{"id": "pyx/0000000", "code": "def filter_strings_by_prefix(list_of_strings, prefix):\n    filtered_strings = []\n    for string in list_of_strings:\n        if string.startswith(prefix):\n            filtered_strings.append(string)\n    return filtered_strings\n", "entry_point": "filter_strings_by_prefix", "input": "['apple', 'apricot', 'banana', 'cherry'], 'ap'", "output": "['apple', 'apricot']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108301_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000001", "code": "def parse_verbosity(vargs):\n    verbosity_levels = {\n        'quiet': 0,\n        'normal': 1,\n        'verbose': 2,\n        'debug': 3\n    }\n    return verbosity_levels.get(vargs, 0)\n", "entry_point": "parse_verbosity", "input": "'invalid'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71548_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000002", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7887", "output": "{1, 33, 3, 2629, 11, 717, 7887, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000003", "code": "# Define a dictionary to store account information\ndatabase = {\n    ('1234', '56789'): {'name': 'John Doe', 'balance': 5000},\n    ('5678', '12345'): {'name': 'Jane Smith', 'balance': 8000}\n}\n# Function to search for account details\ndef buscar_contas(agencia, num_conta):\n    account_key = (agencia, num_conta)\n    if account_key in database:\n        return database[account_key]\n    else:\n        return \"Account not found.\"\n", "entry_point": "buscar_contas", "input": "'0000', '00000'", "output": "'Account not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125941_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000004", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[2, 4, 6]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85102_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000005", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[3, 4, 5, 3, 4]", "output": "'3-4-5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000006", "code": "import string\ndef count_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word.isalpha():\n            unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149842_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000007", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130015_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000008", "code": "def count_consecutive_doubles(s: str) -> int:\n    count = 0\n    for i in range(len(s) - 1):\n        if s[i] == s[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_consecutive_doubles", "input": "'aab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35710_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000009", "code": "def sum_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90391_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000010", "code": "from typing import List, Tuple, Optional\ndef parse_tokens(text: str) -> List[Tuple[str, Optional[str]]]:\n    tokens = []\n    current_token = ''\n    for char in text:\n        if char.isalnum() or char in '._':\n            current_token += char\n        else:\n            if current_token:\n                if current_token.replace('.', '', 1).isdigit():\n                    tokens.append(('FLOAT', current_token))\n                else:\n                    tokens.append(('IDENTIFIER', current_token))\n                current_token = ''\n            if char == '(':\n                tokens.append(('LPAREN', None))\n            elif char == ')':\n                tokens.append(('RPAREN', None))\n            elif char == ',':\n                tokens.append((',', None))\n    if current_token:\n        if current_token.replace('.', '', 1).isdigit():\n            tokens.append(('FLOAT', current_token))\n        else:\n            tokens.append(('IDENTIFIER', current_token))\n    return tokens\n", "entry_point": "parse_tokens", "input": "'r'", "output": "[('IDENTIFIER', 'r')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40570_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000011", "code": "from typing import List\ndef sum_divisible_by_two_and_three(numbers: List[int]) -> int:\n    divisible_sum = 0\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            divisible_sum += num\n    return divisible_sum\n", "entry_point": "sum_divisible_by_two_and_three", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125267_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7576", "output": "{1, 2, 4, 1894, 8, 3788, 947, 7576}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7575", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000013", "code": "def sum_even_numbers(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_even_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51375_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000014", "code": "def check_integer_solution(x, y):\n    denominator = y - x + 1\n    if denominator != 0 and (2 * y + 1 - x) % denominator == 0:\n        return \"YES\"\n    else:\n        return \"NO\"\n", "entry_point": "check_integer_solution", "input": "5, 4", "output": "'NO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110543_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000015", "code": "AUTHORIZED_TOKENS = [\"G<PASSWORD>\", \n                    \"ME<PASSWORD>\", \n                    \"<PASSWORD>\", \n                    \"LK<PASSWORD>\", \n                    \"WATER-104d38\", \n                    \"COLORS-14cff1\"]\nTOKEN_TYPE_U8 = {\"Fungible\" : \"00\",\n                \"NonFungible\" : \"01\", \n                \"SemiFungible\" : \"02\", \n                \"Meta\" : \"03\"}\ndef token_type(token):\n    if any(token.startswith(prefix) for prefix in [\"G\", \"ME\", \"LK\"]) or token.endswith(\"-<6 characters>\"):\n        return \"Fungible\"\n    elif token.startswith(\"<\"):\n        return \"NonFungible\"\n    elif token.startswith(\"WATER-\") or token.startswith(\"COLORS-\"):\n        return \"SemiFungible\"\n    else:\n        return \"Meta\"\n", "entry_point": "token_type", "input": "'TOKEN123'", "output": "'Meta'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68341_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000016", "code": "import ast\ndef extract_imports(code_snippet):\n    imports = {}\n    tree = ast.parse(code_snippet)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports[alias.name] = []\n        elif isinstance(node, ast.ImportFrom):\n            module_name = node.module\n            for alias in node.names:\n                if module_name not in imports:\n                    imports[module_name] = [alias.name]\n                else:\n                    imports[module_name].append(alias.name)\n    return imports\n", "entry_point": "extract_imports", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135956_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000017", "code": "from typing import List\ndef plusOne(digits: List[int]) -> List[int]:\n    n = len(digits)\n    for i in range(n - 1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    return [1] + digits\n", "entry_point": "plusOne", "input": "[9, 9, 9]", "output": "[1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88559_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2949", "output": "{1, 3, 2949, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000019", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "515", "output": "{1, 515, 5, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000020", "code": "def extract_command_and_text(message):\n    # Find the index of the first space after \"!addcom\"\n    start_index = message.find(\"!addcom\") + len(\"!addcom\") + 1\n    # Extract the command by finding the index of the first space after the command\n    end_index_command = message.find(\" \", start_index)\n    command = message[start_index:end_index_command]\n    # Extract the text by finding the index of the first space after the command\n    text = message[end_index_command+1:]\n    return command, text\n", "entry_point": "extract_command_and_text", "input": "'!addcom  rruaaPr'", "output": "('', 'rruaaPr')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33793_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3833", "output": "{1, 3833}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000022", "code": "def sum_divisible_by_num(n):\n    num = 11\n    sum_divisible = 0\n    for i in range(1, n+1):\n        if i % num == 0:\n            sum_divisible += i\n    return sum_divisible\n", "entry_point": "sum_divisible_by_num", "input": "22", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120437_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000023", "code": "def process_data(d):\n    hops = {}\n    for line in d.split(\"\\n\"):\n        try:\n            tokens = line.split()\n            n = int(tokens[0])\n            if tokens[1] == \"*\":\n                ip = \"?\"\n            else:\n                ip = tokens[2].strip(\"(\").strip(\")\")\n            hops[n] = ip\n        except (IndexError, ValueError):\n            # Handle exceptions for cases where tokens are missing or conversion to int fails\n            pass\n    return hops\n", "entry_point": "process_data", "input": "'1 *'", "output": "{1: '?'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40371_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000024", "code": "def sum_even_fibonacci(limit):\n    fib_sequence = [0, 1]\n    sum_even = 0\n    last_fib, current_fib = 0, 1\n    while current_fib <= limit:\n        new_fib = last_fib + current_fib\n        if new_fib % 2 == 0:\n            sum_even += new_fib\n        fib_sequence.append(new_fib)\n        last_fib, current_fib = current_fib, new_fib\n    return sum_even\n", "entry_point": "sum_even_fibonacci", "input": "8", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20263_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000025", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000026", "code": "def sum_even_numbers(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[8, 4, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28367_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000027", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107473_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000028", "code": "def find_lowest(lst):\n    lowest_positive = None\n    for num in lst:\n        if num > 0:\n            if lowest_positive is None or num < lowest_positive:\n                lowest_positive = num\n    return lowest_positive\n", "entry_point": "find_lowest", "input": "[0, -1, -2, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112303_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000029", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    current_max = global_max = nums[0]\n    for num in nums[1:]:\n        current_max = max(num, current_max + num)\n        global_max = max(global_max, current_max)\n    return global_max\n", "entry_point": "max_subarray_sum", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91938_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000030", "code": "from typing import List\ndef count_unique_pairs(nums: List[int], target: int) -> int:\n    seen_pairs = {}\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen_pairs:\n            count += 1\n            del seen_pairs[complement]\n        else:\n            seen_pairs[num] = True\n    return count\n", "entry_point": "count_unique_pairs", "input": "[], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34124_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000031", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[7, 7, 5, 1, 1, 2, 2]", "output": "[7, 7, 5, 1, 1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000032", "code": "from typing import List\ndef calculate_diff(lst: List[int]) -> int:\n    if len(lst) < 2:\n        return 0\n    else:\n        last_two_elements = lst[-2:]\n        return abs(last_two_elements[1] - last_two_elements[0])\n", "entry_point": "calculate_diff", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112649_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8422", "output": "{1, 2, 4211, 8422}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000034", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[5, 3, 2, 9, 3, 2]", "output": "[2, 2, 3, 3, 5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000035", "code": "import ast\ndef count_unique_modules(script: str) -> int:\n    tree = ast.parse(script)\n    unique_modules = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                unique_modules.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            unique_modules.add(node.module.split('.')[0])\n    return len(unique_modules)\n", "entry_point": "count_unique_modules", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135224_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000036", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'<PASSWORD>'", "output": "'d09db0106be9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000037", "code": "def format_output(version: str, default_app_config: str) -> str:\n    version = version if version else '0.0'\n    default_app_config = default_app_config if default_app_config else 'default_config'\n    return f'[{version}] {default_app_config}'\n", "entry_point": "format_output", "input": "'.1.001', 'djsDjjan'", "output": "'[.1.001] djsDjjan'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63589_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000038", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[1, 5, 10]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000039", "code": "def calculate_higher_temperature_hours(tokyo_temps, berlin_temps):\n    if len(tokyo_temps) != len(berlin_temps):\n        raise ValueError(\"Tokyo and Berlin temperature lists must have the same length.\")\n    total_hours = 0\n    for tokyo_temp, berlin_temp in zip(tokyo_temps, berlin_temps):\n        if tokyo_temp > berlin_temp:\n            total_hours += 1\n    return total_hours\n", "entry_point": "calculate_higher_temperature_hours", "input": "[30, 25, 27, 29, 34, 31, 22], [20, 25, 26, 28, 30, 31, 21]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82446_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000040", "code": "from typing import Optional\ndef copy_pin(source_pin_id: str, destination_board_id: str, media_path_or_id: Optional[str]) -> str:\n    # Check if source_pin_id and destination_board_id are valid identifiers\n    if not source_pin_id or not destination_board_id:\n        return \"Invalid source_pin_id or destination_board_id\"\n    # Copy the pin to the destination board\n    try:\n        # Copy logic here\n        if media_path_or_id:\n            return f\"Pin {source_pin_id} copied to board {destination_board_id} with media {media_path_or_id}\"\n        else:\n            return f\"Pin {source_pin_id} copied to board {destination_board_id}\"\n    except Exception as e:\n        return f\"Error copying pin: {str(e)}\"\n", "entry_point": "copy_pin", "input": "'', 'board_123', None", "output": "'Invalid source_pin_id or destination_board_id'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21308_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000041", "code": "from typing import List\ndef count_unique_elements(input_list: List[int]) -> int:\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    return len(unique_elements)\n", "entry_point": "count_unique_elements", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76708_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000042", "code": "def isLongPressedName(name, typed):\n    idx = 0\n    for i in range(len(typed)):\n        if idx < len(name) and name[idx] == typed[i]:\n            idx += 1\n        elif i == 0 or typed[i] != typed[i-1]:\n            return False\n    return idx == len(name)\n", "entry_point": "isLongPressedName", "input": "'alex', 'aalexba'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105526_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000043", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'1.13.0'", "output": "'1.13.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45821_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000044", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[3, 3, 3]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000045", "code": "import os\ndef calculate_total_size(file_paths):\n    total_size = 0\n    for path in file_paths:\n        if os.path.isfile(path):\n            total_size += os.path.getsize(path)\n        elif os.path.isdir(path):\n            sub_files = [os.path.join(path, f) for f in os.listdir(path)]\n            total_size += calculate_total_size(sub_files)\n    return total_size\n", "entry_point": "calculate_total_size", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99675_ipt119", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000046", "code": "def count_unique_words(text: str) -> int:\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Create a set to store unique words\n    unique_words = set()\n    # Iterate through words and add them to the set\n    for word in words:\n        # Remove punctuation marks from the word\n        word = ''.join(char for char in word if char.isalnum())\n        unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'Apple apple! Banana banana. Cherry, cherry'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67804_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000047", "code": "def dummy(n):\n    total_sum = sum(range(1, n + 1))\n    return total_sum\n", "entry_point": "dummy", "input": "991", "output": "491536", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124894_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000048", "code": "def passes_blacklist(sql: str) -> bool:\n    forbidden_keywords = {'delete', 'drop'}\n    sql_lower = sql.lower()\n    for keyword in forbidden_keywords:\n        if keyword in sql_lower:\n            return False\n    return True\n", "entry_point": "passes_blacklist", "input": "'SELECT * FROM users WHERE id = 1; DELETE FROM users;'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86148_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000049", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[1, 3, 3, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000050", "code": "def reverse_words_in_quotes(input_string: str) -> str:\n    result = \"\"\n    in_quotes = False\n    current_word = \"\"\n    for char in input_string:\n        if char == '\"':\n            if in_quotes:\n                result += current_word[::-1]\n                current_word = \"\"\n            in_quotes = not in_quotes\n            result += '\"'\n        elif in_quotes:\n            if char == ' ':\n                result += current_word[::-1] + ' '\n                current_word = \"\"\n            else:\n                current_word += char\n        else:\n            result += char\n    return result\n", "entry_point": "reverse_words_in_quotes", "input": "'\"Hello World\"'", "output": "'\"olleH dlroW\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35334_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000051", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "18", "output": "1597", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000052", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n+1):\n        line = [str(num) for num in range(1, i+1)]\n        line += ['*'] * (i-1)\n        line += [str(num) for num in range(i, 0, -1)]\n        pattern.append(''.join(line))\n    return pattern\n", "entry_point": "generate_pattern", "input": "3", "output": "['11', '12*21', '123**321']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29714_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000053", "code": "def sum_multiples_of_3_and_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_and_5", "input": "[15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57828_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000054", "code": "# Constants representing baud rates\nbaud_rates = {\n    600: -1,\n    1200: 1200,\n    1800: -1,\n    2400: 2400,\n    4800: 4800,\n    9600: 9600,\n    14400: -1,\n    19200: 19200,\n    38400: 38400,\n    56000: -1,\n    57600: 57600,\n    76800: -1,\n    115200: 115200,\n    128000: -1,\n    256000: -1\n}\ndef is_valid_baud_rate(baud_rate: int) -> bool:\n    return baud_rate in baud_rates and baud_rates[baud_rate] != -1\n", "entry_point": "is_valid_baud_rate", "input": "600", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36946_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000055", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 10, 20, 30]", "output": "[1, 1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111970_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000056", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000057", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "359", "output": "{1, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000058", "code": "from typing import List\ndef search_rotated_list(nums: List[int], target: int) -> bool:\n    start, end = 0, len(nums) - 1\n    while start <= end:\n        mid = (start + end) // 2\n        if nums[mid] == target:\n            return True\n        if nums[start] == nums[mid] == nums[end]:\n            start += 1\n            end -= 1\n        elif nums[start] <= nums[mid]:\n            if nums[start] <= target < nums[mid]:\n                end = mid - 1\n            else:\n                start = mid + 1\n        else:\n            if nums[mid] < target <= nums[end]:\n                start = mid + 1\n            else:\n                end = mid - 1\n    return False\n", "entry_point": "search_rotated_list", "input": "[1, 1, 1, 1, 2, 3, 1], 4", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130071_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000059", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 7, 2, 1]", "output": "[3, 8, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000060", "code": "import ast\ndef extract_imported_modules(code):\n    tree = ast.parse(code)\n    imported_modules = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imported_modules.add(alias.name)\n        elif isinstance(node, ast.ImportFrom):\n            module = node.module\n            if module is not None:\n                imported_modules.add(module)\n    # Filter out built-in modules\n    built_in_modules = set(dir(__builtins__))\n    imported_modules = [module for module in imported_modules if module not in built_in_modules]\n    return list(imported_modules)\n", "entry_point": "extract_imported_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147931_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9498", "output": "{1, 2, 3, 6, 4749, 1583, 9498, 3166}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000062", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[5, 5, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000063", "code": "def compare_versions(version1, version2):\n    v1 = list(map(int, version1.split('.')))\n    v2 = list(map(int, version2.split('.')))\n    n = max(len(v1), len(v2))\n    for i in range(n):\n        num1 = v1[i] if i < len(v1) else 0\n        num2 = v2[i] if i < len(v2) else 0\n        if num1 < num2:\n            return -1\n        elif num1 > num2:\n            return 1\n    return 0\n", "entry_point": "compare_versions", "input": "'1.0', '2.0'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145763_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000064", "code": "import re\nfrom collections import Counter\ndef find_most_common_words(text, n):\n    # Preprocess the text by converting to lowercase and removing punctuation\n    text = re.sub(r'[^\\w\\s]', '', text.lower())\n    # Tokenize the text into individual words\n    words = text.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Sort the words based on frequencies and alphabetical order\n    most_common_words = sorted(word_freq.items(), key=lambda x: (-x[1], x[0]))\n    # Return the n most common words\n    return most_common_words[:n]\n", "entry_point": "find_most_common_words", "input": "'', 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74047_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000065", "code": "from typing import List\ndef filter_by_percentage(input_list: List[int], percentage: float) -> List[int]:\n    if not input_list:\n        return []\n    max_value = max(input_list)\n    threshold = max_value * (percentage / 100)\n    filtered_list = [num for num in input_list if num >= threshold]\n    return filtered_list\n", "entry_point": "filter_by_percentage", "input": "[30, 20, 41, 31, 19, 41], 46", "output": "[30, 20, 41, 31, 19, 41]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19265_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000066", "code": "def count_players(scores, target):\n    left, right = 0, len(scores) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if scores[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return len(scores) - left\n", "entry_point": "count_players", "input": "[1.0, 2.0, 3.0, 5.0, 5.5, 6.0], 5.0", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83762_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000067", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the period as the delimiter\n    version_parts = version_string.split('.')\n    # Convert the split parts into integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return the major, minor, and patch version numbers as a tuple\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.12.1'", "output": "(0, 12, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81674_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000068", "code": "import math\ndef calculate_sin(x):\n    \"\"\"\n    Calculate the sine of the input angle x in radians.\n    Args:\n    x (float): Angle in radians\n    Returns:\n    float: Sine of the input angle x\n    \"\"\"\n    return math.sin(x)\n", "entry_point": "calculate_sin", "input": "math.pi / 2", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88101_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000069", "code": "def sort_tuples(array):\n    return sorted(array, key=lambda x: x[1])\n", "entry_point": "sort_tuples", "input": "[(1, 'A'), (2, 'B'), (3, 'C')]", "output": "[(1, 'A'), (2, 'B'), (3, 'C')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36118_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000070", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[10, 11, 12, 13, 17]", "output": "12.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000071", "code": "def min_edit_distance(source, target):\n    slen, tlen = len(source), len(target)\n    dist = [[0 for _ in range(tlen+1)] for _ in range(slen+1)]\n    for i in range(slen+1):\n        dist[i][0] = i\n    for j in range(tlen+1):\n        dist[0][j] = j\n    for i in range(slen):\n        for j in range(tlen):\n            cost = 0 if source[i] == target[j] else 1\n            dist[i+1][j+1] = min(\n                dist[i][j+1] + 1,   # deletion\n                dist[i+1][j] + 1,   # insertion\n                dist[i][j] + cost   # substitution\n            )\n    return dist[-1][-1]\n", "entry_point": "min_edit_distance", "input": "'cat', 'caterpillar'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126361_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000072", "code": "def max_subarray_sum(arr):\n    max_ending_here = max_so_far = arr[0]\n    for num in arr[1:]:\n        max_ending_here = max(num, max_ending_here + num)\n        max_so_far = max(max_so_far, max_ending_here)\n    return max_so_far\n", "entry_point": "max_subarray_sum", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90891_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000073", "code": "def replace_aliases(aliases, sentence):\n    words = sentence.split()\n    for i in range(len(words)):\n        if words[i] in aliases:\n            if (i == 0 or not words[i-1].isalpha()) and (i == len(words)-1 or not words[i+1].isalpha()):\n                words[i] = \"with\"  # Replace the alias with its full form\n    return ' '.join(words)\n", "entry_point": "replace_aliases", "input": "{}, 'ydyotttt'", "output": "'ydyotttt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59875_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000074", "code": "import os\ndef list_files(directory):\n    file_paths = []\n    if os.path.isdir(directory):\n        for item in os.listdir(directory):\n            item_path = os.path.join(directory, item)\n            if os.path.isfile(item_path):\n                file_paths.append(item_path)\n            elif os.path.isdir(item_path):\n                file_paths.extend(list_files(item_path))\n    return file_paths\n", "entry_point": "list_files", "input": "'/path/to/non/existent/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97277_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000075", "code": "from collections import namedtuple\n# Mock Feature class for demonstration purposes\nFeature = namedtuple('Feature', ['uniquename', 'species'])\nfeatures = [\n    Feature('human', 'homo_sapiens'),\n    Feature('dog', 'canis_lupus_familiaris'),\n    Feature('cat', 'felis_catus')\n]\ndef species(name):\n    try:\n        feat = next(feat for feat in features if feat.uniquename == name)\n        species_ = feat.species\n    except StopIteration:\n        species_ = 'Unknown'\n    return species_.replace('_', ' ').capitalize()\n", "entry_point": "species", "input": "'fish'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77432_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000076", "code": "def fibonacci_sequence(n):\n    fib_sequence = [0, 1]\n    while len(fib_sequence) < n:\n        next_num = fib_sequence[-1] + fib_sequence[-2]\n        fib_sequence.append(next_num)\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "3", "output": "[0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52360_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000077", "code": "def check_pairing(d_1, d_2):\n    values_1 = list(d_1.values())\n    values_2 = list(d_2.values())\n    for index, value in enumerate(values_1):\n        for index_2, value_2 in enumerate(values_2):\n            if value == value_2:\n                values_1[index] = -1\n                values_2[index_2] = -1\n                break\n        else:\n            return False\n    for index, value in enumerate(values_2):\n        if value != -1:\n            return False\n    return True\n", "entry_point": "check_pairing", "input": "{'a': 1, 'b': 2}, {'x': 2, 'y': 3}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104907_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000078", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'w or'", "output": "{'w': 1, 'o': 1, 'r': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24606_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000079", "code": "def sum_even_numbers(lst):\n    total = 0\n    for item in lst:\n        if isinstance(item, int) and item % 2 == 0:\n            total += item\n        elif isinstance(item, list):\n            total += sum_even_numbers(item)\n    return total\n", "entry_point": "sum_even_numbers", "input": "[1, [2, 4], 3, [6]]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88801_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000080", "code": "def longest_pressed_key(releaseTimes, keysPressed):\n    longest = releaseTimes[0]\n    slowestKey = keysPressed[0]\n    for i in range(1, len(releaseTimes)):\n        cur = releaseTimes[i] - releaseTimes[i-1]\n        if cur > longest or (cur == longest and keysPressed[i] > slowestKey):\n            longest = cur\n            slowestKey = keysPressed[i]\n    return slowestKey\n", "entry_point": "longest_pressed_key", "input": "[1, 2, 4, 6], ['a', 'b', 'a', 'b']", "output": "'b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129234_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000081", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[1, 5, 3, 2, 5, 4, 2]", "output": "[5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000082", "code": "def longest_common_subsequence(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m):\n        for j in range(n):\n            if s1[i] == s2[j]:\n                dp[i + 1][j + 1] = dp[i][j] + 1\n            else:\n                dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "'', ''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1697_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000083", "code": "def find_missing_number(nums):\n    n = len(nums)\n    expected_sum = (n * (n + 1)) // 2\n    actual_sum = sum(nums)\n    if expected_sum != actual_sum:\n        return expected_sum - actual_sum\n    return -1\n", "entry_point": "find_missing_number", "input": "list(range(35))[:-1]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115210_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000084", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'mtthmmtm/', 'ap//data'", "output": "'mtthmmtm/ap//data'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1435", "output": "{1, 35, 5, 7, 41, 205, 1435, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000086", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[1000, 800, 300], 600", "output": "1800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000087", "code": "import math\ndef euclidean_distance(point1, point2):\n    if not isinstance(point1, tuple) or not isinstance(point2, tuple) or len(point1) != 2 or len(point2) != 2:\n        raise ValueError(\"Both inputs must be tuples of length 2\")\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(0, 0), (3, 4)", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13433_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000088", "code": "from typing import List\ndef average_absolute_differences(list1: List[int], list2: List[int]) -> float:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    absolute_diffs = [abs(x - y) for x, y in zip(list1, list2)]\n    average_diff = sum(absolute_diffs) / len(absolute_diffs)\n    return round(average_diff, 4)  # Rounding to 4 decimal places\n", "entry_point": "average_absolute_differences", "input": "[1], [4.8]", "output": "3.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72862_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000089", "code": "def max_product(nums):\n    max1 = float('-inf')\n    max2 = float('-inf')\n    min1 = float('inf')\n    min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, max1 * min1)\n", "entry_point": "max_product", "input": "[5, 6, -1, -2]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14792_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000090", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[[10], [15, 13]]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000091", "code": "def detect_file_type(filename):\n    if filename[-3:] == 'csv':\n        return 'csv'\n    elif filename[-4:] in ['xlsx', 'xls']:\n        return 'excel'\n    else:\n        return 'autre'\n", "entry_point": "detect_file_type", "input": "'file.txt'", "output": "'autre'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149095_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000092", "code": "def convert_to_json(o):\n    if isinstance(o, (list, tuple)):\n        return [convert_to_json(oo) for oo in o]\n    if hasattr(o, 'to_json'):\n        return o.to_json()\n    if callable(o):\n        comps = [o.__module__] if o.__module__ != 'builtins' else []\n        if type(o) == type(convert_to_json):\n            comps.append(o.__name__)\n        else:\n            comps.append(o.__class__.__name__)\n        res = '.'.join(comps)\n        if type(o) == type(convert_to_json):\n            return res\n        return {'class': res}\n    return o\n", "entry_point": "convert_to_json", "input": "124", "output": "124", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112833_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000093", "code": "def construct_target_url(url: str, host: str) -> str:\n    if url != '/':\n        return ''\n    domain = host + ':9001' if ':9001' not in host else host\n    target = 'http://' + domain + '/RPC2'\n    return target\n", "entry_point": "construct_target_url", "input": "'abc', 'localhost'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99855_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000094", "code": "import re\nBIGQUERY_TABLE_FORMAT = re.compile(r'([\\w.:-]+:)?\\w+\\.\\w+$')\nGCS_URI_FORMAT = re.compile(r'gs://[\\w.-]+/[\\w/.-]+$')\ndef validate_input(input_str, input_type):\n    if input_type == \"bq_table\":\n        return bool(BIGQUERY_TABLE_FORMAT.match(input_str))\n    elif input_type == \"gcs_uri\":\n        return bool(GCS_URI_FORMAT.match(input_str))\n    else:\n        raise ValueError(\"Invalid input_type. Supported types are 'bq_table' and 'gcs_uri'.\")\n", "entry_point": "validate_input", "input": "'my_project:my_dataset.my_table', 'bq_table'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113681_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000095", "code": "import json\ndef parse_mapping(mapping):\n    try:\n        mapping_dict = json.loads(mapping)\n        properties = mapping_dict.get('mappings', {}).get('properties', {})\n        field_types = {field: details.get('type') for field, details in properties.items()}\n        return field_types\n    except json.JSONDecodeError as e:\n        print(f\"Error parsing mapping: {e}\")\n        return {}\n", "entry_point": "parse_mapping", "input": "'invalid json'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49272_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4504", "output": "{1, 2, 4, 1126, 8, 2252, 563, 4504}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4503", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000097", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8179", "output": "{1, 8179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000098", "code": "def calculate_depth(lst):\n    max_depth = 1\n    for element in lst:\n        if isinstance(element, list):\n            max_depth = max(max_depth, 1 + calculate_depth(element))\n    return max_depth\n", "entry_point": "calculate_depth", "input": "[]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126067_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000099", "code": "def check_deletion(N, before, after):\n    if N % 2 == 0:\n        return \"Deletion succeeded\" if before[::2] == after else \"Deletion failed\"\n    else:\n        diff_count = sum(1 for i in range(N) if i < len(after) and before[i] != after[i])\n        return \"Deletion succeeded\" if diff_count == 1 else \"Deletion failed\"\n", "entry_point": "check_deletion", "input": "4, [1, 2, 3, 4], [1, 3]", "output": "'Deletion succeeded'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53001_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000100", "code": "def exam_grade(score):\n    if score < 0 or score > 100:\n        return \"Invalid Score\"\n    elif score >= 90:\n        return \"Top Score\"\n    elif score >= 60:\n        return \"Pass\"\n    else:\n        return \"Fail\"\n", "entry_point": "exam_grade", "input": "-1", "output": "'Invalid Score'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64122_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000101", "code": "def longest_common_prefix(str1: str, str2: str) -> str:\n    prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            prefix += str1[i]\n        else:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "'', 'hello'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106464_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000102", "code": "def max_profit(stock_prices):\n    if not stock_prices:\n        return 0\n    min_price = float('inf')\n    max_profit = 0\n    for price in stock_prices:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "max_profit", "input": "[5, 7, 8]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136190_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5639", "output": "{1, 5639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000104", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5509", "output": "{1, 787, 5509, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000105", "code": "from typing import List\ndef count_pairs_with_sum(nums: List[int], target_sum: int) -> int:\n    num_freq = {}\n    pairs_count = 0\n    for num in nums:\n        complement = target_sum - num\n        if complement in num_freq:\n            pairs_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pairs_count\n", "entry_point": "count_pairs_with_sum", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149634_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000106", "code": "def format_sequences(seq_sp):\n    formatted_seqs = []\n    for i, seq_dict in enumerate(seq_sp):\n        formatted_seq = f\"{i}:{seq_dict['seq']}\"\n        formatted_seqs.append(formatted_seq)\n    return formatted_seqs\n", "entry_point": "format_sequences", "input": "[{'seq': 'GC'}]", "output": "['0:GC']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86340_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000107", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "76, 0, 10", "output": "-414.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000108", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[4, 3, 3, 4, 3, 3]", "output": "[7, 6, 7, 7, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000109", "code": "import re\ndef validate_url(url):\n    # Check if the URL starts with 'http://' or 'https://'\n    if not url.startswith('http://') and not url.startswith('https://'):\n        return False\n    # Extract the domain name from the URL\n    domain = re.search(r'https?://([A-Za-z0-9.-]+)', url)\n    if domain:\n        domain = domain.group(1)\n    else:\n        return False\n    # Validate the domain name against the specified rules\n    if not re.match(r'^[A-Za-z0-9.-]+$', domain):\n        return False\n    if domain.count('.') < 1:\n        return False\n    if any(char.isspace() for char in url):\n        return False\n    return True\n", "entry_point": "validate_url", "input": "'ftp://example.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90770_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000110", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[10, 12, 14, 16]", "output": "208", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000111", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(8, 8, 8)", "output": "729", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000112", "code": "import ast\ndef find_html_redirect_routes(flask_code):\n    routes = []\n    tree = ast.parse(flask_code)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef) and node.name == 'html_redirect':\n            parent_node = node.parent\n            if isinstance(parent_node, ast.Call):\n                for arg in parent_node.args:\n                    if isinstance(arg, ast.Str):\n                        target_url = arg.s\n                        if isinstance(parent_node.func, ast.Attribute) and parent_node.func.attr == 'route':\n                            route_url = parent_node.func.value.s\n                            routes.append((route_url, target_url))\n    return routes\n", "entry_point": "find_html_redirect_routes", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137280_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000113", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[240, 240], 64", "output": "512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000114", "code": "import os\ndef make_list(dataset_path):\n    train_list = []\n    validation_list = []\n    for root, dirs, files in os.walk(dataset_path):\n        for file in files:\n            if 'train' in root:\n                train_list.append(os.path.join(root, file))\n            elif 'validation' in root:\n                validation_list.append(os.path.join(root, file))\n    return train_list, validation_list\n", "entry_point": "make_list", "input": "'/empty_directory'", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103278_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000115", "code": "def get_requirements(python_version):\n    requirements = ['cffi>=1.11.5', 'six>=1.11.0']\n    if python_version < '3.4':\n        requirements.append('enum34')\n    return requirements\n", "entry_point": "get_requirements", "input": "'3.3'", "output": "['cffi>=1.11.5', 'six>=1.11.0', 'enum34']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145684_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000116", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "None, None, '0.9.3'", "output": "'0.9.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000117", "code": "from typing import Dict\nunits: Dict[str, int] = {\n    \"cryptodoge\": 10 ** 6,\n    \"mojo\": 1,\n    \"colouredcoin\": 10 ** 3,\n}\ndef convert_mojos_to_unit(amount: int, target_unit: str) -> float:\n    if target_unit in units:\n        conversion_factor = units[target_unit]\n        converted_amount = amount / conversion_factor\n        return converted_amount\n    else:\n        return f\"Conversion to {target_unit} is not supported.\"\n", "entry_point": "convert_mojos_to_unit", "input": "100, 'ccoc'", "output": "'Conversion to ccoc is not supported.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24392_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000118", "code": "import importlib\ndef extract_colors(module_name):\n    try:\n        module = importlib.import_module(module_name)\n        color_constants = [attr for attr in dir(module) if isinstance(getattr(module, attr), str) and attr.isupper()]\n        return color_constants\n    except (ModuleNotFoundError, AttributeError):\n        return []\n", "entry_point": "extract_colors", "input": "'non_existent_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66438_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000119", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "8", "output": "'oh la laoh la laoh la laoh la la'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000120", "code": "def password_strength_checker(password: str) -> int:\n    score = 0\n    # Length points\n    score += len(password)\n    # Uppercase and lowercase letters\n    if any(c.isupper() for c in password) and any(c.islower() for c in password):\n        score += 5\n    # Digit present\n    if any(c.isdigit() for c in password):\n        score += 5\n    # Special character present\n    special_chars = set(\"!@#$%^&*()_+-=[]{}|;:,.<>?\")\n    if any(c in special_chars for c in password):\n        score += 10\n    # Bonus points for pairs\n    for i in range(len(password) - 1):\n        if password[i].lower() == password[i + 1].lower() and password[i] != password[i + 1]:\n            score += 2\n    return score\n", "entry_point": "password_strength_checker", "input": "'abcd'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139577_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000121", "code": "import re\ndef extract_variables(query):\n    # Regular expression pattern to match variables in SPARQL query\n    pattern = r'\\?[\\w]+'\n    # Find all matches of variables in the query\n    variables = re.findall(pattern, query)\n    # Return a list of distinct variables\n    return list(set(variables))\n", "entry_point": "extract_variables", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16424_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000122", "code": "import re\n# Provided stopwords set\nstopwords = set([\"thank\", \"you\", \"the\", \"please\", \"me\", \"her\", \"his\", \"will\", \"just\", \"myself\", \"ourselves\", \"I\", \"yes\"])\n# Provided regular expression pattern for splitting\nspliter = re.compile(\"([#()!><])\")\ndef process_text(text):\n    tokens = []\n    for token in spliter.split(text):\n        token = token.strip()\n        if token and token not in stopwords:\n            tokens.append(token)\n    return tokens\n", "entry_point": "process_text", "input": "'say'", "output": "['say']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45433_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000123", "code": "def max_subarray_sum(arr):\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[5, 6, 4, 8, -1, -2]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54730_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000124", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454398", "output": "'<t:1630454398>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000125", "code": "from typing import List\ndef play_card_game(deck: List[int]) -> str:\n    player1_sum = 0\n    player2_sum = 0\n    for i, card in enumerate(deck):\n        if i % 2 == 0:\n            player1_sum += card\n        else:\n            player2_sum += card\n    if player1_sum > player2_sum:\n        return \"Player 1\"\n    elif player2_sum > player1_sum:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "play_card_game", "input": "[10, 1, 1]", "output": "'Player 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47107_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000126", "code": "import os\ndef count_valid_lines_of_code(directory):\n    total_lines = 0\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.endswith(\".py\"):\n                file_path = os.path.join(root, file)\n                with open(file_path, 'r') as f:\n                    for line in f:\n                        line = line.strip()\n                        if line and not line.startswith(\"#\"):\n                            total_lines += 1\n    return total_lines\n", "entry_point": "count_valid_lines_of_code", "input": "'/path/to/empty/directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24821_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000127", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[8, 6, 5, 4, 3]", "output": "(8, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000128", "code": "from datetime import datetime, timedelta\ndef generate_dates(start_date, num_days):\n    dates_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days + 1):\n        dates_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return dates_list\n", "entry_point": "generate_dates", "input": "'2019-12-02', 1", "output": "['2019-12-02', '2019-12-03']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127239_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000129", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'add rax, [rbx+r150xadd'", "output": "'add add rax, [rbx+r150xadd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000130", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'COLON epr COLON::'", "output": "('COLON epr COLON', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000131", "code": "import re\nLANDSAT_TILE_REGEX = \"(L)(C|O|T|E)(7|8|5|4)(\\d{3})(\\d{3})(\\d{7})(\\w{3})(\\d{2})\"\nLANDSAT_SHORT_REGEX = \"(L)(C|O|T|E)(7|8|5|4)(\\d{3})(\\d{3})(\\d{7})\"\nMODIS_TILE_REGEX = \"(M)(Y|O)(D)(\\d{2})(G|Q|A)(\\w{1}|\\d{1}).(A\\d{7}).(h\\d{2}v\\d{2}).(\\d{3}).(\\d{13})\"\nLANDSAT_PRODUCTS = [\"oli8\", \"tm4\", \"tm5\", \"etm7\", \"olitirs8\"]\ndef validate_product_id(product_id: str) -> str:\n    landsat_tile_pattern = re.compile(LANDSAT_TILE_REGEX)\n    landsat_short_pattern = re.compile(LANDSAT_SHORT_REGEX)\n    modis_pattern = re.compile(MODIS_TILE_REGEX)\n    if landsat_tile_pattern.match(product_id) or landsat_short_pattern.match(product_id):\n        return \"Valid Landsat Product ID\"\n    elif modis_pattern.match(product_id):\n        return \"Valid MODIS Product ID\"\n    else:\n        return \"Invalid Product ID\"\n", "entry_point": "validate_product_id", "input": "'XYZ1234567'", "output": "'Invalid Product ID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103922_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000132", "code": "def count_unique_evens(lst):\n    unique_evens = set()\n    for num in lst:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_evens", "input": "[2, 4, 6, 8]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89922_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000133", "code": "def calculate_dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        return \"Error: Vectors must have the same length.\"\n    dot_product = sum(x * y for x, y in zip(vector1, vector2))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 2], [3, 4, 5]", "output": "'Error: Vectors must have the same length.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123253_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000134", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha():  # Consider only alphabetic characters\n            unique_chars.add(char.lower())  # Consider both uppercase and lowercase as same character\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'AabcBDd'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32307_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000135", "code": "def check_parentheses(input_formula, n):\n    def recognize(input_formula):\n        stack = []\n        for char in input_formula:\n            if char == '(':\n                stack.append(char)\n            elif char == ')':\n                if not stack:\n                    return False\n                stack.pop()\n        return not stack\n    len_input = len(input_formula) // 2\n    if recognize(input_formula):\n        return len_input == n\n    return False\n", "entry_point": "check_parentheses", "input": "'(())(', 2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11414_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000136", "code": "import re\ndef extract_table_names(migration_script):\n    table_names = []\n    upgrade_tables = re.findall(r\"op\\.create_table\\('(\\w+)'\", migration_script)\n    downgrade_tables = re.findall(r\"op\\.drop_table\\('(\\w+)'\", migration_script)\n    table_names.extend(upgrade_tables)\n    table_names.extend(downgrade_tables)\n    return table_names\n", "entry_point": "extract_table_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119928_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000137", "code": "import re\n# Provided stopwords set\nstopwords = set([\"thank\", \"you\", \"the\", \"please\", \"me\", \"her\", \"his\", \"will\", \"just\", \"myself\", \"ourselves\", \"I\", \"yes\"])\n# Provided regular expression pattern for splitting\nspliter = re.compile(\"([#()!><])\")\ndef process_text(text):\n    tokens = []\n    for token in spliter.split(text):\n        token = token.strip()\n        if token and token not in stopwords:\n            tokens.append(token)\n    return tokens\n", "entry_point": "process_text", "input": "'Plaease'", "output": "['Plaease']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45433_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000138", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0.00\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 84]", "output": "84.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122959_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000139", "code": "from typing import List, Dict, Any\ndef count_unique_values(json_data: List[Dict[str, Any]], column_name: str) -> Dict[str, int]:\n    unique_values_count = {}\n    for data_entry in json_data:\n        column_value = data_entry.get(column_name)\n        if column_value:\n            unique_values_count[column_value] = unique_values_count.get(column_value, 0) + 1\n    return unique_values_count\n", "entry_point": "count_unique_values", "input": "[], 'some_column'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112569_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000140", "code": "import re\ndef extract_years(text):\n    year_pattern = r'\\b\\d{4}\\b'  # Regular expression pattern to match four-digit numbers\n    years = re.findall(year_pattern, text)\n    unique_years = set()\n    for year in years:\n        year_num = int(year)\n        if 1000 <= year_num <= 9999:\n            unique_years.add(year_num)\n    return list(unique_years)\n", "entry_point": "extract_years", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56437_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000141", "code": "def count_unique_amino_acids(sequence):\n    unique_amino_acids = set()\n    for amino_acid in sequence:\n        if amino_acid.isalpha():  # Check if the character is an alphabet\n            unique_amino_acids.add(amino_acid)\n    return len(unique_amino_acids)\n", "entry_point": "count_unique_amino_acids", "input": "'ABCDEF'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31328_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000142", "code": "def pangrams(s):\n    alphabet_set = set()\n    for char in s:\n        if char.isalpha():\n            alphabet_set.add(char.lower())\n    if len(alphabet_set) == 26:\n        return \"pangram\"\n    else:\n        return \"not pangram\"\n", "entry_point": "pangrams", "input": "'Hello World!'", "output": "'not pangram'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111312_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000143", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'aabbc'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134446_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1772", "output": "{1, 2, 4, 1772, 886, 443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1771", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000145", "code": "def sum_multiples_3_5(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "14", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55402_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000146", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[5, 2, 6, 1], 2", "output": "[6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000147", "code": "from typing import List\ndef count_pairs_with_sum(arr: List[int], target: int) -> int:\n    num_count = {}\n    pair_count = 0\n    for num in arr:\n        diff = target - num\n        if diff in num_count:\n            pair_count += num_count[diff]\n        num_count[num] = num_count.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_with_sum", "input": "[1, 1, 3], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126849_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000148", "code": "def trap_water(walls):\n    left, right = 0, len(walls) - 1\n    left_max = right_max = water_trapped = 0\n    while left <= right:\n        if walls[left] <= walls[right]:\n            left_max = max(left_max, walls[left])\n            water_trapped += max(0, left_max - walls[left])\n            left += 1\n        else:\n            right_max = max(right_max, walls[right])\n            water_trapped += max(0, right_max - walls[right])\n            right -= 1\n    return water_trapped\n", "entry_point": "trap_water", "input": "[0, 2, 0, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50098_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000149", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kirjakauppa.fi/125'", "output": "'http://kirjakauppa.fi/125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000150", "code": "def sum_multiples_of_3_and_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_and_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101242_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000151", "code": "from typing import List\ndef sum_of_squares_of_evens(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[14]", "output": "196", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36404_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000152", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[1] * 57, 1", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000153", "code": "import ast\ndef extract_info_from_script(script_content):\n    version = None\n    description = None\n    # Parse the script content as an abstract syntax tree\n    tree = ast.parse(script_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign):\n            for target in node.targets:\n                if isinstance(target, ast.Name):\n                    if target.id == 'VERSION':\n                        version = ast.literal_eval(node.value)\n                    elif target.id == 'description':\n                        description = ast.literal_eval(node.value)\n    return {\n        \"version\": version,\n        \"description\": description\n    }\n", "entry_point": "extract_info_from_script", "input": "''", "output": "{'version': None, 'description': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39803_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000154", "code": "def count_imported_modules(code_snippet):\n    import re\n    import_pattern = r'import\\s+(\\S+)'\n    from_pattern = r'from\\s+(\\S+)\\s+import'\n    imports = re.findall(import_pattern, code_snippet)\n    from_imports = re.findall(from_pattern, code_snippet)\n    all_modules = imports + from_imports\n    module_counts = {}\n    for module in all_modules:\n        module_counts[module] = module_counts.get(module, 0) + 1\n    return module_counts\n", "entry_point": "count_imported_modules", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119995_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000155", "code": "import ast\nfrom collections import Counter\ndef analyze_imports(code_snippet):\n    tree = ast.parse(code_snippet)\n    imports = [node for node in ast.walk(tree) if isinstance(node, ast.Import) or isinstance(node, ast.ImportFrom)]\n    imported_modules = []\n    for imp in imports:\n        if isinstance(imp, ast.Import):\n            imported_modules.extend(alias.name for alias in imp.names)\n        elif isinstance(imp, ast.ImportFrom):\n            imported_modules.append(imp.module)\n    unique_modules = set(imported_modules)\n    total_imports = len(imported_modules)\n    return {'unique_modules_count': len(unique_modules), 'total_imports': total_imports}\n", "entry_point": "analyze_imports", "input": "''", "output": "{'unique_modules_count': 0, 'total_imports': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149827_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000156", "code": "def max_profit(prices):\n    if not prices:\n        return 0\n    min_price = prices[0]\n    max_profit = 0\n    for price in prices[1:]:\n        potential_profit = price - min_price\n        max_profit = max(max_profit, potential_profit)\n        min_price = min(min_price, price)\n    return max_profit\n", "entry_point": "max_profit", "input": "[2, 3, 5, 10]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149592_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000157", "code": "import re\ndef count_imports(script):\n    import_counts = {}\n    import_modules = re.findall(r'import\\s+(\\w+)|from\\s+(\\w+)\\s+import', script)\n    for module_tuple in import_modules:\n        module = module_tuple[0] if module_tuple[0] else module_tuple[1]\n        import_counts[module] = import_counts.get(module, 0) + 1\n    return import_counts\n", "entry_point": "count_imports", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75460_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5667", "output": "{3, 1, 5667, 1889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000159", "code": "import re\ndef extract_series_info(html_data):\n    episodes = []\n    patron = r'<a\\s*rel=\"nofollow\" href=\"([^\"]+)\"[^>]+> <img\\s*.*?src=\"([^\"]+)\"[^>]+>[^>]+>([^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<[^>]+>'\n    matches = re.compile(patron, re.DOTALL).findall(html_data)\n    for index, match in enumerate(matches, start=1):\n        episode_info = {\n            'series_title': 'streamondemand-pureita',\n            'image_url': match[1],\n            'episode_title': match[2],\n            'episode_number': str(index)\n        }\n        episodes.append(episode_info)\n    return episodes\n", "entry_point": "extract_series_info", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101512_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000160", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2123", "output": "{11, 1, 2123, 193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000161", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(len(lst) - 1):\n        total_diff += abs(lst[i] - lst[i + 1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 14, 28]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132641_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000162", "code": "from typing import List\ndef max_profit(prices: List[int]) -> int:\n    if not prices:\n        return 0\n    min_price = float('inf')\n    max_profit = 0\n    for price in prices:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "max_profit", "input": "[1, 2, 3, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107200_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000163", "code": "def find_basement_position(input_str):\n    floor = 0\n    for idx, char in enumerate(input_str):\n        if char == \"(\":\n            floor += 1\n        elif char == \")\":\n            floor -= 1\n        if floor == -1:\n            return idx + 1\n    return -1\n", "entry_point": "find_basement_position", "input": "'((('", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129859_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000164", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[0, 1, 2, 3, -1]", "output": "[0, 1, 1, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000165", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[8, 10], 18", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000166", "code": "from typing import List\ndef count_unique_numbers(nums: List[int]) -> int:\n    unique_numbers = set()\n    for num in nums:\n        unique_numbers.add(num)\n    return len(unique_numbers)\n", "entry_point": "count_unique_numbers", "input": "[1, 2, 2, 3, 4, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120342_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000167", "code": "def validate_expression(expression: str) -> bool:\n    stack = []\n    bracket_map = {')': '(', ']': '[', '}': '{'}\n    for char in expression:\n        if char in bracket_map.values():\n            stack.append(char)\n        elif char in bracket_map.keys():\n            if not stack or bracket_map[char] != stack.pop():\n                return False\n    return not stack\n", "entry_point": "validate_expression", "input": "'(}'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95065_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000168", "code": "def card_game_winner(N, deck):\n    player1_sum = 0\n    player2_sum = 0\n    for i in range(len(deck)):\n        if i % 2 == 0:  # Player 1's turn\n            if deck[i] > deck[i + 1] if i + 1 < len(deck) else 0:\n                player1_sum += deck[i]\n            else:\n                player1_sum += deck[i + 1] if i + 1 < len(deck) else 0\n        else:  # Player 2's turn\n            if deck[i] > deck[i + 1] if i + 1 < len(deck) else 0:\n                player2_sum += deck[i]\n            else:\n                player2_sum += deck[i + 1] if i + 1 < len(deck) else 0\n    if player1_sum > player2_sum:\n        return \"Player 1\"\n    elif player2_sum > player1_sum:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "card_game_winner", "input": "2, [10, 1]", "output": "'Player 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87082_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000169", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 12, 9]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121994_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000170", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "-6", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000171", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5449", "output": "{5449, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000172", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'WWORWWORL'", "output": "'WWORWWORL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000173", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[7, 3, 3, 7, 7, 3, 7]", "output": "[7, 4, 5, 10, 11, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000174", "code": "def count_pairs_sum_to_target(lst, target):\n    num_freq = {}\n    pair_count = 0\n    for num in lst:\n        complement = target - num\n        if complement in num_freq and num_freq[complement] > 0:\n            pair_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_sum_to_target", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79446_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000175", "code": "def is_prime(num):\n    if num < 2:\n        return False\n    for i in range(2, int(num**0.5) + 1):\n        if num % i == 0:\n            return False\n    return True\n", "entry_point": "is_prime", "input": "2", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70351_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000176", "code": "def count_unique_characters(input_string: str) -> int:\n    unique_chars = set()\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():\n            unique_chars.add(char_lower)\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'A1B2!  '", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27927_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000177", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 8, 12]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79049_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000178", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20797_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000179", "code": "def authenticate_user(username, password):\n    predefined_username = \"john_doe\"\n    predefined_password = \"secure_password\"\n    if username == predefined_username and password == predefined_password:\n        return (True, predefined_username)\n    else:\n        return (False, None)\n", "entry_point": "authenticate_user", "input": "'wrong_user', 'wrong_pass'", "output": "(False, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143028_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000180", "code": "def sum_of_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "8", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49804_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000181", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'abc12345'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000182", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[-1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2879_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000183", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[12]", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59947_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000184", "code": "from typing import List\ndef sum_even_numbers(lst: List[int]) -> int:\n    sum_even = 0\n    for num in lst:\n        if (num & 1) == 0:  # Check if the least significant bit is 0\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81359_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000185", "code": "from typing import Tuple\ndef extract_version(version: str) -> Tuple[int, int]:\n    major, minor = map(int, version.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_version", "input": "'1.8'", "output": "(1, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148416_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8922", "output": "{1, 2, 3, 6, 4461, 1487, 8922, 2974}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8921", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000187", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[-3, -2, 49]", "output": "294", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000188", "code": "import re\ncode_snippet = \"\"\"\nfrom __future__ import print_function\nGETINFO = False #pylint: disable=wrong-import-position\nfrom .wiki import Wiki\nfrom .page import Page, User, Revision, CurrentUser\nfrom .excs import WikiError, WikiWarning, EditConflict, catch\nfrom .misc import Tag, RecentChange, GenericData\nfrom .qyoo import Queue\n__version__ = '3.2.1'\n\"\"\"\ndef extract_module_names(code):\n    module_names = set()\n    pattern = r\"from\\s+\\.[\\w.]+\\s+import\\s+([\\w\\s,]+)\"\n    matches = re.findall(pattern, code)\n    for match in matches:\n        modules = match.split(',')\n        for module in modules:\n            module_names.add(module.strip())\n    return list(module_names)\n", "entry_point": "extract_module_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74814_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000189", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[0, 4, 4]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96449_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000190", "code": "def longest_equal_even_odd_subarray(arr):\n    diff_indices = {0: -1}\n    max_length = 0\n    diff = 0\n    for i, num in enumerate(arr):\n        diff += 1 if num % 2 != 0 else -1\n        if diff in diff_indices:\n            max_length = max(max_length, i - diff_indices[diff])\n        else:\n            diff_indices[diff] = i\n    return max_length\n", "entry_point": "longest_equal_even_odd_subarray", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99623_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000191", "code": "def count_unique_videos(users_files: dict) -> int:\n    unique_videos = set()\n    for videos in users_files.values():\n        unique_videos.update(videos)\n    return len(unique_videos)\n", "entry_point": "count_unique_videos", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130194_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000192", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'name=Joh'", "output": "{'name': 'Joh'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000193", "code": "def generate_file_path(agent: str, energy: str) -> str:\n    top_path = './experiments_results/gym/' + agent + '/'\n    if 'Energy0' in energy:\n        ene_sub = '_E0'\n    elif 'EnergyOne' in energy:\n        ene_sub = '_E1'\n    if agent == 'HalfCheetah':\n        abrv = 'HC'\n    elif agent == 'HalfCheetahHeavy':\n        abrv = 'HCheavy'\n    elif agent == 'FullCheetah':\n        abrv = 'FC'\n    else:\n        abrv = agent\n    return top_path + abrv + ene_sub\n", "entry_point": "generate_file_path", "input": "'RanRAge', 'Energy0'", "output": "'./experiments_results/gym/RanRAge/RanRAge_E0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76201_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000194", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[7, 6, 3, 0, 8, 5, 4, -5]", "output": "[343, 36, 27, 0, 64, 125, 16, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000195", "code": "def get_turkish_status(status_code):\n    status_mapping = {\n        'conConnecting': 'Ba\u011flan\u0131yor',\n        'conOffline': '\u00c7evrim D\u0131\u015f\u0131',\n        'conOnline': '\u00c7evrim \u0130\u00e7i',\n        'conPausing': 'Duraklat\u0131l\u0131yor',\n        'conUnknown': 'Bilinmiyor',\n        'cusAway': 'Uzakta',\n        'cusDoNotDisturb': 'Rahats\u0131z Etmeyin',\n        'cusInvisible': 'G\u00f6r\u00fcnmez',\n        'cusLoggedOut': '\u00c7evrim D\u0131\u015f\u0131',\n        'cusNotAvailable': 'Kullan\u0131lam\u0131yor',\n        'cusOffline': '\u00c7evrim D\u0131\u015f\u0131',\n        'cusOnline': '\u00c7evrim \u0130\u00e7i',\n        'cusSkypeMe': 'Skype Me',\n        'cusUnknown': 'Bilinmiyor',\n        'cvsBothEnabled': 'Video G\u00f6nderme ve Alma'\n    }\n    return status_mapping.get(status_code, 'Bilinmiyor')\n", "entry_point": "get_turkish_status", "input": "'unknownStatus'", "output": "'Bilinmiyor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56868_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000196", "code": "from typing import List\ndef change(amount: int, coins: List[int]) -> int:\n    dp = [0] * (amount + 1)\n    dp[0] = 1\n    for coin in coins:\n        for i in range(coin, amount + 1):\n            dp[i] += dp[i - coin]\n    return dp[amount]\n", "entry_point": "change", "input": "0, []", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71745_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000197", "code": "import re\ndef generate_code(input_string):\n    words = input_string.split()\n    code = ''\n    for word in words:\n        first_letter = re.search(r'[a-zA-Z]', word)\n        if first_letter:\n            code += first_letter.group().lower()\n    return code\n", "entry_point": "generate_code", "input": "'Lion Whale Hat Apple Yarn'", "output": "'lwhay'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30063_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000198", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for num in arr:\n        current_sum += num\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[3, 5, -1, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128038_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000199", "code": "def play_war_game(player1_deck, player2_deck):\n    rounds_played = 0\n    while player1_deck and player2_deck:\n        rounds_played += 1\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_deck.extend([card1, card2])\n        elif card2 > card1:\n            player2_deck.extend([card2, card1])\n        else:  # War\n            war_cards = [card1, card2]\n            for _ in range(3):\n                if player1_deck and player2_deck:\n                    war_cards.extend([player1_deck.pop(0), player2_deck.pop(0)])\n            if not player1_deck or not player2_deck:\n                return -1\n            card1 = player1_deck.pop(0)\n            card2 = player2_deck.pop(0)\n            if card1 > card2:\n                player1_deck.extend(war_cards + [card1, card2])\n            else:\n                player2_deck.extend(war_cards + [card2, card1])\n    return rounds_played\n", "entry_point": "play_war_game", "input": "[2, 3, 4, 5, 6], [1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139607_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000200", "code": "from typing import List, Tuple\ndef calculate_average_pixel_values(image: List[int]) -> Tuple[float, float, float, float]:\n    red_sum, green_sum, blue_sum, alpha_sum = 0, 0, 0, 0\n    for i in range(0, len(image), 4):\n        red_sum += image[i]\n        green_sum += image[i + 1]\n        blue_sum += image[i + 2]\n        alpha_sum += image[i + 3]\n    num_pixels = len(image) // 4\n    red_avg = round(red_sum / num_pixels, 2)\n    green_avg = round(green_sum / num_pixels, 2)\n    blue_avg = round(blue_sum / num_pixels, 2)\n    alpha_avg = round(alpha_sum / num_pixels, 2)\n    return red_avg, green_avg, blue_avg, alpha_avg\n", "entry_point": "calculate_average_pixel_values", "input": "[255, 193, 191, 191, 256, 193, 192, 192]", "output": "(255.5, 193.0, 191.5, 191.5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96929_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000201", "code": "# Step 1: Define a dictionary mapping English words to their phonetic representations\nphonetic_dict = {\n    \"hello\": [\"HH\", \"AH\", \"L\", \"OW\"],\n    \"world\": [\"W\", \"ER\", \"L\", \"D\"],\n    \"example\": [\"IH\", \"G\", \"Z\", \"AE\", \"M\", \"P\", \"AH\", \"L\"]\n    # Add more word-phonetic pairs as needed\n}\n# Step 2: Implement the get_g2p(word) function\ndef get_g2p(word):\n    return phonetic_dict.get(word.lower(), [])  # Return the phonetic representation if word exists in the dictionary, else return an empty list\n", "entry_point": "get_g2p", "input": "'universe'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21781_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000202", "code": "def calculate_total_nodes(alpha, beta, ndexname):\n    total_nodes = (beta**(alpha+1) - 1) / (beta - 1) - 1\n    return int(total_nodes)\n", "entry_point": "calculate_total_nodes", "input": "1, 2, None", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122100_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000203", "code": "def get_unique_char_count(cube_name):\n    private_views, public_views = [], []\n    # Simulating the API call and response processing\n    # Replace this section with actual API calls in a real scenario\n    private_views = ['View1', 'View2']\n    public_views = ['View3', 'View4']\n    def count_unique_chars(view_list):\n        unique_chars = set()\n        for view_name in view_list:\n            unique_chars.update(set(view_name))\n        return len(unique_chars)\n    private_count = count_unique_chars(private_views)\n    public_count = count_unique_chars(public_views)\n    return {'private': private_count, 'public': public_count}\n", "entry_point": "get_unique_char_count", "input": "'cube_name'", "output": "{'private': 6, 'public': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133057_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000204", "code": "import math\ndef find_max_ceiling_index(n, m, s):\n    mx = 0\n    ind = 0\n    for i in range(n):\n        if math.ceil(s[i] / m) >= mx:\n            mx = math.ceil(s[i] / m)\n            ind = i\n    return ind + 1\n", "entry_point": "find_max_ceiling_index", "input": "3, 1, [2, 1, 0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97191_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000205", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "156", "output": "'?156'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000206", "code": "def filter_banned_users(banned_users: list, ban_reason: str) -> list:\n    matching_user_ids = []\n    for user in banned_users:\n        if user.get('ban_reason') == ban_reason:\n            matching_user_ids.append(user.get('user_id'))\n    return matching_user_ids\n", "entry_point": "filter_banned_users", "input": "[], 'SUSPICIOUS_ACTIVITY'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106977_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000207", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "10, 2", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000208", "code": "def find_second_highest_score(scores):\n    unique_scores = list(set(scores))  # Remove duplicates\n    if len(unique_scores) < 2:\n        return None\n    else:\n        sorted_scores = sorted(unique_scores, reverse=True)\n        return sorted_scores[1]\n", "entry_point": "find_second_highest_score", "input": "[90, 89, 78]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32942_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000209", "code": "def find_unique_element(A):\n    result = 0\n    for number in A:\n        result ^= number\n    return result\n", "entry_point": "find_unique_element", "input": "[1, 1, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26858_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000210", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[-6, 3, -6, -3, -5, -6, -6, -6]", "output": "[216, 9, 216, 27, 125, 216, 216, 216]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000211", "code": "from typing import List\ndef longest_consecutive_subsequence_length(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] == nums[i - 1] + 1:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 1\n    return max_length\n", "entry_point": "longest_consecutive_subsequence_length", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48952_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000212", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "2", "output": "['1', '2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000213", "code": "def pattern_match(pattern: str, input_str: str) -> bool:\n    if not pattern and not input_str:\n        return True\n    if not pattern or not input_str:\n        return False\n    if pattern[0] == input_str[0] or pattern[0] == '*':\n        return pattern_match(pattern[1:], input_str[1:]) or pattern_match(pattern, input_str[1:])\n    else:\n        return False\n", "entry_point": "pattern_match", "input": "'xyz', 'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63636_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000214", "code": "def max_subarray_sum(arr):\n    max_sum = arr[0]\n    current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83122_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000215", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "0, 85301", "output": "85301", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000216", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3343", "output": "{1, 3343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000217", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "1, 30, 45", "output": "5445000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000218", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[1, [2, [3, [4, 5]]], 38]", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000219", "code": "from typing import List\ndef stoneGame(piles: List[int]) -> bool:\n    n = len(piles)\n    dp = [[0] * n for _ in range(n)]\n    for i in range(n):\n        dp[i][i] = piles[i]\n    for l in range(2, n + 1):\n        for i in range(n - l + 1):\n            j = i + l - 1\n            dp[i][j] = max(piles[i] - dp[i + 1][j], piles[j] - dp[i][j - 1])\n    return dp[0][n - 1] > 0\n", "entry_point": "stoneGame", "input": "[5, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29901_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000220", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_score = sorted_scores[N-1]\n    count_top_score = sorted_scores.count(top_score)\n    sum_top_scores = sum(sorted_scores[:sorted_scores.index(top_score) + count_top_score])\n    average = sum_top_scores / count_top_score\n    return average\n", "entry_point": "calculate_top_players_average", "input": "[145, 145, 145], 3", "output": "145.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54118_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000221", "code": "import ast\ndef extract_imports(script):\n    imports = set()\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports.add(alias.name)\n        elif isinstance(node, ast.ImportFrom):\n            imports.add(node.module)\n    return list(imports)\n", "entry_point": "extract_imports", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45033_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000222", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7779", "output": "{3, 1, 7779, 2593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000223", "code": "from typing import List\ndef get_view_function(url_path: str) -> str:\n    urlpatterns = [\n        ('admin/', 'admin.site.urls'),\n        ('', 'views.root_view'),\n        ('home', 'views.home_view'),\n        ('register_user', 'views.register_user_view'),\n        ('logout', 'views.logout_view'),\n        ('get_professors/<str:student_name>', 'views.get_professors_view'),\n        ('add_professors', 'views.add_professors_view'),\n        ('get_student_info/<str:student_name>', 'views.get_student_info_view'),\n        ('add_grade', 'views.add_grade_view'),\n        ('send_thesis', 'views.send_thesis_view'),\n        ('check_thesis/<str:student_name>/<str:doc_hash>', 'views.check_thesis_view'),\n    ]\n    for pattern, view in urlpatterns:\n        if pattern == url_path:\n            return view\n    return 'Path not registered'\n", "entry_point": "get_view_function", "input": "'non_existent_path'", "output": "'Path not registered'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66172_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000224", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 6]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97423_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000225", "code": "_MIN_SERIAL = 10000000\ndef validate_serial_number(serial_number):\n    return serial_number >= _MIN_SERIAL\n", "entry_point": "validate_serial_number", "input": "10000000", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29014_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000226", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1205", "output": "{1, 5, 241, 1205}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000227", "code": "def count_unique_numbers(input_list):\n    unique_numbers = set()\n    for num in input_list:\n        unique_numbers.add(num)\n    return len(unique_numbers)\n", "entry_point": "count_unique_numbers", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105540_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000228", "code": "def find_non_dup(A=[]):\n    if len(A) == 0:\n        return None\n    non_dup = [x for x in A if A.count(x) == 1]\n    return non_dup[-1]\n", "entry_point": "find_non_dup", "input": "[1, 2, 1, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57269_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "356", "output": "{1, 2, 356, 4, 178, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt355", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000230", "code": "def get_sample_folder_path(platform):\n    platform_paths = {\n        \"UWP\": \"ArcGISRuntime.UWP.Viewer/Samples\",\n        \"WPF\": \"ArcGISRuntime.WPF.Viewer/Samples\",\n        \"Android\": \"Xamarin.Android/Samples\",\n        \"iOS\": \"Xamarin.iOS/Samples\",\n        \"Forms\": \"Shared/Samples\",\n        \"XFA\": \"Shared/Samples\",\n        \"XFI\": \"Shared/Samples\",\n        \"XFU\": \"Shared/Samples\"\n    }\n    if platform in platform_paths:\n        return platform_paths[platform]\n    else:\n        return \"Unknown platform provided\"\n", "entry_point": "get_sample_folder_path", "input": "'Linux'", "output": "'Unknown platform provided'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70790_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000231", "code": "import importlib\nimport inspect\ndef get_functions_in_module(module_name):\n    try:\n        module = importlib.import_module(module_name)\n        members = inspect.getmembers(module, inspect.isfunction)\n        function_names = [name for name, _ in members]\n        return function_names\n    except ModuleNotFoundError:\n        return []\n", "entry_point": "get_functions_in_module", "input": "'non_existent_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18662_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000232", "code": "import os\nimport glob\ndef verify_file_cleanup(directory_path: str, file_pattern: str) -> bool:\n    files_before = glob.glob(os.path.join(directory_path, file_pattern))\n    num_of_files_before = len(files_before)\n    # Perform cleanup operation\n    for file_path in files_before:\n        os.remove(file_path)\n    files_after = glob.glob(os.path.join(directory_path, file_pattern))\n    num_of_files_after = len(files_after)\n    return num_of_files_after < num_of_files_before\n", "entry_point": "verify_file_cleanup", "input": "'/path/to/empty/directory', '*.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109217_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000233", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'H@12lo Hello!23'", "output": "'H12loHello23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000234", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'11.7.11'", "output": "(11, 7, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000235", "code": "def elementwise_division(a, b):\n    if isinstance(a[0], list):  # Check if a is a 2D list\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [[x / y for x, y in zip(row_a, row_b)] for row_a, row_b in zip(a, b)]\n    else:  # Assuming a and b are 1D lists\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [x / y for x, y in zip(a, b)]\n", "entry_point": "elementwise_division", "input": "[1, 2, 3], [4, 5, 6]", "output": "[0.25, 0.4, 0.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108971_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000236", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[]", "output": "[()]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt42", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000237", "code": "def validate_word(word, text):\n    position = -1\n    valid = False\n    words = text.split()\n    for idx, txt_word in enumerate(words):\n        if txt_word == word:\n            if ',' in text[position+len(word):position+len(word)+2]:\n                valid = True\n                position = text.find(word, position+1)\n            elif ' ' not in word:\n                valid = True\n                position = text.find(word, position+1)\n    return valid, position\n", "entry_point": "validate_word", "input": "'apple', 'This is a simple test string.'", "output": "(False, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86929_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000238", "code": "def calculate_bedroc(y_true, y_pred, alpha):\n    n = len(y_true)\n    scores = list(zip(y_true, y_pred))\n    scores.sort(key=lambda x: x[1], reverse=True)\n    bedroc_sum = 0\n    for i, (true_label, _) in enumerate(scores):\n        bedroc_sum += (1 / n) * (2**(-alpha * (i + 1) / n) * true_label)\n    return bedroc_sum\n", "entry_point": "calculate_bedroc", "input": "[1, 0, 1, 0, 1], [0.9, 0.1, 0.8, 0.3, 0.7], 0.5", "output": "0.5231671902378334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3022_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000239", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[80, 88.8, 95]", "output": "88.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101899_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000240", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'Bi'", "output": "'tonga.cashregister.event.BiCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000241", "code": "def is_permutation_palindrome(s: str) -> bool:\n    char_freq = {}\n    for char in s:\n        char_freq[char] = char_freq.get(char, 0) + 1\n    odd_count = 0\n    for freq in char_freq.values():\n        if freq % 2 != 0:\n            odd_count += 1\n            if odd_count > 1:\n                return False\n    return True\n", "entry_point": "is_permutation_palindrome", "input": "'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21329_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000242", "code": "def card_game(deck, limit):\n    player1_sum = 0\n    player2_sum = 0\n    for i, card in enumerate(deck):\n        if i % 2 == 0:\n            player1_sum += card\n            if player1_sum > limit:\n                return \"Player 2 wins\"\n        else:\n            player2_sum += card\n            if player2_sum > limit:\n                return \"Player 1 wins\"\n    if player1_sum > player2_sum:\n        return \"Player 1 wins\"\n    elif player2_sum > player1_sum:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_game", "input": "[5, 3, 4, 2], 10", "output": "'Player 1 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106341_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000243", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5365", "output": "{1, 5, 37, 1073, 145, 5365, 185, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000244", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9423", "output": "{1, 3, 3141, 9, 9423, 1047, 27, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000245", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No average to calculate if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[60, 66, 67, 80]", "output": "66.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140002_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000246", "code": "def max_profit(prices):\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        potential_profit = price - min_price\n        max_profit = max(max_profit, potential_profit)\n        min_price = min(min_price, price)\n    return max_profit\n", "entry_point": "max_profit", "input": "[2, 3, 4, 8]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66423_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000247", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'my_y_m', 'some_attribute'", "output": "'Error: Module my_y_m not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000248", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "0, 6", "output": "'06:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000249", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141172_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000250", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = round(total_sum / total_students)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[89, 89, 89]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92897_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000251", "code": "def sum_of_diagonals(mat):\n    res = 0\n    i, j = 0, 0\n    while j < len(mat):\n        res += mat[i][j]\n        i += 1\n        j += 1\n    i, j = 0, len(mat) - 1\n    while j >= 0:\n        if i != j:\n            res += mat[i][j]\n        i += 1\n        j -= 1\n    return res\n", "entry_point": "sum_of_diagonals", "input": "[[1, 0], [2, 0]]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84275_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000252", "code": "def serialize_vehicle_info(vehicle_info: dict) -> dict:\n    if \"lat\" in vehicle_info:\n        vehicle_info.pop(\"lat\")\n    if \"lon\" in vehicle_info:\n        vehicle_info.pop(\"lon\")\n    return vehicle_info\n", "entry_point": "serialize_vehicle_info", "input": "{'lat': 10.0, 'lon': 20.0}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3103_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000253", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    return max(nums[-1] * nums[-2] * nums[-3], nums[0] * nums[1] * nums[-1])\n", "entry_point": "max_product_of_three", "input": "[3, 4, 21]", "output": "252", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58627_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000254", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'78889 10'", "output": "78899", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000255", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[85, 84, 70]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135338_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000256", "code": "def calculate_bmi_and_health_risk(weight, height):\n    bmi = weight / (height ** 2)\n    if bmi < 18.5:\n        health_risk = 'Underweight'\n    elif 18.5 <= bmi < 25:\n        health_risk = 'Normal weight'\n    elif 25 <= bmi < 30:\n        health_risk = 'Overweight'\n    elif 30 <= bmi < 35:\n        health_risk = 'Moderately obese'\n    elif 35 <= bmi < 40:\n        health_risk = 'Severely obese'\n    else:\n        health_risk = 'Very severely obese'\n    return bmi, health_risk\n", "entry_point": "calculate_bmi_and_health_risk", "input": "2.7219838662866382, 1", "output": "(2.7219838662866382, 'Underweight')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86783_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000257", "code": "import logging\n# Sample DATUM_DICT for testing\nDATUM_DICT = {\n    4326: \"WGS84\",\n    32633: \"WGS84 / UTM zone 33N\",\n    3857: \"WGS84 / Pseudo-Mercator\"\n}\ndef get_datum_and_zone(srid):\n    datum, zone = (None, None)\n    full_datum = DATUM_DICT.get(srid)\n    if full_datum is not None:\n        splits = full_datum.split()\n        datum = splits[0]\n        if len(splits) > 1:\n            try:\n                zone = int(splits[-1])\n            except ValueError as e:\n                logging.exception(e)\n    return datum, zone\n", "entry_point": "get_datum_and_zone", "input": "9999", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114114_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000258", "code": "from typing import List\ndef spiral_order(matrix: List[List[int]]) -> List[int]:\n    m, n = len(matrix), len(matrix[0])\n    dirs = ((0,1), (1,0), (0,-1), (-1,0))\n    cur = 0\n    ans = []\n    visited = [[False for _ in range(n)] for _ in range(m)]\n    i = j = 0\n    while len(ans) < m * n:\n        if not visited[i][j]:\n            ans.append(matrix[i][j])\n            visited[i][j] = True\n        di, dj = dirs[cur]\n        ii, jj = i + di, j + dj\n        if ii < 0 or ii >= m or jj < 0 or jj >= n or visited[ii][jj]:\n            cur = (cur + 1) % 4\n        di, dj = dirs[cur]\n        i, j = i + di, j + dj\n    return ans\n", "entry_point": "spiral_order", "input": "[[1, 2, 3], [8, 9, 4], [7, 6, 5]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61658_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000259", "code": "def compare_strings(s1, s2):\n    return s1.strip() == s2.strip()\n", "entry_point": "compare_strings", "input": "'hello', ' world'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8869_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000260", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'namn=Di'", "output": "{'namn': 'Di'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000261", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3057", "output": "{1, 3, 3057, 1019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000262", "code": "import re\ndef compare_versions(v1, v2):\n    def version_parts(version):\n        return re.findall(r'[\\d\\w]+', version)\n    parts1 = version_parts(v1)\n    parts2 = version_parts(v2)\n    for part1, part2 in zip(parts1, parts2):\n        if part1.isdigit() and part2.isdigit():\n            if int(part1) < int(part2):\n                return -1\n            elif int(part1) > int(part2):\n                return 1\n        else:\n            if part1 < part2:\n                return -1\n            elif part1 > part2:\n                return 1\n    if len(parts1) < len(parts2):\n        return -1\n    elif len(parts1) > len(parts2):\n        return 1\n    else:\n        return 0\n", "entry_point": "compare_versions", "input": "'1.2', '1.1'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65920_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000263", "code": "def max_consecutive_rounds(candies):\n    if not candies:\n        return 0\n    max_consecutive = 1\n    current_consecutive = 1\n    for i in range(1, len(candies)):\n        if candies[i] == candies[i - 1]:\n            current_consecutive += 1\n            max_consecutive = max(max_consecutive, current_consecutive)\n        else:\n            current_consecutive = 1\n    return max_consecutive\n", "entry_point": "max_consecutive_rounds", "input": "[1, 2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31135_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000264", "code": "def find_name_index(names, target_name):\n    target_name_lower = target_name.lower()\n    for index, name in enumerate(names):\n        if name.lower() == target_name_lower:\n            return index\n    return -1\n", "entry_point": "find_name_index", "input": "['Alice', 'Bob', 'Charlie'], 'David'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42651_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000265", "code": "from typing import List\ndef min_ram_changes(devices: List[int]) -> int:\n    total_ram = sum(devices)\n    avg_ram = total_ram // len(devices)\n    changes_needed = sum(abs(avg_ram - ram) for ram in devices)\n    return changes_needed\n", "entry_point": "min_ram_changes", "input": "[1, 5, 5, 12]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74774_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000266", "code": "def find_nb_range(start, end):\n    sum = 0\n    n = start\n    while True:\n        sum += n ** 3\n        if sum >= start and sum <= end:\n            return n\n        elif sum > end:\n            return -1\n        n += 1\n", "entry_point": "find_nb_range", "input": "1, 0", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61881_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000267", "code": "import glob\nimport os\ndef unique_file_extensions(filepath):\n    file_extensions = set()\n    for file_path in glob.glob(filepath + '/*'):\n        if os.path.isfile(file_path):\n            file_name = os.path.basename(file_path)\n            file_extension = file_name.split('.')[-1]\n            file_extensions.add(file_extension)\n    return list(file_extensions)\n", "entry_point": "unique_file_extensions", "input": "'/empty_directory/'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67579_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000268", "code": "def normalize_keys(keys):\n    normalized_keys = []\n    for key in keys:\n        normalized_key = key.replace('DIK_', '').lower()\n        normalized_keys.append(normalized_key)\n    return normalized_keys\n", "entry_point": "normalize_keys", "input": "['DIK_F1', 'DIK_ESCAPE', 'DIK_SPACE']", "output": "['f1', 'escape', 'space']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80403_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000269", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[90]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113339_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000270", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[30, 36, 37, 40]", "output": "36.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000271", "code": "def posix_quote_filter(input_string):\n    # Escape single quotes by doubling them\n    escaped_string = input_string.replace(\"'\", \"''\")\n    # Enclose the modified string in single quotes\n    return f\"'{escaped_string}'\"\n", "entry_point": "posix_quote_filter", "input": "'panic!'", "output": "\"'panic!'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125649_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2211", "output": "{1, 737, 3, 2211, 33, 67, 201, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000273", "code": "import re\ndef parse_sphinx_config(code_snippet):\n    config = {}\n    project_match = re.search(r\"project = u'(.+)'\", code_snippet)\n    if project_match:\n        config['project'] = project_match.group(1)\n    copyright_match = re.search(r\"copyright = u'(.+)'\", code_snippet)\n    if copyright_match:\n        config['copyright'] = copyright_match.group(1)\n    theme_match = re.search(r\"html_theme = '(.+)'\", code_snippet)\n    if theme_match:\n        config['html_theme'] = theme_match.group(1)\n    intersphinx_mapping = re.findall(r\"'(.+?)': \\('(.+?)', None\\)\", code_snippet)\n    config['intersphinx_mapping'] = {key: url for key, url in intersphinx_mapping}\n    return config\n", "entry_point": "parse_sphinx_config", "input": "''", "output": "{'intersphinx_mapping': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12228_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000274", "code": "def sum_of_largest_four(nums):\n    sorted_nums = sorted(nums, reverse=True)\n    return sum(sorted_nums[:4])\n", "entry_point": "sum_of_largest_four", "input": "[10, 11, 11, 12, 5, 3]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104402_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000275", "code": "def get_requirements(python_version):\n    requirements = ['cffi>=1.11.5', 'six>=1.11.0']\n    if python_version < '3.4':\n        requirements.append('enum34')\n    return requirements\n", "entry_point": "get_requirements", "input": "'3.4'", "output": "['cffi>=1.11.5', 'six>=1.11.0']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145684_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000276", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[3, 4, 2, 2]", "output": "[4, 4, 4, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000277", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[1, 1, 1, 4, 4, 2, 2, 2]", "output": "{1: 3, 4: 2, 2: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000278", "code": "def extract_package_info(file_content: str) -> dict:\n    metadata = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        if '__author__' in line:\n            metadata['author'] = line.split(' = ')[1].strip().strip('\"')\n        elif '__email__' in line:\n            metadata['email'] = line.split(' = ')[1].strip().strip('\"')\n        elif '__version__' in line:\n            metadata['version'] = line.split(' = ')[1].strip().strip('\"')\n    return metadata\n", "entry_point": "extract_package_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23814_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000279", "code": "def max_profit(prices):\n    if not prices:\n        return 0\n    min_price = prices[0]\n    max_profit = 0\n    for price in prices[1:]:\n        if price < min_price:\n            min_price = price\n        else:\n            max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "max_profit", "input": "[1, 3, 2, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42584_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000280", "code": "def search_in_rotated_array(array, target):\n    left, right = 0, len(array) - 1\n    while left <= right:\n        mid = (left + right) // 2\n        if array[mid] == target:\n            return mid\n        if array[left] <= array[mid]:\n            if array[left] <= target < array[mid]:\n                right = mid - 1\n            else:\n                left = mid + 1\n        else:\n            if array[mid] < target <= array[right]:\n                left = mid + 1\n            else:\n                right = mid - 1\n    return -1\n", "entry_point": "search_in_rotated_array", "input": "[4, 5, 6, 7, 0, 1, 2], 3", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119385_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000281", "code": "def sum_even_numbers(lst):\n    even_sum = 0\n    for num in lst:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106207_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000282", "code": "def handle_message(message):\n    message_actions = {\n        \"Sorry we couldn't find that article.\": \"No action\",\n        \"You can't report your article.\": \"No action\",\n        \"Only Admins can delete a reported article\": \"No action\",\n        \"You are not allowed to report twice\": \"No action\",\n        \"You successfully deleted the article\": \"Delete article\",\n        \"Only Admins can get reported article\": \"Get reported article\"\n    }\n    return message_actions.get(message, \"Unknown message\")\n", "entry_point": "handle_message", "input": "'This is a test message.'", "output": "'Unknown message'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51721_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000283", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2648", "output": "{1, 2, 4, 8, 331, 1324, 662, 2648}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2647", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000284", "code": "import string\ndef count_unique_words(text: str) -> int:\n    text = text.lower()\n    words = text.split()\n    unique_words = set()\n    for word in words:\n        word = word.strip(string.punctuation)\n        unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'Hello, world! Hello.'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55670_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000285", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'abcd'", "output": "'bc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000286", "code": "def process_reports(s3_client, bucket):\n    errors = []\n    error_lines = []\n    def process_report(resource_type):\n        # Simulated function for processing reports\n        pass\n    def prepare_missing_report(resource_type):\n        # Simulated function for preparing missing report lines\n        return []\n    class IncompleteReportError(Exception):\n        pass\n    for resource_type in (\"bibs\", \"items\", \"holdings\", \"orders\"):\n        try:\n            process_report(resource_type)\n        except IncompleteReportError:\n            error_lines.extend(prepare_missing_report(resource_type))\n            errors.append(resource_type)\n    return errors, error_lines\n", "entry_point": "process_reports", "input": "'mock_s3_client', 'mock_bucket'", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81355_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000287", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average_score", "input": "[80, 85, 86, 87, 90]", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77264_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000288", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "321", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000289", "code": "import os\ndef is_symbolic_link(path):\n    return os.path.islink(path)\n", "entry_point": "is_symbolic_link", "input": "'/tmp/myfile'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123448_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000290", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[2, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117314_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000291", "code": "from typing import List\ndef max_sum_non_adjacent(nums: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = max(include, exclude + num)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[5, 1, 2, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130952_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000292", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'Rolalbak'", "output": "'Rolalbak'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000293", "code": "import importlib\ndef call_module_method(module_name, method_name):\n    try:\n        module = importlib.import_module(module_name)\n        method = getattr(module, method_name)\n        if callable(method):\n            return method()\n        else:\n            return f\"Method '{method_name}' not found in module '{module_name}'\"\n    except ModuleNotFoundError:\n        return \"Module or method not found\"\n    except AttributeError:\n        return f\"Method '{method_name}' not found in module '{module_name}'\"\n", "entry_point": "call_module_method", "input": "'non_existent_module', 'some_method'", "output": "'Module or method not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104870_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000294", "code": "def unique_paths(grid):\n    if not grid or not grid[0]:\n        return 0\n    m, n = len(grid), len(grid[0])\n    dp = [[0] * n for _ in range(m)]\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 1:\n                dp[i][j] = 0\n            elif i == 0 and j == 0:\n                dp[i][j] = 1\n            elif i == 0:\n                dp[i][j] = dp[i][j - 1]\n            elif j == 0:\n                dp[i][j] = dp[i - 1][j]\n            else:\n                dp[i][j] = dp[i - 1][j] + dp[i][j - 1]\n    return dp[m - 1][n - 1]\n", "entry_point": "unique_paths", "input": "[[1]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134402_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000295", "code": "def sum_of_even_numbers(input_list):\n    total = 0\n    for num in input_list:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[2, 4, 6, 8, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34761_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000296", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return 0\n    max1 = max2 = max3 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[5, 6, 11]", "output": "330", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4670_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000297", "code": "from typing import List\ndef manipulate_devices(dev: List[str]) -> List[str]:\n    updated_devices = []\n    dfp_sensor_present = False\n    for device in dev:\n        updated_devices.append(device)\n        if device == 'dfpBinarySensor':\n            dfp_sensor_present = True\n    if not dfp_sensor_present:\n        updated_devices.append('dfpBinarySensor')\n    return updated_devices\n", "entry_point": "manipulate_devices", "input": "[]", "output": "['dfpBinarySensor']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129800_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000298", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9318", "output": "{1, 2, 3, 3106, 9318, 6, 1553, 4659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000299", "code": "from typing import List\ndef is_majority_element(nums: List[int], target: int) -> bool:\n    map_index = dict()\n    for num in nums:\n        if num in map_index:\n            map_index[num] += 1\n        else:\n            map_index[num] = 1\n    border = len(nums) // 2\n    if target in map_index and map_index[target] > border:\n        return True\n    return False\n", "entry_point": "is_majority_element", "input": "[1, 2, 3], 4", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74985_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000300", "code": "def process_criteria(criteria: str) -> int:\n    name, operator = criteria.split(':')\n    result = ord(name[0]) & ord(operator[-1])\n    return result\n", "entry_point": "process_criteria", "input": "'a:b'", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137762_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5403", "output": "{3, 1, 5403, 1801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000302", "code": "def generate_place_names(n):\n    place_names = []\n    for i in range(1, n+1):\n        if i % 2 == 0 and i % 3 == 0:\n            place_names.append(\"Metropolis\")\n        elif i % 2 == 0:\n            place_names.append(\"City\")\n        elif i % 3 == 0:\n            place_names.append(\"Town\")\n        else:\n            place_names.append(str(i))\n    return place_names\n", "entry_point": "generate_place_names", "input": "3", "output": "['1', 'City', 'Town']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143516_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000303", "code": "import socket\nVR_IP_PROTO_IGMP = 2\nVR_IP_PROTO_TCP = 6\nVR_IP_PROTO_UDP = 17\nVR_IP_PROTO_GRE = 47\nVR_IP_PROTO_ICMP6 = 58\nVR_IP_PROTO_SCTP = 132\nVR_GRE_FLAG_CSUM = (socket.ntohs(0x8000))\nVR_GRE_FLAG_KEY = (socket.ntohs(0x2000))\nVR_GRE_BASIC_HDR_LEN = 4\nVR_GRE_CKSUM_HDR_LEN = 8\nVR_GRE_KEY_HDR_LEN = 8\ndef calculate_gre_header_size(protocol: int, flags: int) -> int:\n    basic_header_len = VR_GRE_BASIC_HDR_LEN\n    if protocol == VR_IP_PROTO_GRE:\n        total_len = basic_header_len\n        if flags & VR_GRE_FLAG_CSUM:\n            total_len += VR_GRE_CKSUM_HDR_LEN\n        if flags & VR_GRE_FLAG_KEY:\n            total_len += VR_GRE_KEY_HDR_LEN\n        return total_len\n    return basic_header_len\n", "entry_point": "calculate_gre_header_size", "input": "VR_IP_PROTO_TCP, 0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133178_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000304", "code": "def determine_next_state(task_type, current_state):\n    priorities = {\n        'ROOT': 40,\n        'VM': 50,\n        'LOADER': 60,\n        'INTERRUPT': 70,\n        'PRINT': 70\n    }\n    memory_blocks = {\n        'PAGE_TABLE': range(0, 15),\n        'SHARED_MEMORY': range(15, 32),\n        'USER_TASKS': range(32, 256)\n    }\n    if task_type not in priorities or current_state not in ['running', 'ready', 'blocked']:\n        return \"Invalid input\"\n    current_priority = priorities[task_type]\n    next_state = current_state\n    if current_priority < priorities['ROOT']:\n        next_state = 'blocked'\n    elif current_priority < priorities['VM']:\n        if current_state == 'running':\n            next_state = 'ready'\n    elif current_priority < priorities['LOADER']:\n        if current_state == 'ready':\n            next_state = 'running'\n    elif current_priority < priorities['INTERRUPT']:\n        if current_state == 'blocked':\n            next_state = 'ready'\n    else:\n        if current_state == 'ready':\n            next_state = 'running'\n    for memory_type, memory_range in memory_blocks.items():\n        if memory_range[0] <= current_priority <= memory_range[-1]:\n            if current_priority not in memory_range:\n                next_state = 'blocked'\n    return next_state\n", "entry_point": "determine_next_state", "input": "'VM', 'ready'", "output": "'running'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7318_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000305", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'module_name.apps.appsAppConfig'", "output": "'appsApp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000306", "code": "def parse_events_simple(s):\n    fields = []\n    lines = s.strip().split('\\n')\n    for line in lines:\n        if line.startswith(\"data:\"):\n            name, data = \"data\", line.split(\":\", 1)[1].strip()\n        elif line.startswith(\"id:\"):\n            name, data = \"id\", line.split(\":\", 1)[1].strip()\n        elif line.startswith(\"event:\"):\n            name, data = \"event\", line.split(\":\", 1)[1].strip()\n        else:\n            continue\n        fields.append((name, data))\n    return fields\n", "entry_point": "parse_events_simple", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29131_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000307", "code": "def extract_lines_starting_with_b(input_str):\n    lines = input_str.split('\\n')\n    result = [line for line in lines if line.startswith(\"b'\")]\n    return result\n", "entry_point": "extract_lines_starting_with_b", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30655_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000308", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000309", "code": "import heapq\ndef top_k_frequent_elements(nums, k):\n    freq_map = {}\n    for num in nums:\n        freq_map[num] = freq_map.get(num, 0) + 1\n    heap = [(-freq, num) for num, freq in freq_map.items()]\n    heapq.heapify(heap)\n    top_k = []\n    for _ in range(k):\n        top_k.append(heapq.heappop(heap)[1])\n    return sorted(top_k)\n", "entry_point": "top_k_frequent_elements", "input": "[1, 2, 3], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76714_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000310", "code": "def generate_fibonacci_sequence(limit):\n    fibonacci_sequence = [0, 1]\n    while fibonacci_sequence[-1] <= limit:\n        next_fibonacci = fibonacci_sequence[-1] + fibonacci_sequence[-2]\n        if next_fibonacci <= limit:\n            fibonacci_sequence.append(next_fibonacci)\n        else:\n            break\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "13", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28462_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9106", "output": "{1, 2, 58, 4553, 9106, 157, 314, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9105", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000312", "code": "def count_module_registrations(code_snippet):\n    from collections import defaultdict\n    import re\n    module_pattern = re.compile(r\"admin\\.site\\.register\\((models\\.[\\w.]+)\\)\")\n    module_counts = defaultdict(int)\n    for line in code_snippet.split('\\n'):\n        match = module_pattern.search(line)\n        if match:\n            module_name = match.group(1)\n            module_counts[module_name] += 1\n    return dict(module_counts)\n", "entry_point": "count_module_registrations", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41872_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000313", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6863", "output": "{1, 6863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000314", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[2]", "output": "[(2,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt29", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000315", "code": "import re\nfrom typing import List\ndef extract_logger_names(script: str) -> List[str]:\n    logger_names = set()\n    pattern = r'logging\\.getLogger\\([\\'\"](.*?)[\\'\"]\\)'\n    matches = re.findall(pattern, script)\n    for match in matches:\n        logger_names.add(match)\n    return list(logger_names)\n", "entry_point": "extract_logger_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12780_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000316", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_evens", "input": "[2, 6]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16654_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000317", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    max_height = 0\n    for height in buildings:\n        total_area += max(0, height - max_height)\n        max_height = max(max_height, height)\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[0, 1, 2, 3, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140682_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000318", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[1, 2, 3, 4, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52993_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000319", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "-456", "output": "-654", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000320", "code": "def rock_paper_scissors(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie!\"\n    elif (player1_choice == 'rock' and player2_choice == 'scissors') or \\\n         (player1_choice == 'scissors' and player2_choice == 'paper') or \\\n         (player1_choice == 'paper' and player2_choice == 'rock'):\n        return 'Player 1 wins!'\n    else:\n        return 'Player 2 wins!'\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'paper'", "output": "'Player 2 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127812_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000321", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[0, 1]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000322", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "0, 8", "output": "'08:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000323", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'w'", "output": "{'w': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000324", "code": "def get_full_party_name(party_abbr):\n    if party_abbr == \"gop\":\n        return \"Republican\"\n    elif party_abbr == \"dem\":\n        return \"Democrat\"\n    else:\n        return \"Independent\"\n", "entry_point": "get_full_party_name", "input": "'other'", "output": "'Independent'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129194_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000325", "code": "def max_sum_non_adjacent(nums):\n    if not nums:\n        return 0\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[5, 10, 2, 16, 1]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62269_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000326", "code": "def play_card_game(deck_a, deck_b):\n    total_a = sum(deck_a[:1])  # Draw one card for Player A\n    total_b = sum(deck_b[:1])  # Draw one card for Player B\n    if total_a > total_b:\n        return \"Player A wins the round!\"\n    elif total_b > total_a:\n        return \"Player B wins the round!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "play_card_game", "input": "[5], [3]", "output": "'Player A wins the round!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11746_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000327", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[80, 85, 87, 88, 90]", "output": "86.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105264_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000328", "code": "# Define the mapping between object names and IDs\nobj2id = {\n    \"benchvise\": 2,\n    \"driller\": 7,\n    \"phone\": 21,\n}\ndef get_object_id(obj_name):\n    \"\"\"\n    Get the object ID corresponding to the given object name.\n    Args:\n        obj_name (str): The object name to look up.\n    Returns:\n        int: The object ID if found, otherwise -1.\n    \"\"\"\n    return obj2id.get(obj_name, -1)\n", "entry_point": "get_object_id", "input": "'driller'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97943_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000329", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[8, 9, 0, 5, 3, 4, 2, 3, 9]", "output": "{(8, 9, 0), (5, 3, 4), (2, 3, 9)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000330", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[100, 100, 92, 80, 70]", "output": "[100, 92, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6259", "output": "{11, 1, 6259, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000332", "code": "def perform_list_operation(input_list, command):\n    if command == \"min\":\n        return min(input_list)\n    elif command == \"add\":\n        input_list.append(6)  # Adding 6 as an example, can be modified for a specific item\n        return input_list\n    elif command == \"count\":\n        return input_list.count(2)  # Counting occurrences of 2 as an example\n    elif command == \"type\":\n        return type(input_list)\n    elif command == \"copy\":\n        new_list = input_list.copy()\n        return new_list\n    elif command == \"extend\":\n        input_list.extend([4, 5, 6, 7])  # Extending with specific items\n        return input_list\n    elif command == \"index\":\n        return input_list.index(7)  # Finding the index of 7 as an example\n    elif command == \"insert\":\n        input_list.insert(2, 100)  # Inserting 100 at index 2 as an example\n        return input_list\n    elif command == \"remove\":\n        input_list.remove(100)  # Removing 100 as an example\n        return input_list\n    elif command == \"reverse\":\n        input_list.reverse()\n        return input_list\n    elif command == \"sort\":\n        input_list.sort()\n        return input_list\n    else:\n        return \"Invalid command\"\n", "entry_point": "perform_list_operation", "input": "[], 'multiply'", "output": "'Invalid command'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63626_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000333", "code": "import re\ndef is_valid_set(set_str):\n    elements = re.findall(r'\\d+', set_str)\n    elements = [int(elem) for elem in elements]\n    if len(elements) != len(set(elements)):\n        return False\n    return True\n", "entry_point": "is_valid_set", "input": "'{1, 2, 3}'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19285_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000334", "code": "def evaluate_order(simple_order, impact):\n    bigger_than_threshold = simple_order == \">\"\n    has_positive_impact = impact > 0\n    if bigger_than_threshold and has_positive_impact:\n        return \"\ub192\uc77c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4\"\n    if not bigger_than_threshold and not has_positive_impact:\n        return \"\ub192\uc774\uc138\uc694\"\n    if bigger_than_threshold and not has_positive_impact:\n        return \"\ub0ae\ucd94\uc138\uc694\"\n    if not bigger_than_threshold and has_positive_impact:\n        return \"\ub0ae\ucd9c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4\"\n", "entry_point": "evaluate_order", "input": "'<', 1", "output": "'\ub0ae\ucd9c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28604_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000335", "code": "from collections import deque\ndef is_complete_binary_tree(levels):\n    queue = deque()\n    non_full_level = False\n    index = 0\n    for node in levels:\n        queue.append(node)\n        while queue and queue[0] == None:\n            queue.popleft()\n        if index * 2 + 1 < len(levels) and levels[index * 2 + 1] is None:\n            non_full_level = True\n        if non_full_level and node is not None:\n            return False\n        index += 1\n    return True\n", "entry_point": "is_complete_binary_tree", "input": "[1, 2, 3, 4, 5]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60433_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000336", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000337", "code": "def verify_password(username, password):\n    if username == \"labio\" and len(password) >= 8 and any(c.isupper() for c in password) and any(c.islower() for c in password) and any(c.isdigit() for c in password):\n        return True\n    return False\n", "entry_point": "verify_password", "input": "'user', 'Password1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128732_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000338", "code": "from typing import List\ndef count_pairs_with_sum(arr: List[int], target_sum: int) -> int:\n    seen = {}\n    pair_count = 0\n    for num in arr:\n        complement = target_sum - num\n        if complement in seen:\n            pair_count += 1\n            del seen[complement]\n        else:\n            seen[num] = True\n    return pair_count\n", "entry_point": "count_pairs_with_sum", "input": "[1, 2, 3], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59732_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000339", "code": "import re\nCONFIG_URL_LEGAL_PATTERN = r\"^https?:[^\\s]+?\\.[^\\s]+?\"\nCONFIG_URL_ILLEGAL_PATTERN = r\"\\.(cab|iso|zip|rar|tar|gz|bz2|7z|tgz|apk|exe|app|pkg|bmg|rpm|deb|dmg|jar|jad|bin|msi|\" \\\n                             \"pdf|doc|docx|xls|xlsx|ppt|pptx|txt|md|odf|odt|rtf|py|java|c|cc|js|css|log|csv|tsv|\" \\\n                             \"jpg|jpeg|png|gif|bmp|xpm|xbm|ico|drm|dxf|eps|psd|pcd|pcx|tif|tiff|\" \\\n                             \"mp3|mp4|swf|mkv|avi|flv|mov|wmv|wma|3gp|mpg|mpeg|mp4a|wav|ogg|rmvb)$\"\ndef validate_url(url):\n    legal_pattern = re.compile(CONFIG_URL_LEGAL_PATTERN)\n    illegal_pattern = re.compile(CONFIG_URL_ILLEGAL_PATTERN)\n    if legal_pattern.match(url) and not illegal_pattern.search(url):\n        return True\n    return False\n", "entry_point": "validate_url", "input": "'https://example.com/resource'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11013_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000340", "code": "def latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_major, current_minor, current_patch = map(int, version.split('.'))\n            latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n            if current_major > latest_major or \\\n                    (current_major == latest_major and current_minor > latest_minor) or \\\n                    (current_major == latest_major and current_minor == latest_minor and current_patch > latest_patch):\n                latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['1.2.2', '1.1.0', '0.9.5', '1.2.3']", "output": "'1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94924_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000341", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "5, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1021", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000342", "code": "def sum_even_numbers(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102754_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000343", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[6, 5, 5, 5]", "output": "(6, 125)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000344", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1965", "output": "{1, 3, 131, 5, 393, 1965, 655, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000345", "code": "def verify_wallet_handle(wallet_handle):\n    # Check if the wallet handle is a non-empty string\n    if not isinstance(wallet_handle, str) or not wallet_handle:\n        return False\n    # Check if the wallet handle contains only alphanumeric characters\n    if not wallet_handle.isalnum():\n        return False\n    # Check if the length of the wallet handle is within the range of 5 to 15 characters\n    if not 5 <= len(wallet_handle) <= 15:\n        return False\n    return True\n", "entry_point": "verify_wallet_handle", "input": "'abc123'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105839_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000346", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "17, 'mode', 'input'", "output": "{'response': 'InvalidPin', 'pin': 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000347", "code": "import re\ndef generate_banner(version, date):\n    version_pattern = re.compile(r'^\\d+\\.\\d+\\.\\w+$')\n    date_pattern = re.compile(r'^\\d{4}-\\d{2}-\\d{2}$')\n    if version_pattern.match(version) and date_pattern.match(date):\n        return f\"SageMath version {version}, Release Date: {date}\"\n    else:\n        return \"Invalid input\"\n", "entry_point": "generate_banner", "input": "'1.2.3.4', '2023-01-01'", "output": "'Invalid input'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42221_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000348", "code": "def find_max_checkpoint_less_than_threshold(SAVED_CHECKPOINTS, THRESHOLD):\n    sorted_checkpoints = sorted(SAVED_CHECKPOINTS)\n    max_checkpoint = -1\n    for checkpoint in sorted_checkpoints:\n        if checkpoint < THRESHOLD:\n            max_checkpoint = checkpoint\n        else:\n            break\n    return max_checkpoint\n", "entry_point": "find_max_checkpoint_less_than_threshold", "input": "[], 5", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9150_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000349", "code": "import math\nlap_counts = {\n    \"square\": 0,\n    \"circle\": 0,\n    \"figure-eight\": 0\n}\ndef lap_counter(shape: str) -> int:\n    if shape == \"square\":\n        lap_counts[\"square\"] += 1\n        return lap_counts[\"square\"]\n    elif shape == \"circle\":\n        lap_counts[\"circle\"] += 1\n        return lap_counts[\"circle\"]\n    elif shape == \"figure-eight\":\n        lap_counts[\"figure-eight\"] += 1\n        return lap_counts[\"figure-eight\"]\n    else:\n        return 0\n", "entry_point": "lap_counter", "input": "'triangle'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144836_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000350", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'0.5.2'", "output": "(0, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000351", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'nvsssdame0n1', '122111112211'", "output": "'nvsssdame0n1p122111112211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000352", "code": "from typing import List, Optional\ndef validate_patient_ages(ages: List[Optional[int]]) -> List[bool]:\n    validations = []\n    for age in ages:\n        if age is None:\n            validations.append(True)\n        elif isinstance(age, int) and 1 <= age <= 100:\n            validations.append(True)\n        else:\n            validations.append(False)\n    return validations\n", "entry_point": "validate_patient_ages", "input": "[0, 25, 150, 40, 10, None]", "output": "[False, True, False, True, True, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16067_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000353", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 7, 11]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24858_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000354", "code": "def findCellValue(num, xPos, yPos):\n    a, b = (min(xPos, num-1-yPos), 1) if yPos >= xPos else (min(yPos, num-1-xPos), -1)\n    return (4*num*a - 4*a*a - 2*a + b*(xPos+yPos) + (b>>1&1)*4*(num-a-1)) % 9 + 1\n", "entry_point": "findCellValue", "input": "5, 2, 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17971_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000355", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[4, 8]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123958_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000356", "code": "import re\ndef extract_function_names(script_content):\n    function_names = []\n    lines = script_content.split('\\n')\n    for line in lines:\n        if line.strip().startswith('def'):\n            match = re.search(r'def\\s+(\\w+)\\s*\\(', line)\n            if match:\n                function_names.append(match.group(1))\n    return function_names\n", "entry_point": "extract_function_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8224_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000357", "code": "def count_unique_elements(nums):\n    unique_elements = set(nums)\n    return len(unique_elements)\n", "entry_point": "count_unique_elements", "input": "[1, 2, 3, 4, 1, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59276_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000358", "code": "def max_subarray_sum(nums):\n    max_sum = nums[0]\n    current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[3, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149862_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000359", "code": "def process_tag(tag):\n    prep_token = ''\n    if tag.startswith('3sm', 2):\n        prep_token += 'e'\n    if tag.startswith('3sf', 2):\n        prep_token += 'i'\n    if tag.startswith('3p', 2):\n        prep_token += 'iad'\n    if tag.startswith('1s', 2):\n        prep_token += 'mi'\n    if tag.startswith('2s', 2):\n        prep_token += 'thu'\n    if tag.startswith('2p', 2):\n        prep_token += 'sibh'\n    if tag.startswith('1p', 2):\n        prep_token += 'sinn'\n    return prep_token\n", "entry_point": "process_tag", "input": "'0s123'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131185_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1315", "output": "{1, 1315, 5, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1314", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000361", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'eleeove'", "output": "'eleeove'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000362", "code": "def check_exit_code(command_result, expected_exit_code):\n    return command_result == expected_exit_code\n", "entry_point": "check_exit_code", "input": "1, 0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38664_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000363", "code": "def resample_time_series(data, season):\n    def seasons_resampler(months):\n        return [data[i] for i in range(len(data)) if i % 12 in months]\n    if season == \"winter\":\n        return seasons_resampler([11, 0, 1])  # December, January, February\n    elif season == \"spring\":\n        return seasons_resampler([2, 3, 4])  # March, April, May\n    elif season == \"summer\":\n        return seasons_resampler([5, 6, 7])  # June, July, August\n    elif season == \"autumn\":\n        return seasons_resampler([8, 9, 10])  # September, October, November\n    elif season == \"custom\":\n        # Implement custom resampling logic here\n        return None\n    elif season == \"yearly\":\n        return [sum(data[i:i+12]) for i in range(0, len(data), 12)]  # Resample to yearly values\n    else:\n        return \"Invalid season specified\"\n", "entry_point": "resample_time_series", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 11, 0], 'autumn'", "output": "[9, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58046_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000364", "code": "def validate_password(password):\n    if len(password) < 10:\n        return False\n    if password == password.lower() or password == password.upper():\n        return False\n    if not any('0' <= l <= '9' for l in password):\n        return False\n    return True\n", "entry_point": "validate_password", "input": "'Password123'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14341_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000365", "code": "import re\ndef extract_routes(code_snippet):\n    routes = []\n    pattern = r\"@app\\.route\\(['\\\"](.*?)['\\\"]\"\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        routes.append(match)\n    return routes\n", "entry_point": "extract_routes", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50747_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000366", "code": "def determine_game_winner(deck_a, deck_b):\n    rounds_won_a = 0\n    rounds_won_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            rounds_won_a += 1\n        elif card_b > card_a:\n            rounds_won_b += 1\n    if rounds_won_a > rounds_won_b:\n        return 'Player A'\n    elif rounds_won_b > rounds_won_a:\n        return 'Player B'\n    else:\n        return 'Tie'\n", "entry_point": "determine_game_winner", "input": "[1, 2], [3, 4]", "output": "'Player B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12773_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000367", "code": "def is_numeric(txt):\n    '''Confirms that the text is numeric'''\n    out = len(txt)\n    allowed_chars = set('0123456789-$%+.')  # Define the set of allowed characters\n    allowed_last_chars = set('1234567890%')  # Define the set of allowed last characters\n    for c in txt:\n        if c not in allowed_chars:\n            out = False\n            break\n    if out and txt[-1] not in allowed_last_chars:\n        out = False\n    return out\n", "entry_point": "is_numeric", "input": "'abcd'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94372_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000368", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'0 - 0'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000369", "code": "def count_module_imports(code_snippet):\n    imports = set()\n    for line in code_snippet.split('\\n'):\n        if line.strip().startswith('import'):\n            modules = line.split()[1:]\n            for module in modules:\n                module_name = module.split(',')[0].strip()\n                imports.add(module_name)\n    return len(imports)\n", "entry_point": "count_module_imports", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10424_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000370", "code": "def convert_to_nested_dict(input_dict, delimiter):\n    nested_dict = {}\n    for key, value in input_dict.items():\n        keys = key.split(delimiter)\n        temp_dict = nested_dict\n        for k in keys[:-1]:\n            if k not in temp_dict:\n                temp_dict[k] = {}\n            temp_dict = temp_dict[k]\n        temp_dict[keys[-1]] = value\n    return nested_dict\n", "entry_point": "convert_to_nested_dict", "input": "{}, ':'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49569_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000371", "code": "def factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "9", "output": "362880", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149792_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000372", "code": "def spiralOrder(matrix):\n    if not matrix or not matrix[0]:\n        return []\n    res = []\n    rb, re, cb, ce = 0, len(matrix), 0, len(matrix[0])\n    while len(res) < len(matrix) * len(matrix[0]):\n        # Move right\n        for i in range(cb, ce):\n            res.append(matrix[rb][i])\n        rb += 1\n        # Move down\n        for i in range(rb, re):\n            res.append(matrix[i][ce - 1])\n        ce -= 1\n        # Move left\n        if rb < re:\n            for i in range(ce - 1, cb - 1, -1):\n                res.append(matrix[re - 1][i])\n            re -= 1\n        # Move up\n        if cb < ce:\n            for i in range(re - 1, rb - 1, -1):\n                res.append(matrix[i][cb])\n            cb += 1\n    return res\n", "entry_point": "spiralOrder", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[1, 2, 3, 6, 9, 8, 7, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21236_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1047", "output": "{1, 3, 349, 1047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000374", "code": "loginid  = \"your login id\"\npassword = \"<PASSWORD>\"\ndef validate_credentials(entered_loginid, entered_password):\n    if entered_loginid == loginid and entered_password != \"<PASSWORD>\":\n        return True\n    else:\n        return False\n", "entry_point": "validate_credentials", "input": "'wrongLoginId', 'anyPassword'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48019_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000375", "code": "def solver(s: str, n: int) -> bool:\n    return any(len(word) >= n for word in s.split())\n", "entry_point": "solver", "input": "'   ', 1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45879_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000376", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'24.4.22.0'", "output": "(24, 4, 22, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000377", "code": "def is_prime(num):\n    if num < 2:\n        return False\n    for i in range(2, int(num**0.5) + 1):\n        if num % i == 0:\n            return False\n    return True\n", "entry_point": "is_prime", "input": "1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97739_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000378", "code": "def calculate_gdp_growth_rate(data: str) -> dict:\n    gdp_data = [line.split(',') for line in data.strip().split('\\n')[1:]]\n    gdp_dict = {date: float(gdp) for date, gdp in gdp_data}\n    growth_rates = {}\n    for i in range(1, len(gdp_data)):\n        prev_gdp = float(gdp_data[i - 1][1])\n        curr_gdp = float(gdp_data[i][1])\n        growth_rate = ((curr_gdp - prev_gdp) / prev_gdp) * 100\n        year_quarter = gdp_data[i][0][:7]\n        growth_rates[year_quarter] = round(growth_rate, 2)\n    return growth_rates\n", "entry_point": "calculate_gdp_growth_rate", "input": "'Date,GDP\\n'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6976_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2405", "output": "{1, 481, 65, 5, 2405, 37, 13, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2404", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000380", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'listchartsclit'", "output": "'listchartsclit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000381", "code": "def process_event(event: str, values: list) -> str:\n    if event == \"click\":\n        return f\"Clicked with values: {values}\"\n    elif event == \"hover\":\n        return f\"Hovered with values: {values}\"\n    elif event == \"submit\":\n        return f\"Submitted with values: {values}\"\n    else:\n        return \"Unknown event\"\n", "entry_point": "process_event", "input": "'keypress', []", "output": "'Unknown event'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96210_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000382", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    max_height = 0\n    for height in buildings:\n        total_area += max(0, height - max_height)\n        max_height = max(max_height, height)\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[1, 2, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140682_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000383", "code": "def is_palindrome(s: str) -> bool:\n    # Remove non-alphabetic characters and convert to lowercase\n    clean_str = ''.join(char.lower() for char in s if char.isalpha())\n    # Check if the cleaned string is equal to its reverse\n    return clean_str == clean_str[::-1]\n", "entry_point": "is_palindrome", "input": "'hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7086_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000384", "code": "import re\ndef extract_video_progress(input_str):\n    duration_re = re.compile(r'Duration: (?P<hours>\\d+):(?P<minutes>\\d+):(?P<seconds>\\d+)')\n    progress_re = re.compile(r'time=(?P<hours>\\d+):(?P<minutes>\\d+):(?P<seconds>\\d+)')\n    duration_match = duration_re.search(input_str)\n    progress_match = progress_re.search(input_str)\n    if duration_match and progress_match:\n        total_duration = duration_match.group('hours') + \":\" + duration_match.group('minutes') + \":\" + duration_match.group('seconds')\n        progress_time = progress_match.group('hours') + \":\" + progress_match.group('minutes') + \":\" + progress_match.group('seconds')\n        return total_duration, progress_time\n    else:\n        if \"Invalid data found when processing input\" in input_str:\n            return \"Error\"\n        else:\n            return \"Invalid input format\"\n", "entry_point": "extract_video_progress", "input": "'Random string with no data'", "output": "'Invalid input format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7895_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000385", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<EIMAIL>'", "output": "'<EIMAIL>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000386", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6991", "output": "{1, 6991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000387", "code": "def count_word_occurrences(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Tokenize the text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the counts\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_occurrences", "input": "'pthopythontnp.'", "output": "{'pthopythontnp.': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52489_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000388", "code": "import math\ndef generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, n + 1, i):\n                is_prime[j] = False\n    return [i for i in range(2, n + 1) if is_prime[i]]\n", "entry_point": "generate_primes", "input": "19", "output": "[2, 3, 5, 7, 11, 13, 17, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110729_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000389", "code": "from typing import List\ndef calculate_average_score(scores: List[int], threshold: int) -> float:\n    valid_scores = [score for score in scores if score >= threshold]\n    if not valid_scores:\n        return 0.0  # Return 0 if no scores are above the threshold\n    total_valid_scores = sum(valid_scores)\n    average_score = total_valid_scores / len(valid_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[77, 79, 82, 70], 75", "output": "79.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74900_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000390", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[100, 67]", "output": "167", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000391", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4394", "output": "{1, 2, 169, 4394, 13, 338, 2197, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4393", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000392", "code": "from typing import List, Dict\ndef generate_test_endpoints(uri: str, tests: List[Dict[str, str]]) -> Dict[str, str]:\n    test_endpoints = {}\n    for test in tests:\n        test_name = test[\"name\"]\n        if \"{\" in test_name and \"}\" in test_name:\n            placeholder = test_name[test_name.find(\"{\") + 1:test_name.find(\"}\")]\n            if placeholder in uri:\n                test_endpoints[test_name] = uri.replace(\"{\" + placeholder + \"}\", \"{\" + placeholder + \"}\")\n            else:\n                test_endpoints[test_name] = uri\n        else:\n            test_endpoints[test_name] = uri\n    return test_endpoints\n", "entry_point": "generate_test_endpoints", "input": "'http://example.com/{id}', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98849_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000393", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "120", "output": "'ossg.default.120'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000394", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "16.0, 7", "output": "1.2857142857142858", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000395", "code": "import json\n# Sample titles for top news stories from CBC and CNN\ncbc_titles = [\"Canada announces new environmental policies\", \"COVID-19 vaccination drive in full swing\", \"Breaking: Political unrest in the capital\"]\ncnn_titles = [\"New climate change regulations in Canada\", \"Global efforts to combat COVID-19 pandemic\", \"Protests erupt in major city over government policies\"]\n# Custom similarity metric based on common words\ndef similarity_metric(title1, title2):\n    words1 = set(title1.lower().split())\n    words2 = set(title2.lower().split())\n    common_words = words1.intersection(words2)\n    return len(common_words)\n", "entry_point": "similarity_metric", "input": "'A journey through the Arctic', 'Exploring ancient civilizations'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39484_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000396", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[4, 4, 4, 1, 2, 3]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000397", "code": "def serialize_terms_for_edit_ui(deposit):\n    serialized_deposit = {}\n    terms = deposit.get('terms', {})\n    serialized_deposit['mesh_terms'] = [{'data': term} for term in terms.get('mesh_terms', [])]\n    serialized_deposit['fast_terms'] = [{'data': term} for term in terms.get('fast_terms', [])]\n    return serialized_deposit\n", "entry_point": "serialize_terms_for_edit_ui", "input": "{}", "output": "{'mesh_terms': [], 'fast_terms': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2211_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000398", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[1, [2, [3]], 4]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000399", "code": "def find_distance(text: str, word1: str, word2: str) -> int:\n    words = text.split()\n    pos_word1 = pos_word2 = -1\n    min_distance = len(words)  # Initialize with a large value\n    for i, word in enumerate(words):\n        if word == word1:\n            pos_word1 = i\n        elif word == word2:\n            pos_word2 = i\n        if pos_word1 != -1 and pos_word2 != -1:\n            distance = abs(pos_word1 - pos_word2) - 1\n            min_distance = min(min_distance, distance)\n    return min_distance\n", "entry_point": "find_distance", "input": "'hello there world', 'hello', 'world'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41646_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000400", "code": "import os\nSK_SIGNING_PLUGIN_ENV_VAR = 'SK_SIGNING_PLUGIN'\nU2F_SIGNATURE_TIMEOUT_SECONDS = 5\nSK_SIGNING_PLUGIN_NO_ERROR = 0\nSK_SIGNING_PLUGIN_TOUCH_REQUIRED = 0x6985\nSK_SIGNING_PLUGIN_WRONG_DATA = 0x6A80\ndef process_message(message: str) -> str:\n    sk_signing_plugin = os.getenv(SK_SIGNING_PLUGIN_ENV_VAR)\n    if not sk_signing_plugin:\n        return \"Error: SK signing plugin not found.\"\n    # Simulating interaction with the SK signing plugin\n    # In a real scenario, this would involve calling the plugin with the message\n    # Simulated response from the SK signing plugin\n    response_code = SK_SIGNING_PLUGIN_NO_ERROR  # Simulated successful signing\n    if response_code == SK_SIGNING_PLUGIN_NO_ERROR:\n        return \"Message signed successfully.\"\n    elif response_code == SK_SIGNING_PLUGIN_TOUCH_REQUIRED:\n        return \"Touch required on the security key.\"\n    elif response_code == SK_SIGNING_PLUGIN_WRONG_DATA:\n        return \"Error: Wrong data provided to the security key.\"\n    else:\n        return \"Error: Unknown error occurred.\"\n", "entry_point": "process_message", "input": "'Some message'", "output": "'Error: SK signing plugin not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8643_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000401", "code": "def count_unique_chars(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha() and char.lower() not in unique_chars:\n            unique_chars.add(char.lower())\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'abcde!!'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28280_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000402", "code": "from typing import List\nimport math\ndef cosine_similarity(vector1: List[float], vector2: List[float]) -> float:\n    dot_product = sum(a * b for a, b in zip(vector1, vector2))\n    magnitude1 = math.sqrt(sum(a**2 for a in vector1))\n    magnitude2 = math.sqrt(sum(b**2 for b in vector2))\n    cosine_similarity = dot_product / (magnitude1 * magnitude2) if magnitude1 * magnitude2 != 0 else 0\n    return round(cosine_similarity, 4)\n", "entry_point": "cosine_similarity", "input": "[0, 0], [1, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25833_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000403", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[1, 2, 2, 3, 4, 4, 5, 6, 6]", "output": "[1, 2, 2, 3, 4, 4, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000404", "code": "def calculate_anchor_boxes(input_shape):\n    strides = [4, 8, 16, 32]\n    in_h = [input_shape[0] / s for s in strides]\n    in_w = [input_shape[1] / s for s in strides]\n    continuous_face_scale = [[15, 45], [45, 75], [75, 135], [135, 260]]\n    anchors = [[28, 21], [57, 38], [100, 65], [164, 121]]\n    anchor_boxes = {}\n    for i, (h, w) in enumerate(zip(in_h, in_w)):\n        scale = strides[i]\n        num_boxes_h = int((continuous_face_scale[i][1] - continuous_face_scale[i][0]) / anchors[i][1])\n        num_boxes_w = int((continuous_face_scale[i][1] - continuous_face_scale[i][0]) / anchors[i][0])\n        num_boxes = num_boxes_h * num_boxes_w\n        anchor_boxes[scale] = num_boxes\n    return anchor_boxes\n", "entry_point": "calculate_anchor_boxes", "input": "(45, 15)", "output": "{4: 1, 8: 0, 16: 0, 32: 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140776_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000405", "code": "def extract_app_name(config: str) -> str:\n    # Find the index of the equal sign\n    equal_index = config.index(\"=\")\n    # Extract the substring after the equal sign\n    app_name = config[equal_index + 1:]\n    # Strip any leading or trailing spaces\n    app_name = app_name.strip()\n    return app_name\n", "entry_point": "extract_app_name", "input": "'app_name='", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77630_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000406", "code": "def count_alphanumeric_chars(text):\n    count = 0\n    for char in text:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abc def ghi: 123x!'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10323_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4781", "output": "{1, 683, 4781, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000408", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_num = 0\n    for num in nums:\n        single_num ^= num\n    return single_num\n", "entry_point": "find_single_number", "input": "[5, 2, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121855_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000409", "code": "DATA_LOCATION = \"C:/Users/gonca/Dev/valuvalu/security_analysis/vvsa/data\"\ndef extract_username(data_location):\n    # Split the path using the '/' delimiter\n    path_parts = data_location.split('/')\n    # Extract the username from the path\n    username = path_parts[2]\n    return username\n", "entry_point": "extract_username", "input": "'C:/Users/Dev/SomeFolder/File.txt'", "output": "'Dev'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90875_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000410", "code": "def extract_major_version(version):\n    dot_index = version.find('.')\n    if dot_index != -1:\n        return version[:dot_index]\n    else:\n        return version  # If no dot found, return the entire version string as major version\n", "entry_point": "extract_major_version", "input": "'2018.5'", "output": "'2018'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34102_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000411", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 15, 21]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81996_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000412", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47830_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000413", "code": "import re\ndef generate_log_viewset_mapping(code_snippet):\n    log_viewset_mapping = {}\n    # Regular expression pattern to match the log type and viewset class\n    pattern = r\"class (\\w+)ViewSet\\(AdvancedModelViewSet, AdvancedListAPIView\\):\"\n    # Find all matches of the pattern in the code snippet\n    matches = re.findall(pattern, code_snippet)\n    # Populate the log_viewset_mapping dictionary\n    for match in matches:\n        log_type = match.replace(\"ViewSet\", \"\")\n        viewset_class = match\n        log_viewset_mapping[log_type] = viewset_class\n    return log_viewset_mapping\n", "entry_point": "generate_log_viewset_mapping", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000414", "code": "def resolve_view(url: str) -> str:\n    url_patterns = [\n        ('add/', 'SlackAuthView.as_view(auth_type=\"add\")', 'slack_add'),\n        ('signin/', 'SlackAuthView.as_view(auth_type=\"signin\")', 'slack_signin'),\n        ('add-success/', 'DefaultAddSuccessView.as_view()', 'slack_add_success'),\n        ('signin-success/', 'DefaultSigninSuccessView.as_view()', 'slack_signin_success')\n    ]\n    for pattern, view, name in url_patterns:\n        if url.startswith(pattern):\n            return name\n    return 'Not Found'\n", "entry_point": "resolve_view", "input": "'home/'", "output": "'Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141769_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000415", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[7, 6, 0]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8313_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000416", "code": "from typing import List\nimport functools\ndef maximumScore1(nums: List[int], mult: List[int]) -> int:\n    @functools.lru_cache(maxsize=2000)\n    def dp(left, i):\n        if i >= len(mult):\n            return 0\n        right = len(nums) - 1 - (i - left)\n        return max(mult[i] * nums[left] + dp(left+1, i+1), mult[i] * nums[right] + dp(left, i+1))\n    return dp(0, 0)\n", "entry_point": "maximumScore1", "input": "[1, 2, 3], [3, 2, 1]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146067_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000417", "code": "def validate_lst(element: list) -> bool:\n    '''\n    Return True if element is valid and False otherwise\n    '''\n    for item in range(1, 10):\n        if element.count(item) > 1:\n            return False\n    return True\n", "entry_point": "validate_lst", "input": "[2, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68264_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000418", "code": "def map_urls_to_views(url_patterns):\n    url_view_mapping = {}\n    for path, view_func in url_patterns:\n        url_view_mapping[path] = view_func\n    return url_view_mapping\n", "entry_point": "map_urls_to_views", "input": "[('/admin/', 'admin.views')]", "output": "{'/admin/': 'admin.views'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99905_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000419", "code": "# Constants\nE_INVALID_SNAPSHOT_NAME = 2\ndef validate_snapshot_name(snapshot_name):\n    if not snapshot_name:\n        return E_INVALID_SNAPSHOT_NAME\n    if any(char.isspace() for char in snapshot_name):\n        return E_INVALID_SNAPSHOT_NAME\n    if not snapshot_name.isalnum():\n        return E_INVALID_SNAPSHOT_NAME\n    if len(snapshot_name) < 3:\n        return E_INVALID_SNAPSHOT_NAME\n    return 0\n", "entry_point": "validate_snapshot_name", "input": "'abc'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119724_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000420", "code": "def rob_2(nums):\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob(nums):\n        prev_max = curr_max = 0\n        for num in nums:\n            temp = curr_max\n            curr_max = max(prev_max + num, curr_max)\n            prev_max = temp\n        return curr_max\n    include_first = rob(nums[1:]) + nums[0]\n    exclude_first = rob(nums[:-1])\n    return max(include_first, exclude_first)\n", "entry_point": "rob_2", "input": "[20, 10, 1]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95871_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000421", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'3', 4, 11081001", "output": "'3 - 04 [11081001].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000422", "code": "def simulate_card_game(deck):\n    player1_sum = 0\n    player2_sum = 0\n    for i, card_value in enumerate(deck):\n        if i % 2 == 0:\n            player1_sum += card_value\n        else:\n            player2_sum += card_value\n    if player1_sum > player2_sum:\n        return 0\n    elif player2_sum > player1_sum:\n        return 1\n    else:\n        return -1\n", "entry_point": "simulate_card_game", "input": "[5, 3, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91398_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000423", "code": "from typing import List\ndef find_missing_numbers(input_list: List[int]) -> List[int]:\n    if not input_list:\n        return []\n    min_val, max_val = min(input_list), max(input_list)\n    full_range = set(range(min_val, max_val + 1))\n    input_set = set(input_list)\n    missing_numbers = sorted(full_range.difference(input_set))\n    return missing_numbers\n", "entry_point": "find_missing_numbers", "input": "[0, 2, 4]", "output": "[1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125580_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000424", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[10, 10, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47830_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000425", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[4, 2, 4, 2, 4, 5]", "output": "[4, 2, 4, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000426", "code": "from typing import List\ndef navigate_maze(maze: List[List[str]]) -> bool:\n    def dfs(row, col):\n        if not (0 <= row < len(maze) and 0 <= col < len(maze[0]) and maze[row][col] != '#'):\n            return False\n        if maze[row][col] == 'E':\n            return True\n        maze[row][col] = '#'  # Mark current position as visited\n        # Explore all four directions\n        if dfs(row + 1, col) or dfs(row - 1, col) or dfs(row, col + 1) or dfs(row, col - 1):\n            return True\n        return False\n    # Find the start position 'S'\n    for i in range(len(maze)):\n        for j in range(len(maze[0])):\n            if maze[i][j] == 'S':\n                return dfs(i, j)\n    return False\n", "entry_point": "navigate_maze", "input": "[['#', '#'], ['#', 'S']]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113514_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000427", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[20, 30, 40, 20]", "output": "110", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000428", "code": "def even_fibonacci_sum(limit):\n    a, b = 0, 1\n    sum_even = 0\n    while b <= limit:\n        if b % 2 == 0:\n            sum_even += b\n        a, b = b, a + b\n    return sum_even\n", "entry_point": "even_fibonacci_sum", "input": "8", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76998_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000429", "code": "def calculate_total_nodes(alpha, beta, ndexname):\n    total_nodes = (beta**(alpha+1) - 1) / (beta - 1) - 1\n    return int(total_nodes)\n", "entry_point": "calculate_total_nodes", "input": "2, 3, None", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122100_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000430", "code": "from typing import List\ndef sum_of_even_numbers(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[2, 4, 4]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_162_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5486", "output": "{1, 2, 422, 13, 5486, 211, 2743, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5485", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000432", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8305", "output": "{1, 5, 11, 8305, 755, 55, 151, 1661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000433", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "8", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000434", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[9, 4, 4, 2, 2]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000435", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-3, -3, 4]", "output": "[-3, -3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000436", "code": "def generate_menu_html(menu_items):\n    html_menu = \"<ul>\\n\"\n    for item_name, item_url in menu_items:\n        html_menu += f\"    <li><a href=\\\"{item_url}\\\">{item_name}</a></li>\\n\"\n    html_menu += \"</ul>\"\n    return html_menu\n", "entry_point": "generate_menu_html", "input": "[]", "output": "'<ul>\\n</ul>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82950_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000437", "code": "import pathlib\nGENERATED_EXTENSIONS = [\"pb.go\", \"pb.gw.go\", \"swagger.json\"]\ndef identify_missing_proto_files(path_to_generated, path_to_proto):\n    def find_files(path, fileglob):\n        files_full = list(pathlib.Path(path).glob(fileglob))\n        return files_full\n    def strip_path_extension(filelist):\n        files_extensionless = [str(f).replace(\"\".join(f.suffixes), \"\") for f in filelist]\n        files_name_only = [pathlib.Path(f).stem for f in files_extensionless]\n        return files_name_only\n    def find_difference(generated_list, proto_list):\n        difference = set(generated_list) - set(proto_list)\n        return difference\n    def filter_only_gen_files(candidates):\n        return [x for x in candidates if any(str(x.name).endswith(extension) for extension in GENERATED_EXTENSIONS)]\n    generated_files = find_files(path_to_generated, '*')\n    proto_files = find_files(path_to_proto, '*.proto')\n    generated_files_stripped = strip_path_extension(generated_files)\n    proto_files_stripped = strip_path_extension(proto_files)\n    generated_files_filtered = filter_only_gen_files(generated_files_stripped)\n    missing_proto_files = find_difference(generated_files_filtered, proto_files_stripped)\n    return missing_proto_files\n", "entry_point": "identify_missing_proto_files", "input": "'/path/to/generated', '/path/to/proto'", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20912_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000438", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'dogs', 300", "output": "224", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000439", "code": "import ast\ndef count_unique_imports(module_content):\n    tree = ast.parse(module_content)\n    unique_imports = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                unique_imports.add(alias.name)\n        elif isinstance(node, ast.ImportFrom):\n            unique_imports.add(node.module)\n    return len(unique_imports)\n", "entry_point": "count_unique_imports", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108052_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000440", "code": "def convert_to_json(o):\n    if isinstance(o, (list, tuple)):\n        return [convert_to_json(oo) for oo in o]\n    if hasattr(o, 'to_json'):\n        return o.to_json()\n    if callable(o):\n        comps = [o.__module__] if o.__module__ != 'builtins' else []\n        if type(o) == type(convert_to_json):\n            comps.append(o.__name__)\n        else:\n            comps.append(o.__class__.__name__)\n        res = '.'.join(comps)\n        if type(o) == type(convert_to_json):\n            return res\n        return {'class': res}\n    return o\n", "entry_point": "convert_to_json", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112833_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000441", "code": "# Step 1: Define a dictionary to store valid usernames and passwords\nvalid_credentials = {\n    'user1': 'password1',\n    'user2': 'password2',\n    'user3': 'password3'\n}\n# Step 2: Implement the authenticate_user function\ndef authenticate_user(username: str, password: str) -> bool:\n    if username in valid_credentials:\n        return valid_credentials[username] == password\n    return False\n", "entry_point": "authenticate_user", "input": "'nonexistent_user', 'any_password'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86821_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000442", "code": "import math\n# Define the factorial function using recursion\ndef factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52131_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000443", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    seen = set()  # To avoid counting multiples of both 3 and 5 twice\n    for num in numbers:\n        if num in seen:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 6, 10, 15]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23493_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000444", "code": "from collections import Counter\ndef is_possible_to_rearrange(hand, W):\n    c = Counter(hand)\n    for i in sorted(c):\n        if c[i] > 0:\n            for j in range(W)[::-1]:\n                c[i + j] -= c[i]\n                if c[i + j] < 0:\n                    return False\n    return True\n", "entry_point": "is_possible_to_rearrange", "input": "[1, 2, 2], 4", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49940_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000445", "code": "import os\ndef process_directory_files(root_dir):\n    def get_list_of_file_paths_in_directory(root_dir):\n        paths = [os.path.join(root_dir, f) for f in os.listdir(root_dir) if os.path.isfile(os.path.join(root_dir, f))]\n        return paths\n    def get_name_from_path(path):\n        return os.path.basename(path)\n    def get_file_name_without_extension(file_name):\n        return os.path.splitext(file_name)[0]\n    try:\n        file_paths = get_list_of_file_paths_in_directory(root_dir)\n        formatted_file_names = [get_file_name_without_extension(get_name_from_path(path)) for path in file_paths]\n        return formatted_file_names\n    except FileNotFoundError:\n        return []\n", "entry_point": "process_directory_files", "input": "'/invalid/directory/path'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64287_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000446", "code": "import re\ndef get_verbose_name(class_string: str) -> str:\n    # Regular expression pattern to match the assignment of verbose_name attribute\n    pattern = r\"verbose_name\\s*=\\s*['\\\"](.*?)['\\\"]\"\n    # Search for the pattern within the class_string\n    match = re.search(pattern, class_string)\n    if match:\n        return match.group(1)  # Return the extracted verbose name\n    else:\n        return ''  # Return an empty string if verbose_name attribute is not found or assigned None\n", "entry_point": "get_verbose_name", "input": "'class MyModel:\\n    pass'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28788_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2627", "output": "{1, 2627, 37, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000448", "code": "def sum_of_even_numbers(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4563_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000449", "code": "from typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    for word in text.split():\n        processed_word = ''.join(char.lower() for char in word if char.isalnum())\n        if processed_word:\n            unique_words.add(processed_word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'wwowo!'", "output": "['wwowo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110518_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000450", "code": "def count_increasing_sums(lst):\n    num_increased = 0\n    for i in range(len(lst) - 2):\n        if lst[i] + lst[i+1] < lst[i+1] + lst[i+2]:\n            num_increased += 1\n    return num_increased\n", "entry_point": "count_increasing_sums", "input": "[1, 2, 3, 3, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14820_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000451", "code": "def check_consecutive_zeros_ones(s):\n    for i in range(len(s) - 6):\n        if s[i:i+7] == '0000000' or s[i:i+7] == '1111111':\n            return \"YES\"\n    return \"NO\"\n", "entry_point": "check_consecutive_zeros_ones", "input": "'0000000'", "output": "'YES'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34815_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000452", "code": "from functools import reduce\nfrom operator import xor\ndef find_missing_integer(xs):\n    n = len(xs)\n    xor_xs = reduce(xor, xs)\n    xor_full = reduce(xor, range(1, n + 2))\n    return xor_xs ^ xor_full\n", "entry_point": "find_missing_integer", "input": "[1, 2, 3, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77106_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000453", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[77, 78, 79]", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70185_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000454", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 10, 21]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135029_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000455", "code": "def dot_product(a, b):\n    if len(a) != len(b):\n        raise ValueError(\"Input vectors must have the same length.\")\n    result = 0\n    for ai, bi in zip(a, b):\n        result += ai * bi\n    return result\n", "entry_point": "dot_product", "input": "[1, -3], [1, 1]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10235_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000456", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "638", "output": "{1, 2, 11, 22, 58, 29, 638, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000457", "code": "CIRCULAR_PARAMS_DICT = {\n    'per tp e w k': 'per tp k',\n    'per tc secosw sesinw logk': 'per tc logk',\n    'per tc secosw sesinw k': 'per tc k',\n    'per tc ecosw esinw k': 'per tc k',\n    'per tc e w k': 'per tc k',\n    'logper tc secosw sesinw k': 'logper tc k',\n    'logper tc secosw sesinw logk': 'logper tc logk',\n    'per tc se w k': 'per tc k',\n    'logper tp e w logk': 'logper tp logk'\n}\ndef process_input_string(input_str):\n    words = input_str.split()\n    key = ' '.join(words)\n    if key in CIRCULAR_PARAMS_DICT:\n        return CIRCULAR_PARAMS_DICT[key]\n    else:\n        return \"No match found\"\n", "entry_point": "process_input_string", "input": "'this string has no match'", "output": "'No match found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68067_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000458", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 3, 4, 6, 10]", "output": "4.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000459", "code": "import os\nimport fnmatch\ndef custom_glob(path, pattern):\n    matches = []\n    for root, dirnames, filenames in os.walk(path):\n        for filename in filenames:\n            if fnmatch.fnmatch(filename, pattern):\n                matches.append(os.path.join(root, filename))\n    return matches\n", "entry_point": "custom_glob", "input": "'/non/existent/path', '*.txt'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95459_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000460", "code": "def find_last_number_less_than_five(numbers):\n    for num in reversed(numbers):\n        if num < 5:\n            return num\n    return None\n", "entry_point": "find_last_number_less_than_five", "input": "[7, 8, 9, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109099_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000461", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "22, 22", "output": "22.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000462", "code": "def sum_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 6]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34159_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000463", "code": "import string\ndef count_unique_words(text):\n    text = text.lower()\n    words = text.split()\n    unique_words = set()\n    for word in words:\n        word = word.strip(string.punctuation)\n        unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'hello, hello!'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120267_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000464", "code": "def render_graph_template(graphs, graph_name):\n    graph = graphs.get(graph_name)\n    if graph and hasattr(graph, \"responding\"):\n        return 'bar_data.html'\n    else:\n        return 'line_data.html'\n", "entry_point": "render_graph_template", "input": "{}, 'non_existent_graph'", "output": "'line_data.html'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74962_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000465", "code": "def get_segments(flag, start, end):\n    segments = []\n    # Sample data for demonstration purposes\n    data = {\n        'H1_DATA': [\n            (1126073529, 1126114861),\n            (1126121462, 1126123267),\n            (1126123553, 1126126832),\n            (1126139205, 1126139266),\n            (1126149058, 1126151217),\n        ],\n        'L1_DATA': [\n            (1126259446, 1126259478),\n        ]\n    }\n    if flag in data:\n        for segment in data[flag]:\n            if start <= segment[0] <= end or start <= segment[1] <= end:\n                segments.append(segment)\n    return segments\n", "entry_point": "get_segments", "input": "'L1_DATA', 1126259445, 1126259479", "output": "[(1126259446, 1126259478)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99841_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000466", "code": "from typing import List, Dict, Union\ndef calculate_total_revenue(sales_data: List[Dict[str, Union[str, int, float]]]) -> float:\n    total_revenue = 0.0\n    for sale in sales_data:\n        total_revenue += sale['total_price']\n    return total_revenue\n", "entry_point": "calculate_total_revenue", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102335_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000467", "code": "def compare_lists(list_a, list_b, comparison_type):\n    comparison_results = []\n    for a, b in zip(list_a, list_b):\n        if comparison_type == \"A = B\":\n            comparison_results.append(a == b)\n        elif comparison_type == \"A != B\":\n            comparison_results.append(a != b)\n        elif comparison_type == \"A < B\":\n            comparison_results.append(a < b)\n        elif comparison_type == \"A <= B\":\n            comparison_results.append(a <= b)\n        elif comparison_type == \"A > B\":\n            comparison_results.append(a > b)\n        elif comparison_type == \"A >= B\":\n            comparison_results.append(a >= b)\n        elif comparison_type == \"A is B\":\n            comparison_results.append(a is b)\n        elif comparison_type == \"A is None\":\n            comparison_results.append(a is None)\n    return comparison_results\n", "entry_point": "compare_lists", "input": "[], [], 'A = B'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31090_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000468", "code": "from typing import List\ndef max_distance(colors: List[int]) -> int:\n    color_indices = {}\n    max_dist = 0\n    for i, color in enumerate(colors):\n        if color not in color_indices:\n            color_indices[color] = i\n        else:\n            max_dist = max(max_dist, i - color_indices[color])\n    return max_dist\n", "entry_point": "max_distance", "input": "[1, 2, 3, 4, 5, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93339_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000469", "code": "def extract_variables(file_content):\n    extracted_variables = {}\n    # Extract LINEDIR value\n    linedir_start = file_content.find(\"LINEDIR=\") + len(\"LINEDIR=\")\n    linedir_end = file_content.find(\"\\n\", linedir_start)\n    linedir_value = file_content[linedir_start:linedir_end].strip()\n    # Extract LINE_VERSION value\n    line_version_start = file_content.find(\"LINE_VERSION=\") + len(\"LINE_VERSION=\")\n    line_version_end = file_content.find(\"\\n\", line_version_start)\n    line_version_value = file_content[line_version_start:line_version_end].strip()\n    extracted_variables['LINEDIR'] = linedir_value\n    extracted_variables['LINE_VERSION'] = line_version_value\n    return extracted_variables\n", "entry_point": "extract_variables", "input": "'LINEDIR=\\nLINE_VERSION=\\n'", "output": "{'LINEDIR': '', 'LINE_VERSION': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105382_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000470", "code": "import re\ndef extract_module_info(docstring):\n    module_info = {}\n    module_name_match = re.search(r\"\\.\\. module:: (.+)\", docstring)\n    if module_name_match:\n        module_info[\"module_name\"] = module_name_match.group(1)\n    platforms_match = re.search(r\":platform: (.+)\", docstring)\n    if platforms_match:\n        module_info[\"platforms\"] = platforms_match.group(1).split(\", \")\n    brief_description_match = re.search(r\":synopsis: (.+)\", docstring)\n    if brief_description_match:\n        module_info[\"brief_description\"] = brief_description_match.group(1)\n    author_match = re.search(r\"\\.\\. moduleauthor:: (.+)\", docstring)\n    if author_match:\n        author_info = author_match.group(1).split(\" <\")\n        module_info[\"author_name\"] = author_info[0]\n        module_info[\"author_email\"] = author_info[1].replace(\">\", \"\")\n    return module_info\n", "entry_point": "extract_module_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108778_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000471", "code": "def evaluate_expression(expression: str) -> int:\n    def evaluate_helper(tokens):\n        stack = []\n        for token in tokens:\n            if token == '(':\n                stack.append('(')\n            elif token == ')':\n                sub_expr = []\n                while stack[-1] != '(':\n                    sub_expr.insert(0, stack.pop())\n                stack.pop()  # Remove '('\n                stack.append(evaluate_stack(sub_expr))\n            else:\n                stack.append(token)\n        return evaluate_stack(stack)\n    def evaluate_stack(stack):\n        operators = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y}\n        res = int(stack.pop(0))\n        while stack:\n            operator = stack.pop(0)\n            operand = int(stack.pop(0))\n            res = operators[operator](res, operand)\n        return res\n    tokens = expression.replace('(', ' ( ').replace(')', ' ) ').split()\n    return evaluate_helper(tokens)\n", "entry_point": "evaluate_expression", "input": "'50 + 5'", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122820_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000472", "code": "# Define the predefined hashes for each package\npackage_hashes = {\n    'pendulum': [\n        'sha256:a97e3ed9557ac0c5c3742f21fa4d852d7a050dd9b1b517e993aebef2dd2eea52',\n        'sha256:641140a05f959b37a177866e263f6f53a53b711fae6355336ee832ec1a59da8a'\n    ],\n    'pytzdata': [\n        'sha256:a4d11b8123d00e947fac88508292b9e148da884fc64b884d9da3897a35fa2ab0',\n        'sha256:ec36940a8eec0a2ebc66a257a746428f7b4acce24cc000b3cda4805f259a8cd2'\n    ],\n    'requests': [\n        'sha256:66f332ae62593b874a648b10a8cb106bfdacd2c6288ed7dec3713c3a808a6017',\n        'sha256:b70696ebd1a5e6b627e7e3ac1365a4bc60aaf3495e843c1e70448966c5224cab'\n    ]\n}\ndef validate_hash(package_name, installed_hash):\n    if package_name in package_hashes:\n        return installed_hash in package_hashes[package_name]\n    return False\n", "entry_point": "validate_hash", "input": "'nonexistentpackage', 'somehash'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144233_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000473", "code": "OUTPUT_TYPES = ((\".htm\", \"html\"),\n                (\".html\", \"html\"),\n                (\".xml\", \"xml\"),\n                (\".tag\", \"tag\"))\ndef get_file_type(extension: str) -> str:\n    for ext, file_type in OUTPUT_TYPES:\n        if extension == ext:\n            return file_type\n    return \"Unknown\"\n", "entry_point": "get_file_type", "input": "'txt'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7593_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000474", "code": "def extract_metadata(script_content):\n    metadata = {}\n    lines = script_content.split('\\n')\n    for line in lines:\n        if line.startswith(\"__author__\"):\n            metadata[\"author\"] = line.split(\"=\")[1].strip().strip('\"')\n        elif line.startswith(\"__email__\"):\n            metadata[\"email\"] = line.split(\"=\")[1].strip().strip('\"')\n        elif line.startswith(\"__version__\"):\n            metadata[\"version\"] = line.split(\"=\")[1].strip().strip('\"')\n    return metadata\n", "entry_point": "extract_metadata", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140587_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000475", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'2:00 AM', '2:52'", "output": "'4:52 AM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000476", "code": "def common_characters(s1: str, s2: str) -> int:\n    s1_dict = {}\n    s2_dict = {}\n    count = 0\n    for letter in s1:\n        s1_dict[letter] = s1.count(letter)\n        s1 = s1.replace(letter, \"\", 1)  # Remove the first occurrence of the letter\n    for letter in s2:\n        s2_dict[letter] = s2.count(letter)\n        s2 = s2.replace(letter, \"\", 1)  # Remove the first occurrence of the letter\n    for letter in s1_dict:\n        if letter in s2_dict:\n            count += min(s1_dict[letter], s2_dict[letter])\n    return count\n", "entry_point": "common_characters", "input": "'abcabc', 'aabb'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29180_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000477", "code": "from typing import List\ndef count_unique_numbers(nums: List[int]) -> int:\n    unique_numbers = []\n    for num in nums:\n        if num not in unique_numbers:\n            unique_numbers.append(num)\n    return len(unique_numbers)\n", "entry_point": "count_unique_numbers", "input": "[1, 2, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136241_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000478", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 100, 90, 80, 70, 60, 50, 40]", "output": "[1, 1, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000479", "code": "def max_non_adjacent_sum(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        temp = inclusive\n        inclusive = max(exclusive + num, inclusive)\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[5, 1, 6, 2, 3]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18420_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000480", "code": "def get_char_width(char):\n    def _char_in_map(char, map):\n        for begin, end in map:\n            if char < begin:\n                break\n            if begin <= char <= end:\n                return True\n        return False\n    char = ord(char)\n    _COMBINING_CHARS = [(768, 879)]\n    _EAST_ASIAN_WILD_CHARS = [(11904, 55215)]  # Example range for East Asian wide characters\n    if _char_in_map(char, _COMBINING_CHARS):\n        return 0\n    if _char_in_map(char, _EAST_ASIAN_WILD_CHARS):\n        return 2\n    return 1\n", "entry_point": "get_char_width", "input": "'A'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65761_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000481", "code": "def length_of_longest_substring(s):\n    char_index_map = {}\n    start = 0\n    max_length = 0\n    for end in range(len(s)):\n        if s[end] in char_index_map and char_index_map[s[end]] >= start:\n            start = char_index_map[s[end]] + 1\n        max_length = max(max_length, end - start + 1)\n        char_index_map[s[end]] = end\n    return max_length\n", "entry_point": "length_of_longest_substring", "input": "'ab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22531_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000482", "code": "def filter_bookings(bookings):\n    return [booking for booking in bookings if booking['status'] != 'cancelled']\n", "entry_point": "filter_bookings", "input": "[{'id': 1, 'status': 'cancelled'}, {'id': 2, 'status': 'cancelled'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120734_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000483", "code": "import re\ndef validate_uuid(uuid_str):\n    if len(uuid_str) != 36:\n        return False\n    pattern = re.compile(r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\n    if pattern.match(uuid_str):\n        return True\n    else:\n        return False\n", "entry_point": "validate_uuid", "input": "'123'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13859_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000484", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        if not char.isspace():\n            char = char.lower()\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'A'", "output": "{'a': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36956_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000485", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = round(total_score / len(scores))\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[88, 88, 88, 88, 88]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39790_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000486", "code": "import math\ndef generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, n + 1, i):\n                is_prime[j] = False\n    primes = [num for num in range(2, n + 1) if is_prime[num]]\n    return primes\n", "entry_point": "generate_primes", "input": "17", "output": "[2, 3, 5, 7, 11, 13, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9676_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000487", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[1, -3, 1, 5, 8, 8]", "output": "[1, -27, 1, 125, 64, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000488", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene1.mut1,,gene3.mut3'", "output": "[('gene1', 'mut1'), ('',), ('gene3', 'mut3')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000489", "code": "import re\nBLOCKED_KEYWORDS = [\"apple\", \"banana\", \"orange\"]\ndef replace_blocked_keywords(text):\n    modified_text = text.lower()\n    for keyword in BLOCKED_KEYWORDS:\n        modified_text = re.sub(r'\\b' + re.escape(keyword) + r'\\b', '*' * len(keyword), modified_text, flags=re.IGNORECASE)\n    return modified_text\n", "entry_point": "replace_blocked_keywords", "input": "'aniba'", "output": "'aniba'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141680_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000490", "code": "def max_profit(stock_prices):\n    if not stock_prices:\n        return 0\n    max_profit = 0\n    min_price = stock_prices[0]\n    for price in stock_prices[1:]:\n        min_price = min(min_price, price)\n        potential_profit = price - min_price\n        max_profit = max(max_profit, potential_profit)\n    return max_profit\n", "entry_point": "max_profit", "input": "[1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18541_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000491", "code": "import re\nBOOLEAN = \"BOOLEAN\"\nINT_LIST = \"INT_LIST\"\nFLOAT_LIST = \"FLOAT_LIST\"\nBOOLEAN_LIST = \"BOOLEAN_LIST\"\nVOID = \"VOID\"\nOBJECT = \"OBJECT\"\nSEMANTIC_ERROR = 99\n# Regular expressions to match data types\nREGEX_BOOLEAN = r'true|false'\nregex_boolean = re.compile(REGEX_BOOLEAN)\nREGEX_INT = r'[0-9][0-9]*'\nregex_int = re.compile(REGEX_INT)\nREGEX_FLOAT = r'[0-9]*[\\.][0-9]+'\nregex_float = re.compile(REGEX_FLOAT)\nREGEX_OBJECT = r'cube|sphere'\nregex_object = re.compile(REGEX_OBJECT)\ndef validate_data_type(data_type, value):\n    if data_type == BOOLEAN:\n        return bool(regex_boolean.match(value))\n    elif data_type == INT_LIST:\n        return bool(regex_int.match(value))\n    elif data_type == FLOAT_LIST:\n        return bool(regex_float.match(value))\n    elif data_type == OBJECT:\n        return bool(regex_object.match(value))\n    else:\n        return SEMANTIC_ERROR\n", "entry_point": "validate_data_type", "input": "BOOLEAN, 'true'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000492", "code": "def calculate_similarity(fingerprint1, fingerprint2):\n    intersection = fingerprint1.intersection(fingerprint2)\n    union = fingerprint1.union(fingerprint2)\n    if len(union) == 0:\n        return 0.0\n    else:\n        return len(intersection) / len(union)\n", "entry_point": "calculate_similarity", "input": "set(), set()", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78329_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000493", "code": "from typing import List\ndef count_pairs_with_sum(arr: List[int], target: int) -> int:\n    num_count = {}\n    pair_count = 0\n    for num in arr:\n        diff = target - num\n        if diff in num_count:\n            pair_count += num_count[diff]\n        num_count[num] = num_count.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_with_sum", "input": "[1, 5, 2, 4, 3, 3], 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126849_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000494", "code": "def get_storage_type(storage_path):\n    if storage_path.startswith(\"s3:\"):\n        return \"s3\"\n    elif storage_path.startswith(\"local:\"):\n        return \"local\"\n    else:\n        return \"Unknown\"\n", "entry_point": "get_storage_type", "input": "'ftp:'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80794_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000495", "code": "import re\ndef extract_smiles_index_info(setup_code):\n    info = {}\n    # Regular expressions to match relevant information\n    path_pattern = re.compile(r'MakeSmilesIndex\\((.+),\\s*(.+),\\s*hasHeader=(\\w+),\\s*smilesColumn=\"(.+)\",\\s*nameColumn=\"(.+)\"\\)')\n    # Find the relevant line in the setup code\n    match = path_pattern.search(setup_code)\n    if match:\n        info['MolFileIndexPath'] = match.group(1).strip()\n        info['DirectoryPath'] = match.group(2).strip()\n        info['HasHeader'] = match.group(3).strip() == 'True'\n        info['SmilesColumn'] = match.group(4).strip()\n        info['NameColumn'] = match.group(5).strip()\n    return info\n", "entry_point": "extract_smiles_index_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56673_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000496", "code": "from typing import List, Dict\ndef validate_vehicles(vehicles: List[Dict[str, any]]) -> bool:\n    if len(vehicles) != 1000:\n        return False\n    if not isinstance(vehicles, list):\n        return False\n    first_vehicle = vehicles[0]\n    if first_vehicle != {\n        \"id_\": 1,\n        \"manufacturer\": \"Mazda\",\n        \"model\": \"RX-8\",\n        \"year\": 2006,\n        \"vin\": \"JTJBARBZ2F2356837\",\n    }:\n        return False\n    last_vehicle = vehicles[-1]\n    if last_vehicle[\"id_\"] != 1000:\n        return False\n    return True\n", "entry_point": "validate_vehicles", "input": "[{'id_': i} for i in range(1, 1000)]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42573_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000497", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[3, 4, 5, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000498", "code": "def sum_of_unique_pairs(nums, target):\n    seen = set()\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            count += 1\n            seen.remove(complement)\n        else:\n            seen.add(num)\n    return count\n", "entry_point": "sum_of_unique_pairs", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78039_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000499", "code": "def caesar_cipher(text, shift):\n    result = \"\"\n    for char in text:\n        if char.isupper():\n            new_char = chr((ord(char) - 65 + shift) % 26 + 65)\n            result += new_char\n    return result\n", "entry_point": "caesar_cipher", "input": "'AA', 7", "output": "'HH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7376_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000500", "code": "import re\ndef extract_links(web_page_content):\n    pattern = r'<a\\s+(?:[^>]*?\\s+)?href=\"([^\"]*)\"'\n    return re.findall(pattern, web_page_content)\n", "entry_point": "extract_links", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31690_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000501", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'exdceeds', '11.2.0.0'", "output": "'11.2.0.0exdceeds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000502", "code": "def find_pattern_indices(text, pattern):\n    indices = []\n    pattern_len = len(pattern)\n    for i in range(len(text) - pattern_len + 1):\n        if text[i:i+pattern_len] == pattern:\n            indices.append((i, i+pattern_len-1))\n    return indices\n", "entry_point": "find_pattern_indices", "input": "'', 'abc'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67374_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000503", "code": "def rock_paper_scissors_winner(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie!\"\n    elif (player1_choice == \"rock\" and player2_choice == \"scissors\") or \\\n         (player1_choice == \"scissors\" and player2_choice == \"paper\") or \\\n         (player1_choice == \"paper\" and player2_choice == \"rock\"):\n        return \"Player 1 wins!\"\n    else:\n        return \"Player 2 wins!\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'paper'", "output": "'Player 2 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136725_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000504", "code": "def max_profit(prices):\n    buy1 = buy2 = float('inf')\n    sell1 = sell2 = 0\n    for price in prices:\n        buy1 = min(buy1, price)\n        sell1 = max(sell1, price - buy1)\n        buy2 = min(buy2, price - sell1)\n        sell2 = max(sell2, price - buy2)\n    return sell2\n", "entry_point": "max_profit", "input": "[1, 2, 5, 3, 6]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118396_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000505", "code": "def update_namespace(csl_json, NSDICT):\n    for obj in csl_json:\n        if 'namespace' in obj:\n            namespace_key = obj['namespace'].split('/')[-1]  # Extract the namespace key\n            NSDICT[namespace_key] = obj['namespace']  # Update the namespace dictionary\n    return NSDICT\n", "entry_point": "update_namespace", "input": "[], {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107140_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000506", "code": "def find_duplicate_url_paths(url_patterns):\n    url_path_indices = {}\n    duplicates = []\n    for idx, pattern in enumerate(url_patterns):\n        url_path = pattern.split(\"path(r'\")[1].split(\"',\")[0]\n        if url_path in url_path_indices:\n            url_path_indices[url_path].append(idx)\n        else:\n            url_path_indices[url_path] = [idx]\n    for path, indices in url_path_indices.items():\n        if len(indices) > 1:\n            duplicates.append(path)\n    return duplicates\n", "entry_point": "find_duplicate_url_paths", "input": "[\"path(r'/home')\", \"path(r'/about')\"]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144168_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000507", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "10, 4", "output": "'14:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000508", "code": "import json\ndef validate_vendor_data(json_response):\n    try:\n        data = json.loads(json_response)\n        if data.get('static') != {}:\n            return False\n        if data.get('testing') != {'a': 1, 'b': 'foo'}:\n            return False\n        if data.get('hamster') != {'a': 1, 'b': 'foo'}:\n            return False\n        return True\n    except json.JSONDecodeError:\n        return False\n", "entry_point": "validate_vendor_data", "input": "'{static: }'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4694_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000509", "code": "from typing import Optional\ndef time_spec_to_seconds(spec: str) -> Optional[int]:\n    time_units = {'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1}\n    components = []\n    current_component = ''\n    for char in spec:\n        if char.isnumeric():\n            current_component += char\n        elif char in time_units:\n            if current_component:\n                components.append((int(current_component), char))\n                current_component = ''\n        else:\n            current_component = ''  # Reset if delimiter other than time unit encountered\n    if current_component:\n        components.append((int(current_component), 's'))  # Assume seconds if no unit specified\n    total_seconds = 0\n    last_unit_index = -1\n    for value, unit in components:\n        unit_index = 'wdhms'.index(unit)\n        if unit_index < last_unit_index:\n            return None  # Out of order, return None\n        total_seconds += value * time_units[unit]\n        last_unit_index = unit_index\n    return total_seconds\n", "entry_point": "time_spec_to_seconds", "input": "'1m1s'", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65809_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000510", "code": "def longest_consecutive_sequence(char_stream):\n    current_length = 0\n    longest_length = 0\n    for char in char_stream:\n        if char.isalpha():\n            current_length += 1\n        else:\n            longest_length = max(longest_length, current_length)\n            current_length = 0\n    longest_length = max(longest_length, current_length)  # Check for the last sequence\n    return longest_length\n", "entry_point": "longest_consecutive_sequence", "input": "'abc123'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83866_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000511", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "1, -0.9440149339752388", "output": "-0.4720074669876194", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000512", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalnum():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7214_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000513", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9545", "output": "{1, 5, 9545, 83, 115, 1909, 23, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000514", "code": "def transform_none_to_empty(data):\n    for person in data:\n        for key, value in person.items():\n            if value is None:\n                person[key] = ''\n    return data\n", "entry_point": "transform_none_to_empty", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9611_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000515", "code": "def color_negative_red(val):\n    color = 'red' if val > 0.05 else 'green'\n    return 'color: %s' % color\n", "entry_point": "color_negative_red", "input": "0.1", "output": "'color: red'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80039_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "988", "output": "{1, 2, 4, 38, 76, 13, 494, 19, 52, 247, 26, 988}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt987", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000517", "code": "def calculate_total_scores(student_records):\n    total_scores = {}\n    for record in student_records:\n        student_name, scores = list(record.items())[0]\n        total_score = sum(scores)\n        total_scores[student_name] = total_score\n    return total_scores\n", "entry_point": "calculate_total_scores", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34001_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000518", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[4, 32, 6, 6, 7, 6, 7, 11]", "output": "[36, 38, 12, 13, 13, 13, 18, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000519", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7739", "output": "{1, 7739, 109, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000520", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5646", "output": "{1, 2, 3, 6, 2823, 941, 5646, 1882}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000521", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'hello'", "output": "b'\\x05\\x00\\x00\\x00hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000522", "code": "def min_subarray_length(nums, target):\n    left = 0\n    size = len(nums)\n    res = size + 1\n    sub_sum = 0\n    for right in range(size):\n        sub_sum += nums[right]\n        while sub_sum >= target:\n            sub_length = (right - left + 1)\n            if sub_length < res:\n                res = sub_length\n            sub_sum -= nums[left]\n            left += 1\n    if res == (size + 1):\n        return 0\n    else:\n        return res\n", "entry_point": "min_subarray_length", "input": "[5], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127187_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000523", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 6, 9, 15]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000524", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "10", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000525", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[4, 1, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000526", "code": "def common_end(list1, list2):\n    return list1[0] == list2[0] or list1[-1] == list2[-1]\n", "entry_point": "common_end", "input": "[1, 2, 3], [1, 4, 5]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75755_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000527", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[90, 80, 70, 60, 60, 50, 40, 30]", "output": "[1, 2, 3, 4, 4, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138156_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000528", "code": "def max_nested_parentheses_depth(input_str):\n    depth = 0\n    max_depth = 0\n    for char in input_str:\n        if char == '(':\n            depth += 1\n            max_depth = max(max_depth, depth)\n        elif char == ')':\n            depth -= 1\n    return max_depth\n", "entry_point": "max_nested_parentheses_depth", "input": "'((()))'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80515_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1996", "output": "{1, 2, 4, 998, 1996, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1995", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000530", "code": "def extract_version_number(file_path):\n    version = \"\"\n    found_v = False\n    for char in reversed(file_path):\n        if char.isdigit() or char == '.':\n            version = char + version\n            found_v = False\n        elif char == 'v' and not found_v:\n            found_v = True\n            version = char + version\n        elif found_v:\n            break\n    return version[1:]  # Exclude the 'v' at the beginning\n", "entry_point": "extract_version_number", "input": "'path/to/file/v1.2.3.'", "output": "'1.2.3.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18270_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000531", "code": "def calculate_chunk_range(selection, chunks):\n    chunk_range = []\n    for s, l in zip(selection, chunks):\n        if isinstance(s, slice):\n            start_chunk = s.start // l\n            end_chunk = (s.stop - 1) // l\n            chunk_range.append(list(range(start_chunk, end_chunk + 1)))\n        else:\n            chunk_range.append([s // l])\n    return chunk_range\n", "entry_point": "calculate_chunk_range", "input": "[slice(0, 9), 15], [3, 3]", "output": "[[0, 1, 2], [5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128291_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000532", "code": "import re\ndef parse_liquid_expression(expression):\n    tokens = re.findall(r'\\{\\{.*?\\}\\}|\\{%.*?%\\}', expression)\n    tokens = [token.strip('{}% ') for token in tokens]\n    return tokens\n", "entry_point": "parse_liquid_expression", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104291_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3399", "output": "{1, 33, 3, 3399, 103, 11, 1133, 309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000534", "code": "def calculate_acertos(dados, rerolagens):\n    if dados == 0:\n        return 0\n    def mostraResultado(arg1, arg2):\n        # Placeholder for the actual implementation of mostraResultado\n        # For the purpose of this problem, we will simulate its behavior\n        return arg2 // 2, arg2 // 3\n    acertos_normal, dados_normal = mostraResultado('defesa', dados)\n    acertos_final = acertos_normal\n    if rerolagens > 0 and acertos_normal < dados_normal:\n        acertos_rerolagem, dados_rerodados = mostraResultado('defesa', rerolagens)\n        acertos_final += acertos_rerolagem\n    if acertos_final > dados_normal:\n        acertos_final = dados_normal\n    return acertos_final\n", "entry_point": "calculate_acertos", "input": "6, 0", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90056_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000535", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[8, 5, 2]", "output": "[64, 25, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6137", "output": "{1, 323, 361, 17, 19, 6137}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000537", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "31, 12", "output": "(2.5833333333333335, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000538", "code": "def parse(data):\n    key_start = data.find(':') + 2  # Find the start index of the key\n    key_end = data.find('=', key_start)  # Find the end index of the key\n    key = data[key_start:key_end].strip()  # Extract and strip the key\n    value_start = data.find('\"', key_end) + 1  # Find the start index of the value\n    value_end = data.rfind('\"')  # Find the end index of the value\n    value = data[value_start:value_end]  # Extract the value\n    # Unescape the escaped characters in the value\n    value = value.replace('\\\\\"', '\"').replace('\\\\\\\\', '\\\\')\n    return {key: [value]}  # Return the key-value pair as a dictionary\n", "entry_point": "parse", "input": "': \"\"Bkey{\\\\\"a\\\\\" = \"c\"\"Bkey{\"a\\\\\"'", "output": "{'\"\"Bkey{\\\\\"a\\\\\"': ['c\"\"Bkey{\"a\\\\']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85764_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000539", "code": "import os\nimport re\ndef extract_versions(directory):\n    versions_dict = {}\n    for root, dirs, files in os.walk(directory):\n        for file in files:\n            if file == '__init__.py':\n                package_name = os.path.basename(root)\n                init_path = os.path.join(root, file)\n                with open(init_path) as f:\n                    version = re.compile(r\".*__version__ = '(.*?)'\", re.S).match(f.read()).group(1)\n                versions_dict[package_name] = version\n    return versions_dict\n", "entry_point": "extract_versions", "input": "'/path/to/empty/directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000540", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[6, 10, 6, 10, 10, 6, 6], 9", "output": "[36, 1000, 36, 1000, 1000, 36, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000541", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[2, 2, 3, 4, -1, -1, 5, -2, -2]", "output": "[2, 3, 4, 5, -2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000542", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    # Split the input string at the '.' character\n    app_name, config_class = default_app_config.split('.')[:2]\n    # Return a tuple containing the app name and configuration class name\n    return app_name, config_class\n", "entry_point": "parse_default_app_config", "input": "'gunmel.apns'", "output": "('gunmel', 'apns')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77517_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000543", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    max_sum = arr[0]  # Initialize with the first element\n    current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9022_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000544", "code": "import re\ndef repair_move_path(path: str) -> str:\n    # Define a regular expression pattern to match elements like '{org=>com}'\n    FILE_PATH_RENAME_RE = re.compile(r'\\{([^}]+)=>([^}]+)\\}')\n    # Replace the matched elements with the desired format using re.sub\n    return FILE_PATH_RENAME_RE.sub(r'\\2', path)\n", "entry_point": "repair_move_path", "input": "'/project/{old=>com}/file.txt'", "output": "'/project/com/file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137172_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000545", "code": "import math\ndef calculate_distance_traveled(rotations_right, rotations_left, wheel_radius):\n    distance_right = wheel_radius * 2 * math.pi * rotations_right\n    distance_left = wheel_radius * 2 * math.pi * rotations_left\n    total_distance = (distance_right + distance_left) / 2\n    return total_distance\n", "entry_point": "calculate_distance_traveled", "input": "810, 810, 0.1", "output": "508.93800988154646", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15765_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000546", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4233", "output": "{1, 3, 1411, 4233, 17, 51, 83, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000547", "code": "def simulate_card_game(deck_a, deck_b):\n    round_count = 0\n    history = set()\n    while round_count < 100 and deck_a and deck_b:\n        round_count += 1\n        current_state = (tuple(deck_a), tuple(deck_b))\n        if current_state in history:\n            return 'Draw'\n        history.add(current_state)\n        card_a, card_b = deck_a.pop(0), deck_b.pop(0)\n        if card_a > card_b:\n            deck_a.extend([card_a, card_b])\n        elif card_b > card_a:\n            deck_b.extend([card_b, card_a])\n        else:\n            if len(deck_a) < 3 or len(deck_b) < 3:\n                return 'Draw'\n            else:\n                war_cards = [card_a, card_b] + deck_a[:3] + deck_b[:3]\n                deck_a = deck_a[3:]\n                deck_b = deck_b[3:]\n                if war_cards[2] > war_cards[5]:\n                    deck_a.extend(war_cards)\n                else:\n                    deck_b.extend(war_cards)\n    if not deck_a:\n        return 'Player B'\n    elif not deck_b:\n        return 'Player A'\n    else:\n        return 'Draw'\n", "entry_point": "simulate_card_game", "input": "[5, 4, 3], [2, 1, 0]", "output": "'Player A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98621_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000548", "code": "def authenticate_user(username: str, password: str) -> str:\n    valid_username = \"admin\"\n    valid_password = \"P@ssw0rd\"\n    if username == valid_username:\n        if password == valid_password:\n            return \"Authentication successful\"\n        else:\n            return \"Incorrect password\"\n    else:\n        return \"Unknown username\"\n", "entry_point": "authenticate_user", "input": "'user123', 'any_password'", "output": "'Unknown username'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121086_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000549", "code": "def sum_multiples_of_divisor(numbers, divisor):\n    sum_multiples = 0\n    for num in numbers:\n        if num % divisor == 0:\n            sum_multiples += num\n    return sum_multiples\n", "entry_point": "sum_multiples_of_divisor", "input": "[100, 109], 1", "output": "209", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74016_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000550", "code": "def check_consecutive_zeros_ones(s):\n    for i in range(len(s) - 6):\n        if s[i:i+7] == '0000000' or s[i:i+7] == '1111111':\n            return \"YES\"\n    return \"NO\"\n", "entry_point": "check_consecutive_zeros_ones", "input": "'0000001'", "output": "'NO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34815_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000551", "code": "def str2bool(v):\n    return str(v).lower() in (\"yes\", \"true\", \"t\", \"1\")\n", "entry_point": "str2bool", "input": "0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47020_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000552", "code": "def find_smallest(lst):\n    smallest = float('inf')  # Initialize with a large value\n    for num in lst:\n        if num < smallest:\n            smallest = num\n    return smallest\n", "entry_point": "find_smallest", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80996_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000553", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[92]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113339_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000554", "code": "def extract_info_from_code(code_snippet):\n    info_dict = {}\n    for line in code_snippet.splitlines():\n        if \"__version__\" in line:\n            info_dict[\"version\"] = line.split(\"=\")[1].strip().strip('\"')\n        elif \"__license__\" in line:\n            info_dict[\"license\"] = line.split(\"=\")[1].strip().strip('\"')\n        elif \"__author__\" in line:\n            info_dict[\"author\"] = line.split(\"=\")[1].strip().strip('\"')\n    return info_dict\n", "entry_point": "extract_info_from_code", "input": "'def example_function():\\n    pass'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68494_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000555", "code": "from typing import List\ndef majority_element(nums: List[int]) -> int:\n    candidate = None\n    count = 0\n    for num in nums:\n        if count == 0:\n            candidate = num\n            count = 1\n        elif num == candidate:\n            count += 1\n        else:\n            count -= 1\n    return candidate\n", "entry_point": "majority_element", "input": "[1, 1, 1, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126055_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000556", "code": "import re\ndef extract_unique_words(text):\n    unique_words = set()\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word = ''.join(char for char in word if char.isalnum())\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'world!'", "output": "['world']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13022_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000557", "code": "def find_pair_sum_indices(nums, target):\n    seen = {}  # Dictionary to store numbers seen so far along with their indices\n    for i, num in enumerate(nums):\n        diff = target - num\n        if diff in seen:\n            return (seen[diff], i)\n        seen[num] = i\n    return None\n", "entry_point": "find_pair_sum_indices", "input": "[10, 15, 5], 20", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32000_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000558", "code": "from typing import List\ndef find_last_target(nums: List[int], target: int) -> int:\n    left = 0\n    right = len(nums) - 1\n    while left + 1 < right:\n        mid = int(left + (right - left) / 2)\n        if nums[mid] == target:\n            left = mid\n        elif nums[mid] > target:\n            right = mid\n        elif nums[mid] < target:\n            left = mid\n    if nums[right] == target:\n        return right\n    if nums[left] == target:\n        return left\n    return -1\n", "entry_point": "find_last_target", "input": "[1, 2, 3], 4", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72340_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000559", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'Hello!'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000560", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7610", "output": "{1, 2, 5, 10, 1522, 761, 7610, 3805}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7609", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7732", "output": "{1, 2, 4, 1933, 7732, 3866}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7731", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000562", "code": "import re\ndef count_unique_module_imports(code_snippet):\n    module_imports = set()\n    import_pattern = r'(?:import|from)\\s+([\\w\\.]+)'\n    imports = re.findall(import_pattern, code_snippet)\n    for imp in imports:\n        module_imports.add(imp)\n    return len(module_imports)\n", "entry_point": "count_unique_module_imports", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9039_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000563", "code": "def is_palindrome_list(lst):\n    def is_palindrome_helper(start, end):\n        if start >= end:\n            return True\n        if lst[start] == lst[end]:\n            return is_palindrome_helper(start + 1, end - 1)\n        return False\n    return is_palindrome_helper(0, len(lst) - 1)\n", "entry_point": "is_palindrome_list", "input": "[1, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128718_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000564", "code": "def calculate_class_weight(total_samples: int, num_classes: int, class_samples: int) -> float:\n    class_weight = total_samples / (num_classes * class_samples)\n    return class_weight\n", "entry_point": "calculate_class_weight", "input": "20, 4, 7", "output": "0.7142857142857143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69664_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000565", "code": "def validate_postgresql_events(events):\n    for evt in events:\n        if \"postgresql\" not in evt or \"activity\" not in evt[\"postgresql\"]:\n            return False\n        db_info = evt[\"postgresql\"][\"activity\"].get(\"database\")\n        if not db_info or \"name\" not in db_info or \"oid\" not in db_info:\n            return False\n        if \"state\" not in evt[\"postgresql\"][\"activity\"]:\n            return False\n    return True\n", "entry_point": "validate_postgresql_events", "input": "[{'postgresql': {}}]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_918_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000566", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'app.settings.wwathBCCConfigawiw'", "output": "'wwathBCCConfigawiw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000567", "code": "def calculate_max_drawdown_ratio(stock_prices):\n    if not stock_prices:\n        return 0.0\n    peak = stock_prices[0]\n    trough = stock_prices[0]\n    max_drawdown_ratio = 0.0\n    for price in stock_prices:\n        if price > peak:\n            peak = price\n            trough = price\n        elif price < trough:\n            trough = price\n            drawdown = peak - trough\n            drawdown_ratio = drawdown / peak\n            max_drawdown_ratio = max(max_drawdown_ratio, drawdown_ratio)\n    return max_drawdown_ratio\n", "entry_point": "calculate_max_drawdown_ratio", "input": "[3, 3, 2]", "output": "0.3333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79546_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000568", "code": "def evaluate_expression(tree):\n    if isinstance(tree, int):\n        return tree\n    else:\n        operator, *operands = tree\n        left_operand = evaluate_expression(operands[0])\n        right_operand = evaluate_expression(operands[1])\n        if operator == '+':\n            return left_operand + right_operand\n        elif operator == '-':\n            return left_operand - right_operand\n        elif operator == '*':\n            return left_operand * right_operand\n        elif operator == '/':\n            if right_operand == 0:\n                raise ZeroDivisionError(\"Division by zero\")\n            return left_operand / right_operand\n        else:\n            raise ValueError(\"Invalid operator\")\n", "entry_point": "evaluate_expression", "input": "['+', 2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_972_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000569", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[9, 10, 11], 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000570", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    rounded_average = round(average, 2)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[93.14, 93.14, 93.14]", "output": "93.14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111776_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000571", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000572", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'filename_part_subpart1_subpart2.txt'", "output": "'part_subpart1_subpart2.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000573", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000574", "code": "def sum_of_unique_pairs(nums, target):\n    seen = set()\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            count += 1\n            seen.remove(complement)\n        else:\n            seen.add(num)\n    return count\n", "entry_point": "sum_of_unique_pairs", "input": "[1, 4, 2, 3], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78039_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000575", "code": "def count_non_whitespace_chars(s: str) -> int:\n    count = 0\n    for c in s:\n        if not c.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'Hello!  '", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72891_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000576", "code": "def process_integers(nums):\n    modified_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            modified_nums.append(num + 2)\n        elif num % 2 != 0:\n            modified_nums.append(num * 3)\n        if num % 5 == 0:\n            modified_nums[-1] -= 5\n    return modified_nums\n", "entry_point": "process_integers", "input": "[11, 7, 3, 1, 7, 1]", "output": "[33, 21, 9, 3, 21, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79730_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000577", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 0, 0, 0, 3]", "output": "[0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000578", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha():\n            unique_chars.add(char.lower())\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'A B C - D E'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86971_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000579", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return None\n    nums.sort()\n    potential_product1 = nums[-1] * nums[-2] * nums[-3]\n    potential_product2 = nums[0] * nums[1] * nums[-1]\n    return max(potential_product1, potential_product2)\n", "entry_point": "max_product_of_three", "input": "[3, 4, 15]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97311_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000580", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'name=Dima=User;age=28'", "output": "{'name': 'Dima=User', 'age': '28'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000581", "code": "from typing import List\ndef longest_winning_streak(goals: List[int]) -> int:\n    current_streak = 0\n    longest_streak = 0\n    for i in range(len(goals)):\n        if i == 0 or goals[i] > goals[i - 1]:\n            current_streak += 1\n        else:\n            current_streak = 0\n        longest_streak = max(longest_streak, current_streak)\n    return longest_streak\n", "entry_point": "longest_winning_streak", "input": "[0, 1, 0, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10446_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000582", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "'any_registry', 'any_image', '2.0.0'", "output": "'2.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000583", "code": "import re\ndef extract_translated_strings(code):\n    translated_strings = set()\n    pattern = r'_translate\\(\"Form\", \"(.*?)\"\\)'\n    matches = re.findall(pattern, code)\n    for match in matches:\n        translated_strings.add(match)\n    return list(translated_strings)\n", "entry_point": "extract_translated_strings", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79294_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000584", "code": "def get_parameter_for_oscillator(oscillator_number):\n    if oscillator_number % 2 == 0:\n        return 'EvenParameter'\n    else:\n        return 'OddParameter'\n", "entry_point": "get_parameter_for_oscillator", "input": "1", "output": "'OddParameter'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94575_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000585", "code": "def zellerAlgorithm(year, month, day):\n    if month in [1, 2]:\n        y1 = year - 1\n        m1 = month + 12\n    else:\n        y1 = year\n        m1 = month\n    y2 = y1 % 100\n    c = y1 // 100\n    day_of_week = (day + (13 * (m1 + 1)) // 5 + y2 + y2 // 4 + c // 4 - 2 * c) % 7\n    return day_of_week\n", "entry_point": "zellerAlgorithm", "input": "2021, 3, 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86862_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000586", "code": "def simulate_packet_routing(nodes, packets):\n    total_forwarded_packets = 0\n    for i in range(len(nodes)):\n        forwarded_packets = min(nodes[i], packets[i])\n        total_forwarded_packets += forwarded_packets\n    return total_forwarded_packets\n", "entry_point": "simulate_packet_routing", "input": "[5, 5, 5], [3, 4, 2]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65785_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000587", "code": "from typing import List\ndef find_missing_number(nums: List[int]) -> int:\n    n = len(nums) + 1\n    expected_sum = n * (n + 1) // 2\n    total_sum = sum(nums)\n    missing_number = expected_sum - total_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101660_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000588", "code": "def can_watch_two_movies(flight_length, movie_lengths):\n    seen_lengths = set()\n    for length in movie_lengths:\n        remaining_time = flight_length - length\n        if remaining_time in seen_lengths:\n            return True\n        seen_lengths.add(length)\n    return False\n", "entry_point": "can_watch_two_movies", "input": "120, [60, 70, 90]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101915_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000589", "code": "from typing import List\ndef longest_subarray(arr: List[int], target: int) -> int:\n    start = 0\n    end = 0\n    curr_sum = 0\n    max_length = 0\n    while end < len(arr):\n        curr_sum += arr[end]\n        while curr_sum > target:\n            curr_sum -= arr[start]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_subarray", "input": "[1, 1, 1, 5, 2], 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40443_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1177", "output": "{107, 1, 1177, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000591", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "' WdWd23Wd!!'", "output": "' WdWd23Wd!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000592", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 5, 11, -10]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113174_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000593", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    if not input_list:  # Base case: empty list\n        return 0\n    else:\n        return input_list.pop() + custom_sum(input_list)\n", "entry_point": "custom_sum", "input": "[1, 2, 3, 4]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145591_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000594", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142319_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000595", "code": "def get_aws_service_endpoint(region):\n    region_string = region.lower()\n    if region_string.startswith(\"cn-\"):\n        return \"aws-cn\"\n    elif region_string.startswith(\"us-gov\"):\n        return \"aws-us-gov\"\n    else:\n        return \"aws\"\n", "entry_point": "get_aws_service_endpoint", "input": "'us-gov-virginia'", "output": "'aws-us-gov'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000596", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6687", "output": "{1, 3, 743, 9, 2229, 6687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000597", "code": "from typing import List\ndef top_k_scores(scores: List[int], k: int) -> List[int]:\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    sorted_scores = sorted(score_freq.keys(), reverse=True)\n    result = []\n    unique_count = 0\n    for score in sorted_scores:\n        if unique_count == k:\n            break\n        result.append(score)\n        unique_count += 1\n    return result\n", "entry_point": "top_k_scores", "input": "[100, 92, 90, 88, 85, 80], 4", "output": "[100, 92, 90, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108959_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000598", "code": "import importlib\nimport importlib.util\ndef list_available_modules(package_name):\n    try:\n        package = importlib.import_module(package_name)\n        spec = importlib.util.find_spec(package_name)\n        if spec is not None:\n            module = importlib.util.module_from_spec(spec)\n            spec.loader.exec_module(module)\n            if hasattr(module, '__all__'):\n                return module.__all__\n            else:\n                return []\n        else:\n            return []\n    except ModuleNotFoundError:\n        return []\n", "entry_point": "list_available_modules", "input": "'non_existent_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69860_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000599", "code": "def total_equal_candies(candies_weights):\n    alice_pos = 0\n    bob_pos = len(candies_weights) - 1\n    bob_current_weight = 0\n    alice_current_weight = 0\n    last_equal_candies_total_number = 0\n    while alice_pos <= bob_pos:\n        if alice_current_weight <= bob_current_weight:\n            alice_current_weight += candies_weights[alice_pos]\n            alice_pos += 1\n        else:\n            bob_current_weight += candies_weights[bob_pos]\n            bob_pos -= 1\n        if alice_current_weight == bob_current_weight:\n            last_equal_candies_total_number = alice_pos + (len(candies_weights) - bob_pos - 1)\n    return last_equal_candies_total_number\n", "entry_point": "total_equal_candies", "input": "[1, 1, 1, 1, 1, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8053_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000600", "code": "def check_filter_presence(versions, filter_name):\n    filters = [\n        'MultiSelectFilter', 'MultiSelectRelatedFilter', 'MultiSelectDropdownFilter',\n        'MultiSelectRelatedDropdownFilter', 'DropdownFilter', 'ChoicesDropdownFilter',\n        'RelatedDropdownFilter', 'BooleanAnnotationFilter'\n    ]\n    version_filter_mapping = {\n        (1, 3): [\n            'MultiSelectFilter', 'MultiSelectRelatedFilter', 'MultiSelectDropdownFilter',\n            'MultiSelectRelatedDropdownFilter', 'DropdownFilter', 'ChoicesDropdownFilter',\n            'RelatedDropdownFilter', 'BooleanAnnotationFilter'\n        ],\n        (2, 4): [\n            'NewFilter1', 'NewFilter2', 'NewFilter3'\n        ]\n        # Add more version mappings as needed\n    }\n    version_tuple = tuple(versions)\n    if version_tuple in version_filter_mapping:\n        filters = version_filter_mapping[version_tuple]\n    return filter_name in filters\n", "entry_point": "check_filter_presence", "input": "(3, 5), 'NonExistentFilter'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139601_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000601", "code": "def validate(choice):\n    try:\n        choice_int = int(choice)  # Convert input to integer\n        if 1 <= choice_int <= 3:  # Check if choice is within the range 1 to 3\n            return True\n        else:\n            return False\n    except ValueError:  # Handle non-integer inputs\n        return False\n", "entry_point": "validate", "input": "2", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133414_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000602", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[3, 3, 6, 6, 2, 6, 3]", "output": "[3, 4, 8, 9, 6, 11, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000603", "code": "from typing import List, Tuple\ndef longest_contiguous_subarray_above_threshold(temperatures: List[int], threshold: float) -> Tuple[int, int]:\n    start = 0\n    end = 0\n    max_length = 0\n    current_sum = 0\n    max_start = 0\n    while end < len(temperatures):\n        current_sum += temperatures[end]\n        while start <= end and current_sum / (end - start + 1) <= threshold:\n            current_sum -= temperatures[start]\n            start += 1\n        if end - start + 1 > max_length:\n            max_length = end - start + 1\n            max_start = start\n        end += 1\n    return max_start, max_start + max_length - 1\n", "entry_point": "longest_contiguous_subarray_above_threshold", "input": "[-1, -2, -3], 0", "output": "(0, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18174_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8723", "output": "{1, 11, 13, 143, 8723, 793, 61, 671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000605", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'200.1.330'", "output": "(200, 1, 330)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5897", "output": "{1, 5897}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000607", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'10.5.3'", "output": "(10, 5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000608", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    scores.remove(min_score)\n    if len(scores) == 0:\n        return 0.0\n    return sum(scores) / len(scores)\n", "entry_point": "calculate_average", "input": "[90, 88, 90, 81, 70]", "output": "87.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142282_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000609", "code": "def isNumber(s: str) -> bool:\n    states = [\n        {'blank': 0, 'sign': 1, 'digit': 2, '.': 3},\n        {'digit': 2, '.': 3},\n        {'digit': 2, '.': 4, 'e': 5, 'blank': 8},\n        {'digit': 4},\n        {'digit': 4, 'e': 5, 'blank': 8},\n        {'sign': 6, 'digit': 7},\n        {'digit': 7},\n        {'digit': 7, 'blank': 8},\n        {'blank': 8}\n    ]\n    state = 0\n    for char in s.strip():\n        if char.isdigit():\n            char = 'digit'\n        elif char in ['+', '-']:\n            char = 'sign'\n        elif char in ['e', 'E']:\n            char = 'e'\n        elif char == ' ':\n            char = 'blank'\n        if char not in states[state]:\n            return False\n        state = states[state][char]\n    return state in [2, 4, 7, 8]\n", "entry_point": "isNumber", "input": "'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1102_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000610", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'abc'", "output": "['abc', 'acb', 'bac', 'bca', 'cab', 'cba']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000611", "code": "def calculate_median(data):\n    sorted_data = sorted(data)\n    n = len(sorted_data)\n    if n % 2 == 1:\n        return sorted_data[n // 2]\n    else:\n        mid1 = sorted_data[n // 2 - 1]\n        mid2 = sorted_data[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[2, 3, 4, 5]", "output": "3.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16083_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000612", "code": "from typing import List\ndef max_profit(prices: List[int]) -> int:\n    buy1 = -prices[0]\n    sell1 = buy2 = sell2 = 0\n    for price in prices[1:]:\n        buy1 = max(buy1, -price)\n        sell1 = max(sell1, buy1 + price)\n        buy2 = max(buy2, sell1 - price)\n        sell2 = max(sell2, buy2 + price)\n    return sell2\n", "entry_point": "max_profit", "input": "[1, 2, 3, 4, 5, 1, 6, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100967_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000613", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[4, 5]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58654_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000614", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tasta=addtasks'", "output": "{'field': 'tasta', 'value': 'addtasks'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000615", "code": "def product_except_self(arr):\n    n = len(arr)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products to the left of each element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * arr[i - 1]\n    # Calculate products to the right of each element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * arr[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "product_except_self", "input": "[0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108608_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000616", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 3.1666666666666665, 1", "output": "3.4833333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000617", "code": "def play_card_game(deck_a, deck_b):\n    total_sum = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        total_sum += card_a + card_b\n    if total_sum % 2 == 0:\n        return \"Player A\"\n    else:\n        return \"Player B\"\n", "entry_point": "play_card_game", "input": "[1], [2]", "output": "'Player B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147739_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000618", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a draw\"\n", "entry_point": "simulate_card_game", "input": "[2, 3, 5], [2, 3, 5]", "output": "\"It's a draw\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64608_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000619", "code": "def calculate_product(nums):\n    product = 1\n    for num in nums:\n        if num != 0:\n            product *= num\n    return product\n", "entry_point": "calculate_product", "input": "[3, 4, 8, 12]", "output": "1152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25506_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000620", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'h264'", "output": "'H.264 (AVC)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000621", "code": "def sum_even_numbers(lst):\n    total_sum = 0\n    for num in lst:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 12]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26297_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000622", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "find_single_number", "input": "[1, 1, 2, 2, -8]", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67406_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000623", "code": "from typing import List\ndef max_sum_subarray(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sum_subarray", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101809_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000624", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4727", "output": "{1, 163, 29, 4727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000625", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[4, 5, 0, -2, -3, 1], 5", "output": "[4, 5, 0, -2, -3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000626", "code": "def max_subarray_sum(arr):\n    max_sum = float('-inf')\n    current_sum = 0\n    for num in arr:\n        current_sum += num\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 15, 12]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15965_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000627", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 8]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98779_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000628", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7401", "output": "{1, 3, 2467, 7401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5318", "output": "{1, 2, 2659, 5318}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000630", "code": "def process_message(message):\n    # Extract the message type from the input message\n    message_type = message.strip('\"').split('\"')[0]\n    # Generate response based on the message type\n    if message_type == \"40\":\n        return \"Received message type 40\"\n    elif message_type == \"50\":\n        return \"Received message type 50\"\n    else:\n        return \"Unknown message type\"\n", "entry_point": "process_message", "input": "'\"40\"'", "output": "'Received message type 40'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44223_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000631", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "6, 5, 4", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7617", "output": "{1, 3, 7617, 2539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000633", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10, 15, 5]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54039_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000634", "code": "import os\ndef count_python_files(paths):\n    count = 0\n    for path in paths:\n        if os.path.isdir(path):\n            files = os.listdir(path)\n            for file in files:\n                if file.endswith('.py'):\n                    count += 1\n    return count\n", "entry_point": "count_python_files", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44378_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000635", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha():\n            unique_chars.add(char.lower())\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abcde f!@#$%f'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83141_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000636", "code": "_FA_ENTRY = {\n    'fontSize': 'uint16',\n    'fontStyle': 'uint16',\n    'fontID': 'uint16',\n}\n_STYLE_MAP = {\n    0: 'bold',\n    1: 'italic',\n    2: 'underline',\n    3: 'outline',\n    4: 'shadow',\n    5: 'condensed',\n    6: 'extended',\n}\ndef format_font_style(font_info: dict) -> str:\n    formatted_info = []\n    for key, value in font_info.items():\n        if key in _FA_ENTRY:\n            if key == 'fontStyle':\n                formatted_info.append(f'Font Style: {_STYLE_MAP.get(value, \"Unknown\")}')\n            else:\n                formatted_info.append(f'{key.capitalize()}: {value}')\n    return ', '.join(formatted_info)\n", "entry_point": "format_font_style", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54527_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000637", "code": "def validate_pattern(pattern: str) -> bool:\n    prev_char = ''\n    for char in pattern:\n        if char == prev_char:\n            return False\n        prev_char = char\n    return True\n", "entry_point": "validate_pattern", "input": "'aa'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88067_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000638", "code": "import re\ndef generate_code(input_string):\n    words = input_string.split()\n    code = ''\n    for word in words:\n        first_letter = re.search(r'[a-zA-Z]', word)\n        if first_letter:\n            code += first_letter.group().lower()\n    return code\n", "entry_point": "generate_code", "input": "'word'", "output": "'w'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30063_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000639", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[0, 0], 2", "output": "{(0, 0)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000640", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'This is a sample $$math$$ equation.'", "output": "'This is a sample $math$ equation.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000641", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7496", "output": "{1, 2, 3748, 4, 7496, 8, 937, 1874}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7495", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000642", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'hbo.com/pagesh/ts:e/'", "output": "'hbo.com/pagesh/ts:e/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000643", "code": "import os\nBASE_DIR = '/path/to/base/dir'  # Assume this is the base directory\nSTATIC_ROOT = os.path.join(BASE_DIR, '../static/')\nSTATIC_URL = '/static/'\nMEDIA_ROOT = os.path.join(BASE_DIR, '../media')\nMEDIA_URL = '/media/'\ndef categorize_file_path(file_path: str) -> str:\n    if file_path.startswith(STATIC_ROOT):\n        return \"Static File\"\n    elif file_path.startswith(MEDIA_ROOT):\n        return \"Media File\"\n    else:\n        return \"Neither Static nor Media File\"\n", "entry_point": "categorize_file_path", "input": "'/path/to/other/file.txt'", "output": "'Neither Static nor Media File'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77883_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000644", "code": "def _find_between(s, first, last):\n    try:\n        start = s.index(first) + len(first)\n        end = s.index(last, start)\n        return s[start:end]\n    except ValueError:\n        return \"\"\n", "entry_point": "_find_between", "input": "'a quick brown fox', 'notfound', 'end'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36917_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000645", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[7, 8, 9, 10, 14, 15, 14], 8", "output": "[8, 9, 10, 14, 15, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000646", "code": "def count_unique_divisible(nums, divisor):\n    unique_divisible = set()\n    for num in nums:\n        if num % divisor == 0 and num not in unique_divisible:\n            unique_divisible.add(num)\n    return len(unique_divisible)\n", "entry_point": "count_unique_divisible", "input": "[4, 4, 4], 4", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73209_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000647", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 5, 7, -3, 12]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59318_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000648", "code": "def map_choices_to_descriptions(choices):\n    choices_dict = {}\n    for choice, description in choices:\n        choices_dict[choice] = description\n    return choices_dict\n", "entry_point": "map_choices_to_descriptions", "input": "[(5, 'High'), (3, 'Medium'), (1, 'Low')]", "output": "{5: 'High', 3: 'Medium', 1: 'Low'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115679_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000649", "code": "def parse_ini_string(ini_string: str) -> dict:\n    settings = {}\n    for line in ini_string.split('\\n'):\n        line = line.strip()\n        if not line or line.startswith('#'):\n            continue\n        key_value = line.split('=')\n        if len(key_value) == 2:\n            key = key_value[0].strip()\n            value = key_value[1].strip()\n            settings[key] = value\n    return settings\n", "entry_point": "parse_ini_string", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000650", "code": "def find_first_call_instruction(instruction_list, begin, call_instruction):\n    '''\n    Returns the address of the instruction below the first occurrence of the specified call instruction.\n    '''\n    prev_instruction = None\n    for instruction in instruction_list[begin:]:\n        if prev_instruction is not None and prev_instruction == call_instruction:\n            return instruction\n        prev_instruction = instruction\n", "entry_point": "find_first_call_instruction", "input": "['LOAD', 'CALL', 'STORE'], 0, 'CALL'", "output": "'STORE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137706_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000651", "code": "import base64\ndef process_content(contents):\n    content_type, content_string = contents.split(',')\n    decoded_content = base64.b64decode(content_string)\n    return decoded_content\n", "entry_point": "process_content", "input": "'text/plain,SGVsbG8gV29ybGth'", "output": "b'Hello Worlka'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133360_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000652", "code": "def compare_versions(version1, version2):\n    v1 = list(map(int, version1.split('.')))\n    v2 = list(map(int, version2.split('.')))\n    for i in range(3):\n        if v1[i] < v2[i]:\n            return -1\n        elif v1[i] > v2[i]:\n            return 1\n    return 0\n", "entry_point": "compare_versions", "input": "'1.0.0', '1.0.0'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128180_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000653", "code": "def is_pangram(text):\n    # Convert the input text to lowercase\n    text_lower = text.lower()\n    # Create a set of unique lowercase alphabets present in the input text\n    unique_letters = {letter for letter in text_lower if letter.isalpha()}\n    # Check if the length of the set of lowercase alphabets is equal to 26\n    return len(unique_letters) == 26\n", "entry_point": "is_pangram", "input": "'This is just a test'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18076_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000654", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[4, 4, 8]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31605_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000655", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3661", "output": "'1 hour 1 minute 1 second'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000656", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3998", "output": "{1, 2, 3998, 1999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3997", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000657", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[1, 2, 3, 5, 4, 6, 8], 13", "output": "[3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000658", "code": "import re\ndef extract_inventory_details(input_str):\n    rx_item = re.compile(\n        r\"^NAME: \\\"(?P<name>[^\\\"]+)\\\",\\s+DESCR: \\\"(?P<descr>[^\\\"]+)\\\"\\s*\\n\"\n        r\"PID:\\s+(?P<pid>\\S+)?\\s*,\\s+VID:\\s+(?P<vid>[\\S ]+)?\\n,\\s+\"\n        r\"SN: (?P<serial>\\S+)?\",\n        re.MULTILINE | re.DOTALL,\n    )\n    devices = []\n    for match in rx_item.finditer(input_str):\n        device_info = match.groupdict()\n        devices.append({\n            'Name': device_info['name'],\n            'Description': device_info['descr'],\n            'PID': device_info['pid'],\n            'VID': device_info['vid'],\n            'Serial Number': device_info['serial']\n        })\n    return devices\n", "entry_point": "extract_inventory_details", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78178_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000659", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "10", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000660", "code": "def sum_divisible_by_2_and_3(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0 and num % 3 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_2_and_3", "input": "[6, 12]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87733_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000661", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "8", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000662", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[2, 2, 2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000663", "code": "def sum_multiples(nums):\n    result = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            seen.add(num)\n            result += num\n    return result\n", "entry_point": "sum_multiples", "input": "[3, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57039_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000664", "code": "import re\nfrom typing import List\ndef extract_patterns(input_str: str) -> List[str]:\n    pattern = r'\"(.*?)\"'  # Regular expression pattern to match substrings within double quotes\n    return re.findall(pattern, input_str)\n", "entry_point": "extract_patterns", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69903_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000665", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "100, 200, 17", "output": "317", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000666", "code": "def count_substring_occurrences(larger_str, substring):\n    count = 0\n    start_index = 0\n    while start_index <= len(larger_str) - len(substring):\n        if larger_str[start_index:start_index + len(substring)] == substring:\n            count += 1\n            start_index += 1\n        else:\n            start_index += 1\n    return count\n", "entry_point": "count_substring_occurrences", "input": "'hello', 'world'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94062_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000667", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'1 + 2'", "output": "['3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000668", "code": "def unique_paths(grid):\n    m, n = len(grid), len(grid[0])\n    dp = [[0 for _ in range(n)] for _ in range(m)]\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 1:\n                dp[i][j] = 0\n            elif i == 0 and j == 0:\n                dp[i][j] = 1\n            elif i == 0:\n                dp[i][j] = dp[i][j-1]\n            elif j == 0:\n                dp[i][j] = dp[i-1][j]\n            else:\n                dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "[[0, 0], [0, 0]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_541_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000669", "code": "def min_operations(seq1, seq2):\n    size_x = len(seq1) + 1\n    size_y = len(seq2) + 1\n    matrix = [[0 for _ in range(size_y)] for _ in range(size_x)]\n    for x in range(1, size_x):\n        matrix[x][0] = x\n    for y in range(1, size_y):\n        matrix[0][y] = y\n    for x in range(1, size_x):\n        for y in range(1, size_y):\n            if seq1[x-1] == seq2[y-1]:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1],\n                    matrix[x][y-1] + 1\n                )\n            else:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1] + 1,\n                    matrix[x][y-1] + 1\n                )\n    return matrix[size_x - 1][size_y - 1]\n", "entry_point": "min_operations", "input": "'abcdefghijklm', 'xyz'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43241_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "11", "output": "{1, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000671", "code": "def check_python_compatibility(version1, version2):\n    def get_major_version(version):\n        return int(version.split('.')[0])\n    major_version1 = get_major_version(version1)\n    major_version2 = get_major_version(version2)\n    return major_version1 >= major_version2\n", "entry_point": "check_python_compatibility", "input": "'2.7.15', '3.6.9'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97320_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000672", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4737", "output": "{1, 4737, 3, 1579}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000673", "code": "def has_valid_signature(data: str) -> bool:\n    start_delimiter = \"-----BEGIN SIGNATURE-----\"\n    end_delimiter = \"-----END SIGNATURE-----\"\n    start_index = data.find(start_delimiter)\n    if start_index == -1:\n        return False\n    end_index = data.find(end_delimiter, start_index)\n    if end_index == -1:\n        return False\n    return end_index > start_index\n", "entry_point": "has_valid_signature", "input": "'This is not a signature.'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142225_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000674", "code": "def countWordsAboveThreshold(text, threshold):\n    words = text.split()\n    count = 0\n    for word in words:\n        if len(word) > threshold:\n            count += 1\n    return count\n", "entry_point": "countWordsAboveThreshold", "input": "'', 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5618_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000675", "code": "def filter_dna_sequences(sequences, min_length, max_length):\n    filtered_sequences = []\n    for seq in sequences:\n        if min_length <= len(seq) <= max_length:\n            filtered_sequences.append(seq)\n    return filtered_sequences\n", "entry_point": "filter_dna_sequences", "input": "['ATCGATCG'], 8, 8", "output": "['ATCGATCG']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38699_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000676", "code": "from typing import Any\nUNQUOTED_SUFFIX = \"UNQUOTED_SUFFIX\"\ndef _get_neo4j_suffix_value(value: Any) -> str:\n    if isinstance(value, int) or isinstance(value, bool):\n        return UNQUOTED_SUFFIX\n    else:\n        return ''\n", "entry_point": "_get_neo4j_suffix_value", "input": "5", "output": "'UNQUOTED_SUFFIX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92282_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000677", "code": "import os\ndef select_crnn_model(crnn_type, father_path):\n    LSTMFLAG = False\n    crnn_model_path = \"\"\n    if crnn_type == \"lite_lstm\":\n        LSTMFLAG = True\n        crnn_model_path = os.path.join(father_path, \"models/crnn_lite_lstm_dw_v2.pth\")\n    elif crnn_type == \"lite_dense\":\n        crnn_model_path = os.path.join(father_path, \"models/crnn_lite_dense_dw.pth\")\n    elif crnn_type == \"full_lstm\":\n        LSTMFLAG = True\n        crnn_model_path = os.path.join(father_path, \"models/ocr-lstm.pth\")\n    elif crnn_type == \"full_dense\":\n        crnn_model_path = os.path.join(father_path, \"models/ocr-dense.pth\")\n    return LSTMFLAG, crnn_model_path\n", "entry_point": "select_crnn_model", "input": "'', 'some/path'", "output": "(False, '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46072_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000678", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "281", "output": "{1, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000679", "code": "import json\ndef extract_segments(json_data):\n    extracted_segments = {}\n    try:\n        data = json.loads(json_data)\n        extracted_segments[\"user\"] = data.get(\"user\")\n        extracted_segments[\"tweet\"] = data.get(\"tweet\")\n        extracted_segments[\"stats\"] = data.get(\"stats\")\n    except json.JSONDecodeError:\n        print(\"Invalid JSON data format.\")\n    return extracted_segments\n", "entry_point": "extract_segments", "input": "'invalid json string'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118963_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000680", "code": "def generate_forcefield_path(name):\n    base_directory = \"/path/to/forcefields/\"\n    forcefield_filename = f\"forcefield_{name}.txt\"\n    forcefield_path = base_directory + forcefield_filename\n    return forcefield_path\n", "entry_point": "generate_forcefield_path", "input": "'etttec'", "output": "'/path/to/forcefields/forcefield_etttec.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84731_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5608", "output": "{1, 2, 4, 5608, 8, 2804, 1402, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5607", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000682", "code": "def count_unique_label_types(text_list, default_list):\n    unique_label_types = {}\n    for text, default in zip(text_list, default_list):\n        if text not in unique_label_types:\n            unique_label_types[text] = default\n    return unique_label_types\n", "entry_point": "count_unique_label_types", "input": "['A', 'B', 'C'], [1, 2, 4]", "output": "{'A': 1, 'B': 2, 'C': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111671_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000683", "code": "def get_dot_axis(keras_version_str):\n    keras_version_tuple = tuple(map(int, keras_version_str.split('.')))\n    DOT_AXIS = 0 if keras_version_tuple <= (2, 2, 4) else 1\n    return DOT_AXIS\n", "entry_point": "get_dot_axis", "input": "'2.3.0'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61874_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000684", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    return max(nums[-1] * nums[-2] * nums[-3], nums[0] * nums[1] * nums[-1])\n", "entry_point": "max_product_of_three", "input": "[2, 3, 3]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58627_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000685", "code": "def get_courses_for_key(dictionary, prefix):\n    count = 0\n    for key in dictionary:\n        if key.startswith(prefix):\n            count += 1\n    return count\n", "entry_point": "get_courses_for_key", "input": "{}, 'CS'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142607_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000686", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3543", "output": "{1, 3, 1181, 3543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000687", "code": "def correct_typo(code_snippet):\n    corrected_code = code_snippet.replace('install_requireent', 'install_requires')\n    return corrected_code\n", "entry_point": "correct_typo", "input": "'readme_file:'", "output": "'readme_file:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26763_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000688", "code": "def validate_config(config_data):\n    if all(key in config_data for key in [\"a\", \"b\", \"c\"]):\n        if config_data[\"a\"] == \"1\" and config_data[\"b\"] == \"2\" and \"include an = sign\" in config_data[\"c\"]:\n            return True\n    return False\n", "entry_point": "validate_config", "input": "{'a': '0', 'b': '3', 'c': 'some other value'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125746_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000689", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'ahhk', 2", "output": "'cjjm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000690", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'exexaomampexe'", "output": "'exexaomampexe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000691", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "2, 8", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000692", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[5, 7, 1, 2, 3, 5, 17, 17]", "output": "[5, 7, 0, 0, 3, 5, 17, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5881", "output": "{1, 5881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000694", "code": "def create_response(input_string):\n    size, type_, category = input_string.split()\n    response = \"@TestUser - Ergebnis: 5\\n\"\n    if size == \"hz\" and category == \"human\":\n        response += f\"Humanoid ({size}): Torso getroffen\"\n    elif (size == \"gro\u00df\" or size == \"riesig\") and category == \"non-human\":\n        if type_ == \"mittel\":\n            response += f\"Non-Humanoid ({size}): Torso getroffen\"\n        elif type_ == \"wesen\":\n            response += f\"Non-Humanoid, vierbeinig ({size}): Kopf getroffen\\n\"\n            response += f\"Non-Humanoid, sechs Gliedma\u00dfen ({size}): Torso getroffen\"\n    return response\n", "entry_point": "create_response", "input": "'dummy dummy dummy'", "output": "'@TestUser - Ergebnis: 5\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80342_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000695", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'vyshnav'", "output": "'Vyshnav'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000696", "code": "def generate_url_path(app_name, view_name, *args):\n    url_mapping = {\n        'index': '',\n        'get_by_title': 'title/',\n        'get_filtered_films': 'filter/',\n        'vote_for_film': 'vote/',\n        'insert_film': 'insert/',\n        '_enum_ids': 'enum/',\n        '_get_by_id': 'id/'\n    }\n    if view_name in url_mapping:\n        url_path = f'/{app_name}/{url_mapping[view_name]}'\n        if args:\n            url_path += '/'.join(str(arg) for arg in args)\n        return url_path\n    else:\n        return 'Invalid view name'\n", "entry_point": "generate_url_path", "input": "'service_app', 'get_by_title'", "output": "'/service_app/title/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124830_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000697", "code": "from typing import List\ndef find_majority_element(nums: List[int]) -> int:\n    d = dict()\n    result = -1\n    half = len(nums) // 2\n    for num in nums:\n        if num in d:\n            d[num] += 1\n        else:\n            d[num] = 1\n    for k in d:\n        if d[k] >= half:\n            result = k\n            break\n    return result\n", "entry_point": "find_majority_element", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122021_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000698", "code": "from typing import List\ndef perform_operation(float_list: List[float]) -> float:\n    result = float_list[0]  # Initialize result with the first number\n    for i in range(1, len(float_list)):\n        if i % 2 == 1:  # Odd index, subtract\n            result -= float_list[i]\n        else:  # Even index, add\n            result += float_list[i]\n    return result\n", "entry_point": "perform_operation", "input": "[5.0, 2.0, 2.5, 1.2]", "output": "4.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88957_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000699", "code": "def sum_of_primes(nums):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in nums:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104647_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000700", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{appllba}'", "output": "['appllba']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000701", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1196", "output": "{1, 2, 4, 299, 1196, 13, 46, 52, 598, 23, 26, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1195", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "797", "output": "{1, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000703", "code": "def max_subarray_sum(nums):\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[-2, -3, -4]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78187_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000704", "code": "import re\ndef extract_emails(text):\n    pattern = r'\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b'\n    emails = re.findall(pattern, text)\n    return list(set(emails))\n", "entry_point": "extract_emails", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45659_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2701", "output": "{73, 1, 37, 2701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000706", "code": "def count_vowels(s):\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    vowel_count = 0\n    s = s.lower()\n    for char in s:\n        if char in vowels:\n            vowel_count += 1\n    return vowel_count\n", "entry_point": "count_vowels", "input": "'cat'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132855_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000707", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[1, 2, 3], 0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75916_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000708", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[6, 7], 13", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000709", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[2]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000710", "code": "def card_war(player1, player2):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1, player2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_war", "input": "[1, 2, 3], [2, 3, 4]", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81104_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000711", "code": "def get_unique_property_values(auctions, property_to_filter):\n    unique_values = set()\n    for auction in auctions:\n        if property_to_filter in auction:\n            unique_values.add(auction[property_to_filter])\n    return list(unique_values)\n", "entry_point": "get_unique_property_values", "input": "[], 'some_property'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55660_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000712", "code": "import re\ndef count_unique_packages(script):\n    unique_packages = set()\n    for line in script.split('\\n'):\n        if line.startswith('import') or line.startswith('from'):\n            packages = re.findall(r'\\b\\w+\\b', line.split('import')[-1])\n            for package in packages:\n                unique_packages.add(package)\n    return len(unique_packages)\n", "entry_point": "count_unique_packages", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35865_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000713", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'Hello'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64619_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000714", "code": "def sum_odd_multiples(start, end, multiple):\n    sum_odd = 0\n    for num in range(start, end + 1):\n        if num % 2 != 0 and num % multiple == 0:\n            sum_odd += num\n    return sum_odd\n", "entry_point": "sum_odd_multiples", "input": "5, 45, 5", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77731_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000715", "code": "def sum_multiples_of_3_or_5(input_list):\n    multiples_set = set()\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 15]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12129_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000716", "code": "def find_negative_floor_position(parentheses: str) -> int:\n    floor = 0\n    position = 0\n    counter = 0\n    for char in parentheses:\n        counter += 1\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        if floor < 0:\n            return counter\n    return -1\n", "entry_point": "find_negative_floor_position", "input": "'(())'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125383_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000717", "code": "def calculate_factorial(n):\n    if n < 0:\n        return 0\n    factorial = 1\n    for i in range(1, n + 1):\n        factorial *= i\n    return factorial\n", "entry_point": "calculate_factorial", "input": "-1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130862_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000718", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'abc -', 'abc '", "output": "'-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000719", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[80, 84, 88]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136483_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000720", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'o ohwo'", "output": "'o owho'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000721", "code": "def get_parameter_for_oscillator(oscillator_number):\n    if oscillator_number % 2 == 0:\n        return 'EvenParameter'\n    else:\n        return 'OddParameter'\n", "entry_point": "get_parameter_for_oscillator", "input": "0", "output": "'EvenParameter'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94575_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000722", "code": "def average_words_per_sentence(text):\n    sentences = [sentence.strip() for sentence in text.split('.') + text.split('?') + text.split('!') if sentence.strip()]\n    total_words = 0\n    total_sentences = len(sentences)\n    for sentence in sentences:\n        total_words += len(sentence.split())\n    if total_sentences == 0:\n        return 0\n    else:\n        return total_words / total_sentences\n", "entry_point": "average_words_per_sentence", "input": "'Hello.'", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000723", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average = total_sum / total_students\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[70, 72]", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48784_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000724", "code": "from typing import List\ndef max_attended_events(events: List[int]) -> int:\n    event_list = [(i, i + 1, freq) for i, freq in enumerate(events)]\n    event_list.sort(key=lambda x: x[1])  # Sort events based on end times\n    max_attended = 0\n    prev_end = -1\n    for event in event_list:\n        start, end, _ = event\n        if start >= prev_end:\n            max_attended += 1\n            prev_end = end\n    return max_attended\n", "entry_point": "max_attended_events", "input": "[1, 1, 1, 1, 1, 1, 1, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94594_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4501", "output": "{1, 643, 4501, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000726", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    seen = set()  # To avoid counting multiples of both 3 and 5 twice\n    for num in numbers:\n        if num in seen:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[15, 12, 10]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23493_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000727", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'20.0'", "output": "(20, 0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000728", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[10, 10, 6]", "output": "600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000729", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 85, 78, 60]", "output": "[92, 85, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000730", "code": "def calculate_depth(path):\n    depth = 1\n    for char in path:\n        if char == '/':\n            depth += 1\n    return depth\n", "entry_point": "calculate_depth", "input": "'/a/b'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21386_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000731", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 14, 14, 26]", "output": "[4, 16, 16, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45782_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000732", "code": "def max_consecutive_same_items(nums):\n    max_consecutive = 0\n    current_num = None\n    consecutive_count = 0\n    for num in nums:\n        if num == current_num:\n            consecutive_count += 1\n        else:\n            current_num = num\n            consecutive_count = 1\n        max_consecutive = max(max_consecutive, consecutive_count)\n    return max_consecutive\n", "entry_point": "max_consecutive_same_items", "input": "[2, 2, 2, 2, 3, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138973_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000733", "code": "def set_pyside_version(nuke_version_major):\n    if nuke_version_major < 10 or nuke_version_major == 11:\n        return 'PySide2'\n    else:\n        return 'PySide'\n", "entry_point": "set_pyside_version", "input": "11", "output": "'PySide2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100498_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000734", "code": "def parse_metadata(input_str):\n    metadata_dict = {}\n    lines = input_str.split('\\n')\n    for line in lines:\n        if line.startswith('$'):\n            key_value = line[1:].split(' ')\n            if len(key_value) == 2:\n                key, value = key_value\n                metadata_dict[key] = value\n    return metadata_dict\n", "entry_point": "parse_metadata", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92117_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000735", "code": "import math\ndef calculate_path(R, D):\n    path = math.factorial(D + R - 1) // (math.factorial(R - 1) * math.factorial(D))\n    return path\n", "entry_point": "calculate_path", "input": "1, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141457_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000736", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'rdx, '", "output": "'add rdx, '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000737", "code": "def validate_identity_number(identity_number: str) -> bool:\n    # Check if the length is exactly 11 characters\n    if len(identity_number) != 11:\n        return False\n    # Check if all characters are numeric\n    if not identity_number.isdigit():\n        return False\n    # Check if the first character is not '0'\n    if identity_number[0] == '0':\n        return False\n    return True\n", "entry_point": "validate_identity_number", "input": "'12345678901'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25980_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000738", "code": "def count_foo_occurrences(input_string):\n    count = 0\n    for i in range(len(input_string) - 2):\n        if input_string[i:i+3] == \"foo\":\n            count += 1\n    return count\n", "entry_point": "count_foo_occurrences", "input": "'foofoofoo'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48936_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1086", "output": "{1, 2, 3, 6, 362, 181, 1086, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000740", "code": "import re\ndef is_password_strong(password: str) -> bool:\n    # Check if the password is at least 10 characters long\n    if len(password) < 10:\n        return False\n    # Check if the password contains a mix of numbers, special characters, upper and lowercase letters\n    if not any(char.isdigit() for char in password):\n        return False\n    if not any(char.islower() for char in password):\n        return False\n    if not any(char.isupper() for char in password):\n        return False\n    if not any(char in \"!@#$%^&*()-_+=[]{}|;:,.<>?/\" for char in password):\n        return False\n    # Check if the password avoids common patterns and repeated characters\n    if re.search(r'(.)\\1{2,}', password):\n        return False\n    if re.search(r'123|abc|password', password, re.IGNORECASE):\n        return False\n    return True\n", "entry_point": "is_password_strong", "input": "'Pass1!'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16305_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000741", "code": "from typing import List\ndef max_sum_non_adjacent(nums: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = max(include, exclude + num)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130952_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000742", "code": "def pig_latin_converter(input_string):\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    words = input_string.split()\n    pig_latin_words = []\n    for word in words:\n        if word[0] in vowels:\n            pig_latin_words.append(word + 'way')\n        else:\n            first_vowel_index = next((i for i, c in enumerate(word) if c in vowels), None)\n            if first_vowel_index is not None:\n                pig_latin_words.append(word[first_vowel_index:] + word[:first_vowel_index] + 'ay')\n            else:\n                pig_latin_words.append(word)  # Word has no vowels, keep it as it is\n    # Reconstruct the transformed words into a single string\n    output_string = ' '.join(pig_latin_words)\n    return output_string\n", "entry_point": "pig_latin_converter", "input": "'hello aelo'", "output": "'ellohay aeloway'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10322_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000743", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "0, 'Hell'", "output": "([('Content-type', 'text/plain')], 'Hell')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000744", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        if count + score_count[score] <= n:\n            top_scores.extend([score] * score_count[score])\n            count += score_count[score]\n        else:\n            remaining = n - count\n            top_scores.extend([score] * remaining)\n            break\n    return sum(top_scores) / n\n", "entry_point": "average_top_n_scores", "input": "[90, 90, 90, 80, 70], 4", "output": "87.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13074_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000745", "code": "from typing import Optional\nCORE_API_MEDIA_TYPE_INVALID = 'application/vnd.bihealth.invalid'\nCORE_API_VERSION_INVALID = '9.9.9'\ndef validate_api(media_type: str, version: str) -> bool:\n    return media_type != CORE_API_MEDIA_TYPE_INVALID and version != CORE_API_VERSION_INVALID\n", "entry_point": "validate_api", "input": "'application/json', '1.0.0'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7575_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000746", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[76, 76, 76, 76, 76, 76, 76, 76, 80]", "output": "76.44444444444444", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43674_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000747", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'10.2.5'", "output": "(10, 2, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5465", "output": "{5465, 1, 1093, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000749", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7472", "output": "{1, 2, 4, 934, 8, 1868, 7472, 16, 467, 3736}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7471", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000750", "code": "from typing import List\ndef threeSumClosest(nums: List[int], target: int) -> int:\n    nums.sort()\n    closest_sum = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            if abs(current_sum - target) < abs(closest_sum - target):\n                closest_sum = current_sum\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return target  # Found an exact match, no need to continue\n    return closest_sum\n", "entry_point": "threeSumClosest", "input": "[1, 1, 2, 3], 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47065_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000751", "code": "def is_module_compatible(module, environment):\n    return module.startswith(environment + '.')\n", "entry_point": "is_module_compatible", "input": "'com.example', 'com.example'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130268_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000752", "code": "# Sample data for demonstration\nLOCALEDIR = '/path/to/locales'\nlangcodes = ['en', 'fr', 'de', 'es', 'it']\ntranslates = {'en': 'English', 'fr': 'French', 'de': 'German', 'es': 'Spanish', 'it': 'Italian'}\ndef get_language_name(language_code):\n    return translates.get(language_code, \"Language not found\")\n", "entry_point": "get_language_name", "input": "'jp'", "output": "'Language not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94235_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000753", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[4, 0, 2, 1, 1, 2]", "output": "[4, 1, 4, 4, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000754", "code": "def process_mode(mode):\n    m = -1\n    if 'r' in mode:\n        m = 0\n    elif 'w' in mode:\n        m = 1\n    elif 'a' in mode:\n        m = 2\n    tm = ('r', 'w', 'a')\n    bText = 't' in mode\n    return m, bText\n", "entry_point": "process_mode", "input": "'r'", "output": "(0, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92329_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000755", "code": "def validate_version(version, min_version):\n    version_parts = list(map(int, version.split('.')))\n    min_version_parts = list(map(int, min_version.split('.')))\n    for v, mv in zip(version_parts, min_version_parts):\n        if v < mv:\n            return False\n        elif v > mv:\n            return True\n    return True\n", "entry_point": "validate_version", "input": "'1.0.0', '2.0.0'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88188_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000756", "code": "from typing import List, Optional\ndef find_most_frequent_integer(numbers: List[int]) -> Optional[int]:\n    if not numbers:\n        return None\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    most_frequent = min(frequency, key=lambda x: (-frequency[x], x))\n    return most_frequent\n", "entry_point": "find_most_frequent_integer", "input": "[4, 4, 4, 1, 2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18121_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000757", "code": "import re\nfrom typing import Set\ndef process_mutations(raw_data: str) -> Set[str]:\n    muts = set()\n    text = re.sub('<[^<]+>', \"\", raw_data)  # Strip all xml tags\n    muts.update(re.findall(r'[A-Z]\\d+[A-Z]', text))  # Find patterns like P223Q\n    # Find patterns like \"223 A > T\", \"223 A &gt; T\" and convert them to canonical form \"223A>T\"\n    strings = re.findall(r'\\d+ *[ACGT]+ *(?:&gt;|>) *[ACGT]+', text)\n    for ss in strings:\n        m = re.search(r'(?P<pos>\\d+) *(?P<from>[ACGT]+) *(:?&gt;|>) *(?P<to>[ACGT]+)', ss)\n        mut = f\"{m.group('pos')}{m.group('from')}>{m.group('to')}\"\n        muts.add(mut)\n    return muts\n", "entry_point": "process_mutations", "input": "''", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93632_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1959", "output": "{1, 3, 653, 1959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000759", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3275", "output": "{1, 131, 5, 3275, 655, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3274", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000760", "code": "def extract_operator_info(operator_classes):\n    operator_info = {}\n    for op_class in operator_classes:\n        op_class_split = op_class.split('\\n')\n        if len(op_class_split) >= 2:\n            op_name = op_class_split[0]\n            op_desc = op_class_split[2]  # Description is the third element after splitting\n            operator_info[op_name] = op_desc\n    return operator_info\n", "entry_point": "extract_operator_info", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138438_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000761", "code": "import math\ndef calculate_polygon_area(n, s):\n    if n < 3 or n > 12:\n        return \"Number of sides must be between 3 and 12.\"\n    area = (n * s**2) / (4 * math.tan(math.pi / n))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "2, 5", "output": "'Number of sides must be between 3 and 12.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29408_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000762", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1991", "output": "{1, 11, 181, 1991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000763", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'fif'", "output": "'fif_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000764", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000765", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'aaeohraan'", "output": "'contracts/aaeohraan.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000766", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'3 + 4 * 10'", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000767", "code": "import re\ndef parse_package_metadata(metadata_str):\n    metadata_lines = metadata_str.split('\\n')\n    metadata_dict = {}\n    for line in metadata_lines:\n        if '__version__' in line:\n            metadata_dict['version'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif '__license__' in line:\n            metadata_dict['license'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif '__author__' in line:\n            metadata_dict['author'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif '__email__' in line:\n            metadata_dict['email'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif '__url__' in line:\n            metadata_dict['url'] = re.search(r\"'(.*?)'\", line).group(1)\n    return metadata_dict\n", "entry_point": "parse_package_metadata", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31937_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000768", "code": "from typing import List\ndef extract_features(config_data: dict) -> List[str]:\n    features = config_data.get('features', [])\n    excluded_columns = ['TARGET', 'SK_ID_CURR', 'SK_ID_BUREAU', 'SK_ID_PREV', 'index']\n    filtered_features = [f for f in features if f not in excluded_columns]\n    return filtered_features\n", "entry_point": "extract_features", "input": "{'features': []}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74666_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000769", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4514", "output": "{1, 4514, 2, 37, 74, 2257, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000770", "code": "COLOR_CODES = {\n    (0, 0, 255): 1,\n    (0, 123, 0): 2,\n    (255, 0, 0): 3,\n    (0, 0, 123): 4,\n    (123, 0, 0): 5,\n    (0, 123, 123): 6,\n    (0, 0, 0): 7,\n    (123, 123, 123): 8,\n    (189, 189, 189): 0  # unopened/opened blank\n}\ndef get_cell_value(color):\n    return COLOR_CODES.get(color, -1)\n", "entry_point": "get_cell_value", "input": "(255, 255, 255)", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16350_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000771", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[6], [5], [9, 5], [0], [5]]", "output": "[6, 5, 9, 5, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000772", "code": "def find_most_common_element(lst):\n    element_count = {}\n    for element in lst:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common_element = max(element_count, key=element_count.get)\n    return most_common_element\n", "entry_point": "find_most_common_element", "input": "[2, 2, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14063_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000773", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[8, 0, 4, 0, 1, 2, 3, 8, 1]", "output": "[8, 4, 4, 1, 3, 5, 11, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99008_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000774", "code": "def pick_food(name):\n    if name == \"chima\":\n        return \"chicken\"\n    else:\n        return \"dry food\"\n", "entry_point": "pick_food", "input": "'chima'", "output": "'chicken'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3295_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000775", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'teamworrandrooect'", "output": "'teamworrandrooect'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000776", "code": "def extract_java_files(file_dict: dict) -> list:\n    files = []\n    if file_dict.get(\"java_common.provider\", False):\n        files += file_dict.get(\"java_common.provider.transitive_runtime_jars\", [])\n    files += file_dict.get(\"files\", [])\n    return files\n", "entry_point": "extract_java_files", "input": "{'java_common.provider': False, 'files': []}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3775_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000777", "code": "import re\ndef parsing_text_to_label_set(text):\n    unique_labels = set()\n    labels_found = []\n    for word in text.split():\n        match = re.match(r'label(\\d+)', word)\n        if match:\n            label = match.group()\n            unique_labels.add(label)\n            labels_found.append(label)\n    labels_string = ' '.join(labels_found)\n    return unique_labels, labels_string\n", "entry_point": "parsing_text_to_label_set", "input": "'random text here'", "output": "(set(), '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103606_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000778", "code": "from typing import List\ndef process_commands(commands: str) -> List[int]:\n    engines = [0] * 3  # Initialize engines with zeros\n    for command in commands.split():\n        action, engine_number = command.split(':')\n        engine_number = int(engine_number)\n        if action == 'START':\n            engines[engine_number - 1] = engine_number\n        elif action == 'STOP':\n            engines[engine_number - 1] = 0\n    return engines\n", "entry_point": "process_commands", "input": "''", "output": "[0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117335_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000779", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "2.2221119999999983, 1", "output": "2.2221119999999983", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000780", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:  # Even number of elements\n        mid = n // 2\n        return (sorted_numbers[mid - 1] + sorted_numbers[mid]) / 2\n    else:  # Odd number of elements\n        return sorted_numbers[n // 2]\n", "entry_point": "calculate_median", "input": "[4, 6, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28715_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000781", "code": "import math\ndef calculate_polygon_area(num_sides, side_length):\n    pi = math.pi\n    area = (num_sides * side_length ** 2) / (4 * math.tan(pi / num_sides))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "6, 5.0", "output": "64.9519052838329", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120814_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000782", "code": "def extract_file_extension(name: str) -> str:\n    dot_index = name.rfind('.')\n    if dot_index == -1:  # If no dot is found\n        return \"\"\n    return name[dot_index + 1:]\n", "entry_point": "extract_file_extension", "input": "'testfile'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89470_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000783", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[2, 2, 1]", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000784", "code": "def generate_2d_array(rows, cols):\n    result = []\n    for i in range(rows):\n        row = []\n        for j in range(cols):\n            row.append((i, j))\n        result.append(row)\n    return result\n", "entry_point": "generate_2d_array", "input": "0, 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140571_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000785", "code": "from typing import Union\nuser1 = dict(id=\"1\", userName=\"sam\", password=\"<PASSWORD>\")\nuser2 = dict(id=\"2\", userName=\"ben\", password=\"<PASSWORD>\")\nauth_data = {user1[\"id\"]: user1, user2[\"id\"]: user2}\ndef authenticate_user(user_id: str, password: str) -> Union[dict, str]:\n    if user_id in auth_data:\n        if auth_data[user_id][\"password\"] == password:\n            return auth_data[user_id]\n    return \"Authentication failed\"\n", "entry_point": "authenticate_user", "input": "'3', 'any_password'", "output": "'Authentication failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98449_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000786", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[-1, 0, 3, 4, 3, 4, 2]", "output": "[-1, -1, 2, 6, 9, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000787", "code": "def max_subarray_sum(arr):\n    max_ending_here = max_so_far = arr[0]\n    for num in arr[1:]:\n        max_ending_here = max(num, max_ending_here + num)\n        max_so_far = max(max_so_far, max_ending_here)\n    return max_so_far\n", "entry_point": "max_subarray_sum", "input": "[10, 11, -5]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90891_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000788", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[10, 5, 6, 5, 1, 9, 6, 9, 6]", "output": "[1, 5, 5, 6, 6, 6, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000789", "code": "import re\ndef extract_test_case_info(test_case_method):\n    info = {}\n    # Determine request type (POST or DELETE)\n    if 'post' in test_case_method.lower():\n        info['request_type'] = 'POST'\n    elif 'delete' in test_case_method.lower():\n        info['request_type'] = 'DELETE'\n    # Extract endpoint name\n    endpoint_match = re.search(r\"'(.*?)'\", test_case_method)\n    if endpoint_match:\n        info['endpoint'] = endpoint_match.group(1)\n    # Extract card ID\n    card_id_match = re.search(r'\\[(.*?)\\]', test_case_method)\n    if card_id_match:\n        info['card_id'] = int(card_id_match.group(1))\n    # Determine expected status code\n    status_code_match = re.search(r'self.assertEqual\\((\\d+), resp.status_code\\)', test_case_method)\n    if status_code_match:\n        info['expected_status_code'] = int(status_code_match.group(1))\n    return info\n", "entry_point": "extract_test_case_info", "input": "'This is a test case.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14336_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000790", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[(1, 200)]", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000791", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "2, 0, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000792", "code": "import math\ndef count_unique_sizes(determinants):\n    unique_sizes = set()\n    for det in determinants:\n        size = int(math.sqrt(det))\n        unique_sizes.add(size)\n    return len(unique_sizes)\n", "entry_point": "count_unique_sizes", "input": "[0, 1, 4, 9]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74244_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000793", "code": "from typing import List, Dict, Tuple\ndef extract_package_versions(package_requirements: List[str]) -> Dict[str, Tuple[str, str]]:\n    package_versions = {}\n    for requirement in package_requirements:\n        parts = requirement.split('>=') if '>=' in requirement else requirement.split('==')\n        package_name = parts[0].strip()\n        if '>=' in requirement:\n            min_version, max_version = parts[1].split(', <')\n            max_version = max_version.replace(' ', '')\n        else:\n            min_version = max_version = None\n        package_versions[package_name] = (min_version, max_version)\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88535_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000794", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(11, 0, 12, 9, 12, 12, 12, 12)", "output": "'11.0.12.9.12.12.12.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000795", "code": "def euclid_algorithm(area):\n    \"\"\"Return the largest square to subdivide area by.\"\"\"\n    height = area[0]\n    width = area[1]\n    maxdim = max(height, width)\n    mindim = min(height, width)\n    remainder = maxdim % mindim\n    if remainder == 0:\n        return mindim\n    else:\n        return euclid_algorithm((mindim, remainder))\n", "entry_point": "euclid_algorithm", "input": "(2, 3)", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64166_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000796", "code": "def sum_multiples_3_5(nums):\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15548_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000797", "code": "def calculate_total_survival_value(survival_value: dict) -> int:\n    total_survival_value = 0\n    for target, weapons in survival_value.items():\n        for count in weapons.values():\n            total_survival_value += count\n    return total_survival_value\n", "entry_point": "calculate_total_survival_value", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54423_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000798", "code": "def max_non_adjacent_sum(scores):\n    inclusive = 0\n    exclusive = 0\n    for score in scores:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + score  # Update the inclusive value\n        exclusive = new_exclusive  # Update the exclusive value\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[3, 2, 5, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29068_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000799", "code": "def analyze_test_suite(test_results):\n    for result in test_results:\n        if not result:\n            return \"Some tests failed\"\n    return \"All tests passed\"\n", "entry_point": "analyze_test_suite", "input": "[False]", "output": "'Some tests failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33736_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000800", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[5, 4, 3]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000801", "code": "def is_balanced(bracket_string):\n    stack = []\n    for char in bracket_string:\n        if char == '[':\n            stack.append(char)\n        elif char == ']':\n            if not stack:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "is_balanced", "input": "']][]'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144312_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000802", "code": "def find_smallest(lst):\n    smallest = float('inf')  # Initialize with a large value\n    for num in lst:\n        if num < smallest:\n            smallest = num\n    return smallest\n", "entry_point": "find_smallest", "input": "[0, 1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80996_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000803", "code": "def sum_multiples(nums):\n    multiples_set = set()\n    total_sum = 0\n    for num in nums:\n        if num in multiples_set:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[6, 15]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131152_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000804", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[62]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000805", "code": "def calculate_weighted_average(numbers, n_obs_train):\n    if n_obs_train == 0:\n        return 0  # Handling division by zero\n    weight = 1. / n_obs_train\n    weighted_sum = sum(numbers) * weight\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[0.5436893203883495], 1", "output": "0.5436893203883495", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136723_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000806", "code": "user_credentials = {\n    \"alice\": {\"password\": \"12345\", \"role\": \"admin\"},\n    \"bob\": {\"password\": \"password\", \"role\": \"user\"},\n    \"charlie\": {\"password\": \"securepwd\", \"role\": \"user\"}\n}\ndef authenticate_user(username: str, password: str) -> str:\n    if username in user_credentials and user_credentials[username][\"password\"] == password:\n        return user_credentials[username][\"role\"]\n    return \"Unauthorized\"\n", "entry_point": "authenticate_user", "input": "'bob', 'password'", "output": "'user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14714_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000807", "code": "from collections import Counter\ndef getHint(secret: str, guess: str) -> str:\n    bulls = cows = 0\n    seen = Counter()\n    for s, g in zip(secret, guess):\n        if s == g:\n            bulls += 1\n        else:\n            if seen[s] < 0:\n                cows += 1\n            if seen[g] > 0:\n                cows += 1\n            seen[s] += 1\n            seen[g] -= 1\n    return \"{0}A{1}B\".format(bulls, cows)\n", "entry_point": "getHint", "input": "'12345', '12354'", "output": "'3A2B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78888_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000808", "code": "def determinant(matrix):\n    size = len(matrix)\n    if size == 1:\n        return matrix[0][0]\n    elif size == 2:\n        return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]\n    else:\n        det = 0\n        for i in range(size):\n            sign = (-1) ** i\n            submatrix = [row[:i] + row[i+1:] for row in matrix[1:]]\n            det += sign * matrix[0][i] * determinant(submatrix)\n        return det\n", "entry_point": "determinant", "input": "[[1, 2], [2, 4]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37266_ipt35", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5793", "output": "{3, 1, 5793, 1931}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000810", "code": "def sum_multiples_3_5(numbers):\n    multiples_set = set()\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples_set:\n                total_sum += num\n                multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141969_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000811", "code": "def rock_paper_scissors(player1, player2):\n    if player1 == player2:\n        return \"It's a tie!\"\n    elif (player1 == 'rock' and player2 == 'scissors') or (player1 == 'scissors' and player2 == 'paper') or (player1 == 'paper' and player2 == 'rock'):\n        return 'Player 1 wins'\n    else:\n        return 'Player 2 wins'\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'paper'", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99213_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000812", "code": "from urllib.parse import urlparse, parse_qs\ndef parse_query_params(url: str) -> str:\n    parsed_url = urlparse(url)\n    query_params = parse_qs(parsed_url.query)\n    if 'tag' in query_params:\n        tags = query_params['tag']\n        return ','.join(tags)\n    return \"\"\n", "entry_point": "parse_query_params", "input": "'http://example.com?tag=foo&tag=bar'", "output": "'foo,bar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51641_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000813", "code": "def area_under_curve(x, y) -> float:\n    area = 0\n    for i in range(1, len(x)):\n        # Calculate the area of the trapezoid formed by two consecutive points\n        base = x[i] - x[i-1]\n        height_avg = (y[i] + y[i-1]) / 2\n        area += base * height_avg\n    return area\n", "entry_point": "area_under_curve", "input": "[0, 1, 2], [0, 0, 0]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113501_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000814", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[1, 4.5, 2]", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000815", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 2, 4, 8, 0]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122887_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000816", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'aa'", "output": "'aa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000817", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 68", "output": "'68%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000818", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'10 + 5'", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000819", "code": "from typing import Dict, Set\nVertex = int\nTree = Dict[Vertex, Set[Vertex]]\ndef count_subtrees(tree: Tree, root=1) -> int:\n    def dfs(node):\n        nonlocal subtree_count\n        for child in tree.get(node, []):\n            subtree_count += dfs(child)\n        return 1\n    subtree_count = 0\n    dfs(root)\n    return subtree_count\n", "entry_point": "count_subtrees", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139878_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000820", "code": "def calculate_total_nodes(alpha, beta, ndexname):\n    total_nodes = (beta**(alpha+1) - 1) / (beta - 1) - 1\n    return int(total_nodes)\n", "entry_point": "calculate_total_nodes", "input": "0, 2, 'dummy'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122100_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000821", "code": "def search_complexity(input_size, target_value):\n    proximity = abs(input_size - target_value)\n    if proximity <= 10:\n        return \"Low search complexity\"\n    elif proximity <= 50:\n        return \"Medium search complexity\"\n    else:\n        return \"High search complexity\"\n", "entry_point": "search_complexity", "input": "1, 100", "output": "'High search complexity'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112043_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000822", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0, 1, 1, 2, 4, 4, 5, 6, 7, 7]", "output": "[0, 1, 2, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000823", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[1, 1, 2, 3, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000824", "code": "def extract_view_urls(urls):\n    view_urls = {}\n    for url_pattern, view_name in urls:\n        view_name = view_name.split('.')[-1]  # Extract the view name from the full path\n        if view_name in view_urls:\n            view_urls[view_name].append(url_pattern)\n        else:\n            view_urls[view_name] = [url_pattern]\n    return view_urls\n", "entry_point": "extract_view_urls", "input": "[('home/$', 'some.module.HomeAPI')]", "output": "{'HomeAPI': ['home/$']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20327_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000825", "code": "def process_read_info(contig_info):\n    list_read_info = contig_info[3]\n    even_odd_flag = 1\n    counter = 0\n    for read_info in list_read_info:\n        start_pos, end_pos, read_name, even_odd_flag, mis_region = read_info\n        if even_odd_flag == 1 and mis_region == 'A':\n            counter += 1\n        elif even_odd_flag == 0 and mis_region == 'B':\n            counter -= 1\n    return counter\n", "entry_point": "process_read_info", "input": "[None, None, None, [(0, 1, 'read1', 1, 'A'), (2, 3, 'read2', 0, 'B')]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32181_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000826", "code": "def check_proxy(proxy: str) -> str:\n    # Predefined list of bad proxies for simulation\n    bad_proxies = ['123.456.789.10', 'proxy.example.com', '111.222.333.444']\n    if proxy in bad_proxies:\n        return \"ERROR\"\n    else:\n        return \"None\"\n", "entry_point": "check_proxy", "input": "'good.proxy.com'", "output": "'None'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140067_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000827", "code": "import re\ndef validate_alphanumeric(input_string):\n    pattern = r'^[0-9a-zA-Z]*$'\n    return bool(re.match(pattern, input_string))\n", "entry_point": "validate_alphanumeric", "input": "'abc!'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133892_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000828", "code": "from typing import Tuple\ndef extract_metadata(code_snippet: str) -> Tuple[str, str]:\n    author = None\n    date = None\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if line.strip().startswith('__author__'):\n            author = line.split(\"'\")[1]\n        elif line.strip().startswith('date :'):\n            date = line.split(':')[1].strip()\n    return author, date\n", "entry_point": "extract_metadata", "input": "''", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132159_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000829", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "'some_location', 12348", "output": "'https://www.fitx.de/fitnessstudios/12348'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4838", "output": "{1, 2, 4838, 41, 82, 2419, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4837", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000831", "code": "import re\ndef process_speedtest_output(speedtest_output):\n    formatted_info = []\n    for line in speedtest_output.split(\"\\n\"):\n        if \"Testing from\" in line or \"Download\" in line or \"Upload\" in line:\n            line = re.sub(r'Testing from.*?\\(', 'My IP: ', line)\n            line = re.sub(r'\\)\\.\\.\\.', '', line)\n            line = line.replace(\"Download\", \"D\").replace(\"Upload\", \"U\").replace(\"bit/s\", \"bps\")\n            formatted_info.append(line)\n    return formatted_info\n", "entry_point": "process_speedtest_output", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102924_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000832", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6963", "output": "{1, 33, 3, 11, 2321, 6963, 211, 633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000833", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 70]", "output": "[1, 2, 3, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94997_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "745", "output": "{1, 5, 745, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000835", "code": "def count_records_with_file(olink: dict, file_type: str) -> int:\n    count = 0\n    for record in olink.get(\"records\", []):\n        if file_type in record.get(\"files\", {}):\n            count += 1\n    return count\n", "entry_point": "count_records_with_file", "input": "{'records': []}, 'some_type'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89693_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000836", "code": "def general_convert_time(_time, to_places=2) -> str:\n    \"\"\"\n    Used to get a more readable time conversion\n    \"\"\"\n    def convert_time(_time):\n        # Placeholder for the convert_time function logic\n        return \"12 hours 30 minutes 45 seconds\"  # Placeholder return for testing\n    times = convert_time(_time).split(' ')\n    selected_times = times[:to_places]\n    if len(times) > to_places:\n        return ' '.join(selected_times) + (', ' if len(times) > to_places * 2 else '') + ' '.join(times[to_places:])\n    else:\n        return ' '.join(selected_times)\n", "entry_point": "general_convert_time", "input": "'any_time_value', 0", "output": "', 12 hours 30 minutes 45 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119806_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000837", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_counts = {}\n    for word in words:\n        word = word.strip('.,')  # Remove punctuation if present\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'bnron'", "output": "{'bnron': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117339_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000838", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('a') if char.islower() else ord('A')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'helloxyz', 1", "output": "'ifmmpyza'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35219_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000839", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j - 1], dp[i][j - 1], dp[i - 1][j]) + 1\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'apple', 'orange'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83349_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000840", "code": "def calculate_lcm(a, b):\n    # Euclidean algorithm to find GCD\n    while b:\n        a, b = b, a % b\n    gcd = a\n    # Calculate LCM using the formula LCM(a, b) = (a * b) / GCD(a, b)\n    lcm = (a * b) // gcd\n    return lcm\n", "entry_point": "calculate_lcm", "input": "0, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88150_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000841", "code": "def count_kwargs(_kwargs):\n    kwargs_count = []\n    for kwargs in _kwargs:\n        count = len(kwargs.keys()) + len(kwargs.values())\n        kwargs_count.append(count)\n    return kwargs_count\n", "entry_point": "count_kwargs", "input": "[{}, {}, {}, {}, {}, {}, {}]", "output": "[0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15928_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000842", "code": "import math\ndef getRow(rowIndex):\n    result = [1]\n    if rowIndex == 0:\n        return result\n    n = rowIndex\n    for i in range(int(math.ceil((float(rowIndex) + 1) / 2) - 1)):\n        result.append(result[-1] * n / (rowIndex - n + 1))\n        n -= 1\n    if rowIndex % 2 == 0:\n        result.extend(result[-2::-1])\n    else:\n        result.extend(result[::-1])\n    return result\n", "entry_point": "getRow", "input": "0", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127863_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000843", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7126", "output": "{1, 2, 7, 3563, 14, 7126, 1018, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000844", "code": "import os\ndef has_checkpoint(checkpoint_dir):\n    \"\"\"\n    Check if a checkpoint file named \"checkpoint\" is present in the specified directory.\n    Args:\n    - checkpoint_dir: The directory to check for the presence of the checkpoint file.\n    Returns:\n    - True if the checkpoint file is found, False otherwise.\n    \"\"\"\n    if os.path.isdir(checkpoint_dir):  # Check if the directory exists\n        if os.listdir(checkpoint_dir):  # Check if the directory is not empty\n            checkpoint_file = os.path.join(checkpoint_dir, \"checkpoint\")\n            return os.path.isfile(checkpoint_file)  # Check if \"checkpoint\" file exists in the directory\n    return False  # Return False if any condition fails\n", "entry_point": "has_checkpoint", "input": "'non_existent_directory'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38643_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000845", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return None\n    nums.sort()\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[3, 4, 6]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94397_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000846", "code": "def count_users_with_one_post(post_counts):\n    user_post_count = {}\n    for count in post_counts:\n        if count in user_post_count:\n            user_post_count[count] += 1\n        else:\n            user_post_count[count] = 1\n    return user_post_count.get(1, 0)\n", "entry_point": "count_users_with_one_post", "input": "[1, 2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16257_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000847", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2943", "output": "{1, 3, 327, 9, 109, 981, 27, 2943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000848", "code": "from typing import List\nimport re\ndef extract_unique_modules(code: str) -> List[str]:\n    module_names = set()\n    import_pattern = r'from\\s+\\.\\w+\\s+import\\s+([\\w\\s,]+)'\n    import_lines = re.findall(import_pattern, code)\n    for line in import_lines:\n        modules = line.split(',')\n        for module in modules:\n            module_name = module.strip().split()[0]\n            if module_name != '*':\n                module_names.add(module_name)\n    return list(module_names)\n", "entry_point": "extract_unique_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49660_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "234", "output": "{1, 2, 3, 6, 39, 9, 234, 13, 78, 18, 117, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000850", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i][j - 1] + 1, dp[i - 1][j] + 1, dp[i - 1][j - 1] + 1)\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'abc', 'def'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52056_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000851", "code": "def transform_matrix(matrix):\n    n = len(matrix)\n    transformed_matrix = [[0 for _ in range(n)] for _ in range(n)]\n    for i in range(n):\n        for j in range(n):\n            if i == j:\n                transformed_matrix[i][j] = matrix[i][j]\n            else:\n                row_sum = sum(matrix[i]) - matrix[i][j]\n                col_sum = sum(row[j] for row in matrix) - matrix[i][j]\n                transformed_matrix[i][j] = row_sum + col_sum\n    return transformed_matrix\n", "entry_point": "transform_matrix", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[1, 17, 18], [19, 5, 21], [22, 23, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18344_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000852", "code": "from typing import List\ndef sum_of_even_numbers(numbers: List[int]) -> int:\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5179_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000853", "code": "import math\ndef sum_of_primes(n: int) -> int:\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, n + 1, i):\n                is_prime[j] = False\n    return sum(i for i in range(2, n + 1) if is_prime[i])\n", "entry_point": "sum_of_primes", "input": "7", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79663_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000854", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'MovingreeBatchNorm'", "output": "'movingree_batch_norm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000855", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6173", "output": "{1, 6173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000856", "code": "def sum_even_numbers(lst):\n    total_sum = 0\n    for num in lst:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[-2]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70030_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000857", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3714", "output": "{1857, 1, 3714, 2, 3, 6, 619, 1238}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000858", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'cabccabcCHAIN_IDff31232345', ''", "output": "'cabccabcff31232345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000859", "code": "def initialize_environments(env_names):\n    env_instances = {}\n    for env_name in env_names:\n        try:\n            # Dynamically import the environment class\n            env_module = __import__(f\"dacbench.envs.{env_name.lower()}\", fromlist=[env_name])\n            env_class = getattr(env_module, env_name)\n            # Initialize an instance of the environment class\n            env_instance = env_class()\n            # Add the environment instance to the dictionary\n            env_instances[env_name] = env_instance\n        except (ImportError, AttributeError):\n            print(f\"Error: Could not import or initialize {env_name}\")\n    return env_instances\n", "entry_point": "initialize_environments", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71596_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000860", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[8, 9, 10]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000861", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[3, 1, 1, 1, 1, 2, 2, 4]", "output": "[3, 1, 1, 1, 1, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000862", "code": "def next_hop_ip(src_ip, dst_ip, routing_table):\n    key = (src_ip, dst_ip)\n    if key in routing_table:\n        return routing_table[key]\n    else:\n        return 'No route available'\n", "entry_point": "next_hop_ip", "input": "'192.168.1.1', '10.0.0.1', {}", "output": "'No route available'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81772_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "976", "output": "{1, 2, 4, 488, 8, 976, 16, 244, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt975", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000864", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'files/data/data.csv', None", "output": "('files/data/data.csv', 'files/data/data.csv')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000865", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'4.4.0.1.22'", "output": "(4, 4, 0, 1, 22)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000866", "code": "import re\ndef parse_maven_dependencies(code_snippet):\n    dependencies = {}\n    pattern = r'name = \"(.*?)\",\\n\\s+artifact = \"(.*?)\",\\n\\s+sha1 = \"(.*?)\"'\n    matches = re.findall(pattern, code_snippet, re.DOTALL)\n    for match in matches:\n        name, artifact, sha1 = match\n        dependencies[name] = (artifact, sha1)\n    return dependencies\n", "entry_point": "parse_maven_dependencies", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73691_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000867", "code": "def sum_even_numbers(lst):\n    total_sum = 0\n    for num in lst:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[10, 10, 8]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31557_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000868", "code": "def top_three_scores(scores):\n    unique_scores = set(scores)\n    sorted_scores = sorted(unique_scores, reverse=True)\n    if len(sorted_scores) >= 3:\n        return sorted_scores[:3]\n    else:\n        return sorted_scores\n", "entry_point": "top_three_scores", "input": "[70, 88, 75, 89, 75]", "output": "[89, 88, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99287_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000869", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[100, 86, 83, 86, 86, 83]", "output": "[-14, -3, 3, 0, -3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2315", "output": "{1, 2315, 5, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2314", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000871", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[2, 4, 4, -1, 3, 0, 4, 4]", "output": "[2, 6, 10, 9, 12, 12, 16, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000872", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[5, 5, 3, 3, 1, 1]", "output": "[5, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000873", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "[255, 255, 255]", "output": "'#FFFFFF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000874", "code": "def toggle_trash_bin_relay(relay_id: int, state: int) -> str:\n    if relay_id == 1 and state == 1:\n        return \"Relay toggled successfully\"\n    elif relay_id not in [1, 2, 3]:  # Assuming relay IDs 1, 2, 3 are valid\n        return \"Relay ID not found\"\n    else:\n        return \"Failed to toggle relay\"\n", "entry_point": "toggle_trash_bin_relay", "input": "2, 0", "output": "'Failed to toggle relay'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121601_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000875", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 4, 6, 9]", "output": "108", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000876", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        if not char.isspace():\n            char = char.lower()\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'sample m'", "output": "{'s': 1, 'a': 1, 'm': 2, 'p': 1, 'l': 1, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36956_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000877", "code": "import re\ndef extract_project_details(text):\n    project_details = {}\n    # Extract repository name\n    repository_match = re.search(r'\"(.*?)\"', text)\n    if repository_match:\n        project_details['Repository'] = repository_match.group(1)\n    # Extract project titles\n    project_titles = re.findall(r'\\b[A-Z]{2,}\\b', text)\n    project_details['Project Titles'] = project_titles\n    # Extract model name\n    model_match = re.search(r'Model is (\\w+-\\w+)', text)\n    if model_match:\n        project_details['Model'] = model_match.group(1)\n    # Extract author's name and email\n    author_match = re.search(r'Author: (.*?) \\((.*?)\\)', text)\n    if author_match:\n        project_details['Author'] = author_match.group(1)\n        project_details['Email'] = author_match.group(2)\n    return project_details\n", "entry_point": "extract_project_details", "input": "'this is a test'", "output": "{'Project Titles': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56739_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000878", "code": "def parse_allowed_tags(input_string):\n    tag_dict = {}\n    tag_list = input_string.split()\n    for tag in tag_list:\n        tag_parts = tag.split(':')\n        tag_name = tag_parts[0]\n        attributes = tag_parts[1:] if len(tag_parts) > 1 else []\n        tag_dict[tag_name] = attributes\n    return tag_dict\n", "entry_point": "parse_allowed_tags", "input": "'dtd:t'", "output": "{'dtd': ['t']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14310_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000879", "code": "def initialize_model(network_type, long_side):\n    model_mapping = {\n        'mobile0.25': 'RetinaFace',\n        'slim': 'Slim',\n        'RFB': 'RFB'\n    }\n    if network_type in model_mapping:\n        return f\"Initialized {model_mapping[network_type]} model with long side {long_side}\"\n    else:\n        return \"Invalid network type specified\"\n", "entry_point": "initialize_model", "input": "'mobile0.25', 320", "output": "'Initialized RetinaFace model with long side 320'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84777_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000880", "code": "def has_consecutive_range(lst):\n    if not lst:\n        return False\n    sorted_lst = sorted(lst)\n    for i in range(len(sorted_lst) - 1):\n        if sorted_lst[i + 1] - sorted_lst[i] != 1:\n            return False\n    return True\n", "entry_point": "has_consecutive_range", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40207_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000881", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "5, 2", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000882", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[7, 16]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000883", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'5'", "output": "['5']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000884", "code": "def solution(arr):\n    if not arr:\n        return 0\n    visible_count = 1\n    max_height = arr[-1]\n    for i in range(len(arr) - 2, -1, -1):\n        if arr[i] > max_height:\n            visible_count += 1\n            max_height = arr[i]\n    return visible_count\n", "entry_point": "solution", "input": "[1, 2, 3, 4, 5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115968_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000885", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No meaningful average if less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[60, 70, 74, 78, 80]", "output": "74.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57154_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000886", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:MIT+6.001+Spring2022'", "output": "('MIT', '6.001', 'Spring2022')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000887", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[4, 4, 1, 3, 1, 1, 1, 0, 1]", "output": "[8, 5, 4, 4, 2, 2, 1, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000888", "code": "def unique_arrangements(elements, num_groups):\n    if num_groups == 1:\n        return 1\n    total_arrangements = 0\n    for i in range(1, len(elements) - num_groups + 2):\n        total_arrangements += unique_arrangements(elements[i:], num_groups - 1)\n    return total_arrangements\n", "entry_point": "unique_arrangements", "input": "[1], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71108_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000889", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "27, 'mode', 1", "output": "{'response': 'InvalidPin', 'pin': 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000890", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8223", "output": "{1, 3, 2741, 8223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000891", "code": "def validate_version(version: str) -> bool:\n    components = version.split('.')\n    if len(components) != 3:\n        return False\n    for component in components:\n        if not component.isdigit() or (len(component) > 1 and component.startswith('0')):\n            return False\n    return True\n", "entry_point": "validate_version", "input": "'1.2.3'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108908_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000892", "code": "from collections import Counter\ndef max_score(card, k):\n    c = Counter(card)\n    ans = 0\n    while k > 0:\n        tmp = c.pop(c.most_common(1)[0][0])\n        if k > tmp:\n            ans += tmp * tmp\n            k -= tmp\n        else:\n            ans += k * k\n            k = 0\n    return ans\n", "entry_point": "max_score", "input": "[1, 1, 1, 1, 1, 1, 1, 1, 1], 9", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62809_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000893", "code": "loginid  = \"your login id\"\npassword = \"<PASSWORD>\"\ndef validate_credentials(entered_loginid, entered_password):\n    if entered_loginid == loginid and entered_password != \"<PASSWORD>\":\n        return True\n    else:\n        return False\n", "entry_point": "validate_credentials", "input": "'your login id', 'mySecretPassword'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48019_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000894", "code": "def isPhoneNumber(text):\n    if len(text) != 12:\n        return False\n    for i in range(0, 3):\n        if not text[i].isdecimal():\n            return False\n    if text[3] != '-':\n        return False\n    for i in range(4, 7):\n        if not text[i].isdecimal():\n            return False\n    if text[7] != '-':\n        return False\n    for i in range(8, 12):\n        if not text[i].isdecimal():\n            return False\n    return True\n", "entry_point": "isPhoneNumber", "input": "'123-456-78'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129175_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000895", "code": "def max_height(staircase):\n    max_height = 0\n    current_height = 0\n    for step in staircase:\n        if step == '+':\n            current_height += 1\n        elif step == '-':\n            current_height -= 1\n        max_height = max(max_height, current_height)\n    return max_height\n", "entry_point": "max_height", "input": "'++++++++'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46647_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000896", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_primes = 0\n    for num in numbers:\n        if is_prime(num):\n            total_primes += num\n    return total_primes\n", "entry_point": "sum_of_primes", "input": "[7, 11]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102298_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000897", "code": "def check_palindrome(input):\n    # Convert input to string for uniform processing\n    input_str = str(input).lower().replace(\" \", \"\")\n    # Check if the reversed string is equal to the original string\n    return input_str == input_str[::-1]\n", "entry_point": "check_palindrome", "input": "'hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57138_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000898", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "12, 4", "output": "495", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000899", "code": "import heapq\ndef first_n_smallest(lst, n):\n    heap = [(val, idx) for idx, val in enumerate(lst)]\n    heapq.heapify(heap)\n    result = [heapq.heappop(heap) for _ in range(n)]\n    result.sort(key=lambda x: x[1])  # Sort based on original indices\n    return [val for val, _ in result]\n", "entry_point": "first_n_smallest", "input": "[1, 5, 3], 1", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105636_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000900", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4967", "output": "{1, 4967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000901", "code": "from collections import deque\ndef count_connected_components(graph, N):\n    visited = [0] * (N + 1)  # Initialize visited list\n    cnt = 0  # Initialize count of connected components\n    def bfs(node):\n        queue = deque([node])\n        while queue:\n            n = queue.popleft()\n            for x in graph[n]:\n                if visited[x] == 0:\n                    queue.append(x)\n                    visited[x] = 1\n    for i in range(1, N + 1):\n        if visited[i] == 0:\n            bfs(i)\n            cnt += 1\n    return cnt\n", "entry_point": "count_connected_components", "input": "{1: [2], 2: [1], 3: [], 4: [5], 5: [4]}, 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128332_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000902", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[10, 20, 24]", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000903", "code": "def find_unique_element(nums):\n    unique_element = 0\n    for num in nums:\n        unique_element ^= num\n    return unique_element\n", "entry_point": "find_unique_element", "input": "[2, 1, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52306_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000904", "code": "from typing import List\ndef count_pairs_sum_target(nums: List[int], target: int) -> int:\n    count = 0\n    num_freq = {}\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return count\n", "entry_point": "count_pairs_sum_target", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5042_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000905", "code": "def get_imported_modules(python_version):\n    modules_mapping = {\n        2: ['os', 'hashlib', 're', 'BeautifulSoup', 'sys', 'time', 'glob', 'traceback', 'sqlite3', 'get_python_lib', 'socket', 'copy', 'urlparse', 'StringIO', 'StringIO', 'ConfigParser', 'httplib'],\n        3: ['os', 'hashlib', 're', 'BeautifulSoup', 'sys', 'time', 'glob', 'traceback', 'sqlite3', 'get_python_lib', 'socket', 'copy', 'urlparse', 'StringIO', 'configparser', 'http.client', 'io']\n    }\n    return modules_mapping.get(python_version, [])\n", "entry_point": "get_imported_modules", "input": "1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135754_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000906", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[85, 88, 92, 70, 75]", "output": "[92, 88, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000907", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_evens", "input": "[2, 4, 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121805_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000908", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[1, 7]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3789", "output": "{1, 3, 421, 9, 3789, 1263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4775", "output": "{1, 5, 4775, 25, 955, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4774", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000911", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[5, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000912", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10, 15, 12, 10]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67670_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000913", "code": "def count_pairs_sum_to_target(nums, target):\n    num_freq = {}\n    pairs_count = 0\n    for num in nums:\n        complement = target - num\n        if complement in num_freq and num_freq[complement] > 0:\n            pairs_count += 1\n            num_freq[complement] -= 1\n        else:\n            num_freq[num] = num_freq.get(num, 0) + 1\n    return pairs_count\n", "entry_point": "count_pairs_sum_to_target", "input": "[1, 5, 2, 4, 3, 3], 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71005_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000914", "code": "def prime_sum(limit: int) -> int:\n    def sieve_of_eratosthenes(n):\n        primes = [True] * (n + 1)\n        primes[0] = primes[1] = False\n        p = 2\n        while p * p <= n:\n            if primes[p]:\n                for i in range(p * p, n + 1, p):\n                    primes[i] = False\n            p += 1\n        return [i for i in range(2, n) if primes[i]]\n    primes_below_limit = sieve_of_eratosthenes(limit)\n    return sum(primes_below_limit)\n", "entry_point": "prime_sum", "input": "14", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76811_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000915", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2284", "output": "{1, 2, 4, 2284, 1142, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2283", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000916", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3819", "output": "{1, 3, 67, 201, 3819, 19, 1273, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000917", "code": "def was_last_token(prev_prefix, prefix):\n    add_role = False\n    if prefix != 'I' and prev_prefix == 'I':\n        add_role = True\n    return add_role\n", "entry_point": "was_last_token", "input": "'I', 'I'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101433_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000918", "code": "def calculate_bytes_required(num):\n    if num == 0:\n        return 1  # 0 requires 1 byte to store\n    else:\n        # Calculate the number of bits required to represent the integer\n        num_bits = num.bit_length()\n        # Calculate the number of bytes required (round up division by 8)\n        num_bytes = (num_bits + 7) // 8\n        return num_bytes\n", "entry_point": "calculate_bytes_required", "input": "256", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110035_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000919", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[80, 85, 90, 95, 90, 85, 90, 90]", "output": "[4, 3, 2, 1, 2, 3, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000920", "code": "def mesh_tree_depth(id):\n    if len(id) == 1:\n        return 0\n    else:\n        return id.count('.') + 1\n", "entry_point": "mesh_tree_depth", "input": "'a.b.c'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32418_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000921", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVAsubdiHVAC/fieldsir1'", "output": "('HVAsubdiHVAC/fieldsir1', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000922", "code": "def count_e_letters(input_string):\n    count = 0\n    lowercase_input = input_string.lower()\n    for char in lowercase_input:\n        if char == 'e' or char == '\u00e9':\n            count += 1\n    return count\n", "entry_point": "count_e_letters", "input": "'hello'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15839_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000923", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[4, 4, 5, 8, 4, 8, 8, 7, 3]", "output": "[4, 5, 7, 11, 8, 13, 14, 14, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000924", "code": "import re\ndef extract_urls_and_views(url_config):\n    url_view_dict = {}\n    urlpatterns_start = url_config.find('urlpatterns = [')\n    urlpatterns_end = url_config.find(']', urlpatterns_start)\n    urlpatterns_content = url_config[url_config.find('[', urlpatterns_start):urlpatterns_end+1]\n    url_view_lines = re.findall(r\"path\\(['\\\"](.*?)['\\\"].*?(\\w+\\.\\w+|\\w+\\.as_view\\(\\))\", urlpatterns_content)\n    for url, view in url_view_lines:\n        url_view_dict[url] = view\n    return url_view_dict\n", "entry_point": "extract_urls_and_views", "input": "'urlpatterns = []'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109274_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000925", "code": "import re\ndef parse_template(template_str):\n    result = {}\n    # Regular expression pattern to match placeholders for template, block name, and block body\n    pattern = r'\\{\\{\\s*(?P<template>.*?)\\s*\\}\\},\\s*\\{%\\s*(?P<block_name>.*?)\\s*%\\}\\s*(?P<block_body>.*)'\n    match = re.match(pattern, template_str)\n    if match:\n        result[\"template\"] = match.group(\"template\").strip()\n        result[\"block_name\"] = match.group(\"block_name\").strip()\n        result[\"block_body\"] = match.group(\"block_body\").strip()\n    return result\n", "entry_point": "parse_template", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97514_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000926", "code": "def calculate_average_score(scores: list) -> float:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 90]", "output": "86.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100039_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000927", "code": "def calculate_percentiles(data):\n    data.sort()  # Sort the input data in ascending order\n    percentiles = []\n    for i in range(10, 101, 10):\n        index = int(i / 100 * len(data))  # Calculate the index for the current percentile\n        percentiles.append(data[index - 1])  # Retrieve the value at the calculated index\n    return percentiles\n", "entry_point": "calculate_percentiles", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82884_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000928", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[85, 88, 90, 95, 80]", "output": "87.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_559_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000929", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'ddddd'", "output": "'ddddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000930", "code": "def max_profit(stock_prices):\n    if not stock_prices:\n        return 0\n    min_price = float('inf')\n    max_profit = 0\n    for price in stock_prices:\n        min_price = min(min_price, price)\n        potential_profit = price - min_price\n        max_profit = max(max_profit, potential_profit)\n    return max_profit\n", "entry_point": "max_profit", "input": "[1, 5, 6, 7, 10]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26362_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000931", "code": "def count_players(scores, min_score):\n    count = 0\n    for score in scores:\n        if score < min_score:\n            break\n        count += 1\n    return count\n", "entry_point": "count_players", "input": "[5, 3], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6144_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000932", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "28, 2", "output": "378", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000933", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "30, 6", "output": "593775", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt187", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000934", "code": "def calculate_average_score(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score, 2)  # Round the average score to 2 decimal places\n", "entry_point": "calculate_average_score", "input": "[84, 86, 86, 86, 90]", "output": "86.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140998_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000935", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0  # Return 0 if the list of scores is empty\n    total_score = sum(scores)\n    num_scores = len(scores)\n    if num_scores == 0:\n        return 0  # Return 0 if there are no scores in the list\n    average_score = total_score / num_scores\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[86.6]", "output": "86.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84021_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000936", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', -6, -4", "output": "(-5, -4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000937", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[-154, -153, -154], 3", "output": "-153.66666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000938", "code": "def count_ways_to_climb_stairs(n):\n    if n == 0 or n == 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29461_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000939", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[6, 7, 7, 7]", "output": "[6, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000940", "code": "def sort_forms_by_fields(code_snippet):\n    form_classes = {\n        'FormA': 5,\n        'FormB': 3,\n        'FormC': 7\n    }  # Extracted from the code snippet for demonstration\n    sorted_forms = sorted(form_classes, key=lambda x: form_classes[x], reverse=True)\n    return sorted_forms\n", "entry_point": "sort_forms_by_fields", "input": "None", "output": "['FormC', 'FormA', 'FormB']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8277_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000941", "code": "def find_patterns(input_signal, pattern):\n    indices = []\n    pattern_length = len(pattern)\n    for i in range(len(input_signal) - pattern_length + 1):\n        if input_signal[i:i+pattern_length] == pattern:\n            indices.append(i)\n    return indices\n", "entry_point": "find_patterns", "input": "'abc', 'xyz'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127785_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000942", "code": "def analyze_list(lst):\n    total = len(lst)\n    even_count = sum(1 for num in lst if num % 2 == 0)\n    total_sum = sum(lst)\n    return {'Total': total, 'Even': even_count, 'Sum': total_sum}\n", "entry_point": "analyze_list", "input": "[]", "output": "{'Total': 0, 'Even': 0, 'Sum': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93656_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000943", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "43, 2", "output": "903", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt651", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000944", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'40 - 7'", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000945", "code": "import math\ndef convert_bytes_to_human_readable(size_bytes):\n    if size_bytes == 0:\n        return \"0B\"\n    size_name = (\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\")\n    i = int(math.floor(math.log(size_bytes, 1024)))\n    p = math.pow(1024, i)\n    s = round(size_bytes / p, 2)\n    return \"%s %s\" % (s, size_name[i])\n", "entry_point": "convert_bytes_to_human_readable", "input": "2048", "output": "'2.0 KB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67135_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000946", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[50, 85, 40, 55, 92, 65, 91, 30]", "output": "['E', 'B', 'E', 'E', 'A', 'D', 'A', 'E']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000947", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[11, 10, 8, 8, 8, 7, 7, 6, 4]", "output": "[11, 10, 8, 8, 8, 7, 7, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000948", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('a') if char.islower() else ord('A')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'hello', 3", "output": "'khoor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35219_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000949", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N <= len(scores) else sorted_scores\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[95, 95, 94, 95, 95], 5", "output": "94.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122471_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000950", "code": "def max_profit(stock_prices):\n    if not stock_prices or len(stock_prices) < 2:\n        return 0\n    min_price = float('inf')\n    max_profit = 0\n    for price in stock_prices:\n        min_price = min(min_price, price)\n        potential_profit = price - min_price\n        max_profit = max(max_profit, potential_profit)\n    return max_profit\n", "entry_point": "max_profit", "input": "[2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98153_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000951", "code": "from typing import List\ndef most_frequent_item_id(item_ids: List[int]) -> int:\n    frequency = {}\n    for item_id in item_ids:\n        frequency[item_id] = frequency.get(item_id, 0) + 1\n    max_frequency = max(frequency.values())\n    most_frequent_ids = [item_id for item_id, freq in frequency.items() if freq == max_frequency]\n    return min(most_frequent_ids)\n", "entry_point": "most_frequent_item_id", "input": "[4, 4, 4, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7393_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000952", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'308535383005355353851e/', 280", "output": "'308535383005355353851e/280'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000953", "code": "def reverse_string_in_special_way(string: str) -> str:\n    string = list(string)\n    left, right = 0, len(string) - 1\n    while left < right:\n        string[left], string[right] = string[right], string[left]\n        left += 1\n        right -= 1\n    return ''.join(string)\n", "entry_point": "reverse_string_in_special_way", "input": "'ppllon'", "output": "'nollpp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21549_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000954", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[207]", "output": "207", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000955", "code": "def play_card_game(player1_deck, player2_deck, max_rounds):\n    def play_round():\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_deck.extend([card1, card2])\n        elif card2 > card1:\n            player2_deck.extend([card2, card1])\n        else:  # War\n            if len(player1_deck) < 4 or len(player2_deck) < 4:\n                return -1  # Game ends in a draw\n            else:\n                war_cards = [card1, card2] + player1_deck[:3] + player2_deck[:3]\n                del player1_deck[:4]\n                del player2_deck[:4]\n                result = play_round()  # Recursive war\n                if result == 0:\n                    player1_deck.extend(war_cards)\n                elif result == 1:\n                    player2_deck.extend(war_cards)\n    for _ in range(max_rounds):\n        if not player1_deck:\n            return 1  # Player 2 wins\n        elif not player2_deck:\n            return 0  # Player 1 wins\n        result = play_round()\n        if result == -1:\n            return -1  # Game ends in a draw\n    return -1  # Max rounds reached without a winner\n", "entry_point": "play_card_game", "input": "[1, 2], [3, 4, 5], 10", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40748_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000956", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4658", "output": "{1, 2, 34, 137, 17, 4658, 274, 2329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4657", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000957", "code": "import re\ndef extract_package_names(code_snippet):\n    package_names = set()\n    import_pattern = r\"from\\s+([\\w\\.]+)\\s+import\"\n    imports = re.findall(import_pattern, code_snippet)\n    for imp in imports:\n        package_names.add(imp)\n    return list(package_names)\n", "entry_point": "extract_package_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63678_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000958", "code": "import collections\ndef can_two_sum(arr, k):\n    nums = collections.defaultdict(int)\n    for (i, num) in enumerate(arr):\n        compliment = k - num\n        if nums.get(compliment) is not None and nums.get(compliment) != i:\n            return True\n        else:\n            nums[num] = i\n    return False\n", "entry_point": "can_two_sum", "input": "[1, 2], 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98498_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000959", "code": "from typing import List\ndef count_unique_ips(ip_ranges: List[str]) -> int:\n    total_ips = 0\n    for ip_range in ip_ranges:\n        ip, subnet_mask = ip_range.split('/')\n        subnet_mask = int(subnet_mask)\n        total_ips += 2**(32 - subnet_mask)\n    return total_ips\n", "entry_point": "count_unique_ips", "input": "['192.168.0.0/12', '192.168.16.0/24']", "output": "1048832", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115362_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000960", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[2, 2, 6, 8, 8, 5, 5]", "output": "[2, 2, 6, 8, 8, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000961", "code": "def max_consecutive_ones(n):\n    binary_str = bin(n)[2:]  # Convert n to binary and remove the '0b' prefix\n    max_ones = 0\n    current_ones = 0\n    for digit in binary_str:\n        if digit == '1':\n            current_ones += 1\n            max_ones = max(max_ones, current_ones)\n        else:\n            current_ones = 0\n    return max_ones\n", "entry_point": "max_consecutive_ones", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99433_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000962", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "5, 11.0", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000963", "code": "def filter_keys(input_dict):\n    return {key for key in input_dict.keys() if 'attention_biases' in key}\n", "entry_point": "filter_keys", "input": "{}", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139029_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000964", "code": "from collections import deque\ndef total_contaminated_nodes(n, cont1, g):\n    contaminated_nodes = {cont1}\n    queue = deque([cont1])\n    while queue:\n        current_node = queue.popleft()\n        for neighbor in range(n):\n            if neighbor not in contaminated_nodes and g[current_node][neighbor] == 1:\n                contaminated_nodes.add(neighbor)\n                queue.append(neighbor)\n    return len(contaminated_nodes)\n", "entry_point": "total_contaminated_nodes", "input": "3, 0, [[0, 1, 1], [1, 0, 0], [1, 0, 0]]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91664_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000965", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2031", "output": "{1, 3, 677, 2031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000966", "code": "from typing import List\ndef reconstruct_sequence(counts: List[int]) -> List[int]:\n    sequence = []\n    for i in range(len(counts)):\n        sequence.extend([i+1] * counts[i])\n    return sequence\n", "entry_point": "reconstruct_sequence", "input": "[2, 1, 1, 3]", "output": "[1, 1, 2, 3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4314_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000967", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'ehrwldhhoo'", "output": "'ehrwldhhoo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000968", "code": "def directory_pattern_filter(input_str):\n    if isinstance(input_str, str) and input_str:\n        return True\n    return False\n", "entry_point": "directory_pattern_filter", "input": "0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_469_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000969", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'r00T04'", "output": "'00T04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000970", "code": "import re\ndef validate_password(password):\n    errors = []\n    if len(password) < 8:\n        errors.append('Must be at least 8 characters')\n    if not re.search('[0-9]', password):\n        errors.append('Must include a number')\n    if not re.search('[A-Z]', password):\n        errors.append('Must include a capital letter')\n    if not re.search('[^a-zA-Z0-9]', password):\n        errors.append('Must include a special character')\n    return errors\n", "entry_point": "validate_password", "input": "'Password1'", "output": "['Must include a special character']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92916_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000971", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1502", "output": "1462", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000972", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers.\"\n    elif n == 0:\n        return 1\n    else:\n        return n * calculate_factorial(n - 1)\n", "entry_point": "calculate_factorial", "input": "8", "output": "40320", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139159_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000973", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_evens", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16654_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000974", "code": "import os\nimport glob\ndef count_file_extensions(directory):\n    extension_count = {}\n    files = glob.glob(os.path.join(directory, '*'))\n    for file in files:\n        if os.path.isfile(file):\n            _, extension = os.path.splitext(file)\n            extension = extension.lower()[1:]  # Ignore the leading dot and convert to lowercase\n            extension_count[extension] = extension_count.get(extension, 0) + 1\n    return extension_count\n", "entry_point": "count_file_extensions", "input": "'./empty_directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147721_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000975", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers\"\n    elif n == 0:\n        return 1\n    else:\n        result = 1\n        for i in range(1, n + 1):\n            result *= i\n        return result\n", "entry_point": "calculate_factorial", "input": "-1", "output": "'Factorial is not defined for negative numbers'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39360_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000976", "code": "from datetime import datetime\ndef get_day_of_week(date_str):\n    try:\n        date = datetime.strptime(date_str, \"%Y-%m-%d\")\n        day_of_week = date.strftime(\"%A\")\n        return day_of_week\n    except ValueError:\n        return \"Invalid Date\"\n", "entry_point": "get_day_of_week", "input": "'2021-02-30'", "output": "'Invalid Date'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69670_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000977", "code": "import importlib\ndef custom_reload(module_name):\n    import sys\n    if module_name in sys.modules:\n        try:\n            importlib.reload(sys.modules[module_name])\n            return True\n        except Exception as e:\n            print(f\"Error reloading module '{module_name}': {e}\")\n            return False\n    else:\n        print(f\"Module '{module_name}' does not exist.\")\n        return False\n", "entry_point": "custom_reload", "input": "'non_existent_module'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85920_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000978", "code": "def process_buttons(buttons):\n    if buttons is None:\n        return None\n    try:\n        if buttons.SUBCLASS_OF_ID == 0xe2e10ef2:\n            return buttons\n    except AttributeError:\n        pass\n    if not isinstance(buttons, list):\n        buttons = [[buttons]]\n    elif not isinstance(buttons[0], list):\n        buttons = [buttons]\n    is_inline = False\n    is_normal = False\n    rows = []\n    return buttons, is_inline, is_normal, rows\n", "entry_point": "process_buttons", "input": "[1, 2, 3]", "output": "([[1, 2, 3]], False, False, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147264_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000979", "code": "def format_ranges(lst):\n    formatted_ranges = []\n    start = end = lst[0]\n    for i in range(1, len(lst)):\n        if lst[i] == end + 1:\n            end = lst[i]\n        else:\n            if end - start >= 2:\n                formatted_ranges.append(f\"{start}-{end}\")\n            else:\n                formatted_ranges.extend(str(num) for num in range(start, end + 1))\n            start = end = lst[i]\n    if end - start >= 2:\n        formatted_ranges.append(f\"{start}-{end}\")\n    else:\n        formatted_ranges.extend(str(num) for num in range(start, end + 1))\n    return ','.join(map(str, formatted_ranges))\n", "entry_point": "format_ranges", "input": "[0, 2, 4, 7, 9, 9, 4, 0, 2]", "output": "'0,2,4,7,9,9,4,0,2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111612_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000980", "code": "import io\nimport traceback\ndef process_code_snippet(code: str) -> tuple:\n    co_filename = None\n    f_lineno = None\n    co_name = None\n    sinfo = None\n    lines = code.split('\\n')\n    for line in lines:\n        if 'co.co_filename' in line:\n            co_filename = line.split(',')[0].strip()[1:]\n        elif 'f.f_lineno' in line:\n            f_lineno = int(line.split(',')[1].strip())\n        elif 'co.co_name' in line:\n            co_name = line.split(',')[2].strip()\n        elif 'traceback.print_stack' in line:\n            sio = io.StringIO()\n            sio.write('Stack (most recent call last):\\n')\n            traceback.print_stack(file=sio)\n            sinfo = sio.getvalue().strip()\n            sio.close()\n    return (co_filename, f_lineno, co_name, sinfo)\n", "entry_point": "process_code_snippet", "input": "''", "output": "(None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98960_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000981", "code": "# Define the set of primitive types\nPRIMITIVE_TYPES = {'<string>', '<number>', '<boolean>', '<enum>'}\ndef is_primitive_type(input_type):\n    return input_type in PRIMITIVE_TYPES\n", "entry_point": "is_primitive_type", "input": "'<complex>'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146968_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000982", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'11.5.5'", "output": "(11, 5, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000983", "code": "import re\ndef isPalindrome(string):\n    # Remove non-alphanumeric characters and convert to lowercase\n    clean_string = re.sub(r'[^a-zA-Z0-9]', '', string).lower()\n    # Check if the clean string is equal to its reverse\n    return clean_string == clean_string[::-1]\n", "entry_point": "isPalindrome", "input": "'hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118682_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000984", "code": "def count_storage_operations(storage_operations):\n    operation_counts = {}\n    for code in storage_operations:\n        if code in operation_counts:\n            operation_counts[code] += 1\n        else:\n            operation_counts[code] = 1\n    return operation_counts\n", "entry_point": "count_storage_operations", "input": "[101, 101, 103, 100, 99, 99, 104]", "output": "{101: 2, 103: 1, 100: 1, 99: 2, 104: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69426_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000985", "code": "def evaluate_polynomial(coefs, x0):\n    result = 0\n    for coef in reversed(coefs):\n        result = coef + result * x0\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[740781], 10", "output": "740781", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86312_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2955", "output": "{1, 3, 5, 197, 2955, 591, 15, 985}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000987", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers.\"\n    elif n == 0:\n        return 1\n    else:\n        return n * calculate_factorial(n - 1)\n", "entry_point": "calculate_factorial", "input": "5", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139159_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000988", "code": "def calculate_string_difference(str1, str2):\n    len1, len2 = len(str1), len(str2)\n    max_len = max(len1, len2)\n    diff_count = 0\n    for i in range(max_len):\n        char1 = str1[i] if i < len1 else None\n        char2 = str2[i] if i < len2 else None\n        if char1 != char2:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_string_difference", "input": "'abcdefghijklmno', 'xyzabcdefghijk'", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32682_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2101", "output": "{1, 11, 2101, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000990", "code": "def sum_of_squares(nums: list[int]) -> int:\n    \"\"\"\n    Calculate the sum of squares of integers in the input list.\n    Args:\n    nums: A list of integers.\n    Returns:\n    The sum of the squares of the integers in the input list.\n    \"\"\"\n    return sum(num**2 for num in nums)\n", "entry_point": "sum_of_squares", "input": "[7, 5, 4, 2]", "output": "94", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57390_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000991", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57887_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000992", "code": "import re\ndef extract_version_numbers(input_string):\n    version_numbers = re.findall(r'\\b\\d+\\.\\d+\\b', input_string)\n    unique_versions = list(set(version_numbers))\n    return unique_versions\n", "entry_point": "extract_version_numbers", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137730_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000993", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[10, 10, 10, 10, 10]", "output": "[10, 10, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000994", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average", "input": "[80, 90, 92, 92, 95]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143747_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000995", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'the'", "output": "('the', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000996", "code": "import datetime\ndef get_days_in_previous_month(current_date):\n    year, month, _ = map(int, current_date.split('-'))\n    # Calculate the previous month\n    if month == 1:\n        previous_month = 12\n        previous_year = year - 1\n    else:\n        previous_month = month - 1\n        previous_year = year\n    # Calculate the number of days in the previous month\n    if previous_month in [1, 3, 5, 7, 8, 10, 12]:\n        days_in_previous_month = 31\n    elif previous_month == 2:\n        if previous_year % 4 == 0 and (previous_year % 100 != 0 or previous_year % 400 == 0):\n            days_in_previous_month = 29\n        else:\n            days_in_previous_month = 28\n    else:\n        days_in_previous_month = 30\n    return days_in_previous_month\n", "entry_point": "get_days_in_previous_month", "input": "'2021-03-01'", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21493_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000997", "code": "def process_volumes(volumes):\n    volume_dict = {}\n    for volume in volumes:\n        if volume.get('name'):\n            volume_dict[volume['id']] = volume['name']\n    return volume_dict\n", "entry_point": "process_volumes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71866_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8185", "output": "{1, 5, 1637, 8185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0000999", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8958", "output": "{1, 2, 3, 6, 2986, 1493, 8958, 4479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001000", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'p/houser/app', 'templatlt'", "output": "'p/houser/app/templatlt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001001", "code": "def max_consecutive_wins(scores):\n    if not scores:\n        return 0\n    current_streak = 0\n    max_streak = 0\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            current_streak += 1\n        else:\n            current_streak = 1\n        max_streak = max(max_streak, current_streak)\n    return max_streak\n", "entry_point": "max_consecutive_wins", "input": "[1, 2, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108217_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001002", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'tsam'", "output": "{'tsam': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15367_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001003", "code": "def sum_even_numbers(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[32]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36913_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001004", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[51, 11, 34], 50", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001005", "code": "def extract_package_metadata(metadata_str):\n    metadata_dict = {}\n    lines = metadata_str.split('\\\\n')\n    for line in lines:\n        if '__author__' in line:\n            metadata_dict['author'] = line.split('=')[1].strip().strip('\"\"\"')\n        elif '__email__' in line:\n            metadata_dict['email'] = line.split('=')[1].strip().strip('\"\"\"')\n        elif '__version__' in line:\n            metadata_dict['version'] = line.split('=')[1].strip().strip('\"\"\"')\n    return metadata_dict\n", "entry_point": "extract_package_metadata", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132199_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001006", "code": "def text_pair_classification(text1, text2):\n    text1 = text1.lower()\n    text2 = text2.lower()\n    words1 = set(text1.split())\n    words2 = set(text2.split())\n    common_words = words1.intersection(words2)\n    if common_words:\n        return \"Similar\"\n    elif not common_words and len(words1) == len(words2):\n        return \"Neutral\"\n    else:\n        return \"Different\"\n", "entry_point": "text_pair_classification", "input": "'apple orange', 'banana grape'", "output": "'Neutral'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16018_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001007", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "120.5, 15, 10", "output": "151", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001008", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average", "input": "[80, 85, 87, 91, 99]", "output": "87.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61371_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001009", "code": "from typing import List\ndef is_gray_code_sequence(nums: List[int]) -> bool:\n    is_gray_code = True\n    for i in range(1, len(nums)):\n        xor_result = nums[i-1] ^ nums[i]\n        if xor_result & (xor_result - 1) != 0:\n            is_gray_code = False\n            break\n    return is_gray_code\n", "entry_point": "is_gray_code_sequence", "input": "[1, 3, 4]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001010", "code": "def get_message_format(recipient):\n    message_formats = {\n        \"Alice\": \"Hello, Alice! How are you today?\",\n        \"Bob\": \"Hey Bob! What's up?\",\n        \"Charlie\": \"Charlie, you're awesome!\"\n    }\n    if recipient in message_formats:\n        return message_formats[recipient]\n    else:\n        return \"Sorry, I can't send a message to that recipient.\"\n", "entry_point": "get_message_format", "input": "'Bob'", "output": "\"Hey Bob! What's up?\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45309_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001011", "code": "def parse_package_config(config_str: str) -> dict:\n    metadata = {}\n    lines = config_str.split('\\n')\n    for line in lines:\n        if line.startswith(\"__\"):\n            key, value = line.strip().split(\" = \")\n            metadata[key[2:-1]] = value.strip('\"')\n        elif line.startswith(\"requires\") or line.startswith(\"tests_require\"):\n            key, values = line.split(\" = \")\n            metadata[key] = [pkg.strip().strip('\"') for pkg in values.strip()[1:-2].split(\",\")]\n    return metadata\n", "entry_point": "parse_package_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52550_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001012", "code": "def find_floor_position(parentheses: str) -> int:\n    floor = 0\n    position = 0\n    for char in parentheses:\n        position += 1\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        if floor == -1:\n            return position\n    return -1\n", "entry_point": "find_floor_position", "input": "'((('", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95034_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001013", "code": "import logging\ndef analyze_logging_config(logger_name):\n    logger = logging.getLogger(logger_name)\n    log_level = logging.getLevelName(logger.level)\n    handlers_info = []\n    for handler in logger.handlers:\n        handler_info = {\n            'name': handler.get_name(),\n            'level': logging.getLevelName(handler.level),\n            'formatter': handler.formatter._fmt if handler.formatter else None\n        }\n        handlers_info.append(handler_info)\n    return {\n        'log_level': log_level,\n        'handlers': handlers_info\n    }\n", "entry_point": "analyze_logging_config", "input": "'my_logger'", "output": "{'log_level': 'NOTSET', 'handlers': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95454_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001014", "code": "def find_average_patterns(lst):\n    pattern_count = 0\n    for i in range(1, len(lst) - 1):\n        if lst[i] * 2 == lst[i-1] + lst[i+1]:\n            pattern_count += 1\n    return pattern_count\n", "entry_point": "find_average_patterns", "input": "[1, 2, 4]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88691_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001015", "code": "def extract_ids(code_snippet):\n    id_dict = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if '=' in line:\n            parts = line.split('=')\n            if len(parts) == 2:\n                id_name = parts[0].strip().replace('ID_', '')\n                id_value = int(parts[1].strip())\n                id_dict[id_name] = id_value\n    return id_dict\n", "entry_point": "extract_ids", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29792_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001016", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "7", "output": "'Uranus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001017", "code": "def process_categories(categories):\n    total_added = 0\n    for name, class_code in categories:\n        category = {'name': name, 'class_code': class_code}\n        try:\n            # Simulate adding the category by printing a message\n            print(f\"Adding category: {category['name']} with class code {category['class_code']}\")\n            total_added += 1\n        except Exception as e:\n            print(f\"Error adding category '{name}': {e}\")\n    return total_added\n", "entry_point": "process_categories", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60236_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001018", "code": "def process_transaction(transaction, code):\n    address = transaction.get('address')\n    txid = transaction.get('txId')\n    fee = None\n    feeCost = transaction.get('fee')\n    if feeCost is not None:\n        fee = {\n            'cost': feeCost,\n            'currency': code,\n        }\n    transaction_type = 'withdrawal' if ('success' in transaction) or ('address' in transaction) else 'deposit'\n    tag = transaction.get('paymentId')\n    return {\n        'type': transaction_type,\n        'fee': fee,\n        'tag': tag\n    }\n", "entry_point": "process_transaction", "input": "{}, 'USD'", "output": "{'type': 'deposit', 'fee': None, 'tag': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001019", "code": "def game_winner(n):\n    if n % 2 == 0:\n        check = 0\n        while n % 2 == 0:\n            n = n // 2\n            check += 1\n        if n <= 1:\n            if check % 2:\n                return \"Alice\"\n            else:\n                return \"Bob\"\n        else:\n            return \"Alice\"\n    else:\n        return \"Bob\"\n", "entry_point": "game_winner", "input": "2", "output": "'Alice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127442_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001020", "code": "def extract_view_names(url_patterns):\n    view_names = {}\n    for pattern in url_patterns:\n        view_name_start = pattern.find('.as_view()') + len('.as_view()')\n        view_name_end = pattern.find(',', view_name_start)\n        view_name = pattern[view_name_start:view_name_end].strip()\n        url_name_start = pattern.find(\"name='\") + len(\"name='\")\n        url_name_end = pattern.find(\"'\", url_name_start)\n        url_name = pattern[url_name_start:url_name_end]\n        view_names[url_name] = view_name\n    return view_names\n", "entry_point": "extract_view_names", "input": "[\"urlpatterns = [path('', SomeView.as_view(), name='')]\"]", "output": "{'': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9979_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001021", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "5.28", "output": "5280000000000000248", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001022", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[1, 4, 0, 4, 3, 4, 1, 3]", "output": "[2, 5, 1, 5, 4, 5, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001023", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "17", "output": "17.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001024", "code": "def ferret_custom_axes(efid):\n    # Implement custom axes logic based on the given efid\n    if efid == 1:\n        # Define custom axes information for efid = 1\n        axis_info = (\n            (0.0, 10.0, 1.0, 'X-axis', False),\n            (20.0, 50.0, 5.0, 'Y-axis', False),\n            (100.0, 200.0, 20.0, 'Z-axis', True),\n            (None, None, None, None, None),  # Non-custom axis\n            (None, None, None, None, None),  # Non-custom axis\n            (None, None, None, None, None)   # Non-custom axis\n        )\n    elif efid == 2:\n        # Define custom axes information for efid = 2\n        axis_info = (\n            (5.0, 15.0, 1.0, 'X-axis', False),\n            (30.0, 60.0, 5.0, 'Y-axis', False),\n            (150.0, 250.0, 25.0, 'Z-axis', True),\n            (None, None, None, None, None),  # Non-custom axis\n            (None, None, None, None, None),  # Non-custom axis\n            (None, None, None, None, None)   # Non-custom axis\n        )\n    else:\n        # Default case for non-matching efid\n        axis_info = (None, None, None, None, None, None)\n    return axis_info\n", "entry_point": "ferret_custom_axes", "input": "0", "output": "(None, None, None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42994_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001025", "code": "def count_pairs_sum_to_target(nums, target):\n    seen = {}\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen and seen[complement] > 0:\n            count += 1\n            seen[complement] -= 1\n        else:\n            seen[num] = seen.get(num, 0) + 1\n    return count\n", "entry_point": "count_pairs_sum_to_target", "input": "[2, 4], 6", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76386_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001026", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'test_logger', 16", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1834", "output": "{1, 2, 131, 262, 7, 1834, 14, 917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5753", "output": "{11, 1, 5753, 523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3857", "output": "{1, 133, 551, 7, 203, 3857, 19, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7921", "output": "{89, 1, 7921}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7920", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001031", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106132_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001032", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5551", "output": "{1, 7, 427, 13, 5551, 793, 91, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2395", "output": "{1, 2395, 5, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001034", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 92, 88, 85, 88, 75, 100, 92]", "output": "[100, 92, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001035", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[400, 601], 0", "output": "1001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5864", "output": "{1, 2, 4, 5864, 8, 2932, 1466, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5863", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001037", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8915", "output": "{1, 8915, 5, 1783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8914", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001038", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 7, 7, 0]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001039", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'abc732225553def731ghi'", "output": "{732225553, 731}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001040", "code": "def sum_divisible_by_3_and_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71195_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001041", "code": "def accum(s):\n    modified_chars = []\n    for i, char in enumerate(s):\n        modified_chars.append((char.upper() + char.lower() * i))\n    return '-'.join(modified_chars)\n", "entry_point": "accum", "input": "'MNU'", "output": "'M-Nn-Uuu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97323_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001042", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[5, 10, 30, 16, 15, 15, 18, 18]", "output": "[5, 10, 30, 16, 15, 15, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001043", "code": "import re\ndef extract_package_info(code):\n    pattern = r'name=\"(.*?)\".*?version=\\'(.*?)\\'.*?url=\"(.*?)\".*?author=\"(.*?)\".*?author_email=\"(.*?)\".*?license=\"(.*?)\"'\n    match = re.search(pattern, code, re.DOTALL)\n    if match:\n        name, version, url, author, author_email, license = match.groups()\n        return f\"Package Name: {name}\\nVersion: {version}\\nURL: {url}\\nAuthor: {author}\\nAuthor Email: {author_email}\\nLicense: {license}\"\n    else:\n        return \"Package information not found.\"\n", "entry_point": "extract_package_info", "input": "''", "output": "'Package information not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33917_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001044", "code": "def find_indices(nums, target):\n    num_indices = {}\n    for index, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], index]\n        num_indices[num] = index\n    return []\n", "entry_point": "find_indices", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23894_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001045", "code": "def rock_paper_scissors_winner(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie\"\n    elif (player1_choice == 'rock' and player2_choice == 'scissors') or \\\n         (player1_choice == 'scissors' and player2_choice == 'paper') or \\\n         (player1_choice == 'paper' and player2_choice == 'rock'):\n        return 'Player 1 wins'\n    else:\n        return 'Player 2 wins'\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'scissors'", "output": "'Player 1 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001046", "code": "def max_non_adjacent_sum(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update the inclusive value for the next iteration\n        exclusive = new_exclusive  # Update the exclusive value for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[5, 10, 15]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145895_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001047", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'50 + 7'", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001048", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'PORT=8080'", "output": "{'PORT': '8080'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001049", "code": "def sum_multiples_of_3_or_5(input_list):\n    multiples_set = set()\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples_set:\n                total_sum += num\n                multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51051_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001050", "code": "def find_expense_product(expenses):\n    for i in range(len(expenses)):\n        for j in range(i+1, len(expenses)):\n            if expenses[i] + expenses[j] == 2020:\n                return expenses[i] * expenses[j]\n", "entry_point": "find_expense_product", "input": "[1010, 1010]", "output": "1020100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44296_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001051", "code": "import os\ndef find_missing_init_py(root_path):\n    missing = []\n    for root, dirnames, filenames in os.walk(root_path):\n        needs_init = any(filename.endswith('.py') for filename in filenames)\n        if needs_init and '__init__.py' not in os.listdir(root):\n            missing.append(os.path.relpath(root, root_path))\n    return missing\n", "entry_point": "find_missing_init_py", "input": "'/path/to/my_test_dir'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134997_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001052", "code": "import os\nSECRET = os.environ.get('SECRET')\ndef is_secret_valid(guess):\n    if SECRET is None:\n        return False\n    try:\n        if guess == SECRET:\n            return True\n        return False\n    except KeyError:\n        return False\n", "entry_point": "is_secret_valid", "input": "'any_guess'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12016_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001053", "code": "import re\ndef username_validation(username):\n    pattern = r\"^[a-zA-Z][a-zA-Z0-9_]{2,22}[a-zA-Z0-9]$\"\n    if re.match(pattern, username):\n        return True\n    return False\n", "entry_point": "username_validation", "input": "'A_user1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44680_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001054", "code": "def count_module_imports(code_snippet):\n    module_counts = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if line.startswith('from ') or line.startswith('import '):\n            words = line.split()\n            module_name = words[1]\n            if '.' in module_name:\n                module_name = module_name.split('.')[0]\n            if module_name in module_counts:\n                module_counts[module_name] += 1\n            else:\n                module_counts[module_name] = 1\n    return module_counts\n", "entry_point": "count_module_imports", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51529_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001055", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "38", "output": "'0000000000000026'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001056", "code": "def find_single_integer(nums):\n    integersDict = {}\n    for num in nums:\n        if num in integersDict:\n            integersDict[num] += 1\n        else:\n            integersDict[num] = 1\n    for integer in integersDict:\n        if integersDict[integer] != 3:\n            return integer\n    return nums[0]\n", "entry_point": "find_single_integer", "input": "[2, 3, 3, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39275_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001057", "code": "def translate_data_type(pandas_type):\n    pandas_datatype_names = {\n        'object': 'string',\n        'int64': 'integer',\n        'float64': 'double',\n        'bool': 'boolean',\n        'datetime64[ns]': 'datetime'\n    }\n    return pandas_datatype_names.get(pandas_type, 'unknown')\n", "entry_point": "translate_data_type", "input": "'unsupported_type'", "output": "'unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9746_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001058", "code": "def count_valid_paths(grid):\n    m, n = len(grid), len(grid[0])\n    dp = [[0] * n for _ in range(m)]\n    dp[0][0] = 1\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 1:\n                dp[i][j] = 0\n            else:\n                if i > 0:\n                    dp[i][j] += dp[i-1][j]\n                if j > 0:\n                    dp[i][j] += dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "count_valid_paths", "input": "[[0, 0], [0, 0]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78779_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001059", "code": "def extract_frame_number(file_path: str) -> int:\n    # Find the last occurrence of a period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring following the last period\n    frame_str = file_path[last_period_index + 1:]\n    # Check if the extracted substring is a valid integer\n    if frame_str.isdigit():\n        frame_number = int(frame_str)\n        return frame_number\n    else:\n        return -1  # Return -1 for invalid frame number\n", "entry_point": "extract_frame_number", "input": "'file_without_extension'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35759_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001060", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[10, 5, 0, 10]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001061", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[6, 6, 6], 0", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001062", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 7]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001063", "code": "import re\nfrom typing import List\ndef extract_urls(text: str) -> List[str]:\n    url_rx = re.compile(r'https?://(?:www\\.)?.+')\n    return url_rx.findall(text)\n", "entry_point": "extract_urls", "input": "'This text does not contain any URLs.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99895_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001064", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[4, 4, 5]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24202_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6585", "output": "{1, 3, 5, 1317, 15, 2195, 439, 6585}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001066", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[4, 2, 2, 3, 6, 2, 5, 2, 5]", "output": "[8, 8, 12, 24, 8, 20, 8, 20, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2185", "output": "{1, 5, 2185, 19, 115, 437, 23, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001068", "code": "from pathlib import Path\ndef read_names_directory(output_directory):\n    names_dict = {}\n    names_directory = Path(output_directory) / \"names\"\n    for file_path in names_directory.glob(\"*.txt\"):\n        id = file_path.stem\n        with open(file_path, \"r\") as file:\n            name = file.read().strip()\n            names_dict[id] = name\n    return names_dict\n", "entry_point": "read_names_directory", "input": "'/path/to/nonexistent/directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138972_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001069", "code": "import os\ndef load_config(config_file, namespace):\n    if os.path.isfile(config_file):\n        print(\"load additional sphinx-config: %s\" % config_file)\n        config = namespace.copy()\n        config['__file__'] = config_file\n        execfile_(config_file, config)  # Assume execfile_ is defined elsewhere\n        del config['__file__']\n        namespace.update(config)\n    else:\n        config = namespace.copy()\n        config['tags'] = set(config.get('tags', []))  # Ensure 'tags' is a set\n        config['tags'].add(\"subproject\")\n        namespace.update(config)\n    return namespace\n", "entry_point": "load_config", "input": "'non_existing_file.conf', {}", "output": "{'tags': {'subproject'}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116396_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001070", "code": "def slice_list(lst, start=None, end=None):\n    if start is not None and end is not None:\n        return lst[start:end]\n    elif start is not None:\n        return lst[start:]\n    elif end is not None:\n        return lst[:end]\n    else:\n        return lst\n", "entry_point": "slice_list", "input": "[0, 10, 20, 30, 40, 50, 60, 70, 80], start=4", "output": "[40, 50, 60, 70, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93892_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001071", "code": "import string\ndef isPalindrome(string):\n    if len(string) <= 1:\n        return True\n    else:\n        return string[0].lower() == string[-1].lower() and isPalindrome(string[1:-1])\n", "entry_point": "isPalindrome", "input": "'level'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101551_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8546", "output": "{1, 8546, 2, 4273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8545", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8169", "output": "{1, 3, 2723, 389, 7, 8169, 1167, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001074", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 75, 80, 76, 74]", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22350_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001075", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8293", "output": "{1, 8293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001076", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[2, 3, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3510_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001077", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[-516], 1", "output": "-516.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001078", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[15, 18, 90]", "output": "[6, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001079", "code": "import re\ndef parse_info(code):\n    info = {}\n    name_match = re.search(r\"name\\s*=\\s*'([^']*)'\", code)\n    if name_match:\n        info['name'] = name_match.group(1)\n    help_match = re.search(r\"help\\s*=\\s*'([^']*)'\", code)\n    if help_match:\n        info['help'] = help_match.group(1)\n    args_match = re.search(r\"args\\s*=\\s*'([^']*)'\", code)\n    if args_match:\n        info['args'] = args_match.group(1)\n    check_apps_dirs_match = re.search(r\"check_apps_dirs\\s*=\\s*(\\w+)\", code)\n    if check_apps_dirs_match:\n        info['check_apps_dirs'] = bool(check_apps_dirs_match.group(1))\n    check_apps_match = re.search(r\"check_apps\\s*=\\s*(\\w+)\", code)\n    if check_apps_match:\n        info['check_apps'] = bool(check_apps_match.group(1))\n    skip_options_match = re.search(r\"skip_options\\s*=\\s*(\\w+)\", code)\n    if skip_options_match:\n        info['skip_options'] = bool(skip_options_match.group(1))\n    return info\n", "entry_point": "parse_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95745_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001080", "code": "def extract_patterns(input_string):\n    patterns = set()\n    current_char = ''\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count >= 3:\n                patterns.add(current_char * char_count)\n            current_char = char\n            char_count = 1\n    if char_count >= 3:\n        patterns.add(current_char * char_count)\n    return list(patterns)\n", "entry_point": "extract_patterns", "input": "'aaa'", "output": "['aaa']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001081", "code": "def count_operation_type(operation_list, operation_type):\n    cktable = {-1: \"NON\", 0: \"KER\", 1: \"H2D\", 2: \"D2H\", 8: \"D2D\", 10: \"P2P\"}\n    count = 0\n    for op in operation_list:\n        if op == operation_type:\n            count += 1\n    return count\n", "entry_point": "count_operation_type", "input": "[1, 1, 3, 4], 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88938_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001082", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6571", "output": "{1, 6571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001083", "code": "from typing import List\ndef sum_double_duplicates(lst: List[int]) -> int:\n    element_freq = {}\n    total_sum = 0\n    # Count the frequency of each element in the list\n    for num in lst:\n        element_freq[num] = element_freq.get(num, 0) + 1\n    # Calculate the sum considering duplicates\n    for num, freq in element_freq.items():\n        if freq > 1:\n            total_sum += num * 2 * freq\n        else:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_double_duplicates", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21856_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3783", "output": "{1, 97, 3, 291, 3783, 39, 13, 1261}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001085", "code": "# Define the dictionary with color names and BGR values\ncolor_dict = {\n    'BLACK': (0, 0, 0),\n    'BLUE': (255, 0, 0),\n    'CHOCOLATE': (30, 105, 210),\n    'CYAN': (255, 255, 0),\n    'GOLDEN': (32, 218, 165),\n    'GRAY': (155, 155, 155),\n    'GREEN': (0, 255, 0),\n    'LIGHT_BLUE': (255, 9, 2),\n    'MAGENTA': (255, 0, 255),\n    'ORANGE': (0, 69, 255),\n    'PURPLE': (128, 0, 128),\n    'PINK': (147, 20, 255),\n    'RED': (0, 0, 255),\n    'WHITE': (255, 255, 255),\n    'YELLOW': (0, 255, 255)\n}\ndef get_bgr(color_name):\n    return color_dict.get(color_name, \"Color not found\")\n", "entry_point": "get_bgr", "input": "'AQUA'", "output": "'Color not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89938_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9515", "output": "{1, 865, 5, 11, 9515, 173, 1903, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001087", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['Doge5', 'Doge5', 'Doge5']", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001088", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'3.1.4'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001089", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6458", "output": "{1, 6458, 2, 3229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6457", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001090", "code": "import re\ndef extract_versions(input_string):\n    versions = set()\n    # Regular expression to match import statements\n    import_pattern = r\"from\\s+(\\S+)\\s+import\"\n    # Find all matches of import statements\n    modules = re.findall(import_pattern, input_string)\n    for module_name in modules:\n        try:\n            module = __import__(module_name)\n            if hasattr(module, '__version__'):\n                versions.add(getattr(module, '__version__'))\n        except (ImportError, AttributeError):\n            pass\n    return list(versions)\n", "entry_point": "extract_versions", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127066_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001091", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[3, 4, 5, 6, 1, 1, 2, 2]", "output": "[3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001092", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[1, -1, -5, 0, 3, -1, -6, -5, 0]", "output": "[-1, 1, 5, 0, -3, 1, 6, 5, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001093", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8495", "output": "{1, 1699, 5, 8495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001094", "code": "def group_instructors_by_category(courses):\n    instructors_by_category = {}\n    for course in courses:\n        instructor = course['instructor']\n        category = course['category']\n        if category in instructors_by_category:\n            instructors_by_category[category].append(instructor)\n        else:\n            instructors_by_category[category] = [instructor]\n    return instructors_by_category\n", "entry_point": "group_instructors_by_category", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103618_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001095", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "131629284070068272207233024, 1", "output": "131629284070068272207233024", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt4532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001096", "code": "def count_unique_pairs(nums, target):\n    unique_pairs = set()\n    seen = set()\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        seen.add(num)\n    return len(unique_pairs)\n", "entry_point": "count_unique_pairs", "input": "[1, 5, 2, 4], 6", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001097", "code": "import ast\ndef extract_parser_names(code_snippet):\n    parser_names = []\n    # Parse the code snippet as an Abstract Syntax Tree (AST)\n    tree = ast.parse(code_snippet)\n    # Traverse the AST to find the import statement for the specified module\n    for node in ast.walk(tree):\n        if isinstance(node, ast.ImportFrom) and node.module == 'mi.dataset.parser.dosta_abcdjm_dcl':\n            # Extract the names of the imported parsers\n            for alias in node.names:\n                parser_names.append(alias.name)\n    return parser_names\n", "entry_point": "extract_parser_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103131_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001098", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[7, 1, 7, 6, 7]", "output": "[7, 2, 9, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001099", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 15, 20, 24]", "output": "67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136598_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001100", "code": "def count_char_occurrences(input_string, char):\n    count = 0\n    for c in input_string:\n        if c == char:\n            count += 1\n    return count\n", "entry_point": "count_char_occurrences", "input": "'', 'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28889_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001101", "code": "def count_beautiful_triplets(d, arr):\n    beautiful_triplets_count = 0\n    for i in range(len(arr)):\n        if arr[i] + d in arr and arr[i] + 2*d in arr:\n            beautiful_triplets_count += 1\n    return beautiful_triplets_count\n", "entry_point": "count_beautiful_triplets", "input": "1, []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97862_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001102", "code": "user_credentials = {\n    \"alice\": {\"password\": \"12345\", \"role\": \"admin\"},\n    \"bob\": {\"password\": \"password\", \"role\": \"user\"},\n    \"charlie\": {\"password\": \"securepwd\", \"role\": \"user\"}\n}\ndef authenticate_user(username: str, password: str) -> str:\n    if username in user_credentials and user_credentials[username][\"password\"] == password:\n        return user_credentials[username][\"role\"]\n    return \"Unauthorized\"\n", "entry_point": "authenticate_user", "input": "'dave', 'any_password'", "output": "'Unauthorized'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14714_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001103", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[-2, 4, 1, -1, 5, 3, 4]", "output": "[-2, 5, 3, 2, 9, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001104", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "3, 3, 50", "output": "5.555555555555555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8367", "output": "{1, 3, 2789, 8367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001106", "code": "def first_repeating(n, arr):\n    seen = set()\n    for i in range(n):\n        if arr[i] in seen:\n            return arr[i]\n        seen.add(arr[i])\n    return -1\n", "entry_point": "first_repeating", "input": "0, []", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49861_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001107", "code": "LOCALHOST_EQUIVALENTS = frozenset((\n    'localhost',\n    '127.0.0.1',\n    '0.0.0.0',\n    '0:0:0:0:0:0:0:0',\n    '0:0:0:0:0:0:0:1',\n    '::1',\n    '::',\n))\ndef is_localhost(ip_address):\n    return ip_address in LOCALHOST_EQUIVALENTS\n", "entry_point": "is_localhost", "input": "'8.8.8.8'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109309_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001108", "code": "def total_price(products, threshold):\n    total_price = 0\n    for product in products:\n        weight = product.get(\"weight\", 0)\n        if weight is None:\n            weight = 0\n        if weight > threshold:\n            total_price += product[\"price\"]\n    return total_price\n", "entry_point": "total_price", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10471_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001109", "code": "def count_teams_per_department(departmental_teams):\n    department_counts = {}\n    for team in departmental_teams:\n        department_name = team[\"name\"]\n        department_counts[department_name] = department_counts.get(department_name, 0) + 1\n    return department_counts\n", "entry_point": "count_teams_per_department", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112850_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001110", "code": "import importlib\ndef import_modules_from_package_all(package_name):\n    imported_modules = {}\n    try:\n        package = importlib.import_module(package_name)\n        all_modules = getattr(package, '__all__', [])\n        for module_name in all_modules:\n            full_module_path = f\"{package_name}.{module_name}\"\n            imported_module = importlib.import_module(full_module_path)\n            imported_modules[module_name] = imported_module\n    except (ModuleNotFoundError, AttributeError):\n        pass\n    return imported_modules\n", "entry_point": "import_modules_from_package_all", "input": "'non_existent_package'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58934_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001111", "code": "def parse_expression(input_str):\n    def parse_E(index):\n        nonlocal input_str\n        if parse_T(index):\n            while index < len(input_str) and input_str[index] == '+':\n                index += 1\n                if not parse_T(index):\n                    return False\n            return True\n        return False\n    def parse_T(index):\n        nonlocal input_str\n        if parse_F(index):\n            while index < len(input_str) and input_str[index] == '*':\n                index += 1\n                if not parse_F(index):\n                    return False\n            return True\n        return False\n    def parse_F(index):\n        nonlocal input_str\n        if index < len(input_str) and input_str[index] == '(':\n            index += 1\n            if parse_E(index) and index < len(input_str) and input_str[index] == ')':\n                return True\n        elif index < len(input_str) and input_str[index] == 'id':\n            return True\n        return False\n    return parse_E(0) and len(input_str) == 0\n", "entry_point": "parse_expression", "input": "''", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143129_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001112", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 9, 10]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6779_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001113", "code": "def generate_fibonacci_numbers(limit):\n    fibonacci_numbers = [0, 1]\n    prev, current = 0, 1\n    while prev + current <= limit:\n        next_fibonacci = prev + current\n        fibonacci_numbers.append(next_fibonacci)\n        prev, current = current, next_fibonacci\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci_numbers", "input": "13", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91390_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9445", "output": "{1, 5, 9445, 1889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001115", "code": "import re\ndef extract_message_id(fbl_report: str) -> str:\n    yandex_pattern = r'\\[(.*?)\\]'  # Pattern to match Yandex FBL message ID\n    gmail_pattern = r'\\{(.*?)\\}'   # Pattern to match Gmail FBL message ID\n    yandex_match = re.search(yandex_pattern, fbl_report)\n    gmail_match = re.search(gmail_pattern, fbl_report)\n    if yandex_match:\n        return yandex_match.group(1)\n    elif gmail_match:\n        return gmail_match.group(1)\n    else:\n        return \"Message ID not found\"\n", "entry_point": "extract_message_id", "input": "'No message ID here'", "output": "'Message ID not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29165_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001116", "code": "# Define the function to check if a URL is in the list\ndef check_url_in_list(url):\n    local_urls = ['abc.com', 'example.com']  # List of URLs to be monitored (local scope)\n    return url in local_urls\n", "entry_point": "check_url_in_list", "input": "'nonexistent.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120185_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001117", "code": "def generate_rule_dict(rules):\n    combined_dict = {}\n    for rule in rules:\n        for rule_name, rule_dict in rule.items():\n            combined_dict[rule_name] = rule_dict\n    return combined_dict\n", "entry_point": "generate_rule_dict", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35098_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001118", "code": "def calculate_data_size(data_dir, batch_size, num_workers):\n    # Number of images in train and valid directories (example values)\n    num_train_images = 1000\n    num_valid_images = 500\n    # Calculate total data size for training and validation sets\n    total_data_size_train = num_train_images * batch_size\n    total_data_size_valid = num_valid_images * batch_size\n    # Adjust data size based on the number of workers\n    total_data_size_train *= (1 + (num_workers - 1) * 0.1)\n    total_data_size_valid *= (1 + (num_workers - 1) * 0.1)\n    return total_data_size_train, total_data_size_valid\n", "entry_point": "calculate_data_size", "input": "'path/to/data', 54, 5", "output": "(75600.0, 37800.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75732_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001119", "code": "def calculate_total_area(blocks_data):\n    total_area = 0\n    for block, (width, height) in blocks_data.items():\n        total_area += width * height\n    return total_area\n", "entry_point": "calculate_total_area", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121885_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001120", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "86", "output": "0.4777777777777778", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001121", "code": "def password_strength_checker(password):\n    score = 0\n    # Check length of the password\n    score += len(password)\n    # Check for uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for special characters\n    special_characters = set('!@#$%^&*()_+-=[]{}|;:,.<>?')\n    if any(char in special_characters for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'Abcdefgh'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26515_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001122", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'(srsolr'", "output": "'\\\\(srsolr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001123", "code": "def max_non_adjacent_sum(lst):\n    if not lst:\n        return 0\n    include = lst[0]\n    exclude = 0\n    for i in range(1, len(lst)):\n        new_include = exclude + lst[i]\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[10, 7, 5, 11, 13]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73038_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001124", "code": "def is_query_complete(query: str) -> bool:\n    \"\"\"\n    Returns indication as to if query includes a q=, cb.q=, or cb.fq\n    :param query: the query string to be checked\n    :return: True if this looks like a CBR query\n    \"\"\"\n    # Check for raw query captured from the browser\n    if query.startswith(\"cb.urlver=\"):\n        return True\n    # Check for simpler versions\n    if query.startswith(\"q=\") or query.startswith(\"cb.q=\") or query.startswith(\"cb.fq=\"):\n        return True\n    return False\n", "entry_point": "is_query_complete", "input": "'foo=bar'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98705_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001125", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[4, 4, 4, 3, 2]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001126", "code": "__authentication_methods__ = [\"method1\", \"method2\", \"method3\"]\n__supported_tokens__ = [\"token_type1\", \"token_type2\", \"token_type3\"]\ndef should_revoke_token(client_token: str, client_authentication_method: str) -> bool:\n    if client_authentication_method not in __authentication_methods__:\n        return True\n    elif client_token.startswith(\"invalid_\"):\n        return True\n    elif client_token.split(\"_\")[0] not in __supported_tokens__:\n        return True\n    else:\n        return False\n", "entry_point": "should_revoke_token", "input": "'valid_token', 'method4'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17220_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001127", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0  # Return 0 if the list of scores is empty\n    total_score = sum(scores)\n    num_scores = len(scores)\n    if num_scores == 0:\n        return 0  # Return 0 if there are no scores in the list\n    average_score = total_score / num_scores\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[87, 87, 87, 87, 87, 87, 87, 87, 88]", "output": "87.11111111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84021_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001128", "code": "def authenticate_user(username, password):\n    valid_username = 'admin'\n    valid_password = 'password123'\n    if username == valid_username and password == valid_password:\n        return 'Authentication successful!'\n    else:\n        return 'Invalid username and password pair.'\n", "entry_point": "authenticate_user", "input": "'user', 'pass'", "output": "'Invalid username and password pair.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6081_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001129", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[5, 5]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001130", "code": "import json\ndef process_post_request(request_body: str) -> str:\n    try:\n        post_data = json.loads(request_body)\n    except json.JSONDecodeError:\n        return 'Invalid Request'\n    if 'status' not in post_data:\n        return 'Invalid Request'\n    status = post_data['status']\n    if not isinstance(status, int):\n        return 'Invalid Status'\n    if status == 200:\n        return 'Status OK'\n    elif status == 404:\n        return 'Status Not Found'\n    else:\n        return 'Unknown Status'\n", "entry_point": "process_post_request", "input": "'not a json'", "output": "'Invalid Request'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39582_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001131", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[25]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001132", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[10, 5, 15, 4, 12]", "output": "[0, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001133", "code": "import collections\npossible_show = {\n    'available': None,\n    'chat': 'chat',\n    'away': 'away',\n    'afk': 'away',\n    'dnd': 'dnd',\n    'busy': 'dnd',\n    'xa': 'xa'\n}\ndef process_status_message(status_message):\n    status, _, message = status_message.partition(':')\n    show = possible_show.get(status, 'available')\n    processed_message = message.strip() if message else ''\n    return show, processed_message\n", "entry_point": "process_status_message", "input": "'unknown_status:'", "output": "('available', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35967_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001134", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[30, 30, 30, 23]", "output": "28.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001135", "code": "def generate_pairs(input_list):\n    pairs = []\n    for i in range(len(input_list) - 1):\n        pairs.append((input_list[i], input_list[i + 1]))\n    return pairs\n", "entry_point": "generate_pairs", "input": "[2, 4, 2, 2]", "output": "[(2, 4), (4, 2), (2, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120584_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001136", "code": "def evaluate_expression(expression):\n    return eval(expression)\n", "entry_point": "evaluate_expression", "input": "'1 + 1'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69875_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001137", "code": "def sum_of_even_numbers(input_list):\n    even_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_even_numbers", "input": "[12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6110_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001138", "code": "def passes_blacklist(sql: str) -> bool:\n    forbidden_keywords = {'delete', 'drop'}\n    sql_lower = sql.lower()\n    for keyword in forbidden_keywords:\n        if keyword in sql_lower:\n            return False\n    return True\n", "entry_point": "passes_blacklist", "input": "'SELECT * FROM users;'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86148_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001139", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 1:\n        return 0\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    return adjusted_sum / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[70, 80, 90, 80]", "output": "83.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90214_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "253", "output": "{1, 11, 253, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt252", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4949", "output": "{1, 707, 101, 7, 49, 4949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001142", "code": "def cleanup_query_string(url):\n    base_url, query_string = url.split('?') if '?' in url else (url, '')\n    if '#' in query_string:\n        query_string = query_string[:query_string.index('#')]\n    if query_string.endswith('?') and len(query_string) == 1:\n        query_string = ''\n    cleaned_url = base_url + ('?' + query_string if query_string else '')\n    return cleaned_url\n", "entry_point": "cleanup_query_string", "input": "'.ht//h#hch.hh'", "output": "'.ht//h#hch.hh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64096_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001143", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[100, 90, 90, 80, 70]", "output": "[1, 2, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001144", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'Woror!ld'", "output": "b'Woror!ld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001145", "code": "ALLOWED_EXTENSIONS = ['png', 'apng', 'jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'gif', 'svg', 'bmp', 'ico', 'cur']\ndef is_allowed_extension(filename):\n    # Extract the file extension from the filename\n    file_extension = filename.split('.')[-1].lower()\n    # Check if the file extension is in the list of allowed extensions\n    if file_extension in ALLOWED_EXTENSIONS:\n        return True\n    else:\n        return False\n", "entry_point": "is_allowed_extension", "input": "'example.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56793_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001146", "code": "def max_non_adjacent_sum(nums):\n    if not nums:\n        return 0\n    inclusive = nums[0]\n    exclusive = 0\n    for i in range(1, len(nums)):\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive sum\n        inclusive = exclusive + nums[i]  # Update inclusive sum for the next iteration\n        exclusive = new_exclusive  # Update exclusive sum for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[15, 10, 5, 8]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91455_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001147", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[14]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001148", "code": "def total_characters(lst):\n    total_count = 0\n    for item in lst:\n        if isinstance(item, str):\n            total_count += len(item)\n        elif isinstance(item, list):\n            total_count += total_characters(item)\n    return total_count\n", "entry_point": "total_characters", "input": "['Apple', 'Banana']", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59415_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001149", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[3, 3, 2]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001150", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[6, 7, 7, 10]", "output": "7.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001151", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'valid'", "output": "'valid'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1422", "output": "{1, 2, 3, 6, 711, 9, 237, 1422, 79, 18, 474, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001153", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 10.5, 1.0", "output": "11.55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001154", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "8", "output": "'Invalid Resistance Range'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001155", "code": "from typing import List\ndef search(arr: List[int], n: int, target: int) -> int:\n    low, high = 0, n - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "search", "input": "[1, 2, 3], 3, 0", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108018_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001156", "code": "def generate_unique_substrings(input_str):\n    substrings = set()\n    n = len(input_str)\n    for i in range(n):\n        for j in range(i + 1, n + 1):\n            substrings.add(input_str[i:j])\n    return sorted(list(substrings))\n", "entry_point": "generate_unique_substrings", "input": "'abc'", "output": "['a', 'ab', 'abc', 'b', 'bc', 'c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67099_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001157", "code": "import math\ndef adjust_to_tick(value, tick):\n    remainder = value % tick\n    adjusted_value = value - remainder\n    return adjusted_value\n", "entry_point": "adjust_to_tick", "input": "9.5, 1.0", "output": "9.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4653_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1096", "output": "{1, 2, 548, 4, 1096, 8, 137, 274}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1095", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001159", "code": "import math\ndef my_CribleEratosthene(n):\n    is_prime = [True] * (n+1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n+1, i):\n                is_prime[j] = False\n    primes = [num for num in range(2, n+1) if is_prime[num]]\n    return primes\n", "entry_point": "my_CribleEratosthene", "input": "19", "output": "[2, 3, 5, 7, 11, 13, 17, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55274_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001160", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'abcanataaternal/xaz'", "output": "'abcanataaternal/xaz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001161", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'heolhellolo'", "output": "'heolhellolo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4595", "output": "{1, 4595, 5, 919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001163", "code": "import sys\nimport xml.etree.ElementTree as ET\nimport json\nPY2 = sys.version_info[0] == 2\nPY3 = sys.version_info[0] == 3\nif PY2:\n    from StringIO import StringIO\n    from urllib2 import urlopen\n    from urllib2 import HTTPError\nelif PY3:\n    from io import StringIO\n    from urllib.request import urlopen\n    from urllib.error import HTTPError\ndef convert_data(url, output_format):\n    try:\n        response = urlopen(url)\n        data = response.read().decode('utf-8')\n        if output_format == 'xml':\n            root = ET.fromstring(data)\n            return ET.tostring(root, encoding='utf-8').decode('utf-8')\n        elif output_format == 'json':\n            return json.dumps(json.loads(data), indent=4)\n        else:\n            return \"Invalid output format. Please choose 'xml' or 'json'.\"\n    except HTTPError as e:\n        return f\"HTTP Error: {e.code}\"\n    except Exception as e:\n        return f\"An error occurred: {str(e)}\"\n", "entry_point": "convert_data", "input": "'https/ia', 'json'", "output": "\"An error occurred: unknown url type: 'https/ia'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108391_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001164", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 5, 3, 3]", "output": "[1, 6, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001165", "code": "def sum_of_digit_squares(n):\n    sum_squares = 0\n    for digit in str(n):\n        digit_int = int(digit)\n        sum_squares += digit_int ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "3", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28638_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001166", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3152", "output": "{1, 2, 4, 197, 1576, 8, 394, 3152, 16, 788}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3151", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001167", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "153423647", "output": "746324351", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001168", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "-1, 1, 10", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001169", "code": "def rusher_wpbf(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "rusher_wpbf", "input": "[5, 5, 4, 1, 3, 4, 3, 3, 5]", "output": "[10, 9, 5, 4, 7, 7, 6, 8, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138675_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "762", "output": "{1, 2, 3, 6, 762, 381, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001171", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/home/ume/ts', 'exaexamxt'", "output": "'/home/ume/ts/exaexamxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8392", "output": "{1, 2, 4196, 4, 8392, 8, 2098, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8391", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001173", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4325", "output": "{1, 865, 5, 4325, 173, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4324", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001174", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'Test string 3'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001175", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]", "output": "[1, 1, 1, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001176", "code": "def replace_last_occurrence(path, to_replace, replacement):\n    # Find the index of the last occurrence of 'to_replace' in 'path'\n    last_index = path.rfind(to_replace)\n    if last_index == -1:\n        return path  # If 'to_replace' not found, return the original path\n    # Split the path into two parts based on the last occurrence of 'to_replace'\n    path_before = path[:last_index]\n    path_after = path[last_index + len(to_replace):]\n    # Replace the last occurrence of 'to_replace' with 'replacement'\n    modified_path = path_before + replacement + path_after\n    return modified_path\n", "entry_point": "replace_last_occurrence", "input": "'/s//f/hoht/', '/', ''", "output": "'/s//f/hoht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140432_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001177", "code": "def repeat_elements(lst):\n    repeated_list = []\n    for index, value in enumerate(lst):\n        repeated_list.extend([value] * (index + 1))\n    return repeated_list\n", "entry_point": "repeat_elements", "input": "[2, 3, 1]", "output": "[2, 3, 3, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75218_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001178", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[9, 9, 11, 1]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001179", "code": "def calculate_factorial(n):\n    if n < 0:\n        return 0\n    factorial = 1\n    for i in range(1, n + 1):\n        factorial *= i\n    return factorial\n", "entry_point": "calculate_factorial", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130862_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001180", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_number = 0\n    for num in nums:\n        single_number ^= num\n    return single_number\n", "entry_point": "find_single_number", "input": "[1, 2, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48428_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001181", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[60, 70, 75, 80, 90]", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118381_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001182", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(len(lst) - 1):\n        total_diff += abs(lst[i] - lst[i + 1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132641_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001183", "code": "# Predefined DNS mapping\ndns_mapping = {\n    \"www.example.com\": \"192.168.1.1\",\n    \"mail.example.com\": \"192.168.1.2\",\n    \"ftp.example.com\": \"192.168.1.3\"\n}\ndef resolve_dns(query_domain):\n    if query_domain in dns_mapping:\n        return dns_mapping[query_domain]\n    else:\n        return \"Domain not found\"\n", "entry_point": "resolve_dns", "input": "'notfound.example.com'", "output": "'Domain not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141450_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001184", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[100, 99, 50, 1, 2]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001185", "code": "def calculate_moving_average(numbers, window_size):\n    moving_averages = []\n    for i in range(len(numbers) - window_size + 1):\n        window_sum = sum(numbers[i:i+window_size])\n        window_avg = window_sum / window_size\n        moving_averages.append(window_avg)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[-77.0, 0.0, 0.0, 0.0, 0.0, 0.0], 1", "output": "[-77.0, 0.0, 0.0, 0.0, 0.0, 0.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85249_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9441", "output": "{1, 9441, 3, 9, 3147, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "55", "output": "{1, 11, 5, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt54", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001188", "code": "import re\ndef extract_unique_css_classes(css_content):\n    css_classes = set()\n    class_pattern = r'\\.([a-zA-Z0-9_-]+)\\s*{'\n    matches = re.findall(class_pattern, css_content)\n    for match in matches:\n        css_classes.add(match)\n    return list(css_classes)\n", "entry_point": "extract_unique_css_classes", "input": "'body { background: red; }'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58215_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001189", "code": "DRIVERS = {\n    \"ads1x1x\": [\"ADS1014\", \"ADS1015\", \"ADS1114\", \"ADS1115\"],\n    \"mcp3x0x\": [\"MCP3002\", \"MCP3004\", \"MCP3008\", \"MCP3204\", \"MCP3208\"],\n    \"mcp4725\": [\"MCP4725\"],\n    \"mcp48XX\": [\"MCP4802\", \"MCP4812\", \"MCP4822\"],\n    \"mcp492X\": [\"MCP4921\", \"MCP4922\"],\n    \"pca9685\": [\"PCA9685\"],\n    \"pcf8591\": [\"PCF8591\"]\n}\ndef get_supported_devices(driver_name):\n    return DRIVERS.get(driver_name, [])\n", "entry_point": "get_supported_devices", "input": "'invalid_driver'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1337_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8698", "output": "{1, 8698, 2, 4349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8697", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1465", "output": "{293, 1, 1465, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3961", "output": "{1, 233, 3961, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001193", "code": "def validate_math_expression(expression):\n    stack = []\n    operators = set(['+', '-', '*', '/'])\n    for char in expression:\n        if char == '(':\n            stack.append(char)\n        elif char == ')':\n            if not stack or stack[-1] != '(':\n                return False\n            stack.pop()\n        elif char in operators:\n            if not stack or stack[-1] in operators:\n                return False\n    return len(stack) == 0\n", "entry_point": "validate_math_expression", "input": "'(1 + 2'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43362_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001194", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "8", "output": "[(1, 8), (2, 4), (4, 2), (8, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4133", "output": "{1, 4133}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001196", "code": "import os\ndef get_all_file(path):\n    # Check if the path exists and is a directory\n    if os.path.exists(path) and os.path.isdir(path):\n        # Get a list of all files in the specified directory\n        files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]\n        return files\n    else:\n        print(\"Invalid path or path does not exist.\")\n        return []\n", "entry_point": "get_all_file", "input": "'/invalid/path'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143247_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4459", "output": "{1, 7, 4459, 13, 49, 343, 91, 637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001198", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[3, 2, 3, 2, 3, 2, 2, 0, 3]", "output": "[9, 4, 9, 4, 9, 4, 4, 0, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001199", "code": "def dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        raise ValueError(\"Vectors must be of the same length\")\n    result = 0\n    for i in range(len(vector1)):\n        result += vector1[i] * vector2[i]\n    return result\n", "entry_point": "dot_product", "input": "[1, 2], [-2, -1]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105326_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001200", "code": "def checkGroupedCommand(input_str):\n    commands = input_str.split()\n    grouped_commands = set()\n    current_command = None\n    count = 0\n    for command in commands:\n        if command == current_command:\n            count += 1\n        else:\n            if count > 1:\n                grouped_commands.add(current_command)\n            current_command = command\n            count = 1\n    if count > 1:\n        grouped_commands.add(current_command)\n    return list(grouped_commands)\n", "entry_point": "checkGroupedCommand", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113636_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001201", "code": "ADMIN_THEME = \"admin\"\nDEFAULT_THEME = \"core\"\ndef get_theme(theme_name):\n    if theme_name == ADMIN_THEME:\n        return ADMIN_THEME\n    elif theme_name == DEFAULT_THEME:\n        return DEFAULT_THEME\n    else:\n        return \"Theme not found\"\n", "entry_point": "get_theme", "input": "'user'", "output": "'Theme not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36609_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001202", "code": "def resample_time_series(data, season):\n    def seasons_resampler(months):\n        return [data[i] for i in range(len(data)) if i % 12 in months]\n    if season == \"winter\":\n        return seasons_resampler([11, 0, 1])  # December, January, February\n    elif season == \"spring\":\n        return seasons_resampler([2, 3, 4])  # March, April, May\n    elif season == \"summer\":\n        return seasons_resampler([5, 6, 7])  # June, July, August\n    elif season == \"autumn\":\n        return seasons_resampler([8, 9, 10])  # September, October, November\n    elif season == \"custom\":\n        # Implement custom resampling logic here\n        return None\n    elif season == \"yearly\":\n        return [sum(data[i:i+12]) for i in range(0, len(data), 12)]  # Resample to yearly values\n    else:\n        return \"Invalid season specified\"\n", "entry_point": "resample_time_series", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'fall'", "output": "'Invalid season specified'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58046_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3406", "output": "{1, 2, 131, 262, 1703, 13, 3406, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "68", "output": "{1, 2, 34, 4, 68, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt67", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001205", "code": "import re\nfrom typing import List, Tuple\ndef extract_episodes(html_content: str) -> List[Tuple[int, str]]:\n    episode_pattern = r'<li>Episode (\\d+): (.*?)</li>'\n    episodes = re.findall(episode_pattern, html_content)\n    return [(int(episode[0]), episode[1]) for episode in episodes]\n", "entry_point": "extract_episodes", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34038_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001206", "code": "import os\ndef find_common_parent(path1, path2):\n    dirs1 = path1.split(os.sep)\n    dirs2 = path2.split(os.sep)\n    common_parent = []\n    for dir1, dir2 in zip(dirs1, dirs2):\n        if dir1 == dir2:\n            common_parent.append(dir1)\n        else:\n            break\n    if len(common_parent) > 1:  # At least one common directory found\n        return os.sep.join(common_parent)\n    else:\n        return \"No common parent directory\"\n", "entry_point": "find_common_parent", "input": "'/home/user/docs', '/var/logs'", "output": "'No common parent directory'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131436_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001207", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "11", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001208", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'1100'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001209", "code": "def calculate_product(nums):\n    product = 1\n    for num in nums:\n        if num != 0:\n            product *= num\n    return product\n", "entry_point": "calculate_product", "input": "[10, 48]", "output": "480", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25506_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001210", "code": "from typing import List\nimport itertools\ndef count_combinations(nums: List[int], length: int) -> int:\n    # Generate all combinations of the given length from the input list\n    all_combinations = list(itertools.combinations(nums, length))\n    # Return the total number of unique combinations\n    return len(all_combinations)\n", "entry_point": "count_combinations", "input": "[2], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6198_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001211", "code": "def determine_winner(player1_deck, player2_deck):\n    player1_points = 0\n    player2_points = 0\n    player1_total = sum(player1_deck)\n    player2_total = sum(player2_deck)\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    if player1_points > player2_points:\n        return \"Player 1\"\n    elif player2_points > player1_points:\n        return \"Player 2\"\n    else:\n        if player1_total > player2_total:\n            return \"Player 1\"\n        elif player2_total > player1_total:\n            return \"Player 2\"\n        else:\n            return \"Tie\"\n", "entry_point": "determine_winner", "input": "[1, 2, 3], [2, 3, 4]", "output": "'Player 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50675_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001212", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "261", "output": "{1, 3, 261, 9, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt260", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001213", "code": "def generate_pattern(sequence: str, repetitions: int) -> str:\n    lines = []\n    forward_pattern = sequence\n    reverse_pattern = sequence[::-1]\n    for i in range(repetitions):\n        if i % 2 == 0:\n            lines.append(forward_pattern)\n        else:\n            lines.append(reverse_pattern)\n    return '\\n'.join(lines)\n", "entry_point": "generate_pattern", "input": "'A', 0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81413_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001214", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4610", "output": "{1, 4610, 2, 2305, 5, 10, 461, 922}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4609", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001215", "code": "def run_command_help(command, specified_command=None):\n    valid_commands = ['mycommand', 'yourcommand', 'anothercommand']  # Define valid commands here\n    if specified_command is None:\n        return 0\n    elif specified_command in valid_commands:\n        return 0\n    else:\n        return 1\n", "entry_point": "run_command_help", "input": "'any_command', 'invalidcommand'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56006_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001216", "code": "def shift_string(input_str, shift_value):\n    shift_value = abs(shift_value)\n    if shift_value == 0:\n        return input_str\n    if shift_value > len(input_str):\n        shift_value %= len(input_str)\n    if shift_value < 0:\n        shift_value = len(input_str) + shift_value\n    if shift_value > 0:\n        shifted_str = input_str[-shift_value:] + input_str[:-shift_value]\n    else:\n        shifted_str = input_str[shift_value:] + input_str[:shift_value]\n    return shifted_str\n", "entry_point": "shift_string", "input": "'C', 0", "output": "'C'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14180_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001217", "code": "import ipaddress\ndef is_address_valid(ip_address, allow_private=True):\n    try:\n        ip = ipaddress.ip_address(ip_address)\n        if ip.version == 4 and ip.is_private and not allow_private:\n            raise ValueError(\"Private IPv4 address not allowed\")\n        elif ip.version == 6 and ip.is_private and not allow_private:\n            raise ValueError(\"Private IPv6 address not allowed\")\n        return True\n    except ValueError:\n        raise ValueError(\"Invalid IP address\")\n", "entry_point": "is_address_valid", "input": "'192.168.1.1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125259_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001218", "code": "def lcs_length(x, y):\n    m, n = len(x), len(y)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if x[i - 1] == y[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'abcde', 'ace'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71926_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001219", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9167", "output": "{89, 1, 103, 9167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6190", "output": "{1, 2, 5, 10, 619, 6190, 1238, 3095}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6189", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001221", "code": "def count_added_fields(operations):\n    total_fields = 0\n    for operation in operations:\n        if 'fields' in operation:\n            total_fields += len(operation['fields'])\n    return total_fields\n", "entry_point": "count_added_fields", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001222", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "'SUPPORT_METHOD:'", "output": "{'SUPPORT_METHOD': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001223", "code": "def calculate_tanimoto_similarity(fingerprint_a, fingerprint_b):\n    intersection = set(fingerprint_a) & set(fingerprint_b)\n    union = set(fingerprint_a) | set(fingerprint_b)\n    if len(union) == 0:\n        return 0.0\n    tanimoto_similarity = len(intersection) / len(union)\n    return round(tanimoto_similarity, 2)\n", "entry_point": "calculate_tanimoto_similarity", "input": "[1, 2], [1]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2257_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001224", "code": "def extract_package_info(setup_config):\n    package_name = setup_config.get('name', '')\n    author_names = setup_config.get('author', '').split(', ')\n    required_dependencies = setup_config.get('install_requires', [])\n    return package_name, author_names, required_dependencies\n", "entry_point": "extract_package_info", "input": "{'name': '', 'author': '', 'install_requires': []}", "output": "('', [''], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42507_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001225", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001226", "code": "def maxPower(s):\n    if not s:\n        return 0\n    max_power = 1\n    current_power = 1\n    current_char = s[0]\n    current_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            current_count += 1\n        else:\n            current_char = s[i]\n            current_count = 1\n        max_power = max(max_power, current_count)\n    return max_power\n", "entry_point": "maxPower", "input": "'aab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40173_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001227", "code": "COLOR_RESOLUTIONS = {\n    'THE_1080_P': (1920, 1080),\n    'THE_4_K': (3840, 2160),\n    'THE_12_MP': (4056, 3040)\n}\nGRAY_RESOLUTIONS = {\n    'THE_720_P': (1280, 720),\n    'THE_800_P': (1280, 800),\n    'THE_400_P': (640, 400)\n}\ndef get_resolution_dimensions(resolution_type):\n    if resolution_type in COLOR_RESOLUTIONS:\n        return COLOR_RESOLUTIONS[resolution_type]\n    elif resolution_type in GRAY_RESOLUTIONS:\n        return GRAY_RESOLUTIONS[resolution_type]\n    else:\n        return \"Resolution type not found\"\n", "entry_point": "get_resolution_dimensions", "input": "'NON_EXISTENT_RESOLUTION'", "output": "'Resolution type not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107378_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001228", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'350+7'", "output": "357", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001229", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'a', 'z'", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001230", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 87, 85, 80, 75]", "output": "[92, 87, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001231", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4976", "output": "{1, 2, 4, 8, 622, 4976, 16, 311, 2488, 1244}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4975", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001232", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'333.9.9'", "output": "'334.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001233", "code": "def count_unique_css_properties(css_snippet):\n    css_properties = set()\n    # Split the CSS snippet into lines\n    lines = css_snippet.split('\\n')\n    # Extract CSS properties from each line\n    for line in lines:\n        if ':' in line:\n            property_name = line.split(':')[0].strip()\n            css_properties.add(property_name)\n    # Count the unique CSS properties\n    unique_properties_count = len(css_properties)\n    return unique_properties_count\n", "entry_point": "count_unique_css_properties", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117190_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001234", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "606", "output": "{1, 2, 3, 101, 6, 202, 303, 606}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt605", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001235", "code": "import re\ndef extract_numbers(input_string):\n    # Define the pattern to match numbers enclosed within underscores and dots\n    pattern = re.compile(r\"_([0-9]+)\\.\")\n    # Use re.findall to extract all occurrences of the pattern in the input string\n    extracted_numbers = re.findall(pattern, input_string)\n    # Convert the extracted numbers from strings to integers using list comprehension\n    extracted_integers = [int(num) for num in extracted_numbers]\n    return extracted_integers\n", "entry_point": "extract_numbers", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10395_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001236", "code": "def count_players(scores, target):\n    left, right = 0, len(scores) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if scores[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return len(scores) - left\n", "entry_point": "count_players", "input": "[40, 50, 50, 50, 50, 50, 50, 50, 60, 70], 50", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83762_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001237", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[86, 86, 86]", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81649_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1605", "output": "{1, 321, 3, 5, 1605, 107, 15, 535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001239", "code": "def count_pixels_with_rgb(image, rgb_value):\n    pixel_count = 0\n    for row in image:\n        for pixel in row:\n            if pixel == rgb_value:\n                pixel_count += 1\n    return pixel_count\n", "entry_point": "count_pixels_with_rgb", "input": "[], (255, 255, 255)", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53182_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001240", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9521", "output": "{1, 9521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001241", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7091", "output": "{1, 7091, 1013, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001242", "code": "def check_equally_sampled(time_array):\n    if len(time_array) < 2:\n        return False\n    time_diff = time_array[1] - time_array[0]\n    for i in range(1, len(time_array) - 1):\n        if time_array[i + 1] - time_array[i] != time_diff:\n            return False\n    return True\n", "entry_point": "check_equally_sampled", "input": "[1.0, 2.0, 4.0]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149751_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001243", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001244", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2, 3, 2, 4, 2, 3]", "output": "[4, 5, 5, 6, 6, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001245", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[32, 24, 23, 23, 21, 15, 15, 14, 10], 6", "output": "[32, 24, 23, 23, 21, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001246", "code": "def determine_memory_size(memory_addresses):\n    for address in memory_addresses:\n        if address >= 2**32:\n            return \"using 64 bits\"\n    return \"using 32 bits\"\n", "entry_point": "determine_memory_size", "input": "[0, 1, 2, 3]", "output": "'using 32 bits'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57219_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001247", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9496", "output": "{1, 2, 1187, 4, 2374, 8, 4748, 9496}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9495", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001249", "code": "def access_control_system(message_content, user_id):\n    authorized_users = [123, 456, 789]  # Example authorized user IDs\n    if message_content.startswith(\"!info\"):\n        return \"User is requesting information.\"\n    if message_content.startswith(\"!shutdown\") and user_id in authorized_users:\n        return \"Shutdown command is being executed.\"\n    return \"Unauthorized action or invalid command.\"\n", "entry_point": "access_control_system", "input": "'!unknown', 111", "output": "'Unauthorized action or invalid command.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129653_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001250", "code": "def process_messages(input_str):\n    messages = {'Controller': [], 'Switch': []}\n    for message in input_str.split(','):\n        if message.startswith('C:'):\n            messages['Controller'].append(message[2:])\n        elif message.startswith('S:'):\n            messages['Switch'].append(message[2:])\n    return messages\n", "entry_point": "process_messages", "input": "''", "output": "{'Controller': [], 'Switch': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43777_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001251", "code": "def tennis_set(s1, s2):\n    n1 = min(s1, s2)\n    n2 = max(s1, s2)\n    if n2 == 6:\n        return n1 < 5\n    return n2 == 7 and n1 >= 5 and n1 < n2\n", "entry_point": "tennis_set", "input": "6, 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116363_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001252", "code": "def build_mapping(sign, w):\n    fin_sign = list(sign.values())\n    fin_weig = [int(x) for x in list(w)]\n    sign_neg_index = []\n    try:\n        beg_pos = 0\n        while True:\n            find_pos = fin_sign.index(-1, beg_pos)\n            sign_neg_index.append(find_pos)\n            beg_pos = find_pos + 1\n    except ValueError:\n        pass\n    weight_neg_index = []\n    # Implement the logic to build the mapping from weight to the final negative number here\n    return weight_neg_index\n", "entry_point": "build_mapping", "input": "{'a': 0, 'b': 1, 'c': 2}, '123'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102861_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001253", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "5", "output": "'LIGHTING'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001254", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'abc1234'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001255", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'999 2.71828'", "output": "(2.71828, 999)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2895", "output": "{1, 193, 3, 579, 5, 965, 2895, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001257", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'orange; '", "output": "['orange', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001258", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 2, 3]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001259", "code": "def count_unique_numbers(numbers):\n    num_count = {}\n    # Count occurrences of each number\n    for num in numbers:\n        if num in num_count:\n            num_count[num] += 1\n        else:\n            num_count[num] = 1\n    unique_count = 0\n    # Count unique numbers\n    for num, count in num_count.items():\n        if count == 1:\n            unique_count += 1\n    return unique_count\n", "entry_point": "count_unique_numbers", "input": "[3, 4, 5, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36467_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001260", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[12, 12, 12, 10]", "output": "([12, 12, 12, 10], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001261", "code": "def calculate_total_cost(items_dict):\n    total_cost = 0\n    for item, (price, quantity) in items_dict.items():\n        total_cost += price * quantity\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149087_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001262", "code": "import math\ndef generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n+1, i):\n                is_prime[j] = False\n    primes = [i for i in range(2, n+1) if is_prime[i]]\n    return primes\n", "entry_point": "generate_primes", "input": "29", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6320_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001263", "code": "def extract_domain_name(url):\n    # Remove the protocol part of the URL\n    url = url.split(\"://\")[-1]\n    # Extract the domain name by splitting at the first single forward slash\n    domain_name = url.split(\"/\")[0]\n    return domain_name\n", "entry_point": "extract_domain_name", "input": "'http://wwale'", "output": "'wwale'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96968_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001264", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'The quick brown fox jumps overlazy'", "output": "['overlazy']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001265", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[100, 90, 80, 70], 1", "output": "[100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001266", "code": "def check_test_results(logs: str) -> int:\n    logs = logs.replace(\",\", \"\")  # Remove commas from the logs\n    words = logs.split()  # Split the logs into words\n    terms = ['failed', 'FAILURES']\n    for term in terms:\n        if term in words:\n            return 1  # Exit status 1 if any term is found\n    return 0  # Exit status 0 if none of the terms are found\n", "entry_point": "check_test_results", "input": "'All tests passed'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90182_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001267", "code": "def encrypt(message):\n    encrypted_values = []\n    for char in message:\n        if char.isalpha():\n            position = ord(char.upper()) - ord('A') + 1\n            encrypted_values.append(position * 2)\n    return encrypted_values\n", "entry_point": "encrypt", "input": "'HELLO'", "output": "[16, 10, 24, 24, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40901_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001268", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'hedoing?!llo'", "output": "['hedoing?!llo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001269", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)  # Update exclusive by taking the maximum of previous inclusive and exclusive\n        inclusive = exclusive + num  # Update inclusive by adding the current element to the previous exclusive\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 0, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98262_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001270", "code": "def categorize_value(value):\n    if value < 10:\n        return \"Low\"\n    elif 10 <= value < 20:\n        return \"Medium\"\n    else:\n        return \"High\"\n", "entry_point": "categorize_value", "input": "15", "output": "'Medium'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40001_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001271", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    excluded_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(excluded_scores)\n    average = total / len(excluded_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[68, 70, 72, 74, 76]", "output": "72.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103708_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5249", "output": "{1, 5249, 29, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001273", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'0.2.9'", "output": "'0.3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001274", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "6, 3, 0", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001275", "code": "import re\ndef extract_skills(html_data):\n    skills = {}\n    TREE_RE = re.compile('^<td [^>]*><h[23]><span class=\"mw-headline\" id=\"[^\"]*\">(?:<b>)?([^<]*)(?:</b>)?</span></h[23]>([^<]*)')\n    SKILL_RE = re.compile('(?:</td>)?<td style=\"color: #[0f][0f]0000;[^>]*>([^<>]+)((?:<img[^>]* alt=\"New\" [^>]*>)?)(?:<[^>]+>)*<br />(.*)')\n    skill_matches = TREE_RE.findall(html_data)\n    for skill_match in skill_matches:\n        skill_name = skill_match[0]\n        skill_description = skill_match[1]\n        additional_attributes = SKILL_RE.findall(html_data)\n        skills[skill_name] = {'description': skill_description, 'attributes': additional_attributes}\n    return skills\n", "entry_point": "extract_skills", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94796_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001276", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'UU'", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8807", "output": "{1, 8807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001278", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "987654320, 11", "output": "'00987654320'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001279", "code": "from typing import List, Union, Any\ndef count_unique_integers(input_list: List[Union[int, Any]]) -> int:\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134437_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001280", "code": "from typing import List\ndef remaining_people(line: List[int]) -> int:\n    shortest_height = float('inf')\n    shortest_index = 0\n    for i, height in enumerate(line):\n        if height < shortest_height:\n            shortest_height = height\n            shortest_index = i\n    return len(line[shortest_index:])\n", "entry_point": "remaining_people", "input": "[4, 5, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74868_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001281", "code": "import re\nfrom typing import List, Dict\ndef extract_html_info(line_list: List[str]) -> Dict[str, List[str]]:\n    html_info = {}\n    for line in line_list:\n        match = re.match(r'<(\\w+)(.*?)>', line)\n        if match:\n            tag = match.group(1)\n            attributes = re.findall(r'(\\w+)=\".*?\"', match.group(2))\n            if attributes:\n                html_info[tag] = attributes\n    return html_info\n", "entry_point": "extract_html_info", "input": "['This is a text line.']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104654_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001282", "code": "def validate_id_number(id_number):\n    W = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]\n    id_number_dict = {}\n    id_number_dict['\u6821\u9a8c\u7801'] = 10 if id_number[17] in ['X', 'x'] else int(id_number[17])\n    A = list(map(int, list(id_number[:-1])))\n    id_S = sum([x * y for (x, y) in zip(A, W)])\n    id_N = (12 - id_S % 11) % 11\n    return id_N == id_number_dict['\u6821\u9a8c\u7801']\n", "entry_point": "validate_id_number", "input": "'123456789012345678'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117394_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001283", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'llhheooh'", "output": "b'\\x08\\x00\\x00\\x00llhheooh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001284", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[4, 4, 3, 6, 5, 9]", "output": "[4, 4, 'Fizz', 'Fizz', 'Buzz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001285", "code": "def letter_combinations(digits):\n    if not digits:\n        return []\n    letters = {\"2\": \"abc\", \"3\": \"def\", \"4\": \"ghi\", \"5\": \"jkl\",\n               \"6\": \"mno\", \"7\": \"pqrs\", \"8\": \"tuv\", \"9\": \"wxyz\"}\n    def generate_combinations(current_combination, next_digits):\n        if not next_digits:\n            result.append(current_combination)\n        else:\n            if next_digits[0] in letters:\n                for letter in letters[next_digits[0]]:\n                    generate_combinations(current_combination + letter, next_digits[1:])\n    result = []\n    generate_combinations(\"\", digits)\n    return result\n", "entry_point": "letter_combinations", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123565_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001286", "code": "from typing import List\ndef max_profit(prices: List[int]) -> int:\n    if not prices or len(prices) < 2:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "max_profit", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8890_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001287", "code": "import re\ndef count_unique_licenses(file_content: str) -> int:\n    regex = re.compile(r'// ==BEGIN LICENSE==\\n(.*?)\\n// ==END LICENSE==', re.DOTALL)\n    licenses = set(match.group(1) for match in regex.finditer(file_content))\n    return len(licenses)\n", "entry_point": "count_unique_licenses", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48750_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001288", "code": "import ast\ndef count_imported_functions(code, module_name):\n    tree = ast.parse(code)\n    imports = [node for node in tree.body if isinstance(node, ast.Import) or isinstance(node, ast.ImportFrom)]\n    imported_functions = set()\n    for import_node in imports:\n        for alias in import_node.names:\n            if alias.name == module_name:\n                imported_functions.add(alias.asname if alias.asname else alias.name)\n    return len(imported_functions)\n", "entry_point": "count_imported_functions", "input": "\"print('Hello, World!')\", 'os'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48780_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001289", "code": "import re\ndef extract_encoding(xml_string: str) -> str:\n    xml_detect_re = re.compile(br'^\\s*<\\?xml\\s+(?:[^>]*?encoding=[\"\\']([^\"\\'>]+))?')\n    charset_re = re.compile(r'charset.*?=.*?(?P<charset>[\\w\\-]*)', re.I | re.M | re.S)\n    xml_declaration_match = xml_detect_re.match(xml_string.encode())\n    if xml_declaration_match:\n        encoding_match = charset_re.search(xml_declaration_match.group().decode())\n        if encoding_match:\n            return encoding_match.group('charset')\n    return 'utf-8'\n", "entry_point": "extract_encoding", "input": "''", "output": "'utf-8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29224_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001290", "code": "def perform_operation(op, a, b):\n    if op == \"-\":\n        return a - b\n    if op == \"*\":\n        return a * b\n    if op == \"%\":\n        return a % b\n    if op == \"/\":\n        return int(a / b)\n    if op == \"&\":\n        return a & b\n    if op == \"|\":\n        return a | b\n    if op == \"^\":\n        return a ^ b\n    raise ValueError(\"Unsupported operator\")\n", "entry_point": "perform_operation", "input": "'-', 2, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11513_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001291", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[86, 87, 87]", "output": "87", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103667_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001292", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[3, 3, 3, 3, 1, 1]", "output": "{3: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001293", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "1, -1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001294", "code": "import math\n# Constants\nRDISK = 17  # Encoder disk on the right rear wheel\nCSPD = 1  # Curve speed\nTDIST = 0.3  # Threshold distance for the distance sensor\n# Function to calculate distance traveled by the robot\ndef calculate_distance_traveled(initial_reading, final_reading):\n    # Calculate circumference of the wheel\n    radius = RDISK / (2 * math.pi)\n    circumference = 2 * math.pi * radius\n    # Calculate distance traveled\n    distance = (final_reading - initial_reading) * circumference\n    return distance\n", "entry_point": "calculate_distance_traveled", "input": "0, 52", "output": "884.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111364_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7388", "output": "{1, 2, 4, 3694, 1847, 7388}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7387", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001296", "code": "def extract_blocks(input_string):\n    blocks = []\n    inside_block = False\n    current_block = \"\"\n    for char in input_string:\n        if char == '\"' and not inside_block:\n            inside_block = True\n            current_block = \"\"\n        elif char == '\"' and inside_block:\n            inside_block = False\n            blocks.append(current_block)\n        elif inside_block:\n            current_block += char\n    return blocks\n", "entry_point": "extract_blocks", "input": "'\"\"'", "output": "['']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141650_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001297", "code": "import re\ndef validate_email(email):\n    email_pattern = r\"^[A-Za-z0-9\\.\\+_-]+@[A-Za-z0-9\\.-]+\\.[A-Za-z]*$\"\n    return bool(re.match(email_pattern, email))\n", "entry_point": "validate_email", "input": "'plainaddress'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7228_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001298", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "4.714285714285714, 1", "output": "(4.714285714285714, 4.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001299", "code": "def basic_calculator(num1, num2, operation):\n    if operation == 'add':\n        return num1 + num2\n    elif operation == 'subtract':\n        return num1 - num2\n    elif operation == 'multiply':\n        return num1 * num2\n    elif operation == 'divide':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Error: Division by zero!\"\n    else:\n        return \"Error: Invalid operation specified!\"\n", "entry_point": "basic_calculator", "input": "5, 3, 'modulus'", "output": "'Error: Invalid operation specified!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54628_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001300", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[1, [2, 3]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001301", "code": "from typing import Type, Optional\ndef determine_type(input_value):\n    def is_optional(t: Type) -> bool:\n        return getattr(t, \"__origin__\", None) is Optional\n    def unwrap_optional(t: Type) -> Type:\n        return t.__args__[0]\n    if is_optional(type(input_value)):\n        return f\"Optional[{unwrap_optional(type(input_value)).__name__}]\"\n    return type(input_value).__name__\n", "entry_point": "determine_type", "input": "'example'", "output": "'str'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22148_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4963", "output": "{1, 4963, 709, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001303", "code": "def min_steps_to_reach_farthest_position(positions):\n    if not positions:\n        return 0\n    n = len(positions)\n    if n == 1:\n        return 0\n    farthest = positions[0]\n    max_jump = positions[0]\n    steps = 1\n    for i in range(1, n):\n        if i > farthest:\n            return -1\n        if i > max_jump:\n            max_jump = farthest\n            steps += 1\n        farthest = max(farthest, i + positions[i])\n    return steps\n", "entry_point": "min_steps_to_reach_farthest_position", "input": "[2, 3, 1, 1, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73765_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001304", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[90, 85, 87, 84, 83]", "output": "85.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001305", "code": "import glob\nfrom typing import List\ndef resolve_file_list(files: str) -> List[str]:\n    file_patterns = files.split(',')\n    resolved_files = []\n    for pattern in file_patterns:\n        resolved_files.extend(glob.glob(pattern.strip()))\n    return resolved_files\n", "entry_point": "resolve_file_list", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140567_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001306", "code": "import keyword\ndef count_keywords(text):\n    keyword_counts = {}\n    words = text.split()\n    for word in words:\n        if keyword.iskeyword(word):\n            if word in keyword_counts:\n                keyword_counts[word] += 1\n            else:\n                keyword_counts[word] = 1\n    return keyword_counts\n", "entry_point": "count_keywords", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57689_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001307", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[2, 3, 5, 4]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27734_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001308", "code": "def validate_timestamps(timestamps):\n    for timestamp in timestamps:\n        start_time, end_time = timestamp\n        if start_time < 0 or end_time < 0 or start_time >= end_time:\n            return False\n    return True\n", "entry_point": "validate_timestamps", "input": "[(0, 1), (2, 3), (5, 7)]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52767_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001309", "code": "def string_length_dict(strings):\n    length_dict = {}\n    for string in strings:\n        length = len(string)\n        if length not in length_dict:\n            length_dict[length] = []\n        length_dict[length].append(string)\n    return length_dict\n", "entry_point": "string_length_dict", "input": "['lelephantio', 'lion']", "output": "{11: ['lelephantio'], 4: ['lion']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117243_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001310", "code": "def longest_positive_sequence(lst):\n    max_length = 0\n    current_length = 0\n    for num in lst:\n        if num > 0:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    max_length = max(max_length, current_length)  # Check the last sequence\n    return max_length\n", "entry_point": "longest_positive_sequence", "input": "[0, 1, 2, 3, -1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95331_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001311", "code": "def sum_of_digits(num):\n    sum_digits = 0\n    # Loop to extract digits and sum them up\n    while num > 0:\n        digit = num % 10\n        sum_digits += digit\n        num //= 10\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "12", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55339_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001312", "code": "def calculate_average_cost(plans):\n    total_cost = sum(plan['cost'] for plan in plans)\n    average_cost = total_cost / len(plans) if len(plans) > 0 else 0\n    return round(average_cost, 2)\n", "entry_point": "calculate_average_cost", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87062_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001313", "code": "def sum_of_squares_of_evens(lst):\n    total = 0\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97226_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001314", "code": "import unicodedata\ndef count_unique_chars(input_string):\n    normalized_string = ''.join(c for c in unicodedata.normalize('NFD', input_string.lower()) if unicodedata.category(c) != 'Mn' and c.isalnum())\n    char_count = {}\n    for char in normalized_string:\n        char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'cccaaff1e3'", "output": "{'c': 3, 'a': 2, 'f': 2, '1': 1, 'e': 1, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74363_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001315", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6689", "output": "{1, 6689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001316", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "12, 9", "output": "(20, 23, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001317", "code": "def extract_major_version(version):\n    first_dot_index = version.index('.')\n    major_version = int(version[:first_dot_index])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'1314.0'", "output": "1314", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40723_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001318", "code": "def max_profit(prices):\n    buy1 = buy2 = float('-inf')\n    sell1 = sell2 = 0\n    for price in prices:\n        buy1 = max(buy1, -price)\n        sell1 = max(sell1, buy1 + price)\n        buy2 = max(buy2, sell1 - price)\n        sell2 = max(sell2, buy2 + price)\n    return sell2\n", "entry_point": "max_profit", "input": "[1, 5, 2, 8, 3]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113444_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001319", "code": "def extract_view_urls(urls):\n    view_urls = {}\n    for url_pattern, view_name in urls:\n        view_name = view_name.split('.')[-1]  # Extract the view name from the full path\n        if view_name in view_urls:\n            view_urls[view_name].append(url_pattern)\n        else:\n            view_urls[view_name] = [url_pattern]\n    return view_urls\n", "entry_point": "extract_view_urls", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20327_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001320", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[101, 90, 85, 80, 75, 70]", "output": "[101, 90, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001321", "code": "def check_word(word):\n    letters = [\"a\", \"e\", \"t\", \"o\", \"u\"]\n    if len(word) < 7:\n        return 2\n    if (word[1] in letters) and (word[6] in letters):\n        return 0\n    elif (word[1] in letters) or (word[6] in letters):\n        return 1\n    else:\n        return 2\n", "entry_point": "check_word", "input": "'aexelou'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56928_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001322", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# Hoell'", "output": "'Hoell'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001323", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "5, 8", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001324", "code": "def extract_unique_directories(code_snippet):\n    unique_directories = set()\n    for line in code_snippet.split('\\n'):\n        if '=' in line:\n            path = line.split('=')[-1].strip()\n            directories = [part for part in path.split('/') if part and '.' not in part]\n            directory_path = '/'.join(directories)\n            unique_directories.add(directory_path)\n    return sorted(list(unique_directories))\n", "entry_point": "extract_unique_directories", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28286_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6969", "output": "{1, 3, 69, 101, 303, 2323, 23, 6969}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001326", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + num)\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[6, 1, 7]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74967_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001327", "code": "def sum_of_unique_pairs(nums, target):\n    seen = set()\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            count += 1\n            seen.remove(complement)\n        else:\n            seen.add(num)\n    return count\n", "entry_point": "sum_of_unique_pairs", "input": "[2, 3], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78039_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001328", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    if not input_list:  # Base case: empty list\n        return 0\n    else:\n        return input_list.pop() + custom_sum(input_list)\n", "entry_point": "custom_sum", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145591_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001329", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "29", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001330", "code": "import math\n# Constants\nRDISK = 17  # Encoder disk on the right rear wheel\nCSPD = 1  # Curve speed\nTDIST = 0.3  # Threshold distance for the distance sensor\n# Function to calculate distance traveled by the robot\ndef calculate_distance_traveled(initial_reading, final_reading):\n    # Calculate circumference of the wheel\n    radius = RDISK / (2 * math.pi)\n    circumference = 2 * math.pi * radius\n    # Calculate distance traveled\n    distance = (final_reading - initial_reading) * circumference\n    return distance\n", "entry_point": "calculate_distance_traveled", "input": "0, 50", "output": "850.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111364_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001331", "code": "def has_cycle(graph):\n    def DFS(u):\n        visited[u] = True\n        checkedLoop[u] = True\n        for x in graph[u]:\n            if checkedLoop[x]:\n                return True\n            if not visited[x]:\n                if DFS(x):\n                    return True\n        checkedLoop[u] = False\n        return False\n    visited = [False] * len(graph)\n    checkedLoop = [False] * len(graph)\n    for node in range(len(graph)):\n        if not visited[node]:\n            if DFS(node):\n                return True\n    return False\n", "entry_point": "has_cycle", "input": "[[], [], []]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101169_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "490", "output": "{1, 2, 98, 35, 5, 70, 7, 490, 10, 14, 49, 245}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt489", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001333", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    split_index = default_app_config.rfind('.')\n    app_name = default_app_config[:split_index]\n    config_name = default_app_config[split_index + 1:]\n    # Create a dictionary with extracted values\n    parsed_info = {'app_name': app_name, 'config_name': config_name}\n    return parsed_info\n", "entry_point": "parse_default_app_config", "input": "'appli.applig'", "output": "{'app_name': 'appli', 'config_name': 'applig'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106533_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001334", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[4, 8, 16]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001335", "code": "def calculate_average_excluding_outliers(numbers, threshold):\n    if not numbers:\n        return 0\n    median = sorted(numbers)[len(numbers) // 2]\n    filtered_numbers = [num for num in numbers if abs(num - median) <= threshold * median]\n    if not filtered_numbers:\n        return 0\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_excluding_outliers", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65048_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001336", "code": "import re\ndef extract_nlp_models(code_snippet):\n    model_info = {}\n    pattern = r\"'(.*?)'\\s*=\\s*HANLP_URL\\s*\\+\\s*'([^']*)'\"\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        model_name = match[0]\n        url = match[1]\n        model_type_match = re.search(r'(\\w+ model)', code_snippet)\n        model_type = model_type_match.group(1) if model_type_match else 'Unknown model'\n        model_info[model_name] = (model_type, url)\n    return model_info\n", "entry_point": "extract_nlp_models", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8983_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001337", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a draw\"\n", "entry_point": "simulate_card_game", "input": "[3, 5, 6], [1, 2, 4]", "output": "'Player 1 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64608_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001338", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'unknown_dataset', 231", "output": "231", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001339", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'eapplee', 'randomword'", "output": "'eapplee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001340", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[10, 12, 15]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148339_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001341", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "994", "output": "{1, 994, 2, 7, 71, 142, 14, 497}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001342", "code": "def calculate_total_call_durations(call_records):\n    total_durations = {}\n    for record in call_records:\n        caller = record['caller']\n        duration = record['duration']\n        if caller in total_durations:\n            total_durations[caller] += duration\n        else:\n            total_durations[caller] = duration\n    return total_durations\n", "entry_point": "calculate_total_call_durations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98028_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001343", "code": "def sum_adjacent_elements(input_list):\n    output_list = []\n    if not input_list:\n        return output_list\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "sum_adjacent_elements", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114935_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001344", "code": "def generate_combinations(X, N):\n    def generate_combinations_recursive(remaining_sum, current_combination, start_number):\n        if remaining_sum == 0:\n            all_combs.append(set(current_combination))\n            return\n        for i in range(start_number, X + 1):\n            if pow(i, N) > remaining_sum:\n                break\n            current_combination.append(i)\n            generate_combinations_recursive(remaining_sum - pow(i, N), current_combination, i + 1)\n            current_combination.pop()\n    if X == 1:\n        return [set([1])]\n    all_combs = []\n    generate_combinations_recursive(X, [], 1)\n    return all_combs\n", "entry_point": "generate_combinations", "input": "5, 2", "output": "[{1, 2}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77135_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001345", "code": "import math\ndef calculate_parts_count(max_tarfile_size, max_part_size, min_part_size):\n    max_part_count = int(math.ceil(max_tarfile_size / max_part_size))\n    # Adjust the number of parts if each part exceeds the maximum part size\n    while max_part_count * max_part_size > max_tarfile_size:\n        max_part_count -= 1\n    # Ensure each part is at least the minimum part size\n    if max_part_count * max_part_size < min_part_size:\n        return math.ceil(max_tarfile_size / min_part_size)\n    return max_part_count\n", "entry_point": "calculate_parts_count", "input": "200, 10, 5", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66821_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001346", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "20, 8", "output": "125970", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001347", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[101, 101, 88, 85, 75]", "output": "{101: 2, 88: 1, 85: 1, 75: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001348", "code": "from typing import List\ndef calculate_discount(current: List[float], reference: List[float]) -> List[float]:\n    list_discount = []\n    for i in range(len(current)):\n        c = current[i]\n        r = reference[i]\n        discount = (r - c) / r\n        list_discount.append(discount)\n    return list_discount\n", "entry_point": "calculate_discount", "input": "[0.5, 2], [1, 3]", "output": "[0.5, 0.3333333333333333]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121103_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001349", "code": "import re\ndef find_view_name(url_path):\n    urlpatterns = [\n        (r'^$', 'timeline'),\n        (r'^profile/(\\d+)', 'profile'),\n        (r'^create/post', 'new-post'),\n        (r'^explore/(\\d+)', 'explore'),\n        (r'^follow/(\\d+)', 'follow'),\n        (r'^create/comment(\\d+)', 'comment'),\n        (r'^like/(\\d+)', 'like'),\n        (r'^post/(\\d+)', 'post'),\n    ]\n    for pattern, view_name in urlpatterns:\n        if re.match(pattern, url_path):\n            return view_name\n    return \"Not Found\"\n", "entry_point": "find_view_name", "input": "'nonexistent/path'", "output": "'Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126708_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001350", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[9, 10, 15]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44965_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001351", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "1", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001352", "code": "def sum_excluding_diagonal(matrix):\n    total_sum = 0\n    for i in range(len(matrix)):\n        for j in range(len(matrix[i])):\n            if i != j:\n                total_sum += matrix[i][j]\n    return total_sum\n", "entry_point": "sum_excluding_diagonal", "input": "[[0, 0], [0, 0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136840_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001353", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9179", "output": "{137, 1, 67, 9179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001354", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[6, 3, 2, 4, 0, 5, 6, 4, 3, 2, 0]", "output": "[6, 3, 2, 4, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001355", "code": "def extract_sender_name(sender):\n    if \"<NAME>\" in sender:\n        name = sender.split(' ', 1)[0]\n        return name if name != \"<NAME>\" else \"Unknown\"\n    else:\n        return \"Unknown\"\n", "entry_point": "extract_sender_name", "input": "'Hello World'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97374_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001356", "code": "import heapq\ndef final_stone_weight(stones):\n    stones = [-val for val in stones]\n    heapq.heapify(stones)\n    while len(stones) > 1:\n        stone1 = -heapq.heappop(stones)\n        stone2 = -heapq.heappop(stones)\n        if stone1 == stone2:\n            continue\n        else:\n            heapq.heappush(stones, -abs(stone1 - stone2))\n    return 0 if len(stones) == 0 else -stones[0]\n", "entry_point": "final_stone_weight", "input": "[1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113070_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001357", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "15", "output": "'DARWIN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001358", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "89", "output": "{50: 1, 20: 1, 10: 1, 1: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001359", "code": "import os\ndef check_files_with_extension(directory: str, extension: str) -> bool:\n    if not os.path.exists(directory):\n        return False\n    files = os.listdir(directory)\n    for file in files:\n        if file.endswith(extension):\n            return True\n    return False\n", "entry_point": "check_files_with_extension", "input": "'/nonexistent_directory', '.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77610_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001360", "code": "import re\ndef extract_environment_variables(code_snippet):\n    env_var_counts = {}\n    env_var_pattern = re.compile(r'os.getenv\\(\"([^\"]+)\"\\)')\n    env_vars = env_var_pattern.findall(code_snippet)\n    for env_var in env_vars:\n        if env_var in env_var_counts:\n            env_var_counts[env_var] += 1\n        else:\n            env_var_counts[env_var] = 1\n    return env_var_counts\n", "entry_point": "extract_environment_variables", "input": "'print(\"Hello World\")'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98868_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001361", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8519", "output": "{1, 7, 1217, 8519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001362", "code": "def get_dag_gcs_prefix(project_id, location, composer_environment):\n    # Simulated environment data with placeholder values\n    environment_data = {\n        'config': {\n            'dagGcsPrefix': 'gs://example-dags/'\n        }\n    }\n    # Extract and return the DAG GCS prefix\n    return environment_data['config']['dagGcsPrefix']\n", "entry_point": "get_dag_gcs_prefix", "input": "None, None, None", "output": "'gs://example-dags/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134504_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2854", "output": "{1, 2, 1427, 2854}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001364", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "8", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001365", "code": "def max_non_adjacent_sum(nums):\n    if not nums:\n        return 0\n    inclusive = nums[0]\n    exclusive = 0\n    for i in range(1, len(nums)):\n        temp = inclusive\n        inclusive = max(exclusive + nums[i], inclusive)\n        exclusive = max(temp, exclusive)\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[8, 1, 9]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94810_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001366", "code": "def two_sum_indices(nums, target):\n    num_indices = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], i]\n        num_indices[num] = i\n    return []\n", "entry_point": "two_sum_indices", "input": "[1], 2", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94760_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001367", "code": "def simulate_card_game(num_rounds, deck_a, deck_b):\n    wins_a = 0\n    wins_b = 0\n    for i in range(num_rounds):\n        if deck_a[i] > deck_b[i]:\n            wins_a += 1\n        elif deck_a[i] < deck_b[i]:\n            wins_b += 1\n    return (wins_a, wins_b)\n", "entry_point": "simulate_card_game", "input": "2, [2, 1], [1, 2]", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60949_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001368", "code": "def modify_string(S):\n    if S == 'a':\n        return '-1'\n    else:\n        return 'a'\n", "entry_point": "modify_string", "input": "'b'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10379_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001369", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4858", "output": "{1, 2, 7, 14, 694, 4858, 347, 2429}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4857", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001370", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'exxeeeoeele', 'gam3ggg'", "output": "'ws://exxeeeoeele/gam3ggg/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001371", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[5, 10, 14, -1, -2]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22552_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001372", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'Component Wt.The'", "output": "'Wt.The Component'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8695", "output": "{1, 37, 5, 1739, 235, 47, 8695, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001374", "code": "def extract_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if not char.isspace():\n            unique_chars.add(char)\n    return sorted(list(unique_chars))\n", "entry_point": "extract_unique_characters", "input": "'abcd'", "output": "['a', 'b', 'c', 'd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89815_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001375", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3659", "output": "'1 hour 59 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001376", "code": "from typing import List\ndef count_pairs_sum_target(nums: List[int], target: int) -> int:\n    count = 0\n    num_freq = {}\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return count\n", "entry_point": "count_pairs_sum_target", "input": "[2, 3], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "953", "output": "{1, 953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt952", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001378", "code": "def reverse_complement(Dna):\n    tt = {\n        'A': 'T',\n        'T': 'A',\n        'G': 'C',\n        'C': 'G',\n    }\n    ans = ''\n    for a in Dna:\n        ans += tt[a]\n    return ans[::-1]\n", "entry_point": "reverse_complement", "input": "'AGCAAC'", "output": "'GTTGCT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99538_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001379", "code": "def count_unique_country_codes(country_codes):\n    unique_country_codes = set()\n    for code in country_codes:\n        unique_country_codes.add(code)\n    return len(unique_country_codes)\n", "entry_point": "count_unique_country_codes", "input": "['US', 'CA', 'GB', 'AU', 'US', 'GB']", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116809_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001380", "code": "def is_valid_parentheses(sequence: str) -> bool:\n    stack = []\n    mapping = {')': '('}\n    for char in sequence:\n        if char == '(':\n            stack.append(char)\n        elif char == ')':\n            if not stack or stack.pop() != '(':\n                return False\n    return len(stack) == 0\n", "entry_point": "is_valid_parentheses", "input": "'))'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11303_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001381", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2829", "output": "{1, 3, 69, 41, 2829, 943, 23, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001382", "code": "import re\ndef extract_constants(code_snippet):\n    constants = {}\n    constant_pattern = r\"(\\w+)\\s*=\\s*(.+)\"\n    for line in code_snippet.split('\\n'):\n        match = re.match(constant_pattern, line)\n        if match:\n            constant_name = match.group(1)\n            constant_value = match.group(2)\n            constants[constant_name] = eval(constant_value)\n    return constants\n", "entry_point": "extract_constants", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30665_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001383", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1903", "output": "{1, 11, 173, 1903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001384", "code": "CJ_PATH = r''\nCOOKIES_PATH = r''\nCHAN_ID = ''\nVID_ID = ''\ndef replace_variables(input_string, variable_type):\n    if variable_type == 'CHAN_ID':\n        return input_string.replace('CHAN_ID', CHAN_ID)\n    elif variable_type == 'VID_ID':\n        return input_string.replace('VID_ID', VID_ID)\n    else:\n        return input_string\n", "entry_point": "replace_variables", "input": "'anCHAN_IDdD', 'OTHER_ID'", "output": "'anCHAN_IDdD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27344_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001385", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 2, 3, 0, 8, 1, 3]", "output": "[2, 3, 5, 3, 12, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001386", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[50, 50, 50, 50], 4", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001387", "code": "def repeatedString(s, n):\n    count_1 = n // len(s) * s.count('a')  # Count of 'a' in complete repetitions of s\n    remained_string = n % len(s)  # Number of characters left after complete repetitions\n    count_2 = s[:remained_string].count('a')  # Count of 'a' in the remaining characters\n    return count_1 + count_2\n", "entry_point": "repeatedString", "input": "'a', 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29420_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001388", "code": "def is_luhn(card_number: str) -> bool:\n    digits = list(map(int, card_number))\n    for i in range(len(digits) - 2, -1, -2):\n        digits[i] *= 2\n        if digits[i] > 9:\n            digits[i] -= 9\n    return sum(digits) % 10 == 0\n", "entry_point": "is_luhn", "input": "'1234567812345671'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28623_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001389", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[2]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001390", "code": "import os\ndef is_true_in_env(env_key):\n    \"\"\"\n    :param str env_key: The environment variable key to check.\n    :return bool: True if the environment variable is set to a truthy value, False otherwise.\n    \"\"\"\n    return os.getenv(env_key, \"\") in (\"1\", \"True\", \"true\")\n", "entry_point": "is_true_in_env", "input": "'NON_EXISTENT_ENV_VAR'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71980_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001391", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8229", "output": "{1, 3, 8229, 39, 13, 211, 2743, 633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8228", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001392", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'I love Pytn and Djang'", "output": "'I love Pytn and Djang'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001393", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "4e-15, -30, -29", "output": "-29.999999999999996", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001394", "code": "def count_even_numbers(lst):\n    count = 0\n    for num in lst:\n        if num % 2 == 0:\n            count += 1\n    return count\n", "entry_point": "count_even_numbers", "input": "[0, 2, 4, 6, 8]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39285_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001395", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4779", "output": "{1, 3, 9, 59, 4779, 177, 81, 531, 1593, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001396", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 200.0), ('W', 80.0)]", "output": "120.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001397", "code": "def sum_of_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "11", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49804_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001398", "code": "def time_diff(time1, time2):\n    def time_to_seconds(time_str):\n        h, m, s = map(int, time_str.split(':'))\n        return h * 3600 + m * 60 + s\n    total_seconds1 = time_to_seconds(time1)\n    total_seconds2 = time_to_seconds(time2)\n    time_difference = abs(total_seconds1 - total_seconds2)\n    return time_difference\n", "entry_point": "time_diff", "input": "'00:00:00', '00:00:01'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35063_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001399", "code": "def total_cost(items):\n    total_cost = 0\n    for item in items:\n        cost = item['price'] * item['quantity']\n        total_cost += cost\n    return total_cost\n", "entry_point": "total_cost", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58390_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001400", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "231", "output": "{1, 33, 3, 7, 231, 11, 77, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001401", "code": "def calculate_word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Initialize a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation if needed\n        word = word.strip('.,')\n        # Update the word frequency dictionary\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'pythohellon'", "output": "{'pythohellon': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88926_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001402", "code": "def is_dag(adj_list):\n    visited = set()\n    path = set()\n    def dfs(node):\n        if node in path:\n            return False\n        if node in visited:\n            return True\n        visited.add(node)\n        path.add(node)\n        for neighbor in adj_list.get(node, []):\n            if not dfs(neighbor):\n                return False\n        path.remove(node)\n        return True\n    for node in adj_list:\n        if not dfs(node):\n            return False\n    return True\n", "entry_point": "is_dag", "input": "{0: [1, 2], 1: [3], 2: [3], 3: []}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56306_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001403", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "16, 6", "output": "8008", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3590", "output": "{1, 2, 1795, 5, 3590, 359, 10, 718}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3589", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001405", "code": "def letter_counter(token, word):\n    count = 0\n    for letter in word:\n        if letter == token:\n            count += 1\n    return count\n", "entry_point": "letter_counter", "input": "'a', 'hello'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100580_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001406", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[3, 3, 4, 5, 1, 4, 6]", "output": "[4.24, 4.24, 5.66, 7.07, 1.41, 5.66, 8.49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001407", "code": "def card_game_winner(N, T):\n    player1_sum = 0\n    player2_sum = 0\n    for card in range(1, N + 1):\n        if player1_sum + card <= T:\n            player1_sum += card\n        else:\n            if player2_sum + card <= T:\n                player2_sum += card\n    if player1_sum > player2_sum:\n        return 1\n    elif player2_sum > player1_sum:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_game_winner", "input": "3, 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46837_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001408", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "(0, 10, -1, 3, 9, 8, 4, 8, 8)", "output": "'0.10.-1.3.9.8.4.8.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001409", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001410", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'potlib1'", "output": "'potlib1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4033", "output": "{1, 109, 4033, 37}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001412", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'tootthtto'", "output": "\"Directory 'tootthtto' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9154", "output": "{1, 9154, 2, 4577, 199, 398, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001414", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[0, 0, 0, 1, 2, 2, 2, 3, 4]", "output": "{0: 3, 1: 1, 2: 3, 3: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7948", "output": "{1, 2, 1987, 4, 3974, 7948}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7947", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001416", "code": "import re\ndef extract_affiliated_packages(code_snippet):\n    affiliated_packages = []\n    for line in code_snippet.split('\\\\n'):\n        if line.startswith('from .'):\n            match = re.search(r'from \\\\.(\\w+)', line)\n            if match:\n                affiliated_packages.append(match.group(1))\n    return affiliated_packages\n", "entry_point": "extract_affiliated_packages", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29193_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9089", "output": "{1, 9089, 61, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001418", "code": "def calculate_sign(num):\n    if num < 0:\n        return -1\n    elif num > 0:\n        return 1\n    else:\n        return 0\n", "entry_point": "calculate_sign", "input": "-1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104894_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001419", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'Treieli'", "output": "'Treieli'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001420", "code": "def count_pairs_sum_to_target(nums, target):\n    seen = {}\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen and seen[complement] > 0:\n            count += 1\n            seen[complement] -= 1\n        else:\n            seen[num] = seen.get(num, 0) + 1\n    return count\n", "entry_point": "count_pairs_sum_to_target", "input": "[2, 3, 2, 3], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76386_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001421", "code": "def count_pairs_sum_to_target(nums, target):\n    num_freq = {}\n    pairs_count = 0\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            pairs_count += num_freq[complement]\n        if num in num_freq:\n            num_freq[num] += 1\n        else:\n            num_freq[num] = 1\n    return pairs_count\n", "entry_point": "count_pairs_sum_to_target", "input": "[1, 5, 1, 5, 2, 4, 3, 3], 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69429_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001422", "code": "import os\ndef select_load_balancer_strategy(mode):\n    if mode == 'CPUOnlyLB':\n        return 'CPU Only Load Balancer'\n    elif mode == 'WeightedRandomLB':\n        cpu_ratio = float(os.environ.get('NBA_LOADBALANCER_CPU_RATIO', 1.0))\n        return f'Weighted Random Load Balancer with CPU Ratio: {cpu_ratio}'\n    else:\n        return 'Unknown Load Balancer Strategy'\n", "entry_point": "select_load_balancer_strategy", "input": "'RandomLB'", "output": "'Unknown Load Balancer Strategy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57619_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001423", "code": "GAIN_FOUR = 2\nGAIN_ONE = 0\nGAIN_TWO = 1\nMODE_CONTIN = 0\nMODE_SINGLE = 16\nOSMODE_STATE = 128\ndef calculate_gain(mode, rate):\n    if mode == MODE_CONTIN:\n        return rate * GAIN_ONE\n    elif mode == MODE_SINGLE:\n        return rate + GAIN_TWO\n    elif mode == OSMODE_STATE:\n        return rate - GAIN_FOUR\n    else:\n        return \"Invalid mode\"\n", "entry_point": "calculate_gain", "input": "100, 1", "output": "'Invalid mode'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87824_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001424", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'codingm'", "output": "'codingm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001425", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'abc_prr'", "output": "'prr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001426", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "100, 53", "output": "153", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001427", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4611", "output": "{1, 1537, 3, 4611, 53, 87, 29, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001428", "code": "def parse_launches(input_str):\n    launches_dict = {}\n    launches_list = input_str.split(',')\n    for launch_pair in launches_list:\n        date, description = launch_pair.split(':')\n        launches_dict[date] = description\n    return launches_dict\n", "entry_point": "parse_launches", "input": "'2022-04-25:La'", "output": "{'2022-04-25': 'La'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64743_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001429", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8531", "output": "{19, 1, 8531, 449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001430", "code": "import sys\ndef run_program(cmd, tries):\n    for _ in range(tries):\n        # Simulate program execution (replace with actual program execution logic)\n        return_code = 0  # Simulated return code\n        if return_code != 0:\n            return 1\n    return 0\n", "entry_point": "run_program", "input": "'', 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22762_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001431", "code": "def sum_adjacent_elements(input_list):\n    output_list = []\n    if not input_list:\n        return output_list\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "sum_adjacent_elements", "input": "[3, 3, 0, 4, 3, 5, 3, 3, 3]", "output": "[6, 3, 4, 7, 8, 8, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114935_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001432", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return player1_wins, player2_wins\n", "entry_point": "simulate_card_game", "input": "[3, 1, 2], [1, 3, 4]", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47908_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8258", "output": "{1, 8258, 2, 4129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001434", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "-4, 2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001435", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'Jo', 'Smith', 'Mari'", "output": "'Jo Mari Smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001436", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "3, 4", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001437", "code": "def min_replacements(n, count=0):\n    if n == 1:\n        return count\n    if n % 2 == 0:\n        return min_replacements(n // 2, count + 1)\n    else:\n        return min(min_replacements(n + 1, count + 1), min_replacements(n - 1, count + 1))\n", "entry_point": "min_replacements", "input": "15", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6998_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001438", "code": "def check_naming_convention(input_string):\n    if input_string.startswith(\"START_\") and (input_string.endswith(\"_END\") or input_string.endswith(\"_FINISH\")):\n        return True\n    return False\n", "entry_point": "check_naming_convention", "input": "'MY_PREFIX_END'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31498_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001439", "code": "def class_name_normalize(class_name):\n    \"\"\"\n    Converts a string into a standardized class name format.\n    Args:\n    class_name (str): The input string with words separated by underscores.\n    Returns:\n    str: The converted class name format with each word starting with an uppercase letter followed by lowercase letters.\n    \"\"\"\n    part_list = []\n    for item in class_name.split(\"_\"):\n        part_list.append(\"{}{}\".format(item[0].upper(), item[1:].lower()))\n    return \"\".join(part_list)\n", "entry_point": "class_name_normalize", "input": "'ususer_prose_manager'", "output": "'UsuserProseManager'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55201_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001440", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[2, [3]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001441", "code": "def process_tag_name(branch, expected):\n    result = {}\n    for exp_format in expected:\n        try:\n            tag_name = exp_format.format('branch', branch)\n            if tag_name == exp_format.format('branch', branch):\n                result['tag_name'] = tag_name\n                result['branch'] = branch\n                break\n        except IndexError:\n            pass\n    return result\n", "entry_point": "process_tag_name", "input": "'a_branch', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107572_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001442", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4561", "output": "{1, 4561}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001443", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "5, 5.196152422706632", "output": "7.211102550927978", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001444", "code": "ENDPOINT_MAPPING = {\n    'robot_position': '/robotposition',\n    'cube_position': '/cubeposition',\n    'path': '/path',\n    'flag': '/flag'\n}\ndef generate_endpoint(resource_name):\n    return ENDPOINT_MAPPING.get(resource_name, 'Invalid resource')\n", "entry_point": "generate_endpoint", "input": "'invalid_resource'", "output": "'Invalid resource'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44396_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001445", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'25.12.2023'", "output": "'25.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001446", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'ch10This0ex', '11.1'", "output": "'11.1ch10This0ex'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8061", "output": "{1, 3, 8061, 2687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8060", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001448", "code": "def sum_multiples(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 6, 9, 10]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14565_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001449", "code": "import json\nimport xml.etree.ElementTree as ET\ndef count_elements(data: str, element: str) -> int:\n    count = 0\n    try:\n        if data.strip().startswith('{'):\n            json_data = json.loads(data)\n            if element in json_data:\n                count = 1\n        elif data.strip().startswith('<'):\n            root = ET.fromstring(data)\n            count = len(root.findall(element))\n    except (json.JSONDecodeError, ET.ParseError):\n        pass\n    return count\n", "entry_point": "count_elements", "input": "'{}', 'non_existent_key'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107238_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001450", "code": "def find_missing_number(nums):\n    n = len(nums)\n    total_sum = n * (n + 1) // 2\n    for num in nums:\n        total_sum -= num\n    return total_sum\n", "entry_point": "find_missing_number", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79191_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001451", "code": "def compare_versions(version1: str, version2: str) -> str:\n    def normalize_version(version):\n        parts = list(map(int, version.split('.')))\n        while len(parts) < 3:\n            parts.append(0)\n        return parts\n    v1 = normalize_version(version1)\n    v2 = normalize_version(version2)\n    for part1, part2 in zip(v1, v2):\n        if part1 > part2:\n            return \"Version 1 is greater\"\n        elif part1 < part2:\n            return \"Version 2 is greater\"\n    return \"Versions are equal\"\n", "entry_point": "compare_versions", "input": "'1.0.0', '1.0.1'", "output": "'Version 2 is greater'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87736_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001452", "code": "def maxProfit(prices):\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[5, 6, 7, 8]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12353_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001453", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1322", "output": "{1, 1322, 2, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1321", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001454", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9059", "output": "{1, 9059}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001455", "code": "from typing import List\ndef process_strings(ss: List[str]) -> int:\n    valid = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}\n    signs = {'+', '-'}\n    ns = []\n    if len(ss) == 0:\n        return 0\n    for v in ss:\n        if v in valid:\n            ns.append(v)\n            continue\n        if v in signs and not len(ns):\n            ns.append(v)\n            continue\n        break\n    if not ns or (len(ns) == 1 and ns[0] in signs):\n        return 0\n    r = int(''.join(ns))\n    if r < -2147483648:\n        return -2147483648\n    return r\n", "entry_point": "process_strings", "input": "['+']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44054_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001456", "code": "def find_sections(keyPoints):\n    active = False\n    actSec = {0: False, 1: False}\n    X = None\n    secs = []\n    for k, i in keyPoints:\n        actSec[i] = not actSec[i]\n        if actSec[0] and not actSec[1]:\n            X = k\n            active = True\n        elif active and X is not None and (not actSec[0] or actSec[1]):\n            if len(secs) > 0 and secs[-1][1] == X:\n                secs[-1] = (secs[-1][0], k)\n            else:\n                secs.append((X, k))\n            active = False\n    secs = [(a, b) for a, b in secs if a != b]\n    return secs\n", "entry_point": "find_sections", "input": "[(1, 0), (2, 0), (5, 0), (6, 0)]", "output": "[(1, 2), (5, 6)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89316_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001457", "code": "def filter_variable_names(variables):\n    filtered_variables = [var for var in variables if not var.startswith('_')]\n    return filtered_variables\n", "entry_point": "filter_variable_names", "input": "['_hidden', 'name', 'city', 'phone', '_private']", "output": "['name', 'city', 'phone']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11787_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001458", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'ccc'", "output": "'ccc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001459", "code": "def is_leap(year):\n    # Check if the year is divisible by 4\n    if year % 4 == 0:\n        # Check if it is not divisible by 100 or if it is divisible by 400\n        if year % 100 != 0 or year % 400 == 0:\n            return True\n    return False\n", "entry_point": "is_leap", "input": "2019", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102062_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001460", "code": "from collections import Counter\ndef find_modes(data):\n    freq_dict = Counter(data)\n    max_freq = max(freq_dict.values())\n    modes = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[1, 1, 1, 2]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75133_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001461", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'I&#39;m codim'", "output": "\"I'm codim\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001462", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[1, 2, 3, 4, 5]", "output": "[4, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001463", "code": "algorithm_map = {\n    'RS256': 'sha256',\n    'RS384': 'sha384',\n    'RS512': 'sha512',\n}\ndef get_hash_algorithm(algorithm_name):\n    return algorithm_map.get(algorithm_name, 'Algorithm not found')\n", "entry_point": "get_hash_algorithm", "input": "'RS123'", "output": "'Algorithm not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98777_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001464", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[72, 73, 74]", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117856_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001465", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['5', '3', '5']", "output": "535", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001466", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "400", "output": "'Invalid credentials'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001467", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7574", "output": "{1, 2, 7, 3787, 14, 7574, 1082, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001468", "code": "def clamp_numbers(numbers, lower_bound, upper_bound):\n    return [max(lower_bound, min(num, upper_bound)) for num in numbers]\n", "entry_point": "clamp_numbers", "input": "[3, 5], 4, 4", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51058_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001469", "code": "def min_removals_to_palindrome(stream):\n    def is_palindrome(s):\n        return s == s[::-1]\n    def min_removals_helper(s, left, right):\n        if left >= right:\n            return 0\n        if s[left] == s[right]:\n            return min_removals_helper(s, left + 1, right - 1)\n        else:\n            return 1 + min(min_removals_helper(s, left + 1, right), min_removals_helper(s, left, right - 1))\n    return min_removals_helper(stream, 0, len(stream) - 1)\n", "entry_point": "min_removals_to_palindrome", "input": "'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84471_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001470", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[4, 6, 4, 4, 5, 4, 5, 4, 5]", "output": "[4, 10, 14, 18, 23, 27, 32, 36, 41]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001471", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'m'", "output": "'m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001472", "code": "import os\nimport json\ndef process_message_files(directory_path):\n    messages = []\n    for root, dirs, files in os.walk(directory_path):\n        for file in files:\n            if file.startswith(\"message_\") and file.endswith(\".json\"):\n                file_path = os.path.join(root, file)\n                with open(file_path) as f:\n                    message_data = json.load(f)\n                    sender_name = message_data.get(\"sender\", \"Unknown\")\n                    message_content = message_data.get(\"content\", \"\")\n                    messages.append({\"sender\": sender_name, \"content\": message_content})\n    return messages\n", "entry_point": "process_message_files", "input": "'/path/to/empty/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26934_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001473", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9379", "output": "{1, 83, 9379, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001474", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "12", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001475", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[3], [2]]", "output": "[3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001476", "code": "import re\ntimestamp_regex = '\\\\d{4}[-]?\\\\d{1,2}[-]?\\\\d{1,2} \\\\d{1,2}:\\\\d{1,2}:\\\\d{1,2}'\ndef validate_timestamp(timestamp):\n    pattern = re.compile(timestamp_regex)\n    return bool(pattern.match(timestamp))\n", "entry_point": "validate_timestamp", "input": "''", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52793_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001477", "code": "import re\ndef canonicalize(url):\n    # Returns (canonicalized_url, netloc, tenant). Raises ValueError on errors.\n    match_object = re.match(r'https://([^/]+)/([^/?#]+)', url.lower())\n    if not match_object:\n        raise ValueError(\n            \"Your given address (%s) should consist of \"\n            \"an https url with a minimum of one segment in a path: e.g. \"\n            \"https://login.microsoftonline.com/<tenant_name>\" % url)\n    return match_object.group(0), match_object.group(1), match_object.group(2)\n", "entry_point": "canonicalize", "input": "'https://lohtths/logit'", "output": "('https://lohtths/logit', 'lohtths', 'logit')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88779_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001478", "code": "def highest_growth_rate_city(population_list):\n    highest_growth_rate = 0\n    city_with_highest_growth = None\n    for i in range(1, len(population_list)):\n        growth_rate = population_list[i] - population_list[i - 1]\n        if growth_rate > highest_growth_rate:\n            highest_growth_rate = growth_rate\n            city_with_highest_growth = f'City{i+1}'\n    return city_with_highest_growth\n", "entry_point": "highest_growth_rate_city", "input": "[100, 150, 300]", "output": "'City3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6843_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001479", "code": "def validate_age(input_str):\n    if '-' in input_str:\n        start, end = input_str.split('-')\n        try:\n            start = int(start)\n            end = int(end)\n            return start <= end\n        except ValueError:\n            return False\n    else:\n        try:\n            int(input_str)\n            return True\n        except ValueError:\n            return False\n", "entry_point": "validate_age", "input": "'12-5'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42783_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001480", "code": "def max_sum_non_adjacent(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = num + exclude\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 3, 9, 8]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129715_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4929", "output": "{159, 4929, 1, 3, 1643, 53, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001482", "code": "def sum_greater_than_average(lst):\n    if not lst:\n        return 0  # Return 0 for an empty list\n    avg = sum(lst) / len(lst)\n    sum_greater = sum(num for num in lst if num > avg)\n    return sum_greater\n", "entry_point": "sum_greater_than_average", "input": "[1, 2, 3, 4, 5, 19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126305_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6819", "output": "{3, 1, 6819, 2273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001484", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'Files\\\\Pythoncript.py'", "output": "'Files\\\\Pythoncript.py/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001485", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "12", "output": "[1, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001486", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'ososmaxxclipping.some_other_config'", "output": "'ososmaxxclipping'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001487", "code": "import os\ndef list_files_in_directory(directory_path):\n    if not os.path.exists(directory_path):\n        return []\n    file_paths = []\n    for item in os.listdir(directory_path):\n        item_path = os.path.join(directory_path, item)\n        if os.path.isfile(item_path):\n            file_paths.append(item_path)\n        elif os.path.isdir(item_path):\n            file_paths.extend(list_files_in_directory(item_path))\n    return file_paths\n", "entry_point": "list_files_in_directory", "input": "'path/to/non_existent_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2562_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001488", "code": "def process_circular_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        output_list.append(input_list[i] + input_list[(i + 1) % len(input_list)])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[0, 0, 1, 3, 7, 0]", "output": "[0, 1, 4, 10, 7, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131123_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2593", "output": "{1, 2593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001490", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[1, 1, 1, 2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001491", "code": "def sum_of_multiples(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 6, 9, 10, 12, 15]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59802_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001492", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6186", "output": "{1, 2, 3, 6, 1031, 6186, 2062, 3093}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2575", "output": "{1, 515, 5, 103, 2575, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2574", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001494", "code": "def generate_fibonacci(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci", "input": "8", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4928_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001495", "code": "def simulate_market_diff(symbols):\n    results = []\n    def subscribe_market_diff(symbol):\n        nonlocal results\n        results.append({'stream': 'marketDiff', 'symbol': symbol})  # Simulated message\n    for symbol in symbols:\n        subscribe_market_diff(symbol)\n    for result in results:\n        if result.get('stream') == 'marketDiff':\n            return result\n", "entry_point": "simulate_market_diff", "input": "['CBTC']", "output": "{'stream': 'marketDiff', 'symbol': 'CBTC'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32092_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001496", "code": "def highest_performance_score(scores):\n    if not scores:\n        return None\n    max_score = scores[0]  # Initialize max_score with the first score in the list\n    for score in scores:\n        if score > max_score:\n            max_score = score\n    return max_score\n", "entry_point": "highest_performance_score", "input": "[85, 90, 96, 78]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109212_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001497", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "'Hello, World! This is a test.'", "output": "'hello world this is a test'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001498", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'<PASSWORD>', '8dd8c50d3e'", "output": "'8dd8c50d3e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001499", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[94, 93, 92, 88, 85]", "output": "[94, 93, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001500", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[80, 78, 76, 75, 75, 74, 72], 7", "output": "75.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59091_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001501", "code": "def calc_user_rating(matched_id):\n    # Simulating database query with sample data\n    class UserRating:\n        def __init__(self, rated_user_id, rating):\n            self.rated_user_id = rated_user_id\n            self.rating = rating\n    # Sample data for demonstration\n    ratings_data = [\n        UserRating(1, 4),\n        UserRating(1, 3),\n        UserRating(1, 5),\n        UserRating(2, 2),\n        UserRating(2, 3)\n    ]\n    matched = [rating for rating in ratings_data if rating.rated_user_id == matched_id]\n    rate_sum = sum(rating.rating for rating in matched)\n    if len(matched) == 0:\n        final_rate = 2.5\n    else:\n        final_rate = rate_sum / len(matched)\n    return final_rate\n", "entry_point": "calc_user_rating", "input": "3", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75245_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001502", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'5'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001503", "code": "def check_ending(data):\n    # Define your logic here to check if the data signifies the end of the transmission\n    # For demonstration purposes, let's assume the end sequence is a single byte with value 255\n    end_sequence = 255\n    return data == end_sequence\n", "entry_point": "check_ending", "input": "0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120387_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001504", "code": "def my_count(lst, e):\n    res = 0\n    if type(lst) == list:\n        res = lst.count(e)\n    return res\n", "entry_point": "my_count", "input": "[], 'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128138_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001505", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 2, 5]", "output": "[0, 1, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001506", "code": "def calculate_overlaps(overlap_map: dict[tuple[float, float], int], minimal_overlap: int) -> int:\n    def overlap_map_to_overlaps(overlap_map: dict[tuple[float, float], int], minimal_overlap=2) -> int:\n        return len(list(filter(lambda val: val >= minimal_overlap, overlap_map.values())))\n    return overlap_map_to_overlaps(overlap_map, minimal_overlap)\n", "entry_point": "calculate_overlaps", "input": "{(0.0, 1.0): 3, (1.1, 2.1): 2, (2.2, 3.2): 1, (3.3, 4.3): 0}, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8510_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001507", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'AlisaBBo'", "output": "'AlisaBBoEuroPython'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9577", "output": "{1, 61, 157, 9577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001509", "code": "def calculate_max_baud_rate(serial_port):\n    # Assuming some logic to determine the maximum baud rate based on serial port and channel constraints\n    max_baud_rate = 115200  # Example: Maximum baud rate supported by the hardware\n    # Additional logic to consider channel limitations, noise, etc.\n    # For simplicity, let's assume no additional constraints\n    return max_baud_rate\n", "entry_point": "calculate_max_baud_rate", "input": "'COM1'", "output": "115200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93855_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001510", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70024_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001511", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[10, 20, 30], 60", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001512", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'1010'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001513", "code": "def calculate_total_seconds(duration):\n    # Split the duration string into hours, minutes, and seconds\n    hours, minutes, seconds = map(int, duration.split(':'))\n    # Calculate the total number of seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "calculate_total_seconds", "input": "'12:00:00'", "output": "43200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40922_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001514", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001515", "code": "def basic_calculator(num1: float, num2: float, operation: str) -> float:\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Error: Division by zero!\"\n    else:\n        return \"Error: Invalid operation!\"\n", "entry_point": "basic_calculator", "input": "1.0, 2.0, '%'", "output": "'Error: Invalid operation!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19051_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001516", "code": "def merge_namespaces_with_item_definition(namespaces, item_definition):\n    result = []\n    for namespace in namespaces:\n        name = namespace['name']\n        id_val = item_definition.get('id')\n        val_val = item_definition.get('val')\n        result.append({'name': name, 'id': id_val, 'val': val_val})\n    return result\n", "entry_point": "merge_namespaces_with_item_definition", "input": "[], {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125743_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001517", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[6, 5, 4, 3, 2, 1]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001518", "code": "def map_lipid_to_headgroup(lipid_definitions):\n    lipidGroup = [\"CHOL\", \"PC\", \"PE\", \"SM\", \"PS\", \"Glyco\", \"PI\", \"PA\", \"PIPs\", \"CER\", \"Lyso\", \"DAG\"]\n    lipid_mapping = {}\n    for lipid_def in lipid_definitions:\n        lipid_type = lipid_def[0]\n        headgroup_group_id = lipidGroup.index(lipid_type)\n        lipid_mapping[lipid_type] = headgroup_group_id\n    return lipid_mapping\n", "entry_point": "map_lipid_to_headgroup", "input": "[['PE']]", "output": "{'PE': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126080_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001519", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3049", "output": "{1, 3049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3048", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001520", "code": "from typing import List\ndef get_imported_packages(script: str) -> List[str]:\n    imported_packages = set()\n    for line in script.split('\\n'):\n        if line.startswith('import '):\n            packages = line.split('import ')[1].split(',')\n            for package in packages:\n                imported_packages.add(package.strip())\n        elif line.startswith('from '):\n            package = line.split('from ')[1].split(' ')[0]\n            imported_packages.add(package)\n    return list(imported_packages)\n", "entry_point": "get_imported_packages", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97742_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001521", "code": "app_name = \"welfare\"\nurlpatterns = [\n    (\"/\", \"welfare_index\"),\n    (\"/districts\", \"all_districts\"),\n    (\"/district/<str:district_code>\", \"district_schools\"),\n    (\"/school/<str:school_code>\", \"school_students\"),\n    (\"/view_services\", \"view_services\"),\n    (\"/create_service\", \"service_form\"),\n    (\"/edit_service/<int:code>\", \"service_form\"),\n    (\"/student/<int:code>\", \"student_view\"),\n    (\"/student/<int:student_code>/add_service\", \"student_service_form\"),\n    (\"/student/<int:student_code>/edit_service/<int:assoc_id>\", \"student_service_form\"),\n]\ndef find_view_function(url_path: str) -> str:\n    url_to_view = {path: view for path, view in urlpatterns}\n    for path, view in url_to_view.items():\n        if path == url_path:\n            return view\n    return \"Not Found\"\n", "entry_point": "find_view_function", "input": "'/unknown'", "output": "'Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144446_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001522", "code": "def frog_jump_time(A, X):\n    positions = set()\n    for time, position in enumerate(A):\n        positions.add(position)\n        if len(positions) == X:\n            return time\n    return -1\n", "entry_point": "frog_jump_time", "input": "[0, 1, 1, 0, 0], 3", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50166_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001523", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'stutsdesh'", "output": "'stutsdesh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001524", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "' Smith    ', 18", "output": "'%20Smith%20%20%20%20'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001525", "code": "def sum_of_multiples_of_3_or_5(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in multiples_set:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples_of_3_or_5", "input": "[3, 5, 6, 15, 10]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33384_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4605", "output": "{1, 3, 5, 15, 307, 921, 4605, 1535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001527", "code": "FILE_STATUS = (\n    \"\u2601 Uploaded\",\n    \"\u231a Queued\",\n    \"\u2699 In Progress...\",\n    \"\u2705 Success!\",\n    \"\u274c Failed: file not found\",\n    \"\u274c Failed: unsupported file type\",\n    \"\u274c Failed: server error\",\n    \"\u274c Invalid column mapping, please fix it and re-upload the file.\",\n)\ndef get_file_status_message(index):\n    if 0 <= index < len(FILE_STATUS):\n        return FILE_STATUS[index]\n    else:\n        return \"Invalid status index\"\n", "entry_point": "get_file_status_message", "input": "0", "output": "'\u2601 Uploaded'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2319_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001528", "code": "def remove_negated_atoms(input_program):\n    rules = input_program.strip().split('\\n')\n    output_program = []\n    for rule in rules:\n        if ':-' in rule and any(literal.startswith('-') for literal in rule.split(':-', 1)[1].split(',')):\n            continue\n        output_program.append(rule)\n    return '\\n'.join(output_program)\n", "entry_point": "remove_negated_atoms", "input": "'true.'", "output": "'true.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89987_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001529", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[2, 4]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112046_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001530", "code": "def create_image(pixel_values):\n    side_length = int(len(pixel_values) ** 0.5)\n    image = [[0 for _ in range(side_length)] for _ in range(side_length)]\n    for i in range(side_length):\n        for j in range(side_length):\n            image[i][j] = pixel_values[i * side_length + j]\n    return image\n", "entry_point": "create_image", "input": "[32, 129, 32, 0]", "output": "[[32, 129], [32, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113012_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001531", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No meaningful average if less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[84, 86, 87, 88, 90]", "output": "87.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57154_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001532", "code": "def card_war(player1, player2):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    for card1, card2 in zip(player1, player2):\n        if card_values[card1] > card_values[card2]:\n            return 1\n        elif card_values[card1] < card_values[card2]:\n            return 2\n    return 0\n", "entry_point": "card_war", "input": "['2'], ['3']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71282_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001533", "code": "def count_numbers_with_same_first_last_digit(nums_str):\n    count = 0\n    for num_str in nums_str:\n        if num_str[0] == num_str[-1]:\n            count += 1\n    return count\n", "entry_point": "count_numbers_with_same_first_last_digit", "input": "['5', '5', '123']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139447_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001534", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "8, 3", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001535", "code": "def sum_of_even_numbers(input_list):\n    even_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_even_numbers", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57858_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001536", "code": "def card_game(player_a, player_b):\n    rounds_a_won = 0\n    rounds_b_won = 0\n    ties = 0\n    for card_a, card_b in zip(player_a, player_b):\n        if card_a > card_b:\n            rounds_a_won += 1\n        elif card_b > card_a:\n            rounds_b_won += 1\n        else:\n            ties += 1\n    return rounds_a_won, rounds_b_won, ties\n", "entry_point": "card_game", "input": "[1, 2, 3], [1, 2, 3]", "output": "(0, 0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34362_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001537", "code": "def transform_iso_datetime(iso_datetime: str) -> str:\n    date_str, time_str = iso_datetime.split('T')\n    if '.' in time_str:\n        time_str = time_str.split('.')[0]  # Remove milliseconds if present\n    date_str = date_str.replace('-', '')  # Remove hyphens from date\n    time_str = time_str.replace(':', '')  # Remove colons from time\n    return date_str + 'T' + time_str\n", "entry_point": "transform_iso_datetime", "input": "'2021-05-01T12:30:45'", "output": "'20210501T123045'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14024_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001538", "code": "def apply_replacements(replacements, input_string):\n    replacement_dict = {}\n    # Populate the replacement dictionary\n    for replacement in replacements:\n        old_word, new_word = replacement.split(\":\")\n        replacement_dict[old_word] = new_word\n    # Split the input string into words\n    words = input_string.split()\n    # Apply replacements to each word\n    for i in range(len(words)):\n        if words[i] in replacement_dict:\n            words[i] = replacement_dict[words[i]]\n    # Join the modified words back into a string\n    output_string = \" \".join(words)\n    return output_string\n", "entry_point": "apply_replacements", "input": "['apple:orange'], 'I like apple'", "output": "'I like orange'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5614_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001539", "code": "def generate_sequence(n):\n    if n <= 0:\n        return \"\"\n    sequence = \"A\"\n    current_char = \"A\"\n    for _ in range(n - 1):\n        if current_char == \"A\":\n            sequence += \"B\"\n            current_char = \"B\"\n        else:\n            sequence += \"AA\"\n            current_char = \"A\"\n    return sequence\n", "entry_point": "generate_sequence", "input": "1", "output": "'A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61941_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001540", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3386", "output": "{1, 3386, 2, 1693}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001541", "code": "def count_base_names(file_names):\n    base_name_counts = {}\n    for file_name in file_names:\n        base_name = file_name.split('.')[0]  # Extract base name by removing extension\n        base_name_counts[base_name] = base_name_counts.get(base_name, 0) + 1  # Update count\n    return base_name_counts\n", "entry_point": "count_base_names", "input": "['file3.txt', 'file3.pdf', 'file3.doc']", "output": "{'file3': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119966_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001542", "code": "_rootLeafType2rootBranchType = { 'UChar_t': 'b', 'Char_t': 'B', 'UInt_t': 'i', 'Int_t': 'I', 'Float_t': 'F', 'Double_t': 'D', 'ULong64_t': 'l', 'Long64_t': 'L', 'Bool_t': 'O' }\ndef convert_leaf_to_branch(leaf_type):\n    return _rootLeafType2rootBranchType.get(leaf_type, 'Unknown')\n", "entry_point": "convert_leaf_to_branch", "input": "'String_t'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18566_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001543", "code": "import os\ndef load_commands(directory_path):\n    commands = {}\n    command_path = os.path.split(directory_path)[0]\n    try:\n        for file in os.listdir(command_path):\n            if file.endswith('.py'):\n                try:\n                    command_object = self.import_command(command_path + '/' + file[:-3])\n                    command_name = command_object.details['Name']\n                    commands[command_name] = command_object\n                except Exception as e:\n                    print(f\"Failed to load {file[:-3]} command: {e}\")\n    except Exception as e:\n        pass\n    return commands\n", "entry_point": "load_commands", "input": "'/some/path/no_py_folder'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95097_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001544", "code": "def longest_consecutive_subsequence(lst):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1] + 1:\n            current_length += 1\n        else:\n            if current_length > max_length:\n                max_length = current_length\n                start_index = i - current_length\n            current_length = 1\n    if current_length > max_length:\n        max_length = current_length\n        start_index = len(lst) - current_length\n    return lst[start_index:start_index + max_length]\n", "entry_point": "longest_consecutive_subsequence", "input": "[1, 2]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62550_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001545", "code": "def calculate_even_sum(numbers):\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[12, 12, 12]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38409_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001546", "code": "def get_color_tag(counter):\n    \"\"\"Returns color tag based on the parity of the counter.\"\"\"\n    if counter % 2 == 0:\n        return 'warning'\n    return 'info'\n", "entry_point": "get_color_tag", "input": "0", "output": "'warning'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55016_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001547", "code": "def calculate_factorial(n):\n    if n < 0:\n        return 0\n    factorial = 1\n    for i in range(1, n + 1):\n        factorial *= i\n    return factorial\n", "entry_point": "calculate_factorial", "input": "9", "output": "362880", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130862_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001548", "code": "import re\ndef extract_test_info(test_function):\n    test_info = {}\n    model_match = re.search(r'@pytest.mark.model\\(\"([^\"]+)\"\\)', test_function)\n    if model_match:\n        test_info['model'] = model_match.group(1)\n    dataset_match = re.search(r'@pytest.mark.integration\\(\"([^\"]+)\"\\)', test_function)\n    if dataset_match:\n        test_info['dataset'] = dataset_match.group(1)\n    framework_match = re.search(r'execute_single_node_benchmark\\(ctx, (\\w+), \"(\\w+)\"', test_function)\n    if framework_match:\n        test_info['framework'] = framework_match.group(2)\n    return test_info\n", "entry_point": "extract_test_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113647_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001549", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 10, 4, 6, 2, 8, 4, 7]", "output": "[11, 14, 10, 8, 10, 12, 11, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001550", "code": "from typing import List\ndef extract_filesystem_info(debpackagefilename: str) -> List[str]:\n    filesysinfo = debpackagefilename + \"_filesysinfo.txt\"\n    # Simulating the extraction of file system information\n    fstruct = \"/usr/bin\\n/usr/lib\\n/etc/config\\n\"\n    # Split the file system information by newline and exclude the last two empty lines\n    filelist = fstruct.strip().split(\"\\n\")[:-2]\n    return filelist\n", "entry_point": "extract_filesystem_info", "input": "'sample_package.deb'", "output": "['/usr/bin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85955_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4493", "output": "{1, 4493}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4492", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001552", "code": "def extract_characters(input_string, slice_obj):\n    start, stop, step = slice_obj.indices(len(input_string))\n    result = [input_string[i] for i in range(start, stop, step)]\n    return result\n", "entry_point": "extract_characters", "input": "'formidable', slice(1, 5)", "output": "['o', 'r', 'm', 'i']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83319_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1413", "output": "{1, 3, 1413, 9, 471, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7433", "output": "{1, 7433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001555", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'john', 'doesmith'", "output": "'jdoesmith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001556", "code": "from typing import List, Hashable\ndef longest_consecutive_sequence(lst: List[Hashable], target: Hashable) -> int:\n    current_length = 0\n    max_length = 0\n    for element in lst:\n        if element == target:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    return max_length\n", "entry_point": "longest_consecutive_sequence", "input": "[], 'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57443_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001557", "code": "def totalNQueens(n):\n    def is_safe(board, row, col):\n        for i in range(row):\n            if board[i] == col or abs(i - row) == abs(board[i] - col):\n                return False\n        return True\n    def backtrack(board, row):\n        nonlocal count\n        if row == n:\n            count += 1\n            return\n        for col in range(n):\n            if is_safe(board, row, col):\n                board[row] = col\n                backtrack(board, row + 1)\n    count = 0\n    board = [-1] * n\n    backtrack(board, 0)\n    return count\n", "entry_point": "totalNQueens", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107753_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8783", "output": "{1, 8783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001559", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-4, -1, 0, 0, 4, 4, 10]", "output": "[-4, -1, 0, 0, 4, 4, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001560", "code": "def check_valid_string(input_str):\n    _find_ending_escapes = {\n        '(': ')',\n        '\"': '\"',\n        \"'\": \"'\",\n        '{': '}',\n    }\n    stack = []\n    for char in input_str:\n        if char in _find_ending_escapes:\n            stack.append(char)\n        elif char in _find_ending_escapes.values():\n            if not stack or _find_ending_escapes[stack.pop()] != char:\n                return False\n    return len(stack) == 0\n", "entry_point": "check_valid_string", "input": "'('", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81527_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001561", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 2, 3, 4, 5, 6]", "output": "[1, 4, 13, 16, 125, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001562", "code": "def extract_major_version(version):\n    major_version = int(version.split('.')[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'0.1'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138661_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3417", "output": "{1, 3, 67, 201, 17, 1139, 51, 3417}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001564", "code": "from collections import defaultdict\nfrom typing import Dict\ndef calculate_run_frequencies(filename: str) -> Dict[int, int]:\n    # Simulated dictionary loaded from a file\n    d = {'Run': [1, 2, 1, 3, 2, 1, 4, 3, 2, 1]}\n    runs = d['Run']  # Extract the list of run numbers\n    counts = defaultdict(lambda: 0)  # Initialize a defaultdict to store frequencies\n    for run in runs:\n        counts[run] += 1  # Update the frequency of each run number\n    return dict(counts)  # Convert the defaultdict to a regular dictionary and return\n", "entry_point": "calculate_run_frequencies", "input": "'dummy.txt'", "output": "{1: 4, 2: 3, 3: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59783_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001565", "code": "def list_operations(a):\n    a[2] = a[2] + 23\n    print(a)\n    a[0:2] = [1, 12]\n    print(a)\n    a[0:2] = []\n    print(a)\n    a[1:1] = ['bletch', 'xyzzy']\n    print(a)\n    a[:0] = a\n    print(a)\n    a[:] = []\n    print(a)\n    a.extend('ab')\n    print(a)\n    a.extend([1, 2, 33])\n    return a\n", "entry_point": "list_operations", "input": "['ignored', 'values', 0]", "output": "['a', 'b', 1, 2, 33]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68553_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001566", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'101010101010'", "output": "2730", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001567", "code": "def generate_config(index):\n    config_mapping = {\n        2: {'length_mode': 'increment', 'transmit_mode': 'single_burst', 'frame_size_step': 2000},\n        3: {'mac_dst_mode': 'increment'},\n        4: {'mac_src_mode': 'increment', 'transmit_mode': 'single_burst'},\n        5: {'l3_protocol': 'arp', 'arp_src_hw_mode': 'increment', 'arp_dst_hw_mode': 'decrement'},\n        6: {'rate_pps': 1, 'l3_protocol': 'ipv4', 'ip_src_mode': 'increment', 'ip_dst_mode': 'decrement'},\n        7: {'vlan_user_priority': '3', 'l2_encap': 'ethernet_ii_vlan', 'vlan_id_mode': 'increment'},\n        8: {'vlan': 'enable', 'l3_protocol': 'ipv4', 'ip_src_addr': '1.1.1.1', 'ip_dst_addr': '5.5.5.5',\n            'ip_dscp': '8', 'high_speed_result_analysis': 0, 'track_by': 'trackingenabled0 ipv4DefaultPhb0',\n            'ip_dscp_tracking': 1},\n        9: {'l2_encap': 'ethernet_ii', 'ethernet_value': '88CC',\n            'data_pattern': '02 07 04 00 11 97 2F 8E 80 04 07 03 00 11 97 2F 8E 82 06 02 00 78 00 00 00 00 '\n            '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'},\n        10: {'l2_encap': 'ethernet_ii', 'ethernet_value': '8809', 'data_pattern_mode': 'fixed',\n            'data_pattern': '02 07 04 00 11 97 2F 8E 80 04 07 03 00 11 97 2F 8E 82 06 02 00 78 00 00 00 00 '\n            '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'}\n    }\n    return config_mapping.get(index, {})\n", "entry_point": "generate_config", "input": "1", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70384_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001568", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[4, 5, 6, 6, 5, 1, 5, 6]", "output": "[8, 25, 12, 12, 25, 1, 25, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001569", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'0.100.1-0'", "output": "(0, 100, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001570", "code": "# Dictionary mapping route names to URL endpoints\nroute_urls = {\n    'me': '/me',\n    'put': '/users',\n    'show': '/users/<string:username>',\n    'search': '/users/search',\n    'user_news_feed': '/users/<string:uuid>/feed',\n    'follow': '/follow/<string:username>',\n    'unfollow': '/unfollow/<string:username>',\n    'followers': '/followers',\n    'following': '/following',\n    'groups': '/groups',\n    'create_group': '/groups',\n    'update_group': '/groups',\n    'delete_group': '/groups',\n    'show_group': '/groups/<string:uuid>',\n    'add_user_to_group': '/groups/<string:uuid>/add_user/<string:user_uuid>'\n}\ndef get_url_for_route(route_name):\n    return route_urls.get(route_name, 'Route not found')\n", "entry_point": "get_url_for_route", "input": "'nonexistent_route'", "output": "'Route not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44563_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001571", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "65334.7, '0.00000'", "output": "'6.53347E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001572", "code": "def calculate_product(movements):\n    x = 0\n    y = 0\n    for step in movements:\n        x += step.get('forward', 0)\n        y += step.get('down', 0)\n        y -= step.get('up', 0)\n    return x * y\n", "entry_point": "calculate_product", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33360_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001573", "code": "def max_sum_non_adjacent(lst):\n    if not lst:\n        return 0\n    include = lst[0]\n    exclude = 0\n    for i in range(1, len(lst)):\n        new_include = lst[i] + exclude\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[8, 1, 9]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144392_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001574", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'    striHe\\n'", "output": "'striHe\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001575", "code": "def sum_multiples(nums):\n    total = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[3, 5, 6]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82044_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001576", "code": "def validarCPF(cpf):\n    if len(cpf) != 14 or not cpf[:3].isdigit() or not cpf[4:7].isdigit() or not cpf[8:11].isdigit() or not cpf[12:].isdigit() or cpf[3] != '.' or cpf[7] != '.' or cpf[11] != '-':\n        return False\n    cpf_digits = [int(d) for d in cpf if d.isdigit()]\n    # Calculate first check digit\n    sum_1 = sum(cpf_digits[i] * (10 - i) for i in range(9))\n    check_digit_1 = (sum_1 * 10) % 11 if (sum_1 * 10) % 11 < 10 else 0\n    # Calculate second check digit\n    sum_2 = sum(cpf_digits[i] * (11 - i) for i in range(10))\n    check_digit_2 = (sum_2 * 10) % 11 if (sum_2 * 10) % 11 < 10 else 0\n    return check_digit_1 == cpf_digits[9] and check_digit_2 == cpf_digits[10]\n", "entry_point": "validarCPF", "input": "'123.456.789-00'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51383_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7139", "output": "{1, 7139, 649, 11, 121, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001578", "code": "def generate_form_class(template):\n    lines = template.split('\\n')\n    fields = []\n    for line in lines:\n        if line.strip().startswith('rgen_'):\n            field_name = line.split('=')[0].strip()\n            field_label = line.split('(')[1].split(',')[0].strip().strip(\"'\")\n            fields.append((field_name, field_label))\n    form_class_code = \"class AddForm(r.FlaskForm):\\n\"\n    for field_name, field_label in fields:\n        form_class_code += f\"    {field_name} = r.StringField('{field_label}', validators=[r.Length(max=r.lim.MAX_CONFIG_NAME_SIZE)])\\n\"\n    return form_class_code\n", "entry_point": "generate_form_class", "input": "''", "output": "'class AddForm(r.FlaskForm):\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102318_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001579", "code": "def update_house_users(houses, user_id):\n    modified_houses = []\n    for house in houses:\n        if house['id'] % 2 == 0:\n            house['user'] = user_id\n            modified_houses.append(house)\n    return modified_houses\n", "entry_point": "update_house_users", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60564_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001580", "code": "def map_choices_to_descriptions(choices):\n    choices_dict = {}\n    for choice, description in choices:\n        choices_dict[choice] = description\n    return choices_dict\n", "entry_point": "map_choices_to_descriptions", "input": "[('y', 'Yes'), ('n', 'No')]", "output": "{'y': 'Yes', 'n': 'No'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115679_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001581", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9644", "output": "{1, 2, 4, 2411, 9644, 4822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9643", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001582", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[1, 1, 3, 1, 2, 1, 2, 1, 1]", "output": "[1, 1, 3, 1, 2, 1, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001583", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "16", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001584", "code": "def sum_multiples_of_3_or_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[6, 10]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69053_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001585", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[3, 3, 1, 2]", "output": "{3: 2, 1: 1, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001586", "code": "def parse_config(config_snippet: str) -> dict:\n    settings = {}\n    lines = config_snippet.split('\\n')\n    for line in lines:\n        if '=' in line:\n            setting, value = line.split('=', 1)\n            setting = setting.strip().split('.')[-1]\n            value = value.strip()\n            if value.isdigit():\n                value = int(value)\n            elif value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            settings[setting] = value\n    return settings\n", "entry_point": "parse_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123614_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1910", "output": "{1, 2, 5, 10, 1910, 955, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1909", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001588", "code": "import json\ndef michelson_to_micheline(michelson_code):\n    instructions = michelson_code.split(';')\n    micheline = []\n    for instruction in instructions:\n        parts = instruction.strip().split()\n        if parts:\n            prim = parts[0]\n            args = []\n            for part in parts[1:]:\n                if part.isdigit():\n                    args.append({\"int\": part})\n                else:\n                    args.append(part)\n            micheline.append({\"prim\": prim, \"args\": args})\n    return json.dumps(micheline, indent=4)\n", "entry_point": "michelson_to_micheline", "input": "''", "output": "'[]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107623_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001589", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9092", "output": "{1, 2, 4546, 9092, 4, 2273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9091", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001590", "code": "def find_restriction_sites(dna_sequence, pattern):\n    positions = []\n    pattern_length = len(pattern)\n    for i in range(len(dna_sequence) - pattern_length + 1):\n        if dna_sequence[i:i+pattern_length] == pattern:\n            positions.append(i)\n    return positions\n", "entry_point": "find_restriction_sites", "input": "'', 'ATCG'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16370_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001591", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    a, b = 0, 1\n    fib_sum = a\n    for _ in range(1, n):\n        a, b = b, a + b\n        fib_sum += a\n    return fib_sum\n", "entry_point": "fibonacci_sum", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117189_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001592", "code": "def process_migrations(dependencies, operations):\n    graph = {}\n    for dependency in dependencies:\n        if dependency[1] not in graph:\n            graph[dependency[1]] = []\n        graph[dependency[1]].append(dependency[0])\n    def dfs(node, visited, stack):\n        visited.add(node)\n        if node in graph:\n            for neighbor in graph[node]:\n                if neighbor not in visited:\n                    dfs(neighbor, visited, stack)\n        stack.append(node)\n    visited = set()\n    stack = []\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node, visited, stack)\n    final_operations = []\n    for migration_file in reversed(stack):\n        for operation in operations:\n            if migration_file in str(operation):\n                final_operations.append(operation)\n    return final_operations\n", "entry_point": "process_migrations", "input": "[], ['operation1', 'operation2']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25360_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001593", "code": "def process_buttons(buttons):\n    if buttons is None:\n        return None\n    try:\n        if buttons.SUBCLASS_OF_ID == 0xe2e10ef2:\n            return buttons\n    except AttributeError:\n        pass\n    if not isinstance(buttons, list):\n        buttons = [[buttons]]\n    elif not isinstance(buttons[0], list):\n        buttons = [buttons]\n    is_inline = False\n    is_normal = False\n    rows = []\n    return buttons, is_inline, is_normal, rows\n", "entry_point": "process_buttons", "input": "[3, 1, 4, 2, 3, 2, 1]", "output": "([[3, 1, 4, 2, 3, 2, 1]], False, False, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147264_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001594", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[1, 4, 11, 20, 38, 49]", "output": "'1, 4, 11, 20, 38, 49'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001595", "code": "from typing import List\ndef calculate_accuracy(test_results: List[int]) -> float:\n    num_reads = 0\n    num_correct = 0\n    for result in test_results:\n        num_reads += 1\n        if result == 1:\n            num_correct += 1\n    if num_reads == 0:\n        return 0.0\n    else:\n        return (num_correct / num_reads) * 100\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 1, 1, 1, 0, 0, 0]", "output": "62.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10794_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001596", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001597", "code": "from typing import List\ndef process_transcript(transcript: str, stop_words: List[str], symbols: str) -> List[str]:\n    final_transcript = []\n    for word in transcript.split():\n        for symbol in symbols:\n            word = word.replace(symbol, '')\n        word = word.lower()\n        if word not in stop_words:\n            final_transcript.append(word)\n    return final_transcript\n", "entry_point": "process_transcript", "input": "'SConme!', ['the', 'is', 'in'], '!'", "output": "['sconme']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146492_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001598", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "4, 4.75", "output": "9.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001599", "code": "import re\n# Regular expression pattern\npattern = r'^gfs\\.t(?P<hour>\\d{2})z\\.pgrb2\\.1p00\\.f(?P<fhour>\\d{3})\\.(?P<runDTG>\\d{8})$'\n# JSON schema\nschema = {\n    \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"hour\": { \"type\": \"string\" },\n        \"fhour\": { \"type\": \"string\" },\n        \"runDTG\": { \"type\": \"string\" }\n    }\n}\ndef validate_filename(filename):\n    match = re.match(pattern, filename)\n    if not match:\n        return False\n    extracted_data = match.groupdict()\n    for key in extracted_data:\n        if key not in schema['properties'] or not isinstance(extracted_data[key], str):\n            return False\n    return True\n", "entry_point": "validate_filename", "input": "'gfs.t123abc.pgrb2.1p00.f123.20210101'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60431_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001600", "code": "from typing import List\ndef extract_comments(script: str) -> List[str]:\n    comments = []\n    for line in script.split('\\n'):\n        line = line.strip()\n        if line.startswith('#'):\n            comments.append(line)\n        elif '#' in line:\n            comments.append(line[line.index('#'):].strip())\n    return comments\n", "entry_point": "extract_comments", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26986_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2899", "output": "{1, 2899, 13, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001602", "code": "import socket\ndef check_service(port: int, service_check: str) -> bool:\n    try:\n        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n            s.settimeout(5)  # Set a timeout for the connection attempt\n            s.connect(('localhost', port))\n            print(f\"Service '{service_check}' is reachable on port {port}\")\n            return True\n    except (socket.timeout, ConnectionRefusedError):\n        return False\n", "entry_point": "check_service", "input": "9999, 'Test Service'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127559_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001603", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[4, 5, 4, 5, 4, 3, 6]", "output": "[6, 5, 5, 4, 4, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001604", "code": "def days_in_month(year, month):\n    if month == 2:\n        if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0):\n            return 29  # February in a leap year\n        else:\n            return 28  # February in a non-leap year\n    elif month in [4, 6, 9, 11]:\n        return 30\n    else:\n        return 31\n", "entry_point": "days_in_month", "input": "2023, 1", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41653_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001605", "code": "def sum_even_fibonacci(limit):\n    fib_sequence = [1, 1]\n    even_sum = 0\n    while True:\n        next_fib = fib_sequence[-1] + fib_sequence[-2]\n        if next_fib > limit:\n            break\n        fib_sequence.append(next_fib)\n    for num in fib_sequence:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "4000000", "output": "4613732", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66929_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9281", "output": "{9281, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001607", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/tmp/image.j', 'g'", "output": "'/tmp/image.j/g'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001608", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> int:\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score)\n", "entry_point": "calculate_average_score", "input": "[80, 82, 85, 80, 81]", "output": "82", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63343_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001609", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "17", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001610", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "'Teehe'", "output": "['Teehe']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001611", "code": "def calculate_average_grades(grades):\n    average_grades = {}\n    for student_grades in grades:\n        for student, grades_list in student_grades.items():\n            if grades_list:\n                average_grade = sum(grades_list) / len(grades_list)\n            else:\n                average_grade = 0\n            average_grades[student] = average_grade\n    return average_grades\n", "entry_point": "calculate_average_grades", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32141_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001612", "code": "def extract_package_names(setup_script):\n    package_names = []\n    for line in setup_script.split('\\n'):\n        if 'find_packages' in line:\n            start_index = line.find('include=') + len('include=[')\n            end_index = line.find(']', start_index)\n            packages_content = line[start_index:end_index]\n            package_names = [pkg.strip().strip('\"') for pkg in packages_content.split(',')]\n            break\n    return package_names\n", "entry_point": "extract_package_names", "input": "'find_packages(include=[\"testbedlib\"])'", "output": "['testbedlib']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114048_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001613", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001614", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[84.25]", "output": "84.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81933_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001615", "code": "from typing import List\ndef anonymize_strings(strings: List[str]) -> List[str]:\n    anonymized_strings = []\n    for string in strings:\n        anonymized_string = string[0] + '*' * (len(string) - 2) + string[-1]\n        anonymized_strings.append(anonymized_string)\n    return anonymized_strings\n", "entry_point": "anonymize_strings", "input": "['welded']", "output": "['w****d']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44127_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001616", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "14, 0", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001617", "code": "import re\ndef validate_username(username):\n    pattern = r\"^\\w(\\w| )*\\w$\"  # Regular expression pattern for username validation\n    return bool(re.match(pattern, username))\n", "entry_point": "validate_username", "input": "'User Name'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79782_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001618", "code": "def longest_positive_sequence(lst):\n    max_length = 0\n    current_length = 0\n    for num in lst:\n        if num > 0:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    max_length = max(max_length, current_length)  # Check the last sequence\n    return max_length\n", "entry_point": "longest_positive_sequence", "input": "[1, 2, 3, 4, -1, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95331_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001619", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7675", "output": "{1, 5, 307, 25, 7675, 1535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7674", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001620", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'33.5.1.0.3'", "output": "'33.5.1.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001621", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[102, 92, 85, 76, 56]", "output": "[102, 92, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001622", "code": "def find_special_pairs(numbers):\n    count = 0\n    delta = len(numbers) // 2\n    for i in range(len(numbers)):\n        bi = (i + delta) % len(numbers)\n        if numbers[i] == numbers[bi]:\n            count += 1\n    return count\n", "entry_point": "find_special_pairs", "input": "[1, 2, 1, 2, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102357_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001623", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[2, 9, 2, 2, 1, 1, 2, 1], 1", "output": "[[2], [9], [2], [2], [1], [1], [2], [1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001624", "code": "def padding_zeroes(result, num_digits: int):\n    str_result = str(result)\n    # Check if the input number contains a decimal point\n    if '.' in str_result:\n        decimal_index = str_result.index('.')\n        decimal_part = str_result[decimal_index + 1:]\n        padding_needed = num_digits - len(decimal_part)\n        str_result += \"0\" * padding_needed\n    else:\n        str_result += '.' + \"0\" * num_digits\n    return str_result[:str_result.index('.') + num_digits + 1]\n", "entry_point": "padding_zeroes", "input": "3.14, 3", "output": "'3.140'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26190_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001625", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[10, 15, 13]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001626", "code": "def format_numbers(numbers):\n    formatted_numbers = []\n    for num in numbers:\n        formatted_num = \"{:5.1f}\".format(num)[:5]  # Apply formatting rules\n        formatted_numbers.append(formatted_num)\n    return ' '.join(formatted_numbers)\n", "entry_point": "format_numbers", "input": "[3.1, 123.5, 1.9, 3.1]", "output": "'  3.1 123.5   1.9   3.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116002_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001627", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[81, 81, 79, 76, 70]", "output": "[81, 79, 76]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001628", "code": "def extract_digits(str_input):\n    final_str = \"\"\n    for char in str_input:\n        if char.isdigit():  # Check if the character is a digit\n            final_str += char\n    return final_str\n", "entry_point": "extract_digits", "input": "'abc1def2gh3ij6kl'", "output": "'1236'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132906_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001629", "code": "def get_aws_service_endpoint(region):\n    region_string = region.lower()\n    if region_string.startswith(\"cn-\"):\n        return \"aws-cn\"\n    elif region_string.startswith(\"us-gov\"):\n        return \"aws-us-gov\"\n    else:\n        return \"aws\"\n", "entry_point": "get_aws_service_endpoint", "input": "'us-west-1'", "output": "'aws'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70670_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001630", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "0, 14, 1", "output": "28.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001631", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "4.135698123, 6", "output": "4.135698", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001632", "code": "def common_substring(s1, s2):\n    i, j = 0, 0\n    while i < len(s1) and j < len(s2):\n        if s1[i] == s2[j]:\n            i += 1\n            j += 1\n        else:\n            if len(s1) > len(s2):\n                i += 1\n            else:\n                j += 1\n    return i == len(s1) and j == len(s2)\n", "entry_point": "common_substring", "input": "'abc', 'def'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48581_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001633", "code": "from typing import List\ndef diagonal_difference(matrix: List[List[int]]) -> int:\n    primary_sum = 0\n    secondary_sum = 0\n    n = len(matrix)\n    for i in range(n):\n        primary_sum += matrix[i][i]\n        secondary_sum += matrix[i][n - i - 1]\n    return abs(primary_sum - secondary_sum)\n", "entry_point": "diagonal_difference", "input": "[[0, 0], [0, 0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105403_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001634", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(len(lst) - 1):\n        total_diff += abs(lst[i] - lst[i + 1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 9, 0]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132641_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3854", "output": "{1, 2, 1927, 41, 3854, 47, 82, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001636", "code": "import re\ndef extract_image_urls(html_content):\n    image_urls = set()\n    # Find image URLs in Markdown syntax ![alt text](image_url)\n    markdown_images = re.findall(r'!\\[([^\\]]+)?\\]\\(([^\\)]+)\\)', html_content)\n    image_urls.update(url for alt, url in markdown_images)\n    # Find image URLs in HTML image tags <img src=\"image_url\" alt=\"alt text\">\n    html_images = re.findall(r'<\\s*img[^>]+>\\s*src\\s*=\\\"([^\"]+)\\\"', html_content)\n    image_urls.update(html_images)\n    # Find image URLs in custom format web+graphie:https://example.com/custom_image.png\n    custom_images = re.findall(r'web\\+graphie:([^\\)]+)', html_content)\n    image_urls.update(custom_images)\n    return list(image_urls)\n", "entry_point": "extract_image_urls", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51962_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001637", "code": "_HORNS_       = 0\n_SIDEBANDS_   = 1\n_FREQUENCY_   = 2\n_TIME_        = 3\n_COMAPDATA_ = {'spectrometer/tod': [_HORNS_, _SIDEBANDS_, _FREQUENCY_, _TIME_],\n               'spectrometer/MJD': [_TIME_],\n               'spectrometer/pixel_pointing/pixel_ra': [_HORNS_, _TIME_],\n               'spectrometer/pixel_pointing/pixel_dec': [_HORNS_, _TIME_],\n               'spectrometer/pixel_pointing/pixel_az': [_HORNS_, _TIME_],   \n               'spectrometer/pixel_pointing/pixel_el': [_HORNS_, _TIME_],\n               'spectrometer/frequency': [_SIDEBANDS_, _FREQUENCY_],\n               'spectrometer/time_average': [_HORNS_, _SIDEBANDS_, _FREQUENCY_],\n               'spectrometer/band_average': [_HORNS_, _SIDEBANDS_, _TIME_],\n               'spectrometer/bands': [_SIDEBANDS_],\n               'spectrometer/feeds': [_HORNS_]}\ndef process_data_file(data_path):\n    return _COMAPDATA_.get(data_path, \"Data path not found\")\n", "entry_point": "process_data_file", "input": "'invalid/path'", "output": "'Data path not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117446_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001638", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 4, 3, 0, -1, 2, 0]", "output": "[2, 5, 5, 3, 3, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001639", "code": "def perform_operation(operation=\"add\", operand1=0, operand2=0):\n    if operation == \"add\":\n        return operand1 + operand2\n    elif operation == \"subtract\":\n        return operand1 - operand2\n    elif operation == \"multiply\":\n        return operand1 * operand2\n    elif operation == \"divide\":\n        if operand2 != 0:\n            return operand1 / operand2\n        else:\n            return \"Error: Division by zero\"\n    else:\n        return \"Error: Invalid operation\"\n", "entry_point": "perform_operation", "input": "'modulus'", "output": "'Error: Invalid operation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52158_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001640", "code": "def sum_of_even_squares(n):\n    sum_of_squares = 0\n    for i in range(2, n + 1, 2):  # Iterate over even numbers from 2 to n\n        sum_of_squares += i ** 2  # Add the square of the current even number to the sum\n    return sum_of_squares\n", "entry_point": "sum_of_even_squares", "input": "8", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51931_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001641", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study1234_.txt'", "output": "(1234, '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001642", "code": "def filter_tuples(input_list):\n    filtered_list = []\n    for tup in input_list:\n        if tup[0] > tup[1]:\n            filtered_list.append(tup)\n    return filtered_list\n", "entry_point": "filter_tuples", "input": "[(2, 5), (5, 2), (8, 10), (10, 8)]", "output": "[(5, 2), (10, 8)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67193_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9354", "output": "{1, 2, 3, 4677, 6, 9354, 3118, 1559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001644", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'is is a etth'", "output": "'is-is-a-etth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001645", "code": "from typing import List, Tuple\ndef find_pairs(lst: List[int], target_sum: int) -> List[Tuple[int, int]]:\n    seen_pairs = {}\n    result = []\n    for num in lst:\n        complement = target_sum - num\n        if complement in seen_pairs:\n            result.append((num, complement))\n        seen_pairs[num] = True\n    return result\n", "entry_point": "find_pairs", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13694_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001646", "code": "def removeElement(nums, val):\n    \"\"\"\n    :type nums: List[int]\n    :type val: int\n    :rtype: int\n    \"\"\"\n    nums[:] = [num for num in nums if num != val]\n    return len(nums)\n", "entry_point": "removeElement", "input": "[1, 2, 2, 4, 5, 6, 7, 8, 3, 3], 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53354_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001647", "code": "def filter_books_by_year(books, year_threshold):\n    filtered_books = []\n    for book in books:\n        if book['year'] >= year_threshold:\n            filtered_books.append(book)\n    return filtered_books\n", "entry_point": "filter_books_by_year", "input": "[], 2000", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125466_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001648", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7429", "output": "{1, 323, 7429, 391, 17, 19, 437, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001649", "code": "def sum_even_fibonacci(limit):\n    fib_sequence = [0, 1]\n    even_sum = 0\n    while True:\n        next_fib = fib_sequence[-1] + fib_sequence[-2]\n        if next_fib > limit:\n            break\n        fib_sequence.append(next_fib)\n    for num in fib_sequence:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001650", "code": "import re\nfrom typing import List\ndef extract_patterns(input_str: str) -> List[str]:\n    pattern = r'\"(.*?)\"'  # Regular expression pattern to match substrings within double quotes\n    return re.findall(pattern, input_str)\n", "entry_point": "extract_patterns", "input": "'\"\" \"\"'", "output": "['', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69903_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001651", "code": "import os\ndef delete_pyc_files(rootdir):\n    found = removed = 0\n    for dirpath, dirnames, filenames in os.walk(rootdir):\n        for filename in filenames:\n            if filename.endswith('.pyc'):\n                file_path = os.path.join(dirpath, filename)\n                os.remove(file_path)\n                removed += 1\n                found += 1\n    return found, removed\n", "entry_point": "delete_pyc_files", "input": "'/empty/directory/path'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8739_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001652", "code": "def generate_urls(view_names):\n    app_name = 'projects'\n    urls = {}\n    for view_name in view_names:\n        url_path = f'/{app_name}/{view_name}/'\n        urls[view_name] = url_path\n    return urls\n", "entry_point": "generate_urls", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136062_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8706", "output": "{1, 8706, 3, 2, 4353, 6, 1451, 2902}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8705", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001654", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9831", "output": "{1, 3, 9831, 3277, 113, 339, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001655", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[9, 9, 8, 8, 4, 4]", "output": "[9, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001656", "code": "import re\ndef process_text(input_text):\n    transformations = [\n        (r', }}, ', '}}, '),\n        (r'}}, ', '}}, '),\n        (r'\", {\"', '}}, {\"'),\n        (r'\"}}, {\"', '}}, {\"'),\n        (r'\\n\\n', '\\n'),\n        (r'\\n', ''),\n        (r'}\\n(.+\\n(?!{))+(.+\\n(?={))*?', '}\\n'),\n        (r'[a-z_]+\\n{\\n}\\n', ''),\n        (r'(begin_new_match) ?\\n{ ?\\n} ?', r'\\1\\n{\\n \\1: \\1\\n}'),\n        (r':  ', ': \"None\"')\n    ]\n    processed_text = input_text\n    for pattern, replacement in transformations:\n        processed_text = re.sub(pattern, replacement, processed_text)\n    return processed_text\n", "entry_point": "process_text", "input": "'texline\\n,\\nt,\\n'", "output": "'texline,t,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109568_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001657", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return 0\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79079_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001658", "code": "def build_command(cmd, shell, options):\n    becomecmd = options.get('become_exe', 'default_exe')\n    flags = options.get('become_flags', '')\n    become_pass = options.get('become_pass', False)\n    user = options.get('become_user', '')\n    if become_pass:\n        prompt = '[dzdo via ansible, key=%s] password:' % options.get('_id', 'default_id')\n        flags = '%s -p \"%s\"' % (flags.replace('-n', ''), prompt)\n    user = '-u %s' % user if user else ''\n    return ' '.join([becomecmd, flags, user, cmd])\n", "entry_point": "build_command", "input": "'ls', None, {}", "output": "'default_exe   ls'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18658_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001659", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6143", "output": "{1, 6143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001660", "code": "import importlib.util\ndef check_module(module_name):\n    spec = importlib.util.find_spec(module_name)\n    return spec is not None\n", "entry_point": "check_module", "input": "'non_existent_module'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107579_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001661", "code": "def tidy_objects(objects):\n    pushed_objects = []\n    for obj_name, in_container in objects:\n        if not in_container:\n            pushed_objects.append(obj_name)\n    return pushed_objects\n", "entry_point": "tidy_objects", "input": "[('object1', True), ('object2', True)]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141612_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001662", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "12", "output": "[0, 1, 1, 1, 2, 3, 6, 9, 15, 135, 150, 285]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001663", "code": "from typing import List\ndef card_game_winner(player1: List[int], player2: List[int]) -> str:\n    score_player1 = 0\n    score_player2 = 0\n    for card1, card2 in zip(player1, player2):\n        if card1 > card2:\n            score_player1 += 1\n        elif card2 > card1:\n            score_player2 += 1\n    if score_player1 > score_player2:\n        return \"Player 1\"\n    elif score_player2 > score_player1:\n        return \"Player 2\"\n    else:\n        return \"Draw\"\n", "entry_point": "card_game_winner", "input": "[1, 2, 3], [2, 3, 4]", "output": "'Player 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56310_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001664", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "153", "output": "{1, 3, 9, 17, 51, 153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001665", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[0, 1, 2, 3, 1, 2]", "output": "[0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001666", "code": "def generate_unique_table_name(existing_table_names):\n    numeric_suffixes = [int(name.split(\"_\")[-1]) for name in existing_table_names]\n    unique_suffix = 1\n    while unique_suffix in numeric_suffixes:\n        unique_suffix += 1\n    return f\"table_name_{unique_suffix}\"\n", "entry_point": "generate_unique_table_name", "input": "['table_name_1']", "output": "'table_name_2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94699_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001667", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'gsesers.some.module.Sersesfig'", "output": "('gsesers', 'Sersesfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001668", "code": "import json\ndef combine(data: dict, extra):\n    res = dict()\n    for c, val in data.items():\n        res[c] = {extra: val}\n    return res\n", "entry_point": "combine", "input": "{}, None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37802_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001669", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'Thisesxae'", "output": "'Thisesxae'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001670", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "5, 4, 0", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001671", "code": "def count_ways_to_climb_stairs(n):\n    if n == 0 or n == 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68008_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001672", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9484", "output": "{1, 2, 2371, 4, 4742, 9484}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9483", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001673", "code": "def sum_validated_data(list_data_for_valid):\n    total_sum = 0\n    for data in list_data_for_valid:\n        try:\n            num = float(data)\n            total_sum += num\n        except ValueError:\n            total_sum += 0\n    return total_sum\n", "entry_point": "sum_validated_data", "input": "['10', '8', '4', '2', 'invalid1', 'invalid2']", "output": "24.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19932_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001674", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[[7], [5], [1], [8, 2], [6], [8], [3], [8]]", "output": "[7, 5, 1, 8, 2, 6, 8, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001675", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 1, 3, 0, 1, 2, 4]", "output": "[3, 2, 5, 3, 5, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001676", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 1 or n == 2:\n        return 1\n    else:\n        result = fibonacci_memo(n - 1, memo) + fibonacci_memo(n - 2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33770_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001677", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[5, -2, -1, -3, 3, 8]", "output": "[5, -1, 1, 0, 7, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001678", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[4, 6]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123958_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001679", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[5, 1, 2, 9, 5, 6]", "output": "[1, 2, 5, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001680", "code": "import math\ndef close_enough(a, b, count_error):\n    absolute_difference = math.fabs(a - b)\n    threshold = math.fabs((a + b) / (count_error * 2))\n    return absolute_difference < threshold\n", "entry_point": "close_enough", "input": "4, 5, 1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2686_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001681", "code": "def max_profit(prices):\n    buy1 = buy2 = float('-inf')\n    sell1 = sell2 = 0\n    for price in prices:\n        buy1 = max(buy1, -price)\n        sell1 = max(sell1, buy1 + price)\n        buy2 = max(buy2, sell1 - price)\n        sell2 = max(sell2, buy2 + price)\n    return max(sell1, sell2)\n", "entry_point": "max_profit", "input": "[2, 4, 1, 7, 6, 10]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144710_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4609", "output": "{1, 11, 419, 4609}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001683", "code": "def max_consecutive_same_items(nums):\n    max_consecutive = 0\n    current_num = None\n    consecutive_count = 0\n    for num in nums:\n        if num == current_num:\n            consecutive_count += 1\n        else:\n            current_num = num\n            consecutive_count = 1\n        max_consecutive = max(max_consecutive, consecutive_count)\n    return max_consecutive\n", "entry_point": "max_consecutive_same_items", "input": "[1, 2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138973_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001684", "code": "def is_pangram(text):\n    # Convert the input text to lowercase\n    text_lower = text.lower()\n    # Create a set of unique lowercase alphabets present in the input text\n    unique_letters = {letter for letter in text_lower if letter.isalpha()}\n    # Check if the length of the set of lowercase alphabets is equal to 26\n    return len(unique_letters) == 26\n", "entry_point": "is_pangram", "input": "'The quick brown fox jumps over the lazy dog'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18076_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001685", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7759", "output": "{1, 7759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001686", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001687", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'ae: '", "output": "{'ae': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001688", "code": "def transform_to_dict_list(batch_dict):\n    # Create dict_batch with keys from the first dictionary in batch_dict\n    keys = batch_dict[0].keys()\n    dict_batch = dict.fromkeys(keys)\n    for k in keys:\n        dict_batch[k] = list()\n    # Populate dict_batch with values from batch_dict\n    for bat in batch_dict:\n        for k, v in bat.items():\n            dict_batch[k].append(v)\n    return dict_batch\n", "entry_point": "transform_to_dict_list", "input": "[{}]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85253_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001689", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[88, 88], 2", "output": "88.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75916_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001690", "code": "import re\nfrom collections import Counter\ndef is_isogram(word):\n    if not isinstance(word, str) or word == '':\n        return False\n    cleaned_word = re.sub('[^a-z]', '', word.lower())\n    unique_counts = {count for letter, count in Counter(cleaned_word).most_common()}\n    return len(unique_counts) == 1\n", "entry_point": "is_isogram", "input": "'hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10113_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001691", "code": "def sum_multiples_3_or_5(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_or_5", "input": "20", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36151_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001692", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "18, 6", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001693", "code": "def filter_comments_by_rating(comments, threshold):\n    filtered_authors = set()\n    for comment in comments:\n        if comment['star'] < threshold:\n            filtered_authors.add(comment['author'])\n    return list(filtered_authors)\n", "entry_point": "filter_comments_by_rating", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53891_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001694", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'1.', '1.'", "output": "{'1.': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001695", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[4, 0, 1, 2, 2, 2, 1, 7, 2]", "output": "[4, 1, 3, 5, 6, 7, 7, 14, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001696", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tadtttasks=ddtaskssks'", "output": "{'field': 'tadtttasks', 'value': 'ddtaskssks'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001697", "code": "def map_rule_name_to_value(rule_name):\n    rule_mapping = {\n        \"RULE_pi\": 3,\n        \"RULE_theta\": 4,\n        \"RULE_freezeTime\": 5,\n        \"RULE_timeVarDecl\": 6,\n        \"RULE_objVarDecl\": 7,\n        \"RULE_varList\": 8,\n        \"RULE_interval\": 9,\n        \"RULE_funcBB\": 10,\n        \"RULE_funcAreaTau\": 11,\n        \"RULE_funcRatioAreaTau\": 12,\n        \"RULE_funcDist\": 13,\n        \"RULE_funcLatDist\": 14,\n        \"RULE_funcLonDist\": 15,\n        \"RULE_funcRatioLatLon\": 16,\n        \"RULE_funcAreaTheta\": 17\n    }\n    return rule_mapping.get(rule_name, -1)\n", "entry_point": "map_rule_name_to_value", "input": "'RULE_unknown'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137133_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001698", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "12", "output": "'XII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001699", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[4, 4, 3, 2, 1, 1]", "output": "[4, 4, 3, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2979", "output": "{1, 993, 3, 2979, 9, 331}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001701", "code": "def calculate_dot_product(vector1, vector2):\n    dot_product = 0\n    for i in range(len(vector1)):\n        dot_product += vector1[i] * vector2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[2, 3, 4], [10, 10, 5]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3479_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001702", "code": "def is_allowed(action, obj):\n    allowed_actions = ['read', 'write', 'entrust', 'move', 'transmute', 'derive', 'develop']\n    if action in allowed_actions:\n        return True\n    else:\n        return False\n", "entry_point": "is_allowed", "input": "'delete', None", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40722_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2951", "output": "{1, 227, 13, 2951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001704", "code": "def parse_key_value(code_snippet):\n    key_values = {}\n    key = None\n    value = None\n    # Remove unnecessary characters and split by comma\n    pairs = code_snippet.replace('duree.write(', '').replace('\"', '').replace('+', '').replace(':', '').replace(',', '').split()\n    for pair in pairs:\n        if pair.isalpha():\n            key = pair\n        elif pair.isdigit():\n            value = pair\n            if key and value:\n                key_values[key] = value\n                key = None\n                value = None\n    return key_values\n", "entry_point": "parse_key_value", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11647_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001705", "code": "import ast\ndef count_imported_modules(script):\n    tree = ast.parse(script)\n    imported_modules = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imported_modules.add(alias.name)\n        elif isinstance(node, ast.ImportFrom):\n            imported_modules.add(node.module)\n    return len(imported_modules)\n", "entry_point": "count_imported_modules", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127978_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001706", "code": "def f(bar):\n    # type: (Union[str, bytearray]) -> str\n    if isinstance(bar, bytearray):\n        return bar.decode('utf-8')  # Convert bytearray to string\n    elif isinstance(bar, str):\n        return bar  # Return the input string as is\n    else:\n        raise TypeError(\"Input must be a string or bytearray\")\n", "entry_point": "f", "input": "'Hello'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47415_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001707", "code": "from collections import deque\ndef min_moves_to_win(N, ladders, snakes):\n    visited = set()\n    queue = deque([(1, 0)])  # Start from cell 1 with 0 moves\n    while queue:\n        current_cell, moves = queue.popleft()\n        if current_cell == N:\n            return moves\n        for i in range(1, 7):  # Dice roll from 1 to 6\n            new_cell = current_cell + i\n            if new_cell in ladders:\n                new_cell = ladders[new_cell]  # Climb the ladder\n            elif new_cell in snakes:\n                new_cell = snakes[new_cell]  # Slide down the snake\n            if new_cell <= N and new_cell not in visited:\n                visited.add(new_cell)\n                queue.append((new_cell, moves + 1))\n    return -1\n", "entry_point": "min_moves_to_win", "input": "2, {}, {}", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13443_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001708", "code": "def html_reverse_escape(string):\n    '''Reverse escapes HTML code in string into ASCII text.'''\n    return string.replace(\"&amp;\", \"&\").replace(\"&#39;\", \"'\").replace(\"&quot;\", '\"')\n", "entry_point": "html_reverse_escape", "input": "'I&apo&#39;grea&amp; happy'", "output": "\"I&apo'grea& happy\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68510_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001709", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "5, 9", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001710", "code": "def is_valid_time(time_str):\n    parts = time_str.split(':')\n    if len(parts) != 3:\n        return False\n    try:\n        hours, minutes, seconds = map(int, parts)\n    except ValueError:\n        return False\n    if not (0 <= hours <= 23 and 0 <= minutes <= 59 and 0 <= seconds <= 59):\n        return False\n    return True\n", "entry_point": "is_valid_time", "input": "'12:60:00'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99486_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001711", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 10]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36407_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001712", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[5, -1, 2, 6, 5, 1, 3, 0, 4, 2, 3]", "output": "[-1, 6, 1, 0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001713", "code": "from collections import Counter\ndef find_most_common_element(lst):\n    count = Counter(lst)\n    max_freq = max(count.values())\n    for num in lst:\n        if count[num] == max_freq:\n            return num\n", "entry_point": "find_most_common_element", "input": "[6, 6, 6, 6, 2, 2, 3]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135199_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001714", "code": "import math\ndef calculate_distance(point_a, point_b):\n    x_diff = point_b[0] - point_a[0]\n    y_diff = point_b[1] - point_a[1]\n    z_diff = point_b[2] - point_a[2]\n    distance = math.sqrt(x_diff**2 + y_diff**2 + z_diff**2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0, 0), (6, 0, 0)", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94468_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001715", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2344", "output": "{1, 2, 4, 293, 2344, 8, 586, 1172}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2343", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001716", "code": "def min_eggs_needed(egg_weights, n):\n    dp = [float('inf')] * (n + 1)\n    dp[0] = 0\n    for w in range(1, n + 1):\n        for ew in egg_weights:\n            if w - ew >= 0:\n                dp[w] = min(dp[w], dp[w - ew] + 1)\n    return dp[n]\n", "entry_point": "min_eggs_needed", "input": "[1], 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108972_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6427", "output": "{1, 6427}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001718", "code": "import re\ndef parse_parameters(code_snippet):\n    parameters = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        match = re.search(r'\\b(\\w+)\\s*=\\s*(.+)', line)\n        if match:\n            key = match.group(1)\n            value = match.group(2).split('#')[0].strip()\n            parameters[key] = value\n    return parameters\n", "entry_point": "parse_parameters", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143584_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001719", "code": "def tracklist(data):\n    track_dict = {}\n    if not data:\n        return track_dict\n    for entry in data.split('\\n'):\n        parts = entry.split(' - ')\n        if len(parts) == 2:\n            song_name, artist_name = parts\n            track_dict[song_name.strip()] = artist_name.strip()\n    return track_dict\n", "entry_point": "tracklist", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140589_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001720", "code": "def calculate_median(numbers):\n    sorted_numbers = sorted(numbers)\n    length = len(sorted_numbers)\n    if length % 2 == 1:  # Odd number of elements\n        return sorted_numbers[length // 2]\n    else:  # Even number of elements\n        mid = length // 2\n        return (sorted_numbers[mid - 1] + sorted_numbers[mid]) / 2\n", "entry_point": "calculate_median", "input": "[1, 2, 3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63244_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001721", "code": "from typing import List\ndef minTime(machines: List[int], goal: int) -> int:\n    def countItems(machines, days):\n        total = 0\n        for machine in machines:\n            total += days // machine\n        return total\n    low = 1\n    high = max(machines) * goal\n    while low < high:\n        mid = (low + high) // 2\n        if countItems(machines, mid) < goal:\n            low = mid + 1\n        else:\n            high = mid\n    return low\n", "entry_point": "minTime", "input": "[1, 2], 4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117103_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001722", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'Rollback'", "output": "'Rollback'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1743", "output": "{1, 3, 581, 7, 1743, 83, 21, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1742", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001724", "code": "from typing import List\ndef count_unique_activations(activations: List[str]) -> int:\n    unique_activations = set()\n    for activation in activations:\n        unique_activations.add(activation)\n    return len(unique_activations)\n", "entry_point": "count_unique_activations", "input": "['apple', 'banana', 'orange']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3690_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001725", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[10, 10, 10, 10, 10, 10, 10, 4], 4", "output": "296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001726", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, -1, -2, -3, -4]", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001727", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 3  # Multiply the last added element by 3\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 22, 22, 40, 40]", "output": "[6, 24, 24, 42, 42]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82460_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001728", "code": "def extract_public_key(pgp_key):\n    start_index = pgp_key.find(\"-----BEGIN PGP PUBLIC KEY BLOCK-----\") + len(\"-----BEGIN PGP PUBLIC KEY BLOCK-----\")\n    end_index = pgp_key.find(\"-----END PGP PUBLIC KEY BLOCK-----\")\n    if start_index == -1 or end_index == -1:\n        return \"Invalid PGP public key format\"\n    public_key_content = pgp_key[start_index:end_index].strip()\n    return public_key_content\n", "entry_point": "extract_public_key", "input": "'Some random text'", "output": "'Invalid PGP public key format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25267_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001729", "code": "def validate_oid(oid: str) -> bool:\n    integers = oid.split('.')\n    if len(integers) < 2:\n        return False\n    if not (0 <= int(integers[0]) <= 2 and 0 <= int(integers[1]) <= 39):\n        return False\n    for num in integers[2:]:\n        if not (0 <= int(num) <= 2**64 - 1):\n            return False\n    return True\n", "entry_point": "validate_oid", "input": "'2.40'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130249_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001730", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[2, 4, 8]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108446_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001731", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[-90, -90, -90], 3", "output": "-90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001732", "code": "import os\ndef extract_file_info(directory):\n    file_info = {}\n    for root, _, files in os.walk(directory):\n        for file in files:\n            file_path = os.path.join(root, file)\n            file_name, file_extension = os.path.splitext(file)\n            if file_extension:\n                file_extension = file_extension[1:]  # Remove the leading dot\n                if file_extension not in file_info:\n                    file_info[file_extension] = []\n                file_info[file_extension].append(file_name)\n    return file_info\n", "entry_point": "extract_file_info", "input": "'empty_dir'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001733", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3442", "output": "{1, 3442, 2, 1721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001734", "code": "def generate_primes(limit):\n    is_prime = [True] * (limit + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(limit**0.5) + 1):\n        if is_prime[i]:\n            for j in range(i*i, limit + 1, i):\n                is_prime[j] = False\n    primes = [i for i in range(2, limit + 1) if is_prime[i]]\n    return primes\n", "entry_point": "generate_primes", "input": "23", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29097_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001735", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[10, 9]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001736", "code": "def request(login, password):\n    if len(login) < 5 or len(password) < 8:\n        return False\n    has_upper = any(char.isupper() for char in password)\n    has_lower = any(char.islower() for char in password)\n    has_digit = any(char.isdigit() for char in password)\n    return has_upper and has_lower and has_digit\n", "entry_point": "request", "input": "'user', 'testPassword'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115609_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001737", "code": "import math\ndef euclidean_distance(point1, point2):\n    if not isinstance(point1, tuple) or not isinstance(point2, tuple) or len(point1) != 2 or len(point2) != 2:\n        raise ValueError(\"Both inputs must be tuples of length 2\")\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(1, 1), (6, 4)", "output": "5.830951894845301", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13433_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001738", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "2, 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001739", "code": "import os\ndef serve_static_file(path):\n    routes = {\n        'bower_components': 'bower_components',\n        'modules': 'modules',\n        'styles': 'styles',\n        'scripts': 'scripts',\n        'fonts': 'fonts'\n    }\n    if path == 'robots.txt':\n        return 'robots.txt'\n    elif path == '404.html':\n        return '404.html'\n    elif path.startswith('fonts/'):\n        return os.path.join('fonts', path.split('/', 1)[1])\n    else:\n        for route, directory in routes.items():\n            if path.startswith(route + '/'):\n                return os.path.join(directory, path.split('/', 1)[1])\n    return '404.html'\n", "entry_point": "serve_static_file", "input": "'unknown/file.txt'", "output": "'404.html'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103383_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001740", "code": "def extract_version_number(code_snippet):\n    lines = code_snippet.split('\\n')\n    version_number = 'UNKNOWN'\n    for line in lines:\n        if '__version__ =' in line:\n            version_number = line.split('=')[-1].strip().strip(\"'\").strip('\"')\n            break\n    return version_number\n", "entry_point": "extract_version_number", "input": "''", "output": "'UNKNOWN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95701_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001741", "code": "def character_frequency(input_string):\n    frequency_dict = {}\n    for char in input_string:\n        if char.isalpha():\n            char_lower = char.lower()\n            frequency_dict[char_lower] = frequency_dict.get(char_lower, 0) + 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "'h w o r d'", "output": "{'h': 1, 'w': 1, 'o': 1, 'r': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119970_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001742", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'progrdaing', 'oyp/th'", "output": "'progrdaing/oyp/th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5972", "output": "{1, 2, 4, 2986, 5972, 1493}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5971", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "898", "output": "{1, 898, 2, 449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001745", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'mdimeupower', 0, 0", "output": "\"Error: Invalid operation type 'mdimeupower'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001746", "code": "from typing import List, Dict, Any\ndef filter_records(records: List[Dict[str, Any]], column: str, value: Any) -> List[Dict[str, Any]]:\n    filtered_records = []\n    for record in records:\n        if column in record and record[column] == value:\n            filtered_records.append(record)\n    return filtered_records\n", "entry_point": "filter_records", "input": "[], 'name', 'John'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104039_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001747", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "23, 9", "output": "817190", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001748", "code": "def game_winner(n):\n    if n % 2 == 0:\n        check = 0\n        while n % 2 == 0:\n            n = n // 2\n            check += 1\n        if n <= 1:\n            if check % 2:\n                return \"Alice\"\n            else:\n                return \"Bob\"\n        else:\n            return \"Alice\"\n    else:\n        return \"Bob\"\n", "entry_point": "game_winner", "input": "1", "output": "'Bob'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127442_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001749", "code": "def valid_speed_profile(speeds):\n    prev_speed = None\n    for speed in speeds:\n        if speed < 0 or speed % 5 != 0:\n            return False\n        if prev_speed is not None and speed < prev_speed:\n            return False\n        prev_speed = speed\n    return True\n", "entry_point": "valid_speed_profile", "input": "[-1]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101992_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001750", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[7, 7, 7, 7, 7]", "output": "175", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001751", "code": "TEST_THREAD_NETWORK_IDS = [\n    bytes.fromhex(\"fedcba9876543210\"),\n]\nTEST_WIFI_SSID = \"TestSSID\"\nTEST_WIFI_PASS = \"<PASSWORD>\"\nWIFI_NETWORK_FEATURE_MAP = 1\nTHREAD_NETWORK_FEATURE_MAP = 2\ndef get_network_feature_map(network_type):\n    if network_type == \"Wi-Fi\":\n        return WIFI_NETWORK_FEATURE_MAP\n    elif network_type == \"Thread\":\n        return THREAD_NETWORK_FEATURE_MAP\n    else:\n        return \"Invalid network type\"\n", "entry_point": "get_network_feature_map", "input": "'Bluetooth'", "output": "'Invalid network type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132054_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001752", "code": "def sum_of_primes  (lst):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in lst:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_963_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001753", "code": "def parse_version(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "parse_version", "input": "'1.2.3'", "output": "(1, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18632_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001754", "code": "def count_keyword_in_comments(file_content, keyword):\n    lines = file_content.split('\\n')\n    comment_lines = [line for line in lines if line.strip().startswith('#')]\n    keyword_count = 0\n    for line in comment_lines:\n        if keyword in line:\n            keyword_count += line.count(keyword)\n    return keyword_count\n", "entry_point": "count_keyword_in_comments", "input": "'', 'important'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74808_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001755", "code": "def score_answers(nq_gold_dict, nq_pred_dict):\n    long_answer_stats = {}\n    short_answer_stats = {}\n    for question_id, gold_answers in nq_gold_dict.items():\n        pred_answers = nq_pred_dict.get(question_id, [])\n        # Scoring mechanism for long answers (example scoring logic)\n        long_score = 0\n        for gold_answer in gold_answers:\n            if gold_answer in pred_answers:\n                long_score += 1\n        # Scoring mechanism for short answers (example scoring logic)\n        short_score = min(len(gold_answers), len(pred_answers))\n        long_answer_stats[question_id] = long_score\n        short_answer_stats[question_id] = short_score\n    return long_answer_stats, short_answer_stats\n", "entry_point": "score_answers", "input": "{}, {}", "output": "({}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78415_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001756", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[2, 1, 0, 0, 3, 3, 2, 0]", "output": "[2, 1, 0, 0, 3, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001757", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[1, 2, 3, 4, 5]", "output": "[2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001758", "code": "import re\nRE_SPLITTER = re.compile(r'\\s+')\ndef _parse_data(data):\n    ids, captions = [], []\n    for line in data.split('\\n'):\n        parts = re.split(RE_SPLITTER, line.strip())\n        if len(parts) >= 2:\n            ids.append(parts[0])\n            captions.append(' '.join(parts[1:]))\n    return ids, captions\n", "entry_point": "_parse_data", "input": "''", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52605_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001759", "code": "def handle_translation_error(error_type):\n    error_messages = {\n        \"DetectionError\": \"Error detecting the language of the input text.\",\n        \"DetectionNotSupportedError\": \"Language detection is not supported for this engine.\",\n        \"TranslationError\": \"Error performing or parsing the translation.\",\n        \"EngineApiError\": \"An error reported by the translation service API.\",\n        \"UnsupportedLanguagePairError\": \"The specified language pair is not supported for translation.\",\n        \"InvalidISO6391CodeError\": \"Invalid ISO-639-1 language code provided.\",\n        \"AlignmentNotSupportedError\": \"Alignment is not supported for this language combination.\"\n    }\n    return error_messages.get(error_type, \"Unknown translation error\")\n", "entry_point": "handle_translation_error", "input": "'SomeOtherError'", "output": "'Unknown translation error'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48630_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001760", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001761", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[5, 0, -1, 3, 5, 3, 1, -1, 0, 0, 0]", "output": "[5, 0, -1, 3, 5, 3, 1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001762", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "9", "output": "'\\t\\t\\t\\t\\t\\t\\t\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8408", "output": "{1, 2, 4, 8, 4204, 2102, 8408, 1051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8407", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001764", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'6 + 6'", "output": "['12']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001765", "code": "import math\ndef sieve_of_eratosthenes(limit):\n    is_prime = [True] * (limit + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(limit)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, limit + 1, i):\n                is_prime[j] = False\n    return [num for num in range(2, limit + 1) if is_prime[num]]\n", "entry_point": "sieve_of_eratosthenes", "input": "31", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112116_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001766", "code": "from typing import List\ndef count_unique_elements(input_list: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_count = 0\n    # Count unique elements\n    for count in element_count.values():\n        if count == 1:\n            unique_count += 1\n    return unique_count\n", "entry_point": "count_unique_elements", "input": "[2, 3, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48545_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001767", "code": "from typing import List\ndef find_reverse_duplicates(lines: List[str]) -> List[str]:\n    results = []\n    for line in lines:\n        values = line.split()\n        history = set()\n        duplicates = []\n        for i in reversed(values):\n            if i not in history:\n                history.add(i)\n            elif i not in duplicates:\n                duplicates.insert(0, i)\n        results.append(' '.join(duplicates))\n    return results\n", "entry_point": "find_reverse_duplicates", "input": "['', '']", "output": "['', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105725_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001768", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2426", "output": "{1, 2426, 2, 1213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001769", "code": "def bijektivna(dictionary):\n    mapped_values = set()\n    for key, value in dictionary.items():\n        if value in mapped_values:\n            return False\n        mapped_values.add(value)\n    return True\n", "entry_point": "bijektivna", "input": "{'a': 1, 'b': 1}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59907_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001770", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[4, 4, 4, 4, 4, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001771", "code": "from typing import List\ndef calculate_accuracy(predicted_labels: List[int], true_labels: List[int]) -> float:\n    if len(predicted_labels) != len(true_labels):\n        raise ValueError(\"Length of predicted_labels and true_labels must be the same.\")\n    correct_predictions = sum(1 for pred, true in zip(predicted_labels, true_labels) if pred == true)\n    total_instances = len(predicted_labels)\n    accuracy = correct_predictions / total_instances if total_instances > 0 else 0.0\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 0, 0], [1, 1, 0, 0]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110882_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001772", "code": "def calculate_depth(path):\n    depth = 1\n    for char in path:\n        if char == '/':\n            depth += 1\n    return depth\n", "entry_point": "calculate_depth", "input": "'/a/b/c'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21386_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001773", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "'FFFFFFFF'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001774", "code": "import ast\ndef extract_function_commands(script):\n    tree = ast.parse(script)\n    functions = {}\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            function_name = node.name\n            commands = [ast.dump(n) for n in node.body]\n            functions[function_name] = commands\n    return functions\n", "entry_point": "extract_function_commands", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120574_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001775", "code": "def format_text(text: str) -> str:\n    formatted_text = \"\"\n    words = text.split()\n    for word in words:\n        if word.startswith('*') and word.endswith('*'):\n            formatted_text += word.strip('*').upper() + \" \"\n        elif word.startswith('_') and word.endswith('_'):\n            formatted_text += word.strip('_').lower() + \" \"\n        elif word.startswith('`') and word.endswith('`'):\n            formatted_text += word.strip('`')[::-1] + \" \"\n        else:\n            formatted_text += word + \" \"\n    return formatted_text.strip()\n", "entry_point": "format_text", "input": "'*wo* _hello_ `OHDPMAXE`'", "output": "'WO hello EXAMPDHO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10452_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001776", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 1, 1, 1, 1, 1, 1, 1], 1", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108386_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001777", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('a') if char.islower() else ord('A')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'yza', 1", "output": "'zab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35219_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001778", "code": "from typing import List\ndef select_best_genome(fitness_scores: List[int]) -> int:\n    best_index = 0\n    best_fitness = fitness_scores[0]\n    for i in range(1, len(fitness_scores)):\n        if fitness_scores[i] > best_fitness:\n            best_fitness = fitness_scores[i]\n            best_index = i\n    return best_index\n", "entry_point": "select_best_genome", "input": "[1, 2, 3, 0]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91198_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001779", "code": "def group_projects_by_diagnoses(projects):\n    projects_by_diagnoses = {}\n    for project in projects:\n        diagnosis = project.get(\"diagnoses\")\n        if diagnosis not in projects_by_diagnoses:\n            projects_by_diagnoses[diagnosis] = []\n        projects_by_diagnoses[diagnosis].append(project)\n    return projects_by_diagnoses\n", "entry_point": "group_projects_by_diagnoses", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15479_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001780", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'ab\\ncd\\n\\n'", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001781", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "805", "output": "{1, 161, 35, 5, 805, 7, 115, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt804", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001782", "code": "def calculate_net_balance(uid):\n    # Simulated data for demonstration purposes\n    incomes = [100, 200, 300]  # Simulated income amounts\n    payments = [50, 75]  # Simulated payment amounts\n    total_income = sum(incomes)\n    total_payments = sum(payments)\n    new_balance = total_income - total_payments\n    # Simulated update of blogger's balance\n    blogger_balance = new_balance\n    return blogger_balance\n", "entry_point": "calculate_net_balance", "input": "1", "output": "475", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61506_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001783", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[89, 60, 56, 50, 45]", "output": "[89, 60, 56]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001784", "code": "import math\ndef calculateDownloadCost(fileSize, downloadSpeed, costPerGB):\n    fileSizeGB = fileSize / 1024  # Convert file size from MB to GB\n    downloadTime = fileSizeGB * 8 / downloadSpeed  # Calculate download time in seconds\n    totalCost = math.ceil(fileSizeGB) * costPerGB  # Round up downloaded GB and calculate total cost\n    return totalCost\n", "entry_point": "calculateDownloadCost", "input": "1024, 100, -4.6", "output": "-4.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44451_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001785", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'sientofx'", "output": "{'sientofx': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001786", "code": "import ast\nfrom collections import defaultdict\ndef extract_event_types(code_snippet):\n    event_types = defaultdict(int)\n    tree = ast.parse(code_snippet)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            for stmt in node.body:\n                if isinstance(stmt, ast.Expr) and isinstance(stmt.value, ast.Call):\n                    event_type = stmt.value.func.attr\n                    event_types[event_type] += 1\n    return dict(event_types)\n", "entry_point": "extract_event_types", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139860_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001787", "code": "def extract_license_type(file_content):\n    start_comment = '\"\"\"'\n    end_comment = '\"\"\"'\n    start_index = file_content.find(start_comment)\n    end_index = file_content.find(end_comment, start_index + len(start_comment))\n    if start_index == -1 or end_index == -1:\n        return \"License not specified\"\n    comment_block = file_content[start_index + len(start_comment):end_index]\n    license_prefix = \"# License: \"\n    license_start = comment_block.find(license_prefix)\n    if license_start == -1:\n        return \"License not specified\"\n    license_end = comment_block.find('\\n', license_start)\n    license_type = comment_block[license_start + len(license_prefix):license_end].strip()\n    return license_type\n", "entry_point": "extract_license_type", "input": "'This file does not contain any comments.'", "output": "'License not specified'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127590_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4259", "output": "{1, 4259}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001789", "code": "import math\ndef my_CribleEratosthene(n):\n    is_prime = [True] * (n+1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n+1, i):\n                is_prime[j] = False\n    primes = [num for num in range(2, n+1) if is_prime[num]]\n    return primes\n", "entry_point": "my_CribleEratosthene", "input": "23", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55274_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001790", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "\"'Python'\"", "output": "'Python'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001791", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest integers\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest integers and the largest integer\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[7, 7, 8]", "output": "392", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118316_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001792", "code": "from typing import List, Tuple\ndef classify_entries(line_numbers: List[int]) -> Tuple[List[int], List[int], List[int]]:\n    NOT_AN_ENTRY = set([\n        326, 330, 332, 692, 1845, 6016, 17859, 24005, 49675, 97466, 110519, 118045,\n        119186, 126386\n    ])\n    ALWAYS_AN_ENTRY = set([\n        12470, 17858, 60157, 60555, 60820, 75155, 75330, 77825, 83439, 84266,\n        94282, 97998, 102650, 102655, 102810, 102822, 102895, 103897, 113712,\n        113834, 119068, 123676\n    ])\n    always_starts_entry = [num for num in line_numbers if num in ALWAYS_AN_ENTRY]\n    never_starts_entry = [num for num in line_numbers if num in NOT_AN_ENTRY]\n    ambiguous_starts_entry = [num for num in line_numbers if num not in ALWAYS_AN_ENTRY and num not in NOT_AN_ENTRY]\n    return always_starts_entry, never_starts_entry, ambiguous_starts_entry\n", "entry_point": "classify_entries", "input": "[5, 330, 17857, 3, 327, 4]", "output": "([], [330], [5, 17857, 3, 327, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61128_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001793", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'443'", "output": "{'443': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001794", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'java prgramming languae', 'Yor'", "output": "'java prgramming languae Yor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1593", "output": "{1, 3, 9, 59, 177, 531, 1593, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001796", "code": "def calculate_average(data):\n    total_noisy_add = sum(sample[0] for sample in data)\n    total_std_add = sum(sample[1] for sample in data)\n    average_noisy_add = total_noisy_add / len(data)\n    average_std_add = total_std_add / len(data)\n    return (average_noisy_add, average_std_add)\n", "entry_point": "calculate_average", "input": "[(20, 2), (20, 2), (20, 2), (20, 2), (20, 2)]", "output": "(20.0, 2.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73285_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001797", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'rclusrter', 'some_id'", "output": "\"Provider submodule 'rclusrter' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001798", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29487_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001799", "code": "def filter_dict(data_as_dict, include_keys=None, ignore_keys=None):\n    use_data = {}\n    use_include_keys = include_keys if include_keys else []\n    use_ignore_keys = ignore_keys if ignore_keys else []\n    for k in data_as_dict:\n        if k in use_include_keys and k not in use_ignore_keys:\n            use_data[k] = data_as_dict[k]\n    return use_data\n", "entry_point": "filter_dict", "input": "{}, None, None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27577_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001800", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[4, 5, 8]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125055_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001801", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4885", "output": "{1, 5, 977, 4885}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001802", "code": "def process_buttons(buttons):\n    if buttons is None:\n        return None\n    try:\n        if buttons.SUBCLASS_OF_ID == 0xe2e10ef2:\n            return buttons\n    except AttributeError:\n        pass\n    if not isinstance(buttons, list):\n        buttons = [[buttons]]\n    elif not isinstance(buttons[0], list):\n        buttons = [buttons]\n    is_inline = False\n    is_normal = False\n    rows = []\n    return buttons, is_inline, is_normal, rows\n", "entry_point": "process_buttons", "input": "[3, 3, 3, 1, 2]", "output": "([[3, 3, 3, 1, 2]], False, False, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147264_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7859", "output": "{1, 7859, 29, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001804", "code": "from typing import List\ndef max_distance(colors: List[int]) -> int:\n    color_indices = {}\n    max_dist = 0\n    for i, color in enumerate(colors):\n        if color not in color_indices:\n            color_indices[color] = i\n        else:\n            max_dist = max(max_dist, i - color_indices[color])\n    return max_dist\n", "entry_point": "max_distance", "input": "[1, 2, 3, 1, 4, 5, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93339_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001805", "code": "def extract_comments_from_script(script):\n    comments = []\n    for line in script.split('\\n'):\n        line = line.strip()\n        if line.startswith('#'):\n            comments.append(line)\n    return comments\n", "entry_point": "extract_comments_from_script", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8979_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001806", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "2, 4", "output": "4.47213595499958", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001807", "code": "def nested_list_depth(lst):\n    max_depth = 0\n    def calculate_depth(lst, current_depth):\n        nonlocal max_depth\n        for elem in lst:\n            if isinstance(elem, list):\n                max_depth = max(max_depth, calculate_depth(elem, current_depth + 1))\n        return current_depth\n    calculate_depth(lst, 1)\n    return max_depth\n", "entry_point": "nested_list_depth", "input": "[[1, 2], 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49579_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001808", "code": "def card_war(player1, player2):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1, player2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_war", "input": "[5, 6, 7], [1, 2, 3]", "output": "'Player 1 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81104_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001809", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import frpygluugetbernet'", "output": "'frpygluugetbernet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001810", "code": "def reverse_with_replace(input_string):\n    # Replace \"redis\" with \"python\" in the input string\n    modified_string = input_string.replace(\"redis\", \"python\")\n    # Reverse the modified string\n    reversed_string = modified_string[::-1]\n    return reversed_string\n", "entry_point": "reverse_with_replace", "input": "'mmm'", "output": "'mmm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60196_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001811", "code": "# Define the function to calculate mean accuracy for a specific round\ndef m_acc_round_wise(classification_file, ground_truth, round_number):\n    # Perform the necessary calculations to determine the mean accuracy for the specified round\n    # This is a placeholder implementation and should be replaced with the actual calculation logic\n    mean_accuracy = 0.85  # Placeholder value for demonstration purposes\n    return mean_accuracy\n", "entry_point": "m_acc_round_wise", "input": "'path/to/classification/results', 'path/to/ground/truth', 1", "output": "0.85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82321_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001812", "code": "def LunarMonthDays(lunar_year, lunar_month):\n    # Define a dictionary to map lunar months to the number of days\n    lunar_month_days = {\n        1: 30, 2: 29, 3: 30, 4: 29, 5: 30, 6: 29, 7: 30, 8: 30, 9: 29, 10: 30, 11: 29, 12: 30\n    }\n    # Check if the lunar month is within the valid range\n    if lunar_month < 1 or lunar_month > 12:\n        return \"Invalid lunar month\"\n    # Return the number of days in the specified lunar month\n    return lunar_month_days[lunar_month]\n", "entry_point": "LunarMonthDays", "input": "2023, 0", "output": "'Invalid lunar month'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7829_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001813", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 95, 83.5]", "output": "88.375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001814", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 1 or n == 2:\n        return 1\n    else:\n        result = fibonacci_memo(n - 1, memo) + fibonacci_memo(n - 2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "8", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33770_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001815", "code": "COLOR_RESOLUTIONS = {\n    'THE_1080_P': (1920, 1080),\n    'THE_4_K': (3840, 2160),\n    'THE_12_MP': (4056, 3040)\n}\nGRAY_RESOLUTIONS = {\n    'THE_720_P': (1280, 720),\n    'THE_800_P': (1280, 800),\n    'THE_400_P': (640, 400)\n}\ndef get_resolution_dimensions(resolution_type):\n    if resolution_type in COLOR_RESOLUTIONS:\n        return COLOR_RESOLUTIONS[resolution_type]\n    elif resolution_type in GRAY_RESOLUTIONS:\n        return GRAY_RESOLUTIONS[resolution_type]\n    else:\n        return \"Resolution type not found\"\n", "entry_point": "get_resolution_dimensions", "input": "'THE_4_K'", "output": "(3840, 2160)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107378_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001816", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'mnmee'", "output": "([], ['mnmee'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001817", "code": "def longest_common_substring(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    max_len = 0\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n                max_len = max(max_len, dp[i][j])\n    return max_len\n", "entry_point": "longest_common_substring", "input": "'a', 'a'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58621_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001818", "code": "from typing import List\nimport functools\ndef maximumScore1(nums: List[int], mult: List[int]) -> int:\n    @functools.lru_cache(maxsize=2000)\n    def dp(left, i):\n        if i >= len(mult):\n            return 0\n        right = len(nums) - 1 - (i - left)\n        return max(mult[i] * nums[left] + dp(left+1, i+1), mult[i] * nums[right] + dp(left, i+1))\n    return dp(0, 0)\n", "entry_point": "maximumScore1", "input": "[0, 0, 0], [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146067_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001819", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "50, 10", "output": "10272278170", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1011", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001820", "code": "def process_command(params):\n    outcomes = {\n        (\"-h\",): (0, [\"Usage\"]),\n        (\"-l\",): (0, [\"spaCy model\", \"installed version\", \"available versions\"]),\n        (\"-i\", None): (2, [\"Error: -i option requires an argument\"]),\n        (\"-u\", None): (2, [\"Error: -u option requires an argument\"]),\n        (\"-li\", None): (2, [\"Only one of [list|install|upgrade] can be selected at once.\"]),\n        (\"-i\", \"en_core_web_sm\"): (0, []),\n        (\"-u\", \"en_core_web_sm\"): (0, []),\n        (\"-vvp\", \"-j2\"): (0, [\"Creating database file\", \"All done\"]),\n    }\n    for key, value in outcomes.items():\n        if tuple(params) == key:\n            return value\n    return 2, [\"Command not recognized\"]\n", "entry_point": "process_command", "input": "(1, 2, 3)", "output": "(2, ['Command not recognized'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131488_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001821", "code": "from typing import List\nimport queue\ndef get_bool_operators(query_string: str) -> List[str]:\n    bool_operators = queue.Queue()\n    for ch in query_string:\n        if ch == '&' or ch == '|':\n            bool_operators.put(ch)\n    return list(bool_operators.queue)\n", "entry_point": "get_bool_operators", "input": "'abc'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108905_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001822", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "7", "output": "[-1, -1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001823", "code": "from typing import List, Dict\ndef count_ssh_keys(keys: List[str]) -> Dict[str, int]:\n    key_count = {}\n    for key in keys:\n        if key in key_count:\n            key_count[key] += 1\n        else:\n            key_count[key] = 1\n    return key_count\n", "entry_point": "count_ssh_keys", "input": "['dsa', 'dsa', 'ecdsa', 'ecdsa', 'rsa']", "output": "{'dsa': 2, 'ecdsa': 2, 'rsa': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75399_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001824", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "914", "output": "{1, 914, 2, 457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt913", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001825", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[2], 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108386_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001826", "code": "import re\ndef validate_email(email):\n    pattern = r\"^([a-z0-9_.]+)@([a-z0-9]+)\\.(com|net|org|edu)$\"\n    match = re.match(pattern, email)\n    if match:\n        return True\n    else:\n        return False\n", "entry_point": "validate_email", "input": "'example.user@domain.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73708_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001827", "code": "def count_imports(code: str) -> int:\n    lines = code.split('\\n')\n    import_count = sum(1 for line in lines if line.strip().startswith('import'))\n    return import_count\n", "entry_point": "count_imports", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136090_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001828", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "10.55, 1", "output": "10.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001829", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "1.0, 99.0", "output": "9900.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7", "output": "{1, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001831", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: int) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    result = []\n    while end < len(temperatures):\n        if max(temperatures[start:end+1]) - min(temperatures[start:end+1]) <= threshold:\n            if end - start + 1 > max_length:\n                max_length = end - start + 1\n                result = temperatures[start:end+1]\n            end += 1\n        else:\n            start += 1\n    return result\n", "entry_point": "longest_contiguous_subarray", "input": "[70, 75, 75, 71, 73, 80], 4", "output": "[75, 75, 71, 73]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105139_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001832", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'aze.'", "output": "'aze.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001833", "code": "def count_vowels(s):\n    vowels = set('aeiouAEIOU')\n    count = 0\n    for char in s:\n        if char in vowels:\n            count += 1\n    return count\n", "entry_point": "count_vowels", "input": "'Hello, how are you?'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127363_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "769", "output": "{1, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001835", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5109", "output": "{1, 3, 131, 1703, 39, 393, 13, 5109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5108", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001836", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[70, 90, 80, 70, 70]", "output": "[3, 1, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001837", "code": "def count_file_extensions(file_paths):\n    file_extensions_count = {}\n    # Split the input string by spaces to get individual file paths\n    paths = file_paths.strip().split()\n    for path in paths:\n        # Extract the file extension by splitting at the last '.' in the path\n        extension = path.split('.')[-1].lower() if '.' in path else ''\n        # Update the count of the file extension in the dictionary\n        file_extensions_count[extension] = file_extensions_count.get(extension, 0) + 1\n    return file_extensions_count\n", "entry_point": "count_file_extensions", "input": "'test.t/t'", "output": "{'t/t': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21533_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001838", "code": "def days_exceeding_average(data, period_length):\n    result = []\n    avg_deaths = sum(data[:period_length]) / period_length\n    current_sum = sum(data[:period_length])\n    for i in range(period_length, len(data)):\n        if data[i] > avg_deaths:\n            result.append(i)\n        current_sum += data[i] - data[i - period_length]\n        avg_deaths = current_sum / period_length\n    return result\n", "entry_point": "days_exceeding_average", "input": "[1, 1, 1, 1], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74675_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001839", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[18, 9, 2, 5, 20, 16, 8]", "output": "[2, 5, 8, 9, 16, 18, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001840", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        if num >= 0:\n            total_sum += num\n            count += 1\n    if count == 0:\n        return 0  # To handle the case when there are no positive numbers\n    return total_sum / count\n", "entry_point": "calculate_average", "input": "[10, 15, 15, 15]", "output": "13.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5697_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001841", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'tchrm'", "output": "'tchrm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001842", "code": "import importlib.util\ndef check_module_import(module_name: str) -> bool:\n    spec = importlib.util.find_spec(module_name)\n    return spec is not None\n", "entry_point": "check_module_import", "input": "'non_existent_module'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23844_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001843", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "'H\u00e9ll\u00f6 W\u00f6rld! 23'", "output": "'Hll Wrld! 23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001844", "code": "def prepare_filename_string(input_string):\n    processed_string = input_string.replace(\"_\", \"-\").replace(\"|\", \"-\").replace(\" \", \"-\").replace(\"(\", \"\").replace(\")\", \"\").lower()\n    return processed_string\n", "entry_point": "prepare_filename_string", "input": "'My_File (1) | Name'", "output": "'my-file-1---name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145297_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001845", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'hheve64'", "output": "'hheve64'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001846", "code": "import os\ndef get_maya_os(DEFAULT_DCC):\n    # Extract the file extension from the DEFAULT_DCC value\n    file_extension = os.path.splitext(DEFAULT_DCC)[1]\n    # Map file extensions to operating systems\n    os_mapping = {\n        '.exe': 'Windows',\n        '.app': 'Mac',\n        '.sh': 'Linux'\n    }\n    # Check if the file extension is in the mapping\n    if file_extension in os_mapping:\n        return os_mapping[file_extension]\n    else:\n        return 'Unknown'\n", "entry_point": "get_maya_os", "input": "'example.txt'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75657_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001847", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 70, 80, 90]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138156_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001848", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'http:/w.opeh'", "output": "'xmlns:__NAMESPACE__=\"http:/w.opeh\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001849", "code": "def next_greater_element(nums1, nums2):\n    next_greater = {}\n    stack = []\n    for num in nums2:\n        while stack and num > stack[-1]:\n            next_greater[stack.pop()] = num\n        stack.append(num)\n    result = [next_greater.get(num, -1) for num in nums1]\n    return result\n", "entry_point": "next_greater_element", "input": "[10, 11, 12, 13, 14], [1, 2, 3]", "output": "[-1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119101_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001850", "code": "import ast\ndef count_routes(code_snippet):\n    unique_routes = set()\n    tree = ast.parse(code_snippet)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            for decorator in node.decorator_list:\n                if isinstance(decorator, ast.Call) and isinstance(decorator.func, ast.Attribute):\n                    if decorator.func.attr == 'route' and decorator.func.value.id == 'app':\n                        route_path = decorator.args[0].s\n                        unique_routes.add(route_path)\n    return len(unique_routes)\n", "entry_point": "count_routes", "input": "'def sample_function():\\n    pass'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38758_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001851", "code": "LABEL = \"RANDOM_LANCEMATE\"\nJOBS = (\"Mecha Pilot\", \"Arena Pilot\", \"Recon Pilot\", \"Mercenary\", \"Bounty Hunter\")\ndef generate_id(job_title):\n    shortened_title = job_title[:3].lower()\n    if job_title in JOBS:\n        return f\"{LABEL}_{shortened_title}\"\n    else:\n        return \"Invalid Job Title\"\n", "entry_point": "generate_id", "input": "'Engineer'", "output": "'Invalid Job Title'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7478_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001852", "code": "def total_characters(lst):\n    total_count = 0\n    for item in lst:\n        if isinstance(item, str):\n            total_count += len(item)\n        elif isinstance(item, list):\n            total_count += total_characters(item)\n    return total_count\n", "entry_point": "total_characters", "input": "['Hello', ' ', 'world']", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59415_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001853", "code": "def knapsack_max_value(weights, values, size):\n    def knapsack_helper(size, numItems):\n        if size < 0:\n            return None\n        if (numItems, size) in dp.keys():\n            return dp[(numItems, size)]\n        op1 = knapsack_helper(size - weights[numItems - 1], numItems - 1)\n        op2 = knapsack_helper(size, numItems - 1)\n        dp[(numItems, size)] = max(op1 + values[numItems - 1], op2) if op1 is not None else op2\n        return dp[(numItems, size)]\n    dp = {}\n    for i in range(size + 1):\n        dp[(0, i)] = 0\n    return knapsack_helper(size, len(weights))\n", "entry_point": "knapsack_max_value", "input": "[1, 2, 3], [10, 20, 30], 6", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38750_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001854", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[1, 2, 3, 5, 6, 8, 6, 5], 2", "output": "[[1, 2], [3, 5], [6, 8], [6, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001855", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[5, 5, 1, 1, 2, 11, 1, 1, 1]", "output": "[5, 6, 3, 4, 6, 16, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001856", "code": "def compareTriplets(a, b):\n    score_a = 0\n    score_b = 0\n    for i in range(3):\n        if a[i] > b[i]:\n            score_a += 1\n        elif a[i] < b[i]:\n            score_b += 1\n    return [score_a, score_b]\n", "entry_point": "compareTriplets", "input": "[3, 5, 2], [1, 4, 3]", "output": "[2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134718_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001857", "code": "JETBRAINS_IDES = {\n    'androidstudio': 'Android Studio',\n    'appcode': 'AppCode',\n    'datagrip': 'DataGrip',\n    'goland': 'GoLand',\n    'intellij': 'IntelliJ IDEA',\n    'pycharm': 'PyCharm',\n    'rubymine': 'RubyMine',\n    'webstorm': 'WebStorm'\n}\nJETBRAINS_IDE_NAMES = list(JETBRAINS_IDES.values())\ndef count_ide_names_with_substring(substring: str) -> int:\n    count = 0\n    lowercase_substring = substring.lower()\n    for ide_name in JETBRAINS_IDE_NAMES:\n        if lowercase_substring in ide_name.lower():\n            count += 1\n    return count\n", "entry_point": "count_ide_names_with_substring", "input": "'notfound'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102649_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001858", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "129", "output": "(True, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001859", "code": "def calculate_total_sum(config):\n    total_sum = 0\n    for value in config.values():\n        if isinstance(value, int):\n            total_sum += value\n        elif isinstance(value, dict):\n            total_sum += calculate_total_sum(value)\n    return total_sum\n", "entry_point": "calculate_total_sum", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120570_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001860", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[85, 87, 89]", "output": "87", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117612_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6236", "output": "{1, 2, 4, 3118, 1559, 6236}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6235", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001862", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7687", "output": "{1, 7687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001863", "code": "def is_valid_ipv4(ip):\n    parts = ip.split('.')\n    if len(parts) != 4:\n        return False\n    for part in parts:\n        if not part.isdigit() or not 0 <= int(part) <= 255 or (len(part) > 1 and part[0] == '0'):\n            return False\n    return True\n", "entry_point": "is_valid_ipv4", "input": "'192.168.1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46034_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001864", "code": "def generate_syscalls_dict(arch_name):\n    ADDITIONAL_SYSCALLS = {\n        \"armv7\": [\n            (\"sys_ARM_NR_breakpoint\", 0xF0001),\n            (\"sys_ARM_NR_cacheflush\", 0xF0002),\n            (\"sys_ARM_NR_usr26\", 0xF0003),\n            (\"sys_ARM_NR_usr32\", 0xF0004),\n            (\"sys_ARM_NR_set_tls\", 0xF0005),\n        ]\n    }\n    syscalls_dict = {}\n    if arch_name in ADDITIONAL_SYSCALLS:\n        for syscall_entry in ADDITIONAL_SYSCALLS[arch_name]:\n            syscall_name, syscall_number = syscall_entry\n            syscalls_dict[syscall_name] = syscall_number\n    return syscalls_dict\n", "entry_point": "generate_syscalls_dict", "input": "'x86'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93699_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001865", "code": "def is_sorted(lst):\n    if all(lst[i] <= lst[i + 1] for i in range(len(lst) - 1)):\n        return True\n    elif all(lst[i] >= lst[i + 1] for i in range(len(lst) - 1)):\n        return True\n    else:\n        return False\n", "entry_point": "is_sorted", "input": "[1, 3, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96324_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001866", "code": "from collections import namedtuple\nBoto3ClientMethod = namedtuple('Boto3ClientMethod', ['name', 'waiter', 'operation_description', 'cluster', 'instance'])\ncluster_method_names = ['create_db_cluster', 'restore_db_cluster_from_db_snapshot', 'restore_db_cluster_from_s3',\n                        'restore_db_cluster_to_point_in_time', 'modify_db_cluster', 'delete_db_cluster',\n                        'add_tags_to_resource', 'remove_tags_from_resource', 'list_tags_for_resource',\n                        'promote_read_replica_db_cluster']\ninstance_method_names = ['create_db_instance', 'restore_db_instance_to_point_in_time', 'restore_db_instance_from_s3',\n                         'restore_db_instance_from_db_snapshot', 'create_db_instance_read_replica', 'modify_db_instance',\n                         'delete_db_instance', 'add_tags_to_resource', 'remove_tags_from_resource', 'list_tags_for_resource',\n                         'promote_read_replica', 'stop_db_instance', 'start_db_instance', 'reboot_db_instance']\ndef filter_allowed_methods(resource_type):\n    if resource_type == 'cluster':\n        return cluster_method_names\n    elif resource_type == 'instance':\n        return instance_method_names\n    else:\n        return []\n", "entry_point": "filter_allowed_methods", "input": "'invalid_resource'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17777_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001867", "code": "def jaccard_similarity(set1, set2):\n    intersection_size = len(set1.intersection(set2))\n    union_size = len(set1.union(set2))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    else:\n        return round(intersection_size / union_size, 2)\n", "entry_point": "jaccard_similarity", "input": "{1}, {1, 2}", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148714_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001868", "code": "def extract_version_number(module_content):\n    version_number = 'Version not found'\n    for line in module_content.split('\\n'):\n        if line.strip().startswith('__version__'):\n            parts = line.split('=')\n            if len(parts) == 2:\n                version = parts[1].strip().strip(\"'\\\"\")\n                if version:\n                    version_number = version\n            break\n    return version_number\n", "entry_point": "extract_version_number", "input": "''", "output": "'Version not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146240_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001869", "code": "import math\ndef get_total_pages(post_list, count):\n    total_posts = len(post_list)\n    total_pages = math.ceil(total_posts / count)\n    return total_pages\n", "entry_point": "get_total_pages", "input": "[1, 2, 3], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90417_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001870", "code": "def sum_fibonacci(N):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(N):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "12", "output": "232", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89935_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001871", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[97, 98, 95, 96], 2", "output": "97.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001872", "code": "import re\ndef extract_version(source_code: str) -> str:\n    version_pattern = r'__version__\\s*=\\s*[\\'\"]([^\\'\"]+)[\\'\"]'\n    match = re.search(version_pattern, source_code)\n    if match:\n        return match.group(1)\n    else:\n        return '0.0.0.dev0+Unknown'\n", "entry_point": "extract_version", "input": "''", "output": "'0.0.0.dev0+Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90304_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001873", "code": "def word_to_number(word):\n    number_dict = {\n        'zero': 0, 'um': 1, 'dois': 2, 'tr\u00eas': 3, 'quatro': 4,\n        'cinco': 5, 'seis': 6, 'sete': 7, 'oito': 8, 'nove': 9, 'dez': 10\n    }\n    if word in number_dict:\n        return number_dict[word]\n    else:\n        return \"Invalid input word\"\n", "entry_point": "word_to_number", "input": "'onze'", "output": "'Invalid input word'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69473_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001874", "code": "def sum_multiples(nums):\n    total = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82044_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001875", "code": "def higher_card_game(player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1\"\n    elif player2_wins > player1_wins:\n        return \"Player 2\"\n    else:\n        return \"Draw\"\n", "entry_point": "higher_card_game", "input": "[1, 2, 3], [3, 2, 1]", "output": "'Draw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138590_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001876", "code": "def extract_config_values(config_content):\n    config_values = {}\n    for line in config_content.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            key = key.strip()\n            value = value.strip()\n            config_values[key] = value\n    return config_values\n", "entry_point": "extract_config_values", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25262_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001877", "code": "def sum_of_even_squares(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[4, 4, 8]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128362_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001878", "code": "import json\ndef on_message(message):\n    data = json.loads(message)\n    received_message = data.get('message', '')\n    print(f\"Received message: {received_message}\")\n    response_message = {\n        'message': f\"{received_message} - Received\"\n    }\n    return json.dumps(response_message)\n", "entry_point": "on_message", "input": "'{}'", "output": "'{\"message\": \" - Received\"}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99590_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001879", "code": "def extract_todo_comments(file_content):\n    todo_comments = {}\n    lines = file_content.split('\\n')\n    for line_number, line in enumerate(lines, start=1):\n        if '.. todo::' in line:\n            todo_description = line.strip().replace('.. todo::', '').strip()\n            todo_comments.setdefault(todo_description, []).append(line_number)\n    return todo_comments\n", "entry_point": "extract_todo_comments", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104523_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001880", "code": "def max_non_overlapping_sticks(sticks, target):\n    sticks.sort()  # Sort the sticks in ascending order\n    selected_sticks = 0\n    total_length = 0\n    for stick in sticks:\n        if total_length + stick <= target:\n            selected_sticks += 1\n            total_length += stick\n    return selected_sticks\n", "entry_point": "max_non_overlapping_sticks", "input": "[1, 2, 3, 4, 5], 15", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122772_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001881", "code": "def search_target(nums, target):\n    def find_pivot(nums):\n        start, end = 0, len(nums) - 1\n        while start < end:\n            mid = (start + end) // 2\n            if nums[mid] > nums[end]:\n                start = mid + 1\n            else:\n                end = mid\n        return start\n    def binary_search(start, end):\n        while start <= end:\n            mid = (start + end) // 2\n            if nums[mid] == target:\n                return mid\n            elif nums[mid] < target:\n                start = mid + 1\n            else:\n                end = mid - 1\n        return -1\n    pivot = find_pivot(nums)\n    if nums[pivot] <= target <= nums[-1]:\n        return binary_search(pivot, len(nums) - 1)\n    else:\n        return binary_search(0, pivot - 1)\n", "entry_point": "search_target", "input": "[3, 4, 5, 1, 2], 6", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44702_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001882", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "48, 16", "output": "0.020833333333333332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001883", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[5, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001884", "code": "import re\nregex = (\n    r'^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12]['\n    r'0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|['\n    r'+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$'\n)\nmatch_iso8601 = re.compile(regex).match\ndef validate_iso8601(str_val):\n    \"\"\"Check if datetime string is in ISO8601 format.\"\"\"\n    try:\n        if match_iso8601(str_val) is not None:\n            return True\n    except re.error:\n        pass\n    return False\n", "entry_point": "validate_iso8601", "input": "'2023-01-01T00:00:00Z'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27877_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001885", "code": "import re\ndef extract_footnotes(markdown_text):\n    footnotes = {}\n    footnote_pattern = r'\\[\\^(\\d+)\\]:\\s*(.*)'\n    for match in re.finditer(footnote_pattern, markdown_text, re.MULTILINE):\n        footnote_ref = f'^{match.group(1)}'\n        footnote_content = match.group(2).strip()\n        footnotes[footnote_ref] = footnote_content\n    return footnotes\n", "entry_point": "extract_footnotes", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87331_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001886", "code": "def maxPower(s):\n    if not s:\n        return 0\n    max_power = 1\n    current_power = 1\n    current_char = s[0]\n    current_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            current_count += 1\n        else:\n            current_char = s[i]\n            current_count = 1\n        max_power = max(max_power, current_count)\n    return max_power\n", "entry_point": "maxPower", "input": "'aaaabbb'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40173_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001887", "code": "import os\nEXCLUDEDIRS = [\"build\", \".git\", \".github\"]\ndef get_unique_file_extensions(directory):\n    unique_extensions = set()\n    for root, dirs, files in os.walk(directory):\n        dirs[:] = [d for d in dirs if d not in EXCLUDEDIRS]\n        for file in files:\n            _, extension = os.path.splitext(file)\n            unique_extensions.add(extension.lower()[1:])\n    return list(unique_extensions)\n", "entry_point": "get_unique_file_extensions", "input": "'empty_dir'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103350_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001888", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'1121.1.1'", "output": "(1121, 1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5690", "output": "{1, 2, 5, 10, 1138, 569, 5690, 2845}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5689", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001890", "code": "def format_ghost_users(user_score: int, course_id: str) -> list:\n    user_list = [\n        {\"id\": \"1\", \"name\": \"Alice\", \"img_url\": \"url1\", \"score\": 85, \"courses\": [\"course1\", \"course2\"]},\n        {\"id\": \"2\", \"name\": \"Bob\", \"img_url\": \"url2\", \"score\": 78, \"courses\": [\"course1\"]},\n        {\"id\": \"3\", \"name\": \"Charlie\", \"img_url\": \"url3\", \"score\": 92, \"courses\": [\"course2\"]},\n        {\"id\": \"4\", \"name\": \"David\", \"img_url\": \"url4\", \"score\": 80, \"courses\": [\"course1\", \"course2\"]},\n    ]\n    result = []\n    for user in user_list:\n        if abs(user[\"score\"] - user_score) <= 5 and course_id in user[\"courses\"]:\n            result.append({\"id\": user[\"id\"], \"name\": user[\"name\"], \"img_url\": user[\"img_url\"]})\n    return result\n", "entry_point": "format_ghost_users", "input": "72, 'course3'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92469_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001891", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6146", "output": "{1, 6146, 2, 3073, 7, 878, 14, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001892", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    fib_prev, fib_curr = 0, 1\n    for _ in range(N):\n        fib_sum += fib_curr\n        fib_prev, fib_curr = fib_curr, fib_prev + fib_curr\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "14", "output": "986", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41805_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001893", "code": "def sum_multiples_of_3_or_5(numbers):\n    total_sum = 0\n    seen = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 6, 1, 2]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100401_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8183", "output": "{1, 7, 167, 1169, 49, 8183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001895", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 0, 1]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001896", "code": "import os\ndef search_for_file(root_dir: str) -> bool:\n    for cur_path, _, files in os.walk(root_dir):\n        if 'out.txt' in files:\n            with open(os.path.join(cur_path, 'out.txt'), 'r') as f:\n                if f.read().strip() == 'Filewriter was here':\n                    return True\n    return False\n", "entry_point": "search_for_file", "input": "'/path/to/nonexistent/directory'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120086_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001897", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[300, 400], 100", "output": "700", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001898", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'Hel!H,W\\n\\x00'", "output": "'Hel!H,W\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001899", "code": "def sum_of_lists(lists):\n    total_sum = 0\n    for inner_list in lists:\n        total_sum += sum(inner_list)\n    return total_sum\n", "entry_point": "sum_of_lists", "input": "[[10, 15, 11]]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31268_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001900", "code": "from typing import List\ndef sum_multiples_of_3_or_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 6, 9, 10]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25649_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001901", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 1, 4, 1, 0, 1, 4, 5]", "output": "[1, 5, 5, 1, 1, 5, 9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001902", "code": "from typing import List\ndef max_attended_events(events: List[int]) -> int:\n    event_list = [(i, i + 1, freq) for i, freq in enumerate(events)]\n    event_list.sort(key=lambda x: x[1])  # Sort events based on end times\n    max_attended = 0\n    prev_end = -1\n    for event in event_list:\n        start, end, _ = event\n        if start >= prev_end:\n            max_attended += 1\n            prev_end = end\n    return max_attended\n", "entry_point": "max_attended_events", "input": "[1, 1, 1, 1, 1, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94594_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001903", "code": "def is_indexable_but_not_string(obj: object) -> bool:\n    return not hasattr(obj, \"strip\") and hasattr(obj, \"__iter__\") and not isinstance(obj, str)\n", "entry_point": "is_indexable_but_not_string", "input": "'hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65419_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001904", "code": "from typing import List\ndef max_robbery_amount(nums: List[int]) -> int:\n    def dp(i: int) -> int:\n        if i == 0:\n            return nums[0]\n        if i == 1:\n            return max(nums[0], nums[1])\n        if i not in memo:\n            memo[i] = max(dp(i-1), nums[i]+dp(i-2))\n        return memo[i]\n    memo = {}\n    return dp(len(nums)-1)\n", "entry_point": "max_robbery_amount", "input": "[2, 7, 9, 3, 1]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101435_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001905", "code": "from typing import List\ndef calculate_diff(lst: List[int]) -> int:\n    if len(lst) < 2:\n        return 0\n    else:\n        last_two_elements = lst[-2:]\n        return abs(last_two_elements[1] - last_two_elements[0])\n", "entry_point": "calculate_diff", "input": "[0, 7, 14, 21]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112649_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001906", "code": "def sum_even_fibs(n):\n    if n <= 0:\n        return 0\n    a, b = 0, 1\n    total_sum = 0\n    while b <= n:\n        if b % 2 == 0:\n            total_sum += b\n        a, b = b, a + b\n    return total_sum\n", "entry_point": "sum_even_fibs", "input": "8", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8123_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001907", "code": "import re\ndef extract_api_info(api_doc: str) -> dict:\n    api_info = {}\n    base_url_match = re.search(r'curl -X POST (https://\\S+)', api_doc)\n    if base_url_match:\n        api_info[\"base_url\"] = base_url_match.group(1)\n    auth_match = re.search(r'username=(\\S+)&password=(\\S+)&token=(\\S+)&content_type=(\\S+)', api_doc)\n    if auth_match:\n        api_info[\"authentication\"] = {\n            \"username\": auth_match.group(1),\n            \"password\": auth_match.group(2),\n            \"token\": auth_match.group(3),\n            \"content_type\": auth_match.group(4)\n        }\n    openapi_match = re.search(r'OpenAPI spec version: (\\S+)', api_doc)\n    if openapi_match:\n        api_info[\"openapi_spec_version\"] = openapi_match.group(1)\n    return api_info\n", "entry_point": "extract_api_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63366_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001908", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 91, 78, 70, 70, 60, 50, 40]", "output": "[100, 91, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23327_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9139", "output": "{1, 481, 37, 13, 19, 9139, 247, 703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001910", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[10, 11]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001911", "code": "from typing import Tuple\ndef final_position(directions: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'RD'", "output": "(1, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93403_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001912", "code": "def longest_consecutive_sequence_length(nums):\n    if not nums:\n        return 0\n    longest_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n            longest_length = max(longest_length, current_length)\n        else:\n            current_length = 1\n    return longest_length\n", "entry_point": "longest_consecutive_sequence_length", "input": "[7, 1, 2, 3, 0]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119725_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001913", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[7, 7, 3, 9, 7, 2, 3, 9, 3]", "output": "[49, 49, 9, 81, 49, 2, 9, 81, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001914", "code": "def calculate_depth(lst):\n    max_depth = 1\n    for element in lst:\n        if isinstance(element, list):\n            max_depth = max(max_depth, 1 + calculate_depth(element))\n    return max_depth\n", "entry_point": "calculate_depth", "input": "[1, [2, [3]]]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126067_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001915", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'52:02:30'", "output": "187350", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001916", "code": "from typing import List\ndef sum_of_even_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62351_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001917", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1203", "output": "{3, 1, 401, 1203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001918", "code": "def highest_growth_rate_city(population_list):\n    highest_growth_rate = 0\n    city_with_highest_growth = None\n    for i in range(1, len(population_list)):\n        growth_rate = population_list[i] - population_list[i - 1]\n        if growth_rate > highest_growth_rate:\n            highest_growth_rate = growth_rate\n            city_with_highest_growth = f'City{i+1}'\n    return city_with_highest_growth\n", "entry_point": "highest_growth_rate_city", "input": "[100, 200, 250]", "output": "'City2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6843_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001919", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    total_count = len(scores)\n    average = round(total_sum / total_count)\n    return average\n", "entry_point": "calculate_average", "input": "[88, 90]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87310_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001920", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'hleold H'", "output": "'H Hleold'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001921", "code": "def sum_of_squares_even(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 2, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15719_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001922", "code": "def sum_divisible_by_2_and_3(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 2 == 0 and num % 3 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_2_and_3", "input": "[6, 6]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68299_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001923", "code": "def find_lowest_unique_number(input_string):\n    numbers = sorted(map(int, input_string.split()))\n    for num in numbers:\n        if numbers.count(num) == 1:\n            return numbers.index(num) + 1\n    return 0\n", "entry_point": "find_lowest_unique_number", "input": "'5 5 5 5 5 5 5 8'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36596_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001924", "code": "def determine_secondary_sort(attr, side_of_ball):\n    secondary_sort_attr = \"\"\n    sort_order = \"\"\n    # Define rules to determine secondary sort attribute and order based on primary sort attribute and side of the ball\n    if attr == \"attr1\" and side_of_ball == \"offense\":\n        secondary_sort_attr = \"attr2\"\n        sort_order = \"ascending\"\n    elif attr == \"attr1\" and side_of_ball == \"defense\":\n        secondary_sort_attr = \"attr3\"\n        sort_order = \"descending\"\n    # Add more rules as needed for different primary sort attributes and sides of the ball\n    return (secondary_sort_attr, sort_order)\n", "entry_point": "determine_secondary_sort", "input": "'attr2', 'offense'", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9138_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3617", "output": "{1, 3617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001926", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[1, 2, 3, 4, 5, 6]", "output": "[1, 4, 37, 16, 125, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001927", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[-6, 6]", "output": "-36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001928", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'fox'", "output": "{'fox': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001929", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5385", "output": "{1, 1795, 3, 5, 359, 5385, 15, 1077}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001930", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():  # Check if the character is a letter\n            if char_lower in char_count:\n                char_count[char_lower] += 1\n            else:\n                char_count[char_lower] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'h'", "output": "{'h': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24964_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001931", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "10, 6", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001932", "code": "import math\ndef calculate_optimal_angle(init_vel, maxG):\n    max_distance = 0\n    optimal_angle = 0\n    for angle in range(91):  # Iterate through angles from 0 to 90 degrees\n        distance = (init_vel**2 * math.sin(math.radians(2 * angle))) / maxG\n        if distance > max_distance:\n            max_distance = distance\n            optimal_angle = angle\n    return optimal_angle\n", "entry_point": "calculate_optimal_angle", "input": "10, 9.81", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73418_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001933", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'373777273.0'", "output": "373777273", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001934", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[43, 45]", "output": "'44%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001935", "code": "import string\ndef extract_unique_words(input_str):\n    translator = str.maketrans('', '', string.punctuation)  # Translator to remove punctuation\n    unique_words = []\n    seen_words = set()\n    for word in input_str.split():\n        cleaned_word = word.translate(translator).lower()\n        if cleaned_word not in seen_words:\n            seen_words.add(cleaned_word)\n            unique_words.append(cleaned_word)\n    return unique_words\n", "entry_point": "extract_unique_words", "input": "'Programing!'", "output": "['programing']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26247_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001936", "code": "def highest_version_library(theano_version, tensorflow_version, keras_version):\n    def version_tuple(version_str):\n        return tuple(map(int, version_str.split('.')))\n    theano_tuple = version_tuple(theano_version)\n    tensorflow_tuple = version_tuple(tensorflow_version)\n    keras_tuple = version_tuple(keras_version)\n    if tensorflow_tuple > theano_tuple and tensorflow_tuple > keras_tuple:\n        return 'TensorFlow'\n    elif keras_tuple > theano_tuple and keras_tuple > tensorflow_tuple:\n        return 'Keras'\n    else:\n        return 'Theano'\n", "entry_point": "highest_version_library", "input": "'1.0.0', '2.0.0', '3.0.0'", "output": "'Keras'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96884_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001937", "code": "def sum_multiples(nums):\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142547_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001938", "code": "def longest_consecutive_sequence(nums):\n    if not nums:\n        return 0\n    nums.sort()\n    current_length = 1\n    longest_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] == nums[i - 1] + 1:\n            current_length += 1\n            longest_length = max(longest_length, current_length)\n        else:\n            current_length = 1\n    return longest_length\n", "entry_point": "longest_consecutive_sequence", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45770_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001939", "code": "# Function to parse the Chinese character code and return its pinyin pronunciation\ndef parse_hanzi(code):\n    pinyin_dict = {\n        'U+4E00': 'y\u012b',\n        'U+4E8C': '\u00e8r',\n        'U+4E09': 's\u0101n',\n        'U+4E5D': 'ji\u01d4'\n        # Add more mappings as needed\n    }\n    alternate_dict = {\n        'U+4E00': {'pinyin': 'y\u012b', 'code': '4E00'},\n        'U+4E8C': {'pinyin': '\u00e8r', 'code': '4E8C'},\n        'U+4E09': {'pinyin': 's\u0101n', 'code': '4E09'},\n        'U+4E5D': {'pinyin': 'ji\u01d4', 'code': '4E5D'}\n        # Add more alternate mappings as needed\n    }\n    pinyin = pinyin_dict.get(code)\n    if not pinyin:\n        alternate = alternate_dict.get(code)\n        if alternate:\n            pinyin = alternate['pinyin']\n            extra = '  => U+{0}'.format(alternate['code'])\n            if ',' in pinyin:\n                first_pinyin, extra_pinyin = pinyin.split(',', 1)\n                pinyin = first_pinyin\n                extra += '  ?-> ' + extra_pinyin\n        else:\n            pinyin = 'Pinyin not available'\n    return pinyin\n", "entry_point": "parse_hanzi", "input": "'U+4E8C'", "output": "'\u00e8r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30788_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001940", "code": "def play_card_game(deck_a, deck_b):\n    rounds = 0\n    while deck_a and deck_b:\n        rounds += 1\n        card_a = deck_a.pop(0)\n        card_b = deck_b.pop(0)\n        if card_a > card_b:\n            deck_a.extend([card_a, card_b])\n        elif card_b > card_a:\n            deck_b.extend([card_b, card_a])\n        else:  # War condition\n            war_cards = [card_a, card_b]\n            for _ in range(3):\n                if len(deck_a) == 0 or len(deck_b) == 0:\n                    break\n                war_cards.extend([deck_a.pop(0), deck_b.pop(0)])\n            if war_cards[-2] > war_cards[-1]:\n                deck_a.extend(war_cards)\n            else:\n                deck_b.extend(war_cards)\n    if not deck_a and not deck_b:\n        return \"Draw\"\n    elif not deck_a:\n        return \"Player B wins\"\n    else:\n        return \"Player A wins\"\n", "entry_point": "play_card_game", "input": "[1, 2, 3], [4, 5, 6]", "output": "'Player B wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103971_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001941", "code": "def find_negative_floor_position(parentheses: str) -> int:\n    floor = 0\n    position = 0\n    counter = 0\n    for char in parentheses:\n        counter += 1\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        if floor < 0:\n            return counter\n    return -1\n", "entry_point": "find_negative_floor_position", "input": "'((()))))'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125383_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001942", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'21.4.03', '10.5010.5.0.0'", "output": "'21.4.03 to 10.5010.5.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001943", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'1.12.11.1.1'", "output": "'1.12.11.1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001944", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6529", "output": "{1, 6529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001945", "code": "def calculate_median(numbers):\n    sorted_numbers = sorted(numbers)\n    length = len(sorted_numbers)\n    if length % 2 == 1:  # Odd number of elements\n        return sorted_numbers[length // 2]\n    else:  # Even number of elements\n        mid = length // 2\n        return (sorted_numbers[mid - 1] + sorted_numbers[mid]) / 2\n", "entry_point": "calculate_median", "input": "[1, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63244_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001946", "code": "def compute_dist_excluding_gaps(ref_seq, seq):\n    matching_count = 0\n    for ref_char, seq_char in zip(ref_seq, seq):\n        if ref_char != '-' and seq_char != '-' and ref_char == seq_char:\n            matching_count += 1\n    distance = 1 - (matching_count / len(seq))\n    return distance\n", "entry_point": "compute_dist_excluding_gaps", "input": "'A-B-C-', 'A-B--D'", "output": "0.6666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47319_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001947", "code": "algorithm_map = {\n    'RS256': 'sha256',\n    'RS384': 'sha384',\n    'RS512': 'sha512',\n}\ndef get_hash_algorithm(algorithm_name):\n    return algorithm_map.get(algorithm_name, 'Algorithm not found')\n", "entry_point": "get_hash_algorithm", "input": "'RS512'", "output": "'sha512'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98777_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001948", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'2777'", "output": "(2777,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001949", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5338", "output": "{1, 2, 34, 314, 2669, 17, 5338, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001950", "code": "from typing import List\ndef calculate_accuracy(test_results: List[int]) -> float:\n    num_reads = 0\n    num_correct = 0\n    for result in test_results:\n        num_reads += 1\n        if result == 1:\n            num_correct += 1\n    if num_reads == 0:\n        return 0.0\n    else:\n        return (num_correct / num_reads) * 100\n", "entry_point": "calculate_accuracy", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10794_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001951", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 9, 15]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132351_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001952", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4434", "output": "{1, 2, 3, 739, 1478, 6, 2217, 4434}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4433", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001953", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'user'", "output": "'streamer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001954", "code": "def extract_info(code_snippet):\n    extracted_info = {}\n    for line in code_snippet.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=', 1)\n            key = key.strip()\n            value = value.strip().strip('\"')\n            if key in ['url', 'license', 'author', 'requires']:\n                if key == 'requires':\n                    extracted_info[key] = [req.strip() for req in value.split(',')]\n                else:\n                    extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75003_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001955", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if N >= num_students:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[90, 90, 90, 90], 3", "output": "90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122460_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001956", "code": "import re\ndef extract_skip_directives(code_snippet):\n    COMMENT_REGEX = re.compile(r'(checkov:skip=|bridgecrew:skip=) *([A-Z_\\d]+)(:[^\\n]+)?')\n    skip_directives = []\n    matches = COMMENT_REGEX.findall(code_snippet)\n    for match in matches:\n        directive_type = match[0].split(':')[0]\n        identifier = match[1]\n        skip_directives.append((directive_type, identifier))\n    return skip_directives\n", "entry_point": "extract_skip_directives", "input": "'This is a code snippet without skip directives.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15941_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001957", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[0, 2, 3, 4]", "output": "{0: 0, 2: 4, 3: 9, 4: 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001958", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "2, b=3, c=4, d=2", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001959", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "6", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2131", "output": "{1, 2131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001961", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "13", "output": "'221'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001962", "code": "def minMeetingRooms(intervals):\n    intervals.sort(key=lambda x: x[0])  # Sort intervals based on start time\n    rooms = []  # List to store ongoing meetings\n    for start, end in intervals:\n        settled = False\n        for i, (room_end) in enumerate(rooms):\n            if room_end <= start:\n                rooms[i] = end\n                settled = True\n                break\n        if not settled:\n            rooms.append(end)\n    return len(rooms)\n", "entry_point": "minMeetingRooms", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107943_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001963", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[4, 4, 7, 7, 0, 0]", "output": "[4, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001964", "code": "def countPaths(numrArreglo, numSalto):\n    dp = [0] * numrArreglo\n    dp[0] = 1\n    for i in range(1, numrArreglo):\n        for j in range(1, numSalto + 1):\n            if i - j >= 0:\n                dp[i] += dp[i - j]\n    return dp[numrArreglo - 1]\n", "entry_point": "countPaths", "input": "2, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42463_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001965", "code": "def count_ways_to_climb_stairs(n: int) -> int:\n    if n <= 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "6", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16452_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001966", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'bbb.bb.'", "output": "'bbb.bb.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001967", "code": "def calculate_similarity_score(str1, str2):\n    if len(str1) != len(str2):\n        raise ValueError(\"Input strings must have the same length\")\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            similarity_score += 1\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "'abXY', 'abPQ'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105365_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001968", "code": "def class_name_normalize(class_name):\n    \"\"\"\n    Converts a string into a standardized class name format.\n    Args:\n    class_name (str): The input string with words separated by underscores.\n    Returns:\n    str: The converted class name format with each word starting with an uppercase letter followed by lowercase letters.\n    \"\"\"\n    part_list = []\n    for item in class_name.split(\"_\"):\n        part_list.append(\"{}{}\".format(item[0].upper(), item[1:].lower()))\n    return \"\".join(part_list)\n", "entry_point": "class_name_normalize", "input": "'unag'", "output": "'Unag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55201_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001969", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6431", "output": "{1, 59, 109, 6431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001970", "code": "def calculate_total_elements(maxlag, disp_lag, dt):\n    # Calculate the total number of elements in the matrix\n    total_elements = 2 * int(disp_lag / dt) + 1\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "0, 0, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39261_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001971", "code": "def generate_status_message(shipment_status, payment_status):\n    if shipment_status == \"ORDERED\" and payment_status == \"NOT PAID\":\n        return \"Order placed, payment pending\"\n    elif shipment_status == \"SHIPPED\" and payment_status == \"PAID\":\n        return \"Order shipped and payment received\"\n    else:\n        return f\"Order status: {shipment_status}, Payment status: {payment_status}\"\n", "entry_point": "generate_status_message", "input": "'ODP', 'NOPDDAIDN'", "output": "'Order status: ODP, Payment status: NOPDDAIDN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73464_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001972", "code": "def max_non_contiguous_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = exclude + num\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_contiguous_sum", "input": "[10, 5, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39163_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001973", "code": "import re\ndef extract_env_variables(code_snippet):\n    env_vars = {}\n    lines = code_snippet.strip().split(\"\\n\")\n    for line in lines:\n        match = re.match(r'(\\w+)\\s*=\\s*os\\.environ\\.get\\(\".*?\",\\s*\"(.*)\"\\)', line)\n        if match:\n            var_name, var_value = match.groups()\n            env_vars[var_name] = var_value\n    return env_vars\n", "entry_point": "extract_env_variables", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12860_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001974", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "10", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001975", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[0, 0, -2, -2, 2, 0, 0, 2]", "output": "[0, 0, -4, -4, 4, 0, 0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001976", "code": "def color_negative_red(val):\n    color = 'red' if val > 0.05 else 'green'\n    return 'color: %s' % color\n", "entry_point": "color_negative_red", "input": "0.0", "output": "'color: green'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80039_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001977", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    scores.remove(min_score)\n    total_sum = sum(scores)\n    num_scores = len(scores)\n    if num_scores == 0:\n        return 0.0\n    return total_sum / num_scores\n", "entry_point": "calculate_average", "input": "[99, 100]", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90356_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3566", "output": "{1, 2, 3566, 1783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3565", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001979", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[7, 7, -1, 0, 0, 3, 0, 2, 0]", "output": "[7, 8, 1, 3, 4, 8, 6, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001980", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1795", "output": "{1, 1795, 5, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1794", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001982", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():  # Check if the character is a letter\n            if char_lower in char_count:\n                char_count[char_lower] += 1\n            else:\n                char_count[char_lower] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24964_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001983", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[41, 2]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89844_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001984", "code": "from typing import List\ndef stoneGame(piles: List[int]) -> bool:\n    n = len(piles)\n    dp = [[0] * n for _ in range(n)]\n    for i in range(n):\n        dp[i][i] = piles[i]\n    for l in range(2, n + 1):\n        for i in range(n - l + 1):\n            j = i + l - 1\n            dp[i][j] = max(piles[i] - dp[i + 1][j], piles[j] - dp[i][j - 1])\n    return dp[0][n - 1] > 0\n", "entry_point": "stoneGame", "input": "[1, 1]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29901_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001985", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "3.84, 1", "output": "3.84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001986", "code": "import os\ndef process_image_statuses(folder_path):\n    def get_statuses(folder):\n        # Assume this function is implemented and returns a list of status names\n        return ['status1', 'status2', 'status3']\n    image_statuses = {}\n    for root, _, files in os.walk(folder_path):\n        for file in files:\n            status_name = os.path.splitext(file)[0]\n            image_path = os.path.join(root, file)\n            image_statuses[status_name] = image_path\n    return image_statuses\n", "entry_point": "process_image_statuses", "input": "'/path/to/nonexistent/directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145997_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001987", "code": "from typing import List, Dict, Union\ndef calculate_cart_total(orders: List[Dict[str, Union[int, float]]]) -> float:\n    total_cost = 0\n    for order in orders:\n        total_cost += order['quantity'] * order['price']\n    return total_cost\n", "entry_point": "calculate_cart_total", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37327_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001988", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1778", "output": "{1, 2, 7, 14, 1778, 889, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001989", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'1.0.11.dev0'", "output": "'1.0.11.dev1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001990", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3660", "output": "'1 hour 1 minute'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001991", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5185", "output": "{5185, 1, 5, 1037, 17, 305, 85, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001992", "code": "def insert_operators(nums, target):\n    def insert_operators_helper(nums, target, expression, index, current_val, prev_num):\n        if index == len(nums):\n            if current_val == target:\n                result.append(expression)\n            return\n        for op in ['+', '*']:\n            if op == '+':\n                insert_operators_helper(nums, target, f\"{expression}+{nums[index]}\", index + 1, current_val + nums[index], nums[index])\n            else:\n                insert_operators_helper(nums, target, f\"{expression}*{nums[index]}\", index + 1, current_val - prev_num + prev_num * nums[index], prev_num * nums[index])\n    result = []\n    insert_operators_helper(nums, target, str(nums[0]), 1, nums[0], nums[0])\n    return result\n", "entry_point": "insert_operators", "input": "[1, 2, 3], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97957_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001993", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[11, 3]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118081_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001994", "code": "import re\ndef verify_most_built_recipes_information(project_name):\n    # Simulate the behavior of verifying most built recipes information for a given project\n    default_message_present = False\n    choose_recipe_link_working = False\n    # Simulate checking for the default message and link functionality\n    if project_name == 'selenium-project':\n        default_message_present = True\n        choose_recipe_link_working = True\n    return default_message_present, choose_recipe_link_working\n", "entry_point": "verify_most_built_recipes_information", "input": "'my_project'", "output": "(False, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45147_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001995", "code": "from typing import List\ndef find_first_occurrence(data_changed_flags: List[int]) -> int:\n    for index, value in enumerate(data_changed_flags):\n        if value == 1:\n            return index\n    return -1\n", "entry_point": "find_first_occurrence", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32380_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001996", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[4, 3, 3, 1, 3, 2, 1, 1, 3]", "output": "[4, 4, 5, 4, 7, 7, 7, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001997", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4619", "output": "{1, 4619, 149, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001998", "code": "def get_player_stats(player_id: int) -> dict:\n    try:\n        if player_id % 2 == 0:\n            return {\"assists\": player_id * 2, \"points\": player_id * 3, \"goals\": player_id}\n        else:\n            return {\"assists\": 0, \"points\": 0, \"goals\": 0}\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return {\"assists\": 0, \"points\": 0, \"goals\": 0}\n", "entry_point": "get_player_stats", "input": "1", "output": "{'assists': 0, 'points': 0, 'goals': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113442_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0001999", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[85, 88, 88, 88, 90]", "output": "88.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67908_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002000", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[3, 3, 2, 2]", "output": "[3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8894", "output": "{1, 2, 8894, 4447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8893", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002002", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[3, 3, 4, 4]", "output": "[3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002003", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study1234_20220101.txt'", "output": "(1234, '20220101')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002004", "code": "def simulate_packet_routing(nodes, packets):\n    total_forwarded_packets = 0\n    for i in range(len(nodes)):\n        forwarded_packets = min(nodes[i], packets[i])\n        total_forwarded_packets += forwarded_packets\n    return total_forwarded_packets\n", "entry_point": "simulate_packet_routing", "input": "[5, 8], [5, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65785_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002005", "code": "def sum_squared_differences(list1, list2):\n    if len(list1) != len(list2):\n        return -1\n    sum_squared_diff = sum((x - y) ** 2 for x, y in zip(list1, list2))\n    return sum_squared_diff\n", "entry_point": "sum_squared_differences", "input": "[1, 2, 3], [4, 5]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84550_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002006", "code": "import re\ndef process_string(input_string):\n    # Replace \"Kafka\" with \"Python\"\n    processed_string = input_string.replace(\"Kafka\", \"Python\")\n    # Remove digits from the string\n    processed_string = re.sub(r'\\d', '', processed_string)\n    # Reverse the string\n    processed_string = processed_string[::-1]\n    return processed_string\n", "entry_point": "process_string", "input": "'Kafka is awesome'", "output": "'emosewa si nohtyP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55468_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002007", "code": "import os\ndef analyze_trained_model_directory(directory_path: str) -> dict:\n    framework_files_count = {}\n    for root, _, files in os.walk(directory_path):\n        for file in files:\n            if file.startswith(\"file\"):  # Assuming all files start with \"file\"\n                framework_name = root.split('/')[-1]  # Extract framework name from the directory path\n                framework_files_count[framework_name] = framework_files_count.get(framework_name, 0) + 1\n    return framework_files_count\n", "entry_point": "analyze_trained_model_directory", "input": "'/path/to/empty/directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15444_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002008", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return 0\n    max1 = max2 = max3 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[5, 5, 6]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4670_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002009", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[1, 2, 3, 4, 5, 6, 7, 6]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002010", "code": "import ast\ndef count_unique_imports(code_snippet):\n    imports = set()\n    tree = ast.parse(code_snippet)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            imports.add(node.module.split('.')[0])\n    import_counts = {}\n    for module in imports:\n        import_counts[module] = sum(1 for imp in imports if imp == module)\n    return import_counts\n", "entry_point": "count_unique_imports", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147077_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002011", "code": "import re\ndef decode_entities(xml_string):\n    def replace_entity(match):\n        entity = match.group(0)\n        if entity == '&amp;':\n            return '&'\n        # Add more entity replacements as needed\n        return entity\n    return re.sub(r'&\\w+;', replace_entity, xml_string)\n", "entry_point": "decode_entities", "input": "'<x>fx>&amp;a'", "output": "'<x>fx>&a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69392_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002012", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "98", "output": "'b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002013", "code": "def generate_url_mapping(url_patterns):\n    url_mapping = {}\n    for url_name, view_function in url_patterns:\n        url_mapping[url_name] = view_function\n    return url_mapping\n", "entry_point": "generate_url_mapping", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88171_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002014", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'lne'", "output": "([], ['lne'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002015", "code": "def calculate_avg_revenue_per_employee(companies):\n    avg_revenue_per_employee = {}\n    for company in companies:\n        for name, values in company.items():\n            revenue, employees = values\n            avg_revenue_per_employee[name] = revenue / employees if employees != 0 else 0\n    return avg_revenue_per_employee\n", "entry_point": "calculate_avg_revenue_per_employee", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13494_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002016", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "'SomeLocation', 12349", "output": "'https://www.fitx.de/fitnessstudios/12349'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002017", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "8", "output": "'Unknown Type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002018", "code": "import re\ndef extract_metadata(script_content):\n    metadata = {\"docstring\": None, \"copyright\": None}\n    docstring_match = re.search(r'__doc__ = \"\"\"(.*?)\"\"\"', script_content, re.DOTALL)\n    if docstring_match:\n        metadata[\"docstring\"] = docstring_match.group(1)\n    copyright_match = re.search(r'__copyright__ = \"(.*?)\"', script_content)\n    if copyright_match:\n        metadata[\"copyright\"] = copyright_match.group(1)\n    return metadata\n", "entry_point": "extract_metadata", "input": "''", "output": "{'docstring': None, 'copyright': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147548_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002019", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'tole.txt'", "output": "('tole', '.txt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002020", "code": "def find_min_max(numbers):\n    if not numbers:\n        return None\n    min_value = float('inf')\n    max_value = float('-inf')\n    for num in numbers:\n        if num < min_value:\n            min_value = num\n        if num > max_value:\n            max_value = num\n    return min_value, max_value\n", "entry_point": "find_min_max", "input": "[1, 3, 5, 7]", "output": "(1, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24169_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002021", "code": "def get_type_from_uri_status(uri, status_code):\n    URI = \"/rest/testuri\"\n    TYPE_V200 = \"typeV200\"\n    TYPE_V300 = \"typeV300\"\n    DEFAULT_VALUES = {\n        \"200\": {\"type\": TYPE_V200},\n        \"300\": {\"type\": TYPE_V300}\n    }\n    if status_code in DEFAULT_VALUES and uri == URI:\n        return DEFAULT_VALUES[status_code][\"type\"]\n    else:\n        return \"Unknown\"\n", "entry_point": "get_type_from_uri_status", "input": "'/rest/testuri', '404'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6113_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002022", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "6, 2", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002023", "code": "def check_deletion(N, before, after):\n    if N % 2 == 0:\n        return \"Deletion succeeded\" if before[::2] == after else \"Deletion failed\"\n    else:\n        diff_count = sum(1 for i in range(N) if i < len(after) and before[i] != after[i])\n        return \"Deletion succeeded\" if diff_count == 1 else \"Deletion failed\"\n", "entry_point": "check_deletion", "input": "4, [1, 2, 3, 4], [5, 6]", "output": "'Deletion failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53001_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002024", "code": "def removeElement(nums, val):\n    \"\"\"\n    :type nums: List[int]\n    :type val: int\n    :rtype: int\n    \"\"\"\n    nums[:] = [num for num in nums if num != val]\n    return len(nums)\n", "entry_point": "removeElement", "input": "[1, 2, 3, 4, 4, 5, 6], 4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53354_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002025", "code": "def first_non_repeating_char_index(s):\n    char_count = {}\n    # Populate dictionary with character counts\n    for char in s:\n        if char not in char_count:\n            char_count[char] = 1\n        else:\n            char_count[char] += 1\n    # Find the index of the first non-repeating character\n    for idx, char in enumerate(s):\n        if char_count[char] == 1:\n            return idx\n    return -1\n", "entry_point": "first_non_repeating_char_index", "input": "'aabbc'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11467_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002026", "code": "mod = 10 ** 9 + 7\ndef count_ways(S):\n    A = [0] * (S + 1)\n    A[0] = 1\n    for s in range(3, S + 1):\n        A[s] = (A[s-3] + A[s-1]) % mod\n    return A[S]\n", "entry_point": "count_ways", "input": "11", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7358_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002027", "code": "from functools import reduce\nfrom operator import add\ndef calculate_sum(int_list):\n    # Using reduce with the add operator to calculate the sum\n    total_sum = reduce(add, int_list)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002028", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "(0.0, 0.0, 10.0, 10.0)", "output": "[5.0, 5.0, 10.0, 10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002029", "code": "from typing import List\ndef extract_resource_names(script: str) -> List[str]:\n    resource_names = set()\n    lines = script.split('\\n')\n    for line in lines:\n        if \"Resources\" in line:\n            start_index = line.find('Resources') + len('Resources') + 1\n            if '\"\"\"' in line:\n                start_quote_index = line.find('\"\"\"') + len('\"\"\"')\n                end_quote_index = line.rfind('\"\"\"')\n                resource_name = line[start_quote_index:end_quote_index].strip()\n                resource_names.add(resource_name)\n    return list(resource_names)\n", "entry_point": "extract_resource_names", "input": "'Some random text without the keyword'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104725_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002030", "code": "import importlib\nimport inspect\ndef list_submodules(module_name):\n    try:\n        module = importlib.import_module(module_name)\n        submodules = [name for name, obj in inspect.getmembers(module) if inspect.ismodule(obj)]\n        return submodules\n    except ImportError:\n        return []\n", "entry_point": "list_submodules", "input": "'fake_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90756_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002031", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[4, 7, 9, 10, 3, 8, 3, 3], 5", "output": "[4, 2, 4, 0, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002032", "code": "def jaccard_similarity(set1, set2):\n    intersection = len(set1.intersection(set2))\n    union = len(set1.union(set2))\n    if union == 0:  # Handle division by zero if both sets are empty\n        return 0.00\n    else:\n        return round(intersection / union, 2)\n", "entry_point": "jaccard_similarity", "input": "set(), set()", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53453_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002033", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[2, 2, 4, 2, 2, 4]", "output": "[4, 4, 8, 4, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002034", "code": "import re\nfrom typing import Dict\ndef parse_document(text: str) -> Dict[str, Dict[str, Dict[str, str]]]:\n    namespaces = {}\n    objects = {}\n    namespace_pattern = re.compile(r'- \\*\\*n\\.(.*?)\\*\\*\\n(.*?)\\n', re.DOTALL)\n    object_pattern = re.compile(r'- \\*\\*o\\.(.*?)\\*\\*\\n(.*?)\\n', re.DOTALL)\n    for match in namespace_pattern.finditer(text):\n        namespace_name, members_text = match.groups()\n        members = dict(re.findall(r'- \\*\\*(.*?)\\*\\*<br>\\n(.*?)\\n', members_text))\n        namespaces[namespace_name] = members\n    for match in object_pattern.finditer(text):\n        object_name, members_text = match.groups()\n        members = dict(re.findall(r'- \\*\\*(.*?)\\*\\*<br>\\n(.*?)\\n', members_text))\n        objects[object_name] = members\n    return {'namespaces': namespaces, 'objects': objects}\n", "entry_point": "parse_document", "input": "''", "output": "{'namespaces': {}, 'objects': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128883_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002035", "code": "def find_first_non_repeating_char(s):\n    char_count = {}\n    # Count occurrences of each character\n    for char in s:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    # Find the first non-repeating character\n    for i in range(len(s)):\n        if char_count[s[i]] == 1:\n            return i\n    return -1\n", "entry_point": "find_first_non_repeating_char", "input": "'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63867_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002036", "code": "def check_email_allow_list(email):\n    # Define a hardcoded email allow list\n    email_allow_list = [\"allowed@example.com\", \"user@example.com\", \"test@example.com\"]\n    return email in email_allow_list\n", "entry_point": "check_email_allow_list", "input": "'allowed@example.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107608_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002037", "code": "def extract_major_version(version: str) -> int:\n    # Find the index of the first dot in the version string\n    dot_index = version.index('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version[:dot_index]\n    # Convert the extracted substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'1.0'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39750_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3981", "output": "{1, 3, 3981, 1327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5384", "output": "{1, 2, 1346, 2692, 4, 673, 5384, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5383", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002040", "code": "def simulate_card_game(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    ties = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n        else:\n            ties += 1\n    return player1_wins, player2_wins, ties\n", "entry_point": "simulate_card_game", "input": "[2, 1, 0, 0, 0], [1, 3, 4, 5, 6]", "output": "(1, 4, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74585_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002041", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7961", "output": "{1, 19, 419, 7961}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002042", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'projects/7_8'", "output": "((7, 8), 'projects')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002043", "code": "def max_triangle_weight(triangle, level=0, index=0):\n    if level == len(triangle) - 1:\n        return triangle[level][index]\n    else:\n        return triangle[level][index] + max(\n            max_triangle_weight(triangle, level + 1, index),\n            max_triangle_weight(triangle, level + 1, index + 1)\n        )\n", "entry_point": "max_triangle_weight", "input": "[[0], [0, 1]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29046_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8191", "output": "{1, 8191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002045", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[1, 2, 3, 4], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002046", "code": "def max_sum_non_adjacent(nums):\n    if not nums:\n        return 0\n    include = nums[0]\n    exclude = 0\n    for i in range(1, len(nums)):\n        new_include = exclude + nums[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[5, 3, 9]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147999_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002047", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002048", "code": "def convert_message(message: str) -> str:\n    converted_message = \"\"\n    for char in message:\n        if char.isalpha():\n            converted_message += str(ord(char) - ord('a') + 1) + \"-\"\n        elif char == ' ':\n            converted_message += \"-\"\n    return converted_message[:-1]  # Remove the extra hyphen at the end\n", "entry_point": "convert_message", "input": "'hehlo world'", "output": "'8-5-8-12-15--23-15-18-12-4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148155_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002049", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[], 5", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002050", "code": "def sum_divisible_by_3_and_5(lst):\n    total_sum = 0\n    for num in lst:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127372_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002051", "code": "import os\ndef count_import_statements(directory):\n    total_imports = 0\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.endswith('.py'):\n                file_path = os.path.join(root, file)\n                with open(file_path, 'r') as f:\n                    lines = f.readlines()\n                    imports = sum(1 for line in lines if line.strip().startswith('import') or line.strip().startswith('from'))\n                    total_imports += imports\n    return total_imports\n", "entry_point": "count_import_statements", "input": "'/path/to/empty/directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70972_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002052", "code": "def request(login, password):\n    if len(login) < 5 or len(password) < 8:\n        return False\n    has_upper = any(char.isupper() for char in password)\n    has_lower = any(char.islower() for char in password)\n    has_digit = any(char.isdigit() for char in password)\n    return has_upper and has_lower and has_digit\n", "entry_point": "request", "input": "'user1', 'Password1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115609_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002053", "code": "def get_framework_abbreviation(framework_name):\n    frameworks = {\n        'pytorch': 'PT',\n        'tensorflow': 'TF',\n        'keras': 'KS',\n        'caffe': 'CF'\n    }\n    lowercase_framework = framework_name.lower()\n    if lowercase_framework in frameworks:\n        return frameworks[lowercase_framework]\n    else:\n        return 'Unknown'\n", "entry_point": "get_framework_abbreviation", "input": "'scikit-learn'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121670_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002054", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'example.jpg'", "output": "'ple.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002055", "code": "import socket\ndef get_domain_name(ip_address):\n    try:\n        result = socket.gethostbyaddr(ip_address)\n        return list(result)[0]\n    except socket.herror:\n        return \"Domain name not found\"\n", "entry_point": "get_domain_name", "input": "'0.0.0.0'", "output": "'Domain name not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122690_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002056", "code": "def process_resdict(resdict):\n    processed_dict = {}\n    for key, value in resdict.items():\n        if value[0] == '':\n            processed_dict[key] = value[1]\n    return processed_dict\n", "entry_point": "process_resdict", "input": "{'key1': ['non-empty', 'value1'], 'key2': ['not empty', 'value2']}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61174_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002057", "code": "def extract_django_settings(code_snippet):\n    settings_dict = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if '=' in line:\n            setting_name, setting_value = line.split('=')\n            setting_name = setting_name.strip()\n            setting_value = setting_value.strip().strip(\"'\").strip()\n            settings_dict[setting_name] = setting_value\n    return settings_dict\n", "entry_point": "extract_django_settings", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147540_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002058", "code": "def card_war(player1, player2):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1, player2):\n        if card_values[card1] > card_values[card2]:\n            player1_wins += 1\n        elif card_values[card1] < card_values[card2]:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins.\"\n    elif player1_wins < player2_wins:\n        return \"Player 2 wins.\"\n    else:\n        return \"It's a tie.\"\n", "entry_point": "card_war", "input": "['A', 'K', '2'], ['K', 'Q', '3']", "output": "'Player 1 wins.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147733_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7415", "output": "{1, 1483, 5, 7415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002060", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'hello'", "output": "'olleh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002061", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zzs'", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002062", "code": "def custom_str2bool(input_str):\n    lower_input = input_str.lower()\n    if lower_input == 'true':\n        return True\n    elif lower_input == 'false':\n        return False\n    else:\n        return False\n", "entry_point": "custom_str2bool", "input": "'random_string'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19130_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002063", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 1, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122742_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002064", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = low + (high - low) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[50, 60, 70, 80, 90], 50", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107830_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002065", "code": "import os\nfrom glob import glob\ndef create_transparent_folder(fname):\n    try:\n        os.chdir(fname)\n        png_file_list = glob(\"*.png\")\n        new_file_folder = os.path.join(fname, \"transparent\")\n        if png_file_list and not os.path.exists(new_file_folder):\n            os.makedirs(new_file_folder)\n            return True\n        else:\n            return False\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return False\n", "entry_point": "create_transparent_folder", "input": "'non_existent_directory'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134389_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1670", "output": "{1, 2, 835, 5, 1670, 167, 10, 334}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1669", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002067", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "10", "output": "[(1, 10), (2, 5), (5, 2), (10, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002068", "code": "CREATE = 'create'\nREPLACE = 'replace'\nUPDATE = 'update'\nDELETE = 'delete'\nALL = (CREATE, REPLACE, UPDATE, DELETE)\n_http_methods = {\n    CREATE: ('post',),\n    REPLACE: ('put',),\n    UPDATE: ('patch',),\n    DELETE: ('delete',)\n}\ndef get_http_methods(method):\n    return _http_methods.get(method, ('get',))  # Default to 'get' if method not found\n", "entry_point": "get_http_methods", "input": "'invalid'", "output": "('get',)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23129_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002069", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[8, 6, 4, 5]", "output": "[64, 36, 16, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002070", "code": "def calculate_total_parameters(shufflenet_variant):\n    ShuffleNetV2_cfg = {\n        'shufflenet_v2_x0_5': {'stages_repeats': [4, 8, 4], 'stages_out_channels': [24, 48, 96, 192, 1024]},\n        'shufflenet_v2_x1_0': {'stages_repeats': [4, 8, 4], 'stages_out_channels': [24, 116, 232, 464, 1024]},\n        'shufflenet_v2_x1_5': {'stages_repeats': [4, 8, 4], 'stages_out_channels': [24, 176, 352, 704, 1024]},\n        'shufflenet_v2_x2_0': {'stages_repeats': [4, 8, 4], 'stages_out_channels': [24, 244, 488, 976, 2048]}\n    }\n    shufflenet_cfg = ShuffleNetV2_cfg.get(shufflenet_variant)\n    if shufflenet_cfg is None:\n        return \"Invalid ShuffleNetV2 variant\"\n    stages_repeats = shufflenet_cfg['stages_repeats']\n    stages_out_channels = shufflenet_cfg['stages_out_channels']\n    total_params = 0\n    in_channels = 3  # Initial input channels\n    for repeats, out_channels in zip(stages_repeats, stages_out_channels):\n        for _ in range(repeats):\n            total_params += in_channels * out_channels\n            in_channels = out_channels\n    total_params += in_channels * 1024  # Last stage output channels\n    return total_params\n", "entry_point": "calculate_total_parameters", "input": "'shufflenet_v2_x3_0'", "output": "'Invalid ShuffleNetV2 variant'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26257_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002071", "code": "def generate_source_filters(build_flags):\n    source_filters = [\"+<TRB_MCP23017.h>\"]\n    if build_flags.get(\"TRB_MCP23017_ESP_IDF\"):\n        source_filters.extend([\"+<TRB_MCP23017.c>\", \"+<sys/esp_idf>\"])\n    if build_flags.get(\"TRB_MCP23017_ARDUINO_WIRE\"):\n        source_filters.extend([\"+<TRB_MCP23017.cpp>\", \"+<sys/arduino_wire>\"])\n    if build_flags.get(\"TRB_MCP23017_ARDUINO_BRZO\"):\n        source_filters.extend([\"+<TRB_MCP23017.cpp>\", \"+<sys/arduino_brzo>\"])\n    return source_filters\n", "entry_point": "generate_source_filters", "input": "{}", "output": "['+<TRB_MCP23017.h>']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87162_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1576", "output": "{1, 2, 4, 197, 1576, 8, 394, 788}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1575", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002073", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1])  # Append the last element unchanged\n    return output_list\n", "entry_point": "process_list", "input": "[1, 5, 1, 4, 6, 1, 4]", "output": "[6, 6, 5, 10, 7, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114829_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002074", "code": "# Define the predefined player signals\nPLAYER_SIGNALS = ('loop-status', 'metadata', 'seeked', 'shuffle', 'volume')\ndef filter_player_signals(signal_names):\n    return [signal for signal in signal_names if signal in PLAYER_SIGNALS]\n", "entry_point": "filter_player_signals", "input": "['metadata', 'volume', 'random-signal']", "output": "['metadata', 'volume']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50143_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002075", "code": "from typing import List, Union, Any\ndef total_string_length(input_list: List[Union[str, Any]]) -> int:\n    total_length = 0\n    for element in input_list:\n        if isinstance(element, str):\n            total_length += len(element)\n    return total_length\n", "entry_point": "total_string_length", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92258_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002076", "code": "def is_valid_brackets(s: str) -> bool:\n    stack = []\n    bracket_pairs = {')': '(', ']': '[', '}': '{'}\n    for char in s:\n        if char in bracket_pairs.values():\n            stack.append(char)\n        elif char in bracket_pairs.keys():\n            if not stack or stack.pop() != bracket_pairs[char]:\n                return False\n    return not stack\n", "entry_point": "is_valid_brackets", "input": "')'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59295_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002077", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[-1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002078", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "2.5, 4.0, 4.370000000000004", "output": "20.92500000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002079", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "42340, '0.000'", "output": "'4.234E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002080", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "5, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt58", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002081", "code": "input_tokenizer = {\n    'en-bg': '-l en -a',\n    'en-cs': '-l en -a',\n    'en-de': '-l en -a',\n    'en-el': '-l en -a',\n    'en-hr': '-l en -a',\n    'en-it': '-l en -a',\n    'en-nl': '-l en -a',\n    'en-pl': '-l en -a',\n    'en-pt': '-l en -a',\n    'en-ru': '-l en -a',\n    'en-zh': '-l en -a'\n}\ndef get_input_tokenizer(language_pair):\n    return input_tokenizer.get(language_pair, 'Tokenizer not found')\n", "entry_point": "get_input_tokenizer", "input": "'en-fr'", "output": "'Tokenizer not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90753_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002082", "code": "import os\ndef filter_instances(directory):\n    instances = []\n    if os.path.exists(directory):\n        items = os.listdir(directory)\n        instances = [os.path.join(directory, e) for e in items if e.endswith('.cnf') or e.endswith('.cnf.gz')]\n    return instances\n", "entry_point": "filter_instances", "input": "'non_existent_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79982_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002083", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 9, 9]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20797_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002084", "code": "def adjust_grades(grades, game_results):\n    MAX_TAKEN = 40\n    changed_users_id = set()\n    for game_result in game_results:\n        changed_users_id.add(game_result['win'])\n        changed_users_id.add(game_result['lose'])\n        grades[game_result['win']] += MAX_TAKEN - game_result['taken']\n        grades[game_result['lose']] -= MAX_TAKEN - game_result['taken']\n    commands = [{'id': user_id, 'grade': grades[user_id]} for user_id in changed_users_id]\n    return commands\n", "entry_point": "adjust_grades", "input": "[80, 90, 75], []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20729_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1839", "output": "{1, 3, 613, 1839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002086", "code": "import re\ndef count_duplicate_blocks(script):\n    pattern = r\"if __name__ == '__main__':\\n    unittest.main()\"\n    matches = re.findall(pattern, script)\n    return len(matches)\n", "entry_point": "count_duplicate_blocks", "input": "\"print('Hello, world!')\"", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38057_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002087", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8642", "output": "{1, 8642, 2, 4321, 298, 149, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002088", "code": "import re\ndef extract_version_history(file_content: str) -> dict:\n    version_history = {\"version\": \"\", \"history\": []}\n    version_match = re.search(r'version (\\d+\\.\\d+\\.\\d+)', file_content)\n    if version_match:\n        version_history[\"version\"] = version_match.group(1)\n    history_matches = re.finditer(r'(\\d{4}/\\d{2}/\\d{2}): (.+?)(?=\\n\\d{4}/\\d{2}/\\d{2}|$)', file_content)\n    for match in history_matches:\n        date = match.group(1)\n        phases = match.group(2).split('\\n')\n        version_history[\"history\"].append({\"date\": date, \"phases\": phases})\n    return version_history\n", "entry_point": "extract_version_history", "input": "''", "output": "{'version': '', 'history': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44431_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002089", "code": "def parse_ssm_parameters(parameters):\n    parsed_parameters = {}\n    for param in parameters:\n        param_name = param.get('parameter_name')\n        param_value = param.get('string_value')\n        if param_name and param_value:\n            parsed_parameters[param_name] = param_value\n    return parsed_parameters\n", "entry_point": "parse_ssm_parameters", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11018_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002090", "code": "def process_network_interface(command):\n    if command.startswith(\"ifconfig\"):\n        interface = command.split(\" \")[1] if len(command.split(\" \")) > 1 else None\n        if interface == \"wlan0\":\n            return f\"{interface}: <interface information>\"\n        else:\n            return f\"{interface}: error fetching interface information: Device not found\"\n    else:\n        return \"\"\n", "entry_point": "process_network_interface", "input": "'ls'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66686_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002091", "code": "def canCross(stones):\n    if not stones:\n        return True\n    if stones[1] != 1:\n        return False\n    graph = {val: idx for idx, val in enumerate(stones)}\n    def dfs(stones, graph, pos, jump):\n        if pos == stones[-1]:\n            return True\n        for next_jump in [jump-1, jump, jump+1]:\n            if next_jump <= 0:\n                continue\n            next_pos = pos + next_jump\n            if next_pos in graph and dfs(stones, graph, next_pos, next_jump):\n                return True\n        return False\n    return dfs(stones, graph, 1, 1)\n", "entry_point": "canCross", "input": "[0, 1, 2, 3, 4]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17785_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002092", "code": "def filter_atoms(atom_symbols, forbidden_atoms):\n    filtered_atoms = []\n    for atom in atom_symbols:\n        if atom in forbidden_atoms or 'H' in atom:\n            continue\n        filtered_atoms.append(atom)\n    return filtered_atoms\n", "entry_point": "filter_atoms", "input": "['H', 'O', 'C', 'N', 'Ar', 'Cl'], ['H', 'Ar', 'Cl']", "output": "['O', 'C', 'N']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002093", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[140, 135, 130, 130, 129], 5", "output": "132.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002094", "code": "def sum_fibonacci(N):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(N):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135288_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002095", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "1, 1, 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002096", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[12, 2, 12, 35], 1", "output": "[2, 12, 12, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002097", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002098", "code": "from typing import List\ndef count_visible_buildings(buildings: List[int]) -> int:\n    visible_count = 0\n    max_height = 0\n    for height in buildings[::-1]:\n        if height > max_height:\n            visible_count += 1\n            max_height = height\n    return visible_count\n", "entry_point": "count_visible_buildings", "input": "[5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17783_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002099", "code": "def attribute_fixer(attribute, value):\n    valid_attributes = [\"health\", \"mana\", \"strength\"]\n    if attribute in valid_attributes and value > 0:\n        return True\n    else:\n        return False\n", "entry_point": "attribute_fixer", "input": "'agility', 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37198_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002100", "code": "import sys\ndef get_email_message_class(email_message_type):\n    email_message_classes = {\n        'EmailMessage': 'EmailMessage',\n        'EmailMultiAlternatives': 'EmailMultiAlternatives',\n        'MIMEImage': 'MIMEImage' if sys.version_info < (3, 0) else 'MIMEImage'\n    }\n    return email_message_classes.get(email_message_type, 'Unknown')\n", "entry_point": "get_email_message_class", "input": "'NonExistentType'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140417_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002101", "code": "from typing import List\ndef custom_reduce_product(nums: List[int]) -> int:\n    result = 1\n    for num in nums:\n        result *= num\n    return result\n", "entry_point": "custom_reduce_product", "input": "[0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84659_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002102", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[0, 1, 2, 3, 4, 5], 2", "output": "[[0, 1], [2, 3], [4, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002103", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mtr.sync.apps.MtrSyncConfig'", "output": "('mtr.sync.apps', 'MtrSyncConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002104", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'Alice', 'Presidential Election 2024'", "output": "'Sample Election: Alice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "16", "output": "{1, 2, 4, 8, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002106", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "6, 8", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002107", "code": "import re\ndef count_words(text):\n    word_counts = {}\n    # Split the text into individual words\n    words = text.split()\n    for word in words:\n        # Remove punctuation marks and convert to lowercase\n        cleaned_word = re.sub(r'[^\\w\\s]', '', word).lower()\n        # Update word count in the dictionary\n        if cleaned_word in word_counts:\n            word_counts[cleaned_word] += 1\n        else:\n            word_counts[cleaned_word] = 1\n    return word_counts\n", "entry_point": "count_words", "input": "'heaaxath'", "output": "{'heaaxath': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123802_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3788", "output": "{1, 2, 4, 1894, 3788, 947}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3787", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002109", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[-2, 2, 3, 8, 8, 8, 8, -1]", "output": "[-2, 2, 3, 8, 8, 8, 8, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002110", "code": "def extract_default_configurations(code_snippet):\n    default_configurations = {}\n    for line in code_snippet.split('\\n'):\n        if '=' in line and 'os.environ.get' not in line:\n            key, value = line.split('=')\n            key = key.strip()\n            value = value.strip().split('#')[0].strip()\n            if value.startswith(\"'\") or value.startswith('\"'):\n                value = value.strip(\"'\").strip('\"')\n            elif value.isdigit():\n                value = int(value)\n            elif value.startswith('[') and value.endswith(']'):\n                value = [item.strip().strip(\"'\").strip('\"') for item in value[1:-1].split(',')]\n            default_configurations[key] = value\n    return default_configurations\n", "entry_point": "extract_default_configurations", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110760_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002111", "code": "from typing import Tuple, Optional\ndef validate_input(input_str: str) -> Tuple[bool, Optional[str]]:\n    if len(input_str) < 5:\n        return False, 'Validation failed'\n    if any(char.isdigit() for char in input_str):\n        return False, 'Validation failed'\n    if not input_str.endswith('valid'):\n        return False, 'Validation failed'\n    return True, 'Validation successful'\n", "entry_point": "validate_input", "input": "'test'", "output": "(False, 'Validation failed')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146832_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002112", "code": "import sys\ndef is_java_double_max_approx(number):\n    \"\"\"Returns True if the specified number is approximately equal to the maximum value of a Double in Java; False, otherwise.\n    Keyword arguments:\n    number -- number to check\n    \"\"\"\n    return type(number) == float and abs(number - sys.float_info.max) < sys.float_info.epsilon\n", "entry_point": "is_java_double_max_approx", "input": "1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18206_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002113", "code": "import os\nimport logging\nlogger = logging.getLogger(__name__)\nOWNER_ID = os.getenv(\"OWNER_ID\")\nHELPER_SCRIPTS = {}\nBASE_URL = \"https://muquestionpapers.com/\"\nCOURSES_LIST = {'BE': 'be', 'ME': 'me', 'BSC': 'bs', \"BCOM\": 'bc', \"BAF\": 'ba', \"BBI\": 'bi', \"BFM\": 'bf', \"BMS\": 'bm', \"MCA\": 'mc'}\ndef generate_course_url(course_code, year):\n    if course_code not in COURSES_LIST:\n        return \"Invalid course code provided.\"\n    course_url = BASE_URL + COURSES_LIST[course_code] + str(year) + \"/\"\n    return course_url\n", "entry_point": "generate_course_url", "input": "'MED', 2023", "output": "'Invalid course code provided.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141345_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4247", "output": "{1, 137, 31, 4247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002115", "code": "from typing import List\ndef is_majority(nums: List[int], target: int) -> bool:\n    if len(nums) == 1:\n        return nums[0] == target\n    p, q = 0, len(nums) - 1\n    while p < q:\n        if nums[p] > target:\n            return False\n        elif nums[p] < target:\n            p += 1\n        if nums[q] < target:\n            return False\n        elif nums[q] > target:\n            q -= 1\n        if nums[p] == nums[q] == target:\n            return q - p + 1 > len(nums) // 2\n    return False\n", "entry_point": "is_majority", "input": "[1, 2, 3, 4], 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5303_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002116", "code": "def simulate_card_war(player1_deck, player2_deck):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    return player1_points, player2_points\n", "entry_point": "simulate_card_war", "input": "[2, 1], [1, 2]", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3214_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002117", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "10, 2.8736579881776114", "output": "143.68289940888056", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002118", "code": "from typing import List\ndef sum_multiples_of_3_or_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148821_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002119", "code": "def validate_password(password):\n    # Check the length of the password\n    if len(password) < 8:\n        return False\n    # Check for at least one uppercase, one lowercase, and one digit\n    if not any(char.isupper() for char in password) or \\\n       not any(char.islower() for char in password) or \\\n       not any(char.isdigit() for char in password):\n        return False\n    # Check for whitespace characters\n    if any(char.isspace() for char in password):\n        return False\n    return True\n", "entry_point": "validate_password", "input": "'Pass1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48070_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002120", "code": "import sys\ndef package_installed(package_name):\n    if sys.version_info[0] == 2:\n        try:\n            import imp\n            imp.find_module(package_name)\n            return True\n        except ImportError:\n            return False\n    elif sys.version_info[0] == 3:\n        import importlib.util\n        spec = importlib.util.find_spec(package_name)\n        return spec is not None\n", "entry_point": "package_installed", "input": "'nonexistent_package_xyz'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146736_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002121", "code": "def truncatechars(value, arg):\n    try:\n        length = int(arg)\n    except ValueError:\n        return value  # Return original value if arg is not a valid integer\n    if len(value) > length:\n        return value[:length] + '...'  # Truncate and append '...' if length exceeds arg\n    return value  # Return original value if length is not greater than arg\n", "entry_point": "truncatechars", "input": "'1234567890', 10", "output": "'1234567890'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15483_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002122", "code": "def check_word(word):\n    letters = [\"a\", \"e\", \"t\", \"o\", \"u\"]\n    if len(word) < 7:\n        return 2\n    if (word[1] in letters) and (word[6] in letters):\n        return 0\n    elif (word[1] in letters) or (word[6] in letters):\n        return 1\n    else:\n        return 2\n", "entry_point": "check_word", "input": "'xeyxxxx'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56928_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002123", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "1", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002124", "code": "def extract_security_settings(code_snippet):\n    enabled_security_settings = []\n    for line in code_snippet.splitlines():\n        if \"=\" in line:\n            setting, value = line.split(\"=\")\n            setting = setting.strip()\n            value = value.strip()\n            if value == \"True\":\n                enabled_security_settings.append(setting)\n    return enabled_security_settings\n", "entry_point": "extract_security_settings", "input": "'setting1 = False\\nsetting2 = 0\\nsetting3 = \"Some value\"\\n'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101640_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002125", "code": "def longest_substring_within_budget(s, costs, budget):\n    start = 0\n    end = 0\n    current_cost = 0\n    max_length = 0\n    n = len(s)\n    while end < n:\n        current_cost += costs[ord(s[end]) - ord('a')]\n        while current_cost > budget:\n            current_cost -= costs[ord(s[start]) - ord('a')]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_substring_within_budget", "input": "'a', [1] * 26, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17714_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002126", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[6, 7, 11, 3, 16, 4, 11, 4]", "output": "[13, 18, 14, 19, 20, 15, 15, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002127", "code": "def is_xpath_selector(selector):\n    return selector.startswith('/')\n", "entry_point": "is_xpath_selector", "input": "'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92618_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002128", "code": "def count_unique_integers(lst):\n    unique_integers = set()\n    for element in lst:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[1, 2, 2, 3, 'text', 4, 5.0, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33684_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002129", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 11, 6, 10, 1, 2, 10, 2, 7]", "output": "[2, 12, 8, 13, 5, 7, 16, 9, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002130", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[2, 3, 1, 3, 0, 2, 2, 2, 2]", "output": "[2, 4, 3, 6, 4, 7, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002131", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_count = len(scores)\n    average_score = total_sum / total_count\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[84, 86]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116681_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002132", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'X/C01/co'", "output": "('X', 'C01', 'co')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002133", "code": "def neuinfer(inputs, constant, scale):\n    output = []\n    for value in inputs:\n        result = round((value + constant) * scale)\n        output.append(result)\n    return output\n", "entry_point": "neuinfer", "input": "[8, 10, 8, 9, 10, 5, 10, 8, 5], 2, 1", "output": "[10, 12, 10, 11, 12, 7, 12, 10, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69921_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002134", "code": "from typing import List\ndef sum_of_even_numbers(nums: List[int]) -> int:\n    sum_even = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[2, 4, 6, 8, 6]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105255_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002135", "code": "def sum_even_numbers(lst):\n    even_sum = 0\n    for num in lst:\n        if isinstance(num, int) and num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[10, 12, 8, 6, 2, 'text', 3.5]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54990_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002136", "code": "def processImgFacial(image_data):\n    # Placeholder facial recognition process\n    return \"Facial recognition result\"\n", "entry_point": "processImgFacial", "input": "'example_image_data'", "output": "'Facial recognition result'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48201_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002137", "code": "def find_second_largest(x, y, z):\n    # Find the minimum, maximum, and sum of the three numbers\n    minimum = min(x, y, z)\n    maximum = max(x, y, z)\n    total = x + y + z\n    # Calculate the second largest number\n    second_largest = total - minimum - maximum\n    return second_largest\n", "entry_point": "find_second_largest", "input": "4, 5, 6", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77878_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002138", "code": "def find_most_common_element(input_list):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    max_frequency = max(frequency_dict.values())\n    most_common_elements = [key for key, value in frequency_dict.items() if value == max_frequency]\n    return min(most_common_elements)\n", "entry_point": "find_most_common_element", "input": "[3, 3, 3, 3, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5927_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9218", "output": "{1, 9218, 2, 4609, 419, 838, 11, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9217", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002140", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[3, 2, 2, 2, 5, 1, 4]", "output": "[3, 5, 7, 9, 14, 15, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002141", "code": "def getfirstN(dict, N):\n    \"\"\"\n    Retrieve the first N elements of a dictionary based on keys.\n    Args:\n    dict (dict): Input dictionary.\n    N (int): Number of elements to retrieve.\n    Returns:\n    dict: New dictionary containing the first N elements based on keys.\n    \"\"\"\n    sorted_dict = sorted(dict.items())\n    ret = {}\n    for key, value in sorted_dict[:N]:\n        ret[key] = value\n    return ret\n", "entry_point": "getfirstN", "input": "{}, 5", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120147_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002142", "code": "def validate_phone_number(phone_number):\n    if not isinstance(phone_number, str):\n        return False\n    phone_number = phone_number.lstrip('+')\n    if not phone_number.isdigit():\n        return False\n    if len(phone_number) < 10:\n        return False\n    return True\n", "entry_point": "validate_phone_number", "input": "1234567890", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103179_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002143", "code": "def simulate_editor_loading(loading_steps):\n    busy = False\n    block_displayed = False\n    for step in loading_steps:\n        resource, duration = step\n        if resource == \"JS\":\n            busy = True\n        elif resource == \"CSS\":\n            block_displayed = True\n        # Simulate loading duration\n        for _ in range(duration):\n            pass\n        if resource == \"JS\":\n            busy = False\n    if busy:\n        return \"busy\"\n    elif block_displayed:\n        return \"block_displayed\"\n    else:\n        return \"idle\"\n", "entry_point": "simulate_editor_loading", "input": "[('JS', 2), ('CSS', 1), ('JS', 3)]", "output": "'block_displayed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69961_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002144", "code": "def fibonacci_sequence(n):\n    fib_sequence = [0, 1]\n    while len(fib_sequence) < n:\n        next_num = fib_sequence[-1] + fib_sequence[-2]\n        fib_sequence.append(next_num)\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "2", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52360_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002145", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'t=addtskt'", "output": "{'field': 't', 'value': 'addtskt'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002146", "code": "import os\ndef compare_log_files(base_path):\n    result_string = \"\"\n    if os.path.exists(base_path):\n        subdirs = os.listdir(base_path)\n        for subdir in subdirs:\n            subsubbasepath = os.path.join(base_path, subdir)\n            if os.path.isdir(subsubbasepath):\n                subsubdirs = os.listdir(subsubbasepath)\n                result_string += subsubbasepath + '\\n'\n                content = []\n                for i in range(len(subsubdirs) - 1):\n                    for j in range(i + 1, len(subsubdirs)):\n                        diff_result = os.system('diff ' + os.path.join(subsubbasepath, subsubdirs[i], 'log_json.txt') + ' ' + os.path.join(subsubbasepath, subsubdirs[j], 'log_json.txt'))\n                        content.append([diff_result, subsubdirs[i], subsubdirs[j]])\n                filtered_content = [i for i in content if i[0] == 0]\n                for i in range(len(filtered_content)):\n                    result_string += ' and '.join(filtered_content[i][1:])\n                    if i != len(filtered_content) - 1:\n                        result_string += ', '\n                result_string += '\\n\\n'\n    else:\n        result_string = \"Base directory not found.\"\n    return result_string\n", "entry_point": "compare_log_files", "input": "'/path/to/non/existing/directory'", "output": "'Base directory not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8157_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002147", "code": "def remove_vowels(string):\n    result = ''\n    for char in string:\n        if char not in 'aeiouAEIOU':\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'World!World!'", "output": "'Wrld!Wrld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87966_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002148", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[2, 1, 3, 3, 3, 2, 1, 1, 3]", "output": "[2, 2, 5, 6, 7, 7, 7, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002149", "code": "def repeatedString(s, n):\n    count_1 = n // len(s) * s.count('a')  # Count of 'a' in complete repetitions of s\n    remained_string = n % len(s)  # Number of characters left after complete repetitions\n    count_2 = s[:remained_string].count('a')  # Count of 'a' in the remaining characters\n    return count_1 + count_2\n", "entry_point": "repeatedString", "input": "'aaa', 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29420_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2761", "output": "{1, 11, 2761, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002151", "code": "import importlib.util\ndef get_package_modules(package_name):\n    try:\n        spec = importlib.util.find_spec(package_name)\n        if spec is None:\n            raise ModuleNotFoundError(f\"Package '{package_name}' not found.\")\n        init_file_path = spec.submodule_search_locations[0] + \"/__init__.py\"\n        with open(init_file_path, 'r') as init_file:\n            init_content = init_file.read()\n            exec(init_content)\n            if '__all__' in locals():\n                return locals()['__all__']\n            else:\n                return []\n    except Exception as e:\n        print(f\"Error: {e}\")\n        return []\n", "entry_point": "get_package_modules", "input": "'pyparsing'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56088_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002152", "code": "NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION = 0\nNOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION = 1\nNOTIFICATION_REPORTED_AS_FALLACY = 2\nNOTIFICATION_FOLLOWED_A_SPEAKER = 3\nNOTIFICATION_SUPPORTED_A_DECLARATION = 4\nNOTIFICATION_TYPES = (\n    (NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION, \"added-declaration-for-resolution\"),\n    (NOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION, \"added-declaration-for-declaration\"),\n    (NOTIFICATION_REPORTED_AS_FALLACY, \"reported-as-fallacy\"),\n    (NOTIFICATION_FOLLOWED_A_SPEAKER, \"followed\"),\n    (NOTIFICATION_SUPPORTED_A_DECLARATION, \"supported-a-declaration\"),\n)\ndef get_notification_message(notification_type):\n    for notification_tuple in NOTIFICATION_TYPES:\n        if notification_tuple[0] == notification_type:\n            return notification_tuple[1]\n    return \"Notification type not found\"\n", "entry_point": "get_notification_message", "input": "2", "output": "'reported-as-fallacy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86427_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002153", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[19, 3]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89844_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002154", "code": "def is_valid_xml_tag(tag: str) -> bool:\n    stack = []\n    i = 0\n    while i < len(tag):\n        if tag[i] == '<':\n            i += 1\n            if i >= len(tag) or not tag[i].isalnum() and tag[i] != '_':\n                return False\n            while i < len(tag) and (tag[i].isalnum() or tag[i] == '_'):\n                i += 1\n            if i >= len(tag) or tag[i] == '>':\n                return False\n            stack.append(tag[i-1])\n        elif tag[i] == '>':\n            if not stack or stack.pop() != '<':\n                return False\n        i += 1\n    return len(stack) == 0\n", "entry_point": "is_valid_xml_tag", "input": "'<tag'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48676_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002155", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4747", "output": "{1, 4747, 101, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002156", "code": "def longest_substring_with_k_distinct(s, k):\n    max_length = 0\n    start = 0\n    char_count = {}\n    for end in range(len(s)):\n        char_count[s[end]] = char_count.get(s[end], 0) + 1\n        while len(char_count) > k:\n            char_count[s[start]] -= 1\n            if char_count[s[start]] == 0:\n                del char_count[s[start]]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_substring_with_k_distinct", "input": "'aabba', 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18078_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002157", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9889", "output": "{1, 9889, 899, 319, 11, 341, 29, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002158", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[100, 99]", "output": "2388", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002159", "code": "import re\ndef extract_comments(expected_stdout, expected_stderr):\n    comments = re.findall(r'Comment by (\\w+)', expected_stdout)\n    user_info = re.search(r'Effective user is (\\w+)', expected_stderr)\n    if user_info:\n        user = user_info.group(1)\n        user_comments = {}\n        for comment in comments:\n            if comment not in user_comments:\n                user_comments[comment] = []\n            user_comments[comment].append(f'Comment by {comment}')\n        return user_comments\n    else:\n        return {}\n", "entry_point": "extract_comments", "input": "'Some comment by user1', 'Some other information'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3585_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002160", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'osdiodpe'", "output": "'osdiodpe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002161", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[4]", "output": "(4, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002162", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', logging.INFO", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002163", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[1, 0, 2, 4, 0]", "output": "[1, 2, 6, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002164", "code": "# Define the mapping between object names and IDs\nobj2id = {\n    \"benchvise\": 2,\n    \"driller\": 7,\n    \"phone\": 21,\n}\ndef get_object_id(obj_name):\n    \"\"\"\n    Get the object ID corresponding to the given object name.\n    Args:\n        obj_name (str): The object name to look up.\n    Returns:\n        int: The object ID if found, otherwise -1.\n    \"\"\"\n    return obj2id.get(obj_name, -1)\n", "entry_point": "get_object_id", "input": "'laptop'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97943_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002165", "code": "import json\ndef process_model_config(model_options: str) -> dict:\n    model_cfg = {}\n    if model_options is not None:\n        try:\n            model_cfg = json.loads(model_options)\n        except json.JSONDecodeError:\n            print(\"Invalid JSON format. Returning an empty dictionary.\")\n    return model_cfg\n", "entry_point": "process_model_config", "input": "None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46465_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002166", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'Name: exorg'", "output": "('exorg', False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002167", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6483", "output": "{3, 1, 6483, 2161}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002168", "code": "def calculate_total_price(menu_items):\n    total_price = sum(item[\"price\"] for item in menu_items)\n    return total_price\n", "entry_point": "calculate_total_price", "input": "[{'price': 5.99}]", "output": "5.99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105001_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002169", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[5, 0, 12, 12, 12, 12]", "output": "[5, 12, 12, 12, 12, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002170", "code": "from typing import List\ndef count_runtime_classes(runtime_classes: List[dict]) -> dict:\n    class_count = {}\n    for runtime_class in runtime_classes:\n        class_name = runtime_class.get(\"name\")\n        if class_name in class_count:\n            class_count[class_name] += 1\n        else:\n            class_count[class_name] = 1\n    return class_count\n", "entry_point": "count_runtime_classes", "input": "[{'name': None}] * 8", "output": "{None: 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69123_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002171", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 2, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143850_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002172", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'2 + 3'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002173", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'300 10 +'", "output": "310", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002174", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'22.5.0.5'", "output": "(22, 5, 0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002175", "code": "def find_pairs_sum_to_target(nums, target):\n    seen = {}\n    pairs = []\n    for num in nums:\n        diff = target - num\n        if diff in seen:\n            pairs.append([num, diff])\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs_sum_to_target", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23906_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2738", "output": "{1, 2, 37, 74, 2738, 1369}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002177", "code": "def extract_module_and_test_cases(code_snippet):\n    lines = code_snippet.split('\\n')\n    module_name = lines[0].split('/')[-1].strip()\n    test_cases = []\n    for line in lines:\n        if 'from cloudalbum.tests' in line:\n            test_case = line.split()[-1]\n            test_cases.append(test_case)\n    return {'module_name': module_name, 'test_cases': test_cases}\n", "entry_point": "extract_module_and_test_cases", "input": "''", "output": "{'module_name': '', 'test_cases': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133977_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002178", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99506_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002179", "code": "import os\ndef count_files(directory: str, pattern: str) -> int:\n    count = 0\n    try:\n        for item in os.listdir(directory):\n            item_path = os.path.join(directory, item)\n            if os.path.isfile(item_path) and item.endswith(pattern):\n                count += 1\n            elif os.path.isdir(item_path):\n                count += count_files(item_path, pattern)\n    except FileNotFoundError:\n        pass\n    return count\n", "entry_point": "count_files", "input": "'/path/to/nonexistent/directory', '.txt'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144582_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002180", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'Hello, World. Thiis tesW!TThTi'", "output": "'Hello World Thiis tesW!TThTi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002181", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "3, 2", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002182", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[70, 80, 80, 90, 90]", "output": "83.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91403_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002183", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[7, 5]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89523_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1001", "output": "{1, 7, 1001, 11, 13, 77, 143, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002185", "code": "import os\ndef calculate_total_file_size(directory_path):\n    total_size = 0\n    try:\n        for item in os.listdir(directory_path):\n            item_path = os.path.join(directory_path, item)\n            if os.path.isfile(item_path):\n                total_size += os.path.getsize(item_path)\n            elif os.path.isdir(item_path):\n                total_size += calculate_total_file_size(item_path)\n    except FileNotFoundError:\n        pass\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "'non_existent_directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9318_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002186", "code": "def calculate_parlay_payout(odds):\n    \"\"\"\n    Calculate the potential payout for a parlay bet based on the provided odds.\n    :param odds: List. A list of odds for individual wagers in decimal format.\n    :return: Potential payout for the parlay bet in decimal terms.\n    \"\"\"\n    payout = 1\n    for odd in odds:\n        payout *= odd\n    return payout\n", "entry_point": "calculate_parlay_payout", "input": "[]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15672_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002187", "code": "import re\ndef extract_authors(script):\n    authors = []\n    in_authors_section = False\n    for line in script.splitlines():\n        if line.strip().startswith('Authors:'):\n            in_authors_section = True\n        elif in_authors_section and line.strip().startswith('-'):\n            match = re.search(r'<(.*?)>\\s*\\((.*?)\\)', line)\n            if match:\n                author_name = match.group(1)\n                author_email = match.group(2)\n                authors.append((author_name, author_email))\n        elif in_authors_section and not line.strip():\n            break\n    return authors\n", "entry_point": "extract_authors", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126344_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002188", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[4, 4, 5, 5, 5, 5]", "output": "[5.66, 5.66, 7.07, 7.07, 7.07, 7.07]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002189", "code": "def count_vowels(s):\n    vowels = set('aeiouAEIOU')\n    count = 0\n    for char in s:\n        if char in vowels:\n            count += 1\n    return count\n", "entry_point": "count_vowels", "input": "'abecidof'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127363_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002190", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002191", "code": "def find_missing_number(arr):\n    n = len(arr)\n    sum_of_arr = sum(arr)\n    sum_of_n_no = (n * (n + 1)) // 2\n    missing_number = sum_of_n_no - sum_of_arr\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[i for i in range(32) if i != 26]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97333_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2887", "output": "{1, 2887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002193", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://example.com/phot1ht_150x150'", "output": "'https://example.com/phot1ht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002194", "code": "def find_unique_inode(file_inodes):\n    unique_inode = 0\n    for inode in file_inodes:\n        unique_inode ^= inode\n    return unique_inode\n", "entry_point": "find_unique_inode", "input": "[5, 10, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61857_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002195", "code": "def calculate_total_photons(energy_bins, number_of_photons):\n    total_photons = 0\n    for energy, photons in zip(energy_bins, number_of_photons):\n        total_photons += energy * photons\n    return total_photons\n", "entry_point": "calculate_total_photons", "input": "[150], [3]", "output": "450", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106074_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002196", "code": "import math\ndef calculate_sin(x):\n    \"\"\"\n    Calculate the sine of the input angle x in radians.\n    Args:\n    x (float): Angle in radians\n    Returns:\n    float: Sine of the input angle x\n    \"\"\"\n    return math.sin(x)\n", "entry_point": "calculate_sin", "input": "math.asin(0.2923058037260414)", "output": "0.2923058037260414", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88101_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002197", "code": "def find_latest_version(versions):\n    latest_version = \"0.0.0\"\n    for version in versions:\n        version_parts = list(map(int, version.split(\".\")))\n        latest_parts = list(map(int, latest_version.split(\".\")))\n        if version_parts > latest_parts:\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '1.1.0', '1.0.1', '0.9.0']", "output": "'1.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12565_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002198", "code": "def max_sum_non_adjacent(lst):\n    if not lst:\n        return 0\n    include = lst[0]\n    exclude = 0\n    for i in range(1, len(lst)):\n        new_include = exclude + lst[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 1, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99727_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002199", "code": "def replace_digits(s: str) -> str:\n    result = []\n    prev_char = ''\n    for i, char in enumerate(s):\n        if char.isdigit():\n            result.append(chr(ord(prev_char) + int(char)))\n        else:\n            result.append(char)\n        prev_char = char\n    return ''.join(result)\n", "entry_point": "replace_digits", "input": "'ab3f'", "output": "'abef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43946_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002200", "code": "YEAR_CHOICES = (\n    (1, 'First'),\n    (2, 'Second'),\n    (3, 'Third'),\n    (4, 'Fourth'),\n    (5, 'Fifth'),\n)\ndef get_ordinal(year):\n    for num, ordinal in YEAR_CHOICES:\n        if num == year:\n            return ordinal\n    return \"Unknown\"\n", "entry_point": "get_ordinal", "input": "3", "output": "'Third'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43813_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002201", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'12:334'", "output": "(18, 820)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002202", "code": "import os\ndef count_lines_of_code(directory):\n    total_lines = 0\n    for root, _, files in os.walk(directory):\n        for file_name in files:\n            file_path = os.path.join(root, file_name)\n            if os.path.isfile(file_path):\n                with open(file_path, 'r') as file:\n                    lines = file.readlines()\n                    total_lines += sum(1 for line in lines if line.strip())\n    return total_lines\n", "entry_point": "count_lines_of_code", "input": "'empty_directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123842_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002203", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[93, 92, 90, 89, 88, 85]", "output": "[93, 92, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148811_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002204", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'mprprvalue1ameam'", "output": "('mprprvalue1ameam', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002205", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "2.0", "output": "12.57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56380_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002206", "code": "from typing import List\ndef majority_element(nums: List[int]) -> int:\n    candidate = None\n    count = 0\n    for num in nums:\n        if count == 0:\n            candidate = num\n            count = 1\n        elif num == candidate:\n            count += 1\n        else:\n            count -= 1\n    return candidate\n", "entry_point": "majority_element", "input": "[3, 3, 3, 3, 3, 1, 2, 1, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126055_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8396", "output": "{1, 2, 4, 4198, 8396, 2099}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8395", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002208", "code": "def process_env_list(env_list):\n    env_dict = {}\n    for env_name, is_visualized in env_list:\n        env_dict[env_name] = is_visualized\n    return env_dict\n", "entry_point": "process_env_list", "input": "[('Blackjack-v0', False)]", "output": "{'Blackjack-v0': False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138945_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002209", "code": "def calculate_average_color(colors):\n    total_red = 0\n    total_green = 0\n    total_blue = 0\n    for color in colors:\n        total_red += color[0]\n        total_green += color[1]\n        total_blue += color[2]\n    avg_red = round(total_red / len(colors))\n    avg_green = round(total_green / len(colors))\n    avg_blue = round(total_blue / len(colors))\n    return (avg_red, avg_green, avg_blue)\n", "entry_point": "calculate_average_color", "input": "[(117, 83, 83), (117, 83, 83), (117, 83, 83)]", "output": "(117, 83, 83)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79256_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002210", "code": "import importlib\ndef load_modules(version):\n    major, minor = map(int, version.split('.'))\n    modules = ['kernel', 'sync', 'queue', 'workers', 'network']\n    loaded_modules = []\n    for module_name in modules:\n        module_version = f'{module_name}.{major}.{minor}'\n        try:\n            module = importlib.import_module(module_version)\n            loaded_modules.append(module)\n        except ModuleNotFoundError:\n            print(f\"Module {module_version} not found.\")\n    return loaded_modules\n", "entry_point": "load_modules", "input": "'0.0'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118105_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002211", "code": "def extract_headers(text):\n    lines = text.split(\"\\n\")[1:]  # Split text by newline and skip the first line\n    headers = {}\n    for line in lines:\n        if not line:  # Stop when an empty line is encountered\n            break\n        key, value = line.split(\": \", 1)  # Split line into key and value\n        headers[key] = value\n    return headers\n", "entry_point": "extract_headers", "input": "'Header Line\\n'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110434_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002212", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'./p'", "output": "('p', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002213", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'WHello World, how are you?oyo'", "output": "('WHello', 'World, how are you?oyo')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002214", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3653", "output": "{1, 13, 3653, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002215", "code": "def calculate_bunkers(items, bunker_capacity, box_capacity):\n    total_boxes = items // box_capacity\n    total_bunkers = total_boxes // bunker_capacity\n    if items % box_capacity > 0:\n        total_bunkers += 1\n    return total_bunkers\n", "entry_point": "calculate_bunkers", "input": "1, 1, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101691_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002216", "code": "def get_country_from_ip(ip_address):\n    ip_country_mapping = {\n        \"8.8.8.8\": \"United States\",\n        \"13.32.0.0\": \"United States\",\n        \"23.56.0.0\": \"United States\",\n        \"91.198.174.192\": \"United Kingdom\",\n        \"103.86.99.100\": \"India\",\n        \"180.76.76.76\": \"China\",\n        \"202.12.27.33\": \"Australia\",\n        \"213.180.204.3\": \"Russia\",\n        \"220.181.38.148\": \"China\"\n    }\n    # Extract the first three octets of the IP address for lookup\n    ip_prefix = '.'.join(ip_address.split('.')[:3])\n    # Find the country based on the IP address prefix\n    country = ip_country_mapping.get(ip_prefix, \"Unknown\")\n    return country\n", "entry_point": "get_country_from_ip", "input": "'192.0.2.1'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68597_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002217", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hld'", "output": "['hld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77980_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002218", "code": "from typing import List\nfrom heapq import heapify, heappop\ndef find_kth_largest(nums: List[int], k: int) -> int:\n    if not nums:\n        return None\n    # Create a max-heap by negating each element\n    heap = [-num for num in nums]\n    heapify(heap)\n    # Pop k-1 elements from the heap\n    for _ in range(k - 1):\n        heappop(heap)\n    # Return the kth largest element (negate the result)\n    return -heap[0]\n", "entry_point": "find_kth_largest", "input": "[1, 2, 3], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124799_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002219", "code": "def generate_place_names(n):\n    place_names = []\n    for i in range(1, n+1):\n        if i % 2 == 0 and i % 3 == 0:\n            place_names.append(\"Metropolis\")\n        elif i % 2 == 0:\n            place_names.append(\"City\")\n        elif i % 3 == 0:\n            place_names.append(\"Town\")\n        else:\n            place_names.append(str(i))\n    return place_names\n", "entry_point": "generate_place_names", "input": "4", "output": "['1', 'City', 'Town', 'City']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143516_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002220", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'1.10.12.15.2'", "output": "(1, 10, 12, 15, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002221", "code": "def repeat_strings(strings, num_repeats):\n    if not strings or num_repeats <= 0:\n        return []\n    repeated_list = [s * num_repeats for s in strings]\n    for i, s in enumerate(repeated_list):\n        assert s == strings[i % len(strings)] * num_repeats\n    return repeated_list\n", "entry_point": "repeat_strings", "input": "['abc', 'def', 'ghi'], 3", "output": "['abcabcabc', 'defdefdef', 'ghighighi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16635_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002222", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9083", "output": "{1, 9083, 293, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002223", "code": "def combination_sum(candidates, target):\n    result = []\n    def backtrack(current_combination, start_index, remaining_target):\n        if remaining_target == 0:\n            result.append(current_combination[:])\n            return\n        for i in range(start_index, len(candidates)):\n            if candidates[i] <= remaining_target:\n                current_combination.append(candidates[i])\n                backtrack(current_combination, i, remaining_target - candidates[i])\n                current_combination.pop()\n    backtrack([], 0, target)\n    return result\n", "entry_point": "combination_sum", "input": "[2, 3, 5], 8", "output": "[[2, 2, 2, 2], [2, 3, 3], [3, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34241_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002224", "code": "def calculate_total_pages(data_count: int, page_size: int) -> int:\n    total_pages = data_count // page_size\n    if data_count % page_size != 0:\n        total_pages += 1\n    return total_pages\n", "entry_point": "calculate_total_pages", "input": "56, 7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125536_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002225", "code": "def execute_query(query):\n    data = []  # Placeholder for query result\n    alert = None  # Placeholder for error message\n    # Simulating database query execution\n    try:\n        # Assume query execution here\n        if query == \"SELECT * FROM table\":\n            data = [{\"id\": 1, \"name\": \"Alice\"}, {\"id\": 2, \"name\": \"Bob\"}]\n        else:\n            raise Exception(\"Invalid query\")\n    except Exception as e:\n        alert = str(e)\n    return data, alert\n", "entry_point": "execute_query", "input": "'Some invalid query'", "output": "([], 'Invalid query')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85324_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002226", "code": "def most_common_numbers(data):\n    frequency = {}\n    # Count the frequency of each number\n    for num in data:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    most_common = [num for num, freq in frequency.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[1, 2, 2, 2, 6, 6, 6]", "output": "[2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95940_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002227", "code": "def calculate_output(n):\n    remainder = n % 8\n    if remainder == 0:\n        return 2\n    elif remainder <= 5:\n        return remainder\n    else:\n        return 10 - remainder\n", "entry_point": "calculate_output", "input": "8", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17799_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002228", "code": "def extract_template_info(template_json):\n    template_name = template_json.get('name', 'Unknown Template')\n    template_params = template_json.get('templateParams', [])\n    output = f\"Template Name: {template_name}\\nParameters:\\n\"\n    output += \"\\n\".join(param for param in template_params)\n    return output\n", "entry_point": "extract_template_info", "input": "{}", "output": "'Template Name: Unknown Template\\nParameters:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59203_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002229", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "13", "output": "'JAVASCRIPTIDENTIFIER'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002230", "code": "from typing import Tuple\ndef final_position(directions: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'U'", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93403_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002231", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaDDDeee'", "output": "'a2D3e3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3355", "output": "{1, 5, 11, 305, 55, 3355, 61, 671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002233", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[0, 0, 2, 2, 2, 3, 4, 4]", "output": "{0: 2, 2: 3, 3: 1, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002234", "code": "def parse_allowed_tags(input_string):\n    tag_dict = {}\n    tag_list = input_string.split()\n    for tag in tag_list:\n        tag_parts = tag.split(':')\n        tag_name = tag_parts[0]\n        attributes = tag_parts[1:] if len(tag_parts) > 1 else []\n        tag_dict[tag_name] = attributes\n    return tag_dict\n", "entry_point": "parse_allowed_tags", "input": "'itbotbodydy'", "output": "{'itbotbodydy': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14310_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002235", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'I loveo programming.'", "output": "'I loveo programming.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002236", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[1800, 240, 774]", "output": "'0:46:54'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002237", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'12:05:39 AM'", "output": "'00:05:39'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002238", "code": "from typing import Dict, List, Optional, Union\ndef calculate_total_duration(tasks: List[Dict[str, Union[int, str]]], status: str) -> int:\n    total_duration = 0\n    for task in tasks:\n        if task['task_status'] == status:\n            total_duration += task['task_duration']\n    return total_duration\n", "entry_point": "calculate_total_duration", "input": "[], 'in-progress'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135250_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002239", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[4, 6, 10]", "output": "152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2950_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002240", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "11, 4", "output": "14641", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt31", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002241", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "5, 1, 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2411", "output": "{1, 2411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002243", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "3.5", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002244", "code": "import re\ndef extract_email(docstring: str) -> str:\n    lines = docstring.split('\\n')\n    for i in range(len(lines)):\n        if lines[i].strip().startswith('@contact:'):\n            email_line = lines[i+1].strip()\n            email = re.search(r'[\\w\\.-]+@[\\w\\.-]+', email_line)\n            if email:\n                return email.group()\n    return \"\"\n", "entry_point": "extract_email", "input": "\"Some random text that doesn't include a contact directive.\"", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73888_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002245", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002246", "code": "def check_pattern(input_str):\n    for i in range(len(input_str) - 3):\n        if input_str[i].islower() and input_str[i+1].islower() and input_str[i+2].isdigit() and input_str[i+3].isdigit():\n            return True\n    return False\n", "entry_point": "check_pattern", "input": "'ab12'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136535_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002247", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[2, 4, 3, 3, 3, 3, 3]", "output": "(6, 243)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002248", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "2, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002249", "code": "def merge_dicts(dict1, dict2):\n    merged_dict = dict(dict1)  # Create a copy of dict1 to start with\n    merged_dict.update(dict2)  # Update with key-value pairs from dict2\n    return merged_dict\n", "entry_point": "merge_dicts", "input": "{}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141440_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002250", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "-46", "output": "-64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002251", "code": "def unique_arrangements(elements, num_groups):\n    if num_groups == 1:\n        return 1\n    total_arrangements = 0\n    for i in range(1, len(elements) - num_groups + 2):\n        total_arrangements += unique_arrangements(elements[i:], num_groups - 1)\n    return total_arrangements\n", "entry_point": "unique_arrangements", "input": "[1, 2], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71108_ipt41", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002252", "code": "# Dictionary mapping widget names to actions or tools\nwidget_actions = {\n    \"update_rect_image\": \"Update rectangle image\",\n    \"pan\": \"Pan functionality\",\n    \"draw_line_w_drag\": \"Draw a line while dragging\",\n    \"draw_line_w_click\": \"Draw a line on click\",\n    \"draw_arrow_w_drag\": \"Draw an arrow while dragging\",\n    \"draw_arrow_w_click\": \"Draw an arrow on click\",\n    \"draw_rect_w_drag\": \"Draw a rectangle while dragging\",\n    \"draw_rect_w_click\": \"Draw a rectangle on click\",\n    \"draw_polygon_w_click\": \"Draw a polygon on click\",\n    \"draw_point_w_click\": \"Draw a point on click\",\n    \"modify_existing_shape\": \"Modify existing shape\",\n    \"color_selector\": \"Select color from color selector\",\n    \"save_kml\": \"Save as KML file\",\n    \"select_existing_shape\": \"Select an existing shape\",\n    \"remap_dropdown\": \"Remap dropdown selection\"\n}\ndef get_widget_action(widget_name):\n    return widget_actions.get(widget_name, \"Invalid Widget\")\n", "entry_point": "get_widget_action", "input": "'non_existent_widget'", "output": "'Invalid Widget'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16004_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002253", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[92, 92, 90, 85, 80]", "output": "[92, 92, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002254", "code": "def find_duplicate(nums):\n    d = {}\n    for i in range(0, len(nums)):\n        if nums[i] in d:\n            return nums[i]\n        else:\n            d[nums[i]] = i\n", "entry_point": "find_duplicate", "input": "[1, 0, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148746_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1712", "output": "{1, 2, 4, 8, 107, 428, 1712, 16, 214, 856}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1711", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002256", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N <= len(scores) else sorted_scores\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 95], 2", "output": "92.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122471_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002257", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[1, 6, 3, 5, 2, 4, 5, 5, 0]", "output": "[6, 3, 5, 2, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002258", "code": "def rotate(arr, n):\n    for _ in range(n):\n        x = arr[-1]\n        for i in range(len(arr) - 1, 0, -1):\n            arr[i] = arr[i - 1]\n        arr[0] = x\n    return arr\n", "entry_point": "rotate", "input": "[6, 5, 1, 6, 4, 6, 6, 4], 1", "output": "[4, 6, 5, 1, 6, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51969_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002259", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 8.0", "output": "201.06192982974676", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002260", "code": "def compute(*numbers, maximum=1000):\n    if not numbers:\n        numbers = (3, 5)\n    multiples = set()\n    for number in numbers:\n        multiples.update(range(0, maximum, number))\n    return sum(multiples)\n", "entry_point": "compute", "input": "1000", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27196_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002261", "code": "from typing import List\ndef sum_absolute_differences(list1: List[int], list2: List[int]) -> int:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 98], [0, 0]", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44502_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002262", "code": "def count_unique_nodes(graph_str):\n    unique_nodes = set()\n    edges = graph_str.split('\\n')\n    for edge in edges:\n        nodes = edge.split('->')\n        for node in nodes:\n            unique_nodes.add(node.strip())\n    return len(unique_nodes)\n", "entry_point": "count_unique_nodes", "input": "'A -> A'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17791_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002263", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002264", "code": "def sum_of_squares_of_even_numbers(input_list):\n    total = 0\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49969_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002265", "code": "import math\ndef download_manager(file_sizes, download_speed):\n    total_time = 0\n    file_sizes.sort(reverse=True)  # Sort file sizes in descending order\n    for size in file_sizes:\n        time_to_download = size / download_speed\n        total_time += math.ceil(time_to_download)  # Round up to nearest whole number\n    return total_time\n", "entry_point": "download_manager", "input": "[80, 1], 1", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131368_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002266", "code": "def calculate_polygon_area(vertices):\n    n = len(vertices)\n    area = 0.5 * abs(sum(vertices[i][0] * vertices[(i + 1) % n][1] for i in range(n))\n                     - sum(vertices[i][1] * vertices[(i + 1) % n][0] for i in range(n)))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (8, 0), (4, 3)]", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22232_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002267", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9351", "output": "{1, 3, 9351, 9, 3117, 1039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002268", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 5, 13]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50878_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002269", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "9, 3", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002270", "code": "import math\ndef calculate_terms(seq, wsize, l2):\n    term_c = 0\n    term_t = 0\n    term_g = 0\n    for i in range(len(seq) - wsize + 1):\n        window = seq[i:i+wsize]\n        freq_c = window.count('C') / wsize\n        freq_t = window.count('T') / wsize\n        freq_g = window.count('G') / wsize\n        if freq_c > 0:\n            term_c += (freq_c * math.log(freq_c) / l2)\n        if freq_t > 0:\n            term_t += (freq_t * math.log(freq_t) / l2)\n        if freq_g > 0:\n            term_g += (freq_g * math.log(freq_g) / l2)\n    return term_c, term_t, term_g\n", "entry_point": "calculate_terms", "input": "'AAAAAAA', 3, 1", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38443_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002271", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "1", "output": "'Write-Data'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8114", "output": "{1, 8114, 2, 4057}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8113", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002273", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[64]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002274", "code": "csa_time = [157.230, 144.460, 110.304, 137.585, 97.767, 87.997, 86.016, 83.449, 61.127, 50.558]\nsa_len = [977, 879, 782, 684, 586, 489, 391, 293, 196, 98]\nsa_time = [12.251, 11.857, 12.331, 12.969, 12.777, 12.680, 11.795, 11.555, 11.752, 11.657]\nradix_len = [20, 50, 60, 70, 80, 90, 100, 120, 150, 200, 300, 400, 500, 600, 700, 800, 900]\nradix_time = [0.220, 0.242, 0.243, 0.237, 0.243, 0.244, 0.243, 0.245, 0.256, 0.258, 0.261, 0.263, 0.267, 0.268, 0.270, 0.274, 0.277]\nbest_algorithm = {}\n# Update the best performing algorithm for each document size\nfor size, csa, sa, radix in zip(sa_len, csa_time, sa_time, radix_time):\n    best_algo = min((csa, 'CSA'), (sa, 'SA'), (radix, 'Radix'))[1]\n    best_algorithm[size] = best_algo\ndef best_algorithm_for_size(document_size):\n    return best_algorithm.get(document_size, \"Document size not found\")\n", "entry_point": "best_algorithm_for_size", "input": "684", "output": "'Radix'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103326_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002275", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6855", "output": "{1, 3, 5, 6855, 457, 2285, 15, 1371}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002276", "code": "from functools import reduce\nfrom operator import add\ndef calculate_sum(int_list):\n    # Using reduce with the add operator to calculate the sum\n    total_sum = reduce(add, int_list)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[31]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002277", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[3, 4, 5, 1, 2], [2, 1, 6, 4, 3]", "output": "('Player 2 wins', 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002278", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[93, 92, 91, 90, 93]", "output": "[93, 92, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118412_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2764", "output": "{1, 2, 4, 1382, 2764, 691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2763", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002280", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[2, 2, 0, 7, 0, 3, 7, -1, 0, 7, 7]", "output": "[2, 0, 7, 0, 3, 7, -1, 0, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002281", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[3, 5, 7, 8, 2, 2, 2, 8, 3]", "output": "[3, 6, 9, 11, 6, 7, 8, 15, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002282", "code": "import re\nurl_patterns = [\n    (\"^add_cart$\", \"AddCartView\"),\n    (\"^$\", \"ShowCartView\"),\n    (\"^update_cart$\", \"UpdateCartView\"),\n    (\"^delete_cart$\", \"DeleteCartView\"),\n]\ndef resolve_view(url_path):\n    for pattern, view_class in url_patterns:\n        if re.match(pattern, url_path):\n            return view_class\n    return \"Page Not Found\"\n", "entry_point": "resolve_view", "input": "'not_a_valid_path'", "output": "'Page Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149933_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002283", "code": "def validate_point_valuation(point_valuation: int) -> str:\n    if point_valuation < 0:\n        return \"Invalid point valuation: Negative points are not allowed.\"\n    else:\n        return \"Valid point valuation: Points accepted.\"\n", "entry_point": "validate_point_valuation", "input": "0", "output": "'Valid point valuation: Points accepted.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101305_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002284", "code": "def zellerAlgorithm(year, month, day):\n    if month in [1, 2]:\n        y1 = year - 1\n        m1 = month + 12\n    else:\n        y1 = year\n        m1 = month\n    y2 = y1 % 100\n    c = y1 // 100\n    day_of_week = (day + (13 * (m1 + 1)) // 5 + y2 + y2 // 4 + c // 4 - 2 * c) % 7\n    return day_of_week\n", "entry_point": "zellerAlgorithm", "input": "2023, 10, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86862_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4013", "output": "{1, 4013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002286", "code": "def analyze_grades(grades: list) -> dict:\n    if not grades:\n        return {}\n    total_grades = len(grades)\n    sum_grades = sum(grades)\n    highest_grade = max(grades)\n    lowest_grade = min(grades)\n    average_grade = round(sum_grades / total_grades, 1)\n    return {\n        'average_grade': average_grade,\n        'highest_grade': highest_grade,\n        'lowest_grade': lowest_grade\n    }\n", "entry_point": "analyze_grades", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97392_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002287", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'abracecarxyz'", "output": "'racecar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002288", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[92, 92, 75, 75, 85, 85, 100, 100, 74]", "output": "{92: 2, 75: 2, 85: 2, 100: 2, 74: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002289", "code": "def calculate_accuracy(test_y, pred_y):\n    if len(test_y) != len(pred_y):\n        raise ValueError(\"Length of true labels and predicted labels must be the same.\")\n    correct_predictions = sum(1 for true_label, pred_label in zip(test_y, pred_y) if true_label == pred_label)\n    total_predictions = len(test_y)\n    accuracy = (correct_predictions / total_predictions) * 100\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 1, 1, 0], [1, 1, 1, 1, 1]", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41043_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4861", "output": "{1, 4861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002291", "code": "import os\ndef calculate_avg_word_length(file_path):\n    if not os.path.exists(file_path):\n        return \"File does not exist\"\n    with open(file_path, 'r') as file:\n        content = file.read()\n    if not content:\n        return \"File is empty\"\n    words = content.split()\n    total_length = sum(len(word) for word in words)\n    avg_length = total_length / len(words)\n    return avg_length\n", "entry_point": "calculate_avg_word_length", "input": "'non_existent_file.txt'", "output": "'File does not exist'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84032_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5181", "output": "{1, 33, 3, 11, 157, 471, 5181, 1727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002293", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'3 + 6'", "output": "9.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002294", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'hbo.com/pages/hts:e'", "output": "'hbo.com/pages/hts:e/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "331", "output": "{1, 331}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002296", "code": "def filter_students_by_grade(students):\n    filtered_students = []\n    for student in students:\n        if student.get(\"grade\", 0) >= 80:\n            filtered_students.append(student)\n    return filtered_students\n", "entry_point": "filter_students_by_grade", "input": "[{'name': 'Alice', 'grade': 75}, {'name': 'Bob', 'grade': 50}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136850_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002297", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num + 10)\n        elif num % 2 != 0:\n            modified_list.append(num - 5)\n        if num % 5 == 0:\n            modified_list[-1] *= 2  # Double the last element added\n    return modified_list\n", "entry_point": "process_integers", "input": "[14, 14, 3, -6, 8, 3]", "output": "[24, 24, -2, 4, 18, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21567_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002298", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "997", "output": "{1, 997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002299", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "73", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002300", "code": "def is_back_home(S):\n    x, y = 0, 0\n    for direction in S:\n        if direction == 'N':\n            y += 1\n        elif direction == 'S':\n            y -= 1\n        elif direction == 'E':\n            x += 1\n        elif direction == 'W':\n            x -= 1\n    return x == 0 and y == 0\n", "entry_point": "is_back_home", "input": "'N'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100736_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002301", "code": "def rearrange_possible(a_list):\n    multi4 = len([a for a in a_list if a % 4 == 0])\n    odd_num = len([a for a in a_list if a % 2 != 0])\n    even_num = len(a_list) - odd_num\n    not4 = even_num - multi4\n    if not4 > 0:\n        if odd_num <= multi4:\n            return \"Yes\"\n        else:\n            return \"No\"\n    else:\n        if odd_num <= multi4 + 1:\n            return \"Yes\"\n        else:\n            return \"No\"\n", "entry_point": "rearrange_possible", "input": "[1, 3, 5, 4]", "output": "'No'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48198_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1349", "output": "{1, 19, 1349, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002303", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9713", "output": "{883, 1, 11, 9713}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002304", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "41", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002305", "code": "def get_color_tag(counter):\n    \"\"\"Returns color tag based on the parity of the counter.\"\"\"\n    if counter % 2 == 0:\n        return 'warning'\n    return 'info'\n", "entry_point": "get_color_tag", "input": "1", "output": "'info'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55016_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002306", "code": "def count_unique_even_numbers(lst):\n    unique_evens = set()\n    for num in lst:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_even_numbers", "input": "[2, 4, 2, 3, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111984_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002307", "code": "import heapq\ndef top_k_frequent_elements(nums, k):\n    freq_map = {}\n    for num in nums:\n        freq_map[num] = freq_map.get(num, 0) + 1\n    heap = [(-freq, num) for num, freq in freq_map.items()]\n    heapq.heapify(heap)\n    top_k = []\n    for _ in range(k):\n        top_k.append(heapq.heappop(heap)[1])\n    return sorted(top_k)\n", "entry_point": "top_k_frequent_elements", "input": "[1], 1", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76714_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4349", "output": "{1, 4349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002309", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 50", "output": "'50%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002310", "code": "def analyze_sentiment(text: str) -> str:\n    thanks_keywords = [\n        'thanks',\n        'thank you'\n    ]\n    exit_keywords = [\n        'leave',\n        'bye',\n        'exit',\n        'quit',\n        'goodbye',\n        'later',\n        'farewell'\n    ]\n    thanks_count = 0\n    exit_count = 0\n    text_lower = text.lower()\n    for word in text_lower.split():\n        if word in thanks_keywords:\n            thanks_count += 1\n        elif word in exit_keywords:\n            exit_count += 1\n    if thanks_count > exit_count:\n        return \"positive\"\n    elif exit_count > thanks_count:\n        return \"negative\"\n    else:\n        return \"neutral\"\n", "entry_point": "analyze_sentiment", "input": "''", "output": "'neutral'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59557_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002311", "code": "from typing import List\ndef find_fragmented_packet(packet_lengths: List[int], mtu: int) -> bool:\n    for length in packet_lengths:\n        if length > mtu:\n            return True\n    return False\n", "entry_point": "find_fragmented_packet", "input": "[50, 75, 150], 100", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56658_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002312", "code": "LAMP_SPECS = {\n    'uv': (396, 16),\n    'blue': (434, 22),\n    'cyan': (481, 22),\n    'teal': (508, 29),\n    'green_yellow': (545, 70),\n    'red': (633, 19)\n}\nLAMP_NAMES = set(LAMP_SPECS.keys())\ndef get_lamp_specs(lamp_name):\n    if lamp_name in LAMP_NAMES:\n        return LAMP_SPECS[lamp_name]\n    else:\n        return \"Lamp not found\"\n", "entry_point": "get_lamp_specs", "input": "'purple'", "output": "'Lamp not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13946_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002313", "code": "import re\ndef extract_webinar_objectives(input_text):\n    objectives = {}\n    pattern = r\"(\\W\\w{1,2}\\W): (.+)\"\n    matches = re.findall(pattern, input_text)\n    for match in matches:\n        objectives[match[0]] = match[1]\n    return objectives\n", "entry_point": "extract_webinar_objectives", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37300_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002314", "code": "def encrypt_string(s: str, shift: int) -> str:\n    encrypted_string = \"\"\n    for char in s:\n        if char.isupper():\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_char = chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_char = char\n        encrypted_string += encrypted_char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'Ebiil,', 2", "output": "'Gdkkn,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74768_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002315", "code": "def generate_upgrade_commands(current_version, target_version):\n    upgrade_commands = []\n    for i in range(len(current_version), len(target_version)):\n        upgrade_commands.append(f'Upgrade database from version {current_version[i-1]} to version {target_version[i]}')\n    return upgrade_commands\n", "entry_point": "generate_upgrade_commands", "input": "[2], [2, 0]", "output": "['Upgrade database from version 2 to version 0']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47760_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002316", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate the average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average_score", "input": "[5]", "output": "'Not enough scores to calculate the average.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002317", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'ppatpexamexampat'", "output": "'ppatpexamexampat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002318", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'kitten', 'sitting'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002319", "code": "def count_unique_chars(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha():\n            unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'abcdefg1!?'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48640_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002320", "code": "import math\ndef calculateDownloadCost(fileSize, downloadSpeed, costPerGB):\n    fileSizeGB = fileSize / 1024  # Convert file size from MB to GB\n    downloadTime = fileSizeGB * 8 / downloadSpeed  # Calculate download time in seconds\n    totalCost = math.ceil(fileSizeGB) * costPerGB  # Round up downloaded GB and calculate total cost\n    return totalCost\n", "entry_point": "calculateDownloadCost", "input": "1024, 10, 7.1171999999999995", "output": "7.1171999999999995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44451_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002321", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "0.87, 1.0", "output": "0.87", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002322", "code": "def find_next_square(sq: int) -> int:\n    \"\"\"\n    Finds the next perfect square after the given number.\n    Args:\n    sq: An integer representing the input number.\n    Returns:\n    An integer representing the next perfect square if the input is a perfect square, otherwise -1.\n    \"\"\"\n    sqrt_of_sq = sq ** 0.5\n    return int((sqrt_of_sq + 1) ** 2) if sqrt_of_sq.is_integer() else -1\n", "entry_point": "find_next_square", "input": "2", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35410_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002323", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 80, 78, 75, 70, 60]", "output": "[90, 80, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002324", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'one3five'", "output": "135", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002325", "code": "def find_highest_score(scores):\n    if not scores:\n        return None  # Handle empty list case\n    highest_score = scores[0]  # Initialize highest_score to the first score\n    for score in scores[1:]:  # Iterate through the list starting from the second element\n        if score > highest_score:\n            highest_score = score  # Update highest_score if a higher score is found\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[50, 70, 98]", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118441_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002326", "code": "from typing import List\nDIGIT_TO_CHAR = {\n    '0': ['0'],\n    '1': ['1'],\n    '2': ['a', 'b', 'c'],\n    '3': ['d', 'e', 'f'],\n    '4': ['g', 'h', 'i'],\n    '5': ['j', 'k', 'l'],\n    '6': ['m', 'n', 'o'],\n    '7': ['p', 'q', 'r', 's'],\n    '8': ['t', 'u', 'v'],\n    '9': ['w', 'x', 'y', 'z']\n}\nDEFAULT_NUMBER_OF_RESULTS = 7\nMAX_LENGTH_OF_NUMBER = 16\nMAX_COST = 150\ndef generate_combinations(input_number: str) -> List[str]:\n    results = []\n    def generate_combinations_recursive(current_combination: str, remaining_digits: str):\n        if not remaining_digits:\n            results.append(current_combination)\n            return\n        for char in DIGIT_TO_CHAR[remaining_digits[0]]:\n            new_combination = current_combination + char\n            new_remaining = remaining_digits[1:]\n            generate_combinations_recursive(new_combination, new_remaining)\n    generate_combinations_recursive('', input_number)\n    return results[:DEFAULT_NUMBER_OF_RESULTS]\n", "entry_point": "generate_combinations", "input": "'333'", "output": "['ddd', 'dde', 'ddf', 'ded', 'dee', 'def', 'dfd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133151_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002327", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'useuser@eo\" some_other_info'", "output": "{'useuser@eo\"': 'N/A'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002328", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'X1X'", "output": "['010', '011', '110', '111']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002329", "code": "def get_release_date(version: str) -> str:\n    version_dates = {\n        \"4.5.1\": \"September 14, 2008\",\n        \"4.6.1\": \"July 30, 2009\",\n        \"4.7.1\": \"February 26, 2010\",\n        \"4.8\": \"November 26, 2010\",\n        \"4.9\": \"June 21, 2011\",\n        \"4.10\": \"March 29, 2012\",\n        \"4.11\": \"November 6, 2013\",\n        \"5.0\": \"November 24, 2014\",\n        \"5.1\": \"April 17, 2015\",\n        \"5.2\": \"March 18, 2016\",\n        \"5.3\": \"May 2, 2016\",\n        \"5.4\": \"October 22, 2016\",\n        \"5.5\": \"March 23, 2017\",\n        \"5.6\": \"September 27, 2017\",\n        \"5.7b1\": \"January 27, 2018\",\n        \"5.7b2\": \"February 12, 2018\",\n        \"5.7\": \"February 27, 2018\",\n        \"5.8 devel\": \"Version not found\"\n    }\n    return version_dates.get(version, \"Version not found\")\n", "entry_point": "get_release_date", "input": "'6.0'", "output": "'Version not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110352_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002330", "code": "import re\ndef parse_tiktok_page(html_content):\n    parsed_data = {}\n    pattern_comment_area = re.compile(r'comment-container\">(.*?)comment-post-outside-container\">', re.S)\n    pattern_comments = re.compile(r'<div .*? comment-content .*?<a href=\"/@(.*?)\\?.*?username\">(.*?)</span></a><p .*? comment-text\"><span class=\".*?\">(.*?)</span>', re.S)\n    pattern_user_post_id = re.compile(r'data-e2e=\"user-post-item\".*?<a href=\"http.*?/@.*?/video/(\\d+)', re.S)\n    user_post_ids = pattern_user_post_id.findall(html_content)\n    comments = pattern_comments.findall(html_content)\n    for post_id in user_post_ids:\n        parsed_data[post_id] = []\n    for match in pattern_comment_area.finditer(html_content):\n        comment_area = match.group(1)\n        for comment_match in pattern_comments.finditer(comment_area):\n            username, display_name, comment_text = comment_match.groups()\n            parsed_data[post_id].append((username, display_name, comment_text))\n    return parsed_data\n", "entry_point": "parse_tiktok_page", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35008_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002331", "code": "def check_pattern(input_str):\n    for i in range(len(input_str) - 3):\n        if input_str[i].islower() and input_str[i+1].islower() and input_str[i+2].isdigit() and input_str[i+3].isdigit():\n            return True\n    return False\n", "entry_point": "check_pattern", "input": "'ABCDE'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136535_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002332", "code": "def count_hashtags(tweets):\n    hashtag_count = {}\n    for tweet in tweets:\n        words = tweet.split()\n        hashtags = [word[1:] for word in words if word.startswith(\"#\")]\n        for hashtag in hashtags:\n            if hashtag in hashtag_count:\n                hashtag_count[hashtag] += 1\n            else:\n                hashtag_count[hashtag] = 1\n    return hashtag_count\n", "entry_point": "count_hashtags", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105503_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002333", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[5, 2, 0, 1, 6, 5, 0, 2, 5]", "output": "[0, 0, 1, 2, 2, 5, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002334", "code": "from typing import List\ndef adjust_logging(argv: List[int], filename: str) -> int:\n    import logging\n    logger = logging.getLogger()\n    logger.setLevel(logging.WARNING)  # Default level\n    if argv:\n        verbosity = max(min(argv), 3)  # Ensure verbosity is between 1 and 3\n        if verbosity == 3:\n            logger.setLevel(logging.DEBUG)\n        elif verbosity == 2:\n            logger.setLevel(logging.INFO)\n    def run(filename: str) -> int:\n        # Simulated run function, returns exit code\n        print(f\"Running function with filename: {filename}\")\n        return 0  # Simulated exit code\n    exit_code = run(filename)\n    return exit_code\n", "entry_point": "adjust_logging", "input": "[], 'sample.txt'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133374_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002335", "code": "def max_difference(lst):\n    if len(lst) < 2:\n        return 0\n    min_val = lst[0]\n    max_diff = 0\n    for num in lst[1:]:\n        if num < min_val:\n            min_val = num\n        else:\n            max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 1, 2, 3, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61667_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002336", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "0.06999999999999999, 4", "output": "0.017499999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002337", "code": "def count_unique_numbers(input_list):\n    unique_numbers = set()\n    for num in input_list:\n        unique_numbers.add(num)\n    return len(unique_numbers)\n", "entry_point": "count_unique_numbers", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105540_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002338", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'file1.le23.py4.md\\nffile1.'", "output": "{'md': ['file1.le23.py4.md'], '': ['ffile1.']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002339", "code": "def extract_view_names(url_patterns):\n    url_view_mapping = {}\n    for pattern in url_patterns:\n        path = pattern['path']\n        view = pattern['view']\n        url_view_mapping[path] = view\n    return url_view_mapping\n", "entry_point": "extract_view_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55628_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002340", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'apple,banana,orange'", "output": "['apple', 'banana', 'orange']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002341", "code": "from typing import List\ndef count_unique_elements(input_list: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_count = 0\n    # Count unique elements\n    for count in element_count.values():\n        if count == 1:\n            unique_count += 1\n    return unique_count\n", "entry_point": "count_unique_elements", "input": "[1, 2, 3, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48545_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002342", "code": "def custom_compare(s1, s2):\n    if s1 == s2:\n        return 0\n    if s1 and s2 and s1.isnumeric() and s2.isnumeric() and s1[0] != '0' and s2[0] != '0':\n        if float(s1) == float(s2):\n            return 0\n        elif float(s1) > float(s2):\n            return 1\n        else:\n            return 2\n    if s1 not in ['ALPHA', 'BETA', 'PREVIEW', 'RC', 'TRUNK']:\n        s1 = 'Z' + s1\n    if s2 not in ['ALPHA', 'BETA', 'PREVIEW', 'RC', 'TRUNK']:\n        s2 = 'Z' + s2\n    if s1 < s2:\n        return 1\n    else:\n        return 2\n", "entry_point": "custom_compare", "input": "'ALPHA', 'BETA'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107308_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002343", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    if not input_list:  # Base case: empty list\n        return 0\n    else:\n        return input_list.pop() + custom_sum(input_list)\n", "entry_point": "custom_sum", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145591_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002344", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'Hello\\\\x65d'", "output": "b'Helloed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002345", "code": "def simulate_code_behavior(obj):\n    if len(obj) < 8:\n        return 'Invalid input: obj should have at least 8 elements'\n    if obj[2] <= 2:\n        if obj[3] <= 2:\n            return 'False'\n        elif obj[3] > 2:\n            if obj[7] <= 0:\n                return 'False'\n            elif obj[7] > 0:\n                return 'True'\n    elif obj[2] > 2:\n        return 'True'\n    return 'True'\n", "entry_point": "simulate_code_behavior", "input": "[0, 0, 2, 2, 0, 0, 0, 0]", "output": "'False'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121797_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002346", "code": "def parse_allowed_tags(input_string):\n    tag_dict = {}\n    tag_list = input_string.split()\n    for tag in tag_list:\n        tag_parts = tag.split(':')\n        tag_name = tag_parts[0]\n        attributes = tag_parts[1:] if len(tag_parts) > 1 else []\n        tag_dict[tag_name] = attributes\n    return tag_dict\n", "entry_point": "parse_allowed_tags", "input": "'itd:tite'", "output": "{'itd': ['tite']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14310_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002347", "code": "def minimize_difference(A):\n    total = sum(A)\n    m = float('inf')\n    left_sum = 0\n    for n in A[:-1]:\n        left_sum += n\n        v = abs(total - 2 * left_sum)\n        if v < m:\n            m = v\n    return m\n", "entry_point": "minimize_difference", "input": "[2, 2, 2, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1116_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002348", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002349", "code": "def calculate_precision(true_positives, false_positives):\n    if true_positives + false_positives == 0:\n        return -1\n    precision = true_positives / (true_positives + false_positives)\n    return precision\n", "entry_point": "calculate_precision", "input": "13, 3", "output": "0.8125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116916_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002350", "code": "import re\ndef extract_model_names(code_snippet):\n    model_names = []\n    # Regular expression pattern to match model names in import statements\n    pattern = r'from \\.models\\.(\\w+) import'\n    # Find all matches of the pattern in the code snippet\n    matches = re.findall(pattern, code_snippet)\n    # Extract model names from the matched groups\n    for match in matches:\n        model_names.append(match)\n    return model_names\n", "entry_point": "extract_model_names", "input": "'import some_other_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127209_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002351", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    i = 1\n    while i < len(nums):\n        if nums[i-1] == nums[i]:\n            nums.pop(i)\n            continue\n        i += 1\n    return len(nums)\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119722_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002352", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'sdssa', '221111112'", "output": "'sdssa221111112'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002353", "code": "def merge_files(file1_path, file2_path, output_path):\n    try:\n        with open(file1_path, 'r') as f1, open(file2_path, 'r') as f2:\n            content1 = f1.readlines()\n            content2 = f2.readlines()\n        merged_content = content1 + content2\n        with open(output_path, 'w') as output_file:\n            for line in merged_content:\n                output_file.write(line)\n        return 0  # Success\n    except Exception as e:\n        print(f'Failed to merge files: {e}')\n        return 4  # Error code for file operation failure\n", "entry_point": "merge_files", "input": "'non_existent_file.txt', 'valid_file.txt', 'output_file.txt'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114421_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002354", "code": "import string\ndef extract_unique_words(input_str):\n    translator = str.maketrans('', '', string.punctuation)  # Translator to remove punctuation\n    unique_words = []\n    seen_words = set()\n    for word in input_str.split():\n        cleaned_word = word.translate(translator).lower()\n        if cleaned_word not in seen_words:\n            seen_words.add(cleaned_word)\n            unique_words.append(cleaned_word)\n    return unique_words\n", "entry_point": "extract_unique_words", "input": "'thiiis!'", "output": "['thiiis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26247_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002355", "code": "import re\ndef extract_error_info(log_message):\n    error_info_list = []\n    pattern = r'(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}) (\\w+) leader-elected (\\w+) (ERROR .*)'\n    matches = re.findall(pattern, log_message)\n    for match in matches:\n        timestamp, severity, application, error_details = match\n        error_info_list.append({\n            'timestamp': timestamp,\n            'severity': severity,\n            'application': application,\n            'error_details': error_details\n        })\n    return error_info_list\n", "entry_point": "extract_error_info", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10454_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002356", "code": "import os\ndef find_sql_files(directory):\n    if not os.path.exists(directory):\n        return []\n    sql_files = []\n    for item in os.listdir(directory):\n        item_path = os.path.join(directory, item)\n        if os.path.isfile(item_path) and item.endswith('.sql'):\n            sql_files.append(item_path)\n        elif os.path.isdir(item_path):\n            sql_files.extend(find_sql_files(item_path))\n    return sql_files\n", "entry_point": "find_sql_files", "input": "'/non_existent_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002357", "code": "def get_file_name(language: str) -> str:\n    file_names = {\n        'java': 'Main.java',\n        'c': 'main.c',\n        'cpp': 'main.cpp',\n        'python': 'main.py',\n        'js': 'main.js'\n    }\n    return file_names.get(language, 'Unknown')\n", "entry_point": "get_file_name", "input": "'ruby'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108385_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002358", "code": "def determine_secondary_sort(attr, side_of_ball):\n    secondary_sort_attr = \"\"\n    sort_order = \"\"\n    # Define rules to determine secondary sort attribute and order based on primary sort attribute and side of the ball\n    if attr == \"attr1\" and side_of_ball == \"offense\":\n        secondary_sort_attr = \"attr2\"\n        sort_order = \"ascending\"\n    elif attr == \"attr1\" and side_of_ball == \"defense\":\n        secondary_sort_attr = \"attr3\"\n        sort_order = \"descending\"\n    # Add more rules as needed for different primary sort attributes and sides of the ball\n    return (secondary_sort_attr, sort_order)\n", "entry_point": "determine_secondary_sort", "input": "'attr1', 'offense'", "output": "('attr2', 'ascending')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9138_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002359", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "5, 18", "output": "(27, 14, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3621", "output": "{1, 3, 3621, 71, 17, 51, 213, 1207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002361", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 4, 2, 4, 5, 5, 5, 1, 1]", "output": "[4, 5, 4, 7, 9, 10, 11, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002362", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'Season', 0, '18100111'", "output": "'Season - 00 [18100111].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002363", "code": "def count_outside_entities(entities):\n    outside_count = 0\n    for entity in entities:\n        if entity.get(\"label\") == \"O\":\n            outside_count += 1\n    return outside_count\n", "entry_point": "count_outside_entities", "input": "[{'label': 'A'}, {'label': 'B'}]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95449_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002364", "code": "import datetime\ndef frmtTime(timeStamp):\n    try:\n        timestamp_formats = [\"%Y-%m-%d %H:%M:%S.%f\", \"%Y-%m-%dT%H:%M:%S-%f\"]\n        for fmt in timestamp_formats:\n            try:\n                timestamp_obj = datetime.datetime.strptime(timeStamp, fmt)\n                formatted_timestamp = datetime.datetime.strftime(timestamp_obj, \"%Y-%m-%dT%H:%M:%S-0300\")\n                return formatted_timestamp\n            except ValueError:\n                pass\n        raise ValueError(\"Invalid timestamp format\")\n    except Exception as e:\n        return str(e)\n", "entry_point": "frmtTime", "input": "'random_string'", "output": "'Invalid timestamp format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79609_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002365", "code": "def handle_command(command):\n    command_responses = {\n        \"!hello\": \"Hello there!\",\n        \"!time\": \"The current time is 12:00 PM.\",\n        \"!weather\": \"The weather today is sunny.\",\n        \"!help\": \"You can ask me about the time, weather, or just say hello!\"\n    }\n    return command_responses.get(command, \"Sorry, I don't understand that command.\")\n", "entry_point": "handle_command", "input": "'!bye'", "output": "\"Sorry, I don't understand that command.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123108_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002366", "code": "def validate_phone_number(phone):\n    if phone is None or phone == \"\":\n        raise ValueError(\"Phone number is required\")\n    if not phone.startswith(\"+\"):\n        raise ValueError(\"Phone number must start with country code prefix '+'\")\n    if len(phone) != 13:\n        raise ValueError(\"Invalid phone number length\")\n    return True\n", "entry_point": "validate_phone_number", "input": "'+123456789012'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117553_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002367", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study5678_20221231.txt'", "output": "(5678, '20221231')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002368", "code": "def count_kwargs(_kwargs):\n    kwargs_count = []\n    for kwargs in _kwargs:\n        count = len(kwargs.keys()) + len(kwargs.values())\n        kwargs_count.append(count)\n    return kwargs_count\n", "entry_point": "count_kwargs", "input": "[{}, {}, {}, {}, {}]", "output": "[0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15928_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002369", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002370", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[5, 7, 23]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24858_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002371", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[10, 8, 6, 2]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27882_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002372", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[1, 2, 4, 5, 6, 6, 8, 9]", "output": "[1, 2, 4, 5, 6, 6, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2055", "output": "{1, 3, 5, 2055, 137, 685, 15, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002374", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[90, 90, 90], 3", "output": "90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002375", "code": "def extract_author_name(code_snippet):\n    lines = code_snippet.split('\\n')  # Split the code snippet into lines\n    for line in lines:\n        if '__author__' in line:\n            author_name = line.split('=')[-1].strip().strip(\"'\")\n            return author_name\n", "entry_point": "extract_author_name", "input": "\"__author__ = '__au__author__th'\"", "output": "'__au__author__th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48355_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002376", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7571", "output": "{1, 67, 7571, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002377", "code": "import itertools\ndef unique_eigenvalue_differences(eigvals):\n    unique_eigvals = sorted(set(eigvals))\n    differences = {j - i for i, j in itertools.combinations(unique_eigvals, 2)}\n    return tuple(sorted(differences))\n", "entry_point": "unique_eigenvalue_differences", "input": "[0, 1, 2]", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124400_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002378", "code": "def tower_builder(n_floors):\n    times = 1\n    space = ((2 * n_floors - 1) // 2)\n    tower = []\n    for _ in range(n_floors):\n        tower.append((' ' * space) + ('*' * times) + (' ' * space))\n        times += 2\n        space -= 1\n    return tower\n", "entry_point": "tower_builder", "input": "1", "output": "['*']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38158_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002379", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'agae=30'", "output": "{'agae': '30'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002380", "code": "import re\ndef parse_migration_script(script):\n    create_table_pattern = r\"op\\.create_table\\('predictor_category',([\\s\\S]*?)\\)\"\n    drop_table_pattern = r\"op\\.drop_table\\('predictor_category'\\)\"\n    create_table_match = re.search(create_table_pattern, script)\n    drop_table_match = re.search(drop_table_pattern, script)\n    create_table_sql = create_table_match.group(1).strip() if create_table_match else None\n    drop_table_sql = \"DROP TABLE predictor_category\" if drop_table_match else None\n    return {'create_table': create_table_sql, 'drop_table': drop_table_sql}\n", "entry_point": "parse_migration_script", "input": "''", "output": "{'create_table': None, 'drop_table': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63449_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002381", "code": "def count_carry_operations(a, b):\n    carry = 0\n    carry_count = 0\n    while a or b:\n        carry = (carry + a % 10 + b % 10) // 10\n        if carry:\n            carry_count += 1\n        a = a // 10\n        b = b // 10\n    if carry_count == 0:\n        return 'No carry operation.'\n    elif carry_count == 1:\n        return '1 carry operation.'\n    else:\n        return '{} carry operations.'.format(carry_count)\n", "entry_point": "count_carry_operations", "input": "5, 5", "output": "'1 carry operation.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70222_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002382", "code": "from typing import List, Optional\ndef find_second_largest(nums: List[int]) -> Optional[int]:\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max if second_max != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[1, 2, 3, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116497_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002383", "code": "def most_common_element(input_list):\n    element_count = {}\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common = max(element_count, key=element_count.get)\n    return most_common\n", "entry_point": "most_common_element", "input": "[3, 3, 1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6653_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002384", "code": "def generate_url(namespace, route_name):\n    routes = {\n        'getAllObjectDest': '/',\n    }\n    if route_name in routes:\n        return namespace + routes[route_name]\n    else:\n        return 'Route not found'\n", "entry_point": "generate_url", "input": "'http://example.com', 'nonExistentRoute'", "output": "'Route not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114969_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002385", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[40, 50]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002386", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'amamst snte ute.te'", "output": "{'amamst': 1, 'snte': 1, 'ute.te': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002387", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[1, 1, 2]", "output": "[1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt51", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002388", "code": "def count_students_above_average(scores):\n    total_scores = len(scores)\n    total_sum = sum(scores)\n    average_score = total_sum / total_scores\n    count_above_average = 0\n    for score in scores:\n        if score >= average_score:\n            count_above_average += 1\n    return count_above_average\n", "entry_point": "count_students_above_average", "input": "[30, 40, 70]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84218_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002389", "code": "def translate_cds_manual(cds: str, translation_table: str) -> str:\n    # Define the standard genetic code mapping codons to amino acids\n    genetic_code = {\n        'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',\n        'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',\n        'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',\n        'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R',\n        'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L',\n        'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P',\n        'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q',\n        'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R',\n        'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V',\n        'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A',\n        'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E',\n        'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G',\n        'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S',\n        'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L',\n        'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_',\n        'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'\n    }\n    # Clean out whitespace and convert the DNA sequence to uppercase\n    cds = \"\".join(cds.split()).upper()\n    # Translate the DNA sequence into a protein sequence using the genetic code\n    protein = ''\n    for i in range(0, len(cds), 3):\n        codon = cds[i:i+3]\n        if codon in genetic_code:\n            amino_acid = genetic_code[codon]\n            if amino_acid != '_':  # Stop codon\n                protein += amino_acid\n            else:\n                break  # Stop translation at the stop codon\n        else:\n            protein += 'X'  # Unknown codon represented as 'X'\n    return protein\n", "entry_point": "translate_cds_manual", "input": "'TACTTAATT', ''", "output": "'YLI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11123_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002390", "code": "def final_value(S):\n    X = 0\n    for c in S:\n        if c == 'L':\n            X = 2 * X\n        if c == 'R':\n            X = 2 * X + 1\n        if c == 'U':\n            X //= 2\n    return X\n", "entry_point": "final_value", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33325_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002391", "code": "def calculate_total_duration(p1_dur, p2_dur):\n    total_duration = sum(p1_dur) + sum(p2_dur)\n    return total_duration\n", "entry_point": "calculate_total_duration", "input": "[], [0.5]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125907_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002392", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[70, 80, 90]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002393", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7977", "output": "{1, 2659, 3, 7977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7976", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002394", "code": "def process_commands(input_str):\n    running_total = 0\n    commands = input_str.split()\n    for command in commands:\n        op = command[0]\n        if len(command) > 1:\n            num = int(command[1:])\n        else:\n            num = 0\n        if op == 'A':\n            running_total += num\n        elif op == 'S':\n            running_total -= num\n        elif op == 'M':\n            running_total *= num\n        elif op == 'D' and num != 0:\n            running_total //= num\n        elif op == 'R':\n            running_total = 0\n    return running_total\n", "entry_point": "process_commands", "input": "'A10 S5 S15 S7'", "output": "-17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106417_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002395", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[5, 5, 5, 2, 3]", "output": "(5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002396", "code": "def sum_of_primes(nums):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in nums:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104647_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5023", "output": "{1, 5023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002398", "code": "def has_invalid_bytes(input_string):\n    try:\n        input_string.encode('utf-8').decode('utf-8')\n    except UnicodeDecodeError:\n        return True\n    return False\n", "entry_point": "has_invalid_bytes", "input": "'Hello, World!'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56892_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002399", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[4, 4, 4, 4, 4, 5, 3]", "output": "{4: 5, 5: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002400", "code": "from typing import List\ndef max_sub_array(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sub_array", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80022_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002401", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 1 or n == 2:\n        return 1\n    else:\n        result = fibonacci_memo(n - 1, memo) + fibonacci_memo(n - 2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33770_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002402", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3663", "output": "'1 hour 1 minute 3 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002403", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'variables'", "output": "('variables', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002404", "code": "def is_power_of_two(num: int) -> bool:\n    if num <= 0:\n        return False\n    return num & (num - 1) == 0\n", "entry_point": "is_power_of_two", "input": "-1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9626_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002405", "code": "def multi_bracket_validation(input_str):\n    stack = []\n    bracket_pairs = {')': '(', ']': '[', '}': '{'}\n    for char in input_str:\n        if char in bracket_pairs.values():\n            stack.append(char)\n        elif char in bracket_pairs.keys():\n            if not stack or bracket_pairs[char] != stack.pop():\n                return False\n    return len(stack) == 0\n", "entry_point": "multi_bracket_validation", "input": "'()'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78967_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002406", "code": "def dashboard_navigation_simulator(user):\n    nodes_mapping = {\n        'admin': [{'id': 1, 'label': 'Dashboard'}, {'id': 2, 'label': 'Orders'}, {'id': 3, 'label': 'Customers'}],\n        'user': [{'id': 1, 'label': 'Dashboard'}, {'id': 2, 'label': 'Orders'}],\n        'guest': [{'id': 1, 'label': 'Dashboard'}]\n    }\n    return nodes_mapping.get(user, [])\n", "entry_point": "dashboard_navigation_simulator", "input": "'manager'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48659_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002407", "code": "def calculate_rank(scores, new_score):\n    rank = 1\n    for score in scores:\n        if new_score < score:\n            rank += 1\n        elif new_score == score:\n            break\n        else:\n            break\n    return rank\n", "entry_point": "calculate_rank", "input": "[], 100", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29288_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002408", "code": "LINKING_PROPERTY = \"Transaction/generated/LinkedTransactionId\"\nINPUT_TXN_FILTER = \"type in 'Buy','Purchase','Sell','FwdFxSell', 'FwdFxBuy','FxBuy','FxSell','StockIn'\"\nENTITY_PROPERTY = \"Portfolio/test/Entity\"\nBROKER_PROPERTY = \"Portfolio/test/Broker\"\nCOUNTRY_PROPERTY = \"Instrument/test/Country\"\nPROPERTIES_REQUIRED = [\n    ENTITY_PROPERTY,\n    BROKER_PROPERTY,\n    COUNTRY_PROPERTY\n]\ndef validate_properties(properties_set):\n    for prop in PROPERTIES_REQUIRED:\n        if prop not in properties_set:\n            return False\n    return True\n", "entry_point": "validate_properties", "input": "{'Portfolio/test/Broker', 'Instrument/test/Country'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63864_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002409", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[]", "output": "'Empty list provided.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002410", "code": "# Constants defining attributes for different component types\nATTRIBUTES = {\n    \"is_override_code\": [],\n    \"area_limit\": [],\n    \"code_format\": [],\n    \"code_length\": [],\n    \"automation_id\": [],\n    \"type\": [],\n    \"area\": [],\n    \"master\": [],\n    \"triggers\": [\"event\", \"require_code\"],\n    \"actions\": [],\n    \"event\": [],\n    \"require_code\": [],\n    \"notification\": [],\n    \"version\": [],\n    \"state_payload\": []\n}\ndef get_component_attributes(component_type):\n    return ATTRIBUTES.get(component_type, [])\n", "entry_point": "get_component_attributes", "input": "'non_existent_component'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72451_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002411", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'Pig is fn'", "output": "['Pig', 'is', 'fn']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002412", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[10, 2, 5, 8, 5], 5", "output": "[[10, 2, 5, 8, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002413", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[7, 7, 4, 0, 7, 0, 18, 0]", "output": "[14, 11, 4, 7, 7, 18, 18, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002414", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "1, -3.959999999999999, 1", "output": "-3.959999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002415", "code": "import re\nre_date = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])$')\nre_time = re.compile(r'^([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?$')\nre_datetime = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])(\\D?([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?([zZ])?)?$')\nre_decimal = re.compile('^(\\d+)\\.(\\d+)$')\ndef validate_data_format(input_string: str) -> str:\n    if re.match(re_date, input_string):\n        return \"date\"\n    elif re.match(re_time, input_string):\n        return \"time\"\n    elif re.match(re_datetime, input_string):\n        return \"datetime\"\n    elif re.match(re_decimal, input_string):\n        return \"decimal\"\n    else:\n        return \"unknown\"\n", "entry_point": "validate_data_format", "input": "'hello'", "output": "'unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67151_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002416", "code": "def f(method):\n    if method == 'GET':\n        return \"<h1>MyClub Event Calendar get</h1>\"\n    elif method == 'POST':\n        return \"<h1>MyClub Event Calendar post</h1>\"\n    else:\n        return \"<h1>MyClub Event Calendar</h1>\"\n", "entry_point": "f", "input": "'DELETE'", "output": "'<h1>MyClub Event Calendar</h1>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106549_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002417", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    scores.remove(min_score)\n    total_sum = sum(scores)\n    num_students = len(scores)\n    if num_students == 0:\n        return 0.0\n    return total_sum / num_students\n", "entry_point": "calculate_average", "input": "[70, 73, 73]", "output": "73.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45523_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002418", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002419", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[1, 2, 3], [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111620_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002420", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3955", "output": "{1, 35, 5, 7, 113, 3955, 565, 791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002421", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "18, 18", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002422", "code": "def first_non_repeating_char_index(s):\n    char_count = {}\n    # Populate dictionary with character counts\n    for char in s:\n        if char not in char_count:\n            char_count[char] = 1\n        else:\n            char_count[char] += 1\n    # Find the index of the first non-repeating character\n    for idx, char in enumerate(s):\n        if char_count[char] == 1:\n            return idx\n    return -1\n", "entry_point": "first_non_repeating_char_index", "input": "'aabbccde'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11467_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002423", "code": "from collections import Counter\nimport string\ndef find_top_words(text, n):\n    # Tokenize the text into words\n    words = text.lower().translate(str.maketrans('', '', string.punctuation)).split()\n    # Define common English stopwords\n    stop_words = set([\"i\", \"me\", \"my\", \"myself\", \"we\", \"our\", \"ours\", \"ourselves\", \"you\", \"your\", \"yours\", \"yourself\", \"yourselves\", \"he\", \"him\", \"his\", \"himself\", \"she\", \"her\", \"hers\", \"herself\", \"it\", \"its\", \"itself\", \"they\", \"them\", \"their\", \"theirs\", \"themselves\", \"what\", \"which\", \"who\", \"whom\", \"this\", \"that\", \"these\", \"those\", \"am\", \"is\", \"are\", \"was\", \"were\", \"be\", \"been\", \"being\", \"have\", \"has\", \"had\", \"having\", \"do\", \"does\", \"did\", \"doing\", \"a\", \"an\", \"the\", \"and\", \"but\", \"if\", \"or\", \"because\", \"as\", \"until\", \"while\", \"of\", \"at\", \"by\", \"for\", \"with\", \"about\", \"against\", \"between\", \"into\", \"through\", \"during\", \"before\", \"after\", \"above\", \"below\", \"to\", \"from\", \"up\", \"down\", \"in\", \"out\", \"on\", \"off\", \"over\", \"under\", \"again\", \"further\", \"then\", \"once\", \"here\", \"there\", \"when\", \"where\", \"why\", \"how\", \"all\", \"any\", \"both\", \"each\", \"few\", \"more\", \"most\", \"other\", \"some\", \"such\", \"no\", \"nor\", \"not\", \"only\", \"own\", \"same\", \"so\", \"than\", \"too\", \"very\", \"s\", \"t\", \"can\", \"will\", \"just\", \"don\", \"should\", \"now\"])\n    # Remove stopwords from the tokenized words\n    filtered_words = [word for word in words if word not in stop_words]\n    # Count the frequency of each word\n    word_freq = Counter(filtered_words)\n    # Sort the words based on their frequencies\n    sorted_words = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)\n    # Output the top N most frequent words along with their frequencies\n    top_words = sorted_words[:n]\n    return top_words\n", "entry_point": "find_top_words", "input": "'I am a the', 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52632_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002424", "code": "def canCross(stones):\n    if not stones:\n        return True\n    if stones[1] != 1:\n        return False\n    graph = {val: idx for idx, val in enumerate(stones)}\n    def dfs(stones, graph, pos, jump):\n        if pos == stones[-1]:\n            return True\n        for next_jump in [jump-1, jump, jump+1]:\n            if next_jump <= 0:\n                continue\n            next_pos = pos + next_jump\n            if next_pos in graph and dfs(stones, graph, next_pos, next_jump):\n                return True\n        return False\n    return dfs(stones, graph, 1, 1)\n", "entry_point": "canCross", "input": "[0, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17785_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002425", "code": "def find_primitive_type_index(primitive_type):\n    gltfPrimitiveTypeMap = ['PointList', 'LineList', 'LineStrip', 'LineStrip', 'TriangleList', 'TriangleStrip', 'TriangleFan']\n    for index, type_name in enumerate(gltfPrimitiveTypeMap):\n        if type_name == primitive_type:\n            return index\n    return -1\n", "entry_point": "find_primitive_type_index", "input": "'Hexagon'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32132_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002426", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "1, 1, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002427", "code": "def count_trailing_zeros(n):\n    count = 0\n    i = 5\n    while n // i > 0:\n        count += n // i\n        i *= 5\n    return count\n", "entry_point": "count_trailing_zeros", "input": "5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135178_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002428", "code": "import string\ndef count_unique_words_in_text(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        cleaned_word = word.strip(string.punctuation).lower()\n        unique_words.add(cleaned_word)\n    return len(unique_words)\n", "entry_point": "count_unique_words_in_text", "input": "'Hello world! This is a test, hello world.'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56347_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002429", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "6, 8", "output": "150.79644737231007", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002430", "code": "def manhattan_distance(point1, point2):\n    x1, y1 = point1\n    x2, y2 = point2\n    return abs(x1 - x2) + abs(y1 - y2)\n", "entry_point": "manhattan_distance", "input": "(0, 0), (0, 7)", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128962_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002431", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[0, 0, 0]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002432", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9773", "output": "{337, 1, 29, 9773}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002433", "code": "import json\nimport glob\ndef process_json_files(directory_path):\n    image_data_dict = {}\n    files = glob.glob(directory_path + \"/*.json\")\n    for file_path in files:\n        with open(file_path, 'r') as file:\n            data = json.load(file)\n            image_id = data.get('image_id')\n            image_url = data.get('image_url')\n            if image_id and image_url:\n                image_data_dict[image_id] = image_url\n    return image_data_dict\n", "entry_point": "process_json_files", "input": "'/path/to/nonexistent/dir'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118267_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002434", "code": "def mobile_phone_cipher(input_string: str) -> str:\n    T = {\n        'A': 21, 'B': 22, 'C': 23, 'D': 31, 'E': 32, 'F': 33,\n        'G': 41, 'H': 42, 'I': 43, 'J': 51, 'K': 52, 'L': 53,\n        'M': 61, 'N': 62, 'O': 63, 'P': 71, 'Q': 72, 'R': 73, 'S': 74,\n        'T': 81, 'U': 82, 'V': 83, 'W': 91, 'X': 92, 'Y': 93, 'Z': 94\n    }\n    output = \"\"\n    for char in input_string:\n        if char.isupper():\n            output += str(T.get(char, ''))\n        else:\n            output += char\n    return output\n", "entry_point": "mobile_phone_cipher", "input": "'LLO'", "output": "'535363'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13172_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002435", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'\\n strilineHe\\n'", "output": "'strilineHe\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002436", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "203", "output": "b'\\xcb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002437", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[1, 1, 2, 4, 5, 5]", "output": "{1, 2, 4, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002438", "code": "(_AT_BLOCKING, _AT_NONBLOCKING, _AT_SIGNAL) = range(3)\ndef get_constant_name(input_int):\n    constants = {_AT_BLOCKING: \"_AT_BLOCKING\", _AT_NONBLOCKING: \"_AT_NONBLOCKING\", _AT_SIGNAL: \"_AT_SIGNAL\"}\n    if input_int in constants:\n        return constants[input_int]\n    else:\n        return \"Out of range\"\n", "entry_point": "get_constant_name", "input": "3", "output": "'Out of range'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72958_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002439", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[5, 7, 7, 6], 6", "output": "[7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002440", "code": "def extract_command_and_text(message):\n    # Find the index of the first space after \"!addcom\"\n    start_index = message.find(\"!addcom\") + len(\"!addcom\") + 1\n    # Extract the command by finding the index of the first space after the command\n    end_index_command = message.find(\" \", start_index)\n    command = message[start_index:end_index_command]\n    # Extract the text by finding the index of the first space after the command\n    text = message[end_index_command+1:]\n    return command, text\n", "entry_point": "extract_command_and_text", "input": "'!addcom  ruaaPr'", "output": "('', 'ruaaPr')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33793_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002441", "code": "import ast\nimport keyword\ndef extract_external_libraries(module_content):\n    external_libraries = set()\n    tree = ast.parse(module_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                external_libraries.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            external_libraries.add(node.module.split('.')[0])\n    external_libraries.difference_update(keyword.kwlist)  # Remove Python keywords\n    return list(external_libraries)\n", "entry_point": "extract_external_libraries", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58430_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002442", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "1002", "output": "502503", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002443", "code": "import ast\nimport sys\nimport importlib.util\ndef get_external_modules(module_content):\n    external_modules = set()\n    tree = ast.parse(module_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                external_modules.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            external_modules.add(node.module.split('.')[0])\n    std_lib = set(sys.builtin_module_names)\n    external_modules.difference_update(std_lib)\n    return list(external_modules)\n", "entry_point": "get_external_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141601_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002444", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2995", "output": "{1, 2995, 5, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002445", "code": "MAX_NUM_VERTICES = 2**32\nDEFAULT_MESH_COLOR = 180\ndef generate_mesh_colors(num_vertices, colors=None):\n    mesh_colors = {}\n    if colors is None:\n        colors = [DEFAULT_MESH_COLOR] * num_vertices\n    else:\n        colors += [DEFAULT_MESH_COLOR] * (num_vertices - len(colors))\n    for i, color in enumerate(colors):\n        mesh_colors[i] = color\n    return mesh_colors\n", "entry_point": "generate_mesh_colors", "input": "4, [201, 254, 200, 200]", "output": "{0: 201, 1: 254, 2: 200, 3: 200}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117119_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002446", "code": "def count_sentences(input_string):\n    ENDINGS = ['.', '!', '?', ';']\n    sentence_count = 0\n    in_sentence = False\n    for char in input_string:\n        if char in ENDINGS:\n            if not in_sentence:\n                sentence_count += 1\n                in_sentence = True\n        else:\n            in_sentence = False\n    return sentence_count\n", "entry_point": "count_sentences", "input": "'Hello!'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127733_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002447", "code": "def card_war(player1, player2):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_wins = player2_wins = 0\n    for card1, card2 in zip(player1, player2):\n        rank1 = card_values[str(card1)]\n        rank2 = card_values[str(card2)]\n        if rank1 > rank2:\n            player1_wins += 1\n        elif rank2 > rank1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return 1\n    elif player2_wins > player1_wins:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_war", "input": "['A', 'K', '2'], ['10', 'Q', '3']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104810_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002448", "code": "from collections import defaultdict, deque\ndef find_task_order(dependencies):\n    graph = defaultdict(list)\n    indegree = defaultdict(int)\n    for dependency in dependencies:\n        parent, child = dependency\n        graph[parent].append(child)\n        indegree[child] += 1\n        indegree[parent]  # Ensure all tasks are included in indegree\n    tasks = set(graph.keys()).union(set(indegree.keys()))\n    queue = deque([task for task in tasks if indegree[task] == 0])\n    task_order = []\n    while queue:\n        current_task = queue.popleft()\n        task_order.append(current_task)\n        for dependent_task in graph[current_task]:\n            indegree[dependent_task] -= 1\n            if indegree[dependent_task] == 0:\n                queue.append(dependent_task)\n    return task_order if len(task_order) == len(tasks) else []\n", "entry_point": "find_task_order", "input": "[(1, 2), (2, 3), (3, 1)]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8859_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002449", "code": "from typing import List\ndef max_profit(prices: List[int], k: int) -> int:\n    if not prices or k == 0:\n        return 0\n    n = len(prices)\n    if k >= n // 2:\n        return sum([prices[i+1] - prices[i] if prices[i+1] > prices[i] else 0 for i in range(n-1)])\n    G = [[0] * n for _ in range(k+1)]\n    for i in range(1, k+1):\n        L = [0] * n\n        for j in range(1, n):\n            p = prices[j] - prices[j-1]\n            L[j] = max(G[i-1][j-1] + p, L[j-1] + p)\n            G[i][j] = max(G[i][j-1], L[j])\n    return G[-1][-1]\n", "entry_point": "max_profit", "input": "[3, 6, 2, 8, 5, 10], 3", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68511_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002450", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 2, 3, 5, 3, -2, 6, 4, 3]", "output": "[7, 5, 8, 8, 1, 4, 10, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002451", "code": "def format_headers(headers: dict) -> str:\n    formatted_headers = \"\"\n    for key, value in headers.items():\n        formatted_headers += f\"{key}: {value}\\n\"\n    formatted_headers += \"\\n\\n\"\n    return formatted_headers\n", "entry_point": "format_headers", "input": "{}", "output": "'\\n\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130695_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002452", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'Hello'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002453", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[-8, 5, 2, -7, -6, 2, -7, 3]", "output": "[512, 25, 4, 343, 216, 4, 343, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002454", "code": "OUTPUT_TYPES = ((\".htm\", \"html\"),\n                (\".html\", \"html\"),\n                (\".xml\", \"xml\"),\n                (\".tag\", \"tag\"))\ndef get_file_type(extension: str) -> str:\n    for ext, file_type in OUTPUT_TYPES:\n        if extension == ext:\n            return file_type\n    return \"Unknown\"\n", "entry_point": "get_file_type", "input": "'.xml'", "output": "'xml'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7593_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002455", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    num_rounds = min(len(player1_deck), len(player2_deck))\n    for round_num in range(num_rounds):\n        if player1_deck[round_num] > player2_deck[round_num]:\n            player1_score += 1\n        else:\n            player2_score += 1\n    return player1_score, player2_score\n", "entry_point": "simulate_card_game", "input": "[5, 2, 3, 1, 0, 0, 0], [1, 6, 7, 4, 2, 3, 0]", "output": "(1, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38237_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002456", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[3, 5, 7, 5, 5, 6, 1, 5]", "output": "[8, 12, 12, 10, 11, 7, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002457", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2375", "output": "{1, 5, 2375, 19, 25, 475, 125, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002458", "code": "def sum_of_pairs(lst, target):\n    seen = {}\n    pair_sum = 0\n    for num in lst:\n        complement = target - num\n        if complement in seen:\n            pair_sum += num + complement\n        seen[num] = True\n    return pair_sum\n", "entry_point": "sum_of_pairs", "input": "[], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88231_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002459", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 2, 3, 3, 3, 3, 3, 3, 3]", "output": "{1: 1, 2: 1, 3: 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002460", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[11, 3, 4, 0, 2, 6, 6, 6]", "output": "([11, 3], [4, 0, 2, 6, 6, 6])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002461", "code": "def euclid_gcd(a, b):\n    if not isinstance(a, int) or not isinstance(b, int):\n        return \"Invalid input, please provide integers.\"\n    a = abs(a)\n    b = abs(b)\n    while b != 0:\n        a, b = b, a % b\n    return a\n", "entry_point": "euclid_gcd", "input": "8, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129293_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002462", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[80, 80, 79, 74, 74, 60]", "output": "[80, 79, 74]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3298", "output": "{1, 3298, 2, 194, 34, 97, 17, 1649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002464", "code": "def parse_configuration_settings(code_snippet):\n    config_settings = {}\n    current_section = None\n    for line in code_snippet.split('\\n'):\n        line = line.strip()\n        if line.startswith('config.section_'):\n            current_section = line.split('_')[-1].split('(')[-1].strip(\"('\").strip(\"')\")\n            config_settings[current_section] = {}\n        elif line.startswith('config.') and current_section:\n            key_value = line.split('=')\n            if len(key_value) > 1:\n                key = key_value[0].split('.')[-1].strip()\n                value = key_value[1].strip().strip(\"'\")\n                config_settings[current_section][key] = value\n    return config_settings\n", "entry_point": "parse_configuration_settings", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110960_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002465", "code": "def calculate_total_uploaded_resources(config_data):\n    number_of_resources_uploaded = config_data.get('number_of_resources_uploaded', 0)\n    number_of_modules_uploaded = config_data.get('number_of_modules_uploaded', 0)\n    number_of_assemblies_uploaded = config_data.get('number_of_assemblies_uploaded', 0)\n    total_uploaded_resources = number_of_resources_uploaded + number_of_modules_uploaded + number_of_assemblies_uploaded\n    return total_uploaded_resources\n", "entry_point": "calculate_total_uploaded_resources", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73544_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002466", "code": "def jaro_similarity(source, target):\n    s_len = len(source)\n    t_len = len(target)\n    if s_len == 0 and t_len == 0:\n        return 1.0\n    s_idx = [False] * s_len\n    t_idx = [False] * t_len\n    m = 0\n    t = 0\n    d = max(s_len, t_len) // 2 - 1\n    # Jaro similarity calculation logic\n    # Implement the remaining steps here\n    return 0.0  # Placeholder for the Jaro similarity score\n", "entry_point": "jaro_similarity", "input": "'abc', 'xyz'", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61772_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002467", "code": "# Define a function to simulate retrieving the block reward for a given block number\ndef get_block_reward(block_number):\n    # Simulate fetching the block reward from the blockchain API\n    # In a real scenario, this function would interact with the API to get the actual block reward\n    # For demonstration purposes, we will return a hardcoded reward based on the block number\n    if block_number % 2 == 0:\n        return 3.0\n    else:\n        return 2.5\n", "entry_point": "get_block_reward", "input": "1", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116660_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002468", "code": "# Define the mapping between object names and IDs\nobj2id = {\n    \"benchvise\": 2,\n    \"driller\": 7,\n    \"phone\": 21,\n}\ndef get_object_id(obj_name):\n    \"\"\"\n    Get the object ID corresponding to the given object name.\n    Args:\n        obj_name (str): The object name to look up.\n    Returns:\n        int: The object ID if found, otherwise -1.\n    \"\"\"\n    return obj2id.get(obj_name, -1)\n", "entry_point": "get_object_id", "input": "'phone'", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97943_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002469", "code": "def search(s: str, pattern: str) -> int:\n    if len(s) < len(pattern):\n        return 0\n    if s[:len(pattern)] == pattern:\n        return 1 + search(s[len(pattern):], pattern)\n    else:\n        return search(s[1:], pattern)\n", "entry_point": "search", "input": "'abcabcabcabcabc', 'abc'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118249_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002470", "code": "def sockMerchant(n, ar):\n    sock_count = {}\n    pairs = 0\n    for color in ar:\n        if color in sock_count:\n            sock_count[color] += 1\n        else:\n            sock_count[color] = 1\n    for count in sock_count.values():\n        pairs += count // 2\n    return pairs\n", "entry_point": "sockMerchant", "input": "6, [1, 1, 1, 1, 2, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140964_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002471", "code": "def max_non_contiguous_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = exclude + num\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_contiguous_sum", "input": "[10, 3, 8, 5, 8]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39163_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002472", "code": "def maxProfit(prices):\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[1, 2, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12353_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002473", "code": "def longest_subsequence_length(arr):\n    if len(arr) == 1:\n        return 1\n    ans = 1\n    sub_len = 1\n    prev = 2\n    for i in range(1, len(arr)):\n        if arr[i] > arr[i - 1] and prev != 0:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        elif arr[i] < arr[i - 1] and prev != 1:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        else:\n            sub_len = 1\n        prev = 0 if arr[i] > arr[i - 1] else 1 if arr[i] < arr[i - 1] else 2\n    return ans\n", "entry_point": "longest_subsequence_length", "input": "[1, 3, 2, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82692_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002474", "code": "def check_winner(board: list) -> str:\n    # Check rows\n    for row in board:\n        if all(cell == 'X' for cell in row):\n            return 'X'\n        elif all(cell == 'O' for cell in row):\n            return 'O'\n    # Check columns\n    for col in range(3):\n        if all(board[row][col] == 'X' for row in range(3)):\n            return 'X'\n        elif all(board[row][col] == 'O' for row in range(3)):\n            return 'O'\n    # Check diagonals\n    if all(board[i][i] == 'X' for i in range(3)) or all(board[i][2-i] == 'X' for i in range(3)):\n        return 'X'\n    elif all(board[i][i] == 'O' for i in range(3)) or all(board[i][2-i] == 'O' for i in range(3)):\n        return 'O'\n    # Check for a tie\n    if all(all(cell is not None for cell in row) for row in board):\n        return 'Tie'\n    return 'None'\n", "entry_point": "check_winner", "input": "[['X', 'X', 'X'], [None, None, None], [None, None, None]]", "output": "'X'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002475", "code": "def find_unused_digits(*args):\n    all_digits = set(\"0123456789\")\n    for num in args:\n        for digit in str(num):\n            if digit in all_digits:\n                all_digits.remove(digit)\n    return \"\".join(all_digits)\n", "entry_point": "find_unused_digits", "input": "2345789, 2345, 789", "output": "'061'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99999_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002476", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 7, 1, 1, 3, 7]", "output": "[1, 8, 3, 4, 7, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002477", "code": "rpc_method_handlers = {\n    'api.Repository': lambda: 'Handling Repository API',\n    'api.User': lambda: 'Handling User API'\n}\ndef execute_rpc_handler(api_endpoint: str):\n    if api_endpoint in rpc_method_handlers:\n        return rpc_method_handlers[api_endpoint]()\n    else:\n        return 'Handler not found'\n", "entry_point": "execute_rpc_handler", "input": "'api.Repository'", "output": "'Handling Repository API'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112368_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002478", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'ala', 'bay'", "output": "'ALA_bay'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4245", "output": "{1, 3, 5, 1415, 15, 849, 4245, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002480", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 76, 75, 60, 60, 50]", "output": "[92, 76, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8412_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002481", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'0'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002482", "code": "def overall_validation_status(project_statuses):\n    for project in project_statuses:\n        if not project['isValidated']:\n            return False\n    return True\n", "entry_point": "overall_validation_status", "input": "[{'isValidated': True}, {'isValidated': True}, {'isValidated': True}]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21048_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9843", "output": "{1, 193, 3, 579, 3281, 17, 9843, 51}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002484", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'Smaei'", "output": "'\u30b5\u30f3maei'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002485", "code": "import os\ndef get_file_sizes(directory_path):\n    file_sizes = []\n    try:\n        for filename in os.listdir(directory_path):\n            file_path = os.path.join(directory_path, filename)\n            if os.path.isfile(file_path):\n                file_size = os.path.getsize(file_path)\n                file_sizes.append((filename, file_size))\n    except FileNotFoundError:\n        print(\"Directory not found.\")\n    return file_sizes\n", "entry_point": "get_file_sizes", "input": "'non_existent_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23226_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1289", "output": "{1, 1289}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002487", "code": "def isPhoneNumber(text):\n    if len(text) != 12:\n        return False\n    for i in range(0, 3):\n        if not text[i].isdecimal():\n            return False\n    if text[3] != '-':\n        return False\n    for i in range(4, 7):\n        if not text[i].isdecimal():\n            return False\n    if text[7] != '-':\n        return False\n    for i in range(8, 12):\n        if not text[i].isdecimal():\n            return False\n    return True\n", "entry_point": "isPhoneNumber", "input": "'123-456-7890'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129175_ipt34", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002488", "code": "def find_latest_version(versions):\n    def version_key(version):\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    sorted_versions = sorted(versions, key=version_key, reverse=True)\n    return sorted_versions[0]\n", "entry_point": "find_latest_version", "input": "['4.2.3', '5.1.0', '5.1.6', '5.1.7']", "output": "'5.1.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42610_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002489", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[5, [5, 5], [5]]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002490", "code": "def find_pairs_with_sum(nums, target_sum):\n    seen = {}\n    pairs = []\n    for num in nums:\n        diff = target_sum - num\n        if diff in seen:\n            pairs.append((num, diff))\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs_with_sum", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25827_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002491", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[3, 3, 3, 3, 1, 2]", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002492", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[6, 3, 7, 5, 5, 7, 5], 7", "output": "[[6, 3, 7, 5, 5, 7, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002493", "code": "def basic_calculator(num1, num2, operator):\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n    elif operator == '*':\n        return num1 * num2\n    elif operator == '/':\n        if num2 == 0:\n            return \"Error: Division by zero is not allowed.\"\n        else:\n            return num1 / num2\n    else:\n        return \"Error: Invalid operator\"\n", "entry_point": "basic_calculator", "input": "10, 5, '@'", "output": "'Error: Invalid operator'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81801_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002494", "code": "def count_unique_characters(s):\n    unique_chars = set()\n    for char in s:\n        unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abcdefg1'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144055_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002495", "code": "def generate_url_path(app_name, view_name, *args):\n    url_mapping = {\n        'index': '',\n        'get_by_title': 'title/',\n        'get_filtered_films': 'filter/',\n        'vote_for_film': 'vote/',\n        'insert_film': 'insert/',\n        '_enum_ids': 'enum/',\n        '_get_by_id': 'id/'\n    }\n    if view_name in url_mapping:\n        url_path = f'/{app_name}/{url_mapping[view_name]}'\n        if args:\n            url_path += '/'.join(str(arg) for arg in args)\n        return url_path\n    else:\n        return 'Invalid view name'\n", "entry_point": "generate_url_path", "input": "'my_app', 'non_existent_view'", "output": "'Invalid view name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124830_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002496", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1])  # Append the last element unchanged\n    return output_list\n", "entry_point": "process_list", "input": "[0, 3, 2, 5]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114829_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002497", "code": "def total_legs(animal_list):\n    total_legs_count = 0\n    animals = animal_list.split(',')\n    for animal in animals:\n        name, legs = animal.split(':')\n        total_legs_count += int(legs)\n    return total_legs_count\n", "entry_point": "total_legs", "input": "'ant:4'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23053_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002498", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "11", "output": "'SDL_LOG_CATEGORY_RESERVED3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002499", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "5", "output": "'oh la laoh la laoh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002500", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 1 or n == 2:\n        return 1\n    else:\n        result = fibonacci_memo(n - 1, memo) + fibonacci_memo(n - 2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33770_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002501", "code": "def compute_min_refills(distance, tank, stops):\n    stops = [0] + stops + [distance]\n    n = len(stops) - 1\n    refills = 0\n    current_refill = 0\n    while current_refill < n:\n        last_refill = current_refill\n        while current_refill < n and stops[current_refill + 1] - stops[last_refill] <= tank:\n            current_refill += 1\n        if current_refill == last_refill:\n            return -1\n        if current_refill < n:\n            refills += 1\n    return refills\n", "entry_point": "compute_min_refills", "input": "100, 20, [30]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52394_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002502", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average_score", "input": "[1, 2]", "output": "'Not enough scores to calculate average.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137184_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002503", "code": "csa_time = [157.230, 144.460, 110.304, 137.585, 97.767, 87.997, 86.016, 83.449, 61.127, 50.558]\nsa_len = [977, 879, 782, 684, 586, 489, 391, 293, 196, 98]\nsa_time = [12.251, 11.857, 12.331, 12.969, 12.777, 12.680, 11.795, 11.555, 11.752, 11.657]\nradix_len = [20, 50, 60, 70, 80, 90, 100, 120, 150, 200, 300, 400, 500, 600, 700, 800, 900]\nradix_time = [0.220, 0.242, 0.243, 0.237, 0.243, 0.244, 0.243, 0.245, 0.256, 0.258, 0.261, 0.263, 0.267, 0.268, 0.270, 0.274, 0.277]\nbest_algorithm = {}\n# Update the best performing algorithm for each document size\nfor size, csa, sa, radix in zip(sa_len, csa_time, sa_time, radix_time):\n    best_algo = min((csa, 'CSA'), (sa, 'SA'), (radix, 'Radix'))[1]\n    best_algorithm[size] = best_algo\ndef best_algorithm_for_size(document_size):\n    return best_algorithm.get(document_size, \"Document size not found\")\n", "entry_point": "best_algorithm_for_size", "input": "1000", "output": "'Document size not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103326_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002504", "code": "# Define the map_path_id function\ndef map_path_id(inner_path_id, view_path_id_map):\n    # Retrieve the mapping for the inner path ID from the view path ID map\n    mapped_path_id = view_path_id_map.get(inner_path_id, None)\n    return mapped_path_id\n", "entry_point": "map_path_id", "input": "1, {1: 4, 2: 5}", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130638_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002505", "code": "def bubble_sort(elements):\n    while True:\n        swapped = False\n        for i in range(len(elements) - 1):\n            if elements[i] > elements[i + 1]:\n                # Swap elements\n                elements[i], elements[i + 1] = elements[i + 1], elements[i]\n                swapped = True\n        if not swapped:\n            break\n    return elements\n", "entry_point": "bubble_sort", "input": "[25, 24, 11, 9, 25, 26, 25]", "output": "[9, 11, 24, 25, 25, 25, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115988_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002506", "code": "def removeElement(nums, val):\n    \"\"\"\n    :type nums: List[int]\n    :type val: int\n    :rtype: int\n    \"\"\"\n    nums[:] = [num for num in nums if num != val]\n    return len(nums)\n", "entry_point": "removeElement", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10], 10", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53354_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002507", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[5, 6, 8]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66251_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8194", "output": "{1, 8194, 2, 4097, 482, 34, 17, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8193", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002509", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "40, 124", "output": "(220, 55)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002510", "code": "def extract_base_directory(file_path):\n    base_dir = \"\"\n    for i in range(len(file_path) - 1, -1, -1):\n        if file_path[i] == '/':\n            base_dir = file_path[:i]\n            break\n    return base_dir\n", "entry_point": "extract_base_directory", "input": "'/home/user/docu.txt'", "output": "'/home/user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67520_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002511", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = low + (high - low) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 7", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31126_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002512", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'yooy'", "output": "{'yooy': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002513", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "3", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002514", "code": "def find_non_dup(A=[]):\n    if len(A) == 0:\n        return None\n    non_dup = [x for x in A if A.count(x) == 1]\n    return non_dup[-1]\n", "entry_point": "find_non_dup", "input": "[1, 1, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57269_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002515", "code": "from typing import List\ndef countConstruct(target: str, wordBank: List[str]) -> int:\n    ways = [0] * (len(target) + 1)\n    ways[0] = 1\n    for i in range(len(target)):\n        if ways[i] > 0:\n            for word in wordBank:\n                if target[i:i+len(word)] == word:\n                    ways[i+len(word)] += ways[i]\n    return ways[len(target)]\n", "entry_point": "countConstruct", "input": "'abc', ['def', 'ghi', 'jkl']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94402_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002516", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[16, 17, 18, 17.5]", "output": "17.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002517", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1057", "output": "{151, 1, 7, 1057}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002518", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "205", "output": "{1, 5, 205, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002519", "code": "def get_spyrelet_info(spyrelet_name):\n    spyrelets = {\n        'freqSweep_Keysight': [\n            'spyre.spyrelets.freqSweep_VNA_Keysight_spyrelet.Sweep',\n            {'vna': 'vna', 'source': 'source'},\n            {}\n        ],\n    }\n    if spyrelet_name in spyrelets:\n        spyrelet_info = spyrelets[spyrelet_name]\n        spyrelet_class = spyrelet_info[0]\n        input_params = spyrelet_info[1]\n        config_params = spyrelet_info[2]\n        return {\n            'Spyrelet Class': spyrelet_class,\n            'Input Parameters': input_params,\n            'Configuration Parameters': config_params\n        }\n    else:\n        return \"Spyrelet not found in the spyrelets dictionary.\"\n", "entry_point": "get_spyrelet_info", "input": "'nonExistingSpyrelet'", "output": "'Spyrelet not found in the spyrelets dictionary.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66637_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002520", "code": "def count_ways_to_climb_stairs(n):\n    if n == 0 or n == 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68008_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002521", "code": "def padding_zeroes(result, num_digits: int):\n    str_result = str(result)\n    # Check if the input number contains a decimal point\n    if '.' in str_result:\n        decimal_index = str_result.index('.')\n        decimal_part = str_result[decimal_index + 1:]\n        padding_needed = num_digits - len(decimal_part)\n        str_result += \"0\" * padding_needed\n    else:\n        str_result += '.' + \"0\" * num_digits\n    return str_result[:str_result.index('.') + num_digits + 1]\n", "entry_point": "padding_zeroes", "input": "6.04, 5", "output": "'6.04000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26190_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002522", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "2", "output": "'Skipped due to blacklist'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002523", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "10", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002524", "code": "def process_arguments(args):\n    if '-frontend' not in args or '-primary-file' not in args or '-o' not in args:\n        return \"Missing required arguments\"\n    primary_file = args[args.index('-primary-file') + 1]\n    output_file = args[args.index('-o') + 1]\n    if '-emit-bc' in args:\n        return f\"Handled {primary_file}\"\n    elif '-c' in args:\n        return f\"Produced {output_file}\"\n    else:\n        return \"Unknown action\"\n", "entry_point": "process_arguments", "input": "['-frontend', '-o', 'output.txt']", "output": "'Missing required arguments'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75523_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002525", "code": "def calculate_time_elapsed(start_time, end_time):\n    total_seconds = end_time - start_time\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return hours, minutes, seconds\n", "entry_point": "calculate_time_elapsed", "input": "0, 7200", "output": "(2, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87493_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002526", "code": "def validate_email_domain(email):\n    allowed_domains = ['company.com', 'example.org', 'test.net']\n    # Extract domain from email address\n    domain = email.split('@')[-1]\n    # Check if the domain is in the allowed list\n    if domain in allowed_domains:\n        return True\n    else:\n        return False\n", "entry_point": "validate_email_domain", "input": "'user@gmail.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6913_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002527", "code": "def get_archive_name(host_system):\n    if host_system == \"windows\":\n        return 'jpegsr9c.zip'\n    else:\n        return 'jpegsrc.v9c.tar.gz'\n", "entry_point": "get_archive_name", "input": "'linux'", "output": "'jpegsrc.v9c.tar.gz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78138_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002528", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'    mumultiltine\\n'", "output": "'mumultiltine\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002529", "code": "from typing import List\ndef search(arr: List[int], n: int, target: int) -> int:\n    low, high = 0, n - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "search", "input": "[1, 2, 3, 4, 5, 6, 7, 42, 9, 10], 10, 42", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108018_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002530", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[2, 2, 2, 4, 4, 4, 1, 1]", "output": "{2: 3, 4: 3, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002531", "code": "def blueprint(rows):\n    blueprint_pattern = []\n    for i in range(1, rows + 1):\n        row = []\n        if i % 2 != 0:  # Odd row\n            for j in range(1, i + 1):\n                row.append(j)\n        else:  # Even row\n            for j in range(ord('A'), ord('A') + i):\n                row.append(chr(j))\n        blueprint_pattern.append(row)\n    return blueprint_pattern\n", "entry_point": "blueprint", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141993_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002532", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44837_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002533", "code": "def sum_multiples_3_and_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_and_5", "input": "[15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95576_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002534", "code": "def get_json_support_level(django_version):\n    json_support_levels = {\n        (2, 2): 'has_jsonb_agg',\n        (3, 2): 'is_postgresql_10',\n        (4, 0): 'has_native_json_field'\n    }\n    for version, support_level in json_support_levels.items():\n        if django_version[:2] == version:\n            return support_level\n    return 'JSON support level not defined for this Django version'\n", "entry_point": "get_json_support_level", "input": "(4, 0)", "output": "'has_native_json_field'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40645_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002535", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abcabc;123;de'", "output": "['abcabc', 'de']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002536", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hhheeelllllloo'", "output": "{'h': 3, 'e': 3, 'l': 6, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119981_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002537", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "14, 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4622", "output": "{1, 2, 4622, 2311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4621", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3754", "output": "{1, 3754, 2, 1877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002540", "code": "from typing import List, Dict, Any\ndef validate_speaker_data(data: List[Dict[str, Any]]) -> bool:\n    for speaker_data in data:\n        if 'list_of_speakers_id' not in speaker_data or 'user_id' not in speaker_data:\n            return False\n    return True\n", "entry_point": "validate_speaker_data", "input": "[{'user_id': '1234'}, {'list_of_speakers_id': '5678'}]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75079_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002541", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1000010X'", "output": "['10000100', '10000101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002542", "code": "def total_cost(nums, A, B):\n    if B == 0:\n        return float(A)\n    k_m = 2 * A / B\n    count = 0\n    j_s = [nums[0]]\n    for i in range(1, len(nums)):\n        if nums[i] - nums[i - 1] <= k_m:\n            j_s.append(nums[i])\n        else:\n            count += A + (j_s[-1] - j_s[0]) / 2 * B\n            j_s = [nums[i]]\n    count += A + (j_s[-1] - j_s[0]) / 2 * B\n    return float(count)\n", "entry_point": "total_cost", "input": "[1, 2, 3, 5], 2, 2", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101200_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002543", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5417", "output": "{1, 5417}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002544", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[12, 12, 12, 24, 48]", "output": "[12, 12, 12, 24, 48]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002545", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'TrTmiemli'", "output": "'TrTmiemli'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002546", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "129", "output": "'2:09'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002547", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('a') if char.islower() else ord('A')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'ifmfazi', 5", "output": "'nkrkfen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35219_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002548", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "'Hlo, Wordd', 'd'", "output": "'Hlo, Word'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002549", "code": "import re\ndef analyze_version_pattern(version):\n    patterns = {\n        'NO_REPOSITORY_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_COMMITS_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_TAG_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_TAG_DIRTY_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'TAG_ON_HEAD_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+$'),\n        'TAG_ON_HEAD_DIRTY_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SNAPSHOT\\w+$'),\n        'TAG_NOT_ON_HEAD_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SHA\\w+$'),\n        'TAG_NOT_ON_HEAD_DIRTY_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SHA\\w+SNAPSHOT\\w+$')\n    }\n    for pattern_type, pattern in patterns.items():\n        if pattern.match(version):\n            return pattern_type\n    return \"Unknown\"\n", "entry_point": "analyze_version_pattern", "input": "'invalid_version'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39657_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002550", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[100, 82, 101]", "output": "{100: 1, 82: 1, 101: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "425", "output": "{1, 5, 425, 17, 85, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt424", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7642", "output": "{1, 7642, 2, 3821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8161", "output": "{1, 8161}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4145", "output": "{1, 829, 5, 4145}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4144", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002555", "code": "def calculate_average(num1, num2, num3):\n    total_sum = num1 + num2 + num3\n    average = total_sum / 3\n    return average\n", "entry_point": "calculate_average", "input": "18, 19, 19", "output": "18.666666666666668", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_179_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002556", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8099", "output": "{1, 8099, 1157, 7, 13, 623, 89, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002557", "code": "def is_perfect_square(num: int) -> bool:\n    if num < 0:\n        return False\n    n = 0\n    while n * n <= num:\n        if n * n == num:\n            return True\n        n += 1\n    return False\n", "entry_point": "is_perfect_square", "input": "2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5593_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002558", "code": "from typing import List\nimport ast\ndef find_functions_missing_typehints(file_content: str) -> List[str]:\n    tree = ast.parse(file_content)\n    missing_typehints = []\n    for node in tree.body:\n        if isinstance(node, ast.FunctionDef):\n            if not node.returns and all(param.annotation is ast.Name(id='Any') for param in node.args.args):\n                missing_typehints.append(node.name)\n    return missing_typehints\n", "entry_point": "find_functions_missing_typehints", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17742_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002559", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "6, 7.280109889280518", "output": "9.433981132056603", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002560", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8371", "output": "{11, 1, 8371, 761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002561", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "'any_id', -8", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002562", "code": "def maximize_score(deck):\n    take = skip = 0\n    for card in deck:\n        new_take = skip + card\n        new_skip = max(take, skip)\n        take, skip = new_take, new_skip\n    return max(take, skip)\n", "entry_point": "maximize_score", "input": "[9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91144_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002563", "code": "def parse_configuration_file(file_content):\n    builders = {}\n    testers = {}\n    gsutil_urls = {}\n    lines = file_content.split('\\n')\n    for i in range(len(lines)):\n        line = lines[i]\n        if 'B(' in line:  # Extract builder information\n            builder_name = line.split('(')[1].split(',')[0].strip().strip(\"'\")\n            if 'builddir=' in line:\n                build_dir = line.split('builddir=')[1].split(')')[0].strip().strip(\"'\")\n                builders[builder_name] = build_dir\n        elif 'B(' in line and 'scheduler=' in line:  # Extract tester information\n            tester_name = line.split('(')[1].split(',')[0].strip().strip(\"'\")\n            scheduler = line.split('scheduler=')[1].split(')')[0].strip().strip(\"'\")\n            testers[tester_name] = scheduler\n        elif 'GetGSUtilUrl' in line:  # Extract URL information\n            parameters = line.split('(')[1].split(')')[0].split(',')\n            gsutil_urls[parameters[0].strip().strip(\"'\")] = parameters[1].strip().strip(\"'\")\n    return builders, testers, gsutil_urls\n", "entry_point": "parse_configuration_file", "input": "''", "output": "({}, {}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121863_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002564", "code": "def calculate_result(model_type, value):\n    dismodfun = {\n        'RDD': 'RDD',\n        'RRDD-E': 'RRDD',\n        'RRDD-R': 'RRDD',\n    }\n    if model_type in dismodfun:\n        if model_type == 'RDD':\n            return value ** 2\n        elif model_type == 'RRDD-E':\n            return value * 2\n        elif model_type == 'RRDD-R':\n            return value ** 3\n    else:\n        return 'Invalid model type'\n", "entry_point": "calculate_result", "input": "'XYZ', 10", "output": "'Invalid model type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83607_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002565", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "2048", "output": "'     2 KB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002566", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'exaplemple'", "output": "'exaplemple_685733743'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6401", "output": "{1, 37, 6401, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002568", "code": "def validate_search_form(test_cases):\n    results = []\n    for case in test_cases:\n        has_searchtype = \"searchtype\" in case\n        has_query = \"query\" in case\n        if has_searchtype and has_query:\n            results.append(True)\n        elif has_searchtype or has_query:\n            results.append(False)\n        else:\n            results.append(False)\n    return results\n", "entry_point": "validate_search_form", "input": "[{}, {}, {}, {}]", "output": "[False, False, False, False]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6557_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "94", "output": "{1, 2, 94, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt93", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002570", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'000x123066f'", "output": "{'bytecode': '0x000x123066f'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002571", "code": "def sum_multiples_of_3_or_5(nums):\n    multiples = set()\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples:\n                total += num\n                multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66564_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002572", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/admin/dashboard/'", "output": "'/admin/dashboard/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002573", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 3, 4, 1, 5, 3, 1, 3, 3]", "output": "[3, 6, 10, 11, 16, 19, 20, 23, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002574", "code": "import os\ndef files_in_dir(dir):\n    if not os.path.exists(dir):\n        return 0\n    num_files = 0\n    for dir_entry in os.listdir(dir):\n        full_filename = os.path.join(dir, dir_entry)\n        if os.path.isfile(full_filename):\n            num_files += 1\n        elif os.path.isdir(full_filename):\n            num_files += files_in_dir(full_filename)\n    return num_files\n", "entry_point": "files_in_dir", "input": "'non_existent_directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14067_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3586", "output": "{1, 3586, 2, 1793, 163, 326, 11, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002576", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9896", "output": "{1, 2, 4, 9896, 8, 2474, 4948, 1237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9895", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002577", "code": "def calculate_luminance(r, g, b):\n    luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b\n    return round(luminance, 2)\n", "entry_point": "calculate_luminance", "input": "0, 2.5, 0", "output": "1.79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28393_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002578", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "518.54", "output": "'R$:518,54'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8846", "output": "{1, 2, 8846, 4423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002580", "code": "def calculate_grade(score1, score2):\n    if score1 >= 90 and score2 > 80:\n        return \"A\"\n    elif score1 >= 80 and score2 >= 70:\n        return \"B\"\n    elif score1 >= 70 and score2 >= 60:\n        return \"C\"\n    elif score1 == 75 or score2 <= 65:\n        return \"D\"\n    else:\n        return \"E\"\n", "entry_point": "calculate_grade", "input": "75, 65", "output": "'C'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123969_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002581", "code": "import re\ndef parse_translation_mapping(code_snippet):\n    translation_mapping = {}\n    # Regular expression pattern to match the UI element names and their translated texts\n    pattern = r'\\.(\\w+)\\.(\\w+)\\(_translate\\(\"NewCharacterDialog\", \"(.*?)\"\\)'\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        element_name = match[1]\n        translated_text = match[2]\n        translation_mapping[element_name] = translated_text\n    return translation_mapping\n", "entry_point": "parse_translation_mapping", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44569_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002582", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "12", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2821", "output": "{1, 2821, 7, 13, 403, 217, 91, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4577", "output": "{1, 199, 4577, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002585", "code": "def validate_file(file_name, file_size, file_extension):\n    IMAGE_EXT_NAME_LS = [\"bmp\", \"jpg\", \"png\", \"tif\", \"gif\", \"pcx\", \"tga\", \"exif\", \"fpx\", \"svg\", \"psd\", \"cdr\", \"pcd\", \"dxf\",\n                         \"ufo\", \"eps\", \"ai\", \"raw\", \"WMF\", \"webp\"]\n    DOC_EXT_NAME_LS = [\"ppt\", \"pptx\", \"doc\", \"docx\", \"xls\", \"xlsx\", \"txt\", \"pdf\"]\n    IMAGE_MAX_SIZE = 5 * 1024 * 1024\n    DOC_MAX_SIZE = 100 * 1024 * 1024\n    if file_extension.lower() in IMAGE_EXT_NAME_LS:\n        if file_size <= IMAGE_MAX_SIZE:\n            return True\n    elif file_extension.lower() in DOC_EXT_NAME_LS:\n        if file_size <= DOC_MAX_SIZE:\n            return True\n    return False\n", "entry_point": "validate_file", "input": "'example.exe', 50 * 1024 * 1024, 'exe'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46349_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002586", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[1, 2, 3, 4], 7", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002587", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "42", "output": "'000000000000002a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002588", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "8", "output": "'1113213211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002589", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "20", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002590", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    numbers.sort()\n    n = len(numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return float(numbers[n // 2])\n    else:  # Even number of elements\n        mid1 = numbers[n // 2 - 1]\n        mid2 = numbers[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[4, 5]", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95265_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2823", "output": "{1, 3, 941, 2823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002592", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[0], 7", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002593", "code": "def convert_time_interval(minutes):\n    time_intervals = {\n        1: '1m',\n        3: '3m',\n        5: '5m',\n        15: '15m',\n        30: '30m',\n        60: '1h',\n        120: '2h',\n        240: '4h',\n        360: '6h',\n        480: '8h',\n        720: '12h',\n        1440: '1d',\n        4320: '3d',\n        10080: '1w',\n        43200: '1M'\n    }\n    if minutes in time_intervals:\n        return time_intervals[minutes]\n    else:\n        return \"Invalid time interval\"\n", "entry_point": "convert_time_interval", "input": "2", "output": "'Invalid time interval'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142859_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002594", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_repeated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_repeated_scores:\n        return max(non_repeated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_repeated_score", "input": "[100, 50, 50]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144053_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002595", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "2, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002596", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3801", "output": "{1, 3, 7, 1267, 21, 181, 3801, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002597", "code": "from typing import List\ndef sum_multiples_of_3_or_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 6, 9]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93298_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002598", "code": "def max_subarray_sum(nums):\n    max_sum = nums[0]\n    current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 5, 2, 3]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29596_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002599", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "89", "output": "{89: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002600", "code": "def card_game_winner(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    for i in range(min(len(deck1), len(deck2))):\n        if deck1[i] > deck2[i]:\n            player1_wins += 1\n        elif deck1[i] < deck2[i]:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins the game with {} rounds won out of {}\".format(player1_wins, min(len(deck1), len(deck2)))\n    elif player1_wins < player2_wins:\n        return \"Player 2 wins the game with {} rounds won out of {}\".format(player2_wins, min(len(deck1), len(deck2)))\n    else:\n        return \"It's a tie!\"\n", "entry_point": "card_game_winner", "input": "[1, 2, 3], [1, 2, 3]", "output": "\"It's a tie!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114680_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002601", "code": "from typing import List\ndef split_list(lst: List[int], n: int) -> List[List[int]]:\n    if n == 1:\n        return [lst]\n    output = [[] for _ in range(n)]\n    for i, num in enumerate(lst):\n        output[i % n].append(num)\n    return output\n", "entry_point": "split_list", "input": "[50, 6, 1, 50, 6, 6, 50], 5", "output": "[[50, 6], [6, 50], [1], [50], [6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21886_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002602", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1504", "output": "1464", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002603", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "999", "output": "'Quest ID not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002604", "code": "def count_trailing_zeros_in_factorial(n):\n    count = 0\n    i = 5\n    while n // i > 0:\n        count += n // i\n        i *= 5\n    return count\n", "entry_point": "count_trailing_zeros_in_factorial", "input": "25", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25829_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002605", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 1, 0, 1, 0, 1, 1, 1]", "output": "[2, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002606", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002607", "code": "def get_account_description(account_code):\n    account_type = {\n        \"ma\": \"manager\",\n        \"em\": \"employee\",\n        \"hr\": \"hr\"\n    }\n    return account_type.get(account_code, \"Unknown account type\")\n", "entry_point": "get_account_description", "input": "'admin'", "output": "'Unknown account type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137661_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002608", "code": "def count_elements_in_nested_dict(nested_dict):\n    count = 0\n    for value in nested_dict.values():\n        if isinstance(value, dict):\n            count += count_elements_in_nested_dict(value)\n        elif isinstance(value, list):\n            count += len(value)\n        else:\n            count += 1\n    return count\n", "entry_point": "count_elements_in_nested_dict", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44462_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002609", "code": "def sum_of_even_squares(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num ** 2\n    return even_sum\n", "entry_point": "sum_of_even_squares", "input": "[2, 6, 6]", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24763_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002610", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[7, 1, 1, 4, 6, 5, 5, 5]", "output": "[7, 1, 4, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002611", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1163", "output": "{1, 1163}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002612", "code": "import re\ndef simulate_acl_operations(acl_entry_str):\n    non_ascii_name = u'Test NonAscii \u0142\u0631\u062d\uc548'\n    # Simulate creating an object\n    obj_uri = \"gs://example-bucket/foo\"\n    # Simulate getting ACL entries\n    stdout = f\"Sample ACL entries for {obj_uri}\"\n    # Simulate updating ACL entries\n    new_acl_str = re.sub('</Entries>', f'%s</Entries>' % acl_entry_str, stdout)\n    # Simulate creating a temporary ACL file\n    acl_path = \"temp_acl_file.xml\"\n    # Simulate setting ACL for the object\n    res_acl_str = f\"Updated ACL entries for {obj_uri}\"\n    return res_acl_str\n", "entry_point": "simulate_acl_operations", "input": "''", "output": "'Updated ACL entries for gs://example-bucket/foo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80771_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002613", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'2.5abc'", "output": "(2, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002614", "code": "import time\ndef is_daytime(dawn_hr, sunset_hr):\n    current_time = time.localtime()\n    hour = current_time[3]\n    minute = current_time[4]\n    hour_float = 1.0 * hour + minute / 60.0\n    if hour_float > (sunset_hr + 12) or hour_float < dawn_hr:\n        return False  # Nighttime\n    else:\n        return True  # Daytime\n", "entry_point": "is_daytime", "input": "6, 18", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7339_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002615", "code": "def validate_user_data(data: dict) -> str:\n    if 'email' not in data:\n        return 'Error: Email is missing.'\n    if 'password' not in data:\n        return 'Error: Password is missing.'\n    if len(data.get('password', '')) < 8:\n        return 'Error: Password must be at least 8 characters long.'\n    return ''\n", "entry_point": "validate_user_data", "input": "{'password': '12345678'}", "output": "'Error: Email is missing.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114221_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002616", "code": "SEP_MAP = {\"xls\": \"\\t\", \"XLS\": \"\\t\", \"CSV\": \",\", \"csv\": \",\", \"xlsx\": \"\\t\", \"XLSX\": \"\\t\"}\ndef get_separator(file_extension):\n    return SEP_MAP.get(file_extension, \"Unknown\")\n", "entry_point": "get_separator", "input": "'doc'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45466_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002617", "code": "def calculate_average_score(scores):\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[83, 83, 83]", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72557_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002618", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 1, 0, 2, 3, 3, 3, 0]", "output": "[3, 2, 2, 5, 7, 8, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002619", "code": "def recursion_binary_search(arr, target):\n    if not arr:\n        return False\n    if len(arr) == 1:\n        return arr[0] == target\n    if target < arr[0] or target > arr[-1]:\n        return False\n    mid = len(arr) // 2\n    if arr[mid] == target:\n        return True\n    elif target < arr[mid]:\n        return recursion_binary_search(arr[:mid], target)\n    else:\n        return recursion_binary_search(arr[mid:], target)\n", "entry_point": "recursion_binary_search", "input": "[], 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48156_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002620", "code": "def generate_symmetric_banner(text, gap):\n    total_length = len(text) + gap\n    left_padding = (total_length - len(text)) // 2\n    right_padding = total_length - len(text) - left_padding\n    symmetric_banner = \" \" * left_padding + text + \" \" * right_padding\n    return symmetric_banner\n", "entry_point": "generate_symmetric_banner", "input": "'Hello,', 24", "output": "'            Hello,            '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92337_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002621", "code": "def text_converter(input_text, conversion_type):\n    words = input_text.split()\n    if conversion_type == \"reverse\":\n        converted_text = ' '.join(reversed(words))\n    elif conversion_type == \"capitalize\":\n        converted_text = ' '.join(word.capitalize() for word in words)\n    else:\n        return \"Invalid conversion type. Please choose 'reverse' or 'capitalize'.\"\n    return converted_text\n", "entry_point": "text_converter", "input": "'hello world', 'reverse'", "output": "'world hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145071_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002622", "code": "def sum_multiples_of_3_or_5(numbers):\n    multiples_set = set()\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples_set:\n                multiples_set.add(num)\n                total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145133_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002623", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'apramae'", "output": "('apramae', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002624", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "-6", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002625", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'user set   '", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002626", "code": "def generate_sequence(a, b, n):\n    output = \"\"\n    for num in range(1, n + 1):\n        if num % a == 0 and num % b == 0:\n            output += \"FB \"\n        elif num % a == 0:\n            output += \"F \"\n        elif num % b == 0:\n            output += \"B \"\n        else:\n            output += str(num) + \" \"\n    return output.rstrip()\n", "entry_point": "generate_sequence", "input": "4, 7, 6", "output": "'1 2 3 F 5 6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30858_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002627", "code": "def extract_major_minor_version(version_string):\n    # Split the version string by the dot ('.') character\n    version_parts = version_string.split('.')\n    # Extract the major version\n    major_version = int(version_parts[0])\n    # Extract the minor version by removing non-numeric characters\n    minor_version = ''.join(filter(str.isdigit, version_parts[1]))\n    # Convert the major and minor version parts to integers\n    minor_version = int(minor_version)\n    # Return a tuple containing the major and minor version numbers\n    return major_version, minor_version\n", "entry_point": "extract_major_minor_version", "input": "'333.version42'", "output": "(333, 42)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141202_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002628", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[10, 10, 10, 10]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98803_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002629", "code": "def is_valid_base64(input_str):\n    base64_chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"\n    if len(input_str) % 4 != 0:\n        return False\n    for char in input_str:\n        if char not in base64_chars and char != '=':\n            return False\n    padding_count = input_str.count('=')\n    if padding_count > 2:\n        return False\n    if padding_count == 1 and input_str[-1] != '=':\n        return False\n    if padding_count == 2 and input_str[-2:] != '==':\n        return False\n    return True\n", "entry_point": "is_valid_base64", "input": "'QUFB'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44667_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002630", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[6, 2, 1, 1, 2]", "output": "[8, 3, 2, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002631", "code": "def generate_event_log(event_type, app_name):\n    event_messages = {\n        \"eAlgoLog\": \"eAlgoLog event occurred\",\n        \"eAlgoSetting\": \"eAlgoSetting event occurred\",\n        \"eAlgoVariables\": \"eAlgoVariables event occurred\",\n        \"eAlgoParameters\": \"eAlgoParameters event occurred\"\n    }\n    if event_type in event_messages:\n        return f\"{app_name} - {event_messages[event_type]}\"\n    else:\n        return \"Invalid event type\"\n", "entry_point": "generate_event_log", "input": "'eAlgoLog', 'AlgoTrading'", "output": "'AlgoTrading - eAlgoLog event occurred'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57908_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "808", "output": "{1, 2, 4, 101, 808, 8, 202, 404}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt807", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002633", "code": "from typing import List\ndef evaluate_condition(obj: List[float]) -> str:\n    if obj[7] <= 3.0:\n        if obj[3] <= 4:\n            return 'True'\n        elif obj[3] > 4:\n            return 'True'\n        else:\n            return 'True'\n    elif obj[7] > 3.0:\n        if obj[3] > 0:\n            return 'True'\n        elif obj[3] <= 0:\n            return 'True'\n        else:\n            return 'True'\n    else:\n        return 'True'\n", "entry_point": "evaluate_condition", "input": "[1.0, 2.0, -1.0, 4.0, 5.0, 6.0, 7.0, 3.0]", "output": "'True'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83901_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002634", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    sum_scores = sum(sorted_scores[1:])\n    return sum_scores / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[50, 80, 83, 84, 85]", "output": "83.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56746_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8266", "output": "{1, 8266, 2, 4133}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002636", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 1, 0, 1, 1, 1, 2, 1]", "output": "[2, 1, 1, 2, 2, 3, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26581_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002637", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[2, 2, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134482_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002638", "code": "def search(s: str, pattern: str) -> int:\n    if len(s) < len(pattern):\n        return 0\n    if s[:len(pattern)] == pattern:\n        return 1 + search(s[len(pattern):], pattern)\n    else:\n        return search(s[1:], pattern)\n", "entry_point": "search", "input": "'hello', 'he'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118249_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002639", "code": "def verify_message(m: str) -> bool:\n    mBytes = m.encode(\"utf-8\")\n    mInt = int.from_bytes(mBytes, byteorder=\"big\")\n    mBytes2 = mInt.to_bytes(((mInt.bit_length() + 7) // 8), byteorder=\"big\")\n    m2 = mBytes2.decode(\"utf-8\")\n    return m == m2\n", "entry_point": "verify_message", "input": "'hello'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88308_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002640", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[6, 1, 1, 2, 2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002641", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7734", "output": "{1, 2, 3, 6, 1289, 2578, 7734, 3867}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002642", "code": "def firstDuplicateValue(array):\n    for n in array:\n        n = abs(n)\n        if array[n - 1] < 0:\n            return n\n        array[n - 1] *= -1\n    return -1\n", "entry_point": "firstDuplicateValue", "input": "[1, 2, 3, 4, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124309_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002643", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[20, 25, 14], 60", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002644", "code": "def find_base_paths(file_names):\n    BASE_FILES = \"C:\\\\Users\\\\Dani\\\\repos-git\\\\shexerp3\\\\test\\\\t_files\\\\\"\n    BASE_FILES_GENERAL = BASE_FILES + \"general\\\\\"\n    file_paths = {\n        \"g1_all_classes_no_comments.shex\": BASE_FILES_GENERAL,\n        \"t_graph_1.ttl\": BASE_FILES,\n        \"t_graph_1.nt\": BASE_FILES,\n        \"t_graph_1.tsv\": BASE_FILES,\n        \"t_graph_1.json\": BASE_FILES,\n        \"t_graph_1.xml\": BASE_FILES,\n        \"t_graph_1.n3\": BASE_FILES\n    }\n    base_paths = [file_paths.get(file_name, \"Base file path not found\") for file_name in file_names]\n    return base_paths\n", "entry_point": "find_base_paths", "input": "['nonexistent_file.txt']", "output": "['Base file path not found']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22720_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002645", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "6", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002646", "code": "def extract_major_version(version):\n    major_version = int(version.split('.')[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'2.5'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138661_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002647", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6853", "output": "{1, 6853, 7, 11, 77, 623, 979, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002648", "code": "def calculate_tanimoto_similarity(fingerprint_a, fingerprint_b):\n    intersection = set(fingerprint_a) & set(fingerprint_b)\n    union = set(fingerprint_a) | set(fingerprint_b)\n    if len(union) == 0:\n        return 0.0\n    tanimoto_similarity = len(intersection) / len(union)\n    return round(tanimoto_similarity, 2)\n", "entry_point": "calculate_tanimoto_similarity", "input": "[], []", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2257_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002649", "code": "def count_trailing_zeros_in_factorial(n):\n    count = 0\n    i = 5\n    while n // i > 0:\n        count += n // i\n        i *= 5\n    return count\n", "entry_point": "count_trailing_zeros_in_factorial", "input": "30", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25829_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002650", "code": "def longest_consecutive_subsequence(input_list):\n    current_sequence = []\n    longest_sequence = []\n    for num in input_list:\n        if not current_sequence or num == current_sequence[-1] + 1:\n            current_sequence.append(num)\n        else:\n            if len(current_sequence) > len(longest_sequence):\n                longest_sequence = current_sequence\n            current_sequence = [num]\n    if len(current_sequence) > len(longest_sequence):\n        longest_sequence = current_sequence\n    return longest_sequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[4, 5, 10, 12]", "output": "[4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87901_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002651", "code": "def find_earliest_bus_departure(t, busses):\n    for i in range(t, t + 1000):  # Check timestamps from t to t+1000\n        for bus in busses:\n            if i % bus == 0:  # Check if bus departs at current timestamp\n                return i\n", "entry_point": "find_earliest_bus_departure", "input": "935, [936]", "output": "936", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75100_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002652", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'notifcation'", "output": "'notifcation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002653", "code": "def transform_sql_query(sql_query):\n    modified_query = sql_query.replace(\"select\", \"SELECT\").replace(\"from\", \"FROM\").replace(\"where\", \"WHERE\")\n    return modified_query\n", "entry_point": "transform_sql_query", "input": "'select'", "output": "'SELECT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96099_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002654", "code": "# Define the dependencies dictionary\ndependencies = {\n    'MySqlConnection': ['MySqlConnectionResolver'],\n    'MySqlConnectionResolver': []\n}\ndef resolve_dependencies(module_name):\n    def dfs(module):\n        if module not in dependencies:\n            return\n        for dependency in dependencies[module]:\n            if dependency not in visited:\n                visited.add(dependency)\n                dfs(dependency)\n        order.append(module)\n    visited = set()\n    order = []\n    visited.add(module_name)\n    dfs(module_name)\n    return order\n", "entry_point": "resolve_dependencies", "input": "'UnresolvedModule'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59418_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002655", "code": "def generate_url_path(app_name, view_name, *args):\n    url_mapping = {\n        'index': '',\n        'get_by_title': 'title/',\n        'get_filtered_films': 'filter/',\n        'vote_for_film': 'vote/',\n        'insert_film': 'insert/',\n        '_enum_ids': 'enum/',\n        '_get_by_id': 'id/'\n    }\n    if view_name in url_mapping:\n        url_path = f'/{app_name}/{url_mapping[view_name]}'\n        if args:\n            url_path += '/'.join(str(arg) for arg in args)\n        return url_path\n    else:\n        return 'Invalid view name'\n", "entry_point": "generate_url_path", "input": "'service_app', 'insert_film', 123", "output": "'/service_app/insert/123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124830_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002656", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'John'", "output": "'John'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002657", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[85, 88, 90, 90, 92]", "output": "89.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101899_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002658", "code": "def is_subnational1(code: str) -> bool:\n    if len(code) < 5:\n        return False\n    parts = code.split(\"-\")\n    if len(parts) != 2:\n        return False\n    country_code, subnational_code = parts\n    if len(country_code) != 2 or not country_code.isalpha() or not country_code.isupper():\n        return False\n    if len(subnational_code) != 2 or not subnational_code.isalpha() or not subnational_code.isupper():\n        return False\n    return True\n", "entry_point": "is_subnational1", "input": "'AB-CDD'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15033_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002659", "code": "def check_python_compatibility(version1, version2):\n    def get_major_version(version):\n        return int(version.split('.')[0])\n    major_version1 = get_major_version(version1)\n    major_version2 = get_major_version(version2)\n    return major_version1 >= major_version2\n", "entry_point": "check_python_compatibility", "input": "'3.1.4', '3.0.1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97320_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002660", "code": "def card_game_winner(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return 1\n    elif player2_wins > player1_wins:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_game_winner", "input": "[1, 2, 3], [4, 5, 6]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3863_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002661", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'DAM', 'HMN'", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002662", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-7, -11, -10, -9, -11, -8, 7]", "output": "[-7, -11, -10, -9, -11, -8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002663", "code": "def remove_dot_glyphs(glyph_names):\n    filtered_glyphs = [name for name in glyph_names if '.' not in name]\n    return filtered_glyphs\n", "entry_point": "remove_dot_glyphs", "input": "['a.b', 'c.d']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75654_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002664", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[1, 1, 2, 3]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002665", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4547", "output": "{1, 4547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002666", "code": "import json\ndef update_module_values(data):\n    for item in data:\n        if isinstance(item, dict):\n            module = item.get(\"@module\", \"\")\n            if \"beep_ep\" in module:\n                item[\"@module\"] = module.replace(\"beep_ep\", \"beep\")\n    return data\n", "entry_point": "update_module_values", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102332_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002667", "code": "import math\ndef calculate_quality_score(likelihood):\n    likelihood = min(float(likelihood), 1 - 1e-8)  # Restrict likelihood to be at most 1 - 1e-8\n    quality = -10 * math.log10(1 - likelihood)\n    return min(quality, 80)  # Ensure quality score does not exceed 80\n", "entry_point": "calculate_quality_score", "input": "0.99999999", "output": "79.99999997817775", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132420_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002668", "code": "def generate_modified_commands(input_str):\n    modified_commands = []\n    for line in input_str.split('\\n'):\n        if not line:\n            continue\n        parts = line.split()\n        if len(parts) != 2:\n            continue\n        command, target = parts\n        output = ('error: the following file has local modifications:\\n    {}\\n(use '\n                  '--cached to keep the file, or -f to force removal)').format(target)\n        new_commands = [f'{command} --cached {target}', f'{command} -f {target}']\n        modified_commands.append(new_commands)\n    return modified_commands\n", "entry_point": "generate_modified_commands", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4424_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002669", "code": "from typing import List\ndef find_non_unique_machine_ids(machine_ids: List[str]) -> List[str]:\n    id_counts = {}\n    # Count occurrences of each machine ID\n    for machine_id in machine_ids:\n        id_counts[machine_id] = id_counts.get(machine_id, 0) + 1\n    # Filter out non-unique machine IDs\n    non_unique_ids = [id for id, count in id_counts.items() if count > 1]\n    return non_unique_ids\n", "entry_point": "find_non_unique_machine_ids", "input": "['id1', 'id2', 'id3']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102400_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002670", "code": "def find_peak_index(arr):\n    for i in range(1, len(arr) - 1):\n        if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:\n            return i\n    return -1  # No peak found\n", "entry_point": "find_peak_index", "input": "[1, 2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94014_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002671", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[10, 10, 6, 10, 10, 10]", "output": "[20, 16, 16, 20, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002672", "code": "def calculate_factorial(n):\n    if n < 0:\n        return 0\n    factorial = 1\n    for i in range(1, n + 1):\n        factorial *= i\n    return factorial\n", "entry_point": "calculate_factorial", "input": "7", "output": "5040", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130862_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002673", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[5]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002674", "code": "import re\ndef extract_translations(input_str):\n    translation_set = set()\n    pattern = r'_translate\\(\".*?\", \"(.*?)\"\\)'\n    translations = re.findall(pattern, input_str)\n    for translation in translations:\n        translation_set.add(translation)\n    return list(translation_set)\n", "entry_point": "extract_translations", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95497_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002675", "code": "def process_states(inputs, num_iterations):\n    states_fw = []\n    states_bw = []\n    prev_layer = inputs\n    for _ in range(num_iterations):\n        next_layer = [prev_layer[i] + prev_layer[-i-1] for i in range(len(prev_layer))]\n        states_fw.extend(next_layer)\n        states_bw = next_layer + states_bw\n        prev_layer = next_layer\n    return states_fw, states_bw\n", "entry_point": "process_states", "input": "[], 1", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70892_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002676", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4953", "output": "{1, 3, 39, 13, 1651, 4953, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4952", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002677", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else sorted_scores\n    return sum(top_scores) / len(top_scores) if top_scores else 0\n", "entry_point": "average_top_scores", "input": "[83], 1", "output": "83.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125675_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002678", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4319", "output": "{1, 7, 617, 4319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002679", "code": "import re\ndef validate_uhl_system_number(uhl_system_number):\n    pattern = r'^([SRFG]\\d{7}|U\\d{7}.*|LB\\d{7}|RTD[\\-0-9]*)$'\n    if not uhl_system_number:\n        return True  # Empty string is considered invalid\n    if not re.match(pattern, uhl_system_number):\n        return True  # Input does not match the specified format rules\n    return False  # Input matches the specified format rules\n", "entry_point": "validate_uhl_system_number", "input": "'A123'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138825_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002680", "code": "from typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    for word in text.split():\n        processed_word = ''.join(char.lower() for char in word if char.isalnum())\n        if processed_word:\n            unique_words.add(processed_word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Hello, hello! Python; world.'", "output": "['hello', 'python', 'world']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110518_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002681", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "'o o'", "output": "'oo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002682", "code": "def check_go_pattern(input_string: str) -> bool:\n    # Convert the input string and pattern to lowercase for case-insensitive comparison\n    input_lower = input_string.lower()\n    pattern = \"go\"\n    # Check if the pattern \"go\" is present in the lowercase input string\n    return pattern in input_lower\n", "entry_point": "check_go_pattern", "input": "'Hello World'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26178_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002683", "code": "def ParseSegmentFromUrl(url: str, segment: str) -> str:\n    segments = url.split('/')\n    for i in range(len(segments)):\n        if segments[i] == segment.strip('/'):\n            return segments[i+1] if i+1 < len(segments) else \"\"\n    return \"\"\n", "entry_point": "ParseSegmentFromUrl", "input": "'http://example.com/one/two/three', 'four'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25864_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002684", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_repeated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_repeated_scores:\n        return max(non_repeated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_repeated_score", "input": "[1, 1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144053_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002685", "code": "from typing import List\ndef sum_multiples_of_3_or_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[10, 5, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93298_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002686", "code": "def calculate_circle_area(radius):\n    # Approximate the value of \u03c0 as 3.14159\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "1", "output": "3.14159", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002687", "code": "def find_pairs_with_difference(nums, k):\n    unique_nums = set(nums)\n    pair_count = 0\n    for num in nums:\n        if num + k in unique_nums:\n            pair_count += 1\n        if num - k in unique_nums:\n            pair_count += 1\n        unique_nums.add(num)\n    return pair_count // 2  # Divide by 2 to avoid double counting pairs\n", "entry_point": "find_pairs_with_difference", "input": "[0, 1, 1, 2, 2, 3, 4, 5], 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23679_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002688", "code": "def find_most_common_element(lst):\n    element_count = {}\n    for element in lst:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common_element = max(element_count, key=element_count.get)\n    return most_common_element\n", "entry_point": "find_most_common_element", "input": "[5, 5, 5, 3, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14063_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002689", "code": "def create_grayscale_image(pixel_values):\n    num_rows = len(pixel_values) // 2\n    grayscale_image = [pixel_values[i:i+2] for i in range(0, len(pixel_values), 2)]\n    return grayscale_image\n", "entry_point": "create_grayscale_image", "input": "[256, 150, 75, 100, 150, -2, 74]", "output": "[[256, 150], [75, 100], [150, -2], [74]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125826_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002690", "code": "def process_students(students):\n    remaining_students = 0\n    total_grade = 0\n    for student in students:\n        if student[\"age\"] >= 18:\n            remaining_students += 1\n            total_grade += student[\"grade\"]\n    average_grade = total_grade / remaining_students if remaining_students > 0 else 0\n    return remaining_students, average_grade\n", "entry_point": "process_students", "input": "[{'age': 17, 'grade': 90}, {'age': 18, 'grade': 85}]", "output": "(1, 85.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39319_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002691", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[10, 20, 20]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002692", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abcdefg'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28577_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002693", "code": "def get_file_ext_from_url(url: str) -> str:\n    file_name_start = url.rfind('/') + 1\n    file_name_end = url.rfind('?') if '?' in url else len(url)\n    file_name = url[file_name_start:file_name_end]\n    dot_index = file_name.rfind('.')\n    if dot_index != -1:\n        return file_name[dot_index:]\n    else:\n        return ''\n", "entry_point": "get_file_ext_from_url", "input": "'https://example.com/path/'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_292_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002694", "code": "def calculate_fairness(age, capital_gain, capital_loss):\n    N_age = (age - 17.0) / 62.0\n    N_capital_gain = (capital_gain - 0.0) / 22040.0\n    N_capital_loss = (capital_loss - 0.0) / 1258.0\n    t = 0.0006 * N_age + -5.7363 * N_capital_gain + -0.0002 * N_capital_loss + 1.0003\n    if age > 18:\n        t = t + -0.0003\n    if age < 18:\n        t = t - 0.5\n    return t < 0\n", "entry_point": "calculate_fairness", "input": "17, 100000, 0", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3840_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002695", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[5, 5, 15, 2, 6, 4, 6, 2, 15]", "output": "[10, 20, 17, 8, 10, 10, 8, 17, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002696", "code": "def extract_info(openapi_doc):\n    version_start = openapi_doc.find(\"The version of the OpenAPI document:\") + len(\"The version of the OpenAPI document:\")\n    version_end = openapi_doc.find(\"\\n\", version_start)\n    version = openapi_doc[version_start:version_end].strip()\n    contact_start = openapi_doc.find(\"Contact:\") + len(\"Contact:\")\n    contact_end = openapi_doc.find(\">\", contact_start)\n    contact_email = openapi_doc[contact_start + 1:contact_end]\n    return version, contact_email\n", "entry_point": "extract_info", "input": "'The version of the OpenAPI document: \\nContact: '", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30019_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002697", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 9, 20]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2720_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002698", "code": "def parse_query(query: str) -> str:\n    parts = query.split('==')\n    if len(parts) != 2:\n        return \"Invalid query format. Please provide a query in the format 'column == value'.\"\n    column = parts[0].strip()\n    value = parts[1].strip()\n    return f\"SELECT * FROM results WHERE {column} == {value}\"\n", "entry_point": "parse_query", "input": "'colA == value'", "output": "'SELECT * FROM results WHERE colA == value'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002699", "code": "def eval_refi(current_payment, time_left, refi_cost):\n    monthly_savings = current_payment - (refi_cost / time_left)\n    payback_months = refi_cost / monthly_savings\n    overall_savings = (current_payment * time_left) - refi_cost\n    return monthly_savings, payback_months, overall_savings\n", "entry_point": "eval_refi", "input": "1000, 12, 5000", "output": "(583.3333333333333, 8.571428571428573, 7000)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8071", "output": "{1, 1153, 7, 8071}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002701", "code": "def sum_multiples_3_5(nums):\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118142_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002702", "code": "# Constants for data types\nB3_UTF8 = \"UTF8\"\nB3_BOOL = \"BOOL\"\nB3_SVARINT = \"SVARINT\"\nB3_COMPOSITE_DICT = \"COMPOSITE_DICT\"\nB3_COMPOSITE_LIST = \"COMPOSITE_LIST\"\nB3_FLOAT64 = \"FLOAT64\"\ndef detect_data_type(obj):\n    if isinstance(obj, str):\n        return B3_UTF8\n    if obj is True or obj is False:\n        return B3_BOOL\n    if isinstance(obj, int):\n        return B3_SVARINT\n    if isinstance(obj, dict):\n        return B3_COMPOSITE_DICT\n    if isinstance(obj, list):\n        return B3_COMPOSITE_LIST\n    if isinstance(obj, float):\n        return B3_FLOAT64\n    if PY2 and isinstance(obj, long):\n        return B3_SVARINT\n    return \"Unknown\"\n", "entry_point": "detect_data_type", "input": "42", "output": "'SVARINT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49151_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002703", "code": "import os\ndef find_setup_app(dirpath):\n    '''Search dirpath and enclosed directories for Setup.app.\n    Returns the path to the actual executable.'''\n    for (path, _, _) in os.walk(dirpath):\n        if path.endswith(\"Setup.app\"):\n            setup_path = os.path.join(path, \"Contents\", \"MacOS\", \"Setup\")\n            if os.path.exists(setup_path):\n                return setup_path\n    return ''\n", "entry_point": "find_setup_app", "input": "'/path/to/nonexistent/directory'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33054_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002704", "code": "from typing import List\ndef sum_of_evens(lst: List[int]) -> int:\n    sum_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_evens += num\n    return sum_evens\n", "entry_point": "sum_of_evens", "input": "[2, 4, 6, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134018_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7478", "output": "{1, 2, 3739, 7478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002706", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[1, 1]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002707", "code": "import re\ndef count_test_functions(directory_files):\n    total_test_functions = 0\n    for content in directory_files:\n        test_functions = re.findall(r'def test_\\w+\\(\\):', content)\n        total_test_functions += len(test_functions)\n    return total_test_functions\n", "entry_point": "count_test_functions", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46304_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002708", "code": "import re\ndef generate_slug(value):\n    def django_slugify(value):\n        # Placeholder for the default slugify method\n        return re.sub(r'[^a-z0-9-]', '', value.lower().replace(' ', '-'))\n    try:\n        from unidecode import unidecode\n        return re.sub(r'[^a-z0-9-]', '', unidecode(value.lower()))\n    except ImportError:\n        try:\n            from pytils.translit import slugify\n            return re.sub(r'[^a-z0-9-]', '', slugify(value.lower()))\n        except ImportError:\n            return re.sub(r'[^a-z0-9-]', '', django_slugify(value))\n", "entry_point": "generate_slug", "input": "' '", "output": "'-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85241_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002709", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "0", "output": "'Unknown Device'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002710", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9146", "output": "{1, 2, 34, 269, 17, 538, 9146, 4573}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002711", "code": "def credit_card_check(card_number):\n    card_number = card_number.replace(\" \", \"\")  # Remove spaces from the input\n    if not 13 <= len(card_number) <= 19:\n        return False  # Invalid length\n    total_sum = 0\n    is_second_digit = False\n    for digit in reversed(card_number):\n        if not digit.isdigit():\n            return False  # Non-digit character found\n        digit = int(digit)\n        if is_second_digit:\n            digit *= 2\n            if digit > 9:\n                digit -= 9\n        total_sum += digit\n        is_second_digit = not is_second_digit\n    return total_sum % 10 == 0\n", "entry_point": "credit_card_check", "input": "'123a456789'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95106_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002712", "code": "def intToHuman(number):\n    B = 1000*1000*1000\n    M = 1000*1000\n    K = 1000\n    if number >= B:\n        numStr = f\"{number/B:.1f}\" + \"B\"\n    elif number >= M:\n        numStr = f\"{number/M:.1f}\" + \"M\"\n    elif number >= K:\n        numStr = f\"{number/K:.1f}\" + \"K\"\n    else:\n        numStr = str(int(number))\n    return numStr\n", "entry_point": "intToHuman", "input": "2500000", "output": "'2.5M'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61849_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4193", "output": "{1, 4193, 599, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002714", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'Johon'", "output": "('Johon', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002715", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'3.0.0'", "output": "'2.9.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002716", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['15 + 23']", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002717", "code": "from typing import List\ndef count_unique_pairs(arr: List[int], target: int) -> int:\n    seen = set()\n    count = 0\n    for num in arr:\n        complement = target - num\n        if complement in seen:\n            count += 1\n            seen.remove(complement)\n        else:\n            seen.add(num)\n    return count\n", "entry_point": "count_unique_pairs", "input": "[2, 3, 1], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31854_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002718", "code": "def simulate_card_game(N, cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A wins\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "simulate_card_game", "input": "4, [5, 1, 4, 3]", "output": "'Player A wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2279_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002719", "code": "import json\ndef compare_json_objects(json1, json2):\n    try:\n        dict1 = json.loads(json1)\n        dict2 = json.loads(json2)\n        return sorted(dict1.items()) == sorted(dict2.items()) and len(dict1) == len(dict2)\n    except json.JSONDecodeError:\n        return False\n", "entry_point": "compare_json_objects", "input": "'{\"key1\": \"value1\"}', '{\"key2\": \"value2\"'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118849_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002720", "code": "def extract_digits(str_input):\n    final_str = \"\"\n    for char in str_input:\n        if char.isdigit():  # Check if the character is a digit\n            final_str += char\n    return final_str\n", "entry_point": "extract_digits", "input": "'abc123def456'", "output": "'123456'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132906_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002721", "code": "def simplify_string(input_str):\n    simplified_result = \"\"\n    for char in input_str:\n        if char == 'a':\n            continue\n        elif char == 'b':\n            simplified_result += 'z'\n        else:\n            simplified_result += char\n    return simplified_result[::-1]\n", "entry_point": "simplify_string", "input": "'brabr'", "output": "'rzrz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100095_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002722", "code": "from itertools import permutations\ndef unique_word_combinations(message):\n    words = message.split()\n    unique_combinations = set()\n    for perm in permutations(words, 3):\n        unique_combinations.add(' '.join(perm))\n    return list(unique_combinations)\n", "entry_point": "unique_word_combinations", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28704_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002723", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[4, 3, 3, 1, 3, 2, 6, 5, 2]", "output": "[16, 9, 9, 1, 9, 4, 36, 25, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002724", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[8.0, 9.5]", "output": "8.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002725", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[7, 4, 7, 5, 6, 3, 6]", "output": "[7, 4, 5, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002726", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[10, 9, 4, 14, 3, 2, 9]", "output": "[19, 13, 18, 17, 5, 11, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002727", "code": "def generate_bounding_boxes(image_width, image_height):\n    # Define the bounding box coordinates\n    x_min = 0.1 * image_width\n    x_max = 0.9 * image_width\n    y_min = 0.1 * image_height\n    y_max = 0.9 * image_height\n    # Normalize the bounding box coordinates\n    x_min /= image_width\n    x_max /= image_width\n    y_min /= image_height\n    y_max /= image_height\n    return [(x_min, y_min, x_max, y_max)]\n", "entry_point": "generate_bounding_boxes", "input": "1, 1", "output": "[(0.1, 0.1, 0.9, 0.9)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73188_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002728", "code": "def divisible_count(x, y, k):\n    count_y = (k * (y // k + 1) - 1) // k\n    count_x = (k * ((x - 1) // k + 1) - 1) // k\n    return count_y - count_x\n", "entry_point": "divisible_count", "input": "4, 12, 4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144622_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002729", "code": "import re\ndef detect_card(input_str):\n    # Regular expression to match a sequence of 16 digits\n    pattern = r'\\d{16}'\n    # Search for the pattern in the input string\n    match = re.search(pattern, input_str)\n    # Return True if a match is found, indicating credit card information is present\n    return bool(match)\n", "entry_point": "detect_card", "input": "'abcdefgh'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39354_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002730", "code": "def max_sum_non_adjacent(lst):\n    if not lst:\n        return 0\n    include = lst[0]\n    exclude = 0\n    for i in range(1, len(lst)):\n        new_include = lst[i] + exclude\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 5, 9, 4, 8]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30525_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002731", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "781", "output": "{1, 11, 781, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002732", "code": "def find_missing_number(nums):\n    n = len(nums)\n    expected_sum = (n * (n + 1)) // 2\n    actual_sum = sum(nums)\n    if expected_sum != actual_sum:\n        return expected_sum - actual_sum\n    return -1\n", "entry_point": "find_missing_number", "input": "list(range(0, 44))", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115210_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002733", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'ameLoremt,', 10", "output": "'ameLoremt,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002734", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'yt'", "output": "['yt']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002735", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002736", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/some/directory/paxt'", "output": "'paxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002737", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'prefix.lgo  oggger'", "output": "'lgo  oggger'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002738", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[], 5, 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002739", "code": "def encrypt_text(text: str) -> str:\n    encrypted_chars = []\n    for idx, char in enumerate(text):\n        shift_amount = idx % 26\n        encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_text", "input": "'hello'", "output": "'hfnos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24966_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002740", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'sus-eus-1'", "output": "'sus-eus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002741", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "-1", "output": "-0.382", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002742", "code": "def highest_growth_rate_city(population_list):\n    highest_growth_rate = 0\n    city_with_highest_growth = None\n    for i in range(1, len(population_list)):\n        growth_rate = population_list[i] - population_list[i - 1]\n        if growth_rate > highest_growth_rate:\n            highest_growth_rate = growth_rate\n            city_with_highest_growth = f'City{i+1}'\n    return city_with_highest_growth\n", "entry_point": "highest_growth_rate_city", "input": "[100, 102, 104, 106, 120]", "output": "'City5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6843_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002743", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<tag></tag>'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002744", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2950_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002745", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[36, 25, 16, 16, 4]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002746", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_number = 0\n    for num in nums:\n        single_number ^= num\n    return single_number\n", "entry_point": "find_single_number", "input": "[1, 1, 2, 2, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48428_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002747", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[90, 90, 79, 70]", "output": "[90, 90, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002748", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return 0\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence", "input": "[3, 1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79696_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002749", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'SeeS21 Dec 11842Dep'", "output": "'Dec SeeS21, 11842Dep'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002750", "code": "def validate_parentheses(expression):\n    stack = []\n    for char in expression:\n        if char == \"(\":\n            stack.append(\"(\")\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                return \"Invalid expression\"\n    if not stack:\n        return \"Valid expression\"\n    else:\n        return \"Invalid expression\"\n", "entry_point": "validate_parentheses", "input": "')('", "output": "'Invalid expression'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77396_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002751", "code": "def get_phone_number_type(phone_number):\n    metadata = {\n        'Toll-free': ['110', '92'],\n        'Premium rate': ['105', '106'],\n        'Emergency': ['110', '112'],\n        'Short code': ['104', '105', '106', '107', '108', '109', '65', '919', '950', '985', '998'],\n        'Standard rate': ['165', '919', '950', '985', '998']\n    }\n    for type_, patterns in metadata.items():\n        for pattern in patterns:\n            if phone_number.startswith(pattern) and len(phone_number) in (len(pattern), len(pattern) + 1):\n                return type_\n    return 'Unknown'\n", "entry_point": "get_phone_number_type", "input": "'1234'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138923_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002752", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'frequency'", "output": "{'frequency': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002753", "code": "def timecode_to_frames(tc, framerate):\n    components = tc.split(':')\n    hours = int(components[0])\n    minutes = int(components[1])\n    seconds = int(components[2])\n    frames = int(components[3])\n    total_frames = frames + seconds * framerate + minutes * framerate * 60 + hours * framerate * 60 * 60\n    return total_frames\n", "entry_point": "timecode_to_frames", "input": "'00:07:15:00', 30", "output": "13050", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42773_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002754", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[2, 0, 2]", "output": "[2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002755", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7163", "output": "{1, 551, 13, 19, 247, 377, 7163, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002756", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'spaceshttps://wexwit'", "output": "'spaceshttpswexwit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002757", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7211", "output": "{1, 7211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002758", "code": "from typing import Any\ndef is_bool(value: Any) -> bool:\n    return type(value) is bool\n", "entry_point": "is_bool", "input": "True", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31009_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002759", "code": "def subset_sum(items, target, index=0):\n    if target == 0:\n        return True\n    if index >= len(items) or target < 0:\n        return False\n    # Include the current item\n    if subset_sum(items, target - items[index], index + 1):\n        return True\n    # Exclude the current item\n    if subset_sum(items, target, index + 1):\n        return True\n    return False\n", "entry_point": "subset_sum", "input": "[2, 3, 5], 5", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109736_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002760", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[0, 1, 6, 8]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002761", "code": "def longest_consecutive(nums):\n    num_set = set(nums)\n    max_length = 0\n    for num in num_set:\n        if num - 1 not in num_set:\n            current_num = num\n            current_length = 1\n            while current_num + 1 in num_set:\n                current_num += 1\n                current_length += 1\n            max_length = max(max_length, current_length)\n    return max_length\n", "entry_point": "longest_consecutive", "input": "[1, 2, 3, 5, 7]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126647_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002762", "code": "NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION = 0\nNOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION = 1\nNOTIFICATION_REPORTED_AS_FALLACY = 2\nNOTIFICATION_FOLLOWED_A_SPEAKER = 3\nNOTIFICATION_SUPPORTED_A_DECLARATION = 4\nNOTIFICATION_TYPES = (\n    (NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION, \"added-declaration-for-resolution\"),\n    (NOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION, \"added-declaration-for-declaration\"),\n    (NOTIFICATION_REPORTED_AS_FALLACY, \"reported-as-fallacy\"),\n    (NOTIFICATION_FOLLOWED_A_SPEAKER, \"followed\"),\n    (NOTIFICATION_SUPPORTED_A_DECLARATION, \"supported-a-declaration\"),\n)\ndef get_notification_message(notification_type):\n    for notification_tuple in NOTIFICATION_TYPES:\n        if notification_tuple[0] == notification_type:\n            return notification_tuple[1]\n    return \"Notification type not found\"\n", "entry_point": "get_notification_message", "input": "4", "output": "'supported-a-declaration'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86427_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002763", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[3, 2, 2, 0, 0, 4, 3]", "output": "[0, 0, 2, 2, 3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002764", "code": "from typing import List\ndef find_first_duplicate(A: List[int]) -> int:\n    seen = set()\n    for num in A:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55340_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002765", "code": "def apply_sparsity(epoch, initial_epoch, periodicity):\n    if (epoch - initial_epoch) >= 0 and (epoch - initial_epoch) % periodicity == 0:\n        return True\n    else:\n        return False\n", "entry_point": "apply_sparsity", "input": "3, 5, 1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92732_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002766", "code": "import base64\ndef process_content(contents):\n    content_type, content_string = contents.split(',')\n    decoded_content = base64.b64decode(content_string)\n    return decoded_content\n", "entry_point": "process_content", "input": "'text/plain,SG8gV29ybGQh'", "output": "b'Ho World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133360_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002767", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'22.1.121'", "output": "(22, 1, 121)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002768", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7814", "output": "{1, 2, 3907, 7814}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7813", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002769", "code": "def get_projects_to_build(projects):\n    projects_to_build = []\n    for project in projects:\n        for project_name, built_status in project.items():\n            if not built_status:\n                projects_to_build.append(project_name)\n    return projects_to_build\n", "entry_point": "get_projects_to_build", "input": "[{'Project A': True}, {'Project B': True}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25917_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002770", "code": "def sum_of_even_numbers(input_list):\n    even_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_even_numbers", "input": "[6, 6, 6, 6, 6, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7100_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002771", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[10], 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002772", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 93, 92, 85, 85, 70, 60]", "output": "[100, 93, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118412_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002773", "code": "IMAGE_CLASSIFICATION_BENCHMARKS = {\n    'task1': 'Benchmark info for task1 in image classification',\n    'task2': 'Benchmark info for task2 in image classification',\n}\nVISION_BENCHMARKS = {\n    'image_classification': IMAGE_CLASSIFICATION_BENCHMARKS,\n}\nNLP_BENCHMARKS = {\n    'task1': 'Benchmark info for task1 in NLP',\n}\nQAT_BENCHMARKS = {\n    'task1': 'Benchmark info for task1 in QAT',\n}\ndef get_benchmark_info(domain, task_type):\n    if domain in VISION_BENCHMARKS:\n        if task_type in VISION_BENCHMARKS[domain]:\n            return VISION_BENCHMARKS[domain][task_type]\n        else:\n            return \"Benchmark information for the task type is not available.\"\n    elif domain == 'NLP':\n        if task_type in NLP_BENCHMARKS:\n            return NLP_BENCHMARKS[task_type]\n        else:\n            return \"Benchmark information for the task type is not available.\"\n    elif domain == 'QAT':\n        if task_type in QAT_BENCHMARKS:\n            return QAT_BENCHMARKS[task_type]\n        else:\n            return \"Benchmark information for the task type is not available.\"\n    else:\n        return \"Domain not found.\"\n", "entry_point": "get_benchmark_info", "input": "'not_a_valid_domain', 'any_task_type'", "output": "'Domain not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72628_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002774", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if N >= num_students:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[100, 90, 80], 1", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122460_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002775", "code": "def sum_of_even_numbers(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[6, 4, 6]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38312_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002776", "code": "def generate_symmetric_banner(text, gap):\n    total_length = len(text) + gap\n    left_padding = (total_length - len(text)) // 2\n    right_padding = total_length - len(text) - left_padding\n    symmetric_banner = \" \" * left_padding + text + \" \" * right_padding\n    return symmetric_banner\n", "entry_point": "generate_symmetric_banner", "input": "'Hlo, Wor!', 32", "output": "'                Hlo, Wor!                '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92337_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002777", "code": "def get_known_classes(task_num):\n    known_classes = {\n        2: [\"truck\", \"traffic light\", \"fire hydrant\", \"stop sign\", \"parking meter\",\n            \"bench\", \"elephant\", \"bear\", \"zebra\", \"giraffe\",\n            \"backpack\", \"umbrella\", \"handbag\", \"tie\", \"suitcase\",\n            \"microwave\", \"oven\", \"toaster\", \"sink\", \"refrigerator\"],\n        3: [\"truck\", \"traffic light\", \"fire hydrant\", \"stop sign\", \"parking meter\",\n            \"bench\", \"elephant\", \"bear\", \"zebra\", \"giraffe\",\n            \"backpack\", \"umbrella\", \"handbag\", \"tie\", \"suitcase\",\n            \"microwave\", \"oven\", \"toaster\", \"sink\", \"refrigerator\",\n            \"frisbee\", \"skis\", \"snowboard\", \"sports ball\", \"kite\",\n            \"baseball bat\", \"baseball glove\", \"skateboard\", \"surfboard\",\n            \"tennis racket\",\n            \"banana\", \"apple\", \"sandwich\", \"orange\", \"broccoli\",\n            \"carrot\", \"hot dog\", \"pizza\", \"donut\", \"cake\"],\n        4: [\"truck\", \"traffic light\", \"fire hydrant\", \"stop sign\", \"parking meter\",\n            \"bench\", \"elephant\", \"bear\", \"zebra\", \"giraffe\",\n            \"backpack\", \"umbrella\", \"handbag\", \"tie\", \"suitcase\",\n            \"microwave\", \"oven\", \"toaster\", \"sink\", \"refrigerator\",\n            \"frisbee\", \"skis\", \"snowboard\", \"sports ball\", \"kite\",\n            \"baseball bat\", \"baseball glove\", \"skateboard\", \"surfboard\",\n            \"tennis racket\",\n            \"banana\", \"apple\", \"sandwich\", \"orange\", \"broccoli\",\n            \"carrot\", \"hot dog\", \"pizza\", \"donut\", \"cake\",\n            \"bed\", \"toilet\", \"laptop\", \"mouse\",\n            \"remote\", \"keyboard\", \"cell phone\", \"book\", \"clock\",\n            \"vase\", \"scissors\", \"teddy bear\", \"hair drier\", \"toothbrush\",\n            \"wine glass\", \"cup\", \"fork\", \"knife\", \"spoon\", \"bowl\"]\n    }\n    return known_classes.get(task_num, \"Invalid task number\")\n", "entry_point": "get_known_classes", "input": "-1", "output": "'Invalid task number'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57061_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002778", "code": "def password_strength_checker(password):\n    numbers = \"0123456789\"\n    lower_case = \"abcdefghijklmnopqrstuvwxyz\"\n    upper_case = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n    special_characters = \"!@#$%^&*()-+\"\n    miss = 0\n    if any(character in numbers for character in password) == False:\n        miss += 1\n    if any(character in lower_case for character in password) == False:\n        miss += 1\n    if any(character in upper_case for character in password) == False:\n        miss += 1\n    if any(character in special_characters for character in password) == False:\n        miss += 1\n    n = 4 - miss\n    return max(miss, 6 - n)\n", "entry_point": "password_strength_checker", "input": "'password'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96281_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002779", "code": "import re\ndef remove_retweet(tweet):\n    return re.sub(r\"\\brt\\b\", \"\", tweet)\n", "entry_point": "remove_retweet", "input": "'rt'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62869_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002780", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[3, 3, 2, 4, 2, 2, 2, 4]", "output": "[6, 5, 6, 6, 4, 4, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002781", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    return max(nums[-1] * nums[-2] * nums[-3], nums[0] * nums[1] * nums[-1])\n", "entry_point": "max_product_of_three", "input": "[-2, -3, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58627_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5234", "output": "{1, 5234, 2, 2617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002783", "code": "def extract_preamble(doc):\n    if 'preamble' in doc:\n        return doc['preamble']\n    else:\n        return \"Preamble not found in the dictionary.\"\n", "entry_point": "extract_preamble", "input": "{}", "output": "'Preamble not found in the dictionary.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76505_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2659", "output": "{1, 2659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002785", "code": "def polygon_area(vertices):\n    n = len(vertices)\n    area = 0\n    for i in range(n):\n        j = (i + 1) % n\n        area += vertices[i][0] * vertices[j][1]\n        area -= vertices[j][0] * vertices[i][1]\n    area = abs(area) / 2\n    return area\n", "entry_point": "polygon_area", "input": "[(0, 0), (1, 1), (2, 2)]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002786", "code": "from typing import List, Union, Any\ndef count_unique_elements(input_list: List[Union[int, Any]]) -> int:\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_elements", "input": "[1, 2, 2, 3, 'hello', 5.0]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69046_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002787", "code": "def multi_bracket_validation(input_str):\n    stack = []\n    bracket_pairs = {')': '(', ']': '[', '}': '{'}\n    for char in input_str:\n        if char in bracket_pairs.values():\n            stack.append(char)\n        elif char in bracket_pairs.keys():\n            if not stack or bracket_pairs[char] != stack.pop():\n                return False\n    return len(stack) == 0\n", "entry_point": "multi_bracket_validation", "input": "'([)]'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78967_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002788", "code": "def classify_location(beacon1, beacon2, beacon3):\n    signal_sum = beacon1 + beacon2 + beacon3\n    if signal_sum < 10:\n        return 'Location A'\n    elif 10 <= signal_sum <= 20:\n        return 'Location B'\n    else:\n        return 'Location C'\n", "entry_point": "classify_location", "input": "3, 4, 5", "output": "'Location B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78948_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002789", "code": "def validate_card(card_number: str) -> bool:\n    def digits_of(n):\n        return [int(d) for d in str(n)]\n    digits = digits_of(card_number)\n    odd_digits = digits[-1::-2]\n    even_digits = digits[-2::-2]\n    checksum = 0\n    checksum += sum(odd_digits)\n    for d in even_digits:\n        checksum += sum(digits_of(d * 2))\n    return checksum % 10 == 0\n", "entry_point": "validate_card", "input": "'1234567890123457'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73696_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002790", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'I love red apples and blue grapes.'", "output": "'I love green apples and red grapes.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002791", "code": "def count_words(input_string):\n    word_count = 0\n    words_list = input_string.split()\n    for word in words_list:\n        word_count += 1\n    return word_count\n", "entry_point": "count_words", "input": "'hello'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132450_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002792", "code": "def compress_string(s1):\n    newStr = ''\n    char = ''\n    count = 0\n    for i in range(len(s1)):\n        if char != s1[i]:\n            if char != '':  # Add previous character and count to newStr\n                newStr += char + str(count)\n            char = s1[i]\n            count = 1\n        else:\n            count += 1\n    newStr += char + str(count)  # Add last character and count to newStr\n    if len(newStr) > len(s1):\n        return s1\n    return newStr\n", "entry_point": "compress_string", "input": "'abcdabcdee'", "output": "'abcdabcdee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79600_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002793", "code": "def dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        raise ValueError(\"Vectors must be of the same length\")\n    result = 0\n    for i in range(len(vector1)):\n        result += vector1[i] * vector2[i]\n    return result\n", "entry_point": "dot_product", "input": "[5, 5, 5, 5], [3, 3, 3, 3]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105326_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002794", "code": "import math\ndef calculate_sampled_rows(sampling_rate):\n    total_rows = 120000000  # Total number of rows in the dataset (120M records)\n    sampled_rows = math.ceil(total_rows * sampling_rate)\n    # Ensure at least one row is sampled\n    if sampled_rows == 0:\n        sampled_rows = 1\n    return sampled_rows\n", "entry_point": "calculate_sampled_rows", "input": "0.6001", "output": "72012000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18389_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002795", "code": "import collections\ndef can_two_sum(arr, k):\n    nums = collections.defaultdict(int)\n    for (i, num) in enumerate(arr):\n        compliment = k - num\n        if nums.get(compliment) is not None and nums.get(compliment) != i:\n            return True\n        else:\n            nums[num] = i\n    return False\n", "entry_point": "can_two_sum", "input": "[1, 4, 2, 3], 5", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98498_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002796", "code": "import re\ndef extract_libraries(code_snippet):\n    # Regular expression pattern to match imported libraries\n    pattern = r\"import\\s+(\\w+)\"\n    # Find all matches of the pattern in the code snippet\n    matches = re.findall(pattern, code_snippet)\n    # Filter out duplicates and return the unique libraries\n    unique_libraries = list(set(matches))\n    return unique_libraries\n", "entry_point": "extract_libraries", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81931_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002797", "code": "from typing import List\ndef top_k_scores(scores: List[int], k: int) -> List[int]:\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    sorted_scores = sorted(score_freq.keys(), reverse=True)\n    result = []\n    unique_count = 0\n    for score in sorted_scores:\n        if unique_count == k:\n            break\n        result.append(score)\n        unique_count += 1\n    return result\n", "entry_point": "top_k_scores", "input": "[80, 82, 83, 85, 86, 87, 88, 89, 70, 75], 6", "output": "[89, 88, 87, 86, 85, 83]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108959_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002798", "code": "import re\ndef checkMessage(message: str, rString: str) -> bool:\n    result = re.search(r\"\".join(rString), message)\n    if result:\n        span = result.span()\n        return len(message) == (span[1] - span[0])\n    return False\n", "entry_point": "checkMessage", "input": "'b', 'a'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56988_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002799", "code": "def card_war(player1_cards, player2_cards):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        rank1 = card_values[card1]\n        rank2 = card_values[card2]\n        if rank1 > rank2:\n            player1_wins += 1\n        elif rank2 > rank1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_war", "input": "['2', '3', '4'], ['2', '3', '4']", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60689_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002800", "code": "import os\nimport json\ndef process_data(data_path: str) -> list:\n    if os.path.exists(data_path):\n        file_extension = data_path.split('.')[-1]\n        if file_extension == 'txt':\n            with open(data_path, \"r\") as file:\n                return [line.rstrip('\\n') for line in file]\n        elif file_extension == 'json':\n            with open(data_path, \"r\") as file:\n                return json.load(file)\n        else:\n            raise ValueError(\"Unsupported file type. Only text (.txt) and JSON (.json) files are supported.\")\n    else:\n        return []\n", "entry_point": "process_data", "input": "'non_existing_file.txt'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126724_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002801", "code": "def findSubsetsThatSumToK(arr, k):\n    subsets = []\n    def generateSubsets(arr, index, current, current_sum, k, subsets):\n        if current_sum == k:\n            subsets.append(current[:])\n        if index == len(arr) or current_sum >= k:\n            return\n        for i in range(index, len(arr)):\n            current.append(arr[i])\n            generateSubsets(arr, i + 1, current, current_sum + arr[i], k, subsets)\n            current.pop()\n    generateSubsets(arr, 0, [], 0, k, subsets)\n    return subsets\n", "entry_point": "findSubsetsThatSumToK", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127361_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002802", "code": "from typing import List\ndef calculate_median(nums: List[int]) -> float:\n    sorted_list = sorted(nums)\n    med = None\n    if len(sorted_list) % 2 == 0:\n        mid_index_1 = len(sorted_list) // 2\n        mid_index_2 = (len(sorted_list) // 2) - 1\n        med = (sorted_list[mid_index_1] + sorted_list[mid_index_2]) / 2.0\n    else:\n        mid_index = (len(sorted_list) - 1) // 2\n        med = sorted_list[mid_index]\n    return med\n", "entry_point": "calculate_median", "input": "[4, 5, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95589_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002803", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[5, 4, 4, 0, 1, 1]", "output": "{5: 1, 4: 2, 0: 1, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002804", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "249", "output": "{1, 83, 3, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002805", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[10, 15, 10]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9214", "output": "{1, 2, 34, 542, 271, 17, 9214, 4607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9213", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002807", "code": "def extract_field_names(input_string):\n    field_names = []\n    in_field = False\n    current_field = \"\"\n    for char in input_string:\n        if char == '[':\n            in_field = True\n            current_field = \"\"\n        elif char == ']':\n            in_field = False\n            field_names.append(current_field.split(':')[0].strip())\n        elif in_field:\n            current_field += char\n    return field_names\n", "entry_point": "extract_field_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105860_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002808", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[5, 7, 8, 1, 6, 1], 5", "output": "[[5, 7, 8, 1, 6], [1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6463", "output": "{1, 23, 281, 6463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002810", "code": "def calculate_input_dim(env_name, ob_space):\n    def observation_size(space):\n        return len(space)\n    def goal_size(space):\n        return 0  # Assuming goal information size is 0\n    def box_size(space):\n        return 0  # Assuming box size is 0\n    def robot_state_size(space):\n        return len(space)\n    if env_name == 'PusherObstacle-v0':\n        input_dim = observation_size(ob_space) - goal_size(ob_space) - box_size(ob_space)\n    elif 'Sawyer' in env_name:\n        input_dim = robot_state_size(ob_space)\n    else:\n        raise NotImplementedError(\"Input dimension calculation not implemented for this environment\")\n    return input_dim\n", "entry_point": "calculate_input_dim", "input": "'PusherObstacle-v0', [0, 0, 0, 0, 0, 0]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88440_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002811", "code": "import re\nfrom typing import Tuple\ndef parse_revision_id(revision_id: str) -> Tuple[str, str]:\n    pattern = r'^(\\d)([0-9a-fA-F]{12})$'\n    match = re.match(pattern, revision_id)\n    if match:\n        revision_number = match.group(1)\n        hex_string = match.group(2)\n        password = hex_string[:6]\n        key = hex_string[6:]\n        return (password, key)\n    else:\n        return ('', '')\n", "entry_point": "parse_revision_id", "input": "'invalid_revision_id'", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33893_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002812", "code": "def count_unique_divisible(nums, divisor):\n    unique_divisible = set()\n    for num in nums:\n        if num % divisor == 0 and num not in unique_divisible:\n            unique_divisible.add(num)\n    return len(unique_divisible)\n", "entry_point": "count_unique_divisible", "input": "[4, 8, 4], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73209_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5821", "output": "{1, 5821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002814", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[6, 6, 6, 6, 6], 5", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002815", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(0, 1, -1, 1, 0, 0, 4, 0)", "output": "'(0.1.-1.1.0.0.4.0)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002816", "code": "import math\ndef sum_of_factorial_digits(n):\n    factorial_result = math.factorial(n)\n    total = sum(int(digit) for digit in str(factorial_result))\n    return total\n", "entry_point": "sum_of_factorial_digits", "input": "11", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108789_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002817", "code": "def format_mail_settings(mail_settings):\n    formatted_settings = \"\"\n    for key, value in mail_settings.items():\n        formatted_settings += f\"{key.replace('_', ' ').title()}: {value}\\n\"\n    return formatted_settings\n", "entry_point": "format_mail_settings", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9916_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002818", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4156", "output": "{1, 2, 4, 1039, 4156, 2078}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8290", "output": "{1, 8290, 2, 5, 10, 4145, 1658, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8289", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002820", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[7, 7, 6, 5, 7, 6]", "output": "[343, 343, 36, 125, 343, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002821", "code": "import re\ndef filter_song_and_artist(sub_title):\n    # Split the submission title using the hyphen as the delimiter\n    parts = sub_title.split('-')\n    # If the submission title does not contain a hyphen or has more than one hyphen, it is not a valid song submission\n    if len(parts) != 2:\n        return None\n    # Extract the artist and track name, and trim any leading or trailing whitespaces\n    artist = parts[0].strip()\n    track_name = parts[1].strip()\n    return (artist, track_name)\n", "entry_point": "filter_song_and_artist", "input": "'-'", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138461_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002822", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5003", "output": "{1, 5003}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5002", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7494", "output": "{1, 2, 3, 3747, 2498, 7494, 6, 1249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002824", "code": "def first_last6(nums):\n    return nums[0] == 6 or nums[-1] == 6\n", "entry_point": "first_last6", "input": "[6]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103111_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002825", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3462", "output": "{1, 2, 3, 1731, 1154, 3462, 6, 577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3461", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002826", "code": "def count_ways_to_climb_stairs(n: int) -> int:\n    if n <= 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16452_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002827", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[0, 3, 6, 1, 0, 3, 6, 1]", "output": "[0, 3, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1194", "output": "{1, 2, 3, 6, 199, 1194, 398, 597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1193", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002829", "code": "def find_min_temperature(temperatures):\n    min_temp = float('inf')  # Initialize min_temp to a large value\n    for temp in temperatures:\n        if temp < min_temp:\n            min_temp = temp\n    return min_temp\n", "entry_point": "find_min_temperature", "input": "[10, 15, 20]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36490_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "748", "output": "{1, 2, 34, 4, 68, 11, 748, 44, 17, 374, 22, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt747", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002831", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'O-8'", "output": "'O'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002832", "code": "def import_translation(version: tuple, default_config: str) -> str:\n    try:\n        if version[0] >= 4:\n            from django.utils.translation import gettext_lazy as translation_func\n        else:\n            from django.utils.translation import ugettext_lazy as translation_func\n    except ImportError:\n        return \"Translation function not found\"\n    return translation_func.__name__\n", "entry_point": "import_translation", "input": "(3, 2), 'config'", "output": "'Translation function not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83271_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002833", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1682", "output": "{1, 2, 841, 1682, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002834", "code": "def calculate_average(filename: str) -> float:\n    try:\n        with open(filename, 'r') as fh:\n            count = 0\n            total = 0.0\n            for line in fh:\n                if not line.startswith('X-DSPAM-Confidence:'):\n                    continue\n                position = line.find(':')\n                number = float(line[position + 1:])\n                total += number\n                count += 1\n            if count == 0:\n                return 0.0  # Avoid division by zero\n            average = total / count\n            return average\n    except FileNotFoundError:\n        return -1\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return -1\n", "entry_point": "calculate_average", "input": "'non_existent_file.txt'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63117_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002835", "code": "def process_words(word_list):\n    processed_list = []\n    for word in word_list:\n        processed_word = word.strip().lower()\n        processed_list.append(processed_word)\n    return processed_list\n", "entry_point": "process_words", "input": "['  Hello ', 'WORLD  ', '  pYtHon']", "output": "['hello', 'world', 'python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79220_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002836", "code": "def is_vampire_number(x, y):\n    product = x * y\n    if len(str(x) + str(y)) != len(str(product)):\n        return False\n    product_digits = str(product)\n    for digit in str(x) + str(y):\n        if digit in product_digits:\n            product_digits = product_digits.replace(digit, '', 1)  # Remove the digit from the product\n        else:\n            return False\n    return len(product_digits) == 0  # Check if all digits in the product have been matched\n", "entry_point": "is_vampire_number", "input": "21, 6", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82769_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002837", "code": "from typing import List\ndef sum_of_even_numbers(arr: List[int]) -> int:\n    sum_even = 0\n    for num in arr:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[2, 4, 6, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108635_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002838", "code": "def merge_intervals(arr1, arr2):\n    l = min(min(arr1), min(arr2))\n    r = max(max(arr1), max(arr2))\n    return [l, r]\n", "entry_point": "merge_intervals", "input": "[1, 3, 5], [6, 8]", "output": "[1, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98126_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002839", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "-2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002840", "code": "def fibonacci_sum(n):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(n):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87098_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002841", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002842", "code": "from typing import List\ndef sum_divisible_by_3_and_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30, 90]", "output": "135", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80529_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002843", "code": "def top_students(scores, N):\n    avg_scores = {name: sum(scores) / len(scores) for name, scores in scores.items()}\n    sorted_students = sorted(avg_scores.items(), key=lambda x: (-x[1], x[0]))\n    top_students = [student[0] for student in sorted_students[:N]]\n    return top_students\n", "entry_point": "top_students", "input": "{}, 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6911_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002844", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'lhlllo'", "output": "'olllhl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002845", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'Hello, world! Hello world.'", "output": "{'hello': 2, 'world': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002846", "code": "def max_difference(lst):\n    if len(lst) < 2:\n        return 0\n    min_val = lst[0]\n    max_diff = 0\n    for num in lst[1:]:\n        if num < min_val:\n            min_val = num\n        else:\n            max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61667_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002847", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 3, 2, 0, 3, 0, 3, 4]", "output": "[3, 4, 4, 3, 7, 5, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002848", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[5, 5, 2, 1, 1, 4, 5]", "output": "[5, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7442", "output": "{1, 2, 3721, 7442, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002850", "code": "def fibonacci_sum(n):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(n):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "9", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87098_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002851", "code": "from typing import Tuple\nimport importlib\ndef extract_version_info(module: str) -> Tuple[str, str]:\n    try:\n        imported_module = importlib.import_module(module)\n        version = getattr(imported_module, '__version__', '')\n        githash = getattr(imported_module, '__githash__', '')\n    except ImportError:\n        version = ''\n        githash = ''\n    return version, githash\n", "entry_point": "extract_version_info", "input": "'non_existent_module'", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97272_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2855", "output": "{1, 571, 5, 2855}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002853", "code": "def calculate_score(accuracy):\n    if accuracy >= 0.92:\n        score = 10\n    elif accuracy >= 0.9:\n        score = 9\n    elif accuracy >= 0.85:\n        score = 8\n    elif accuracy >= 0.8:\n        score = 7\n    elif accuracy >= 0.75:\n        score = 6\n    elif accuracy >= 0.70:\n        score = 5\n    else:\n        score = 4\n    return score\n", "entry_point": "calculate_score", "input": "0.0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22276_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002854", "code": "def set_pyside_version(nuke_version_major):\n    if nuke_version_major < 10 or nuke_version_major == 11:\n        return 'PySide2'\n    else:\n        return 'PySide'\n", "entry_point": "set_pyside_version", "input": "12", "output": "'PySide'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100498_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002855", "code": "from typing import List\ndef calculate_visible_skyline(building_heights: List[int]) -> int:\n    total_visible_skyline = 0\n    stack = []\n    for height in building_heights:\n        while stack and height > stack[-1]:\n            total_visible_skyline += stack.pop()\n        stack.append(height)\n    total_visible_skyline += sum(stack)\n    return total_visible_skyline\n", "entry_point": "calculate_visible_skyline", "input": "[20, 5, 5]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39592_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002856", "code": "def string_operations(input_string):\n    # Remove leading and trailing whitespace\n    input_string_stripped = input_string.strip()\n    # Extract substrings based on specified criteria\n    substring1 = input_string_stripped[2:6]  # Extract characters from index 2 to 5\n    substring2 = input_string_stripped[:3]   # Extract first 3 characters\n    substring3 = input_string_stripped[-3:]  # Extract last 3 characters\n    substring4 = input_string_stripped[-3]   # Extract character at index -3\n    return (substring1, substring2, substring3, substring4)\n", "entry_point": "string_operations", "input": "' programming '", "output": "('ogra', 'pro', 'ing', 'i')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53707_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002857", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_evens", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26745_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002858", "code": "import importlib\ndef extract_version(module_name):\n    try:\n        module = importlib.import_module(module_name)\n        version = getattr(module, '__version__', 'Version not found')\n        return str(version)\n    except ModuleNotFoundError:\n        return 'Module not found'\n", "entry_point": "extract_version", "input": "'this_module_does_not_exist'", "output": "'Module not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12029_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002859", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[10, 5, 3]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002860", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'httpht.ope'", "output": "'xmlns:__NAMESPACE__=\"httpht.ope\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002861", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[4, -2, -2, 3, 4, 5, 4, 3, 0]", "output": "[4, -1, 0, 6, 8, 10, 10, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002862", "code": "def count_unique_numbers(numbers):\n    num_count = {}\n    # Count the occurrences of each number\n    for num in numbers:\n        num_count[num] = num_count.get(num, 0) + 1\n    unique_count = 0\n    # Count the unique numbers\n    for count in num_count.values():\n        if count == 1:\n            unique_count += 1\n    return unique_count\n", "entry_point": "count_unique_numbers", "input": "[2, 2, 3, 3, 5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40287_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002863", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[2, 6, 1, 7, 2, 6]", "output": "[1, 2, 2, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002864", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[5, 5, 3, 6, 1, 4, 0]", "output": "{5: 2, 3: 1, 6: 1, 1: 1, 4: 1, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002865", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5051", "output": "{1, 5051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5308", "output": "{1, 2, 4, 1327, 5308, 2654}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5307", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002867", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[4, 6]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115918_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002868", "code": "import sys\nledmap = {\n    'n': 'NUMLOCK',\n    'c': 'CAPSLOCK',\n    's': 'SCROLLLOCK',\n}\ndef convert_led_states(led_states):\n    key_presses = []\n    for led_state in led_states:\n        if led_state in ledmap:\n            key_presses.append(ledmap[led_state])\n        else:\n            return f'Unknown LED state: \"{led_state}\". Use one of \"{\"\".join(ledmap.keys())}\".'\n    return key_presses\n", "entry_point": "convert_led_states", "input": "['n', 'c', 's']", "output": "['NUMLOCK', 'CAPSLOCK', 'SCROLLLOCK']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42654_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002869", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 7, 11]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48394_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002870", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[80, 75, 72, 60, 45], 3", "output": "75.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132005_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002871", "code": "import re\ndef extract_pattern(input_text):\n    match = re.search(r'\\w+\\s*no\\s*', input_text)\n    if match:\n        return match.group()\n    else:\n        return \"\"\n", "entry_point": "extract_pattern", "input": "'yes'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90966_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002872", "code": "def count_even_numbers(numbers):\n    count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            count += 1\n    return count\n", "entry_point": "count_even_numbers", "input": "[0, 2, 4, 1, 3, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144048_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002873", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4402", "output": "{1, 2, 71, 142, 4402, 2201, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002874", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9722", "output": "{1, 9722, 2, 4861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9721", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002875", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6725", "output": "{1345, 1, 5, 6725, 269, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6724", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2407", "output": "{1, 83, 29, 2407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002877", "code": "import re\ndef decode_entities(xml_string):\n    def replace_entity(match):\n        entity = match.group(0)\n        if entity == '&amp;':\n            return '&'\n        # Add more entity replacements as needed\n        return entity\n    return re.sub(r'&\\w+;', replace_entity, xml_string)\n", "entry_point": "decode_entities", "input": "'<pxx>Souff<x</x>>'", "output": "'<pxx>Souff<x</x>>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69392_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002878", "code": "def max_difference(lst):\n    min_val = float('inf')\n    max_diff = 0\n    for num in lst:\n        min_val = min(min_val, num)\n        max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61803_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002879", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002880", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'JonJn', 5", "output": "'JonJn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002881", "code": "def sum_multiples(nums):\n    total_sum = 0\n    for num in nums:\n        if num > 0 and (num % 3 == 0 or num % 5 == 0):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 9, 12]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132311_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002882", "code": "# Dictionary mapping hexadecimal constants to their meanings\nconstants_dict = {\n    0x1F: 'INVALID_IO',\n    0x20: 'INVALID_ESC_CHAR',\n    0x23: 'INVALID_VAR_NAME_TOO_LONG',\n    0x65: 'EVENT_TOUCH_HEAD',\n    0x66: 'CURRENT_PAGE_ID_HEAD',\n    0x67: 'EVENT_POSITION_HEAD',\n    0x68: 'EVENT_SLEEP_POSITION_HEAD',\n    0x70: 'STRING_HEAD',\n    0x71: 'NUMBER_HEAD',\n    0x86: 'EVENT_ENTER_SLEEP_MODE',\n    0x87: 'EVENT_ENTER_WAKE_UP_MODE',\n    0x88: 'EVENT_LAUNCHED',\n    0x89: 'EVENT_UPGRADED',\n    0xFD: 'EVENT_DATA_TR_FINISHED',\n    0xFE: 'EVENT_DATA_TR_READY'\n}\ndef decode_hex(hex_value):\n    decimal_value = int(hex_value, 16)\n    return constants_dict.get(decimal_value, 'Unknown')\n", "entry_point": "decode_hex", "input": "'99'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78460_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002883", "code": "def handle_translation_error(error_type):\n    error_messages = {\n        \"DetectionError\": \"Error detecting the language of the input text.\",\n        \"DetectionNotSupportedError\": \"Language detection is not supported for this engine.\",\n        \"TranslationError\": \"Error performing or parsing the translation.\",\n        \"EngineApiError\": \"An error reported by the translation service API.\",\n        \"UnsupportedLanguagePairError\": \"The specified language pair is not supported for translation.\",\n        \"InvalidISO6391CodeError\": \"Invalid ISO-639-1 language code provided.\",\n        \"AlignmentNotSupportedError\": \"Alignment is not supported for this language combination.\"\n    }\n    return error_messages.get(error_type, \"Unknown translation error\")\n", "entry_point": "handle_translation_error", "input": "'DetectionError'", "output": "'Error detecting the language of the input text.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48630_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002884", "code": "def max_sum_from_grid(grid):\n    max_row_values = [max(row) for row in grid]\n    return sum(max_row_values)\n", "entry_point": "max_sum_from_grid", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41541_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002885", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[3, 2, 2, 1, 3, 1, 9, 1, 2]", "output": "[3, 3, 4, 4, 7, 6, 15, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3263", "output": "{1, 251, 13, 3263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002887", "code": "def rock_paper_scissors(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"Tie\"\n    elif (player1_choice == \"rock\" and player2_choice == \"scissors\") or \\\n         (player1_choice == \"scissors\" and player2_choice == \"paper\") or \\\n         (player1_choice == \"paper\" and player2_choice == \"rock\"):\n        return \"Player 1\"\n    else:\n        return \"Player 2\"\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'paper'", "output": "'Player 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002888", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "[16, 255, 15]", "output": "'#10FF0F'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6731", "output": "{1, 6731, 53, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002890", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'1 + 2'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002891", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3117", "output": "{1, 3, 3117, 1039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002892", "code": "def count_unique_divisible(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0 and num not in unique_divisible_numbers:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible", "input": "[3, 6, 9, 12, 15], 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121992_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002893", "code": "def move_player(movements):\n    player_position = [0, 0]\n    winning_position = [3, 4]\n    for move in movements:\n        if move == 'U' and player_position[1] < 4:\n            player_position[1] += 1\n        elif move == 'D' and player_position[1] > 0:\n            player_position[1] -= 1\n        elif move == 'L' and player_position[0] > 0:\n            player_position[0] -= 1\n        elif move == 'R' and player_position[0] < 3:\n            player_position[0] += 1\n        if player_position == winning_position:\n            print(\"Congratulations, you won!\")\n            break\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "'U'", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49262_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002894", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    # Sort the dictionary by values in descending order\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "word_frequency", "input": "'worldpython'", "output": "{'worldpython': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86121_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002895", "code": "from typing import List\ndef calculate_accuracy(test_results: List[int]) -> float:\n    num_reads = 0\n    num_correct = 0\n    for result in test_results:\n        num_reads += 1\n        if result == 1:\n            num_correct += 1\n    if num_reads == 0:\n        return 0.0\n    else:\n        return (num_correct / num_reads) * 100\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 1, 0, 0, 0, 0, 0]", "output": "37.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10794_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002896", "code": "def check_solution_stack(solution_stack):\n    for i in range(1, len(solution_stack)):\n        if solution_stack[i] <= solution_stack[i - 1]:\n            return False\n    return True\n", "entry_point": "check_solution_stack", "input": "[3, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48449_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002897", "code": "from urllib.parse import urlparse\n_VALID_URLS = {\"http\", \"https\", \"ftp\"}\ndef check_valid_protocol(url):\n    try:\n        scheme = urlparse(url).scheme\n        return scheme in _VALID_URLS\n    except:\n        return False\n", "entry_point": "check_valid_protocol", "input": "''", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68314_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002898", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71615_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002899", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9616", "output": "{1, 2, 4, 2404, 4808, 8, 9616, 16, 1202, 601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9615", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002900", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[10, [15, 5], [11]]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002901", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2747", "output": "{1, 67, 2747, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6098", "output": "{1, 6098, 2, 3049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002903", "code": "def find_operator(a, b, c):\n    operators = ['+', '-', '*', '/']\n    for op in operators:\n        if op == '+':\n            if a + b == c:\n                return True\n        elif op == '-':\n            if a - b == c:\n                return True\n        elif op == '*':\n            if a * b == c:\n                return True\n        elif op == '/':\n            if b != 0 and a / b == c:\n                return True\n    return False\n", "entry_point": "find_operator", "input": "1, 2, 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130763_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002904", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'3.9.9'", "output": "'4.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002905", "code": "def count_mandatory_questions(questions):\n    mandatory_count = 0\n    for question in questions:\n        if question.get('mandatory', False):\n            mandatory_count += 1\n    return mandatory_count\n", "entry_point": "count_mandatory_questions", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107681_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6544", "output": "{1, 2, 4, 1636, 3272, 8, 6544, 16, 818, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6543", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002907", "code": "from typing import Dict\ndef extract_smb_info(result: str) -> Dict[str, str]:\n    smb_info = {}\n    lines = result.split('\\n')\n    start_processing = False\n    for line in lines:\n        if start_processing:\n            parts = line.split()\n            if len(parts) >= 2:\n                share_name = parts[0]\n                share_type = parts[1]\n                smb_info[share_name] = share_type\n        elif \"Sharename\" in line:\n            start_processing = True\n    return smb_info\n", "entry_point": "extract_smb_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17218_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002908", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1905", "output": "{1, 3, 5, 15, 1905, 635, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002909", "code": "def sum_of_squares_even(numbers):\n    sum_even_squares = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_squares_even", "input": "[6, 8]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21139_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002910", "code": "def compute_min_refills(distance, tank, stops):\n    stops = [0] + stops + [distance]\n    n = len(stops) - 1\n    refills = 0\n    current_refill = 0\n    while current_refill < n:\n        last_refill = current_refill\n        while current_refill < n and stops[current_refill + 1] - stops[last_refill] <= tank:\n            current_refill += 1\n        if current_refill == last_refill:\n            return -1\n        if current_refill < n:\n            refills += 1\n    return refills\n", "entry_point": "compute_min_refills", "input": "500, 200, [200, 400]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52394_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002911", "code": "def get_file_extension(file_path):\n    # Find the last occurrence of the period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring starting from the last period to the end of the file path\n    if last_period_index != -1:  # Check if a period was found\n        file_extension = file_path[last_period_index:]\n        return file_extension\n    else:\n        return \"\"  # Return an empty string if no period was found\n", "entry_point": "get_file_extension", "input": "'filename'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141157_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002912", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2774", "output": "{1, 2, 38, 73, 1387, 146, 19, 2774}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2773", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002913", "code": "def find_sections(keyPoints):\n    active = False\n    actSec = {0: False, 1: False}\n    X = None\n    secs = []\n    for k, i in keyPoints:\n        actSec[i] = not actSec[i]\n        if actSec[0] and not actSec[1]:\n            X = k\n            active = True\n        elif active and X is not None and (not actSec[0] or actSec[1]):\n            if len(secs) > 0 and secs[-1][1] == X:\n                secs[-1] = (secs[-1][0], k)\n            else:\n                secs.append((X, k))\n            active = False\n    secs = [(a, b) for a, b in secs if a != b]\n    return secs\n", "entry_point": "find_sections", "input": "[(1, 0), (2, 0)]", "output": "[(1, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89316_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002914", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'hello', 3", "output": "'khoor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002915", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[6, 4, 1, 5, 2, 1, 6]", "output": "[1, 1, 2, 4, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002916", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'evveehh'", "output": "'evveehh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002917", "code": "from typing import Tuple\ndef extract_info_from_comment(comment: str) -> Tuple[str, str]:\n    name_start = comment.find(\"UNSW Testing -\") + len(\"UNSW Testing -\")\n    name_end = comment.find(\">\", name_start)\n    name = comment[name_start:name_end]\n    date_start = comment.find(\"Copyright\") + len(\"Copyright\") + 1\n    date_end = comment.find(\"UNSW Testing -\", date_start)\n    date = comment[date_start:date_end].strip()\n    return name, date\n", "entry_point": "extract_info_from_comment", "input": "''", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145796_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002918", "code": "def berge_dominance(set_a, set_b):\n    for b_element in set_b:\n        if not any(a_element >= b_element for a_element in set_a):\n            return False\n    return True\n", "entry_point": "berge_dominance", "input": "[3, 4], [2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7140_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002919", "code": "import os\nimport logging\n# Configure the logger\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\ndef extract_data(service, data_file):\n    logger.info(f\"Extracting data for {service} from {data_file}..\")\n    if not os.path.exists(data_file):\n        logger.error(f\"'{service}' data file not found\")\n        return (\"\", \"\")\n    if service not in [\"youtube\", \"netflix\"]:\n        logger.error(\n            f\"Incorrect service name. Expecting 'youtube' or 'netflix', provided {service}\"\n        )\n        return (\"\", \"\")\n    return (service, data_file)\n", "entry_point": "extract_data", "input": "'hulu', 'somefile.txt'", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142332_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002920", "code": "def process_doxygen_input(doxygen_input):\n    if not isinstance(doxygen_input, str):\n        return \"Error: the `doxygen_input` variable must be of type `str`.\"\n    doxyfile = doxygen_input == \"Doxyfile\"\n    return doxyfile\n", "entry_point": "process_doxygen_input", "input": "'File'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55873_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002921", "code": "def generate_indented_list(n):\n    output = \"\"\n    for i in range(1, n + 1):\n        indent = \"    \" * (i - 1)  # Generate the appropriate level of indentation\n        output += f\"{i}. {indent}Item {i}\\n\"\n    return output\n", "entry_point": "generate_indented_list", "input": "2", "output": "'1. Item 1\\n2.     Item 2\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95960_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002922", "code": "def categorize_fault_type(fault_type):\n    keyword_to_category = {\n        'keypair': 'KeyPair',\n        'publickey': 'PublicKey',\n        'privatekey': 'PrivateKey',\n        'helm-release': 'Helm Release',\n        'install': 'Installation',\n        'delete': 'Deletion',\n        'pod-status': 'Pod Status',\n        'kubernetes-cluster': 'Kubernetes',\n        'connection': 'Connection',\n        'helm-not-updated': 'Helm Version',\n        'helm-version-check': 'Helm Version Check',\n        'helm-not-installed': 'Helm Installation',\n        'check-helm-installed': 'Helm Installation Check',\n        'helm-registry-path-fetch': 'Helm Registry Path',\n        'helm-chart-pull': 'Helm Chart Pull',\n        'helm-chart-export': 'Helm Chart Export',\n        'kubernetes-get-version': 'Kubernetes Version'\n    }\n    categories = []\n    for keyword, category in keyword_to_category.items():\n        if keyword in fault_type:\n            categories.append(category)\n    return categories\n", "entry_point": "categorize_fault_type", "input": "'install'", "output": "['Installation']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138910_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002923", "code": "def moving_average(nums, k):\n    if k <= 0:\n        raise ValueError(\"k should be a positive integer\")\n    if k > len(nums):\n        return []\n    averages = []\n    window_sum = sum(nums[:k])\n    averages.append(window_sum / k)\n    for i in range(k, len(nums)):\n        window_sum = window_sum - nums[i - k] + nums[i]\n        averages.append(window_sum / k)\n    return averages\n", "entry_point": "moving_average", "input": "[], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117361_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002924", "code": "def encrypt_string(input_string):\n    encrypted_result = \"\"\n    for i, char in enumerate(input_string):\n        if char.isalpha():\n            shift_amount = i + 1\n            if char.islower():\n                encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n            else:\n                encrypted_char = chr((ord(char) - ord('A') + shift_amount) % 26 + ord('A'))\n        else:\n            encrypted_char = char\n        encrypted_result += encrypted_char\n    return encrypted_result\n", "entry_point": "encrypt_string", "input": "'Hello,'", "output": "'Igopt,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110857_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002925", "code": "def count_uppercase_letters(input_string):\n    uppercase_count = 0\n    for char in input_string:\n        if char.isupper():\n            uppercase_count += 1\n    return uppercase_count\n", "entry_point": "count_uppercase_letters", "input": "'HeLlo'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13975_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002926", "code": "def evaluate_expression(expression: str) -> int:\n    def evaluate_helper(tokens):\n        stack = []\n        for token in tokens:\n            if token == '(':\n                stack.append('(')\n            elif token == ')':\n                sub_expr = []\n                while stack[-1] != '(':\n                    sub_expr.insert(0, stack.pop())\n                stack.pop()  # Remove '('\n                stack.append(evaluate_stack(sub_expr))\n            else:\n                stack.append(token)\n        return evaluate_stack(stack)\n    def evaluate_stack(stack):\n        operators = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y}\n        res = int(stack.pop(0))\n        while stack:\n            operator = stack.pop(0)\n            operand = int(stack.pop(0))\n            res = operators[operator](res, operand)\n        return res\n    tokens = expression.replace('(', ' ( ').replace(')', ' ) ').split()\n    return evaluate_helper(tokens)\n", "entry_point": "evaluate_expression", "input": "'(10 + 12)'", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122820_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8053", "output": "{1, 8053}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002928", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'230x6230x6bcdefcf'", "output": "{'bytecode': '0x230x6230x6bcdefcf'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002929", "code": "import math\ndef is_prime_alternative(n):\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    max_divisor = math.isqrt(n) + 1\n    for i in range(3, max_divisor, 2):\n        if n % i == 0:\n            return False\n    return True\n", "entry_point": "is_prime_alternative", "input": "3", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92862_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002930", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'o!'", "output": "{'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002931", "code": "def evaluate_expressions(expressions):\n    results = []\n    for expression in expressions:\n        result = eval(expression)\n        results.append(result)\n    return results\n", "entry_point": "evaluate_expressions", "input": "['2 + 3', '4 * 3', '7 * 3', '2 * 2', '1 + 1']", "output": "[5, 12, 21, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56248_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002932", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'abcdefgh', 'abcdefgh'", "output": "(0, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002933", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[1, 2, 3, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96122_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002934", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "659", "output": "{1, 659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002935", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1771", "output": "{1, 161, 7, 11, 1771, 77, 23, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002936", "code": "def elementwise_multiply(list1, list2):\n    if len(list1) != len(list2):\n        return []\n    result = []\n    for i in range(len(list1)):\n        result.append(list1[i] * list2[i])\n    return result\n", "entry_point": "elementwise_multiply", "input": "[0, 2, 3, 3, 1, 2], [1, 3, 4, 3, 5, 3]", "output": "[0, 6, 12, 9, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118879_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002937", "code": "def find_first_exceeded_day(tweet_counts):\n    for day, count in enumerate(tweet_counts):\n        if count > 200:\n            return day\n    return -1\n", "entry_point": "find_first_exceeded_day", "input": "[200, 150, 180, 199, 201]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137540_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002938", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[0, 1, 4, 0, 6, 6, 0, 7]", "output": "[0, 0, 0, 1, 4, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002939", "code": "import re\nfrom collections import Counter\ndef most_common_word(s: str) -> str:\n    # Preprocess the input string\n    s = re.sub(r'[^\\w\\s]', '', s.lower())\n    # Split the string into words\n    words = s.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Find the most common word\n    most_common = max(word_freq, key=word_freq.get)\n    return most_common\n", "entry_point": "most_common_word", "input": "'helloo helloo helloo hi hey'", "output": "'helloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23655_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002940", "code": "def parse_arguments(arguments):\n    parsed_args = {}\n    i = 0\n    while i < len(arguments):\n        if arguments[i].startswith('-'):\n            flag = arguments[i]\n            if i + 1 < len(arguments) and not arguments[i + 1].startswith('-'):\n                parsed_args[flag] = arguments[i + 1]\n                i += 1\n            else:\n                parsed_args[flag] = True\n        i += 1\n    return parsed_args\n", "entry_point": "parse_arguments", "input": "['-b', 'a']", "output": "{'-b': 'a'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40725_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002941", "code": "from typing import List\ndef calculate_total_characters(strings: List[str]) -> int:\n    total_chars = 0\n    concatenated_string = \"\"\n    for string in strings:\n        total_chars += len(string)\n        concatenated_string += string\n    total_chars += len(concatenated_string)\n    return total_chars\n", "entry_point": "calculate_total_characters", "input": "['hello', 'world', 'a']", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56126_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002942", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level1': 1000}", "output": "1000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002943", "code": "from typing import List\ndef calculate_average_grade(grades: List[float]) -> float:\n    if len(grades) > 1:\n        grades.remove(min(grades))\n    return sum(grades) / len(grades)\n", "entry_point": "calculate_average_grade", "input": "[80, 80, 80, 60]", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3885_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002944", "code": "from typing import List\ndef min_items_to_buy(prices: List[int], budget: float) -> int:\n    prices.sort()  # Sort prices in ascending order\n    items_count = 0\n    for price in prices:\n        budget -= price\n        items_count += 1\n        if budget <= 0:\n            break\n    return items_count\n", "entry_point": "min_items_to_buy", "input": "[2, 3, 1, 4, 5], 10.0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139036_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002945", "code": "def get_parent_directory(file_path):\n    parent_dir = ''\n    for char in file_path[::-1]:\n        if char in ('/', '\\\\'):\n            break\n        parent_dir = char + parent_dir\n    return parent_dir\n", "entry_point": "get_parent_directory", "input": "'C:/Documents/file.txt'", "output": "'file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48400_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002946", "code": "def fill_characters(n, positions, s):\n    ans = [''] * n\n    for i, pos in enumerate(positions):\n        ans[pos - 1] += s[i % len(s)]\n    return ''.join(ans)\n", "entry_point": "fill_characters", "input": "9, [1, 1, 1, 1, 1, 1, 1, 1, 1], 'a'", "output": "'aaaaaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84635_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002947", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3967", "output": "{1, 3967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002948", "code": "def repeat(character: str, counter: int) -> str:\n    \"\"\"Repeat returns character repeated `counter` times.\"\"\"\n    word = \"\"\n    for _ in range(counter):\n        word += character\n    return word\n", "entry_point": "repeat", "input": "'a', 20", "output": "'aaaaaaaaaaaaaaaaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60016_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002949", "code": "def longest_consecutive_primes(primes, n):\n    prime = [False, False] + [True] * (n - 1)\n    for i in range(2, int(n**0.5) + 1):\n        if prime[i]:\n            for j in range(i*i, n+1, i):\n                prime[j] = False\n    count = 0\n    ans = 0\n    for index, elem in enumerate(primes):\n        total_sum = 0\n        temp_count = 0\n        for i in range(index, len(primes)):\n            total_sum += primes[i]\n            temp_count += 1\n            if total_sum > n:\n                break\n            if prime[total_sum]:\n                if temp_count > count or (temp_count == count and primes[index] < ans):\n                    ans = total_sum\n                    count = temp_count\n    return ans, count\n", "entry_point": "longest_consecutive_primes", "input": "[2, 3, 5, 19], 29", "output": "(29, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91133_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002950", "code": "def can_reach_target(grid, k):\n    m = len(grid)\n    n = len(grid[0])\n    def dfs(x, y, curr_sum):\n        if x == m - 1 and y == n - 1:\n            return curr_sum % k == 0\n        if x < m - 1 and dfs(x + 1, y, curr_sum + grid[x + 1][y]):\n            return True\n        if y < n - 1 and dfs(x, y + 1, curr_sum + grid[x][y + 1]):\n            return True\n        return False\n    return dfs(0, 0, grid[0][0])\n", "entry_point": "can_reach_target", "input": "[[1, 2], [2, 3]], 2", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16219_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002951", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[10, 5], [0, 0]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002952", "code": "from typing import List\ndef check_large_family(households: List[int]) -> bool:\n    for members in households:\n        if members > 5:\n            return True\n    return False\n", "entry_point": "check_large_family", "input": "[1, 2, 3, 4, 5]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68608_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9815", "output": "{1, 65, 5, 1963, 13, 755, 9815, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002954", "code": "def calculate_numeric_sum(data):\n    total_sum = 0\n    for value in data.values():\n        if isinstance(value, (int, float)):\n            total_sum += value\n        elif isinstance(value, dict):\n            total_sum += calculate_numeric_sum(value)\n        elif isinstance(value, list):\n            for item in value:\n                if isinstance(item, dict):\n                    total_sum += calculate_numeric_sum(item)\n    return total_sum\n", "entry_point": "calculate_numeric_sum", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77395_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002955", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[5, 0, 1, 4, 5, 2, 3]", "output": "[5, 5, 6, 10, 15, 17, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002956", "code": "def find_median(arr):\n    arr.sort()\n    n = len(arr)\n    if n % 2 == 1:\n        return arr[n // 2]\n    else:\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (arr[mid_left] + arr[mid_right]) / 2\n", "entry_point": "find_median", "input": "[1, 2, 3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141135_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002957", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[4, 7, 8, 7, 11, 10, 7, 9], 6", "output": "[4, 1, 2, 1, 5, 4, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002958", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'C:\\\\Users\\\\John\\\\Documents'", "output": "'C:/Users/John/Documents'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002959", "code": "# Constants\n_ACCELERATION_VALUE = 1\n_INDICATOR_SIZE = 8\n_ANIMATION_SEQUENCE = ['-', '\\\\', '|', '/']\ndef _get_busy_animation_part(index):\n    return _ANIMATION_SEQUENCE[index % len(_ANIMATION_SEQUENCE)]\n", "entry_point": "_get_busy_animation_part", "input": "3", "output": "'/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97851_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002960", "code": "def find_unique_pairs(lst, target):\n    unique_pairs = set()\n    complements = set()\n    for num in lst:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29529_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002961", "code": "def factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "5", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149792_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002962", "code": "def calculate_fairness(age, capital_gain, capital_loss):\n    N_age = (age - 17.0) / 62.0\n    N_capital_gain = (capital_gain - 0.0) / 22040.0\n    N_capital_loss = (capital_loss - 0.0) / 1258.0\n    t = 0.0006 * N_age + -5.7363 * N_capital_gain + -0.0002 * N_capital_loss + 1.0003\n    if age > 18:\n        t = t + -0.0003\n    if age < 18:\n        t = t - 0.5\n    return t < 0\n", "entry_point": "calculate_fairness", "input": "18, 0, 0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3840_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002963", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "118", "output": "'ossg.default.118'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002964", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/'", "output": "'/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002965", "code": "# Step 1: Create a dictionary to store the mappings\ncommand_mapping = {\n    'PERMISSIONS': 'Permissions',\n    'permissions': 'Permissions',\n    'Permissions': 'Permissions'\n}\n# Step 3: Implement the get_command function\ndef get_command(command_name):\n    return command_mapping.get(command_name, 'Command not found')\n", "entry_point": "get_command", "input": "'InvalidCommand'", "output": "'Command not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62413_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002966", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(8, 9, 1, 9, 9, 9, 1, 1, 9)", "output": "'8.9.1.9.9.9.1.1.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002967", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[81, 85, 84, 83, 87, 84, 82, 88, 81]", "output": "83.88888888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5463_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002968", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[3, 2, 5, 3, 2, 1, 3, 5]", "output": "[5, 7, 8, 5, 3, 4, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002969", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3073", "output": "{1, 439, 3073, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002970", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "18.0, 10.0", "output": "18.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002971", "code": "from typing import List\nfrom collections import deque\ndef shortest_distances(N: int, R: List[List[int]]) -> List[int]:\n    D = [-1] * N\n    D[0] = 0\n    queue = deque([0])\n    while queue:\n        nxt = queue.popleft()\n        for i in R[nxt]:\n            if D[i] == -1:\n                queue.append(i)\n                D[i] = D[nxt] + 1\n    return D\n", "entry_point": "shortest_distances", "input": "11, [[] for _ in range(11)]", "output": "[0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61964_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002972", "code": "def calculate_atomic_mass(compound_elements, atomic_masses):\n    total_atomic_mass = 0\n    for element, quantity in compound_elements.items():\n        total_atomic_mass += quantity * atomic_masses.get(element, 0)\n    return total_atomic_mass\n", "entry_point": "calculate_atomic_mass", "input": "{}, {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112037_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8877", "output": "{1, 33, 3, 807, 11, 8877, 269, 2959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002974", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "5, 5", "output": "7.0710678118654755", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002975", "code": "LOG_MESSAGES = {\n    \"sn.user.signup\": \"User signed up\",\n    \"sn.user.auth.challenge\": \"Authentication challenge initiated\",\n    \"sn.user.auth.challenge.success\": \"Authentication challenge succeeded\",\n    \"sn.user.auth.challenge.failure\": \"Authentication challenge failed\",\n    \"sn.user.2fa.disable\": \"Two-factor authentication disabled\",\n    \"sn.user.email.update\": \"Email updated\",\n    \"sn.user.password.reset\": \"Password reset initiated\",\n    \"sn.user.password.reset.success\": \"Password reset succeeded\",\n    \"sn.user.password.reset.failure\": \"Password reset failed\",\n    \"sn.user.invite\": \"User invited\",\n    \"sn.user.role.update\": \"User role updated\",\n    \"sn.user.profile.update\": \"User profile updated\",\n    \"sn.user.page.view\": \"User page viewed\",\n    \"sn.verify\": \"Verification initiated\"\n}\ndef get_log_message(log_event_type):\n    return LOG_MESSAGES.get(log_event_type, \"Unknown log event type\")\n", "entry_point": "get_log_message", "input": "'invalid.event.type'", "output": "'Unknown log event type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88021_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002976", "code": "from typing import List\nimport heapq\ndef reconstruct_sequence(freq_list: List[int]) -> List[int]:\n    pq = []\n    for i, freq in enumerate(freq_list):\n        heapq.heappush(pq, (freq, i+1))\n    result = []\n    while pq:\n        freq, elem = heapq.heappop(pq)\n        result.append(elem)\n        freq -= 1\n        if freq > 0:\n            heapq.heappush(pq, (freq, elem))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[2, 4, 1, 2]", "output": "[3, 1, 1, 4, 4, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41932_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002977", "code": "def is_indexable_but_not_string(obj: object) -> bool:\n    return not hasattr(obj, \"strip\") and hasattr(obj, \"__iter__\") and not isinstance(obj, str)\n", "entry_point": "is_indexable_but_not_string", "input": "[1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65419_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002978", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'CCO'", "output": "'CCO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002979", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'fbffoor'", "output": "'fbffoor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002980", "code": "def sum_multiples_of_3_or_5(numbers):\n    multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples.add(num)\n    return sum(multiples)\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[5, 15]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81475_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002981", "code": "import re\ndef extract_version(file_content):\n    version_pattern = re.compile(r'from \\.(\\w+) import __version__')\n    version_number = \"Version not found\"\n    for line in file_content.split('\\n'):\n        match = version_pattern.search(line)\n        if match:\n            module_name = match.group(1)\n            module_path = f\"{module_name}.py\"\n            try:\n                module = __import__(module_path, fromlist=['__version__'])\n                version_number = getattr(module, '__version__')\n            except (ImportError, AttributeError):\n                pass\n            break\n    return version_number\n", "entry_point": "extract_version", "input": "''", "output": "'Version not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42775_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002982", "code": "def login_system(username, password):\n    if username == 'root' and password == 'woshiniba':\n        return \"Login successful. Welcome, root!\"\n    else:\n        return \"Login failed. Incorrect username or password.\"\n", "entry_point": "login_system", "input": "'admin', 'password123'", "output": "'Login failed. Incorrect username or password.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78928_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002983", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "2, 8", "output": "256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt71", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002984", "code": "def calculate_sum_of_digits(port, connection_key):\n    total_sum = 0\n    for digit in str(port) + str(connection_key):\n        total_sum += int(digit)\n    return total_sum\n", "entry_point": "calculate_sum_of_digits", "input": "1999, 0", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102611_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002985", "code": "def parse_url_patterns(urlpatterns):\n    view_urls = {}\n    for pattern in urlpatterns:\n        url_pattern = pattern[0]\n        view_name = pattern[1]\n        view_urls[view_name] = url_pattern\n    return view_urls\n", "entry_point": "parse_url_patterns", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141682_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002986", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'hello world && (sor qurqu'", "output": "'hello\\\\ world\\\\ \\\\&&\\\\ \\\\(sor\\\\ qurqu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002987", "code": "from typing import List\ndef generate_directories(base_dir: str) -> List[str]:\n    subdirectories = [\"evaluation\", \"jobinfo\"]\n    return [f\"{base_dir}/{subdir}\" for subdir in subdirectories]\n", "entry_point": "generate_directories", "input": "'/r//'", "output": "['/r///evaluation', '/r///jobinfo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93666_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002988", "code": "def min_swaps_to_sort(nums):\n    count_1 = nums.count(1)\n    count_2 = nums.count(2)\n    count_3 = nums.count(3)\n    swaps = 0\n    for i in range(count_1):\n        if nums[i] != 1:\n            if nums[i] == 2:\n                if count_1 > 0:\n                    count_1 -= 1\n                    swaps += 1\n                else:\n                    count_3 -= 1\n                    swaps += 2\n            elif nums[i] == 3:\n                count_3 -= 1\n                swaps += 1\n    for i in range(count_1, count_1 + count_2):\n        if nums[i] != 2:\n            count_3 -= 1\n            swaps += 1\n    return swaps\n", "entry_point": "min_swaps_to_sort", "input": "[1, 1, 2, 2, 3, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124017_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002989", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "9, 11", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002990", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "11", "output": "[1, 0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002991", "code": "import math\ndef calculate_CA_for_pvalue(pvalue: float) -> float:\n    CA = math.sqrt(-0.5 * math.log(pvalue))\n    return CA\n", "entry_point": "calculate_CA_for_pvalue", "input": "0.8", "output": "0.33402361541828873", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63144_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002992", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "352", "output": "'CCCLII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002993", "code": "def determine_name(n):\n    # Check if n is odd or even and return the corresponding name\n    if n % 2 == 1:\n        return \"Alice\"\n    else:\n        return \"Bob\"\n", "entry_point": "determine_name", "input": "0", "output": "'Bob'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124502_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002994", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'122313123'", "output": "'12231312312485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002995", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "True", "output": "'true'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002996", "code": "def is_valid_base64(input_str):\n    base64_chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"\n    if len(input_str) % 4 != 0:\n        return False\n    for char in input_str:\n        if char not in base64_chars and char != '=':\n            return False\n    padding_count = input_str.count('=')\n    if padding_count > 2:\n        return False\n    if padding_count == 1 and input_str[-1] != '=':\n        return False\n    if padding_count == 2 and input_str[-2:] != '==':\n        return False\n    return True\n", "entry_point": "is_valid_base64", "input": "'abcde'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44667_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002997", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2239", "output": "{1, 2239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002998", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'aa'", "output": "'AA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0002999", "code": "def count(char, word):\n    total = 0\n    for any in word:\n        if any == char:\n            total += 1\n    return total\n", "entry_point": "count", "input": "'a', ''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47470_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003000", "code": "# Define the mapping between detector names and camera types\ndetector_camera_mapping = {\n    'EigerDetector': 'cam.EigerDetectorCam',\n    'FirewireLinDetector': 'cam.FirewireLinDetectorCam',\n    'FirewireWinDetector': 'cam.FirewireWinDetectorCam',\n    'GreatEyesDetector': 'cam.GreatEyesDetectorCam',\n    'LightFieldDetector': 'cam.LightFieldDetectorCam'\n}\n# Function to get the camera type based on the detector name\ndef get_camera_type(detector_name):\n    return detector_camera_mapping.get(detector_name, 'Detector not found')\n", "entry_point": "get_camera_type", "input": "'NonExistentDetector'", "output": "'Detector not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_375_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003001", "code": "def max_subset_sum_non_adjacent(arr):\n    inclusive = 0\n    exclusive = 0\n    for num in arr:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update inclusive as the sum of previous exclusive and current element\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[10, 1, 5, 0, 6]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38682_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003002", "code": "def dna_to_rna(dna_strand):\n    pairs = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}\n    rna_complement = ''.join(pairs[n] for n in dna_strand)\n    return rna_complement\n", "entry_point": "dna_to_rna", "input": "'TGGCACA'", "output": "'ACCGUGU'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39038_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003003", "code": "PROVISIONING = {\n    'state': 'provisioning'\n}\nRUNNING = {\n    'state': 'running',\n    'master': {\n        'ipAddress': '192.168.20.18'\n    },\n    'blockedPorts': [1, 2, 3]\n}\nPROFILE = {\n    'handle': 'user1'\n}\ndef process_state(state):\n    if state == 'provisioning':\n        return PROFILE.get('handle')\n    elif state == 'running':\n        ip_address = RUNNING.get('master', {}).get('ipAddress')\n        blocked_ports = RUNNING.get('blockedPorts')\n        return (ip_address, blocked_ports)\n    else:\n        return None\n", "entry_point": "process_state", "input": "'running'", "output": "('192.168.20.18', [1, 2, 3])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71058_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003004", "code": "def find_first_exceeded_day(tweet_counts):\n    for day, count in enumerate(tweet_counts):\n        if count > 200:\n            return day\n    return -1\n", "entry_point": "find_first_exceeded_day", "input": "[150, 200, 200, 201, 100]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137540_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003005", "code": "# Step 1: Define a dictionary mapping English words to their phonetic representations\nphonetic_dict = {\n    \"hello\": [\"HH\", \"AH\", \"L\", \"OW\"],\n    \"world\": [\"W\", \"ER\", \"L\", \"D\"],\n    \"example\": [\"IH\", \"G\", \"Z\", \"AE\", \"M\", \"P\", \"AH\", \"L\"]\n    # Add more word-phonetic pairs as needed\n}\n# Step 2: Implement the get_g2p(word) function\ndef get_g2p(word):\n    return phonetic_dict.get(word.lower(), [])  # Return the phonetic representation if word exists in the dictionary, else return an empty list\n", "entry_point": "get_g2p", "input": "'world'", "output": "['W', 'ER', 'L', 'D']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21781_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003006", "code": "def count_unique_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in numbers:\n        if is_prime(num) and num not in unique_primes:\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[2, 3, 5, 7, 11, 13, 17]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31404_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003007", "code": "def longestCommonPrefix(strs):\n    if not strs:\n        return \"\"\n    prefix = strs[0]\n    for string in strs[1:]:\n        i = 0\n        while i < len(prefix) and i < len(string) and prefix[i] == string[i]:\n            i += 1\n        prefix = prefix[:i]\n        if not prefix:\n            break\n    return prefix\n", "entry_point": "longestCommonPrefix", "input": "['apple', 'application', 'apricot']", "output": "'ap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86856_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003008", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[10], [-9]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17756_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003009", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'Hello hello'", "output": "{'hello': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003010", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9839", "output": "{1, 9839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003011", "code": "def can_convert_to_palindrome(string):\n    z, o = 0, 0\n    for c in string:\n        if c == '0':\n            z += 1\n        else:\n            o += 1\n    if z == 1 or o == 1:\n        return \"Yes\"\n    else:\n        return \"No\"\n", "entry_point": "can_convert_to_palindrome", "input": "'0011'", "output": "'No'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118308_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003012", "code": "import re\ndef validate_phone_numbers(phone_numbers):\n    valid_numbers = []\n    pattern = r'\\d{3}-\\d{4}-\\d{4}'\n    for number in phone_numbers:\n        match = re.fullmatch(pattern, number)\n        if match:\n            valid_numbers.append(True)\n        else:\n            valid_numbers.append(False)\n    return valid_numbers\n", "entry_point": "validate_phone_numbers", "input": "['1234-567-8910', 'not-a-valid-phone', '1234567890']", "output": "[False, False, False]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34101_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003013", "code": "from typing import List\nimport functools\ndef maximumScore1(nums: List[int], mult: List[int]) -> int:\n    @functools.lru_cache(maxsize=2000)\n    def dp(left, i):\n        if i >= len(mult):\n            return 0\n        right = len(nums) - 1 - (i - left)\n        return max(mult[i] * nums[left] + dp(left+1, i+1), mult[i] * nums[right] + dp(left, i+1))\n    return dp(0, 0)\n", "entry_point": "maximumScore1", "input": "[1, 2, 3, 4, 5], [3, 2, 1]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146067_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003014", "code": "from typing import List\ndef max_difference_after(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    min_element = nums[0]\n    max_difference = 0\n    for num in nums[1:]:\n        difference = num - min_element\n        if difference > max_difference:\n            max_difference = difference\n        if num < min_element:\n            min_element = num\n    return max_difference\n", "entry_point": "max_difference_after", "input": "[0, 2, 5, 3, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72615_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003015", "code": "def device_info(os):\n    if os == 'eos':\n        # Simulating the behavior of fetching version and model information for an EOS device\n        version_info = 'EOS Version X.Y.Z'\n        model_info = 'EOS Model ABC'\n        return version_info, model_info\n    else:\n        return 'Not supported on this platform'\n", "entry_point": "device_info", "input": "'linux'", "output": "'Not supported on this platform'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84666_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003016", "code": "def fetch_organization_data(search_type, search_value):\n    organizations = {\n        \"ABC Inc.\": {\n            \"name\": \"ABC Inc.\",\n            \"location\": \"City A\",\n            \"industry\": \"Tech\",\n            \"employees\": 100\n        },\n        \"12345\": {\n            \"name\": \"XYZ Corp\",\n            \"location\": \"City B\",\n            \"industry\": \"Finance\",\n            \"employees\": 500\n        }\n    }\n    if search_type == \"name\" and search_value in organizations:\n        return organizations[search_value]\n    elif search_type == \"id\" and search_value in organizations:\n        return organizations[search_value]\n    else:\n        return \"Organization not found.\"\n", "entry_point": "fetch_organization_data", "input": "'location', 'Some City'", "output": "'Organization not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59576_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003017", "code": "import os\ndef calculate_rpm_size(directory: str) -> int:\n    total_size = 0\n    try:\n        # List all files in the specified directory\n        files = os.listdir(directory)\n        # Filter out only the files with a .rpm extension\n        rpm_files = [file for file in files if file.endswith('.rpm')]\n        # Iterate through the list of RPM files and calculate the total size\n        for rpm_file in rpm_files:\n            file_path = os.path.join(directory, rpm_file)\n            total_size += os.path.getsize(file_path)\n        return total_size // 1024  # Convert total size to kilobytes and return\n    except FileNotFoundError:\n        return 0  # Return 0 if the directory does not exist or cannot be accessed\n", "entry_point": "calculate_rpm_size", "input": "'non_existent_directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144764_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003018", "code": "def generate_triangles(boundary_point_loops, n_points):\n    triangles = []\n    for loop in boundary_point_loops:\n        for i in range(len(loop) - 1):\n            for j in range(n_points):\n                new_point = [loop[i][0] + (loop[i+1][0] - loop[i][0]) * (j + 1) / n_points, loop[i][1] + (loop[i+1][1] - loop[i][1]) * (j + 1) / n_points]\n                triangles.append([loop[i], loop[i+1], new_point])\n    return triangles\n", "entry_point": "generate_triangles", "input": "[], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131775_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003019", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'friends.'", "output": "'friends.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003020", "code": "import math\ndef calculate_combinations(top_k):\n    if top_k < 2:\n        return 0  # No combinations possible with less than 2 embeddings\n    total_combinations = math.factorial(top_k) // math.factorial(top_k - 2)\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132126_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1636", "output": "{1, 2, 4, 1636, 818, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1635", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003022", "code": "def even_fibonacci_sum(limit):\n    a, b = 0, 1\n    sum_even = 0\n    while b <= limit:\n        if b % 2 == 0:\n            sum_even += b\n        a, b = b, a + b\n    return sum_even\n", "entry_point": "even_fibonacci_sum", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141032_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003023", "code": "def balancedSums(arr):\n    total_sum = sum(arr)\n    left_sum = 0\n    for i in range(len(arr)):\n        total_sum -= arr[i]\n        if left_sum == total_sum:\n            return i\n        left_sum += arr[i]\n    return -1\n", "entry_point": "balancedSums", "input": "[1, 2, 3, 2, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101017_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1763", "output": "{1, 1763, 43, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003025", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[100, 80, 60, 40]", "output": "280", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003026", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003027", "code": "def process_migrations(operations):\n    schema = {}\n    for operation in operations:\n        for op_type, op_details in operation.items():\n            if op_type == 'CreateModel':\n                model_name = op_details['name']\n                schema[model_name] = [field['name'] for field in op_details['fields']]\n            elif op_type == 'AddField':\n                model_name = op_details['model']\n                field_name = op_details['field']['name']\n                schema[model_name].append(field_name)\n            elif op_type == 'RemoveField':\n                model_name = op_details['model']\n                field_name = op_details['field']\n                schema[model_name].remove(field_name)\n    return schema\n", "entry_point": "process_migrations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133548_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7843", "output": "{1, 7843, 713, 11, 341, 23, 253, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003029", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'C:\\\\Users\\\\Admin\\\\Documents'", "output": "'C:\\\\Users\\\\Admin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003030", "code": "import ast\ndef extract_local_functions(script):\n    tree = ast.parse(script)\n    local_functions = []\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            if not any(isinstance(n, ast.FunctionDef) for n in ast.walk(node)):\n                local_functions.append(node.name)\n    return local_functions\n", "entry_point": "extract_local_functions", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148092_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003031", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[10, 9, 2, 7, 1, 4, 10, 2]", "output": "[19, 11, 9, 8, 5, 14, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003032", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[2, 3, 5, 2, 3, 2, 2, 3]", "output": "[2, 5, 10, 12, 15, 17, 19, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3133", "output": "{1, 13, 241, 3133}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003034", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "6, 4", "output": "1296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt37", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003035", "code": "def calculate_word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Initialize a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation if needed\n        word = word.strip('.,')\n        # Update the word frequency dictionary\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'pytho'", "output": "{'pytho': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88926_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2435", "output": "{1, 2435, 5, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003037", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "11", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003038", "code": "def repeatedString(s, n):\n    count_1 = n // len(s) * s.count('a')  # Count of 'a' in complete repetitions of s\n    remained_string = n % len(s)  # Number of characters left after complete repetitions\n    count_2 = s[:remained_string].count('a')  # Count of 'a' in the remaining characters\n    return count_1 + count_2\n", "entry_point": "repeatedString", "input": "'aaaaa', 9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29420_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003039", "code": "import re\nVALID_LOCAL_CHARS = r\"a-zA-Z\u00c0-\u00ff0-9.!#$%&'*+/=?^_`{|}~\\-\"\nhostname_part = re.compile(r\"^(xn-|[a-z0-9]+)(-[a-z0-9]+)*$\", re.IGNORECASE)\ntld_part = re.compile(r\"^([a-z]{2,63}|xn--([a-z0-9]+-)*[a-z0-9]+)$\", re.IGNORECASE)\nEMAIL_REGEX_PATTERN = r\"^[{}]+@([^.@][^@\\s]+)$\".format(VALID_LOCAL_CHARS)\ndef validate_email_address(email):\n    if re.match(EMAIL_REGEX_PATTERN, email):\n        local_part, domain_part = email.split('@')\n        if re.match(f\"^[{VALID_LOCAL_CHARS}]+$\", local_part) and hostname_part.match(domain_part) and tld_part.match(domain_part.split('.')[-1]):\n            return True\n    return False\n", "entry_point": "validate_email_address", "input": "'username@'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14778_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003040", "code": "import keyword\ndef validate_collection_name(collection_name):\n    # List of Python keywords\n    python_keywords = keyword.kwlist\n    # Check if the collection name is empty\n    if not collection_name:\n        return False\n    # Check if the collection name starts with a number\n    if collection_name[0].isdigit():\n        return False\n    # Check if the collection name contains special characters other than underscore\n    if not collection_name.replace('_', '').isalnum():\n        return False\n    # Check if the collection name is a Python keyword\n    if collection_name in python_keywords:\n        return False\n    return True\n", "entry_point": "validate_collection_name", "input": "'import'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78726_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003041", "code": "def max_score_subset(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        dp[i] = max(\n            scores[i] + dp[i - 2] if i >= 2 and scores[i] - scores[i - 2] <= 5 else scores[i],\n            dp[i - 1]\n        )\n    return max(dp)\n", "entry_point": "max_score_subset", "input": "[90]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30122_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003042", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4111", "output": "{1, 4111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003043", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[33, 91, 32, 67, 66, 33, 32, 75]", "output": "[33, 91, 32, 67, 66, 33, 32, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003044", "code": "def adapt_dataset_name(dataset_name: str) -> str:\n    torchvision_datasets = {\n        \"CIFAR10\": \"CIFAR10\",\n        \"MNIST\": \"MNIST\",\n        # Add more Torchvision dataset names here\n    }\n    return torchvision_datasets.get(dataset_name, \"Dataset not found\")\n", "entry_point": "adapt_dataset_name", "input": "'ImageNet'", "output": "'Dataset not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98850_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003045", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 89, 20]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003046", "code": "def count_unique_even_numbers(numbers):\n    unique_evens = set()\n    for num in numbers:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_even_numbers", "input": "[2, 4, 6]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17662_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003047", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "'   foewf  hello world feat. John-Do!!'", "output": "'Foewf  Hello World ft John-Do'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003048", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'text'", "output": "{'text': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003049", "code": "def longest_consecutive_zeros(N):\n    binary_str = bin(N)[2:]  # Convert N to binary and remove the '0b' prefix\n    max_zeros = 0\n    current_zeros = 0\n    for digit in binary_str:\n        if digit == '0':\n            current_zeros += 1\n            max_zeros = max(max_zeros, current_zeros)\n        else:\n            current_zeros = 0\n    return max_zeros\n", "entry_point": "longest_consecutive_zeros", "input": "32", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40346_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8879", "output": "{1, 683, 13, 8879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8878", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003051", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[8.4]", "output": "8.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003052", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tasks=addttss'", "output": "{'field': 'tasks', 'value': 'addttss'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "477", "output": "{1, 3, 9, 53, 477, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt476", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003054", "code": "def countPaths(numrArreglo, numSalto):\n    dp = [0] * numrArreglo\n    dp[0] = 1\n    for i in range(1, numrArreglo):\n        for j in range(1, numSalto + 1):\n            if i - j >= 0:\n                dp[i] += dp[i - j]\n    return dp[numrArreglo - 1]\n", "entry_point": "countPaths", "input": "6, 3", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42463_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003055", "code": "import re\ndef extract_task_names(code_snippet):\n    task_names = []\n    # Regular expression pattern to match task names\n    pattern = r'\\b(\\w+)\\s*=\\s*cms\\.Sequence\\((.*?)\\)'\n    # Find all matches of the pattern in the code snippet\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        if 'ecalPreshowerDefaultTasksSequence' in match[0]:\n            tasks = re.findall(r'\\b(\\w+)\\b', match[1])\n            task_names.extend(tasks)\n    return task_names\n", "entry_point": "extract_task_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91770_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003056", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    while player1_deck and player2_deck:\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    return player1_score, player2_score\n", "entry_point": "simulate_card_game", "input": "[3, 4, 2], [1, 2, 5]", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131386_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003057", "code": "def filter_gt_avg(numbers):\n    if not numbers:\n        return []\n    avg = sum(numbers) / len(numbers)\n    return [num for num in numbers if num > avg]\n", "entry_point": "filter_gt_avg", "input": "[5, 6, 7, 8, 10, 8, 8]", "output": "[8, 10, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15446_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003058", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "24, 'mode', 'input'", "output": "{'response': 'InvalidPin', 'pin': 24}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003059", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[2, 4, 2, 5, 3, 1, 1, 1]", "output": "[2, 4, 2, 5, 3, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003060", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8035", "output": "{1, 8035, 5, 1607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003061", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 1, 1, 1, 1, 3, 1]", "output": "[1, 2, 2, 2, 4, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125440_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003062", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'5010.2.10'", "output": "(5010, 2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003063", "code": "def calculate_circle_area(radius):\n    # Define a constant for pi\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78790_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5702", "output": "{1, 2, 2851, 5702}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003065", "code": "def common_end(list1, list2):\n    return list1[0] == list2[0] or list1[-1] == list2[-1]\n", "entry_point": "common_end", "input": "[1, 2, 3], [4, 5, 6]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75755_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003066", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "(9, 9, 7, 8, 8, 0, 4)", "output": "'9.9.7.8.8.0.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8934", "output": "{1, 2, 3, 2978, 8934, 6, 1489, 4467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003068", "code": "def parse_time_duration(duration_str):\n    # Split the duration string into hours, minutes, and seconds components\n    components = duration_str.split('h')\n    hours = int(components[0])\n    if 'm' in components[1]:\n        components = components[1].split('m')\n        minutes = int(components[0])\n    else:\n        minutes = 0\n    if 's' in components[1]:\n        components = components[1].split('s')\n        seconds = int(components[0])\n    else:\n        seconds = 0\n    # Calculate the total duration in seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "parse_time_duration", "input": "'2h'", "output": "7200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1363_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003069", "code": "EXCHANGES = ['binance', 'binanceus', 'coinbasepro', 'kraken']\nEXCHANGE_NAMES = ['Binance', 'Binance US', 'Coinbase Pro', 'Kraken']\nINTERVALS = ['1m', '5m', '15m', '30m', '1h', '12h', '1d']\ndef execute_trade(exchange_index, interval_index, trade_amount):\n    exchange_name = EXCHANGE_NAMES[exchange_index]\n    interval = INTERVALS[interval_index]\n    return f\"Trading {trade_amount} BTC on {exchange_name} at {interval} interval.\"\n", "entry_point": "execute_trade", "input": "2, 0, 0.6", "output": "'Trading 0.6 BTC on Coinbase Pro at 1m interval.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52795_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6987", "output": "{1, 3, 137, 6987, 17, 51, 2329, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003071", "code": "def sum_of_squares_even(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[6, 6, 4]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15719_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003072", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            result.append(input_list[i] + input_list[i + 1])\n        else:\n            result.append(input_list[i] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[4, 6, 4, 2, 0, 6, 1, 5]", "output": "[10, 10, 6, 2, 6, 7, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37203_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1304", "output": "{1, 2, 163, 4, 326, 8, 652, 1304}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1303", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003074", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'0.50.50'", "output": "(0, 50, 50)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003075", "code": "def max_product_of_two(nums):\n    if len(nums) < 2:\n        return 0\n    max_product = float('-inf')\n    second_max_product = float('-inf')\n    for num in nums:\n        if num > max_product:\n            second_max_product = max_product\n            max_product = num\n        elif num > second_max_product:\n            second_max_product = num\n    return max_product * second_max_product if max_product != float('-inf') and second_max_product != float('-inf') else 0\n", "entry_point": "max_product_of_two", "input": "[1, 5, 6, 2]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103728_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003076", "code": "def calculate_available_ips(start_ip, end_ip):\n    def ip_to_int(ip):\n        parts = ip.split('.')\n        return int(parts[0]) * 256**3 + int(parts[1]) * 256**2 + int(parts[2]) * 256 + int(parts[3])\n    start_int = ip_to_int(start_ip)\n    end_int = ip_to_int(end_ip)\n    total_ips = end_int - start_int + 1\n    available_ips = total_ips - 2  # Exclude network and broadcast addresses\n    return available_ips\n", "entry_point": "calculate_available_ips", "input": "'192.168.1.0', '192.168.1.10'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16242_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003077", "code": "def extract_log_messages(input_string):\n    unique_log_messages = set()\n    start_phrase = 'logger.debug(\"'\n    end_phrase = '\")'\n    start_index = input_string.find(start_phrase)\n    while start_index != -1:\n        end_index = input_string.find(end_phrase, start_index + len(start_phrase))\n        if end_index != -1:\n            log_message = input_string[start_index + len(start_phrase):end_index]\n            unique_log_messages.add(log_message)\n            start_index = input_string.find(start_phrase, end_index)\n        else:\n            break\n    return list(unique_log_messages)\n", "entry_point": "extract_log_messages", "input": "'This string does not contain any logs.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38515_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003078", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8747", "output": "{1, 8747}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003079", "code": "def calculate_average_scores(students):\n    subject_scores_sum = {}\n    num_students = len(students)\n    for student in students:\n        for subject, score in student.items():\n            if subject != \"name\":\n                subject_scores_sum[subject] = subject_scores_sum.get(subject, 0) + score\n    average_scores = {subject: total_score / num_students for subject, total_score in subject_scores_sum.items()}\n    return average_scores\n", "entry_point": "calculate_average_scores", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65774_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003080", "code": "import math\ndef combs(n, k):\n    if k == 0 or k == n:\n        return 1\n    return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))\n", "entry_point": "combs", "input": "3, 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128662_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003081", "code": "def generate_fibonacci_sequence(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "8", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32126_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003082", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 10]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19616_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003083", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "92", "output": "{2: 2, 23: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2654", "output": "{1, 2, 2654, 1327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003085", "code": "def count_test_cases(module_content):\n    test_cases = module_content.split('\"\"\"')[1:-1]  # Extract test cases enclosed in triple quotes\n    return len(test_cases)\n", "entry_point": "count_test_cases", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15445_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003086", "code": "def generate_primes(limit):\n    is_prime = [True] * (limit + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(limit**0.5) + 1):\n        if is_prime[i]:\n            for j in range(i*i, limit + 1, i):\n                is_prime[j] = False\n    primes = [i for i in range(2, limit + 1) if is_prime[i]]\n    return primes\n", "entry_point": "generate_primes", "input": "31", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29097_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003087", "code": "from typing import List, Set\nimport re\ndef extract_symbols(parameter_values: List[str]) -> Set[str]:\n    symbols = set()\n    for value in parameter_values:\n        # Using regular expression to find symbols in the parameter value\n        symbol_matches = re.findall(r'\\b[a-zA-Z_][a-zA-Z0-9_]*\\b', value)\n        symbols.update(symbol_matches)\n    return symbols\n", "entry_point": "extract_symbols", "input": "['alpha', 'beta', 'gamma', 'theta']", "output": "{'alpha', 'theta', 'beta', 'gamma'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96595_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003088", "code": "from typing import List\ndef min_boats(people: List[int], limit: int) -> int:\n    people.sort()\n    left, right, boats = 0, len(people) - 1, 0\n    while left <= right:\n        if people[left] + people[right] <= limit:\n            left += 1\n        right -= 1\n        boats += 1\n    return boats\n", "entry_point": "min_boats", "input": "[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50], 100", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49829_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003089", "code": "import math\ndef count_unique_sizes(determinants):\n    unique_sizes = set()\n    for det in determinants:\n        size = int(math.sqrt(det))\n        unique_sizes.add(size)\n    return len(unique_sizes)\n", "entry_point": "count_unique_sizes", "input": "[0, 1, 4, 9, 16, 25]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74244_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003090", "code": "def process_dependencies(dependencies):\n    processed = {}\n    for dep_key, dep_value in dependencies:\n        if dep_value:\n            processed[dep_key] = list(dep_value)\n        else:\n            processed[dep_key] = []\n    return processed\n", "entry_point": "process_dependencies", "input": "[('a', None)]", "output": "{'a': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15042_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003091", "code": "from typing import List\ndef sum_of_even_numbers(numbers: List[int]) -> int:\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149964_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003092", "code": "def custom_split(arr, target_sum):\n    def split_dataset(index, current_sum, current_set, remaining):\n        nonlocal best_diff, best_set\n        if index == len(arr):\n            diff = abs(current_sum - target_sum)\n            if diff < best_diff:\n                best_diff = diff\n                best_set = current_set.copy()\n            return\n        split_dataset(index + 1, current_sum, current_set, remaining[1:])  # Exclude current element\n        split_dataset(index + 1, current_sum + remaining[0], current_set + [index], remaining[1:])  # Include current element\n    best_diff = float('inf')\n    best_set = []\n    split_dataset(0, 0, [], arr)\n    test_indices = [i for i in range(len(arr)) if i not in best_set]\n    return best_set, test_indices\n", "entry_point": "custom_split", "input": "[1, 2, 3, 4, 5, 6, 7], 22", "output": "([3, 4, 5, 6], [0, 1, 2])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39514_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003093", "code": "FILE_STATUS = (\n    \"\u2601 Uploaded\",\n    \"\u231a Queued\",\n    \"\u2699 In Progress...\",\n    \"\u2705 Success!\",\n    \"\u274c Failed: file not found\",\n    \"\u274c Failed: unsupported file type\",\n    \"\u274c Failed: server error\",\n    \"\u274c Invalid column mapping, please fix it and re-upload the file.\",\n)\ndef get_file_status_message(index):\n    if 0 <= index < len(FILE_STATUS):\n        return FILE_STATUS[index]\n    else:\n        return \"Invalid status index\"\n", "entry_point": "get_file_status_message", "input": "8", "output": "'Invalid status index'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2319_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003094", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[80, 75, 70], 3", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94918_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003095", "code": "def simulate_reformat_temperature_data(raw_data):\n    # Simulate processing the data using a hypothetical script 'reformat_weather_data.py'\n    # In this simulation, we will simply reverse the input data as an example\n    reformatted_data = raw_data[::-1]\n    return reformatted_data\n", "entry_point": "simulate_reformat_temperature_data", "input": "'30,25827'", "output": "'72852,03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136307_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003096", "code": "def solution(arr):\n    if not arr:\n        return 0\n    visible_count = 1\n    max_height = arr[-1]\n    for i in range(len(arr) - 2, -1, -1):\n        if arr[i] > max_height:\n            visible_count += 1\n            max_height = arr[i]\n    return visible_count\n", "entry_point": "solution", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115968_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003097", "code": "def check_freestyle_string(input_string):\n    try:\n        str(input_string)\n        return True\n    except Exception:\n        return False\n", "entry_point": "check_freestyle_string", "input": "42", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107211_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003098", "code": "import re\ndef analyze_github_text(text: str) -> str:\n    github_url_pattern = r'https://github.com/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)'\n    match = re.search(github_url_pattern, text)\n    if match:\n        return f\"{match.group(1)}/{match.group(2)}\"\n    else:\n        return \"No GitHub URL found\"\n", "entry_point": "analyze_github_text", "input": "'This is just a random string without any links.'", "output": "'No GitHub URL found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12255_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003099", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7703", "output": "{1, 7703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003100", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "8", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003101", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'10:445:0, some other info'", "output": "{'when': '10:445:0', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003102", "code": "from collections import Counter\ndef max_score(card, k):\n    c = Counter(card)\n    ans = 0\n    while k > 0:\n        tmp = c.pop(c.most_common(1)[0][0])\n        if k > tmp:\n            ans += tmp * tmp\n            k -= tmp\n        else:\n            ans += k * k\n            k = 0\n    return ans\n", "entry_point": "max_score", "input": "[1, 1, 1, 1], 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62809_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003103", "code": "def find_unique_element(A):\n    result = 0\n    for number in A:\n        result ^= number\n    return result\n", "entry_point": "find_unique_element", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26858_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003104", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[5, 5, 5, 5, 6, 0, 0, 1], 5", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003105", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[3, 3, 0, 11, 3, 3, 3]", "output": "[3, 3, 11, 3, 3, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003106", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "8, 16", "output": "128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003107", "code": "def concatenate_vectors(vector_arrays):\n    concatenated_list = []\n    for vector_array in vector_arrays:\n        for vector in vector_array:\n            concatenated_list.append(vector)\n    return concatenated_list\n", "entry_point": "concatenate_vectors", "input": "[[3, 4], [2, 4, 2]]", "output": "[3, 4, 2, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15071_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003108", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[1, 5, 1, 4, 6, 5, 5]", "output": "[1, 5, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003109", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "3, 32, 97", "output": "[33, 32, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003110", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'hlllo'", "output": "'olllh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003111", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[7, 3, 2, 6, 3, 2, 5, 7]", "output": "[2, 2, 3, 3, 5, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003112", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[82, 86, 90]", "output": "86.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88301_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7534", "output": "{1, 2, 7534, 3767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7533", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003114", "code": "from typing import List\ndef above_average_count(scores: List[int]) -> int:\n    total_participants = len(scores)\n    total_score = sum(scores)\n    average_score = total_score / total_participants\n    count_above_average = 0\n    for score in scores:\n        if score >= average_score:\n            count_above_average += 1\n    return count_above_average\n", "entry_point": "above_average_count", "input": "[70, 80, 90, 45, 50]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15623_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003115", "code": "def longest_consecutive_sequence_length(nums):\n    if not nums:\n        return 0\n    longest_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n            longest_length = max(longest_length, current_length)\n        else:\n            current_length = 1\n    return longest_length\n", "entry_point": "longest_consecutive_sequence_length", "input": "[1, 2, 3, 4, 1, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119725_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003116", "code": "from typing import List\ndef count_elements_not_in_d(b: List[int], d: List[int]) -> int:\n    set_b = set(b)\n    set_d = set(d)\n    return len(set_b.difference(set_d))\n", "entry_point": "count_elements_not_in_d", "input": "[1, 2, 3, 4], [3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83668_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003117", "code": "def count_table_references(sql_query):\n    table_counts = {}\n    words = sql_query.split()\n    i = 0\n    while i < len(words):\n        if words[i] == 'FROM' or words[i] == 'JOIN':\n            table_name = words[i + 1]\n            if table_name in table_counts:\n                table_counts[table_name] += 1\n            else:\n                table_counts[table_name] = 1\n        i += 1\n    return table_counts\n", "entry_point": "count_table_references", "input": "'SELECT column1, column2'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74644_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003118", "code": "def compare_versions(installed_version, recommended_version):\n    installed_parts = list(map(int, installed_version.split('.')))\n    recommended_parts = list(map(int, recommended_version.split('.')))\n    for i in range(3):  # Compare major, minor, patch versions\n        if installed_parts[i] < recommended_parts[i]:\n            return \"Outdated\"\n        elif installed_parts[i] > recommended_parts[i]:\n            return \"Newer version installed\"\n    return \"Up to date\"\n", "entry_point": "compare_versions", "input": "'1.0.0', '1.1.0'", "output": "'Outdated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51372_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003119", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[3, 3]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2824", "output": "{1, 2, 706, 1412, 4, 353, 2824, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2823", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003121", "code": "def basic_calculator(num1, num2, operation):\n    if operation == \"add\":\n        return num1 + num2\n    elif operation == \"sub\":\n        return num1 - num2\n    elif operation == \"mul\":\n        return num1 * num2\n    elif operation == \"div\":\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Division by zero is not allowed.\"\n    else:\n        return \"Invalid operation specified.\"\n", "entry_point": "basic_calculator", "input": "1, 2, 'invalid_op'", "output": "'Invalid operation specified.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74615_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003122", "code": "def simulateImageHandling(file_path):\n    # Simulate reading the image file (placeholder)\n    image_size_kb = 150  # Placeholder for image size in kilobytes\n    image_width = 230    # Placeholder for image width\n    image_height = 280   # Placeholder for image height\n    if image_size_kb > 200:\n        return \"ERRORSIZE\"\n    elif image_width != 230 or image_height != 280:\n        return \"ERRORDIMENSION\"\n    else:\n        return \"SUCCESS\"\n", "entry_point": "simulateImageHandling", "input": "'dummy_path/to/image.jpg'", "output": "'SUCCESS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118894_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003123", "code": "def extract_project_info(code_snippet: str) -> dict:\n    project_info = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if '__project__' in line:\n            project_info['project'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__title__' in line:\n            project_info['title'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__author__' in line:\n            project_info['author'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__license__' in line:\n            project_info['license'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__version__' in line:\n            project_info['version'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__mail__' in line:\n            project_info['mail'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__maintainer__' in line:\n            project_info['maintainer'] = line.split('=')[1].strip().strip(\"'\")\n        elif '__status__' in line:\n            project_info['status'] = line.split('=')[1].strip().strip(\"'\")\n    return project_info\n", "entry_point": "extract_project_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42874_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003124", "code": "def count_activation_word_occurrences(text, activation_word):\n    words = text.split()\n    count = sum(1 for word in words if word == activation_word)\n    return count\n", "entry_point": "count_activation_word_occurrences", "input": "'hello world', 'python'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125794_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003125", "code": "def longest_zero_sum_subarray(arr):\n    sum_map = {0: -1}\n    max_len = 0\n    curr_sum = 0\n    for i, num in enumerate(arr):\n        curr_sum += num\n        if curr_sum in sum_map:\n            max_len = max(max_len, i - sum_map[curr_sum])\n        else:\n            sum_map[curr_sum] = i\n    return max_len\n", "entry_point": "longest_zero_sum_subarray", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67035_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003126", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'TeTLt*###'", "output": "'TeTLt*###\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003127", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7283", "output": "{1, 7283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7282", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003128", "code": "import re\nDATE_PATTERN = re.compile(r\"^\\s*([0-9]{2})/([0-9]{2})/([0-9]{4})$\")\nDATE2_PATTERN = re.compile(r\"^\\s*([0-9]{4})-([0-9]{2})-([0-9]{2})$\")\nDATETIME_PATTERN = re.compile(\n    r\"\"\"\n        ^\\s*\n        ([0-9]{2})/\n        ([0-9]{2})/\n        ([0-9]{4})\\s+\n        ([0-9]{2}):\n        ([0-9]{2})\n        (?::([0-9]{2}))?\n        $\n    \"\"\",\n    re.X,\n)\ndef validate_date_format(date_str):\n    if DATE_PATTERN.match(date_str) or DATE2_PATTERN.match(date_str) or DATETIME_PATTERN.match(date_str):\n        return True\n    return False\n", "entry_point": "validate_date_format", "input": "'12/12/2021'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87573_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003129", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'abc/native.repository_name()def/external/anything'", "output": "'abc/GENDIRdef/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003130", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'C:\\\\Users\\\\JohC'", "output": "'C:/Users/JohC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003131", "code": "from typing import List\ndef find_nearest(array: List[float], value: float) -> float:\n    if not array:\n        raise ValueError(\"Input array is empty\")\n    nearest_idx = 0\n    min_diff = abs(array[0] - value)\n    for i in range(1, len(array)):\n        diff = abs(array[i] - value)\n        if diff < min_diff:\n            min_diff = diff\n            nearest_idx = i\n    return array[nearest_idx]\n", "entry_point": "find_nearest", "input": "[4.0, 4.12, 4.2], 4.15", "output": "4.12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121237_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003132", "code": "def is_palindrome_list(lst):\n    return lst == lst[::-1]\n", "entry_point": "is_palindrome_list", "input": "[1]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107981_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003133", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3663", "output": "'01:01:03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6054", "output": "{1, 2, 3, 2018, 6054, 6, 1009, 3027}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003135", "code": "def sum_multiples_3_5(nums):\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 6, 12]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65812_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003136", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'2352.0'", "output": "2352", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003137", "code": "def map_and(process):\n    # Initialize the result as True\n    result = True\n    # Iterate through each boolean value in the process\n    for value in process:\n        # Update the result by performing logical AND operation\n        result = result and value\n    return result\n", "entry_point": "map_and", "input": "[True, False]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119781_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003138", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[3, [2, 3]]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003139", "code": "EMAIL_EXPIRES = 60 * 2  # 2 hours in minutes\ndef is_email_link_expired(link_timestamp, current_timestamp):\n    time_difference = current_timestamp - link_timestamp\n    if time_difference > EMAIL_EXPIRES:\n        return True\n    else:\n        return False\n", "entry_point": "is_email_link_expired", "input": "0, 121", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41577_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003140", "code": "import re\ndef extract_entities(text):\n    entities = {\n        'Apple': 'organization',\n        'Google': 'organization',\n        'Cupertino, California': 'location',\n        'Mountain View': 'location'\n    }\n    output = {}\n    sentences = re.split(r'[.!?]', text)\n    for sentence in sentences:\n        words = sentence.split()\n        for word in words:\n            entity_type = entities.get(word, None)\n            if entity_type:\n                output[word] = entity_type\n    return output\n", "entry_point": "extract_entities", "input": "'This is a general statement.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131495_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003141", "code": "def perform_operation(nums, operation):\n    if operation == 'add':\n        result = sum(nums)\n    elif operation == 'subtract':\n        result = nums[0] - sum(nums[1:])\n    elif operation == 'multiply':\n        result = 1\n        for num in nums:\n            result *= num\n    elif operation == 'divide':\n        result = nums[0]\n        for num in nums[1:]:\n            result /= num\n    else:\n        return \"Invalid operation\"\n    return result\n", "entry_point": "perform_operation", "input": "[], 'modulus'", "output": "'Invalid operation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143837_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003142", "code": "def unit_converter(value, initial_unit, target_unit):\n    conversions = {\n        'kg': {'kg': 1, 'g': 1000, 'lb': 2.2, 'oz': 35.274, 'amu': 6.022e26},\n        'g': {'kg': 0.001, 'g': 1, 'lb': 0.0022, 'oz': 0.035274, 'amu': 6.022e23},\n        'lb': {'kg': 0.454545, 'g': 453.592, 'lb': 1, 'oz': 16, 'amu': 2.7316e26},\n        'oz': {'kg': 0.0283495, 'g': 28.3495, 'lb': 0.0625, 'oz': 1, 'amu': 1.70725e25},\n        'amu': {'kg': 1.66053886e-27, 'g': 1.66053886e-24, 'lb': 3.660861e-27, 'oz': 5.8573776e-26, 'amu': 1},\n        'C': {'C': 1, 'N': 1.602e-19, 'dyn': 1e5, 'J': 1, 'W': 1, 'eV': 1.602e-19, 'keV': 1.602e-16, 'MeV': 1.602e-13, 'GeV': 1.602e-10},\n        'N': {'C': 1.602e19, 'N': 1, 'dyn': 1e5, 'J': 1, 'W': 1, 'eV': 1.602e-19, 'keV': 1.602e-16, 'MeV': 1.602e-13, 'GeV': 1.602e-10},\n        'dyn': {'C': 1e-5, 'N': 0.00001, 'dyn': 1, 'J': 0.00001, 'W': 0.00001, 'eV': 1.602e-24, 'keV': 1.602e-21, 'MeV': 1.602e-18, 'GeV': 1.602e-15},\n        'J': {'C': 1, 'N': 1, 'dyn': 100000, 'J': 1, 'W': 1, 'eV': 6.242e18, 'keV': 6.242e15, 'MeV': 6.242e12, 'GeV': 6.242e9},\n        'W': {'C': 1, 'N': 1, 'dyn': 100000, 'J': 1, 'W': 1, 'eV': 6.242e18, 'keV': 6.242e15, 'MeV': 6.242e12, 'GeV': 6.242e9},\n        'eV': {'C': 6.242e18, 'N': 6.242e12, 'dyn': 6.242e24, 'J': 1.602e-19, 'W': 1.602e-19, 'eV': 1, 'keV': 0.001, 'MeV': 1e-6, 'GeV': 1e-9},\n        'keV': {'C': 6.242e21, 'N': 6.242e15, 'dyn': 6.242e18, 'J': 1.602e-16, 'W': 1.602e-16, 'eV': 1000, 'keV': 1, 'MeV': 0.001, 'GeV': 1e-6},\n        'MeV': {'C': 6.242e24, 'N': 6.242e18, 'dyn': 6.242e21, 'J': 1.602e-13, 'W': 1.602e-13, 'eV': 1e6, 'keV': 1000, 'MeV': 1, 'GeV': 0.001},\n        'GeV': {'C': 6.242e27, 'N': 6.242e21, 'dyn': 6.242e24, 'J': 1.602e-10, 'W': 1.602e-10, 'eV': 1e9, 'keV': 1e6, 'MeV': 1000, 'GeV': 1}\n    }\n    if initial_unit in conversions and target_unit in conversions[initial_unit]:\n        conversion_factor = conversions[initial_unit][target_unit]\n        converted_value = value * conversion_factor\n        return converted_value\n    else:\n        return \"Unsupported conversion\"\n", "entry_point": "unit_converter", "input": "10, 'invalid_unit', 'kg'", "output": "'Unsupported conversion'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77588_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003143", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[5, 6]", "output": "[25, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003144", "code": "def sum_of_primes(nums):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in nums:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 11]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104647_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003145", "code": "def count_unique_country_codes(country_codes):\n    unique_country_codes = set()\n    for code in country_codes:\n        unique_country_codes.add(code)\n    return len(unique_country_codes)\n", "entry_point": "count_unique_country_codes", "input": "['US', 'CN', 'DE', 'BR', 'JP']", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116809_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003146", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'ssnake_case_examplae'", "output": "'ssnakeCaseExamplae'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003147", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 15]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81996_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003148", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-162], 1", "output": "-162.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132005_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003149", "code": "def rock_paper_scissors_winner(player_choice, computer_choice):\n    if player_choice == computer_choice:\n        return \"It's a tie!\"\n    elif (player_choice == \"rock\" and computer_choice == \"scissors\") or \\\n         (player_choice == \"scissors\" and computer_choice == \"paper\") or \\\n         (player_choice == \"paper\" and computer_choice == \"rock\"):\n        return \"Player wins! Congratulations!\"\n    else:\n        return \"Computer wins! Better luck next time!\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'rock'", "output": "\"It's a tie!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101675_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003150", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'1.0'", "output": "(1, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003151", "code": "def card_war(player1_card, player2_card):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_value = card_values[player1_card]\n    player2_value = card_values[player2_card]\n    if player1_value > player2_value:\n        return \"Player 1 wins!\"\n    elif player2_value > player1_value:\n        return \"Player 2 wins!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "card_war", "input": "'3', '4'", "output": "'Player 2 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46407_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003152", "code": "def is_palindrome_alphanumeric(s: str) -> bool:\n    # Remove non-alphanumeric characters and convert to lowercase\n    alphanumeric_s = ''.join(char.lower() for char in s if char.isalnum())\n    # Two pointers approach to check for palindrome\n    left, right = 0, len(alphanumeric_s) - 1\n    while left < right:\n        if alphanumeric_s[left] != alphanumeric_s[right]:\n            return False\n        left += 1\n        right -= 1\n    return True\n", "entry_point": "is_palindrome_alphanumeric", "input": "'A man, a plan, a canal: Panama'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6454", "output": "{1, 2, 7, 461, 14, 6454, 922, 3227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003154", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5686", "output": "{1, 2, 2843, 5686}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5685", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003155", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'b'", "output": "{'b': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003156", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "' oggolle '", "output": "'oggolle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003157", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alpha=1,beta=2,gmma=3'", "output": "{'alpha': '1', 'beta': '2', 'gmma': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003158", "code": "def isMath(operation: str) -> bool:\n    if not operation.startswith(\"(\") or not operation.endswith(\")\"):\n        return False\n    operation = operation[1:-1].split()\n    if len(operation) < 3:\n        return False\n    operator = operation[0]\n    if operator not in [\"+\", \"-\", \"*\", \"/\"]:\n        return False\n    operands = operation[1:]\n    for operand in operands:\n        if not operand.isalnum():\n            return False\n    return True\n", "entry_point": "isMath", "input": "'(+ 2)'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73873_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003159", "code": "def getFirstSetBit(n):\n    pos = 1\n    while n > 0:\n        if n & 1 == 1:\n            return pos\n        n = n >> 1\n        pos += 1\n    return 0\n", "entry_point": "getFirstSetBit", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107353_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003160", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[10, 9, 5, 6, 9, 8, 5, 6, 9]", "output": "[5, 5, 6, 6, 8, 9, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003161", "code": "def character_frequency(input_string):\n    frequency_dict = {}\n    for char in input_string:\n        if char in frequency_dict:\n            frequency_dict[char] += 1\n        else:\n            frequency_dict[char] = 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "'helloelleh'", "output": "{'h': 2, 'e': 3, 'l': 4, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130080_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003162", "code": "def initialize_model(network_type, long_side):\n    model_mapping = {\n        'mobile0.25': 'RetinaFace',\n        'slim': 'Slim',\n        'RFB': 'RFB'\n    }\n    if network_type in model_mapping:\n        return f\"Initialized {model_mapping[network_type]} model with long side {long_side}\"\n    else:\n        return \"Invalid network type specified\"\n", "entry_point": "initialize_model", "input": "'invalidType', 10", "output": "'Invalid network type specified'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84777_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003163", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-9, -6, -10, -5, 7, 3, 7, 7]", "output": "[-9, -6, -10, -5, 7, 3, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003164", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454400", "output": "'<t:1630454400>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003165", "code": "import ast\ndef extract_unique_imports(code_snippet):\n    imports = set()\n    tree = ast.parse(code_snippet)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports.add(f'import {alias.name}')\n        elif isinstance(node, ast.ImportFrom):\n            imports.add(f'from {node.module} import {\", \".join(alias.name for alias in node.names)}')\n    return list(imports)\n", "entry_point": "extract_unique_imports", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41559_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003166", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[0, 2, 6], [3, 2, 3]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59273_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003167", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'aahh', 65", "output": "[65, 65, 93, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003168", "code": "def count_unique_divisible(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0 and num not in unique_divisible_numbers:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible", "input": "[2, 4, 6, 8, 10, 12, 14], 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121992_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003169", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[2, 3, 4, 1]", "output": "[3, 1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003170", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003171", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hhelloehelloeel'", "output": "{'hhelloehelloeel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003172", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'hot dish'", "output": "'hot_dish'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003173", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[87, 81, 80, 80, 75, 72]", "output": "[87, 81, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003174", "code": "def filter_rooms_by_budget(listings, budget):\n    available_listings = []\n    for room in listings:\n        if room[\"price_per_night\"] <= budget:\n            available_listings.append(room)\n    return available_listings\n", "entry_point": "filter_rooms_by_budget", "input": "[{'price_per_night': 150}, {'price_per_night': 200}], 100", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123061_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003175", "code": "from typing import List, Tuple, Any\ndef extract_unique_args(messages: List[Tuple[str, Any]], message_type: str) -> List[Any]:\n    unique_args = set()\n    for msg_type, arg in messages:\n        if msg_type == message_type:\n            unique_args.add(arg)\n    return list(unique_args)\n", "entry_point": "extract_unique_args", "input": "[], 'error'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003176", "code": "def max_non_adjacent_sum(scores):\n    inclusive = 0\n    exclusive = 0\n    for score in scores:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + score  # Update the inclusive value\n        exclusive = new_exclusive  # Update the exclusive value\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[10, 5, 8, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29068_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003177", "code": "def count_unique_subsets(nums):\n    total_subsets = 0\n    n = len(nums)\n    for i in range(1, 2**n):\n        subset = [nums[j] for j in range(n) if (i >> j) & 1]\n        if subset:  # Ensure subset is not empty\n            total_subsets += 1\n    return total_subsets\n", "entry_point": "count_unique_subsets", "input": "[1, 2, 3, 4, 5]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53823_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003178", "code": "from datetime import datetime\ndue_date_format = '%Y-%m-%d'\ndatepicker_date_format = '%m%d%Y'\ndef convert_datepicker_to_due_date(datepicker_date):\n    try:\n        # Parse the input date in datepicker format\n        parsed_date = datetime.strptime(datepicker_date, datepicker_date_format)\n        # Convert the parsed date to due date format\n        due_date = parsed_date.strftime(due_date_format)\n        return due_date\n    except ValueError:\n        return \"Invalid date format provided\"\n", "entry_point": "convert_datepicker_to_due_date", "input": "'13012023'", "output": "'Invalid date format provided'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3548_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003179", "code": "def extract_policies_by_category(policy_list, category):\n    filtered_policies = []\n    for policy_str in policy_list:\n        policy_parts = policy_str.split(':')\n        if len(policy_parts) == 2 and policy_parts[0] == category:\n            filtered_policies.append(policy_str)\n    return filtered_policies\n", "entry_point": "extract_policies_by_category", "input": "[], 'example_category'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_949_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003180", "code": "from collections import defaultdict\ndef find_shortest_subarray(arr):\n    freq = defaultdict(list)\n    for i, num in enumerate(arr):\n        freq[num].append(i)\n    max_freq = max(len(indices) for indices in freq.values())\n    shortest_length = float('inf')\n    for indices in freq.values():\n        if len(indices) == max_freq:\n            shortest_length = min(shortest_length, indices[-1] - indices[0] + 1)\n    return shortest_length\n", "entry_point": "find_shortest_subarray", "input": "[1, 2, 1, 3, 1, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30490_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003181", "code": "def find_min_synaptic_conductance_time(synaptic_conductance_values):\n    min_value = synaptic_conductance_values[0]\n    min_time = 1\n    for i in range(1, len(synaptic_conductance_values)):\n        if synaptic_conductance_values[i] < min_value:\n            min_value = synaptic_conductance_values[i]\n            min_time = i + 1  # Time points start from 1\n    return min_time\n", "entry_point": "find_min_synaptic_conductance_time", "input": "[10, 9, 8, 7, 6, 5, 4, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31704_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003182", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[85, 90, 70, 95, 60, 50], 6", "output": "[3, 1, 0, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003183", "code": "def count_uppercase_letters(module_names):\n    uppercase_counts = {}\n    for module_name in module_names:\n        count = sum(1 for char in module_name if char.isupper())\n        uppercase_counts[module_name] = count\n    return uppercase_counts\n", "entry_point": "count_uppercase_letters", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11325_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003184", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'abcec'", "output": "'cec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003185", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'le'", "output": "'le.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003186", "code": "from textwrap import dedent\ndef merge_configurations(global_conf, local_conf):\n    def parse_configuration(conf_str):\n        config = {}\n        in_codecarbon_section = False\n        for line in conf_str.splitlines():\n            line = line.strip()\n            if line.startswith(\"[codecarbon]\"):\n                in_codecarbon_section = True\n            elif in_codecarbon_section and \"=\" in line:\n                key, value = line.split(\"=\", 1)\n                config[key.strip()] = value.strip()\n            elif in_codecarbon_section and not line:\n                break\n        return config\n    global_config = parse_configuration(global_conf)\n    local_config = parse_configuration(local_conf)\n    merged_config = global_config.copy()\n    merged_config.update(local_config)\n    merged_conf_str = \"[codecarbon]\\n\" + \"\\n\".join(f\"{key}={value}\" for key, value in merged_config.items())\n    return merged_conf_str\n", "entry_point": "merge_configurations", "input": "'[codecarbon]\\n', '[codecarbon]\\n'", "output": "'[codecarbon]\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117822_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003187", "code": "def sum_with_next(lst):\n    new_list = []\n    for i in range(len(lst)):\n        if i < len(lst) - 1:\n            new_list.append(lst[i] + lst[i + 1])\n        else:\n            new_list.append(lst[i] + lst[0])\n    return new_list\n", "entry_point": "sum_with_next", "input": "[0, -1, 4, -3, 4, -1, 4, -1]", "output": "[-1, 3, 1, 1, 3, 3, 3, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34169_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003188", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[5, 3, 8, 1, 2]", "output": "[1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003189", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'Acaherodemia', 3, '108110810010p'", "output": "'Acaherodemia - 03 [108110810010p].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003190", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'abcdececararacecxyz'", "output": "'cecararacec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003191", "code": "def reverse_dict_values(input_dict):\n    reversed_dict = {}\n    for key, value in input_dict.items():\n        if isinstance(key, str):\n            reversed_key = key[::-1]\n        else:\n            reversed_key = key\n        if isinstance(value, str):\n            reversed_value = value[::-1]\n        elif isinstance(value, dict):\n            reversed_value = reverse_dict_values(value)\n        else:\n            reversed_value = value\n        reversed_dict[reversed_key] = reversed_value\n    return reversed_dict\n", "entry_point": "reverse_dict_values", "input": "{'a': '1', 'b': {'c': '2'}}", "output": "{'a': '1', 'b': {'c': '2'}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31008_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003192", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    total_sum = 0\n    for num in input_list:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67910_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003193", "code": "import re\ndef extract_error_messages(module_content):\n    error_messages = set()\n    pattern = r'^([A-Z_]+)\\s*=\\s*\\'(.+?)\\''\n    matches = re.findall(pattern, module_content, re.MULTILINE)\n    for match in matches:\n        error_messages.add(match[1])\n    return list(error_messages)\n", "entry_point": "extract_error_messages", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73408_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003194", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2 and element not in common_elements:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 3, 4, 6], [5, 3, 6, 7]", "output": "[3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23619_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003195", "code": "def max_subarray_sum(arr):\n    max_sum = float('-inf')\n    current_sum = 0\n    for num in arr:\n        current_sum += num\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 5, 12, 0]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15965_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003196", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1138", "output": "{1, 1138, 2, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003197", "code": "def extract_full_name(input_str):\n    words = input_str.split()\n    full_name = ''.join(word[0] for word in words if word.isalpha())\n    return full_name\n", "entry_point": "extract_full_name", "input": "'the'", "output": "'t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98367_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003198", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average)\n", "entry_point": "calculate_average", "input": "[70, 70, 72, 74, 80]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54636_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003199", "code": "def is_bow(text):\n    if not isinstance(text, dict):\n        return False\n    for key, value in text.items():\n        if not isinstance(key, str) or not isinstance(value, int) or value < 0 or key is None:\n            return False\n    return True\n", "entry_point": "is_bow", "input": "[1, 2, 3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94059_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003200", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[1, 2, 3, 4, 9, 7, 6], 3", "output": "[9, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003201", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "545", "output": "{1, 109, 5, 545}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003202", "code": "def jaccard_similarity_coefficient(x, y):\n    set_x = set(x)\n    set_y = set(y)\n    intersection_size = len(set_x.intersection(set_y))\n    union_size = len(set_x.union(set_y))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    return intersection_size / union_size\n", "entry_point": "jaccard_similarity_coefficient", "input": "[1], [1, 2, 3, 4, 5]", "output": "0.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77613_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003203", "code": "user_credentials = {\n    \"alice\": {\"password\": \"12345\", \"role\": \"admin\"},\n    \"bob\": {\"password\": \"password\", \"role\": \"user\"},\n    \"charlie\": {\"password\": \"securepwd\", \"role\": \"user\"}\n}\ndef authenticate_user(username: str, password: str) -> str:\n    if username in user_credentials and user_credentials[username][\"password\"] == password:\n        return user_credentials[username][\"role\"]\n    return \"Unauthorized\"\n", "entry_point": "authenticate_user", "input": "'alice', '12345'", "output": "'admin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14714_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003204", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003205", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5277", "output": "{1, 3, 5277, 1759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003206", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 15]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2720_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003207", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[5, 3, -1, 1, 5, 0, 1, -1]", "output": "[5, 3, -1, 1, 5, 0, 1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003208", "code": "def alphabet_shift(input_string, n):\n    result = \"\"\n    for char in input_string:\n        if char.isalpha():\n            shifted_char = chr(((ord(char) - ord('a') + n) % 26) + ord('a'))\n            result += shifted_char\n        else:\n            result += char\n    return result\n", "entry_point": "alphabet_shift", "input": "'dbefabc', 1", "output": "'ecfgbcd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1133_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003209", "code": "from urllib.parse import urlparse\ndef transform_text(input_text):\n    def xml_escape(string):\n        return string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\"', '&quot;').replace(\"'\", '&apos;')\n    def static_url(url):\n        static_bucket_url = \"https://example.com/static/\"  # Example static bucket URL\n        relative_path = urlparse(url).path.split('/', 3)[-1]  # Extract relative path\n        return f\"{static_bucket_url}{relative_path}\"\n    escaped_text = xml_escape(input_text)\n    static_url_text = static_url(input_text)\n    return f\"{escaped_text} {static_url_text}\"\n", "entry_point": "transform_text", "input": "'is'", "output": "'is https://example.com/static/is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43461_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003210", "code": "def transform_list(nums, transform):\n    transformed_list = []\n    for num in nums:\n        if transform == 'double':\n            transformed_list.append(num * 2)\n        elif transform == 'square':\n            transformed_list.append(num ** 2)\n        elif transform == 'add_one':\n            transformed_list.append(num + 1)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[], 'double'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45340_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003211", "code": "def calculate_consecutive_ones(data_bit):\n    consecutive_count = 0\n    max_consecutive_count = 0\n    for bit in data_bit:\n        if bit == 1:\n            consecutive_count += 1\n            max_consecutive_count = max(max_consecutive_count, consecutive_count)\n        else:\n            consecutive_count = 0\n    return max_consecutive_count\n", "entry_point": "calculate_consecutive_ones", "input": "[1, 1, 0]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42781_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003212", "code": "def calculate_total_time_elapsed(frame_interval, num_frames):\n    time_interval = frame_interval * 10.0 / 60.0  # Calculate time interval for 10 frames in minutes\n    total_time_elapsed = time_interval * (num_frames / 10)  # Calculate total time elapsed in minutes\n    return total_time_elapsed\n", "entry_point": "calculate_total_time_elapsed", "input": "60.0, 20", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24500_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003213", "code": "def longest_common_subsequence(text1, text2):\n    m, n = len(text1), len(text2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m):\n        for j in range(n):\n            if text1[i] == text2[j]:\n                dp[i+1][j+1] = dp[i][j] + 1\n            else:\n                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "'abcde', 'ace'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14619_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003214", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "965", "output": "{1, 5, 193, 965}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003215", "code": "def contains_duplicates(nums: [int]) -> bool:\n    return len(nums) != len(set(nums))\n", "entry_point": "contains_duplicates", "input": "[1, 2, 2]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49260_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003216", "code": "def extract_author_and_url(code_snippet):\n    author = None\n    url = None\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if line.startswith('__author__'):\n            author = line.split('=')[1].strip().strip(\"'\")\n        elif line.startswith('__url__'):\n            url = line.split('=')[1].strip().strip(\"'\")\n    return author, url\n", "entry_point": "extract_author_and_url", "input": "''", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147838_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003217", "code": "from typing import List\ndef total_visible_skyline(buildings: List[int]) -> int:\n    total_skyline = 0\n    max_height = 0\n    for height in buildings:\n        if height > max_height:\n            total_skyline += height - max_height\n            max_height = height\n    return total_skyline\n", "entry_point": "total_visible_skyline", "input": "[3, 4, 0, 8, 6]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115607_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003218", "code": "import re\ndef remove_retweet(tweet):\n    return re.sub(r\"\\brt\\b\", \"\", tweet)\n", "entry_point": "remove_retweet", "input": "'g\u00fczel'", "output": "'g\u00fczel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62869_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003219", "code": "def calculate_dot_product(A, B):\n    if len(A) != len(B):\n        raise ValueError(\"Arrays must be of the same length\")\n    dot_product = sum(a * b for a, b in zip(A, B))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[4, 4], [4, 4]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105699_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003220", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[5, 5, 10, 7]", "output": "6.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003221", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive > 0:\n        return sum_positive / count_positive\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[7]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60830_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003222", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5989", "output": "{1, 53, 5989, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003223", "code": "def max_subset_sum_non_adjacent(arr):\n    incl = 0\n    excl = 0\n    for i in arr:\n        new_excl = max(incl, excl)  # Calculate the new value for excl\n        incl = excl + i  # Update incl to be excl + current element\n        excl = new_excl  # Update excl for the next iteration\n    return max(incl, excl)  # Return the maximum of incl and excl\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[7, 1, 3, 9]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143195_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003224", "code": "def largest_rectangle_area(histogram):\n    stack = []\n    max_area = 0\n    index = 0\n    while index < len(histogram):\n        if not stack or histogram[index] >= histogram[stack[-1]]:\n            stack.append(index)\n            index += 1\n        else:\n            top = stack.pop()\n            area = histogram[top] * ((index - stack[-1] - 1) if stack else index)\n            max_area = max(max_area, area)\n    while stack:\n        top = stack.pop()\n        area = histogram[top] * ((index - stack[-1] - 1) if stack else index)\n        max_area = max(max_area, area)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[4, 4, 4, 0, 0]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29850_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003225", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9433", "output": "{1, 9433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003226", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'apple,ba'", "output": "['apple', 'ba']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003227", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "2, 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003228", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2249", "output": "{1, 2249, 13, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6057", "output": "{1, 673, 3, 2019, 6057, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003230", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "3, 3, 103", "output": "11.444444444444445", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003231", "code": "from collections import defaultdict\ndef topological_sort(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    # Build the graph and calculate in-degrees\n    for dep in dependencies:\n        graph[dep[1]].append(dep[0])\n        in_degree[dep[0]] += 1\n    # Initialize a queue with nodes having in-degree 0\n    queue = [node for node in graph if in_degree[node] == 0]\n    result = []\n    # Perform topological sort\n    while queue:\n        node = queue.pop(0)\n        result.append(node)\n        for neighbor in graph[node]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    return result if len(result) == len(graph) else []\n", "entry_point": "topological_sort", "input": "[(1, 2), (2, 3), (3, 1)]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48656_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003232", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> int:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[70, 72, 74]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7016_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003233", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "'N'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003234", "code": "import os\ndef count_python_files(directory):\n    python_files_count = {}\n    for root, _, files in os.walk(directory):\n        py_files = [f for f in files if f.endswith('.py')]\n        if py_files:\n            python_files_count[root] = len(py_files)\n    return python_files_count\n", "entry_point": "count_python_files", "input": "'non_existent_directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125897_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003235", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'ft'", "output": "'App/static/uploads/ft'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003236", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'WW'", "output": "{'ww': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003237", "code": "def validate_firewall_rules(event_hub_name, firewall_rules):\n    # Check if Event Hub name contains the required substring\n    if '-cctesteventhubns' not in event_hub_name:\n        return False\n    # Define the expected firewall rules\n    expected_rules = ['192.168.3.11/24', '10.1.1.1/32']\n    # Check if the provided firewall rules match the expected rules\n    if set(firewall_rules) == set(expected_rules):\n        return True\n    else:\n        return False\n", "entry_point": "validate_firewall_rules", "input": "'testeventhub', ['10.1.1.1/32']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23178_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003238", "code": "def count_valid_groupings(n, k):\n    c1 = n // k\n    c2 = n // (k // 2)\n    if k % 2 == 1:\n        cnt = pow(c1, 3)\n    else:\n        cnt = pow(c1, 3) + pow(c2 - c1, 3)\n    return cnt\n", "entry_point": "count_valid_groupings", "input": "15, 6", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122726_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003239", "code": "import re\ndef extract_primary_component(normalized_principal_name: str) -> str:\n    bare_principal = None\n    if normalized_principal_name:\n        match = re.match(r\"([^/@]+)(?:/[^@])?(?:@.*)?\", normalized_principal_name)\n        if match:\n            bare_principal = match.group(1)\n    return bare_principal\n", "entry_point": "extract_primary_component", "input": "'nimbus'", "output": "'nimbus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4075_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003240", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '**':\n        return num1 ** num2\n    elif operation == '*' or operation == '/':\n        return num1 * num2 if operation == '*' else num1 / num2\n    elif operation == '//' or operation == '%':\n        return num1 // num2 if operation == '//' else num1 % num2\n    elif operation == '+' or operation == '-':\n        return num1 + num2 if operation == '+' else num1 - num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'+', 1, 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63622_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003241", "code": "def count_unique_chars(input_string):\n    unique_chars = set()\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():\n            unique_chars.add(char_lower)\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'aaa!!123'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10628_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8313", "output": "{1, 3, 163, 489, 17, 2771, 51, 8313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003243", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 0, 0, 2, 3, 7, 7, 1]", "output": "[7, 1, 2, 5, 7, 12, 13, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003244", "code": "from typing import List\ndef calculate_total_time(tasks: List[int], cooldown: int) -> int:\n    last_occurrence = {}\n    time_elapsed = 0\n    for task_duration in tasks:\n        if task_duration not in last_occurrence or last_occurrence[task_duration] + cooldown <= time_elapsed:\n            time_elapsed += task_duration\n        else:\n            time_elapsed = last_occurrence[task_duration] + cooldown + task_duration\n        last_occurrence[task_duration] = time_elapsed\n    return time_elapsed\n", "entry_point": "calculate_total_time", "input": "[10], 0", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98461_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003245", "code": "from typing import List\ndef modified_binary_search(arr: List[int], target: int) -> int:\n    low, high = 0, len(arr) - 1\n    result = -1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            result = mid\n            high = mid - 1\n    return result\n", "entry_point": "modified_binary_search", "input": "[1, 2, 3, 4], 5", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97045_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003246", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "5, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003247", "code": "import re\ndef extract_image_urls(html_content):\n    image_urls = set()\n    # Find image URLs in Markdown syntax ![alt text](image_url)\n    markdown_images = re.findall(r'!\\[([^\\]]+)?\\]\\(([^\\)]+)\\)', html_content)\n    image_urls.update(url for alt, url in markdown_images)\n    # Find image URLs in HTML image tags <img src=\"image_url\" alt=\"alt text\">\n    html_images = re.findall(r'<\\s*img[^>]+>\\s*src\\s*=\\\"([^\"]+)\\\"', html_content)\n    image_urls.update(html_images)\n    # Find image URLs in custom format web+graphie:https://example.com/custom_image.png\n    custom_images = re.findall(r'web\\+graphie:([^\\)]+)', html_content)\n    image_urls.update(custom_images)\n    return list(image_urls)\n", "entry_point": "extract_image_urls", "input": "'![alt text](nn)'", "output": "['nn']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51962_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003248", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'XX', 'ME'", "output": "'Invalid status code: XX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003249", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'R'", "output": "(1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003250", "code": "def check_nested_parentheses(input_string: str) -> bool:\n    stack = []\n    opening = '({['\n    closing = ')}]'\n    matching = {')': '(', '}': '{', ']': '['}\n    for char in input_string:\n        if char in opening:\n            stack.append(char)\n        elif char in closing:\n            if not stack or stack[-1] != matching[char]:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "check_nested_parentheses", "input": "'(a + b) * (c - d)'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113585_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003251", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'Hello.'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3138", "output": "{1, 3138, 3, 2, 1569, 6, 523, 1046}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003253", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 6, 8, 10, 4]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100839_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003254", "code": "import base64\ndef modified_unbase64(s):\n    s_utf7 = '+' + s.replace(',', '/') + '-'\n    original_bytes = s_utf7.encode('utf-7')\n    original_string = original_bytes.decode('utf-7')\n    return original_string\n", "entry_point": "modified_unbase64", "input": "'SGVsbG8sIFSGVmxkIQ=='", "output": "'+SGVsbG8sIFSGVmxkIQ==-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65108_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003255", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 15, 12, 20]", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100977_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003256", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'stify_playe'", "output": "'Stify Playe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003257", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'854119876'", "output": "'85411987622485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003258", "code": "import math\ndef is_primitive_root(n, a):\n    def euler_totient(n):\n        result = n\n        p = 2\n        while p * p <= n:\n            if n % p == 0:\n                while n % p == 0:\n                    n //= p\n                result -= result // p\n            p += 1\n        if n > 1:\n            result -= result // n\n        return result\n    phi_n = euler_totient(n)\n    for k in range(1, phi_n):\n        if pow(a, k, n) == 1:\n            if k == phi_n:\n                return True\n            else:\n                return False\n    return False\n", "entry_point": "is_primitive_root", "input": "8, 2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149599_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003259", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'ddav_v10.'", "output": "'ddav_v11.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003260", "code": "def calculate_scores(scores):\n    n = len(scores)\n    calculated_scores = []\n    for i in range(n):\n        if i == 0:\n            new_score = scores[i] + scores[i + 1]\n        elif i == n - 1:\n            new_score = scores[i] + scores[i - 1]\n        else:\n            new_score = scores[i - 1] + scores[i] + scores[i + 1]\n        calculated_scores.append(new_score)\n    return calculated_scores\n", "entry_point": "calculate_scores", "input": "[5, 5, 7, 5, 8, 5, 8]", "output": "[10, 17, 17, 20, 18, 21, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90567_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003261", "code": "def remove_min_parentheses(s):\n    if not s:\n        return \"\"\n    s = list(s)\n    stack = []\n    for i, char in enumerate(s):\n        if char == \"(\":\n            stack.append(i)\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                s[i] = \"\"\n    while stack:\n        s[stack.pop()] = \"\"\n    return \"\".join(s)\n", "entry_point": "remove_min_parentheses", "input": "'((('", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35267_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003262", "code": "from typing import Dict, List, Tuple\ndef parse_labelframe_options(input_str: str) -> Tuple[Dict[str, List[str]], Dict[str, List[str]]]:\n    standard_options = {}\n    widget_specific_options = {}\n    current_section = None\n    for line in input_str.split('\\n'):\n        line = line.strip()\n        if line.startswith('STANDARD OPTIONS'):\n            current_section = standard_options\n        elif line.startswith('WIDGET-SPECIFIC OPTIONS'):\n            current_section = widget_specific_options\n        elif line and current_section is not None:\n            option_name, *values = [value.strip() for value in line.split(',')]\n            current_section[option_name] = values\n    return standard_options, widget_specific_options\n", "entry_point": "parse_labelframe_options", "input": "''", "output": "({}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73075_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003263", "code": "# Function to parse the Chinese character code and return its pinyin pronunciation\ndef parse_hanzi(code):\n    pinyin_dict = {\n        'U+4E00': 'y\u012b',\n        'U+4E8C': '\u00e8r',\n        'U+4E09': 's\u0101n',\n        'U+4E5D': 'ji\u01d4'\n        # Add more mappings as needed\n    }\n    alternate_dict = {\n        'U+4E00': {'pinyin': 'y\u012b', 'code': '4E00'},\n        'U+4E8C': {'pinyin': '\u00e8r', 'code': '4E8C'},\n        'U+4E09': {'pinyin': 's\u0101n', 'code': '4E09'},\n        'U+4E5D': {'pinyin': 'ji\u01d4', 'code': '4E5D'}\n        # Add more alternate mappings as needed\n    }\n    pinyin = pinyin_dict.get(code)\n    if not pinyin:\n        alternate = alternate_dict.get(code)\n        if alternate:\n            pinyin = alternate['pinyin']\n            extra = '  => U+{0}'.format(alternate['code'])\n            if ',' in pinyin:\n                first_pinyin, extra_pinyin = pinyin.split(',', 1)\n                pinyin = first_pinyin\n                extra += '  ?-> ' + extra_pinyin\n        else:\n            pinyin = 'Pinyin not available'\n    return pinyin\n", "entry_point": "parse_hanzi", "input": "'U+0000'", "output": "'Pinyin not available'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30788_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003264", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 82.25]", "output": "85.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003265", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) < 2:\n        return 0\n    numbers.remove(max(numbers))\n    numbers.remove(min(numbers))\n    if len(numbers) == 0:\n        return 0\n    average = sum(numbers) / len(numbers)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 2, 3, 4]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122319_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003266", "code": "import re\ndef extract_installer_tasks(input_str):\n    tasks = []\n    current_task = None\n    for line in input_str.split('\\n'):\n        if line.startswith('- name:'):\n            current_task = line.split(': ', 1)[1]\n        elif 'tateru.deploy.installer_address' in line:\n            if current_task:\n                tasks.append(current_task)\n    return tasks\n", "entry_point": "extract_installer_tasks", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41954_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003267", "code": "def evaluate_expression(expression):\n    try:\n        result = eval(expression)\n        return result\n    except ZeroDivisionError:\n        return \"Error: Division by zero\"\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "evaluate_expression", "input": "')1 + 2'", "output": "\"Error: unmatched ')' (<string>, line 1)\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79055_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003268", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[6, 0, 7, 6, 39, 7, 7, 6]", "output": "[6, 0, 7, 6, 39, 7, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003269", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 22]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7411", "output": "{1, 7411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003271", "code": "from typing import List, Union, Any\ndef count_unique_elements(input_list: List[Union[int, Any]]) -> int:\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_elements", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003272", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'sotier'", "output": "'Sotier'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003273", "code": "def can_interleave(s1, s2, s3):\n    m, n = len(s1), len(s2)\n    if m + n != len(s3):\n        return False\n    f = [[False] * (n + 1) for _ in range(m + 1)]\n    f[0][0] = True\n    for i in range(m + 1):\n        for j in range(n + 1):\n            if i > 0:\n                f[i][j] |= f[i-1][j] and s1[i-1] == s3[i+j-1]\n            if j > 0:\n                f[i][j] |= f[i][j-1] and s2[j-1] == s3[i+j-1]\n    return f[m][n]\n", "entry_point": "can_interleave", "input": "'abc', 'def', 'abcdefx'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120375_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003274", "code": "def process_subject_list(subject_list):\n    subject_dict = {}\n    for filename in subject_list:\n        subject_number = int(filename.split('_')[1])  # Extract subject number from filename\n        if subject_number in subject_dict:\n            subject_dict[subject_number].append(filename)\n        else:\n            subject_dict[subject_number] = [filename]\n    return subject_dict\n", "entry_point": "process_subject_list", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15296_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003275", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[4, 4, 0]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136278_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003276", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[7, 11, 19]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19002_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003277", "code": "def count_unique_divisible(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0 and num not in unique_divisible_numbers:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible", "input": "[1, 2, 4, 5], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121992_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003278", "code": "def find_lowest(lst):\n    lowest_positive = None\n    for num in lst:\n        if num > 0:\n            if lowest_positive is None or num < lowest_positive:\n                lowest_positive = num\n    return lowest_positive\n", "entry_point": "find_lowest", "input": "[3, 5, 10]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112303_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003279", "code": "def sum_of_squares(lst):\n    sum_squares = 0\n    for num in lst:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[7]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36660_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003280", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[80, 81, 81, 82]", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18435_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003281", "code": "import re\ndef extract_modules(file_content):\n    module_names = set()\n    pattern = r\"from\\s+\\.\\w+\\s+import\\s+(\\w+)\"\n    for line in file_content.split('\\n'):\n        match = re.search(pattern, line)\n        if match:\n            module_names.add(match.group(1) + '.py')\n    return sorted(module_names)\n", "entry_point": "extract_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39898_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6046", "output": "{1, 2, 6046, 3023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6045", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003283", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "147", "output": "{1, 3, 7, 49, 147, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3613", "output": "{1, 3613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003285", "code": "def find_shortest_path(grid):\n    def is_valid_move(row, col):\n        return 0 <= row < len(grid) and 0 <= col < len(grid[0]) and grid[row][col] == 0\n    def backtrack_path(parents, target):\n        path = []\n        while target in parents:\n            path.insert(0, target)\n            target = parents[target]\n        return path\n    start = None\n    target = None\n    for i in range(len(grid)):\n        for j in range(len(grid[0])):\n            if grid[i][j] == 'S':\n                start = (i, j)\n            elif grid[i][j] == 'T':\n                target = (i, j)\n    if not start or not target:\n        return []\n    queue = [start]\n    visited = set()\n    parents = {}\n    while queue:\n        current = queue.pop(0)\n        if current == target:\n            return backtrack_path(parents, target)\n        visited.add(current)\n        row, col = current\n        for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n            new_row, new_col = row + dr, col + dc\n            if is_valid_move(new_row, new_col) and (new_row, new_col) not in visited:\n                queue.append((new_row, new_col))\n                parents[(new_row, new_col)] = current\n    return []\n", "entry_point": "find_shortest_path", "input": "[[1, 1, 1], [1, 'S', 1], [1, 1, 1], [1, 'T', 1]]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51279_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003286", "code": "def is_happy(n):\n    seen = set()\n    while n not in seen:\n        seen.add(n)\n        new_n = 0\n        for char in str(n):\n            new_n += int(char) ** 2\n        n = new_n\n    return n == 1\n", "entry_point": "is_happy", "input": "4", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52737_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003287", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 10, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123355_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003288", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 3, 3, 5, 5]", "output": "[1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003289", "code": "def sum_multiples_3_5(numbers):\n    result = 0\n    seen_multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in seen_multiples:\n                result += num\n                seen_multiples.add(num)\n    return result\n", "entry_point": "sum_multiples_3_5", "input": "[3, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69539_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "975", "output": "{1, 65, 3, 195, 5, 325, 39, 75, 13, 975, 15, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt974", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003291", "code": "from typing import List\ndef extract_packages(module_names: List[str]) -> List[str]:\n    unique_packages = set()\n    for module_name in module_names:\n        parts = module_name.split('.')\n        if len(parts) >= 2:  # Ensure the correct format of package.subpackage.module\n            unique_packages.add('.'.join(parts[:2]))\n    return sorted(list(unique_packages))\n", "entry_point": "extract_packages", "input": "['']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71196_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003292", "code": "import re\ndef extractEmails(text):\n    emails = []\n    for c in [\"'\", \"[\", \"]\", \"\\\"\", \"(\", \")\", \"/\", \":\", \";\", \"\\\"\", \",\"]:\n        text = text.replace(c, \" \")\n    for s in text.split():\n        if \"@\" in s and s.count(\"@\") == 1:\n            local, domain = s.split(\"@\")\n            if re.match(r'^[a-zA-Z0-9._-]+$', local) and re.match(r'^[a-zA-Z0-9.]+$', domain) and re.match(r'\\.[a-zA-Z]{2,}$', domain):\n                emails.append(s)\n    return emails\n", "entry_point": "extractEmails", "input": "'Hello, this is a test message without any emails.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120427_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003293", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[2, 2, 4, 4, 6, 3]", "output": "[6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003294", "code": "from collections import defaultdict\ndef find_original_song(alias):\n    music_aliases = {\n        'alias1': ['song1', 'song2'],\n        'alias2': ['song3']\n    }\n    original_songs = music_aliases.get(alias.lower(), [])\n    if original_songs:\n        return original_songs[0]\n    else:\n        return \"Alias not found\"\n", "entry_point": "find_original_song", "input": "'UnknownAlias'", "output": "'Alias not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5621_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1779", "output": "{3, 1, 1779, 593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003296", "code": "def find_lcs_length(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length", "input": "'a', 'xay'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102514_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003297", "code": "def count_digits(n):\n    count = 0\n    while n != 0:\n        count += 1\n        n = n // 10\n    return count\n", "entry_point": "count_digits", "input": "12345", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4667_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003298", "code": "def decrypt(encryptedText, key):\n    decryptedText = \"\"\n    key = key.lower().replace('\u0130', 'i')\n    encryptedText = encryptedText.lower()\n    i = 0\n    while i < len(encryptedText):\n        char = ord(encryptedText[i])\n        charOfKey = ord(key[i % len(key)])\n        if char >= 97 and char <= 122 and charOfKey >= 97 and charOfKey <= 122:\n            decryptedText += chr((char - charOfKey + 26) % 26 + 97)\n        else:\n            decryptedText += chr(char)\n        i += 1\n    return decryptedText\n", "entry_point": "decrypt", "input": "'mj', 'a'", "output": "'mj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70304_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1072", "output": "{1, 2, 67, 4, 134, 8, 268, 1072, 16, 536}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1071", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003300", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2026", "output": "{1, 2026, 2, 1013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003301", "code": "EXCHANGES = ['binance', 'binanceus', 'coinbasepro', 'kraken']\nEXCHANGE_NAMES = ['Binance', 'Binance US', 'Coinbase Pro', 'Kraken']\nINTERVALS = ['1m', '5m', '15m', '30m', '1h', '12h', '1d']\ndef execute_trade(exchange_index, interval_index, trade_amount):\n    exchange_name = EXCHANGE_NAMES[exchange_index]\n    interval = INTERVALS[interval_index]\n    return f\"Trading {trade_amount} BTC on {exchange_name} at {interval} interval.\"\n", "entry_point": "execute_trade", "input": "3, 1, 1.05", "output": "'Trading 1.05 BTC on Kraken at 5m interval.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52795_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "93", "output": "{1, 3, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt92", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003303", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[-2, 3, 6]", "output": "-36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003304", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6014", "output": "{1, 2, 194, 97, 62, 3007, 6014, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6013", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003305", "code": "def card_war_winner(N, deck1, deck2):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    if player1_points > player2_points:\n        return \"Player 1\"\n    elif player2_points > player1_points:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "card_war_winner", "input": "5, [1, 3, 5, 5, 6], [2, 4, 8, 7, 9]", "output": "'Player 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20743_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003306", "code": "def validate_pattern(pattern: str, input_str: str) -> bool:\n    if len(pattern) != len(input_str):\n        return False\n    for p_char, i_char in zip(pattern, input_str):\n        if p_char.isalpha():\n            if not i_char.isalpha():\n                return False\n        elif p_char.isdigit():\n            if not i_char.isdigit():\n                return False\n        else:\n            return False\n    return True\n", "entry_point": "validate_pattern", "input": "'abc', 'xyz'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96321_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003307", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "794.1, 1", "output": "794.0875", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003308", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 4]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19002_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003309", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'key1=va1'", "output": "{'key1': 'va1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003310", "code": "def generate_unique_table_name(existing_table_names):\n    numeric_suffixes = [int(name.split(\"_\")[-1]) for name in existing_table_names]\n    unique_suffix = 1\n    while unique_suffix in numeric_suffixes:\n        unique_suffix += 1\n    return f\"table_name_{unique_suffix}\"\n", "entry_point": "generate_unique_table_name", "input": "[]", "output": "'table_name_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94699_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003311", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "1, -7", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003312", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[9, 3, 8, 2, 9, 3, 8]", "output": "[9, 3, 8, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003313", "code": "def simulate_card_game(num_rounds, deck_a, deck_b):\n    wins_a = 0\n    wins_b = 0\n    for i in range(num_rounds):\n        if deck_a[i] > deck_b[i]:\n            wins_a += 1\n        elif deck_a[i] < deck_b[i]:\n            wins_b += 1\n    return (wins_a, wins_b)\n", "entry_point": "simulate_card_game", "input": "2, [1, 2], [2, 2]", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106558_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003314", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[0, -1, 5, 2, 0, 1, 5]", "output": "[-1, 6, -3, -2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003315", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7747", "output": "{1, 7747, 61, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003316", "code": "def reconstruct_string(char_counts):\n    char_map = {chr(ord('a') + i): count for i, count in enumerate(char_counts)}\n    sorted_char_map = dict(sorted(char_map.items(), key=lambda x: x[1]))\n    result = ''\n    for char, count in sorted_char_map.items():\n        result += char * count\n    return result\n", "entry_point": "reconstruct_string", "input": "[0, 3, 3, 3, 1, 3, 3] + [0] * 19", "output": "'ebbbcccdddfffggg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66252_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003317", "code": "def calculate_sum_of_digits(port, connection_key):\n    total_sum = 0\n    for digit in str(port) + str(connection_key):\n        total_sum += int(digit)\n    return total_sum\n", "entry_point": "calculate_sum_of_digits", "input": "1999, 1", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102611_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003318", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'TeTxt*#'", "output": "'TeTxt*#\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003319", "code": "def exponential_moving_average(data, alpha):\n    ema_values = [data[0]]  # Initialize with the first data point\n    for i in range(1, len(data)):\n        ema = (alpha * data[i]) + ((1 - alpha) * ema_values[-1])\n        ema_values.append(ema)\n    return ema_values\n", "entry_point": "exponential_moving_average", "input": "[10, 15, 20, 25, 30], 0.5", "output": "[10, 12.5, 16.25, 20.625, 25.3125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27790_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003320", "code": "from typing import List\ndef custom_regex(pattern: str, source: str) -> List[str]:\n    def match(p_idx, s_idx):\n        if p_idx == len(pattern):\n            return [\"\"]\n        if s_idx == len(source):\n            return []\n        matches = []\n        if p_idx + 1 < len(pattern) and pattern[p_idx + 1] == '*':\n            if pattern[p_idx] == '.' or pattern[p_idx] == source[s_idx]:\n                matches += match(p_idx, s_idx + 1)\n            matches += match(p_idx + 2, s_idx)\n        elif pattern[p_idx] == '.' or pattern[p_idx] == source[s_idx]:\n            matches += [source[s_idx] + m for m in match(p_idx + 1, s_idx + 1)]\n        return matches\n    return match(0, 0)\n", "entry_point": "custom_regex", "input": "'abc', 'xyz'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123049_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003321", "code": "def sum_of_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[10, 8, 20]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148789_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003322", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'1.2.9'", "output": "'1.3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003323", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8423", "output": "{1, 8423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003324", "code": "def get_substrings(s):\n    substrings = []\n    n = len(s)\n    for i in range(n):\n        for j in range(i, n):\n            substrings.append(s[i:j+1])\n    return substrings\n", "entry_point": "get_substrings", "input": "'abc'", "output": "['a', 'ab', 'abc', 'b', 'bc', 'c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80417_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5231", "output": "{1, 5231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003326", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "8, 9", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003327", "code": "def check_parentheses(expression):\n    stack = []\n    for char in expression:\n        if char == '(':\n            stack.append('(')\n        elif char == ')':\n            if not stack:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "check_parentheses", "input": "'()'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6582_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003328", "code": "def count_pairs_with_difference(nums, k):\n    count = 0\n    num_set = set(nums)\n    for num in nums:\n        if num + k in num_set or num - k in num_set:\n            count += 1\n    return count\n", "entry_point": "count_pairs_with_difference", "input": "[1, 2, 3, 4, 5, 3, 2], 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1892_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003329", "code": "def polygon_area(vertices):\n    n = len(vertices)\n    area = 0\n    for i in range(n):\n        j = (i + 1) % n\n        area += vertices[i][0] * vertices[j][1]\n        area -= vertices[j][0] * vertices[i][1]\n    area = abs(area) / 2\n    return area\n", "entry_point": "polygon_area", "input": "[(0, 0), (4, 0), (4, 3), (0, 3)]", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86518_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003330", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "'    '", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8483", "output": "{1, 8483, 17, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003332", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[70, 67, 66, 65, 64, 64, 62], 7", "output": "65.42857142857143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52376_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003333", "code": "def custom_find(main_str, sub_str):\n    for i in range(len(main_str) - len(sub_str) + 1):\n        if main_str[i:i + len(sub_str)] == sub_str:\n            return i\n    return -1\n", "entry_point": "custom_find", "input": "'hello', 'hello'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145848_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6595", "output": "{1, 6595, 5, 1319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003335", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[2, 4, 2, 4, 2, 4, 6]", "output": "[2, 2, 2, 4, 4, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003336", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-8, 3", "output": "-512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt72", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003337", "code": "def calculate_string_difference(str1, str2):\n    len1, len2 = len(str1), len(str2)\n    max_len = max(len1, len2)\n    diff_count = 0\n    for i in range(max_len):\n        char1 = str1[i] if i < len1 else None\n        char2 = str2[i] if i < len2 else None\n        if char1 != char2:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_string_difference", "input": "'abcdefghij', '1234567890'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32682_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003338", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[-1, 1, 5, 6, 2, 2]", "output": "[-1, 1, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003339", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'my_d', '**'", "output": "'my_d_**'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003340", "code": "def sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "10", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60427_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003341", "code": "def detect_circular_reference(graph):\n    def dfs(node, visited, current_path):\n        visited.add(node)\n        current_path.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor in current_path or (neighbor not in visited and dfs(neighbor, visited, current_path)):\n                return True\n        current_path.remove(node)\n        return False\n    visited = set()\n    for node in graph:\n        if node not in visited and dfs(node, visited, set()):\n            return True\n    return False\n", "entry_point": "detect_circular_reference", "input": "{'a': ['b'], 'b': ['c'], 'c': ['a']}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116111_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8825", "output": "{1, 353, 5, 1765, 8825, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003343", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '13:30:45'", "output": "5445", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003344", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[4, -1]", "output": "{4: 1, -1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003345", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1g.3g1.22-gdf812281'", "output": "'1g.3g1.22+gdf812281'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003346", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[], 1", "output": "'invalid'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1949", "output": "{1, 1949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003348", "code": "def sum_greater_than_average(arr):\n    if not arr:\n        return 0\n    avg = sum(arr) / len(arr)\n    filtered_elements = [num for num in arr if num > avg]\n    return sum(filtered_elements)\n", "entry_point": "sum_greater_than_average", "input": "[4, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30094_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003349", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[34, 36, 12, 14, 11, 34, 64]", "output": "[11, 12, 14, 34, 34, 36, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003350", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "11, 11", "output": "380.1327110843649", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003351", "code": "def parse_gunicorn_config(config_snippet):\n    config_dict = {}\n    for line in config_snippet.split('\\n'):\n        line = line.strip()\n        if not line.startswith('#') and '=' in line:\n            key, value = map(str.strip, line.split('='))\n            config_dict[key] = eval(value) if value.startswith('[') or value.startswith('\"') else value\n    return config_dict\n", "entry_point": "parse_gunicorn_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135845_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003352", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins!\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "simulate_card_game", "input": "[1, 3, 2], [2, 4, 3]", "output": "'Player 2 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41111_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003353", "code": "def custom_sed(file_path, old_text, new_text):\n    try:\n        with open(file_path, 'r') as file:\n            content = file.read()\n            modified_content = content.replace(old_text, new_text)\n        with open(file_path, 'w') as file:\n            file.write(modified_content)\n        return True\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return False\n", "entry_point": "custom_sed", "input": "'/path/to/nonexistent/file.txt', 'old_text', 'new_text'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132958_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003354", "code": "def check_token(token):\n    # Check if the token is a string and has a length of 32 characters\n    if not isinstance(token, str) or len(token) != 32:\n        return False\n    # Verify if the token contains only alphanumeric characters\n    if not token.isalnum():\n        return False\n    return True\n", "entry_point": "check_token", "input": "12345", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132002_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003355", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'1011110111'", "output": "759", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003356", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "19, 20", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2617", "output": "{1, 2617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003358", "code": "from math import acos, degrees\ndef find_triangle_angles(a, b, c):\n    if a + b > c and b + c > a and a + c > b:  # Triangle inequality theorem check\n        first_angle = round(degrees(acos((b ** 2 + c ** 2 - a ** 2) / (2 * b * c))))\n        second_angle = round(degrees(acos((a ** 2 + c ** 2 - b ** 2) / (2 * a * c))))\n        third_angle = 180 - first_angle - second_angle\n        return sorted([first_angle, second_angle, third_angle])\n    else:\n        return None\n", "entry_point": "find_triangle_angles", "input": "0.2588, 0.7986, 0.9272", "output": "[15, 53, 112]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40430_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003359", "code": "import os\nextensions = ['jpg', 'jpeg', 'png', 'ico', 'bmp', 'tiff', 'pnm']\ndef find_image_files(directory_path):\n    image_files = []\n    for root, dirs, files in os.walk(directory_path):\n        for file in files:\n            if any(file.lower().endswith(ext) for ext in extensions):\n                image_files.append(os.path.join(root, file))\n    return image_files\n", "entry_point": "find_image_files", "input": "'/path/to/empty_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120883_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003360", "code": "def custom_pad4(s, char):\n    padding_needed = 4 - (len(s) % 4)\n    padded_string = s + char * padding_needed\n    return padded_string\n", "entry_point": "custom_pad4", "input": "'Hello', '*'", "output": "'Hello***'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132634_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003361", "code": "def validate_fen(fen: str) -> bool:\n    components = fen.split()\n    if len(components) != 6:\n        return False\n    board_state, turn, castling, en_passant, halfmove, fullmove = components\n    if not all(c.isalnum() for c in board_state):\n        return False\n    if turn not in ['w', 'b']:\n        return False\n    if castling not in ['KQkq', '-']:\n        return False\n    if en_passant != '-' and (len(en_passant) != 2 or not en_passant[1].isdigit()):\n        return False\n    if not halfmove.isdigit() or not fullmove.isdigit():\n        return False\n    return True\n", "entry_point": "validate_fen", "input": "'rnbqkb1r/pppppppp/8/8/8 w KQkq - 0 1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124184_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003362", "code": "def generate_unique_engine_name(existing_engine_names):\n    existing_numbers = set()\n    for name in existing_engine_names:\n        if name.startswith(\"engine\"):\n            try:\n                num = int(name[6:])  # Extract the number part after \"engine\"\n                existing_numbers.add(num)\n            except ValueError:\n                pass  # Ignore if the number part is not an integer\n    new_num = 1\n    while new_num in existing_numbers:\n        new_num += 1\n    return f\"engine{new_num}\"\n", "entry_point": "generate_unique_engine_name", "input": "['engine1', 'engine2']", "output": "'engine3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120274_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003363", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'very_long_climit'", "output": "'very_long_climit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003364", "code": "def is_one_edit_distance_apart(s, t):\n    if abs(len(s) - len(t)) > 1:\n        return False\n    if len(s) < len(t):\n        s, t = t, s\n    mismatch_found = False\n    i = j = 0\n    while i < len(s) and j < len(t):\n        if s[i] != t[j]:\n            if mismatch_found:\n                return False\n            mismatch_found = True\n            if len(s) == len(t):\n                j += 1\n        else:\n            j += 1\n        i += 1\n    return mismatch_found or len(s) > len(t)\n", "entry_point": "is_one_edit_distance_apart", "input": "'abc', 'de'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3753_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003365", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[3, 3, 2, 4, 4, 1, 5, 6]", "output": "{3: 2, 2: 1, 4: 2, 1: 1, 5: 1, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003366", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "3", "output": "'https://www.kaiheila.cn/api/v3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003367", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 8, -2, 1]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20256_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003368", "code": "def convert_attribute_name(original_name):\n    attribute_map = {\n        'api_version': 'apiVersion',\n        'authorization': 'authorization',\n        'bearer_token_file': 'bearerTokenFile',\n        'name': 'name',\n        'namespace': 'namespace',\n        'path_prefix': 'pathPrefix',\n        'port': 'port',\n        'scheme': 'scheme',\n        'timeout': 'timeout',\n        'tls_config': 'tlsConfig'\n    }\n    return attribute_map.get(original_name, 'Not Found')\n", "entry_point": "convert_attribute_name", "input": "'missing_attribute'", "output": "'Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120015_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003369", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[88, 85, 78, 70]", "output": "[88, 85, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003370", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4843", "output": "{1, 4843, 29, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003371", "code": "def filter_staff_by_risk_score(staff_list, threshold):\n    filtered_staff = [staff for staff in staff_list if staff.get('risk_score', 0) >= threshold]\n    return filtered_staff\n", "entry_point": "filter_staff_by_risk_score", "input": "[{'name': 'Alice'}, {'name': 'Bob'}, {'name': 'Charlie'}], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102602_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003372", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "'fof'", "output": "'Fof'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003373", "code": "from functools import reduce\nfrom operator import add\ndef calculate_sum(int_list):\n    # Using reduce with the add operator to calculate the sum\n    total_sum = reduce(add, int_list)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[10, 19]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003374", "code": "from typing import Iterable\ndef target_matches_any(target: str, expected_targets: Iterable[str]) -> bool:\n    if target == \"*\":\n        return True\n    for expected in expected_targets:\n        if target == expected or expected == \"*\":\n            return True\n    return False\n", "entry_point": "target_matches_any", "input": "'apple', ['banana', 'apple']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003375", "code": "def birthday(array, day, month):\n    count = 0\n    window_sum = 0\n    window_start = 0\n    for i in range(len(array)):\n        window_sum += array[i]\n        if i >= month - 1:\n            if window_sum == day:\n                count += 1\n            window_sum -= array[window_start]\n            window_start += 1\n    return count\n", "entry_point": "birthday", "input": "[1, 1], 5, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17123_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003376", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "59.80319000000001, 5.0", "output": "54.80319000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003377", "code": "def parse_django_config(input_string):\n    config_dict = {}\n    for line in input_string.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip().strip(\"'\")\n    return config_dict\n", "entry_point": "parse_django_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61841_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1655", "output": "{1, 331, 5, 1655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1654", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003379", "code": "def filter_flavors(flavors, keyword):\n    filtered_flavors = []\n    for flavor in flavors:\n        if keyword in flavor:\n            filtered_flavors.append(flavor)\n    return filtered_flavors\n", "entry_point": "filter_flavors", "input": "[], 'any_keyword'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2910_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003380", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "332", "output": "{1, 2, 4, 166, 332, 83}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt331", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003381", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 6, 8, 8, 8, 5, 5, 9]", "output": "[4, 6, 8, 8, 8, 25, 25, 81]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003382", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[1, 1, 2, 2, 3, 3]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003383", "code": "def elementwise_multiply(list1, list2):\n    if len(list1) != len(list2):\n        return []\n    result = []\n    for i in range(len(list1)):\n        result.append(list1[i] * list2[i])\n    return result\n", "entry_point": "elementwise_multiply", "input": "[], [1, 2, 3]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118879_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003384", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    rounded_average = round(average, 2)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[90.0, 90.0, 90.99]", "output": "90.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111776_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003385", "code": "import itertools\ndef generate_permutations(input_str):\n    # Generate all permutations of the input string\n    perms = itertools.permutations(input_str)\n    # Convert permutations to a list of strings\n    perm_list = [''.join(perm) for perm in perms]\n    return perm_list\n", "entry_point": "generate_permutations", "input": "'abc'", "output": "['abc', 'acb', 'bac', 'bca', 'cab', 'cba']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30268_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003386", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "23, 'mode', 1", "output": "{'response': 'InvalidPin', 'pin': 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003387", "code": "import keyword\ndef is_valid_name(ident: str) -> bool:\n    '''Determine if ident is a valid register or bitfield name.'''\n    if not isinstance(ident, str):\n        raise TypeError(\"expected str, but got {!r}\".format(type(ident)))\n    if not ident.isidentifier():\n        return False\n    if keyword.iskeyword(ident):\n        return False\n    return True\n", "entry_point": "is_valid_name", "input": "'if'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17950_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003388", "code": "def find_lcs_length_optimized(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length_optimized", "input": "'AGGTAB', 'GXTXAYB'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28396_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003389", "code": "def latex_to_mathjax(command_type, latex_expression):\n    if command_type == 'ce':\n        return f'${latex_expression}$'\n    elif command_type == 'pu':\n        return f'${latex_expression}$${latex_expression}$'\n    else:\n        return 'Invalid command type'\n", "entry_point": "latex_to_mathjax", "input": "'invalid', 'some_expression'", "output": "'Invalid command type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11235_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003390", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'abcdef', 'ghijkl'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42819_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003391", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "[6.25, 13.125, 21], 5", "output": "(1.25, 2.625, 21)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003392", "code": "def min_abs_diff_subset(nums, goal):\n    n = len(nums)\n    result = float('inf')\n    for mask in range(1 << n):\n        subset_sum = 0\n        for i in range(n):\n            if mask & (1 << i):\n                subset_sum += nums[i]\n        result = min(result, abs(goal - subset_sum))\n    return result\n", "entry_point": "min_abs_diff_subset", "input": "[3, 4, 5], 7", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90984_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003393", "code": "def parse_command(command):\n    parts = command.split()\n    if len(parts) < 3:\n        return \"Invalid command\"\n    operation = parts[0]\n    num1 = float(parts[1])\n    num2 = float(parts[2])\n    if operation == 'add':\n        return num1 + num2\n    elif operation == 'subtract':\n        return num1 - num2\n    elif operation == 'multiply':\n        return num1 * num2\n    elif operation == 'divide':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Division by zero is not allowed\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "parse_command", "input": "'add 2.0 4.0'", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24855_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003394", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'rcluster', 'cluster'", "output": "\"Provider submodule 'rcluster' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003395", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4461", "output": "{1, 3, 4461, 1487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6323", "output": "{1, 6323}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003397", "code": "def authenticate(client_secret: str) -> str:\n    if client_secret.endswith('-invalid'):\n        raise Exception(\"Incorrect credentials provided\")\n    return 'access-token'\n", "entry_point": "authenticate", "input": "'my-secret-key'", "output": "'access-token'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22916_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003398", "code": "def generate_fibonacci(limit):\n    fibonacci_numbers = [0, 1]\n    while True:\n        next_fibonacci = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        if next_fibonacci <= limit:\n            fibonacci_numbers.append(next_fibonacci)\n        else:\n            break\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci", "input": "5", "output": "[0, 1, 1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43932_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003399", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[70.0, 71.0, 72.0, 72.5]", "output": "71.375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21931_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003400", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "881", "output": "{1, 881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003402", "code": "def alphabet_positions(input_string):\n    positions = {}\n    for char in input_string:\n        if char.isalpha() and char.islower():\n            positions[char] = ord(char) - ord('a') + 1\n    return positions\n", "entry_point": "alphabet_positions", "input": "'hello'", "output": "{'h': 8, 'e': 5, 'l': 12, 'o': 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73805_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2841", "output": "{1, 3, 947, 2841}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2840", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003404", "code": "def calculate_range(data):\n    if not data:\n        return None  # Handle empty dataset\n    min_val = max_val = data[0]  # Initialize min and max values\n    for num in data[1:]:\n        if num < min_val:\n            min_val = num\n        elif num > max_val:\n            max_val = num\n    return max_val - min_val\n", "entry_point": "calculate_range", "input": "[0, 12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21170_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003405", "code": "def custom_word_frequency(sentence: str, custom_punctuation: str) -> dict:\n    sentence = sentence.lower()\n    words = {}\n    for s in custom_punctuation:\n        sentence = sentence.replace(s, ' ')\n    for w in sentence.split():\n        if w.endswith('\\''):\n            w = w[:-1]\n        if w.startswith('\\''):\n            w = w[1:]\n        words[w] = words.get(w, 0) + 1\n    return words\n", "entry_point": "custom_word_frequency", "input": "'belworlhelbeautifulld', ''", "output": "{'belworlhelbeautifulld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9164_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003406", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9465", "output": "{1, 3, 5, 1893, 15, 3155, 631, 9465}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003407", "code": "def simulate_card_game(deck):\n    set_aside = []\n    while len(deck) > 1:\n        set_aside.append(deck.pop(0))\n        deck.append(deck.pop(0))\n    set_aside.append(deck[0])\n    return set_aside\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5]", "output": "[1, 3, 5, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15766_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003408", "code": "def calculate_video_duration(fps, total_frames):\n    total_duration = total_frames / fps\n    return round(total_duration, 2)\n", "entry_point": "calculate_video_duration", "input": "30, 978", "output": "32.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131697_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003409", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[4, 6]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111856_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003410", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['* 3'], 10", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003411", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "12, 10, 16", "output": "(0, 6, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003412", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[5, 6, 7, 8, 7, 8, 7, 8, 6, 7], 6", "output": "[7, 8, 7, 8, 7, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003413", "code": "import re\ndef extract_project_details(code_snippet: str) -> dict:\n    details = {}\n    url_match = re.search(r'__url__ = \"(.*?)\"', code_snippet)\n    git_version_match = re.search(r'__git_version__ = \"(.*?)\"', code_snippet)\n    version_match = re.search(r'__version__ = \"(.*?)\"', code_snippet)\n    install_dir_match = re.search(r'__install_dir__ = P\\(\"(.*?)\"\\)', code_snippet)\n    if url_match:\n        details['URL'] = url_match.group(1)\n    if git_version_match:\n        details['Git Version'] = git_version_match.group(1)\n    if version_match:\n        details['Project Version'] = version_match.group(1)\n    if install_dir_match:\n        details['Installation Directory'] = install_dir_match.group(1)\n    return details\n", "entry_point": "extract_project_details", "input": "'Some random text without any parameters.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120480_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003414", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[85, 85, 76, 76, 72, 70, 60, 50]", "output": "[85, 76, 72]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003415", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[6, 6, 6, 1, 2], 3", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003416", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate the average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average) if average.is_integer() else round(average)\n", "entry_point": "calculate_average", "input": "[80, 88, 90]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63511_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003417", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'ABLMNOPQRST'", "output": "'ABLMNOPQRST'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003418", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2630", "output": "{1, 2, 1315, 5, 2630, 263, 10, 526}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2629", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003419", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "43", "output": "{'int': '43'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003420", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[72, 101, 108, 108, 111]", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003421", "code": "def min_swaps_to_sort(nums):\n    count_1 = nums.count(1)\n    count_2 = nums.count(2)\n    count_3 = nums.count(3)\n    swaps = 0\n    for i in range(count_1):\n        if nums[i] != 1:\n            if nums[i] == 2:\n                if count_1 > 0:\n                    count_1 -= 1\n                    swaps += 1\n                else:\n                    count_3 -= 1\n                    swaps += 2\n            elif nums[i] == 3:\n                count_3 -= 1\n                swaps += 1\n    for i in range(count_1, count_1 + count_2):\n        if nums[i] != 2:\n            count_3 -= 1\n            swaps += 1\n    return swaps\n", "entry_point": "min_swaps_to_sort", "input": "[3, 2, 1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124017_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003422", "code": "def find_floor_crossing_index(parentheses):\n    floor = 0\n    for i, char in enumerate(parentheses, start=1):\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        else:\n            raise ValueError(\"Invalid character in input string\")\n        if floor == -1:\n            return i\n    return -1  # If floor never reaches -1\n", "entry_point": "find_floor_crossing_index", "input": "')'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17635_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003423", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003424", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[7, 7, 8, 7, 8, 8, 1, 7], 7", "output": "[[7, 7, 8, 7, 8, 8, 1], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003425", "code": "def has_enough_info(session: dict) -> bool:\n    # Step 1: Check if the input is a dictionary\n    if not isinstance(session, dict):\n        return False\n    # Step 2: Check for the presence of required keys\n    for expected in ['title', 'start', 'end']:\n        if expected not in session:\n            return False\n    # Step 3: All required keys are present\n    return True\n", "entry_point": "has_enough_info", "input": "{'title': 'Meeting'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40026_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5193", "output": "{1, 577, 3, 1731, 5193, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003427", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[0, 1, 2, 3, 4, 5, 6]", "output": "[0, 1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003428", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5133", "output": "{1, 3, 5133, 1711, 177, 87, 59, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003429", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'sigle-wosd'", "output": "['sigle-wosd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003430", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[97, 96, 95, 95], 4", "output": "95.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13203_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003431", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "255, 167, 0", "output": "'#FFA700'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003432", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'faz=uqx'", "output": "{'faz': 'uqx'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003433", "code": "def latest_version(versions):\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "latest_version", "input": "['1.0.0']", "output": "'1.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109733_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003434", "code": "# Define the dictionary mapping routes to HTML template file names\nroute_templates = {\n    '/manual': 'manual.html',\n    '/tracking_ijazah': 'tracking_ijazah.html',\n    '/kelas_mkdu': 'kelas_mkdu.html',\n    '/katalog_online': 'katalog_online.html',\n    '/pendaftaran_wisuda': 'pendaftaran_wisuda.html',\n    '/daftar_peserta_mata_kuliah': 'daftar_peserta_matkul.html'\n}\n# Implement the get_template function\ndef get_template(route: str) -> str:\n    return route_templates.get(route, \"Route not found\")\n", "entry_point": "get_template", "input": "'/not_a_route'", "output": "'Route not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64495_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003435", "code": "from typing import List\ndef minTime(machines: List[int], goal: int) -> int:\n    def countItems(machines, days):\n        total = 0\n        for machine in machines:\n            total += days // machine\n        return total\n    low = 1\n    high = max(machines) * goal\n    while low < high:\n        mid = (low + high) // 2\n        if countItems(machines, mid) < goal:\n            low = mid + 1\n        else:\n            high = mid\n    return low\n", "entry_point": "minTime", "input": "[3, 4, 6], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117103_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003436", "code": "import math\ndef is_prime_alternative(n):\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    max_divisor = math.isqrt(n) + 1\n    for i in range(3, max_divisor, 2):\n        if n % i == 0:\n            return False\n    return True\n", "entry_point": "is_prime_alternative", "input": "4", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92862_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003437", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[1, 1, 0]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003438", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6581", "output": "{1, 6581}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003439", "code": "from collections import Counter\ndef count_unique_keys(data):\n    keys_counter = Counter(data.keys())\n    return len(keys_counter)\n", "entry_point": "count_unique_keys", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141051_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003440", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8045", "output": "{1609, 1, 5, 8045}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8044", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003441", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "519", "output": "{1, 3, 173, 519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003442", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[28, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]", "output": "'CRLF1234567890-='", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003443", "code": "def count_reachable_empty_cells(maze):\n    def dfs(i, j):\n        if 0 <= i < len(maze) and 0 <= j < len(maze[0]) and maze[i][j] == 0 and (i, j) not in visited:\n            visited.add((i, j))\n            nonlocal result\n            result += 1\n            for dx, dy in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n                dfs(i + dx, j + dy)\n    visited = set()\n    result = 0\n    dfs(0, 0)\n    return result\n", "entry_point": "count_reachable_empty_cells", "input": "[[1]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65837_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003444", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[70, 80, 70, 90, 80]", "output": "[3, 2, 3, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003445", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'tm'", "output": "'Tm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003446", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146424_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003447", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "206", "output": "b'\\xce'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003448", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "8, 4", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003449", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[5, 3, 1, 4, 2, 5, 4]", "output": "[125, 27, 1, 16, 4, 125, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003450", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6521", "output": "{1, 6521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003451", "code": "def count_elements(input):\n    count = 0\n    for element in input:\n        if isinstance(element, list):\n            count += count_elements(element)\n        else:\n            count += 1\n    return count\n", "entry_point": "count_elements", "input": "[1, [2, 3], 4, [5]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9884_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "742", "output": "{1, 2, 742, 7, 106, 14, 371, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003453", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'tteettxt'", "output": "'<p>tteettxt</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003454", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[2, 2, 5, 6, 6, 7, 8, 8]", "output": "[2, 2, 5, 6, 6, 7, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003455", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6770", "output": "{1, 2, 5, 677, 1354, 10, 6770, 3385}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6769", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003456", "code": "def count_unique_characters(s):\n    char_count = {}\n    # Count occurrences of each character in the string\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    unique_count = 0\n    for char, count in char_count.items():\n        if count == 1:\n            unique_count += 1\n    return unique_count\n", "entry_point": "count_unique_characters", "input": "'aabbc'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45823_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003457", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4357", "output": "{1, 4357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003458", "code": "def is_isogram(string):\n    seen = set()\n    for char in string.lower():\n        if char.isalpha():\n            if char in seen:\n                return False\n            seen.add(char)\n    return True\n", "entry_point": "is_isogram", "input": "'abcdefg'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97975_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003459", "code": "def find_max_xor(L, R):\n    xor = L ^ R\n    max_xor = 1\n    while xor:\n        xor >>= 1\n        max_xor <<= 1\n    return max_xor - 1\n", "entry_point": "find_max_xor", "input": "1, 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120767_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003460", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "13", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003461", "code": "import os\nfrom pathlib import Path\nfrom typing import Tuple\ndef setup_env_path(file_path: str) -> Tuple[str, str]:\n    checkout_dir = Path(file_path).resolve().parent\n    parent_dir = checkout_dir.parent\n    if parent_dir != \"/\" and os.path.isdir(parent_dir / \"etc\"):\n        env_file = parent_dir / \"etc\" / \"env\"\n        default_var_root = parent_dir / \"var\"\n    else:\n        env_file = checkout_dir / \".env\"\n        default_var_root = checkout_dir / \"var\"\n    return str(env_file), str(default_var_root)\n", "entry_point": "setup_env_path", "input": "'/path/to/somefile.txt'", "output": "('/path/to/.env', '/path/to/var')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10500_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003462", "code": "import re\ndef extract_config_details(script: str) -> dict:\n    config_details = {}\n    lines = script.split('\\n')\n    for line in lines:\n        if line.startswith('PROP_NAME'):\n            config_details['Property Name'] = re.search(r'\"(.*?)\"', line).group(1)\n        elif line.startswith('TIMEZONE'):\n            config_details['Timezone'] = re.search(r'\"(.*?)\"', line).group(1)\n        elif line.startswith('BABEL_LOCALES'):\n            config_details['Languages'] = re.findall(r'\"(.*?)\"', line)\n        elif line.startswith('BABEL_DEFAULT_LOCALE'):\n            config_details['Default Language'] = re.search(r'\"(.*?)\"', line).group(1)\n        elif line.startswith('MYSQL_DATABASE_USER'):\n            config_details['DB User'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif line.startswith('MYSQL_DATABASE_PASSWORD'):\n            config_details['DB Password'] = '<PASSWORD>'  # Placeholder for actual password\n        elif line.startswith('MYSQL_DATABASE_DB'):\n            config_details['DB Name'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif line.startswith('MYSQL_DATABASE_HOST'):\n            config_details['DB Host'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif line.startswith('SECRET_KEY'):\n            config_details['Secret Key'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif line.startswith('UPLOADS_DEFAULT_DEST'):\n            config_details['Uploads Default Destination'] = re.search(r\"'(.*?)'\", line).group(1)\n        elif line.startswith('UPLOADS_DEFAULT_URL'):\n            config_details['Uploads Default URL'] = re.search(r\"'(.*?)'\", line).group(1)\n    return config_details\n", "entry_point": "extract_config_details", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88863_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003463", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "23, 1", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003464", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "134", "output": "(True, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003465", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "find_single_number", "input": "[1, 1, 2, 2, 3, 3, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67406_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003466", "code": "def count_registrations(registrations):\n    registration_counts = {}\n    for registration in registrations:\n        entity_type, _ = registration.split(', ')\n        if entity_type in registration_counts:\n            registration_counts[entity_type] += 1\n        else:\n            registration_counts[entity_type] = 1\n    return registration_counts\n", "entry_point": "count_registrations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109346_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003467", "code": "def extract_test_cases(input_string):\n    test_cases = []\n    lines = input_string.split('\\n')\n    for line in lines:\n        if '=' in line:\n            parts = line.split('=')\n            server_version = parts[0].strip().strip(\"'\")\n            test_function = parts[1].strip().split()[0]\n            if test_function != '_skip_test':\n                test_cases.append((server_version, test_function))\n    return test_cases\n", "entry_point": "extract_test_cases", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131043_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003468", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[1, [2, 3], 4]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003469", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import os.path'", "output": "'os.path'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003470", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[8, 9, 11]", "output": "792", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5851_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003471", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "15, 5", "output": "3003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2523", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003472", "code": "def sort_aggregation_methods(input_dict):\n    aggregation_methods = input_dict.get('aggregation_methods', [])\n    sorted_methods = sorted(aggregation_methods, key=lambda x: (len(x), x))\n    sorted_dict = {\n        'aggregation_methods': sorted_methods\n    }\n    return sorted_dict\n", "entry_point": "sort_aggregation_methods", "input": "{}", "output": "{'aggregation_methods': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7499_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003473", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[0, 32, 64, 80], 8", "output": "176", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003474", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "711", "output": "{1, 3, 711, 9, 237, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt710", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003475", "code": "def min_eggs_needed(egg_weights, n):\n    dp = [float('inf')] * (n + 1)\n    dp[0] = 0\n    for w in range(1, n + 1):\n        for ew in egg_weights:\n            if w - ew >= 0:\n                dp[w] = min(dp[w], dp[w - ew] + 1)\n    return dp[n]\n", "entry_point": "min_eggs_needed", "input": "[1], 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108972_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003476", "code": "from typing import Sequence\ndef sum_of_squares_of_evens(sequence: Sequence[int]) -> int:\n    sum_of_squares = 0\n    for num in sequence:\n        if num % 2 == 0:  # Check if the number is even\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 4, 6]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43282_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003477", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[4, 5, 6, 2]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003478", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[32, 33, 67, 91, 75, 32, 32, 91, 90]", "output": "[32, 33, 67, 91, 75, 32, 32, 91, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9797", "output": "{1, 101, 9797, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003480", "code": "import ast\ndef extract_settings_info(code_snippet):\n    settings_info = {}\n    # Parse the code snippet as a Python AST (Abstract Syntax Tree)\n    parsed_code = ast.parse(code_snippet)\n    # Extract the required information from the parsed code\n    for node in ast.walk(parsed_code):\n        if isinstance(node, ast.Assign):\n            if isinstance(node.targets[0], ast.Name):\n                setting_name = node.targets[0].id\n                if setting_name == \"BOT_NAME\":\n                    settings_info[\"bot_name\"] = node.value.s\n                elif setting_name == \"SPIDER_MODULES\":\n                    settings_info[\"spider_modules\"] = [module.s for module in node.value.elts]\n                elif setting_name == \"ROBOTSTXT_OBEY\":\n                    settings_info[\"robotstxt_obey\"] = node.value.value\n                elif setting_name == \"CONCURRENT_REQUESTS\":\n                    settings_info[\"concurrent_requests\"] = node.value.n\n                elif setting_name == \"SPIDERMON_VALIDATION_CERBERUS\":\n                    settings_info[\"cerberus_schema_path\"] = node.value.elts[0].s\n    return settings_info\n", "entry_point": "extract_settings_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25419_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003481", "code": "def is_flow_logs_enabled(vpc_id):\n    # Mock response similar to the one returned by describe_flow_logs\n    mock_response = {\n        'FlowLogs': [\n            {\n                'FlowLogId': 'flow-log-id-1',\n                'ResourceType': 'VPC',\n                'ResourceId': vpc_id,\n                # Add more fields as needed for accuracy\n            }\n        ]\n    }\n    # Check if the VPC ID exists in the mock response\n    if any(log['ResourceId'] == vpc_id for log in mock_response['FlowLogs']):\n        return True\n    else:\n        return False\n", "entry_point": "is_flow_logs_enabled", "input": "'vpc-identifier'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92626_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003482", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "4, 9", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003483", "code": "def custom_split(arr, target_sum):\n    def split_dataset(index, current_sum, current_set, remaining):\n        nonlocal best_diff, best_set\n        if index == len(arr):\n            diff = abs(current_sum - target_sum)\n            if diff < best_diff:\n                best_diff = diff\n                best_set = current_set.copy()\n            return\n        split_dataset(index + 1, current_sum, current_set, remaining[1:])  # Exclude current element\n        split_dataset(index + 1, current_sum + remaining[0], current_set + [index], remaining[1:])  # Include current element\n    best_diff = float('inf')\n    best_set = []\n    split_dataset(0, 0, [], arr)\n    test_indices = [i for i in range(len(arr)) if i not in best_set]\n    return best_set, test_indices\n", "entry_point": "custom_split", "input": "[1, 2, 3, 5, 1, 0], 6", "output": "([3, 4], [0, 1, 2, 5])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39514_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003484", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 7, 20, 12, 70, 2]", "output": "[1, 7, 4, 27, 2401, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003485", "code": "def happyLadybugs(b):\n    for a in set(b):\n        if a != \"_\" and b.count(a) == 1:\n            return \"NO\"\n    if b.count(\"_\") == 0:\n        for i in range(1, len(b) - 1):\n            if b[i - 1] != b[i] and b[i + 1] != b[i]:\n                return \"NO\"\n    return \"YES\"\n", "entry_point": "happyLadybugs", "input": "'aa_bb'", "output": "'YES'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63192_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1424", "output": "{1, 2, 4, 356, 712, 8, 1424, 16, 178, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1423", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003487", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'rtessTir'", "output": "'rtesssuccess'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003488", "code": "from decimal import Decimal\ndef htdf_to_satoshi(amount_htdf):\n    amount_decimal = Decimal(str(amount_htdf))  # Convert input to Decimal\n    satoshi_value = int(amount_decimal * (10 ** 8))  # Convert HTDF to satoshi\n    return satoshi_value\n", "entry_point": "htdf_to_satoshi", "input": "211.0", "output": "21100000000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13302_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5683", "output": "{1, 5683}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003490", "code": "import json\ndef execute_and_format_result(input_data):\n    try:\n        result = eval(input_data)\n        if type(result) in [list, dict]:\n            return json.dumps(result, indent=4)\n        else:\n            return result\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "execute_and_format_result", "input": "'[1, 2, 3] ]'", "output": "\"Error: unmatched ']' (<string>, line 1)\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97741_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003491", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[5, 6, 10]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38745_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003492", "code": "from typing import List\ndef is_secure_environment(hostnames: List[str]) -> bool:\n    import os\n    DEBUG = True if \"DEBUG\" in os.environ else False\n    ALLOWED_HOSTS = [\"lkkpomia-stage.azurewebsites.net\"]  # Assuming this is the ALLOWED_HOSTS setting\n    if not DEBUG and all(hostname in ALLOWED_HOSTS for hostname in hostnames):\n        return True\n    else:\n        return False\n", "entry_point": "is_secure_environment", "input": "['example.com']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121081_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003493", "code": "from typing import List, Tuple\ndef total_area(rectangles: List[Tuple[int, int, int, int]]) -> int:\n    points = set()\n    total_area = 0\n    for rect in rectangles:\n        for x in range(rect[0], rect[2]):\n            for y in range(rect[1], rect[3]):\n                if (x, y) not in points:\n                    points.add((x, y))\n                    total_area += 1\n    return total_area\n", "entry_point": "total_area", "input": "[(0, 0, 5, 5)]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139460_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003494", "code": "def calculate_tracking_error(actual_size, desired_size):\n    vertical_error = desired_size[0] - actual_size[0]\n    horizontal_error = desired_size[1] - actual_size[1]\n    total_error = vertical_error**2 + horizontal_error**2\n    return total_error\n", "entry_point": "calculate_tracking_error", "input": "(0, 0), (16, 0)", "output": "256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30005_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003495", "code": "from typing import List\ndef remove_non_integers(x: List) -> List:\n    return [element for element in x if isinstance(element, int)]\n", "entry_point": "remove_non_integers", "input": "[1234, 'text', 56.78, None]", "output": "[1234]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118715_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003496", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6389", "output": "{1, 6389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003497", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8603", "output": "{1, 8603, 1229, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003498", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[2, 2, 2]", "output": "[2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003499", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[1, 5, 7, 1]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003500", "code": "def sum_multiples_3_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41452_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003501", "code": "def calculate_event_percentage(event_occurrences, event_index):\n    total_count = sum(event_occurrences)\n    if event_index < 0 or event_index >= len(event_occurrences):\n        return \"Invalid event index\"\n    event_count = event_occurrences[event_index]\n    percentage = (event_count / total_count) * 100\n    return percentage\n", "entry_point": "calculate_event_percentage", "input": "[], -1", "output": "'Invalid event index'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23800_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4787", "output": "{1, 4787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003503", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'exaexampleile.txmle'", "output": "'App/static/uploads/exaexampleile.txmle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003504", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "2", "output": "1.4142135624", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003505", "code": "MUTATION_COMPLEMENTS = {\n    \"CtoG\": \"GtoC\",\n    \"CtoA\": \"GtoT\",\n    \"AtoT\": \"TtoA\",\n    \"CtoT\": \"GtoA\",\n    \"AtoC\": \"TtoG\",\n    \"AtoG\": \"TtoC\",\n}\ndef get_complement_mutation(mutation_type):\n    if mutation_type in MUTATION_COMPLEMENTS:\n        return MUTATION_COMPLEMENTS[mutation_type]\n    else:\n        return \"Mutation type not found.\"\n", "entry_point": "get_complement_mutation", "input": "'XtoY'", "output": "'Mutation type not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147742_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003506", "code": "import itertools\ndef count_unique_combinations(items, k):\n    unique_combinations = list(itertools.combinations(items, k))\n    return len(unique_combinations)\n", "entry_point": "count_unique_combinations", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23071_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003507", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1669", "output": "{1, 1669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003508", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "3", "output": "'-reserved-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003509", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "64", "output": "'@'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4527", "output": "{1, 3, 1509, 9, 4527, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003511", "code": "def is_hexadecimal(s):\n    for char in s:\n        if not (char.isdigit() or (char.upper() >= 'A' and char.upper() <= 'F')):\n            return False\n    return True\n", "entry_point": "is_hexadecimal", "input": "'G'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80089_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003512", "code": "def unique_word_count(sentence):\n    unique_words = set()\n    words = sentence.split()\n    for word in words:\n        unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "unique_word_count", "input": "'hello'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17367_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003513", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2085", "output": "{1, 417, 3, 5, 2085, 139, 15, 695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2084", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003514", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2164", "output": "{1, 2, 4, 2164, 1082, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2163", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003515", "code": "def find_peak_index(arr):\n    for i in range(1, len(arr) - 1):\n        if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:\n            return i\n    return -1  # No peak found\n", "entry_point": "find_peak_index", "input": "[1, 2, 3, 4, 5, 10, 8, 7]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94014_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003516", "code": "def min_num_seconds(num_seconds, gemstones_colors):\n    n = len(num_seconds)\n    for i in range(n - 1, -1, -1):\n        for j in range(i, n):\n            if i == n - 1:\n                num_seconds[i][j] = 1\n            else:\n                new = 1 + num_seconds[i + 1][j] if i + 1 < n else 1\n                if i + 1 < n and gemstones_colors[i] == gemstones_colors[i + 1]:\n                    num_seconds[i][j] = min(1 + num_seconds[i + 2][j] if i + 2 < n else 1, num_seconds[i][j])\n                num_seconds[i][j] = min(new, num_seconds[i][j])\n                first_occurrence = i + 2\n                while first_occurrence <= j and first_occurrence < n:\n                    if gemstones_colors[i] == gemstones_colors[first_occurrence]:\n                        new = num_seconds[i + 1][first_occurrence - 1] + num_seconds[first_occurrence + 1][j] if first_occurrence + 1 < n else 0\n                        num_seconds[i][j] = min(new, num_seconds[i][j])\n                    first_occurrence += 1\n    return num_seconds[0][-1]\n", "entry_point": "min_num_seconds", "input": "[[0]], ['red', 'red', 'red']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75626_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003517", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "58", "output": "58", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003518", "code": "import sys\nDEFAULT_SERVER_UPTIME = 21 * 24 * 60 * 60\nMIN_SERVER_UPTIME = 1 * 24 * 60 * 60\nDEFAULT_MAX_APP_LEASE = 7 * 24 * 60 * 60\nDEFAULT_THRESHOLD = 0.9\ndef calculate_total_uptime(lease_durations):\n    total_uptime = 0\n    for lease_duration in lease_durations:\n        server_uptime = min(max(lease_duration, MIN_SERVER_UPTIME), DEFAULT_MAX_APP_LEASE)\n        total_uptime += server_uptime\n    return total_uptime\n", "entry_point": "calculate_total_uptime", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10263_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003519", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003520", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7145", "output": "{1, 5, 7145, 1429}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7144", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003521", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[2, 4, 4, 5, 5, 5, 0]", "output": "{2: 1, 4: 2, 5: 3, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003522", "code": "from typing import List\ndef sum_within_ranges(lower_bounds: List[int]) -> int:\n    total_sum = 0\n    for i in range(len(lower_bounds) - 1):\n        start = lower_bounds[i]\n        end = lower_bounds[i + 1]\n        total_sum += sum(range(start, end))\n    total_sum += lower_bounds[-1]  # Add the last lower bound\n    return total_sum\n", "entry_point": "sum_within_ranges", "input": "[1, 4, 7]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29413_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003523", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'HelloRT'", "output": "('', 'HelloRT')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003524", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "10", "output": "0.45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003525", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68316_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003526", "code": "def check_ram_size(ram_size):\n    SYSTEM_RAM_GB_MAIN = 64\n    SYSTEM_RAM_GB_SMALL = 2\n    if ram_size >= SYSTEM_RAM_GB_MAIN:\n        return \"Sufficient RAM size\"\n    elif ram_size >= SYSTEM_RAM_GB_SMALL:\n        return \"Insufficient RAM size\"\n    else:\n        return \"RAM size too small\"\n", "entry_point": "check_ram_size", "input": "4", "output": "'Insufficient RAM size'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90224_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003527", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            total = input_list[i] + input_list[i + 1]\n        elif i == len(input_list) - 1:\n            total = input_list[i] + input_list[i - 1]\n        else:\n            total = input_list[i - 1] + input_list[i] + input_list[i + 1]\n        output_list.append(total)\n    return output_list\n", "entry_point": "process_list", "input": "[5, 6, 3, 5, 0]", "output": "[11, 14, 14, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34585_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003528", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "0.42, 1", "output": "0.42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003529", "code": "def replace_file_type(file_name, new_type):\n    \"\"\"\n    Replaces the file type extension of a given file name with a new type.\n    :param file_name: Original file name with extension\n    :param new_type: New file type extension\n    :return: Modified file name with updated extension\n    \"\"\"\n    file_name_parts = file_name.split(\".\")\n    if len(file_name_parts) > 1:  # Ensure there is a file extension to replace\n        file_name_parts[-1] = new_type  # Replace the last part (file extension) with the new type\n        return \".\".join(file_name_parts)  # Join the parts back together with \".\"\n    else:\n        return file_name  # Return the original file name if no extension found\n", "entry_point": "replace_file_type", "input": "'document.doc', 'pdf'", "output": "'document.pdf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41247_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003530", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10, 15, 10]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111003_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003531", "code": "def min_trips(k, weights):\n    total_trips = sum((x + k - 1) // k for x in weights)\n    min_trips_needed = (total_trips + 1) // 2\n    return min_trips_needed\n", "entry_point": "min_trips", "input": "3, [3, 3, 3, 3, 3, 3, 3, 3, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5487_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003532", "code": "def find_missing_number(L):\n    n = len(L) + 1\n    total_sum = n * (n + 1) // 2\n    list_sum = sum(L)\n    missing_number = total_sum - list_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149242_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003533", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[0, 5, 4, 4, 6, 7, 4]", "output": "[1, 6, 5, 5, 7, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003534", "code": "def concatenate_string(s, n):\n    result = \"\"\n    for i in range(n):\n        result += s\n    return result\n", "entry_point": "concatenate_string", "input": "'hhhohelloel', 2", "output": "'hhhohelloelhhhohelloel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24778_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003535", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[0, 0, 1, 3], 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003536", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'11.'", "output": "['11.']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003537", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[3, 3, 1, 3, 2, -1, -3]", "output": "[9, 9, 1, 9, 4, 1, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1745", "output": "{1, 349, 1745, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003539", "code": "def dummy(n):\n    total_sum = sum(range(1, n + 1))\n    return total_sum\n", "entry_point": "dummy", "input": "1000", "output": "500500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124894_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003540", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[10, 7, 4, 4, 3, 2, 1, 0, -1]", "output": "[10, 7, 4, 4, 3, 2, 1, 0, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003541", "code": "import re\ndef parse_setup_script(setup_script: str) -> dict:\n    extracted_info = {}\n    # Regular expressions to match and extract package information\n    name = re.search(r\"name='(.*?)'\", setup_script)\n    version = re.search(r\"version='(.*?)'\", setup_script)\n    author = re.search(r\"author=\\\"(.*?)\\\"\", setup_script)\n    author_email = re.search(r\"author_email=\\\"(.*?)\\\"\", setup_script)\n    description = re.search(r\"description=\\\"(.*?)\\\"\", setup_script)\n    if name:\n        extracted_info['name'] = name.group(1)\n    if version:\n        extracted_info['version'] = version.group(1)\n    if author:\n        extracted_info['author'] = author.group(1)\n    if author_email:\n        extracted_info['author_email'] = author_email.group(1)\n    if description:\n        extracted_info['description'] = description.group(1)\n    return extracted_info\n", "entry_point": "parse_setup_script", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43472_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003542", "code": "def extract_package_details(package_info):\n    name = package_info.get(\"name\", \"\")\n    version = package_info.get(\"version\", \"\")\n    author = package_info.get(\"author\", \"\")\n    entry_point = \"\"\n    if \"entry_points\" in package_info and \"console_scripts\" in package_info[\"entry_points\"]:\n        entry_point = package_info[\"entry_points\"][\"console_scripts\"][0].split(\"=\")[0].strip()\n    return name, version, author, entry_point\n", "entry_point": "extract_package_details", "input": "{}", "output": "('', '', '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39806_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003543", "code": "import json\ndef extract_user_values(json_payload):\n    try:\n        data = json.loads(json_payload)\n    except json.JSONDecodeError:\n        return \"Invalid JSON payload\"\n    user_values = []\n    for key, value in data.items():\n        if key.startswith('user_') and isinstance(value, int):\n            user_values.append(value)\n    return user_values\n", "entry_point": "extract_user_values", "input": "'Hello world'", "output": "'Invalid JSON payload'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119734_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003544", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'11.2.0'", "output": "(11, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003545", "code": "def lcs_length(x, y):\n    m, n = len(x), len(y)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if x[i - 1] == y[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'abc', 'ac'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71926_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003546", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5437", "output": "{1, 5437}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003547", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[10, 20, 6, 0]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003548", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[100, 92, 85, 72, 75, 40]", "output": "[100, 92, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003549", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'llcappwdwdclsss'", "output": "'Manual not available for llcappwdwdclsss'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003550", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8583", "output": "{1, 3, 2861, 8583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003551", "code": "def calculate_bytes_required(num):\n    if num == 0:\n        return 1  # 0 requires 1 byte to store\n    else:\n        # Calculate the number of bits required to represent the integer\n        num_bits = num.bit_length()\n        # Calculate the number of bytes required (round up division by 8)\n        num_bytes = (num_bits + 7) // 8\n        return num_bytes\n", "entry_point": "calculate_bytes_required", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110035_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003552", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'B'], 3", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003553", "code": "def solution(arr):\n    if not arr:\n        return 0\n    visible_count = 1\n    max_height = arr[-1]\n    for i in range(len(arr) - 2, -1, -1):\n        if arr[i] > max_height:\n            visible_count += 1\n            max_height = arr[i]\n    return visible_count\n", "entry_point": "solution", "input": "[5, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115968_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003554", "code": "def find_second_highest_score(scores):\n    unique_scores = list(set(scores))  # Remove duplicates\n    if len(unique_scores) < 2:\n        return None\n    else:\n        sorted_scores = sorted(unique_scores, reverse=True)\n        return sorted_scores[1]\n", "entry_point": "find_second_highest_score", "input": "[90, 85, 70, 60]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32942_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003555", "code": "def categorize_tf_vars(tf_vars):\n    conv_vars = []\n    tconv_vars = []\n    bn_vars = []\n    other_vars = []\n    for var_name in tf_vars.keys():\n        if var_name.startswith('conv'):\n            conv_vars.append(var_name)\n        elif var_name.startswith('tconv'):\n            tconv_vars.append(var_name)\n        elif 'bn' in var_name:\n            bn_vars.append(var_name)\n        else:\n            other_vars.append(var_name)\n    return conv_vars, tconv_vars, bn_vars, other_vars\n", "entry_point": "categorize_tf_vars", "input": "{}", "output": "([], [], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19103_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003556", "code": "def find_highest_score_index(scores):\n    highest_score = float('-inf')\n    highest_score_index = -1\n    for i in range(len(scores)):\n        if scores[i] > highest_score:\n            highest_score = scores[i]\n            highest_score_index = i\n        elif scores[i] == highest_score and i < highest_score_index:\n            highest_score_index = i\n    return highest_score_index\n", "entry_point": "find_highest_score_index", "input": "[50, 100, 90]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57664_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003557", "code": "import os\ndef is_file_writable(file_path: str) -> bool:\n    if os.path.exists(file_path):\n        return os.access(file_path, os.W_OK)\n    else:\n        directory_path = os.path.dirname(file_path)\n        return os.access(directory_path, os.W_OK)\n", "entry_point": "is_file_writable", "input": "'/protected/folder/file.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35493_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4456", "output": "{1, 2, 4, 4456, 8, 557, 2228, 1114}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4455", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003559", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "27, 7", "output": "888030", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003560", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'The final number is 100'", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003561", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'HelHeH12lo!!$%'", "output": "'HelHeH12lo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003562", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0  # Handle the case where there are no scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[95, 90, 88, 90], 4", "output": "90.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44364_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003563", "code": "def max_product_of_three(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of first two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 3, 10]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11525_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003564", "code": "def get_earnings_color(notification_type):\n    # Define earnings notification colors and transparent PNG URL\n    EARNINGS_COLORS = {\n        \"beat\": \"20d420\",\n        \"miss\": \"d42020\",\n        \"no consensus\": \"000000\"\n    }\n    TRANSPARENT_PNG = \"https://cdn.major.io/wide-empty-transparent.png\"\n    # Return the color code based on the notification type\n    return EARNINGS_COLORS.get(notification_type.lower(), \"FFFFFF\")  # Default to white for invalid types\n", "entry_point": "get_earnings_color", "input": "'invalid_type'", "output": "'FFFFFF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38125_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003565", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[-7, -3, 1, 3, 7, 27]", "output": "567", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003566", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[1, 2, 3, 10, 4, 10, 5]", "output": "[3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003567", "code": "import re\ndef extract_components(text: str) -> dict:\n    components = {}\n    pattern = r'\"\"\"(.*?)\"\"\"'\n    matches = re.findall(pattern, text, re.DOTALL)\n    for match in matches:\n        lines = match.strip().split('\\n')\n        component_name = lines[1].strip()\n        component_desc = ' '.join(lines[2:]).strip()\n        components[component_name] = component_desc\n    return components\n", "entry_point": "extract_components", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003568", "code": "def analyze_environment_usage(code_snippet):\n    correct_count = 0\n    incorrect_count = 0\n    for line in code_snippet.split('\\n'):\n        line = line.strip()\n        if 'Environment' in line and 'autoescape' in line:\n            if 'autoescape=True' in line or 'autoescape=select_autoescape()' in line:\n                correct_count += 1\n            else:\n                incorrect_count += 1\n    return correct_count, incorrect_count\n", "entry_point": "analyze_environment_usage", "input": "''", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50412_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003569", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'1.91.2'", "output": "'1.91.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003570", "code": "def max_difference(lst):\n    if len(lst) < 2:\n        return 0\n    min_val = lst[0]\n    max_diff = 0\n    for num in lst[1:]:\n        if num < min_val:\n            min_val = num\n        else:\n            max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 3, 5, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61667_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003571", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'abac,d -> jklm'", "output": "(['abac', 'd'], 'jklm')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003572", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27882_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003573", "code": "import re\ndef extract_screen_names(code_snippet):\n    screen_names = set()\n    pattern = r'MDSRTGO_scr_\\d+'\n    for line in code_snippet.split('\\n'):\n        matches = re.findall(pattern, line)\n        for match in matches:\n            screen_names.add(match)\n    return list(screen_names)\n", "entry_point": "extract_screen_names", "input": "'Hello world\\nThis is a test\\nMDSRTGO_scr_abc'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25380_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003574", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'foo=bffooff'", "output": "{'foo': 'bffooff'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9087", "output": "{1, 3, 39, 233, 13, 3029, 699, 9087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003576", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'haelo'", "output": "['haelo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3297", "output": "{1, 3297, 3, 7, 1099, 21, 471, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003578", "code": "def evaluate_expression(tree):\n    if isinstance(tree, int):\n        return tree\n    else:\n        operator, *operands = tree\n        left_operand = evaluate_expression(operands[0])\n        right_operand = evaluate_expression(operands[1])\n        if operator == '+':\n            return left_operand + right_operand\n        elif operator == '-':\n            return left_operand - right_operand\n        elif operator == '*':\n            return left_operand * right_operand\n        elif operator == '/':\n            if right_operand == 0:\n                raise ZeroDivisionError(\"Division by zero\")\n            return left_operand / right_operand\n        else:\n            raise ValueError(\"Invalid operator\")\n", "entry_point": "evaluate_expression", "input": "['+', 3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_972_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003579", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[4, 5, 14, 16, 4, 5, 14, 16]", "output": "[9, 19, 30, 20, 9, 19, 30, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003580", "code": "import ast\nfrom collections import defaultdict\ndef analyze_imports(code_snippet):\n    tree = ast.parse(code_snippet)\n    imports = defaultdict(int)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports[alias.name.split('.')[0]] += 1\n        elif isinstance(node, ast.ImportFrom):\n            imports[node.module] += 1\n    return dict(imports)\n", "entry_point": "analyze_imports", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23948_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003581", "code": "import string\ndef count_unique_words(document_content: str) -> int:\n    translator = str.maketrans('', '', string.punctuation)\n    words = document_content.split()\n    unique_words = set()\n    for word in words:\n        clean_word = word.translate(translator).lower()\n        if clean_word:\n            unique_words.add(clean_word)\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'Apple, banana; orange. Grape kiwi peach!'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94250_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003582", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8941", "output": "{1, 8941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003583", "code": "def calculate_avg_acceleration(points):\n    total_acceleration = 0\n    total_count = 0\n    for point in points:\n        total_acceleration += sum(point)\n        total_count += len(point)\n    if total_count == 0:\n        return 0\n    average_acceleration = total_acceleration / total_count\n    return round(average_acceleration)\n", "entry_point": "calculate_avg_acceleration", "input": "[[4, 4], [4, 4]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38952_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003584", "code": "import re\ndef extract_episode_info(text):\n    episode_info = []\n    lines = text.split('\\n')\n    for line in lines:\n        match = re.search(r'Episode (\\d+): (.+)', line)\n        if match:\n            episode_number = int(match.group(1))\n            anime_name = match.group(2)\n            episode_info.append((episode_number, anime_name))\n    return episode_info\n", "entry_point": "extract_episode_info", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117266_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003585", "code": "from collections import Counter\ndef max_score(card, k):\n    c = Counter(card)\n    ans = 0\n    while k > 0:\n        tmp = c.pop(c.most_common(1)[0][0])\n        if k > tmp:\n            ans += tmp * tmp\n            k -= tmp\n        else:\n            ans += k * k\n            k = 0\n    return ans\n", "entry_point": "max_score", "input": "[6, 6, 6, 6, 6, 6], 6", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62809_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003586", "code": "def generate_password(key, length):\n    password = ''\n    key_length = len(key)\n    key_index = 0\n    while len(password) < length:\n        char = key[key_index]\n        if char.isdigit():\n            password += char\n        elif char.isalpha():\n            password += str(ord(char))\n        key_index = (key_index + 1) % key_length\n    return password[:length]\n", "entry_point": "generate_password", "input": "'83831019911410', 14", "output": "'83831019911410'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134648_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2127", "output": "{1, 3, 709, 2127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003588", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'2.1.3'", "output": "'2.1.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003589", "code": "import math\ndef count_perfect_squares(numbers):\n    count = 0\n    for num in numbers:\n        if math.isqrt(num) ** 2 == num:\n            count += 1\n    return count\n", "entry_point": "count_perfect_squares", "input": "[0, 1, 4, 9, 16, 25]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144234_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003590", "code": "def parse_test_cases(code_snippet):\n    test_cases = {}\n    lines = code_snippet.split('\\n')\n    current_test_case = None\n    current_description = \"\"\n    for line in lines:\n        if line.startswith('o '):\n            if current_test_case is not None:\n                test_cases[current_test_case] = current_description.strip()\n            current_test_case = line.split('o ')[1].split(':')[0]\n            current_description = \"\"\n        else:\n            current_description += line.strip() + ' '\n    if current_test_case is not None:\n        test_cases[current_test_case] = current_description.strip()\n    return test_cases\n", "entry_point": "parse_test_cases", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34939_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003591", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'Bbone'", "output": "'bbone.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003592", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35742_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003593", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "8", "output": "225792", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003594", "code": "def generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(n**0.5) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n + 1, i):\n                is_prime[j] = False\n    return [num for num in range(2, n + 1) if is_prime[num]]\n", "entry_point": "generate_primes", "input": "13", "output": "[2, 3, 5, 7, 11, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96094_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003595", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    fib_prev, fib_curr = 0, 1\n    for _ in range(N):\n        fib_sum += fib_curr\n        fib_prev, fib_curr = fib_curr, fib_prev + fib_curr\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "17", "output": "4180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41805_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003596", "code": "def update_tag_expiration(repository: str, tag: str, current_expiration: int) -> bool:\n    # Calculate the updated expiration time\n    updated_expiration = current_expiration + 60 * 60 * 24\n    # Simulate updating the expiration time of the tag in the repository\n    # This step is abstracted for the purpose of this problem\n    # Verify the update by checking if the tag's lifetime end timestamp matches the updated expiration time\n    return updated_expiration == current_expiration + 60 * 60 * 24\n", "entry_point": "update_tag_expiration", "input": "'my_repo', 'v1.0', 1000", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6704_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003597", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "-1898.054, 0.01", "output": "-18.98054", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003598", "code": "import re\ndef process_twitter_text(text):\n    re_usernames = re.compile(\"@([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    re_hashtags = re.compile(\"#([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    replace_hashtags = \"<a href=\\\"http://twitter.com/search?q=%23\\\\1\\\">#\\\\1</a>\"\n    replace_usernames = \"<a href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a>\"\n    processed_text = re_usernames.sub(replace_usernames, text)\n    processed_text = re_hashtags.sub(replace_hashtags, processed_text)\n    return processed_text\n", "entry_point": "process_twitter_text", "input": "'outtweett'", "output": "'outtweett'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76234_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "628", "output": "{1, 2, 4, 628, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt627", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003600", "code": "def merge_sort_skip_multiples_of_3(arr):\n    def merge(left, right):\n        result = []\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] < right[j]:\n                result.append(left[i])\n                i += 1\n            else:\n                result.append(right[j])\n                j += 1\n        result.extend(left[i:])\n        result.extend(right[j:])\n        return result\n    def merge_sort(arr):\n        if len(arr) <= 1:\n            return arr\n        mid = len(arr) // 2\n        left = merge_sort(arr[:mid])\n        right = merge_sort(arr[mid:])\n        return merge(left, right)\n    multiples_of_3 = [num for num in arr if num % 3 == 0]\n    non_multiples_of_3 = [num for num in arr if num % 3 != 0]\n    sorted_non_multiples_of_3 = merge_sort(non_multiples_of_3)\n    result = []\n    i = j = 0\n    for num in arr:\n        if num % 3 == 0:\n            result.append(multiples_of_3[i])\n            i += 1\n        else:\n            result.append(sorted_non_multiples_of_3[j])\n            j += 1\n    return result\n", "entry_point": "merge_sort_skip_multiples_of_3", "input": "[9, 5, 12, 7, 9, 12, 12]", "output": "[9, 5, 12, 7, 9, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15751_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003601", "code": "def get_group_status(input_data: dict) -> str:\n    all_statuses = {\n        'admin': '\u0410\u0414\u041c\u0418\u041d\u0418\u0421\u0422\u0420\u0410\u0422\u041e\u0420\u042b:',\n        'changer': '\u0427\u0415\u0419\u041d\u0414\u0416\u0418:',\n        'operator': '\u041e\u041f\u0415\u0420\u0410\u0422\u041e\u0420\u042b:',\n        'secretary': '\u0421\u0415\u041a\u0420\u0415\u0422\u0410\u0420\u0418:',\n        'executor': '\u0418\u0421\u041f\u041e\u041b\u041d\u0418\u0422\u0415\u041b\u0418:',\n        'permit': '\u041d\u0410 \u041f\u0420\u041e\u041f\u0423\u0421\u041a:',\n        'request': '\u0412 \u0421\u0422\u0410\u0422\u0423\u0421\u0415 \"\u0417\u0410\u041f\u0420\u041e\u0421\":',\n        'block': '\u0417\u0410\u0411\u041b\u041e\u041a\u0418\u0420\u041e\u0412\u0410\u041d\u041d\u042b:'\n    }\n    group = input_data.get('group')\n    if group in all_statuses:\n        return all_statuses[group]\n    else:\n        return 'Group status not found.'\n", "entry_point": "get_group_status", "input": "{'group': 'unknown_group'}", "output": "'Group status not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34977_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003602", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "'Hlo, ,Wold', 'd'", "output": "'Hlo, ,Wol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003603", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[1, 1, 1, 2]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9251", "output": "{1, 9251, 841, 11, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003605", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "54, 10, 5", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003606", "code": "import ast\ndef generate_constants_mapping(code_snippet):\n    constants_mapping = {}\n    # Parse the code snippet to extract constant names and values\n    parsed_code = ast.parse(code_snippet)\n    for node in ast.walk(parsed_code):\n        if isinstance(node, ast.Assign) and len(node.targets) == 1 and isinstance(node.targets[0], ast.Name):\n            constant_name = node.targets[0].id\n            constant_value = ast.literal_eval(node.value)\n            constants_mapping[constant_name] = constant_value\n    return constants_mapping\n", "entry_point": "generate_constants_mapping", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20796_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003607", "code": "def check_fib(num):\n    fib = [0, 1]\n    while fib[-1] < num:\n        fib.append(fib[-1] + fib[-2])\n    return num in fib\n", "entry_point": "check_fib", "input": "-1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118205_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003608", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[75.0, 77.0, 78.0, 78.0]", "output": "77.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43674_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003609", "code": "def process_desktop_file(desktop_file: str) -> dict:\n    result = {}\n    for line in desktop_file.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            result[key] = value\n    for key, value in result.items():\n        if value == 'false':\n            result[key] = False\n        elif value == 'true':\n            result[key] = True\n    if 'Terminal' not in result:\n        result['Terminal'] = False\n    if 'Hidden' not in result:\n        result['Hidden'] = False\n    return result\n", "entry_point": "process_desktop_file", "input": "''", "output": "{'Terminal': False, 'Hidden': False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16429_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003610", "code": "def findFirstBadVersion(versions, bad_version):\n    start = 0\n    end = len(versions) - 1\n    while start < end:\n        mid = start + (end - start) // 2\n        if versions[mid] >= bad_version:\n            end = mid\n        else:\n            start = mid + 1\n    if versions[start] == bad_version:\n        return start\n    elif versions[end] == bad_version:\n        return end\n    else:\n        return -1\n", "entry_point": "findFirstBadVersion", "input": "[1, 2, 4, 5], 3", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1351_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003611", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'anataa'", "output": "'anataa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003612", "code": "def reverse_engineer_logic(input_num):\n    if input_num == 23:\n        return 1\n    # Add additional conditions and logic here if needed\n    else:\n        return 0  # Default return value if input_num does not match the hidden logic\n", "entry_point": "reverse_engineer_logic", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28391_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003613", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[10, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003614", "code": "def get_storage_type(storage_path):\n    if storage_path.startswith(\"s3:\"):\n        return \"s3\"\n    elif storage_path.startswith(\"local:\"):\n        return \"local\"\n    else:\n        return \"Unknown\"\n", "entry_point": "get_storage_type", "input": "'local:'", "output": "'local'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80794_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003615", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[3, 3, 1, 5, 1, 3]", "output": "[6, 4, 6, 6, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003616", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "-103.00000000000001", "output": "170.14999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003617", "code": "def find_latest_version(versions):\n    def version_key(version):\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    sorted_versions = sorted(versions, key=version_key, reverse=True)\n    return sorted_versions[0]\n", "entry_point": "find_latest_version", "input": "['1.0.0', '2.0.0', '3.0.0', '3.2.0', '3.2.1']", "output": "'3.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42610_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003618", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[1, 2, 4], [5, 0, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003619", "code": "def extract_versions(dependencies):\n    versions_dict = {}\n    for dependency in dependencies:\n        package_name, version = dependency.split('==')\n        versions_dict[package_name] = [version]\n    return versions_dict\n", "entry_point": "extract_versions", "input": "['pandas==1.0.3']", "output": "{'pandas': ['1.0.3']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20257_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003620", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1137 * 5", "output": "{1, 3, 5, 1895, 15, 1137, 5685, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003621", "code": "from typing import List\ndef find_target_index(collection: List[int], target: int) -> int:\n    left, right = 0, len(collection) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if collection[mid] == target:\n            return mid\n        elif collection[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return -1\n", "entry_point": "find_target_index", "input": "[1, 3, 5, 7, 9], 7", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29277_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003622", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(1, len(lst)):\n        abs_diff_sum += abs(lst[i] - lst[i - 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 10, 20, 26]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72973_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003623", "code": "def sum_of_squares_even(numbers):\n    sum_even_squares = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            sum_even_squares += num ** 2  # Square the even number and add to the sum\n    return sum_even_squares\n", "entry_point": "sum_of_squares_even", "input": "[4, 8]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86520_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003624", "code": "import re\ndef count_unique_admin_classes(code_snippet):\n    admin_classes = set()\n    pattern = r'admin\\.site\\.register\\(([\\w]+),\\s*([\\w]+)\\)'\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        admin_class_name = match[1]\n        admin_classes.add(admin_class_name)\n    return len(admin_classes)\n", "entry_point": "count_unique_admin_classes", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118908_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1717", "output": "{1, 101, 1717, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1716", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7978", "output": "{1, 7978, 2, 3989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003627", "code": "from typing import List, Dict\ndef process_metadata(metadata_list: List[Dict[str, any]]) -> Dict[str, List[int]]:\n    collection_timestamps = {}\n    for metadata in metadata_list:\n        name = metadata[\"name\"]\n        timestamps = metadata[\"timestamps\"]\n        if name in collection_timestamps:\n            collection_timestamps[name].extend(timestamps)\n        else:\n            collection_timestamps[name] = timestamps\n    return collection_timestamps\n", "entry_point": "process_metadata", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67711_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003628", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4673", "output": "{4673, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9986", "output": "{1, 9986, 2, 4993}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003630", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[3, 4, 7, 7, 7, 1], 1", "output": "[3, 4, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003631", "code": "from typing import List\ndef custom_reduce_product(nums: List[int]) -> int:\n    result = 1\n    for num in nums:\n        result *= num\n    return result\n", "entry_point": "custom_reduce_product", "input": "[100, 72, 4]", "output": "28800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84659_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003632", "code": "DICTCOMMIT = \"d127bb07681750556db90083bc63de1df9f81d71\"\nDICTVERSION = \"2.0.1-6-gd127bb0\"\ndef count_matching_characters(str1, str2):\n    matching_count = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            matching_count += 1\n    return matching_count\n", "entry_point": "count_matching_characters", "input": "'abcd', 'efgh'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122306_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003633", "code": "def calculate_score(numbers):\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    if total > 30:\n        return \"High Score!\"\n    else:\n        return total\n", "entry_point": "calculate_score", "input": "[3, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123213_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003634", "code": "def parse_afni_output(output_string):\n    lines = output_string.splitlines()\n    values_list = []\n    for line in lines:\n        try:\n            float_value = float(line)\n            values_list.append(float_value)\n        except ValueError:\n            pass  # Ignore lines that are not valid float values\n    return values_list\n", "entry_point": "parse_afni_output", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003635", "code": "def filter_data_under_30(data):\n    filtered_data = []\n    for row in data:\n        if row.get('age', 0) >= 30:\n            filtered_data.append(row)\n    return filtered_data\n", "entry_point": "filter_data_under_30", "input": "[{'age': 25}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79304_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003636", "code": "def play_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    if player1_score > player2_score:\n        return \"Player 1 wins\"\n    elif player2_score > player1_score:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "play_card_game", "input": "[1, 2, 3], [4, 5, 6]", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147223_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003637", "code": "def get_default_route(application):\n    routers = dict(\n        BASE = dict(\n            default_application = \"webremote\",\n            default_controller = \"webremote\",\n            default_function = \"index\",\n        )\n    )\n    if application in routers:\n        return (application, routers[application]['default_controller'], routers[application]['default_function'])\n    else:\n        return \"Application not found\"\n", "entry_point": "get_default_route", "input": "'NOT_A_KEY'", "output": "'Application not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126500_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003638", "code": "def generate_indented_list(n):\n    output = \"\"\n    for i in range(1, n + 1):\n        indent = \"    \" * (i - 1)  # Generate the appropriate level of indentation\n        output += f\"{i}. {indent}Item {i}\\n\"\n    return output\n", "entry_point": "generate_indented_list", "input": "1", "output": "'1. Item 1\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95960_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003639", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[6, 2, 7, 3, 6, 2, 6]", "output": "[2, 2, 3, 6, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003640", "code": "def get_author_emails(language: str, data: dict) -> set:\n    if language in data:\n        return data[language].get('AUTHORS_EMAILS', set())\n    else:\n        return set()\n", "entry_point": "get_author_emails", "input": "'Python', {}", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88997_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003641", "code": "def max_sum_non_adjacent(lst):\n    if not lst:\n        return 0\n    include = lst[0]\n    exclude = 0\n    for i in range(1, len(lst)):\n        new_include = lst[i] + exclude\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 5, 20]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30525_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003642", "code": "def play_card_game(deck_a, deck_b):\n    total_sum = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        total_sum += card_a + card_b\n    if total_sum % 2 == 0:\n        return \"Player A\"\n    else:\n        return \"Player B\"\n", "entry_point": "play_card_game", "input": "[2, 4], [2, 4]", "output": "'Player A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147739_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003643", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'WORWORL'", "output": "'WORWORL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003644", "code": "import re\nHIDDEN_SETTING = re.compile(r\"URL|BACKEND\")\ndef count_unique_long_words(text: str, length: int) -> int:\n    words = text.split()\n    filtered_words = [word.lower() for word in words if not HIDDEN_SETTING.search(word)]\n    unique_long_words = set(word for word in filtered_words if len(word) > length)\n    return len(unique_long_words)\n", "entry_point": "count_unique_long_words", "input": "'', 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45296_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003645", "code": "def extract_version_components(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "extract_version_components", "input": "'0.159.0'", "output": "(0, 159, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27689_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003646", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "total_size_in_kb", "input": "[2500, 2500, 2168]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33137_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003647", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[6, 6, 6, 7, 7, 8, 8]", "output": "6.857142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003648", "code": "import re\ndef parse_migration_script(script):\n    foreign_keys = []\n    # Regular expression pattern to match op.create_foreign_key calls\n    pattern = r\"op\\.create_foreign_key\\(None, '(\\w+)', '(\\w+)', \\['(\\w+)'\\], \\['(\\w+)'\\]\\)\"\n    # Find all matches in the script\n    matches = re.findall(pattern, script)\n    # Extract and store the foreign key constraints\n    for match in matches:\n        table_name, column_name, referenced_table, referenced_column = match\n        foreign_keys.append((table_name, column_name, referenced_table, referenced_column))\n    return foreign_keys\n", "entry_point": "parse_migration_script", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16671_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8851", "output": "{1, 8851, 53, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003650", "code": "def extract_unique_tags(html_content):\n    unique_tags = set()\n    tag = ''\n    inside_tag = False\n    for char in html_content:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n            tag = tag.strip()\n            if tag:\n                unique_tags.add(tag)\n            tag = ''\n        elif inside_tag:\n            if char.isalnum():\n                tag += char\n    return sorted(list(unique_tags))\n", "entry_point": "extract_unique_tags", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126025_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003651", "code": "def sum_multiples(nums):\n    total = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[3, 5, 6, 10, 12]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1463_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "907", "output": "{1, 907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003653", "code": "import re\ndef extract_module_names(code_snippet):\n    module_names = set()\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if 'import' in line or 'from' in line:\n            modules = re.findall(r'(?:import|from)\\s+([\\w\\.]+)', line)\n            for module in modules:\n                module_names.update(re.findall(r'(?<!\\.)\\b\\w+\\b', module))\n    return module_names\n", "entry_point": "extract_module_names", "input": "''", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131886_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003654", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 42, 41, 30, 25]", "output": "[42, 42, 41]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003655", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'Coding'", "output": "'oding'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003656", "code": "def calculate_language_capacity(gene, age, pleio):\n    start = (10 - pleio) * age\n    total_capacity = sum(gene[start:start + 10])\n    return max(0, total_capacity)\n", "entry_point": "calculate_language_capacity", "input": "[0] * 20, 1, 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41245_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "50", "output": "{1, 2, 5, 10, 50, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt49", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003658", "code": "def is_multiple(a, b):\n    return a % b == 0\n", "entry_point": "is_multiple", "input": "5, 3", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29243_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003659", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'nanapps.some.intermediate.values.nnnnNg'", "output": "('nanapps', 'nnnnNg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2391", "output": "{1, 3, 797, 2391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2390", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003661", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "9, 4, 5", "output": "(1928, 1582)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003662", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "20.0, 15.0", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003663", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'se_cle'", "output": "'seCle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003664", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    max_height = 0\n    for height in buildings:\n        total_area += max(0, height - max_height)\n        max_height = max(max_height, height)\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48707_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003665", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "None, 12344", "output": "'https://www.fitx.de/fitnessstudios/12344'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003666", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'wo!rld'", "output": "['wo!rld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003667", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "115004", "output": "57502", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003668", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/w/www/images', 'logoo/ng'", "output": "'/w/www/images/logoo/ng'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003669", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4869", "output": "{1, 3, 4869, 9, 1623, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4336", "output": "{1, 2, 4, 8, 271, 4336, 16, 2168, 1084, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4335", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003671", "code": "def rusher_wpbf(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "rusher_wpbf", "input": "[1, 3, 5, 3, 4, 1]", "output": "[4, 8, 8, 7, 5, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138675_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003672", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 4, 4, 8, 8, 3, 12, 5, 7]", "output": "[4, 4, 4, 8, 8, 9, 12, 25, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003673", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 2, 2, 3, 3, 3, 4, 4, 4, 4]", "output": "{1: 1, 2: 2, 3: 3, 4: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003674", "code": "def count_substring(s: str, sub_s: str) -> int:\n    count = 0\n    for i in range(len(s) - len(sub_s) + 1):\n        if s[i:i+len(sub_s)] == sub_s:\n            count += 1\n    return count\n", "entry_point": "count_substring", "input": "'', 'abc'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128804_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003675", "code": "def extract_major_minor_version(version_string):\n    # Split the version string by the dot ('.') character\n    version_parts = version_string.split('.')\n    # Extract the major version\n    major_version = int(version_parts[0])\n    # Extract the minor version by removing non-numeric characters\n    minor_version = ''.join(filter(str.isdigit, version_parts[1]))\n    # Convert the major and minor version parts to integers\n    minor_version = int(minor_version)\n    # Return a tuple containing the major and minor version numbers\n    return major_version, minor_version\n", "entry_point": "extract_major_minor_version", "input": "'3.x41424'", "output": "(3, 41424)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141202_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003676", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<jsmith@example.org>'", "output": "('jsmith@example.org', 'example.org')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003677", "code": "def get_rgb_value(color):\n    color_map = {\n        \"RED\": (255, 0, 0),\n        \"GREEN\": (0, 255, 0),\n        \"BLUE\": (0, 0, 255),\n        \"YELLOW\": (255, 255, 0),\n        \"CYAN\": (0, 255, 255),\n        \"MAGENTA\": (255, 0, 255),\n        \"WHITE\": (255, 255, 255),\n        \"BLACK\": (0, 0, 0)\n    }\n    return color_map.get(color, \"Color not found\")\n", "entry_point": "get_rgb_value", "input": "'RED'", "output": "(255, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45808_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003678", "code": "def sum_of_squares_of_evens(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total_sum += num ** 2  # Add the square of the even number to the total sum\n    return total_sum\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 4, 10]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8266_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003679", "code": "def is_boolean(value):\n    true_values = {'true', '1', 't', 'y', 'yes', 'on'}\n    return value.lower() in true_values\n", "entry_point": "is_boolean", "input": "'no'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30286_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003680", "code": "def extract_purpose(script_content):\n    lines = script_content.split('\\n')\n    in_comment = False\n    for line in lines:\n        if '\"\"\"' in line:\n            in_comment = not in_comment\n        if in_comment and 'Proposito:' in line:\n            purpose = line.split('Proposito:')[1].strip()\n            return purpose\n    return \"Purpose not found\"\n", "entry_point": "extract_purpose", "input": "'This is a script with no comments.'", "output": "'Purpose not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80203_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003681", "code": "def twoSum(nums, index, tar):\n    check = set([])\n    appear = set([])\n    result = []\n    for i in range(index, len(nums)):\n        if tar - nums[i] in check:\n            if (tar - nums[i], nums[i]) not in appear:\n                result.append([tar - nums[i], nums[i]])\n            appear.add((tar - nums[i], nums[i]))\n        check.add(nums[i])\n    return result\n", "entry_point": "twoSum", "input": "[], 0, 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80777_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8998", "output": "{1, 2, 8998, 11, 818, 4499, 22, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8997", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003683", "code": "from typing import List\ndef count_items_above_average(items: List[int]) -> int:\n    if not items:\n        return 0\n    average_weight = sum(items) / len(items)\n    count = sum(1 for item in items if item > average_weight)\n    return count\n", "entry_point": "count_items_above_average", "input": "[4, 5, 7, 8]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73147_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003684", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'-214 -214'", "output": "'-214 -214'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003685", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[60, 70, 75, 75, 90]", "output": "73.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39901_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003686", "code": "MEBIBYTE = 1024 * 1024\nSTREAMING_DEFAULT_PART_SIZE = 10 * MEBIBYTE\nDEFAULT_PART_SIZE = 128 * MEBIBYTE\nOBJECT_USE_MULTIPART_SIZE = 128 * MEBIBYTE\ndef determine_part_size(file_size):\n    if file_size <= STREAMING_DEFAULT_PART_SIZE:\n        return STREAMING_DEFAULT_PART_SIZE\n    elif file_size <= DEFAULT_PART_SIZE:\n        return DEFAULT_PART_SIZE\n    else:\n        return OBJECT_USE_MULTIPART_SIZE\n", "entry_point": "determine_part_size", "input": "134217728", "output": "134217728", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_780_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003687", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_repeated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_repeated_scores:\n        return max(non_repeated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_repeated_score", "input": "[90, 91, 92, 93, 93]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144053_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9958", "output": "{1, 2, 9958, 13, 4979, 26, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003689", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'Alice', 'Debris'", "output": "'ALI_deb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003690", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 85, 80, 70, 70]", "output": "[90, 85, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003691", "code": "def count_passed_students(scores):\n    pass_count = 0\n    for score in scores:\n        if score >= 50:\n            pass_count += 1\n    return pass_count\n", "entry_point": "count_passed_students", "input": "[50, 60, 70, 80, 90, 50, 45, 40]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140531_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003692", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[4, 4, 3, 3, 6, 2, 2]", "output": "[4, 3, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003693", "code": "import math\ndef mint_pizza(slices_per_person, slices_per_pizza):\n    total_slices_needed = sum(slices_per_person)\n    min_pizzas = math.ceil(total_slices_needed / slices_per_pizza)\n    return min_pizzas\n", "entry_point": "mint_pizza", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149850_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003694", "code": "import math\ndef min_sum_pair(n):\n    dist = n\n    for i in range(1, math.floor(math.sqrt(n)) + 1):\n        if n % i == 0:\n            j = n // i\n            dist = min(dist, i + j - 2)\n    return dist\n", "entry_point": "min_sum_pair", "input": "80", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134268_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003695", "code": "def parse_config_file(config_data: str) -> dict:\n    config_dict = {}\n    for line in config_data.split('\\n'):\n        line = line.strip()\n        if line and not line.startswith('#'):\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip()\n    return config_dict\n", "entry_point": "parse_config_file", "input": "'PORT=8080\\nENABLE_FEATURE=true'", "output": "{'PORT': '8080', 'ENABLE_FEATURE': 'true'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101724_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003696", "code": "import ast\ndef ast_to_literal(node):\n    if isinstance(node, ast.AST):\n        field_names = node._fields\n        res = {'constructor': node.__class__.__name__}\n        for field_name in field_names:\n            field = getattr(node, field_name, None)\n            field = ast_to_literal(field)\n            res[field_name] = field\n        return res\n    if isinstance(node, list):\n        res = []\n        for each in node:\n            res.append(ast_to_literal(each))\n        return res\n    return node\n", "entry_point": "ast_to_literal", "input": "'xxxxx'", "output": "'xxxxx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99020_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003697", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 7, 2, 5]", "output": "[3, 8, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7282", "output": "{1, 2, 11, 331, 7282, 662, 22, 3641}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003699", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[75, 75, 75, 75, 85, 100, 100, 92, 74]", "output": "{75: 4, 85: 1, 100: 2, 92: 1, 74: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003700", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[4, 7, 5, 10, 3, 6, 5, 3, 3], 8", "output": "[[4, 7, 5, 10, 3, 6, 5, 3], [3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003701", "code": "import os\ndef count_files_with_extension(base_dir, target_extension):\n    file_count = 0\n    if os.path.exists(base_dir) and os.path.isdir(base_dir):\n        for file_name in os.listdir(base_dir):\n            if os.path.isfile(os.path.join(base_dir, file_name)) and file_name.endswith(target_extension):\n                file_count += 1\n    return file_count\n", "entry_point": "count_files_with_extension", "input": "'/nonexistent/directory', '.txt'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23214_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003702", "code": "from typing import List\nMAX_TRANSACTION_SIZE_IN_BYTES = 4096\nSCRIPT_HASH_LENGTH = 32\ndef validate_transaction_payload(script: str, arguments: List[str]) -> bool:\n    total_size = len(script) + sum(len(arg) for arg in arguments)\n    if total_size > MAX_TRANSACTION_SIZE_IN_BYTES:\n        return False\n    script_hash_length = len(script)\n    if script_hash_length != SCRIPT_HASH_LENGTH:\n        return False\n    return True\n", "entry_point": "validate_transaction_payload", "input": "'', []", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89467_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003703", "code": "def process_commands(commands):\n    working_copy = {}\n    for command in commands:\n        parts = command.split()\n        if parts[0] == \"add\":\n            working_copy[parts[1]] = parts[1]\n        elif parts[0] == \"delete\":\n            working_copy.pop(parts[1], None)\n        elif parts[0] == \"update\":\n            working_copy[parts[1]] = parts[1]\n        elif parts[0] == \"copy\":\n            working_copy[parts[2]] = working_copy.get(parts[1], None)\n    return list(working_copy.values())\n", "entry_point": "process_commands", "input": "['add test', 'delete test']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124145_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003704", "code": "def is_balanced_parentheses(s: str) -> bool:\n    stack = []\n    for char in s:\n        if char == \"(\":\n            stack.append(char)\n        elif char == \")\":\n            if not stack:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "is_balanced_parentheses", "input": "')'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124796_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003705", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "23, 10", "output": "1144066", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003706", "code": "import re\ndef count_copyright_holders(code_snippet):\n    copyright_holders = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        match = re.search(r'Copyright \\(c\\) (.+?) \\d{4}', line)\n        if match:\n            holder = match.group(1)\n            if holder in copyright_holders:\n                copyright_holders[holder] += 1\n            else:\n                copyright_holders[holder] = 1\n    return copyright_holders\n", "entry_point": "count_copyright_holders", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5041_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003707", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level1': 103, 'level2': 103, 'level3': 103, 'level4': 103}", "output": "412", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003708", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3514", "output": "{1, 2, 7, 14, 502, 3514, 251, 1757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003709", "code": "def analyze_title(title, max_length):\n    violations = []\n    if not title:\n        violations.append(\"1: B6 Body message is missing\")\n    else:\n        if len(title) > max_length:\n            violations.append(f\"1: T1 Title exceeds max length ({len(title)}>{max_length}): \\\"{title}\\\"\")\n        if title[-1] in ['.', '!', '?']:\n            violations.append(f\"1: T3 Title has trailing punctuation ({title[-1]}): \\\"{title}\\\"\")\n    return '\\n'.join(violations)\n", "entry_point": "analyze_title", "input": "'Valid Title', 50", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140551_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003710", "code": "def determine_winner(deck1, deck2):\n    points_player1 = 0\n    points_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            points_player1 += 1\n        elif card2 > card1:\n            points_player2 += 1\n    if points_player1 > points_player2:\n        return 1\n    elif points_player2 > points_player1:\n        return 2\n    else:\n        return 0\n", "entry_point": "determine_winner", "input": "[1, 2, 3], [2, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60498_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003711", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[0, 0, 0, 0, 0, 0, 21]", "output": "(21, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003712", "code": "from datetime import datetime\ndef get_day_of_week(date_str):\n    try:\n        date = datetime.strptime(date_str, \"%Y-%m-%d\")\n        day_of_week = date.strftime(\"%A\")\n        return day_of_week\n    except ValueError:\n        return \"Invalid Date\"\n", "entry_point": "get_day_of_week", "input": "'2023-10-01'", "output": "'Sunday'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69670_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003713", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{0: 2, 1: 3, 2: 1}", "output": "[0, 0, 1, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003714", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "66535409, 0, 2", "output": "66535409", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003715", "code": "import re\ndef extract_log_info(log_message: str) -> dict:\n    pattern = r\"<green>(.*?)</green> \\| (\\w+) \\| (.*)\"\n    match = re.match(pattern, log_message)\n    if match:\n        timestamp = match.group(1)\n        log_level = match.group(2)\n        message = match.group(3)\n        return {'timestamp': timestamp, 'log_level': log_level, 'message': message}\n    else:\n        return {}  # Return empty dictionary if the log message format does not match\n", "entry_point": "extract_log_info", "input": "'Some random log message'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44422_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003716", "code": "def determine_next_state(task_type, current_state):\n    priorities = {\n        'ROOT': 40,\n        'VM': 50,\n        'LOADER': 60,\n        'INTERRUPT': 70,\n        'PRINT': 70\n    }\n    memory_blocks = {\n        'PAGE_TABLE': range(0, 15),\n        'SHARED_MEMORY': range(15, 32),\n        'USER_TASKS': range(32, 256)\n    }\n    if task_type not in priorities or current_state not in ['running', 'ready', 'blocked']:\n        return \"Invalid input\"\n    current_priority = priorities[task_type]\n    next_state = current_state\n    if current_priority < priorities['ROOT']:\n        next_state = 'blocked'\n    elif current_priority < priorities['VM']:\n        if current_state == 'running':\n            next_state = 'ready'\n    elif current_priority < priorities['LOADER']:\n        if current_state == 'ready':\n            next_state = 'running'\n    elif current_priority < priorities['INTERRUPT']:\n        if current_state == 'blocked':\n            next_state = 'ready'\n    else:\n        if current_state == 'ready':\n            next_state = 'running'\n    for memory_type, memory_range in memory_blocks.items():\n        if memory_range[0] <= current_priority <= memory_range[-1]:\n            if current_priority not in memory_range:\n                next_state = 'blocked'\n    return next_state\n", "entry_point": "determine_next_state", "input": "'UNKNOWN', 'ready'", "output": "'Invalid input'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7318_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003717", "code": "import os\ndef check_config_file_exists(file_path: str) -> bool:\n    \"\"\"\n    Check if the configuration file exists at the specified file path.\n    Args:\n    file_path (str): The path to the configuration file.\n    Returns:\n    bool: True if the file exists, False otherwise.\n    \"\"\"\n    return os.path.exists(file_path)\n", "entry_point": "check_config_file_exists", "input": "'path/to/nonexistent/config.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3178_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003718", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "5, 0, 15", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003719", "code": "def extend_oid(base_oid, extension_tuple):\n    extended_oid = base_oid + extension_tuple\n    return extended_oid\n", "entry_point": "extend_oid", "input": "(4, 6, -1), (5, 4, 0, -1, 6)", "output": "(4, 6, -1, 5, 4, 0, -1, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97535_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003720", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "4", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003721", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5263", "output": "{1, 19, 277, 5263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003722", "code": "def prepare_argument(arg, num):\n    if isinstance(arg, float):\n        return [arg] * num\n    try:\n        evaluated_arg = eval(arg)\n        if isinstance(evaluated_arg, list):\n            return evaluated_arg\n    except:\n        pass\n    return [arg] * num\n", "entry_point": "prepare_argument", "input": "3.14, 3", "output": "[3.14, 3.14, 3.14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81072_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4777", "output": "{1, 4777, 17, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2474", "output": "{1, 2474, 2, 1237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003725", "code": "def get_first_n_elements(L, n):\n    if n < 0:\n        n = 0\n    if n > len(L):\n        n = len(L)\n    return L[:n]\n", "entry_point": "get_first_n_elements", "input": "['sarah', 'srah', 'sarah'], 3", "output": "['sarah', 'srah', 'sarah']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16455_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003726", "code": "def convert_bytes(num):\n    for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:\n        if num < 1024.0 and num > -1024.0:\n            return \"{0:.1f} {1}\".format(num, x)\n        num /= 1024.0\n", "entry_point": "convert_bytes", "input": "5368709120", "output": "'5.0 GB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132353_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003727", "code": "def can_place_flowers(flowerbed, n):\n    cnt = 0\n    flowerbed = [0] + flowerbed + [0]  # Add 0s at the beginning and end for boundary check\n    for i in range(1, len(flowerbed) - 1):\n        if flowerbed[i - 1] == flowerbed[i] == flowerbed[i + 1] == 0:\n            flowerbed[i] = 1\n            cnt += 1\n    return cnt >= n\n", "entry_point": "can_place_flowers", "input": "[0, 0, 0], 1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147289_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003728", "code": "def merge_intervals(intervals):\n    if not intervals:\n        return []\n    intervals.sort(key=lambda x: x[0])  # Sort intervals based on start point\n    merged = [intervals[0]]\n    for interval in intervals[1:]:\n        if interval[0] <= merged[-1][1]:  # Overlapping intervals\n            merged[-1][1] = max(merged[-1][1], interval[1])\n        else:\n            merged.append(interval)\n    return merged\n", "entry_point": "merge_intervals", "input": "[[1, 3], [2, 5], [4, 6], [8, 10], [15, 18]]", "output": "[[1, 6], [8, 10], [15, 18]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8115_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003729", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "12", "output": "[1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003730", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'1.2.3'", "output": "'1.2.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003731", "code": "legacy_bundled_packages = {\n    'pycurl': [2, 3],\n    'scribe': [2],\n    'dataclasses': [3]\n}\ndef is_legacy_bundled_package(package_name: str, python_version: int) -> bool:\n    if package_name in legacy_bundled_packages:\n        return python_version in legacy_bundled_packages[package_name]\n    return False\n", "entry_point": "is_legacy_bundled_package", "input": "'numpy', 3", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132979_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2421", "output": "{1, 3, 807, 9, 269, 2421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003733", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 3, 3, 3, 2, 2, 2, 2, 3]", "output": "[3, 6, 9, 8, 10, 12, 14, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003734", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 6, 9, 10, 15]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36407_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003735", "code": "import re\ndef check_security_vulnerabilities(code_snippet):\n    vulnerabilities = []\n    if \"def server_error(request):\" in code_snippet:\n        vulnerabilities.append(\"Potential security vulnerability: Server error handler may expose sensitive information.\")\n    if \"@login_required\" in code_snippet:\n        vulnerabilities.append(\"Potential security vulnerability: 'login_required' decorator used without proper validation.\")\n    return vulnerabilities\n", "entry_point": "check_security_vulnerabilities", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64058_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1802", "output": "{1, 2, 34, 901, 1802, 106, 17, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003737", "code": "from typing import Tuple\nimport re\ndef extract_license_info(file_content: str) -> Tuple[str, str]:\n    match = re.search(r'\"\"\"(.*?)\"\"\"', file_content, re.DOTALL)\n    if match:\n        copyright_text = match.group(1)\n        license_version_match = re.search(r'licensed under the (.*?)\\.', copyright_text)\n        company_name_match = re.search(r'C\\) (\\w+ \\w+ Limited)', copyright_text)\n        if license_version_match and company_name_match:\n            return license_version_match.group(1), company_name_match.group(1)\n    return \"License information not found\", \"\"\n", "entry_point": "extract_license_info", "input": "''", "output": "('License information not found', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62389_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003738", "code": "def is_long_pressed_name(name: str, typed: str) -> bool:\n    i, j = 0, 0\n    while j < len(typed):\n        if i < len(name) and name[i] == typed[j]:\n            i += 1\n            j += 1\n        elif j > 0 and typed[j] == typed[j - 1]:\n            j += 1\n        else:\n            return False\n    return i == len(name)\n", "entry_point": "is_long_pressed_name", "input": "'alex', 'aax'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52370_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003739", "code": "def sum_multiples_3_5(numbers):\n    multiples_set = set()\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples_set:\n                total_sum += num\n                multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 9]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141969_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003740", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "67, 2", "output": "2211", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1959", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003741", "code": "def detect_file_type(filename):\n    if filename[-3:] == 'csv':\n        return 'csv'\n    elif filename[-4:] in ['xlsx', 'xls']:\n        return 'excel'\n    else:\n        return 'autre'\n", "entry_point": "detect_file_type", "input": "'data.xlsx'", "output": "'excel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149095_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003742", "code": "def total_cost(items, prices):\n    total = 0\n    for item, price in zip(items, prices):\n        total += price\n    return total\n", "entry_point": "total_cost", "input": "['item1', 'item2'], [1.0, 1.5]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63562_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003743", "code": "def calculate_output(n):\n    remainder = n % 8\n    if remainder == 0:\n        return 2\n    elif remainder <= 5:\n        return remainder\n    else:\n        return 10 - remainder\n", "entry_point": "calculate_output", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17799_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003744", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1.0, 3.12", "output": "3.12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "208", "output": "{1, 2, 4, 104, 8, 13, 208, 16, 52, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt207", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2930", "output": "{1, 2, 5, 293, 586, 10, 2930, 1465}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2929", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003747", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "999", "output": "{1, 3, 37, 999, 9, 333, 111, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003748", "code": "def extract_version(version):\n    try:\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "extract_version", "input": "'1.2.23'", "output": "(1, 2, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19951_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003749", "code": "def find_starting_tokens(e):\n    starting_tokens = []\n    current_label = None\n    for i, label in enumerate(e):\n        if label != current_label:\n            starting_tokens.append(i)\n            current_label = label\n    return starting_tokens\n", "entry_point": "find_starting_tokens", "input": "['A', 'B', 'C', 'D', 'E', 'F']", "output": "[0, 1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47145_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003750", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'25.11.2023'", "output": "'25.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003751", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "6, 7, 16", "output": "(0, 3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003752", "code": "def decode_cipher(encoded_str, shift):\n    decoded_str = ''\n    for char in encoded_str:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            decoded_char = chr((ord(char) - shift - base) % 26 + base)\n            decoded_str += decoded_char\n        else:\n            decoded_str += char\n    return decoded_str\n", "entry_point": "decode_cipher", "input": "'qquf', 2", "output": "'oosd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69667_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003753", "code": "def count_non_whitespace_chars(input_string):\n    count = 0\n    for char in input_string:\n        if not char.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'Python!2A'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117092_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003754", "code": "# Define a function to check if a string has a length greater than 5 characters\ndef check_length(s):\n    return len(s) > 5\n", "entry_point": "check_length", "input": "'hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55794_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003755", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, 3, 4, 5, -1, -2]", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003756", "code": "from typing import List\ndef find_highest_lexicographical_tutor(tutors: List[str]) -> str:\n    highest_lex_tutor = max(tutors, key=str)\n    for tutor in tutors[1:]:\n        if tutor > highest_lex_tutor:\n            highest_lex_tutor = tutor\n    return highest_lex_tutor\n", "entry_point": "find_highest_lexicographical_tutor", "input": "['zara', 'lion', 'apple', 'tutor']", "output": "'zara'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47260_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003757", "code": "import logging\nimport urllib.request\nimport urllib.error\n# Configure logging\nlogging.basicConfig(level=logging.INFO)  # Set the logging level to INFO\ndef get_url_status(url):\n    if url is None:\n        return False\n    try:\n        response = urllib.request.urlopen(url)\n        return response.status == 200\n    except urllib.error.HTTPError as e:\n        logging.info('Error: %s' % e)\n    except Exception as e:\n        logging.warning('Error: %s' % e)\n    return False\n", "entry_point": "get_url_status", "input": "None", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60754_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003758", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[9], 1, 1", "output": "[9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003759", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "13", "output": "'GetTelemetry'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003760", "code": "default_build_pattern = \"(bEXP_ARCH1|bSeriesTOC)\"\ndefault_process_pattern = \"(bKBD3|bSeriesTOC)\"\noptions = None\nSRC_CODES_TO_INCLUDE_PARAS = [\"GW\", \"SE\"]\nDATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE = [\"IPL\", \"ZBK\", \"NLP\", \"SE\", \"GW\"]\ndef process_source_code(source_code):\n    include_paragraphs = source_code in SRC_CODES_TO_INCLUDE_PARAS\n    create_update_notification = source_code not in DATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE\n    return include_paragraphs, create_update_notification\n", "entry_point": "process_source_code", "input": "'SE'", "output": "(True, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46779_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003761", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "'A'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003762", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "16", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003763", "code": "def countWordsAboveThreshold(text, threshold):\n    words = text.split()\n    count = 0\n    for word in words:\n        if len(word) > threshold:\n            count += 1\n    return count\n", "entry_point": "countWordsAboveThreshold", "input": "'hello', 4", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5618_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003764", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'glean_f6x', 10", "output": "'glean_f6x_high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003765", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'85,985,92,7,882,78'", "output": "[85, 985, 92, 7, 882, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003766", "code": "def extract_value(data, keys):\n    if not keys:\n        return data\n    key = keys[0]\n    if isinstance(data, list) and isinstance(key, int) and 0 <= key < len(data):\n        return extract_value(data[key], keys[1:])\n    elif isinstance(data, dict) and key in data:\n        return extract_value(data[key], keys[1:])\n    else:\n        return None\n", "entry_point": "extract_value", "input": "{'a': [{'b': 'x'}, {'c': 'c'}]}, ['a', 1, 'c']", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118033_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003767", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6073", "output": "{1, 6073}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003768", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'capclswdcpw'", "output": "'Manual not available for capclswdcpw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003769", "code": "def is_perfect_square(num):\n    if num < 0:\n        return False\n    sqrt_num = int(num ** 0.5)\n    return sqrt_num * sqrt_num == num\n", "entry_point": "is_perfect_square", "input": "1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_307_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8898", "output": "{4449, 1, 8898, 2, 3, 6, 1483, 2966}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9989", "output": "{1, 1427, 9989, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003772", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff11\uff12\uff13'", "output": "'123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003773", "code": "import ast\ndef parse_message_definition(definition):\n    def extract_fields(node):\n        fields = []\n        if isinstance(node, ast.Dict):\n            for key in node.keys:\n                if isinstance(key, ast.Str):\n                    fields.append(key.s)\n        return fields\n    def parse_node(node):\n        messages = {}\n        if isinstance(node, ast.Assign) and isinstance(node.value, ast.Call) and isinstance(node.value.func, ast.Attribute):\n            message_name = node.targets[0].id\n            if node.value.func.attr == 'GeneratedProtocolMessageType':\n                fields = extract_fields(node.value.args[2])\n                messages[message_name] = fields\n            for child_node in ast.walk(node):\n                if isinstance(child_node, ast.Call):\n                    messages.update(parse_node(child_node))\n        return messages\n    parsed = ast.parse(definition)\n    messages = {}\n    for node in parsed.body:\n        messages.update(parse_node(node))\n    return messages\n", "entry_point": "parse_message_definition", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116061_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003774", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "5", "output": "'SDL_LOG_CATEGORY_VIDEO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003775", "code": "from itertools import combinations\ndef find_largest_triangle_area(points):\n    def triangle_area(x1, y1, x2, y2, x3, y3):\n        return abs(x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2) / 2\n    max_area = 0\n    for (x1, y1), (x2, y2), (x3, y3) in combinations(points, 3):\n        area = triangle_area(x1, y1, x2, y2, x3, y3)\n        max_area = max(max_area, area)\n    return max_area\n", "entry_point": "find_largest_triangle_area", "input": "[(0, 0), (1, 1), (2, 2)]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93237_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003776", "code": "def calculate_perimeter(grid):\n    N = len(grid)\n    ans = 0\n    for i in range(N):\n        for j in range(N):\n            if grid[i][j] == 0:\n                continue\n            height = grid[i][j]\n            ans += 2\n            for h in range(1, height + 1):\n                adj = [[i + 1, j], [i - 1, j], [i, j + 1], [i, j - 1]]\n                for a, b in adj:\n                    if a < 0 or N <= a or b < 0 or N <= b:\n                        ans += 1\n                    else:\n                        if h <= grid[a][b]:\n                            ans += 0\n                        else:\n                            ans += 1\n    return ans\n", "entry_point": "calculate_perimeter", "input": "[[0, 0], [0, 0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141809_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003777", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[85, 88, 90]", "output": "88.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27226_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003778", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[-1, 4, 4, 2, 4]", "output": "([-1, None, None, None], [4, 4, 2, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003779", "code": "def unique_sum(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "unique_sum", "input": "[1, 2, 4, 7, 10, 11, 13, 19]", "output": "67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140817_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003780", "code": "from typing import Dict, List, TypeVar, Union\nJsonTypeVar = TypeVar(\"JsonTypeVar\")\nJsonPrimitive = Union[str, float, int, bool, None]\nJsonDict = Dict[str, JsonTypeVar]\nJsonArray = List[JsonTypeVar]\nJson = Union[JsonPrimitive, JsonDict, JsonArray]\ndef count_primitive_values(json_data: Json) -> int:\n    count = 0\n    if isinstance(json_data, (str, float, int, bool, type(None))):\n        return 1\n    if isinstance(json_data, dict):\n        for value in json_data.values():\n            count += count_primitive_values(value)\n    elif isinstance(json_data, list):\n        for item in json_data:\n            count += count_primitive_values(item)\n    return count\n", "entry_point": "count_primitive_values", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7551_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003781", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8259", "output": "{3, 1, 8259, 2753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003782", "code": "def filter_artifacts(maven_rules):\n    artifacts = []\n    for rule in maven_rules:\n        if rule[\"sha1\"]:\n            artifacts.append(rule[\"artifact\"])\n    return artifacts\n", "entry_point": "filter_artifacts", "input": "[{'sha1': None, 'artifact': 'artifact'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83843_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003783", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[2, 2, 2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2054", "output": "{1, 2, 1027, 2054, 13, 79, 26, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003785", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[6, 5, 4, 4, 2, 0, 6]", "output": "[0, 2, 4, 4, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003786", "code": "def format_string(input_str: str) -> str:\n    parts = input_str.split('.')\n    formatted_parts = []\n    for part in parts:\n        if '(' in part:  # Check if it's a function\n            formatted_parts.append(part)\n        else:\n            formatted_parts.append(f'\"{part}\"')\n    return '.'.join(formatted_parts)\n", "entry_point": "format_string", "input": "'func.SomeFunctionarg2)'", "output": "'\"func\".\"SomeFunctionarg2)\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134126_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003787", "code": "def get_api_key(api_key_number):\n    api_keys = {\n        1: 'ELSEVIER_API_1',\n        2: 'ELSEVIER_API_2',\n        3: 'ELSEVIER_API_3',\n        4: 'ELSEVIER_API_4',\n    }\n    return api_keys.get(api_key_number, 'DEFAULT_API_KEY')\n", "entry_point": "get_api_key", "input": "1", "output": "'ELSEVIER_API_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137352_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8086", "output": "{1, 2, 4043, 13, 622, 8086, 311, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003789", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "':hhehwo:'", "output": "['hhehwo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003790", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2297", "output": "{1, 2297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003791", "code": "import base64\nimport re\n# Simulated JSON data encoded in base64\nsimulated_data = b'eyJ0cmVlcyI6eyJtYXN0ZXJzIjpbIm1hc3Rlcl1dfX0='  # {\"trees\":{\"masters\":[\"master\"]}}\nMASTER_RE = r'masters\":\\[\"(.*?)\"\\]'\ndef extract_masters_for_tree(tree):\n    decoded_data = base64.b64decode(simulated_data).decode('utf-8')\n    # Manually extract the relevant part of the JSON data\n    start_index = decoded_data.find('{\"trees\":')\n    if start_index == -1:\n        return []\n    relevant_data = decoded_data[start_index:]\n    masters = re.findall(MASTER_RE, relevant_data)\n    return masters\n", "entry_point": "extract_masters_for_tree", "input": "None", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83692_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003792", "code": "def iterativeBinarySearch(vector, wanted):\n    left_index = 0\n    right_index = len(vector) - 1\n    while left_index <= right_index:\n        pivot = (left_index + right_index) // 2\n        if vector[pivot] == wanted:\n            return pivot\n        elif vector[pivot] < wanted:\n            left_index = pivot + 1\n        else:\n            right_index = pivot - 1\n    return -1\n", "entry_point": "iterativeBinarySearch", "input": "[1, 2, 3, 4, 5], 6", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63734_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003793", "code": "def find_second_smallest(nums):\n    if len(nums) < 2:\n        return None\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif smallest < num < second_smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[1, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003794", "code": "def insert_position(scores, new_score):\n    position = 0\n    for score in scores:\n        if new_score >= score:\n            position += 1\n        else:\n            break\n    return position\n", "entry_point": "insert_position", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26274_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003795", "code": "import math\ndef organize_points_in_bins(pts, prec):\n    locs_pt = {tuple(pt): (math.floor(pt[0] / prec), math.floor(pt[1] / prec)) for pt in pts}\n    d_bin = dict()\n    for pt, loc in locs_pt.items():\n        if loc in d_bin:\n            d_bin[loc].append(pt)\n        else:\n            d_bin[loc] = [pt]\n    return d_bin\n", "entry_point": "organize_points_in_bins", "input": "[(4.5, 3.2)], 1.2", "output": "{(3, 2): [(4.5, 3.2)]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91944_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003796", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "find_single_number", "input": "[1, 1, 2, 2, 3, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67406_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003797", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[3, 1, 5, 7, 2, 6, 4, 8]", "output": "[2, 4, 6, 8, 1, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003798", "code": "def calculate_trainable_params(total_params, non_trainable_params):\n    trainable_params = total_params - non_trainable_params\n    return trainable_params\n", "entry_point": "calculate_trainable_params", "input": "24767875, 0", "output": "24767875", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112905_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003799", "code": "def convert_integers(numbers):\n    converted_list = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            converted_list.append('even_odd')\n        elif num % 2 == 0:\n            converted_list.append('even')\n        elif num % 3 == 0:\n            converted_list.append('odd')\n        else:\n            converted_list.append(num)\n    return converted_list\n", "entry_point": "convert_integers", "input": "[4, 4, 5, 4, 4, 9]", "output": "['even', 'even', 5, 'even', 'even', 'odd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77525_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003800", "code": "def find_operator(a, b, c):\n    operators = ['+', '-', '*', '/']\n    for op in operators:\n        if op == '+':\n            if a + b == c:\n                return True\n        elif op == '-':\n            if a - b == c:\n                return True\n        elif op == '*':\n            if a * b == c:\n                return True\n        elif op == '/':\n            if b != 0 and a / b == c:\n                return True\n    return False\n", "entry_point": "find_operator", "input": "2, 3, 5", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130763_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003801", "code": "def compare_versions(version1: str, version2: str) -> str:\n    def normalize_version(version):\n        parts = list(map(int, version.split('.')))\n        while len(parts) < 3:\n            parts.append(0)\n        return parts\n    v1 = normalize_version(version1)\n    v2 = normalize_version(version2)\n    for part1, part2 in zip(v1, v2):\n        if part1 > part2:\n            return \"Version 1 is greater\"\n        elif part1 < part2:\n            return \"Version 2 is greater\"\n    return \"Versions are equal\"\n", "entry_point": "compare_versions", "input": "'1.0', '1.0.0'", "output": "'Versions are equal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87736_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003802", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'2:34:47'", "output": "9287", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003803", "code": "def map_dataset_subset(dataset_name):\n    if dataset_name == \"train\":\n        return \"train_known\"\n    elif dataset_name == \"val\":\n        return \"train_unseen\"\n    elif dataset_name == \"test\":\n        return \"test_known\"\n    else:\n        return \"Invalid dataset subset name provided.\"\n", "entry_point": "map_dataset_subset", "input": "'invalid'", "output": "'Invalid dataset subset name provided.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39576_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003804", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "97, 74.0", "output": "(-48.5, 48.5, 111.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003805", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "'   sentence,  // comment'", "output": "'sentence,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003806", "code": "def is_anagram(str1: str, str2: str) -> bool:\n    # Check if lengths are equal\n    if len(str1) != len(str2):\n        return False\n    # Convert to lowercase and remove spaces\n    str1 = str1.lower().replace(\" \", \"\")\n    str2 = str2.lower().replace(\" \", \"\")\n    # Sort the strings\n    str1 = sorted(str1)\n    str2 = sorted(str2)\n    # Check if sorted strings are equal\n    return str1 == str2\n", "entry_point": "is_anagram", "input": "'abc', 'def'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145917_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003807", "code": "import re\ndef process_text(text):\n    re_check = re.compile(r\"^[a-z0-9_]+$\")\n    re_newlines = re.compile(r\"[\\r\\n\\x0b]+\")\n    re_multiplespaces = re.compile(r\"\\s{2,}\")\n    re_remindertext = re.compile(r\"( *)\\([^()]*\\)( *)\")\n    re_minuses = re.compile(r\"(?:^|(?<=[\\s/]))[-\\u2013](?=[\\dXY])\")\n    # Remove leading and trailing whitespace\n    text = text.strip()\n    # Replace multiple spaces with a single space\n    text = re_multiplespaces.sub(' ', text)\n    # Remove text enclosed within parentheses\n    text = re_remindertext.sub('', text)\n    # Replace '-' or '\u2013' with a space based on the specified conditions\n    text = re_minuses.sub(' ', text)\n    return text\n", "entry_point": "process_text", "input": "'He'", "output": "'He'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124316_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003808", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "7", "output": "'OUTLET'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4454", "output": "{1, 2, 34, 131, 4454, 262, 17, 2227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003810", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'banana\\norange', 'aple'", "output": "['aple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003811", "code": "from collections import defaultdict\ndef find_anagrams(s, p):\n    result = []\n    pattern_freq = defaultdict(int)\n    for char in p:\n        pattern_freq[char] += 1\n    start, end, match = 0, 0, 0\n    while end < len(s):\n        if s[end] in pattern_freq:\n            pattern_freq[s[end]] -= 1\n            if pattern_freq[s[end]] == 0:\n                match += 1\n        if match == len(pattern_freq):\n            result.append(start)\n        if end - start + 1 == len(p):\n            if s[start] in pattern_freq:\n                if pattern_freq[s[start]] == 0:\n                    match -= 1\n                pattern_freq[s[start]] += 1\n            start += 1\n        end += 1\n    return result\n", "entry_point": "find_anagrams", "input": "'ab', 'abc'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35223_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003812", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'A', 'B', 'C', 'D', 'E'], 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003813", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "8, 2", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt875", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003814", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "'NNNNNNN'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003815", "code": "def is_locale_independent(path):\n    MEDIA_URL = \"/media/\"  # Example MEDIA_URL\n    LOCALE_INDEPENDENT_PATHS = [\"/public/\", \"/static/\"]  # Example LOCALE_INDEPENDENT_PATHS\n    if MEDIA_URL and path.startswith(MEDIA_URL):\n        return True\n    for pattern in LOCALE_INDEPENDENT_PATHS:\n        if pattern in path:\n            return True\n    return False\n", "entry_point": "is_locale_independent", "input": "'/home/user/files'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74853_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003816", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8411", "output": "{1, 8411, 13, 647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003817", "code": "def sum_of_digits(num):\n    sum_digits = 0\n    # Loop to extract digits and sum them up\n    while num > 0:\n        digit = num % 10\n        sum_digits += digit\n        num //= 10\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55339_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003818", "code": "def find_second_smallest(nums):\n    if len(nums) < 2:\n        return None\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif smallest < num < second_smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[3, 4, 4, 5, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14329_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3508", "output": "{1, 2, 4, 877, 3508, 1754}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3507", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003820", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'mil.pm'", "output": "[('mil.pm', 'mil.pm')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003821", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3257", "output": "{1, 3257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003822", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2021-01-01', '2021-01-06'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003823", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'Hello,'", "output": "'Ifmmp-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003824", "code": "def sum_divisible_numbers(start, end, divisor):\n    sum_divisible = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            sum_divisible += num\n    return sum_divisible\n", "entry_point": "sum_divisible_numbers", "input": "10, 40, 10", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31930_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003825", "code": "def count_a_in_list(strings):\n    total_count = 0\n    for string in strings:\n        for char in string:\n            if char.lower() == 'a':\n                total_count += 1\n    return total_count\n", "entry_point": "count_a_in_list", "input": "['a']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113849_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003826", "code": "def extract_author_name(setup_config):\n    author_name = setup_config.get('author', 'Author not found')\n    return author_name\n", "entry_point": "extract_author_name", "input": "{}", "output": "'Author not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61880_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003827", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'/home/user/directory'", "output": "'/home/user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003828", "code": "def sum_secondary_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][len(matrix) - i - 1]\n    return diagonal_sum\n", "entry_point": "sum_secondary_diagonal", "input": "[[1, 2, 5], [3, 5, 4], [5, 6, 7]]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25784_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003829", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "0, 10, 2", "output": "21.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003830", "code": "def max_product_of_two(nums):\n    if len(nums) < 2:\n        return 0\n    max_product = float('-inf')\n    second_max_product = float('-inf')\n    for num in nums:\n        if num > max_product:\n            second_max_product = max_product\n            max_product = num\n        elif num > second_max_product:\n            second_max_product = num\n    return max_product * second_max_product if max_product != float('-inf') and second_max_product != float('-inf') else 0\n", "entry_point": "max_product_of_two", "input": "[1, 4, 9]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103728_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003831", "code": "def calculate_unique_lattice_points(kmesh):\n    k1, k2, k3 = kmesh\n    Rlist = [(R1, R2, R3) for R1 in range(-k1 // 2 + 1, k1 // 2 + 1)\n             for R2 in range(-k2 // 2 + 1, k2 // 2 + 1)\n             for R3 in range(-k3 // 2 + 1, k3 // 2 + 1)]\n    unique_points = set(Rlist)  # Convert to set to remove duplicates\n    return len(unique_points)\n", "entry_point": "calculate_unique_lattice_points", "input": "(0, 0, 0)", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135054_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003832", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 10", "output": "314.1592653589793", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003833", "code": "def pypi_url_to_dict(url):\n    if not url.startswith('https://pypi.org/project/'):\n        return {}\n    parts = url.split('/')\n    if len(parts) < 5:\n        return {}\n    project_name = parts[4]\n    version = parts[-1]\n    return {'project': project_name, 'version': version}\n", "entry_point": "pypi_url_to_dict", "input": "'http://randomsite.com/package/version'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75555_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003834", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "102.0, 49.0", "output": "(-51.0, 51.0, 136.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003835", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4769", "output": "{19, 1, 4769, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003836", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 91, 92, 90, 90, 90, 91]", "output": "90.57142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49545_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003837", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> int:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[90, 91, 91, 92, 92]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144629_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003838", "code": "from typing import List\ndef sum_absolute_differences(list1: List[int], list2: List[int]) -> int:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[10, 5, 15], [0, 0, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44502_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003839", "code": "def filter_dicts_by_name_starting_with_A(dict_list):\n    filtered_list = []\n    for dictionary in dict_list:\n        if 'name' in dictionary and dictionary.get('name', '').startswith('A'):\n            filtered_list.append(dictionary)\n    return filtered_list\n", "entry_point": "filter_dicts_by_name_starting_with_A", "input": "[{'name': 'Bob'}, {'name': 'Charlie'}, {'age': 20}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47627_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003840", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[80, 80, 80]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81649_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003841", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 84, 84, 84, 88]", "output": "84.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61788_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7925", "output": "{1, 5, 1585, 7925, 25, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7924", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003843", "code": "def sum_of_squares_even(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_squares_even", "input": "[2, 2, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10286_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003844", "code": "def sum_multiples_3_or_5(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_or_5", "input": "12", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36151_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003845", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 2, 4, 2, 1, 2, 4, 2, 1]", "output": "[1, 3, 7, 9, 10, 12, 16, 18, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003846", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'RePnyon', 'This is just a description without the keyword'", "output": "('RePnyon', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003847", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "10", "output": "'1 1 2 2 3 4 4 4 5 6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003848", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[3, 4, 6, 0, 7]", "output": "'0-3-4-6-7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003849", "code": "def sum_multiples_3_5(nums):\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15548_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003850", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt49", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003851", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6616", "output": "{1, 2, 4, 8, 3308, 1654, 6616, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6615", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003852", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[0, 7, 1, 7]", "output": "[7, 8, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003853", "code": "def count_pairs_with_difference(nums, k):\n    count = 0\n    num_set = set(nums)\n    for num in nums:\n        if num + k in num_set or num - k in num_set:\n            count += 1\n    return count\n", "entry_point": "count_pairs_with_difference", "input": "[1, 3], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1892_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003854", "code": "def generate_primes(limit):\n    is_prime = [True] * (limit + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(limit**0.5) + 1):\n        if is_prime[i]:\n            for j in range(i*i, limit + 1, i):\n                is_prime[j] = False\n    primes = [i for i in range(2, limit + 1) if is_prime[i]]\n    return primes\n", "entry_point": "generate_primes", "input": "37", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29097_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003855", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[1, 5, 18, 140, 541]", "output": "[18, 140, 541]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003856", "code": "def max_sum_non_adjacent(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 5, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7360_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003857", "code": "def calculate_max_voltage(gain):\n    if gain == 1:\n        max_VOLT = 4.096\n    elif gain == 2:\n        max_VOLT = 2.048\n    elif gain == 4:\n        max_VOLT = 1.024\n    elif gain == 8:\n        max_VOLT = 0.512\n    elif gain == 16:\n        max_VOLT = 0.256\n    else:  # gain == 2/3\n        max_VOLT = 6.144\n    return max_VOLT\n", "entry_point": "calculate_max_voltage", "input": "2 / 3", "output": "6.144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119884_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003858", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[10, 15, 20]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003859", "code": "def paginate_items(items, page_number):\n    ITEMS_PER_PAGE = 10  # Default value if settings not available\n    total_items = len(items)\n    total_pages = (total_items + ITEMS_PER_PAGE - 1) // ITEMS_PER_PAGE\n    if page_number < 1 or page_number > total_pages or not items:\n        return []\n    start_index = (page_number - 1) * ITEMS_PER_PAGE\n    end_index = min(start_index + ITEMS_PER_PAGE, total_items)\n    return items[start_index:end_index]\n", "entry_point": "paginate_items", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42452_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003860", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "-1, 25", "output": "-23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9473", "output": "{1, 9473}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003862", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[5, 7, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130400_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003863", "code": "def longest_subarray_with_distinct_elements(k):\n    n = len(k)\n    hashmap = dict()\n    j = 0\n    ans = 0\n    c = 0\n    for i in range(n):\n        if k[i] in hashmap and hashmap[k[i]] > 0:\n            while i > j and k[i] in hashmap and hashmap[k[i]] > 0:\n                hashmap[k[j]] -= 1\n                j += 1\n                c -= 1\n        hashmap[k[i]] = 1\n        c += 1\n        ans = max(ans, c)\n    return ans\n", "entry_point": "longest_subarray_with_distinct_elements", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37610_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003864", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hellohelow'", "output": "{'h': 2, 'e': 2, 'l': 3, 'o': 2, 'w': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16186_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003865", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[6, 6], 5", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003866", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "2, 4", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003867", "code": "def sum_fibonacci(n):\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    sum_fib = 1\n    fib_prev = 0\n    fib_curr = 1\n    for _ in range(2, n):\n        fib_next = fib_prev + fib_curr\n        sum_fib += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "10", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46852_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003868", "code": "def sum_of_even_numbers(input_list):\n    even_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_even_numbers", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7100_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003869", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[8, 8, 8, 9, 9]", "output": "[8, 9, 10, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003870", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[79, 81]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5899_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003871", "code": "# Define the list of file paths\npaths = [\n    \"/home/user/file1.txt\",\n    \"../folder/file2.txt\"\n]\n# Obfuscation function\ndef obfuscate_path(path):\n    obfuscated_path = ''\n    for char in path:\n        if char.isalpha():\n            obfuscated_path += chr((ord(char) - ord('a') + 3) % 26 + ord('a'))\n        else:\n            obfuscated_path += char\n    return obfuscated_path\n", "entry_point": "obfuscate_path", "input": "'/home/user/file1.txt'", "output": "'/krph/xvhu/iloh1.waw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103149_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003872", "code": "def check_compatibility(version1, version2):\n    major1, minor1, patch1 = map(int, version1.split('.'))\n    major2, minor2, patch2 = map(int, version2.split('.'))\n    if major1 != major2:\n        return \"Incompatible\"\n    elif minor1 != minor2:\n        return \"Partially compatible\"\n    elif patch1 != patch2:\n        return \"Compatible with restrictions\"\n    else:\n        return \"Compatible\"\n", "entry_point": "check_compatibility", "input": "'1.2.3', '1.2.4'", "output": "'Compatible with restrictions'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135189_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003873", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 86, 85, 85, 84, 75]", "output": "[92, 86, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003874", "code": "def numCells(grid):\n    max_heights = [max(row) for row in grid]  # Find the maximum height in each row\n    max_height = max(max_heights)  # Find the overall maximum height in the grid\n    count = sum(row.count(max_height) for row in grid)  # Count cells with the overall maximum height\n    return count\n", "entry_point": "numCells", "input": "[[3, 2], [1, 4]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8494_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003875", "code": "def generate_fibonacci_numbers(limit):\n    fibonacci_numbers = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_numbers.append(a)\n        a, b = b, a + b\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci_numbers", "input": "2", "output": "[0, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30929_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003876", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        if not char.isspace():\n            char = char.lower()\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'l e e'", "output": "{'l': 1, 'e': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36956_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003877", "code": "def analyze_character(string, character):\n    count = 0\n    first_position = None\n    last_position = None\n    for index, char in enumerate(string, start=1):\n        if char.lower() == character.lower():\n            count += 1\n            if first_position is None:\n                first_position = index\n            last_position = index\n    return count, first_position, last_position\n", "entry_point": "analyze_character", "input": "'', 'a'", "output": "(0, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63123_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003878", "code": "def min_changes_to_alternate(s):\n    one = 0\n    zero = 0\n    for i in range(len(s)):\n        if i > 0 and s[i] == s[i-1]:\n            continue\n        if s[i] == \"1\":\n            one += 1\n        else:\n            zero += 1\n    return min(one, zero)\n", "entry_point": "min_changes_to_alternate", "input": "'101011'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53461_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003879", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003880", "code": "def calculate_score(card_values):\n    total_score = 0\n    for card in card_values:\n        total_score += card\n    if total_score == 21:\n        return \"Blackjack!\"\n    elif total_score > 21:\n        return \"Bust!\"\n    else:\n        return total_score\n", "entry_point": "calculate_score", "input": "[10, 10, 2]", "output": "'Bust!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98295_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003881", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[1, 10]", "output": "9.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003882", "code": "def find_repeated_element(A):\n    count_dict = {}\n    for num in A:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    repeated_element = max(count_dict, key=count_dict.get)\n    return repeated_element\n", "entry_point": "find_repeated_element", "input": "[0, 0, 0, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99039_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003883", "code": "import sys\ndef validate_version_compatibility(version_tuple, version_suffix, min_python_version):\n    module_version = '.'.join(str(x) for x in version_tuple) + version_suffix\n    if sys.version_info >= min_python_version:\n        return True\n    else:\n        return False\n", "entry_point": "validate_version_compatibility", "input": "(3, 8, 0), '', (3, 8)", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2714_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003884", "code": "def convert_samples_to_strings(samples):\n    converted_samples = []\n    for sample in samples:\n        converted_sample = \"|\".join(sample[0]) + \"_\" + str(sample[1])\n        converted_samples.append(converted_sample)\n    return converted_samples\n", "entry_point": "convert_samples_to_strings", "input": "[([], []), ([], [])]", "output": "['_[]', '_[]']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95892_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003885", "code": "def simulate_card_game(deck_a, deck_b):\n    score_a, score_b = 0, 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    return score_a, score_b\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7, 4, 3], [1, 2, 3, 5, 4]", "output": "(3, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77887_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1455", "output": "{1, 97, 3, 291, 5, 485, 1455, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003887", "code": "def sum_multiples_of_3_or_5(nums):\n    multiples = set()\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples:\n                total += num\n                multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 9, 10]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66564_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003888", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'cat.dog.apple.an'", "output": "'apple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003889", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/path/to/your/file.txt'", "output": "'file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003890", "code": "import socket\ndef calculate_system_workload(workload_data, hostname):\n    local_hostname = socket.gethostname()\n    if hostname != local_hostname:\n        return -1\n    total_workload = sum(workload_data.values()) / len(workload_data) * 100\n    return total_workload\n", "entry_point": "calculate_system_workload", "input": "{'task1': 30, 'task2': 70}, 'another-computer'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47534_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003891", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9994", "output": "{1, 2, 4997, 38, 263, 9994, 526, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003892", "code": "# Database containing information about available spectra\ndatabase = {\n    'Bohlin2014': {\n        'filename': 'alpha_lyr_stis_008-edit.fits',\n        'description': 'Spectrum of Bohlin 2014',\n        'bibcode': '2014AJ....147..127B'\n    }\n}\ndef get_spectrum_info(spectrum_key):\n    if spectrum_key in database:\n        return database[spectrum_key]\n    else:\n        return 'Spectrum not found'\n", "entry_point": "get_spectrum_info", "input": "'UnknownSpectrum'", "output": "'Spectrum not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30227_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003893", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "983", "output": "{1, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003894", "code": "def count_ways(M, N, X):\n    if X > M * N:\n        return 0\n    ways = [[0 for _ in range(M * N + 1)] for _ in range(N + 1)]\n    for i in range(1, M + 1):\n        ways[1][i] = 1\n    for i in range(2, N + 1):\n        for j in range(1, X + 1):\n            for k in range(1, M + 1):\n                if j - k <= 0:\n                    continue\n                ways[i][j] += ways[i - 1][j - k]\n    return ways[N][X]\n", "entry_point": "count_ways", "input": "2, 2, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138246_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003895", "code": "def count_trailing_zeros(n):\n    count = 0\n    i = 5\n    while n // i > 0:\n        count += n // i\n        i *= 5\n    return count\n", "entry_point": "count_trailing_zeros", "input": "10", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135178_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003896", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 70, 20]", "output": "[1, 2, 3, 4, 5, 6, 7, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003897", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[0, 6, 6, 2, 2, 2, 2, 3]", "output": "{0: 1, 6: 2, 2: 4, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003898", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "2, 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003899", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(-1, 0, 0, -1, 4, -1, -1)", "output": "'(-1.0.0.-1.4.-1.-1)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003900", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[2, 2, 3, 3]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003901", "code": "import os\ndef find_files_with_extension(directory_path, target_dir_name, target_file_ext):\n    matching_files = []\n    for root, dirs, files in os.walk(directory_path):\n        if target_dir_name in dirs:\n            target_dir_path = os.path.join(root, target_dir_name)\n            for file in files:\n                if file.endswith(target_file_ext):\n                    matching_files.append(os.path.join(target_dir_path, file))\n    return matching_files\n", "entry_point": "find_files_with_extension", "input": "'/some/path', 'nonexistent_dir', '.txt'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141638_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003902", "code": "def count_unique_paths(graph_edges, start_vertex, end_vertex):\n    def dfs(current_vertex):\n        if current_vertex == end_vertex:\n            nonlocal unique_paths\n            unique_paths += 1\n            return\n        visited.add(current_vertex)\n        for edge in graph_edges:\n            source, destination = edge\n            if source == current_vertex and destination not in visited:\n                dfs(destination)\n        visited.remove(current_vertex)\n    unique_paths = 0\n    visited = set()\n    dfs(start_vertex)\n    return unique_paths\n", "entry_point": "count_unique_paths", "input": "[], 1, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110326_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003903", "code": "import ast\nfrom typing import List\ndef extract_public_functions(script: str) -> List[str]:\n    public_functions = []\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            if not node.name.startswith('_'):\n                public_functions.append(node.name)\n    return public_functions\n", "entry_point": "extract_public_functions", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26156_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003904", "code": "def calculate_project_cost(base_cost: float, cost_per_line: float, lines_of_code: int) -> float:\n    total_cost = base_cost + (lines_of_code * cost_per_line)\n    return total_cost\n", "entry_point": "calculate_project_cost", "input": "100, 12.615225, 100", "output": "1361.5225", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125885_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003905", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'emxampl_aontract'", "output": "'contracts/emxampl_aontract.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003906", "code": "def count_valid_groupings(n, k):\n    c1 = n // k\n    c2 = n // (k // 2)\n    if k % 2 == 1:\n        cnt = pow(c1, 3)\n    else:\n        cnt = pow(c1, 3) + pow(c2 - c1, 3)\n    return cnt\n", "entry_point": "count_valid_groupings", "input": "6, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122726_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003907", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(N, len(scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    average = top_scores_sum / num_students if num_students > 0 else 0.0\n    return average\n", "entry_point": "average_top_scores", "input": "[70, 75, 75], 3", "output": "73.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99565_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003908", "code": "def brainfuck_interpreter(code, input_str):\n    memory = [0] * 30000  # Initialize memory tape with 30,000 cells\n    data_ptr = 0\n    input_ptr = 0\n    output = \"\"\n    def find_matching_bracket(code, current_ptr, direction):\n        count = 1\n        while count != 0:\n            current_ptr += direction\n            if code[current_ptr] == '[':\n                count += direction\n            elif code[current_ptr] == ']':\n                count -= direction\n        return current_ptr\n    while data_ptr < len(code):\n        char = code[data_ptr]\n        if char == '>':\n            data_ptr += 1\n        elif char == '<':\n            data_ptr -= 1\n        elif char == '+':\n            memory[data_ptr] = (memory[data_ptr] + 1) % 256\n        elif char == '-':\n            memory[data_ptr] = (memory[data_ptr] - 1) % 256\n        elif char == '.':\n            output += chr(memory[data_ptr])\n        elif char == ',':\n            if input_ptr < len(input_str):\n                memory[data_ptr] = ord(input_str[input_ptr])\n                input_ptr += 1\n        elif char == '[':\n            if memory[data_ptr] == 0:\n                data_ptr = find_matching_bracket(code, data_ptr, 1)\n        elif char == ']':\n            if memory[data_ptr] != 0:\n                data_ptr = find_matching_bracket(code, data_ptr, -1)\n        data_ptr += 1\n    return output\n", "entry_point": "brainfuck_interpreter", "input": "'.', ''", "output": "'\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114726_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003909", "code": "def simulate_card_game(deck):\n    player1_sum = 0\n    player2_sum = 0\n    for i, card_value in enumerate(deck):\n        if i % 2 == 0:\n            player1_sum += card_value\n        else:\n            player2_sum += card_value\n    if player1_sum > player2_sum:\n        return 0\n    elif player2_sum > player1_sum:\n        return 1\n    else:\n        return -1\n", "entry_point": "simulate_card_game", "input": "[1, 2, 0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91398_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003910", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "8", "output": "174", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003911", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7289", "output": "{197, 1, 37, 7289}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003912", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'1.2'", "output": "(1, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003913", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[9, 8, 5, 4, 4, 3, 1]", "output": "[1, 3, 4, 4, 5, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003914", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "7, 7", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003915", "code": "def process_faceit_data(response):\n    results = response.get('payload', {}).get('results', [])\n    if not results:\n        return \"No player profiles found.\"\n    player_urls = []\n    ban_status = []\n    for player_data in results:\n        nickname = player_data.get('nickname', '')\n        status = player_data.get('status', '')\n        player_urls.append(f\"https://www.faceit.com/en/players/{nickname}\")\n        ban_status.append(f\"{nickname}: {status}\")\n    player_urls_str = '\\n'.join(player_urls)\n    ban_status_str = '\\n'.join(ban_status)\n    return f\"Player URLs:\\n{player_urls_str}\\n\\nBan Status:\\n{ban_status_str}\"\n", "entry_point": "process_faceit_data", "input": "{'payload': {'results': []}}", "output": "'No player profiles found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48878_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003916", "code": "def calculate_time_elapsed(start_time, end_time):\n    total_seconds = end_time - start_time\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return hours, minutes, seconds\n", "entry_point": "calculate_time_elapsed", "input": "0, 7201", "output": "(2, 0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87493_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003917", "code": "from typing import List, Optional\ndef find_most_frequent_integer(numbers: List[int]) -> Optional[int]:\n    if not numbers:\n        return None\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    most_frequent = min(frequency, key=lambda x: (-frequency[x], x))\n    return most_frequent\n", "entry_point": "find_most_frequent_integer", "input": "[1, 1, 1, 2, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18121_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003918", "code": "def execute_opcodes(opcodes):\n    stack = []\n    pc = 0  # Program counter\n    while pc < len(opcodes):\n        opcode = opcodes[pc]\n        if opcode.startswith('PUSH'):\n            num = int(opcode[4:])\n            stack.append(num)\n        elif opcode.startswith('JMP'):\n            offset = int(opcode.split('_')[1])\n            pc += offset\n            continue\n        elif opcode.startswith('JMPIF'):\n            offset = int(opcode.split('_')[1])\n            if stack.pop():\n                pc += offset\n                continue\n        elif opcode == 'JMPEQ':\n            offset = int(opcode.split('_')[1])\n            if stack.pop() == stack.pop():\n                pc += offset\n                continue\n        pc += 1\n    return stack\n", "entry_point": "execute_opcodes", "input": "['PUSH 5', 'PUSH 3', 'PUSH 10']", "output": "[5, 3, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72950_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003919", "code": "def sum_divisible_by_2_and_3(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0 and num % 3 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_2_and_3", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87733_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003920", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[1, 3, 9]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003921", "code": "from typing import List\ndef min_boats(people: List[int], limit: int) -> int:\n    people.sort()\n    left, right, boats = 0, len(people) - 1, 0\n    while left <= right:\n        if people[left] + people[right] <= limit:\n            left += 1\n        right -= 1\n        boats += 1\n    return boats\n", "entry_point": "min_boats", "input": "[70] * 9 + [80] * 9, 150", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49829_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003922", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6645", "output": "{1, 3, 5, 2215, 15, 1329, 6645, 443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003923", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'## '", "output": "'<h2></h2>\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003924", "code": "def length_of_longest_substring(s):\n    start_index = 0\n    end_index = 0\n    answer = 0\n    char_to_position = {}\n    for i, let in enumerate(s):\n        if let not in char_to_position:\n            char_to_position[let] = i\n        elif char_to_position[let] >= start_index:\n            start_index = char_to_position[let] + 1\n            char_to_position[let] = i\n        else:\n            char_to_position[let] = i\n        end_index += 1\n        if end_index - start_index > answer:\n            answer = end_index - start_index\n    return answer\n", "entry_point": "length_of_longest_substring", "input": "'abc'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137919_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003925", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "5", "output": "108", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003926", "code": "def format_strings(strings):\n    formatted_strings = [s.strip().capitalize() + '!' for s in strings]\n    return '\\n'.join(formatted_strings)\n", "entry_point": "format_strings", "input": "['   hello   ', 'world', 'python']", "output": "'Hello!\\nWorld!\\nPython!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36523_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003927", "code": "import math\ndef convert_bytes_to_human_readable(size_bytes):\n    if size_bytes == 0:\n        return \"0B\"\n    size_name = (\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\")\n    i = int(math.floor(math.log(size_bytes, 1024)))\n    p = math.pow(1024, i)\n    s = round(size_bytes / p, 2)\n    return \"%s %s\" % (s, size_name[i])\n", "entry_point": "convert_bytes_to_human_readable", "input": "2039", "output": "'1.99 KB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67135_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003928", "code": "def count_alphanumeric_chars(input_str):\n    count = 0\n    for char in input_str:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'hello123'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52816_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003929", "code": "def reconstruct_message(packets):\n    packet_dict = {}\n    for packet in packets:\n        seq_num, data = packet.split(':')\n        packet_dict[int(seq_num)] = data\n    sorted_packets = sorted(packet_dict.items())\n    reconstructed_message = ''\n    for seq_num, data in sorted_packets:\n        if seq_num != len(reconstructed_message) + 1:\n            return \"Incomplete message\"\n        reconstructed_message += data\n    return reconstructed_message\n", "entry_point": "reconstruct_message", "input": "['3:Hello', '1:World']", "output": "'Incomplete message'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124667_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003930", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[87, 75, 71, 50, 65]", "output": "[87, 75, 71]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003931", "code": "def sum_of_factorial_digits(num):\n    fact_total = 1\n    while num != 1:\n        fact_total *= num\n        num -= 1\n    fact_total_str = str(fact_total)\n    sum_total = sum(int(digit) for digit in fact_total_str)\n    return sum_total\n", "entry_point": "sum_of_factorial_digits", "input": "5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145190_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003932", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'11.51.3'", "output": "(11, 51, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003933", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[2, 4, 4, 3, 3, 5, 3, 2]", "output": "[7, 9, 9, 8, 8, 10, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003934", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[10, 9, 8, 3, 11, 11, 10, 6, 11]", "output": "[3, 6, 8, 9, 10, 10, 11, 11, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003935", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'BEVMICHAELBRLY'", "output": "'YLRBLEAHCIMVEB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003936", "code": "def convert_log_levels(log_levels):\n    log_mapping = {0: 'DEBUG', 1: 'INFO', 2: 'WARNING', 3: 'ERROR'}\n    log_strings = [log_mapping[level] for level in log_levels]\n    return log_strings\n", "entry_point": "convert_log_levels", "input": "[3, 0, 0, 2]", "output": "['ERROR', 'DEBUG', 'DEBUG', 'WARNING']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93726_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003937", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1059", "output": "{3, 1, 1059, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003938", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[1, 2, 3, 4], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003939", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3781", "output": "{1, 19, 3781, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003940", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[1156, 1157], 2", "output": "4626", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003941", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8917", "output": "{1, 241, 37, 8917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003942", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[8.0, 8.395]", "output": "8.1975", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003943", "code": "def calculate_dot_product(list1, list2):\n    dot_product = 0\n    for i in range(len(list1)):\n        dot_product += list1[i] * list2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[6, 3], [5, 4]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118702_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003944", "code": "def update_router_data(router_data_list, router_id, is_active):\n    for router_data in router_data_list:\n        if router_data[\"id\"] == router_id:\n            router_data[\"is_active\"] = is_active\n            break\n    return router_data_list\n", "entry_point": "update_router_data", "input": "[], 1, True", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15709_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2290", "output": "{1, 2, 5, 229, 458, 10, 2290, 1145}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2289", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003946", "code": "def card_war(deck1, deck2):\n    round_count = 0\n    while round_count < 100 and deck1 and deck2:\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        if card1 > card2:\n            deck1.extend([card1, card2])\n        elif card2 > card1:\n            deck2.extend([card2, card1])\n        else:  # War\n            war_cards = [card1, card2]\n            while len(deck1) >= 2 and len(deck2) >= 2:\n                war_cards.extend([deck1.pop(0), deck2.pop(0)])\n                if deck1[0] != deck2[0]:\n                    break\n            if deck1[0] > deck2[0]:\n                deck1.extend(war_cards)\n            else:\n                deck2.extend(war_cards)\n        round_count += 1\n    if not deck1 and not deck2:\n        return -1\n    elif not deck1:\n        return 1\n    else:\n        return 0\n", "entry_point": "card_war", "input": "[3, 4, 5], [1, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10690_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003947", "code": "from typing import List\ndef threeSumClosest(nums: List[int], target: int) -> int:\n    nums.sort()\n    closest_sum = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            if abs(current_sum - target) < abs(closest_sum - target):\n                closest_sum = current_sum\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return target  # Found an exact match, no need to continue\n    return closest_sum\n", "entry_point": "threeSumClosest", "input": "[0, 1, 1], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47065_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003948", "code": "from typing import List\ndef find_reverse_duplicates(lines: List[str]) -> List[str]:\n    results = []\n    for line in lines:\n        values = line.split()\n        history = set()\n        duplicates = []\n        for i in reversed(values):\n            if i not in history:\n                history.add(i)\n            elif i not in duplicates:\n                duplicates.insert(0, i)\n        results.append(' '.join(duplicates))\n    return results\n", "entry_point": "find_reverse_duplicates", "input": "['', '', '', '', '']", "output": "['', '', '', '', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105725_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003949", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study9999_20220315.txt'", "output": "(9999, '20220315')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003950", "code": "import os\ndef process_directory(directory):\n    file_info = {}\n    for root, _, files in os.walk(directory):\n        for file in files:\n            file_path = os.path.join(root, file)\n            file_name, file_extension = os.path.splitext(file)\n            file_size = os.path.getsize(file_path)\n            file_info[file_name] = {'size': file_size, 'extension': file_extension[1:]}\n    return file_info\n", "entry_point": "process_directory", "input": "'/tmp/empty_directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100990_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003951", "code": "def simplify_path(path):\n    stack = []\n    for element in path:\n        if element == '.':\n            continue\n        elif element == '..':\n            if stack:\n                stack.pop()\n        elif element == '':\n            stack = []\n        else:\n            stack.append(element)\n    return stack\n", "entry_point": "simplify_path", "input": "['cc', 'c', 'c']", "output": "['cc', 'c', 'c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59313_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003952", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "3, [5, 1, 1, 1, 5, 1, 1, 1, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1858", "output": "{929, 1, 1858, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1857", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003954", "code": "def calculate_product(nums):\n    product = 1\n    for num in nums:\n        if num != 0:\n            product *= num\n    return product\n", "entry_point": "calculate_product", "input": "[10, 12, 8]", "output": "960", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25506_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003955", "code": "def count_increases(depth_values):\n    if not depth_values:\n        return 0\n    count = 0\n    for i in range(len(depth_values) - 1):\n        if depth_values[i] < depth_values[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_increases", "input": "[1, 2, 3, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53838_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003956", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    for i in range(1, len(buildings) - 1):\n        total_area += min(buildings[i], buildings[i+1])\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58935_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003957", "code": "def maximize_profit(weights, profits, bag_capacity):\n    n = len(weights)\n    data = [(i, profits[i], weights[i]) for i in range(n)]\n    data.sort(key=lambda x: x[1] / x[2], reverse=True)\n    total_profit = 0\n    selected_items = []\n    remaining_capacity = bag_capacity\n    for i in range(n):\n        if data[i][2] <= remaining_capacity:\n            remaining_capacity -= data[i][2]\n            selected_items.append(data[i][0])\n            total_profit += data[i][1]\n        else:\n            break\n    return total_profit, selected_items\n", "entry_point": "maximize_profit", "input": "[20, 30], [122, 50], 20", "output": "(122, [0])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2609_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003958", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "18", "output": "508032", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003959", "code": "from collections import Counter\ndef getHint(secret: str, guess: str) -> str:\n    bulls = cows = 0\n    seen = Counter()\n    for s, g in zip(secret, guess):\n        if s == g:\n            bulls += 1\n        else:\n            if seen[s] < 0:\n                cows += 1\n            if seen[g] > 0:\n                cows += 1\n            seen[s] += 1\n            seen[g] -= 1\n    return \"{0}A{1}B\".format(bulls, cows)\n", "entry_point": "getHint", "input": "'1234', '1243'", "output": "'2A2B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78888_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003960", "code": "from typing import List, Tuple\ndef generate_test_summary(tests: List[bool]) -> Tuple[int, int, int, float]:\n    total_tests = len(tests)\n    passed_tests = sum(tests)\n    failed_tests = total_tests - passed_tests\n    success_rate = (passed_tests / total_tests) * 100 if total_tests > 0 else 0.0\n    return total_tests, passed_tests, failed_tests, success_rate\n", "entry_point": "generate_test_summary", "input": "[True, True, True, True, False, False, False]", "output": "(7, 4, 3, 57.14285714285714)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108687_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003961", "code": "def validate_expression(expression: str) -> bool:\n    stack = []\n    bracket_map = {')': '(', ']': '[', '}': '{'}\n    for char in expression:\n        if char in bracket_map.values():\n            stack.append(char)\n        elif char in bracket_map.keys():\n            if not stack or bracket_map[char] != stack.pop():\n                return False\n    return not stack\n", "entry_point": "validate_expression", "input": "'([]{})'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95065_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003962", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "981", "output": "{1, 3, 327, 9, 109, 981}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003963", "code": "def find_missing_number(L):\n    n = len(L) + 1\n    total_sum = n * (n + 1) // 2\n    list_sum = sum(L)\n    missing_number = total_sum - list_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "list(range(1, 36))", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149242_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003964", "code": "def count_unique_java_classes(script):\n    unique_classes = set()\n    for line in script.split('\\n'):\n        if 'from jnius import autoclass' in line:\n            java_class = line.split('autoclass ')[1].strip()\n            unique_classes.add(java_class)\n    return len(unique_classes)\n", "entry_point": "count_unique_java_classes", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_861_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003965", "code": "import re\n# Pre-defined regular expression pattern\nre_session = re.compile(r\"session=(.*?);\")\ndef extract_session_ids(text):\n    # Find all matches of the regular expression pattern in the input text\n    matches = re_session.findall(text)\n    # Extract session IDs from the matches and store them in a set for uniqueness\n    session_ids = set(match for match in matches)\n    return list(session_ids)\n", "entry_point": "extract_session_ids", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27451_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003966", "code": "def organize_tabs(tab_names):\n    tab_dict = {}\n    for tab_name in tab_names:\n        try:\n            module = __import__(f'app.dashboard.tab.{tab_name}', fromlist=[tab_name])\n            tab_component = getattr(module, tab_name)\n            tab_dict[tab_name] = tab_component\n        except ImportError:\n            print(f\"Error importing tab component for '{tab_name}'.\")\n    return tab_dict\n", "entry_point": "organize_tabs", "input": "['InvalidTab1', 'InvalidTab2']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67906_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8749", "output": "{1, 13, 673, 8749}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003968", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4695", "output": "{1, 3, 5, 939, 15, 4695, 313, 1565}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003969", "code": "def parse_arguments(args):\n    parsed_args = {'package': None}\n    if '--package' in args:\n        package_index = args.index('--package')\n        if package_index + 1 < len(args):\n            parsed_args['package'] = args[package_index + 1]\n    return parsed_args\n", "entry_point": "parse_arguments", "input": "['--package', 'my_package']", "output": "{'package': 'my_package'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40531_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003970", "code": "def check_output_contains_string(command, pod_obj, str_to_check):\n    # Simulating the extraction of output from the command run on the OSD pod\n    output = \"Sample output containing the string to check: {}\".format(str_to_check)\n    # Check if the string to check is contained in the output\n    if str_to_check in output:\n        return True\n    else:\n        return False\n", "entry_point": "check_output_contains_string", "input": "None, None, 'the string to check'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65465_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003971", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003972", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "41", "output": "'0000000000000029'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003973", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'123+ABC+456+XYZ'", "output": "('123', 'ABC', '456', 'XYZ')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003974", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max if second_max != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[10, 8, 5, 3, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12088_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003975", "code": "def fibonacci_sum(n):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(n):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87098_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2333", "output": "{1, 2333}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003977", "code": "def brainfuck_interpreter(code, input_str):\n    memory = [0] * 30000  # Initialize memory tape with 30,000 cells\n    data_ptr = 0\n    input_ptr = 0\n    output = \"\"\n    def find_matching_bracket(code, current_ptr, direction):\n        count = 1\n        while count != 0:\n            current_ptr += direction\n            if code[current_ptr] == '[':\n                count += direction\n            elif code[current_ptr] == ']':\n                count -= direction\n        return current_ptr\n    while data_ptr < len(code):\n        char = code[data_ptr]\n        if char == '>':\n            data_ptr += 1\n        elif char == '<':\n            data_ptr -= 1\n        elif char == '+':\n            memory[data_ptr] = (memory[data_ptr] + 1) % 256\n        elif char == '-':\n            memory[data_ptr] = (memory[data_ptr] - 1) % 256\n        elif char == '.':\n            output += chr(memory[data_ptr])\n        elif char == ',':\n            if input_ptr < len(input_str):\n                memory[data_ptr] = ord(input_str[input_ptr])\n                input_ptr += 1\n        elif char == '[':\n            if memory[data_ptr] == 0:\n                data_ptr = find_matching_bracket(code, data_ptr, 1)\n        elif char == ']':\n            if memory[data_ptr] != 0:\n                data_ptr = find_matching_bracket(code, data_ptr, -1)\n        data_ptr += 1\n    return output\n", "entry_point": "brainfuck_interpreter", "input": "'', ''", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114726_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003978", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[3, 3, 0, 0, 4, 4, 1, 4]", "output": "[3, 0, 4, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003979", "code": "def parse_log_message(log_message):\n    parts = log_message.split(':')\n    if len(parts) != 4:\n        return {\"error\": \"Invalid log message format\"}\n    filename = parts[0]\n    line_number = parts[1]\n    function_name = parts[2]\n    message = parts[3]\n    return {\n        \"filename\": filename,\n        \"line number\": line_number,\n        \"function name\": function_name,\n        \"message\": message\n    }\n", "entry_point": "parse_log_message", "input": "'An error occurred'", "output": "{'error': 'Invalid log message format'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7125_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003980", "code": "import re\ndef extract_info_from_code(code: str) -> dict:\n    version_pattern = r\"__version__ = '([\\d.]+)'\"\n    all_pattern = r\"__all__ = \\[([^\\]]+)\\]\"\n    version_match = re.search(version_pattern, code)\n    all_match = re.search(all_pattern, code)\n    version = version_match.group(1) if version_match else None\n    imported_modules = [m.strip().strip(\"'\") for m in all_match.group(1).split(\",\")] if all_match else []\n    return {\"version\": version, \"imported_modules\": imported_modules}\n", "entry_point": "extract_info_from_code", "input": "''", "output": "{'version': None, 'imported_modules': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71895_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003981", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'2.1.32.10321.'", "output": "'2.1.32.10321.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003982", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9369", "output": "{1, 3, 9, 1041, 347, 3123, 9369, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003983", "code": "from collections import deque\ndef magical_string(n):\n    if n == 0:\n        return 0\n    S = \"122\"\n    queue = deque(['1', '2'])\n    count = 1\n    for i in range(2, n):\n        next_num = queue.popleft()\n        if next_num == '1':\n            S += '2'\n            count += 1\n        else:\n            S += '1'\n        queue.append('1' if S[i] == '1' else '2')\n    return count\n", "entry_point": "magical_string", "input": "9", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49285_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003984", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'ooooooo', 0", "output": "'ooooooo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003985", "code": "import re\nfrom typing import List\ndef check_mysql_compatibility(schema_columns: List[str]) -> bool:\n    allowed_data_types = {'INT', 'VARCHAR', 'TEXT', 'DATE', 'DATETIME'}\n    for column in schema_columns:\n        column_parts = column.split()\n        if len(column_parts) != 2:\n            return False\n        column_name, data_type = column_parts\n        if not re.match(r'^[a-zA-Z_][a-zA-Z0-9_]*$', column_name):\n            return False\n        if data_type not in allowed_data_types:\n            return False\n    return True\n", "entry_point": "check_mysql_compatibility", "input": "['user_id INT', 'username VARCHAR', 'created_at DATETIME']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003986", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "5.5, 5.5", "output": "('0', '10')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003987", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[3, 4, 5, 6]", "output": "'3-4-5-6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003988", "code": "def extract_relationships(rel_name: str, obj_index: int, relationships: dict) -> list:\n    if rel_name in relationships:\n        if 0 <= obj_index < len(relationships[rel_name]):\n            return relationships[rel_name][obj_index]\n    return []\n", "entry_point": "extract_relationships", "input": "'non_existent', 0, {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50045_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003989", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 4, 6]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63873_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003990", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[0, 0, 1, 1, 4, 4, 5, 2]", "output": "{0: 2, 1: 2, 4: 2, 5: 1, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003991", "code": "def process_job_names(on_queue: str) -> dict:\n    job_names = on_queue.splitlines()\n    unique_job_names = set()\n    longest_job_name = ''\n    for job_name in job_names:\n        unique_job_names.add(job_name.strip())\n        if len(job_name) > len(longest_job_name):\n            longest_job_name = job_name.strip()\n    return {'unique_count': len(unique_job_names), 'longest_job_name': longest_job_name}\n", "entry_point": "process_job_names", "input": "'1job1'", "output": "{'unique_count': 1, 'longest_job_name': '1job1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132971_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3221", "output": "{1, 3221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5037", "output": "{1, 3, 69, 73, 5037, 1679, 23, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5036", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003994", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'5.b'", "output": "'5.c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003995", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[10, 8, 9, 1, 10, 10, 9], 8", "output": "[1000, 512, 729, 1, 1000, 1000, 729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003996", "code": "from typing import List\ndef find_highest_score(scores: List[int]) -> int:\n    reference_score = max(scores)\n    decoded_scores = [reference_score - score for score in scores]\n    highest_score = float('-inf')\n    highest_original_score = float('-inf')\n    for i, decoded_score in enumerate(decoded_scores):\n        if decoded_score == min(decoded_scores) and scores[i] > highest_original_score:\n            highest_original_score = scores[i]\n            highest_score = decoded_score\n    return highest_original_score\n", "entry_point": "find_highest_score", "input": "[3, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107603_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003997", "code": "def longest_common_subsequence(seq1, seq2):\n    m, n = len(seq1), len(seq2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if seq1[i - 1] == seq2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "[1, 2, 3, 4], [0, 1, 2, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17883_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003998", "code": "def find_lcs_length_optimized(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length_optimized", "input": "'ABCDEF', 'A1B2C3D4E5F'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28396_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0003999", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[75, 81.5, 82, 85, 95]", "output": "82.83333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83310_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004000", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6476", "output": "{1, 2, 4, 3238, 6476, 1619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6475", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004001", "code": "def calculate_bleed_damage(cards):\n    total_bleed_damage = 0\n    reset_value = 0  # Define the reset value here\n    for card in cards:\n        if card == reset_value:\n            total_bleed_damage = 0\n        else:\n            total_bleed_damage += card\n    return total_bleed_damage\n", "entry_point": "calculate_bleed_damage", "input": "[3.0, 3.5]", "output": "6.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46599_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004002", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[2, 48, 10, 40, 12, 48, 12]", "output": "[2, 48, 10, 40, 12, 48, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004003", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[3, 7, 2]", "output": "[3, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004004", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'foxloud'", "output": "{'foxloud': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004005", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "601", "output": "{601, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004006", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[4, 8, 8, 8, 1, 5, 5, 9]", "output": "[4, 8, 8, 8, 1, 5, 5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004007", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "40, 25, 53", "output": "40.43138888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004008", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[0, 2, 3, 3, 7, -1]", "output": "[0, 2, 3, 3, 7, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004009", "code": "from typing import List\ndef find_sum_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_val = min_val = nums[0]\n    for num in nums[1:]:\n        if num > max_val:\n            max_val = num\n        elif num < min_val:\n            min_val = num\n    return max_val + min_val\n", "entry_point": "find_sum_of_max_min", "input": "[1, 10, 15]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16636_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004010", "code": "compatible_process_models = set(['DP', 'MFM'])\ncompatible_mixture_models = set(['ConjugateGaussianMixture', 'NonconjugateGaussianMixture'])\ndef check_compatibility(model1, model2):\n    if model1 in compatible_process_models and model2 in compatible_process_models:\n        return True\n    if model1 in compatible_mixture_models and model2 in compatible_mixture_models:\n        return True\n    return False\n", "entry_point": "check_compatibility", "input": "'DP', 'ConjugateGaussianMixture'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21130_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004011", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004012", "code": "def compare_csrf_tokens(token1: str, token2: str) -> bool:\n    # Normalize tokens by converting to lowercase and stripping whitespace\n    normalized_token1 = token1.lower().strip()\n    normalized_token2 = token2.lower().strip()\n    # Compare the normalized tokens for equality\n    return normalized_token1 == normalized_token2\n", "entry_point": "compare_csrf_tokens", "input": "'Token', 'token1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4021_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004013", "code": "def sum_absolute_differences(arr1, arr2):\n    sum_diff = 0\n    for num1, num2 in zip(arr1, arr2):\n        sum_diff += abs(num1 - num2)\n    return sum_diff\n", "entry_point": "sum_absolute_differences", "input": "[1, 2, 3, 4], [5, 6, 7, 0]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121134_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004014", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "10", "output": "385", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004015", "code": "def count_pairs(nums, target):\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        if target - num in num_freq and num_freq[target - num] > 0:\n            pair_count += 1\n            num_freq[target - num] -= 1\n        else:\n            num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs", "input": "[2, 3], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82729_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6557", "output": "{1, 83, 6557, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004017", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.111.100'", "output": "(0, 111, 100)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4107", "output": "{1, 3, 37, 4107, 111, 1369}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004019", "code": "def reverse_string(input_string):\n    return input_string[::-1]\n", "entry_point": "reverse_string", "input": "'news'", "output": "'swen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18735_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004020", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{1: []}, 1", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004021", "code": "def getFirstSetBit(n):\n    pos = 1\n    while n > 0:\n        if n & 1 == 1:\n            return pos\n        n = n >> 1\n        pos += 1\n    return 0\n", "entry_point": "getFirstSetBit", "input": "16", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107353_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004022", "code": "from typing import List\ndef sum_of_reoccurring_data_points(data: List[int]) -> int:\n    frequency_map = {}\n    # Count the frequency of each data point\n    for num in data:\n        frequency_map[num] = frequency_map.get(num, 0) + 1\n    # Sum up the reoccurring data points\n    total_sum = sum(num for num, freq in frequency_map.items() if freq > 1)\n    return total_sum\n", "entry_point": "sum_of_reoccurring_data_points", "input": "[2, 2, 3, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146140_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004023", "code": "import os\ndef find_python_files(directory_path):\n    python_files = []\n    for root, dirs, files in os.walk(directory_path):\n        for file in files:\n            if file.endswith(\".py\"):\n                python_files.append(os.path.abspath(os.path.join(root, file)))\n    return python_files\n", "entry_point": "find_python_files", "input": "'/path/to/nonexistent/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83162_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004024", "code": "def count_unique_directories(file_paths):\n    unique_directories = set()\n    for file_path in file_paths:\n        directories = file_path.split('/')\n        # Exclude the last element (file name) and empty strings\n        directories = [directory for directory in directories[:-1] if directory]\n        unique_directories.update(directories)\n    return len(unique_directories)\n", "entry_point": "count_unique_directories", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38025_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004025", "code": "def process_string(input_str):\n    if not input_str:\n        return 'EMPTY'\n    modified_str = ''\n    for i, char in enumerate(input_str[::-1]):\n        if char.isalpha():\n            if i % 2 == 1:\n                modified_str += char.upper()\n            else:\n                modified_str += char.lower()\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "process_string", "input": "'PytHoN'", "output": "'nOhTyP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48299_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004026", "code": "from typing import List\ndef is_small_straight(dice: List[int]) -> bool:\n    if dice is None:\n        return False\n    def number_counts(dice: List[int]) -> dict:\n        counts = {}\n        for num in dice:\n            counts[num] = counts.get(num, 0) + 1\n        return counts\n    counts = number_counts(dice)\n    return (\n        counts.get(2, 0) > 0\n        and counts.get(3, 0) > 0\n        and (\n            (counts.get(1, 0) > 0 and (counts.get(4, 0) > 0 or counts.get(5, 0) > 0))\n            or (counts.get(2, 0) > 0 and counts.get(5, 0) > 0)\n        )\n    )\n", "entry_point": "is_small_straight", "input": "[1, 2, 3, 5]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135571_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004027", "code": "import re\ndef count_word_occurrences(text, word):\n    # Preprocess the text by removing punctuation and converting to lowercase\n    text = re.sub(r'[^\\w\\s]', '', text.lower())\n    # Split the text into individual words\n    words = text.split()\n    # Count the occurrences of the word\n    count = sum(1 for w in words if w == word)\n    return count\n", "entry_point": "count_word_occurrences", "input": "'An apple a day keeps the doctor away. I love to eat an apple.', 'apple'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120078_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004028", "code": "def extract_rendering_parameters(code_snippet):\n    rendering_params = {}\n    for line in code_snippet.split('\\n'):\n        line = line.strip()\n        if line.startswith(('obs_param', 'nan_punition', 'true_reset_every_n_episodes', 'render',\n                            'MAX_TIMEFRAME_CONTROL_PLOT', 'MAX_TIMEFRAME_FULL_CONTROL_PLOT',\n                            'POSITION_JET_PLOT', 'POSITION_REWARD_SPOTS', 'POSITION_CONTROL_SPOTS',\n                            'N_PLOTS', 'show_control', 'start_h_plot', 'RENDER_PERIOD', 'SAVE_PERIOD',\n                            'obs_at_jet_render_param')):\n            param_name, param_value = line.split('=')\n            rendering_params[param_name.strip()] = param_value.strip()\n    return rendering_params\n", "entry_point": "extract_rendering_parameters", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141223_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004029", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[3, 4, 3, 9, 5]", "output": "[9, 4, 9, 81, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004030", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[0, 1, 1, 0]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004031", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[1, 1, 2, 2, 3, 3, 3, 4]", "output": "[1, 1, 2, 2, 3, 3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004032", "code": "def remove_vowels(string):\n    result = ''\n    for char in string:\n        if char not in 'aeiouAEIOU':\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'Hello'", "output": "'Hll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87966_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004033", "code": "def frequencies_map_with_map_from(lst):\n    from collections import Counter\n    return dict(map(lambda x: (x, lst.count(x)), set(lst)))\n", "entry_point": "frequencies_map_with_map_from", "input": "['a']", "output": "{'a': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49570_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "848", "output": "{1, 2, 4, 424, 8, 106, 848, 16, 212, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt847", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004035", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4067", "output": "{1, 4067, 581, 7, 49, 83}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004036", "code": "import time\ndef minutechanged(oldminute):\n    currentminute = time.localtime()[4]\n    if ((currentminute - oldminute) >= 1) or (oldminute == 59 and currentminute == 0):\n        return True\n    else:\n        return False\n", "entry_point": "minutechanged", "input": "29", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49465_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004037", "code": "def find_duplicate(nums):\n    d = {}\n    for i in range(0, len(nums)):\n        if nums[i] in d:\n            return nums[i]\n        else:\n            d[nums[i]] = i\n", "entry_point": "find_duplicate", "input": "[1, 2, 3, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148746_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004038", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'3.5.7'", "output": "'3.5.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004039", "code": "def max_non_adjacent_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[10, 2, 3, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11871_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004040", "code": "def dummy(n):\n    total_sum = sum(range(1, n + 1))\n    return total_sum\n", "entry_point": "dummy", "input": "998", "output": "498501", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124894_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004041", "code": "def final_state(state):\n    final_state = state.copy()\n    for i in range(1, len(state)):\n        if state[i] != state[i - 1]:\n            final_state[i] = 0\n    return final_state\n", "entry_point": "final_state", "input": "[-1, 1, 2, 3, 4, 5, 6, 7]", "output": "[-1, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82567_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004042", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'hello,world:how;are|yhu'", "output": "['hello', 'world', 'how', 'are', 'yhu']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004043", "code": "def max_consecutive_rounds(candies):\n    if not candies:\n        return 0\n    max_consecutive = 1\n    current_consecutive = 1\n    for i in range(1, len(candies)):\n        if candies[i] == candies[i - 1]:\n            current_consecutive += 1\n            max_consecutive = max(max_consecutive, current_consecutive)\n        else:\n            current_consecutive = 1\n    return max_consecutive\n", "entry_point": "max_consecutive_rounds", "input": "[2, 2, 2, 3, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31135_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004044", "code": "def extract_commands(input_str):\n    commands = {}\n    lines = input_str.strip().split('\\n')\n    for line in lines:\n        if line.strip().startswith('\u274d'):\n            parts = line.split(':')\n            command_name = parts[0].strip().split('/')[1]\n            description = parts[1].strip()\n            commands[command_name] = description\n    return commands\n", "entry_point": "extract_commands", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133516_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004045", "code": "mappings = {\n    \"event1\": \"action1\",\n    \"event2\": \"action2\",\n    \"event3\": \"action3\"\n}\ndef process_event(event):\n    return mappings.get(event, 'No action found')\n", "entry_point": "process_event", "input": "'event4'", "output": "'No action found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108152_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004046", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "5, 1", "output": "(5.0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004047", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[11, 13]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86417_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004048", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004049", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[1, 3, 4, -1, 2, 4, 4, 2]", "output": "[1, 3, 4, -1, 2, 4, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004050", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'PaParserareP', 'hphpppp'", "output": "'PaParserareP.hphpppp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004051", "code": "from typing import List\ndef find_sum_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_val = min_val = nums[0]\n    for num in nums[1:]:\n        if num > max_val:\n            max_val = num\n        elif num < min_val:\n            min_val = num\n    return max_val + min_val\n", "entry_point": "find_sum_of_max_min", "input": "[0, 10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16636_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004052", "code": "def extract_unique_architectures(architectures):\n    unique_architectures = set()\n    for arch in architectures:\n        unique_architectures.add(tuple(arch))\n    unique_architectures = [list(arch) for arch in sorted(unique_architectures)]\n    return unique_architectures\n", "entry_point": "extract_unique_architectures", "input": "[[]]", "output": "[[]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139723_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004053", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average excluding highest and lowest.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 84, 85, 90]", "output": "84.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66758_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004054", "code": "SUFFIX = {'ng': 1e-9, '\u00b5g': 1e-6, 'ug': 1e-6, 'mg': 1e-3, 'g': 1, 'kg': 1e3}\ndef convert_weight(weight, from_suffix, to_suffix):\n    if from_suffix not in SUFFIX or to_suffix not in SUFFIX:\n        return \"Invalid suffix provided\"\n    # Convert weight to base unit (grams)\n    weight_in_grams = weight * SUFFIX[from_suffix]\n    # Convert base unit to target unit\n    converted_weight = weight_in_grams / SUFFIX[to_suffix]\n    return round(converted_weight, 2)\n", "entry_point": "convert_weight", "input": "100, 'oz', 'g'", "output": "'Invalid suffix provided'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21722_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004055", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4969", "output": "{1, 4969}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1541", "output": "{1, 67, 1541, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004057", "code": "def maxProfit(prices):\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[3, 5, 8]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12353_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004058", "code": "def count_unique_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in numbers:\n        if is_prime(num) and num not in unique_primes:\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[2, 3, 5, 7, 11]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31404_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004059", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'ppppp ooo r'", "output": "{'p': 5, 'o': 3, 'r': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139810_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004060", "code": "def process_choices(choices):\n    result = {}\n    count = {}\n    for choice, display_name in choices:\n        if display_name in result:\n            if display_name in count:\n                count[display_name] += 1\n            else:\n                count[display_name] = 1\n            new_display_name = f\"{display_name}_{count[display_name]}\"\n            result[display_name].append(choice)\n            result[new_display_name] = [choice]\n        else:\n            result[display_name] = [choice]\n    return result\n", "entry_point": "process_choices", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104982_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004061", "code": "def min_moves_to_target(target):\n    return abs(target)\n", "entry_point": "min_moves_to_target", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63367_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004062", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1744", "output": "{1, 2, 4, 872, 8, 109, 1744, 16, 436, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1743", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004063", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "2.06, 1.2", "output": "1.43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004064", "code": "def count_occurrences(matrix, target):\n    count = 0\n    for row in matrix:\n        count += row.count(target)\n    return count\n", "entry_point": "count_occurrences", "input": "[[7, 1, 2], [7, 3, 4], [0, 7, 7]], 7", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115078_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004065", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[-2, -2, -2, -2, 1, 2, 2, 3, -1]", "output": "[-2, -2, -2, -2, 1, 2, 2, 3, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004066", "code": "from typing import List\ndef count_state_occurrences(states: List[int], target_state: int) -> int:\n    count = 0\n    for state in states:\n        if state == target_state:\n            count += 1\n    return count\n", "entry_point": "count_state_occurrences", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145747_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004067", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(5, 5, 8, 5, 8, 5, 8)", "output": "'5.5.8.5.8.5.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004068", "code": "def generate_url(owner, repo, token_auth):\n    return f'{owner}/{repo}/{token_auth}/'\n", "entry_point": "generate_url", "input": "'john_dojohn_doee', 'my_projcec', ''", "output": "'john_dojohn_doee/my_projcec//'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8083_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4846", "output": "{1, 2, 4846, 2423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004070", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "51", "output": "'LI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004071", "code": "def shortest_distance_to_char(S, C):\n    cp = [i for i, s in enumerate(S) if s == C]\n    result = []\n    for i, s in enumerate(S):\n        result.append(min(abs(i - x) for x in cp))\n    return result\n", "entry_point": "shortest_distance_to_char", "input": "'abcdeca', 'a'", "output": "[0, 1, 2, 3, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98860_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004072", "code": "def get_node_list(heap):\n    node_list = [None, len(heap)] + [i for i in range(len(heap)) if heap[i] is not None]\n    return node_list\n", "entry_point": "get_node_list", "input": "[0, None, 1, 2, 3, 4, 5, 6]", "output": "[None, 8, 0, 2, 3, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133261_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004073", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[3, 7, 0, 2, 3, 1, 7]", "output": "[3, 8, 2, 5, 7, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004074", "code": "def longest_consecutive_sequence(char_stream):\n    current_length = 0\n    longest_length = 0\n    for char in char_stream:\n        if char.isalpha():\n            current_length += 1\n        else:\n            longest_length = max(longest_length, current_length)\n            current_length = 0\n    longest_length = max(longest_length, current_length)  # Check for the last sequence\n    return longest_length\n", "entry_point": "longest_consecutive_sequence", "input": "'abcde1fg2'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83866_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004075", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[100, 100, 100, 100, 100, 85, 100], 7", "output": "97.85714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004076", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'any.part.yConnfigConfig'", "output": "'yConnfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004077", "code": "def calculate_grayscale(r: int, g: int, b: int) -> int:\n    grayscale = int(0.299 * r + 0.587 * g + 0.114 * b)\n    return grayscale\n", "entry_point": "calculate_grayscale", "input": "0, 4, 0", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80937_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004078", "code": "def get_common_prefix(str1, str2):\n    common_prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            common_prefix += str1[i]\n        else:\n            break\n    return common_prefix\n", "entry_point": "get_common_prefix", "input": "'', 'nonempty'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41977_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004079", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'uppercase'", "output": "'UPPERCASE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004080", "code": "def isMatch(s, p):\n    m, n = len(s), len(p)\n    dp = [[False] * (n + 1) for _ in range(m + 1)]\n    dp[0][0] = True\n    for j in range(1, n + 1):\n        if p[j - 1] == '*':\n            dp[0][j] = dp[0][j - 1]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s[i - 1] == p[j - 1] or p[j - 1] == '?':\n                dp[i][j] = dp[i - 1][j - 1]\n            elif p[j - 1] == '*':\n                dp[i][j] = dp[i][j - 1] or dp[i - 1][j]\n    return dp[m][n]\n", "entry_point": "isMatch", "input": "'abc', 'd*'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004081", "code": "import re\ndef parse_configuration_info(code_snippet):\n    config_info = {}\n    dataset_pattern = r\"Loaded dataset `(.+?)` for training\"\n    output_dir_pattern = r\"Output will be saved to `(.+?)`\"\n    log_dir_pattern = r\"Logs will be saved to `(.+?)`\"\n    device_name_pattern = r\"(.+?)\\n\"\n    dataset_match = re.search(dataset_pattern, code_snippet)\n    output_dir_match = re.search(output_dir_pattern, code_snippet)\n    log_dir_match = re.search(log_dir_pattern, code_snippet)\n    device_name_match = re.search(device_name_pattern, code_snippet)\n    if dataset_match:\n        config_info['dataset'] = dataset_match.group(1)\n    if output_dir_match:\n        config_info['output_dir'] = output_dir_match.group(1)\n    if log_dir_match:\n        config_info['log_dir'] = log_dir_match.group(1)\n    if device_name_match:\n        config_info['device_name'] = device_name_match.group(1)\n    return config_info\n", "entry_point": "parse_configuration_info", "input": "'Initialization complete. No data present.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58374_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004082", "code": "def check_nested_parentheses(input_string: str) -> bool:\n    stack = []\n    opening = '({['\n    closing = ')}]'\n    matching = {')': '(', '}': '{', ']': '['}\n    for char in input_string:\n        if char in opening:\n            stack.append(char)\n        elif char in closing:\n            if not stack or stack[-1] != matching[char]:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "check_nested_parentheses", "input": "'(('", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113585_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004083", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the period as the delimiter\n    version_parts = version_string.split('.')\n    # Convert the split parts into integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return the major, minor, and patch version numbers as a tuple\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.0.12'", "output": "(0, 0, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81674_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004084", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "1.0, 8", "output": "0.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004085", "code": "def find_common_modules(file_content1, file_content2):\n    def extract_modules(file_content):\n        modules = set()\n        for line in file_content.split('\\n'):\n            if line.startswith('import '):\n                modules.update(line.split()[1:])\n        return modules\n    modules_file1 = extract_modules(file_content1)\n    modules_file2 = extract_modules(file_content2)\n    common_modules = list(modules_file1.intersection(modules_file2))\n    return common_modules\n", "entry_point": "find_common_modules", "input": "'import math\\nimport os', 'import random\\nimport sys'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94819_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004086", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'hot'", "output": "'hot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004087", "code": "def check_version_status(current_version, existing_version):\n    if current_version > existing_version:\n        return \"Update Required\"\n    elif current_version == existing_version:\n        return \"Up to Date\"\n    else:\n        return \"Downgrade Not Allowed\"\n", "entry_point": "check_version_status", "input": "1.1, 1.0", "output": "'Update Required'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61614_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004088", "code": "from typing import List\ndef count_unique_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in numbers:\n        if is_prime(num):\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[2, 3, 4, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44678_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004089", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6988", "output": "{1, 2, 4, 3494, 6988, 1747}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6987", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004090", "code": "def sort_dates(dates):\n    def custom_sort(date):\n        year, month, day = map(int, date.split('-'))\n        return year, month, day\n    return sorted(dates, key=custom_sort)\n", "entry_point": "sort_dates", "input": "['1987-03-25']", "output": "['1987-03-25']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3897_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004091", "code": "def min_trips(k, weights):\n    total_trips = sum((x + k - 1) // k for x in weights)\n    min_trips_needed = (total_trips + 1) // 2\n    return min_trips_needed\n", "entry_point": "min_trips", "input": "3, [3] * 47", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5487_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004092", "code": "import math\ndef calculate_rmse(actual_values, predicted_values):\n    if len(actual_values) != len(predicted_values):\n        raise ValueError(\"Length of actual and predicted values should be the same.\")\n    squared_diff = [(actual - predicted) ** 2 for actual, predicted in zip(actual_values, predicted_values)]\n    mean_squared_diff = sum(squared_diff) / len(actual_values)\n    rmse = math.sqrt(mean_squared_diff)\n    return rmse\n", "entry_point": "calculate_rmse", "input": "[2.0, 2.0], [1.0, 3.0]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102976_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004093", "code": "# Dictionary mapping genetic analyzer names to their types\ngenetic_analyzers = {\n    \"NextSeq 550\": \"ILLUMINA_NETSEQ_550\",\n    \"PacBio RS\": \"PACBIO_RS\",\n    \"PacBio RS II\": \"PACBIO_RS2\",\n    \"Sequel\": \"PACBIO_SEQEL\",\n    \"Ion Torrent PGM\": \"IONTORRENT_PGM\",\n    \"Ion Torrent Proton\": \"IONTORRENT_PROTON\",\n    \"Ion Torrent S5\": \"IONTORRENT_S5\",\n    \"Ion Torrent S5 XL\": \"IONTORRENT_S5XL\",\n    \"AB 3730xL Genetic Analyzer\": \"ABI_AB3730XL\",\n    \"AB 3730 Genetic Analyzer\": \"ABI_AB3730\",\n    \"AB 3500xL Genetic Analyzer\": \"ABI_AB3500XL\",\n    \"AB 3500 Genetic Analyzer\": \"ABI_AB3500\",\n    \"AB 3130xL Genetic Analyzer\": \"ABI_AB3130XL\",\n    \"AB 3130 Genetic Analyzer\": \"ABI_AB3130\",\n    \"AB 310 Genetic Analyzer\": \"ABI_AB310\"\n}\ndef get_genetic_analyzer_type(name):\n    return genetic_analyzers.get(name, \"Unknown Analyzer\")\n", "entry_point": "get_genetic_analyzer_type", "input": "'Non-Existent Analyzer'", "output": "'Unknown Analyzer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15803_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5048", "output": "{1, 2, 4, 8, 1262, 631, 5048, 2524}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5047", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004095", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/home/documents/file.txt'", "output": "'/home/documents/file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004096", "code": "def find_lowest(lst):\n    lowest_positive = None\n    for num in lst:\n        if num > 0:\n            if lowest_positive is None or num < lowest_positive:\n                lowest_positive = num\n    return lowest_positive\n", "entry_point": "find_lowest", "input": "[2, 3, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112303_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004097", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2591", "output": "{1, 2591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004098", "code": "import re\ndef process_string(input_string):\n    # Replace \"Kafka\" with \"Python\"\n    processed_string = input_string.replace(\"Kafka\", \"Python\")\n    # Remove digits from the string\n    processed_string = re.sub(r'\\d', '', processed_string)\n    # Reverse the string\n    processed_string = processed_string[::-1]\n    return processed_string\n", "entry_point": "process_string", "input": "'Kafka is some'", "output": "'emos si nohtyP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55468_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004099", "code": "def is_number(s: str) -> bool:\n    s = s.strip()  # Remove leading and trailing whitespaces\n    if not s:  # Check if the string is empty after trimming\n        return False\n    try:\n        float(s)  # Attempt to convert the string to a float\n        return True\n    except ValueError:\n        return False\n", "entry_point": "is_number", "input": "''", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4271_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004100", "code": "import re\ndef extract_tasks(runbook_script):\n    tasks = []\n    task_pattern = re.compile(r\"Task\\.(\\w+)\\.(\\w+)\\((.*?)\\)\")\n    for match in task_pattern.finditer(runbook_script):\n        task_type, task_name, task_args = match.groups()\n        task_details = {\"type\": task_type, \"script_content\": None, \"filename\": None, \"variables\": [], \"target_endpoint\": None}\n        if task_name == \"escript\":\n            script_match = re.search(r\"script=\\\"(.*?)\\\"\", task_args)\n            if script_match:\n                task_details[\"script_content\"] = script_match.group(1)\n        elif task_name == \"ssh\":\n            filename_match = re.search(r\"filename=\\\"(.*?)\\\"\", task_args)\n            if filename_match:\n                task_details[\"filename\"] = filename_match.group(1)\n        elif task_name == \"Exec\":\n            script_match = re.search(r\"script=\\\"(.*?)\\\"\", task_args)\n            if script_match:\n                task_details[\"script_content\"] = script_match.group(1)\n        variables_match = re.search(r\"variables=\\[(.*?)\\]\", task_args)\n        if variables_match:\n            task_details[\"variables\"] = variables_match.group(1).replace(\"'\", \"\").split(\", \")\n        target_match = re.search(r\"target=(.*?)\\)\", task_args)\n        if target_match:\n            task_details[\"target_endpoint\"] = target_match.group(1)\n        tasks.append(task_details)\n    return {\"tasks\": tasks}\n", "entry_point": "extract_tasks", "input": "''", "output": "{'tasks': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25173_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004101", "code": "def max_sum_k_consecutive(a, k, s):\n    if k > len(a):\n        return -1\n    max_sum = -1\n    window_sum = sum(a[:k])\n    start = 0\n    for end in range(k, len(a)):\n        window_sum += a[end] - a[start]\n        if window_sum <= s:\n            max_sum = max(max_sum, window_sum)\n        start += 1\n    return max_sum\n", "entry_point": "max_sum_k_consecutive", "input": "[1, 2, 3], 4, 10", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91821_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004102", "code": "import os\ndef count_python_files_and_lines(directory):\n    total_python_files = 0\n    total_lines_of_code = 0\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.endswith('.py'):\n                total_python_files += 1\n                file_path = os.path.join(root, file)\n                with open(file_path, 'r') as f:\n                    total_lines_of_code += sum(1 for line in f)\n    return total_python_files, total_lines_of_code\n", "entry_point": "count_python_files_and_lines", "input": "'empty_directory'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39412_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004103", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'/path/to/idfy_rest_idfy_rest_clest.py'", "output": "'idfy_rest_idfy_rest_clest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004104", "code": "import math\ndef mint_pizza(slices_per_person, slices_per_pizza):\n    total_slices_needed = sum(slices_per_person)\n    min_pizzas = math.ceil(total_slices_needed / slices_per_pizza)\n    return min_pizzas\n", "entry_point": "mint_pizza", "input": "[6, 6, 6], 8", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149850_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1147", "output": "{1, 1147, 37, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004106", "code": "from typing import List\ndef check_square_pattern(lst: List[int]) -> bool:\n    for i in range(len(lst) - 1):\n        if lst[i+1] != lst[i] ** 2:\n            return False\n    return True\n", "entry_point": "check_square_pattern", "input": "[2, 4, 16]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58073_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004107", "code": "import json\ndef find_email_details(requested_email):\n    # Predefined list of names and emails\n    data = [\n        {'name': 'Alice', 'email': 'alice@example.com'},\n        {'name': 'Bob', 'email': 'bob@example.com'},\n        {'name': 'Charlie', 'email': 'charlie@example.com'}\n    ]\n    for entry in data:\n        if entry['email'] == requested_email:\n            return json.dumps({'name': entry['name'], 'email': entry['email']})\n    return json.dumps({'error': 1})\n", "entry_point": "find_email_details", "input": "'notfound@example.com'", "output": "'{\"error\": 1}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124254_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004108", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        row = list(range(1, i + 1)) + ['*'] * (n - 1) + list(range(i, 0, -1))\n        pattern.append('*'.join(map(str, row)))\n    return pattern\n", "entry_point": "generate_pattern", "input": "1", "output": "['1*1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25502_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004109", "code": "def calculate_weighted_average(numbers, n_obs_train):\n    if n_obs_train == 0:\n        return 0  # Handling division by zero\n    weight = 1. / n_obs_train\n    weighted_sum = sum(numbers) * weight\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[0.711340206185567] * 7, 7", "output": "0.711340206185567", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136723_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004110", "code": "def sum_multiples_of_3_or_5(input_list):\n    multiples_set = set()\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[10, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12129_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004111", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JoJoJ', 'eeDSSmSDSe', 'MMMMariMar'", "output": "'JoJoJ MMMMariMar eeDSSmSDSe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "334", "output": "{1, 2, 334, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004113", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'XPXIPI', 'ME'", "output": "'Invalid status code: XPXIPI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004114", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 0, 0, 4, 0, 5, 0]", "output": "[0, 5, 0, 8, 0, 5, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004115", "code": "def extract_model_info(model_config):\n    authors = model_config.get('authors', '')\n    description = model_config.get('description', '')\n    input_names = [input_data['name'] for input_data in model_config.get('inputs', [])]\n    output_names = [output_data['name'] for output_data in model_config.get('outputs', [])]\n    return authors, description, input_names, output_names\n", "entry_point": "extract_model_info", "input": "{}", "output": "('', '', [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75564_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004116", "code": "def calculate_reward(piece_past_movements, rewards=None):\n    rewards = rewards or {1: 0.8, 2: 0.9, 3: 1, 4: 0.9, 5: 0.5, 6: 0.25}\n    n_skips = 0\n    for movement in piece_past_movements:\n        if abs(movement) > 1:\n            n_skips += 1\n    score = rewards.get(n_skips, 0)\n    return score\n", "entry_point": "calculate_reward", "input": "[2, 3, -4, 5, -2]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67309_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004117", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[8, 10]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004118", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[0, 2, 1, 6, 3, 4, 4, 2, 9]", "output": "[2, 1, 6, 3, 4, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004119", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4966", "output": "{1, 2, 4966, 13, 2483, 26, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004120", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004121", "code": "def process_parameters(rn):\n    net_size = rn.get('net_size', [])\n    net_unit_type = rn.get('net_unit_type', [])\n    net_act_type = rn.get('net_act_type', [])\n    net_arch = rn.get('net_arch', [])\n    if 'conv' in net_unit_type and 'tanh' in net_act_type:\n        print(\"Convolutional layer with tanh activation detected\")\n    if 'bi' in net_arch:\n        print(\"Bidirectional architecture selected\")\n    total_units = sum(net_size)\n    return total_units\n", "entry_point": "process_parameters", "input": "{'net_size': [], 'net_unit_type': [], 'net_act_type': [], 'net_arch': []}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149893_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004122", "code": "from collections import deque\ndef shortest_path(graph, start, end):\n    if start not in graph or end not in graph:\n        return []\n    queue = deque([start])\n    visited = {start: None}\n    while queue:\n        current_node = queue.popleft()\n        if current_node == end:\n            path = []\n            while current_node is not None:\n                path.insert(0, current_node)\n                current_node = visited[current_node]\n            return path\n        for neighbor in graph[current_node]:\n            if neighbor not in visited:\n                visited[neighbor] = current_node\n                queue.append(neighbor)\n    return []\n", "entry_point": "shortest_path", "input": "{'A': ['C'], 'C': []}, 'A', 'B'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38512_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004123", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[1, 10, 2, 3, 4, 5, 6, 7, 10]", "output": "[1, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004124", "code": "def get_file_extension(file_path):\n    # Find the last occurrence of the period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring starting from the last period to the end of the file path\n    if last_period_index != -1:  # Check if a period was found\n        file_extension = file_path[last_period_index:]\n        return file_extension\n    else:\n        return \"\"  # Return an empty string if no period was found\n", "entry_point": "get_file_extension", "input": "'sample.csv'", "output": "'.csv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141157_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004125", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'2.0.96'", "output": "(2, 0, 96)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004126", "code": "import re\ndef parse_makefile(makefile_content):\n    has_title = False\n    main_title = None\n    missing_outputs = []\n    for line in makefile_content.split('\\n'):\n        if 'MAIN:' in line:\n            has_title = True\n            main_title = line.split(':')[-1].strip() if ':' in line else None\n        if 'Must remake target' in line and 'MAIN' not in line and 'pre-build' not in line:\n            missing_output = re.search(r'Must remake target (.+)', line)\n            if missing_output:\n                missing_outputs.append(missing_output.group(1))\n    return has_title, main_title, missing_outputs\n", "entry_point": "parse_makefile", "input": "'No main target here.'", "output": "(False, None, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88822_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004127", "code": "def process_list(input_list, threshold):\n    modified_list = []\n    current_sum = 0\n    for num in input_list:\n        if num < threshold:\n            modified_list.append(num)\n        else:\n            current_sum += num\n            modified_list.append(current_sum)\n    return modified_list\n", "entry_point": "process_list", "input": "[3, 2, 9, 9, 9, 9, 2], 7", "output": "[3, 2, 9, 18, 27, 36, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129571_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004128", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[0, 3, 3, 0, 2, 3, 2]", "output": "[0, 4, 5, 3, 6, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004129", "code": "import typing\nFD_CLOEXEC = 1\nF_GETFD = 2\nF_SETFD = 3\ndef fcntl(fd: int, op: int, arg: int = 0) -> int:\n    if op == F_GETFD:\n        # Simulated logic to get file descriptor flags\n        return 777  # Placeholder value for demonstration\n    elif op == F_SETFD:\n        # Simulated logic to set file descriptor flags\n        return arg  # Placeholder value for demonstration\n    elif op == FD_CLOEXEC:\n        # Simulated logic to handle close-on-exec flag\n        return 1  # Placeholder value for demonstration\n    else:\n        raise ValueError(\"Invalid operation\")\n", "entry_point": "fcntl", "input": "123, FD_CLOEXEC", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147416_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004130", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'22.5'", "output": "(22, 5, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4497", "output": "{1, 4497, 3, 1499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004132", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 10, 15, 20, 30, 34]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004133", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "9, 3", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004134", "code": "def generate_default_dict(keys, default_value):\n    result_dict = {}\n    for key in keys:\n        result_dict[key] = default_value\n    return result_dict\n", "entry_point": "generate_default_dict", "input": "['a', 'b', 'c'], 0", "output": "{'a': 0, 'b': 0, 'c': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91901_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004135", "code": "def sum_of_multiples(matrix, target):\n    total_sum = 0\n    for row in matrix:\n        for element in row:\n            if element % target == 0:\n                total_sum += element\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[[3, 3], [1, 2]], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7703_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004136", "code": "def count_intersecting_unclassified(centrifuge_reads: set, kraken2_reads: set) -> int:\n    intersecting_reads = set()\n    for read_id in centrifuge_reads:\n        if read_id in kraken2_reads:\n            intersecting_reads.add(read_id)\n    return len(intersecting_reads)\n", "entry_point": "count_intersecting_unclassified", "input": "set(), set()", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102749_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004137", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7777", "output": "{1, 7777, 707, 101, 7, 11, 77, 1111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004138", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4837", "output": "{1, 691, 4837, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004139", "code": "def generate_response(message):\n    channel_id = 'CNCRFR7KP'\n    team_id = 'TE4VDPM2L'\n    user_id = 'UE6P69HFH'\n    response_url = \"no\"\n    channel_name = \"local\"\n    if \"lambda\" in message:\n        return \"lambda_function\"\n    if channel_id in message and team_id in message and user_id in message:\n        return \"channel_team_user\"\n    if response_url == \"no\" and \"no\" in message:\n        return \"no_response\"\n    if channel_name == \"local\" and \"local\" in message:\n        return \"local_channel\"\n    return \"No matching rule found.\"\n", "entry_point": "generate_response", "input": "'no'", "output": "'no_response'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78868_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2981", "output": "{1, 11, 2981, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004141", "code": "def generate_discord_mention(webhook_url, role_id):\n    # Extract role ID from the webhook URL\n    role_id = webhook_url.split('/')[-1]\n    # Format the role ID into a Discord mention string\n    mention = f'<@&{role_id}>'\n    return mention\n", "entry_point": "generate_discord_mention", "input": "'https://discord.com/api/webhooks/1234567890/wef', None", "output": "'<@&wef>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141409_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004142", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'pgprhog'", "output": "'Pgprhog'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004143", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'100 + 10'", "output": "110.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004144", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'1.2.9'", "output": "'1.3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004145", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'thitttts'", "output": "'thitttts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004146", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@examplle.om'", "output": "'examplle.om'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004147", "code": "import re\nNAME_REGEX = \"^[a-z0-9-_]+$\"\ndef validate_name(input_str):\n    if not input_str:  # Handle empty input string\n        return False\n    return bool(re.match(NAME_REGEX, input_str))\n", "entry_point": "validate_name", "input": "'valid-name_123'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123794_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004148", "code": "# Step 1: Create a dictionary to store version-checksum mappings\nversion_checksum_map = {\n    '4.4.1': 'c0033e524aa9e05ed18879641ffe6e0f',\n    '4.4.0': '8e626a1708ceff83412180d2ff2f3e57',\n    '4.3.1': '971eee85d630eb4bafcd52531c79673f',\n    '4.3.0': '5961164fe908faf798232a265ed48c73',\n    '4.2.2': '4ac8ae11f1eef4920bf4a5383e13ab50',\n    '4.2.1': 'de583ee9c84db6296269ce7de0afb63f',\n    '4.2.0': 'fc535e4e020a41cd2b55508302b155bb',\n    '4.1.1': '51376850c46fb006e1f8d1cd353507c5',\n    '4.1.0': '638a43e4f8a15872f749090c3f0827b6'\n}\n# Step 2: Implement the get_checksum function\ndef get_checksum(version: str) -> str:\n    return version_checksum_map.get(version, \"Version not found\")\n", "entry_point": "get_checksum", "input": "'5.0.0'", "output": "'Version not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79238_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "303", "output": "{1, 3, 101, 303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004150", "code": "def parse_migration_script(script):\n    table_columns = {}\n    current_table = None\n    for line in script.split('\\n'):\n        if 'def upgrade():' in line:\n            current_table = None\n        elif 'with op.batch_alter_table' in line:\n            current_table = line.split(\"'\")[1]\n            table_columns[current_table] = []\n        elif 'batch_op.add_column' in line:\n            column_name = line.split(\"('\")[1].split(\"'\")[0]\n            table_columns[current_table].append(column_name)\n    return table_columns\n", "entry_point": "parse_migration_script", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27388_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004151", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[10, 10, 10, 16], 10", "output": "[46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004152", "code": "def score(dice):\n    score = 0\n    counts = [0] * 7  # Initialize counts for each dice face (index 1-6)\n    for roll in dice:\n        counts[roll] += 1\n    for i in range(1, 7):\n        if counts[i] >= 3:\n            if i == 1:\n                score += 1000\n            else:\n                score += i * 100\n            counts[i] -= 3\n    score += counts[1] * 100  # Add remaining 1's\n    score += counts[5] * 50   # Add remaining 5's\n    return score\n", "entry_point": "score", "input": "[5, 5]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95031_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7135", "output": "{1, 1427, 5, 7135}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004154", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'101010'", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004155", "code": "def custom_reshape(data, shape):\n    total_elements = sum(len(row) for row in data)\n    target_elements = shape[0] * shape[1]\n    if total_elements != target_elements:\n        return None\n    reshaped_data = []\n    for i in range(shape[0]):\n        reshaped_data.append(data[i % len(data)][:shape[1]])\n    return reshaped_data\n", "entry_point": "custom_reshape", "input": "[[1, 2, 3]], (1, 3)", "output": "[[1, 2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42656_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004156", "code": "import re\ndef count_unique_words(text_content):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', text_content.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'testhello'", "output": "{'testhello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004157", "code": "def find_unique_inode(file_inodes):\n    unique_inode = 0\n    for inode in file_inodes:\n        unique_inode ^= inode\n    return unique_inode\n", "entry_point": "find_unique_inode", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61857_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5863", "output": "{1, 451, 5863, 41, 11, 13, 143, 533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004159", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[0, -1, 1]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004160", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcdefgh', 'ijklmnop'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004161", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "5.0", "output": "78.54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119846_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004162", "code": "def requires_special_handling(driver: str) -> bool:\n    special_drivers = [\"QEMU\", \"Xen\"]\n    return driver in special_drivers\n", "entry_point": "requires_special_handling", "input": "'NVMe'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65777_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004163", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'wor!ld!'", "output": "'wor!ld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004164", "code": "def dummy(n):\n    fibonacci_numbers = [0, 1]\n    while len(fibonacci_numbers) < n:\n        next_number = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        fibonacci_numbers.append(next_number)\n    return fibonacci_numbers[:n]\n", "entry_point": "dummy", "input": "7", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134685_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004165", "code": "from typing import List\ndef find_nearest(array: List[float], value: float) -> float:\n    if not array:\n        raise ValueError(\"Input array is empty\")\n    nearest_idx = 0\n    min_diff = abs(array[0] - value)\n    for i in range(1, len(array)):\n        diff = abs(array[i] - value)\n        if diff < min_diff:\n            min_diff = diff\n            nearest_idx = i\n    return array[nearest_idx]\n", "entry_point": "find_nearest", "input": "[7.1], 7.1", "output": "7.1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121237_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004166", "code": "import re\ndef extract_version_number(input_string):\n    pattern = r'\\d+(\\.\\d+)+'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group()\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version_number", "input": "'No version here'", "output": "'Version number not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48611_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004167", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[100.0, 64.0]", "output": "164.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004168", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>a<raca</p>'", "output": "'a<raca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9290", "output": "{1, 2, 1858, 929, 5, 4645, 9290, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9289", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4215", "output": "{1, 3, 5, 843, 15, 4215, 281, 1405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004171", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[1, 2, 3, 4]", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004172", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'127.0..1', 8081", "output": "'http://127.0..1:8081'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004173", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    # Use regular expression to extract words while ignoring non-alphanumeric characters\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'hello llhello'", "output": "{'hello': 1, 'llhello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115848_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004174", "code": "def compare_colors(red, blue):\n    rcount = bcount = 0\n    for i in range(len(red)):\n        if red[i] == 'r':\n            rcount += 1\n        elif red[i] == 'b':\n            bcount += 1\n    for i in range(len(blue)):\n        if blue[i] == 'r':\n            rcount -= 1\n        elif blue[i] == 'b':\n            bcount -= 1\n    if rcount > bcount:\n        return 'RED'\n    elif rcount < bcount:\n        return 'BLUE'\n    else:\n        return 'EQUAL'\n", "entry_point": "compare_colors", "input": "'rrrbb', 'b'", "output": "'RED'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4786_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004175", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "79, 1", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004176", "code": "def get_turkish_status(status_code):\n    status_mapping = {\n        'conConnecting': 'Ba\u011flan\u0131yor',\n        'conOffline': '\u00c7evrim D\u0131\u015f\u0131',\n        'conOnline': '\u00c7evrim \u0130\u00e7i',\n        'conPausing': 'Duraklat\u0131l\u0131yor',\n        'conUnknown': 'Bilinmiyor',\n        'cusAway': 'Uzakta',\n        'cusDoNotDisturb': 'Rahats\u0131z Etmeyin',\n        'cusInvisible': 'G\u00f6r\u00fcnmez',\n        'cusLoggedOut': '\u00c7evrim D\u0131\u015f\u0131',\n        'cusNotAvailable': 'Kullan\u0131lam\u0131yor',\n        'cusOffline': '\u00c7evrim D\u0131\u015f\u0131',\n        'cusOnline': '\u00c7evrim \u0130\u00e7i',\n        'cusSkypeMe': 'Skype Me',\n        'cusUnknown': 'Bilinmiyor',\n        'cvsBothEnabled': 'Video G\u00f6nderme ve Alma'\n    }\n    return status_mapping.get(status_code, 'Bilinmiyor')\n", "entry_point": "get_turkish_status", "input": "'conOnline'", "output": "'\u00c7evrim \u0130\u00e7i'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56868_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004177", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[1, 0, 0, 20.0]", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004178", "code": "def modify_list(lst, threshold):\n    modified_lst = []\n    for num in lst:\n        if num >= threshold:\n            sum_greater = sum([x for x in lst if x >= threshold])\n            modified_lst.append(sum_greater)\n        else:\n            modified_lst.append(num)\n    return modified_lst\n", "entry_point": "modify_list", "input": "[10, 10, 9], 9", "output": "[29, 29, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28092_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004179", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[0, 0, 0, 0, 2, 2, 3, 3, 4]", "output": "{0: 4, 2: 2, 3: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004180", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[0, 5, 12, 20]", "output": "[5, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004181", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'123 4564.56'", "output": "(4564.56, 123)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004182", "code": "import re\ndef extract_authors_from_script(script):\n    author_pattern = re.compile(r'__author__ = \\'(.*?)\\'')\n    author_names = author_pattern.findall(script)\n    return list(set(author_names))\n", "entry_point": "extract_authors_from_script", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33534_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004183", "code": "def top3(products, amounts, prices):\n    revenue_index_product = [(amount * price, -idx, product) for product, amount, price, idx in zip(products, amounts, prices, range(len(prices)))]\n    revenue_index_product = sorted(revenue_index_product, reverse=True)\n    return [product for (revenue, idx, product) in revenue_index_product[:3]]\n", "entry_point": "top3", "input": "['A', 'B', 'C', 'D'], [10, 1, 8, 7], [5, 1, 4, 3]", "output": "['A', 'C', 'D']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134348_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004184", "code": "def generate_mutated_sequence(cutting_solutions, original_sequence):\n    new_sequence = list(original_sequence)\n    for solution in cutting_solutions:\n        if solution.get(\"n_mutations\", 0) == 0:\n            continue\n        start, mutated_seq = solution[\"mutated_region\"]\n        end = start + len(mutated_seq)\n        new_sequence[start:end] = list(mutated_seq)\n    return \"\".join(new_sequence)\n", "entry_point": "generate_mutated_sequence", "input": "[{'n_mutations': 1, 'mutated_region': (4, 'ATA')}], 'AAAAAAAA'", "output": "'AAAAATAA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104355_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004185", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'aarch64'", "output": "'arm64'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004186", "code": "def find_unique_number(nums):\n    unique_num = 0\n    for num in nums:\n        unique_num ^= num\n    return unique_num\n", "entry_point": "find_unique_number", "input": "[1, 1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126841_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004187", "code": "def generate_password(email):\n    # Extract domain name from email\n    domain = email.split('@')[-1]\n    # Reverse the domain name\n    reversed_domain = domain[::-1]\n    # Combine reversed domain with \"SecurePW\" to generate password\n    password = reversed_domain + \"SecurePW\"\n    return password\n", "entry_point": "generate_password", "input": "'user@examplm'", "output": "'mlpmaxeSecurePW'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104790_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004188", "code": "def count_kwargs(_kwargs):\n    kwargs_count = []\n    for kwargs in _kwargs:\n        count = len(kwargs.keys()) + len(kwargs.values())\n        kwargs_count.append(count)\n    return kwargs_count\n", "entry_point": "count_kwargs", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15928_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004189", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1388", "output": "{1, 2, 4, 1388, 694, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1387", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004190", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004191", "code": "def sort_data(order, data):\n    order_dict = {o: d for o, d in zip(order, data)}\n    sorted_data = sorted(data, key=lambda x: order_dict[order[data.index(x)]])\n    return sorted_data\n", "entry_point": "sort_data", "input": "[0.2, 0.5, 0.8], [0.8, 0.5, 0.2]", "output": "[0.2, 0.5, 0.8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100308_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004192", "code": "import string\ndef count_word_occurrences(text):\n    def clean_word(word):\n        return word.strip(string.punctuation).lower()\n    word_counts = {}\n    words = text.split()\n    for word in words:\n        cleaned_word = clean_word(word)\n        if cleaned_word:\n            word_counts[cleaned_word] = word_counts.get(cleaned_word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'tshis'", "output": "{'tshis': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4386_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5182", "output": "{1, 2, 5182, 2591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004194", "code": "def ltof(values):\n    \"\"\"\n    Converts the special integer-encoded doubles back into Python floats.\n    Args:\n    values (list or tuple): List of integer-encoded doubles.\n    Returns:\n    list: List of corresponding Python floats.\n    \"\"\"\n    assert isinstance(values, (tuple, list)), \"Input must be a list or tuple\"\n    return [int(val) / 1000. for val in values]\n", "entry_point": "ltof", "input": "[1000, 750, 1250, 1250, 1250]", "output": "[1.0, 0.75, 1.25, 1.25, 1.25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144669_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004195", "code": "def is_sorted_non_decreasing(lst):\n    for i in range(len(lst) - 1):\n        if lst[i] > lst[i + 1]:\n            return False\n    return True\n", "entry_point": "is_sorted_non_decreasing", "input": "[3, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122366_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004196", "code": "def validate_registration(username: str, password1: str, password2: str) -> str:\n    if not username:\n        return \"Username cannot be empty.\"\n    if password1 != password2:\n        return \"Passwords do not match.\"\n    return \"Registration successful.\"\n", "entry_point": "validate_registration", "input": "'user', 'pass123', 'pass123'", "output": "'Registration successful.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3689_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1198", "output": "{1, 2, 1198, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1197", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004198", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'a_'", "output": "'a_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004199", "code": "from collections import defaultdict\ndef organize_dependencies(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    for dependency, _ in dependencies:\n        in_degree[dependency] = 0\n    for i in range(1, len(dependencies)):\n        if dependencies[i][0] != dependencies[i-1][0]:\n            graph[dependencies[i-1][0]].append(dependencies[i][0])\n            in_degree[dependencies[i][0]] += 1\n    queue = [dependency for dependency in in_degree if in_degree[dependency] == 0]\n    result = []\n    while queue:\n        current = queue.pop(0)\n        result.append(current)\n        for neighbor in graph[current]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    return result\n", "entry_point": "organize_dependencies", "input": "[('a', None)]", "output": "['a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25215_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004200", "code": "import collections\ndef count_subarrays(a, k):\n    n = len(a)\n    s = [0] * (n + 1)\n    for i in range(n):\n        s[i + 1] = s[i] + a[i]\n    for i in range(1, n + 1):\n        s[i] = (s[i] - i) % k\n    cnt = collections.defaultdict(int)\n    cnt[0] = 1\n    res = 0\n    for i in range(1, n + 1):\n        res += cnt[s[i]]\n        cnt[s[i]] += 1\n        if i - (k - 1) >= 0:\n            cnt[s[i - (k - 1)]] -= 1\n    return res\n", "entry_point": "count_subarrays", "input": "[1, 1, 1, 1], 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104413_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004201", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[2, 8]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2950_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004202", "code": "import re\n# Pre-defined regular expression pattern\nre_session = re.compile(r\"session=(.*?);\")\ndef extract_session_ids(text):\n    # Find all matches of the regular expression pattern in the input text\n    matches = re_session.findall(text)\n    # Extract session IDs from the matches and store them in a set for uniqueness\n    session_ids = set(match for match in matches)\n    return list(session_ids)\n", "entry_point": "extract_session_ids", "input": "'text with session=abc123; and some other content'", "output": "['abc123']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27451_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004203", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'woRTwoRT @Rh'", "output": "('', 'woRTwoRT @Rh')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004204", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[4, 5]", "output": "[4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004205", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "-2", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004206", "code": "def extract_metadata(code_snippet):\n    metadata = {}\n    lines = code_snippet.strip().split('\\n')\n    for line in lines:\n        key_value = line.split('=')\n        key = key_value[0].strip().strip('_').lower()\n        value = key_value[1].strip().strip(\" '\")\n        metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "\"= ''\"", "output": "{'': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113322_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004207", "code": "import logging\nLOG_LEVELS = {\n    \"CRITICAL\": logging.CRITICAL,\n    \"ERROR\": logging.ERROR,\n    \"WARNING\": logging.WARNING,\n    \"INFO\": logging.INFO,\n    \"DEBUG\": logging.DEBUG,\n}\nDEFAULT_LEVEL = \"WARNING\"\ndef convert_log_level(log_level):\n    return LOG_LEVELS.get(log_level, LOG_LEVELS.get(DEFAULT_LEVEL))\n", "entry_point": "convert_log_level", "input": "'WARNING'", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18272_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004208", "code": "def map_loggers_to_configurations(loggers, configurations):\n    logger_config_map = {}\n    for logger in loggers:\n        found = False\n        for config in configurations:\n            if logger.split('.')[0] in config:\n                logger_config_map[logger] = config\n                found = True\n                break\n        if not found:\n            logger_config_map[logger] = 'No configuration found'\n    return logger_config_map\n", "entry_point": "map_loggers_to_configurations", "input": "[], ['config1', 'config2']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36627_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004209", "code": "def has_circular_dependencies(dependencies):\n    graph = {}\n    def build_graph():\n        for dep in dependencies:\n            if dep[0] not in graph:\n                graph[dep[0]] = []\n            graph[dep[0]].append(dep[1])\n    def dfs(node, visited, path):\n        visited.add(node)\n        path.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor in path or (neighbor not in visited and dfs(neighbor, visited, path)):\n                return True\n        path.remove(node)\n        return False\n    build_graph()\n    for node in graph:\n        if dfs(node, set(), set()):\n            return True\n    return False\n", "entry_point": "has_circular_dependencies", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125978_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004210", "code": "def product_except_self(arr):\n    n = len(arr)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products to the left of each element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * arr[i - 1]\n    # Calculate products to the right of each element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * arr[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "product_except_self", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108608_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004211", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[]", "output": "(0, 0, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004212", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'Hello, hello! World.'", "output": "{'hello': 2, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004213", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "'123 rWold'", "output": "[('NUMBER', '123'), ('WORD', 'rWold')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004214", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[0, 2, 1, 3, 4, 5, 6, 7, 8], 2", "output": "[0, 0, 1, 1, 0, 1, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004215", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "4, 0", "output": "'Enemy: 4, Own: 0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004216", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> int:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[75, 75, 75]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7016_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004217", "code": "def calculate_winner(cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A wins\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "calculate_winner", "input": "[5, 3, 2]", "output": "'Player A wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134546_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004218", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7206", "output": "{1, 2, 3, 2402, 7206, 6, 1201, 3603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004219", "code": "import re\ndef analyze_content(content, reg):\n    matches = re.findall(reg, content)\n    indices = [m.start(0) for m in re.finditer(reg, content)]\n    result = {\n        'count': len(matches),\n        'indices': indices,\n        'matches': matches\n    }\n    return result\n", "entry_point": "analyze_content", "input": "'', 'abc'", "output": "{'count': 0, 'indices': [], 'matches': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23069_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004220", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '**':\n        return num1 ** num2\n    elif operation == '*' or operation == '/':\n        return num1 * num2 if operation == '*' else num1 / num2\n    elif operation == '//' or operation == '%':\n        return num1 // num2 if operation == '//' else num1 % num2\n    elif operation == '+' or operation == '-':\n        return num1 + num2 if operation == '+' else num1 - num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'invalidOp', 5, 3", "output": "'Invalid operation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63622_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004221", "code": "def findFirstBadVersion(versions, bad_version):\n    start = 0\n    end = len(versions) - 1\n    while start < end:\n        mid = start + (end - start) // 2\n        if versions[mid] >= bad_version:\n            end = mid\n        else:\n            start = mid + 1\n    if versions[start] == bad_version:\n        return start\n    elif versions[end] == bad_version:\n        return end\n    else:\n        return -1\n", "entry_point": "findFirstBadVersion", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 10], 10", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1351_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004222", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[5, 5, 7]", "output": "175", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122742_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004223", "code": "import os\ndef extract_package_info(package_name):\n    version = None\n    long_description = None\n    # Read version number from _version.py\n    version_file_path = os.path.join(package_name, '_version.py')\n    if os.path.exists(version_file_path):\n        ver = {}\n        with open(version_file_path) as fd:\n            exec(fd.read(), ver)\n        version = ver.get('__version__')\n    # Read long description from README.md\n    readme_file_path = os.path.join(package_name, 'README.md')\n    if os.path.exists(readme_file_path):\n        with open(readme_file_path, \"r\", encoding=\"utf-8\") as fh:\n            long_description = fh.read()\n    return version, long_description\n", "entry_point": "extract_package_info", "input": "'non_existent_package'", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11609_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2022", "output": "{1, 2, 3, 674, 2022, 6, 337, 1011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2021", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004225", "code": "def find_most_frequent_character(strings):\n    char_freq = {}\n    for string in strings:\n        for i, char in enumerate(string):\n            if char != '':  # Ignore empty positions\n                if i not in char_freq:\n                    char_freq[i] = {}\n                if char in char_freq[i]:\n                    char_freq[i][char] += 1\n                else:\n                    char_freq[i][char] = 1\n    result = ''\n    max_freq = 0\n    for pos in char_freq:\n        max_char = min(char_freq[pos], key=lambda x: (-char_freq[pos][x], x))\n        if char_freq[pos][max_char] > max_freq:\n            result = max_char\n            max_freq = char_freq[pos][max_char]\n    return result\n", "entry_point": "find_most_frequent_character", "input": "['a', 'b', 'a']", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108003_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004226", "code": "def generate_url(route_pattern, request_id):\n    return route_pattern.replace(\"{request_id}\", str(request_id))\n", "entry_point": "generate_url", "input": "'/aemy-{request_id}/api-.cv', 're'", "output": "'/aemy-re/api-.cv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10596_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004227", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'5.5'", "output": "'5.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004228", "code": "def get_reward(win_type_nm):\n    if win_type_nm == 'jackpot':\n        return \"Congratulations! You've won the jackpot!\"\n    elif win_type_nm == 'bonus':\n        return \"Great job! You've earned a bonus reward!\"\n    elif win_type_nm == 'match':\n        return \"Nice! You've matched a win!\"\n    else:\n        return \"Sorry, no reward this time. Try again!\"\n", "entry_point": "get_reward", "input": "'none'", "output": "'Sorry, no reward this time. Try again!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97895_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004229", "code": "from datetime import datetime\ndef calculate_date_difference(date1, date2):\n    # Parse the input date strings into datetime objects\n    date1_obj = datetime.strptime(date1, '%Y-%m-%d')\n    date2_obj = datetime.strptime(date2, '%Y-%m-%d')\n    # Calculate the absolute difference in days between the two dates\n    date_difference = abs((date1_obj - date2_obj).days)\n    return date_difference\n", "entry_point": "calculate_date_difference", "input": "'2023-01-01', '2023-01-10'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86815_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004230", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[4, 9, 1, 1, 1], 5", "output": "[4, 9, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004231", "code": "import re\ndef extract_configuration_info(code_snippet):\n    config_info = {}\n    secret_key = re.search(r\"SECRET_KEY = '(.+)'\", code_snippet)\n    if secret_key:\n        config_info['SECRET_KEY'] = secret_key.group(1)\n    email_server_details = re.findall(r\"MAIL_(\\w+) = '(.+)'\", code_snippet)\n    for key, value in email_server_details:\n        config_info[key] = value\n    database_uri = re.search(r\"SQLALCHEMY_DATABASE_URI = '(.+)'\", code_snippet)\n    if database_uri:\n        config_info['SQLALCHEMY_DATABASE_URI'] = database_uri.group(1)\n    uploaded_files_dest = re.search(r\"UPLOADED_FILES_DEST = '(.+)'\", code_snippet)\n    if uploaded_files_dest:\n        config_info['UPLOADED_FILES_DEST'] = uploaded_files_dest.group(1)\n    return config_info\n", "entry_point": "extract_configuration_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89883_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004232", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[250, 300, 251], 200", "output": "801", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004233", "code": "from typing import List\ndef minimize_total_time(tasks: List[int]) -> int:\n    tasks.sort(reverse=True)  # Sort tasks in descending order\n    workers = [0] * len(tasks)  # Initialize total time taken by each worker\n    for task in tasks:\n        min_time_worker = workers.index(min(workers))  # Find the worker with the least total time\n        workers[min_time_worker] += task  # Assign the task to the worker\n    return max(workers)  # Return the maximum total time taken by any worker\n", "entry_point": "minimize_total_time", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24883_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004234", "code": "def sum_multiples_3_or_5(n: int) -> int:\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_or_5", "input": "10", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10997_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004235", "code": "import os\ndef get_unique_extensions(directory):\n    if not os.path.isdir(directory):\n        return []\n    extensions = set()\n    for file in os.listdir(directory):\n        _, extension = os.path.splitext(file)\n        if extension:\n            extensions.add(extension[1:])  # Remove the leading dot\n    return list(extensions)\n", "entry_point": "get_unique_extensions", "input": "'/invalid/directory/path'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92366_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004236", "code": "def minMeetingRooms(intervals):\n    intervals.sort(key=lambda x: x[0])  # Sort intervals based on start time\n    rooms = []  # List to store ongoing meetings\n    for start, end in intervals:\n        settled = False\n        for i, (room_end) in enumerate(rooms):\n            if room_end <= start:\n                rooms[i] = end\n                settled = True\n                break\n        if not settled:\n            rooms.append(end)\n    return len(rooms)\n", "entry_point": "minMeetingRooms", "input": "[(1, 2)]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107943_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004237", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[110, 105, 107, 100, 99, 97, 93, 106], 8", "output": "102.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004238", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'1.0.2'", "output": "(1, 0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004239", "code": "def find_numbers_in_range(min_val, max_val):\n    numbers_in_range = []\n    for num in range(min_val, max_val + 1):\n        if num == 2 or num == 3:\n            numbers_in_range.append(num)\n    return numbers_in_range\n", "entry_point": "find_numbers_in_range", "input": "2, 3", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119042_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004240", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5163", "output": "{3, 1, 5163, 1721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004241", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5008", "output": "{1, 2, 4, 1252, 2504, 8, 5008, 16, 626, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5007", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004242", "code": "def format_metadata(metadata, indent=4):\n    formatted_attrs = []\n    for key in metadata.keys():\n        formatted_attrs.append(\" \" * indent + f\"{key}: {repr(metadata[key])}\")\n    return \"\\n\".join(formatted_attrs)\n", "entry_point": "format_metadata", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104242_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004243", "code": "import re\n# Define the regular expression patterns for each file format\n_regexes = {\n    'pdb.gz': re.compile(r'\\.pdb\\.gz$'),\n    'mmcif': re.compile(r'\\.mmcif$'),\n    'sdf': re.compile(r'\\.sdf$'),\n    'xyz': re.compile(r'\\.xyz$'),\n    'sharded': re.compile(r'\\.sharded$')\n}\ndef identify_file_format(file_name):\n    for format_key, pattern in _regexes.items():\n        if pattern.search(file_name):\n            return format_key\n    return \"Unknown Format\"\n", "entry_point": "identify_file_format", "input": "'example.mmcif'", "output": "'mmcif'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24846_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004244", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8107", "output": "{1, 737, 67, 11, 8107, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004245", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 12, 15, 20, 5, 8, 21, 25]", "output": "(4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004246", "code": "# Define the set of allowed file extensions\nALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])\ndef allowed_file(filename):\n    if '.' in filename:\n        # Split the filename to get the extension\n        extension = filename.rsplit('.', 1)[1].lower()\n        # Check if the extension is in the allowed extensions set\n        return extension in ALLOWED_EXTENSIONS\n    return False\n", "entry_point": "allowed_file", "input": "'image.png'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50839_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004247", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average excluding highest and lowest.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90]", "output": "85.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66758_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004248", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'gyrosaat'", "output": "'Value of gyrosaat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004249", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[4, 2, 3, 7, 3, 3, 8, 4, 7]", "output": "[2, 3, 3, 3, 4, 4, 7, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004250", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1062", "output": "{1, 2, 3, 354, 1062, 6, 9, 177, 18, 531, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004251", "code": "def evaluate_expression(expression):\n    return eval(expression)\n", "entry_point": "evaluate_expression", "input": "'1 + 2'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69875_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004252", "code": "import json\nimport urllib.request\ndef validate_api_data(api_url: str, json_schema: dict) -> bool:\n    try:\n        with urllib.request.urlopen(api_url) as url:\n            data = json.loads(url.read().decode())\n        # Assuming validate_json function is defined elsewhere\n        if not validate_json(data, json_schema):\n            return True\n        else:\n            return False\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return False\n", "entry_point": "validate_api_data", "input": "'http://invalid-url', {}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127263_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004253", "code": "def calculate_median(numbers):\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return sorted_numbers[n // 2]\n    else:  # Even number of elements\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (sorted_numbers[mid_left] + sorted_numbers[mid_right]) / 2\n", "entry_point": "calculate_median", "input": "[5, 6, 7]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80358_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004254", "code": "from typing import List\ndef maximize_min_distance(a: List[int], M: int) -> int:\n    a.sort()\n    def is_ok(mid):\n        last = a[0]\n        count = 1\n        for i in range(1, len(a)):\n            if a[i] - last >= mid:\n                count += 1\n                last = a[i]\n        return count >= M\n    left, right = 0, a[-1] - a[0]\n    while left < right:\n        mid = (left + right + 1) // 2\n        if is_ok(mid):\n            left = mid\n        else:\n            right = mid - 1\n    return left\n", "entry_point": "maximize_min_distance", "input": "[0, 1], 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2008", "output": "{1, 2, 4, 8, 1004, 502, 2008, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2007", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004256", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(2, 5, 1)", "output": "'2.5.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004257", "code": "import re\ndef filter_valid_emails(emails):\n    valid_emails = []\n    email_pattern = r'^[\\w\\.-]+@[a-zA-Z\\d\\.-]+\\.[a-zA-Z]{2,}$'\n    for email in emails:\n        if re.match(email_pattern, email):\n            valid_emails.append(email)\n    return valid_emails\n", "entry_point": "filter_valid_emails", "input": "['invalidemail.com', 'user@domain', '@example.com', 'example@.com']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94733_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004258", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[10, 15, 20]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004259", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 83], 2", "output": "86.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89007_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004260", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[0, 0, 1, 0, 0, 2]", "output": "[3, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004261", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.10.1100'", "output": "(0, 10, 1100)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004262", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[3, 3, 1, 5, 0, 4]", "output": "[3, 1, 5, 0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004263", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[0, 1, 2, 3, 6]", "output": "[0, 1, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004264", "code": "def generate_fibonacci_sequence(n):\n    ult = 0\n    num = 1\n    sequence = []\n    while num <= n:\n        sequence.append(num)\n        ult, num = num, ult + num\n    return sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "89", "output": "[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53548_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004265", "code": "import re\nfrom collections import Counter\ndef most_common_word(s: str) -> str:\n    # Preprocess the input string\n    s = re.sub(r'[^\\w\\s]', '', s.lower())\n    # Split the string into words\n    words = s.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Find the most common word\n    most_common = max(word_freq, key=word_freq.get)\n    return most_common\n", "entry_point": "most_common_word", "input": "'Hello world! This world is a beautiful world.'", "output": "'world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23655_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004266", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6815", "output": "{1, 5, 235, 47, 145, 1363, 29, 6815}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004267", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'22..00.', 'forms.FormlC'", "output": "\"[22..00.]: 'forms.FormlC'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004268", "code": "def extract_filename(log_location: str) -> str:\n    # Find the last occurrence of '/' to identify the start of the filename\n    start_index = log_location.rfind('/') + 1\n    # Find the position of the '.' before the extension\n    end_index = log_location.rfind('.')\n    # Extract the filename between the last '/' and the '.'\n    filename = log_location[start_index:end_index]\n    return filename\n", "entry_point": "extract_filename", "input": "'/path/to/file/ttm.txt'", "output": "'ttm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13809_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004269", "code": "def get_file_ext_from_url(url: str) -> str:\n    file_name_start = url.rfind('/') + 1\n    file_name_end = url.rfind('?') if '?' in url else len(url)\n    file_name = url[file_name_start:file_name_end]\n    dot_index = file_name.rfind('.')\n    if dot_index != -1:\n        return file_name[dot_index:]\n    else:\n        return ''\n", "entry_point": "get_file_ext_from_url", "input": "'http://example.com/file.th?someparam=value'", "output": "'.th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_292_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004270", "code": "def count_pairs(arr, target):\n    freq_map = {}\n    pair_count = 0\n    for x in arr:\n        complement = target - x\n        if complement in freq_map:\n            pair_count += freq_map[complement]\n        freq_map[x] = freq_map.get(x, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112887_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004271", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7624", "output": "{1, 2, 3812, 4, 7624, 8, 1906, 953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7623", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004272", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 1, 2, 3, 2, 1, 4]", "output": "[1, 4, 9, 8, 5, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77019_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004273", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004274", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[1, 1, 1, 1], 30, 10", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004275", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[80, 70, 65, 50, 45, 30]", "output": "[80, 70, 65]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004276", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "755", "output": "{1, 755, 5, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8324", "output": "{1, 2, 4162, 4, 8324, 2081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8323", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004278", "code": "import re\ndef get_unique_modules(code_snippet):\n    import_pattern = r\"import\\s+([\\w.]+)|from\\s+([\\w.]+)\\s+import\"\n    matches = re.findall(import_pattern, code_snippet)\n    unique_modules = set()\n    for match in matches:\n        for module in match:\n            if module:\n                unique_modules.add(module)\n    return list(unique_modules)\n", "entry_point": "get_unique_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94969_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004279", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'6.2', 122", "output": "'6.2.122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004280", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "524", "output": "{1, 2, 131, 4, 262, 524}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt523", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004281", "code": "def extract_text_from_paragraph_elements(paragraph_elements):\n    \"\"\"\n    Extracts text content from a list of ParagraphElement objects.\n    Args:\n        paragraph_elements: List of ParagraphElement objects\n    Returns:\n        List of text content extracted from each element\n    \"\"\"\n    extracted_text = []\n    for element in paragraph_elements:\n        text_run = element.get('textRun')\n        if text_run is None:\n            extracted_text.append('')\n        else:\n            extracted_text.append(text_run.get('content', ''))\n    return extracted_text\n", "entry_point": "extract_text_from_paragraph_elements", "input": "[{'textRun': None}] * 9", "output": "['', '', '', '', '', '', '', '', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35466_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004282", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[-3, -1, 3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004283", "code": "def check_key(dictionary: dict, key: str) -> bool:\n    if key in dictionary:\n        return True\n    for value in dictionary.values():\n        if isinstance(value, dict):\n            if check_key(value, key):\n                return True\n    return False\n", "entry_point": "check_key", "input": "{'a': 1, 'b': {'c': 2, 'd': {'e': 3}}}, 'x'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65807_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004284", "code": "def can_issue_warning(user_roles):\n    moderation_roles = ['moderators', 'admins']  # Roles allowed to issue a warning\n    for role in user_roles:\n        if role in moderation_roles:\n            return True\n    return False\n", "entry_point": "can_issue_warning", "input": "['moderators']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117657_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004285", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[4, 10]", "output": "116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_423_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004286", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8693", "output": "{1, 8693}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004287", "code": "def determine_name(n):\n    # Check if n is odd or even and return the corresponding name\n    if n % 2 == 1:\n        return \"Alice\"\n    else:\n        return \"Bob\"\n", "entry_point": "determine_name", "input": "1", "output": "'Alice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124502_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004288", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4591", "output": "{1, 4591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004289", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[91, 88, 65, 92, 86, 88, 87, 85, 92]", "output": "[65, 85, 86, 87, 88, 88, 91, 92, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004290", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'4.5.9'", "output": "'4.6.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004291", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.DoeJoJo.Doe@EOM'", "output": "'john.doejojo.doe@eom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004292", "code": "def count_unique_queries(search_queries):\n    unique_queries_count = {}\n    for user_id, query_text in search_queries:\n        if user_id not in unique_queries_count:\n            unique_queries_count[user_id] = set()\n        unique_queries_count[user_id].add(query_text)\n    return {user_id: len(queries) for user_id, queries in unique_queries_count.items()}\n", "entry_point": "count_unique_queries", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29638_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3716", "output": "{1, 2, 1858, 4, 3716, 929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3715", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004294", "code": "def sum_of_factors(number):\n    sum_factors = 0\n    upper_limit = int(number ** 0.5) + 1\n    for i in range(1, upper_limit):\n        if number % i == 0:\n            if i != number / i:  # Exclude the number itself\n                sum_factors += i\n                sum_factors += number // i\n    return sum_factors\n", "entry_point": "sum_of_factors", "input": "28", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66573_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004295", "code": "def generate_list(n):\n    res = []\n    for i in range(1, (n // 2) + 1):\n        res.append(i)\n    for i in range(-(n // 2), 0):\n        res.append(i)\n    return res\n", "entry_point": "generate_list", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88002_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004296", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2067", "output": "{1, 3, 39, 13, 689, 2067, 53, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004297", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[6, 6, 9, 7, 5, 11, 7, 7]", "output": "([6, 6], [9, 7, 5, 11, 7, 7])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004298", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "61, 0", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004299", "code": "def max_triangle_weight(triangle, level=0, index=0):\n    if level == len(triangle) - 1:\n        return triangle[level][index]\n    else:\n        return triangle[level][index] + max(\n            max_triangle_weight(triangle, level + 1, index),\n            max_triangle_weight(triangle, level + 1, index + 1)\n        )\n", "entry_point": "max_triangle_weight", "input": "[[1], [2, 3], [4, 5, 1]]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29046_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004300", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 2, 3, 8, 6, 7, 9, 7]", "output": "[1, 2, 9, 512, 1296, 16807, 531441, 823543]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1587", "output": "{1, 3, 69, 529, 1587, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004302", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'33.5.11.0.3'", "output": "'33.5.11.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004303", "code": "def is_multiple(a, b):\n    return a % b == 0\n", "entry_point": "is_multiple", "input": "6, 3", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29243_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004304", "code": "def check_filter_presence(versions, filter_name):\n    filters = [\n        'MultiSelectFilter', 'MultiSelectRelatedFilter', 'MultiSelectDropdownFilter',\n        'MultiSelectRelatedDropdownFilter', 'DropdownFilter', 'ChoicesDropdownFilter',\n        'RelatedDropdownFilter', 'BooleanAnnotationFilter'\n    ]\n    version_filter_mapping = {\n        (1, 3): [\n            'MultiSelectFilter', 'MultiSelectRelatedFilter', 'MultiSelectDropdownFilter',\n            'MultiSelectRelatedDropdownFilter', 'DropdownFilter', 'ChoicesDropdownFilter',\n            'RelatedDropdownFilter', 'BooleanAnnotationFilter'\n        ],\n        (2, 4): [\n            'NewFilter1', 'NewFilter2', 'NewFilter3'\n        ]\n        # Add more version mappings as needed\n    }\n    version_tuple = tuple(versions)\n    if version_tuple in version_filter_mapping:\n        filters = version_filter_mapping[version_tuple]\n    return filter_name in filters\n", "entry_point": "check_filter_presence", "input": "[1, 3], 'DropdownFilter'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139601_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004305", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9659", "output": "{1, 9659, 13, 743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004306", "code": "import os\ndef configure_access(password):\n    if password:\n        return 'readwrite'\n    else:\n        return 'readonly'\n", "entry_point": "configure_access", "input": "'mypassword'", "output": "'readwrite'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133597_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004307", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[90, 89, 80, 85], 4", "output": "[0, 1, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004308", "code": "def count_unique_nodes(graph_str):\n    unique_nodes = set()\n    edges = graph_str.split('\\n')\n    for edge in edges:\n        nodes = edge.split('->')\n        for node in nodes:\n            unique_nodes.add(node.strip())\n    return len(unique_nodes)\n", "entry_point": "count_unique_nodes", "input": "'A -> B\\nB -> C\\nC -> D\\nD -> E\\nE -> F\\nF -> A'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17791_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004309", "code": "def extract_command_and_text(message):\n    # Find the index of the first space after \"!addcom\"\n    start_index = message.find(\"!addcom\") + len(\"!addcom\") + 1\n    # Extract the command by finding the index of the first space after the command\n    end_index_command = message.find(\" \", start_index)\n    command = message[start_index:end_index_command]\n    # Extract the text by finding the index of the first space after the command\n    text = message[end_index_command+1:]\n    return command, text\n", "entry_point": "extract_command_and_text", "input": "'!addcom ge:re youuusage:re?'", "output": "('ge:re', 'youuusage:re?')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33793_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004310", "code": "def extract_domain_counts(start_urls):\n    domain_counts = {}\n    for url in start_urls:\n        domain = url.split('//')[-1].split('/')[0]\n        if domain in domain_counts:\n            domain_counts[domain] += 1\n        else:\n            domain_counts[domain] = 1\n    return domain_counts\n", "entry_point": "extract_domain_counts", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75510_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4417", "output": "{4417, 1, 631, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004312", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "8", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004313", "code": "from math import isqrt\ndef generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, isqrt(n) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n + 1, i):\n                is_prime[j] = False\n    return [num for num, prime in enumerate(is_prime) if prime]\n", "entry_point": "generate_primes", "input": "5", "output": "[2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141297_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004314", "code": "# Constants\nE_INVALID_SNAPSHOT_NAME = 2\ndef validate_snapshot_name(snapshot_name):\n    if not snapshot_name:\n        return E_INVALID_SNAPSHOT_NAME\n    if any(char.isspace() for char in snapshot_name):\n        return E_INVALID_SNAPSHOT_NAME\n    if not snapshot_name.isalnum():\n        return E_INVALID_SNAPSHOT_NAME\n    if len(snapshot_name) < 3:\n        return E_INVALID_SNAPSHOT_NAME\n    return 0\n", "entry_point": "validate_snapshot_name", "input": "''", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119724_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004315", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[5, 6, 8], 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004316", "code": "def sum_multiples_of_3_or_5(nums):\n    multiples = set()\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples:\n                total += num\n                multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 10, 12, 15]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66564_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5855", "output": "{1, 1171, 5, 5855}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004318", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "14", "output": "{1, 2, 14, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004319", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6229", "output": "{1, 6229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6228", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004320", "code": "def nrzi_encode(input_str):\n    output = \"\"\n    signal_level = 0\n    for bit in input_str:\n        if bit == '1':\n            signal_level = 1 - signal_level\n        output += str(signal_level)\n    return output\n", "entry_point": "nrzi_encode", "input": "'000001'", "output": "'000001'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123000_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004321", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[63, 73, 33, 32, 37, 70, 70]", "output": "[65, 75, 33, 32, 37, 70, 70]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004322", "code": "def basic_calculator(num1, num2, operation):\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Error: Division by zero\"\n    else:\n        return \"Error: Invalid operation\"\n", "entry_point": "basic_calculator", "input": "5, 3, '^'", "output": "'Error: Invalid operation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004323", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-7, 3, 4, 3, 2, 1, 3, 2]", "output": "[-7, 3, 4, 3, 2, 1, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004324", "code": "def total_price(cart):\n    total = 0\n    for item in cart:\n        total += item[\"price\"]\n    return total\n", "entry_point": "total_price", "input": "[{'price': 9.99}]", "output": "9.99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23365_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004325", "code": "import os\ndef count_files_by_extension(directory_path, extension):\n    count = 0\n    for root, _, files in os.walk(directory_path):\n        for file in files:\n            if file.endswith('.' + extension):\n                count += 1\n    return count\n", "entry_point": "count_files_by_extension", "input": "'empty_directory', 'txt'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118574_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004326", "code": "def sum_of_even_numbers(input_list):\n    even_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_even_numbers", "input": "[10, 10, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57858_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004327", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[0, 4, 3, 4, 3, 2, 4]", "output": "[1, 5, 4, 5, 4, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004328", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'watermelogo,pi'", "output": "['watermelogo', 'pi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004329", "code": "def calculate_smallest_rectangle_area(points):\n    minlat = min(point[0] for point in points)\n    minlon = min(point[1] for point in points)\n    maxlat = max(point[0] for point in points)\n    maxlon = max(point[1] for point in points)\n    width = maxlat - minlat\n    height = maxlon - minlon\n    return width * height\n", "entry_point": "calculate_smallest_rectangle_area", "input": "[(0, 0), (0, 6), (6, 0), (6, 6)]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149770_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004330", "code": "import re\ndef input_url_source_check(input_url):\n    sources_regex = {\n        'syosetu': '((http:\\/\\/|https:\\/\\/)?(ncode.syosetu.com\\/n))(\\d{4}[a-z]{2}\\/?)$',\n        'example': 'https://www.example.com/.*'\n    }\n    for key, pattern in sources_regex.items():\n        regex = re.compile(pattern)\n        if re.match(regex, input_url):\n            return key\n    return False\n", "entry_point": "input_url_source_check", "input": "'http://invalid-url.com/'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93592_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004331", "code": "def sum_of_squares(lst):\n    sum_squares = 0\n    for num in lst:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[1, 2, 3, -3]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36660_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004332", "code": "def find_highest_score(scores):\n    if not scores:\n        return None\n    highest_score = scores[0]\n    for score in scores[1:]:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[90, 95, 96]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73697_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004333", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4901", "output": "{1, 4901, 169, 13, 377, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004335", "code": "def calculate_metrics(metrics):\n    total_metrics = len(metrics)\n    metrics_sum = sum(metrics)\n    average = metrics_sum / total_metrics\n    rounded_average = round(average, 2)\n    return rounded_average\n", "entry_point": "calculate_metrics", "input": "[0.66, 0.68]", "output": "0.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118593_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004336", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-3, 1, 2, 4, 5]", "output": "[[-3, 1, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004337", "code": "def count_score_combinations(scores):\n    total_sum = sum(scores)\n    dp = [0] * (total_sum + 1)\n    dp[0] = 1\n    for score in scores:\n        for j in range(score, total_sum + 1):\n            dp[j] += dp[j - score]\n    return dp[-1]\n", "entry_point": "count_score_combinations", "input": "[1, 2, 3]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11763_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004338", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[15, 5, 6]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20128_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004339", "code": "def card_war(player1_card, player2_card):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_value = card_values[player1_card]\n    player2_value = card_values[player2_card]\n    if player1_value > player2_value:\n        return \"Player 1 wins!\"\n    elif player2_value > player1_value:\n        return \"Player 2 wins!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "card_war", "input": "'5', '5'", "output": "\"It's a tie!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46407_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004340", "code": "def most_common_element(input_list):\n    element_count = {}\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common = max(element_count, key=element_count.get)\n    return most_common\n", "entry_point": "most_common_element", "input": "[5, 5, 5, 1, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6653_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004341", "code": "def max_product(nums):\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[1, 2, 4, 5]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2090_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004342", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "900000000.0", "output": "'0.9 x 10^8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004343", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[85, 85, 85, 86, 86, 86, 91, 83]", "output": "{85: 3, 86: 3, 91: 1, 83: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004344", "code": "def is_valid_byteorder(hi):\n    INTHDRS = ['nvhdr', 'other_field1', 'other_field2']  # Define the list of header fields\n    try:\n        nvhdr = hi[INTHDRS.index('nvhdr')]  # Extract 'nvhdr' value from the header list\n        return 0 < nvhdr < 20  # Check if 'nvhdr' is within the valid range\n    except ValueError:\n        return False  # Return False if 'nvhdr' is not found in the header\n", "entry_point": "is_valid_byteorder", "input": "[10]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113096_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004345", "code": "import re\ndef extract_message_info(text: str) -> dict:\n    fields = []\n    types = []\n    has_header = False\n    for line in text.split('\\n'):\n        if line.strip().startswith('#') or line.strip() == \"\":\n            continue\n        if \"__slots__\" in line:\n            has_header = True\n            continue\n        match = re.match(r'\\s*(\\w+): (.+)', line)\n        if match:\n            fields.append(match.group(1))\n            types.append(match.group(2))\n    return {\n        \"fields\": fields,\n        \"types\": types,\n        \"has_header\": has_header\n    }\n", "entry_point": "extract_message_info", "input": "''", "output": "{'fields': [], 'types': [], 'has_header': False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84787_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004346", "code": "def longest_consecutive_sequence(steps):\n    current_length = 0\n    max_length = 0\n    for step in steps:\n        if step != 0:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 0\n    return max_length\n", "entry_point": "longest_consecutive_sequence", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74155_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1004", "output": "{1, 2, 4, 1004, 502, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1003", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004348", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4106", "output": "{1, 4106, 2, 2053}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4105", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004349", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[2, 3, 3, 2, 2, 3, 3, 2]", "output": "[4, 6, 6, 4, 4, 6, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004350", "code": "from typing import List\nfrom math import sqrt\ndef process_integers(int_list: List[int], threshold: int) -> float:\n    filtered_integers = [x for x in int_list if x >= threshold]\n    squared_integers = [x**2 for x in filtered_integers]\n    sum_squared = sum(squared_integers)\n    return sqrt(sum_squared)\n", "entry_point": "process_integers", "input": "[10, 3, 2], 2", "output": "10.63014581273465", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15467_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004351", "code": "def concat(parameters, sep):\n    text = ''\n    for i in range(len(parameters)):\n        text += str(parameters[i])\n        if i != len(parameters) - 1:\n            text += sep\n        else:\n            text += '\\n'\n    return text\n", "entry_point": "concat", "input": "[1, 4, 5, 4, 4, 3, 2, 4], '----'", "output": "'1----4----5----4----4----3----2----4\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80875_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004352", "code": "import os\ndef simulate_run(filename):\n    filesplit = filename.rsplit('.', 1)\n    if len(filesplit) < 2:\n        return \"Invalid filename format\"\n    second_part_length = len(filesplit[1])\n    filesplit[1] = f'%0{second_part_length}d'\n    modified_filename = '.'.join(filesplit)\n    directory = os.path.dirname(modified_filename)\n    directory_parts = os.path.basename(directory).rsplit(' ', 1)\n    if len(directory_parts) < 2:\n        return \"Frame number not found\"\n    filename_frame = directory_parts[1]\n    clipboard_content = f'{modified_filename} {filename_frame}'\n    return clipboard_content\n", "entry_point": "simulate_run", "input": "'filename_without_extension'", "output": "'Invalid filename format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44297_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004353", "code": "def get_polarities(input_list):\n    polarity_map = {\n        1: -1,\n        0: 1,\n        3: 0,\n        2: None\n    }\n    output_list = []\n    for num in input_list:\n        if num in polarity_map:\n            output_list.append(polarity_map[num])\n        else:\n            output_list.append('Unknown')\n    return output_list\n", "entry_point": "get_polarities", "input": "[1, 0, 3, 2, 4]", "output": "[-1, 1, 0, None, 'Unknown']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26756_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "608", "output": "{608, 1, 2, 32, 4, 38, 8, 76, 304, 16, 19, 152}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt607", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4961", "output": "{1, 4961, 451, 41, 11, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004356", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "15", "output": "'fizzbuzz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004357", "code": "def findSqrt(num):\n    l = 0\n    r = num\n    while l <= r:\n        mid = l + (r - l) // 2\n        if mid * mid == num:\n            return True\n        if mid * mid < num:\n            l = mid + 1\n        if mid * mid > num:\n            r = mid - 1\n    return False\n", "entry_point": "findSqrt", "input": "2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63488_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8336", "output": "{1, 2, 4, 2084, 4168, 8, 521, 8336, 16, 1042}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8335", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004359", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i][j - 1] + 1, dp[i - 1][j] + 1, dp[i - 1][j - 1] + 1)\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'aaaaaaaaaaaa', 'bbbbbbbbbbbb'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44999_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004360", "code": "def manhattan_distance(point1, point2):\n    x1, y1 = point1\n    x2, y2 = point2\n    return abs(x1 - x2) + abs(y1 - y2)\n", "entry_point": "manhattan_distance", "input": "(0, 0), (15, 0)", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128962_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004361", "code": "def sum_of_even_numbers(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[0, 2, 4, 6, 2]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102661_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004362", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 1, 8, 1, 2]", "output": "[0, 2, 10, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25747_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2167", "output": "{1, 11, 197, 2167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004364", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1337", "output": "{1, 7, 191, 1337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004365", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'hello he \"exaple\"'", "output": "['hello', 'he', 'exaple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004366", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:999]'", "output": "76561197960266727", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004367", "code": "import re\ndef extract_function_docstrings(script):\n    function_pattern = re.compile(r\"def\\s+([a-zA-Z_]\\w*)\\s*\\(([^)]*)\\)\\s*:\\s*\\\"\\\"\\\"(.*?)\\\"\\\"\\\"\", re.DOTALL)\n    functions = function_pattern.findall(script)\n    function_dict = {}\n    for function in functions:\n        function_name = function[0]\n        docstring = function[2].strip()\n        function_dict[function_name] = docstring\n    return function_dict\n", "entry_point": "extract_function_docstrings", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92296_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004368", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[5, 1, 0, 3, 2, 0, 0]", "output": "[5, 2, 2, 6, 6, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004369", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "12, 97.7984", "output": "1173.5808", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004370", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[5, 1, 2, 5]", "output": "[125, 1, 4, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004371", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[0, 0, 4, 2, 1]", "output": "[0, 0, 16, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004372", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "0, 4", "output": "'04:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004373", "code": "def min_abs_diff(nums):\n    nums.sort()\n    min_diff = float('inf')\n    for i in range(1, len(nums)):\n        diff = abs(nums[i] - nums[i-1])\n        min_diff = min(min_diff, diff)\n    return min_diff\n", "entry_point": "min_abs_diff", "input": "[1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132683_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004374", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "5.0, 11.0, 100", "output": "(1.0, 0.02727272727272727)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004375", "code": "import re\ndef process_string(input_string):\n    extracted_values = {'name': 'Unknown', 'age': 'Unknown', 'city': 'Unknown'}\n    pattern = r'(?:name=([^\\s,]+))?,?(?:age=([^\\s,]+))?,?(?:city=([^\\s,]+))?'\n    match = re.match(pattern, input_string)\n    if match:\n        extracted_values['name'] = match.group(1) if match.group(1) else 'Unknown'\n        extracted_values['age'] = match.group(2) if match.group(2) else 'Unknown'\n        extracted_values['city'] = match.group(3) if match.group(3) else 'Unknown'\n    return extracted_values\n", "entry_point": "process_string", "input": "'name=Alice,age=30,city=New'", "output": "{'name': 'Alice', 'age': '30', 'city': 'New'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136671_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004376", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1871", "output": "{1, 1871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004377", "code": "def rearrange_string(s):\n    s = list(s)\n    left, right = 0, len(s) - 1\n    while left < right:\n        while left < right and s[left].islower():\n            left += 1\n        while left < right and s[right].isupper():\n            right -= 1\n        if left < right:\n            s[left], s[right] = s[right], s[left]\n    return ''.join(s)\n", "entry_point": "rearrange_string", "input": "'dadaAADAD'", "output": "'dadaAADAD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134334_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004378", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[2, 3, 1]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004379", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004380", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'eegglge', 10", "output": "'eegglge_high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004381", "code": "def count_foo_occurrences(input_string):\n    count = 0\n    for i in range(len(input_string) - 2):\n        if input_string[i:i+3] == \"foo\":\n            count += 1\n    return count\n", "entry_point": "count_foo_occurrences", "input": "'foo'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48936_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004382", "code": "# Given set of valid PEN values\nVALID_PENS = {1588, 1234, 5678, 9999}  # Example valid PEN values\ndef validate_pen(pen):\n    return pen in VALID_PENS\n", "entry_point": "validate_pen", "input": "1000", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004383", "code": "def sum_absolute_differences(lst1, lst2):\n    total_diff = 0\n    for i in range(len(lst1)):\n        total_diff += abs(lst1[i] - lst2[i])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[5, 0], [0, 0]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24453_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004384", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'aeh', 18", "output": "'swz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65928_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004385", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[52]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004386", "code": "def get_value(type_acquisition, model_input_size):\n    dict_size = {\n        \"SEM\": {\n            \"512\": 0.1,\n            \"256\": 0.2\n        },\n        \"TEM\": {\n            \"512\": 0.01\n        }\n    }\n    # Check if the type_acquisition and model_input_size exist in the dictionary\n    if type_acquisition in dict_size and model_input_size in dict_size[type_acquisition]:\n        return dict_size[type_acquisition][model_input_size]\n    else:\n        return \"Value not found\"\n", "entry_point": "get_value", "input": "'SEM', '256'", "output": "0.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2685_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004387", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "1, 4, 5", "output": "'1.4.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004388", "code": "def max_product(nums):\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2090_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004389", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'world!'", "output": "['world!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004390", "code": "from typing import List\ndef extract_headings(markdown_text: str) -> List[str]:\n    headings = []\n    for line in markdown_text.split('\\n'):\n        line = line.strip()\n        if line.startswith('#'):\n            heading = line.lstrip('#').strip()\n            headings.append(heading)\n    return headings\n", "entry_point": "extract_headings", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89024_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004391", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[4, 3, 5, 5, 5, 5, 5, 4]", "output": "[5.66, 4.24, 7.07, 7.07, 7.07, 7.07, 7.07, 5.66]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8538", "output": "{1, 2, 3, 6, 4269, 1423, 8538, 2846}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004393", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 90, 90, 85, 80]", "output": "[95, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113414_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004394", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[10, 20, 30, 25, 6], 66", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004395", "code": "from typing import List\ndef calculate_unique_views(view_ids: List[int]) -> int:\n    unique_views = set()\n    for view_id in view_ids:\n        unique_views.add(view_id)\n    return len(unique_views)\n", "entry_point": "calculate_unique_views", "input": "[1, 1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46079_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004396", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 6, 6, 6, 6, 3, 5, 5, 5]", "output": "[4, 6, 6, 6, 6, 9, 25, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004397", "code": "def sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "15", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60427_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004398", "code": "import urllib\ndef count_unique_bytes(url: str) -> int:\n    unique_bytes = set()\n    try:\n        stream = urllib.urlopen(url)\n        bytes = stream.read()\n        for byte in bytes:\n            unique_bytes.add(byte)\n        return len(unique_bytes)\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return 0\n", "entry_point": "count_unique_bytes", "input": "'http://invalid-url'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34581_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004399", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 36]", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35742_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004400", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'A24'", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004401", "code": "def skipVowels(word):\n    novowels = ''\n    for ch in word:\n        if ch.lower() in 'aeiou':\n            continue\n        novowels += ch\n    return novowels\n", "entry_point": "skipVowels", "input": "'hello'", "output": "'hll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120866_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004402", "code": "def get_sample_folder_path(platform):\n    platform_paths = {\n        \"UWP\": \"ArcGISRuntime.UWP.Viewer/Samples\",\n        \"WPF\": \"ArcGISRuntime.WPF.Viewer/Samples\",\n        \"Android\": \"Xamarin.Android/Samples\",\n        \"iOS\": \"Xamarin.iOS/Samples\",\n        \"Forms\": \"Shared/Samples\",\n        \"XFA\": \"Shared/Samples\",\n        \"XFI\": \"Shared/Samples\",\n        \"XFU\": \"Shared/Samples\"\n    }\n    if platform in platform_paths:\n        return platform_paths[platform]\n    else:\n        return \"Unknown platform provided\"\n", "entry_point": "get_sample_folder_path", "input": "'Forms'", "output": "'Shared/Samples'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70790_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004403", "code": "def extract_domain(url):\n    # Remove the protocol prefix\n    url = url.replace(\"http://\", \"\").replace(\"https://\", \"\")\n    # Extract the domain name\n    domain_parts = url.split(\"/\")\n    domain = domain_parts[0]\n    # Remove subdomains\n    domain_parts = domain.split(\".\")\n    if len(domain_parts) > 2:\n        domain = \".\".join(domain_parts[-2:])\n    return domain\n", "entry_point": "extract_domain", "input": "'https://sub.example.com'", "output": "'example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77353_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004404", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[98, 96, 62, 90, 89, 90, 100, 75], 6", "output": "[98, 96, 62, 90, 89, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004405", "code": "NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION = 0\nNOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION = 1\nNOTIFICATION_REPORTED_AS_FALLACY = 2\nNOTIFICATION_FOLLOWED_A_SPEAKER = 3\nNOTIFICATION_SUPPORTED_A_DECLARATION = 4\nNOTIFICATION_TYPES = (\n    (NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION, \"added-declaration-for-resolution\"),\n    (NOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION, \"added-declaration-for-declaration\"),\n    (NOTIFICATION_REPORTED_AS_FALLACY, \"reported-as-fallacy\"),\n    (NOTIFICATION_FOLLOWED_A_SPEAKER, \"followed\"),\n    (NOTIFICATION_SUPPORTED_A_DECLARATION, \"supported-a-declaration\"),\n)\ndef get_notification_message(notification_type):\n    for notification_tuple in NOTIFICATION_TYPES:\n        if notification_tuple[0] == notification_type:\n            return notification_tuple[1]\n    return \"Notification type not found\"\n", "entry_point": "get_notification_message", "input": "5", "output": "'Notification type not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86427_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004406", "code": "def process_input_tensor(dec_u_list):\n    dec_w_list = []\n    dec_b_list = []\n    for element in dec_u_list:\n        if isinstance(element, list):\n            dec_w_list.append(element)\n        else:\n            dec_b_list.append(element)\n    return dec_w_list, dec_b_list\n", "entry_point": "process_input_tensor", "input": "[[1, [2, 3], 4, [5, 6]]]", "output": "([[1, [2, 3], 4, [5, 6]]], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82568_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004407", "code": "import string\ndef extract_unique_words(input_str):\n    translator = str.maketrans('', '', string.punctuation)  # Translator to remove punctuation\n    unique_words = []\n    seen_words = set()\n    for word in input_str.split():\n        cleaned_word = word.translate(translator).lower()\n        if cleaned_word not in seen_words:\n            seen_words.add(cleaned_word)\n            unique_words.append(cleaned_word)\n    return unique_words\n", "entry_point": "extract_unique_words", "input": "'iis! IIS, iis. Iis?'", "output": "['iis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26247_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "667", "output": "{1, 667, 29, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004409", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'python'", "output": "{'python': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7329", "output": "{1, 7329, 3, 7, 2443, 21, 1047, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004411", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Welcome to __title__'", "output": "'Welcome to hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004412", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'BTCUSDT'", "output": "('BTC', 'USDT')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3993", "output": "{1, 33, 3, 121, 11, 363, 1331, 3993}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004414", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 1, 1, 4, 1, -1, 2, 3]", "output": "[1, 2, 12, 4, -5, 12, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004415", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[2, 1, 3, 3, 5, 3, 4, 6, 4], 3", "output": "[[2, 1, 3], [3, 5, 3], [4, 6, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004416", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[4, 8, 7, 3, 8, 3]", "output": "[4, 9, 9, 6, 12, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004417", "code": "def construct_path(path: str, name: str) -> str:\n    if path.endswith(\"/\"):\n        path = path[:-1]\n    if name.startswith(\"/\"):\n        name = name[1:]\n    return f\"{path}/{name}\"\n", "entry_point": "construct_path", "input": "'/home', 'user'", "output": "'/home/user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82517_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004418", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/user/documents/some-file.txt'", "output": "'some-file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004419", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[15, 15, 11, 16, 16]", "output": "['FizzBuzz', 'FizzBuzz', 11, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004420", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'0.0.1'", "output": "'0.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004421", "code": "def map_source_to_file(source):\n    if source == 'A':\n        return 'art_source.txt'\n    elif source == 'C':\n        return 'clip_source.txt'\n    elif source == 'P':\n        return 'product_source.txt'\n    elif source == 'R':\n        return 'real_source.txt'\n    else:\n        return \"Unknown Source Type, only supports A C P R.\"\n", "entry_point": "map_source_to_file", "input": "'R'", "output": "'real_source.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140499_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004422", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[1, 2, 5]", "output": "{1, 2, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004423", "code": "import re\ndef remove_color_codes(text):\n    return re.sub('(\u00a7[0-9a-f])', '', text)\n", "entry_point": "remove_color_codes", "input": "'\u00a7aTTh\u00a70'", "output": "'TTh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50171_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004424", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['20', '+', '40']", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004425", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[8, 8, 3, 6, 7, 1, 1, 7, 8]", "output": "[8, 9, 5, 9, 11, 6, 7, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004426", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'nvme0n1', 2", "output": "'nvme0n1p2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004427", "code": "from typing import List\ndef max_visible_buildings(buildings: List[int]) -> int:\n    if not buildings:\n        return 0\n    n = len(buildings)\n    lis = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if buildings[i] > buildings[j] and lis[i] < lis[j] + 1:\n                lis[i] = lis[j] + 1\n    return max(lis)\n", "entry_point": "max_visible_buildings", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100979_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004428", "code": "def op(image):\n    # Assuming image is represented as a list of RGB values for each pixel\n    # Convert RGB to grayscale by averaging the RGB values\n    grayscale_image = [(pixel[0] + pixel[1] + pixel[2]) // 3 for pixel in image]\n    return grayscale_image\n", "entry_point": "op", "input": "[[85, 85, 85], [85, 85, 85], [85, 85, 85]]", "output": "[85, 85, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48312_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004429", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "33, 2", "output": "528", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004430", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[[5, 2], [3.5]]", "output": "10.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004431", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'gyroscope_ungame_rat'", "output": "'Value of gyroscope_ungame_rat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004432", "code": "def sum_multiples_3_or_5(num):\n    total = 0\n    for i in range(num):\n        if i % 3 == 0 or i % 5 == 0:\n            total += i\n    return total\n", "entry_point": "sum_multiples_3_or_5", "input": "24", "output": "119", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124212_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004433", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "71, 'codadd_coluo_instruments.py'", "output": "'71_codadd_coluo_instruments'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004434", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[15, 2, 11, 5]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75875_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004435", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3749", "output": "{1, 163, 3749, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1930", "output": "{1, 2, 386, 193, 5, 965, 1930, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1929", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004437", "code": "import typing\ndef circular_sum(input_list: typing.List[int]) -> typing.List[int]:\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 0, 3, 2, 3, 1, 2, 1]", "output": "[0, 3, 5, 5, 4, 3, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4417_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004438", "code": "import math\ndef calculate_expression(x):\n    sqrt_x = math.sqrt(x)\n    log_x = math.log10(x)\n    result = sqrt_x + log_x\n    return result\n", "entry_point": "calculate_expression", "input": "11", "output": "4.358017475513625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127737_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004439", "code": "def password_strength_checker(password: str) -> int:\n    score = 0\n    # Length points\n    score += len(password)\n    # Uppercase and lowercase letters\n    if any(c.isupper() for c in password) and any(c.islower() for c in password):\n        score += 5\n    # Digit present\n    if any(c.isdigit() for c in password):\n        score += 5\n    # Special character present\n    special_chars = set(\"!@#$%^&*()_+-=[]{}|;:,.<>?\")\n    if any(c in special_chars for c in password):\n        score += 10\n    # Bonus points for pairs\n    for i in range(len(password) - 1):\n        if password[i].lower() == password[i + 1].lower() and password[i] != password[i + 1]:\n            score += 2\n    return score\n", "entry_point": "password_strength_checker", "input": "'Abc12'", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139577_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004440", "code": "from typing import Tuple\ndef final_position(directions: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'UDLR'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93403_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004441", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "12", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004442", "code": "def is_happy_number(n):\n    seen = {}\n    while True:\n        if n in seen:\n            return False\n        counter = 0\n        for i in range(len(str(n))):\n            counter += int(str(n)[i]) ** 2\n        seen[n] = 1\n        n = counter\n        counter = 0\n        if n == 1:\n            return True\n", "entry_point": "is_happy_number", "input": "4", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52206_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004443", "code": "import re\ndef parse_gem_packages(output: str) -> dict:\n    gem_packages = {}\n    lines = output.strip().split('\\n')\n    for line in lines:\n        match = re.match(r'(\\S+)\\s+\\(([^)]+)\\)', line)\n        if match:\n            package_name = match.group(1)\n            versions = match.group(2).split(', ')\n            gem_packages[package_name] = versions\n    return gem_packages\n", "entry_point": "parse_gem_packages", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77874_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004444", "code": "def translate_russian_to_english(message):\n    translations = {\n        '\u041f\u0440\u0438\u043d\u044f\u043b\u0438!': 'Accepted!',\n        '\u0421\u043f\u0430\u0441\u0438\u0431\u043e': 'Thank you',\n        '\u0437\u0430': 'for',\n        '\u0432\u0430\u0448\u0443': 'your',\n        '\u0437\u0430\u044f\u0432\u043a\u0443.': 'application.'\n    }\n    translated_message = []\n    words = message.split()\n    for word in words:\n        translated_word = translations.get(word, word)\n        translated_message.append(translated_word)\n    return ' '.join(translated_message)\n", "entry_point": "translate_russian_to_english", "input": "'\u0421\u043f\u0430\u0441\u0438\u0431\u043e'", "output": "'Thank you'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111635_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004445", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3657", "output": "{1, 3, 1219, 69, 3657, 53, 23, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004446", "code": "import sys\ndef min_distance_dijkstra(alst, h, w):\n    dist = {}\n    dist[(-1, -1)] = 0\n    dist[(h, w)] = sys.maxsize\n    for i in range(0, h+1):\n        for j in range(0, w+1):\n            dist[(i, j)] = sys.maxsize\n    toVisit = list(dist.keys())\n    while len(toVisit) > 0:\n        toCheck = {k: dist[k] for k in toVisit}\n        key = min(toCheck, key=toCheck.get)\n        val = dist[key]\n        for t in alst.get(key, {}):\n            dist[t] = min(dist[t], val + alst[key][t])\n        toVisit.remove(key)\n    return dist[(h, w)]\n", "entry_point": "min_distance_dijkstra", "input": "{}, 2, 2", "output": "9223372036854775807", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78432_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004447", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[1, 2, 3, 4, 5, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004448", "code": "def forgiving_true(expression):\n    forgiving_truthy_values = {\"t\", \"True\", \"true\", 1, True}\n    return expression in forgiving_truthy_values\n", "entry_point": "forgiving_true", "input": "0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14124_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004449", "code": "def evolucoes_proximas(pokemon):\n    pokemon_evolutions = {\n        \"CHARIZARD\": [\"CHARMANDER\", \"CHARMELEON\"],\n        \"CHARMANDER\": [\"CHARMELEON\", \"CHARIZARD\"],\n        \"CHARMELEON\": [\"CHARMANDER\", \"CHARIZARD\"],\n        # Add more Pok\u00e9mon and their evolution chains as needed\n    }\n    if pokemon in pokemon_evolutions:\n        return pokemon_evolutions[pokemon]\n    else:\n        return []\n", "entry_point": "evolucoes_proximas", "input": "'PIKACHU'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87799_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004450", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8875", "output": "{1, 355, 5, 71, 8875, 1775, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004451", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 90, 89.2]", "output": "89.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004452", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers.\"\n    elif n == 0:\n        return 1\n    else:\n        return n * calculate_factorial(n - 1)\n", "entry_point": "calculate_factorial", "input": "6", "output": "720", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139159_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004453", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'world'", "output": "['world']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004454", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    index = len(scores)\n    while low <= high:\n        mid = (low + high) // 2\n        if scores[mid] >= threshold:\n            index = mid\n            high = mid - 1\n        else:\n            low = mid + 1\n    return len(scores) - index\n", "entry_point": "count_students_above_threshold", "input": "[], 75", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148839_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004455", "code": "def max_palindrome_length(s: str) -> int:\n    char_count = {}\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    max_length = 0\n    for count in char_count.values():\n        max_length += count if count % 2 == 0 else count - 1\n    return max_length\n", "entry_point": "max_palindrome_length", "input": "'aabbcceedd'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124507_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004456", "code": "import re\ndef extract_version_info(version_str):\n    version_info = {}\n    pattern = r\"v(?P<version>[0-9]+(?:\\.[0-9]+)*)(?P<dev>\\.dev[0-9]+\\+g[0-9a-f]+)?(?P<date>\\.d[0-9]+)?\"\n    match = re.match(pattern, version_str)\n    if match:\n        version_info['version'] = match.group('version')\n        if match.group('dev'):\n            version_info['dev'] = int(match.group('dev').split('.dev')[1].split('+')[0])\n            version_info['git_commit'] = match.group('dev').split('+g')[1]\n        if match.group('date'):\n            version_info['date'] = int(match.group('date').split('.d')[1])\n    return version_info\n", "entry_point": "extract_version_info", "input": "'v1.2.3'", "output": "{'version': '1.2.3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47059_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004457", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'O', 'John', 2017", "output": "'O00JOH2017'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004458", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[3, 3, 2, 6, 2, 4, 4]", "output": "[3, 2, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004459", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'162435678'", "output": "'16243567822485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004460", "code": "def sum_of_squares_of_even_numbers(input_list):\n    sum_of_squares = 0\n    for num in input_list:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113006_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004461", "code": "def binary_search(arr, target):\n    low = 0\n    high = len(arr) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "[], 5", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9228_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004462", "code": "from typing import List\ndef filter_event_types(prefix: str) -> List[str]:\n    __all__ = [\"catch_event_type\", \"end_event_type\", \"event_type\", \"intermediate_catch_event_type\",\n               \"intermediate_throw_event_type\", \"start_event_type\", \"throw_event_type\"]\n    filtered_event_types = [event_type for event_type in __all__ if event_type.startswith(prefix)]\n    return filtered_event_types\n", "entry_point": "filter_event_types", "input": "'xyz'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56513_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7027", "output": "{1, 7027}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7026", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004464", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JoooJ', 'DoSSmSSth', 'MariMare'", "output": "'JoooJ MariMare DoSSmSSth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004465", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[9, 5, 8, 16, 2, 5, 9]", "output": "[2, 5, 5, 8, 9, 9, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004466", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:  # Even number of elements\n        mid = n // 2\n        return (sorted_numbers[mid - 1] + sorted_numbers[mid]) / 2\n    else:  # Odd number of elements\n        return sorted_numbers[n // 2]\n", "entry_point": "calculate_median", "input": "[5, 7, 9]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28715_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004467", "code": "from typing import List\ndef min_transactions_to_equalize_shares(shares: List[int]) -> int:\n    total_shares = sum(shares)\n    target_shares = total_shares // len(shares)\n    transactions = 0\n    for share in shares:\n        transactions += max(0, target_shares - share)\n    return transactions\n", "entry_point": "min_transactions_to_equalize_shares", "input": "[0, 0, 8]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91176_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004468", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[8.2]", "output": "8.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004469", "code": "def generate_fibonacci_numbers(limit):\n    fibonacci_numbers = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_numbers.append(a)\n        a, b = b, a + b\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci_numbers", "input": "8", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146022_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004470", "code": "from time import strptime, mktime\ndef date_to_stamp(date_str):\n    \"\"\"\n    Convert a date string in 'YYYY-MM-DD' format to a Unix timestamp.\n    :param date_str: Date string in 'YYYY-MM-DD' format\n    :return: Unix timestamp corresponding to the input date\n    \"\"\"\n    try:\n        date_struct = strptime(date_str, '%Y-%m-%d')\n        timestamp = mktime(date_struct)\n        return int(timestamp)\n    except ValueError:\n        return \"Invalid date format. Please provide date in 'YYYY-MM-DD' format.\"\n", "entry_point": "date_to_stamp", "input": "'2022-12-31'", "output": "1672444800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120867_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004471", "code": "from typing import Optional\nCORE_API_MEDIA_TYPE_INVALID = 'application/vnd.bihealth.invalid'\nCORE_API_VERSION_INVALID = '9.9.9'\ndef validate_api(media_type: str, version: str) -> bool:\n    return media_type != CORE_API_MEDIA_TYPE_INVALID and version != CORE_API_VERSION_INVALID\n", "entry_point": "validate_api", "input": "'application/vnd.bihealth.invalid', 'some.version'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7575_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004472", "code": "def password_generator(username):\n    password = \"\"\n    for i in range(len(username)):\n        password += username[i-1] if i > 0 else username[0]\n    return password\n", "entry_point": "password_generator", "input": "'tee'", "output": "'tte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123535_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004473", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "5, 1, 7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004474", "code": "def max_non_adjacent_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[20, 1, 15, 1, 8]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11871_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004475", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'l Wo!H'", "output": "'y Jb!U'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004476", "code": "def calculate_operations(results):\n    calculated_results = []\n    for i in range(0, len(results), 2):\n        operand1 = results[i]\n        operand2 = results[i + 1]\n        expected_result = results[i + 1]\n        if operand1 + operand2 == expected_result:\n            calculated_results.append(operand1 + operand2)\n        elif operand1 - operand2 == expected_result:\n            calculated_results.append(operand1 - operand2)\n        elif operand1 * operand2 == expected_result:\n            calculated_results.append(operand1 * operand2)\n        elif operand1 // operand2 == expected_result:\n            calculated_results.append(operand1 // operand2)\n    return calculated_results\n", "entry_point": "calculate_operations", "input": "[2, 5, 3, 8]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21926_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004477", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'12abce!@#'", "output": "['abce']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004478", "code": "import math\ndef get_total_pages(post_list, count):\n    total_posts = len(post_list)\n    total_pages = math.ceil(total_posts / count)\n    return total_pages\n", "entry_point": "get_total_pages", "input": "['post1', 'post2', 'post3', 'post4', 'post5', 'post6'], 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90417_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004479", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'WorWlt'", "output": "'WorWlt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004480", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[1, 1, 2, 2, 3, 4, 4]", "output": "([1, 2, 3, 4], 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004481", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'papath2ppatat'", "output": "'Content for papath2ppatat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004482", "code": "import math\ndef regularized_quantile_loss(y_true, y_pred, q):\n    loss = 2 * (q * math.log(math.cosh(y_pred - y_true)) + (1 - q) * math.log(math.cosh(y_true - y_pred)))\n    return loss\n", "entry_point": "regularized_quantile_loss", "input": "1, 2, 0.5", "output": "0.8675616609660542", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137166_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004483", "code": "from typing import List\ndef maxProfit(prices: List[int]) -> int:\n    if not prices or len(prices) < 2:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[5, 1, 7]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94869_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004484", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "'[1, 4, 5]'", "output": "[1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004485", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[75, 78, 79, 81, 90]", "output": "79.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137363_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004486", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'INITIAL', 'START'", "output": "'CONNECTING'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004487", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[5]", "output": "('Rel Day 5', 'relday5')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004488", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "12", "output": "[12, 6, 3, 10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004489", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'taskeme0'", "output": "{'when': 'taskeme0', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004490", "code": "def count_unique_even_numbers(lst):\n    unique_evens = set()\n    for num in lst:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_even_numbers", "input": "[2, 4, 6, 8, 4, 2, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111984_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004491", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[7, 1, 1]", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004492", "code": "def extract_test_descriptions(test_cases):\n    test_descriptions = {}\n    for test_case in test_cases:\n        test_name, test_description = test_case.split(\": \")\n        test_descriptions[test_name] = test_description\n    return test_descriptions\n", "entry_point": "extract_test_descriptions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98842_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004493", "code": "def extract_docstring_info(docstring):\n    info = {}\n    lines = docstring.strip().split('\\n')\n    for line in lines:\n        if line.startswith(':param'):\n            params = line.split(':param ')[1].split(',')\n            for param in params:\n                info[param.strip()] = None\n        elif line.startswith(':return'):\n            return_info = line.split(':return ')\n            if len(return_info) > 1:\n                info['return'] = return_info[1]\n    return info\n", "entry_point": "extract_docstring_info", "input": "'\\n:param ctx\\n:param num: Thi.\\n'", "output": "{'ctx': None, 'num: Thi.': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46124_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004494", "code": "def reverse_engineer_logic(input_num):\n    if input_num == 23:\n        return 1\n    # Add additional conditions and logic here if needed\n    else:\n        return 0  # Default return value if input_num does not match the hidden logic\n", "entry_point": "reverse_engineer_logic", "input": "23", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28391_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004495", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5441", "output": "{5441, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004496", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[12, 12]", "output": "(12, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004497", "code": "def player(prev_play, opponent_history=[]):\n    opponent_history.append(prev_play)\n    guess = \"R\"\n    if len(opponent_history) > 2:\n        guess = opponent_history[-2]\n    return guess\n", "entry_point": "player", "input": "'R'", "output": "'R'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121291_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5781", "output": "{1, 3, 1927, 41, 141, 47, 5781, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "397", "output": "{1, 397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004500", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[10, 2, 1], [0, 0, 0]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004501", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4771", "output": "{1, 4771, 13, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004502", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[6, 8, 6, 3, 7, 8, 5, 6], 1", "output": "[[6], [8], [6], [3], [7], [8], [5], [6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004503", "code": "def evaluate_expression(expression):\n    try:\n        result = eval(expression)\n        return result\n    except ZeroDivisionError:\n        return \"Error: Division by zero\"\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "evaluate_expression", "input": "'5 + 5'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79055_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004504", "code": "from typing import List, Tuple\ndef has_circular_dependencies(dependencies: List[Tuple[str, str]]) -> bool:\n    graph = {}\n    for dependency in dependencies:\n        if dependency[0] not in graph:\n            graph[dependency[0]] = []\n        graph[dependency[0]].append(dependency[1])\n    def dfs(task, visited, stack):\n        visited.add(task)\n        stack.add(task)\n        for neighbor in graph.get(task, []):\n            if neighbor not in visited:\n                if dfs(neighbor, visited, stack):\n                    return True\n            elif neighbor in stack:\n                return True\n        stack.remove(task)\n        return False\n    for task in graph.keys():\n        if dfs(task, set(), set()):\n            return True\n    return False\n", "entry_point": "has_circular_dependencies", "input": "[('A', 'B'), ('B', 'C'), ('C', 'A')]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20914_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004505", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9654", "output": "{1, 2, 3, 6, 1609, 3218, 9654, 4827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004506", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(1, 0, 2, 0, 3, 0, 0, 0)", "output": "'1.0.2.0.3.0.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004507", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v31.2.'", "output": "'31.2.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004508", "code": "def calculate_salutes(hallway: str) -> int:\n    crosses = 0\n    right_count = 0\n    for char in hallway:\n        if char == \">\":\n            right_count += 1\n        elif char == \"<\":\n            crosses += right_count * 2\n    return crosses\n", "entry_point": "calculate_salutes", "input": "'>>>>>>>>>><<'", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117936_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004509", "code": "def check_allocation_mismatch(resource_class, traits):\n    return any(trait == resource_class for trait in traits)\n", "entry_point": "check_allocation_mismatch", "input": "'CPU', ['CPU', 'GPU', 'RAM']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141020_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004510", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "2", "output": "'11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004511", "code": "import re\ndef extract_primary_keys(urlpatterns: dict) -> list:\n    primary_keys = []\n    pattern = r'\\(\\?<(\\w+)>\\d+\\)'\n    for url_pattern in urlpatterns.keys():\n        match = re.search(pattern, url_pattern)\n        if match:\n            primary_keys.append(match.group(1))\n    return primary_keys\n", "entry_point": "extract_primary_keys", "input": "{'/users/': None, '/products/': None, '/articles/': None}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100730_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004512", "code": "def organize_dependencies(dependencies):\n    dependency_dict = {}\n    for module, dependency in dependencies:\n        if module in dependency_dict:\n            dependency_dict[module].append(dependency)\n        else:\n            dependency_dict[module] = [dependency]\n    return dependency_dict\n", "entry_point": "organize_dependencies", "input": "[('a', 'b'), ('c', 'd'), ('e', 'f')]", "output": "{'a': ['b'], 'c': ['d'], 'e': ['f']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63465_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004513", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/foo/bar/../../c'", "output": "'/c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004514", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[5, 1, 7, 1, 5]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9009_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004515", "code": "def string_manipulation(input_string: str) -> str:\n    result = \"\"\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper() if char.islower() else char.lower()\n        elif char.isdigit():\n            result += '#'\n        else:\n            result += char\n    return result\n", "entry_point": "string_manipulation", "input": "'HeH'", "output": "'hEh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54131_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "189", "output": "{1, 3, 7, 9, 21, 27, 189, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004517", "code": "import re\nIDENTIFIED_COMMANDS = {\n    'NS STATUS %s': ['STATUS {username} (\\d)', '3'],\n    'PRIVMSG NickServ ACC %s': ['{username} ACC (\\d)', '3'],\n}\ndef parse_irc_command(command):\n    for irc_command, pattern_info in IDENTIFIED_COMMANDS.items():\n        pattern = pattern_info[0].replace('{username}', '(.+)')\n        expected_length = int(pattern_info[1])\n        match = re.match(pattern, command)\n        if match:\n            return expected_length\n    return -1\n", "entry_point": "parse_irc_command", "input": "'INVALID COMMAND'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115648_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004518", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 4, 2, 7, 4, 4, 3, 3]", "output": "[5, 6, 9, 11, 8, 7, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004519", "code": "from typing import List\ndef process_text(text: str) -> List[str]:\n    lines = []\n    buffer = \"\"\n    for i, char in enumerate(text):\n        if char == \"\\r\":\n            if i < len(text) - 1 and text[i + 1] == \"\\n\":\n                lines.append(buffer + \"\\n\")\n                buffer = \"\"\n            else:\n                lines.append(buffer + \"\\n\")\n                buffer = \"\"\n        elif char == \"\\n\":\n            lines.append(buffer + \"\\n\")\n            buffer = \"\"\n        else:\n            buffer += char\n    return lines\n", "entry_point": "process_text", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146667_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004520", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'ttathatiot'", "output": "'ttathatiot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004521", "code": "def remove_consecutive_duplicates(s: str) -> str:\n    results = []\n    for c in s:\n        if len(results) == 0 or results[-1] != c:\n            results.append(c)\n    return \"\".join(results)\n", "entry_point": "remove_consecutive_duplicates", "input": "'aabb'", "output": "'ab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101236_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2047", "output": "{89, 1, 23, 2047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004523", "code": "def maxProfit(prices):\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[1, 2, 5, 10, 3]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12353_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004524", "code": "def extract_message(data):\n    if isinstance(data, dict) and \"message\" in data:\n        return data[\"message\"]\n    elif isinstance(data, str) and \"message=\" in data:\n        message = data.split(\"message=\")[1]\n        return message\n    else:\n        return \"Hello World!\"\n", "entry_point": "extract_message", "input": "42", "output": "'Hello World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82781_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1826", "output": "{1, 1826, 2, 166, 11, 913, 83, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004526", "code": "def count_temperatures_in_range(temperatures, min_kelvin, max_kelvin):\n    count = 0\n    for temp in temperatures:\n        if min_kelvin <= temp <= max_kelvin:\n            count += 1\n    return count\n", "entry_point": "count_temperatures_in_range", "input": "[250, 300, 350], 300, 300", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141087_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004527", "code": "from typing import List\ndef find_target_index(collection: List[int], target: int) -> int:\n    left, right = 0, len(collection) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if collection[mid] == target:\n            return mid\n        elif collection[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return -1\n", "entry_point": "find_target_index", "input": "[1, 2, 3, 4, 5], 6", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29277_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004528", "code": "from typing import Dict\n# Define the number format constants\nFORMAT_GENERAL = 0\nFORMAT_DATE_XLSX14 = 1\nFORMAT_NUMBER_00 = 2\nFORMAT_DATE_TIME3 = 3\nFORMAT_PERCENTAGE_00 = 4\n# Dictionary mapping cell identifiers to number formats\ncell_formats: Dict[str, int] = {\n    'A1': FORMAT_GENERAL,\n    'A2': FORMAT_DATE_XLSX14,\n    'A3': FORMAT_NUMBER_00,\n    'A4': FORMAT_DATE_TIME3,\n    'A5': FORMAT_PERCENTAGE_00\n}\ndef check_number_format(cell: str, number_format: int) -> bool:\n    if cell in cell_formats:\n        return cell_formats[cell] == number_format\n    return False\n", "entry_point": "check_number_format", "input": "'B1', 0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131224_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004529", "code": "def extract_user_repos(urls):\n    user_repos = {}\n    for url in urls:\n        parts = url.split('/')\n        username = parts[3]\n        repo = parts[4]\n        if username in user_repos:\n            user_repos[username].append(repo)\n        else:\n            user_repos[username] = [repo]\n    return user_repos\n", "entry_point": "extract_user_repos", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92284_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004530", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3017", "output": "{1, 3017, 431, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004531", "code": "from typing import List\ndef extract_dataset_providers(env_var: str) -> List[str]:\n    if not env_var:\n        return []\n    return env_var.split(',')\n", "entry_point": "extract_dataset_providers", "input": "'ciroc'", "output": "['ciroc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18804_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004532", "code": "from typing import Dict, List\nimport ast\ndef extract_dependencies(noxfile_content: str) -> Dict[str, List[str]]:\n    dependencies = {}\n    nox_ast = ast.parse(noxfile_content)\n    for node in nox_ast.body:\n        if isinstance(node, ast.FunctionDef):\n            session_name = node.name\n            session_dependencies = []\n            for statement in node.body:\n                if isinstance(statement, ast.Expr) and isinstance(statement.value, ast.Call):\n                    if isinstance(statement.value.func, ast.Attribute) and statement.value.func.attr == 'install':\n                        session_dependencies.extend([arg.s for arg in statement.value.args])\n            dependencies[session_name] = session_dependencies\n    return dependencies\n", "entry_point": "extract_dependencies", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9602_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004533", "code": "def lengthOfLIS(nums):\n    if not nums:\n        return 0\n    sequence = [nums[0]]\n    def binarySearch(arr, target):\n        left, right = 0, len(arr) - 1\n        while left <= right:\n            mid = (left + right) // 2\n            if arr[mid] == target:\n                return mid\n            elif arr[mid] < target:\n                left = mid + 1\n            else:\n                right = mid - 1\n        return left\n    for num in nums[1:]:\n        if num < sequence[0]:\n            sequence[0] = num\n        elif num > sequence[-1]:\n            sequence.append(num)\n        else:\n            sequence[binarySearch(sequence, num)] = num\n    return len(sequence)\n", "entry_point": "lengthOfLIS", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74041_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004534", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48656c6c6f20726c6421'", "output": "b'Hello rld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004535", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[5, 7, 10, 14, 14, 20], 10", "output": "[10, 14, 14, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004536", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'EDDNA'", "output": "'ANDDE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004537", "code": "def process_object(object_name: str, object_category: str) -> tuple:\n    source_value = None\n    endpoint_url = None\n    if object_category == \"data_source\":\n        source_value = \"ds_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/ds_smart_status\"\n        object_category = \"data_name\"\n    elif object_category == \"data_host\":\n        source_value = \"dh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/dh_smart_status\"\n    elif object_category == \"metric_host\":\n        source_value = \"mh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/mh_smart_status\"\n    body = \"{'\" + object_category + \"': '\" + object_name + \"'}\"\n    return source_value, endpoint_url, body\n", "entry_point": "process_object", "input": "'exampeject', 'data_hos'", "output": "(None, None, \"{'data_hos': 'exampeject'}\")", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133706_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004538", "code": "def calculate_average_depth(depths):\n    total_depth = 0\n    count = 0\n    for depth in depths:\n        if depth >= 0:\n            total_depth += depth\n            count += 1\n    if count == 0:\n        return 0  # Handle case when there are no valid depths\n    average_depth = round(total_depth / count, 2)\n    return average_depth\n", "entry_point": "calculate_average_depth", "input": "[2.4]", "output": "2.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20373_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4054", "output": "{1, 2, 2027, 4054}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004540", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    camel_case = words[0] + ''.join(word.capitalize() for word in words[1:])\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'hetsti_a_a'", "output": "'hetstiAA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46573_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004541", "code": "import re\ndef extract_top_level_libraries(python_code):\n    import_regex = r'^import\\s+(\\w+)|^from\\s+(\\w+)'\n    imports = re.findall(import_regex, python_code, re.MULTILINE)\n    libraries = set()\n    for import_tuple in imports:\n        library = import_tuple[0] if import_tuple[0] else import_tuple[1]\n        if not library.startswith('.'):\n            libraries.add(library)\n    return list(libraries)\n", "entry_point": "extract_top_level_libraries", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117994_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004542", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "51, 20, 3", "output": "66.85499999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004543", "code": "def extract_top_module(module_path: str) -> str:\n    # Split the module_path string by dots\n    modules = module_path.split('.')\n    # Return the top-level module name\n    return modules[0]\n", "entry_point": "extract_top_module", "input": "'trsentry.some.module'", "output": "'trsentry'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40470_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004544", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[85, 87, 88, 90, 85]", "output": "87.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004545", "code": "def sum_validated_data(list_data_for_valid):\n    total_sum = 0\n    for data in list_data_for_valid:\n        try:\n            num = float(data)\n            total_sum += num\n        except ValueError:\n            total_sum += 0\n    return total_sum\n", "entry_point": "sum_validated_data", "input": "[20120406040.0]", "output": "20120406040.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19932_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004546", "code": "import re\ndef is_valid_email(email):\n    if email.count('@') != 1:\n        return False\n    local_part, domain_part = email.split('@')\n    if not (1 <= len(local_part) <= 64 and 1 <= len(domain_part) <= 255):\n        return False\n    if not re.match(r'^[a-zA-Z0-9._-]+$', local_part):\n        return False\n    if not re.match(r'^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$', domain_part):\n        return False\n    return True\n", "entry_point": "is_valid_email", "input": "'@example.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143618_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004547", "code": "def apply_replacements_iterated(axiom, rules, iterations):\n    result = axiom\n    for _ in range(iterations):\n        new_result = \"\"\n        for char in result:\n            new_result += rules.get(char, char)\n        result = new_result\n    return result\n", "entry_point": "apply_replacements_iterated", "input": "'A', {'A': 'AA'}, 1", "output": "'AA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78549_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004548", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'orbitrap', 'both'", "output": "{'tolerance': 0.005, 'mode': 'both'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004549", "code": "def generate_unique_table_name(existing_table_names):\n    numeric_suffixes = [int(name.split(\"_\")[-1]) for name in existing_table_names]\n    unique_suffix = 1\n    while unique_suffix in numeric_suffixes:\n        unique_suffix += 1\n    return f\"table_name_{unique_suffix}\"\n", "entry_point": "generate_unique_table_name", "input": "['table_name_1', 'table_name_2']", "output": "'table_name_3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94699_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004550", "code": "from typing import List\ndef longest_consecutive_subsequence_length(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] == nums[i - 1] + 1:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 1\n    return max_length\n", "entry_point": "longest_consecutive_subsequence_length", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48952_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004551", "code": "import re\ndef process_text(input_text):\n    transformations = [\n        (r', }}, ', '}}, '),\n        (r'}}, ', '}}, '),\n        (r'\", {\"', '}}, {\"'),\n        (r'\"}}, {\"', '}}, {\"'),\n        (r'\\n\\n', '\\n'),\n        (r'\\n', ''),\n        (r'}\\n(.+\\n(?!{))+(.+\\n(?={))*?', '}\\n'),\n        (r'[a-z_]+\\n{\\n}\\n', ''),\n        (r'(begin_new_match) ?\\n{ ?\\n} ?', r'\\1\\n{\\n \\1: \\1\\n}'),\n        (r':  ', ': \"None\"')\n    ]\n    processed_text = input_text\n    for pattern, replacement in transformations:\n        processed_text = re.sub(pattern, replacement, processed_text)\n    return processed_text\n", "entry_point": "process_text", "input": "'Anothertext,\\n'", "output": "'Anothertext,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109568_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2896", "output": "{1, 2, 4, 1448, 8, 362, 2896, 16, 724, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2895", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004553", "code": "from typing import List\ndef isWordGuessed(secretWord: str, lettersGuessed: List[str]) -> bool:\n    isAinB = [char in lettersGuessed for char in secretWord]\n    return all(isAinB)\n", "entry_point": "isWordGuessed", "input": "'abc', ['a']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004554", "code": "def count_vowels(txt):\n    vowels = 'aeiou'\n    txt_lower = txt.lower()\n    return sum(1 for t in txt_lower if t in vowels)\n", "entry_point": "count_vowels", "input": "'ai'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37224_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004555", "code": "def calculate_total_epochs(batch_size, last_epoch, min_unit):\n    if last_epoch < min_unit:\n        return min_unit\n    else:\n        return last_epoch + min_unit\n", "entry_point": "calculate_total_epochs", "input": "32, 7, 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134381_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004556", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'useuserr@eo any_value'", "output": "{'useuserr@eo': 'N/A'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004557", "code": "from typing import List\ndef maxFruits(tree: List[int]) -> int:\n    if not tree or len(tree) == 0:\n        return 0\n    left = 0\n    ans = 0\n    baskets = {}\n    for t, fruit in enumerate(tree):\n        baskets[fruit] = t\n        if len(baskets) > 2:\n            left = min(baskets.values())\n            del baskets[tree[left]]\n            left += 1\n        ans = max(ans, t - left + 1)\n    return ans\n", "entry_point": "maxFruits", "input": "[1, 2, 1, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77640_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004558", "code": "from typing import List, Dict\ndef get_tags(tags: List[Dict[str, str]]) -> List[str]:\n    tag_list = [tag[\"name\"] for tag in tags]\n    return tag_list\n", "entry_point": "get_tags", "input": "[{'name': 'bird'}]", "output": "['bird']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87975_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004559", "code": "import heapq\ndef first_n_smallest(lst, n):\n    heap = [(val, idx) for idx, val in enumerate(lst)]\n    heapq.heapify(heap)\n    result = [heapq.heappop(heap) for _ in range(n)]\n    result.sort(key=lambda x: x[1])  # Sort based on original indices\n    return [val for val, _ in result]\n", "entry_point": "first_n_smallest", "input": "[1, 2, 3, 4], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105636_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004560", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'configuration he'", "output": "'he configuration'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004561", "code": "from typing import List\ndef can_cross_stones(stones: List[int]) -> bool:\n    n = len(stones)\n    dp = [[False] * (n + 1) for _ in range(n)]\n    dp[0][0] = True\n    for i in range(1, n):\n        for j in range(i):\n            k = stones[i] - stones[j]\n            if k > n:\n                continue\n            for x in (k - 1, k, k + 1):\n                if 0 <= x <= n:\n                    dp[i][k] |= dp[j][x]\n    return any(dp[-1])\n", "entry_point": "can_cross_stones", "input": "[0, 2, 5]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70312_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004562", "code": "def transcode_videos(videos, mapping):\n    transcoded_videos = {}\n    for video in videos:\n        original_format = video['format']\n        transcoded_format = mapping.get(original_format, original_format)\n        transcoded_videos[video['name']] = transcoded_format\n    return transcoded_videos\n", "entry_point": "transcode_videos", "input": "[], {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6373_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004563", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    total_count = len(scores)\n    average = round(total_sum / total_count)\n    return average\n", "entry_point": "calculate_average", "input": "[84, 84, 84, 84, 84]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87310_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004564", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "8", "output": "'8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004565", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "6", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004566", "code": "from typing import List\ndef count_students_above_threshold(scores: List[int], threshold: int) -> int:\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[50, 60, 70, 75, 80, 85, 90, 95, 100, 101, 110], 100", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122205_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004567", "code": "def count_action_types(actions):\n    action_counts = {}\n    for action in actions:\n        action_type = action.get(\"type\")\n        if action_type in action_counts:\n            action_counts[action_type] += 1\n        else:\n            action_counts[action_type] = 1\n    return action_counts\n", "entry_point": "count_action_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110496_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004568", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    nums.sort()\n    n = len(nums)\n    return max(nums[n-1] * nums[n-2] * nums[n-3], nums[0] * nums[1] * nums[n-1])\n", "entry_point": "max_product_of_three", "input": "[-1, -1, 343]", "output": "343", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112128_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004569", "code": "from typing import List\nimport logging\ndef process_cookies(cookie_indices: List[int]) -> List[int]:\n    valid_cookies_index = [index for index in cookie_indices if index % 2 == 0 and index % 3 == 0]\n    logging.info('Checking the cookie for validity is over.')\n    return valid_cookies_index\n", "entry_point": "process_cookies", "input": "[1, 3, 5]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99711_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004570", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'ASPPH', 7", "output": "'HZWWO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004571", "code": "def find_next_square(sq: int) -> int:\n    \"\"\"\n    Finds the next perfect square after the given number.\n    Args:\n    sq: An integer representing the input number.\n    Returns:\n    An integer representing the next perfect square if the input is a perfect square, otherwise -1.\n    \"\"\"\n    sqrt_of_sq = sq ** 0.5\n    return int((sqrt_of_sq + 1) ** 2) if sqrt_of_sq.is_integer() else -1\n", "entry_point": "find_next_square", "input": "121", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35410_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004572", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[5, 9, 10, 2, 3, 7, 2, 8, 7], 4", "output": "[[5, 9, 10, 2], [3, 7, 2, 8], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004573", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(1, 4, -1, 6, 3, 3, -1, 0, 6)", "output": "(6, 4, -1, 6, 3, 3, -1, 0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004574", "code": "import ast\ndef extract_view_classes(code_snippet):\n    view_classes = []\n    # Parse the code snippet as an abstract syntax tree\n    tree = ast.parse(code_snippet)\n    # Traverse the abstract syntax tree to find import statements\n    for node in ast.walk(tree):\n        if isinstance(node, ast.ImportFrom) and node.module == 'views':\n            for alias in node.names:\n                view_classes.append(alias.name)\n    return view_classes\n", "entry_point": "extract_view_classes", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61132_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9362", "output": "{1, 2, 4681, 302, 9362, 151, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004576", "code": "from urllib.parse import parse_qs, urlparse\ndef parse_query_params(url: str) -> dict:\n    parsed_url = urlparse(url)\n    query_params = parse_qs(parsed_url.query)\n    parsed_query_params = {}\n    for key, value in query_params.items():\n        if len(value) == 1:\n            parsed_query_params[key] = value[0]\n        else:\n            parsed_query_params[key] = value\n    return parsed_query_params\n", "entry_point": "parse_query_params", "input": "'http://example.com/'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100438_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004577", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'hgggv'", "output": "'sttte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004578", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 9, 12, 15]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79978_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4105", "output": "{1, 821, 5, 4105}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4104", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004580", "code": "def first_last6(nums):\n    return nums[0] == 6 or nums[-1] == 6\n", "entry_point": "first_last6", "input": "[1, 2, 3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103111_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004581", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2749", "output": "{1, 2749}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004582", "code": "def extract_group_ids(groups):\n    group_ids = set()\n    for group in groups:\n        group_id = ''\n        for char in group:\n            if char.isdigit():\n                group_id += char\n            else:\n                break\n        if group_id:\n            group_ids.add(int(group_id))\n    return sorted(list(group_ids))\n", "entry_point": "extract_group_ids", "input": "['abc', 'def', 'ghi']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58489_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004583", "code": "from typing import Any\ndef is_bool(value: Any) -> bool:\n    return type(value) is bool\n", "entry_point": "is_bool", "input": "0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31009_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004584", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "78, 'addc_columaddts.py'", "output": "'78_addc_columaddts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004585", "code": "from numbers import Integral\ndef is_lone_coo(where):\n    \"\"\"Check if ``where`` has been specified as a single coordinate triplet.\"\"\"\n    return len(where) == 3 and isinstance(where[0], Integral)\n", "entry_point": "is_lone_coo", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106857_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004586", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[3, 2, 4, -3, 2]", "output": "[-1, 2, -7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004587", "code": "def group_files_by_extension(file_paths):\n    file_paths_by_extension = {}\n    for file_path in file_paths:\n        file_name, file_extension = file_path.rsplit('.', 1)\n        file_extension = file_extension.lower()\n        if file_extension in file_paths_by_extension:\n            file_paths_by_extension[file_extension].append(file_path)\n        else:\n            file_paths_by_extension[file_extension] = [file_path]\n    return file_paths_by_extension\n", "entry_point": "group_files_by_extension", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9510_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004588", "code": "def generate_fibonacci(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci", "input": "13", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60700_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004589", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "677", "output": "{1, 677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4058", "output": "{1, 4058, 2, 2029}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4057", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004591", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'name=Dima=er;age=28'", "output": "{'name': 'Dima=er', 'age': '28'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004592", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[10, 13, 23]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004593", "code": "import ast\ndef extract_routes(file_content):\n    routes = {}\n    tree = ast.parse(file_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            for decorator in node.decorator_list:\n                if isinstance(decorator, ast.Call) and isinstance(decorator.func, ast.Attribute):\n                    if decorator.func.attr == 'route' and isinstance(decorator.func.value, ast.Attribute):\n                        blueprint_name = decorator.func.value.attr\n                        route_path = decorator.args[0].s\n                        for stmt in node.body:\n                            if isinstance(stmt, ast.Return) and isinstance(stmt.value, ast.Call):\n                                if isinstance(stmt.value.func, ast.Name) and stmt.value.func.id == 'render_template':\n                                    title = stmt.value.keywords[0].value.s\n                                    routes[route_path] = title\n    return routes\n", "entry_point": "extract_routes", "input": "\"def no_route():\\n    return 'Hello World'\"", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54988_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004594", "code": "def find_second_largest(nums):\n    largest = second_largest = float('-inf')\n    for num in nums:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num > second_largest and num != largest:\n            second_largest = num\n    return second_largest\n", "entry_point": "find_second_largest", "input": "[10, 9, 7, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53647_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004595", "code": "import base64\ndef modified_unbase64(s):\n    s_utf7 = '+' + s.replace(',', '/') + '-'\n    original_bytes = s_utf7.encode('utf-7')\n    original_string = original_bytes.decode('utf-7')\n    return original_string\n", "entry_point": "modified_unbase64", "input": "'SGVsbG8sIFdvIQ=='", "output": "'+SGVsbG8sIFdvIQ==-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65108_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004596", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "7", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004597", "code": "import math\ndef calculate_nequat_nvert(n: int) -> tuple:\n    nequat = int(math.sqrt(math.pi * n))\n    nvert = nequat // 2\n    return nequat, nvert\n", "entry_point": "calculate_nequat_nvert", "input": "12", "output": "(6, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142533_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004598", "code": "SEP_MAP = {\"xls\": \"\\t\", \"XLS\": \"\\t\", \"CSV\": \",\", \"csv\": \",\", \"xlsx\": \"\\t\", \"XLSX\": \"\\t\"}\ndef get_separator(file_extension):\n    return SEP_MAP.get(file_extension, \"Unknown\")\n", "entry_point": "get_separator", "input": "'xls'", "output": "'\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45466_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004599", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'kaluku'", "output": "['kaluku']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004600", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        circular_sum = input_list[i] + input_list[(i + 1) % list_length]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 5, 4, 2, 6]", "output": "[10, 9, 6, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117423_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7589", "output": "{1, 7589}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004602", "code": "def count_differing_characters(revision1, revision2):\n    if len(revision1) != len(revision2):\n        return -1  # Return -1 if the lengths of the revision numbers are not equal\n    differing_count = 0\n    for char1, char2 in zip(revision1, revision2):\n        if char1 != char2:\n            differing_count += 1\n    return differing_count\n", "entry_point": "count_differing_characters", "input": "'AAAAAAAAAA', 'BBBBBBBBBB'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76189_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004603", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/path/to/example.txt'", "output": "'example.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004604", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'sammple'", "output": "'sammple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004605", "code": "def moving_average(nums, window_size):\n    moving_averages = []\n    window_sum = sum(nums[:window_size])\n    for i in range(window_size, len(nums)+1):\n        moving_averages.append(window_sum / window_size)\n        if i < len(nums):\n            window_sum = window_sum - nums[i - window_size] + nums[i]\n    return moving_averages\n", "entry_point": "moving_average", "input": "[0, 153.6, 57.6], 2", "output": "[76.8, 105.6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16719_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004606", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'examplehello he exaple'", "output": "['examplehello', 'he', 'exaple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004607", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[6, 9, 17, 2, 8, 6, 6, 6]", "output": "[2, 6, 6, 6, 6, 8, 9, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004608", "code": "from typing import List\ndef sum_of_evens(lst: List[int]) -> int:\n    sum_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_evens += num\n    return sum_evens\n", "entry_point": "sum_of_evens", "input": "[6, 6]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134018_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004609", "code": "def check_keys_in_cache(connection, cache, keys, binary=False, query_id=None):\n    # Establish connection to Ignite server (Assuming connection establishment logic is provided elsewhere)\n    # Placeholder for actual logic to check keys in cache\n    all_keys_present = True  # Placeholder value\n    # Return result data object\n    result = {\n        'status': 0,  # Zero status indicates success\n        'value': all_keys_present\n    }\n    return result\n", "entry_point": "check_keys_in_cache", "input": "None, None, ['key1', 'key2']", "output": "{'status': 0, 'value': True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3917_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004610", "code": "def word_pattern(pattern: str, input_str: str) -> bool:\n    words = input_str.split()\n    if len(pattern) != len(words):\n        return False\n    pattern_map = {}\n    seen_words = set()\n    for char, word in zip(pattern, words):\n        if char not in pattern_map:\n            if word in seen_words:\n                return False\n            pattern_map[char] = word\n            seen_words.add(word)\n        else:\n            if pattern_map[char] != word:\n                return False\n    return True\n", "entry_point": "word_pattern", "input": "'abba', 'dog cat'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40478_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004611", "code": "def fill_matrix(s):\n    n = int((len(s) + 2) ** 0.5)  # Calculate the size of the square matrix\n    matrix = [['_' for _ in range(n)] for _ in range(n)]  # Initialize the square matrix\n    directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]  # Right, Down, Left, Up\n    direction_index = 0\n    row, col = 0, 0\n    for char in s:\n        matrix[row][col] = char\n        next_row, next_col = row + directions[direction_index][0], col + directions[direction_index][1]\n        if 0 <= next_row < n and 0 <= next_col < n and matrix[next_row][next_col] == '_':\n            row, col = next_row, next_col\n        else:\n            direction_index = (direction_index + 1) % 4\n            row, col = row + directions[direction_index][0], col + directions[direction_index][1]\n    return matrix\n", "entry_point": "fill_matrix", "input": "'as'", "output": "[['a', 's'], ['_', '_']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1644_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004612", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4124", "output": "{1, 2, 4, 1031, 2062, 4124}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4123", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004613", "code": "import re\ndef extract_urls_and_emails(text):\n    protocol = u\"(?:http|ftp|news|nntp|telnet|gopher|wais|file|prospero)\"\n    mailto = u\"mailto\"\n    url_body = u\"\\S+[0-9A-Za-z/]\"\n    url = u\"<?(?:{0}://|{1}:|www\\.){2}>?\".format(protocol, mailto, url_body)\n    url_re = re.compile(url, re.I)\n    localpart_border = u\"[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~]\"\n    localpart_inside = u\"[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~.]\"\n    localpart = u\"{0}{1}*\".format(localpart_border, localpart_inside)\n    subdomain_start = u\"[A-Za-z]\"\n    subdomain_inside = u\"[A-Za-z0-9\\\\-]\"\n    subdomain_end = u\"[A-Za-z0-9]\"\n    subdomain = u\"{0}{1}*{2}\".format(subdomain_start, subdomain_inside, subdomain_end)\n    domain = u\"{0}(?:\\\\.{1})*\".format(subdomain, subdomain)\n    email_str = u\"{0}@{1}\".format(localpart, domain)\n    email_re = re.compile(email_str)\n    urls = url_re.findall(text)\n    emails = email_re.findall(text)\n    return urls + emails\n", "entry_point": "extract_urls_and_emails", "input": "'Hello, this is a test message without any contact information!'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34293_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004614", "code": "def calculate_diff(string1, string2):\n    if len(string1) != len(string2):\n        return \"Strings are of different length\"\n    diff_count = 0\n    for i in range(len(string1)):\n        if string1[i] != string2[i]:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_diff", "input": "'abcde', 'axyze'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98507_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004615", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[1, 3, 4, 5]", "output": "([1, 3, 4, 5], 13)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004616", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "31", "output": "31.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004617", "code": "import os\ndef delete_file(file_path):\n    try:\n        if os.path.exists(file_path):\n            os.remove(file_path)\n            return 'Deleted'\n        else:\n            return 'File can not be found.'\n    except Exception as e:\n        return str(e)\n", "entry_point": "delete_file", "input": "'/path/to/nonexistent/file.txt'", "output": "'File can not be found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27330_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004618", "code": "def prime_sum(limit: int) -> int:\n    def sieve_of_eratosthenes(n):\n        primes = [True] * (n + 1)\n        primes[0] = primes[1] = False\n        p = 2\n        while p * p <= n:\n            if primes[p]:\n                for i in range(p * p, n + 1, p):\n                    primes[i] = False\n            p += 1\n        return [i for i in range(2, n) if primes[i]]\n    primes_below_limit = sieve_of_eratosthenes(limit)\n    return sum(primes_below_limit)\n", "entry_point": "prime_sum", "input": "10", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76811_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004619", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'ab'", "output": "['ab', 'ba']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004620", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'7'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004621", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[6, 5, 3, 4, 3, 6, 4, 6]", "output": "[3, 3, 4, 4, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004622", "code": "def evaluate_expression(expression):\n    expression = expression.replace('^', '**')  # Replace '^' with '**' for exponentiation\n    try:\n        result = eval(expression)  # Evaluate the expression\n        return result\n    except Exception as e:\n        return f\"Error: {e}\"  # Return an error message if evaluation fails\n", "entry_point": "evaluate_expression", "input": "'3^2'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72501_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004623", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'exampleexam:80'", "output": "('http', 'exampleexam', 80)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004624", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004625", "code": "# Define a dictionary to store account information\ndatabase = {\n    ('1234', '56789'): {'name': 'John Doe', 'balance': 5000},\n    ('5678', '12345'): {'name': 'Jane Smith', 'balance': 8000}\n}\n# Function to search for account details\ndef buscar_contas(agencia, num_conta):\n    account_key = (agencia, num_conta)\n    if account_key in database:\n        return database[account_key]\n    else:\n        return \"Account not found.\"\n", "entry_point": "buscar_contas", "input": "'1234', '56789'", "output": "{'name': 'John Doe', 'balance': 5000}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125941_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4313", "output": "{1, 19, 4313, 227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004627", "code": "from typing import List\ndef find_sum_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_val = min_val = nums[0]\n    for num in nums[1:]:\n        if num > max_val:\n            max_val = num\n        elif num < min_val:\n            min_val = num\n    return max_val + min_val\n", "entry_point": "find_sum_of_max_min", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16636_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004628", "code": "def calculate_mean_metrics(times, test_scores):\n    mean_time = sum(times) / len(times) if times else 0\n    mean_accuracy = sum(test_scores) / len(test_scores) if test_scores else 0\n    return mean_time, mean_accuracy\n", "entry_point": "calculate_mean_metrics", "input": "[], [93.55555555555556] * 9", "output": "(0, 93.55555555555556)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137268_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "387", "output": "{1, 129, 3, 387, 9, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004630", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(targets=['result'], expr=8)", "output": "'result = 8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004631", "code": "import re\nfrom ctypes import CFUNCTYPE\ndef process_glfw_header(header_content):\n    # Placeholder content for testing\n    header_content = \"Sample GLFW header file content\"\n    # Normalize whitespace\n    header_content = re.sub(r\"[ \\t]+\", \" \", header_content)\n    # Simulate the operations mentioned in the script snippet\n    return header_content\n", "entry_point": "process_glfw_header", "input": "'Any input here'", "output": "'Sample GLFW header file content'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43269_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004632", "code": "from typing import List\ndef sum_of_even_numbers(nums: List[int]) -> int:\n    sum_even = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105255_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004633", "code": "def largest_prime_factor(number):\n    factor = 2\n    while factor ** 2 <= number:\n        if number % factor == 0:\n            number //= factor\n        else:\n            factor += 1\n    return max(factor, number)\n", "entry_point": "largest_prime_factor", "input": "167", "output": "167", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80074_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2113", "output": "{2113, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004635", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[1, 0], [0, 1]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1145_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004636", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[1, 1, 2, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6724", "output": "{1, 3362, 2, 6724, 4, 164, 41, 1681, 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6723", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004638", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6785", "output": "{1, 6785, 5, 295, 1357, 115, 23, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004639", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, -3, 3, 2, 3, 4, 3, 0]", "output": "[-3, 0, 5, 5, 7, 7, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004640", "code": "def calculate_median(data):\n    sorted_data = sorted(data)\n    n = len(sorted_data)\n    if n % 2 == 1:\n        return sorted_data[n // 2]\n    else:\n        mid1 = sorted_data[n // 2 - 1]\n        mid2 = sorted_data[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[6, 8]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16083_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004641", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[2, 6, 2, 4, 5, 4, 2, -2]", "output": "[4, 36, 4, 16, 125, 16, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004642", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1948", "output": "{1, 2, 4, 487, 974, 1948}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1947", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1491", "output": "{1, 3, 7, 71, 497, 1491, 213, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004644", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4603", "output": "{1, 4603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004645", "code": "def get_algorithm_config(config_name):\n    default_config = {'mode': 'default'}\n    config_mapping = {\n        'videoonenet': {'mode': 'videoonenet', 'rho': 0.3},\n        'videoonenetadmm': {'mode': 'videoonenetadmm', 'rho': 0.3},\n        'videowaveletsparsityadmm': {'mode': 'videowaveletsparsityadmm', 'rho': 0.3, 'lambda_l1': 0.05},\n        'rnn': {'rnn': True},\n        'nornn': {'rnn': False}\n    }\n    return config_mapping.get(config_name, default_config)\n", "entry_point": "get_algorithm_config", "input": "'videoonenet'", "output": "{'mode': 'videoonenet', 'rho': 0.3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36133_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004646", "code": "def is_happy_number(n):\n    seen = {}\n    while True:\n        if n in seen:\n            return False\n        counter = 0\n        for i in range(len(str(n))):\n            counter += int(str(n)[i]) ** 2\n        seen[n] = 1\n        n = counter\n        counter = 0\n        if n == 1:\n            return True\n", "entry_point": "is_happy_number", "input": "1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52206_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004647", "code": "def calculate_weighted_average(values, weights):\n    if len(values) != len(weights):\n        raise ValueError(\"Values and weights lists must have the same length.\")\n    weighted_sum = sum(value * weight for value, weight in zip(values, weights))\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[10, 20, 30], [2, 3, 2]", "output": "140", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65743_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004648", "code": "import re\nfrom typing import Tuple, Optional\nIE_DESC = 'Redgifs user'\n_VALID_URL = r'https?://(?:www\\.)?redgifs\\.com/users/(?P<username>[^/?#]+)(?:\\?(?P<query>[^#]+))?'\n_PAGE_SIZE = 30\ndef process_redgifs_url(url: str) -> Tuple[str, Optional[str], int]:\n    match = re.match(_VALID_URL, url)\n    if match:\n        username = match.group('username')\n        query = match.group('query')\n        return username, query, _PAGE_SIZE\n    return '', None, _PAGE_SIZE\n", "entry_point": "process_redgifs_url", "input": "'https://www.example.com/users/username'", "output": "('', None, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56955_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004649", "code": "def extract_major_minor_version(version_string):\n    # Split the version string by the dot ('.') character\n    version_parts = version_string.split('.')\n    # Extract the major version\n    major_version = int(version_parts[0])\n    # Extract the minor version by removing non-numeric characters\n    minor_version = ''.join(filter(str.isdigit, version_parts[1]))\n    # Convert the major and minor version parts to integers\n    minor_version = int(minor_version)\n    # Return a tuple containing the major and minor version numbers\n    return major_version, minor_version\n", "entry_point": "extract_major_minor_version", "input": "'3.143'", "output": "(3, 143)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141202_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004650", "code": "def isLatestVersion(currentVersion, latestVersion):\n    current_versions = list(map(int, currentVersion.split('.')))\n    latest_versions = list(map(int, latestVersion.split('.')))\n    for cur_ver, lat_ver in zip(current_versions, latest_versions):\n        if cur_ver < lat_ver:\n            return False\n        elif cur_ver > lat_ver:\n            return True\n    return True\n", "entry_point": "isLatestVersion", "input": "'1.0.0', '1.0.0'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10898_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004651", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "200, 10, 20", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004652", "code": "DEBUG = True\nADMINS = frozenset([\n    \"<EMAIL>\"\n])\ndef check_admin(email):\n    if not DEBUG:\n        return False\n    return email in ADMINS\n", "entry_point": "check_admin", "input": "'random@example.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96686_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004653", "code": "def text_transformation(text: str) -> str:\n    # Convert to lowercase, replace \"deprecated\" with \"obsolete\", strip whitespaces, and reverse the string\n    transformed_text = text.lower().replace(\"deprecated\", \"obsolete\").strip()[::-1]\n    return transformed_text\n", "entry_point": "text_transformation", "input": "'    deprecated   '", "output": "'etelosbo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19675_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004654", "code": "def calculate_max_vertical_deviation(image_dims, ground_truth_horizon, detected_horizon):\n    width, height = image_dims\n    def gt(x):\n        return ground_truth_horizon[0] * x + ground_truth_horizon[1]\n    def dt(x):\n        return detected_horizon[0] * x + detected_horizon[1]\n    if ground_truth_horizon is None or detected_horizon is None:\n        return None\n    max_deviation = max(abs(gt(0) - dt(0)), abs(gt(width) - dt(width)))\n    normalized_deviation = max_deviation / height\n    return normalized_deviation\n", "entry_point": "calculate_max_vertical_deviation", "input": "(1, 1), (0, 0), (0, 0.1962962962962963)", "output": "0.1962962962962963", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_623_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004655", "code": "import ast\ndef extract_functions_and_classes(module_code):\n    module_ast = ast.parse(module_code)\n    functions = []\n    classes = []\n    for node in ast.walk(module_ast):\n        if isinstance(node, ast.FunctionDef):\n            functions.append(node.name)\n        elif isinstance(node, ast.ClassDef):\n            classes.append(node.name)\n    return functions, classes\n", "entry_point": "extract_functions_and_classes", "input": "''", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53175_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004656", "code": "def sum_divisible_by_3_and_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114364_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004657", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "5, 4, '+'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004658", "code": "from functools import reduce\nfrom operator import add\ndef calculate_sum(int_list):\n    # Using reduce with the add operator to calculate the sum\n    total_sum = reduce(add, int_list)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004659", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[4, 5, 7, 4, 1, 5, 1]", "output": "[4, 6, 9, 7, 5, 10, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6738", "output": "{1, 2, 3, 1123, 2246, 6, 3369, 6738}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004661", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004662", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'very_long_ds_the_limit'", "output": "'very_long_ds_the_limit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4363", "output": "{1, 4363}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4362", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004664", "code": "def count_e_letters(input_string):\n    count = 0\n    lowercase_input = input_string.lower()\n    for char in lowercase_input:\n        if char == 'e' or char == '\u00e9':\n            count += 1\n    return count\n", "entry_point": "count_e_letters", "input": "'e\u00e9\u00e9'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15839_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004665", "code": "# Define the set of allowed file extensions\nALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])\ndef allowed_file(filename):\n    if '.' in filename:\n        # Split the filename to get the extension\n        extension = filename.rsplit('.', 1)[1].lower()\n        # Check if the extension is in the allowed extensions set\n        return extension in ALLOWED_EXTENSIONS\n    return False\n", "entry_point": "allowed_file", "input": "'testfile.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50839_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004666", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[2, 7, 3, 8, 7, 3, 3, 2, 6]", "output": "[2, 8, 5, 11, 11, 8, 9, 9, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004667", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4447", "output": "{1, 4447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004668", "code": "def process_genetic_data(line):\n    def int_no_zero(s):\n        return int(s.lstrip('0')) if s.lstrip('0') else 0\n    indiv_name, marker_line = line.split(',')\n    markers = marker_line.replace('\\t', ' ').split(' ')\n    markers = [marker for marker in markers if marker != '']\n    if len(markers[0]) in [2, 4]:  # 2 digits per allele\n        marker_len = 2\n    else:\n        marker_len = 3\n    try:\n        allele_list = [(int_no_zero(marker[0:marker_len]), int_no_zero(marker[marker_len:]))\n                       for marker in markers]\n    except ValueError:  # Haploid\n        allele_list = [(int_no_zero(marker[0:marker_len]),)\n                       for marker in markers]\n    return indiv_name, allele_list, marker_len\n", "entry_point": "process_genetic_data", "input": "'Alice, 01 23 45 67'", "output": "('Alice', [(1, 0), (23, 0), (45, 0), (67, 0)], 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138215_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004669", "code": "from typing import List\ndef best_sum(target_sum: int, numbers: List[int]) -> List[int]:\n    table = [None] * (target_sum + 1)\n    table[0] = []\n    for i in range(target_sum + 1):\n        if table[i] is not None:\n            for num in numbers:\n                if i + num <= target_sum:\n                    if table[i + num] is None or len(table[i] + [num]) < len(table[i + num]):\n                        table[i + num] = table[i] + [num]\n    return table[target_sum]\n", "entry_point": "best_sum", "input": "10, [5]", "output": "[5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127929_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004670", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'I&#3co'", "output": "'I&#3co'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004671", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3009", "output": "{1, 3009, 3, 1003, 17, 177, 51, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3008", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004672", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[160, 165, 170, 166, 167]", "output": "166", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1022", "output": "{1, 2, 7, 73, 14, 146, 1022, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1021", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004674", "code": "def calculate_average(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_scores = sum(scores) - min_score\n    num_scores = len(scores) - 1\n    average = sum_scores / num_scores if num_scores > 0 else 0\n    return average\n", "entry_point": "calculate_average", "input": "[90, 90, 80, 88]", "output": "89.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101810_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004675", "code": "def sum_fibonacci(N):\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    a, b = 0, 1\n    fib_sum = a + b\n    for _ in range(2, N):\n        a, b = b, a + b\n        fib_sum += b\n    return fib_sum\n", "entry_point": "sum_fibonacci", "input": "9", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126922_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004676", "code": "from typing import List, Dict\ndef count_firewall_rules_by_direction(rules: List[Dict[str, str]]) -> Dict[str, int]:\n    rule_count = {'inbound': 0, 'outbound': 0}\n    for rule in rules:\n        direction = rule.get('direction')\n        if direction == 'inbound':\n            rule_count['inbound'] += 1\n        elif direction == 'outbound':\n            rule_count['outbound'] += 1\n    return rule_count\n", "entry_point": "count_firewall_rules_by_direction", "input": "[]", "output": "{'inbound': 0, 'outbound': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82611_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004677", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[3, 4, 5]", "output": "{3: 180, 4: 360, 5: 540}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004678", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "8", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004679", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[7, 14, 17, 13, 17, 4, 19, 13]", "output": "[21, 31, 30, 30, 21, 23, 32, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004680", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[4, 4, 5, 5, 3, 4, 4]", "output": "[16, 16, 25, 25, 9, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004681", "code": "def count_divisible_pairs(n):\n    count = 0\n    for a in range(n):\n        for b in range(a+1, n):\n            if (a + b) % n == 0:\n                count += 1\n    return count\n", "entry_point": "count_divisible_pairs", "input": "5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30636_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004682", "code": "default_build_pattern = \"(bEXP_ARCH1|bSeriesTOC)\"\ndefault_process_pattern = \"(bKBD3|bSeriesTOC)\"\noptions = None\nSRC_CODES_TO_INCLUDE_PARAS = [\"GW\", \"SE\"]\nDATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE = [\"IPL\", \"ZBK\", \"NLP\", \"SE\", \"GW\"]\ndef process_source_code(source_code):\n    include_paragraphs = source_code in SRC_CODES_TO_INCLUDE_PARAS\n    create_update_notification = source_code not in DATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE\n    return include_paragraphs, create_update_notification\n", "entry_point": "process_source_code", "input": "'XYZ'", "output": "(False, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46779_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004683", "code": "def extract_author_name(code_snippet):\n    lines = code_snippet.split('\\n')  # Split the code snippet into lines\n    for line in lines:\n        if '__author__' in line:\n            author_name = line.split('=')[-1].strip().strip(\"'\")\n            return author_name\n", "entry_point": "extract_author_name", "input": "\"__author__ = 'John Doe'\\nprint('Hello World')\"", "output": "'John Doe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48355_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004684", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "2.4", "output": "2399999999999999911", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004685", "code": "def convert_to_short_prefix(long_variable_name):\n    mappings = {\n        \"SHORT_NEW_TABLE_PREFIX\": \"n!\",\n        \"SHORT_DELTA_TABLE_PREFIX\": \"c!\",\n        \"SHORT_RENAMED_TABLE_PREFIX\": \"o!\",\n        \"SHORT_INSERT_TRIGGER_PREFIX\": \"i!\",\n        \"SHORT_UPDATE_TRIGGER_PREFIX\": \"u!\",\n        \"SHORT_DELETE_TRIGGER_PREFIX\": \"d!\",\n        \"OSC_LOCK_NAME\": \"OnlineSchemaChange\"\n    }\n    return mappings.get(long_variable_name, \"Unknown\")\n", "entry_point": "convert_to_short_prefix", "input": "'SOME_UNKNOWN_PREFIX'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139316_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004686", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1065", "output": "{1, 355, 3, 5, 71, 1065, 15, 213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004687", "code": "def classify_triangle(r1: int, r2: int, r3: int) -> str:\n    if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:\n        if r1 == r2 == r3:\n            return 'Equilateral'\n        elif r1 != r2 and r2 != r3 and r1 != r3:\n            return 'Scalene'\n        else:\n            return 'Isosceles'\n    else:\n        return 'Not a triangle'\n", "entry_point": "classify_triangle", "input": "3, 3, 3", "output": "'Equilateral'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83282_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004688", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[4, 1, 6, 1, 7, 4, 6, 4]", "output": "[1, 1, 4, 4, 4, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004689", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2098", "output": "{1, 2098, 2, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004690", "code": "from typing import List\ndef fast_moving_average(data: List[float], num_intervals: int) -> List[float]:\n    if len(data) < num_intervals:\n        return []\n    interval_size = len(data) // num_intervals\n    moving_avg = []\n    for i in range(num_intervals):\n        start = i * interval_size\n        end = start + interval_size if i < num_intervals - 1 else len(data)\n        interval_data = data[start:end]\n        avg = sum(interval_data) / len(interval_data) if interval_data else 0\n        moving_avg.append(avg)\n    return moving_avg\n", "entry_point": "fast_moving_average", "input": "[6.0, 6.5, 3.5, 5.0], 4", "output": "[6.0, 6.5, 3.5, 5.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98561_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6025", "output": "{1, 5, 6025, 241, 1205, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6024", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004692", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[1, 1, 1, 1, 2, 2, 0, 3, 4]", "output": "{1: 4, 2: 2, 0: 1, 3: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004693", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        if count + score_count[score] <= n:\n            top_scores.extend([score] * score_count[score])\n            count += score_count[score]\n        else:\n            remaining = n - count\n            top_scores.extend([score] * remaining)\n            break\n    return sum(top_scores) / n\n", "entry_point": "average_top_n_scores", "input": "[0, 0], 2", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13074_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004694", "code": "def find_longest_sequence(dice_rolls):\n    if not dice_rolls:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(dice_rolls)):\n        if dice_rolls[i] == dice_rolls[i - 1] + 1:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "find_longest_sequence", "input": "[3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10121_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004695", "code": "import os\ndef count_lines_in_python_files(directory):\n    file_line_counts = {}\n    for root, dirs, files in os.walk(directory):\n        for file in files:\n            if file.endswith('.py'):\n                file_path = os.path.join(root, file)\n                with open(file_path, 'r') as f:\n                    line_count = sum(1 for line in f)\n                file_name = os.path.relpath(file_path, directory)\n                file_line_counts[file_name] = line_count\n    return file_line_counts\n", "entry_point": "count_lines_in_python_files", "input": "'empty_directory/'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145553_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004696", "code": "import re\n# Define the regular expression patterns for each file format\n_regexes = {\n    'pdb.gz': re.compile(r'\\.pdb\\.gz$'),\n    'mmcif': re.compile(r'\\.mmcif$'),\n    'sdf': re.compile(r'\\.sdf$'),\n    'xyz': re.compile(r'\\.xyz$'),\n    'sharded': re.compile(r'\\.sharded$')\n}\ndef identify_file_format(file_name):\n    for format_key, pattern in _regexes.items():\n        if pattern.search(file_name):\n            return format_key\n    return \"Unknown Format\"\n", "entry_point": "identify_file_format", "input": "'file.txt'", "output": "'Unknown Format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24846_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004697", "code": "import os\nfrom typing import List\ndef list_subdirectories(directory: str) -> List[str]:\n    subdirectories = []\n    try:\n        entries = os.listdir(directory)\n    except OSError:\n        return subdirectories\n    for entry in entries:\n        full_path = os.path.join(directory, entry)\n        if os.path.isdir(full_path):\n            subdirectories.append(full_path)\n            subdirectories.extend(list_subdirectories(full_path))\n    return subdirectories\n", "entry_point": "list_subdirectories", "input": "'/path/to/nonexistent/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102778_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004698", "code": "import os\ndef process_cmake_file(full_path: str, name: str) -> bool:\n    cmake_parent = os.path.join(full_path, 'CMakeLists.txt')\n    if not os.path.isfile(cmake_parent):\n        print(\"Parent path is not a CMake directory. Skipping adding the new executable to the project.\")\n        return False\n    with open(cmake_parent, 'r') as handle:\n        content = handle.read().strip()\n    with open(cmake_parent, 'w') as handle:\n        handle.write(content + '\\nadd_subdirectory({})\\n'.format(name))\n    print(\"Successfully added '{}' to parent CMakeLists.txt\".format(name))\n    print('Successfully wrote project files.')\n    return True\n", "entry_point": "process_cmake_file", "input": "'/some/nonexistent/path', 'some_subdir'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88483_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004699", "code": "def autocomplete_results(autocomplete_type, query):\n    music_pieces = [\n        {\"name\": \"Tristan und Isolde\", \"composer\": \"Wagner\"},\n        {\"name\": \"Carmen\", \"composer\": \"Bizet\"},\n        {\"name\": \"La Boh\u00e8me\", \"composer\": \"Puccini\"},\n        {\"name\": \"Swan Lake\", \"composer\": \"Tchaikovsky\"}\n    ]\n    results = []\n    for piece in music_pieces:\n        if autocomplete_type == \"name\" and query.lower() in piece[\"name\"].lower():\n            results.append({\"label\": piece[\"name\"]})\n        elif autocomplete_type == \"composer\" and query.lower() in piece[\"composer\"].lower():\n            results.append({\"label\": piece[\"composer\"]})\n    return results\n", "entry_point": "autocomplete_results", "input": "'name', 'nonexistent'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133721_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004700", "code": "def next_greater_elements(x):\n    stack = []\n    solution = [None] * len(x)\n    for i in range(len(x)-1, -1, -1):\n        while stack and x[i] >= x[stack[-1]]:\n            stack.pop()\n        if stack:\n            solution[i] = stack[-1]\n        stack.append(i)\n    return solution\n", "entry_point": "next_greater_elements", "input": "[1, 1, 1, 3, 2, 2, 2]", "output": "[3, 3, 3, None, None, None, None]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72944_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004701", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "17, 29", "output": "[17, 19, 23, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8923", "output": "{1, 8923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004703", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[4, 4, 3]", "output": "(8, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004704", "code": "def search_rotated_array(nums, target):\n    l, r = 0, len(nums) - 1\n    while l <= r:\n        m = (l + r) // 2\n        if nums[m] == target:\n            return m\n        if nums[l] <= nums[m]:\n            if nums[l] <= target < nums[m]:\n                r = m - 1\n            else:\n                l = m + 1\n        else:\n            if nums[m] < target <= nums[r]:\n                l = m + 1\n            else:\n                r = m - 1\n    return -1\n", "entry_point": "search_rotated_array", "input": "[4, 5, 6, 7, 0, 1, 2], 10", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108772_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004705", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 3, 1, 2, 2, 3, 3, 2, 2]", "output": "[2, 4, 3, 5, 6, 8, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004706", "code": "def find_divisible_sum(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "find_divisible_sum", "input": "[15, 30, 75]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147524_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004707", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'7'", "output": "'8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004708", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004709", "code": "def extract_region_from_bucket_names(bucket_names):\n    bucket_region_map = {}\n    for bucket_name in bucket_names:\n        region = bucket_name.split(\"-\")[2]\n        bucket_region_map[bucket_name] = region\n    return bucket_region_map\n", "entry_point": "extract_region_from_bucket_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88324_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004710", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'Aalbert', 'Ifux'", "output": "'AAL_ifu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004711", "code": "def generate_pseudonym(name):\n    pseudonym_count = {}\n    # Split the name into words\n    words = name.split()\n    pseudonym = ''.join(word[0].upper() for word in words)\n    if pseudonym in pseudonym_count:\n        pseudonym_count[pseudonym] += 1\n    else:\n        pseudonym_count[pseudonym] = 1\n    count = pseudonym_count[pseudonym]\n    return (pseudonym + str(count), sum(pseudonym_count.values()))\n", "entry_point": "generate_pseudonym", "input": "'Alice Cooper'", "output": "('AC1', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11221_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3272", "output": "{1, 2, 1636, 4, 3272, 8, 818, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3271", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004713", "code": "INVALID = (None, 1, True)\nEMPTY = (tuple(), list(), dict(), \"\")\nSTRINGS = (('a', 'b'), ['a', 'b'], {'a': \"one\", 'b': \"two\"}, set(['a', 'b']), \"foo\")\nINTEGERS = ((0, 1, 2), [0, 1, 2], {0: 0, 1: 1, 2: 2}, set([0, 1, 2]))\nTRUTHY = ((1, True, 'foo'), [1, True, 'foo'], {'a': 1, 'b': True, 1: 'foo'}, set([1, True, 'foo']))\nFALSY = ((0, False, ''), [0, False, ''], {None: 0, '': False, 0: ''}, set([0, False, '']))\nNONMAP = (tuple(), list(), \"\")\ndef validate_iterable(input_iterable) -> bool:\n    categories = [EMPTY, STRINGS, INTEGERS, TRUTHY, FALSY, NONMAP]\n    for category in categories:\n        if input_iterable in category:\n            return True\n    return False\n", "entry_point": "validate_iterable", "input": "{'c': 3}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66433_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004714", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'docume.txt'", "output": "'docume_v1.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004715", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1808", "output": "{1, 2, 226, 4, 452, 904, 8, 1808, 16, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1807", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004716", "code": "def find(char, string):\n    for c in string:\n        if c == char:\n            return True\n    return False\n", "entry_point": "find", "input": "'a', 'apple'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141417_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004717", "code": "def calculate_even_sum(numbers):\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[2, 4, 4]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38409_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004718", "code": "def sum_multiples_of_3_not_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_not_5", "input": "[3, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108735_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004719", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#FFA500'", "output": "(255, 165, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004720", "code": "def totalNQueens(n):\n    def is_safe(board, row, col):\n        for i in range(row):\n            if board[i] == col or abs(i - row) == abs(board[i] - col):\n                return False\n        return True\n    def backtrack(board, row):\n        nonlocal count\n        if row == n:\n            count += 1\n            return\n        for col in range(n):\n            if is_safe(board, row, col):\n                board[row] = col\n                backtrack(board, row + 1)\n    count = 0\n    board = [-1] * n\n    backtrack(board, 0)\n    return count\n", "entry_point": "totalNQueens", "input": "2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107753_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004721", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "120, -6.0, 1.0", "output": "109.095", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004722", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "6", "output": "[0, 1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004723", "code": "def card_war_winner(N, deck1, deck2):\n    player1_score = 0\n    player2_score = 0\n    for i in range(N):\n        if deck1[i] > deck2[i]:\n            player1_score += 1\n        elif deck1[i] < deck2[i]:\n            player2_score += 1\n    if player1_score > player2_score:\n        return 1\n    elif player1_score < player2_score:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_war_winner", "input": "3, [5, 3, 4], [1, 2, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95440_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004724", "code": "from typing import List, Union\ndef filter_satellite_objects(satellite_list: List[Union[int, str]]) -> List[str]:\n    filtered_satellites = [satellite for satellite in satellite_list if isinstance(satellite, str)]\n    return filtered_satellites\n", "entry_point": "filter_satellite_objects", "input": "[1, 2, 3, 'e']", "output": "['e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113677_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6441", "output": "{1, 2147, 3, 6441, 113, 19, 339, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004726", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'Inmn'", "output": "'inmn.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004727", "code": "def extract_variables(script):\n    variables = {}\n    for line in script.splitlines():\n        line = line.strip()\n        if line and \"=\" in line:\n            parts = line.split(\"=\")\n            variable_name = parts[0].strip()\n            variable_value = \"=\".join(parts[1:]).strip()\n            variables[variable_name] = variable_value\n    return variables\n", "entry_point": "extract_variables", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38111_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004728", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "225", "output": "{1, 225, 3, 5, 9, 75, 45, 15, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt224", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6758", "output": "{1, 2, 6758, 109, 3379, 218, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004730", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "10", "output": "152.8740565703525", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004731", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 1, 5, 5, 5, 5, 5]", "output": "[1, 2, 7, 12, 17, 22, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004732", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14851_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004733", "code": "def minStatuesNeeded(statues):\n    min_height = min(statues)\n    max_height = max(statues)\n    total_statues = len(statues)\n    # Calculate the number of additional statues needed to make the array consecutive\n    additional_statues = (max_height - min_height + 1) - total_statues\n    return additional_statues\n", "entry_point": "minStatuesNeeded", "input": "[1, 4, 6]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18434_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004734", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    # Use regular expression to extract words while ignoring non-alphanumeric characters\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'hehellpythono!'", "output": "{'hehellpythono': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115848_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004735", "code": "from typing import List\ndef unique_elements(lista: List[int]) -> List[int]:\n    seen = set()\n    result = []\n    for num in lista:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "unique_elements", "input": "[1, 1, 2, 2, 3, 3, 4, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139228_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "536", "output": "{1, 2, 67, 4, 134, 8, 268, 536}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt535", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2456", "output": "{1, 2, 4, 614, 8, 1228, 307, 2456}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2455", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004738", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'myapp.senasConfig'", "output": "'senasConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7484", "output": "{1, 2, 4, 1871, 7484, 3742}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7483", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004740", "code": "def parse_ve_direct_data(input_string):\n    voltage = None\n    current = None\n    lines = input_string.split('\\n')\n    for line in lines:\n        key_value = line.split('\\t')\n        if len(key_value) == 2:\n            key, value = key_value\n            if key == 'V':\n                voltage = float(value)\n            elif key == 'I':\n                current = float(value)\n    return voltage, current\n", "entry_point": "parse_ve_direct_data", "input": "''", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89184_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004741", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v1.2.3'", "output": "'1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004742", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[8, 10, 18]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7596_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004743", "code": "import os\ndef validate_token(provided_token: str) -> bool:\n    hub_token_path = os.environ.get('HUB_TOKEN_PATH', '')\n    if not hub_token_path or not os.path.isfile(hub_token_path):\n        return False\n    with open(hub_token_path, 'r') as f:\n        internal_token = f.read().strip()\n    return provided_token == internal_token\n", "entry_point": "validate_token", "input": "'some_invalid_token'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45183_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9607", "output": "{1, 739, 13, 9607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004745", "code": "def is_balanced(s):\n    stack = []\n    brackets_map = {')': '(', ']': '[', '}': '{'}\n    for char in s:\n        if char in brackets_map.values():\n            stack.append(char)\n        elif char in brackets_map.keys():\n            if not stack or brackets_map[char] != stack.pop():\n                return False\n    return not stack\n", "entry_point": "is_balanced", "input": "'{[()]}'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34337_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004746", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[0, 4], [4, 0]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70247_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004747", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "-98.00000000000001", "output": "175.14999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004748", "code": "def max_nested_parentheses_depth(input_str):\n    depth = 0\n    max_depth = 0\n    for char in input_str:\n        if char == '(':\n            depth += 1\n            max_depth = max(max_depth, depth)\n        elif char == ')':\n            depth -= 1\n    return max_depth\n", "entry_point": "max_nested_parentheses_depth", "input": "'(((( ))))'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80515_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004749", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'unknown_dataset', 227", "output": "227", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004750", "code": "def calculate_winner(cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B\"\n    else:\n        return \"Tie\"\n", "entry_point": "calculate_winner", "input": "[2, 5]", "output": "'Player B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63696_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004751", "code": "def longest_subarray_with_distinct_elements(k):\n    n = len(k)\n    hashmap = dict()\n    j = 0\n    ans = 0\n    c = 0\n    for i in range(n):\n        if k[i] in hashmap and hashmap[k[i]] > 0:\n            while i > j and k[i] in hashmap and hashmap[k[i]] > 0:\n                hashmap[k[j]] -= 1\n                j += 1\n                c -= 1\n        hashmap[k[i]] = 1\n        c += 1\n        ans = max(ans, c)\n    return ans\n", "entry_point": "longest_subarray_with_distinct_elements", "input": "[1, 1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37610_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2791", "output": "{1, 2791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004753", "code": "import ast\nimport sys\nimport keyword\nimport importlib.util\ndef analyze_imported_modules(script):\n    external_modules = set()\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                module_name = alias.name.split('.')[0]\n                if module_name not in sys.builtin_module_names and module_name not in keyword.kwlist:\n                    external_modules.add(module_name)\n        elif isinstance(node, ast.ImportFrom):\n            if node.module:\n                module_name = node.module.split('.')[0]\n                if module_name not in sys.builtin_module_names and module_name not in keyword.kwlist:\n                    external_modules.add(module_name)\n    return sorted(list(external_modules))\n", "entry_point": "analyze_imported_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67052_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004754", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'10 * 8'", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004755", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[58, 58, 58]", "output": "58", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70866_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004756", "code": "import re\ndef scan_text(input_text):\n    patterns = {\n        'bold': r'\\*\\*',\n        'link_special': r'\\[\\[(?P<target>.*?)\\|(?P<text>.*?)\\]\\]',\n        'link': r'\\[\\[(.*?)\\]\\]',\n        'underline': r'_'\n    }\n    results = []\n    for token, regex in patterns.items():\n        for match in re.finditer(regex, input_text):\n            if token == 'link_special':\n                results.append((token, match.groups(), match.groupdict(), match.group()))\n            else:\n                results.append((token, match.groups(), None, match.group()))\n    return results\n", "entry_point": "scan_text", "input": "'**'", "output": "[('bold', (), None, '**')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148257_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004757", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 2, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122887_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004758", "code": "import re\ndef process_text(text):\n    re_check = re.compile(r\"^[a-z0-9_]+$\")\n    re_newlines = re.compile(r\"[\\r\\n\\x0b]+\")\n    re_multiplespaces = re.compile(r\"\\s{2,}\")\n    re_remindertext = re.compile(r\"( *)\\([^()]*\\)( *)\")\n    re_minuses = re.compile(r\"(?:^|(?<=[\\s/]))[-\\u2013](?=[\\dXY])\")\n    # Remove leading and trailing whitespace\n    text = text.strip()\n    # Replace multiple spaces with a single space\n    text = re_multiplespaces.sub(' ', text)\n    # Remove text enclosed within parentheses\n    text = re_remindertext.sub('', text)\n    # Replace '-' or '\u2013' with a space based on the specified conditions\n    text = re_minuses.sub(' ', text)\n    return text\n", "entry_point": "process_text", "input": "'     '", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124316_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004759", "code": "def extract_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if not char.isspace():\n            unique_chars.add(char)\n    return sorted(list(unique_chars))\n", "entry_point": "extract_unique_characters", "input": "'abc de f'", "output": "['a', 'b', 'c', 'd', 'e', 'f']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89815_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004760", "code": "def letter_counter(token, word):\n    count = 0\n    for letter in word:\n        if letter == token:\n            count += 1\n    return count\n", "entry_point": "letter_counter", "input": "'a', 'banana'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100580_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004761", "code": "import re\ndef extract_config_info(config_content: str) -> dict:\n    output_info = {}\n    current_module = None\n    for line in config_content.split('\\n'):\n        line = line.strip()\n        if line.startswith('process.'):\n            current_module = line.split('=')[0].strip()\n        elif current_module == 'process.DQMoutput':\n            if 'fileName' in line:\n                match = re.search(r\"'(.*?)'\", line)\n                if match:\n                    output_info['output_file'] = match.group(1)\n        elif current_module == 'process.options':\n            if 'numberOfThreads' in line:\n                match = re.search(r\"uint32\\((\\d+)\\)\", line)\n                if match:\n                    output_info['num_threads'] = int(match.group(1))\n            elif 'numberOfStreams' in line:\n                match = re.search(r\"uint32\\((\\d+)\\)\", line)\n                if match:\n                    output_info['num_streams'] = int(match.group(1))\n    return output_info\n", "entry_point": "extract_config_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47723_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004762", "code": "def generate_fibonacci_sequence(limit):\n    fibonacci_sequence = [0, 1]\n    while fibonacci_sequence[-1] + fibonacci_sequence[-2] <= limit:\n        next_fibonacci = fibonacci_sequence[-1] + fibonacci_sequence[-2]\n        fibonacci_sequence.append(next_fibonacci)\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "7", "output": "[0, 1, 1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145981_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004763", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'ThisThisased'", "output": "'this_thisased'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004764", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'worldd'", "output": "{'worldd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004765", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "90", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004766", "code": "def calculate_dissatisfaction(farmland):\n    m, l1, l2 = float('inf'), len(farmland), len(farmland[0])\n    def cnt(i, j):\n        return sum([(k - i) ** 2 + (l - j) ** 2 for k in range(l1) for l in range(l2) if farmland[k][l] == 'C'])\n    if all([c == 'C' for r in farmland for c in r]):\n        return cnt(l1 // 2, l2 // 2)\n    for i in range(l1):\n        for j in range(l2):\n            if farmland[i][j] == 'C':\n                m = min(m, cnt(i, j))\n    return m\n", "entry_point": "calculate_dissatisfaction", "input": "[['C', '.', 'C'], ['C', '.', '.'], ['.', 'C', '.']]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91284_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004767", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "['apple', 'apple', 'cat', 1]", "output": "{'apple': 2, 'cat': 1, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004768", "code": "from collections import defaultdict, deque\ndef task_ordering(dependencies):\n    task_dependencies = defaultdict(list)\n    all_tasks = set()\n    indegree = defaultdict(int)\n    for dependency in dependencies:\n        task_dependencies[dependency[0]].append(dependency[1])\n        all_tasks.update(dependency)\n    for task in all_tasks:\n        indegree[task] = 0\n    for dependency in dependencies:\n        indegree[dependency[1]] += 1\n    queue = deque([task for task in all_tasks if indegree[task] == 0])\n    result = []\n    while queue:\n        current_task = queue.popleft()\n        result.append(current_task)\n        for dependent_task in task_dependencies[current_task]:\n            indegree[dependent_task] -= 1\n            if indegree[dependent_task] == 0:\n                queue.append(dependent_task)\n    return result\n", "entry_point": "task_ordering", "input": "[(1, 4), (4, 2), (4, 5), (2, 3)]", "output": "[1, 4, 2, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123947_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004769", "code": "import re\ndef extract_modules_and_classes(code):\n    module_pattern = r'from\\s+(\\w+)\\s+import|import\\s+(\\w+)'\n    class_pattern = r'class\\s+(\\w+)'\n    modules = set(re.findall(module_pattern, code))\n    classes = set(re.findall(class_pattern, code))\n    module_names = [module[0] if module[0] else module[1] for module in modules]\n    class_names = [class_name for class_name in classes]\n    return list(set(module_names)), list(set(class_names))\n", "entry_point": "extract_modules_and_classes", "input": "''", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125120_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004770", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0], [8, 0, 0]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144987_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004771", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 2, 5, 7]", "output": "[7, 3, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004772", "code": "def count_unique_primes(nums):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in nums:\n        if is_prime(num):\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[2, 3, 5, 1, 4, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51785_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004773", "code": "import re\nfrom typing import List\ndef extract_words(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-z]{3,}y\\b'  # Define the pattern using regular expression\n    words = re.findall(pattern, text)  # Find all words matching the pattern\n    unique_words = list(set(words))    # Get unique words\n    return unique_words\n", "entry_point": "extract_words", "input": "'Hello there!'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132295_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004774", "code": "def calculate_mode(numbers):\n    frequency_dict = {}\n    for num in numbers:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return min(modes)\n", "entry_point": "calculate_mode", "input": "[4, 4, 4, 5, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48679_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004775", "code": "import importlib\nimport inspect\nfrom types import ModuleType\ndef check_module_functions(module_name):\n    try:\n        user_module = importlib.import_module(module_name)\n    except:\n        return False\n    if not isinstance(user_module, ModuleType):\n        return False\n    callables = inspect.getmembers(user_module, inspect.isfunction)\n    if len(callables) > 1:\n        return True\n    else:\n        return False\n", "entry_point": "check_module_functions", "input": "'non_existent_module'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138360_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004776", "code": "def generate_indices(s):\n    modes = []\n    for i, c in enumerate(s):\n        modes += [i] * int(c)\n    return sorted(modes)\n", "entry_point": "generate_indices", "input": "'12231'", "output": "[0, 1, 1, 2, 2, 3, 3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130187_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004777", "code": "HIGH_COLOR = (0, 255, 0)\nLOW_COLOR = (0, 0, 64)\ndef replace_colors(colors):\n    new_colors = []\n    for color in colors:\n        avg_rgb = sum(color) // 3\n        if avg_rgb > 128:\n            new_colors.append(HIGH_COLOR)\n        else:\n            new_colors.append(LOW_COLOR)\n    return new_colors\n", "entry_point": "replace_colors", "input": "[(0, 0, 64), (0, 0, 64), (0, 0, 64)]", "output": "[(0, 0, 64), (0, 0, 64), (0, 0, 64)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130367_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004778", "code": "from typing import List, Tuple\ndef process_transactions(transactions: List[int]) -> Tuple[int, bool]:\n    balance = 0\n    destroy_contract = False\n    for transaction in transactions:\n        balance += transaction\n        if balance < 0:\n            destroy_contract = True\n            break\n    return balance, destroy_contract\n", "entry_point": "process_transactions", "input": "[3, -2, -5]", "output": "(-4, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9357_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004779", "code": "from typing import List\ndef calculate_max_score(scores: List[int]) -> int:\n    if not scores:\n        return 0\n    n = len(scores)\n    if n == 1:\n        return scores[0]\n    dp = [0] * n\n    dp[0] = scores[0]\n    dp[1] = max(scores[0], scores[1])\n    for i in range(2, n):\n        dp[i] = max(scores[i] + dp[i - 2], dp[i - 1])\n    return dp[-1]\n", "entry_point": "calculate_max_score", "input": "[19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64203_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004780", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[3, 1, 2, 1, 0, 0, 0]", "output": "[4, 3, 3, 1, 0, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004781", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 3, 6, 1]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122887_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004782", "code": "def count_pairs(nums, target):\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        if target - num in num_freq and num_freq[target - num] > 0:\n            pair_count += 1\n            num_freq[target - num] -= 1\n        else:\n            num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs", "input": "[1, 2, 3, 4], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82729_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004783", "code": "import os\ndef find_common_parent(path1: str, path2: str) -> str:\n    parent1 = path1.split(os.sep)\n    parent2 = path2.split(os.sep)\n    common_parent = []\n    for dir1, dir2 in zip(parent1, parent2):\n        if dir1 == dir2:\n            common_parent.append(dir1)\n        else:\n            break\n    if len(common_parent) == 1 and common_parent[0] == '':\n        return os.sep  # Handle the case when the paths start with the root directory\n    if len(common_parent) == 0:\n        return \"No common parent directory\"\n    return os.sep.join(common_parent)\n", "entry_point": "find_common_parent", "input": "'/', '/'", "output": "'/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85951_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3686", "output": "{1, 2, 194, 97, 3686, 38, 19, 1843}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3685", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1893", "output": "{1, 3, 1893, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004786", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/um/exam'", "output": "('C:/Users/um', 'exam')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004787", "code": "import os\ndef count_python_files_and_loc(directory: str) -> tuple:\n    total_python_files = 0\n    total_lines = 0\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.endswith(\".py\"):\n                total_python_files += 1\n                with open(os.path.join(root, file), \"r\") as f:\n                    total_lines += sum(1 for line in f if line.strip())\n    return total_python_files, total_lines\n", "entry_point": "count_python_files_and_loc", "input": "'/path/to/nonexistent/directory'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122911_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004788", "code": "def encrypt_decrypt_message(message, shift):\n    result = \"\"\n    for char in message:\n        if char.isupper():\n            result += chr((ord(char) - 65 + shift) % 26 + 65) if char.isupper() else char\n        elif char.islower():\n            result += chr((ord(char) - 97 + shift) % 26 + 97) if char.islower() else char\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt_decrypt_message", "input": "'Hello, World!', 5", "output": "'Mjqqt, Btwqi!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149832_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004789", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[-31], 1", "output": "-31.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004790", "code": "import ast\ndef validate_lambda_expression(lambda_exp: str) -> bool:\n    if not lambda_exp.startswith(\"(lambda \") or not lambda_exp.endswith(\")\"):\n        return False\n    params_body = lambda_exp[len(\"(lambda \"):-1].split(\":\", 1)\n    if len(params_body) != 2:\n        return False\n    params, body = params_body\n    try:\n        params = params.strip()\n        body = body.strip()\n        ast.literal_eval(f\"lambda {params}: {body}\")\n    except (SyntaxError, ValueError):\n        return False\n    return True\n", "entry_point": "validate_lambda_expression", "input": "'lambda x: x + 1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24999_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004791", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'1.9.91'", "output": "'1.9.92'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004792", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8329", "output": "{1, 8329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004793", "code": "def find_invalid_fixtures(fixtures):\n    invalid_fixtures = []\n    for fixture, version in fixtures.items():\n        try:\n            int(version)\n        except ValueError:\n            invalid_fixtures.append(fixture)\n    return invalid_fixtures\n", "entry_point": "find_invalid_fixtures", "input": "{'fixture1': '1', 'fixture2': '2', 'fixture3': '3'}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97330_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004794", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[1, 1, 1, 3, 3, 3, 3, 3, 2]", "output": "{1: 3, 3: 5, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004795", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "6, 2", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004796", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'tssaor'", "output": "'Tweet posted successfully: tssaor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6962", "output": "{1, 2, 6962, 118, 3481, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004798", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "778989, 'heth0', ''", "output": "'acl/778989/interfaces/heth0_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004799", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'0.10.1-0'", "output": "(0, 10, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1131", "output": "{1, 3, 39, 1131, 13, 87, 377, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004801", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3736", "output": "{1, 2, 4, 934, 8, 1868, 467, 3736}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3735", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004802", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "8", "output": "'112'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5259", "output": "{3, 1, 5259, 1753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004804", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "627", "output": "{1, 33, 3, 11, 209, 627, 19, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004805", "code": "def map_source_to_file(source):\n    if source == 'A':\n        return 'art_source.txt'\n    elif source == 'C':\n        return 'clip_source.txt'\n    elif source == 'P':\n        return 'product_source.txt'\n    elif source == 'R':\n        return 'real_source.txt'\n    else:\n        return \"Unknown Source Type, only supports A C P R.\"\n", "entry_point": "map_source_to_file", "input": "'B'", "output": "'Unknown Source Type, only supports A C P R.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140499_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004806", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max\n", "entry_point": "find_second_largest", "input": "[10, 11, 15]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84134_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004807", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[1, 1, 2]", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1667", "output": "{1, 1667}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004809", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'Hello World!'", "output": "'Uryyb Jbeyq!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004810", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "0.0, 2411680318.529858", "output": "2411680318.529858", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004811", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hhhhhheeeellllloooo'", "output": "{'h': 6, 'e': 4, 'l': 5, 'o': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84684_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1822", "output": "{1, 2, 1822, 911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004813", "code": "from typing import List\ndef _remove_trailing_zeros(numbers: List[float]) -> List[float]:\n    # Iterate through the list from the end and remove trailing zeros\n    while numbers and numbers[-1] == 0.0:\n        numbers.pop()\n    return numbers\n", "entry_point": "_remove_trailing_zeros", "input": "[0.6, 0.0, 1.0, 1.0, 0.4, 0.0, 0.0]", "output": "[0.6, 0.0, 1.0, 1.0, 0.4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148979_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004814", "code": "def count_max_progress(progress_list):\n    max_progress_count = 0\n    for progress in progress_list:\n        if progress == 10:\n            max_progress_count += 1\n    return max_progress_count\n", "entry_point": "count_max_progress", "input": "[10, 10]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93593_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004815", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3158", "output": "{1, 2, 1579, 3158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004816", "code": "def is_leap_year(year):\n    if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):\n        return True\n    else:\n        return False\n", "entry_point": "is_leap_year", "input": "2019", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004817", "code": "def categorize_items(categories):\n    categorized_items = {}\n    for category in categories:\n        category_name, items = category.split(':')\n        categorized_items[category_name] = items.split(',')\n    return categorized_items\n", "entry_point": "categorize_items", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116654_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004818", "code": "def wheel(pos):\n    if pos < 0 or pos > 255:\n        return (0, 0, 0)\n    if pos < 85:\n        return (255 - pos * 3, pos * 3, 0)\n    if pos < 170:\n        pos -= 85\n        return (0, 255 - pos * 3, pos * 3)\n    pos -= 170\n    return (pos * 3, 0, 255 - pos * 3)\n", "entry_point": "wheel", "input": "213", "output": "(129, 0, 126)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16803_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004819", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'missing_key', 'defaudt_valud'", "output": "'defaudt_valud'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004820", "code": "def parse_modules(module_list):\n    modules_dict = {}\n    for module_class in module_list:\n        module, class_name = module_class.split('.')\n        if module in modules_dict:\n            if isinstance(modules_dict[module], list):\n                modules_dict[module].append(class_name)\n            else:\n                modules_dict[module] = [modules_dict[module], class_name]\n        else:\n            modules_dict[module] = class_name\n    return modules_dict\n", "entry_point": "parse_modules", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34143_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004821", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'eae'", "output": "('eae', '', '', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004822", "code": "def max_subarray_sum(nums):\n    max_ending_here = max_so_far = nums[0]\n    for num in nums[1:]:\n        max_ending_here = max(num, max_ending_here + num)\n        max_so_far = max(max_so_far, max_ending_here)\n    return max_so_far\n", "entry_point": "max_subarray_sum", "input": "[5, 1, 3, 7]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60358_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004823", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[2, 3, 1, 5, 0, 6, 1, 5, 2]", "output": "[1, 5, 4, 6, 5, 6, 7, 6, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004824", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7133", "output": "{1, 1019, 7133, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004825", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "202.005, 0, 5", "output": "79.38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004826", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['3', '2', '2', '3']", "output": "3223", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004827", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[4, 4]", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004828", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average", "input": "[76, 78, 79, 77, 81]", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106786_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004829", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<pact.a'", "output": "'<pact.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7856", "output": "{1, 2, 4, 8, 491, 1964, 7856, 16, 982, 3928}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7855", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004831", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'ello123'", "output": "'ELLO###'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004832", "code": "def check_integer_solution(x, y):\n    denominator = y - x + 1\n    if denominator != 0 and (2 * y + 1 - x) % denominator == 0:\n        return \"YES\"\n    else:\n        return \"NO\"\n", "entry_point": "check_integer_solution", "input": "1, 2", "output": "'YES'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110543_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004833", "code": "def compareTriplets(a, b):\n    score_a = 0\n    score_b = 0\n    for i in range(3):\n        if a[i] > b[i]:\n            score_a += 1\n        elif a[i] < b[i]:\n            score_b += 1\n    return [score_a, score_b]\n", "entry_point": "compareTriplets", "input": "[1, 2, 3], [2, 3, 4]", "output": "[0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134718_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "351", "output": "{1, 3, 39, 9, 13, 117, 27, 351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004835", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[3, 2, 4, 5, 8, 5]", "output": "[27, 4, 16, 125, 64, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004836", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mtrMtmtrcnfi.mtrMtmtrcnfim'", "output": "('mtrMtmtrcnfi', 'mtrMtmtrcnfim')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004837", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[3, 4, 5, 4, 2, 3, 3, 5]", "output": "[3, 7, 12, 16, 18, 21, 24, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004838", "code": "def flatten_dependencies(dependencies):\n    flattened_dependencies = []\n    for item in dependencies:\n        if isinstance(item, tuple):\n            flattened_dependencies.extend(item)\n        else:\n            flattened_dependencies.append(item)\n    return list(set(flattened_dependencies))\n", "entry_point": "flatten_dependencies", "input": "['0002_remove_content_type_name']", "output": "['0002_remove_content_type_name']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64153_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004839", "code": "def __is_object_bound_column(column_name):\n    \"\"\"\n    Check if column is object bound attribute or method\n    :param column_name: column name to be checked\n    :return: True if column is object bound, False otherwise\n    \"\"\"\n    PY2SQL_OBJECT_ATTR_PREFIX = \"attr_\"\n    PY2SQL_OBJECT_METHOD_PREFIX = \"method_\"\n    PY2SQL_PRIMITIVE_TYPES_VALUE_COLUMN_NAME = \"value\"\n    PY2SQL_OBJECT_PYTHON_ID_COLUMN_NAME = \"id\"\n    return column_name.startswith(PY2SQL_OBJECT_ATTR_PREFIX) or \\\n           column_name.startswith(PY2SQL_OBJECT_METHOD_PREFIX) or \\\n           column_name == PY2SQL_PRIMITIVE_TYPES_VALUE_COLUMN_NAME or \\\n           column_name == PY2SQL_OBJECT_PYTHON_ID_COLUMN_NAME\n", "entry_point": "__is_object_bound_column", "input": "'column_name'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28560_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004840", "code": "def get_repo_name_from_url(url: str) -> str:\n    if not url:\n        return None\n    last_slash_index = url.rfind(\"/\")\n    last_suffix_index = url.rfind(\".git\")\n    if last_suffix_index < 0:\n        last_suffix_index = len(url)\n    if last_slash_index < 0 or last_suffix_index <= last_slash_index:\n        raise Exception(\"Invalid repo url {}\".format(url))\n    return url[last_slash_index + 1:last_suffix_index]\n", "entry_point": "get_repo_name_from_url", "input": "'https://example.com/some/path/rgit.git'", "output": "'rgit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4595_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004841", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2011", "output": "{1, 2011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004842", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['* 2', '* 3', '* 4', '* 5', '* 6', '+ 36'], 1", "output": "756", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004843", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3671", "output": "{1, 3671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004844", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    i = 1\n    while i < len(nums):\n        if nums[i-1] == nums[i]:\n            nums.pop(i)\n            continue\n        i += 1\n    return len(nums)\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119722_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004845", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81996_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004846", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004847", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3217", "output": "{1, 3217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004848", "code": "def simulate_card_war(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    war_cards = []\n    while player1_deck and player2_deck:\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_score += 1\n            player1_deck.extend(war_cards + [card1, card2])\n            war_cards = []\n        elif card2 > card1:\n            player2_score += 1\n            player2_deck.extend(war_cards + [card1, card2])\n            war_cards = []\n        else:\n            war_cards.extend([card1, card2])\n            for _ in range(3):\n                if player1_deck and player2_deck:\n                    war_cards.append(player1_deck.pop(0))\n                    war_cards.append(player2_deck.pop(0))\n    return player1_score, player2_score\n", "entry_point": "simulate_card_war", "input": "[1, 2, 3], [4, 5, 6]", "output": "(0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43005_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004849", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[14, 14, 13, 13, 13, 13, 13, 12, 7]", "output": "[7, 12, 13, 13, 13, 13, 13, 14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9457", "output": "{1, 193, 1351, 7, 49, 9457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004851", "code": "from typing import List\ndef extract_css_comments(totalLength: int, roughCss: str) -> List[str]:\n    comments = []\n    commentText = ''\n    inComment = False\n    for i in range(totalLength):\n        if i < totalLength - 1 and roughCss[i] == '/' and roughCss[i + 1] == '*':\n            inComment = True\n            i += 1\n        elif i < totalLength - 1 and roughCss[i] == '*' and roughCss[i + 1] == '/':\n            inComment = False\n            comments.append(commentText)\n            commentText = ''\n            i += 1\n        elif inComment:\n            commentText += roughCss[i]\n    return comments\n", "entry_point": "extract_css_comments", "input": "0, ''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125997_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004852", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'uu-a'", "output": "'uu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004853", "code": "from collections import Counter\ndef find_most_common_element(lst):\n    count = Counter(lst)\n    max_freq = max(count.values())\n    for num in lst:\n        if count[num] == max_freq:\n            return num\n", "entry_point": "find_most_common_element", "input": "[1, 1, 1, 2, 3, 4]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135199_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004854", "code": "def process_buttons(buttons):\n    if buttons is None:\n        return None\n    try:\n        if buttons.SUBCLASS_OF_ID == 0xe2e10ef2:\n            return buttons\n    except AttributeError:\n        pass\n    if not isinstance(buttons, list):\n        buttons = [[buttons]]\n    elif not isinstance(buttons[0], list):\n        buttons = [buttons]\n    is_inline = False\n    is_normal = False\n    rows = []\n    return buttons, is_inline, is_normal, rows\n", "entry_point": "process_buttons", "input": "[3, 2, 3, 3, 4, 3, 2]", "output": "([[3, 2, 3, 3, 4, 3, 2]], False, False, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147264_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004855", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[3, 3, 3, 1, 2]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004856", "code": "SCRABBLE_LETTER_VALUES = {\n    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8,\n    'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1,\n    'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10\n}\ndef calculate_word_score(word, n):\n    if len(word) == 0:\n        return 0\n    wordScore = 0\n    lettersUsed = 0\n    for theLetter in word:\n        wordScore += SCRABBLE_LETTER_VALUES[theLetter]\n        lettersUsed += 1\n    wordScore *= lettersUsed\n    if lettersUsed == n:\n        wordScore += 50\n    return wordScore\n", "entry_point": "calculate_word_score", "input": "'dabe', 4", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38596_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004857", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "[20, 30, 60, 70]", "output": "[40.0, 50.0, 40, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004858", "code": "def find_divisible_sum(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "find_divisible_sum", "input": "[15, 15, 15, 15]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147524_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004859", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'Hello,'", "output": "'Uryyb,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004860", "code": "def solution(array):\n    result = array.copy()  # Create a copy of the input array to avoid modifying the original array\n    for i in range(len(array) - 1):\n        if array[i] == 0 and array[i + 1] == 1:\n            result[i], result[i + 1] = result[i + 1], result[i]  # Swap the elements if the condition is met\n    return result\n", "entry_point": "solution", "input": "[1, 2, -1, 3, 2, 1, 1, 3, 1]", "output": "[1, 2, -1, 3, 2, 1, 1, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107637_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4889", "output": "{1, 4889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004862", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7082", "output": "{1, 7082, 2, 3541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004864", "code": "from typing import List\ndef sum_divisible_by_3_and_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30, 45]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80529_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004865", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125172_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004866", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(5, 5, 5)", "output": "'5.5.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004867", "code": "def calculate_mse(predicted_values, actual_values):\n    if len(predicted_values) != len(actual_values):\n        raise ValueError(\"Input lists must have the same length\")\n    squared_errors = [(pred - actual) ** 2 for pred, actual in zip(predicted_values, actual_values)]\n    mse = sum(squared_errors) / len(predicted_values)\n    return mse\n", "entry_point": "calculate_mse", "input": "[0.0, 2.0], [1.0, 1.0]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109164_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004868", "code": "from typing import Tuple, Optional\ndef validate_input(input_str: str) -> Tuple[bool, Optional[str]]:\n    if len(input_str) < 5:\n        return False, 'Validation failed'\n    if any(char.isdigit() for char in input_str):\n        return False, 'Validation failed'\n    if not input_str.endswith('valid'):\n        return False, 'Validation failed'\n    return True, 'Validation successful'\n", "entry_point": "validate_input", "input": "'testvalid'", "output": "(True, 'Validation successful')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146832_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004869", "code": "def get_rgb_value(color):\n    color_map = {\n        \"RED\": (255, 0, 0),\n        \"GREEN\": (0, 255, 0),\n        \"BLUE\": (0, 0, 255),\n        \"YELLOW\": (255, 255, 0),\n        \"CYAN\": (0, 255, 255),\n        \"MAGENTA\": (255, 0, 255),\n        \"WHITE\": (255, 255, 255),\n        \"BLACK\": (0, 0, 0)\n    }\n    return color_map.get(color, \"Color not found\")\n", "entry_point": "get_rgb_value", "input": "'ORANGE'", "output": "'Color not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45808_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004870", "code": "MOBILENET_RESTRICTIONS = [('Camera', 10), ('GPS', 8), ('Bluetooth', 9)]\ndef filter_mobile_restrictions(threshold):\n    restricted_features = [feature for feature, version in MOBILENET_RESTRICTIONS if version >= threshold]\n    return restricted_features\n", "entry_point": "filter_mobile_restrictions", "input": "11", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92353_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004871", "code": "def analyze_list(lst):\n    total = len(lst)\n    even_count = sum(1 for num in lst if num % 2 == 0)\n    total_sum = sum(lst)\n    return {'Total': total, 'Even': even_count, 'Sum': total_sum}\n", "entry_point": "analyze_list", "input": "[1, 2, 3, 4, 5]", "output": "{'Total': 5, 'Even': 2, 'Sum': 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93656_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004872", "code": "from typing import List\ndef min_ram_changes(devices: List[int]) -> int:\n    total_ram = sum(devices)\n    avg_ram = total_ram // len(devices)\n    changes_needed = sum(abs(avg_ram - ram) for ram in devices)\n    return changes_needed\n", "entry_point": "min_ram_changes", "input": "[0, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74774_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004873", "code": "import re\nfrom typing import Tuple\ndef extract_git_info(script: str) -> Tuple[str, str]:\n    url_pattern = r'git clone (https?://\\S+)'\n    dir_pattern = r'cd (\\S+)'\n    url_match = re.search(url_pattern, script)\n    dir_match = re.search(dir_pattern, script)\n    if url_match and dir_match:\n        return url_match.group(1), dir_match.group(1)\n    else:\n        return None, None\n", "entry_point": "extract_git_info", "input": "'random text without commands'", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130700_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004874", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 4], [9, 4]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004875", "code": "def render_template(template, context):\n    rendered_template = template\n    for key, value in context.items():\n        rendered_template = rendered_template.replace(\"{{ \" + key + \" }}\", str(value))\n    return rendered_template\n", "entry_point": "render_template", "input": "'{{ greeting }},', {'greeting': 'Hello'}", "output": "'Hello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8818_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2155", "output": "{1, 2155, 5, 431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004877", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'//pducsd/'", "output": "'//pducsd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004878", "code": "def extract_digits(str_input):\n    final_str = \"\"\n    for char in str_input:\n        if char.isdigit():  # Check if the character is a digit\n            final_str += char\n    return final_str\n", "entry_point": "extract_digits", "input": "'1'", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132906_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004879", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[8.0, 8.0]", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004880", "code": "def calculate_diff(string1, string2):\n    if len(string1) != len(string2):\n        return \"Strings are of different length\"\n    diff_count = 0\n    for i in range(len(string1)):\n        if string1[i] != string2[i]:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_diff", "input": "'abc', 'abcd'", "output": "'Strings are of different length'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98507_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004881", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[1, 1, 2, 4, 4, 5, 5]", "output": "[2, 3, 6, 8, 9, 10, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004882", "code": "def find_lcs_length_optimized(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length_optimized", "input": "'abc', 'xyz'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28396_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004883", "code": "def count_uppercase_letters(input_string):\n    uppercase_count = 0\n    for char in input_string:\n        if char.isupper():\n            uppercase_count += 1\n    return uppercase_count\n", "entry_point": "count_uppercase_letters", "input": "'A'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113893_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5342", "output": "{1, 2, 5342, 2671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004885", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'lly l'", "output": "['l']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4203", "output": "{1, 3, 9, 4203, 467, 1401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004887", "code": "def reconstruct_string(freq_list):\n    char_freq = {}\n    # Create a dictionary mapping characters to their frequencies\n    for i, freq in enumerate(freq_list):\n        char_freq[chr(i)] = freq\n    # Sort the characters by their ASCII values\n    sorted_chars = sorted(char_freq.keys())\n    result = \"\"\n    # Reconstruct the string based on the frequency list\n    for char in sorted_chars:\n        result += char * char_freq[char]\n    return result\n", "entry_point": "reconstruct_string", "input": "[1, 1, 0, 1, 0, 2, 2] + [0] * (256 - 7)", "output": "'\\x00\\x01\\x03\\x05\\x05\\x06\\x06'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49716_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004888", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'bctabae'", "output": "'aba'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004889", "code": "def calculate_version_number(version_info_dict):\n    major = version_info_dict.get(\"major\", 0)\n    minor = version_info_dict.get(\"minor\", 0)\n    patch = version_info_dict.get(\"patch\", 0)\n    status = version_info_dict.get(\"status\", \"\")\n    version_number = f\"{major}.{minor}.{patch}-{status}\"\n    return version_number\n", "entry_point": "calculate_version_number", "input": "{'major': 0, 'minor': 0, 'patch': 0, 'status': ''}", "output": "'0.0.0-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137684_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004890", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[3, 3, 6, 2, 2, 6, 6, 6]", "output": "[3, 4, 8, 5, 6, 11, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004891", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2719", "output": "{1, 2719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004892", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6058", "output": "{1, 2, 233, 6058, 13, 466, 3029, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6057", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004893", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'woldwowoldrld'", "output": "{'woldwowoldrld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004894", "code": "STATUS_CODE_OK = 1\nSTATUS_CODE_SKIP = 2\nSTATUS_CODE_REPEAT = 3\ndef determine_status_code(current_status_code, response_data):\n    if current_status_code is None:\n        return STATUS_CODE_OK\n    elif \"error\" in response_data and response_data[\"error\"]:\n        return STATUS_CODE_REPEAT\n    elif \"skip\" in response_data and response_data[\"skip\"]:\n        return STATUS_CODE_SKIP\n    else:\n        return STATUS_CODE_OK\n", "entry_point": "determine_status_code", "input": "None, {}", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32732_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004895", "code": "def count_unique_amino_acids(sequence):\n    unique_amino_acids = set()\n    for amino_acid in sequence:\n        if amino_acid.isalpha():  # Check if the character is an alphabet\n            unique_amino_acids.add(amino_acid)\n    return len(unique_amino_acids)\n", "entry_point": "count_unique_amino_acids", "input": "'ABC123!!!'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31328_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004896", "code": "def find_highest_bidder(bids):\n    highest_bidder = \"\"\n    highest_bid = 0\n    for bidder, bid_amount in bids:\n        if bid_amount > highest_bid or (bid_amount == highest_bid and bidder < highest_bidder):\n            highest_bidder = bidder\n            highest_bid = bid_amount\n    return highest_bidder\n", "entry_point": "find_highest_bidder", "input": "[('Alice', 50), ('Jerry', 90), ('Tom', 100)]", "output": "'Tom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32734_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004897", "code": "def find_subarray_sum_indices(nums):\n    cumulative_sums = {0: -1}\n    cumulative_sum = 0\n    result = []\n    for index, num in enumerate(nums):\n        cumulative_sum += num\n        if cumulative_sum in cumulative_sums:\n            result = [cumulative_sums[cumulative_sum] + 1, index]\n            return result\n        cumulative_sums[cumulative_sum] = index\n    return result\n", "entry_point": "find_subarray_sum_indices", "input": "[0]", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56814_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004898", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3303", "output": "{1, 3, 3303, 9, 1101, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004899", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6599", "output": "{1, 6599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004900", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 7, 9, 7, 3, 7, 3]", "output": "[3, 8, 11, 10, 7, 12, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004901", "code": "def generate_url(route_pattern, request_id):\n    return route_pattern.replace(\"{request_id}\", str(request_id))\n", "entry_point": "generate_url", "input": "'/api-{request_id}', 'r.cv'", "output": "'/api-r.cv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10596_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004902", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[0, 12, 1, 2, 3]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004903", "code": "import re\ndef extract_app_details(code_snippet):\n    app_details = {}\n    app_name_match = re.search(r'app_name = \"(.*?)\"', code_snippet)\n    if app_name_match:\n        app_details['name'] = app_name_match.group(1)\n    app_title_match = re.search(r'app_title = \"(.*?)\"', code_snippet)\n    if app_title_match:\n        app_details['title'] = app_title_match.group(1)\n    app_publisher_match = re.search(r'app_publisher = \"(.*?)\"', code_snippet)\n    if app_publisher_match:\n        app_details['publisher'] = app_publisher_match.group(1)\n    app_description_match = re.search(r'app_description = \"(.*?)\"', code_snippet)\n    if app_description_match:\n        app_details['description'] = app_description_match.group(1)\n    app_icon_match = re.search(r'app_icon = \"(.*?)\"', code_snippet)\n    if app_icon_match:\n        app_details['icon'] = app_icon_match.group(1)\n    app_color_match = re.search(r'app_color = \"(.*?)\"', code_snippet)\n    if app_color_match:\n        app_details['color'] = app_color_match.group(1)\n    app_email_match = re.search(r'app_email = \"(.*?)\"', code_snippet)\n    if app_email_match:\n        app_details['email'] = app_email_match.group(1)\n    app_license_match = re.search(r'app_license = \"(.*?)\"', code_snippet)\n    if app_license_match:\n        app_details['license'] = app_license_match.group(1)\n    app_include_css_match = re.search(r'app_include_css = \"(.*?)\"', code_snippet)\n    if app_include_css_match:\n        app_details['include_css'] = app_include_css_match.group(1)\n    return app_details\n", "entry_point": "extract_app_details", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14765_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004904", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[5, 3, 3, 3]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1229", "output": "{1, 1229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1228", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "285", "output": "{1, 3, 5, 15, 19, 57, 285, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004907", "code": "from typing import List\ndef find_missing_numbers(input_list: List[int]) -> List[int]:\n    if not input_list:\n        return []\n    min_val, max_val = min(input_list), max(input_list)\n    full_range = set(range(min_val, max_val + 1))\n    input_set = set(input_list)\n    missing_numbers = sorted(full_range.difference(input_set))\n    return missing_numbers\n", "entry_point": "find_missing_numbers", "input": "[1, 2, 4]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125580_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004908", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004909", "code": "from typing import List, Tuple\nfrom math import sqrt\ndef max_distance(points: List[Tuple[int, int]]) -> float:\n    max_dist = 0\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            max_dist = max(max_dist, distance)\n    return round(max_dist, 2)\n", "entry_point": "max_distance", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39213_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004910", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size = sum(file_sizes)\n    return total_size // 1024\n", "entry_point": "total_size_in_kb", "input": "[13312]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13519_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004911", "code": "def sum_of_even_squares(lst):\n    sum_even_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136278_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004912", "code": "import re\ndef validate_version(version):\n    complex_regex = \"^(.*)-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?(?:\\+(.*))$\"\n    simple_regex = \"^(.*)-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*).*\"\n    if re.match(complex_regex, version):\n        return \"Complex Version\"\n    elif re.match(simple_regex, version):\n        return \"Simple Version\"\n    else:\n        return \"Invalid Version\"\n", "entry_point": "validate_version", "input": "''", "output": "'Invalid Version'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75154_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004913", "code": "from typing import List\ndef is_sum_multiple_of_5(numbers: List[int]) -> bool:\n    total_sum = sum(numbers)\n    return total_sum % 5 == 0\n", "entry_point": "is_sum_multiple_of_5", "input": "[5]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119095_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004914", "code": "ERROR_CLONE_IN_QUARANTINE = \"Database in quarantine cannot be cloned\"\nERROR_CLONE_NOT_ALIVE = \"Database is not alive and cannot be cloned\"\nERROR_DELETE_PROTECTED = \"Database {} is protected and cannot be deleted\"\nERROR_DELETE_DEAD = \"Database {} is not alive and cannot be deleted\"\nERROR_UPGRADE_MONGO24 = \"MongoDB 2.4 cannot be upgraded by this task.\"\nERROR_UPGRADE_IN_QUARANTINE = \"Database in quarantine and cannot be upgraded.\"\nERROR_UPGRADE_IS_DEAD = \"Database is dead and cannot be upgraded.\"\nERROR_UPGRADE_NO_EQUIVALENT_PLAN = \"Source plan do not has equivalent plan to upgrade.\"\ndef get_action(error_message):\n    error_to_action = {\n        ERROR_CLONE_IN_QUARANTINE: \"No action needed\",\n        ERROR_CLONE_NOT_ALIVE: \"No action needed\",\n        ERROR_DELETE_PROTECTED: \"No action needed\",\n        ERROR_DELETE_DEAD: \"No action needed\",\n        ERROR_UPGRADE_MONGO24: \"No action needed\",\n        ERROR_UPGRADE_IN_QUARANTINE: \"No action needed\",\n        ERROR_UPGRADE_IS_DEAD: \"No action needed\",\n        ERROR_UPGRADE_NO_EQUIVALENT_PLAN: \"No action needed\",\n    }\n    if error_message in error_to_action:\n        return error_to_action[error_message]\n    elif error_message.startswith(\"Database\"):\n        return \"No action needed\"\n    else:\n        return \"Unknown error message\"\n", "entry_point": "get_action", "input": "'Database in quarantine cannot be cloned'", "output": "'No action needed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71785_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004915", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "11", "output": "'11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004916", "code": "def extract_internationalization_settings(code_snippet):\n    internationalization_settings = {}\n    # Split the code snippet by lines\n    lines = code_snippet.split('\\n')\n    # Flag to indicate if we are currently parsing internationalization settings\n    parsing_internationalization = False\n    for line in lines:\n        if '############################' in line:\n            parsing_internationalization = not parsing_internationalization\n        elif parsing_internationalization and '=' in line:\n            key, value = line.strip().split('=')\n            key = key.strip()\n            value = value.strip().strip(\"'\")\n            internationalization_settings[key] = value\n    return internationalization_settings\n", "entry_point": "extract_internationalization_settings", "input": "'No settings here'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114993_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004917", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rptordmo.optionptofifi'", "output": "('rptordmo', 'optionptofifi')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004918", "code": "from typing import List\ndef sum_multiples(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples", "input": "[15, 12, 9, 5]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40895_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004919", "code": "def calculate_score(playerA_deck, playerB_deck):\n    score_A = 0\n    score_B = 0\n    for card_A, card_B in zip(playerA_deck, playerB_deck):\n        if card_A > card_B:\n            score_A += 1\n        elif card_B > card_A:\n            score_B += 1\n    return (score_A, score_B)\n", "entry_point": "calculate_score", "input": "[5, 6, 3, 2, 4], [4, 3, 5, 6, 8]", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12603_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004920", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8144", "output": "{1, 2, 4, 4072, 8, 8144, 16, 2036, 1018, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8143", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004921", "code": "import re\ndef count_dropped_tables(migration_script):\n    # Regular expression pattern to match 'op.drop_table' commands\n    pattern = r\"op.drop_table\\('(\\w+)'\\)\"\n    # Find all matches of the pattern in the migration script\n    matches = re.findall(pattern, migration_script)\n    # Count the unique table names\n    dropped_tables_count = len(set(matches))\n    return dropped_tables_count\n", "entry_point": "count_dropped_tables", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126375_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004922", "code": "def evaluate_expression(expression):\n    try:\n        result = eval(expression)\n        return result\n    except ZeroDivisionError:\n        return \"Error: Division by zero\"\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "evaluate_expression", "input": "'1 + '", "output": "'Error: invalid syntax (<string>, line 1)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79055_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004923", "code": "def distribute_prize(total_prize):\n    primeiro = total_prize * 0.46\n    segundo = total_prize * 0.32\n    terceiro = total_prize - primeiro - segundo\n    return primeiro, segundo, terceiro\n", "entry_point": "distribute_prize", "input": "780000.0", "output": "(358800.0, 249600.0, 171600.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65224_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004924", "code": "import re\ndef extract_test_method_codes(text_block):\n    pattern = r'O3\\d{2}'\n    matches = re.findall(pattern, text_block)\n    descriptions = re.findall(r'(?<=O3\\d{2}\\s).*(?=\\n)', text_block)\n    test_method_codes = {match: description for match, description in zip(matches, descriptions)}\n    return test_method_codes\n", "entry_point": "extract_test_method_codes", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96340_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004925", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "15", "output": "[1, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004926", "code": "from typing import List\ndef min_energy(grid: List[List[int]]) -> int:\n    n = len(grid)\n    dp = [[float('inf')] * n for _ in range(n)]\n    dp[0][0] = grid[0][0]\n    for i in range(1, n):\n        dp[i][0] = max(1, dp[i-1][0] - grid[i][0])\n    for j in range(1, n):\n        dp[0][j] = max(1, dp[0][j-1] - grid[0][j])\n    for i in range(1, n):\n        for j in range(1, n):\n            dp[i][j] = max(1, min(dp[i-1][j], dp[i][j-1]) - grid[i][j])\n    return dp[n-1][n-1]\n", "entry_point": "min_energy", "input": "[[0, 0], [0, 0]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8460_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004927", "code": "def find_nb_range(start, end):\n    sum = 0\n    n = start\n    while True:\n        sum += n ** 3\n        if sum >= start and sum <= end:\n            return n\n        elif sum > end:\n            return -1\n        n += 1\n", "entry_point": "find_nb_range", "input": "0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61881_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004928", "code": "def update_download_status(incomplete_downloads):\n    updated_incomplete_downloads = []\n    for index, download in enumerate(incomplete_downloads):\n        if index % 2 == 0:  # Simulating successful download for odd-indexed files\n            continue\n        else:\n            updated_incomplete_downloads.append(download)\n    return updated_incomplete_downloads\n", "entry_point": "update_download_status", "input": "['goodfile', 'ffilff2']", "output": "['ffilff2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48055_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004929", "code": "def generate_output_muon_container(muon_container: str, muon_working_point: str, muon_isolation: str) -> str:\n    return f\"{muon_container}Calib_{muon_working_point}{muon_isolation}_%SYS%\"\n", "entry_point": "generate_output_muon_container", "input": "'toion', 'gTig', 'ightHigh'", "output": "'toionCalib_gTigightHigh_%SYS%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69025_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004930", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[6, 5, 4, 1, 6, 1, 7, 0]", "output": "[11, 9, 5, 7, 7, 8, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99008_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004931", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2557", "output": "{1, 2557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004932", "code": "def longest_increasing_sequence(temperatures):\n    longest_length = 0\n    current_length = 1\n    start_index = 0\n    current_start = 0\n    for i in range(1, len(temperatures)):\n        if temperatures[i] > temperatures[i - 1]:\n            current_length += 1\n            if current_length > longest_length:\n                longest_length = current_length\n                start_index = current_start\n        else:\n            current_length = 1\n            current_start = i\n    return start_index, longest_length\n", "entry_point": "longest_increasing_sequence", "input": "[1, 2, 2]", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138378_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004933", "code": "def firstDuplicateValue(array):\n    for n in array:\n        n = abs(n)\n        if array[n - 1] < 0:\n            return n\n        array[n - 1] *= -1\n    return -1\n", "entry_point": "firstDuplicateValue", "input": "[2, 3, 3, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124309_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004934", "code": "import re\ndef remove_color_codes(text):\n    return re.sub('(\u00a7[0-9a-f])', '', text)\n", "entry_point": "remove_color_codes", "input": "'wolrl\u00a7a\u00a7r!'", "output": "'wolrl\u00a7r!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50171_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004935", "code": "def calculate_total_cost(output):\n    total_cost = 0\n    lines = output.strip().split('\\n')\n    for line in lines:\n        cost_str = line.split()[1].split('@')[0]\n        total_cost += int(cost_str)\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "'item1 3@someinfo\\nitem2 5@otherinfo'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1054_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004936", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'MgMMgggg'", "output": "'MgMMgggg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004937", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004938", "code": "def dot_product(a, b):\n    if len(a) != len(b):\n        raise ValueError(\"Input vectors must have the same length.\")\n    result = 0\n    for ai, bi in zip(a, b):\n        result += ai * bi\n    return result\n", "entry_point": "dot_product", "input": "[0, 0], [0, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10235_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004939", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[5, 3, 7, 4, 2, 1, 0, 2, 0], 0, 9", "output": "[5, 3, 7, 4, 2, 1, 0, 2, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6269", "output": "{1, 6269}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004941", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4826", "output": "{1, 2, 38, 2413, 19, 4826, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004942", "code": "def generate_timestamps(frequency, duration):\n    timestamps = []\n    for sec in range(0, duration+1, frequency):\n        hours = sec // 3600\n        minutes = (sec % 3600) // 60\n        seconds = sec % 60\n        timestamp = f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n        timestamps.append(timestamp)\n    return timestamps\n", "entry_point": "generate_timestamps", "input": "8, 24", "output": "['00:00:00', '00:00:08', '00:00:16', '00:00:24']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12595_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004943", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9426", "output": "{1, 2, 3, 1571, 3142, 6, 4713, 9426}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004944", "code": "import ast\ndef extract_author_info(module_content):\n    author_info = {}\n    module_ast = ast.parse(module_content)\n    for node in module_ast.body:\n        if isinstance(node, ast.Assign):\n            for target in node.targets:\n                if isinstance(target, ast.Name) and target.id.startswith('__') and target.id != '__doc__':\n                    key = target.id.lstrip('_')\n                    value = ast.literal_eval(node.value)\n                    author_info[key] = value\n    return author_info\n", "entry_point": "extract_author_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65116_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004945", "code": "def count_consecutive_doubles(s: str) -> int:\n    count = 0\n    for i in range(len(s) - 1):\n        if s[i] == s[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_consecutive_doubles", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35710_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004946", "code": "from typing import List\ndef determine_winner(deck: List[int]) -> str:\n    player1_score = 0\n    player2_score = 0\n    current_player = 1\n    for card in deck:\n        if current_player == 1:\n            player1_score += card\n            current_player = 2\n        else:\n            player2_score += card\n            current_player = 1\n    if player1_score > player2_score:\n        return \"Player 1\"\n    elif player2_score > player1_score:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "determine_winner", "input": "[3, 1, 4, 1, 5]", "output": "'Player 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140728_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004947", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(0, 1, 0, 0, 1, 0)", "output": "'0.1.0.0.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004948", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[1, 3, 5, 7, 9]", "output": "[81, 49, 25, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004949", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6849", "output": "{1, 6849, 3, 9, 2283, 761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004950", "code": "import string\ndef count_unique_punctuation(text):\n    unique_punctuation = set()\n    for char in text:\n        if char in string.punctuation:\n            unique_punctuation.add(char)\n    return len(unique_punctuation)\n", "entry_point": "count_unique_punctuation", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102564_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004951", "code": "def max_product_of_three(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of first two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 3, 5, 5]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11525_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004952", "code": "from typing import List\ndef sum_of_squares_of_evens(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total_sum += num ** 2  # Add the square of the even number to the total sum\n    return total_sum\n", "entry_point": "sum_of_squares_of_evens", "input": "[4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16571_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004953", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'quickjsumps'", "output": "['quickjsumps']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004954", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hello'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004955", "code": "def min_edit_distance(source, target):\n    slen, tlen = len(source), len(target)\n    dist = [[0 for _ in range(tlen+1)] for _ in range(slen+1)]\n    for i in range(slen+1):\n        dist[i][0] = i\n    for j in range(tlen+1):\n        dist[0][j] = j\n    for i in range(slen):\n        for j in range(tlen):\n            cost = 0 if source[i] == target[j] else 1\n            dist[i+1][j+1] = min(\n                dist[i][j+1] + 1,   # deletion\n                dist[i+1][j] + 1,   # insertion\n                dist[i][j] + cost   # substitution\n            )\n    return dist[-1][-1]\n", "entry_point": "min_edit_distance", "input": "'cat', 'dog'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126361_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004956", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2242", "output": "{1, 2242, 2, 1121, 38, 19, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2241", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004957", "code": "def top_three_scores(scores):\n    unique_scores = set(scores)\n    sorted_scores = sorted(unique_scores, reverse=True)\n    if len(sorted_scores) >= 3:\n        return sorted_scores[:3]\n    else:\n        return sorted_scores\n", "entry_point": "top_three_scores", "input": "[100, 92, 89, 85, 85, 82]", "output": "[100, 92, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99287_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004958", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[1, 2, 3, 3, 3, 3]", "output": "[(3, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004959", "code": "from typing import List\ndef calculate_accuracy(test_results: List[int]) -> float:\n    num_reads = 0\n    num_correct = 0\n    for result in test_results:\n        num_reads += 1\n        if result == 1:\n            num_correct += 1\n    if num_reads == 0:\n        return 0.0\n    else:\n        return (num_correct / num_reads) * 100\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 0, 0, 0, 0, 0, 0, 0]", "output": "22.22222222222222", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10794_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004960", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004961", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'oSKool'", "output": "['oSKool']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004962", "code": "def generate_matrix(n):\n    matriz = [[0 for _ in range(n)] for _ in range(n)]\n    for diagonal_principal in range(n):\n        matriz[diagonal_principal][diagonal_principal] = 2\n    for diagonal_secundaria in range(n):\n        matriz[diagonal_secundaria][n - 1 - diagonal_secundaria] = 3\n    for linha in range(n // 3, n - n // 3):\n        for coluna in range(n // 3, n - n // 3):\n            matriz[linha][coluna] = 1\n    return matriz\n", "entry_point": "generate_matrix", "input": "2", "output": "[[1, 1], [1, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23096_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004963", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 6, 8, 8, 3, 3, 5]", "output": "[4, 6, 8, 8, 9, 9, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9593", "output": "{1, 181, 53, 9593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004965", "code": "def sum_of_squares(lst):\n    sum_squares = 0\n    for num in lst:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[3, 3, 3]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36660_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004966", "code": "def convert_risk_to_chinese(risk):\n    risk_mapping = {\n        'None': 'None',\n        'Low': '\u4f4e\u5371',\n        'Medium': '\u4e2d\u5371',\n        'High': '\u9ad8\u5371',\n        'Critical': '\u4e25\u91cd'\n    }\n    return risk_mapping.get(risk, 'Unknown')  # Return the Chinese risk level or 'Unknown' if not found\n", "entry_point": "convert_risk_to_chinese", "input": "'Extreme'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46692_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3254", "output": "{1, 2, 1627, 3254}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3253", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004968", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[10, 20, 15, 25, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004969", "code": "import logging\ndef count_log_levels(module_name):\n    try:\n        module = __import__(module_name)\n        if hasattr(module, 'LOG_LEVELS'):\n            log_levels = getattr(module, 'LOG_LEVELS')\n            return len(set(log_levels.keys()))\n        else:\n            return 0\n    except (ImportError, AttributeError):\n        return 0\n", "entry_point": "count_log_levels", "input": "'non_existent_module'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85706_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004970", "code": "from typing import List, Dict\ndef count_transaction_types(transaction_types: List[str]) -> Dict[str, int]:\n    transaction_count = {}\n    for transaction_type in transaction_types:\n        if transaction_type in transaction_count:\n            transaction_count[transaction_type] += 1\n        else:\n            transaction_count[transaction_type] = 1\n    return transaction_count\n", "entry_point": "count_transaction_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86051_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004971", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average = total_sum / total_students\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[73, 74, 75]", "output": "74", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48784_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004972", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4412", "output": "{1, 2, 4, 1103, 4412, 2206}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4411", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3505", "output": "{1, 3505, 5, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004974", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    numbers.sort()\n    n = len(numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return float(numbers[n // 2])\n    else:  # Even number of elements\n        mid1 = numbers[n // 2 - 1]\n        mid2 = numbers[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[3, 4, 5]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95265_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004975", "code": "import math\ndef calculate_distances(points):\n    distances = {}\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            distances[(points[i], points[j])] = distance\n    return distances\n", "entry_point": "calculate_distances", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67685_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004976", "code": "def count_chars_above_threshold(strings, threshold):\n    total_chars = 0\n    for string in strings:\n        if len(string) > threshold:\n            total_chars += len(string)\n    return total_chars\n", "entry_point": "count_chars_above_threshold", "input": "['abcd', 'abcdefgh', 'hi', 'cat'], 3", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_466_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004977", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 80, 82, 84, 100]", "output": "82.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22350_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004978", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'@ 2!l#l$'", "output": "' 2ll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004979", "code": "def get_parent_directory(file_path):\n    parent_dir = ''\n    for char in file_path[::-1]:\n        if char in ('/', '\\\\'):\n            break\n        parent_dir = char + parent_dir\n    return parent_dir\n", "entry_point": "get_parent_directory", "input": "'C:/User/Documents/Programfi'", "output": "'Programfi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48400_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004980", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5134", "output": "{1, 2, 34, 2567, 5134, 302, 17, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5133", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004981", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'LLQ'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004982", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9643", "output": "{1, 9643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004983", "code": "def str_between(input_str: str, left: str, right: str) -> str:\n    left_index = input_str.find(left)\n    if left_index == -1:\n        return \"\"\n    right_index = input_str.find(right, left_index + len(left))\n    if right_index == -1:\n        return \"\"\n    return input_str[left_index + len(left):right_index]\n", "entry_point": "str_between", "input": "'Hello World', 'A', 'B'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96216_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004984", "code": "def find_floor_crossing_index(parentheses):\n    floor = 0\n    for i, char in enumerate(parentheses, start=1):\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        else:\n            raise ValueError(\"Invalid character in input string\")\n        if floor == -1:\n            return i\n    return -1  # If floor never reaches -1\n", "entry_point": "find_floor_crossing_index", "input": "'(()))'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17635_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004985", "code": "def process_numbers(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num * 5)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "process_numbers", "input": "[5, 0, 2, 6, 3, 7]", "output": "[5, 0, 4, 30, 27, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146375_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8861", "output": "{1, 8861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004987", "code": "# Simulated database table with sample data\ndatabase_table = {\n    (1, 101): True,\n    (2, 102): True,\n    (3, 103): False,\n    (4, 104): True,\n}\ndef get_article_author_id(article_id, author_id):\n    # Simulated database query to check if the combination exists\n    return 1 if database_table.get((article_id, author_id), False) else 0\n", "entry_point": "get_article_author_id", "input": "1, 101", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33510_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004988", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'Hell,Hello, \u4f60\u597d'", "output": "b'Hell,Hello, \\xe4\\xbd\\xa0\\xe5\\xa5\\xbd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004989", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "12, 2", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004990", "code": "def max_product(nums):\n    max1 = float('-inf')\n    max2 = float('-inf')\n    min1 = float('inf')\n    min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, max1 * min1)\n", "entry_point": "max_product", "input": "[8, 8]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14792_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004991", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[1, 0, 3, 2, 5, 6]", "output": "[0, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004992", "code": "import json\ndef submit_token(token, data):\n    try:\n        submission_data = json.loads(data)\n    except json.JSONDecodeError:\n        return \"Error\", \"Invalid JSON data provided\"\n    # Simulate token submission process (replace with actual service interaction)\n    success_message = \"Success\"\n    notes = [\"Note 1\", \"Note 2\"]  # Simulated notes from the service\n    return success_message, notes\n", "entry_point": "submit_token", "input": "'some_token', '{abc}'", "output": "('Error', 'Invalid JSON data provided')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33498_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5125", "output": "{1, 1025, 5, 5125, 41, 205, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5124", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004994", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    seen = set()  # To avoid counting multiples of both 3 and 5 twice\n    for num in numbers:\n        if num in seen:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 6, 18]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23493_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8445", "output": "{1, 3, 5, 15, 563, 1689, 8445, 2815}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004996", "code": "import importlib\ndef import_modules(module_names):\n    imported_modules = {}\n    for module_name in module_names:\n        try:\n            imported_module = importlib.import_module(module_name)\n            imported_modules[module_name] = imported_module\n        except ModuleNotFoundError:\n            imported_modules[module_name] = None\n    return imported_modules\n", "entry_point": "import_modules", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36198_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004997", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "572", "output": "{1, 2, 4, 11, 44, 13, 143, 52, 22, 26, 572, 286}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt571", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004998", "code": "def format_command_usage(name, desc, usage_template):\n    return usage_template.format(name=name, desc=desc)\n", "entry_point": "format_command_usage", "input": "'fsl_ents', '', '{name}:'", "output": "'fsl_ents:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41916_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0004999", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6986", "output": "{1, 2, 3493, 998, 7, 6986, 14, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005000", "code": "def calculate_probability_of_dominant(k, m, n):\n    population = k + m + n\n    pK = k / population\n    pMK = (m / population) * (k / (population - 1.0))\n    pMM = (m / population) * ((m - 1.0) / (population - 1.0)) * 0.75\n    pMN = (m / population) * (n / (population - 1.0)) * 0.5\n    pNK = (n / population) * (k / (population - 1.0))\n    pNM = (n / population) * (m / (population - 1.0)) * 0.5\n    result = pK + pMK + pMM + pMN + pNK + pNM\n    return result\n", "entry_point": "calculate_probability_of_dominant", "input": "2, 2, 2", "output": "0.7833333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130629_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005001", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "10", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005002", "code": "query = {\n    \"sideMovementLeft\": \"Moving left.\",\n    \"sideMovementRight\": \"Moving right.\",\n    \"invalidMovement\": \"Invalid movement direction.\"\n}\ndef leftRightMovement(directionS):\n    if directionS == \"left\":\n        response = query[\"sideMovementLeft\"]\n    elif directionS == \"right\":\n        response = query[\"sideMovementRight\"]\n    else:\n        response = query[\"invalidMovement\"]\n    return response\n", "entry_point": "leftRightMovement", "input": "'up'", "output": "'Invalid movement direction.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138962_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005003", "code": "def calculate_video_duration(fps, total_frames):\n    total_duration = total_frames / fps\n    return round(total_duration, 2)\n", "entry_point": "calculate_video_duration", "input": "30, 898", "output": "29.93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131697_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005004", "code": "from typing import List\ndef merge_sorted_arrays(nums1: List[int], nums2: List[int]) -> List[int]:\n    sorted_array = []\n    nums1_index, nums2_index = 0, 0\n    while nums1_index < len(nums1) and nums2_index < len(nums2):\n        num1, num2 = nums1[nums1_index], nums2[nums2_index]\n        if num1 <= num2:\n            sorted_array.append(num1)\n            nums1_index += 1\n        else:\n            sorted_array.append(num2)\n            nums2_index += 1\n    sorted_array.extend(nums1[nums1_index:])\n    sorted_array.extend(nums2[nums2_index:])\n    return sorted_array\n", "entry_point": "merge_sorted_arrays", "input": "[2, 4, 4, 4], [2, 5, 6, 6, 7]", "output": "[2, 2, 4, 4, 4, 5, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90744_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005005", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[2, 2, 2, 1, 1, 1, 3]", "output": "{2: 3, 1: 3, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005006", "code": "def max_points(grid):\n    rows, cols = len(grid), len(grid[0])\n    # Initialize a 2D list to store the maximum points at each position\n    dp = [[0] * cols for _ in range(rows)]\n    # Initialize the first position with its points\n    dp[0][0] = grid[0][0]\n    # Update the first row\n    for col in range(1, cols):\n        dp[0][col] = dp[0][col - 1] + grid[0][col]\n    # Update the first column\n    for row in range(1, rows):\n        dp[row][0] = dp[row - 1][0] + grid[row][0]\n    # Update the rest of the grid\n    for row in range(1, rows):\n        for col in range(1, cols):\n            dp[row][col] = grid[row][col] + max(dp[row - 1][col], dp[row][col - 1])\n    return dp[rows - 1][cols - 1]\n", "entry_point": "max_points", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90205_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005007", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005008", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7067", "output": "{1, 7067, 37, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005009", "code": "def parse_command(command):\n    parts = command.split()\n    if len(parts) < 3:\n        return \"Invalid command\"\n    operation = parts[0]\n    num1 = float(parts[1])\n    num2 = float(parts[2])\n    if operation == 'add':\n        return num1 + num2\n    elif operation == 'subtract':\n        return num1 - num2\n    elif operation == 'multiply':\n        return num1 * num2\n    elif operation == 'divide':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Division by zero is not allowed\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "parse_command", "input": "'add 6.0 7.0'", "output": "13.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24855_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005010", "code": "def min_changes_to_anagram(bigger_str, smaller_str):\n    str_counter = {}\n    for char in bigger_str:\n        if char in str_counter:\n            str_counter[char] += 1\n        else:\n            str_counter[char] = 1\n    for char in smaller_str:\n        if char in str_counter:\n            str_counter[char] -= 1\n    needed_changes = 0\n    for counter in str_counter.values():\n        needed_changes += abs(counter)\n    return needed_changes\n", "entry_point": "min_changes_to_anagram", "input": "'aabbccdddeeef', 'abcdefg'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124427_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005011", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a draw\"\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3], [3, 4, 5]", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64608_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005012", "code": "def find_most_common_element(lst):\n    element_count = {}\n    for element in lst:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common_element = max(element_count, key=element_count.get)\n    return most_common_element\n", "entry_point": "find_most_common_element", "input": "[-1, -1, 0, 1, 2]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14063_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005013", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[5, 8, 10, 15], 1, 2", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005014", "code": "# Dictionary mapping ANSI escape codes to substrings\nansi_to_substring = {\n    '\\x1b[91;1m': '+m',\n    '\\x1b[92;1m': '+h',\n    '\\x1b[93;1m': '+k',\n    '\\x1b[94;1m': '+b',\n    '\\x1b[95;1m': '+u',\n    '\\x1b[96;1m': '+c',\n    '\\x1b[97;1m': '+p',\n    '\\x1b[98;1m': '+w',\n    '\\x1b[0m': '+0'\n}\ndef decode(text):\n    for ansi_code, substring in ansi_to_substring.items():\n        text = text.replace(ansi_code, substring)\n    return text\n", "entry_point": "decode", "input": "'World\\x1b[0m!'", "output": "'World+0!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18500_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005015", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[5, 6], 11", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005016", "code": "def merge_lists(tds, tbs):\n    tas = []\n    # Append elements from tds in order\n    for element in tds:\n        tas.append(element)\n    # Append elements from tbs in reverse order\n    for element in reversed(tbs):\n        tas.append(element)\n    return tas\n", "entry_point": "merge_lists", "input": "[0, 1, -1, 1, 2, 2], [6, 3, 8, 2, 0]", "output": "[0, 1, -1, 1, 2, 2, 0, 2, 8, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146813_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005017", "code": "def calculate_score(playerA_deck, playerB_deck):\n    score_A = 0\n    score_B = 0\n    for card_A, card_B in zip(playerA_deck, playerB_deck):\n        if card_A > card_B:\n            score_A += 1\n        elif card_B > card_A:\n            score_B += 1\n    return (score_A, score_B)\n", "entry_point": "calculate_score", "input": "[2, 3, 1, 5, 4], [3, 4, 5, 6, 2]", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12603_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005018", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005019", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1121", "output": "{1, 19, 59, 1121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005020", "code": "def determinant(matrix):\n    size = len(matrix)\n    if size == 1:\n        return matrix[0][0]\n    elif size == 2:\n        return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]\n    else:\n        det = 0\n        for i in range(size):\n            sign = (-1) ** i\n            submatrix = [row[:i] + row[i+1:] for row in matrix[1:]]\n            det += sign * matrix[0][i] * determinant(submatrix)\n        return det\n", "entry_point": "determinant", "input": "[[1, 2], [2, 1]]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37266_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005021", "code": "def longest_subarray_with_distinct_elements(k):\n    n = len(k)\n    hashmap = dict()\n    j = 0\n    ans = 0\n    c = 0\n    for i in range(n):\n        if k[i] in hashmap and hashmap[k[i]] > 0:\n            while i > j and k[i] in hashmap and hashmap[k[i]] > 0:\n                hashmap[k[j]] -= 1\n                j += 1\n                c -= 1\n        hashmap[k[i]] = 1\n        c += 1\n        ans = max(ans, c)\n    return ans\n", "entry_point": "longest_subarray_with_distinct_elements", "input": "[1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37610_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005022", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[96, 95, 95, 90]", "output": "[96, 95, 95]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005023", "code": "def sum_multiples_of_3_or_5(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44443_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005024", "code": "def calculate_score(accuracy):\n    if accuracy >= 0.92:\n        score = 10\n    elif accuracy >= 0.9:\n        score = 9\n    elif accuracy >= 0.85:\n        score = 8\n    elif accuracy >= 0.8:\n        score = 7\n    elif accuracy >= 0.75:\n        score = 6\n    elif accuracy >= 0.70:\n        score = 5\n    else:\n        score = 4\n    return score\n", "entry_point": "calculate_score", "input": "0.76", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22276_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005025", "code": "def sum_of_squares(lst):\n    sum_squares = 0\n    for num in lst:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[1, 2, 3]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36660_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005026", "code": "from typing import List\nDIGIT_WORDS = [str(\"Zero\"), str(\"One\"), str(\"Two\"), str(\"Three\"), str(\"Four\"), str(\"Five\"), str(\"Six\"), str(\"Seven\"), str(\"Eight\"), str(\"Nine\"), str(\"Ten\")]\ndef convert_to_words(numbers: List[int]) -> List[str]:\n    result = []\n    for num in numbers:\n        if 0 <= num <= 10:\n            result.append(DIGIT_WORDS[num])\n        else:\n            result.append(\"Unknown\")\n    return result\n", "entry_point": "convert_to_words", "input": "[6, 11, 6, 6]", "output": "['Six', 'Unknown', 'Six', 'Six']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89715_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2514", "output": "{1, 2, 3, 419, 838, 6, 1257, 2514}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005028", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[100, 90, 90, 89, 85, 85, 80]", "output": "90.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005029", "code": "def filter_gt_avg(numbers):\n    if not numbers:\n        return []\n    avg = sum(numbers) / len(numbers)\n    return [num for num in numbers if num > avg]\n", "entry_point": "filter_gt_avg", "input": "[8, 9, 10, 10]", "output": "[10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15446_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4225", "output": "{1, 4225, 65, 5, 325, 169, 13, 845, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4224", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005031", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1916", "output": "{1, 2, 4, 1916, 958, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1915", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005032", "code": "def extract_purpose(text: str) -> str:\n    start_index = text.find('\"\"\"')  # Find the first occurrence of triple double quotes\n    if start_index == -1:\n        return \"No primary purpose found.\"\n    end_index = text.find('\"\"\"', start_index + 3)  # Find the end of the triple double quotes\n    if end_index == -1:\n        return \"No closing triple double quotes found.\"\n    return text[start_index + 3:end_index].strip()  # Extract and return the text within the triple double quotes\n", "entry_point": "extract_purpose", "input": "''", "output": "'No primary purpose found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46897_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005033", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[10, 5, 3]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005034", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[5, 6, -1, 0, 2, -1, 6, 2]", "output": "[-1, -1, 0, 2, 2, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005035", "code": "def max_product_of_three(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # First two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 5, 25]", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99666_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005036", "code": "def _clean_binary_segmentation(input, percentile):\n    sorted_input = sorted(input)\n    threshold_index = int(len(sorted_input) * percentile / 100)\n    below_percentile = sorted_input[:threshold_index]\n    equal_above_percentile = sorted_input[threshold_index:]\n    return below_percentile, equal_above_percentile\n", "entry_point": "_clean_binary_segmentation", "input": "[3, 4, 35, 40, 50], 40", "output": "([3, 4], [35, 40, 50])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96298_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005037", "code": "def sum_divisible_by_3_and_5(ys):\n    total_sum = 0\n    for num in ys:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4118_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2533", "output": "{1, 2533, 17, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005039", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 5, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9009_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005040", "code": "def calculate_operations(results):\n    calculated_results = []\n    for i in range(0, len(results), 2):\n        operand1 = results[i]\n        operand2 = results[i + 1]\n        expected_result = results[i + 1]\n        if operand1 + operand2 == expected_result:\n            calculated_results.append(operand1 + operand2)\n        elif operand1 - operand2 == expected_result:\n            calculated_results.append(operand1 - operand2)\n        elif operand1 * operand2 == expected_result:\n            calculated_results.append(operand1 * operand2)\n        elif operand1 // operand2 == expected_result:\n            calculated_results.append(operand1 // operand2)\n    return calculated_results\n", "entry_point": "calculate_operations", "input": "[1, 2, 1, 1]", "output": "[2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21926_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005041", "code": "def modular_inverse(a, m):\n    def egcd(a, b):\n        if a == 0:\n            return (b, 0, 1)\n        else:\n            g, x, y = egcd(b % a, a)\n            return (g, y - (b // a) * x, x)\n    g, x, y = egcd(a, m)\n    if g != 1:\n        return None\n    else:\n        return x % m\n", "entry_point": "modular_inverse", "input": "5, 12", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35681_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005042", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "134", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005043", "code": "def validate_variable_range(var_name, var_value, range_str):\n    error_message = \"\"\n    if var_value is None:\n        var_value = \"\"\n        error_message = f\"Variable \\\"{var_name}\\\" not found (i.e. it's undefined).\\n\"\n    else:\n        range_values = range_str.split(\"..\")\n        range_min = int(range_values[0]) if range_values[0] else None\n        range_max = int(range_values[1]) if range_values[1] else None\n        # Validate var_value against the specified range\n        if not (range_min is None or (range_min <= var_value <= range_max)):\n            error_message = f\"Variable \\\"{var_name}\\\" is outside the specified range.\\n\"\n    if error_message:\n        error_message = error_message.capitalize()\n        error_message = error_message.replace(\"\\n\", \" \")\n        error_message = error_message.strip()\n        error_message = f\"Error: {error_message}\"\n    return error_message\n", "entry_point": "validate_variable_range", "input": "'test_variable', 5, '0..10'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46411_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005044", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "3", "output": "'III'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005045", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "1.92, 1", "output": "1.92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt29", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005046", "code": "import logging\ndef process_serial_data(data_str):\n    logging.info(\"Initializing data processing\")\n    data_dict = {}\n    pairs = data_str.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        data_dict[key] = value\n    return data_dict\n", "entry_point": "process_serial_data", "input": "'ekkey:v3e'", "output": "{'ekkey': 'v3e'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86728_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005047", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'home/user/hom', 'templa'", "output": "'home/user/hom/templa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005048", "code": "def latest_supported_api_version(input_date):\n    supported_api_versions = [\n        '2019-02-02',\n        '2019-07-07',\n        '2019-12-12',\n        '2020-02-10',\n    ]\n    for version in reversed(supported_api_versions):\n        if input_date >= version:\n            return version\n    return 'No supported API version available'\n", "entry_point": "latest_supported_api_version", "input": "'2019-01-01'", "output": "'No supported API version available'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134418_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005049", "code": "from typing import List\ndef longest_common_prefix(strings: List[str]) -> str:\n    if not strings:\n        return \"\"\n    prefix = strings[0]\n    for string in strings[1:]:\n        i = 0\n        while i < len(prefix) and i < len(string) and prefix[i] == string[i]:\n            i += 1\n        prefix = prefix[:i]\n        if not prefix:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "['flower', 'flow', 'flight']", "output": "'fl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135664_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005050", "code": "def generateMatrix(n: int) -> [[int]]:\n    def fillMatrix(matrix, top, bottom, left, right, num):\n        if top > bottom or left > right:\n            return\n        # Fill top row\n        for i in range(left, right + 1):\n            matrix[top][i] = num\n            num += 1\n        top += 1\n        # Fill right column\n        for i in range(top, bottom + 1):\n            matrix[i][right] = num\n            num += 1\n        right -= 1\n        # Fill bottom row\n        if top <= bottom:\n            for i in range(right, left - 1, -1):\n                matrix[bottom][i] = num\n                num += 1\n            bottom -= 1\n        # Fill left column\n        if left <= right:\n            for i in range(bottom, top - 1, -1):\n                matrix[i][left] = num\n                num += 1\n            left += 1\n        fillMatrix(matrix, top, bottom, left, right, num)\n    matrix = [[None for _ in range(n)] for _ in range(n)]\n    fillMatrix(matrix, 0, n - 1, 0, n - 1, 1)\n    return matrix\n", "entry_point": "generateMatrix", "input": "3", "output": "[[1, 2, 3], [8, 9, 4], [7, 6, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97938_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005051", "code": "def divisible_count(x, y, k):\n    count_y = (k * (y // k + 1) - 1) // k\n    count_x = (k * ((x - 1) // k + 1) - 1) // k\n    return count_y - count_x\n", "entry_point": "divisible_count", "input": "1, 16, 1", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144622_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005052", "code": "def get_child_objects(locationDict: dict, parentId: int, zoneId: int = None) -> list:\n    parent = locationDict.get(parentId)\n    if parent is None:\n        return []\n    if zoneId is None:\n        children = []\n        for zone in parent.values():\n            for iObject in zone:\n                children.append(iObject)\n    else:\n        children = parent.get(zoneId, [])\n    return children\n", "entry_point": "get_child_objects", "input": "{}, 99", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101403_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005053", "code": "def count_ways_to_climb_stairs(n: int) -> int:\n    if n <= 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "7", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16452_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005054", "code": "def parse_command(command):\n    parts = command.split()\n    if len(parts) < 3:\n        return \"Invalid command\"\n    operation = parts[0]\n    num1 = float(parts[1])\n    num2 = float(parts[2])\n    if operation == 'add':\n        return num1 + num2\n    elif operation == 'subtract':\n        return num1 - num2\n    elif operation == 'multiply':\n        return num1 * num2\n    elif operation == 'divide':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Division by zero is not allowed\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "parse_command", "input": "'add 3'", "output": "'Invalid command'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24855_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005055", "code": "def solution(s):\n    start = 0\n    end = len(s) - 1\n    while start < len(s) and not s[start].isalnum():\n        start += 1\n    while end >= 0 and not s[end].isalnum():\n        end -= 1\n    return s[start:end+1]\n", "entry_point": "solution", "input": "'z'", "output": "'z'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114817_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005056", "code": "def basic_calculator(num1, num2, operation):\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Error: Division by zero!\"\n    else:\n        return \"Error: Invalid operation!\"\n", "entry_point": "basic_calculator", "input": "25, 25, '+'", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109294_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005057", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9809", "output": "{9809, 1, 17, 577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005058", "code": "def process_circular_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        output_list.append(input_list[i] + input_list[(i + 1) % len(input_list)])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131123_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005059", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'C_C_NC_NNC_N'", "output": "'No occurrences found for bond type C_C_NC_NNC_N'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005060", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[10]", "output": "(10, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005061", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'456 7.89'", "output": "(7.89, 456)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005062", "code": "from typing import List\ndef calculate_max_score(scores: List[int]) -> int:\n    if not scores:\n        return 0\n    n = len(scores)\n    if n == 1:\n        return scores[0]\n    dp = [0] * n\n    dp[0] = scores[0]\n    dp[1] = max(scores[0], scores[1])\n    for i in range(2, n):\n        dp[i] = max(scores[i] + dp[i - 2], dp[i - 1])\n    return dp[-1]\n", "entry_point": "calculate_max_score", "input": "[3, 2, 7, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64203_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005063", "code": "def extract_version(input_string):\n    start_index = input_string.find('\"') + 1\n    end_index = input_string.find('\"', start_index)\n    if start_index != -1 and end_index != -1:\n        return input_string[start_index:end_index]\n    else:\n        return None\n", "entry_point": "extract_version", "input": "'Version: \"0.3.0+d563e1=\" The latest'", "output": "'0.3.0+d563e1='", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48779_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005064", "code": "def get_framework_abbreviation(framework_name):\n    frameworks = {\n        'pytorch': 'PT',\n        'tensorflow': 'TF',\n        'keras': 'KS',\n        'caffe': 'CF'\n    }\n    lowercase_framework = framework_name.lower()\n    if lowercase_framework in frameworks:\n        return frameworks[lowercase_framework]\n    else:\n        return 'Unknown'\n", "entry_point": "get_framework_abbreviation", "input": "'pytorch'", "output": "'PT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121670_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005065", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'abcdn'", "output": "'n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4175", "output": "{1, 835, 5, 167, 4175, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4174", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005067", "code": "from typing import List\ndef calculate_visible_skyline(building_heights: List[int]) -> int:\n    total_visible_skyline = 0\n    stack = []\n    for height in building_heights:\n        while stack and height > stack[-1]:\n            total_visible_skyline += stack.pop()\n        stack.append(height)\n    total_visible_skyline += sum(stack)\n    return total_visible_skyline\n", "entry_point": "calculate_visible_skyline", "input": "[10, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39592_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005068", "code": "def sum_of_squares_of_even_numbers(input_list):\n    sum_of_squares = 0\n    for num in input_list:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[4, 8]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113006_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005069", "code": "# Define the memory protection constants and their attributes\nMEMORY_PROTECTION_ATTRIBUTES = {\n    0x01: ['PAGE_NOACCESS'],\n    0x02: ['PAGE_READONLY'],\n    0x04: ['PAGE_READWRITE'],\n    0x08: ['PAGE_WRITECOPY'],\n    0x100: ['PAGE_GUARD'],\n    0x200: ['PAGE_NOCACHE'],\n    0x400: ['PAGE_WRITECOMBINE'],\n    0x40000000: ['PAGE_TARGETS_INVALID', 'PAGE_TARGETS_NO_UPDATE']\n}\ndef get_protection_attributes(memory_protection):\n    attributes = []\n    for constant, attr_list in MEMORY_PROTECTION_ATTRIBUTES.items():\n        if memory_protection & constant:\n            attributes.extend(attr_list)\n    return attributes\n", "entry_point": "get_protection_attributes", "input": "5", "output": "['PAGE_NOACCESS', 'PAGE_READWRITE']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63843_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005070", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'r1234'", "output": "'1234'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005071", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[5, 5, 7, 7], 4", "output": "[4, 5, 5, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4274", "output": "{2137, 1, 4274, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005073", "code": "def process_integers(integer_list):\n    total = 0\n    for num in integer_list:\n        if num > 0:\n            total += num ** 2\n        elif num < 0:\n            total -= abs(num) / 2\n    return total\n", "entry_point": "process_integers", "input": "[4, 2, -2]", "output": "19.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92247_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005074", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2189", "output": "{1, 11, 2189, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005075", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[4, 1, 8]", "output": "[8, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005076", "code": "import string\ndef count_unique_punctuation(text):\n    unique_punctuation = set()\n    for char in text:\n        if char in string.punctuation:\n            unique_punctuation.add(char)\n    return len(unique_punctuation)\n", "entry_point": "count_unique_punctuation", "input": "'Hello!!!'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102564_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005077", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 8, 5, 5, 1, 5, 5, 5, 5]", "output": "[1, 64, 125, 125, 1, 125, 125, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005078", "code": "def login_system(username, password):\n    if username == \"admin\" and password == \"password123\":\n        return \"Login successful\"\n    else:\n        return \"Login failed\"\n", "entry_point": "login_system", "input": "'user', 'password123'", "output": "'Login failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18101_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005079", "code": "def get_aquarium_light_color(aquarium_id):\n    aquarium_data = {\n        1: {'default_mode': 'red', 'total_food_quantity': 50},\n        2: {'default_mode': 'blue', 'total_food_quantity': 30},\n        3: {'default_mode': 'green', 'total_food_quantity': 70}\n    }\n    if aquarium_id not in aquarium_data:\n        return 'Unknown'\n    default_mode = aquarium_data[aquarium_id]['default_mode']\n    total_food_quantity = aquarium_data[aquarium_id]['total_food_quantity']\n    if default_mode == 'red' and total_food_quantity < 40:\n        return 'dim red'\n    elif default_mode == 'blue' and total_food_quantity >= 50:\n        return 'bright blue'\n    elif default_mode == 'green':\n        return 'green'\n    else:\n        return default_mode\n", "entry_point": "get_aquarium_light_color", "input": "0", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20096_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005080", "code": "import re\ndef extract_year_links(html_text):\n    year_links = {}\n    YEAR_LINKS = {\n        \"2020\": \"/minutes-2020\",\n        \"2019\": \"/2019\",\n        \"2018\": \"/minutes-2018\",\n        \"2017\": \"/boe/meetings/minutes\",\n        \"2016\": \"/minutes-2016-0\",\n        \"2015\": \"/minutes-2015\",\n        \"2014\": \"/minutes-2014\",\n        \"2013\": \"/minutes-2013\",\n        \"2012\": \"/minutes-2012\",\n        \"2011\": \"/minutes-2011\",\n        \"2010\": \"/minutes-2010\",\n        \"2009\": \"/minutes-2009\",\n    }\n    for year, link in YEAR_LINKS.items():\n        match = re.search(f'\"{link}\"', html_text)\n        if match:\n            year_links[year] = link\n    return year_links\n", "entry_point": "extract_year_links", "input": "'<html><body>No Relevant Links Here</body></html>'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27242_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005081", "code": "def get_weights(targets, n_weights, p_weights):\n    weights = []\n    for target in targets:\n        if target == 1:\n            weights.append(p_weights)\n        elif target == 0:\n            weights.append(n_weights)\n    return weights\n", "entry_point": "get_weights", "input": "[1, 0, 1, 0], 0.5, 0.8", "output": "[0.8, 0.5, 0.8, 0.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52482_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005082", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 6, 6, 9]", "output": "[4, 6, 6, 81]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005083", "code": "def extract_app_name(config: str) -> str:\n    # Find the index of the equal sign\n    equal_index = config.index(\"=\")\n    # Extract the substring after the equal sign\n    app_name = config[equal_index + 1:]\n    # Strip any leading or trailing spaces\n    app_name = app_name.strip()\n    return app_name\n", "entry_point": "extract_app_name", "input": "'app_name =   my_app   '", "output": "'my_app'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77630_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005084", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "85302, 0", "output": "85302", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1191", "output": "{1, 3, 397, 1191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005086", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "2, 517", "output": "1034", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005087", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'   mult\\n   line\\n'", "output": "'mult\\nline\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005088", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'Hello'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005089", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9598", "output": "{1, 2, 9598, 4799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5282", "output": "{1, 5282, 2, 38, 139, 2641, 19, 278}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005091", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'data%2n', 'Paork'", "output": "'data%2n Paork'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005092", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'0 x 0 7 y 0 2'", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005093", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'city: New'", "output": "{'city': 'New'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005094", "code": "from typing import List\ndef max_sum_subarray(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sum_subarray", "input": "[1, 2, 3, -2, 1, 4]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101809_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005095", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'2h'", "output": "7200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005096", "code": "from typing import List, Dict\ndef filter_resource_drivers(drivers: List[Dict[str, str]], filter_type: str) -> List[str]:\n    filtered_ids = []\n    for driver in drivers:\n        if driver.get('type') == filter_type:\n            filtered_ids.append(driver.get('id'))\n    return filtered_ids\n", "entry_point": "filter_resource_drivers", "input": "[], 'A'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96693_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005097", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6565", "output": "{1, 1313, 65, 5, 6565, 101, 13, 505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005098", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005099", "code": "def timeout_category(timeout):\n    KEEPALIVE_TIMEOUT = 10e-6\n    RECOVERY_TIMEOUT = 1e-3\n    if timeout <= KEEPALIVE_TIMEOUT:\n        return \"Keep-Alive Timeout\"\n    elif timeout <= RECOVERY_TIMEOUT:\n        return \"Recovery Timeout\"\n    else:\n        return \"Unknown Timeout\"\n", "entry_point": "timeout_category", "input": "0", "output": "'Keep-Alive Timeout'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22338_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005100", "code": "def validate(choice):\n    try:\n        choice_int = int(choice)  # Convert input to integer\n        if 1 <= choice_int <= 3:  # Check if choice is within the range 1 to 3\n            return True\n        else:\n            return False\n    except ValueError:  # Handle non-integer inputs\n        return False\n", "entry_point": "validate", "input": "'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133414_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005101", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'*Title*Q**CEO**'", "output": "('', 'Title*Q**CEO**')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005102", "code": "def find_min_temperature(temperatures):\n    min_temp = float('inf')  # Initialize min_temp to a large value\n    for temp in temperatures:\n        if temp < min_temp:\n            min_temp = temp\n    return min_temp\n", "entry_point": "find_min_temperature", "input": "[3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36490_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005103", "code": "def simulate_card_game(num_rounds, deck_a, deck_b):\n    wins_a = 0\n    wins_b = 0\n    for i in range(num_rounds):\n        if deck_a[i] > deck_b[i]:\n            wins_a += 1\n        elif deck_a[i] < deck_b[i]:\n            wins_b += 1\n    return (wins_a, wins_b)\n", "entry_point": "simulate_card_game", "input": "2, [1, 1], [1, 1]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106558_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005104", "code": "def fa_mime_type(mime_type):\n    mime_to_icon = {\n        'application/pdf': 'file-pdf-o',\n        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'file-excel-o',\n        'text/html': 'file-text-o'\n    }\n    return mime_to_icon.get(mime_type, 'file-o')\n", "entry_point": "fa_mime_type", "input": "'application/pdf'", "output": "'file-pdf-o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72858_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005105", "code": "import collections\ndef rearrange_string(s: str, k: int) -> str:\n    res = []\n    d = collections.defaultdict(int)\n    # Count the frequency of each character\n    for c in s:\n        d[c] += 1\n    v = collections.defaultdict(int)\n    for i in range(len(s)):\n        c = None\n        for key in d:\n            if (not c or d[key] > d[c]) and d[key] > 0 and v[key] <= i + k:\n                c = key\n        if not c:\n            return ''\n        res.append(c)\n        d[c] -= 1\n        v[c] = i + k\n    return ''.join(res)\n", "entry_point": "rearrange_string", "input": "'aaaaabababc', 2", "output": "'aaaaabababc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4736_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005106", "code": "import re\ndef check_passphrase_strength(passphrase: str) -> bool:\n    if passphrase:\n        regex = re.compile(r\"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$\")\n        return bool(regex.search(passphrase))\n    return False\n", "entry_point": "check_passphrase_strength", "input": "'abc12'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65760_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005107", "code": "def play_card_game(player1_deck, player2_deck, max_rounds):\n    rounds_played = 0\n    current_round = 0\n    while player1_deck and player2_deck and current_round < max_rounds:\n        current_round += 1\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_deck.extend([card1, card2])\n        elif card2 > card1:\n            player2_deck.extend([card2, card1])\n        else:  # War\n            war_cards = [card1, card2]\n            for _ in range(3):\n                if player1_deck and player2_deck:\n                    war_cards.extend([player1_deck.pop(0), player2_deck.pop(0)])\n            if war_cards[-1] > war_cards[-2]:\n                player1_deck.extend(war_cards)\n            else:\n                player2_deck.extend(war_cards)\n        rounds_played = current_round\n    winner = 1 if len(player1_deck) > len(player2_deck) else 2 if len(player2_deck) > len(player1_deck) else 0\n    return winner, rounds_played\n", "entry_point": "play_card_game", "input": "[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], 5", "output": "(2, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62348_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005108", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1100010X'", "output": "['11000100', '11000101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005109", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6234", "output": "{1, 2, 3, 6, 3117, 1039, 6234, 2078}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005110", "code": "from typing import Tuple\ndef extract_version(version_str: str) -> Tuple[int, int, int]:\n    parts = version_str.split('.')\n    if len(parts) != 3:\n        return None\n    try:\n        major = int(parts[0])\n        minor = int(parts[1])\n        patch = int(parts[2])\n        return major, minor, patch\n    except ValueError:\n        return None\n", "entry_point": "extract_version", "input": "'1.2.3'", "output": "(1, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49339_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005111", "code": "def remaining_items_after_operations(operations):\n    stack = []\n    for operation in operations:\n        if operation.startswith(\"push\"):\n            _, item = operation.split()\n            stack.append(int(item))\n        elif operation == \"pop\" and stack:\n            stack.pop()\n    return stack\n", "entry_point": "remaining_items_after_operations", "input": "['push 1']", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8016_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7358", "output": "{1, 2, 13, 566, 26, 283, 7358, 3679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7357", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005113", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'cappwdwdcls'", "output": "'Manual not available for cappwdwdcls'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7801", "output": "{1, 29, 269, 7801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005115", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "31", "output": "{1, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt30", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005116", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[2, 3, 4, 6]", "output": "{2: 0, 3: 180, 4: 360, 6: 720}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005117", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'serveservers.some.middle.Servefig'", "output": "('serveservers', 'Servefig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005118", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 15, -5]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65004_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005119", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[4, 4]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005120", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 5, 5, 1]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122742_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005121", "code": "VIDEOS = {\n    '1': {'title': 'Video 1', 'duration': 120, 'size': 52428800},\n    '2': {'title': 'Video 2', 'duration': 180, 'size': 104857600},\n    '3': {'title': 'Video 3', 'duration': 90, 'size': 73400320}\n}\ndef filter_videos(min_duration, max_size):\n    filtered_videos = []\n    for video_id, video_info in VIDEOS.items():\n        if video_info['duration'] >= min_duration and video_info['size'] <= max_size:\n            filtered_videos.append(video_info['title'])\n    return filtered_videos\n", "entry_point": "filter_videos", "input": "120, 73400319", "output": "['Video 1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89945_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005122", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "88", "output": "'88'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005123", "code": "def longest_consecutive_subsequence(input_list):\n    current_sequence = []\n    longest_sequence = []\n    for num in input_list:\n        if not current_sequence or num == current_sequence[-1] + 1:\n            current_sequence.append(num)\n        else:\n            if len(current_sequence) > len(longest_sequence):\n                longest_sequence = current_sequence\n            current_sequence = [num]\n    if len(current_sequence) > len(longest_sequence):\n        longest_sequence = current_sequence\n    return longest_sequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[5, 6]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87901_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005124", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[91, 86, 91, 77, 72, 86]", "output": "[91, 86, 77]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005125", "code": "import os\ndef calculate_directory_size(directory_path):\n    total_size = 0\n    if os.path.exists(directory_path):\n        for item in os.listdir(directory_path):\n            item_path = os.path.join(directory_path, item)\n            if os.path.isfile(item_path):\n                total_size += os.path.getsize(item_path)\n            elif os.path.isdir(item_path):\n                total_size += calculate_directory_size(item_path)\n    return total_size\n", "entry_point": "calculate_directory_size", "input": "'/path/to/nonexistent/directory'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24802_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005126", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005127", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7345", "output": "{1, 65, 5, 13, 7345, 113, 565, 1469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005128", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "13", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005129", "code": "def generate_http_response(status_code, fileType=None):\n    if status_code == 200:\n        return f\"HTTP/1.1 200 OK\\r\\nContent-type: {fileType}\\r\\n\\r\\n\"\n    elif status_code == 301:\n        return \"HTTP/1.1 301 Moved Permanently\\r\\n\\r\\n\".encode()\n    elif status_code == 404:\n        return \"HTTP/1.1 404 Not Found\\r\\n\\r\\n\".encode()\n    elif status_code == 405:\n        return \"HTTP/1.1 405 Method Not Allowed\\r\\n\\r\\n\".encode()\n    else:\n        return \"Invalid status code\".encode()\n", "entry_point": "generate_http_response", "input": "999", "output": "b'Invalid status code'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98337_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005130", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'thittts'", "output": "'thittts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005131", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'h'", "output": "{'h': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005132", "code": "import math\ndef calculate_disk_radius(solid_angle, distance):\n    # Calculate disk radius using the formula: radius = sqrt(solid_angle * distance^2)\n    radius = math.sqrt(solid_angle * distance**2)\n    return radius\n", "entry_point": "calculate_disk_radius", "input": "6.0, 5", "output": "12.24744871391589", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28379_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005133", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'\u4f60\u597d 122'", "output": "'Chinese: \u4f60\u597d\\nAlphanumeric: 122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2083", "output": "{1, 2083}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005135", "code": "import re\ndef extract_mentions(text_snippet):\n    user_mentions = re.findall(r'@(\\w+)', text_snippet)\n    channel_mentions = re.findall(r'#(\\w+)', text_snippet)\n    links = re.findall(r'https?://\\S+', text_snippet)\n    return user_mentions, channel_mentions, links\n", "entry_point": "extract_mentions", "input": "''", "output": "([], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89967_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005136", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "114", "output": "{1, 2, 3, 38, 6, 114, 19, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt113", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005137", "code": "def most_accessed_memory_address(memory_addresses):\n    address_count = {}\n    for address in memory_addresses:\n        if address in address_count:\n            address_count[address] += 1\n        else:\n            address_count[address] = 1\n    max_count = max(address_count.values())\n    most_accessed_addresses = [address for address, count in address_count.items() if count == max_count]\n    return min(most_accessed_addresses)\n", "entry_point": "most_accessed_memory_address", "input": "[10, 10, 10, 11, 12]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123494_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005138", "code": "from typing import List, Dict\ndef find_config_files(config_names: List[str], prefix1: str, prefix2: str) -> Dict[str, str]:\n    config_files = {}\n    for name in config_names:\n        config_files[name] = f\"/path/to/{prefix1}{name}\"\n        config_files[name] = f\"/path/to/{prefix2}{name}\"\n    return config_files\n", "entry_point": "find_config_files", "input": "[], 'prefix1', 'prefix2'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81575_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005139", "code": "def can_rearrange_string(S):\n    char_count = {}\n    for char in S:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    for count in char_count.values():\n        if count != 2:\n            return \"No\"\n    return \"Yes\"\n", "entry_point": "can_rearrange_string", "input": "'abc'", "output": "'No'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "551", "output": "{1, 19, 29, 551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005141", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "4, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005142", "code": "def count_unique_chars(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha() and char.lower() not in unique_chars:\n            unique_chars.add(char.lower())\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'abcde!@#f'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28280_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005143", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 1, 1]", "output": "[2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005144", "code": "from pathlib import Path\ndef count_items_and_directories(directory_path):\n    path = Path(directory_path)\n    all_items = [*path.rglob('*')]\n    dirs = filter(Path.is_dir, all_items)\n    total_count = len(all_items)\n    dir_count = len([*dirs])\n    return total_count, dir_count\n", "entry_point": "count_items_and_directories", "input": "'/path/to/non_existent_directory'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128359_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005145", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "0, 5", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005146", "code": "def categorize_items(items):\n    faqs = []\n    issues = []\n    categories = []\n    for item in items:\n        if item['type'] == 'FAQ':\n            faqs.append(item)\n        elif item['type'] == 'KnownIssue':\n            issues.append(item)\n        elif item['type'] == 'BugCategory':\n            categories.append(item)\n    categories.sort(key=lambda x: x['details'])\n    return {'faqs': faqs, 'issues': issues, 'categories': categories}\n", "entry_point": "categorize_items", "input": "[]", "output": "{'faqs': [], 'issues': [], 'categories': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123299_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005147", "code": "def count_digit_one(n):\n    count = 0\n    for num in range(1, n + 1):\n        count += str(num).count('1')\n    return count\n", "entry_point": "count_digit_one", "input": "5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41035_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005148", "code": "def extract_github_info(url):\n    # Remove \"https://github.com/\" from the URL\n    url = url.replace(\"https://github.com/\", \"\")\n    # Split the remaining URL by \"/\"\n    parts = url.split(\"/\")\n    # Extract the username and repository name\n    username = parts[0]\n    repository = parts[1]\n    return (username, repository)\n", "entry_point": "extract_github_info", "input": "'https://github.com/httpsb.an-dr/TheScriph'", "output": "('httpsb.an-dr', 'TheScriph')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146065_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005149", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 4, 1, 1, 2, 5, 1, 3]", "output": "[4, 5, 2, 3, 7, 6, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29487_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005150", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[2, 7, 2, 1, 8, 8, 2, 2, 7]", "output": "[2, 8, 4, 4, 12, 13, 8, 9, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005151", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6697", "output": "{1, 181, 37, 6697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005152", "code": "def find_models_with_field(migrations, field_name):\n    models_with_field = set()\n    for migration in migrations:\n        for operation in migration.get(\"operations\", []):\n            if operation.get(\"operation\") == \"AddField\" and operation.get(\"field_name\") == field_name:\n                models_with_field.add(migration.get(\"model_name\"))\n    return list(models_with_field)\n", "entry_point": "find_models_with_field", "input": "[], 'some_field_name'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106321_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005153", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "4556, 'eth1', 'eth1_i'", "output": "'acl/4556/interfaces/eth1_eth1_i'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005154", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    sum_evens = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_evens += num\n    return sum_evens\n", "entry_point": "sum_of_evens", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47898_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005155", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "['R', 'R'], 3, 1", "output": "(2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005156", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 3, 9", "output": "(1338, 2031)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005157", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[10, [5], [[9]], [0]]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005158", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    seen = set()\n    for num in numbers:\n        if num in seen:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 10]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110500_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005159", "code": "def find_min_max(numbers):\n    if not numbers:\n        return None\n    min_value = float('inf')\n    max_value = float('-inf')\n    for num in numbers:\n        if num < min_value:\n            min_value = num\n        if num > max_value:\n            max_value = num\n    return min_value, max_value\n", "entry_point": "find_min_max", "input": "[1, 5, 8]", "output": "(1, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24169_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005160", "code": "def perform_operation(op, a, b):\n    if op == \"-\":\n        return a - b\n    if op == \"*\":\n        return a * b\n    if op == \"%\":\n        return a % b\n    if op == \"/\":\n        return int(a / b)\n    if op == \"&\":\n        return a & b\n    if op == \"|\":\n        return a | b\n    if op == \"^\":\n        return a ^ b\n    raise ValueError(\"Unsupported operator\")\n", "entry_point": "perform_operation", "input": "'-', 4, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11513_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4443", "output": "{3, 1, 4443, 1481}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005162", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "None", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005163", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "255, 164, 0", "output": "'#FFA400'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005164", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4625", "output": "{1, 185, 5, 37, 4625, 125, 25, 925}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4624", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005165", "code": "def max_difference(lst):\n    if len(lst) < 2:\n        return 0\n    min_val = lst[0]\n    max_diff = 0\n    for num in lst[1:]:\n        if num < min_val:\n            min_val = num\n        else:\n            max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 2, 1, 3, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61667_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005166", "code": "# Define dictionaries for section types and flags\nsection_types = {\n    0: 'SHT_NULL', 1: 'SHT_PROGBITS', 2: 'SHT_SYMTAB', 3: 'SHT_STRTAB',\n    4: 'SHT_RELA', 6: 'SHT_DYNAMIC', 8: 'SHT_NOBITS', 9: 'SHT_REL', 11: 'SHT_DYNSYM'\n}\nsection_flags = {\n    1<<0: 'SHF_WRITE', 1<<1: 'SHF_ALLOC', 1<<2: 'SHF_EXECINSTR',\n    1<<4: 'SHF_MERGE', 1<<5: 'SHF_STRINGS'\n}\ndef get_section_attributes(section_index):\n    if section_index in section_types:\n        section_type = section_types[section_index]\n        flags = [section_flags[flag] for flag in section_flags if flag & section_index]\n        return f\"Section {section_index} is of type {section_type} and has flags {' '.join(flags)}\"\n    else:\n        return \"Invalid section index.\"\n", "entry_point": "get_section_attributes", "input": "0", "output": "'Section 0 is of type SHT_NULL and has flags '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136296_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005167", "code": "def run_command_help(command, specified_command=None):\n    valid_commands = ['mycommand', 'yourcommand', 'anothercommand']  # Define valid commands here\n    if specified_command is None:\n        return 0\n    elif specified_command in valid_commands:\n        return 0\n    else:\n        return 1\n", "entry_point": "run_command_help", "input": "'mycommand', None", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56006_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005168", "code": "def extract_metadata(docstring):\n    metadata = {}\n    lines = docstring.split('\\n')\n    for line in lines:\n        if line.strip().startswith(':'):\n            key_value = line.strip().split(':', 1)\n            if len(key_value) == 2:\n                key = key_value[0][1:].strip()\n                value = key_value[1].strip()\n                metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "': :\u4f5c\u4f5c\u8005:'", "output": "{'': ':\u4f5c\u4f5c\u8005:'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74221_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005169", "code": "from typing import List\ndef find_nearest(array: List[float], value: float) -> float:\n    if not array:\n        raise ValueError(\"Input array is empty\")\n    nearest_idx = 0\n    min_diff = abs(array[0] - value)\n    for i in range(1, len(array)):\n        diff = abs(array[i] - value)\n        if diff < min_diff:\n            min_diff = diff\n            nearest_idx = i\n    return array[nearest_idx]\n", "entry_point": "find_nearest", "input": "[4.0, 4.5, 5.0], 4.5", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121237_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1698", "output": "{1, 1698, 2, 3, 6, 849, 566, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1697", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005171", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'0.15'", "output": "'0.15.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005172", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'1.1.111'", "output": "'1.1.112'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005173", "code": "def largest_prime_factor(N):\n    factor = 2\n    while factor * factor <= N:\n        if N % factor == 0:\n            N //= factor\n        else:\n            factor += 1\n    return max(factor, N)\n", "entry_point": "largest_prime_factor", "input": "97", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109160_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005174", "code": "def retrieve_workset_data(workset):\n    result = {}\n    # Simulated data retrieval from \"worksets/name\" view\n    worksets_name_data = {\n        \"workset1\": {\"_id\": 1, \"_rev\": \"abc\", \"info\": \"data1\"},\n        \"workset2\": {\"_id\": 2, \"_rev\": \"def\", \"info\": \"data2\"}\n    }\n    # Simulated data retrieval from \"worksets/lims_id\" view\n    worksets_lims_id_data = {\n        \"workset1\": {\"_id\": 3, \"_rev\": \"ghi\", \"info\": \"data3\"},\n        \"workset2\": {\"_id\": 4, \"_rev\": \"jkl\", \"info\": \"data4\"}\n    }\n    # Fetch data from \"worksets/name\" view and process it\n    if workset in worksets_name_data:\n        result[workset] = worksets_name_data[workset]\n        result[workset].pop(\"_id\", None)\n        result[workset].pop(\"_rev\", None)\n    # If data is not found in the first view, fetch from \"worksets/lims_id\" view\n    if workset not in result and workset in worksets_lims_id_data:\n        result[workset] = worksets_lims_id_data[workset]\n        result[workset].pop(\"_id\", None)\n        result[workset].pop(\"_rev\", None)\n    return result\n", "entry_point": "retrieve_workset_data", "input": "'workset3'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141692_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005175", "code": "import re\ndef count_unique_inline_classes(code_snippet):\n    inline_class_pattern = re.compile(r'class (\\w+)')\n    inline_classes = set()\n    for line in code_snippet.split('\\n'):\n        if 'admin.site.register' in line:\n            matches = inline_class_pattern.findall(line)\n            for match in matches:\n                inline_classes.add(match)\n    unique_inline_class_counts = {}\n    for inline_class in inline_classes:\n        count = sum(1 for line in code_snippet.split('\\n') if inline_class in line)\n        unique_inline_class_counts[inline_class] = count\n    return unique_inline_class_counts\n", "entry_point": "count_unique_inline_classes", "input": "'Some random code without any register statements.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140982_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1265", "output": "{1, 5, 11, 1265, 115, 55, 23, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005177", "code": "def combine_strings(func_name, str1, str2):\n    def ti(s1, s2):\n        return s1 + s2\n    def antya(s1, s2):\n        return s2 + s1\n    if func_name == \"ti\":\n        return ti(str1, str2)\n    elif func_name == \"antya\":\n        return antya(str1, str2)\n    else:\n        return \"Invalid function name\"\n", "entry_point": "combine_strings", "input": "'ti', 'ta', 'e'", "output": "'tae'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3414_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005178", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5583", "output": "{1, 3, 1861, 5583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005179", "code": "import re\ndef extract_system_info(information):\n    extracted_info = {}\n    pattern = r'USERNAME: \"(.*?)\".*?HOSTNAME: \"(.*?)\".*?LOCAL IP: \"(.*?)\".*?CONNECTED NETWORK: \"(.*?)\".*?USING NETWORK INTERFACE: \"(.*?)\".*?DEVICE UPTIME: \"(.*?)\".*?RAM USAGE: \"(.*?)\".*?SSH PORT: \"(.*?)\"'\n    match = re.search(pattern, information, re.DOTALL)\n    if match:\n        extracted_info['Username'] = match.group(1)\n        extracted_info['Hostname'] = match.group(2)\n        extracted_info['Local IP'] = match.group(3)\n        extracted_info['Connected Network'] = match.group(4)\n        extracted_info['Using Network Interface'] = match.group(5)\n        extracted_info['Device Uptime'] = match.group(6)\n        extracted_info['RAM Usage'] = match.group(7)\n        extracted_info['SSH Port'] = match.group(8)\n    return extracted_info\n", "entry_point": "extract_system_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19870_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005180", "code": "def perform_operation(nums, operation):\n    if operation == 'add':\n        result = sum(nums)\n    elif operation == 'subtract':\n        result = nums[0] - sum(nums[1:])\n    elif operation == 'multiply':\n        result = 1\n        for num in nums:\n            result *= num\n    elif operation == 'divide':\n        result = nums[0]\n        for num in nums[1:]:\n            result /= num\n    else:\n        return \"Invalid operation\"\n    return result\n", "entry_point": "perform_operation", "input": "[3, 5, 10], 'multiply'", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143837_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005181", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 4, 5, 4, 5, 4]", "output": "[1, 5, 7, 7, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005182", "code": "def count_even_numbers(lst):\n    count = 0\n    for num in lst:\n        if num % 2 == 0:\n            count += 1\n    return count\n", "entry_point": "count_even_numbers", "input": "[0, 2, 4, 6, 8, 10, 12]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39285_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005183", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3971", "output": "{1, 3971, 361, 11, 209, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005184", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.config.Djcerg'", "output": "'Djcerg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005185", "code": "def process_value(a):\n    k = 'default_value'  # Define a default value for b\n    if a == 'w':\n        b = 'c'\n    elif a == 'y':\n        b = 'd'\n    else:\n        b = k  # Assign the default value if a does not match any condition\n    return b\n", "entry_point": "process_value", "input": "'x'", "output": "'default_value'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149280_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005186", "code": "import math\ndef calculate_rmse(actual_values, predicted_values):\n    if len(actual_values) != len(predicted_values):\n        raise ValueError(\"Length of actual and predicted values should be the same.\")\n    squared_diff = [(actual - predicted) ** 2 for actual, predicted in zip(actual_values, predicted_values)]\n    mean_squared_diff = sum(squared_diff) / len(actual_values)\n    rmse = math.sqrt(mean_squared_diff)\n    return rmse\n", "entry_point": "calculate_rmse", "input": "[0, 0, 0], [3, 3, 3]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102976_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005187", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[3, 10, 15, 6, 6, 6, 2, 2, 5]", "output": "[10, 6, 6, 6, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1309", "output": "{1, 7, 11, 77, 17, 119, 187, 1309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005189", "code": "def simulate_game(directions):\n    x, y = 0, 0  # Initial position of the player\n    for direction in directions:\n        if direction == \"UP\":\n            y += 1\n        elif direction == \"DOWN\":\n            y -= 1\n        elif direction == \"LEFT\":\n            x -= 1\n        elif direction == \"RIGHT\":\n            x += 1\n    return (x, y)\n", "entry_point": "simulate_game", "input": "['UP', 'UP']", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70245_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005190", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{1, 3}, {6, 7}", "output": "{1, 3, 6, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005191", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return 0\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence", "input": "[1, 3, 2, 4, 5, 6, 7]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139118_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7761", "output": "{1, 3, 39, 199, 13, 7761, 597, 2587}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3147", "output": "{3, 1, 3147, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005194", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "20", "output": "'XX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2338", "output": "{1, 2338, 2, 7, 167, 334, 14, 1169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005196", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[4, 3, 1, 2, 4, 3, 3]", "output": "[4, 7, 8, 10, 14, 17, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005197", "code": "def check_list_elements(input_list):\n    for element in input_list:\n        if element is None or (isinstance(element, str) and not element):\n            return True\n    return False\n", "entry_point": "check_list_elements", "input": "[None]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36393_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005198", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'d'", "output": "'D'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005199", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 4, 3, 2, 4]", "output": "[4, 16, 37, 4, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005200", "code": "def format_settings_output(settings_dict):\n    output_string = \"\"\n    for setting, value in settings_dict.items():\n        if value is not None:\n            output_string += f\"{setting}: {value}\\n\"\n    return output_string\n", "entry_point": "format_settings_output", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108637_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005201", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6906", "output": "{1, 2, 3, 6, 6906, 3453, 2302, 1151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005202", "code": "from typing import List\ndef sum_absolute_differences(list1: List[int], list2: List[int]) -> int:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[10, 5], [0, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44502_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005203", "code": "def find_first_call_instruction(instruction_list, begin, call_instruction):\n    '''\n    Returns the address of the instruction below the first occurrence of the specified call instruction.\n    '''\n    prev_instruction = None\n    for instruction in instruction_list[begin:]:\n        if prev_instruction is not None and prev_instruction == call_instruction:\n            return instruction\n        prev_instruction = instruction\n", "entry_point": "find_first_call_instruction", "input": "[3, 4, 5, 7], 0, 5", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137706_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3401", "output": "{3401, 1, 19, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005205", "code": "from collections import deque\ndef count_connected_components(graph, N):\n    visited = [0] * (N + 1)  # Initialize visited list\n    cnt = 0  # Initialize count of connected components\n    def bfs(node):\n        queue = deque([node])\n        while queue:\n            n = queue.popleft()\n            for x in graph[n]:\n                if visited[x] == 0:\n                    queue.append(x)\n                    visited[x] = 1\n    for i in range(1, N + 1):\n        if visited[i] == 0:\n            bfs(i)\n            cnt += 1\n    return cnt\n", "entry_point": "count_connected_components", "input": "{1: [2], 2: [1, 3], 3: [2]}, 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128332_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005206", "code": "def extract_values(resources):\n    forwarding_rule = next((r for r in resources if r.get('type') == 'google_compute_forwarding_rule'), None)\n    if forwarding_rule:\n        values = forwarding_rule.get('values')\n        return {\n            'all_ports': not values.get('all_ports'),\n            'ports': values.get('ports'),\n            'allow_global_access': values.get('allow_global_access')\n        }\n    else:\n        return {}  # Return an empty dictionary if no forwarding rule resource is found\n", "entry_point": "extract_values", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66406_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005207", "code": "def flexible_sum(*args):\n    if len(args) < 3:\n        args += (30, 40)[len(args):]  # Assign default values if fewer than 3 arguments provided\n    return sum(args)\n", "entry_point": "flexible_sum", "input": "10", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74466_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005208", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "-1, 1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005209", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(1, 1, 1)", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005210", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[65, 65, 84, 85, 85, 88, 88, 92]", "output": "[65, 65, 84, 85, 85, 88, 88, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005211", "code": "def convert_cronstr_to_params(cron_str:str):\n    tmp = cron_str.split(\" \")\n    FIELD_NAMES = ('year', 'month', 'day', 'week', 'day_of_week', 'hour', 'minute', 'second')\n    res = []\n    index_val = len(FIELD_NAMES) - 1\n    for v in FIELD_NAMES:\n        if v == 'year':\n            res.append('*')\n        else:\n            res.append(tmp[index_val])\n        index_val = index_val - 1\n    return res\n", "entry_point": "convert_cronstr_to_params", "input": "'* * * * * * *'", "output": "['*', '*', '*', '*', '*', '*', '*', '*']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73219_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005212", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[3, 2, 1, 1, 0, 0, 2, 1] + [0] * 18", "output": "'aaabbcdggh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5107", "output": "{1, 5107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005214", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'CCC_C_NNCNC_'", "output": "'No occurrences found for bond type CCC_C_NNCNC_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005215", "code": "from typing import List\ndef expand(maze: List[List[int]], fill: int) -> List[List[int]]:\n    length = len(maze)\n    res = [[fill] * (length * 2) for _ in range(length * 2)]\n    for i in range(length // 2, length // 2 + length):\n        for j in range(length // 2, length // 2 + length):\n            res[i][j] = maze[i - length // 2][j - length // 2]\n    return res\n", "entry_point": "expand", "input": "[[0]], 9", "output": "[[0, 9], [9, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134081_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005216", "code": "from typing import List\ndef distribute_files(file_sizes: List[int], max_size: int) -> List[List[int]]:\n    folders = []\n    current_folder = []\n    current_size = 0\n    for file_size in file_sizes:\n        if current_size + file_size <= max_size:\n            current_folder.append(file_size)\n            current_size += file_size\n        else:\n            folders.append(current_folder)\n            current_folder = [file_size]\n            current_size = file_size\n    if current_folder:\n        folders.append(current_folder)\n    return folders\n", "entry_point": "distribute_files", "input": "[603, 801, 602, 603, 603], 603", "output": "[[603], [801], [602], [603], [603]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22508_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5854", "output": "{1, 2, 5854, 2927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005218", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'ex.json'", "output": "'ex_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005219", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005220", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    if not input_list:  # Base case: empty list\n        return 0\n    else:\n        return input_list.pop() + custom_sum(input_list)\n", "entry_point": "custom_sum", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145591_ipt31", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005221", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[60]", "output": "720", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005222", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[1, 1, 1, 0, 0, 0]", "output": "{1: 3, 0: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005223", "code": "def find_swap_indices(A):\n    tmp_min = idx_min = float('inf')\n    tmp_max = idx_max = -float('inf')\n    for i, elem in enumerate(reversed(A)):\n        tmp_min = min(elem, tmp_min)\n        if elem > tmp_min:\n            idx_min = i\n    for i, elem in enumerate(A):\n        tmp_max = max(elem, tmp_max)\n        if elem < tmp_max:\n            idx_max = i\n    idx_min = len(A) - 1 - idx_min\n    return [-1] if idx_max == idx_min else [idx_min, idx_max]\n", "entry_point": "find_swap_indices", "input": "[1, 2, 3, 4, 5, 0]", "output": "[0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96522_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005224", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else []\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "calculate_top_players_average", "input": "[95, 92, 91, 87, 84], 4", "output": "91.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30456_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005225", "code": "def sum_multiples_of_3_or_5(numbers):\n    total_sum = 0\n    seen = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 10]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100401_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005226", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[5, 1, 6, 5, 1, 5, 6]", "output": "[1, 1, 5, 5, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8005", "output": "{1601, 1, 5, 8005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8004", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005228", "code": "import re\nfrom typing import List\ndef extract_matches(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-zA-Z0-9]*\\b'  # Define the pattern for matching words\n    matches = re.findall(pattern, text)  # Find all matches in the text\n    unique_matches = list(set(matches))  # Get unique matches by converting to set and back to list\n    return unique_matches\n", "entry_point": "extract_matches", "input": "'batchSpawnerRegexStates'", "output": "['batchSpawnerRegexStates']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76446_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005229", "code": "def max_height(staircase):\n    max_height = 0\n    current_height = 0\n    for step in staircase:\n        if step == '+':\n            current_height += 1\n        elif step == '-':\n            current_height -= 1\n        max_height = max(max_height, current_height)\n    return max_height\n", "entry_point": "max_height", "input": "'+++++'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46647_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005230", "code": "def custom_base_to_base10(custom_number, input_base):\n    numbers = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n    size = len(custom_number)\n    result = 0\n    for i in range(size):\n        digit_value = numbers.index(custom_number[size - 1 - i])\n        result += digit_value * (input_base ** i)\n    return result\n", "entry_point": "custom_base_to_base10", "input": "'601', 10", "output": "601", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4122_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005231", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3711", "output": "{1, 3, 1237, 3711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3710", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005232", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'ddeee'", "output": "'ddeee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005233", "code": "def calculate_average_without_outliers(numbers, threshold):\n    median = sorted(numbers)[len(numbers) // 2] if len(numbers) % 2 != 0 else sum(sorted(numbers)[len(numbers) // 2 - 1:len(numbers) // 2 + 1]) / 2\n    outliers = [num for num in numbers if abs(num - median) > threshold]\n    filtered_numbers = [num for num in numbers if num not in outliers]\n    if len(filtered_numbers) == 0:\n        return 0  # Return 0 if all numbers are outliers\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_without_outliers", "input": "[100, 100, 104, 150], 5", "output": "101.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15753_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005234", "code": "# Define roles not authorized to delete an organization\nroles_not_authorized_to_delete = {\"IM\", \"SK\"}\n# Define roles not authorized to get a list of organizations\nroles_not_authorized_to_get = {\"IM\"}\ndef check_permission(role, action):\n    if action == \"delete\" and role in roles_not_authorized_to_delete:\n        return True\n    elif action == \"get\" and role in roles_not_authorized_to_get:\n        return True\n    return False\n", "entry_point": "check_permission", "input": "'Admin', 'delete'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17007_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4143", "output": "{1, 3, 1381, 4143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005236", "code": "def adapt_dataset_name(dataset_name: str) -> str:\n    torchvision_datasets = {\n        \"CIFAR10\": \"CIFAR10\",\n        \"MNIST\": \"MNIST\",\n        # Add more Torchvision dataset names here\n    }\n    return torchvision_datasets.get(dataset_name, \"Dataset not found\")\n", "entry_point": "adapt_dataset_name", "input": "'MNIST'", "output": "'MNIST'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98850_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005237", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "222", "output": "{1, 2, 3, 37, 6, 74, 111, 222}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005238", "code": "import re\ndef parse_sphinx_config(config_script):\n    project_info = {}\n    for line in config_script.split('\\n'):\n        if 'project =' in line:\n            project_info['project'] = line.split('=')[1].strip().strip(\"u'\").strip(\"'\")\n        elif 'version =' in line:\n            project_info['version'] = line.split('=')[1].strip().strip(\"'\")\n        elif 'release =' in line:\n            project_info['release'] = line.split('=')[1].strip().strip(\"'\")\n        elif 'extensions =' in line:\n            extensions = re.findall(r\"'(.*?)'\", line)\n            project_info['extensions'] = extensions\n    return project_info\n", "entry_point": "parse_sphinx_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100451_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005239", "code": "def check_lottery_result(player_numbers, winning_numbers):\n    num_matches = len(set(player_numbers).intersection(winning_numbers))\n    if num_matches == 3:\n        return \"Jackpot Prize\"\n    elif num_matches == 2:\n        return \"Smaller Prize\"\n    elif num_matches == 1:\n        return \"Consolation Prize\"\n    else:\n        return \"No Prize\"\n", "entry_point": "check_lottery_result", "input": "[42, 10, 20], [42]", "output": "'Consolation Prize'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52867_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005240", "code": "def count_unique_keywords(packages):\n    keyword_count = {}\n    for package in packages:\n        keywords = package.get('keywords', [])\n        for keyword in keywords:\n            keyword_count[keyword] = keyword_count.get(keyword, 0) + 1\n    return keyword_count\n", "entry_point": "count_unique_keywords", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77932_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005241", "code": "def count_words_with_a(description):\n    # Split the description into individual words\n    words = description.split()\n    # Initialize a counter for words containing 'a'\n    count = 0\n    # Iterate through each word and check for 'a'\n    for word in words:\n        if 'a' in word.lower():  # Case-insensitive check for 'a'\n            count += 1\n    return count\n", "entry_point": "count_words_with_a", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27946_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005242", "code": "def format_imap_message(message_type, dynamic_content=None):\n    messages = {\n        \"IMAP_ERR_LISTING_FOLDERS\": \"Error listing folders\",\n        \"IMAP_ERR_LOGGING_IN_TO_SERVER\": \"Error logging in to server\",\n        \"IMAP_ERR_SELECTING_FOLDER\": \"Error selecting folder '{folder}'\",\n        \"IMAP_GOT_LIST_FOLDERS\": \"Got folder listing\",\n        \"IMAP_LOGGED_IN\": \"User logged in\",\n        \"IMAP_SELECTED_FOLDER\": \"Selected folder '{folder}'\",\n        \"IMAP_SUCC_CONNECTIVITY_TEST\": \"Connectivity test passed\",\n        \"IMAP_ERR_CONNECTIVITY_TEST\": \"Connectivity test failed\",\n        \"IMAP_ERR_END_TIME_LT_START_TIME\": \"End time less than start time\",\n        \"IMAP_ERR_MAILBOX_SEARCH_FAILED\": \"Mailbox search failed\",\n        \"IMAP_ERR_MAILBOX_SEARCH_FAILED_RESULT\": \"Mailbox search failed, result: {result} data: {data}\",\n        \"IMAP_FETCH_ID_FAILED\": \"Fetch for uuid: {muuid} failed, reason: {excep}\",\n        \"IMAP_FETCH_ID_FAILED_RESULT\": \"Fetch for uuid: {muuid} failed, result: {result}, data: {data}\",\n        \"IMAP_VALIDATE_INTEGER_MESSAGE\": \"Please provide a valid integer value in the {key} parameter\",\n        \"IMAP_ERR_CODE_MESSAGE\": \"Error code unavailable\"\n    }\n    if message_type in messages:\n        if dynamic_content:\n            return messages[message_type].format(**dynamic_content)\n        else:\n            return messages[message_type]\n    else:\n        return messages[\"IMAP_ERR_CODE_MESSAGE\"]\n", "entry_point": "format_imap_message", "input": "'INVALID_MESSAGE_TYPE'", "output": "'Error code unavailable'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111337_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005243", "code": "def extract_country_code(url_path):\n    # Find the index of the first '/' after the initial '/'\n    start_index = url_path.find('/', 1) + 1\n    # Extract the country code using string slicing\n    country_code = url_path[start_index:-1]\n    return country_code\n", "entry_point": "extract_country_code", "input": "'/api/us/'", "output": "'us'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90290_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005244", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[5, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005245", "code": "import math\ndef mint_pizza(slices_per_person, slices_per_pizza):\n    total_slices_needed = sum(slices_per_person)\n    min_pizzas = math.ceil(total_slices_needed / slices_per_pizza)\n    return min_pizzas\n", "entry_point": "mint_pizza", "input": "[1, 2, 2], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149850_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005246", "code": "def generate_pythagorean_triples(limit):\n    triples = []\n    for a in range(1, limit + 1):\n        for b in range(a, limit + 1):\n            c = (a**2 + b**2)**0.5\n            if c.is_integer() and c <= limit:\n                triples.append((a, b, int(c)))\n    return triples\n", "entry_point": "generate_pythagorean_triples", "input": "10", "output": "[(3, 4, 5), (6, 8, 10)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41271_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005247", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'python'", "output": "'Java'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7195", "output": "{1, 7195, 5, 1439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005249", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "10, 0", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005250", "code": "def sum_divisible_by_3_not_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    return total\n", "entry_point": "sum_divisible_by_3_not_5", "input": "[3, 6, 9]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59130_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5354", "output": "{1, 5354, 2, 2677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005252", "code": "LOCALHOST_EQUIVALENTS = frozenset((\n    'localhost',\n    '127.0.0.1',\n    '0.0.0.0',\n    '0:0:0:0:0:0:0:0',\n    '0:0:0:0:0:0:0:1',\n    '::1',\n    '::',\n))\ndef is_localhost(ip_address):\n    return ip_address in LOCALHOST_EQUIVALENTS\n", "entry_point": "is_localhost", "input": "'localhost'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109309_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005253", "code": "def generate_status_message(shipment_status, payment_status):\n    if shipment_status == \"ORDERED\" and payment_status == \"NOT PAID\":\n        return \"Order placed, payment pending\"\n    elif shipment_status == \"SHIPPED\" and payment_status == \"PAID\":\n        return \"Order shipped and payment received\"\n    else:\n        return f\"Order status: {shipment_status}, Payment status: {payment_status}\"\n", "entry_point": "generate_status_message", "input": "'PROCESSED', 'PAID'", "output": "'Order status: PROCESSED, Payment status: PAID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73464_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005254", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "[], 5", "output": "'{v0, v1, v2, v3, v4}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005255", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_num = num + 2\n        else:\n            processed_num = max(num - 1, 0)  # Subtract 1 from odd numbers, ensure non-negativity\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_integers", "input": "[0, 1, 1, -1, -1, 0]", "output": "[2, 0, 0, 0, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98159_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005256", "code": "def calculate_winner(game):\n    team1, team2, score1, score2 = game.split('_')\n    if int(score1) > int(score2):\n        return team1\n    elif int(score1) < int(score2):\n        return team2\n    else:\n        return \"Draw\"\n", "entry_point": "calculate_winner", "input": "'TeamA_TeamB_0_0'", "output": "'Draw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71038_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005257", "code": "import re\nBOOLEAN = \"BOOLEAN\"\nINT_LIST = \"INT_LIST\"\nFLOAT_LIST = \"FLOAT_LIST\"\nBOOLEAN_LIST = \"BOOLEAN_LIST\"\nVOID = \"VOID\"\nOBJECT = \"OBJECT\"\nSEMANTIC_ERROR = 99\n# Regular expressions to match data types\nREGEX_BOOLEAN = r'true|false'\nregex_boolean = re.compile(REGEX_BOOLEAN)\nREGEX_INT = r'[0-9][0-9]*'\nregex_int = re.compile(REGEX_INT)\nREGEX_FLOAT = r'[0-9]*[\\.][0-9]+'\nregex_float = re.compile(REGEX_FLOAT)\nREGEX_OBJECT = r'cube|sphere'\nregex_object = re.compile(REGEX_OBJECT)\ndef validate_data_type(data_type, value):\n    if data_type == BOOLEAN:\n        return bool(regex_boolean.match(value))\n    elif data_type == INT_LIST:\n        return bool(regex_int.match(value))\n    elif data_type == FLOAT_LIST:\n        return bool(regex_float.match(value))\n    elif data_type == OBJECT:\n        return bool(regex_object.match(value))\n    else:\n        return SEMANTIC_ERROR\n", "entry_point": "validate_data_type", "input": "VOID, 'some_value'", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26989_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005258", "code": "def calculate_total_time(jobs):\n    total_time = 0\n    for duration in jobs:\n        total_time += duration\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[5, 4, 10]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84145_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3231", "output": "{1, 3, 359, 9, 1077, 3231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005260", "code": "def find_missing(S):\n    full_set = set(range(10))\n    sum_S = sum(S)\n    sum_full_set = sum(full_set)\n    return sum_full_set - sum_S\n", "entry_point": "find_missing", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109203_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005261", "code": "def generate_subsequences(seq):\n    subseq = []\n    def generate_helper(curr, remaining):\n        if remaining:\n            generate_helper(curr + [remaining[0]], remaining[1:])\n            generate_helper(curr + [remaining[-1]], remaining[:-1])\n        else:\n            subseq.append(curr)\n    generate_helper([], seq)\n    return subseq\n", "entry_point": "generate_subsequences", "input": "[]", "output": "[[]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128232_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9329", "output": "{1, 19, 491, 9329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005263", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[2, 1, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005264", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6315", "output": "{1, 3, 5, 421, 6315, 1263, 15, 2105}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6314", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005265", "code": "from collections import deque\n# Given initial state\ntab_inicial = \"initial_state\"\nfila = deque([tab_inicial])\nfilaRepet = set([tab_inicial])\nnos_exp = 0\nvisited = set()\ndef generate_neighbors(node):\n    # Function to generate neighboring nodes for a given node\n    # Implement this based on the graph structure\n    return []  # Placeholder return for an empty list\n", "entry_point": "generate_neighbors", "input": "'initial_state'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146938_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005266", "code": "from typing import List\ndef fast_moving_average(data: List[float], num_intervals: int) -> List[float]:\n    if len(data) < num_intervals:\n        return []\n    interval_size = len(data) // num_intervals\n    moving_avg = []\n    for i in range(num_intervals):\n        start = i * interval_size\n        end = start + interval_size if i < num_intervals - 1 else len(data)\n        interval_data = data[start:end]\n        avg = sum(interval_data) / len(interval_data) if interval_data else 0\n        moving_avg.append(avg)\n    return moving_avg\n", "entry_point": "fast_moving_average", "input": "[2.0, 2.0, 5.0, 5.0, 8.0, 9.0], 3", "output": "[2.0, 5.0, 8.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98561_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005267", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hellheleo'", "output": "{'hellheleo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005268", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6898", "output": "{1, 6898, 2, 3449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005269", "code": "def organize_dependencies(dependencies):\n    dependency_dict = {}\n    for module, dependency in dependencies:\n        if module in dependency_dict:\n            dependency_dict[module].append(dependency)\n        else:\n            dependency_dict[module] = [dependency]\n    return dependency_dict\n", "entry_point": "organize_dependencies", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63465_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005270", "code": "def calculate_circle_area(radius):\n    # Approximate the value of \u03c0 as 3.14159\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "5", "output": "78.53975", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46985_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005271", "code": "def calculate_average(measurements):\n    average_measurements = {}\n    for key, values in measurements.items():\n        if values:\n            average = sum(values) / len(values)\n            average_measurements[key] = average\n    return average_measurements\n", "entry_point": "calculate_average", "input": "{'key1': [], 'key2': []}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79257_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005272", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[0, 4, 1, 1, 0, 2, 2, 2, 2], 4", "output": "[4, 8, 5, 5, 4, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8829", "output": "{1, 3, 327, 9, 109, 81, 981, 27, 8829, 2943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005274", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[1, 1, 1, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005275", "code": "def extract_unit_model(string):\n    # Split the input string by spaces to extract individual unit representations\n    units = string.split()\n    # Format each unit representation by adding a space between the unit name and exponent\n    formatted_units = [unit.replace('^', '^(') + ')' for unit in units]\n    # Join the formatted unit representations into a single string with spaces in between\n    unit_model = ' '.join(formatted_units)\n    return unit_model\n", "entry_point": "extract_unit_model", "input": "'Gram^MilHr'", "output": "'Gram^(MilHr)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81565_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005276", "code": "def count_circular_paths(G, length):\n    def dfs(node, path, path_length):\n        nonlocal count\n        if path_length == length and node == path[0]:\n            count += 1\n            return\n        if path_length < length:\n            for neighbor in G[node]:\n                if neighbor not in path:\n                    dfs(neighbor, path + [neighbor], path_length + 1)\n    count = 0\n    for node in G:\n        dfs(node, [node], 1)\n    return count\n", "entry_point": "count_circular_paths", "input": "{}, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73137_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005277", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 4, 6, 5]", "output": "[16, 16, 46, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005278", "code": "from zipfile import ZipFile\ndef process_wheel_file(wheel_path: str) -> bool:\n    try:\n        with ZipFile(wheel_path, 'r') as wheel_zip:\n            expected_files = {\n                'example/sub_module_a/__init__.py',\n                'example/sub_module_a/where.py',\n                'example_sub_module_a-0.0.0.dist-info/AUTHORS.rst',\n                'example_sub_module_a-0.0.0.dist-info/LICENSE',\n                'example_sub_module_a-0.0.0.dist-info/METADATA',\n                'example_sub_module_a-0.0.0.dist-info/WHEEL',\n                'example_sub_module_a-0.0.0.dist-info/top_level.txt',\n                'example_sub_module_a-0.0.0.dist-info/RECORD'\n            }\n            file_contents = wheel_zip.read('example/sub_module_a/where.py')\n            return set(wheel_zip.namelist()) == expected_files and file_contents == b'a = \"module_a\"\\n'\n    except FileNotFoundError:\n        return False\n", "entry_point": "process_wheel_file", "input": "'non_existent_file.whl'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32385_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005279", "code": "from typing import List\ndef is_slave_process(rank: int, args: List[str]) -> bool:\n    return rank == 1 or \"--tests-slave\" in args\n", "entry_point": "is_slave_process", "input": "0, []", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39145_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005280", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 91], 2", "output": "90.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12185_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005281", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'lovered'", "output": "'lovegreen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005282", "code": "# Define the my_db function to mimic the behavior\ndef my_db(msg):\n    # Sample dictionary with 'city_code' key and value\n    return {'city_code': 123}\n", "entry_point": "my_db", "input": "'hello'", "output": "{'city_code': 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128517_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005283", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'be'", "output": "'Be'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005284", "code": "import re\nfrom typing import List\ndef extract_matches(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-zA-Z0-9]*\\b'  # Define the pattern for matching words\n    matches = re.findall(pattern, text)  # Find all matches in the text\n    unique_matches = list(set(matches))  # Get unique matches by converting to set and back to list\n    return unique_matches\n", "entry_point": "extract_matches", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76446_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005285", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', 5, -9", "output": "(6, -9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005286", "code": "def calculate_min_payment(balance, annualInterestRate):\n    totalMonths = 12\n    initialBalance = balance\n    monthlyPaymentRate = 0\n    monthlyInterestRate = annualInterestRate / totalMonths\n    while balance > 0:\n        for i in range(totalMonths):\n            balance = balance - monthlyPaymentRate + ((balance - monthlyPaymentRate) * monthlyInterestRate)\n        if balance > 0:\n            monthlyPaymentRate += 10\n            balance = initialBalance\n        elif balance <= 0:\n            break\n    return monthlyPaymentRate\n", "entry_point": "calculate_min_payment", "input": "4000, 0.18", "output": "370", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63181_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005287", "code": "def calculate_mean_metrics(times, test_scores):\n    mean_time = sum(times) / len(times) if times else 0\n    mean_accuracy = sum(test_scores) / len(test_scores) if test_scores else 0\n    return mean_time, mean_accuracy\n", "entry_point": "calculate_mean_metrics", "input": "[0.3], [88, 88]", "output": "(0.3, 88.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137268_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005288", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4432", "output": "{1, 2, 4, 2216, 8, 554, 4432, 16, 1108, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4431", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005289", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[76, 78]", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70866_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005290", "code": "def get_error_description(error_code):\n    error_codes = {\n        70: \"File write error\",\n        80: \"File too big to upload\",\n        90: \"Failed to create local directory\",\n        100: \"Failed to create local file\",\n        110: \"Failed to delete directory\",\n        120: \"Failed to delete file\",\n        130: \"File not found\",\n        140: \"Maximum retry limit reached\",\n        150: \"Request failed\",\n        160: \"Cache not loaded\",\n        170: \"Migration failed\",\n        180: \"Download certificates error\",\n        190: \"User rejected\",\n        200: \"Update needed\",\n        210: \"Skipped\"\n    }\n    return error_codes.get(error_code, \"Unknown Error\")\n", "entry_point": "get_error_description", "input": "999", "output": "'Unknown Error'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66002_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005291", "code": "def find_smallest_cell(matrix):\n    N = len(matrix)\n    INF = 10 ** 18\n    smallest_value = INF\n    smallest_coords = (0, 0)\n    for y in range(N):\n        for x in range(N):\n            if matrix[y][x] < smallest_value:\n                smallest_value = matrix[y][x]\n                smallest_coords = (y, x)\n    return smallest_coords\n", "entry_point": "find_smallest_cell", "input": "[[1, 2], [3, 0]]", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87658_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005292", "code": "def count_palindromic_substrings(s):\n    count = 0\n    def expand_around_center(left, right):\n        nonlocal count\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            count += 1\n            left -= 1\n            right += 1\n    for i in range(len(s)):\n        expand_around_center(i, i)  # Odd length palindromes\n        expand_around_center(i, i + 1)  # Even length palindromes\n    return count\n", "entry_point": "count_palindromic_substrings", "input": "'aabaa'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49477_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005293", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[5, 1, 2, 3, 7]", "output": "[5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005294", "code": "def count_alphanumeric_chars(text):\n    count = 0\n    for char in text:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abc!'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10323_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4343", "output": "{1, 43, 101, 4343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005296", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JoJJoJ', 'DDDoe', 'MaMarierrar'", "output": "'JoJJoJ MaMarierrar DDDoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005297", "code": "from typing import List\nimport ast\ndef extract_data_files(setup_script: str) -> List[str]:\n    data_files = None\n    # Parse the setup script to extract the data_files list\n    try:\n        parsed_setup = ast.parse(setup_script)\n        for node in ast.walk(parsed_setup):\n            if isinstance(node, ast.Assign) and isinstance(node.value, ast.List) and len(node.targets) == 1:\n                if node.targets[0].id == 'data_files':\n                    data_files = node.value.elts\n                    break\n    except SyntaxError:\n        return []\n    if data_files is None:\n        return []\n    # Extract filenames from the data_files list\n    filenames = []\n    for file_tuple in data_files:\n        if isinstance(file_tuple, ast.Tuple) and len(file_tuple.elts) == 2:\n            package_name = file_tuple.elts[0].s\n            if package_name == 'fool':\n                filenames.extend([file.s for file in file_tuple.elts[1].elts])\n    return filenames\n", "entry_point": "extract_data_files", "input": "\"data_files = [('bar', [])]\"", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80232_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005298", "code": "def rock_paper_scissors_winner(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie\"\n    elif (player1_choice == 'rock' and player2_choice == 'scissors') or \\\n         (player1_choice == 'scissors' and player2_choice == 'paper') or \\\n         (player1_choice == 'paper' and player2_choice == 'rock'):\n        return \"Player 1 wins\"\n    else:\n        return \"Player 2 wins\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'rock'", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143238_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005299", "code": "def calculate_absolute_differences_sum(arr):\n    total_diff = 0\n    for i in range(1, len(arr)):\n        total_diff += abs(arr[i] - arr[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 10, 12, 14, 18]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67231_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005300", "code": "_flav_dict = {\"g\": 21, \"d\": 1, \"u\": 2, \"s\": 3, \"c\": 4, \"b\": 5, \"t\": 6}\ndef get_particle(flav_str, skip_error=False):\n    particle = _flav_dict.get(flav_str[0])\n    if particle is None:\n        if not skip_error:\n            raise ValueError(f\"Could not understand the incoming flavour: {flav_str}. You can skip this error by using --no_pdf\")\n        else:\n            return None\n    if flav_str[-1] == \"~\":\n        particle = -particle\n    return particle\n", "entry_point": "get_particle", "input": "'s'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112786_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "725", "output": "{1, 5, 145, 725, 25, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt724", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005302", "code": "from functools import reduce\nfrom typing import List\ndef calculate_sum(input_list: List[int]) -> int:\n    return reduce(lambda x, y: x + y, input_list)\n", "entry_point": "calculate_sum", "input": "[14]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50691_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005303", "code": "from typing import Dict, List\ndef topological_sort(graph: Dict[int, List[int]]) -> List[int]:\n    visited = set()\n    post_order = []\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        post_order.append(node)\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node)\n    return post_order[::-1]\n", "entry_point": "topological_sort", "input": "{4: [3], 3: []}", "output": "[4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78090_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005304", "code": "ACTIVITY_VIEW = 'VIEW'\nACTIVITY_VOTE = 'VOTE'\n# \ubcf4\ub4dc \uc5ed\ud560\nBOARD_ROLE = {\n    'DEFAULT': 'DEFAULT',\n    'PROJECT': 'PROJECT',\n    'DEBATE': 'DEBATE',\n    'PLANBOOK': 'PLANBOOK',\n    'ARCHIVING':'ARCHIVING',\n    'WORKHOUR': 'WORKHOUR',\n    'SPONSOR': 'SPONSOR',\n    'SWIPER':'SWIPER',\n    'STORE': 'STORE',\n    'CONTACT':'CONTACT',\n}\ndef filter_activities_by_role(activities, board_role):\n    filtered_activities = []\n    for activity_type, description in activities:\n        if BOARD_ROLE.get(board_role) == activity_type:\n            filtered_activities.append((activity_type, description))\n    return filtered_activities\n", "entry_point": "filter_activities_by_role", "input": "[], 'DEFAULT'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63656_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005305", "code": "def generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(n**0.5) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n + 1, i):\n                is_prime[j] = False\n    primes = [num for num in range(2, n + 1) if is_prime[num]]\n    return primes\n", "entry_point": "generate_primes", "input": "11", "output": "[2, 3, 5, 7, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117646_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005306", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[4, 1, 5, -1, 0]", "output": "[4, 1, 5, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005307", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'HELLO WORLD', 3", "output": "'KHOOR ZRUOG'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3973", "output": "{1, 29, 137, 3973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005309", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[20, 30], 0", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005310", "code": "def calculate_edit_distance_median(edit_distances):\n    # Filter out edit distances equal to 0\n    filtered_distances = [dist for dist in edit_distances if dist != 0]\n    # Sort the filtered list\n    sorted_distances = sorted(filtered_distances)\n    length = len(sorted_distances)\n    if length == 0:\n        return 0\n    # Calculate the median\n    if length % 2 == 1:\n        return sorted_distances[length // 2]\n    else:\n        mid = length // 2\n        return (sorted_distances[mid - 1] + sorted_distances[mid]) / 2\n", "entry_point": "calculate_edit_distance_median", "input": "[0, 2, 4]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8147_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9771", "output": "{3, 1, 9771, 3257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005312", "code": "def calculate_mae(expected, predicted):\n    if len(expected) != len(predicted):\n        raise ValueError(\"Expected and predicted lists must have the same length.\")\n    mae = sum(abs(e - p) for e, p in zip(expected, predicted)) / len(expected)\n    return mae\n", "entry_point": "calculate_mae", "input": "[10, 20], [0, 5]", "output": "12.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59534_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005313", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "0", "output": "'Unknown error code'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005314", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[10, 20, 30, 40, 50, 100]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005315", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'Doe, '", "output": "[('Doe', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005316", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "8, 4", "output": "'Enemy: 8, Own: 4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005317", "code": "import ast\ndef extract_altered_tables(script):\n    tables = set()\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call):\n            if hasattr(node.func, 'attr'):\n                if node.func.attr == 'add_column' or node.func.attr == 'drop_column':\n                    table_name = node.args[0].s\n                    tables.add(table_name)\n    return list(tables)\n", "entry_point": "extract_altered_tables", "input": "\"print('Hello, World!')\"", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121094_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005318", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'{'", "output": "([], ['{'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005319", "code": "def max_palindrome_length(s: str) -> int:\n    char_count = {}\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    max_length = 0\n    for count in char_count.values():\n        max_length += count if count % 2 == 0 else count - 1\n    return max_length\n", "entry_point": "max_palindrome_length", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124507_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005320", "code": "def extract_verification_info(verifications):\n    extracted_info = {}\n    for verification in verifications:\n        for criteria in verification['criteria']:\n            if criteria not in extracted_info:\n                extracted_info[criteria] = []\n            extracted_info[criteria].append((verification['comparator'], verification['value']))\n    return extracted_info\n", "entry_point": "extract_verification_info", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142439_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005321", "code": "def search_license_plates(plates, query):\n    result = []\n    query = query.lower()  # Convert query to lowercase for case-insensitive search\n    for plate_info in plates:\n        plate = plate_info['plate'].lower()  # Convert plate number to lowercase for case-insensitive search\n        if query in plate:\n            result.append(plate_info)\n    return result\n", "entry_point": "search_license_plates", "input": "[], 'ABC'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63617_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005322", "code": "def card_war(player1, player2):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1, player2):\n        if card_values[card1] > card_values[card2]:\n            player1_wins += 1\n        elif card_values[card1] < card_values[card2]:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins!\"\n    elif player1_wins < player2_wins:\n        return \"Player 2 wins!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "card_war", "input": "['A', 'K'], ['10', 'J']", "output": "'Player 1 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16177_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005323", "code": "import ast\ndef extract_settings(code_snippet):\n    settings_dict = {}\n    code_lines = code_snippet.strip().split('\\n')\n    for line in code_lines:\n        try:\n            key, value = map(str.strip, line.split('='))\n            key = key.strip()\n            value = ast.literal_eval(value.strip())\n            if key in ['LANGUAGE_CODE', 'TIME_ZONE', 'STATIC_URL', 'MEDIA_ROOT']:\n                settings_dict[key] = value\n        except (ValueError, SyntaxError):\n            pass\n    return settings_dict\n", "entry_point": "extract_settings", "input": "'\\nrandom_setting 42\\nanother_setting = not_a_literal\\n'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77656_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005324", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'abcdag.png'", "output": "'ag.png'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9818", "output": "{1, 9818, 2, 4909}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005326", "code": "def format_title_version(title: str, version: tuple) -> str:\n    version_str = \".\".join(map(str, version))\n    formatted_str = f'\"{title}\" version: {version_str}'\n    return formatted_str\n", "entry_point": "format_title_version", "input": "'TessellTeion', ()", "output": "'\"TessellTeion\" version: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31803_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3179", "output": "{1, 289, 11, 3179, 17, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005328", "code": "def count_unique_words(input_list):\n    unique_word_counts = {}\n    for string in input_list:\n        words = string.lower().split()\n        unique_word_counts[string] = len(set(words))\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "['ome.', 'world!', 'ome']", "output": "{'ome.': 1, 'world!': 1, 'ome': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103230_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8743", "output": "{1, 7, 1249, 8743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8742", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005330", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9978", "output": "{1, 2, 3, 6, 9978, 4989, 3326, 1663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005331", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first participant as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 80, 80, 70, 60, 50, 40]", "output": "[1, 2, 3, 3, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122200_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005332", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "5, 10, 0", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005333", "code": "import math\nK = 10  # Define the constant K\ndef compute_delta_phi(r, rp):\n    return math.atan(math.tanh(r / K) / math.sinh(rp / K))\n", "entry_point": "compute_delta_phi", "input": "0, 1", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122619_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005334", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "10, 7", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005335", "code": "def extract_major_version(version):\n    major_version = int(version.split('.')[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'32.0'", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104028_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005336", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'<p>Hello World &lt;3</p>'", "output": "'Hello World <3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005337", "code": "def extract_comments(script):\n    comments = []\n    lines = script.split('\\n')\n    for line in lines:\n        line = line.strip()\n        if line.startswith('#'):\n            comments.append(line)\n        elif '#' in line:\n            comments.append(line[line.index('#'):].strip())\n    return comments\n", "entry_point": "extract_comments", "input": "'#'", "output": "['#']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64364_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005338", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[5, 6, 7, 11, 12, 13]", "output": "[5, 6, 7, 11, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005339", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "-1, 264, 'ofofooofo'", "output": "{'ofofooofo': -264}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005340", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4113", "output": "{1, 3, 9, 457, 4113, 1371}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005341", "code": "import re\ndef extract_test_info(test_module):\n    suite_info = {}\n    test_info = {}\n    suite_pattern = r'@lcc\\.suite\\(\"([^\"]+)\"\\)\\n@lcc\\.prop\\(\"([^\"]+)\", \"([^\"]+)\"\\)\\n@lcc\\.tags\\(\"([^\"]+)\"\\)\\n@lcc\\.link\\(\"([^\"]+)\", \"([^\"]+)\"\\)'\n    test_pattern = r'@lcc\\.test\\(\"([^\"]+)\"\\)\\n@lcc\\.prop\\(\"([^\"]+)\", \"([^\"]+)\"\\)\\n@lcc\\.tags\\(\"([^\"]+)\"\\)\\n@lcc\\.link\\(\"([^\"]+)\", \"([^\"]+)\"\\)'\n    suite_match = re.search(suite_pattern, test_module)\n    test_match = re.search(test_pattern, test_module)\n    if suite_match:\n        suite_info['name'] = suite_match.group(1)\n        suite_info['properties'] = {suite_match.group(2): suite_match.group(3)}\n        suite_info['tags'] = [suite_match.group(4)]\n        suite_info['links'] = {suite_match.group(5): suite_match.group(6)}\n    if test_match:\n        test_info['name'] = test_match.group(1)\n        test_info['properties'] = {test_match.group(2): test_match.group(3)}\n        test_info['tags'] = [test_match.group(4)]\n        test_info['links'] = {test_match.group(5): test_match.group(6)}\n    return suite_info, test_info\n", "entry_point": "extract_test_info", "input": "''", "output": "({}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145046_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005342", "code": "def process_game_data(gamedata):\n    level = gamedata.get(\"level\", 0)\n    if level < 5:\n        gamedata[\"level\"] = level + 1\n    elif level >= 5 and level < 10:\n        gamedata[\"iron\"] *= 2\n    elif level >= 10 and level < 15:\n        gamedata[\"coal\"] += 5\n    elif level >= 15:\n        gamedata[\"copper\"] *= 3\n    return gamedata\n", "entry_point": "process_game_data", "input": "{'level': 0}", "output": "{'level': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1566_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005343", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3597", "output": "{1, 33, 3, 327, 11, 3597, 109, 1199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005344", "code": "def can_reach_end(steps):\n    max_reach = 0\n    for i in range(len(steps)):\n        if i > max_reach:\n            return False\n        max_reach = max(max_reach, i + steps[i])\n        if max_reach >= len(steps) - 1:\n            return True\n    return False\n", "entry_point": "can_reach_end", "input": "[2, 3, 1, 1, 4]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17546_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005345", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            new_pos = ord(char) + shift\n            if new_pos > ord('z'):\n                new_pos = new_pos - 26  # Wrap around the alphabet\n            encrypted_text += chr(new_pos)\n        else:\n            encrypted_text += char  # Keep non-letter characters unchanged\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'fpmh', 1", "output": "'gqni'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55105_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005346", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "16", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005347", "code": "def split_into_chunks(data, chunk_size):\n    num_chunks = -(-len(data) // chunk_size)  # Calculate the number of chunks needed\n    chunks = []\n    for i in range(num_chunks):\n        start = i * chunk_size\n        end = (i + 1) * chunk_size\n        chunk = data[start:end]\n        if len(chunk) < chunk_size:\n            chunk += [None] * (chunk_size - len(chunk))  # Pad with None values if needed\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_into_chunks", "input": "[1, 7, 3, 6, 7, 7, 6, 1, 6], 2", "output": "[[1, 7], [3, 6], [7, 7], [6, 1], [6, None]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138006_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005348", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3688", "output": "{1, 2, 4, 3688, 8, 461, 1844, 922}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3687", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005349", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "3", "output": "[3, 10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005350", "code": "def fetchJson(queryString):\n    # Simulating fetching data based on the query string\n    if queryString == \"example_query\":\n        posts = [\n            {\"titleId\": 1, \"title\": \"First Post\"},\n            {\"titleId\": 2, \"title\": \"Second Post\"},\n            {\"titleId\": 3, \"title\": \"Third Post\"}\n        ]\n        return {\"response\": posts}\n    else:\n        return {\"response\": []}\n", "entry_point": "fetchJson", "input": "''", "output": "{'response': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133626_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5059", "output": "{1, 5059}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005352", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1251", "output": "{1, 417, 3, 1251, 9, 139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005353", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "0, 86397", "output": "86397", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005354", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "25, 10", "output": "3268760", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt56", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8734", "output": "{1, 2, 11, 397, 4367, 22, 794, 8734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005356", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005357", "code": "ALLOWED_EXTENSIONS = ['png', 'apng', 'jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'gif', 'svg', 'bmp', 'ico', 'cur']\ndef is_allowed_extension(filename):\n    # Extract the file extension from the filename\n    file_extension = filename.split('.')[-1].lower()\n    # Check if the file extension is in the list of allowed extensions\n    if file_extension in ALLOWED_EXTENSIONS:\n        return True\n    else:\n        return False\n", "entry_point": "is_allowed_extension", "input": "'example.JPG'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56793_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005358", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "2", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005359", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9794", "output": "{1, 9794, 2, 4897, 166, 83, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9793", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005360", "code": "import re\n# Pre-defined regular expression pattern\nre_session = re.compile(r\"session=(.*?);\")\ndef extract_session_ids(text):\n    # Find all matches of the regular expression pattern in the input text\n    matches = re_session.findall(text)\n    # Extract session IDs from the matches and store them in a set for uniqueness\n    session_ids = set(match for match in matches)\n    return list(session_ids)\n", "entry_point": "extract_session_ids", "input": "'session=def456;'", "output": "['def456']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27451_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005361", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt23", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005362", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'aaaaaabbbbbb', 'cccccccccccc'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005363", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "60", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005364", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005365", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "8", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005366", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005367", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'exCOLOr:'", "output": "('exCOLOr', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3807", "output": "{1, 3, 423, 9, 141, 47, 81, 1269, 27, 3807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005369", "code": "import re\ndef extract_api_version(input_string):\n    # Define the regular expression pattern to match the version number\n    pattern = r'REST API Version (\\d+\\.\\d+\\.\\d+)'\n    # Search for the pattern in the input string\n    match = re.search(pattern, input_string)\n    if match:\n        # Extract the version number from the matched pattern\n        version_number = match.group(1)\n        return version_number\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_api_version", "input": "''", "output": "'Version number not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28242_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005370", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4219", "output": "{1, 4219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5602", "output": "{1, 5602, 2, 2801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5601", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005372", "code": "import re\ndef parse_config(config_str):\n    base_model = None\n    learning_rate = None\n    lines = config_str.split('\\n')\n    for line in lines:\n        if line.startswith(\"_base_\"):\n            base_model = re.search(r\"'(.*?)'\", line).group(1)\n        elif line.startswith(\"optimizer\"):\n            learning_rate = float(re.search(r'lr=(\\d+\\.\\d+)', line).group(1))\n    return base_model, learning_rate\n", "entry_point": "parse_config", "input": "''", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112880_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005373", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'mov rdx, qwordptr[rax]'", "output": "'add mov rdx, qwordptr[rax]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005374", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5307", "output": "{1, 3, 1769, 61, 87, 183, 5307, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5306", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005375", "code": "def find_pairs(arr, target_sum):\n    arr.sort()\n    left = 0\n    right = len(arr) - 1\n    count = 0\n    while left < right:\n        cur_sum = arr[left] + arr[right]\n        if cur_sum == target_sum:\n            print(target_sum, arr[left], arr[right])\n            count += 1\n            left += 1\n        elif cur_sum < target_sum:\n            left += 1\n        else:\n            right -= 1\n    print(\"Total pairs found:\", count)\n    return count\n", "entry_point": "find_pairs", "input": "[], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73088_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005376", "code": "def power(x, n):\n    p = 1\n    for i in range(n):\n        p *= x\n    return p\n", "entry_point": "power", "input": "5, 6", "output": "15625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145971_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005377", "code": "from typing import List, Tuple\ndef process_numbers(numbers: List[int]) -> Tuple[int, int]:\n    count = 0\n    total_sum = 0\n    for num in numbers:\n        count += 1\n        total_sum += num\n        if num == 999:\n            break\n    return count - 1, total_sum - 999  # Adjusting count and sum for excluding the terminating 999\n", "entry_point": "process_numbers", "input": "[10, 20, 15, 26, 999]", "output": "(4, 71)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24887_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005378", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    unique_scores = []\n    top_scores = []\n    for score in sorted_scores:\n        if score not in unique_scores:\n            unique_scores.append(score)\n            top_scores.append(score)\n            if len(top_scores) == n:\n                break\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[50, 60, 76, 78, 80], 3", "output": "78.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78119_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005379", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2', 118", "output": "'2.118'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005380", "code": "def calculate_winner(cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A wins\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "calculate_winner", "input": "[2, 3, 1, 5]", "output": "'Player B wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005381", "code": "def max_difference(lst):\n    if len(lst) < 2:\n        return 0\n    min_val = lst[0]\n    max_diff = 0\n    for num in lst[1:]:\n        if num < min_val:\n            min_val = num\n        else:\n            max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61667_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005382", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[50, 100, 100, 40, 60, 100]", "output": "[5, 1, 1, 6, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005383", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documentsfile.txt'", "output": "('local', 'documentsfile.txt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005384", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'HeLLo'", "output": "'hEllO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005385", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'UDSTBDBNB'", "output": "('UDSTBD', 'BNB')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005386", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005387", "code": "def convert_to_month_names(month_numbers):\n    month_dict = {\n        \"01\": \"January\",\n        \"02\": \"February\",\n        \"03\": \"March\",\n        \"04\": \"April\",\n        \"05\": \"May\",\n        \"06\": \"June\",\n        \"07\": \"July\",\n        \"08\": \"August\",\n        \"09\": \"September\",\n        \"10\": \"October\",\n        \"11\": \"November\",\n        \"12\": \"December\",\n    }\n    result = []\n    for month_num in month_numbers:\n        if month_num in month_dict:\n            result.append(month_dict[month_num])\n        else:\n            result.append(\"Invalid Month\")\n    return result\n", "entry_point": "convert_to_month_names", "input": "['01', '03', '05', '00']", "output": "['January', 'March', 'May', 'Invalid Month']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132280_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005388", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[0, -1, 6, 1, 4, 0, -2, 1, -1]", "output": "[-1, 5, 7, 5, 4, -2, -1, 0, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005389", "code": "def count_occurrences(input_string, target_char):\n    count = 0\n    for char in input_string:\n        if char == target_char:\n            count += 1\n    return count\n", "entry_point": "count_occurrences", "input": "'', 'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26995_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005390", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://examge.jpg_150x0'", "output": "'https://examge.jpg_150x0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005391", "code": "def transformImages(images):\n    transformed_images = []\n    for image in images:\n        max_pixel_value = max(image)\n        transformed_image = [max_pixel_value] * len(image)\n        transformed_images.append(transformed_image)\n    return transformed_images\n", "entry_point": "transformImages", "input": "[[1, 2, 3], [5, 6, 0], [0, 1, 9]]", "output": "[[3, 3, 3], [6, 6, 6], [9, 9, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99850_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005392", "code": "def perform_operation(op, a, b):\n    if op == \"-\":\n        return a - b\n    if op == \"*\":\n        return a * b\n    if op == \"%\":\n        return a % b\n    if op == \"/\":\n        return int(a / b)\n    if op == \"&\":\n        return a & b\n    if op == \"|\":\n        return a | b\n    if op == \"^\":\n        return a ^ b\n    raise ValueError(\"Unsupported operator\")\n", "entry_point": "perform_operation", "input": "'-', 0, 15", "output": "-15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11513_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005393", "code": "def modify_email(email_data):\n    # Modify the email by adding a new recipient to the \"To\" field\n    new_recipient = \"NewRecipient@example.com\"\n    email_data = email_data.replace(\"To: Recipient 1\", f\"To: Recipient 1, {new_recipient}\")\n    # Update the email subject to include \"Modified\"\n    email_data = email_data.replace(\"Subject: test mail\", \"Subject: Modified: test mail\")\n    return email_data\n", "entry_point": "modify_email", "input": "'email'", "output": "'email'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12643_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005394", "code": "from typing import List\ndef is_sum_multiple_of_5(numbers: List[int]) -> bool:\n    total_sum = sum(numbers)\n    return total_sum % 5 == 0\n", "entry_point": "is_sum_multiple_of_5", "input": "[1, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005395", "code": "def get_reward(win_type_nm):\n    if win_type_nm == 'jackpot':\n        return \"Congratulations! You've won the jackpot!\"\n    elif win_type_nm == 'bonus':\n        return \"Great job! You've earned a bonus reward!\"\n    elif win_type_nm == 'match':\n        return \"Nice! You've matched a win!\"\n    else:\n        return \"Sorry, no reward this time. Try again!\"\n", "entry_point": "get_reward", "input": "'bonus'", "output": "\"Great job! You've earned a bonus reward!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97895_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "47", "output": "{1, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt46", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005397", "code": "def timecode_to_frames(tc, framerate):\n    components = tc.split(':')\n    hours = int(components[0])\n    minutes = int(components[1])\n    seconds = int(components[2])\n    frames = int(components[3])\n    total_frames = frames + seconds * framerate + minutes * framerate * 60 + hours * framerate * 60 * 60\n    return total_frames\n", "entry_point": "timecode_to_frames", "input": "'00:00:00:03', 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42773_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005398", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2717", "output": "{1, 11, 13, 143, 209, 19, 247, 2717}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2716", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005399", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1336", "output": "{1, 2, 4, 167, 8, 334, 1336, 668}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1335", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005400", "code": "def calculate_average(scores):\n    if len(scores) == 0:\n        return 0\n    sorted_scores = sorted(scores)\n    total = sum(sorted_scores[1:])  # Exclude the lowest score\n    average = total / len(sorted_scores[1:])\n    return average\n", "entry_point": "calculate_average", "input": "[80, 85, 85, 85]", "output": "85.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22852_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005401", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'eoom.com'", "output": "'eoom.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005402", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 2, 2, 2, 2, 2, 21]", "output": "252", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005403", "code": "from typing import List, Dict, Any\ndef filter_not_equal(data: List[Dict[str, Any]], key: str, value: Any) -> List[Dict[str, Any]]:\n    filtered_data = []\n    for item in data:\n        if key in item and item[key] != value:\n            filtered_data.append(item)\n    return filtered_data\n", "entry_point": "filter_not_equal", "input": "[], 'key', 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139173_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005404", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[7]", "output": "[7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005405", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.7.2777'", "output": "(3, 7, 2777)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005406", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[5, 1, 1, 3]", "output": "[6, 2, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112873_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "229", "output": "{1, 229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt228", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005408", "code": "from typing import List\ndef calculate_average_length(strings: List[str]) -> int:\n    total_length = 0\n    for s in strings:\n        processed_str = s.strip()  # Remove leading and trailing whitespaces\n        actual_length = len(processed_str)\n        total_length += actual_length\n    average_length = total_length / len(strings)\n    return round(average_length)\n", "entry_point": "calculate_average_length", "input": "['hello', 'world!', 'apple', 'banana']", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78504_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005409", "code": "# Define the function to check if a URL is in the list\ndef check_url_in_list(url):\n    local_urls = ['abc.com', 'example.com']  # List of URLs to be monitored (local scope)\n    return url in local_urls\n", "entry_point": "check_url_in_list", "input": "'abc.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120185_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005410", "code": "from typing import List\ndef calculate_accuracy(test_results: List[int]) -> float:\n    num_reads = 0\n    num_correct = 0\n    for result in test_results:\n        num_reads += 1\n        if result == 1:\n            num_correct += 1\n    if num_reads == 0:\n        return 0.0\n    else:\n        return (num_correct / num_reads) * 100\n", "entry_point": "calculate_accuracy", "input": "[1, 0, 0, 0, 0]", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10794_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005411", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'IP', 'HI'", "output": "'In Progress - Highest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005412", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 1, 3, 7, 7, 1, 4, 5, 1]", "output": "[4, 2, 5, 10, 11, 6, 10, 12, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005413", "code": "import ast\ndef count_entities(code_snippet):\n    tree = ast.parse(code_snippet)\n    variables = functions = classes = 0\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign):\n            variables += len(node.targets)\n        elif isinstance(node, ast.FunctionDef):\n            functions += 1\n        elif isinstance(node, ast.ClassDef):\n            classes += 1\n    return {\n        'variables': variables,\n        'functions': functions,\n        'classes': classes\n    }\n", "entry_point": "count_entities", "input": "''", "output": "{'variables': 0, 'functions': 0, 'classes': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47175_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005414", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[102, 90, 79, 60, 60, 50, 50]", "output": "[102, 90, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005415", "code": "from typing import List\ndef max_visible_buildings(buildings: List[int]) -> int:\n    slopes = []\n    for i in range(1, len(buildings)):\n        slope = (buildings[i] - buildings[i - 1]) / (i - (i - 1))\n        slopes.append(slope)\n    slopes.sort(reverse=True)\n    visible_buildings = 1\n    max_slope = slopes[0]\n    for slope in slopes[1:]:\n        if slope > max_slope:\n            max_slope = slope\n            visible_buildings += 1\n    return visible_buildings\n", "entry_point": "max_visible_buildings", "input": "[3, 3, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56164_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005416", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[10, 19, 16, 18], 16", "output": "[19, 16, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2578", "output": "{1, 2578, 2, 1289}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2577", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005418", "code": "def find_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    complement_sequence = ''\n    for nucleotide in dna_sequence:\n        complement_sequence += complement_dict.get(nucleotide.upper(), '')  # Handle case-insensitive input\n    return complement_sequence\n", "entry_point": "find_complement", "input": "'AAA'", "output": "'TTT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101417_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005419", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[-2, -2, 12, 1, -1, -2, -2, 0, 0]", "output": "[-2, -2, 12, 1, -1, -2, -2, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005420", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1979", "output": "{1, 1979}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005421", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[4, 2]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005422", "code": "def evaluate_conditions(obj):\n    if obj[1] <= 2:\n        if obj[9] > 0.0:\n            if obj[8] <= 2.0:\n                return True\n            elif obj[8] > 2.0:\n                return False\n            else:\n                return False\n        elif obj[9] <= 0.0:\n            return False\n        else:\n            return False\n    elif obj[1] > 2:\n        return False\n    else:\n        return False\n", "entry_point": "evaluate_conditions", "input": "[0, 3, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6729_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005423", "code": "def play_game(grid):\n    def dfs(row, col):\n        if row < 0 or row >= len(grid) or col < 0 or col >= len(grid[0]) or grid[row][col] == '1' or visited[row][col]:\n            return False\n        if grid[row][col] == '1':\n            return True\n        visited[row][col] = True\n        directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n        for dr, dc in directions:\n            if dfs(row + dr, col + dc):\n                return True\n        return False\n    visited = [[False for _ in range(len(grid[0]))] for _ in range(len(grid))]\n    return dfs(0, 0)\n", "entry_point": "play_game", "input": "[['0', '0'], ['0', '0']]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23720_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005424", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'app.config.AuthBCCConfig'", "output": "'AuthBCCConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005425", "code": "def next_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "next_semantic_version", "input": "'0.9.9'", "output": "'1.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143821_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005426", "code": "import sys\ndef get_open_command(platform, disk_location):\n    if platform == \"linux2\":\n        return 'xdg-open \"%s\"' % disk_location\n    elif platform == \"darwin\":\n        return 'open \"%s\"' % disk_location\n    elif platform == \"win32\":\n        return 'cmd.exe /C start \"Folder\" \"%s\"' % disk_location\n    else:\n        raise Exception(\"Platform '%s' is not supported.\" % platform)\n", "entry_point": "get_open_command", "input": "'linux2', '/home/user/file.pdf'", "output": "'xdg-open \"/home/user/file.pdf\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32294_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005427", "code": "import itertools\ndef count_unique_combinations(items, k):\n    unique_combinations = list(itertools.combinations(items, k))\n    return len(unique_combinations)\n", "entry_point": "count_unique_combinations", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 1", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23071_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005428", "code": "def longest_increasing_sequence_length(nums):\n    if not nums:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "longest_increasing_sequence_length", "input": "[1, 2, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79552_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005429", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2225", "output": "{89, 1, 5, 2225, 25, 445}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2224", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005430", "code": "from typing import List\ndef autocomplete_suggestions(suggestions: List[str], search_term: str) -> List[str]:\n    matching_suggestions = []\n    search_term_lower = search_term.lower()\n    for suggestion in suggestions:\n        if search_term_lower in suggestion.lower():\n            matching_suggestions.append(suggestion)\n    return matching_suggestions\n", "entry_point": "autocomplete_suggestions", "input": "['apple', 'banana', 'grape'], 'orange'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7169", "output": "{107, 1, 67, 7169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005432", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "'*italicized'", "output": "'*italicized\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6034", "output": "{1, 2, 7, 3017, 14, 431, 6034, 862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005434", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0  # Return 0 if the list of scores is empty\n    total_score = sum(scores)\n    num_scores = len(scores)\n    if num_scores == 0:\n        return 0  # Return 0 if there are no scores in the list\n    average_score = total_score / num_scores\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 86]", "output": "85.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84021_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005435", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mtr.sync.ps.Mig'", "output": "('mtr.sync.ps', 'Mig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005436", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'Nene'", "output": "'nene.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005437", "code": "def process_list(lst):\n    length = len(lst)\n    if length % 2 == 1:  # Odd number of elements\n        middle_index = length // 2\n        return lst[:middle_index] + lst[middle_index + 1:]\n    else:  # Even number of elements\n        middle_index = length // 2\n        return lst[:middle_index - 1] + lst[middle_index + 1:]\n", "entry_point": "process_list", "input": "[5, 2, 4, 1, 3, 6, 0, 1, 4, 1]", "output": "[5, 2, 4, 1, 0, 1, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52704_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005438", "code": "heightGrowableTypes = [\"BitmapCanvas\", \"CodeEditor\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"RadioGroup\", \"StaticBox\", \"TextArea\", \"Tree\"]\nwidthGrowableTypes = [\"BitmapCanvas\", \"CheckBox\", \"Choice\", \"CodeEditor\", \"ComboBox\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"PasswordField\", \"RadioGroup\", \"Spinner\", \"StaticBox\", \"StaticText\", \"TextArea\", \"TextField\", \"Tree\"]\ngrowableTypes = [\"Gauge\", \"Slider\", \"StaticLine\"]\ndef getGrowthBehavior(elementType):\n    if elementType in growableTypes:\n        return \"Both-growable\"\n    elif elementType in heightGrowableTypes:\n        return \"Height-growable\"\n    elif elementType in widthGrowableTypes:\n        return \"Width-growable\"\n    else:\n        return \"Not-growable\"\n", "entry_point": "getGrowthBehavior", "input": "'Button'", "output": "'Not-growable'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41927_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005439", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9785", "output": "{1, 515, 1957, 5, 103, 19, 9785, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005440", "code": "def parse_list_of_lists(all_groups_str):\n    all_groups_str = all_groups_str.strip()[1:-1]  # Remove leading and trailing square brackets\n    groups = []\n    for line in all_groups_str.split(',\\n'):\n        group = [int(val) for val in line.strip()[1:-1].split(', ')]\n        groups.append(group)\n    return groups\n", "entry_point": "parse_list_of_lists", "input": "'[[4]]'", "output": "[[4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39140_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005441", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'zab', 1", "output": "'abc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65928_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005442", "code": "def calculate_weighted_average(probabilities):\n    weighted_sum = 0\n    for value, probability in probabilities.items():\n        weighted_sum += value * probability\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "{0: 0.5, 1: 0.5}", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63042_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005443", "code": "def count_even_numbers(lst):\n    count = 0\n    for num in lst:\n        if num % 2 == 0:\n            count += 1\n    return count\n", "entry_point": "count_even_numbers", "input": "[2, 2, 2, 2, 2, 2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39285_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005444", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documentutc/imagt'", "output": "('local', 'documentutc/imagt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005445", "code": "from typing import List, Dict\nPrivProtocolMap = {\n    \"DES\": \"config.usmDESPrivProtocol\",\n    \"3DES\": \"config.usm3DESEDEPrivProtocol\",\n    \"AES\": \"config.usmAesCfb128Protocol\",\n    \"AES128\": \"config.usmAesCfb128Protocol\",\n    \"AES192\": \"config.usmAesCfb192Protocol\",\n    \"AES192BLMT\": \"config.usmAesBlumenthalCfb192Protocol\",\n    \"AES256\": \"config.usmAesCfb256Protocol\",\n    \"AES256BLMT\": \"config.usmAesBlumenthalCfb256Protocol\",\n    \"NONE\": \"config.usmNoPrivProtocol\",\n}\ndef generate_config_map(protocols: List[str]) -> Dict[str, str]:\n    config_map = {}\n    for protocol in protocols:\n        if protocol in PrivProtocolMap:\n            config_map[protocol] = PrivProtocolMap[protocol]\n    return config_map\n", "entry_point": "generate_config_map", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137810_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005446", "code": "def calculate_sum_of_digits(port, connection_key):\n    total_sum = 0\n    for digit in str(port) + str(connection_key):\n        total_sum += int(digit)\n    return total_sum\n", "entry_point": "calculate_sum_of_digits", "input": "999, 7", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102611_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005447", "code": "def sum_divisible_numbers(start, end, divisor):\n    total_sum = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_numbers", "input": "5, 3, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119149_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005448", "code": "def calculate_char_frequency(input_string):\n    input_string = input_string.upper()\n    frequency = {}\n    for char in input_string:\n        if char != \" \":\n            if char in frequency:\n                frequency[char] += 1\n            else:\n                frequency[char] = 1\n    return frequency\n", "entry_point": "calculate_char_frequency", "input": "'WORLD!'", "output": "{'W': 1, 'O': 1, 'R': 1, 'L': 1, 'D': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50071_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005449", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[7.67]", "output": "7.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005450", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'AAABBBCCDD'", "output": "{'A': 3, 'B': 3, 'C': 2, 'D': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005451", "code": "def find_pairs(lst, target_sum):\n    seen = {}\n    pairs = []\n    for num in lst:\n        complement = target_sum - num\n        if complement in seen:\n            pairs.append((num, complement))\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs", "input": "[4, 4, 4], 8", "output": "[(4, 4), (4, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52644_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005452", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[56, 55, 56, 55, 1, 55], 3", "output": "[1, 55, 55, 55, 56, 56]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005453", "code": "def rearrange_string(s):\n    s = list(s)\n    left, right = 0, len(s) - 1\n    while left < right:\n        while left < right and s[left].islower():\n            left += 1\n        while left < right and s[right].isupper():\n            right -= 1\n        if left < right:\n            s[left], s[right] = s[right], s[left]\n    return ''.join(s)\n", "entry_point": "rearrange_string", "input": "'dcDD'", "output": "'dcDD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134334_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005454", "code": "from typing import List\ndef average_absolute_differences(list1: List[int], list2: List[int]) -> float:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    absolute_diffs = [abs(x - y) for x, y in zip(list1, list2)]\n    average_diff = sum(absolute_diffs) / len(absolute_diffs)\n    return round(average_diff, 4)  # Rounding to 4 decimal places\n", "entry_point": "average_absolute_differences", "input": "[2, 3, 1], [4, 5, 2]", "output": "1.6667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72862_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005455", "code": "def prepare_argument(arg, num):\n    if isinstance(arg, float):\n        return [arg] * num\n    try:\n        evaluated_arg = eval(arg)\n        if isinstance(evaluated_arg, list):\n            return evaluated_arg\n    except:\n        pass\n    return [arg] * num\n", "entry_point": "prepare_argument", "input": "42, 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81072_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005456", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[0, 3, 2, 2, 1, 1, 0, 3, 3]", "output": "[0, 4, 4, 5, 5, 6, 6, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005457", "code": "def determine_db_connection_type(token_host: str) -> str:\n    if token_host == 'redis':\n        return 'redis'\n    else:\n        return 'sql'\n", "entry_point": "determine_db_connection_type", "input": "'mysql'", "output": "'sql'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127494_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005458", "code": "def sum_of_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[-2, -6]", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31055_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005459", "code": "def modular_inverse(a, m):\n    def egcd(a, b):\n        if a == 0:\n            return (b, 0, 1)\n        else:\n            g, x, y = egcd(b % a, a)\n            return (g, y - (b // a) * x, x)\n    g, x, y = egcd(a, m)\n    if g != 1:\n        return None\n    else:\n        return x % m\n", "entry_point": "modular_inverse", "input": "12, 13", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35681_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005460", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[6, 12, 18]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005461", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "4, 4", "output": "('0', '7')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005462", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9097", "output": "{1, 9097, 11, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005463", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "11", "output": "'SetPositions'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005464", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[6, 1, 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91583_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4345", "output": "{1, 5, 869, 11, 395, 79, 55, 4345}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005466", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "6", "output": "'0246810'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005467", "code": "def min_changes_to_queue(queue):\n    min_changes = 0\n    max_height = 0\n    for height in reversed(queue):\n        if height > max_height:\n            min_changes += 1\n        max_height = max(max_height, height)\n    return min_changes\n", "entry_point": "min_changes_to_queue", "input": "[1, 3, 2, 4, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115403_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005468", "code": "def sum_of_squares(nums: list[int]) -> int:\n    \"\"\"\n    Calculate the sum of squares of integers in the input list.\n    Args:\n    nums: A list of integers.\n    Returns:\n    The sum of the squares of the integers in the input list.\n    \"\"\"\n    return sum(num**2 for num in nums)\n", "entry_point": "sum_of_squares", "input": "[8, 6, 4]", "output": "116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57390_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005469", "code": "def create_image(pixel_values):\n    side_length = int(len(pixel_values) ** 0.5)\n    image = [[0 for _ in range(side_length)] for _ in range(side_length)]\n    for i in range(side_length):\n        for j in range(side_length):\n            image[i][j] = pixel_values[i * side_length + j]\n    return image\n", "entry_point": "create_image", "input": "[192, 160, 129, 129]", "output": "[[192, 160], [129, 129]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113012_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005470", "code": "def identify_os(gcc_version_string):\n    if \"Apple LLVM\" in gcc_version_string:\n        return \"Mac\"\n    elif \"Ubuntu\" in gcc_version_string:\n        return \"Ubuntu\"\n    elif \"Windows\" in gcc_version_string:\n        return \"Windows\"\n    else:\n        return \"Unknown\"\n", "entry_point": "identify_os", "input": "'Linux'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9045_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005471", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[10, 20, 3]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005472", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "11", "output": "2048", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005473", "code": "from typing import List\ndef process_subnet_rules(output: str) -> List[str]:\n    subnet_rules = []\n    for line in output.split('\\n'):\n        if ' via ' in line and ' dev ' in line:\n            subnet_rules.append(line)\n    return subnet_rules\n", "entry_point": "process_subnet_rules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4019_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005474", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'84'", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5981", "output": "{1, 5981}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005476", "code": "import errno\ndef process_socket_errors(sock_errors: dict) -> dict:\n    sockErrors = {errno.ESHUTDOWN: True,\n                  errno.ENOTCONN: True,\n                  errno.ECONNRESET: False,\n                  errno.ECONNREFUSED: False,\n                  errno.EAGAIN: False,\n                  errno.EWOULDBLOCK: False}\n    if hasattr(errno, 'EBADFD'):\n        sockErrors[errno.EBADFD] = True\n    ignore_status = {}\n    for error_code in sock_errors:\n        ignore_status[error_code] = sockErrors.get(error_code, False)\n    return ignore_status\n", "entry_point": "process_socket_errors", "input": "{77: 0, 105: 0, 78: 0}", "output": "{77: True, 105: False, 78: False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12691_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005477", "code": "TEST_THREAD_NETWORK_IDS = [\n    bytes.fromhex(\"fedcba9876543210\"),\n]\nTEST_WIFI_SSID = \"TestSSID\"\nTEST_WIFI_PASS = \"<PASSWORD>\"\nWIFI_NETWORK_FEATURE_MAP = 1\nTHREAD_NETWORK_FEATURE_MAP = 2\ndef get_network_feature_map(network_type):\n    if network_type == \"Wi-Fi\":\n        return WIFI_NETWORK_FEATURE_MAP\n    elif network_type == \"Thread\":\n        return THREAD_NETWORK_FEATURE_MAP\n    else:\n        return \"Invalid network type\"\n", "entry_point": "get_network_feature_map", "input": "'Wi-Fi'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132054_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005478", "code": "def count_students_above_average(scores):\n    total_scores = len(scores)\n    total_sum = sum(scores)\n    average_score = total_sum / total_scores\n    count_above_average = 0\n    for score in scores:\n        if score >= average_score:\n            count_above_average += 1\n    return count_above_average\n", "entry_point": "count_students_above_average", "input": "[10, 50, 70, 80, 90, 100]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84218_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005479", "code": "from typing import List\ndef remove_and_count(lst: List[int], target: int) -> int:\n    count = 0\n    i = 0\n    while i < len(lst):\n        if lst[i] == target:\n            lst.pop(i)\n            count += 1\n        else:\n            i += 1\n    print(\"Modified list:\", lst)\n    return count\n", "entry_point": "remove_and_count", "input": "[1, 2, 3], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134776_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005480", "code": "def find_highest_score(student_scores):\n    highest_score = 0\n    for score in student_scores:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[72, 85, 91, 67]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8042_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1973", "output": "{1, 1973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005482", "code": "def process_query(query: str, operator: str) -> dict:\n    parts = [x.strip() for x in operator.split(query)]\n    assert len(parts) in (1, 3), \"Invalid query format\"\n    query_key = parts[0]\n    result = {query_key: {}}\n    return result\n", "entry_point": "process_query", "input": "'some_query', '>>>>'", "output": "{'>>>>': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13586_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005483", "code": "def schedule_jobs(jobs):\n    # Sort the jobs based on their durations in ascending order\n    sorted_jobs = sorted(jobs, key=lambda x: x[1])\n    # Extract and return the job types in the sorted order\n    sorted_job_types = [job[0] for job in sorted_jobs]\n    return sorted_job_types\n", "entry_point": "schedule_jobs", "input": "[('Job1', 5), ('Job2', 2), ('Job3', 10)]", "output": "['Job2', 'Job1', 'Job3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16397_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3941", "output": "{1, 563, 3941, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005485", "code": "def max_subset_sum_non_adjacent(arr):\n    inclusive = 0\n    exclusive = 0\n    for num in arr:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update inclusive as the sum of previous exclusive and current element\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[10, 5, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38682_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005486", "code": "def simulate_card_game(N, cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A wins\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "simulate_card_game", "input": "2, [1, 1]", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2279_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005487", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5089", "output": "{1, 727, 5089, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005488", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[6, 5, 7, 4, 9, 4, 8, 5], -2, 6", "output": "[24, 18, 30, 12, 42, 12, 36, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005489", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[3, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[3, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005490", "code": "def validate_environment_info(info):\n    if \"python\" not in info or \"platform\" not in info or \"packages\" not in info:\n        return False\n    if not info[\"python\"] or not info[\"platform\"]:\n        return False\n    if not isinstance(info[\"packages\"], list) or len(info[\"packages\"]) == 0:\n        return False\n    required_packages = {\"modelforge\", \"asdf\", \"numpy\"}\n    packages_set = set(p[0] for p in info[\"packages\"])\n    if not required_packages.issubset(packages_set):\n        return False\n    return True\n", "entry_point": "validate_environment_info", "input": "{'python': '3.8', 'platform': 'linux'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109335_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005491", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5963", "output": "{89, 1, 67, 5963}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005492", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        line = [i**2]\n        for j in range(i - 1):\n            line.append(line[-1] - 1)\n        pattern.append(line)\n    return pattern\n", "entry_point": "generate_pattern", "input": "2", "output": "[[1], [4, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10987_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005493", "code": "def format_messages(actions):\n    formatted_messages = {}\n    PACK_VERIFY_KEY = \"PACK_VERIFY_KEY\"\n    for action in actions:\n        if \"delete\" in action:\n            formatted_messages[action] = f'{action} \"{{{PACK_VERIFY_KEY}}}\"'\n        elif \"set\" in action:\n            formatted_messages[action] = f'{action} \"{{{PACK_VERIFY_KEY}}}\" to {{}}'\n    return formatted_messages\n", "entry_point": "format_messages", "input": "['settthe']", "output": "{'settthe': 'settthe \"{PACK_VERIFY_KEY}\" to {}'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134938_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2909", "output": "{1, 2909}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005495", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9795", "output": "{1, 3265, 3, 9795, 5, 1959, 653, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9794", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005496", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[60]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005497", "code": "def insert_position(scores, new_score):\n    position = 0\n    for score in scores:\n        if new_score >= score:\n            position += 1\n        else:\n            break\n    return position\n", "entry_point": "insert_position", "input": "[10, 20, 30, 40, 50], 60", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26274_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6043", "output": "{1, 6043}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8566", "output": "{1, 2, 4283, 8566}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8565", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005500", "code": "# Step 1: Define a dictionary mapping English words to their phonetic representations\nphonetic_dict = {\n    \"hello\": [\"HH\", \"AH\", \"L\", \"OW\"],\n    \"world\": [\"W\", \"ER\", \"L\", \"D\"],\n    \"example\": [\"IH\", \"G\", \"Z\", \"AE\", \"M\", \"P\", \"AH\", \"L\"]\n    # Add more word-phonetic pairs as needed\n}\n# Step 2: Implement the get_g2p(word) function\ndef get_g2p(word):\n    return phonetic_dict.get(word.lower(), [])  # Return the phonetic representation if word exists in the dictionary, else return an empty list\n", "entry_point": "get_g2p", "input": "'hello'", "output": "['HH', 'AH', 'L', 'OW']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21781_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005501", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    if trimmed_scores:\n        return sum(trimmed_scores) / len(trimmed_scores)\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[75, 78, 80, 82, 85]", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124520_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1347", "output": "{3, 1, 1347, 449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005503", "code": "def parse_modeline(code: str) -> dict:\n    modeline_prefix = '# pylama:'\n    params = {}\n    for line in code.splitlines():\n        if modeline_prefix in line:\n            modeline = line[line.index(modeline_prefix) + len(modeline_prefix):].strip()\n            for param in modeline.split(':'):\n                key, value = param.split('=')\n                params[key.strip()] = value.strip()\n    return params\n", "entry_point": "parse_modeline", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146854_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005504", "code": "def count_max_progress(progress_list):\n    max_progress_count = 0\n    for progress in progress_list:\n        if progress == 10:\n            max_progress_count += 1\n    return max_progress_count\n", "entry_point": "count_max_progress", "input": "[1, 2, 3, 10]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93593_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005505", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[10, 10, 0, 8]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005506", "code": "def calculate_sign(num):\n    if num < 0:\n        return -1\n    elif num > 0:\n        return 1\n    else:\n        return 0\n", "entry_point": "calculate_sign", "input": "5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104894_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005507", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'RRRRDD'", "output": "(4, -2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005508", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 2, 4, 8, 2, 2, 7, 2, 2]", "output": "[2, 3, 6, 11, 6, 7, 13, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005509", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2 and element not in common_elements:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[3, 1, 2], [3, 4, 5]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23619_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6119", "output": "{1, 211, 29, 6119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005511", "code": "def sum_of_squares_even(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15719_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005512", "code": "import re\ndef isDone(qstat_job):\n    status_list = qstat_job.strip().split()\n    if len(status_list) == 1:\n        return True\n    for status in status_list:\n        if re.match(\"d.*\", status):\n            return True\n    return False\n", "entry_point": "isDone", "input": "'running pending queued'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77573_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005513", "code": "def sum_multiples(nums):\n    total = 0\n    seen = set()  # To keep track of numbers already added to avoid duplicates\n    for num in nums:\n        if num in seen:  # Skip if the number is already added\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[1, 2, 3, 4, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5699_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005514", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 15]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142512_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005515", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3469", "output": "{1, 3469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005516", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005517", "code": "def process_arguments(args):\n    if len(args) in {2, 4, 7}:\n        ip = args[1]\n        return ip\n    else:\n        return 'Error: Invalid argument length'\n", "entry_point": "process_arguments", "input": "['first_arg', '127.0.0.1']", "output": "'127.0.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47272_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005518", "code": "import re\ndef extract_flags_info(code_snippet):\n    flags_info = {}\n    flag_pattern = r\"flags.DEFINE_(string|integer|float)\\('(\\w+)', '(.+)', '(.+)'\\)\"\n    flags = re.findall(flag_pattern, code_snippet)\n    for flag_type, flag_name, flag_desc, flag_value in flags:\n        if flag_type == 'string':\n            flags_info[flag_name] = (flag_desc, flag_value)\n        elif flag_type == 'integer':\n            flags_info[flag_name] = (flag_desc, int(flag_value))\n        elif flag_type == 'float':\n            flags_info[flag_name] = (flag_desc, float(flag_value))\n    return flags_info\n", "entry_point": "extract_flags_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94253_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005519", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'John', 'Doe', 'Smith'", "output": "'John Doe Smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005520", "code": "def reverse_words(input_string):\n    # Split the input string into individual words\n    words = input_string.split()\n    # Reverse each word in the list of words\n    reversed_words = [word[::-1] for word in words]\n    # Join the reversed words back together into a single string\n    reversed_string = ' '.join(reversed_words)\n    return reversed_string\n", "entry_point": "reverse_words", "input": "'old'", "output": "'dlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149182_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "82", "output": "{1, 82, 2, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt81", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005522", "code": "def find_highest_score(student_scores):\n    highest_score = 0\n    for score in student_scores:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[50, 80, 90, 70]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005523", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the '.' delimiter\n    version_components = version_string.split('.')\n    # Extract major, minor, and patch version numbers\n    major_version = int(version_components[0])\n    minor_version = int(version_components[1])\n    patch_version = int(version_components[2])\n    return major_version, minor_version, patch_version\n", "entry_point": "extract_version_numbers", "input": "'2.7.1'", "output": "(2, 7, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146914_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005524", "code": "def get_latest_versions(packages):\n    latest_versions = {}\n    for package in packages:\n        name = package['name']\n        version = package['version']\n        if name not in latest_versions or version > latest_versions[name]:\n            latest_versions[name] = version\n    return latest_versions\n", "entry_point": "get_latest_versions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11867_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005525", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(0, 254, 1)", "output": "'#00FE01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9739", "output": "{1, 9739}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005527", "code": "def _lik_formulae(lik):\n    lik_formulas = {\n        \"bernoulli\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"probit\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=\u03a6(x)\\n\",\n        \"binomial\": \" for y\u1d62 ~ Binom(\u03bc\u1d62=g(z\u1d62), n\u1d62) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"poisson\": \" for y\u1d62 ~ Poisson(\u03bb\u1d62=g(z\u1d62)) and g(x)=e\u02e3\\n\"\n    }\n    return lik_formulas.get(lik, \"\\n\")\n", "entry_point": "_lik_formulae", "input": "''", "output": "'\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106790_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005528", "code": "def validate_identity_number(identity_number: str) -> bool:\n    # Check if the length is exactly 11 characters\n    if len(identity_number) != 11:\n        return False\n    # Check if all characters are numeric\n    if not identity_number.isdigit():\n        return False\n    # Check if the first character is not '0'\n    if identity_number[0] == '0':\n        return False\n    return True\n", "entry_point": "validate_identity_number", "input": "'01234567890'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25980_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005529", "code": "import re\ndef is_valid_email(email):\n    if email.count('@') != 1:\n        return False\n    local_part, domain_part = email.split('@')\n    if not (1 <= len(local_part) <= 64 and 1 <= len(domain_part) <= 255):\n        return False\n    if not re.match(r'^[a-zA-Z0-9._-]+$', local_part):\n        return False\n    if not re.match(r'^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$', domain_part):\n        return False\n    return True\n", "entry_point": "is_valid_email", "input": "'user.name@example.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143618_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005530", "code": "def string_replace(to_find_string: str, replace_string: str, target_string: str) -> str:\n    index = target_string.find(to_find_string)\n    if index == -1:\n        return target_string\n    beginning = target_string[:index]\n    end = target_string[index + len(to_find_string):]\n    new_string = beginning + replace_string + end\n    return new_string\n", "entry_point": "string_replace", "input": "'them', 'Th', 'brothem'", "output": "'broTh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61704_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005531", "code": "from typing import List\nfrom json import loads\ndef extract_errors(api_response: str) -> List[str]:\n    try:\n        response_dict = loads(api_response)\n        errors_list = response_dict.get(\"errors\", [])\n        error_messages = [error.get(\"message\") for error in errors_list]\n        return error_messages\n    except Exception as e:\n        print(f\"Error processing API response: {e}\")\n        return []\n", "entry_point": "extract_errors", "input": "'{\"data\": \"some data\"}'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36034_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005532", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1551", "output": "{1, 33, 3, 517, 11, 141, 1551, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005533", "code": "def convert_memory_size(memory_size):\n    units = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n    conversion_rates = [1, 1024, 1024**2, 1024**3, 1024**4]\n    for idx, rate in enumerate(conversion_rates):\n        if memory_size < rate or idx == len(conversion_rates) - 1:\n            converted_size = memory_size / conversion_rates[idx - 1]\n            return f\"{converted_size:.2f} {units[idx - 1]}\"\n", "entry_point": "convert_memory_size", "input": "1073741824", "output": "'1.00 GB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149300_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005534", "code": "def card_war_winner(N, deck1, deck2):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    if player1_points > player2_points:\n        return \"Player 1\"\n    elif player2_points > player1_points:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "card_war_winner", "input": "3, [1, 2, 3], [1, 2, 3]", "output": "'Tie'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20743_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005535", "code": "import ast\ndef extract_properties(class_definition):\n    class_ast = ast.parse(class_definition)\n    properties_dict = None\n    for node in ast.walk(class_ast):\n        if isinstance(node, ast.Assign) and isinstance(node.value, ast.Dict):\n            for target in node.targets:\n                if isinstance(target, ast.Name) and target.id == 'properties':\n                    properties_dict = node.value\n    if properties_dict is None:\n        return []\n    property_names = [key.s for key in properties_dict.keys if isinstance(key, ast.Str)]\n    return property_names\n", "entry_point": "extract_properties", "input": "'class MyClass:\\n    pass'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130290_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005536", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'111.3.3-22.gdf811gg3'", "output": "'111.3.3+22.gdf811gg3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6092", "output": "{1, 2, 4, 3046, 6092, 1523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6091", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005538", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "9, 1", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005539", "code": "from typing import List\ndef calculate_average_score(scores: List[int], threshold: int) -> float:\n    valid_scores = [score for score in scores if score >= threshold]\n    if not valid_scores:\n        return 0.0  # Return 0 if no scores are above the threshold\n    total_valid_scores = sum(valid_scores)\n    average_score = total_valid_scores / len(valid_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 85, 80], 80", "output": "82.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74900_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005540", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[4, 4, 1, 2, 3], 2", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005541", "code": "def extract_directives(documentation: str) -> dict:\n    directives = {}\n    lines = documentation.split('\\n')\n    for line in lines:\n        if line.startswith('.. rst:directive:: .. c:module::'):\n            directive, _, filename = line.partition('::')\n            directives[directive.strip()] = filename.strip()\n    return directives\n", "entry_point": "extract_directives", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43901_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005542", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 6, 9, 6, 7]", "output": "[6, 6, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt26", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005543", "code": "def simulate_game(grid, instructions):\n    m, n = len(grid), len(grid[0])\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    x, y = 0, 0  # Initial position\n    for move in instructions:\n        dx, dy = directions[move]\n        new_x, new_y = x + dx, y + dy\n        if 0 <= new_x < m and 0 <= new_y < n and grid[new_x][new_y] == 0:\n            x, y = new_x, new_y\n    return x, y\n", "entry_point": "simulate_game", "input": "[[0], [0]], 'D'", "output": "(1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90203_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005544", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[-8, -4, -2, 8, 3, 0, 0, 0, 4]", "output": "[64, 16, 4, 64, 27, 0, 0, 0, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005545", "code": "from typing import List\ndef rotate_image(image: List[List[int]]) -> List[List[int]]:\n    n = len(image)\n    # Transpose the matrix\n    for i in range(n):\n        for j in range(i+1, n):\n            image[i][j], image[j][i] = image[j][i], image[i][j]\n    # Reverse each row\n    for i in range(n):\n        image[i] = image[i][::-1]\n    return image\n", "entry_point": "rotate_image", "input": "[[1]]", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43613_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005546", "code": "def repeat_characters(s: str) -> str:\n    output = \"\"\n    for char in s:\n        output += char * 2\n    return output\n", "entry_point": "repeat_characters", "input": "'hello'", "output": "'hheelllloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63922_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005547", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6712", "output": "{1, 2, 4, 839, 8, 1678, 6712, 3356}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6711", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005548", "code": "import math\n# Constants\nRDISK = 17  # Encoder disk on the right rear wheel\nCSPD = 1  # Curve speed\nTDIST = 0.3  # Threshold distance for the distance sensor\n# Function to calculate distance traveled by the robot\ndef calculate_distance_traveled(initial_reading, final_reading):\n    # Calculate circumference of the wheel\n    radius = RDISK / (2 * math.pi)\n    circumference = 2 * math.pi * radius\n    # Calculate distance traveled\n    distance = (final_reading - initial_reading) * circumference\n    return distance\n", "entry_point": "calculate_distance_traveled", "input": "0, 49", "output": "833.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111364_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005549", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/home/./documen.txt'", "output": "'/home/documen.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005550", "code": "def get_aws_service_endpoint(region):\n    region_string = region.lower()\n    if region_string.startswith(\"cn-\"):\n        return \"aws-cn\"\n    elif region_string.startswith(\"us-gov\"):\n        return \"aws-us-gov\"\n    else:\n        return \"aws\"\n", "entry_point": "get_aws_service_endpoint", "input": "'cn-north-1'", "output": "'aws-cn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70670_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4867", "output": "{1, 4867, 157, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4339", "output": "{1, 4339}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005553", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[75, 76, 78, 79, 88]", "output": "77.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146620_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005554", "code": "from typing import List\ndef find_first_zero(arr: List[int]) -> int:\n    index = 0\n    for num in arr:\n        if num == 0:\n            return index\n        index += 1\n    return -1\n", "entry_point": "find_first_zero", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79416_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005555", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4927", "output": "{1, 379, 13, 4927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005556", "code": "from collections import deque\ndef new_year_chaos(n, q):\n    acc = 0\n    expect = list(range(1, n + 1))\n    q = deque(q)\n    while q:\n        iof = expect.index(q[0])\n        if iof > 2:\n            return 'Too chaotic'\n        else:\n            acc += iof\n            expect.remove(q[0])\n            q.popleft()\n    return acc\n", "entry_point": "new_year_chaos", "input": "5, [5, 1, 2, 3, 4]", "output": "'Too chaotic'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98787_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005557", "code": "from typing import List, Tuple\ndef card_game(deck: List[int]) -> Tuple[int, int]:\n    score_player1 = 0\n    score_player2 = 0\n    for i in range(0, len(deck), 2):\n        if deck[i] > deck[i + 1]:\n            score_player1 += 1\n        else:\n            score_player2 += 1\n    return score_player1, score_player2\n", "entry_point": "card_game", "input": "[3, 1, 4, 2]", "output": "(2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_218_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005558", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'2 * 1'", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005559", "code": "import re\nfrom datetime import datetime\ndef process_string(input_string):\n    current_year = datetime.now().year\n    current_month = datetime.now().strftime('%m')\n    def replace_counter(match):\n        counter_format = match.group(0)\n        min_width = int(counter_format.split(':')[1][1:-1])  # Extract minimum width from the placeholder\n        return str(counter_format.format(counter=process_string.counter).zfill(min_width))\n    process_string.counter = 1\n    placeholders = {\n        '{year}': str(current_year),\n        '{month}': current_month,\n        '{counter:0[1-9]+[0-9]*d}': replace_counter\n    }\n    for placeholder, value in placeholders.items():\n        input_string = re.sub(re.escape(placeholder), str(value) if callable(value) else value, input_string)\n    process_string.counter += 1\n    return input_string\n", "entry_point": "process_string", "input": "'{yeaar'", "output": "'{yeaar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112572_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005560", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'Hello, World! 123'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005561", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[4.0, 4.0]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005562", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'qtof', 'both'", "output": "{'tolerance': 0.01, 'mode': 'both'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005563", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[5, 6, 2, 3, 3, -5, -5, 0, -3]", "output": "[25, 36, 4, 9, 9, 25, 25, 0, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005564", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[5, 5, 5, 2, 4]", "output": "[15, 15, 15, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005565", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[3, 3, 7, 9]", "output": "[81, 49, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005566", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[2, 1, 3, 4, 4, 4, 5, 4], 4", "output": "[2, 1, 3, 5, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5930", "output": "{1, 2, 1186, 5, 5930, 10, 593, 2965}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5929", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005568", "code": "def find_common_prefix(labels):\n    if not labels:\n        return ''\n    common_prefix = ''\n    first_label = labels[0]\n    for i, char in enumerate(first_label):\n        for label in labels[1:]:\n            if i >= len(label) or label[i] != char:\n                return common_prefix\n        common_prefix += char\n    return common_prefix\n", "entry_point": "find_common_prefix", "input": "['apple', 'application', 'april']", "output": "'ap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90010_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005569", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are less than 2 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 87, 88, 90, 95]", "output": "88.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3324_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005570", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[30, 36, 37, 38, 50]", "output": "37.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134450_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005571", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        row = list(range(1, i + 1)) + [i] * (n - i)\n        pattern.append(row)\n    return pattern\n", "entry_point": "generate_pattern", "input": "1", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6444_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005572", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005573", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'ylay', 4", "output": "['ylay']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005574", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/some/path/.hidden'", "output": "'.hidden'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005575", "code": "import unicodedata\ndef count_unique_alphanumeric_chars(input_str):\n    alphanumeric_chars = set()\n    for char in input_str:\n        if unicodedata.category(char).startswith(\"L\") or unicodedata.category(char).startswith(\"N\"):\n            alphanumeric_chars.add(char.lower())\n    return len(alphanumeric_chars)\n", "entry_point": "count_unique_alphanumeric_chars", "input": "'abc1234'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45124_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005576", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9681", "output": "{1, 3, 7, 1383, 461, 9681, 21, 3227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005577", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmo.options.rdmo.optofig'", "output": "('rdmo.options.rdmo', 'optofig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005578", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[10, 5, 4], 19", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005579", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[2, 5, 4, 0]", "output": "[4, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005580", "code": "# Define the plant_recommendation function\ndef plant_recommendation(care):\n    if care == 'low':\n        return 'aloe'\n    elif care == 'medium':\n        return 'pothos'\n    elif care == 'high':\n        return 'orchid'\n", "entry_point": "plant_recommendation", "input": "'high'", "output": "'orchid'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50948_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005581", "code": "def filter_elements(iterable, include_values):\n    filtered_list = []\n    for value in iterable:\n        if value in include_values:\n            filtered_list.append(value)\n    return filtered_list\n", "entry_point": "filter_elements", "input": "[1, 4, 4, 2, 4, 5, 4, 4], {2, 4}", "output": "[4, 4, 2, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46502_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005582", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'../../../..'", "output": "'/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005583", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "10, 10, 10, 8", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005584", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "999", "output": "'Unknown error'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005585", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3482", "output": "{1, 3482, 2, 1741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3481", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005586", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "140", "output": "{1, 2, 35, 4, 5, 70, 7, 10, 140, 14, 20, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt139", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005587", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[85, 78, 92, 65, 90, 87]", "output": "[65, 78, 85, 87, 90, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005588", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7359", "output": "{1, 33, 3, 223, 11, 2453, 669, 7359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005589", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[85, 85, 85, 85, 85], 5", "output": "85.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82034_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "383", "output": "{1, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005591", "code": "def filter_records(record):\n    if 'gnomAD_non_cancer_MAX_AF_POPS_adj' in record and record['gnomAD_non_cancer_MAX_AF_POPS_adj'] == []:\n        return False\n    for key, value in record.items():\n        if value == '':\n            return False\n    return True\n", "entry_point": "filter_records", "input": "{'some_key': 'some_value', 'another_key': 'another_value'}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69599_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005592", "code": "from typing import List\ndef find_missing_number(nums: List[int]) -> int:\n    n = len(nums) + 1\n    expected_sum = n * (n + 1) // 2\n    total_sum = sum(nums)\n    missing_number = expected_sum - total_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101660_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005593", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'John DoeSmith'", "output": "('John', 'DoeSmith')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005594", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 3, 2, 1, 3, 1, 2]", "output": "[8, 5, 3, 4, 4, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34035_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005595", "code": "def count_instances(instances, target_instance_type):\n    count = 0\n    for instance in instances:\n        if instance.get('instance_type') == target_instance_type:\n            count += 1\n    return count\n", "entry_point": "count_instances", "input": "[], 't2.micro'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74819_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005596", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[2, 3, 5, 8, 10]", "output": "[4, 9, 16, 20, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005597", "code": "import os\nimport glob\nJPEG_EXTENSIONS = ('[jJ][pP][gG]', '[jJ][pP][eE][gG]')\ndef find_jpeg_files(directory):\n    jpeg_files = []\n    for ext_pattern in JPEG_EXTENSIONS:\n        search_pattern = os.path.join(directory, f'*.{ext_pattern}')\n        jpeg_files.extend(glob.glob(search_pattern, recursive=True))\n    return jpeg_files\n", "entry_point": "find_jpeg_files", "input": "'/non_existent_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149172_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005598", "code": "import json\ndef calculate_average_utility(input_data):\n    utility_values = input_data.get(\"utility_values\", [])\n    if not utility_values:\n        return 0.00\n    average_utility = sum(utility_values) / len(utility_values)\n    rounded_average = round(average_utility, 2)\n    return rounded_average\n", "entry_point": "calculate_average_utility", "input": "{'utility_values': []}", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52585_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2883", "output": "{1, 961, 3, 2883, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005600", "code": "# Define the expected outputs for each test case\nheader = \"Expected Header\\n\"\nlines = [\"Line 1\\n\", \"Line 2\\n\"]\nfooter = \"Expected Footer\\n\"\ndef run_test(arguments, expected_stdout, expected_stderr):\n    actual_stdout = ''.join([header] + lines + [footer])  # Simulating actual stdout\n    actual_stderr = \"file 'foo-5-0.log' has no results!\\n\"  # Simulating actual stderr\n    if actual_stdout == expected_stdout and actual_stderr == expected_stderr:\n        return \"PASS\"\n    else:\n        return \"FAIL\"\n", "entry_point": "run_test", "input": "None, 'Mismatch Output\\n', 'Some other error message\\n'", "output": "'FAIL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14682_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005601", "code": "def calculate_score(cards):\n    total_score = 0\n    ace_count = 0\n    for card in cards:\n        if card in ['J', 'Q', 'K']:\n            total_score += 10\n        elif card == 'A':\n            ace_count += 1\n        else:\n            total_score += card\n    for _ in range(ace_count):\n        if total_score + 11 <= 21:\n            total_score += 11\n        else:\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['J', 'Q', 'K', 'K', 2]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116780_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005602", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'vtStringConver'", "output": "'vtstringconver'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005603", "code": "TT_EQ = 'EQ'  # =\nTT_LPAREN = 'LPAREN'  # (\nTT_RPAREN = 'RPAREN'  # )\nTT_LSQUARE = 'LSQUARE'\nTT_RSQUARE = 'RSQUARE'\nTT_EE = 'EE'  # ==\nTT_NE = 'NE'  # !=\nTT_LT = 'LT'  # >\nTT_GT = 'GT'  # <\nTT_LTE = 'LTE'  # >=\nTT_GTE = 'GTE'  # <=\nTT_COMMA = 'COMMA'\nTT_ARROW = 'ARROW'\nTT_NEWLINE = 'NEWLINE'\nTT_EOF = 'EOF'\ndef lexer(code):\n    tokens = []\n    i = 0\n    while i < len(code):\n        char = code[i]\n        if char.isspace():\n            i += 1\n            continue\n        if char == '=':\n            tokens.append((TT_EQ, char))\n        elif char == '(':\n            tokens.append((TT_LPAREN, char))\n        elif char == ')':\n            tokens.append((TT_RPAREN, char))\n        elif char == '[':\n            tokens.append((TT_LSQUARE, char))\n        elif char == ']':\n            tokens.append((TT_RSQUARE, char))\n        elif char == '>':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_GTE, '>='))\n                i += 1\n            else:\n                tokens.append((TT_GT, char))\n        elif char == '<':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_LTE, '<='))\n                i += 1\n            else:\n                tokens.append((TT_LT, char))\n        elif char == '!':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_NE, '!='))\n                i += 1\n        elif char == ',':\n            tokens.append((TT_COMMA, char))\n        elif char == '-':\n            if i + 1 < len(code) and code[i + 1] == '>':\n                tokens.append((TT_ARROW, '->'))\n                i += 1\n        elif char.isdigit():\n            num = char\n            while i + 1 < len(code) and code[i + 1].isdigit():\n                num += code[i + 1]\n                i += 1\n            tokens.append(('NUM', num))\n        elif char.isalpha():\n            identifier = char\n            while i + 1 < len(code) and code[i + 1].isalnum():\n                identifier += code[i + 1]\n                i += 1\n            tokens.append(('ID', identifier))\n        elif char == '\\n':\n            tokens.append((TT_NEWLINE, char))\n        i += 1\n    tokens.append((TT_EOF, ''))  # End of file token\n    return tokens\n", "entry_point": "lexer", "input": "'=='", "output": "[('EQ', '='), ('EQ', '='), ('EOF', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28449_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1107", "output": "{1, 3, 27, 9, 41, 369, 1107, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005605", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(-1, 5, 1, 0, 3, 1, 0, 3, 1)", "output": "'-1.5.1.0.3.1.0.3.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005606", "code": "def generate_unique_slug(base_string, existing_slugs):\n    counter = 1\n    slug = base_string\n    while slug in existing_slugs:\n        slug = f'{base_string}-{counter}'\n        counter += 1\n    return slug\n", "entry_point": "generate_unique_slug", "input": "'project', []", "output": "'project'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44340_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005607", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[51, 50, 30, 20]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005608", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[33, 67, 33, 32, 33, 33, 32]", "output": "[33, 67, 33, 32, 33, 33, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005609", "code": "def extract_app_name(config_class: str) -> str:\n    # Split the input string by newline character to get individual lines\n    lines = config_class.split('\\n')\n    # Iterate through each line to find the line containing the app name\n    for line in lines:\n        if 'name =' in line:\n            # Extract the app name by splitting the line and getting the last element\n            app_name = line.split('=')[-1].strip().strip(\"'\")\n            return app_name\n    return \"App name not found\"\n", "entry_point": "extract_app_name", "input": "''", "output": "'App name not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38896_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005610", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[0, 4, 3, 5, 2, 0]", "output": "[0, 2, 5, 3, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005611", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "'hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005612", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[1, 0, 0, 3, 0, 6]", "output": "[-1, 0, 3, -3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005613", "code": "def jaccard_similarity_coefficient(x, y):\n    set_x = set(x)\n    set_y = set(y)\n    intersection_size = len(set_x.intersection(set_y))\n    union_size = len(set_x.union(set_y))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    return intersection_size / union_size\n", "entry_point": "jaccard_similarity_coefficient", "input": "[1, 2], [1, 2, 3]", "output": "0.6666666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005614", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        circular_sum = input_list[i] + input_list[(i + 1) % list_length]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 4, 5, 5, 3, 5, 5]", "output": "[7, 8, 9, 10, 8, 8, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117423_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005615", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[3, 8]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005616", "code": "def extract_author_details(setup_content: str) -> str:\n    author_name = None\n    author_email = None\n    # Split the setup content by lines\n    lines = setup_content.split('\\n')\n    # Extract author details\n    for line in lines:\n        if line.startswith('author ='):\n            author_name = line.split('=')[1].strip()[1:-2]  # Extract author's name\n        elif line.startswith('author_email ='):\n            author_email = line.split('=')[1].strip()[1:-1]  # Extract author's email\n    # Format the output\n    if author_email:\n        return f\"Author: {author_name}, Email: {author_email}\"\n    else:\n        return f\"Author: {author_name}, Email: Not provided\"\n", "entry_point": "extract_author_details", "input": "''", "output": "'Author: None, Email: Not provided'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60199_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005617", "code": "def is_anagram(word1, word2):\n    if len(word1) != len(word2):\n        return False\n    char_count = {}\n    for ch in word1:\n        char_count[ch] = char_count.get(ch, 0) + 1\n    for ch in word2:\n        if ch not in char_count:\n            return False\n        char_count[ch] -= 1\n        if char_count[ch] < 0:\n            return False\n    return all(count == 0 for count in char_count.values())\n", "entry_point": "is_anagram", "input": "'listen', 'silent'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136456_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005618", "code": "def sum_multiples_3_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41452_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005619", "code": "import math\ndef calculate_result(x):\n    sinn = math.sin(math.radians(15))\n    son = math.exp(x) - 5 * x\n    mon = math.sqrt(x**2 + 1)\n    lnn = math.log(3 * x)\n    result = sinn + son / mon - lnn\n    return round(result, 10)\n", "entry_point": "calculate_result", "input": "7", "output": "147.3518976988", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26393_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005620", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average)  # Return the average as an integer\n", "entry_point": "calculate_average", "input": "[80, 82, 83, 84, 85]", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99126_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005621", "code": "from typing import List\ndef calculate_spectral_flux(power_spectra: List[List[float]]) -> List[float]:\n    spectral_flux_values = [0.0]  # Initialize with 0 for the first frame\n    for i in range(1, len(power_spectra)):\n        spectral_flux = sum(abs(curr - prev) for curr, prev in zip(power_spectra[i], power_spectra[i-1]))\n        spectral_flux_values.append(spectral_flux)\n    return spectral_flux_values\n", "entry_point": "calculate_spectral_flux", "input": "[[0.0]]", "output": "[0.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63428_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005622", "code": "def extract_setup_info(setup_keywords):\n    download_url = setup_keywords.get('download_url', None)\n    provides = setup_keywords.get('provides', None)\n    packages = provides if provides else setup_keywords.get('packages', None)\n    python_requires = setup_keywords.get('python_requires', None)\n    entry_points = None\n    if 'entry_points' in setup_keywords:\n        entry_points = setup_keywords['entry_points'].get('console_scripts', [None])[0]\n    return download_url, packages, python_requires, entry_points\n", "entry_point": "extract_setup_info", "input": "{}", "output": "(None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59056_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005623", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "735", "output": "{1, 3, 35, 5, 7, 105, 15, 49, 147, 245, 21, 735}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt734", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005624", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[2, -5, 0, 6, 5, -5, -2, 1, 5]", "output": "[5, 1, 2, 5, 5, 6, 0, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005625", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'\u4f60 12 \u4f60\u597d 3'", "output": "'Chinese: \u4f60, \u4f60\u597d\\nAlphanumeric: 12, 3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005626", "code": "import math\ndef calculate_distance(point_a, point_b):\n    x_diff = point_b[0] - point_a[0]\n    y_diff = point_b[1] - point_a[1]\n    z_diff = point_b[2] - point_a[2]\n    distance = math.sqrt(x_diff**2 + y_diff**2 + z_diff**2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0, 0), (3, 3, 3)", "output": "5.196152422706632", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94468_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005627", "code": "# Constants and data structures from the code snippet\nBRAIN_WAVES = {\n    'delta': (0.5, 4.0),\n    'theta': (4.0, 7.0),\n    'alpha': (7.0, 12.0),\n    'beta': (12.0, 30.0),\n}\n# Function to calculate the frequency range for a given brain wave type\ndef calculate_frequency_range(brain_wave_type):\n    if brain_wave_type in BRAIN_WAVES:\n        return BRAIN_WAVES[brain_wave_type]\n    else:\n        return \"Brain wave type not found in the dictionary.\"\n", "entry_point": "calculate_frequency_range", "input": "'gamma'", "output": "'Brain wave type not found in the dictionary.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67058_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005628", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'watermelon'", "output": "['watermelon']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005629", "code": "def calculate_total_cost(prices, quantities):\n    total_cost = sum(price * quantity for price, quantity in zip(prices, quantities))\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "[10, 4], [9, 2]", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57072_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4926", "output": "{1, 2, 3, 6, 1642, 821, 4926, 2463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005631", "code": "def calculate_sum(grid, directions):\n    rows, cols = len(grid), len(grid[0])\n    row, col = 0, 0\n    total_sum = grid[row][col]\n    for direction in directions:\n        if direction == 'R':\n            col += 1\n        elif direction == 'D':\n            row += 1\n        total_sum += grid[row][col]\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[[5, 2, 3], [4, 10, 2], [12, 7, 9]], ['D', 'R', 'R']", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103710_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005632", "code": "def extract_unique_types(elements):\n    unique_types = set()  # Initialize an empty set to store unique types\n    for element in elements:\n        element_type = element.get(\"type\")  # Extract the type of the element\n        if isinstance(element_type, list):  # Check if the type is a list\n            unique_types.update(element_type)  # Add all types in the list to the set\n        else:\n            unique_types.add(element_type)  # Add the type to the set if not a list\n    return unique_types\n", "entry_point": "extract_unique_types", "input": "[{'type': None}]", "output": "{None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29492_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005633", "code": "from typing import List\ndef longest_winning_streak(goals: List[int]) -> int:\n    current_streak = 0\n    longest_streak = 0\n    for i in range(len(goals)):\n        if i == 0 or goals[i] > goals[i - 1]:\n            current_streak += 1\n        else:\n            current_streak = 0\n        longest_streak = max(longest_streak, current_streak)\n    return longest_streak\n", "entry_point": "longest_winning_streak", "input": "[3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10446_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1295", "output": "{1, 259, 35, 5, 37, 7, 1295, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005635", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'a', 'm'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005636", "code": "def sum_digits_power(n):\n    digit_sum = 0\n    num_digits = 0\n    temp = n\n    # Calculate the sum of digits\n    while temp > 0:\n        digit_sum += temp % 10\n        temp //= 10\n    # Calculate the number of digits\n    temp = n\n    while temp > 0:\n        num_digits += 1\n        temp //= 10\n    # Calculate the result\n    result = digit_sum ** num_digits\n    return result\n", "entry_point": "sum_digits_power", "input": "55500", "output": "759375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137515_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005637", "code": "def binary_decode(arr):\n    result = 0\n    for i in range(len(arr)):\n        result += arr[i] * 2**(len(arr) - 1 - i)\n    return result\n", "entry_point": "binary_decode", "input": "[1, 0, 1, 1, 0, 0, 0, 1]", "output": "177", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27590_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005638", "code": "import ast\nimport sys\nimport keyword\nimport re\ndef extract_custom_modules(code):\n    custom_modules = set()\n    tree = ast.parse(code)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                custom_modules.add(alias.name)\n        elif isinstance(node, ast.ImportFrom):\n            if node.module is not None:\n                custom_modules.add(node.module)\n    standard_lib_modules = set(sys.builtin_module_names)\n    standard_lib_modules.update(keyword.kwlist)\n    custom_modules = [mod for mod in custom_modules if not any(re.match(f'^{mod}\\.', std_mod) for std_mod in standard_lib_modules)]\n    return list(custom_modules)\n", "entry_point": "extract_custom_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19383_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005639", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3421", "output": "{1, 11, 3421, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005640", "code": "methods_allowed = ('GET',)\ndef check_method_allowed(http_method: str) -> bool:\n    return http_method in methods_allowed\n", "entry_point": "check_method_allowed", "input": "'POST'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103317_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005641", "code": "def calculate_total_size_in_kb(file_sizes):\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "calculate_total_size_in_kb", "input": "[10240]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119982_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005642", "code": "def process_string(input_string):\n    modified_string = input_string.replace(\"python\", \"Java\").replace(\"code\", \"\").replace(\"snippet\", \"program\")\n    return modified_string\n", "entry_point": "process_string", "input": "'I'", "output": "'I'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6573_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "827", "output": "{1, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005644", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'apple.orange.grapefuit.banana'", "output": "'grapefuit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005645", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4369", "output": "{1, 257, 4369, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005646", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[15.29]", "output": "15.29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005647", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "9, 10", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005648", "code": "import re\ndef extract_time_language_settings(code_snippet):\n    settings = {}\n    time_zone_match = re.search(r\"TIME_ZONE = '(.+)'\", code_snippet)\n    if time_zone_match:\n        settings['TIME_ZONE'] = time_zone_match.group(1)\n    use_tz_match = re.search(r\"USE_TZ = (.+)\", code_snippet)\n    if use_tz_match:\n        settings['USE_TZ'] = bool(use_tz_match.group(1))\n    language_code_match = re.search(r\"LANGUAGE_CODE = '(.+)'\", code_snippet)\n    if language_code_match:\n        settings['LANGUAGE_CODE'] = language_code_match.group(1)\n    use_i18n_match = re.search(r\"USE_I18N = (.+)\", code_snippet)\n    if use_i18n_match:\n        settings['USE_I18N'] = bool(use_i18n_match.group(1))\n    use_l10n_match = re.search(r\"USE_L10N = (.+)\", code_snippet)\n    if use_l10n_match:\n        settings['USE_L10N'] = bool(use_l10n_match.group(1))\n    return settings\n", "entry_point": "extract_time_language_settings", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92022_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005649", "code": "def search_value_in_list(x, val):\n    for index, element in enumerate(x):\n        if element == val:\n            return index\n    return -1\n", "entry_point": "search_value_in_list", "input": "[10, 20, 30, 40], 30", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81667_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005650", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7622", "output": "{1, 2, 3811, 37, 7622, 103, 74, 206}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7621", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2803", "output": "{1, 2803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005652", "code": "import re\nimport argparse\ndef validate_aligner(aligner_str):\n    aligner_str = aligner_str.lower()\n    aligner_pattern = \"star|subread\"\n    if not re.match(aligner_pattern, aligner_str):\n        error = \"Aligner to be used (STAR|Subread)\"\n        raise argparse.ArgumentTypeError(error)\n    else:\n        return aligner_str\n", "entry_point": "validate_aligner", "input": "'subread'", "output": "'subread'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52623_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3021", "output": "{1, 3, 3021, 1007, 19, 53, 57, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3020", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005654", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[3, 1, 1, 3, 3, 1, 0, 3, 1]", "output": "[3, 1, 3, 1, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005655", "code": "def num_leading_zeros(class_num):\n    if class_num < 10:\n        return 4\n    elif class_num < 100:\n        return 3\n    elif class_num < 1000:\n        return 2\n    elif class_num < 10000:\n        return 1\n    else:\n        return 0\n", "entry_point": "num_leading_zeros", "input": "1000", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18260_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005656", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9022", "output": "{1, 2, 13, 694, 26, 347, 9022, 4511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9021", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005657", "code": "def merge_definitions(environmentdefs, roledefs, componentdefs):\n    merged_definitions = {}\n    for env_key in environmentdefs:\n        merged_definitions[env_key] = {}\n        for key in set(roledefs.keys()) | set(componentdefs.keys()):\n            role_values = roledefs.get(key, [])\n            component_values = componentdefs.get(key, [])\n            merged_definitions[env_key][key] = role_values + component_values if role_values and component_values else role_values or component_values\n    return merged_definitions\n", "entry_point": "merge_definitions", "input": "{}, {}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110802_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005658", "code": "import string\ndef encode_payload(payload):\n    encoded_payload = \"\"\n    i = 0\n    while i < len(payload):\n        if payload[i] == '%' and (i < len(payload) - 2) and payload[i + 1:i + 3].isalnum() and all(c in string.hexdigits for c in payload[i + 1:i + 3]):\n            encoded_payload += payload[i:i + 3]\n            i += 3\n        elif payload[i] != ' ':\n            encoded_payload += '%%%02X' % ord(payload[i])\n            i += 1\n        else:\n            encoded_payload += payload[i]\n            i += 1\n    return encoded_payload\n", "entry_point": "encode_payload", "input": "'!'", "output": "'%21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131939_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005659", "code": "def calculate_total_params(models):\n    total_params = 0\n    for model in models:\n        total_params += model['layers'] * model['params_per_layer']\n    return total_params\n", "entry_point": "calculate_total_params", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45661_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005660", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "8", "output": "[8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005661", "code": "from typing import List\ndef binary_search(nums: List[int], target: int) -> int:\n    lo, hi = 0, len(nums) - 1\n    while lo <= hi:\n        mid = (lo + hi) // 2\n        if nums[mid] == target:\n            return mid\n        elif nums[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "[1, 3, 5, 7, 9], 7", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58590_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005662", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1,2,3,455'", "output": "(1, 2, 3, 455)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005663", "code": "def rock_paper_scissors(player1, player2):\n    if player1 == player2:\n        return \"It's a tie!\"\n    elif (player1 == 'rock' and player2 == 'scissors') or (player1 == 'scissors' and player2 == 'paper') or (player1 == 'paper' and player2 == 'rock'):\n        return 'Player 1 wins'\n    else:\n        return 'Player 2 wins'\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'scissors'", "output": "'Player 1 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99213_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005664", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5006", "output": "{1, 2, 5006, 2503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5005", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005665", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'ooDJohSm '", "output": "('ooDJohSm', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005666", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "7, 12", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005667", "code": "def longest_increasing_subsequence_length(nums):\n    if not nums:\n        return 0\n    dp = [1] * len(nums)\n    for i in range(1, len(nums)):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence_length", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34697_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005668", "code": "import re\ndef extract_imported_names(code_snippet):\n    imported_names = set()\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if line.startswith('import') or line.startswith('from'):\n            modules = re.findall(r'[\\w.]+', line.split('import')[-1])\n            for module in modules:\n                imported_names.add(module.split('.')[-1])\n    return list(imported_names)\n", "entry_point": "extract_imported_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72348_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005669", "code": "def get_repo_name_from_url(url: str) -> str:\n    if not url:\n        return None\n    last_slash_index = url.rfind(\"/\")\n    last_suffix_index = url.rfind(\".git\")\n    if last_suffix_index < 0:\n        last_suffix_index = len(url)\n    if last_slash_index < 0 or last_suffix_index <= last_slash_index:\n        raise Exception(\"Invalid repo url {}\".format(url))\n    return url[last_slash_index + 1:last_suffix_index]\n", "entry_point": "get_repo_name_from_url", "input": "'http://example.com/repo/rgithtt.git'", "output": "'rgithtt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4595_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005670", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v.1.0.0'", "output": "'.1.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005671", "code": "def calculate_total_power_consumption(components):\n    total_power = 0\n    for component in components:\n        total_power += component[1]\n    return total_power\n", "entry_point": "calculate_total_power_consumption", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96330_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005672", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'5\\n110 * 2'", "output": "['5', '220']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4831", "output": "{1, 4831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005674", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "2, 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005675", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'slope rise/run'", "output": "'slope_rise/run'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005676", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "78401.0, '0.0000'", "output": "'7.8401E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005677", "code": "import re\ndef extract_url_names_and_views(url_patterns_snippet):\n    url_name_view_map = {}\n    pattern = re.compile(r'url\\((?P<url_pattern>.+),\\s(?P<view_function>\\w+),\\sname=\"(?P<url_name>\\w+)\"\\)')\n    matches = pattern.finditer(url_patterns_snippet)\n    for match in matches:\n        url_name = match.group('url_name')\n        view_function = match.group('view_function')\n        url_name_view_map[url_name] = view_function\n    return url_name_view_map\n", "entry_point": "extract_url_names_and_views", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22850_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005678", "code": "def extract_raw_id_fields(admin_configurations):\n    model_to_raw_id_fields = {}\n    for config in admin_configurations:\n        model = config.get(\"model\")\n        raw_id_fields = config.get(\"raw_id_fields\")\n        model_to_raw_id_fields[model] = raw_id_fields\n    return model_to_raw_id_fields\n", "entry_point": "extract_raw_id_fields", "input": "[{'model': None, 'raw_id_fields': None}]", "output": "{None: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47143_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005679", "code": "from typing import List\nimport queue\ndef get_bool_operators(query_string: str) -> List[str]:\n    bool_operators = queue.Queue()\n    for ch in query_string:\n        if ch == '&' or ch == '|':\n            bool_operators.put(ch)\n    return list(bool_operators.queue)\n", "entry_point": "get_bool_operators", "input": "'some text & more text |'", "output": "['&', '|']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108905_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005680", "code": "import re\nRE_LINKS = re.compile(r'\\[{2}(.*?)\\]{2}', re.DOTALL | re.UNICODE)\nIGNORED_NAMESPACES = [\n    'wikipedia', 'category', 'file', 'portal', 'template',\n    'mediaWiki', 'user', 'help', 'book', 'draft', 'wikiProject',\n    'special', 'talk', 'image', 'module'\n]\ndef extract_internal_links(text):\n    internal_links = set()\n    matches = RE_LINKS.findall(text)\n    for match in matches:\n        link = match.split('|')[-1].strip()\n        namespace = link.split(':')[0].lower()\n        if namespace not in IGNORED_NAMESPACES:\n            internal_links.add(link)\n    return list(internal_links)\n", "entry_point": "extract_internal_links", "input": "'This is a test without any links.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23771_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3226", "output": "{1, 3226, 2, 1613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8833", "output": "{1, 8833, 803, 73, 11, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005683", "code": "def calculate_char_counts(strings):\n    char_counts = {}  # Initialize an empty dictionary to store the results\n    for string in strings:\n        char_counts[string] = len(string)  # Calculate the length of each string and store in the dictionary\n    return char_counts\n", "entry_point": "calculate_char_counts", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': 5, 'banana': 6, 'cherry': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96287_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005684", "code": "def generate_code(input_string):\n    result = \"\"\n    position = 1\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper()\n            result += str(position)\n            position += 1\n    return result\n", "entry_point": "generate_code", "input": "'lLo'", "output": "'L1L2O3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4318_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005685", "code": "def filter_courses(course_data, min_credits, preferred_instructors):\n    filtered_courses = []\n    for course_key, course_info in course_data.items():\n        if course_info['credits'] >= min_credits and course_info['instructor'] in preferred_instructors:\n            filtered_courses.append(course_info['name'])\n    return filtered_courses\n", "entry_point": "filter_courses", "input": "{}, 3, ['Alice', 'Bob']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005686", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 5, 4, 5], 3", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005687", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'thtis'", "output": "{'thtis': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1535", "output": "{1, 307, 5, 1535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005689", "code": "def count_unique_keys(dictionaries):\n    unique_keys_count = {}\n    for dictionary in dictionaries:\n        for key in dictionary.keys():\n            unique_keys_count[key] = unique_keys_count.get(key, 0) + 1\n    return unique_keys_count\n", "entry_point": "count_unique_keys", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130176_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005690", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[1, 1, 2, 2, 7, 8]", "output": "[7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005691", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['ignored', '1', 'A', '22', '11', 'A', 'A', '11']", "output": "'1 A 22 11 A A 11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005692", "code": "import re\ndef count_learner_types(module_str: str) -> dict:\n    learner_types = {}\n    # Regular expression to match the learner import statements\n    pattern = r\"from\\s+\\S+\\s+import\\s+(?P<learners>.+)\"\n    # Find all matches of the pattern in the module content\n    matches = re.finditer(pattern, module_str)\n    for match in matches:\n        learners = match.group('learners').split(',')\n        for learner in learners:\n            learner_type = learner.strip().split()[-1].split('.')[-1]\n            learner_types[learner_type] = learner_types.get(learner_type, 0) + 1\n    return learner_types\n", "entry_point": "count_learner_types", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6199_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005693", "code": "import re\ndef get_http_status_code(response_message):\n    # Regular expression pattern to extract the status code\n    pattern = r'HTTP/\\d\\.\\d (\\d{3})'\n    # Search for the status code in the response message\n    match = re.search(pattern, response_message)\n    if match:\n        status_code = int(match.group(1))\n        # Check if the status code is recognized\n        if status_code in [400, 411, 404, 200, 505]:\n            return status_code\n        else:\n            return \"Unrecognized HTTP Status Code\"\n    else:\n        return \"Invalid HTTP Response Message\"\n", "entry_point": "get_http_status_code", "input": "'Hello, World!'", "output": "'Invalid HTTP Response Message'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127986_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2639", "output": "{1, 7, 203, 13, 2639, 377, 91, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005695", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'https://example.com', '/api/data'", "output": "'https://example.com/api/data'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005696", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'b'", "output": "'b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005697", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[2, 2, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59947_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005698", "code": "def calculate_luminance(r, g, b):\n    luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b\n    return round(luminance, 2)\n", "entry_point": "calculate_luminance", "input": "-1, 0, 0", "output": "-0.21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28393_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005699", "code": "def validate_registration(username: str, password1: str, password2: str) -> str:\n    if not username:\n        return \"Username cannot be empty.\"\n    if password1 != password2:\n        return \"Passwords do not match.\"\n    return \"Registration successful.\"\n", "entry_point": "validate_registration", "input": "'', 'password123', 'password123'", "output": "'Username cannot be empty.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3689_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005700", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[8, 7, 9]", "output": "[7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt42", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005701", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "550", "output": "{1, 2, 5, 550, 10, 11, 110, 50, 275, 22, 55, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt549", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005702", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'ppbpretixbaseb', 'PRETIA'", "output": "'ppbpretixbasebPRETIA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005703", "code": "def process_list(lst):\n    length = len(lst)\n    if length % 2 == 1:  # Odd number of elements\n        middle_index = length // 2\n        return lst[:middle_index] + lst[middle_index + 1:]\n    else:  # Even number of elements\n        middle_index = length // 2\n        return lst[:middle_index - 1] + lst[middle_index + 1:]\n", "entry_point": "process_list", "input": "[3, 3, 4, 1, 2, 4, 3]", "output": "[3, 3, 4, 2, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52704_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005704", "code": "INVALID = (None, 1, True)\nEMPTY = (tuple(), list(), dict(), \"\")\nSTRINGS = (('a', 'b'), ['a', 'b'], {'a': \"one\", 'b': \"two\"}, set(['a', 'b']), \"foo\")\nINTEGERS = ((0, 1, 2), [0, 1, 2], {0: 0, 1: 1, 2: 2}, set([0, 1, 2]))\nTRUTHY = ((1, True, 'foo'), [1, True, 'foo'], {'a': 1, 'b': True, 1: 'foo'}, set([1, True, 'foo']))\nFALSY = ((0, False, ''), [0, False, ''], {None: 0, '': False, 0: ''}, set([0, False, '']))\nNONMAP = (tuple(), list(), \"\")\ndef validate_iterable(input_iterable) -> bool:\n    categories = [EMPTY, STRINGS, INTEGERS, TRUTHY, FALSY, NONMAP]\n    for category in categories:\n        if input_iterable in category:\n            return True\n    return False\n", "entry_point": "validate_iterable", "input": "('a', 'b')", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66433_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005705", "code": "def smallest_unique(fronts, backs):\n    same_sides = {}\n    for i in range(len(fronts)):\n        if fronts[i] == backs[i]:\n            if fronts[i] not in same_sides:\n                same_sides[fronts[i]] = 0\n            same_sides[fronts[i]] += 1\n    min_side = 2345\n    for i in range(len(fronts)):\n        f, b = fronts[i], backs[i]\n        if f == b:\n            continue\n        if f not in same_sides:\n            min_side = min(min_side, f)\n        if b not in same_sides:\n            min_side = min(min_side, b)\n    if min_side == 2345:\n        min_side = 0\n    return min_side\n", "entry_point": "smallest_unique", "input": "[1, 1, 1], [1, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121336_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005706", "code": "def move_player(movements):\n    player_position = [0, 0]\n    winning_position = [3, 4]\n    for move in movements:\n        if move == 'U' and player_position[1] < 4:\n            player_position[1] += 1\n        elif move == 'D' and player_position[1] > 0:\n            player_position[1] -= 1\n        elif move == 'L' and player_position[0] > 0:\n            player_position[0] -= 1\n        elif move == 'R' and player_position[0] < 3:\n            player_position[0] += 1\n        if player_position == winning_position:\n            print(\"Congratulations, you won!\")\n            break\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "'UUU'", "output": "(0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49262_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005707", "code": "def count_unique_squares(group_of_squares: str) -> int:\n    squares_list = group_of_squares.split()  # Split the input string into individual square representations\n    unique_squares = set(squares_list)  # Convert the list into a set to remove duplicates\n    return len(unique_squares)  # Return the count of unique squares\n", "entry_point": "count_unique_squares", "input": "'A B C D'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41414_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005708", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    seen = set()\n    for num in numbers:\n        if num in seen:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110500_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005709", "code": "import string\ndef encrypt_message(message, key):\n    accepted_keys = string.ascii_uppercase\n    encrypted_message = \"\"\n    # Validate the key\n    key_comp = key.replace(\" \", \"\")\n    if not set(key_comp).issubset(set(accepted_keys)):\n        raise ValueError(\"Key contains special characters or integers that are not acceptable values\")\n    # Repeat the key cyclically to match the length of the message\n    key = key * (len(message) // len(key)) + key[:len(message) % len(key)]\n    # Encrypt the message using One-Time Pad encryption\n    for m, k in zip(message, key):\n        encrypted_char = chr(((ord(m) - 65) + (ord(k) - 65)) % 26 + 65)\n        encrypted_message += encrypted_char\n    return encrypted_message\n", "entry_point": "encrypt_message", "input": "'RNHFR', 'ABCDE'", "output": "'ROJIV'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111246_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005710", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[3, 3, 2, 2]", "output": "[3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005711", "code": "def calculate_char_frequency(input_string: str) -> dict:\n    char_frequency = {}\n    for char in input_string:\n        if char.isalnum():\n            char = char.lower()  # Convert character to lowercase for case-insensitivity\n            char_frequency[char] = char_frequency.get(char, 0) + 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125669_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005712", "code": "def generateParentheses(n):\n    def generateParenthesesHelper(open_count, close_count, current_pattern, result):\n        if open_count == n and close_count == n:\n            result.append(current_pattern)\n            return\n        if open_count < n:\n            generateParenthesesHelper(open_count + 1, close_count, current_pattern + '(', result)\n        if close_count < open_count:\n            generateParenthesesHelper(open_count, close_count + 1, current_pattern + ')', result)\n    result = []\n    generateParenthesesHelper(0, 0, '', result)\n    return result\n", "entry_point": "generateParentheses", "input": "1", "output": "['()']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74608_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005713", "code": "from typing import List\ndef calculate_total_time(tasks: List[int], cooldown: int) -> int:\n    last_occurrence = {}\n    time_elapsed = 0\n    for task_duration in tasks:\n        if task_duration not in last_occurrence or last_occurrence[task_duration] + cooldown <= time_elapsed:\n            time_elapsed += task_duration\n        else:\n            time_elapsed = last_occurrence[task_duration] + cooldown + task_duration\n        last_occurrence[task_duration] = time_elapsed\n    return time_elapsed\n", "entry_point": "calculate_total_time", "input": "[5, 5, 5], 0", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98461_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005714", "code": "def latest_version(versions):\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "latest_version", "input": "['6.5.5', '6.4.7', '5.9.9', '6.5.6']", "output": "'6.5.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109733_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005715", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'zzzzmg'", "output": "'zzzzmg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005716", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'2 3 +'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005717", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "14, 7", "output": "3432", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt3069", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005718", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 8], [3, 5]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17756_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005719", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'random_dataset', 230", "output": "230", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005720", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8907", "output": "{3, 1, 2969, 8907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005721", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'2.5.6-78'", "output": "(2, 5, 6, 78)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005722", "code": "import ast\ndef extract_tested_modules(test_module_content):\n    module_names = set()\n    tree = ast.parse(test_module_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                module_names.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            module_names.add(node.module.split('.')[0])\n    tested_modules = [name for name in module_names if name.startswith('_')]\n    return tested_modules\n", "entry_point": "extract_tested_modules", "input": "'import os\\n# Sample module content'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118655_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005723", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "9", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005724", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "1099511627776", "output": "'     1 TB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005725", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "8, [8, 5, 2, 2, 2, 7, 5, 2]", "output": "[5, 8, 2, 2, 7, 2, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005726", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "35.0, 8", "output": "(4.375, 4.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005727", "code": "def compress_text(text: str) -> str:\n    if not text:\n        return \"\"\n    compressed_text = \"\"\n    current_char = text[0]\n    char_count = 1\n    for i in range(1, len(text)):\n        if text[i] == current_char:\n            char_count += 1\n        else:\n            compressed_text += current_char + str(char_count)\n            current_char = text[i]\n            char_count = 1\n    compressed_text += current_char + str(char_count)\n    return compressed_text\n", "entry_point": "compress_text", "input": "'hc'", "output": "'h1c1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148970_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005728", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "20", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005729", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[10, 15, 20, 20]", "output": "65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005730", "code": "def count_comments(file_content):\n    comment_count = 0\n    for line in file_content.split('\\n'):\n        if line.strip().startswith('#') or not line.strip():\n            comment_count += 1\n    return comment_count\n", "entry_point": "count_comments", "input": "'This is a line of code.\\nAnother line of code.\\nYet another line.'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41468_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005731", "code": "def parse_classifiers(classifiers_str):\n    classifiers_dict = {}\n    for line in classifiers_str.strip().split('\\n'):\n        parts = line.split(' :: ')\n        if len(parts) == 2:\n            category, value = parts\n            category = category.strip()\n            value = value.strip()\n            if category in classifiers_dict:\n                classifiers_dict[category].append(value)\n            else:\n                classifiers_dict[category] = [value]\n    return classifiers_dict\n", "entry_point": "parse_classifiers", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136447_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005732", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-154.0], 1", "output": "-154.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2401_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005733", "code": "from typing import List\nfrom math import sqrt\ndef process_integers(int_list: List[int], threshold: int) -> float:\n    filtered_integers = [x for x in int_list if x >= threshold]\n    squared_integers = [x**2 for x in filtered_integers]\n    sum_squared = sum(squared_integers)\n    return sqrt(sum_squared)\n", "entry_point": "process_integers", "input": "[10, 5, 2], 2", "output": "11.357816691600547", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15467_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005734", "code": "def fizz_buzz_transform(numbers):\n    transformed_list = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            transformed_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            transformed_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            transformed_list.append(\"Buzz\")\n        else:\n            transformed_list.append(num)\n    return transformed_list\n", "entry_point": "fizz_buzz_transform", "input": "[1, 7, 5, 3, 1, 14, 3]", "output": "[1, 7, 'Buzz', 'Fizz', 1, 14, 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20136_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005735", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[86.5, 86.0, 87.0, 87.5, 86.5, 86.0, 87.0, 88.0, 87.5]", "output": "86.88888888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3587_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6567", "output": "{1, 33, 3, 6567, 199, 11, 2189, 597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8230", "output": "{1, 2, 5, 8230, 10, 1646, 4115, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8229", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005738", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6467", "output": "{1, 6467, 29, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005739", "code": "def calculate_rank(scores, new_score):\n    rank = 1\n    for score in scores:\n        if new_score < score:\n            rank += 1\n        elif new_score == score:\n            break\n        else:\n            break\n    return rank\n", "entry_point": "calculate_rank", "input": "[90, 80, 70], 60", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29288_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005740", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[0, -1, 2, 3, 4, -1, 6, -1]", "output": "[-1, 1, 5, 7, 3, 5, 5, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005741", "code": "import os\nimport fnmatch\ndef find_files_by_pattern(file_patterns, root_dir, depth_level):\n    matching_files = []\n    for root, dirs, files in os.walk(root_dir):\n        current_depth = root[len(root_dir):].count(os.sep)\n        if current_depth > depth_level:\n            continue\n        for file_pattern in file_patterns:\n            for filename in fnmatch.filter(files, file_pattern):\n                matching_files.append(os.path.join(root, filename))\n    return matching_files\n", "entry_point": "find_files_by_pattern", "input": "['*.xyz'], 'some_directory/', 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84502_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1953", "output": "{1, 1953, 3, 7, 9, 651, 63, 21, 279, 217, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1952", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005743", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'ListChLit'", "output": "'listchlit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005744", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[1, 1, 1, 2, 2, 3, 0, 6]", "output": "{1: 3, 2: 2, 3: 1, 0: 1, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4835", "output": "{1, 4835, 5, 967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005746", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[1, 2, 3, 4, 5, 6]", "output": "[2, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005747", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "0, {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005748", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[0, 1, 7, 2, 3, 2, 4]", "output": "[2, 3, 2, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005749", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[3, 1, 7, 2]", "output": "[1, 1, 1, 2, 2, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005750", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005751", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < n:\n            top_scores.append(score)\n        else:\n            min_score = min(top_scores)\n            if score > min_score:\n                top_scores.remove(min_score)\n                top_scores.append(score)\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[70, 85, 90, 90, 88], 3", "output": "89.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65534_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005752", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 9]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14851_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005753", "code": "def check_compatibility(version1, version2):\n    major1, minor1, patch1 = map(int, version1.split('.'))\n    major2, minor2, patch2 = map(int, version2.split('.'))\n    if major1 != major2:\n        return \"Incompatible\"\n    elif minor1 != minor2:\n        return \"Partially compatible\"\n    elif patch1 != patch2:\n        return \"Compatible with restrictions\"\n    else:\n        return \"Compatible\"\n", "entry_point": "check_compatibility", "input": "'1.2.3', '2.0.0'", "output": "'Incompatible'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135189_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005754", "code": "def divisible_count(x, y, k):\n    count_y = (k * (y // k + 1) - 1) // k\n    count_x = (k * ((x - 1) // k + 1) - 1) // k\n    return count_y - count_x\n", "entry_point": "divisible_count", "input": "1, 9, 1", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144622_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005755", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'myapp.config.AuthBCCConfigwwa'", "output": "'AuthBCCConfigwwa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005756", "code": "def validate_mpeg_dash_url(url: str) -> bool:\n    if url.startswith(\"dash://\"):\n        if url.startswith(\"dash://http://\") or url.startswith(\"dash://https://\"):\n            return True\n    return False\n", "entry_point": "validate_mpeg_dash_url", "input": "'dash://example.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144180_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005757", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    num_scores = len(scores) - 1  # Exclude the minimum score\n    average_score = adjusted_sum / num_scores\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 90, 88]", "output": "89.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97621_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005758", "code": "def schedule_tasks(tasks, time_limit):\n    sorted_tasks = sorted(tasks, key=lambda x: (x[\"priority\"], x[\"duration\"]))\n    total_duration = 0\n    scheduled_tasks = []\n    for task in sorted_tasks:\n        if total_duration + task[\"duration\"] <= time_limit:\n            scheduled_tasks.append({\"id\": task[\"id\"], \"name\": task[\"name\"]})\n            total_duration += task[\"duration\"]\n    return scheduled_tasks\n", "entry_point": "schedule_tasks", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12718_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005759", "code": "def check_asset_match(subset_instance_asset, workspace_asset):\n    return subset_instance_asset == workspace_asset\n", "entry_point": "check_asset_match", "input": "1, 1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146098_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005760", "code": "from typing import List, Tuple\ndef calculate_extra_points(course_list: List[Tuple[str, int]]) -> int:\n    total_points = 0\n    for course, points in course_list:\n        total_points += points\n    return total_points\n", "entry_point": "calculate_extra_points", "input": "[('Math', 3), ('Science', 4)]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69310_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005761", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[1, -2, 1, 11, 2, 5, -1, -2, 4]", "output": "[1, -2, 1, 11, 2, 5, -1, -2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005762", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'\"eyuot\"'", "output": "['eyuot']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005763", "code": "from collections import Counter\ndef find_modes(data):\n    freq_dict = Counter(data)\n    max_freq = max(freq_dict.values())\n    modes = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[3, 3, 3, 1, 2, 1]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75133_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005764", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 10), (2, 5), (3, 5)]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4502", "output": "{1, 2, 2251, 4502}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4501", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005766", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'data/all.json', None", "output": "('data/all.json', 'data/all.rdf')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005767", "code": "def count_live_streams(live):\n    count = 0\n    for status in live:\n        if status == 1 or status == 2:\n            count += 1\n    return count\n", "entry_point": "count_live_streams", "input": "[1, 1, 1, 2, 2, 2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94184_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005768", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[1, 2, 13]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005769", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6893", "output": "{1, 61, 6893, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6331", "output": "{1, 6331, 13, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005771", "code": "import re\n# Dictionary mapping incorrect function names to correct function names\nfunction_mapping = {\n    'prit': 'print'\n}\ndef correct_function_names(code_snippet):\n    # Regular expression pattern to match function names\n    pattern = r'\\b(' + '|'.join(re.escape(key) for key in function_mapping.keys()) + r')\\b'\n    # Replace incorrect function names with correct function names\n    corrected_code = re.sub(pattern, lambda x: function_mapping[x.group()], code_snippet)\n    return corrected_code\n", "entry_point": "correct_function_names", "input": "'prit(\"Hello Python3!\")'", "output": "'print(\"Hello Python3!\")'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116715_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005772", "code": "def max_sum_non_adjacent(lst):\n    if not lst:\n        return 0\n    incl = 0\n    excl = 0\n    for num in lst:\n        new_excl = max(incl, excl)  # Update the exclusion value\n        incl = excl + num  # Update the inclusion value\n        excl = new_excl\n    return max(incl, excl)\n", "entry_point": "max_sum_non_adjacent", "input": "[7, 1, 9]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141544_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005773", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'9:00 AM', '1:52'", "output": "'10:52 AM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005774", "code": "# Define a function to check if a string has a length greater than 5 characters\ndef check_length(s):\n    return len(s) > 5\n", "entry_point": "check_length", "input": "'abcdef'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55794_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005775", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(1, 3, 2)", "output": "'1.3.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005776", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    a, b = 0, 1\n    for _ in range(N):\n        fib_sum += a\n        a, b = b, a + b\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92640_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005777", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 3, 2, 2, 4, 1, 3, 2]", "output": "[3, 4, 6, 16, 5, 18, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77019_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005778", "code": "from typing import List, Tuple\ndef find_pairs(nums: List[int], target: int) -> List[Tuple[int, int]]:\n    seen = set()\n    pairs = []\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            pairs.append((num, complement))\n        seen.add(num)\n    return pairs\n", "entry_point": "find_pairs", "input": "[5, 9, 5], 14", "output": "[(9, 5), (5, 9)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97249_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005779", "code": "def count_pairs_sum(nums, target):\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        diff = target - num\n        if diff in num_freq:\n            pair_count += num_freq[diff]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_sum", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94686_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005780", "code": "def simulate_card_game(deck, limit):\n    max_sum = 0\n    current_sum = 0\n    for card_value in deck:\n        if current_sum + card_value <= limit:\n            current_sum += card_value\n            max_sum = max(max_sum, current_sum)\n        else:\n            break\n    return max_sum\n", "entry_point": "simulate_card_game", "input": "[3, 5], 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89758_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005781", "code": "def second_most_frequent(arr):\n    most_freq = None\n    second_most_freq = None\n    counter = {}\n    second_counter = {}\n    for n in arr:\n        counter.setdefault(n, 0)\n        counter[n] += 1\n        if counter[n] > counter.get(most_freq, 0):\n            second_most_freq = most_freq\n            most_freq = n\n        elif counter[n] > counter.get(second_most_freq, 0) and n != most_freq:\n            second_most_freq = n\n    return second_most_freq\n", "entry_point": "second_most_frequent", "input": "[1, 1, 0, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120689_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005782", "code": "from typing import List\ndef distribute_files(file_sizes: List[int], max_size: int) -> List[List[int]]:\n    folders = []\n    current_folder = []\n    current_size = 0\n    for file_size in file_sizes:\n        if current_size + file_size <= max_size:\n            current_folder.append(file_size)\n            current_size += file_size\n        else:\n            folders.append(current_folder)\n            current_folder = [file_size]\n            current_size = file_size\n    if current_folder:\n        folders.append(current_folder)\n    return folders\n", "entry_point": "distribute_files", "input": "[801, 300, 600, 399, 199, 300], 900", "output": "[[801], [300, 600], [399, 199, 300]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22508_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005783", "code": "def sum_multiples_of_3_or_5(input_list):\n    multiples_set = set()\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples_set:\n                total_sum += num\n                multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 9, 10]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51051_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005784", "code": "def parse_file_format_definition(definition: str) -> dict:\n    field_definitions = definition.split('\\n')\n    format_dict = {}\n    for field_def in field_definitions:\n        field_name, data_type = field_def.split(':')\n        format_dict[field_name.strip()] = data_type.strip()\n    return format_dict\n", "entry_point": "parse_file_format_definition", "input": "'username: str\\npassword: str'", "output": "{'username': 'str', 'password': 'str'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143153_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005785", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_excluding_extremes", "input": "[60, 72, 73, 75, 100]", "output": "73.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108103_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005786", "code": "def twoNumberSum(arr, n):\n    seen = set()\n    for num in arr:\n        diff = n - num\n        if diff in seen:\n            return [diff, num]\n        seen.add(num)\n    return []\n", "entry_point": "twoNumberSum", "input": "[1, 2, 3, 4], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7709_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005787", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005788", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[0, 3, 1, 1, 0, 1, 1, 4] + [0] * 18", "output": "'bbbcdfghhhh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005789", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'myapp.apps.DjangoAutocertConfig'", "output": "'DjangoAutocertConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005790", "code": "ONE_HOUR = 3600\ndef hours_ago(delta_seconds: int) -> str:\n    hours = delta_seconds // ONE_HOUR\n    return \"over {} hours ago\".format(hours)\n", "entry_point": "hours_ago", "input": "8000", "output": "'over 2 hours ago'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47586_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7341", "output": "{1, 3, 7341, 2447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005792", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "9.7034", "output": "'0.97034 x 10^0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005793", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "10", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005794", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'addreadwss: '", "output": "{'addreadwss': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005795", "code": "def combination_sum(candidates, target):\n    result = []\n    def backtrack(current_combination, start_index, remaining_target):\n        if remaining_target == 0:\n            result.append(current_combination[:])\n            return\n        for i in range(start_index, len(candidates)):\n            if candidates[i] <= remaining_target:\n                current_combination.append(candidates[i])\n                backtrack(current_combination, i, remaining_target - candidates[i])\n                current_combination.pop()\n    backtrack([], 0, target)\n    return result\n", "entry_point": "combination_sum", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34241_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005796", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8257", "output": "{8257, 1, 359, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005797", "code": "def extract_field_names(input_string):\n    field_names = []\n    in_field = False\n    current_field = \"\"\n    for char in input_string:\n        if char == '[':\n            in_field = True\n            current_field = \"\"\n        elif char == ']':\n            in_field = False\n            field_names.append(current_field.split(':')[0].strip())\n        elif in_field:\n            current_field += char\n    return field_names\n", "entry_point": "extract_field_names", "input": "'[Name: John Doe] [Age: 30] [City: New York]'", "output": "['Name', 'Age', 'City']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105860_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005798", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alalp=gammal3a'", "output": "{'alalp': 'gammal3a'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005799", "code": "def sum_multiples_3_or_5(num):\n    total = 0\n    for i in range(num):\n        if i % 3 == 0 or i % 5 == 0:\n            total += i\n    return total\n", "entry_point": "sum_multiples_3_or_5", "input": "9", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124212_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005800", "code": "def process_data(input_list):\n    processed_list = [f\"{2*num}_DT\" for num in input_list]\n    return processed_list\n", "entry_point": "process_data", "input": "[3, 7, 11]", "output": "['6_DT', '14_DT', '22_DT']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27646_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005801", "code": "def extract_js_placeholders(js_snippet):\n    placeholders = ['confirm', 'selected', 'tablecheckbox']\n    extracted_values = {}\n    for placeholder in placeholders:\n        start_index = js_snippet.find('%(' + placeholder + ')s')\n        if start_index != -1:\n            end_index = js_snippet.find(')', start_index)\n            value = js_snippet[start_index + len('%(' + placeholder + ')s'):end_index]\n            extracted_values[placeholder] = value\n    return extracted_values\n", "entry_point": "extract_js_placeholders", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34687_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005802", "code": "def simple_calculator(input_list):\n    result = float(input_list[0])\n    operation = None\n    for i in range(1, len(input_list), 2):\n        if input_list[i] in ['+', '-', '*', '/']:\n            operation = input_list[i]\n        else:\n            num = float(input_list[i])\n            if operation == '+':\n                result += num\n            elif operation == '-':\n                result -= num\n            elif operation == '*':\n                result *= num\n            elif operation == '/':\n                if num == 0:\n                    return \"Error: Division by zero\"\n                result /= num\n    return result\n", "entry_point": "simple_calculator", "input": "[10.0, '+', 0]", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122722_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005803", "code": "def ascii_cipher(message, key):\n    def is_prime(n):\n        if n < 2:\n            return False\n        return all(n % i != 0 for i in range(2, round(pow(n, 0.5)) + 1) ) or n == 2\n    pfactor = max(i for i in range(2, abs(key) + 1) if is_prime(i) and key % i == 0) * (-1 if key < 0 else 1)\n    encrypted_message = ''.join(chr((ord(c) + pfactor) % 128) for c in message)\n    return encrypted_message\n", "entry_point": "ascii_cipher", "input": "'Hello, World!', 7", "output": "\"Olssv3'^vysk(\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44495_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005804", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 4, 6, 5, 6, 4, 3, 1]", "output": "[7, 10, 11, 11, 10, 7, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005805", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    total_sum = sum(scores)\n    adjusted_sum = total_sum - min_score\n    num_scores = len(scores) - 1  # Excluding the minimum score\n    return adjusted_sum / num_scores if num_scores > 0 else 0\n", "entry_point": "calculate_average_score", "input": "[80, 90, 90, 95, 92, 88, 94, 86]", "output": "90.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5691", "output": "{1, 3, 7, 1897, 813, 271, 21, 5691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005807", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9193", "output": "{1, 29, 317, 9193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1497", "output": "{1, 3, 1497, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8843", "output": "{1, 8843, 37, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005810", "code": "def max_consecutive_ones(n):\n    binary_str = bin(n)[2:]  # Convert n to binary and remove the '0b' prefix\n    max_ones = 0\n    current_ones = 0\n    for digit in binary_str:\n        if digit == '1':\n            current_ones += 1\n            max_ones = max(max_ones, current_ones)\n        else:\n            current_ones = 0\n    return max_ones\n", "entry_point": "max_consecutive_ones", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99433_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005811", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[2, 4, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34640_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9674", "output": "{1, 2, 4837, 1382, 7, 9674, 14, 691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005813", "code": "def getKeysByValue(dictOfElements, valueToFind):\n    listOfKeys = []\n    for key, value in dictOfElements.items():\n        if value == valueToFind:\n            listOfKeys.append(key)\n    return listOfKeys\n", "entry_point": "getKeysByValue", "input": "{}, 42", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4420_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005814", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8709", "output": "{1, 3, 8709, 2903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8708", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005815", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'datadatput.gdb/featdre_class'", "output": "'datadatput.gdb/featdre_class_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005816", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[0, 0]", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005817", "code": "def forgiving_true(expression):\n    forgiving_truthy_values = {\"t\", \"True\", \"true\", 1, True}\n    return expression in forgiving_truthy_values\n", "entry_point": "forgiving_true", "input": "1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14124_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005818", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 15, 10, 5, 5]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6779_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005819", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'other', 'sample_pacbio.eads.reads.fa'", "output": "'sample_pacbio.eads_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005820", "code": "from typing import List\nfrom heapq import heapify, heappop\ndef find_kth_largest(nums: List[int], k: int) -> int:\n    if not nums:\n        return None\n    # Create a max-heap by negating each element\n    heap = [-num for num in nums]\n    heapify(heap)\n    # Pop k-1 elements from the heap\n    for _ in range(k - 1):\n        heappop(heap)\n    # Return the kth largest element (negate the result)\n    return -heap[0]\n", "entry_point": "find_kth_largest", "input": "[4, 5, 6, 7, 8], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124799_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005821", "code": "from typing import List\ndef max_loot_circle(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob_range(start, end):\n        max_loot = [0, nums[start]]\n        for i in range(start+1, end+1):\n            max_loot.append(max(max_loot[-1], max_loot[-2] + nums[i]))\n        return max_loot[-1]\n    return max(rob_range(0, len(nums)-2), rob_range(1, len(nums)-1))\n", "entry_point": "max_loot_circle", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119426_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005822", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "6.5508105, 6", "output": "6.550811", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2063", "output": "{1, 2063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005824", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9995", "output": "{1, 9995, 5, 1999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005825", "code": "def latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_major, current_minor, current_patch = map(int, version.split('.'))\n            latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n            if current_major > latest_major or \\\n                    (current_major == latest_major and current_minor > latest_minor) or \\\n                    (current_major == latest_major and current_minor == latest_minor and current_patch > latest_patch):\n                latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['1.0.0', '1.5.1', '2.0.0']", "output": "'2.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94924_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005826", "code": "def parse_django_settings(settings_content: str) -> dict:\n    settings = {}\n    for line in settings_content.split('\\n'):\n        if line.startswith('BASE_DIR'):\n            settings['BASE_DIR'] = line.split('=')[1].strip().strip(\"'\")\n        elif line.startswith('SECRET_KEY'):\n            settings['SECRET_KEY'] = line.split('=')[1].strip().strip(\"'\")\n        elif line.startswith('DEBUG'):\n            settings['DEBUG'] = line.split('=')[1].strip().lower() == 'true'\n    return settings\n", "entry_point": "parse_django_settings", "input": "'This is a comment\\nSome other settings'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129564_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005827", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 2, 0, 4, 0, 2, 0, 4, 4]", "output": "[3, 4, 0, 8, 0, 4, 0, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005828", "code": "def calculate_weighted_average(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"The lengths of numbers and weights must be equal.\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    weighted_avg = weighted_sum / total_weight\n    return weighted_avg\n", "entry_point": "calculate_weighted_average", "input": "[21, 22], [1, 1]", "output": "21.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131444_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "98", "output": "{1, 98, 2, 7, 14, 49}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt97", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005830", "code": "def count_even_odd(numbers):\n    even_count = 0\n    odd_count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n    return even_count, odd_count\n", "entry_point": "count_even_odd", "input": "[0, 2, 4, 6, 8, 1, 3]", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51670_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2641", "output": "{2641, 1, 19, 139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2640", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005832", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[2, 5, 5, 1, 3], 3", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005833", "code": "TOKEN_TYPE = ((0, 'PUBLIC_KEY'), (1, 'PRIVATE_KEY'), (2, 'AUTHENTICATION TOKEN'), (4, 'OTHER'))\ndef get_token_type_verbose(token_type: int) -> str:\n    token_type_mapping = dict(TOKEN_TYPE)\n    return token_type_mapping.get(token_type, 'Unknown Token Type')\n", "entry_point": "get_token_type_verbose", "input": "0", "output": "'PUBLIC_KEY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149682_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3995", "output": "{1, 5, 235, 47, 17, 85, 3995, 799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005835", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 1, 5, 8, 13]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005836", "code": "import itertools\ndef count_unique_combinations(items, k):\n    unique_combinations = list(itertools.combinations(items, k))\n    return len(unique_combinations)\n", "entry_point": "count_unique_combinations", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23071_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005837", "code": "def process_query(query: str, operator: str) -> dict:\n    parts = [x.strip() for x in operator.split(query)]\n    assert len(parts) in (1, 3), \"Invalid query format\"\n    query_key = parts[0]\n    result = {query_key: {}}\n    return result\n", "entry_point": "process_query", "input": "'xyz', '====>=='", "output": "{'====>==': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13586_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005838", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'elle'", "output": "[('e', 2), ('l', 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5367", "output": "{1, 3, 1789, 5367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005840", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[75]", "output": "[75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005841", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[7, 0, 2, 1, 2, 2, 2, 1]", "output": "[7, 1, 4, 4, 6, 7, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7971", "output": "{3, 1, 7971, 2657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005843", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'worldhello'", "output": "{'worldhello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005844", "code": "def validate_name(name):\n    predefined_name = '<NAME>'\n    # Test 1: Check if the name matches exactly with the predefined string\n    if name != predefined_name:\n        return False\n    # Test 2: Check if the name matches after converting it to a Unicode string\n    if name != predefined_name.encode('utf-8').decode('utf-8'):\n        return False\n    # Test 3: Check if the name matches after multiple Unicode conversions\n    for _ in range(3):\n        name = name.encode('utf-8').decode('utf-8')\n        if name != predefined_name:\n            return False\n    # Test 4: Check if the name matches after multiple Unicode conversions back and forth\n    for _ in range(3):\n        name = name.encode('utf-8').decode('utf-8').encode('utf-8').decode('utf-8')\n        if name != predefined_name:\n            return False\n    return True\n", "entry_point": "validate_name", "input": "'WrongName'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10351_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005845", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "20, 7", "output": "77520", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005846", "code": "def max_non_adjacent_sum(scores):\n    inclusive = 0\n    exclusive = 0\n    for score in scores:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + score\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[15, 5, 17]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32468_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005847", "code": "from typing import List\ndef count_double_clicks(click_times: List[int]) -> int:\n    if not click_times:\n        return 0\n    double_clicks = 0\n    prev_click_time = click_times[0]\n    for click_time in click_times[1:]:\n        if click_time - prev_click_time <= 640:\n            double_clicks += 1\n        prev_click_time = click_time\n    return double_clicks\n", "entry_point": "count_double_clicks", "input": "[0, 100, 200, 300, 400, 500, 600, 700]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15147_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005848", "code": "import json\ndef parser_content(content):\n    try:\n        parsed_content = json.loads(content)\n        jwt_token = parsed_content['data']['jwt']\n        return jwt_token\n    except (json.JSONDecodeError, KeyError) as e:\n        print(f\"Error parsing JSON content: {e}\")\n        return None\n", "entry_point": "parser_content", "input": "'{\"data\": {\"jwt\": \"example_jwt_token\"}}'", "output": "'example_jwt_token'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123852_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005849", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[0, 1, 2, 3], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005850", "code": "def calculate_average(num1, num2, num3):\n    total_sum = num1 + num2 + num3\n    average = total_sum / 3\n    return average\n", "entry_point": "calculate_average", "input": "19, 19, 20", "output": "19.333333333333332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_179_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005851", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 6]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96449_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005852", "code": "from typing import List\ndef max_score_subset(scores: List[int], K: int) -> int:\n    scores.sort()\n    max_score = 0\n    left, right = 0, 1\n    while right < len(scores):\n        if scores[right] - scores[left] <= K:\n            max_score = max(max_score, scores[left] + scores[right])\n            right += 1\n        else:\n            left += 1\n    return max_score\n", "entry_point": "max_score_subset", "input": "[10, 10], 0", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94061_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005853", "code": "import re\ndef extract_unique_module_names(code_snippet):\n    imports = re.findall(r'import\\s+(\\S+)', code_snippet)\n    module_names = set()\n    for imp in imports:\n        module_name = imp.split('.')[0]\n        module_names.add(module_name)\n    return list(module_names)\n", "entry_point": "extract_unique_module_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8954_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005854", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['10 + 10']", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005855", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "(21, 40, 40, 41)", "output": "[30.5, 40.5, 19, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005856", "code": "def find_first_exceeded_day(tweet_counts):\n    for day, count in enumerate(tweet_counts):\n        if count > 200:\n            return day\n    return -1\n", "entry_point": "find_first_exceeded_day", "input": "[150, 250]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137540_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005857", "code": "from typing import List\ndef sum_absolute_differences(list1: List[int], list2: List[int]) -> int:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0, 0, 0], [21, 0, 0, 0, 0]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44502_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005858", "code": "def check_number_conditions(number, minRange, maxRange):\n    if len(str(number)) != 6:\n        return False\n    def hasRepeat(num):\n        return len(set(str(num))) < len(str(num))\n    def alwaysIncreasing(num):\n        return all(int(num[i]) <= int(num[i+1]) for i in range(len(num)-1))\n    if not hasRepeat(number):\n        return False\n    if not alwaysIncreasing(str(number)):\n        return False\n    if not (minRange <= number <= maxRange):\n        return False\n    return True\n", "entry_point": "check_number_conditions", "input": "122345, 100000, 130000", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77666_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005859", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "223", "output": "{1, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005860", "code": "def check_version_status(current_version, existing_version):\n    if current_version > existing_version:\n        return \"Update Required\"\n    elif current_version == existing_version:\n        return \"Up to Date\"\n    else:\n        return \"Downgrade Not Allowed\"\n", "entry_point": "check_version_status", "input": "1.0, 2.0", "output": "'Downgrade Not Allowed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61614_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005861", "code": "def sum_of_factorial_digits(num):\n    fact_total = 1\n    while num != 1:\n        fact_total *= num\n        num -= 1\n    fact_total_str = str(fact_total)\n    sum_total = sum(int(digit) for digit in fact_total_str)\n    return sum_total\n", "entry_point": "sum_of_factorial_digits", "input": "3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145190_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005862", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "5, 23.0", "output": "115", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005863", "code": "import os\ndef process_data_from_url(url):\n    # Simulate downloading the file\n    print(f\"Downloading data from URL: {url}\")\n    # Simulate loading the downloaded file into an AnnData object\n    print(\"Loading data into AnnData object...\")\n    # Simulate preprocessing steps\n    print(\"Simulating log transformation of the data...\")\n    print(\"Simulating normalization of the data...\")\n    print(\"Simulating PCA...\")\n    return \"Data processing complete.\"\n", "entry_point": "process_data_from_url", "input": "'http://example.com/data'", "output": "'Data processing complete.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22356_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005864", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "92, 2", "output": "4186", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt3934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005865", "code": "# Function to parse the Chinese character code and return its pinyin pronunciation\ndef parse_hanzi(code):\n    pinyin_dict = {\n        'U+4E00': 'y\u012b',\n        'U+4E8C': '\u00e8r',\n        'U+4E09': 's\u0101n',\n        'U+4E5D': 'ji\u01d4'\n        # Add more mappings as needed\n    }\n    alternate_dict = {\n        'U+4E00': {'pinyin': 'y\u012b', 'code': '4E00'},\n        'U+4E8C': {'pinyin': '\u00e8r', 'code': '4E8C'},\n        'U+4E09': {'pinyin': 's\u0101n', 'code': '4E09'},\n        'U+4E5D': {'pinyin': 'ji\u01d4', 'code': '4E5D'}\n        # Add more alternate mappings as needed\n    }\n    pinyin = pinyin_dict.get(code)\n    if not pinyin:\n        alternate = alternate_dict.get(code)\n        if alternate:\n            pinyin = alternate['pinyin']\n            extra = '  => U+{0}'.format(alternate['code'])\n            if ',' in pinyin:\n                first_pinyin, extra_pinyin = pinyin.split(',', 1)\n                pinyin = first_pinyin\n                extra += '  ?-> ' + extra_pinyin\n        else:\n            pinyin = 'Pinyin not available'\n    return pinyin\n", "entry_point": "parse_hanzi", "input": "'U+4E00'", "output": "'y\u012b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30788_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005866", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005867", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8355", "output": "{1, 2785, 3, 8355, 5, 1671, 557, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2997", "output": "{1, 3, 37, 999, 9, 333, 111, 81, 2997, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005869", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "352", "output": "{352, 1, 2, 32, 4, 8, 11, 44, 176, 16, 22, 88}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt351", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005870", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "2, 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt65", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005871", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[50, 73]", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7319", "output": "{1, 563, 13, 7319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005873", "code": "def get_valid_https_verify(input_value):\n    if isinstance(input_value, bool):\n        return input_value\n    elif isinstance(input_value, str) or isinstance(input_value, unicode):\n        return input_value.lower() == 'true'\n    else:\n        return False\n", "entry_point": "get_valid_https_verify", "input": "False", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69368_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005874", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7221", "output": "{1, 3, 2407, 83, 7221, 87, 249, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005875", "code": "from typing import List, Dict\ndef process_hub_ids(hub_ids: List[str]) -> Dict[str, str]:\n    hub_dir_mapping = {}\n    for hub_id in hub_ids:\n        if hub_id.lower() in {'jupyter', 'public', 'pub'}:\n            hub_dir_mapping[hub_id] = ''\n        else:\n            hub_dir_mapping[hub_id] = f'Workspace/{hub_id}'\n    return hub_dir_mapping\n", "entry_point": "process_hub_ids", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29481_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005876", "code": "def max_non_overlapping_sticks(sticks, target):\n    sticks.sort()  # Sort the sticks in ascending order\n    selected_sticks = 0\n    total_length = 0\n    for stick in sticks:\n        if total_length + stick <= target:\n            selected_sticks += 1\n            total_length += stick\n    return selected_sticks\n", "entry_point": "max_non_overlapping_sticks", "input": "[5, 10], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122772_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005877", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "-2097153, 0", "output": "-2097153", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005878", "code": "import re\ndef extract_openapi_version(input_string):\n    pattern = r'OpenAPI spec version: (\\d+\\.\\d+\\.\\d+)'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group(1)\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_openapi_version", "input": "''", "output": "'Version number not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34480_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005879", "code": "import re\n# Define the URL patterns and associated views\nurl_patterns = {\n    r\"^control/event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/covidcerts/$\": \"settings\"\n}\ndef match_url_to_view(url):\n    for pattern, view_name in url_patterns.items():\n        if re.match(pattern, url):\n            return view_name\n    return \"Not Found\"\n", "entry_point": "match_url_to_view", "input": "'/some/other/path/'", "output": "'Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116212_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005880", "code": "from typing import List, Tuple\ndef process_transactions(transactions: List[int]) -> Tuple[int, bool]:\n    balance = 0\n    destroy_contract = False\n    for transaction in transactions:\n        balance += transaction\n        if balance < 0:\n            destroy_contract = True\n            break\n    return balance, destroy_contract\n", "entry_point": "process_transactions", "input": "[-8]", "output": "(-8, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9357_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005881", "code": "def map_choices_to_descriptions(choices):\n    choices_dict = {}\n    for choice, description in choices:\n        choices_dict[choice] = description\n    return choices_dict\n", "entry_point": "map_choices_to_descriptions", "input": "[(1, 'Yes'), (0, 'No')]", "output": "{1: 'Yes', 0: 'No'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115679_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005882", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "8", "output": "55555533", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005883", "code": "def count_severities(severity_str):\n    severities = {}\n    for severity in severity_str.split(','):\n        severity = severity.strip()  # Remove leading and trailing spaces\n        if severity in severities:\n            severities[severity] += 1\n        else:\n            severities[severity] = 1\n    return severities\n", "entry_point": "count_severities", "input": "'Criicarl'", "output": "{'Criicarl': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5726_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005884", "code": "def calculate_jaccard_similarity(set1, set2):\n    intersection_size = len(set1.intersection(set2))\n    union_size = len(set1.union(set2))\n    if union_size == 0:\n        return 0.00\n    else:\n        jaccard_similarity = intersection_size / union_size\n        return round(jaccard_similarity, 2)\n", "entry_point": "calculate_jaccard_similarity", "input": "set(), set()", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140952_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005885", "code": "from typing import List\nfrom math import sqrt\ndef process_integers(int_list: List[int], threshold: int) -> float:\n    filtered_integers = [x for x in int_list if x >= threshold]\n    squared_integers = [x**2 for x in filtered_integers]\n    sum_squared = sum(squared_integers)\n    return sqrt(sum_squared)\n", "entry_point": "process_integers", "input": "[], 1", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15467_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005886", "code": "import ast\ndef extract_cog_names(code_snippet):\n    tree = ast.parse(code_snippet)\n    cog_names = []\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute) and node.func.attr == 'add_cog':\n            cog_name = node.args[0].func.attr\n            cog_names.append(cog_name)\n    return cog_names\n", "entry_point": "extract_cog_names", "input": "'def my_function(): pass'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34763_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005887", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "-0.7410000000000001, 1", "output": "-0.7410000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005888", "code": "def happyLadybugs(b):\n    for a in set(b):\n        if a != \"_\" and b.count(a) == 1:\n            return \"NO\"\n    if b.count(\"_\") == 0:\n        for i in range(1, len(b) - 1):\n            if b[i - 1] != b[i] and b[i + 1] != b[i]:\n                return \"NO\"\n    return \"YES\"\n", "entry_point": "happyLadybugs", "input": "'_AB'", "output": "'NO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63192_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1048", "output": "{1, 2, 131, 4, 262, 8, 524, 1048}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1047", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005890", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[100, 144, 10]", "output": "144000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005891", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[90, 89, 87, 88, 90]", "output": "88.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005892", "code": "def generate_file_path(agent: str, energy: str) -> str:\n    top_path = './experiments_results/gym/' + agent + '/'\n    if 'Energy0' in energy:\n        ene_sub = '_E0'\n    elif 'EnergyOne' in energy:\n        ene_sub = '_E1'\n    if agent == 'HalfCheetah':\n        abrv = 'HC'\n    elif agent == 'HalfCheetahHeavy':\n        abrv = 'HCheavy'\n    elif agent == 'FullCheetah':\n        abrv = 'FC'\n    else:\n        abrv = agent\n    return top_path + abrv + ene_sub\n", "entry_point": "generate_file_path", "input": "'RanAge', 'EnergyOne'", "output": "'./experiments_results/gym/RanAge/RanAge_E1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76201_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005893", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7001", "output": "{7001, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005894", "code": "import math\n# Define the factorial function using recursion\ndef factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "4", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52131_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005895", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'extra characters -1'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005896", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[8, 0, 12, 0, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005897", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2018", "output": "{1, 2018, 2, 1009}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2017", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005898", "code": "def parse_message_types(input_string: str) -> dict:\n    message_types = {}\n    current_message = None\n    for line in input_string.split('\\n'):\n        line = line.strip()\n        if not line:\n            continue\n        if line.startswith('message'):\n            current_message = line.split()[1]\n            message_types[current_message] = []\n        elif current_message and 'fields_by_name' in line:\n            parts = line.split()\n            related_message = parts[-1]\n            message_types[current_message].append(f\"Related to: {related_message}\")\n        elif current_message and ' = ' in line:\n            field_name = line.split()[1]\n            message_types[current_message].append(field_name)\n    return message_types\n", "entry_point": "parse_message_types", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93106_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005899", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5573", "output": "{1, 5573}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005900", "code": "def calculate_mae(expected, predicted):\n    if len(expected) != len(predicted):\n        raise ValueError(\"Expected and predicted lists must have the same length.\")\n    mae = sum(abs(e - p) for e, p in zip(expected, predicted)) / len(expected)\n    return mae\n", "entry_point": "calculate_mae", "input": "[0, 10], [5, 5]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005901", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[5, 6, 6]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005902", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    if len(tokens) == 3:  # Arithmetic operation\n        num1, operator, num2 = tokens\n        num1, num2 = int(num1), int(num2)\n        if operator == '+':\n            return num1 + num2\n        elif operator == '-':\n            return num1 - num2\n        elif operator == '*':\n            return num1 * num2\n        elif operator == '/':\n            return num1 / num2\n    elif len(tokens) == 2:  # Comparison or logical operation\n        operator = tokens[0]\n        if operator == 'not':\n            return not eval(tokens[1])\n        elif operator == 'and':\n            return all(eval(token) for token in tokens[1:])\n        elif operator == 'or':\n            return any(eval(token) for token in tokens[1:])\n    return None  # Invalid expression format\n", "entry_point": "evaluate_expression", "input": "'2 * 3'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109464_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005903", "code": "def unban_user(user_id, botBanList):\n    for i in range(len(botBanList)):\n        if user_id == botBanList[i][0]:\n            del botBanList[i]\n            return botBanList\n    return \":x: User with ID {} is not banned from using the bot.\".format(user_id)\n", "entry_point": "unban_user", "input": "999999, [[123456], [345678], [999999]]", "output": "[[123456], [345678]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114255_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005904", "code": "def longest_pressed_key(releaseTimes, keysPressed):\n    longest = releaseTimes[0]\n    slowestKey = keysPressed[0]\n    for i in range(1, len(releaseTimes)):\n        cur = releaseTimes[i] - releaseTimes[i-1]\n        if cur > longest or (cur == longest and keysPressed[i] > slowestKey):\n            longest = cur\n            slowestKey = keysPressed[i]\n    return slowestKey\n", "entry_point": "longest_pressed_key", "input": "[1, 2, 4, 5, 8], ['a', 'b', 'c', 'b', 'c']", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129234_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005905", "code": "MINIMUM_CONFIRMATIONS = 6\ndef check_confirmations(confirmations):\n    return len(confirmations) >= MINIMUM_CONFIRMATIONS\n", "entry_point": "check_confirmations", "input": "[1, 2, 3, 4, 5, 6]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78569_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005906", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[4, 5, 8, 10]", "output": "6.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005907", "code": "import importlib\ndef check_exception_import(module_name, exception_name):\n    try:\n        imported_module = importlib.import_module(module_name)\n        return hasattr(imported_module, exception_name)\n    except ModuleNotFoundError:\n        return False\n", "entry_point": "check_exception_import", "input": "'non_existing_module', 'SomeException'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66875_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005908", "code": "def reverse_string(input_string):\n    return input_string[::-1]\n", "entry_point": "reverse_string", "input": "'neter'", "output": "'reten'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18735_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005909", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[10, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3846", "output": "{1, 2, 3, 1923, 1282, 3846, 6, 641}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005911", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6721", "output": "{6721, 1, 611, 517, 11, 13, 47, 143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005912", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[6, 4, 4, 4]", "output": "[6, 10, 14, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005913", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MCCLIII'", "output": "1253", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005914", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[2, 1, 4, 0, 1, 0, -1]", "output": "[2, 3, 7, 7, 8, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005915", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'pop or ra'", "output": "{'p': 2, 'o': 2, 'r': 2, 'a': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29002_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005916", "code": "import re\ndef extract_numerical_values(input_string):\n    num_match = re.compile(r'([\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+[\\.\\,]*)+[\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+|([-+]*\\d+[\\.\\,]*)+\\d+|([\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+|\\d+)')\n    matches = num_match.findall(input_string)\n    numerical_values = []\n    for match in matches:\n        for group in match:\n            if group:\n                if group.isdigit():\n                    numerical_values.append(int(group))\n                else:\n                    # Convert Indian numeral system representation to regular Arabic numerals\n                    num = int(''.join(str(ord(digit) - ord('\u0966')) for digit in group))\n                    numerical_values.append(num)\n    return numerical_values\n", "entry_point": "extract_numerical_values", "input": "'Hello, world!'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8862_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005917", "code": "from typing import List\ndef format_string(flags: List[bool], S: str) -> str:\n    ans = []\n    m = len(flags)\n    for i, (flag, ch) in enumerate(zip(flags, S)):\n        if flag:\n            if i == 0 or not flags[i - 1]:\n                ans.append('<b>')\n            ans.append(ch)\n            if i == m - 1 or not flags[i + 1]:\n                ans.append('</b>')\n        else:\n            ans.append(ch)\n    return ''.join(ans)\n", "entry_point": "format_string", "input": "[False, True, True, False, True], 'Hello'", "output": "'H<b>el</b>l<b>o</b>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40664_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005918", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 9, 15, 21]", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35742_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005919", "code": "from typing import List, Dict\ndef word_frequency_counter(words: List[str]) -> Dict[str, int]:\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency_counter", "input": "['banna', 'banna', 'h', 'bannba']", "output": "{'banna': 2, 'h': 1, 'bannba': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103792_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005920", "code": "def sum_squared_differences(arr1, arr2):\n    if len(arr1) != len(arr2):\n        return \"Error: Arrays must have the same length\"\n    sum_sq_diff = sum((x - y) ** 2 for x, y in zip(arr1, arr2))\n    return sum_sq_diff\n", "entry_point": "sum_squared_differences", "input": "[1, 2, 3], [4, 5]", "output": "'Error: Arrays must have the same length'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49431_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005921", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[1, 2, 1, 1, 4, 2, 3, 4]", "output": "[3, 3, 2, 5, 6, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005922", "code": "def count_ways_to_climb_stairs(n: int) -> int:\n    if n <= 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "9", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16452_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005923", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[[5, 5], [5, 6]]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005924", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "None, 'some_directory'", "output": "'Error: app_config path is missing'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005925", "code": "def simplify_path(path):\n    stack = []\n    for element in path:\n        if element == '.':\n            continue\n        elif element == '..':\n            if stack:\n                stack.pop()\n        elif element == '':\n            stack = []\n        else:\n            stack.append(element)\n    return stack\n", "entry_point": "simplify_path", "input": "['..', '..', '']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59313_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005926", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 2, 3, 4, 4, 5, 5, 6]", "output": "{1: 2, 2: 1, 3: 1, 4: 2, 5: 2, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005927", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    sum_evens = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_evens += num\n    return sum_evens\n", "entry_point": "sum_of_evens", "input": "[8, 10]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47898_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005928", "code": "def max_score_subset(scores):\n    scores.sort()\n    prev_score = prev_count = curr_score = curr_count = max_sum = 0\n    for score in scores:\n        if score == curr_score:\n            curr_count += 1\n        elif score == curr_score + 1:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        else:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        if prev_score == score - 1:\n            max_sum = max(max_sum, prev_count * prev_score + curr_count * curr_score)\n        else:\n            max_sum = max(max_sum, curr_count * curr_score)\n    return max_sum\n", "entry_point": "max_score_subset", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103662_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005929", "code": "def calculate_weighted_average(numbers, n_obs_train):\n    if n_obs_train == 0:\n        return 0  # Handling division by zero\n    weight = 1. / n_obs_train\n    weighted_sum = sum(numbers) * weight\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[4.0, 4.75], 24", "output": "0.3645833333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136723_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005930", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4281", "output": "{3, 1, 4281, 1427}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005931", "code": "def sum_multiples(nums):\n    result = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            seen.add(num)\n            result += num\n    return result\n", "entry_point": "sum_multiples", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57039_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005932", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "492", "output": "{1, 2, 3, 164, 4, 6, 41, 492, 12, 82, 246, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt491", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005933", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[2, 3, 4, 5]", "output": "[2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005934", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "-1", "output": "'https://www.kaiheila.cn/api/v-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005935", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "96", "output": "'?96'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005936", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "2, -4", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005937", "code": "from typing import Tuple\ndef parse_module_docstring(docstring: str) -> Tuple[str, str]:\n    module_name = \"\"\n    description = \"\"\n    lines = docstring.split('\\n')\n    for line in lines:\n        if line.strip().startswith(\".. module::\"):\n            module_name = line.split(\".. module::\")[1].strip()\n        elif line.strip().startswith(\":synopsis:\"):\n            description = line.split(\":synopsis:\")[1].strip()\n    return module_name, description\n", "entry_point": "parse_module_docstring", "input": "''", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48673_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005938", "code": "def generate_model_details(model_type):\n    model_details = {\n        \"layoutlmv3\": \"LayoutLMv3 is a model for document layout analysis.\",\n        \"bert\": \"BERT is a model for natural language understanding.\",\n        \"gpt-3\": \"GPT-3 is a model for natural language generation.\"\n    }\n    return model_details.get(model_type, \"Model details not found.\")\n", "entry_point": "generate_model_details", "input": "'random_model'", "output": "'Model details not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113461_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005939", "code": "def find_largest_probability_cell(p):\n    max_prob = float('-inf')\n    max_row, max_col = -1, -1\n    for r, row in enumerate(p):\n        for c, val in enumerate(row):\n            if val > max_prob:\n                max_prob = val\n                max_row, max_col = r, c\n    return max_row, max_col\n", "entry_point": "find_largest_probability_cell", "input": "[[0.1, 0.2, 0.9], [0.05, 0.4, 0.3], [0, 0, 0]]", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85296_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2161", "output": "{2161, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005941", "code": "import os\nimport configparser\nLANGUAGE_DEF = \"English\"\nMODE_DEF = \"Normal\"\nLANGUAGE_KEY_NAME_MAP = {\n    \"Python\": \"Py\",\n    \"Java\": \"Jv\",\n    \"C++\": \"Cpp\"\n}\nMODE_KEY_NAME_MAP = {\n    \"Debug\": \"Dbg\",\n    \"Release\": \"Rel\"\n}\ndef parse_config(config_file):\n    if not os.path.exists(config_file):\n        return LANGUAGE_DEF, MODE_DEF\n    config = configparser.ConfigParser()\n    config.read(config_file)\n    language = config['DEFAULT'].get('Language', LANGUAGE_DEF)\n    mode = config['DEFAULT'].get('Mode', MODE_DEF)\n    language_def = LANGUAGE_KEY_NAME_MAP.get(language, LANGUAGE_DEF)\n    mode_def = MODE_KEY_NAME_MAP.get(mode, MODE_DEF)\n    return language_def, mode_def\n", "entry_point": "parse_config", "input": "'non_existent_config.ini'", "output": "('English', 'Normal')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56290_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1946", "output": "{1, 2, 7, 139, 973, 14, 278, 1946}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005943", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[4, 5, 3, 4, 0, 7, 10]", "output": "[4, 4, 0, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005944", "code": "import math\ndef calculate_distances(array):\n    distances = []\n    for point in array:\n        x, y, z = point\n        distance = math.sqrt(x**2 + y**2 + z**2)\n        distances.append(round(distance, 3))  # Rounding to 3 decimal places\n    return distances\n", "entry_point": "calculate_distances", "input": "[(0, 0, 0), (1, 1, 1), (3, 4, 0)]", "output": "[0.0, 1.732, 5.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110535_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005945", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[5, 5, 2, 3, 10, 8, 7, 8, 8], 2", "output": "[[5, 5], [2, 3], [10, 8], [7, 8], [8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005946", "code": "def convert_quotes(text: str, lang: str) -> str:\n    if lang == 'fr':\n        double_open = '\u00ab'\n        double_close = '\u00bb'\n    elif lang == 'de':\n        double_open = '\u2039'\n        double_close = '\u203a'\n    else:\n        raise ValueError(\"Unsupported language. Choose 'fr' for French or 'de' for German.\")\n    result = []\n    in_double_quotes = False\n    in_single_quotes = False\n    for char in text:\n        if char == '\"':\n            if in_double_quotes:\n                result.append(double_close)\n            else:\n                result.append(double_open)\n            in_double_quotes = not in_double_quotes\n        elif char == \"'\":\n            if in_single_quotes:\n                result.append(double_close)\n            else:\n                result.append(double_open)\n            in_single_quotes = not in_single_quotes\n        else:\n            result.append(char)\n    return ''.join(result)\n", "entry_point": "convert_quotes", "input": "'\"example\" \"text\"', 'fr'", "output": "'\u00abexample\u00bb \u00abtext\u00bb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5600_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005947", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1010010X'", "output": "['10100100', '10100101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005948", "code": "def max_sum_non_adjacent(lst):\n    inclusive = 0\n    exclusive = 0\n    for num in lst:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49510_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005949", "code": "def sum_of_even_squares(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[2, 6]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128362_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005950", "code": "def max_non_overlapping_circles(radii):\n    radii.sort()\n    count = 0\n    max_radius = float('-inf')\n    for radius in radii:\n        if radius >= max_radius:\n            count += 1\n            max_radius = radius * 2\n    return count\n", "entry_point": "max_non_overlapping_circles", "input": "[1, 2, 4, 8, 16]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114287_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005951", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[2]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005952", "code": "def traffic_light_action(color):\n    if color == 'red':\n        return 'Stop'\n    elif color == 'green':\n        return 'GoGoGo'\n    elif color == 'yellow':\n        return 'Stop or Go fast'\n    else:\n        return 'Light is bad!!!'\n", "entry_point": "traffic_light_action", "input": "'blue'", "output": "'Light is bad!!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129716_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005953", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>Thiample ap><ct.a</p>'", "output": "'Thiample ap><ct.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005954", "code": "def max_rectangle_area(buildings):\n    stack = []\n    max_area = 0\n    n = len(buildings)\n    for i in range(n):\n        while stack and buildings[i] < buildings[stack[-1]]:\n            height = buildings[stack.pop()]\n            width = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, height * width)\n        stack.append(i)\n    while stack:\n        height = buildings[stack.pop()]\n        width = n if not stack else n - stack[-1] - 1\n        max_area = max(max_area, height * width)\n    return max_area\n", "entry_point": "max_rectangle_area", "input": "[8, 8, 8, 8, 8]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70831_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1970", "output": "{1, 2, 5, 197, 394, 10, 1970, 985}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1969", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005956", "code": "def get_api_key(api_key_number):\n    api_keys = {\n        1: 'ELSEVIER_API_1',\n        2: 'ELSEVIER_API_2',\n        3: 'ELSEVIER_API_3',\n        4: 'ELSEVIER_API_4',\n    }\n    return api_keys.get(api_key_number, 'DEFAULT_API_KEY')\n", "entry_point": "get_api_key", "input": "0", "output": "'DEFAULT_API_KEY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137352_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005957", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "1007, 100", "output": "907", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005958", "code": "def can_partition(nums):\n    total_sum = sum(nums)\n    if total_sum % 2 != 0:\n        return False\n    target_sum = total_sum // 2\n    n = len(nums)\n    dp = [[False for _ in range(target_sum + 1)] for _ in range(n + 1)]\n    for i in range(n + 1):\n        dp[i][0] = True\n    for i in range(1, n + 1):\n        for j in range(1, target_sum + 1):\n            if j >= nums[i - 1]:\n                dp[i][j] = dp[i - 1][j] or dp[i - 1][j - nums[i - 1]]\n            else:\n                dp[i][j] = dp[i - 1][j]\n    return dp[n][target_sum]\n", "entry_point": "can_partition", "input": "[1, 5, 11, 5]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147173_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005959", "code": "def get_file_extension(filename):\n    file_extensions = {\n        'c': 'C',\n        'cpp': 'C++',\n        'java': 'Java',\n        'py': 'Python',\n        'html': 'HTML'\n    }\n    extension = filename.split('.')[-1]\n    if extension in file_extensions:\n        return file_extensions[extension]\n    else:\n        return 'Unknown'\n", "entry_point": "get_file_extension", "input": "'file.xyz'", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94277_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005960", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alpha=1,beta=2,gamma=3'", "output": "{'alpha': '1', 'beta': '2', 'gamma': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005961", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[7, 3, 5, 2, 7, 3, 5, 2]", "output": "[7, 3, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005962", "code": "def generate_url(owner, repo, token_auth):\n    return f'{owner}/{repo}/{token_auth}/'\n", "entry_point": "generate_url", "input": "'jodee', 'mmy_projeccct', 'aaa1'", "output": "'jodee/mmy_projeccct/aaa1/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8083_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005963", "code": "def reverse_complement(s):\n    sc = \"\"\n    for n in reversed(s):\n        if n == \"A\":\n            sc += \"T\"\n        elif n == \"T\":\n            sc += \"A\"\n        elif n == \"C\":\n            sc += \"G\"\n        elif n == \"G\":\n            sc += \"C\"\n        else:\n            continue\n    return sc\n", "entry_point": "reverse_complement", "input": "'AATCGA'", "output": "'TCGATT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36581_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005964", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'abc', 'abc def'", "output": "(0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005965", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1466", "output": "{1, 1466, 2, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005966", "code": "import importlib\nfrom typing import List\ndef custom_import(module_name: str) -> List[str]:\n    imported_modules = []\n    try:\n        module = importlib.import_module(module_name)\n        all_modules = getattr(module, '__all__', [])\n        for mod_name in all_modules:\n            imported_module = importlib.import_module(f\"{module_name}.{mod_name}\")\n            imported_modules.append(imported_module)\n    except (ModuleNotFoundError, AttributeError):\n        pass\n    return imported_modules\n", "entry_point": "custom_import", "input": "'non_existent_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60065_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005967", "code": "def play_war_game(deck1, deck2):\n    table = []\n    while deck1 and deck2:\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        table.extend([card1, card2])\n        if card1 > card2:\n            deck1.extend(table)\n            table = []\n        elif card2 > card1:\n            deck2.extend(table)\n            table = []\n        else:  # War\n            if len(deck1) < 4 or len(deck2) < 4:\n                return 0 if len(deck2) < 4 else 1\n            table.extend(deck1[:3] + deck2[:3])\n            del deck1[:3]\n            del deck2[:3]\n    return 0 if deck2 else 1\n", "entry_point": "play_war_game", "input": "[1, 2, 3], [4, 5, 6, 7, 8]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133686_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005968", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "-1.0, 2.0, 2.379999999999981", "output": "-4.379999999999981", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005969", "code": "def calculate_average_score(scores):\n    if not scores:  # Check if the input list is empty\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 81, 82, 83, 84, 85, 82]", "output": "82.42857142857143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128899_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5295", "output": "{1, 353, 3, 1059, 5, 1765, 5295, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005971", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[10, 15, 20, 25, 30], 2", "output": "[30, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005972", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2343", "output": "{1, 33, 3, 2343, 71, 11, 781, 213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005973", "code": "def process_integers(numbers, rule):\n    result = []\n    if rule == 'even':\n        result = sorted([num for num in numbers if num % 2 == 0])\n    elif rule == 'odd':\n        result = sorted([num for num in numbers if num % 2 != 0], reverse=True)\n    return result\n", "entry_point": "process_integers", "input": "[1, 2, 3, 8, 10], 'even'", "output": "[2, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58613_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005974", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[1, 1, 2, 2]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005975", "code": "def extract_variables(script):\n    variables = {}\n    for line in script.splitlines():\n        line = line.strip()\n        if line and \"=\" in line:\n            parts = line.split(\"=\")\n            variable_name = parts[0].strip()\n            variable_value = \"=\".join(parts[1:]).strip()\n            variables[variable_name] = variable_value\n    return variables\n", "entry_point": "extract_variables", "input": "'ry = L'", "output": "{'ry': 'L'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38111_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005976", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'737'", "output": "(737,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "681", "output": "{3, 1, 681, 227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005978", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "39, 126", "output": "(219, 53)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005979", "code": "def calculate_average_excluding_outliers(numbers, threshold):\n    if not numbers:\n        return 0\n    median = sorted(numbers)[len(numbers) // 2]\n    filtered_numbers = [num for num in numbers if abs(num - median) <= threshold * median]\n    if not filtered_numbers:\n        return 0\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_excluding_outliers", "input": "[30.0, 30.5], 0.1", "output": "30.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65048_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005980", "code": "from collections import Counter\nimport string\ndef find_top_words(text, n):\n    # Tokenize the text into words\n    words = text.lower().translate(str.maketrans('', '', string.punctuation)).split()\n    # Define common English stopwords\n    stop_words = set([\"i\", \"me\", \"my\", \"myself\", \"we\", \"our\", \"ours\", \"ourselves\", \"you\", \"your\", \"yours\", \"yourself\", \"yourselves\", \"he\", \"him\", \"his\", \"himself\", \"she\", \"her\", \"hers\", \"herself\", \"it\", \"its\", \"itself\", \"they\", \"them\", \"their\", \"theirs\", \"themselves\", \"what\", \"which\", \"who\", \"whom\", \"this\", \"that\", \"these\", \"those\", \"am\", \"is\", \"are\", \"was\", \"were\", \"be\", \"been\", \"being\", \"have\", \"has\", \"had\", \"having\", \"do\", \"does\", \"did\", \"doing\", \"a\", \"an\", \"the\", \"and\", \"but\", \"if\", \"or\", \"because\", \"as\", \"until\", \"while\", \"of\", \"at\", \"by\", \"for\", \"with\", \"about\", \"against\", \"between\", \"into\", \"through\", \"during\", \"before\", \"after\", \"above\", \"below\", \"to\", \"from\", \"up\", \"down\", \"in\", \"out\", \"on\", \"off\", \"over\", \"under\", \"again\", \"further\", \"then\", \"once\", \"here\", \"there\", \"when\", \"where\", \"why\", \"how\", \"all\", \"any\", \"both\", \"each\", \"few\", \"more\", \"most\", \"other\", \"some\", \"such\", \"no\", \"nor\", \"not\", \"only\", \"own\", \"same\", \"so\", \"than\", \"too\", \"very\", \"s\", \"t\", \"can\", \"will\", \"just\", \"don\", \"should\", \"now\"])\n    # Remove stopwords from the tokenized words\n    filtered_words = [word for word in words if word not in stop_words]\n    # Count the frequency of each word\n    word_freq = Counter(filtered_words)\n    # Sort the words based on their frequencies\n    sorted_words = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)\n    # Output the top N most frequent words along with their frequencies\n    top_words = sorted_words[:n]\n    return top_words\n", "entry_point": "find_top_words", "input": "'testting', 1", "output": "[('testting', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52632_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005981", "code": "def count_unique_evens(numbers):\n    unique_evens = set()\n    for num in numbers:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_evens", "input": "[2, 2, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30074_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005982", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[75, 80, 83, 88, 90]", "output": "83.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5432_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005983", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6347", "output": "{11, 1, 6347, 577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005984", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[3, 0], [2, 1], [5, 2]]", "output": "[[3], [2], [5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005985", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3166", "output": "{1, 2, 3166, 1583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "529", "output": "{1, 529, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2126", "output": "{1, 2, 2126, 1063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005988", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "335", "output": "{1, 67, 5, 335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt334", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005989", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[7, 7, 6, 6, 8, 4, 8, 4]", "output": "[7, 6, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005990", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3093", "output": "{1, 3, 3093, 1031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005991", "code": "def calculate_input_dim(env_name, ob_space):\n    def observation_size(space):\n        return len(space)\n    def goal_size(space):\n        return 0  # Assuming goal information size is 0\n    def box_size(space):\n        return 0  # Assuming box size is 0\n    def robot_state_size(space):\n        return len(space)\n    if env_name == 'PusherObstacle-v0':\n        input_dim = observation_size(ob_space) - goal_size(ob_space) - box_size(ob_space)\n    elif 'Sawyer' in env_name:\n        input_dim = robot_state_size(ob_space)\n    else:\n        raise NotImplementedError(\"Input dimension calculation not implemented for this environment\")\n    return input_dim\n", "entry_point": "calculate_input_dim", "input": "'PusherObstacle-v0', [0, 1, 2, 3, 4, 5, 6, 7]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88440_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005992", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['+ 10', '* 5', '+ 2'], 2", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005993", "code": "def authenticate_user(username, password):\n    if len(username) < 5 or not isinstance(password, int) or not (1000 <= password <= 9999):\n        return False\n    if username == \"admin\" and password == 1234:\n        return True\n    return False\n", "entry_point": "authenticate_user", "input": "'admin', 1234", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102954_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005994", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'1000.3'", "output": "'1000.3.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005995", "code": "def max_score_before_game_ends(scores):\n    max_score = float('-inf')  # Initialize max_score to negative infinity\n    for score in scores:\n        if score <= max_score:\n            break  # Exit the loop if the current score is less than or equal to the max_score\n        max_score = max(max_score, score)  # Update max_score if the current score is greater\n    return max_score\n", "entry_point": "max_score_before_game_ends", "input": "[7, 8, 9, 10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31682_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005996", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[10, 20, 30, 40, 39]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005997", "code": "from typing import List\ndef process_commands(commands: str) -> List[int]:\n    engines = [0] * 3  # Initialize engines with zeros\n    for command in commands.split():\n        action, engine_number = command.split(':')\n        engine_number = int(engine_number)\n        if action == 'START':\n            engines[engine_number - 1] = engine_number\n        elif action == 'STOP':\n            engines[engine_number - 1] = 0\n    return engines\n", "entry_point": "process_commands", "input": "'START:1 START:3'", "output": "[1, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117335_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005998", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'BEVERLY'", "output": "'YLREVEB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0005999", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8251", "output": "{1, 8251, 37, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006000", "code": "def count_values_in_range(n, min_val, max_val):\n    count = 0\n    i = 0\n    while True:\n        i, sq = i + 1, i ** n\n        if sq in range(min_val, max_val + 1):\n            count += 1\n        if sq > max_val:\n            break\n    return count\n", "entry_point": "count_values_in_range", "input": "1, 3, 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140446_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006001", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'JAA'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006002", "code": "def calculate_average_without_outliers(numbers, threshold):\n    median = sorted(numbers)[len(numbers) // 2] if len(numbers) % 2 != 0 else sum(sorted(numbers)[len(numbers) // 2 - 1:len(numbers) // 2 + 1]) / 2\n    outliers = [num for num in numbers if abs(num - median) > threshold]\n    filtered_numbers = [num for num in numbers if num not in outliers]\n    if len(filtered_numbers) == 0:\n        return 0  # Return 0 if all numbers are outliers\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_without_outliers", "input": "[17, 18, 19], 1", "output": "18.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15753_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006003", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[3, 7, 8]", "output": "168", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006004", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "997", "output": "497503", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006005", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'from some_module import'", "output": "'import'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006006", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "38347922, 1", "output": "38347922", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt26", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006007", "code": "def calculate_refresh_interval(refresh_timeout: int) -> int:\n    return refresh_timeout // 6\n", "entry_point": "calculate_refresh_interval", "input": "3606", "output": "601", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13656_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006008", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0, 2, 22, 24, 60, 65, 67, 670'", "output": "[0, 2, 22, 24, 60, 65, 67, 670]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006009", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 3, 2, 3, 1, 2, 4]", "output": "[4, 5, 5, 4, 3, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99008_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006010", "code": "import re\ndef count_word_occurrences(input_string):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word.isalpha():\n            word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'This'", "output": "{'this': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99880_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006011", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    elif n == 1:\n        return 0\n    a, b = 0, 1\n    sum_fib = a + b\n    for _ in range(2, n):\n        a, b = b, a + b\n        sum_fib += b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "5", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146168_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9965", "output": "{1, 5, 1993, 9965}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006013", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[1, 2, 3, 4, 3, 5, 1, 4, 4]", "output": "[1, 4, 27, 16, 27, 125, 1, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006014", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 1, 2, 2, 3, 3, 10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006015", "code": "TOKEN_TYPE = ((0, 'PUBLIC_KEY'), (1, 'PRIVATE_KEY'), (2, 'AUTHENTICATION TOKEN'), (4, 'OTHER'))\ndef get_token_type_verbose(token_type: int) -> str:\n    token_type_mapping = dict(TOKEN_TYPE)\n    return token_type_mapping.get(token_type, 'Unknown Token Type')\n", "entry_point": "get_token_type_verbose", "input": "3", "output": "'Unknown Token Type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149682_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006016", "code": "def process_data(data: str) -> str:\n    if data == \"photo_prod\":\n        return \"take_photo_product\"\n    elif data == \"rept_photo\":\n        return \"repeat_photo\"\n    else:\n        return \"invalid_command\"\n", "entry_point": "process_data", "input": "'unknown_command'", "output": "'invalid_command'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135393_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006017", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006018", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 1, 3, 2, 2, 2, 2, 2]", "output": "[3, 2, 5, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006019", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.10.3'", "output": "(1, 10, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006020", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2468", "output": "{1, 2, 2468, 4, 617, 1234}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2467", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006021", "code": "def perform_list_operation(input_list, command):\n    if command == \"min\":\n        return min(input_list)\n    elif command == \"add\":\n        input_list.append(6)  # Adding 6 as an example, can be modified for a specific item\n        return input_list\n    elif command == \"count\":\n        return input_list.count(2)  # Counting occurrences of 2 as an example\n    elif command == \"type\":\n        return type(input_list)\n    elif command == \"copy\":\n        new_list = input_list.copy()\n        return new_list\n    elif command == \"extend\":\n        input_list.extend([4, 5, 6, 7])  # Extending with specific items\n        return input_list\n    elif command == \"index\":\n        return input_list.index(7)  # Finding the index of 7 as an example\n    elif command == \"insert\":\n        input_list.insert(2, 100)  # Inserting 100 at index 2 as an example\n        return input_list\n    elif command == \"remove\":\n        input_list.remove(100)  # Removing 100 as an example\n        return input_list\n    elif command == \"reverse\":\n        input_list.reverse()\n        return input_list\n    elif command == \"sort\":\n        input_list.sort()\n        return input_list\n    else:\n        return \"Invalid command\"\n", "entry_point": "perform_list_operation", "input": "[2], 'count'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63626_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006022", "code": "import math\n# ANSI escape codes for colors\ncolors = {\n    'RED': (255, 0, 0),\n    'GREEN': (0, 255, 0),\n    'BLUE': (0, 0, 255),\n    'YELLOW': (255, 255, 0),\n    'MAGENTA': (255, 0, 255),\n    'CYAN': (0, 255, 255),\n    'WHITE': (255, 255, 255)\n}\ndef rgb_to_ansi(r, g, b):\n    closest_color = None\n    min_distance = float('inf')\n    for color, rgb in colors.items():\n        distance = math.sqrt((r - rgb[0])**2 + (g - rgb[1])**2 + (b - rgb[2])**2)\n        if distance < min_distance:\n            min_distance = distance\n            closest_color = color\n    return closest_color\n", "entry_point": "rgb_to_ansi", "input": "255, 1, 0", "output": "'RED'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25041_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006023", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'example.ollooooo'", "output": "'ollooooo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006024", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "9, 3, 8", "output": "(1726, 2195)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006025", "code": "from collections import Counter\ndef find_most_common_element(nums):\n    counts = Counter(nums)\n    most_common_element = max(counts, key=counts.get)\n    return most_common_element\n", "entry_point": "find_most_common_element", "input": "[4, 4, 4, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45657_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006026", "code": "def sum_squared_differences(arr1, arr2):\n    if len(arr1) != len(arr2):\n        return \"Error: Arrays must have the same length.\"\n    sum_squared_diff = sum((x - y) ** 2 for x, y in zip(arr1, arr2))\n    return sum_squared_diff\n", "entry_point": "sum_squared_differences", "input": "[1, 2, 3], [4, 5]", "output": "'Error: Arrays must have the same length.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104625_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006027", "code": "TEMPLATE_PATH = \"/home/scom/documents/opu_surveillance_system/monitoring/master/\"\nSTATIC_PATH = \"/home/scom/documents/opu_surveillance_system/monitoring/static/\"\ndef check_path_type(file_path):\n    if file_path.startswith(TEMPLATE_PATH):\n        return \"TEMPLATE_PATH\"\n    elif file_path.startswith(STATIC_PATH):\n        return \"STATIC_PATH\"\n    else:\n        return \"Neither TEMPLATE_PATH nor STATIC_PATH\"\n", "entry_point": "check_path_type", "input": "'/home/user/documents/file.txt'", "output": "'Neither TEMPLATE_PATH nor STATIC_PATH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31825_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006028", "code": "def repeat_elements(lst, n):\n    result = []\n    for num in lst:\n        for _ in range(n):\n            result.append(num)\n    return result\n", "entry_point": "repeat_elements", "input": "[1, 2, 3], 2", "output": "[1, 1, 2, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45000_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006029", "code": "def length_of_longest_substring(s: str) -> int:\n    char_index_map = {}\n    start = 0\n    max_length = 0\n    for end in range(len(s)):\n        if s[end] in char_index_map and char_index_map[s[end]] >= start:\n            start = char_index_map[s[end]] + 1\n        char_index_map[s[end]] = end\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "length_of_longest_substring", "input": "'abcd'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65081_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006030", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[1, 2, 2, 3, 3, 3], 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006031", "code": "query = {\n    \"sideMovementLeft\": \"Moving left.\",\n    \"sideMovementRight\": \"Moving right.\",\n    \"invalidMovement\": \"Invalid movement direction.\"\n}\ndef leftRightMovement(directionS):\n    if directionS == \"left\":\n        response = query[\"sideMovementLeft\"]\n    elif directionS == \"right\":\n        response = query[\"sideMovementRight\"]\n    else:\n        response = query[\"invalidMovement\"]\n    return response\n", "entry_point": "leftRightMovement", "input": "'right'", "output": "'Moving right.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138962_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006032", "code": "import re\ndef lexer(text):\n    tokens = []\n    rules = [\n        (r'if|else|while|for', 'keyword'),\n        (r'[a-zA-Z][a-zA-Z0-9]*', 'identifier'),\n        (r'\\d+', 'number'),\n        (r'[+\\-*/]', 'operator')\n    ]\n    for rule in rules:\n        pattern, token_type = rule\n        for token in re.findall(pattern, text):\n            tokens.append((token, token_type))\n    return tokens\n", "entry_point": "lexer", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24727_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006033", "code": "def generate_config(index):\n    config_mapping = {\n        2: {'length_mode': 'increment', 'transmit_mode': 'single_burst', 'frame_size_step': 2000},\n        3: {'mac_dst_mode': 'increment'},\n        4: {'mac_src_mode': 'increment', 'transmit_mode': 'single_burst'},\n        5: {'l3_protocol': 'arp', 'arp_src_hw_mode': 'increment', 'arp_dst_hw_mode': 'decrement'},\n        6: {'rate_pps': 1, 'l3_protocol': 'ipv4', 'ip_src_mode': 'increment', 'ip_dst_mode': 'decrement'},\n        7: {'vlan_user_priority': '3', 'l2_encap': 'ethernet_ii_vlan', 'vlan_id_mode': 'increment'},\n        8: {'vlan': 'enable', 'l3_protocol': 'ipv4', 'ip_src_addr': '1.1.1.1', 'ip_dst_addr': '5.5.5.5',\n            'ip_dscp': '8', 'high_speed_result_analysis': 0, 'track_by': 'trackingenabled0 ipv4DefaultPhb0',\n            'ip_dscp_tracking': 1},\n        9: {'l2_encap': 'ethernet_ii', 'ethernet_value': '88CC',\n            'data_pattern': '02 07 04 00 11 97 2F 8E 80 04 07 03 00 11 97 2F 8E 82 06 02 00 78 00 00 00 00 '\n            '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'},\n        10: {'l2_encap': 'ethernet_ii', 'ethernet_value': '8809', 'data_pattern_mode': 'fixed',\n            'data_pattern': '02 07 04 00 11 97 2F 8E 80 04 07 03 00 11 97 2F 8E 82 06 02 00 78 00 00 00 00 '\n            '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'}\n    }\n    return config_mapping.get(index, {})\n", "entry_point": "generate_config", "input": "3", "output": "{'mac_dst_mode': 'increment'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70384_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1958", "output": "{1, 2, 1958, 11, 178, 979, 22, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006035", "code": "def generate_report_query(report_type, month):\n    REPORT_TYPE_SWITCHER = {'DR': {'report_key': 'DATABASE_REPORTS', 'report_fields': 'DATABASE_REPORT_FIELDS'},\n                            'IR': {'report_key': 'ITEM_REPORTS', 'report_fields': 'ITEM_REPORT_FIELDS'},\n                            'PR': {'report_key': 'PLATFORM_REPORTS', 'report_fields': 'PLATFORM_REPORT_FIELDS'},\n                            'TR': {'report_key': 'TITLE_REPORTS', 'report_fields': 'TITLE_REPORT_FIELDS'}}\n    if report_type not in REPORT_TYPE_SWITCHER:\n        return \"Invalid report type\"\n    report_key = REPORT_TYPE_SWITCHER[report_type]['report_key']\n    report_fields = REPORT_TYPE_SWITCHER[report_type]['report_fields']\n    month_calculation = 'COALESCE(SUM(CASE month WHEN {} THEN metric END), 0)'.format(month)\n    sql_query = f\"SELECT {month_calculation} AS {report_fields}_total FROM {report_key}\"\n    return sql_query\n", "entry_point": "generate_report_query", "input": "'XYZ', 1", "output": "'Invalid report type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120649_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2301", "output": "{1, 3, 39, 13, 177, 59, 2301, 767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006037", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 5, 10, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006038", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006039", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'', 'b'", "output": "['b']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5102", "output": "{1, 2, 5102, 2551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006041", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[4, 3, 0, 3, 2, 3]", "output": "[3, 2, 3, 0, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006042", "code": "def longest_non_decreasing_substring(s):\n    substring = s[0]\n    length = 1\n    bestsubstring = substring\n    bestlength = length\n    for num in range(len(s)-1):\n        if s[num] <= s[num+1]:\n            substring += s[num+1]\n            length += 1\n            if length > bestlength:\n                bestsubstring = substring\n                bestlength = length\n        else:\n            substring = s[num+1]\n            length = 1\n    return bestsubstring\n", "entry_point": "longest_non_decreasing_substring", "input": "'aade'", "output": "'aade'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21049_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006043", "code": "def check_compatibility(version1, version2):\n    v1_major, v1_minor, v1_patch = map(int, version1.split('.'))\n    v2_major, v2_minor, v2_patch = map(int, version2.split('.'))\n    if v1_major != v2_major:\n        return False\n    elif v1_minor != v2_minor:\n        return False\n    else:\n        return v1_patch == v2_patch\n", "entry_point": "check_compatibility", "input": "'1.2.3', '1.2.3'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21465_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006044", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 90, 95, 83.5]", "output": "89.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006045", "code": "import collections\ndef is_bipartite(graph):\n    N = len(graph)\n    q = collections.deque([])\n    color = {}\n    for node in range(1, N+1):\n        if node not in color:\n            color[node] = 0\n            q.append(node)\n            while q:\n                cur = q.popleft()\n                for nei in graph[cur]:\n                    if nei in color and color[nei] == color[cur]:\n                        return False\n                    if nei not in color:\n                        color[nei] = 1 - color[cur]\n                        q.append(nei)\n    return True\n", "entry_point": "is_bipartite", "input": "{1: [2, 3], 2: [1, 3], 3: [1, 2]}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56505_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006046", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7471", "output": "{1, 31, 241, 7471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006047", "code": "import math\ndef adjust_to_tick(value, tick):\n    remainder = value % tick\n    adjusted_value = value - remainder\n    return adjusted_value\n", "entry_point": "adjust_to_tick", "input": "8.8001, 0.1", "output": "8.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4653_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006048", "code": "def calculate_time_elapsed(start_time, end_time):\n    total_seconds = end_time - start_time\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return hours, minutes, seconds\n", "entry_point": "calculate_time_elapsed", "input": "0, 7202", "output": "(2, 0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87493_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006049", "code": "def sum_of_multiples(A, k):\n    total_sum = 0\n    for row in A:\n        for elem in row:\n            if elem % k == 0:\n                total_sum += elem\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[[5, 10, 20], [10]], 5", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104742_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006050", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[3, 8, 4, 7, 2, 6, 4, 6], 2", "output": "[[3, 8], [4, 7], [2, 6], [4, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006051", "code": "import re\ndef extract_info_from_code(code_snippet):\n    imported_modules = set()\n    date = None\n    import_pattern = re.compile(r'import\\s+([\\w\\s,]+)')\n    date_pattern = re.compile(r'(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s+\\d{2}\\s+\\d{4}')\n    for line in code_snippet.split('\\n'):\n        import_match = import_pattern.search(line)\n        if import_match:\n            modules = import_match.group(1).replace(' ', '').split(',')\n            imported_modules.update(modules)\n        date_match = date_pattern.search(line)\n        if date_match:\n            date = date_match.group()\n    return list(imported_modules), date\n", "entry_point": "extract_info_from_code", "input": "''", "output": "([], None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148364_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006052", "code": "def simulate_ripple(grid, source_row, source_col):\n    source_height = grid[source_row][source_col]\n    rows, cols = len(grid), len(grid[0])\n    def manhattan_distance(row, col):\n        return abs(row - source_row) + abs(col - source_col)\n    result = [[0 for _ in range(cols)] for _ in range(rows)]\n    for row in range(rows):\n        for col in range(cols):\n            distance = manhattan_distance(row, col)\n            result[row][col] = max(grid[row][col], source_height - distance)\n    return result\n", "entry_point": "simulate_ripple", "input": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]], 1, 1", "output": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32833_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006053", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[1, 2, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006054", "code": "def check_baseline_deviation(blvals, threshold_percent):\n    if len(blvals) < 2:\n        raise ValueError(\"At least two baseline values are required for deviation calculation.\")\n    mean_bl = sum(blvals) / len(blvals)\n    max_deviation = max(abs(blvals[i] - blvals[i-1]) for i in range(1, len(blvals)))\n    percentage_deviation = (max_deviation / mean_bl) * 100\n    return percentage_deviation <= threshold_percent\n", "entry_point": "check_baseline_deviation", "input": "[5.0, 5.0], 10", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31357_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006055", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'hello oevoeor world'", "output": "['oevoeor']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4654", "output": "{1, 2, 358, 13, 4654, 179, 2327, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006057", "code": "def min_eggs_needed(egg_weights, n):\n    dp = [float('inf')] * (n + 1)\n    dp[0] = 0\n    for w in range(1, n + 1):\n        for ew in egg_weights:\n            if w - ew >= 0:\n                dp[w] = min(dp[w], dp[w - ew] + 1)\n    return dp[n]\n", "entry_point": "min_eggs_needed", "input": "[1], 17", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108972_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006058", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'2.5.0'", "output": "'2.5.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2758", "output": "{1, 2, 1379, 197, 2758, 7, 394, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006060", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'single-word'", "output": "['single-word']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006061", "code": "def count_pauli_words(num_wires):\n    if num_wires == 1:\n        return 2\n    else:\n        sub_count = count_pauli_words(num_wires - 1)\n        return 2 * sub_count + sub_count\n", "entry_point": "count_pauli_words", "input": "2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129484_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006062", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[16, 16, 9]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006063", "code": "def sum_multiples(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135007_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006064", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006065", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'schoo'", "output": "'schoo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006066", "code": "def parse_code_snippet(code):\n    info = {}\n    lines = code.strip().split('\\n')\n    for line in lines:\n        if 'Author:' in line:\n            author_info = line.split('(')\n            info['author_name'] = author_info[0].split(':')[1].strip()\n            info['author_email'] = author_info[1].split(')')[0].strip()\n        elif 'Create:' in line:\n            info['creation_date'] = line.split(':')[1].strip()\n        elif 'ChangeLog' in line:\n            change_log = []\n            for log_line in lines[lines.index(line) + 2:]:\n                if '|' in log_line:\n                    log_parts = log_line.split('|')\n                    change_log.append({\n                        'date': log_parts[0].strip(),\n                        'ticket': log_parts[1].strip(),\n                        'description': log_parts[2].strip()\n                    })\n            info['change_log'] = change_log\n    return info\n", "entry_point": "parse_code_snippet", "input": "'Some random text here.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107728_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006067", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'coding'", "output": "'coding'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006068", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#A55050'", "output": "(165, 80, 80)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3334", "output": "{1, 2, 1667, 3334}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006070", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers\"\n    elif n == 0:\n        return 1\n    else:\n        result = 1\n        for i in range(1, n + 1):\n            result *= i\n        return result\n", "entry_point": "calculate_factorial", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39360_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006071", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[100, 162.5]", "output": "62.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1713", "output": "{3, 1, 1713, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006073", "code": "def parse_inventory_data(data: str) -> dict:\n    inventory_dict = {}\n    pairs = data.split(',')\n    for pair in pairs:\n        try:\n            key, value = pair.split(':')\n            key = key.strip()\n            value = value.strip()\n            if value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            elif value.isdigit():\n                value = int(value)\n            inventory_dict[key] = value\n        except (ValueError, AttributeError):\n            # Handle parsing errors by skipping the current pair\n            pass\n    return inventory_dict\n", "entry_point": "parse_inventory_data", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83492_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006074", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[15, 20, -1, -5, 0]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006075", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0, 22, 60, 65, 67'", "output": "[0, 22, 60, 65, 67]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006076", "code": "def is_sorted(lst):\n    if all(lst[i] <= lst[i + 1] for i in range(len(lst) - 1)):\n        return True\n    elif all(lst[i] >= lst[i + 1] for i in range(len(lst) - 1)):\n        return True\n    else:\n        return False\n", "entry_point": "is_sorted", "input": "[1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96324_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006077", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'AAAAAABBBBBBCCCDD'", "output": "{'A': 6, 'B': 6, 'C': 3, 'D': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006078", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'CexCexOeO::'", "output": "('CexCexOeO', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006079", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8869", "output": "{1, 8869, 7, 49, 1267, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006080", "code": "def process_arguments(arguments):\n    build_arguments = \"\"\n    for arg in arguments:\n        if arg == \"-validation\":\n            build_arguments += \"-validation \"\n    return build_arguments.strip()\n", "entry_point": "process_arguments", "input": "['-validation']", "output": "'-validation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4598_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006081", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[3, 3, 3, 3, 4, 4, 7, 6, 5]", "output": "([3, 4, 7, 6, 5], [4, 2, 1, 1, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006082", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[50, 10, 4]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006083", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "2.4244, 2", "output": "3.4244", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006084", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'a'", "output": "'A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6227", "output": "{1, 6227, 13, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6226", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006086", "code": "def extract_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if not char.isspace():\n            unique_chars.add(char)\n    return sorted(list(unique_chars))\n", "entry_point": "extract_unique_characters", "input": "'ab def'", "output": "['a', 'b', 'd', 'e', 'f']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89815_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006087", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[3, 3, 2, 1, 4, 6]", "output": "[37, 37, 4, 1, 16, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006088", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8203", "output": "{1, 8203, 13, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006089", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "1, {1: True, 2: False}", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006090", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[91], 1", "output": "91.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86097_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006091", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "4, 3, 8", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5672", "output": "{1, 2, 4, 709, 5672, 8, 1418, 2836}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5671", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006093", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1241", "output": "{73, 1, 1241, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006094", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 5, 1, 3, 2, 4, 1]", "output": "[1, 6, 3, 6, 6, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006095", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[6, 0, 1, 5, 3, 5, 5]", "output": "[6, 0, 1, 3, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006096", "code": "def sockMerchant(n, ar):\n    sock_count = {}\n    pairs = 0\n    for color in ar:\n        if color in sock_count:\n            sock_count[color] += 1\n        else:\n            sock_count[color] = 1\n    for count in sock_count.values():\n        pairs += count // 2\n    return pairs\n", "entry_point": "sockMerchant", "input": "4, [1, 1, 2, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140964_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006097", "code": "from typing import List\ndef sum_multiples_of_3_and_5(numbers: List[int]) -> int:\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_multiples_of_3_and_5", "input": "[-15]", "output": "-15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3685_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006098", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006099", "code": "def remove_duplicates(input_string):\n    if not input_string:\n        return \"\"\n    result = input_string[0]  # Initialize result with the first character\n    for i in range(1, len(input_string)):\n        if input_string[i] != input_string[i - 1]:\n            result += input_string[i]\n    return result\n", "entry_point": "remove_duplicates", "input": "'hellohellohelloe'", "output": "'heloheloheloe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5338_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006100", "code": "def find_example_idx(n, cum_sums, idx=0):\n    N = len(cum_sums)\n    stack = [[0, N-1]]\n    while stack:\n        start, end = stack.pop()\n        search_i = (start + end) // 2\n        if start < end:\n            if n < cum_sums[search_i]:\n                stack.append([start, search_i])\n            else:\n                stack.append([search_i + 1, end])\n        else:\n            if n < cum_sums[start]:\n                return idx + start\n            else:\n                return idx + start + 1\n", "entry_point": "find_example_idx", "input": "1.5, [1.0, 2.0, 3.0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89652_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006101", "code": "def check_number_conditions(number, minRange, maxRange):\n    if len(str(number)) != 6:\n        return False\n    def hasRepeat(num):\n        return len(set(str(num))) < len(str(num))\n    def alwaysIncreasing(num):\n        return all(int(num[i]) <= int(num[i+1]) for i in range(len(num)-1))\n    if not hasRepeat(number):\n        return False\n    if not alwaysIncreasing(str(number)):\n        return False\n    if not (minRange <= number <= maxRange):\n        return False\n    return True\n", "entry_point": "check_number_conditions", "input": "12345, 100000, 999999", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77666_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "682", "output": "{1, 2, 682, 11, 341, 22, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006103", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[7]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt49", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006104", "code": "def most_common_bits(readings):\n    blen = len(readings[0])\n    count = [0 for _ in range(blen)]\n    for line in readings:\n        for i in range(blen):\n            count[i] += int(line[i])\n    most_freq = [str(int(x > len(readings)/2)) for x in count]\n    return most_freq\n", "entry_point": "most_common_bits", "input": "['101', '100', '111']", "output": "['1', '0', '1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55957_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006105", "code": "from pathlib import Path\nfrom typing import List\ndef gather_media_folders(source_folder: str) -> List[str]:\n    media_folders = []\n    this_folder = Path(source_folder)\n    while True:\n        media_folder_candidate = this_folder / 'media'\n        if media_folder_candidate.exists() and media_folder_candidate.is_dir():\n            media_folders.append(str(media_folder_candidate.absolute()))\n        if len(this_folder.parents) == 1:\n            break\n        this_folder = this_folder.parent\n    return media_folders\n", "entry_point": "gather_media_folders", "input": "'/tmp/some_folder'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13328_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2994", "output": "{1, 2, 3, 998, 6, 2994, 499, 1497}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006107", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[9, 8, 5, 5, 4, 4, 4, 1]", "output": "[81, 64, 25, 25, 16, 16, 16, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006108", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[28]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006109", "code": "from typing import List\ndef unnest_all_HPparams(grids: List[dict]) -> List[dict]:\n    def unnest_HPparams(k: str) -> tuple:\n        return tuple(k.split(\"__\"))\n    result = []\n    for grid in grids:\n        new_grid = {}\n        for k, v in grid.items():\n            name, key = unnest_HPparams(k)\n            if name not in new_grid:\n                new_grid[name] = {}\n            new_grid[name][key] = v\n        result.append(new_grid)\n    return result\n", "entry_point": "unnest_all_HPparams", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65529_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006110", "code": "def calculate_iou(A, B):\n    xA = max(A[0], B[0])\n    yA = max(A[1], B[1])\n    xB = min(A[2], B[2])\n    yB = min(A[3], B[3])\n    interArea = max(0, xB - xA) * max(0, yB - yA)\n    if interArea == 0:\n        return 0.0\n    boxAArea = (A[2] - A[0]) * (A[3] - A[1])\n    boxBArea = (B[2] - B[0]) * (B[3] - B[1])\n    iou = interArea / float(boxAArea + boxBArea - interArea)\n    return iou\n", "entry_point": "calculate_iou", "input": "(0, 0, 1, 1), (2, 2, 3, 3)", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88885_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006111", "code": "from typing import List, Dict\ndef count_actions(events: List[Dict[str, str]]) -> Dict[str, int]:\n    action_counts = {}\n    for event in events:\n        action = event.get(\"action\")\n        if action:\n            action_counts[action] = action_counts.get(action, 0) + 1\n    return action_counts\n", "entry_point": "count_actions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146906_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006112", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        width = 1\n        current_height = min(height, prev_height)\n        area = width * current_height\n        total_area += area\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[3, 4, 5, 3]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140413_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006113", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[40, 70, 100, 40, 80, 90, 50, 60, 80]", "output": "[8, 5, 1, 8, 3, 2, 7, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006114", "code": "def get_error_description(error_code):\n    error_codes = {\n        70: \"File write error\",\n        80: \"File too big to upload\",\n        90: \"Failed to create local directory\",\n        100: \"Failed to create local file\",\n        110: \"Failed to delete directory\",\n        120: \"Failed to delete file\",\n        130: \"File not found\",\n        140: \"Maximum retry limit reached\",\n        150: \"Request failed\",\n        160: \"Cache not loaded\",\n        170: \"Migration failed\",\n        180: \"Download certificates error\",\n        190: \"User rejected\",\n        200: \"Update needed\",\n        210: \"Skipped\"\n    }\n    return error_codes.get(error_code, \"Unknown Error\")\n", "entry_point": "get_error_description", "input": "160", "output": "'Cache not loaded'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66002_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006115", "code": "import os\ndef find_common_parent_directory(path1, path2):\n    parent_dir1 = path1\n    parent_dir2 = path2\n    while parent_dir1 != parent_dir2:\n        parent_dir1, dir1 = os.path.split(parent_dir1)\n        parent_dir2, dir2 = os.path.split(parent_dir2)\n    return parent_dir1\n", "entry_point": "find_common_parent_directory", "input": "'/foo/bar', '/baz/qux'", "output": "'/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43774_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006116", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 84, 84, 85, 90]", "output": "84.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61985_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006117", "code": "from typing import List, Dict\nREFERENCE_RESULTS = {\n    \"Ni\": [9.406e-6 - 0.001e-6j, 64.390e-6 - 1.351e-6j, 72.969e-6 - 2.894e-6j],\n    \"Fe2O3\": [7.176e-6 - 0j, 41.125e-6 - 3.635e-6j, 42.740e-6 - 0.956e-6j],\n    \"D2O\": [6.393e-6 - 0j, 9.455e-6 - 0.032e-6j, 9.416e-6 - 0.006e-6j],\n}\ndef calculate_scattering_lengths(compound_formulas: List[str]) -> Dict[str, List[complex]]:\n    scattering_lengths = {}\n    for compound in compound_formulas:\n        if compound in REFERENCE_RESULTS:\n            scattering_lengths[compound] = REFERENCE_RESULTS[compound]\n    return scattering_lengths\n", "entry_point": "calculate_scattering_lengths", "input": "['H2O', 'CO2', 'NaCl']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63607_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006118", "code": "def character_frequency(input_string):\n    frequency_dict = {}\n    for char in input_string:\n        if char in frequency_dict:\n            frequency_dict[char] += 1\n        else:\n            frequency_dict[char] = 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "'hhheeelllo'", "output": "{'h': 3, 'e': 3, 'l': 3, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130080_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006119", "code": "import re\ndef extract_citation_info(citation):\n    info = {}\n    title_match = re.search(r'title={(.+?)}', citation)\n    if title_match:\n        info['title'] = title_match.group(1)\n    authors_match = re.search(r'author={(.+?)}', citation)\n    if authors_match:\n        info['authors'] = authors_match.group(1).split(' and ')\n    journal_match = re.search(r'journal={(.+?)}', citation)\n    if journal_match:\n        info['journal'] = journal_match.group(1)\n    year_match = re.search(r'year={(\\d+)}', citation)\n    if year_match:\n        info['year'] = int(year_match.group(1))\n    return info\n", "entry_point": "extract_citation_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74647_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006120", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'npytodrworldn'", "output": "{'npytodrworldn': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006121", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1])  # Append the last element unchanged\n    return output_list\n", "entry_point": "process_list", "input": "[5, 4, 4, 1, 1, 1, 4, 3]", "output": "[9, 8, 5, 2, 2, 5, 7, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114829_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5276", "output": "{1, 2, 4, 1319, 2638, 5276}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5275", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006123", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006124", "code": "def calculate_data_size(data_dir, batch_size, num_workers):\n    # Number of images in train and valid directories (example values)\n    num_train_images = 1000\n    num_valid_images = 500\n    # Calculate total data size for training and validation sets\n    total_data_size_train = num_train_images * batch_size\n    total_data_size_valid = num_valid_images * batch_size\n    # Adjust data size based on the number of workers\n    total_data_size_train *= (1 + (num_workers - 1) * 0.1)\n    total_data_size_valid *= (1 + (num_workers - 1) * 0.1)\n    return total_data_size_train, total_data_size_valid\n", "entry_point": "calculate_data_size", "input": "'dummy_dir', 97.6, 1", "output": "(97600.0, 48800.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75732_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006125", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4856", "output": "{1, 2, 4, 8, 4856, 2428, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4855", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5662", "output": "{1, 2, 38, 298, 2831, 19, 149, 5662}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006127", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[1, 2, 3, 4], [0, 3, 4, 10]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144987_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006128", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6573", "output": "{1, 3, 7, 939, 6573, 2191, 21, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006129", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "17", "output": "987", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006130", "code": "import itertools\ndef unique_eigenvalue_differences(eigvals):\n    unique_eigvals = sorted(set(eigvals))\n    differences = {j - i for i, j in itertools.combinations(unique_eigvals, 2)}\n    return tuple(sorted(differences))\n", "entry_point": "unique_eigenvalue_differences", "input": "[0, 1, 2, 3]", "output": "(1, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124400_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006131", "code": "def count_students_above_threshold(scores, threshold):\n    left, right = 0, len(scores)\n    while left < right:\n        mid = left + (right - left) // 2\n        if scores[mid] < threshold:\n            left = mid + 1\n        else:\n            right = mid\n    return len(scores) - left\n", "entry_point": "count_students_above_threshold", "input": "[10, 20, 30, 40, 51, 52, 53, 54, 55, 60], 50", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138305_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006132", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[1, 5, 1]", "output": "[1, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006133", "code": "def max_non_adjacent_sum(scores):\n    inclusive = 0\n    exclusive = 0\n    for score in scores:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + score\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[15, 5, 18]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32468_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1206", "output": "{1, 2, 3, 67, 6, 134, 201, 9, 402, 18, 1206, 603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006135", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[16, 15, 2, 17, 15]", "output": "[16, 'FizzBuzz', 2, 17, 'FizzBuzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006136", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9959", "output": "{1, 433, 23, 9959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006137", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "13", "output": "233", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006138", "code": "def minimum_swaps(arr):\n    a = dict(enumerate(arr, 1))\n    b = {v: k for k, v in a.items()}\n    count = 0\n    for i in a:\n        x = a[i]\n        if x != i:\n            y = b[i]\n            a[y] = x\n            b[x] = y\n            count += 1\n    return count\n", "entry_point": "minimum_swaps", "input": "[1, 2, 3, 4, 5]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125007_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006139", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'orbitrap', 'positive'", "output": "{'tolerance': 0.005, 'mode': 'positive'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006140", "code": "from typing import List\ndef maxFruits(tree: List[int]) -> int:\n    if not tree or len(tree) == 0:\n        return 0\n    left = 0\n    ans = 0\n    baskets = {}\n    for t, fruit in enumerate(tree):\n        baskets[fruit] = t\n        if len(baskets) > 2:\n            left = min(baskets.values())\n            del baskets[tree[left]]\n            left += 1\n        ans = max(ans, t - left + 1)\n    return ans\n", "entry_point": "maxFruits", "input": "[1, 2, 1, 1, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77640_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8527", "output": "{1, 8527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006142", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1100110X'", "output": "['11001100', '11001101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8068", "output": "{1, 2, 4034, 8068, 4, 2017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8067", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006144", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 81, 80, 75, 75]", "output": "[92, 81, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006145", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7706", "output": "{1, 7706, 2, 3853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7705", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006146", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "1234567890.0, 2616784678.328356", "output": "1382216788.3283558", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006147", "code": "def extract_full_name(input_str):\n    words = input_str.split()\n    full_name = ''.join(word[0] for word in words if word.isalpha())\n    return full_name\n", "entry_point": "extract_full_name", "input": "'s'", "output": "'s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98367_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006148", "code": "def find_equal(lst):\n    seen = {}  # Dictionary to store elements and their indices\n    for i, num in enumerate(lst):\n        if num in seen:\n            return (seen[num], i)  # Return the indices of the first pair of equal elements\n        seen[num] = i\n    return None  # Return None if no pair of equal elements is found\n", "entry_point": "find_equal", "input": "[5, 5]", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51954_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006149", "code": "import re\ndef is_valid_password(password):\n    # Check if the password length is at least 8 characters\n    if len(password) < 8:\n        return False\n    # Check if the password meets all criteria using regular expressions\n    if not re.search(r'[A-Z]', password) or not re.search(r'[a-z]', password) or not re.search(r'\\d', password) or not re.search(r'[!@#$%^&*]', password):\n        return False\n    return True\n", "entry_point": "is_valid_password", "input": "'Password1!'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84984_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006150", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'aacrch6r4'", "output": "'aacrch6r4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006151", "code": "def process_criteria(criteria: str) -> int:\n    name, operator = criteria.split(':')\n    result = ord(name[0]) & ord(operator[-1])\n    return result\n", "entry_point": "process_criteria", "input": "'x:y'", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137762_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2935", "output": "{1, 587, 5, 2935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006153", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "1.0, 8.0, 100", "output": "(1.0, 0.0375)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006154", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3409", "output": "{3409, 1, 487, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006155", "code": "def my_pow(x: float, n: int) -> float:\n    if n == 0:\n        return 1\n    result = my_pow(x*x, abs(n) // 2)\n    if n % 2:\n        result *= x\n    if n < 0:\n        return 1 / result\n    return result\n", "entry_point": "my_pow", "input": "2, 8", "output": "256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125524_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006156", "code": "def map_base_types(base_types, base_type_mapping):\n    grpc_base_types = []\n    for base_type in base_types:\n        if base_type in base_type_mapping:\n            grpc_base_types.append(base_type_mapping[base_type])\n    return grpc_base_types\n", "entry_point": "map_base_types", "input": "[], {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105849_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006157", "code": "def is_valid_brackets(s: str) -> bool:\n    stack = []\n    bracket_pairs = {')': '(', ']': '[', '}': '{'}\n    for char in s:\n        if char in bracket_pairs.values():\n            stack.append(char)\n        elif char in bracket_pairs.keys():\n            if not stack or stack.pop() != bracket_pairs[char]:\n                return False\n    return not stack\n", "entry_point": "is_valid_brackets", "input": "'{[()]}'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59295_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7257", "output": "{1, 3, 41, 123, 177, 2419, 7257, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5476", "output": "{1, 2, 5476, 4, 37, 74, 2738, 148, 1369}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5475", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006160", "code": "def move_player(movements):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    player_position = [0, 0]\n    for move in movements:\n        dx, dy = directions.get(move, (0, 0))\n        new_x = player_position[0] + dx\n        new_y = player_position[1] + dy\n        if 0 <= new_x < 5 and 0 <= new_y < 5:\n            player_position[0] = new_x\n            player_position[1] = new_y\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['D', 'R', 'R', 'R', 'R']", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144868_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006161", "code": "def find_first_exceeded_day(tweet_counts):\n    for day, count in enumerate(tweet_counts):\n        if count > 200:\n            return day\n    return -1\n", "entry_point": "find_first_exceeded_day", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137540_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006162", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[1, 2, 3, 4, 3]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006163", "code": "from typing import List, Tuple\ndef find_pairs(nums: List[int], target: int) -> List[Tuple[int, int]]:\n    seen = set()\n    pairs = []\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            pairs.append((num, complement))\n        seen.add(num)\n    return pairs\n", "entry_point": "find_pairs", "input": "[9, 9], 18", "output": "[(9, 9)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97249_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006164", "code": "from typing import List\ndef sum_divisible_by_two_and_three(numbers: List[int]) -> int:\n    divisible_sum = 0\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            divisible_sum += num\n    return divisible_sum\n", "entry_point": "sum_divisible_by_two_and_three", "input": "[6, 6, 0]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125267_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006165", "code": "def calculate_video_duration(fps, total_frames):\n    total_duration = total_frames / fps\n    return round(total_duration, 2)\n", "entry_point": "calculate_video_duration", "input": "30, 1296", "output": "43.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131697_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006166", "code": "def check_gift(distance):\n    if distance < 25:\n        value = 2\n    elif distance < 50:\n        value = 5\n    elif distance < 75:\n        value = 10\n    else:\n        value = 20\n    print(str(value) + ' eVoucher')  # Display the eVoucher value\n    return value\n", "entry_point": "check_gift", "input": "50", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75143_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006167", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the '.' delimiter\n    version_components = version_string.split('.')\n    # Extract major, minor, and patch version numbers\n    major_version = int(version_components[0])\n    minor_version = int(version_components[1])\n    patch_version = int(version_components[2])\n    return major_version, minor_version, patch_version\n", "entry_point": "extract_version_numbers", "input": "'0.5.3'", "output": "(0, 5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146914_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006168", "code": "def fill_gaps(input_array):\n    def get_neighbors_avg(row, col):\n        neighbors = []\n        for r, c in [(row-1, col), (row+1, col), (row, col-1), (row, col+1)]:\n            if 0 <= r < len(input_array) and 0 <= c < len(input_array[0]) and input_array[r][c] != 'GAP':\n                neighbors.append(input_array[r][c])\n        return sum(neighbors) / len(neighbors) if neighbors else 0\n    output_array = [row[:] for row in input_array]  # Create a copy of the input array\n    for i in range(len(input_array)):\n        for j in range(len(input_array[0])):\n            if input_array[i][j] == 'GAP':\n                output_array[i][j] = get_neighbors_avg(i, j)\n    return output_array\n", "entry_point": "fill_gaps", "input": "[['GAP', 2], [3, 'GAP']]", "output": "[[2.5, 2], [3, 2.5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131580_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "957", "output": "{1, 33, 3, 11, 29, 87, 957, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006170", "code": "def parse_launches(input_str):\n    launches_dict = {}\n    launches_list = input_str.split(',')\n    for launch_pair in launches_list:\n        date, description = launch_pair.split(':')\n        launches_dict[date] = description\n    return launches_dict\n", "entry_point": "parse_launches", "input": "'2022-0:Launch'", "output": "{'2022-0': 'Launch'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64743_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006171", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[80, 82, 83, 85, 80]", "output": "82.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006172", "code": "def maximum_product(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[-3, -3, -1]", "output": "-9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38245_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006173", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'world'", "output": "'WORLD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006174", "code": "def sum_of_squares_of_even_numbers(input_list):\n    total = 0\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49969_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006175", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if isinstance(num, int) and num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 8, 10, 12, 26]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31563_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006176", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'111.3.9'", "output": "'111.4.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5735", "output": "{1, 5, 37, 5735, 155, 185, 1147, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5734", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006178", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 4, 8]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111856_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006179", "code": "def find_second_smallest(nums):\n    if len(nums) < 2:\n        return None\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif smallest < num < second_smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[1, 2, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14329_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006180", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[4, 8, 7]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006181", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[3, 3, 7, 7, 7, 9]", "output": "[81, 49, 49, 49, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006182", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{1, 2, 3}, {4, 5, 6, 7}", "output": "{1, 2, 3, 4, 5, 6, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006183", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6044", "output": "{1, 2, 4, 1511, 3022, 6044}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6043", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006184", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[8, 4, 4, 3, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006185", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[2, 2, 3]", "output": "[2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006186", "code": "def validate_oid(oid: str) -> bool:\n    integers = oid.split('.')\n    if len(integers) < 2:\n        return False\n    if not (0 <= int(integers[0]) <= 2 and 0 <= int(integers[1]) <= 39):\n        return False\n    for num in integers[2:]:\n        if not (0 <= int(num) <= 2**64 - 1):\n            return False\n    return True\n", "entry_point": "validate_oid", "input": "'1.15'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130249_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006187", "code": "import importlib\ndef execute_function_from_module(module_name, function_name, *args, **kwargs):\n    try:\n        module = importlib.import_module(module_name)\n        function = getattr(module, function_name)\n        return function(*args, **kwargs)\n    except ModuleNotFoundError:\n        return f\"Module '{module_name}' not found.\"\n    except AttributeError:\n        return f\"Function '{function_name}' not found in module '{module_name}'.\"\n", "entry_point": "execute_function_from_module", "input": "'tmath', 'any_function'", "output": "\"Module 'tmath' not found.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133564_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8317", "output": "{1, 8317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006189", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "121, 8", "output": "'00000121'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5939", "output": "{1, 5939}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006191", "code": "from collections import deque\ndef new_year_chaos(n, q):\n    acc = 0\n    expect = list(range(1, n + 1))\n    q = deque(q)\n    while q:\n        iof = expect.index(q[0])\n        if iof > 2:\n            return 'Too chaotic'\n        else:\n            acc += iof\n            expect.remove(q[0])\n            q.popleft()\n    return acc\n", "entry_point": "new_year_chaos", "input": "3, [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98787_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006192", "code": "def flexible_sum(*args):\n    if len(args) < 3:\n        args += (30, 40)[len(args):]  # Assign default values if fewer than 3 arguments provided\n    return sum(args)\n", "entry_point": "flexible_sum", "input": "20, 20, 20", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74466_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006193", "code": "def calculate_difference(n):\n    square_of_sum = (n ** 2 * (n + 1) ** 2) / 4\n    sum_of_squares = (n * (n + 1) * ((2 * n) + 1)) / 6\n    return int(square_of_sum - sum_of_squares)\n", "entry_point": "calculate_difference", "input": "2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42300_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006194", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(1, len(lst)):\n        abs_diff_sum += abs(lst[i] - lst[i - 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 5, 5, 10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72973_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006195", "code": "def get_api_info(service_name):\n    api_services = {\n        \"GOOGLE\": (\"\", \"https://maps.googleapis.com/maps/api/directions/json?units=imperial\"),\n        \"MAPZEN\": (\"\", \"https://valhalla.mapzen.com/route\")\n    }\n    if service_name in api_services:\n        return api_services[service_name]\n    else:\n        return \"Service not found\"\n", "entry_point": "get_api_info", "input": "'INVALID_SERVICE'", "output": "'Service not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100358_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006196", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = low + (high - low) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31126_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006197", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "327", "output": "372", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006198", "code": "def move_files(from_location, to_location, file_pattern):\n    # Hypothetical functions for copy, remove, and delete operations\n    def copy_files(from_location, to_location, file_pattern):\n        # Implementation not provided for this example\n        return \"Copy operation successful\"\n    def remove_files(location, file_pattern):\n        # Implementation not provided for this example\n        return {\"code\": \"OK\"}\n    def delete_directory(directory):\n        # Implementation not provided for this example\n        return \"Directory deleted\"\n    result = copy_files(from_location, to_location, file_pattern)\n    if result == \"Copy operation successful\":\n        result = remove_files(from_location, file_pattern)\n        if result[\"code\"] == \"OK\" and from_location != \"incoming\":\n            result = delete_directory(from_location)\n    return result\n", "entry_point": "move_files", "input": "'temp_directory', 'backup_directory', '*.txt'", "output": "'Directory deleted'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112579_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006199", "code": "def calculate_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:  # Odd number of elements\n        return sorted_nums[n // 2]\n    else:  # Even number of elements\n        mid_left = n // 2 - 1\n        mid_right = n // 2\n        return (sorted_nums[mid_left] + sorted_nums[mid_right]) / 2\n", "entry_point": "calculate_median", "input": "[2, 4, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32741_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006200", "code": "import re\ndef extract_view_names(urlpatterns):\n    view_names = {}\n    for pattern in urlpatterns:\n        url_pattern, view_function, view_name = pattern\n        view_names[url_pattern] = view_name\n    return view_names\n", "entry_point": "extract_view_names", "input": "[('^search/$', 'some_view_function', 'search')]", "output": "{'^search/$': 'search'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111716_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006201", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "6", "output": "'GetGestures'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006202", "code": "def fetch_java(file_paths):\n    java_files_count = 0\n    for file_path in file_paths:\n        if file_path.endswith(\".java\"):\n            java_files_count += 1\n    return java_files_count\n", "entry_point": "fetch_java", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143990_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4291", "output": "{1, 4291, 613, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9263", "output": "{1, 59, 157, 9263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006205", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 2, 1, 2, 1, 2, 1], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13435_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006206", "code": "def process_info(input_string):\n    char_count = {}\n    for char in input_string:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    return char_count\n", "entry_point": "process_info", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28397_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006207", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'AB.AEAE'", "output": "[('AB', 'AEAE')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006208", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "99.0, 101.0", "output": "(-49.5, 49.5, 84.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006209", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3518", "output": "{1, 2, 3518, 1759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3517", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006210", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'225'", "output": "{'225': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006211", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'t&lt;3;'", "output": "'t<3;'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006212", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    sum_evens = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_evens += num\n    return sum_evens\n", "entry_point": "sum_of_evens", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136227_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006213", "code": "def filter_models(models: list) -> list:\n    filtered_models = [model for model in models if model.startswith('N')]\n    return filtered_models\n", "entry_point": "filter_models", "input": "['NaiveBayes', 'DecisionTree', 'RandomForest']", "output": "['NaiveBayes']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141779_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006214", "code": "def get_char_width(char):\n    def _char_in_map(char, map):\n        for begin, end in map:\n            if char < begin:\n                break\n            if begin <= char <= end:\n                return True\n        return False\n    char = ord(char)\n    _COMBINING_CHARS = [(768, 879)]\n    _EAST_ASIAN_WILD_CHARS = [(11904, 55215)]  # Example range for East Asian wide characters\n    if _char_in_map(char, _COMBINING_CHARS):\n        return 0\n    if _char_in_map(char, _EAST_ASIAN_WILD_CHARS):\n        return 2\n    return 1\n", "entry_point": "get_char_width", "input": "'\u0300'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65761_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2157", "output": "{1, 3, 2157, 719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006216", "code": "import re\ndef check_valid_password(password):\n    if len(password) < 8:\n        return False\n    if not re.search(r\"[A-Z]\", password):\n        return False\n    if not re.search(r\"[a-z]\", password):\n        return False\n    if not re.search(r\"\\d\", password):\n        return False\n    if not re.search(r\"[!@#$%^&*()-_+=]\", password):\n        return False\n    return True\n", "entry_point": "check_valid_password", "input": "'Pass1!'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35155_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006217", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'\u4f60\u597d'", "output": "b'\\xe4\\xbd\\xa0\\xe5\\xa5\\xbd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006218", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[3, 1, -2, 8, 0, 2, 8, -3, -1]", "output": "[-3, -2, -1, 0, 1, 2, 3, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006219", "code": "def min_removals_to_palindrome(stream):\n    def is_palindrome(s):\n        return s == s[::-1]\n    def min_removals_helper(s, left, right):\n        if left >= right:\n            return 0\n        if s[left] == s[right]:\n            return min_removals_helper(s, left + 1, right - 1)\n        else:\n            return 1 + min(min_removals_helper(s, left + 1, right), min_removals_helper(s, left, right - 1))\n    return min_removals_helper(stream, 0, len(stream) - 1)\n", "entry_point": "min_removals_to_palindrome", "input": "'abcda'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84471_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6473", "output": "{6473, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006221", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['0.0.1', '0.0.2', '0.0.0']", "output": "'0.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006222", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            output_list.append(num + 10)\n        elif num % 2 != 0:\n            output_list.append(num - 5)\n        if num % 5 == 0:\n            output_list[-1] *= 2\n    return output_list\n", "entry_point": "process_integers", "input": "[3, 2, 8, 20, 3, 3]", "output": "[-2, 12, 18, 60, -2, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148920_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006223", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['Jack', 2, 'Ace']", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006224", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 4, 3, 2]", "output": "[5, 7, 7, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006225", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006226", "code": "def validate_config_keys(config, valid_keys):\n    for key in config.keys():\n        if key not in valid_keys:\n            return False\n    return True\n", "entry_point": "validate_config_keys", "input": "{}, ['key1', 'key2']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138912_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006227", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[4, 0, 1, 3, 2, 4, 3, 1, 0]", "output": "[4, 4, 5, 8, 10, 14, 17, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006228", "code": "def extract_contact_emails(invoices):\n    unique_emails = set()\n    for invoice in invoices:\n        unique_emails.add(invoice.get('contact_email'))\n    return list(unique_emails)\n", "entry_point": "extract_contact_emails", "input": "[{'contact_email': None}, {'contact_email': None}]", "output": "[None]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24680_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006229", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[5, 5, 5, 3, 3, 4, 4]", "output": "[25, 25, 25, 9, 9, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006230", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "407", "output": "{1, 11, 37, 407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006231", "code": "import re\ndef extract_lessons_topics(text):\n    lesson_topic_dict = {}\n    lesson_pattern = re.compile(r'Lessons? (\\d+).*?cover(.*?)\\.')\n    lessons_info = lesson_pattern.findall(text)\n    for lesson_num, topics_str in lessons_info:\n        topics = [topic.strip() for topic in topics_str.split('and')]\n        lesson_topic_dict[int(lesson_num)] = topics\n    return lesson_topic_dict\n", "entry_point": "extract_lessons_topics", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78720_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006232", "code": "def plate_validation(plate):\n    if len(plate) not in [6, 7]:\n        return False\n    if not plate[:3].isalpha():\n        return False\n    if not plate[-4:].isdigit():\n        return False\n    return True\n", "entry_point": "plate_validation", "input": "'ABC12'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118079_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006233", "code": "from typing import List\nimport itertools\ndef count_combinations(nums: List[int], length: int) -> int:\n    # Generate all combinations of the given length from the input list\n    all_combinations = list(itertools.combinations(nums, length))\n    # Return the total number of unique combinations\n    return len(all_combinations)\n", "entry_point": "count_combinations", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 3", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6198_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006234", "code": "import re\ndef validate_alphanumeric(input_string):\n    pattern = r'^[0-9a-zA-Z]*$'\n    return bool(re.match(pattern, input_string))\n", "entry_point": "validate_alphanumeric", "input": "'abc123'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133892_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8123", "output": "{1, 8123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006236", "code": "def bijektivna(dictionary):\n    mapped_values = set()\n    for key, value in dictionary.items():\n        if value in mapped_values:\n            return False\n        mapped_values.add(value)\n    return True\n", "entry_point": "bijektivna", "input": "{'a': 1, 'b': 2, 'c': 3}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59907_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006237", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "10", "output": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006238", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 3, 1, 3, -2, 3, 1]", "output": "[3, 5, 4, 4, 1, 1, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006239", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene1.mu3.mut3'", "output": "[('gene1', 'mu3', 'mut3')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006240", "code": "import unicodedata\ndef count_unique_alphanumeric_chars(input_str):\n    alphanumeric_chars = set()\n    for char in input_str:\n        if unicodedata.category(char).startswith(\"L\") or unicodedata.category(char).startswith(\"N\"):\n            alphanumeric_chars.add(char.lower())\n    return len(alphanumeric_chars)\n", "entry_point": "count_unique_alphanumeric_chars", "input": "'a1B2C'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45124_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006241", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4918", "output": "{1, 2, 2459, 4918}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4917", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "776", "output": "{1, 2, 194, 388, 4, 97, 776, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt775", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006243", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'ba'", "output": "{'ba': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40517_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006244", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "7, 6", "output": "[0, 1, 8, 51, 310, 1865, 11196]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006245", "code": "from typing import List, Dict\ndef get_hot_skus(hot_skus: List[Dict[int, List[str]]], category_id: int) -> List[str]:\n    for hot_sku_dict in hot_skus:\n        if category_id in hot_sku_dict:\n            return hot_sku_dict[category_id]\n    return []\n", "entry_point": "get_hot_skus", "input": "[{1: ['SKU1', 'SKU2']}, {2: ['SKU3', 'SKU4']}], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38427_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006246", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "87", "output": "0.48333333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006247", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "897", "output": "{1, 897, 3, 69, 39, 299, 13, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006248", "code": "def sum_of_squares_excluding_divisible_by_3_and_5(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_divisible_by_3_and_5", "input": "12", "output": "650", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77973_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006249", "code": "def extract_authentication_backends(code_snippet):\n    authentication_backends = []\n    # Split the code snippet into lines\n    lines = code_snippet.split('\\n')\n    # Iterate through each line to find authentication backends\n    for line in lines:\n        if 'AUTHENTICATION_BACKENDS' in line:\n            # Extract the authentication backends from the line\n            start_index = line.find('(') + 1\n            end_index = line.rfind(')')\n            backends = line[start_index:end_index].split(',')\n            # Remove leading and trailing whitespaces from each backend\n            backends = [backend.strip() for backend in backends]\n            # Add the extracted backends to the list\n            authentication_backends.extend(backends)\n    # Remove duplicates by converting the list to a set and back to a list\n    unique_authentication_backends = list(set(authentication_backends))\n    return unique_authentication_backends\n", "entry_point": "extract_authentication_backends", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130410_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006250", "code": "def calculate_score(result):\n    if result == \"win\":\n        return 3\n    elif result == \"loss\":\n        return -1\n    elif result == \"draw\":\n        return 0\n    else:\n        return \"Invalid result\"\n", "entry_point": "calculate_score", "input": "'win'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88276_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006251", "code": "def count_older_ages(ages, threshold):\n    count = 0\n    for age in ages:\n        if age > threshold:\n            count += 1\n    return count\n", "entry_point": "count_older_ages", "input": "[25, 30, 35], 30", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135375_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006252", "code": "def process_node_env_vars(env_vars):\n    nodeVersion = env_vars.get('LIBNODE_NODE_VERSION', '')\n    configFlags = env_vars.get('LIBNODE_CONFIG_FLAGS', '').split()\n    x86 = env_vars.get('LIBNODE_X86', '') == '1'\n    zipBasenameSuffix = env_vars.get('LIBNODE_ZIP_SUFFIX', '')\n    if env_vars.get('LIBNODE_SMALL_ICU', '') == '1':\n        configFlags.append('--with-intl=small-icu')\n        zipBasenameSuffix += '-smallicu'\n    return configFlags, zipBasenameSuffix\n", "entry_point": "process_node_env_vars", "input": "{}", "output": "([], '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108366_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006253", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'He is a friend.'", "output": "'Tom is a friend.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006254", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'prct'", "output": "'prct'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9004", "output": "{1, 2, 4, 2251, 9004, 4502}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9003", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006256", "code": "def filter_settings_by_prefix(settings, prefix):\n    filtered_settings = {}\n    prefix_length = len(prefix)\n    for key in settings:\n        if key.startswith(prefix):\n            k = key[prefix_length:].lower()\n            filtered_settings[k] = settings[key]\n    return filtered_settings\n", "entry_point": "filter_settings_by_prefix", "input": "{'another_key': 'value', 'some_other_key': 'value'}, 'prefix_'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126168_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006257", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "5.05607399999999, 5.0", "output": "50.05607399999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006258", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "6", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006259", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "6", "output": "'SDL_LOG_CATEGORY_RENDER'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006260", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5374", "output": "{1, 2, 5374, 2687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006261", "code": "def calculate_coverage_percentage(executed_lines):\n    total_lines = 10  # Total number of unique lines in the code snippet\n    executed_lines = set(executed_lines)  # Convert executed lines to a set for uniqueness\n    executed_unique_lines = len(executed_lines)  # Number of unique lines executed\n    coverage_percentage = int((executed_unique_lines / total_lines) * 100)  # Calculate coverage percentage\n    return coverage_percentage\n", "entry_point": "calculate_coverage_percentage", "input": "[1, 2, 3, 4, 5, 1, 2, 3, 4, 5]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8427_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006262", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0  # Handle the case where there are no scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[89.0, 90.0], 2", "output": "89.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44364_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006263", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[112]", "output": "112", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006264", "code": "import math\ndef combs(n, k):\n    if k == 0 or k == n:\n        return 1\n    return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))\n", "entry_point": "combs", "input": "5, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128662_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006265", "code": "from typing import List\ndef filter_module_names(module_list: List[str]) -> List[str]:\n    valid_modules = [module for module in module_list if not module.startswith('.')]\n    return valid_modules\n", "entry_point": "filter_module_names", "input": "['m.o.e', 'onst', 'move', 'mo.e']", "output": "['m.o.e', 'onst', 'move', 'mo.e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95042_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006266", "code": "def count_age_categories(ages):\n    adults = 0\n    minors = 0\n    for age in ages:\n        if age >= 18:\n            adults += 1\n        else:\n            minors += 1\n    return adults, minors\n", "entry_point": "count_age_categories", "input": "[18, 18, 18, 18, 18, 18, 18]", "output": "(7, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73769_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006267", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Hello! hello. hello?'", "output": "['hello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006268", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[10, 14]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006269", "code": "def count_distinct_arrangements(input):\n    input += [max(input) + 3]\n    paths = [0] * (max(input) + 1)\n    paths[0] = 1\n    for i in input:\n        for j in (1, 2, 3):\n            if i - j in input:\n                paths[i] += paths[i - j]\n    return paths[-1]\n", "entry_point": "count_distinct_arrangements", "input": "[1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120360_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9572", "output": "{1, 2, 9572, 4, 4786, 2393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9571", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006271", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 10]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71615_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006272", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "15", "output": "'PROGRAMMABLE_SWITCH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5255", "output": "{1, 1051, 5, 5255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5254", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006274", "code": "import bisect\ndef findKth(nums, k):\n    if not nums or k <= 0:\n        return -1\n    low = min(min(arr) for arr in nums)\n    high = max(max(arr) for arr in nums)\n    result = -1\n    while low <= high:\n        mid = (low + high) // 2\n        count = sum(len(arr) - bisect.bisect_left(arr, mid) for arr in nums)\n        if count >= k:\n            result = mid\n            high = mid - 1\n        else:\n            low = mid + 1\n    return result if k <= sum(len(arr) for arr in nums) else -1\n", "entry_point": "findKth", "input": "[[1, 2, 3], [4, 5]], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51522_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006275", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5851", "output": "{1, 5851}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006276", "code": "def calculate_total_elements(maxlag, disp_lag, dt):\n    # Calculate the total number of elements in the matrix\n    total_elements = 2 * int(disp_lag / dt) + 1\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "maxlag=0, disp_lag=-8, dt=1", "output": "-15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39261_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5467", "output": "{1, 7, 71, 11, 781, 77, 497, 5467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006278", "code": "def process_options(options):\n    format = options.get('format')\n    indent = options.get('indent')\n    using = options.get('database')\n    excludes = options.get('exclude')\n    show_traceback = options.get('traceback')\n    use_natural_keys = options.get('use_natural_keys')\n    use_base_manager = options.get('use_base_manager')\n    pks = options.get('primary_keys')\n    if pks:\n        primary_keys = pks.split(',')\n    else:\n        primary_keys = []\n    excluded_apps = set()\n    excluded_models = set()\n    return primary_keys, excluded_apps, excluded_models\n", "entry_point": "process_options", "input": "{}", "output": "([], set(), set())", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78062_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8993", "output": "{1, 8993, 391, 529, 17, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006280", "code": "from typing import List\ndef sum_multiples(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131686_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006281", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3055", "output": "{1, 65, 611, 5, 235, 13, 3055, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006282", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'hhevcehhv'", "output": "'hhevcehhv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006283", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6745", "output": "{1, 355, 1349, 5, 71, 19, 6745, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4583", "output": "{1, 4583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006285", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[0, 0, 225], 3, 3", "output": "225.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006286", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "1.0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006287", "code": "def scatter_nd_simple(data, indices, updates):\n    updated_data = [row[:] for row in data]  # Create a copy of the original data\n    for idx, update in zip(indices, updates):\n        row_idx, col_idx = idx\n        updated_data[row_idx][col_idx] += update\n    return updated_data\n", "entry_point": "scatter_nd_simple", "input": "[[0, 0, 0], [0, 0, 0]], [(0, 0), (1, 1)], [5, 5]", "output": "[[5, 0, 0], [0, 5, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7645_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006288", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'3', '5', 'gpu', '2.13'", "output": "'3.5-gpu-ml-scala2.13'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006289", "code": "def calculate_median(data):\n    sorted_data = sorted(data)\n    n = len(sorted_data)\n    if n % 2 == 1:\n        return sorted_data[n // 2]\n    else:\n        mid1 = sorted_data[n // 2 - 1]\n        mid2 = sorted_data[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[5, 6]", "output": "5.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16083_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006290", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[70, 75, 76, 77, 80]", "output": "76.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23072_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006291", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "256", "output": "'?255'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006292", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'Bob'", "output": "'BobboB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006293", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 1, 6]", "output": "[7, 5, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92643_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006294", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'image_without_tag'", "output": "('image_without_tag', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006295", "code": "def total_legs(animal_list):\n    total_legs_count = 0\n    animals = animal_list.split(',')\n    for animal in animals:\n        name, legs = animal.split(':')\n        total_legs_count += int(legs)\n    return total_legs_count\n", "entry_point": "total_legs", "input": "'dog:4,cat:4'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23053_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006296", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Two potential products:\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # First two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[3, 4, 4]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130562_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006297", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6429", "output": "{1, 3, 6429, 2143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006298", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[5, 7, 10, 6]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006299", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "12", "output": "232", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006300", "code": "from typing import List\ndef sum_double_duplicates(lst: List[int]) -> int:\n    element_freq = {}\n    total_sum = 0\n    # Count the frequency of each element in the list\n    for num in lst:\n        element_freq[num] = element_freq.get(num, 0) + 1\n    # Calculate the sum considering duplicates\n    for num, freq in element_freq.items():\n        if freq > 1:\n            total_sum += num * 2 * freq\n        else:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_double_duplicates", "input": "[5, 5, 2]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21856_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006301", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[2, -2, -2, -2, -2, 4, 3, -3]", "output": "{2: 1, -2: 4, 4: 1, 3: 1, -3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006302", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[3, 5, 4, 1], 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006303", "code": "def compress_string(s1):\n    newStr = ''\n    char = ''\n    count = 0\n    for i in range(len(s1)):\n        if char != s1[i]:\n            if char != '':  # Add previous character and count to newStr\n                newStr += char + str(count)\n            char = s1[i]\n            count = 1\n        else:\n            count += 1\n    newStr += char + str(count)  # Add last character and count to newStr\n    if len(newStr) > len(s1):\n        return s1\n    return newStr\n", "entry_point": "compress_string", "input": "'abccccaaaabac'", "output": "'abccccaaaabac'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79600_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006304", "code": "import re\ndef is_secure_revision(revision):\n    if len(revision) < 8:\n        return False\n    if not any(char.isupper() for char in revision):\n        return False\n    if not any(char.islower() for char in revision):\n        return False\n    if not any(char.isdigit() for char in revision):\n        return False\n    if not any(not char.isalnum() for char in revision):\n        return False\n    if re.search(r'(?i)PASSWORD', revision):\n        return False\n    return True\n", "entry_point": "is_secure_revision", "input": "'abc123'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22390_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006305", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "15", "output": "[5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3553", "output": "{1, 3553, 323, 11, 17, 209, 19, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006307", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'example'", "output": "'example_1861000095'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006308", "code": "def extract_unit_model(string):\n    # Split the input string by spaces to extract individual unit representations\n    units = string.split()\n    # Format each unit representation by adding a space between the unit name and exponent\n    formatted_units = [unit.replace('^', '^(') + ')' for unit in units]\n    # Join the formatted unit representations into a single string with spaces in between\n    unit_model = ' '.join(formatted_units)\n    return unit_model\n", "entry_point": "extract_unit_model", "input": "'mGr^aGram^(-1.0)'", "output": "'mGr^(aGram^((-1.0))'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81565_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006309", "code": "def generate_indices(s):\n    modes = []\n    for i, c in enumerate(s):\n        modes += [i] * int(c)\n    return sorted(modes)\n", "entry_point": "generate_indices", "input": "'231'", "output": "[0, 0, 1, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130187_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006310", "code": "from typing import List, Tuple\ndef compress_dataset(data: List[int]) -> List[Tuple[int, int]]:\n    if not data:\n        return []\n    result = []\n    current_num = data[0]\n    count = 1\n    for i in range(1, len(data)):\n        if data[i] == current_num:\n            count += 1\n        else:\n            result.append((current_num, count))\n            current_num = data[i]\n            count = 1\n    result.append((current_num, count))\n    return result\n", "entry_point": "compress_dataset", "input": "[1, 1, 2, 2, 2, 3, 3, 3, 3]", "output": "[(1, 2), (2, 3), (3, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23372_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006311", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[22, 22, 23, 23, 24]", "output": "22.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006312", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[2, 2, -7, -3, -3]", "output": "[4, 4, -343, -27, -27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006313", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return []\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    max_length = max(dp)\n    max_index = dp.index(max_length)\n    result = [nums[max_index]]\n    current_length = max_length - 1\n    for i in range(max_index - 1, -1, -1):\n        if dp[i] == current_length and nums[i] < result[-1]:\n            result.append(nums[i])\n            current_length -= 1\n    return result[::-1]\n", "entry_point": "longest_increasing_subsequence", "input": "[1, 3]", "output": "[1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9591_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006314", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[60]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006315", "code": "def calculate_total_facelets(width):\n    facelets_per_row = 3\n    facelets_per_face = facelets_per_row ** 2\n    faces_count = 6\n    total_facelets = facelets_per_face * faces_count\n    return total_facelets\n", "entry_point": "calculate_total_facelets", "input": "0", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18081_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006316", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "0.1", "output": "5e-05", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006317", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[11, 10, 9, 10]", "output": "[14641, 10000, 6561, 10000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006318", "code": "def GetNote(note_name, scale):\n    midi_val = (scale - 1) * 12  # MIDI value offset based on scale\n    # Dictionary to map note letters to MIDI offsets\n    note_offsets = {'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11}\n    note = note_name[0]\n    if note not in note_offsets:\n        raise ValueError(\"Invalid note name\")\n    midi_val += note_offsets[note]\n    if len(note_name) > 1:\n        modifier = note_name[1]\n        if modifier == 's' or modifier == '#':\n            midi_val += 1\n        else:\n            raise ValueError(\"Invalid note modifier\")\n    if note_name[:2] in ('es', 'e#', 'bs', 'b#'):\n        raise ValueError(\"Invalid note combination\")\n    return midi_val\n", "entry_point": "GetNote", "input": "'c#', -1", "output": "-23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24350_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006319", "code": "def longest_subsequence_length(arr):\n    if len(arr) == 1:\n        return 1\n    ans = 1\n    sub_len = 1\n    prev = 2\n    for i in range(1, len(arr)):\n        if arr[i] > arr[i - 1] and prev != 0:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        elif arr[i] < arr[i - 1] and prev != 1:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        else:\n            sub_len = 1\n        prev = 0 if arr[i] > arr[i - 1] else 1 if arr[i] < arr[i - 1] else 2\n    return ans\n", "entry_point": "longest_subsequence_length", "input": "[1, 3, 2, 4, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82692_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006320", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[100, 50]", "output": "-50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006321", "code": "from typing import List\ndef determine_output_filename(args: List[str]) -> str:\n    if len(args) == 1:\n        return args[0]\n    else:\n        return 'ts_src/data.ts'\n", "entry_point": "determine_output_filename", "input": "[]", "output": "'ts_src/data.ts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79579_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006322", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[25], 0", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006323", "code": "def file_linear_byte_offset(values, factor, coefficients):\n    total_sum = sum(value * multiplier * coefficient for value, multiplier, coefficient in zip(values, [1] * len(values), coefficients))\n    return total_sum * factor\n", "entry_point": "file_linear_byte_offset", "input": "[600, 240], 1, [1, 3]", "output": "1320", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121000_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6166", "output": "{1, 2, 3083, 6166}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9458", "output": "{4729, 1, 9458, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9457", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9508", "output": "{1, 2, 9508, 4, 2377, 4754}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9507", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1809", "output": "{1, 3, 67, 27, 9, 201, 1809, 603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006328", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.62.0', 123", "output": "'2.62.0.123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006329", "code": "def validate_credentials(username, password):\n    if username == 'admin' and password == 'admin123':\n        return \"Welcome, admin!\"\n    elif username == 'guest' and password == 'guest123':\n        return \"Welcome, guest!\"\n    else:\n        return \"Invalid credentials!\"\n", "entry_point": "validate_credentials", "input": "'unknown', 'wrongpassword'", "output": "'Invalid credentials!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105999_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006330", "code": "from typing import List\ndef calculate_closest_average(hitoffsets: List[float]) -> int:\n    if not hitoffsets:\n        return 0\n    total_sum = sum(hitoffsets)\n    average = total_sum / len(hitoffsets)\n    closest_integer = round(average)\n    return closest_integer\n", "entry_point": "calculate_closest_average", "input": "[2.0, 3.0, 4.0]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35525_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7414", "output": "{1, 2, 674, 11, 337, 7414, 22, 3707}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7413", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006332", "code": "def process_cache_configurations(caches):\n    backend_values = []\n    password_count = 0\n    for cache_name, cache_config in caches.items():\n        backend_values.append(cache_config.get('BACKEND', ''))\n        if 'PASSWORD' in cache_config.get('OPTIONS', {}):\n            password_count += 1\n    return backend_values, password_count\n", "entry_point": "process_cache_configurations", "input": "{}", "output": "([], 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122222_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006333", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5911", "output": "{1, 23, 257, 5911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006334", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'UUUR'", "output": "(1, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1711", "output": "{1, 59, 29, 1711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1710", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006336", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 90, 85, 80, 75, 85]", "output": "[92, 90, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118412_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006337", "code": "from typing import List\ndef min_classrooms(students: List[int]) -> int:\n    classrooms = 0\n    current_students = 0\n    for num_students in students:\n        if current_students + num_students <= 30:\n            current_students += num_students\n        else:\n            classrooms += 1\n            current_students = num_students\n    if current_students > 0:\n        classrooms += 1\n    return classrooms\n", "entry_point": "min_classrooms", "input": "[30, 30, 30, 30, 30, 30, 30, 30]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149205_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006338", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6268", "output": "{1, 2, 4, 6268, 3134, 1567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6267", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006339", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'oloolooo'", "output": "'oloolooo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006340", "code": "def binary_decode(arr):\n    result = 0\n    for i in range(len(arr)):\n        result += arr[i] * 2**(len(arr) - 1 - i)\n    return result\n", "entry_point": "binary_decode", "input": "[1, 0, 1, 0, 0, 0, 1, 1]", "output": "163", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27590_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006341", "code": "def longest_increasing_subsequence_length(nums):\n    if not nums:\n        return 0\n    dp = [1] * len(nums)\n    for i in range(1, len(nums)):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence_length", "input": "[10, 1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006342", "code": "def find_min_positive_constant(constants):\n    min_positive = None\n    for constant in constants:\n        if constant > 0 and (min_positive is None or constant < min_positive):\n            min_positive = constant\n    return min_positive\n", "entry_point": "find_min_positive_constant", "input": "[0.01, 1.0, 2.0, -3.0, 0.0]", "output": "0.01", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115319_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006343", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "6", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006344", "code": "def calculate_final_time(b, max_var_fixed):\n    final_best_time = 0\n    for max_b, variable, fixed in max_var_fixed:\n        passed_bits = min(b, max_b)\n        b -= passed_bits\n        final_best_time += fixed + variable * passed_bits\n        if not b:\n            return final_best_time\n    return final_best_time\n", "entry_point": "calculate_final_time", "input": "8, [(5, 2, 1), (3, 3, 1)]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41267_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006345", "code": "def grouped(n, iterable, fillvalue=None):\n    groups = []\n    it = iter(iterable)\n    while True:\n        group = tuple(next(it, fillvalue) for _ in range(n))\n        if group == (fillvalue,) * n:\n            break\n        groups.append(group)\n    return groups\n", "entry_point": "grouped", "input": "3, []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32257_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006346", "code": "from typing import List\ndef calculate_closest_average(hitoffsets: List[float]) -> int:\n    if not hitoffsets:\n        return 0\n    total_sum = sum(hitoffsets)\n    average = total_sum / len(hitoffsets)\n    closest_integer = round(average)\n    return closest_integer\n", "entry_point": "calculate_closest_average", "input": "[1.5, 2.5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35525_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006347", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[5, 3, 8]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006348", "code": "def card_war_winner(player1_cards, player2_cards):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_score = sum(card_values[card] for card in player1_cards)\n    player2_score = sum(card_values[card] for card in player2_cards)\n    if player1_score > player2_score:\n        return \"Player 1\"\n    elif player2_score > player1_score:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "card_war_winner", "input": "['A', 'K'], ['5', '3']", "output": "'Player 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138984_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006349", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[90, 90, 82, 78], 3", "output": "87.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111793_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006350", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for num1, num2 in zip(arr1, arr2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0, 10, 15, 20], [5, 0, 10, 25]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20129_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006351", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "' **I** '", "output": "'I'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006352", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7507", "output": "{1, 7507}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006353", "code": "MIN_GENES_TO_USE_CACHING_GENE_MATCHER = 10\ndef use_caching_gene_matcher(num_genes_to_match):\n    if num_genes_to_match > MIN_GENES_TO_USE_CACHING_GENE_MATCHER:\n        return True\n    else:\n        return False\n", "entry_point": "use_caching_gene_matcher", "input": "10", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19770_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006354", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[3, 2, 2, 2, 2, 1, 1, 1, 5]", "output": "{3: 1, 2: 4, 1: 3, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006355", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "14", "output": "'14'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006356", "code": "def compareTriplets(a, b):\n    score_a = 0\n    score_b = 0\n    for i in range(3):\n        if a[i] > b[i]:\n            score_a += 1\n        elif a[i] < b[i]:\n            score_b += 1\n    return [score_a, score_b]\n", "entry_point": "compareTriplets", "input": "[3, 2, 5], [2, 3, 5]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134718_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006357", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'opoione2prpe'", "output": "('opoione2prpe', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006358", "code": "def classify_location(beacon1, beacon2, beacon3):\n    signal_sum = beacon1 + beacon2 + beacon3\n    if signal_sum < 10:\n        return 'Location A'\n    elif 10 <= signal_sum <= 20:\n        return 'Location B'\n    else:\n        return 'Location C'\n", "entry_point": "classify_location", "input": "10, 10, 2", "output": "'Location C'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78948_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006359", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'pppp a'", "output": "['p']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006360", "code": "def find_longest_sequence(dice_rolls):\n    if not dice_rolls:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(dice_rolls)):\n        if dice_rolls[i] == dice_rolls[i - 1] + 1:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "find_longest_sequence", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10121_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006361", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[6, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006362", "code": "import os\ndef count_files_and_directories(path: str) -> tuple:\n    file_count = 0\n    dir_count = 0\n    if os.path.isdir(path):\n        for item in os.listdir(path):\n            item_path = os.path.join(path, item)\n            if os.path.isfile(item_path):\n                file_count += 1\n            elif os.path.isdir(item_path):\n                dir_count += 1\n                sub_file_count, sub_dir_count = count_files_and_directories(item_path)\n                file_count += sub_file_count\n                dir_count += sub_dir_count\n    return file_count, dir_count\n", "entry_point": "count_files_and_directories", "input": "'/path/to/nonexistent/directory'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119107_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006363", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[94, 93, 92, 90]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135338_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006364", "code": "def parse_config_settings(code_snippet):\n    settings = {}\n    for line in code_snippet.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            key = key.strip()\n            value = value.strip().strip(\"'\").strip('\"')\n            if key in ['project', 'copyright', 'version', 'release']:\n                settings[key] = value\n            elif key == 'exclude_patterns':\n                settings[key] = [pattern.strip() for pattern in value.strip('[]').split(',')]\n    return settings\n", "entry_point": "parse_config_settings", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147112_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006365", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 3, 4, 4, 3, 3]", "output": "[1, 4, 8, 12, 15, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006366", "code": "def longest_subsequence_length(arr):\n    if len(arr) == 1:\n        return 1\n    ans = 1\n    sub_len = 1\n    prev = 2\n    for i in range(1, len(arr)):\n        if arr[i] > arr[i - 1] and prev != 0:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        elif arr[i] < arr[i - 1] and prev != 1:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        else:\n            sub_len = 1\n        prev = 0 if arr[i] > arr[i - 1] else 1 if arr[i] < arr[i - 1] else 2\n    return ans\n", "entry_point": "longest_subsequence_length", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82692_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006367", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    # Sort the dictionary by values in descending order\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "word_frequency", "input": "'world'", "output": "{'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86121_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006368", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'jane', 'mdoesmdoe'", "output": "'jmdoesmdoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006369", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(3, 5, 4, 0, 0, 0, 0)", "output": "(0, 5, 4, 0, 0, 0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006370", "code": "def eval_levicivita(*args):\n    if len(args) < 2:\n        return 0\n    elif len(args) % 2 == 0:\n        return 1  # Initialize result as 1 for multiplication\n        for arg in args:\n            result *= arg\n    else:\n        return sum(args)\n", "entry_point": "eval_levicivita", "input": "1, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73882_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006371", "code": "def zellerAlgorithm(year, month, day):\n    if month in [1, 2]:\n        y1 = year - 1\n        m1 = month + 12\n    else:\n        y1 = year\n        m1 = month\n    y2 = y1 % 100\n    c = y1 // 100\n    day_of_week = (day + (13 * (m1 + 1)) // 5 + y2 + y2 // 4 + c // 4 - 2 * c) % 7\n    return day_of_week\n", "entry_point": "zellerAlgorithm", "input": "2020, 2, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86862_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006372", "code": "from typing import List, Tuple\ndef generate_test_summary(tests: List[bool]) -> Tuple[int, int, int, float]:\n    total_tests = len(tests)\n    passed_tests = sum(tests)\n    failed_tests = total_tests - passed_tests\n    success_rate = (passed_tests / total_tests) * 100 if total_tests > 0 else 0.0\n    return total_tests, passed_tests, failed_tests, success_rate\n", "entry_point": "generate_test_summary", "input": "[True, True, True, True, True, False, False]", "output": "(7, 5, 2, 71.42857142857143)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108687_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006373", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'10.2.8'", "output": "'10.2.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006374", "code": "# Define dictionaries for section types and flags\nsection_types = {\n    0: 'SHT_NULL', 1: 'SHT_PROGBITS', 2: 'SHT_SYMTAB', 3: 'SHT_STRTAB',\n    4: 'SHT_RELA', 6: 'SHT_DYNAMIC', 8: 'SHT_NOBITS', 9: 'SHT_REL', 11: 'SHT_DYNSYM'\n}\nsection_flags = {\n    1<<0: 'SHF_WRITE', 1<<1: 'SHF_ALLOC', 1<<2: 'SHF_EXECINSTR',\n    1<<4: 'SHF_MERGE', 1<<5: 'SHF_STRINGS'\n}\ndef get_section_attributes(section_index):\n    if section_index in section_types:\n        section_type = section_types[section_index]\n        flags = [section_flags[flag] for flag in section_flags if flag & section_index]\n        return f\"Section {section_index} is of type {section_type} and has flags {' '.join(flags)}\"\n    else:\n        return \"Invalid section index.\"\n", "entry_point": "get_section_attributes", "input": "5", "output": "'Invalid section index.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136296_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006375", "code": "def minimum_swaps(arr):\n    a = dict(enumerate(arr, 1))\n    b = {v: k for k, v in a.items()}\n    count = 0\n    for i in a:\n        x = a[i]\n        if x != i:\n            y = b[i]\n            a[y] = x\n            b[x] = y\n            count += 1\n    return count\n", "entry_point": "minimum_swaps", "input": "[2, 3, 4, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125007_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006376", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 12, 9, 10]", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6779_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006377", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[6, 7, 7, -1, -5]", "output": "6.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006378", "code": "def calculate_dot_product(vector1, vector2):\n    min_len = min(len(vector1), len(vector2))\n    dot_product_result = sum(vector1[i] * vector2[i] for i in range(min_len))\n    return dot_product_result\n", "entry_point": "calculate_dot_product", "input": "[0, 0, 0], [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135589_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006379", "code": "from typing import List, Tuple\nfrom math import sqrt\ndef max_distance(points: List[Tuple[int, int]]) -> float:\n    max_dist = 0\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            max_dist = max(max_dist, distance)\n    return round(max_dist, 2)\n", "entry_point": "max_distance", "input": "[(0, 0), (5, 5)]", "output": "7.07", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39213_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006380", "code": "from datetime import datetime\ndef utc_to_unix_timestamp(iso_timestamp: str) -> int:\n    # Parse the input UTC timestamp string into a datetime object\n    dt_utc = datetime.fromisoformat(iso_timestamp.replace(\"Z\", \"+00:00\"))\n    # Calculate the Unix timestamp by converting datetime object to timestamp\n    unix_timestamp = int(dt_utc.timestamp())\n    return unix_timestamp\n", "entry_point": "utc_to_unix_timestamp", "input": "'2022-12-31T23:59:59Z'", "output": "1672531199", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119762_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006381", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 7, 2]", "output": "[3, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006382", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2762", "output": "{1, 2762, 2, 1381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006383", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "0", "output": "'Unknown Command'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006384", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study1234_study12.txt'", "output": "(1234, 'study12')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006385", "code": "def max_score_subset(scores):\n    scores.sort()\n    prev_score = prev_count = curr_score = curr_count = max_sum = 0\n    for score in scores:\n        if score == curr_score:\n            curr_count += 1\n        elif score == curr_score + 1:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        else:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        if prev_score == score - 1:\n            max_sum = max(max_sum, prev_count * prev_score + curr_count * curr_score)\n        else:\n            max_sum = max(max_sum, curr_count * curr_score)\n    return max_sum\n", "entry_point": "max_score_subset", "input": "[4, 4, 4]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103662_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006386", "code": "import importlib\ndef execute_function_from_module(module_name, function_name, *args, **kwargs):\n    try:\n        module = importlib.import_module(module_name)\n        function = getattr(module, function_name)\n        return function(*args, **kwargs)\n    except ModuleNotFoundError:\n        return f\"Module '{module_name}' not found.\"\n    except AttributeError:\n        return f\"Function '{function_name}' not found in module '{module_name}'.\"\n", "entry_point": "execute_function_from_module", "input": "'omao', 'any_function'", "output": "\"Module 'omao' not found.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133564_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006387", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4607", "output": "{1, 271, 17, 4607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006388", "code": "def euclid_algorithm(area):\n    \"\"\"Return the largest square to subdivide area by.\"\"\"\n    height = area[0]\n    width = area[1]\n    maxdim = max(height, width)\n    mindim = min(height, width)\n    remainder = maxdim % mindim\n    if remainder == 0:\n        return mindim\n    else:\n        return euclid_algorithm((mindim, remainder))\n", "entry_point": "euclid_algorithm", "input": "(160, 80)", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64166_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006389", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'pthon'", "output": "{'pthon': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006390", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "0", "output": "'     0 B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006391", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "12", "output": "338688", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006392", "code": "try:\n    _xrange = xrange\nexcept NameError:\n    _xrange = range  # Python 3 compatibility\ndef sum_of_evens(start, end):\n    sum_even = 0\n    for num in _xrange(start, end+1):\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_evens", "input": "2, 12", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141776_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006393", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[0, 0, 0, 0, 0, 1, 1, -1]", "output": "{0: 5, 1: 2, -1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006394", "code": "def process_command(input_str):\n    x = input_str.split(' ')\n    com = x[0]\n    rest = x[1:]\n    return (com, rest)\n", "entry_point": "process_command", "input": "'gumegnargumencsts'", "output": "('gumegnargumencsts', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93382_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006395", "code": "import re\nRE_NUMBER_VALIDATOR = re.compile(r'^\\d+[.,]\\d+$')\ndef validate_number_format(number: str) -> bool:\n    return bool(RE_NUMBER_VALIDATOR.match(number))\n", "entry_point": "validate_number_format", "input": "'12.34'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18098_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006396", "code": "def diagnose(data):\n    char_counts = {}\n    for char in data:\n        if char in char_counts:\n            char_counts[char] += 1\n        else:\n            char_counts[char] = 1\n    return char_counts\n", "entry_point": "diagnose", "input": "'hle'", "output": "{'h': 1, 'l': 1, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98386_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006397", "code": "def calculate_average_grade(grades):\n    grade_values = {'A': 95, 'B': 85, 'C': 75, 'D': 65, 'F': 30}  # Mapping of grades to numerical values\n    total_grade = sum(grade_values.get(grade, 0) for grade in grades)\n    average_grade = total_grade / len(grades)\n    if 90 <= average_grade <= 100:\n        letter_grade = 'A'\n    elif 80 <= average_grade < 90:\n        letter_grade = 'B'\n    elif 70 <= average_grade < 80:\n        letter_grade = 'C'\n    elif 60 <= average_grade < 70:\n        letter_grade = 'D'\n    else:\n        letter_grade = 'F'\n    return average_grade, letter_grade\n", "entry_point": "calculate_average_grade", "input": "['F', 'F', 'F', 'F']", "output": "(30.0, 'F')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101290_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006398", "code": "def find_latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_version = tuple(map(int, latest_version.split('.')))\n            new_version = tuple(map(int, version.split('.')))\n            if new_version > current_version:\n                latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.1', '2.2.0', '2.1.9', '2.2.1']", "output": "'2.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92338_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006399", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[0, 0, 0], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006400", "code": "def calculate_salutes(hallway: str) -> int:\n    crosses = 0\n    right_count = 0\n    for char in hallway:\n        if char == \">\":\n            right_count += 1\n        elif char == \"<\":\n            crosses += right_count * 2\n    return crosses\n", "entry_point": "calculate_salutes", "input": "'> <'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117936_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006401", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "63, 31", "output": "916312070471295232", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006402", "code": "def find_largest_probability_cell(p):\n    max_prob = float('-inf')\n    max_row, max_col = -1, -1\n    for r, row in enumerate(p):\n        for c, val in enumerate(row):\n            if val > max_prob:\n                max_prob = val\n                max_row, max_col = r, c\n    return max_row, max_col\n", "entry_point": "find_largest_probability_cell", "input": "[]", "output": "(-1, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85296_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006403", "code": "from typing import List\ndef fast_moving_average(data: List[float], num_intervals: int) -> List[float]:\n    if len(data) < num_intervals:\n        return []\n    interval_size = len(data) // num_intervals\n    moving_avg = []\n    for i in range(num_intervals):\n        start = i * interval_size\n        end = start + interval_size if i < num_intervals - 1 else len(data)\n        interval_data = data[start:end]\n        avg = sum(interval_data) / len(interval_data) if interval_data else 0\n        moving_avg.append(avg)\n    return moving_avg\n", "entry_point": "fast_moving_average", "input": "[1.0, 2.0], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98561_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006404", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 4, 4, 7, 7, 7, 2]", "output": "[2, 4, 4, 7, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006405", "code": "from typing import List, Dict, Union\ndef filter_hints(hints: List[Dict[str, Union[str, int]]], threshold: int) -> List[str]:\n    filtered_messages = []\n    for hint in hints:\n        if hint.get(\"level\", 0) >= threshold:\n            filtered_messages.append(hint.get(\"message\", \"\"))\n    return filtered_messages\n", "entry_point": "filter_hints", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63674_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006406", "code": "def calculate_gpu_memory_usage(processes):\n    max_memory_usage = max(processes)\n    total_memory_usage = sum(processes)\n    return max_memory_usage, total_memory_usage\n", "entry_point": "calculate_gpu_memory_usage", "input": "[1024, 999, 920]", "output": "(1024, 2943)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48951_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006407", "code": "import re\ndef lexer(text):\n    tokens = []\n    rules = [\n        (r'if|else|while|for', 'keyword'),\n        (r'[a-zA-Z][a-zA-Z0-9]*', 'identifier'),\n        (r'\\d+', 'number'),\n        (r'[+\\-*/]', 'operator')\n    ]\n    for rule in rules:\n        pattern, token_type = rule\n        for token in re.findall(pattern, text):\n            tokens.append((token, token_type))\n    return tokens\n", "entry_point": "lexer", "input": "'5'", "output": "[('5', 'number')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24727_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4571", "output": "{1, 4571, 653, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006409", "code": "def getFirstSetBit(n):\n    pos = 1\n    while n > 0:\n        if n & 1 == 1:\n            return pos\n        n = n >> 1\n        pos += 1\n    return 0\n", "entry_point": "getFirstSetBit", "input": "8", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107353_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006410", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[1, 4, 1]", "output": "[5, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1626", "output": "{1, 2, 3, 6, 813, 271, 1626, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1625", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006412", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_score = sorted_scores[N-1]\n    count_top_score = sorted_scores.count(top_score)\n    sum_top_scores = sum(sorted_scores[:sorted_scores.index(top_score) + count_top_score])\n    average = sum_top_scores / count_top_score\n    return average\n", "entry_point": "calculate_top_players_average", "input": "[180, 182, 182], 2", "output": "182.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54118_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006413", "code": "from typing import List\ndef reconstruct_sequence(counts: List[int]) -> List[int]:\n    sequence = []\n    for i in range(len(counts)):\n        sequence.extend([i+1] * counts[i])\n    return sequence\n", "entry_point": "reconstruct_sequence", "input": "[1, 3, 1, 1, 2, 1]", "output": "[1, 2, 2, 2, 3, 4, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4314_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006414", "code": "import re\ndef count_word_frequencies(input_list):\n    word_freq = {}\n    for word in input_list:\n        cleaned_word = re.sub(r'[^a-zA-Z0-9]', '', word).lower()\n        if cleaned_word in word_freq:\n            word_freq[cleaned_word] += 1\n        else:\n            word_freq[cleaned_word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "['cheapplerry', 'cheapplerry']", "output": "{'cheapplerry': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27713_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006415", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "6", "output": "[1, 3, 5, 7, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006416", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3089", "output": "{1, 3089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006417", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[210]", "output": "2520", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006418", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9487", "output": "{1, 179, 53, 9487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006419", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[86, 86, 85, 86, 85]", "output": "85.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006420", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[0, 1, 3, 4, 4, 5, 6, 6], 8", "output": "[0, 1, 3, 4, 4, 5, 6, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3027", "output": "{3, 1, 3027, 1009}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3026", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006422", "code": "from typing import List\ndef sum_with_next(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst) - 1):\n        result.append(lst[i] + lst[i + 1])\n    result.append(lst[-1] + lst[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 5, 0, 6, 2, 3, -1, 4]", "output": "[6, 5, 6, 8, 5, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111975_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006423", "code": "def validate_window_config(window_type, window_offset, window_size):\n    def check_greater_than_value(value, param_name, threshold):\n        if value < threshold:\n            raise ValueError(f\"{param_name} must be greater than or equal to {threshold}\")\n    window_type = window_type.lower()\n    if window_type == \"scroll\":\n        check_greater_than_value(window_offset, \"window_offset\", 0)\n    elif window_type in [\"slide\", \"accumulate\"]:\n        check_greater_than_value(window_offset, \"window_offset\", 0)\n        check_greater_than_value(window_size, \"window_size\", 0)\n    return \"Window configuration is valid.\"\n", "entry_point": "validate_window_config", "input": "'scroll', 0, 0", "output": "'Window configuration is valid.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23254_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006424", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'WWdlWHrld'", "output": "'XXemXIsme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "892", "output": "{1, 2, 4, 892, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt891", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006426", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'0.9.9'", "output": "'1.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006427", "code": "import os\ndef change_file_permissions(file_path, permission_mode):\n    if not os.path.exists(file_path):\n        return \"File not found.\"\n    os.chmod(file_path, permission_mode)\n    return f\"File permissions changed successfully for file: {file_path}\"\n", "entry_point": "change_file_permissions", "input": "'/invalid/path/to/nonexistent/file.txt', 493", "output": "'File not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19897_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006428", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[0, 8]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2950_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006429", "code": "import math\ndef sum_of_primes(n: int) -> int:\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, n + 1, i):\n                is_prime[j] = False\n    return sum(i for i in range(2, n + 1) if is_prime[i])\n", "entry_point": "sum_of_primes", "input": "20", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79663_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006430", "code": "def format_version(version: tuple) -> str:\n    if len(version) == 3:\n        return f\"v{version[0]}.{version[1]}.{version[2]}\"\n    elif len(version) == 2:\n        return f\"v{version[0]}.{version[1]}.0\"\n    elif len(version) == 1:\n        return f\"v{version[0]}.0.0\"\n", "entry_point": "format_version", "input": "(2, 5)", "output": "'v2.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103483_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006431", "code": "from typing import List\ndef longest_subarray(arr: List[int], target: int) -> int:\n    start = 0\n    end = 0\n    curr_sum = 0\n    max_length = 0\n    while end < len(arr):\n        curr_sum += arr[end]\n        while curr_sum > target:\n            curr_sum -= arr[start]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_subarray", "input": "[1, 2, 3, 4, 5], 15", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40443_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006432", "code": "def distance_to_camera(knownWidth, focalLength, perWidth):\n    # Compute and return the distance from the object to the camera\n    return (knownWidth * focalLength) / perWidth\n", "entry_point": "distance_to_camera", "input": "200, 195.39772727272728, 100", "output": "390.79545454545456", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71888_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006433", "code": "from typing import List\ndef longest_subarray(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray", "input": "[1, 1, 1, 1, 1, 1, 1, 1, 1], 3", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33512_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006434", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[4, 4, 6, 4, 5, 1, 3, 7]", "output": "[4, 4, 6, 4, 5, 1, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006435", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[2, 2]", "output": "('Rel Days 2 to 2', 'reldays2_2')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006436", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "126, 10, 5", "output": "145", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006437", "code": "from typing import List\ndef modified_binary_search(arr: List[int], target: int) -> int:\n    low, high = 0, len(arr) - 1\n    result = -1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            result = mid\n            high = mid - 1\n    return result\n", "entry_point": "modified_binary_search", "input": "[1, 2, 3], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97045_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006438", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 200, 300, 400]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006439", "code": "def secondLongestWord(sentence):\n    wordArray = sentence.split(\" \")\n    longest = \"\"\n    secondLongest = \"\"\n    for word in wordArray:\n        if len(word) >= len(longest):\n            secondLongest = longest\n            longest = word\n        elif len(word) > len(secondLongest):\n            secondLongest = word\n    return secondLongest\n", "entry_point": "secondLongestWord", "input": "'the quick brown fox quickly'", "output": "'brown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116541_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006440", "code": "from datetime import datetime, timedelta\ndef generate_dates(start_date, num_days):\n    dates_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days + 1):\n        dates_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return dates_list\n", "entry_point": "generate_dates", "input": "'2018-09-30', 2", "output": "['2018-09-30', '2018-10-01', '2018-10-02']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127239_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006441", "code": "def minimum_edit_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + 2)\n    return dp[m][n]\n", "entry_point": "minimum_edit_distance", "input": "'abcdef', 'azced'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_695_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006442", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4421", "output": "{1, 4421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4541", "output": "{1, 19, 4541, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006444", "code": "import re\ndef extract_sensitive_info(code_snippet):\n    sensitive_info = []\n    # Define regex patterns for passwords, salts, and email addresses\n    password_pattern = r\"'(.*?)'\"\n    salt_pattern = r'\"(.*?)\"'\n    email_pattern = r'<(.*?)>'\n    # Compile regex patterns\n    password_regex = re.compile(password_pattern)\n    salt_regex = re.compile(salt_pattern)\n    email_regex = re.compile(email_pattern)\n    # Search for sensitive information in the code snippet\n    sensitive_info.extend(password_regex.findall(code_snippet))\n    sensitive_info.extend(salt_regex.findall(code_snippet))\n    sensitive_info.extend(email_regex.findall(code_snippet))\n    return sensitive_info\n", "entry_point": "extract_sensitive_info", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22951_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006445", "code": "def parse_arguments(args):\n    parsed_options = {}\n    key = None\n    for arg in args:\n        if arg.startswith('-'):\n            key = arg.lstrip('-')\n        else:\n            if key:\n                parsed_options[key] = arg\n                key = None\n    return parsed_options\n", "entry_point": "parse_arguments", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131336_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006446", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'frareiends.'", "output": "'frareiends.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006447", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[10, 12, 20, 30]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006448", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "2", "output": "'1 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006449", "code": "def getFirstSetBit(n):\n    pos = 1\n    while n > 0:\n        if n & 1 == 1:\n            return pos\n        n = n >> 1\n        pos += 1\n    return 0\n", "entry_point": "getFirstSetBit", "input": "6", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107353_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006450", "code": "rpc_method_handlers = {\n    'api.Repository': lambda: 'Handling Repository API',\n    'api.User': lambda: 'Handling User API'\n}\ndef execute_rpc_handler(api_endpoint: str):\n    if api_endpoint in rpc_method_handlers:\n        return rpc_method_handlers[api_endpoint]()\n    else:\n        return 'Handler not found'\n", "entry_point": "execute_rpc_handler", "input": "'api.FakeEndpoint'", "output": "'Handler not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112368_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006451", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "0, 8", "output": "b'\\x08\\x00\\x00\\x00\\x00\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006452", "code": "import re\ndef count_unique_words(text):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'wawe s.'", "output": "{'wawe': 1, 's': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33729_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006453", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[91, 85, 85, 80, 79]", "output": "[91, 85, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006454", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'Lily'", "output": "'YLIL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006455", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[5, 8]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006456", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'1211.2'", "output": "(1211, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006457", "code": "def exam_grade(score):\n    if score < 0 or score > 100:\n        return \"Invalid Score\"\n    elif score >= 90:\n        return \"Top Score\"\n    elif score >= 60:\n        return \"Pass\"\n    else:\n        return \"Fail\"\n", "entry_point": "exam_grade", "input": "50", "output": "'Fail'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64122_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006458", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6919", "output": "{1, 37, 6919, 11, 17, 629, 407, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006459", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[5, 5, 5, 6, 5, 5]", "output": "5.166666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006460", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "7", "output": "429", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006461", "code": "def longest_consecutive_sequence(nums):\n    if not nums:\n        return 0\n    nums.sort()\n    current_length = 1\n    longest_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] == nums[i - 1] + 1:\n            current_length += 1\n            longest_length = max(longest_length, current_length)\n        else:\n            current_length = 1\n    return longest_length\n", "entry_point": "longest_consecutive_sequence", "input": "[1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45770_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006462", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4804", "output": "{1, 2, 2402, 4804, 4, 1201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4803", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006463", "code": "def custom_convert(st):\n    # Reverse the input string\n    reversed_st = st[::-1]\n    # Apply the character replacements\n    modified_st = reversed_st.replace('o', 'u').replace('a', 'o')\n    return modified_st\n", "entry_point": "custom_convert", "input": "'banana'", "output": "'ononob'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96668_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006464", "code": "def fairRations(arr):\n    total_loaves = 0\n    for i in range(len(arr) - 1):\n        if arr[i] % 2 != 0:\n            arr[i] += 1\n            arr[i + 1] += 1\n            total_loaves += 2\n    if arr[-1] % 2 != 0:\n        return 'NO'\n    else:\n        return total_loaves\n", "entry_point": "fairRations", "input": "[1, 1, 1, 1, 1, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50701_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006465", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 3, 2, 7, 8, 1, 2, 3]", "output": "[3, 4, 4, 10, 12, 6, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006466", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "40, 8", "output": "76904685", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006467", "code": "def calculate_last_element(t, n):\n    for i in range(2, n):\n        t.append(t[i-2] + t[i-1]*t[i-1])\n    return t[-1]\n", "entry_point": "calculate_last_element", "input": "[2, 2], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120049_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006468", "code": "def basic_calculator(num1, num2, operation):\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Error: Division by zero\"\n    else:\n        return \"Error: Invalid operation\"\n", "entry_point": "basic_calculator", "input": "1.0, 1.0, '+'", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006469", "code": "from typing import List\ndef determine_highest_bid(bids: List[float], base_value: float) -> float:\n    highest_bid = -1\n    for bid in bids:\n        if bid > base_value and bid > highest_bid:\n            highest_bid = bid\n    return highest_bid\n", "entry_point": "determine_highest_bid", "input": "[150.0], 100.0", "output": "150.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114737_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006470", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5326", "output": "{1, 2, 5326, 2663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5325", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006471", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "125", "output": "'ossg.default.125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006472", "code": "import re\ndef process_text(input_text: str) -> str:\n    # Remove all characters that are not Cyrillic or alphanumeric\n    processed_text = re.sub(r\"[^\u0430-\u044f\u0410-\u042f0-9 ]+\", \"\", input_text)\n    # Replace double spaces with a single space\n    processed_text = re.sub('(  )', ' ', processed_text)\n    # Replace \"\\r\\n\" with a space\n    processed_text = processed_text.replace(\"\\r\\n\", \" \")\n    return processed_text\n", "entry_point": "process_text", "input": "'~\u041f\u0440\u0438\u0432\u0438\u0438@!'", "output": "'\u041f\u0440\u0438\u0432\u0438\u0438'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100805_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006473", "code": "def replace_placeholders(input_string, placeholders):\n    for placeholder, value in placeholders.items():\n        input_string = input_string.replace(placeholder, value)\n    return input_string\n", "entry_point": "replace_placeholders", "input": "'{left}{right}', {'{left}': 'l', '{right}': 's'}", "output": "'ls'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84770_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006474", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    round_num = 1\n    while player1_deck and player2_deck:\n        player1_card = player1_deck.pop(0)\n        player2_card = player2_deck.pop(0)\n        if player1_card > player2_card:\n            player1_score += 1\n        elif player2_card > player1_card:\n            player2_score += 1\n        round_num += 1\n    if player1_score > player2_score:\n        return \"Player 1 wins the game!\"\n    elif player2_score > player1_score:\n        return \"Player 2 wins the game!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3], [1, 2, 3]", "output": "\"It's a tie!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16584_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006475", "code": "def replace_last_occurrence(path, to_replace, replacement):\n    # Find the index of the last occurrence of 'to_replace' in 'path'\n    last_index = path.rfind(to_replace)\n    if last_index == -1:\n        return path  # If 'to_replace' not found, return the original path\n    # Split the path into two parts based on the last occurrence of 'to_replace'\n    path_before = path[:last_index]\n    path_after = path[last_index + len(to_replace):]\n    # Replace the last occurrence of 'to_replace' with 'replacement'\n    modified_path = path_before + replacement + path_after\n    return modified_path\n", "entry_point": "replace_last_occurrence", "input": "'/home/user//ifl/hxt', 'user', 'use'", "output": "'/home/use//ifl/hxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140432_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006476", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "-10485740, 0", "output": "-10485740", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006477", "code": "from urllib.parse import urlparse, parse_qs\ndef parse_query_params(url: str) -> str:\n    parsed_url = urlparse(url)\n    query_params = parse_qs(parsed_url.query)\n    if 'tag' in query_params:\n        tags = query_params['tag']\n        return ','.join(tags)\n    return \"\"\n", "entry_point": "parse_query_params", "input": "'http://example.com'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51641_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006478", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[1, 0, 0, 0, 1, 4, 1, 3, 0]", "output": "[0, 3, 1, 4, 1, 0, 0, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4947", "output": "{1, 97, 3, 291, 17, 1649, 4947, 51}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006480", "code": "def calculate_total_time(jobs):\n    total_time = 0\n    for duration in jobs:\n        total_time += duration\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 4]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84145_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006481", "code": "import os\nimport ast\ndef extract_required_packages(code_snippet):\n    # Parse the code snippet to extract the relevant information\n    code_ast = ast.parse(code_snippet)\n    for node in ast.walk(code_ast):\n        if isinstance(node, ast.Assign) and len(node.targets) == 1:\n            target = node.targets[0]\n            if isinstance(target, ast.Name) and target.id == 'INSTALL_REQUIRES':\n                if isinstance(node.value, ast.List):\n                    required_packages = [elem.s for elem in node.value.elts]\n                    return required_packages\n                elif isinstance(node.value, ast.Name) and node.value.id == '[]':\n                    return []\n    return None  # Return None if required packages are not found\n", "entry_point": "extract_required_packages", "input": "'INSTALL_REQUIRES = []'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77927_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006482", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabcbc'", "output": "'a3b1c1b1c1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144981_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006483", "code": "def determine_winner(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    if player1_score > player2_score:\n        return 1\n    elif player2_score > player1_score:\n        return 2\n    else:\n        return 0\n", "entry_point": "determine_winner", "input": "[1, 2, 3], [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137063_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006484", "code": "def calculate_score(cards):\n    total_score = 0\n    ace_count = 0\n    for card in cards:\n        if card in ['J', 'Q', 'K']:\n            total_score += 10\n        elif card == 'A':\n            ace_count += 1\n        else:\n            total_score += card\n    for _ in range(ace_count):\n        if total_score + 11 <= 21:\n            total_score += 11\n        else:\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "[10, 9]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116780_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006485", "code": "def generate_review_urls(prof_id, course_name, review_id=None, vote=None):\n    base_url = '/reviews/'\n    if review_id:\n        return f'{base_url}{review_id}/{prof_id}/{course_name}'\n    elif vote:\n        return f'{base_url}{review_id}/{vote}/{prof_id}/{course_name}'\n    else:\n        return f'{base_url}{prof_id}/{course_name}'\n", "entry_point": "generate_review_urls", "input": "123, 'math101', review_id=456", "output": "'/reviews/456/123/math101'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129147_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006486", "code": "def find_highest_score(student_scores):\n    highest_score = 0\n    for score in student_scores:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[85, 90, 92]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8042_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006487", "code": "def prepare_argument(arg, num):\n    if isinstance(arg, float):\n        return [arg] * num\n    try:\n        evaluated_arg = eval(arg)\n        if isinstance(evaluated_arg, list):\n            return evaluated_arg\n    except:\n        pass\n    return [arg] * num\n", "entry_point": "prepare_argument", "input": "'[[1, 2,hel1,', 1", "output": "['[[1, 2,hel1,']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81072_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006488", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[3, 5, -1, 6, 2, 0, 0, 0]", "output": "[3, 5, -1, 6, 2, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006489", "code": "def repeat(character: str, counter: int) -> str:\n    \"\"\"Repeat returns character repeated `counter` times.\"\"\"\n    word = \"\"\n    for _ in range(counter):\n        word += character\n    return word\n", "entry_point": "repeat", "input": "'a', 0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60016_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006490", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'my_dag', '0 1 * * *'", "output": "'my_dag_0_1_*_*_*'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006491", "code": "def count_set_bits(num):\n    count = 0\n    while num:\n        count += num & 1\n        num >>= 1\n    return count\n", "entry_point": "count_set_bits", "input": "11", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139196_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006492", "code": "def evaluate_expression(operand1, operator, operand2):\n    if operator == '==':\n        return operand1 == operand2\n    elif operator == '!=':\n        return operand1 != operand2\n    elif operator == '<':\n        return operand1 < operand2\n    elif operator == '<=':\n        return operand1 <= operand2\n    elif operator == '>':\n        return operand1 > operand2\n    elif operator == '>=':\n        return operand1 >= operand2\n    elif operator == 'is':\n        return operand1 is operand2\n    elif operator == 'is not':\n        return operand1 is not operand2\n    elif operator == 'in':\n        return operand1 in operand2\n    elif operator == 'not in':\n        return operand1 not in operand2\n    else:\n        raise ValueError(\"Invalid operator\")\n", "entry_point": "evaluate_expression", "input": "1, '==', 1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121990_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006493", "code": "def extract_info(script):\n    version = None\n    url = None\n    lines = script.split('\\n')\n    for line in lines:\n        if line.startswith(\"__version__\"):\n            version = line.split(\"=\")[1].strip().strip('\"')\n        elif line.startswith(\"__url__\"):\n            url = line.split(\"=\")[1].strip().strip('\"')\n    return {\"version\": version, \"url\": url}\n", "entry_point": "extract_info", "input": "''", "output": "{'version': None, 'url': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42733_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006494", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "5, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006495", "code": "MAX_NUM_VERTICES = 2**32\nDEFAULT_MESH_COLOR = 180\ndef generate_mesh_colors(num_vertices, colors=None):\n    mesh_colors = {}\n    if colors is None:\n        colors = [DEFAULT_MESH_COLOR] * num_vertices\n    else:\n        colors += [DEFAULT_MESH_COLOR] * (num_vertices - len(colors))\n    for i, color in enumerate(colors):\n        mesh_colors[i] = color\n    return mesh_colors\n", "entry_point": "generate_mesh_colors", "input": "4, [199, 150, 254, 257]", "output": "{0: 199, 1: 150, 2: 254, 3: 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117119_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006496", "code": "def sum_multiples_of_3_or_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 9, 15]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69053_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006497", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "10, 3", "output": "1000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006498", "code": "def generate_pascals_triangle(num_rows):\n    triangle = []\n    for row in range(num_rows):\n        current_row = []\n        for col in range(row + 1):\n            if col == 0 or col == row:\n                current_row.append(1)\n            else:\n                current_row.append(triangle[row - 1][col - 1] + triangle[row - 1][col])\n        triangle.append(current_row)\n    return triangle\n", "entry_point": "generate_pascals_triangle", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110086_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006499", "code": "def sum_greater_than_average(arr):\n    if not arr:\n        return 0\n    avg = sum(arr) / len(arr)\n    filtered_elements = [num for num in arr if num > avg]\n    return sum(filtered_elements)\n", "entry_point": "sum_greater_than_average", "input": "[1, 2, 3, 6, 12]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30094_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006500", "code": "def get_file_ext_from_url(url: str) -> str:\n    file_name_start = url.rfind('/') + 1\n    file_name_end = url.rfind('?') if '?' in url else len(url)\n    file_name = url[file_name_start:file_name_end]\n    dot_index = file_name.rfind('.')\n    if dot_index != -1:\n        return file_name[dot_index:]\n    else:\n        return ''\n", "entry_point": "get_file_ext_from_url", "input": "'http://example.com/path/to/file.chmsut'", "output": "'.chmsut'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_292_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006501", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'88d8c050d3eca8d8885a', '<PASSWORD>'", "output": "'88d8c050d3eca8d8885a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006502", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'d09db10'", "output": "'d09db10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006503", "code": "def extract_major_version(version: str) -> int:\n    try:\n        major_version = int(version.split('.')[0])\n        return major_version\n    except (ValueError, IndexError):\n        return -1\n", "entry_point": "extract_major_version", "input": "'391.0'", "output": "391", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140809_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006504", "code": "import re\nre_date = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])$')\nre_time = re.compile(r'^([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?$')\nre_datetime = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])(\\D?([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?([zZ])?)?$')\nre_decimal = re.compile('^(\\d+)\\.(\\d+)$')\ndef validate_data_format(input_string: str) -> str:\n    if re.match(re_date, input_string):\n        return \"date\"\n    elif re.match(re_time, input_string):\n        return \"time\"\n    elif re.match(re_datetime, input_string):\n        return \"datetime\"\n    elif re.match(re_decimal, input_string):\n        return \"decimal\"\n    else:\n        return \"unknown\"\n", "entry_point": "validate_data_format", "input": "'3.14'", "output": "'decimal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67151_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006505", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "6", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006506", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[10, 10, 10, 10, 10, 10]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006507", "code": "from typing import List\ndef remove_and_count(lst: List[int], target: int) -> int:\n    count = 0\n    i = 0\n    while i < len(lst):\n        if lst[i] == target:\n            lst.pop(i)\n            count += 1\n        else:\n            i += 1\n    print(\"Modified list:\", lst)\n    return count\n", "entry_point": "remove_and_count", "input": "[1, 2, 3, 4], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134776_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006508", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[1] + [0] * 25", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006509", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[5, 10, 10]", "output": "500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006510", "code": "from math import sqrt\ndef calculate_rectifying_radius(proj, f):\n    semi_maj = proj[0]\n    semi_min = float(semi_maj * (1 - f))\n    ecc1sq = float(f * (2 - f))\n    ecc2sq = float(ecc1sq / (1 - ecc1sq))\n    ecc1 = sqrt(ecc1sq)\n    n = f / (2 - f)\n    n = float(n)\n    n2 = n ** 2\n    # Rectifying Radius (Horner Form)\n    A = proj[0] / (1 + n) * ((n2 *\n                              (n2 *\n                               (n2 *\n                                (25 * n2 + 64)\n                                + 256)\n                               + 4096)\n                              + 16384)\n                             / 16384.)\n    return A\n", "entry_point": "calculate_rectifying_radius", "input": "(10.0,), 0.5", "output": "7.70982202461009", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57526_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1394", "output": "{1, 2, 34, 41, 17, 1394, 82, 697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1393", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006512", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 1, 4, 3, 2, 6, 1, 4]", "output": "[1, 1, 16, 13, 4, 36, 1, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006513", "code": "def custom_any(seq):\n    for i in seq:\n        if i:\n            return True\n    return False\n", "entry_point": "custom_any", "input": "[0, 1]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41032_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006514", "code": "def parse_test_cases(test_cases):\n    test_dict = {}\n    current_suite = None\n    for line in test_cases.splitlines():\n        if '.' in line or '/' in line:\n            current_suite = line.strip()\n            test_dict[current_suite] = []\n        elif current_suite:\n            test_dict[current_suite].append(line.strip())\n    return test_dict\n", "entry_point": "parse_test_cases", "input": "'ParameterizedTest/0.\\n'", "output": "{'ParameterizedTest/0.': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88834_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006515", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5309", "output": "{1, 5309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006516", "code": "def fibonacci_iterative(num):\n    if num <= 0:\n        return None\n    if num == 1:\n        return 0\n    if num == 2:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, num):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci_iterative", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73606_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006517", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "21", "output": "'XXI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006518", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "44, 2", "output": "946", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt734", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006519", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "5", "output": "'\\t\\t\\t\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006520", "code": "from typing import List, Tuple\ndef generate_test_summary(tests: List[bool]) -> Tuple[int, int, int, float]:\n    total_tests = len(tests)\n    passed_tests = sum(tests)\n    failed_tests = total_tests - passed_tests\n    success_rate = (passed_tests / total_tests) * 100 if total_tests > 0 else 0.0\n    return total_tests, passed_tests, failed_tests, success_rate\n", "entry_point": "generate_test_summary", "input": "[True, True, True, True, True, False]", "output": "(6, 5, 1, 83.33333333333334)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108687_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006521", "code": "def sum_with_next_k(nums, k):\n    result = []\n    for i in range(len(nums) - k + 1):\n        result.append(sum(nums[i:i+k]))\n    return result\n", "entry_point": "sum_with_next_k", "input": "[0, 3, 2, 5, 4, 7], 2", "output": "[3, 5, 7, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73692_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006522", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1,23'", "output": "(1, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006523", "code": "def process_queue(tasks, n):\n    time_taken = 0\n    while tasks:\n        processing = tasks[:n]\n        max_time = max(processing)\n        time_taken += max_time\n        tasks = tasks[n:]\n    return time_taken\n", "entry_point": "process_queue", "input": "[2, 4, 6, 2, 6], 3", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31967_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006524", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_num = num + 2\n        else:\n            processed_num = max(num - 1, 0)  # Subtract 1 from odd numbers, ensure non-negativity\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 2, 1, 4, 2, 2]", "output": "[4, 4, 0, 6, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98159_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2932", "output": "{1, 2, 4, 2932, 1466, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2931", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006526", "code": "def sum_of_squares_of_evens(lst):\n    total = 0\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[8, 4, 4]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71318_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006527", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'44.24444.2'", "output": "(44, 24444, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006528", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "6", "output": "459041", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8368", "output": "{1, 2, 4, 8, 523, 2092, 8368, 16, 1046, 4184}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8367", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006530", "code": "def get_value(type_acquisition, model_input_size):\n    dict_size = {\n        \"SEM\": {\n            \"512\": 0.1,\n            \"256\": 0.2\n        },\n        \"TEM\": {\n            \"512\": 0.01\n        }\n    }\n    # Check if the type_acquisition and model_input_size exist in the dictionary\n    if type_acquisition in dict_size and model_input_size in dict_size[type_acquisition]:\n        return dict_size[type_acquisition][model_input_size]\n    else:\n        return \"Value not found\"\n", "entry_point": "get_value", "input": "'XYZ', '512'", "output": "'Value not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2685_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006531", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "101", "output": "{1, 101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006532", "code": "import re\ndef extract_author_and_license(file_content):\n    author = None\n    license = None\n    author_match = re.search(r'@author: (.+)', file_content)\n    if author_match:\n        author = author_match.group(1)\n    license_match = re.search(r'@license: (.+)', file_content)\n    if license_match:\n        license = license_match.group(1)\n    return author, license\n", "entry_point": "extract_author_and_license", "input": "'Some random text without the needed patterns.'", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84774_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006533", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', 0, 0", "output": "(1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006534", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[5, 0, 3, 0, 9, 4, 5, 5]", "output": "[5, 1, 5, 3, 13, 9, 11, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006535", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[circular_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 1, 2, 3, 3, 2, 0, 2, 2]", "output": "[1, 3, 5, 6, 5, 2, 2, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51677_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8489", "output": "{1, 13, 653, 8489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006537", "code": "def check_html_tags(html_elements):\n    stack = []\n    tag_map = {\"<div>\": \"</div>\", \"<p>\": \"</p>\", \"<span>\": \"</span>\"}  # Define the mapping of opening to closing tags\n    for element in html_elements:\n        if element in tag_map:\n            stack.append(element)\n        elif element == tag_map.get(stack[-1], None):\n            stack.pop()\n        else:\n            return False\n    return len(stack) == 0\n", "entry_point": "check_html_tags", "input": "['<div>', '<p>', '</p>', '</div>']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119351_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006538", "code": "def sum_of_squares_of_evens(lst):\n    total = 0\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 8, 1, 3]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97226_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006539", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "16", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006540", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[8, 12, 16]", "output": "(16, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006541", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'l_utils'", "output": "'Exporting annotated corpus data for l_utils.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006542", "code": "from typing import List\nimport ast\ndef get_unique_absolute_imports(file_content: str) -> List[str]:\n    tree = ast.parse(file_content)\n    imports = [node for node in tree.body if isinstance(node, ast.Import)]\n    absolute_imports = []\n    for import_node in imports:\n        for alias in import_node.names:\n            module_name = alias.name.split('.')[0]\n            if not module_name.startswith('.'):\n                absolute_imports.append(module_name)\n    return list(set(absolute_imports))\n", "entry_point": "get_unique_absolute_imports", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64656_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006543", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[1, 2, 3, 4, 1, 2, 3]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006544", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'document_v2.txt'", "output": "'document_v3.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4697", "output": "{1, 7, 11, 427, 77, 4697, 61, 671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006546", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'XRPBTC'", "output": "('XRP', 'BTC')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006547", "code": "import re\nfrom typing import List\ndef analyze_imports(script: str) -> List[str]:\n    imports = re.findall(r'^import\\s+(\\w+)|^from\\s+(\\w+)', script, re.MULTILINE)\n    modules = set()\n    for imp in imports:\n        module = imp[0] if imp[0] else imp[1]\n        if module != '__future__':\n            module = module.split('.')[0]  # Consider only the top-level module\n            modules.add(module)\n    return list(modules)\n", "entry_point": "analyze_imports", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137089_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006548", "code": "def fizz_buzz_transform(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "fizz_buzz_transform", "input": "[16, 15, 1, 15]", "output": "[16, 'FizzBuzz', 1, 'FizzBuzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8969_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006549", "code": "from typing import List\ndef calculate_average_test_score(test_scores: List[int]) -> int:\n    total_score = 0\n    for score in test_scores:\n        total_score += score\n    average = total_score / len(test_scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_test_score", "input": "[80, 85, 85, 85, 90]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87338_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006550", "code": "def calculate_total_seconds(duration):\n    # Split the duration string into hours, minutes, and seconds\n    hours, minutes, seconds = map(int, duration.split(':'))\n    # Calculate the total number of seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "calculate_total_seconds", "input": "'0:59:59'", "output": "3599", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40922_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006551", "code": "def calculate_average_scores(results):\n    unitag_scores = {}\n    unitag_counts = {}\n    for unitag, score in results:\n        if unitag in unitag_scores:\n            unitag_scores[unitag] += score\n            unitag_counts[unitag] += 1\n        else:\n            unitag_scores[unitag] = score\n            unitag_counts[unitag] = 1\n    average_scores = {unitag: unitag_scores[unitag] / unitag_counts[unitag] for unitag in unitag_scores}\n    return average_scores\n", "entry_point": "calculate_average_scores", "input": "[(201, 75), (202, 80), (203, 85)]", "output": "{201: 75.0, 202: 80.0, 203: 85.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3220_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006552", "code": "def unique_sum(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "unique_sum", "input": "[1, 2, 4, 5, 7, 9, 10, 11]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140817_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006553", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[100, 50, 203, 3]", "output": "5206", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006554", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[1, -3, -3, 4, 0, -2, -2, -2, -2]", "output": "{1: 1, -3: 2, 4: 1, 0: 1, -2: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006555", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "3, 4", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006556", "code": "def count_increases(depth_values):\n    if not depth_values:\n        return 0\n    count = 0\n    for i in range(len(depth_values) - 1):\n        if depth_values[i] < depth_values[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_increases", "input": "[1, 2, 1, 3, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53838_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006557", "code": "def parse_time_duration(duration_str):\n    # Split the duration string into hours, minutes, and seconds components\n    components = duration_str.split('h')\n    hours = int(components[0])\n    if 'm' in components[1]:\n        components = components[1].split('m')\n        minutes = int(components[0])\n    else:\n        minutes = 0\n    if 's' in components[1]:\n        components = components[1].split('s')\n        seconds = int(components[0])\n    else:\n        seconds = 0\n    # Calculate the total duration in seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "parse_time_duration", "input": "'25h'", "output": "90000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1363_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006558", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1111100X'", "output": "['11111000', '11111001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt68", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006559", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'atext.'", "output": "'atext.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006560", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "1902, 1000", "output": "902", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006561", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[1, 2, 3, 4, 5], 2, 4", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006562", "code": "import os\ndef count_files_by_extension(directory_path):\n    extension_count = {}\n    if not os.path.exists(directory_path):\n        return extension_count\n    for item in os.listdir(directory_path):\n        item_path = os.path.join(directory_path, item)\n        if os.path.isfile(item_path):\n            _, extension = os.path.splitext(item)\n            extension_count[extension] = extension_count.get(extension, 0) + 1\n        elif os.path.isdir(item_path):\n            nested_extension_count = count_files_by_extension(item_path)\n            for ext, count in nested_extension_count.items():\n                extension_count[ext] = extension_count.get(ext, 0) + count\n    return extension_count\n", "entry_point": "count_files_by_extension", "input": "'non_existent_directory_path'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76750_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "310", "output": "{1, 2, 5, 10, 310, 155, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt309", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006564", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[2, -1]", "output": "{2, -1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006565", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[33]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2901", "output": "{1, 3, 2901, 967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006567", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        inner_list = list(range(1, i + 1))\n        pattern.append(inner_list)\n    return pattern\n", "entry_point": "generate_pattern", "input": "3", "output": "[[1], [1, 2], [1, 2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76877_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006568", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[1, 1, 1, 1, 1, 0, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006569", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'fdequency'", "output": "{'fdequency': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006570", "code": "def fizz_buzz_transform(numbers):\n    transformed_list = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            transformed_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            transformed_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            transformed_list.append(\"Buzz\")\n        else:\n            transformed_list.append(num)\n    return transformed_list\n", "entry_point": "fizz_buzz_transform", "input": "[1, 3, 5, 15, 7, 9]", "output": "[1, 'Fizz', 'Buzz', 'FizzBuzz', 7, 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20136_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006571", "code": "def find_latest_version(versions):\n    latest_version = \"0.0.0\"\n    for version in versions:\n        version_parts = list(map(int, version.split(\".\")))\n        latest_parts = list(map(int, latest_version.split(\".\")))\n        if version_parts > latest_parts:\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['0.0.0', '0.1.0', '0.2.0', '0.2.1']", "output": "'0.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12565_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006572", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 0, -1, 4, -2, 3]", "output": "[1, -1, 3, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29487_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006573", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[5, 2, 0, 1, 1]", "output": "[5, 2, 0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006574", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "308", "output": "{1, 2, 4, 7, 11, 44, 77, 14, 308, 22, 154, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt307", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006575", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<tag>Wel thew</tag>'", "output": "'Wel thew'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006576", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "15", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006577", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "0, 1028435106.5667512", "output": "1028435106.5667512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006578", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[26, 20, 20, 9, 5, 3], 4", "output": "[26, 20, 20, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006579", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "72, 'codcs.py'", "output": "'72_codcs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006580", "code": "def sum_multiples_of_3_or_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[5, 6, 12, 15]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69053_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006581", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "661", "output": "{1, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006582", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[9, 3, 8, 5, 2]", "output": "[9, 3, 8, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "699", "output": "{3, 1, 699, 233}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006584", "code": "def rock_paper_scissors_winner(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie\"\n    elif (player1_choice == 'rock' and player2_choice == 'scissors') or \\\n         (player1_choice == 'scissors' and player2_choice == 'paper') or \\\n         (player1_choice == 'paper' and player2_choice == 'rock'):\n        return \"Player 1 wins\"\n    else:\n        return \"Player 2 wins\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'paper'", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143238_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006585", "code": "import re\ndef extract_table_columns(script):\n    table_columns = {}\n    # Regular expression patterns to match table and column creation\n    table_pattern = re.compile(r'op.create_table\\(\\s*\"(\\w+)\"')\n    column_pattern = re.compile(r'sa.Column\\(\"(\\w+)\"')\n    # Find all matches for table and column names\n    table_matches = table_pattern.findall(script)\n    column_matches = column_pattern.findall(script)\n    # Populate the dictionary with table names and column names\n    for table in table_matches:\n        table_columns[table] = [column for column in column_matches if column in script]\n    return table_columns\n", "entry_point": "extract_table_columns", "input": "'some random text'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9486_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006586", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "10, 3, '+'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006587", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "16, 3", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006588", "code": "def chatbot(user_input):\n    user_input = user_input.lower()  # Convert input to lowercase for case-insensitive matching\n    if \"hello\" in user_input or \"hi\" in user_input:\n        return \"Hello! How can I assist you today?\"\n    elif \"weather\" in user_input:\n        return \"The weather is sunny today.\"\n    elif \"bye\" in user_input or \"goodbye\" in user_input:\n        return \"Goodbye! Have a great day!\"\n    else:\n        return \"I'm sorry, I didn't understand that.\"\n", "entry_point": "chatbot", "input": "'What is your name?'", "output": "\"I'm sorry, I didn't understand that.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98572_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006589", "code": "def jaro_distance(str1, str2):\n    if not str1 and not str2:\n        return 0.0\n    len_str1 = len(str1)\n    len_str2 = len(str2)\n    if len_str1 == 0 or len_str2 == 0:\n        return 0.0\n    max_dist = max(len_str1, len_str2) // 2 - 1\n    matches = 0\n    transpositions = 0\n    matched_indices = set()\n    for i in range(len_str1):\n        start = max(0, i - max_dist)\n        end = min(i + max_dist + 1, len_str2)\n        for j in range(start, end):\n            if str1[i] == str2[j] and j not in matched_indices:\n                matches += 1\n                matched_indices.add(j)\n                break\n    if matches == 0:\n        return 0.0\n    for i, j in zip(range(len_str1), range(len_str2)):\n        if str1[i] != str2[j]:\n            transpositions += 1\n    transpositions //= 2\n    return (matches / len_str1 + matches / len_str2 + (matches - transpositions) / matches) / 3\n", "entry_point": "jaro_distance", "input": "'MARTHA', 'MARHTA'", "output": "0.9444444444444445", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22884_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006590", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'ei'", "output": "'ei'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3379", "output": "{1, 3379, 109, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006592", "code": "def get_available_franchises(country, transaction_type):\n    available_franchises = {\n        'USA': ['Franchise A', 'Franchise B', 'Franchise C'],\n        'UK': ['Franchise B', 'Franchise D'],\n        'Canada': ['Franchise A', 'Franchise C', 'Franchise E']\n    }\n    if country in available_franchises:\n        franchises_for_country = available_franchises[country]\n        filtered_franchises = [franchise for franchise in franchises_for_country if transaction_type in franchise.lower()]\n        return filtered_franchises\n    else:\n        return []\n", "entry_point": "get_available_franchises", "input": "'Australia', 'any_transaction'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147576_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006593", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the '.' delimiter\n    version_components = version_string.split('.')\n    # Extract major, minor, and patch version numbers\n    major_version = int(version_components[0])\n    minor_version = int(version_components[1])\n    patch_version = int(version_components[2])\n    return major_version, minor_version, patch_version\n", "entry_point": "extract_version_numbers", "input": "'1.0.0'", "output": "(1, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146914_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3466", "output": "{1, 3466, 2, 1733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006595", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9391", "output": "{1, 9391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9390", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006596", "code": "def validate_email_domain(email):\n    allowed_domains = ['company.com', 'example.org', 'test.net']\n    # Extract domain from email address\n    domain = email.split('@')[-1]\n    # Check if the domain is in the allowed list\n    if domain in allowed_domains:\n        return True\n    else:\n        return False\n", "entry_point": "validate_email_domain", "input": "'user@company.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6913_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006597", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "411", "output": "{3, 1, 137, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006598", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[100, 101, 100, 99]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99506_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006599", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'abc', 3", "output": "'def'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65928_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006600", "code": "import math\ndef count_unique_sizes(determinants):\n    unique_sizes = set()\n    for det in determinants:\n        size = int(math.sqrt(det))\n        unique_sizes.add(size)\n    return len(unique_sizes)\n", "entry_point": "count_unique_sizes", "input": "[0, 1, 4, 9, 16]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74244_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006601", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "3", "output": "'oh la laoh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3208", "output": "{1, 2, 802, 1604, 4, 3208, 8, 401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3207", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006603", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[4, 5, 1, 1, 2, 4, 1, 4, 3]", "output": "[1, 1, 1, 2, 3, 4, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006604", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 86, 87, 88, 90]", "output": "87.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145058_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006605", "code": "from typing import List\ndef apply_threshold(all_confs: List[float], max_num: int) -> float:\n    sorted_confs = sorted(all_confs, reverse=True)\n    threshold_index = max_num - 1\n    if threshold_index < 0:\n        raise ValueError(\"max_num should be greater than 0\")\n    if threshold_index >= len(sorted_confs):\n        raise ValueError(\"max_num exceeds the number of confidence scores\")\n    return sorted_confs[threshold_index]\n", "entry_point": "apply_threshold", "input": "[0.9, 0.8, 0.7], 3", "output": "0.7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112728_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006606", "code": "import ast\ndef evaluate_expression(expression: str) -> float:\n    tree = ast.parse(expression, mode='eval')\n    def evaluate_node(node):\n        if isinstance(node, ast.BinOp):\n            left = evaluate_node(node.left)\n            right = evaluate_node(node.right)\n            if isinstance(node.op, ast.Add):\n                return left + right\n            elif isinstance(node.op, ast.Sub):\n                return left - right\n            elif isinstance(node.op, ast.Mult):\n                return left * right\n            elif isinstance(node.op, ast.Div):\n                return left / right\n        elif isinstance(node, ast.Num):\n            return node.n\n        elif isinstance(node, ast.Expr):\n            return evaluate_node(node.value)\n        else:\n            raise ValueError(\"Invalid expression\")\n    return evaluate_node(tree.body)\n", "entry_point": "evaluate_expression", "input": "'0'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124878_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006607", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7694", "output": "{1, 2, 7694, 3847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7693", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006608", "code": "def can_place_flowers(flowerbed, n):\n    cnt = 0\n    flowerbed = [0] + flowerbed + [0]  # Add 0s at the beginning and end for boundary check\n    for i in range(1, len(flowerbed) - 1):\n        if flowerbed[i - 1] == flowerbed[i] == flowerbed[i + 1] == 0:\n            flowerbed[i] = 1\n            cnt += 1\n    return cnt >= n\n", "entry_point": "can_place_flowers", "input": "[1, 0, 1], 1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147289_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006609", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3, 4], 1", "output": "400.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006610", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'this isrrw'", "output": "{'this': 1, 'isrrw': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006611", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[5, 10], 10", "output": "[25, 1000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006612", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7235", "output": "{1, 7235, 5, 1447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006613", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[70, 75, 76, 79, 80]", "output": "76.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113065_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006614", "code": "def check_gene_data(gff_file, essentials_file, gene_names_file):\n    def load_default_files(gff_file, essentials_file, gene_names_file):\n        # Simulated function to load files, returns dummy data for demonstration\n        return \"dummy_gff_data\", \"dummy_essentials_data\", \"dummy_gene_names_data\"\n    def read_genes(gff_file, essentials_file, gene_names_file):\n        # Simulated function to read genes, returns dummy data for demonstration\n        return {\"gene1\": [1, 10, \"+\"], \"gene2\": [5, 20, \"-\"]}, {}, {}\n    # Load files and read genes\n    a, b, c = load_default_files(gff_file, essentials_file, gene_names_file)\n    a_0, _, _ = read_genes(a, b, c)\n    # Validate the first value of the gene coordinates\n    first_value = next(iter(a_0.values()))\n    assert first_value == [1, 10, \"+\"], \"The first value of the gene coordinates is incorrect\"\n    # Identify the gene with the highest coordinate value\n    max_coordinate_gene = max(a_0, key=lambda x: a_0[x][1])\n    return max_coordinate_gene\n", "entry_point": "check_gene_data", "input": "'gff_file_path', 'essentials_file_path', 'gene_names_file_path'", "output": "'gene2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20429_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006615", "code": "def remove_consecutive_spaces(input_str):\n    input_list = list(input_str)\n    i = 0\n    while i <= len(input_list) - 1:\n        if input_list[i] == ' ' and input_list[i - 1] == ' ':\n            del input_list[i]\n        else:\n            i += 1\n    modified_str = ''.join(input_list)\n    return modified_str\n", "entry_point": "remove_consecutive_spaces", "input": "'Hello   World'", "output": "'Hello World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92998_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006616", "code": "def sum_divisible_numbers(start, end, divisor):\n    sum_divisible = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            sum_divisible += num\n    return sum_divisible\n", "entry_point": "sum_divisible_numbers", "input": "2, 8, 2", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31930_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006617", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1844", "output": "{1, 2, 4, 461, 1844, 922}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1843", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006618", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'= TTeTrueSQLALCHEMY_DATABASE_URI'", "output": "{'': 'TTeTrueSQLALCHEMY_DATABASE_URI'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006619", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return player1_wins, player2_wins\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7, 8, 9, 10, 2, 3], [4, 5, 6, 7, 1, 1, 4, 6]", "output": "(6, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47908_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006620", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[1, 9]", "output": "(9, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006621", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', 3, 2", "output": "(4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006622", "code": "YEAR_CHOICES = (\n    (1, 'First'),\n    (2, 'Second'),\n    (3, 'Third'),\n    (4, 'Fourth'),\n    (5, 'Fifth'),\n)\ndef get_ordinal(year):\n    for num, ordinal in YEAR_CHOICES:\n        if num == year:\n            return ordinal\n    return \"Unknown\"\n", "entry_point": "get_ordinal", "input": "6", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43813_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006623", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'3.1.4.27'", "output": "(3, 1, 4, 27)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006624", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-55.4], 1", "output": "-55.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2401_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006625", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 88, 75, 75, 60]", "output": "[100, 90, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006626", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[26, 26, 20, 10, 5, 3, 1], 4", "output": "[26, 26, 20, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006627", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'Error occurred', 3, 3", "output": "'3: Error occurred'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006628", "code": "from collections import Counter\ndef getHint(secret: str, guess: str) -> str:\n    bulls = cows = 0\n    seen = Counter()\n    for s, g in zip(secret, guess):\n        if s == g:\n            bulls += 1\n        else:\n            if seen[s] < 0:\n                cows += 1\n            if seen[g] > 0:\n                cows += 1\n            seen[s] += 1\n            seen[g] -= 1\n    return \"{0}A{1}B\".format(bulls, cows)\n", "entry_point": "getHint", "input": "'1234', '4213'", "output": "'1A3B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78888_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006629", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "300, 4", "output": "296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006630", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[27]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18834_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006631", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[24, 25, 26]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006632", "code": "def bubble_sort(elements):\n    while True:\n        swapped = False\n        for i in range(len(elements) - 1):\n            if elements[i] > elements[i + 1]:\n                # Swap elements\n                elements[i], elements[i + 1] = elements[i + 1], elements[i]\n                swapped = True\n        if not swapped:\n            break\n    return elements\n", "entry_point": "bubble_sort", "input": "[90, 25, 24, 23, 23, 24, 24, 90, 90]", "output": "[23, 23, 24, 24, 24, 25, 90, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115988_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006633", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'is'", "output": "'Tweet posted successfully: is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006634", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the period as the delimiter\n    version_parts = version_string.split('.')\n    # Convert the split parts into integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return the major, minor, and patch version numbers as a tuple\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.12.0'", "output": "(0, 12, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81674_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006635", "code": "def create_grayscale_image(pixel_values):\n    num_rows = len(pixel_values) // 2\n    grayscale_image = [pixel_values[i:i+2] for i in range(0, len(pixel_values), 2)]\n    return grayscale_image\n", "entry_point": "create_grayscale_image", "input": "[25, 50, 75, 100, 25, 75, 150]", "output": "[[25, 50], [75, 100], [25, 75], [150]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125826_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006636", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "452", "output": "{1, 2, 226, 452, 4, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt451", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006637", "code": "def string_length_dict(input_list):\n    result_dict = {}\n    for string in input_list:\n        length = len(string)\n        if length not in result_dict:\n            result_dict[length] = [string]\n        else:\n            if string not in result_dict[length]:\n                result_dict[length].append(string)\n    return result_dict\n", "entry_point": "string_length_dict", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11715_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006638", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[3, 1, 3, 3, 2, 3, 2, 2]", "output": "[6, 2, 6, 6, 4, 6, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006639", "code": "def repeat(character: str, counter: int) -> str:\n    \"\"\"Repeat returns character repeated `counter` times.\"\"\"\n    word = \"\"\n    for _ in range(counter):\n        word += character\n    return word\n", "entry_point": "repeat", "input": "'a', 5", "output": "'aaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60016_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006640", "code": "def filter_data(table, conditions):\n    filtered_rows = []\n    for row in table:\n        satisfies_all_conditions = True\n        for condition in conditions:\n            for key, value in condition.items():\n                if key not in row or row[key] != value:\n                    satisfies_all_conditions = False\n                    break\n            if not satisfies_all_conditions:\n                break\n        if satisfies_all_conditions:\n            filtered_rows.append(row)\n    return filtered_rows\n", "entry_point": "filter_data", "input": "[{}, {}, {}, {}, {}, {}], []", "output": "[{}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120398_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006641", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9286", "output": "{1, 2, 4643, 9286}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006642", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "5, 5", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006643", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006644", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6717", "output": "{1, 3, 6717, 2239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6716", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006645", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[0, 1, -1, 3, -3], 2", "output": "[1, 0, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006646", "code": "from typing import List\ndef find_first_duplicate(A: List[int]) -> int:\n    seen = set()\n    for num in A:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 4, 3, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55340_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006647", "code": "def extract_view_names(urlpatterns):\n    view_names = set()\n    for pattern in urlpatterns:\n        view_names.add(pattern[1])\n    return view_names\n", "entry_point": "extract_view_names", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57057_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006648", "code": "def sum_fibonacci(n):\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    sum_fib = 1\n    fib_prev = 0\n    fib_curr = 1\n    for _ in range(2, n):\n        fib_next = fib_prev + fib_curr\n        sum_fib += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "8", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46852_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006649", "code": "def check_string(s):\n    digit_found = False\n    english_letter_found = False\n    for ch in s:\n        if ch.isdigit():\n            digit_found = True\n        elif ch.isalpha():\n            english_letter_found = True\n        elif u'\\u4e00' <= ch <= u'\\u9fff':\n            return False\n    return digit_found and english_letter_found\n", "entry_point": "check_string", "input": "'A1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41220_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006650", "code": "def elementwise_multiply(list1, list2):\n    if len(list1) != len(list2):\n        return []\n    result = []\n    for i in range(len(list1)):\n        result.append(list1[i] * list2[i])\n    return result\n", "entry_point": "elementwise_multiply", "input": "[1, 2, 3], [2, 3, 4]", "output": "[2, 6, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118879_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5823", "output": "{1, 3, 647, 9, 1941, 5823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006652", "code": "from typing import List\nimport heapq\ndef min_time_to_complete_tasks(tasks: List[int], num_concurrent: int) -> int:\n    if not tasks:\n        return 0\n    tasks.sort()  # Sort tasks in ascending order of processing times\n    pq = []  # Priority queue to store the next available task to start\n    time = 0\n    running_tasks = []\n    for task in tasks:\n        while len(running_tasks) >= num_concurrent:\n            next_task_time, next_task = heapq.heappop(pq)\n            time = max(time, next_task_time)\n            running_tasks.remove(next_task)\n        time += task\n        running_tasks.append(task)\n        heapq.heappush(pq, (time, task))\n    return max(time, max(pq)[0])  # Return the maximum time taken to complete all tasks\n", "entry_point": "min_time_to_complete_tasks", "input": "[5, 10, 5, 5], 2", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10650_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006653", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['3 + 5', '6 * 1']", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006654", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 2, 7, 7, 1, 1, 9, 0]", "output": "[2, 3, 9, 10, 5, 6, 15, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006655", "code": "import re\ndef extract_model_names_from_content(content):\n    model_names = []\n    class_pattern = r'class\\s+(\\w+)\\(models.Model\\):'\n    matches = re.findall(class_pattern, content)\n    for match in matches:\n        model_names.append(match)\n    return model_names\n", "entry_point": "extract_model_names_from_content", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36678_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006656", "code": "# Constants\n_ACCELERATION_VALUE = 1\n_INDICATOR_SIZE = 8\n_ANIMATION_SEQUENCE = ['-', '\\\\', '|', '/']\ndef _get_busy_animation_part(index):\n    return _ANIMATION_SEQUENCE[index % len(_ANIMATION_SEQUENCE)]\n", "entry_point": "_get_busy_animation_part", "input": "0", "output": "'-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97851_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006657", "code": "def count_storage_operations(storage_operations):\n    operation_counts = {}\n    for code in storage_operations:\n        if code in operation_counts:\n            operation_counts[code] += 1\n        else:\n            operation_counts[code] = 1\n    return operation_counts\n", "entry_point": "count_storage_operations", "input": "[100, 102, 102, 104, 105, 106]", "output": "{100: 1, 102: 2, 104: 1, 105: 1, 106: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69426_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006658", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        circular_sum = input_list[i] + input_list[(i + 1) % list_length]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2, 1, 3, 4, 1, 0, 1]", "output": "[4, 3, 4, 7, 5, 1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117423_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006659", "code": "def pushDominoes(dominoes: str) -> str:\n    forces = [0] * len(dominoes)\n    force = 0\n    # Calculate forces from the left\n    for i in range(len(dominoes)):\n        if dominoes[i] == 'R':\n            force = len(dominoes)\n        elif dominoes[i] == 'L':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] += force\n    # Calculate forces from the right\n    force = 0\n    for i in range(len(dominoes) - 1, -1, -1):\n        if dominoes[i] == 'L':\n            force = len(dominoes)\n        elif dominoes[i] == 'R':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] -= force\n    # Determine the final state of each domino\n    result = ''\n    for f in forces:\n        if f > 0:\n            result += 'R'\n        elif f < 0:\n            result += 'L'\n        else:\n            result += '.'\n    return result\n", "entry_point": "pushDominoes", "input": "'LLRRLL..'", "output": "'LLRRLL..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122559_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006660", "code": "import math\ndef calculate_cosine_similarity(vector1, vector2):\n    dot_product = 0\n    magnitude1 = 0\n    magnitude2 = 0\n    # Calculate dot product and magnitudes\n    for key in set(vector1.keys()) & set(vector2.keys()):\n        dot_product += vector1[key] * vector2[key]\n    for value in vector1.values():\n        magnitude1 += value ** 2\n    for value in vector2.values():\n        magnitude2 += value ** 2\n    magnitude1 = math.sqrt(magnitude1)\n    magnitude2 = math.sqrt(magnitude2)\n    # Calculate cosine similarity\n    if magnitude1 == 0 or magnitude2 == 0:\n        return 0\n    else:\n        return dot_product / (magnitude1 * magnitude2)\n", "entry_point": "calculate_cosine_similarity", "input": "{}, {'a': 1}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12988_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006661", "code": "def find_first_non_repeating_char(s):\n    char_count = {}\n    # Count occurrences of each character\n    for char in s:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    # Find the first non-repeating character\n    for i in range(len(s)):\n        if char_count[s[i]] == 1:\n            return i\n    return -1\n", "entry_point": "find_first_non_repeating_char", "input": "'aabbccddx'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63867_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006662", "code": "def apply_replacements(replacements, input_string):\n    replacement_dict = {}\n    # Populate the replacement dictionary\n    for replacement in replacements:\n        old_word, new_word = replacement.split(\":\")\n        replacement_dict[old_word] = new_word\n    # Split the input string into words\n    words = input_string.split()\n    # Apply replacements to each word\n    for i in range(len(words)):\n        if words[i] in replacement_dict:\n            words[i] = replacement_dict[words[i]]\n    # Join the modified words back into a string\n    output_string = \" \".join(words)\n    return output_string\n", "entry_point": "apply_replacements", "input": "[], 'and'", "output": "'and'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5614_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006663", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[1, 4, 1, 3, 5]", "output": "[1, 4, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006664", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'randomtext24c1text112222222'", "output": "{24, 1, 112222222}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006665", "code": "def process_values(x, y, raw_z):\n    z = None\n    if y > 145 and y <= 166 and x <= 18:\n        y = 145\n        x = 5\n    raw_z_int = int(raw_z)\n    if raw_z_int < 70:\n        z = 3\n    elif 70 <= raw_z_int <= 80:\n        z = 4\n    else:\n        z = 5\n    if 51 <= y <= 185 and 0 <= x <= 87:\n        return {'x': x, 'y': y, 'z': z}\n    return None\n", "entry_point": "process_values", "input": "10, 150, 81", "output": "{'x': 5, 'y': 145, 'z': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64164_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006666", "code": "from typing import List\ndef sum_of_even_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[4, 6, 8, 10]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62351_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006667", "code": "def find_runner_up(scores):\n    highest_score = float('-inf')\n    runner_up = float('-inf')\n    for score in scores:\n        if score > highest_score:\n            runner_up = highest_score\n            highest_score = score\n        elif score > runner_up and score != highest_score:\n            runner_up = score\n    return runner_up\n", "entry_point": "find_runner_up", "input": "[2, 3, 4, 5, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109289_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006668", "code": "import re\nREGEX_SPLITTER = \"([sS]?\\\\d+?\\\\s?[eExX-]\\\\d+)\"\nREGEX_EPISODE_SPLITTER = \"[sS]?(\\\\d+?)\\\\s?[eExX-](\\\\d+)\"\nREGEX_CLEANER = \"[^a-zA-Z0-9]+$\"\ndef extract_metadata(filename):\n    metadata = {}\n    # Extract show name, season number, and episode number using regular expressions\n    match = re.search(REGEX_SPLITTER, filename)\n    if match:\n        episode_match = re.search(REGEX_EPISODE_SPLITTER, match.group())\n        if episode_match:\n            metadata[\"show\"] = filename[:match.start()].strip().replace(\".\", \" \")\n            metadata[\"season\"] = int(episode_match.group(1))\n            metadata[\"episode\"] = int(episode_match.group(2))\n    return metadata\n", "entry_point": "extract_metadata", "input": "'Friends S01E03'", "output": "{'show': 'Friends', 'season': 1, 'episode': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124325_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006669", "code": "def min_distance_to_parking(N, M, occupied_positions):\n    if M == 0:\n        return 1\n    occupied_positions.sort()\n    distances = [occupied_positions[0] - 1] + [occupied_positions[i] - occupied_positions[i - 1] - 1 for i in range(1, M)] + [N - occupied_positions[-1]]\n    return min(distances)\n", "entry_point": "min_distance_to_parking", "input": "5, 3, [6, 7, 8]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38780_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006670", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "6", "output": "'6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006671", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "10", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006672", "code": "def extract_author_info(setup_config):\n    author_name = setup_config.get('author', 'Unknown Author')\n    author_email = setup_config.get('author_email', 'Unknown Email')\n    return author_name, author_email\n", "entry_point": "extract_author_info", "input": "{}", "output": "('Unknown Author', 'Unknown Email')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69852_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3926", "output": "{1, 2, 1963, 13, 302, 3926, 151, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006674", "code": "import os\nimport json\ndef parse_plugins(directory_path):\n    plugins = []\n    if os.path.exists(directory_path) and os.path.isdir(directory_path):\n        for filename in os.listdir(directory_path):\n            if filename.endswith(\".json\"):\n                file_path = os.path.join(directory_path, filename)\n                with open(file_path, 'r') as file:\n                    plugin_data = json.load(file)\n                    plugin = {\n                        \"name\": plugin_data.get(\"name\"),\n                        \"description\": plugin_data.get(\"description\"),\n                        \"dependencies\": plugin_data.get(\"dependencies\", [])\n                    }\n                    plugins.append(plugin)\n    return plugins\n", "entry_point": "parse_plugins", "input": "'/invalid/path/to/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76235_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006675", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8523", "output": "{1, 3, 9, 8523, 947, 2841}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006676", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5293", "output": "{1, 67, 5293, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006677", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'petalieep', 'ja', 'smsmithith'", "output": "'Petalieep Ja Smsmithith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006678", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'The quick brown fox jumps over the lazy dog'", "output": "['quick', 'brown', 'jumps']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006679", "code": "def length_of_longest_substring(s: str) -> int:\n    char_index_map = {}\n    start = 0\n    max_length = 0\n    for end in range(len(s)):\n        if s[end] in char_index_map and char_index_map[s[end]] >= start:\n            start = char_index_map[s[end]] + 1\n        char_index_map[s[end]] = end\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "length_of_longest_substring", "input": "'abcdefg'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65081_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006680", "code": "def calculate_dot_product(vector1, vector2):\n    min_len = min(len(vector1), len(vector2))\n    dot_product_result = sum(vector1[i] * vector2[i] for i in range(min_len))\n    return dot_product_result\n", "entry_point": "calculate_dot_product", "input": "[4, 8], [8, 4]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135589_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006681", "code": "def generate_api_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "generate_api_url", "input": "'https:', 't/useruses'", "output": "'https:t/useruses'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62370_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2598", "output": "{1, 2, 3, 866, 2598, 6, 433, 1299}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006683", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "14", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006684", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'12:30:05 PM'", "output": "'12:30:05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006685", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'testte'", "output": "'testte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006686", "code": "def find_duplicate(nums):\n    slow = nums[0]\n    fast = nums[0]\n    while True:\n        slow = nums[slow]\n        fast = nums[nums[fast]]\n        if slow == fast:\n            break\n    slow = nums[0]\n    while slow != fast:\n        slow = nums[slow]\n        fast = nums[fast]\n    return slow\n", "entry_point": "find_duplicate", "input": "[1, 2, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2478_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006687", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006688", "code": "def max_subarray_sum(nums):\n    max_sum = nums[0]\n    current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[-3, -7, -4]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41851_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006689", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'o a g'", "output": "{'o': 1, 'a': 1, 'g': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139810_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006690", "code": "def grid_game(moves, boundary):\n    x, y = 0, 0\n    for move in moves:\n        if move == \"U\" and y < boundary[1]:\n            y += 1\n        elif move == \"D\" and y > -boundary[1]:\n            y -= 1\n        elif move == \"L\" and x > -boundary[0]:\n            x -= 1\n        elif move == \"R\" and x < boundary[0]:\n            x += 1\n    return (x, y)\n", "entry_point": "grid_game", "input": "['R'], (2, 1)", "output": "(1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67141_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006691", "code": "def calculate_weighted_average(numbers, n_obs_train):\n    if n_obs_train == 0:\n        return 0  # Handling division by zero\n    weight = 1. / n_obs_train\n    weighted_sum = sum(numbers) * weight\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[0.1, 0.1, 0.1, 1.3170212765957445], 4", "output": "0.40425531914893614", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136723_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006692", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[4, 5, 1]", "output": "[4, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006693", "code": "import json\ndef process_json_response(response, param_name):\n    try:\n        json_data = json.loads(response)\n        if 'data' in json_data and len(json_data['data']) > 0:\n            expected_response = \"Required parameter '\" + param_name + \"' is missing\"\n            if 'detail' in json_data and json_data['detail'] == expected_response:\n                return True\n    except (json.JSONDecodeError, KeyError):\n        pass\n    return False\n", "entry_point": "process_json_response", "input": "'not a json', 'example_param'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111183_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006694", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "8", "output": "[0, 1, 1, 1, 2, 3, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006695", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "68, 1.0", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006696", "code": "from typing import List, Dict\ndef filter_db_params(db_params_list: List[Dict[str, str]], key: str, value: str) -> List[Dict[str, str]]:\n    filtered_params = []\n    for params in db_params_list:\n        if key in params and params[key] == value:\n            filtered_params.append(params)\n    return filtered_params\n", "entry_point": "filter_db_params", "input": "[], 'some_key', 'some_value'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50236_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006697", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['irrelevant', '2', '11', '22', 'AA', 'CB', 'AZ']", "output": "'2 11 22 AA CB AZ'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5213", "output": "{1, 13, 401, 5213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5212", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006699", "code": "import re\ndef parse_table_schema(code_snippet):\n    table_info = {}\n    # Extract table name\n    table_name = re.search(r'op.create_table\\(\\s*\"(\\w+)\"', code_snippet)\n    if table_name:\n        table_info[\"table_name\"] = table_name.group(1)\n    # Extract column definitions\n    columns = re.findall(r'sa.Column\\(\"(\\w+)\",\\s*sa\\.(\\w+)\\(', code_snippet)\n    if columns:\n        table_info[\"columns\"] = {col[0]: col[1].upper() for col in columns}\n    return table_info\n", "entry_point": "parse_table_schema", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92758_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006700", "code": "def get_ZX_from_ZZ_XX(ZZ, XX):\n    if hasattr(ZZ, '__iter__') and len(ZZ) == len(XX):\n        return [(z, x) for z, x in zip(ZZ, XX)]\n    else:\n        return (ZZ, XX)\n", "entry_point": "get_ZX_from_ZZ_XX", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "[(1, 'a'), (2, 'b'), (3, 'c')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141248_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006701", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'Pig  p'", "output": "{'p': 2, 'i': 1, 'g': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29002_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006702", "code": "def relay_game(players):\n    num_relays = 4\n    current_relay = 0\n    active_player = 0\n    while current_relay < num_relays:\n        current_relay += 1\n        active_player = (active_player + 1) % len(players)\n    return players[active_player]\n", "entry_point": "relay_game", "input": "['Bob', 'Alice', 'Charlie', 'Diana']", "output": "'Bob'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11380_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006703", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "15", "output": "'1111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006704", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7966", "output": "{1, 2, 7, 14, 3983, 1138, 569, 7966}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006705", "code": "def is_vampire_number(x, y):\n    product = x * y\n    if len(str(x) + str(y)) != len(str(product)):\n        return False\n    product_digits = str(product)\n    for digit in str(x) + str(y):\n        if digit in product_digits:\n            product_digits = product_digits.replace(digit, '', 1)  # Remove the digit from the product\n        else:\n            return False\n    return len(product_digits) == 0  # Check if all digits in the product have been matched\n", "entry_point": "is_vampire_number", "input": "1, 10", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82769_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006706", "code": "def reverse_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each nucleotide with its complement\n    complemented_sequence = ''.join(complement_dict[nucleotide] for nucleotide in reversed_sequence)\n    return complemented_sequence\n", "entry_point": "reverse_complement", "input": "'A'", "output": "'T'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100926_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006707", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4973", "output": "{1, 4973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006708", "code": "import re\ndef extract_versions_and_authors(source_code):\n    versions = set()\n    authors = set()\n    version_pattern = re.compile(r'__version__ = \\'(.*?)\\'')\n    author_pattern = re.compile(r'__author__ = \\'(.*?)\\'')\n    for line in source_code.split('\\n'):\n        version_match = version_pattern.search(line)\n        if version_match:\n            versions.add(version_match.group(1))\n        author_match = author_pattern.search(line)\n        if author_match:\n            authors.add(author_match.group(1))\n    return list(versions), list(authors)\n", "entry_point": "extract_versions_and_authors", "input": "''", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87607_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006709", "code": "def can_partition(nums):\n    total_sum = sum(nums)\n    if total_sum % 2 != 0:\n        return False\n    n = len(nums)\n    target_sum = total_sum // 2\n    dp = [[False for _ in range(target_sum + 1)] for _ in range(n + 1)]\n    for i in range(n + 1):\n        dp[i][0] = True\n    for i in range(1, n + 1):\n        for j in range(1, target_sum + 1):\n            if j >= nums[i - 1]:\n                dp[i][j] = dp[i - 1][j] or dp[i - 1][j - nums[i - 1]]\n            else:\n                dp[i][j] = dp[i - 1][j]\n    return dp[n][target_sum]\n", "entry_point": "can_partition", "input": "[1, 2, 5]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006710", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'33.5.3'", "output": "'33.5.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006711", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'abcdefghijk', 'abxyz'", "output": "0.18181818181818182", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3201", "output": "{1, 3201, 3, 291, 33, 97, 11, 1067}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3200", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006713", "code": "def convert_to_binary_labels(labels, fg_labels):\n    binary_labels = []\n    fg_counter = 0\n    for label in labels:\n        if label in fg_labels:\n            binary_labels.append(fg_counter)\n            fg_counter += 1\n        else:\n            binary_labels.append(-1)  # Assign -1 for non-foreground labels\n    # Adjust binary labels to start from 0 for foreground labels\n    min_fg_label = min(binary_label for binary_label in binary_labels if binary_label >= 0)\n    binary_labels = [binary_label - min_fg_label if binary_label >= 0 else -1 for binary_label in binary_labels]\n    return binary_labels\n", "entry_point": "convert_to_binary_labels", "input": "[10, 30, 20, 40, 50, 60, 70], {10, 20}", "output": "[0, -1, 1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96185_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006714", "code": "def compare_xml_strings(dat1, dat2):\n    class DummyObject:\n        def assertMultiLineEqual(self, dat1, dat2):\n            return dat1 == dat2\n    dummy_obj = DummyObject()\n    if hasattr(dummy_obj, 'assertXmlEqual'):\n        return dummy_obj.assertXmlEqual(dat1, dat2)\n    else:\n        return dummy_obj.assertMultiLineEqual(dat1, dat2)\n", "entry_point": "compare_xml_strings", "input": "'abc', 'def'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8007_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006715", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(2, 10, 10, 4, 11, 10, 11, 10)", "output": "'2.10.10.4.11.10.11.10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006716", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[5, 1, 9, 2, 5]", "output": "[1, 2, 5, 5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006717", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "14", "output": "[1, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6928", "output": "{1, 2, 866, 4, 1732, 3464, 8, 6928, 16, 433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6927", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006719", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[6, 7]", "output": "[6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006720", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3775", "output": "{1, 5, 755, 151, 25, 3775}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3774", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006721", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1506", "output": "{1, 1506, 3, 2, 6, 753, 502, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1505", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006722", "code": "def check_email_allow_list(email):\n    # Define a hardcoded email allow list\n    email_allow_list = [\"allowed@example.com\", \"user@example.com\", \"test@example.com\"]\n    return email in email_allow_list\n", "entry_point": "check_email_allow_list", "input": "'notallowed@example.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107608_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006723", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[10, 20, 30, 40, 50]", "output": "[10, 20, 30, 40, 50]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006724", "code": "def login(username, password):\n    credentials = {\n        \"user1\": \"password1\",\n        \"user2\": \"password2\"\n    }\n    if username in credentials and credentials[username] == password:\n        # Generate JWT token (for simplicity, just concatenate username and a secret key)\n        jwt_token = username + \"_secretkey\"\n        return {\"jwt\": jwt_token}\n    else:\n        return {\"error\": \"Invalid username or password\"}\n", "entry_point": "login", "input": "'invalid_user', 'any_password'", "output": "{'error': 'Invalid username or password'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89772_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006725", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[18]", "output": "[18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006726", "code": "def fizz_buzz_list(a):\n    result = []\n    for i in range(1, a + 1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(i)\n    return result\n", "entry_point": "fizz_buzz_list", "input": "9", "output": "[1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72269_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006727", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'a hob'", "output": "'a hob'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006728", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3184", "output": "{1, 2, 4, 199, 8, 398, 3184, 16, 1592, 796}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3183", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4718", "output": "{1, 2, 674, 7, 4718, 14, 337, 2359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4717", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006730", "code": "def count_operation_type(operation_list, operation_type):\n    cktable = {-1: \"NON\", 0: \"KER\", 1: \"H2D\", 2: \"D2H\", 8: \"D2D\", 10: \"P2P\"}\n    count = 0\n    for op in operation_list:\n        if op == operation_type:\n            count += 1\n    return count\n", "entry_point": "count_operation_type", "input": "[1, 2, 0, 3], 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88938_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006731", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[38]", "output": "[38]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006732", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[5, 6, 7, 8], 0, 3", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006733", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "-4, -2", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006734", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2003", "output": "{1, 2003}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2002", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006736", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'English'", "output": "'English'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006737", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[10, 4, 221, 1]", "output": "262", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006738", "code": "def determine_port(flask_debug: str) -> int:\n    if flask_debug == '1':\n        return 5005\n    else:\n        return 5005\n", "entry_point": "determine_port", "input": "'0'", "output": "5005", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42883_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006739", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "5", "output": "[0, 1, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006740", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1112", "output": "{1, 2, 4, 8, 139, 556, 278, 1112}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1111", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006741", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9621", "output": "{1, 3, 3207, 9, 1069, 9621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006742", "code": "def categorize_students(scores):\n    groups = {'A': [], 'B': [], 'C': []}\n    for score in scores:\n        if score >= 80:\n            groups['A'].append(score)\n        elif 60 <= score <= 79:\n            groups['B'].append(score)\n        else:\n            groups['C'].append(score)\n    return groups\n", "entry_point": "categorize_students", "input": "[85, 90, 70, 60, 45, 55]", "output": "{'A': [85, 90], 'B': [70, 60], 'C': [45, 55]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63935_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006743", "code": "def sum_multiples_3_or_5(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_or_5", "input": "15", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36151_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006744", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[17, 16, 17]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006745", "code": "import hashlib\nimport os\ndef calculate_hashes(directory: str) -> dict:\n    hashes = {}\n    for root, _, files in os.walk(directory):\n        for file in files:\n            file_path = os.path.relpath(os.path.join(root, file), directory)\n            with open(os.path.join(root, file), 'rb') as f:\n                file_hash = hashlib.sha256()\n                while chunk := f.read(4096):\n                    file_hash.update(chunk)\n                hashes[file_path] = file_hash.hexdigest()\n    return hashes\n", "entry_point": "calculate_hashes", "input": "'/path/to/empty/directory/'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59876_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006746", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "2", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006747", "code": "def find_max_xor(L, R):\n    xor = L ^ R\n    max_xor = 1\n    while xor:\n        xor >>= 1\n        max_xor <<= 1\n    return max_xor - 1\n", "entry_point": "find_max_xor", "input": "0, 7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120767_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006748", "code": "import math\ndef sum_of_factorial_digits(n):\n    factorial_result = math.factorial(n)\n    total = sum(int(digit) for digit in str(factorial_result))\n    return total\n", "entry_point": "sum_of_factorial_digits", "input": "6", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108789_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006749", "code": "def extract_tags(resource_dict):\n    output_dict = {}\n    for tag in resource_dict.get('Tags', []):\n        key = tag.get('Key')\n        value = tag.get('Value')\n        if key and value:\n            output_dict[key] = value\n    return output_dict\n", "entry_point": "extract_tags", "input": "{'Tags': []}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131359_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006750", "code": "def calculate_sum_of_multiples(NUM):\n    total_sum = 0\n    for i in range(1, NUM):\n        if i % 3 == 0 or i % 5 == 0:\n            total_sum += i\n    return total_sum\n", "entry_point": "calculate_sum_of_multiples", "input": "23", "output": "119", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107367_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006751", "code": "def calculate_score(numbers):\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    if total > 30:\n        return \"High Score!\"\n    else:\n        return total\n", "entry_point": "calculate_score", "input": "[3, 6, 9, 12, 18]", "output": "'High Score!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123213_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006752", "code": "def next_greater_elements(x):\n    stack = []\n    solution = [None] * len(x)\n    for i in range(len(x)-1, -1, -1):\n        while stack and x[i] >= x[stack[-1]]:\n            stack.pop()\n        if stack:\n            solution[i] = stack[-1]\n        stack.append(i)\n    return solution\n", "entry_point": "next_greater_elements", "input": "[5, 1, 3, 3, 4, 2, 1]", "output": "[None, 2, 4, 4, None, None, None]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72944_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006753", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '13:30:00'", "output": "5400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006754", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[1, 0, 3, 4]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006755", "code": "def find_related_nodes(nodes, target):\n    related_nodes = {target}\n    frontier = [target]\n    while frontier:\n        node = frontier.pop()\n        for neighbor in nodes.get(node, []):\n            if neighbor not in related_nodes:\n                related_nodes.add(neighbor)\n                frontier.append(neighbor)\n    return related_nodes\n", "entry_point": "find_related_nodes", "input": "{}, 'AAAAA'", "output": "{'AAAAA'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42946_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006756", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'CONNECTING', 'FAILURE'", "output": "'ERROR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006757", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7719", "output": "{1, 3, 7719, 2573, 83, 249, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006758", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[70, 75], 2", "output": "72.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52376_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006759", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1384", "output": "{1, 2, 4, 1384, 8, 173, 692, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1383", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006760", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6830", "output": "{1, 2, 5, 10, 683, 6830, 1366, 3415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6829", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006761", "code": "def higher_card_game(player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1\"\n    elif player2_wins > player1_wins:\n        return \"Player 2\"\n    else:\n        return \"Draw\"\n", "entry_point": "higher_card_game", "input": "[3, 5, 7], [2, 4, 6]", "output": "'Player 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006762", "code": "def compare_versions(version1: str, version2: str) -> str:\n    def normalize_version(version):\n        parts = list(map(int, version.split('.')))\n        while len(parts) < 3:\n            parts.append(0)\n        return parts\n    v1 = normalize_version(version1)\n    v2 = normalize_version(version2)\n    for part1, part2 in zip(v1, v2):\n        if part1 > part2:\n            return \"Version 1 is greater\"\n        elif part1 < part2:\n            return \"Version 2 is greater\"\n    return \"Versions are equal\"\n", "entry_point": "compare_versions", "input": "'2.0', '1.9'", "output": "'Version 1 is greater'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87736_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006763", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006764", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[2, 2, 2, 1, 3, 3, 3, 5, 7]", "output": "[2, 2, 2, 1, 3, 3, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006765", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 20, 25, 30, 20, 40]", "output": "[1, 2, 2, 3, 4, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006766", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 4]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143850_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006767", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7733", "output": "{1, 37, 11, 209, 19, 7733, 407, 703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006768", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[40, 40, 42, 42]", "output": "'41%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006769", "code": "import re\ndef locate_tag_positions(ml, aid):\n    pattern = r'<[^>]*\\said\\s*=\\s*[\"\\']%s[\"\\'][^>]*>' % aid\n    aid_pattern = re.compile(pattern, re.IGNORECASE)\n    for m in re.finditer(aid_pattern, ml):\n        plt = m.start()\n        pgt = ml.find('>', plt + 1)\n        return plt, pgt\n    return 0, 0\n", "entry_point": "locate_tag_positions", "input": "'', 'example'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65565_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006770", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are less than 2 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 85, 90, 100]", "output": "87.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3324_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3634", "output": "{1, 2, 46, 79, 3634, 23, 1817, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006772", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[90, 90], 2", "output": "90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006773", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9523", "output": "{89, 1, 9523, 107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006774", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 87, 81, 80, 80, 70]", "output": "[100, 87, 81]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006775", "code": "def sum_of_multiples_of_3_or_5(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in multiples_set:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples_of_3_or_5", "input": "[3, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33384_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006776", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[10, 0, 0], [0, 10, 0], [0, 0, 11]]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1145_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006777", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'373'", "output": "(373,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006778", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[101, 101, 101, 100, 101]", "output": "[101, 101, 101, 100, 101]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006779", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7422", "output": "{1, 2, 3, 6, 2474, 1237, 7422, 3711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006780", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "44, 33, 59", "output": "44.56638888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006781", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'foxfox'", "output": "'foxfox'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006782", "code": "def longest_substring_within_budget(s, costs, budget):\n    start = 0\n    end = 0\n    current_cost = 0\n    max_length = 0\n    n = len(s)\n    while end < n:\n        current_cost += costs[ord(s[end]) - ord('a')]\n        while current_cost > budget:\n            current_cost -= costs[ord(s[start]) - ord('a')]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_substring_within_budget", "input": "'abc', [1] * 26, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17714_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006783", "code": "def find_device_port(device_name):\n    FAUXMOS = [\n        ['tv', 45671],\n        #['sound', 45672]\n    ]\n    for device in FAUXMOS:\n        if device[0] == device_name:\n            return device[1]\n    return -1\n", "entry_point": "find_device_port", "input": "'sound'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54767_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9002", "output": "{1, 2, 643, 1286, 7, 9002, 14, 4501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9001", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3847", "output": "{1, 3847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006786", "code": "def custom_can_convert_to_int(msg: str) -> bool:\n    if not msg:  # Check if the input string is empty\n        return False\n    for char in msg:\n        if not char.isdigit():  # Check if the character is not a digit\n            return False\n    return True\n", "entry_point": "custom_can_convert_to_int", "input": "'123'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129394_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006787", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'1.32.1', \"'Ky'\"", "output": "(1, 32, 1, 'Ky')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006788", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "'any_location', 12339", "output": "'https://www.fitx.de/fitnessstudios/12339'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9238", "output": "{1, 2, 298, 4619, 149, 9238, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006790", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'Hello worll'", "output": "{'hello': 1, 'worll': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8312", "output": "{1, 2, 4, 8, 1039, 8312, 4156, 2078}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8311", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006792", "code": "def search_rotated_array(nums, target):\n    l, r = 0, len(nums) - 1\n    while l <= r:\n        m = (l + r) // 2\n        if nums[m] == target:\n            return m\n        if nums[l] <= nums[m]:\n            if nums[l] <= target < nums[m]:\n                r = m - 1\n            else:\n                l = m + 1\n        else:\n            if nums[m] < target <= nums[r]:\n                l = m + 1\n            else:\n                r = m - 1\n    return -1\n", "entry_point": "search_rotated_array", "input": "[4, 5, 6, 7, 8, 9, 1, 2, 3], 9", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108772_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006793", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1139", "output": "{1, 67, 1139, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006794", "code": "def add_binary(a, b):\n    # Convert binary strings to decimal integers\n    int_a = int(a, 2)\n    int_b = int(b, 2)\n    # Add the decimal integers\n    sum_decimal = int_a + int_b\n    # Convert the sum back to binary representation\n    return bin(sum_decimal)[2:]\n", "entry_point": "add_binary", "input": "'10', '10'", "output": "'100'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38045_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006795", "code": "CURRENT_BAZEL_VERSION = \"5.0.0\"\nOTHER_BAZEL_VERSIONS = [\n    \"4.2.2\",\n]\nSUPPORTED_BAZEL_VERSIONS = [\n    CURRENT_BAZEL_VERSION,\n] + OTHER_BAZEL_VERSIONS\ndef is_bazel_version_supported(version: str) -> bool:\n    return version in SUPPORTED_BAZEL_VERSIONS\n", "entry_point": "is_bazel_version_supported", "input": "'3.0.0'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32139_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006796", "code": "def compare_scores(player1_scores, player2_scores):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for score1, score2 in zip(player1_scores, player2_scores):\n        if score1 > score2:\n            rounds_won_player1 += 1\n        elif score2 > score1:\n            rounds_won_player2 += 1\n    return [rounds_won_player1, rounds_won_player2]\n", "entry_point": "compare_scores", "input": "[1, 2], [0, 3]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107299_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006797", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "71, 1", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2301", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006798", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 6, 7, 8, 2, 2, 4, 3, 6]", "output": "[1, 7, 9, 11, 6, 7, 10, 10, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006799", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9565", "output": "{1, 5, 9565, 1913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006800", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "8", "output": "[8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006801", "code": "def count_unique_divisible_numbers(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible_numbers", "input": "[], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61726_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006802", "code": "def calculate_average_clouds_per_hour(clouds_per_hour, hours_observed):\n    total_clouds = sum(clouds_per_hour)\n    total_hours = len(hours_observed)\n    average_clouds_per_hour = total_clouds / total_hours\n    return average_clouds_per_hour\n", "entry_point": "calculate_average_clouds_per_hour", "input": "[9, 10, 8, 10, 9, 10, 9, 8], [1, 2, 3, 4, 5, 6, 7, 8]", "output": "9.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42405_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006803", "code": "def average_top_scores(scores):\n    scores.sort(reverse=True)\n    top_students = min(5, len(scores))\n    top_scores_sum = sum(scores[:top_students])\n    return top_scores_sum / top_students\n", "entry_point": "average_top_scores", "input": "[90.0, 92.0, 93.5, 95.0, 88.5]", "output": "91.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61425_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006804", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    sum_scores_except_lowest = sum(sorted_scores[1:])\n    average = sum_scores_except_lowest / (len(scores) - 1)\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[-1, 0, 0]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71878_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006805", "code": "def find_second_largest(nums):\n    largest = float('-inf')\n    second_largest = float('-inf')\n    for num in nums:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num > second_largest and num != largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[5, 10, 15]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115169_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006806", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[3, 4, 5, 7]", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134450_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006807", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total = 0\n    for num in numbers:\n        if is_prime(num):\n            total += num\n    return total\n", "entry_point": "sum_of_primes", "input": "[2, 5, 7, 11]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77459_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006808", "code": "def count_unique_characters(input_string):\n    char_counts = {}\n    for char in input_string:\n        if char.isalpha():\n            char = char.upper()\n            char_counts[char] = char_counts.get(char, 0) + 1\n    return char_counts\n", "entry_point": "count_unique_characters", "input": "'W0W,O!'", "output": "{'W': 2, 'O': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123807_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006809", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'llunkw'", "output": "'llunkw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006810", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[10, 13]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006811", "code": "def generateSecureToken(sCorpID, sEncodingAESKey):\n    concatenated_str = sCorpID + sEncodingAESKey\n    length = len(concatenated_str)\n    reversed_str = concatenated_str[::-1]\n    uppercase_str = reversed_str.upper()\n    secure_token = uppercase_str + str(length)\n    return secure_token\n", "entry_point": "generateSecureToken", "input": "'ABC123', 'KEY123'", "output": "'321YEK321CBA12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75848_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006812", "code": "import re\ndef extract_top_level_modules(script):\n    imported_modules = set()\n    for line in script.split('\\n'):\n        match = re.match(r'^from\\s+([\\w.]+)\\s+import', line)\n        if match:\n            imported_modules.add(match.group(1))\n        else:\n            match = re.match(r'^import\\s+([\\w.]+)', line)\n            if match:\n                imported_modules.add(match.group(1))\n    return list(imported_modules)\n", "entry_point": "extract_top_level_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86730_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006813", "code": "def modify_django_app_name(app_name: str) -> str:\n    modified_name = \"\"\n    for char in app_name:\n        if char.isupper():\n            modified_name += \"_\" + char.lower()\n        else:\n            modified_name += char\n    return modified_name\n", "entry_point": "modify_django_app_name", "input": "'Reviewings'", "output": "'_reviewings'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57025_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006814", "code": "def can_form_palindrome(s: str) -> bool:\n    a_pointer, b_pointer = 0, len(s) - 1\n    while a_pointer <= b_pointer:\n        if s[a_pointer] != s[b_pointer]:\n            s1 = s[:a_pointer] + s[a_pointer + 1:]\n            s2 = s[:b_pointer] + s[b_pointer - 1:]\n            return s1 == s1[::-1] or s2 == s2[::-1]\n        a_pointer += 1\n        b_pointer -= 1\n    return True\n", "entry_point": "can_form_palindrome", "input": "'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67698_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006815", "code": "def count_pairs_sum(nums, target):\n    pairs_count = 0\n    num_dict = {}\n    for num in nums:\n        complement = target - num\n        if complement in num_dict and num_dict[complement] > 0:\n            pairs_count += 1\n            num_dict[complement] -= 1\n        else:\n            num_dict[num] = num_dict.get(num, 0) + 1\n    return pairs_count\n", "entry_point": "count_pairs_sum", "input": "[1, 2, 2, 3], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54468_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006816", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 6, 5]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79978_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006817", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average", "input": "[100]", "output": "'Not enough scores to calculate average.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102000_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006818", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6326", "output": "{1, 2, 3163, 6326}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6325", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006819", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 3, 4, 5, 6], [3, 4, 5, 7, 8]", "output": "[3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41084_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006820", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'/home/user/app', 'templates'", "output": "'/home/user/app/templates'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006821", "code": "def longest_non_decreasing_substring(s):\n    substring = s[0]\n    length = 1\n    bestsubstring = substring\n    bestlength = length\n    for num in range(len(s)-1):\n        if s[num] <= s[num+1]:\n            substring += s[num+1]\n            length += 1\n            if length > bestlength:\n                bestsubstring = substring\n                bestlength = length\n        else:\n            substring = s[num+1]\n            length = 1\n    return bestsubstring\n", "entry_point": "longest_non_decreasing_substring", "input": "'bade'", "output": "'ade'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21049_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006822", "code": "def max_score_subset(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        dp[i] = max(\n            scores[i] + dp[i - 2] if i >= 2 and scores[i] - scores[i - 2] <= 5 else scores[i],\n            dp[i - 1]\n        )\n    return max(dp)\n", "entry_point": "max_score_subset", "input": "[100]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30122_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7491", "output": "{1, 2497, 3, 7491, 33, 227, 681, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006824", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8681", "output": "{1, 8681}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006825", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'Hello Some', 'Hello '", "output": "'Some'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006826", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'ine\\n'", "output": "[['ine']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006827", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[1, 1, 6, 3, 1, 4, 3, 5, 1, 5], 1", "output": "[6, 3, 4, 3, 5, 5, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006828", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'Th Th'", "output": "'Th,Th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006829", "code": "import re\ndef count_word_occurrences(input_string):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word.isalpha():\n            word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'Text'", "output": "{'text': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99880_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006830", "code": "def highest_non_duplicated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_duplicated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_duplicated_scores:\n        return max(non_duplicated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_duplicated_score", "input": "[92, 72, 72, 81, 81]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79204_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006831", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 0, 3, -1, 1, 6, -2, 3, 0]", "output": "[1, 1, 5, 2, 5, 11, 4, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006832", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1746", "output": "{1, 2, 3, 291, 194, 582, 6, 97, 873, 9, 1746, 18}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006833", "code": "import re\ndef extract_variables(query):\n    # Regular expression pattern to match variables in SPARQL query\n    pattern = r'\\?[\\w]+'\n    # Find all matches of variables in the query\n    variables = re.findall(pattern, query)\n    # Return a list of distinct variables\n    return list(set(variables))\n", "entry_point": "extract_variables", "input": "'?pp'", "output": "['?pp']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16424_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006834", "code": "def sum_of_squares(nums: list[int]) -> int:\n    \"\"\"\n    Calculate the sum of squares of integers in the input list.\n    Args:\n    nums: A list of integers.\n    Returns:\n    The sum of the squares of the integers in the input list.\n    \"\"\"\n    return sum(num**2 for num in nums)\n", "entry_point": "sum_of_squares", "input": "[4, 5, 6]", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57390_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006835", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'abdcd'", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006836", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'BBB,'", "output": "[('BBB', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006837", "code": "def count_pairs_sum(nums, target):\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        diff = target - num\n        if diff in num_freq:\n            pair_count += num_freq[diff]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_sum", "input": "[2, 3], 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94686_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006838", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'15m'", "output": "900", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006839", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[6, 8, 10]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006840", "code": "def convert_bitmap_to_active_bits(primary_bitmap):\n    active_data_elements = []\n    for i in range(len(primary_bitmap)):\n        if primary_bitmap[i] == '1':\n            active_data_elements.append(i + 1)  # Data element numbers start from 1\n    return active_data_elements\n", "entry_point": "convert_bitmap_to_active_bits", "input": "'10000000000101'", "output": "[1, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53443_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006841", "code": "def conditional_element_selection(condition, x, y):\n    result = []\n    for i in range(len(condition)):\n        result.append(x[i] if condition[i] else y[i])\n    return result\n", "entry_point": "conditional_element_selection", "input": "[], [], []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96824_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006842", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    total_primes = 0\n    for num in numbers:\n        if is_prime(num):\n            total_primes += num\n    return total_primes\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 11, 13, 17]", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_264_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006843", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[9, 6, 3, 5, 8, 5, 5, 3], 8", "output": "[[9, 6, 3, 5, 8, 5, 5, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006844", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6059", "output": "{73, 1, 83, 6059}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006845", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[3, 4, 5, 6]", "output": "[4.24, 5.66, 7.07, 8.49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006846", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[0, 0, 2, 2, 3, 3, 4]", "output": "{0: 2, 2: 2, 3: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006847", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "937", "output": "{1, 937}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006848", "code": "def parse_version(version_str):\n    # Split the version number string using the dot as the delimiter\n    version_parts = version_str.split('.')\n    # Convert the version number components to integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return a tuple containing the major, minor, and patch version numbers\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.363.3'", "output": "(1, 363, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42795_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006849", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 4, 4, 3, 3, 3]", "output": "[9, 8, 8, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006850", "code": "def count_unique_authors(script_content):\n    unique_authors = set()\n    lines = script_content.split('\\n')\n    for line in lines:\n        if line.strip().startswith('__author__'):\n            author_name = line.split('=')[1].strip().strip(\"'\")\n            unique_authors.add(author_name)\n    return len(unique_authors)\n", "entry_point": "count_unique_authors", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74707_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006851", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "1007", "output": "507528", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7727", "output": "{1, 7727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006853", "code": "def find_first_duplicate(lst):\n    seen = set()\n    for num in lst:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 4, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92633_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006854", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "5, 3", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006855", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'tehela'", "output": "['tehela']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77980_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006856", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(1, 5, 3, 5, 3, 4, 4, 3, -1)", "output": "'1.5.3.5.3.4.4.3.-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006857", "code": "def process_string(input_string):\n    if \"apple\" in input_string:\n        input_string = input_string.replace(\"apple\", \"orange\")\n    if \"banana\" in input_string:\n        input_string = input_string.replace(\"banana\", \"\")\n    if \"cherry\" in input_string:\n        input_string = input_string.replace(\"cherry\", \"CHERRY\")\n    return input_string\n", "entry_point": "process_string", "input": "'I like apple, banana, and cherry.'", "output": "'I like orange, , and CHERRY.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133930_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006858", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9670", "output": "{1, 2, 4835, 5, 9670, 967, 10, 1934}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9669", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006859", "code": "def can_pair_elements(data):\n    c1, c2 = 0, 0\n    for val in data:\n        c1 += val[0]\n        c2 += val[1]\n    return c1 % 2 == c2 % 2\n", "entry_point": "can_pair_elements", "input": "[(1, 1), (1, 2)]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61377_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006860", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "258", "output": "{129, 1, 258, 2, 3, 6, 43, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006861", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3664", "output": "'1 hour, 1 minute, and 4 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006862", "code": "def get_reward(win_type_nm):\n    if win_type_nm == 'jackpot':\n        return \"Congratulations! You've won the jackpot!\"\n    elif win_type_nm == 'bonus':\n        return \"Great job! You've earned a bonus reward!\"\n    elif win_type_nm == 'match':\n        return \"Nice! You've matched a win!\"\n    else:\n        return \"Sorry, no reward this time. Try again!\"\n", "entry_point": "get_reward", "input": "'match'", "output": "\"Nice! You've matched a win!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97895_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1363", "output": "{1, 1363, 29, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1362", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006864", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "11", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006865", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[3, 4, 6]", "output": "4.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006866", "code": "def sum_of_digit_squares(n: int) -> int:\n    total_sum = 0\n    for digit in str(n):\n        total_sum += int(digit) ** 2\n    return total_sum\n", "entry_point": "sum_of_digit_squares", "input": "532", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47266_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006867", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2703", "output": "{1, 3, 901, 2703, 17, 51, 53, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006868", "code": "def generate_directory_mapping(keys, values, dir_names):\n    directory_mapping = {}\n    for i in range(len(keys)):\n        key = keys[i]\n        value = values[i][0]  # Extract the value from the nested list\n        directory_name = dir_names[i]\n        directory_mapping[key] = directory_name\n    return directory_mapping\n", "entry_point": "generate_directory_mapping", "input": "[], [], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148850_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006869", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2919", "output": "{1, 417, 3, 7, 2919, 139, 973, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006870", "code": "from typing import List\ndef min_ram_changes(devices: List[int]) -> int:\n    total_ram = sum(devices)\n    avg_ram = total_ram // len(devices)\n    changes_needed = sum(abs(avg_ram - ram) for ram in devices)\n    return changes_needed\n", "entry_point": "min_ram_changes", "input": "[0, 12, 24]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74774_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006871", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'ETTHBUSBT'", "output": "('ETTHBUSBT', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006872", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import pandpd'", "output": "'pandpd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006873", "code": "def sum_fibonacci(N):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(N):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89935_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006874", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "10", "output": "'1010'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006875", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'example_contrac'", "output": "'contracts/example_contrac.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006876", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[5.0, 9.571428571428571, -1.2, -5.3]", "output": "7.285714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006877", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[8, 1, 5]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5087", "output": "{1, 5087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006879", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'team/2021_2022'", "output": "((2021, 2022), 'team')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006880", "code": "from typing import List, Dict, Any, Union\ndef process_blocks(all_blocks: List[Dict[str, Any]], limit: Union[int, str], marker: Union[int, str]) -> Union[List[Dict[str, Any]], str]:\n    if not isinstance(limit, int) and limit != 'blah':\n        return 'Invalid parameters'\n    if not isinstance(marker, int) and marker != 'blah':\n        return 'Invalid parameters'\n    if isinstance(limit, int):\n        filtered_blocks = all_blocks[:limit]\n    else:\n        filtered_blocks = all_blocks\n    if isinstance(marker, int):\n        filtered_blocks = [block for block in filtered_blocks if block.get('marker') == marker]\n    return filtered_blocks\n", "entry_point": "process_blocks", "input": "[], 2.5, 1", "output": "'Invalid parameters'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109914_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006881", "code": "from typing import List, Optional, Tuple\ndef find_target_indices(nums: List[int], target: int) -> Optional[Tuple[int, int]]:\n    complement_dict = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in complement_dict:\n            return (complement_dict[complement], i)\n        complement_dict[num] = i\n    return None\n", "entry_point": "find_target_indices", "input": "[2, 3], 5", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133300_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006882", "code": "def read_as_dict(result):\n    output = []\n    for row in result:\n        converted_row = {k: v for k, v in row.items()}\n        output.append(converted_row)\n    return output\n", "entry_point": "read_as_dict", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145315_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006883", "code": "def parse_urlpatterns(urlpatterns):\n    url_mapping = {}\n    for pattern in urlpatterns:\n        path, view_func, name = pattern\n        url_mapping[name] = view_func\n    return url_mapping\n", "entry_point": "parse_urlpatterns", "input": "[('/home/', 'home_page', 'home')]", "output": "{'home': 'home_page'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113179_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006884", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8323", "output": "{1, 8323, 1189, 7, 41, 203, 29, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006886", "code": "def max_height(staircase):\n    max_height = 0\n    current_height = 0\n    for step in staircase:\n        if step == '+':\n            current_height += 1\n        elif step == '-':\n            current_height -= 1\n        max_height = max(max_height, current_height)\n    return max_height\n", "entry_point": "max_height", "input": "'+++--'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46647_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006887", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'writinIg'", "output": "'writinIg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006888", "code": "def filter_valid_revision_identifiers(identifiers):\n    valid_identifiers = []\n    for identifier in identifiers:\n        if len(identifier) == 12 and all(char in '0123456789abcdef' for char in identifier):\n            valid_identifiers.append(identifier)\n    return valid_identifiers\n", "entry_point": "filter_valid_revision_identifiers", "input": "['short', 'longer_than_12', '12345g67890a']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91454_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006889", "code": "def create_language_sheet_values(resources, language_code):\n    sheet_values = []\n    for resource_name, translations in resources.items():\n        if len(translations) > language_code:\n            translation = translations[language_code]\n        else:\n            translation = \"Translation Not Available\"\n        sheet_values.append([resource_name, translation])\n    return sheet_values\n", "entry_point": "create_language_sheet_values", "input": "{}, 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10502_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006890", "code": "def modify_list(lst, threshold):\n    modified_lst = []\n    for num in lst:\n        if num >= threshold:\n            sum_greater = sum([x for x in lst if x >= threshold])\n            modified_lst.append(sum_greater)\n        else:\n            modified_lst.append(num)\n    return modified_lst\n", "entry_point": "modify_list", "input": "[6, 2, 8, 2, 1, 1], 6", "output": "[14, 2, 14, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28092_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006891", "code": "def weighted_avg(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"The lengths of numbers and weights must be equal.\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    return weighted_sum / total_weight\n", "entry_point": "weighted_avg", "input": "[3, 4], [4, 1]", "output": "3.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67800_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006892", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "[8, 9, 10, 7, 7, 8, 10, 10]", "output": "'8.9.10.7.7.8.10.10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006893", "code": "TARGET_CENTER = 'gear_target_details--center'\nX, Y = 0, 1  # Coordinate indices\nDESIRED_X_POSITION = 0.4\nDESIRED_Y_POSITION = 0.3\nCENTERING_X_TOLERANCE = 0.02\nCENTERING_Y_TOLERANCE = 0.02\nSPEEDS = {\n    'x_mostly_y': 0.3,\n    'xy': 0.4,\n    'y_only': 0.3,\n    'y_min': 0.1,\n    'y_max': 0.3,\n    'x_only': 0.5,\n    'x_bounds': 0.1\n}\ndef calculate_optimal_speed(current_position):\n    x, y = current_position\n    x_distance = abs(x - DESIRED_X_POSITION)\n    y_distance = abs(y - DESIRED_Y_POSITION)\n    if x_distance <= CENTERING_X_TOLERANCE and y_distance <= CENTERING_Y_TOLERANCE:\n        return SPEEDS['xy']\n    elif x_distance <= CENTERING_X_TOLERANCE:\n        return SPEEDS['x_only']\n    elif y_distance <= CENTERING_Y_TOLERANCE:\n        return SPEEDS['y_only']\n    elif x_distance > y_distance:\n        return SPEEDS['x_mostly_y']\n    else:\n        return SPEEDS['y_max']\n", "entry_point": "calculate_optimal_speed", "input": "(0.5, 0.3)", "output": "0.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97173_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8593", "output": "{1, 8593, 13, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006895", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[5, 9, 15], 10", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006896", "code": "def calculate_mode(numbers):\n    frequency_dict = {}\n    for num in numbers:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return min(modes)\n", "entry_point": "calculate_mode", "input": "[0, 0, 0, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48679_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006897", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = low + (high - low) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[1, 2, 3, 4], 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107830_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006898", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'print3'", "output": "('print3', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006899", "code": "# Simulated database table with sample data\ndatabase_table = {\n    (1, 101): True,\n    (2, 102): True,\n    (3, 103): False,\n    (4, 104): True,\n}\ndef get_article_author_id(article_id, author_id):\n    # Simulated database query to check if the combination exists\n    return 1 if database_table.get((article_id, author_id), False) else 0\n", "entry_point": "get_article_author_id", "input": "3, 103", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33510_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006900", "code": "def perform_operation(op, a, b):\n    if op == \"-\":\n        return a - b\n    if op == \"*\":\n        return a * b\n    if op == \"%\":\n        return a % b\n    if op == \"/\":\n        return int(a / b)\n    if op == \"&\":\n        return a & b\n    if op == \"|\":\n        return a | b\n    if op == \"^\":\n        return a ^ b\n    raise ValueError(\"Unsupported operator\")\n", "entry_point": "perform_operation", "input": "'-', 10, 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11513_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006901", "code": "def time_to_seconds(text):\n    time_units = text.split(\":\")\n    hours = int(time_units[0])\n    minutes = int(time_units[1])\n    seconds = int(time_units[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'22:30:45'", "output": "81045", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11606_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006902", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[4, 5, 5, 5]", "output": "[8, 15, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006903", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2956", "output": "{1, 2, 739, 4, 1478, 2956}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2955", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006904", "code": "def custom_split(data, delimiters):\n    result = []\n    current_substring = \"\"\n    for char in data:\n        if char in delimiters:\n            if current_substring:\n                result.append(current_substring)\n                current_substring = \"\"\n        else:\n            current_substring += char\n    if current_substring:\n        result.append(current_substring)\n    return result\n", "entry_point": "custom_split", "input": "'apple;bananarry.orangeb', ';'", "output": "['apple', 'bananarry.orangeb']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10049_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006905", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'https:ple.com', '/api/dat/'", "output": "'https:ple.com/api/dat/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4171", "output": "{1, 4171, 43, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006907", "code": "from typing import List\ndef access_control(user_id: int, command: str, authorized_users: List[int]) -> str:\n    if command in ['start', 'help']:\n        return \"All users are allowed to execute this command.\"\n    elif command == 'rnv':\n        if user_id in authorized_users:\n            return \"User is authorized to execute the 'rnv' command.\"\n        else:\n            return \"User is not authorized to execute the 'rnv' command.\"\n    else:\n        if user_id in authorized_users:\n            return \"User is authorized to execute this command.\"\n        else:\n            return \"User is not authorized to execute this command.\"\n", "entry_point": "access_control", "input": "3, 'delete', [1, 2]", "output": "'User is not authorized to execute this command.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20154_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006908", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "423", "output": "{1, 3, 423, 9, 141, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006909", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'image_withtag'", "output": "('image_withtag', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006910", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gge1'", "output": "[('gge1',)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006911", "code": "from typing import List, Tuple\nfrom numbers import Real\ndef find_unique_pairs(numbers: List[Real], target: Real) -> List[Tuple[Real, Real]]:\n    unique_pairs = set()\n    complements = set()\n    for num in numbers:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[4, 6, 1, 2, 3], 10", "output": "[(4, 6)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128394_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006912", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[8, 7, 2, 6, 2, 8, 7, 3]", "output": "[8, 8, 4, 9, 6, 13, 13, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006913", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1619", "output": "{1, 1619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006914", "code": "mod = 10 ** 9 + 7\ndef count_ways(S):\n    A = [0] * (S + 1)\n    A[0] = 1\n    for s in range(3, S + 1):\n        A[s] = (A[s-3] + A[s-1]) % mod\n    return A[S]\n", "entry_point": "count_ways", "input": "8", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7358_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006915", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4382", "output": "{1, 2, 7, 14, 2191, 626, 313, 4382}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006916", "code": "from typing import List\ndef find_first_duplicate(A: List[int]) -> int:\n    seen = set()\n    for num in A:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 4, 5]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55340_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006917", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'Worlad!'", "output": "['worlad']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006918", "code": "def retrieve_workset_data(workset):\n    result = {}\n    # Simulated data retrieval from \"worksets/name\" view\n    worksets_name_data = {\n        \"workset1\": {\"_id\": 1, \"_rev\": \"abc\", \"info\": \"data1\"},\n        \"workset2\": {\"_id\": 2, \"_rev\": \"def\", \"info\": \"data2\"}\n    }\n    # Simulated data retrieval from \"worksets/lims_id\" view\n    worksets_lims_id_data = {\n        \"workset1\": {\"_id\": 3, \"_rev\": \"ghi\", \"info\": \"data3\"},\n        \"workset2\": {\"_id\": 4, \"_rev\": \"jkl\", \"info\": \"data4\"}\n    }\n    # Fetch data from \"worksets/name\" view and process it\n    if workset in worksets_name_data:\n        result[workset] = worksets_name_data[workset]\n        result[workset].pop(\"_id\", None)\n        result[workset].pop(\"_rev\", None)\n    # If data is not found in the first view, fetch from \"worksets/lims_id\" view\n    if workset not in result and workset in worksets_lims_id_data:\n        result[workset] = worksets_lims_id_data[workset]\n        result[workset].pop(\"_id\", None)\n        result[workset].pop(\"_rev\", None)\n    return result\n", "entry_point": "retrieve_workset_data", "input": "'workset1'", "output": "{'workset1': {'info': 'data1'}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141692_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006919", "code": "def compare_versions(installed_version, recommended_version):\n    installed_parts = list(map(int, installed_version.split('.')))\n    recommended_parts = list(map(int, recommended_version.split('.')))\n    for i in range(3):  # Compare major, minor, patch versions\n        if installed_parts[i] < recommended_parts[i]:\n            return \"Outdated\"\n        elif installed_parts[i] > recommended_parts[i]:\n            return \"Newer version installed\"\n    return \"Up to date\"\n", "entry_point": "compare_versions", "input": "'1.1.0', '1.0.0'", "output": "'Newer version installed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51372_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006920", "code": "from typing import List\ndef find_longest_subarray_with_sum(nums: List[int], target_sum: int) -> List[int]:\n    sum_index_map = {0: -1}\n    current_sum = 0\n    max_length = 0\n    result = []\n    for i, num in enumerate(nums):\n        current_sum += num\n        if current_sum - target_sum in sum_index_map and i - sum_index_map[current_sum - target_sum] > max_length:\n            max_length = i - sum_index_map[current_sum - target_sum]\n            result = nums[sum_index_map[current_sum - target_sum] + 1:i + 1]\n        if current_sum not in sum_index_map:\n            sum_index_map[current_sum] = i\n    return result\n", "entry_point": "find_longest_subarray_with_sum", "input": "[3, 4, 1, 2, 5], 7", "output": "[4, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26568_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006921", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[1, 3, 5, 7, 9, 11], 2", "output": "[1, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006922", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8287", "output": "{1, 8287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8286", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006923", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[1, 2, 3, 6, 3, 1, 5, 3, 0]", "output": "[2, 3, 6, 3, 1, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006924", "code": "import re\ndef find_unsubstituted_variables(input_string):\n    unsubstituted_variables = []\n    # Find all occurrences of ${} patterns in the input string\n    variables = re.findall(r'\\${(.*?)}', input_string)\n    for var in variables:\n        # Check if the variable is wrapped with Fn::Sub\n        if f'Fn::Sub(\"${{{var}}}\")' not in input_string:\n            unsubstituted_variables.append(var)\n    return unsubstituted_variables\n", "entry_point": "find_unsubstituted_variables", "input": "'Hello ${to} worlds!'", "output": "['to']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131499_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006925", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'AAI', 'ifinity'", "output": "'AAI_ifi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006926", "code": "def extract_film_titles(films):\n    film_dict = {}\n    for film in films:\n        if \"id\" in film and \"title\" in film:\n            film_dict[film[\"id\"]] = film[\"title\"]\n    return film_dict\n", "entry_point": "extract_film_titles", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11850_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8533", "output": "{1, 161, 1219, 7, 371, 8533, 53, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006928", "code": "import re\ndef is_valid_import(statement: str) -> bool:\n    components = statement.split()\n    if len(components) < 2:\n        return False\n    if components[0] not in ['import', 'from']:\n        return False\n    module_name = components[1]\n    if not re.match(r'^[a-zA-Z_][a-zA-Z0-9_.]*$', module_name):\n        return False\n    if len(components) > 2 and components[2] == 'import':\n        if len(components) < 4 or components[3] != 'as':\n            return False\n        if len(components) < 5 or not re.match(r'^[a-zA-Z_][a-zA-Z0-9_]*$', components[4]):\n            return False\n    return True\n", "entry_point": "is_valid_import", "input": "'import'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47825_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006929", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "''", "output": "{'bytecode': '0x'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006930", "code": "def filter_sequences(dna_sequences, query_ids):\n    filtered_sequences = []\n    for sequence in dna_sequences:\n        for query_id in query_ids:\n            if query_id in sequence:\n                filtered_sequences.append(sequence)\n                break  # Break out of the inner loop once a match is found\n    return filtered_sequences\n", "entry_point": "filter_sequences", "input": "['seq1', 'seq2', 'notmatching'], ['seq1', 'seq2', 'other']", "output": "['seq1', 'seq2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48577_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006931", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "3", "output": "555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006932", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7066", "output": "{1, 7066, 2, 3533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006933", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 3, 7, 7, 0, 1, 7, 0]", "output": "[4, 4, 9, 10, 4, 6, 13, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006934", "code": "heightGrowableTypes = [\"BitmapCanvas\", \"CodeEditor\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"RadioGroup\", \"StaticBox\", \"TextArea\", \"Tree\"]\nwidthGrowableTypes = [\"BitmapCanvas\", \"CheckBox\", \"Choice\", \"CodeEditor\", \"ComboBox\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"PasswordField\", \"RadioGroup\", \"Spinner\", \"StaticBox\", \"StaticText\", \"TextArea\", \"TextField\", \"Tree\"]\ngrowableTypes = [\"Gauge\", \"Slider\", \"StaticLine\"]\ndef getGrowthBehavior(elementType):\n    if elementType in growableTypes:\n        return \"Both-growable\"\n    elif elementType in heightGrowableTypes:\n        return \"Height-growable\"\n    elif elementType in widthGrowableTypes:\n        return \"Width-growable\"\n    else:\n        return \"Not-growable\"\n", "entry_point": "getGrowthBehavior", "input": "'CodeEditor'", "output": "'Height-growable'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41927_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006935", "code": "def longest_increasing_subsequence(A):\n    T = [None] * len(A)\n    prev = [None] * len(A)\n    for i in range(len(A)):\n        T[i] = 1\n        prev[i] = -1\n        for j in range(i):\n            if A[j] < A[i] and T[i] < T[j] + 1:\n                T[i] = T[j] + 1\n                prev[i] = j\n    return max(T) if T else 0\n", "entry_point": "longest_increasing_subsequence", "input": "[10, 1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55167_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006936", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'(lHello)'", "output": "'lHello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006937", "code": "def generate_menu(sections, actions):\n    menu_structure = \"\"\n    for section_key, section_name in sections.items():\n        menu_structure += f\"- {section_name}\\n\"\n        for action_key, action_details in actions.items():\n            menu_structure += f\"  - {action_details['main']} ({action_details['sub']})\\n\"\n    return menu_structure\n", "entry_point": "generate_menu", "input": "{}, {}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102036_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006938", "code": "def calculate_average_score(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average_score", "input": "[75, 78, 79, 80, 85]", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57628_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006939", "code": "def process_registration_data(registration_data):\n    registered_users = {}\n    for user_data in registration_data:\n        if 'username' in user_data and 'password' in user_data and user_data['username'] and user_data['password']:\n            registered_users[user_data['username']] = user_data['password']\n    return registered_users\n", "entry_point": "process_registration_data", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88935_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006940", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "None, 3, [0, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006941", "code": "def sum_of_multiples_of_3_or_5(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in multiples_set:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples_of_3_or_5", "input": "[15, 20, 25]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33384_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6497", "output": "{73, 1, 6497, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006943", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers.\"\n    elif n == 0:\n        return 1\n    else:\n        return n * calculate_factorial(n - 1)\n", "entry_point": "calculate_factorial", "input": "3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139159_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006944", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3331", "output": "{1, 3331}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006945", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[1, 3, 12, 0, 0]", "output": "[1, 3, 12, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006946", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8347", "output": "{1, 8347, 17, 491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006947", "code": "import re\ndef is_valid_filename(filename: str) -> bool:\n    if not filename or len(filename) > 255:\n        return False\n    # Regular expression to match valid filename rules\n    pattern = r\"^[^/\\\\:*?\\\"<>|.\\s][^/\\\\:*?\\\"<>|\\r\\n]*[^/\\\\:*?\\\"<>|.\\s]$\"\n    return bool(re.match(pattern, filename))\n", "entry_point": "is_valid_filename", "input": "'example_file.txt'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65220_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006948", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documents/file.t'", "output": "('local', 'documents/file.t')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006949", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3814", "output": "{1, 2, 1907, 3814}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3813", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006950", "code": "def check_asset_match(subset_instance_asset, workspace_asset):\n    return subset_instance_asset == workspace_asset\n", "entry_point": "check_asset_match", "input": "1, 2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146098_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "610", "output": "{1, 610, 2, 5, 10, 305, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt609", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006952", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[10, [15, 30]]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006953", "code": "# Predefined DNS mapping\ndns_mapping = {\n    \"www.example.com\": \"192.168.1.1\",\n    \"mail.example.com\": \"192.168.1.2\",\n    \"ftp.example.com\": \"192.168.1.3\"\n}\ndef resolve_dns(query_domain):\n    if query_domain in dns_mapping:\n        return dns_mapping[query_domain]\n    else:\n        return \"Domain not found\"\n", "entry_point": "resolve_dns", "input": "'www.example.com'", "output": "'192.168.1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141450_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006954", "code": "import re\nimport keyword\ndef extract_external_modules(script):\n    external_modules = set()\n    standard_library_modules = set(dir(__import__('os')))\n    import_pattern = r'import\\s+([\\w, ]+)'\n    from_pattern = r'from\\s+([\\w.]+)\\s+import'\n    import_matches = re.findall(import_pattern, script)\n    from_matches = re.findall(from_pattern, script)\n    all_matches = import_matches + from_matches\n    for match in all_matches:\n        modules = [m.strip() for m in match.split(',')]\n        for module in modules:\n            module_name = module.split('.')[0]\n            if module_name not in keyword.kwlist and module_name not in standard_library_modules:\n                external_modules.add(module_name)\n    return list(external_modules)\n", "entry_point": "extract_external_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142999_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006955", "code": "def concat_first_last_chars(strings):\n    result = []\n    for string in strings:\n        concatenated = string[0] + string[-1]\n        result.append(concatenated)\n    return result\n", "entry_point": "concat_first_last_chars", "input": "['abc', 'def', 'xyz']", "output": "['ac', 'df', 'xz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109926_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006956", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6813", "output": "{1, 3, 9, 757, 6813, 2271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006957", "code": "def find_max_xor(L, R):\n    xor = L ^ R\n    max_xor = 1\n    while xor:\n        xor >>= 1\n        max_xor <<= 1\n    return max_xor - 1\n", "entry_point": "find_max_xor", "input": "0, 15", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120767_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006958", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5554", "output": "{1, 5554, 2, 2777}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5553", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006959", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1913", "output": "{1, 1913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006960", "code": "def is_possible_path(H, W, grid):\n    obstacles = 0\n    for i in range(H):\n        for j in range(W):\n            if grid[i][j] == '#':\n                obstacles += 1\n    if obstacles == 0:\n        return 'Possible'\n    else:\n        return 'Impossible'\n", "entry_point": "is_possible_path", "input": "3, 3, [['.', '.', '.'], ['#', '.', '.'], ['.', '.', '.']]", "output": "'Impossible'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19495_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006961", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    excluded_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(excluded_scores)\n    average = total / len(excluded_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[65, 66, 69, 72, 80]", "output": "69.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103708_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006962", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "9876, 4", "output": "'9876'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006963", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'hello world'", "output": "'HeLlO WoRlD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7399", "output": "{1, 1057, 7, 7399, 49, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006965", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average", "input": "[80, 90, 92, 94, 100]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143747_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006966", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "0.154", "output": "7.7e-05", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006967", "code": "def min_trips(k, weights):\n    total_trips = sum((x + k - 1) // k for x in weights)\n    min_trips_needed = (total_trips + 1) // 2\n    return min_trips_needed\n", "entry_point": "min_trips", "input": "3, [3, 3, 3, 3, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5487_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006968", "code": "def parse_vm_info(input_str):\n    vm_info = {}\n    entries = input_str.split('^')\n    for entry in entries:\n        vm_name, ip_address = entry.split(':')\n        vm_info[vm_name] = ip_address\n    return vm_info\n", "entry_point": "parse_vm_info", "input": "'VM1:.168.1.2^VM3VM1:.168.13'", "output": "{'VM1': '.168.1.2', 'VM3VM1': '.168.13'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46533_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006969", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[-1]", "output": "{-1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006970", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[4, 4, 4]", "output": "{4: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006971", "code": "def serviceLane(width, cases):\n    result = []\n    for case in cases:\n        start, end = case\n        segment = width[start:end+1]\n        min_width = min(segment)\n        result.append(min_width)\n    return result\n", "entry_point": "serviceLane", "input": "[1, 2, 1, 2, 1], [(0, 1), (1, 3), (2, 4)]", "output": "[1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129083_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006972", "code": "def are_anagrams(str1, str2):\n    str1 = str1.replace(\" \", \"\").lower()\n    str2 = str2.replace(\" \", \"\").lower()\n    if len(str1) != len(str2):\n        return False\n    char_freq1 = {}\n    char_freq2 = {}\n    for char in str1:\n        char_freq1[char] = char_freq1.get(char, 0) + 1\n    for char in str2:\n        char_freq2[char] = char_freq2.get(char, 0) + 1\n    return char_freq1 == char_freq2\n", "entry_point": "are_anagrams", "input": "'hello', 'world'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40214_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "339", "output": "{3, 1, 339, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006974", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006975", "code": "def calculate_7_day_avg(daily_cases):\n    moving_averages = []\n    for i in range(len(daily_cases)):\n        if i < 6:\n            moving_averages.append(0)  # Append 0 for days with insufficient data\n        else:\n            avg = sum(daily_cases[i-6:i+1]) / 7\n            moving_averages.append(avg)\n    return moving_averages\n", "entry_point": "calculate_7_day_avg", "input": "[0, 0, 0, 0, 0, 0, 2151.0]", "output": "[0, 0, 0, 0, 0, 0, 307.2857142857143]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43237_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006976", "code": "def validate_output_format(user_output_format: str, supported_formats: list) -> bool:\n    return user_output_format in supported_formats\n", "entry_point": "validate_output_format", "input": "'json', ['json', 'xml', 'csv']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141344_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006977", "code": "def process_string(input_string):\n    if \"apple\" in input_string:\n        input_string = input_string.replace(\"apple\", \"orange\")\n    if \"banana\" in input_string:\n        input_string = input_string.replace(\"banana\", \"\")\n    if \"cherry\" in input_string:\n        input_string = input_string.replace(\"cherry\", \"CHERRY\")\n    return input_string\n", "entry_point": "process_string", "input": "'aaIa'", "output": "'aaIa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133930_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006978", "code": "import math\ndef min_sum_pair(n):\n    dist = n\n    for i in range(1, math.floor(math.sqrt(n)) + 1):\n        if n % i == 0:\n            j = n // i\n            dist = min(dist, i + j - 2)\n    return dist\n", "entry_point": "min_sum_pair", "input": "14", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134268_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006979", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'120.1211', 8083", "output": "'http://120.1211:8083'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006980", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 3", "output": "28.274333882308138", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006981", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "2, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt49", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006982", "code": "def find_equal(lst):\n    seen = {}  # Dictionary to store elements and their indices\n    for i, num in enumerate(lst):\n        if num in seen:\n            return (seen[num], i)  # Return the indices of the first pair of equal elements\n        seen[num] = i\n    return None  # Return None if no pair of equal elements is found\n", "entry_point": "find_equal", "input": "[1, 2, 3, 3]", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51954_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006983", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7864", "output": "{1, 2, 4, 8, 1966, 983, 7864, 3932}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7863", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006984", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[70, 88, 85, 84]", "output": "[88, 85, 84]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006985", "code": "from typing import List, Tuple\nimport re\ndef extract_authors_contributors(source_code: str) -> List[Tuple[str, str]]:\n    match = re.search(r'\"\"\"(.*?)\"\"\"', source_code, re.DOTALL)\n    if match:\n        notice_section = match.group(1)\n        authors_contributors = re.findall(r'(\\w+)\\s+\\(([\\w@.,]+)\\)', notice_section)\n        return authors_contributors\n    else:\n        return []\n", "entry_point": "extract_authors_contributors", "input": "'This is a source code without any author information.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93658_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006986", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name based on the structure of the import statement\n    if components[0] == 'import':\n        # Case: import module\n        return components[1]\n    elif components[0] == 'from':\n        # Case: from package.module import something\n        return '.'.join(components[1:-2])\n", "entry_point": "extract_module_name", "input": "'from  import something'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120486_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006987", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 1, 1]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006988", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'datall.jso', None", "output": "('datall.jso', 'datall.jso')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006989", "code": "def parse_allowed_tags(input_string):\n    tag_dict = {}\n    tag_list = input_string.split()\n    for tag in tag_list:\n        tag_parts = tag.split(':')\n        tag_name = tag_parts[0]\n        attributes = tag_parts[1:] if len(tag_parts) > 1 else []\n        tag_dict[tag_name] = attributes\n    return tag_dict\n", "entry_point": "parse_allowed_tags", "input": "'a:hretledlel'", "output": "{'a': ['hretledlel']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14310_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006990", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3664", "output": "'1 hr 1 min 4 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006991", "code": "from typing import List\ndef filter_events_by_type(events: List[dict], target_event_type: str) -> List[dict]:\n    filtered_events = []\n    for event in events:\n        if event.get(\"event_type\") == target_event_type:\n            filtered_events.append(event)\n    return filtered_events\n", "entry_point": "filter_events_by_type", "input": "[], 'some_event_type'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56915_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006992", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'helhoware;yhu'", "output": "['helhoware', 'yhu']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006993", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "24, 12", "output": "2704156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt34", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006994", "code": "def calculate_pages(total_items, items_per_page, max_items_per_page):\n    if total_items <= items_per_page:\n        return 1\n    elif total_items <= max_items_per_page:\n        return -(-total_items // items_per_page)  # Ceiling division to handle remaining items\n    else:\n        return -(-total_items // max_items_per_page)  # Ceiling division based on max items per page\n", "entry_point": "calculate_pages", "input": "10, 5, 10", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143482_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006995", "code": "def extract_version(import_string):\n    for line in import_string.split('\\n'):\n        if 'from toraman.version import __version__' in line:\n            version_start = line.find('__version__')\n            version_end = line.rfind('__version__') + len('__version__')\n            version_number = line[version_start:version_end]\n            return version_number\n", "entry_point": "extract_version", "input": "'from toraman.version import __version__'", "output": "'__version__'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1355_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006996", "code": "def find_missing_number(arr):\n    n = len(arr)\n    sum_of_arr = sum(arr)\n    sum_of_n_no = (n * (n + 1)) // 2\n    missing_number = sum_of_n_no - sum_of_arr\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97333_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006997", "code": "def extract_base_directory(file_path):\n    base_dir = \"\"\n    for i in range(len(file_path) - 1, -1, -1):\n        if file_path[i] == '/':\n            base_dir = file_path[:i]\n            break\n    return base_dir\n", "entry_point": "extract_base_directory", "input": "'/home/user/somefile.txt'", "output": "'/home/user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67520_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006998", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[93, 93, 93, 93, 93]", "output": "93.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0006999", "code": "from itertools import combinations\ndef find_largest_triangle_area(points):\n    def triangle_area(x1, y1, x2, y2, x3, y3):\n        return abs(x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2) / 2\n    max_area = 0\n    for (x1, y1), (x2, y2), (x3, y3) in combinations(points, 3):\n        area = triangle_area(x1, y1, x2, y2, x3, y3)\n        max_area = max(max_area, area)\n    return max_area\n", "entry_point": "find_largest_triangle_area", "input": "[(0, 0), (4, 0), (0, 7)]", "output": "14.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93237_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007000", "code": "import re\ndef extract_translations(ui_translation_func):\n    translations = {}\n    pattern = r'_translate\\(\"([^\"]+)\", \"([^\"]+)\"\\)'\n    matches = re.findall(pattern, ui_translation_func)\n    for key, value in matches:\n        if value in translations:\n            translations[value].append(key)\n        else:\n            translations[value] = [key]\n    return translations\n", "entry_point": "extract_translations", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57396_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007001", "code": "from collections import defaultdict\ndef close_files_in_order(file_names):\n    graph = defaultdict(list)\n    for i in range(len(file_names) - 1):\n        graph[file_names[i]].append(file_names[i + 1])\n    def topological_sort(node, visited, stack):\n        visited.add(node)\n        for neighbor in graph[node]:\n            if neighbor not in visited:\n                topological_sort(neighbor, visited, stack)\n        stack.append(node)\n    visited = set()\n    stack = []\n    for file_name in file_names:\n        if file_name not in visited:\n            topological_sort(file_name, visited, stack)\n    return stack[::-1]\n", "entry_point": "close_files_in_order", "input": "['file3', 'file1', 'file2']", "output": "['file3', 'file1', 'file2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25686_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007002", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 10, 9]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18834_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007003", "code": "from typing import List\ndef check_square_pattern(lst: List[int]) -> bool:\n    for i in range(len(lst) - 1):\n        if lst[i+1] != lst[i] ** 2:\n            return False\n    return True\n", "entry_point": "check_square_pattern", "input": "[2, 5]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58073_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007004", "code": "from typing import Union, List\ndef parse_driving_envs(driving_environments: str) -> Union[str, List[str]]:\n    driving_environments = driving_environments.split(',')\n    for driving_env in driving_environments:\n        if len(driving_env.split('_')) < 2:\n            raise ValueError(f'Invalid format for the driving environment {driving_env} (should be Suite_Town)')\n    if len(driving_environments) == 1:\n        return driving_environments[0]\n    return driving_environments\n", "entry_point": "parse_driving_envs", "input": "'Suite1_ow1'", "output": "'Suite1_ow1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141849_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007005", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4975", "output": "{1, 995, 5, 199, 4975, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4974", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007006", "code": "def calculate_string_difference(str1, str2):\n    len1, len2 = len(str1), len(str2)\n    max_len = max(len1, len2)\n    diff_count = 0\n    for i in range(max_len):\n        char1 = str1[i] if i < len1 else None\n        char2 = str2[i] if i < len2 else None\n        if char1 != char2:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_string_difference", "input": "'hello', 'hallo'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32682_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007007", "code": "def generate_event_log(event_type, app_name):\n    event_messages = {\n        \"eAlgoLog\": \"eAlgoLog event occurred\",\n        \"eAlgoSetting\": \"eAlgoSetting event occurred\",\n        \"eAlgoVariables\": \"eAlgoVariables event occurred\",\n        \"eAlgoParameters\": \"eAlgoParameters event occurred\"\n    }\n    if event_type in event_messages:\n        return f\"{app_name} - {event_messages[event_type]}\"\n    else:\n        return \"Invalid event type\"\n", "entry_point": "generate_event_log", "input": "'someInvalidType', 'MyApp'", "output": "'Invalid event type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57908_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007008", "code": "def modified_insertion_sort(arr):\n    def insertion_sort(arr):\n        for i in range(1, len(arr)):\n            key = arr[i]\n            j = i - 1\n            while j >= 0 and arr[j] > key:\n                arr[j + 1] = arr[j]\n                j -= 1\n            arr[j + 1] = key\n    sorted_arr = []\n    positive_nums = [num for num in arr if num > 0]\n    insertion_sort(positive_nums)\n    pos_index = 0\n    for num in arr:\n        if num > 0:\n            sorted_arr.append(positive_nums[pos_index])\n            pos_index += 1\n        else:\n            sorted_arr.append(num)\n    return sorted_arr\n", "entry_point": "modified_insertion_sort", "input": "[3, 2, 6, 0, 2, 0, 3, 2]", "output": "[2, 2, 2, 0, 3, 0, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66384_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007009", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8351", "output": "{1, 1193, 7, 8351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007010", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1609", "output": "{1609, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007011", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "2", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007012", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007013", "code": "def count_posts_per_author(posts):\n    author_post_count = {}\n    for post in posts:\n        author = post['author']\n        author_post_count[author] = author_post_count.get(author, 0) + 1\n    return author_post_count\n", "entry_point": "count_posts_per_author", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007014", "code": "from typing import List, Optional\ndef most_frequent_element(lst: List[int]) -> Optional[int]:\n    if not lst:\n        return None\n    freq_count = {}\n    max_freq = 0\n    most_freq_element = None\n    for num in lst:\n        freq_count[num] = freq_count.get(num, 0) + 1\n        if freq_count[num] > max_freq:\n            max_freq = freq_count[num]\n            most_freq_element = num\n    return most_freq_element\n", "entry_point": "most_frequent_element", "input": "[1, 2, 3, 3, 3, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62206_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007015", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[5, 3, 1, 2, 3, 2, 1]", "output": "[8, 4, 3, 5, 5, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007016", "code": "from typing import List, Dict\ndef get_flower_names(labels: List[int], label_to_name: Dict[int, str]) -> List[str]:\n    flower_names = []\n    for label in labels:\n        flower_names.append(label_to_name.get(label, \"Unknown\"))\n    return flower_names\n", "entry_point": "get_flower_names", "input": "[1, 2, 3, 4], {}", "output": "['Unknown', 'Unknown', 'Unknown', 'Unknown']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54604_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007017", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "252, 162, 0", "output": "'#FCA200'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007018", "code": "def count_unique_css_properties(css_snippet):\n    css_properties = set()\n    # Split the CSS snippet into lines\n    lines = css_snippet.split('\\n')\n    # Extract CSS properties from each line\n    for line in lines:\n        if ':' in line:\n            property_name = line.split(':')[0].strip()\n            css_properties.add(property_name)\n    # Count the unique CSS properties\n    unique_properties_count = len(css_properties)\n    return unique_properties_count\n", "entry_point": "count_unique_css_properties", "input": "'color: blue;'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117190_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007019", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    sum_scores = sum(scores) - min_score\n    return sum_scores / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[75, 80, 78, 70, 80]", "output": "78.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82119_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007020", "code": "def final_coordinates(routes):\n    x, y = 0, 0  # Initialize traveler's coordinates\n    for route in routes:\n        for direction in route:\n            if direction == 'N':\n                y += 1\n            elif direction == 'S':\n                y -= 1\n            elif direction == 'E':\n                x += 1\n            elif direction == 'W':\n                x -= 1\n    return (x, y)\n", "entry_point": "final_coordinates", "input": "[['N', 'W']]", "output": "(-1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23024_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2813", "output": "{1, 29, 2813, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007022", "code": "def extract_cookies(cookies):\n    cookie_dict = {}\n    cookie_pairs = cookies.split(';')\n    for pair in cookie_pairs:\n        pair = pair.strip()  # Remove leading/trailing whitespaces\n        if pair:\n            key, value = pair.split('=', 1)\n            cookie_dict[key] = value\n    return cookie_dict\n", "entry_point": "extract_cookies", "input": "'__utmb=30149280.2.10.162521d144'", "output": "{'__utmb': '30149280.2.10.162521d144'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120315_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007023", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[4, 4, 4, 4, 1, 2, 3]", "output": "(4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007024", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84684_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007025", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/home/user/projects', '/home/user'", "output": "'../.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007026", "code": "def slice_list(lst, start=None, end=None):\n    if start is not None and end is not None:\n        return lst[start:end]\n    elif start is not None:\n        return lst[start:]\n    elif end is not None:\n        return lst[:end]\n    else:\n        return lst\n", "entry_point": "slice_list", "input": "[10, 30, 20, 100, 40, 50], 1, 5", "output": "[30, 20, 100, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93892_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007027", "code": "import os\ndef find_zip_or_egg_index(filename):\n    normalized_path = os.path.normpath(filename)\n    zip_index = normalized_path.find('.zip')\n    egg_index = normalized_path.find('.egg')\n    if zip_index != -1 and egg_index != -1:\n        return min(zip_index, egg_index)\n    elif zip_index != -1:\n        return zip_index\n    elif egg_index != -1:\n        return egg_index\n    else:\n        return -1\n", "entry_point": "find_zip_or_egg_index", "input": "'file.txt'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_581_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007028", "code": "def sum_squared_differences(arr1, arr2):\n    total_diff = 0\n    for a, b in zip(arr1, arr2):\n        total_diff += (a - b) ** 2\n    return total_diff\n", "entry_point": "sum_squared_differences", "input": "[1, 0], [0, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76760_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3058", "output": "{1, 2, 11, 139, 3058, 278, 22, 1529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3057", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007030", "code": "from typing import List\ndef single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "single_number", "input": "[3, 3, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118847_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007031", "code": "def tidy_objects(objects):\n    pushed_objects = []\n    for obj_name, in_container in objects:\n        if not in_container:\n            pushed_objects.append(obj_name)\n    return pushed_objects\n", "entry_point": "tidy_objects", "input": "[('object1', False), ('object2', False)]", "output": "['object1', 'object2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141612_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007032", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1735", "output": "{1, 347, 5, 1735}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1734", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007033", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[1, 1, 3, 4, 6, 6]", "output": "'1-3-4-6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007034", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'xexample.m:443'", "output": "('https', 'xexample.m', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007035", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[50, 45, 40, 0], 5", "output": "135", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8457", "output": "{2819, 1, 3, 8457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007037", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "287", "output": "{1, 7, 41, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt286", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007038", "code": "from typing import List\ndef most_frequent_item_id(item_ids: List[int]) -> int:\n    frequency = {}\n    for item_id in item_ids:\n        frequency[item_id] = frequency.get(item_id, 0) + 1\n    max_frequency = max(frequency.values())\n    most_frequent_ids = [item_id for item_id, freq in frequency.items() if freq == max_frequency]\n    return min(most_frequent_ids)\n", "entry_point": "most_frequent_item_id", "input": "[1, 1, 2, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7393_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007039", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'CC'", "output": "['CC', 'CC']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007040", "code": "def calculate_sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum_multiples", "input": "11", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15183_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007041", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.22.62', 117", "output": "'2.22.62.117'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007042", "code": "def extract_frames(lidar_data, start_value):\n    frames = []\n    frame = []\n    for val in lidar_data:\n        if val == start_value:\n            if frame:\n                frames.append(frame)\n                frame = []\n        frame.append(val)\n    if frame:\n        frames.append(frame)\n    return frames\n", "entry_point": "extract_frames", "input": "[4, 5, 4, 1, 4, 5, 3, 2, 5], 4", "output": "[[4, 5], [4, 1], [4, 5, 3, 2, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007043", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'0.70.0'", "output": "(0, 70, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007044", "code": "def basic_calculator(num1, num2, operator):\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n    elif operator == '*':\n        return num1 * num2\n    elif operator == '/':\n        if num2 == 0:\n            return \"Error: Division by zero is not allowed.\"\n        else:\n            return num1 / num2\n    else:\n        return \"Error: Invalid operator\"\n", "entry_point": "basic_calculator", "input": "10, 5, '+'", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81801_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007045", "code": "import re\ndef is_password_strong(password):\n    if len(password) < 8:\n        return False\n    if not any(char.isupper() for char in password):\n        return False\n    if not any(char.islower() for char in password):\n        return False\n    if not any(char.isdigit() for char in password):\n        return False\n    if not any(char in '!@#$%^&*()-_+=' for char in password):\n        return False\n    return True\n", "entry_point": "is_password_strong", "input": "'A1b!cdef'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102271_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007046", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9578", "output": "{1, 9578, 2, 4789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9577", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007047", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7141", "output": "{1, 37, 193, 7141}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007048", "code": "def filter_objects(objects, key, value):\n    filtered_list = []\n    for obj in objects:\n        if key in obj and obj[key] == value:\n            filtered_list.append(obj)\n    return filtered_list\n", "entry_point": "filter_objects", "input": "[{'name': 'Alice'}, {'age': 30}], 'id', 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111424_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007049", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "10, 18", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007050", "code": "def calculate_balance(initial_balance, transactions, account_id):\n    balances = {account_id: initial_balance}\n    for account, amount in transactions:\n        if account not in balances:\n            balances[account] = 0\n        balances[account] += amount\n    return balances.get(account_id, 0)\n", "entry_point": "calculate_balance", "input": "10, [('account_id', 10)], 'account_id'", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007051", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'B'", "output": "'tonga.cashregister.event.BCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007052", "code": "def sum_multiples_of_3_and_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_and_5", "input": "[15, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135269_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007053", "code": "def simulate_file_system(commands):\n    file_system = {}\n    for command in commands:\n        operation, path = command.split()\n        if operation == \"touch\":\n            file_system[path] = True\n        elif operation == \"rm\" and path in file_system:\n            del file_system[path]\n    return file_system\n", "entry_point": "simulate_file_system", "input": "['touch file1', 'rm file1']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115194_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007054", "code": "_FREEZE_START = 1639641600\n_FREEZE_END = 1641196800\ndef check_freeze_period(timestamp):\n    return _FREEZE_START <= timestamp <= _FREEZE_END\n", "entry_point": "check_freeze_period", "input": "1639640000", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65214_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007055", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'\\nLinie\\n'", "output": "[['Linie']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007056", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 0, 3, 1, 2, 1, 1]", "output": "[0, 3, 4, 3, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007057", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9762", "output": "{1, 9762, 3, 2, 6, 4881, 3254, 1627}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007058", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[20, 1, 8, 3]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30353_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007059", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 87, 85, 80, 75, 75]", "output": "[100, 87, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007060", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "9", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4669", "output": "{1, 161, 7, 203, 29, 23, 667, 4669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007062", "code": "def transform_sql_query(sql_query):\n    modified_query = sql_query.replace(\"select\", \"SELECT\").replace(\"from\", \"FROM\").replace(\"where\", \"WHERE\")\n    return modified_query\n", "entry_point": "transform_sql_query", "input": "'select * from eudta.f000'", "output": "'SELECT * FROM eudta.f000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96099_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007063", "code": "ERROR_CLONE_IN_QUARANTINE = \"Database in quarantine cannot be cloned\"\nERROR_CLONE_NOT_ALIVE = \"Database is not alive and cannot be cloned\"\nERROR_DELETE_PROTECTED = \"Database {} is protected and cannot be deleted\"\nERROR_DELETE_DEAD = \"Database {} is not alive and cannot be deleted\"\nERROR_UPGRADE_MONGO24 = \"MongoDB 2.4 cannot be upgraded by this task.\"\nERROR_UPGRADE_IN_QUARANTINE = \"Database in quarantine and cannot be upgraded.\"\nERROR_UPGRADE_IS_DEAD = \"Database is dead and cannot be upgraded.\"\nERROR_UPGRADE_NO_EQUIVALENT_PLAN = \"Source plan do not has equivalent plan to upgrade.\"\ndef get_action(error_message):\n    error_to_action = {\n        ERROR_CLONE_IN_QUARANTINE: \"No action needed\",\n        ERROR_CLONE_NOT_ALIVE: \"No action needed\",\n        ERROR_DELETE_PROTECTED: \"No action needed\",\n        ERROR_DELETE_DEAD: \"No action needed\",\n        ERROR_UPGRADE_MONGO24: \"No action needed\",\n        ERROR_UPGRADE_IN_QUARANTINE: \"No action needed\",\n        ERROR_UPGRADE_IS_DEAD: \"No action needed\",\n        ERROR_UPGRADE_NO_EQUIVALENT_PLAN: \"No action needed\",\n    }\n    if error_message in error_to_action:\n        return error_to_action[error_message]\n    elif error_message.startswith(\"Database\"):\n        return \"No action needed\"\n    else:\n        return \"Unknown error message\"\n", "entry_point": "get_action", "input": "'Random error occurred'", "output": "'Unknown error message'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71785_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007064", "code": "def calculate_total_balance(accounts, owner):\n    total_balance = 0\n    for account in accounts:\n        if account['owner'] == owner:\n            total_balance += account['balance']\n    return total_balance\n", "entry_point": "calculate_total_balance", "input": "[], 'Charlie'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86383_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007065", "code": "def firstDuplicateValue(array):\n    for n in array:\n        n = abs(n)\n        if array[n - 1] < 0:\n            return n\n        array[n - 1] *= -1\n    return -1\n", "entry_point": "firstDuplicateValue", "input": "[1, 2, 3, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124309_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007066", "code": "def count_unique_words(input_list):\n    unique_word_counts = {}\n    for string in input_list:\n        words = string.split()\n        unique_words = set(word.lower() for word in words)\n        unique_word_counts[string] = len(unique_words)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "['r!', 'r!!world', 'r!!worldh']", "output": "{'r!': 1, 'r!!world': 1, 'r!!worldh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123350_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007067", "code": "def count_storage_operations(storage_operations):\n    operation_counts = {}\n    for code in storage_operations:\n        if code in operation_counts:\n            operation_counts[code] += 1\n        else:\n            operation_counts[code] = 1\n    return operation_counts\n", "entry_point": "count_storage_operations", "input": "[99, 99, 106, 103, 103, 100, 100]", "output": "{99: 2, 106: 1, 103: 2, 100: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69426_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007068", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "1", "output": "'T__0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8177", "output": "{1, 481, 37, 13, 8177, 17, 629, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007070", "code": "def min_steps_to_reach_farthest_position(positions):\n    if not positions:\n        return 0\n    n = len(positions)\n    if n == 1:\n        return 0\n    farthest = positions[0]\n    max_jump = positions[0]\n    steps = 1\n    for i in range(1, n):\n        if i > farthest:\n            return -1\n        if i > max_jump:\n            max_jump = farthest\n            steps += 1\n        farthest = max(farthest, i + positions[i])\n    return steps\n", "entry_point": "min_steps_to_reach_farthest_position", "input": "[0, 0, 0]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73765_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007071", "code": "def is_numeric(txt):\n    '''Confirms that the text is numeric'''\n    out = len(txt)\n    allowed_chars = set('0123456789-$%+.')  # Define the set of allowed characters\n    allowed_last_chars = set('1234567890%')  # Define the set of allowed last characters\n    for c in txt:\n        if c not in allowed_chars:\n            out = False\n            break\n    if out and txt[-1] not in allowed_last_chars:\n        out = False\n    return out\n", "entry_point": "is_numeric", "input": "'12.3%'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94372_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007072", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[2, 0, 0, 0], 'subtract'", "output": "[2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2739", "output": "{1, 33, 3, 11, 913, 2739, 83, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007074", "code": "def calculate_coverage_percentage(executed_lines):\n    total_lines = 10  # Total number of unique lines in the code snippet\n    executed_lines = set(executed_lines)  # Convert executed lines to a set for uniqueness\n    executed_unique_lines = len(executed_lines)  # Number of unique lines executed\n    coverage_percentage = int((executed_unique_lines / total_lines) * 100)  # Calculate coverage percentage\n    return coverage_percentage\n", "entry_point": "calculate_coverage_percentage", "input": "[1, 2, 3, 4]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8427_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007075", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'.atex!'", "output": "['atex']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007076", "code": "def find_mismatched_elements(input_list):\n    mismatched_elements = [(index, value) for index, value in enumerate(input_list) if index != value]\n    return mismatched_elements\n", "entry_point": "find_mismatched_elements", "input": "[0, 3, 2, 5]", "output": "[(1, 3), (3, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128835_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007077", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'hhhap'", "output": "'Binary path for hhhap not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007078", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    i = 1\n    while i < len(nums):\n        if nums[i-1] == nums[i]:\n            nums.pop(i)\n            continue\n        i += 1\n    return len(nums)\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 3, 4, 5, 5, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119722_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007079", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average", "input": "[80, 81, 82, 90]", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114673_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007080", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4426", "output": "{1, 4426, 2, 2213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007081", "code": "def longest_consecutive_sequence_length(nums):\n    if not nums:\n        return 0\n    longest_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n            longest_length = max(longest_length, current_length)\n        else:\n            current_length = 1\n    return longest_length\n", "entry_point": "longest_consecutive_sequence_length", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119725_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007082", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'Is'", "output": "{'is': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007083", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 12]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89201_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007084", "code": "import re\ndef clean_query(query: str) -> dict:\n    cleaned_query = query.upper()\n    if re.match(r'^AS\\d+$', cleaned_query):\n        return {\"cleanedValue\": cleaned_query, \"category\": \"asn\"}\n    elif cleaned_query.isalnum():\n        return {\"cleanedValue\": cleaned_query, \"category\": \"as-set\"}\n    else:\n        return {\"error\": \"Invalid query. A valid prefix is required.\"}\n", "entry_point": "clean_query", "input": "'foobar'", "output": "{'cleanedValue': 'FOOBAR', 'category': 'as-set'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106273_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8755", "output": "{1, 515, 5, 103, 17, 8755, 85, 1751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007086", "code": "import re\ndef parse_migration_code(migration_code):\n    dependencies = re.findall(r\"'(\\w+)',\\s*'(\\w+)'\", migration_code)\n    operations = re.findall(r\"migrations\\.(\\w+)\\(.*?model_name='(\\w+)'.*?name='(\\w+)'\", migration_code)\n    dependency_operations = {dep: [] for dep in dependencies}\n    for operation, model_name, operation_name in operations:\n        dependency = next((dep[0] for dep in dependencies if dep[1] == model_name), None)\n        if dependency:\n            dependency_operations[dependency].append(f\"{operation}: {model_name}.{operation_name}\")\n    return dependency_operations\n", "entry_point": "parse_migration_code", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95831_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007087", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5703", "output": "{1, 3, 1901, 5703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007088", "code": "def analyze_list(lst):\n    total = len(lst)\n    even_count = sum(1 for num in lst if num % 2 == 0)\n    total_sum = sum(lst)\n    return {'Total': total, 'Even': even_count, 'Sum': total_sum}\n", "entry_point": "analyze_list", "input": "[2, 4, 1, 3, 5, 5]", "output": "{'Total': 6, 'Even': 2, 'Sum': 20}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93656_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007089", "code": "import re\n# Dictionary mapping incorrect function names to correct function names\nfunction_mapping = {\n    'prit': 'print'\n}\ndef correct_function_names(code_snippet):\n    # Regular expression pattern to match function names\n    pattern = r'\\b(' + '|'.join(re.escape(key) for key in function_mapping.keys()) + r')\\b'\n    # Replace incorrect function names with correct function names\n    corrected_code = re.sub(pattern, lambda x: function_mapping[x.group()], code_snippet)\n    return corrected_code\n", "entry_point": "correct_function_names", "input": "'to'", "output": "'to'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116715_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007090", "code": "def most_frequent_word(text):\n    word_freq = {}\n    # Split the text into individual words\n    words = text.split()\n    # Count the frequency of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    # Find the word with the highest frequency\n    most_frequent = max(word_freq, key=word_freq.get)\n    return most_frequent, word_freq[most_frequent]\n", "entry_point": "most_frequent_word", "input": "'hello hello goodbye'", "output": "('hello', 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51755_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007091", "code": "def find_smallest_divisible_number(digit1: int, digit2: int, k: int) -> int:\n    MAX_NUM_OF_DIGITS = 10\n    INT_MAX = 2**31-1\n    if digit1 < digit2:\n        digit1, digit2 = digit2, digit1\n    total = 2\n    for l in range(1, MAX_NUM_OF_DIGITS+1):\n        for mask in range(total):\n            curr, bit = 0, total>>1\n            while bit:\n                curr = curr*10 + (digit1 if mask&bit else digit2)\n                bit >>= 1\n            if k < curr <= INT_MAX and curr % k == 0:\n                return curr\n        total <<= 1\n    return -1\n", "entry_point": "find_smallest_divisible_number", "input": "3, 6, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7656_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007092", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[5, 5, 4, 6, 3, 6, 4, 3]", "output": "[5, 4, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007093", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'xeexeeee', 'g1e1e1ggame12a323'", "output": "'ws://xeexeeee/g1e1e1ggame12a323/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007094", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[90, 90, 90, 85, 83]", "output": "87.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007095", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'app.config.wwathBCCConfgaai'", "output": "'wwathBCCConfgaai'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007096", "code": "def simulate_program(a):\n    sum = 0\n    while True:\n        if a == 0:\n            return int(sum)\n        if a <= 2:\n            return -1\n        if a % 5 != 0:\n            a -= 3\n            sum += 1\n        else:\n            sum += a // 5\n            a = 0\n", "entry_point": "simulate_program", "input": "18", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33330_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007097", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(1, 5, 1, 7, 7, 1, 7, 7, 7)", "output": "'1.5.1.7.7.1.7.7.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007098", "code": "def sum_of_squares_of_evens(input_list):\n    total = 0\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 12]", "output": "148", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147300_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007099", "code": "def compare_versions(version1, version2):\n    v1 = list(map(int, version1.split('.')))\n    v2 = list(map(int, version2.split('.')))\n    for i in range(3):  # Compare major, minor, and patch versions\n        if v1[i] > v2[i]:\n            return \"First version is greater\"\n        elif v1[i] < v2[i]:\n            return \"Second version is greater\"\n    return \"Versions are equal\"\n", "entry_point": "compare_versions", "input": "'1.0.0', '1.0.1'", "output": "'Second version is greater'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136117_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007100", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[8, 4, 6, 4, 4, 5, 7], 0, 7", "output": "[56, 28, 42, 28, 28, 35, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007101", "code": "from typing import List, Dict, Union\ndef find_organization_id(orgs: List[Dict[str, Union[str, int]]], org_friendly_name: str) -> Union[int, str]:\n    for org in orgs:\n        if org[\"name\"] == org_friendly_name:\n            return org[\"id\"]\n    return \"Org not found\"\n", "entry_point": "find_organization_id", "input": "[], 'Some Organization'", "output": "'Org not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131609_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007102", "code": "def filter_constants(input_set, additional_constants):\n    return input_set.intersection(additional_constants.keys())\n", "entry_point": "filter_constants", "input": "{'a', 'b', 'c'}, {'d': 1, 'e': 2}", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98819_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007103", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'2.2.9200'", "output": "'2.2.9201'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007104", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7298", "output": "{3649, 1, 7298, 2, 41, 178, 82, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007105", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "13", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007106", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[24, 25, 26, 33, 12, 34, 35, 25, 34]", "output": "[12, 24, 25, 25, 26, 33, 34, 34, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007107", "code": "def sort_trades(trades):\n    # Define a custom key function to extract the timestamp for sorting\n    def get_timestamp(trade):\n        return trade[0]\n    # Sort the trades based on timestamps in descending order\n    sorted_trades = sorted(trades, key=get_timestamp, reverse=True)\n    return sorted_trades\n", "entry_point": "sort_trades", "input": "[(7, 6, 7)]", "output": "[(7, 6, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41963_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2882", "output": "{1, 2882, 2, 1441, 131, 262, 11, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2881", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007109", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'abc, def, ghi -> jklm'", "output": "(['abc', 'def', 'ghi'], 'jklm')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007110", "code": "def count_special_pairs(n):\n    count = 0\n    for x in range(1, n + 1):\n        for y in range(x, n + 1, x):\n            if (n - (x + y)) % y == 0:\n                count += 1\n    return count\n", "entry_point": "count_special_pairs", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118433_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007111", "code": "from typing import List\ndef sum_of_max_values(strings: List[str]) -> int:\n    total_sum = 0\n    for string in strings:\n        integers = [int(num) for num in string.split(',')]\n        max_value = max(integers)\n        total_sum += max_value\n    return total_sum\n", "entry_point": "sum_of_max_values", "input": "['2,3,8', '1,6', '4,0']", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86134_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007112", "code": "def filter_constants(constants):\n    result = {}\n    for constant in constants:\n        if 'AGENT' not in constant:\n            result[constant] = len(constant)\n    return result\n", "entry_point": "filter_constants", "input": "['STANT_B']", "output": "{'STANT_B': 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57505_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007113", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'mov[ramov rdx, qwordptr[rax]dd,   '", "output": "'add mov[ramov rdx, qwordptr[rax]dd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007114", "code": "def is_valid_constant_type(input_type: str) -> bool:\n    valid_constant_types = ['int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64',\n                            'uint64', 'float32', 'float64', 'char', 'byte', 'string']\n    invalid_constant_types = ['std_msgs/String', '/', 'String', 'time', 'duration', 'header']\n    if input_type in valid_constant_types and input_type not in invalid_constant_types:\n        return True\n    else:\n        return False\n", "entry_point": "is_valid_constant_type", "input": "'header'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13111_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007115", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[4, 4, 1, 4, 1, 3, 3, 5]", "output": "[8, 5, 5, 5, 4, 6, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007116", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[2, 8, 8, 16]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007117", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "369", "output": "{1, 3, 9, 41, 369, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007118", "code": "def delete(request, pk):\n    # Simulating deletion of post with primary key pk\n    posts = {\n        1: \"Post 1\",\n        2: \"Post 2\",\n        3: \"Post 3\"\n    }\n    if pk in posts:\n        del posts[pk]\n        print(f\"Post with primary key {pk} deleted successfully.\")\n        return \"Redirecting to /user/\"\n    else:\n        print(f\"Post with primary key {pk} not found.\")\n        return \"Redirecting to /user/\"\n", "entry_point": "delete", "input": "None, 4", "output": "'Redirecting to /user/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33874_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007119", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[-1, -1, -1, 0, 0, 0, 1, 2, 2]", "output": "{-1: 3, 0: 3, 1: 1, 2: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007120", "code": "def calculate_total_cost(output):\n    total_cost = 0\n    lines = output.strip().split('\\n')\n    for line in lines:\n        cost_str = line.split()[1].split('@')[0]\n        total_cost += int(cost_str)\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "'Item 1@something'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1054_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6658", "output": "{1, 6658, 2, 3329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6657", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007122", "code": "import re\ndef find_unsubstituted_variables(input_string):\n    unsubstituted_variables = []\n    # Find all occurrences of ${} patterns in the input string\n    variables = re.findall(r'\\${(.*?)}', input_string)\n    for var in variables:\n        # Check if the variable is wrapped with Fn::Sub\n        if f'Fn::Sub(\"${{{var}}}\")' not in input_string:\n            unsubstituted_variables.append(var)\n    return unsubstituted_variables\n", "entry_point": "find_unsubstituted_variables", "input": "'Hello, my name is ${name} and I am from ${place}.'", "output": "['name', 'place']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131499_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007123", "code": "def longest_common_substring(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    max_len = 0\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n                max_len = max(max_len, dp[i][j])\n    return max_len\n", "entry_point": "longest_common_substring", "input": "'', 'abc'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58621_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007124", "code": "import collections\ndef rearrange_string(s: str, k: int) -> str:\n    res = []\n    d = collections.defaultdict(int)\n    # Count the frequency of each character\n    for c in s:\n        d[c] += 1\n    v = collections.defaultdict(int)\n    for i in range(len(s)):\n        c = None\n        for key in d:\n            if (not c or d[key] > d[c]) and d[key] > 0 and v[key] <= i + k:\n                c = key\n        if not c:\n            return ''\n        res.append(c)\n        d[c] -= 1\n        v[c] = i + k\n    return ''.join(res)\n", "entry_point": "rearrange_string", "input": "'aaaab', 2", "output": "'aaaab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4736_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007125", "code": "def calculate_winner(cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B\"\n    else:\n        return \"Tie\"\n", "entry_point": "calculate_winner", "input": "[5, 1, 3]", "output": "'Player A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63696_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7377", "output": "{1, 3, 7377, 2459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007127", "code": "def query_bgp_neighbor(dev: str, bgp_neighbor: str) -> str:\n    # Check if the provided dev connection is a Juniper device\n    if \"Juniper\" not in dev:\n        return \"Error: Provided device is not a Juniper device\"\n    # Simulate querying the BGP neighbor table\n    # In a real scenario, this would involve actual communication with the device\n    # Here, we are just printing a sample message\n    bgp_state = \"Established\"  # Simulated BGP state\n    print(f\"Querying BGP neighbor {bgp_neighbor} on device {dev}. State: {bgp_state}\")\n    return bgp_state\n", "entry_point": "query_bgp_neighbor", "input": "'Juniper EX4300', '192.168.1.1'", "output": "'Established'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6641_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007128", "code": "def modular_inverse(a, m):\n    def egcd(a, b):\n        if a == 0:\n            return (b, 0, 1)\n        else:\n            g, x, y = egcd(b % a, a)\n            return (g, y - (b // a) * x, x)\n    g, x, y = egcd(a, m)\n    if g != 1:\n        return None\n    else:\n        return x % m\n", "entry_point": "modular_inverse", "input": "5, 104", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35681_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007129", "code": "def find_peak_index(arr):\n    for i in range(1, len(arr) - 1):\n        if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:\n            return i\n    return -1  # No peak found\n", "entry_point": "find_peak_index", "input": "[1, 2, 3, 1, 0]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94014_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7931", "output": "{1, 7, 103, 11, 1133, 77, 721, 7931}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "313", "output": "{1, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007132", "code": "def extract_characters(input_string, slice_obj):\n    start, stop, step = slice_obj.indices(len(input_string))\n    result = [input_string[i] for i in range(start, stop, step)]\n    return result\n", "entry_point": "extract_characters", "input": "'python', slice(1, 5, 1)", "output": "['y', 't', 'h', 'o']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83319_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007133", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4916", "output": "{1, 2, 4, 1229, 4916, 2458}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4915", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007134", "code": "def next_greater_elements(x):\n    stack = []\n    solution = [None] * len(x)\n    for i in range(len(x)-1, -1, -1):\n        while stack and x[i] >= x[stack[-1]]:\n            stack.pop()\n        if stack:\n            solution[i] = stack[-1]\n        stack.append(i)\n    return solution\n", "entry_point": "next_greater_elements", "input": "[1, 2, 2, 3, 3]", "output": "[1, 3, 3, None, None]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72944_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007135", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "50.0, 27.103084799999998", "output": "1355.1542399999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007136", "code": "def evaluate_order(simple_order, impact):\n    bigger_than_threshold = simple_order == \">\"\n    has_positive_impact = impact > 0\n    if bigger_than_threshold and has_positive_impact:\n        return \"\ub192\uc77c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4\"\n    if not bigger_than_threshold and not has_positive_impact:\n        return \"\ub192\uc774\uc138\uc694\"\n    if bigger_than_threshold and not has_positive_impact:\n        return \"\ub0ae\ucd94\uc138\uc694\"\n    if not bigger_than_threshold and has_positive_impact:\n        return \"\ub0ae\ucd9c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4\"\n", "entry_point": "evaluate_order", "input": "'<', 0", "output": "'\ub192\uc774\uc138\uc694'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28604_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007137", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: float) -> List[int]:\n    start = end = 0\n    max_length = 0\n    window_sum = 0\n    left = 0\n    for right, temp in enumerate(temperatures):\n        window_sum += temp\n        while window_sum / (right - left + 1) > threshold:\n            if right - left > max_length:\n                max_length = right - left\n                start, end = left, right\n            window_sum -= temperatures[left]\n            left += 1\n    return [start, end]\n", "entry_point": "longest_contiguous_subarray", "input": "[], 50.0", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39417_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007138", "code": "MSG_DATE_SEP = \">>>:\"\nEND_MSG = \"THEEND\"\nALLOWED_KEYS = [\n    'q',\n    'e',\n    's',\n    'z',\n    'c',\n    '',\n]\ndef process_input(input_str):\n    if MSG_DATE_SEP in input_str:\n        index = input_str.find(MSG_DATE_SEP)\n        if index + len(MSG_DATE_SEP) < len(input_str):\n            char = input_str[index + len(MSG_DATE_SEP)]\n            if char in ALLOWED_KEYS:\n                return char\n    elif END_MSG in input_str:\n        return ''\n    return \"INVALID\"\n", "entry_point": "process_input", "input": "'>>>:x'", "output": "'INVALID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90484_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007139", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'1.2.9'", "output": "'1.3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007140", "code": "def calculate_points(scores):\n    if not scores:\n        return 0\n    total_points = 0\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            total_points += 1\n        else:\n            total_points -= 1\n    return total_points\n", "entry_point": "calculate_points", "input": "[3, 2, 1]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101160_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2878", "output": "{1, 2, 2878, 1439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007142", "code": "def max_sum_non_adjacent(lst):\n    inclusive = 0\n    exclusive = 0\n    for num in lst:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49510_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "237", "output": "{1, 3, 237, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007144", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hllllllooe'", "output": "{'h': 1, 'l': 6, 'o': 2, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84684_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007145", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 2, 4, 8, 2, 3, 7, 2]", "output": "[1, 3, 6, 11, 6, 8, 13, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007146", "code": "def get_dot_axis(keras_version_str):\n    keras_version_tuple = tuple(map(int, keras_version_str.split('.')))\n    DOT_AXIS = 0 if keras_version_tuple <= (2, 2, 4) else 1\n    return DOT_AXIS\n", "entry_point": "get_dot_axis", "input": "'2.2.4'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61874_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007147", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[20, 30]", "output": "[20, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007148", "code": "from typing import List\ndef calculate_highest_score(scores: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = score + exclude\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "calculate_highest_score", "input": "[10, 15, 20, 5, 3]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24235_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007149", "code": "def count_ways_to_climb_stairs(n):\n    if n == 0 or n == 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "8", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29461_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007150", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[3, 1, 0, 2, 2, 0, 2, 3, 2], 2", "output": "[5, 3, 2, 4, 4, 2, 4, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007151", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8049", "output": "{1, 2683, 3, 8049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8048", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6755", "output": "{1, 193, 6755, 35, 5, 965, 7, 1351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007153", "code": "def check_win(p1):\n    winning_combination = {1, 3, 5, 6, 7, 8}\n    return winning_combination.issubset(p1)\n", "entry_point": "check_win", "input": "set()", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55458_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007154", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[3, 2, 4, 1, 3, 1, 2, 4]", "output": "[4, 2, 1, 3, 1, 4, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007155", "code": "def generate_html_input(form_field):\n    html_input = \"\"\n    for field_name, field_props in form_field.items():\n        input_type = \"text\"  # Default input type\n        attrs = \"\"\n        if \"max_length\" in field_props:\n            attrs += f' max_length=\"{field_props[\"max_length\"]}\"'\n        if \"required\" in field_props and field_props[\"required\"]:\n            attrs += ' required'\n        if \"widget\" in field_props and \"attrs\" in field_props[\"widget\"]:\n            for attr_name, attr_value in field_props[\"widget\"][\"attrs\"].items():\n                attrs += f' {attr_name}=\"{attr_value}\"'\n        html_input += f'<input type=\"{input_type}\" name=\"{field_name}\"{attrs}>\\n'\n    return html_input\n", "entry_point": "generate_html_input", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007156", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'BTBTCUSDTTCUSDT'", "output": "('BTBTCUSDTTC', 'USDT')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007157", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8441", "output": "{1, 367, 8441, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007158", "code": "import importlib\nfrom typing import List\ndef load_module_objects(module_name: str) -> List[str]:\n    try:\n        module = importlib.import_module(module_name)\n        if hasattr(module, '__all__'):\n            return module.__all__\n        else:\n            return []\n    except ModuleNotFoundError:\n        return []  # Return empty list if module not found\n", "entry_point": "load_module_objects", "input": "'non_existent_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108811_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007159", "code": "import re\ndef extract_test_functions(file_content):\n    test_functions = re.findall(r\"def test_[a-zA-Z0-9_]+\\(self\\):\", file_content)\n    test_function_names = [func.split('(')[0] for func in test_functions]\n    return test_function_names\n", "entry_point": "extract_test_functions", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1343_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007160", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "765", "output": "{1, 3, 5, 9, 45, 15, 17, 51, 85, 153, 765, 255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007161", "code": "def extract_digits(str_input):\n    final_str = \"\"\n    for char in str_input:\n        if char.isdigit():  # Check if the character is a digit\n            final_str += char\n    return final_str\n", "entry_point": "extract_digits", "input": "'abc3d1e6f1g'", "output": "'3161'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132906_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6221", "output": "{1, 6221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007163", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'ABLMABCDEEGHIJTNRs'", "output": "'ABLMABCDEEGHIJTNRs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007164", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) <= 1:\n        return None\n    min_val = min(numbers)\n    max_val = max(numbers)\n    numbers.remove(min_val)\n    numbers.remove(max_val)\n    if len(numbers) == 0:\n        return None\n    return sum(numbers) / len(numbers)\n", "entry_point": "calculate_average_excluding_extremes", "input": "[3.0, 4.0, 5.0, 6.0]", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148106_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007165", "code": "def posix_quote_filter(input_string):\n    # Escape single quotes by doubling them\n    escaped_string = input_string.replace(\"'\", \"''\")\n    # Enclose the modified string in single quotes\n    return f\"'{escaped_string}'\"\n", "entry_point": "posix_quote_filter", "input": "'Dpani pnic!'", "output": "\"'Dpani pnic!'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125649_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007166", "code": "def count_unique_numeric_elements(input_list):\n    unique_numeric_elements = set()\n    for element in input_list:\n        if isinstance(element, (int, float)):\n            unique_numeric_elements.add(element)\n    return len(unique_numeric_elements)\n", "entry_point": "count_unique_numeric_elements", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9037_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007167", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7745", "output": "{7745, 1, 1549, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007168", "code": "import re\nSENSITIVE_SETTINGS_RE = re.compile(\n    'api|key|pass|salt|secret|signature|token',\n    flags=re.IGNORECASE\n)\ndef filter_sensitive_settings(input_dict):\n    filtered_dict = {key: value for key, value in input_dict.items() if not SENSITIVE_SETTINGS_RE.search(key)}\n    return filtered_dict\n", "entry_point": "filter_sensitive_settings", "input": "{'api': 'my_api_key', 'PASSWORD': 'mypassword'}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2237_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007169", "code": "from typing import List\ndef process_incidents(incident_ids: List[str], action: str) -> str:\n    valid_actions = ['link', 'unlink']\n    if action not in valid_actions:\n        action = 'link'\n    if action == 'link':\n        result = f\"Successfully linked incidents: {', '.join(incident_ids)}\"\n    else:\n        result = f\"Successfully unlinked incidents: {', '.join(incident_ids)}\"\n    return result\n", "entry_point": "process_incidents", "input": "[], 'link'", "output": "'Successfully linked incidents: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83208_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5761", "output": "{1, 5761, 823, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007171", "code": "from datetime import datetime, timedelta\ndef ts_current_week_start(ts: int) -> int:\n    dt = datetime.fromtimestamp(ts / 1000.0)\n    days_to_subtract = dt.weekday() % 7\n    dt = dt - timedelta(days=days_to_subtract)\n    dt = dt.replace(hour=0, minute=0, second=0, microsecond=0)\n    return round(dt.timestamp() * 1000)\n", "entry_point": "ts_current_week_start", "input": "1633430400000", "output": "1633305600000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61295_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007172", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[6, 4, 6, 6, 6, 0, 4, 5]", "output": "[6, 4, 6, 6, 6, 0, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007173", "code": "def format_column_name(raw_column_name, year):\n    raw_column_name = '_'.join(raw_column_name.lower().split())\n    raw_column_name = raw_column_name.replace('_en_{}_'.format(year), '_')\n    formatted_column_name = raw_column_name.replace('\u00e9', 'e')  # Replace accented '\u00e9' with 'e'\n    return formatted_column_name\n", "entry_point": "format_column_name", "input": "'Sales Revenue en 2022 April', 2022", "output": "'sales_revenue_april'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25598_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007174", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "4", "output": "[0, 0, 1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007175", "code": "import math\ndef cosine_approximation(x, n):\n    result = 1.0\n    for i in range(2, 2*n+1, 2):\n        term = ((-1)**(i/2)) * (x**i) / math.factorial(i)\n        result += term\n    return result\n", "entry_point": "cosine_approximation", "input": "0, 10", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4661_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007176", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[1, 1, 2, 2, 3, 3, 4], 3", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8421", "output": "{1, 3, 8421, 7, 401, 1203, 21, 2807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007178", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "3", "output": "'3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007179", "code": "def generate_resource_lists(max_id, list_count):\n    resource_lists = []\n    entries_per_list = max_id // list_count\n    remaining_count = max_id - (entries_per_list * list_count)\n    starting_index = 1\n    for i in range(1, list_count + 1):\n        ending_index = i * entries_per_list\n        resource_lists.append(list(range(starting_index, ending_index + 1)))\n        starting_index = ending_index + 1\n    if remaining_count:\n        starting_index = resource_lists[-1][-1] + 1\n        ending_index = starting_index + remaining_count\n        resource_lists.append(list(range(starting_index, ending_index)))\n    return resource_lists\n", "entry_point": "generate_resource_lists", "input": "8, 2", "output": "[[1, 2, 3, 4], [5, 6, 7, 8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104705_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007180", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 1, 2, 3, 1, 1, 3, 1]", "output": "[1, 2, 5, 6, 8, 3, 3, 4, 4, 4, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007181", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4503", "output": "{1, 3, 237, 79, 19, 4503, 57, 1501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007182", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4703", "output": "{1, 4703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007183", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1,2,3'", "output": "(1, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8895", "output": "{1, 3, 5, 15, 593, 1779, 2965, 8895}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007185", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'Rge-123'", "output": "'Rge'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007186", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'3 + 5'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007187", "code": "import os\nfrom pathlib import Path\nfrom typing import Tuple\ndef setup_env_path(file_path: str) -> Tuple[str, str]:\n    checkout_dir = Path(file_path).resolve().parent\n    parent_dir = checkout_dir.parent\n    if parent_dir != \"/\" and os.path.isdir(parent_dir / \"etc\"):\n        env_file = parent_dir / \"etc\" / \"env\"\n        default_var_root = parent_dir / \"var\"\n    else:\n        env_file = checkout_dir / \".env\"\n        default_var_root = checkout_dir / \"var\"\n    return str(env_file), str(default_var_root)\n", "entry_point": "setup_env_path", "input": "'/etc/somefile.txt'", "output": "('/etc/env', '/var')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10500_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007188", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[-2, -3, 1, -1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007189", "code": "import ast\ndef extract_names_from_code(code):\n    tree = ast.parse(code)\n    names = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                names.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            names.add(node.module)\n        elif isinstance(node, ast.ClassDef):\n            names.add(node.name)\n    return list(names)\n", "entry_point": "extract_names_from_code", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38493_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007190", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'add(a,}'", "output": "'add(a,}\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007191", "code": "def calculate_word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Initialize a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation if needed\n        word = word.strip('.,')\n        # Update the word frequency dictionary\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'ppyth'", "output": "{'ppyth': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88926_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007192", "code": "def encrypt_text(input_string):\n    encrypted_result = \"\"\n    for char in input_string:\n        ascii_val = ord(char)  # Get ASCII value of the character\n        encrypted_ascii = ascii_val + 1  # Increment ASCII value by 1\n        encrypted_char = chr(encrypted_ascii)  # Convert back to character\n        encrypted_result += encrypted_char  # Append to the encrypted result string\n    return encrypted_result\n", "entry_point": "encrypt_text", "input": "'helloheh'", "output": "'ifmmpifi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124153_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007193", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "124", "output": "'ossg.default.124'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007194", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_score = sorted_scores[N-1]\n    count_top_score = sorted_scores.count(top_score)\n    sum_top_scores = sum(sorted_scores[:sorted_scores.index(top_score) + count_top_score])\n    average = sum_top_scores / count_top_score\n    return average\n", "entry_point": "calculate_top_players_average", "input": "[217, 217, 217, 200, 180], 3", "output": "217.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54118_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007195", "code": "def dummy(n):\n    total_sum = sum(range(1, n + 1))\n    return total_sum\n", "entry_point": "dummy", "input": "999", "output": "499500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124894_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007196", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'aticaanP'", "output": "'aticaanP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007197", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'WWorloorl'", "output": "b'WWorloorl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007198", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3086", "output": "{1, 2, 3086, 1543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007199", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "5, 1, 8", "output": "'5.1.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007200", "code": "def calculate_average(data):\n    total_noisy_add = sum(sample[0] for sample in data)\n    total_std_add = sum(sample[1] for sample in data)\n    average_noisy_add = total_noisy_add / len(data)\n    average_std_add = total_std_add / len(data)\n    return (average_noisy_add, average_std_add)\n", "entry_point": "calculate_average", "input": "[(10.0, 10.0), (10.0, 10.0)]", "output": "(10.0, 10.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73285_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007201", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'230x6230x6bcdefcdf'", "output": "{'bytecode': '0x230x6230x6bcdefcdf'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007202", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[1, 2, 3], 0, 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007203", "code": "import re\ndef extract_software_components(text):\n    software_components = {}\n    pattern = r'([^\\n:]+):\\s*([^\\n]+)'\n    matches = re.findall(pattern, text)\n    for match in matches:\n        software_components[match[0].strip()] = match[1].strip()\n    return software_components\n", "entry_point": "extract_software_components", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6122", "output": "{1, 6122, 2, 3061}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007205", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'3.11.0.3'", "output": "'3.11.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007206", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3111", "output": "{1, 3, 3111, 1037, 17, 51, 183, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007207", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#FFA550'", "output": "(255, 165, 80)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007208", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'8'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007209", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3538", "output": "{1, 2, 58, 1769, 3538, 61, 122, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007210", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'Parser', 'hpp'", "output": "'Parser.hpp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007211", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/folder/subfolder/fie.tx'", "output": "'fie.tx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007212", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "304", "output": "{1, 2, 4, 38, 8, 76, 304, 16, 19, 152}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt303", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007213", "code": "from datetime import datetime, timedelta\ndelay_status_by_date = {\n    'PAYMENT_RECEIVED': 3,\n    'PROCESSING': 1,\n    'SHIPPING': 5,\n    'PORT_ARRIVED': 4,\n}\ndef calculate_delivery_date(order_status):\n    if order_status in delay_status_by_date:\n        current_date = datetime.now()\n        estimated_delivery_date = current_date + timedelta(days=delay_status_by_date[order_status])\n        return estimated_delivery_date.strftime('%Y-%m-%d')\n    else:\n        return \"Order status not found in dictionary.\"\n", "entry_point": "calculate_delivery_date", "input": "'CANCELLED'", "output": "'Order status not found in dictionary.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84049_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007214", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[6, 7, 3, 7, 3, 5, 3, 5]", "output": "[6, 8, 5, 10, 7, 10, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007215", "code": "def find_last_word_length(s: str) -> int:\n    reversed_string = s.strip()[::-1]  # Reverse the input string after removing leading/trailing spaces\n    length = 0\n    for char in reversed_string:\n        if char == ' ':\n            if length == 0:\n                continue\n            break\n        length += 1\n    return length\n", "entry_point": "find_last_word_length", "input": "'Hello everyone, welcome to the function'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93428_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007216", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:98765]'", "output": "76561197960364493", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007217", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[4, 1, 2, 3, 2, 3, 3, 3]", "output": "[16, 1, 4, 27, 4, 27, 27, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007218", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8090", "output": "{1, 2, 5, 809, 10, 4045, 1618, 8090}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8089", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007219", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'thitestts'", "output": "'thitestts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007220", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/webhoo5/'", "output": "'webhoo5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007221", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8101", "output": "{1, 8101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007222", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9074", "output": "{1, 2, 26, 13, 9074, 4537, 698, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007223", "code": "def calculate_dot_product(list1, list2):\n    dot_product = 0\n    for i in range(len(list1)):\n        dot_product += list1[i] * list2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 2, 2], [5, 3, 2]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118702_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007224", "code": "def decrypt(encryptedText, key):\n    decryptedText = \"\"\n    key = key.lower().replace('\u0130', 'i')\n    encryptedText = encryptedText.lower()\n    i = 0\n    while i < len(encryptedText):\n        char = ord(encryptedText[i])\n        charOfKey = ord(key[i % len(key)])\n        if char >= 97 and char <= 122 and charOfKey >= 97 and charOfKey <= 122:\n            decryptedText += chr((char - charOfKey + 26) % 26 + 97)\n        else:\n            decryptedText += chr(char)\n        i += 1\n    return decryptedText\n", "entry_point": "decrypt", "input": "'mm', 'a'", "output": "'mm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70304_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007225", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "20", "output": "{1, 2, 4, 5, 10, 20}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007226", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'(solr'", "output": "'\\\\(solr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007227", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "225, 15, 5", "output": "270", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007228", "code": "def modular_inverse(a, m):\n    def egcd(a, b):\n        if a == 0:\n            return (b, 0, 1)\n        else:\n            g, x, y = egcd(b % a, a)\n            return (g, y - (b // a) * x, x)\n    g, x, y = egcd(a, m)\n    if g != 1:\n        return None\n    else:\n        return x % m\n", "entry_point": "modular_inverse", "input": "7, 26", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35681_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2452", "output": "{1, 2, 4, 613, 1226, 2452}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2451", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007230", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "7", "output": "0.42857142857142855", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007231", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.14.15'", "output": "(3, 14, 15)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7474", "output": "{1, 2, 37, 101, 202, 74, 7474, 3737}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007233", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[-1, 2, 2, 6, -2, 5, 5, 5]", "output": "[-2, 2, 2, 6, -1, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007234", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[3, 4]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007235", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[7, 10, 20, 30, 45]", "output": "(45, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007236", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[42]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007237", "code": "import os\nimport re\ndef find_movie_database_ids(path: str) -> dict:\n    if not os.path.isdir(path):\n        return {}\n    for file in sorted(os.listdir(path)):\n        filepath = os.path.join(path, file)\n        if os.path.isfile(filepath) and (re.match(r'.+?\\.nfo', file) or re.match(r'.+?\\.txt', file)):\n            with open(filepath, \"r\", encoding=\"latin-1\") as data:\n                for line in data:\n                    imdb_search = re.search(r\"(http|https)://www.imdb.com/title/(tt\\d+)\", line)\n                    if imdb_search:\n                        return {'imdb': imdb_search.group(2)}\n                    db_search = re.search(r\"https:\\/\\/movie\\.douban\\.com\\/(subject|movie)\\/(\\d+)\", line)\n                    if db_search:\n                        return {'douban': db_search.group(2)}\n    return {}\n", "entry_point": "find_movie_database_ids", "input": "'/path/to/nonexistent/directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105477_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2573", "output": "{1, 83, 2573, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007239", "code": "def process_actions(actions):\n    processed_actions = {}\n    for action in actions:\n        method = action['method']\n        action_info = {'method': method}\n        if 'options' in action:\n            action_info['options'] = action['options']\n        processed_actions[method] = action_info\n    return processed_actions\n", "entry_point": "process_actions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37374_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007240", "code": "TOKEN_TYPE = ((0, 'PUBLIC_KEY'), (1, 'PRIVATE_KEY'), (2, 'AUTHENTICATION TOKEN'), (4, 'OTHER'))\ndef get_token_type_verbose(token_type: int) -> str:\n    token_type_mapping = dict(TOKEN_TYPE)\n    return token_type_mapping.get(token_type, 'Unknown Token Type')\n", "entry_point": "get_token_type_verbose", "input": "2", "output": "'AUTHENTICATION TOKEN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149682_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007241", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6129", "output": "{1, 3, 227, 27, 9, 681, 6129, 2043}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007243", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[], 5", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007244", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kkkjkkjakjhkatt2'", "output": "'http://kkkjkkjakjhkatt2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3697", "output": "{1, 3697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007246", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[5, 5, 8]", "output": "[5, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt29", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007247", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Hello, World!', 5", "output": "'Mjqqt, Btwqi!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20125_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2853", "output": "{1, 3, 2853, 9, 951, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007249", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "295", "output": "{1, 59, 5, 295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007250", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1703", "output": "{1, 131, 13, 1703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007251", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.622.62', 125", "output": "'2.622.62.125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7611", "output": "{1, 129, 3, 2537, 59, 43, 177, 7611}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007253", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7895", "output": "{1, 1579, 5, 7895}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007254", "code": "def search_engine(query):\n    # Simulated database with search results and relevance scores\n    database = {\n        \"apple\": 0.8,\n        \"orange\": 0.6,\n        \"fruit\": 0.4\n    }\n    def evaluate_expression(expression):\n        if expression in database:\n            return database[expression]\n        elif expression == \"AND\":\n            return 1  # Simulated relevance score for AND operator\n        elif expression == \"OR\":\n            return 0.5  # Simulated relevance score for OR operator\n    def evaluate_query(query_tokens):\n        stack = []\n        for token in query_tokens:\n            if token == \"AND\":\n                operand1 = stack.pop()\n                operand2 = stack.pop()\n                stack.append(max(operand1, operand2))\n            elif token == \"OR\":\n                operand1 = stack.pop()\n                operand2 = stack.pop()\n                stack.append(max(operand1, operand2))\n            else:\n                stack.append(evaluate_expression(token))\n        return stack.pop()\n    query_tokens = query.split()\n    relevance_scores = [(token, evaluate_expression(token)) for token in query_tokens]\n    relevance_scores.sort(key=lambda x: x[1], reverse=True)\n    search_results = [{\"ID\": i, \"Relevance Score\": score} for i, (token, score) in enumerate(relevance_scores)]\n    return search_results\n", "entry_point": "search_engine", "input": "'AND'", "output": "[{'ID': 0, 'Relevance Score': 1}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23618_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007255", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "1, 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72377_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5779", "output": "{1, 5779}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007257", "code": "def is_number(s: str) -> bool:\n    s = s.strip()  # Remove leading and trailing whitespaces\n    if not s:  # Check if the string is empty after trimming\n        return False\n    try:\n        float(s)  # Attempt to convert the string to a float\n        return True\n    except ValueError:\n        return False\n", "entry_point": "is_number", "input": "'123.45'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4271_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007258", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[60, 24, 5]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100977_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007259", "code": "def find_zero_sign_change(coefficients):\n    zero_loc = []\n    prev_sign = None\n    for i in range(len(coefficients)):\n        if coefficients[i] == 0:\n            zero_loc.append(i)\n        elif prev_sign is not None and coefficients[i] * prev_sign < 0:\n            zero_loc.append(i)\n        if coefficients[i] != 0:\n            prev_sign = 1 if coefficients[i] > 0 else -1\n    return zero_loc\n", "entry_point": "find_zero_sign_change", "input": "[1, 0, -1, 0, 1, -1]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140511_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007260", "code": "def digitDifferenceSort(a):\n    def dg(n):\n        s = list(map(int, str(n)))\n        return max(s) - min(s)\n    ans = [(a[i], i) for i in range(len(a))]\n    A = sorted(ans, key=lambda x: (dg(x[0]), -x[1]))\n    return [c[0] for c in A]\n", "entry_point": "digitDifferenceSort", "input": "[7, 7, 7, 23, 889, 153]", "output": "[7, 7, 7, 889, 23, 153]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132098_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007261", "code": "def calculate_mode(numbers):\n    frequency_dict = {}\n    for num in numbers:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return min(modes)\n", "entry_point": "calculate_mode", "input": "[1, 2, 3, 3, 3, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48679_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5446", "output": "{1, 2, 2723, 389, 5446, 7, 778, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007263", "code": "def closest_three_sum(nums, target):\n    nums.sort()\n    closest_sum = float('inf')\n    closest_diff = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            current_diff = abs(current_sum - target)\n            if current_diff < closest_diff:\n                closest_sum = current_sum\n                closest_diff = current_diff\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return current_sum\n    return closest_sum\n", "entry_point": "closest_three_sum", "input": "[-10, 1, 2, 3, 4], -7", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34495_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007264", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9649", "output": "{1, 9649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007265", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[5, 7, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007266", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3891", "output": "{3, 1, 3891, 1297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007267", "code": "import re\ndef validate_version(version):\n    complex_regex = \"^(.*)-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?(?:\\+(.*))$\"\n    simple_regex = \"^(.*)-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*).*\"\n    if re.match(complex_regex, version):\n        return \"Complex Version\"\n    elif re.match(simple_regex, version):\n        return \"Simple Version\"\n    else:\n        return \"Invalid Version\"\n", "entry_point": "validate_version", "input": "'mypackage-1.2.3-beta.1+build.123'", "output": "'Complex Version'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75154_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007268", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7102", "output": "{1, 2, 67, 134, 106, 53, 7102, 3551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007269", "code": "def replace_yiddish_characters(input_str):\n    mapping = {\n        '\u05d0\u05b8': '\u05d0',\n        '\u05d0\u05b7': '\u05d0',\n        '\u05f2\u05b7': '\u05d9\u05d9',\n        '\u05f2': '\u05d9\u05d9',\n        '\u05e4\u05bf': '\u05e4',\n        '\u05d1\u05bf': '\u05d1',\n        '\u05f1': '\u05d5\u05d9',\n        '\u05f0': '\u05d5\u05d5',\n        '\u05e4\u05bc': '\u05e4'\n    }\n    for key, value in mapping.items():\n        input_str = input_str.replace(key, value)\n    return input_str\n", "entry_point": "replace_yiddish_characters", "input": "'\u05d0\u05b8'", "output": "'\u05d0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140367_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007270", "code": "def check_password_match(database_config: dict, secret_key: str) -> bool:\n    if \"PASSWORD\" in database_config and database_config[\"PASSWORD\"] == secret_key:\n        return True\n    return False\n", "entry_point": "check_password_match", "input": "{'USER': 'admin'}, 'mySecret123'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24387_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007271", "code": "def parse_platform(curr_platform):\n    platform, compiler = curr_platform.split(\"_\")\n    output_folder_platform = \"\"\n    output_folder_compiler = \"\"\n    if platform.startswith(\"win\"):\n        output_folder_platform = \"Win\"\n        if \"vs2013\" in compiler:\n            output_folder_compiler = \"vc120\"\n        elif \"vs2015\" in compiler:\n            output_folder_compiler = \"vc140\"\n        elif \"vs2017\" in compiler:\n            output_folder_compiler = \"vc141\"\n    elif platform.startswith(\"darwin\"):\n        output_folder_platform = \"Mac\"\n        output_folder_compiler = \"clang\"\n    elif platform.startswith(\"linux\"):\n        output_folder_platform = \"Linux\"\n        output_folder_compiler = \"clang\"\n    return output_folder_platform, output_folder_compiler\n", "entry_point": "parse_platform", "input": "'linux_example'", "output": "('Linux', 'clang')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142101_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007272", "code": "def count_words_starting_with_vowel_or_consonant(words):\n    vowel_count = 0\n    consonant_count = 0\n    vowels = set('aeiou')\n    for word in words:\n        if word.lower()[0] in vowels:\n            vowel_count += 1\n        else:\n            consonant_count += 1\n    return {'vowel': vowel_count, 'consonant': consonant_count}\n", "entry_point": "count_words_starting_with_vowel_or_consonant", "input": "['apple', 'orange', 'banana', 'grape', 'kiwi']", "output": "{'vowel': 2, 'consonant': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59793_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007273", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i + 1 < len(input_list):\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[6, 4, 2, 3, 1, 4, 5]", "output": "[10, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54766_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007274", "code": "import re\ndef filter_song_and_artist(sub_title):\n    # Split the submission title using the hyphen as the delimiter\n    parts = sub_title.split('-')\n    # If the submission title does not contain a hyphen or has more than one hyphen, it is not a valid song submission\n    if len(parts) != 2:\n        return None\n    # Extract the artist and track name, and trim any leading or trailing whitespaces\n    artist = parts[0].strip()\n    track_name = parts[1].strip()\n    return (artist, track_name)\n", "entry_point": "filter_song_and_artist", "input": "'   Tr   -   ack '", "output": "('Tr', 'ack')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138461_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007275", "code": "from typing import List\ndef generate_masks(n: int) -> List[str]:\n    if n == 0:\n        return ['']\n    masks = []\n    for mask in generate_masks(n - 1):\n        masks.append(mask + '0')\n        masks.append(mask + '1')\n    return masks\n", "entry_point": "generate_masks", "input": "2", "output": "['00', '01', '10', '11']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18657_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007276", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "2, 10", "output": "1024", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt73", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "860", "output": "{1, 2, 4, 5, 10, 43, 172, 430, 20, 86, 215, 860}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt859", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007278", "code": "def process_error_handlers(error_handlers):\n    error_dict = {}\n    for code, template in reversed(error_handlers):\n        error_dict[code] = template\n    return error_dict\n", "entry_point": "process_error_handlers", "input": "[(500, '500.html.j2')]", "output": "{500: '500.html.j2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5735_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007279", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'appple', 'banana'", "output": "'appple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007280", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'0'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007281", "code": "from typing import List\nimport heapq\ndef minAvailableDuration(slots1: List[List[int]], slots2: List[List[int]], duration: int) -> List[int]:\n    timeslots = list(filter(lambda x: x[1] - x[0] >= duration, slots1 + slots2))\n    heapq.heapify(timeslots)\n    while len(timeslots) > 1:\n        start1, end1 = heapq.heappop(timeslots)\n        start2, end2 = timeslots[0]\n        if end1 >= start2 + duration:\n            return [start2, start2 + duration]\n    return []\n", "entry_point": "minAvailableDuration", "input": "[[1, 2]], [[3, 4]], 2", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49852_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8201", "output": "{1, 59, 139, 8201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8200", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007283", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9109", "output": "{1, 9109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9108", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007284", "code": "def generate_telegram_url(api_token):\n    URL_BASE = 'https://api.telegram.org/file/bot'\n    complete_url = URL_BASE + api_token + '/'\n    return complete_url\n", "entry_point": "generate_telegram_url", "input": "'PTUTTHRE'", "output": "'https://api.telegram.org/file/botPTUTTHRE/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139134_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007285", "code": "def calculate_event_percentage(event_occurrences, event_index):\n    total_count = sum(event_occurrences)\n    if event_index < 0 or event_index >= len(event_occurrences):\n        return \"Invalid event index\"\n    event_count = event_occurrences[event_index]\n    percentage = (event_count / total_count) * 100\n    return percentage\n", "entry_point": "calculate_event_percentage", "input": "[6, 46], 0", "output": "11.538461538461538", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23800_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007286", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'apple.banana.grapefuitet.orange.lemon'", "output": "'grapefuitet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007287", "code": "from typing import Tuple\ndef final_position(directions: str, grid_size: int) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    x = max(-grid_size, min(grid_size, x))\n    y = max(-grid_size, min(grid_size, y))\n    return (x, y)\n", "entry_point": "final_position", "input": "'UURRLD', 2", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81995_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007288", "code": "def parse_inventory_data(data: str) -> dict:\n    inventory_dict = {}\n    pairs = data.split(',')\n    for pair in pairs:\n        try:\n            key, value = pair.split(':')\n            key = key.strip()\n            value = value.strip()\n            if value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            elif value.isdigit():\n                value = int(value)\n            inventory_dict[key] = value\n        except (ValueError, AttributeError):\n            # Handle parsing errors by skipping the current pair\n            pass\n    return inventory_dict\n", "entry_point": "parse_inventory_data", "input": "'age: 30'", "output": "{'age': 30}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83492_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6346", "output": "{1, 2, 3173, 38, 167, 6346, 334, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6345", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1421", "output": "{1, 7, 203, 1421, 49, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007291", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[34, 35, 36, 38, 34]", "output": "35.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007292", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kikirjakkuppa./125'", "output": "'http://kikirjakkuppa./125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007293", "code": "from typing import List, Dict, Any\ndef remove_key_value_pair(input_list: List[Dict[str, Any]], key: str) -> List[Dict[str, Any]]:\n    output_list = []\n    for d in input_list:\n        if key in d:\n            new_d = {k: v for k, v in d.items() if k != key}\n            output_list.append(new_d)\n        else:\n            output_list.append(d)\n    return output_list\n", "entry_point": "remove_key_value_pair", "input": "[], 'key'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23691_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3715", "output": "{1, 3715, 5, 743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3714", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9359", "output": "{1, 7, 9359, 49, 1337, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007296", "code": "from typing import List\ndef calculate_total_time(tasks: List[int], cooldown: int) -> int:\n    last_occurrence = {}\n    time_elapsed = 0\n    for task_duration in tasks:\n        if task_duration not in last_occurrence or last_occurrence[task_duration] + cooldown <= time_elapsed:\n            time_elapsed += task_duration\n        else:\n            time_elapsed = last_occurrence[task_duration] + cooldown + task_duration\n        last_occurrence[task_duration] = time_elapsed\n    return time_elapsed\n", "entry_point": "calculate_total_time", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98461_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007297", "code": "import re\nre_punc = re.compile(r'[!\"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\']')\narticles = set([\"a\", \"an\", \"the\"])\ndef normalize_answer(s):\n    \"\"\"\n    Lower text, remove punctuation, articles, and extra whitespace.\n    Args:\n    s: A string representing the input text to be normalized.\n    Returns:\n    A string with the input text normalized as described.\n    \"\"\"\n    s = s.lower()\n    s = re_punc.sub(\" \", s)\n    s = \" \".join([word for word in s.split() if word not in articles])\n    s = \" \".join(s.split())\n    return s\n", "entry_point": "normalize_answer", "input": "'jjumo'", "output": "'jjumo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46089_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007298", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    total = 0\n    for _ in range(n):\n        if not scores:\n            break\n        max_score = max(scores)\n        total += max_score\n        scores.remove(max_score)\n    return total / max(n, len(scores))\n", "entry_point": "average_top_n_scores", "input": "[80, 90, 80], 3", "output": "83.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5232_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "505", "output": "{1, 5, 101, 505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007300", "code": "def calculate_network_density(CIJ):\n    n = len(CIJ)\n    k = sum(sum(1 for val in row if val != 0) for row in CIJ)\n    density = k / (n * (n - 1))\n    return density\n", "entry_point": "calculate_network_density", "input": "[[0, 1, 1], [1, 0, 1], [0, 0, 0]]", "output": "0.6666666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108028_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007301", "code": "def encrypt_decrypt_message(message, shift):\n    result = \"\"\n    for char in message:\n        if char.isupper():\n            result += chr((ord(char) - 65 + shift) % 26 + 65) if char.isupper() else char\n        elif char.islower():\n            result += chr((ord(char) - 97 + shift) % 26 + 97) if char.islower() else char\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt_decrypt_message", "input": "'Hello, World!', 0", "output": "'Hello, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149832_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007302", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[0, 1, 0]", "output": "[1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13953_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007303", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[9, 1, 2, 3, 5]", "output": "[9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007304", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[1, 3, 5, 15]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007305", "code": "# Sample list of event metadata dictionaries\nEVENTS = [\n    {'name': 'event1', 'event': {'attribute1': 10, 'attribute2': 20}},\n    {'name': 'event2', 'event': {'attribute1': 15, 'attribute2': 25}},\n    {'name': 'event3', 'event': {'attribute1': 20, 'attribute2': 30}},\n]\n# Function to calculate average attribute value\ndef calculate_average_attribute(attribute_name):\n    total = 0\n    count = 0\n    for event_meta in EVENTS:\n        if attribute_name in event_meta['event']:\n            total += event_meta['event'][attribute_name]\n            count += 1\n    if count == 0:\n        return 0\n    return total / count\n", "entry_point": "calculate_average_attribute", "input": "'non_existing_attribute'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43110_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "688", "output": "{1, 2, 4, 8, 43, 172, 688, 16, 86, 344}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt687", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007307", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2734", "output": "{1, 2, 2734, 1367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007308", "code": "def get_learning_rate(epoch, lr_schedule):\n    closest_epoch = max(filter(lambda x: x <= epoch, lr_schedule.keys()))\n    return lr_schedule[closest_epoch]\n", "entry_point": "get_learning_rate", "input": "5, {1: 0.01, 3: 0.005, 5: 0.001}", "output": "0.001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78080_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6185", "output": "{1237, 1, 5, 6185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007310", "code": "def transform_response(response):\n    value = response.get('index', '')  # Extract the value associated with the key 'index'\n    length = len(value)  # Calculate the length of the value string\n    transformed_dict = {length: value}  # Create a new dictionary with length as key and value as value\n    return transformed_dict\n", "entry_point": "transform_response", "input": "{'index': ''}", "output": "{0: ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007311", "code": "def find_special_number(n: int) -> int:\n    prod = 1\n    sum_ = 0\n    while n > 0:\n        last_digit = n % 10\n        prod *= last_digit\n        sum_ += last_digit\n        n //= 10\n    return prod - sum_\n", "entry_point": "find_special_number", "input": "63", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121266_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007312", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'example.txt'", "output": "('example', '.txt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007313", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007314", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9147", "output": "{3, 1, 9147, 3049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007315", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007316", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[10, 20, 15, 30, 40, 30, 25, 40]", "output": "[5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007317", "code": "import ast\ndef count_function_calls(script):\n    function_calls = {}\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call):\n            if isinstance(node.func, ast.Name):\n                function_name = node.func.id\n                function_calls[function_name] = function_calls.get(function_name, 0) + 1\n    return function_calls\n", "entry_point": "count_function_calls", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113446_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007318", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "67", "output": "{1, 67}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt66", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007319", "code": "def calculate_similarity_score(str1, str2):\n    if len(str1) != len(str2):\n        raise ValueError(\"Input strings must have the same length\")\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            similarity_score += 1\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "'a', 'b'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105365_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007320", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "104, 10, 8", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007321", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    new_list = []\n    for i in range(len(lst) - 1):\n        new_list.append(lst[i] + lst[i + 1])\n    new_list.append(lst[-1] + lst[0])\n    return new_list\n", "entry_point": "process_list", "input": "[0, 3, 4, 3, 3, 5]", "output": "[3, 7, 7, 6, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64952_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007322", "code": "def find_single_integer(nums):\n    integersDict = {}\n    for num in nums:\n        if num in integersDict:\n            integersDict[num] += 1\n        else:\n            integersDict[num] = 1\n    for integer in integersDict:\n        if integersDict[integer] != 3:\n            return integer\n    return nums[0]\n", "entry_point": "find_single_integer", "input": "[8, 1, 1, 1, 2, 2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39275_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007323", "code": "import math\ndef mint_pizza(slices_per_person, slices_per_pizza):\n    total_slices_needed = sum(slices_per_person)\n    min_pizzas = math.ceil(total_slices_needed / slices_per_pizza)\n    return min_pizzas\n", "entry_point": "mint_pizza", "input": "[8, 8, 8, 8, 8, 8], 8", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149850_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9032", "output": "{1, 2, 4516, 4, 9032, 8, 1129, 2258}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9031", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007325", "code": "import os\nimport glob\ndef identify_plugins_to_check(MODULE, EXTERNAL_PLUGINS_PATH):\n    internal_plugins_to_check = []\n    external_plugins_to_check = []\n    for key, value in os.environ.items():\n        begin = \"%s_INTERNAL_PLUGINS_INSTALL_\" % MODULE\n        if key.startswith(begin) and value.strip() == \"1\":\n            internal_plugins_to_check.append(key.replace(begin, \"\").lower())\n    for fil in glob.glob(\"%s/*.plugin\" % EXTERNAL_PLUGINS_PATH):\n        h = get_plugin_hash(fil, mode=\"file\")\n        if h:\n            external_plugins_to_check.append(fil)\n    return internal_plugins_to_check, external_plugins_to_check\n", "entry_point": "identify_plugins_to_check", "input": "'TEST', '/non/existent/path'", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96875_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007326", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007327", "code": "def count_file_extensions(file_paths):\n    file_extensions_count = {}\n    # Split the input string by spaces to get individual file paths\n    paths = file_paths.strip().split()\n    for path in paths:\n        # Extract the file extension by splitting at the last '.' in the path\n        extension = path.split('.')[-1].lower() if '.' in path else ''\n        # Update the count of the file extension in the dictionary\n        file_extensions_count[extension] = file_extensions_count.get(extension, 0) + 1\n    return file_extensions_count\n", "entry_point": "count_file_extensions", "input": "'script.py'", "output": "{'py': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21533_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007328", "code": "def highest_performance_score(scores):\n    if not scores:\n        return None\n    max_score = scores[0]  # Initialize max_score with the first score in the list\n    for score in scores:\n        if score > max_score:\n            max_score = score\n    return max_score\n", "entry_point": "highest_performance_score", "input": "[95, 98, 92, 89]", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109212_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007329", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 4, 6, 15]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007330", "code": "def generate_decoder_dimensions(encode_dim, latent):\n    # Reverse the encoder dimensions list\n    decode_dim = list(reversed(encode_dim))\n    # Append the latent size at the end\n    decode_dim.append(latent)\n    return decode_dim\n", "entry_point": "generate_decoder_dimensions", "input": "[3200, 1600, 800, 400], 10", "output": "[400, 800, 1600, 3200, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112112_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007331", "code": "import glob\nfrom typing import List\ndef process_yaml_files(dn_path: str = '') -> List[str]:\n    if dn_path:\n        dn_list = glob.glob(dn_path + '*.yml')\n    else:\n        dn_list = glob.glob('../data_needed/*.yml')\n    return dn_list\n", "entry_point": "process_yaml_files", "input": "'non_existent_directory/'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62188_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007332", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n in [0, 1]:\n        return n\n    else:\n        result = fibonacci_memo(n-1, memo) + fibonacci_memo(n-2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83419_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007333", "code": "EXPERIMENTS_BASE_FILE_PATH = \"/../experiments/base_model/model_params.json\"\nEXPERIMENTS_EFF_FILE_PATH = \"/../experiments/efficient_net/model_params.json\"\nMETRIC_THRESHOLD = 0.5\ndef choose_model_file(metric_value):\n    if metric_value >= METRIC_THRESHOLD:\n        return EXPERIMENTS_EFF_FILE_PATH\n    else:\n        return EXPERIMENTS_BASE_FILE_PATH\n", "entry_point": "choose_model_file", "input": "0.5", "output": "'/../experiments/efficient_net/model_params.json'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76735_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007334", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[2, 5, 1]", "output": "[5, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007335", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'COOexpr r: LOON:'", "output": "('COOexpr r', 'LOON', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007336", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "7, 3", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007337", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'10010'", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007338", "code": "import datetime\ndef get_pin(lose_date):\n    today = datetime.datetime.today()\n    tomorrow = today + datetime.timedelta(days=1)\n    red_bound = today.replace(hour=23, minute=59, second=59).timestamp()\n    yellow_bound = tomorrow.replace(hour=23, minute=59, second=59).timestamp()\n    if lose_date <= red_bound:\n        return 9  # red PIN\n    elif lose_date <= yellow_bound:\n        return 10  # yellow PIN\n    else:\n        return 11  # green PIN\n", "entry_point": "get_pin", "input": "datetime.datetime.now().timestamp()", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82948_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1398", "output": "{1, 2, 3, 6, 233, 466, 1398, 699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007340", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[7, 1, 2, 3, 4]", "output": "[7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007341", "code": "def calculate_total_blocks(dataset_size, block_size, blocks_per_file):\n    num_blocks_x = dataset_size[0] // block_size[0]\n    num_blocks_y = dataset_size[1] // block_size[1]\n    num_blocks_z = dataset_size[2] // block_size[2]\n    total_blocks = num_blocks_x * num_blocks_y * num_blocks_z\n    total_files = total_blocks // blocks_per_file\n    return total_blocks, total_files\n", "entry_point": "calculate_total_blocks", "input": "(40, 40, 80), (10, 10, 10), 256", "output": "(128, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98188_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007342", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'Hol\u00e0 oic Hos'", "output": "'Hol\u00e0 oic Hos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007343", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "'http://s'", "output": "'s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007344", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3357", "output": "{1, 3, 9, 373, 3357, 1119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007345", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[7]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007346", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "0.4, 2", "output": "0.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007347", "code": "import datetime\ndef optimize_data(dataDictionary):\n    oldest = 0\n    maxSteps = 0\n    for i in dataDictionary:\n        createdDate = datetime.datetime.fromisoformat(dataDictionary[i]['CreatedDate'])\n        currentDate = datetime.datetime.now()\n        difference = currentDate - createdDate\n        daysOfDifference = difference.days\n        dataDictionary[i]['daysDiff'] = daysOfDifference\n        if daysOfDifference > oldest:\n            oldest = daysOfDifference\n        if dataDictionary[i]['Steps'] > maxSteps:\n            maxSteps = dataDictionary[i]['Steps']\n    return oldest, maxSteps\n", "entry_point": "optimize_data", "input": "{}", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31417_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007348", "code": "def count_names(input_str):\n    name_counts = {}\n    names = input_str.split(',')\n    for name in names:\n        name = name.strip().lower()\n        name_counts[name] = name_counts.get(name, 0) + 1\n    return name_counts\n", "entry_point": "count_names", "input": "'mamarkkmary,'", "output": "{'mamarkkmary': 1, '': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64824_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007349", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[-1, 11, 0, 0, 1, 1]", "output": "[-1, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007350", "code": "def format_column_name(raw_column_name, year):\n    raw_column_name = '_'.join(raw_column_name.lower().split())\n    raw_column_name = raw_column_name.replace('_en_{}_'.format(year), '_')\n    formatted_column_name = raw_column_name.replace('\u00e9', 'e')  # Replace accented '\u00e9' with 'e'\n    return formatted_column_name\n", "entry_point": "format_column_name", "input": "'reverevenue_en_2021_eiil', 2021", "output": "'reverevenue_eiil'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25598_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007351", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "0", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007352", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 5, 5, 4, 5, 4, 5]", "output": "[8, 10, 9, 9, 9, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31739_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007353", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'abc def tfoxhtee ghijkl'", "output": "['tfoxhtee']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007354", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1317", "output": "{1, 3, 1317, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007356", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "1.998333333333334, 5", "output": "0.3996666666666668", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007357", "code": "def generate_fibonacci_sequence(n):\n    ult = 0\n    num = 1\n    sequence = []\n    while num <= n:\n        sequence.append(num)\n        ult, num = num, ult + num\n    return sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "144", "output": "[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53548_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4645", "output": "{1, 5, 929, 4645}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007359", "code": "def parse_css(input_string):\n    css_rules = {}\n    rules = input_string.split('{')\n    for rule in rules:\n        if '}' in rule:\n            selector, properties = rule.split('}')\n            selector = selector.strip()\n            properties = properties.strip()\n            if selector and properties:\n                properties_dict = {}\n                for prop in properties.split(';'):\n                    prop = prop.strip()\n                    if prop:\n                        prop_parts = prop.split(':')\n                        if len(prop_parts) == 2:\n                            key, value = prop_parts\n                            properties_dict[key.strip()] = value.strip()\n                css_rules[selector] = properties_dict\n    return css_rules\n", "entry_point": "parse_css", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145077_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007360", "code": "JETBRAINS_IDES = {\n    'androidstudio': 'Android Studio',\n    'appcode': 'AppCode',\n    'datagrip': 'DataGrip',\n    'goland': 'GoLand',\n    'intellij': 'IntelliJ IDEA',\n    'pycharm': 'PyCharm',\n    'rubymine': 'RubyMine',\n    'webstorm': 'WebStorm'\n}\nJETBRAINS_IDE_NAMES = list(JETBRAINS_IDES.values())\ndef count_ide_names_with_substring(substring: str) -> int:\n    count = 0\n    lowercase_substring = substring.lower()\n    for ide_name in JETBRAINS_IDE_NAMES:\n        if lowercase_substring in ide_name.lower():\n            count += 1\n    return count\n", "entry_point": "count_ide_names_with_substring", "input": "'code'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102649_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007361", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "10", "output": "193", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007362", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'HoHHHHHH'", "output": "'HoHHHHHH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007363", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'myapp.cerg'", "output": "'cerg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007364", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454406", "output": "'<t:1630454406>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007365", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3362", "output": "{1, 3362, 2, 41, 1681, 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007366", "code": "import re\ndef check_valid_password(password):\n    if len(password) < 8:\n        return False\n    if not re.search(r\"[A-Z]\", password):\n        return False\n    if not re.search(r\"[a-z]\", password):\n        return False\n    if not re.search(r\"\\d\", password):\n        return False\n    if not re.search(r\"[!@#$%^&*()-_+=]\", password):\n        return False\n    return True\n", "entry_point": "check_valid_password", "input": "'Password1!'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35155_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007367", "code": "from typing import List\ndef calculate_highest_score(scores: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = score + exclude\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "calculate_highest_score", "input": "[10, 0, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24235_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007368", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'1.1'", "output": "(1, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007369", "code": "def calculate_output(n):\n    remainder = n % 8\n    if remainder == 0:\n        return 2\n    elif remainder <= 5:\n        return remainder\n    else:\n        return 10 - remainder\n", "entry_point": "calculate_output", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17799_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007370", "code": "def check_pangram(s):\n    cleaned_str = ''.join(c for c in s.lower() if c.isalpha())\n    unique_chars = set(cleaned_str)\n    if len(unique_chars) == 26:\n        return \"pangram\"\n    else:\n        return \"not pangram\"\n", "entry_point": "check_pangram", "input": "'The quick brown fox jumps over the lazy d'", "output": "'not pangram'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23402_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007371", "code": "def min_operations(seq1, seq2):\n    size_x = len(seq1) + 1\n    size_y = len(seq2) + 1\n    matrix = [[0 for _ in range(size_y)] for _ in range(size_x)]\n    for x in range(1, size_x):\n        matrix[x][0] = x\n    for y in range(1, size_y):\n        matrix[0][y] = y\n    for x in range(1, size_x):\n        for y in range(1, size_y):\n            if seq1[x-1] == seq2[y-1]:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1],\n                    matrix[x][y-1] + 1\n                )\n            else:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1] + 1,\n                    matrix[x][y-1] + 1\n                )\n    return matrix[size_x - 1][size_y - 1]\n", "entry_point": "min_operations", "input": "'abcdefg', 'xyzuvwxy'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43241_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007372", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4657", "output": "{1, 4657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007373", "code": "from typing import List, Tuple\ndef card_game(deck: List[int]) -> Tuple[int, int]:\n    score_player1 = 0\n    score_player2 = 0\n    for i in range(0, len(deck), 2):\n        if deck[i] > deck[i + 1]:\n            score_player1 += 1\n        else:\n            score_player2 += 1\n    return score_player1, score_player2\n", "entry_point": "card_game", "input": "[5, 3, 2, 4, 6, 2, 1, 3]", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_218_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007374", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5132", "output": "{1, 2, 1283, 4, 2566, 5132}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5131", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6889", "output": "{1, 83, 6889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007376", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 1, 3, 3, 2, 2, 2, 4]", "output": "{1: 3, 3: 2, 2: 3, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007377", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'key2=vklue2'", "output": "{'key2': 'vklue2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007378", "code": "def count_pairs_divisible_by_3(nums):\n    nums.sort()\n    l_count = 0\n    m_count = 0\n    result = 0\n    for num in nums:\n        if num % 3 == 1:\n            l_count += 1\n        elif num % 3 == 2:\n            m_count += 1\n    result += l_count * m_count  # Pairs where one element leaves remainder 1 and the other leaves remainder 2\n    result += (l_count * (l_count - 1)) // 2  # Pairs where both elements leave remainder 1\n    result += (m_count * (m_count - 1)) // 2  # Pairs where both elements leave remainder 2\n    return result\n", "entry_point": "count_pairs_divisible_by_3", "input": "[1, 1, 2, 2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47070_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007379", "code": "import platform\ndef get_binary_paths(platform_name):\n    if \"Windows\" in platform_name:\n        git_binary = \"C:\\\\Program Files\\\\Git\\\\bin\\\\git.exe\"\n        diff_binary = \"C:\\\\Program Files\\\\Git\\\\usr\\\\bin\\\\diff.exe\"\n    else:\n        git_binary = \"git\"\n        diff_binary = \"diff\"\n    return git_binary, diff_binary\n", "entry_point": "get_binary_paths", "input": "'Linux'", "output": "('git', 'diff')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40844_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007380", "code": "def calculate_final_time(b, max_var_fixed):\n    final_best_time = 0\n    for max_b, variable, fixed in max_var_fixed:\n        passed_bits = min(b, max_b)\n        b -= passed_bits\n        final_best_time += fixed + variable * passed_bits\n        if not b:\n            return final_best_time\n    return final_best_time\n", "entry_point": "calculate_final_time", "input": "10, [(5, 4, 0), (5, 0, 8)]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41267_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007381", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "20, 10, '+'", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007382", "code": "def evaluate_expression(expression):\n    expression = expression.replace('^', '**')  # Replace '^' with '**' for exponentiation\n    try:\n        result = eval(expression)  # Evaluate the expression\n        return result\n    except Exception as e:\n        return f\"Error: {e}\"  # Return an error message if evaluation fails\n", "entry_point": "evaluate_expression", "input": "'0 - 2'", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72501_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007383", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "100, -13.64914042810116", "output": "-113.64914042810116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007384", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[75, 74], 2", "output": "74.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007385", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(2, 6, 340)", "output": "7161", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007386", "code": "import re\ndef extract_variables(query):\n    # Regular expression pattern to match variables in SPARQL query\n    pattern = r'\\?[\\w]+'\n    # Find all matches of variables in the query\n    variables = re.findall(pattern, query)\n    # Return a list of distinct variables\n    return list(set(variables))\n", "entry_point": "extract_variables", "input": "'?o'", "output": "['?o']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16424_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007387", "code": "def serviceLane(width, cases):\n    result = []\n    for case in cases:\n        start, end = case\n        segment = width[start:end+1]\n        min_width = min(segment)\n        result.append(min_width)\n    return result\n", "entry_point": "serviceLane", "input": "[3, 3, 3, 5, 4], [(0, 2), (1, 3), (2, 4)]", "output": "[3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129083_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007388", "code": "def mod_lcm(numbers, mod):\n    def lcm(x, y):\n        while y != 0:\n            z = x % y\n            x = y\n            y = z\n        return x\n    def modmlt(x, y):\n        return (x * y) % mod\n    def mod_lcm_two(x, y):\n        return modmlt(x, y) // lcm(x, y)\n    result = numbers[0]\n    for num in numbers[1:]:\n        result = mod_lcm_two(result, num)\n    return result % mod\n", "entry_point": "mod_lcm", "input": "[0, 5, 10], 7", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67695_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007389", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[0, 6, 8, -1]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105369_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007390", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'hello!'", "output": "['hello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007391", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "5, 0", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007392", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'is'", "output": "['is']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007393", "code": "from typing import List\ndef min_classrooms(students: List[int]) -> int:\n    classrooms = 0\n    current_students = 0\n    for num_students in students:\n        if current_students + num_students <= 30:\n            current_students += num_students\n        else:\n            classrooms += 1\n            current_students = num_students\n    if current_students > 0:\n        classrooms += 1\n    return classrooms\n", "entry_point": "min_classrooms", "input": "[25, 25, 25, 25, 30, 30]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149205_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007394", "code": "def count_fields(settings_panels):\n    field_counts = {}\n    for panel in settings_panels:\n        panel_type = list(panel.keys())[0]\n        fields = panel[panel_type]\n        field_counts[panel_type] = field_counts.get(panel_type, 0) + len(fields)\n    return field_counts\n", "entry_point": "count_fields", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17609_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007395", "code": "import re\ndef extract_system_settings(config_data):\n    settings = {}\n    for line in config_data.split('\\n'):\n        match = re.match(r\"settings\\.base\\.system_name = (.+)\", line)\n        if match:\n            settings['system_name'] = match.group(1)\n        match = re.match(r\"settings\\.base\\.theme = (.+)\", line)\n        if match:\n            settings['theme'] = match.group(1)\n        match = re.match(r\"settings\\.security\\.self_registration = (.+)\", line)\n        if match:\n            settings['self_registration'] = bool(match.group(1))\n        match = re.match(r\"settings\\.auth\\.registration_requires_verification = (.+)\", line)\n        if match:\n            settings['registration_requires_verification'] = bool(match.group(1))\n        match = re.match(r\"settings\\.auth\\.registration_link_user_to_default = \\[(.+)\\]\", line)\n        if match:\n            settings['registration_link_user_to_default'] = [role.strip() for role in match.group(1).split(',')]\n    return settings\n", "entry_point": "extract_system_settings", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22018_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007396", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<jth@example.org>'", "output": "('jth@example.org', 'example.org')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007397", "code": "def calculate_inventory_value(inventory):\n    total_value = 0\n    for item in inventory:\n        total_value += item['price'] * item['quantity']\n    return total_value\n", "entry_point": "calculate_inventory_value", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21362_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007398", "code": "def extract_url_prefixes(url_patterns):\n    unique_prefixes = set()\n    for url_pattern in url_patterns:\n        first_slash_index = url_pattern.find('/')\n        if first_slash_index != -1:\n            prefix = url_pattern[:first_slash_index]\n            unique_prefixes.add(prefix)\n    return unique_prefixes\n", "entry_point": "extract_url_prefixes", "input": "['example', 'test', 'anotherTest']", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117075_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007399", "code": "from decimal import Decimal\ndef htdf_to_satoshi(amount_htdf):\n    amount_decimal = Decimal(str(amount_htdf))  # Convert input to Decimal\n    satoshi_value = int(amount_decimal * (10 ** 8))  # Convert HTDF to satoshi\n    return satoshi_value\n", "entry_point": "htdf_to_satoshi", "input": "139623.7186", "output": "13962371860000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13302_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007400", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'CAcxC:\\\\Users\\\\Admin\\\\SomeFile.txt'", "output": "'CAcxC:\\\\Users\\\\Admin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6796", "output": "{1, 2, 1699, 4, 3398, 6796}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6795", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007402", "code": "def findProductOfPair(numbers, target):\n    seen_numbers = set()\n    for num in numbers:\n        diff = target - num\n        if diff in seen_numbers:\n            return num * diff\n        seen_numbers.add(num)\n    return -1\n", "entry_point": "findProductOfPair", "input": "[7, 8], 10", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108235_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007403", "code": "import re\ntimestamp_regex = '\\\\d{4}[-]?\\\\d{1,2}[-]?\\\\d{1,2} \\\\d{1,2}:\\\\d{1,2}:\\\\d{1,2}'\ndef validate_timestamp(timestamp):\n    pattern = re.compile(timestamp_regex)\n    return bool(pattern.match(timestamp))\n", "entry_point": "validate_timestamp", "input": "'2023-03-15 14:30:45'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52793_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007404", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2021-01-01', '2021-01-31'", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007405", "code": "def count_paths(n):\n    s = [[0] * 10 for _ in range(n + 1)]\n    s[1] = [0] + [1] * 9\n    mod = 1000 ** 3\n    for i in range(2, n + 1):\n        for j in range(0, 9 + 1):\n            if j >= 1:\n                s[i][j] += s[i - 1][j - 1]\n            if j <= 8:\n                s[i][j] += s[i - 1][j + 1]\n    return sum(s[n]) % mod\n", "entry_point": "count_paths", "input": "7", "output": "424", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21515_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007406", "code": "import os\ndef get_maya_os(DEFAULT_DCC):\n    # Extract the file extension from the DEFAULT_DCC value\n    file_extension = os.path.splitext(DEFAULT_DCC)[1]\n    # Map file extensions to operating systems\n    os_mapping = {\n        '.exe': 'Windows',\n        '.app': 'Mac',\n        '.sh': 'Linux'\n    }\n    # Check if the file extension is in the mapping\n    if file_extension in os_mapping:\n        return os_mapping[file_extension]\n    else:\n        return 'Unknown'\n", "entry_point": "get_maya_os", "input": "'program.exe'", "output": "'Windows'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75657_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007407", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[10, 20, 30, 40, 50, 60]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007408", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'d df'", "output": "'D Df'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007409", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[1, 2, 3, 4]", "output": "[1, 3, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007410", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import something.gr'", "output": "'gr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3757", "output": "{1, 289, 13, 3757, 17, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007412", "code": "def check_read_pairs(read_names):\n    read_pairs = {}\n    for name in read_names:\n        read_id, pair_suffix = name.split('/')\n        if read_id in read_pairs:\n            if read_pairs[read_id] != pair_suffix:\n                return False\n        else:\n            read_pairs[read_id] = pair_suffix\n    return True\n", "entry_point": "check_read_pairs", "input": "['id1/1', 'id1/2']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52460_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007413", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[18.0, 18.0, 18.1, 18.2, 18.3]", "output": "18.12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007414", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "6", "output": "[(1, 6), (2, 3), (3, 2), (6, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6005", "output": "{1, 5, 1201, 6005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6004", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007416", "code": "def extract_project_name(code_snippet):\n    start_phrase = 'This project demonstrates'\n    start_index = code_snippet.find(start_phrase)\n    if start_index == -1:\n        return \"Project name not found\"\n    start_index += len(start_phrase)\n    start_quote = code_snippet.find('\"', start_index)\n    end_quote = code_snippet.find('\"', start_quote + 1)\n    if start_quote == -1 or end_quote == -1:\n        return \"Project name not found\"\n    return code_snippet[start_quote + 1:end_quote]\n", "entry_point": "extract_project_name", "input": "'The quick brown fox jumps over the lazy dog.'", "output": "'Project name not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4527_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007417", "code": "DOCUMENT_FORMATS = (\n    \".doc\",\n    \".docx\",\n    \".rtf\",\n    \".htm\",\n    \".html\",\n    \".txt\",\n    \".zip\",\n    \".mobi\",\n    \".pdf\",\n    \".jpg\",\n    \".gif\",\n    \".bmp\",\n    \".png\",\n)\ndef filter_documents(file_names):\n    filtered_files = []\n    for file_name in file_names:\n        for doc_format in DOCUMENT_FORMATS:\n            if file_name.endswith(doc_format):\n                filtered_files.append(file_name)\n                break  # Break the inner loop once a match is found\n    return filtered_files\n", "entry_point": "filter_documents", "input": "['file1.exe', 'file2.exe', 'file3.exe']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71703_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007418", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[1, 5, 6, 0, 5, 5]", "output": "[2, 10, 12, 0, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007419", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[25]", "output": "'0x19'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007420", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[2, 4, 1, 3, 2, 4]", "output": "[2, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007421", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 1, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122887_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007422", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[16, 5, 32]", "output": "2560", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007423", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "4.8, 1", "output": "4.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007424", "code": "import math\ndef adjust_to_tick(value, tick):\n    remainder = value % tick\n    adjusted_value = value - remainder\n    return adjusted_value\n", "entry_point": "adjust_to_tick", "input": "17.0, 5.0", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4653_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5829", "output": "{1, 3, 67, 5829, 201, 87, 1943, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007426", "code": "import math\ndef getRow(rowIndex):\n    result = [1]\n    if rowIndex == 0:\n        return result\n    n = rowIndex\n    for i in range(int(math.ceil((float(rowIndex) + 1) / 2) - 1)):\n        result.append(result[-1] * n / (rowIndex - n + 1))\n        n -= 1\n    if rowIndex % 2 == 0:\n        result.extend(result[-2::-1])\n    else:\n        result.extend(result[::-1])\n    return result\n", "entry_point": "getRow", "input": "3", "output": "[1, 3.0, 3.0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127863_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007427", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007428", "code": "def extract_semantic_version(version):\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(''.join(filter(str.isdigit, version_parts[2])))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.10.0'", "output": "(0, 10, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111562_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007429", "code": "def calculate_routes(m, n):\n    # Initialize a 2D array to store the number of routes to reach each cell\n    routes = [[0 for _ in range(n)] for _ in range(m)]\n    # Initialize the number of routes to reach the starting point as 1\n    routes[0][0] = 1\n    # Calculate the number of routes for each cell in the grid\n    for i in range(m):\n        for j in range(n):\n            if i > 0:\n                routes[i][j] += routes[i - 1][j]  # Add the number of routes from above cell\n            if j > 0:\n                routes[i][j] += routes[i][j - 1]  # Add the number of routes from left cell\n    # The number of routes to reach the destination is stored in the bottom-right cell\n    return routes[m - 1][n - 1]\n", "entry_point": "calculate_routes", "input": "3, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9475_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007430", "code": "import re\ndef parse_show_mab_output(output):\n    devices = []\n    pattern = r'Device hostname: (.*?)\\nMAC address: (.*?)\\nInterface: (.*?)\\nIP address: (.*?)\\n\\n'\n    matches = re.findall(pattern, output, re.DOTALL)\n    for match in matches:\n        device_info = {\n            'hostname': match[0],\n            'mac_address': match[1],\n            'interface': match[2],\n            'ip_address': match[3]\n        }\n        devices.append(device_info)\n    return devices\n", "entry_point": "parse_show_mab_output", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145316_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007431", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'Alisa'", "output": "'AlisaasilA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007432", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3077", "output": "{1, 3077, 17, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007433", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return 0\n    max1 = max2 = max3 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[9, -3, -11, 1, 2]", "output": "297", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4670_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007434", "code": "def process_string(input_string):\n    modified_string = input_string.replace(\"python\", \"Java\").replace(\"code\", \"\").replace(\"snippet\", \"program\")\n    return modified_string\n", "entry_point": "process_string", "input": "'snippet'", "output": "'program'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6573_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007435", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[2, 2, 3, 12]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007436", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[1, 2, 4]", "output": "([1, 2, 4], 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007437", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[[3], 7]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007438", "code": "def maxPower(s):\n    if not s:\n        return 0\n    max_power = 1\n    current_power = 1\n    current_char = s[0]\n    current_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            current_count += 1\n        else:\n            current_char = s[i]\n            current_count = 1\n        max_power = max(max_power, current_count)\n    return max_power\n", "entry_point": "maxPower", "input": "'ab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40173_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007439", "code": "def convert_invoices(invoices, exchange_rates):\n    converted_invoices = []\n    for invoice in invoices:\n        currency = invoice['currency']\n        amount = invoice['amount']\n        if currency in exchange_rates:\n            converted_amount = amount * exchange_rates[currency]\n            converted_invoice = {'id': invoice['id'], 'amount': converted_amount, 'currency': currency}\n        else:\n            converted_invoice = invoice\n        converted_invoices.append(converted_invoice)\n    return converted_invoices\n", "entry_point": "convert_invoices", "input": "[], {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80345_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007440", "code": "import os\ndef list_algorithms(path):\n    installed_algs = []\n    alg_path = os.path.join(path, 'algorithms')\n    for root, dirs, _ in os.walk(alg_path):\n        for algdir in dirs:\n            parent = root[root.rfind(os.sep) + 1:]\n            if parent == 'algorithms':\n                temp_path = get_json_path(path, algdir)\n            else:\n                temp_path = get_json_path(path, parent + os.sep + algdir)\n            temp_alg = get_algorithm(temp_path)\n            if temp_alg != {}:\n                installed_algs.append(temp_alg)\n    return sorted(installed_algs, key=lambda k: k['name'])\n", "entry_point": "list_algorithms", "input": "'/not/existing/path'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73357_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007441", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "806", "output": "{1, 2, 806, 13, 403, 26, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007442", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "0, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007443", "code": "def process_dependencies(dependencies):\n    dependency_dict = {}\n    for key, value in dependencies:\n        if key in dependency_dict:\n            dependency_dict[key].append(value)\n        else:\n            dependency_dict[key] = [value]\n    return dependency_dict\n", "entry_point": "process_dependencies", "input": "[('A', 'B'), ('C', 'D'), ('E', 'F')]", "output": "{'A': ['B'], 'C': ['D'], 'E': ['F']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147184_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007444", "code": "def bitonic(a, n):\n    for i in range(1, n):\n        if a[i] < a[i - 1]:\n            return i - 1\n    return -1\n", "entry_point": "bitonic", "input": "[1, 2, 1], 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106120_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007445", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5932", "output": "{1, 2, 4, 1483, 5932, 2966}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5931", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007446", "code": "def word_to_number(word):\n    number_dict = {\n        'zero': 0, 'um': 1, 'dois': 2, 'tr\u00eas': 3, 'quatro': 4,\n        'cinco': 5, 'seis': 6, 'sete': 7, 'oito': 8, 'nove': 9, 'dez': 10\n    }\n    if word in number_dict:\n        return number_dict[word]\n    else:\n        return \"Invalid input word\"\n", "entry_point": "word_to_number", "input": "'cinco'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69473_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007447", "code": "def move_player(movements):\n    player_position = [0, 0]\n    winning_position = [3, 4]\n    for move in movements:\n        if move == 'U' and player_position[1] < 4:\n            player_position[1] += 1\n        elif move == 'D' and player_position[1] > 0:\n            player_position[1] -= 1\n        elif move == 'L' and player_position[0] > 0:\n            player_position[0] -= 1\n        elif move == 'R' and player_position[0] < 3:\n            player_position[0] += 1\n        if player_position == winning_position:\n            print(\"Congratulations, you won!\")\n            break\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['R', 'R', 'U', 'U']", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49262_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007448", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[4, 4, 4, 7, 7, 2, 6, 5]", "output": "{4: 3, 7: 2, 2: 1, 6: 1, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007449", "code": "def count_trailing_zeros(n):\n    count = 0\n    i = 5\n    while n // i > 0:\n        count += n // i\n        i *= 5\n    return count\n", "entry_point": "count_trailing_zeros", "input": "15", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135178_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007450", "code": "def extract_version_numbers(version_str):\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    revision = int(version_components[2].split('.')[0])  # Extract only the numeric part\n    return major, minor, revision\n", "entry_point": "extract_version_numbers", "input": "'4.4.4'", "output": "(4, 4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110593_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007451", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[3, 3, 3, 3, 1, 1, 1, 1, 2]", "output": "{3: 4, 1: 4, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007452", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007453", "code": "def calculate_dot_product(v1, v2):\n    if len(v1) != len(v2):\n        return \"Error: Vectors must have the same length\"\n    dot_product = sum(v1[i] * v2[i] for i in range(len(v1)))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 2, 3], [4, 5]", "output": "'Error: Vectors must have the same length'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86372_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007454", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007455", "code": "import os\ndef find_common_parent(path1, path2):\n    dirs1 = path1.split(os.sep)\n    dirs2 = path2.split(os.sep)\n    common_parent = []\n    for dir1, dir2 in zip(dirs1, dirs2):\n        if dir1 == dir2:\n            common_parent.append(dir1)\n        else:\n            break\n    if len(common_parent) > 1:  # At least the root directory is common\n        return os.sep.join(common_parent)\n    else:\n        return None\n", "entry_point": "find_common_parent", "input": "'/home/user1', '/home/user2'", "output": "'/home'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92196_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007456", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007457", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'sesers.some.intermediate.parts.Sersesfig'", "output": "('sesers', 'Sersesfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007458", "code": "from typing import Dict\nunits: Dict[str, int] = {\n    \"cryptodoge\": 10 ** 6,\n    \"mojo\": 1,\n    \"colouredcoin\": 10 ** 3,\n}\ndef convert_mojos_to_unit(amount: int, target_unit: str) -> float:\n    if target_unit in units:\n        conversion_factor = units[target_unit]\n        converted_amount = amount / conversion_factor\n        return converted_amount\n    else:\n        return f\"Conversion to {target_unit} is not supported.\"\n", "entry_point": "convert_mojos_to_unit", "input": "5000000, 'cryptodoge'", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007459", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "1, 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007460", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'20222..0.', 'rmrmfl'", "output": "\"[20222..0.]: 'rmrmfl'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007461", "code": "def find_smallest(lst):\n    smallest = float('inf')  # Initialize with a large value\n    for num in lst:\n        if num < smallest:\n            smallest = num\n    return smallest\n", "entry_point": "find_smallest", "input": "[-1, 0, 1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80996_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007462", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[10, 20, 30, 56, 8]", "output": "(56, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007463", "code": "from typing import List\ndef custom_reduce_product(nums: List[int]) -> int:\n    result = 1\n    for num in nums:\n        result *= num\n    return result\n", "entry_point": "custom_reduce_product", "input": "[10, 40]", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84659_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007464", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4721", "output": "{1, 4721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007465", "code": "def unique_paths_with_obstacles(grid):\n    m, n = len(grid), len(grid[0])\n    dp = [[0] * n for _ in range(m)]\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 1:\n                dp[i][j] = 0\n            elif i == 0 and j == 0:\n                dp[i][j] = 1\n            else:\n                dp[i][j] = (dp[i-1][j] if i > 0 else 0) + (dp[i][j-1] if j > 0 else 0)\n    return dp[m-1][n-1] % (10**9 + 7)\n", "entry_point": "unique_paths_with_obstacles", "input": "[[0, 0], [1, 0]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52953_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007466", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'file_par'", "output": "'par'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007467", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    scores.remove(min_score)\n    if len(scores) == 0:\n        return 0.0\n    return sum(scores) / len(scores)\n", "entry_point": "calculate_average", "input": "[60, 90, 80, 85, 95, 100, 90, 60]", "output": "85.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142282_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007468", "code": "def play_card_game(deck):\n    dp_include = [0] * len(deck)\n    dp_skip = [0] * len(deck)\n    dp_include[0] = deck[0]\n    dp_skip[0] = 0 if deck[0] % 3 == 0 else deck[0]\n    for i in range(1, len(deck)):\n        dp_include[i] = max(dp_skip[i-1] + deck[i], dp_include[i-1])\n        dp_skip[i] = max(dp_include[i-1] if deck[i] % 3 != 0 else 0, dp_skip[i-1])\n    return max(dp_include[-1], dp_skip[-1])\n", "entry_point": "play_card_game", "input": "[10, 13]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50885_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007469", "code": "from typing import List\ndef check_sequence(nums: List[int]) -> bool:\n    l = len(nums)\n    end = 1\n    for index in range(1, l):\n        val = nums[l - index - 1]\n        if val >= end:\n            end = 1\n        else:\n            end += 1\n    return end == 1\n", "entry_point": "check_sequence", "input": "[1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42198_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007470", "code": "def concatenate_string(s, n):\n    result = \"\"\n    for i in range(n):\n        result += s\n    return result\n", "entry_point": "concatenate_string", "input": "'hohellol', 4", "output": "'hohellolhohellolhohellolhohellol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24778_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007471", "code": "from typing import List\ndef find_first_duplicate(A: List[int]) -> int:\n    seen = set()\n    for num in A:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 5, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55340_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007472", "code": "import bisect\ndef findKth(nums, k):\n    if not nums or k <= 0:\n        return -1\n    low = min(min(arr) for arr in nums)\n    high = max(max(arr) for arr in nums)\n    result = -1\n    while low <= high:\n        mid = (low + high) // 2\n        count = sum(len(arr) - bisect.bisect_left(arr, mid) for arr in nums)\n        if count >= k:\n            result = mid\n            high = mid - 1\n        else:\n            low = mid + 1\n    return result if k <= sum(len(arr) for arr in nums) else -1\n", "entry_point": "findKth", "input": "[], 1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51522_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007473", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[0, 5, 3, 6, 5, 2, 3]", "output": "[0, 5, 8, 14, 19, 21, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007474", "code": "def find_unique_number(nums):\n    unique_num = 0\n    for num in nums:\n        unique_num ^= num\n    return unique_num\n", "entry_point": "find_unique_number", "input": "[3, 3, 5, 5, 11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126841_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007475", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 87, 85]", "output": "87.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81933_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007476", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "8", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007477", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "'any_user_id_value', 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007478", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 81, 82]", "output": "81.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137363_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007479", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[0, 10], [5, 4]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007480", "code": "YEAR_CHOICES = (\n    (1, 'First'),\n    (2, 'Second'),\n    (3, 'Third'),\n    (4, 'Fourth'),\n    (5, 'Fifth'),\n)\ndef get_ordinal(year):\n    for num, ordinal in YEAR_CHOICES:\n        if num == year:\n            return ordinal\n    return \"Unknown\"\n", "entry_point": "get_ordinal", "input": "2", "output": "'Second'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43813_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007481", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[2, 5, 10, 20, 44]", "output": "(2, 44)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007482", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "663", "output": "{1, 3, 39, 13, 17, 51, 663, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt662", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007483", "code": "# Define the positions and their corresponding bitmask values\npositions = {\n    'catcher': 1,\n    'first_base': 2,\n    'second_base': 4,\n    'third_base': 8,\n    'short_stop': 16,\n    'outfield': 32,\n    'left_field': 64,\n    'center_field': 128,\n    'right_field': 256,\n    'designated_hitter': 512,\n    'pitcher': 1024,\n    'starting_pitcher': 2048,\n    'relief_pitcher': 4096\n}\ndef get_eligible_positions(player_mask):\n    eligible_positions = []\n    for position, mask in positions.items():\n        if player_mask & mask:\n            eligible_positions.append(position)\n    return eligible_positions\n", "entry_point": "get_eligible_positions", "input": "28", "output": "['second_base', 'third_base', 'short_stop']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51303_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007484", "code": "import re\ndef extract_module_versions(script):\n    version_pattern = re.compile(r'__version__ = \"(.*?)\"')\n    import_pattern = re.compile(r'from \\.(\\w+) import')\n    module_versions = {}\n    for line in script.split('\\n'):\n        import_match = import_pattern.search(line)\n        if import_match:\n            module_name = import_match.group(1)\n            version_match = version_pattern.search(line)\n            version = version_match.group(1) if version_match else None\n            module_versions[module_name] = version\n    return module_versions\n", "entry_point": "extract_module_versions", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127851_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4327", "output": "{1, 4327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007486", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(1, -1, 1, 1, 6, 2, 1, 6, 0)", "output": "'1.-1.1.1.6.2.1.6.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007487", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'zi10001}p: '", "output": "{'zi10001}p': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007488", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 7, 2]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86417_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007489", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[2, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007490", "code": "import os\ndef read_env_file(file_path):\n    env_data = {}\n    if not os.path.isfile(file_path):\n        return env_data\n    with open(file_path, 'r') as file:\n        for line in file:\n            line = line.strip()\n            if not line or '=' not in line:\n                continue\n            key, value = line.split('=', 1)\n            key = key.strip()\n            value = value.strip()\n            env_data[key] = value\n    return env_data\n", "entry_point": "read_env_file", "input": "'non_existent_env_file.env'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6878_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007491", "code": "def timeout_category(timeout):\n    KEEPALIVE_TIMEOUT = 10e-6\n    RECOVERY_TIMEOUT = 1e-3\n    if timeout <= KEEPALIVE_TIMEOUT:\n        return \"Keep-Alive Timeout\"\n    elif timeout <= RECOVERY_TIMEOUT:\n        return \"Recovery Timeout\"\n    else:\n        return \"Unknown Timeout\"\n", "entry_point": "timeout_category", "input": "0.0011", "output": "'Unknown Timeout'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22338_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007492", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'10.20.30'", "output": "'10.20.31'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2351", "output": "{1, 2351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007494", "code": "def sum_of_multiples_of_3_and_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples_of_3_and_5", "input": "[15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11094_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007495", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[5, 5]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007496", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "157", "output": "'?157'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007497", "code": "import re\ndef detect_card(input_str):\n    # Regular expression to match a sequence of 16 digits\n    pattern = r'\\d{16}'\n    # Search for the pattern in the input string\n    match = re.search(pattern, input_str)\n    # Return True if a match is found, indicating credit card information is present\n    return bool(match)\n", "entry_point": "detect_card", "input": "'My credit card number is 1234567812345678.'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39354_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8210", "output": "{1, 2, 5, 4105, 1642, 10, 8210, 821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8209", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007499", "code": "def extract_url_variables(code_snippet):\n    extracted_urls = {}\n    for line in code_snippet.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            key = key.strip()\n            value = value.strip().strip('\"').strip(\"'\")\n            if key.endswith('_URL'):\n                extracted_urls[key] = value\n    return extracted_urls\n", "entry_point": "extract_url_variables", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5021_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007500", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 1, 1, 2, 4, 4, 5, 3]", "output": "[1, 2, 3, 5, 8, 9, 11, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007501", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[300, 287, 274], 1, 3", "output": "287.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007502", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[23, 1, 23]", "output": "[23, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007503", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[8.1, 8.3]", "output": "8.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007504", "code": "def word_to_number(word):\n    number_dict = {\n        'zero': 0, 'um': 1, 'dois': 2, 'tr\u00eas': 3, 'quatro': 4,\n        'cinco': 5, 'seis': 6, 'sete': 7, 'oito': 8, 'nove': 9, 'dez': 10\n    }\n    if word in number_dict:\n        return number_dict[word]\n    else:\n        return \"Invalid input word\"\n", "entry_point": "word_to_number", "input": "'um'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69473_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007505", "code": "def transitive_reduction(graph):\n    n = len(graph)\n    closure = [row[:] for row in graph]\n    for k in range(n):\n        for i in range(n):\n            for j in range(n):\n                closure[i][j] = closure[i][j] or (closure[i][k] and closure[k][j])\n    reduction = [row[:] for row in graph]\n    for i in range(n):\n        for j in range(n):\n            if reduction[i][j]:\n                for k in range(n):\n                    if closure[j][k] and reduction[i][k]:\n                        reduction[i][k] = 0\n    return reduction\n", "entry_point": "transitive_reduction", "input": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]]", "output": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134961_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007506", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff57\uff28\uff28\uff4c\uff28\uff4c\uff4f'", "output": "'wHHlHlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007507", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "9", "output": "[0, 0, 1, 3, 6, 2, 7, 13, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007508", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_animtionteites', 0", "output": "'\\n  .width(test_animtionteites);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007509", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6472", "output": "{1, 2, 3236, 4, 6472, 8, 809, 1618}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6471", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007510", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'devicec: GP, memory_: 8GB'", "output": "{'devicec': 'GP', 'memory_': '8GB'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007511", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        if height > prev_height:\n            total_area += height\n        else:\n            total_area += prev_height\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[2, 5, 6, 4, 3]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147834_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007512", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'a', 'j'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007513", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[-2]", "output": "[(-2,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007514", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[5.0, [2.0, 3.5]]", "output": "10.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007515", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/home/user/usxample.'", "output": "'usxample.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007516", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[15, 8, 9, 16, 6, 15, 16, 16, 16]", "output": "[6, 8, 9, 15, 15, 16, 16, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007517", "code": "# Define dictionaries for section types and flags\nsection_types = {\n    0: 'SHT_NULL', 1: 'SHT_PROGBITS', 2: 'SHT_SYMTAB', 3: 'SHT_STRTAB',\n    4: 'SHT_RELA', 6: 'SHT_DYNAMIC', 8: 'SHT_NOBITS', 9: 'SHT_REL', 11: 'SHT_DYNSYM'\n}\nsection_flags = {\n    1<<0: 'SHF_WRITE', 1<<1: 'SHF_ALLOC', 1<<2: 'SHF_EXECINSTR',\n    1<<4: 'SHF_MERGE', 1<<5: 'SHF_STRINGS'\n}\ndef get_section_attributes(section_index):\n    if section_index in section_types:\n        section_type = section_types[section_index]\n        flags = [section_flags[flag] for flag in section_flags if flag & section_index]\n        return f\"Section {section_index} is of type {section_type} and has flags {' '.join(flags)}\"\n    else:\n        return \"Invalid section index.\"\n", "entry_point": "get_section_attributes", "input": "8", "output": "'Section 8 is of type SHT_NOBITS and has flags '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136296_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007518", "code": "def extract_trips(data):\n    total_trips = 0\n    for item in data.get('data', []):\n        total_trips += item.get('trips', 0) or 0\n    return total_trips\n", "entry_point": "extract_trips", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126402_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007519", "code": "def totalNQueens(n):\n    def is_safe(board, row, col):\n        for i in range(row):\n            if board[i] == col or abs(i - row) == abs(board[i] - col):\n                return False\n        return True\n    def backtrack(board, row):\n        nonlocal count\n        if row == n:\n            count += 1\n            return\n        for col in range(n):\n            if is_safe(board, row, col):\n                board[row] = col\n                backtrack(board, row + 1)\n    count = 0\n    board = [-1] * n\n    backtrack(board, 0)\n    return count\n", "entry_point": "totalNQueens", "input": "8", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107753_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007520", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[1, 1, 5, 5, 2, 2, 0]", "output": "[1, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007521", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "13", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007522", "code": "def days_exceeding_average(data, period_length):\n    result = []\n    avg_deaths = sum(data[:period_length]) / period_length\n    current_sum = sum(data[:period_length])\n    for i in range(period_length, len(data)):\n        if data[i] > avg_deaths:\n            result.append(i)\n        current_sum += data[i] - data[i - period_length]\n        avg_deaths = current_sum / period_length\n    return result\n", "entry_point": "days_exceeding_average", "input": "[1, 2, 3, 4, 5, 6, 10, 10, 10], 6", "output": "[6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74675_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007523", "code": "def parse_version(version_str):\n    # Split the version number string using the dot as the delimiter\n    version_parts = version_str.split('.')\n    # Convert the version number components to integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return a tuple containing the major, minor, and patch version numbers\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.6.3'", "output": "(1, 6, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42795_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007524", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'3.10.250'", "output": "'3.10.251'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45821_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9706", "output": "{1, 2, 422, 9706, 46, 211, 4853, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9705", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007526", "code": "def extract_imported_modules(code_snippet):\n    imports_dict = {}\n    lines = code_snippet.split('\\n')\n    current_dir = None\n    for line in lines:\n        if line.startswith('sys.path.append'):\n            current_dir = line.split(\"'\")[1]\n            imports_dict[current_dir] = []\n        elif line.startswith('from'):\n            module = line.split(' ')[-1].split(' ')[0]\n            if current_dir:\n                imports_dict[current_dir].append(module)\n    return imports_dict\n", "entry_point": "extract_imported_modules", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115063_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007527", "code": "from typing import List\ndef longest_subarray(arr: List[int], k: int) -> int:\n    prefix_sum_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    prefix_sum = 0\n    for i, num in enumerate(arr):\n        prefix_sum += num\n        remainder = prefix_sum % k\n        if remainder < 0:\n            remainder += k\n        if remainder in prefix_sum_remainder:\n            max_length = max(max_length, i - prefix_sum_remainder[remainder])\n        if remainder not in prefix_sum_remainder:\n            prefix_sum_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray", "input": "[1, 2, 1, 2, 1, 2], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6086_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007528", "code": "def calculate_average_price(prices):\n    total_sum = sum(prices)\n    average_price = total_sum / len(prices)\n    rounded_average = round(average_price)\n    return rounded_average\n", "entry_point": "calculate_average_price", "input": "[175000, 175000, 175000, 175000]", "output": "175000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112291_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007529", "code": "def find_missing(S):\n    full_set = set(range(10))\n    sum_S = sum(S)\n    sum_full_set = sum(full_set)\n    return sum_full_set - sum_S\n", "entry_point": "find_missing", "input": "[0, 1, 2, 4, 5, 6, 7, 8, 9]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109203_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007530", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[50, 60, 60, 70, 80]", "output": "[1, 2, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111970_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007531", "code": "# Define a function to simulate retrieving the block reward for a given block number\ndef get_block_reward(block_number):\n    # Simulate fetching the block reward from the blockchain API\n    # In a real scenario, this function would interact with the API to get the actual block reward\n    # For demonstration purposes, we will return a hardcoded reward based on the block number\n    if block_number % 2 == 0:\n        return 3.0\n    else:\n        return 2.5\n", "entry_point": "get_block_reward", "input": "0", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116660_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007532", "code": "# Constants\n_ACCELERATION_VALUE = 1\n_INDICATOR_SIZE = 8\n_ANIMATION_SEQUENCE = ['-', '\\\\', '|', '/']\ndef _get_busy_animation_part(index):\n    return _ANIMATION_SEQUENCE[index % len(_ANIMATION_SEQUENCE)]\n", "entry_point": "_get_busy_animation_part", "input": "2", "output": "'|'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97851_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007533", "code": "def encrypt_decrypt_message(message, shift):\n    result = \"\"\n    for char in message:\n        if char.isupper():\n            result += chr((ord(char) - 65 + shift) % 26 + 65) if char.isupper() else char\n        elif char.islower():\n            result += chr((ord(char) - 97 + shift) % 26 + 97) if char.islower() else char\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt_decrypt_message", "input": "'Hello,', 4", "output": "'Lipps,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149832_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007534", "code": "from datetime import datetime\ndef validate_credit_card(card_number, card_expiry):\n    # Rule 1: Check if card_number contains only digits and is of valid length\n    if not card_number.isdigit() or len(card_number) > 20:\n        return False\n    # Rule 2: Check if card_expiry is in the format MMYY and represents a valid future date\n    try:\n        expiry_date = datetime.strptime(card_expiry, '%m%y')\n        current_date = datetime.now()\n        if expiry_date < current_date:\n            return False\n    except ValueError:\n        return False\n    return True\n", "entry_point": "validate_credit_card", "input": "'123a', '1225'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91051_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007535", "code": "def find_next_square(sq: int) -> int:\n    \"\"\"\n    Finds the next perfect square after the given number.\n    Args:\n    sq: An integer representing the input number.\n    Returns:\n    An integer representing the next perfect square if the input is a perfect square, otherwise -1.\n    \"\"\"\n    sqrt_of_sq = sq ** 0.5\n    return int((sqrt_of_sq + 1) ** 2) if sqrt_of_sq.is_integer() else -1\n", "entry_point": "find_next_square", "input": "625", "output": "676", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35410_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007536", "code": "import math\ndef generate_primes(n):\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, n + 1, i):\n                is_prime[j] = False\n    primes = [i for i in range(2, n + 1) if is_prime[i]]\n    return primes\n", "entry_point": "generate_primes", "input": "7", "output": "[2, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3811_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9392", "output": "{1, 2, 4, 8, 587, 2348, 9392, 16, 1174, 4696}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9391", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007538", "code": "import os\ndef find_files_by_extension(directory, extension):\n    result_files = []\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.endswith(extension):\n                result_files.append(os.path.join(root, file))\n    return result_files\n", "entry_point": "find_files_by_extension", "input": "'/non_existent_directory', '.txt'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86517_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007539", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'wworldorld'", "output": "{'wworldorld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007540", "code": "def count_alphanumeric_chars(input_str):\n    count = 0\n    for char in input_str:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abcde12345'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52816_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007541", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "\"['itemem1', '']\"", "output": "['itemem1', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007542", "code": "def count_imports(script_content):\n    lines = script_content.split('\\n')\n    import_count = 0\n    for line in lines:\n        if line.strip().startswith('import'):\n            import_count += 1\n    return import_count\n", "entry_point": "count_imports", "input": "'import math\\n# This is a comment\\n# Another comment\\n'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65025_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007543", "code": "def find_unique_pairs(lst, target):\n    unique_pairs = set()\n    complements = set()\n    for num in lst:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[1, 2, 3, 5], 8", "output": "[(3, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29529_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007544", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 6]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115918_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007545", "code": "from typing import List\ndef get_selinux_state(policies: List[str]) -> str:\n    enforcing_count = 0\n    permissive_count = 0\n    for policy in policies:\n        if policy == \"enforcing\":\n            enforcing_count += 1\n        elif policy == \"permissive\":\n            permissive_count += 1\n    if enforcing_count == len(policies):\n        return \"enforcing\"\n    elif permissive_count == len(policies):\n        return \"permissive\"\n    else:\n        return \"mixed\"\n", "entry_point": "get_selinux_state", "input": "['enforcing', 'enforcing', 'enforcing']", "output": "'enforcing'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24751_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007546", "code": "def process_image(option: str, image_url: str = None, uploaded_image: str = None) -> str:\n    if option == 'library':\n        # Process example image from library\n        return 'Processed example image from library'\n    elif option == 'url' and image_url:\n        # Process image downloaded from URL\n        return 'Processed image downloaded from URL'\n    elif option == 'upload' and uploaded_image:\n        # Process uploaded image\n        return 'Processed uploaded image'\n    else:\n        return 'Invalid option or missing image data'\n", "entry_point": "process_image", "input": "'upload', uploaded_image='example_image.jpg'", "output": "'Processed uploaded image'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138019_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007547", "code": "from typing import List, Dict, Union\ndef calculate_average(dataset: List[Dict[str, Union[str, int, float]]], attribute: str, ignore_epoch: int) -> float:\n    total_sum = 0\n    total_records = 0\n    for i, record in enumerate(dataset):\n        if i != ignore_epoch:\n            if attribute in record:\n                total_sum += record[attribute]\n                total_records += 1\n    if total_records == 0:\n        return 0  # Return 0 if no valid records found\n    return total_sum / total_records\n", "entry_point": "calculate_average", "input": "[{'name': 'Alice'}, {'name': 'Bob'}], 'score', 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146499_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007548", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4359", "output": "{1, 3, 1453, 4359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007549", "code": "def generate_telegram_url(api_token):\n    URL_BASE = 'https://api.telegram.org/file/bot'\n    complete_url = URL_BASE + api_token + '/'\n    return complete_url\n", "entry_point": "generate_telegram_url", "input": "'PRE'", "output": "'https://api.telegram.org/file/botPRE/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139134_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007550", "code": "def count_file_extensions(file_paths):\n    file_extensions_count = {}\n    # Split the input string by spaces to get individual file paths\n    paths = file_paths.strip().split()\n    for path in paths:\n        # Extract the file extension by splitting at the last '.' in the path\n        extension = path.split('.')[-1].lower() if '.' in path else ''\n        # Update the count of the file extension in the dictionary\n        file_extensions_count[extension] = file_extensions_count.get(extension, 0) + 1\n    return file_extensions_count\n", "entry_point": "count_file_extensions", "input": "'file'", "output": "{'': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21533_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007551", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[85, 84, 86]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007552", "code": "# Constants\nXY_SHAPE    = 3\nXYT_SHAPE   = 4\nXYZT_SHAPE  = 5\nOCET_SHAPE  = 6\nSURFT_SHAPE = 7\nBOTT_SHAPE  = 8\nG_SHAPE     = 9\nXYZ_SHAPE   = 10\nINIT       = 0\nMEAN       = 1\nRESET      = 2\nACCUMULATE = 10\nSMALL = 1E-08\n_ZERO_ = 0.0\n_ONE_ = 1.0\ndef calculate_average(numbers, computation_type):\n    if computation_type == INIT:\n        return _ZERO_\n    elif computation_type == MEAN:\n        if len(numbers) == 0:\n            return _ZERO_\n        return sum(numbers) / len(numbers)\n    elif computation_type == RESET:\n        return _ZERO_\n    elif computation_type == ACCUMULATE:\n        if len(numbers) == 0:\n            return _ZERO_\n        return sum(numbers)\n", "entry_point": "calculate_average", "input": "[3.0], MEAN", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121955_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007553", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "1, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007554", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'RRRRRUU', 6, 3", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007555", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'dataile.com'", "output": "'dataile.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007556", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6989", "output": "{1, 29, 241, 6989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007557", "code": "def format_text(text: str) -> str:\n    formatted_text = \"\"\n    words = text.split()\n    for word in words:\n        if word.startswith('*') and word.endswith('*'):\n            formatted_text += word.strip('*').upper() + \" \"\n        elif word.startswith('_') and word.endswith('_'):\n            formatted_text += word.strip('_').lower() + \" \"\n        elif word.startswith('`') and word.endswith('`'):\n            formatted_text += word.strip('`')[::-1] + \" \"\n        else:\n            formatted_text += word + \" \"\n    return formatted_text.strip()\n", "entry_point": "format_text", "input": "'Hello *world* python `example`'", "output": "'Hello WORLD python elpmaxe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10452_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2257", "output": "{1, 61, 2257, 37}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007559", "code": "def extract_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if not char.isspace():\n            unique_chars.add(char)\n    return sorted(list(unique_chars))\n", "entry_point": "extract_unique_characters", "input": "'def'", "output": "['d', 'e', 'f']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007560", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "(3, 3, 2, 3, 1, 2, 2, 0, 5)", "output": "(3, 3, 2, 3, 1, 2, 2, 0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007561", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[96, 96, 95, 90]", "output": "[96, 96, 95]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007562", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average)  # Return the average as an integer\n", "entry_point": "calculate_average", "input": "[80, 81, 82, 83, 84]", "output": "82", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65577_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007563", "code": "import re\ndef extract_email(api_info: str) -> str:\n    email_pattern = r'<([^<>]+)>'\n    match = re.search(email_pattern, api_info)\n    if match:\n        return match.group(1)\n    else:\n        return 'Email not found'\n", "entry_point": "extract_email", "input": "''", "output": "'Email not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27815_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007564", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[102, 102, 91, 78, 50, 50]", "output": "[102, 91, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23327_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007565", "code": "def map_variable_to_abbreviation(variable_name):\n    variable_mappings = {\n        '10m_u_component_of_wind': 'u10',\n        '10m_v_component_of_wind': 'v10',\n        '2m_dewpoint_temperature': 'd2m',\n        '2m_temperature': 't2m',\n        'cloud_base_height': 'cbh',\n        'precipitation_type': 'ptype',\n        'total_cloud_cover': 'tcc',\n        'total_precipitation': 'tp',\n        'runoff': 'ro',\n        'potential_evaporation': 'pev',\n        'evaporation': 'e',\n        'maximum_individual_wave_height': 'hmax',\n        'significant_height_of_combined_wind_waves_and_swell': 'swh',\n        'peak_wave_period': 'pp1d',\n        'sea_surface_temperature': 'sst'\n    }\n    if variable_name in variable_mappings:\n        return variable_mappings[variable_name]\n    else:\n        return \"Abbreviation not found\"\n", "entry_point": "map_variable_to_abbreviation", "input": "'unknown_variable'", "output": "'Abbreviation not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131015_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007566", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "1", "output": "'Parse error, unexpected input'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007567", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'Sam'", "output": "'\u30b5\u30f3am'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007568", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "7, 4", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007569", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'This'", "output": "'This'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007570", "code": "import os\ndef count_total_images_in_directory(directory_path: str) -> int:\n    image_count = 0\n    for root, dirs, files in os.walk(directory_path):\n        for file in files:\n            if file.endswith('.jpg'):\n                image_count += 1\n    return image_count\n", "entry_point": "count_total_images_in_directory", "input": "'empty_dir'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79904_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3779", "output": "{1, 3779}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007572", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 8", "output": "112.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007573", "code": "def serviceLane(width, cases):\n    result = []\n    for case in cases:\n        start, end = case\n        segment = width[start:end+1]\n        min_width = min(segment)\n        result.append(min_width)\n    return result\n", "entry_point": "serviceLane", "input": "[1, 2, 1, 2], [(0, 1), (2, 3)]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129083_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007574", "code": "from typing import List, Set\ndef filter_json_content_types(content_types: List[str]) -> Set[str]:\n    json_related_types = set()\n    for content_type in content_types:\n        if content_type.startswith('application/json'):\n            json_related_types.add(content_type)\n    return json_related_types\n", "entry_point": "filter_json_content_types", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37797_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007575", "code": "from typing import List\ndef manipulate_devices(dev: List[str]) -> List[str]:\n    updated_devices = []\n    dfp_sensor_present = False\n    for device in dev:\n        updated_devices.append(device)\n        if device == 'dfpBinarySensor':\n            dfp_sensor_present = True\n    if not dfp_sensor_present:\n        updated_devices.append('dfpBinarySensor')\n    return updated_devices\n", "entry_point": "manipulate_devices", "input": "['sensor1', 'sensor2']", "output": "['sensor1', 'sensor2', 'dfpBinarySensor']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129800_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007576", "code": "def map_blend_shape_locations(blend_shape_locations):\n    blend_shape_mapping = {}\n    id_counter = 0\n    for location in blend_shape_locations:\n        blend_shape_mapping[location] = id_counter\n        id_counter += 1\n    return blend_shape_mapping\n", "entry_point": "map_blend_shape_locations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84442_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007577", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'PyyhyooWelcome__titlle_'", "output": "'PyyhyooWelcome__titlle_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007578", "code": "def bingo(array):\n    target_numbers = {2, 9, 14, 7, 15}\n    found_numbers = set(array)\n    count = 0\n    for num in target_numbers:\n        if num in found_numbers:\n            count += 1\n    if count == 5:\n        return \"WIN\"\n    else:\n        return \"LOSE\"\n", "entry_point": "bingo", "input": "[2, 9, 14, 7]", "output": "'LOSE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145571_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007579", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    max_height = 0\n    for height in buildings:\n        total_area += max(0, height - max_height)\n        max_height = max(max_height, height)\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[2, 5, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48707_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007580", "code": "from configparser import ConfigParser\ndef extract_database_name(config_file_path: str) -> str:\n    parser = ConfigParser()\n    try:\n        parser.read(config_file_path)\n        database_name = parser.get('database', 'dbfilename')\n    except Exception as e:\n        database_name = \"default.db\"\n    return database_name\n", "entry_point": "extract_database_name", "input": "'non_existing_config.ini'", "output": "'default.db'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76612_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007581", "code": "def process_json_operations(json_list: list) -> int:\n    running_total = 0\n    for json_obj in json_list:\n        operation = json_obj.get(\"operation\")\n        value = json_obj.get(\"value\", 0)\n        if operation == \"add\":\n            running_total += value\n        elif operation == \"subtract\":\n            running_total -= value\n        elif operation == \"multiply\":\n            running_total *= value\n        elif operation == \"reset\":\n            running_total = 0\n        elif operation == \"result\":\n            return running_total\n    return running_total\n", "entry_point": "process_json_operations", "input": "[{'operation': 'reset'}, {'operation': 'result'}]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3323_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007582", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4119", "output": "{1, 3, 1373, 4119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2264", "output": "{1, 2, 4, 8, 1132, 566, 2264, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2263", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007584", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'auracy'", "output": "'auracy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007585", "code": "def assign_inbound_number(service_id, services, available_numbers):\n    for service in services:\n        if service['id'] == service_id:\n            if available_numbers:\n                assigned_number = available_numbers.pop(0)\n                return assigned_number\n            else:\n                return \"No available inbound numbers\"\n", "entry_point": "assign_inbound_number", "input": "1, [{'id': 1}], ['9876543210', '1234567890']", "output": "'9876543210'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44485_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007586", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[4, 3, 2, 1, 1, 3, 1, 4]", "output": "[1, 1, 1, 2, 3, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007587", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tasks=adtt'", "output": "{'field': 'tasks', 'value': 'adtt'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007588", "code": "def customer_name_groups(customer_names):\n    name_groups = {}\n    for name in customer_names:\n        if name and name[0].isalpha():\n            first_letter = name[0].upper()\n            name_groups.setdefault(first_letter, []).append(name)\n    return name_groups\n", "entry_point": "customer_name_groups", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2122_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007589", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[0, 6, 2, 4, 2, 4]", "output": "[6, 8, 6, 6, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007590", "code": "from typing import List\nfrom datetime import datetime\ndef earliest_date(dates: List[str]) -> str:\n    earliest_date = \"9999/12/31\"  # Initialize with a date far in the future\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, \"%Y/%m/%d\")\n        if date_obj < datetime.strptime(earliest_date, \"%Y/%m/%d\"):\n            earliest_date = date_str\n    return earliest_date\n", "entry_point": "earliest_date", "input": "['2023/01/01', '2022/09/16', '2022/10/01', '2022/09/15']", "output": "'2022/09/15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128206_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007591", "code": "def snake_case(string):\n    return string.replace(\" \", \"_\").lower()\n", "entry_point": "snake_case", "input": "'Hello World'", "output": "'hello_world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78100_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007592", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8401", "output": "{1, 8401, 271, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007593", "code": "def average_price_of_good_images(tasks):\n    total_price = 0\n    good_image_count = 0\n    for task in tasks:\n        if 'good' in task['img']:\n            total_price += task['pred_price']\n            good_image_count += 1\n    if good_image_count > 0:\n        average_price = total_price / good_image_count\n    else:\n        average_price = 0\n    return round(average_price, 2)\n", "entry_point": "average_price_of_good_images", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18021_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3051", "output": "{1, 3, 9, 3051, 113, 339, 1017, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007595", "code": "def determine_client_type(client_id: str) -> str:\n    client_number = int(client_id.split('-')[-1])\n    if client_number < 100:\n        return \"OLD1-\" + str(client_number)\n    elif 100 <= client_number < 1000:\n        return \"OLD2-\" + str(client_number)\n    else:\n        return \"OLD3-\" + str(client_number)\n", "entry_point": "determine_client_type", "input": "'client-10'", "output": "'OLD1-10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46850_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007596", "code": "def max_product(nums):\n    max1 = float('-inf')\n    max2 = float('-inf')\n    min1 = float('inf')\n    min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, max1 * min1)\n", "entry_point": "max_product", "input": "[3, 4, 9]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14792_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007597", "code": "def product_except_self(arr):\n    n = len(arr)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products to the left of each element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * arr[i - 1]\n    # Calculate products to the right of each element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * arr[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "product_except_self", "input": "[0, 0, 0, 0]", "output": "[0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108608_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007598", "code": "def process_mesh_files(sfm_fp, mesh_fp, image_dp):\n    log_messages = []\n    if mesh_fp is not None:\n        log_messages.append(\"Found the following mesh file: \" + mesh_fp)\n    else:\n        log_messages.append(\"Request target mesh does not exist in this project.\")\n    return log_messages\n", "entry_point": "process_mesh_files", "input": "None, 'h/to/mte', None", "output": "['Found the following mesh file: h/to/mte']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140821_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2117", "output": "{73, 1, 29, 2117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007600", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[1, 1, 2, 3, 1]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007601", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'thmt', '/api'", "output": "'thmt/api'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007602", "code": "def file_linear_byte_offset(values, factor, coefficients):\n    total_sum = sum(value * multiplier * coefficient for value, multiplier, coefficient in zip(values, [1] * len(values), coefficients))\n    return total_sum * factor\n", "entry_point": "file_linear_byte_offset", "input": "[1, 2], 14.0, [3, 4]", "output": "154.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121000_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007603", "code": "def calculate_max_voltage(gain):\n    if gain == 1:\n        max_VOLT = 4.096\n    elif gain == 2:\n        max_VOLT = 2.048\n    elif gain == 4:\n        max_VOLT = 1.024\n    elif gain == 8:\n        max_VOLT = 0.512\n    elif gain == 16:\n        max_VOLT = 0.256\n    else:  # gain == 2/3\n        max_VOLT = 6.144\n    return max_VOLT\n", "entry_point": "calculate_max_voltage", "input": "8", "output": "0.512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119884_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2693", "output": "{1, 2693}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007605", "code": "def make_cls_name(base: str, replacement: str) -> str:\n    return base.replace(\"Base\", replacement)\n", "entry_point": "make_cls_name", "input": "'CreateBase', 'Class'", "output": "'CreateClass'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120218_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007606", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'path/to/examplxt'", "output": "'examplxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007607", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2937", "output": "{89, 1, 33, 3, 11, 267, 979, 2937}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007608", "code": "def generate_model_verbose_names(operations):\n    model_verbose_names = {}\n    for operation in operations:\n        model_name = operation['name']\n        verbose_name = operation['options']['verbose_name']\n        model_verbose_names[model_name] = verbose_name\n    return model_verbose_names\n", "entry_point": "generate_model_verbose_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29606_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007609", "code": "from typing import Dict, Tuple\ndef validate_user_info(user_info: Dict[str, str]) -> Tuple[bool, bool]:\n    phone_number_valid = user_info.get('phone_number', '').isdigit() and len(user_info.get('phone_number', '')) == 10\n    email_address_valid = '@' in user_info.get('email_address', '') and '.' in user_info.get('email_address', '')\n    return phone_number_valid, email_address_valid\n", "entry_point": "validate_user_info", "input": "{'phone_number': '123456789', 'email_address': 'name.com'}", "output": "(False, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007610", "code": "def removeElement(nums, val):\n    \"\"\"\n    :type nums: List[int]\n    :type val: int\n    :rtype: int\n    \"\"\"\n    nums[:] = [num for num in nums if num != val]\n    return len(nums)\n", "entry_point": "removeElement", "input": "[1, 2, 3], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53354_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007611", "code": "def check_go_pattern(input_string: str) -> bool:\n    # Convert the input string and pattern to lowercase for case-insensitive comparison\n    input_lower = input_string.lower()\n    pattern = \"go\"\n    # Check if the pattern \"go\" is present in the lowercase input string\n    return pattern in input_lower\n", "entry_point": "check_go_pattern", "input": "'go'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26178_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007612", "code": "def calculate_moving_average(fmeter_values, N):\n    moving_averages = []\n    for i in range(len(fmeter_values) - N + 1):\n        window = fmeter_values[i:i + N]\n        average = sum(window) / N\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[25, 26, 27, 29, 32.5], 4", "output": "[26.75, 28.625]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67817_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007613", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)  # Round to 2 decimal places\n", "entry_point": "calculate_average", "input": "[80, 82, 83, 84, 85, 87, 90]", "output": "84.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007614", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        patch = 0\n        minor += 1\n        if minor > 9:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'3.6.7'", "output": "'3.6.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58418_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007615", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "86", "output": "{2: 1, 43: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8237", "output": "{1, 8237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007617", "code": "def count_foo_occurrences(input_string):\n    count = 0\n    for i in range(len(input_string) - 2):\n        if input_string[i:i+3] == \"foo\":\n            count += 1\n    return count\n", "entry_point": "count_foo_occurrences", "input": "'foofoo'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48936_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007618", "code": "BRIGHTNESS_TO_PRESET = {1: \"low\", 2: \"medium\", 3: \"high\"}\ndef convert_brightness_to_preset(brightness: int) -> str:\n    preset = BRIGHTNESS_TO_PRESET.get(brightness)\n    return preset if preset else \"Unknown\"\n", "entry_point": "convert_brightness_to_preset", "input": "0", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134852_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007619", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007620", "code": "def count_consecutive_doubles(s: str) -> int:\n    count = 0\n    for i in range(len(s) - 1):\n        if s[i] == s[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_consecutive_doubles", "input": "'aaabbbaa'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35710_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007621", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{2: [0], 0: [3], 3: [1], 1: []}, 2", "output": "[2, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007622", "code": "def count_reachable_nodes(graph, start_node):\n    visited = set()\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n    dfs(start_node)\n    return len(visited)\n", "entry_point": "count_reachable_nodes", "input": "{'A': []}, 'A'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61530_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007623", "code": "import re\ndef count_unique_modules(script_content):\n    import_regex = r'import\\s+([\\w\\.]+)'\n    module_names = re.findall(import_regex, script_content)\n    unique_modules = set(module_names)\n    return len(unique_modules)\n", "entry_point": "count_unique_modules", "input": "'import os\\nimport sys'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81420_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007624", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'* '", "output": "'<p>*</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007625", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'main', 'ask_question'", "output": "'ASK_QUESTION'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007626", "code": "import logging\ndef generate_log_message(imported_modules, logger_name):\n    imported_modules_str = ', '.join(imported_modules)\n    log_message = f\"Imported modules: {imported_modules_str}. Logger name: {logger_name}\"\n    return log_message\n", "entry_point": "generate_log_message", "input": "[], 'cclouery.ib'", "output": "'Imported modules: . Logger name: cclouery.ib'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1897_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3959", "output": "{1, 107, 37, 3959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007628", "code": "def calculate_value(n, a):\n    mod = 10**9 + 7\n    answer = 0\n    sumation = sum(a)\n    for i in range(n-1):\n        sumation -= a[i]\n        answer += a[i] * sumation\n        answer %= mod\n    return answer\n", "entry_point": "calculate_value", "input": "2, [13, 16]", "output": "208", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102907_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007629", "code": "def calculate_point_averages(points):\n    if not points:\n        return (0, 0)\n    sum_x = sum(point[0] for point in points)\n    sum_y = sum(point[1] for point in points)\n    avg_x = sum_x / len(points)\n    avg_y = sum_y / len(points)\n    return (avg_x, avg_y)\n", "entry_point": "calculate_point_averages", "input": "[(2, 2), (2, 2)]", "output": "(2.0, 2.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89551_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007630", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 6, 3, 1, 3]", "output": "[7, 9, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110145_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007631", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'33.2.3'", "output": "(33, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007632", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "1.5", "output": "1500000000000000000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007633", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "5, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007634", "code": "from itertools import combinations\ndef find_minimum_value(sum_heights, to_sub, top):\n    minimum = -1\n    for r in range(len(to_sub) + 1):\n        for comb in combinations(to_sub, r):\n            value = sum(sum_heights) + sum(comb)\n            if value >= top and (minimum == -1 or minimum > value):\n                minimum = value\n    return minimum\n", "entry_point": "find_minimum_value", "input": "[50], [0, 10], 60", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131602_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007635", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            new_pos = ord(char) + shift\n            if new_pos > ord('z'):\n                new_pos = new_pos - 26  # Wrap around the alphabet\n            encrypted_text += chr(new_pos)\n        else:\n            encrypted_text += char  # Keep non-letter characters unchanged\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'ebebw', 1", "output": "'fcfcx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55105_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007636", "code": "def find_max_xor(L, R):\n    xor = L ^ R\n    max_xor = 1\n    while xor:\n        xor >>= 1\n        max_xor <<= 1\n    return max_xor - 1\n", "entry_point": "find_max_xor", "input": "0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120767_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007637", "code": "# Dictionary mapping hexadecimal constants to their meanings\nconstants_dict = {\n    0x1F: 'INVALID_IO',\n    0x20: 'INVALID_ESC_CHAR',\n    0x23: 'INVALID_VAR_NAME_TOO_LONG',\n    0x65: 'EVENT_TOUCH_HEAD',\n    0x66: 'CURRENT_PAGE_ID_HEAD',\n    0x67: 'EVENT_POSITION_HEAD',\n    0x68: 'EVENT_SLEEP_POSITION_HEAD',\n    0x70: 'STRING_HEAD',\n    0x71: 'NUMBER_HEAD',\n    0x86: 'EVENT_ENTER_SLEEP_MODE',\n    0x87: 'EVENT_ENTER_WAKE_UP_MODE',\n    0x88: 'EVENT_LAUNCHED',\n    0x89: 'EVENT_UPGRADED',\n    0xFD: 'EVENT_DATA_TR_FINISHED',\n    0xFE: 'EVENT_DATA_TR_READY'\n}\ndef decode_hex(hex_value):\n    decimal_value = int(hex_value, 16)\n    return constants_dict.get(decimal_value, 'Unknown')\n", "entry_point": "decode_hex", "input": "'0x67'", "output": "'EVENT_POSITION_HEAD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78460_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007638", "code": "def find_max_product(a_list):\n    big = a_list[0][0] * a_list[0][1]  # Initialize with the product of the first two elements\n    for row in range(len(a_list)):\n        for column in range(len(a_list[row])):\n            if column < len(a_list[row]) - 1:\n                if a_list[row][column] * a_list[row][column + 1] > big:\n                    big = a_list[row][column] * a_list[row][column + 1]\n            if row < len(a_list) - 1:\n                if a_list[row][column] * a_list[row + 1][column] > big:\n                    big = a_list[row][column] * a_list[row + 1][column]\n            if row < len(a_list) - 1 and column < len(a_list[row]) - 1:\n                if a_list[row][column] * a_list[row + 1][column + 1] > big:\n                    big = a_list[row][column] * a_list[row + 1][column + 1]\n                if a_list[row + 1][column] * a_list[row][column + 1] > big:\n                    big = a_list[row + 1][column] * a_list[row][column + 1]\n    return big\n", "entry_point": "find_max_product", "input": "[[5, 5], [1, 2]]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61059_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007639", "code": "def count_word_occurrences(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Tokenize the text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the counts\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_occurrences", "input": "'helhellolo'", "output": "{'helhellolo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52489_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007640", "code": "def bubble_sort(elements):\n    while True:\n        swapped = False\n        for i in range(len(elements) - 1):\n            if elements[i] > elements[i + 1]:\n                # Swap elements\n                elements[i], elements[i + 1] = elements[i + 1], elements[i]\n                swapped = True\n        if not swapped:\n            break\n    return elements\n", "entry_point": "bubble_sort", "input": "[11, 24, 10, 91, 64, 89, 11, 22]", "output": "[10, 11, 11, 22, 24, 64, 89, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115988_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007641", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "0, 1", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007642", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "931", "output": "{1, 931, 133, 7, 49, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1625", "output": "{1, 65, 325, 5, 13, 1625, 125, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1624", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007644", "code": "def extract_github_info(url):\n    # Remove \"https://github.com/\" from the URL\n    url = url.replace(\"https://github.com/\", \"\")\n    # Split the remaining URL by \"/\"\n    parts = url.split(\"/\")\n    # Extract the username and repository name\n    username = parts[0]\n    repository = parts[1]\n    return (username, repository)\n", "entry_point": "extract_github_info", "input": "'https://github.com/https:/'", "output": "('https:', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146065_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007645", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[0, 4, 7, [6, 6, 6]]", "output": "[0, 4, 7, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007646", "code": "import os\nDEFAULT_LIST = [\"chromedriver.exe\"]\nPROCESS_LIST = DEFAULT_LIST if os.environ.get('processList') is None else os.environ.get('processList')\ndef filter_processes(process_dict):\n    filtered_dict = {process: cpu_usage for process, cpu_usage in process_dict.items() if process in PROCESS_LIST}\n    return filtered_dict\n", "entry_point": "filter_processes", "input": "{'not_chromedriver.exe': 10, 'another_process.exe': 20}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62627_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007647", "code": "def count_increasing_sums(lst):\n    num_increased = 0\n    for i in range(len(lst) - 2):\n        if lst[i] + lst[i+1] < lst[i+1] + lst[i+2]:\n            num_increased += 1\n    return num_increased\n", "entry_point": "count_increasing_sums", "input": "[1, 2, 3, 4, 5, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14820_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007648", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "3", "output": "'1 1 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "565", "output": "{1, 5, 565, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007650", "code": "def get_jail_number(input_str: str) -> str:\n    lines = input_str.split('\\n')\n    for line in lines:\n        if line.strip().startswith('|- Number of jail:'):\n            return line.split(':')[-1].strip()\n    return '0'  # Return '0' if the line with the count is not found\n", "entry_point": "get_jail_number", "input": "''", "output": "'0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118358_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1852", "output": "{1, 2, 4, 463, 1852, 926}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1851", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3099", "output": "{3, 1, 3099, 1033}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007653", "code": "def calculate_distances(S1, S2):\n    map = {}\n    initial = 0\n    distance = []\n    for i in range(26):\n        map[S1[i]] = i\n    for i in S2:\n        distance.append(abs(map[i] - initial))\n        initial = map[i]\n    return distance\n", "entry_point": "calculate_distances", "input": "'abcdefghijklmnopqrstuvwxyz', 'cde'", "output": "[2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35345_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007654", "code": "def calculate_weighted_average(numbers, weights):\n    if len(numbers) != len(weights):\n        return None\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    if total_weight == 0:\n        return None\n    return weighted_sum / total_weight\n", "entry_point": "calculate_weighted_average", "input": "[8, 4], [2, 3]", "output": "5.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41144_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007655", "code": "def card_game(deck1, deck2):\n    score1, score2 = 0, 0\n    round_num = 1\n    while deck1 and deck2:\n        card1, card2 = deck1.pop(0), deck2.pop(0)\n        if card1 > card2:\n            score1 += 2\n        elif card2 > card1:\n            score2 += 2\n        round_num += 1\n    if score1 > score2:\n        return \"Player 1 wins\"\n    elif score2 > score1:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_game", "input": "[1, 2, 3], [1, 2, 3]", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29510_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007656", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "6, 3, 0", "output": "(0, 3, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "668", "output": "{1, 2, 4, 167, 334, 668}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt667", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007658", "code": "def max_non_adjacent_score(scores):\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[5, 1, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26474_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007659", "code": "def rock_paper_scissors_winner(player_choice, computer_choice):\n    if player_choice == computer_choice:\n        return \"It's a tie!\"\n    elif (player_choice == \"rock\" and computer_choice == \"scissors\") or \\\n         (player_choice == \"scissors\" and computer_choice == \"paper\") or \\\n         (player_choice == \"paper\" and computer_choice == \"rock\"):\n        return \"Player wins! Congratulations!\"\n    else:\n        return \"Computer wins! Better luck next time!\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'paper'", "output": "'Computer wins! Better luck next time!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101675_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007660", "code": "def sum_greater_than_average(arr):\n    if not arr:\n        return 0\n    avg = sum(arr) / len(arr)\n    filtered_elements = [num for num in arr if num > avg]\n    return sum(filtered_elements)\n", "entry_point": "sum_greater_than_average", "input": "[5, 10, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30094_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007661", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1301", "output": "{1, 1301}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007662", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-6, -1, -7, 3, 2, 0, 2]", "output": "[-6, -1, -7, 3, 2, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007663", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007664", "code": "import math\ndef calculate_path(R, D):\n    path = math.factorial(D + R - 1) // (math.factorial(R - 1) * math.factorial(D))\n    return path\n", "entry_point": "calculate_path", "input": "4, 3", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141457_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007665", "code": "from typing import List\nfrom collections import deque\ndef min_distance(matrix: List[List[int]]) -> int:\n    if matrix[0][0] == 1:\n        return -1\n    R, C = len(matrix), len(matrix[0])\n    bfs = deque([[0, 0]])\n    dists = {(0, 0): 1}\n    while bfs:\n        r, c = bfs.popleft()\n        if (r, c) == (R-1, C-1):\n            return dists[r, c]\n        for nr, nc in [[r-1, c], [r+1, c], [r, c-1], [r, c+1]]:\n            if 0 <= nr < R and 0 <= nc < C and (nr, nc) not in dists and matrix[nr][nc] == 0:\n                dists[nr, nc] = dists[r, c] + 1\n                bfs.append((nr, nc))\n    return -1\n", "entry_point": "min_distance", "input": "[[0, 0, 1], [0, 0, 0], [1, 1, 0]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119423_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007666", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "48, ['49']", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007667", "code": "def GetNote(note_name, scale):\n    midi_val = (scale - 1) * 12  # MIDI value offset based on scale\n    # Dictionary to map note letters to MIDI offsets\n    note_offsets = {'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11}\n    note = note_name[0]\n    if note not in note_offsets:\n        raise ValueError(\"Invalid note name\")\n    midi_val += note_offsets[note]\n    if len(note_name) > 1:\n        modifier = note_name[1]\n        if modifier == 's' or modifier == '#':\n            midi_val += 1\n        else:\n            raise ValueError(\"Invalid note modifier\")\n    if note_name[:2] in ('es', 'e#', 'bs', 'b#'):\n        raise ValueError(\"Invalid note combination\")\n    return midi_val\n", "entry_point": "GetNote", "input": "'c', 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24350_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007668", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[4, 4, 5, 4]", "output": "[8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007669", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return None\n    nums.sort()\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 2, 3, 4, 12]", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94397_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007670", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[[10, 5], [8, 10]]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007671", "code": "def calculate_average_score(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score, 2)  # Round the average score to 2 decimal places\n", "entry_point": "calculate_average_score", "input": "[60, 72, 75, 76, 90]", "output": "74.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140998_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007672", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 1, 0]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8291", "output": "{1, 8291}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007674", "code": "def find_pairs_with_difference(nums, k):\n    unique_nums = set(nums)\n    pair_count = 0\n    for num in nums:\n        if num + k in unique_nums:\n            pair_count += 1\n        if num - k in unique_nums:\n            pair_count += 1\n        unique_nums.add(num)\n    return pair_count // 2  # Divide by 2 to avoid double counting pairs\n", "entry_point": "find_pairs_with_difference", "input": "[1, 2, 3, 4, 5], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23679_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007675", "code": "def calculate_error(list1, list2):\n    total_error = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_error\n", "entry_point": "calculate_error", "input": "[0], [2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33914_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007676", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[92, 91], 2", "output": "91.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12185_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007677", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9475", "output": "{1, 9475, 5, 1895, 25, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9474", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007678", "code": "def filter_and_sort_movies(movies, year_threshold):\n    filtered_movies = [movie for movie in movies if movie['year'] >= year_threshold]\n    sorted_movies = sorted(filtered_movies, key=lambda x: (x['price'], x['title']), reverse=True)\n    return sorted_movies\n", "entry_point": "filter_and_sort_movies", "input": "[], 2000", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39516_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007679", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4581", "output": "{1, 3, 4581, 9, 1527, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007680", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'<PASSWORD>', '8d8c050d3eca'", "output": "'8d8c050d3eca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007681", "code": "from typing import List\ndef max_average_score(scores: List[int]) -> float:\n    max_avg = float('-inf')\n    window_sum = 0\n    window_size = 0\n    for score in scores:\n        window_sum += score\n        window_size += 1\n        if window_sum / window_size > max_avg:\n            max_avg = window_sum / window_size\n        if window_sum < 0:\n            window_sum = 0\n            window_size = 0\n    return max_avg\n", "entry_point": "max_average_score", "input": "[6, 6]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6333_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007682", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'worimportaat dtc'", "output": "{'worimportaat': 1, 'dtc': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007683", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[90, 95, 100, 90, 100]", "output": "95.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135847_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007684", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "78399, '0.0000'", "output": "'7.8399E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007685", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007686", "code": "def sum_fibonacci(N):\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    elif N == 2:\n        return 1\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_fibonacci", "input": "7", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140036_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007687", "code": "def calculate_difference(n):\n    square_of_sum = (n ** 2 * (n + 1) ** 2) / 4\n    sum_of_squares = (n * (n + 1) * ((2 * n) + 1)) / 6\n    return int(square_of_sum - sum_of_squares)\n", "entry_point": "calculate_difference", "input": "6", "output": "350", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007688", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[4, 5, 5, 9, 10, 10]", "output": "'4, 5, 9, 10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007689", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5079", "output": "{1, 3, 1693, 5079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007690", "code": "def is_valid_ipv4(ip):\n    parts = ip.split('.')\n    if len(parts) != 4:\n        return False\n    for part in parts:\n        if not part.isdigit() or not 0 <= int(part) <= 255 or (len(part) > 1 and part[0] == '0'):\n            return False\n    return True\n", "entry_point": "is_valid_ipv4", "input": "'192.168.0.1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007691", "code": "def exam_grade(score):\n    if score < 0 or score > 100:\n        return \"Invalid Score\"\n    elif score >= 90:\n        return \"Top Score\"\n    elif score >= 60:\n        return \"Pass\"\n    else:\n        return \"Fail\"\n", "entry_point": "exam_grade", "input": "90", "output": "'Top Score'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64122_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007692", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 3, 3, 1, 0, -2, -1, 1]", "output": "[0, 4, 10, 12, 16, 15, 30, 56]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7158", "output": "{1, 2, 3, 6, 1193, 2386, 7158, 3579}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007694", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[5, 5, 6, 5, 5, 2, 3, 5, 5]", "output": "[5, 10, 16, 21, 26, 28, 31, 36, 41]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007695", "code": "# Dictionary mapping parameter names to values\nparameter_values = {\n    (0x80ED, 0x80E6): [1, 2, 4, 8, 12, 16],\n    # Add more parameter values as needed\n}\ndef get_color_table_parameters(target, pname):\n    if (target, pname) in parameter_values:\n        return parameter_values[(target, pname)]\n    else:\n        return []\n", "entry_point": "get_color_table_parameters", "input": "33005, 32999", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11255_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007696", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'5% 12 123.45% 5%'", "output": "'Chinese: \\nAlphanumeric: 5%, 12, 123.45%, 5%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007697", "code": "def sum_of_even_numbers(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_even_numbers", "input": "[10, 10, 12]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118722_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007698", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'helworldlo'", "output": "'h.e.l.w.o.r.l.d.l.o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007699", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[1.0, 3.0]", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007700", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'40 - 2'", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007701", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[2, 8, 3, 5]", "output": "(8, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007702", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[1, 2, 4, 2, 1, 4, 4, 5]", "output": "[6, 7, 9, 7, 6, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007703", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "8", "output": "'Neptune'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007704", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6914", "output": "{1, 6914, 2, 3457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6913", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007705", "code": "def count_elements(input):\n    count = 0\n    for element in input:\n        if isinstance(element, list):\n            count += count_elements(element)\n        else:\n            count += 1\n    return count\n", "entry_point": "count_elements", "input": "[[1, 2], [3], 4, 5, [6]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9884_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "179", "output": "{1, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007707", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6753", "output": "{1, 3, 6753, 2251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007708", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9082", "output": "{1, 2, 38, 239, 19, 9082, 4541, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007709", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[10, 5, 16, 14, 15, 20, 8], 14", "output": "[16, 14, 15, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007710", "code": "# Constants\nMENLO_QUEUE_COMPONENT_CPU = \"cpu\"\nMENLO_QUEUE_COMPONENT_ETH = \"eth\"\nMENLO_QUEUE_COMPONENT_FC = \"fc\"\nMENLO_QUEUE_COMPONENT_UNKNOWN = \"unknown\"\nMENLO_QUEUE_INDEX_0 = \"0\"\nMENLO_QUEUE_INDEX_0_A = \"0_A\"\nMENLO_QUEUE_INDEX_0_B = \"0_B\"\nMENLO_QUEUE_INDEX_1 = \"1\"\nMENLO_QUEUE_INDEX_1_A = \"1_A\"\nMENLO_QUEUE_INDEX_1_B = \"1_B\"\nMENLO_QUEUE_INDEX_UNKNOWN = \"unknown\"\nSUSPECT_FALSE = \"false\"\nSUSPECT_NO = \"no\"\nSUSPECT_TRUE = \"true\"\nSUSPECT_YES = \"yes\"\n# Function to determine suspiciousness\ndef is_suspicious(component, index):\n    if (component == MENLO_QUEUE_COMPONENT_CPU and (index == MENLO_QUEUE_INDEX_0_A or index == MENLO_QUEUE_INDEX_1_B)) or \\\n       (component == MENLO_QUEUE_COMPONENT_ETH and (index == MENLO_QUEUE_INDEX_0 or index == MENLO_QUEUE_INDEX_1)) or \\\n       (component == MENLO_QUEUE_COMPONENT_FC and index == MENLO_QUEUE_INDEX_UNKNOWN):\n        return SUSPECT_TRUE\n    else:\n        return SUSPECT_FALSE\n", "entry_point": "is_suspicious", "input": "'cpu', '0'", "output": "'false'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2702_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007711", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[2, 4, 4, 2, 4, 4, 5, 2]", "output": "[2, 6, 10, 12, 16, 20, 25, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007712", "code": "def count_coma_warriors(health_points):\n    coma_warriors = 0\n    for health in health_points:\n        if health == 0:\n            coma_warriors += 1\n    return coma_warriors\n", "entry_point": "count_coma_warriors", "input": "[0, 0, 0, 1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115294_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6781", "output": "{1, 6781}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007714", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "4", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007715", "code": "def process_zone_ids(all_zone_ids):\n    prev_zone_id = ''  # last visited zone_id\n    zone_id_count = 0  # counter for number of visits of the same zone_id\n    zone_id_list = []  # sequence of zone_ids\n    zone_id_count_list = []  # corresponding number of visits\n    for zone_id in all_zone_ids:\n        if zone_id != prev_zone_id:\n            if zone_id_count:  # skip this for the first zone_id\n                zone_id_count_list.append(zone_id_count)  # store #visits of previous zone_id\n            zone_id_list.append(zone_id)  # store current/new zone_id\n            zone_id_count = 1  # reset counter\n        else:\n            zone_id_count += 1\n        prev_zone_id = zone_id\n    if zone_id_count:  # handle the last zone_id\n        zone_id_count_list.append(zone_id_count)\n    return zone_id_list, zone_id_count_list\n", "entry_point": "process_zone_ids", "input": "['A', 'A', 'B', 'B', 'B', 'C', 'C']", "output": "(['A', 'B', 'C'], [2, 3, 2])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126846_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007716", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'b.'", "output": "'b.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1091", "output": "{1, 1091}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5327", "output": "{1, 7, 761, 5327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007719", "code": "def classify_triangle(r1: int, r2: int, r3: int) -> str:\n    if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:\n        if r1 == r2 == r3:\n            return 'Equilateral'\n        elif r1 != r2 and r2 != r3 and r1 != r3:\n            return 'Scalene'\n        else:\n            return 'Isosceles'\n    else:\n        return 'Not a triangle'\n", "entry_point": "classify_triangle", "input": "3, 3, 4", "output": "'Isosceles'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83282_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007720", "code": "from typing import List\ndef max_stairs_sum(steps: List[int]) -> int:\n    if not steps:\n        return 0\n    if len(steps) == 1:\n        return steps[0]\n    n1 = steps[0]\n    n2 = steps[1]\n    for i in range(2, len(steps)):\n        t = steps[i] + max(n1, n2)\n        n1, n2 = n2, t\n    return max(n1, n2)\n", "entry_point": "max_stairs_sum", "input": "[5, 4, 4]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100230_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007721", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first participant as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 70, 80]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122200_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007722", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#FFFFFF'", "output": "(255, 255, 255)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007723", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[60, 90, 80, 70, 80]", "output": "[5, 1, 2, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007724", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "20, 3", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007725", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[5, [8], 0.65]", "output": "13.65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007726", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[3, 2, 3, -1, 3, 3, 2]", "output": "[-1, 1, -4, 4, 0, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007727", "code": "def remove_labels_from_features(input_dict):\n    # Create a new dictionary to avoid modifying the original input\n    modified_dict = input_dict.copy()\n    # Check if 'labels' key is present in the dictionary\n    if 'labels' in modified_dict:\n        modified_dict.pop('labels')  # Remove the 'labels' key\n    return modified_dict\n", "entry_point": "remove_labels_from_features", "input": "{'labels': 123}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59368_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007728", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5063", "output": "{1, 83, 61, 5063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007729", "code": "from typing import List\ndef generate_masks(n: int) -> List[str]:\n    if n == 0:\n        return ['']\n    masks = []\n    for mask in generate_masks(n - 1):\n        masks.append(mask + '0')\n        masks.append(mask + '1')\n    return masks\n", "entry_point": "generate_masks", "input": "1", "output": "['0', '1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18657_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007730", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[1, 2, 2, 3, 3, 4]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007731", "code": "from typing import List\ndef is_majority(nums: List[int], target: int) -> bool:\n    if len(nums) == 1:\n        return nums[0] == target\n    p, q = 0, len(nums) - 1\n    while p < q:\n        if nums[p] > target:\n            return False\n        elif nums[p] < target:\n            p += 1\n        if nums[q] < target:\n            return False\n        elif nums[q] > target:\n            q -= 1\n        if nums[p] == nums[q] == target:\n            return q - p + 1 > len(nums) // 2\n    return False\n", "entry_point": "is_majority", "input": "[2, 2, 2, 3, 4, 2, 2], 2", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5303_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3830", "output": "{1, 2, 5, 10, 3830, 1915, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3829", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007733", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3917", "output": "{1, 3917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007734", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[95, 92, 90, 88, 85, 80]", "output": "[95, 92, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9573", "output": "{1, 3, 9573, 3191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007736", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'x'", "output": "['x']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007737", "code": "def missingNumber(array, n):\n    total = n*(n+1)//2\n    array_sum = sum(array)\n    return total - array_sum\n", "entry_point": "missingNumber", "input": "[1, 2, 3, 4, 5, 12], 5", "output": "-12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114479_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007738", "code": "from typing import List\ndef count_unique_numbers(numbers: List[int]) -> int:\n    unique_numbers = set()\n    for num in numbers:\n        unique_numbers.add(num)\n    return len(unique_numbers)\n", "entry_point": "count_unique_numbers", "input": "[1, 2, 3, 4, 5, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129275_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007739", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[9, 5, 1, 10, 6, 10, 9, 7, 6]", "output": "[81, 25, 1, 10, 6, 10, 81, 49, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007740", "code": "def sum_even_numbers(input_list):\n    total_sum = 0\n    for element in input_list:\n        if isinstance(element, str):\n            try:\n                num = int(element)\n                if num % 2 == 0:\n                    total_sum += num\n            except ValueError:\n                pass\n        elif isinstance(element, int) and element % 2 == 0:\n            total_sum += element\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[61174]", "output": "61174", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120619_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007741", "code": "import re\ndef isDone(qstat_job):\n    status_list = qstat_job.strip().split()\n    if len(status_list) == 1:\n        return True\n    for status in status_list:\n        if re.match(\"d.*\", status):\n            return True\n    return False\n", "entry_point": "isDone", "input": "'done'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77573_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007742", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[1, 2, 2, 3, 6, 6]", "output": "([1, 2, 3, 6], 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007743", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# text.'", "output": "'text.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007744", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'4.9.9'", "output": "'5.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007745", "code": "import ast\nimport sys\ndef extract_imported_modules(code):\n    tree = ast.parse(code)\n    imported_modules = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imported_modules.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            if node.module is not None and not node.module.startswith('sys'):\n                imported_modules.add(node.module.split('.')[0])\n    std_lib_modules = set(sys.builtin_module_names)\n    user_defined_modules = sorted(imported_modules - std_lib_modules)\n    return user_defined_modules\n", "entry_point": "extract_imported_modules", "input": "'import math\\nimport os'", "output": "['os']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41250_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007746", "code": "def generate_test_cases(prefix, operations):\n    test_cases = []\n    for operation in operations:\n        test_name = prefix + operation.upper().replace(' ', '_')\n        test_cases.append(test_name)\n    return sorted(test_cases)\n", "entry_point": "generate_test_cases", "input": "'test_', ['deecruer', 'deecruer m']", "output": "['test_DEECRUER', 'test_DEECRUER_M']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136677_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007747", "code": "def max_subset_sum_non_adjacent(arr):\n    incl = 0\n    excl = 0\n    for i in arr:\n        new_excl = max(incl, excl)  # Calculate the new value for excl\n        incl = excl + i  # Update incl to be excl + current element\n        excl = new_excl  # Update excl for the next iteration\n    return max(incl, excl)  # Return the maximum of incl and excl\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[3, 5, 11]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143195_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007748", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[1, 3, 5]", "output": "[2, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007749", "code": "import re\ndef process_text(input_text: str) -> str:\n    # Remove all characters that are not Cyrillic or alphanumeric\n    processed_text = re.sub(r\"[^\u0430-\u044f\u0410-\u042f0-9 ]+\", \"\", input_text)\n    # Replace double spaces with a single space\n    processed_text = re.sub('(  )', ' ', processed_text)\n    # Replace \"\\r\\n\" with a space\n    processed_text = processed_text.replace(\"\\r\\n\", \" \")\n    return processed_text\n", "entry_point": "process_text", "input": "'\u0442\u0435\u0441\u0440\u043e\u043a\u0430'", "output": "'\u0442\u0435\u0441\u0440\u043e\u043a\u0430'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100805_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007750", "code": "def identify_unique_individuals(actions):\n    unique_individuals = set()\n    for action in actions:\n        words = action.split()\n        for word in words:\n            if word.istitle():  # Check if the word is capitalized (assumed to be a name)\n                unique_individuals.add(word)\n    return list(unique_individuals)\n", "entry_point": "identify_unique_individuals", "input": "['this is a test', 'another string', 'lowercase words here']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25231_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007751", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'aaabbccccd'", "output": "'a3b2c4d1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9158", "output": "{1, 2, 4579, 482, 9158, 38, 241, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007753", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[0, 0, 0, 0, 1, -3, 4, -4, 2]", "output": "{0: 4, 1: 1, -3: 1, 4: 1, -4: 1, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007754", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "388", "output": "{1, 2, 194, 388, 4, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt387", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007755", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[2, 2, 4, 4, 4, 1, 1, 3, 3]", "output": "[2, 2, 4, 4, 4, 1, 1, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007756", "code": "import ast\ndef count_unique_libraries(script: str) -> int:\n    imports = set()\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports.add(alias.name.split('.')[0])\n        elif isinstance(node, ast.ImportFrom):\n            imports.add(node.module.split('.')[0])\n    return len(imports)\n", "entry_point": "count_unique_libraries", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17353_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007757", "code": "from typing import List\ndef find_first_duplicate(A: List[int]) -> int:\n    seen = set()\n    for num in A:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 4, 5, 6, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55340_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007758", "code": "from typing import List\ndef calculate_sum_and_max_odd(numbers: List[int]) -> int:\n    even_sum = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return even_sum * max_odd\n", "entry_point": "calculate_sum_and_max_odd", "input": "[8, 8, 9]", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2830_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007759", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'httphshhh', '/api/d/ta'", "output": "'httphshhh/api/d/ta'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007760", "code": "def extract_major_minor_version(version_string):\n    # Split the version string by the dot ('.') character\n    version_parts = version_string.split('.')\n    # Extract the major version\n    major_version = int(version_parts[0])\n    # Extract the minor version by removing non-numeric characters\n    minor_version = ''.join(filter(str.isdigit, version_parts[1]))\n    # Convert the major and minor version parts to integers\n    minor_version = int(minor_version)\n    # Return a tuple containing the major and minor version numbers\n    return major_version, minor_version\n", "entry_point": "extract_major_minor_version", "input": "'3333.143'", "output": "(3333, 143)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141202_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007761", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[1, 3, 0, 2, 1]", "output": "[1, 2, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007762", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'my_module', 'some_attribute'", "output": "'Error: Module my_module not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007763", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'1.99.9'", "output": "'1.100.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007764", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[1, 0, 2], 10, 3", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007765", "code": "from typing import List\nimport logging\ndef process_cookies(cookie_indices: List[int]) -> List[int]:\n    valid_cookies_index = [index for index in cookie_indices if index % 2 == 0 and index % 3 == 0]\n    logging.info('Checking the cookie for validity is over.')\n    return valid_cookies_index\n", "entry_point": "process_cookies", "input": "[6, 6, 1, 2, 3, 5]", "output": "[6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99711_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007766", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3897", "output": "{1, 3, 9, 433, 1299, 3897}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007767", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'mmy_modd_m', 'some_attribute'", "output": "'Error: Module mmy_modd_m not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007768", "code": "def asigning_variables(config):\n    path = config.get('path', '')\n    offres = config.get('offres', '')\n    yaml_path = config.get('yaml', '')\n    n_sequences = config.get('n_sequences', 0)\n    return path, offres, yaml_path, n_sequences\n", "entry_point": "asigning_variables", "input": "{}", "output": "('', '', '', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007769", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1442", "output": "{1, 1442, 2, 7, 103, 206, 14, 721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007770", "code": "def text_transformation(text: str) -> str:\n    # Convert to lowercase, replace \"deprecated\" with \"obsolete\", strip whitespaces, and reverse the string\n    transformed_text = text.lower().replace(\"deprecated\", \"obsolete\").strip()[::-1]\n    return transformed_text\n", "entry_point": "text_transformation", "input": "'ii'", "output": "'ii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19675_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007771", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[5, 3, 4, 4, 2]", "output": "{5: 1, 3: 1, 4: 2, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007772", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110101X'", "output": "['11101010', '11101011']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt63", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007773", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[20, 20, 23]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007774", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'Waag', 4, 3", "output": "'4: Waag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007775", "code": "import re\nregex = (\n    r'^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12]['\n    r'0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|['\n    r'+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$'\n)\nmatch_iso8601 = re.compile(regex).match\ndef validate_iso8601(str_val):\n    \"\"\"Check if datetime string is in ISO8601 format.\"\"\"\n    try:\n        if match_iso8601(str_val) is not None:\n            return True\n    except re.error:\n        pass\n    return False\n", "entry_point": "validate_iso8601", "input": "'2021-02-30'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27877_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007776", "code": "def is_one_edit_distance_apart(s, t):\n    if abs(len(s) - len(t)) > 1:\n        return False\n    if len(s) < len(t):\n        s, t = t, s\n    mismatch_found = False\n    i = j = 0\n    while i < len(s) and j < len(t):\n        if s[i] != t[j]:\n            if mismatch_found:\n                return False\n            mismatch_found = True\n            if len(s) == len(t):\n                j += 1\n        else:\n            j += 1\n        i += 1\n    return mismatch_found or len(s) > len(t)\n", "entry_point": "is_one_edit_distance_apart", "input": "'abc', 'abx'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3753_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007777", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7439", "output": "{1, 43, 173, 7439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007778", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4051", "output": "{1, 4051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007779", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    nums.sort()\n    n = len(nums)\n    return max(nums[n-1] * nums[n-2] * nums[n-3], nums[0] * nums[1] * nums[n-1])\n", "entry_point": "max_product_of_three", "input": "[-2, -1, 14]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112128_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007780", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.9.3'", "output": "(0, 9, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007781", "code": "from typing import List\ndef calculate_total(operations: List[int]) -> int:\n    total = 0\n    stack = []\n    for op in operations:\n        if op == 0:\n            total += op\n            stack.append(op)\n        elif op == 1:\n            if stack:\n                last_added = stack.pop()\n                total -= last_added\n        elif op == 2:\n            while stack:\n                last_added = stack.pop()\n                total -= last_added\n    return total\n", "entry_point": "calculate_total", "input": "[0, 0, 1, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43366_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007782", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[0, 1, -1, 5, 3, 2]", "output": "[1, 0, 4, 8, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117452_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007783", "code": "def format_order_details(order_details):\n    formatted_order = \"Order Details:\\n\"\n    for item, quantity in order_details.items():\n        formatted_order += f\"- {item}: {quantity}\\n\"\n    return formatted_order\n", "entry_point": "format_order_details", "input": "{}", "output": "'Order Details:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136623_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007784", "code": "def search_value_in_list(x, val):\n    for index, element in enumerate(x):\n        if element == val:\n            return index\n    return -1\n", "entry_point": "search_value_in_list", "input": "[], 5", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81667_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007785", "code": "from typing import List, Tuple, Any, Dict\ndef convert_settings(settings_list: List[Tuple[str, Any]]) -> Dict[str, Any]:\n    settings_dict = {}\n    for key, value in settings_list:\n        settings_dict[key] = value\n    return settings_dict\n", "entry_point": "convert_settings", "input": "[('key1', 100), ('key2', None)]", "output": "{'key1': 100, 'key2': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139910_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007786", "code": "def process_allowed_hosts(allowed_hosts_str):\n    if not allowed_hosts_str:\n        return []\n    allowed_hosts = set()\n    for host in allowed_hosts_str.split(','):\n        host = host.strip()\n        if host:\n            allowed_hosts.add(host)\n    return list(allowed_hosts)\n", "entry_point": "process_allowed_hosts", "input": "'  v.mplm, example   '", "output": "['example', 'v.mplm']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75961_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007787", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'255'", "output": "255", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1256", "output": "{1, 2, 4, 1256, 8, 628, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1255", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007789", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'samptext. samplele'", "output": "'Samptext. samplele'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007790", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[2, -3, 5, -7]", "output": "[4, 27, 25, 343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007791", "code": "def calculate_xor_checksum(input_string):\n    checksum = 0\n    for char in input_string:\n        checksum ^= ord(char)\n    return checksum\n", "entry_point": "calculate_xor_checksum", "input": "'b'", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56407_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007792", "code": "from typing import List\ndef count_unique_numbers(nums: List[int]) -> int:\n    unique_abs_values = set()\n    for num in nums:\n        unique_abs_values.add(abs(num))\n    return len(unique_abs_values)\n", "entry_point": "count_unique_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102352_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007793", "code": "def longest_equal_even_odd_subarray(arr):\n    diff_indices = {0: -1}\n    max_length = 0\n    diff = 0\n    for i, num in enumerate(arr):\n        diff += 1 if num % 2 != 0 else -1\n        if diff in diff_indices:\n            max_length = max(max_length, i - diff_indices[diff])\n        else:\n            diff_indices[diff] = i\n    return max_length\n", "entry_point": "longest_equal_even_odd_subarray", "input": "[1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99623_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007794", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "8", "output": "159", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007795", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[1, 2, 2, 8, 2, 2, 2, 3]", "output": "[1, 3, 4, 11, 6, 7, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007796", "code": "from typing import List\nimport heapq\ndef reconstruct_sequence(freq_list: List[int]) -> List[int]:\n    pq = []\n    for i, freq in enumerate(freq_list):\n        heapq.heappush(pq, (freq, i+1))\n    result = []\n    while pq:\n        freq, elem = heapq.heappop(pq)\n        result.append(elem)\n        freq -= 1\n        if freq > 0:\n            heapq.heappush(pq, (freq, elem))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[2, 1, 1, 1]", "output": "[2, 3, 4, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41932_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007797", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "'token', 4, [0, 1, 2, 3, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007798", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'/pat/y'", "output": "\"Directory '/pat/y' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007799", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 10, 10, 20, 20, 40]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9991", "output": "{1, 103, 97, 9991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007801", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'1311.3.9'", "output": "'1311.4.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007802", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 11]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19002_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007803", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_num = num + 2\n        else:\n            processed_num = max(num - 1, 0)  # Subtract 1 from odd numbers, ensure non-negativity\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_integers", "input": "[-2, 1, 0, -2, 2, 1, 4, 0]", "output": "[0, 0, 2, 0, 4, 0, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98159_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007804", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    prev_score = None\n    ranks = []\n    for score in reversed(scores):\n        if score not in rank_dict:\n            if prev_score is not None and score < prev_score:\n                current_rank += 1\n            rank_dict[score] = current_rank\n        ranks.append(rank_dict[score])\n        prev_score = score\n    return ranks[::-1]\n", "entry_point": "calculate_ranks", "input": "[100, 100, 100, 100, 100, 100]", "output": "[1, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9219_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007805", "code": "def process_list(lst):\n    length = len(lst)\n    if length % 2 == 1:  # Odd number of elements\n        middle_index = length // 2\n        return lst[:middle_index] + lst[middle_index + 1:]\n    else:  # Even number of elements\n        middle_index = length // 2\n        return lst[:middle_index - 1] + lst[middle_index + 1:]\n", "entry_point": "process_list", "input": "[4, 4, 4, 0, 5, 5, 5]", "output": "[4, 4, 4, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52704_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007806", "code": "import re\ndef render_template(template, variables):\n    def replace_variable(match):\n        variable_name = match.group(1)\n        return str(variables.get(variable_name, match.group(0)))\n    return re.sub(r'{{\\s*(\\w+)\\s*}}', replace_variable, template)\n", "entry_point": "render_template", "input": "'{{ missing_var }}', {}", "output": "'{{ missing_var }}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68570_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007807", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[70, 75, 77, 80, 85]", "output": "77.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46711_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5596", "output": "{1, 2, 4, 2798, 1399, 5596}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5595", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007809", "code": "def calculate_accuracy(true_classes, predicted_classes):\n    if len(true_classes) != len(predicted_classes):\n        raise ValueError(\"Lengths of true_classes and predicted_classes must be equal\")\n    correct_predictions = sum(1 for true, pred in zip(true_classes, predicted_classes) if true == pred)\n    total_predictions = len(true_classes)\n    accuracy = correct_predictions / total_predictions if total_predictions > 0 else 0.0\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 1, 1, 0], [1, 1, 1, 1, 1]", "output": "0.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127344_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007810", "code": "from typing import List\ndef most_common_age(ages: List[int]) -> int:\n    age_freq = {}\n    for age in ages:\n        if age in age_freq:\n            age_freq[age] += 1\n        else:\n            age_freq[age] = 1\n    most_common = min(age_freq, key=lambda x: (-age_freq[x], x))\n    return most_common\n", "entry_point": "most_common_age", "input": "[24, 24, 22, 25]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113386_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6505", "output": "{1, 1301, 6505, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9304", "output": "{1, 2, 4, 8, 1163, 4652, 2326, 9304}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9303", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007813", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[0]", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007814", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 5, 3, 5, 3, 3]", "output": "[9, 8, 8, 8, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007815", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8716", "output": "{1, 2, 2179, 4, 4358, 8716}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8715", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007816", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[0, 0, 0, 0, 1, 1, 2, 2]", "output": "{0: 4, 1: 2, 2: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007817", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2561", "output": "{197, 1, 13, 2561}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007818", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3131", "output": "{1, 3131, 101, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6729", "output": "{6729, 1, 3, 2243}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007820", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1172", "output": "{1, 2, 4, 293, 586, 1172}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1171", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007821", "code": "def is_sorted_non_decreasing(lst):\n    for i in range(len(lst) - 1):\n        if lst[i] > lst[i + 1]:\n            return False\n    return True\n", "entry_point": "is_sorted_non_decreasing", "input": "[1, 2, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122366_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007822", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'1234567890abcdef'", "output": "{'bytecode': '0x1234567890abcdef'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007823", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'xt.com'", "output": "'xt.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007824", "code": "def count_unique_dependencies(dependencies):\n    unique_dependencies_count = {}\n    for dependency in dependencies:\n        package, dependency_name = dependency.split()\n        if package in unique_dependencies_count:\n            unique_dependencies_count[package].add(dependency_name)\n        else:\n            unique_dependencies_count[package] = {dependency_name}\n    return {package: len(dependencies) for package, dependencies in unique_dependencies_count.items()}\n", "entry_point": "count_unique_dependencies", "input": "['package1 depA', 'package3 depB']", "output": "{'package1': 1, 'package3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1592_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007825", "code": "def reconstruct_string(char_counts):\n    char_map = {chr(ord('a') + i): count for i, count in enumerate(char_counts)}\n    sorted_char_map = dict(sorted(char_map.items(), key=lambda x: x[1]))\n    result = ''\n    for char, count in sorted_char_map.items():\n        result += char * count\n    return result\n", "entry_point": "reconstruct_string", "input": "[2, 0, 3, 2] + [0] * 22", "output": "'aaddccc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66252_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007826", "code": "def filter_grafana_modules(data):\n    grafana_modules = []\n    for module_name, module_info in data.get('modules', {}).items():\n        if module_info.get('type') == 'grafana':\n            grafana_modules.append(module_info.get('name'))\n    return grafana_modules\n", "entry_point": "filter_grafana_modules", "input": "{'modules': {'module1': {'type': 'prometheus', 'name': 'Module One'}}}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14788_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007827", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 1, 3, 3, 2, 0, 3]", "output": "[1, 6, 9, 8, 0, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45837_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007828", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[31]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007829", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[6, 7, 8, 9, 10, 4, 4]", "output": "6.857142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007830", "code": "# Dictionary mapping hexadecimal constants to their meanings\nconstants_dict = {\n    0x1F: 'INVALID_IO',\n    0x20: 'INVALID_ESC_CHAR',\n    0x23: 'INVALID_VAR_NAME_TOO_LONG',\n    0x65: 'EVENT_TOUCH_HEAD',\n    0x66: 'CURRENT_PAGE_ID_HEAD',\n    0x67: 'EVENT_POSITION_HEAD',\n    0x68: 'EVENT_SLEEP_POSITION_HEAD',\n    0x70: 'STRING_HEAD',\n    0x71: 'NUMBER_HEAD',\n    0x86: 'EVENT_ENTER_SLEEP_MODE',\n    0x87: 'EVENT_ENTER_WAKE_UP_MODE',\n    0x88: 'EVENT_LAUNCHED',\n    0x89: 'EVENT_UPGRADED',\n    0xFD: 'EVENT_DATA_TR_FINISHED',\n    0xFE: 'EVENT_DATA_TR_READY'\n}\ndef decode_hex(hex_value):\n    decimal_value = int(hex_value, 16)\n    return constants_dict.get(decimal_value, 'Unknown')\n", "entry_point": "decode_hex", "input": "'0x20'", "output": "'INVALID_ESC_CHAR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78460_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1978", "output": "{1, 2, 43, 46, 86, 23, 1978, 989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007832", "code": "def sum_multiples(nums):\n    multiples_set = set()\n    total_sum = 0\n    for num in nums:\n        if num in multiples_set:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[5, 10, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131152_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007833", "code": "def extract_blocks_with_style(blocks, target_style):\n    contents = []\n    for block in blocks:\n        if block.get(\"style\") == target_style:\n            contents.append(block.get(\"content\"))\n    return contents\n", "entry_point": "extract_blocks_with_style", "input": "[], 'some_style'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137272_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007834", "code": "def modify_sets(input_sets):\n    for s in input_sets:\n        if any(isinstance(elem, str) for elem in s):\n            s.discard(next(iter(s), None))\n        if any(isinstance(elem, int) for elem in s):\n            s.update({elem + 100 for elem in s if isinstance(elem, int)})\n        if any(isinstance(elem, bool) for elem in s):\n            s.update({not elem for elem in s if isinstance(elem, bool)})\n        if any(not isinstance(elem, (int, str, bool)) for elem in s):\n            first_elem = next(iter(s), None)\n            s.clear()\n            s.add(first_elem)\n    return input_sets\n", "entry_point": "modify_sets", "input": "[{'a'}, {'b'}, {'c'}, {'d'}, {'e'}]", "output": "[set(), set(), set(), set(), set()]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74367_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007835", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[1, 2, 2, 3, 4, 4]", "output": "{1, 2, 3, 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007836", "code": "import re\n# Regex for form fields\nRE_EMAIL = re.compile(r'^[\\S]+@[\\S]+\\.[\\S]+$')\n# Form validation error messages\nRE_EMAIL_FAIL = \"That's not a valid email. Please try again.\"\nRE_EMAIL_SUCCESS = \"You will be the first to be updated!\"\ndef validate_email(email):\n    if RE_EMAIL.match(email):\n        return RE_EMAIL_SUCCESS\n    else:\n        return RE_EMAIL_FAIL\n", "entry_point": "validate_email", "input": "''", "output": "\"That's not a valid email. Please try again.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123274_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007837", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'cryptounknown'", "output": "\"Operation type 'cryptounknown' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007838", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2015", "output": "{1, 65, 5, 13, 403, 155, 31, 2015}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007839", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 1, 2, 3, 2, 1, 1, 7, 1]", "output": "[7, 2, 4, 6, 6, 6, 7, 14, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007840", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1558", "output": "{1, 2, 38, 41, 779, 82, 19, 1558}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007841", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'abcdefg', 'a'", "output": "0.14285714285714285", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007842", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'7123456Z56X89'", "output": "('7123456Z56X89', None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007843", "code": "def get_module_version(module_name: str) -> str:\n    version = \"undefined\"\n    try:\n        # Attempt to import the module dynamically\n        module = __import__(module_name, fromlist=['_version'])\n        # Try to access the version number from the imported module\n        try:\n            version = module._version.version\n        except AttributeError:\n            pass\n    except ImportError:\n        pass\n    return version\n", "entry_point": "get_module_version", "input": "'nonexistent_module'", "output": "'undefined'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78058_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007844", "code": "def count_e_letters(input_string):\n    count = 0\n    lowercase_input = input_string.lower()\n    for char in lowercase_input:\n        if char == 'e' or char == '\u00e9':\n            count += 1\n    return count\n", "entry_point": "count_e_letters", "input": "'e\u00e9ee'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15839_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007845", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'2.5.913'", "output": "'2.5.914'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007846", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4328", "output": "{1, 2, 4, 4328, 8, 2164, 1082, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4327", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007847", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6515", "output": "{1, 6515, 5, 1303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007848", "code": "def rounded_sum(numbers):\n    total_sum = sum(numbers)\n    rounded_sum = round(total_sum)\n    return rounded_sum\n", "entry_point": "rounded_sum", "input": "[11.5]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88747_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9353", "output": "{1, 9353, 199, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007850", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'xx946yy518zz'", "output": "{946, 518}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007851", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "1000000000.0, -2035597599.0007524", "output": "-3035597599.0007524", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007852", "code": "def highest_version_library(theano_version, tensorflow_version, keras_version):\n    def version_tuple(version_str):\n        return tuple(map(int, version_str.split('.')))\n    theano_tuple = version_tuple(theano_version)\n    tensorflow_tuple = version_tuple(tensorflow_version)\n    keras_tuple = version_tuple(keras_version)\n    if tensorflow_tuple > theano_tuple and tensorflow_tuple > keras_tuple:\n        return 'TensorFlow'\n    elif keras_tuple > theano_tuple and keras_tuple > tensorflow_tuple:\n        return 'Keras'\n    else:\n        return 'Theano'\n", "entry_point": "highest_version_library", "input": "'1.0.5', '2.5.0', '2.0.0'", "output": "'TensorFlow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96884_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007853", "code": "def workflow_run_2_3(value, system):\n    if 'output_quality_metrics' in value:\n        del value['output_quality_metrics']\n    return value\n", "entry_point": "workflow_run_2_3", "input": "{'output_quality_metrics': 'some_value'}, None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116515_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007854", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "103.0, 97.0", "output": "(-51.5, 51.5, 88.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007855", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[1, 5, -2, 2, 3, 1]", "output": "[1, 25, -4, 4, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007856", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007857", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'ffifil.'", "output": "{'': ['ffifil.']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007858", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "4", "output": "'oh la laoh la la'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007859", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[2, 4, 17]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007860", "code": "def sum_multiples_of_3_or_5(input_list):\n    total_sum = 0\n    seen_multiples = set()  # To avoid counting multiples of both 3 and 5 twice\n    for num in input_list:\n        if num % 3 == 0 and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n        elif num % 5 == 0 and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26577_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007861", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[4, 1, 0, 2, 1, 0, 4, 11, 11]", "output": "[4, 1, 2, 1, 4, 11, 11, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007862", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'2.2.521'", "output": "(2, 2, 521)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007863", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[5, 7], [0, 1]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007864", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "243", "output": "{1, 3, 9, 81, 243, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007865", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007866", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 4, 2, 3, 4, 1, 9, 3]", "output": "[4, 5, 4, 6, 8, 6, 15, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007867", "code": "import re\ndef extract_password(response_text):\n    password = re.findall(\"\\[[0-9]{2}\\.[0-9]{2}.[0-9]{4} [0-9]{2}::[0-9]{2}:[0-9]{2}\\] (.*)\\n\", response_text)[0]\n    return password\n", "entry_point": "extract_password", "input": "'[12.12.2020 10::30:45] PassworRD1\\n'", "output": "'PassworRD1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135431_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007868", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    a, b = 0, 1\n    fib_sum = a\n    for _ in range(1, n):\n        a, b = b, a + b\n        fib_sum += a\n    return fib_sum\n", "entry_point": "fibonacci_sum", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117189_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007869", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[0, 0, 1, 2, 2, 7, 9, 10]", "output": "[0, 0, 1, 2, 2, 7, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8830", "output": "{1, 2, 5, 1766, 10, 883, 8830, 4415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8829", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007871", "code": "def evaluate_expression(tree):\n    if isinstance(tree, int):\n        return tree\n    else:\n        operator, *operands = tree\n        left_operand = evaluate_expression(operands[0])\n        right_operand = evaluate_expression(operands[1])\n        if operator == '+':\n            return left_operand + right_operand\n        elif operator == '-':\n            return left_operand - right_operand\n        elif operator == '*':\n            return left_operand * right_operand\n        elif operator == '/':\n            if right_operand == 0:\n                raise ZeroDivisionError(\"Division by zero\")\n            return left_operand / right_operand\n        else:\n            raise ValueError(\"Invalid operator\")\n", "entry_point": "evaluate_expression", "input": "['+', 3, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_972_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007872", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[2, 3, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007873", "code": "from typing import List\ndef bubble_sort_and_count_swaps(arr: List[int]) -> int:\n    swaps = 0\n    n = len(arr)\n    for i in range(n):\n        for j in range(n - i - 1):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swaps += 1\n    return swaps\n", "entry_point": "bubble_sort_and_count_swaps", "input": "[4, 3, 2, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135568_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007874", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'jjojndj'", "output": "'jjojndj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007875", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'document'", "output": "{'document': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8281", "output": "{1, 7, 169, 13, 49, 8281, 91, 637, 1183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007877", "code": "from datetime import date, timedelta\ndef weeks_dates(wky):\n    # Parse week number and year from the input string\n    wk = int(wky[:2])\n    yr = int(wky[2:])\n    # Calculate the starting date of the year\n    start_date = date(yr, 1, 1)\n    start_date += timedelta(6 - start_date.weekday())\n    # Calculate the date range for the given week number and year\n    delta = timedelta(days=(wk - 1) * 7)\n    date_start = start_date + delta\n    date_end = date_start + timedelta(days=6)\n    # Format the date range as a string\n    date_range = f'{date_start} to {date_end}'\n    return date_range\n", "entry_point": "weeks_dates", "input": "'0107417'", "output": "'7417-01-05 to 7417-01-11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143506_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007878", "code": "def longest_consecutive_sequence(steps):\n    current_length = 0\n    max_length = 0\n    for step in steps:\n        if step != 0:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 0\n    return max_length\n", "entry_point": "longest_consecutive_sequence", "input": "[0, 1, 2, 3, 4, 5, 6, 0]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74155_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007879", "code": "def extract_variables(file_content):\n    extracted_variables = {}\n    # Extract LINEDIR value\n    linedir_start = file_content.find(\"LINEDIR=\") + len(\"LINEDIR=\")\n    linedir_end = file_content.find(\"\\n\", linedir_start)\n    linedir_value = file_content[linedir_start:linedir_end].strip()\n    # Extract LINE_VERSION value\n    line_version_start = file_content.find(\"LINE_VERSION=\") + len(\"LINE_VERSION=\")\n    line_version_end = file_content.find(\"\\n\", line_version_start)\n    line_version_value = file_content[line_version_start:line_version_end].strip()\n    extracted_variables['LINEDIR'] = linedir_value\n    extracted_variables['LINE_VERSION'] = line_version_value\n    return extracted_variables\n", "entry_point": "extract_variables", "input": "'LINEDIR=r\\nLINE_VERSION='", "output": "{'LINEDIR': 'r', 'LINE_VERSION': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105382_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007880", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1629", "output": "{1, 3, 9, 181, 1629, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007881", "code": "def filter_hyperparameters(hyperparameters, threshold):\n    filtered_hyperparameters = {}\n    for key, value in hyperparameters.items():\n        if isinstance(value, float) and value > threshold:\n            filtered_hyperparameters[key] = value\n    return filtered_hyperparameters\n", "entry_point": "filter_hyperparameters", "input": "{'a': 1, 'b': 'text'}, 0.5", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_208_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007882", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "2, -5", "output": "-10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007883", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'Preixb', 'PRETPPETIX'", "output": "'preixbPRETPPETIX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007884", "code": "def bicubic_kernel(x, a=-0.50):\n    abs_x = abs(x)\n    if abs_x <= 1.0:\n        return (a + 2.0) * (abs_x ** 3.0) - (a + 3.0) * (abs_x ** 2.0) + 1\n    elif 1.0 < abs_x < 2.0:\n        return a * (abs_x ** 3) - 5.0 * a * (abs_x ** 2.0) + 8.0 * a * abs_x - 4.0 * a\n    else:\n        return 0.0\n", "entry_point": "bicubic_kernel", "input": "2.0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11047_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007885", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/tmp', 'ipm'", "output": "'/tmp/ipm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007886", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "5, b=5", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007887", "code": "from typing import List\ndef last_successful_step(steps: List[int]) -> int:\n    last_successful = 0\n    for step in steps:\n        if step > last_successful + 1:\n            return last_successful\n        last_successful = step\n    return steps[-1]\n", "entry_point": "last_successful_step", "input": "[2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132617_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007888", "code": "def filter_packages_by_keyword(packages, keyword):\n    filtered_packages = []\n    for package in packages:\n        if keyword in package['description']:\n            filtered_packages.append((package['name'], package['version']))\n    return filtered_packages\n", "entry_point": "filter_packages_by_keyword", "input": "[], 'test'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146898_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007889", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[2, 2]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007890", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'Clip.settings'", "output": "'Clip'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007891", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "': EHEPELP:'", "output": "{'': 'EHEPELP:'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007892", "code": "def replace_file_type(file_name, new_type):\n    \"\"\"\n    Replaces the file type extension of a given file name with a new type.\n    :param file_name: Original file name with extension\n    :param new_type: New file type extension\n    :return: Modified file name with updated extension\n    \"\"\"\n    file_name_parts = file_name.split(\".\")\n    if len(file_name_parts) > 1:  # Ensure there is a file extension to replace\n        file_name_parts[-1] = new_type  # Replace the last part (file extension) with the new type\n        return \".\".join(file_name_parts)  # Join the parts back together with \".\"\n    else:\n        return file_name  # Return the original file name if no extension found\n", "entry_point": "replace_file_type", "input": "'dodut', ' '", "output": "'dodut'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41247_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007893", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 39, 39, 20, 15]", "output": "[42, 39, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007894", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'11.1311101.0'", "output": "'11.1311101.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45821_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007895", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "2, 9", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007896", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "10", "output": "[1, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007897", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_evens", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121805_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007898", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'data science jobs in', 'Berlin'", "output": "'data science jobs in Berlin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007899", "code": "def calculate_video_duration(frames: int, fps: int) -> int:\n    total_duration = frames // fps\n    return total_duration\n", "entry_point": "calculate_video_duration", "input": "17, 1", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77453_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007900", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3545", "output": "{709, 1, 3545, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007901", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[6, 7, 6, 7, 1, 1]", "output": "[6, 8, 8, 10, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1723", "output": "{1, 1723}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007903", "code": "def largest_rectangle_area(histogram):\n    stack = []\n    max_area = 0\n    index = 0\n    while index < len(histogram):\n        if not stack or histogram[index] >= histogram[stack[-1]]:\n            stack.append(index)\n            index += 1\n        else:\n            top = stack.pop()\n            area = histogram[top] * ((index - stack[-1] - 1) if stack else index)\n            max_area = max(max_area, area)\n    while stack:\n        top = stack.pop()\n        area = histogram[top] * ((index - stack[-1] - 1) if stack else index)\n        max_area = max(max_area, area)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[1, 1, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29850_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007904", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[2, 3, 4, 2, 3, 2]", "output": "[4, 37, 16, 4, 37, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007905", "code": "def reverse_words_in_string(input_string):\n    words = input_string.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words_in_string", "input": "'ore'", "output": "'ero'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137200_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1106", "output": "{1, 2, 7, 553, 14, 79, 1106, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1105", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007907", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[-4, -5, -3, -2], 0, 2", "output": "[-8, -10, -6, -4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007908", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "698", "output": "{1, 698, 2, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt697", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "793", "output": "{1, 61, 13, 793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007910", "code": "def generate_timestamps(frequency, duration):\n    timestamps = []\n    for sec in range(0, duration+1, frequency):\n        hours = sec // 3600\n        minutes = (sec % 3600) // 60\n        seconds = sec % 60\n        timestamp = f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n        timestamps.append(timestamp)\n    return timestamps\n", "entry_point": "generate_timestamps", "input": "11, 22", "output": "['00:00:00', '00:00:11', '00:00:22']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12595_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007911", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = low + (high - low) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[50, 60, 70, 80, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], 92", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31126_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007912", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "8", "output": "40320", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007913", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'Ishii'", "output": "'Ish\u30a4\u30b7\u30a4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007914", "code": "from typing import List\ndef get_selinux_state(policies: List[str]) -> str:\n    enforcing_count = 0\n    permissive_count = 0\n    for policy in policies:\n        if policy == \"enforcing\":\n            enforcing_count += 1\n        elif policy == \"permissive\":\n            permissive_count += 1\n    if enforcing_count == len(policies):\n        return \"enforcing\"\n    elif permissive_count == len(policies):\n        return \"permissive\"\n    else:\n        return \"mixed\"\n", "entry_point": "get_selinux_state", "input": "['enforcing', 'permissive']", "output": "'mixed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24751_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007915", "code": "def organize_offices(office_data):\n    office_mapping = {}\n    for office_type, office in office_data:\n        if office_type in office_mapping:\n            office_mapping[office_type].append(office)\n        else:\n            office_mapping[office_type] = [office]\n    return office_mapping\n", "entry_point": "organize_offices", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21578_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007916", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "find_latest_version", "input": "['3.4.4', '3.3.5', '3.4.5']", "output": "'3.4.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112747_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007917", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1754", "output": "{1, 1754, 2, 877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5707", "output": "{1, 5707, 13, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007919", "code": "def process_dependencies(dependencies):\n    dependency_map = {}\n    all_components = set()\n    no_dependency_components = set()\n    result = []\n    for dependency in dependencies:\n        dependent, dependency_of = dependency\n        all_components.add(dependent)\n        all_components.add(dependency_of)\n        if dependency_of not in dependency_map:\n            dependency_map[dependency_of] = []\n        dependency_map[dependency_of].append(dependent)\n    for component in all_components:\n        if component not in dependency_map:\n            no_dependency_components.add(component)\n    while no_dependency_components:\n        component = no_dependency_components.pop()\n        result.append(component)\n        if component in dependency_map:\n            dependents = dependency_map[component]\n            for dependent in dependents:\n                dependency_map[component].remove(dependent)\n                if not any(dependency_map[other_component] == [dependent] for other_component in dependency_map.values()):\n                    no_dependency_components.add(dependent)\n    return result\n", "entry_point": "process_dependencies", "input": "[('A', 'B'), ('B', 'A')]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9786_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007920", "code": "def find_product(rows, goal):\n    rows.sort()\n    l = 0\n    r = len(rows) - 1\n    while rows[l] + rows[r] != goal and l < r:\n        if rows[l] + rows[r] < goal:\n            l += 1\n        else:\n            r -= 1\n    if rows[l] + rows[r] == goal:\n        return rows[l] * rows[r]\n    else:\n        return 'FAIL'\n", "entry_point": "find_product", "input": "[1, 2, 3], 10", "output": "'FAIL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27687_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007921", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "12, 8", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007922", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[1, 1, 0, 4]", "output": "[1, 1, 0, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007923", "code": "def find_example_idx(n, cum_sums, idx=0):\n    N = len(cum_sums)\n    stack = [[0, N-1]]\n    while stack:\n        start, end = stack.pop()\n        search_i = (start + end) // 2\n        if start < end:\n            if n < cum_sums[search_i]:\n                stack.append([start, search_i])\n            else:\n                stack.append([search_i + 1, end])\n        else:\n            if n < cum_sums[start]:\n                return idx + start\n            else:\n                return idx + start + 1\n", "entry_point": "find_example_idx", "input": "8, [0, 1, 2, 3, 4, 5, 6, 7, 9, 10]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89652_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007924", "code": "from typing import List\nimport itertools\ndef count_combinations(nums: List[int], length: int) -> int:\n    # Generate all combinations of the given length from the input list\n    all_combinations = list(itertools.combinations(nums, length))\n    # Return the total number of unique combinations\n    return len(all_combinations)\n", "entry_point": "count_combinations", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 1", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6198_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007925", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 4, 2, 7, 9, 4, 7, 7, 7]", "output": "[2, 4, 4, 7, 7, 7, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt22", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007926", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'data/anonther'", "output": "'data/anonther_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7087", "output": "{1, 19, 373, 7087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007928", "code": "def count_elements(lst):\n    element_count = {}\n    for tup in lst:\n        for elem in tup:\n            if elem in element_count:\n                element_count[elem] += 1\n            else:\n                element_count[elem] = 1\n    return element_count\n", "entry_point": "count_elements", "input": "[('a', 'b'), ('b', 'c'), ('c', 'a')]", "output": "{'a': 2, 'b': 2, 'c': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127979_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007929", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9806", "output": "{1, 2, 9806, 4903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007930", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'/path/totory'", "output": "\"Directory '/path/totory' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007931", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9866", "output": "{1, 9866, 2, 4933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007932", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[95, 95, 90, 90, 90, 90, 90, 85], 8", "output": "90.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74521_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007933", "code": "def sort_modules(modules):\n    def custom_sort(module):\n        return (-module[1], module[0])\n    sorted_modules = sorted(modules, key=custom_sort)\n    sorted_module_names = [module[0] for module in sorted_modules]\n    return sorted_module_names\n", "entry_point": "sort_modules", "input": "[('A', 3), ('B', 1), ('C', 2)]", "output": "['A', 'C', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65686_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007934", "code": "def get_updated_value(filter_condition):\n    metadata = {}\n    if isinstance(filter_condition, str):\n        metadata[filter_condition] = 'default_value'\n    elif isinstance(filter_condition, list):\n        for condition in filter_condition:\n            metadata[condition] = 'default_value'\n    return metadata\n", "entry_point": "get_updated_value", "input": "'fififilter23l3'", "output": "{'fififilter23l3': 'default_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97050_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007935", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 78.0, 79.0, 80.0, 90]", "output": "79.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137363_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007936", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[2, 1, 0, 1, 5, 2, 5]", "output": "[2, 1, 0, 1, 5, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007937", "code": "def custom_reshape(data, shape):\n    total_elements = sum(len(row) for row in data)\n    target_elements = shape[0] * shape[1]\n    if total_elements != target_elements:\n        return None\n    reshaped_data = []\n    for i in range(shape[0]):\n        reshaped_data.append(data[i % len(data)][:shape[1]])\n    return reshaped_data\n", "entry_point": "custom_reshape", "input": "[[1, 2], [4, 5], [1, 2]], (3, 2)", "output": "[[1, 2], [4, 5], [1, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42656_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007938", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3163", "output": "{1, 3163}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007939", "code": "from typing import List, Tuple\ndef card_game(deck1: List[int], deck2: List[int]) -> Tuple[int, int]:\n    score1, score2 = 0, 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score1 += 1\n        elif card2 > card1:\n            score2 += 1\n    return score1, score2\n", "entry_point": "card_game", "input": "[5, 6, 7, 2, 3, 1, 0], [1, 2, 3, 4, 8, 9, 10]", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28513_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007940", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 5, 6, -1, 3, 1, 7, -1]", "output": "[9, 11, 5, 2, 4, 8, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99008_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007941", "code": "import re\ndef extract_migration_details(migration_code):\n    details = {}\n    model_name = re.search(r\"model_name='(\\w+)'\", migration_code)\n    if model_name:\n        details['model_name'] = model_name.group(1)\n    operation = re.search(r\"migrations\\.(\\w+)\\(\", migration_code)\n    if operation:\n        details['operation'] = operation.group(1)\n    field_name = re.search(r\"name='(\\w+)'\", migration_code)\n    if field_name:\n        details['field_name'] = field_name.group(1)\n    new_properties = re.search(r\"field=(models\\.\\w+)\\((.*?)\\)\", migration_code)\n    if new_properties:\n        details['new_properties'] = {}\n        details['new_properties']['field_type'] = new_properties.group(1).split('.')[-1]\n        properties = re.findall(r\"(\\w+)=([^,]+)\", new_properties.group(2))\n        for prop in properties:\n            details['new_properties'][prop[0]] = prop[1].strip()\n    return details\n", "entry_point": "extract_migration_details", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38040_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007942", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007943", "code": "def empty_space(s):\n    if len(s) == 0:\n        return True\n    whitespace = ' \\t\\n'  # Define whitespace characters\n    for c in s:\n        if c not in whitespace:\n            return False\n    return True\n", "entry_point": "empty_space", "input": "'Hello'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16798_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007944", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9931", "output": "{1, 9931}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007945", "code": "from typing import List\ndef minOperations(boxes: str) -> List[int]:\n    ans = [0] * len(boxes)\n    lc = 0\n    lcost = 0\n    rc = 0\n    rcost = 0\n    for i in range(1, len(boxes)):\n        if boxes[i - 1] == \"1\":\n            lc += 1\n        lcost += lc\n        ans[i] = lcost\n    for i in range(len(boxes) - 2, -1, -1):\n        if boxes[i + 1] == \"1\":\n            rc += 1\n        rcost += rc\n        ans[i] += rcost\n    return ans\n", "entry_point": "minOperations", "input": "'110'", "output": "[1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57206_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007946", "code": "def check_baseline_deviation(blvals, threshold_percent):\n    if len(blvals) < 2:\n        raise ValueError(\"At least two baseline values are required for deviation calculation.\")\n    mean_bl = sum(blvals) / len(blvals)\n    max_deviation = max(abs(blvals[i] - blvals[i-1]) for i in range(1, len(blvals)))\n    percentage_deviation = (max_deviation / mean_bl) * 100\n    return percentage_deviation <= threshold_percent\n", "entry_point": "check_baseline_deviation", "input": "[1, 100], 50", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31357_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007947", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[5, 5, 5, 4, 4, 3, 2, 5]", "output": "[2, 3, 4, 4, 5, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007948", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'preprocessor_nameoption2'", "output": "('preprocessor_nameoption2', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007949", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[10, 3, 2, 9, 10]", "output": "[2, 3, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007950", "code": "def largest_prime_factor(N):\n    factor = 2\n    while factor * factor <= N:\n        if N % factor == 0:\n            N //= factor\n        else:\n            factor += 1\n    return max(factor, N)\n", "entry_point": "largest_prime_factor", "input": "83", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109160_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007951", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'RRDD'", "output": "(2, -2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007952", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        patch = 0\n        minor += 1\n        if minor > 9:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'9.9.9'", "output": "'10.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58418_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007953", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "4", "output": "[1, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007954", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[1, 2, 3, 4, 5]", "output": "[1, 4, 27, 16, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1490", "output": "{1, 2, 5, 745, 298, 10, 1490, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1489", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007956", "code": "def longest_common_prefix(revision_identifiers):\n    if not revision_identifiers:\n        return \"\"\n    min_len = min(len(identifier) for identifier in revision_identifiers)\n    prefix = \"\"\n    for i in range(min_len):\n        char = revision_identifiers[0][i]\n        if all(identifier[i] == char for identifier in revision_identifiers):\n            prefix += char\n        else:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "['496dba83', '496dba83xyz', '496dba83abc']", "output": "'496dba83'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147008_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007957", "code": "def calculate_total_time(jobs):\n    total_time = 0\n    for duration in jobs:\n        total_time += duration\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 11]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007958", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "3, 3, 7", "output": "'3.3.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007959", "code": "from typing import List\ndef lift_simulation(people: int, lift: List[int]) -> str:\n    if people <= 0 and sum(lift) % 4 != 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people > 0:\n        return f\"There isn't enough space! {people} people in a queue!\\n\" + ' '.join(map(str, lift))\n    elif people <= 0 and sum(lift) == 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people <= 0:\n        return ' '.join(map(str, lift))\n", "entry_point": "lift_simulation", "input": "0, [62, 61, 80, 61]", "output": "'62 61 80 61'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147066_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007960", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "14, 2", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt4212", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007961", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "9, 10", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007962", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5912", "output": "{1, 2, 739, 4, 1478, 8, 2956, 5912}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5911", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007963", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "101", "output": "'Invalid parameters'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007964", "code": "def max_score_subset(scores):\n    scores.sort()\n    prev_score = prev_count = curr_score = curr_count = max_sum = 0\n    for score in scores:\n        if score == curr_score:\n            curr_count += 1\n        elif score == curr_score + 1:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        else:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        if prev_score == score - 1:\n            max_sum = max(max_sum, prev_count * prev_score + curr_count * curr_score)\n        else:\n            max_sum = max(max_sum, curr_count * curr_score)\n    return max_sum\n", "entry_point": "max_score_subset", "input": "[2, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103662_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007965", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'0.0.7'", "output": "'0.0.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007966", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "77", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007967", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[10, 12, 14]", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145902_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007968", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['+ 3'], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007969", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "2, 2, 4", "output": "'2.2.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007970", "code": "import os\ndef process_recording_data(file_path):\n    try:\n        from pyintan.intan import read_rhd, read_rhs\n        HAVE_PYINTAN = True\n    except ImportError:\n        HAVE_PYINTAN = False\n    if HAVE_PYINTAN:\n        if os.path.exists(file_path):\n            # Read data from the Intan recording file\n            data = read_rhd(file_path)  # Example function, replace with actual data extraction function\n            return data\n        else:\n            return \"File not found\"\n    else:\n        return \"Please install pyintan to use this extractor!\"\n", "entry_point": "process_recording_data", "input": "'/path/to/data.rhd'", "output": "'Please install pyintan to use this extractor!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10642_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007971", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007972", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "83", "output": "0.46111111111111114", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007973", "code": "import re\ndef count_unique_routes(code_snippet):\n    route_pattern = re.compile(r\"@app.route\\(['\\\"](.*?)['\\\"]\\)\")\n    routes = route_pattern.findall(code_snippet)\n    unique_routes = set(routes)\n    return len(unique_routes)\n", "entry_point": "count_unique_routes", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50157_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007974", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'1502:30:05'", "output": "5409005", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "691", "output": "{1, 691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007976", "code": "import ast\nfrom typing import List\ndef extract_function_names(code: str) -> List[str]:\n    tree = ast.parse(code)\n    function_names = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            function_names.add(node.name + '()')\n        elif isinstance(node, ast.Call) and isinstance(node.func, ast.Name):\n            function_names.add(node.func.id + '()')\n    return list(function_names)\n", "entry_point": "extract_function_names", "input": "'def multiply(a, b):\\n    return a * b'", "output": "['multiply()']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115842_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007977", "code": "def generate_username(first_name: str, last_name: str, existing_usernames: list) -> str:\n    username = (first_name[0] + last_name).lower()\n    unique_username = username\n    counter = 1\n    while unique_username in existing_usernames:\n        unique_username = f\"{username}{counter}\"\n        counter += 1\n    return unique_username\n", "entry_point": "generate_username", "input": "'Nina', 'dd', []", "output": "'ndd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82643_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007978", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'TH.'", "output": "'th.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007979", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6598", "output": "{1, 2, 3299, 6598}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007980", "code": "import re\ndef extract_version(input_string):\n    version_pattern = re.compile(r'__version__ = (.+)')\n    match = version_pattern.search(input_string)\n    if match:\n        version_number = match.group(1)\n        return version_number\n    else:\n        return None\n", "entry_point": "extract_version", "input": "'__version__ = 1.2.3'", "output": "'1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56336_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007981", "code": "from urllib.parse import parse_qs, urlparse\ndef parse_query_params(url: str) -> dict:\n    parsed_url = urlparse(url)\n    query_params = parse_qs(parsed_url.query)\n    parsed_query_params = {}\n    for key, value in query_params.items():\n        if len(value) == 1:\n            parsed_query_params[key] = value[0]\n        else:\n            parsed_query_params[key] = value\n    return parsed_query_params\n", "entry_point": "parse_query_params", "input": "'http://example.com/search?q=python&lang=en'", "output": "{'q': 'python', 'lang': 'en'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100438_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007982", "code": "def traffic_light_action(color):\n    if color == 'red':\n        return 'Stop'\n    elif color == 'green':\n        return 'GoGoGo'\n    elif color == 'yellow':\n        return 'Stop or Go fast'\n    else:\n        return 'Light is bad!!!'\n", "entry_point": "traffic_light_action", "input": "'yellow'", "output": "'Stop or Go fast'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129716_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007983", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "500.0, 'woorlr'", "output": "([('Content-type', 'text/plain')], 'woorlr')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007984", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "903", "output": "{1, 129, 3, 7, 903, 43, 301, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007985", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[10, 20, 33], 10", "output": "630", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007986", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "[5, 2, 1, 1, 5, 5]", "output": "[5, 2, 1, 1, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007987", "code": "def unique_instruments(target_urls_umxhq, target_urls_umxl):\n    all_instruments = list(target_urls_umxhq.keys()) + list(target_urls_umxl.keys())\n    unique_instruments = sorted(list(set(all_instruments)))\n    return unique_instruments\n", "entry_point": "unique_instruments", "input": "{}, {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113048_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007988", "code": "CONTROL_PORT_READ_ENABLE_BIT    = 4\nCONTROL_GRAYDOT_KILL_BIT        = 5\nCONTROL_PORT_MODE_BIT           = 6\nCONTROL_PORT_MODE_COPY          = (0b01 << CONTROL_PORT_MODE_BIT)\nCONTROL_PORT_MODE_MASK          = (0b11 << CONTROL_PORT_MODE_BIT)\ndef apply_mask(control_value, control_mask) -> int:\n    masked_value = control_value & control_mask\n    return masked_value\n", "entry_point": "apply_mask", "input": "149, 255", "output": "149", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120473_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007989", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "(8, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007990", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9254", "output": "{1, 2, 9254, 7, 1322, 14, 4627, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9253", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007991", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'El'", "output": "{'el': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007992", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 89, 87, 87], 4", "output": "88.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80206_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007993", "code": "def fibonacci_sum(n):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(n):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "8", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87098_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007994", "code": "import re\ndef extract_server_config(code: str) -> dict:\n    host_pattern = r\"host='(.*?)'\"\n    port_pattern = r\"port=(\\d+)\"\n    ssl_context_pattern = r\"ssl_context='(.*?)'\"\n    host_match = re.search(host_pattern, code)\n    port_match = re.search(port_pattern, code)\n    ssl_context_match = re.search(ssl_context_pattern, code)\n    if host_match and port_match and ssl_context_match:\n        return {\n            'host': host_match.group(1),\n            'port': int(port_match.group(1)),\n            'ssl_context': ssl_context_match.group(1)\n        }\n    else:\n        return {}\n", "entry_point": "extract_server_config", "input": "'some random text'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62207_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007995", "code": "def generate_filter_pairs(filters):\n    filter_pairs = []\n    for i in range(len(filters)):\n        for j in range(i+1, len(filters)):\n            filter_pairs.append((filters[i], filters[j]))\n    return filter_pairs\n", "entry_point": "generate_filter_pairs", "input": "['u', 'u']", "output": "[('u', 'u')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46274_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007996", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[89.0, 90.0]", "output": "89.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3587_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007997", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[4, 3, 3, 2, 2, 4, 3, 2, 1]", "output": "[4, 7, 10, 12, 14, 18, 21, 23, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9431", "output": "{1, 9431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0007999", "code": "def check_entity_type(entities):\n    for entity in entities:\n        if entity.get(\"entityType\", \"\").lower() in (\"task\", \"show\"):\n            return True\n    return False\n", "entry_point": "check_entity_type", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141074_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008000", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'(3 * 6)'", "output": "18.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008001", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return None\n    nums.sort()\n    potential_product1 = nums[-1] * nums[-2] * nums[-3]\n    potential_product2 = nums[0] * nums[1] * nums[-1]\n    return max(potential_product1, potential_product2)\n", "entry_point": "max_product_of_three", "input": "[5, 5, 10]", "output": "250", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97311_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008002", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008003", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'\\nTs'", "output": "'<p></p><p>Ts</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008004", "code": "def word_break(words, s):\n    word_set = set(words)\n    dp = [False] * (len(s) + 1)\n    dp[0] = True\n    for i in range(1, len(s) + 1):\n        for j in range(i):\n            if dp[j] and s[j:i] in word_set:\n                dp[i] = True\n                break\n    return dp[len(s)]\n", "entry_point": "word_break", "input": "['banana', 'orange'], 'applepie'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56861_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008005", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/home/ume/', 'exaext'", "output": "'/home/ume//exaext'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008006", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[1, 4, 2, 15, 5, 4, 5, 5]", "output": "[1, 4, 2, 'FizzBuzz', 'Buzz', 4, 'Buzz', 'Buzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008007", "code": "from typing import List\ndef count_state_occurrences(states: List[int], target_state: int) -> int:\n    count = 0\n    for state in states:\n        if state == target_state:\n            count += 1\n    return count\n", "entry_point": "count_state_occurrences", "input": "[1, 5, 3, 5, 2], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145747_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008008", "code": "def extract_text(input_text: str) -> str:\n    parts = input_text.split('<!DOCTYPE html>', 1)\n    return parts[0] if len(parts) > 1 else input_text\n", "entry_point": "extract_text", "input": "'tsecondhird<!DOCTYPE html>whatever else'", "output": "'tsecondhird'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21287_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008009", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 4, 2, 4, 4, 4, 1]", "output": "[4, 4, 12, 16, 20, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008010", "code": "def longest_common_prefix(strings):\n    if not strings:\n        return \"\"\n    prefix = strings[0]\n    for string in strings[1:]:\n        i = 0\n        while i < len(prefix) and i < len(string) and prefix[i] == string[i]:\n            i += 1\n        prefix = prefix[:i]\n        if not prefix:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "['apple', 'apricot', 'ape']", "output": "'ap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008011", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'milk\\neggs', 'eggs milk epapleb'", "output": "['epapleb']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008012", "code": "def is_query_complete(query: str) -> bool:\n    \"\"\"\n    Returns indication as to if query includes a q=, cb.q=, or cb.fq\n    :param query: the query string to be checked\n    :return: True if this looks like a CBR query\n    \"\"\"\n    # Check for raw query captured from the browser\n    if query.startswith(\"cb.urlver=\"):\n        return True\n    # Check for simpler versions\n    if query.startswith(\"q=\") or query.startswith(\"cb.q=\") or query.startswith(\"cb.fq=\"):\n        return True\n    return False\n", "entry_point": "is_query_complete", "input": "'cb.q=example_query'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98705_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008013", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "5.0, 3.0", "output": "5.830951894845301", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008014", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[1, 2], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008015", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'2000 + 1558'", "output": "3558", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008016", "code": "def group_files_by_name(paths):\n    file_map = {}\n    for path in paths:\n        file_name = path.split('/')[-1].split('.')[0]\n        if file_name in file_map:\n            file_map[file_name].append(path)\n        else:\n            file_map[file_name] = [path]\n    return {key: value for key, value in file_map.items() if len(value) > 1}\n", "entry_point": "group_files_by_name", "input": "['/folder/file1.txt', '/folder/file2.txt', '/folder/file3.md']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30608_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "571", "output": "{1, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008018", "code": "import json\ndef process_post_request(request_body: str) -> str:\n    try:\n        post_data = json.loads(request_body)\n    except json.JSONDecodeError:\n        return 'Invalid Request'\n    if 'status' not in post_data:\n        return 'Invalid Request'\n    status = post_data['status']\n    if not isinstance(status, int):\n        return 'Invalid Status'\n    if status == 200:\n        return 'Status OK'\n    elif status == 404:\n        return 'Status Not Found'\n    else:\n        return 'Unknown Status'\n", "entry_point": "process_post_request", "input": "'{\"status\": 200}'", "output": "'Status OK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39582_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008019", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/adm/n/dashboard/'", "output": "'/adm/n/dashboard'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008020", "code": "from typing import List\nDIGIT_TO_CHAR = {\n    '0': ['0'],\n    '1': ['1'],\n    '2': ['a', 'b', 'c'],\n    '3': ['d', 'e', 'f'],\n    '4': ['g', 'h', 'i'],\n    '5': ['j', 'k', 'l'],\n    '6': ['m', 'n', 'o'],\n    '7': ['p', 'q', 'r', 's'],\n    '8': ['t', 'u', 'v'],\n    '9': ['w', 'x', 'y', 'z']\n}\nDEFAULT_NUMBER_OF_RESULTS = 7\nMAX_LENGTH_OF_NUMBER = 16\nMAX_COST = 150\ndef generate_combinations(input_number: str) -> List[str]:\n    results = []\n    def generate_combinations_recursive(current_combination: str, remaining_digits: str):\n        if not remaining_digits:\n            results.append(current_combination)\n            return\n        for char in DIGIT_TO_CHAR[remaining_digits[0]]:\n            new_combination = current_combination + char\n            new_remaining = remaining_digits[1:]\n            generate_combinations_recursive(new_combination, new_remaining)\n    generate_combinations_recursive('', input_number)\n    return results[:DEFAULT_NUMBER_OF_RESULTS]\n", "entry_point": "generate_combinations", "input": "''", "output": "['']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133151_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008021", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "138", "output": "(True, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008022", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[2, 2, 4, 2, 1, 2, 3, 2, 4]", "output": "[4, 4, 8, 4, 1, 4, 9, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008023", "code": "def average_comments_per_topic(topics):\n    total_comments = 0\n    for topic in topics:\n        total_comments += len(topic['comments'])\n    if len(topics) == 0:\n        return 0.0\n    average = total_comments / len(topics)\n    return round(average, 2)\n", "entry_point": "average_comments_per_topic", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103276_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008024", "code": "def generate_url_mapping(url_patterns):\n    url_mapping = {}\n    for path, view_func in url_patterns:\n        url_mapping[path] = view_func\n    return url_mapping\n", "entry_point": "generate_url_mapping", "input": "[('blog/', 'blog_view')]", "output": "{'blog/': 'blog_view'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65770_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008025", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[2, 3, 5, 4, 5, 4]", "output": "[2, 5, 10, 14, 19, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008026", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[85, 90, 90, 90, 95]", "output": "90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67908_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9389", "output": "{1, 9389, 229, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008028", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "4, 3", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008029", "code": "import os\nir_file = ''  # Assume this is a global variable initialized before calling process_images()\ndef process_images(ir_cam_dir, fall_dir):\n    try:\n        # Find the latest image file in ir_cam_dir\n        ir_files = [f for f in os.listdir(ir_cam_dir) if f.endswith('.jpg')]\n        if not ir_files:\n            return \"No image files found in ir_cam_dir\"\n        latest_ir_file = sorted(ir_files)[-1]\n        ir_path = os.path.join(ir_cam_dir, latest_ir_file)\n        # Upload the latest image file if it's different from ir_file\n        global ir_file\n        if ir_path != ir_file:\n            ftp_upload(ir_path)\n            ir_file = ir_path\n        # Find the latest image file in fall_dir after filtering non-image files\n        fall_files = [f for f in os.listdir(fall_dir) if f.endswith('.jpg')]\n        if not fall_files:\n            return \"No image files found in fall_dir\"\n        latest_fall_file = sorted(fall_files)[-1]\n        fall_path = os.path.join(fall_dir, latest_fall_file)\n        return fall_path\n    except FileNotFoundError:\n        return \"Directory not found\"\n", "entry_point": "process_images", "input": "'non_existing_directory', 'valid_directory'", "output": "'Directory not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72376_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008030", "code": "def calculate_xor_checksum(input_string):\n    checksum = 0\n    for char in input_string:\n        checksum ^= ord(char)\n    return checksum\n", "entry_point": "calculate_xor_checksum", "input": "'\\x01\\x08'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56407_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008031", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'24.4.222.0'", "output": "(24, 4, 222, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008032", "code": "from typing import List\ndef process_commands(commands: str) -> List[int]:\n    engines = [0] * 3  # Initialize engines with zeros\n    for command in commands.split():\n        action, engine_number = command.split(':')\n        engine_number = int(engine_number)\n        if action == 'START':\n            engines[engine_number - 1] = engine_number\n        elif action == 'STOP':\n            engines[engine_number - 1] = 0\n    return engines\n", "entry_point": "process_commands", "input": "'START:3'", "output": "[0, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117335_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008033", "code": "def process_git_hook_data(request_data: dict) -> str:\n    hook_data = request_data.get('hook')\n    if hook_data is not None:\n        return hook_data\n    else:\n        return request_data.get('data', 'No hook data found')\n", "entry_point": "process_git_hook_data", "input": "{}", "output": "'No hook data found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97047_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5343", "output": "{1, 3, 39, 137, 13, 1781, 411, 5343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008035", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4519", "output": "{1, 4519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008036", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'data-scienp', 'poythhon'", "output": "'data-scienp/poythhon'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008037", "code": "def extract_network_settings(configurations):\n    network_settings = {}\n    for config in configurations:\n        key, value = config.split(\"=\")\n        key = key.strip()\n        value = value.strip()\n        network_settings[key] = value\n    return network_settings\n", "entry_point": "extract_network_settings", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28104_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008038", "code": "def check_string(s):\n    digit_found = False\n    english_letter_found = False\n    for ch in s:\n        if ch.isdigit():\n            digit_found = True\n        elif ch.isalpha():\n            english_letter_found = True\n        elif u'\\u4e00' <= ch <= u'\\u9fff':\n            return False\n    return digit_found and english_letter_found\n", "entry_point": "check_string", "input": "'\u4e2d\u6587'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41220_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008039", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454399", "output": "'<t:1630454399>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008040", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "''", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008041", "code": "import math\ndef calculate_softmax(z):\n    z_exp = [math.exp(i) for i in z]\n    sum_z_exp = sum(z_exp)\n    softmax = [round(i / sum_z_exp, 3) for i in z_exp]\n    return softmax\n", "entry_point": "calculate_softmax", "input": "[-1.036, -1.237, -1.036]", "output": "[0.355, 0.29, 0.355]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41248_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008042", "code": "def FindPairsWithSum(Arr, Total):\n    pairs = []\n    seen = {}\n    for x in Arr:\n        diff = Total - x\n        if diff in seen:\n            pairs.append((x, diff))\n        seen[x] = True\n    return pairs\n", "entry_point": "FindPairsWithSum", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121436_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008043", "code": "def obscure_phone(phone_number, format_type):\n    number = ''.join(filter(str.isdigit, phone_number))[-4:]\n    obscured_number = ''\n    for char in phone_number[:-4]:\n        if char.isdigit():\n            obscured_number += '*'\n        else:\n            obscured_number += char\n    if format_type == 'E164':\n        return '+' + '*' * (len(phone_number) - 4) + number\n    elif format_type == 'INTERNATIONAL':\n        return '+*' + ' ***-***-' + '*' * len(number) + number\n    elif format_type == 'NATIONAL':\n        return '(***) ***-' + '*' * len(number) + number\n    elif format_type == 'RFC3966':\n        return 'tel:+*' + '-***-***-' + '*' * len(number) + number\n", "entry_point": "obscure_phone", "input": "'12345678901234', 'RFC3966'", "output": "'tel:+*-***-***-****1234'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94268_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008044", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[10, 6, 9, 10, 8, 11]", "output": "[6, 8, 9, 10, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008045", "code": "def rain_water_trapped(arr):\n    n = len(arr)\n    left_max = [0] * n\n    right_max = [0] * n\n    water_trapped = 0\n    left_max[0] = arr[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], arr[i])\n    right_max[n - 1] = arr[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], arr[i])\n    for i in range(n):\n        water_trapped += max(0, min(left_max[i], right_max[i]) - arr[i])\n    return water_trapped\n", "entry_point": "rain_water_trapped", "input": "[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27488_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008046", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "'q'", "output": "'q'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008047", "code": "def generate_sheet_type_summary(songs):\n    sheet_type_counts = {}\n    for song in songs:\n        sheet_type = song.get(\"sheet_type\")\n        sheet_type_counts[sheet_type] = sheet_type_counts.get(sheet_type, 0) + 1\n    return sheet_type_counts\n", "entry_point": "generate_sheet_type_summary", "input": "[{'sheet_type': None}] * 9", "output": "{None: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111461_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008048", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "-0.2499999999999969, 1.0, 1.0", "output": "-0.4999999999999938", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008049", "code": "def analyze_sentiment(text: str) -> str:\n    thanks_keywords = [\n        'thanks',\n        'thank you'\n    ]\n    exit_keywords = [\n        'leave',\n        'bye',\n        'exit',\n        'quit',\n        'goodbye',\n        'later',\n        'farewell'\n    ]\n    thanks_count = 0\n    exit_count = 0\n    text_lower = text.lower()\n    for word in text_lower.split():\n        if word in thanks_keywords:\n            thanks_count += 1\n        elif word in exit_keywords:\n            exit_count += 1\n    if thanks_count > exit_count:\n        return \"positive\"\n    elif exit_count > thanks_count:\n        return \"negative\"\n    else:\n        return \"neutral\"\n", "entry_point": "analyze_sentiment", "input": "'Thanks for your help'", "output": "'positive'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59557_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008050", "code": "def co2(arr):\n    total_length = 0\n    for binary_str in arr:\n        total_length += len(binary_str)\n    return total_length\n", "entry_point": "co2", "input": "['11111111111111111111', '000000']", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43201_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008051", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'module.oloo'", "output": "'oloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008052", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[100, 102, 103, 103, 104]", "output": "[100, 103, 103, 104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008053", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 17", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008054", "code": "def find_lowest_unique_number(input_string):\n    numbers = sorted(map(int, input_string.split()))\n    for num in numbers:\n        if numbers.count(num) == 1:\n            return numbers.index(num) + 1\n    return 0\n", "entry_point": "find_lowest_unique_number", "input": "'1'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36596_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008055", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6673", "output": "{1, 6673}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008056", "code": "def countPaths(numrArreglo, numSalto):\n    dp = [0] * numrArreglo\n    dp[0] = 1\n    for i in range(1, numrArreglo):\n        for j in range(1, numSalto + 1):\n            if i - j >= 0:\n                dp[i] += dp[i - j]\n    return dp[numrArreglo - 1]\n", "entry_point": "countPaths", "input": "1, 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42463_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008057", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'soandorientation'", "output": "'Value of soandorientation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008058", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7882", "output": "{1, 2, 3941, 1126, 7, 7882, 14, 563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7881", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008059", "code": "def filter_elbs(elbs, health_check_protocol):\n    filtered_elbs = []\n    for elb in elbs:\n        if elb['HealthCheck']['Target'].startswith(health_check_protocol):\n            filtered_elbs.append(elb)\n    return filtered_elbs\n", "entry_point": "filter_elbs", "input": "[], 'http'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59663_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008060", "code": "from typing import List, Dict, Union\ndef total_characters(posts: List[Dict[str, Union[int, str]]]) -> int:\n    total_chars = 0\n    for post in posts:\n        if post.get('content'):\n            total_chars += len(post['content'])\n    return total_chars\n", "entry_point": "total_characters", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11853_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9757", "output": "{1, 11, 9757, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008062", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'key3', 'devltdve'", "output": "'devltdve'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008063", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "'\u043f\u043f\u043f\u0431\u0432\u0433\u0431\u0432'", "output": "[16, 16, 16, 1, 2, 3, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008064", "code": "# Define the error code mappings in the ret_dict dictionary\nret_dict = {\n    404: \"Not Found\",\n    500: \"Internal Server Error\",\n    403: \"Forbidden\",\n    400: \"Bad Request\"\n}\ndef response_string(code):\n    # Check if the error code exists in the ret_dict dictionary\n    return ret_dict.get(code, \"\uc815\ubcf4 \uc5c6\uc74c\")\n", "entry_point": "response_string", "input": "403", "output": "'Forbidden'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57903_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8206", "output": "{1, 2, 4103, 746, 11, 8206, 373, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008066", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[50, 69, 70, 74, 90]", "output": "71.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_354_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008067", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'Python,'", "output": "['Python', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008068", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documents/file.tlt'", "output": "('local', 'documents/file.tlt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8899", "output": "{11, 1, 8899, 809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "967", "output": "{1, 967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008071", "code": "def balancedSums(arr):\n    total_sum = sum(arr)\n    left_sum = 0\n    for i in range(len(arr)):\n        total_sum -= arr[i]\n        if left_sum == total_sum:\n            return i\n        left_sum += arr[i]\n    return -1\n", "entry_point": "balancedSums", "input": "[0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101017_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008072", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "12", "output": "'SDL_LOG_CATEGORY_RESERVED4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3426", "output": "{1, 3426, 3, 2, 6, 1713, 1142, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008074", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "11, 11", "output": "(21, 21, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008075", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['King', 'Ace', 'Jack']", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008076", "code": "def find_example_idx(n, cum_sums, idx=0):\n    N = len(cum_sums)\n    stack = [[0, N-1]]\n    while stack:\n        start, end = stack.pop()\n        search_i = (start + end) // 2\n        if start < end:\n            if n < cum_sums[search_i]:\n                stack.append([start, search_i])\n            else:\n                stack.append([search_i + 1, end])\n        else:\n            if n < cum_sums[start]:\n                return idx + start\n            else:\n                return idx + start + 1\n", "entry_point": "find_example_idx", "input": "5, [0, 1, 2, 3, 4, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89652_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7421", "output": "{1, 181, 7421, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008078", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 39, 28, 5, 10, 15]", "output": "[42, 39, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008079", "code": "import re\ndef process_text(input_text: str) -> str:\n    # Remove all characters that are not Cyrillic or alphanumeric\n    processed_text = re.sub(r\"[^\u0430-\u044f\u0410-\u042f0-9 ]+\", \"\", input_text)\n    # Replace double spaces with a single space\n    processed_text = re.sub('(  )', ' ', processed_text)\n    # Replace \"\\r\\n\" with a space\n    processed_text = processed_text.replace(\"\\r\\n\", \" \")\n    return processed_text\n", "entry_point": "process_text", "input": "'\u0441\u0442\u0440\u043e\u043a\u0430'", "output": "'\u0441\u0442\u0440\u043e\u043a\u0430'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100805_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008080", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n in [0, 1]:\n        return n\n    else:\n        result = fibonacci_memo(n-1, memo) + fibonacci_memo(n-2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83419_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008081", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "7", "output": "5555553", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008082", "code": "import sys\ndef calculate_memory(obj, visited=None):\n    if visited is None:\n        visited = set()\n    if id(obj) in visited:\n        return 0\n    visited.add(id(obj))\n    size = sys.getsizeof(obj)\n    if isinstance(obj, dict):\n        size += sum(calculate_memory(v, visited) for v in obj.values())\n    elif isinstance(obj, (list, tuple, set)):\n        size += sum(calculate_memory(v, visited) for v in obj)\n    return size\n", "entry_point": "calculate_memory", "input": "10", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104691_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008083", "code": "def change_directory(current_dir: str, new_dir: str) -> str:\n    current_dirs = current_dir.split('/')\n    new_dirs = new_dir.split('/')\n    for directory in new_dirs:\n        if directory == '..':\n            if current_dirs:\n                current_dirs.pop()\n        else:\n            current_dirs.append(directory)\n    return '/'.join(current_dirs)\n", "entry_point": "change_directory", "input": "'/home/use', 'photto'", "output": "'/home/use/photto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140324_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008084", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "'hellohheehl'", "output": "'hellohheehl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008085", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.0.1'", "output": "(0, 0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008086", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-636.0], 1", "output": "-636.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2401_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008087", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'WloWorldHld'", "output": "'XmpXpsmeIme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008088", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alpahalpha='", "output": "{'alpahalpha': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008089", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '1.8.9', '1.9.8', '1.9.9']", "output": "'1.9.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008090", "code": "# Constants defining attributes for different component types\nATTRIBUTES = {\n    \"is_override_code\": [],\n    \"area_limit\": [],\n    \"code_format\": [],\n    \"code_length\": [],\n    \"automation_id\": [],\n    \"type\": [],\n    \"area\": [],\n    \"master\": [],\n    \"triggers\": [\"event\", \"require_code\"],\n    \"actions\": [],\n    \"event\": [],\n    \"require_code\": [],\n    \"notification\": [],\n    \"version\": [],\n    \"state_payload\": []\n}\ndef get_component_attributes(component_type):\n    return ATTRIBUTES.get(component_type, [])\n", "entry_point": "get_component_attributes", "input": "'triggers'", "output": "['event', 'require_code']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72451_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008091", "code": "from typing import List\ndef count_pairs_sum_target(nums: List[int], target: int) -> int:\n    seen = {}\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            count += 1\n        seen[num] = True\n    return count\n", "entry_point": "count_pairs_sum_target", "input": "[1, 4, 2, 3, 1, 4], 5", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72473_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008092", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 10, 12", "output": "(2746, 2675)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008093", "code": "def simulate_race(cars):\n    finishing_times = [(index, position / speed) for index, (position, speed) in enumerate(cars)]\n    finishing_times.sort(key=lambda x: x[1])\n    return [car[0] for car in finishing_times]\n", "entry_point": "simulate_race", "input": "[(2, 1), (4, 2), (1, 1), (8, 4)]", "output": "[2, 0, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2163", "output": "{1, 3, 7, 103, 721, 2163, 309, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008095", "code": "import ast\ndef extract_tasks_info(script):\n    tasks_info = []\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            for decorator in node.decorator_list:\n                if isinstance(decorator, ast.Call) and decorator.func.id == 'nstask':\n                    task_name = node.name\n                    task_description = ast.get_docstring(node) or \"No description provided.\"\n                    tasks_info.append((task_name, task_description))\n    return tasks_info\n", "entry_point": "extract_tasks_info", "input": "'def some_function():\\n    pass'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119690_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008096", "code": "import os\ndef calculate_memory_consumption(weights_file, input_shape, max_seconds):\n    weights_file_size = os.path.getsize(weights_file) if os.path.exists(weights_file) else 0\n    total_memory_consumption = weights_file_size\n    return total_memory_consumption\n", "entry_point": "calculate_memory_consumption", "input": "'non_existing_file.txt', [], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35321_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008097", "code": "from typing import List\ndef find_min_abs_difference_pairs(arr: List[int]) -> List[List[int]]:\n    arr.sort()\n    min_diff = min(arr[i] - arr[i - 1] for i in range(1, len(arr)))\n    min_pairs = [[arr[i - 1], arr[i]] for i in range(1, len(arr)) if arr[i] - arr[i - 1] == min_diff]\n    return min_pairs\n", "entry_point": "find_min_abs_difference_pairs", "input": "[4, 4, 5, 5, 5]", "output": "[[4, 4], [5, 5], [5, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128793_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3043", "output": "{1, 3043, 179, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008099", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'apple; banana; cherry'", "output": "['apple', 'banana', 'cherry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008100", "code": "def process_encoded_function_data(encoded_function_data, value):\n    # Decode the function signature and arguments from the encoded function data\n    function_signature = encoded_function_data[:10]  # Assuming function signature length is 10 characters\n    arguments = encoded_function_data[10:]  # Assuming arguments start after the function signature\n    # Simulate applying the decoded function to the provided value\n    if function_signature == \"setDataTypes\":\n        # Assuming setDataTypes function takes one argument\n        result = int(arguments) + value\n        return result\n    else:\n        return \"Function not supported\"\n", "entry_point": "process_encoded_function_data", "input": "'randomFuncab', 5", "output": "'Function not supported'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4325_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008101", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "-1.346", "output": "-0.0006730000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008102", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'Woyou?rdhow,'", "output": "('Woyou?rdhow,', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8333", "output": "{1, 13, 641, 8333}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008104", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "' th is    en   ten  // ignore this'", "output": "'thisenten'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008105", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "137", "output": "(True, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008106", "code": "def find_min_max(numbers):\n    if not numbers:\n        return None\n    min_value = float('inf')\n    max_value = float('-inf')\n    for num in numbers:\n        if num < min_value:\n            min_value = num\n        if num > max_value:\n            max_value = num\n    return min_value, max_value\n", "entry_point": "find_min_max", "input": "[1, 5, 9]", "output": "(1, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24169_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008107", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[10, 82]", "output": "[10, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008108", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[4, 4, 5, 5, 5, 5]", "output": "[16, 20, 20, 20, 20, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008109", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1237", "output": "{1, 1237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008110", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'    test    '", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008111", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 5, 5, 17]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008112", "code": "def count_kwargs(_kwargs):\n    kwargs_count = []\n    for kwargs in _kwargs:\n        count = len(kwargs.keys()) + len(kwargs.values())\n        kwargs_count.append(count)\n    return kwargs_count\n", "entry_point": "count_kwargs", "input": "[{}, {}, {}, {}, {}, {}]", "output": "[0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15928_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3107", "output": "{1, 3107, 13, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008114", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0, 2,  22,   24, 60, 650'", "output": "[0, 2, 22, 24, 60, 650]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008115", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'eeexyz'", "output": "[('e', 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008116", "code": "from pathlib import Path\n# In case of apocalypse - use any of `api_mirrors`\nAPI_BASE = 'https://2ch.hk'\nhostname_mirrors = (\n    '2ch.hk',\n    '2ch.pm',\n    '2ch.re',\n    '2ch.tf',\n    '2ch.wf',\n    '2ch.yt',\n    '2-ch.so',\n)\napi_mirrors = tuple(f'https://{hostname}' for hostname in hostname_mirrors)\ndef find_mirror_url(url):\n    for mirror_url in api_mirrors:\n        if url == mirror_url:\n            return mirror_url\n    return \"Mirror not found\"\n", "entry_point": "find_mirror_url", "input": "'https://example.com'", "output": "'Mirror not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105611_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008117", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "4", "output": "'Unterminated comment'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008118", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'300 + 23'", "output": "323", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008119", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'oo'", "output": "['oo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008120", "code": "def extract_icon_paths(code_snippet):\n    icon_paths = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if '=' in line:\n            parts = line.split('=')\n            icon_name = parts[0].strip()\n            icon_path = parts[1].strip()\n            icon_paths[icon_name] = icon_path\n    return icon_paths\n", "entry_point": "extract_icon_paths", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60198_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008121", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[82, 43, 3, 9, 82, 82, 26]", "output": "[3, 9, 26, 43, 82, 82, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008122", "code": "def convert_to_binary_labels(labels, fg_labels):\n    binary_labels = []\n    fg_counter = 0\n    for label in labels:\n        if label in fg_labels:\n            binary_labels.append(fg_counter)\n            fg_counter += 1\n        else:\n            binary_labels.append(-1)  # Assign -1 for non-foreground labels\n    # Adjust binary labels to start from 0 for foreground labels\n    min_fg_label = min(binary_label for binary_label in binary_labels if binary_label >= 0)\n    binary_labels = [binary_label - min_fg_label if binary_label >= 0 else -1 for binary_label in binary_labels]\n    return binary_labels\n", "entry_point": "convert_to_binary_labels", "input": "['a', 'b', 'c', 'd', 'e'], ['b']", "output": "[-1, 0, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96185_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008123", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'CHECKING'", "output": "'VERIFYING'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008124", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6514", "output": "{3257, 1, 6514, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008125", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "62", "output": "'01:02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008126", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10, 12, 15, 5]", "output": "47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2720_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008127", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "191", "output": "'?191'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008128", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[2, 2, 3, 2, 3, 3, 7, 2]", "output": "[2, 3, 5, 5, 7, 8, 13, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008129", "code": "def evaluate_order(simple_order, impact):\n    bigger_than_threshold = simple_order == \">\"\n    has_positive_impact = impact > 0\n    if bigger_than_threshold and has_positive_impact:\n        return \"\ub192\uc77c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4\"\n    if not bigger_than_threshold and not has_positive_impact:\n        return \"\ub192\uc774\uc138\uc694\"\n    if bigger_than_threshold and not has_positive_impact:\n        return \"\ub0ae\ucd94\uc138\uc694\"\n    if not bigger_than_threshold and has_positive_impact:\n        return \"\ub0ae\ucd9c \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4\"\n", "entry_point": "evaluate_order", "input": "'>', 0", "output": "'\ub0ae\ucd94\uc138\uc694'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28604_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008130", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 5, 12, 2, 11, 11]", "output": "[2, 6, 14, 5, 15, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008131", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'programming/', 'python/'", "output": "'programming/python'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008132", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[3, 5, 7, 9], 0, 3", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008133", "code": "def get_segments(flag, start, end):\n    segments = []\n    # Sample data for demonstration purposes\n    data = {\n        'H1_DATA': [\n            (1126073529, 1126114861),\n            (1126121462, 1126123267),\n            (1126123553, 1126126832),\n            (1126139205, 1126139266),\n            (1126149058, 1126151217),\n        ],\n        'L1_DATA': [\n            (1126259446, 1126259478),\n        ]\n    }\n    if flag in data:\n        for segment in data[flag]:\n            if start <= segment[0] <= end or start <= segment[1] <= end:\n                segments.append(segment)\n    return segments\n", "entry_point": "get_segments", "input": "'H1_DATA', 1126151218, 1126250000", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99841_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008134", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'text'", "output": "['text']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008135", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'31.110.0'", "output": "(31, 110, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008136", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[4, 4, 4, 4], 3, 1", "output": "[4, 3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008137", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.Doe@ExampleNCom'", "output": "'john.doe@examplencom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008138", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008139", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'john', 'smit'", "output": "'jsmit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008140", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 2, 3]", "output": "[3, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25747_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008141", "code": "def filter_modules(module_names):\n    available_modules = [\"violin\", \"scatter\", \"lm\", \"hist\", \"factorial_heatmap\", \"model_recovery\"]\n    filtered_modules = [module for module in module_names if module in available_modules]\n    return filtered_modules\n", "entry_point": "filter_modules", "input": "['hist', 'lm', 'scatter', 'some_other_module']", "output": "['hist', 'lm', 'scatter']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78855_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008142", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'I'", "output": "{'I': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008143", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'e=Alice'", "output": "{'e': 'Alice'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008144", "code": "def repeat_strings(strings, num_repeats):\n    if not strings or num_repeats <= 0:\n        return []\n    repeated_list = [s * num_repeats for s in strings]\n    for i, s in enumerate(repeated_list):\n        assert s == strings[i % len(strings)] * num_repeats\n    return repeated_list\n", "entry_point": "repeat_strings", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16635_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008145", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 3, 2, 2, 1, 1, 1, 1]", "output": "[7, 7, 5, 4, 3, 2, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92643_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008146", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008147", "code": "from typing import List\nMAX_FORCE = 10.0\nTARGET_VELOCITY = 5.0\nMULTIPLY = 2.0\ndef calculate_total_force(robot_velocities: List[float]) -> float:\n    total_force = sum([MAX_FORCE * (TARGET_VELOCITY - vel) * MULTIPLY for vel in robot_velocities])\n    return total_force\n", "entry_point": "calculate_total_force", "input": "[0.8000000000000005]", "output": "83.99999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22767_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008148", "code": "def extract_docstring_info(docstring):\n    info = {}\n    lines = docstring.strip().split('\\n')\n    for line in lines:\n        if line.startswith(':param'):\n            params = line.split(':param ')[1].split(',')\n            for param in params:\n                info[param.strip()] = None\n        elif line.startswith(':return'):\n            return_info = line.split(':return ')\n            if len(return_info) > 1:\n                info['return'] = return_info[1]\n    return info\n", "entry_point": "extract_docstring_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46124_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3123", "output": "{1, 3, 9, 1041, 3123, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008150", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "30.0", "output": "303.15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008151", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3656", "output": "'1 hour 56 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008152", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'Danag'", "output": "'Danag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008153", "code": "def affordable_options(gold, silver, copper):\n    vic = {\"Province\": 8, \"Duchy\": 5, \"Estate\": 2}\n    tres = {\"Gold\": 6, \"Silver\": 3, \"Copper\": 0}\n    money = gold * 3 + silver * 2 + copper\n    options = []\n    for coin, cost in tres.items():\n        if money >= cost:\n            options.append(coin)\n            break\n    for prov, cost in vic.items():\n        if money >= cost:\n            options.insert(0, prov)\n            break\n    return options\n", "entry_point": "affordable_options", "input": "2, 1, 0", "output": "['Province', 'Gold']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49027_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008154", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "-3, 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008155", "code": "from fnmatch import translate\ndef prepare_config(config: dict) -> dict:\n    # If only a single path is passed, convert it into a list\n    if isinstance(config.get('path'), str):\n        config['path'] = [config['path']]\n    # Set default value for 'recursive' key if not provided\n    config.setdefault('recursive', False)\n    # Translate the 'mask' key into a regexp if specified\n    if config.get('mask'):\n        config['regexp'] = translate(config['mask'])\n    # Set a default regexp pattern if none provided\n    if not config.get('regexp'):\n        config['regexp'] = '.'\n    return config\n", "entry_point": "prepare_config", "input": "{'recursive': False}", "output": "{'recursive': False, 'regexp': '.'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100355_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008156", "code": "import itertools\ndef generate_combinations(nums, k):\n    # Generate all combinations of size k\n    combinations = itertools.combinations(nums, k)\n    # Convert tuples to lists and store in result list\n    result = [list(comb) for comb in combinations]\n    return result\n", "entry_point": "generate_combinations", "input": "[], 0", "output": "[[]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31218_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008157", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9188", "output": "{1, 2, 9188, 4, 4594, 2297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9187", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008158", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'grrape'", "output": "['grrape']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5414", "output": "{1, 2, 2707, 5414}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5413", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008160", "code": "def parse_list_of_lists(all_groups_str):\n    all_groups_str = all_groups_str.strip()[1:-1]  # Remove leading and trailing square brackets\n    groups = []\n    for line in all_groups_str.split(',\\n'):\n        group = [int(val) for val in line.strip()[1:-1].split(', ')]\n        groups.append(group)\n    return groups\n", "entry_point": "parse_list_of_lists", "input": "'[[0]]'", "output": "[[0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39140_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008161", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kjakjhkatt2'", "output": "'http://kjakjhkatt2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7816", "output": "{1, 2, 1954, 3908, 4, 7816, 8, 977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7815", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008163", "code": "import sys\ndef get_compatible_modules(python_version: int) -> list:\n    compatible_modules = []\n    if python_version == 2:\n        compatible_modules = ['cStringIO', 'thrift.transport.TTransport']\n    elif python_version == 3:\n        compatible_modules = ['io', 'thrift.transport.TTransport']\n    return compatible_modules\n", "entry_point": "get_compatible_modules", "input": "3", "output": "['io', 'thrift.transport.TTransport']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97069_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008164", "code": "import re\ndef extract_config_settings(code_snippet):\n    config_settings = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        match = re.match(r'^(\\w+)\\s*=\\s*(.*)', line)\n        if match:\n            var_name = match.group(1)\n            var_value = match.group(2).strip()\n            if var_value.isdigit():\n                var_value = int(var_value)\n            elif var_value.lower() == 'true' or var_value.lower() == 'false':\n                var_value = var_value.lower() == 'true'\n            config_settings[var_name] = var_value\n    return config_settings\n", "entry_point": "extract_config_settings", "input": "'# This is a comment\\nSome random text'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36317_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008165", "code": "def fill_characters(n, positions, s):\n    ans = [''] * n\n    for i, pos in enumerate(positions):\n        ans[pos - 1] += s[i % len(s)]\n    return ''.join(ans)\n", "entry_point": "fill_characters", "input": "4, [1, 2, 1, 3], 'abc'", "output": "'acba'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84635_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008166", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filter1'", "output": "['filter1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008167", "code": "def generate_platform_tool_xml(platform, tool_elements):\n    xml_output = \"\"\n    for tool_element in tool_elements:\n        xml_output += f\"\\t{tool_element}\\n\"\n    platform_tools_xml = f\"<PlatformTools>\\n{xml_output}</PlatformTools>\"\n    return platform_tools_xml\n", "entry_point": "generate_platform_tool_xml", "input": "'any_platform', []", "output": "'<PlatformTools>\\n</PlatformTools>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5183", "output": "{73, 1, 71, 5183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008169", "code": "def minesweeper(matrix):\n    row = len(matrix)\n    col = len(matrix[0])\n    def neighbouring_squares(i, j):\n        return sum(\n            matrix[x][y]\n            for x in range(i - 1, i + 2)\n            if 0 <= x < row\n            for y in range(j - 1, j + 2)\n            if 0 <= y < col\n            if i != x or j != y\n        )\n    return [[neighbouring_squares(i, j) for j in range(col)] for i in range(row)]\n", "entry_point": "minesweeper", "input": "[[0, 0], [0, 0], [0, 0], [0, 0]]", "output": "[[0, 0], [0, 0], [0, 0], [0, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60915_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008170", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'37'", "output": "(37,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008171", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'fnlno'", "output": "['fnlno']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008172", "code": "from typing import List\ndef total_visible_skyline(buildings: List[int]) -> int:\n    total_skyline = 0\n    max_height = 0\n    for height in buildings:\n        if height > max_height:\n            total_skyline += height - max_height\n            max_height = height\n    return total_skyline\n", "entry_point": "total_visible_skyline", "input": "[1, 3, 5, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115607_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008173", "code": "def maximum_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product_of_three", "input": "[5, 5, 5, 1]", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93080_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008174", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[3, 1, 2, -1, 2, 1]", "output": "[1, 2, -1, 2, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008175", "code": "def count_intersecting_unclassified(centrifuge_reads: set, kraken2_reads: set) -> int:\n    intersecting_reads = set()\n    for read_id in centrifuge_reads:\n        if read_id in kraken2_reads:\n            intersecting_reads.add(read_id)\n    return len(intersecting_reads)\n", "entry_point": "count_intersecting_unclassified", "input": "{'read_1', 'read_2'}, {'read_1', 'read_3', 'read_4'}", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102749_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3782", "output": "{1, 2, 1891, 3782, 122, 61, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008177", "code": "def extract_fields_from_migrations(operations):\n    fields_dict = {}\n    for model_name, field_type in operations:\n        if model_name in fields_dict:\n            fields_dict[model_name].append(field_type)\n        else:\n            fields_dict[model_name] = [field_type]\n    return fields_dict\n", "entry_point": "extract_fields_from_migrations", "input": "[('category', 'CharField')]", "output": "{'category': ['CharField']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86036_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008178", "code": "# Define the positions and their corresponding bitmask values\npositions = {\n    'catcher': 1,\n    'first_base': 2,\n    'second_base': 4,\n    'third_base': 8,\n    'short_stop': 16,\n    'outfield': 32,\n    'left_field': 64,\n    'center_field': 128,\n    'right_field': 256,\n    'designated_hitter': 512,\n    'pitcher': 1024,\n    'starting_pitcher': 2048,\n    'relief_pitcher': 4096\n}\ndef get_eligible_positions(player_mask):\n    eligible_positions = []\n    for position, mask in positions.items():\n        if player_mask & mask:\n            eligible_positions.append(position)\n    return eligible_positions\n", "entry_point": "get_eligible_positions", "input": "34", "output": "['first_base', 'outfield']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51303_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008179", "code": "from xml.etree import ElementTree\ndef get_column_names_with_geo(xml_file_path):\n    try:\n        tree = ElementTree.parse(xml_file_path)\n        root = tree.getroot()\n        ns = {\"kml\": \"http://www.opengis.net/kml/2.2\"}\n        scheme = root.find(\".//kml:Schema\", ns)\n        col_iter = scheme.findall('kml:SimpleField', ns)\n        column_names = [element.attrib['name'] for element in col_iter]\n        column_names.extend([\"Longitude\", \"Latitude\"])\n        return column_names\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return []\n", "entry_point": "get_column_names_with_geo", "input": "'non_existent_file.xml'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138090_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008180", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[20, 6, 6, 30, 21]", "output": "[400, 36, 36, 900, 441]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008181", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[3, 3, 1, 2]", "output": "[3, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008182", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "246", "output": "{1, 2, 3, 6, 41, 82, 246, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt245", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008183", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2069", "output": "{1, 2069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2563", "output": "{11, 1, 2563, 233}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008185", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008186", "code": "def kendall_tau_distance(permutation1, permutation2):\n    distance = 0\n    n = len(permutation1)\n    for i in range(n):\n        for j in range(i+1, n):\n            if (permutation1[i] < permutation1[j] and permutation2[i] > permutation2[j]) or \\\n               (permutation1[i] > permutation1[j] and permutation2[i] < permutation2[j]):\n                distance += 1\n    return distance\n", "entry_point": "kendall_tau_distance", "input": "[1, 2], [2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101117_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008187", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'city: N'", "output": "{'city': 'N'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7766", "output": "{1, 2, 706, 353, 11, 3883, 7766, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008189", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 4], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13435_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008190", "code": "def extract_fields_from_migrations(migrations):\n    model_fields = {}\n    for operation in migrations:\n        model_name = operation['model_name']\n        field_name = operation['field_name']\n        if model_name in model_fields:\n            model_fields[model_name].append(field_name)\n        else:\n            model_fields[model_name] = [field_name]\n    return model_fields\n", "entry_point": "extract_fields_from_migrations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81775_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8033", "output": "{1, 29, 277, 8033}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008192", "code": "def colorize_log_message(message, log_level):\n    RESET_SEQ = \"\\033[0m\"\n    COLOR_SEQ = \"\\033[1;%dm\"\n    COL = {\n        'DEBUG': 34, 'INFO': 35,\n        'WARNING': 33, 'CRITICAL': 33, 'ERROR': 31\n    }\n    color_code = COL.get(log_level, 37)  # Default to white if log_level not found\n    colored_message = COLOR_SEQ % color_code + message + RESET_SEQ\n    return colored_message\n", "entry_point": "colorize_log_message", "input": "'a', 'INVALID_LOG_LEVEL'", "output": "'\\x1b[1;37ma\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1938_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008193", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[4, [5]]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008194", "code": "def find_divisible_sum(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "find_divisible_sum", "input": "[150]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147524_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008195", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[5, 6, 6, 7, 7, 7, 14, 14, 14]", "output": "[5, 6, 6, 7, 7, 7, 14, 14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008196", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "15, 4", "output": "1365", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008197", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'CC(=C)CO'", "output": "'CC(=C)CO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008198", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[4]", "output": "{4: 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008199", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'the'", "output": "'the'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008200", "code": "def find_subarray_sum_indices(nums):\n    cumulative_sums = {0: -1}\n    cumulative_sum = 0\n    result = []\n    for index, num in enumerate(nums):\n        cumulative_sum += num\n        if cumulative_sum in cumulative_sums:\n            result = [cumulative_sums[cumulative_sum] + 1, index]\n            return result\n        cumulative_sums[cumulative_sum] = index\n    return result\n", "entry_point": "find_subarray_sum_indices", "input": "[5, 0]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56814_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008201", "code": "def flatten_dicts(input_list):\n    flattened_dict = {}\n    def flatten_dict(input_dict, prefix=''):\n        for key, value in input_dict.items():\n            if isinstance(value, dict):\n                flatten_dict(value, f\"{prefix}.{key}\" if prefix else key)\n            else:\n                flattened_dict.setdefault(f\"{prefix}.{key}\" if prefix else key, []).append(value)\n    for dictionary in input_list:\n        flatten_dict(dictionary)\n    return flattened_dict\n", "entry_point": "flatten_dicts", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126596_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008202", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[1, 2, 3]", "output": "[1, 8, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008203", "code": "def calculate_last_element(t, n):\n    for i in range(2, n):\n        t.append(t[i-2] + t[i-1]*t[i-1])\n    return t[-1]\n", "entry_point": "calculate_last_element", "input": "[10, 3], 3", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120049_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008204", "code": "def merge_sorted_lists(list1, list2):\n    merged_list = []\n    i, j = 0, 0\n    while i < len(list1) and j < len(list2):\n        if list1[i] < list2[j]:\n            merged_list.append(list1[i])\n            i += 1\n        else:\n            merged_list.append(list2[j])\n            j += 1\n    merged_list.extend(list1[i:])\n    merged_list.extend(list2[j:])\n    return merged_list\n", "entry_point": "merge_sorted_lists", "input": "[1, 2, 2, 3, 3], [1, 2, 4, 4, 5, 5]", "output": "[1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104249_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008205", "code": "def calculate_product(nums):\n    product = 1\n    for num in nums:\n        if num != 0:\n            product *= num\n    return product\n", "entry_point": "calculate_product", "input": "[1, 2, 3, 4, 5]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25506_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008206", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "8", "output": "[0, 1, 2, 3, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008207", "code": "from datetime import datetime, timedelta\ndef filter_dates(dates, env):\n    now = datetime.now()\n    a_month = now - timedelta(days=60)\n    filtered_dates = []\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, '%Y-%m-%d')\n        if a_month <= date_obj <= now:\n            filtered_dates.append(date_obj.strftime('%d-%m-%Y'))\n    return filtered_dates\n", "entry_point": "filter_dates", "input": "['2023-07-01', '2023-08-14', '2023-12-01'], None", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113954_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008208", "code": "import re\ndef extract_version_info(version_str):\n    version_info = {}\n    pattern = r\"v(?P<version>[0-9]+(?:\\.[0-9]+)*)(?P<dev>\\.dev[0-9]+\\+g[0-9a-f]+)?(?P<date>\\.d[0-9]+)?\"\n    match = re.match(pattern, version_str)\n    if match:\n        version_info['version'] = match.group('version')\n        if match.group('dev'):\n            version_info['dev'] = int(match.group('dev').split('.dev')[1].split('+')[0])\n            version_info['git_commit'] = match.group('dev').split('+g')[1]\n        if match.group('date'):\n            version_info['date'] = int(match.group('date').split('.d')[1])\n    return version_info\n", "entry_point": "extract_version_info", "input": "'1.2.3'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47059_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008209", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[4, 5, 6], 2", "output": "[6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9421", "output": "{1, 9421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008211", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'ne'", "output": "'ne.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008212", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'the dogudly'", "output": "{'the': 1, 'dogudly': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008213", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'018541118'", "output": "'01854111882485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008214", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'service.address.config'", "output": "'address'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008215", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "0, 13", "output": "13.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008216", "code": "def count_unique_languages(code_snippets):\n    unique_languages = set()\n    for snippet in code_snippets:\n        words = snippet.split()\n        for word in words:\n            word = word.strip('();,')\n            if word.lower() in [\"python\", \"sql\", \"javascript\", \"java\"]:\n                unique_languages.add(word.lower())\n    return len(unique_languages)\n", "entry_point": "count_unique_languages", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136266_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008217", "code": "def pick_food(name):\n    if name == \"chima\":\n        return \"chicken\"\n    else:\n        return \"dry food\"\n", "entry_point": "pick_food", "input": "'dog'", "output": "'dry food'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3295_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008218", "code": "def extract_domain_usernames(emails):\n    domain_usernames = {}\n    for email in emails:\n        username, domain = email.split('@')\n        if domain in domain_usernames:\n            domain_usernames[domain].append(username)\n        else:\n            domain_usernames[domain] = [username]\n    return domain_usernames\n", "entry_point": "extract_domain_usernames", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79198_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008219", "code": "from typing import List\ndef check_packages(long_description: str, required: List[str]) -> List[str]:\n    # Tokenize the long description into individual words\n    words = long_description.split()\n    # Extract package names by identifying words that end with a comma or period\n    packages_mentioned = [word.strip(\",.\") for word in words if word.endswith(\",\") or word.endswith(\".\")]\n    # Find packages mentioned but not in the required packages list\n    missing_packages = [pkg for pkg in packages_mentioned if pkg not in required]\n    return missing_packages\n", "entry_point": "check_packages", "input": "'We need to install numpy, pandas.', ['numpy', 'pandas']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42099_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7123", "output": "{1, 7123, 419, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008221", "code": "import os\ndef quote_args(args):\n    if os.name == 'nt':\n        # Custom quoting mechanism for Windows\n        return ' '.join(['\"' + arg.replace('\"', '\\\\\"') + '\"' for arg in args])\n    else:\n        # Custom quoting mechanism for other operating systems\n        return ' '.join([\"'\" + arg.replace(\"'\", \"'\\\\''\") + \"'\" for arg in args])\n", "entry_point": "quote_args", "input": "['arg1', 'arg2 with space', 'arg3']", "output": "\"'arg1' 'arg2 with space' 'arg3'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148085_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008222", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tasks=addttskt'", "output": "{'field': 'tasks', 'value': 'addttskt'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008223", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) < 2:\n        return 0\n    numbers.remove(max(numbers))\n    numbers.remove(min(numbers))\n    if len(numbers) == 0:\n        return 0\n    average = sum(numbers) / len(numbers)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1.0, 2.0, 4.0, 6.0]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122319_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008224", "code": "import re\ndef extract_id_from_url(url):\n    pattern = r'https?://dagelijksekost\\.een\\.be/gerechten/(?P<id>[^/?#&]+)'\n    match = re.match(pattern, url)\n    if match:\n        return match.group('id')\n    else:\n        return 'Invalid URL'\n", "entry_point": "extract_id_from_url", "input": "'dagelijksekost.een.be/gerechten/123'", "output": "'Invalid URL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75650_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008225", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6", "output": "{1, 2, 3, 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008226", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3244", "output": "{1, 2, 4, 811, 3244, 1622}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3243", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008227", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "'LLD'", "output": "(-2, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008228", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1642", "output": "{1, 1642, 2, 821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008229", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'hhelo'", "output": "{'hhelo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008230", "code": "def count_increases(depths):\n    increase_count = 0\n    for i in range(len(depths) - 3):\n        sum1 = sum(depths[i : i + 3])\n        sum2 = sum(depths[i + 1 : i + 4])\n        if sum1 < sum2:\n            increase_count += 1\n    return increase_count\n", "entry_point": "count_increases", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99474_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008231", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "2147483647, 1", "output": "2147483648", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008232", "code": "import re\n# Predefined regular expressions\nrx_card = re.compile(r'Card (?P<card_number>\\d+): (?P<model>.+)')\nrx_card2 = re.compile(r'Card (?P<card_number>\\d+): (?P<model>.+)')\ndef extract_card_info(output):\n    r = []\n    for line in output.splitlines():\n        match = rx_card.search(line)\n        if match:\n            r.append(match.groupdict())\n        else:\n            match = rx_card2.search(line)\n            if match:\n                r.append(match.groupdict())\n    return r\n", "entry_point": "extract_card_info", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96414_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008233", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 8, 8, 8]", "output": "[7, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt47", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008234", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[5, 5, 1, 1, 1, 1, 2, 6]", "output": "{5: 2, 1: 4, 2: 1, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008235", "code": "def evaluate_conditions(obj):\n    if obj[1] <= 2:\n        if obj[9] > 0.0:\n            if obj[8] <= 2.0:\n                return True\n            elif obj[8] > 2.0:\n                return False\n            else:\n                return False\n        elif obj[9] <= 0.0:\n            return False\n        else:\n            return False\n    elif obj[1] > 2:\n        return False\n    else:\n        return False\n", "entry_point": "evaluate_conditions", "input": "[0, 2, 0, 0, 0, 0, 0, 0, 2, 1]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6729_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008236", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[22]", "output": "'0x16'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008237", "code": "from typing import List\ndef process_image(pixels: List[int]) -> List[int]:\n    result = []\n    for pixel in pixels:\n        result.append(pixel * 2)\n    return result\n", "entry_point": "process_image", "input": "[74, 51, 50, 199, 51, 99, 50, 51]", "output": "[148, 102, 100, 398, 102, 198, 100, 102]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142011_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008238", "code": "def filter_ongoing_sprints(sprints):\n    ongoing_sprints = []\n    for sprint in sprints:\n        if sprint['status'] == 'ongoing':\n            ongoing_sprints.append(sprint)\n    return ongoing_sprints\n", "entry_point": "filter_ongoing_sprints", "input": "[{'status': 'completed'}, {'status': 'not started'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70323_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008239", "code": "def is_hexadecimal(s):\n    for char in s:\n        if not (char.isdigit() or (char.upper() >= 'A' and char.upper() <= 'F')):\n            return False\n    return True\n", "entry_point": "is_hexadecimal", "input": "'1A3F'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80089_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008240", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'abcdefghijklmnopqrst', 'abcdefghijklmnopqrstuvwxyz'", "output": "(0, 20)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008241", "code": "def maximize_profit(weights, profits, bag_capacity):\n    n = len(weights)\n    data = [(i, profits[i], weights[i]) for i in range(n)]\n    data.sort(key=lambda x: x[1] / x[2], reverse=True)\n    total_profit = 0\n    selected_items = []\n    remaining_capacity = bag_capacity\n    for i in range(n):\n        if data[i][2] <= remaining_capacity:\n            remaining_capacity -= data[i][2]\n            selected_items.append(data[i][0])\n            total_profit += data[i][1]\n        else:\n            break\n    return total_profit, selected_items\n", "entry_point": "maximize_profit", "input": "[1, 2, 3], [10, 20, 30], 0", "output": "(0, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2609_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "354", "output": "{1, 354, 2, 3, 6, 177, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008243", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "0", "output": "'Download successful'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008244", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[-4, -2, 2, -1, 2, 1, 1, 2, 1, 1, 1]", "output": "[2, -1, 2, 1, 1, 2, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008245", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[4, 9, 1, 0, 4, 4, 9, 9]", "output": "[4, 10, 3, 3, 8, 9, 15, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008246", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'iai'", "output": "'iai'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008247", "code": "import ast\ndef ast_to_literal(node):\n    if isinstance(node, ast.AST):\n        field_names = node._fields\n        res = {'constructor': node.__class__.__name__}\n        for field_name in field_names:\n            field = getattr(node, field_name, None)\n            field = ast_to_literal(field)\n            res[field_name] = field\n        return res\n    if isinstance(node, list):\n        res = []\n        for each in node:\n            res.append(ast_to_literal(each))\n        return res\n    return node\n", "entry_point": "ast_to_literal", "input": "'xx'", "output": "'xx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99020_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008248", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008249", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'HeWOWOWO'", "output": "'hEwowowo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008250", "code": "def custom_can_convert_to_int(msg: str) -> bool:\n    if not msg:  # Check if the input string is empty\n        return False\n    for char in msg:\n        if not char.isdigit():  # Check if the character is not a digit\n            return False\n    return True\n", "entry_point": "custom_can_convert_to_int", "input": "''", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129394_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008251", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[30.0, 35.0, 35.32]", "output": "33.44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008252", "code": "def find_min_positive_constant(constants):\n    min_positive = None\n    for constant in constants:\n        if constant > 0 and (min_positive is None or constant < min_positive):\n            min_positive = constant\n    return min_positive\n", "entry_point": "find_min_positive_constant", "input": "[-1, 0, 1e-12, 1e-10, 2, 3]", "output": "1e-12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115319_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008253", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "2, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt29", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008254", "code": "import hashlib\nimport pathlib\ndef calculate_html_hashes(directory_path):\n    html_hashes = {}\n    for file_path in pathlib.Path(directory_path).rglob('*.html'):\n        with open(file_path, 'rb') as file:\n            file_content = file.read()\n            hash_value = hashlib.sha256(file_content).hexdigest()\n            html_hashes[file_path.name] = hash_value\n    return html_hashes\n", "entry_point": "calculate_html_hashes", "input": "'empty_directory'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112223_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008255", "code": "def sum_of_squares_of_even_numbers(input_list):\n    total = 0\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[4, 4, 0]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49969_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008256", "code": "from collections import defaultdict\ndef process_dependencies(dependency_pairs):\n    num_heads = defaultdict(int)\n    tails = defaultdict(list)\n    heads = []\n    for h, t in dependency_pairs:\n        num_heads[t] += 1\n        if h in tails:\n            tails[h].append(t)\n        else:\n            tails[h] = [t]\n            heads.append(h)\n    ordered = [h for h in heads if h not in num_heads]\n    for h in ordered:\n        for t in tails[h]:\n            num_heads[t] -= 1\n            if not num_heads[t]:\n                ordered.append(t)\n    cyclic = [n for n, heads in num_heads.items() if heads]\n    return ordered, cyclic\n", "entry_point": "process_dependencies", "input": "[(1, 2), (2, 3), (3, 4), (4, 1)]", "output": "([], [2, 3, 4, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128375_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008257", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'some/base/path', 123", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008258", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'444.2.14'", "output": "(444, 2, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008259", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "0, -2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008260", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "2, 1", "output": "[-1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008261", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "669", "output": "{1, 3, 669, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008262", "code": "def parse_music_commands(code_snippet):\n    parsed_data = {'BPM': None, 'Scale': None, 'Instruments': {}}\n    lines = code_snippet.strip().split('\\n')\n    for line in lines:\n        if line.startswith('Clock.bpm='):\n            parsed_data['BPM'] = int(line.split('=')[1].split(';')[0])\n        elif line.startswith('Scale.default='):\n            parsed_data['Scale'] = line.split('=')[1].strip('\"')\n        elif '>>' in line:\n            instrument, command = line.split('>>')\n            instrument = instrument.strip()\n            command = command.split('(')[1].split(')')[0]\n            parsed_data['Instruments'][instrument] = {'play_command': command}\n    return parsed_data\n", "entry_point": "parse_music_commands", "input": "''", "output": "{'BPM': None, 'Scale': None, 'Instruments': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008263", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "5", "output": "[5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008264", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 90, 92, 93, 100]", "output": "91.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113065_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008265", "code": "# Dictionary mapping ANSI escape codes to substrings\nansi_to_substring = {\n    '\\x1b[91;1m': '+m',\n    '\\x1b[92;1m': '+h',\n    '\\x1b[93;1m': '+k',\n    '\\x1b[94;1m': '+b',\n    '\\x1b[95;1m': '+u',\n    '\\x1b[96;1m': '+c',\n    '\\x1b[97;1m': '+p',\n    '\\x1b[98;1m': '+w',\n    '\\x1b[0m': '+0'\n}\ndef decode(text):\n    for ansi_code, substring in ansi_to_substring.items():\n        text = text.replace(ansi_code, substring)\n    return text\n", "entry_point": "decode", "input": "'Worl\\x1b[0m!'", "output": "'Worl+0!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18500_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008266", "code": "from typing import List, Tuple, Optional\nimport glob\ndef process_mc_directories(datadir_output: str, nexp: str, MCset: Optional[Tuple[int, int]]) -> Tuple[List[str], int]:\n    workdir = datadir_output + '/' + nexp\n    print('working directory = %s' % workdir)\n    print('\\n getting file system information...\\n')\n    dirs = glob.glob(workdir + \"/r*\")\n    if MCset:\n        dirset = dirs[MCset[0]:MCset[1] + 1]\n    else:\n        dirset = dirs\n    mcdir = [item.split('/')[-1] for item in dirset]\n    niters = len(mcdir)\n    print('mcdir: %s' % str(mcdir))\n    print('niters = %s' % str(niters))\n    return mcdir, niters\n", "entry_point": "process_mc_directories", "input": "'non_existent_directory', 'some_exp', None", "output": "([], 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128849_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008267", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1068", "output": "{1, 2, 3, 356, 4, 6, 267, 1068, 12, 178, 534, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1067", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008268", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "3, 3, 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008269", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[2, 1, 2]", "output": "[1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008270", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'123456+XYZ'", "output": "('123456', 'XYZ', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008271", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "5.45", "output": "93.26585", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4252", "output": "{1, 2, 4, 1063, 2126, 4252}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4251", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008273", "code": "def calculate_depth(path):\n    depth = 1\n    for char in path:\n        if char == '/':\n            depth += 1\n    return depth\n", "entry_point": "calculate_depth", "input": "'////'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21386_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008274", "code": "# Define the list of file paths\npaths = [\n    \"/home/user/file1.txt\",\n    \"../folder/file2.txt\"\n]\n# Obfuscation function\ndef obfuscate_path(path):\n    obfuscated_path = ''\n    for char in path:\n        if char.isalpha():\n            obfuscated_path += chr((ord(char) - ord('a') + 3) % 26 + ord('a'))\n        else:\n            obfuscated_path += char\n    return obfuscated_path\n", "entry_point": "obfuscate_path", "input": "'../folder/file2.txt'", "output": "'../iroghu/iloh2.waw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103149_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008275", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return player1_wins, player2_wins\n", "entry_point": "simulate_card_game", "input": "[1, 2], [3, 4]", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47908_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008276", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(len(lst) - 1):\n        total_diff += abs(lst[i] - lst[i + 1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 10, 0]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132641_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008277", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[10, 1, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008278", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[0, 1, 3, 1, 4, 6, 1, 1, 1]", "output": "[1, 4, 4, 5, 10, 7, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5862", "output": "{1, 2, 3, 1954, 5862, 6, 977, 2931}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5861", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008280", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9466", "output": "{1, 9466, 2, 4733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008281", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabbbccDDDeee'", "output": "'a3b3c2D3e3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3949", "output": "{1, 11, 3949, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008283", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'iterations: 100, batch_size: 32'", "output": "{'iterations': '100', 'batch_size': '32'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008284", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[85, 90, 75, 65, 55]", "output": "['B', 'A', 'C', 'D', 'E']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008285", "code": "def filter_and_sort_cache_configs(cache_configs, threshold_limit):\n    filtered_configs = [config for config in cache_configs if config['CACHE_TYPE'] != 'filesystem' or config['CACHE_THRESHOLD'] >= threshold_limit]\n    sorted_configs = sorted(filtered_configs, key=lambda x: x['CACHE_THRESHOLD'])\n    return sorted_configs\n", "entry_point": "filter_and_sort_cache_configs", "input": "[{'CACHE_TYPE': 'filesystem', 'CACHE_THRESHOLD': 5}], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12712_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008286", "code": "def generate_wiktionary_url(snippet, query, lang):\n    query = query.replace(' ', '_')\n    if lang == 'fr':\n        return '\"%s\" - http://fr.wiktionary.org/wiki/%s' % (snippet, query)\n    elif lang == 'es':\n        return '\"%s\" - http://es.wiktionary.org/wiki/%s' % (snippet, query)\n    else:\n        return '\"%s\" - http://en.wiktionary.org/wiki/%s' % (snippet, query)\n", "entry_point": "generate_wiktionary_url", "input": "'wwor', 'lohlooeo', 'en'", "output": "'\"wwor\" - http://en.wiktionary.org/wiki/lohlooeo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98635_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008287", "code": "def latest_version(versions):\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "latest_version", "input": "['3.2.0', '3.1.5', '2.5.1', '3.2.1']", "output": "'3.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109733_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008288", "code": "def count_unique_primes(nums):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in nums:\n        if is_prime(num):\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51785_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4029", "output": "{1, 3, 237, 79, 17, 51, 4029, 1343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4028", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008290", "code": "from typing import List\ndef count_contours(contour_areas: List[int], threshold: int) -> int:\n    cumulative_sum = 0\n    contour_count = 0\n    for area in contour_areas:\n        cumulative_sum += area\n        contour_count += 1\n        if cumulative_sum >= threshold:\n            return contour_count\n    return contour_count\n", "entry_point": "count_contours", "input": "[2, 2, 3, 5], 10", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21235_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008291", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[95, 90, 93, 92, 85], 4", "output": "92.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008292", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[200, 175, 175, 150], 4", "output": "175.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1208", "output": "{1, 2, 4, 8, 302, 151, 1208, 604}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1207", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008294", "code": "def count_unique_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in numbers:\n        if is_prime(num) and num not in unique_primes:\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[2, 3, 5, 7]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31404_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008295", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[1, 7, 31, 1, 30, 30, 1, 9, 1], 4", "output": "[[1, 7, 31, 1], [30, 30, 1, 9], [1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008296", "code": "def find_zero_sign_change(coefficients):\n    zero_loc = []\n    prev_sign = None\n    for i in range(len(coefficients)):\n        if coefficients[i] == 0:\n            zero_loc.append(i)\n        elif prev_sign is not None and coefficients[i] * prev_sign < 0:\n            zero_loc.append(i)\n        if coefficients[i] != 0:\n            prev_sign = 1 if coefficients[i] > 0 else -1\n    return zero_loc\n", "entry_point": "find_zero_sign_change", "input": "[-1, 0, 0, 1, 2, -3, 0, 4]", "output": "[1, 2, 3, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140511_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008297", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/Docum/exam'", "output": "('C:/Users/Docum', 'exam')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008298", "code": "def minMeetingRooms(intervals):\n    intervals.sort(key=lambda x: x[0])  # Sort intervals based on start time\n    rooms = []  # List to store ongoing meetings\n    for start, end in intervals:\n        settled = False\n        for i, (room_end) in enumerate(rooms):\n            if room_end <= start:\n                rooms[i] = end\n                settled = True\n                break\n        if not settled:\n            rooms.append(end)\n    return len(rooms)\n", "entry_point": "minMeetingRooms", "input": "[(0, 30), (5, 10), (15, 20)]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107943_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008299", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "3, 7, 13", "output": "(3, 13)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008300", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "69, 0", "output": "69", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "943", "output": "{1, 23, 41, 943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4874", "output": "{1, 4874, 2, 2437}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008303", "code": "def modify_dell(maxc, minc, dell):\n    next = []\n    for i in range(len(maxc)):\n        if dell[i] > maxc[i]:\n            next.append(maxc[i])\n        elif dell[i] < minc[i]:\n            next.append(minc[i])\n        else:\n            next.append(dell[i])\n    return next\n", "entry_point": "modify_dell", "input": "[10, 6, 30, 40], [9, 5, 25, 34], [10, 5, 25, 35]", "output": "[10, 5, 25, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98828_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008304", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 80, 70, 60, 60, 50]", "output": "[1, 2, 3, 4, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94997_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008305", "code": "def sum_of_multiples_of_3_and_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples_of_3_and_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11094_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008306", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'module.lgoo'", "output": "'lgoo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008307", "code": "def calculate_total_parameters(model_structure):\n    total_parameters = 0\n    for line in model_structure.split('\\n'):\n        if 'Convolution2D' in line:\n            params = line.split('(')[1].split(')')[0].split(',')\n            num_filters = int(params[0])\n            filter_width = int(params[1])\n            filter_height = int(params[2])\n            input_channels = int(params[0])  # Assuming input channels same as number of filters\n            total_parameters += (filter_width * filter_height * input_channels + 1) * num_filters\n    return total_parameters\n", "entry_point": "calculate_total_parameters", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103772_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008308", "code": "from typing import List\ndef find_min_abs_difference_pairs(arr: List[int]) -> List[List[int]]:\n    arr.sort()\n    min_diff = min(arr[i] - arr[i - 1] for i in range(1, len(arr)))\n    min_pairs = [[arr[i - 1], arr[i]] for i in range(1, len(arr)) if arr[i] - arr[i - 1] == min_diff]\n    return min_pairs\n", "entry_point": "find_min_abs_difference_pairs", "input": "[3, 3, 3, 3, 4, 4]", "output": "[[3, 3], [3, 3], [3, 3], [4, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128793_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008309", "code": "from typing import List\ndef remove_and_count(lst: List[int], target: int) -> int:\n    count = 0\n    i = 0\n    while i < len(lst):\n        if lst[i] == target:\n            lst.pop(i)\n            count += 1\n        else:\n            i += 1\n    print(\"Modified list:\", lst)\n    return count\n", "entry_point": "remove_and_count", "input": "[5, 5, 1, 2, 3], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134776_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008310", "code": "from typing import List\ndef modifySequence(nums: List[int]) -> List[int]:\n    cnt = 0\n    modified_nums = nums.copy()\n    for i in range(1, len(nums)):\n        if nums[i - 1] > nums[i]:\n            cnt += 1\n            if cnt > 1:\n                return []\n            if i - 2 >= 0 and nums[i - 2] > nums[i]:\n                modified_nums[i] = nums[i - 1]\n            else:\n                modified_nums[i - 1] = nums[i]\n    return modified_nums\n", "entry_point": "modifySequence", "input": "[3, 2, 1]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138529_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008311", "code": "def max_nested_parentheses_depth(input_str):\n    depth = 0\n    max_depth = 0\n    for char in input_str:\n        if char == '(':\n            depth += 1\n            max_depth = max(max_depth, depth)\n        elif char == ')':\n            depth -= 1\n    return max_depth\n", "entry_point": "max_nested_parentheses_depth", "input": "'((((()))))'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80515_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008312", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaaabbrr'", "output": "{'a': 4, 'b': 2, 'r': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008313", "code": "def max_non_overlapping_sticks(sticks, target):\n    sticks.sort()  # Sort the sticks in ascending order\n    selected_sticks = 0\n    total_length = 0\n    for stick in sticks:\n        if total_length + stick <= target:\n            selected_sticks += 1\n            total_length += stick\n    return selected_sticks\n", "entry_point": "max_non_overlapping_sticks", "input": "[1, 2, 3, 4], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122772_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008314", "code": "def calculate_moving_average(nums, window_size):\n    moving_averages = []\n    window_sum = sum(nums[:window_size])\n    for i in range(len(nums) - window_size + 1):\n        if i > 0:\n            window_sum = window_sum - nums[i - 1] + nums[i + window_size - 1]\n        moving_averages.append(window_sum / window_size)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[99.77777777777777], 1", "output": "[99.77777777777777]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33324_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008315", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[10, 7, 12, 13]", "output": "(13, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008316", "code": "MIN_GENES_TO_USE_CACHING_GENE_MATCHER = 10\ndef use_caching_gene_matcher(num_genes_to_match):\n    if num_genes_to_match > MIN_GENES_TO_USE_CACHING_GENE_MATCHER:\n        return True\n    else:\n        return False\n", "entry_point": "use_caching_gene_matcher", "input": "11", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19770_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008317", "code": "def generate_model_definition(fields):\n    model_definition = \"class YourModel(models.Model):\\n\"\n    for field in fields:\n        field_name = field['name']\n        field_type = field['type']\n        field_label = field['label']\n        model_definition += f\"    {field_name} = models.{field_type}(\\n\"\n        model_definition += f\"        pgettext_lazy(\\\"ok:redirects\\\", '{field_label}'),\\n\"\n        for key, value in field.items():\n            if key not in ['name', 'type', 'label']:\n                model_definition += f\"        {key}={value},\\n\"\n        model_definition += \"    )\\n\"\n    return model_definition\n", "entry_point": "generate_model_definition", "input": "[]", "output": "'class YourModel(models.Model):\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33267_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008318", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7926", "output": "{1, 2, 3, 6, 1321, 2642, 7926, 3963}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008319", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'HelloHello, World!', 4", "output": "'LippsLipps, Asvph!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008320", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "5", "output": "711", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008321", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "5", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008322", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3313.13.13'", "output": "(3313, 13, 13)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008323", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    try:\n        import adafruit_ads1x15.ads1015 as ADS\n        from adafruit_ads1x15.analog_in import AnalogIn\n        print(\"Module available\")\n    except ModuleNotFoundError:\n        print(\"Module not found\")\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92208_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008324", "code": "from typing import List\ndef two_sum(nums: List[int], target: int) -> List[int]:\n    seen = {}  # Dictionary to store elements and their indices\n    for idx, num in enumerate(nums):\n        complement = target - num\n        if complement in seen:\n            return [seen[complement], idx]\n        seen[num] = idx\n    return []\n", "entry_point": "two_sum", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50190_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9269", "output": "{1, 713, 299, 13, 403, 9269, 23, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008326", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'Read', 'I love programming.'", "output": "('Read', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1733", "output": "{1, 1733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008328", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "17", "output": "'PSOS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008329", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008330", "code": "def mesh_tree_depth(id):\n    if len(id) == 1:\n        return 0\n    else:\n        return id.count('.') + 1\n", "entry_point": "mesh_tree_depth", "input": "'ab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32418_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008331", "code": "import math\ndef count_perfect_squares(numbers):\n    count = 0\n    for num in numbers:\n        if math.isqrt(num) ** 2 == num:\n            count += 1\n    return count\n", "entry_point": "count_perfect_squares", "input": "[0, 1, 4, 9, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144234_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008332", "code": "import re\nre_punc = re.compile(r'[!\"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\']')\narticles = set([\"a\", \"an\", \"the\"])\ndef normalize_answer(s):\n    \"\"\"\n    Lower text, remove punctuation, articles, and extra whitespace.\n    Args:\n    s: A string representing the input text to be normalized.\n    Returns:\n    A string with the input text normalized as described.\n    \"\"\"\n    s = s.lower()\n    s = re_punc.sub(\" \", s)\n    s = \" \".join([word for word in s.split() if word not in articles])\n    s = \" \".join(s.split())\n    return s\n", "entry_point": "normalize_answer", "input": "'The dog!'", "output": "'dog'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46089_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008333", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "1073741843, 1", "output": "1073741844", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008334", "code": "EXPERIMENTS_BASE_FILE_PATH = \"/../experiments/base_model/model_params.json\"\nEXPERIMENTS_EFF_FILE_PATH = \"/../experiments/efficient_net/model_params.json\"\nMETRIC_THRESHOLD = 0.5\ndef choose_model_file(metric_value):\n    if metric_value >= METRIC_THRESHOLD:\n        return EXPERIMENTS_EFF_FILE_PATH\n    else:\n        return EXPERIMENTS_BASE_FILE_PATH\n", "entry_point": "choose_model_file", "input": "0.3", "output": "'/../experiments/base_model/model_params.json'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76735_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008335", "code": "def is_back_home(S):\n    x, y = 0, 0\n    for direction in S:\n        if direction == 'N':\n            y += 1\n        elif direction == 'S':\n            y -= 1\n        elif direction == 'E':\n            x += 1\n        elif direction == 'W':\n            x -= 1\n    return x == 0 and y == 0\n", "entry_point": "is_back_home", "input": "'NESW'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100736_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008336", "code": "from typing import List\ndef degree(poly: List[int]) -> int:\n    deg = 0\n    for i in range(len(poly) - 1, -1, -1):\n        if poly[i] != 0:\n            deg = i\n            break\n    return deg\n", "entry_point": "degree", "input": "[0, 0, 0, 0, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116666_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008337", "code": "def max_rectangle_area(buildings):\n    stack = []\n    max_area = 0\n    n = len(buildings)\n    for i in range(n):\n        while stack and buildings[i] < buildings[stack[-1]]:\n            height = buildings[stack.pop()]\n            width = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, height * width)\n        stack.append(i)\n    while stack:\n        height = buildings[stack.pop()]\n        width = n if not stack else n - stack[-1] - 1\n        max_area = max(max_area, height * width)\n    return max_area\n", "entry_point": "max_rectangle_area", "input": "[4, 4, 4, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70831_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008338", "code": "def find_average_patterns(lst):\n    pattern_count = 0\n    for i in range(1, len(lst) - 1):\n        if lst[i] * 2 == lst[i-1] + lst[i+1]:\n            pattern_count += 1\n    return pattern_count\n", "entry_point": "find_average_patterns", "input": "[1, 2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88691_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8414", "output": "{1, 2, 7, 14, 4207, 1202, 601, 8414}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8413", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008340", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3607", "output": "{1, 3607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008341", "code": "def parse_file(file_path):\n    rules = []\n    whitelist_ips = []\n    try:\n        with open(file_path, 'r') as file:\n            for line in file:\n                line = line.strip()\n                if not line or line.startswith('#'):\n                    continue\n                line = line.split('#')[0].strip()  # Remove inline comments\n                if line.startswith('allow:') or line.startswith('deny:'):\n                    rules.append(line.split(':')[1].strip())\n                else:\n                    whitelist_ips.append(line)\n    except FileNotFoundError:\n        print(f\"File '{file_path}' not found.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n    return rules, whitelist_ips\n", "entry_point": "parse_file", "input": "'nonexistent_file.txt'", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31367_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008342", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "5", "output": "'111221'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008343", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7487", "output": "{1, 7487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008344", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "13", "output": "1201", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008345", "code": "def isMath(operation: str) -> bool:\n    if not operation.startswith(\"(\") or not operation.endswith(\")\"):\n        return False\n    operation = operation[1:-1].split()\n    if len(operation) < 3:\n        return False\n    operator = operation[0]\n    if operator not in [\"+\", \"-\", \"*\", \"/\"]:\n        return False\n    operands = operation[1:]\n    for operand in operands:\n        if not operand.isalnum():\n            return False\n    return True\n", "entry_point": "isMath", "input": "'( + 1 2 )'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73873_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008346", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8798", "output": "{1, 2, 166, 106, 4399, 83, 53, 8798}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8797", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008347", "code": "def my_pow(x: float, n: int) -> float:\n    if n == 0:\n        return 1\n    result = my_pow(x*x, abs(n) // 2)\n    if n % 2:\n        result *= x\n    if n < 0:\n        return 1 / result\n    return result\n", "entry_point": "my_pow", "input": "2, -2", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125524_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008348", "code": "def longest_equal_even_odd_subarray(arr):\n    diff_indices = {0: -1}\n    max_length = 0\n    diff = 0\n    for i, num in enumerate(arr):\n        diff += 1 if num % 2 != 0 else -1\n        if diff in diff_indices:\n            max_length = max(max_length, i - diff_indices[diff])\n        else:\n            diff_indices[diff] = i\n    return max_length\n", "entry_point": "longest_equal_even_odd_subarray", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99623_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008349", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[1, 1, 1, 1, 2, 4, 4, 3]", "output": "{1: 4, 2: 1, 4: 2, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008350", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7855", "output": "{1, 1571, 5, 7855}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008351", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "9", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008352", "code": "def make_2D_custom(X, y=0):\n    if isinstance(X, list):\n        if all(isinstance(elem, list) for elem in X):\n            if len(X[0]) == 1:\n                X = [[elem[0], y] for elem in X]\n            return X\n        else:\n            X = [[elem, y] for elem in X]\n            return X\n    elif isinstance(X, int) or isinstance(X, float):\n        X = [[X, y]]\n        return X\n    else:\n        return X\n", "entry_point": "make_2D_custom", "input": "1, 2", "output": "[[1, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106690_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008353", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "find_latest_version", "input": "['4.4.4', '4.4.3', '4.3.2', '3.5.1']", "output": "'4.4.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112747_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008354", "code": "def validate_mac_address(sanitizedMACAddress):\n    items = sanitizedMACAddress.split(\":\")\n    if len(items) != 6:\n        return False\n    HEXADECIMAL_CHARS = set('0123456789ABCDEF')\n    for section in items:\n        if len(section) != 2:\n            return False\n        if not all(char.upper() in HEXADECIMAL_CHARS for char in section):\n            return False\n    return True\n", "entry_point": "validate_mac_address", "input": "'A0:B1:C2:D3:E4'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86991_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008355", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "2", "output": "0.892", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008356", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[3, 3, 4, 4, 1, 5, 5, 3]", "output": "[9, 9, 16, 16, 1, 25, 25, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008357", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "13", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008358", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[2, 4, 5, 11, 20, 39, 50]", "output": "'2, 4, 5, 11, 20, 39, 50'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008359", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        circular_sum = input_list[i] + input_list[(i + 1) % list_length]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 2, 1, 7, 3, 5, 0, 4]", "output": "[2, 3, 8, 10, 8, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117423_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008360", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'uu-us-stus-a'", "output": "'uu-us-stus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008361", "code": "def calculate_accuracy(y_true, y_pred):\n    if len(y_true) != len(y_pred):\n        raise ValueError(\"Length of true labels and predicted labels must be the same.\")\n    correct_predictions = 0\n    total_predictions = len(y_true)\n    for true_label, pred_label in zip(y_true, y_pred):\n        if true_label == pred_label:\n            correct_predictions += 1\n    accuracy = correct_predictions / total_predictions\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[1, 0, 1, 1, 0], [1, 1, 1, 0, 0]", "output": "0.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38023_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008362", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2495", "output": "{1, 499, 5, 2495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008363", "code": "def rotate_array(arr, s):\n    n = len(arr)\n    s = s % n\n    for _ in range(s):\n        store = arr[n-1]\n        for i in range(n-2, -1, -1):\n            arr[i+1] = arr[i]\n        arr[0] = store\n    return arr\n", "entry_point": "rotate_array", "input": "[1, 11, 3, 11, 11], 1", "output": "[11, 1, 11, 3, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58826_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008364", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5990", "output": "{1, 2, 5, 5990, 10, 1198, 2995, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5989", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008365", "code": "def fa_mime_type(mime_type):\n    mime_to_icon = {\n        'application/pdf': 'file-pdf-o',\n        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'file-excel-o',\n        'text/html': 'file-text-o'\n    }\n    return mime_to_icon.get(mime_type, 'file-o')\n", "entry_point": "fa_mime_type", "input": "'image/jpeg'", "output": "'file-o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72858_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008366", "code": "from typing import List\ndef is_secure_environment(hostnames: List[str]) -> bool:\n    import os\n    DEBUG = True if \"DEBUG\" in os.environ else False\n    ALLOWED_HOSTS = [\"lkkpomia-stage.azurewebsites.net\"]  # Assuming this is the ALLOWED_HOSTS setting\n    if not DEBUG and all(hostname in ALLOWED_HOSTS for hostname in hostnames):\n        return True\n    else:\n        return False\n", "entry_point": "is_secure_environment", "input": "['lkkpomia-stage.azurewebsites.net']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121081_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008367", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5383", "output": "{1, 7, 769, 5383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008368", "code": "def generate_fibonacci_numbers(limit):\n    fibonacci_numbers = [0, 1]\n    prev, current = 0, 1\n    while prev + current <= limit:\n        next_fibonacci = prev + current\n        fibonacci_numbers.append(next_fibonacci)\n        prev, current = current, next_fibonacci\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci_numbers", "input": "21", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91390_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008369", "code": "def lint_text(input_string):\n    errors = []\n    if \"error\" in input_string:\n        errors.append(\"error\")\n    if \"warning\" in input_string:\n        errors.append(\"warning\")\n    return errors\n", "entry_point": "lint_text", "input": "'this is an error and a warning'", "output": "['error', 'warning']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20385_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008370", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'Helo 1233!'", "output": "'Helo1233'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008371", "code": "def most_frequent_word(text):\n    word_freq = {}\n    # Split the text into individual words\n    words = text.split()\n    # Count the frequency of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    # Find the word with the highest frequency\n    most_frequent = max(word_freq, key=word_freq.get)\n    return most_frequent, word_freq[most_frequent]\n", "entry_point": "most_frequent_word", "input": "'hello world'", "output": "('hello', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51755_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008372", "code": "# Define the decoding lambdas\nitheta_ = lambda tr_identity: (tr_identity & 0x000000ff) >> 0\niphi_ = lambda tr_identity: (tr_identity & 0x0000ff00) >> 8\nindex_ = lambda tr_identity: (tr_identity & 0xffff0000) >> 16\n# Function to decode the transformation identity\ndef decode_transform(tr_identity):\n    itheta = itheta_(tr_identity)\n    iphi = iphi_(tr_identity)\n    index = index_(tr_identity)\n    return itheta, iphi, index\n", "entry_point": "decode_transform", "input": "16716346", "output": "(58, 18, 255)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121743_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2114", "output": "{1, 2114, 2, 1057, 7, 302, 14, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2113", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008374", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1714", "output": "{857, 1, 1714, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008375", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'aapa'", "output": "'Content for aapa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008376", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filter1, filter2, filter3'", "output": "['filter1', 'filter2', 'filter3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008377", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "13", "output": "'13'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008378", "code": "def count_max_progress(progress_list):\n    max_progress_count = 0\n    for progress in progress_list:\n        if progress == 10:\n            max_progress_count += 1\n    return max_progress_count\n", "entry_point": "count_max_progress", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93593_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008379", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "12, 1, 15", "output": "479001600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008380", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9868", "output": "{1, 2, 2467, 4, 4934, 9868}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9867", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008381", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(-1, 0, 7, -1, 0, 2, 7)", "output": "'-1.0.7.-1.0.2.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008382", "code": "def maxScore(nums):\n    n = len(nums)\n    dp = [[0] * n for _ in range(n)]\n    for i in range(n):\n        dp[i][i] = nums[i]\n    for length in range(2, n + 1):\n        for i in range(n - length + 1):\n            j = i + length - 1\n            dp[i][j] = max(nums[i] - dp[i + 1][j], nums[j] - dp[i][j - 1])\n    return dp[0][n - 1]\n", "entry_point": "maxScore", "input": "[2, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80788_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008383", "code": "def get_node_list(heap):\n    node_list = [None, len(heap)] + [i for i in range(len(heap)) if heap[i] is not None]\n    return node_list\n", "entry_point": "get_node_list", "input": "[]", "output": "[None, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133261_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008384", "code": "def calculate_balance(transactions):\n    balance = 0\n    for transaction in transactions:\n        if transaction['type'] == 'income':\n            balance += transaction['amount']\n        elif transaction['type'] == 'expense':\n            balance -= transaction['amount']\n    return balance\n", "entry_point": "calculate_balance", "input": "[{'type': 'income', 'amount': 100}, {'type': 'expense', 'amount': 100}]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67059_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008385", "code": "def process_integers(input_list):\n    # Multiply each integer by 2\n    multiplied_list = [num * 2 for num in input_list]\n    # Subtract 10 from each integer\n    subtracted_list = [num - 10 for num in multiplied_list]\n    # Calculate the square of each integer\n    squared_list = [num ** 2 for num in subtracted_list]\n    # Find the sum of all squared integers\n    sum_squared = sum(squared_list)\n    return sum_squared\n", "entry_point": "process_integers", "input": "[8]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101819_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008386", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'https://www.exwithth spcs'", "output": "'httpswww.exwithth%20spcs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008387", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[3, 3, 3, 1, 1, 2]", "output": "{3: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008388", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'wold'", "output": "{'wold': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008389", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4307", "output": "{73, 1, 4307, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4306", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008390", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6278", "output": "{1, 2, 3139, 6278, 73, 43, 146, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6277", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008391", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[4, 2, 1, 1, 5, 3, 2, 5]", "output": "[6, 3, 2, 6, 8, 5, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008392", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89225_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008393", "code": "def max_product_of_two(nums):\n    if len(nums) < 2:\n        return 0\n    max_product = float('-inf')\n    second_max_product = float('-inf')\n    for num in nums:\n        if num > max_product:\n            second_max_product = max_product\n            max_product = num\n        elif num > second_max_product:\n            second_max_product = num\n    return max_product * second_max_product if max_product != float('-inf') and second_max_product != float('-inf') else 0\n", "entry_point": "max_product_of_two", "input": "[1, 4, 6, 2, 3]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103728_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008394", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '**':\n        return num1 ** num2\n    elif operation == '*' or operation == '/':\n        return num1 * num2 if operation == '*' else num1 / num2\n    elif operation == '//' or operation == '%':\n        return num1 // num2 if operation == '//' else num1 % num2\n    elif operation == '+' or operation == '-':\n        return num1 + num2 if operation == '+' else num1 - num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'+', 10, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63622_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008395", "code": "def count_hex_matches(input_string):\n    UCI_VERSION = '5964e2fc6156c5f720eed7faecf609c3c6245e3d'\n    UCI_VERSION_lower = UCI_VERSION.lower()\n    input_string_lower = input_string.lower()\n    count = 0\n    for char in input_string_lower:\n        if char in UCI_VERSION_lower:\n            count += 1\n    return count\n", "entry_point": "count_hex_matches", "input": "'55996644eeff12'", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86391_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008396", "code": "from typing import List\ndef most_frequent_bases(dna_sequence: str) -> List[str]:\n    base_count = {}\n    # Count the occurrences of each base\n    for base in dna_sequence:\n        if base in base_count:\n            base_count[base] += 1\n        else:\n            base_count[base] = 1\n    max_count = max(base_count.values())\n    most_frequent_bases = [base for base, count in base_count.items() if count == max_count]\n    return sorted(most_frequent_bases)\n", "entry_point": "most_frequent_bases", "input": "'AAAACCGG'", "output": "['A']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79013_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7273", "output": "{1, 1039, 7273, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008398", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3663", "output": "'1 hour, 1 minute, and 3 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008399", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6007", "output": "{1, 6007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008400", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7809", "output": "{1, 7809, 3, 137, 2603, 19, 57, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008401", "code": "from typing import List\ndef sum_multiples_of_3_or_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 6, 9, 12, 15]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84660_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008402", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'exammcm:443'", "output": "('https', 'exammcm', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008403", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 1, 8, 2]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91583_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008404", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/ts', ''", "output": "'/ts/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008405", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[0, 7, 14, 21, 28, 35, 42], 7", "output": "[0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008406", "code": "from collections import defaultdict\ndef close_files_in_order(file_names):\n    graph = defaultdict(list)\n    for i in range(len(file_names) - 1):\n        graph[file_names[i]].append(file_names[i + 1])\n    def topological_sort(node, visited, stack):\n        visited.add(node)\n        for neighbor in graph[node]:\n            if neighbor not in visited:\n                topological_sort(neighbor, visited, stack)\n        stack.append(node)\n    visited = set()\n    stack = []\n    for file_name in file_names:\n        if file_name not in visited:\n            topological_sort(file_name, visited, stack)\n    return stack[::-1]\n", "entry_point": "close_files_in_order", "input": "['file3', 'fifie2lef']", "output": "['file3', 'fifie2lef']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25686_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008407", "code": "def find_missing_number(arr):\n    n = len(arr)\n    sum_of_arr = sum(arr)\n    sum_of_n_no = (n * (n + 1)) // 2\n    missing_number = sum_of_n_no - sum_of_arr\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97333_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008408", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "3.26, 1.5", "output": "1.45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "833", "output": "{833, 1, 7, 17, 49, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008410", "code": "def assign_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        else:\n            grades.append('C')\n    return grades\n", "entry_point": "assign_grades", "input": "[75, 85, 82, 90]", "output": "['C', 'B', 'B', 'A']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4885_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008411", "code": "def process_image(option: str, image_url: str = None, uploaded_image: str = None) -> str:\n    if option == 'library':\n        # Process example image from library\n        return 'Processed example image from library'\n    elif option == 'url' and image_url:\n        # Process image downloaded from URL\n        return 'Processed image downloaded from URL'\n    elif option == 'upload' and uploaded_image:\n        # Process uploaded image\n        return 'Processed uploaded image'\n    else:\n        return 'Invalid option or missing image data'\n", "entry_point": "process_image", "input": "'invalid'", "output": "'Invalid option or missing image data'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138019_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008412", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[0, 24, 12, 8]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008413", "code": "def decode_secret_message(encoded_message, shift):\n    decoded_message = \"\"\n    for char in encoded_message:\n        if char.isalpha():\n            if char.islower():\n                decoded_message += chr(((ord(char) - ord('a') - shift) % 26) + ord('a'))\n            else:\n                decoded_message += chr(((ord(char) - ord('A') - shift) % 26) + ord('A'))\n        else:\n            decoded_message += char\n    return decoded_message\n", "entry_point": "decode_secret_message", "input": "'lii', 2", "output": "'jgg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69063_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008414", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 2]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008415", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.17.1'", "output": "(0, 17, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008416", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3074", "output": "{1, 3074, 2, 1537, 106, 53, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008417", "code": "def calculate_total_pressure(partial_pressures):\n    total_pressure = sum(partial_pressures.values())\n    return total_pressure\n", "entry_point": "calculate_total_pressure", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26484_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008418", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'18.09.2023'", "output": "'18.09'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008419", "code": "def _determine_vmax(max_data_value):\n    vmax = 1\n    if max_data_value > 255:\n        vmax = None\n    elif max_data_value > 1:\n        vmax = 255\n    return vmax\n", "entry_point": "_determine_vmax", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21347_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008420", "code": "def generate_unique_username(name, existing_usernames):\n    base_username = name.replace(\" \", \"\").lower()\n    if base_username not in existing_usernames:\n        return base_username\n    unique_username = base_username\n    count = 1\n    while unique_username in existing_usernames:\n        unique_username = f\"{base_username}{count}\"\n        count += 1\n    return unique_username\n", "entry_point": "generate_unique_username", "input": "'John Doe', ['janedoe', 'johnsmith']", "output": "'johndoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25779_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008421", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abc!@#$dei'", "output": "['abc', 'dei']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008422", "code": "import math\ndef calculate_expression(x):\n    sqrt_x = math.sqrt(x)\n    log_x = math.log10(x)\n    result = sqrt_x + log_x\n    return result\n", "entry_point": "calculate_expression", "input": "9", "output": "3.9542425094393248", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127737_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008423", "code": "from collections import Counter\ndef task_scheduler(tasks, n):\n    task_freq = Counter(tasks)\n    max_freq = max(task_freq.values())\n    idle_time = (max_freq - 1) * n\n    for task, freq in task_freq.items():\n        idle_time -= min(freq, max_freq - 1)\n    idle_time = max(0, idle_time)\n    return len(tasks) + idle_time\n", "entry_point": "task_scheduler", "input": "['A', 'A', 'B', 'C'], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48302_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008424", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[1, 3, 4], 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9033", "output": "{9033, 1, 3, 3011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5626", "output": "{1, 2, 194, 58, 97, 2813, 5626, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5625", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008427", "code": "from collections import deque\ndef find_max_element(nums):\n    d = deque(nums)\n    max_element = None\n    while d:\n        if d[0] >= d[-1]:\n            current_max = d.popleft()\n        else:\n            current_max = d.pop()\n        if max_element is None or current_max > max_element:\n            max_element = current_max\n    return max_element\n", "entry_point": "find_max_element", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79887_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008428", "code": "def transliterate_lines(source_text, mapping):\n    mapping_dict = dict(pair.split(':') for pair in mapping.split(','))\n    transliterated_text = ''.join(mapping_dict.get(char, char) for char in source_text)\n    return transliterated_text\n", "entry_point": "transliterate_lines", "input": "'koding', 'i:\u026a'", "output": "'kod\u026ang'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56181_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008429", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7379", "output": "{1, 7379, 157, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008430", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4103", "output": "{1, 11, 373, 4103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008431", "code": "def modified_insertion_sort(arr):\n    def insertion_sort(arr):\n        for i in range(1, len(arr)):\n            key = arr[i]\n            j = i - 1\n            while j >= 0 and arr[j] > key:\n                arr[j + 1] = arr[j]\n                j -= 1\n            arr[j + 1] = key\n    sorted_arr = []\n    positive_nums = [num for num in arr if num > 0]\n    insertion_sort(positive_nums)\n    pos_index = 0\n    for num in arr:\n        if num > 0:\n            sorted_arr.append(positive_nums[pos_index])\n            pos_index += 1\n        else:\n            sorted_arr.append(num)\n    return sorted_arr\n", "entry_point": "modified_insertion_sort", "input": "[6, 4, 0, 0, 6, 7]", "output": "[4, 6, 0, 0, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66384_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008432", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'gvhg'", "output": "'test'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008433", "code": "def extract_github_info(url):\n    # Remove \"https://github.com/\" from the URL\n    url = url.replace(\"https://github.com/\", \"\")\n    # Split the remaining URL by \"/\"\n    parts = url.split(\"/\")\n    # Extract the username and repository name\n    username = parts[0]\n    repository = parts[1]\n    return (username, repository)\n", "entry_point": "extract_github_info", "input": "'https://github.com/http/'", "output": "('http', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146065_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6447", "output": "{1, 3, 2149, 7, 6447, 307, 21, 921}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008435", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'abcddddabc'", "output": "'dddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5903", "output": "{1, 5903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008437", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[1, 3, -2, 3, 2, 3]", "output": "[4, 1, 1, 5, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008438", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'preproption2'", "output": "('preproption2', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008439", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'nadinapps.some.other.parts.NannNg'", "output": "('nadinapps', 'NannNg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008440", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4582", "output": "{1, 2, 4582, 79, 2291, 58, 29, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008441", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[6, 8, 2, 1, 9, 6, 8, 1]", "output": "[6, 9, 4, 4, 13, 11, 14, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008442", "code": "def sum_secondary_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][len(matrix) - i - 1]\n    return diagonal_sum\n", "entry_point": "sum_secondary_diagonal", "input": "[[1, 2, 5], [3, 4, 1], [5, 0, 6]]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25784_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008443", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'WLORLD'", "output": "'WLORLD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008444", "code": "def count_file_extensions(file_paths):\n    extension_count = {}\n    for file_path in file_paths:\n        file_name, file_extension = file_path.rsplit('.', 1)\n        file_extension = file_extension.lower()\n        if file_extension in extension_count:\n            extension_count[file_extension] += 1\n        else:\n            extension_count[file_extension] = 1\n    return extension_count\n", "entry_point": "count_file_extensions", "input": "['script1.py', 'script2.py']", "output": "{'py': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19521_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008445", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "88", "output": "'qst_save_relative_of_merchant'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008446", "code": "def count_subarrays(N, S, array):\n    count = 0\n    window_sum = 0\n    start = 0\n    for end in range(N):\n        window_sum += array[end]\n        while window_sum > S:\n            window_sum -= array[start]\n            start += 1\n        if window_sum == S:\n            count += 1\n    return count\n", "entry_point": "count_subarrays", "input": "2, 5, [2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148612_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008447", "code": "def extract_app_name(config_class_str):\n    # Find the index of 'name =' in the input string\n    name_index = config_class_str.find(\"name =\")\n    # Extract the substring starting from the app name\n    app_name_start = config_class_str.find(\"'\", name_index) + 1\n    app_name_end = config_class_str.find(\"'\", app_name_start)\n    # Return the extracted app name\n    return config_class_str[app_name_start:app_name_end]\n", "entry_point": "extract_app_name", "input": "\"name = 'ark_f'\"", "output": "'ark_f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66687_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008448", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008449", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-3, -1, 0, 1, 2]", "output": "[[-3, 1, 2], [-1, 0, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008450", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'12.51.11'", "output": "(12, 51, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008451", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'aaaaaaacrh64rac64'", "output": "'aaaaaaacrh64rac64'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "329", "output": "{329, 1, 47, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008453", "code": "from typing import List, Dict\ndef count_module_types(commands_list: List[str]) -> Dict[str, int]:\n    module_counts = {}\n    for module_type in commands_list:\n        if module_type in module_counts:\n            module_counts[module_type] += 1\n        else:\n            module_counts[module_type] = 1\n    return module_counts\n", "entry_point": "count_module_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62127_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008454", "code": "def paginate_messages(all_messages, page, limit):\n    start_index = (page - 1) * limit\n    end_index = start_index + limit\n    return all_messages[start_index:end_index]\n", "entry_point": "paginate_messages", "input": "[], 1, 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124960_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008455", "code": "from typing import List\ndef above_average_scores(scores: List[int]) -> List[int]:\n    if not scores:\n        return []\n    average_score = sum(scores) / len(scores)\n    above_average = [score for score in scores if score > average_score]\n    return above_average\n", "entry_point": "above_average_scores", "input": "[70, 75, 80, 89, 85, 80]", "output": "[80, 89, 85, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44803_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008456", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "'a + b - c * d / e'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008457", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'400 - 39'", "output": "361", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008458", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "7, [7, 2, 3, 5, 8, 2, 2]", "output": "[2, 7, 5, 3, 2, 8, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008459", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[3, 4, 2, 4, 3, 4, 0, 4]", "output": "[7, 6, 6, 7, 7, 4, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008460", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "22, 10", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008461", "code": "from typing import List\ndef count_elements_not_in_d(b: List[int], d: List[int]) -> int:\n    set_b = set(b)\n    set_d = set(d)\n    return len(set_b.difference(set_d))\n", "entry_point": "count_elements_not_in_d", "input": "[1, 2, 3, 4, 5, 6], [5, 6, 7]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83668_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008462", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'P1'", "output": "360", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008463", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "47, 116", "output": "(227, 63)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008464", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[8, 6, 12, 6, 8, 5, 7, 5, 5]", "output": "([8, 6, 12, 6, 8], [5, 7, 5, 5])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008465", "code": "from typing import List\ndef custom_min(nums: List[float]) -> float:\n    if not nums:\n        raise ValueError(\"Input list cannot be empty\")\n    min_value = nums[0]  # Initialize min_value with the first element\n    for num in nums[1:]:  # Iterate from the second element\n        if num < min_value:\n            min_value = num\n    return min_value\n", "entry_point": "custom_min", "input": "[-2.5, 0.0, 1.2, -9.6]", "output": "-9.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69430_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008466", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 3, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008467", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'aa!a '", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008468", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'11.0.10'", "output": "'11.0.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008469", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'Johonth'", "output": "('Johonth', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008470", "code": "def f(bar):\n    # type: (Union[str, bytearray]) -> str\n    if isinstance(bar, bytearray):\n        return bar.decode('utf-8')  # Convert bytearray to string\n    elif isinstance(bar, str):\n        return bar  # Return the input string as is\n    else:\n        raise TypeError(\"Input must be a string or bytearray\")\n", "entry_point": "f", "input": "'123'", "output": "'123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47415_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008471", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'ca_certsi_,'", "output": "{'ca_certsi_': None, '': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008472", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[5.0, 5.0, 0.0, 0.0], 'add'", "output": "[10.0, 10.0, 10.0, 10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008473", "code": "def execute_dependencies(dependencies):\n    graph = {}\n    elements = set()\n    for dep in dependencies:\n        if dep[0] not in graph:\n            graph[dep[0]] = []\n        graph[dep[0]].append(dep[1])\n        elements.add(dep[0])\n        elements.add(dep[1])\n    order = []\n    def visit(element):\n        if element in graph:\n            for dep in graph[element]:\n                if dep not in order:\n                    visit(dep)\n        order.append(element)\n    for element in elements:\n        if element not in order:\n            visit(element)\n    return order[::-1]\n", "entry_point": "execute_dependencies", "input": "[('d', 'c'), ('c', 'b'), ('b', 'a')]", "output": "['d', 'c', 'b', 'a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15862_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008474", "code": "def repeat_characters(s: str) -> str:\n    output = \"\"\n    for char in s:\n        output += char * 2\n    return output\n", "entry_point": "repeat_characters", "input": "'lhlhlo'", "output": "'llhhllhhlloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63922_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6694", "output": "{1, 2, 3347, 6694}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6693", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008476", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "10.304436597, 7", "output": "10.3044365", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008477", "code": "def validate_output_format(user_output_format: str, supported_formats: list) -> bool:\n    return user_output_format in supported_formats\n", "entry_point": "validate_output_format", "input": "'json', ['xml', 'csv']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141344_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008478", "code": "import re\ndef get_tags(data):\n    pattern = r'<([a-zA-Z0-9]+)[^>]*>'\n    tags = re.findall(pattern, data)\n    unique_tags = list(set(tags))\n    return unique_tags\n", "entry_point": "get_tags", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008479", "code": "def get_dependencies(python_version, operating_system):\n    install_requires = []\n    if python_version == '2':\n        install_requires.append('functools32>=3.2.3-2')\n    if python_version == '3' or operating_system == 'Darwin':\n        install_requires.append('bsddb3>=6.1.0')\n    return install_requires\n", "entry_point": "get_dependencies", "input": "'3', 'Linux'", "output": "['bsddb3>=6.1.0']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27475_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008480", "code": "from typing import List\ndef calculate_average_test_score(test_scores: List[int]) -> int:\n    total_score = 0\n    for score in test_scores:\n        total_score += score\n    average = total_score / len(test_scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_test_score", "input": "[86]", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87338_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008481", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'item'", "output": "'<p>item</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008482", "code": "from typing import List\ndef generate_masks(n: int) -> List[str]:\n    if n == 0:\n        return ['']\n    masks = []\n    for mask in generate_masks(n - 1):\n        masks.append(mask + '0')\n        masks.append(mask + '1')\n    return masks\n", "entry_point": "generate_masks", "input": "0", "output": "['']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18657_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4801", "output": "{1, 4801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1941", "output": "{1, 3, 1941, 647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008485", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[3, 3, 2, 2, 4, 2, 3]", "output": "[9, 9, 4, 4, 16, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "159", "output": "{1, 3, 53, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt158", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008487", "code": "def compress_text(text: str) -> str:\n    if not text:\n        return \"\"\n    compressed_text = \"\"\n    current_char = text[0]\n    char_count = 1\n    for i in range(1, len(text)):\n        if text[i] == current_char:\n            char_count += 1\n        else:\n            compressed_text += current_char + str(char_count)\n            current_char = text[i]\n            char_count = 1\n    compressed_text += current_char + str(char_count)\n    return compressed_text\n", "entry_point": "compress_text", "input": "'aaabbbccc'", "output": "'a3b3c3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148970_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008488", "code": "def generate_stairs(N):\n    stairs_ = []\n    for i in range(1, N + 1):\n        symb = \"#\" * i\n        empty = \" \" * (N - i)\n        stairs_.append(symb + empty)\n    return stairs_\n", "entry_point": "generate_stairs", "input": "1", "output": "['#']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69687_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008489", "code": "def format_command_usage(name, desc, usage_template):\n    return usage_template.format(name=name, desc=desc)\n", "entry_point": "format_command_usage", "input": "'component', 'This is a component.', '{name}'", "output": "'component'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41916_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008490", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1401", "output": "{1, 3, 467, 1401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008491", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '2.0.0', '2.4.9', '2.5.0']", "output": "'2.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49230_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008492", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[5, 5, 1, 1, 4, 4]", "output": "[5, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008493", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[3, 5, 6, 6, 7, 7]", "output": "[3, 5, 6, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9569", "output": "{1, 7, 1367, 9569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008495", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "10", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt48", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008496", "code": "def process_dependencies(dependencies):\n    dependency_dict = {}\n    for key, value in dependencies:\n        if key in dependency_dict:\n            dependency_dict[key].append(value)\n        else:\n            dependency_dict[key] = [value]\n    return dependency_dict\n", "entry_point": "process_dependencies", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147184_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008497", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[5, 5, 4, 3, 2]", "output": "(5, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5617", "output": "{1, 137, 5617, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008499", "code": "def calculate_max_vertical_deviation(image_dims, ground_truth_horizon, detected_horizon):\n    width, height = image_dims\n    def gt(x):\n        return ground_truth_horizon[0] * x + ground_truth_horizon[1]\n    def dt(x):\n        return detected_horizon[0] * x + detected_horizon[1]\n    if ground_truth_horizon is None or detected_horizon is None:\n        return None\n    max_deviation = max(abs(gt(0) - dt(0)), abs(gt(width) - dt(width)))\n    normalized_deviation = max_deviation / height\n    return normalized_deviation\n", "entry_point": "calculate_max_vertical_deviation", "input": "(100, 100), (0.1, 0), (0.0, 9.814814814814815)", "output": "0.09814814814814815", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_623_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008500", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'1.1.3'", "output": "'1.1.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008501", "code": "import logging\ndef process_serial_data(data_str):\n    logging.info(\"Initializing data processing\")\n    data_dict = {}\n    pairs = data_str.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        data_dict[key] = value\n    return data_dict\n", "entry_point": "process_serial_data", "input": "'key1:value1e1ke'", "output": "{'key1': 'value1e1ke'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86728_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008502", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 0, 1, 4, 3, 5, 0, 3, 5]", "output": "[0, 1, 5, 7, 8, 5, 3, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110145_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008503", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'22.0.962'", "output": "(22, 0, 962)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008504", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[8, 1, 5, 8, 1, 8, 1, 1], 5", "output": "[512, 1, 125, 512, 1, 512, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008505", "code": "def removeElement(nums, val):\n    \"\"\"\n    :type nums: List[int]\n    :type val: int\n    :rtype: int\n    \"\"\"\n    nums[:] = [num for num in nums if num != val]\n    return len(nums)\n", "entry_point": "removeElement", "input": "[1, 2, 3, 3, 3, 4, 5, 6, 7, 8], 3", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53354_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008506", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7122", "output": "{1, 2, 3, 1187, 2374, 6, 3561, 7122}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008507", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "16", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "89", "output": "{89, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt88", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008509", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[2, 4, 4, 6, 6, 6, 8, 8, 10]", "output": "[2, 4, 4, 6, 6, 6, 8, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008510", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 1, 3, 2, 2, 0, 1, 1, 4]", "output": "[2, 4, 5, 4, 2, 1, 2, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137556_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008511", "code": "def process_tracking_data(x_coordinates, tracking_multiplier, tracker_name):\n    result = []\n    found_tracker = False\n    prev = None\n    for x in x_coordinates:\n        if prev is not None:\n            result.append((x - prev) * tracking_multiplier)\n        prev = x\n    if tracker_name in x_coordinates:\n        found_tracker = True\n    if found_tracker:\n        return result\n    else:\n        return \"TRACKER NOT FOUND\"\n", "entry_point": "process_tracking_data", "input": "[1.0, 2.0, 3.0], 1, 42", "output": "'TRACKER NOT FOUND'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6263_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008512", "code": "def calculate_total_seconds(duration):\n    # Split the duration string into hours, minutes, and seconds\n    hours, minutes, seconds = map(int, duration.split(':'))\n    # Calculate the total number of seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "calculate_total_seconds", "input": "'00:00:00'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40922_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008513", "code": "def count_a_in_list(strings):\n    total_count = 0\n    for string in strings:\n        for char in string:\n            if char.lower() == 'a':\n                total_count += 1\n    return total_count\n", "entry_point": "count_a_in_list", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113849_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008514", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008515", "code": "def prepare_argument(arg, num):\n    if isinstance(arg, float):\n        return [arg] * num\n    try:\n        evaluated_arg = eval(arg)\n        if isinstance(evaluated_arg, list):\n            return evaluated_arg\n    except:\n        pass\n    return [arg] * num\n", "entry_point": "prepare_argument", "input": "'[1, 2, 3]', 1", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81072_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008516", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "7", "output": "'Unknown status code'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008517", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2566", "output": "{1, 2, 1283, 2566}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2565", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008518", "code": "import re\ndef process_twitter_text(text):\n    re_usernames = re.compile(\"@([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    re_hashtags = re.compile(\"#([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    replace_hashtags = \"<a href=\\\"http://twitter.com/search?q=%23\\\\1\\\">#\\\\1</a>\"\n    replace_usernames = \"<a href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a>\"\n    processed_text = re_usernames.sub(replace_usernames, text)\n    processed_text = re_hashtags.sub(replace_hashtags, processed_text)\n    return processed_text\n", "entry_point": "process_twitter_text", "input": "'by'", "output": "'by'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76234_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008519", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "11, 11", "output": "184756", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99400_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008520", "code": "from collections import Counter\ndef calculate_checksum(ids):\n    twos = 0\n    threes = 0\n    for item in ids:\n        counts = dict(Counter(item))\n        two, three = 0, 0\n        for count in counts.values():\n            if count == 2:\n                two = 1\n            if count == 3:\n                three = 1\n        twos += two\n        threes += three\n    checksum = twos * threes\n    return checksum\n", "entry_point": "calculate_checksum", "input": "['abc', 'def', 'ghi']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106945_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1016", "output": "{1, 2, 4, 8, 1016, 508, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1015", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008522", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[1, 2, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008523", "code": "def flatten_list(df_list):\n    flat_list = [item for sublist in df_list for item in sublist]\n    return flat_list\n", "entry_point": "flatten_list", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96775_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008524", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "766", "output": "{1, 2, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008525", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 1, 2, 8, 7, 1, 8, 9, 7]", "output": "[3, 2, 4, 11, 11, 6, 14, 16, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "771", "output": "{3, 1, 771, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008527", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4994", "output": "{1, 4994, 2, 2497, 227, 454, 11, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008528", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[10, 12, 12], 10", "output": "340", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008529", "code": "def generate_code(input_string):\n    result = \"\"\n    position = 1\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper()\n            result += str(position)\n            position += 1\n    return result\n", "entry_point": "generate_code", "input": "'HelloHello'", "output": "'H1E2L3L4O5H6E7L8L9O10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4318_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008530", "code": "def extract_total_params(architecture_description: str) -> int:\n    lines = architecture_description.split('\\n')\n    for line in lines:\n        if \"Total params\" in line:\n            total_params_str = line.split(\":\")[-1].strip().replace(\",\", \"\")\n            return int(total_params_str)\n    return 0  # Return 0 if \"Total params\" line is not found\n", "entry_point": "extract_total_params", "input": "'This is an architecture summary.'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61856_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008531", "code": "import math\ndef calculate_control_gain(nj, amplitude, frequency):\n    control_gain = nj * (amplitude * frequency)**0.5\n    return control_gain\n", "entry_point": "calculate_control_gain", "input": "6.792525303596594, 10, 10", "output": "67.92525303596594", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136868_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008532", "code": "import datetime\ndef validate_expiry_date(expiry_year, expiry_month):\n    current_date = datetime.date.today()\n    if expiry_year < current_date.year or (expiry_year == current_date.year and expiry_month <= current_date.month):\n        return False\n    return True\n", "entry_point": "validate_expiry_date", "input": "2022, 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24890_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008533", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "'##te# Hello\\nThixt.xt.xt.'", "output": "'<p>##te# Hello\\nThixt.xt.xt.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008534", "code": "def sum_of_multiples_of_3_and_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples_of_3_and_5", "input": "[15, 30]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11094_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3883", "output": "{11, 1, 3883, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4866", "output": "{1, 4866, 3, 2, 2433, 6, 811, 1622}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008537", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(0, 0, 0), 28429", "output": "28429", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008538", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[4, 5, 5]", "output": "4.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008539", "code": "def neuinfer(inputs, constant, scale):\n    output = []\n    for value in inputs:\n        result = round((value + constant) * scale)\n        output.append(result)\n    return output\n", "entry_point": "neuinfer", "input": "[15, 15, 11, 15, 11, 15, 7], 0, 1", "output": "[15, 15, 11, 15, 11, 15, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008540", "code": "def calculate_metrics(metrics: list) -> dict:\n    total = 0\n    count = 0\n    for metric in metrics:\n        if isinstance(metric, (int, float)):\n            total += metric\n            count += 1\n        elif isinstance(metric, str) and metric.isdigit():\n            total += int(metric)\n            count += 1\n    if count == 0:\n        return {'average': 0, 'count': 0}\n    else:\n        return {'average': total / count, 'count': count}\n", "entry_point": "calculate_metrics", "input": "[25, 25, 25, 25]", "output": "{'average': 25.0, 'count': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46209_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008541", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        sum_val = input_list[i] + input_list[(i + 1) % n]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[6, 1, 2, 0, 1, 2, 2, 3, 4]", "output": "[7, 3, 2, 1, 3, 4, 5, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149618_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008542", "code": "def validate_tag_name(tag):\n    assert '%' not in tag, \"Character '%' is a reserved word, it is not allowed in tag.\"\n    assert tag != 'embedding', \"'embedding' is a reserved word, it is not allowed in tag.\"\n    return True\n", "entry_point": "validate_tag_name", "input": "'my_tag'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76131_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008543", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5894", "output": "{1, 2, 2947, 421, 5894, 7, 842, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5893", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008544", "code": "from functools import reduce\nfrom typing import List\ndef calculate_sum(input_list: List[int]) -> int:\n    return reduce(lambda x, y: x + y, input_list)\n", "entry_point": "calculate_sum", "input": "[10, 5, 5, 5]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50691_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008545", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) == 1:\n        return scores[0]  # If only one score is present, return that score as the average\n    min_score = min(scores)\n    sum_scores = sum(scores) - min_score\n    return sum_scores / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[60, 70, 70]", "output": "70.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37302_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008546", "code": "def count_unique_chars(string: str) -> int:\n    unique_chars = set()\n    for char in string:\n        unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'abcd'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74408_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008547", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4062", "output": "{1, 2, 3, 677, 6, 1354, 2031, 4062}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008548", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'h\u00e9tf\u0151 MMa'", "output": "'Monday MMa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008549", "code": "def update_uc(strings):\n    updated_strings = [s.upper() for s in strings]\n    sorted_strings = sorted(updated_strings, key=lambda x: len(x), reverse=True)\n    return sorted_strings\n", "entry_point": "update_uc", "input": "['banana', 'orange', 'apple', 'kiwi']", "output": "['BANANA', 'ORANGE', 'APPLE', 'KIWI']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147628_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008550", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>This <pact.a</p>'", "output": "'This <pact.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5131", "output": "{1, 5131, 733, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6574", "output": "{1, 2, 38, 173, 6574, 19, 3287, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008553", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[10, 15, 13]", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008554", "code": "def calculate_moving_average(prices, window_size):\n    moving_averages = []\n    for i in range(window_size - 1, len(prices)):\n        average = sum(prices[i - window_size + 1:i + 1]) / window_size\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[60.0, 61.0, 62.0], 3", "output": "[61.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42913_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008555", "code": "def validate_file(file_name, file_size, file_extension):\n    IMAGE_EXT_NAME_LS = [\"bmp\", \"jpg\", \"png\", \"tif\", \"gif\", \"pcx\", \"tga\", \"exif\", \"fpx\", \"svg\", \"psd\", \"cdr\", \"pcd\", \"dxf\",\n                         \"ufo\", \"eps\", \"ai\", \"raw\", \"WMF\", \"webp\"]\n    DOC_EXT_NAME_LS = [\"ppt\", \"pptx\", \"doc\", \"docx\", \"xls\", \"xlsx\", \"txt\", \"pdf\"]\n    IMAGE_MAX_SIZE = 5 * 1024 * 1024\n    DOC_MAX_SIZE = 100 * 1024 * 1024\n    if file_extension.lower() in IMAGE_EXT_NAME_LS:\n        if file_size <= IMAGE_MAX_SIZE:\n            return True\n    elif file_extension.lower() in DOC_EXT_NAME_LS:\n        if file_size <= DOC_MAX_SIZE:\n            return True\n    return False\n", "entry_point": "validate_file", "input": "'image.jpg', 4 * 1024 * 1024, 'jpg'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46349_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008556", "code": "def max_consecutive_rounds(candies):\n    if not candies:\n        return 0\n    max_consecutive = 1\n    current_consecutive = 1\n    for i in range(1, len(candies)):\n        if candies[i] == candies[i - 1]:\n            current_consecutive += 1\n            max_consecutive = max(max_consecutive, current_consecutive)\n        else:\n            current_consecutive = 1\n    return max_consecutive\n", "entry_point": "max_consecutive_rounds", "input": "['B', 'A', 'A', 'C']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31135_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008557", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'cadaaacc'", "output": "'cadaaacc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1357", "output": "{1, 59, 1357, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008559", "code": "def find_smallest_divisible_number(digit1: int, digit2: int, k: int) -> int:\n    MAX_NUM_OF_DIGITS = 10\n    INT_MAX = 2**31-1\n    if digit1 < digit2:\n        digit1, digit2 = digit2, digit1\n    total = 2\n    for l in range(1, MAX_NUM_OF_DIGITS+1):\n        for mask in range(total):\n            curr, bit = 0, total>>1\n            while bit:\n                curr = curr*10 + (digit1 if mask&bit else digit2)\n                bit >>= 1\n            if k < curr <= INT_MAX and curr % k == 0:\n                return curr\n        total <<= 1\n    return -1\n", "entry_point": "find_smallest_divisible_number", "input": "3, 5, 5", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7656_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008560", "code": "def process_binary_patterns(bpatterns, mapping, output_value):\n    def found(num, bp):\n        print(f\"Found {num} for pattern {bp}\")\n    for bp in bpatterns:\n        if mapping[6] & bp >= bp:\n            found(5, bp)\n            break\n    for bp in bpatterns:\n        if mapping[9] & bp >= bp:\n            found(3, bp)\n            break\n    if len(bpatterns) == 1:\n        found(2, bpatterns[0])\n    return output_value.split()\n", "entry_point": "process_binary_patterns", "input": "[64], [0, 0, 0, 0, 0, 0, 64, 0, 0, 0], '52'", "output": "['52']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8987_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008561", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "149.0, 102.0", "output": "(-74.5, 74.5, 83.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008562", "code": "def calculate_total_cost_with_discount(cart, discount_rate):\n    prices = {'apple': 2, 'banana': 1, 'orange': 1.5}  # Prices of items in the cart\n    total_cost = sum(prices[item] * quantity for item, quantity in cart.items())\n    discounted_cost = total_cost - (total_cost * discount_rate)\n    return discounted_cost\n", "entry_point": "calculate_total_cost_with_discount", "input": "{}, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112673_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008563", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'abbccDDDeee'", "output": "'a1b2c2D3e3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008564", "code": "import sys\nNOT_FINISHED = sys.float_info.max\nconfig_values = {\n    \"car_icons\": [\"icon0\", \"icon1\", \"icon2\", \"icon3\"],\n    \"circuit\": \"Sample Circuit\",\n    \"coord_host\": \"localhost\",\n    \"coord_port\": 8000,\n    \"finish_line_name\": \"Finish Line 1\",\n    \"num_lanes\": 4,\n    \"race_timeout\": 60,\n    \"servo_down_value\": 0,\n    \"servo_up_value\": 1,\n    \"track_name\": \"Local Track\"\n}\ndef get_config_value(config_name: str) -> float:\n    return config_values.get(config_name, NOT_FINISHED)\n", "entry_point": "get_config_value", "input": "'non_existent_key'", "output": "1.7976931348623157e+308", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117192_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008565", "code": "def truncatechars(value, arg):\n    try:\n        length = int(arg)\n    except ValueError:\n        return value  # Return original value if arg is not a valid integer\n    if len(value) > length:\n        return value[:length] + '...'  # Truncate and append '...' if length exceeds arg\n    return value  # Return original value if length is not greater than arg\n", "entry_point": "truncatechars", "input": "'Helll', 5", "output": "'Helll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15483_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008566", "code": "def extract_semantic_version(version):\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(''.join(filter(str.isdigit, version_parts[2])))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.1.610abc'", "output": "(0, 1, 610)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111562_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008567", "code": "def generate_api_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "generate_api_url", "input": "'https://api', 'https://m/users/uss/us'", "output": "'https://apihttps://m/users/uss/us'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62370_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008568", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 3, 3], 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008569", "code": "import re\ndef extract_descriptor_options(code_snippet: str) -> dict:\n    descriptor_options = {}\n    message_pattern = r\"GeneratedProtocolMessageType\\('(\\w+)',\"\n    options_pattern = r\"_descriptor._ParseOptions\\(descriptor_pb2.FileOptions\\(\\), _b\\('(.*)'\\)\\)\"\n    messages = re.findall(message_pattern, code_snippet)\n    options = re.findall(options_pattern, code_snippet)\n    for i, message in enumerate(messages):\n        descriptor_options[message] = options[i] if i < len(options) else None\n    return descriptor_options\n", "entry_point": "extract_descriptor_options", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99896_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008570", "code": "def highest_scoring_student(students):\n    if not students:\n        return None\n    highest_score = float('-inf')\n    highest_scoring_student = None\n    for student in students:\n        name, score = student\n        if score > highest_score:\n            highest_score = score\n            highest_scoring_student = name\n    return highest_scoring_student\n", "entry_point": "highest_scoring_student", "input": "[('John', 85), ('Mike', 90)]", "output": "'Mike'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93566_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008571", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[4, 5, 7, 4, 5, 6, 4, 5]", "output": "[20, 28, 16, 20, 24, 16, 20, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008572", "code": "def extract_app_name(config: str) -> str:\n    # Find the index of the equal sign\n    equal_index = config.index(\"=\")\n    # Extract the substring after the equal sign\n    app_name = config[equal_index + 1:]\n    # Strip any leading or trailing spaces\n    app_name = app_name.strip()\n    return app_name\n", "entry_point": "extract_app_name", "input": "'key = m=g'", "output": "'m=g'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77630_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008573", "code": "def generate_default_dict(keys, default_value):\n    result_dict = {}\n    for key in keys:\n        result_dict[key] = default_value\n    return result_dict\n", "entry_point": "generate_default_dict", "input": "['aa', 'b', 'cc', 'c'], 1", "output": "{'aa': 1, 'b': 1, 'cc': 1, 'c': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91901_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008574", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123355_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008575", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "7.123456, 4", "output": "7.1234", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008576", "code": "import itertools\ndef check_condition(variable_names, condition):\n    for combination in itertools.product([True, False], repeat=len(variable_names)):\n        variables = dict(zip(variable_names, combination))\n        if all(variables[var] for var in variables) and eval(condition, variables):\n            return \"Condition met\"\n    return \"Condition not met\"\n", "entry_point": "check_condition", "input": "['A'], 'A'", "output": "'Condition met'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37067_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008577", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average = round(average_score, 2)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[86, 87, 87]", "output": "86.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105956_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008578", "code": "import keyword\ndef count_keywords(text):\n    keyword_counts = {}\n    words = text.split()\n    for word in words:\n        if keyword.iskeyword(word):\n            if word in keyword_counts:\n                keyword_counts[word] += 1\n            else:\n                keyword_counts[word] = 1\n    return keyword_counts\n", "entry_point": "count_keywords", "input": "'this is a test'", "output": "{'is': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57689_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8948", "output": "{1, 2, 4, 8948, 4474, 2237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8947", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008580", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'hello w'", "output": "{'hello': 1, 'w': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008581", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "' :30:00'", "output": "{'when': ':30:00', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008582", "code": "def solve(a, b, dt={}):\n    if len(a) <= 1:\n        return False\n    if (a, b) in dt:\n        return dt[(a, b)]\n    flag = False\n    temp = a + '-' + 'b'\n    if temp in dt:\n        return dt[temp]\n    for i in range(1, len(a)):\n        temp1 = solve(a[:i], b[-i:]) and solve(a[i:], b[:-i])  # swapped\n        temp2 = solve(a[:i], b[:i]) and solve(a[i:], b[i:])    # not swapped\n        if temp1 or temp2:\n            flag = True\n            break\n    dt[(a, b)] = flag\n    return flag\n", "entry_point": "solve", "input": "'ab', 'cd'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96565_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008583", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[2, 3, 4, 7]", "output": "'2-3-4-7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008584", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 7, 8]", "output": "(7, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008585", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7789", "output": "{1, 7789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008586", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'task, something else'", "output": "{'when': 'task', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008587", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[0, 0]", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008588", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[30, 45]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008589", "code": "def isNumber(s: str) -> bool:\n    states = [\n        {'blank': 0, 'sign': 1, 'digit': 2, '.': 3},\n        {'digit': 2, '.': 3},\n        {'digit': 2, '.': 4, 'e': 5, 'blank': 8},\n        {'digit': 4},\n        {'digit': 4, 'e': 5, 'blank': 8},\n        {'sign': 6, 'digit': 7},\n        {'digit': 7},\n        {'digit': 7, 'blank': 8},\n        {'blank': 8}\n    ]\n    state = 0\n    for char in s.strip():\n        if char.isdigit():\n            char = 'digit'\n        elif char in ['+', '-']:\n            char = 'sign'\n        elif char in ['e', 'E']:\n            char = 'e'\n        elif char == ' ':\n            char = 'blank'\n        if char not in states[state]:\n            return False\n        state = states[state][char]\n    return state in [2, 4, 7, 8]\n", "entry_point": "isNumber", "input": "'3.14'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1102_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008590", "code": "def extract_alias(source_url):\n    if ':' in source_url:\n        alias = source_url.split(':', 1)[0]\n        return alias\n    else:\n        return None\n", "entry_point": "extract_alias", "input": "'htt/https:example.com'", "output": "'htt/https'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119573_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008591", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[2, 4, 7, 8, 7, 7, 13]", "output": "[2, 4, 8, 49, 49, 49, 169]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008592", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[10, 9, 10, 9], 4", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7342", "output": "{1, 2, 7342, 3671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008594", "code": "def encrypt_text(text: str, k: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        new_ascii = ord(char) + k\n        if new_ascii > 126:\n            new_ascii = 32 + (new_ascii - 127)\n        encrypted_text += chr(new_ascii)\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Zruog$', 5", "output": "'_wztl)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40126_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008595", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[10, 10, 10, 12]", "output": "12000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008596", "code": "def calculate_average_params(tups):\n    weight_params = {}\n    for weight, param in tups:\n        if weight not in weight_params:\n            weight_params[weight] = [param, 1]\n        else:\n            weight_params[weight][0] += param\n            weight_params[weight][1] += 1\n    average_params = {weight: param_sum / count for weight, (param_sum, count) in weight_params.items()}\n    return average_params\n", "entry_point": "calculate_average_params", "input": "[(100.0, 10.0)]", "output": "{100.0: 10.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12268_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008597", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[2, 3, 5, 1, 6, 5, 4, 1, 1]", "output": "[4, 27, 125, 1, 36, 125, 16, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008598", "code": "from typing import List, Dict, Union\ndef sort_analysis_options(analysis_options: List[Dict[str, Union[int, str]]]) -> List[Dict[str, Union[int, str]]]:\n    analysis_options.sort(key=lambda item: (item.get('priority', 100), item.get('text', '')))\n    return analysis_options\n", "entry_point": "sort_analysis_options", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56941_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008599", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[3, 2, 4, 6, 3, 6, 7, 6, 6]", "output": "[2, 4, 6, 6, 6, 6, 3, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008600", "code": "import tempfile\ndef check_svg_for_circle(svg_benchmark):\n    # Simulate the execution of the oscap command\n    output = \"<guide>Some text with circle element</guide>\"  # Simulated output with \"circle\" present\n    return \"circle\" in output\n", "entry_point": "check_svg_for_circle", "input": "None", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96297_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008601", "code": "def score(dice):\n    score = 0\n    counts = [0] * 7  # Initialize counts for each dice face (index 1-6)\n    for roll in dice:\n        counts[roll] += 1\n    for i in range(1, 7):\n        if counts[i] >= 3:\n            if i == 1:\n                score += 1000\n            else:\n                score += i * 100\n            counts[i] -= 3\n    score += counts[1] * 100  # Add remaining 1's\n    score += counts[5] * 50   # Add remaining 5's\n    return score\n", "entry_point": "score", "input": "[5, 5, 5, 5]", "output": "550", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95031_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008602", "code": "def find_min_max(numbers):\n    if not numbers:\n        return None\n    min_value = float('inf')\n    max_value = float('-inf')\n    for num in numbers:\n        if num < min_value:\n            min_value = num\n        if num > max_value:\n            max_value = num\n    return min_value, max_value\n", "entry_point": "find_min_max", "input": "[2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "(2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24169_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008603", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[5, 1, 1, 6, 2, 3, 4, 4]", "output": "[125, 1, 1, 46, 4, 37, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "598", "output": "{1, 2, 299, 13, 46, 598, 23, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008605", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[78, 80, 84, 85, 90, 95]", "output": "84.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61788_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008606", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 40, 39, 35, 20, 10]", "output": "[42, 40, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008607", "code": "import json\ndef calculate_monthly_charges(response_obj):\n    try:\n        charges = response_obj['charges']['monthToDate']\n        return float(charges)\n    except KeyError:\n        return 0.0  # Return 0.0 if the 'monthToDate' charges are not found in the response\n", "entry_point": "calculate_monthly_charges", "input": "{}", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137580_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008608", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "305", "output": "{1, 61, 5, 305}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008609", "code": "def convert_to_indices(input_string):\n    alphabet = \"abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\\\"/\\\\|_@#$%^&*~`+-=<>()[]{} \"\n    dictionary = {char: idx for idx, char in enumerate(alphabet, start=1)}\n    indices_list = [dictionary[char] for char in input_string if char in dictionary]\n    return indices_list\n", "entry_point": "convert_to_indices", "input": "'hello'", "output": "[8, 5, 12, 12, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126715_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008610", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'abcdefghijklm', 'abcd'", "output": "0.3076923076923077", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008611", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "24", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008612", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 8, 5, 5]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24273_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008613", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[3, 3, 3, 4, -1]", "output": "[3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008614", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[1, 4, 3, 6, 5, 5]", "output": "[2, 5, 4, 7, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008615", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8823", "output": "{1, 3, 519, 173, 17, 51, 8823, 2941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008616", "code": "def List_Product(list):\n    L = []\n    for k in range(len(list[0])):\n        l = 1  # Reset product to 1 for each column\n        for i in range(len(list)):\n            l *= list[i][k]\n        L.append(l)\n    return L\n", "entry_point": "List_Product", "input": "[[3, 2], [5, 2], [63, 54]]", "output": "[945, 216]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130339_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008617", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'30.11.21'", "output": "(30, 11, 21)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008618", "code": "colors = {\n    'MAROON': (128, 0, 0),\n    'MEDIUM_AQUAMARINE': (102, 205, 170),\n    'MEDIUM_BLUE': (0, 0, 205),\n    'MEDIUM_ORCHID': (186, 85, 211),\n    'MEDIUM_PURPLE': (147, 112, 219),\n    'MEDIUM_SEA_GREEN': (60, 179, 113),\n    'MEDIUM_SLATE_BLUE': (123, 104, 238),\n    'MEDIUM_SPRING_GREEN': (0, 250, 154),\n    'MEDIUM_TURQUOISE': (72, 209, 204),\n    'MEDIUM_VIOLET_RED': (199, 21, 133),\n    'MIDNIGHT_BLUE': (25, 25, 112),\n    'MINT_CREAM': (245, 255, 250),\n    'MISTY_ROSE': (255, 228, 225),\n    'MOCCASIN': (255, 228, 181),\n    'NAVAJO_WHITE': (255, 222, 173)\n}\ndef get_rgb(color_name):\n    max_match = ''\n    for color in colors:\n        if color_name.startswith(color) and len(color) > len(max_match):\n            max_match = color\n    return colors.get(max_match, \"Color not found\")\n", "entry_point": "get_rgb", "input": "'XYZ'", "output": "'Color not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75761_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008619", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'lslasst'", "output": "'lslasst'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008620", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7829", "output": "{1, 7829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008621", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'000500.15'", "output": "'000500.15.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008622", "code": "def simulate_with_context(initial_context: dict, company_ids: list, new_context: dict) -> dict:\n    context = initial_context.copy()\n    if 'allowed_company_ids' in new_context:\n        context['allowed_company_ids'] = new_context['allowed_company_ids']\n    for key, value in new_context.items():\n        if key != 'allowed_company_ids':\n            context[key] = value\n    return context\n", "entry_point": "simulate_with_context", "input": "{}, [], {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137018_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008623", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    total_primes = 0\n    for num in numbers:\n        if is_prime(num):\n            total_primes += num\n    return total_primes\n", "entry_point": "sum_of_primes", "input": "[2, 7, 23]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_264_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008624", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "'sample_acl_id', None, None", "output": "'acl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008625", "code": "import json\ndef reverse_value_and_return_json(data):\n    # Extract the value associated with the key 'is_taken'\n    original_value = data.get('is_taken', '')\n    # Reverse the extracted value\n    reversed_value = original_value[::-1]\n    # Update the dictionary with the reversed value\n    data['is_taken'] = reversed_value\n    # Return the modified dictionary as a JSON response\n    return json.dumps(data)\n", "entry_point": "reverse_value_and_return_json", "input": "{'is_taken': ''}", "output": "'{\"is_taken\": \"\"}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47370_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008626", "code": "def max_nested_parentheses_depth(input_str):\n    depth = 0\n    max_depth = 0\n    for char in input_str:\n        if char == '(':\n            depth += 1\n            max_depth = max(max_depth, depth)\n        elif char == ')':\n            depth -= 1\n    return max_depth\n", "entry_point": "max_nested_parentheses_depth", "input": "'(()())'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80515_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8321", "output": "{1, 8321, 53, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008628", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "11", "output": "3.459431618637297", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6249", "output": "{2083, 1, 3, 6249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008630", "code": "from typing import List, Tuple\ndef card_game(deck1: List[int], deck2: List[int]) -> Tuple[int, int]:\n    score1, score2 = 0, 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score1 += 1\n        elif card2 > card1:\n            score2 += 1\n    return score1, score2\n", "entry_point": "card_game", "input": "[3, 1, 2, 1, 1, 1], [2, 3, 4, 5, 6, 7]", "output": "(1, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28513_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7957", "output": "{73, 1, 109, 7957}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008632", "code": "from typing import List\ndef extract_dataset_providers(env_var: str) -> List[str]:\n    if not env_var:\n        return []\n    return env_var.split(',')\n", "entry_point": "extract_dataset_providers", "input": "'DaasecirrocumrquetDasastt'", "output": "['DaasecirrocumrquetDasastt']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18804_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008633", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5349", "output": "{1, 3, 5349, 1783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1823", "output": "{1, 1823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3769", "output": "{1, 3769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008636", "code": "TT_EQ = 'EQ'  # =\nTT_LPAREN = 'LPAREN'  # (\nTT_RPAREN = 'RPAREN'  # )\nTT_LSQUARE = 'LSQUARE'\nTT_RSQUARE = 'RSQUARE'\nTT_EE = 'EE'  # ==\nTT_NE = 'NE'  # !=\nTT_LT = 'LT'  # >\nTT_GT = 'GT'  # <\nTT_LTE = 'LTE'  # >=\nTT_GTE = 'GTE'  # <=\nTT_COMMA = 'COMMA'\nTT_ARROW = 'ARROW'\nTT_NEWLINE = 'NEWLINE'\nTT_EOF = 'EOF'\ndef lexer(code):\n    tokens = []\n    i = 0\n    while i < len(code):\n        char = code[i]\n        if char.isspace():\n            i += 1\n            continue\n        if char == '=':\n            tokens.append((TT_EQ, char))\n        elif char == '(':\n            tokens.append((TT_LPAREN, char))\n        elif char == ')':\n            tokens.append((TT_RPAREN, char))\n        elif char == '[':\n            tokens.append((TT_LSQUARE, char))\n        elif char == ']':\n            tokens.append((TT_RSQUARE, char))\n        elif char == '>':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_GTE, '>='))\n                i += 1\n            else:\n                tokens.append((TT_GT, char))\n        elif char == '<':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_LTE, '<='))\n                i += 1\n            else:\n                tokens.append((TT_LT, char))\n        elif char == '!':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_NE, '!='))\n                i += 1\n        elif char == ',':\n            tokens.append((TT_COMMA, char))\n        elif char == '-':\n            if i + 1 < len(code) and code[i + 1] == '>':\n                tokens.append((TT_ARROW, '->'))\n                i += 1\n        elif char.isdigit():\n            num = char\n            while i + 1 < len(code) and code[i + 1].isdigit():\n                num += code[i + 1]\n                i += 1\n            tokens.append(('NUM', num))\n        elif char.isalpha():\n            identifier = char\n            while i + 1 < len(code) and code[i + 1].isalnum():\n                identifier += code[i + 1]\n                i += 1\n            tokens.append(('ID', identifier))\n        elif char == '\\n':\n            tokens.append((TT_NEWLINE, char))\n        i += 1\n    tokens.append((TT_EOF, ''))  # End of file token\n    return tokens\n", "entry_point": "lexer", "input": "'='", "output": "[('EQ', '='), ('EOF', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28449_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5401", "output": "{1, 11, 5401, 491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008638", "code": "def remove(universe, username):\n    for entry in universe:\n        if entry.get('username') == username:\n            universe.remove(entry)\n            return True\n    return False\n", "entry_point": "remove", "input": "[], 'someusername'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136957_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008639", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    unique_scores = []\n    top_scores = []\n    for score in sorted_scores:\n        if score not in unique_scores:\n            unique_scores.append(score)\n            top_scores.append(score)\n            if len(top_scores) == n:\n                break\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[90, 85, 84, 70, 90], 3", "output": "86.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78119_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008640", "code": "def extract_version_number(line: str) -> str:\n    line = line.strip(\" \\n'\\\"\")  # Remove leading/trailing whitespaces, single quotes, and newline characters\n    _, _, version = line.partition('=')  # Split the string based on '='\n    return version.strip()  # Return the extracted version number\n", "entry_point": "extract_version_number", "input": "'version =   '", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143740_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008641", "code": "from typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    for word in text.split():\n        processed_word = ''.join(char.lower() for char in word if char.isalnum())\n        if processed_word:\n            unique_words.add(processed_word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'worwrldwrldpy!!??'", "output": "['worwrldwrldpy']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110518_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008642", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 1, 3, 0, 1, 4, 5, 4]", "output": "[4, 6, 7, 1, 1, 7, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1677", "output": "{1, 129, 3, 39, 43, 13, 1677, 559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008644", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.10.1'", "output": "(0, 10, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008645", "code": "import re\nnmeaChecksumRegExStr = r\"\"\"\\,[0-9]\\*([0-9A-F][0-9A-F])\"\"\"\nnmeaChecksumRE = re.compile(nmeaChecksumRegExStr)\ndef validate_nmea_checksum(nmea_string):\n    match = nmeaChecksumRE.search(nmea_string)\n    if match:\n        checksum = int(match.group(1), 16)\n        calculated_checksum = 0\n        for char in nmea_string[nmea_string.index('$')+1:nmea_string.index('*')]:\n            calculated_checksum ^= ord(char)\n        return checksum == calculated_checksum\n    return False\n", "entry_point": "validate_nmea_checksum", "input": "'$GPRMC,123456,A,4823.2345,N,12345.6789,W,0.0,0,010101*01'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134812_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008646", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8965", "output": "{1, 1793, 163, 5, 8965, 11, 815, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008647", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "430", "output": "{1, 2, 5, 10, 43, 430, 86, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt429", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008648", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(1, 10, 0)", "output": "'1.10.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008649", "code": "def find_pairs_with_difference(nums, k):\n    unique_nums = set(nums)\n    pair_count = 0\n    for num in nums:\n        if num + k in unique_nums:\n            pair_count += 1\n        if num - k in unique_nums:\n            pair_count += 1\n        unique_nums.add(num)\n    return pair_count // 2  # Divide by 2 to avoid double counting pairs\n", "entry_point": "find_pairs_with_difference", "input": "[1, 2, 3, 4], 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23679_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008650", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'2.15.23'", "output": "(2, 15, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008651", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 3, 3, 4, 3, 4, 4, 3]", "output": "[1, 4, 7, 11, 14, 18, 22, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008652", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[69]", "output": "69", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6584", "output": "{1, 2, 4, 8, 1646, 823, 6584, 3292}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6583", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008654", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7641", "output": "{1, 3, 9, 283, 849, 2547, 7641, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7640", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008655", "code": "def group_units_by_timezone(units):\n    grouped_units = {}\n    for unit in units:\n        time_zone = unit[\"time_zone\"]\n        unit_name = unit[\"name\"]\n        if time_zone not in grouped_units:\n            grouped_units[time_zone] = []\n        grouped_units[time_zone].append(unit_name)\n    return grouped_units\n", "entry_point": "group_units_by_timezone", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1819_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008656", "code": "def flexible_sum(*args):\n    if len(args) < 3:\n        args += (30, 40)[len(args):]  # Assign default values if fewer than 3 arguments provided\n    return sum(args)\n", "entry_point": "flexible_sum", "input": "70, 70, 15", "output": "155", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74466_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008657", "code": "def sum_multiples_of_3_not_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_not_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108735_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008658", "code": "def process_object(object_name: str, object_category: str) -> tuple:\n    source_value = None\n    endpoint_url = None\n    if object_category == \"data_source\":\n        source_value = \"ds_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/ds_smart_status\"\n        object_category = \"data_name\"\n    elif object_category == \"data_host\":\n        source_value = \"dh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/dh_smart_status\"\n    elif object_category == \"metric_host\":\n        source_value = \"mh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/mh_smart_status\"\n    body = \"{'\" + object_category + \"': '\" + object_name + \"'}\"\n    return source_value, endpoint_url, body\n", "entry_point": "process_object", "input": "'exame_oet', 'daatdata_os'", "output": "(None, None, \"{'daatdata_os': 'exame_oet'}\")", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133706_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008659", "code": "def extract_author_name(code_snippet):\n    lines = code_snippet.split('\\n')  # Split the code snippet into lines\n    for line in lines:\n        if '__author__' in line:\n            author_name = line.split('=')[-1].strip().strip(\"'\")\n            return author_name\n", "entry_point": "extract_author_name", "input": "\"__author__ = '__au__author__thor'\"", "output": "'__au__author__thor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48355_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008660", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['Jack', 'Queen', 'King']", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008661", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('a')[0])  # Remove any additional alpha characters\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'40.4.24'", "output": "(40, 4, 24)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101817_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008662", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'item2, item3'", "output": "['item2', 'item3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008663", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[40, 43, 47, 44, 45]", "output": "43.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008664", "code": "def manipulate_string(input_string: str) -> str:\n    # Step 1: Reverse the input string\n    reversed_string = input_string[::-1]\n    # Step 2: Capitalize the first letter of the reversed string\n    capitalized_string = reversed_string.capitalize()\n    # Step 3: Append the length of the original string\n    final_output = capitalized_string + str(len(input_string))\n    return final_output\n", "entry_point": "manipulate_string", "input": "'hhehelo'", "output": "'Olehehh7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1099_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008665", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6235", "output": "{1, 5, 43, 145, 215, 6235, 29, 1247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008666", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[5, -9]", "output": "-45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008667", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008668", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '1.2.3', '2.0.0']", "output": "'2.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008669", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7241", "output": "{7241, 1, 557, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008670", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'Ppb P* Rr e ix base B', 'PRTPPR'", "output": "'ppbprreixbasebPRTPPR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008671", "code": "def simulate_program(a):\n    sum = 0\n    while True:\n        if a == 0:\n            return int(sum)\n        if a <= 2:\n            return -1\n        if a % 5 != 0:\n            a -= 3\n            sum += 1\n        else:\n            sum += a // 5\n            a = 0\n", "entry_point": "simulate_program", "input": "15", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33330_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008672", "code": "import math\ndef get_total_pages(post_list, count):\n    total_posts = len(post_list)\n    total_pages = math.ceil(total_posts / count)\n    return total_pages\n", "entry_point": "get_total_pages", "input": "['Post 1'], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90417_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008673", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[1, 2, 3], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008674", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "0, 10", "output": "'10:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008675", "code": "def generate_default_filename(version, info):\n    total_test_inputs = len(info)\n    default_filename = f\"{version}_{total_test_inputs}\"\n    return default_filename\n", "entry_point": "generate_default_filename", "input": "'.1.', []", "output": "'.1._0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116348_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008676", "code": "def calculate(numbers):\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd\n", "entry_point": "calculate", "input": "[2, 2, 6, 7]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115831_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008677", "code": "def find_earliest_date(date_list):\n    min_date = \"9999-12-31\"  # Initialize with a date greater than any possible date\n    for date in date_list:\n        if date < min_date:\n            min_date = date\n    return min_date\n", "entry_point": "find_earliest_date", "input": "[]", "output": "'9999-12-31'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34726_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008678", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0], [11, 0, 0]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144987_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008679", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5622", "output": "{1, 2, 3, 6, 937, 1874, 5622, 2811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5621", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008680", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(targets=['x'], expr=13)", "output": "'x = 13'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008681", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 90]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008682", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[1, 5, 3, 4, 2]", "output": "[6, 7, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008683", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5729", "output": "{337, 1, 5729, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008684", "code": "def determine_client_type(client_id: str) -> str:\n    client_number = int(client_id.split('-')[-1])\n    if client_number < 100:\n        return \"OLD1-\" + str(client_number)\n    elif 100 <= client_number < 1000:\n        return \"OLD2-\" + str(client_number)\n    else:\n        return \"OLD3-\" + str(client_number)\n", "entry_point": "determine_client_type", "input": "'client-500'", "output": "'OLD2-500'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46850_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008685", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "126, {}", "output": "'126-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008686", "code": "def generate_2d_array(rows, cols):\n    result = []\n    for i in range(rows):\n        row = []\n        for j in range(cols):\n            row.append((i, j))\n        result.append(row)\n    return result\n", "entry_point": "generate_2d_array", "input": "3, 0", "output": "[[], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140571_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008687", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[100.0, 82.0]", "output": "182.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008688", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "3", "output": "'T__2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008689", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "11, 7", "output": "'Enemy: 11, Own: 7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008690", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008691", "code": "def unique_word_count(sentence):\n    unique_words = set()\n    words = sentence.split()\n    for word in words:\n        unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "unique_word_count", "input": "'apple banana cherry'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17367_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008692", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[30, 35, 40]", "output": "'35%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008693", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[1, 6, 7, 4, 3]", "output": "[6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008694", "code": "def get_file_type(file_path):\n    file_extension = file_path[file_path.rfind(\".\"):].lower()\n    file_types = {\n        \".py\": \"Python file\",\n        \".txt\": \"Text file\",\n        \".jpg\": \"Image file\",\n        \".png\": \"Image file\",\n        \".mp3\": \"Audio file\",\n        \".mp4\": \"Video file\"\n    }\n    return file_types.get(file_extension, \"Unknown file type\")\n", "entry_point": "get_file_type", "input": "'file_without_extension'", "output": "'Unknown file type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12387_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008695", "code": "def password_strength_checker(password):\n    score = 0\n    # Check length of the password\n    score += len(password)\n    # Check for uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for special characters\n    special_characters = set('!@#$%^&*()_+-=[]{}|;:,.<>?')\n    if any(char in special_characters for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'A1b!c'", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26515_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008696", "code": "def getFirstSetBit(n):\n    pos = 1\n    while n > 0:\n        if n & 1 == 1:\n            return pos\n        n = n >> 1\n        pos += 1\n    return 0\n", "entry_point": "getFirstSetBit", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107353_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008697", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6998", "output": "{1, 2, 3499, 6998}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6997", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008698", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[2, 8, 3, 3, 5, 5]", "output": "[2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008699", "code": "def find_runner_up(scores):\n    highest_score = float('-inf')\n    runner_up = float('-inf')\n    for score in scores:\n        if score > highest_score:\n            runner_up = highest_score\n            highest_score = score\n        elif score > runner_up and score != highest_score:\n            runner_up = score\n    return runner_up\n", "entry_point": "find_runner_up", "input": "[5, 4, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109289_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008700", "code": "def extract_true_settings(settings_content):\n    true_settings = {}\n    settings_dict = {}\n    exec(settings_content, settings_dict)\n    for setting, value in settings_dict.items():\n        if isinstance(value, bool) and value:\n            true_settings[setting] = value\n    return true_settings\n", "entry_point": "extract_true_settings", "input": "'# No variables defined'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91200_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008701", "code": "def process_integers(nums):\n    modified_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            modified_nums.append(num + 2)\n        elif num % 2 != 0:\n            modified_nums.append(num * 3)\n        if num % 5 == 0:\n            modified_nums[-1] -= 5\n    return modified_nums\n", "entry_point": "process_integers", "input": "[-1, 3, 1, 1, -1, -1, 1, 38, 1]", "output": "[-3, 9, 3, 3, -3, -3, 3, 40, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79730_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008702", "code": "def reverse_string_in_special_way(string: str) -> str:\n    string = list(string)\n    left, right = 0, len(string) - 1\n    while left < right:\n        string[left], string[right] = string[right], string[left]\n        left += 1\n        right -= 1\n    return ''.join(string)\n", "entry_point": "reverse_string_in_special_way", "input": "'hello'", "output": "'olleh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21549_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008703", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "20.0, 53.268", "output": "1065.3600000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008704", "code": "def calculate_chunk_range(selection, chunks):\n    chunk_range = []\n    for s, l in zip(selection, chunks):\n        if isinstance(s, slice):\n            start_chunk = s.start // l\n            end_chunk = (s.stop - 1) // l\n            chunk_range.append(list(range(start_chunk, end_chunk + 1)))\n        else:\n            chunk_range.append([s // l])\n    return chunk_range\n", "entry_point": "calculate_chunk_range", "input": "[2, slice(2, 3), 6], [1, 1, 1]", "output": "[[2], [2], [6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128291_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8065", "output": "{1, 8065, 1613, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008706", "code": "def calculate_cumulative_sum(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 5, 5, 3, 3, 5]", "output": "[3, 8, 13, 16, 19, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126098_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008707", "code": "def validate_user_move(user_move, possible_moves):\n    if not possible_moves:\n        return \"No possible moves\"\n    valid = False\n    for possible_move in possible_moves:\n        if user_move == possible_move:  # Assuming user_move and possible_move are comparable\n            valid = True\n            break\n    if valid:\n        return \"Valid move\"\n    else:\n        return \"Invalid move\"\n", "entry_point": "validate_user_move", "input": "'any_move', []", "output": "'No possible moves'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107547_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008708", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'ejaju', 'NY'", "output": "'ejaju NY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008709", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "412", "output": "{1, 2, 4, 103, 206, 412}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt411", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008710", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[2, 3, -4]", "output": "-24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008711", "code": "def extract_unique_constraints(operations):\n    unique_constraints = {}\n    for operation in operations:\n        if 'AlterUniqueTogether' in operation:\n            model_name = operation['AlterUniqueTogether']['name']\n            unique_fields = operation['AlterUniqueTogether']['unique_together']\n            unique_constraints[model_name] = set(unique_fields)\n    return unique_constraints\n", "entry_point": "extract_unique_constraints", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34243_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008712", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'AiAliceAlice', 'SomeElection'", "output": "'Sample Election: AiAliceAlice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008713", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'gg'", "output": "'gg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008714", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5042", "output": "{1, 5042, 2, 2521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5041", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008715", "code": "def max_equal_apples(apples):\n    total_apples = sum(apples)\n    if total_apples % len(apples) == 0:\n        return total_apples // len(apples)\n    else:\n        return 0\n", "entry_point": "max_equal_apples", "input": "[7, 7, 7, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66277_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008716", "code": "def calculate_average_score(scores: list) -> float:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 90, 88, 92]", "output": "88.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100039_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008717", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "0, 10, 8", "output": "24.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008718", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 7, 1", "output": "17.142857142857142", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008719", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1,2'", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008720", "code": "import ast\ndef count_package_imports(content, package_name):\n    tree = ast.parse(content)\n    imports_count = 0\n    for node in ast.walk(tree):\n        if isinstance(node, ast.ImportFrom):\n            if node.module and node.module.startswith(package_name):\n                imports_count += len(node.names)\n    return imports_count\n", "entry_point": "count_package_imports", "input": "'', 'some_package'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131189_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008721", "code": "def tomorrow(_):\n    return {i: i**2 for i in range(1, _+1)}\n", "entry_point": "tomorrow", "input": "1", "output": "{1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74523_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008722", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2326", "output": "{1, 2, 1163, 2326}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2325", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008723", "code": "def calculate_max_drawdown_ratio(stock_prices):\n    if not stock_prices:\n        return 0.0\n    peak = stock_prices[0]\n    trough = stock_prices[0]\n    max_drawdown_ratio = 0.0\n    for price in stock_prices:\n        if price > peak:\n            peak = price\n            trough = price\n        elif price < trough:\n            trough = price\n            drawdown = peak - trough\n            drawdown_ratio = drawdown / peak\n            max_drawdown_ratio = max(max_drawdown_ratio, drawdown_ratio)\n    return max_drawdown_ratio\n", "entry_point": "calculate_max_drawdown_ratio", "input": "[50, 100, 90, 80, 74.54545454545455]", "output": "0.2545454545454545", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79546_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008724", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[[5], [6]]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008725", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008726", "code": "def remove_negated_atoms(input_program):\n    rules = input_program.strip().split('\\n')\n    output_program = []\n    for rule in rules:\n        if ':-' in rule and any(literal.startswith('-') for literal in rule.split(':-', 1)[1].split(',')):\n            continue\n        output_program.append(rule)\n    return '\\n'.join(output_program)\n", "entry_point": "remove_negated_atoms", "input": "':-| :--'", "output": "':-| :--'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89987_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008727", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5451", "output": "{1, 3, 69, 5451, 237, 79, 23, 1817}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008728", "code": "def padding_zeroes(result, num_digits: int):\n    str_result = str(result)\n    # Check if the input number contains a decimal point\n    if '.' in str_result:\n        decimal_index = str_result.index('.')\n        decimal_part = str_result[decimal_index + 1:]\n        padding_needed = num_digits - len(decimal_part)\n        str_result += \"0\" * padding_needed\n    else:\n        str_result += '.' + \"0\" * num_digits\n    return str_result[:str_result.index('.') + num_digits + 1]\n", "entry_point": "padding_zeroes", "input": "3.2, 1", "output": "'3.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26190_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8362", "output": "{1, 2, 226, 37, 8362, 74, 113, 4181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008730", "code": "from typing import List\ndef next_greater_element(nums1: List[int], nums2: List[int]) -> List[int]:\n    stack, m = [], {}\n    for n in nums2:\n        while stack and stack[-1] < n:\n            m[stack.pop()] = n\n        stack.append(n)\n    return [m.get(n, -1) for n in nums1]\n", "entry_point": "next_greater_element", "input": "[5, 6, 7, 8, 9, 10, 11, 12], [1, 2, 3, 4]", "output": "[-1, -1, -1, -1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143758_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008731", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5402", "output": "{1, 2, 37, 73, 74, 2701, 146, 5402}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008732", "code": "from typing import Dict\ndef calculate_total_cost(cart: Dict[str, float]) -> float:\n    total_cost = 0.0\n    item_counts = {}\n    for item, price in cart.items():\n        item_counts[item] = item_counts.get(item, 0) + 1\n    for item, count in item_counts.items():\n        if count >= 2:\n            total_cost += price * (count - count // 2)  # Apply discount for each set of 2 or more items\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "{}", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119322_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008733", "code": "import heapq\ndef final_stone_weight(stones):\n    stones = [-val for val in stones]\n    heapq.heapify(stones)\n    while len(stones) > 1:\n        stone1 = -heapq.heappop(stones)\n        stone2 = -heapq.heappop(stones)\n        if stone1 == stone2:\n            continue\n        else:\n            heapq.heappush(stones, -abs(stone1 - stone2))\n    return 0 if len(stones) == 0 else -stones[0]\n", "entry_point": "final_stone_weight", "input": "[2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113070_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008734", "code": "def highest_version_library(theano_version, tensorflow_version, keras_version):\n    def version_tuple(version_str):\n        return tuple(map(int, version_str.split('.')))\n    theano_tuple = version_tuple(theano_version)\n    tensorflow_tuple = version_tuple(tensorflow_version)\n    keras_tuple = version_tuple(keras_version)\n    if tensorflow_tuple > theano_tuple and tensorflow_tuple > keras_tuple:\n        return 'TensorFlow'\n    elif keras_tuple > theano_tuple and keras_tuple > tensorflow_tuple:\n        return 'Keras'\n    else:\n        return 'Theano'\n", "entry_point": "highest_version_library", "input": "'1.2.3', '1.2.2', '1.2.1'", "output": "'Theano'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96884_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008735", "code": "def largest_prime_factor(n):\n    number = n\n    divider = 2\n    while number != 1:\n        if number % divider == 0:\n            number = number // divider\n        else:\n            divider += 1\n    return divider\n", "entry_point": "largest_prime_factor", "input": "307", "output": "307", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139210_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008736", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "2, 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008737", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'odrworldrld'", "output": "{'odrworldrld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008738", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[0, 68, 68, 68, 100]", "output": "68.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92389_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7262", "output": "{1, 2, 7262, 3631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008740", "code": "def lint_text(input_string):\n    errors = []\n    if \"error\" in input_string:\n        errors.append(\"error\")\n    if \"warning\" in input_string:\n        errors.append(\"warning\")\n    return errors\n", "entry_point": "lint_text", "input": "'This is a warning message.'", "output": "['warning']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20385_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008741", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[20, 23]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008742", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 1, 4, 2, 4, 2]", "output": "[2, 5, 6, 6, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008743", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'a9d372s14b'", "output": "{9, 372, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008744", "code": "import re\ndef count_unique_models(file_content: str) -> int:\n    model_names = set()\n    import_regex = r'from\\s+\\w+\\.\\w+\\s+import\\s+(\\w+)'\n    imports = re.findall(import_regex, file_content)\n    for imp in imports:\n        model_name = imp.split('.')[-1]\n        model_names.add(model_name)\n    return len(model_names)\n", "entry_point": "count_unique_models", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23756_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008745", "code": "def categorize_file_diffs(file_diffs):\n    added_files = []\n    deleted_files = []\n    modified_files = []\n    for diff in file_diffs:\n        if diff['type'] == 'added':\n            added_files.append(diff)\n        elif diff['type'] == 'deleted':\n            deleted_files.append(diff)\n        elif diff['type'] == 'modified':\n            modified_files.append(diff)\n    return (added_files, deleted_files, modified_files)\n", "entry_point": "categorize_file_diffs", "input": "[]", "output": "([], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65624_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008746", "code": "def calculate_polygon_area(vertices):\n    if len(vertices) < 3:\n        return 0  # Not a valid polygon\n    area = 0\n    n = len(vertices)\n    x, y = zip(*vertices)\n    for i in range(n):\n        j = (i + 1) % n\n        area += x[i] * y[j] - x[j] * y[i]\n    return abs(area) / 2\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (4, 0), (4, 4), (0, 4)]", "output": "16.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104366_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008747", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'https://ktu.edu.in'", "output": "'<URL>s://ktu.edu.in'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "196", "output": "{1, 2, 98, 196, 4, 7, 14, 49, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt195", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008749", "code": "import ast\nfrom typing import List\ndef check_unnecessary_casts(code: str) -> List[str]:\n    unnecessary_casts = []\n    tree = ast.parse(code)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'cast':\n            if len(node.args) == 2 and isinstance(node.args[1], ast.Name):\n                cast_type = node.args[0].id\n                var_type = node.args[1].id\n                if cast_type == var_type:\n                    line_number = node.lineno\n                    unnecessary_casts.append(f\"Unnecessary cast at line {line_number}\")\n    return unnecessary_casts\n", "entry_point": "check_unnecessary_casts", "input": "'x = 10'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7933_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008750", "code": "def encrypt_text(text: str) -> str:\n    encrypted_chars = []\n    for idx, char in enumerate(text):\n        shift_amount = idx % 26\n        encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_text", "input": "'world'", "output": "'wptoh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24966_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008751", "code": "from typing import List\ndef best_sum(target_sum: int, numbers: List[int]) -> List[int]:\n    table = [None] * (target_sum + 1)\n    table[0] = []\n    for i in range(target_sum + 1):\n        if table[i] is not None:\n            for num in numbers:\n                if i + num <= target_sum:\n                    if table[i + num] is None or len(table[i] + [num]) < len(table[i + num]):\n                        table[i + num] = table[i] + [num]\n    return table[target_sum]\n", "entry_point": "best_sum", "input": "11, [5, 6]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127929_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008752", "code": "def calculate_max_trial_value(trial_values):\n    return max(trial_values)\n", "entry_point": "calculate_max_trial_value", "input": "[10, 15, 20, 25]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15346_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008753", "code": "def GetNote(note_name, scale):\n    midi_val = (scale - 1) * 12  # MIDI value offset based on scale\n    # Dictionary to map note letters to MIDI offsets\n    note_offsets = {'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11}\n    note = note_name[0]\n    if note not in note_offsets:\n        raise ValueError(\"Invalid note name\")\n    midi_val += note_offsets[note]\n    if len(note_name) > 1:\n        modifier = note_name[1]\n        if modifier == 's' or modifier == '#':\n            midi_val += 1\n        else:\n            raise ValueError(\"Invalid note modifier\")\n    if note_name[:2] in ('es', 'e#', 'bs', 'b#'):\n        raise ValueError(\"Invalid note combination\")\n    return midi_val\n", "entry_point": "GetNote", "input": "'b', 3", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24350_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008754", "code": "def is_palindrome_alphanumeric(s: str) -> bool:\n    # Remove non-alphanumeric characters and convert to lowercase\n    alphanumeric_s = ''.join(char.lower() for char in s if char.isalnum())\n    # Two pointers approach to check for palindrome\n    left, right = 0, len(alphanumeric_s) - 1\n    while left < right:\n        if alphanumeric_s[left] != alphanumeric_s[right]:\n            return False\n        left += 1\n        right -= 1\n    return True\n", "entry_point": "is_palindrome_alphanumeric", "input": "'race a car'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10962_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008755", "code": "def calculate_quadrilateral_area(vertices):\n    n = len(vertices)\n    area = 0\n    for i in range(n):\n        j = (i + 1) % n\n        area += vertices[i][0] * vertices[j][1]\n        area -= vertices[j][0] * vertices[i][1]\n    area = abs(area) / 2\n    return area\n", "entry_point": "calculate_quadrilateral_area", "input": "[(0, 0), (3, 0), (3, 4), (0, 4)]", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57770_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008756", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3005", "output": "{601, 1, 5, 3005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3004", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008757", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[2, 4, 4, 5, 3, 3, 6]", "output": "[6, 9, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008758", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "-4", "output": "-40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008759", "code": "import string\ndef extract_unique_words(input_str):\n    translator = str.maketrans('', '', string.punctuation)  # Translator to remove punctuation\n    unique_words = []\n    seen_words = set()\n    for word in input_str.split():\n        cleaned_word = word.translate(translator).lower()\n        if cleaned_word not in seen_words:\n            seen_words.add(cleaned_word)\n            unique_words.append(cleaned_word)\n    return unique_words\n", "entry_point": "extract_unique_words", "input": "'!iishethhaphell??'", "output": "['iishethhaphell']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26247_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008760", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[-1, -2, 2, 4, 1, 0]", "output": "[-1, -2, 2, 4, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008761", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(1, len(lst)):\n        abs_diff_sum += abs(lst[i] - lst[i - 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72973_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008762", "code": "def sum_multiples_of_3_or_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 6, 20]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37729_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008763", "code": "def simulate_game(directions):\n    x, y = 0, 0  # Initial position of the player\n    for direction in directions:\n        if direction == \"UP\":\n            y += 1\n        elif direction == \"DOWN\":\n            y -= 1\n        elif direction == \"LEFT\":\n            x -= 1\n        elif direction == \"RIGHT\":\n            x += 1\n    return (x, y)\n", "entry_point": "simulate_game", "input": "['UP', 'UP', 'UP']", "output": "(0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70245_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008764", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "'Python ppythamming '", "output": "'python_ppythamming_18'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008765", "code": "from typing import List\ndef transform_bytes(input_bytes: List[int]) -> List[int]:\n    MAGIC = b\"\\x60\\x60\\xB0\\x17\"\n    first_magic_byte = MAGIC[0]\n    last_magic_byte = MAGIC[-1]\n    transformed_bytes = []\n    for byte in input_bytes:\n        if byte < first_magic_byte:\n            transformed_bytes.append(first_magic_byte)\n        elif byte > last_magic_byte:\n            transformed_bytes.append(last_magic_byte)\n        else:\n            transformed_bytes.append(byte)\n    return transformed_bytes\n", "entry_point": "transform_bytes", "input": "[50, 80, 90, 250, 255]", "output": "[96, 96, 96, 23, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6591_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008766", "code": "def filter_datasources(datasources, filter_type):\n    filtered_datasources = [ds for ds in datasources if ds.get(\"type\") == filter_type]\n    return filtered_datasources\n", "entry_point": "filter_datasources", "input": "[], 'any_type'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22498_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008767", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "10.0, 115.6138822272", "output": "1156.138822272", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008768", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'wom'", "output": "{'wom': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008769", "code": "import itertools\ndef generate_permutations(input_str):\n    # Generate all permutations of the input string\n    perms = itertools.permutations(input_str)\n    # Convert permutations to a list of strings\n    perm_list = [''.join(perm) for perm in perms]\n    return perm_list\n", "entry_point": "generate_permutations", "input": "'aaa'", "output": "['aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008770", "code": "def extract_major_version(version):\n    first_dot_index = version.index('.')\n    major_version = int(version[:first_dot_index])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'1123.0'", "output": "1123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40723_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008771", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 2, 2, 4, 5, 7, 5, 1, 2]", "output": "[1, 4, 4, 16, 125, 343, 125, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008772", "code": "def password_strength_checker(password):\n    score = 0\n    # Check length of the password\n    score += len(password)\n    # Check for uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for special characters\n    special_characters = set('!@#$%^&*()_+-=[]{}|;:,.<>?')\n    if any(char in special_characters for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'A1b2345'", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26515_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008773", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5123", "output": "{1, 5123, 109, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008774", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size = sum(file_sizes)\n    return total_size // 1024\n", "entry_point": "total_size_in_kb", "input": "[10240, 10240, 1024]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13519_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3461", "output": "{1, 3461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008776", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "-1, 0", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008777", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5675", "output": "{1, 227, 5, 5675, 1135, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5674", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008778", "code": "ONE_HOUR = 3600\ndef hours_ago(delta_seconds: int) -> str:\n    hours = delta_seconds // ONE_HOUR\n    return \"over {} hours ago\".format(hours)\n", "entry_point": "hours_ago", "input": "10800", "output": "'over 3 hours ago'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47586_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008779", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[10, 14, 20, 15, 15, 8], 14", "output": "[14, 20, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008780", "code": "def largest_rectangle_area(height):\n    stack = []\n    max_area = 0\n    height.append(0)  # Append a zero height bar to handle the case when all bars are in increasing order\n    for i in range(len(height)):\n        while stack and height[i] < height[stack[-1]]:\n            h = height[stack.pop()]\n            w = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, h * w)\n        stack.append(i)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[5, 5, 1, 2]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95511_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008781", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "3.145, 2", "output": "3.14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4652", "output": "{1, 2, 4, 1163, 4652, 2326}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4651", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008783", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'unknown_dataset', 225", "output": "225", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008784", "code": "SIMAPRO_TECHNOSPHERE = {\n    \"Avoided products\",\n    \"Electricity/heat\",\n    \"Materials/fuels\",\n    \"Waste to treatment\",\n}\nSIMAPRO_PRODUCTS = {\"Products\", \"Waste treatment\"}\ndef categorize_items(items):\n    techosphere_items = set()\n    product_items = set()\n    for item in items:\n        if item in SIMAPRO_TECHNOSPHERE:\n            techosphere_items.add(item)\n        if item in SIMAPRO_PRODUCTS:\n            product_items.add(item)\n    return techosphere_items, product_items\n", "entry_point": "categorize_items", "input": "[]", "output": "(set(), set())", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67197_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6965", "output": "{1, 995, 35, 5, 7, 199, 1393, 6965}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008786", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "'He on ot? equitut // This is a comment'", "output": "'heonot?equitut'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008787", "code": "from typing import List\ndef sum_of_powers(numbers: List[int], power: int) -> int:\n    result = 0\n    for num in numbers:\n        result += num ** power\n    return result\n", "entry_point": "sum_of_powers", "input": "[99], 1", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38539_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008788", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[20, 36, 37, 90, 40]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008789", "code": "from typing import List, Tuple\nfrom numbers import Real\ndef find_unique_pairs(numbers: List[Real], target: Real) -> List[Tuple[Real, Real]]:\n    unique_pairs = set()\n    complements = set()\n    for num in numbers:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[2, 3, 4, 5], 7", "output": "[(2, 5), (3, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128394_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008790", "code": "def count_resource_changes(resource_changes):\n    action_counts = {}\n    for change in resource_changes:\n        action = change[\"Action\"]\n        action_counts[action] = action_counts.get(action, 0) + 1\n    return action_counts\n", "entry_point": "count_resource_changes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11481_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008791", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max if second_max != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[5, 7, 8]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12088_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008792", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1601", "output": "{1601, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008793", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[6, 5, 2, 5, 6, 8, 6, 5, 6]", "output": "[2, 6, 6, 6, 6, 8, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008794", "code": "def series_sum(x, n):\n    sum_terms = 0\n    term = x\n    denominator = 1 - x**2\n    for i in range(1, n+1):\n        sum_terms += (2 * term) / denominator\n        term *= x**2  # Update term for the next iteration\n    return sum_terms\n", "entry_point": "series_sum", "input": "0.1, 10", "output": "0.20406081012141625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18869_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008795", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 9, 6, 8, 2, 4, 7]", "output": "[7, 10, 8, 11, 6, 9, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008796", "code": "def filter_aquariums_by_type(aquariums, valid_type):\n    filtered_aquariums = []\n    for aquarium in aquariums:\n        if aquarium.get('type') == valid_type:\n            filtered_aquariums.append(aquarium)\n    return filtered_aquariums\n", "entry_point": "filter_aquariums_by_type", "input": "[], 'freshwater'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15946_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008797", "code": "def gene_synonyms(feature: dict) -> list:\n    result = []\n    synonyms = feature.get(\"qualifiers\", {}).get(\"gene_synonym\", [])\n    for synonym in synonyms:\n        result.extend(synonym.split(\"; \"))\n    return result\n", "entry_point": "gene_synonyms", "input": "{'qualifiers': {}}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148745_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008798", "code": "def extract_library_versions(library_info_list):\n    library_versions = {}\n    for lib_info in library_info_list:\n        name, version = lib_info.split('/')\n        if name in library_versions:\n            # Compare versions to keep the latest one\n            if version > library_versions[name]:\n                library_versions[name] = version\n        else:\n            library_versions[name] = version\n    return library_versions\n", "entry_point": "extract_library_versions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93023_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008799", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6682", "output": "{1, 2, 514, 26, 257, 13, 3341, 6682}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008800", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "14", "output": "377", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008801", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 4, 6, 2, 4, 1, 1]", "output": "[4, 12, 6, 16, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008802", "code": "def correct_typo(code_snippet):\n    corrected_code = code_snippet.replace('install_requireent', 'install_requires')\n    return corrected_code\n", "entry_point": "correct_typo", "input": "'set_requirs'", "output": "'set_requirs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26763_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008803", "code": "def max_sum_non_adjacent_parity(lst):\n    odd_sum = even_sum = 0\n    for num in lst:\n        if num % 2 == 0:  # Even number\n            even_sum, odd_sum = max(even_sum, odd_sum), even_sum + num\n        else:  # Odd number\n            even_sum, odd_sum = max(even_sum, odd_sum + num), odd_sum\n    return max(odd_sum, even_sum)\n", "entry_point": "max_sum_non_adjacent_parity", "input": "[4, 0, 6]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85540_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008804", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1922", "output": "{1, 1922, 2, 961, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1921", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008805", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'h'", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008806", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[3, 0, 0, 2, -1, 1, 4, 4]", "output": "[3, 0, 2, -1, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008807", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7498", "output": "{1, 2, 163, 3749, 326, 7498, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008808", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[1, 3, 5, 4, 5, 9, 10, 1]", "output": "[10, 9, 5, 5, 4, 3, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008809", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average", "input": "[85, 90, 95]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114673_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8126", "output": "{1, 2, 34, 478, 239, 17, 8126, 4063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2134", "output": "{1, 2, 194, 97, 11, 1067, 2134, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2133", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3901", "output": "{1, 83, 3901, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008813", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'  worhhlohlld  '", "output": "['worhhlohlld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008814", "code": "def is_spy_number(n):\n    str_num = str(n)\n    sum_of_digits = 0\n    product_of_digits = 1\n    for digit in str_num:\n        digit_int = int(digit)\n        sum_of_digits += digit_int\n        product_of_digits *= digit_int\n    if sum_of_digits == product_of_digits:\n        return True\n    else:\n        return False\n", "entry_point": "is_spy_number", "input": "10", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105904_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008815", "code": "from typing import Union, Dict, List\ndef _get_repr(item, path='', result=None) -> Dict[str, Union[str, Dict, List]]:\n    if result is None:\n        result = {}\n    if isinstance(item, dict):\n        for key, value in item.items():\n            _get_repr(value, f\"{path}.{key}\" if path else key, result)\n    elif isinstance(item, list):\n        for idx, value in enumerate(item):\n            _get_repr(value, f\"{path}.{idx}\", result)\n    else:\n        result[path] = getattr(item, '_repr', item)\n    return result\n", "entry_point": "_get_repr", "input": "{'name': 'Alice'}", "output": "{'name': 'Alice'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112191_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008816", "code": "def calculate_circle_area(radius):\n    # Approximate the value of \u03c0 as 3.14159\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "9.0", "output": "254.46878999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46985_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008817", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[3, 4, 4, 4, 4, 4, 2, 3]", "output": "[7, 8, 8, 8, 8, 6, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008818", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[7, 1, 8, 3, 9, 2]", "output": "[7, 1, 8, 3, 9, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7444", "output": "{1, 2, 4, 1861, 3722, 7444}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7443", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008820", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "353", "output": "{1, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008821", "code": "def total_characters(lst):\n    total_count = 0\n    for item in lst:\n        if isinstance(item, str):\n            total_count += len(item)\n        elif isinstance(item, list):\n            total_count += total_characters(item)\n    return total_count\n", "entry_point": "total_characters", "input": "['abcdefghij']", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59415_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008822", "code": "def generate_pascals_triangle(numRows):\n    result = []\n    for i in range(numRows):\n        row = [1] * (i + 1)\n        for j in range(1, len(row) - 1):\n            row[j] = result[i - 1][j - 1] + result[i - 1][j]\n        result.append(row)\n    return result\n", "entry_point": "generate_pascals_triangle", "input": "4", "output": "[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115665_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2757", "output": "{1, 3, 2757, 919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008824", "code": "def calculate_sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum_multiples", "input": "10", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15183_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008825", "code": "def first_non_repeating_char_index(s):\n    char_count = {}\n    # Populate dictionary with character counts\n    for char in s:\n        if char not in char_count:\n            char_count[char] = 1\n        else:\n            char_count[char] += 1\n    # Find the index of the first non-repeating character\n    for idx, char in enumerate(s):\n        if char_count[char] == 1:\n            return idx\n    return -1\n", "entry_point": "first_non_repeating_char_index", "input": "'a'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11467_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008826", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4857", "output": "{1, 1619, 3, 4857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008827", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "6, 6", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7633", "output": "{1, 7633, 449, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7632", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008829", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[1, 3, 2, 4, 4, 5, 1, 1]", "output": "[1, 4, 6, 10, 14, 19, 20, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008830", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 62", "output": "'62%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008831", "code": "from typing import List\ndef degree(poly: List[int]) -> int:\n    deg = 0\n    for i in range(len(poly) - 1, -1, -1):\n        if poly[i] != 0:\n            deg = i\n            break\n    return deg\n", "entry_point": "degree", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116666_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008832", "code": "def text_pair_classification(text1, text2):\n    text1 = text1.lower()\n    text2 = text2.lower()\n    words1 = set(text1.split())\n    words2 = set(text2.split())\n    common_words = words1.intersection(words2)\n    if common_words:\n        return \"Similar\"\n    elif not common_words and len(words1) == len(words2):\n        return \"Neutral\"\n    else:\n        return \"Different\"\n", "entry_point": "text_pair_classification", "input": "'Hello world', 'Hello everyone'", "output": "'Similar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16018_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008833", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008834", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[102, 101, 79, 79, 60, 45]", "output": "[102, 101, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23327_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008835", "code": "def shortest_distance_to_char(S, C):\n    cp = [i for i, s in enumerate(S) if s == C]\n    result = []\n    for i, s in enumerate(S):\n        result.append(min(abs(i - x) for x in cp))\n    return result\n", "entry_point": "shortest_distance_to_char", "input": "'abcaabca', 'c'", "output": "[2, 1, 0, 1, 2, 1, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98860_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008836", "code": "def extract_top_module(module_path: str) -> str:\n    # Split the module_path string by dots\n    modules = module_path.split('.')\n    # Return the top-level module name\n    return modules[0]\n", "entry_point": "extract_top_module", "input": "'tr'", "output": "'tr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40470_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008837", "code": "def calculate_reward(piece_past_movements, rewards=None):\n    rewards = rewards or {1: 0.8, 2: 0.9, 3: 1, 4: 0.9, 5: 0.5, 6: 0.25}\n    n_skips = 0\n    for movement in piece_past_movements:\n        if abs(movement) > 1:\n            n_skips += 1\n    score = rewards.get(n_skips, 0)\n    return score\n", "entry_point": "calculate_reward", "input": "[0.5, 1.0, 2.5]", "output": "0.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67309_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008838", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4057", "output": "{1, 4057}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008839", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 10)\n        elif num % 2 != 0:\n            processed_list.append(num - 5)\n        if num % 5 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[8, 4, 19, 6, 19, 8]", "output": "[18, 14, 14, 16, 14, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71116_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008840", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4286", "output": "{1, 2, 4286, 2143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008841", "code": "from typing import List\ndef min_classrooms(students: List[int]) -> int:\n    classrooms = 0\n    current_students = 0\n    for num_students in students:\n        if current_students + num_students <= 30:\n            current_students += num_students\n        else:\n            classrooms += 1\n            current_students = num_students\n    if current_students > 0:\n        classrooms += 1\n    return classrooms\n", "entry_point": "min_classrooms", "input": "[30, 30, 30, 30, 30, 30, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149205_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008842", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "60, 20", "output": "4191844505805495", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008843", "code": "def resolve_view(url: str) -> str:\n    url_patterns = [\n        ('add/', 'SlackAuthView.as_view(auth_type=\"add\")', 'slack_add'),\n        ('signin/', 'SlackAuthView.as_view(auth_type=\"signin\")', 'slack_signin'),\n        ('add-success/', 'DefaultAddSuccessView.as_view()', 'slack_add_success'),\n        ('signin-success/', 'DefaultSigninSuccessView.as_view()', 'slack_signin_success')\n    ]\n    for pattern, view, name in url_patterns:\n        if url.startswith(pattern):\n            return name\n    return 'Not Found'\n", "entry_point": "resolve_view", "input": "'add/item'", "output": "'slack_add'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141769_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008844", "code": "def count_common_substrings(s1, s2):\n    g1 = {}\n    for i in range(1, len(s1)):\n        g1[s1[i-1: i+1]] = g1.get(s1[i-1: i+1], 0) + 1\n    g2 = set()\n    for i in range(1, len(s2)):\n        g2.add(s2[i-1: i+1])\n    common_substrings = frozenset(g1.keys()) & g2\n    total_count = sum([g1[g] for g in common_substrings])\n    return total_count\n", "entry_point": "count_common_substrings", "input": "'ababc', 'abc'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53680_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008845", "code": "def unicode_converter(input_string):\n    result = \"\"\n    for char in input_string:\n        code_point = ord(char)\n        result += f\"\\\\u{format(code_point, 'x')}\"\n    return result\n", "entry_point": "unicode_converter", "input": "'hell'", "output": "'\\\\u68\\\\u65\\\\u6c\\\\u6c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4025_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008846", "code": "def extract_characters(input_string, slice_obj):\n    start, stop, step = slice_obj.indices(len(input_string))\n    result = [input_string[i] for i in range(start, stop, step)]\n    return result\n", "entry_point": "extract_characters", "input": "'Programming', slice(0, 5, 1)", "output": "['P', 'r', 'o', 'g', 'r']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83319_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008847", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7783", "output": "{1, 43, 181, 7783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008848", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "-4, -4", "output": "('0', '-9')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008849", "code": "from typing import List\ndef max_loot_circle(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob_range(start, end):\n        max_loot = [0, nums[start]]\n        for i in range(start+1, end+1):\n            max_loot.append(max(max_loot[-1], max_loot[-2] + nums[i]))\n        return max_loot[-1]\n    return max(rob_range(0, len(nums)-2), rob_range(1, len(nums)-1))\n", "entry_point": "max_loot_circle", "input": "[2, 1, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119426_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "284", "output": "{1, 2, 4, 71, 142, 284}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt283", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008851", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'HEee HELd'", "output": "'HeEe HeLd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008852", "code": "def extract_type_aliases(type_aliases):\n    alias_mapping = {}\n    for i in range(0, len(type_aliases), 2):\n        alias_name, base_type = type_aliases[i].split('=')\n        alias_mapping[alias_name.strip()] = base_type.strip()\n    return alias_mapping\n", "entry_point": "extract_type_aliases", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128756_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008853", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[1, 1, 7, 2, 3, 5, 6, 6]", "output": "[1, 7, 2, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008854", "code": "def play_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    if player1_score > player2_score:\n        return \"Player 1 wins\"\n    elif player2_score > player1_score:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "play_card_game", "input": "[5, 6, 7], [3, 2, 4]", "output": "'Player 1 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147223_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008855", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "0.2", "output": "'0.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008856", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[2, 3, 5, 3, 1, 2, 2, 1]", "output": "[2, 5, 10, 13, 14, 16, 18, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008857", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "133", "output": "'2:13'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008858", "code": "import json\ndef revert_changes(request, dictionary):\n    if '_old_bindings_data' in request and 'srpm_name_mapping' in request['_old_bindings_data']:\n        original_key, original_value = request['_old_bindings_data']['srpm_name_mapping']\n        original_value = json.loads(original_value)\n        if original_key in dictionary:\n            dictionary[original_key] = original_value\n    return dictionary\n", "entry_point": "revert_changes", "input": "{'some_other_key': 'value'}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100812_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008859", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "'FFFFFFFFFF'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008860", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1146", "output": "{1, 2, 3, 6, 1146, 573, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008861", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'W,T.h,r.l,d'", "output": "'WThrld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008862", "code": "def sum_divisible_by_3_and_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 45]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114364_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7915", "output": "{1, 7915, 5, 1583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7914", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008864", "code": "def parse_requirements(requirements_list):\n    parsed_requirements = {}\n    for requirement in requirements_list:\n        package_name, version_constraint = requirement.split('=', 1)\n        parsed_requirements[package_name.strip()] = version_constraint.strip()\n    return parsed_requirements\n", "entry_point": "parse_requirements", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100003_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008865", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1514", "output": "{1, 1514, 2, 757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008866", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 2, 5]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126564_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008867", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'2.9.100'", "output": "'2.9.101'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9293", "output": "{1, 9293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008869", "code": "def extract_file_extension(file_path):\n    # Find the index of the last period '.' character in the file path\n    last_dot_index = file_path.rfind('.')\n    # Check if a period '.' was found and it is not the last character in the string\n    if last_dot_index != -1 and last_dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character immediately after the last period\n        file_extension = file_path[last_dot_index + 1:]\n        return file_extension\n    else:\n        # If no extension found or the period is the last character, return None\n        return None\n", "entry_point": "extract_file_extension", "input": "'example.pdff'", "output": "'pdff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51602_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3067", "output": "{1, 3067}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008871", "code": "def find_first_10_digits_sum(numbers_list):\n    # Convert strings to integers and sum them up\n    total_sum = sum(int(num) for num in numbers_list)\n    # Get the first 10 digits of the total sum\n    first_10_digits = str(total_sum)[:10]\n    return first_10_digits\n", "entry_point": "find_first_10_digits_sum", "input": "['1129893', '0']", "output": "'1129893'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7323_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008872", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 91, 93, 85, 88, 90]", "output": "[93, 91, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008873", "code": "def complex_enclosed_types(enclosed_types, prot):\n    filtered_types = [m['name'] for m in enclosed_types if m['prot'] == prot]\n    return filtered_types\n", "entry_point": "complex_enclosed_types", "input": "[], 'any_value'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43232_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008874", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8809", "output": "{1, 383, 8809, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008875", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'oDoe SmhiJ'", "output": "('oDoe', 'SmhiJ')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008876", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[5, 5, 6, 4, 6, 6, 6], 4, 4", "output": "[36, 36, 40, 32, 40, 40, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008877", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "20, 'mode', 0", "output": "{'response': 'InvalidPin', 'pin': 20}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008878", "code": "def reverse_words(text):\n    words = text.split()  # Split the input text into individual words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word using slicing\n    return ' '.join(reversed_words)  # Join the reversed words back into a single string\n", "entry_point": "reverse_words", "input": "'hh'", "output": "'hh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145784_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008879", "code": "def sum_of_squares_even(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_squares_even", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10286_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008880", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "65334.34, '0.000000'", "output": "'6.533434E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008881", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9557", "output": "{1, 19, 9557, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008882", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'add'", "output": "'dd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008883", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8971", "output": "{1, 8971}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5239", "output": "{1, 169, 13, 403, 5239, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6619", "output": "{1, 6619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008886", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "30, 3", "output": "4060", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008887", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.2.0'", "output": "(3, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008888", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "0, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8649", "output": "{1, 961, 2883, 3, 8649, 9, 279, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008890", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[42, 44]", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008891", "code": "def dna_to_rna(dna_strand):\n    pairs = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}\n    rna_complement = ''.join(pairs[n] for n in dna_strand)\n    return rna_complement\n", "entry_point": "dna_to_rna", "input": "'GGCGGCTTT'", "output": "'CCGCCGAAA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39038_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008892", "code": "import importlib\ndef import_modules_from_package(package_name):\n    imported_modules = []\n    try:\n        package = importlib.import_module(package_name)\n        for module_name in dir(package):\n            if not module_name.startswith('__'):\n                try:\n                    module = importlib.import_module(f\"{package_name}.{module_name}\")\n                    imported_modules.append(module_name)\n                except ModuleNotFoundError:\n                    pass\n    except ModuleNotFoundError:\n        pass\n    return imported_modules\n", "entry_point": "import_modules_from_package", "input": "'non_existent_package'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109563_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008893", "code": "def discover_profiles(connection_profiles, target_data_object):\n    accessible_profiles = []\n    for profile, data_objects in connection_profiles.items():\n        if target_data_object in data_objects:\n            accessible_profiles.append(profile)\n    return accessible_profiles\n", "entry_point": "discover_profiles", "input": "{}, 'any_object'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63215_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008894", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[5, 3]", "output": "('Rel Days 5 to 3', 'reldays5_3')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008895", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 73.33333333333333, 80]", "output": "73.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16456_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008896", "code": "def can_jump_over_walls(heights):\n    max_jump_height = 0\n    for height in heights:\n        if height < max_jump_height:\n            return 'No'\n        max_jump_height = max(max_jump_height, height - 1)\n    return 'Yes'\n", "entry_point": "can_jump_over_walls", "input": "[0, 0]", "output": "'Yes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136701_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008897", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "'URPERMISSION: L:'", "output": "{'URPERMISSION': 'L:'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008898", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'filefile'", "output": "'filefile_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008899", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9021", "output": "{1, 97, 3, 291, 93, 3007, 9021, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9020", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008900", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[5, 6, 3, 5, 6, -1]", "output": "[5, 11, 14, 19, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008901", "code": "def replace_placeholders(template, values):\n    for key, value in values.items():\n        placeholder = \"{{\" + key + \"}}\"\n        template = template.replace(placeholder, str(value))\n    return template\n", "entry_point": "replace_placeholders", "input": "'{{placeholder}})', {'placeholder': ''}", "output": "')'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54757_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8926", "output": "{1, 2, 8926, 4463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008903", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5692", "output": "{1, 2, 4, 1423, 5692, 2846}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5691", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008904", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'RRRRRRRRUUU', 9, 4", "output": "(8, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008905", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[3, 1, 4, 2, 4, 5]", "output": "[4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008906", "code": "def parse_version(version_str):\n    parts = version_str.split('.')\n    if len(parts) != 3:\n        return None\n    try:\n        major = int(parts[0])\n        minor = int(parts[1])\n        patch = int(parts[2])\n        return major, minor, patch\n    except ValueError:\n        return None\n", "entry_point": "parse_version", "input": "'3.144.2'", "output": "(3, 144, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52090_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008907", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[30]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008908", "code": "def compress_text(text: str) -> str:\n    if not text:\n        return \"\"\n    compressed_text = \"\"\n    current_char = text[0]\n    char_count = 1\n    for i in range(1, len(text)):\n        if text[i] == current_char:\n            char_count += 1\n        else:\n            compressed_text += current_char + str(char_count)\n            current_char = text[i]\n            char_count = 1\n    compressed_text += current_char + str(char_count)\n    return compressed_text\n", "entry_point": "compress_text", "input": "'aaabcc'", "output": "'a3b1c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148970_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1526", "output": "{1, 2, 7, 109, 14, 1526, 218, 763}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008910", "code": "def calculate_total_iterations(runner, optimizer_config):\n    max_epochs = runner.get('max_epochs', 1)  # Default to 1 epoch if 'max_epochs' key is missing\n    update_interval = optimizer_config.get('update_interval', 1)  # Default to 1 update if 'update_interval' key is missing\n    total_iterations = max_epochs * update_interval\n    return total_iterations\n", "entry_point": "calculate_total_iterations", "input": "{'max_epochs': 1}, {'update_interval': 1}", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4502_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008911", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'qx', 3", "output": "[67, 95]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008912", "code": "def get_model_details(model_name):\n    DEPTH_MODELS = ('alexnet', 'resnet18', 'resnet50', 'vgg', 'sqznet')\n    DEPTH_DIMS = {'alexnet': 4096, 'resnet18': 512, 'resnet50': 2048, 'vgg': 4096, 'sqznet': 1024}\n    DEPTH_CHANNELS = {'alexnet': 256, 'resnet18': 256, 'resnet50': 1024, 'vgg': 512, 'sqznet': 512}\n    if model_name in DEPTH_MODELS:\n        return DEPTH_DIMS[model_name], DEPTH_CHANNELS[model_name]\n    else:\n        return \"Model not recognized\"\n", "entry_point": "get_model_details", "input": "'invalid_model'", "output": "'Model not recognized'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125406_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008913", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 0, 0, 21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008914", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 500.0)]", "output": "500.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008915", "code": "def count_coma_warriors(health_points):\n    coma_warriors = 0\n    for health in health_points:\n        if health == 0:\n            coma_warriors += 1\n    return coma_warriors\n", "entry_point": "count_coma_warriors", "input": "[0, 5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115294_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008916", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'some/path/to/pp'", "output": "'pp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008917", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[8, 0, 10, 0, 10]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9009_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "642", "output": "{321, 1, 642, 2, 3, 6, 107, 214}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008919", "code": "import re\ndef word_frequency(input_list):\n    word_freq = {}\n    for word in input_list:\n        # Convert word to lowercase and remove non-alphabetic characters\n        cleaned_word = re.sub(r'[^a-zA-Z]', '', word.lower())\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "['hello!', 'Hello', 'hello', 'world', 'world!']", "output": "{'hello': 3, 'world': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75241_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008920", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 1, 2, 3, 3, 3, 5, 4, 4]", "output": "[4, 5, 7, 6, 6, 6, 7, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008921", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4321", "output": "{1, 29, 4321, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008922", "code": "import re\ndef contains_word(author_last_name, author_first_name, bibliographic_entry):\n    # Extract author names from the bibliographic entry\n    author_names = re.findall(r'[A-Z][a-z]*', bibliographic_entry)\n    # Check if both last name and first name are present in the extracted author names\n    return author_last_name in author_names and author_first_name in author_names\n", "entry_point": "contains_word", "input": "'Smith', 'John', 'The Adventures of Sherlock Holmes'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9245_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008923", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(2, 0, 0)", "output": "'2.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008924", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8927", "output": "{1, 113, 79, 8927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008925", "code": "def encrypt_documents(documents, encryption_key):\n    def encrypt_text(text):\n        encrypted_text = \"\"\n        for char in text:\n            if char.isalpha():\n                base = ord('A') if char.isupper() else ord('a')\n                encrypted_char = chr((ord(char) - base + encryption_key) % 26 + base)\n                encrypted_text += encrypted_char\n            else:\n                encrypted_text += char\n        return encrypted_text\n    encrypted_documents = []\n    for doc in documents:\n        encrypted_doc = {\"document_text\": encrypt_text(doc[\"document_text\"])}\n        encrypted_documents.append(encrypted_doc)\n    return encrypted_documents\n", "entry_point": "encrypt_documents", "input": "[], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64248_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008926", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 10, 20, 30]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008927", "code": "from typing import List\nimport itertools\ndef count_combinations(nums: List[int], length: int) -> int:\n    # Generate all combinations of the given length from the input list\n    all_combinations = list(itertools.combinations(nums, length))\n    # Return the total number of unique combinations\n    return len(all_combinations)\n", "entry_point": "count_combinations", "input": "[1, 2, 3, 4], 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6198_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008928", "code": "def longest_consecutive_sequence(char_stream):\n    current_length = 0\n    longest_length = 0\n    for char in char_stream:\n        if char.isalpha():\n            current_length += 1\n        else:\n            longest_length = max(longest_length, current_length)\n            current_length = 0\n    longest_length = max(longest_length, current_length)  # Check for the last sequence\n    return longest_length\n", "entry_point": "longest_consecutive_sequence", "input": "'abcdefghijklmn'", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83866_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008929", "code": "import string\ndef encrypt_message(message, key):\n    accepted_keys = string.ascii_uppercase\n    encrypted_message = \"\"\n    # Validate the key\n    key_comp = key.replace(\" \", \"\")\n    if not set(key_comp).issubset(set(accepted_keys)):\n        raise ValueError(\"Key contains special characters or integers that are not acceptable values\")\n    # Repeat the key cyclically to match the length of the message\n    key = key * (len(message) // len(key)) + key[:len(message) % len(key)]\n    # Encrypt the message using One-Time Pad encryption\n    for m, k in zip(message, key):\n        encrypted_char = chr(((ord(m) - 65) + (ord(k) - 65)) % 26 + 65)\n        encrypted_message += encrypted_char\n    return encrypted_message\n", "entry_point": "encrypt_message", "input": "'VVV', 'A'", "output": "'VVV'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111246_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008930", "code": "def sum_of_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_even_numbers", "input": "[10, 12, 4, 8]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148789_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008931", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[85, 80, 80, 80, 70], 4", "output": "81.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59091_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008932", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 1, 6]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75875_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008933", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[4, 6, 1, 1, 3]", "output": "[4, 6, 1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008934", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[1620, 1]", "output": "'0:27:01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008935", "code": "from typing import Tuple\ndef split_with_escape(input_str: str, separator: str) -> Tuple[str, str]:\n    key = ''\n    val = ''\n    escaped = False\n    for i in range(len(input_str)):\n        if input_str[i] == '\\\\' and not escaped:\n            escaped = True\n        elif input_str[i] == separator and not escaped:\n            val = input_str[i+1:]\n            break\n        else:\n            if escaped:\n                key += input_str[i]\n                escaped = False\n            else:\n                key += input_str[i]\n    return key, val\n", "entry_point": "split_with_escape", "input": "'z', '#'", "output": "('z', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12144_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4822", "output": "{1, 2, 2411, 4822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008937", "code": "import math\ndef normalized_entropy(probabilities):\n    entropy = -sum(p * math.log(p) for p in probabilities if p != 0)\n    total_events = len(probabilities)\n    normalized_entropy = entropy / math.log(total_events)\n    return normalized_entropy\n", "entry_point": "normalized_entropy", "input": "[0.3, 0.5, 0.2]", "output": "0.9372305632161295", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24832_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008938", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'device: , n_gpu: 2'", "output": "{'device': '', 'n_gpu': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008939", "code": "def unique(sequence):\n    if len(sequence) == len(set(sequence)):\n        return True\n    else:\n        return False\n", "entry_point": "unique", "input": "[1, 2, 2]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65143_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "102", "output": "{1, 2, 3, 34, 102, 6, 17, 51}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008941", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[2, 2, 2, 3]", "output": "[2, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt30", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008942", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[8, 10, 10, 10, 10, 4, 9, 4, 9]", "output": "[64, 100, 100, 100, 100, 16, 729, 16, 729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008943", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[5, 8, 2, 1]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008944", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1561", "output": "{1, 223, 1561, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008945", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'ellle', 1", "output": "'fmmmf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008946", "code": "from typing import List, Tuple\ndef process_numbers(numbers: List[int]) -> Tuple[int, int]:\n    count = 0\n    total_sum = 0\n    for num in numbers:\n        count += 1\n        total_sum += num\n        if num == 999:\n            break\n    return count - 1, total_sum - 999  # Adjusting count and sum for excluding the terminating 999\n", "entry_point": "process_numbers", "input": "[10, 20, 17, 999]", "output": "(3, 47)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24887_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008947", "code": "from typing import List\ndef count_scrolls(scroll_heights: List[int]) -> int:\n    scroll_count = 0\n    for i in range(1, len(scroll_heights)):\n        if scroll_heights[i] > scroll_heights[i - 1]:\n            scroll_count += 1\n    return scroll_count\n", "entry_point": "count_scrolls", "input": "[1, 2, 3, 4, 5, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70066_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008948", "code": "def decode_string(pattern):\n    result = \"\"\n    inside_underscore = False\n    underscore_chars = []\n    for char in pattern:\n        if char == '_':\n            if inside_underscore:\n                result += ''.join(reversed(underscore_chars))\n                underscore_chars = []\n            inside_underscore = not inside_underscore\n        else:\n            if inside_underscore:\n                underscore_chars.append(char)\n            else:\n                result += char\n    if underscore_chars:\n        result += ''.join(reversed(underscore_chars))\n    return result\n", "entry_point": "decode_string", "input": "'abc_idea_'", "output": "'abcaedi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114886_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008949", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8959", "output": "{1, 289, 527, 17, 8959, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008950", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'C-12'", "output": "'C'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008951", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[2, 2, 2, 2, 2, 2]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008952", "code": "def analyze_list(lst):\n    total = len(lst)\n    even_count = sum(1 for num in lst if num % 2 == 0)\n    total_sum = sum(lst)\n    return {'Total': total, 'Even': even_count, 'Sum': total_sum}\n", "entry_point": "analyze_list", "input": "[2, 4, 1, 1, 3, 5, 5, 5]", "output": "{'Total': 8, 'Even': 2, 'Sum': 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93656_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008953", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "14, 1", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008954", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5983", "output": "{1, 31, 193, 5983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "895", "output": "{1, 179, 5, 895}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008956", "code": "def evaluate_expressions(expressions):\n    results = []\n    for exp in expressions:\n        result = eval(exp)\n        results.append(int(result))\n    return results\n", "entry_point": "evaluate_expressions", "input": "['2 + 4', '3 + 4', '8 + 8']", "output": "[6, 7, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8684_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008957", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'ussl=ues,,'", "output": "{'ussl': 'ues', '': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008958", "code": "import re\ndef extract_field_details(class_fields):\n    field_details = {}\n    for field_definition in class_fields:\n        match = re.match(r\"(\\w+)\\s*=\\s*fields\\.(\\w+)\\((.*?)\\)\", field_definition)\n        if match:\n            field_name = match.group(1)\n            field_type = match.group(2)\n            additional_info = match.group(3).strip() if match.group(3) else None\n            field_details[field_name] = (field_type, additional_info)\n    return field_details\n", "entry_point": "extract_field_details", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104149_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008959", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[2, 3, 2, 4, 7, 6, 6], 7", "output": "[[2, 3, 2, 4, 7, 6, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008960", "code": "def correct_typo(code_snippet):\n    corrected_code = code_snippet.replace('install_requireent', 'install_requires')\n    return corrected_code\n", "entry_point": "correct_typo", "input": "':rea_e:'", "output": "':rea_e:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26763_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008961", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 7, 11, 9, 3]", "output": "[7, 8, 13, 12, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008962", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    new_list = []\n    for i in range(len(lst) - 1):\n        new_list.append(lst[i] + lst[i + 1])\n    new_list.append(lst[-1] + lst[0])\n    return new_list\n", "entry_point": "process_list", "input": "[1, 2, 2, 5, 2, 3, 1, 3]", "output": "[3, 4, 7, 7, 5, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64952_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008963", "code": "def prepare_data(phase):\n    if phase == 'train':\n        print(f\"Preparing data for training phase...\")\n        return {'train': [1, 2, 3, 4, 5]}\n    elif phase == 'test':\n        print(f\"Preparing data for testing phase...\")\n        return {'test': ['a', 'b', 'c', 'd', 'e']}\n    elif phase == 'valid':\n        print(f\"Preparing data for validation phase...\")\n        return {'valid': ['apple', 'banana', 'cherry', 'date', 'elderberry']}\n    else:\n        print(f\"Invalid phase: {phase}. Please provide 'train', 'test', or 'valid'.\")\n", "entry_point": "prepare_data", "input": "'test'", "output": "{'test': ['a', 'b', 'c', 'd', 'e']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66855_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6011", "output": "{1, 6011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008965", "code": "def dechiffrer(morse_code):\n    morse_dict = {\n        '.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D', '.': 'E',\n        '..-.': 'F', '--.': 'G', '....': 'H', '..': 'I', '.---': 'J',\n        '-.-': 'K', '.-..': 'L', '--': 'M', '-.': 'N', '---': 'O',\n        '.--.': 'P', '--.-': 'Q', '.-.': 'R', '...': 'S', '-': 'T',\n        '..-': 'U', '...-': 'V', '.--': 'W', '-..-': 'X', '-.--': 'Y',\n        '--..': 'Z', '/': ' '\n    }\n    decoded_message = \"\"\n    words = morse_code.split('/')\n    for word in words:\n        characters = word.split()\n        for char in characters:\n            if char in morse_dict:\n                decoded_message += morse_dict[char]\n        decoded_message += ' '\n    return decoded_message.strip()\n", "entry_point": "dechiffrer", "input": "'.-.'", "output": "'R'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31381_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008966", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'example/1_45'", "output": "((1, 45), 'example')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008967", "code": "from typing import List\ndef max_score_subset(scores: List[int], K: int) -> int:\n    scores.sort()\n    max_score = 0\n    left, right = 0, 1\n    while right < len(scores):\n        if scores[right] - scores[left] <= K:\n            max_score = max(max_score, scores[left] + scores[right])\n            right += 1\n        else:\n            left += 1\n    return max_score\n", "entry_point": "max_score_subset", "input": "[8, 10], 2", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94061_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008968", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "3", "output": "'fizz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008969", "code": "def remove_chucks(hebrew_word):\n    \"\"\" Hebrew numbering systems use 'chuck-chucks' (quotation\n        marks that aren't being used to signify a quotation) \n        in between letters that are meant as numerics rather \n        than words. This function removes the 'chuck-chucks' \n        from the input Hebrew word.\n        Args:\n        hebrew_word (str): A Hebrew word with 'chuck-chucks'.\n        Returns:\n        str: The Hebrew word with 'chuck-chucks' removed.\n    \"\"\"\n    chucks = ['\u05f4', '\u05f3', '\"', \"'\"]\n    for chuck in chucks:\n        while chuck in hebrew_word:\n            hebrew_word = hebrew_word.replace(chuck, '')\n    return hebrew_word\n", "entry_point": "remove_chucks", "input": "'\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05dd'", "output": "'\u05e9\u05e9\u05e9\u05e9\u05e9\u05e9\u05e9\u05dd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31435_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1351", "output": "{1, 7, 193, 1351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008971", "code": "from collections import deque\ndef shortest_paths(graph, start):\n    queue = deque([start])\n    paths = {start: [start]}\n    while queue:\n        node = queue.popleft()\n        current_path = paths[node]\n        for neighbor in graph.get(node, []):\n            if neighbor not in paths:\n                paths[neighbor] = current_path + [neighbor]\n                queue.append(neighbor)\n    return {node: paths[node][1:] for node in paths if node != start}\n", "entry_point": "shortest_paths", "input": "{'A': []}, 'A'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143208_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008972", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'epppm'", "output": "'epppm_3020071935'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008973", "code": "from typing import List, Tuple\ndef process_transactions(transactions: List[int]) -> Tuple[int, bool]:\n    balance = 0\n    destroy_contract = False\n    for transaction in transactions:\n        balance += transaction\n        if balance < 0:\n            destroy_contract = True\n            break\n    return balance, destroy_contract\n", "entry_point": "process_transactions", "input": "[-15]", "output": "(-15, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9357_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6787", "output": "{11, 1, 6787, 617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008975", "code": "def longest_zero_sum_subarray(arr):\n    sum_map = {0: -1}\n    max_len = 0\n    curr_sum = 0\n    for i, num in enumerate(arr):\n        curr_sum += num\n        if curr_sum in sum_map:\n            max_len = max(max_len, i - sum_map[curr_sum])\n        else:\n            sum_map[curr_sum] = i\n    return max_len\n", "entry_point": "longest_zero_sum_subarray", "input": "[1, 2, -3, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67035_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008976", "code": "from typing import List, Optional\ndef convert_order_by(order_by: Optional[List[str]]) -> Optional[List[str]]:\n    if order_by:\n        return [order.replace(\"created_on\", \"createdDateTimeUtc\") for order in order_by]\n    return order_by\n", "entry_point": "convert_order_by", "input": "['name', 'created_on desc']", "output": "['name', 'createdDateTimeUtc desc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131502_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008977", "code": "def digitDifferenceSort(a):\n    def dg(n):\n        s = list(map(int, str(n)))\n        return max(s) - min(s)\n    ans = [(a[i], i) for i in range(len(a))]\n    A = sorted(ans, key=lambda x: (dg(x[0]), -x[1]))\n    return [c[0] for c in A]\n", "entry_point": "digitDifferenceSort", "input": "[23, 7, 887, 152]", "output": "[7, 887, 23, 152]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132098_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008978", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'es_aws_region=us-west-ue, , '", "output": "{'es_aws_region': 'us-west-ue', '': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008979", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'exljaca.class'", "output": "'java exljaca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008980", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[10, 15, 15, 15, 15]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136598_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008981", "code": "import re\ndef extract_numerical_values(input_string):\n    num_match = re.compile(r'([\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+[\\.\\,]*)+[\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+|([-+]*\\d+[\\.\\,]*)+\\d+|([\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+|\\d+)')\n    matches = num_match.findall(input_string)\n    numerical_values = []\n    for match in matches:\n        for group in match:\n            if group:\n                if group.isdigit():\n                    numerical_values.append(int(group))\n                else:\n                    # Convert Indian numeral system representation to regular Arabic numerals\n                    num = int(''.join(str(ord(digit) - ord('\u0966')) for digit in group))\n                    numerical_values.append(num)\n    return numerical_values\n", "entry_point": "extract_numerical_values", "input": "'0 0'", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8862_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008982", "code": "def rusher_wpbf(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "rusher_wpbf", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008983", "code": "def dummy(n):\n    fibonacci_numbers = [0, 1]\n    while len(fibonacci_numbers) < n:\n        next_number = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        fibonacci_numbers.append(next_number)\n    return fibonacci_numbers[:n]\n", "entry_point": "dummy", "input": "11", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134685_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008984", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "6, 6, 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008985", "code": "def longest_consecutive_subsequence(lst):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1] + 1:\n            current_length += 1\n        else:\n            if current_length > max_length:\n                max_length = current_length\n                start_index = i - current_length\n            current_length = 1\n    if current_length > max_length:\n        max_length = current_length\n        start_index = len(lst) - current_length\n    return lst[start_index:start_index + max_length]\n", "entry_point": "longest_consecutive_subsequence", "input": "[7]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62550_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008986", "code": "from typing import List\ndef _get_group_tags(large_groups: List[int], tag: str) -> List[str]:\n    \"\"\"Creates a list of tags to be used for the draw_tags function.\"\"\"\n    group_tags = [tag for _ in range(len(large_groups))]\n    return group_tags\n", "entry_point": "_get_group_tags", "input": "[], 'example_tag'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53931_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6051", "output": "{3, 1, 6051, 2017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008988", "code": "import sys\nledmap = {\n    'n': 'NUMLOCK',\n    'c': 'CAPSLOCK',\n    's': 'SCROLLLOCK',\n}\ndef convert_led_states(led_states):\n    key_presses = []\n    for led_state in led_states:\n        if led_state in ledmap:\n            key_presses.append(ledmap[led_state])\n        else:\n            return f'Unknown LED state: \"{led_state}\". Use one of \"{\"\".join(ledmap.keys())}\".'\n    return key_presses\n", "entry_point": "convert_led_states", "input": "['s', 'n', 's']", "output": "['SCROLLLOCK', 'NUMLOCK', 'SCROLLLOCK']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42654_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008989", "code": "from typing import List\ndef calculate_closest_average(hitoffsets: List[float]) -> int:\n    if not hitoffsets:\n        return 0\n    total_sum = sum(hitoffsets)\n    average = total_sum / len(hitoffsets)\n    closest_integer = round(average)\n    return closest_integer\n", "entry_point": "calculate_closest_average", "input": "[0.5, 1.5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35525_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008990", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[16, 0, 0, 6, 17, 14, 6, 6]", "output": "[16, 32, 96, 6, 17, 14, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008991", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[0, 2, 2, 3, 2, 6, 1, 2]", "output": "[2, 4, 5, 5, 8, 7, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4146", "output": "{1, 2, 3, 1382, 6, 4146, 691, 2073}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008993", "code": "def is_valid_relationship_type(type_name):\n    valid_relationship_types = {'OneToOne', 'OneToMany', 'ManyToOne', 'ManyToMany'}\n    return type_name in valid_relationship_types\n", "entry_point": "is_valid_relationship_type", "input": "'OneToZero'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95563_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008994", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8691", "output": "{3, 1, 8691, 2897}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8779", "output": "{1, 8779}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008996", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[3, 2, 4, 5, 5, 3, 1, 3, 6], 6", "output": "[3, 2, 4, 5, 5, 3, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008997", "code": "import os\nfrom typing import List\ndef reconstruct_files(outfolder: str) -> List[str]:\n    trainval_file = os.path.join(outfolder, 'trainval.txt')\n    test_file = os.path.join(outfolder, 'test.txt')\n    files = []\n    if os.path.exists(trainval_file) and os.path.exists(test_file):\n        with open(trainval_file, \"r\") as f:\n            trainval_files = f.read().splitlines()\n            files.extend(trainval_files)\n        with open(test_file, \"r\") as f:\n            test_files = f.read().splitlines()\n            files.extend(test_files)\n        return files\n    else:\n        print(\"Error: One or both of the files 'trainval.txt' and 'test.txt' do not exist in the specified folder.\")\n        return []\n", "entry_point": "reconstruct_files", "input": "'/path/to/nonexistent/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60868_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008998", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 19, 38, 38, 19, 38]", "output": "[1, 10, 121, 1331, 10000, 161051]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0008999", "code": "def process_job_names(on_queue: str) -> dict:\n    job_names = on_queue.splitlines()\n    unique_job_names = set()\n    longest_job_name = ''\n    for job_name in job_names:\n        unique_job_names.add(job_name.strip())\n        if len(job_name) > len(longest_job_name):\n            longest_job_name = job_name.strip()\n    return {'unique_count': len(unique_job_names), 'longest_job_name': longest_job_name}\n", "entry_point": "process_job_names", "input": "'job2\\njob2\\njob2'", "output": "{'unique_count': 1, 'longest_job_name': 'job2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132971_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009000", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[3, 1, 2]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt33", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009001", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[2, 6, 2, 5, 5, 3, 4, 1, 1]", "output": "[2, 6, 5, 3, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009002", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 1, 2, 6, 2, 7, 3, 2, 7]", "output": "[1, 2, 4, 9, 6, 12, 9, 9, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009003", "code": "def extract_blocks(input_string):\n    blocks = []\n    inside_block = False\n    current_block = \"\"\n    for char in input_string:\n        if char == '\"' and not inside_block:\n            inside_block = True\n            current_block = \"\"\n        elif char == '\"' and inside_block:\n            inside_block = False\n            blocks.append(current_block)\n        elif inside_block:\n            current_block += char\n    return blocks\n", "entry_point": "extract_blocks", "input": "'\"t\"'", "output": "['t']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141650_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009004", "code": "def calculate_output(n):\n    remainder = n % 8\n    if remainder == 0:\n        return 2\n    elif remainder <= 5:\n        return remainder\n    else:\n        return 10 - remainder\n", "entry_point": "calculate_output", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17799_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009005", "code": "def update_headers(data: dict, headers1: dict, token: dict) -> dict:\n    access_token = token.get('access_token', '')  # Extract the access_token from the token dictionary\n    headers1['Authorization'] = 'Bearer ' + access_token  # Update headers1 with Authorization key\n    return headers1\n", "entry_point": "update_headers", "input": "{}, {}, {}", "output": "{'Authorization': 'Bearer '}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91570_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009006", "code": "import os\nfrom typing import List, Dict\ndef collect_package_data(PROJECT: str, folders: List[str]) -> Dict[str, List[str]]:\n    package_data = {}\n    for folder in folders:\n        files_list = []\n        for root, _, files in os.walk(os.path.join(PROJECT, folder)):\n            for filename in files:\n                files_list.append(filename)\n        package_data[folder] = files_list\n    return package_data\n", "entry_point": "collect_package_data", "input": "'/path/to/project', ['static', 'templates']", "output": "{'static': [], 'templates': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77702_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009007", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3247", "output": "{1, 191, 17, 3247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009008", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2007", "output": "{1, 3, 9, 2007, 669, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009009", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'Smith', 5", "output": "'Smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009010", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[5, 0, 4, 2, 6, 0, 4, 5]", "output": "[0, 0, 2, 4, 4, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009011", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "120", "output": "'2:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009012", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "5, 5, '+'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009013", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1.0, 20.0", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009014", "code": "def count_account_roles(accounts):\n    role_counts = {}\n    for account in accounts:\n        role = account['role']\n        role_counts[role] = role_counts.get(role, 0) + 1\n    return role_counts\n", "entry_point": "count_account_roles", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116083_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009015", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "7.0", "output": "2.674", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009016", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[74, 75, 76]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81649_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009017", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[7, 8, 7, 1, 7]", "output": "[7, 9, 9, 4, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009018", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'andteamwork'", "output": "'andteamwork'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009019", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8870", "output": "{1, 2, 5, 8870, 10, 1774, 4435, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8869", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009020", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'helo'", "output": "{'helo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9175", "output": "{1, 5, 1835, 367, 9175, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9174", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009022", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filtee1fifte 3e3'", "output": "['filtee1fifte 3e3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009023", "code": "from typing import List\ndef unique_sorted_indices(energies: List[float]) -> List[int]:\n    energy_dict = {}  # Dictionary to store energy values and their original indices\n    for idx, energy in enumerate(energies):\n        energy_dict.setdefault(energy, idx)  # Store energy value with its index\n    sorted_unique_energies = sorted(set(energies))  # Sort unique energies in ascending order\n    unique_sorted_indices = [energy_dict[energy] for energy in sorted_unique_energies]  # Retrieve original indices\n    return unique_sorted_indices\n", "entry_point": "unique_sorted_indices", "input": "[5.0, 3.0, 5.0, 1.0]", "output": "[3, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129565_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009024", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27882_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009025", "code": "def custom_pad(x, k=8):\n    remainder = x % k\n    if remainder > 0:\n        x += k - remainder\n    return x\n", "entry_point": "custom_pad", "input": "24", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86362_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009026", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "'123'", "output": "[('NUMBER', '123')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009027", "code": "def generate_auth_token(github_repo, git_tag):\n    # Extract the first three characters of the GitHub repository name\n    repo_prefix = github_repo[:3]\n    # Extract the last three characters of the Git tag\n    tag_suffix = git_tag[-3:]\n    # Concatenate the extracted strings to form the authorization token\n    auth_token = repo_prefix + tag_suffix\n    return auth_token\n", "entry_point": "generate_auth_token", "input": "'gmmxyz', 'release-0.0'", "output": "'gmm0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37072_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009028", "code": "def count_supported_regions(id):\n    supported_regions = set()\n    if id.startswith('user-'):\n        supported_regions = {'US', 'EU'}\n    elif id.startswith('org-'):\n        supported_regions = {'US', 'EU', 'APAC'}\n    return len(supported_regions)\n", "entry_point": "count_supported_regions", "input": "'user-123'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94111_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009029", "code": "def findTwoNumbers(array, targetSum):\n    seen_numbers = set()\n    for num in array:\n        potential_match = targetSum - num\n        if potential_match in seen_numbers:\n            return [potential_match, num]\n        seen_numbers.add(num)\n    return []\n", "entry_point": "findTwoNumbers", "input": "[1, 14], 15", "output": "[1, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115301_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1907", "output": "{1, 1907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009031", "code": "import logging\n# Configure logging\nlogging.basicConfig(level=logging.DEBUG)\ndef string_lengths(input_list):\n    result_dict = {}\n    for string in input_list:\n        logging.debug(\"Processing string: %s\", string)\n        length = len(string)\n        result_dict[string] = length\n    return result_dict\n", "entry_point": "string_lengths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111301_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009032", "code": "def trap_water(walls):\n    left, right = 0, len(walls) - 1\n    left_max, right_max = 0, 0\n    water_trapped = 0\n    while left < right:\n        if walls[left] < walls[right]:\n            if walls[left] <= left_max:\n                water_trapped += left_max - walls[left]\n            else:\n                left_max = walls[left]\n            left += 1\n        else:\n            if walls[right] <= right_max:\n                water_trapped += right_max - walls[right]\n            else:\n                right_max = walls[right]\n            right -= 1\n    return water_trapped\n", "entry_point": "trap_water", "input": "[1, 0, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47373_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009033", "code": "def check_compatibility(version1, version2):\n    major1, minor1, patch1 = map(int, version1.split('.'))\n    major2, minor2, patch2 = map(int, version2.split('.'))\n    if major1 != major2:\n        return \"Incompatible\"\n    elif minor1 != minor2:\n        return \"Partially compatible\"\n    elif patch1 != patch2:\n        return \"Compatible with restrictions\"\n    else:\n        return \"Compatible\"\n", "entry_point": "check_compatibility", "input": "'1.0.0', '1.1.0'", "output": "'Partially compatible'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135189_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1029", "output": "{1, 3, 1029, 7, 49, 147, 21, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1028", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009035", "code": "import ast\nimport sys\nimport keyword\ndef get_custom_modules(script):\n    custom_modules = set()\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                module_name = alias.name.split('.')[0]\n                if module_name not in sys.builtin_module_names and not keyword.iskeyword(module_name):\n                    custom_modules.add(module_name)\n        elif isinstance(node, ast.ImportFrom):\n            if node.module is not None:\n                module_name = node.module.split('.')[0]\n                if module_name not in sys.builtin_module_names and not keyword.iskeyword(module_name):\n                    custom_modules.add(module_name)\n    return list(custom_modules)\n", "entry_point": "get_custom_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52760_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009036", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[10, 5, 12]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009037", "code": "def card_war_winner(N, deck1, deck2):\n    score1 = 0\n    score2 = 0\n    for i in range(N):\n        if deck1[i] > deck2[i]:\n            score1 += 1\n        elif deck1[i] < deck2[i]:\n            score2 += 1\n    if score1 > score2:\n        return 1\n    elif score2 > score1:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_war_winner", "input": "5, [1, 2, 3, 4, 5], [2, 3, 4, 5, 6]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115575_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009038", "code": "def process_numbers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_num = num + 2\n        else:\n            processed_num = num * 3\n        if processed_num % 3 == 0:\n            processed_num -= 3\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_numbers", "input": "[3, 1]", "output": "[6, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89026_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009039", "code": "def max_non_adjacent_score(scores):\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[15, 2, 17, 10]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26474_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009040", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average = total_sum / total_students\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[60, 62, 64]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33090_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009041", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-4, 2, 2, 1]", "output": "[[-4, 2, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009042", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5461", "output": "{1, 43, 5461, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009043", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "10, 25", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009044", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'0.z'", "output": "'1.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009045", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9707", "output": "{1, 9707, 17, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009046", "code": "from typing import List\ndef sum_of_even_squares(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[4, 8, 12]", "output": "224", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15283_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009047", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[0, 2, 2, 5, 5]", "output": "[0, 2, 2, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009048", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, -1, -2, -3, -4, -5]", "output": "(1, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009049", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "0, 85295", "output": "85295", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009050", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[8, 6, 0, 0, 0, 3, 9]", "output": "[8, 6, 0, 0, 0, 3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009051", "code": "# Sample data for demonstration\nLOCALEDIR = '/path/to/locales'\nlangcodes = ['en', 'fr', 'de', 'es', 'it']\ntranslates = {'en': 'English', 'fr': 'French', 'de': 'German', 'es': 'Spanish', 'it': 'Italian'}\ndef get_language_name(language_code):\n    return translates.get(language_code, \"Language not found\")\n", "entry_point": "get_language_name", "input": "'fr'", "output": "'French'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94235_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009052", "code": "def find_special_number(n: int) -> int:\n    prod = 1\n    sum_ = 0\n    while n > 0:\n        last_digit = n % 10\n        prod *= last_digit\n        sum_ += last_digit\n        n //= 10\n    return prod - sum_\n", "entry_point": "find_special_number", "input": "67", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121266_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009053", "code": "def find_earliest_time(timestamps):\n    earliest_time = \"23:59\"\n    equally_earliest = []\n    for timestamp in timestamps:\n        if timestamp < earliest_time:\n            earliest_time = timestamp\n            equally_earliest = [timestamp]\n        elif timestamp == earliest_time:\n            equally_earliest.append(timestamp)\n    return sorted(equally_earliest)\n", "entry_point": "find_earliest_time", "input": "['07:30', '08:00', '09:00']", "output": "['07:30']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60674_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009054", "code": "def compress_string(input_string):\n    if not input_string:\n        return \"\"\n    compressed_string = \"\"\n    current_char = input_string[0]\n    char_count = 1\n    for i in range(1, len(input_string)):\n        if input_string[i] == current_char:\n            char_count += 1\n        else:\n            compressed_string += current_char + str(char_count)\n            current_char = input_string[i]\n            char_count = 1\n    compressed_string += current_char + str(char_count)\n    return compressed_string\n", "entry_point": "compress_string", "input": "'accaaaabb'", "output": "'a1c2a4b2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107828_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009055", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['3.5.2', '2.0.0', '3.4.1', '3.5.3']", "output": "'3.5.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009056", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['51231405']", "output": "51231405", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009057", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MMCLIII'", "output": "2153", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009058", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive > 0:\n        return sum_positive / count_positive\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[5.0, 6.0, 8.0]", "output": "6.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60830_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009059", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009060", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5055", "output": "{1, 3, 5, 15, 337, 1011, 1685, 5055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009061", "code": "def merge_sort_skip_multiples_of_3(arr):\n    def merge(left, right):\n        result = []\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] < right[j]:\n                result.append(left[i])\n                i += 1\n            else:\n                result.append(right[j])\n                j += 1\n        result.extend(left[i:])\n        result.extend(right[j:])\n        return result\n    def merge_sort(arr):\n        if len(arr) <= 1:\n            return arr\n        mid = len(arr) // 2\n        left = merge_sort(arr[:mid])\n        right = merge_sort(arr[mid:])\n        return merge(left, right)\n    multiples_of_3 = [num for num in arr if num % 3 == 0]\n    non_multiples_of_3 = [num for num in arr if num % 3 != 0]\n    sorted_non_multiples_of_3 = merge_sort(non_multiples_of_3)\n    result = []\n    i = j = 0\n    for num in arr:\n        if num % 3 == 0:\n            result.append(multiples_of_3[i])\n            i += 1\n        else:\n            result.append(sorted_non_multiples_of_3[j])\n            j += 1\n    return result\n", "entry_point": "merge_sort_skip_multiples_of_3", "input": "[12, 11, 6, 6, 12, 13, 12, 6]", "output": "[12, 11, 6, 6, 12, 13, 12, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15751_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009062", "code": "def generate_unique_slug(base_string, existing_slugs):\n    counter = 1\n    slug = base_string\n    while slug in existing_slugs:\n        slug = f'{base_string}-{counter}'\n        counter += 1\n    return slug\n", "entry_point": "generate_unique_slug", "input": "'prct', []", "output": "'prct'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44340_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009063", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n in [0, 1]:\n        return n\n    else:\n        result = fibonacci_memo(n-1, memo) + fibonacci_memo(n-2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83419_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1228", "output": "{1, 2, 4, 614, 1228, 307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1227", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6128", "output": "{1, 2, 4, 8, 6128, 16, 3064, 1532, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6127", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3777", "output": "{1, 3, 3777, 1259}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009067", "code": "from typing import List\ndef calculate_total_size(file_paths: List[str]) -> int:\n    total_size = 0\n    for path in file_paths:\n        if path.endswith('/'):\n            directory_files = [f for f in file_paths if f.startswith(path) and f != path]\n            total_size += calculate_total_size(directory_files)\n        else:\n            total_size += int(path.split('_')[-1].split('.')[0])  # Extract size from file path\n    return total_size\n", "entry_point": "calculate_total_size", "input": "['file_200.txt', 'file_300.txt']", "output": "500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17322_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009068", "code": "import string\ndef password_strength_checker(password):\n    score = 0\n    # Calculate length of the password\n    score += len(password)\n    # Check for presence of both uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for presence of at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for presence of at least one special character\n    if any(char in string.punctuation for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'A1b2c3!@#'", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62688_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009069", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7773", "output": "{1, 3, 7773, 2591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009071", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'a127316b5c'", "output": "{127316, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1647", "output": "{1, 3, 549, 9, 1647, 183, 27, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009073", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abc-def ghi'", "output": "['abc', 'def', 'ghi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009074", "code": "def calculate_char_frequency(input_string: str) -> dict:\n    char_frequency = {}\n    for char in input_string:\n        if char.isalnum():\n            char = char.lower()  # Convert character to lowercase for case-insensitivity\n            char_frequency[char] = char_frequency.get(char, 0) + 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'h'", "output": "{'h': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125669_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009075", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'some.module.path.MyAppConfig'", "output": "'MyApp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009076", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[17]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2116", "output": "{1, 2, 1058, 2116, 4, 46, 529, 23, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2115", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009078", "code": "def sum_of_largest_four(nums):\n    sorted_nums = sorted(nums, reverse=True)\n    return sum(sorted_nums[:4])\n", "entry_point": "sum_of_largest_four", "input": "[15, 12, 13, 10]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104402_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009079", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009080", "code": "def validate_registration(username: str, password1: str, password2: str) -> str:\n    if not username:\n        return \"Username cannot be empty.\"\n    if password1 != password2:\n        return \"Passwords do not match.\"\n    return \"Registration successful.\"\n", "entry_point": "validate_registration", "input": "'user123', 'pass123', 'pass124'", "output": "'Passwords do not match.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3689_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009081", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7698", "output": "{1, 2, 3, 1283, 2566, 6, 3849, 7698}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7697", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009082", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "960.96", "output": "'R$:960,96'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009083", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'2022.1.500'", "output": "(2022, 1, 500)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1855", "output": "{1, 35, 5, 7, 265, 371, 53, 1855}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009085", "code": "from typing import List\ndef max_score_subset(scores: List[int], K: int) -> int:\n    scores.sort()\n    max_score = 0\n    left, right = 0, 1\n    while right < len(scores):\n        if scores[right] - scores[left] <= K:\n            max_score = max(max_score, scores[left] + scores[right])\n            right += 1\n        else:\n            left += 1\n    return max_score\n", "entry_point": "max_score_subset", "input": "[10, 14, 1, 5, 8], 4", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94061_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009086", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[80, 80, 80, 80], 4", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009087", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, 19.939879759519037", "output": "19.939879759519037", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009088", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "'heheolo'", "output": "{'str': 'heheolo'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009089", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'fo'", "output": "'fo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009090", "code": "import re\ndef count_unique_words(text_content):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', text_content.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'Test'", "output": "{'test': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009091", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8089", "output": "{1, 8089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009092", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[5, 2, -2]", "output": "[25, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009093", "code": "def simulate_game(grid, start, instructions):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    rows, cols = len(grid), len(grid[0])\n    x, y = start\n    for instruction in instructions:\n        dx, dy = directions[instruction]\n        x = (x + dx) % rows\n        y = (y + dy) % cols\n        if grid[x][y] == 1:  # Check if the new position is blocked\n            x, y = start  # Reset to the starting position\n    return x, y\n", "entry_point": "simulate_game", "input": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]], (1, 1), ['U', 'D']", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1807_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009094", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'bb'", "output": "['bb', 'bb']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009095", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7408", "output": "{1, 2, 4, 8, 463, 7408, 16, 3704, 1852, 926}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7407", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009096", "code": "PAD = 0\nEOS = 1\nBOS = 2\nUNK = 3\nUNK_WORD = '<unk>'\nPAD_WORD = '<pad>'\nBOS_WORD = '<s>'\nEOS_WORD = '</s>'\nNEG_INF = -10000  # -float('inf')\ndef calculate_log_probability(sequence):\n    log_prob = 0.0\n    for word in sequence:\n        if word == BOS_WORD:\n            log_prob += -1.0\n        elif word == EOS_WORD:\n            log_prob += -2.0\n        else:\n            log_prob += -len(word)\n    return log_prob\n", "entry_point": "calculate_log_probability", "input": "['<s>', 'word', 'word', 'word', 'word', '</s>']", "output": "-19.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107531_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009097", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[1, 3, 5]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009098", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[3, 3, 3, 4, 4, 2, 2]", "output": "[9, 9, 9, 16, 16, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009099", "code": "def toggle_trash_bin_relay(relay_id: int, state: int) -> str:\n    if relay_id == 1 and state == 1:\n        return \"Relay toggled successfully\"\n    elif relay_id not in [1, 2, 3]:  # Assuming relay IDs 1, 2, 3 are valid\n        return \"Relay ID not found\"\n    else:\n        return \"Failed to toggle relay\"\n", "entry_point": "toggle_trash_bin_relay", "input": "4, 0", "output": "'Relay ID not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121601_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009100", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'RRRRRR'", "output": "(6, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009101", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[4, 4, 3, 1, 5, 4, 1, 5, 4]", "output": "[16, 16, 27, 1, 125, 16, 1, 125, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009102", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "5", "output": "['1', '2', '3', '4', '5']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009103", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[1357], 1", "output": "1357", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009104", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5321", "output": "{1, 5321, 17, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009105", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[0, 0, 1, 2, 3, 4, 5, 6]", "output": "{0: 2, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8433", "output": "{1, 3, 9, 937, 8433, 2811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009107", "code": "import re\nMENTION_PATTERN = r'@(user|channel)\\((\\d+)\\)'\ndef get_mention(message):\n    \"\"\"Get the user or channel ID mentioned at the beginning of a message, if any.\"\"\"\n    match = re.search(MENTION_PATTERN, message)\n    if match:\n        # Return the first not-None value in the match group tuple, be it a user or channel mention\n        return next(group for group in match.groups() if group is not None)\n    else:\n        return None\n", "entry_point": "get_mention", "input": "'@user(12345)'", "output": "'user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9189_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009108", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[88, 88, 89, 89, 88]", "output": "88.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009109", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/home//use/../use/hom/a/./use/.t/'", "output": "'/home/use/hom/a/use/.t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009110", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest integers\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest integers and the largest integer\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[5, 5, 8]", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118316_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "580", "output": "{1, 2, 290, 4, 580, 5, 10, 145, 116, 20, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt579", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "235", "output": "{1, 235, 5, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1097", "output": "{1097, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009114", "code": "def encrypt_string(input_string):\n    encrypted_result = \"\"\n    for i, char in enumerate(input_string):\n        if char.isalpha():\n            shift_amount = i + 1\n            if char.islower():\n                encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n            else:\n                encrypted_char = chr((ord(char) - ord('A') + shift_amount) % 26 + ord('A'))\n        else:\n            encrypted_char = char\n        encrypted_result += encrypted_char\n    return encrypted_result\n", "entry_point": "encrypt_string", "input": "'World!'", "output": "'Xqupi!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110857_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009115", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9514", "output": "{1, 2, 67, 134, 71, 9514, 142, 4757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009116", "code": "def calculate_utxo_register_sum(tx_data_14, tx_data_15, utxo_data_15):\n    total_len_tx_14 = sum(tx_data_14)\n    total_len_tx_15 = sum(tx_data_15)\n    # Find the difference in transaction lengths\n    diff_tx_lengths = total_len_tx_15 - total_len_tx_14\n    # Calculate the sum of register lengths of UTXOs associated with the transaction in version 0.15\n    sum_register_lengths = sum(utxo_data_15) - diff_tx_lengths\n    return sum_register_lengths\n", "entry_point": "calculate_utxo_register_sum", "input": "[10, 20], [30, 50], [80, 90]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132609_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009117", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'v99p9'", "output": "'v99p9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009118", "code": "def sum_multiples_3_or_5(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_or_5", "input": "16", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36151_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009119", "code": "from typing import List\ndef max_simultaneous_muse_tools(locations: List[int]) -> int:\n    max_tools = float('inf')  # Initialize to positive infinity for comparison\n    for tools in locations:\n        max_tools = min(max_tools, tools)\n    return max_tools\n", "entry_point": "max_simultaneous_muse_tools", "input": "[0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65482_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5804", "output": "{1, 2, 4, 1451, 5804, 2902}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5803", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009121", "code": "def max_non_adjacent_sum(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34492_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009122", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[7, 5, 5], [5, 7]", "output": "[7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41084_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009123", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[-1, 2, 1, 2, 0, 6, 4, 6]", "output": "[-1, 0, 1, 2, 2, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009124", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return 0\n    max1 = max2 = max3 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009125", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[1, 2, 2, 0, 2, 1], 5, 5", "output": "[30, 35, 35, 25, 35, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9385", "output": "{1, 9385, 1877, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009127", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.22.2262', 127", "output": "'2.22.2262.127'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009128", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 80, 85, 90, 100]", "output": "85.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78318_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009129", "code": "def _sk_fail(input_str):\n    if input_str == \"pdb\":\n        return \"Debugging tool selected: pdb\"\n    else:\n        return \"Unknown operation\"\n", "entry_point": "_sk_fail", "input": "'pdb'", "output": "'Debugging tool selected: pdb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128113_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009130", "code": "def find_numbers_in_range(min_val, max_val):\n    numbers_in_range = []\n    for num in range(min_val, max_val + 1):\n        if num == 2 or num == 3:\n            numbers_in_range.append(num)\n    return numbers_in_range\n", "entry_point": "find_numbers_in_range", "input": "0, 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119042_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009131", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'path1'", "output": "'Content for path1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009132", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "3", "output": "[0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009133", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'a!00@a*000#aaa$0'", "output": "'a00a000aaa0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009134", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[1, 2, 3, 4, 5, 6]", "output": "[6, 5, 4, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009135", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 16, 0]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009136", "code": "import re\ndef extract_version_number(input_string):\n    pattern = r'v\\d+\\.\\d+'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group()\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version_number", "input": "'The version is v3.0 and it is up to date'", "output": "'v3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69963_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009137", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'key1=value1'", "output": "['key1', 'value1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009138", "code": "def sum_even_numbers(input_list):\n    sum_even = 0\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[42]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117229_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009139", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'ChareliDoe'", "output": "[('ChareliDoe', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009140", "code": "from typing import List\ndef longest_subarray_length(nums: List[int]) -> int:\n    last_seen = {}\n    start = 0\n    max_length = 0\n    for end in range(len(nums)):\n        if nums[end] in last_seen and last_seen[nums[end]] >= start:\n            start = last_seen[nums[end]] + 1\n        last_seen[nums[end]] = end\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_subarray_length", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16612_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009141", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Incctuao.'", "output": "['incctuao']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009142", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[2, -3, 5, 8, 4]", "output": "[4, -27, 125, 64, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009143", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[8, 10, 10, 7, 9, 9, 11]", "output": "[16, 20, 20, 49, 81, 81, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7976", "output": "{1, 2, 4, 997, 7976, 8, 1994, 3988}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7975", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009145", "code": "import re\nimport argparse\ndef validate_aligner(aligner_str):\n    aligner_str = aligner_str.lower()\n    aligner_pattern = \"star|subread\"\n    if not re.match(aligner_pattern, aligner_str):\n        error = \"Aligner to be used (STAR|Subread)\"\n        raise argparse.ArgumentTypeError(error)\n    else:\n        return aligner_str\n", "entry_point": "validate_aligner", "input": "'STAR'", "output": "'star'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52623_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009146", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[5, 18, 1, 12, 22]", "output": "[18, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009147", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3657", "output": "'1 hour, and 57 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009148", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 22", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009149", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[300, 120, 34]", "output": "'7 minutes and 34 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009150", "code": "from typing import List\ndef generateOutput(data: List[int], threshold: int, operation: str) -> List[int]:\n    output = []\n    for num in data:\n        if operation == \"add\":\n            output.append(num + threshold)\n        elif operation == \"subtract\":\n            output.append(num - threshold)\n        elif operation == \"multiply\":\n            output.append(num * threshold)\n        elif operation == \"divide\":\n            output.append(num // threshold)  # Using integer division for simplicity\n    return output\n", "entry_point": "generateOutput", "input": "[0, 50, 100], 50, 'add'", "output": "[50, 100, 150]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84207_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009151", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[3, 1, 7, 3, 2, 4, 4, 3, 4], 5", "output": "[[3, 1, 7, 3, 2], [4, 4, 3, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009152", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[5, 3, 3, 6, 3], [3, 5, 6]", "output": "[5, 3, 3, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41084_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009153", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[3, 3, 3, 1, 0, 0, 2]", "output": "[3, 3, 3, 1, 0, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009154", "code": "from typing import List\ndef calculate_total_cost(prices: List[float], quantities: List[int]) -> float:\n    total_cost = 0\n    for price, quantity in zip(prices, quantities):\n        total_cost += price * quantity\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "[10.0, 9.6], [4, 1]", "output": "49.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85014_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009155", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 3, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122887_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2510", "output": "{1, 2, 5, 1255, 10, 2510, 502, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2509", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009157", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7454", "output": "{1, 2, 7454, 3727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009158", "code": "def correct_typo(code_snippet):\n    corrected_code = code_snippet.replace('install_requireent', 'install_requires')\n    return corrected_code\n", "entry_point": "correct_typo", "input": "'readme_iwe:'", "output": "'readme_iwe:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26763_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9647", "output": "{1, 11, 877, 9647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009160", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3286", "output": "{1, 2, 106, 1643, 53, 3286, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009161", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'illumina', 'saamplssaas.reads.fa'", "output": "'saamplssaas_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009162", "code": "def count_unique_users(chatroom_ids):\n    unique_users = set()\n    # Simulated data for users in each chatroom\n    chatroom_users = {\n        101: ['A', 'B', 'C'],\n        102: ['B', 'D'],\n        103: ['C', 'E'],\n        104: ['D', 'E']\n    }\n    for chatroom_id in chatroom_ids:\n        users_in_chatroom = chatroom_users.get(chatroom_id, [])\n        unique_users.update(users_in_chatroom)\n    return len(unique_users)\n", "entry_point": "count_unique_users", "input": "[101, 102, 103, 104]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116843_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009163", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "'[1, 2, 4]'", "output": "[1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009164", "code": "def count_module_roots(module_names):\n    root_counts = {}\n    for module_name in module_names:\n        root = module_name.split('_')[0] if '_' in module_name else module_name\n        root_counts[root] = root_counts.get(root, 0) + 1\n    return root_counts\n", "entry_point": "count_module_roots", "input": "['ssttil_mod1', 'sstls_mod2']", "output": "{'ssttil': 1, 'sstls': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82501_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009165", "code": "import glob\nimport os\ndef count_words(directory: str, pattern: str) -> int:\n    word_count = 0\n    files = glob.glob(os.path.join(directory, pattern))\n    for file_path in files:\n        with open(file_path, 'r', encoding='utf-8') as file:\n            content = file.read()\n            words = content.split()\n            word_count += len(words)\n    return word_count\n", "entry_point": "count_words", "input": "'/path/to/empty/directory', '*.txt'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92795_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009166", "code": "from typing import Tuple\ndef split_with_escape(input_str: str, separator: str) -> Tuple[str, str]:\n    key = ''\n    val = ''\n    escaped = False\n    for i in range(len(input_str)):\n        if input_str[i] == '\\\\' and not escaped:\n            escaped = True\n        elif input_str[i] == separator and not escaped:\n            val = input_str[i+1:]\n            break\n        else:\n            if escaped:\n                key += input_str[i]\n                escaped = False\n            else:\n                key += input_str[i]\n    return key, val\n", "entry_point": "split_with_escape", "input": "'abz', ':'", "output": "('abz', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12144_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009167", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6038", "output": "{1, 2, 3019, 6038}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6037", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9395", "output": "{1, 9395, 5, 1879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4024", "output": "{1, 2, 4, 8, 1006, 503, 4024, 2012}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4023", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009170", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[6, 1, 3, 5, 13, 17]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009171", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9693", "output": "{1, 3, 359, 9, 1077, 27, 9693, 3231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009172", "code": "def authenticate_user(username: str, password: str) -> str:\n    valid_username = \"admin\"\n    valid_password = \"P@ssw0rd\"\n    if username == valid_username:\n        if password == valid_password:\n            return \"Authentication successful\"\n        else:\n            return \"Incorrect password\"\n    else:\n        return \"Unknown username\"\n", "entry_point": "authenticate_user", "input": "'admin', 'wrongpassword'", "output": "'Incorrect password'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121086_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009173", "code": "from typing import List, Tuple\ndef has_circular_dependency(dependencies: List[Tuple[str, str]]) -> bool:\n    graph = {node: [] for _, node in dependencies}\n    for parent, child in dependencies:\n        graph[child].append(parent)\n    def dfs(node, visited, stack):\n        visited.add(node)\n        stack.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                if dfs(neighbor, visited, stack):\n                    return True\n            elif neighbor in stack:\n                return True\n        stack.remove(node)\n        return False\n    for node in graph:\n        if dfs(node, set(), set()):\n            return True\n    return False\n", "entry_point": "has_circular_dependency", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62221_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009174", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[3, 5, 1, 4], 15", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009175", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'21 Dec 1842De'", "output": "'Dec 21, 1842De'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009176", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[7, 10, 7, 8, 8, 6, 8]", "output": "[7, 11, 9, 11, 12, 11, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009177", "code": "from typing import List\ndef find_nearest(array: List[float], value: float) -> float:\n    if not array:\n        raise ValueError(\"Input array is empty\")\n    nearest_idx = 0\n    min_diff = abs(array[0] - value)\n    for i in range(1, len(array)):\n        diff = abs(array[i] - value)\n        if diff < min_diff:\n            min_diff = diff\n            nearest_idx = i\n    return array[nearest_idx]\n", "entry_point": "find_nearest", "input": "[8.0, 8.5, 8.9, 9.0, 9.5], 8.9", "output": "8.9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121237_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009178", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "16", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009179", "code": "def find_last_word_length(s: str) -> int:\n    reversed_string = s.strip()[::-1]  # Reverse the input string after removing leading/trailing spaces\n    length = 0\n    for char in reversed_string:\n        if char == ' ':\n            if length == 0:\n                continue\n            break\n        length += 1\n    return length\n", "entry_point": "find_last_word_length", "input": "'test'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93428_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009180", "code": "import re\nfrom typing import List\ndef extract_dois(text: str) -> List[str]:\n    dois_pattern = r'doi:\\d{2}\\.\\d{4}/\\w+'  # Regular expression pattern for matching DOIs\n    dois = re.findall(dois_pattern, text)\n    return dois\n", "entry_point": "extract_dois", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75592_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009181", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[10, 9], 'add'", "output": "[19, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009182", "code": "def sum_of_squares_of_evens(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total_sum += num ** 2  # Add the square of the even number to the total sum\n    return total_sum\n", "entry_point": "sum_of_squares_of_evens", "input": "[12]", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8266_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009183", "code": "from typing import List, Tuple\ndef count_circle_intersections(circle_centers: List[Tuple[float, float]], radii: List[float]) -> int:\n    intersection_count = 0\n    n = len(circle_centers)\n    for i in range(n):\n        for j in range(i + 1, n):\n            center1, center2 = circle_centers[i], circle_centers[j]\n            distance = ((center1[0] - center2[0]) ** 2 + (center1[1] - center2[1]) ** 2) ** 0.5\n            if distance < radii[i] + radii[j]:\n                intersection_count += 1\n    return intersection_count\n", "entry_point": "count_circle_intersections", "input": "[(0, 0), (0.5, 0), (2, 0)], [1, 1, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28351_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009184", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 0, 0, 0, 2, 0, 0, 2]", "output": "[4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009185", "code": "def calculate_sum_of_multiples(NUM):\n    total_sum = 0\n    for i in range(1, NUM):\n        if i % 3 == 0 or i % 5 == 0:\n            total_sum += i\n    return total_sum\n", "entry_point": "calculate_sum_of_multiples", "input": "15", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107367_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009186", "code": "import uuid\ndef generate_product_uuid(existing_uuid):\n    # Convert the existing UUID to uppercase\n    existing_uuid_upper = existing_uuid.upper()\n    # Add the prefix 'PROD_' to the uppercase UUID\n    modified_uuid = 'PROD_' + existing_uuid_upper\n    return modified_uuid\n", "entry_point": "generate_product_uuid", "input": "'4504'", "output": "'PROD_4504'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91223_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009187", "code": "def simulate_card_game(num_rounds, deck_a, deck_b):\n    wins_a = 0\n    wins_b = 0\n    for i in range(num_rounds):\n        if deck_a[i] > deck_b[i]:\n            wins_a += 1\n        elif deck_a[i] < deck_b[i]:\n            wins_b += 1\n    return (wins_a, wins_b)\n", "entry_point": "simulate_card_game", "input": "6, [5, 7, 10, 3, 4, 2], [2, 4, 3, 1, 5, 6]", "output": "(4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60949_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009188", "code": "def calculate_total_images_per_epoch(config_params):\n    train_batch_size = config_params.get('train_batch_size', 0)\n    num_workers = config_params.get('num_workers', 0)\n    total_images = train_batch_size * num_workers\n    return total_images\n", "entry_point": "calculate_total_images_per_epoch", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21949_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009189", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "803.0875, 10", "output": "802.9625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009190", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'*Titl'", "output": "('', '*Titl')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009191", "code": "def process_string(input_str):\n    if not input_str:\n        return 'EMPTY'\n    modified_str = ''\n    for i, char in enumerate(input_str[::-1]):\n        if char.isalpha():\n            if i % 2 == 1:\n                modified_str += char.upper()\n            else:\n                modified_str += char.lower()\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "process_string", "input": "'hWr'", "output": "'rWh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48299_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009192", "code": "def extract_even_words(input_string):\n    words = input_string.split(' ')\n    even_words = ' '.join(words[1::2])  # Select every second word starting from index 1 (even positions)\n    return even_words\n", "entry_point": "extract_even_words", "input": "'the quick brown fox jumps over lazy'", "output": "'quick fox over'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122280_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009193", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[3, 5]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009194", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "127, 8", "output": "'00000127'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009195", "code": "def total_dependencies(required_packages: dict) -> int:\n    all_dependencies = set()\n    for dependencies in required_packages.values():\n        all_dependencies.update(dependencies)\n    return len(all_dependencies)\n", "entry_point": "total_dependencies", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58645_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009196", "code": "def extract_full_name(input_str):\n    words = input_str.split()\n    full_name = ''.join(word[0] for word in words if word.isalpha())\n    return full_name\n", "entry_point": "extract_full_name", "input": "'F'", "output": "'F'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98367_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3919", "output": "{1, 3919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009198", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[2, 3, 5, 1, 3, 1, 3, 1, 3]", "output": "[1, 1, 1, 2, 3, 3, 3, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009199", "code": "def process_filename(filename):\n    ALLOW_CHILD_SERVICES = ['service1', 'service2']  # Example list of allowed services\n    REPLACE_NAMES = {'old_name1': 'new_name1', 'old_name2': 'new_name2'}  # Example dictionary for name replacements\n    IGNORED_NAMES = {'ignored_name1', 'ignored_name2'}  # Example set of ignored names\n    friendly_name, _ = filename.split('_', 1)\n    friendly_name = friendly_name.replace('Amazon', '').replace('AWS', '')\n    name_parts = friendly_name.split('_')\n    if len(name_parts) >= 2:\n        if name_parts[0] not in ALLOW_CHILD_SERVICES:\n            friendly_name = name_parts[-1]\n    if friendly_name.lower().endswith('large'):\n        return None\n    if friendly_name in REPLACE_NAMES:\n        friendly_name = REPLACE_NAMES[friendly_name]\n    if friendly_name in IGNORED_NAMES:\n        return None\n    return friendly_name.lower()\n", "entry_point": "process_filename", "input": "'sersice1_example.txt'", "output": "'sersice1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53309_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009200", "code": "LAMP_SPECS = {\n    'uv': (396, 16),\n    'blue': (434, 22),\n    'cyan': (481, 22),\n    'teal': (508, 29),\n    'green_yellow': (545, 70),\n    'red': (633, 19)\n}\nLAMP_NAMES = set(LAMP_SPECS.keys())\ndef get_lamp_specs(lamp_name):\n    if lamp_name in LAMP_NAMES:\n        return LAMP_SPECS[lamp_name]\n    else:\n        return \"Lamp not found\"\n", "entry_point": "get_lamp_specs", "input": "'cyan'", "output": "(481, 22)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13946_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009201", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'abcd'", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009202", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 3, 1, 1, 4]", "output": "[3, 4, 3, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009203", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'CONNECTING', 'SUCCESS'", "output": "'ESTABLISHED'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009204", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110X'", "output": "['11100', '11101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt51", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009205", "code": "def longest_increasing_sequence_length(nums):\n    if not nums:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "longest_increasing_sequence_length", "input": "[1, 2, 3, 0, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79552_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009206", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[3, 4, 5, 1, 2, 6, 7], [4, 3, 2, 8, 9, 10, 11]", "output": "('Player 2 wins', 2, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009207", "code": "def filter_dicts(input_list):\n    filtered_list = []\n    for dictionary in input_list:\n        if 'exclude_key' in dictionary and dictionary['exclude_key'] == 'exclude_value':\n            continue\n        filtered_list.append(dictionary)\n    return filtered_list\n", "entry_point": "filter_dicts", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30808_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009208", "code": "def handle_command(command):\n    command_responses = {\n        \"!hello\": \"Hello there!\",\n        \"!time\": \"The current time is 12:00 PM.\",\n        \"!weather\": \"The weather today is sunny.\",\n        \"!help\": \"You can ask me about the time, weather, or just say hello!\"\n    }\n    return command_responses.get(command, \"Sorry, I don't understand that command.\")\n", "entry_point": "handle_command", "input": "'!hello'", "output": "'Hello there!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123108_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009209", "code": "from math import pi, cos, sin\ndef calculate_hexagonal_path(ref_point, radius, num_sides):\n    angle_increment = 2 * pi / num_sides\n    path = []\n    for i in range(num_sides):\n        angle = i * angle_increment\n        x = ref_point[0] + radius * cos(angle)\n        y = ref_point[1] + radius * sin(angle)\n        z = ref_point[2]\n        path.append([x, y, z])\n    return path\n", "entry_point": "calculate_hexagonal_path", "input": "(135.0, 100.0, 101), 9.0, 1", "output": "[[144.0, 100.0, 101]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137551_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "277", "output": "{1, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009211", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "10, 16", "output": "160", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009212", "code": "def longest_subarray_with_distinct_elements(k):\n    n = len(k)\n    hashmap = dict()\n    j = 0\n    ans = 0\n    c = 0\n    for i in range(n):\n        if k[i] in hashmap and hashmap[k[i]] > 0:\n            while i > j and k[i] in hashmap and hashmap[k[i]] > 0:\n                hashmap[k[j]] -= 1\n                j += 1\n                c -= 1\n        hashmap[k[i]] = 1\n        c += 1\n        ans = max(ans, c)\n    return ans\n", "entry_point": "longest_subarray_with_distinct_elements", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37610_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009213", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[0, 7, 7, 7, 0, 0]", "output": "(21, 6, 0, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009214", "code": "def parse_arguments(args):\n    parsed_args = {'package': None}\n    if '--package' in args:\n        package_index = args.index('--package')\n        if package_index + 1 < len(args):\n            parsed_args['package'] = args[package_index + 1]\n    return parsed_args\n", "entry_point": "parse_arguments", "input": "['--package']", "output": "{'package': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40531_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009215", "code": "from typing import List\ndef max_simultaneous_muse_tools(locations: List[int]) -> int:\n    max_tools = float('inf')  # Initialize to positive infinity for comparison\n    for tools in locations:\n        max_tools = min(max_tools, tools)\n    return max_tools\n", "entry_point": "max_simultaneous_muse_tools", "input": "[-1, 0, 1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65482_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009216", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1533", "output": "{1, 3, 7, 73, 21, 219, 1533, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "753", "output": "{1, 3, 753, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009218", "code": "def repeat_elements(lst):\n    repeated_list = []\n    for index, value in enumerate(lst):\n        repeated_list.extend([value] * (index + 1))\n    return repeated_list\n", "entry_point": "repeat_elements", "input": "[2, 1, 0, 4, 2]", "output": "[2, 1, 1, 0, 0, 0, 4, 4, 4, 4, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75218_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009219", "code": "def alphabet_shift(input_string, n):\n    result = \"\"\n    for char in input_string:\n        if char.isalpha():\n            shifted_char = chr(((ord(char) - ord('a') + n) % 26) + ord('a'))\n            result += shifted_char\n        else:\n            result += char\n    return result\n", "entry_point": "alphabet_shift", "input": "'abcxyz', 2", "output": "'cdezab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1133_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2834", "output": "{1, 2, 26, 1417, 13, 109, 2834, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009221", "code": "def count_set_bits(num):\n    count = 0\n    while num:\n        count += num & 1\n        num >>= 1\n    return count\n", "entry_point": "count_set_bits", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139196_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009222", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'2.0.1.dev'", "output": "(2, 0, 1, 'dev')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009223", "code": "def custom_lr_scheduler(validation_loss_history, current_lr, factor=0.5, patience=3):\n    if len(validation_loss_history) < patience:\n        return current_lr\n    for i in range(1, patience + 1):\n        if validation_loss_history[-i] < validation_loss_history[-i - 1]:\n            return current_lr\n    new_lr = current_lr * factor\n    return new_lr\n", "entry_point": "custom_lr_scheduler", "input": "[0.3, 0.2, 0.25, 0.2], 0.001", "output": "0.001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126338_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009224", "code": "def filter_legal_age_users(users):\n    legal_age_users = []\n    for user in users:\n        if user.get(\"age\", 0) >= 18:\n            legal_age_users.append(user)\n    return legal_age_users\n", "entry_point": "filter_legal_age_users", "input": "[{'age': 16}, {'age': 17}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138644_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009225", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(3, 2, -1, 2, 0, 3, 1, 0)", "output": "'3.2.-1.2.0.3.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009226", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/hho/'", "output": "'/hho'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009227", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'/usr//local/bin/'", "output": "'usr/local/bin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009228", "code": "def convert_to_mac_addresses(file_parsed):\n    macs = []\n    for i in file_parsed:\n        mac = ''\n        mac_list = [i[o].to_bytes(1, 'big') for o in range(0, len(i))]  # Convert integers to bytes\n        mac_list_len = len(mac_list)\n        for j in range(mac_list_len):\n            mac += mac_list[j].hex()\n            if j < (mac_list_len - 1):\n                mac += \":\"\n        macs.append(mac)\n    return macs\n", "entry_point": "convert_to_mac_addresses", "input": "[[], [], [], [], [], [], [], [], []]", "output": "['', '', '', '', '', '', '', '', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92905_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009229", "code": "def process_text(input_text: str) -> str:\n    manualMap = {\n        \"can't\": \"cannot\",\n        \"won't\": \"will not\",\n        \"don't\": \"do not\",\n        # Add more contractions as needed\n    }\n    articles = {\"a\", \"an\", \"the\"}\n    contractions = {v: k for k, v in manualMap.items()}\n    outText = []\n    tempText = input_text.lower().split()\n    for word in tempText:\n        word = manualMap.get(word, word)\n        if word not in articles:\n            outText.append(word)\n    for wordId, word in enumerate(outText):\n        if word in contractions:\n            outText[wordId] = contractions[word]\n    return ' '.join(outText)\n", "entry_point": "process_text", "input": "'brown'", "output": "'brown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127920_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009230", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "25, 12", "output": "5200300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt59", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009231", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "30, 8", "output": "5852925", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1703", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009232", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[7, 7, 14, 14, 14, 16, 13]", "output": "[7, 7, 13, 14, 14, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009233", "code": "from typing import List\ndef custom_regex(pattern: str, source: str) -> List[str]:\n    def match(p_idx, s_idx):\n        if p_idx == len(pattern):\n            return [\"\"]\n        if s_idx == len(source):\n            return []\n        matches = []\n        if p_idx + 1 < len(pattern) and pattern[p_idx + 1] == '*':\n            if pattern[p_idx] == '.' or pattern[p_idx] == source[s_idx]:\n                matches += match(p_idx, s_idx + 1)\n            matches += match(p_idx + 2, s_idx)\n        elif pattern[p_idx] == '.' or pattern[p_idx] == source[s_idx]:\n            matches += [source[s_idx] + m for m in match(p_idx + 1, s_idx + 1)]\n        return matches\n    return match(0, 0)\n", "entry_point": "custom_regex", "input": "'b', 'b'", "output": "['b']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123049_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009234", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'abcdefg', 'hijklmn'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42819_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6241", "output": "{1, 6241, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009236", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'//home//use//home//use/.t'", "output": "'/home/use/home/use/.t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009237", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4246", "output": "{1, 2, 386, 193, 11, 2123, 4246, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4245", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009238", "code": "import os\nimport logging\ndef process_file(infilepath: str, outfilepath: str, output_format: str) -> str:\n    filename = os.path.basename(infilepath).split('.')[0]\n    logging.info(\"Reading fileprint... \" + infilepath)\n    output_file = f\"{outfilepath}/{filename}.{output_format}\"\n    return output_file\n", "entry_point": "process_file", "input": "'///some/other/path/xt.txt', '///pathoht', 'sssv'", "output": "'///pathoht/xt.sssv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139858_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009239", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2810", "output": "{1, 2, 5, 10, 562, 281, 2810, 1405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2809", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009240", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3918", "output": "{1, 2, 3, 6, 1959, 653, 3918, 1306}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3917", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009241", "code": "def update_domain(config):\n    config['domain'] = 'example.com'\n    return config\n", "entry_point": "update_domain", "input": "{}", "output": "{'domain': 'example.com'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43422_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009242", "code": "def validate_product_input(user_input, inventory):\n    try:\n        product_number = int(user_input)\n        if 0 < product_number <= len(inventory):\n            return True, product_number\n    except ValueError:\n        pass\n    return False, -1\n", "entry_point": "validate_product_input", "input": "'xyz', ['Product1', 'Product2']", "output": "(False, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104027_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009243", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[66, 68]", "output": "67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70866_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009244", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 1 or n == 2:\n        return 1\n    else:\n        result = fibonacci_memo(n - 1, memo) + fibonacci_memo(n - 2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33770_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009245", "code": "def longest_substring_with_k_distinct(s, k):\n    max_length = 0\n    start = 0\n    char_count = {}\n    for end in range(len(s)):\n        char_count[s[end]] = char_count.get(s[end], 0) + 1\n        while len(char_count) > k:\n            char_count[s[start]] -= 1\n            if char_count[s[start]] == 0:\n                del char_count[s[start]]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_substring_with_k_distinct", "input": "'aabbcc', 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18078_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009246", "code": "def calculate_total_metrics(services, prefix):\n    total_metrics = 0\n    for service_name, metrics in services.items():\n        if service_name.startswith(prefix):\n            total_metrics += len(metrics)\n    return total_metrics\n", "entry_point": "calculate_total_metrics", "input": "{}, 'abc'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23775_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009247", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'>>'", "output": "'>>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009248", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "17, 0, 5", "output": "153", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009249", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "-0.87", "output": "'-0.87'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009250", "code": "def format_version(version_str: str) -> str:\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    version_integers = [int(component) for component in version_components]\n    # Format the version string as 'vX.Y.Z'\n    formatted_version = 'v' + '.'.join(map(str, version_integers))\n    return formatted_version\n", "entry_point": "format_version", "input": "'1.2.3'", "output": "'v1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15533_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009251", "code": "import math\ndef euclidean_distance(point1, point2):\n    if not isinstance(point1, tuple) or not isinstance(point2, tuple) or len(point1) != 2 or len(point2) != 2:\n        raise ValueError(\"Both inputs must be tuples of length 2\")\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(0, 0), (300, 200)", "output": "360.5551275463989", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13433_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009252", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.isupper():\n            encrypted_text += chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_text += chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Hello,', 2", "output": "'Jgnnq,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123131_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009253", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "4, 3", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009254", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'data/input.sph'", "output": "'data/input.sph_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009255", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[83, 85, 88, 90, 95]", "output": "87.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83310_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7682", "output": "{1, 7682, 2, 3841, 167, 334, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5815", "output": "{1, 1163, 5, 5815}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009258", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'Hell,'", "output": "b'Hell,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009259", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[90, 87, 87, 70, 75]", "output": "[90, 87, 87]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009260", "code": "def build_conditions(filters):\n    conditions = []\n    for field, value in filters.items():\n        condition = f\"{field} = '{value}'\" if isinstance(value, str) else f\"{field} = {value}\"\n        conditions.append(condition)\n    return ' AND '.join(conditions)\n", "entry_point": "build_conditions", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33961_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009261", "code": "import sys\nDEFAULT_SERVER_UPTIME = 21 * 24 * 60 * 60\nMIN_SERVER_UPTIME = 1 * 24 * 60 * 60\nDEFAULT_MAX_APP_LEASE = 7 * 24 * 60 * 60\nDEFAULT_THRESHOLD = 0.9\ndef calculate_total_uptime(lease_durations):\n    total_uptime = 0\n    for lease_duration in lease_durations:\n        server_uptime = min(max(lease_duration, MIN_SERVER_UPTIME), DEFAULT_MAX_APP_LEASE)\n        total_uptime += server_uptime\n    return total_uptime\n", "entry_point": "calculate_total_uptime", "input": "[604800, 604800, 86400, 86400, 86400]", "output": "1468800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10263_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009262", "code": "def adjust_ratings(products, adjustment_factor):\n    updated_products = []\n    for product in products:\n        product['avg_rating'] += adjustment_factor\n        updated_products.append(product)\n    return updated_products\n", "entry_point": "adjust_ratings", "input": "[], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121319_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009263", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6337", "output": "{1, 6337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009264", "code": "from typing import List\ndef lift_simulation(people: int, lift: List[int]) -> str:\n    if people <= 0 and sum(lift) % 4 != 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people > 0:\n        return f\"There isn't enough space! {people} people in a queue!\\n\" + ' '.join(map(str, lift))\n    elif people <= 0 and sum(lift) == 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people <= 0:\n        return ' '.join(map(str, lift))\n", "entry_point": "lift_simulation", "input": "0, []", "output": "'The lift has empty spots!\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147066_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009265", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 0, 1]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009266", "code": "def calculate_xor_checksum(input_string):\n    checksum = 0\n    for char in input_string:\n        checksum ^= ord(char)\n    return checksum\n", "entry_point": "calculate_xor_checksum", "input": "'\\x07'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56407_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009267", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[1, 2, 4, 3, 8, 7, 16, 32, 12]", "output": "[1, 1, 1, 2, 1, 3, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009268", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6913", "output": "{1, 223, 6913, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009269", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 84, 78, 76, 76, 70]", "output": "[92, 84, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009270", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "16", "output": "2.388657133911758", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009271", "code": "def sum_non_border_elements(matrix):\n    if len(matrix) < 3 or len(matrix[0]) < 3:\n        return 0  # Matrix is too small to have non-border elements\n    total_sum = 0\n    for i in range(1, len(matrix) - 1):\n        for j in range(1, len(matrix[0]) - 1):\n            total_sum += matrix[i][j]\n    return total_sum\n", "entry_point": "sum_non_border_elements", "input": "[[1, 2], [3, 4]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88007_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009272", "code": "def calculate_median(numbers):\n    sorted_numbers = sorted(numbers)\n    length = len(sorted_numbers)\n    if length % 2 == 1:  # Odd number of elements\n        return sorted_numbers[length // 2]\n    else:  # Even number of elements\n        mid_right = length // 2\n        mid_left = mid_right - 1\n        return (sorted_numbers[mid_left] + sorted_numbers[mid_right]) / 2\n", "entry_point": "calculate_median", "input": "[5.0, 7.0]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15473_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009273", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[5, 8]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009274", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'CB'", "output": "['CB', 'BC']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009275", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 5, 1", "output": "24.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009276", "code": "def count_ways_to_climb_stairs(n):\n    if n == 0 or n == 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29461_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2555", "output": "{1, 35, 5, 7, 73, 365, 2555, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2554", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009278", "code": "def count_unique_characters(s: str) -> int:\n    char_count = {}\n    # Count occurrences of each character\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    unique_count = 0\n    for count in char_count.values():\n        if count == 1:\n            unique_count += 1\n    return unique_count\n", "entry_point": "count_unique_characters", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148025_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009279", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[65, 63, 62, 65, 65]", "output": "[62, 63, 65, 65, 65]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009280", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'my_dddg', '0'", "output": "'my_dddg_0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009281", "code": "from typing import List, Dict\ndef count_dependencies(dependencies: List[str]) -> Dict[str, int]:\n    dependency_count = {}\n    for dependency in dependencies:\n        if dependency in dependency_count:\n            dependency_count[dependency] += 1\n        else:\n            dependency_count[dependency] = 1\n    return dependency_count\n", "entry_point": "count_dependencies", "input": "['numpy', 'numpy', 'papotl']", "output": "{'numpy': 2, 'papotl': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8571_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009282", "code": "from typing import List\ndef maximize_min_distance(a: List[int], M: int) -> int:\n    a.sort()\n    def is_ok(mid):\n        last = a[0]\n        count = 1\n        for i in range(1, len(a)):\n            if a[i] - last >= mid:\n                count += 1\n                last = a[i]\n        return count >= M\n    left, right = 0, a[-1] - a[0]\n    while left < right:\n        mid = (left + right + 1) // 2\n        if is_ok(mid):\n            left = mid\n        else:\n            right = mid - 1\n    return left\n", "entry_point": "maximize_min_distance", "input": "[5], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125115_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009283", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'wate,kiwi,mango,pgraapple'", "output": "['wate', 'kiwi', 'mango', 'pgraapple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4038", "output": "{1, 2, 3, 2019, 1346, 4038, 6, 673}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4037", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009285", "code": "from typing import List\ndef process_numbers(numbers: List[int]) -> List[int]:\n    processed_numbers = []\n    for index, num in enumerate(numbers):\n        total = num + index\n        if total % 2 == 0:\n            processed_numbers.append(total ** 2)\n        else:\n            processed_numbers.append(total ** 3)\n    return processed_numbers\n", "entry_point": "process_numbers", "input": "[2, 3, 3, 0, 4, 0, 1, 2, 2]", "output": "[4, 16, 125, 27, 64, 125, 343, 729, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1098_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009286", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8873", "output": "{19, 1, 8873, 467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009287", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[5, 20, 7, 8, 7, 13, 12, 9]", "output": "[25, 27, 15, 15, 20, 25, 21, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009288", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[100, 90, 80, 70, 60, 60, 50, 40]", "output": "[1, 2, 3, 4, 5, 5, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009289", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[4, 2, 3, 5, 1]", "output": "[4, 2, 3, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009290", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 6, 3, 3]", "output": "[6, 9, 9, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009291", "code": "def card_game(player_a, player_b):\n    rounds_a_won = 0\n    rounds_b_won = 0\n    ties = 0\n    for card_a, card_b in zip(player_a, player_b):\n        if card_a > card_b:\n            rounds_a_won += 1\n        elif card_b > card_a:\n            rounds_b_won += 1\n        else:\n            ties += 1\n    return rounds_a_won, rounds_b_won, ties\n", "entry_point": "card_game", "input": "[6, 7, 8, 9, 10, 1], [5, 2, 3, 4, 0, 3]", "output": "(5, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34362_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009292", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "8, 5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009293", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[100, 90, 85, 80, 85, 71, 60], 6", "output": "85.16666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132005_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009294", "code": "# Constants mapping\nMEMORY_PROTECTION_CONSTANTS = {\n    0x80: \"PAGE_EXECUTE_WRITECOPY\",\n    0x100: \"PAGE_GUARD\",\n    0x1000: \"MEM_COMMIT\",\n    0x2000: \"MEM_RESERVE\",\n    0x8000: \"MEM_RELEASE\",\n    0x10000: \"MEM_FREE\",\n    0x20000: \"MEM_PRIVATE\",\n    0x40000: \"MEM_MAPPED\",\n    0x1000000: \"SEC_IMAGE\",\n    0x1000000: \"MEM_IMAGE\"\n}\ndef get_memory_protection_constant(constant_value):\n    if constant_value in MEMORY_PROTECTION_CONSTANTS:\n        return MEMORY_PROTECTION_CONSTANTS[constant_value]\n    else:\n        return \"Unknown Constant\"\n", "entry_point": "get_memory_protection_constant", "input": "0", "output": "'Unknown Constant'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106201_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8015", "output": "{1, 1603, 35, 5, 229, 7, 8015, 1145}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009296", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'SthrMMr', 8", "output": "'SthrMMr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009297", "code": "def calculate_score(player1_cards, player2_cards):\n    cards = player1_cards if len(player1_cards) > 0 else player2_cards\n    result = 0\n    count = 1\n    while len(cards) > 0:\n        result += cards.pop() * count\n        count += 1\n    return result\n", "entry_point": "calculate_score", "input": "[2, 5, 9], []", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83679_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009298", "code": "def determine_winner(N, player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "determine_winner", "input": "3, [1, 2, 3], [1, 2, 3]", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31130_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009299", "code": "def count_unique_dependencies(dependencies):\n    unique_dependencies_count = {}\n    for dependency in dependencies:\n        package, dependency_name = dependency.split()\n        if package in unique_dependencies_count:\n            unique_dependencies_count[package].add(dependency_name)\n        else:\n            unique_dependencies_count[package] = {dependency_name}\n    return {package: len(dependencies) for package, dependencies in unique_dependencies_count.items()}\n", "entry_point": "count_unique_dependencies", "input": "['pkg1 dep1', 'pkg1 dep2', 'pkg1 dep3']", "output": "{'pkg1': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1592_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009300", "code": "def is_xpath_selector(selector):\n    return selector.startswith('/')\n", "entry_point": "is_xpath_selector", "input": "'/example'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92618_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009301", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'3.1133'", "output": "(3, 1133)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009302", "code": "from typing import List\nfrom heapq import heapify, heappop\ndef find_kth_largest(nums: List[int], k: int) -> int:\n    if not nums:\n        return None\n    # Create a max-heap by negating each element\n    heap = [-num for num in nums]\n    heapify(heap)\n    # Pop k-1 elements from the heap\n    for _ in range(k - 1):\n        heappop(heap)\n    # Return the kth largest element (negate the result)\n    return -heap[0]\n", "entry_point": "find_kth_largest", "input": "[10, 8, 7], 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124799_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009303", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 15, 30]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100977_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009304", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6106", "output": "{1, 2, 71, 43, 3053, 142, 86, 6106}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6105", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009305", "code": "def count_even_odd(numbers):\n    even_count = 0\n    odd_count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n    return even_count, odd_count\n", "entry_point": "count_even_odd", "input": "[2, 1, 3, 5]", "output": "(1, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51670_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9232", "output": "{1, 2, 1154, 4, 2308, 577, 4616, 8, 9232, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9231", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009307", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0  # Handle the case where there are no scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[87.0], 1", "output": "87.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44364_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009308", "code": "def distance_to_camera(knownWidth, focalLength, perWidth):\n    # Compute and return the distance from the object to the camera\n    return (knownWidth * focalLength) / perWidth\n", "entry_point": "distance_to_camera", "input": "50, 68.28679245283018, 10", "output": "341.4339622641509", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71888_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009309", "code": "def simple_conv1d(input_data, filter_data, stride):\n    output = []\n    input_size = len(input_data)\n    filter_size = len(filter_data)\n    num_iterations = (input_size - filter_size) // stride + 1\n    for i in range(num_iterations):\n        start_idx = i * stride\n        end_idx = start_idx + filter_size\n        conv_result = sum([a * b for a, b in zip(input_data[start_idx:end_idx], filter_data)])\n        output.append(conv_result)\n    return output\n", "entry_point": "simple_conv1d", "input": "[0.5, 1.0, 1.5, 2.0, 2.5], [1.0, 1.0], 1", "output": "[1.5, 2.5, 3.5, 4.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55508_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009310", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "123, {}", "output": "'123-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009311", "code": "from typing import Tuple\ndef determine_connection_implementation(author_info: str) -> Tuple[str, str, str]:\n    author_name, author_email = author_info.split(\" <<\")\n    author_email = author_email.strip(\">>\")\n    connection_type = \"\"\n    service_list = \"\"\n    state_machine = \"\"\n    if \"IosXESingleRpConnection\" in dir():\n        connection_type = \"Single RP\"\n        service_list = \"IosXEServiceList\"\n        state_machine = \"IosXECat9kSingleRpStateMachine\"\n    elif \"IosXEDualRPConnection\" in dir():\n        connection_type = \"Dual RP\"\n        service_list = \"HAIosXEServiceList\"\n        state_machine = \"IosXECat9kDualRpStateMachine\"\n    return connection_type, service_list, state_machine\n", "entry_point": "determine_connection_implementation", "input": "'John Doe <<john.doe@example.com>>'", "output": "('', '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12084_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009312", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9872", "output": "{1, 2, 4, 2468, 4936, 8, 617, 9872, 16, 1234}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9871", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009313", "code": "def word_frequency(text):\n    text = text.lower()  # Convert text to lowercase\n    words = text.split()  # Split text into words\n    frequency_dict = {}  # Dictionary to store word frequencies\n    for word in words:\n        # Remove any punctuation marks if needed\n        word = word.strip('.,!?;:\"')\n        if word in frequency_dict:\n            frequency_dict[word] += 1\n        else:\n            frequency_dict[word] = 1\n    return frequency_dict\n", "entry_point": "word_frequency", "input": "'worldo'", "output": "{'worldo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117162_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009314", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9788", "output": "{1, 2, 4, 2447, 9788, 4894}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9787", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009315", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2476", "output": "{1, 2, 4, 619, 2476, 1238}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2475", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009316", "code": "def diagnose(data):\n    char_counts = {}\n    for char in data:\n        if char in char_counts:\n            char_counts[char] += 1\n        else:\n            char_counts[char] = 1\n    return char_counts\n", "entry_point": "diagnose", "input": "'hellohell'", "output": "{'h': 2, 'e': 2, 'l': 4, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98386_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5034", "output": "{1, 2, 3, 6, 839, 5034, 1678, 2517}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009318", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4196", "output": "{1, 2, 4196, 4, 2098, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4195", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009319", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'Triemli'", "output": "'Triemli, Z\u00fcrich'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009320", "code": "def calculate_total_size_in_kb(file_sizes):\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "calculate_total_size_in_kb", "input": "[9216]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119982_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009321", "code": "def max_non_adjacent_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[15, 2, 14]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11871_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009322", "code": "def min_changes_to_anagram(bigger_str, smaller_str):\n    str_counter = {}\n    for char in bigger_str:\n        if char in str_counter:\n            str_counter[char] += 1\n        else:\n            str_counter[char] = 1\n    for char in smaller_str:\n        if char in str_counter:\n            str_counter[char] -= 1\n    needed_changes = 0\n    for counter in str_counter.values():\n        needed_changes += abs(counter)\n    return needed_changes\n", "entry_point": "min_changes_to_anagram", "input": "'aabbccddeeffgg', 'abcde'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124427_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009323", "code": "def card_game_winner(N, T):\n    player1_sum = 0\n    player2_sum = 0\n    for card in range(1, N + 1):\n        if player1_sum + card <= T:\n            player1_sum += card\n        else:\n            if player2_sum + card <= T:\n                player2_sum += card\n    if player1_sum > player2_sum:\n        return 1\n    elif player2_sum > player1_sum:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_game_winner", "input": "6, 10", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46837_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009324", "code": "from typing import List\ndef count_contours(contour_areas: List[int], threshold: int) -> int:\n    cumulative_sum = 0\n    contour_count = 0\n    for area in contour_areas:\n        cumulative_sum += area\n        contour_count += 1\n        if cumulative_sum >= threshold:\n            return contour_count\n    return contour_count\n", "entry_point": "count_contours", "input": "[1, 2, 2], 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21235_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009325", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[12, 12, 12, 5]", "output": "[12, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009326", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[71, 70, 69, 65, 65, 60]", "output": "[71, 70, 69]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009327", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'swoisrld!'", "output": "['swoisrld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009328", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['0.1.1', '1.0.1', '1.0.2', '0.10.0']", "output": "'1.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49230_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009329", "code": "from typing import List\ndef min_ram_changes(devices: List[int]) -> int:\n    total_ram = sum(devices)\n    avg_ram = total_ram // len(devices)\n    changes_needed = sum(abs(avg_ram - ram) for ram in devices)\n    return changes_needed\n", "entry_point": "min_ram_changes", "input": "[1, 3, 8, 15]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74774_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009330", "code": "def calculate_total_elements(maxlag, disp_lag, dt):\n    # Calculate the total number of elements in the matrix\n    total_elements = 2 * int(disp_lag / dt) + 1\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "0, -4, 1", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39261_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7270", "output": "{1, 2, 5, 7270, 10, 1454, 3635, 727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7269", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009332", "code": "def normalize_text(text):\n    normalized_text = []\n    word = \"\"\n    for char in text:\n        if char.isalnum():\n            word += char\n        elif word:\n            normalized_text.append(word)\n            word = \"\"\n    if word:\n        normalized_text.append(word)\n    return \" \".join(normalized_text).lower()\n", "entry_point": "normalize_text", "input": "'helworld! h'", "output": "'helworld h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35252_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009333", "code": "def filter_gt_avg(numbers):\n    if not numbers:\n        return []\n    avg = sum(numbers) / len(numbers)\n    return [num for num in numbers if num > avg]\n", "entry_point": "filter_gt_avg", "input": "[6, 7, 8, 8]", "output": "[8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15446_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009334", "code": "def extract_unique_tags(html_content):\n    unique_tags = set()\n    tag = ''\n    inside_tag = False\n    for char in html_content:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n            tag = tag.strip()\n            if tag:\n                unique_tags.add(tag)\n            tag = ''\n        elif inside_tag:\n            if char.isalnum():\n                tag += char\n    return sorted(list(unique_tags))\n", "entry_point": "extract_unique_tags", "input": "'<bbody></bbody>'", "output": "['bbody']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126025_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009335", "code": "from typing import List\ndef find_longest_subarray_with_sum(nums: List[int], target_sum: int) -> List[int]:\n    sum_index_map = {0: -1}\n    current_sum = 0\n    max_length = 0\n    result = []\n    for i, num in enumerate(nums):\n        current_sum += num\n        if current_sum - target_sum in sum_index_map and i - sum_index_map[current_sum - target_sum] > max_length:\n            max_length = i - sum_index_map[current_sum - target_sum]\n            result = nums[sum_index_map[current_sum - target_sum] + 1:i + 1]\n        if current_sum not in sum_index_map:\n            sum_index_map[current_sum] = i\n    return result\n", "entry_point": "find_longest_subarray_with_sum", "input": "[4], 4", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26568_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009336", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'Spaces'", "output": "('Spaces', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009337", "code": "def elementwise_less_equal(v1, v2):\n    result = []\n    for val1, val2 in zip(v1, v2):\n        result.append(val1 <= val2)\n    return result\n", "entry_point": "elementwise_less_equal", "input": "[1, 2, 3], [2, 2, 1]", "output": "[True, True, False]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11405_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009338", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'ziep_cod: 90Y'", "output": "{'ziep_cod': '90Y'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009339", "code": "def check_exit_code(command_result, expected_exit_code):\n    return command_result == expected_exit_code\n", "entry_point": "check_exit_code", "input": "0, 0", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38664_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009340", "code": "def count_word_frequencies(messages):\n    word_freq = {}\n    for message in messages:\n        words = message.lower().split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132213_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009341", "code": "import ast\ndef count_unique_tensorlayer_input_classes(script_content):\n    unique_classes = set()\n    tree = ast.parse(script_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.ImportFrom) and node.module == 'tensorlayer.layers.core':\n            for alias in node.names:\n                if alias.name.endswith('Input'):\n                    unique_classes.add(alias.name)\n    return len(unique_classes)\n", "entry_point": "count_unique_tensorlayer_input_classes", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83412_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "878", "output": "{1, 2, 878, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009343", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "12", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009344", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "9", "output": "'./prespawned/version9_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009345", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[-1, 2, -1, 0, 9, -2, 7]", "output": "[-2, -1, -1, 0, 2, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009346", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 2, 2, 2, 12, 12, 12, 9, 13]", "output": "([2, 2, 2, 2, 12, 12, 12], [9, 13])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009347", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[80, 80, 80, 80, 85, 70], 6", "output": "79.16666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009348", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'application/rss+xml'", "output": "('application', 'rss', 'xml', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009349", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "6", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009350", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    n = len(scores)\n    dp = [0] * n\n    dp[0] = scores[0]\n    for i in range(1, n):\n        if scores[i] > scores[i - 1]:\n            dp[i] = max(dp[i], dp[i - 1] + scores[i])\n        else:\n            dp[i] = dp[i - 1]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[1, 2, 3, 4, 5, 8]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127370_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3713", "output": "{1, 3713, 79, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009352", "code": "def max_palindrome_length(s: str) -> int:\n    char_count = {}\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    max_length = 0\n    for count in char_count.values():\n        max_length += count if count % 2 == 0 else count - 1\n    return max_length\n", "entry_point": "max_palindrome_length", "input": "'aabb'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124507_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009353", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6872", "output": "{1, 2, 4, 8, 3436, 1718, 6872, 859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6871", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009354", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[1, 2, 2, 2, 2, 2, 3]", "output": "[2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009355", "code": "def sum_of_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "20", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49804_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009356", "code": "from math import sqrt\ndef calculate_distances(points):\n    distances = []\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            distances.append(distance)\n    return distances\n", "entry_point": "calculate_distances", "input": "[(0, 0), (2, 2)]", "output": "[2.8284271247461903]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64177_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009357", "code": "from typing import List, Dict\ndef convert_variable_types(variables: List[str]) -> Dict[str, str]:\n    variable_types = {}\n    for var in variables:\n        var_name, var_type = var.split(\":\")\n        var_name = var_name.strip()\n        var_type = var_type.strip()\n        variable_types[var_name] = var_type\n    return variable_types\n", "entry_point": "convert_variable_types", "input": "['_Features: ']", "output": "{'_Features': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46156_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009358", "code": "def find_nth_fibonacci(first, second, n):\n    if n == 1:\n        return first\n    elif n == 2:\n        return second\n    else:\n        for i in range(n - 2):\n            next_num = first + second\n            first, second = second, next_num\n        return next_num\n", "entry_point": "find_nth_fibonacci", "input": "0, 1, 7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81618_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009359", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8559", "output": "{1, 3, 2853, 9, 8559, 951, 27, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1759", "output": "{1, 1759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009361", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'examp.com'", "output": "'examp.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009362", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "0, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009363", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'3.10.5'", "output": "'3.10.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009364", "code": "def generate_indices(s):\n    modes = []\n    for i, c in enumerate(s):\n        modes += [i] * int(c)\n    return sorted(modes)\n", "entry_point": "generate_indices", "input": "'22311'", "output": "[0, 0, 1, 1, 2, 2, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130187_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009365", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[12, 10, 2, 0]", "output": "248", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4220_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009366", "code": "def longest_common_subsequence(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m):\n        for j in range(n):\n            if s1[i] == s2[j]:\n                dp[i + 1][j + 1] = dp[i][j] + 1\n            else:\n                dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "'AGGTAB', 'GXTXAYB'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009367", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'XRPBTC'", "output": "('XRP', 'BTC')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9397", "output": "{1, 9397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009369", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{0: [1], 1: [2]}, -1", "output": "[-1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009370", "code": "from os.path import join, dirname, basename\nfrom glob import glob\nfrom typing import List\ndef process_vhdl_files(directory: str, vhdl_standard: str) -> List[str]:\n    lib_files = []\n    for file_name in glob(join(directory, \"*.vhd\")):\n        if basename(file_name).endswith(\"2008p.vhd\") and vhdl_standard not in [\"2008\", \"2019\"]:\n            continue\n        lib_files.append(file_name)\n    return lib_files\n", "entry_point": "process_vhdl_files", "input": "'path/to/nonexistent/directory', '2010'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128578_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009371", "code": "def min_unsorted_subarray_length(nums):\n    n = len(nums)\n    sorted_nums = sorted(nums)\n    start, end = n + 1, -1\n    for i in range(n):\n        if nums[i] != sorted_nums[i]:\n            start = min(start, i)\n            end = max(end, i)\n    diff = end - start\n    return diff + 1 if diff > 0 else 0\n", "entry_point": "min_unsorted_subarray_length", "input": "[1, 3, 5, 7, 2, 4, 6, 8]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20405_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009372", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7185", "output": "{1, 3, 5, 15, 7185, 2395, 1437, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009373", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "2, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009374", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7657", "output": "{1, 7657, 13, 589, 19, 403, 247, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009375", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "3, 4", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009376", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "25, 25", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009377", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'85,92,7,88'", "output": "[85, 92, 7, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009378", "code": "def is_domain_allowed(allowed_hosts, domain_name):\n    for host in allowed_hosts:\n        if domain_name == host or domain_name.endswith('.' + host):\n            return True\n    return False\n", "entry_point": "is_domain_allowed", "input": "['example.com', 'allowed.com'], 'unrelatedsite.com'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81860_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009379", "code": "def extract_imported_paths(code_snippet):\n    imported_paths = set()\n    for line in code_snippet.split('\\n'):\n        if 'from macadam.conf.path_config import' in line:\n            paths = line.split('import ')[1].split(',')\n            for path in paths:\n                imported_paths.add(path.strip())\n    return list(imported_paths)\n", "entry_point": "extract_imported_paths", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97399_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009380", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "{'CONF_NUMBER': 17}", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009381", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[1, 5, 5, 6]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009382", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'hello world'", "output": "'hello_world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009383", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 78, 76]", "output": "[92, 78, 76]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009384", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'uuuuu', 1", "output": "'vvvvv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009385", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char.isalpha():\n            char_lower = char.lower()\n            char_frequency[char_lower] = char_frequency.get(char_lower, 0) + 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'wro'", "output": "{'w': 1, 'r': 1, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14987_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009386", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3313.13.14'", "output": "(3313, 13, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009387", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'RU'", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009388", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6814", "output": "{1, 2, 6814, 3407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6813", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009389", "code": "def validate_directive_arguments(args):\n    required_arguments = 2\n    optional_arguments = 0\n    final_argument_whitespace = False\n    option_spec = {\n        'alt': str,\n        'width': int,\n        'height': int,\n    }\n    num_required = 0\n    has_final_whitespace = False\n    for key, value in args.items():\n        if key in option_spec:\n            if not isinstance(value, option_spec[key]):\n                return False\n        elif key == '_final_argument':\n            if ' ' in value:\n                return False\n            has_final_whitespace = True\n        else:\n            num_required += 1\n    if num_required < required_arguments or num_required + len(args) - 1 > required_arguments + optional_arguments:\n        return False\n    return not has_final_whitespace\n", "entry_point": "validate_directive_arguments", "input": "{'arg1': 'value1'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148236_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009390", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char == \" \":\n            encrypted_text += \" \"\n        else:\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'tloia', 7", "output": "'asvph'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51413_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009391", "code": "import re\ndef extract_authors_names(code_snippet):\n    pattern = r'\\*\\*Autores de los comentarios:\\*\\* (.+?) & (.+?)\\n'\n    match = re.search(pattern, code_snippet, re.DOTALL)\n    if match:\n        return [match.group(1), match.group(2)]\n    else:\n        return []\n", "entry_point": "extract_authors_names", "input": "'This is a sample text without authors.'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47619_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009392", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_counts = {}\n    for word in words:\n        word = word.strip('.,')  # Remove punctuation if present\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'uthemubdmod'", "output": "{'uthemubdmod': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117339_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009393", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8093", "output": "{1, 8093}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009394", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "1, 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009395", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'LVIII'", "output": "58", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3352", "output": "{1, 2, 419, 4, 838, 8, 1676, 3352}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3351", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009397", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "6", "output": "'312211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009398", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009399", "code": "def calculate_absolute_differences_sum(arr):\n    total_diff = 0\n    for i in range(1, len(arr)):\n        total_diff += abs(arr[i] - arr[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 7, 14, 21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67231_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009400", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "0, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009401", "code": "def count_pairs_with_difference(nums, k):\n    count = 0\n    num_set = set(nums)\n    for num in nums:\n        if num + k in num_set or num - k in num_set:\n            count += 1\n    return count\n", "entry_point": "count_pairs_with_difference", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1892_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009402", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7941", "output": "{1, 3, 7941, 2647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009403", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[3, 6, 12, 24, 48]", "output": "[3, 6, 12, 24, 48]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009404", "code": "AUTHORIZED_TOKENS = [\"G<PASSWORD>\", \n                    \"ME<PASSWORD>\", \n                    \"<PASSWORD>\", \n                    \"LK<PASSWORD>\", \n                    \"WATER-104d38\", \n                    \"COLORS-14cff1\"]\nTOKEN_TYPE_U8 = {\"Fungible\" : \"00\",\n                \"NonFungible\" : \"01\", \n                \"SemiFungible\" : \"02\", \n                \"Meta\" : \"03\"}\ndef token_type(token):\n    if any(token.startswith(prefix) for prefix in [\"G\", \"ME\", \"LK\"]) or token.endswith(\"-<6 characters>\"):\n        return \"Fungible\"\n    elif token.startswith(\"<\"):\n        return \"NonFungible\"\n    elif token.startswith(\"WATER-\") or token.startswith(\"COLORS-\"):\n        return \"SemiFungible\"\n    else:\n        return \"Meta\"\n", "entry_point": "token_type", "input": "'<12345>'", "output": "'NonFungible'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68341_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009405", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[6.444444444444445]", "output": "6.444444444444445", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009406", "code": "def find_highest_score_index(scores):\n    highest_score = float('-inf')\n    highest_score_index = -1\n    for i in range(len(scores)):\n        if scores[i] > highest_score:\n            highest_score = scores[i]\n            highest_score_index = i\n        elif scores[i] == highest_score and i < highest_score_index:\n            highest_score_index = i\n    return highest_score_index\n", "entry_point": "find_highest_score_index", "input": "[1, 2, 3, 4, 5, 10, 5, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57664_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2819", "output": "{1, 2819}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009408", "code": "def sum_of_squares_of_even_numbers(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[2, 4]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108721_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "110", "output": "{1, 2, 5, 10, 11, 110, 22, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt109", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7443", "output": "{1, 3, 9, 2481, 7443, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009411", "code": "def solution(A, B, K):\n    count = 0\n    if A % K == 0:\n        count += 1\n    for i in range(A + (A % K), B + 1, K):\n        count += 1\n    return count\n", "entry_point": "solution", "input": "6, 17, 4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93792_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009412", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "5", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009413", "code": "def manhattan_distance(point1, point2):\n    x1, y1 = point1\n    x2, y2 = point2\n    return abs(x1 - x2) + abs(y1 - y2)\n", "entry_point": "manhattan_distance", "input": "(0, 0), (0, 0)", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128962_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009414", "code": "import re\n# Define the URL patterns and associated views\nurl_patterns = {\n    r\"^control/event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/covidcerts/$\": \"settings\"\n}\ndef match_url_to_view(url):\n    for pattern, view_name in url_patterns.items():\n        if re.match(pattern, url):\n            return view_name\n    return \"Not Found\"\n", "entry_point": "match_url_to_view", "input": "'control/event/john_doe/marathon/covidcerts/'", "output": "'settings'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116212_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5315", "output": "{1, 5315, 5, 1063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5314", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009416", "code": "def friend_group(adjacency):\n    def find(group, x):\n        if group[x] != x:\n            group[x] = find(group, group[x])\n        return group[x]\n    groups = []\n    mapping = {}\n    for i in adjacency:\n        if i not in mapping:\n            mapping[i] = i\n            groups.append({i})\n        for adj in adjacency[i]:\n            if adj in mapping:\n                root_i = find(mapping, i)\n                root_adj = find(mapping, adj)\n                if root_i != root_adj:\n                    groups[root_i].update(groups[root_adj])\n                    for member in groups[root_adj]:\n                        mapping[member] = root_i\n                    groups[root_adj] = set()\n    return [group for group in groups if group]\n", "entry_point": "friend_group", "input": "{'2': []}", "output": "[{'2'}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135255_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009417", "code": "def create_regions_dict(regions_list):\n    regions = {r[\"culture_code\"]: r for r in regions_list}\n    return regions\n", "entry_point": "create_regions_dict", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133493_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009418", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[6, 8, 8, 8, 3, 12, 5, 5, 5]", "output": "[6, 8, 8, 8, 9, 12, 25, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6484", "output": "{1, 2, 4, 3242, 6484, 1621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6483", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009420", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'Contact: <th@example.rg>'", "output": "('th@example.rg', 'example.rg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009421", "code": "def skipVowels(word):\n    novowels = ''\n    for ch in word:\n        if ch.lower() in 'aeiou':\n            continue\n        novowels += ch\n    return novowels\n", "entry_point": "skipVowels", "input": "'wood'", "output": "'wd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120866_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009422", "code": "def maxPower(s):\n    if not s:\n        return 0\n    max_power = 1\n    current_power = 1\n    current_char = s[0]\n    current_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            current_count += 1\n        else:\n            current_char = s[i]\n            current_count = 1\n        max_power = max(max_power, current_count)\n    return max_power\n", "entry_point": "maxPower", "input": "'aaaaa'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40173_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009423", "code": "def process_token_request(grant_type, scope, authentication):\n    if len(scope) > 1:\n        return 'Request rejected: Multiple scope parameters provided.'\n    else:\n        return 'Request successful.'\n", "entry_point": "process_token_request", "input": "'client_credentials', '', {}", "output": "'Request successful.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43102_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009424", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        patch = 0\n        minor += 1\n        if minor > 9:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'0.0.0'", "output": "'0.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58418_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009425", "code": "# Constants\nAUTH_DATA_FAIL_BAD_ID = -1\nAPI_BAD_REQUEST_BAD_OFFSET = \"Bad Request: Bad Offset\"\n# Function to retrieve icons based on input parameters\ndef get_all(params):\n    if 'offset' in params and params['offset'] == AUTH_DATA_FAIL_BAD_ID:\n        return API_BAD_REQUEST_BAD_OFFSET\n    else:\n        # Placeholder for actual retrieval logic\n        return \"Icons retrieved successfully\"\n", "entry_point": "get_all", "input": "{}", "output": "'Icons retrieved successfully'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139218_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009426", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello, my name is Thomas. illise'", "output": "'Thomas illise'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009427", "code": "import re\n_VALID_URL = r'https?://(www\\.)?willow\\.tv/videos/(?P<id>[0-9a-z-_]+)'\n_GEO_COUNTRIES = ['US']\ndef validate_url_access(url: str, country: str) -> bool:\n    if country not in _GEO_COUNTRIES:\n        return False\n    pattern = re.compile(_VALID_URL)\n    match = pattern.match(url)\n    return bool(match)\n", "entry_point": "validate_url_access", "input": "'http://www.willow.tv/videos/somevideo123', 'FR'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16371_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009428", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 10, 10, 20, 20, 28]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009429", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "932", "output": "{1, 2, 932, 4, 233, 466}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt931", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009430", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'KEY=e'", "output": "{'KEY': 'e'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009431", "code": "def validate_users_parameters(users, permissible_values):\n    invalid_parameters = []\n    for user_id, user_data in users.items():\n        for param, value in user_data.items():\n            if param in permissible_values:\n                if isinstance(permissible_values[param], tuple):\n                    if not permissible_values[param][0] <= value <= permissible_values[param][1]:\n                        invalid_parameters.append(f\"Invalid parameter for {user_id}: {param}\")\n                elif isinstance(permissible_values[param], list):\n                    if value not in permissible_values[param]:\n                        invalid_parameters.append(f\"Invalid parameter for {user_id}: {param}\")\n    return invalid_parameters\n", "entry_point": "validate_users_parameters", "input": "{'user1': {'age': 5}, 'user2': {'age': 8}}, {'age': (1, 10)}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136202_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009432", "code": "def evaluate_expression(expression):\n    try:\n        result = eval(expression)\n        return result\n    except ZeroDivisionError:\n        return \"Error: Division by zero\"\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "evaluate_expression", "input": "'10 + 1'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79055_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009433", "code": "def mesh_tree_depth(id):\n    if len(id) == 1:\n        return 0\n    else:\n        return id.count('.') + 1\n", "entry_point": "mesh_tree_depth", "input": "'x'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32418_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009434", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10  # Increment the last element in the list by 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[1, 2, 3, 4, 5, 6, 2]", "output": "[1, 4, 37, 16, 125, 46, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82710_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009435", "code": "def generate_http_response(status_code, fileType=None):\n    if status_code == 200:\n        return f\"HTTP/1.1 200 OK\\r\\nContent-type: {fileType}\\r\\n\\r\\n\"\n    elif status_code == 301:\n        return \"HTTP/1.1 301 Moved Permanently\\r\\n\\r\\n\".encode()\n    elif status_code == 404:\n        return \"HTTP/1.1 404 Not Found\\r\\n\\r\\n\".encode()\n    elif status_code == 405:\n        return \"HTTP/1.1 405 Method Not Allowed\\r\\n\\r\\n\".encode()\n    else:\n        return \"Invalid status code\".encode()\n", "entry_point": "generate_http_response", "input": "404", "output": "b'HTTP/1.1 404 Not Found\\r\\n\\r\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98337_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009436", "code": "def candy(A):\n    candies = [1] * len(A)\n    # Forward pass\n    for i in range(1, len(A)):\n        if A[i] > A[i - 1]:\n            candies[i] = candies[i - 1] + 1\n    result = candies[-1]\n    # Backward pass\n    for i in range(len(A) - 2, -1, -1):\n        if A[i] > A[i + 1]:\n            candies[i] = max(candies[i], candies[i + 1] + 1)\n        result += candies[i]\n    return result\n", "entry_point": "candy", "input": "[1, 0, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54117_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009437", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'oodwoorld'", "output": "{'oodwoorld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009438", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Two potential products:\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # First two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 3, 3, 3]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130562_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009439", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "['F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F']", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009440", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "28", "output": "28.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009441", "code": "import re\nDATE_PATTERN = re.compile(r\"^\\s*([0-9]{2})/([0-9]{2})/([0-9]{4})$\")\nDATE2_PATTERN = re.compile(r\"^\\s*([0-9]{4})-([0-9]{2})-([0-9]{2})$\")\nDATETIME_PATTERN = re.compile(\n    r\"\"\"\n        ^\\s*\n        ([0-9]{2})/\n        ([0-9]{2})/\n        ([0-9]{4})\\s+\n        ([0-9]{2}):\n        ([0-9]{2})\n        (?::([0-9]{2}))?\n        $\n    \"\"\",\n    re.X,\n)\ndef validate_date_format(date_str):\n    if DATE_PATTERN.match(date_str) or DATE2_PATTERN.match(date_str) or DATETIME_PATTERN.match(date_str):\n        return True\n    return False\n", "entry_point": "validate_date_format", "input": "'31-01-2020'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87573_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009442", "code": "def generate_error_endpoint(blueprint_name, url_prefix):\n    # Concatenate the URL prefix with the blueprint name to form the complete API endpoint URL\n    api_endpoint = f\"{url_prefix}/{blueprint_name}\"\n    return api_endpoint\n", "entry_point": "generate_error_endpoint", "input": "'errorreports', '/api/v1/errors'", "output": "'/api/v1/errors/errorreports'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69413_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4915", "output": "{1, 4915, 5, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4914", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009444", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcdef', 'ghijkl'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009445", "code": "def reverse_and_uppercase(string):\n    reversed_uppercase = string[::-1].upper()\n    return reversed_uppercase\n", "entry_point": "reverse_and_uppercase", "input": "'HH'", "output": "'HH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45524_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009446", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 1, 3, 5, 4, -2, -1, 3, 1]", "output": "[0, 2, 10, 24, 32, 15, 30, 70, 72]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009447", "code": "def calculate_similarity(v1, v2, cost_factor):\n    similarity_score = 0\n    for val1, val2 in zip(v1, v2):\n        dot_product = val1 * val2\n        cost = abs(val1 - val2)\n        similarity_score += dot_product * cost_factor * cost\n    return similarity_score\n", "entry_point": "calculate_similarity", "input": "[4, 6], [4, 8], 2", "output": "192", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115100_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009448", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[1, 0], [0, 2]]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1145_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009449", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        sum_val = input_list[i] + input_list[(i + 1) % n]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2, 4, 2, 2, 5, 1]", "output": "[4, 6, 6, 4, 7, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149618_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009450", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'RRU'", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009451", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "43", "output": "{1, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt42", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009452", "code": "MSG_DATE_SEP = \">>>:\"\nEND_MSG = \"THEEND\"\nALLOWED_KEYS = [\n    'q',\n    'e',\n    's',\n    'z',\n    'c',\n    '',\n]\ndef process_input(input_str):\n    if MSG_DATE_SEP in input_str:\n        index = input_str.find(MSG_DATE_SEP)\n        if index + len(MSG_DATE_SEP) < len(input_str):\n            char = input_str[index + len(MSG_DATE_SEP)]\n            if char in ALLOWED_KEYS:\n                return char\n    elif END_MSG in input_str:\n        return ''\n    return \"INVALID\"\n", "entry_point": "process_input", "input": "'THEEND'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90484_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009453", "code": "from typing import List\ndef max_average_score(scores: List[int]) -> float:\n    max_avg = float('-inf')\n    window_sum = 0\n    window_size = 0\n    for score in scores:\n        window_sum += score\n        window_size += 1\n        if window_sum / window_size > max_avg:\n            max_avg = window_sum / window_size\n        if window_sum < 0:\n            window_sum = 0\n            window_size = 0\n    return max_avg\n", "entry_point": "max_average_score", "input": "[2, 2]", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6333_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009454", "code": "def validate_csp_directives(csp_directives: dict, uri_scheme: str) -> list:\n    matching_uris = []\n    for directive in csp_directives.values():\n        uris = directive.split(';')\n        for uri in uris:\n            uri = uri.strip()\n            if uri.startswith(uri_scheme):\n                matching_uris.append(uri)\n    return matching_uris\n", "entry_point": "validate_csp_directives", "input": "{}, 'http'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128143_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009455", "code": "def min_removals_to_palindrome(stream):\n    def is_palindrome(s):\n        return s == s[::-1]\n    def min_removals_helper(s, left, right):\n        if left >= right:\n            return 0\n        if s[left] == s[right]:\n            return min_removals_helper(s, left + 1, right - 1)\n        else:\n            return 1 + min(min_removals_helper(s, left + 1, right), min_removals_helper(s, left, right - 1))\n    return min_removals_helper(stream, 0, len(stream) - 1)\n", "entry_point": "min_removals_to_palindrome", "input": "'abca'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84471_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009456", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    sum_evens = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_evens += num\n    return sum_evens\n", "entry_point": "sum_of_evens", "input": "[2, 8]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136227_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009457", "code": "def extract_revision_info(script):\n    revision_id = None\n    create_date = None\n    for line in script.splitlines():\n        if line.startswith(\"Revision ID:\"):\n            revision_id = line.split(\":\")[1].strip()\n        elif line.startswith(\"Create Date:\"):\n            create_date = line.split(\":\")[1].strip()\n    return {\"revision_id\": revision_id, \"create_date\": create_date}\n", "entry_point": "extract_revision_info", "input": "''", "output": "{'revision_id': None, 'create_date': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84416_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009458", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'a2:cd'", "output": "(162, 205)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009459", "code": "def get_brand_purchase_deets(customers, purchases):\n    brand_purchase_deets = {}\n    for customer, purchase in zip(customers, purchases):\n        brand = purchase % 3\n        if customer not in brand_purchase_deets:\n            brand_purchase_deets[customer] = {}\n        if brand not in brand_purchase_deets[customer]:\n            brand_purchase_deets[customer][brand] = 1\n        else:\n            brand_purchase_deets[customer][brand] += 1\n    return brand_purchase_deets\n", "entry_point": "get_brand_purchase_deets", "input": "[1, 1, 3], [3, 5, 6]", "output": "{1: {0: 1, 2: 1}, 3: {0: 1}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14257_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009460", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7190", "output": "{1, 2, 5, 10, 3595, 719, 7190, 1438}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7189", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009461", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[8, 8]", "output": "[8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt38", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009462", "code": "def parse_help_info(help_text):\n    method_dict = {}\n    lines = help_text.strip().split('\\n')\n    for line in lines:\n        if line.startswith('find_element_by_'):\n            method_name = line.replace('find_element_by_', '')\n            method_dict[method_name] = f'Finds an element by {method_name.replace(\"_\", \" \")}'\n    return method_dict\n", "entry_point": "parse_help_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106722_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009463", "code": "from typing import List\ndef find_index(sparse_array: List[str], query: str) -> int:\n    left, right = 0, len(sparse_array) - 1\n    while left <= right:\n        mid = (left + right) // 2\n        if sparse_array[mid] == \"\":\n            l, r = mid - 1, mid + 1\n            while True:\n                if l < left and r > right:\n                    return -1\n                elif r <= right and sparse_array[r] != \"\":\n                    mid = r\n                    break\n                elif l >= left and sparse_array[l] != \"\":\n                    mid = l\n                    break\n                l -= 1\n                r += 1\n        if sparse_array[mid] == query:\n            return mid\n        elif sparse_array[mid] < query:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return -1\n", "entry_point": "find_index", "input": "['apple', '', 'banana'], 'cherry'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80214_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009464", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: int) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    result = []\n    while end < len(temperatures):\n        if max(temperatures[start:end+1]) - min(temperatures[start:end+1]) <= threshold:\n            if end - start + 1 > max_length:\n                max_length = end - start + 1\n                result = temperatures[start:end+1]\n            end += 1\n        else:\n            start += 1\n    return result\n", "entry_point": "longest_contiguous_subarray", "input": "[70, 73, 74, 75, 78], 2", "output": "[73, 74, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105139_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009465", "code": "from typing import List\ndef count_pairs_sum_target(nums: List[int], target: int) -> int:\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            pair_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_sum_target", "input": "[1, 1, 2, 2, 3, 4, 4], 5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134075_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009466", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3517", "output": "{1, 3517}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009467", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[8.0, 8.4, -1, -5]", "output": "8.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009468", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'ie_ig'", "output": "('ie_ig', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009469", "code": "def process_commands(input_str):\n    running_total = 0\n    commands = input_str.split()\n    for command in commands:\n        op = command[0]\n        if len(command) > 1:\n            num = int(command[1:])\n        else:\n            num = 0\n        if op == 'A':\n            running_total += num\n        elif op == 'S':\n            running_total -= num\n        elif op == 'M':\n            running_total *= num\n        elif op == 'D' and num != 0:\n            running_total //= num\n        elif op == 'R':\n            running_total = 0\n    return running_total\n", "entry_point": "process_commands", "input": "'A1 S1 R'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106417_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009470", "code": "def max_non_overlapping_sticks(sticks, target):\n    sticks.sort()  # Sort the sticks in ascending order\n    selected_sticks = 0\n    total_length = 0\n    for stick in sticks:\n        if total_length + stick <= target:\n            selected_sticks += 1\n            total_length += stick\n    return selected_sticks\n", "entry_point": "max_non_overlapping_sticks", "input": "[1, 2, 3, 4, 10], 10", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122772_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009471", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'100 20 3'", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2357", "output": "{1, 2357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009473", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filer3e3'", "output": "['filer3e3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009474", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 2, 1, 3, 3, 1, 1, 3]", "output": "[2, 2, 9, 12, 5, 6, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6243", "output": "{3, 1, 6243, 2081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009476", "code": "def sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "18", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_965_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009477", "code": "from typing import List\ndef find_majority_element(nums: List[int]) -> int:\n    d = dict()\n    result = -1\n    half = len(nums) // 2\n    for num in nums:\n        if num in d:\n            d[num] += 1\n        else:\n            d[num] = 1\n    for k in d:\n        if d[k] >= half:\n            result = k\n            break\n    return result\n", "entry_point": "find_majority_element", "input": "[3, 3, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122021_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5483", "output": "{1, 5483}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009479", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[5, 1, 1, -3, 2, -3]", "output": "[6, 2, -2, -1, -1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009480", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "122, {}", "output": "'122-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009481", "code": "def get_speckle_subobjects(attr, scale, name):\n    subobjects = []\n    for key in attr:\n        subtype = attr[key].get(\"type\", None)\n        if subtype:\n            subobject = {\"name\": f\"{name}.{key}\", \"type\": subtype}\n            subobjects.append(subobject)\n            props = attr[key].get(\"properties\", None)\n            if props:\n                subobjects.extend(get_speckle_subobjects(props, scale, subobject[\"name\"]))\n    return subobjects\n", "entry_point": "get_speckle_subobjects", "input": "{}, 1, 'test'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009482", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "867", "output": "{1, 289, 3, 867, 17, 51}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009483", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'lllwor'", "output": "{'l': 3, 'w': 1, 'o': 1, 'r': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16186_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9879", "output": "{1, 3, 37, 267, 111, 9879, 89, 3293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9878", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009485", "code": "from typing import List\ndef calculate_highest_score(scores: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = score + exclude\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "calculate_highest_score", "input": "[5, 0, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24235_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009486", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 2, 2, 3, 4, 4, 5]", "output": "{1: 2, 2: 2, 3: 1, 4: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009487", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9311", "output": "{1, 9311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009488", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4767", "output": "{1, 3, 227, 7, 681, 1589, 21, 4767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2428", "output": "{1, 2, 4, 2428, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2427", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009490", "code": "import datetime\ndef get_days_in_previous_month(current_date):\n    year, month, _ = map(int, current_date.split('-'))\n    # Calculate the previous month\n    if month == 1:\n        previous_month = 12\n        previous_year = year - 1\n    else:\n        previous_month = month - 1\n        previous_year = year\n    # Calculate the number of days in the previous month\n    if previous_month in [1, 3, 5, 7, 8, 10, 12]:\n        days_in_previous_month = 31\n    elif previous_month == 2:\n        if previous_year % 4 == 0 and (previous_year % 100 != 0 or previous_year % 400 == 0):\n            days_in_previous_month = 29\n        else:\n            days_in_previous_month = 28\n    else:\n        days_in_previous_month = 30\n    return days_in_previous_month\n", "entry_point": "get_days_in_previous_month", "input": "'2023-01-15'", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21493_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009491", "code": "def most_frequent_element(sequence):\n    frequency = {}\n    max_freq = 0\n    most_frequent_element = None\n    for num in sequence:\n        if num in frequency:\n            frequency[num] += 1\n        else:\n            frequency[num] = 1\n        if frequency[num] > max_freq:\n            max_freq = frequency[num]\n            most_frequent_element = num\n    return most_frequent_element\n", "entry_point": "most_frequent_element", "input": "[0, 0, 1, 1, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23662_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009492", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9443", "output": "{1, 9443, 1349, 133, 7, 71, 497, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009493", "code": "def process_criteria(criteria: str) -> int:\n    name, operator = criteria.split(':')\n    result = ord(name[0]) & ord(operator[-1])\n    return result\n", "entry_point": "process_criteria", "input": "'a:y'", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137762_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009494", "code": "def sum_even_fibonacci(limit):\n    fib_sequence = [0, 1]\n    even_sum = 0\n    current_fib = 1\n    while current_fib <= limit:\n        if current_fib % 2 == 0:\n            even_sum += current_fib\n        fib_sequence.append(current_fib)\n        current_fib = fib_sequence[-1] + fib_sequence[-2]\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35181_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009495", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'hello'", "output": "'h.e.l.l.o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009496", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[6, 6]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143850_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009497", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "14", "output": "[1, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009498", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8], 7", "output": "128.57142857142858", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009499", "code": "from typing import List\ndef latest_version(versions: List[str]) -> str:\n    latest_version = versions[0]\n    for version in versions[1:]:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['2.5.0', '3.0.0']", "output": "'3.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138257_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009500", "code": "def extract_base_directory(file_path):\n    base_dir = \"\"\n    for i in range(len(file_path) - 1, -1, -1):\n        if file_path[i] == '/':\n            base_dir = file_path[:i]\n            break\n    return base_dir\n", "entry_point": "extract_base_directory", "input": "'/home/file.txt'", "output": "'/home'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67520_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009501", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'Charlie'", "output": "[('Charlie', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009502", "code": "def calculate_tf_frequency(tf_names):\n    tf_frequency = {}\n    for tf_name in tf_names:\n        if tf_name in tf_frequency:\n            tf_frequency[tf_name] += 1\n        else:\n            tf_frequency[tf_name] = 1\n    return tf_frequency\n", "entry_point": "calculate_tf_frequency", "input": "['TTF2', 'TFTFTF12', 'TTFTF1T']", "output": "{'TTF2': 1, 'TFTFTF12': 1, 'TTFTF1T': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24416_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009503", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "23, 12", "output": "0.9166666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009504", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    # Split the input string at the '.' character\n    app_name, config_class = default_app_config.split('.')[:2]\n    # Return a tuple containing the app name and configuration class name\n    return app_name, config_class\n", "entry_point": "parse_default_app_config", "input": "'gunmeps.GunmelConfig'", "output": "('gunmeps', 'GunmelConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77517_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009505", "code": "def custom_pad4(s, char):\n    padding_needed = 4 - (len(s) % 4)\n    padded_string = s + char * padding_needed\n    return padded_string\n", "entry_point": "custom_pad4", "input": "'Heeee', '*'", "output": "'Heeee***'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132634_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009506", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3592", "output": "{1, 2, 898, 1796, 4, 449, 3592, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3591", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009507", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009508", "code": "def simulate_card_game(deck1, deck2):\n    score_player1 = 0\n    score_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score_player1 += 1\n        elif card2 > card1:\n            score_player2 += 1\n    return score_player1, score_player2\n", "entry_point": "simulate_card_game", "input": "[3, 5, 2, 1, 4], [2, 1, 3, 4, 5]", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107463_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009509", "code": "from typing import List\ndef rearrange_list(a_list: List[int]) -> int:\n    pivot = a_list[-1]\n    list_length = len(a_list)\n    for i in range(list_length - 2, -1, -1):  # Iterate from the second last element to the first\n        if a_list[i] > pivot:\n            a_list.insert(list_length, a_list.pop(i))  # Move the element to the right of the pivot\n    return a_list.index(pivot)\n", "entry_point": "rearrange_list", "input": "[0, 2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141863_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009510", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "12", "output": "650", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009511", "code": "def min_subarray_length(nums, target):\n    left = 0\n    size = len(nums)\n    res = size + 1\n    sub_sum = 0\n    for right in range(size):\n        sub_sum += nums[right]\n        while sub_sum >= target:\n            sub_length = (right - left + 1)\n            if sub_length < res:\n                res = sub_length\n            sub_sum -= nums[left]\n            left += 1\n    if res == (size + 1):\n        return 0\n    else:\n        return res\n", "entry_point": "min_subarray_length", "input": "[1, 2], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127187_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009512", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4031", "output": "{1, 139, 29, 4031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009513", "code": "def calculate_total_images_processed(num_train_samples, train_batch_size, train_steps):\n    total_images_processed = num_train_samples * train_batch_size * train_steps\n    return total_images_processed\n", "entry_point": "calculate_total_images_processed", "input": "2, 1, 44505329", "output": "89010658", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82078_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009514", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "9, [2, 6, 3, 2, 6, 0, 1, 1, 1]", "output": "[6, 2, 2, 3, 0, 6, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009515", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Two potential products:\n    # 1. Product of the last three elements\n    max_product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    # 2. Product of the first two elements and the last element\n    max_product2 = nums[0] * nums[1] * nums[n-1]\n    return max(max_product1, max_product2)\n", "entry_point": "max_product_of_three", "input": "[2, 2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56636_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009516", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "65.0, 3.59, 100.0", "output": "877.2857142857143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009517", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "15", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009518", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "10, 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009519", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "11", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009520", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 3, 5, 6, 7]", "output": "[2, 6, 10, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009521", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 7, 3, -1, 5, -2, -1, -3, -1]", "output": "[1, 8, 5, 2, 9, 3, 5, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009522", "code": "def sum_of_primes(nums):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in nums:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138176_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009523", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[5, 5, 2, -1, 0, 1, 1]", "output": "[5, 2, -1, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009524", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9257", "output": "{1, 9257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6212", "output": "{1, 3106, 2, 6212, 4, 1553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6211", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009526", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[100, 96, 95, 93, 89, 75], 4", "output": "96.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74521_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009527", "code": "def categorize_students(scores):\n    groups = {'A': [], 'B': [], 'C': []}\n    for score in scores:\n        if score >= 80:\n            groups['A'].append(score)\n        elif 60 <= score <= 79:\n            groups['B'].append(score)\n        else:\n            groups['C'].append(score)\n    return groups\n", "entry_point": "categorize_students", "input": "[86, 91, 90, 86, 46]", "output": "{'A': [86, 91, 90, 86], 'B': [], 'C': [46]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63935_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009528", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i + 1 < len(input_list):\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[3, 5, 2, 3, 4, 2, 7]", "output": "[8, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54766_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1753", "output": "{1, 1753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009530", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6782", "output": "{1, 2, 6782, 3391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009531", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    num_rounds = min(len(player1_deck), len(player2_deck))\n    for round_num in range(num_rounds):\n        if player1_deck[round_num] > player2_deck[round_num]:\n            player1_score += 1\n        else:\n            player2_score += 1\n    return player1_score, player2_score\n", "entry_point": "simulate_card_game", "input": "[0, 1, 2, 3], [1, 2, 3, 4]", "output": "(0, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38237_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009532", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[3, 9, 10, 8, 0, 7, 6, 101], 101, 8", "output": "[3, 101, 101, 101, 0, 7, 6, 101]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3037", "output": "{1, 3037}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3036", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009534", "code": "from typing import List, Dict\ndef filter_virtual_machines(vm_list: List[Dict[str, str]]) -> List[str]:\n    filtered_vms = []\n    for vm in vm_list:\n        if vm.get('name', '').startswith('V') and len(vm.get('name', '')) > 5:\n            filtered_vms.append(vm['name'])\n    return filtered_vms\n", "entry_point": "filter_virtual_machines", "input": "[{'name': 'App1'}, {'name': 'Server'}, {'name': 'VM'}, {'name': 'T'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71130_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009535", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'TTh cohe'", "output": "'cohe TTh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9429", "output": "{1, 449, 3, 1347, 7, 3143, 9429, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009537", "code": "from typing import List, Dict\ndef count_doc_word_pairs(docs_of_words: List[List[str]], word_to_id: Dict[str, int]) -> Dict[tuple, int]:\n    doc_word_freq = {}\n    for doc_id, doc_words in enumerate(docs_of_words):\n        for word in doc_words:\n            word_id = word_to_id[word]\n            pair = (doc_id, word_id)\n            doc_word_freq[pair] = doc_word_freq.get(pair, 0) + 1\n    return doc_word_freq\n", "entry_point": "count_doc_word_pairs", "input": "[], {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94558_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "589", "output": "{1, 19, 589, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3", "output": "{1, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009540", "code": "def sum_of_multiples(matrix, target):\n    total_sum = 0\n    for row in matrix:\n        for element in row:\n            if element % target == 0:\n                total_sum += element\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7703_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1786", "output": "{1, 2, 38, 47, 19, 1786, 893, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009542", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, -1, 6, 2, 6, 1, 1, 4, 1]", "output": "[-1, 12, 6, 24, 5, 6, 28, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009543", "code": "def find_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    complement_sequence = ''\n    for nucleotide in dna_sequence:\n        complement_sequence += complement_dict.get(nucleotide.upper(), '')  # Handle case-insensitive input\n    return complement_sequence\n", "entry_point": "find_complement", "input": "'ATCG'", "output": "'TAGC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101417_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009544", "code": "def calculate_average(scores):\n    if len(scores) < 2:\n        return 0\n    min_score = min(scores)\n    max_score = max(scores)\n    scores.remove(min_score)\n    scores.remove(max_score)\n    average = sum(scores) / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[85, 87.75, 87.75, 87.75, 90]", "output": "87.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121549_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5462", "output": "{1, 2, 2731, 5462}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5461", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009546", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'3.0.13'", "output": "(3, 0, 13)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009547", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[95, 92, 90]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135338_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009548", "code": "def _determine_vmax(max_data_value):\n    vmax = 1\n    if max_data_value > 255:\n        vmax = None\n    elif max_data_value > 1:\n        vmax = 255\n    return vmax\n", "entry_point": "_determine_vmax", "input": "130", "output": "255", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21347_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009549", "code": "def parse_config_file(config_data: str) -> dict:\n    config_dict = {}\n    for line in config_data.split('\\n'):\n        line = line.strip()\n        if line and not line.startswith('#'):\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip()\n    return config_dict\n", "entry_point": "parse_config_file", "input": "'SERVER_PORT=80\\n# this is a comment\\n'", "output": "{'SERVER_PORT': '80'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101724_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009550", "code": "def encrypt_string(input_string):\n    encrypted_result = \"\"\n    for i, char in enumerate(input_string):\n        if char.isalpha():\n            shift_amount = i + 1\n            if char.islower():\n                encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n            else:\n                encrypted_char = chr((ord(char) - ord('A') + shift_amount) % 26 + ord('A'))\n        else:\n            encrypted_char = char\n        encrypted_result += encrypted_char\n    return encrypted_result\n", "entry_point": "encrypt_string", "input": "'Hel'", "output": "'Igo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110857_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6115", "output": "{1, 6115, 5, 1223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009552", "code": "from typing import List\ndef find_sum_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_val = min_val = nums[0]\n    for num in nums[1:]:\n        if num > max_val:\n            max_val = num\n        elif num < min_val:\n            min_val = num\n    return max_val + min_val\n", "entry_point": "find_sum_of_max_min", "input": "[10, 1, 3, 5]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16636_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009553", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[5, 5, 2, 2, 4, 1, 3, 3]", "output": "[5, 2, 4, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009554", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/h', 'exaeeexx'", "output": "'/h/exaeeexx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009555", "code": "def find_device_port(device_name):\n    FAUXMOS = [\n        ['tv', 45671],\n        #['sound', 45672]\n    ]\n    for device in FAUXMOS:\n        if device[0] == device_name:\n            return device[1]\n    return -1\n", "entry_point": "find_device_port", "input": "'tv'", "output": "45671", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54767_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009556", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive > 0:\n        return sum_positive / count_positive\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[6.0, 7.2]", "output": "6.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60830_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009557", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/ttsm', 'exaet'", "output": "'/ttsm/exaet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009558", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009559", "code": "def find_unique_element(A):\n    result = 0\n    for number in A:\n        result ^= number\n    return result\n", "entry_point": "find_unique_element", "input": "[1, 2, 2, 3, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26858_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009560", "code": "from typing import List\nimport os\ndef load_order(package_path: str) -> List[str]:\n    graph = {}\n    modules = []\n    # Traverse the package directory\n    for root, _, files in os.walk(package_path):\n        for file in files:\n            if file.endswith('.py') and file != '__init__.py':\n                module_name = file.replace('.py', '')\n                modules.append(module_name)\n                graph[module_name] = []\n                with open(os.path.join(root, file), 'r') as f:\n                    for line in f:\n                        if line.startswith('# Dependencies:'):\n                            dependencies = line.strip().split(': ')[1].split(', ')\n                            graph[module_name].extend(dependencies)\n    # Topological sort\n    load_order = []\n    visited = set()\n    def dfs(node):\n        if node in visited:\n            return\n        visited.add(node)\n        for dependency in graph[node]:\n            dfs(dependency)\n        load_order.append(node)\n    for module in modules:\n        dfs(module)\n    return load_order[::-1]\n", "entry_point": "load_order", "input": "'/non_existent_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88196_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5931", "output": "{1, 3, 9, 5931, 659, 1977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009562", "code": "def viewTGA(command):\n    if command == '0':\n        return \"Command 0 executed successfully.\"\n    else:\n        return \"Invalid command.\"\n", "entry_point": "viewTGA", "input": "'1'", "output": "'Invalid command.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133517_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009563", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[6, 6, 6, 2, 2, 3, 3, 3]", "output": "[36, 36, 36, 4, 4, 27, 27, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009564", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3088", "output": "{1, 2, 386, 4, 772, 193, 1544, 8, 3088, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3087", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009565", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6994", "output": "{1, 2, 26, 3497, 13, 269, 6994, 538}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009566", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'aa, Ld', 10", "output": "'kk, Vn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20125_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009567", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[1, 1, 1, 1, 1, 1, 0, 1, 0]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009568", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "903, 0", "output": "903", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009569", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "5, 6", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009570", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5531", "output": "{1, 5531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2171", "output": "{1, 2171, 13, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009572", "code": "def calculate_dot_product(vector1, vector2):\n    dot_product = 0\n    for i in range(len(vector1)):\n        dot_product += vector1[i] * vector2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[4, 4], [2, 2]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3479_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009573", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3527", "output": "{1, 3527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009574", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'21.2'", "output": "(21, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009575", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'t123400T00t134'", "output": "'00T00t134'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009576", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1024", "output": "b'\\x00\\x00\\x04\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8529", "output": "{8529, 1, 3, 2843}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009578", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "5", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009579", "code": "def device_status_summary(nb_devices):\n    status_summary = {\"active\": 0, \"offline\": 0, \"unknown\": 0}\n    for device in nb_devices.get(\"results\", []):\n        status = device.get(\"status\", \"unknown\")\n        if status in status_summary:\n            status_summary[status] += 1\n        else:\n            status_summary[\"unknown\"] += 1\n    return status_summary\n", "entry_point": "device_status_summary", "input": "{'results': []}", "output": "{'active': 0, 'offline': 0, 'unknown': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108960_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009580", "code": "from itertools import chain\ndef count_segments(starts, ends, points):\n    cnt = [0] * len(points)\n    start_points = zip(starts, ['l'] * len(starts), range(len(starts)))\n    end_points = zip(ends, ['r'] * len(ends), range(len(ends)))\n    point_points = zip(points, ['p'] * len(points), range(len(points)))\n    sort_list = chain(start_points, end_points, point_points)\n    sort_list = sorted(sort_list, key=lambda a: (a[0], a[1]))\n    segment_count = 0\n    for num, letter, index in sort_list:\n        if letter == 'l':\n            segment_count += 1\n        elif letter == 'r':\n            segment_count -= 1\n        else:\n            cnt[index] = segment_count\n    return cnt\n", "entry_point": "count_segments", "input": "[1, 2], [2, 3], [1, 2, 4]", "output": "[1, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23716_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009581", "code": "def count_total_fields_added(migrations):\n    total_fields_added = 0\n    for migration in migrations:\n        operations = migration.get(\"operations\", [])\n        total_fields_added += len(operations)\n    return total_fields_added\n", "entry_point": "count_total_fields_added", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40647_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009582", "code": "def get_earnings_color(notification_type):\n    # Define earnings notification colors and transparent PNG URL\n    EARNINGS_COLORS = {\n        \"beat\": \"20d420\",\n        \"miss\": \"d42020\",\n        \"no consensus\": \"000000\"\n    }\n    TRANSPARENT_PNG = \"https://cdn.major.io/wide-empty-transparent.png\"\n    # Return the color code based on the notification type\n    return EARNINGS_COLORS.get(notification_type.lower(), \"FFFFFF\")  # Default to white for invalid types\n", "entry_point": "get_earnings_color", "input": "'beat'", "output": "'20d420'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38125_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009583", "code": "def format_attribute_map(attribute_map):\n    formatted_output = []\n    for attribute, info in attribute_map.items():\n        key = info['key']\n        data_type = info['type']\n        formatted_output.append(f\"Attribute: {key} - Type: {data_type}\")\n    return '\\n'.join(formatted_output)\n", "entry_point": "format_attribute_map", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41834_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009584", "code": "import json\ndef execute_and_format_result(input_data):\n    try:\n        result = eval(input_data)\n        if type(result) in [list, dict]:\n            return json.dumps(result, indent=4)\n        else:\n            return result\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "execute_and_format_result", "input": "'[1, 2, 3]'", "output": "'[\\n    1,\\n    2,\\n    3\\n]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97741_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009585", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5419", "output": "{1, 5419}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009586", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[84, 85, 88]", "output": "85.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3587_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009587", "code": "from typing import List\nimport logging\ndef process_cookies(cookie_indices: List[int]) -> List[int]:\n    valid_cookies_index = [index for index in cookie_indices if index % 2 == 0 and index % 3 == 0]\n    logging.info('Checking the cookie for validity is over.')\n    return valid_cookies_index\n", "entry_point": "process_cookies", "input": "[1, 3, 5, 6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99711_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009588", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "8", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009589", "code": "def calculate_trainable_params(total_params, non_trainable_params):\n    trainable_params = total_params - non_trainable_params\n    return trainable_params\n", "entry_point": "calculate_trainable_params", "input": "24767874, 0", "output": "24767874", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112905_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009590", "code": "def calculate_max_profit(K, A, B):\n    if B - A <= 2 or 1 + (K - 2) < A:\n        return K + 1\n    exchange_times, last = divmod(K - (A - 1), 2)\n    profit = B - A\n    return A + exchange_times * profit + last\n", "entry_point": "calculate_max_profit", "input": "4, 3, 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88263_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009591", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[5, 8, 2]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009592", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6343", "output": "{1, 6343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009593", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[1, 0, 3, 4]", "output": "[1, 0, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2911", "output": "{1, 41, 71, 2911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009595", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8656", "output": "{1, 2, 4, 4328, 8, 8656, 16, 2164, 1082, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8655", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009596", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009597", "code": "def final_state(state):\n    final_state = state.copy()\n    for i in range(1, len(state)):\n        if state[i] != state[i - 1]:\n            final_state[i] = 0\n    return final_state\n", "entry_point": "final_state", "input": "[1, 2, 0, 0, 0, 0, 0, 0]", "output": "[1, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82567_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009598", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'iT'", "output": "'iT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009599", "code": "import os\ndef find_zip_or_egg_index(filename):\n    normalized_path = os.path.normpath(filename)\n    zip_index = normalized_path.find('.zip')\n    egg_index = normalized_path.find('.egg')\n    if zip_index != -1 and egg_index != -1:\n        return min(zip_index, egg_index)\n    elif zip_index != -1:\n        return zip_index\n    elif egg_index != -1:\n        return egg_index\n    else:\n        return -1\n", "entry_point": "find_zip_or_egg_index", "input": "'filename_example.zip'", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_581_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009600", "code": "def calculate_total_sum(videoFiles):\n    total_sum = 0\n    for video_file in videoFiles:\n        number = int(video_file.split('_')[1].split('.')[0])\n        total_sum += number\n    return total_sum\n", "entry_point": "calculate_total_sum", "input": "['video_5.mp4', 'video_6.mp4', 'video_5.mp4']", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146951_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7769", "output": "{7769, 1, 457, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009602", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009603", "code": "def count_unique_even_numbers(numbers):\n    unique_evens = set()\n    for num in numbers:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_even_numbers", "input": "[0, 2, 4, 6, 8, 1, 3, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17662_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009604", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "21.0, 10.0", "output": "21.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4943", "output": "{1, 4943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009606", "code": "def custom_wrapper(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            modified_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            modified_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            modified_list.append(\"Buzz\")\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "custom_wrapper", "input": "[16, 4, 15, 3, 7, 2, 4]", "output": "[16, 4, 'FizzBuzz', 'Fizz', 7, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139069_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009607", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{0: 5, 2: 2, 3: 5}, 3", "output": "'[5,0,2,5]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009608", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'1100011'", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009609", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'osien'", "output": "'Value of osien'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009610", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[4, 1, 5, 5, 1, 0]", "output": "[1, 1, 1, 1, 5, 5, 5, 5, 5, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009611", "code": "from typing import List\ndef delete_entities(entity_list: List[int], delete_ids: List[int]) -> List[int]:\n    return [entity for entity in entity_list if entity not in delete_ids]\n", "entry_point": "delete_entities", "input": "[3, 3, 2, 5, 5, 4], []", "output": "[3, 3, 2, 5, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62424_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009612", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'04x02406'", "output": "{'bytecode': '0x04x02406'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009613", "code": "def extract_file_extension(file_path):\n    # Find the last occurrence of the dot ('.') in the file path\n    dot_index = file_path.rfind('.')\n    # Check if a dot was found and the dot is not at the end of the file path\n    if dot_index != -1 and dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character after the last dot\n        return file_path[dot_index + 1:]\n    # Return an empty string if no extension found\n    return \"\"\n", "entry_point": "extract_file_extension", "input": "'example.doc.txt'", "output": "'txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73936_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009614", "code": "def pageCount(n, p):\n    # Calculate pages turned from the front\n    front_turns = p // 2\n    # Calculate pages turned from the back\n    if n % 2 == 0:\n        back_turns = (n - p) // 2\n    else:\n        back_turns = (n - p - 1) // 2\n    return min(front_turns, back_turns)\n", "entry_point": "pageCount", "input": "8, 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96390_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009615", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0'", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009616", "code": "def update_mongo_user(mongo, api_key):\n    updated_mongo = mongo.copy()\n    updated_mongo[\"user\"] = api_key\n    return updated_mongo\n", "entry_point": "update_mongo_user", "input": "{}, 'abc16'", "output": "{'user': 'abc16'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8030_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009617", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3454", "output": "{1, 2, 11, 22, 314, 157, 3454, 1727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3962", "output": "{1, 2, 7, 14, 566, 3962, 283, 1981}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009619", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 2, 3, 4]", "output": "[1, 3, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009620", "code": "from typing import Tuple\ndef final_position(directions: str, grid_size: int) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    x = max(-grid_size, min(grid_size, x))\n    y = max(-grid_size, min(grid_size, y))\n    return (x, y)\n", "entry_point": "final_position", "input": "'UUUURRRR', 4", "output": "(4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81995_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7715", "output": "{1, 7715, 5, 1543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7714", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009622", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "115", "output": "151", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009623", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "232", "output": "{1, 2, 4, 232, 8, 116, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt231", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009624", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1863", "output": "{1, 3, 69, 1863, 9, 621, 207, 81, 23, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009625", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "6, 8", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009626", "code": "legacy_bundled_packages = {\n    'pycurl': [2, 3],\n    'scribe': [2],\n    'dataclasses': [3]\n}\ndef is_legacy_bundled_package(package_name: str, python_version: int) -> bool:\n    if package_name in legacy_bundled_packages:\n        return python_version in legacy_bundled_packages[package_name]\n    return False\n", "entry_point": "is_legacy_bundled_package", "input": "'pycurl', 2", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132979_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009627", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "2, -2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009628", "code": "def separate_euler_angles(euler_angles):\n    x_components = [euler[0] for euler in euler_angles]\n    y_components = [euler[1] for euler in euler_angles]\n    z_components = [euler[2] for euler in euler_angles]\n    return x_components, y_components, z_components\n", "entry_point": "separate_euler_angles", "input": "[[30, 45, 60], [90, 180, 270]]", "output": "([30, 90], [45, 180], [60, 270])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61480_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009629", "code": "def sum_of_digit_squares(n: int) -> int:\n    total_sum = 0\n    for digit in str(n):\n        total_sum += int(digit) ** 2\n    return total_sum\n", "entry_point": "sum_of_digit_squares", "input": "421", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47266_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009630", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "599186, 1", "output": "599186", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009631", "code": "from typing import List\ndef is_small_straight(dice: List[int]) -> bool:\n    if dice is None:\n        return False\n    def number_counts(dice: List[int]) -> dict:\n        counts = {}\n        for num in dice:\n            counts[num] = counts.get(num, 0) + 1\n        return counts\n    counts = number_counts(dice)\n    return (\n        counts.get(2, 0) > 0\n        and counts.get(3, 0) > 0\n        and (\n            (counts.get(1, 0) > 0 and (counts.get(4, 0) > 0 or counts.get(5, 0) > 0))\n            or (counts.get(2, 0) > 0 and counts.get(5, 0) > 0)\n        )\n    )\n", "entry_point": "is_small_straight", "input": "[2, 3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135571_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009632", "code": "import re\ndef word_frequency(input_list):\n    word_freq = {}\n    for word in input_list:\n        word = re.sub(r'[^\\w\\s]', '', word).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29735_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009633", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 5, 2.5, 0]", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009634", "code": "def map_choices_to_descriptions(choices):\n    choices_dict = {}\n    for choice, description in choices:\n        choices_dict[choice] = description\n    return choices_dict\n", "entry_point": "map_choices_to_descriptions", "input": "[('s', 'Save'), ('c', 'Cancel')]", "output": "{'s': 'Save', 'c': 'Cancel'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115679_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009635", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'movingFreeBatchNorm'", "output": "'moving_free_batch_norm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009636", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[2, 4], 1, 2", "output": "[2, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2059", "output": "{1, 2059, 29, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009638", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'111123#@!Hlo%'", "output": "'111123Hlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009639", "code": "def average_working_hours(census):\n    senior_citizens = [person for person in census if person[0] > 60]  # Filter senior citizens based on age\n    if not senior_citizens:\n        return 0  # Return 0 if there are no senior citizens in the dataset\n    working_hours_sum = sum(person[3] for person in senior_citizens)  # Calculate total working hours of senior citizens\n    senior_citizens_len = len(senior_citizens)  # Get the number of senior citizens\n    avg_working_hours = working_hours_sum / senior_citizens_len  # Compute average working hours\n    return avg_working_hours\n", "entry_point": "average_working_hours", "input": "[(65, 'John Doe', 'Retired', 50)]", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123665_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009640", "code": "def rank_scores(scores):\n    score_counts = {}\n    for score in scores:\n        score_counts[score] = score_counts.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    ranks = {}\n    rank = 1\n    for score in unique_scores:\n        count = score_counts[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "rank_scores", "input": "[85, 70, 65, 63, 95, 80, 80]", "output": "[2, 5, 6, 7, 1, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135203_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009641", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[0, 4, 5, 4, 3, 0, 4]", "output": "[4, 9, 9, 7, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009642", "code": "from decimal import Decimal\ndef htdf_to_satoshi(amount_htdf):\n    amount_decimal = Decimal(str(amount_htdf))  # Convert input to Decimal\n    satoshi_value = int(amount_decimal * (10 ** 8))  # Convert HTDF to satoshi\n    return satoshi_value\n", "entry_point": "htdf_to_satoshi", "input": "139623.71397296", "output": "13962371397296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13302_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009643", "code": "def resolve_view(url: str) -> str:\n    url_patterns = [\n        ('add/', 'SlackAuthView.as_view(auth_type=\"add\")', 'slack_add'),\n        ('signin/', 'SlackAuthView.as_view(auth_type=\"signin\")', 'slack_signin'),\n        ('add-success/', 'DefaultAddSuccessView.as_view()', 'slack_add_success'),\n        ('signin-success/', 'DefaultSigninSuccessView.as_view()', 'slack_signin_success')\n    ]\n    for pattern, view, name in url_patterns:\n        if url.startswith(pattern):\n            return name\n    return 'Not Found'\n", "entry_point": "resolve_view", "input": "'signin/'", "output": "'slack_signin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141769_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009644", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3660", "output": "'1 hr 1 min'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009645", "code": "import sys\nNOT_FINISHED = sys.float_info.max\nconfig_values = {\n    \"car_icons\": [\"icon0\", \"icon1\", \"icon2\", \"icon3\"],\n    \"circuit\": \"Sample Circuit\",\n    \"coord_host\": \"localhost\",\n    \"coord_port\": 8000,\n    \"finish_line_name\": \"Finish Line 1\",\n    \"num_lanes\": 4,\n    \"race_timeout\": 60,\n    \"servo_down_value\": 0,\n    \"servo_up_value\": 1,\n    \"track_name\": \"Local Track\"\n}\ndef get_config_value(config_name: str) -> float:\n    return config_values.get(config_name, NOT_FINISHED)\n", "entry_point": "get_config_value", "input": "'circuit'", "output": "'Sample Circuit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117192_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009646", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[8, 3, 4, 2, 3, 3, 5, 1, 5], 7", "output": "[[8, 3, 4, 2, 3, 3, 5], [1, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009647", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[16, 16, 25, 9, 1]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009648", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6638", "output": "{1, 2, 6638, 3319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009649", "code": "def merge_sorted_lists(list1, list2):\n    merged_list = []\n    i, j = 0, 0\n    while i < len(list1) and j < len(list2):\n        if list1[i] < list2[j]:\n            merged_list.append(list1[i])\n            i += 1\n        else:\n            merged_list.append(list2[j])\n            j += 1\n    merged_list.extend(list1[i:])\n    merged_list.extend(list2[j:])\n    return merged_list\n", "entry_point": "merge_sorted_lists", "input": "[0, 3, 3], [1, 2, 3, 4]", "output": "[0, 1, 2, 3, 3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104249_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009650", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[20, 22]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009651", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[6], [5, 5], [2, 2], [5, 5], [6]]", "output": "[6, 5, 5, 2, 2, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009652", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'CBTTCHBTPAXUSDC'", "output": "('CBTTCHBTPAX', 'USDC')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009653", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'name=John'", "output": "{'name': 'John'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009654", "code": "from typing import List, Hashable\ndef longest_consecutive_sequence(lst: List[Hashable], target: Hashable) -> int:\n    current_length = 0\n    max_length = 0\n    for element in lst:\n        if element == target:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    return max_length\n", "entry_point": "longest_consecutive_sequence", "input": "[1, 2, 3, 4, 'a', 'b', 'c'], 'a'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57443_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009655", "code": "from typing import List, Union, Any\ndef count_unique_elements(input_list: List[Union[int, Any]]) -> int:\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_elements", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69046_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009656", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3797", "output": "{1, 3797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009657", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{0: 3, 5: 1, 2: 2}", "output": "[0, 0, 0, 5, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009658", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else []\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "calculate_top_players_average", "input": "[90, 93, 94], 3", "output": "92.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30456_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009659", "code": "def calculate(numbers):\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd\n", "entry_point": "calculate", "input": "[2, 4, 6, 7]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115831_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009660", "code": "def parse_version(version_str):\n    # Split the version number string using the dot as the delimiter\n    version_parts = version_str.split('.')\n    # Convert the version number components to integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return a tuple containing the major, minor, and patch version numbers\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'10.0.5'", "output": "(10, 0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42795_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009661", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9138", "output": "{1, 2, 3, 3046, 6, 9138, 1523, 4569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009662", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3676", "output": "{1, 2, 4, 1838, 919, 3676}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3675", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009663", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "10", "output": "1024", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009664", "code": "def dummy(n):\n    fibonacci_numbers = [0, 1]\n    while len(fibonacci_numbers) < n:\n        next_number = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        fibonacci_numbers.append(next_number)\n    return fibonacci_numbers[:n]\n", "entry_point": "dummy", "input": "8", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134685_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009665", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[2, 2, 2, 2, 2, 4, 4, 6, 10]", "output": "[2, 2, 2, 2, 2, 4, 4, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009666", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "10, 5", "output": "252", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009667", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'twiords i'", "output": "{'twiords': 1, 'i': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15367_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009668", "code": "def find_single_integer(nums):\n    integersDict = {}\n    for num in nums:\n        if num in integersDict:\n            integersDict[num] += 1\n        else:\n            integersDict[num] = 1\n    for integer in integersDict:\n        if integersDict[integer] != 3:\n            return integer\n    return nums[0]\n", "entry_point": "find_single_integer", "input": "[3, 1, 1, 1, 2, 2, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39275_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009669", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "11", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5009", "output": "{1, 5009}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5008", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009671", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3376", "output": "{1, 2, 4, 422, 8, 844, 3376, 16, 211, 1688}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009672", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'eel'", "output": "b'\\x03\\x00\\x00\\x00eel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009673", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[2, 3, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009674", "code": "def calculate_unique_lattice_points(kmesh):\n    k1, k2, k3 = kmesh\n    Rlist = [(R1, R2, R3) for R1 in range(-k1 // 2 + 1, k1 // 2 + 1)\n             for R2 in range(-k2 // 2 + 1, k2 // 2 + 1)\n             for R3 in range(-k3 // 2 + 1, k3 // 2 + 1)]\n    unique_points = set(Rlist)  # Convert to set to remove duplicates\n    return len(unique_points)\n", "entry_point": "calculate_unique_lattice_points", "input": "(6, 6, 1)", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135054_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009675", "code": "def sum_even_numbers(input_list):\n    total_sum = 0\n    for element in input_list:\n        if isinstance(element, str):\n            try:\n                num = int(element)\n                if num % 2 == 0:\n                    total_sum += num\n            except ValueError:\n                pass\n        elif isinstance(element, int) and element % 2 == 0:\n            total_sum += element\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "['100', 2]", "output": "102", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120619_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009676", "code": "def extract_domain_name(url):\n    # Remove the protocol part of the URL\n    url = url.split(\"://\")[-1]\n    # Extract the domain name by splitting at the first single forward slash\n    domain_name = url.split(\"/\")[0]\n    return domain_name\n", "entry_point": "extract_domain_name", "input": "'https:w.example.com/'", "output": "'https:w.example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96968_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009677", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zzk'", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009678", "code": "def find_second_smallest(nums):\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif num < second_smallest and num != smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33126_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009679", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'!!a0aaa00b@@'", "output": "'a0aaa00b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3539", "output": "{1, 3539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009681", "code": "def keep_alive(token):\n    return f\"Keeping connection alive with token: {token}\"\n", "entry_point": "keep_alive", "input": "'my__t_knn'", "output": "'Keeping connection alive with token: my__t_knn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98656_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009682", "code": "def count_non_whitespace_chars(input_string):\n    count = 0\n    for char in input_string:\n        if not char.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'abcdefgh'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117092_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009683", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8819", "output": "{1, 8819}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009684", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i + 1 < len(input_list):\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[3, 4, 2, 3, 0, 5, 3, 5, 1]", "output": "[7, 5, 5, 8, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54766_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009685", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 85, 86]", "output": "85.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49545_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009686", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1.0, 1.328125", "output": "1.328125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009687", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7096", "output": "{1, 2, 4, 8, 1774, 887, 7096, 3548}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7095", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009688", "code": "def unicode_converter(input_string):\n    result = \"\"\n    for char in input_string:\n        code_point = ord(char)\n        result += f\"\\\\u{format(code_point, 'x')}\"\n    return result\n", "entry_point": "unicode_converter", "input": "'lhell'", "output": "'\\\\u6c\\\\u68\\\\u65\\\\u6c\\\\u6c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4025_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009689", "code": "def find_special_number(n: int) -> int:\n    prod = 1\n    sum_ = 0\n    while n > 0:\n        last_digit = n % 10\n        prod *= last_digit\n        sum_ += last_digit\n        n //= 10\n    return prod - sum_\n", "entry_point": "find_special_number", "input": "22", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121266_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9046", "output": "{1, 2, 4523, 9046}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9045", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009691", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 60, 60]", "output": "[1, 2, 3, 4, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94997_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009692", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8039", "output": "{1, 8039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8038", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009693", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[-2, -2]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1594", "output": "{1, 1594, 2, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009695", "code": "def count_even_odd(numbers):\n    even_count = 0\n    odd_count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n    return even_count, odd_count\n", "entry_point": "count_even_odd", "input": "[0, 2, 4, 6, 1, 3, 5, 7, 9]", "output": "(4, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51670_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009696", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(3, 0, 12)", "output": "'3.0.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009697", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4621", "output": "{1, 4621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009698", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[2, 4, 6]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009699", "code": "def format_string(input_str: str) -> str:\n    parts = input_str.split('.')\n    formatted_parts = []\n    for part in parts:\n        if '(' in part:  # Check if it's a function\n            formatted_parts.append(part)\n        else:\n            formatted_parts.append(f'\"{part}\"')\n    return '.'.join(formatted_parts)\n", "entry_point": "format_string", "input": "'farfuncFunction().Ac.Foo.g2)'", "output": "'farfuncFunction().\"Ac\".\"Foo\".\"g2)\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134126_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009700", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[10, 4, 8, 6]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009701", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "131", "output": "'2:11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009702", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009703", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[29, 30, 31, 32, 35]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009704", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[0, 2, 5, 4, 3, 2, 5, 5, 3]", "output": "[0, 2, 7, 11, 14, 16, 21, 26, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009705", "code": "def basic_calculator(num1, num2, operator):\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n    elif operator == '*':\n        return num1 * num2\n    elif operator == '/':\n        if num2 == 0:\n            return \"Error: Division by zero is not allowed.\"\n        else:\n            return num1 / num2\n    else:\n        return \"Error: Invalid operator\"\n", "entry_point": "basic_calculator", "input": "10, 0, '/'", "output": "'Error: Division by zero is not allowed.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81801_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009706", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hhelheehh'", "output": "{'hhelheehh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009707", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'C_C_C_N'", "output": "'No occurrences found for bond type C_C_C_N'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009708", "code": "def custom_url_router(url_patterns):\n    url_mapping = {}\n    for pattern, view_func in url_patterns:\n        placeholders = [placeholder.strip('<>') for placeholder in pattern.split('/') if '<' in placeholder]\n        if not placeholders:\n            url_mapping[pattern] = view_func\n        else:\n            url_with_placeholders = pattern\n            for placeholder in placeholders:\n                url_with_placeholders = url_with_placeholders.replace(f'<{placeholder}>', f'<>{placeholder}')\n            url_mapping[url_with_placeholders] = view_func\n    return url_mapping\n", "entry_point": "custom_url_router", "input": "[('/about/', 'about_page')]", "output": "{'/about/': 'about_page'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87593_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009709", "code": "import importlib\ndef extract_exports(modules):\n    exports_dict = {}\n    for module_name in modules:\n        try:\n            module = importlib.import_module('.' + module_name, package=__name__)\n            exports = getattr(module, '__all__', [])\n            exports_dict[module_name] = exports\n        except (ModuleNotFoundError, AttributeError):\n            pass\n    return exports_dict\n", "entry_point": "extract_exports", "input": "['non_existent_module1', 'non_existent_module2']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82172_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009710", "code": "from typing import List\ndef max_difference_after(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    min_element = nums[0]\n    max_difference = 0\n    for num in nums[1:]:\n        difference = num - min_element\n        if difference > max_difference:\n            max_difference = difference\n        if num < min_element:\n            min_element = num\n    return max_difference\n", "entry_point": "max_difference_after", "input": "[3, 5, 8, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72615_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009711", "code": "def detect_circular_reference(graph):\n    def dfs(node, visited, current_path):\n        visited.add(node)\n        current_path.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor in current_path or (neighbor not in visited and dfs(neighbor, visited, current_path)):\n                return True\n        current_path.remove(node)\n        return False\n    visited = set()\n    for node in graph:\n        if node not in visited and dfs(node, visited, set()):\n            return True\n    return False\n", "entry_point": "detect_circular_reference", "input": "{'A': ['B'], 'B': ['C'], 'C': []}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116111_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009712", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38745_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009713", "code": "def jaccard_similarity(set1, set2):\n    intersection_size = len(set1.intersection(set2))\n    union_size = len(set1.union(set2))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    else:\n        return round(intersection_size / union_size, 2)\n", "entry_point": "jaccard_similarity", "input": "{1, 2, 3}, {2, 3, 4, 5}", "output": "0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148714_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009714", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[2, 5, 5, 4, 1]", "output": "[2, 5, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009715", "code": "import re\ndef extractVolChapterFragmentPostfix(title):\n    title = title.replace('-', '.')  # Replace hyphens with periods for consistency\n    match = re.match(r'v(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:\\s*(.*))?$', title, re.IGNORECASE)\n    if match:\n        vol = match.group(1)\n        chp = match.group(2)\n        frag = match.group(3)\n        postfix = match.group(4)\n        return vol, chp, frag, postfix\n    else:\n        return None, None, None, None\n", "entry_point": "extractVolChapterFragmentPostfix", "input": "'invalid_input'", "output": "(None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143168_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009716", "code": "def calculate_regression_coefficients(x, y):\n    if len(x) != len(y):\n        raise ValueError(\"Input lists x and y must have the same length\")\n    n = len(x)\n    mean_x = sum(x) / n\n    mean_y = sum(y) / n\n    SS_xx = sum((xi - mean_x) ** 2 for xi in x)\n    SS_xy = sum((xi - mean_x) * (yi - mean_y) for xi, yi in zip(x, y))\n    b_1 = SS_xy / SS_xx if SS_xx != 0 else 0  # Avoid division by zero\n    b_0 = mean_y - b_1 * mean_x\n    return b_0, b_1\n", "entry_point": "calculate_regression_coefficients", "input": "[0, 2], [0, 1]", "output": "(0.0, 0.5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83034_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009717", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[1, 2, [3, 4]]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2631", "output": "{1, 3, 877, 2631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009719", "code": "def count_max_progress(progress_list):\n    max_progress_count = 0\n    for progress in progress_list:\n        if progress == 10:\n            max_progress_count += 1\n    return max_progress_count\n", "entry_point": "count_max_progress", "input": "[10, 10, 10, 10, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93593_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009720", "code": "def simulate_test(db_name: str, test_script: str, substitutions: dict) -> str:\n    modified_script = test_script\n    for placeholder, value in substitutions.items():\n        modified_script = modified_script.replace(placeholder, str(value))\n    return modified_script\n", "entry_point": "simulate_test", "input": "'my_db', '', {}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128062_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009721", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "45, 30, 0", "output": "45.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009722", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3271", "output": "{1, 3271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009723", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'Jane'", "output": "[('Jane', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009724", "code": "import re\ndef validate_version(version):\n    complex_regex = \"^(.*)-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?(?:\\+(.*))$\"\n    simple_regex = \"^(.*)-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*).*\"\n    if re.match(complex_regex, version):\n        return \"Complex Version\"\n    elif re.match(simple_regex, version):\n        return \"Simple Version\"\n    else:\n        return \"Invalid Version\"\n", "entry_point": "validate_version", "input": "'mypackage-1.0.0'", "output": "'Simple Version'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75154_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009725", "code": "def max_consecutive_rounds(candies):\n    if not candies:\n        return 0\n    max_consecutive = 1\n    current_consecutive = 1\n    for i in range(1, len(candies)):\n        if candies[i] == candies[i - 1]:\n            current_consecutive += 1\n            max_consecutive = max(max_consecutive, current_consecutive)\n        else:\n            current_consecutive = 1\n    return max_consecutive\n", "entry_point": "max_consecutive_rounds", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31135_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009726", "code": "def solution(array):\n    result = array.copy()  # Create a copy of the input array to avoid modifying the original array\n    for i in range(len(array) - 1):\n        if array[i] == 0 and array[i + 1] == 1:\n            result[i], result[i + 1] = result[i + 1], result[i]  # Swap the elements if the condition is met\n    return result\n", "entry_point": "solution", "input": "[1, 1, -1, 3, 0, -1, 3, 2, 0]", "output": "[1, 1, -1, 3, 0, -1, 3, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107637_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009727", "code": "from typing import List, Dict\ndef map_error_codes(error_codes: List[int], errorcode: Dict[int, str]) -> List[str]:\n    symbolic_error_codes = [errorcode.get(code) for code in error_codes]\n    return symbolic_error_codes\n", "entry_point": "map_error_codes", "input": "[1, 2, 3, 4, 5], {}", "output": "[None, None, None, None, None]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82393_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009728", "code": "def lint_text(input_string):\n    errors = []\n    if \"error\" in input_string:\n        errors.append(\"error\")\n    if \"warning\" in input_string:\n        errors.append(\"warning\")\n    return errors\n", "entry_point": "lint_text", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20385_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009729", "code": "import string\ndef count_unique_words_in_text(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        cleaned_word = word.strip(string.punctuation).lower()\n        unique_words.add(cleaned_word)\n    return len(unique_words)\n", "entry_point": "count_unique_words_in_text", "input": "'Hello! hello. HELLO'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56347_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009730", "code": "def count_consecutive_i(input_str):\n    max_consecutive_i = 0\n    current_consecutive_i = 0\n    for char in input_str:\n        if char == 'i':\n            current_consecutive_i += 1\n            max_consecutive_i = max(max_consecutive_i, current_consecutive_i)\n        else:\n            current_consecutive_i = 0\n    return max_consecutive_i\n", "entry_point": "count_consecutive_i", "input": "'iiiiiiiiiiiiiiii'", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6207_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009731", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1293", "output": "{1, 3, 1293, 431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009732", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'Data includes FIG.HIJ in the record.'", "output": "[('FIG', 'HIJ')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009733", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "1, 10", "output": "b'\\n\\x00\\x00\\x00\\x01\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009734", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 5, 4, 3, 3, 1, 4]", "output": "[7, 9, 9, 7, 6, 4, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125440_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "327", "output": "{1, 3, 109, 327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009736", "code": "def min_operations(seq1, seq2):\n    size_x = len(seq1) + 1\n    size_y = len(seq2) + 1\n    matrix = [[0 for _ in range(size_y)] for _ in range(size_x)]\n    for x in range(1, size_x):\n        matrix[x][0] = x\n    for y in range(1, size_y):\n        matrix[0][y] = y\n    for x in range(1, size_x):\n        for y in range(1, size_y):\n            if seq1[x-1] == seq2[y-1]:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1],\n                    matrix[x][y-1] + 1\n                )\n            else:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1] + 1,\n                    matrix[x][y-1] + 1\n                )\n    return matrix[size_x - 1][size_y - 1]\n", "entry_point": "min_operations", "input": "'abcde', 'xyzabc'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43241_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009737", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[5, 5, 8, 7, 10, 10, 10]", "output": "7.857142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009738", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7321", "output": "{1, 7321}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6789", "output": "{1, 3, 6789, 73, 2263, 219, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009740", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[10, -2], [6, [3, 4]], [-1, [4, 10]]]", "output": "[10, -2, 6, 3, 4, -1, 4, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009741", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6436", "output": "{1, 2, 6436, 4, 1609, 3218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6435", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2107", "output": "{1, 7, 43, 301, 49, 2107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009743", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        circular_sum = input_list[i] + input_list[(i + 1) % list_length]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 3, 4, 0, 5, 5, 4]", "output": "[8, 7, 4, 5, 10, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117423_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7629", "output": "{1, 3, 7629, 2543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009745", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[5, 1, 4, 2, 0, 3, 5, 5]", "output": "[25, 1, 16, 4, 0, 9, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009746", "code": "CJ_PATH = r''\nCOOKIES_PATH = r''\nCHAN_ID = ''\nVID_ID = ''\ndef replace_variables(input_string, variable_type):\n    if variable_type == 'CHAN_ID':\n        return input_string.replace('CHAN_ID', CHAN_ID)\n    elif variable_type == 'VID_ID':\n        return input_string.replace('VID_ID', VID_ID)\n    else:\n        return input_string\n", "entry_point": "replace_variables", "input": "'VID_ID', 'CHAN_ID'", "output": "'VID_ID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27344_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009747", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[90, 85, 93, 90]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009748", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "42, 32, 56", "output": "42.54888888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009749", "code": "def calculate_file_size(chunk_lengths):\n    total_size = 0\n    seen_bytes = set()\n    for length in chunk_lengths:\n        total_size += length\n        for i in range(length - 1):\n            if total_size - i in seen_bytes:\n                total_size -= 1\n            seen_bytes.add(total_size - i)\n    return total_size\n", "entry_point": "calculate_file_size", "input": "[10, 10, 1]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134958_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009750", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_evens", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16654_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009751", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9019", "output": "{1, 9019, 29, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9662", "output": "{1, 2, 9662, 4831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009753", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009754", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'matplotlib.pyplot'", "output": "'matplotlib.pyplot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009755", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "25.0", "output": "298.15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009756", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "3", "output": "[0, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009757", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7556", "output": "{1, 2, 3778, 7556, 4, 1889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7555", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4799", "output": "{1, 4799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009759", "code": "from typing import Dict, Set, Tuple\nHeightmap = Dict[Tuple[int, int], int]\nBasin = Set[Tuple[int, int]]\ndef find_basins(heightmap: Heightmap) -> Basin:\n    basins = set()\n    for (x, y), height in heightmap.items():\n        is_basin = True\n        for dx, dy in [(0, -1), (0, 1), (-1, 0), (1, 0)]:\n            neighbor_height = heightmap.get((x + dx, y + dy), float('inf'))\n            if neighbor_height <= height:\n                is_basin = False\n                break\n        if is_basin:\n            basins.add((x, y))\n    return basins\n", "entry_point": "find_basins", "input": "{(0, 0): 2, (1, 0): 1, (0, 1): 1, (2, 0): 3, (1, 1): 4}", "output": "{(1, 0), (0, 1)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2080_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009760", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[20, 10, 30, 40, 20, 20, 20]", "output": "[1, 0, 2, 3, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009761", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3287", "output": "{1, 19, 173, 3287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3286", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009762", "code": "def solver(s: str, n: int) -> bool:\n    return any(len(word) >= n for word in s.split())\n", "entry_point": "solver", "input": "'hello world', 5", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45879_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009763", "code": "def sum_of_digit_squares(n):\n    sum_squares = 0\n    for digit in str(n):\n        digit_int = int(digit)\n        sum_squares += digit_int ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "521", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110328_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009764", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "100, 42", "output": "142", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8331", "output": "{3, 1, 8331, 2777}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009766", "code": "def calculate_points(scores):\n    if not scores:\n        return 0\n    total_points = 0\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            total_points += 1\n        else:\n            total_points -= 1\n    return total_points\n", "entry_point": "calculate_points", "input": "[1, 2, 1, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101160_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009767", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9778", "output": "{1, 9778, 2, 4889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009768", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[2, 3, 4, 0, 4, 2, 4, 2]", "output": "[5, 7, 4, 4, 6, 6, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009769", "code": "import inspect\ndef list_handlers(module_name):\n    handlers_list = []\n    try:\n        module = __import__(module_name)\n        members = inspect.getmembers(module, inspect.isclass)\n        for name, obj in members:\n            if name.endswith('Handler'):\n                handlers_list.append(name)\n    except ImportError:\n        print(f\"Module '{module_name}' not found.\")\n    return handlers_list\n", "entry_point": "list_handlers", "input": "'non_existing_module'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11031_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009770", "code": "def simulate_war_game(deck1, deck2):\n    table = []  # Cards on the table during a \"war\" round\n    while deck1 and deck2:  # Continue the game while both players have cards\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        table.extend([card1, card2])  # Place the revealed cards on the table\n        if card1 > card2:\n            deck1.extend(table)  # Player 1 wins the round\n            table.clear()\n        elif card2 > card1:\n            deck2.extend(table)  # Player 2 wins the round\n            table.clear()\n        else:  # \"War\" condition\n            if len(deck1) < 4 or len(deck2) < 4:\n                return 0 if len(deck2) < 4 else 1  # One player doesn't have enough cards for a \"war\"\n            table.extend(deck1[:3] + deck2[:3])  # Place additional cards face down\n            del deck1[:3]\n            del deck2[:3]\n    return 0 if deck2 else 1  # Return the index of the winning player\n", "entry_point": "simulate_war_game", "input": "[1, 2, 3], [4, 5, 6]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67979_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3341", "output": "{1, 13, 3341, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009772", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[1, 2, 3], 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009773", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5151", "output": "{1, 3, 101, 303, 17, 51, 1717, 5151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5150", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009774", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'executab.exe'", "output": "'executab.exe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009775", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(3, 2, 3, 3, 0, 3, 0, 3)", "output": "'3.2.3.3.0.3.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009776", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7386", "output": "{1, 2, 3, 6, 3693, 1231, 7386, 2462}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009777", "code": "def verify_wallet_handle(wallet_handle):\n    # Check if the wallet handle is a non-empty string\n    if not isinstance(wallet_handle, str) or not wallet_handle:\n        return False\n    # Check if the wallet handle contains only alphanumeric characters\n    if not wallet_handle.isalnum():\n        return False\n    # Check if the length of the wallet handle is within the range of 5 to 15 characters\n    if not 5 <= len(wallet_handle) <= 15:\n        return False\n    return True\n", "entry_point": "verify_wallet_handle", "input": "None", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105839_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009778", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'Hello,'", "output": "b'Hello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009779", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[0, 0, 3]", "output": "{0: 2, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009780", "code": "def validate_card(card_number: str) -> bool:\n    def digits_of(n):\n        return [int(d) for d in str(n)]\n    digits = digits_of(card_number)\n    odd_digits = digits[-1::-2]\n    even_digits = digits[-2::-2]\n    checksum = 0\n    checksum += sum(odd_digits)\n    for d in even_digits:\n        checksum += sum(digits_of(d * 2))\n    return checksum % 10 == 0\n", "entry_point": "validate_card", "input": "'49927398716'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73696_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009781", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[-1, -1, -1, 0, 1, 2]", "output": "(-1, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009782", "code": "import re\ndef extract_attributes(code_snippet):\n    attribute_dict = {}\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        match = re.search(r'(\\w+) = \\((.*)\\)', line)\n        if match:\n            object_type = match.group(1)\n            attributes = match.group(2).replace('\"', '').split(', ')\n            attribute_dict[object_type] = attributes\n    return attribute_dict\n", "entry_point": "extract_attributes", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21301_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009783", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "6.764, 0, 1000", "output": "966.2857142857143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009784", "code": "def find_median(arr):\n    arr.sort()\n    n = len(arr)\n    if n % 2 == 1:\n        return arr[n // 2]\n    else:\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (arr[mid_left] + arr[mid_right]) / 2\n", "entry_point": "find_median", "input": "[1.0, 2.0]", "output": "1.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141135_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009785", "code": "def extract_method_info(class_string):\n    method_info = {}\n    in_method = False\n    method_name = ''\n    method_type = ''\n    method_lines = 0\n    for line in class_string.split('\\n'):\n        line = line.strip()\n        if line.startswith('def '):\n            if in_method:\n                method_info[method_name] = (method_type, method_lines)\n            in_method = True\n            method_name = line.split('(')[0].split('def ')[1]\n            method_type = 'setup' if 'setup' in method_name else 'teardown'\n            method_lines = 0\n        elif in_method and line:\n            method_lines += 1\n    if in_method:\n        method_info[method_name] = (method_type, method_lines)\n    return method_info\n", "entry_point": "extract_method_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130942_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009786", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2094", "output": "{1, 2, 3, 6, 2094, 1047, 698, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2093", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009787", "code": "def process_migration_operations(model, operations):\n    for operation in operations:\n        if operation['operation'] == 'RenameField':\n            old_name = operation['details']['old_name']\n            new_name = operation['details']['new_name']\n            if old_name in model['fields']:\n                model['fields'][new_name] = model['fields'].pop(old_name)\n        elif operation['operation'] == 'AddField':\n            name = operation['details']['name']\n            field_type = operation['details']['type']\n            model['fields'][name] = field_type\n    return model\n", "entry_point": "process_migration_operations", "input": "{'fields': {}}, []", "output": "{'fields': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46866_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009788", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009789", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[230, 240, 241], 1, 3", "output": "237.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009790", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'baaaaabb'", "output": "'b1a5b2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2947", "output": "{1, 2947, 421, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009792", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9509", "output": "{1, 37, 9509, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009793", "code": "def calculate_7_day_avg(daily_cases):\n    moving_averages = []\n    for i in range(len(daily_cases)):\n        if i < 6:\n            moving_averages.append(0)  # Append 0 for days with insufficient data\n        else:\n            avg = sum(daily_cases[i-6:i+1]) / 7\n            moving_averages.append(avg)\n    return moving_averages\n", "entry_point": "calculate_7_day_avg", "input": "[1, 2, 3, 4, 5, 6]", "output": "[0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43237_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009794", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'hthhtt', '111111/de1'", "output": "'hthhtt/111111/de1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9127", "output": "{1, 9127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009796", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'91.2.1'", "output": "'91.2.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5485", "output": "{1097, 1, 5, 5485}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009798", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'pe', 'jajj', 'thhssmhi'", "output": "'Pe Jajj Thhssmhi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009799", "code": "def custom_word_frequency(sentence: str, custom_punctuation: str) -> dict:\n    sentence = sentence.lower()\n    words = {}\n    for s in custom_punctuation:\n        sentence = sentence.replace(s, ' ')\n    for w in sentence.split():\n        if w.endswith('\\''):\n            w = w[:-1]\n        if w.startswith('\\''):\n            w = w[1:]\n        words[w] = words.get(w, 0) + 1\n    return words\n", "entry_point": "custom_word_frequency", "input": "'Bel!', '!'", "output": "{'bel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9164_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009800", "code": "from typing import List, Tuple\ndef above_average_count(scores: List[int]) -> Tuple[float, int]:\n    total_students = len(scores)\n    total_score = sum(scores)\n    average_score = round(total_score / total_students, 2)\n    above_average_count = sum(score > average_score for score in scores)\n    return average_score, above_average_count\n", "entry_point": "above_average_count", "input": "[80, 80, 90, 70, 70]", "output": "(78.0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65850_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009801", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'diThitthatat not bad!nner'", "output": "'diThitthatat good!nner'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009802", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6519", "output": "{1, 3, 41, 53, 6519, 123, 2173, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009803", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2, 4, 12]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009804", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'inandto'", "output": "{'inandto': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40517_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009805", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['doge10', 'doge15', 'doge17']", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009806", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[1, 2, 8]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009807", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2191", "output": "{1, 7, 313, 2191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009808", "code": "def count_backtick_patterns(text: str) -> int:\n    count = 0\n    index = 0\n    while index < len(text) - 2:\n        if text[index] == '`' and text[index + 1] == '`' and text[index + 2] != '`':\n            count += 1\n            index += 2  # Skip the next two characters\n        index += 1\n    return count\n", "entry_point": "count_backtick_patterns", "input": "'``x'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14469_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009809", "code": "def process_line(line):\n    start_br = line.find('[')\n    end_br = line.find(']')\n    conf_delim = line.find('::')\n    verb1 = line[:start_br].strip()\n    rel = line[start_br + 1: end_br].strip()\n    verb2 = line[end_br + 1: conf_delim].strip()\n    conf = line[conf_delim + 2:].strip()  # Skip the '::' delimiter\n    return verb1, rel, verb2, conf\n", "entry_point": "process_line", "input": "'[lazy]:: og'", "output": "('', 'lazy', '', 'og')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60093_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "595", "output": "{1, 35, 5, 7, 17, 595, 85, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009811", "code": "def card_game_winner(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return \"Player 1 wins\"\n    elif rounds_won_player2 > rounds_won_player1:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_game_winner", "input": "[1, 2, 3], [2, 3, 4]", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5149_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009812", "code": "def html_color_to_rgb(color_name):\n    HTML_COLORS = {\n        'black': (0, 0, 0), 'green': (0, 128, 0),\n        'silver': (192, 192, 192), 'lime': (0, 255, 0),\n        'gray': (128, 128, 128), 'olive': (128, 128, 0),\n        'white': (255, 255, 255), 'yellow': (255, 255, 0),\n        'maroon': (128, 0, 0), 'navy': (0, 0, 128),\n        'red': (255, 0, 0), 'blue': (0, 0, 255),\n        'purple': (128, 0, 128), 'teal': (0, 128, 128),\n        'fuchsia': (255, 0, 255), 'aqua': (0, 255, 255),\n    }\n    return HTML_COLORS.get(color_name)\n", "entry_point": "html_color_to_rgb", "input": "'red'", "output": "(255, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56036_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009813", "code": "def repeat_characters(s: str) -> str:\n    output = \"\"\n    for char in s:\n        output += char * 2\n    return output\n", "entry_point": "repeat_characters", "input": "'heholhelo'", "output": "'hheehhoollhheelloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63922_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009814", "code": "def correlation_coefficient(arr1, arr2):\n    n = len(arr1)\n    mean_arr1 = sum(arr1) / n\n    mean_arr2 = sum(arr2) / n\n    covariance = sum((arr1[i] - mean_arr1) * (arr2[i] - mean_arr2) for i in range(n)) / n\n    std_dev_arr1 = (sum((x - mean_arr1) ** 2 for x in arr1) / n) ** 0.5\n    std_dev_arr2 = (sum((x - mean_arr2) ** 2 for x in arr2) / n) ** 0.5\n    correlation = covariance / (std_dev_arr1 * std_dev_arr2)\n    return correlation\n", "entry_point": "correlation_coefficient", "input": "[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]", "output": "0.9999999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132093_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009815", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4]", "output": "[1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009816", "code": "from typing import List\ndef last_successful_step(steps: List[int]) -> int:\n    last_successful = 0\n    for step in steps:\n        if step > last_successful + 1:\n            return last_successful\n        last_successful = step\n    return steps[-1]\n", "entry_point": "last_successful_step", "input": "[0, 1, 2, 3, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132617_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009817", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "8.0, 8.0", "output": "32.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009818", "code": "from typing import List\nimport logging\ndef process_cookies(cookie_indices: List[int]) -> List[int]:\n    valid_cookies_index = [index for index in cookie_indices if index % 2 == 0 and index % 3 == 0]\n    logging.info('Checking the cookie for validity is over.')\n    return valid_cookies_index\n", "entry_point": "process_cookies", "input": "[6, 6, 12, 1, 3, 5]", "output": "[6, 6, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99711_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8776", "output": "{1, 2, 4388, 4, 8776, 8, 1097, 2194}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8775", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009820", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "402", "output": "'Permission denied'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009821", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4491", "output": "{1, 3, 9, 4491, 499, 1497}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009822", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'This,hi.iis'", "output": "'Thishiiis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009823", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[2, 2, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009824", "code": "def rank_scores(scores):\n    score_counts = {}\n    for score in scores:\n        score_counts[score] = score_counts.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    ranks = {}\n    rank = 1\n    for score in unique_scores:\n        count = score_counts[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "rank_scores", "input": "[70, 100, 80, 100, 90, 70]", "output": "[5, 1, 4, 1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135203_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009825", "code": "from typing import List\ndef smallestRangeDifference(A: List[int], K: int) -> int:\n    A.sort()\n    ans = A[-1] - A[0]\n    for x, y in zip(A, A[1:]):\n        ans = min(ans, max(A[-1]-K, x+K) - min(A[0]+K, y-K))\n    return ans\n", "entry_point": "smallestRangeDifference", "input": "[2, 4, 12], 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93507_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009826", "code": "def assign_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        else:\n            grades.append('C')\n    return grades\n", "entry_point": "assign_grades", "input": "[80, 80, 80, 80, 80, 80, 80, 80]", "output": "['B', 'B', 'B', 'B', 'B', 'B', 'B', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4885_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009827", "code": "def generate_version_info(version, author_name, author_email):\n    version_str = '.'.join(map(str, version))\n    return \"Version {} - Author: {} ({})\".format(version_str, author_name, author_email)\n", "entry_point": "generate_version_info", "input": "(), 'DooJohJoh', 'doen.john.d'", "output": "'Version  - Author: DooJohJoh (doen.john.d)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130108_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9913", "output": "{1, 9913, 431, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009829", "code": "import itertools\nLEONARDO_APPS = ['testapp1']\ndef generate_app_combinations(apps):\n    all_combinations = []\n    for r in range(1, len(apps) + 1):\n        all_combinations.extend(list(itertools.combinations(apps, r)))\n    return [list(comb) for comb in all_combinations]\n", "entry_point": "generate_app_combinations", "input": "['testapp1']", "output": "[['testapp1']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009830", "code": "def circular_sum(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 4, 4, 6, 1, 1, 4]", "output": "[7, 8, 8, 10, 7, 2, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148378_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009831", "code": "def are_anagrams(str1, str2):\n    str1 = str1.replace(\" \", \"\").lower()\n    str2 = str2.replace(\" \", \"\").lower()\n    if len(str1) != len(str2):\n        return False\n    char_freq1 = {}\n    char_freq2 = {}\n    for char in str1:\n        char_freq1[char] = char_freq1.get(char, 0) + 1\n    for char in str2:\n        char_freq2[char] = char_freq2.get(char, 0) + 1\n    return char_freq1 == char_freq2\n", "entry_point": "are_anagrams", "input": "'listen', 'silent'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40214_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009832", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[4, 3, 3, 10, 10, 10, 10, 5, 11]", "output": "[8, 9, 9, 20, 20, 20, 20, 25, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009833", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'T123400T004'", "output": "'00T004'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7528", "output": "{1, 2, 4, 7528, 8, 941, 3764, 1882}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7527", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009835", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "10, 10, 10, 9, 10", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009836", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "total_size_in_kb", "input": "[10240, 1024, 1024]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33137_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009837", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'13.2.10'", "output": "(13, 2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009838", "code": "import re\ndef validate_feedback_data(data: dict) -> bool:\n    if 'feedback' not in data:\n        return False\n    if not data.get('name') or not data.get('email_address'):\n        return False\n    email_pattern = r'^[\\w\\.-]+@[\\w\\.-]+\\.\\w+$'\n    if not re.match(email_pattern, data['email_address']):\n        return False\n    return True\n", "entry_point": "validate_feedback_data", "input": "{'name': 'John Doe', 'email_address': 'john.doe@example.com'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81410_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009839", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[4, 1, 6, 0, 6, 4, 4, 6]", "output": "[0, 1, 4, 4, 4, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009840", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "14", "output": "'STRING'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009841", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9719", "output": "{1, 9719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009842", "code": "from typing import List\ndef sum_divisible_by_3_and_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30, 60]", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80529_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009843", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "52, 4", "output": "270725", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt74", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009844", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "0, 9", "output": "9.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009845", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/output'", "output": "'/tmp/ml4pl/data/output'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009846", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "217", "output": "{1, 217, 31, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009847", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0], 1", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009848", "code": "import math\ndef euclidean_distance(point1, point2):\n    distance = math.sqrt((point2[0] - point1[0])**2 + (point2[1] - point1[1])**2 + (point2[2] - point1[2])**2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(0, 0, 0), (3, 0, 0)", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35659_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009849", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(0, 0, 255)", "output": "'#0000FF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009850", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'Sampei'", "output": "'\u30b5\u30f3ampei'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009851", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[6, 6, 2, 2, 4, 7, 7]", "output": "[6, 2, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4468", "output": "{1, 2, 4, 4468, 2234, 1117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4467", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009853", "code": "def min_gas_stations(distances, max_distance):\n    stations = 0\n    remaining_distance = max_distance\n    for distance in distances:\n        if remaining_distance < distance:\n            stations += 1\n            remaining_distance = max_distance\n        remaining_distance -= distance\n    return stations\n", "entry_point": "min_gas_stations", "input": "[2, 2, 2, 2, 2, 2, 2, 2, 2], 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48197_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009854", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'Hello,'", "output": "b'Hello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009855", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[93, 85, 85, 76, 76]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009856", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009857", "code": "def reverse_words(words):\n    new_words = []\n    for word in words:\n        new_words.append(word[::-1])\n    return new_words\n", "entry_point": "reverse_words", "input": "['hello', 'world', 'python']", "output": "['olleh', 'dlrow', 'nohtyp']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42555_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009858", "code": "import os\ndef sum_even_numbers_from_file(file_path: str) -> int:\n    if not os.path.exists(file_path):\n        return 0  # Return 0 if the file does not exist\n    total_sum = 0\n    with open(file_path, 'r') as file:\n        for line in file:\n            number = int(line.strip())\n            if number % 2 == 0:\n                total_sum += number\n    return total_sum\n", "entry_point": "sum_even_numbers_from_file", "input": "'non_existent_file.txt'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009859", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[1, 2, 3, 4, 5, 9], 10", "output": "[0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009860", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'orbitrap', 'ion'", "output": "{'tolerance': 0.005, 'mode': 'ion'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009861", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 2, 3, 4, 5]", "output": "[3, 4, 9, 8, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009862", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9691", "output": "{11, 1, 9691, 881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009863", "code": "def calculate_res2net_parameters(layers, scales, width):\n    total_parameters = layers * (width * scales**2 + 3 * width)\n    return total_parameters\n", "entry_point": "calculate_res2net_parameters", "input": "18, 2, 68", "output": "8568", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69497_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009864", "code": "from typing import List\ndef _merge_small_intervals(buff: List[int], size: int) -> List[int]:\n    result = []\n    start = 0\n    end = 0\n    while end < len(buff):\n        while end < len(buff) - 1 and buff[end + 1] - buff[end] == 1:\n            end += 1\n        if end - start + 1 < size:\n            result.extend(buff[start:end + 1])\n        else:\n            result.extend(buff[start:end + 1])\n        end += 1\n        start = end\n    return result\n", "entry_point": "_merge_small_intervals", "input": "[0, 2, 10, 3, 3, 11, 10, 1], 2", "output": "[0, 2, 10, 3, 3, 11, 10, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9378_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009865", "code": "def manipulate_presets(presets: list, status: str) -> list:\n    if status == 'add':\n        presets.append({'name': 'New Preset'})\n    elif status == 'remove':\n        if presets:\n            presets.pop()\n    elif status == 'clear':\n        presets.clear()\n    elif status == 'display':\n        return presets\n    else:\n        return 'Invalid status'\n    return presets\n", "entry_point": "manipulate_presets", "input": "[], 'invalid'", "output": "'Invalid status'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14782_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009866", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.isupper():\n            encrypted_text += chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_text += chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Hello, World!', 3", "output": "'Khoor, Zruog!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123131_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009867", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 31, 31, 0]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7178", "output": "{1, 2, 194, 97, 37, 3589, 7178, 74}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009869", "code": "def mutations(inputs):\n    item_a = set(inputs[0].lower())\n    item_b = set(inputs[1].lower())\n    return item_b.issubset(item_a)\n", "entry_point": "mutations", "input": "['abc', 'abcd']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114620_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1602", "output": "{1, 1602, 3, 2, 801, 6, 9, 267, 178, 18, 534, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1601", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009871", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5375", "output": "{1, 5, 43, 1075, 215, 25, 125, 5375}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009872", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[-5, -3, -2, -4]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009873", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'gyr'", "output": "'Value of gyr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009874", "code": "def count_unique_words(poem: str) -> int:\n    # Split the poem into individual words and convert them to lowercase\n    words = [word.lower() for word in poem.split()]\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Return the total number of unique words\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'The quick brown fox jumps over the lazy dog and the quick fox'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62859_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009875", "code": "def compress_string(s1):\n    newStr = ''\n    char = ''\n    count = 0\n    for i in range(len(s1)):\n        if char != s1[i]:\n            if char != '':  # Add previous character and count to newStr\n                newStr += char + str(count)\n            char = s1[i]\n            count = 1\n        else:\n            count += 1\n    newStr += char + str(count)  # Add last character and count to newStr\n    if len(newStr) > len(s1):\n        return s1\n    return newStr\n", "entry_point": "compress_string", "input": "'aaacabbcabaaabad'", "output": "'aaacabbcabaaabad'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79600_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009876", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[70, 75, 80], 3", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009877", "code": "def process_list(lst, threshold):\n    processed_list = []\n    for num in lst:\n        if num >= threshold:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_list", "input": "[2, 5, 8, 10], 6", "output": "[8, 125, 64, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88444_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6575", "output": "{1, 1315, 5, 263, 6575, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6574", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009879", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1505", "output": "1465", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009880", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[2, 1, 5, 3, 3, 2, 3, 3]", "output": "[4, 1, 125, 27, 27, 4, 27, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009881", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "300, 0", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009882", "code": "def count_consecutive_i(input_str):\n    max_consecutive_i = 0\n    current_consecutive_i = 0\n    for char in input_str:\n        if char == 'i':\n            current_consecutive_i += 1\n            max_consecutive_i = max(max_consecutive_i, current_consecutive_i)\n        else:\n            current_consecutive_i = 0\n    return max_consecutive_i\n", "entry_point": "count_consecutive_i", "input": "'iiiii'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6207_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009883", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "6, 1, 5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009884", "code": "import re\nfrom typing import List\ndef extract_function_declarations(c_source_code: str) -> List[str]:\n    pattern = r'extern \"C\" {([^}]*)}'\n    match = re.search(pattern, c_source_code, re.DOTALL)\n    if match:\n        declarations = match.group(1).strip()\n        return [declaration.strip() for declaration in declarations.split(';') if declaration.strip()]\n    else:\n        return []\n", "entry_point": "extract_function_declarations", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26220_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009885", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'mym_d', 'gmydd 00'", "output": "'mym_d_gmydd_00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3382", "output": "{1, 2, 38, 178, 19, 3382, 89, 1691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009887", "code": "from functools import reduce\ndef calculate_ribbon_length(dimensions):\n    total_ribbon_length = 0\n    for box in dimensions:\n        l, w, h = box\n        # Calculate the smallest perimeter\n        smallest_perimeter = 2 * l + 2 * w + 2 * h - 2 * max(l, w, h)\n        # Calculate the volume\n        volume = l * w * h\n        # Calculate the ribbon required for the box\n        ribbon_length = smallest_perimeter + volume\n        total_ribbon_length += ribbon_length\n    return total_ribbon_length\n", "entry_point": "calculate_ribbon_length", "input": "[(2, 3, 4)]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50392_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009888", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3982", "output": "{1, 2, 1991, 362, 11, 3982, 181, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8812", "output": "{1, 2, 4, 8812, 4406, 2203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8811", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009890", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_number = 0\n    for num in nums:\n        single_number ^= num\n    return single_number\n", "entry_point": "find_single_number", "input": "[1, 1, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48428_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009891", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[1], [1], [1, 3], [2, [6]], [1, [1, 3]]]", "output": "[1, 1, 1, 3, 2, 6, 1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009892", "code": "_FREEZE_START = 1639641600\n_FREEZE_END = 1641196800\ndef check_freeze_period(timestamp):\n    return _FREEZE_START <= timestamp <= _FREEZE_END\n", "entry_point": "check_freeze_period", "input": "1639641600", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65214_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009893", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[7, 7, 7, 7, 8, 3, 7]", "output": "[7, 8, 9, 10, 12, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009894", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "12", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009895", "code": "from typing import List\ndef generate_directories(base_dir: str) -> List[str]:\n    subdirectories = [\"evaluation\", \"jobinfo\"]\n    return [f\"{base_dir}/{subdir}\" for subdir in subdirectories]\n", "entry_point": "generate_directories", "input": "'/opt/ml/'", "output": "['/opt/ml//evaluation', '/opt/ml//jobinfo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93666_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009896", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[0, 0, 2, -1, 3, 5, 5]", "output": "[0, 0, 2, -1, 3, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009897", "code": "def totalNQueens(n):\n    def is_safe(board, row, col):\n        for i in range(row):\n            if board[i] == col or abs(i - row) == abs(board[i] - col):\n                return False\n        return True\n    def backtrack(board, row):\n        nonlocal count\n        if row == n:\n            count += 1\n            return\n        for col in range(n):\n            if is_safe(board, row, col):\n                board[row] = col\n                backtrack(board, row + 1)\n    count = 0\n    board = [-1] * n\n    backtrack(board, 0)\n    return count\n", "entry_point": "totalNQueens", "input": "9", "output": "352", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107753_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009898", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'   HHello,   '", "output": "'HHello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009899", "code": "def character_frequency(input_string):\n    freq_dict = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            if char in freq_dict:\n                freq_dict[char] += 1\n            else:\n                freq_dict[char] = 1\n    return freq_dict\n", "entry_point": "character_frequency", "input": "'Hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65596_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009900", "code": "def count_supported_regions(id):\n    supported_regions = set()\n    if id.startswith('user-'):\n        supported_regions = {'US', 'EU'}\n    elif id.startswith('org-'):\n        supported_regions = {'US', 'EU', 'APAC'}\n    return len(supported_regions)\n", "entry_point": "count_supported_regions", "input": "'admin-123'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94111_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009901", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "[9, 3, 9, 9, 0, 9, 9, 9]", "output": "'9.3.9.9.0.9.9.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009902", "code": "def convert_to_json(o):\n    if isinstance(o, (list, tuple)):\n        return [convert_to_json(oo) for oo in o]\n    if hasattr(o, 'to_json'):\n        return o.to_json()\n    if callable(o):\n        comps = [o.__module__] if o.__module__ != 'builtins' else []\n        if type(o) == type(convert_to_json):\n            comps.append(o.__name__)\n        else:\n            comps.append(o.__class__.__name__)\n        res = '.'.join(comps)\n        if type(o) == type(convert_to_json):\n            return res\n        return {'class': res}\n    return o\n", "entry_point": "convert_to_json", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112833_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009903", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "29.0", "output": "302.15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009904", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[5], [2]]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "522", "output": "{1, 2, 3, 261, 6, 9, 522, 174, 18, 87, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009906", "code": "def countPaths(numrArreglo, numSalto):\n    dp = [0] * numrArreglo\n    dp[0] = 1\n    for i in range(1, numrArreglo):\n        for j in range(1, numSalto + 1):\n            if i - j >= 0:\n                dp[i] += dp[i - j]\n    return dp[numrArreglo - 1]\n", "entry_point": "countPaths", "input": "5, 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42463_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009907", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4593", "output": "{1, 3, 4593, 1531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009908", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "7.549733848241311, 5, 2", "output": "1.2748669241206554", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009909", "code": "def extract_peak_locations(peaks_or_locations):\n    dimensions = set()\n    for peak in peaks_or_locations:\n        dimensions.update(peak.keys())\n    peak_locations = []\n    for peak in peaks_or_locations:\n        location = []\n        for dim in dimensions:\n            location.append(peak.get(dim, 0.0))\n        peak_locations.append(location)\n    return peak_locations\n", "entry_point": "extract_peak_locations", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[[], [], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93547_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009910", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'RRRR', 5, 1", "output": "(4, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009911", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average excluding highest and lowest.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[81, 82, 83, 84, 85]", "output": "83.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66758_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009912", "code": "def trap(heights):\n    if not heights:\n        return 0\n    left, right = 0, len(heights) - 1\n    left_max, right_max = 0, 0\n    trapped_water = 0\n    while left < right:\n        if heights[left] < heights[right]:\n            if heights[left] >= left_max:\n                left_max = heights[left]\n            else:\n                trapped_water += left_max - heights[left]\n            left += 1\n        else:\n            if heights[right] >= right_max:\n                right_max = heights[right]\n            else:\n                trapped_water += right_max - heights[right]\n            right -= 1\n    return trapped_water\n", "entry_point": "trap", "input": "[0, 2, 0, 2, 0]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54741_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009913", "code": "def calculate_total_epochs(batch_size, last_epoch, min_unit):\n    if last_epoch < min_unit:\n        return min_unit\n    else:\n        return last_epoch + min_unit\n", "entry_point": "calculate_total_epochs", "input": "32, 6, 5", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134381_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009914", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3827", "output": "{89, 1, 3827, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009915", "code": "def process_markup(text: str) -> str:\n    formatted_text = \"\"\n    stack = []\n    current_text = \"\"\n    for char in text:\n        if char == '[':\n            if current_text:\n                formatted_text += current_text\n                current_text = \"\"\n            stack.append(char)\n        elif char == ']':\n            tag = \"\".join(stack)\n            stack = []\n            if tag == \"[b]\":\n                current_text = f\"<b>{current_text}</b>\"\n            elif tag == \"[r]\":\n                current_text = f\"<span style='color:red'>{current_text}</span>\"\n            elif tag == \"[u]\":\n                current_text = f\"<u>{current_text}</u>\"\n        else:\n            current_text += char\n    formatted_text += current_text\n    return formatted_text\n", "entry_point": "process_markup", "input": "'[r]World[/r]'", "output": "'rWorld/r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63510_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009916", "code": "def manipulate_presets(presets: list, status: str) -> list:\n    if status == 'add':\n        presets.append({'name': 'New Preset'})\n    elif status == 'remove':\n        if presets:\n            presets.pop()\n    elif status == 'clear':\n        presets.clear()\n    elif status == 'display':\n        return presets\n    else:\n        return 'Invalid status'\n    return presets\n", "entry_point": "manipulate_presets", "input": "[1, 2, 3], 'clear'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14782_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009917", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 10, 10, 20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009918", "code": "def max_sum_non_adjacent(lst):\n    inclusive = 0\n    exclusive = 0\n    for num in lst:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 1, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116770_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009919", "code": "def ascii_cipher(message, key):\n    def is_prime(n):\n        if n < 2:\n            return False\n        return all(n % i != 0 for i in range(2, round(pow(n, 0.5)) + 1) ) or n == 2\n    pfactor = max(i for i in range(2, abs(key) + 1) if is_prime(i) and key % i == 0) * (-1 if key < 0 else 1)\n    encrypted_message = ''.join(chr((ord(c) + pfactor) % 128) for c in message)\n    return encrypted_message\n", "entry_point": "ascii_cipher", "input": "'Pmttw4(_w)', 3", "output": "'Spwwz7+bz,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44495_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009920", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5139", "output": "{1, 3, 9, 1713, 5139, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009921", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[3, 11, 19]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126564_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009922", "code": "def extract_metadata(code_snippet):\n    metadata = {}\n    lines = code_snippet.strip().split('\\n')\n    for line in lines:\n        key_value = line.split('=')\n        key = key_value[0].strip().strip('_').lower()\n        value = key_value[1].strip().strip(\" '\")\n        metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "\"autho = '__'\"", "output": "{'autho': '__'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113322_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009923", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "2", "output": "39135.75848201024", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009924", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'World'", "output": "'Xpsme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009925", "code": "import re\ndef generate_code(input_string):\n    words = input_string.split()\n    code = ''\n    for word in words:\n        first_letter = re.search(r'[a-zA-Z]', word)\n        if first_letter:\n            code += first_letter.group().lower()\n    return code\n", "entry_point": "generate_code", "input": "'Hello'", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30063_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009926", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[-7, -7, 2, 3, 2, -8, -8]", "output": "[343, 343, 4, 9, 4, 512, 512]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009927", "code": "def double_letter(name, letters):\n    modified_name = \"\"\n    for char in name:\n        if char in letters:\n            modified_name += char * 2\n        else:\n            modified_name += char\n    return modified_name\n", "entry_point": "double_letter", "input": "'Bacon', 'ao'", "output": "'Baacoon'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009928", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[10, 20, 19, 0]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009929", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "12345", "output": "'0000000000003039'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009930", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[17, 18, 540, 5, 2, 1]", "output": "[17, 18, 540]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009931", "code": "import re\ndef get_unique_directories(code_snippet):\n    directory_paths = re.findall(r'(\\w+_DIR\\s*=\\s*DATA_DIR\\s*\\+\\s*\\'[\\w\\/]*\\')', code_snippet)\n    directory_names = [re.search(r'\\'([\\w\\/]*)\\'', path).group(1) for path in directory_paths]\n    unique_directories = list(set(directory_names))\n    return unique_directories\n", "entry_point": "get_unique_directories", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66636_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009932", "code": "def average_age(players):\n    total_age = 0\n    for player in players:\n        total_age += player['age']\n    average_age = total_age / len(players)\n    return round(average_age)\n", "entry_point": "average_age", "input": "[{'age': 20}, {'age': 21}, {'age': 22}, {'age': 23}, {'age': 24}]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45277_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009933", "code": "def format_package_info(package_info):\n    formatted_info = \"\"\n    for key, value in package_info.items():\n        if isinstance(value, list):\n            value = ', '.join(value)\n        elif isinstance(value, bool):\n            value = str(value)\n        formatted_info += f\"{key.capitalize()}: {value}\\n\"\n    return formatted_info\n", "entry_point": "format_package_info", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88836_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009934", "code": "def generate_matrix(n):\n    matriz = [[0 for _ in range(n)] for _ in range(n)]\n    for diagonal_principal in range(n):\n        matriz[diagonal_principal][diagonal_principal] = 2\n    for diagonal_secundaria in range(n):\n        matriz[diagonal_secundaria][n - 1 - diagonal_secundaria] = 3\n    for linha in range(n // 3, n - n // 3):\n        for coluna in range(n // 3, n - n // 3):\n            matriz[linha][coluna] = 1\n    return matriz\n", "entry_point": "generate_matrix", "input": "1", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23096_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009935", "code": "def str_to_bool(value):\n    true_values = {'true', 't', '1', 'yes', 'y'}\n    false_values = {'false', 'f', '0', 'no', 'n'}\n    if value.lower() in true_values:\n        return True\n    elif value.lower() in false_values:\n        return False\n    else:\n        raise ValueError(f'{value} is not a valid boolean value')\n", "entry_point": "str_to_bool", "input": "'true'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141972_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009936", "code": "def bar(arr):\n    modified_arr = []\n    for i in range(len(arr)):\n        sum_except_current = sum(arr) - arr[i]\n        modified_arr.append(sum_except_current)\n    return modified_arr\n", "entry_point": "bar", "input": "[1, 3, 3, 1, 4]", "output": "[11, 9, 9, 11, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30502_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009937", "code": "def modular_inverse(a, m):\n    def egcd(a, b):\n        if a == 0:\n            return (b, 0, 1)\n        else:\n            g, x, y = egcd(b % a, a)\n            return (g, y - (b // a) * x, x)\n    g, x, y = egcd(a, m)\n    if g != 1:\n        return None\n    else:\n        return x % m\n", "entry_point": "modular_inverse", "input": "4, 99", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35681_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009938", "code": "def calculate_similarity_score(values, threshold, max_score):\n    counter = 0\n    for value in values:\n        if threshold <= value <= max_score:\n            counter += 1\n    similarity_score = counter / len(values) if len(values) > 0 else 0\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "[], 0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115408_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009939", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8782", "output": "{1, 2, 8782, 4391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1747", "output": "{1, 1747}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009941", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabbabcc'", "output": "'a3b2a1b1c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144981_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "497", "output": "{1, 497, 71, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009943", "code": "def sum_of_primes(n):\n    if n < 2:\n        return 0\n    sum = 0\n    size = n\n    slots = [True for i in range(size)]\n    slots[0] = False\n    slots[1] = False\n    for stride in range(2, size // 2):\n        pos = stride\n        while pos < size - stride:\n            pos += stride\n            slots[pos] = False\n    for idx, pr in enumerate(slots):\n        if pr:\n            sum += idx\n    return sum\n", "entry_point": "sum_of_primes", "input": "14", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38956_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009944", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "123", "output": "321", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009945", "code": "def modify_email(email_data):\n    # Modify the email by adding a new recipient to the \"To\" field\n    new_recipient = \"NewRecipient@example.com\"\n    email_data = email_data.replace(\"To: Recipient 1\", f\"To: Recipient 1, {new_recipient}\")\n    # Update the email subject to include \"Modified\"\n    email_data = email_data.replace(\"Subject: test mail\", \"Subject: Modified: test mail\")\n    return email_data\n", "entry_point": "modify_email", "input": "'the'", "output": "'the'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12643_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009946", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "11", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009947", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha():  # Consider only alphabetic characters\n            unique_chars.add(char.lower())  # Consider both uppercase and lowercase as same character\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abcdefghij'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32307_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009948", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/user/documents/some-lp.txt'", "output": "'some-lp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009949", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 2, 8, 10, 10, 12, 12, 12, 9]", "output": "([2, 2, 8, 10, 10, 12, 12, 12], [9])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009950", "code": "def sum_adjacent_elements(input_list):\n    output_list = []\n    if not input_list:\n        return output_list\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "sum_adjacent_elements", "input": "[7, 4, 4, 1]", "output": "[11, 8, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114935_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009951", "code": "import re\ndef extract_viewsets(urls):\n    viewset_mapping = {\n        'video': 'VideoViewSet',\n        'activity': 'ActivityViewSet',\n        'option': 'OptionViewSet',\n        'answer': 'AnswerViewSet'\n    }\n    extracted_viewsets = {}\n    for url in urls:\n        base_name = re.search(r'/(?P<base_name>\\w+)/$', url).group('base_name')\n        if base_name in viewset_mapping:\n            extracted_viewsets[viewset_mapping[base_name]] = base_name\n    return extracted_viewsets\n", "entry_point": "extract_viewsets", "input": "['/path/to/endpoint/answer/']", "output": "{'AnswerViewSet': 'answer'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145032_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009952", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'se_exa'", "output": "'seExa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009953", "code": "def validate_mpeg_dash_url(url: str) -> bool:\n    if url.startswith(\"dash://\"):\n        if url.startswith(\"dash://http://\") or url.startswith(\"dash://https://\"):\n            return True\n    return False\n", "entry_point": "validate_mpeg_dash_url", "input": "'dash://http://example.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144180_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009954", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 101, 102, 99, 98, 97]", "output": "[102, 101, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57187_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009955", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[7, 4, 6, 7, 5, 7]", "output": "[7, 11, 17, 24, 29, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009956", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[10, 18]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009957", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "5, 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009958", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8765", "output": "{1, 5, 1753, 8765}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009959", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[1, 1, 4, 5]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009960", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[-2, 0, 0, 0, 0, 0, 0, 0]", "output": "[-4, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009961", "code": "from collections import defaultdict\ndef find_shortest_subarray(arr):\n    freq = defaultdict(list)\n    for i, num in enumerate(arr):\n        freq[num].append(i)\n    max_freq = max(len(indices) for indices in freq.values())\n    shortest_length = float('inf')\n    for indices in freq.values():\n        if len(indices) == max_freq:\n            shortest_length = min(shortest_length, indices[-1] - indices[0] + 1)\n    return shortest_length\n", "entry_point": "find_shortest_subarray", "input": "[1, 2, 1, 2, 1, 2, 3, 4, 1]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30490_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009962", "code": "def min_swaps_to_sort(nums):\n    count_1 = nums.count(1)\n    count_2 = nums.count(2)\n    count_3 = nums.count(3)\n    swaps = 0\n    for i in range(count_1):\n        if nums[i] != 1:\n            if nums[i] == 2:\n                if count_1 > 0:\n                    count_1 -= 1\n                    swaps += 1\n                else:\n                    count_3 -= 1\n                    swaps += 2\n            elif nums[i] == 3:\n                count_3 -= 1\n                swaps += 1\n    for i in range(count_1, count_1 + count_2):\n        if nums[i] != 2:\n            count_3 -= 1\n            swaps += 1\n    return swaps\n", "entry_point": "min_swaps_to_sort", "input": "[2, 3, 1, 3, 2, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124017_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009963", "code": "def snake_case(string):\n    return string.replace(\" \", \"_\").lower()\n", "entry_point": "snake_case", "input": "'HHeH'", "output": "'hheh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78100_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009964", "code": "def reverse_complement(dna_sequence: str) -> str:\n    # Dictionary mapping each base to its complementary base\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the input DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each base with its complementary base\n    reverse_complement_sequence = ''.join(complement_dict[base] for base in reversed_sequence)\n    return reverse_complement_sequence\n", "entry_point": "reverse_complement", "input": "'G'", "output": "'C'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67367_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009965", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9235", "output": "{1, 9235, 5, 1847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009966", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009967", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'aa'", "output": "['aa', 'aa']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009968", "code": "import re\nBLOCKED_KEYWORDS = [\"apple\", \"banana\", \"orange\"]\ndef replace_blocked_keywords(text):\n    modified_text = text.lower()\n    for keyword in BLOCKED_KEYWORDS:\n        modified_text = re.sub(r'\\b' + re.escape(keyword) + r'\\b', '*' * len(keyword), modified_text, flags=re.IGNORECASE)\n    return modified_text\n", "entry_point": "replace_blocked_keywords", "input": "'Papples'", "output": "'papples'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141680_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009969", "code": "from typing import Sequence\ndef process_simulation_output(data: Sequence[dict]) -> dict:\n    parameter_sums = {}\n    num_data_points = len(data)\n    for data_point in data:\n        for parameter, value in data_point.items():\n            parameter_sums[parameter] = parameter_sums.get(parameter, 0) + value\n    average_values = {param: total / num_data_points for param, total in parameter_sums.items()}\n    return average_values\n", "entry_point": "process_simulation_output", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93103_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "811", "output": "{1, 811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009971", "code": "def count_non_whitespace_chars(s: str) -> int:\n    count = 0\n    for c in s:\n        if not c.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'a b c d'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72891_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009972", "code": "def calculate_total_pages(data_count: int, page_size: int) -> int:\n    total_pages = data_count // page_size\n    if data_count % page_size != 0:\n        total_pages += 1\n    return total_pages\n", "entry_point": "calculate_total_pages", "input": "3, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125536_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009973", "code": "import re\nfrom typing import List\ndef extract_memos(ofx_content: str) -> List[str]:\n    memo_lines = re.findall(r'<MEMO>(.*?)</MEMO>', ofx_content, re.DOTALL)\n    return memo_lines\n", "entry_point": "extract_memos", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40783_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009974", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    # Sort the dictionary by values in descending order\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "word_frequency", "input": "'horldpytholo'", "output": "{'horldpytholo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86121_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "939", "output": "{3, 1, 939, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009976", "code": "def get_addresses(mask, address):\n    addresses = ['']\n    for bit_mask, bit_address in zip(mask, format(address, '036b')):\n        if bit_mask == '0':\n            addresses = [addr + bit for addr, bit in zip(addresses, bit_address)]\n        elif bit_mask == '1':\n            addresses = [addr + '1' for addr in addresses]\n        elif bit_mask == 'X':\n            new_addresses = []\n            for addr in addresses:\n                new_addresses.append(addr + '0')\n                new_addresses.append(addr + '1')\n            addresses = new_addresses\n    return [int(addr, 2) for addr in addresses]\n", "entry_point": "get_addresses", "input": "'X X X', 0", "output": "[0, 1, 2, 3, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128658_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7317", "output": "{1, 3, 2439, 9, 813, 271, 7317, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009978", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['Ace', 'Jack']", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009979", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[1, 3, 5]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009980", "code": "def extract_file_extensions(file_paths):\n    unique_extensions = set()\n    for file_path in file_paths:\n        file_name = file_path.split('/')[-1]\n        file_extension = file_name.split('.')[-1]\n        unique_extensions.add(file_extension)\n    return unique_extensions\n", "entry_point": "extract_file_extensions", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58620_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6509", "output": "{1, 283, 6509, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009982", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'EVT_BUTTON'", "output": "'wx.adv.EVT_BUTTON'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009983", "code": "def remove_duplicates(input_string):\n    if not input_string:\n        return \"\"\n    result = input_string[0]  # Initialize result with the first character\n    for i in range(1, len(input_string)):\n        if input_string[i] != input_string[i - 1]:\n            result += input_string[i]\n    return result\n", "entry_point": "remove_duplicates", "input": "'hellohe'", "output": "'helohe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5338_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009984", "code": "def sum_absolute_differences(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0], [9, 9]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145947_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009985", "code": "from typing import List\ndef reverse_insertion_sort(comp: int) -> List[int]:\n    lst = []\n    n = 0\n    while comp > 0:\n        n += 1\n        if comp <= n:\n            lst.insert(0, n)\n            comp -= 1\n            n = 0\n        else:\n            lst.append(n)\n            comp -= n\n    return lst\n", "entry_point": "reverse_insertion_sort", "input": "12", "output": "[1, 5, 1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73545_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009986", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 90, 88, 89], 4", "output": "89.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82034_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009987", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009988", "code": "# Define the function to process configurations\ndef process_configurations(configs):\n    processed_configs = {}\n    for config in configs:\n        processed_config = {}\n        for key, value in config.items():\n            processed_key = key.upper()\n            processed_value = value + \"_processed\"\n            processed_config[processed_key] = processed_value\n        processed_configs[tuple(config.items())] = processed_config\n    return processed_configs\n", "entry_point": "process_configurations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133694_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009989", "code": "def find_common_directory_path(path1, path2):\n    dirs1 = path1.split('/')\n    dirs2 = path2.split('/')\n    common_dirs = []\n    for dir1, dir2 in zip(dirs1, dirs2):\n        if dir1 == dir2:\n            common_dirs.append(dir1)\n        else:\n            break\n    common_path = '/'.join(common_dirs)\n    return common_path\n", "entry_point": "find_common_directory_path", "input": "'home/user/documents', 'var/log/files'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62467_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009990", "code": "def simulate_roomba(n, m, instructions):\n    cleaned_cells = set()\n    roomba_position = (0, 0)\n    cleaned_cells.add(roomba_position)\n    for instruction in instructions:\n        x, y = roomba_position\n        if instruction == 'U' and x > 0:\n            roomba_position = (x - 1, y)\n        elif instruction == 'D' and x < n - 1:\n            roomba_position = (x + 1, y)\n        elif instruction == 'L' and y > 0:\n            roomba_position = (x, y - 1)\n        elif instruction == 'R' and y < m - 1:\n            roomba_position = (x, y + 1)\n        if roomba_position not in cleaned_cells:\n            cleaned_cells.add(roomba_position)\n    return len(cleaned_cells)\n", "entry_point": "simulate_roomba", "input": "1, 1, []", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110772_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009991", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'python is a Python language.'", "output": "'Python is a programming language'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009992", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[10, 0, 9, 10, 8, 0, 1, 7, 0]", "output": "[10, 10, 9, 8, 7, 1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009993", "code": "def fractional_knapsack(val, wt, wt_cap):\n    vals_per_wts = [(v / w, v, w) for (v, w) in zip(val, wt)]\n    sorted_vals_per_wts = sorted(vals_per_wts, reverse=True)\n    max_val = 0\n    total_wt = 0\n    for vw, v, w in sorted_vals_per_wts:\n        if total_wt + w <= wt_cap:\n            total_wt += w\n            max_val += v\n        else:\n            wt_remain = wt_cap - total_wt\n            max_val += vw * wt_remain\n            break\n    return max_val\n", "entry_point": "fractional_knapsack", "input": "[], [], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64632_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009994", "code": "def parse_legend(input_str):\n    legend_dict = {}\n    # Extract legend information after the colon\n    legend_info = input_str.split(\":\")[1].strip()\n    # Split legend into individual control type mappings\n    mappings = legend_info.split(\",\")\n    # Parse each mapping and create the dictionary\n    for mapping in mappings:\n        control_type, full_name = mapping.split(\"--\")\n        legend_dict[control_type.strip()] = full_name.strip()\n    return legend_dict\n", "entry_point": "parse_legend", "input": "'Controls: P--touch screen, K--keypad'", "output": "{'P': 'touch screen', 'K': 'keypad'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77975_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009995", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[1, 1, 1, 1, 1, 1, 1, 1, 0, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009996", "code": "def calculate_total_nft_value(transactions):\n    total_value = sum(transaction[\"value\"] for transaction in transactions)\n    return total_value\n", "entry_point": "calculate_total_nft_value", "input": "[{'value': 100}, {'value': 125}]", "output": "225", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24676_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009997", "code": "def get_value(type_acquisition, model_input_size):\n    dict_size = {\n        \"SEM\": {\n            \"512\": 0.1,\n            \"256\": 0.2\n        },\n        \"TEM\": {\n            \"512\": 0.01\n        }\n    }\n    # Check if the type_acquisition and model_input_size exist in the dictionary\n    if type_acquisition in dict_size and model_input_size in dict_size[type_acquisition]:\n        return dict_size[type_acquisition][model_input_size]\n    else:\n        return \"Value not found\"\n", "entry_point": "get_value", "input": "'TEM', '512'", "output": "0.01", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2685_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7288", "output": "{1, 2, 4, 8, 911, 7288, 3644, 1822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7287", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0009999", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'29 Feb 2000'", "output": "'Feb 29, 2000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010000", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[53]", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010001", "code": "def count_older_ages(ages, threshold):\n    count = 0\n    for age in ages:\n        if age > threshold:\n            count += 1\n    return count\n", "entry_point": "count_older_ages", "input": "[10, 15, 21, 22, 23, 24], 20", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135375_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010002", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "'**about**'", "output": "'about'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010003", "code": "def get_voltage_level(voltage_value):\n    _cc_voltages = {6300: '5', 10000: '6', 16000: '7', 25000: '8', 50000: '9'}\n    if voltage_value in _cc_voltages:\n        return _cc_voltages[voltage_value]\n    else:\n        return 'Unknown'\n", "entry_point": "get_voltage_level", "input": "7000", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146269_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010004", "code": "import os\ndef unique_files(folder1: str, folder2: str) -> set:\n    files_folder1 = set()\n    files_folder2 = set()\n    for root, _, files in os.walk(folder1):\n        for f in files:\n            if f.endswith(\".md\"):\n                files_folder1.add(f.split(\".md\")[0])\n    for root, _, files in os.walk(folder2):\n        for f in files:\n            if f.endswith(\".md\"):\n                files_folder2.add(f.split(\".md\")[0])\n    unique_files_folder1 = files_folder1 - files_folder2\n    return unique_files_folder1\n", "entry_point": "unique_files", "input": "'empty_folder1', 'empty_folder2'", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3888_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010005", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "12", "output": "0.4583333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010006", "code": "def get_model_details(model_name):\n    DEPTH_MODELS = ('alexnet', 'resnet18', 'resnet50', 'vgg', 'sqznet')\n    DEPTH_DIMS = {'alexnet': 4096, 'resnet18': 512, 'resnet50': 2048, 'vgg': 4096, 'sqznet': 1024}\n    DEPTH_CHANNELS = {'alexnet': 256, 'resnet18': 256, 'resnet50': 1024, 'vgg': 512, 'sqznet': 512}\n    if model_name in DEPTH_MODELS:\n        return DEPTH_DIMS[model_name], DEPTH_CHANNELS[model_name]\n    else:\n        return \"Model not recognized\"\n", "entry_point": "get_model_details", "input": "'resnet18'", "output": "(512, 256)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125406_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010007", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "'EE'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010008", "code": "def card_war(player1_cards, player2_cards):\n    results = []\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            results.append('Player 1')\n        elif card2 > card1:\n            results.append('Player 2')\n        else:\n            results.append('Tie')\n    return results\n", "entry_point": "card_war", "input": "[1, 3, 4], [2, 3, 5]", "output": "['Player 2', 'Tie', 'Player 2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114336_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010009", "code": "def min_sum_of_squared_differences(a):\n    s = float(\"inf\")\n    for i in range(min(a), max(a) + 1):\n        t = 0\n        for j in a:\n            t += (j - i) ** 2\n        s = min(s, t)\n    return s\n", "entry_point": "min_sum_of_squared_differences", "input": "[0, 5, 10]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139350_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010010", "code": "from typing import List\nimport queue\ndef get_bool_operators(query_string: str) -> List[str]:\n    bool_operators = queue.Queue()\n    for ch in query_string:\n        if ch == '&' or ch == '|':\n            bool_operators.put(ch)\n    return list(bool_operators.queue)\n", "entry_point": "get_bool_operators", "input": "'|'", "output": "['|']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108905_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010011", "code": "from typing import List, Dict, Union\ndef count_schools_by_id(schools: List[Dict[str, Union[int, str]]]) -> Dict[int, int]:\n    school_id_counts = {}\n    for school in schools:\n        school_id = school['school_id']\n        if school_id in school_id_counts:\n            school_id_counts[school_id] += 1\n        else:\n            school_id_counts[school_id] = 1\n    return school_id_counts\n", "entry_point": "count_schools_by_id", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44138_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010012", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'path/to/some/ftxu'", "output": "'path/to/some/ftxu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9001", "output": "{1, 9001}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010014", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[-2, -1, 1, 3, 4, 5, 3, 1, 5, 1]", "output": "[1, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5235", "output": "{1, 3, 5, 15, 1745, 5235, 1047, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5036", "output": "{1, 2, 4, 1259, 5036, 2518}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5035", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010017", "code": "def requires_special_handling(driver: str) -> bool:\n    special_drivers = [\"QEMU\", \"Xen\"]\n    return driver in special_drivers\n", "entry_point": "requires_special_handling", "input": "'QEMU'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65777_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010018", "code": "def calculate_network_stats(data):\n    neurons = set()\n    connections = set()\n    for entry in data:\n        neurons.add(entry['neuron_id'])\n        connections.update(entry['connections'])\n    total_neurons = len(neurons)\n    total_connections = len(connections) + sum(len(entry['connections']) for entry in data)\n    return total_neurons, total_connections\n", "entry_point": "calculate_network_stats", "input": "[]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132107_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010019", "code": "import base64\ndef process_content(contents):\n    content_type, content_string = contents.split(',')\n    decoded_content = base64.b64decode(content_string)\n    return decoded_content\n", "entry_point": "process_content", "input": "'application/json,eyJhIjoiYiJ9'", "output": "b'{\"a\":\"b\"}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133360_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010020", "code": "def calculate_max_voltage(gain):\n    if gain == 1:\n        max_VOLT = 4.096\n    elif gain == 2:\n        max_VOLT = 2.048\n    elif gain == 4:\n        max_VOLT = 1.024\n    elif gain == 8:\n        max_VOLT = 0.512\n    elif gain == 16:\n        max_VOLT = 0.256\n    else:  # gain == 2/3\n        max_VOLT = 6.144\n    return max_VOLT\n", "entry_point": "calculate_max_voltage", "input": "1", "output": "4.096", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119884_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010021", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 89, 85, 70, 70]", "output": "[100, 90, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148811_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010022", "code": "def process_certificates(fixtures):\n    passed_certificates = {}\n    for fixture in fixtures:\n        if fixture.get('status') == 'passed':\n            domain = fixture.get('domain')\n            expiry_date = fixture.get('expiry_date')\n            passed_certificates[domain] = expiry_date\n    return passed_certificates\n", "entry_point": "process_certificates", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70860_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010023", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 3, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5210", "output": "{1, 2, 5, 521, 10, 2605, 1042, 5210}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5209", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010025", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.config.erg'", "output": "'erg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010026", "code": "def pig_latin_converter(input_string):\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    words = input_string.split()\n    pig_latin_words = []\n    for word in words:\n        if word[0] in vowels:\n            pig_latin_words.append(word + 'way')\n        else:\n            first_vowel_index = next((i for i, c in enumerate(word) if c in vowels), None)\n            if first_vowel_index is not None:\n                pig_latin_words.append(word[first_vowel_index:] + word[:first_vowel_index] + 'ay')\n            else:\n                pig_latin_words.append(word)  # Word has no vowels, keep it as it is\n    # Reconstruct the transformed words into a single string\n    output_string = ' '.join(pig_latin_words)\n    return output_string\n", "entry_point": "pig_latin_converter", "input": "'hello'", "output": "'ellohay'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10322_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010027", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 101, 92, 88, 85, 70]", "output": "[101, 100, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5917", "output": "{1, 61, 5917, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010029", "code": "def sum_multiples(nums):\n    total = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[3, 5, 6, 10]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82044_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1175", "output": "{1, 5, 235, 47, 1175, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1174", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010031", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4705", "output": "{1, 4705, 5, 941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010032", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "251, 161, 3", "output": "'#FBA103'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010033", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "2, 8", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010034", "code": "import math\nMB = 1 << 20\nBUFF_SIZE = 10 * MB\ndef calculate_total_size(file_sizes):\n    total_size_in_bytes = sum(file_sizes)\n    total_size_in_mb = math.ceil(total_size_in_bytes / BUFF_SIZE)\n    return total_size_in_mb\n", "entry_point": "calculate_total_size", "input": "[12582912] * 10", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31272_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010035", "code": "import re\ndef parse_wsgi_config(wsgi_config_content):\n    wsgi_config_data = {}\n    lines = wsgi_config_content.split('\\n')\n    for line in lines:\n        if 'os.environ.setdefault' in line:\n            key_match = re.search(r'\"(.*?)\"', line)\n            value_match = re.search(r', \"(.*?)\"', line)\n            if key_match and value_match:\n                key = key_match.group(1)\n                value = value_match.group(1)\n                wsgi_config_data[key] = value\n    return wsgi_config_data\n", "entry_point": "parse_wsgi_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55859_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010036", "code": "# Given enumeration of supported targets\nCPUS = {\n  'i686': [],\n  'amd64': ['generic', 'zen2', 'skylake', 'tremont'],\n  'arm64': ['cortex-a72'],\n  'riscv': ['sifive-u74'],\n  'power': ['pwr8', 'pwr9']\n}\ndef get_supported_cpu_models(architecture):\n    if architecture in CPUS:\n        return CPUS[architecture]\n    else:\n        return f\"No supported CPU models found for architecture '{architecture}'.\"\n", "entry_point": "get_supported_cpu_models", "input": "'arm64'", "output": "['cortex-a72']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57656_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010037", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'brie'", "output": "{'brie': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40517_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2193", "output": "{1, 129, 3, 43, 2193, 17, 51, 731}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "710", "output": "{1, 2, 355, 5, 710, 71, 10, 142}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt709", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010040", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'gglgeann_', 10", "output": "'gglgeann__high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010041", "code": "def process_integers(integer_list):\n    total = 0\n    for num in integer_list:\n        if num > 0:\n            total += num ** 2\n        elif num < 0:\n            total -= abs(num) / 2\n    return total\n", "entry_point": "process_integers", "input": "[10, 8, -125]", "output": "101.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92247_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010042", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'12'", "output": "'##'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010043", "code": "def my_index2(l, x, default=False):\n    return l.index(x) if x in l else default\n", "entry_point": "my_index2", "input": "[1, 2, 3], 4, -2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117825_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010044", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "4", "output": "[(1, 4), (2, 2), (4, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010045", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[5, 6, 5, 0, 5, 6]", "output": "[0, 5, 5, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010046", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'pexaplemepppexem'", "output": "'pexaplemepppexem_1464970852'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010047", "code": "def calculate_total(data):\n    total_revenue = 0\n    total_profit = 0\n    for entry in data:\n        total_revenue += entry['revenue']\n        total_profit += entry['profit']\n    return total_revenue, total_profit\n", "entry_point": "calculate_total", "input": "[{'revenue': 50, 'profit': 20}, {'revenue': 50, 'profit': 30}]", "output": "(100, 50)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131837_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010048", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[5, 0, -5, 2, 2, 2, 0, 5, -5]", "output": "[25, 0, 25, 4, 4, 4, 0, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010049", "code": "def max_score_subset(scores):\n    scores.sort()\n    prev_score = prev_count = curr_score = curr_count = max_sum = 0\n    for score in scores:\n        if score == curr_score:\n            curr_count += 1\n        elif score == curr_score + 1:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        else:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        if prev_score == score - 1:\n            max_sum = max(max_sum, prev_count * prev_score + curr_count * curr_score)\n        else:\n            max_sum = max(max_sum, curr_count * curr_score)\n    return max_sum\n", "entry_point": "max_score_subset", "input": "[2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103662_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1328", "output": "{1, 2, 4, 166, 8, 332, 1328, 16, 83, 664}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1327", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010051", "code": "def extract_python_version(input_string):\n    parts = input_string.split()\n    for part in parts:\n        if '.' in part:\n            return part\n", "entry_point": "extract_python_version", "input": "'This is Python 3.9.1 running on Windows'", "output": "'3.9.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30856_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010052", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'http:/tp:oe'", "output": "'xmlns:__NAMESPACE__=\"http:/tp:oe\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010053", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[74]", "output": "74", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010054", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[0, 3, 2, -1, -3, 1]", "output": "[3, -1, -3, -2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010055", "code": "def moving_average(nums, k):\n    if k <= 0:\n        raise ValueError(\"k should be a positive integer\")\n    if k > len(nums):\n        return []\n    averages = []\n    window_sum = sum(nums[:k])\n    averages.append(window_sum / k)\n    for i in range(k, len(nums)):\n        window_sum = window_sum - nums[i - k] + nums[i]\n        averages.append(window_sum / k)\n    return averages\n", "entry_point": "moving_average", "input": "[9, 9, 6, 8], 2", "output": "[9.0, 7.5, 7.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117361_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010056", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'/serapp', 'templpatsla'", "output": "'/serapp/templpatsla'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010057", "code": "def find_smallest_divisible_number(digit1: int, digit2: int, k: int) -> int:\n    MAX_NUM_OF_DIGITS = 10\n    INT_MAX = 2**31-1\n    if digit1 < digit2:\n        digit1, digit2 = digit2, digit1\n    total = 2\n    for l in range(1, MAX_NUM_OF_DIGITS+1):\n        for mask in range(total):\n            curr, bit = 0, total>>1\n            while bit:\n                curr = curr*10 + (digit1 if mask&bit else digit2)\n                bit >>= 1\n            if k < curr <= INT_MAX and curr % k == 0:\n                return curr\n        total <<= 1\n    return -1\n", "entry_point": "find_smallest_divisible_number", "input": "5, 5, 10", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7656_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010058", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9554", "output": "{1, 2, 34, 4777, 17, 9554, 562, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9553", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010059", "code": "from typing import List, Any\nPER_PAGE = 10\ndef paginate(items: List[Any], page: int) -> List[Any]:\n    total_pages = (len(items) + PER_PAGE - 1) // PER_PAGE\n    if page < 1 or page > total_pages:\n        return []\n    start_idx = (page - 1) * PER_PAGE\n    end_idx = min(start_idx + PER_PAGE, len(items))\n    return items[start_idx:end_idx]\n", "entry_point": "paginate", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 2", "output": "[11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91891_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010060", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:edX+CSc01+c02c'", "output": "('edX', 'CSc01', 'c02c')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010061", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'diThisbad!'", "output": "'diThisbad!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010062", "code": "def f(bar):\n    # type: (Union[str, bytearray]) -> str\n    if isinstance(bar, bytearray):\n        return bar.decode('utf-8')  # Convert bytearray to string\n    elif isinstance(bar, str):\n        return bar  # Return the input string as is\n    else:\n        raise TypeError(\"Input must be a string or bytearray\")\n", "entry_point": "f", "input": "bytearray(b'Testing 123')", "output": "'Testing 123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47415_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010063", "code": "def validate_parameters(frequency, warmup):\n    if not isinstance(frequency, int) or frequency < 1:\n        raise ValueError('Frequency should be an integer equal to or larger than 1')\n    if not isinstance(warmup, int) or warmup < 1 or warmup >= frequency:\n        raise ValueError(f'Warmup should be an integer between 1 and {frequency-1}')\n    return True\n", "entry_point": "validate_parameters", "input": "5, 3", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136932_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010064", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[1, 2, 2, 3, 4, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010065", "code": "import re\ndef find_common_strings(section1, section2):\n    words1 = set(re.findall(r'\\b\\w{3,}\\b', section1))\n    words2 = set(re.findall(r'\\b\\w{3,}\\b', section2))\n    common_words = words1.intersection(words2)\n    common_strings = sorted(list(common_words))\n    return common_strings\n", "entry_point": "find_common_strings", "input": "'cat dog', 'sun moon'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94192_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010066", "code": "from typing import List\ndef sum_multiples_of_3_or_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 12]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84660_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010067", "code": "def extract_config_info(config_str):\n    parts = config_str.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "extract_config_info", "input": "'waldur_openstack.OpenStackConfig'", "output": "('waldur_openstack', 'OpenStackConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24681_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010068", "code": "def calculate_moving_average(nums, k):\n    moving_averages = []\n    for i in range(len(nums) - k + 1):\n        window_sum = sum(nums[i:i+k])\n        moving_averages.append(window_sum / k)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[1, 2], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143205_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010069", "code": "def cadastralSurvey(pMap):\n    def dfs(row, col):\n        if row < 0 or row >= len(pMap) or col < 0 or col >= len(pMap[0]) or pMap[row][col] == 0 or visited[row][col]:\n            return\n        visited[row][col] = True\n        for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n            dfs(row + dr, col + dc)\n    if not pMap:\n        return 0\n    rows, cols = len(pMap), len(pMap[0])\n    visited = [[False for _ in range(cols)] for _ in range(rows)]\n    distinct_plots = 0\n    for i in range(rows):\n        for j in range(cols):\n            if pMap[i][j] == 1 and not visited[i][j]:\n                dfs(i, j)\n                distinct_plots += 1\n    return distinct_plots\n", "entry_point": "cadastralSurvey", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42053_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010070", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[1, 6, 3, 5, 5, 3, 2, 5]", "output": "[6, 3, 5, 5, 3, 2, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010071", "code": "def first_repeating(n, arr):\n    seen = set()\n    for i in range(n):\n        if arr[i] in seen:\n            return arr[i]\n        seen.add(arr[i])\n    return -1\n", "entry_point": "first_repeating", "input": "5, [1, 2, 3, 4, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49861_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010072", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the '.' delimiter\n    version_components = version_string.split('.')\n    # Extract major, minor, and patch version numbers\n    major_version = int(version_components[0])\n    minor_version = int(version_components[1])\n    patch_version = int(version_components[2])\n    return major_version, minor_version, patch_version\n", "entry_point": "extract_version_numbers", "input": "'2.7.2'", "output": "(2, 7, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146914_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010073", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'ababcabc###def!@#ghi'", "output": "['ababcabc', 'def', 'ghi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010074", "code": "def calculate_commission_rate(trading_volume_usd, user_type):\n    if user_type == 'taker':\n        if trading_volume_usd <= 100000:\n            return 0.001 * trading_volume_usd\n        elif trading_volume_usd <= 500000:\n            return 0.0008 * trading_volume_usd\n        else:\n            return 0.0006 * trading_volume_usd\n    elif user_type == 'maker':\n        if trading_volume_usd <= 100000:\n            return 0.0005 * trading_volume_usd\n        elif trading_volume_usd <= 500000:\n            return 0.0004 * trading_volume_usd\n        else:\n            return 0.0003 * trading_volume_usd\n", "entry_point": "calculate_commission_rate", "input": "100000, 'taker'", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77743_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010075", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "1", "output": "'\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010076", "code": "import os\ndef get_log_file_paths(directory):\n    log_file_paths = set()\n    for root, dirs, files in os.walk(directory):\n        for file in files:\n            if file.endswith(\".log\"):\n                log_file_paths.add(os.path.join(root, file))\n    return log_file_paths\n", "entry_point": "get_log_file_paths", "input": "'/path/to/nonexistent/directory'", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104019_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010077", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[2, 4, 6]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010078", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "4", "output": "{'int': '4'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010079", "code": "def process_strings(input_list):\n    filtered_list = [s.upper() for s in input_list if 'a' not in s.lower()]\n    sorted_list = sorted(filtered_list, key=len, reverse=True)\n    return sorted_list\n", "entry_point": "process_strings", "input": "['KIWI']", "output": "['KIWI']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8897_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010080", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[0, 4, 5, 1, 1, 2, 2, 2, 2]", "output": "[4, 5, 1, 1, 2, 2, 2, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010081", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[10, 86, 85, 76, 60]", "output": "[86, 85, 76]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010082", "code": "import math\ndef get_total_pages(post_list, count):\n    total_posts = len(post_list)\n    total_pages = math.ceil(total_posts / count)\n    return total_pages\n", "entry_point": "get_total_pages", "input": "['post1', 'post2', 'post3', 'post4', 'post5', 'post6', 'post7'], -1", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90417_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010083", "code": "def rounded_sum(numbers):\n    total_sum = sum(numbers)\n    rounded_sum = round(total_sum)\n    return rounded_sum\n", "entry_point": "rounded_sum", "input": "[10.0, 5.0, 8.0]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88747_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010084", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# te.xt.tet'", "output": "'te.xt.tet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010085", "code": "import binascii\nimport string\ndef single_byte_xor_decrypt(hex_str):\n    bytes_data = binascii.unhexlify(hex_str)\n    max_score = 0\n    decrypted_message = \"\"\n    for key in range(256):\n        decrypted = ''.join([chr(byte ^ key) for byte in bytes_data])\n        score = sum([decrypted.count(char) for char in string.ascii_letters])\n        if score > max_score:\n            max_score = score\n            decrypted_message = decrypted\n    return decrypted_message\n", "entry_point": "single_byte_xor_decrypt", "input": "'5a7676725a7677'", "output": "'ZvvrZvw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68268_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1427", "output": "{1, 1427}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010087", "code": "def journeyToMoon(n, astronaut):\n    adj_list = [[] for _ in range(n)]\n    for pair in astronaut:\n        adj_list[pair[0]].append(pair[1])\n        adj_list[pair[1]].append(pair[0])\n    def dfs(node, visited):\n        size = 1\n        visited[node] = True\n        for neighbor in adj_list[node]:\n            if not visited[neighbor]:\n                size += dfs(neighbor, visited)\n        return size\n    visited = [False] * n\n    components = []\n    for i in range(n):\n        if not visited[i]:\n            components.append(dfs(i, visited))\n    total_pairs = sum(components)\n    total_ways = 0\n    for component_size in components:\n        total_pairs -= component_size\n        total_ways += component_size * total_pairs\n    return total_ways // 2\n", "entry_point": "journeyToMoon", "input": "1, []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35640_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010088", "code": "def process_data(SBTS_DIC, NODES_DIC, COMMS_DIC):\n    result = {}\n    for key_sbts, value_sbts in SBTS_DIC.items():\n        if value_sbts in NODES_DIC and NODES_DIC[value_sbts] in COMMS_DIC:\n            result[key_sbts] = COMMS_DIC[NODES_DIC[value_sbts]]\n    return result\n", "entry_point": "process_data", "input": "{}, {}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136099_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010089", "code": "from itertools import combinations\ndef can_form_triangle(sticks):\n    for comb in combinations(sticks, 3):\n        l1, l2, l3 = comb\n        if (l1 + l2 > l3) and (l1 + l3 > l2) and (l2 + l3 > l1):\n            return True\n    return False\n", "entry_point": "can_form_triangle", "input": "[3, 4, 5]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124844_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010090", "code": "def pins_with_notes(board):\n    result = []\n    for section_pins in board.values():\n        for pin in section_pins:\n            if pin in board['_notes']:\n                result.append(pin)\n    return result\n", "entry_point": "pins_with_notes", "input": "{'_notes': [], 'section1': [1, 2, 3], 'section2': [4, 5, 6]}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010091", "code": "def filter_permissions(perms_map, permission_classes, authentication_classes):\n    filtered_permissions = []\n    for perm_dict in perms_map:\n        for perm_class, perm_level in perm_dict.items():\n            if perm_class in permission_classes and perm_level in authentication_classes:\n                filtered_permissions.append({perm_class: perm_level})\n    return filtered_permissions\n", "entry_point": "filter_permissions", "input": "[], ['admin', 'user'], [1, 2]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105239_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "796", "output": "{1, 2, 4, 199, 398, 796}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt795", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010093", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        inner_list = list(range(1, i + 1))\n        pattern.append(inner_list)\n    return pattern\n", "entry_point": "generate_pattern", "input": "4", "output": "[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76877_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010094", "code": "def max_sum_non_adjacent(lst):\n    inclusive = 0\n    exclusive = 0\n    for num in lst:\n        temp = inclusive\n        inclusive = max(num + exclusive, inclusive)\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99321_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010095", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'eelo'", "output": "b'\\x04\\x00\\x00\\x00eelo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010096", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[6, 2, 8, 2, 6, 8, 8, 6, 7]", "output": "[6, 3, 10, 5, 10, 13, 14, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010097", "code": "def generate_output(service_results):\n    final_output = \"\"\n    for service_name, analysis_result in service_results.items():\n        chunks_leaked, mem_leaks = analysis_result.split(':')\n        formatted_output = '{:^25}{:^25}{:^30}'.format(service_name, chunks_leaked, mem_leaks) + \"\\n\"\n        final_output += formatted_output\n    return final_output\n", "entry_point": "generate_output", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41693_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010098", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'cappwcatl'", "output": "'Manual not available for cappwcatl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010099", "code": "from typing import List\nfrom datetime import datetime\ndef earliest_date(dates: List[str]) -> str:\n    earliest_date = \"9999/12/31\"  # Initialize with a date far in the future\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, \"%Y/%m/%d\")\n        if date_obj < datetime.strptime(earliest_date, \"%Y/%m/%d\"):\n            earliest_date = date_str\n    return earliest_date\n", "entry_point": "earliest_date", "input": "['2022/04/01', '2023/01/01', '2022/03/10']", "output": "'2022/03/10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128206_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010100", "code": "def f(bar):\n    # type: (Union[str, bytearray]) -> str\n    if isinstance(bar, bytearray):\n        return bar.decode('utf-8')  # Convert bytearray to string\n    elif isinstance(bar, str):\n        return bar  # Return the input string as is\n    else:\n        raise TypeError(\"Input must be a string or bytearray\")\n", "entry_point": "f", "input": "bytearray(b'789')", "output": "'789'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47415_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010101", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "2, 0", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010102", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'wohello wr'", "output": "'wr wohello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1547", "output": "{1, 7, 1547, 13, 17, 119, 91, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010104", "code": "def calculate_mean_median(numbers):\n    # Calculate the mean\n    mean = sum(numbers) / len(numbers)\n    # Sort the list to find the median\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:\n        # If the list has an even number of elements\n        median = (sorted_numbers[n // 2 - 1] + sorted_numbers[n // 2]) / 2\n    else:\n        # If the list has an odd number of elements\n        median = sorted_numbers[n // 2]\n    return mean, median\n", "entry_point": "calculate_mean_median", "input": "[3.0, 3.5, 4.0]", "output": "(3.5, 3.5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51463_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010105", "code": "def queryProcessed(ele, arr):\n    for var in arr:\n        if ele == var:\n            return True\n    return False\n", "entry_point": "queryProcessed", "input": "10, [1, 2, 3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49833_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010106", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[4, 0, 1, 4, 5, 2, 0, 1]", "output": "[4, 0, 1, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010107", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'clean_data', 'series.npy'", "output": "'clean_data/series.npy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010108", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "-1, -2, 3", "output": "'-1.-2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010109", "code": "def simulate_vehicle(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        elif command == 'A':\n            y += 1\n        elif command == 'B':\n            y -= 1\n    return x, y\n", "entry_point": "simulate_vehicle", "input": "['A', 'L', 'R']", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105598_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010110", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8805", "output": "{1, 1761, 3, 5, 8805, 587, 15, 2935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8804", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010111", "code": "def digitDifferenceSort(a):\n    def dg(n):\n        s = list(map(int, str(n)))\n        return max(s) - min(s)\n    ans = [(a[i], i) for i in range(len(a))]\n    A = sorted(ans, key=lambda x: (dg(x[0]), -x[1]))\n    return [c[0] for c in A]\n", "entry_point": "digitDifferenceSort", "input": "[22, 22, 887, 886, 24, 154, 152, 891]", "output": "[22, 22, 887, 24, 886, 152, 154, 891]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132098_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010112", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[10, 20, 30, 40], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010113", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'ESTABLISHED', 'REJECT'", "output": "'DECLINED'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010114", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[0, 3, 1, 5, 4, 2, 3, 3, 3]", "output": "[5, 8, 6, 10, 9, 7, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010115", "code": "def sum_of_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "10", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49804_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010116", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9769", "output": "{1, 9769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010117", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010118", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[101]", "output": "[101]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010119", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5435", "output": "{1, 5435, 5, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010120", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'eeoom.comoom.com'", "output": "'eeoom.comoom.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2431", "output": "{1, 11, 13, 143, 17, 187, 221, 2431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010122", "code": "def vending_machine(coins, item_id, inserted_amount):\n    items = {\n        1: {\"price\": 100, \"quantity\": 5},\n        2: {\"price\": 75, \"quantity\": 2},\n        3: {\"price\": 50, \"quantity\": 3}\n    }\n    total_inserted = sum(coins)\n    if item_id not in items:\n        return (0, coins)  # Invalid item ID, return inserted coins as change\n    selected_item = items[item_id]\n    if total_inserted < selected_item[\"price\"]:\n        return (0, coins)  # Insufficient funds, return inserted coins as change\n    change_due = total_inserted - selected_item[\"price\"]\n    if change_due > 0:\n        change_coins = []\n        for coin in [50, 25, 10, 5, 1]:\n            while change_due >= coin and coins.count(coin) < coins.count(coin) + selected_item[\"quantity\"]:\n                change_coins.append(coin)\n                change_due -= coin\n        if change_due > 0:\n            return (0, coins)  # Unable to provide change, return inserted coins as change\n    else:\n        change_coins = []\n    selected_item[\"quantity\"] -= 1\n    return (item_id, change_coins)\n", "entry_point": "vending_machine", "input": "[25, 25, 25, 25], 4, 0", "output": "(0, [25, 25, 25, 25])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20577_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010123", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9356", "output": "{1, 2, 2339, 4, 4678, 9356}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9355", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010124", "code": "import re\nfrom datetime import datetime\ndef process_string(input_string):\n    current_year = datetime.now().year\n    current_month = datetime.now().strftime('%m')\n    def replace_counter(match):\n        counter_format = match.group(0)\n        min_width = int(counter_format.split(':')[1][1:-1])  # Extract minimum width from the placeholder\n        return str(counter_format.format(counter=process_string.counter).zfill(min_width))\n    process_string.counter = 1\n    placeholders = {\n        '{year}': str(current_year),\n        '{month}': current_month,\n        '{counter:0[1-9]+[0-9]*d}': replace_counter\n    }\n    for placeholder, value in placeholders.items():\n        input_string = re.sub(re.escape(placeholder), str(value) if callable(value) else value, input_string)\n    process_string.counter += 1\n    return input_string\n", "entry_point": "process_string", "input": "'{{yea{r'", "output": "'{{yea{r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112572_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010125", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo Hello World'", "output": "'Hello World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010126", "code": "from typing import List, Dict\ndef filter_messages(messages: List[Dict[str, str]], sender: str, keyword: str) -> List[Dict[str, str]]:\n    filtered_messages = []\n    for message in messages:\n        if message[\"sender\"] == sender and keyword in message[\"content\"]:\n            filtered_messages.append(message)\n    return filtered_messages\n", "entry_point": "filter_messages", "input": "[], 'John', 'hello'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114990_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010127", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5398", "output": "{1, 2, 2699, 5398}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010128", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "7", "output": "210066847942", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010129", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    if trimmed_scores:\n        return sum(trimmed_scores) / len(trimmed_scores)\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[75, 78, 78, 79, 81]", "output": "78.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124520_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6661", "output": "{1, 6661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010131", "code": "import json\nimport logging\ndef calculate_cart_total(existing_data, userID):\n    total = 0\n    for items in existing_data:\n        quantity = items['quantity']\n        price = items['price']\n        total += float(quantity) * float(price)\n    response = {}\n    response['userid'] = userID\n    response['carttotal'] = total\n    response = json.dumps(response)\n    logging.info(\"The total for user %s is %f\", userID, total)\n    return response\n", "entry_point": "calculate_cart_total", "input": "[], '5432134234'", "output": "'{\"userid\": \"5432134234\", \"carttotal\": 0}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37848_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010132", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'10'", "output": "['10']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010133", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 92, 85, 85]", "output": "[100, 92, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148811_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010134", "code": "def determine_winner(deck_a, deck_b):\n    score_a = 0\n    score_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    if score_a > score_b:\n        return 'Player A'\n    elif score_b > score_a:\n        return 'Player B'\n    else:\n        return 'Tie'\n", "entry_point": "determine_winner", "input": "[1, 2, 3], [1, 2, 3]", "output": "'Tie'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21245_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010135", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "883", "output": "{1, 883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010136", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/hk/'", "output": "'hk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010137", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "18, 6", "output": "18564", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010138", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3799", "output": "{1, 131, 29, 3799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010139", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{0, 1, 2}, {4, 5}", "output": "{0, 1, 2, 4, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010140", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'5+3'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010141", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[12, 10, 8, 4, 2]", "output": "[12, 10, 8, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010142", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "9, 2", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt411", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010143", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "-0.25, -0.25", "output": "-1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010144", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[4, 4, 4]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42557_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010145", "code": "# Constants and data structures from the code snippet\nBRAIN_WAVES = {\n    'delta': (0.5, 4.0),\n    'theta': (4.0, 7.0),\n    'alpha': (7.0, 12.0),\n    'beta': (12.0, 30.0),\n}\n# Function to calculate the frequency range for a given brain wave type\ndef calculate_frequency_range(brain_wave_type):\n    if brain_wave_type in BRAIN_WAVES:\n        return BRAIN_WAVES[brain_wave_type]\n    else:\n        return \"Brain wave type not found in the dictionary.\"\n", "entry_point": "calculate_frequency_range", "input": "'delta'", "output": "(0.5, 4.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67058_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010146", "code": "def find_median(arr):\n    arr.sort()\n    n = len(arr)\n    if n % 2 == 1:\n        return arr[n // 2]\n    else:\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (arr[mid_left] + arr[mid_right]) / 2\n", "entry_point": "find_median", "input": "[2.5]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141135_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010147", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[36], 2", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010148", "code": "def count_servers_in_debug_mode(servers):\n    debug_servers_count = 0\n    for server in servers:\n        if server.get(\"debug\", False):\n            debug_servers_count += 1\n    return debug_servers_count\n", "entry_point": "count_servers_in_debug_mode", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107601_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7929", "output": "{1, 3, 9, 881, 2643, 7929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010150", "code": "def calculate_similarity_score(values, threshold, max_score):\n    counter = 0\n    for value in values:\n        if threshold <= value <= max_score:\n            counter += 1\n    similarity_score = counter / len(values) if len(values) > 0 else 0\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "[0, 2, 4], 1, 3", "output": "0.3333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115408_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010151", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2413", "output": "{1, 19, 2413, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010152", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "-2", "output": "'https://www.kaiheila.cn/api/v-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010153", "code": "def custom_find(main_str, sub_str):\n    for i in range(len(main_str) - len(sub_str) + 1):\n        if main_str[i:i + len(sub_str)] == sub_str:\n            return i\n    return -1\n", "entry_point": "custom_find", "input": "'hello', 'world'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145848_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010154", "code": "def average_brightness(light_states):\n    total_brightness = 0\n    num_lights_on = 0\n    for light_state in light_states:\n        brightness = light_state['attributes'].get('brightness', 0)\n        if brightness > 0:\n            total_brightness += brightness\n            num_lights_on += 1\n    if num_lights_on == 0:\n        return 0\n    else:\n        return total_brightness / num_lights_on\n", "entry_point": "average_brightness", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132613_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010155", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7347", "output": "{1, 3, 237, 79, 2449, 7347, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010156", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[5, 4, 3, 3, 3, 2, 1]", "output": "[5, 4, 3, 3, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010157", "code": "def generate_default_param_file(param_settings):\n    param_file_content = '\\n'.join([f\"{param} = {value}\" for param, value in param_settings.items()])\n    return param_file_content\n", "entry_point": "generate_default_param_file", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17401_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010158", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[0, 0, 1, 1, 3, 3]", "output": "[3, 3, 1, 1, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010159", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    unique_scores = []\n    top_scores = []\n    for score in sorted_scores:\n        if score not in unique_scores:\n            unique_scores.append(score)\n            top_scores.append(score)\n            if len(top_scores) == n:\n                break\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[90, 91, 85, 76], 2", "output": "90.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78119_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010160", "code": "def play_maze_game(maze):\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n    def is_valid_move(row, col):\n        return 0 <= row < len(maze) and 0 <= col < len(maze[0]) and maze[row][col] != 'X'\n    for row in range(len(maze)):\n        for col in range(len(maze[0])):\n            if maze[row][col] == 'S':\n                current_row, current_col = row, col\n    for dr, dc in directions:\n        new_row, new_col = current_row + dr, current_col + dc\n        if is_valid_move(new_row, new_col):\n            if maze[new_row][new_col] == 'G':\n                return 'You win! Congratulations!'\n            current_row, current_col = new_row, new_col\n    return 'Game over! You lose.'\n", "entry_point": "play_maze_game", "input": "[['S', 'G'], ['.', '.']]", "output": "'You win! Congratulations!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88612_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010161", "code": "def custom_any(seq):\n    for i in seq:\n        if i:\n            return True\n    return False\n", "entry_point": "custom_any", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41032_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010162", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "10", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010163", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9343", "output": "{1, 9343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010164", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "370", "output": "{1, 2, 5, 37, 74, 10, 370, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt369", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010165", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "1", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010166", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1582", "output": "{1, 2, 226, 7, 1582, 14, 113, 791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010167", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[5, 7, 6]", "output": "[[7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010168", "code": "def parse_test_cases(test_cases):\n    test_dict = {}\n    current_suite = None\n    for line in test_cases.splitlines():\n        if '.' in line or '/' in line:\n            current_suite = line.strip()\n            test_dict[current_suite] = []\n        elif current_suite:\n            test_dict[current_suite].append(line.strip())\n    return test_dict\n", "entry_point": "parse_test_cases", "input": "'Parameter0.Fr'", "output": "{'Parameter0.Fr': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88834_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010169", "code": "def count_live_streams(live):\n    count = 0\n    for status in live:\n        if status == 1 or status == 2:\n            count += 1\n    return count\n", "entry_point": "count_live_streams", "input": "[1, 1, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94184_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010170", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "9, 14", "output": "126", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010171", "code": "def generate_place_names(n):\n    place_names = []\n    for i in range(1, n+1):\n        if i % 2 == 0 and i % 3 == 0:\n            place_names.append(\"Metropolis\")\n        elif i % 2 == 0:\n            place_names.append(\"City\")\n        elif i % 3 == 0:\n            place_names.append(\"Town\")\n        else:\n            place_names.append(str(i))\n    return place_names\n", "entry_point": "generate_place_names", "input": "5", "output": "['1', 'City', 'Town', 'City', '5']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143516_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "906", "output": "{1, 2, 3, 453, 6, 906, 302, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010173", "code": "import re\n# Dictionary mapping incorrect function names to correct function names\nfunction_mapping = {\n    'prit': 'print'\n}\ndef correct_function_names(code_snippet):\n    # Regular expression pattern to match function names\n    pattern = r'\\b(' + '|'.join(re.escape(key) for key in function_mapping.keys()) + r')\\b'\n    # Replace incorrect function names with correct function names\n    corrected_code = re.sub(pattern, lambda x: function_mapping[x.group()], code_snippet)\n    return corrected_code\n", "entry_point": "correct_function_names", "input": "'pprprit(\"Hello Python3!\")t(Po'", "output": "'pprprit(\"Hello Python3!\")t(Po'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116715_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010174", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[88, 69, 69, 50]", "output": "[88, 69, 69]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010175", "code": "def find_smallest_cell(matrix):\n    N = len(matrix)\n    INF = 10 ** 18\n    smallest_value = INF\n    smallest_coords = (0, 0)\n    for y in range(N):\n        for x in range(N):\n            if matrix[y][x] < smallest_value:\n                smallest_value = matrix[y][x]\n                smallest_coords = (y, x)\n    return smallest_coords\n", "entry_point": "find_smallest_cell", "input": "[[3, 4, 5], [5, 6, 1], [7, 8, 9]]", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87658_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010176", "code": "import re\nre_date = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])$')\nre_time = re.compile(r'^([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?$')\nre_datetime = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])(\\D?([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?([zZ])?)?$')\nre_decimal = re.compile('^(\\d+)\\.(\\d+)$')\ndef validate_data_format(input_string: str) -> str:\n    if re.match(re_date, input_string):\n        return \"date\"\n    elif re.match(re_time, input_string):\n        return \"time\"\n    elif re.match(re_datetime, input_string):\n        return \"datetime\"\n    elif re.match(re_decimal, input_string):\n        return \"decimal\"\n    else:\n        return \"unknown\"\n", "entry_point": "validate_data_format", "input": "'2023-04-15'", "output": "'date'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67151_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2177", "output": "{1, 2177, 311, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010178", "code": "def sum_with_next_k(nums, k):\n    result = []\n    for i in range(len(nums) - k + 1):\n        result.append(sum(nums[i:i+k]))\n    return result\n", "entry_point": "sum_with_next_k", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0], 1", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73692_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010179", "code": "def get_valid_https_verify(input_value):\n    if isinstance(input_value, bool):\n        return input_value\n    elif isinstance(input_value, str) or isinstance(input_value, unicode):\n        return input_value.lower() == 'true'\n    else:\n        return False\n", "entry_point": "get_valid_https_verify", "input": "True", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69368_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010180", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3148", "output": "{1, 2, 4, 1574, 3148, 787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3147", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010181", "code": "def calculate_sum_of_digits(port, connection_key):\n    total_sum = 0\n    for digit in str(port) + str(connection_key):\n        total_sum += int(digit)\n    return total_sum\n", "entry_point": "calculate_sum_of_digits", "input": "999, 9", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102611_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010182", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[5, 10, 3, 8, 6, 1, 8]", "output": "[10, 8, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010183", "code": "def calculate_tanimoto_similarity(fingerprint_a, fingerprint_b):\n    intersection = set(fingerprint_a) & set(fingerprint_b)\n    union = set(fingerprint_a) | set(fingerprint_b)\n    if len(union) == 0:\n        return 0.0\n    tanimoto_similarity = len(intersection) / len(union)\n    return round(tanimoto_similarity, 2)\n", "entry_point": "calculate_tanimoto_similarity", "input": "[1], [1, 2, 3]", "output": "0.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2257_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2585", "output": "{1, 517, 5, 11, 235, 47, 55, 2585}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010185", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'1.0.0'", "output": "(1, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5195", "output": "{1, 5195, 5, 1039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010187", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[1, 2, 3, 4, 5, 7]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010188", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "5", "output": "'1 1 2 2 3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010189", "code": "def filter_notes(notes, keyword):\n    filtered_notes = []\n    for note in notes:\n        if keyword.lower() in note['title'].lower() or keyword.lower() in note['content'].lower():\n            filtered_notes.append(note)\n    return filtered_notes\n", "entry_point": "filter_notes", "input": "[], 'keyword'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81977_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010190", "code": "def move_player(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        # Check boundaries\n        x = max(-10, min(10, x))\n        y = max(-10, min(10, y))\n    return x, y\n", "entry_point": "move_player", "input": "['L']", "output": "(-1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9534_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010191", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010192", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[80.0, 85.0, 90.0, 94.0]", "output": "87.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010193", "code": "import re\nfrom typing import List\ndef extract_function_signatures(script: str) -> List[str]:\n    pattern = r'def\\s+([a-zA-Z_]\\w*)\\s*\\((.*?)\\):'\n    regex = re.compile(pattern, re.MULTILINE | re.DOTALL)\n    matches = regex.findall(script)\n    signatures = [f\"{match[0]}({match[1]})\" for match in matches]\n    return signatures\n", "entry_point": "extract_function_signatures", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74689_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010194", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "1", "output": "'Unknown Category'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010195", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_primes = 0\n    for num in numbers:\n        if is_prime(num):\n            total_primes += num\n    return total_primes\n", "entry_point": "sum_of_primes", "input": "[2, 2, 3, 3, 3, 3]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102298_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010196", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8682", "output": "{1, 2, 3, 6, 1447, 8682, 2894, 4341}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010197", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[1, 1, 2, 2, 3, 4, 5, 5]", "output": "{1, 2, 3, 4, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010198", "code": "def secondLongestWord(sentence):\n    wordArray = sentence.split(\" \")\n    longest = \"\"\n    secondLongest = \"\"\n    for word in wordArray:\n        if len(word) >= len(longest):\n            secondLongest = longest\n            longest = word\n        elif len(word) > len(secondLongest):\n            secondLongest = word\n    return secondLongest\n", "entry_point": "secondLongestWord", "input": "'The jumped quick fox'", "output": "'quick'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116541_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010199", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4745", "output": "{1, 65, 5, 4745, 73, 13, 365, 949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010200", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0.00\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[81, 81, 81, 81, 81, 81, 81, 81, 82]", "output": "81.11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122959_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010201", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'hhello world hellohello'", "output": "{'hhello': 1, 'world': 1, 'hellohello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010202", "code": "from typing import List\ndef max_product(nums: List[int]) -> int:\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[4, 6]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91738_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010203", "code": "def calculate_total_xp(server: str, stats: dict) -> int:\n    hourly_xp = stats.get(\"HourlyXP\", 0)\n    require_online = stats.get(\"RequireOnline\", False)\n    if require_online and server == \"online\":\n        return hourly_xp\n    elif not require_online:\n        return hourly_xp\n    else:\n        return 0\n", "entry_point": "calculate_total_xp", "input": "'offline', {'HourlyXP': 100, 'RequireOnline': True}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123528_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010204", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "5, 5, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010205", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'rtestsTir'", "output": "'rpasssuccess'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010206", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3914", "output": "{1, 2, 1957, 38, 103, 3914, 206, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3913", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010207", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'3737314.2'", "output": "(3737314, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010208", "code": "def calculate_risk_level(grid):\n    rows, cols = len(grid), len(grid[0])\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n    total_risk = 0\n    risky_depths = []\n    for i in range(1, rows - 1):\n        for j in range(1, cols - 1):\n            depth = grid[i][j]\n            min_neighbor_depth = min(grid[i + di][j + dj] for di, dj in directions)\n            if depth < min_neighbor_depth:\n                total_risk += depth\n                risky_depths.append(depth)\n    return total_risk + len(risky_depths)\n", "entry_point": "calculate_risk_level", "input": "[[1, 1, 1], [1, 1, 1], [1, 1, 1]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63763_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010209", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else sorted_scores\n    return sum(top_scores) / len(top_scores) if top_scores else 0\n", "entry_point": "average_top_scores", "input": "[90, 88, 85, 87, 86, 89, 84, 92], 8", "output": "87.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125675_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010210", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "135", "output": "(True, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010211", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'World,'", "output": "('World,', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010212", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'7 + 4'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010213", "code": "def min_unsorted_subarray_length(nums):\n    n = len(nums)\n    sorted_nums = sorted(nums)\n    start, end = n + 1, -1\n    for i in range(n):\n        if nums[i] != sorted_nums[i]:\n            start = min(start, i)\n            end = max(end, i)\n    diff = end - start\n    return diff + 1 if diff > 0 else 0\n", "entry_point": "min_unsorted_subarray_length", "input": "[2, 3, 4, 5, 1, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010214", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[1, 2, 5, 7, 10]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010215", "code": "def validate_storage_capabilities(expected_capabilities, actual_capabilities):\n    return expected_capabilities == actual_capabilities\n", "entry_point": "validate_storage_capabilities", "input": "[1, 2, 3], [1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13123_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010216", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[0, 5, 1, 0, 3, 0, 1]", "output": "[0, 125, 1, 0, 27, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010217", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[0, 0, 2, 5]", "output": "{0, 2, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010218", "code": "import re\ndef clean_slug(value, separator=None):\n    if separator == '-' or separator is None:\n        re_sep = '-'\n    else:\n        re_sep = '(?:-|%s)' % re.escape(separator)\n    value = re.sub(r'^%s+|%s+$' % (re_sep, re_sep), '', value)\n    if separator:\n        value = re.sub('%s+' % re_sep, separator, value)\n    return value\n", "entry_point": "clean_slug", "input": "'hello+_+__lold', '+'", "output": "'hello+_+__lold'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141562_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010219", "code": "def extract_major_version(version):\n    dot_index = version.find('.')\n    if dot_index != -1:\n        return version[:dot_index]\n    else:\n        return version  # If no dot found, return the entire version string as major version\n", "entry_point": "extract_major_version", "input": "'2201'", "output": "'2201'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34102_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010220", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "8, 10, 11", "output": "(8, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010221", "code": "def min_swaps_to_sort(nums):\n    count_1 = nums.count(1)\n    count_2 = nums.count(2)\n    count_3 = nums.count(3)\n    swaps = 0\n    for i in range(count_1):\n        if nums[i] != 1:\n            if nums[i] == 2:\n                if count_1 > 0:\n                    count_1 -= 1\n                    swaps += 1\n                else:\n                    count_3 -= 1\n                    swaps += 2\n            elif nums[i] == 3:\n                count_3 -= 1\n                swaps += 1\n    for i in range(count_1, count_1 + count_2):\n        if nums[i] != 2:\n            count_3 -= 1\n            swaps += 1\n    return swaps\n", "entry_point": "min_swaps_to_sort", "input": "[3, 2, 1, 3, 2, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124017_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010222", "code": "import re\ndef extract_pattern(input_text):\n    match = re.search(r'\\w+\\s*no\\s*', input_text)\n    if match:\n        return match.group()\n    else:\n        return \"\"\n", "entry_point": "extract_pattern", "input": "'apple no\\n'", "output": "'apple no\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90966_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010223", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 66534481, 1", "output": "66534481", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010224", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'TThiishis'", "output": "'TThiishis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010225", "code": "def max_non_adjacent_sum(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        temp = inclusive\n        inclusive = max(exclusive + num, inclusive)\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85142_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010226", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'exhexaple_'", "output": "'exhexaple_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010227", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'St.'", "output": "['st']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77980_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010228", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[0, 2, 4, 5, 7, -1]", "output": "[0, 2, 4, 5, 7, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "187", "output": "{11, 1, 187, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt186", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010230", "code": "def exam_grade(score):\n    if score < 0 or score > 100:\n        return \"Invalid Score\"\n    elif score >= 90:\n        return \"Top Score\"\n    elif score >= 60:\n        return \"Pass\"\n    else:\n        return \"Fail\"\n", "entry_point": "exam_grade", "input": "75", "output": "'Pass'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64122_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010231", "code": "def area_under_curve(x, y) -> float:\n    area = 0\n    for i in range(1, len(x)):\n        # Calculate the area of the trapezoid formed by two consecutive points\n        base = x[i] - x[i-1]\n        height_avg = (y[i] + y[i-1]) / 2\n        area += base * height_avg\n    return area\n", "entry_point": "area_under_curve", "input": "[0, 1, 2], [0, -4.5, 0]", "output": "-4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113501_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9093", "output": "{1, 3, 9093, 7, 433, 1299, 21, 3031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010233", "code": "def my_pow(x: float, n: int) -> float:\n    if n == 0:\n        return 1\n    result = my_pow(x*x, abs(n) // 2)\n    if n % 2:\n        result *= x\n    if n < 0:\n        return 1 / result\n    return result\n", "entry_point": "my_pow", "input": "2.0, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125524_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010234", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{6: []}, 6", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010235", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'A', 'A', 'A', 'B'], 7", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010236", "code": "def generate_js_includes(doctype_js: dict) -> str:\n    js_includes = []\n    for doctype, js_path in doctype_js.items():\n        js_includes.append(f\"Doctype: {doctype} - JS Path: {js_path}\")\n    return '\\n'.join(js_includes)\n", "entry_point": "generate_js_includes", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010237", "code": "CURRENT_BAZEL_VERSION = \"5.0.0\"\nOTHER_BAZEL_VERSIONS = [\n    \"4.2.2\",\n]\nSUPPORTED_BAZEL_VERSIONS = [\n    CURRENT_BAZEL_VERSION,\n] + OTHER_BAZEL_VERSIONS\ndef is_bazel_version_supported(version: str) -> bool:\n    return version in SUPPORTED_BAZEL_VERSIONS\n", "entry_point": "is_bazel_version_supported", "input": "'5.0.0'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32139_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "314", "output": "{1, 314, 2, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt313", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010239", "code": "def calculate_trainable_parameters(layers, units_per_layer):\n    total_params = 0\n    input_size = 7 * 7  # Assuming input size based on the environment\n    for _ in range(layers):\n        total_params += (input_size + 1) * units_per_layer\n        input_size = units_per_layer\n    return total_params\n", "entry_point": "calculate_trainable_parameters", "input": "0, 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124974_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010240", "code": "import re\nfrom typing import List\ndef extract_patterns(input_str: str) -> List[str]:\n    pattern = r'\"(.*?)\"'  # Regular expression pattern to match substrings within double quotes\n    return re.findall(pattern, input_str)\n", "entry_point": "extract_patterns", "input": "'\"multiple\"'", "output": "['multiple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69903_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010241", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 3]", "output": "[1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8390", "output": "{1, 2, 4195, 5, 8390, 839, 10, 1678}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8389", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010243", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105369_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010244", "code": "def count_digit_one(n):\n    count = 0\n    for num in range(1, n + 1):\n        count += str(num).count('1')\n    return count\n", "entry_point": "count_digit_one", "input": "13", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41035_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010245", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[20, 20, 20]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010246", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8571", "output": "{3, 1, 8571, 2857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010247", "code": "def largest_prime_factor(number):\n    factor = 2\n    while factor ** 2 <= number:\n        if number % factor == 0:\n            number //= factor\n        else:\n            factor += 1\n    return max(factor, number)\n", "entry_point": "largest_prime_factor", "input": "82", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80074_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010248", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[85, 85, 85, 75, 75, 100, 100, 92, 93]", "output": "{85: 3, 75: 2, 100: 2, 92: 1, 93: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010249", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010250", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "10.0, 0", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010251", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "None, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6155", "output": "{1, 6155, 5, 1231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010253", "code": "def sum_divisible_by_3_not_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    return total\n", "entry_point": "sum_divisible_by_3_not_5", "input": "[6, 9, 12]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59130_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010254", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'220..0..0', 'rmflCrmf'", "output": "\"[220..0..0]: 'rmflCrmf'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010255", "code": "import re\ndef clean_slug(value, separator=None):\n    if separator == '-' or separator is None:\n        re_sep = '-'\n    else:\n        re_sep = '(?:-|%s)' % re.escape(separator)\n    value = re.sub(r'^%s+|%s+$' % (re_sep, re_sep), '', value)\n    if separator:\n        value = re.sub('%s+' % re_sep, separator, value)\n    return value\n", "entry_point": "clean_slug", "input": "'hello---world', separator='_'", "output": "'hello_world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141562_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010256", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[66], 1", "output": "66.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59091_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010257", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'AAAAAAA'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010258", "code": "def calculate_input_dim(env_name, ob_space):\n    def observation_size(space):\n        return len(space)\n    def goal_size(space):\n        return 0  # Assuming goal information size is 0\n    def box_size(space):\n        return 0  # Assuming box size is 0\n    def robot_state_size(space):\n        return len(space)\n    if env_name == 'PusherObstacle-v0':\n        input_dim = observation_size(ob_space) - goal_size(ob_space) - box_size(ob_space)\n    elif 'Sawyer' in env_name:\n        input_dim = robot_state_size(ob_space)\n    else:\n        raise NotImplementedError(\"Input dimension calculation not implemented for this environment\")\n    return input_dim\n", "entry_point": "calculate_input_dim", "input": "'PusherObstacle-v0', [1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88440_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2521", "output": "{1, 2521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010260", "code": "from typing import List\ndef most_common_age(ages: List[int]) -> int:\n    age_freq = {}\n    for age in ages:\n        if age in age_freq:\n            age_freq[age] += 1\n        else:\n            age_freq[age] = 1\n    most_common = min(age_freq, key=lambda x: (-age_freq[x], x))\n    return most_common\n", "entry_point": "most_common_age", "input": "[25, 25, 20]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113386_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010261", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9957", "output": "{1, 3, 9957, 3319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010262", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[5, 1, 5, 2, 1, 3, 4, 2]", "output": "[25, 1, 25, 4, 1, 9, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010263", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[283]", "output": "283.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010264", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "506", "output": "{1, 2, 11, 46, 22, 23, 506, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt505", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010265", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7127", "output": "{1, 7127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010266", "code": "def jaccard_index(set1, set2):\n    intersection_size = len(set1 & set2)\n    union_size = len(set1 | set2)\n    if union_size == 0:\n        return 0.00\n    else:\n        jaccard = intersection_size / union_size\n        return round(jaccard, 2)\n", "entry_point": "jaccard_index", "input": "set(), set()", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9565_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010267", "code": "def sum_fibonacci(N):\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    a, b = 0, 1\n    fib_sum = a + b\n    for _ in range(2, N):\n        a, b = b, a + b\n        fib_sum += b\n    return fib_sum\n", "entry_point": "sum_fibonacci", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126922_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010268", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "4, 0, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010269", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 0, 0, 0, 1, 0, 0]", "output": "[1, 1, 1, 1, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010270", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "1.0, 2.0", "output": "2.23606797749979", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010271", "code": "from typing import List\ndef longest_consecutive_subsequence_length(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] == nums[i - 1] + 1:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 1\n    return max_length\n", "entry_point": "longest_consecutive_subsequence_length", "input": "[5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48952_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010272", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'111X'", "output": "['1110', '1111']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt42", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4639", "output": "{1, 4639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010274", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[1, 2, 3, 4, 5, 9]", "output": "(9, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010275", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "1, 0", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010276", "code": "def sum_multiples_of_3_or_5(numbers):\n    total = 0\n    seen = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[5, 12]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86745_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010277", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[3, 3, 2, 2, 9, 4]", "output": "[3, 2, 9, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010278", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[5, 5, 6]", "output": "[6, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010279", "code": "def count_elements(input):\n    count = 0\n    for element in input:\n        if isinstance(element, list):\n            count += count_elements(element)\n        else:\n            count += 1\n    return count\n", "entry_point": "count_elements", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9884_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010280", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9634", "output": "{1, 9634, 2, 4817}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010281", "code": "def calculate_coverage_percentage(executed_lines):\n    total_lines = 10  # Total number of unique lines in the code snippet\n    executed_lines = set(executed_lines)  # Convert executed lines to a set for uniqueness\n    executed_unique_lines = len(executed_lines)  # Number of unique lines executed\n    coverage_percentage = int((executed_unique_lines / total_lines) * 100)  # Calculate coverage percentage\n    return coverage_percentage\n", "entry_point": "calculate_coverage_percentage", "input": "[1, 2, 3, 4, 5, 6, 7]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8427_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010282", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'trrtetsTir'", "output": "'trrtetssuccess'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010283", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[8]", "output": "[8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9231", "output": "{1, 3, 3077, 9231, 17, 51, 181, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7199", "output": "{1, 23, 313, 7199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010286", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "5, 7", "output": "[0, 1, 2, 3, 4, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010287", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[1, 1, 2, 3, 2, 3]", "output": "[1, 2, 4, 6, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010288", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[170, 172, 174]", "output": "172", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010289", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010290", "code": "from typing import List\ndef count_ways(amount: int, coins: List[int]) -> int:\n    ways = [1] + [0] * amount\n    for coin in coins:\n        for val in range(coin, amount + 1):\n            ways[val] += ways[val - coin]\n    return ways[-1]\n", "entry_point": "count_ways", "input": "8, [1, 2, 5]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6024_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010291", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6693", "output": "{1, 97, 3, 291, 6693, 69, 23, 2231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1774", "output": "{1, 2, 1774, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1773", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7757", "output": "{1, 7757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010294", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "19", "output": "[19, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010295", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[8, 8, 1, 5, 4, 6, 9, 8]", "output": "[9, 8, 8, 8, 6, 5, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010296", "code": "def count_a_in_list(strings):\n    total_count = 0\n    for string in strings:\n        for char in string:\n            if char.lower() == 'a':\n                total_count += 1\n    return total_count\n", "entry_point": "count_a_in_list", "input": "['a', 'A']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113849_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010297", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[1, 0, 2, 0, 3, 0, 4, 0, 5]", "output": "'abbcccddddeeeee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010298", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[5, -6]", "output": "-30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010299", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "198", "output": "b'\\xc6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010300", "code": "def parse_urlpatterns(urlpatterns):\n    url_view_mapping = {}\n    for url_entry in urlpatterns:\n        url_path = url_entry[0]\n        view_class = url_entry[1]\n        url_view_mapping[url_path] = view_class\n    return url_view_mapping\n", "entry_point": "parse_urlpatterns", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88593_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010301", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1011110X'", "output": "['10111100', '10111101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010302", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[5], 6, [5, 5]]", "output": "[5, 6, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010303", "code": "def find_common_prefix(strings):\n    if not strings:\n        return None\n    prefix = \"\"\n    for i in range(len(strings[0])):\n        char = strings[0][i]\n        for string in strings[1:]:\n            if i >= len(string) or string[i] != char:\n                return prefix\n        prefix += char\n    return prefix\n", "entry_point": "find_common_prefix", "input": "['flower', 'flow', 'flee']", "output": "'fl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93804_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010304", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "402", "output": "{1, 2, 3, 67, 134, 6, 201, 402}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010305", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    sum_scores_except_lowest = sum(sorted_scores[1:])\n    average = sum_scores_except_lowest / (len(scores) - 1)\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[80, 87, 90, 90]", "output": "89.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71878_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010306", "code": "def vending_machine(coins, item_id, inserted_amount):\n    items = {\n        1: {\"price\": 100, \"quantity\": 5},\n        2: {\"price\": 75, \"quantity\": 2},\n        3: {\"price\": 50, \"quantity\": 3}\n    }\n    total_inserted = sum(coins)\n    if item_id not in items:\n        return (0, coins)  # Invalid item ID, return inserted coins as change\n    selected_item = items[item_id]\n    if total_inserted < selected_item[\"price\"]:\n        return (0, coins)  # Insufficient funds, return inserted coins as change\n    change_due = total_inserted - selected_item[\"price\"]\n    if change_due > 0:\n        change_coins = []\n        for coin in [50, 25, 10, 5, 1]:\n            while change_due >= coin and coins.count(coin) < coins.count(coin) + selected_item[\"quantity\"]:\n                change_coins.append(coin)\n                change_due -= coin\n        if change_due > 0:\n            return (0, coins)  # Unable to provide change, return inserted coins as change\n    else:\n        change_coins = []\n    selected_item[\"quantity\"] -= 1\n    return (item_id, change_coins)\n", "entry_point": "vending_machine", "input": "[24, 24, 24, 24, 24], 99, 0", "output": "(0, [24, 24, 24, 24, 24])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20577_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010307", "code": "import re\ndef process_string(input_string):\n    # Replace \"Kafka\" with \"Python\"\n    processed_string = input_string.replace(\"Kafka\", \"Python\")\n    # Remove digits from the string\n    processed_string = re.sub(r'\\d', '', processed_string)\n    # Reverse the string\n    processed_string = processed_string[::-1]\n    return processed_string\n", "entry_point": "process_string", "input": "'Kafka'", "output": "'nohtyP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55468_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010308", "code": "def sum_of_squares_of_evens(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8562_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010309", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'2:00 PM', '2:15'", "output": "'4:15 PM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010310", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3835", "output": "{1, 65, 5, 295, 59, 13, 3835, 767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9446", "output": "{1, 2, 4723, 9446}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010312", "code": "def extract_y_coordinates(coordinates):\n    y_coordinates = []  # Initialize an empty list to store y-coordinates\n    for coord in coordinates:\n        y_coordinates.append(coord[1])  # Extract y-coordinate (index 1) and append to the list\n    return y_coordinates\n", "entry_point": "extract_y_coordinates", "input": "[(0, 1), (3, 5)]", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19900_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010313", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 2", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt35", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010314", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[2, 3, 1, 4, -1, 6, 2, 6]", "output": "[5, 4, 5, 3, 5, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010315", "code": "from typing import List\ndef extract_phone_numbers(input_list: List[str]) -> List[str]:\n    phone_numbers = []\n    for phone_str in input_list:\n        numbers = phone_str.split(',')\n        for number in numbers:\n            cleaned_number = number.strip()\n            if cleaned_number:\n                phone_numbers.append(cleaned_number)\n    return phone_numbers\n", "entry_point": "extract_phone_numbers", "input": "['32323, 422', '32323, 42']", "output": "['32323', '422', '32323', '42']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103322_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010316", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "61, 1", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1577", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010317", "code": "def count_age_categories(ages):\n    adults = 0\n    minors = 0\n    for age in ages:\n        if age >= 18:\n            adults += 1\n        else:\n            minors += 1\n    return adults, minors\n", "entry_point": "count_age_categories", "input": "[18, 19, 20, 21, 25, 30, 40, 50]", "output": "(8, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73769_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010318", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'HH'", "output": "'HH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010319", "code": "def analyze_log_entries(log_entries: list) -> dict:\n    log_level_counts = {'INFO': 0, 'WARNING': 0, 'ERROR': 0}\n    for log_level, _ in log_entries:\n        if log_level in log_level_counts:\n            log_level_counts[log_level] += 1\n    return log_level_counts\n", "entry_point": "analyze_log_entries", "input": "[]", "output": "{'INFO': 0, 'WARNING': 0, 'ERROR': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75621_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010320", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7906", "output": "{1, 7906, 2, 67, 134, 3953, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010321", "code": "def handle_command(command):\n    command_responses = {\n        \"!hello\": \"Hello there!\",\n        \"!time\": \"The current time is 12:00 PM.\",\n        \"!weather\": \"The weather today is sunny.\",\n        \"!help\": \"You can ask me about the time, weather, or just say hello!\"\n    }\n    return command_responses.get(command, \"Sorry, I don't understand that command.\")\n", "entry_point": "handle_command", "input": "'!weather'", "output": "'The weather today is sunny.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123108_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010322", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 90, 85, 86], 4", "output": "87.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89007_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010323", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "382", "output": "{1, 2, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010324", "code": "def max_subset_sum_non_adjacent(arr):\n    incl = 0\n    excl = 0\n    for i in arr:\n        new_excl = max(incl, excl)  # Calculate the new value for excl\n        incl = excl + i  # Update incl to be excl + current element\n        excl = new_excl  # Update excl for the next iteration\n    return max(incl, excl)  # Return the maximum of incl and excl\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[10, 1, 1, 13]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143195_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8078", "output": "{1, 2, 1154, 577, 7, 4039, 8078, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8077", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4132", "output": "{1, 2, 4132, 4, 1033, 2066}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4131", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010327", "code": "def bubble_sort(elements):\n    while True:\n        swapped = False\n        for i in range(len(elements) - 1):\n            if elements[i] > elements[i + 1]:\n                # Swap elements\n                elements[i], elements[i + 1] = elements[i + 1], elements[i]\n                swapped = True\n        if not swapped:\n            break\n    return elements\n", "entry_point": "bubble_sort", "input": "[34, 22]", "output": "[22, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115988_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010328", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[[1, 2], [3, 4], [4]]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9609", "output": "{1, 9609, 3, 3203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010330", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[3, 4, 5, 6, 7, 3, 4, -1, -2, 5]", "output": "[3, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010331", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "10, 116.31599999999999", "output": "1163.1599999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010332", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 2, 2, 2, 2, 1]", "output": "[1, 4, 4, 4, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010333", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'2.525.0'", "output": "'2.524.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010334", "code": "def extract_version(input_string):\n    start_index = input_string.find('\"') + 1\n    end_index = input_string.find('\"', start_index)\n    if start_index != -1 and end_index != -1:\n        return input_string[start_index:end_index]\n    else:\n        return None\n", "entry_point": "extract_version", "input": "'version = \"0.3.0+d563e17\"'", "output": "'0.3.0+d563e17'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48779_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010335", "code": "def find_subarray_sum_indices(nums):\n    cumulative_sums = {0: -1}\n    cumulative_sum = 0\n    result = []\n    for index, num in enumerate(nums):\n        cumulative_sum += num\n        if cumulative_sum in cumulative_sums:\n            result = [cumulative_sums[cumulative_sum] + 1, index]\n            return result\n        cumulative_sums[cumulative_sum] = index\n    return result\n", "entry_point": "find_subarray_sum_indices", "input": "[1, 2, 0]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56814_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010336", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'youlyo'", "output": "{'youlyo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010337", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'1234 5678 9012 3456 card'", "output": "'XXXX-XXXX-XXXX-XXXX card'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010338", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "1100000000.0", "output": "'0.11000000000000001 x 10^9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010339", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'RRRRRUU'", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010340", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7892", "output": "{1, 2, 4, 3946, 7892, 1973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7891", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010341", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "146, 1", "output": "146", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010342", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "-7340053, 1", "output": "-14680106", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010343", "code": "import ast\ndef extract_theme_colors(code_snippet):\n    # Parse the code snippet to extract _html_theme_colors dictionary\n    parsed_code = ast.parse(code_snippet)\n    html_theme_colors = {}\n    for node in ast.walk(parsed_code):\n        if isinstance(node, ast.Assign) and isinstance(node.targets[0], ast.Name) and node.targets[0].id == '_html_theme_colors':\n            html_theme_colors = ast.literal_eval(node.value)\n    # Format color names and values\n    formatted_colors = []\n    for color_name, color_value in html_theme_colors.items():\n        formatted_colors.append(f\"{color_name}: {color_value}\")\n    return '\\n'.join(formatted_colors)\n", "entry_point": "extract_theme_colors", "input": "'_html_theme_colors = {}'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129297_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010344", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010345", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "7", "output": "'Unknown-DataId'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010346", "code": "def sum_multiples_of_3_or_5(input_list):\n    multiples_set = set()\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12129_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010347", "code": "# Define the map_path_id function\ndef map_path_id(inner_path_id, view_path_id_map):\n    # Retrieve the mapping for the inner path ID from the view path ID map\n    mapped_path_id = view_path_id_map.get(inner_path_id, None)\n    return mapped_path_id\n", "entry_point": "map_path_id", "input": "5, {5: 200}", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130638_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010348", "code": "def remove_consecutive_duplicates(s: str) -> str:\n    results = []\n    for c in s:\n        if len(results) == 0 or results[-1] != c:\n            results.append(c)\n    return \"\".join(results)\n", "entry_point": "remove_consecutive_duplicates", "input": "'aaabbbcccdddeeefff'", "output": "'abcdef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101236_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010349", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "''", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010350", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "12131521", "output": "'VCode-12131521'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010351", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'This is number 2'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010352", "code": "import itertools\ndef generate_combinations(varTypes, regions):\n    return list(itertools.product(varTypes, regions))\n", "entry_point": "generate_combinations", "input": "['ws'], ['alaska']", "output": "[('ws', 'alaska')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80185_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010353", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(N, len(scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    average = top_scores_sum / num_students if num_students > 0 else 0.0\n    return average\n", "entry_point": "average_top_scores", "input": "[70, 70, 70], 3", "output": "70.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99565_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010354", "code": "def count_emojis(input_string):\n    emoji_count = {}\n    # Split the input string into individual emojis\n    emojis = input_string.split()\n    # Count the occurrences of each unique emoji\n    for emoji in emojis:\n        if emoji in emoji_count:\n            emoji_count[emoji] += 1\n        else:\n            emoji_count[emoji] = 1\n    return emoji_count\n", "entry_point": "count_emojis", "input": "'\u2728\u2728'", "output": "{'\u2728\u2728': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128683_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010355", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[15.0, 19.0, 20.0, 21.0, 22.0, 19.5, 19.5]", "output": "19.428571428571427", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010356", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'Career'", "output": "{'career': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010357", "code": "def fahrenheit_to_celsius(fahrenheit):\n    celsius = (5 * (fahrenheit - 32) / 9)\n    return celsius\n", "entry_point": "fahrenheit_to_celsius", "input": "99.8", "output": "37.666666666666664", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19191_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010358", "code": "def generate_default_names(num_topics, num_ranks):\n    default_names = {}\n    for i in range(1, num_topics + 1):\n        topic_name = f'topic_{i}'\n        rank_name = f'rank_{i % num_ranks + 1}'\n        default_names[topic_name] = rank_name\n    return default_names\n", "entry_point": "generate_default_names", "input": "2, 1", "output": "{'topic_1': 'rank_1', 'topic_2': 'rank_1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58006_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010359", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "18", "output": "18.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010360", "code": "from typing import List, Tuple, Any\ndef transform_tuples(tuples_list: List[Tuple[Any, Any]]) -> List[Tuple[Any, Any]]:\n    transformed_list = []\n    for tup in tuples_list:\n        if tup[0] is None and tup[1] is not None:\n            transformed_list.append((tup[1], tup[1]))\n        elif tup[0] is not None and tup[1] is None:\n            transformed_list.append((tup[0], tup[0]))\n        elif tup[0] is not None and tup[1] is not None:\n            transformed_list.append(tup)\n    return transformed_list\n", "entry_point": "transform_tuples", "input": "[(None, 1), (None, 2), (3, 4)]", "output": "[(1, 1), (2, 2), (3, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136514_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010361", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[1, 2, 3, -1]", "output": "[1, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010362", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "32", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010363", "code": "def evaluate_expression(tokens):\n    def precedence(op):\n        if op in ['*', '/']:\n            return 2\n        elif op in ['+', '-']:\n            return 1\n        else:\n            return 0\n    def apply_operation(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n        elif operator == '/':\n            return a // b\n    stack = []\n    operands = []\n    operators = []\n    for token in tokens:\n        if token.isdigit():\n            operands.append(int(token))\n        elif token in ['+', '-', '*', '/']:\n            while operators and precedence(operators[-1]) >= precedence(token):\n                operands.append(apply_operation(operands, operators.pop()))\n            operators.append(token)\n        elif token == '(':\n            operators.append(token)\n        elif token == ')':\n            while operators[-1] != '(':\n                operands.append(apply_operation(operands, operators.pop()))\n            operators.pop()\n    while operators:\n        operands.append(apply_operation(operands, operators.pop()))\n    return operands[0]\n", "entry_point": "evaluate_expression", "input": "['32', '*', '81', '+', '16']", "output": "2608", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30309_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010364", "code": "import math\ndef mint_pizza(slices_per_person, slices_per_pizza):\n    total_slices_needed = sum(slices_per_person)\n    min_pizzas = math.ceil(total_slices_needed / slices_per_pizza)\n    return min_pizzas\n", "entry_point": "mint_pizza", "input": "[20, 10, 10], 8", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149850_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010365", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "970", "output": "{1, 2, 194, 97, 5, 485, 970, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt969", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010366", "code": "def calculate_moving_average(nums, window_size):\n    moving_averages = []\n    window_sum = sum(nums[:window_size])\n    for i in range(len(nums) - window_size + 1):\n        if i > 0:\n            window_sum = window_sum - nums[i - 1] + nums[i + window_size - 1]\n        moving_averages.append(window_sum / window_size)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[10, 8, 9, 8, 11, 6, 0], 7", "output": "[7.428571428571429]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33324_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010367", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "804", "output": "{1, 2, 3, 804, 4, 6, 134, 67, 201, 268, 12, 402}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt803", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010368", "code": "from collections import Counter\ndef find_modes(data):\n    freq_dict = Counter(data)\n    max_freq = max(freq_dict.values())\n    modes = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[0, 0, 1, 1]", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75133_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010369", "code": "# Define the memory protection constants and their attributes\nMEMORY_PROTECTION_ATTRIBUTES = {\n    0x01: ['PAGE_NOACCESS'],\n    0x02: ['PAGE_READONLY'],\n    0x04: ['PAGE_READWRITE'],\n    0x08: ['PAGE_WRITECOPY'],\n    0x100: ['PAGE_GUARD'],\n    0x200: ['PAGE_NOCACHE'],\n    0x400: ['PAGE_WRITECOMBINE'],\n    0x40000000: ['PAGE_TARGETS_INVALID', 'PAGE_TARGETS_NO_UPDATE']\n}\ndef get_protection_attributes(memory_protection):\n    attributes = []\n    for constant, attr_list in MEMORY_PROTECTION_ATTRIBUTES.items():\n        if memory_protection & constant:\n            attributes.extend(attr_list)\n    return attributes\n", "entry_point": "get_protection_attributes", "input": "4", "output": "['PAGE_READWRITE']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63843_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010370", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[3, 1, 5, 3, 3, 2, 3, 3]", "output": "[3, 1, 5, 3, 3, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010371", "code": "# Constants for data types\nB3_UTF8 = \"UTF8\"\nB3_BOOL = \"BOOL\"\nB3_SVARINT = \"SVARINT\"\nB3_COMPOSITE_DICT = \"COMPOSITE_DICT\"\nB3_COMPOSITE_LIST = \"COMPOSITE_LIST\"\nB3_FLOAT64 = \"FLOAT64\"\ndef detect_data_type(obj):\n    if isinstance(obj, str):\n        return B3_UTF8\n    if obj is True or obj is False:\n        return B3_BOOL\n    if isinstance(obj, int):\n        return B3_SVARINT\n    if isinstance(obj, dict):\n        return B3_COMPOSITE_DICT\n    if isinstance(obj, list):\n        return B3_COMPOSITE_LIST\n    if isinstance(obj, float):\n        return B3_FLOAT64\n    if PY2 and isinstance(obj, long):\n        return B3_SVARINT\n    return \"Unknown\"\n", "entry_point": "detect_data_type", "input": "5.67", "output": "'FLOAT64'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49151_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010372", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5708", "output": "{1, 2, 4, 2854, 5708, 1427}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5707", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010373", "code": "def calculate_coverage_percentage(executed_lines):\n    total_lines = 10  # Total number of unique lines in the code snippet\n    executed_lines = set(executed_lines)  # Convert executed lines to a set for uniqueness\n    executed_unique_lines = len(executed_lines)  # Number of unique lines executed\n    coverage_percentage = int((executed_unique_lines / total_lines) * 100)  # Calculate coverage percentage\n    return coverage_percentage\n", "entry_point": "calculate_coverage_percentage", "input": "[0, 1, 2, 3, 4, 5]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8427_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010374", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'XXIPXPPIP', 'ME'", "output": "'Invalid status code: XXIPXPPIP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010375", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[35, 22, 33, 90, 22, 22, 33, 22, 35]", "output": "[22, 22, 22, 22, 33, 33, 35, 35, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010376", "code": "def find_swap_indices(A):\n    tmp_min = idx_min = float('inf')\n    tmp_max = idx_max = -float('inf')\n    for i, elem in enumerate(reversed(A)):\n        tmp_min = min(elem, tmp_min)\n        if elem > tmp_min:\n            idx_min = i\n    for i, elem in enumerate(A):\n        tmp_max = max(elem, tmp_max)\n        if elem < tmp_max:\n            idx_max = i\n    idx_min = len(A) - 1 - idx_min\n    return [-1] if idx_max == idx_min else [idx_min, idx_max]\n", "entry_point": "find_swap_indices", "input": "[1, 3, 5, 8, 4, 6, 7, 2, 9]", "output": "[1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96522_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010377", "code": "def find_special_pairs(numbers):\n    count = 0\n    delta = len(numbers) // 2\n    for i in range(len(numbers)):\n        bi = (i + delta) % len(numbers)\n        if numbers[i] == numbers[bi]:\n            count += 1\n    return count\n", "entry_point": "find_special_pairs", "input": "[1, 2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102357_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2815", "output": "{1, 563, 5, 2815}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1051", "output": "{1, 1051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010380", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'ppe'", "output": "'ppe_3109510499'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010381", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "392, 100", "output": "292", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010382", "code": "def simulate_file_system(commands):\n    file_system = {}\n    def create_file(file_path):\n        directory, file_name = file_path.rsplit('/', 1)\n        if directory not in file_system:\n            file_system[directory] = []\n        file_system[directory].append(file_name)\n    def delete_file(file_path):\n        directory, file_name = file_path.rsplit('/', 1)\n        if directory in file_system and file_name in file_system[directory]:\n            file_system[directory].remove(file_name)\n    def list_directory(directory_path):\n        if directory_path in file_system:\n            return sorted(file_system[directory_path])\n        return []\n    output = []\n    for command in commands:\n        action, path = command.split(' ', 1)\n        if action == 'CREATE':\n            create_file(path)\n        elif action == 'DELETE':\n            delete_file(path)\n        elif action == 'LIST':\n            output.extend(list_directory(path))\n    return output\n", "entry_point": "simulate_file_system", "input": "['LIST /nonexistent', 'LIST /empty']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146345_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010383", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "2, 14, 5", "output": "(2, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7822", "output": "{1, 2, 7822, 3911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010385", "code": "import math\ndef calculate_padding(size):\n    next_power_of_2 = 2 ** math.ceil(math.log2(size))\n    return next_power_of_2 - size\n", "entry_point": "calculate_padding", "input": "12", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17732_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010386", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'hllo'", "output": "'ollh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010387", "code": "def snapCurve(x):\n    y = 1 / (x + 1)\n    y = (1 - y) * 2\n    if y > 1:\n        return 1\n    else:\n        return y\n", "entry_point": "snapCurve", "input": "0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010388", "code": "def calculate_total_financial_data(financial_data):\n    total_financial_data = {}\n    for data in financial_data:\n        year = data[\"financial_year_id\"]\n        total = data[\"revenue\"] - data[\"expenses\"]\n        if year in total_financial_data:\n            total_financial_data[year] += total\n        else:\n            total_financial_data[year] = total\n    return total_financial_data\n", "entry_point": "calculate_total_financial_data", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104201_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010389", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'etetwiords ix'", "output": "{'etetwiords': 1, 'ix': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15367_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010390", "code": "from typing import List\ndef sum_double_duplicates(lst: List[int]) -> int:\n    element_freq = {}\n    total_sum = 0\n    # Count the frequency of each element in the list\n    for num in lst:\n        element_freq[num] = element_freq.get(num, 0) + 1\n    # Calculate the sum considering duplicates\n    for num, freq in element_freq.items():\n        if freq > 1:\n            total_sum += num * 2 * freq\n        else:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_double_duplicates", "input": "[5, 5, 10, 29]", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21856_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010391", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[63, 62, 26, 25, 25, 25, 24, 12, 63]", "output": "[12, 24, 25, 25, 25, 26, 62, 63, 63]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010392", "code": "def count_consecutive_doubles(s: str) -> int:\n    count = 0\n    for i in range(len(s) - 1):\n        if s[i] == s[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_consecutive_doubles", "input": "'aabbccddeeff'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35710_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010393", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(5, 31, 33), 5000", "output": "24893", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010394", "code": "from typing import List\ndef max_simultaneous_muse_tools(locations: List[int]) -> int:\n    max_tools = float('inf')  # Initialize to positive infinity for comparison\n    for tools in locations:\n        max_tools = min(max_tools, tools)\n    return max_tools\n", "entry_point": "max_simultaneous_muse_tools", "input": "[1, 100, 50]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65482_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010395", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8389", "output": "{1, 8389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010396", "code": "def extract_unique_architectures(architectures):\n    unique_architectures = set()\n    for arch in architectures:\n        unique_architectures.add(tuple(arch))\n    unique_architectures = [list(arch) for arch in sorted(unique_architectures)]\n    return unique_architectures\n", "entry_point": "extract_unique_architectures", "input": "[[], [50], [200, 100, 10], [200, 100, 10]]", "output": "[[], [50], [200, 100, 10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139723_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010397", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'cat.dog.bird.grapefapit.apricot'", "output": "'grapefapit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010398", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'tsih'", "output": "['tsih']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010399", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "29", "output": "[1, 1, 1, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010400", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8286", "output": "{1, 2, 3, 1381, 6, 2762, 4143, 8286}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "105", "output": "{1, 3, 35, 5, 7, 105, 15, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt104", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010402", "code": "def unique_sum(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "unique_sum", "input": "[1, 2, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140817_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5822", "output": "{1, 2, 71, 41, 142, 82, 5822, 2911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010404", "code": "def process_message(message):\n    # Extract the message type from the input message\n    message_type = message.strip('\"').split('\"')[0]\n    # Generate response based on the message type\n    if message_type == \"40\":\n        return \"Received message type 40\"\n    elif message_type == \"50\":\n        return \"Received message type 50\"\n    else:\n        return \"Unknown message type\"\n", "entry_point": "process_message", "input": "'\"39\"'", "output": "'Unknown message type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44223_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010405", "code": "def get_file_type(file_path):\n    file_extension = file_path[file_path.rfind(\".\"):].lower()\n    file_types = {\n        \".py\": \"Python file\",\n        \".txt\": \"Text file\",\n        \".jpg\": \"Image file\",\n        \".png\": \"Image file\",\n        \".mp3\": \"Audio file\",\n        \".mp4\": \"Video file\"\n    }\n    return file_types.get(file_extension, \"Unknown file type\")\n", "entry_point": "get_file_type", "input": "'photo.png'", "output": "'Image file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12387_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010406", "code": "def fibonacci_memoization(n):\n    memo = {}\n    def fibonacci_helper(n):\n        if n in memo:\n            return memo[n]\n        if n <= 1:\n            return n\n        else:\n            result = fibonacci_helper(n - 1) + fibonacci_helper(n - 2)\n            memo[n] = result\n            return result\n    return fibonacci_helper(n)\n", "entry_point": "fibonacci_memoization", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10382_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010407", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if isinstance(num, int) and is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[3, 3]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148587_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010408", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[7, 8, 8]", "output": "7.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010409", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "10, 0", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010410", "code": "def longest_zero_sum_subarray(arr):\n    sum_map = {0: -1}\n    max_len = 0\n    curr_sum = 0\n    for i, num in enumerate(arr):\n        curr_sum += num\n        if curr_sum in sum_map:\n            max_len = max(max_len, i - sum_map[curr_sum])\n        else:\n            sum_map[curr_sum] = i\n    return max_len\n", "entry_point": "longest_zero_sum_subarray", "input": "[1, -1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67035_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6366", "output": "{1, 2, 3, 1061, 6, 2122, 3183, 6366}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010412", "code": "def validate_parentheses(expression):\n    stack = []\n    for char in expression:\n        if char == \"(\":\n            stack.append(\"(\")\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                return \"Invalid expression\"\n    if not stack:\n        return \"Valid expression\"\n    else:\n        return \"Invalid expression\"\n", "entry_point": "validate_parentheses", "input": "'()'", "output": "'Valid expression'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77396_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010413", "code": "import re\ndef extract_unique_words(text):\n    unique_words = set()\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word = ''.join(char for char in word if char.isalnum())\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'HwRoLdRrW'", "output": "['hwroldrrw']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13022_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010414", "code": "import os\nimport importlib.util\ndef analyze_directory(directory_path):\n    python_files_count = 0\n    pymongo_missing = False\n    for root, _, files in os.walk(directory_path):\n        for file in files:\n            if file.endswith(\".py\"):\n                python_files_count += 1\n    try:\n        importlib.util.find_spec('pymongo')\n    except ImportError:\n        pymongo_missing = True\n    return python_files_count, pymongo_missing\n", "entry_point": "analyze_directory", "input": "'empty_dir'", "output": "(0, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129010_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010415", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'Hello, Wo!'", "output": "'Uryyb, Jb!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010416", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2946", "output": "{1, 2946, 3, 2, 1473, 6, 491, 982}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010417", "code": "def modify_p(str_line):\n    p = [1] * len(str_line)\n    mx = 1\n    id = 0\n    for i in range(len(str_line)):\n        if str_line[i].isdigit():\n            p[i] = max(p[i-1] + 1, mx)\n        else:\n            p[i] = 1\n    return p\n", "entry_point": "modify_p", "input": "'a1b234c5d'", "output": "[1, 2, 1, 2, 3, 4, 1, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149837_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010418", "code": "def count_bag_node_children(bag_nodes, bag_type):\n    \"\"\"\n    Count how many bags a bag of type bag_type can hold\n    \"\"\"\n    children_count = 0\n    for child, child_count in bag_nodes.get(bag_type, {}).items():\n        children_count += child_count + child_count * count_bag_node_children(\n            bag_nodes, child\n        )\n    return children_count\n", "entry_point": "count_bag_node_children", "input": "{}, 'non_existent_bag_type'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010419", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 7, 8, 7, 6, 8, 8, 8, 1]", "output": "[1, 343, 64, 343, 46, 64, 64, 64, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010420", "code": "def modify_template_name(template_name: str) -> str:\n    # Trim leading and trailing whitespace, convert to lowercase, and return\n    return template_name.strip().lower()\n", "entry_point": "modify_template_name", "input": "'   MyTeTMLate   '", "output": "'mytetmlate'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116239_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010421", "code": "import re\ndef extract_approvals(code_snippet):\n    approvals = []\n    approvals_pattern = r\"(\\w+)\\.approve\\('(.+)', (\\d+), {'from': (\\w+)}\"\n    approvals_matches = re.findall(approvals_pattern, code_snippet)\n    for match in approvals_matches:\n        token, recipient, amount, sender = match\n        approvals.append({\n            'token': token,\n            'recipient': recipient,\n            'amount': int(amount),\n            'sender': sender\n        })\n    return approvals\n", "entry_point": "extract_approvals", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108059_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010422", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'<KEY>'", "output": "'password123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010423", "code": "def get_enabled_runners(mock_runners):\n    enabled_runners = []\n    for runner in mock_runners:\n        if runner.get('enabled', False):\n            enabled_runners.append(runner.get('name', ''))\n    return enabled_runners\n", "entry_point": "get_enabled_runners", "input": "[{'enabled': False}, {'enabled': False}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_647_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010424", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'\"hello world\" example'", "output": "['hello world', 'example']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010425", "code": "import os\nimport codecs\ndef read_qa(qa_path):\n    if not os.path.exists(qa_path):\n        return set()\n    qa = set()\n    with codecs.open(qa_path, 'r', 'utf-8') as logfile:\n        for line in logfile:\n            phrase, _ = line.split('\\t', 1)  # Split only once to get the phrase\n            qa.add(phrase.strip())\n    return qa\n", "entry_point": "read_qa", "input": "'/path/to/non/existent/file.txt'", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44069_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010426", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'mydmmd', ' 1'", "output": "'mydmmd__1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010427", "code": "def calculate_matrix_sum(matrix, size):\n    total_sum = 0\n    for row in matrix:\n        total_sum += sum(row)\n    return total_sum\n", "entry_point": "calculate_matrix_sum", "input": "[[1, 2, 3, 4, 5, 6]], 6", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64447_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010428", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "53, 1", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010429", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[3]", "output": "[(3,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010430", "code": "def calculate_score(result):\n    if result == \"win\":\n        return 3\n    elif result == \"loss\":\n        return -1\n    elif result == \"draw\":\n        return 0\n    else:\n        return \"Invalid result\"\n", "entry_point": "calculate_score", "input": "'tie'", "output": "'Invalid result'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88276_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010431", "code": "def calculate_error_rates(acc_rate1, acc_rate5):\n    err_rate1 = 1 - acc_rate1\n    err_rate5 = 1 - acc_rate5\n    return err_rate1, err_rate5\n", "entry_point": "calculate_error_rates", "input": "-0.6500000000000001, 3.32", "output": "(1.6500000000000001, -2.32)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60400_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010432", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zyte'", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010433", "code": "def longest_common_subsequence(text1, text2):\n    m, n = len(text1), len(text2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m):\n        for j in range(n):\n            if text1[i] == text2[j]:\n                dp[i+1][j+1] = dp[i][j] + 1\n            else:\n                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "'a', 'ab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14619_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7174", "output": "{1, 2, 3587, 34, 7174, 422, 17, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7173", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010435", "code": "def calculate_weighted_average(values, weights):\n    if len(values) != len(weights):\n        raise ValueError(\"Values and weights lists must have the same length.\")\n    weighted_sum = sum(value * weight for value, weight in zip(values, weights))\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[10, 2], [2, 5]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65743_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010436", "code": "def generate_default_names(num_topics, num_ranks):\n    default_names = {}\n    for i in range(1, num_topics + 1):\n        topic_name = f'topic_{i}'\n        rank_name = f'rank_{i % num_ranks + 1}'\n        default_names[topic_name] = rank_name\n    return default_names\n", "entry_point": "generate_default_names", "input": "1, 1", "output": "{'topic_1': 'rank_1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58006_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010437", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[0, 1, 3, 2, 8, 2, 8, 7, 9]", "output": "[1, 3, 2, 8, 2, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010438", "code": "def generate_stairs(N):\n    stairs_ = []\n    for i in range(1, N + 1):\n        symb = \"#\" * i\n        empty = \" \" * (N - i)\n        stairs_.append(symb + empty)\n    return stairs_\n", "entry_point": "generate_stairs", "input": "5", "output": "['#    ', '##   ', '###  ', '#### ', '#####']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69687_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010439", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2921", "output": "{2921, 1, 127, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2920", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010440", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[5, 6]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010441", "code": "import ast\ndef count_unique_templates(script):\n    unique_templates = set()\n    # Parse the script to extract template names\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'render':\n            if len(node.args) >= 2 and isinstance(node.args[1], ast.Str):\n                unique_templates.add(node.args[1].s)\n    return len(unique_templates)\n", "entry_point": "count_unique_templates", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77384_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010442", "code": "def validate_ingredient_payload(payload: dict) -> bool:\n    if 'name' in payload and isinstance(payload['name'], str) and payload['name']:\n        return True\n    return False\n", "entry_point": "validate_ingredient_payload", "input": "{}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48856_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010443", "code": "from collections import Counter\nimport string\ndef find_first_repeated_word(input_str):\n    # Function to remove punctuation marks from the input string\n    def remove_punctuation(s):\n        return ''.join([char for char in s if char not in string.punctuation])\n    # Remove punctuation marks, convert to lowercase, and split the string into words\n    cleaned_str = remove_punctuation(input_str).casefold().split()\n    # Count the occurrences of each word\n    word_count = Counter(cleaned_str)\n    # Find the first repeated word\n    for word in cleaned_str:\n        if word_count[word] > 1:\n            return word\n    return None\n", "entry_point": "find_first_repeated_word", "input": "'The quick brown fox jumps over the lazy dog.'", "output": "'the'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52918_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010444", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "' th '", "output": "{'th': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010445", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1817", "output": "{1, 79, 1817, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010446", "code": "from typing import List\ndef max_non_adjacent_score(scores: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = exclude + score\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 3, 16, 4]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96838_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010447", "code": "def calculate_average(scores):\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[70, 74, 74, 74, 76]", "output": "74", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81649_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010448", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "8", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt33", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010449", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4199", "output": "{1, 323, 4199, 13, 17, 19, 247, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010450", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "6", "output": "'./prespawned/version6_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010451", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[4, 0, 2, 1, -1, 5, 5, 1, 1]", "output": "[4, 0, 2, 1, -1, 5, 5, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "399", "output": "{1, 3, 133, 7, 399, 19, 21, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010453", "code": "def calculate_unit_name_lengths(units):\n    unit_name_lengths = {}\n    for unit in units:\n        if unit:  # Check if the unit name is not an empty string\n            unit_name_lengths[unit] = len(unit)\n    return unit_name_lengths\n", "entry_point": "calculate_unit_name_lengths", "input": "['S', 'ATC Mobl', 'AA', 'ATC']", "output": "{'S': 1, 'ATC Mobl': 8, 'AA': 2, 'ATC': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31867_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010454", "code": "def find_highest_score(scores):\n    if not scores:\n        return None\n    highest_score = scores[0]\n    for score in scores[1:]:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[92, 85, 97]", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73697_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010455", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8893", "output": "{1, 8893}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010456", "code": "def validate_config(config):\n    for key, value in config.items():\n        if \"menu\" in value:\n            if len(value) > 1:\n                return False\n    return True\n", "entry_point": "validate_config", "input": "{'key1': 'value1', 'key2': 'm'}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128243_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010457", "code": "def calculate_similarity_score(str1, str2):\n    if len(str1) != len(str2):\n        raise ValueError(\"Input strings must have the same length\")\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            similarity_score += 1\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "'abcd', 'abcd'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105365_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010458", "code": "def calculate_score(accuracy):\n    if accuracy >= 0.92:\n        score = 10\n    elif accuracy >= 0.9:\n        score = 9\n    elif accuracy >= 0.85:\n        score = 8\n    elif accuracy >= 0.8:\n        score = 7\n    elif accuracy >= 0.75:\n        score = 6\n    elif accuracy >= 0.70:\n        score = 5\n    else:\n        score = 4\n    return score\n", "entry_point": "calculate_score", "input": "0.72", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22276_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010459", "code": "from typing import List, Optional\ndef find_most_frequent_integer(numbers: List[int]) -> Optional[int]:\n    if not numbers:\n        return None\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    most_frequent = min(frequency, key=lambda x: (-frequency[x], x))\n    return most_frequent\n", "entry_point": "find_most_frequent_integer", "input": "[3, 3, 3, 1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18121_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010460", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[100, 50, 30]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010461", "code": "def reduce_polymer(polymer):\n    stack = []\n    for unit in polymer:\n        if stack and unit.swapcase() == stack[-1]:\n            stack.pop()\n        else:\n            stack.append(unit)\n    return ''.join(stack)\n", "entry_point": "reduce_polymer", "input": "'DA'", "output": "'DA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51419_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010462", "code": "def count_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if char.isalpha():  # Consider only alphabetic characters\n            unique_chars.add(char.lower())  # Consider both uppercase and lowercase as distinct\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abcdefghijklm12345!@#'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44520_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010463", "code": "def final_value(S):\n    X = 0\n    for c in S:\n        if c == 'L':\n            X = 2 * X\n        if c == 'R':\n            X = 2 * X + 1\n        if c == 'U':\n            X //= 2\n    return X\n", "entry_point": "final_value", "input": "'LR'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33325_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010464", "code": "def countdown_sequence(n):\n    if n <= 0:\n        return []\n    else:\n        return [n] + countdown_sequence(n - 1) + countdown_sequence(n - 2)\n", "entry_point": "countdown_sequence", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94818_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010465", "code": "def count_students_above_threshold(scores, threshold):\n    left, right = 0, len(scores) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if scores[mid] <= threshold:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return len(scores) - left\n", "entry_point": "count_students_above_threshold", "input": "[60, 65, 75, 80], 70", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63232_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010466", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[1, 1, 1, 2, 3, 2, 2]", "output": "[2, 2, 2, 4, 6, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010467", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1534", "output": "{1, 2, 13, 118, 26, 59, 1534, 767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1533", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010468", "code": "def evaluate_expression(expression: str) -> int:\n    def evaluate_helper(tokens):\n        stack = []\n        for token in tokens:\n            if token == '(':\n                stack.append('(')\n            elif token == ')':\n                sub_expr = []\n                while stack[-1] != '(':\n                    sub_expr.insert(0, stack.pop())\n                stack.pop()  # Remove '('\n                stack.append(evaluate_stack(sub_expr))\n            else:\n                stack.append(token)\n        return evaluate_stack(stack)\n    def evaluate_stack(stack):\n        operators = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y}\n        res = int(stack.pop(0))\n        while stack:\n            operator = stack.pop(0)\n            operand = int(stack.pop(0))\n            res = operators[operator](res, operand)\n        return res\n    tokens = expression.replace('(', ' ( ').replace(')', ' ) ').split()\n    return evaluate_helper(tokens)\n", "entry_point": "evaluate_expression", "input": "'75'", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122820_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010469", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "11", "output": "143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010470", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4003", "output": "{1, 4003}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4002", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010471", "code": "from typing import List\ndef contains_duplicate(nums: List[int]) -> bool:\n    return len(nums) != len(set(nums))\n", "entry_point": "contains_duplicate", "input": "[1, 2, 3, 1]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64587_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010472", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[30, 29, 20, 20, 19, 15, 15, 15, 15], 7", "output": "[30, 29, 20, 20, 19, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010473", "code": "def getTotalPage(m, n):\n    page, remaining = divmod(m, n)\n    if remaining != 0:\n        return page + 1\n    else:\n        return page\n", "entry_point": "getTotalPage", "input": "8, 1", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50511_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010474", "code": "def find_restriction_sites(dna_sequence, pattern):\n    positions = []\n    pattern_length = len(pattern)\n    for i in range(len(dna_sequence) - pattern_length + 1):\n        if dna_sequence[i:i+pattern_length] == pattern:\n            positions.append(i)\n    return positions\n", "entry_point": "find_restriction_sites", "input": "'ATGCAT', 'AT'", "output": "[0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16370_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010475", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[10, 40]", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010476", "code": "def count_players(scores, target):\n    left, right = 0, len(scores) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if scores[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return len(scores) - left\n", "entry_point": "count_players", "input": "[1, 2, 3, 4, 5], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83762_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010477", "code": "def find_example_idx(n, cum_sums, idx=0):\n    N = len(cum_sums)\n    stack = [[0, N-1]]\n    while stack:\n        start, end = stack.pop()\n        search_i = (start + end) // 2\n        if start < end:\n            if n < cum_sums[search_i]:\n                stack.append([start, search_i])\n            else:\n                stack.append([search_i + 1, end])\n        else:\n            if n < cum_sums[start]:\n                return idx + start\n            else:\n                return idx + start + 1\n", "entry_point": "find_example_idx", "input": "9, [0, 1, 2, 3, 4, 5, 6, 7, 8, 10]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89652_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010478", "code": "def LunarMonthDays(lunar_year, lunar_month):\n    # Define a dictionary to map lunar months to the number of days\n    lunar_month_days = {\n        1: 30, 2: 29, 3: 30, 4: 29, 5: 30, 6: 29, 7: 30, 8: 30, 9: 29, 10: 30, 11: 29, 12: 30\n    }\n    # Check if the lunar month is within the valid range\n    if lunar_month < 1 or lunar_month > 12:\n        return \"Invalid lunar month\"\n    # Return the number of days in the specified lunar month\n    return lunar_month_days[lunar_month]\n", "entry_point": "LunarMonthDays", "input": "2020, 2", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7829_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010479", "code": "def max_nested_parentheses_depth(input_str):\n    depth = 0\n    max_depth = 0\n    for char in input_str:\n        if char == '(':\n            depth += 1\n            max_depth = max(max_depth, depth)\n        elif char == ')':\n            depth -= 1\n    return max_depth\n", "entry_point": "max_nested_parentheses_depth", "input": "'()'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80515_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010480", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "45, 120", "output": "(225, 59)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010481", "code": "def longest_increasing_subsequence_length(nums):\n    if not nums:\n        return 0\n    dp = [1] * len(nums)\n    for i in range(1, len(nums)):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence_length", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34697_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010482", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[[5, 4], [3, 1]]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010483", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[2, 2, 4, 3, 2, 2, 0]", "output": "[2, 2, 4, 3, 2, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010484", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[2, 3]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4897", "output": "{1, 83, 59, 4897}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010486", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[37, 37, 37]", "output": "'37%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010487", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[20, 30, 40]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010488", "code": "def insert_position(scores, new_score):\n    position = 0\n    for score in scores:\n        if new_score >= score:\n            position += 1\n        else:\n            break\n    return position\n", "entry_point": "insert_position", "input": "[2], 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26274_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010489", "code": "import math\n# Constants\nRDISK = 17  # Encoder disk on the right rear wheel\nCSPD = 1  # Curve speed\nTDIST = 0.3  # Threshold distance for the distance sensor\n# Function to calculate distance traveled by the robot\ndef calculate_distance_traveled(initial_reading, final_reading):\n    # Calculate circumference of the wheel\n    radius = RDISK / (2 * math.pi)\n    circumference = 2 * math.pi * radius\n    # Calculate distance traveled\n    distance = (final_reading - initial_reading) * circumference\n    return distance\n", "entry_point": "calculate_distance_traveled", "input": "0, 46", "output": "782.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111364_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010490", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 2, 1, 3]", "output": "[0, 3, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010491", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[1, 0], [8, 1], [5, 2]]", "output": "[[1], [8], [5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010492", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 1, 0, 3, 2, 3]", "output": "[1, 2, 5, 5, 4, 4, 4, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010493", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[1, 2, 3, 4, 5, 6]", "output": "[1, 4, 2, 5, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010494", "code": "def count_unique_evens(numbers):\n    unique_evens = set()\n    for num in numbers:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_evens", "input": "[2, 4, 6]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30074_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010495", "code": "def generate_auth_token(github_repo, git_tag):\n    # Extract the first three characters of the GitHub repository name\n    repo_prefix = github_repo[:3]\n    # Extract the last three characters of the Git tag\n    tag_suffix = git_tag[-3:]\n    # Concatenate the extracted strings to form the authorization token\n    auth_token = repo_prefix + tag_suffix\n    return auth_token\n", "entry_point": "generate_auth_token", "input": "'mygit', 'version0.0'", "output": "'myg0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37072_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010496", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6019", "output": "{1, 6019, 13, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010497", "code": "def check_pairing(d_1, d_2):\n    values_1 = list(d_1.values())\n    values_2 = list(d_2.values())\n    for index, value in enumerate(values_1):\n        for index_2, value_2 in enumerate(values_2):\n            if value == value_2:\n                values_1[index] = -1\n                values_2[index_2] = -1\n                break\n        else:\n            return False\n    for index, value in enumerate(values_2):\n        if value != -1:\n            return False\n    return True\n", "entry_point": "check_pairing", "input": "{'a': 1, 'b': 2, 'c': 3}, {'x': 3, 'y': 1, 'z': 2}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104907_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1971", "output": "{1, 3, 27, 9, 73, 657, 1971, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010499", "code": "def process_event(event: str, values: list) -> str:\n    if event == \"click\":\n        return f\"Clicked with values: {values}\"\n    elif event == \"hover\":\n        return f\"Hovered with values: {values}\"\n    elif event == \"submit\":\n        return f\"Submitted with values: {values}\"\n    else:\n        return \"Unknown event\"\n", "entry_point": "process_event", "input": "'submit', [True, False]", "output": "'Submitted with values: [True, False]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96210_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010500", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'Doe, John'", "output": "[('Doe', 'John')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010501", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "[2], [-3], [-2], [3], [5], [6], [1, 1]", "output": "[2, -3, -2, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010502", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[81, 82], 2", "output": "81.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010503", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'05:45:00 PM'", "output": "'17:45:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010504", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 11, 12, 13, 14, 15, 16, 9]", "output": "(7, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010505", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 1, 0, 5, 2, 1, 4, -1]", "output": "[6, 1, 5, 7, 3, 5, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010506", "code": "from typing import List\nfrom datetime import datetime, timedelta\ndef generate_date_list(start_date: str, num_days: int) -> List[str]:\n    date_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days):\n        date_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return date_list\n", "entry_point": "generate_date_list", "input": "'2023-01-01', 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94343_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010507", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "11, 2", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010508", "code": "def filter_tasks(tasks, priority, status):\n    filtered_tasks = []\n    for task in tasks:\n        if task[\"priority\"] >= priority and task[\"status\"] == status:\n            filtered_tasks.append(task[\"name\"])\n    return filtered_tasks\n", "entry_point": "filter_tasks", "input": "[], 5, 'completed'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147511_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010509", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7901", "output": "{1, 7901}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9813", "output": "{1, 3, 9813, 3271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010511", "code": "def validate_rpc_response(response):\n    if all(key in response for key in [\"id\", \"jsonrpc\", \"result\"]):\n        if isinstance(response[\"id\"], int) and response[\"jsonrpc\"] == \"2.0\":\n            return True\n    return False\n", "entry_point": "validate_rpc_response", "input": "{'jsonrpc': '2.0', 'result': {}}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107063_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010512", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[108, 107, 108, 72, 109, 111, 100, 72, 109]", "output": "'lklHmodHm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010513", "code": "def calculate_factorial(n):\n    if n < 0:\n        return 0\n    factorial = 1\n    for i in range(1, n + 1):\n        factorial *= i\n    return factorial\n", "entry_point": "calculate_factorial", "input": "10", "output": "3628800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130862_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010514", "code": "import math\ndef calculate_line_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i][\"x\"], points[i][\"y\"]\n        x2, y2 = points[i + 1][\"x\"], points[i + 1][\"y\"]\n        distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n        total_length += distance\n    return total_length\n", "entry_point": "calculate_line_length", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142229_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010515", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "74, 'some_directory/add_coluo_instruments.py'", "output": "'74_add_coluo_instruments'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3706", "output": "{1, 2, 34, 218, 109, 17, 3706, 1853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3705", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010517", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[2, 2, 3, 3, 7, 0]", "output": "[7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010518", "code": "def calculate_sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum_multiples", "input": "9", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15183_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010519", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "0, 8, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010520", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[5, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010521", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 1, 2, 2, 3, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010522", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'gglea', 10", "output": "'gglea_high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010523", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[8, 9, 8, 4, 9]", "output": "[8, 10, 10, 7, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010524", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'CCnfCliiC.some_other_configuration'", "output": "'CCnfCliiC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010525", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(3, -2, 1, 2, 3, 0, 0, -2)", "output": "'3.-2.1.2.3.0.0.-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010526", "code": "def filter_issues(issues, priority, status):\n    filtered_titles = []\n    for issue in issues:\n        if issue['priority'] == priority and issue['status'] == status:\n            filtered_titles.append(issue['title'])\n    return filtered_titles\n", "entry_point": "filter_issues", "input": "[], 'high', 'open'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80255_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010527", "code": "from typing import Union, Dict, Any, List\ndef to_c_envp(source: Union[Dict[str, str], Any]) -> List[str]:\n    if isinstance(source, dict):\n        return [\"%s=%s\" % (key, value) for key, value in source.items()]\n    else:\n        return source\n", "entry_point": "to_c_envp", "input": "{'VAR1': 'VAL1', 'VAR2': 'VAL2'}", "output": "['VAR1=VAL1', 'VAR2=VAL2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42352_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010528", "code": "import os\ndef should_write_binary(file_path: str) -> bool:\n    file_name, file_extension = os.path.splitext(file_path)\n    return file_extension == \".bin\"\n", "entry_point": "should_write_binary", "input": "'file.txt'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124717_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010529", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[100, 90, 80, 70, 60, 60, 50]", "output": "[1, 2, 3, 4, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010530", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[1, 0, 1, 2, 4, 1, 0]", "output": "[1, 1, 2, 4, 8, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010531", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2487", "output": "{1, 3, 829, 2487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010532", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8431", "output": "{1, 8431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010533", "code": "def sum_of_min_values(matrix):\n    total_min_sum = 0\n    for row in matrix:\n        min_value = min(row)\n        total_min_sum += min_value\n    return total_min_sum\n", "entry_point": "sum_of_min_values", "input": "[[2]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147997_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010534", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "9", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010535", "code": "from typing import List\ndef maxProfit(prices: List[int]) -> int:\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[3, 5, 8, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135965_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010536", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[4, 10, 40, 49, 50]", "output": "'4, 10, 40, 49, 50'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9137", "output": "{1, 9137}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1789", "output": "{1, 1789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010539", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "-1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010540", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'', '/css/style.css'", "output": "'/css/style.css'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6407", "output": "{1, 43, 149, 6407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010542", "code": "def rotate_matrix_clockwise(matrix):\n    # Transpose the matrix\n    transposed_matrix = [[matrix[j][i] for j in range(len(matrix))] for i in range(len(matrix))]\n    # Reverse each row to get the rotated matrix\n    rotated_matrix = [row[::-1] for row in transposed_matrix]\n    return rotated_matrix\n", "entry_point": "rotate_matrix_clockwise", "input": "[[6, 4, 5], [7, 8, 8], [7, 8, 8]]", "output": "[[7, 7, 6], [8, 8, 4], [8, 8, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010543", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "981", "output": "189", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2065", "output": "{1, 35, 5, 7, 295, 2065, 59, 413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010545", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'John.Doe'", "output": "'johndoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010546", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[93, 92, 85, 80, 75, 70]", "output": "[93, 92, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010547", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 7, 2, 1, 2, 2, 7]", "output": "[7, 8, 4, 4, 6, 7, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010548", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4683", "output": "{1, 3, 7, 4683, 21, 1561, 669, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010549", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'thmtthmmtmhm//', 'api/dat/'", "output": "'thmtthmmtmhm//api/dat/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010550", "code": "def count_unique_subsets(nums):\n    total_subsets = 0\n    n = len(nums)\n    for i in range(1, 2**n):\n        subset = [nums[j] for j in range(n) if (i >> j) & 1]\n        if subset:  # Ensure subset is not empty\n            total_subsets += 1\n    return total_subsets\n", "entry_point": "count_unique_subsets", "input": "[1, 2, 3, 4, 5, 6]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53823_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010551", "code": "def rain_water_trapped(arr):\n    n = len(arr)\n    left_max = [0] * n\n    right_max = [0] * n\n    water_trapped = 0\n    left_max[0] = arr[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], arr[i])\n    right_max[n - 1] = arr[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], arr[i])\n    for i in range(n):\n        water_trapped += max(0, min(left_max[i], right_max[i]) - arr[i])\n    return water_trapped\n", "entry_point": "rain_water_trapped", "input": "[1, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27488_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4684", "output": "{1, 2, 4, 2342, 4684, 1171}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4683", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3351", "output": "{1, 3, 1117, 3351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5721", "output": "{5721, 1, 3, 1907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010555", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[100, 99, 50]", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135338_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010556", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9123", "output": "{3, 1, 9123, 3041}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010557", "code": "def control_flow_replica(x):\n    if x < 0:\n        if x < -10:\n            return x * 2\n        else:\n            return x * 3\n    else:\n        if x > 10:\n            return x * 4\n        else:\n            return x * 5\n", "entry_point": "control_flow_replica", "input": "4", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17276_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010558", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "7", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010559", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[0, 0, 1, 2, 3, 3, 5, 5]", "output": "{0: 2, 1: 1, 2: 1, 3: 2, 5: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010560", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7834", "output": "{1, 7834, 2, 3917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010561", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'abcde'", "output": "(1, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010562", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[5, 5, 5, 4, 4, 4, 4, 4, 3]", "output": "4.222222222222222", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "869", "output": "{1, 11, 869, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010564", "code": "def pack_subtasks(subtasks, bin_capacity):\n    bins = 0\n    current_bin_weight = 0\n    remaining_capacity = bin_capacity\n    for subtask in subtasks:\n        if subtask > bin_capacity:\n            bins += 1\n            current_bin_weight = 0\n            remaining_capacity = bin_capacity\n        if subtask <= remaining_capacity:\n            current_bin_weight += subtask\n            remaining_capacity -= subtask\n        else:\n            bins += 1\n            current_bin_weight = subtask\n            remaining_capacity = bin_capacity - subtask\n    if current_bin_weight > 0:\n        bins += 1\n    return bins\n", "entry_point": "pack_subtasks", "input": "[5], 10", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28590_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010565", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "18, 5, 15", "output": "6402373705728000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010566", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "28", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2309", "output": "{1, 2309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010568", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[5, 3, 1, 3, 5, 4, 4, 5, 3]", "output": "[5, 8, 9, 12, 17, 21, 25, 30, 33]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010569", "code": "import math\n# Constants\nRDISK = 17  # Encoder disk on the right rear wheel\nCSPD = 1  # Curve speed\nTDIST = 0.3  # Threshold distance for the distance sensor\n# Function to calculate distance traveled by the robot\ndef calculate_distance_traveled(initial_reading, final_reading):\n    # Calculate circumference of the wheel\n    radius = RDISK / (2 * math.pi)\n    circumference = 2 * math.pi * radius\n    # Calculate distance traveled\n    distance = (final_reading - initial_reading) * circumference\n    return distance\n", "entry_point": "calculate_distance_traveled", "input": "0, 55", "output": "935.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111364_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010570", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010571", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '13:15:00'", "output": "4500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010572", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'12.52.5'", "output": "'12.51.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010573", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "33", "output": "{11, 1, 3, 33}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt32", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010574", "code": "from functools import reduce\ndef calculate_ribbon_length(dimensions):\n    total_ribbon_length = 0\n    for box in dimensions:\n        l, w, h = box\n        # Calculate the smallest perimeter\n        smallest_perimeter = 2 * l + 2 * w + 2 * h - 2 * max(l, w, h)\n        # Calculate the volume\n        volume = l * w * h\n        # Calculate the ribbon required for the box\n        ribbon_length = smallest_perimeter + volume\n        total_ribbon_length += ribbon_length\n    return total_ribbon_length\n", "entry_point": "calculate_ribbon_length", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50392_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8315", "output": "{1, 8315, 5, 1663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8314", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010576", "code": "from typing import List\ndef process_strings(ss: List[str]) -> int:\n    valid = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}\n    signs = {'+', '-'}\n    ns = []\n    if len(ss) == 0:\n        return 0\n    for v in ss:\n        if v in valid:\n            ns.append(v)\n            continue\n        if v in signs and not len(ns):\n            ns.append(v)\n            continue\n        break\n    if not ns or (len(ns) == 1 and ns[0] in signs):\n        return 0\n    r = int(''.join(ns))\n    if r < -2147483648:\n        return -2147483648\n    return r\n", "entry_point": "process_strings", "input": "['3']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44054_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010577", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "4", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010578", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[6, 7, 9]", "output": "378", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1767", "output": "{1, 3, 1767, 589, 19, 57, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010580", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'10:20:30'", "output": "37230", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010581", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "460, {}", "output": "'460-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010582", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7281", "output": "{1, 3, 9, 809, 7281, 2427}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010583", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[3, 3, 0, 0, 0, 2, 1, 3]", "output": "[3, 3, 0, 0, 0, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010584", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'121121231'", "output": "'12112123102485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010585", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[6, 4, 1, 4, 5, 4, 3]", "output": "[36, 16, 1, 16, 125, 16, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010586", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "96", "output": "'96'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010587", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'item1,'", "output": "['item1', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010588", "code": "def count_special_pairs(n):\n    count = 0\n    for x in range(1, n + 1):\n        for y in range(x, n + 1, x):\n            if (n - (x + y)) % y == 0:\n                count += 1\n    return count\n", "entry_point": "count_special_pairs", "input": "7", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118433_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010589", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4688", "output": "{1, 2, 4, 293, 2344, 8, 586, 4688, 16, 1172}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4687", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010590", "code": "from typing import List\ndef generate_directories(base_dir: str) -> List[str]:\n    subdirectories = [\"evaluation\", \"jobinfo\"]\n    return [f\"{base_dir}/{subdir}\" for subdir in subdirectories]\n", "entry_point": "generate_directories", "input": "'/opt/ml'", "output": "['/opt/ml/evaluation', '/opt/ml/jobinfo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93666_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010591", "code": "import ast\ndef calculate_execution_time(script):\n    # Parse the script to an Abstract Syntax Tree (AST)\n    tree = ast.parse(script)\n    # Initialize variables to store time taken for each operation\n    read_time = 0\n    sleep_time = 0\n    write_time = 0\n    # Traverse the AST to identify time-consuming operations\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call):\n            if isinstance(node.func, ast.Attribute) and node.func.attr == 'open':\n                read_time += 1  # Assuming reading takes 1 second\n            elif isinstance(node.func, ast.Attribute) and node.func.attr == 'sleep':\n                sleep_time += 8  # Waiting for 8 seconds\n            elif isinstance(node.func, ast.Attribute) and node.func.attr == 'write':\n                write_time += 1  # Assuming writing takes 1 second\n    # Calculate total execution time\n    total_time = read_time + sleep_time + write_time\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90118_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010592", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "10", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010593", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "15", "output": "1240", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010594", "code": "def jaro_distance(str1, str2):\n    if not str1 and not str2:\n        return 0.0\n    len_str1 = len(str1)\n    len_str2 = len(str2)\n    if len_str1 == 0 or len_str2 == 0:\n        return 0.0\n    max_dist = max(len_str1, len_str2) // 2 - 1\n    matches = 0\n    transpositions = 0\n    matched_indices = set()\n    for i in range(len_str1):\n        start = max(0, i - max_dist)\n        end = min(i + max_dist + 1, len_str2)\n        for j in range(start, end):\n            if str1[i] == str2[j] and j not in matched_indices:\n                matches += 1\n                matched_indices.add(j)\n                break\n    if matches == 0:\n        return 0.0\n    for i, j in zip(range(len_str1), range(len_str2)):\n        if str1[i] != str2[j]:\n            transpositions += 1\n    transpositions //= 2\n    return (matches / len_str1 + matches / len_str2 + (matches - transpositions) / matches) / 3\n", "entry_point": "jaro_distance", "input": "'', ''", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22884_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010595", "code": "from typing import List\ndef smallestRangeDifference(A: List[int], K: int) -> int:\n    A.sort()\n    ans = A[-1] - A[0]\n    for x, y in zip(A, A[1:]):\n        ans = min(ans, max(A[-1]-K, x+K) - min(A[0]+K, y-K))\n    return ans\n", "entry_point": "smallestRangeDifference", "input": "[1, 4, 6], 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93507_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010596", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5018", "output": "{1, 2, 386, 26, 193, 13, 2509, 5018}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5017", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010597", "code": "def unique_counts(input_list):\n    # Creating an empty dictionary to store unique items and their counts\n    counts_dict = {}\n    # Bubble sort implementation (source: https://realpython.com/sorting-algorithms-python/)\n    def bubble_sort(arr):\n        n = len(arr)\n        for i in range(n):\n            for j in range(0, n-i-1):\n                if arr[j] > arr[j+1]:\n                    arr[j], arr[j+1] = arr[j+1], arr[j]\n    # Sorting the input list using bubble sort\n    sorted_list = input_list.copy()  # Create a copy to preserve the original list\n    bubble_sort(sorted_list)\n    # Counting unique items and their occurrences\n    current_item = None\n    count = 0\n    for item in sorted_list:\n        if item != current_item:\n            if current_item is not None:\n                counts_dict[current_item] = count\n            current_item = item\n            count = 1\n        else:\n            count += 1\n    counts_dict[current_item] = count  # Add count for the last item\n    return counts_dict\n", "entry_point": "unique_counts", "input": "['A', 'A', 'A', 'B', 'C']", "output": "{'A': 3, 'B': 1, 'C': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146010_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4892", "output": "{1, 2, 4, 1223, 2446, 4892}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4891", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7677", "output": "{1, 3, 9, 853, 7677, 2559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010600", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4399", "output": "{1, 83, 53, 4399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7569", "output": "{1, 3, 261, 9, 841, 7569, 87, 2523, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010602", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[3, 3, 5, 2, 5, 2]", "output": "[3, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010603", "code": "def sum_words_with_a(words):\n    total_sum = 0\n    for word in words:\n        if 'a' in word.lower():\n            total_sum += len(word)\n    return total_sum\n", "entry_point": "sum_words_with_a", "input": "['apple', 'banana', 'grape', 'cat', 'strawberry', 'mango']", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3105_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010604", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'characterthshorto'", "output": "'characterthshorto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010605", "code": "mappings = {\n    \"event1\": \"action1\",\n    \"event2\": \"action2\",\n    \"event3\": \"action3\"\n}\ndef process_event(event):\n    return mappings.get(event, 'No action found')\n", "entry_point": "process_event", "input": "'event2'", "output": "'action2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108152_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010606", "code": "def generate_kernel_code(device_params: dict, template: str) -> str:\n    # Find the placeholder in the template\n    placeholder = '${device_params.max_total_local_size}'\n    # Replace the placeholder with the actual value\n    kernel_code = template.replace(placeholder, str(device_params.get('max_total_local_size', 0)))\n    return kernel_code\n", "entry_point": "generate_kernel_code", "input": "{}, '${device_pvoidxcal_size};'", "output": "'${device_pvoidxcal_size};'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14881_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010607", "code": "def calculate_circle_area(radius):\n    # Define a constant for pi\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "2.0", "output": "12.56636", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78790_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010608", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'10:01:30AM'", "output": "'10:01:30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010609", "code": "def simulate_code_behavior(obj):\n    if len(obj) < 8:\n        return 'Invalid input: obj should have at least 8 elements'\n    if obj[2] <= 2:\n        if obj[3] <= 2:\n            return 'False'\n        elif obj[3] > 2:\n            if obj[7] <= 0:\n                return 'False'\n            elif obj[7] > 0:\n                return 'True'\n    elif obj[2] > 2:\n        return 'True'\n    return 'True'\n", "entry_point": "simulate_code_behavior", "input": "[1, 2, 3, 1, 5, 7, 8, 9]", "output": "'True'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121797_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3638", "output": "{1, 2, 34, 107, 17, 3638, 214, 1819}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010611", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "4, 3, 153", "output": "12.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010612", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[0, 3, 3, 3, 3, 1]", "output": "{0: 1, 3: 4, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010613", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'8525,9,8'", "output": "[8525, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010614", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6971", "output": "{1, 6971}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010615", "code": "def extract_domain_name(url):\n    # Remove the protocol part of the URL\n    url = url.split(\"://\")[-1]\n    # Extract the domain name by splitting at the first single forward slash\n    domain_name = url.split(\"/\")[0]\n    return domain_name\n", "entry_point": "extract_domain_name", "input": "'http://hhthtae'", "output": "'hhthtae'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96968_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010616", "code": "def count_trailing_zeros_in_factorial(n):\n    count = 0\n    i = 5\n    while n // i > 0:\n        count += n // i\n        i *= 5\n    return count\n", "entry_point": "count_trailing_zeros_in_factorial", "input": "20", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25829_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010617", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7861", "output": "{1, 1123, 7861, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010618", "code": "# Constants for data types\nB3_UTF8 = \"UTF8\"\nB3_BOOL = \"BOOL\"\nB3_SVARINT = \"SVARINT\"\nB3_COMPOSITE_DICT = \"COMPOSITE_DICT\"\nB3_COMPOSITE_LIST = \"COMPOSITE_LIST\"\nB3_FLOAT64 = \"FLOAT64\"\ndef detect_data_type(obj):\n    if isinstance(obj, str):\n        return B3_UTF8\n    if obj is True or obj is False:\n        return B3_BOOL\n    if isinstance(obj, int):\n        return B3_SVARINT\n    if isinstance(obj, dict):\n        return B3_COMPOSITE_DICT\n    if isinstance(obj, list):\n        return B3_COMPOSITE_LIST\n    if isinstance(obj, float):\n        return B3_FLOAT64\n    if PY2 and isinstance(obj, long):\n        return B3_SVARINT\n    return \"Unknown\"\n", "entry_point": "detect_data_type", "input": "[]", "output": "'COMPOSITE_LIST'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49151_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010619", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "64", "output": "'01:04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010620", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[2, 2, 4, 4, 6, 8, 8, 10]", "output": "(44, 8, 2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010621", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "10, 15, 20", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010622", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7073", "output": "{11, 1, 7073, 643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010623", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(targets=['value'], expr=7)", "output": "'value = 7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010624", "code": "def determine_cases(jac_case, hess_case, design_info):\n    if jac_case == \"skip\" and hess_case == \"skip\":\n        raise ValueError(\"Jacobian and Hessian cannot both be skipped.\")\n    cases = []\n    if jac_case == \"skip\":\n        cases.append(\"hessian\")\n    elif hess_case == \"skip\":\n        cases.append(\"jacobian\")\n    else:\n        cases.extend([\"jacobian\", \"hessian\", \"robust\"])\n        if design_info is not None:\n            if \"psu\" in design_info:\n                cases.append(\"cluster_robust\")\n            if {\"strata\", \"psu\", \"fpc\"}.issubset(design_info):\n                cases.append(\"strata_robust\")\n    return cases\n", "entry_point": "determine_cases", "input": "'skip', 'not_skip', None", "output": "['hessian']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7669_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010625", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[120, 15]", "output": "'2 minutes and 15 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010626", "code": "from typing import List\ndef longest_common_prefix(strings: List[str]) -> str:\n    if not strings:\n        return \"\"\n    prefix = strings[0]\n    for string in strings[1:]:\n        i = 0\n        while i < len(prefix) and i < len(string) and prefix[i] == string[i]:\n            i += 1\n        prefix = prefix[:i]\n        if not prefix:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "['flower', 'flowerpot', 'flowers']", "output": "'flower'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135664_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010627", "code": "import re\ndef analyze_version_pattern(version):\n    patterns = {\n        'NO_REPOSITORY_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_COMMITS_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_TAG_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_TAG_DIRTY_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'TAG_ON_HEAD_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+$'),\n        'TAG_ON_HEAD_DIRTY_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SNAPSHOT\\w+$'),\n        'TAG_NOT_ON_HEAD_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SHA\\w+$'),\n        'TAG_NOT_ON_HEAD_DIRTY_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SHA\\w+SNAPSHOT\\w+$')\n    }\n    for pattern_type, pattern in patterns.items():\n        if pattern.match(version):\n            return pattern_type\n    return \"Unknown\"\n", "entry_point": "analyze_version_pattern", "input": "'1.0.0SHA234'", "output": "'TAG_NOT_ON_HEAD_VERSION_PATTERN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39657_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010628", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hhellhelo'", "output": "{'hhellhelo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010629", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else sorted_scores\n    return sum(top_scores) / len(top_scores) if top_scores else 0\n", "entry_point": "average_top_scores", "input": "[95], 1", "output": "95.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125675_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010630", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[2, 3, 3, 2, 3]", "output": "[2, 4, 0, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010631", "code": "from typing import List, Tuple\ndef count_circle_intersections(circle_centers: List[Tuple[float, float]], radii: List[float]) -> int:\n    intersection_count = 0\n    n = len(circle_centers)\n    for i in range(n):\n        for j in range(i + 1, n):\n            center1, center2 = circle_centers[i], circle_centers[j]\n            distance = ((center1[0] - center2[0]) ** 2 + (center1[1] - center2[1]) ** 2) ** 0.5\n            if distance < radii[i] + radii[j]:\n                intersection_count += 1\n    return intersection_count\n", "entry_point": "count_circle_intersections", "input": "[], []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28351_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6526", "output": "{1, 2, 13, 502, 26, 251, 6526, 3263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010633", "code": "def replace_value(original_array, value_to_replace, new_value):\n    modified_array = [[new_value if element == value_to_replace else element for element in row] for row in original_array]\n    return modified_array\n", "entry_point": "replace_value", "input": "[], 0, 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148252_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010634", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[10, 5, 0, 0]", "output": "[15, 5, 0, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010635", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[72, 88, 87, 86, 70]", "output": "[88, 87, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010636", "code": "from typing import List\ndef find_min_abs_difference_pairs(arr: List[int]) -> List[List[int]]:\n    arr.sort()\n    min_diff = min(arr[i] - arr[i - 1] for i in range(1, len(arr)))\n    min_pairs = [[arr[i - 1], arr[i]] for i in range(1, len(arr)) if arr[i] - arr[i - 1] == min_diff]\n    return min_pairs\n", "entry_point": "find_min_abs_difference_pairs", "input": "[1, 2, 3, 4]", "output": "[[1, 2], [2, 3], [3, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128793_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010637", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[1, 2, 2, 3, 3], 4, 2", "output": "[1, 2, 4, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010638", "code": "import math\ndef calculate_quality_score(likelihood):\n    likelihood = min(float(likelihood), 1 - 1e-8)  # Restrict likelihood to be at most 1 - 1e-8\n    quality = -10 * math.log10(1 - likelihood)\n    return min(quality, 80)  # Ensure quality score does not exceed 80\n", "entry_point": "calculate_quality_score", "input": "0.98", "output": "16.989700043360184", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132420_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010639", "code": "def count_operation_type(operation_list, operation_type):\n    cktable = {-1: \"NON\", 0: \"KER\", 1: \"H2D\", 2: \"D2H\", 8: \"D2D\", 10: \"P2P\"}\n    count = 0\n    for op in operation_list:\n        if op == operation_type:\n            count += 1\n    return count\n", "entry_point": "count_operation_type", "input": "[0, 2, 8, 10], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88938_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010640", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    # Use regular expression to extract words while ignoring non-alphanumeric characters\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'Hello world! Python. Hello World?'", "output": "{'hello': 2, 'world': 2, 'python': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115848_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010641", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[3, 1, 2, 3, 0, 2, 6, 0]", "output": "[3, 4, 6, 9, 9, 11, 17, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010642", "code": "from typing import List\ndef filter_by_percentage(input_list: List[int], percentage: float) -> List[int]:\n    if not input_list:\n        return []\n    max_value = max(input_list)\n    threshold = max_value * (percentage / 100)\n    filtered_list = [num for num in input_list if num >= threshold]\n    return filtered_list\n", "entry_point": "filter_by_percentage", "input": "[38, 40, 40, 40, 50], 80", "output": "[40, 40, 40, 50]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19265_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010643", "code": "def count_emojis(input_string):\n    emoji_count = {}\n    # Split the input string into individual emojis\n    emojis = input_string.split()\n    # Count the occurrences of each unique emoji\n    for emoji in emojis:\n        if emoji in emoji_count:\n            emoji_count[emoji] += 1\n        else:\n            emoji_count[emoji] = 1\n    return emoji_count\n", "entry_point": "count_emojis", "input": "'\ud83c\udf1f\ud83c\udf1f\u2728\u2728\ud83d\ude34'", "output": "{'\ud83c\udf1f\ud83c\udf1f\u2728\u2728\ud83d\ude34': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128683_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010644", "code": "def max_distance(red_points, blue_points):\n    max_sum = 0\n    for red in red_points:\n        for blue in blue_points:\n            distance = abs(red - blue)\n            max_sum = max(max_sum, distance)\n    return max_sum\n", "entry_point": "max_distance", "input": "[-5], [6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25133_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010645", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9667", "output": "{1, 9667, 1381, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010646", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6295", "output": "{1, 1259, 5, 6295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010647", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[5, 7, 19, 23]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125172_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010648", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[2, 7, 2, 7, 7, 7, 2]", "output": "[2, 8, 4, 10, 11, 12, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010649", "code": "from typing import Optional\ndef time_spec_to_seconds(spec: str) -> Optional[int]:\n    time_units = {'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1}\n    components = []\n    current_component = ''\n    for char in spec:\n        if char.isnumeric():\n            current_component += char\n        elif char in time_units:\n            if current_component:\n                components.append((int(current_component), char))\n                current_component = ''\n        else:\n            current_component = ''  # Reset if delimiter other than time unit encountered\n    if current_component:\n        components.append((int(current_component), 's'))  # Assume seconds if no unit specified\n    total_seconds = 0\n    last_unit_index = -1\n    for value, unit in components:\n        unit_index = 'wdhms'.index(unit)\n        if unit_index < last_unit_index:\n            return None  # Out of order, return None\n        total_seconds += value * time_units[unit]\n        last_unit_index = unit_index\n    return total_seconds\n", "entry_point": "time_spec_to_seconds", "input": "'1w4d15h11s'", "output": "1004411", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65809_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010650", "code": "def compress_text(text: str) -> str:\n    if not text:\n        return \"\"\n    compressed_text = \"\"\n    current_char = text[0]\n    char_count = 1\n    for i in range(1, len(text)):\n        if text[i] == current_char:\n            char_count += 1\n        else:\n            compressed_text += current_char + str(char_count)\n            current_char = text[i]\n            char_count = 1\n    compressed_text += current_char + str(char_count)\n    return compressed_text\n", "entry_point": "compress_text", "input": "'hello'", "output": "'h1e1l2o1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148970_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010651", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "13", "output": "549", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010652", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    total = sum(scores)\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[88, 89, 88, 87, 90, 88, 86, 89, 89]", "output": "88.22222222222223", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45427_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010653", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "70, 65", "output": "135", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010654", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'eilfifilffileilff'", "output": "'eilfifilffileilff_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010655", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_num = 0\n    for num in nums:\n        single_num ^= num\n    return single_num\n", "entry_point": "find_single_number", "input": "[5, 5, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121855_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010656", "code": "from typing import List, Dict\ndef filter_dicts_by_key(input_list: List[Dict], key_to_check: str) -> List[Dict]:\n    output_list = []\n    for dictionary in input_list:\n        if key_to_check in dictionary:\n            output_list.append(dictionary)\n    return output_list\n", "entry_point": "filter_dicts_by_key", "input": "[], 'some_key'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132802_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010657", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[0, 1, 3, 2, -2, -2, 2, 0, 8]", "output": "[-2, -2, 0, 0, 1, 2, 2, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010658", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "1", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010659", "code": "def count_occurrences(input_data):\n    occurrences = {}\n    for line in input_data:\n        xID, jobID, sOccur, timestamp = line.split('\\t')\n        occurrences[sOccur] = occurrences.get(sOccur, 0) + 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124808_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010660", "code": "def length_of_longest_substring(s):\n    char_index_map = {}\n    start = 0\n    max_length = 0\n    for end in range(len(s)):\n        if s[end] in char_index_map and char_index_map[s[end]] >= start:\n            start = char_index_map[s[end]] + 1\n        max_length = max(max_length, end - start + 1)\n        char_index_map[s[end]] = end\n    return max_length\n", "entry_point": "length_of_longest_substring", "input": "'a'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22531_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010661", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010662", "code": "def obscure_phone(phone_number, format_type):\n    number = ''.join(filter(str.isdigit, phone_number))[-4:]\n    obscured_number = ''\n    for char in phone_number[:-4]:\n        if char.isdigit():\n            obscured_number += '*'\n        else:\n            obscured_number += char\n    if format_type == 'E164':\n        return '+' + '*' * (len(phone_number) - 4) + number\n    elif format_type == 'INTERNATIONAL':\n        return '+*' + ' ***-***-' + '*' * len(number) + number\n    elif format_type == 'NATIONAL':\n        return '(***) ***-' + '*' * len(number) + number\n    elif format_type == 'RFC3966':\n        return 'tel:+*' + '-***-***-' + '*' * len(number) + number\n", "entry_point": "obscure_phone", "input": "'(555) 555-1234', 'NATIONAL'", "output": "'(***) ***-****1234'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010663", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'.2.1.42.1.2.01', '1.51101'", "output": "'.2.1.42.1.2.01 to 1.51101'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010664", "code": "def longest_non_decreasing_substring(s):\n    substring = s[0]\n    length = 1\n    bestsubstring = substring\n    bestlength = length\n    for num in range(len(s)-1):\n        if s[num] <= s[num+1]:\n            substring += s[num+1]\n            length += 1\n            if length > bestlength:\n                bestsubstring = substring\n                bestlength = length\n        else:\n            substring = s[num+1]\n            length = 1\n    return bestsubstring\n", "entry_point": "longest_non_decreasing_substring", "input": "'aeb'", "output": "'ae'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21049_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010665", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'mil.'", "output": "[('mil.', 'milion')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010666", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1983", "output": "{1, 3, 661, 1983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010667", "code": "def extract_config_info(config_str):\n    parts = config_str.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "extract_config_info", "input": "'waldur_openstac.waldur_openstac'", "output": "('waldur_openstac', 'waldur_openstac')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24681_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010668", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "'hello'", "output": "{'str': 'hello'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010669", "code": "import collections\ndef is_bipartite(graph):\n    N = len(graph)\n    q = collections.deque([])\n    color = {}\n    for node in range(1, N+1):\n        if node not in color:\n            color[node] = 0\n            q.append(node)\n            while q:\n                cur = q.popleft()\n                for nei in graph[cur]:\n                    if nei in color and color[nei] == color[cur]:\n                        return False\n                    if nei not in color:\n                        color[nei] = 1 - color[cur]\n                        q.append(nei)\n    return True\n", "entry_point": "is_bipartite", "input": "{1: [3, 4], 2: [3, 4], 3: [1, 2], 4: [1, 2]}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56505_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010670", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https0x150_150x150'", "output": "'https0x150'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010671", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "60, 30, 2", "output": "3600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010672", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[7, 2, 5, 11, 4, 1, 10], 6", "output": "[[7, 2, 5, 11, 4, 1], [10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010673", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "-4, 1", "output": "-4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010674", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[4, 2, 5, 3, 1, 2, 2, 3]", "output": "[2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010675", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[95, 95, 95, 90]", "output": "[95, 95, 95]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010676", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'12:05:32AM'", "output": "'00:05:32'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010677", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[-1, 4, 4, 2, 3, 1, 2, 0, 2]", "output": "[-1, 3, 7, 9, 12, 13, 15, 15, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010678", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1113", "output": "{1, 3, 7, 371, 21, 53, 1113, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010679", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "5, 8", "output": "390625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt60", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "122", "output": "{1, 122, 2, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010681", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'unknownvisualiv'", "output": "\"Operation type 'unknownvisualiv' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010682", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JJoJ', 'DoSSmSth', 'MMariMarearar'", "output": "'JJoJ MMariMarearar DoSSmSth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010683", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 6)]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010684", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3659", "output": "'1 hour, and 59 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010685", "code": "def resample_time_series(data, season):\n    def seasons_resampler(months):\n        return [data[i] for i in range(len(data)) if i % 12 in months]\n    if season == \"winter\":\n        return seasons_resampler([11, 0, 1])  # December, January, February\n    elif season == \"spring\":\n        return seasons_resampler([2, 3, 4])  # March, April, May\n    elif season == \"summer\":\n        return seasons_resampler([5, 6, 7])  # June, July, August\n    elif season == \"autumn\":\n        return seasons_resampler([8, 9, 10])  # September, October, November\n    elif season == \"custom\":\n        # Implement custom resampling logic here\n        return None\n    elif season == \"yearly\":\n        return [sum(data[i:i+12]) for i in range(0, len(data), 12)]  # Resample to yearly values\n    else:\n        return \"Invalid season specified\"\n", "entry_point": "resample_time_series", "input": "[1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12], 'winter'", "output": "[1, 2, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58046_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010686", "code": "def process_commands(input_str):\n    running_total = 0\n    commands = input_str.split()\n    for command in commands:\n        op = command[0]\n        if len(command) > 1:\n            num = int(command[1:])\n        else:\n            num = 0\n        if op == 'A':\n            running_total += num\n        elif op == 'S':\n            running_total -= num\n        elif op == 'M':\n            running_total *= num\n        elif op == 'D' and num != 0:\n            running_total //= num\n        elif op == 'R':\n            running_total = 0\n    return running_total\n", "entry_point": "process_commands", "input": "'A5'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106417_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010687", "code": "def generate_track_description(track_name, track_type, data_files):\n    track_description = f\"track {track_name}\\n\"\n    track_description += f\"type={track_type}\\n\"\n    for data_file in data_files:\n        track_description += f\"bigDataUrl={data_file}\\n\"\n    return track_description\n", "entry_point": "generate_track_description", "input": "'Gene', 'wiiggle', []", "output": "'track Gene\\ntype=wiiggle\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124471_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010688", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[2, 2, 8, 0]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27882_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010689", "code": "def generate_telegram_url(api_token):\n    URL_BASE = 'https://api.telegram.org/file/bot'\n    complete_url = URL_BASE + api_token + '/'\n    return complete_url\n", "entry_point": "generate_telegram_url", "input": "'PPUPU'", "output": "'https://api.telegram.org/file/botPPUPU/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139134_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010690", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[92, 93, 93, 94, 95]", "output": "93.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105264_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4458", "output": "{1, 2, 3, 6, 743, 4458, 1486, 2229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4457", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010692", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "879", "output": "{1, 3, 293, 879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt878", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7081", "output": "{73, 1, 7081, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010694", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "7", "output": "128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010695", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5, 6]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt35", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010696", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[45, 45, 41, 36], 4", "output": "41.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010697", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(0, 3, -1, 5)", "output": "(5, 3, -1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010698", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[2, 8, 8, 10]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010699", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello, this is Thomas. rIyh'", "output": "'Thomas rIyh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010700", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[6, 5, 3, 6, 1, 8]", "output": "[6, 6, 5, 9, 5, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010701", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[0, 7, 6, 0, 2, 1, 2, 2]", "output": "[0, 8, 8, 3, 6, 6, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9743", "output": "{1, 9743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9742", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010703", "code": "def generate_matrix(n):\n    matriz = [[0 for _ in range(n)] for _ in range(n)]\n    for diagonal_principal in range(n):\n        matriz[diagonal_principal][diagonal_principal] = 2\n    for diagonal_secundaria in range(n):\n        matriz[diagonal_secundaria][n - 1 - diagonal_secundaria] = 3\n    for linha in range(n // 3, n - n // 3):\n        for coluna in range(n // 3, n - n // 3):\n            matriz[linha][coluna] = 1\n    return matriz\n", "entry_point": "generate_matrix", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23096_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010704", "code": "def uint256_list_to_int(l):\n    out = 0\n    for i in range(len(l)):\n        out += l[i] * 2 ** (32 * i)\n    return out\n", "entry_point": "uint256_list_to_int", "input": "[0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87317_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010705", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'is'", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010706", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[74, 74, 74, 67, 63, 63, 74, 74]", "output": "[75, 75, 75, 67, 65, 65, 75, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010707", "code": "from typing import List\ndef most_frequent_bases(dna_sequence: str) -> List[str]:\n    base_count = {}\n    # Count the occurrences of each base\n    for base in dna_sequence:\n        if base in base_count:\n            base_count[base] += 1\n        else:\n            base_count[base] = 1\n    max_count = max(base_count.values())\n    most_frequent_bases = [base for base, count in base_count.items() if count == max_count]\n    return sorted(most_frequent_bases)\n", "entry_point": "most_frequent_bases", "input": "'CCCAAT'", "output": "['C']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79013_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010708", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6178", "output": "{1, 6178, 2, 3089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010709", "code": "def calculate_total_nft_value(transactions):\n    total_value = sum(transaction[\"value\"] for transaction in transactions)\n    return total_value\n", "entry_point": "calculate_total_nft_value", "input": "[{'value': 650}]", "output": "650", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24676_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010710", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum_result = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum_result)\n    return output_list\n", "entry_point": "circular_sum", "input": "[9, 6, 6, 6, 5, 4, 6]", "output": "[15, 12, 12, 11, 9, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60286_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010711", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6399", "output": "{1, 3, 711, 9, 237, 79, 81, 2133, 27, 6399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010712", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[0, 2, 4, 2, 7, 2, 7, 2]", "output": "[0, 3, 6, 5, 3, 7, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010713", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'silent'", "output": "{'silent': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010714", "code": "def check_naming_convention(input_string):\n    if input_string.startswith(\"START_\") and (input_string.endswith(\"_END\") or input_string.endswith(\"_FINISH\")):\n        return True\n    return False\n", "entry_point": "check_naming_convention", "input": "'START_example_END'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31498_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010715", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9683", "output": "{1, 9683, 421, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010716", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'path/to/fil.txt'", "output": "'fil.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010717", "code": "def calculate_class_weight(total_samples: int, num_classes: int, class_samples: int) -> float:\n    class_weight = total_samples / (num_classes * class_samples)\n    return class_weight\n", "entry_point": "calculate_class_weight", "input": "10, 2, 5", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69664_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010718", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'AbA', ' (BengkkuDery)'", "output": "{'title': 'AbA', 'contrib': ' (BengkkuDery)'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010719", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3455", "output": "{1, 691, 5, 3455}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010720", "code": "import math\ndef close_enough(a, b, count_error):\n    absolute_difference = math.fabs(a - b)\n    threshold = math.fabs((a + b) / (count_error * 2))\n    return absolute_difference < threshold\n", "entry_point": "close_enough", "input": "10, 2, 2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2686_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010721", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7702", "output": "{1, 2, 3851, 7702}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010722", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 7]", "output": "[7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010723", "code": "import ast\nimport logging\ndef count_log_handlers(script):\n    log_handlers = {}\n    # Parse the script to identify log handler definitions\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign) and isinstance(node.value, ast.Call) and hasattr(node.value.func, 'attr'):\n            if node.value.func.attr == 'StreamHandler' or node.value.func.attr == 'FileHandler':\n                handler_type = node.value.func.attr\n                log_level = 'INFO'  # Default log level if not explicitly set\n                for keyword in node.value.keywords:\n                    if keyword.arg == 'level':\n                        log_level = keyword.value.attr\n                key = (handler_type, log_level)\n                log_handlers[key] = log_handlers.get(key, 0) + 1\n    return log_handlers\n", "entry_point": "count_log_handlers", "input": "'print(\"Hello World!\")'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2167_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010724", "code": "def binary_decode(arr):\n    result = 0\n    for i in range(len(arr)):\n        result += arr[i] * 2**(len(arr) - 1 - i)\n    return result\n", "entry_point": "binary_decode", "input": "[1, 1, 0, 1, 0, 0, 0, 1, 0]", "output": "418", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010725", "code": "def find_unique_inode(file_inodes):\n    unique_inode = 0\n    for inode in file_inodes:\n        unique_inode ^= inode\n    return unique_inode\n", "entry_point": "find_unique_inode", "input": "[1, 1, 2, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61857_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010726", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'_xml_sx'", "output": "'Exporting annotated corpus data for _xml_sx.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010727", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'162.31.3'", "output": "(162, 31, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010728", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "85800, 0", "output": "85800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010729", "code": "def process_integers(nums):\n    modified_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            modified_nums.append(num + 2)\n        elif num % 2 != 0:\n            modified_nums.append(num * 3)\n        if num % 5 == 0:\n            modified_nums[-1] -= 5\n    return modified_nums\n", "entry_point": "process_integers", "input": "[8, 8, 38, 5]", "output": "[10, 10, 40, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79730_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010730", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[16]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010731", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "353", "output": "'CCCLIII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010732", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documentle.tlt'", "output": "('local', 'documentle.tlt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010733", "code": "from typing import List\ndef calculate_total_time(tasks: List[int], cooldown: int) -> int:\n    last_occurrence = {}\n    time_elapsed = 0\n    for task_duration in tasks:\n        if task_duration not in last_occurrence or last_occurrence[task_duration] + cooldown <= time_elapsed:\n            time_elapsed += task_duration\n        else:\n            time_elapsed = last_occurrence[task_duration] + cooldown + task_duration\n        last_occurrence[task_duration] = time_elapsed\n    return time_elapsed\n", "entry_point": "calculate_total_time", "input": "[3], 0", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98461_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010734", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "10, 6, 12", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8365", "output": "{1, 35, 5, 7, 1673, 1195, 8365, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010736", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[2, 7, 6, 0, 2, 2, 6, 6, 5]", "output": "[9, 13, 6, 2, 4, 8, 12, 11, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4435", "output": "{1, 4435, 5, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010738", "code": "def find_second_largest(numbers):\n    largest = second_largest = float('-inf')\n    for num in numbers:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num > second_largest and num != largest:\n            second_largest = num\n    return second_largest\n", "entry_point": "find_second_largest", "input": "[22, 24, 23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104207_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010739", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[1, 5, 6]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010740", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8957", "output": "{1, 169, 13, 689, 53, 8957}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010741", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6041", "output": "{1, 6041, 863, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3169", "output": "{1, 3169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010743", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "47", "output": "'XLVII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010744", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[2, 2, 2, 2, 2, 2, 2, 2]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010745", "code": "def play_card_game(deck_a, deck_b):\n    total_a = sum(deck_a[:1])  # Draw one card for Player A\n    total_b = sum(deck_b[:1])  # Draw one card for Player B\n    if total_a > total_b:\n        return \"Player A wins the round!\"\n    elif total_b > total_a:\n        return \"Player B wins the round!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "play_card_game", "input": "[3], [5]", "output": "'Player B wins the round!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11746_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "685", "output": "{1, 5, 137, 685}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010747", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5287", "output": "{1, 311, 17, 5287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5286", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010748", "code": "def process_revision(revision):\n    # Extract the first 6 characters of the revision string in reverse order\n    key = revision[:6][::-1]\n    # Update the down_revision variable with the extracted value\n    global down_revision\n    down_revision = key\n    return down_revision\n", "entry_point": "process_revision", "input": "'0b7ccc'", "output": "'ccc7b0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39423_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010749", "code": "def format_sequences(seq_sp):\n    formatted_seqs = []\n    for i, seq_dict in enumerate(seq_sp):\n        formatted_seq = f\"{i}:{seq_dict['seq']}\"\n        formatted_seqs.append(formatted_seq)\n    return formatted_seqs\n", "entry_point": "format_sequences", "input": "[{'seq': 'ACGT'}]", "output": "['0:ACGT']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86340_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "152", "output": "{1, 2, 4, 38, 8, 76, 19, 152}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt151", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010751", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'hello', 'hello there'", "output": "(0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010752", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[-1, -2, -3, 8.0, 7.7, 7.0]", "output": "7.57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010753", "code": "def tomorrow(_):\n    return {i: i**2 for i in range(1, _+1)}\n", "entry_point": "tomorrow", "input": "0", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74523_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010754", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 2:\n        raise ValueError(\"At least 2 scores are required.\")\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    return adjusted_sum / (len(scores) - 1)\n", "entry_point": "calculate_average_score", "input": "[0, 100, 100]", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35185_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010755", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_kb = 0\n    for size in file_sizes:\n        total_size_kb += size / 1024  # Convert bytes to kilobytes\n    return int(total_size_kb)  # Return the total size in kilobytes as an integer\n", "entry_point": "calculate_total_size", "input": "[6144]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87932_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010756", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaaa'", "output": "'a4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010757", "code": "def process_request(request_body):\n    contype_test = request_body.get(\"interpersonal_content-type_test\")\n    if contype_test:\n        return {\n            \"interpersonal_test_result\": contype_test,\n            \"uploaded_file_count\": sum(len(files) for files in request_body.values() if isinstance(files, list)),\n        }\n    action = request_body.get(\"action\", \"create\")\n    supported_actions = [\"create\", \"delete\", \"undelete\", \"update\"]\n    if action not in supported_actions:\n        raise ValueError(f\"'{action}' action not supported\")\n    verified = {\"scopes\": [\"create\"]}  # Simulated verified scopes\n    if action not in verified[\"scopes\"]:\n        raise PermissionError(f\"Insufficient scope for '{action}' action\")\n    return f\"Action '{action}' successfully processed\"\n", "entry_point": "process_request", "input": "{'action': 'create'}", "output": "\"Action 'create' successfully processed\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102287_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "72", "output": "{1, 2, 3, 36, 4, 6, 72, 8, 9, 12, 18, 24}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt71", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010759", "code": "import logging\nLOG_LEVELS = {\n    \"CRITICAL\": logging.CRITICAL,\n    \"ERROR\": logging.ERROR,\n    \"WARNING\": logging.WARNING,\n    \"INFO\": logging.INFO,\n    \"DEBUG\": logging.DEBUG,\n}\nDEFAULT_LEVEL = \"WARNING\"\ndef convert_log_level(log_level):\n    return LOG_LEVELS.get(log_level, LOG_LEVELS.get(DEFAULT_LEVEL))\n", "entry_point": "convert_log_level", "input": "'INFO'", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18272_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010760", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[5, 10, 15]", "output": "[15, 25, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010761", "code": "def simulate_card_game(deck1, deck2):\n    rounds_played = 0\n    while deck1 and deck2:\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        rounds_played += 1\n    return rounds_played\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5, 6, 7], [8, 9, 10, 11, 12, 13, 14]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84703_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010762", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)  # Round to 2 decimal places\n", "entry_point": "calculate_average", "input": "[75, 86, 87, 90, 92]", "output": "87.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20923_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010763", "code": "from typing import List, Dict\ndef categorize_game_outcomes(game_outcomes: List[dict]) -> Dict[str, List[str]]:\n    categorized_outcomes = {\"Active\": [], \"Tie\": [], \"Won\": []}\n    for outcome in game_outcomes:\n        if outcome[\"kind\"] == \"Active\":\n            pass  # No winner for Active games\n        elif outcome[\"kind\"] == \"Tie\":\n            pass  # No winner for Tie games\n        elif outcome[\"kind\"] == \"Won\":\n            winner = outcome[\"value\"][\"winner\"]\n            categorized_outcomes[\"Won\"].append(winner)\n    return categorized_outcomes\n", "entry_point": "categorize_game_outcomes", "input": "[]", "output": "{'Active': [], 'Tie': [], 'Won': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32920_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010764", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[2, 3, 4]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010765", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[3, 7, 4, 3, 3, 3, 7, 2, 2]", "output": "[3, 8, 6, 6, 7, 8, 4, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010766", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4390", "output": "{1, 2, 5, 4390, 10, 878, 2195, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4389", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010767", "code": "def classify_triangle(r1: int, r2: int, r3: int) -> str:\n    if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:\n        if r1 == r2 == r3:\n            return 'Equilateral'\n        elif r1 != r2 and r2 != r3 and r1 != r3:\n            return 'Scalene'\n        else:\n            return 'Isosceles'\n    else:\n        return 'Not a triangle'\n", "entry_point": "classify_triangle", "input": "5, 2, 2", "output": "'Not a triangle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83282_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010768", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "8, 5, 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010769", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "8, 0", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010770", "code": "def compare_strings(s1, s2):\n    return s1.strip() == s2.strip()\n", "entry_point": "compare_strings", "input": "'  hello  ', 'hello'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8869_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "837", "output": "{1, 3, 837, 9, 279, 27, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010772", "code": "def calculate_average(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_scores = sum(scores) - min_score\n    num_scores = len(scores) - 1  # Exclude the minimum score\n    average_score = sum_scores / num_scores if num_scores > 0 else 0\n    return average_score\n", "entry_point": "calculate_average", "input": "[90, 90, 90, 90, 70]", "output": "90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12467_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010773", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8822", "output": "{1, 2, 802, 11, 401, 8822, 22, 4411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010774", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4276", "output": "{1, 2, 4, 1069, 4276, 2138}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4275", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010776", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "12", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010777", "code": "def count_unique_divisible_numbers(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible_numbers", "input": "[4, 4, 4, 3], 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61726_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010778", "code": "def simulate_deployment(args):\n    '''Simulates the deployment process based on the provided arguments.\n    Args:\n        args (dict): A dictionary containing deployment arguments.\n    Returns:\n        bool: True if the deployment command is to start, False otherwise.\n    '''\n    return args.get('command') == 'start'\n", "entry_point": "simulate_deployment", "input": "{'command': 'stop'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118959_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010779", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'data/all.', None", "output": "('data/all.', 'data/all.')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010780", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7036", "output": "{1, 2, 4, 7036, 3518, 1759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7035", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010781", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6802", "output": "{1, 2, 358, 38, 3401, 6802, 19, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010782", "code": "def sum_odd_multiples(start, end, multiple):\n    sum_odd = 0\n    for num in range(start, end + 1):\n        if num % 2 != 0 and num % multiple == 0:\n            sum_odd += num\n    return sum_odd\n", "entry_point": "sum_odd_multiples", "input": "0, 0, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010783", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[1, 2, 3, 5], 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010784", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[8, 8, 8, 2, 1, 1, 1]", "output": "[8, 8, 8, 2, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010785", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'my.module.name.djangppsAppfgConfig'", "output": "'djangppsAppfg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010786", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'This is number 1'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010787", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010788", "code": "def convert_to_lowercase(input_list):\n    lowercase_list = []\n    for string in input_list:\n        lowercase_string = \"\"\n        for char in string:\n            if 'A' <= char <= 'Z':\n                lowercase_string += chr(ord(char) + 32)\n            else:\n                lowercase_string += char\n        lowercase_list.append(lowercase_string)\n    return lowercase_list\n", "entry_point": "convert_to_lowercase", "input": "['Hello', 'World', 'Python']", "output": "['hello', 'world', 'python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15076_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010789", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "-1.4", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010790", "code": "from urllib.parse import urlparse, parse_qs\ndef extract_next_param(callback_url):\n    parsed_url = urlparse(callback_url)\n    query_params = parse_qs(parsed_url.query)\n    next_param = query_params.get('next', [None])[0]\n    return next_param\n", "entry_point": "extract_next_param", "input": "'http://example.com/?next=https://exapl'", "output": "'https://exapl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010791", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 == 0:\n            return \"Error: Division by zero\"\n        return num1 / num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'+', 3, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107177_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010792", "code": "def duplicate_characters(name):\n    duplicated_name = \"\"\n    for char in name:\n        duplicated_name += char * 2\n    return duplicated_name\n", "entry_point": "duplicate_characters", "input": "'Baak'", "output": "'BBaaaakk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49603_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010793", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "8, 12, 97", "output": "[13, 12, 12, 12, 12, 12, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010794", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num + 2)\n        elif num % 2 != 0:\n            processed_nums.append(num * 3)\n        if num % 5 == 0:\n            processed_nums[-1] -= 5\n    return processed_nums\n", "entry_point": "process_integers", "input": "[7, 38, 38, 3, 11, 5]", "output": "[21, 40, 40, 9, 33, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65994_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010795", "code": "def calculate_range(data):\n    if not data:\n        return None  # Handle empty dataset\n    min_val = max_val = data[0]  # Initialize min and max values\n    for num in data[1:]:\n        if num < min_val:\n            min_val = num\n        elif num > max_val:\n            max_val = num\n    return max_val - min_val\n", "entry_point": "calculate_range", "input": "[1, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21170_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010796", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[2, 2, 2, 2, 2], 10, 5", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3929", "output": "{3929, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5898", "output": "{1, 2, 3, 2949, 6, 5898, 1966, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010799", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: int) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    result = []\n    while end < len(temperatures):\n        if max(temperatures[start:end+1]) - min(temperatures[start:end+1]) <= threshold:\n            if end - start + 1 > max_length:\n                max_length = end - start + 1\n                result = temperatures[start:end+1]\n            end += 1\n        else:\n            start += 1\n    return result\n", "entry_point": "longest_contiguous_subarray", "input": "[70, 73, 74, 76, 80], 3", "output": "[73, 74, 76]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105139_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010800", "code": "def largest_prime_factor(N):\n    factor = 2\n    while factor * factor <= N:\n        if N % factor == 0:\n            N //= factor\n        else:\n            factor += 1\n    return max(factor, N)\n", "entry_point": "largest_prime_factor", "input": "6598", "output": "3299", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109160_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010801", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "1, 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010802", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'for'", "output": "'for'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010803", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average)  # Return the average as an integer\n", "entry_point": "calculate_average", "input": "[78, 79, 79, 79, 80]", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99126_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010804", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8799", "output": "{1, 3, 419, 7, 1257, 2933, 21, 8799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010805", "code": "def sum_squared_differences(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    sum_squared_diff = 0\n    for num1, num2 in zip(list1, list2):\n        diff = num2 - num1\n        sum_squared_diff += diff ** 2\n    return sum_squared_diff\n", "entry_point": "sum_squared_differences", "input": "[1, 1, 1], [1, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53280_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010806", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'F23'", "output": "142", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010807", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[3, 5, 2]", "output": "[[5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010808", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "10, 5, 19", "output": "(0, 5, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010809", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8836", "output": "{1, 2, 4418, 4, 8836, 2209, 47, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8835", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010811", "code": "def find_second_smallest(nums):\n    if len(nums) < 2:\n        return None\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif smallest < num < second_smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[0, 3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14329_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010812", "code": "from typing import List, Tuple, Any, Dict\ndef convert_settings(settings_list: List[Tuple[str, Any]]) -> Dict[str, Any]:\n    settings_dict = {}\n    for key, value in settings_list:\n        settings_dict[key] = value\n    return settings_dict\n", "entry_point": "convert_settings", "input": "[('key', {})]", "output": "{'key': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139910_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010813", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[5, 7, 10], 0, 2", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010814", "code": "def calculate_video_duration(frames: int, fps: int) -> int:\n    total_duration = frames // fps\n    return total_duration\n", "entry_point": "calculate_video_duration", "input": "14, 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77453_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010815", "code": "def process_satellite_data(response):\n    data = response.strip().split(\"\\n\")\n    tle_dictionary = {}\n    for i in range(len(data)):\n        line = data[i]\n        if line.startswith(\"1\"):  # Check if the line starts with '1'\n            sat_name = data[i - 1]\n            lineOne = data[i]\n            lineTwo = data[i + 1]\n            print(\"Inserting\", sat_name, lineOne, lineTwo)\n            # Add record to the database (simulated here)\n            # self.add_record(sat_name, lineOne, lineTwo)\n            tle_dictionary[sat_name] = lineOne + lineTwo\n    return tle_dictionary\n", "entry_point": "process_satellite_data", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93311_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010816", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_num = num + 2\n        else:\n            processed_num = max(num - 1, 0)  # Subtract 1 from odd numbers, ensure non-negativity\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_integers", "input": "[0, 6, 8, 3, 1]", "output": "[2, 8, 10, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98159_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010817", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'some.path', '', '55555'", "output": "'.55555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010818", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[0, 2, 3, 5, 6, 5, 6, 100]", "output": "[2, 3, 5, 6, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9079", "output": "{1, 7, 1297, 9079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010820", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6683", "output": "{1, 6683, 163, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010821", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 88, 86, 86, 82, 67]", "output": "[100, 88, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010822", "code": "def count_emojis(input_string):\n    emoji_count = {}\n    # Split the input string into individual emojis\n    emojis = input_string.split()\n    # Count the occurrences of each unique emoji\n    for emoji in emojis:\n        if emoji in emoji_count:\n            emoji_count[emoji] += 1\n        else:\n            emoji_count[emoji] = 1\n    return emoji_count\n", "entry_point": "count_emojis", "input": "'\u2728 \u2728 \ud83c\udf1f \ud83d\ude34'", "output": "{'\u2728': 2, '\ud83c\udf1f': 1, '\ud83d\ude34': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128683_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010823", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'ffofoffffo=baoffofoo'", "output": "{'ffofoffffo': 'baoffofoo'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010824", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'C:C:\\\\/h/home/user/another_directory/'", "output": "'C:C:\\\\/h/home/user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010825", "code": "import re\nfrom typing import List\ndef extract_xpath_expressions(script: str) -> List[str]:\n    xpath_expressions = re.findall(r\"find_element_by_xpath\\(\\\"(.*?)\\\"\\)\", script)\n    distinct_xpath_expressions = list(set(xpath_expressions))\n    return distinct_xpath_expressions\n", "entry_point": "extract_xpath_expressions", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13869_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010826", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 1, 2, 3, 2, 3, 1, 3, 3]", "output": "[2, 3, 5, 5, 5, 4, 4, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73916_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010827", "code": "def missingNumber(array, n):\n    total = n*(n+1)//2\n    array_sum = sum(array)\n    return total - array_sum\n", "entry_point": "missingNumber", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18], 18", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114479_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010828", "code": "def calculate_score(player1_cards, player2_cards):\n    cards = player1_cards if len(player1_cards) > 0 else player2_cards\n    result = 0\n    count = 1\n    while len(cards) > 0:\n        result += cards.pop() * count\n        count += 1\n    return result\n", "entry_point": "calculate_score", "input": "[10, 20, 30], []", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83679_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010829", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[1, 1, 4, 0, 1, 4, 0, 0, 0]", "output": "[1, 1, 4, 1, 4, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010830", "code": "def calculate_precision(true_positives, false_positives):\n    if true_positives + false_positives == 0:\n        return -1\n    precision = true_positives / (true_positives + false_positives)\n    return precision\n", "entry_point": "calculate_precision", "input": "5, 1", "output": "0.8333333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116916_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010831", "code": "def subset_sum(items, target, index=0):\n    if target == 0:\n        return True\n    if index >= len(items) or target < 0:\n        return False\n    # Include the current item\n    if subset_sum(items, target - items[index], index + 1):\n        return True\n    # Exclude the current item\n    if subset_sum(items, target, index + 1):\n        return True\n    return False\n", "entry_point": "subset_sum", "input": "[1, 2, 3], 7", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109736_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010832", "code": "def sort_modules(modules):\n    def custom_sort(module):\n        return (-module[1], module[0])\n    sorted_modules = sorted(modules, key=custom_sort)\n    sorted_module_names = [module[0] for module in sorted_modules]\n    return sorted_module_names\n", "entry_point": "sort_modules", "input": "[(20, 10), (20, 5), (20, 15)]", "output": "[20, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65686_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010833", "code": "CONTROL_PORT_READ_ENABLE_BIT    = 4\nCONTROL_GRAYDOT_KILL_BIT        = 5\nCONTROL_PORT_MODE_BIT           = 6\nCONTROL_PORT_MODE_COPY          = (0b01 << CONTROL_PORT_MODE_BIT)\nCONTROL_PORT_MODE_MASK          = (0b11 << CONTROL_PORT_MODE_BIT)\ndef apply_mask(control_value, control_mask) -> int:\n    masked_value = control_value & control_mask\n    return masked_value\n", "entry_point": "apply_mask", "input": "153, 255", "output": "153", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120473_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010834", "code": "def apply_formatting(input_str):\n    style = ''\n    color = ''\n    # Extract style and color information from the input string\n    if '\\033[' in input_str:\n        start_idx = input_str.index('\\033[')\n        end_idx = input_str.index('m')\n        style_color = input_str[start_idx + 2:end_idx].split(';')\n        style = style_color[0]\n        color = style_color[1]\n    # Apply ANSI escape codes based on the extracted information\n    formatted_text = f'\\033[{style};{color}m{input_str[end_idx + 1:-4]}\\033[m'\n    return formatted_text\n", "entry_point": "apply_formatting", "input": "'\\x1b[7;30m \\x1b[m'", "output": "'\\x1b[7;30m\\x1b[m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1962_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010835", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "241", "output": "{1, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010836", "code": "def calculate_points(scores):\n    if not scores:\n        return 0\n    total_points = 0\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            total_points += 1\n        else:\n            total_points -= 1\n    return total_points\n", "entry_point": "calculate_points", "input": "[5, 4, 3, 2, 1]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101160_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010837", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'2.z'", "output": "'3.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010838", "code": "def find_pairs_with_difference(nums, k):\n    unique_nums = set(nums)\n    pair_count = 0\n    for num in nums:\n        if num + k in unique_nums:\n            pair_count += 1\n        if num - k in unique_nums:\n            pair_count += 1\n        unique_nums.add(num)\n    return pair_count // 2  # Divide by 2 to avoid double counting pairs\n", "entry_point": "find_pairs_with_difference", "input": "[1, 3], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23679_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010839", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'1<KEY>1B', 'Bz'", "output": "'1Bz1B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010840", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'dav_v10.sv'", "output": "'dav_v11.sv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010841", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[89, 89, 89, 80, 75]", "output": "[89, 89, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113414_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010842", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'1121.11.1'", "output": "(1121, 11, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010843", "code": "def extract_key_value_pairs(input_str: str) -> dict:\n    key_value_pairs = {}\n    in_key_value_section = False\n    for line in input_str.split('\\n'):\n        if in_key_value_section:\n            if '\"' in line and '=' in line:\n                key, value = line.split('=')\n                key = key.strip()\n                value = value.strip().strip('\"')\n                key_value_pairs[key] = value\n            elif '\"\"\"' in line:\n                break\n        elif '\"\"\"' in line:\n            in_key_value_section = True\n    return key_value_pairs\n", "entry_point": "extract_key_value_pairs", "input": "'\"\"\"\\nThis is some text.\\n\"\"\"'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1342_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010844", "code": "MEBIBYTE = 1024 * 1024\nSTREAMING_DEFAULT_PART_SIZE = 10 * MEBIBYTE\nDEFAULT_PART_SIZE = 128 * MEBIBYTE\nOBJECT_USE_MULTIPART_SIZE = 128 * MEBIBYTE\ndef determine_part_size(file_size):\n    if file_size <= STREAMING_DEFAULT_PART_SIZE:\n        return STREAMING_DEFAULT_PART_SIZE\n    elif file_size <= DEFAULT_PART_SIZE:\n        return DEFAULT_PART_SIZE\n    else:\n        return OBJECT_USE_MULTIPART_SIZE\n", "entry_point": "determine_part_size", "input": "10485760", "output": "10485760", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_780_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010845", "code": "def num_decodings(sequence):\n    N = len(sequence)\n    dp = [0] * (N + 1)\n    dp[0] = 1\n    dp[1] = 1\n    for i in range(2, N + 1):\n        if sequence[i - 1] == 0:\n            if sequence[i - 2] == 1 or sequence[i - 2] == 2:\n                dp[i] = dp[i - 2]\n            else:\n                return 0\n        elif 1 <= sequence[i - 1] <= 9:\n            dp[i] = dp[i - 1]\n        elif sequence[i - 1] == 1 or (sequence[i - 1] == 2 and sequence[i - 2] == 0):\n            dp[i] = dp[i - 1]\n        elif 10 <= sequence[i - 2] * 10 + sequence[i - 1] <= 26:\n            dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "num_decodings", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62866_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010846", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4523", "output": "{1, 4523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010847", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[10, 12, 8, 4]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010848", "code": "def general_convert_time(_time, to_places=2) -> str:\n    \"\"\"\n    Used to get a more readable time conversion\n    \"\"\"\n    def convert_time(_time):\n        # Placeholder for the convert_time function logic\n        return \"12 hours 30 minutes 45 seconds\"  # Placeholder return for testing\n    times = convert_time(_time).split(' ')\n    selected_times = times[:to_places]\n    if len(times) > to_places:\n        return ' '.join(selected_times) + (', ' if len(times) > to_places * 2 else '') + ' '.join(times[to_places:])\n    else:\n        return ' '.join(selected_times)\n", "entry_point": "general_convert_time", "input": "45045", "output": "'12 hours, 30 minutes 45 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119806_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010849", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> int:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[73]", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55653_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6141", "output": "{1, 3, 69, 267, 23, 89, 6141, 2047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010851", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7881", "output": "{1, 2627, 3, 37, 71, 7881, 111, 213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010852", "code": "def solution(s):\n    start = 0\n    end = len(s) - 1\n    while start < len(s) and not s[start].isalnum():\n        start += 1\n    while end >= 0 and not s[end].isalnum():\n        end -= 1\n    return s[start:end+1]\n", "entry_point": "solution", "input": "'!!!abcddeghijk!!!'", "output": "'abcddeghijk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114817_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010853", "code": "def euclid_gcd(a, b):\n    if not isinstance(a, int) or not isinstance(b, int):\n        return \"Invalid input, please provide integers.\"\n    a = abs(a)\n    b = abs(b)\n    while b != 0:\n        a, b = b, a % b\n    return a\n", "entry_point": "euclid_gcd", "input": "3.5, 5", "output": "'Invalid input, please provide integers.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129293_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010854", "code": "def sum_of_digit_squares(n):\n    sum_squares = 0\n    for digit in str(n):\n        digit_int = int(digit)\n        sum_squares += digit_int ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "54", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28638_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010855", "code": "def find_non_dup(A=[]):\n    if len(A) == 0:\n        return None\n    non_dup = [x for x in A if A.count(x) == 1]\n    return non_dup[-1]\n", "entry_point": "find_non_dup", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57269_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010856", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'wolh'", "output": "{'wolh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010857", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[10.0, 0.0, 0.0], 'add'", "output": "[10.0, 10.0, 10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010858", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'O<NAME>'", "output": "'O<NAME>, Oberrieden'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010859", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3, 4, 5] * 15, 100", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010860", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8911", "output": "{1, 67, 133, 7, 8911, 19, 469, 1273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010861", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[3, 1, 2, 1, 3, 5, 4, 3]", "output": "[4.24, 1.41, 2.83, 1.41, 4.24, 7.07, 5.66, 4.24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010862", "code": "def find_pairs(arr, target_sum):\n    arr.sort()\n    left = 0\n    right = len(arr) - 1\n    count = 0\n    while left < right:\n        cur_sum = arr[left] + arr[right]\n        if cur_sum == target_sum:\n            print(target_sum, arr[left], arr[right])\n            count += 1\n            left += 1\n        elif cur_sum < target_sum:\n            left += 1\n        else:\n            right -= 1\n    print(\"Total pairs found:\", count)\n    return count\n", "entry_point": "find_pairs", "input": "[1, 2, 4, 5], 6", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73088_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010863", "code": "def calculate_circle_area(radius):\n    # Approximate the value of \u03c0 as 3.14159\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "3", "output": "28.27431", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46985_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010864", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'10.1.5.2'", "output": "(10, 1, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010865", "code": "def process_api_key(api_key_source):\n    if api_key_source == \"bearer\":\n        # Placeholder validation logic for bearer token\n        return True\n    elif api_key_source == \"query\":\n        # Placeholder validation logic for query parameter\n        return True\n    elif api_key_source == \"header\":\n        # Placeholder validation logic for header\n        return True\n    else:\n        return False\n", "entry_point": "process_api_key", "input": "'bearer'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20910_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010866", "code": "def extract_text(input_text: str) -> str:\n    parts = input_text.split('<!DOCTYPE html>', 1)\n    return parts[0] if len(parts) > 1 else input_text\n", "entry_point": "extract_text", "input": "'htmlm><!DOCTYPE html>'", "output": "'htmlm>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21287_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010867", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6095", "output": "{1, 1219, 5, 265, 6095, 115, 53, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1688", "output": "{1, 2, 4, 422, 8, 844, 211, 1688}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1687", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010869", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "[10, 8, 10, 7, -2, 0, 10, 8]", "output": "'10.8.10.7.-2.0.10.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010870", "code": "def assign_batches(batches, records, max_records_per_batch):\n    batch_counts = {batch[\"batch_id\"]: len(batch[\"records\"]) for batch in batches}\n    sorted_batches = sorted(batches, key=lambda x: (batch_counts.get(x[\"batch_id\"], 0), x[\"batch_id\"]))\n    for record in records:\n        for batch in sorted_batches:\n            if len(batch[\"records\"]) < max_records_per_batch:\n                batch[\"records\"].append(record[\"record_id\"])\n                record[\"batch_id\"] = batch[\"batch_id\"]\n                batch_counts[batch[\"batch_id\"]] += 1\n                break\n    return records\n", "entry_point": "assign_batches", "input": "[], [{} for _ in range(5)], 2", "output": "[{}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22041_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010871", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "987654321", "output": "'000000003ade68b1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010872", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[0, 0, 0, 0, 0, 1]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010873", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[6, 7, 1, 10, 6, 9, 3, 6]", "output": "[13, 8, 11, 16, 15, 12, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010874", "code": "CLASS_DATA_SCHEMA = {\n    \"name\": str,\n    \"desc_enter\": str,\n    \"desc_exit\": str,\n    \"choices\": dict\n}\ndef validate_class_data(class_data):\n    for key, value_type in CLASS_DATA_SCHEMA.items():\n        if key not in class_data or not isinstance(class_data[key], value_type):\n            return False\n    return True\n", "entry_point": "validate_class_data", "input": "{'name': 'Math', 'desc_enter': 'Entering Math class'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87533_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010875", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "5.5365335, 7", "output": "5.5365335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010876", "code": "def snapCurve(x):\n    y = 1 / (x + 1)\n    y = (1 - y) * 2\n    if y > 1:\n        return 1\n    else:\n        return y\n", "entry_point": "snapCurve", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117095_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1517", "output": "{1, 37, 1517, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7258", "output": "{1, 2, 38, 3629, 19, 7258, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010879", "code": "def lcs_length(x, y):\n    m, n = len(x), len(y)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if x[i - 1] == y[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'ABCBDAB', 'BDCAB'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71926_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010880", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "50, 2", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010881", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[21, 21, 21, 21]", "output": "[441, 441, 441, 441]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010882", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'hello', '1.1.00.1'", "output": "{'1.1.00.1': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010883", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[3, 4, 2, 3, 4, 1]", "output": "[[4], [4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010884", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "116", "output": "'ossg.default.116'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010885", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[5, 5, 5, 1, 2, 3]", "output": "(5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010886", "code": "from typing import List\ndef find_sum_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_val = min_val = nums[0]\n    for num in nums[1:]:\n        if num > max_val:\n            max_val = num\n        elif num < min_val:\n            min_val = num\n    return max_val + min_val\n", "entry_point": "find_sum_of_max_min", "input": "[3, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16636_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010887", "code": "def merge_metadata_dicts(metadata_dicts):\n    merged_dict = {}\n    for metadata_dict in metadata_dicts:\n        for key, value in metadata_dict.items():\n            if key in merged_dict:\n                if isinstance(value, dict):\n                    merged_dict[key] = merge_metadata_dicts([merged_dict[key], value])\n                elif isinstance(value, list):\n                    merged_dict[key] = list(set(merged_dict[key] + value))\n                else:\n                    if merged_dict[key] != value:\n                        merged_dict[key] = [merged_dict[key], value]\n            else:\n                merged_dict[key] = value\n    return merged_dict\n", "entry_point": "merge_metadata_dicts", "input": "[{'entity3': {}}, {'e3': {}}]", "output": "{'entity3': {}, 'e3': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39590_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010888", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "6, 11", "output": "121", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010889", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[2, 2, 1, 5, 7, 0, 0]", "output": "[4, 3, 6, 12, 7, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010890", "code": "def extract_author_and_date(code_snippet):\n    author_name = None\n    date = None\n    for line in code_snippet.split('\\n'):\n        if '@Author' in line:\n            author_name = line.split(':')[-1].strip()\n        elif '@Date' in line:\n            date = line.split(':')[-1].strip().split()[0]\n    return author_name, date\n", "entry_point": "extract_author_and_date", "input": "''", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54287_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010891", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[2, 3, 3, 5, 6, 6, 6, 6]", "output": "[2, 3, 3, 5, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010892", "code": "import re\ndef extract_footnotes(markdown_text):\n    footnotes = {}\n    footnote_pattern = r'\\[\\^(\\d+)\\]:\\s*(.*)'\n    for match in re.finditer(footnote_pattern, markdown_text, re.MULTILINE):\n        footnote_ref = f'^{match.group(1)}'\n        footnote_content = match.group(2).strip()\n        footnotes[footnote_ref] = footnote_content\n    return footnotes\n", "entry_point": "extract_footnotes", "input": "'[^1]:'", "output": "{'^1': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87331_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010893", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(1, 0, 0)", "output": "'#010000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010894", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'Title'", "output": "['Title']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010895", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(1, 6, 1)", "output": "'1.6.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010896", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'http/ex50_150x150'", "output": "'http/ex50'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010897", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'aaYorkge: 30'", "output": "{'aaYorkge': 30}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010898", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]", "output": "[5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010899", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'myapp.settings.sensorAtlasConfig'", "output": "'sensorAtlasConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010900", "code": "def extract_semantic_version(version):\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(''.join(filter(str.isdigit, version_parts[2])))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.100.10'", "output": "(0, 100, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111562_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010901", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8017", "output": "{8017, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010902", "code": "def check_prevent_initial_call(callbacks):\n    return [callback.get(\"prevent_initial_call\", False) is False for callback in callbacks]\n", "entry_point": "check_prevent_initial_call", "input": "[{}, {}, {}, {}, {}, {}, {}]", "output": "[True, True, True, True, True, True, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101469_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010903", "code": "def control_flow_replica(x):\n    if x < 0:\n        if x < -10:\n            return x * 2\n        else:\n            return x * 3\n    else:\n        if x > 10:\n            return x * 4\n        else:\n            return x * 5\n", "entry_point": "control_flow_replica", "input": "-2", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17276_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010904", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2634", "output": "{1, 2, 3, 1317, 6, 2634, 878, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010905", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(N, len(scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    average = top_scores_sum / num_students if num_students > 0 else 0.0\n    return average\n", "entry_point": "average_top_scores", "input": "[80, 75, 75, 75, 75, 75, 75, 70, 70], 9", "output": "74.44444444444444", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99565_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010906", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average = total_sum / total_students\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[67, 69, 70]", "output": "69", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33090_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010907", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 2, 3, 6, 4, 8, 2, 7]", "output": "[2, 6, 4, 8, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010908", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1943", "output": "{1, 67, 29, 1943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010909", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[6, 6, 0, -1, -2, 1, 5, 5, 5]", "output": "{6: 2, 0: 1, -1: 1, -2: 1, 1: 1, 5: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6088", "output": "{1, 2, 3044, 4, 6088, 8, 1522, 761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6087", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010911", "code": "def manipulate_string(input_string: str) -> str:\n    # Step 1: Reverse the input string\n    reversed_string = input_string[::-1]\n    # Step 2: Capitalize the first letter of the reversed string\n    capitalized_string = reversed_string.capitalize()\n    # Step 3: Append the length of the original string\n    final_output = capitalized_string + str(len(input_string))\n    return final_output\n", "entry_point": "manipulate_string", "input": "'hello'", "output": "'Olleh5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1099_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010912", "code": "def concat(parameters, sep):\n    text = ''\n    for i in range(len(parameters)):\n        text += str(parameters[i])\n        if i != len(parameters) - 1:\n            text += sep\n        else:\n            text += '\\n'\n    return text\n", "entry_point": "concat", "input": "[1, 2, 3, 4], '-'", "output": "'1-2-3-4\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80875_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010913", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[12, 8, 32]", "output": "3072", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010914", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(101, 101, 0)", "output": "10404", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010915", "code": "def ensure_lower_roles(roles):\n    if roles is None:\n        return []\n    return [role.strip().lower() for role in roles]\n", "entry_point": "ensure_lower_roles", "input": "['CMM-Admin', 'CMM-User']", "output": "['cmm-admin', 'cmm-user']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14884_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010916", "code": "import re\ndef process_svg_data(svgwidth, viewboxstr):\n    param = re.compile(r'(([-+]?[0-9]+(\\.[0-9]*)?|[-+]?\\.[0-9]+)([eE][-+]?[0-9]+)?)')\n    p = param.match(svgwidth)\n    width = 100  # default\n    viewboxwidth = 100  # default\n    if p:\n        width = float(p.string[p.start():p.end()])\n    else:\n        print(\"SVG Width not set correctly! Assuming width = 100\")\n    viewboxnumbers = []\n    for t in viewboxstr.split():\n        try:\n            viewboxnumbers.append(float(t))\n        except ValueError:\n            pass\n    return width, viewboxnumbers\n", "entry_point": "process_svg_data", "input": "'abc', '0'", "output": "(100, [0.0])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120937_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010917", "code": "def generate_filter_pairs(filters):\n    filter_pairs = []\n    for i in range(len(filters)):\n        for j in range(i+1, len(filters)):\n            filter_pairs.append((filters[i], filters[j]))\n    return filter_pairs\n", "entry_point": "generate_filter_pairs", "input": "['r', 'rr', 'rg']", "output": "[('r', 'rr'), ('r', 'rg'), ('rr', 'rg')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46274_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9105", "output": "{1, 3, 5, 15, 9105, 3035, 1821, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9104", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010919", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[1, 1, 2, 2, 4, 5]", "output": "[1, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010920", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "31, 36", "output": "1116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010921", "code": "from typing import List\ndef maxWaterTrapped(height: List[int]) -> int:\n    left, right = 0, len(height) - 1\n    maxWater = 0\n    while left < right:\n        water = (right - left) * min(height[left], height[right])\n        maxWater = max(maxWater, water)\n        if height[left] < height[right]:\n            left += 1\n        else:\n            right -= 1\n    return maxWater\n", "entry_point": "maxWaterTrapped", "input": "[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28209_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010922", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "13, 8", "output": "'Enemy: 13, Own: 8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010923", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "999, 100", "output": "899", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010924", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7538", "output": "{3769, 1, 7538, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010926", "code": "def generate_video_embed_code(video_id, platform):\n    if platform == \"youtube\":\n        return f'<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/{video_id}\" frameborder=\"0\" allowfullscreen></iframe>'\n    elif platform == \"vimeo\":\n        return f'<iframe src=\"https://player.vimeo.com/video/{video_id}\" width=\"640\" height=\"360\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe>'\n    elif platform == \"dailymotion\":\n        return f'<iframe style=\"width: 100%; height: 100%\" frameborder=\"0\" webkitAllowFullScreen allowFullScreen src=\"http://www.dailymotion.com/embed/video/{video_id}\"></iframe>'\n    else:\n        return \"Unsupported platform\"\n", "entry_point": "generate_video_embed_code", "input": "'12345', 'facebook'", "output": "'Unsupported platform'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139056_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010927", "code": "def find_last_number_less_than_five(numbers):\n    for num in reversed(numbers):\n        if num < 5:\n            return num\n    return None\n", "entry_point": "find_last_number_less_than_five", "input": "[6, 7, 10, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109099_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010928", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6008", "output": "{1, 2, 4, 8, 751, 6008, 3004, 1502}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6007", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010929", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5853", "output": "{1, 3, 5853, 1951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010930", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[38]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010931", "code": "import re\ndef process_twitter_text(text):\n    re_usernames = re.compile(\"@([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    re_hashtags = re.compile(\"#([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    replace_hashtags = \"<a href=\\\"http://twitter.com/search?q=%23\\\\1\\\">#\\\\1</a>\"\n    replace_usernames = \"<a href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a>\"\n    processed_text = re_usernames.sub(replace_usernames, text)\n    processed_text = re_hashtags.sub(replace_hashtags, processed_text)\n    return processed_text\n", "entry_point": "process_twitter_text", "input": "'tiandhit'", "output": "'tiandhit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76234_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010932", "code": "# Define the positions and their corresponding bitmask values\npositions = {\n    'catcher': 1,\n    'first_base': 2,\n    'second_base': 4,\n    'third_base': 8,\n    'short_stop': 16,\n    'outfield': 32,\n    'left_field': 64,\n    'center_field': 128,\n    'right_field': 256,\n    'designated_hitter': 512,\n    'pitcher': 1024,\n    'starting_pitcher': 2048,\n    'relief_pitcher': 4096\n}\ndef get_eligible_positions(player_mask):\n    eligible_positions = []\n    for position, mask in positions.items():\n        if player_mask & mask:\n            eligible_positions.append(position)\n    return eligible_positions\n", "entry_point": "get_eligible_positions", "input": "22", "output": "['first_base', 'second_base', 'short_stop']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51303_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010933", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'n_pgpu: '", "output": "{'n_pgpu': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010934", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6247", "output": "{1, 6247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010935", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\begin{table}[H]'", "output": "'\\\\begin{table}[H]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3809", "output": "{1, 13, 293, 3809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010937", "code": "def base64_encode(input_str):\n    base64_chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"\n    # Step 1: Convert input string to ASCII representation\n    ascii_vals = [ord(char) for char in input_str]\n    # Step 2: Convert ASCII to binary format\n    binary_str = ''.join(format(val, '08b') for val in ascii_vals)\n    # Step 3: Pad binary string to be a multiple of 6 bits\n    while len(binary_str) % 6 != 0:\n        binary_str += '0'\n    # Step 4: Map 6-bit binary chunks to base64 characters\n    base64_encoded = ''\n    for i in range(0, len(binary_str), 6):\n        chunk = binary_str[i:i+6]\n        base64_encoded += base64_chars[int(chunk, 2)]\n    # Step 5: Handle padding at the end\n    padding = len(binary_str) % 24\n    if padding == 12:\n        base64_encoded += '=='\n    elif padding == 18:\n        base64_encoded += '='\n    return base64_encoded\n", "entry_point": "base64_encode", "input": "'Hello, World!'", "output": "'SGVsbG8sIFdvcmxkIQ=='", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132996_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010938", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "26", "output": "[1, 1, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010939", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010940", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "5.57012, 16.0", "output": "149.57012", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010941", "code": "def count_mirror_numbers(a, b):\n    cnt = 0\n    for i in range(a, b+1):\n        s = str(i)\n        s_r = s[::-1]\n        n = len(s) // 2\n        if s[:n] == s_r[:n]:\n            cnt += 1\n    return cnt\n", "entry_point": "count_mirror_numbers", "input": "0, 9", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19378_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6665", "output": "{1, 5, 6665, 43, 1333, 215, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010943", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 88, 75, 60, 65, 70]", "output": "[92, 88, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010944", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 3, 5, 2, 2, 5, 2]", "output": "[7, 8, 7, 4, 7, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010945", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 2, 5, 10]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24202_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010946", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if N >= num_students:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[-606], 1", "output": "-606.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122460_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010947", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    if len(tokens) == 3:  # Arithmetic operation\n        num1, operator, num2 = tokens\n        num1, num2 = int(num1), int(num2)\n        if operator == '+':\n            return num1 + num2\n        elif operator == '-':\n            return num1 - num2\n        elif operator == '*':\n            return num1 * num2\n        elif operator == '/':\n            return num1 / num2\n    elif len(tokens) == 2:  # Comparison or logical operation\n        operator = tokens[0]\n        if operator == 'not':\n            return not eval(tokens[1])\n        elif operator == 'and':\n            return all(eval(token) for token in tokens[1:])\n        elif operator == 'or':\n            return any(eval(token) for token in tokens[1:])\n    return None  # Invalid expression format\n", "entry_point": "evaluate_expression", "input": "'266 + 0'", "output": "266", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109464_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010948", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'oJJooJoJ', 'mithDoSSmSth', 'aMre'", "output": "'oJJooJoJ aMre mithDoSSmSth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010949", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[3, 3], 0", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010950", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[0, 0, 5, 5, 2, 2, 3, 2, 2]", "output": "[0, 5, 2, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010951", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[16, 81, 25]", "output": "32400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010952", "code": "import os\ndef list_files_and_directories(directory_path):\n    try:\n        files_and_directories = os.listdir(directory_path)\n        return files_and_directories\n    except FileNotFoundError:\n        return \"Directory not found or accessible.\"\n", "entry_point": "list_files_and_directories", "input": "'/path/to/nonexistent/directory'", "output": "'Directory not found or accessible.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89025_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010953", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-6, 0, -1, 1, -6]", "output": "[6, 0, 1, -1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010954", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "63, 0", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3679", "output": "{1, 283, 13, 3679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010956", "code": "import itertools\ndef unique_eigenvalue_differences(eigvals):\n    unique_eigvals = sorted(set(eigvals))\n    differences = {j - i for i, j in itertools.combinations(unique_eigvals, 2)}\n    return tuple(sorted(differences))\n", "entry_point": "unique_eigenvalue_differences", "input": "[0, 1, 2, 3, 4]", "output": "(1, 2, 3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124400_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010957", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9415", "output": "{1, 1345, 35, 5, 7, 9415, 269, 1883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010958", "code": "import re\nfrom typing import List\nNUMERIC_VALUES = re.compile(r\"-?[\\d.]*\\d$\")\ndef count_numeric_strings(input_list: List[str]) -> int:\n    count = 0\n    for string in input_list:\n        if NUMERIC_VALUES.search(string):\n            count += 1\n    return count\n", "entry_point": "count_numeric_strings", "input": "['hello', '123', 'world', '3.14']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76559_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010959", "code": "def count_unique_divisible_numbers(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible_numbers", "input": "[2, 4, 6, 8, 2, 4], 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61726_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010960", "code": "import re\ndef parse_repository_config(repo_config):\n    repo_dict = {}\n    for idx, repo_entry in enumerate(repo_config.split('\\n')):\n        parts = repo_entry.split()\n        if len(parts) < 4:\n            continue  # Skip incomplete repository entries\n        repo_info = {\n            'type': parts[0],\n            'arch': re.search(r'\\[arch=(\\w+)\\]', repo_entry).group(1) if '[arch=' in repo_entry else None,\n            'url': parts[1] if '[arch=' in repo_entry else parts[0],\n            'dist': parts[2],\n            'components': ' '.join(parts[3:])\n        }\n        repo_dict[f'repo{idx+1}'] = repo_info\n    return repo_dict\n", "entry_point": "parse_repository_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73504_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010961", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6854", "output": "{1, 2, 3427, 6854, 298, 46, 149, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010962", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "913", "output": "{83, 1, 913, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010963", "code": "from typing import List, Dict, Union\ndef process_model_attributes(attributes: List[str]) -> Dict[str, Union[bool, float, None]]:\n    output = {'use_batch_coeff': False, 'bert_dropout': None}\n    if 'USE_BATCH_COEFF' in attributes:\n        output['use_batch_coeff'] = True\n        if 'BERT_ATTR' in attributes:\n            # Simulating extraction of BERT_ATTR value (e.g., 0.2)\n            output['bert_dropout'] = 0.2\n        else:\n            output['bert_dropout'] = DEFAULT_BERT_DROPOUT\n    return output\n", "entry_point": "process_model_attributes", "input": "[]", "output": "{'use_batch_coeff': False, 'bert_dropout': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111870_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010964", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[90, 85, 83, 80, 72]", "output": "82.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010965", "code": "def filter_urls(url_matching, urls):\n    filtered_urls = []\n    for url in urls:\n        for match_type, pattern in url_matching:\n            if match_type == \"EXACT\" and url == pattern:\n                filtered_urls.append(url)\n                break\n            elif match_type == \"CONTAINS\" and pattern in url:\n                filtered_urls.append(url)\n                break\n    return filtered_urls\n", "entry_point": "filter_urls", "input": "[('EXACT', 'example.com'), ('CONTAINS', 'test')], []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147142_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010966", "code": "def is_boolean(value):\n    true_values = {'true', '1', 't', 'y', 'yes', 'on'}\n    return value.lower() in true_values\n", "entry_point": "is_boolean", "input": "'yes'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30286_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010967", "code": "def simulate_api_request(route, method, data=None):\n    routes = {\n        '/': 'index.html',\n        '/app.js': 'app.js',\n        '/favicon.ico': 'favicon.ico',\n        '/api/list': {'GET': lambda: {'puzzles': solvers.puzzle_list()}},\n        '/api/solve': {\n            'POST': lambda: {'pzprv3': solvers.solve(data['pzprv3'], data['different_from'])}\n        }\n    }\n    if route not in routes:\n        return '404 Not Found'\n    if method not in routes[route]:\n        return '405 Method Not Allowed'\n    if method == 'POST':\n        return routes[route][method]()\n    else:\n        return routes[route]\n", "entry_point": "simulate_api_request", "input": "'/invalid-route', 'GET'", "output": "'404 Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138582_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010968", "code": "from typing import List\nDIGIT_WORDS = [str(\"Zero\"), str(\"One\"), str(\"Two\"), str(\"Three\"), str(\"Four\"), str(\"Five\"), str(\"Six\"), str(\"Seven\"), str(\"Eight\"), str(\"Nine\"), str(\"Ten\")]\ndef convert_to_words(numbers: List[int]) -> List[str]:\n    result = []\n    for num in numbers:\n        if 0 <= num <= 10:\n            result.append(DIGIT_WORDS[num])\n        else:\n            result.append(\"Unknown\")\n    return result\n", "entry_point": "convert_to_words", "input": "[3, 7, 11, 5, 0]", "output": "['Three', 'Seven', 'Unknown', 'Five', 'Zero']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89715_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010969", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2319", "output": "{1, 3, 773, 2319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010970", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[5, 3, 11, 9, 6, 3, 10], 6", "output": "[5, 3, 5, 3, 0, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010971", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9596", "output": "{1, 2, 4, 9596, 4798, 2399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9595", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010972", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "2.6, 3", "output": "17.576000000000004", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010973", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[79]", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010974", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 2, 5, 4, 4, 4, 5]", "output": "[2, 7, 9, 8, 8, 9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110145_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010975", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'uohhow'", "output": "{'uohhow': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010976", "code": "def calculate_total_power_consumption(heating_power, efficiency, hours_of_operation):\n    total_power_consumption = 0\n    for power in heating_power:\n        total_power_consumption += power * efficiency * hours_of_operation\n    return total_power_consumption\n", "entry_point": "calculate_total_power_consumption", "input": "[390, 780], 0.8, 30", "output": "28080.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74992_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1099", "output": "{1, 1099, 157, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010978", "code": "def sort_trades(trades):\n    # Define a custom key function to extract the timestamp for sorting\n    def get_timestamp(trade):\n        return trade[0]\n    # Sort the trades based on timestamps in descending order\n    sorted_trades = sorted(trades, key=get_timestamp, reverse=True)\n    return sorted_trades\n", "entry_point": "sort_trades", "input": "[(7, 7), (7,), (7, 7)]", "output": "[(7, 7), (7,), (7, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41963_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010979", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'fie'", "output": "'fie_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010980", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[92, 90, 88, 85, 84, 82, 77], 7", "output": "85.42857142857143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79219_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010981", "code": "# Define the mapping between detector names and camera types\ndetector_camera_mapping = {\n    'EigerDetector': 'cam.EigerDetectorCam',\n    'FirewireLinDetector': 'cam.FirewireLinDetectorCam',\n    'FirewireWinDetector': 'cam.FirewireWinDetectorCam',\n    'GreatEyesDetector': 'cam.GreatEyesDetectorCam',\n    'LightFieldDetector': 'cam.LightFieldDetectorCam'\n}\n# Function to get the camera type based on the detector name\ndef get_camera_type(detector_name):\n    return detector_camera_mapping.get(detector_name, 'Detector not found')\n", "entry_point": "get_camera_type", "input": "'EigerDetector'", "output": "'cam.EigerDetectorCam'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_375_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010982", "code": "def generate_weather_message(args):\n    weather_data = {\n        \"dublin\": {\n            \"channel\": {\n                \"item\": {\n                    \"condition\": {\n                        \"date\": \"2022-01-01\",\n                        \"temp\": 20,\n                        \"text\": \"Sunny\"\n                    }\n                }\n            }\n        },\n        \"paris\": {\n            \"channel\": {\n                \"item\": {\n                    \"condition\": {\n                        \"date\": \"2022-01-02\",\n                        \"temp\": 15,\n                        \"text\": \"Cloudy\"\n                    }\n                }\n            }\n        }\n    }\n    if not args:\n        args = [\"dublin\"]\n    location = \" \".join(args)\n    if location not in weather_data:\n        return \"Location not found\"\n    condition = weather_data[location][\"channel\"][\"item\"][\"condition\"]\n    msg = \"{location}, {date}, {temp}\u00b0C, {sky}\".format(\n        location=location.capitalize(),\n        date=condition[\"date\"],\n        temp=condition[\"temp\"],\n        sky=condition[\"text\"],\n    )\n    return msg\n", "entry_point": "generate_weather_message", "input": "['london']", "output": "'Location not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35689_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010983", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# is'", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010984", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'Hello123'", "output": "'hELLO###'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010985", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1101010X'", "output": "['11010100', '11010101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9208", "output": "{1, 2, 4, 8, 9208, 4604, 2302, 1151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9207", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2846", "output": "{1, 2, 2846, 1423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010988", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010989", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010990", "code": "def count_unique_chars(strings):\n    result = {}\n    for string in strings:\n        processed_string = string.lower().replace(\" \", \"\")\n        unique_chars = set()\n        for char in processed_string:\n            if char.isalpha():\n                unique_chars.add(char)\n        result[string] = len(unique_chars)\n    return result\n", "entry_point": "count_unique_chars", "input": "['Pme', 'Python']", "output": "{'Pme': 3, 'Python': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64720_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010991", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4076", "output": "{1, 2, 4, 4076, 2038, 1019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4075", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3954", "output": "{1, 2, 3, 1318, 6, 3954, 659, 1977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3953", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010993", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.DoeJoJo.dJE@EoejComo'", "output": "'john.doejojo.dje@eoejcomo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010994", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9073", "output": "{1, 43, 9073, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7499", "output": "{1, 7499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6772", "output": "{1, 2, 4, 6772, 3386, 1693}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6771", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010997", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4681", "output": "{4681, 1, 151, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2461", "output": "{1, 107, 2461, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0010999", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[6, 8, 10, 5, 7.5, 6.5, 11, -1, -2]", "output": "7.714285714285714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011000", "code": "def validate_conference_menu(resp):\n    # Check if \"errors\" key is present\n    if \"errors\" in resp:\n        return False\n    # Check the length of the list under \"data/conference/menu/links\"\n    try:\n        links = resp[\"data\"][\"conference\"][\"menu\"][\"links\"]\n        if len(links) != 3:\n            return False\n    except (KeyError, TypeError):\n        return False\n    return True\n", "entry_point": "validate_conference_menu", "input": "{'errors': 'Some error message'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137769_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7969", "output": "{1, 613, 13, 7969}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011002", "code": "def tracklist(data):\n    track_dict = {}\n    if not data:\n        return track_dict\n    for entry in data.split('\\n'):\n        parts = entry.split(' - ')\n        if len(parts) == 2:\n            song_name, artist_name = parts\n            track_dict[song_name.strip()] = artist_name.strip()\n    return track_dict\n", "entry_point": "tracklist", "input": "'Song1 - At3'", "output": "{'Song1': 'At3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140589_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011003", "code": "from typing import List\nSUPPORTED_BACKENDS = [\n    'pycryptodomex',\n    'pysha3',\n]\ndef check_backend_availability(backend: str, supported_backends: List[str]) -> bool:\n    return backend in supported_backends\n", "entry_point": "check_backend_availability", "input": "'pycryptodomex', SUPPORTED_BACKENDS", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134615_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011004", "code": "def calculate_dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        raise ValueError(\"Input vectors must have the same length\")\n    dot_product = 0\n    for i in range(len(vector1)):\n        dot_product += vector1[i] * vector2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 2], [5, 3]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011005", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[10], [10, 13]]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011006", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[7, 7], 'add'", "output": "[14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011007", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for i in range(len(arr1)):\n        total_diff += abs(arr1[i] - arr2[i])\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[10], [1]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136179_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011008", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[6, 0, 0, 1, 4, 0, 6, 0]", "output": "[6, 1, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011009", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[1, 1, 2, 2, 3, 3]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011010", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "' H '", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011011", "code": "def extract_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if not char.isspace():\n            unique_chars.add(char)\n    return sorted(list(unique_chars))\n", "entry_point": "extract_unique_characters", "input": "'   e f  '", "output": "['e', 'f']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89815_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011012", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2020-01-01', '2021-01-01'", "output": "366", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4223", "output": "{1, 41, 103, 4223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011014", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9874", "output": "{4937, 1, 9874, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4195", "output": "{1, 4195, 5, 839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "427", "output": "{1, 427, 61, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011017", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://example.com/_150x1ht_150x150'", "output": "'https://example.com/_150x1ht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "42", "output": "{1, 2, 3, 6, 7, 42, 14, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt41", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011019", "code": "def filter_complaints_by_status(complaints, status_to_filter):\n    filtered_complaint_ids = []\n    for complaint in complaints:\n        if complaint[\"status\"] == status_to_filter:\n            filtered_complaint_ids.append(complaint[\"complaint_id\"])\n    return filtered_complaint_ids\n", "entry_point": "filter_complaints_by_status", "input": "[], 'open'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83066_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011020", "code": "def get_file_extension(file_path):\n    # Find the last occurrence of the period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring starting from the last period to the end of the file path\n    if last_period_index != -1:  # Check if a period was found\n        file_extension = file_path[last_period_index:]\n        return file_extension\n    else:\n        return \"\"  # Return an empty string if no period was found\n", "entry_point": "get_file_extension", "input": "'.'", "output": "'.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141157_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011021", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['0 + 0', '0 - 0']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011022", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4118", "output": "{1, 2, 71, 2059, 142, 4118, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4951", "output": "{1, 4951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011024", "code": "def find_local_maxima(linePoints):\n    local_maxima = []\n    # Check if the first point is a local maxima\n    if linePoints[0][1] >= linePoints[1][0]:\n        local_maxima.append(linePoints[0])\n    # Iterate through the line segment points excluding the first and last points\n    for i in range(1, len(linePoints) - 1):\n        if linePoints[i][1] >= linePoints[i-1][1] and linePoints[i][1] >= linePoints[i+1][0]:\n            local_maxima.append(linePoints[i])\n    # Check if the last point is a local maxima\n    if linePoints[-1][0] >= linePoints[-2][1]:\n        local_maxima.append(linePoints[-1])\n    return local_maxima\n", "entry_point": "find_local_maxima", "input": "[(8, 9), (10, 6), (9, 10)]", "output": "[(9, 10)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65073_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011025", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[3, 2, 1]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011026", "code": "import re\ndef extract_city_and_date(url_pattern):\n    pattern = r'city/(?P<city>[^/]+)/date/(?P<date>[^/]+)/'\n    match = re.match(pattern, url_pattern)\n    if match:\n        return match.groupdict()\n    else:\n        return None\n", "entry_point": "extract_city_and_date", "input": "'city/london/date/2023-01-01/'", "output": "{'city': 'london', 'date': '2023-01-01'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141519_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011027", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 0, 2, 1, 3, 2, 1, 0]", "output": "[1, 1, 3, 4, 7, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011028", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "10, 5", "output": "252", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4453", "output": "{73, 1, 61, 4453}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011030", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[8, 8]", "output": "[8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt66", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011031", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[10, 5, 9]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011032", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'1230x123456bcdef'", "output": "{'bytecode': '0x1230x123456bcdef'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011033", "code": "def sum_of_pairs(lst, target):\n    seen = {}\n    pair_sum = 0\n    for num in lst:\n        complement = target - num\n        if complement in seen:\n            pair_sum += num + complement\n        seen[num] = True\n    return pair_sum\n", "entry_point": "sum_of_pairs", "input": "[2, 4, 1, 5], 6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88231_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011034", "code": "def process_input_tensor(dec_u_list):\n    dec_w_list = []\n    dec_b_list = []\n    for element in dec_u_list:\n        if isinstance(element, list):\n            dec_w_list.append(element)\n        else:\n            dec_b_list.append(element)\n    return dec_w_list, dec_b_list\n", "entry_point": "process_input_tensor", "input": "[]", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82568_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011035", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1869", "output": "{1, 3, 7, 267, 1869, 623, 21, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011036", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011037", "code": "def find_max_product(a_list):\n    big = a_list[0][0] * a_list[0][1]  # Initialize with the product of the first two elements\n    for row in range(len(a_list)):\n        for column in range(len(a_list[row])):\n            if column < len(a_list[row]) - 1:\n                if a_list[row][column] * a_list[row][column + 1] > big:\n                    big = a_list[row][column] * a_list[row][column + 1]\n            if row < len(a_list) - 1:\n                if a_list[row][column] * a_list[row + 1][column] > big:\n                    big = a_list[row][column] * a_list[row + 1][column]\n            if row < len(a_list) - 1 and column < len(a_list[row]) - 1:\n                if a_list[row][column] * a_list[row + 1][column + 1] > big:\n                    big = a_list[row][column] * a_list[row + 1][column + 1]\n                if a_list[row + 1][column] * a_list[row][column + 1] > big:\n                    big = a_list[row + 1][column] * a_list[row][column + 1]\n    return big\n", "entry_point": "find_max_product", "input": "[[8, 9], [2, 1]]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61059_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011038", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 1, 1", "output": "(936, 314)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011039", "code": "def dna_to_rna(dna_strand):\n    pairs = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}\n    rna_complement = ''.join(pairs[n] for n in dna_strand)\n    return rna_complement\n", "entry_point": "dna_to_rna", "input": "'GGCGCTTA'", "output": "'CCGCGAAU'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39038_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011040", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'JJo.'", "output": "'jjo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011041", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 7, 11, 19]", "output": "47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145369_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011042", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "90", "output": "'qst_quests_end'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011043", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "16, 8", "output": "12870", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1823", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011044", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "74.22800000000001, 10.0", "output": "64.22800000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011045", "code": "from typing import List\ndef process_commands(commands: List[str]) -> int:\n    result = 0\n    for command in commands:\n        parts = command.split()\n        command_name = parts[0]\n        arguments = list(map(int, parts[1:]))\n        if command_name == 'add':\n            result += sum(arguments)\n        elif command_name == 'subtract':\n            result -= arguments[0]\n            for arg in arguments[1:]:\n                result -= arg\n        elif command_name == 'multiply':\n            result *= arguments[0]\n            for arg in arguments[1:]:\n                result *= arg\n    return result\n", "entry_point": "process_commands", "input": "['add 1000', 'subtract 2740']", "output": "-1740", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38199_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011046", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'applapapplapplon'", "output": "('applapapplapplon', '', '', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011047", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# Hello'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011048", "code": "def every(lst, f=1, start=0):\n    result = []\n    for i in range(start, len(lst), f):\n        result.append(lst[i])\n    return result\n", "entry_point": "every", "input": "[4]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105731_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011049", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "121", "output": "121", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011050", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[8, 2, 2, 4, 6, 7, 2, 2]", "output": "[8, 3, 4, 7, 10, 12, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011051", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[2, 4, 4, 4, 4, 3, 3, 3]", "output": "{2: 1, 4: 4, 3: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011052", "code": "from typing import List\ndef count_pairs_with_sum(arr: List[int], target: int) -> int:\n    num_freq = {}\n    pair_count = 0\n    for num in arr:\n        complement = target - num\n        if complement in num_freq:\n            pair_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_with_sum", "input": "[3, 3, 7, 7, 3, 4, 6], 10", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011053", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, num + current_sum)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[8, 16]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103842_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011054", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "44, 121", "output": "(224, 58)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011055", "code": "def calculate_average_excluding_extremes(scores):\n    sorted_scores = sorted(scores)\n    if len(sorted_scores) < 3:\n        return \"Not enough scores to calculate the average.\"\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the highest and lowest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[80, 88, 89, 90, 95]", "output": "89.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45520_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011056", "code": "def count_users_with_one_post(post_counts):\n    user_post_count = {}\n    for count in post_counts:\n        if count in user_post_count:\n            user_post_count[count] += 1\n        else:\n            user_post_count[count] = 1\n    return user_post_count.get(1, 0)\n", "entry_point": "count_users_with_one_post", "input": "[1, 1, 1, 5, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16257_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011057", "code": "def get_file_type(file_path):\n    file_extension = file_path[file_path.rfind(\".\"):].lower()\n    file_types = {\n        \".py\": \"Python file\",\n        \".txt\": \"Text file\",\n        \".jpg\": \"Image file\",\n        \".png\": \"Image file\",\n        \".mp3\": \"Audio file\",\n        \".mp4\": \"Video file\"\n    }\n    return file_types.get(file_extension, \"Unknown file type\")\n", "entry_point": "get_file_type", "input": "'sample_video.mp4'", "output": "'Video file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12387_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011058", "code": "def reverse_complement(dna_sequence: str) -> str:\n    # Dictionary mapping each base to its complementary base\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the input DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each base with its complementary base\n    reverse_complement_sequence = ''.join(complement_dict[base] for base in reversed_sequence)\n    return reverse_complement_sequence\n", "entry_point": "reverse_complement", "input": "'ATCGATCGATCG'", "output": "'CGATCGATCGAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67367_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011059", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'3.9.2-dev.1'", "output": "(3, 9, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011060", "code": "import urllib.parse\ndef categorize_urls(urls):\n    categorized_urls = {'stage0': [], 'stage1': [], 'onedrive': []}\n    for url in urls:\n        path = urllib.parse.urlparse(url).path\n        parts = path.split('/')\n        if parts[1] == 'documents' and parts[2] == 'lang':\n            categorized_urls['stage0'].append(url)\n        elif parts[1] == 'documents' and parts[2] == 'grammar':\n            categorized_urls['stage1'].append(url)\n        elif parts[1] == 'onedrive' and parts[2] == 'auth':\n            categorized_urls['onedrive'].append(url)\n    return categorized_urls\n", "entry_point": "categorize_urls", "input": "[]", "output": "{'stage0': [], 'stage1': [], 'onedrive': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43664_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011061", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[0, 5, 8], [5, 5, 0]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59273_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011062", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6583", "output": "{1, 227, 29, 6583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011063", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[8, 5, 10], 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011064", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'3.a'", "output": "'3.b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011065", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'zg'", "output": "'zg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3881", "output": "{1, 3881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011067", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[1, 2, 3, 6, 6, 4, 5, 6], 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011068", "code": "def encrypt_string(s: str, shift: int) -> str:\n    encrypted_string = \"\"\n    for char in s:\n        if char.isupper():\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_char = chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_char = char\n        encrypted_string += encrypted_char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'Yng!', 1", "output": "'Zoh!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74768_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4249", "output": "{1, 4249, 607, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011070", "code": "def count_even_odd(numbers):\n    even_count = 0\n    odd_count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n    return even_count, odd_count\n", "entry_point": "count_even_odd", "input": "[0, 2, 4, 6, 8, 1, 3, 5]", "output": "(5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51670_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011071", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 0, 1, 3, 2, 2, 0, 2]", "output": "[3, 1, 4, 5, 4, 2, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011072", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "'\u043f\u0431\u0432\u0433'", "output": "[16, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011073", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'test set eckyyet'", "output": "'eckyyet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011074", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello there, my name is Thomas. every day.'", "output": "'Thomas every'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011075", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'over'", "output": "{'over': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011076", "code": "import re\ndef extract_viewsets_from_router(router_code):\n    viewset_pattern = re.compile(r'router\\.register\\(\"(.*?)\", (.*?), basename=\"(.*?)\"\\)')\n    viewsets = {}\n    matches = viewset_pattern.findall(router_code)\n    for match in matches:\n        viewset_name = match[0]\n        viewset_class = match[1]\n        base_name = match[2]\n        viewsets[viewset_name] = base_name\n    return viewsets\n", "entry_point": "extract_viewsets_from_router", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97040_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011077", "code": "def calculate_last_element(t, n):\n    for i in range(2, n):\n        t.append(t[i-2] + t[i-1]*t[i-1])\n    return t[-1]\n", "entry_point": "calculate_last_element", "input": "[5, 28], 3", "output": "789", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120049_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011078", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8831", "output": "{1, 8831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011079", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9583", "output": "{1, 259, 37, 7, 9583, 1369}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011080", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[3, 3, 3, 3, 4, 4, 5]", "output": "{3: 4, 4: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011081", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'2.0.1.dev0'", "output": "(2, 0, 1, 'dev0')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011082", "code": "from typing import List\ndef count_unique_pairs(numbers: List[int], target: int) -> int:\n    seen = {}\n    count = 0\n    for num in numbers:\n        complement = target - num\n        if complement in seen and seen[complement] > 0:\n            count += 1\n            seen[complement] -= 1\n        else:\n            seen[num] = seen.get(num, 0) + 1\n    return count\n", "entry_point": "count_unique_pairs", "input": "[1, 4, 2, 3, 2, 3], 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76342_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011083", "code": "def is_valid_relationship_type(type_name):\n    valid_relationship_types = {'OneToOne', 'OneToMany', 'ManyToOne', 'ManyToMany'}\n    return type_name in valid_relationship_types\n", "entry_point": "is_valid_relationship_type", "input": "'OneToMany'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95563_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011084", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'BNBUSDT'", "output": "('BNB', 'USDT')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011085", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'ffoffffobr'", "output": "'ffoffffobr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011086", "code": "def count_kwargs(_kwargs):\n    kwargs_count = []\n    for kwargs in _kwargs:\n        count = len(kwargs.keys()) + len(kwargs.values())\n        kwargs_count.append(count)\n    return kwargs_count\n", "entry_point": "count_kwargs", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15928_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011087", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'example.com:443'", "output": "('https', 'example.com', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011088", "code": "def caesar_cipher(text, shift):\n    result = \"\"\n    for char in text:\n        if char.isupper():\n            new_char = chr((ord(char) - 65 + shift) % 26 + 65)\n            result += new_char\n    return result\n", "entry_point": "caesar_cipher", "input": "'OLSLO', 1", "output": "'PMTMP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7376_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011089", "code": "def vending_machine(items, coins_inserted, item_id):\n    coin_values = {1, 5, 10}\n    total_inserted = sum(coins_inserted)\n    if item_id not in items:\n        return (False, 0)\n    item_name, item_price, quantity_available = items[item_id]\n    if quantity_available <= 0 or total_inserted < item_price:\n        return (False, 0)\n    items[item_id] = (item_name, item_price, quantity_available - 1)\n    change = total_inserted - item_price\n    if change < 0:\n        return (False, 0)\n    return (True, change)\n", "entry_point": "vending_machine", "input": "{'A': ('Soda', 150, 0)}, [10, 5], 'B'", "output": "(False, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33607_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011090", "code": "from typing import List\ndef generate_html_list(input_list: List[str]) -> str:\n    html = \"<ul>\"\n    for item in input_list:\n        html += f\"<li>{item}</li>\"\n    html += \"</ul>\"\n    return html\n", "entry_point": "generate_html_list", "input": "[]", "output": "'<ul></ul>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53215_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011091", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo llo'", "output": "'llo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011092", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 3, 8, 10, 9, 1, 9, 1, 3]", "output": "[3, 4, 10, 13, 13, 6, 15, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011093", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'1.91.9'", "output": "'1.92.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6719", "output": "{1, 6719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011095", "code": "from typing import List\ndef parentheses_placement(nums: List[int], target: int) -> bool:\n    def evaluate_expression(nums, target, current_sum, index):\n        if index == len(nums):\n            return current_sum == target\n        for i in range(index, len(nums)):\n            current_sum += nums[i]\n            if evaluate_expression(nums, target, current_sum, i + 1):\n                return True\n            current_sum -= nums[i]\n            current_sum *= nums[i]\n            if evaluate_expression(nums, target, current_sum, i + 1):\n                return True\n            current_sum //= nums[i]\n        return False\n    return evaluate_expression(nums, target, nums[0], 1)\n", "entry_point": "parentheses_placement", "input": "[2, 2, 2], 6", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118745_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "647", "output": "{1, 647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011097", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7606", "output": "{1, 2, 3803, 7606}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7605", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2423", "output": "{1, 2423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011099", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "421", "output": "{1, 421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5221", "output": "{1, 227, 5221, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011101", "code": "def extract_force_steps(lines):\n    force_steps = []\n    read_force = False\n    final_flag = False\n    vc_flag = False\n    for line in lines:\n        if \"Force\" in line:\n            if read_force:\n                force = int(line.split(\"-\")[-1].strip().split()[0])\n                force_steps.append(force)\n        elif \"Final coordinates\" in line:\n            final_flag = True\n        elif \"VC-relaxation\" in line:\n            vc_flag = True\n    return force_steps\n", "entry_point": "extract_force_steps", "input": "['This is a text line', 'Another line without relevant info']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36478_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011102", "code": "import sys\ndef process_test_args(argv):\n    predefined_args = [\n        \"--cov\",\n        \"elasticsearch_dsl\",\n        \"--cov\",\n        \"test_elasticsearch_dsl.test_integration.test_examples\",\n        \"--verbose\",\n        \"--junitxml\",\n        \"junit.xml\",\n        \"--cov-report\",\n        \"xml\",\n    ]\n    if argv is None:\n        argv = predefined_args\n    else:\n        argv = argv[1:]\n    return argv\n", "entry_point": "process_test_args", "input": "['some_script_name', 'test_file.py']", "output": "['test_file.py']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92393_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011103", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[5, 2, 1, 1, 3, 3, 0, 2, 5]", "output": "[5, 7, 8, 9, 12, 15, 15, 17, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011104", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6296", "output": "{1, 2, 4, 1574, 8, 3148, 787, 6296}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6295", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1639", "output": "{1, 11, 149, 1639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011106", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'1.2.3'", "output": "'1.2.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5738", "output": "{1, 2, 38, 5738, 302, 19, 2869, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011108", "code": "from typing import List\ndef process_commands(commands: str) -> List[int]:\n    engines = [0] * 3  # Initialize engines with zeros\n    for command in commands.split():\n        action, engine_number = command.split(':')\n        engine_number = int(engine_number)\n        if action == 'START':\n            engines[engine_number - 1] = engine_number\n        elif action == 'STOP':\n            engines[engine_number - 1] = 0\n    return engines\n", "entry_point": "process_commands", "input": "'START:2 START:3'", "output": "[0, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117335_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011109", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "200, 200, 44, 120, 80", "output": "444", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011110", "code": "from math import gcd\ndef calculate_output(solutionsFound):\n    a = solutionsFound[0][0]\n    b = solutionsFound[0][1]\n    c = solutionsFound[1][0]\n    d = solutionsFound[1][1]\n    k = gcd(a - c, d - b)\n    h = gcd(a + c, d + b)\n    m = gcd(a + c, d - b)\n    l = gcd(a - c, d + b)\n    n = (k**2 + h**2) * (l**2 + m**2)\n    result1 = int((k**2 + h**2) / 2)\n    result2 = int((l**2 + m**2) / 2)\n    return [result1, result2]\n", "entry_point": "calculate_output", "input": "[(2, 0), (0, 2)]", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73488_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011111", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "5", "output": "'21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011112", "code": "def min_subarray_length(nums, target):\n    left = 0\n    size = len(nums)\n    res = size + 1\n    sub_sum = 0\n    for right in range(size):\n        sub_sum += nums[right]\n        while sub_sum >= target:\n            sub_length = (right - left + 1)\n            if sub_length < res:\n                res = sub_length\n            sub_sum -= nums[left]\n            left += 1\n    if res == (size + 1):\n        return 0\n    else:\n        return res\n", "entry_point": "min_subarray_length", "input": "[2, 3, 5], 10", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127187_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011113", "code": "import re\nHIDDEN_SETTING = re.compile(r\"URL|BACKEND\")\ndef count_unique_long_words(text: str, length: int) -> int:\n    words = text.split()\n    filtered_words = [word.lower() for word in words if not HIDDEN_SETTING.search(word)]\n    unique_long_words = set(word for word in filtered_words if len(word) > length)\n    return len(unique_long_words)\n", "entry_point": "count_unique_long_words", "input": "'example', 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45296_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011114", "code": "import re\ndef extract_input_pipeline_names(code_snippet):\n    input_pipeline_names = set()\n    # Regular expression pattern to match import statements\n    pattern = r\"from python\\.input\\.(.*?)_input_pipeline import\"\n    # Find all matches of the pattern in the code snippet\n    matches = re.findall(pattern, code_snippet)\n    # Add the matched input pipeline names to the set\n    input_pipeline_names.update(matches)\n    return list(input_pipeline_names)\n", "entry_point": "extract_input_pipeline_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37624_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011115", "code": "def find_differing_pair(ids):\n    for i, ID in enumerate(ids):\n        for other_i, other_ID in enumerate(ids):\n            if i >= other_i:\n                continue\n            count_differences = 0\n            differing_index = -1\n            for j, (a, b) in enumerate(zip(ID, other_ID)):\n                if a != b:\n                    count_differences += 1\n                    differing_index = j\n                if count_differences > 1:\n                    break\n            if count_differences == 1:\n                return differing_index, i\n", "entry_point": "find_differing_pair", "input": "['abcde', 'abXde']", "output": "(2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133434_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011116", "code": "def calculate_total_photons(energy_bins, number_of_photons):\n    total_photons = 0\n    for energy, photons in zip(energy_bins, number_of_photons):\n        total_photons += energy * photons\n    return total_photons\n", "entry_point": "calculate_total_photons", "input": "[100, 50, 36], [8, 1, 1]", "output": "886", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106074_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011117", "code": "def merge_config_files(config_files):\n    merged_settings = {}\n    for config_dict in config_files:\n        merged_settings.update(config_dict)  # Update merged settings with the current config dictionary\n    return merged_settings\n", "entry_point": "merge_config_files", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20072_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011118", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "42, 21", "output": "0.015873015873015872", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011119", "code": "def sum_digits_power(n):\n    digit_sum = 0\n    num_digits = 0\n    temp = n\n    # Calculate the sum of digits\n    while temp > 0:\n        digit_sum += temp % 10\n        temp //= 10\n    # Calculate the number of digits\n    temp = n\n    while temp > 0:\n        num_digits += 1\n        temp //= 10\n    # Calculate the result\n    result = digit_sum ** num_digits\n    return result\n", "entry_point": "sum_digits_power", "input": "20000000000000000000", "output": "1048576", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137515_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8703", "output": "{1, 3, 967, 9, 2901, 8703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011121", "code": "def get_aquarium_light_color(aquarium_id):\n    aquarium_data = {\n        1: {'default_mode': 'red', 'total_food_quantity': 50},\n        2: {'default_mode': 'blue', 'total_food_quantity': 30},\n        3: {'default_mode': 'green', 'total_food_quantity': 70}\n    }\n    if aquarium_id not in aquarium_data:\n        return 'Unknown'\n    default_mode = aquarium_data[aquarium_id]['default_mode']\n    total_food_quantity = aquarium_data[aquarium_id]['total_food_quantity']\n    if default_mode == 'red' and total_food_quantity < 40:\n        return 'dim red'\n    elif default_mode == 'blue' and total_food_quantity >= 50:\n        return 'bright blue'\n    elif default_mode == 'green':\n        return 'green'\n    else:\n        return default_mode\n", "entry_point": "get_aquarium_light_color", "input": "1", "output": "'red'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20096_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011122", "code": "def calculate_hamming_dist(uploaded_hash, db_store_hash):\n    count = 0\n    for i in range(len(uploaded_hash)):\n        if uploaded_hash[i] != db_store_hash[i]:\n            count += 1\n    return count\n", "entry_point": "calculate_hamming_dist", "input": "'abcde', 'abfgh'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4669_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011123", "code": "def parse_version(version_str):\n    parts = version_str.split('.')\n    if len(parts) != 3:\n        return None\n    try:\n        major = int(parts[0])\n        minor = int(parts[1])\n        patch = int(parts[2])\n        return major, minor, patch\n    except ValueError:\n        return None\n", "entry_point": "parse_version", "input": "'3.14.27'", "output": "(3, 14, 27)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52090_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011124", "code": "import ast\ndef count_unique_modules_imported(script):\n    imports = set()\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                module = alias.name.split('.')[-1]\n                imports.add(module)\n        elif isinstance(node, ast.ImportFrom):\n            module = node.module.split('.')[-1]\n            imports.add(module)\n    return len(imports)\n", "entry_point": "count_unique_modules_imported", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17170_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011125", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'ldsseds'", "output": "'Tweet posted successfully: ldsseds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011126", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "['L', 'L', 'L', 'L', 'L', 'L']", "output": "(-6, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011127", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 7, 9]", "output": "[7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt25", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011128", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/folder/subfolder/examppt'", "output": "'examppt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011129", "code": "def generate_cmake_ios_resource_config(resources: dict) -> str:\n    config_lines = \"\"\n    for resource_name, resource_path in resources.items():\n        config_lines += f\"set({resource_name} {resource_path})\\n\"\n        config_lines += f\"set_source_files_properties(${{{resource_name}}} PROPERTIES MACOSX_PACKAGE_LOCATION {resource_path}\\n\"\n    return config_lines\n", "entry_point": "generate_cmake_ios_resource_config", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25255_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011130", "code": "def generate_telegram_url(api_token):\n    URL_BASE = 'https://api.telegram.org/file/bot'\n    complete_url = URL_BASE + api_token + '/'\n    return complete_url\n", "entry_point": "generate_telegram_url", "input": "'PUTT_HRE'", "output": "'https://api.telegram.org/file/botPUTT_HRE/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139134_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011131", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[1.0, 2.0, 3.0, 4.0, 2.777777777777777], 5", "output": "2.5555555555555554", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011132", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1567", "output": "{1, 1567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011133", "code": "def count_even_numbers(lst):\n    count = 0\n    for num in lst:\n        if num % 2 == 0:\n            count += 1\n    return count\n", "entry_point": "count_even_numbers", "input": "[2, 4, 6, 8, 1, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39285_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011134", "code": "import re\ndef find_view_function(url_path):\n    url_patterns = [\n        (r'^$', 'index'),\n        (r'^api_keys/$', 'apikeys'),\n        (r'^update/$', 'update'),\n        (r'^password/$', 'password_change'),\n        (r'^activate/$', 'activation'),\n        (r'^ssh_key/(?P<action>add|delete)/$', 'sshkey'),\n        (r'^impersonate/user/(?P<username>[A-Za-z0-9@.+_-]+)/$', 'start_impersonation'),\n        (r'^impersonate/cancel/$', 'stop_impersonation'),\n    ]\n    for pattern, view_function in url_patterns:\n        if re.match(pattern, url_path):\n            return view_function\n    return \"Not Found\"\n", "entry_point": "find_view_function", "input": "''", "output": "'index'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49048_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011135", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'D.'", "output": "'D.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011136", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3855", "output": "{1, 257, 3, 771, 5, 1285, 3855, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011137", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[95, 90, 90, 90, 85], 4", "output": "91.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011138", "code": "def find_latest_version(versions):\n    def version_key(version):\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    sorted_versions = sorted(versions, key=version_key, reverse=True)\n    return sorted_versions[0]\n", "entry_point": "find_latest_version", "input": "['9.0.0', '10.0.1', '9.1.0', '10.1.0', '8.2.5']", "output": "'10.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42610_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2633", "output": "{2633, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2632", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011140", "code": "def generate_url(namespace, route_name):\n    routes = {\n        'getAllObjectDest': '/',\n    }\n    if route_name in routes:\n        return namespace + routes[route_name]\n    else:\n        return 'Route not found'\n", "entry_point": "generate_url", "input": "'/map', 'getAllObjectDest'", "output": "'/map/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114969_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7994", "output": "{1, 2, 7, 14, 1142, 7994, 571, 3997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011142", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'ae'", "output": "['ae']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011143", "code": "from typing import List\ndef count_unique_words(sentences: List[str]) -> int:\n    unique_words = set()\n    for sentence in sentences:\n        words = sentence.split()\n        for word in words:\n            unique_words.add(word.lower())\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "['The cat sat', 'The dog sat']", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41011_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011144", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'danedare'", "output": "'danedare'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011145", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[3, 29, 2, 30, 4, 4, 2, 3]", "output": "'2, 3, 4, 29, 30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011146", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[0, 1, 2, 3, 4, 5, 3, 3, 1, 1], 4", "output": "[4, 5, 3, 3, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011147", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3661", "output": "'01:01:01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011148", "code": "import re\ndef extract_pacman_paths(code_snippet: str) -> dict:\n    paths = {}\n    pattern = r'(\\w+)\\s*=\\s*\"([^\"]+)\"'\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        variable_name, path = match\n        if variable_name.startswith(\"PM_\"):\n            paths[variable_name] = path\n    return paths\n", "entry_point": "extract_pacman_paths", "input": "\"variable1 = 'some_path'; variable2 = 'another_path';\"", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79987_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7806", "output": "{1, 2, 3, 6, 2602, 1301, 7806, 3903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011150", "code": "def sum_odd_multiples(start, end, multiple):\n    sum_odd = 0\n    for num in range(start, end + 1):\n        if num % 2 != 0 and num % multiple == 0:\n            sum_odd += num\n    return sum_odd\n", "entry_point": "sum_odd_multiples", "input": "1, 49, 7", "output": "112", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011151", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5119", "output": "{1, 5119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011152", "code": "from typing import List, Optional\ndef most_frequent_element(lst: List[int]) -> Optional[int]:\n    if not lst:\n        return None\n    freq_count = {}\n    max_freq = 0\n    most_freq_element = None\n    for num in lst:\n        freq_count[num] = freq_count.get(num, 0) + 1\n        if freq_count[num] > max_freq:\n            max_freq = freq_count[num]\n            most_freq_element = num\n    return most_freq_element\n", "entry_point": "most_frequent_element", "input": "[1, 1, 2, 2, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62206_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011153", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[7, 10, 15], 8", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011154", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[2, 3, 1, 2, 5]", "output": "[2, 3, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011155", "code": "def extract_app_name(config_class_str):\n    # Find the index of 'name =' in the input string\n    name_index = config_class_str.find(\"name =\")\n    # Extract the substring starting from the app name\n    app_name_start = config_class_str.find(\"'\", name_index) + 1\n    app_name_end = config_class_str.find(\"'\", app_name_start)\n    # Return the extracted app name\n    return config_class_str[app_name_start:app_name_end]\n", "entry_point": "extract_app_name", "input": "\"name = 'ArkFufdpn'\"", "output": "'ArkFufdpn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66687_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011156", "code": "# Define the decoding lambdas\nitheta_ = lambda tr_identity: (tr_identity & 0x000000ff) >> 0\niphi_ = lambda tr_identity: (tr_identity & 0x0000ff00) >> 8\nindex_ = lambda tr_identity: (tr_identity & 0xffff0000) >> 16\n# Function to decode the transformation identity\ndef decode_transform(tr_identity):\n    itheta = itheta_(tr_identity)\n    iphi = iphi_(tr_identity)\n    index = index_(tr_identity)\n    return itheta, iphi, index\n", "entry_point": "decode_transform", "input": "16716339", "output": "(51, 18, 255)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121743_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011157", "code": "def calculate_surface_area(grid):\n    n, total_area = len(grid), 0\n    for i in range(n):\n        for j in range(n):\n            if grid[i][j]:\n                total_area += 4  # Each cell contributes 4 units to the surface area\n                for nx, ny in [(i-1, j), (i, j-1), (i+1, j), (i, j+1)]:\n                    if 0 <= nx < n and 0 <= ny < n:\n                        neighbor_height = grid[nx][ny]\n                    else:\n                        neighbor_height = 0\n                    total_area += max(0, grid[i][j] - neighbor_height)\n    return total_area\n", "entry_point": "calculate_surface_area", "input": "[[0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71304_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011158", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[18, 19, 20, 20]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011159", "code": "def calculate_dot_product(A, B):\n    if len(A) != len(B):\n        raise ValueError(\"Arrays must be of the same length\")\n    dot_product = sum(a * b for a, b in zip(A, B))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[3, 6], [9, 7]", "output": "69", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105699_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011160", "code": "def map_phases_to_statuses(phase_list, status_list):\n    phase_status_mapping = {}\n    for phase, status in zip(phase_list, status_list):\n        phase_status_mapping[phase] = status\n    return phase_status_mapping\n", "entry_point": "map_phases_to_statuses", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126453_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011161", "code": "def make_cls_name(base: str, replacement: str) -> str:\n    return base.replace(\"Base\", replacement)\n", "entry_point": "make_cls_name", "input": "'BaseCrol', 'Bast'", "output": "'BastCrol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120218_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8689", "output": "{1, 8689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011163", "code": "def generate_default_names(num_topics, num_ranks):\n    default_names = {}\n    for i in range(1, num_topics + 1):\n        topic_name = f'topic_{i}'\n        rank_name = f'rank_{i % num_ranks + 1}'\n        default_names[topic_name] = rank_name\n    return default_names\n", "entry_point": "generate_default_names", "input": "0, 1", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58006_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011164", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "4, 5", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011165", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "3, 0", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011166", "code": "def extract_domain_name(url):\n    # Remove the protocol part of the URL\n    url = url.split(\"://\")[-1]\n    # Extract the domain name by splitting at the first single forward slash\n    domain_name = url.split(\"/\")[0]\n    return domain_name\n", "entry_point": "extract_domain_name", "input": "'http://www.example.com'", "output": "'www.example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96968_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011167", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "find_latest_version", "input": "['1.2.3', '2.1.0', '3.0.0']", "output": "'3.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112747_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011168", "code": "def merge_intervals(arr1, arr2):\n    l = min(min(arr1), min(arr2))\n    r = max(max(arr1), max(arr2))\n    return [l, r]\n", "entry_point": "merge_intervals", "input": "[1, 5], [6, 7]", "output": "[1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98126_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011169", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'eeeelolo'", "output": "b'\\x08\\x00\\x00\\x00eeeelolo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011170", "code": "from typing import List\ndef max_sub_array(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sub_array", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80022_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011171", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[2, 3, 5, 10, 6, 6]", "output": "[2, 10, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011172", "code": "def prefix_strings(input_list):\n    prefixes_dict = {}\n    for string in input_list:\n        lowercase_string = string.lower()\n        for i in range(1, len(lowercase_string) + 1):\n            prefix = lowercase_string[:i]\n            prefixes_dict.setdefault(prefix, []).append(string)\n    return prefixes_dict\n", "entry_point": "prefix_strings", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88750_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011173", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48656c6c6f20576f72486421'", "output": "b'Hello WorHd!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011174", "code": "def categorize_students(scores):\n    groups = {'A': [], 'B': [], 'C': []}\n    for score in scores:\n        if score >= 80:\n            groups['A'].append(score)\n        elif 60 <= score <= 79:\n            groups['B'].append(score)\n        else:\n            groups['C'].append(score)\n    return groups\n", "entry_point": "categorize_students", "input": "[91, 61, 55]", "output": "{'A': [91], 'B': [61], 'C': [55]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63935_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011175", "code": "def count_numbers_with_same_first_last_digit(nums_str):\n    count = 0\n    for num_str in nums_str:\n        if num_str[0] == num_str[-1]:\n            count += 1\n    return count\n", "entry_point": "count_numbers_with_same_first_last_digit", "input": "['5', '34']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139447_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011176", "code": "MINIMUM_CONFIRMATIONS = 6\ndef check_confirmations(confirmations):\n    return len(confirmations) >= MINIMUM_CONFIRMATIONS\n", "entry_point": "check_confirmations", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78569_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011177", "code": "import socket\nVR_IP_PROTO_IGMP = 2\nVR_IP_PROTO_TCP = 6\nVR_IP_PROTO_UDP = 17\nVR_IP_PROTO_GRE = 47\nVR_IP_PROTO_ICMP6 = 58\nVR_IP_PROTO_SCTP = 132\nVR_GRE_FLAG_CSUM = (socket.ntohs(0x8000))\nVR_GRE_FLAG_KEY = (socket.ntohs(0x2000))\nVR_GRE_BASIC_HDR_LEN = 4\nVR_GRE_CKSUM_HDR_LEN = 8\nVR_GRE_KEY_HDR_LEN = 8\ndef calculate_gre_header_size(protocol: int, flags: int) -> int:\n    basic_header_len = VR_GRE_BASIC_HDR_LEN\n    if protocol == VR_IP_PROTO_GRE:\n        total_len = basic_header_len\n        if flags & VR_GRE_FLAG_CSUM:\n            total_len += VR_GRE_CKSUM_HDR_LEN\n        if flags & VR_GRE_FLAG_KEY:\n            total_len += VR_GRE_KEY_HDR_LEN\n        return total_len\n    return basic_header_len\n", "entry_point": "calculate_gre_header_size", "input": "VR_IP_PROTO_GRE, VR_GRE_FLAG_CSUM", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133178_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011178", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8252", "output": "{1, 2, 4, 2063, 8252, 4126}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8251", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011179", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'illumina', 'sample_pacbeads.fa.reads.fa'", "output": "'sample_pacbeads.fa_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011180", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[3, 3, 4, 4, 4, 0, 1, 3, 3]", "output": "[3, 3, 4, 4, 4, 0, 1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011181", "code": "def shift_array(arr, k):\n    effective_shift = k % len(arr)\n    shifted_arr = []\n    for i in range(len(arr)):\n        new_index = (i + effective_shift) % len(arr)\n        shifted_arr.insert(new_index, arr[i])\n    return shifted_arr\n", "entry_point": "shift_array", "input": "[2, 2, 3, 1, 3, 3, 3, 3], 4", "output": "[3, 3, 3, 3, 2, 2, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145368_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011182", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "' a00_!a000@aaa#0aaa0 '", "output": "'a00a000aaa0aaa0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011183", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011184", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'cluster', 'general'", "output": "\"Provider submodule 'cluster' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011185", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9241", "output": "{1, 9241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011186", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'00.150'", "output": "'00.150.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2246", "output": "{1, 2, 1123, 2246}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2245", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011188", "code": "from typing import List\ndef maximalSquare(matrix: List[List[int]]) -> int:\n    if not matrix:\n        return 0\n    rows, cols = len(matrix), len(matrix[0])\n    dp = [[0] * cols for _ in range(rows)]\n    max_square_size = 0\n    for i in range(rows):\n        for j in range(cols):\n            if matrix[i][j] == 1:\n                if i == 0 or j == 0:\n                    dp[i][j] = 1\n                else:\n                    dp[i][j] = min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1]) + 1\n                max_square_size = max(max_square_size, dp[i][j])\n    return max_square_size ** 2\n", "entry_point": "maximalSquare", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58198_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011189", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[3, 3, 6, 6, 1]", "output": "[3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011190", "code": "def average_top_scores(scores):\n    scores.sort(reverse=True)\n    top_students = min(5, len(scores))\n    top_scores_sum = sum(scores[:top_students])\n    return top_scores_sum / top_students\n", "entry_point": "average_top_scores", "input": "[90, 89, 85, 86, 82]", "output": "86.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61425_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011191", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'11.32.1', \"'Key'\"", "output": "(11, 32, 1, 'Key')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011192", "code": "def calculate_char_frequency(input_string):\n    input_string = input_string.upper()\n    frequency = {}\n    for char in input_string:\n        if char != \" \":\n            if char in frequency:\n                frequency[char] += 1\n            else:\n                frequency[char] = 1\n    return frequency\n", "entry_point": "calculate_char_frequency", "input": "'WORLD R'", "output": "{'W': 1, 'O': 1, 'R': 2, 'L': 1, 'D': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50071_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011193", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "8", "output": "171", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011194", "code": "def fibonacci_iterative(num):\n    if num <= 0:\n        return None\n    if num == 1:\n        return 0\n    if num == 2:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, num):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci_iterative", "input": "8", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73606_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011195", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[5, 12, 13, 13, 5, 14, 6, 7, 13]", "output": "[5, 5, 6, 7, 12, 13, 13, 13, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011196", "code": "import os\ndef search_keyword_in_files(keyword, directory):\n    keyword = keyword.lower()\n    found_files = []\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.endswith('.py'):\n                file_path = os.path.join(root, file)\n                with open(file_path, 'r') as f:\n                    content = f.read().lower()\n                    if keyword in content:\n                        found_files.append(file_path)\n    return found_files\n", "entry_point": "search_keyword_in_files", "input": "'non_existent_keyword', '/path/to/empty_directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44245_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2537", "output": "{1, 43, 2537, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011198", "code": "import re\ndef is_valid_password(password):\n    # Check if the password length is at least 8 characters\n    if len(password) < 8:\n        return False\n    # Check if the password meets all criteria using regular expressions\n    if not re.search(r'[A-Z]', password) or not re.search(r'[a-z]', password) or not re.search(r'\\d', password) or not re.search(r'[!@#$%^&*]', password):\n        return False\n    return True\n", "entry_point": "is_valid_password", "input": "'short1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84984_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011199", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(10, 20, 30, 40, 50, 60)", "output": "(60, 50, 40, 30, 20, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011200", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "11", "output": "[(1, 11), (11, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011201", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[100, 101, 102]", "output": "102", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011202", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[31.2, 31.24]", "output": "31.22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011203", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'world'", "output": "{'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55166_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011204", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'abcdge.png'", "output": "'ge.png'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011205", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011206", "code": "import re\ndef count_word_occurrences(text):\n    word_count = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_word_occurrences", "input": "'iaxtxetxt'", "output": "{'iaxtxetxt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90305_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011207", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[4, 2, 6, 1, 6, 2, 2]", "output": "[4, 2, 6, 1, 6, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011208", "code": "def find_common_elements(lista1: list, lista2: list) -> list:\n    common_elements = [x for x in lista1 for y in lista2 if x == y]\n    return list(set(common_elements))\n", "entry_point": "find_common_elements", "input": "[1, 2, 3], [4, 5, 6]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57850_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011209", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[0, 3, 5, 4, 3, 1, 3, 3, 4]", "output": "[3, 8, 9, 7, 4, 4, 6, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011210", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[0, 5, 5, 13, 5, -1, 20, 13]", "output": "[5, 0, 8, -8, -6, 21, -7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011211", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9451", "output": "{1, 9451, 13, 727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011212", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "62, 1", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011213", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'myCustomName'", "output": "'myCustomName'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011214", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'   llo,   '", "output": "'llo,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011215", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'1..README1', '11111.1.1'", "output": "{'11111.1.1': '1..README1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011216", "code": "def replace_non_bmp_chars(input_string: str, replacement_char: str) -> str:\n    return ''.join(replacement_char if ord(char) > 0xFFFF else char for char in input_string)\n", "entry_point": "replace_non_bmp_chars", "input": "'\ud800\udc00', 'H'", "output": "'H'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91568_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011217", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(12, 0, 12, 11, 4, 2, 9, 0, 12)", "output": "'12.0.12.11.4.2.9.0.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011218", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8912", "output": "{1, 2, 4, 4456, 8, 557, 8912, 16, 2228, 1114}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8911", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011219", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'hello world && (solr query)'", "output": "'hello\\\\ world\\\\ \\\\&&\\\\ \\\\(solr\\\\ query\\\\)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011220", "code": "def generate_indices(s):\n    modes = []\n    for i, c in enumerate(s):\n        modes += [i] * int(c)\n    return sorted(modes)\n", "entry_point": "generate_indices", "input": "'2233'", "output": "[0, 0, 1, 1, 2, 2, 2, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130187_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011221", "code": "def calculate_variance(data):\n    try:\n        if len(data) == 0:\n            raise ValueError(\"Empty data set provided\")\n        mean_value = sum(data) / len(data)\n        num_value = len(data)\n        sum_squared_diff = sum((x - mean_value) ** 2 for x in data)\n        return round(sum_squared_diff / num_value, 2)\n    except ZeroDivisionError:\n        print(\"Watch out: You're dividing by zero\")\n    except ValueError as e:\n        print(e)\n", "entry_point": "calculate_variance", "input": "[0, 2, 2, 4]", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76960_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011222", "code": "from typing import List\nimport itertools\ndef count_combinations(nums: List[int], length: int) -> int:\n    # Generate all combinations of the given length from the input list\n    all_combinations = list(itertools.combinations(nums, length))\n    # Return the total number of unique combinations\n    return len(all_combinations)\n", "entry_point": "count_combinations", "input": "[1, 2, 3, 4, 5, 6], 2", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6198_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011223", "code": "def reshape_tensor(sizes, new_order):\n    reshaped_sizes = []\n    for index in new_order:\n        reshaped_sizes.append(sizes[index])\n    return reshaped_sizes\n", "entry_point": "reshape_tensor", "input": "[6, 2, 4, 5, 1, 3], [0, 1, 1, 2, 0, 1, 0, 0]", "output": "[6, 2, 2, 4, 6, 2, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117209_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011224", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[2871], 1", "output": "2871", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011225", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 92, 91, 89, 88, 91, 92]", "output": "[99, 92, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148811_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011226", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'The KEF Wt.'", "output": "'Wt. KEF The'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011227", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 2, -6, 4, -6, 7]", "output": "[2, -4, -2, -2, 1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011228", "code": "def calculate_chunk_range(selection, chunks):\n    chunk_range = []\n    for s, l in zip(selection, chunks):\n        if isinstance(s, slice):\n            start_chunk = s.start // l\n            end_chunk = (s.stop - 1) // l\n            chunk_range.append(list(range(start_chunk, end_chunk + 1)))\n        else:\n            chunk_range.append([s // l])\n    return chunk_range\n", "entry_point": "calculate_chunk_range", "input": "[12, 12], [4, 4]", "output": "[[3], [3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128291_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4618", "output": "{1, 4618, 2, 2309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4617", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011230", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'aofaork'", "output": "'aofaork'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011231", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[1, 1, 3, 4, 2, 1, 0, 2]", "output": "[2, 4, 7, 6, 3, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117452_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011232", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'a6aah6'", "output": "'a6aah6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011233", "code": "from typing import List\ndef max_contiguous_sum(lst: List[int]) -> int:\n    max_sum = lst[0]\n    current_sum = lst[0]\n    for num in lst[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_contiguous_sum", "input": "[2, 3, 1, -1, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132431_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011234", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'22.03.2021'", "output": "'22.03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011235", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "2097156, 1", "output": "4194312", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011236", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "61", "output": "'01:01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011237", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[10, 10], [12]]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011238", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[304]", "output": "304.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011239", "code": "SCRABBLE_LETTER_VALUES = {\n    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8,\n    'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1,\n    'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10\n}\ndef calculate_word_score(word, n):\n    if len(word) == 0:\n        return 0\n    wordScore = 0\n    lettersUsed = 0\n    for theLetter in word:\n        wordScore += SCRABBLE_LETTER_VALUES[theLetter]\n        lettersUsed += 1\n    wordScore *= lettersUsed\n    if lettersUsed == n:\n        wordScore += 50\n    return wordScore\n", "entry_point": "calculate_word_score", "input": "'qz', 2", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38596_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011240", "code": "def sum_of_digits(num):\n    sum_digits = 0\n    # Loop to extract digits and sum them up\n    while num > 0:\n        digit = num % 10\n        sum_digits += digit\n        num //= 10\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "19", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55339_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011241", "code": "def calculate_sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum_multiples", "input": "15", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15183_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011242", "code": "def calculate_income_expenses(transactions):\n    total_income = 0\n    total_expenses = 0\n    for transaction in transactions:\n        if 'description' in transaction and 'amount' in transaction and 'category' in transaction:\n            try:\n                amount = float(transaction['amount'])\n            except ValueError:\n                continue\n            if transaction['category'] == 'inc':\n                total_income += amount\n            elif transaction['category'] == 'exp':\n                total_expenses += amount\n    return total_income, total_expenses\n", "entry_point": "calculate_income_expenses", "input": "[]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67734_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011243", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011244", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011245", "code": "def count_players(scores, min_score):\n    count = 0\n    for score in scores:\n        if score < min_score:\n            break\n        count += 1\n    return count\n", "entry_point": "count_players", "input": "[55, 65, 45], 50", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6144_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011246", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "',,'", "output": "{',': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15027_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011247", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[10, 20, 20]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011248", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "0, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011249", "code": "def find_second_smallest(nums):\n    if len(nums) < 2:\n        return None\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif smallest < num < second_smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[5, 8, 10]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14329_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011250", "code": "def largest_rectangle_area(histogram):\n    stack = []\n    max_area = 0\n    index = 0\n    while index < len(histogram):\n        if not stack or histogram[index] >= histogram[stack[-1]]:\n            stack.append(index)\n            index += 1\n        else:\n            top = stack.pop()\n            area = histogram[top] * ((index - stack[-1] - 1) if stack else index)\n            max_area = max(max_area, area)\n    while stack:\n        top = stack.pop()\n        area = histogram[top] * ((index - stack[-1] - 1) if stack else index)\n        max_area = max(max_area, area)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[3, 3, 3]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29850_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011251", "code": "import re\nfrom collections import Counter\ndef find_phone(text):\n    return re.findall(r'\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b', text)\n", "entry_point": "find_phone", "input": "'Hello, this is a test message!'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73946_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011252", "code": "import math\ndef farthest_distance(points):\n    max_distance = 0.0\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i][\"x\"], points[i][\"y\"]\n            x2, y2 = points[j][\"x\"], points[j][\"y\"]\n            distance = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            max_distance = max(max_distance, distance)\n    return max_distance\n", "entry_point": "farthest_distance", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100387_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011253", "code": "from typing import List\ndef max_contiguous_sum(lst: List[int]) -> int:\n    max_sum = lst[0]\n    current_sum = lst[0]\n    for num in lst[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_contiguous_sum", "input": "[3, 4, 5]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132431_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011254", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'rise/run'", "output": "'rise/run'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7561", "output": "{1, 7561}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011256", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'ssis'", "output": "'Tweet posted successfully: ssis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3853", "output": "{1, 3853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7453", "output": "{1, 29, 7453, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011259", "code": "def remove_min_parentheses(s):\n    if not s:\n        return \"\"\n    s = list(s)\n    stack = []\n    for i, char in enumerate(s):\n        if char == \"(\":\n            stack.append(i)\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                s[i] = \"\"\n    while stack:\n        s[stack.pop()] = \"\"\n    return \"\".join(s)\n", "entry_point": "remove_min_parentheses", "input": "'()((()))'", "output": "'()((()))'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35267_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011260", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'croypcto'", "output": "\"Operation type 'croypcto' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011261", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6951", "output": "{1, 993, 3, 7, 6951, 331, 2317, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4217", "output": "{1, 4217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011263", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9749", "output": "{1, 9749}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011264", "code": "def binary_search(target, lst):\n    low = 0\n    high = len(lst) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if lst[mid] == target:\n            return mid\n        elif lst[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return low\n", "entry_point": "binary_search", "input": "9, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43298_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011265", "code": "def generate_network_manifest(static_cache_manifest: str, home_cache_manifest: str, static_network_manifest: str) -> str:\n    return static_cache_manifest + home_cache_manifest + static_network_manifest + '*\\n'\n", "entry_point": "generate_network_manifest", "input": "'/stae', '//he', '**NETWTOR'", "output": "'/stae//he**NETWTOR*\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75037_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011266", "code": "from typing import List\ndef max_difference_after(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    min_element = nums[0]\n    max_difference = 0\n    for num in nums[1:]:\n        difference = num - min_element\n        if difference > max_difference:\n            max_difference = difference\n        if num < min_element:\n            min_element = num\n    return max_difference\n", "entry_point": "max_difference_after", "input": "[0, 1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72615_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011267", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2799", "output": "{1, 3, 933, 9, 2799, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011268", "code": "import re\ndef filter_alphanumeric(strings):\n    result = []\n    for s in strings:\n        if re.match(r\"^[a-zA-Z0-9]+$\", s):\n            result.append(s)\n    return result\n", "entry_point": "filter_alphanumeric", "input": "['!', ' ', '@#%', '   ']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99672_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011269", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[3, 4, -1, 7, 5, 3, 4, 5]", "output": "[3, 4, -1, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2847", "output": "{1, 3, 39, 73, 13, 949, 219, 2847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011271", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[1, 2, 3]", "output": "'1, 2, 3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011272", "code": "import re\ndef extract_entities(input_str):\n    entities = set()\n    lines = input_str.split('\\n')\n    for line in lines:\n        match = re.match(r'\\w+\\((\\w+)\\)\\.', line)\n        if match:\n            entities.add(match.group())\n        match = re.match(r'\\w+\\((\\w+)\\) :-', line)\n        if match:\n            entities.add(match.group())\n        matches = re.findall(r'\\w+\\((\\w+)\\)', line)\n        entities.update(matches)\n    return entities\n", "entry_point": "extract_entities", "input": "''", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72426_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011273", "code": "def calculate_max_vertical_deviation(image_dims, ground_truth_horizon, detected_horizon):\n    width, height = image_dims\n    def gt(x):\n        return ground_truth_horizon[0] * x + ground_truth_horizon[1]\n    def dt(x):\n        return detected_horizon[0] * x + detected_horizon[1]\n    if ground_truth_horizon is None or detected_horizon is None:\n        return None\n    max_deviation = max(abs(gt(0) - dt(0)), abs(gt(width) - dt(width)))\n    normalized_deviation = max_deviation / height\n    return normalized_deviation\n", "entry_point": "calculate_max_vertical_deviation", "input": "(30, 30), (0, 10), (0, 23)", "output": "0.43333333333333335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_623_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011274", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[12, 0], [0, -12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111620_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011275", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'Hello hello world'", "output": "{'hello': 2, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011276", "code": "def find_common_elements(list1, list2):\n    # Find the common elements between the two lists using set intersection\n    common_elements = list(set(list1) & set(list2))\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 4, 5, 6], [4, 5, 7, 8]", "output": "[4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146440_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011277", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'1.51.5'", "output": "(1, 51, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011278", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, 20", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4137", "output": "{1, 3, 1379, 197, 7, 4137, 591, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011280", "code": "def parse_allowed_tags(input_string):\n    tag_dict = {}\n    tag_list = input_string.split()\n    for tag in tag_list:\n        tag_parts = tag.split(':')\n        tag_name = tag_parts[0]\n        attributes = tag_parts[1:] if len(tag_parts) > 1 else []\n        tag_dict[tag_name] = attributes\n    return tag_dict\n", "entry_point": "parse_allowed_tags", "input": "'strong:ul'", "output": "{'strong': ['ul']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14310_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011281", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[8, 10, 2, 5, 8, 2, 9, 8, 4]", "output": "[64, 100, 4, 10, 64, 4, 729, 64, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7893", "output": "{1, 3, 2631, 9, 877, 7893}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011283", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[3, 5, 3, 1, 3, 5, 3, 3]", "output": "[1, 3, 3, 3, 3, 3, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011284", "code": "def count_subarrays(N, S, array):\n    count = 0\n    window_sum = 0\n    start = 0\n    for end in range(N):\n        window_sum += array[end]\n        while window_sum > S:\n            window_sum -= array[start]\n            start += 1\n        if window_sum == S:\n            count += 1\n    return count\n", "entry_point": "count_subarrays", "input": "0, 0, []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148612_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011285", "code": "def extract_environment_variables(code_snippet):\n    env_variables = []\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if '=' in line:\n            parts = line.split('=')\n            variable_name = parts[0].strip()\n            if variable_name.isupper() and variable_name.endswith('_ENV'):\n                env_variables.append(variable_name)\n    return env_variables\n", "entry_point": "extract_environment_variables", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70097_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011286", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'woHello wldrld!'", "output": "'woHello                                 wldrld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011287", "code": "def has_balanced_delimiters(contents: str) -> bool:\n    stack = []\n    opening_delimiters = \"({[\"\n    closing_delimiters = \")}]\"\n    delimiter_pairs = {')': '(', '}': '{', ']': '['}\n    for char in contents:\n        if char in opening_delimiters:\n            stack.append(char)\n        elif char in closing_delimiters:\n            if not stack or stack[-1] != delimiter_pairs[char]:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "has_balanced_delimiters", "input": "')'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105254_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011288", "code": "from typing import List, Dict\ndef count_module_occurrences(module_list: List[str]) -> Dict[str, int]:\n    module_counts = {}\n    for module in module_list:\n        module_lower = module.lower()\n        module_counts[module_lower] = module_counts.get(module_lower, 0) + 1\n    return module_counts\n", "entry_point": "count_module_occurrences", "input": "['modmmdulmemm1le', 'ModMMDULMEMM1LE']", "output": "{'modmmdulmemm1le': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103440_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011289", "code": "from typing import List\ndef count_unique_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    unique_primes = set()\n    for num in numbers:\n        if is_prime(num):\n            unique_primes.add(num)\n    return len(unique_primes)\n", "entry_point": "count_unique_primes", "input": "[2, 3, 5, 7, 11, 13, 17, 19, 23]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44678_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011290", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'sound'", "output": "'Value of sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011291", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "3", "output": "19567.87924100512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011292", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[85, 90, 90, 91, 95]", "output": "90.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78318_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011293", "code": "def group_strings_by_first_char(strings):\n    grouped_strings = {}\n    for string in strings:\n        first_char = string[0].lower()\n        if first_char in grouped_strings:\n            grouped_strings[first_char].append(string)\n        else:\n            grouped_strings[first_char] = [string]\n    return grouped_strings\n", "entry_point": "group_strings_by_first_char", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100133_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011294", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for i in range(len(arr1)):\n        total_diff += abs(arr1[i] - arr2[i])\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[10, 15], [0, 5]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136179_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011295", "code": "import string\ndef count_word_frequency(file_content):\n    word_freq = {}\n    text = file_content.lower()\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'texta'", "output": "{'texta': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3322_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011296", "code": "def sum_of_digit_squares(n: int) -> int:\n    total_sum = 0\n    for digit in str(n):\n        total_sum += int(digit) ** 2\n    return total_sum\n", "entry_point": "sum_of_digit_squares", "input": "53", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47266_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011297", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[30, 30, 30]", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011298", "code": "from typing import List, Dict\ndef process_scan_images(objects: List[str]) -> Dict[str, List[str]]:\n    channel_objects = {}\n    for obj in objects:\n        channel, obj_name = obj.split('/')\n        if channel in channel_objects:\n            channel_objects[channel].append(obj_name)\n        else:\n            channel_objects[channel] = [obj_name]\n    return channel_objects\n", "entry_point": "process_scan_images", "input": "['ch1/c', 'channel2/obj4']", "output": "{'ch1': ['c'], 'channel2': ['obj4']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92717_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8678", "output": "{1, 2, 4339, 8678}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011300", "code": "algorithm_map = {\n    'RS256': 'sha256',\n    'RS384': 'sha384',\n    'RS512': 'sha512',\n}\ndef get_hash_algorithm(algorithm_name):\n    return algorithm_map.get(algorithm_name, 'Algorithm not found')\n", "entry_point": "get_hash_algorithm", "input": "'RS384'", "output": "'sha384'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98777_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011301", "code": "def generate_output_muon_container(muon_container: str, muon_working_point: str, muon_isolation: str) -> str:\n    return f\"{muon_container}Calib_{muon_working_point}{muon_isolation}_%SYS%\"\n", "entry_point": "generate_output_muon_container", "input": "'totoioMuleMuon', 'gg', 'TtTgihTTT'", "output": "'totoioMuleMuonCalib_ggTtTgihTTT_%SYS%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69025_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5429", "output": "{89, 1, 61, 5429}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011303", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9942", "output": "{1, 2, 3, 6, 4971, 3314, 9942, 1657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9941", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011304", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "1.0, 14.0, 100", "output": "(1.0, 0.02142857142857143)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011305", "code": "def generate_fibonacci_numbers(limit):\n    fibonacci_numbers = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_numbers.append(a)\n        a, b = b, a + b\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci_numbers", "input": "3", "output": "[0, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30929_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6926", "output": "{1, 2, 6926, 3463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011307", "code": "def fibonacci_iterative(num):\n    if num <= 0:\n        return None\n    if num == 1:\n        return 0\n    if num == 2:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, num):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci_iterative", "input": "4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73606_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011308", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[[1.3, 2.0], [3.0]]", "output": "6.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1158", "output": "{1, 2, 3, 579, 386, 1158, 6, 193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011310", "code": "def get_field_values(transactions, field_name):\n    field_values = []\n    for transaction in transactions:\n        if field_name in transaction:\n            field_values.append(transaction[field_name])\n    return field_values\n", "entry_point": "get_field_values", "input": "[], 'status'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67708_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011311", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0 and num % 3 == 0:\n            modified_list.append(num * 5)\n        elif num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:\n            modified_list.append(num ** 3)\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 2, -2, 1, 2]", "output": "[1, 4, 4, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2885_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011312", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'1.10.52.2'", "output": "(1, 10, 52, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011313", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "2, 3, 4", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011314", "code": "from typing import List\ndef two_sum(nums: List[int], target: int) -> List[int]:\n    seen = {}  # Dictionary to store elements and their indices\n    for idx, num in enumerate(nums):\n        complement = target - num\n        if complement in seen:\n            return [seen[complement], idx]\n        seen[num] = idx\n    return []\n", "entry_point": "two_sum", "input": "[1, 2, 3, 4, 5, 7], 10", "output": "[2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50190_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011315", "code": "# Define the error code mappings in the ret_dict dictionary\nret_dict = {\n    404: \"Not Found\",\n    500: \"Internal Server Error\",\n    403: \"Forbidden\",\n    400: \"Bad Request\"\n}\ndef response_string(code):\n    # Check if the error code exists in the ret_dict dictionary\n    return ret_dict.get(code, \"\uc815\ubcf4 \uc5c6\uc74c\")\n", "entry_point": "response_string", "input": "401", "output": "'\uc815\ubcf4 \uc5c6\uc74c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57903_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011316", "code": "def get_seq_len(sentence):\n    length = 0\n    for num in sentence:\n        length += 1\n        if num == 1:\n            break\n    return length\n", "entry_point": "get_seq_len", "input": "[0, 0, 0, 0, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87843_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011317", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:\n            modified_list.append(num + 10)\n        elif num % 2 != 0:\n            modified_list.append(num - 5)\n        if num % 5 == 0:\n            modified_list.append(num * 2)\n    return modified_list\n", "entry_point": "process_integers", "input": "[3, -6, 3, -6, 16, 8]", "output": "[-2, 4, -2, 4, 26, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39060_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011318", "code": "def get_unique_field_values(bib_data, field_name):\n    unique_values = set()\n    for entry in bib_data.get(\"entries\", []):\n        field_value = entry.get(field_name)\n        if field_value:\n            unique_values.add(field_value)\n    return list(unique_values)\n", "entry_point": "get_unique_field_values", "input": "{'entries': []}, 'some_field'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37528_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011319", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 94], 2", "output": "92.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59721_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011320", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(10, 8), fan='fan_in'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011321", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[1, 4, 4, 5]", "output": "{1: 1, 4: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011322", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "100, 2, 1", "output": "103", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011323", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 2, 7]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118081_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011324", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'heaawooswollr l'", "output": "{'heaawooswollr': 1, 'l': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011325", "code": "def calculate_average(num1, num2, num3):\n    total_sum = num1 + num2 + num3\n    average = total_sum / 3\n    return average\n", "entry_point": "calculate_average", "input": "20.0, 21.0, 21.0", "output": "20.666666666666668", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_179_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011326", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011327", "code": "def count_pairs_divisible_by_3(nums):\n    nums.sort()\n    l_count = 0\n    m_count = 0\n    result = 0\n    for num in nums:\n        if num % 3 == 1:\n            l_count += 1\n        elif num % 3 == 2:\n            m_count += 1\n    result += l_count * m_count  # Pairs where one element leaves remainder 1 and the other leaves remainder 2\n    result += (l_count * (l_count - 1)) // 2  # Pairs where both elements leave remainder 1\n    result += (m_count * (m_count - 1)) // 2  # Pairs where both elements leave remainder 2\n    return result\n", "entry_point": "count_pairs_divisible_by_3", "input": "[1, 4, 7, 10, 13, 16, 2, 5, 8]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47070_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011328", "code": "def sum_squared_differences(arr1, arr2):\n    if len(arr1) != len(arr2):\n        return \"Error: Arrays must have the same length\"\n    sum_sq_diff = sum((x - y) ** 2 for x, y in zip(arr1, arr2))\n    return sum_sq_diff\n", "entry_point": "sum_squared_differences", "input": "[5, 11, 20], [0, 6, 14]", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49431_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4", "output": "{1, 2, 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011330", "code": "def play_war_game(player1_deck, player2_deck):\n    rounds_played = 0\n    is_war = False\n    while player1_deck and player2_deck:\n        rounds_played += 1\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_deck.extend([card1, card2])\n        elif card2 > card1:\n            player2_deck.extend([card2, card1])\n        else:\n            is_war = True\n            war_cards = [card1, card2]\n            while is_war:\n                if len(player1_deck) < 4 or len(player2_deck) < 4:\n                    return f\"Both players ran out of cards after {rounds_played} rounds\"\n                for _ in range(3):\n                    war_cards.append(player1_deck.pop(0))\n                    war_cards.append(player2_deck.pop(0))\n                card1 = player1_deck.pop(0)\n                card2 = player2_deck.pop(0)\n                if card1 > card2:\n                    player1_deck.extend(war_cards)\n                    player1_deck.extend([card1, card2])\n                    is_war = False\n                elif card2 > card1:\n                    player2_deck.extend(war_cards)\n                    player2_deck.extend([card2, card1])\n                    is_war = False\n    if not player1_deck:\n        return f\"Player 2 wins after {rounds_played} rounds\"\n    else:\n        return f\"Player 1 wins after {rounds_played} rounds\"\n", "entry_point": "play_war_game", "input": "[1, 2, 4, 6, 7], [3, 5, 8, 9, 10]", "output": "'Player 2 wins after 5 rounds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58824_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011331", "code": "def determine_movement_direction(keys):\n    if keys[0]:  # UP key pressed\n        return \"UP\"\n    elif keys[1]:  # DOWN key pressed\n        return \"DOWN\"\n    elif keys[2]:  # LEFT key pressed\n        return \"LEFT\"\n    elif keys[3]:  # RIGHT key pressed\n        return \"RIGHT\"\n    else:\n        return \"STAY\"\n", "entry_point": "determine_movement_direction", "input": "[False, False, True, False]", "output": "'LEFT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103609_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011332", "code": "def get_config_value(config, key):\n    keys = key.split('.')\n    current = config\n    try:\n        for k in keys:\n            current = current[k]\n        return current\n    except (KeyError, TypeError):\n        return \"Key not found\"\n", "entry_point": "get_config_value", "input": "{'settings': {}}, 'settings.foo'", "output": "'Key not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82831_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011333", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "52", "output": "{1, 2, 4, 13, 52, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt51", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "77", "output": "{1, 11, 77, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt76", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011335", "code": "from typing import List\ndef rearrange_list(a_list: List[int]) -> int:\n    pivot = a_list[-1]\n    list_length = len(a_list)\n    for i in range(list_length - 2, -1, -1):  # Iterate from the second last element to the first\n        if a_list[i] > pivot:\n            a_list.insert(list_length, a_list.pop(i))  # Move the element to the right of the pivot\n    return a_list.index(pivot)\n", "entry_point": "rearrange_list", "input": "[2, 2, 2, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141863_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011336", "code": "import math\ndef calculate_result(x):\n    sinn = math.sin(math.radians(15))\n    son = math.exp(x) - 5 * x\n    mon = math.sqrt(x**2 + 1)\n    lnn = math.log(3 * x)\n    result = sinn + son / mon - lnn\n    return round(result, 10)\n", "entry_point": "calculate_result", "input": "5", "output": "21.7540806324", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26393_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011337", "code": "def generate_struct(data, state):\n    struct = []\n    for i in range(len(data)):\n        for j in range(len(data)):\n            if data[i][j] > 0:\n                struct.append([state[i], state[j], {'label': data[i][j]}])\n    return struct\n", "entry_point": "generate_struct", "input": "[[0, 0], [0, 0]], ['A', 'B']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12465_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011338", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<EMAIL>'", "output": "'<CENSORED>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9062", "output": "{1, 2, 197, 9062, 394, 46, 4531, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011340", "code": "def count_elements(input):\n    count = 0\n    for element in input:\n        if isinstance(element, list):\n            count += count_elements(element)\n        else:\n            count += 1\n    return count\n", "entry_point": "count_elements", "input": "[[1, 2], [3], [4, 5, 6], 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9884_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011341", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1451", "output": "{1, 1451}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011342", "code": "def bingo(array):\n    target_numbers = {2, 9, 14, 7, 15}\n    found_numbers = set(array)\n    count = 0\n    for num in target_numbers:\n        if num in found_numbers:\n            count += 1\n    if count == 5:\n        return \"WIN\"\n    else:\n        return \"LOSE\"\n", "entry_point": "bingo", "input": "[2, 9, 14, 7, 15]", "output": "'WIN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145571_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011343", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "2", "output": "'Invalid-Data'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011344", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[3, 2, 4, -1, -1, 1, 4, 5]", "output": "[3, 2, 4, -1, -1, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011345", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "24", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011346", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[3, 5, 4, 3, 5, 5, 5]", "output": "[37, 125, 16, 37, 125, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011347", "code": "def find_swap_indices(A):\n    tmp_min = idx_min = float('inf')\n    tmp_max = idx_max = -float('inf')\n    for i, elem in enumerate(reversed(A)):\n        tmp_min = min(elem, tmp_min)\n        if elem > tmp_min:\n            idx_min = i\n    for i, elem in enumerate(A):\n        tmp_max = max(elem, tmp_max)\n        if elem < tmp_max:\n            idx_max = i\n    idx_min = len(A) - 1 - idx_min\n    return [-1] if idx_max == idx_min else [idx_min, idx_max]\n", "entry_point": "find_swap_indices", "input": "[1, 2, 3, 5, 6, 7, 8, 9, 4]", "output": "[3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96522_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011348", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1737", "output": "{1, 193, 579, 3, 1737, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011349", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1756", "output": "{1, 2, 4, 878, 439, 1756}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1755", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011350", "code": "from math import acos, degrees\ndef find_triangle_angles(a, b, c):\n    if a + b > c and b + c > a and a + c > b:  # Triangle inequality theorem check\n        first_angle = round(degrees(acos((b ** 2 + c ** 2 - a ** 2) / (2 * b * c))))\n        second_angle = round(degrees(acos((a ** 2 + c ** 2 - b ** 2) / (2 * a * c))))\n        third_angle = 180 - first_angle - second_angle\n        return sorted([first_angle, second_angle, third_angle])\n    else:\n        return None\n", "entry_point": "find_triangle_angles", "input": "66, 83, 100", "output": "[41, 56, 83]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40430_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011351", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[25]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123355_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011352", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2524", "output": "{1, 2, 4, 1262, 631, 2524}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2523", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011353", "code": "def calculate_weighted_average(numbers, n_obs_train):\n    if n_obs_train == 0:\n        return 0  # Handling division by zero\n    weight = 1. / n_obs_train\n    weighted_sum = sum(numbers) * weight\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[0.24], 1", "output": "0.24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136723_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011354", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[0, 0, 0, 0, 1, 0, 0, 0]", "output": "[0, 1, 2, 3, 5, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7643", "output": "{1, 7643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011356", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'1.17.1'", "output": "(1, 17, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7397", "output": "{1, 13, 7397, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011358", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "[0, -1, 4], [3]", "output": "[0, -1, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011359", "code": "def next_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "next_semantic_version", "input": "'9.8.7'", "output": "'9.8.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143821_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011360", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "3.94, 2", "output": "1.97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011361", "code": "from typing import Union, List\ndef parse_driving_envs(driving_environments: str) -> Union[str, List[str]]:\n    driving_environments = driving_environments.split(',')\n    for driving_env in driving_environments:\n        if len(driving_env.split('_')) < 2:\n            raise ValueError(f'Invalid format for the driving environment {driving_env} (should be Suite_Town)')\n    if len(driving_environments) == 1:\n        return driving_environments[0]\n    return driving_environments\n", "entry_point": "parse_driving_envs", "input": "'Suite1_TownS'", "output": "'Suite1_TownS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141849_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011362", "code": "def assign_teams(candidates, team_capacities):\n    team_skill_levels = [0] * len(team_capacities)\n    assigned_teams = []\n    for candidate in candidates:\n        max_skill_team = None\n        max_skill = float('-inf')\n        for i, capacity in enumerate(team_capacities):\n            if team_skill_levels[i] + candidate <= capacity and team_skill_levels[i] > max_skill:\n                max_skill = team_skill_levels[i]\n                max_skill_team = i\n        if max_skill_team is None:\n            min_skill_team = team_skill_levels.index(min(team_skill_levels))\n            assigned_teams.append(min_skill_team)\n            team_skill_levels[min_skill_team] += candidate\n        else:\n            assigned_teams.append(max_skill_team)\n            team_skill_levels[max_skill_team] += candidate\n    return assigned_teams\n", "entry_point": "assign_teams", "input": "[5, 4, 3, 8, 6, 4], [15, 10, 12]", "output": "[0, 0, 0, 1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58063_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011363", "code": "def calculate_weighted_average(numbers, weights):\n    if len(numbers) != len(weights) or len(numbers) == 0:\n        raise ValueError(\"Input lists must have the same non-zero length\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    if total_weight == 0:\n        raise ValueError(\"Total weight cannot be zero\")\n    return weighted_sum / total_weight\n", "entry_point": "calculate_weighted_average", "input": "[6, 8], [2, 2]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131264_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011364", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "0, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011365", "code": "def sum_of_digit_squares(n: int) -> int:\n    total_sum = 0\n    for digit in str(n):\n        total_sum += int(digit) ** 2\n    return total_sum\n", "entry_point": "sum_of_digit_squares", "input": "211", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47266_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011366", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7621", "output": "{1, 7621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011367", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "'some_location', 12345", "output": "'https://www.fitx.de/fitnessstudios/12345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8054", "output": "{1, 2, 4027, 8054}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011369", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'Hello, world!'", "output": "['Hello,', 'world!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011370", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'11.1..L'", "output": "'11.1..L'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011371", "code": "def calculate_result(l, r):\n    count = 1\n    result = 0\n    while True:\n        l = int(l * r)\n        if l <= 5:\n            break\n        result += (2 ** count) * l\n        count += 1\n    return result\n", "entry_point": "calculate_result", "input": "5, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78073_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011372", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4751", "output": "{1, 4751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8552", "output": "{1, 2, 4, 8552, 8, 1069, 4276, 2138}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8551", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011374", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[4, 1, 3, 2, 3, 2, 4]", "output": "[16, 1, 27, 4, 27, 4, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1731", "output": "{3, 1, 1731, 577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011376", "code": "def count_numbers_with_same_first_last_digit(nums_str):\n    count = 0\n    for num_str in nums_str:\n        if num_str[0] == num_str[-1]:\n            count += 1\n    return count\n", "entry_point": "count_numbers_with_same_first_last_digit", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139447_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011377", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, -1, 1, 2, -2, 0, 2, -1]", "output": "[-1, 2, 6, -8, 0, 12, -7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011378", "code": "import re\nfrom typing import List\ndef extract_urls(text: str) -> List[str]:\n    url_rx = re.compile(r'https?://(?:www\\.)?.+')\n    return url_rx.findall(text)\n", "entry_point": "extract_urls", "input": "'Here is a link: http://anotherexample.com'", "output": "['http://anotherexample.com']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99895_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011379", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'config.addressapps.settings'", "output": "'addressapps'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011380", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "8, 14", "output": "[1, 1, 2, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011381", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5857", "output": "{1, 5857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011382", "code": "def count_unique_tags(tasks):\n    tag_counts = {}\n    for task in tasks:\n        tags = task.get('tags', [])\n        for tag in tags:\n            tag_counts[tag] = tag_counts.get(tag, 0) + 1\n    return tag_counts\n", "entry_point": "count_unique_tags", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118515_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011383", "code": "def min_operations_to_make_all_E(s: str) -> int:\n    n = len(s)\n    a = [0] * n\n    b = [0] * n\n    for i in range(1, n):\n        c = s[i]\n        if c == 'E':\n            a[i] = a[i - 1]\n        else:\n            a[i] = a[i - 1] + 1\n    if s[n - 1] == 'E':\n        b[n - 1] = 1\n    for i in range(n - 2, -1, -1):\n        c = s[i]\n        if c == 'W':\n            b[i] = b[i + 1]\n        else:\n            b[i] = b[i + 1] + 1\n    min_ops = n\n    for i in range(n):\n        min_ops = min(min_ops, a[i] + b[i])\n    return min_ops\n", "entry_point": "min_operations_to_make_all_E", "input": "'EEWEE'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143345_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011384", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'ehello world world hellol'", "output": "{'ehello': 1, 'world': 2, 'hellol': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8279", "output": "{1, 487, 17, 8279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011386", "code": "def process_help_section(path):\n    # Strip off the '/data/help/' part of the path\n    section = path.split('/', 3)[-1]\n    if section in ['install', 'overview', 'usage', 'examples', 'cloudhistory', 'changelog']:\n        return f\"Sending section: {section}\"\n    elif section.startswith('stage'):\n        stages_data = [{'name': stage_name, 'help': f\"Help for {stage_name}\"} for stage_name in ['stage1', 'stage2', 'stage3']]\n        return stages_data\n    else:\n        return f\"Could not find help section: {section}\"\n", "entry_point": "process_help_section", "input": "'/data/help/unew'", "output": "'Could not find help section: unew'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99964_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011387", "code": "def get_unique_ids(adet):\n    unique_ids = {}\n    current_id = 101  # Starting identifier value\n    for detector in adet:\n        unique_ids[detector] = current_id\n        current_id += 1\n    return unique_ids\n", "entry_point": "get_unique_ids", "input": "['DetectorBDeteDet']", "output": "{'DetectorBDeteDet': 101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102441_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011388", "code": "def jaccard_index(set1, set2):\n    intersection_size = len(set1 & set2)\n    union_size = len(set1 | set2)\n    if union_size == 0:\n        return 0.00\n    else:\n        jaccard = intersection_size / union_size\n        return round(jaccard, 2)\n", "entry_point": "jaccard_index", "input": "{1, 2}, {1, 2, 3, 4}", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9565_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011389", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[1, 32]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011390", "code": "def largest_prime_factor(n):\n    number = n\n    divider = 2\n    while number != 1:\n        if number % divider == 0:\n            number = number // divider\n        else:\n            divider += 1\n    return divider\n", "entry_point": "largest_prime_factor", "input": "733", "output": "733", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139210_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011391", "code": "def redirect_url(redirection_rules, source_url):\n    for rule in redirection_rules:\n        if rule[0] == source_url:\n            return rule[1]\n    return source_url\n", "entry_point": "redirect_url", "input": "[], '/home/he/home/hhe'", "output": "'/home/he/home/hhe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105613_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011392", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "7.5", "output": "176.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011393", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 10]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011394", "code": "import re\ndef generate_code(input_string):\n    words = input_string.split()\n    code = ''\n    for word in words:\n        first_letter = re.search(r'[a-zA-Z]', word)\n        if first_letter:\n            code += first_letter.group().lower()\n    return code\n", "entry_point": "generate_code", "input": "'Hello apple'", "output": "'ha'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30063_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011395", "code": "def parse_version(version_str):\n    # Split the version number string using the dot as the delimiter\n    version_parts = version_str.split('.')\n    # Convert the version number components to integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return a tuple containing the major, minor, and patch version numbers\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'2.13.0'", "output": "(2, 13, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42795_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011396", "code": "import os\ndef determine_file_location(relative_root: str, location_type: str, root_folder: str = '') -> str:\n    MS_DATA = os.getenv('MS_DATA', '')  # Get the value of MS_DATA environment variable or default to empty string\n    if location_type == 'LOCAL':\n        full_path = os.path.join(root_folder, relative_root)\n    elif location_type == 'S3':\n        full_path = os.path.join('s3://' + root_folder, relative_root)\n    else:\n        raise ValueError(\"Invalid location type. Supported types are 'LOCAL' and 'S3'.\")\n    return full_path\n", "entry_point": "determine_file_location", "input": "'file.txt', 'LOCAL', 'data'", "output": "'data/file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7795_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011397", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "-455", "output": "-554", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011398", "code": "def balancedSums(arr):\n    total_sum = sum(arr)\n    left_sum = 0\n    for i in range(len(arr)):\n        total_sum -= arr[i]\n        if left_sum == total_sum:\n            return i\n        left_sum += arr[i]\n    return -1\n", "entry_point": "balancedSums", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101017_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011399", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "'Hello'", "output": "'<p>Hello</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011400", "code": "def max_triangle_weight(triangle, level=0, index=0):\n    if level == len(triangle) - 1:\n        return triangle[level][index]\n    else:\n        return triangle[level][index] + max(\n            max_triangle_weight(triangle, level + 1, index),\n            max_triangle_weight(triangle, level + 1, index + 1)\n        )\n", "entry_point": "max_triangle_weight", "input": "[[1], [1, 1], [1, 0, 3]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011401", "code": "def make_2D_custom(X, y=0):\n    if isinstance(X, list):\n        if all(isinstance(elem, list) for elem in X):\n            if len(X[0]) == 1:\n                X = [[elem[0], y] for elem in X]\n            return X\n        else:\n            X = [[elem, y] for elem in X]\n            return X\n    elif isinstance(X, int) or isinstance(X, float):\n        X = [[X, y]]\n        return X\n    else:\n        return X\n", "entry_point": "make_2D_custom", "input": "[[], [], [], [], [], [], []]", "output": "[[], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106690_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011402", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{ apple , banana , cherr }'", "output": "['apple', 'banana', 'cherr']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3431", "output": "{73, 1, 47, 3431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6647", "output": "{1, 289, 6647, 391, 17, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011405", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4945", "output": "{1, 5, 43, 4945, 115, 23, 215, 989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011406", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[9, 18, 36, 45], 9", "output": "108", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011407", "code": "def count_students_above_threshold(scores, threshold):\n    low, high = 0, len(scores) - 1\n    while low <= high:\n        mid = low + (high - low) // 2\n        if scores[mid] <= threshold:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return len(scores) - low\n", "entry_point": "count_students_above_threshold", "input": "[50, 60, 70, 80, 90, 100], 70", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107830_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011408", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            new_pos = ord(char) + shift\n            if new_pos > ord('z'):\n                new_pos = new_pos - 26  # Wrap around the alphabet\n            encrypted_text += chr(new_pos)\n        else:\n            encrypted_text += char  # Keep non-letter characters unchanged\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'olloefglssv', 0", "output": "'olloefglssv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55105_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1791", "output": "{1, 3, 199, 9, 597, 1791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3467", "output": "{1, 3467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011411", "code": "def FindPairsWithSum(Arr, Total):\n    pairs = []\n    seen = {}\n    for x in Arr:\n        diff = Total - x\n        if diff in seen:\n            pairs.append((x, diff))\n        seen[x] = True\n    return pairs\n", "entry_point": "FindPairsWithSum", "input": "[2, 3], 5", "output": "[(3, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121436_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011412", "code": "def has_odd_and_even(nums):\n    has_odd = False\n    has_even = False\n    for num in nums:\n        if num % 2 == 0:\n            has_even = True\n        else:\n            has_odd = True\n        if has_odd and has_even:\n            return True\n    return False\n", "entry_point": "has_odd_and_even", "input": "[1, 3, 5, 7]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71944_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011413", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(1, 3, 3, 1, 1, 4, 1, 3, 2)", "output": "(2, 3, 3, 1, 1, 4, 1, 3, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011414", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'toxt'", "output": "('toxt', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6681", "output": "{1, 3, 131, 393, 17, 2227, 51, 6681}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011416", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011417", "code": "def queryProcessed(ele, arr):\n    for var in arr:\n        if ele == var:\n            return True\n    return False\n", "entry_point": "queryProcessed", "input": "3, [1, 2, 3, 4]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49833_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011418", "code": "def process_api_key(api_key_source):\n    if api_key_source == \"bearer\":\n        # Placeholder validation logic for bearer token\n        return True\n    elif api_key_source == \"query\":\n        # Placeholder validation logic for query parameter\n        return True\n    elif api_key_source == \"header\":\n        # Placeholder validation logic for header\n        return True\n    else:\n        return False\n", "entry_point": "process_api_key", "input": "'invalid'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20910_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011419", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[0, 0, 0], [6, 6, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011420", "code": "def file_linear_byte_offset(values, factor, coefficients):\n    total_sum = sum(value * multiplier * coefficient for value, multiplier, coefficient in zip(values, [1] * len(values), coefficients))\n    return total_sum * factor\n", "entry_point": "file_linear_byte_offset", "input": "[5, 5, 5, 5], 10.6, [10, 10, 10, 10]", "output": "2120.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121000_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011421", "code": "def my_pow(x: float, n: int) -> float:\n    if n == 0:\n        return 1\n    result = my_pow(x*x, abs(n) // 2)\n    if n % 2:\n        result *= x\n    if n < 0:\n        return 1 / result\n    return result\n", "entry_point": "my_pow", "input": "2.0, 2", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125524_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011422", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9434", "output": "{1, 2, 106, 4717, 178, 53, 89, 9434}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9433", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011423", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'0 x x 8 x x 0'", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011424", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 3, 3, 4, 2, 4]", "output": "[0, 1, 2, 3, 3, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011425", "code": "def is_valid_layer_sequence(layers):\n    for i in range(len(layers) - 1):\n        if layers[i] == layers[i + 1]:\n            return False\n    return True\n", "entry_point": "is_valid_layer_sequence", "input": "[1, 2]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48211_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011426", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'heellweor'", "output": "{'heellweor': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011427", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "30", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011428", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "460", "output": "{1, 2, 4, 5, 230, 10, 460, 46, 115, 20, 23, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt459", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011429", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[5, 7, 11, 5, 7]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011430", "code": "def min_energy(energies):\n    min_energy_required = 0\n    current_energy = 0\n    for energy in energies:\n        current_energy += energy\n        if current_energy < 0:\n            min_energy_required += abs(current_energy)\n            current_energy = 0\n    return min_energy_required\n", "entry_point": "min_energy", "input": "[-5, 1, -7, 2]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78421_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011431", "code": "def extract_app_name(config_class_str):\n    # Find the index of 'name =' in the input string\n    name_index = config_class_str.find(\"name =\")\n    # Extract the substring starting from the app name\n    app_name_start = config_class_str.find(\"'\", name_index) + 1\n    app_name_end = config_class_str.find(\"'\", app_name_start)\n    # Return the extracted app name\n    return config_class_str[app_name_start:app_name_end]\n", "entry_point": "extract_app_name", "input": "\"config = { 'name = 'ArkFundConfig(AConfi)'; }\"", "output": "'ArkFundConfig(AConfi)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66687_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011432", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "5, 4", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011433", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[5, 6, 10, 8, 12, 7], 6", "output": "[10, 8, 12, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011434", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[3, 2, 19, 3, 18, 13, 17, 10, 14]", "output": "[5, 21, 22, 21, 31, 30, 27, 24, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011435", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_number = 0\n    for num in nums:\n        single_number ^= num\n    return single_number\n", "entry_point": "find_single_number", "input": "[1, 1, 2, 3, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48428_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "63", "output": "{1, 3, 7, 9, 21, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt62", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011437", "code": "# Dictionary mapping genetic analyzer names to their types\ngenetic_analyzers = {\n    \"NextSeq 550\": \"ILLUMINA_NETSEQ_550\",\n    \"PacBio RS\": \"PACBIO_RS\",\n    \"PacBio RS II\": \"PACBIO_RS2\",\n    \"Sequel\": \"PACBIO_SEQEL\",\n    \"Ion Torrent PGM\": \"IONTORRENT_PGM\",\n    \"Ion Torrent Proton\": \"IONTORRENT_PROTON\",\n    \"Ion Torrent S5\": \"IONTORRENT_S5\",\n    \"Ion Torrent S5 XL\": \"IONTORRENT_S5XL\",\n    \"AB 3730xL Genetic Analyzer\": \"ABI_AB3730XL\",\n    \"AB 3730 Genetic Analyzer\": \"ABI_AB3730\",\n    \"AB 3500xL Genetic Analyzer\": \"ABI_AB3500XL\",\n    \"AB 3500 Genetic Analyzer\": \"ABI_AB3500\",\n    \"AB 3130xL Genetic Analyzer\": \"ABI_AB3130XL\",\n    \"AB 3130 Genetic Analyzer\": \"ABI_AB3130\",\n    \"AB 310 Genetic Analyzer\": \"ABI_AB310\"\n}\ndef get_genetic_analyzer_type(name):\n    return genetic_analyzers.get(name, \"Unknown Analyzer\")\n", "entry_point": "get_genetic_analyzer_type", "input": "'PacBio RS'", "output": "'PACBIO_RS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15803_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011438", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'3.2.5'", "output": "'3.2.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011439", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'1 + 2'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011440", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[3, 9, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011441", "code": "from collections import Counter\ndef calculate_chrf_score(hyp, ref, n):\n    def get_ngrams(sentence, n):\n        return [sentence[i:i+n] for i in range(len(sentence) - n + 1)]\n    hyp_ngrams = Counter(get_ngrams(hyp, n))\n    ref_ngrams = Counter(get_ngrams(ref, n))\n    common_ngrams = hyp_ngrams & ref_ngrams\n    precision = sum(common_ngrams.values()) / max(sum(hyp_ngrams.values()), 1)\n    recall = sum(common_ngrams.values()) / max(sum(ref_ngrams.values()), 1)\n    chrf_score = 2 * (precision * recall) / max((precision + recall), 1e-6)  # Avoid division by zero\n    return chrf_score\n", "entry_point": "calculate_chrf_score", "input": "'abc', 'xyz', 1", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80306_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011442", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[3, 1, 3, 2, 3, 5, 6]", "output": "[6, 5, 3, 3, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011443", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[1, 2, 3, 4, 3, 4, 6, 6]", "output": "3.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011444", "code": "def extract_primitive_key_values(d):\n    if not d or not isinstance(d, (dict, list)):\n        return []\n    key_values = []\n    if isinstance(d, dict):\n        for key, value in d.items():\n            if isinstance(key, (str, int, float)) and isinstance(value, (str, int, float)):\n                key_values.append((key, value))\n            elif isinstance(value, (dict, list)):\n                key_values.extend(extract_primitive_key_values(value))\n    elif isinstance(d, list):\n        for item in d:\n            if isinstance(item, (str, int, float)):\n                key_values.append(('item', item))\n            elif isinstance(item, (dict, list)):\n                key_values.extend(extract_primitive_key_values(item))\n    return key_values\n", "entry_point": "extract_primitive_key_values", "input": "['reading', 'painting']", "output": "[('item', 'reading'), ('item', 'painting')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8736_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011445", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[12, 11, 24, 11, 62, 13]", "output": "[11, 11, 12, 13, 24, 62]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011446", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[-11]", "output": "-11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "933", "output": "{1, 3, 933, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011448", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i] + input_list[i+1])\n        elif i == len(input_list) - 1:\n            output_list.append(input_list[i-1] + input_list[i])\n        else:\n            output_list.append(input_list[i-1] + input_list[i] + input_list[i+1])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[2, 4, 1]", "output": "[6, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13642_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011449", "code": "WINDOWS_PORTS = ['TEST', 'FOO', 'COM0', 'COM1', 'COM2', 'COM3', 'tty']\nMAC_PORTS = ['/dev/tty', '/dev/cu.usb', '/dev/tty.usbmodem0', '/dev/tty.usbmodem1', '/dev/tty.usbmodem2', '/dev/tty.usbmodem3']\nLINUX_PORTS = ['/dev/Bluetooth', '/dev/foo', '/dev/cu.ACM0', '/dev/cu.ACM1', '/dev/cu.ACM2', '/dev/cu.ACM3']\nNO_PORTS = ['/dev/tty', 'COMX', '/dev/tty.usbmodem', 'foo']\ndef get_available_ports(os_type):\n    if os_type.lower() == 'windows':\n        return [port for port in WINDOWS_PORTS if port.startswith('COM') or port.startswith('tty')]\n    elif os_type.lower() == 'mac':\n        return [port for port in MAC_PORTS]\n    elif os_type.lower() == 'linux':\n        return [port for port in LINUX_PORTS]\n    else:\n        return []\n", "entry_point": "get_available_ports", "input": "'android'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66089_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011450", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[5, 4, 3, 4, 1, 4, 5]", "output": "[1, 9, 7, 7, 5, 5, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011451", "code": "def calculate_training_time(start_time, end_time):\n    start_h, start_m, start_s = map(int, start_time.split(':'))\n    end_h, end_m, end_s = map(int, end_time.split(':'))\n    total_seconds_start = start_h * 3600 + start_m * 60 + start_s\n    total_seconds_end = end_h * 3600 + end_m * 60 + end_s\n    training_time_seconds = total_seconds_end - total_seconds_start\n    return training_time_seconds\n", "entry_point": "calculate_training_time", "input": "'00:00:00', '03:42:01'", "output": "13321", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7459_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011452", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[11]", "output": "'0xb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011453", "code": "from collections import defaultdict\ndef most_frequent_date(dates):\n    date_freq = defaultdict(int)\n    for date in dates:\n        date_freq[date] += 1\n    max_freq = max(date_freq.values())\n    most_frequent_dates = [date for date, freq in date_freq.items() if freq == max_freq]\n    return min(most_frequent_dates)\n", "entry_point": "most_frequent_date", "input": "['202025', '202025', '202134']", "output": "'202025'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118940_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011454", "code": "def calculate_total_volume(Ly, qF, nStretch):\n    # Calculate the volume of the rectangular prism\n    volume = Ly * Ly * (nStretch * Ly)\n    # Calculate the filled volume based on the fill factor\n    filled_volume = volume * qF\n    # Calculate the total volume of the 3D object\n    total_volume = filled_volume * nStretch\n    return total_volume\n", "entry_point": "calculate_total_volume", "input": "0, 1, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90349_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011455", "code": "from typing import Dict, Set, Tuple\nHeightmap = Dict[Tuple[int, int], int]\nBasin = Set[Tuple[int, int]]\ndef find_basins(heightmap: Heightmap) -> Basin:\n    basins = set()\n    for (x, y), height in heightmap.items():\n        is_basin = True\n        for dx, dy in [(0, -1), (0, 1), (-1, 0), (1, 0)]:\n            neighbor_height = heightmap.get((x + dx, y + dy), float('inf'))\n            if neighbor_height <= height:\n                is_basin = False\n                break\n        if is_basin:\n            basins.add((x, y))\n    return basins\n", "entry_point": "find_basins", "input": "{}", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2080_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011456", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'apple.appapple.banana'", "output": "'appapple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011457", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "6, 11", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011458", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4139", "output": "{1, 4139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011459", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'wor!ld!d'", "output": "'wor!ld!d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011460", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/home/home/h/ueu', 'filfffip/ima'", "output": "'/home/home/h/ueu/filfffip/ima'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011461", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'h'", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011462", "code": "def find_missing_number(arr):\n    n = len(arr)\n    sum_of_arr = sum(arr)\n    sum_of_n_no = (n * (n + 1)) // 2\n    missing_number = sum_of_n_no - sum_of_arr\n    return missing_number\n", "entry_point": "find_missing_number", "input": "list(range(0, 27)) + [28]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97333_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011463", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'FilenCPr/test'", "output": "'FilenCPr/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011464", "code": "from typing import List\ndef sum_within_ranges(lower_bounds: List[int]) -> int:\n    total_sum = 0\n    for i in range(len(lower_bounds) - 1):\n        start = lower_bounds[i]\n        end = lower_bounds[i + 1]\n        total_sum += sum(range(start, end))\n    total_sum += lower_bounds[-1]  # Add the last lower bound\n    return total_sum\n", "entry_point": "sum_within_ranges", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29413_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5858", "output": "{1, 5858, 2, 101, 202, 2929, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5857", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011466", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for i in range(len(arr1)):\n        total_diff += abs(arr1[i] - arr2[i])\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0, 0, 0], [29, 0, 0]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136179_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011467", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[8, 7, 8]", "output": "[8, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011468", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[92, 90, 88, 85, 84, 80]", "output": "[92, 90, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011469", "code": "def calculate_event_percentage(event_occurrences, event_index):\n    total_count = sum(event_occurrences)\n    if event_index < 0 or event_index >= len(event_occurrences):\n        return \"Invalid event index\"\n    event_count = event_occurrences[event_index]\n    percentage = (event_count / total_count) * 100\n    return percentage\n", "entry_point": "calculate_event_percentage", "input": "[2, 45], 0", "output": "4.25531914893617", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23800_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011470", "code": "def extract_author_name(code_snippet):\n    author_name = None\n    lines = code_snippet.split('\\n')\n    for line in lines:\n        if '__author__' in line:\n            author_name = line.split('=')[-1].strip().strip(\"'\\\"\")\n            break\n    return author_name\n", "entry_point": "extract_author_name", "input": "\"__author__ = '__author__'\"", "output": "'__author__'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94350_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011471", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[15, 5, 7, 15, 7, 5, 1]", "output": "[20, 12, 22, 22, 12, 6, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011472", "code": "def classify_temperatures(temperatures):\n    classifications = []\n    for temp in temperatures:\n        if temp > 100:\n            classifications.append('Steam')\n        elif temp < 0:\n            classifications.append('Ice')\n        else:\n            classifications.append('Water')\n    return classifications\n", "entry_point": "classify_temperatures", "input": "[101, 50, 102, 75, 90]", "output": "['Steam', 'Water', 'Steam', 'Water', 'Water']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29517_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011473", "code": "def extract_report_fields(report, fields):\n    extracted_data = {}\n    for line in report.split('\\n'):\n        if not line:\n            continue\n        record = line.split(',')\n        record_id = record[0]\n        extracted_values = [record[i] for i, field in enumerate(fields, start=1) if i < len(record)]\n        extracted_data[record_id] = extracted_values\n    return extracted_data\n", "entry_point": "extract_report_fields", "input": "'3,Ao,21\\n', ['Field1', 'Field2']", "output": "{'3': ['Ao', '21']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26286_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011474", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'Pmx Bone Importer'", "output": "'pmx_bone_importer.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011475", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011476", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9830", "output": "{1, 2, 5, 9830, 10, 1966, 4915, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9829", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011477", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[1, 2, 3, 4, 5], 2", "output": "{(2, 3), (4, 5), (1, 2), (3, 4)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011478", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'  oic  '", "output": "'oic'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011479", "code": "import os\nimport shutil\ndef manipulate_files(folder):\n    train_dir = os.path.join(folder, 'Images/train')\n    val_dir = os.path.join(folder, 'Images/val')\n    total_files = 0\n    if not os.path.exists(val_dir):\n        print(f\"Directory '{val_dir}' does not exist.\")\n        return total_files\n    for file in os.listdir(val_dir):\n        val_file_path = os.path.join(val_dir, file)\n        train_file_path = os.path.join(train_dir, file)\n        if not os.path.exists(train_file_path):\n            os.makedirs(train_file_path)\n        for sub_file in os.listdir(val_file_path):\n            shutil.move(os.path.join(val_file_path, sub_file), os.path.join(train_file_path, sub_file))\n    for folder in os.listdir(train_dir):\n        files = os.listdir(os.path.join(train_dir, folder))\n        total_files += len(files)\n    return total_files\n", "entry_point": "manipulate_files", "input": "'/path/to/folder'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27418_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011480", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[3510], 2", "output": "7020", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011481", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'r'", "output": "['r']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011482", "code": "from typing import List\ndef process_commands(commands: List[str]) -> int:\n    result = 0\n    for command in commands:\n        parts = command.split()\n        command_name = parts[0]\n        arguments = list(map(int, parts[1:]))\n        if command_name == 'add':\n            result += sum(arguments)\n        elif command_name == 'subtract':\n            result -= arguments[0]\n            for arg in arguments[1:]:\n                result -= arg\n        elif command_name == 'multiply':\n            result *= arguments[0]\n            for arg in arguments[1:]:\n                result *= arg\n    return result\n", "entry_point": "process_commands", "input": "['add 36']", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38199_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011483", "code": "def find_most_frequent_character(strings):\n    char_freq = {}\n    for string in strings:\n        for i, char in enumerate(string):\n            if char != '':  # Ignore empty positions\n                if i not in char_freq:\n                    char_freq[i] = {}\n                if char in char_freq[i]:\n                    char_freq[i][char] += 1\n                else:\n                    char_freq[i][char] = 1\n    result = ''\n    max_freq = 0\n    for pos in char_freq:\n        max_char = min(char_freq[pos], key=lambda x: (-char_freq[pos][x], x))\n        if char_freq[pos][max_char] > max_freq:\n            result = max_char\n            max_freq = char_freq[pos][max_char]\n    return result\n", "entry_point": "find_most_frequent_character", "input": "['dog', 'deed', 'deer', 'dive']", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108003_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9923", "output": "{1, 9923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011485", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[-2, 2, 1, 3, -2, 5, 6, 5, 0]", "output": "[-2, 3, 3, 6, 2, 10, 12, 12, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011486", "code": "def generate_unique_id(name):\n    # Convert the name to uppercase and remove spaces\n    modified_name = ''.join(char for char in name.upper() if char != ' ')\n    # Calculate the sum of ASCII values of characters in the modified name\n    unique_id = sum(ord(char) for char in modified_name)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'AAAAA K'", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79954_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011487", "code": "def reverse(input_str):\n    reversed_str = ''\n    for i in range(len(input_str) - 1, -1, -1):\n        reversed_str += input_str[i]\n    return reversed_str\n", "entry_point": "reverse", "input": "'racecar'", "output": "'racecar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77619_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011488", "code": "def longest_consecutive_primes(primes, n):\n    prime = [False, False] + [True] * (n - 1)\n    for i in range(2, int(n**0.5) + 1):\n        if prime[i]:\n            for j in range(i*i, n+1, i):\n                prime[j] = False\n    count = 0\n    ans = 0\n    for index, elem in enumerate(primes):\n        total_sum = 0\n        temp_count = 0\n        for i in range(index, len(primes)):\n            total_sum += primes[i]\n            temp_count += 1\n            if total_sum > n:\n                break\n            if prime[total_sum]:\n                if temp_count > count or (temp_count == count and primes[index] < ans):\n                    ans = total_sum\n                    count = temp_count\n    return ans, count\n", "entry_point": "longest_consecutive_primes", "input": "[5], 5", "output": "(5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91133_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011489", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[2, 4, 6, 1, 3, 5]", "output": "[2, 4, 6, 1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011490", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'123!123!!'", "output": "'123!123!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011491", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 2, 2, 1, 2, 3, 3, 4]", "output": "[4, 5, 5, 3, 3, 5, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011492", "code": "from typing import List\ndef filter_valid_modules(module_names: List[str]) -> List[str]:\n    __all__ = [\n        \"ProgressBar\",\n        \"read_config\",\n        \"has_package\",\n        \"package_of\",\n        \"package_python_version\"\n    ]\n    return [module for module in module_names if module in __all__]\n", "entry_point": "filter_valid_modules", "input": "['moduleA', 'moduleB', 'moduleC']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88541_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7077", "output": "{1, 3, 7077, 7, 337, 1011, 21, 2359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011494", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[0, 1, 3, 4, 5, 10]", "output": "[0, 2, 6, 8, 10, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011495", "code": "def generate_fibonacci_numbers(limit):\n    fibonacci_numbers = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_numbers.append(a)\n        a, b = b, a + b\n    return fibonacci_numbers\n", "entry_point": "generate_fibonacci_numbers", "input": "5", "output": "[0, 1, 1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30929_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011496", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "0", "output": "'Invalid Planet Number'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011497", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'/some/directory/idf.py'", "output": "'idf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8083", "output": "{1, 137, 8083, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011499", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[3, 5, 2, 1, 0, 6, 7]", "output": "[1, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011500", "code": "def process_data(input_data, properties):\n    array_name = properties.get('arrayName', '')\n    power = properties.get('power', 1.0)\n    sscale = properties.get('sscale', 1)\n    loop_count = properties.get('loop_count', 1)\n    target = properties.get('target', 0.0)\n    spread = properties.get('spread', 0.0)\n    processed_data = input_data.copy()\n    for _ in range(loop_count):\n        for i in range(len(processed_data)):\n            element = processed_data[i]\n            if array_name in element:\n                element_value = element[array_name]\n                modified_value = (element_value ** power) * sscale + spread\n                if modified_value > target:\n                    processed_data[i][array_name] = modified_value\n    return processed_data\n", "entry_point": "process_data", "input": "[{}, {}, {}, {}, {}], {'arrayName': 'some_key'}", "output": "[{}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87905_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011501", "code": "def solution(s):\n    start = 0\n    end = len(s) - 1\n    while start < len(s) and not s[start].isalnum():\n        start += 1\n    while end >= 0 and not s[end].isalnum():\n        end -= 1\n    return s[start:end+1]\n", "entry_point": "solution", "input": "'$%^ 12.def   !@#'", "output": "'12.def'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114817_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9714", "output": "{1, 2, 3, 3238, 6, 9714, 1619, 4857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011503", "code": "def model_properties(properties):\n    result = {}\n    for prop_name, prop_value in reversed(properties):\n        if prop_name not in result:\n            result[prop_name] = prop_value if prop_value is not None else None\n    return result\n", "entry_point": "model_properties", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46838_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011504", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8218", "output": "{1, 2, 7, 587, 4109, 14, 1174, 8218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8217", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011505", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[5, 11, 4, 'a', 3.14]", "output": "[5, 12, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011506", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[2, 1, 5, 1, 4, 3, 2, 6, 2]", "output": "[4, 1, 125, 1, 16, 27, 4, 36, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011507", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'{{'", "output": "'{{\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011508", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "11, 0", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011509", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[5, 4, 1, 5]", "output": "[5, 9, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011510", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'0.0.0-dev'", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011511", "code": "def count_unique_integers(input_list):\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108788_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011512", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2 and element not in common_elements:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 6, 4, 5], [5, 6, 4, 7, 8]", "output": "[6, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011513", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[-3, -5, -2, 7, 1]", "output": "[1, 7, 2, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011514", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[1, 3, 6, 1, 1, 4, 4, 4, 4], 4", "output": "[1, 3, 6, 1, 1, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011515", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'coenvert'", "output": "'coenvert'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011516", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 1, 4, 0, 4, 0, 2, 1]", "output": "[6, 5, 4, 4, 4, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89166_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011517", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[2, 4, 2, 3, 3, 0, 1, 1, 4, 0]", "output": "[2, 4, 3, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011518", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "4", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011519", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "1, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011520", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "10485745, 0", "output": "10485745", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011521", "code": "def get_voltage_level(voltage_value):\n    _cc_voltages = {6300: '5', 10000: '6', 16000: '7', 25000: '8', 50000: '9'}\n    if voltage_value in _cc_voltages:\n        return _cc_voltages[voltage_value]\n    else:\n        return 'Unknown'\n", "entry_point": "get_voltage_level", "input": "16000", "output": "'7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146269_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011522", "code": "def evaluate_expressions(expressions):\n    results = []\n    for expression in expressions:\n        result = eval(expression)\n        results.append(result)\n    return results\n", "entry_point": "evaluate_expressions", "input": "['6 + 6', '4 / 2', '3 - 2', '16 / 2', '7 / 2']", "output": "[12, 2.0, 1, 8.0, 3.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56248_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011523", "code": "from typing import List, Tuple\ndef classify_entries(line_numbers: List[int]) -> Tuple[List[int], List[int], List[int]]:\n    NOT_AN_ENTRY = set([\n        326, 330, 332, 692, 1845, 6016, 17859, 24005, 49675, 97466, 110519, 118045,\n        119186, 126386\n    ])\n    ALWAYS_AN_ENTRY = set([\n        12470, 17858, 60157, 60555, 60820, 75155, 75330, 77825, 83439, 84266,\n        94282, 97998, 102650, 102655, 102810, 102822, 102895, 103897, 113712,\n        113834, 119068, 123676\n    ])\n    always_starts_entry = [num for num in line_numbers if num in ALWAYS_AN_ENTRY]\n    never_starts_entry = [num for num in line_numbers if num in NOT_AN_ENTRY]\n    ambiguous_starts_entry = [num for num in line_numbers if num not in ALWAYS_AN_ENTRY and num not in NOT_AN_ENTRY]\n    return always_starts_entry, never_starts_entry, ambiguous_starts_entry\n", "entry_point": "classify_entries", "input": "[326, 330, 5, 4, 4, 3, 3, 4, 4]", "output": "([], [326, 330], [5, 4, 4, 3, 3, 4, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61128_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011524", "code": "import ast\ndef count_unique_functions(code: str) -> int:\n    tree = ast.parse(code)\n    function_names = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            function_names.add(node.name)\n    return len(function_names)\n", "entry_point": "count_unique_functions", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34257_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011525", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{}, -3", "output": "[-3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011526", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[3, 3, 2, 5, 5, 5, 4, 5], 0", "output": "[3, 3, 2, 5, 5, 5, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011527", "code": "def max_height(staircase):\n    max_height = 0\n    current_height = 0\n    for step in staircase:\n        if step == '+':\n            current_height += 1\n        elif step == '-':\n            current_height -= 1\n        max_height = max(max_height, current_height)\n    return max_height\n", "entry_point": "max_height", "input": "'++++++++++'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46647_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011528", "code": "def max_subset_sum_non_adjacent(arr):\n    inclusive = 0\n    exclusive = 0\n    for num in arr:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update inclusive as the sum of previous exclusive and current element\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[15, 1, 17]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38682_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011529", "code": "PROPAGATIONSPEED = 299792458.0\nIDLE = 0\nTRANSMIT = 1\ndef calculate_transmission_time(distance, state_device1, state_device2):\n    if state_device1 == IDLE or state_device2 == IDLE:\n        return float('inf')\n    transmission_time = distance / PROPAGATIONSPEED\n    return transmission_time\n", "entry_point": "calculate_transmission_time", "input": "1000000.0, 1, 1", "output": "0.0033356409519815205", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95165_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011530", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1687", "output": "{1, 7, 241, 1687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011531", "code": "def longest_palindromic_substring(s):\n    size = len(s)\n    if size < 2:\n        return s\n    dp = [[False for _ in range(size)] for _ in range(size)]\n    maxLen = 1\n    start = 0\n    for j in range(1, size):\n        for i in range(0, j):\n            if s[i] == s[j]:\n                if j - i <= 2:\n                    dp[i][j] = True\n                else:\n                    dp[i][j] = dp[i + 1][j - 1]\n            if dp[i][j]:\n                curLen = j - i + 1\n                if curLen > maxLen:\n                    maxLen = curLen\n                    start = i\n    return s[start : start + maxLen]\n", "entry_point": "longest_palindromic_substring", "input": "'xbababc'", "output": "'babab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74617_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011532", "code": "from typing import List\ndef _get_group_tags(large_groups: List[int], tag: str) -> List[str]:\n    \"\"\"Creates a list of tags to be used for the draw_tags function.\"\"\"\n    group_tags = [tag for _ in range(len(large_groups))]\n    return group_tags\n", "entry_point": "_get_group_tags", "input": "[1, 2, 3], 'group'", "output": "['group', 'group', 'group']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53931_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011533", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'tlll'", "output": "'tlll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011534", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "91", "output": "{1, 91, 13, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt90", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9483", "output": "{1, 3, 327, 9483, 109, 87, 3161, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011536", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[7, 1, 3, 3, 8, 4, 2, 6, 6, 7, 1]", "output": "[7, 1, 3, 8, 4, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011537", "code": "def extract_major_version(version: str) -> int:\n    # Find the index of the first dot in the version string\n    dot_index = version.index('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version[:dot_index]\n    # Convert the extracted substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'33.0'", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39750_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011538", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'o helo'", "output": "'o oleh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011539", "code": "def minStatuesNeeded(statues):\n    min_height = min(statues)\n    max_height = max(statues)\n    total_statues = len(statues)\n    # Calculate the number of additional statues needed to make the array consecutive\n    additional_statues = (max_height - min_height + 1) - total_statues\n    return additional_statues\n", "entry_point": "minStatuesNeeded", "input": "[1, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18434_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011540", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[3, 4, 4, 3, 3, 3, 3, 0], 5, 0", "output": "[5, 3, 4, 4, 3, 3, 3, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011541", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "10, 12, 16", "output": "(10, 16)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011542", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[20, 5]", "output": "12.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011543", "code": "def extract_major_version(version: str) -> int:\n    # Find the index of the first dot in the version string\n    dot_index = version.find('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version[:dot_index] if dot_index != -1 else version\n    # Convert the substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'10'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134353_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011544", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[10, 2, 3, 3, 4, 5, 6]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011545", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "1, ['13', 'x', 'x', 'x', 'x']", "output": "156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011546", "code": "import math\ndef calculate_total_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i]\n        x2, y2 = points[i + 1]\n        length = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n        total_length += length\n    return total_length\n", "entry_point": "calculate_total_length", "input": "[(0, 0), (3, 4), (6, 8)]", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3574_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011547", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8884", "output": "{1, 2, 4, 2221, 8884, 4442}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8883", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011548", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[99], 1", "output": "99.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011549", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5991", "output": "{1, 3, 1997, 5991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011550", "code": "import ast\nfrom collections import defaultdict\ndef count_unique_module_imports(code_snippet):\n    imports = defaultdict(int)\n    tree = ast.parse(code_snippet)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports[alias.name] += 1\n        elif isinstance(node, ast.ImportFrom):\n            module_name = node.module if node.module else ''\n            full_module_name = f\"{module_name}.{node.names[0].name}\"\n            imports[full_module_name] += 1\n    return dict(imports)\n", "entry_point": "count_unique_module_imports", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31510_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011551", "code": "def count_players(scores, target):\n    left, right = 0, len(scores) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if scores[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return len(scores) - left\n", "entry_point": "count_players", "input": "[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], 4.0", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83762_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "935", "output": "{1, 5, 935, 11, 17, 85, 55, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2042", "output": "{1, 2042, 2, 1021}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2041", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011554", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_animaewdtt', 0", "output": "'\\n  .width(test_animaewdtt);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011555", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1, 0.87", "output": "0.87", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011556", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'ABC SKmSKFmSK', 'ABC '", "output": "'SKmSKFmSK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011557", "code": "def check_lottery_result(player_numbers, winning_numbers):\n    num_matches = len(set(player_numbers).intersection(winning_numbers))\n    if num_matches == 3:\n        return \"Jackpot Prize\"\n    elif num_matches == 2:\n        return \"Smaller Prize\"\n    elif num_matches == 1:\n        return \"Consolation Prize\"\n    else:\n        return \"No Prize\"\n", "entry_point": "check_lottery_result", "input": "[4, 5, 6], [1, 2, 3]", "output": "'No Prize'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52867_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011558", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'RRRUUDD'", "output": "(3, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011559", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 50.0), ('W', 50.0)]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011560", "code": "from typing import List\ndef maxFruits(tree: List[int]) -> int:\n    if not tree or len(tree) == 0:\n        return 0\n    left = 0\n    ans = 0\n    baskets = {}\n    for t, fruit in enumerate(tree):\n        baskets[fruit] = t\n        if len(baskets) > 2:\n            left = min(baskets.values())\n            del baskets[tree[left]]\n            left += 1\n        ans = max(ans, t - left + 1)\n    return ans\n", "entry_point": "maxFruits", "input": "[1, 1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77640_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011561", "code": "def elementwise_less_equal(v1, v2):\n    result = []\n    for val1, val2 in zip(v1, v2):\n        result.append(val1 <= val2)\n    return result\n", "entry_point": "elementwise_less_equal", "input": "[1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]", "output": "[True, True, True, True, True, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11405_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011562", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "2, 5", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt23", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011563", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'pear; grape'", "output": "['pear', 'grape']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011564", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "1, 714", "output": "714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011565", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'308535385114.dkrm/cafe2/', 290", "output": "'308535385114.dkrm/cafe2/290'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011566", "code": "def calc_user_rating(matched_id):\n    # Simulating database query with sample data\n    class UserRating:\n        def __init__(self, rated_user_id, rating):\n            self.rated_user_id = rated_user_id\n            self.rating = rating\n    # Sample data for demonstration\n    ratings_data = [\n        UserRating(1, 4),\n        UserRating(1, 3),\n        UserRating(1, 5),\n        UserRating(2, 2),\n        UserRating(2, 3)\n    ]\n    matched = [rating for rating in ratings_data if rating.rated_user_id == matched_id]\n    rate_sum = sum(rating.rating for rating in matched)\n    if len(matched) == 0:\n        final_rate = 2.5\n    else:\n        final_rate = rate_sum / len(matched)\n    return final_rate\n", "entry_point": "calc_user_rating", "input": "1", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75245_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011567", "code": "from typing import List\ndef check_large_family(households: List[int]) -> bool:\n    for members in households:\n        if members > 5:\n            return True\n    return False\n", "entry_point": "check_large_family", "input": "[6]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68608_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011568", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'0:0:59'", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011569", "code": "def get_dependencies(python_version, operating_system):\n    install_requires = []\n    if python_version == '2':\n        install_requires.append('functools32>=3.2.3-2')\n    if python_version == '3' or operating_system == 'Darwin':\n        install_requires.append('bsddb3>=6.1.0')\n    return install_requires\n", "entry_point": "get_dependencies", "input": "'1', 'Windows'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27475_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011570", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'A'", "output": "['A']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8662", "output": "{1, 2, 71, 4331, 142, 8662, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011572", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    multiples_set = set()\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 10, 15, 12]", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83405_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011573", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[1, 0, 1, 0]", "output": "[1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011574", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[1, 2, 3, 4, 5, 6]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011575", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[90, 90, 90, 85, 80]", "output": "[90, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011576", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[4, 2, 4, 0, 1, 2, -3, -3]", "output": "[3, 3, 2, 1, 0, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8569", "output": "{1, 451, 41, 779, 11, 209, 19, 8569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011578", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "535", "output": "{1, 107, 5, 535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011579", "code": "def total_balance(transactions):\n    balance = 0\n    for transaction in transactions:\n        if transaction['type'] == 'credit':\n            balance += transaction['amount']\n        elif transaction['type'] == 'debit':\n            balance -= transaction['amount']\n    return balance\n", "entry_point": "total_balance", "input": "[{'type': 'credit', 'amount': 100}, {'type': 'debit', 'amount': 100}]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92275_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011580", "code": "import os\ndef find_common_parent(path1: str, path2: str) -> str:\n    parent1 = path1.split(os.sep)\n    parent2 = path2.split(os.sep)\n    common_parent = []\n    for dir1, dir2 in zip(parent1, parent2):\n        if dir1 == dir2:\n            common_parent.append(dir1)\n        else:\n            break\n    if len(common_parent) == 1 and common_parent[0] == '':\n        return os.sep  # Handle the case when the paths start with the root directory\n    if len(common_parent) == 0:\n        return \"No common parent directory\"\n    return os.sep.join(common_parent)\n", "entry_point": "find_common_parent", "input": "'/home/user/documents/file.txt', '/home/user/photos/image.png'", "output": "'/home/user'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85951_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011581", "code": "def simulate_reformat_temperature_data(raw_data):\n    # Simulate processing the data using a hypothetical script 'reformat_weather_data.py'\n    # In this simulation, we will simply reverse the input data as an example\n    reformatted_data = raw_data[::-1]\n    return reformatted_data\n", "entry_point": "simulate_reformat_temperature_data", "input": "'33'", "output": "'33'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136307_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011582", "code": "from typing import Tuple\ndef final_position(directions: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'RRU'", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93403_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "38", "output": "{1, 2, 19, 38}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt37", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011584", "code": "def find_unique_element(nums):\n    unique_element = 0\n    for num in nums:\n        unique_element ^= num\n    return unique_element\n", "entry_point": "find_unique_element", "input": "[1, 1, 2, 2, 3, 3, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52306_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011585", "code": "def sum_of_even_squares(lst):\n    total = 0\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[10]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22926_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011586", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[6, 1, 1, 0, 2, 0]", "output": "[7, 2, 1, 2, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125440_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011587", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "[], 1", "output": "'{v0}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011588", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[91, 85, 78], 1", "output": "[91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011589", "code": "from datetime import datetime\ndef execute_command(cmd: str) -> str:\n    if cmd == \"HELLO\":\n        return \"Hello, World!\"\n    elif cmd == \"TIME\":\n        current_time = datetime.now().strftime(\"%H:%M\")\n        return current_time\n    elif cmd == \"GOODBYE\":\n        return \"Goodbye!\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "execute_command", "input": "'HELLO'", "output": "'Hello, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88933_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011590", "code": "from functools import reduce\nfrom operator import add\ndef calculate_sum(int_list):\n    # Using reduce with the add operator to calculate the sum\n    total_sum = reduce(add, int_list)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[16, 16]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011591", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[0, 1, 2, 3, 4, 0, 1, 2]", "output": "[0, 1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011592", "code": "def extract_viewsets(urls):\n    viewsets_mapping = {}\n    for url_pattern in urls:\n        start_index = url_pattern.find(\"include(\") + len(\"include(\")\n        end_index = url_pattern.find(\".urls))\")\n        viewset_name = url_pattern[start_index:end_index]\n        start_index = url_pattern.find(\"'\") + 1\n        end_index = url_pattern.find(\"',\")\n        url = url_pattern[start_index:end_index]\n        viewsets_mapping[url] = viewset_name\n    return viewsets_mapping\n", "entry_point": "extract_viewsets", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7235_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011593", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[1, 1, -1, 0, 0, 0, 0, 0]", "output": "[1, 1, -1, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2891", "output": "{1, 7, 2891, 49, 59, 413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011595", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[2, 1, 4, 5, 6], 3, 1", "output": "[2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011596", "code": "def count_qualifying_digits(data):\n    ans = 0\n    for line in data:\n        _, output = line.split(\" | \")\n        for digit in output.split():\n            if len(digit) in (2, 3, 4, 7):\n                ans += 1\n    return ans\n", "entry_point": "count_qualifying_digits", "input": "['input1 | 12 123']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121913_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011597", "code": "def analyze_list(lst):\n    total = len(lst)\n    even_count = sum(1 for num in lst if num % 2 == 0)\n    total_sum = sum(lst)\n    return {'Total': total, 'Even': even_count, 'Sum': total_sum}\n", "entry_point": "analyze_list", "input": "[2, 3, 5]", "output": "{'Total': 3, 'Even': 1, 'Sum': 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93656_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011598", "code": "from typing import List\ndef reconstruct_sequence(counts: List[int]) -> List[int]:\n    sequence = []\n    for i in range(len(counts)):\n        sequence.extend([i+1] * counts[i])\n    return sequence\n", "entry_point": "reconstruct_sequence", "input": "[1, 4, 3, 4, 3]", "output": "[1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4314_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011599", "code": "def simulate_program(a):\n    sum = 0\n    while True:\n        if a == 0:\n            return int(sum)\n        if a <= 2:\n            return -1\n        if a % 5 != 0:\n            a -= 3\n            sum += 1\n        else:\n            sum += a // 5\n            a = 0\n", "entry_point": "simulate_program", "input": "25", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33330_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011600", "code": "import re\ndef custom_module_sort(versions):\n    def to_alphanumeric_pairs(text):\n        convert = lambda text: int(text) if text.isdigit() else text\n        alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]\n        return alphanum_key(text)\n    return sorted(versions, key=to_alphanumeric_pairs)\n", "entry_point": "custom_module_sort", "input": "['module1', 'module2', 'module10']", "output": "['module1', 'module2', 'module10']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82089_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011601", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max if second_max != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[7, 6, 1, 2, 3]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12088_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011602", "code": "from typing import List\ndef max_difference_after(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    min_element = nums[0]\n    max_difference = 0\n    for num in nums[1:]:\n        difference = num - min_element\n        if difference > max_difference:\n            max_difference = difference\n        if num < min_element:\n            min_element = num\n    return max_difference\n", "entry_point": "max_difference_after", "input": "[0, 1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72615_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011603", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 4, 4, 6, 1, 5, 3, 1, 5]", "output": "[5, 8, 10, 7, 6, 8, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011604", "code": "import re\nfrom typing import List\ndef _splitter(text: str) -> List[str]:\n    if len(text) == 0:\n        return []\n    if \"'\" not in text:\n        return [text]\n    return re.findall(\"'([^']+)'\", text)\n", "entry_point": "_splitter", "input": "'no quotes here'", "output": "['no quotes here']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84189_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011605", "code": "def lengthOfLIS(nums):\n    if not nums:\n        return 0\n    sequence = [nums[0]]\n    def binarySearch(arr, target):\n        left, right = 0, len(arr) - 1\n        while left <= right:\n            mid = (left + right) // 2\n            if arr[mid] == target:\n                return mid\n            elif arr[mid] < target:\n                left = mid + 1\n            else:\n                right = mid - 1\n        return left\n    for num in nums[1:]:\n        if num < sequence[0]:\n            sequence[0] = num\n        elif num > sequence[-1]:\n            sequence.append(num)\n        else:\n            sequence[binarySearch(sequence, num)] = num\n    return len(sequence)\n", "entry_point": "lengthOfLIS", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74041_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011606", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/usr/bin'", "output": "'/usr/bin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011607", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7026", "output": "{1, 2, 3, 2342, 6, 7026, 1171, 3513}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011608", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:  # Even number of elements\n        mid = n // 2\n        return (sorted_numbers[mid - 1] + sorted_numbers[mid]) / 2\n    else:  # Odd number of elements\n        return sorted_numbers[n // 2]\n", "entry_point": "calculate_median", "input": "[1, 2, 3, 4]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28715_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011609", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[2, 4, 3, 5]", "output": "[2, 6, 9, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011610", "code": "def count_carry_operations(a, b):\n    carry = 0\n    carry_count = 0\n    while a or b:\n        carry = (carry + a % 10 + b % 10) // 10\n        if carry:\n            carry_count += 1\n        a = a // 10\n        b = b // 10\n    if carry_count == 0:\n        return 'No carry operation.'\n    elif carry_count == 1:\n        return '1 carry operation.'\n    else:\n        return '{} carry operations.'.format(carry_count)\n", "entry_point": "count_carry_operations", "input": "0, 0", "output": "'No carry operation.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70222_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011611", "code": "from typing import List\ndef play_game(grid: List[List[int]]) -> int:\n    rows, cols = len(grid), len(grid[0])\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]  # right, left, down, up\n    visited = set()\n    total_sum = 0\n    x, y = 0, 0\n    while 0 <= x < rows and 0 <= y < cols and (x, y) not in visited and grid[x][y] >= 0:\n        total_sum += grid[x][y]\n        visited.add((x, y))\n        for dx, dy in directions:\n            new_x, new_y = x + dx, y + dy\n            if 0 <= new_x < rows and 0 <= new_y < cols and (new_x, new_y) not in visited and grid[new_x][new_y] >= 0:\n                x, y = new_x, new_y\n                break\n        else:\n            break\n    return total_sum\n", "entry_point": "play_game", "input": "[[10, 10], [10, 10], [0, 0]]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138126_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011612", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8986", "output": "{1, 8986, 2, 4493}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011613", "code": "def determine_client_type(client_id: str) -> str:\n    client_number = int(client_id.split('-')[-1])\n    if client_number < 100:\n        return \"OLD1-\" + str(client_number)\n    elif 100 <= client_number < 1000:\n        return \"OLD2-\" + str(client_number)\n    else:\n        return \"OLD3-\" + str(client_number)\n", "entry_point": "determine_client_type", "input": "'client-0'", "output": "'OLD1-0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46850_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011614", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 6, 12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011615", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7118", "output": "{1, 2, 7118, 3559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4126", "output": "{1, 2, 4126, 2063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011617", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'25429 25429'", "output": "'25429 25429'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011618", "code": "def count_unique_chars(input_string):\n    unique_chars = set()\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():\n            unique_chars.add(char_lower)\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'aAbBcC!@#$%'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10628_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011619", "code": "def simulate_card_game(deck_a, deck_b):\n    score_a, score_b = 0, 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    return score_a, score_b\n", "entry_point": "simulate_card_game", "input": "[3, 1, 2, 0, 4], [2, 3, 4, 5, 6]", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77887_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011620", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(0, 10, 5)", "output": "'0.10.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011621", "code": "def min_moves_to_target(target):\n    return abs(target)\n", "entry_point": "min_moves_to_target", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63367_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011622", "code": "def generate_pseudonym(name):\n    pseudonym_count = {}\n    # Split the name into words\n    words = name.split()\n    pseudonym = ''.join(word[0].upper() for word in words)\n    if pseudonym in pseudonym_count:\n        pseudonym_count[pseudonym] += 1\n    else:\n        pseudonym_count[pseudonym] = 1\n    count = pseudonym_count[pseudonym]\n    return (pseudonym + str(count), sum(pseudonym_count.values()))\n", "entry_point": "generate_pseudonym", "input": "'Alice'", "output": "('A1', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11221_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011623", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "' world! '", "output": "['world!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011624", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'awesome'", "output": "{'awesome': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113237_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011625", "code": "def format_project_info(info: dict) -> str:\n    output = \"\"\n    for key, value in info.items():\n        if key == \"classifiers\":\n            output += f\"{key.capitalize()}:\\n\"\n            for classifier in value:\n                output += f\"- {classifier}\\n\"\n        else:\n            output += f\"{key.capitalize()}: {value}\\n\"\n    return output\n", "entry_point": "format_project_info", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113552_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9245", "output": "{1, 5, 43, 215, 1849, 9245}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011627", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[1, 6], 0", "output": "[1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011628", "code": "def cleanup_query_string(url):\n    base_url, query_string = url.split('?') if '?' in url else (url, '')\n    if '#' in query_string:\n        query_string = query_string[:query_string.index('#')]\n    if query_string.endswith('?') and len(query_string) == 1:\n        query_string = ''\n    cleaned_url = base_url + ('?' + query_string if query_string else '')\n    return cleaned_url\n", "entry_point": "cleanup_query_string", "input": "'.h.hthhttpohh'", "output": "'.h.hthhttpohh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64096_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011629", "code": "from typing import List, Dict, Union\ndef calculate_shopping_cart_cost(cart: List[Dict[str, Union[str, float, int]]]) -> float:\n    total_cost = 0\n    for item in cart:\n        total_cost += item[\"price\"] * item[\"quantity\"]\n    return total_cost\n", "entry_point": "calculate_shopping_cart_cost", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120875_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011630", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "6", "output": "[0, 1, 1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011631", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[82, 83, 81, 81, 80, 70]", "output": "81.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011632", "code": "def delete_objects(buckets, objects):\n    bucket_objects = {\n        \"bucket1\": [\"object1\", \"object2\"],\n        \"bucket2\": [\"object3\"]\n    }\n    for bucket in buckets:\n        if bucket in bucket_objects:\n            del bucket_objects[bucket]\n    for obj in objects:\n        for bucket, obj_list in bucket_objects.items():\n            if obj in obj_list:\n                obj_list.remove(obj)\n    updated_buckets = list(bucket_objects.keys())\n    updated_objects = [obj for obj_list in bucket_objects.values() for obj in obj_list]\n    return updated_buckets, updated_objects\n", "entry_point": "delete_objects", "input": "['bucket1'], ['object1', 'object2']", "output": "(['bucket2'], ['object3'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41222_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011633", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[3, 7]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6742", "output": "{1, 2, 3371, 6742}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "467 * 13", "output": "{1, 467, 13, 6071}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011636", "code": "from typing import List\ndef count_odd_cells(n: int, m: int, indices: List[List[int]]) -> int:\n    row = [0] * n\n    col = [0] * m\n    ans = 0\n    for r, c in indices:\n        row[r] += 1\n        col[c] += 1\n    for i in range(n):\n        for j in range(m):\n            ans += (row[i] + col[j]) % 2\n    return ans\n", "entry_point": "count_odd_cells", "input": "3, 3, [[0, 0], [1, 1], [2, 2], [0, 1]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70394_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011637", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[4]", "output": "[(4,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt57", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011638", "code": "from typing import List\ndef find_last_target(nums: List[int], target: int) -> int:\n    left = 0\n    right = len(nums) - 1\n    while left + 1 < right:\n        mid = int(left + (right - left) / 2)\n        if nums[mid] == target:\n            left = mid\n        elif nums[mid] > target:\n            right = mid\n        elif nums[mid] < target:\n            left = mid\n    if nums[right] == target:\n        return right\n    if nums[left] == target:\n        return left\n    return -1\n", "entry_point": "find_last_target", "input": "[1, 2, 3, 3, 4], 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72340_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011639", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[3, 4, 5]", "output": "[3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011640", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[12, 10, 10, 10, 8, 1, 3, 5]", "output": "[12, 10, 10, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011641", "code": "def calculate_average(nums: list) -> float:\n    if len(nums) <= 1:\n        return 0\n    min_val = min(nums)\n    max_val = max(nums)\n    remaining_nums = [num for num in nums if num != min_val and num != max_val]\n    if not remaining_nums:\n        return 0\n    return sum(remaining_nums) / len(remaining_nums)\n", "entry_point": "calculate_average", "input": "[1, 5, 5, 10, 6]", "output": "5.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144900_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011642", "code": "def validate_dog_size(size_code):\n    valid_sizes = ['S', 'M', 'L']\n    if size_code in valid_sizes:\n        return True\n    else:\n        return False\n", "entry_point": "validate_dog_size", "input": "'X'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74708_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2342", "output": "{1, 2, 1171, 2342}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011644", "code": "def calculate_token_required(options):\n    debug = options.get('debug', False)\n    output = options.get('--output', False)\n    token_required = not debug and not output\n    return token_required\n", "entry_point": "calculate_token_required", "input": "{}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133231_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011645", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2, 2, 2, 2, 4, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011646", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[4, 4, 5, 3, 5, 8]", "output": "[4, 5, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011647", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[300, 120, 32]", "output": "'7 minutes and 32 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011648", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2665", "output": "{1, 65, 5, 2665, 41, 13, 205, 533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011649", "code": "def find_earliest_date(dates):\n    earliest_date = dates[0]\n    for date in dates[1:]:\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date\n", "entry_point": "find_earliest_date", "input": "['2021-12-26', '2021-12-27', '2021-12-25']", "output": "'2021-12-25'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110382_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011650", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i][j - 1] + 1, dp[i - 1][j] + 1, dp[i - 1][j - 1] + 1)\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'', 'abcdefghij'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44999_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2959", "output": "{1, 11, 269, 2959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011652", "code": "def max_sum_non_adjacent_parity(lst):\n    odd_sum = even_sum = 0\n    for num in lst:\n        if num % 2 == 0:  # Even number\n            even_sum, odd_sum = max(even_sum, odd_sum), even_sum + num\n        else:  # Odd number\n            even_sum, odd_sum = max(even_sum, odd_sum + num), odd_sum\n    return max(odd_sum, even_sum)\n", "entry_point": "max_sum_non_adjacent_parity", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85540_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011653", "code": "def chatbot(user_input):\n    user_input = user_input.lower()  # Convert input to lowercase for case-insensitive matching\n    if \"hello\" in user_input or \"hi\" in user_input:\n        return \"Hello! How can I assist you today?\"\n    elif \"weather\" in user_input:\n        return \"The weather is sunny today.\"\n    elif \"bye\" in user_input or \"goodbye\" in user_input:\n        return \"Goodbye! Have a great day!\"\n    else:\n        return \"I'm sorry, I didn't understand that.\"\n", "entry_point": "chatbot", "input": "'hello'", "output": "'Hello! How can I assist you today?'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98572_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011654", "code": "import unicodedata\ndef count_unique_chars(input_string):\n    normalized_string = ''.join(c for c in unicodedata.normalize('NFD', input_string.lower()) if unicodedata.category(c) != 'Mn' and c.isalnum())\n    char_count = {}\n    for char in normalized_string:\n        char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'c c c A f E 1 3'", "output": "{'c': 3, 'a': 1, 'f': 1, 'e': 1, '1': 1, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74363_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011655", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[5, 6, 4]", "output": "[5, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011656", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "13, 4", "output": "28561", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011657", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_num = 0\n    for num in nums:\n        single_num ^= num\n    return single_num\n", "entry_point": "find_single_number", "input": "[1, 1, 2, 2, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121855_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011658", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[5, 3, 10, 14, 20], 10", "output": "[10, 14, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011659", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6547", "output": "{1, 6547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1161", "output": "{1, 129, 3, 387, 1161, 9, 43, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011661", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'appn/json; charset=UTF-8'", "output": "('appn', 'json', '', {'charset': 'UTF-8'})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011662", "code": "def binary_search(target, lst):\n    low = 0\n    high = len(lst) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if lst[mid] == target:\n            return mid\n        elif lst[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return low\n", "entry_point": "binary_search", "input": "100, [1, 2, 3, 4, 5, 100]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43298_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011663", "code": "from typing import List\ndef generateOutput(data: List[int], threshold: int, operation: str) -> List[int]:\n    output = []\n    for num in data:\n        if operation == \"add\":\n            output.append(num + threshold)\n        elif operation == \"subtract\":\n            output.append(num - threshold)\n        elif operation == \"multiply\":\n            output.append(num * threshold)\n        elif operation == \"divide\":\n            output.append(num // threshold)  # Using integer division for simplicity\n    return output\n", "entry_point": "generateOutput", "input": "[], 5, 'add'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84207_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011664", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    sum_excluding_extremes = sum(sorted_scores[1:-1])\n    average = sum_excluding_extremes / (len(scores) - 2)\n    return average\n", "entry_point": "calculate_average_score", "input": "[60, 70, 80]", "output": "70.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63109_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011665", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[2, 8], 0, 1", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011666", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[85, 82, 80, 78, 72]", "output": "[85, 82, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8412_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011667", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    total_sum = 0\n    for num in input_list:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[13]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67910_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011668", "code": "def toBase10(num, b=62):\n    base = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"\n    res = 0\n    for digit in num:\n        res = b * res + base.find(digit)\n    return res\n", "entry_point": "toBase10", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28311_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011669", "code": "from typing import List\ndef max_attended_events(events: List[int]) -> int:\n    event_list = [(i, i + 1, freq) for i, freq in enumerate(events)]\n    event_list.sort(key=lambda x: x[1])  # Sort events based on end times\n    max_attended = 0\n    prev_end = -1\n    for event in event_list:\n        start, end, _ = event\n        if start >= prev_end:\n            max_attended += 1\n            prev_end = end\n    return max_attended\n", "entry_point": "max_attended_events", "input": "[1, 1, 1, 1, 1, 1, 1, 1, 1]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94594_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011670", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{2: [0], 0: [1], 1: [3], 3: []}, 2", "output": "[2, 0, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011671", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'filessic/scon.mp3', None", "output": "('filessic/scon.mp3', 'filessic/scon.mp3')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011672", "code": "from typing import List\ndef calculate_average(t: List[List[int]]) -> float:\n    total = 0\n    rows = 0\n    for row in t:\n        total += sum(row)\n        rows += 1\n    return total / rows\n", "entry_point": "calculate_average", "input": "[[30], [31]]", "output": "30.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011673", "code": "def process_help_section(path):\n    # Strip off the '/data/help/' part of the path\n    section = path.split('/', 3)[-1]\n    if section in ['install', 'overview', 'usage', 'examples', 'cloudhistory', 'changelog']:\n        return f\"Sending section: {section}\"\n    elif section.startswith('stage'):\n        stages_data = [{'name': stage_name, 'help': f\"Help for {stage_name}\"} for stage_name in ['stage1', 'stage2', 'stage3']]\n        return stages_data\n    else:\n        return f\"Could not find help section: {section}\"\n", "entry_point": "process_help_section", "input": "'/data/help/overview'", "output": "'Sending section: overview'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99964_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011674", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[12, 25, 34, 11, 12, 24]", "output": "[11, 12, 12, 24, 25, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011675", "code": "def factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "7", "output": "5040", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149792_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011676", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6298", "output": "{1, 2, 67, 134, 3149, 47, 6298, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011677", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'P@P#r!e$t%I^p', 'PREET'", "output": "'ppretipPREET'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011678", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'salary: 50000, currency: USD'", "output": "{'salary': 50000, 'currency': 'USD'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011679", "code": "def indexof(listofnames, value):\n    if value in listofnames:\n        value_index = listofnames.index(value)\n        return (listofnames, value_index)\n    else:\n        return -1\n", "entry_point": "indexof", "input": "['Bob', 'Charlie', 'David'], 'Alice'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_304_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7085", "output": "{1, 545, 65, 5, 1417, 13, 7085, 109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7084", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011681", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average = round(average_score, 2)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[88.0, 87.5, 89.0, 88.5, 87.6]", "output": "88.12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105956_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011682", "code": "def calculate_total_plays(music):\n    total_plays = {}\n    for track, plays in music:\n        if track in total_plays:\n            total_plays[track] += plays\n        else:\n            total_plays[track] = plays\n    return total_plays\n", "entry_point": "calculate_total_plays", "input": "[('song1', 10), ('song1', 20), ('song2', 40)]", "output": "{'song1': 30, 'song2': 40}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1397_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011683", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "9", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011684", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[72, 72]", "output": "288", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011685", "code": "# Step 1: Create a dictionary to store the mappings\ncommand_mapping = {\n    'PERMISSIONS': 'Permissions',\n    'permissions': 'Permissions',\n    'Permissions': 'Permissions'\n}\n# Step 3: Implement the get_command function\ndef get_command(command_name):\n    return command_mapping.get(command_name, 'Command not found')\n", "entry_point": "get_command", "input": "'PERMISSIONS'", "output": "'Permissions'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62413_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011686", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011687", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[4, 0, 7, 0, 9, 0, 5, 5]", "output": "[4, 7, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011688", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[1, 2, 3, 4, 2, 4]", "output": "[2, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011689", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'XXIPXPIPP', 'ME'", "output": "'Invalid status code: XXIPXPIPP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011690", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'fille', 'This is just a description.'", "output": "('fille', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011691", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[7, 7, 7, 8]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011692", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'UUR'", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011693", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'['", "output": "'\\x1b[38;5;196m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011694", "code": "def calculate_value(n, a):\n    mod = 10**9 + 7\n    answer = 0\n    sumation = sum(a)\n    for i in range(n-1):\n        sumation -= a[i]\n        answer += a[i] * sumation\n        answer %= mod\n    return answer\n", "entry_point": "calculate_value", "input": "1, [0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102907_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011695", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70765_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011696", "code": "def sum_of_multiples(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples", "input": "[5, 10, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59802_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011697", "code": "def is_valid_seed(seed: str) -> bool:\n    n = len(seed)\n    for i in range(1, n // 2 + 1):\n        if n % i == 0:\n            repeated_seq = seed[:i]\n            if all(seed[j:j+i] == repeated_seq for j in range(0, n, i)) and seed != repeated_seq:\n                return True\n    return False\n", "entry_point": "is_valid_seed", "input": "'A'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143461_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011698", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 1, -1, 0, 0, 0, 0, 3]", "output": "{1: 3, -1: 1, 0: 4, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011699", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "2, 5, 50", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011700", "code": "import base64\ndef process_content(contents):\n    content_type, content_string = contents.split(',')\n    decoded_content = base64.b64decode(content_string)\n    return decoded_content\n", "entry_point": "process_content", "input": "'text/plain,SGVsbGQh'", "output": "b'Helld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133360_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011701", "code": "from urllib.parse import urlparse\ndef process_url(enclosure: str, username: str = None, api_key: str = None) -> str:\n    parsed_url = urlparse(enclosure)\n    if username is not None:\n        url = '/vsigzip//vsicurl/%s://%s:%s@%s%s' % (parsed_url.scheme,\n                                                      username,\n                                                      api_key,\n                                                      parsed_url.netloc,\n                                                      parsed_url.path)\n    else:\n        url = '/vsigzip//vsicurl/%s://%s%s' % (parsed_url.scheme,\n                                               parsed_url.netloc,\n                                               parsed_url.path)\n    return url\n", "entry_point": "process_url", "input": "'//haxa', 'uuu3', 'secetkey'", "output": "'/vsigzip//vsicurl/://uuu3:secetkey@haxa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108938_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011702", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8737", "output": "{1, 8737}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011704", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "2.3, 2", "output": "5.289999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3673", "output": "{3673, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011706", "code": "def sum_of_digits(n: int) -> int:\n    sum_digits = 0\n    for digit in str(n):\n        sum_digits += int(digit)\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "59", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99099_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011707", "code": "def format_output(version: str, app_config: str) -> str:\n    return f\"Version: {version}, Default App Config: {app_config}\"\n", "entry_point": "format_output", "input": "'vvv', 'djmoneg'", "output": "'Version: vvv, Default App Config: djmoneg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138174_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011708", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 4, 0, 2, 2, 2, 5, 0]", "output": "[1, 5, 2, 5, 6, 7, 11, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011709", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[2, 0, 0, 1, 1, 1, 1, 0]", "output": "[0, 1, 1, 1, 1, 0, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011710", "code": "from typing import List\nfrom datetime import datetime\ndef earliest_date(dates: List[str]) -> str:\n    earliest_date = \"9999/12/31\"  # Initialize with a date far in the future\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, \"%Y/%m/%d\")\n        if date_obj < datetime.strptime(earliest_date, \"%Y/%m/%d\"):\n            earliest_date = date_str\n    return earliest_date\n", "entry_point": "earliest_date", "input": "['2025/01/01', '2024/12/20']", "output": "'2024/12/20'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128206_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011711", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "193 * 41", "output": "{1, 193, 7913, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5137", "output": "{1, 11, 5137, 467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011713", "code": "import re\ndef extract_service_names(code_snippet):\n    imports = re.findall(r'from\\s+(\\S+)\\s+import\\s+(\\S+)', code_snippet)\n    service_names = set()\n    for module, service in imports:\n        if module.startswith('services.'):\n            service_names.add(service)\n        else:\n            service_names.add(service.split('.')[-1])\n    return list(service_names)\n", "entry_point": "extract_service_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87240_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011714", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1038", "output": "{1, 2, 3, 6, 519, 173, 1038, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1037", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011715", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7214", "output": "{1, 2, 7214, 3607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7213", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011716", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['IGNORE', '11', '1', '1', 'AA', 'CB', 'CBC', 'AA']", "output": "'11 1 1 AA CB CBC AA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011717", "code": "from typing import List\ndef sum_non_diagonal(matrix: List[List[int]]) -> int:\n    sum_non_diag = 0\n    n = len(matrix)\n    for i in range(n):\n        for j in range(n):\n            if i != j:  # Check if the element is not on the diagonal\n                sum_non_diag += matrix[i][j]\n    return sum_non_diag\n", "entry_point": "sum_non_diagonal", "input": "[[10, 5, 5], [5, 0, 5], [5, 5, 10]]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54102_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011718", "code": "def reverse_words(text):\n    words = text.split()  # Split the input text into individual words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word using slicing\n    return ' '.join(reversed_words)  # Join the reversed words back into a single string\n", "entry_point": "reverse_words", "input": "'hello world'", "output": "'olleh dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145784_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011719", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are 0 or 1 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[10, 19.25, 20.25, 21.25, 30]", "output": "20.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115816_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011720", "code": "def frog_jump_time(A, X):\n    positions = set()\n    for time, position in enumerate(A):\n        positions.add(position)\n        if len(positions) == X:\n            return time\n    return -1\n", "entry_point": "frog_jump_time", "input": "[1, 2, 3, 4], 4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50166_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011721", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 66565995, 1", "output": "66565995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011722", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7183", "output": "{1, 11, 653, 7183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011723", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[4]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8939", "output": "{1, 8939, 1277, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011725", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[6, 6, 4, 2, 2, 2, 2, 2]", "output": "[6, 6, 4, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011726", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "8, 7, 12", "output": "(0, 4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011727", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[7, -1, 1, 5, 4, 3, 0, -1], 6", "output": "[[7, -1, 1, 5, 4, 3], [0, -1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011728", "code": "def calculate_carbon_uptake_rate(growth_rate):\n    R_GLUC = 200\n    R_XYL = 50\n    R_FRUC = 200\n    R_GLYC = 2000\n    N_GLUC = 6\n    N_XYL = 5\n    total_carbon_uptake_rate = (R_GLUC * N_GLUC + R_XYL * N_XYL + R_FRUC * 6 + R_GLYC * 3) * growth_rate\n    return total_carbon_uptake_rate\n", "entry_point": "calculate_carbon_uptake_rate", "input": "4.35", "output": "37627.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50880_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011729", "code": "def fill_characters(n, positions, s):\n    ans = [''] * n\n    for i, pos in enumerate(positions):\n        ans[pos - 1] += s[i % len(s)]\n    return ''.join(ans)\n", "entry_point": "fill_characters", "input": "8, [1, 1, 1, 1, 1, 1, 1, 1], 'a'", "output": "'aaaaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84635_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011730", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 2, 3, 2, 4]", "output": "[6, 5, 5, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34035_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011731", "code": "def find_latest_version(versions):\n    if not versions:\n        return None\n    latest_version = versions[0]\n    for version in versions:\n        if version > latest_version:\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['2020-01-01', '2020-12-10', '2020-12-15']", "output": "'2020-12-15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26505_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011732", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "122", "output": "'ossg.default.122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011733", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "17", "output": "[17, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011734", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[1, 6, 2, 3, 3, 3, 0, 2, 3]", "output": "[1, 36, 4, 27, 27, 27, 0, 4, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011735", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'XXIPXPPPP', 'ME'", "output": "'Invalid status code: XXIPXPPPP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011736", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[0, 0, 4, 2, 1, 3, 1, 1, 1]", "output": "[0, 4, 6, 3, 4, 4, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13953_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011737", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'11100X'", "output": "['111000', '111001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt39", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011738", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'.ex.xpec'", "output": "'.ex.xpec.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2023", "output": "{1, 289, 7, 2023, 17, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011740", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'npoboene'", "output": "'npoboene.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011741", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'10.20.30'", "output": "(10, 20, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7679", "output": "{1097, 1, 7, 7679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3565", "output": "{1, 5, 713, 3565, 115, 23, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011744", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[7, 2, 0, 7, 9, 0, 7]", "output": "[0, 0, 2, 7, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011745", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '15:30:45'", "output": "12645", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011746", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[36, 38, 40]", "output": "'38%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011747", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5924", "output": "{1, 2, 5924, 4, 1481, 2962}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5923", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011748", "code": "def generate_list(n):\n    res = []\n    for i in range(1, (n // 2) + 1):\n        res.append(i)\n    for i in range(-(n // 2), 0):\n        res.append(i)\n    return res\n", "entry_point": "generate_list", "input": "4", "output": "[1, 2, -2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88002_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011749", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 3, 4, 4, 10]", "output": "3.6666666666666665", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3903", "output": "{1, 3, 1301, 3903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011751", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5906", "output": "{1, 5906, 2, 2953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011752", "code": "def find_negative_floor_position(parentheses: str) -> int:\n    floor = 0\n    position = 0\n    counter = 0\n    for char in parentheses:\n        counter += 1\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        if floor < 0:\n            return counter\n    return -1\n", "entry_point": "find_negative_floor_position", "input": "')'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125383_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011753", "code": "FILE_STATUS = (\n    \"\u2601 Uploaded\",\n    \"\u231a Queued\",\n    \"\u2699 In Progress...\",\n    \"\u2705 Success!\",\n    \"\u274c Failed: file not found\",\n    \"\u274c Failed: unsupported file type\",\n    \"\u274c Failed: server error\",\n    \"\u274c Invalid column mapping, please fix it and re-upload the file.\",\n)\ndef get_file_status_message(index):\n    if 0 <= index < len(FILE_STATUS):\n        return FILE_STATUS[index]\n    else:\n        return \"Invalid status index\"\n", "entry_point": "get_file_status_message", "input": "1", "output": "'\u231a Queued'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2319_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011754", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "5, 4", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72377_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011755", "code": "def generate_weather_message(args):\n    weather_data = {\n        \"dublin\": {\n            \"channel\": {\n                \"item\": {\n                    \"condition\": {\n                        \"date\": \"2022-01-01\",\n                        \"temp\": 20,\n                        \"text\": \"Sunny\"\n                    }\n                }\n            }\n        },\n        \"paris\": {\n            \"channel\": {\n                \"item\": {\n                    \"condition\": {\n                        \"date\": \"2022-01-02\",\n                        \"temp\": 15,\n                        \"text\": \"Cloudy\"\n                    }\n                }\n            }\n        }\n    }\n    if not args:\n        args = [\"dublin\"]\n    location = \" \".join(args)\n    if location not in weather_data:\n        return \"Location not found\"\n    condition = weather_data[location][\"channel\"][\"item\"][\"condition\"]\n    msg = \"{location}, {date}, {temp}\u00b0C, {sky}\".format(\n        location=location.capitalize(),\n        date=condition[\"date\"],\n        temp=condition[\"temp\"],\n        sky=condition[\"text\"],\n    )\n    return msg\n", "entry_point": "generate_weather_message", "input": "['dublin']", "output": "'Dublin, 2022-01-01, 20\u00b0C, Sunny'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35689_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011756", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5726", "output": "{1, 2, 7, 14, 2863, 818, 409, 5726}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011757", "code": "def calculate_total_truck_count(_inbound_truck_raw_data, _outbound_truck_raw_data):\n    inbound_truck_count = len(_inbound_truck_raw_data)\n    outbound_truck_count = len(_outbound_truck_raw_data)\n    total_truck_count = inbound_truck_count + outbound_truck_count\n    return total_truck_count\n", "entry_point": "calculate_total_truck_count", "input": "[1, 2, 3, 4], [1, 2, 3, 4]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24222_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011758", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 10, 7, 9, 11, 0]", "output": "[3, 11, 9, 12, 15, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011759", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6219", "output": "{1, 3, 9, 6219, 691, 2073}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011760", "code": "import math\ndef download_manager(file_sizes, download_speed):\n    total_time = 0\n    file_sizes.sort(reverse=True)  # Sort file sizes in descending order\n    for size in file_sizes:\n        time_to_download = size / download_speed\n        total_time += math.ceil(time_to_download)  # Round up to nearest whole number\n    return total_time\n", "entry_point": "download_manager", "input": "[50, 30, 20, 5, 4], 1", "output": "109", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131368_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011761", "code": "def compare_scores(player1_scores, player2_scores):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for score1, score2 in zip(player1_scores, player2_scores):\n        if score1 > score2:\n            rounds_won_player1 += 1\n        elif score2 > score1:\n            rounds_won_player2 += 1\n    return [rounds_won_player1, rounds_won_player2]\n", "entry_point": "compare_scores", "input": "[5, 5, 5], [5, 5, 5]", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107299_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011762", "code": "from typing import List\ndef distribute_files(file_sizes: List[int], max_size: int) -> List[List[int]]:\n    folders = []\n    current_folder = []\n    current_size = 0\n    for file_size in file_sizes:\n        if current_size + file_size <= max_size:\n            current_folder.append(file_size)\n            current_size += file_size\n        else:\n            folders.append(current_folder)\n            current_folder = [file_size]\n            current_size = file_size\n    if current_folder:\n        folders.append(current_folder)\n    return folders\n", "entry_point": "distribute_files", "input": "[800, 300, 200, 400, 600], 900", "output": "[[800], [300, 200, 400], [600]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22508_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "484", "output": "{1, 2, 484, 4, 11, 44, 242, 22, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt483", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011764", "code": "def check_openbabel_compatibility(sdf_rdkit, sdf_ani, sdf_xtb):\n    ob_compat = True\n    try:\n        import openbabel as ob\n    except (ModuleNotFoundError, AttributeError):\n        ob_compat = False\n    return ob_compat\n", "entry_point": "check_openbabel_compatibility", "input": "None, None, None", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14532_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011765", "code": "def sum_squared_differences(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    sum_squared_diff = 0\n    for num1, num2 in zip(list1, list2):\n        diff = num2 - num1\n        sum_squared_diff += diff ** 2\n    return sum_squared_diff\n", "entry_point": "sum_squared_differences", "input": "[1, 2, 0], [5, 4, 0]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53280_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011766", "code": "def apply_formatting(input_str):\n    style = ''\n    color = ''\n    # Extract style and color information from the input string\n    if '\\033[' in input_str:\n        start_idx = input_str.index('\\033[')\n        end_idx = input_str.index('m')\n        style_color = input_str[start_idx + 2:end_idx].split(';')\n        style = style_color[0]\n        color = style_color[1]\n    # Apply ANSI escape codes based on the extracted information\n    formatted_text = f'\\033[{style};{color}m{input_str[end_idx + 1:-4]}\\033[m'\n    return formatted_text\n", "entry_point": "apply_formatting", "input": "'\\x1b[0;33mPython is awesome\\x1b[m'", "output": "'\\x1b[0;33mPython is awesom\\x1b[m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1962_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011767", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6978", "output": "{3489, 1, 6978, 2, 3, 6, 1163, 2326}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011768", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[2, -2, 2, 2, -1, 7, 2, 7, 2]", "output": "[2, 0, 2, 4, 3, 10, 12, 19, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011769", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6891", "output": "{3, 1, 6891, 2297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "315", "output": "{1, 3, 35, 5, 7, 105, 9, 45, 15, 21, 315, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt314", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1630", "output": "{1, 2, 163, 5, 326, 10, 815, 1630}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1629", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011772", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[0, 6, 0, -1, 5, 4, 5, 6]", "output": "[0, 6, -1, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011773", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[9, 6, 8, 7, 6, 6, 8, 6]", "output": "[9, 7, 10, 10, 10, 11, 14, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011774", "code": "def extract_file_extension(file_path):\n    # Find the last occurrence of the dot ('.') in the file path\n    dot_index = file_path.rfind('.')\n    # Check if a dot was found and the dot is not at the end of the file path\n    if dot_index != -1 and dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character after the last dot\n        return file_path[dot_index + 1:]\n    # Return an empty string if no extension found\n    return \"\"\n", "entry_point": "extract_file_extension", "input": "'image.png'", "output": "'png'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73936_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5410", "output": "{1, 5410, 2, 5, 10, 2705, 1082, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5409", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011776", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011777", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[2, 1, 4, 3, -1, 5, 4, 7]", "output": "[2, -1, 1, 5, 4, 4, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011778", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1777", "output": "{1, 1777}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011779", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8337", "output": "{1, 3, 7, 1191, 397, 8337, 21, 2779}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011780", "code": "def simulate_card_game(deck1, deck2, rounds):\n    player1_wins = 0\n    player2_wins = 0\n    for _ in range(rounds):\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return f\"Player 1 wins {player1_wins} rounds, Player 2 wins {player2_wins} rounds\"\n", "entry_point": "simulate_card_game", "input": "[1, 1, 1], [1, 1, 1], 3", "output": "'Player 1 wins 0 rounds, Player 2 wins 0 rounds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77971_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011781", "code": "def additional_packages_required(major, minor):\n    required_packages = []\n    if major < 3 or minor < 4:\n        required_packages.append(\"enum34\")\n    return required_packages\n", "entry_point": "additional_packages_required", "input": "2, 5", "output": "['enum34']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134863_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8902", "output": "{1, 2, 4451, 8902}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8901", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011783", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011784", "code": "def extract_env_vars(file_content, keys):\n    result = {}\n    for line in file_content.split('\\n'):\n        key_value = line.strip().split(' = ')\n        if len(key_value) == 2:\n            key, value = key_value\n            if key in keys:\n                result[key] = value\n    return result\n", "entry_point": "extract_env_vars", "input": "'', ['KEY1', 'KEY2']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4143_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8403", "output": "{3, 1, 8403, 2801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011786", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "752.5000000000001", "output": "'0.7525000000000001 x 10^2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011787", "code": "def build_unique_users(queryset, ctype_as_string):\n    users = []\n    if ctype_as_string == 'comment':\n        for comment in queryset:\n            if comment.get('user') not in users:\n                users.append(comment.get('user'))\n    if ctype_as_string == 'contact':\n        for c in queryset:\n            if c.get('user') and c.get('user') not in users:\n                users.append(c.get('user'))\n    if not users:\n        return f\"Error finding content type: {ctype_as_string}\"\n    return users\n", "entry_point": "build_unique_users", "input": "[], 'comment'", "output": "'Error finding content type: comment'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120280_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011788", "code": "from typing import List\ndef maxWaterTrapped(height: List[int]) -> int:\n    left, right = 0, len(height) - 1\n    maxWater = 0\n    while left < right:\n        water = (right - left) * min(height[left], height[right])\n        maxWater = max(maxWater, water)\n        if height[left] < height[right]:\n            left += 1\n        else:\n            right -= 1\n    return maxWater\n", "entry_point": "maxWaterTrapped", "input": "[0, 1, 0, 3, 0, 1, 0, 5]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28209_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3218", "output": "{1609, 1, 3218, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3217", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011790", "code": "def gameOutcome(button_states: tuple[bool, bool, bool]) -> str:\n    if all(button_states):\n        return \"Win\"\n    elif button_states.count(False) == 1:\n        return \"Neutral\"\n    else:\n        return \"Lose\"\n", "entry_point": "gameOutcome", "input": "(False, True, True)", "output": "'Neutral'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136357_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011791", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "50, 60, 1", "output": "111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011792", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'eqqq \"some_value\"'", "output": "{'eqqq': 'N/A'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011793", "code": "def simulate_card_game(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    ties = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n        else:\n            ties += 1\n    return player1_wins, player2_wins, ties\n", "entry_point": "simulate_card_game", "input": "[5, 3, 2, 1, 4], [4, 2, 2, 3, 5]", "output": "(2, 2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74585_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011794", "code": "def latest_supported_api_version(input_date):\n    supported_api_versions = [\n        '2019-02-02',\n        '2019-07-07',\n        '2019-12-12',\n        '2020-02-10',\n    ]\n    for version in reversed(supported_api_versions):\n        if input_date >= version:\n            return version\n    return 'No supported API version available'\n", "entry_point": "latest_supported_api_version", "input": "'2020-02-10'", "output": "'2020-02-10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134418_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7662", "output": "{1, 2, 3, 6, 7662, 3831, 2554, 1277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011796", "code": "def count_valid_parentheses(n):\n    memo = {}\n    def count_valid_parentheses_recursive(open_count, close_count, memo):\n        if open_count == 0 and close_count == 0:\n            return 1\n        if open_count > close_count:\n            return 0\n        if (open_count, close_count) in memo:\n            return memo[(open_count, close_count)]\n        valid_count = 0\n        if open_count > 0:\n            valid_count += count_valid_parentheses_recursive(open_count - 1, close_count, memo)\n        if close_count > 0:\n            valid_count += count_valid_parentheses_recursive(open_count, close_count - 1, memo)\n        memo[(open_count, close_count)] = valid_count\n        return valid_count\n    return count_valid_parentheses_recursive(n, n, memo)\n", "entry_point": "count_valid_parentheses", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68128_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011797", "code": "from typing import List, Dict\ndef classify_users(users: List[Dict[str, any]]) -> Dict[str, List[Dict[str, any]]]:\n    natural_persons = []\n    organizations = []\n    for user in users:\n        if user.get('is_organization', False):\n            organizations.append(user)\n        else:\n            natural_persons.append(user)\n    return {'Natural Person': natural_persons, 'Organization': organizations}\n", "entry_point": "classify_users", "input": "[]", "output": "{'Natural Person': [], 'Organization': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115439_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8574", "output": "{1, 2, 3, 6, 2858, 1429, 8574, 4287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011799", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[0, 1, 2, 4, 3, 5, 3]", "output": "[1, 3, 6, 7, 8, 8, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011800", "code": "def validate_dog_size(size_code):\n    valid_sizes = ['S', 'M', 'L']\n    if size_code in valid_sizes:\n        return True\n    else:\n        return False\n", "entry_point": "validate_dog_size", "input": "'S'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74708_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011801", "code": "def max_sum_non_adjacent(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)\n        inclusive = exclusive + num\n        exclusive = new_exclusive\n    return max(inclusive, exclusive)\n", "entry_point": "max_sum_non_adjacent", "input": "[10, 5, 13]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148397_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011802", "code": "def find_duplicate(nums):\n    slow = nums[0]\n    fast = nums[0]\n    while True:\n        slow = nums[slow]\n        fast = nums[nums[fast]]\n        if slow == fast:\n            break\n    slow = nums[0]\n    while slow != fast:\n        slow = nums[slow]\n        fast = nums[fast]\n    return slow\n", "entry_point": "find_duplicate", "input": "[1, 2, 3, 4, 5, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2478_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011803", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[10, 5, 10]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011804", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'tunknown'", "output": "'tunknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011805", "code": "def average_string_length(lst):\n    total_length = 0\n    count = 0\n    for item in lst:\n        if isinstance(item, str):\n            total_length += len(item)\n            count += 1\n    if count == 0:\n        return 0\n    average_length = total_length / count\n    return round(average_length)\n", "entry_point": "average_string_length", "input": "['abcdefgh', 'abcdefghi', 'abcdefghij']", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106752_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011806", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'wowowrl'", "output": "{'wowowrl': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011807", "code": "import ast\ndef extract_info_from_script(script):\n    imported_modules = []\n    flask_app_name = None\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imported_modules.append(alias.name)\n        elif isinstance(node, ast.ImportFrom):\n            imported_modules.append(node.module)\n        elif isinstance(node, ast.Assign):\n            for target in node.targets:\n                if isinstance(target, ast.Attribute) and isinstance(target.value, ast.Name) and target.value.id == 'views':\n                    flask_app_name = target.attr\n    imported_modules = list(set(imported_modules))  # Remove duplicates\n    return imported_modules, flask_app_name\n", "entry_point": "extract_info_from_script", "input": "''", "output": "([], None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108965_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5035", "output": "{1, 5, 265, 5035, 1007, 19, 53, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8841", "output": "{1, 3, 2947, 421, 7, 8841, 1263, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8840", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011810", "code": "def evaluate_expression(expression):\n    try:\n        result = eval(expression)\n        return result\n    except ZeroDivisionError:\n        return \"Error: Division by zero\"\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "evaluate_expression", "input": "'5()'", "output": "\"Error: 'int' object is not callable\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79055_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5648", "output": "{1, 2, 706, 4, 1412, 353, 2824, 8, 5648, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5647", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011812", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'apple_music'", "output": "'Apple Music'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3842", "output": "{1, 3842, 2, 1921, 226, 34, 17, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3841", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011814", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[4, 1, 1, 2, 2, -1, 3, 1, 3]", "output": "[4, 5, 6, 8, 10, 9, 12, 13, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011815", "code": "from typing import List\ndef longest_subarray_length(nums: List[int]) -> int:\n    last_seen = {}\n    start = 0\n    max_length = 0\n    for end in range(len(nums)):\n        if nums[end] in last_seen and last_seen[nums[end]] >= start:\n            start = last_seen[nums[end]] + 1\n        last_seen[nums[end]] = end\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_subarray_length", "input": "[1, 2, 3, 1, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16612_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011816", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "13, 0", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011817", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[4, 4, 3, 0, 0, 7, 5, 5, 1]", "output": "[4, 3, 0, 7, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011818", "code": "def process_dict(data):\n    result = {}\n    for key, value in data.items():\n        if isinstance(value, dict):\n            result[key] = process_dict(value)\n        elif isinstance(value, int):\n            result[key] = value * 2\n        elif isinstance(value, str):\n            result[key] = value[::-1]\n        elif isinstance(value, list):\n            result[key] = sorted(value)\n        else:\n            result[key] = value\n    return result\n", "entry_point": "process_dict", "input": "{'a': 2, 'b': 'abcd', 'c': [3, 1, 2]}", "output": "{'a': 4, 'b': 'dcba', 'c': [1, 2, 3]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60796_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5545", "output": "{1, 5545, 1109, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011820", "code": "def get_message_format(recipient):\n    message_formats = {\n        \"Alice\": \"Hello, Alice! How are you today?\",\n        \"Bob\": \"Hey Bob! What's up?\",\n        \"Charlie\": \"Charlie, you're awesome!\"\n    }\n    if recipient in message_formats:\n        return message_formats[recipient]\n    else:\n        return \"Sorry, I can't send a message to that recipient.\"\n", "entry_point": "get_message_format", "input": "'Charlie'", "output": "\"Charlie, you're awesome!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45309_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011821", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 2:\n        raise ValueError(\"At least 2 scores are required.\")\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    return adjusted_sum / (len(scores) - 1)\n", "entry_point": "calculate_average_score", "input": "[50, 70, 80, 60, 61]", "output": "67.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35185_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011822", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3125", "output": "{1, 5, 625, 3125, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3124", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011823", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'the withe.'", "output": "'the withe.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011824", "code": "from typing import List\ndef sum_absolute_differences(list1: List[int], list2: List[int]) -> int:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0, 0], [30, 30, 30, 0]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44502_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011825", "code": "from typing import Dict\ndef is_my_seat(seats_taken: Dict[int, bool], seat_id: int) -> bool:\n    is_first_row = 0 <= seat_id <= 7\n    is_last_row = 1015 <= seat_id <= 1023\n    if is_first_row or is_last_row or seats_taken[seat_id] or not seats_taken.get(seat_id - 1, False) or not seats_taken.get(seat_id + 1, False):\n        return False\n    return True\n", "entry_point": "is_my_seat", "input": "{5: False, 4: True, 6: True}, 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48050_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011826", "code": "def evaluate_expression(expression):\n    expression = expression.replace('^', '**')  # Replace '^' with '**' for exponentiation\n    try:\n        result = eval(expression)  # Evaluate the expression\n        return result\n    except Exception as e:\n        return f\"Error: {e}\"  # Return an error message if evaluation fails\n", "entry_point": "evaluate_expression", "input": "''", "output": "'Error: invalid syntax (<string>, line 0)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72501_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011827", "code": "def combine_strings(func_name, str1, str2):\n    def ti(s1, s2):\n        return s1 + s2\n    def antya(s1, s2):\n        return s2 + s1\n    if func_name == \"ti\":\n        return ti(str1, str2)\n    elif func_name == \"antya\":\n        return antya(str1, str2)\n    else:\n        return \"Invalid function name\"\n", "entry_point": "combine_strings", "input": "'xyz', 'hello', 'world'", "output": "'Invalid function name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3414_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1942", "output": "{1, 2, 971, 1942}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1941", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011829", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 1, -1, 2, 3, -3, 1, -4, 2]", "output": "[1, 0, 1, 5, 0, -2, -3, -2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011830", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'7854560 9'", "output": "7854569", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011831", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "41, 118", "output": "(221, 61)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011832", "code": "def generate_identifier(input_string):\n    char_count = {}\n    for char in input_string:\n        if char not in char_count:\n            char_count[char] = 1\n        else:\n            char_count[char] += 1\n    sorted_char_count = dict(sorted(char_count.items()))\n    identifier = ''.join(str(ord(char)) for char in sorted_char_count.keys())\n    return int(identifier)\n", "entry_point": "generate_identifier", "input": "'hello'", "output": "101104108111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73073_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011833", "code": "import os\ndef determine_file_location(relative_root: str, location_type: str, root_folder: str = '') -> str:\n    MS_DATA = os.getenv('MS_DATA', '')  # Get the value of MS_DATA environment variable or default to empty string\n    if location_type == 'LOCAL':\n        full_path = os.path.join(root_folder, relative_root)\n    elif location_type == 'S3':\n        full_path = os.path.join('s3://' + root_folder, relative_root)\n    else:\n        raise ValueError(\"Invalid location type. Supported types are 'LOCAL' and 'S3'.\")\n    return full_path\n", "entry_point": "determine_file_location", "input": "'scripts/utils.py', 'LOCAL', '/usr/bin'", "output": "'/usr/bin/scripts/utils.py'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7795_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1604", "output": "{1, 2, 802, 4, 1604, 401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1603", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011835", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'1.2.3'", "output": "(1, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011836", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'GGLEL'", "output": "'LELGG'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "181", "output": "{1, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011838", "code": "def generateMatrix(n: int) -> [[int]]:\n    def fillMatrix(matrix, top, bottom, left, right, num):\n        if top > bottom or left > right:\n            return\n        # Fill top row\n        for i in range(left, right + 1):\n            matrix[top][i] = num\n            num += 1\n        top += 1\n        # Fill right column\n        for i in range(top, bottom + 1):\n            matrix[i][right] = num\n            num += 1\n        right -= 1\n        # Fill bottom row\n        if top <= bottom:\n            for i in range(right, left - 1, -1):\n                matrix[bottom][i] = num\n                num += 1\n            bottom -= 1\n        # Fill left column\n        if left <= right:\n            for i in range(bottom, top - 1, -1):\n                matrix[i][left] = num\n                num += 1\n            left += 1\n        fillMatrix(matrix, top, bottom, left, right, num)\n    matrix = [[None for _ in range(n)] for _ in range(n)]\n    fillMatrix(matrix, 0, n - 1, 0, n - 1, 1)\n    return matrix\n", "entry_point": "generateMatrix", "input": "2", "output": "[[1, 2], [4, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97938_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011839", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'equation.'", "output": "'equation.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011840", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'browjsn', 7", "output": "'browjsn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011841", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "None, 6, [1, 2, 3, 4, 5, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2501", "output": "{1, 61, 2501, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011843", "code": "def find_indices(nums, target):\n    num_indices = {}\n    for index, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], index]\n        num_indices[num] = index\n    return []\n", "entry_point": "find_indices", "input": "[3, 4], 7", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23894_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011844", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7984", "output": "{1, 2, 4, 998, 8, 1996, 7984, 16, 499, 3992}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7983", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011845", "code": "def concat_first_last_chars(strings):\n    result = []\n    for string in strings:\n        concatenated = string[0] + string[-1]\n        result.append(concatenated)\n    return result\n", "entry_point": "concat_first_last_chars", "input": "['xz', 'xz', 'df', 'df']", "output": "['xz', 'xz', 'df', 'df']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109926_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011846", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[0, 1, 2, 3, 4, 5, 10]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011847", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'UDSTBNB'", "output": "('UDST', 'BNB')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011848", "code": "from typing import List\ndef process_numbers(numbers: List[int]) -> List[int]:\n    processed_numbers = []\n    for index, num in enumerate(numbers):\n        total = num + index\n        if total % 2 == 0:\n            processed_numbers.append(total ** 2)\n        else:\n            processed_numbers.append(total ** 3)\n    return processed_numbers\n", "entry_point": "process_numbers", "input": "[1, 0, 1, 1, 1, 0]", "output": "[1, 1, 27, 16, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1098_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2687", "output": "{1, 2687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011850", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "7", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011851", "code": "def process_object(object_name: str, object_category: str) -> tuple:\n    source_value = None\n    endpoint_url = None\n    if object_category == \"data_source\":\n        source_value = \"ds_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/ds_smart_status\"\n        object_category = \"data_name\"\n    elif object_category == \"data_host\":\n        source_value = \"dh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/dh_smart_status\"\n    elif object_category == \"metric_host\":\n        source_value = \"mh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/mh_smart_status\"\n    body = \"{'\" + object_category + \"': '\" + object_name + \"'}\"\n    return source_value, endpoint_url, body\n", "entry_point": "process_object", "input": "'exampleject', 'asd'", "output": "(None, None, \"{'asd': 'exampleject'}\")", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133706_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011852", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[5, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18834_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011853", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0, 1, 1, 2, 2, 3, 4, 5, 5]", "output": "[0, 1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011854", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'r John S ', 11", "output": "'r%20John%20S%20'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011855", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[13, 14]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011856", "code": "def extract_frames(lidar_data, start_value):\n    frames = []\n    frame = []\n    for val in lidar_data:\n        if val == start_value:\n            if frame:\n                frames.append(frame)\n                frame = []\n        frame.append(val)\n    if frame:\n        frames.append(frame)\n    return frames\n", "entry_point": "extract_frames", "input": "[2, 2, 6, 3, 6, 6, 3, 2], 0", "output": "[[2, 2, 6, 3, 6, 6, 3, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49590_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011857", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011858", "code": "from datetime import date, timedelta\ndef weeks_dates(wky):\n    # Parse week number and year from the input string\n    wk = int(wky[:2])\n    yr = int(wky[2:])\n    # Calculate the starting date of the year\n    start_date = date(yr, 1, 1)\n    start_date += timedelta(6 - start_date.weekday())\n    # Calculate the date range for the given week number and year\n    delta = timedelta(days=(wk - 1) * 7)\n    date_start = start_date + delta\n    date_end = date_start + timedelta(days=6)\n    # Format the date range as a string\n    date_range = f'{date_start} to {date_end}'\n    return date_range\n", "entry_point": "weeks_dates", "input": "'4301'", "output": "'0001-10-28 to 0001-11-03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143506_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011859", "code": "def cost(B):\n    n = len(B)\n    dp = [[0, 0] for _ in range(n)]\n    dp[0][1] = B[0]\n    for i in range(1, n):\n        dp[i][0] = max(dp[i-1][0], dp[i-1][1])\n        dp[i][1] = B[i] + dp[i-1][0]\n    return min(dp[-1][0], dp[-1][1])\n", "entry_point": "cost", "input": "[20, 25]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37166_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011860", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[70, 80, 85, 90]", "output": "82.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56346_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011861", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "3.43, 1", "output": "3.43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt36", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011862", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@example.comm'", "output": "'example.comm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011863", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[-14, 0, 14]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27175_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011864", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(10, 10, 10)", "output": "1331", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011865", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'111.111.5'", "output": "(111, 111, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8139", "output": "{3, 1, 2713, 8139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011867", "code": "def calculate_absolute_differences_sum(arr):\n    total_diff = 0\n    for i in range(1, len(arr)):\n        total_diff += abs(arr[i] - arr[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences_sum", "input": "[1, 4, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67231_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011868", "code": "def find_contiguous_sum(numbers, target):\n    start = 0\n    end = 1\n    current_sum = numbers[start] + numbers[end]\n    while end < len(numbers):\n        if current_sum == target:\n            return min(numbers[start:end+1]) + max(numbers[start:end+1])\n        elif current_sum < target:\n            end += 1\n            current_sum += numbers[end]\n        else:\n            current_sum -= numbers[start]\n            start += 1\n    return None  # If no contiguous set is found\n", "entry_point": "find_contiguous_sum", "input": "[1, 1, 1, 1, 1, 5], 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12627_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011869", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'25 Jul 2021'", "output": "'Jul 25, 2021'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011870", "code": "def calculate_area_under_curve(x_values, y_values):\n    total_area = 0\n    for i in range(len(x_values) - 1):\n        x1, x2 = x_values[i], x_values[i + 1]\n        y1, y2 = y_values[i], y_values[i + 1]\n        total_area += 0.5 * (y1 + y2) * (x2 - x1)\n    return total_area\n", "entry_point": "calculate_area_under_curve", "input": "[0, 1, 2], [0, 2, 1]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59634_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011871", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[2, 0, 2, 2, 0, 2]", "output": "[2, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7265", "output": "{1, 5, 7265, 1453}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011873", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7274", "output": "{1, 7274, 2, 3637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011874", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average = round(average_score, 2)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[88.29, 88.29, 88.29, 88.29, 88.29, 88.29, 88.29, 88.29, 88.29, 88.3]", "output": "88.29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105956_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011875", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'WWdWHrld'", "output": "'XXeXIsme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011876", "code": "def count_vowels(s):\n    vowels = set('aeiouAEIOU')\n    count = 0\n    for char in s:\n        if char in vowels:\n            count += 1\n    return count\n", "entry_point": "count_vowels", "input": "'aeiouaei'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127363_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1921", "output": "{1, 1921, 17, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1920", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4507", "output": "{1, 4507}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011879", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[5, 3, 3, 100, 3, 3, 4, 119], 103, 100", "output": "[5, 3, 3, 103, 3, 3, 4, 103]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011880", "code": "DAYS = {0: 'Monday', 1: 'Tuesday', 2: 'Wednesday', 3: 'Thursday', 4: 'Friday', 5: 'Saturday', 6: 'Sunday'}\ndef store_hours(store_hours):\n    clean_time = ''\n    for key, value in store_hours.items():\n        if 'isOpen' in value and 'open' in value and 'close' in value:\n            if value['isOpen'] == 'true':\n                clean_time += DAYS[key] + ' ' + value['open'][:2] + ':' + value['open'][2:] + '-' + value['close'][:2] + ':' + value['close'][2:] + ';'\n            else:\n                clean_time += DAYS[key] + ' Closed;'\n    return clean_time\n", "entry_point": "store_hours", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_902_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011881", "code": "def maximum_product(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[4, 4, 5]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38245_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6611", "output": "{11, 1, 6611, 601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011883", "code": "def categorize_weights(weights):\n    category_dict = {1: [], 2: [], 3: [], 4: []}\n    for weight in weights:\n        if weight <= 10:\n            category_dict[1].append(weight)\n        elif weight <= 20:\n            category_dict[2].append(weight)\n        elif weight <= 30:\n            category_dict[3].append(weight)\n        else:\n            category_dict[4].append(weight)\n    return category_dict\n", "entry_point": "categorize_weights", "input": "[5, 5, 14, 13, 35, 35, 35]", "output": "{1: [5, 5], 2: [14, 13], 3: [], 4: [35, 35, 35]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1655_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011884", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4355", "output": "{1, 65, 4355, 67, 5, 871, 13, 335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011886", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "19", "output": "2584", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011887", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "614", "output": "{1, 2, 307, 614}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011888", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'slope'", "output": "'slope'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5977", "output": "{5977, 1, 43, 139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5976", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011890", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'ccea', 'hgru.hdfgdf'", "output": "'ccea/hgru.hdfgdf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011891", "code": "from copy import deepcopy\nxlim, ylim = 3, 2  # board dimensions\n# The eight movement directions possible for a chess queen\nRAYS = [(1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1)]\ndef can_reach_target(current_pos, target_pos):\n    if current_pos == target_pos:\n        return False  # Queen is already at the target position\n    for dx, dy in RAYS:\n        new_pos = (current_pos[0] + dx, current_pos[1] + dy)\n        if 0 <= new_pos[0] < xlim and 0 <= new_pos[1] < ylim and new_pos == target_pos:\n            return True\n    return False\n", "entry_point": "can_reach_target", "input": "(1, 1), (1, 1)", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74743_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011892", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7634", "output": "{1, 2, 3817, 11, 7634, 694, 22, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011893", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[2, 3, 4, 5, 6]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011894", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[1, 1, 1, 2, 2, 2, 0, 0], 3", "output": "[1, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011895", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[5, 12, 18, 18, 18]", "output": "[12, 18, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011896", "code": "from typing import List\ndef find_missing_numbers(input_list: List[int]) -> List[int]:\n    if not input_list:\n        return []\n    min_val, max_val = min(input_list), max(input_list)\n    full_range = set(range(min_val, max_val + 1))\n    input_set = set(input_list)\n    missing_numbers = sorted(full_range.difference(input_set))\n    return missing_numbers\n", "entry_point": "find_missing_numbers", "input": "[5, 7]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125580_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011897", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'11110X'", "output": "['111100', '111101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011898", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4925", "output": "{1, 5, 197, 985, 4925, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4924", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011899", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "52, 2", "output": "1326", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1074", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011900", "code": "import re\ndef extract_folder_paths(code_snippet):\n    folder_paths = {}\n    # Regular expression pattern to match folder paths assigned to variables\n    pattern = r'(\\w+)\\s*=\\s*\"([^\"]+)\"'\n    # Find all matches of the pattern in the code snippet\n    matches = re.findall(pattern, code_snippet)\n    # Populate the dictionary with folder names and paths\n    for match in matches:\n        folder_name, folder_path = match\n        folder_paths[folder_name] = folder_path\n    return folder_paths\n", "entry_point": "extract_folder_paths", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74474_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011901", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8726", "output": "{1, 2, 4363, 8726}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011902", "code": "def generate_portables_mention_string(portables_channel_ids):\n    portables_channel_mentions = [f'<#{id}>' for id in portables_channel_ids]\n    if len(portables_channel_mentions) == 1:\n        return portables_channel_mentions[0]\n    else:\n        return ', '.join(portables_channel_mentions[:-1]) + ', or ' + portables_channel_mentions[-1]\n", "entry_point": "generate_portables_mention_string", "input": "[122, 122, 788, 122, 122]", "output": "'<#122>, <#122>, <#788>, <#122>, or <#122>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60152_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011903", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[4, 5], 2", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011904", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    max_height = 0\n    for height in buildings:\n        total_area += max(0, height - max_height)\n        max_height = max(max_height, height)\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[1, 2, 6, 4, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140682_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011905", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "[3, 3, 4, 4, 3]", "output": "3.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4912", "output": "{1, 2, 4, 614, 8, 1228, 4912, 16, 307, 2456}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4911", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011907", "code": "def extract_semantic_version(version):\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(''.join(filter(str.isdigit, version_parts[2])))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.1.0'", "output": "(0, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111562_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011908", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2621", "output": "{1, 2621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3065", "output": "{1, 5, 613, 3065}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6214", "output": "{1, 2, 3107, 6214, 13, 239, 26, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6213", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011911", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9529", "output": "{733, 1, 13, 9529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011912", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6062", "output": "{1, 2, 866, 7, 6062, 14, 433, 3031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011913", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3374", "output": "{1, 2, 482, 7, 3374, 14, 241, 1687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011914", "code": "def calculate_average_position(points):\n    sum_x, sum_y, sum_z = 0, 0, 0\n    total_points = len(points)\n    for point in points:\n        sum_x += point[0]\n        sum_y += point[1]\n        sum_z += point[2]\n    avg_x = sum_x / total_points\n    avg_y = sum_y / total_points\n    avg_z = sum_z / total_points\n    return (avg_x, avg_y, avg_z)\n", "entry_point": "calculate_average_position", "input": "[(2.0, 5.0, 8.0), (4.0, 7.0, 10.0)]", "output": "(3.0, 6.0, 9.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24711_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011915", "code": "def binary_search(target, lst):\n    low = 0\n    high = len(lst) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if lst[mid] == target:\n            return mid\n        elif lst[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return low\n", "entry_point": "binary_search", "input": "5, [1, 3, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43298_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011916", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[], 3", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011917", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 1, 2, 2, 3]", "output": "{1: 3, 2: 2, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011918", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[1, 2, 2, 3, 3, 4, 8]", "output": "[1, 2, 2, 3, 3, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011919", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n in [0, 1]:\n        return n\n    else:\n        result = fibonacci_memo(n-1, memo) + fibonacci_memo(n-2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83419_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011920", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[6, 3, 5]", "output": "(6, 15)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011921", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[3, 3, 4, 2, 0, 0]", "output": "[3, 4, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011922", "code": "from typing import List, Tuple\ndef classify_entries(line_numbers: List[int]) -> Tuple[List[int], List[int], List[int]]:\n    NOT_AN_ENTRY = set([\n        326, 330, 332, 692, 1845, 6016, 17859, 24005, 49675, 97466, 110519, 118045,\n        119186, 126386\n    ])\n    ALWAYS_AN_ENTRY = set([\n        12470, 17858, 60157, 60555, 60820, 75155, 75330, 77825, 83439, 84266,\n        94282, 97998, 102650, 102655, 102810, 102822, 102895, 103897, 113712,\n        113834, 119068, 123676\n    ])\n    always_starts_entry = [num for num in line_numbers if num in ALWAYS_AN_ENTRY]\n    never_starts_entry = [num for num in line_numbers if num in NOT_AN_ENTRY]\n    ambiguous_starts_entry = [num for num in line_numbers if num not in ALWAYS_AN_ENTRY and num not in NOT_AN_ENTRY]\n    return always_starts_entry, never_starts_entry, ambiguous_starts_entry\n", "entry_point": "classify_entries", "input": "[330, 1, 5, 17857, 331, 4, 2]", "output": "([], [330], [1, 5, 17857, 331, 4, 2])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61128_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011923", "code": "import math\ndef calculate_rmse(actual_values, predicted_values):\n    if len(actual_values) != len(predicted_values):\n        raise ValueError(\"Length of actual and predicted values should be the same.\")\n    squared_diff = [(actual - predicted) ** 2 for actual, predicted in zip(actual_values, predicted_values)]\n    mean_squared_diff = sum(squared_diff) / len(actual_values)\n    rmse = math.sqrt(mean_squared_diff)\n    return rmse\n", "entry_point": "calculate_rmse", "input": "[0, 5, 10, 15, 20], [5, 10, 15, 20, 25]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102976_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011924", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5674", "output": "{1, 5674, 2, 2837}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011925", "code": "def calculate_u(w, x0, n):\n    w0 = w + sum(x0)\n    u = [w0] * n\n    return u\n", "entry_point": "calculate_u", "input": "10, [3, 4], 3", "output": "[17, 17, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54111_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011926", "code": "def calculate_cumulative_demand(energy_demand_data, delivery_point):\n    cumulative_demand = {}\n    for energy, demand_data in energy_demand_data.items():\n        cumulative_demand[energy] = {}\n        total_demand = 0\n        for technology, demand in demand_data.items():\n            if technology == \"Electric Vehicles\" and delivery_point == \"Vehicle to Grid\":\n                demand = demand[\"consumption\"] - demand[\"generation\"]\n            total_demand += demand\n            cumulative_demand[energy][technology] = total_demand\n    return cumulative_demand\n", "entry_point": "calculate_cumulative_demand", "input": "{}, 'Vehicle to Grid'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69338_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011927", "code": "def get_data_form_template_path(model_id):\n    DATA_TEMPLATES = {1: 'forms/rtbh_rule.j2', 4: 'forms/ipv4_rule.j2', 6: 'forms/ipv6_rule.j2'}\n    DEFAULT_SORT = {1: 'ivp4', 4: 'source', 6: 'source'}\n    return DATA_TEMPLATES.get(model_id, DATA_TEMPLATES.get(1, 'forms/default_rule.j2'))\n", "entry_point": "get_data_form_template_path", "input": "1", "output": "'forms/rtbh_rule.j2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130729_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011928", "code": "def count_redis_cache_configurations(settings_dict):\n    caches = settings_dict.get('CACHES', {})\n    redis_cache_count = 0\n    for cache_name, cache_config in caches.items():\n        if cache_config.get('BACKEND') == 'django_redis.cache.RedisCache':\n            redis_cache_count += 1\n    return redis_cache_count\n", "entry_point": "count_redis_cache_configurations", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142696_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011929", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "201", "output": "b'\\xc9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011930", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 4]", "output": "[6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110145_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011931", "code": "def max_equal_apples(apples):\n    total_apples = sum(apples)\n    if total_apples % len(apples) == 0:\n        return total_apples // len(apples)\n    else:\n        return 0\n", "entry_point": "max_equal_apples", "input": "[6, 6, 6, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66277_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011932", "code": "def simulate_card_game(player1_deck, player2_deck):\n    while player1_deck and player2_deck:\n        player1_card = player1_deck.pop(0)\n        player2_card = player2_deck.pop(0)\n        if player1_card > player2_card:\n            player1_deck.extend([player1_card, player2_card])\n        elif player2_card > player1_card:\n            player2_deck.extend([player2_card, player1_card])\n        else:  # War\n            if len(player1_deck) < 3 or len(player2_deck) < 3:\n                return \"Draw\"  # Not enough cards for war\n            else:\n                war_cards = [player1_card, player2_card]\n                for _ in range(3):\n                    war_cards.append(player1_deck.pop(0))\n                    war_cards.append(player2_deck.pop(0))\n                if sum(war_cards[:4]) > sum(war_cards[4:]):\n                    player1_deck.extend(war_cards)\n                else:\n                    player2_deck.extend(war_cards)\n    return \"Player 1 wins\" if player1_deck else \"Player 2 wins\"\n", "entry_point": "simulate_card_game", "input": "[5, 5], [5, 5]", "output": "'Draw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134393_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011933", "code": "def filter_versions(versions, min_version):\n    def version_tuple(version_str):\n        return tuple(map(int, version_str.split(\".\")))\n    min_version_tuple = version_tuple(min_version)\n    filtered_versions = []\n    for version in versions:\n        if version_tuple(version) >= min_version_tuple:\n            filtered_versions.append(version)\n    return filtered_versions\n", "entry_point": "filter_versions", "input": "['0.9', '1.0.0', '1.0', '2'], '1.0'", "output": "['1.0.0', '1.0', '2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8232_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011934", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[1, 5, 0, 7, 5, 7, 0, 1, 0]", "output": "[1, 6, 2, 10, 9, 12, 6, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011935", "code": "def pageCount(n, p):\n    # Calculate pages turned from the front\n    front_turns = p // 2\n    # Calculate pages turned from the back\n    if n % 2 == 0:\n        back_turns = (n - p) // 2\n    else:\n        back_turns = (n - p - 1) // 2\n    return min(front_turns, back_turns)\n", "entry_point": "pageCount", "input": "0, -10", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96390_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011936", "code": "def simulate_card_game(deck1, deck2, rounds):\n    player1_wins = 0\n    player2_wins = 0\n    for _ in range(rounds):\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return f\"Player 1 wins {player1_wins} rounds, Player 2 wins {player2_wins} rounds\"\n", "entry_point": "simulate_card_game", "input": "[3, 4, 2], [1, 2, 5], 3", "output": "'Player 1 wins 2 rounds, Player 2 wins 1 rounds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77971_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011937", "code": "def convert_memory_size(memory_size):\n    units = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n    conversion_rates = [1, 1024, 1024**2, 1024**3, 1024**4]\n    for idx, rate in enumerate(conversion_rates):\n        if memory_size < rate or idx == len(conversion_rates) - 1:\n            converted_size = memory_size / conversion_rates[idx - 1]\n            return f\"{converted_size:.2f} {units[idx - 1]}\"\n", "entry_point": "convert_memory_size", "input": "1022", "output": "'1022.00 Bytes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149300_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011938", "code": "# Sample data for demonstration\nLOCALEDIR = '/path/to/locales'\nlangcodes = ['en', 'fr', 'de', 'es', 'it']\ntranslates = {'en': 'English', 'fr': 'French', 'de': 'German', 'es': 'Spanish', 'it': 'Italian'}\ndef get_language_name(language_code):\n    return translates.get(language_code, \"Language not found\")\n", "entry_point": "get_language_name", "input": "'it'", "output": "'Italian'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94235_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011939", "code": "def modify_template_name(template_name: str) -> str:\n    # Trim leading and trailing whitespace, convert to lowercase, and return\n    return template_name.strip().lower()\n", "entry_point": "modify_template_name", "input": "'   MyTemplate   '", "output": "'mytemplate'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116239_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6851", "output": "{1, 6851, 13, 527, 17, 403, 221, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011941", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7153", "output": "{1, 311, 7153, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011942", "code": "import os\ndef should_write_binary(file_path: str) -> bool:\n    file_name, file_extension = os.path.splitext(file_path)\n    return file_extension == \".bin\"\n", "entry_point": "should_write_binary", "input": "'file.bin'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124717_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011943", "code": "def categorize_indices(indices):\n    categorized_indices = {'Low': [], 'Medium': [], 'High': []}\n    for index, count in indices.items():\n        if count < 1000:\n            categorized_indices['Low'].append(index)\n        elif 1000 <= count <= 10000:\n            categorized_indices['Medium'].append(index)\n        elif count > 10000:\n            categorized_indices['High'].append(index)\n    return categorized_indices\n", "entry_point": "categorize_indices", "input": "{}", "output": "{'Low': [], 'Medium': [], 'High': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97452_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011944", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'bb'", "output": "{'b': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2818", "output": "{1, 2818, 2, 1409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011946", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "364", "output": "{1, 2, 4, 7, 364, 13, 14, 52, 182, 26, 91, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt363", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011947", "code": "def calculate_moving_average(fmeter_values, N):\n    moving_averages = []\n    for i in range(len(fmeter_values) - N + 1):\n        window = fmeter_values[i:i + N]\n        average = sum(window) / N\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[18, 20, 20, 21.5, 23], 3", "output": "[19.333333333333332, 20.5, 21.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67817_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011948", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5199", "output": "{1, 3, 1733, 5199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011949", "code": "def find_missing(S):\n    full_set = set(range(10))\n    sum_S = sum(S)\n    sum_full_set = sum(full_set)\n    return sum_full_set - sum_S\n", "entry_point": "find_missing", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109203_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011950", "code": "from collections import Counter\nimport string\ndef find_top_words(text, n):\n    # Tokenize the text into words\n    words = text.lower().translate(str.maketrans('', '', string.punctuation)).split()\n    # Define common English stopwords\n    stop_words = set([\"i\", \"me\", \"my\", \"myself\", \"we\", \"our\", \"ours\", \"ourselves\", \"you\", \"your\", \"yours\", \"yourself\", \"yourselves\", \"he\", \"him\", \"his\", \"himself\", \"she\", \"her\", \"hers\", \"herself\", \"it\", \"its\", \"itself\", \"they\", \"them\", \"their\", \"theirs\", \"themselves\", \"what\", \"which\", \"who\", \"whom\", \"this\", \"that\", \"these\", \"those\", \"am\", \"is\", \"are\", \"was\", \"were\", \"be\", \"been\", \"being\", \"have\", \"has\", \"had\", \"having\", \"do\", \"does\", \"did\", \"doing\", \"a\", \"an\", \"the\", \"and\", \"but\", \"if\", \"or\", \"because\", \"as\", \"until\", \"while\", \"of\", \"at\", \"by\", \"for\", \"with\", \"about\", \"against\", \"between\", \"into\", \"through\", \"during\", \"before\", \"after\", \"above\", \"below\", \"to\", \"from\", \"up\", \"down\", \"in\", \"out\", \"on\", \"off\", \"over\", \"under\", \"again\", \"further\", \"then\", \"once\", \"here\", \"there\", \"when\", \"where\", \"why\", \"how\", \"all\", \"any\", \"both\", \"each\", \"few\", \"more\", \"most\", \"other\", \"some\", \"such\", \"no\", \"nor\", \"not\", \"only\", \"own\", \"same\", \"so\", \"than\", \"too\", \"very\", \"s\", \"t\", \"can\", \"will\", \"just\", \"don\", \"should\", \"now\"])\n    # Remove stopwords from the tokenized words\n    filtered_words = [word for word in words if word not in stop_words]\n    # Count the frequency of each word\n    word_freq = Counter(filtered_words)\n    # Sort the words based on their frequencies\n    sorted_words = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)\n    # Output the top N most frequent words along with their frequencies\n    top_words = sorted_words[:n]\n    return top_words\n", "entry_point": "find_top_words", "input": "'frequen', 1", "output": "[('frequen', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52632_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011951", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "4", "output": "'Mars'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011952", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6077", "output": "{1, 59, 6077, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011953", "code": "def calculate_average(data):\n    total_noisy_add = sum(sample[0] for sample in data)\n    total_std_add = sum(sample[1] for sample in data)\n    average_noisy_add = total_noisy_add / len(data)\n    average_std_add = total_std_add / len(data)\n    return (average_noisy_add, average_std_add)\n", "entry_point": "calculate_average", "input": "[(16.0, 3.0), (17.0, 3.0)]", "output": "(16.5, 3.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73285_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011954", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'789'", "output": "789", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011955", "code": "def reverse_lookup(dictionary, value):\n    keys_with_value = []\n    for key, val in dictionary.items():\n        if val == value:\n            keys_with_value.append(key)\n    return keys_with_value\n", "entry_point": "reverse_lookup", "input": "{}, 'some_value'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33667_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011956", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "-5, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011957", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'Pyiin'", "output": "['Pyiin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011958", "code": "import time\ndef convert_epoch_time(seconds):\n    time_struct = time.gmtime(seconds)\n    formatted_time = time.strftime('%a %b %d %H:%M:%S %Y', time_struct)\n    return formatted_time\n", "entry_point": "convert_epoch_time", "input": "4", "output": "'Thu Jan 01 00:00:04 1970'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107337_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011959", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 2, 3, 6, 6, 7, 7, 1, 7]", "output": "[3, 3, 5, 9, 10, 12, 13, 8, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011960", "code": "def encrypt_string(s: str, shift: int) -> str:\n    encrypted_string = \"\"\n    for char in s:\n        if char.isupper():\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_char = chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_char = char\n        encrypted_string += encrypted_char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'Hello, World!', 3", "output": "'Khoor, Zruog!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74768_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011961", "code": "def count_character_occurrences(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_character_occurrences", "input": "'hello, hello,'", "output": "{'h': 2, 'e': 2, 'l': 4, 'o': 2, ',': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87306_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011962", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[34, 90, 12, 91, 90, 12, 25, 90]", "output": "[12, 12, 25, 34, 90, 90, 90, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011963", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[25]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5341", "output": "{1, 7, 109, 49, 763, 5341}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011965", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3925", "output": "{1, 5, 785, 3925, 25, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3924", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011966", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[10, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011967", "code": "def calculate_grayscale(r: int, g: int, b: int) -> int:\n    grayscale = int(0.299 * r + 0.587 * g + 0.114 * b)\n    return grayscale\n", "entry_point": "calculate_grayscale", "input": "0, 6, 0", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80937_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011968", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[1, 1, 1, 1, 2, 2, 4, 4]", "output": "{1: 4, 2: 2, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011969", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[1, 7, 7, 8, 8, 6, 6, 0]", "output": "[7, 7, 8, 8, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011970", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "9", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011971", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4853", "output": "{1, 211, 4853, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011972", "code": "import math\ndef my_CribleEratosthene(n):\n    is_prime = [True] * (n+1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n+1, i):\n                is_prime[j] = False\n    primes = [num for num in range(2, n+1) if is_prime[num]]\n    return primes\n", "entry_point": "my_CribleEratosthene", "input": "13", "output": "[2, 3, 5, 7, 11, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55274_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011973", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "21, 'mode', 0", "output": "{'response': 'InvalidPin', 'pin': 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011974", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[0, 2, 4, 8, 10, 30]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86698_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3859", "output": "{1, 3859, 17, 227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011976", "code": "from collections import deque\ndef min_steps_to_cover_all_empty_cells(grid):\n    m, n = len(grid), len(grid[0])\n    q = deque()\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 2:\n                q.append([i, j, 0])\n    steps = 0\n    while q:\n        k = len(q)\n        visited = set()\n        for _ in range(k):\n            rx, ry, steps = q.popleft()\n            for dx, dy in [[-1, 0], [1, 0], [0, -1], [0, 1]]:\n                nx, ny = rx + dx, ry + dy\n                if nx < 0 or nx >= m or ny < 0 or ny >= n or grid[nx][ny] != 0 or (nx, ny) in visited:\n                    continue\n                visited.add((nx, ny))\n                grid[nx][ny] = 2\n                q.append([nx, ny, steps + 1])\n    for row in grid:\n        if 0 in row:\n            return -1  # Not all empty cells are reachable\n    return steps\n", "entry_point": "min_steps_to_cover_all_empty_cells", "input": "[[2, 0, 0], [1, 1, 0], [0, 0, 0]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128007_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011977", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2403", "output": "{1, 801, 3, 2403, 9, 267, 89, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011979", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 2, 3, 0, 0, 3, 4, 2, 2]", "output": "[9, 4, 9, 0, 0, 9, 8, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011980", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[1, 1, 3, 3, 4, 3, 2, 4, 2]", "output": "[1, 3, 4, 3, 2, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "899", "output": "{1, 899, 29, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011982", "code": "def calculate_average_excluding_outliers(numbers, threshold):\n    if not numbers:\n        return 0\n    median = sorted(numbers)[len(numbers) // 2]\n    filtered_numbers = [num for num in numbers if abs(num - median) <= threshold * median]\n    if not filtered_numbers:\n        return 0\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_excluding_outliers", "input": "[20, 25, 30], 0.2", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65048_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011983", "code": "def generate_error_endpoint(blueprint_name, url_prefix):\n    # Concatenate the URL prefix with the blueprint name to form the complete API endpoint URL\n    api_endpoint = f\"{url_prefix}/{blueprint_name}\"\n    return api_endpoint\n", "entry_point": "generate_error_endpoint", "input": "'errorerrorre', '/apis'", "output": "'/apis/errorerrorre'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69413_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011984", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4376", "output": "{1, 2, 547, 4, 1094, 8, 2188, 4376}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011985", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'10-80'", "output": "-70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011986", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'3.1'", "output": "(3, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5621", "output": "{1, 803, 7, 73, 11, 77, 5621, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011988", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'ThbrobbThe '", "output": "'ThbrobbThe,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011989", "code": "def find_twice_chars(input_str):\n    char_count = {}\n    result = []\n    for char in input_str:\n        char_count[char] = char_count.get(char, 0) + 1\n        if char_count[char] == 2:\n            result.append(char)\n    return result\n", "entry_point": "find_twice_chars", "input": "'hello'", "output": "['l']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135967_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011990", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[1, 2, 2, 3, 3, 3, 4]", "output": "([1, 2, 3, 4], [1, 2, 3, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011991", "code": "def alphabet_positions(input_string):\n    positions = {}\n    for char in input_string:\n        if char.isalpha() and char.islower():\n            positions[char] = ord(char) - ord('a') + 1\n    return positions\n", "entry_point": "alphabet_positions", "input": "'e'", "output": "{'e': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73805_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011992", "code": "import re\ndef average_imported_module_length(script):\n    imported_modules = re.findall(r'import\\s+(\\S+)|from\\s+(\\S+)\\s+import', script)\n    module_names = [module for group in imported_modules for module in group if module]\n    module_lengths = [len(module.replace(',', '')) for module in module_names]\n    if module_lengths:\n        return sum(module_lengths) / len(module_lengths)\n    else:\n        return 0\n", "entry_point": "average_imported_module_length", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107552_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1183", "output": "{1, 7, 169, 13, 91, 1183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011994", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[60, 70, 73, 78, 90]", "output": "73.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38748_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5927", "output": "{1, 5927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011996", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'test.olleh.olloloo'", "output": "'olloloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011997", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0.00\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[83.44, 83.44]", "output": "83.44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122959_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011998", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'ell2ell3'", "output": "'ELL#ELL#'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0011999", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 2, 2, 4, 2, 4, 2]", "output": "[1, 3, 4, 7, 6, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012000", "code": "def modify_list(input_list):\n    input_list.insert(3, 7)  # Insert 7 at index 3\n    input_list.pop()  # Remove the last element\n    input_list.reverse()  # Reverse the list\n    return input_list\n", "entry_point": "modify_list", "input": "[6, 6, 4, 7, 4, 6, 7, 0]", "output": "[7, 6, 4, 7, 7, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29418_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012001", "code": "import math\n# Define the factorial function using recursion\ndef factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "8", "output": "40320", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52131_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012002", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3938", "output": "{1, 3938, 2, 358, 11, 1969, 179, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012003", "code": "CJ_PATH = r''\nCOOKIES_PATH = r''\nCHAN_ID = ''\nVID_ID = ''\ndef replace_variables(input_string, variable_type):\n    if variable_type == 'CHAN_ID':\n        return input_string.replace('CHAN_ID', CHAN_ID)\n    elif variable_type == 'VID_ID':\n        return input_string.replace('VID_ID', VID_ID)\n    else:\n        return input_string\n", "entry_point": "replace_variables", "input": "'isan', 'random_type'", "output": "'isan'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27344_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012004", "code": "def fill(patterns):\n    filled_words = []\n    for pattern in patterns:\n        if isinstance(pattern, list):\n            filled_word = ''.join([pattern[0][i] if pattern[0][i] != '_' else pattern[1][i] for i in range(len(pattern[0]))])\n            filled_words.append(filled_word)\n    return filled_words\n", "entry_point": "fill", "input": "[['_p', 's']]", "output": "['sp']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37042_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012005", "code": "from typing import Tuple\nimport math\ndef calculate_distance(point1: Tuple[int, int], point2: Tuple[int, int]) -> float:\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0), (3, 4)", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60623_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012006", "code": "from typing import List\ndef count_successful_commands(commands: List[str]) -> int:\n    successful_count = 0\n    for command in commands:\n        if \"error\" not in command.lower():\n            successful_count += 1\n    return successful_count\n", "entry_point": "count_successful_commands", "input": "['run command', 'this command has an error', 'execute task']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32409_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012007", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7967", "output": "{1, 31, 257, 7967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012008", "code": "import unicodedata\ndef count_unique_alphanumeric_chars(input_str):\n    alphanumeric_chars = set()\n    for char in input_str:\n        if unicodedata.category(char).startswith(\"L\") or unicodedata.category(char).startswith(\"N\"):\n            alphanumeric_chars.add(char.lower())\n    return len(alphanumeric_chars)\n", "entry_point": "count_unique_alphanumeric_chars", "input": "'abc123'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45124_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012009", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3063", "output": "{1, 3, 1021, 3063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012010", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'15m'", "output": "900", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012011", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[80, 69, 66, 10, 50, 30]", "output": "[80, 69, 66]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012012", "code": "def populate_rois_lod(rois):\n    rois_lod = [[]]  # Initialize with an empty sublist\n    for element in rois:\n        if isinstance(element, int):\n            rois_lod[-1].append(element)  # Add integer to the last sublist\n        elif isinstance(element, list):\n            rois_lod.append(element.copy())  # Create a new sublist with elements of the list\n    return rois_lod\n", "entry_point": "populate_rois_lod", "input": "[1, [2, 3, 4], [5, 6, 7]]", "output": "[[1], [2, 3, 4], [5, 6, 7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2890_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012013", "code": "def calculate_ascii_products(ascii_list, special_char):\n    ascii_dict = {}\n    for ascii_code in ascii_list:\n        letter = chr(ascii_code)\n        product = ascii_code * special_char\n        ascii_dict[letter] = product\n    return ascii_dict\n", "entry_point": "calculate_ascii_products", "input": "[89, 83, 73, 80], 41", "output": "{'Y': 3649, 'S': 3403, 'I': 2993, 'P': 3280}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85308_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012014", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[2, 2, 5, 5, -1, 4, 0, 3]", "output": "{2: 2, 5: 2, -1: 1, 4: 1, 0: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012015", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 3, 7, 4, 3, 4]", "output": "[1, 4, 9, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012016", "code": "def merge_sorted_arrays(arr1, arr2):\n    merged = []\n    i, j = 0, 0\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] < arr2[j]:\n            merged.append(arr1[i])\n            i += 1\n        else:\n            merged.append(arr2[j])\n            j += 1\n    merged.extend(arr1[i:])\n    merged.extend(arr2[j:])\n    return merged\n", "entry_point": "merge_sorted_arrays", "input": "[1, 3, 5, 6, 8], [0, 1, 4, 5, 8]", "output": "[0, 1, 1, 3, 4, 5, 5, 6, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75408_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012017", "code": "def transform_data(data):\n    nested_data = {}\n    for item in data:\n        for key, value in item.items():\n            keys = key.split('_')\n            current_dict = nested_data\n            for k in keys[:-1]:\n                current_dict = current_dict.setdefault(k, {})\n            if keys[-1] in current_dict:\n                if not isinstance(current_dict[keys[-1]], list):\n                    current_dict[keys[-1]] = [current_dict[keys[-1]]]\n                current_dict[keys[-1]].append(value)\n            else:\n                current_dict[keys[-1]] = value\n    return nested_data\n", "entry_point": "transform_data", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57961_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012018", "code": "def parse(data):\n    key_start = data.find(':') + 2  # Find the start index of the key\n    key_end = data.find('=', key_start)  # Find the end index of the key\n    key = data[key_start:key_end].strip()  # Extract and strip the key\n    value_start = data.find('\"', key_end) + 1  # Find the start index of the value\n    value_end = data.rfind('\"')  # Find the end index of the value\n    value = data[value_start:value_end]  # Extract the value\n    # Unescape the escaped characters in the value\n    value = value.replace('\\\\\"', '\"').replace('\\\\\\\\', '\\\\')\n    return {key: [value]}  # Return the key-value pair as a dictionary\n", "entry_point": "parse", "input": "'key: odo}\"}o = \"\"'", "output": "{'odo}\"}o': ['']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85764_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012019", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'VV'", "output": "'VV'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012020", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[85, 87, 88], 3", "output": "86.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7171", "output": "{1, 7171, 101, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012022", "code": "def solve(num_stairs, points):\n    dp = [0] * (num_stairs + 1)\n    dp[1] = points[1]\n    for i in range(2, num_stairs + 1):\n        dp[i] = max(points[i] + dp[i - 1], dp[i - 2] + points[i])\n    return dp[num_stairs]\n", "entry_point": "solve", "input": "3, [0, 10, 12, 5]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147689_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6865", "output": "{1, 6865, 5, 1373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6864", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012024", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "18", "output": "0.02333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012025", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2062", "output": "{1, 2, 2062, 1031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012026", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105369_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9848", "output": "{1, 2, 4, 8, 1231, 9848, 4924, 2462}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9847", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012028", "code": "def search(s: str, pattern: str) -> int:\n    if len(s) < len(pattern):\n        return 0\n    if s[:len(pattern)] == pattern:\n        return 1 + search(s[len(pattern):], pattern)\n    else:\n        return search(s[1:], pattern)\n", "entry_point": "search", "input": "'a', 'abc'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118249_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7024", "output": "{1, 2, 4, 8, 878, 7024, 16, 439, 3512, 1756}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7023", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012030", "code": "def process_mesh_files(sfm_fp, mesh_fp, image_dp):\n    log_messages = []\n    if mesh_fp is not None:\n        log_messages.append(\"Found the following mesh file: \" + mesh_fp)\n    else:\n        log_messages.append(\"Request target mesh does not exist in this project.\")\n    return log_messages\n", "entry_point": "process_mesh_files", "input": "None, 'hh/', None", "output": "['Found the following mesh file: hh/']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140821_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012031", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5393", "output": "{1, 5393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012032", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[1, 5, 6, 4, 5, 5, 5, 0]", "output": "[5, 6, 4, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4907", "output": "{1, 4907, 701, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012034", "code": "def kendall_tau_distance(permutation1, permutation2):\n    distance = 0\n    n = len(permutation1)\n    for i in range(n):\n        for j in range(i+1, n):\n            if (permutation1[i] < permutation1[j] and permutation2[i] > permutation2[j]) or \\\n               (permutation1[i] > permutation1[j] and permutation2[i] < permutation2[j]):\n                distance += 1\n    return distance\n", "entry_point": "kendall_tau_distance", "input": "[1, 2, 3, 4], [2, 1, 4, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101117_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012035", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if isinstance(num, int) and is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[19, 7, 5]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148587_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012036", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454396", "output": "'<t:1630454396>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012037", "code": "def get_unique_elements(input_list):\n    unique_strings = set()\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, str):\n            unique_strings.add(element)\n        elif isinstance(element, int):\n            unique_integers.add(element)\n    unique_elements = list(unique_strings) + list(unique_integers)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "['SSalJohhnly', 0, 1, 2]", "output": "['SSalJohhnly', 0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17731_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012038", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[20, 22]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012039", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hehworldwow'", "output": "['hehworldwow']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012040", "code": "def sum_of_squares_of_evens(lst):\n    total = 0\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[4, 10]", "output": "116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97226_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012041", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "8", "output": "'1000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012042", "code": "def most_accessed_memory_address(memory_addresses):\n    address_count = {}\n    for address in memory_addresses:\n        if address in address_count:\n            address_count[address] += 1\n        else:\n            address_count[address] = 1\n    max_count = max(address_count.values())\n    most_accessed_addresses = [address for address, count in address_count.items() if count == max_count]\n    return min(most_accessed_addresses)\n", "entry_point": "most_accessed_memory_address", "input": "[11, 11, 12, 12, 13]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123494_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012043", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "\"'PyQteeQut'\"", "output": "'PyQteeQut'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2494", "output": "{1, 2, 43, 86, 58, 29, 2494, 1247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012045", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1462", "output": "{1, 2, 34, 43, 17, 1462, 86, 731}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1461", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012046", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'exampleffif'", "output": "'App/static/uploads/exampleffif'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012047", "code": "import os\ndef get_database_uri(env_vars):\n    if 'DATABASE_URL' not in env_vars:\n        SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'\n    elif 'EXTRA_DATABASE' in env_vars:\n        SQLALCHEMY_DATABASE_URI = env_vars['EXTRA_DATABASE']\n    else:\n        SQLALCHEMY_DATABASE_URI = env_vars['DATABASE_URL']\n    SQLALCHEMY_TRACK_MODIFICATIONS = False\n    return SQLALCHEMY_DATABASE_URI\n", "entry_point": "get_database_uri", "input": "{}", "output": "'sqlite:///app.db'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16927_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012048", "code": "def check_valid_string(input_str):\n    _find_ending_escapes = {\n        '(': ')',\n        '\"': '\"',\n        \"'\": \"'\",\n        '{': '}',\n    }\n    stack = []\n    for char in input_str:\n        if char in _find_ending_escapes:\n            stack.append(char)\n        elif char in _find_ending_escapes.values():\n            if not stack or _find_ending_escapes[stack.pop()] != char:\n                return False\n    return len(stack) == 0\n", "entry_point": "check_valid_string", "input": "'{(hello)}'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81527_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012049", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "-3", "output": "0.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012050", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[0, 0], [7, 0]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126506_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012051", "code": "def generate_endpoints(router, urlpatterns):\n    registered_endpoints = {}\n    for path, view_set in urlpatterns:\n        for endpoint, registered_view_set in router.items():\n            if view_set == registered_view_set:\n                registered_endpoints[endpoint] = registered_view_set\n    return registered_endpoints\n", "entry_point": "generate_endpoints", "input": "{}, []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138702_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012052", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012053", "code": "def max_difference(lst):\n    if len(lst) < 2:\n        return 0\n    min_val = lst[0]\n    max_diff = 0\n    for num in lst[1:]:\n        if num < min_val:\n            min_val = num\n        else:\n            max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[1, 3, 0, 7, 5]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61667_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012054", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1255", "output": "{1, 251, 5, 1255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012055", "code": "def filter_products_by_category(products, target_category):\n    filtered_products = []\n    for product in products:\n        if product.get('category') == target_category:\n            filtered_products.append(product)\n    return filtered_products\n", "entry_point": "filter_products_by_category", "input": "[], 'Electronics'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8807_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2354", "output": "{1, 2, 11, 107, 2354, 214, 22, 1177}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012057", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "13", "output": "'SCO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012058", "code": "# Define the set of primitive types\nPRIMITIVE_TYPES = {'<string>', '<number>', '<boolean>', '<enum>'}\ndef is_primitive_type(input_type):\n    return input_type in PRIMITIVE_TYPES\n", "entry_point": "is_primitive_type", "input": "'<string>'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146968_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012059", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'/hr/folder'", "output": "'/hr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012060", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3495", "output": "{1, 3, 5, 3495, 233, 1165, 15, 699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012061", "code": "def combination_sum(nums, target):\n    def backtrack(start, target, path, res):\n        if target == 0:\n            res.append(path[:])\n            return\n        for i in range(start, len(nums)):\n            if nums[i] > target:\n                continue\n            path.append(nums[i])\n            backtrack(i, target - nums[i], path, res)\n            path.pop()\n    result = []\n    backtrack(0, target, [], result)\n    return result\n", "entry_point": "combination_sum", "input": "[2, 3, 7], 7", "output": "[[2, 2, 3], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119641_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012062", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[6, -3, 5, 1, 0]", "output": "[36, 25, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012063", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2722", "output": "{1361, 1, 2722, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2721", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5026", "output": "{1, 5026, 2, 7, 359, 718, 14, 2513}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9697", "output": "{1, 9697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012066", "code": "def simulate_packet_routing(nodes, packets):\n    total_forwarded_packets = 0\n    for i in range(len(nodes)):\n        forwarded_packets = min(nodes[i], packets[i])\n        total_forwarded_packets += forwarded_packets\n    return total_forwarded_packets\n", "entry_point": "simulate_packet_routing", "input": "[4, 8], [4, 7]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65785_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012067", "code": "import logging\nLOG_LEVELS = {\n    \"CRITICAL\": logging.CRITICAL,\n    \"ERROR\": logging.ERROR,\n    \"WARNING\": logging.WARNING,\n    \"INFO\": logging.INFO,\n    \"DEBUG\": logging.DEBUG,\n}\nDEFAULT_LEVEL = \"WARNING\"\ndef convert_log_level(log_level):\n    return LOG_LEVELS.get(log_level, LOG_LEVELS.get(DEFAULT_LEVEL))\n", "entry_point": "convert_log_level", "input": "'DEBUG'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18272_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012068", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "500, 0", "output": "85900", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012069", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'1.0.0'", "output": "'1.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3677", "output": "{1, 3677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012071", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    numbers.sort()\n    n = len(numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return float(numbers[n // 2])\n    else:  # Even number of elements\n        mid1 = numbers[n // 2 - 1]\n        mid2 = numbers[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[2, 4]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95265_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012072", "code": "def wheel(pos):\n    if pos < 0 or pos > 255:\n        return (0, 0, 0)\n    if pos < 85:\n        return (255 - pos * 3, pos * 3, 0)\n    if pos < 170:\n        pos -= 85\n        return (0, 255 - pos * 3, pos * 3)\n    pos -= 170\n    return (pos * 3, 0, 255 - pos * 3)\n", "entry_point": "wheel", "input": "212", "output": "(126, 0, 129)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16803_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012073", "code": "def count_elements(input):\n    count = 0\n    for element in input:\n        if isinstance(element, list):\n            count += count_elements(element)\n        else:\n            count += 1\n    return count\n", "entry_point": "count_elements", "input": "[1, [2], 3, 4, [5, 6], 7, [8]]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9884_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012074", "code": "from typing import List\ndef maxProfit(prices: List[int]) -> int:\n    if not prices:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135965_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012075", "code": "def extract_metadata(docstring):\n    metadata = {}\n    lines = docstring.split('\\n')\n    for line in lines:\n        if line.strip().startswith(':'):\n            key_value = line.strip().split(':', 1)\n            if len(key_value) == 2:\n                key = key_value[0][1:].strip()\n                value = key_value[1].strip()\n                metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "': \u4f5c\u8005:httpspc'", "output": "{'': '\u4f5c\u8005:httpspc'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74221_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012076", "code": "import math\ndef calculate_padding(size):\n    next_power_of_2 = 2 ** math.ceil(math.log2(size))\n    return next_power_of_2 - size\n", "entry_point": "calculate_padding", "input": "5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17732_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012077", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[10, 20, 30]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012078", "code": "def pushDominoes(dominoes: str) -> str:\n    forces = [0] * len(dominoes)\n    force = 0\n    # Calculate forces from the left\n    for i in range(len(dominoes)):\n        if dominoes[i] == 'R':\n            force = len(dominoes)\n        elif dominoes[i] == 'L':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] += force\n    # Calculate forces from the right\n    force = 0\n    for i in range(len(dominoes) - 1, -1, -1):\n        if dominoes[i] == 'L':\n            force = len(dominoes)\n        elif dominoes[i] == 'R':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] -= force\n    # Determine the final state of each domino\n    result = ''\n    for f in forces:\n        if f > 0:\n            result += 'R'\n        elif f < 0:\n            result += 'L'\n        else:\n            result += '.'\n    return result\n", "entry_point": "pushDominoes", "input": "'LL'", "output": "'LL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122559_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012079", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3547", "output": "{1, 3547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012080", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[24, 25]", "output": "(24, 25)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012081", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[1, 5, 6, 0, 2, 3, 3]", "output": "[1, 125, 36, 0, 4, 27, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012082", "code": "def populate_rois_lod(rois):\n    rois_lod = [[]]  # Initialize with an empty sublist\n    for element in rois:\n        if isinstance(element, int):\n            rois_lod[-1].append(element)  # Add integer to the last sublist\n        elif isinstance(element, list):\n            rois_lod.append(element.copy())  # Create a new sublist with elements of the list\n    return rois_lod\n", "entry_point": "populate_rois_lod", "input": "[3, 7, 2, 3, 3, [3, 3], [3, 3, 2]]", "output": "[[3, 7, 2, 3, 3], [3, 3], [3, 3, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2890_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012083", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 20]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106713_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012084", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[5, 5, 5, 6, 3, 0, 4, 6, 5]", "output": "[0, 3, 4, 5, 5, 5, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012085", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[3, 1, 3, 4, 5, 1, 5]", "output": "[3, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "977", "output": "{1, 977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt976", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012087", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2905", "output": "{1, 35, 581, 5, 7, 83, 2905, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012088", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "160", "output": "{160, 1, 2, 32, 4, 5, 40, 8, 10, 80, 16, 20}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt159", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012089", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "2, [0, 0, 0, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012090", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[11, 7, 5, 3]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125172_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012091", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(50, 10, 50, 19, 19, 21, 10)", "output": "(10, 21, 19, 19, 50, 10, 50)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012092", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[8, 4, 2, 1, 0, 7, 1]", "output": "[64, 16, 4, 1, 10, 343, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012093", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2224", "output": "{1, 2, 4, 8, 139, 556, 2224, 16, 278, 1112}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2223", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012094", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "20, 10", "output": "184756", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012095", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[90, 85, 100, 70, 95, 70, 95]", "output": "[4, 5, 1, 6, 2, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012096", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[7, 8, 9, 10, 11], 7", "output": "[343, 512, 729, 1000, 1331]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012097", "code": "from typing import List\ndef calculate_avg_return_per_timestep(returns: List[float], total_timesteps: int) -> float:\n    sum_of_returns = sum(returns)\n    avg_return_per_timestep = sum_of_returns / total_timesteps\n    return avg_return_per_timestep\n", "entry_point": "calculate_avg_return_per_timestep", "input": "[0.11], 1", "output": "0.11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10641_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012098", "code": "def extract_country_code(url_path):\n    # Find the index of the first '/' after the initial '/'\n    start_index = url_path.find('/', 1) + 1\n    # Extract the country code using string slicing\n    country_code = url_path[start_index:-1]\n    return country_code\n", "entry_point": "extract_country_code", "input": "'/a/u/u//u/k/'", "output": "'u/u//u/k'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90290_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012099", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'/home/user/docs'", "output": "'/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5242", "output": "{1, 5242, 2, 2621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5241", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012101", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3314", "output": "{1, 3314, 2, 1657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3313", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5969", "output": "{5969, 1, 127, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012103", "code": "def categorize_students(scores):\n    groups = {'A': [], 'B': [], 'C': []}\n    for score in scores:\n        if score >= 80:\n            groups['A'].append(score)\n        elif 60 <= score <= 79:\n            groups['B'].append(score)\n        else:\n            groups['C'].append(score)\n    return groups\n", "entry_point": "categorize_students", "input": "[89, 61, 61, 61]", "output": "{'A': [89], 'B': [61, 61, 61], 'C': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63935_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012104", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[3, 4, 6, 3, 3, 3, 4, 3]", "output": "[7, 10, 9, 6, 6, 7, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012105", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 1, 4, -3, 5, 4, 1, 0]", "output": "[2, 5, 1, 2, 9, 5, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2056", "output": "{1, 2, 514, 1028, 4, 257, 2056, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2055", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2493", "output": "{1, 3, 9, 277, 2493, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2492", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7527", "output": "{1, 193, 3, 579, 7527, 39, 13, 2509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012109", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8278", "output": "{1, 2, 4139, 8278}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8277", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012110", "code": "def has_cycle(graph):\n    def DFS(u):\n        visited[u] = True\n        checkedLoop[u] = True\n        for x in graph[u]:\n            if checkedLoop[x]:\n                return True\n            if not visited[x]:\n                if DFS(x):\n                    return True\n        checkedLoop[u] = False\n        return False\n    visited = [False] * len(graph)\n    checkedLoop = [False] * len(graph)\n    for node in range(len(graph)):\n        if not visited[node]:\n            if DFS(node):\n                return True\n    return False\n", "entry_point": "has_cycle", "input": "[[1], [2], [0]]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101169_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012111", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "4, 1", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012112", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mmtr.symt.appsmtrrmtmmy'", "output": "('mmtr.symt', 'appsmtrrmtmmy')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012113", "code": "from typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    for word in text.split():\n        processed_word = ''.join(char.lower() for char in word if char.isalnum())\n        if processed_word:\n            unique_words.add(processed_word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'wrwrldwo'", "output": "['wrwrldwo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110518_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9485", "output": "{1, 35, 5, 7, 1897, 1355, 9485, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012115", "code": "def largest_prime_factor(number):\n    factor = 2\n    while factor ** 2 <= number:\n        if number % factor == 0:\n            number //= factor\n        else:\n            factor += 1\n    return max(factor, number)\n", "entry_point": "largest_prime_factor", "input": "29", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80074_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012116", "code": "def custom_url_router(url_patterns):\n    url_mapping = {}\n    for pattern, view_func in url_patterns:\n        placeholders = [placeholder.strip('<>') for placeholder in pattern.split('/') if '<' in placeholder]\n        if not placeholders:\n            url_mapping[pattern] = view_func\n        else:\n            url_with_placeholders = pattern\n            for placeholder in placeholders:\n                url_with_placeholders = url_with_placeholders.replace(f'<{placeholder}>', f'<>{placeholder}')\n            url_mapping[url_with_placeholders] = view_func\n    return url_mapping\n", "entry_point": "custom_url_router", "input": "[('/', 'home')]", "output": "{'/': 'home'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87593_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012117", "code": "def merge_sort_skip_multiples_of_3(arr):\n    def merge(left, right):\n        result = []\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] < right[j]:\n                result.append(left[i])\n                i += 1\n            else:\n                result.append(right[j])\n                j += 1\n        result.extend(left[i:])\n        result.extend(right[j:])\n        return result\n    def merge_sort(arr):\n        if len(arr) <= 1:\n            return arr\n        mid = len(arr) // 2\n        left = merge_sort(arr[:mid])\n        right = merge_sort(arr[mid:])\n        return merge(left, right)\n    multiples_of_3 = [num for num in arr if num % 3 == 0]\n    non_multiples_of_3 = [num for num in arr if num % 3 != 0]\n    sorted_non_multiples_of_3 = merge_sort(non_multiples_of_3)\n    result = []\n    i = j = 0\n    for num in arr:\n        if num % 3 == 0:\n            result.append(multiples_of_3[i])\n            i += 1\n        else:\n            result.append(sorted_non_multiples_of_3[j])\n            j += 1\n    return result\n", "entry_point": "merge_sort_skip_multiples_of_3", "input": "[9, 5, 7, 6, 10, 10, 9, 13]", "output": "[9, 5, 7, 6, 10, 10, 9, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15751_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012118", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "6", "output": "[0, 1, 1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012119", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'/tatory'", "output": "\"Directory '/tatory' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012120", "code": "from typing import List, Tuple\nfrom collections import deque\ndef check_confirmations(transactions: List[Tuple[str, int]]) -> List[bool]:\n    confirmations = [0] * len(transactions)\n    pending_transactions = deque()\n    output = []\n    for transaction in transactions:\n        pending_transactions.append(transaction)\n    for _ in range(len(pending_transactions)):\n        current_transaction = pending_transactions.popleft()\n        confirmations[transactions.index(current_transaction)] += 1\n        if confirmations[transactions.index(current_transaction)] >= current_transaction[1]:\n            output.append(True)\n        else:\n            output.append(False)\n    return output\n", "entry_point": "check_confirmations", "input": "[('tx1', 2), ('tx2', 2), ('tx3', 2)]", "output": "[False, False, False]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69837_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012121", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "0, 10.0", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3281", "output": "{1, 3281, 193, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012123", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5697", "output": "{5697, 1, 3, 9, 1899, 211, 633, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012124", "code": "import re\ndef extract_code(title):\n    match = re.search(r\"\\w+-?\\d+\", title)\n    return match.group(0) if match else \"\"\n", "entry_point": "extract_code", "input": "'D3'", "output": "'D3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13798_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012125", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[5, 7, 8, 9, 3, 2], 7", "output": "[8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012126", "code": "def min_eggs_needed(egg_weights, n):\n    dp = [float('inf')] * (n + 1)\n    dp[0] = 0\n    for w in range(1, n + 1):\n        for ew in egg_weights:\n            if w - ew >= 0:\n                dp[w] = min(dp[w], dp[w - ew] + 1)\n    return dp[n]\n", "entry_point": "min_eggs_needed", "input": "[1], 9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108972_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012127", "code": "from typing import List\ndef longest_subarray(arr: List[int], k: int) -> int:\n    prefix_sum_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    prefix_sum = 0\n    for i, num in enumerate(arr):\n        prefix_sum += num\n        remainder = prefix_sum % k\n        if remainder < 0:\n            remainder += k\n        if remainder in prefix_sum_remainder:\n            max_length = max(max_length, i - prefix_sum_remainder[remainder])\n        if remainder not in prefix_sum_remainder:\n            prefix_sum_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray", "input": "[1, 2], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6086_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012128", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[2, 4, 1], 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012129", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3513", "output": "{3, 1, 3513, 1171}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3512", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012130", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene1gge1.gg'", "output": "[('gene1gge1', 'gg')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012131", "code": "def calculate_min_max_sum(arr):\n    total_sum = sum(arr)\n    min_sum = total_sum - max(arr)\n    max_sum = total_sum - min(arr)\n    return min_sum, max_sum\n", "entry_point": "calculate_min_max_sum", "input": "[3, 8, 5, 5]", "output": "(13, 18)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17042_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012132", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'0.7.0'", "output": "(0, 7, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012133", "code": "def minimize_difference(A):\n    total = sum(A)\n    m = float('inf')\n    left_sum = 0\n    for n in A[:-1]:\n        left_sum += n\n        v = abs(total - 2 * left_sum)\n        if v < m:\n            m = v\n    return m\n", "entry_point": "minimize_difference", "input": "[1, 2, 3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1116_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012134", "code": "def extract_domain(url):\n    # Remove the protocol prefix\n    url = url.replace(\"http://\", \"\").replace(\"https://\", \"\")\n    # Extract the domain name\n    domain_parts = url.split(\"/\")\n    domain = domain_parts[0]\n    # Remove subdomains\n    domain_parts = domain.split(\".\")\n    if len(domain_parts) > 2:\n        domain = \".\".join(domain_parts[-2:])\n    return domain\n", "entry_point": "extract_domain", "input": "'https://example.'", "output": "'example.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77353_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012135", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "' aworaword d '", "output": "{'aworaword': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64619_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012136", "code": "def search_engine(query):\n    # Simulated database with search results and relevance scores\n    database = {\n        \"apple\": 0.8,\n        \"orange\": 0.6,\n        \"fruit\": 0.4\n    }\n    def evaluate_expression(expression):\n        if expression in database:\n            return database[expression]\n        elif expression == \"AND\":\n            return 1  # Simulated relevance score for AND operator\n        elif expression == \"OR\":\n            return 0.5  # Simulated relevance score for OR operator\n    def evaluate_query(query_tokens):\n        stack = []\n        for token in query_tokens:\n            if token == \"AND\":\n                operand1 = stack.pop()\n                operand2 = stack.pop()\n                stack.append(max(operand1, operand2))\n            elif token == \"OR\":\n                operand1 = stack.pop()\n                operand2 = stack.pop()\n                stack.append(max(operand1, operand2))\n            else:\n                stack.append(evaluate_expression(token))\n        return stack.pop()\n    query_tokens = query.split()\n    relevance_scores = [(token, evaluate_expression(token)) for token in query_tokens]\n    relevance_scores.sort(key=lambda x: x[1], reverse=True)\n    search_results = [{\"ID\": i, \"Relevance Score\": score} for i, (token, score) in enumerate(relevance_scores)]\n    return search_results\n", "entry_point": "search_engine", "input": "'fruit'", "output": "[{'ID': 0, 'Relevance Score': 0.4}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23618_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012137", "code": "def simple_calculator(input_list):\n    result = float(input_list[0])\n    operation = None\n    for i in range(1, len(input_list), 2):\n        if input_list[i] in ['+', '-', '*', '/']:\n            operation = input_list[i]\n        else:\n            num = float(input_list[i])\n            if operation == '+':\n                result += num\n            elif operation == '-':\n                result -= num\n            elif operation == '*':\n                result *= num\n            elif operation == '/':\n                if num == 0:\n                    return \"Error: Division by zero\"\n                result /= num\n    return result\n", "entry_point": "simple_calculator", "input": "['5', '+', '0']", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122722_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012138", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[10, 0, 0, 16, 15, 15, 15, 15]", "output": "[10, 20, 60, 16, 15, 15, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6466", "output": "{3233, 1, 6466, 2, 106, 53, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012140", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[50, 90, 93, 97, 100]", "output": "93.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29086_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8063", "output": "{1, 11, 733, 8063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012142", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[9, 17, 15, 18, 18, 18]", "output": "[9, 8, 6, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012143", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'ignore.this', '1.2', '5'", "output": "'1.2.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012144", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0  # Handle cases with less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Remove the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[85, 90, 90.5, 91, 95]", "output": "90.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97324_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012145", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[4, 5]", "output": "('Rel Days 4 to 5', 'reldays4_5')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012146", "code": "def top_three_scores(scores):\n    unique_scores = set(scores)\n    sorted_scores = sorted(unique_scores, reverse=True)\n    if len(sorted_scores) >= 3:\n        return sorted_scores[:3]\n    else:\n        return sorted_scores\n", "entry_point": "top_three_scores", "input": "[90, 89, 89]", "output": "[90, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99287_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012147", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6352", "output": "{1, 2, 4, 3176, 8, 397, 6352, 16, 1588, 794}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6351", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012148", "code": "def removeOuterParentheses(s: str) -> str:\n    result = \"\"\n    balance = 0\n    for c in s:\n        if c == '(' and balance > 0:\n            result += c\n        if c == ')' and balance > 1:\n            result += c\n        balance += 1 if c == '(' else -1\n    return result\n", "entry_point": "removeOuterParentheses", "input": "'(()())'", "output": "'()()'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5654_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012149", "code": "def load_available_classes(module_names):\n    available_mixin_classes = []\n    for module_name in module_names:\n        try:\n            module = __import__(module_name, globals(), locals(), ['InterfaceVTK', 'InterfaceOMF'])\n            for name in dir(module):\n                obj = getattr(module, name)\n                if callable(obj) and name.startswith('Interface'):\n                    available_mixin_classes.append(obj)\n        except ImportError as err:\n            pass\n    return available_mixin_classes\n", "entry_point": "load_available_classes", "input": "['module_not_found_1', 'module_not_found_2']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106892_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012150", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'HelloExample!'", "output": "['helloexample']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012151", "code": "from typing import List\ndef threeSumClosest(nums: List[int], target: int) -> int:\n    nums.sort()\n    closest_sum = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            if abs(current_sum - target) < abs(closest_sum - target):\n                closest_sum = current_sum\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return target  # Found an exact match, no need to continue\n    return closest_sum\n", "entry_point": "threeSumClosest", "input": "[-1, 0, 1], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47065_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012152", "code": "def generate_lookup_id(existing_ids, new_name):\n    # Extract the first three characters of the new customer's name and convert to uppercase\n    lookup_prefix = new_name[:3].upper()\n    # Generate a unique number for the new customer based on existing customer IDs\n    existing_numbers = [int(cid[3:]) for cid in existing_ids if cid[3:].isdigit()]\n    unique_number = max(existing_numbers) + 1 if existing_numbers else 1\n    # Combine the extracted characters and unique number to form the lookup ID\n    lookup_id = f\"{lookup_prefix}{unique_number:03d}\"\n    return lookup_id\n", "entry_point": "generate_lookup_id", "input": "['JOH001', 'JOH002', 'JOH003'], 'John Doe'", "output": "'JOH004'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136556_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012153", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "16", "output": "987", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012154", "code": "def reverse_str(s, k):\n    result = ''\n    for i in range(0, len(s), 2*k):\n        result += s[i:i+k][::-1] + s[i+k:i+2*k]\n    return result\n", "entry_point": "reverse_str", "input": "'cbadef', 3", "output": "'abcdef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58788_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012155", "code": "def calculate_spearman_rank_correlation(rank_x, rank_y):\n    n = len(rank_x)\n    if n != len(rank_y):\n        raise ValueError(\"Input lists must have the same length.\")\n    if n < 2:\n        raise ValueError(\"Input lists must have at least two elements.\")\n    # Calculate the differences between ranks\n    d = [rank_x[i] - rank_y[i] for i in range(n)]\n    # Calculate the sum of squared differences\n    sum_d_squared = sum([diff ** 2 for diff in d])\n    # Calculate the Spearman rank correlation coefficient\n    spearman_coefficient = 1 - (6 * sum_d_squared) / (n * (n**2 - 1))\n    return spearman_coefficient\n", "entry_point": "calculate_spearman_rank_correlation", "input": "[1, 2], [2, 1]", "output": "-1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76493_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7173", "output": "{1, 3, 7173, 9, 2391, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012157", "code": "from typing import List\ndef count_double_clicks(click_times: List[int]) -> int:\n    if not click_times:\n        return 0\n    double_clicks = 0\n    prev_click_time = click_times[0]\n    for click_time in click_times[1:]:\n        if click_time - prev_click_time <= 640:\n            double_clicks += 1\n        prev_click_time = click_time\n    return double_clicks\n", "entry_point": "count_double_clicks", "input": "[0, 300, 600, 900]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15147_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6508", "output": "{1, 2, 4, 6508, 3254, 1627}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6507", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "124", "output": "{1, 2, 4, 124, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt123", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012160", "code": "def extract_numerical_version(version_string):\n    numerical_version = ''.join(filter(lambda x: x.isdigit() or x == '.', version_string))\n    numerical_version = numerical_version.replace('.', '', 1)  # Remove the first occurrence of '.'\n    try:\n        return float(numerical_version)\n    except ValueError:\n        return None\n", "entry_point": "extract_numerical_version", "input": "'version 3.141.591 onwards'", "output": "3141.591", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59934_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012161", "code": "from typing import List\ndef get_unique_elements(input_list: List[int]) -> List[int]:\n    unique_elements = []\n    seen_elements = set()\n    for element in input_list:\n        if element not in seen_elements:\n            unique_elements.append(element)\n            seen_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[11, 11, 9, 4, 10, 3, 3]", "output": "[11, 9, 4, 10, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78256_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2526", "output": "{1, 2, 3, 421, 6, 842, 1263, 2526}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012163", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "-1, 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012164", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'   Hello, World!   '", "output": "'Hello, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012165", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'exaplxeple'", "output": "'exaplxeple_1964706995'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012166", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "2, 52, 103", "output": "[52, 51]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012167", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7570", "output": "{1, 2, 5, 3785, 1514, 10, 7570, 757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7569", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012168", "code": "def sum_squared_differences(a, b):\n    total_sum = 0\n    min_len = min(len(a), len(b))\n    for i in range(min_len):\n        diff = a[i] - b[i]\n        total_sum += diff ** 2\n    return total_sum\n", "entry_point": "sum_squared_differences", "input": "[10, 22], [0, 10]", "output": "244", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148697_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012169", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'woRT @Rh'", "output": "('', 'woRT @Rh')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012170", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hellohello'", "output": "{'hellohello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012171", "code": "from typing import List\ndef count_items_above_average(items: List[int]) -> int:\n    if not items:\n        return 0\n    average_weight = sum(items) / len(items)\n    count = sum(1 for item in items if item > average_weight)\n    return count\n", "entry_point": "count_items_above_average", "input": "[1, 2, 10, 15, 20]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73147_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012172", "code": "def two_sum_indices(nums, target):\n    num_indices = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], i]\n        num_indices[num] = i\n    return []\n", "entry_point": "two_sum_indices", "input": "[1, 2, 3, 4], 6", "output": "[1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94760_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012173", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[60, 48]", "output": "108", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012174", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    n = len(scores)\n    dp = [0] * n\n    dp[0] = scores[0]\n    for i in range(1, n):\n        if scores[i] > scores[i - 1]:\n            dp[i] = max(dp[i], dp[i - 1] + scores[i])\n        else:\n            dp[i] = dp[i - 1]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[1, 2, 3, 4, 5, 6]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127370_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012175", "code": "def filter_modules(module_list):\n    unique_modules = set()\n    for module in module_list:\n        if not module.startswith('oic') and not module.startswith('otest'):\n            unique_modules.add(module)\n    return sorted(list(unique_modules))\n", "entry_point": "filter_modules", "input": "['os', 'otses.events', 'oic.module', 'otest.module']", "output": "['os', 'otses.events']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30826_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "292", "output": "{1, 2, 292, 4, 73, 146}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt291", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4773", "output": "{1, 129, 3, 37, 4773, 43, 111, 1591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012178", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 4, 2, 3, 4, 2]", "output": "[4, 2, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012179", "code": "from typing import List\ndef prune_weights(weights: List[float], pruning_percentage: float) -> List[float]:\n    num_weights_to_prune = int(len(weights) * pruning_percentage)\n    sorted_weights = sorted(weights, reverse=True)\n    pruned_weights = [0.0 if idx < num_weights_to_prune else weight for idx, weight in enumerate(sorted_weights)]\n    return pruned_weights\n", "entry_point": "prune_weights", "input": "[0.5, 0.4, 0.3, 0.2, 0.1], 0.4", "output": "[0.0, 0.0, 0.3, 0.2, 0.1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135367_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012180", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4895", "output": "{1, 5, 11, 979, 55, 89, 445, 4895}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012181", "code": "def custom_multiply(*args):\n    if len(args) == 2 and all(isinstance(arg, int) for arg in args):\n        return args[0] * args[1]\n    elif len(args) == 1 and isinstance(args[0], int):\n        return args[0] * args[0]\n    else:\n        return -1\n", "entry_point": "custom_multiply", "input": "5, 7", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73921_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012182", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-2, 5", "output": "-32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt68", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012183", "code": "from typing import List\ndef min_ram_changes(devices: List[int]) -> int:\n    total_ram = sum(devices)\n    avg_ram = total_ram // len(devices)\n    changes_needed = sum(abs(avg_ram - ram) for ram in devices)\n    return changes_needed\n", "entry_point": "min_ram_changes", "input": "[0, 4, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74774_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7302", "output": "{1, 2, 3, 3651, 2434, 7302, 6, 1217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7301", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012185", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[2, 3, 4, 5, 6, 7, 8, 9, 8], 10", "output": "[0, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012186", "code": "def find_starting_tokens(e):\n    starting_tokens = []\n    current_label = None\n    for i, label in enumerate(e):\n        if label != current_label:\n            starting_tokens.append(i)\n            current_label = label\n    return starting_tokens\n", "entry_point": "find_starting_tokens", "input": "[0, 1, 2, 3, 4, 5, 6]", "output": "[0, 1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47145_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012187", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[1, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6081", "output": "{1, 3, 6081, 2027}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012189", "code": "import re\ndef extract_secret_password(migration_script):\n    # Regular expression pattern to match the revision identifier format\n    pattern = r\"(\\d+)<(.*?)>\"\n    # Search for the pattern in the migration script\n    match = re.search(pattern, migration_script)\n    if match:\n        # Extract and return the secret password\n        return match.group(2)\n    else:\n        return \"Secret password not found\"\n", "entry_point": "extract_secret_password", "input": "''", "output": "'Secret password not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112496_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012190", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/some_other_info/N:515/anything_else'", "output": "(515,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "447", "output": "{1, 3, 149, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012192", "code": "def find_pairs_with_sum(nums, target_sum):\n    seen = {}\n    pairs = []\n    for num in nums:\n        diff = target_sum - num\n        if diff in seen:\n            pairs.append((num, diff))\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs_with_sum", "input": "[2, 4], 6", "output": "[(4, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25827_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "379", "output": "{1, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012194", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers\"\n    elif n == 0:\n        return 1\n    else:\n        result = 1\n        for i in range(1, n + 1):\n            result *= i\n        return result\n", "entry_point": "calculate_factorial", "input": "11", "output": "39916800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39360_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012195", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coeff in coefficients[::-1]:\n        result = result * x + coeff\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[1, 0, -1, -3547591], 1", "output": "-3547591", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110926_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012196", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'anotherano'", "output": "'contracts/anotherano.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012197", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'Python.'", "output": "'Programming'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012198", "code": "def find_subarray_sum_indices(nums):\n    cumulative_sums = {0: -1}\n    cumulative_sum = 0\n    result = []\n    for index, num in enumerate(nums):\n        cumulative_sum += num\n        if cumulative_sum in cumulative_sums:\n            result = [cumulative_sums[cumulative_sum] + 1, index]\n            return result\n        cumulative_sums[cumulative_sum] = index\n    return result\n", "entry_point": "find_subarray_sum_indices", "input": "[5, 2, 1, -1]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56814_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012199", "code": "def extract_package_versions(requirements):\n    package_versions = {}\n    for requirement in requirements:\n        package_name, version = requirement.split(\"==\")\n        package_versions[package_name] = version\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "['numpy==19']", "output": "{'numpy': '19'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36114_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012200", "code": "def custom_index(text, char, start_index=0):\n    for i in range(start_index, len(text)):\n        if text[i] == char:\n            return i\n    return -1\n", "entry_point": "custom_index", "input": "'hello', 'x'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20364_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012201", "code": "def dummy(n):\n    total_sum = sum(range(1, n + 1))\n    return total_sum\n", "entry_point": "dummy", "input": "993", "output": "493521", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124894_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012202", "code": "def can_pair_elements(data):\n    c1, c2 = 0, 0\n    for val in data:\n        c1 += val[0]\n        c2 += val[1]\n    return c1 % 2 == c2 % 2\n", "entry_point": "can_pair_elements", "input": "[(2, 4), (1, 3)]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61377_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012203", "code": "def sum_of_multiples(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 6, 15]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59802_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012204", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'exapmpe_centract'", "output": "'contracts/exapmpe_centract.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012205", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "5, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012206", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'30.11.2023'", "output": "'30.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012207", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "4, 2, 1", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012208", "code": "def calculate_sum_of_digits(port, connection_key):\n    total_sum = 0\n    for digit in str(port) + str(connection_key):\n        total_sum += int(digit)\n    return total_sum\n", "entry_point": "calculate_sum_of_digits", "input": "888, 3", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102611_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012209", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138156_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4724", "output": "{1, 2, 4, 4724, 2362, 1181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4723", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012211", "code": "def distinct_substrings(s, k):\n    if len(s) < k:\n        return False\n    substrings = set()\n    tmp = 0\n    for i in range(len(s)):\n        tmp = tmp * 2 + int(s[i])\n        if i >= k:\n            tmp -= int(s[i - k]) << k\n        if i >= k - 1:\n            substrings.add(tmp)\n    return len(substrings) == (1 << k)\n", "entry_point": "distinct_substrings", "input": "'00110111', 2", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25437_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012212", "code": "from typing import Tuple\ndef extract_info_from_comment(comment: str) -> Tuple[str, str]:\n    name_start = comment.find(\"UNSW Testing -\") + len(\"UNSW Testing -\")\n    name_end = comment.find(\">\", name_start)\n    name = comment[name_start:name_end]\n    date_start = comment.find(\"Copyright\") + len(\"Copyright\") + 1\n    date_end = comment.find(\"UNSW Testing -\", date_start)\n    date = comment[date_start:date_end].strip()\n    return name, date\n", "entry_point": "extract_info_from_comment", "input": "'UNSW Testing -> Copyright CYo UNSW Testing -'", "output": "('', 'CYo')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145796_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9349", "output": "{1, 9349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012214", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'0.90.9'", "output": "'0.91.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "188", "output": "{1, 2, 4, 47, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt187", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012216", "code": "def calculate_metrics(metrics):\n    total_metrics = len(metrics)\n    metrics_sum = sum(metrics)\n    average = metrics_sum / total_metrics\n    rounded_average = round(average, 2)\n    return rounded_average\n", "entry_point": "calculate_metrics", "input": "[0.8, 0.82]", "output": "0.81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118593_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012217", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'BBBBBBBBB'", "output": "'tonga.cashregister.event.BBBBBBBBBCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012218", "code": "from math import sqrt\ndef calculate_distances(points):\n    distances = []\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            distances.append(distance)\n    return distances\n", "entry_point": "calculate_distances", "input": "[(0, 0), (3, 4)]", "output": "[5.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64177_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012219", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1947", "output": "{1, 33, 3, 649, 59, 11, 177, 1947}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012220", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 1, 2, -3, 5, 0, 3], 3", "output": "[1, 1, 2, -3, 5, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012221", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[[3], [4]]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012222", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "3, [5, 2, 3, 1, 6, 4, 7, 8, 8]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012223", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5081", "output": "{1, 5081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5519", "output": "{1, 5519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012225", "code": "def has_duplicate_device_paths(device_paths):\n    seen_paths = set()\n    for path in device_paths:\n        if path in seen_paths:\n            return True\n        seen_paths.add(path)\n    return False\n", "entry_point": "has_duplicate_device_paths", "input": "['/device1', '/device2', '/device3']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141362_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012226", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 3, 5, 5, 4, 4, 3, 3, 1]", "output": "[1, 4, 9, 14, 18, 22, 25, 28, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9314", "output": "{1, 9314, 2, 4657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9313", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012228", "code": "def count_occurrences(input_string, target_char):\n    count = 0\n    for char in input_string:\n        if char == target_char:\n            count += 1\n    return count\n", "entry_point": "count_occurrences", "input": "'hello', 'l'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26995_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "71", "output": "{1, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt70", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012230", "code": "def process_alarm_metrics(metrics):\n    alarm_dimensions = {}\n    for metric in metrics:\n        alarm_id = metric['alarm_id']\n        dimensions = metric['dimensions']\n        if alarm_id in alarm_dimensions:\n            alarm_dimensions[alarm_id].append(dimensions)\n        else:\n            alarm_dimensions[alarm_id] = [dimensions]\n    return alarm_dimensions\n", "entry_point": "process_alarm_metrics", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31263_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012231", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[5, 5, 1, 3, 3]", "output": "{5: 2, 1: 1, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012232", "code": "def latest_version(versions):\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "latest_version", "input": "['2.1.0', '1.0.0', '3.0.0', '3.1.2', '3.2.5', '3.3.3']", "output": "'3.3.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109733_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012233", "code": "def calculate_total_images_processed(num_train_samples, train_batch_size, train_steps):\n    total_images_processed = num_train_samples * train_batch_size * train_steps\n    return total_images_processed\n", "entry_point": "calculate_total_images_processed", "input": "32316928, 1, 1", "output": "32316928", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82078_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012234", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[-1, 9, -1, -1, 2, 9]", "output": "[-1, 10, 1, 2, 6, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012235", "code": "from typing import List\ndef remove_deleted_files(instance_list: List[dict]) -> List[dict]:\n    # Placeholder function to simulate autosync being enabled\n    def autosync_enabled():\n        return True\n    def delete_objects_in_es(**kwargs):\n        # Implementation not provided for this function\n        pass\n    # Filtering out deleted files\n    valid_instance_ids = [obj['id'] for obj in instance_list if not obj.get('deleted', False)]\n    # Removing deleted files from the build process if autosync is enabled\n    if autosync_enabled():\n        kwargs = {\n            'app_label': 'app_label',\n            'model_name': 'HTMLFile',\n            'document_class': 'PageDocument',\n            'objects_id': valid_instance_ids,\n        }\n        delete_objects_in_es(**kwargs)\n    return [obj for obj in instance_list if not obj.get('deleted', False)]\n", "entry_point": "remove_deleted_files", "input": "[{'id': 1, 'deleted': True}, {'id': 2, 'deleted': True}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1746_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012236", "code": "def generate_pattern(sequence: str, repetitions: int) -> str:\n    lines = []\n    forward_pattern = sequence\n    reverse_pattern = sequence[::-1]\n    for i in range(repetitions):\n        if i % 2 == 0:\n            lines.append(forward_pattern)\n        else:\n            lines.append(reverse_pattern)\n    return '\\n'.join(lines)\n", "entry_point": "generate_pattern", "input": "'ABABCDD', 2", "output": "'ABABCDD\\nDDCBABA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81413_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012237", "code": "import re\ndef count_words(text):\n    word_counts = {}\n    # Split the text into individual words\n    words = text.split()\n    for word in words:\n        # Remove punctuation marks and convert to lowercase\n        cleaned_word = re.sub(r'[^\\w\\s]', '', word).lower()\n        # Update word count in the dictionary\n        if cleaned_word in word_counts:\n            word_counts[cleaned_word] += 1\n        else:\n            word_counts[cleaned_word] = 1\n    return word_counts\n", "entry_point": "count_words", "input": "'tworlth'", "output": "{'tworlth': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123802_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012238", "code": "def find_single_integer(nums):\n    integersDict = {}\n    for num in nums:\n        if num in integersDict:\n            integersDict[num] += 1\n        else:\n            integersDict[num] = 1\n    for integer in integersDict:\n        if integersDict[integer] != 3:\n            return integer\n    return nums[0]\n", "entry_point": "find_single_integer", "input": "[1, 2, 2, 2, 3, 3, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39275_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012239", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[70, 89, 90, 92, 100]", "output": "90.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135847_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012240", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "'python programming'", "output": "'python_programming_18'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012241", "code": "def highest_non_duplicated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_duplicated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_duplicated_scores:\n        return max(non_duplicated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_duplicated_score", "input": "[100, 50, 70, 50]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79204_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1635", "output": "{1, 545, 3, 1635, 5, 327, 109, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012243", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[1, 1, 4, 1, 3, 0, 2]", "output": "[1, 1, 4, 1, 3, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012244", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[1000, 1000, 436], 3", "output": "7308", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5744", "output": "{1, 2, 4, 359, 8, 718, 5744, 16, 2872, 1436}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5743", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012246", "code": "def determine_db_connection_type(token_host: str) -> str:\n    if token_host == 'redis':\n        return 'redis'\n    else:\n        return 'sql'\n", "entry_point": "determine_db_connection_type", "input": "'redis'", "output": "'redis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127494_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012247", "code": "def calculate_error(list1, list2):\n    total_error = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_error\n", "entry_point": "calculate_error", "input": "[10, 20, 4, 7, 5], [0, 15, 0, 2, 0]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33914_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012248", "code": "def complete_app_names(incomplete_apps, complete_apps):\n    result = []\n    for incomplete_app in incomplete_apps:\n        for complete_app in complete_apps:\n            if complete_app.startswith(incomplete_app):\n                result.append(incomplete_app + complete_app[len(incomplete_app):])\n                break\n    return result\n", "entry_point": "complete_app_names", "input": "['for'], ['formulas']", "output": "['formulas']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85495_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012249", "code": "import importlib\ndef execute_function_from_module(module_name, function_name, *args, **kwargs):\n    try:\n        module = importlib.import_module(module_name)\n        function = getattr(module, function_name)\n        return function(*args, **kwargs)\n    except ModuleNotFoundError:\n        return f\"Module '{module_name}' not found.\"\n    except AttributeError:\n        return f\"Function '{function_name}' not found in module '{module_name}'.\"\n", "entry_point": "execute_function_from_module", "input": "'mat', 'foo'", "output": "\"Module 'mat' not found.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133564_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012250", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8102", "output": "{1, 2, 4051, 8102}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7390", "output": "{1, 2, 739, 5, 1478, 10, 3695, 7390}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7389", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012252", "code": "def replace_file_type(file_name, new_type):\n    \"\"\"\n    Replaces the file type extension of a given file name with a new type.\n    :param file_name: Original file name with extension\n    :param new_type: New file type extension\n    :return: Modified file name with updated extension\n    \"\"\"\n    file_name_parts = file_name.split(\".\")\n    if len(file_name_parts) > 1:  # Ensure there is a file extension to replace\n        file_name_parts[-1] = new_type  # Replace the last part (file extension) with the new type\n        return \".\".join(file_name_parts)  # Join the parts back together with \".\"\n    else:\n        return file_name  # Return the original file name if no extension found\n", "entry_point": "replace_file_type", "input": "'docunt.oldtype', 'ppdddf'", "output": "'docunt.ppdddf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41247_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012253", "code": "from typing import List\nimport logging\ndef process_cookies(cookie_indices: List[int]) -> List[int]:\n    valid_cookies_index = [index for index in cookie_indices if index % 2 == 0 and index % 3 == 0]\n    logging.info('Checking the cookie for validity is over.')\n    return valid_cookies_index\n", "entry_point": "process_cookies", "input": "[6, 12]", "output": "[6, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99711_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012254", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3660", "output": "'01:01:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012255", "code": "def calculate_average_age(people):\n    total_age = 0\n    for person in people:\n        total_age += person['idade']\n    if len(people) == 0:\n        return 0  # Handle division by zero if the list is empty\n    else:\n        return total_age / len(people)\n", "entry_point": "calculate_average_age", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52440_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012256", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "2, 8, 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012257", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[10]", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012258", "code": "def jaccard_similarity_coefficient(x, y):\n    set_x = set(x)\n    set_y = set(y)\n    intersection_size = len(set_x.intersection(set_y))\n    union_size = len(set_x.union(set_y))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    return intersection_size / union_size\n", "entry_point": "jaccard_similarity_coefficient", "input": "[1, 2, 3], [1, 2, 3, 4, 5, 6, 7]", "output": "0.42857142857142855", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77613_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012259", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 2, 1, 1, 1, 1, 2]", "output": "[2, 3, 2, 2, 2, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012260", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8539", "output": "{1, 8539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012261", "code": "from typing import List\ndef find_majority_element(nums: List[int]) -> int:\n    d = dict()\n    result = -1\n    half = len(nums) // 2\n    for num in nums:\n        if num in d:\n            d[num] += 1\n        else:\n            d[num] = 1\n    for k in d:\n        if d[k] >= half:\n            result = k\n            break\n    return result\n", "entry_point": "find_majority_element", "input": "[2, 2, 2, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122021_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012262", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[111, 111, 108, 100, 108, 101, 100]", "output": "'ooldled'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012263", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7663", "output": "{1, 97, 79, 7663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7662", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012264", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1277", "output": "{1, 1277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012265", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "556", "output": "{1, 2, 4, 139, 556, 278}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt555", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012266", "code": "def find_numbers_in_range(min_val, max_val):\n    numbers_in_range = []\n    for num in range(min_val, max_val + 1):\n        if num == 2 or num == 3:\n            numbers_in_range.append(num)\n    return numbers_in_range\n", "entry_point": "find_numbers_in_range", "input": "2, 2", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119042_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012267", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'Hello W'", "output": "b'Hello W'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012268", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1662", "output": "{1, 2, 3, 6, 554, 277, 1662, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012269", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'gyroscsoe'", "output": "'Value of gyroscsoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2102", "output": "{1, 2, 1051, 2102}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012271", "code": "def calculate_total_score(scores):\n    total_score = 0\n    for score in scores:\n        if score % 5 == 0 and score % 7 == 0:\n            total_score += score * 4\n        elif score % 5 == 0:\n            total_score += score * 2\n        elif score % 7 == 0:\n            total_score += score * 3\n        else:\n            total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[-5, -7, -8, -35]", "output": "-179", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93768_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012272", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'', 5", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136738_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012273", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012274", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'daa-scie/', 'pypythonthom/'", "output": "'daa-scie/pypythonthom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012275", "code": "def filter_gt_avg(numbers):\n    if not numbers:\n        return []\n    avg = sum(numbers) / len(numbers)\n    return [num for num in numbers if num > avg]\n", "entry_point": "filter_gt_avg", "input": "[5, 9, 10, 9]", "output": "[9, 10, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15446_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012276", "code": "def longest_common_prefix(str1: str, str2: str) -> str:\n    prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            prefix += str1[i]\n        else:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "'app', 'appetizer'", "output": "'app'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106464_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012277", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'x'", "output": "'Exporting annotated corpus data for x.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012278", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 94, 93, 90, 85, 89]", "output": "[99, 94, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012279", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[1, 2, 3, 4, 5]", "output": "[5, 4, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012280", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabbbcc'", "output": "'a3b3c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144981_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012281", "code": "def format_ranges(lst):\n    formatted_ranges = []\n    start = end = lst[0]\n    for i in range(1, len(lst)):\n        if lst[i] == end + 1:\n            end = lst[i]\n        else:\n            if end - start >= 2:\n                formatted_ranges.append(f\"{start}-{end}\")\n            else:\n                formatted_ranges.extend(str(num) for num in range(start, end + 1))\n            start = end = lst[i]\n    if end - start >= 2:\n        formatted_ranges.append(f\"{start}-{end}\")\n    else:\n        formatted_ranges.extend(str(num) for num in range(start, end + 1))\n    return ','.join(map(str, formatted_ranges))\n", "entry_point": "format_ranges", "input": "[0, 2, 4, 1, 0, 9, 10, 2, 1]", "output": "'0,2,4,1,0,9,10,2,1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111612_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012282", "code": "def count_alphanumeric_chars(input_str):\n    count = 0\n    for char in input_str:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abc12'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52816_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012283", "code": "def extract_package_versions(package_list):\n    package_versions = {}\n    for package_str in package_list:\n        package_name, version = package_str.split('=')\n        package_versions[package_name] = version\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "['matplotlib=3.1', 'ma=3.1']", "output": "{'matplotlib': '3.1', 'ma': '3.1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27939_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8655", "output": "{1, 577, 3, 1731, 5, 2885, 8655, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8654", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012285", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'10 + 8'", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012286", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "107", "output": "{1, 107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012287", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6999", "output": "{1, 3, 2333, 6999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012288", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6101", "output": "{1, 6101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012289", "code": "def rock_paper_scissors_winner(player_choice, computer_choice):\n    if player_choice == computer_choice:\n        return \"It's a tie!\"\n    elif (player_choice == \"rock\" and computer_choice == \"scissors\") or \\\n         (player_choice == \"scissors\" and computer_choice == \"paper\") or \\\n         (player_choice == \"paper\" and computer_choice == \"rock\"):\n        return \"Player wins! Congratulations!\"\n    else:\n        return \"Computer wins! Better luck next time!\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'scissors'", "output": "'Player wins! Congratulations!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012290", "code": "def evaluate_expression(expression):\n    try:\n        result = eval(expression)\n        return result\n    except ZeroDivisionError:\n        return \"Error: Division by zero\"\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "evaluate_expression", "input": "'1/0'", "output": "'Error: Division by zero'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79055_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012291", "code": "from typing import List\ndef extract_public_modules(code: str) -> List[str]:\n    public_modules = []\n    for line in code.split('\\n'):\n        if line.startswith('from taichi.') and 'import' in line:\n            modules = line.split('import')[1].strip().replace('*', '').split(',')\n            for module in modules:\n                module_name = module.strip()\n                if not module_name.startswith('_'):\n                    public_modules.append(module_name)\n    return public_modules\n", "entry_point": "extract_public_modules", "input": "\"print('Hello World')\"", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61298_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7628", "output": "{1, 2, 4, 3814, 7628, 1907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7627", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012293", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 5, 1.0", "output": "5.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "823", "output": "{1, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012295", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[85, 75, 82, 65, 95, 91, 60, 80]", "output": "['B', 'C', 'B', 'D', 'A', 'A', 'D', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012296", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[3, 3, 4, 2, 8, 2, 4, 8]", "output": "[3, 4, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012297", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[3, 0, 2, -1, 2, 3, 3, 0, 2]", "output": "[3, 3, 5, 4, 6, 9, 12, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012298", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[0, 17, 13, 4]", "output": "[17, 30, 17, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "226", "output": "{1, 226, 2, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012300", "code": "import ast\ndef evaluate_expression(expression: str) -> float:\n    tree = ast.parse(expression, mode='eval')\n    def evaluate_node(node):\n        if isinstance(node, ast.BinOp):\n            left = evaluate_node(node.left)\n            right = evaluate_node(node.right)\n            if isinstance(node.op, ast.Add):\n                return left + right\n            elif isinstance(node.op, ast.Sub):\n                return left - right\n            elif isinstance(node.op, ast.Mult):\n                return left * right\n            elif isinstance(node.op, ast.Div):\n                return left / right\n        elif isinstance(node, ast.Num):\n            return node.n\n        elif isinstance(node, ast.Expr):\n            return evaluate_node(node.value)\n        else:\n            raise ValueError(\"Invalid expression\")\n    return evaluate_node(tree.body)\n", "entry_point": "evaluate_expression", "input": "'136 + 2 / 3'", "output": "136.66666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124878_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1397", "output": "{1, 11, 1397, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012302", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "' filtee1er2, fiter3 '", "output": "['filtee1er2', 'fiter3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012303", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7213", "output": "{1, 7213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7212", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012304", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'quick brown', 6", "output": "('quick ', 'brown')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012305", "code": "def average_top_scores(scores):\n    scores.sort(reverse=True)\n    top_students = min(5, len(scores))\n    top_scores_sum = sum(scores[:top_students])\n    return top_scores_sum / top_students\n", "entry_point": "average_top_scores", "input": "[89, 90, 90, 91, 91]", "output": "90.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61425_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012306", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[60, 90, 50, 70, 80, 40, 100, 60]", "output": "[5, 2, 6, 4, 3, 7, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012307", "code": "import datetime\ndef get_days_in_previous_month(current_date):\n    year, month, _ = map(int, current_date.split('-'))\n    # Calculate the previous month\n    if month == 1:\n        previous_month = 12\n        previous_year = year - 1\n    else:\n        previous_month = month - 1\n        previous_year = year\n    # Calculate the number of days in the previous month\n    if previous_month in [1, 3, 5, 7, 8, 10, 12]:\n        days_in_previous_month = 31\n    elif previous_month == 2:\n        if previous_year % 4 == 0 and (previous_year % 100 != 0 or previous_year % 400 == 0):\n            days_in_previous_month = 29\n        else:\n            days_in_previous_month = 28\n    else:\n        days_in_previous_month = 30\n    return days_in_previous_month\n", "entry_point": "get_days_in_previous_month", "input": "'2023-05-01'", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21493_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012308", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "1048576", "output": "'     1 MB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012309", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 2, 2, 4, 2, 2]", "output": "[6, 4, 6, 6, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012310", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'h\u00e9tf\u0151'", "output": "'Monday'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012311", "code": "import re\nre_punc = re.compile(r'[!\"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\']')\narticles = set([\"a\", \"an\", \"the\"])\ndef normalize_answer(s):\n    \"\"\"\n    Lower text, remove punctuation, articles, and extra whitespace.\n    Args:\n    s: A string representing the input text to be normalized.\n    Returns:\n    A string with the input text normalized as described.\n    \"\"\"\n    s = s.lower()\n    s = re_punc.sub(\" \", s)\n    s = \" \".join([word for word in s.split() if word not in articles])\n    s = \" \".join(s.split())\n    return s\n", "entry_point": "normalize_answer", "input": "'a o'", "output": "'o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46089_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012312", "code": "from typing import List\ndef find_new_active_providers(existing_providers: List[str]) -> List[str]:\n    # Mocking the retrieved active providers for demonstration\n    active_providers = ['A', 'B', 'C']  # Simulating the active providers retrieved from the database\n    # Filtering out the new active providers not present in the existing providers list\n    new_active_providers = [provider for provider in active_providers if provider not in existing_providers]\n    return new_active_providers\n", "entry_point": "find_new_active_providers", "input": "['B']", "output": "['A', 'C']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68315_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012313", "code": "def binary_decode(arr):\n    result = 0\n    for i in range(len(arr)):\n        result += arr[i] * 2**(len(arr) - 1 - i)\n    return result\n", "entry_point": "binary_decode", "input": "[1, 0, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27590_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012314", "code": "def calculate_bleed_damage(cards):\n    total_bleed_damage = 0\n    reset_value = 0  # Define the reset value here\n    for card in cards:\n        if card == reset_value:\n            total_bleed_damage = 0\n        else:\n            total_bleed_damage += card\n    return total_bleed_damage\n", "entry_point": "calculate_bleed_damage", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46599_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012315", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[2, 3, 8, 5, 1]", "output": "3.3333333333333335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012316", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7156", "output": "{1, 2, 4, 7156, 3578, 1789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012317", "code": "from typing import List\ndef extract_placeholders(url_template: str) -> List[str]:\n    placeholders = set()\n    start = False\n    current_placeholder = \"\"\n    for char in url_template:\n        if char == '{':\n            start = True\n        elif char == '}':\n            start = False\n            placeholders.add(current_placeholder)\n            current_placeholder = \"\"\n        elif start:\n            current_placeholder += char\n    return list(placeholders)\n", "entry_point": "extract_placeholders", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98949_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012318", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "'# '", "output": "'<h1></h1>\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012319", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9418", "output": "{1, 2, 34, 4709, 9418, 554, 17, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9417", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012320", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[4], 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012321", "code": "def map_emotions(emotion_codes):\n    emotion_map = {\n        \"A\": \"anger\",\n        \"D\": \"disgust\",\n        \"F\": \"fear\",\n        \"H\": \"happiness\",\n        \"S\": \"sadness\",\n        \"N\": \"neutral\",\n        \"X\": \"unknown\",\n    }\n    mapped_emotions = []\n    for code in emotion_codes:\n        mapped_emotion = emotion_map.get(code, \"unknown\")\n        mapped_emotions.append(mapped_emotion)\n    return mapped_emotions\n", "entry_point": "map_emotions", "input": "['Z', 'Y', 'Q', 'W']", "output": "['unknown', 'unknown', 'unknown', 'unknown']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132303_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012322", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'expr:COLON:'", "output": "('expr', 'COLON', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012323", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4098", "output": "{1, 4098, 3, 2, 2049, 6, 683, 1366}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012324", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[8.25, 8.25, 8.25, 8.25]", "output": "8.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012325", "code": "def extract_model_info(config_dict):\n    pretrained_model = config_dict.get('model', {}).get('pretrained', None)\n    backbone_type = config_dict.get('model', {}).get('backbone', {}).get('type', None)\n    num_classes = config_dict.get('model', {}).get('decode_head', {}).get('num_classes', None)\n    max_iters = config_dict.get('runner', {}).get('max_iters', None)\n    checkpoint_by_epoch = config_dict.get('checkpoint_config', {}).get('by_epoch', None)\n    checkpoint_interval = config_dict.get('checkpoint_config', {}).get('interval', None)\n    evaluation_interval = config_dict.get('evaluation', {}).get('interval', None)\n    return pretrained_model, backbone_type, num_classes, max_iters, checkpoint_by_epoch, checkpoint_interval, evaluation_interval\n", "entry_point": "extract_model_info", "input": "{}", "output": "(None, None, None, None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140456_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012326", "code": "from typing import List\ndef single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "single_number", "input": "[1, 1, 4, 2, 4, 2, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118847_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012327", "code": "def sum_of_factorial_digits(num):\n    fact_total = 1\n    while num != 1:\n        fact_total *= num\n        num -= 1\n    fact_total_str = str(fact_total)\n    sum_total = sum(int(digit) for digit in fact_total_str)\n    return sum_total\n", "entry_point": "sum_of_factorial_digits", "input": "9", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145190_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012328", "code": "def find_starting_tokens(e):\n    starting_tokens = []\n    current_label = None\n    for i, label in enumerate(e):\n        if label != current_label:\n            starting_tokens.append(i)\n            current_label = label\n    return starting_tokens\n", "entry_point": "find_starting_tokens", "input": "['A', 'B', 'C', 'C', 'D', 'D', 'E', 'F']", "output": "[0, 1, 2, 4, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47145_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012329", "code": "def generate_username(first_name: str, last_name: str, existing_usernames: list) -> str:\n    username = (first_name[0] + last_name).lower()\n    unique_username = username\n    counter = 1\n    while unique_username in existing_usernames:\n        unique_username = f\"{username}{counter}\"\n        counter += 1\n    return unique_username\n", "entry_point": "generate_username", "input": "'john', 'doe', ['jane', 'smith']", "output": "'jdoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82643_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012330", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9789", "output": "{1, 3, 39, 13, 753, 251, 9789, 3263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4234", "output": "{1, 2, 2117, 73, 4234, 146, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012332", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'1'", "output": "[['1']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012333", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8931", "output": "{1, 2977, 3, 8931, 229, 39, 13, 687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012334", "code": "def factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "6", "output": "720", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149792_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3091", "output": "{11, 1, 3091, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012336", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[5, 10, 10]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012337", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012338", "code": "import re\ndef repair_move_path(path: str) -> str:\n    # Define a regular expression pattern to match elements like '{org=>com}'\n    FILE_PATH_RENAME_RE = re.compile(r'\\{([^}]+)=>([^}]+)\\}')\n    # Replace the matched elements with the desired format using re.sub\n    return FILE_PATH_RENAME_RE.sub(r'\\2', path)\n", "entry_point": "repair_move_path", "input": "'/dir/456/{file.doc=>file.doc}'", "output": "'/dir/456/file.doc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137172_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012339", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[10, 20, 15]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012340", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'path/to/../to/file.txt'", "output": "'path/to/file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012341", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 1, 2, 4, 5]", "output": "{1: 2, 2: 1, 4: 1, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012342", "code": "import re\ndef extract_numerical_values(input_string):\n    num_match = re.compile(r'([\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+[\\.\\,]*)+[\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+|([-+]*\\d+[\\.\\,]*)+\\d+|([\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f]+|\\d+)')\n    matches = num_match.findall(input_string)\n    numerical_values = []\n    for match in matches:\n        for group in match:\n            if group:\n                if group.isdigit():\n                    numerical_values.append(int(group))\n                else:\n                    # Convert Indian numeral system representation to regular Arabic numerals\n                    num = int(''.join(str(ord(digit) - ord('\u0966')) for digit in group))\n                    numerical_values.append(num)\n    return numerical_values\n", "entry_point": "extract_numerical_values", "input": "'1 and \u0967'", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8862_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012343", "code": "def process_value(a):\n    k = 'default_value'  # Define a default value for b\n    if a == 'w':\n        b = 'c'\n    elif a == 'y':\n        b = 'd'\n    else:\n        b = k  # Assign the default value if a does not match any condition\n    return b\n", "entry_point": "process_value", "input": "'y'", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149280_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012344", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5442", "output": "{2721, 1, 5442, 2, 3, 6, 907, 1814}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012345", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3310", "output": "{1, 2, 5, 10, 331, 3310, 662, 1655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3309", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012346", "code": "def find_first_duplicate(lst):\n    seen = set()\n    for num in lst:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 9, 3, 4, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92633_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012347", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 3, 2, 2, 4, 4, 4, 4]", "output": "[4, 5, 4, 6, 8, 8, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51354_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012348", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "85904, 0", "output": "85904", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012349", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "9", "output": "'https://www.kaiheila.cn/api/v9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012350", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "[4, 4]", "output": "5.656854249492381", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012351", "code": "def max_product_of_three(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # First two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[4, 7, 12]", "output": "336", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99666_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012352", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Python'", "output": "'Python'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012353", "code": "def shift_array(arr, k):\n    effective_shift = k % len(arr)\n    shifted_arr = []\n    for i in range(len(arr)):\n        new_index = (i + effective_shift) % len(arr)\n        shifted_arr.insert(new_index, arr[i])\n    return shifted_arr\n", "entry_point": "shift_array", "input": "[1, 2, 3, 4, 5], 2", "output": "[4, 5, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145368_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1182", "output": "{1, 2, 3, 197, 6, 394, 591, 1182}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012355", "code": "def calculate_project_cost(base_cost: float, cost_per_line: float, lines_of_code: int) -> float:\n    total_cost = base_cost + (lines_of_code * cost_per_line)\n    return total_cost\n", "entry_point": "calculate_project_cost", "input": "-6000.0, 159.809700000001, 1", "output": "-5840.190299999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125885_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012356", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'123456789'", "output": "'123456789'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012357", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[1, 1, 3]", "output": "[1, 1, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4498", "output": "{1, 2, 26, 2249, 13, 173, 4498, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012359", "code": "def play_game(obstacles):\n    def dfs(x, y, energy, visited):\n        if (x, y) == (4, 4):\n            return True\n        if energy < 0 or (x, y) in obstacles or x < 0 or y < 0 or x > 4 or y > 4 or (x, y) in visited:\n            return False\n        visited.add((x, y))\n        directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n        for dx, dy in directions:\n            if dfs(x + dx, y + dy, energy - 1, visited):\n                return True\n        visited.remove((x, y))\n        return False\n    return dfs(0, 0, 10, set())\n", "entry_point": "play_game", "input": "set()", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50684_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8549", "output": "{1, 83, 8549, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012361", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'mPy'", "output": "'mpy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012362", "code": "def longest_common_prefix(str1: str, str2: str) -> str:\n    prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            prefix += str1[i]\n        else:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "'flowing', 'flower'", "output": "'flow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106464_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012363", "code": "def convert(s: str, numRows: int) -> str:\n    if numRows == 1 or numRows >= len(s):\n        return s\n    rows = ['' for _ in range(numRows)]\n    current_row, going_down = 0, False\n    for char in s:\n        rows[current_row] += char\n        if current_row == 0 or current_row == numRows - 1:\n            going_down = not going_down\n        current_row += 1 if going_down else -1\n    return ''.join(rows)\n", "entry_point": "convert", "input": "'PAYPALISHIRING', 3", "output": "'PAHNAPLSIIGYIR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75853_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012364", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[6, 6.5, 6.0]", "output": "6.166666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012365", "code": "heightGrowableTypes = [\"BitmapCanvas\", \"CodeEditor\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"RadioGroup\", \"StaticBox\", \"TextArea\", \"Tree\"]\nwidthGrowableTypes = [\"BitmapCanvas\", \"CheckBox\", \"Choice\", \"CodeEditor\", \"ComboBox\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"PasswordField\", \"RadioGroup\", \"Spinner\", \"StaticBox\", \"StaticText\", \"TextArea\", \"TextField\", \"Tree\"]\ngrowableTypes = [\"Gauge\", \"Slider\", \"StaticLine\"]\ndef getGrowthBehavior(elementType):\n    if elementType in growableTypes:\n        return \"Both-growable\"\n    elif elementType in heightGrowableTypes:\n        return \"Height-growable\"\n    elif elementType in widthGrowableTypes:\n        return \"Width-growable\"\n    else:\n        return \"Not-growable\"\n", "entry_point": "getGrowthBehavior", "input": "'CheckBox'", "output": "'Width-growable'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41927_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012366", "code": "from typing import List\ndef find_missing_numbers(input_list: List[int]) -> List[int]:\n    if not input_list:\n        return []\n    min_val, max_val = min(input_list), max(input_list)\n    full_range = set(range(min_val, max_val + 1))\n    input_set = set(input_list)\n    missing_numbers = sorted(full_range.difference(input_set))\n    return missing_numbers\n", "entry_point": "find_missing_numbers", "input": "[1, 4]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125580_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012367", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'spscs'", "output": "'spscs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012368", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[5, 4, 4, 1, 5]", "output": "[9, 8, 5, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012369", "code": "def flux_conditions(values, threshold=0.2):\n    flux_types = []\n    for value in values:\n        if value > threshold:\n            flux_types.append(1)\n        elif value < -threshold:\n            flux_types.append(-1)\n        else:\n            flux_types.append(0)\n    return flux_types\n", "entry_point": "flux_conditions", "input": "[0.1, -0.3, 0.3, 0.1, 0.1]", "output": "[0, -1, 1, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137897_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012370", "code": "def sum_of_digits(num):\n    sum_digits = 0\n    # Loop to extract digits and sum them up\n    while num > 0:\n        digit = num % 10\n        sum_digits += digit\n        num //= 10\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "13", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55339_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9166", "output": "{1, 2, 9166, 4583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012372", "code": "import time\ndef calculate_seconds_until_future_time(current_time, future_time):\n    return abs(future_time - current_time)\n", "entry_point": "calculate_seconds_until_future_time", "input": "0, 5013", "output": "5013", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45249_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012373", "code": "from typing import List, Optional\ndef validate_patient_ages(ages: List[Optional[int]]) -> List[bool]:\n    validations = []\n    for age in ages:\n        if age is None:\n            validations.append(True)\n        elif isinstance(age, int) and 1 <= age <= 100:\n            validations.append(True)\n        else:\n            validations.append(False)\n    return validations\n", "entry_point": "validate_patient_ages", "input": "[None, 25, 50, 75, 100, 1]", "output": "[True, True, True, True, True, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16067_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012374", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[11, 12, 10]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012375", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "18", "output": "[6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012376", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[64, 11, 35, 12, 89, 13, 33]", "output": "[11, 12, 13, 33, 35, 64, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012377", "code": "def diagnose(data):\n    char_counts = {}\n    for char in data:\n        if char in char_counts:\n            char_counts[char] += 1\n        else:\n            char_counts[char] = 1\n    return char_counts\n", "entry_point": "diagnose", "input": "'hhhhhhlle'", "output": "{'h': 6, 'l': 2, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98386_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012378", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'James', 'smmhith'", "output": "'jsmmhith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012379", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    numbers.sort()\n    n = len(numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return float(numbers[n // 2])\n    else:  # Even number of elements\n        mid1 = numbers[n // 2 - 1]\n        mid2 = numbers[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[6, 7, 8, 9]", "output": "7.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95265_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012380", "code": "def find_missing_number(nums):\n    n = len(nums)\n    expected_sum = (n * (n + 1)) // 2\n    actual_sum = sum(nums)\n    if expected_sum != actual_sum:\n        return expected_sum - actual_sum\n    return -1\n", "entry_point": "find_missing_number", "input": "[0, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115210_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012381", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[85, 88, 79, 84, 86, 92, 65, 89, 85]", "output": "[65, 79, 84, 85, 85, 86, 88, 89, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012382", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    max1, max2, max3 = float('-inf'), float('-inf'), float('-inf')\n    min1, min2 = float('inf'), float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, min1 * min2 * max1)\n", "entry_point": "max_product_of_three", "input": "[1, 1, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74922_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012383", "code": "def convert_bitmap_to_active_bits(primary_bitmap):\n    active_data_elements = []\n    for i in range(len(primary_bitmap)):\n        if primary_bitmap[i] == '1':\n            active_data_elements.append(i + 1)  # Data element numbers start from 1\n    return active_data_elements\n", "entry_point": "convert_bitmap_to_active_bits", "input": "'100000000000000000000000000000000001'", "output": "[1, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53443_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012384", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'filffileilfi'", "output": "'filffileilfi_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012385", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[6, 6, 6, 7, 8, 4, 8, 4]", "output": "[12, 12, 13, 15, 12, 12, 12, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012386", "code": "from urllib.parse import urlparse\n_VALID_URLS = {\"http\", \"https\", \"ftp\"}\ndef check_valid_protocol(url):\n    try:\n        scheme = urlparse(url).scheme\n        return scheme in _VALID_URLS\n    except:\n        return False\n", "entry_point": "check_valid_protocol", "input": "'http://example.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68314_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012387", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'llohel'", "output": "{'llohel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012388", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'longenr'", "output": "'longenr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012389", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "123451.59, '0.0000000'", "output": "'1.2345159E+05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012390", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "7, [2, 3, 5, 3, 2, 7, 2]", "output": "[3, 2, 3, 5, 7, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012391", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5873", "output": "{1, 5873, 839, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3878", "output": "{1, 2, 3878, 7, 554, 14, 1939, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012393", "code": "import math\ndef combs(n, k):\n    if k == 0 or k == n:\n        return 1\n    return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))\n", "entry_point": "combs", "input": "6, 2", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128662_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012394", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'whellelh'", "output": "{'whellelh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012395", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "34, 34, 3", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012396", "code": "def reconstruct_string(freq_list):\n    char_freq = {}\n    # Create a dictionary mapping characters to their frequencies\n    for i, freq in enumerate(freq_list):\n        char_freq[chr(i)] = freq\n    # Sort the characters by their ASCII values\n    sorted_chars = sorted(char_freq.keys())\n    result = \"\"\n    # Reconstruct the string based on the frequency list\n    for char in sorted_chars:\n        result += char * char_freq[char]\n    return result\n", "entry_point": "reconstruct_string", "input": "[3, 1, 1, 1, 2, 1]", "output": "'\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x04\\x05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49716_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012397", "code": "def most_common_numbers(data):\n    frequency = {}\n    # Count the frequency of each number\n    for num in data:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    most_common = [num for num, freq in frequency.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[5, 5, 6, 6, 7]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95940_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012398", "code": "def extract_metadata(docstring):\n    metadata = {}\n    lines = docstring.split('\\n')\n    for line in lines:\n        if line.strip().startswith(':'):\n            key_value = line.strip().split(':', 1)\n            if len(key_value) == 2:\n                key = key_value[0][1:].strip()\n                value = key_value[1].strip()\n                metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "': aboutcg:'", "output": "{'': 'aboutcg:'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74221_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012399", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[8, 27, 12, 12, 1, 8, 1, 8]", "output": "'7]--ESC7ESC7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012400", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[25, 27]", "output": "26.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012401", "code": "import base64\ndef modified_unbase64(s):\n    s_utf7 = '+' + s.replace(',', '/') + '-'\n    original_bytes = s_utf7.encode('utf-7')\n    original_string = original_bytes.decode('utf-7')\n    return original_string\n", "entry_point": "modified_unbase64", "input": "'SGVsvkSGxk=I='", "output": "'+SGVsvkSGxk=I=-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65108_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012402", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3701", "output": "{1, 3701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012403", "code": "from typing import List\ndef distribute_files(file_sizes: List[int], max_size: int) -> List[List[int]]:\n    folders = []\n    current_folder = []\n    current_size = 0\n    for file_size in file_sizes:\n        if current_size + file_size <= max_size:\n            current_folder.append(file_size)\n            current_size += file_size\n        else:\n            folders.append(current_folder)\n            current_folder = [file_size]\n            current_size = file_size\n    if current_folder:\n        folders.append(current_folder)\n    return folders\n", "entry_point": "distribute_files", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22508_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012404", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[10, 12, 14, 20]", "output": "224", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012405", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[10, 5, 0], [0, 5, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92030_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012406", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "65, 0", "output": "65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012407", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'0.1.1-0'", "output": "(0, 1, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2001", "output": "{1, 3, 69, 2001, 87, 23, 667, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012409", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for i in range(len(arr1)):\n        total_diff += abs(arr1[i] - arr2[i])\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0, 0, 23], [0, 0, 0]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136179_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3249", "output": "{1, 3, 9, 361, 171, 3249, 19, 57, 1083}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012411", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.isupper():\n            encrypted_text += chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_text += chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Ea', 3", "output": "'Hd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123131_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012412", "code": "from typing import List\ndef select_best_genome(fitness_scores: List[int]) -> int:\n    best_index = 0\n    best_fitness = fitness_scores[0]\n    for i in range(1, len(fitness_scores)):\n        if fitness_scores[i] > best_fitness:\n            best_fitness = fitness_scores[i]\n            best_index = i\n    return best_index\n", "entry_point": "select_best_genome", "input": "[2, 3, 1, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91198_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012413", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'ae', 'a/2121235'", "output": "'ae/a/2121235'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012414", "code": "from typing import List\ndef check_nested_tags(tag_lines: List[str]) -> bool:\n    stack = []\n    for line in tag_lines:\n        if line.startswith(\"<\") and line.endswith(\">\"):\n            if line.startswith(\"</\"):\n                if not stack or stack[-1] != line[2:-1]:\n                    return False\n                stack.pop()\n            else:\n                stack.append(line[1:-1])\n    return len(stack) == 0\n", "entry_point": "check_nested_tags", "input": "['<tag1>', '</tag2>']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40369_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012415", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[91, 75, 71, 70, 60]", "output": "[91, 75, 71]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012416", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[4, 1, 2, 4, 3, 2]", "output": "[4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1346", "output": "{673, 1, 1346, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1345", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012418", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 1, 6, 7, 4, -2, -1, 1, 7]", "output": "[5, 7, 13, 11, 2, -3, 0, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012419", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 87.5, 88.1, 95]", "output": "87.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_354_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012420", "code": "def name_lengths(names):\n    name_lengths_dict = {}\n    for name in names:\n        name_lengths_dict[name] = len(name)\n    return name_lengths_dict\n", "entry_point": "name_lengths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77735_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6009", "output": "{3, 1, 6009, 2003}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6008", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012422", "code": "def valid_speed_profile(speeds):\n    prev_speed = None\n    for speed in speeds:\n        if speed < 0 or speed % 5 != 0:\n            return False\n        if prev_speed is not None and speed < prev_speed:\n            return False\n        prev_speed = speed\n    return True\n", "entry_point": "valid_speed_profile", "input": "[0, 5, 10, 15]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101992_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012423", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "3.0", "output": "28.27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56380_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012424", "code": "from typing import List\ndef max_average_score(scores: List[int]) -> float:\n    max_avg = float('-inf')\n    window_sum = 0\n    window_size = 0\n    for score in scores:\n        window_sum += score\n        window_size += 1\n        if window_sum / window_size > max_avg:\n            max_avg = window_sum / window_size\n        if window_sum < 0:\n            window_sum = 0\n            window_size = 0\n    return max_avg\n", "entry_point": "max_average_score", "input": "[3, 3, 3]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6333_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012425", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'abcdefghij', 'efghxyz'", "output": "0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012426", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'COOLON::'", "output": "('COOLON', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012427", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'compression'", "output": "\"Module 'compression_ops' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012428", "code": "def repeat(character: str, counter: int) -> str:\n    \"\"\"Repeat returns character repeated `counter` times.\"\"\"\n    word = \"\"\n    for _ in range(counter):\n        word += character\n    return word\n", "entry_point": "repeat", "input": "'a', 12", "output": "'aaaaaaaaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60016_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012429", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 0, 1, 3, 3, 3, -1, -1, 1]", "output": "[0, 1, 6, 18, 28, 40, 30, 42, 72]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012430", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[2, 2, 2, 3, 3, 4, 4]", "output": "[2, 2, 2, 3, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt32", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012431", "code": "def dechiffrer(morse_code):\n    morse_dict = {\n        '.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D', '.': 'E',\n        '..-.': 'F', '--.': 'G', '....': 'H', '..': 'I', '.---': 'J',\n        '-.-': 'K', '.-..': 'L', '--': 'M', '-.': 'N', '---': 'O',\n        '.--.': 'P', '--.-': 'Q', '.-.': 'R', '...': 'S', '-': 'T',\n        '..-': 'U', '...-': 'V', '.--': 'W', '-..-': 'X', '-.--': 'Y',\n        '--..': 'Z', '/': ' '\n    }\n    decoded_message = \"\"\n    words = morse_code.split('/')\n    for word in words:\n        characters = word.split()\n        for char in characters:\n            if char in morse_dict:\n                decoded_message += morse_dict[char]\n        decoded_message += ' '\n    return decoded_message.strip()\n", "entry_point": "dechiffrer", "input": "'.--'", "output": "'W'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31381_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012432", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2291", "output": "{1, 2291, 29, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012433", "code": "def extract_author_name(setup_config):\n    author_name = setup_config.get('author', 'Unknown')\n    return author_name\n", "entry_point": "extract_author_name", "input": "{}", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30533_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012434", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "16", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012435", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/folder/us'", "output": "'us'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012436", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "100, 'HelelHello,'", "output": "([('Content-type', 'text/plain')], 'HelelHello,')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012437", "code": "def find_min_path(triangle):\n    if not triangle:\n        return 0\n    for row in range(len(triangle) - 2, -1, -1):\n        for col in range(len(triangle[row])):\n            triangle[row][col] += min(triangle[row + 1][col], triangle[row + 1][col + 1])\n    return triangle[0][0]\n", "entry_point": "find_min_path", "input": "[[2], [3, 4], [6, 5, 7]]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139174_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012438", "code": "def transform_sql_query(sql_query):\n    modified_query = sql_query.replace(\"select\", \"SELECT\").replace(\"from\", \"FROM\").replace(\"where\", \"WHERE\")\n    return modified_query\n", "entry_point": "transform_sql_query", "input": "'select * frota.f0006 where rownum=1'", "output": "'SELECT * frota.f0006 WHERE rownum=1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96099_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012439", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[2, 1, 3, 5, 0, 3]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012440", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[3, 1, 6, 4, 6, 1, 6]", "output": "[37, 1, 46, 16, 46, 1, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012441", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "['U', 'U', 'U', 'D', 'D', 'L', 'L', 'L', 'L', 'L']", "output": "(-5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012442", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "122, 3", "output": "'122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4887", "output": "{1, 3, 9, 181, 4887, 27, 1629, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012444", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "290", "output": "{1, 290, 2, 5, 10, 145, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt289", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012445", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'nottifiation'", "output": "'nottifiation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012446", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "-8.0, 1", "output": "-8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5559", "output": "{1, 3, 327, 109, 17, 51, 5559, 1853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012448", "code": "from datetime import datetime\ndef is_future_datetime(datetime_str):\n    d2 = datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S')\n    now = datetime.now()\n    return d2 > now\n", "entry_point": "is_future_datetime", "input": "'2020-01-01 00:00:00'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130964_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012449", "code": "def convert_nodes_to_latlon(nodes):\n    latlon_nodes = {}\n    for key, value in nodes.items():\n        lat = value[1] / 1000  # Simulated latitude conversion\n        lon = value[0] / 1000  # Simulated longitude conversion\n        latlon_nodes[key] = [lat, lon]\n    return latlon_nodes\n", "entry_point": "convert_nodes_to_latlon", "input": "{201: [3, 2], 401: [3, 2]}", "output": "{201: [0.002, 0.003], 401: [0.002, 0.003]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92519_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012450", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[34]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012451", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[6, 6, 6, 6, 6, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012452", "code": "def find_anomaly(numbers, preamble_size):\n    def is_valid(window, number):\n        for i in range(len(window)):\n            for j in range(i + 1, len(window)):\n                if window[i] + window[j] == number:\n                    return True\n        return False\n    window = numbers[:preamble_size]\n    for i in range(preamble_size, len(numbers)):\n        number = numbers[i]\n        if not is_valid(window, number):\n            return number\n        window.pop(0)\n        window.append(number)\n    return None\n", "entry_point": "find_anomaly", "input": "[3, 4, 5, 2], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105708_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012453", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[1, 1, 5, 5, -2, -2, -1, 0]", "output": "[1, 5, -2, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012454", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[50, 100, 90, 70]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012455", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'2322522'", "output": "2322522", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012456", "code": "def extract_test_cases(input_string):\n    test_cases = []\n    lines = input_string.split('\\n')\n    for line in lines:\n        if '=' in line:\n            parts = line.split('=')\n            server_version = parts[0].strip().strip(\"'\")\n            test_function = parts[1].strip().split()[0]\n            if test_function != '_skip_test':\n                test_cases.append((server_version, test_function))\n    return test_cases\n", "entry_point": "extract_test_cases", "input": "\" 'A' = API\\n\"", "output": "[('A', 'API')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131043_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012457", "code": "import sys\ndef get_compatible_modules(python_version: int) -> list:\n    compatible_modules = []\n    if python_version == 2:\n        compatible_modules = ['cStringIO', 'thrift.transport.TTransport']\n    elif python_version == 3:\n        compatible_modules = ['io', 'thrift.transport.TTransport']\n    return compatible_modules\n", "entry_point": "get_compatible_modules", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97069_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012458", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'itext. sample'", "output": "'Itext. sample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012459", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "68", "output": "'D'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012460", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1389", "output": "{1, 3, 1389, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012461", "code": "def extract_variables(script):\n    variables = {}\n    for line in script.splitlines():\n        line = line.strip()\n        if line and \"=\" in line:\n            parts = line.split(\"=\")\n            variable_name = parts[0].strip()\n            variable_value = \"=\".join(parts[1:]).strip()\n            variables[variable_name] = variable_value\n    return variables\n", "entry_point": "extract_variables", "input": "'pRDM_eVIEd_ctry = '", "output": "{'pRDM_eVIEd_ctry': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38111_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012462", "code": "from typing import List\ndef extract_packages(module_names: List[str]) -> List[str]:\n    unique_packages = set()\n    for module_name in module_names:\n        parts = module_name.split('.')\n        if len(parts) >= 2:  # Ensure the correct format of package.subpackage.module\n            unique_packages.add('.'.join(parts[:2]))\n    return sorted(list(unique_packages))\n", "entry_point": "extract_packages", "input": "['grr.server.some_module']", "output": "['grr.server']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71196_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012463", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[75, 75, 75, 75, 75]", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012464", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[2, 3, 1], 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5438", "output": "{1, 2, 5438, 2719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5437", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012466", "code": "def count_file_extensions(file_paths):\n    extension_counts = {}\n    for file_path in file_paths:\n        file_name, file_extension = file_path.rsplit('.', 1)\n        file_extension = file_extension.lower()\n        extension_counts[file_extension] = extension_counts.get(file_extension, 0) + 1\n    return extension_counts\n", "entry_point": "count_file_extensions", "input": "['data.csv']", "output": "{'csv': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106441_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012467", "code": "def simulate_insert_roles(roles_list):\n    total_inserted = 0\n    for role_data in roles_list:\n        # Simulate inserting the role into the database\n        print(f\"Simulating insertion of role: {role_data['name']}\")\n        total_inserted += 1\n    return total_inserted\n", "entry_point": "simulate_insert_roles", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36169_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012468", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'this', 1", "output": "{'this': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012469", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9694", "output": "{1, 2, 131, 37, 262, 74, 4847, 9694}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9693", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012470", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9182", "output": "{1, 2, 9182, 4591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012471", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(1, -2, -2, 2, 1, 1, -1)", "output": "'1.-2.-2.2.1.1.-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4691", "output": "{1, 4691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012473", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[6, 9, 7, 10, 10], 3", "output": "[9, 12, 10, 13, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012474", "code": "def find_common_elements(list1, list2):\n    common_elements = set()\n    for num in list1:\n        if num in list2:\n            common_elements.add(num)\n    return list(common_elements)\n", "entry_point": "find_common_elements", "input": "[1, 2, 3, 4], [2, 4, 5, 6]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87689_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012475", "code": "from typing import List\ndef most_common_age(ages: List[int]) -> int:\n    age_freq = {}\n    for age in ages:\n        if age in age_freq:\n            age_freq[age] += 1\n        else:\n            age_freq[age] = 1\n    most_common = min(age_freq, key=lambda x: (-age_freq[x], x))\n    return most_common\n", "entry_point": "most_common_age", "input": "[26, 26, 26, 25, 25]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113386_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012476", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "739", "output": "{1, 739}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012477", "code": "def reverse_words_in_string(s: str) -> str:\n    result = \"\"\n    word = \"\"\n    for char in s:\n        if char != ' ':\n            word = char + word\n        else:\n            result += word + ' '\n            word = \"\"\n    result += word  # Append the last word without a space\n    return result\n", "entry_point": "reverse_words_in_string", "input": "'olloh'", "output": "'hollo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88814_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012478", "code": "from typing import List\n_VALUES_TO_NAMES = {\n    1: \"ASCAP\",\n    2: \"BMI\",\n    3: \"SESAC\",\n    4: \"Other\",\n}\n_NAMES_TO_VALUES = {\n    \"ASCAP\": 1,\n    \"BMI\": 2,\n    \"SESAC\": 3,\n    \"Other\": 4,\n}\ndef map_names_to_values(names: List[str]) -> List[int]:\n    output = []\n    for name in names:\n        if name in _NAMES_TO_VALUES:\n            output.append(_NAMES_TO_VALUES[name])\n    return output\n", "entry_point": "map_names_to_values", "input": "['ASCAP', 'BMI', 'SESAC', 'Other', 'BMI']", "output": "[1, 2, 3, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134159_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012479", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "10, 8", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012480", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'QFH'", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3911", "output": "{1, 3911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012482", "code": "def count_tasks(tasks):\n    task_count = {}\n    for task in tasks:\n        task_name = task[\"task_name\"].lower()\n        task_count[task_name] = task_count.get(task_name, 0) + 1\n    return task_count\n", "entry_point": "count_tasks", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30663_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012483", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[2, 2, 2, 3]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012484", "code": "from typing import List, Any\ndef encode_and_append(pieces: List[str], value: Any) -> int:\n    encoded_value = str(value)  # Convert the value to a string\n    pieces.append(encoded_value)  # Append the encoded value to the list\n    return len(encoded_value)  # Return the size of the encoded value\n", "entry_point": "encode_and_append", "input": "['a'], 10", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7925_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012485", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[4, 4, 4, 1, 2, 2]", "output": "[(4, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012486", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, -1, 3, 3, 1, 0, -1]", "output": "[0, 2, 6, 4, 1, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137556_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012487", "code": "def merge_lists(tds, tbs):\n    tas = []\n    # Append elements from tds in order\n    for element in tds:\n        tas.append(element)\n    # Append elements from tbs in reverse order\n    for element in reversed(tbs):\n        tas.append(element)\n    return tas\n", "entry_point": "merge_lists", "input": "[1, 2, 2, 1, 1], [6, 4, 7, 4, 4, 5]", "output": "[1, 2, 2, 1, 1, 5, 4, 4, 7, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146813_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012488", "code": "from typing import List\ndef find_new_active_providers(existing_providers: List[str]) -> List[str]:\n    # Mocking the retrieved active providers for demonstration\n    active_providers = ['A', 'B', 'C']  # Simulating the active providers retrieved from the database\n    # Filtering out the new active providers not present in the existing providers list\n    new_active_providers = [provider for provider in active_providers if provider not in existing_providers]\n    return new_active_providers\n", "entry_point": "find_new_active_providers", "input": "[]", "output": "['A', 'B', 'C']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68315_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012489", "code": "def calculate_discounted_price(costs, discounts, rebate_factor):\n    total_cost = sum(costs)\n    total_discount = sum(discounts)\n    final_price = (total_cost - total_discount) * rebate_factor\n    if final_price < 0:\n        return 0\n    else:\n        return round(final_price, 2)\n", "entry_point": "calculate_discounted_price", "input": "[50], [100], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12135_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012490", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'sdsa', '11221111122111111'", "output": "'sdsa11221111122111111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012491", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'\u4f60'", "output": "'\u4f60'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012492", "code": "import re\ndef count_unique_words(text):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'yyythopython t'", "output": "{'yyythopython': 1, 't': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33729_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012493", "code": "def get_max_depth(json):\n    def calculate_depth(obj, depth):\n        if isinstance(obj, dict):\n            max_depth = depth\n            for key, value in obj.items():\n                max_depth = max(max_depth, calculate_depth(value, depth + 1))\n            return max_depth\n        else:\n            return depth\n    return calculate_depth(json, 1)\n", "entry_point": "get_max_depth", "input": "{}", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103896_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012494", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[1, 3, 3, 3, 3, 4, 10]", "output": "3.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012495", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9025", "output": "{9025, 1, 5, 361, 1805, 19, 25, 475, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9024", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012496", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 2, 7, 1, 1]", "output": "[4, 4, 343, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012497", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[0, 2, 2, 2, 5, 3, 5, 2]", "output": "[0, 2, 4, 6, 11, 14, 19, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012498", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012499", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "2", "output": "\"Parse error, unexpected '</'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012500", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2558", "output": "{1, 2, 2558, 1279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012501", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'1.12.1'", "output": "'1.12.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4093", "output": "{1, 4093}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012503", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "227", "output": "{1, 227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt226", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012504", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hell'", "output": "{'hell': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012505", "code": "def countdown_sequence(n):\n    if n <= 0:\n        return []\n    else:\n        return [n] + countdown_sequence(n - 1) + countdown_sequence(n - 2)\n", "entry_point": "countdown_sequence", "input": "3", "output": "[3, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94818_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012506", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 3, 1", "output": "40.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012507", "code": "def adapt_dataset_name(dataset_name: str) -> str:\n    torchvision_datasets = {\n        \"CIFAR10\": \"CIFAR10\",\n        \"MNIST\": \"MNIST\",\n        # Add more Torchvision dataset names here\n    }\n    return torchvision_datasets.get(dataset_name, \"Dataset not found\")\n", "entry_point": "adapt_dataset_name", "input": "'CIFAR10'", "output": "'CIFAR10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98850_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012508", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[10, [5], [6, 10]]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012509", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "177, 1, 'ffofooo'", "output": "{'ffofooo': 177}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012510", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[0, 0, 15, 0, 0]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012511", "code": "def calculate_absolute_differences_sum(arr):\n    total_diff = 0\n    for i in range(1, len(arr)):\n        total_diff += abs(arr[i] - arr[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 5, 10, 16]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67231_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012512", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[90, 94, 85, 70, 60], 2", "output": "[90, 94]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012513", "code": "from typing import List, Dict\ndef filter_restaurants(restaurants: List[Dict[str, str]], cuisine: str, min_rating: float) -> List[Dict[str, str]]:\n    filtered_restaurants = []\n    for restaurant in restaurants:\n        if restaurant[\"cuisine\"] == cuisine and restaurant[\"rating\"] >= min_rating:\n            filtered_restaurants.append(restaurant)\n    return filtered_restaurants\n", "entry_point": "filter_restaurants", "input": "[], 'Italian', 4.0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28887_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012514", "code": "import re\nfrom typing import List, Tuple\ndef process_code_lines(lines: List[str]) -> Tuple[List[str], List[str], str]:\n    function_scope = []\n    scope_args = []\n    function_return = \"\"\n    for line in lines:\n        match = re.search(\"^ *return[ ]+\", line)\n        if not line.strip().startswith(\"return\"):\n            function_scope.append(line)\n        else:\n            function_return = line.strip()\n    return_variable_name = function_return.split(\" \")[-1]\n    # Placeholder for parsing function scope to determine scope and arguments\n    # Implement the parsing logic here\n    return function_scope, scope_args, return_variable_name\n", "entry_point": "process_code_lines", "input": "['arg2):']", "output": "(['arg2):'], [], '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148604_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012515", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7256", "output": "{1, 2, 4, 8, 907, 3628, 1814, 7256}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7255", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012516", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'HelloHel!'", "output": "'HelloHel!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012517", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'ehhe'", "output": "'ehhe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012518", "code": "def count_unique_characters(strings):\n    unique_chars = set()\n    for string in strings:\n        unique_chars.update(set(string))\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "['abcde', 'fghij', 'k']", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012519", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'4.2.2'", "output": "(4, 2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012520", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "7, -8, 0", "output": "-56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012521", "code": "import re\ndef extract_attributes(class_definition):\n    attributes = []\n    attribute_pattern = r'Column\\(\"(\\w+)\",\\s*db\\.(\\w+\\(.+?\\)),\\s*comment=\"(.+?)\"\\)'\n    matches = re.findall(attribute_pattern, class_definition)\n    for match in matches:\n        attribute = {\n            \"name\": match[0],\n            \"data_type\": match[1],\n            \"comment\": match[2]\n        }\n        attributes.append(attribute)\n    return attributes\n", "entry_point": "extract_attributes", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144502_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012522", "code": "def find_highest_score(scores):\n    if not scores:\n        return None\n    highest_score = scores[0]\n    for score in scores[1:]:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[70, 85, 90, 95]", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012523", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1441", "output": "{11, 1, 1441, 131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012524", "code": "import os\nimport base64\ndef generate_memcache_key(key, namespace=None):\n    app_id = os.environ.get('APPLICATION_ID', '')\n    if app_id:\n        app_id += '.'\n    if namespace:\n        key = f\"{namespace}.{key}\"\n    key = f\"{key}{app_id}\"\n    return base64.b64encode(key.encode()).decode()\n", "entry_point": "generate_memcache_key", "input": "'example_key'", "output": "'ZXhhbXBsZV9rZXk='", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83754_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012525", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[100, 100, 100, 100, 72]", "output": "94.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2571", "output": "{3, 1, 2571, 857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012527", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[2, 2, 2]", "output": "[2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt85", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012528", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import pandadsas'", "output": "'pandadsas'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012529", "code": "def directory_pattern_filter(input_str):\n    if isinstance(input_str, str) and input_str:\n        return True\n    return False\n", "entry_point": "directory_pattern_filter", "input": "'test'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_469_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012530", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[75, 76, 76, 77, 76]", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47766_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012531", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'ee'", "output": "[('e', 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012532", "code": "from typing import List\nfrom heapq import heapify, heappop\ndef find_kth_largest(nums: List[int], k: int) -> int:\n    if not nums:\n        return None\n    # Create a max-heap by negating each element\n    heap = [-num for num in nums]\n    heapify(heap)\n    # Pop k-1 elements from the heap\n    for _ in range(k - 1):\n        heappop(heap)\n    # Return the kth largest element (negate the result)\n    return -heap[0]\n", "entry_point": "find_kth_largest", "input": "[1], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124799_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012533", "code": "def average_string_length(string_list):\n    total_length = 0\n    for string in string_list:\n        total_length += len(string)\n    average_length = total_length / len(string_list)\n    rounded_average_length = round(average_length)\n    return rounded_average_length\n", "entry_point": "average_string_length", "input": "['abcde', 'abcd', 'abcdef']", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128270_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012534", "code": "def extract_python_version(input_string):\n    parts = input_string.split()\n    for part in parts:\n        if '.' in part:\n            return part\n", "entry_point": "extract_python_version", "input": "'Here is the version: .\u2744.\u2744'", "output": "'.\u2744.\u2744'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30856_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012535", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[50, 49]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012536", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "0", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012537", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'C:\\\\User\\\\path\\\\..\\\\path\\\\toesktop\\\\ft'", "output": "'C:/User/path/toesktop/ft'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012538", "code": "def rock_paper_scissors_winner(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie!\"\n    elif (player1_choice == \"rock\" and player2_choice == \"scissors\") or \\\n         (player1_choice == \"scissors\" and player2_choice == \"paper\") or \\\n         (player1_choice == \"paper\" and player2_choice == \"rock\"):\n        return \"Player 1 wins!\"\n    else:\n        return \"Player 2 wins!\"\n", "entry_point": "rock_paper_scissors_winner", "input": "'rock', 'scissors'", "output": "'Player 1 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136725_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012539", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'amelolorett'", "output": "{'amelolorett': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012540", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6367", "output": "{1, 6367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012541", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "24, 5", "output": "(4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012542", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[70, 75, 76, 74, 72], 4", "output": "74.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012543", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'<div>eHoello</div>'", "output": "'eHoello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1873", "output": "{1873, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012545", "code": "def delete_talk(request: dict) -> str:\n    talk_id = request.get('id')\n    user_id = request.get('user_id')\n    if talk_id:\n        # Simulating database lookup\n        if talk_id == 123 and user_id == 456:  # Assuming talk ID and user ID for permission check\n            # Simulating deletion of comments\n            comments_deleted = True  # Placeholder for comments deletion status\n            if comments_deleted:\n                return \"success\"\n        elif talk_id != 123:\n            return \"talk_id does not exist\"\n        else:\n            return \"no permission\"\n    else:\n        return \"talk_id does not exist\"\n", "entry_point": "delete_talk", "input": "{'user_id': 456}", "output": "'talk_id does not exist'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53356_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012546", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[6, 5, 6, 3, 5, 2, 6, 6]", "output": "[2, 3, 5, 5, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012547", "code": "def custom_flatten(input_list):\n    flattened_list = []\n    # Flatten the list\n    for sublist in input_list:\n        for item in sublist:\n            flattened_list.append(item)\n    # Remove duplicates and sort\n    unique_sorted_list = []\n    for item in flattened_list:\n        if item not in unique_sorted_list:\n            unique_sorted_list.append(item)\n    unique_sorted_list.sort()\n    return unique_sorted_list\n", "entry_point": "custom_flatten", "input": "[[]]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111051_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012548", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8871", "output": "{1, 3, 2957, 8871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012549", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012550", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "1.0, 6.0041539669036865", "output": "5.0041539669036865", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012551", "code": "def extract_project_info(setup_dict):\n    project_name = setup_dict.get('name', '')\n    project_description = setup_dict.get('description', '')\n    project_author = setup_dict.get('author', '')\n    return project_name, project_description, project_author\n", "entry_point": "extract_project_info", "input": "{}", "output": "('', '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103616_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012552", "code": "def process_filename(filename):\n    ALLOW_CHILD_SERVICES = ['service1', 'service2']  # Example list of allowed services\n    REPLACE_NAMES = {'old_name1': 'new_name1', 'old_name2': 'new_name2'}  # Example dictionary for name replacements\n    IGNORED_NAMES = {'ignored_name1', 'ignored_name2'}  # Example set of ignored names\n    friendly_name, _ = filename.split('_', 1)\n    friendly_name = friendly_name.replace('Amazon', '').replace('AWS', '')\n    name_parts = friendly_name.split('_')\n    if len(name_parts) >= 2:\n        if name_parts[0] not in ALLOW_CHILD_SERVICES:\n            friendly_name = name_parts[-1]\n    if friendly_name.lower().endswith('large'):\n        return None\n    if friendly_name in REPLACE_NAMES:\n        friendly_name = REPLACE_NAMES[friendly_name]\n    if friendly_name in IGNORED_NAMES:\n        return None\n    return friendly_name.lower()\n", "entry_point": "process_filename", "input": "'service1_test'", "output": "'service1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53309_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012553", "code": "def longest_palindromic_substring(s):\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    max_palindrome = \"\"\n    for i in range(len(s)):\n        # Odd-length palindrome\n        palindrome1 = expand_around_center(s, i, i)\n        # Even-length palindrome\n        palindrome2 = expand_around_center(s, i, i + 1)\n        if len(palindrome1) > len(max_palindrome):\n            max_palindrome = palindrome1\n        if len(palindrome2) > len(max_palindrome):\n            max_palindrome = palindrome2\n    return max_palindrome\n", "entry_point": "longest_palindromic_substring", "input": "'aaaaabbbbaaaaa'", "output": "'aaaaabbbbaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137320_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012554", "code": "from typing import List\nimport itertools\ndef count_combinations(nums: List[int], length: int) -> int:\n    # Generate all combinations of the given length from the input list\n    all_combinations = list(itertools.combinations(nums, length))\n    # Return the total number of unique combinations\n    return len(all_combinations)\n", "entry_point": "count_combinations", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6198_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012555", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2053", "output": "{1, 2053}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012556", "code": "def max_non_adjacent_sum(nums):\n    inclusive = 0\n    exclusive = 0\n    for num in nums:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update the inclusive value for the next iteration\n        exclusive = new_exclusive  # Update the exclusive value for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[3, 1, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145895_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8062", "output": "{1, 2, 139, 278, 58, 29, 8062, 4031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4377", "output": "{1, 3, 1459, 4377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012559", "code": "def simulate_card_war(player1_deck, player2_deck):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    return player1_points, player2_points\n", "entry_point": "simulate_card_war", "input": "[1, 1, 1], [1, 1, 1]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3214_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012560", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[1, 4, 2, 0, 3, 2, 2, 5]", "output": "[4, 2, 0, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8598", "output": "{1, 2, 3, 6, 4299, 2866, 8598, 1433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012562", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7222", "output": "{1, 2, 46, 7222, 23, 314, 3611, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012563", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[0, 0, 1, 2]", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012564", "code": "from collections import deque\ndef find_max_element(nums):\n    d = deque(nums)\n    max_element = None\n    while d:\n        if d[0] >= d[-1]:\n            current_max = d.popleft()\n        else:\n            current_max = d.pop()\n        if max_element is None or current_max > max_element:\n            max_element = current_max\n    return max_element\n", "entry_point": "find_max_element", "input": "[3, 5, 7, 1, 2]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79887_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012565", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[1, 2, 3, 4, 5]", "output": "[1, 4, 9, 8, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "666", "output": "{1, 2, 3, 37, 6, 9, 74, 333, 111, 18, 666, 222}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt665", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012567", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'multilineis'", "output": "'multilineis\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012568", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(2, 6), (2, 6)]", "output": "{2: [6, 6]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012569", "code": "from typing import List, Optional\ndef find_second_largest(nums: List[int]) -> Optional[int]:\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max if second_max != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[1, 2, 3, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116497_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012570", "code": "def calculate_data_size(data_dir, batch_size, num_workers):\n    # Number of images in train and valid directories (example values)\n    num_train_images = 1000\n    num_valid_images = 500\n    # Calculate total data size for training and validation sets\n    total_data_size_train = num_train_images * batch_size\n    total_data_size_valid = num_valid_images * batch_size\n    # Adjust data size based on the number of workers\n    total_data_size_train *= (1 + (num_workers - 1) * 0.1)\n    total_data_size_valid *= (1 + (num_workers - 1) * 0.1)\n    return total_data_size_train, total_data_size_valid\n", "entry_point": "calculate_data_size", "input": "'/path/to/data', 35, 4", "output": "(45500.0, 22750.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75732_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012571", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'eexampl.json'", "output": "'eexampl_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012572", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "942", "output": "{1, 2, 3, 6, 942, 471, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt941", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012573", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'A', 'B', 'B', 'B'], 2", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012574", "code": "def extract_python_version(input_string):\n    parts = input_string.split()\n    for part in parts:\n        if '.' in part:\n            return part\n", "entry_point": "extract_python_version", "input": "'3\u2744.8.\u260310'", "output": "'3\u2744.8.\u260310'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30856_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012575", "code": "def calculate_error_rates(acc_rate1, acc_rate5):\n    err_rate1 = 1 - acc_rate1\n    err_rate5 = 1 - acc_rate5\n    return err_rate1, err_rate5\n", "entry_point": "calculate_error_rates", "input": "-1.85, 2.158", "output": "(2.85, -1.158)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60400_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012576", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[15], 1", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012577", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[5, 1, 0, 5, 1, 0, 2, 3]", "output": "[5, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012578", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'COCCC(=C)COO'", "output": "'COCCC(=C)COO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012579", "code": "def max_non_overlapping_circles(radii):\n    radii.sort()\n    count = 0\n    max_radius = float('-inf')\n    for radius in radii:\n        if radius >= max_radius:\n            count += 1\n            max_radius = radius * 2\n    return count\n", "entry_point": "max_non_overlapping_circles", "input": "[1, 2, 4, 8, 16, 32]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114287_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012580", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, 2.0, 2.5", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012581", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, 3, 4, -1, -2]", "output": "(4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012582", "code": "from typing import List\ndef check_unique_service_names(service_names: List[str]) -> bool:\n    seen_names = set()\n    for name in service_names:\n        if name in seen_names:\n            return False\n        seen_names.add(name)\n    return True\n", "entry_point": "check_unique_service_names", "input": "['database', 'cache', 'database']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135580_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4089", "output": "{1, 3, 141, 47, 1363, 87, 4089, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1591", "output": "{1, 43, 37, 1591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012585", "code": "def calculate_grayscale(r: int, g: int, b: int) -> int:\n    grayscale = int(0.299 * r + 0.587 * g + 0.114 * b)\n    return grayscale\n", "entry_point": "calculate_grayscale", "input": "0, 0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80937_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012586", "code": "SEP_MAP = {\"xls\": \"\\t\", \"XLS\": \"\\t\", \"CSV\": \",\", \"csv\": \",\", \"xlsx\": \"\\t\", \"XLSX\": \"\\t\"}\ndef get_separator(file_extension):\n    return SEP_MAP.get(file_extension, \"Unknown\")\n", "entry_point": "get_separator", "input": "'CSV'", "output": "','", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45466_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012587", "code": "def longest_common_substring(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    max_len = 0\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n                max_len = max(max_len, dp[i][j])\n    return max_len\n", "entry_point": "longest_common_substring", "input": "'abcde', 'bcf'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58621_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012588", "code": "def find_duplicate(nums):\n    d = {}\n    for i in range(0, len(nums)):\n        if nums[i] in d:\n            return nums[i]\n        else:\n            d[nums[i]] = i\n", "entry_point": "find_duplicate", "input": "[1, 2, 3, 4, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148746_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012589", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'kekey1=va1hr_value'", "output": "{'kekey1': 'va1hr_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012590", "code": "from typing import List\nimport re\ndef extract_view_modules(url_config: str) -> List[str]:\n    view_modules = set()\n    # Regular expression pattern to match import statements from 'users' app namespace\n    pattern = r\"from \\. import ([\\w, ]+)\"\n    # Find all matches of the pattern in the URL configuration content\n    matches = re.findall(pattern, url_config)\n    # Extract view modules from each match and add them to the set\n    for match in matches:\n        modules = match.split(',')\n        for module in modules:\n            view_modules.add(module.strip())\n    return list(view_modules)\n", "entry_point": "extract_view_modules", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52712_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012591", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[14, 0, 0, 0, 0, 0, 0, 0], 2", "output": "[14, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012592", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'applict/'", "output": "('applict', '', '', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012593", "code": "def parse_vm_info(input_str):\n    vm_info = {}\n    entries = input_str.split('^')\n    for entry in entries:\n        vm_name, ip_address = entry.split(':')\n        vm_info[vm_name] = ip_address\n    return vm_info\n", "entry_point": "parse_vm_info", "input": "'VM1:.168.1.2^VM3VM1:.168.1.3'", "output": "{'VM1': '.168.1.2', 'VM3VM1': '.168.1.3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46533_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012594", "code": "import os\ndef expand_env_variables(file_path):\n    def replace_env_var(match):\n        var_name = match.group(1)\n        return os.environ.get(var_name, f'%{var_name}%')\n    expanded_path = os.path.expandvars(file_path)\n    return expanded_path\n", "entry_point": "expand_env_variables", "input": "'%%LOCLAPPDATA%\\\\spdyn-update'", "output": "'%%LOCLAPPDATA%\\\\spdyn-update'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012595", "code": "def rotate_2d_array(arr):\n    if not arr:\n        return arr\n    rows, cols = len(arr), len(arr[0])\n    # Transpose the matrix\n    for i in range(rows):\n        for j in range(i, cols):\n            arr[i][j], arr[j][i] = arr[j][i], arr[i][j]\n    # Reverse each row\n    for i in range(rows):\n        arr[i] = arr[i][::-1]\n    return arr\n", "entry_point": "rotate_2d_array", "input": "[[100]]", "output": "[[100]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81190_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012596", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "17", "output": "'IP_CAMERA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012597", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[63]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7207", "output": "{1, 7207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012599", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "6, 5, 6", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012600", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1.0, 2.1944444444444446", "output": "2.1944444444444446", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "964", "output": "{1, 2, 482, 964, 4, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt963", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7539", "output": "{1, 3, 7, 359, 2513, 7539, 1077, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012603", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "56, ['x', '59']", "output": "177", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2643", "output": "{3, 1, 2643, 881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012605", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "1073741824, 16", "output": "1073741840", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012606", "code": "def max_non_adjacent_sum(nums):\n    if not nums:\n        return 0\n    inclusive = nums[0]\n    exclusive = 0\n    for i in range(1, len(nums)):\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive sum\n        inclusive = exclusive + nums[i]  # Update inclusive sum for the next iteration\n        exclusive = new_exclusive  # Update exclusive sum for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_non_adjacent_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91455_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012607", "code": "def calculate_total_cost(prices, quantities):\n    total_cost = sum(price * quantity for price, quantity in zip(prices, quantities))\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "[16], [11]", "output": "176", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57072_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012608", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5469", "output": "{1, 3, 5469, 1823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012609", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5769", "output": "{1, 641, 3, 1923, 5769, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012610", "code": "def categorize_fault_type(fault_type):\n    keyword_to_category = {\n        'keypair': 'KeyPair',\n        'publickey': 'PublicKey',\n        'privatekey': 'PrivateKey',\n        'helm-release': 'Helm Release',\n        'install': 'Installation',\n        'delete': 'Deletion',\n        'pod-status': 'Pod Status',\n        'kubernetes-cluster': 'Kubernetes',\n        'connection': 'Connection',\n        'helm-not-updated': 'Helm Version',\n        'helm-version-check': 'Helm Version Check',\n        'helm-not-installed': 'Helm Installation',\n        'check-helm-installed': 'Helm Installation Check',\n        'helm-registry-path-fetch': 'Helm Registry Path',\n        'helm-chart-pull': 'Helm Chart Pull',\n        'helm-chart-export': 'Helm Chart Export',\n        'kubernetes-get-version': 'Kubernetes Version'\n    }\n    categories = []\n    for keyword, category in keyword_to_category.items():\n        if keyword in fault_type:\n            categories.append(category)\n    return categories\n", "entry_point": "categorize_fault_type", "input": "'error'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138910_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012611", "code": "def _sk_fail(input_str):\n    if input_str == \"pdb\":\n        return \"Debugging tool selected: pdb\"\n    else:\n        return \"Unknown operation\"\n", "entry_point": "_sk_fail", "input": "'test'", "output": "'Unknown operation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128113_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012612", "code": "def max_sum_non_adjacent_parity(lst):\n    odd_sum = even_sum = 0\n    for num in lst:\n        if num % 2 == 0:  # Even number\n            even_sum, odd_sum = max(even_sum, odd_sum), even_sum + num\n        else:  # Odd number\n            even_sum, odd_sum = max(even_sum, odd_sum + num), odd_sum\n    return max(odd_sum, even_sum)\n", "entry_point": "max_sum_non_adjacent_parity", "input": "[10, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85540_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012613", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[28, 27, 26, 25, 21, 15, 10, 5, 1], 6", "output": "[28, 27, 26, 25, 21, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012614", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'data-scienec', 'machine-learnnig'", "output": "'data-scienec/machine-learnnig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012615", "code": "def generateMatrix(n: int) -> [[int]]:\n    def fillMatrix(matrix, top, bottom, left, right, num):\n        if top > bottom or left > right:\n            return\n        # Fill top row\n        for i in range(left, right + 1):\n            matrix[top][i] = num\n            num += 1\n        top += 1\n        # Fill right column\n        for i in range(top, bottom + 1):\n            matrix[i][right] = num\n            num += 1\n        right -= 1\n        # Fill bottom row\n        if top <= bottom:\n            for i in range(right, left - 1, -1):\n                matrix[bottom][i] = num\n                num += 1\n            bottom -= 1\n        # Fill left column\n        if left <= right:\n            for i in range(bottom, top - 1, -1):\n                matrix[i][left] = num\n                num += 1\n            left += 1\n        fillMatrix(matrix, top, bottom, left, right, num)\n    matrix = [[None for _ in range(n)] for _ in range(n)]\n    fillMatrix(matrix, 0, n - 1, 0, n - 1, 1)\n    return matrix\n", "entry_point": "generateMatrix", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97938_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "17", "output": "{1, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012617", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'examplefile.tx'", "output": "'App/static/uploads/examplefile.tx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6209", "output": "{6209, 1, 887, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012619", "code": "def adjust_risk_scores(dependents, risk_scores):\n    if dependents > 0:\n        risk_scores['life'] += 1\n        risk_scores['disability'] += 1\n    return risk_scores\n", "entry_point": "adjust_risk_scores", "input": "0, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56665_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012620", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "0, 100", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8077", "output": "{197, 1, 8077, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012622", "code": "def import_classes_from_modules(module_names):\n    imported_classes = []\n    for module_name in module_names:\n        try:\n            module = __import__(module_name, globals(), locals(), [], 0)\n            for name in dir(module):\n                obj = getattr(module, name)\n                if inspect.isclass(obj):\n                    imported_classes.append(obj)\n        except ImportError:\n            print(f\"Module '{module_name}' not found.\")\n    return imported_classes\n", "entry_point": "import_classes_from_modules", "input": "['nonexistent_module1', 'nonexistent_module2']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67056_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012623", "code": "def process_integers(input_list):\n    # Multiply each integer by 2\n    multiplied_list = [num * 2 for num in input_list]\n    # Subtract 10 from each integer\n    subtracted_list = [num - 10 for num in multiplied_list]\n    # Calculate the square of each integer\n    squared_list = [num ** 2 for num in subtracted_list]\n    # Find the sum of all squared integers\n    sum_squared = sum(squared_list)\n    return sum_squared\n", "entry_point": "process_integers", "input": "[6, 8, 2]", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101819_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012624", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012625", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zzzzx'", "output": "128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012626", "code": "from typing import List\ndef count_items_above_average(items: List[int]) -> int:\n    if not items:\n        return 0\n    average_weight = sum(items) / len(items)\n    count = sum(1 for item in items if item > average_weight)\n    return count\n", "entry_point": "count_items_above_average", "input": "[1, 2, 3, 10, 10, 10, 10]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73147_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012627", "code": "def merge_sorted_lists(list1, list2):\n    merged_list = []\n    i, j = 0, 0\n    while i < len(list1) and j < len(list2):\n        if list1[i] < list2[j]:\n            merged_list.append(list1[i])\n            i += 1\n        else:\n            merged_list.append(list2[j])\n            j += 1\n    merged_list.extend(list1[i:])\n    merged_list.extend(list2[j:])\n    return merged_list\n", "entry_point": "merge_sorted_lists", "input": "[1, 3, 5], [2, 4, 6]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104249_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012628", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[1, 0, 43, 22, 0, 0, 0, 22]", "output": "([1, 43], [0, 22, 0, 0, 0, 22])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012629", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[3885], 1", "output": "3885", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012630", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'thaaTthat'", "output": "'thaaTthat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012631", "code": "def count_coma_warriors(health_points):\n    coma_warriors = 0\n    for health in health_points:\n        if health == 0:\n            coma_warriors += 1\n    return coma_warriors\n", "entry_point": "count_coma_warriors", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115294_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012632", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalnum():\n            char_count[char_lower] = char_count.get(char_lower, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hhhhool3'", "output": "{'h': 4, 'o': 2, 'l': 1, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64902_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012633", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "-0.04666666666666666, 1", "output": "-0.04666666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012634", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'045678901'", "output": "'04567890102485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012635", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'abcdefghi'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012636", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'PREFIX_SKFSKF', 'PREFIX_'", "output": "'SKFSKF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012637", "code": "import re\ndef extractVolChapterFragmentPostfix(title):\n    title = title.replace('-', '.')  # Replace hyphens with periods for consistency\n    match = re.match(r'v(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:\\s*(.*))?$', title, re.IGNORECASE)\n    if match:\n        vol = match.group(1)\n        chp = match.group(2)\n        frag = match.group(3)\n        postfix = match.group(4)\n        return vol, chp, frag, postfix\n    else:\n        return None, None, None, None\n", "entry_point": "extractVolChapterFragmentPostfix", "input": "'v3.5.2 . Chapter 10: The1Er'", "output": "('3', '5', '2', '. Chapter 10: The1Er')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143168_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012638", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "-0.9, 1", "output": "-0.9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012639", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4933", "output": "{1, 4933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012640", "code": "def find_pairs(arr, target_sum):\n    arr.sort()\n    left = 0\n    right = len(arr) - 1\n    count = 0\n    while left < right:\n        cur_sum = arr[left] + arr[right]\n        if cur_sum == target_sum:\n            print(target_sum, arr[left], arr[right])\n            count += 1\n            left += 1\n        elif cur_sum < target_sum:\n            left += 1\n        else:\n            right -= 1\n    print(\"Total pairs found:\", count)\n    return count\n", "entry_point": "find_pairs", "input": "[1, 2, 3, 7, 8, 9], 10", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73088_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012641", "code": "from typing import List\ndef calculate_sum_max_odd(input_list: List[int]) -> int:\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd if sum_even > 0 else 0\n", "entry_point": "calculate_sum_max_odd", "input": "[2, 4, 8, 7]", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134591_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012642", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[5, 5, 2, -1, -1, 6, 4, 0, 0]", "output": "[5, 2, -1, 6, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4153", "output": "{1, 4153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012644", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4403", "output": "{1, 259, 37, 7, 17, 4403, 629, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012645", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[5, 8, 8]", "output": "(8, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012646", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[1, 2, 3, 4, 5, 6, 2]", "output": "[2, 4, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012647", "code": "import re\ndef clean_query(query: str) -> dict:\n    cleaned_query = query.upper()\n    if re.match(r'^AS\\d+$', cleaned_query):\n        return {\"cleanedValue\": cleaned_query, \"category\": \"asn\"}\n    elif cleaned_query.isalnum():\n        return {\"cleanedValue\": cleaned_query, \"category\": \"as-set\"}\n    else:\n        return {\"error\": \"Invalid query. A valid prefix is required.\"}\n", "entry_point": "clean_query", "input": "'ffobar'", "output": "{'cleanedValue': 'FFOBAR', 'category': 'as-set'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106273_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012648", "code": "def schedule_jobs(jobs):\n    # Sort the jobs based on their durations in ascending order\n    sorted_jobs = sorted(jobs, key=lambda x: x[1])\n    # Extract and return the job types in the sorted order\n    sorted_job_types = [job[0] for job in sorted_jobs]\n    return sorted_job_types\n", "entry_point": "schedule_jobs", "input": "[('JobA', 2), ('JobB', 3), ('JobC', 1)]", "output": "['JobC', 'JobA', 'JobB']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16397_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012649", "code": "def extract_digits(str_input):\n    final_str = \"\"\n    for char in str_input:\n        if char.isdigit():  # Check if the character is a digit\n            final_str += char\n    return final_str\n", "entry_point": "extract_digits", "input": "'abcdef'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132906_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012650", "code": "def process_numbers(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n        elif num % 5 == 0:\n            total += 2 * num\n        else:\n            total -= num\n    return total\n", "entry_point": "process_numbers", "input": "[2, 5, -5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25805_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "889", "output": "{1, 127, 889, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012652", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/uoutpu.txt'", "output": "'/tmp/ml4pl/data/uoutpu.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012653", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'man', 0", "output": "[48, 0, 52]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012654", "code": "def generate_download_urls(num_actors, data_types):\n    BASE_DOWNLOAD_URL = 'https://zenodo.org/record/1188976/files/{0}?download=1'\n    download_urls = []\n    for actor_id in range(1, num_actors + 1):\n        for data_type in data_types:\n            download_url = BASE_DOWNLOAD_URL.format(f\"{actor_id:02d}_{data_type}\")\n            download_urls.append(download_url)\n    return download_urls\n", "entry_point": "generate_download_urls", "input": "0, ['data1', 'data2']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45115_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012655", "code": "def get_time_series_names(time_series_list):\n    time_series_names = set()\n    for item in time_series_list:\n        name_parts = item.split('@')\n        time_series_name = name_parts[0]\n        time_series_names.add(time_series_name)\n    return time_series_names\n", "entry_point": "get_time_series_names", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98062_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012656", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'-8someText'", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012657", "code": "VOCAB_FILES_NAMES = {\"vocab_file\": \"spm.model\", \"tokenizer_file\": \"tokenizer.json\"}\nPRETRAINED_VOCAB_FILES_MAP = {\n    \"vocab_file\": {\n        \"microsoft/deberta-v2-xlarge\": \"https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/spm.model\",\n        \"microsoft/deberta-v2-xxlarge\": \"https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/spm.model\",\n        \"microsoft/deberta-v2-xlarge-mnli\": \"https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/spm.model\",\n        \"microsoft/deberta-v2-xxlarge-mnli\": \"https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/spm.model\",\n    }\n}\nPRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {\n    \"microsoft/deberta-v2-xlarge\": 512,\n    \"microsoft/deberta-v2-xxlarge\": 512,\n    \"microsoft/deberta-v2-xlarge-mnli\": 512,\n    \"microsoft/deberta-v2-xxlarge-mnli\": 512,\n}\ndef get_model_info(model_name):\n    if model_name in PRETRAINED_VOCAB_FILES_MAP[\"vocab_file\"]:\n        vocab_file_name = VOCAB_FILES_NAMES[\"vocab_file\"]\n        positional_embeddings_size = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES.get(model_name, None)\n        return (vocab_file_name, positional_embeddings_size) if positional_embeddings_size is not None else \"Model not found\"\n    else:\n        return \"Model not found\"\n", "entry_point": "get_model_info", "input": "'unknown/model'", "output": "'Model not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64705_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012658", "code": "def calculate_moving_average(numbers, window_size):\n    moving_averages = []\n    for i in range(len(numbers) - window_size + 1):\n        window_sum = sum(numbers[i:i+window_size])\n        window_avg = window_sum / window_size\n        moving_averages.append(window_avg)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[53.42857142857143], 1", "output": "[53.42857142857143]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85249_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012659", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3501", "output": "{1, 3, 389, 9, 3501, 1167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012660", "code": "# Define the positions and their corresponding bitmask values\npositions = {\n    'catcher': 1,\n    'first_base': 2,\n    'second_base': 4,\n    'third_base': 8,\n    'short_stop': 16,\n    'outfield': 32,\n    'left_field': 64,\n    'center_field': 128,\n    'right_field': 256,\n    'designated_hitter': 512,\n    'pitcher': 1024,\n    'starting_pitcher': 2048,\n    'relief_pitcher': 4096\n}\ndef get_eligible_positions(player_mask):\n    eligible_positions = []\n    for position, mask in positions.items():\n        if player_mask & mask:\n            eligible_positions.append(position)\n    return eligible_positions\n", "entry_point": "get_eligible_positions", "input": "32", "output": "['outfield']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51303_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012661", "code": "def count_vowels(input_string):\n    # Initialize a variable to store the count of vowels\n    vowel_count = 0\n    # Define a set of lowercase vowels\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    # Iterate through each character in the input string\n    for char in input_string.lower():  # Convert to lowercase for case-insensitivity\n        # Check if the lowercase character is a vowel\n        if char in vowels:\n            vowel_count += 1\n    return vowel_count\n", "entry_point": "count_vowels", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140215_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012662", "code": "def count_differing_characters(revision1, revision2):\n    if len(revision1) != len(revision2):\n        return -1  # Return -1 if the lengths of the revision numbers are not equal\n    differing_count = 0\n    for char1, char2 in zip(revision1, revision2):\n        if char1 != char2:\n            differing_count += 1\n    return differing_count\n", "entry_point": "count_differing_characters", "input": "'abcde', 'abc'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76189_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6414", "output": "{1, 2, 3, 6, 3207, 1069, 6414, 2138}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6413", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012664", "code": "def calculate_average_color(colors):\n    total_red = 0\n    total_green = 0\n    total_blue = 0\n    for color in colors:\n        total_red += color[0]\n        total_green += color[1]\n        total_blue += color[2]\n    avg_red = round(total_red / len(colors))\n    avg_green = round(total_green / len(colors))\n    avg_blue = round(total_blue / len(colors))\n    return (avg_red, avg_green, avg_blue)\n", "entry_point": "calculate_average_color", "input": "[(85, 85, 85), (85, 85, 85), (85, 85, 85)]", "output": "(85, 85, 85)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79256_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012665", "code": "from typing import Dict\nunits: Dict[str, int] = {\n    \"cryptodoge\": 10 ** 6,\n    \"mojo\": 1,\n    \"colouredcoin\": 10 ** 3,\n}\ndef convert_mojos_to_unit(amount: int, target_unit: str) -> float:\n    if target_unit in units:\n        conversion_factor = units[target_unit]\n        converted_amount = amount / conversion_factor\n        return converted_amount\n    else:\n        return f\"Conversion to {target_unit} is not supported.\"\n", "entry_point": "convert_mojos_to_unit", "input": "100, 'colouredc'", "output": "'Conversion to colouredc is not supported.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24392_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012666", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    new_list = []\n    for i in range(len(lst) - 1):\n        new_list.append(lst[i] + lst[i + 1])\n    new_list.append(lst[-1] + lst[0])\n    return new_list\n", "entry_point": "process_list", "input": "[3, 2, 2, 1, 2, 2, 2, 4, 3]", "output": "[5, 4, 3, 3, 4, 4, 6, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64952_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012667", "code": "def organize_states(state_abbreviations):\n    rows = []\n    row_size = 5  # Number of state abbreviations per row\n    current_row = []\n    for state in state_abbreviations:\n        current_row.append(state)\n        if len(current_row) == row_size:\n            rows.append(current_row)\n            current_row = []\n    if current_row:  # Add any remaining states to the last row\n        rows.append(current_row)\n    return rows\n", "entry_point": "organize_states", "input": "['BAAP', 'SC', 'MMM', 'BAP', 'BSC']", "output": "[['BAAP', 'SC', 'MMM', 'BAP', 'BSC']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58157_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012668", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "30, 50, '+'", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012669", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'a'", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012670", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'C'", "output": "['C']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012671", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 11, 12, 13, 14, 15, 5, 25, 30]", "output": "(6, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012672", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_num = num + 2\n        else:\n            processed_num = max(num - 1, 0)  # Subtract 1 from odd numbers, ensure non-negativity\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_integers", "input": "[1, 2, 8, -1, 3, 2, -1]", "output": "[0, 4, 10, 0, 2, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98159_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012673", "code": "def find_min_synaptic_conductance_time(synaptic_conductance_values):\n    min_value = synaptic_conductance_values[0]\n    min_time = 1\n    for i in range(1, len(synaptic_conductance_values)):\n        if synaptic_conductance_values[i] < min_value:\n            min_value = synaptic_conductance_values[i]\n            min_time = i + 1  # Time points start from 1\n    return min_time\n", "entry_point": "find_min_synaptic_conductance_time", "input": "[5, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31704_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012674", "code": "import re\ndef word_frequency(input_list):\n    word_freq = {}\n    for word in input_list:\n        word = re.sub(r'[^\\w\\s]', '', word).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "['oranbananage']", "output": "{'oranbananage': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29735_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012675", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7303", "output": "{1, 67, 109, 7303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012676", "code": "def format_package_details(package_setup):\n    formatted_output = \"\"\n    for key, value in package_setup.items():\n        formatted_output += f\"{key.capitalize()}: {value}\\n\"\n    return formatted_output\n", "entry_point": "format_package_details", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120417_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012677", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "8, 12", "output": "(24, 20, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012678", "code": "def max_subarray_sum(nums):\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, num + current_sum)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 20, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103842_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012679", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 == 0:\n            return \"Error: Division by zero\"\n        return num1 / num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'*', 14, 1", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107177_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012680", "code": "def extract_db_info(settings_dict):\n    db_config = settings_dict.get('DATABASES', {}).get('default', {})\n    formatted_info = \"Database Configuration:\\n\"\n    for key, value in db_config.items():\n        formatted_info += f\"{key.upper()}: {value}\\n\"\n    return formatted_info\n", "entry_point": "extract_db_info", "input": "{}", "output": "'Database Configuration:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4742", "output": "{1, 2, 2371, 4742}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4463", "output": "{1, 4463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012683", "code": "def calculate_total_epochs(batch_size, last_epoch, min_unit):\n    if last_epoch < min_unit:\n        return min_unit\n    else:\n        return last_epoch + min_unit\n", "entry_point": "calculate_total_epochs", "input": "32, 7, 2", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134381_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012684", "code": "from functools import reduce\nfrom operator import xor\ndef find_missing_integer(xs):\n    n = len(xs)\n    xor_xs = reduce(xor, xs)\n    xor_full = reduce(xor, range(1, n + 2))\n    return xor_xs ^ xor_full\n", "entry_point": "find_missing_integer", "input": "[1, 2, 3, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77106_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012685", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{1: 2}, 8", "output": "'[0,2,0,0,0,0,0,0,0]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012686", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'Hellol!'", "output": "'Hellol!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012687", "code": "def extract_y_coordinates(coordinates):\n    y_coordinates = []  # Initialize an empty list to store y-coordinates\n    for coord in coordinates:\n        y_coordinates.append(coord[1])  # Extract y-coordinate (index 1) and append to the list\n    return y_coordinates\n", "entry_point": "extract_y_coordinates", "input": "[(1, 2), (3, 4), (5, 6)]", "output": "[2, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19900_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6439", "output": "{1, 137, 47, 6439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012689", "code": "def find_highest_score_index(scores):\n    highest_score = float('-inf')\n    highest_score_index = -1\n    for i in range(len(scores)):\n        if scores[i] > highest_score:\n            highest_score = scores[i]\n            highest_score_index = i\n        elif scores[i] == highest_score and i < highest_score_index:\n            highest_score_index = i\n    return highest_score_index\n", "entry_point": "find_highest_score_index", "input": "[10, 20, 30, 40, 40]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57664_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012690", "code": "def sum_of_squares_even(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[6, 6]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15719_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012691", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012692", "code": "def longest_non_decreasing_substring(s):\n    substring = s[0]\n    length = 1\n    bestsubstring = substring\n    bestlength = length\n    for num in range(len(s)-1):\n        if s[num] <= s[num+1]:\n            substring += s[num+1]\n            length += 1\n            if length > bestlength:\n                bestsubstring = substring\n                bestlength = length\n        else:\n            substring = s[num+1]\n            length = 1\n    return bestsubstring\n", "entry_point": "longest_non_decreasing_substring", "input": "'abcde'", "output": "'abcde'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21049_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012693", "code": "def count_increases(depths):\n    increase_count = 0\n    for i in range(len(depths) - 3):\n        sum1 = sum(depths[i : i + 3])\n        sum2 = sum(depths[i + 1 : i + 4])\n        if sum1 < sum2:\n            increase_count += 1\n    return increase_count\n", "entry_point": "count_increases", "input": "[1, 2, 3, 4, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99474_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012694", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coeff in coefficients[::-1]:\n        result = result * x + coeff\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[1, -8], 1", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110926_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012695", "code": "def extract_env_variables(env_vars):\n    extracted_vars = {}\n    for env_var in env_vars:\n        var_name, var_value = env_var.split('=')\n        extracted_vars[var_name] = var_value\n    return extracted_vars\n", "entry_point": "extract_env_variables", "input": "['PATH=/usr/local/bin']", "output": "{'PATH': '/usr/local/bin'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84505_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012696", "code": "def distinct_substrings(s, k):\n    if len(s) < k:\n        return False\n    substrings = set()\n    tmp = 0\n    for i in range(len(s)):\n        tmp = tmp * 2 + int(s[i])\n        if i >= k:\n            tmp -= int(s[i - k]) << k\n        if i >= k - 1:\n            substrings.add(tmp)\n    return len(substrings) == (1 << k)\n", "entry_point": "distinct_substrings", "input": "'0', 2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25437_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012697", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'tthiss'", "output": "['tthiss']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1353", "output": "{1, 33, 3, 451, 1353, 41, 11, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012699", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[5.4, 5.4]", "output": "5.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012700", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'ggame_rotationvecto'", "output": "'Value of ggame_rotationvecto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012701", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 9, 3, 8, 2, 1, 1, 2]", "output": "[0, 10, 5, 11, 6, 6, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012702", "code": "def count_consecutive_i(input_str):\n    max_consecutive_i = 0\n    current_consecutive_i = 0\n    for char in input_str:\n        if char == 'i':\n            current_consecutive_i += 1\n            max_consecutive_i = max(max_consecutive_i, current_consecutive_i)\n        else:\n            current_consecutive_i = 0\n    return max_consecutive_i\n", "entry_point": "count_consecutive_i", "input": "'iiiiiiiiii'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6207_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012703", "code": "def extract_integer_parts(numbers):\n    integer_parts = []\n    for num in numbers:\n        num_str = str(num)\n        integer_part = int(num_str.split('.')[0])\n        integer_parts.append(integer_part)\n    return integer_parts\n", "entry_point": "extract_integer_parts", "input": "[3.5, 7.1, 7.8, 4.2, 7.5, 4.9, 7.6]", "output": "[3, 7, 7, 4, 7, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64120_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012704", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'ET'", "output": "('ET', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4201", "output": "{1, 4201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4200", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012706", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[6, -4, 7, 4, 1, 3, 5, 3]", "output": "[2, 3, 11, 5, 4, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012707", "code": "def access_control_system(message_content, user_id):\n    authorized_users = [123, 456, 789]  # Example authorized user IDs\n    if message_content.startswith(\"!info\"):\n        return \"User is requesting information.\"\n    if message_content.startswith(\"!shutdown\") and user_id in authorized_users:\n        return \"Shutdown command is being executed.\"\n    return \"Unauthorized action or invalid command.\"\n", "entry_point": "access_control_system", "input": "'!shutdown', 123", "output": "'Shutdown command is being executed.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129653_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012708", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[1, 4, 3, 2, 1, 3, 3, 4]", "output": "[1, 4, 3, 2, 1, 3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012709", "code": "def calculate_average_score(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score, 2)  # Round the average score to 2 decimal places\n", "entry_point": "calculate_average_score", "input": "[65.0, 72.0, 72.0, 72.0, 80.0]", "output": "72.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140998_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012710", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff57\uff4f'", "output": "'wo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012711", "code": "def calculate_total_downtime_duration(downtimes):\n    total_duration = 0\n    for downtime in downtimes:\n        total_duration += downtime['start']\n    return total_duration\n", "entry_point": "calculate_total_downtime_duration", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20590_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6973", "output": "{1, 19, 6973, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012713", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'h/hoot/a', '212342123455'", "output": "'h/hoot/a/212342123455'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012714", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[3, 3, 3, 3, 3, 2, 2, 2, 2, 0, 0, 0, 1], 4", "output": "[3, 2, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012715", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    a, b = 0, 1\n    for _ in range(N):\n        fib_sum += a\n        a, b = b, a + b\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92640_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012716", "code": "TOKEN_TYPE = ((0, 'PUBLIC_KEY'), (1, 'PRIVATE_KEY'), (2, 'AUTHENTICATION TOKEN'), (4, 'OTHER'))\ndef get_token_type_verbose(token_type: int) -> str:\n    token_type_mapping = dict(TOKEN_TYPE)\n    return token_type_mapping.get(token_type, 'Unknown Token Type')\n", "entry_point": "get_token_type_verbose", "input": "4", "output": "'OTHER'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149682_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1489", "output": "{1, 1489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012718", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0.0799999999999947, 1.5, 2.5", "output": "1.5799999999999947", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012719", "code": "def calculate_team_scores(team_participants):\n    team_scores = {}\n    for participant in team_participants:\n        team_name = participant[\"team\"]\n        score = participant[\"score\"]\n        if team_name in team_scores:\n            team_scores[team_name] += score\n        else:\n            team_scores[team_name] = score\n    return team_scores\n", "entry_point": "calculate_team_scores", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112532_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012720", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'21 Dec 1842'", "output": "'Dec 21, 1842'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012721", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[10, 16]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012722", "code": "def extract_file_extension(file_path):\n    # Find the last occurrence of the dot ('.') in the file path\n    dot_index = file_path.rfind('.')\n    # Check if a dot was found and the dot is not at the end of the file path\n    if dot_index != -1 and dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character after the last dot\n        return file_path[dot_index + 1:]\n    # Return an empty string if no extension found\n    return \"\"\n", "entry_point": "extract_file_extension", "input": "'file.csv'", "output": "'csv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73936_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1827", "output": "{1, 609, 3, 1827, 261, 7, 9, 203, 21, 87, 29, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012724", "code": "def generate_auth_token(github_repo, git_tag):\n    # Extract the first three characters of the GitHub repository name\n    repo_prefix = github_repo[:3]\n    # Extract the last three characters of the Git tag\n    tag_suffix = git_tag[-3:]\n    # Concatenate the extracted strings to form the authorization token\n    auth_token = repo_prefix + tag_suffix\n    return auth_token\n", "entry_point": "generate_auth_token", "input": "'mygithub', 'release_vvv'", "output": "'mygvvv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37072_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012725", "code": "def sum_of_digit_squares(n: int) -> int:\n    total_sum = 0\n    for digit in str(n):\n        total_sum += int(digit) ** 2\n    return total_sum\n", "entry_point": "sum_of_digit_squares", "input": "321", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47266_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012726", "code": "def format_color_names(input_string):\n    predefined_words = [\"is\", \"a\", \"nice\"]\n    words = input_string.split()\n    formatted_words = []\n    for word in words:\n        if word.lower() not in predefined_words:\n            word = word.capitalize()\n        formatted_words.append(word)\n    formatted_string = ' '.join(formatted_words)\n    return formatted_string\n", "entry_point": "format_color_names", "input": "'cmcyyc'", "output": "'Cmcyyc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25204_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012727", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No meaningful average if less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 74, 75, 77, 80]", "output": "75.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57154_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012728", "code": "# Constants\n_ACCELERATION_VALUE = 1\n_INDICATOR_SIZE = 8\n_ANIMATION_SEQUENCE = ['-', '\\\\', '|', '/']\ndef _get_busy_animation_part(index):\n    return _ANIMATION_SEQUENCE[index % len(_ANIMATION_SEQUENCE)]\n", "entry_point": "_get_busy_animation_part", "input": "1", "output": "'\\\\'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97851_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012729", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "13, 6", "output": "1716.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012730", "code": "def calculate_edit_distance_median(edit_distances):\n    # Filter out edit distances equal to 0\n    filtered_distances = [dist for dist in edit_distances if dist != 0]\n    # Sort the filtered list\n    sorted_distances = sorted(filtered_distances)\n    length = len(sorted_distances)\n    if length == 0:\n        return 0\n    # Calculate the median\n    if length % 2 == 1:\n        return sorted_distances[length // 2]\n    else:\n        mid = length // 2\n        return (sorted_distances[mid - 1] + sorted_distances[mid]) / 2\n", "entry_point": "calculate_edit_distance_median", "input": "[4, 1, 3, 5, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8147_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012731", "code": "from typing import List\ndef count_visible_buildings(buildings: List[int]) -> int:\n    visible_count = 0\n    max_height = 0\n    for height in buildings[::-1]:\n        if height > max_height:\n            visible_count += 1\n            max_height = height\n    return visible_count\n", "entry_point": "count_visible_buildings", "input": "[5, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17783_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012732", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[6, 3, 10, 1, 5, 8, 5, 5]", "output": "[3, 5, 1, 6, 4, 2, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012733", "code": "def additional_packages_required(major, minor):\n    required_packages = []\n    if major < 3 or minor < 4:\n        required_packages.append(\"enum34\")\n    return required_packages\n", "entry_point": "additional_packages_required", "input": "3, 4", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134863_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012734", "code": "def get_calibration_file_extension(cal_mode):\n    extensions = {\n        0: \".jpg\",\n        1: \".yaml\",\n        2: \".xml\"\n    }\n    return extensions.get(cal_mode, \"Unknown\")\n", "entry_point": "get_calibration_file_extension", "input": "3", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65114_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012735", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[3, 1, 0, 2, 2, 2, 2, 4, 4]", "output": "[3, 1, 0, 2, 2, 2, 2, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012736", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "9.1, 10.0", "output": "45.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012737", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "94", "output": "'94'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012738", "code": "from typing import List, Dict\ndef total_money_in_wallet(wallet: List[int], conversion_rates: Dict[str, float]) -> float:\n    total_money = 0.0\n    for currency_value in wallet:\n        total_money += currency_value / conversion_rates.get('USD', 1.0)\n    return round(total_money, 2)\n", "entry_point": "total_money_in_wallet", "input": "[9700], {'USD': 100.0}", "output": "97.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104442_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8989", "output": "{89, 1, 101, 8989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012740", "code": "def find_earliest_bus_departure(t, busses):\n    for i in range(t, t + 1000):  # Check timestamps from t to t+1000\n        for bus in busses:\n            if i % bus == 0:  # Check if bus departs at current timestamp\n                return i\n", "entry_point": "find_earliest_bus_departure", "input": "943, [59, 118]", "output": "944", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75100_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012741", "code": "def generate_place_names(n):\n    place_names = []\n    for i in range(1, n+1):\n        if i % 2 == 0 and i % 3 == 0:\n            place_names.append(\"Metropolis\")\n        elif i % 2 == 0:\n            place_names.append(\"City\")\n        elif i % 3 == 0:\n            place_names.append(\"Town\")\n        else:\n            place_names.append(str(i))\n    return place_names\n", "entry_point": "generate_place_names", "input": "2", "output": "['1', 'City']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143516_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012742", "code": "import math\ndef calculate_expression(x):\n    sqrt_x = math.sqrt(x)\n    log_x = math.log10(x)\n    result = sqrt_x + log_x\n    return result\n", "entry_point": "calculate_expression", "input": "3.0", "output": "2.20917206228854", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127737_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012743", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[1, 3, 2, 0, 0, 0]", "output": "[1, 3, 2, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "732", "output": "{1, 2, 3, 4, 6, 12, 366, 244, 183, 122, 732, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt731", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2245", "output": "{1, 5, 449, 2245}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012746", "code": "def simulate_train(commands):\n    position = 0\n    for command in commands:\n        if command == 'F' and position < 10:\n            position += 1\n        elif command == 'B' and position > -10:\n            position -= 1\n    return position\n", "entry_point": "simulate_train", "input": "['F', 'F']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105746_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012747", "code": "from datetime import datetime\ndef calculate_date_difference(date1, date2):\n    # Parse the input date strings into datetime objects\n    date1_obj = datetime.strptime(date1, '%Y-%m-%d')\n    date2_obj = datetime.strptime(date2, '%Y-%m-%d')\n    # Calculate the absolute difference in days between the two dates\n    date_difference = abs((date1_obj - date2_obj).days)\n    return date_difference\n", "entry_point": "calculate_date_difference", "input": "'2023-10-01', '2023-10-06'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86815_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012748", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'van,MMa'", "output": "'van,MMa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012749", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'iim'", "output": "('iim', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012750", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "[], 0", "output": "'{}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012751", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5722", "output": "{1, 5722, 2, 2861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5721", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8909", "output": "{1, 59, 8909, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012753", "code": "def count_test_results(results):\n    pass_count = sum(1 for result in results if result)\n    fail_count = sum(1 for result in results if not result)\n    return (pass_count, fail_count)\n", "entry_point": "count_test_results", "input": "[True, True, False, False, False, False, False]", "output": "(2, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7187_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012754", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7823", "output": "{1, 7823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012755", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3694", "output": "{1, 2, 3694, 1847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3693", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012756", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'3 5 +'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012757", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "2, b=4", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7269", "output": "{1, 3, 7269, 2423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012759", "code": "from typing import List, Tuple\ndef process_numbers(numbers: List[int]) -> Tuple[int, int]:\n    count = 0\n    total_sum = 0\n    for num in numbers:\n        count += 1\n        total_sum += num\n        if num == 999:\n            break\n    return count - 1, total_sum - 999  # Adjusting count and sum for excluding the terminating 999\n", "entry_point": "process_numbers", "input": "[999]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24887_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012760", "code": "from typing import List\ndef max_loot_circle(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob_range(start, end):\n        max_loot = [0, nums[start]]\n        for i in range(start+1, end+1):\n            max_loot.append(max(max_loot[-1], max_loot[-2] + nums[i]))\n        return max_loot[-1]\n    return max(rob_range(0, len(nums)-2), rob_range(1, len(nums)-1))\n", "entry_point": "max_loot_circle", "input": "[4, 1, 5, 0]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119426_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012761", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'jjavrg   u BerYin', 'Berlin'", "output": "'jjavrg   u BerYin Berlin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012762", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[4, 7]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt25", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012763", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'10.2.4'", "output": "'10.2.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012764", "code": "def count_jolt_differences(adapters):\n    adapters.sort()\n    adapters = [0] + adapters + [adapters[-1] + 3]  # Add the charging outlet and device's built-in adapter\n    one_jolt_diff = 0\n    three_jolt_diff = 0\n    for i in range(1, len(adapters)):\n        diff = adapters[i] - adapters[i - 1]\n        if diff == 1:\n            one_jolt_diff += 1\n        elif diff == 3:\n            three_jolt_diff += 1\n    return one_jolt_diff * three_jolt_diff\n", "entry_point": "count_jolt_differences", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144973_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012765", "code": "import string\ndef count_word_frequency(file_content):\n    word_freq = {}\n    text = file_content.lower()\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'fieeexx'", "output": "{'fieeexx': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3322_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012766", "code": "def count_unique_integers(input_list):\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108788_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012767", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'python', 'ttur Yk'", "output": "'python ttur Yk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012768", "code": "def generate_response(message):\n    channel_id = 'CNCRFR7KP'\n    team_id = 'TE4VDPM2L'\n    user_id = 'UE6P69HFH'\n    response_url = \"no\"\n    channel_name = \"local\"\n    if \"lambda\" in message:\n        return \"lambda_function\"\n    if channel_id in message and team_id in message and user_id in message:\n        return \"channel_team_user\"\n    if response_url == \"no\" and \"no\" in message:\n        return \"no_response\"\n    if channel_name == \"local\" and \"local\" in message:\n        return \"local_channel\"\n    return \"No matching rule found.\"\n", "entry_point": "generate_response", "input": "'Hello world!'", "output": "'No matching rule found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78868_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012769", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:ocC:/Users/Docum'", "output": "('C:ocC:/Users', 'Docum')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012770", "code": "import math\ndef min_sum_pair(n):\n    dist = n\n    for i in range(1, math.floor(math.sqrt(n)) + 1):\n        if n % i == 0:\n            j = n // i\n            dist = min(dist, i + j - 2)\n    return dist\n", "entry_point": "min_sum_pair", "input": "10", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134268_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012771", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "74898, 1", "output": "74898", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt23", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012772", "code": "def find_unique_number(nums):\n    unique_num = 0\n    for num in nums:\n        unique_num ^= num\n    return unique_num\n", "entry_point": "find_unique_number", "input": "[5, 1, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126841_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012773", "code": "def organize_dependencies(dependencies):\n    dependency_dict = {}\n    for module, dependency in dependencies:\n        if module in dependency_dict:\n            dependency_dict[module].append(dependency)\n        else:\n            dependency_dict[module] = [dependency]\n    return dependency_dict\n", "entry_point": "organize_dependencies", "input": "[('foo', 'bar')]", "output": "{'foo': ['bar']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63465_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012774", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'ag'", "output": "'ag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012775", "code": "def getTotalPage(m, n):\n    page, remaining = divmod(m, n)\n    if remaining != 0:\n        return page + 1\n    else:\n        return page\n", "entry_point": "getTotalPage", "input": "10, 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50511_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012776", "code": "from typing import List\ndef generate_version_number(scene_files: List[str]) -> str:\n    highest_version = 0\n    for file in scene_files:\n        if file.startswith(\"file_v\"):\n            version = int(file.split(\"_v\")[1])\n            highest_version = max(highest_version, version)\n    new_version = highest_version + 1 if highest_version > 0 else 1\n    return f\"v{new_version}\"\n", "entry_point": "generate_version_number", "input": "[]", "output": "'v1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11750_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012777", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70.0, 80.0, 80.2, 80.4, 90.0]", "output": "80.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5655_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012778", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[1], 10, 4", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012779", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2381", "output": "{1, 2381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012780", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2037", "output": "{1, 97, 3, 291, 7, 679, 2037, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2036", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012781", "code": "def validate_json_response(response):\n    # Check if response is a dictionary\n    if not isinstance(response, dict):\n        return False\n    expected_keys = [\"labels\", \"probabilities\"]\n    # Check if all expected keys are present and values are not None\n    for key in expected_keys:\n        if key not in response or response[key] is None:\n            return False\n    return True\n", "entry_point": "validate_json_response", "input": "['wrong', 'type']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115200_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012782", "code": "def calculate_event_percentage(event_occurrences, event_index):\n    total_count = sum(event_occurrences)\n    if event_index < 0 or event_index >= len(event_occurrences):\n        return \"Invalid event index\"\n    event_count = event_occurrences[event_index]\n    percentage = (event_count / total_count) * 100\n    return percentage\n", "entry_point": "calculate_event_percentage", "input": "[20, 80], 0", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23800_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012783", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "597", "output": "{1, 3, 597, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012784", "code": "# Constants for data types\nB3_UTF8 = \"UTF8\"\nB3_BOOL = \"BOOL\"\nB3_SVARINT = \"SVARINT\"\nB3_COMPOSITE_DICT = \"COMPOSITE_DICT\"\nB3_COMPOSITE_LIST = \"COMPOSITE_LIST\"\nB3_FLOAT64 = \"FLOAT64\"\ndef detect_data_type(obj):\n    if isinstance(obj, str):\n        return B3_UTF8\n    if obj is True or obj is False:\n        return B3_BOOL\n    if isinstance(obj, int):\n        return B3_SVARINT\n    if isinstance(obj, dict):\n        return B3_COMPOSITE_DICT\n    if isinstance(obj, list):\n        return B3_COMPOSITE_LIST\n    if isinstance(obj, float):\n        return B3_FLOAT64\n    if PY2 and isinstance(obj, long):\n        return B3_SVARINT\n    return \"Unknown\"\n", "entry_point": "detect_data_type", "input": "'hello'", "output": "'UTF8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49151_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6457", "output": "{1, 587, 11, 6457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012786", "code": "def convert_to_indices(input_string):\n    alphabet = \"abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\\\"/\\\\|_@#$%^&*~`+-=<>()[]{} \"\n    dictionary = {char: idx for idx, char in enumerate(alphabet, start=1)}\n    indices_list = [dictionary[char] for char in input_string if char in dictionary]\n    return indices_list\n", "entry_point": "convert_to_indices", "input": "'helllo'", "output": "[8, 5, 12, 12, 12, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126715_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012787", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'.1.3'", "output": "'.1.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012788", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[1, 2, 3, 4, 5, 9, 4, 2, 6, 7, 6], 6", "output": "[9, 4, 2, 6, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9949", "output": "{1, 9949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012790", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6767", "output": "{1, 67, 101, 6767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7987", "output": "{1, 163, 7, 49, 7987, 1141}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012792", "code": "def count_hex_matches(input_string):\n    UCI_VERSION = '5964e2fc6156c5f720eed7faecf609c3c6245e3d'\n    UCI_VERSION_lower = UCI_VERSION.lower()\n    input_string_lower = input_string.lower()\n    count = 0\n    for char in input_string_lower:\n        if char in UCI_VERSION_lower:\n            count += 1\n    return count\n", "entry_point": "count_hex_matches", "input": "'59629'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86391_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012793", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2922", "output": "{1, 2, 3, 6, 487, 2922, 974, 1461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2921", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012794", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[5, 5, 7, 1]", "output": "175", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012795", "code": "def sum_fibonacci(N):\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    a, b = 0, 1\n    fib_sum = a + b\n    for _ in range(2, N):\n        a, b = b, a + b\n        fib_sum += b\n    return fib_sum\n", "entry_point": "sum_fibonacci", "input": "6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126922_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012796", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'Woorl'", "output": "b'Woorl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012797", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'A', 'ABCD'", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012798", "code": "import re\nfrom collections import Counter\ndef find_phone(text):\n    return re.findall(r'\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b', text)\n", "entry_point": "find_phone", "input": "'Call me at 555-123-4567'", "output": "['555-123-4567']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73946_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012799", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[30, 33, 33, 33, 40]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6494", "output": "{1, 2, 382, 34, 3247, 17, 6494, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012801", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'salMple'", "output": "{'salmple': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012802", "code": "from typing import List, Dict\ndef count_postal_frequency(postal_codes: List[str]) -> Dict[str, int]:\n    frequency_dict = {}\n    for code in postal_codes:\n        code = code.strip().lower()  # Remove leading/trailing whitespaces and convert to lowercase\n        frequency_dict[code] = frequency_dict.get(code, 0) + 1  # Update frequency\n    return frequency_dict\n", "entry_point": "count_postal_frequency", "input": "[' x1y2z ', 'X1Y2Z3', ' x1y21z3 ']", "output": "{'x1y2z': 1, 'x1y2z3': 1, 'x1y21z3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39976_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012803", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 5", "output": "16807", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt38", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012804", "code": "def split_input_target(chunk):\n    input_text = chunk[:-1]\n    target_text = chunk[1:]\n    return input_text, target_text\n", "entry_point": "split_input_target", "input": "'lo'", "output": "('l', 'o')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41781_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012805", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'fifiles/archita.cs', None", "output": "('fifiles/archita.cs', 'fifiles/archita.cs')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012806", "code": "def normalize_skill_counts(job_skill_count, max_count):\n    normalized_counts = {}\n    for skill, count in job_skill_count.items():\n        normalized_count = (count / max_count) * 100\n        normalized_counts[skill] = normalized_count\n    return normalized_counts\n", "entry_point": "normalize_skill_counts", "input": "{}, 10", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100223_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012807", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "4", "output": "'https://www.kaiheila.cn/api/v4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012808", "code": "from typing import List, Dict\ndef analyze_test_methods(test_methods: List[str]) -> Dict[str, int]:\n    result = {}\n    for method_name in test_methods:\n        underscore_count = method_name.count('_')\n        result[method_name] = underscore_count\n    return result\n", "entry_point": "analyze_test_methods", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13868_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012809", "code": "from typing import List\ndef latest_version(versions: List[str]) -> str:\n    latest_version = versions[0]\n    for version in versions[1:]:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['1.0.1', '2.0.0', '2.4.9', '2.5.7', '2.5.8']", "output": "'2.5.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138257_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2570", "output": "{1, 2, 514, 257, 5, 1285, 2570, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2569", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2606", "output": "{1, 2, 2606, 1303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2605", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012812", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "[10, 10, 20, 20]", "output": "[15.0, 15.0, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012813", "code": "def convert_to_legacy_xml(v3_response):\n    command = v3_response.get('command', '')\n    termtype = v3_response.get('termtype', '')\n    pbx_name = v3_response.get('pbx_name', '')\n    legacy_xml = f'<command cmd=\"{command}\" cmdType=\"{termtype}\" pbxName=\"{pbx_name}\"/>'\n    return legacy_xml\n", "entry_point": "convert_to_legacy_xml", "input": "{}", "output": "'<command cmd=\"\" cmdType=\"\" pbxName=\"\"/>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85291_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012814", "code": "def construct_graph(degrees):\n    total_degrees = sum(degrees)\n    if total_degrees % 2 != 0:\n        return []\n    n = len(degrees)\n    degrees = sorted(enumerate(degrees), key=lambda x: x[1], reverse=True)\n    adj_matrix = [[0] * n for _ in range(n)]\n    for i in range(n):\n        node, degree = degrees[i]\n        for j in range(i + 1, i + 1 + degree):\n            if j >= n:\n                return []\n            adj_matrix[node][degrees[j][0]] = 1\n            adj_matrix[degrees[j][0]][node] = 1\n            degrees[j] = (degrees[j][0], degrees[j][1] - 1)\n    return adj_matrix\n", "entry_point": "construct_graph", "input": "[1, 2, 2]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56920_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012815", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1,2,3,4,5'", "output": "(1, 2, 3, 4, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012816", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'ie_ie_without_tagig'", "output": "('ie_ie_without_tagig', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012817", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5030", "output": "{1, 2, 5, 5030, 10, 1006, 2515, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5029", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012818", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[5, 4, 6, 2, 2, 9, 4, 5]", "output": "[2, 2, 4, 4, 5, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012819", "code": "from typing import List\ndef sum_multiples_3_5_unique(numbers: List[int]) -> int:\n    unique_multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            unique_multiples.add(num)\n    return sum(unique_multiples)\n", "entry_point": "sum_multiples_3_5_unique", "input": "[3, 5, 6, 12, 20]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57809_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012820", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4762", "output": "{1, 4762, 2, 2381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012821", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[8, 7, 2, 5, 6]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012822", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "100, 51.76470588235294", "output": "-48.23529411764706", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012823", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['0.1.1', '1.0.0', '1.21.9', '1.22.0']", "output": "'1.22.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012824", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "891", "output": "{1, 33, 3, 99, 27, 9, 297, 11, 81, 891}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012825", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[351], 1", "output": "351", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012826", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 11, 1", "output": "10.90909090909091", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012827", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaabbbrr'", "output": "{'a': 3, 'b': 3, 'r': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012828", "code": "from collections import defaultdict\ndef can_form_circle(words):\n    def dfs(node, graph, visited, start):\n        visited[node] = True\n        for neighbor in graph[node]:\n            if not visited[neighbor]:\n                if dfs(neighbor, graph, visited, start):\n                    return True\n            elif neighbor == start:\n                return True\n        return False\n    graph = defaultdict(list)\n    for word in words:\n        graph[word[0]].append(word[-1])\n    for node in graph:\n        visited = {n: False for n in graph}\n        if dfs(node, graph, visited, node):\n            return True\n    return False\n", "entry_point": "can_form_circle", "input": "['apple', 'egg', 'grape']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88157_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012829", "code": "def max_score_before_game_ends(scores):\n    max_score = float('-inf')  # Initialize max_score to negative infinity\n    for score in scores:\n        if score <= max_score:\n            break  # Exit the loop if the current score is less than or equal to the max_score\n        max_score = max(max_score, score)  # Update max_score if the current score is greater\n    return max_score\n", "entry_point": "max_score_before_game_ends", "input": "[1, 2, 3, 4, 5, 6, 5]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31682_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012830", "code": "from typing import List\ndef sum_of_squares_of_evens(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total_sum += num ** 2  # Add the square of the even number to the total sum\n    return total_sum\n", "entry_point": "sum_of_squares_of_evens", "input": "[6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16571_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012831", "code": "from datetime import timedelta\nATTR_ROUTE_CODE = 'route_code'\nATTR_TIMING_POINT_CODE = 'timing_point_code'\nATTR_LINE_FILTER = 'line_filter'\nATTR_ICON = 'icon'\nATTR_DESTINATION = 'destination'\nATTR_PROVIDER = 'provider'\nATTR_TRANSPORT_TYPE = 'transport_type'\nATTR_LINE_NAME = 'line_name'\nATTR_STOP_NAME = 'stop_name'\nATTR_DEPARTURE = 'departure'\nATTR_DELAY = 'delay'\nATTR_DEPARTURES = 'departures'\nATTR_UPDATE_CYCLE = 'update_cycle'\nATTR_CREDITS = 'credits'\nMIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)\ndef filter_departures(departures, line_filter):\n    filtered_departures = {}\n    for departure in departures:\n        if departure.get(ATTR_LINE_FILTER) == line_filter:\n            line_name = departure.get(ATTR_LINE_NAME)\n            departure_time = departure.get(ATTR_DEPARTURE)\n            if line_name in filtered_departures:\n                filtered_departures[line_name].append(departure_time)\n            else:\n                filtered_departures[line_name] = [departure_time]\n    return filtered_departures\n", "entry_point": "filter_departures", "input": "[], 'bus'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135435_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012832", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'131.3.2', \"'KKee'\"", "output": "(131, 3, 2, 'KKee')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012833", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[100, 90, 80, 75, 50], 4", "output": "86.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111793_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6652", "output": "{1, 2, 4, 6652, 3326, 1663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6651", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012835", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0]", "output": "{0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012836", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "15", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012837", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "2, 8", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012838", "code": "def count_e_letters(input_string):\n    count = 0\n    lowercase_input = input_string.lower()\n    for char in lowercase_input:\n        if char == 'e' or char == '\u00e9':\n            count += 1\n    return count\n", "entry_point": "count_e_letters", "input": "'e\u00e9'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15839_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012839", "code": "def correct_typo(code_snippet):\n    corrected_code = code_snippet.replace('install_requireent', 'install_requires')\n    return corrected_code\n", "entry_point": "correct_typo", "input": "'setu'", "output": "'setu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26763_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012840", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'notionatio'", "output": "'notionatio'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012841", "code": "from typing import List\ndef calculate_moving_average(numbers: List[float], window_size: int) -> List[float]:\n    moving_averages = []\n    for i in range(len(numbers) - window_size + 1):\n        window_sum = sum(numbers[i:i+window_size])\n        window_avg = window_sum / window_size\n        moving_averages.append(window_avg)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[30.5], 1", "output": "[30.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33913_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012842", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "11", "output": "39916800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012843", "code": "def extract_file_extension(file_path):\n    # Find the index of the last period '.' character in the file path\n    last_dot_index = file_path.rfind('.')\n    # Check if a period '.' was found and it is not the last character in the string\n    if last_dot_index != -1 and last_dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character immediately after the last period\n        file_extension = file_path[last_dot_index + 1:]\n        return file_extension\n    else:\n        # If no extension found or the period is the last character, return None\n        return None\n", "entry_point": "extract_file_extension", "input": "'document.pdf'", "output": "'pdf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51602_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012844", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1414", "output": "{1, 2, 707, 101, 1414, 7, 202, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1413", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012845", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "272", "output": "{1, 2, 34, 4, 68, 136, 8, 272, 16, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt271", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012846", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[1, 5, 5, 6, 1, -7]", "output": "[1, 125, 125, 36, 1, -343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012847", "code": "def process_accounts(accounts, filter_criteria):\n    filtered_accounts = []\n    for account in accounts:\n        meets_criteria = True\n        for key, value in filter_criteria.items():\n            if key not in account or account[key] != value:\n                meets_criteria = False\n                break\n        if meets_criteria:\n            filtered_accounts.append(account)\n    return filtered_accounts\n", "entry_point": "process_accounts", "input": "[{}, {}, {}, {}], {}", "output": "[{}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2341_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012848", "code": "from collections import deque\ndef bfs(graph, start):\n    visited = set()\n    queue = deque([start])\n    traversal_order = []\n    while queue:\n        node = queue.popleft()\n        if node not in visited:\n            traversal_order.append(node)\n            visited.add(node)\n            queue.extend(neigh for neigh in graph.get(node, []) if neigh not in visited)\n    return traversal_order\n", "entry_point": "bfs", "input": "{-2: []}, -2", "output": "[-2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53696_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "856", "output": "{1, 2, 4, 8, 107, 428, 214, 856}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt855", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6646", "output": "{1, 2, 3323, 6646}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012851", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'PaPareP', 'hp'", "output": "'PaPareP.hp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012852", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "-2, -1, 2", "output": "'-2.-1.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012853", "code": "def calculate_score(player1_cards, player2_cards):\n    cards = player1_cards if len(player1_cards) > 0 else player2_cards\n    result = 0\n    count = 1\n    while len(cards) > 0:\n        result += cards.pop() * count\n        count += 1\n    return result\n", "entry_point": "calculate_score", "input": "[1], []", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83679_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012854", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4689", "output": "{1, 3, 9, 521, 4689, 1563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012855", "code": "def process_numbers(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num * 5)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "process_numbers", "input": "[2, 7, 9, 8, 1, 9]", "output": "[4, 7, 729, 64, 1, 729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146375_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6158", "output": "{1, 2, 6158, 3079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012857", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[4, 4, 4, 6, 8, 1, 5]", "output": "[4, 4, 4, 6, 8, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012858", "code": "def calculate_available_ips(start_ip, end_ip):\n    def ip_to_int(ip):\n        parts = ip.split('.')\n        return int(parts[0]) * 256**3 + int(parts[1]) * 256**2 + int(parts[2]) * 256 + int(parts[3])\n    start_int = ip_to_int(start_ip)\n    end_int = ip_to_int(end_ip)\n    total_ips = end_int - start_int + 1\n    available_ips = total_ips - 2  # Exclude network and broadcast addresses\n    return available_ips\n", "entry_point": "calculate_available_ips", "input": "'192.168.1.100', '192.168.1.1'", "output": "-100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16242_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012859", "code": "def sum_multiples(nums):\n    total = 0\n    seen = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen:\n            total += num\n            seen.add(num)\n    return total\n", "entry_point": "sum_multiples", "input": "[5, 15]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82044_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012860", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "19", "output": "{1, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012861", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[7, 1, 2, 2, 3, 3]", "output": "(7, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012862", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6847", "output": "{1, 41, 167, 6847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012863", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kirjakauppa.fi/k24'", "output": "'http://kirjakauppa.fi/k24'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012864", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[3, 1, 4, 6, 6, 44, 44, 44]", "output": "([3, 1], [4, 6, 6, 44, 44, 44])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012865", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "9, 26", "output": "234", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9962", "output": "{1, 2, 34, 293, 9962, 586, 17, 4981}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012867", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "'og:descriptiotime=2020-02-20'", "output": "{'og:descriptiotime': '2020-02-20'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "527", "output": "{1, 31, 17, 527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012869", "code": "def prime_sum(limit: int) -> int:\n    def sieve_of_eratosthenes(n):\n        primes = [True] * (n + 1)\n        primes[0] = primes[1] = False\n        p = 2\n        while p * p <= n:\n            if primes[p]:\n                for i in range(p * p, n + 1, p):\n                    primes[i] = False\n            p += 1\n        return [i for i in range(2, n) if primes[i]]\n    primes_below_limit = sieve_of_eratosthenes(limit)\n    return sum(primes_below_limit)\n", "entry_point": "prime_sum", "input": "4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76811_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012870", "code": "from typing import List, Tuple\ndef extract_view_functions(url_patterns: List[Tuple[str, str]], keyword: str) -> List[str]:\n    result = []\n    for path, view_func in url_patterns:\n        if keyword in path:\n            result.append(view_func)\n    return result\n", "entry_point": "extract_view_functions", "input": "[], 'nonexistent'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105133_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012871", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2121", "output": "{1, 3, 707, 101, 7, 2121, 303, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3004", "output": "{1, 2, 4, 751, 3004, 1502}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3003", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012873", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'llllellAA', '2023 Election'", "output": "'Sample Election: llllellAA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012874", "code": "def calculate_remaining_balance(balance, annualInterestRate, monthlyPaymentRate):\n    for _ in range(12):\n        min_payment = monthlyPaymentRate * balance\n        unpaid_balance = balance - min_payment\n        balance = unpaid_balance * (1 + annualInterestRate / 12)\n    return round(balance, 2)\n", "entry_point": "calculate_remaining_balance", "input": "1491048570.63, 0.0, 0.0", "output": "1491048570.63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101986_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012875", "code": "def count_fields_added(migrations):\n    total_fields_added = sum(1 for migration in migrations if migration.get('operation') == 'migrations.AddField')\n    return total_fields_added\n", "entry_point": "count_fields_added", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92445_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012876", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[1, 2, 5, 5, 3, 3]", "output": "[5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012877", "code": "def longest_substring_with_k_distinct(s, k):\n    left = 0\n    right = 0\n    letters = [0] * 26\n    maxnum = 0\n    result = 0\n    for per in s:\n        id_ = ord(per) - ord(\"A\")\n        letters[id_] += 1\n        maxnum = max(maxnum, letters[id_])\n        while right - left + 1 - maxnum > k:\n            letters[ord(s[left]) - ord(\"A\")] -= 1\n            left += 1\n        result = max(result, right - left + 1)\n        right += 1\n    return result\n", "entry_point": "longest_substring_with_k_distinct", "input": "'AABBCC', 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140789_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012878", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'C:\\\\U'", "output": "'C:/U'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012879", "code": "def convert_message(message: str) -> str:\n    converted_message = \"\"\n    for char in message:\n        if char.isalpha():\n            converted_message += str(ord(char) - ord('a') + 1) + \"-\"\n        elif char == ' ':\n            converted_message += \"-\"\n    return converted_message[:-1]  # Remove the extra hyphen at the end\n", "entry_point": "convert_message", "input": "'hello world'", "output": "'8-5-12-12-15--23-15-18-12-4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148155_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012880", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "7, 3", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99400_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012881", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'clcltc', 'gru.hdfriei.npy'", "output": "'clcltc/gru.hdfriei.npy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012882", "code": "def time_diff(time1, time2):\n    def time_to_seconds(time_str):\n        h, m, s = map(int, time_str.split(':'))\n        return h * 3600 + m * 60 + s\n    total_seconds1 = time_to_seconds(time1)\n    total_seconds2 = time_to_seconds(time2)\n    time_difference = abs(total_seconds1 - total_seconds2)\n    return time_difference\n", "entry_point": "time_diff", "input": "'00:00:00', '10:15:15'", "output": "36915", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35063_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012883", "code": "def extract_variables(input_list):\n    variables_dict = {}\n    for item in input_list:\n        variable, value = item.split('=')\n        variable = variable.strip()\n        value = value.strip().strip(\"'\")\n        variables_dict[variable] = value\n    return variables_dict\n", "entry_point": "extract_variables", "input": "[\"color='blue'\"]", "output": "{'color': 'blue'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28445_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012884", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "13", "output": "'XIII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9081", "output": "{1, 3, 9, 1009, 3027, 9081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012886", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[40, 45, 50]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012887", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'Joh '", "output": "('Joh', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012888", "code": "def sum_of_digits_of_power(exponent):\n    # Calculate 2 raised to the power of the given exponent\n    result = 2 ** exponent\n    # Convert the result to a string to extract individual digits\n    digits = [int(d) for d in str(result)]\n    # Sum up the digits\n    digit_sum = sum(digits)\n    return digit_sum\n", "entry_point": "sum_of_digits_of_power", "input": "1000", "output": "1366", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012889", "code": "from typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    for word in text.split():\n        processed_word = ''.join(char.lower() for char in word if char.isalnum())\n        if processed_word:\n            unique_words.add(processed_word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'wrldwrldpyth'", "output": "['wrldwrldpyth']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110518_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012890", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[1, 2, 3, 2]", "output": "[2, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012891", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[2, 3, 4, 15, 16, 16, 16, -1]", "output": "[2, 'Fizz', 4, 'FizzBuzz', 16, 16, 16, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012892", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[3], [4]]", "output": "[3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012893", "code": "from collections import deque\ndef min_moves_to_win(N, ladders, snakes):\n    visited = set()\n    queue = deque([(1, 0)])  # Start from cell 1 with 0 moves\n    while queue:\n        current_cell, moves = queue.popleft()\n        if current_cell == N:\n            return moves\n        for i in range(1, 7):  # Dice roll from 1 to 6\n            new_cell = current_cell + i\n            if new_cell in ladders:\n                new_cell = ladders[new_cell]  # Climb the ladder\n            elif new_cell in snakes:\n                new_cell = snakes[new_cell]  # Slide down the snake\n            if new_cell <= N and new_cell not in visited:\n                visited.add(new_cell)\n                queue.append((new_cell, moves + 1))\n    return -1\n", "entry_point": "min_moves_to_win", "input": "1, {}, {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13443_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5627", "output": "{1, 331, 5627, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012895", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012896", "code": "import math\ndef combs(n, k):\n    if k == 0 or k == n:\n        return 1\n    return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))\n", "entry_point": "combs", "input": "7, 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128662_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012897", "code": "def get_seq_len(sentence):\n    length = 0\n    for num in sentence:\n        length += 1\n        if num == 1:\n            break\n    return length\n", "entry_point": "get_seq_len", "input": "[2, 3, 4, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87843_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012898", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'add rax, [rbx + r15 * 4 + 0x10]'", "output": "'add add rax, [rbx+r15*4+0x10]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012899", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[7, 0, 5, 4]", "output": "[7, 7, 12, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012900", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "207", "output": "b'\\xcf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012901", "code": "import math\ndef sieve_of_eratosthenes(limit):\n    is_prime = [True] * (limit + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(limit)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, limit + 1, i):\n                is_prime[j] = False\n    return [num for num in range(2, limit + 1) if is_prime[num]]\n", "entry_point": "sieve_of_eratosthenes", "input": "23", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112116_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1748", "output": "{1, 2, 4, 38, 874, 76, 46, 19, 1748, 437, 23, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1747", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012903", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9111", "output": "{1, 3, 3037, 9111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012904", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1058", "output": "{1, 1058, 2, 46, 529, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1057", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "220", "output": "{1, 2, 4, 5, 10, 11, 44, 110, 20, 22, 55, 220}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt219", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "523", "output": "{1, 523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012907", "code": "def max_consecutive_rounds(candies):\n    if not candies:\n        return 0\n    max_consecutive = 1\n    current_consecutive = 1\n    for i in range(1, len(candies)):\n        if candies[i] == candies[i - 1]:\n            current_consecutive += 1\n            max_consecutive = max(max_consecutive, current_consecutive)\n        else:\n            current_consecutive = 1\n    return max_consecutive\n", "entry_point": "max_consecutive_rounds", "input": "[1, 1, 1, 1, 1, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31135_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012908", "code": "import math\ndef calculate_cosine_similarity(vector1, vector2):\n    dot_product = 0\n    magnitude1 = 0\n    magnitude2 = 0\n    # Calculate dot product and magnitudes\n    for key in set(vector1.keys()) & set(vector2.keys()):\n        dot_product += vector1[key] * vector2[key]\n    for value in vector1.values():\n        magnitude1 += value ** 2\n    for value in vector2.values():\n        magnitude2 += value ** 2\n    magnitude1 = math.sqrt(magnitude1)\n    magnitude2 = math.sqrt(magnitude2)\n    # Calculate cosine similarity\n    if magnitude1 == 0 or magnitude2 == 0:\n        return 0\n    else:\n        return dot_product / (magnitude1 * magnitude2)\n", "entry_point": "calculate_cosine_similarity", "input": "{'a': 1, 'b': 2}, {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12988_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012909", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[0, 7, 0, -5, 0, 7, 0, 15, 7]", "output": "[7, -7, -5, 5, 7, -7, 15, -8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7669", "output": "{1, 7669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012911", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[80, 80, 75, 73, 57]", "output": "73.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012912", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3548", "output": "{1, 2, 4, 1774, 887, 3548}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3547", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012913", "code": "def count_emojis(input_string):\n    emoji_count = {}\n    # Split the input string into individual emojis\n    emojis = input_string.split()\n    # Count the occurrences of each unique emoji\n    for emoji in emojis:\n        if emoji in emoji_count:\n            emoji_count[emoji] += 1\n        else:\n            emoji_count[emoji] = 1\n    return emoji_count\n", "entry_point": "count_emojis", "input": "'\ud83c\udf1f'", "output": "{'\ud83c\udf1f': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128683_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012914", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v10.1.31.3.'", "output": "'10.1.31.3.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012915", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 4, 1, 4, 2, 3, 4, 2]", "output": "[4, 2, 12, 8, 15, 24, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77019_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012916", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[0, 2, 3, 4, 0, 0, 8, 7, 1]", "output": "[0, 3, 5, 7, 4, 5, 14, 14, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012917", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1875", "output": "{1, 3, 5, 75, 15, 625, 1875, 375, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012918", "code": "from typing import List\ndef find_process_to_terminate(processes: List[str]) -> str:\n    process_count = {}\n    for process in processes:\n        if process in process_count:\n            process_count[process] += 1\n        else:\n            process_count[process] = 1\n    max_count = max(process_count.values())\n    most_frequent_processes = [process for process, count in process_count.items() if count == max_count]\n    for process in processes:\n        if process in most_frequent_processes:\n            return process\n", "entry_point": "find_process_to_terminate", "input": "['Minecraft.exe', 'Minecraft.exe', 'Notepad.exe']", "output": "'Minecraft.exe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15864_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012919", "code": "from typing import List\ndef modifySequence(nums: List[int]) -> List[int]:\n    cnt = 0\n    modified_nums = nums.copy()\n    for i in range(1, len(nums)):\n        if nums[i - 1] > nums[i]:\n            cnt += 1\n            if cnt > 1:\n                return []\n            if i - 2 >= 0 and nums[i - 2] > nums[i]:\n                modified_nums[i] = nums[i - 1]\n            else:\n                modified_nums[i - 1] = nums[i]\n    return modified_nums\n", "entry_point": "modifySequence", "input": "[3, 2, 3]", "output": "[2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138529_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012920", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "146.4, 15, 10", "output": "183", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012921", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8163", "output": "{1, 2721, 3, 8163, 9, 907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012922", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['4.5.6', '4.5.5', '4.4.9', '3.5.6']", "output": "'4.5.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012923", "code": "def sum_of_digits(n: int) -> int:\n    sum_digits = 0\n    for digit in str(n):\n        sum_digits += int(digit)\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "93", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99099_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012924", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'[an]'", "output": "'\\x1b[38;5;196man\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012925", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'abcf,gabc,def,ghi -> jka'", "output": "(['abcf', 'gabc', 'def', 'ghi'], 'jka')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012926", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'a', 'h'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012927", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, -23]", "output": "-23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012928", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'1'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012929", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[3, 1, 7, 6, 5, 2]", "output": "[2, 1, 3, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012930", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[2, 4, 5, 2, 4, 1]", "output": "[5, 4, 4, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012931", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/home/user', 'documents/e.jpg'", "output": "'/home/user/documents/e.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012932", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "395", "output": "{1, 395, 5, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012933", "code": "def trapped_rainwater(buildings):\n    if not buildings:\n        return 0\n    n = len(buildings)\n    left_max = [0] * n\n    right_max = [0] * n\n    left_max[0] = buildings[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], buildings[i])\n    right_max[n - 1] = buildings[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], buildings[i])\n    total_rainwater = 0\n    for i in range(n):\n        total_rainwater += max(0, min(left_max[i], right_max[i]) - buildings[i])\n    return total_rainwater\n", "entry_point": "trapped_rainwater", "input": "[0, 1, 0, 2, 1, 0, 1, 3, 0]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26473_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012934", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'Please uu.'", "output": "'Please uu.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012935", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "4", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012936", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 91, 90, 80]", "output": "[100, 91, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012937", "code": "def calculate_average_scores(scores):\n    student_scores = {}\n    student_counts = {}\n    for name, score in scores:\n        if name in student_scores:\n            student_scores[name] += score\n            student_counts[name] += 1\n        else:\n            student_scores[name] = score\n            student_counts[name] = 1\n    average_scores = {name: round(student_scores[name] / student_counts[name]) for name in student_scores}\n    return average_scores\n", "entry_point": "calculate_average_scores", "input": "[('Bob', 80)]", "output": "{'Bob': 80}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43986_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012938", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['King', 'King', 'King', 'Ace', 3, 4]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012939", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[24]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100714_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012940", "code": "from datetime import datetime\ndef calculate_date_difference(date1, date2):\n    # Parse the input date strings into datetime objects\n    date1_obj = datetime.strptime(date1, '%Y-%m-%d')\n    date2_obj = datetime.strptime(date2, '%Y-%m-%d')\n    # Calculate the absolute difference in days between the two dates\n    date_difference = abs((date1_obj - date2_obj).days)\n    return date_difference\n", "entry_point": "calculate_date_difference", "input": "'2023-10-01', '2023-10-08'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86815_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012941", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "58", "output": "{1, 58, 2, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt57", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012942", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -1.0, -2.3000000000000003", "output": "-3.3000000000000003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012943", "code": "import re\ndef is_valid_set(set_str):\n    elements = re.findall(r'\\d+', set_str)\n    elements = [int(elem) for elem in elements]\n    if len(elements) != len(set(elements)):\n        return False\n    return True\n", "entry_point": "is_valid_set", "input": "'1 2 2'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19285_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012944", "code": "def higher_card_game(player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1\"\n    elif player2_wins > player1_wins:\n        return \"Player 2\"\n    else:\n        return \"Draw\"\n", "entry_point": "higher_card_game", "input": "[1, 2, 3], [2, 3, 4]", "output": "'Player 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138590_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012945", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[8, 11, 1, 10, 1, 10, 10], 8", "output": "[512, 1331, 1, 1000, 1, 1000, 1000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012946", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'i'", "output": "'i'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012947", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1321", "output": "{1, 1321}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012948", "code": "def extract_verbose_name(class_name: str) -> str:\n    # Split the class name based on uppercase letters\n    words = [char if char.isupper() else ' ' + char for char in class_name]\n    verbose_name = ''.join(words).strip()\n    # Convert the verbose name to the desired format\n    verbose_name = verbose_name.replace('Config', '').replace('ADM', ' \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0414\u0435\u0434\u043e\u0432 \u041c\u043e\u0440\u043e\u0437\u043e\u0432')\n    return verbose_name\n", "entry_point": "extract_verbose_name", "input": "'ClubConfig'", "output": "'C l u bC o n f i g'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42194_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012949", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "19, 8", "output": "(2.375, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012950", "code": "def count_users_with_starting_letter(users, letter):\n    count = 0\n    for user in users:\n        first_name = user['fname']\n        if first_name.startswith(letter):\n            count += 1\n    return count\n", "entry_point": "count_users_with_starting_letter", "input": "[], 'A'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60355_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4449", "output": "{1, 4449, 3, 1483}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012952", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "110792", "output": "55396", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5935", "output": "{1, 1187, 5, 5935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012954", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[10, 21, 22, 5, 7, 11], 6", "output": "[[10, 21, 22, 5, 7, 11]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012955", "code": "from typing import List\ndef extract_dataset_providers(env_var: str) -> List[str]:\n    if not env_var:\n        return []\n    return env_var.split(',')\n", "entry_point": "extract_dataset_providers", "input": "'circirrocuqaa'", "output": "['circirrocuqaa']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18804_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012956", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(0, 2, 4, 4, 0, 0)", "output": "'(0.2.4.4.0.0)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012957", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[1, 3, 11, 1, 3, 2, 11, 6]", "output": "[4, 14, 12, 4, 5, 13, 17, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012958", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[1, 2, 3, 4, 5], 2, 3", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012959", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4568", "output": "{1, 2, 4, 8, 2284, 1142, 4568, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4567", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012960", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[10, 8, 12, 8, 6, 3, 5, 5, 7]", "output": "([10, 8, 12, 8, 6], [3, 5, 5, 7])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012961", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012962", "code": "def cooking3(N, M, wig):\n    dp = [float('inf')] * (N + 1)\n    dp[0] = 0\n    for i in range(1, N + 1):\n        for w in wig:\n            if i - w >= 0:\n                dp[i] = min(dp[i], dp[i - w] + 1)\n    return dp[N] if dp[N] != float('inf') else -1\n", "entry_point": "cooking3", "input": "4, 1, [1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18807_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012963", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[5.0, 9.0, -1.0, -2.0]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5243", "output": "{1, 7, 107, 749, 49, 5243}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012965", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[2, 0, 0, 3, 0, 3]", "output": "[2, 0, 3, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012966", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 7, 9, 4, 7, 7, 8, 4, 8]", "output": "[2, 8, 11, 7, 11, 12, 14, 11, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012967", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[1, 1, 2, 3, 3, 4]", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012968", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8168", "output": "{1, 2, 4, 8168, 8, 4084, 2042, 1021}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8167", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012969", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[20, 6, 18, -2, 7, 6, 6, -2]", "output": "[26, 24, 16, 5, 13, 12, 4, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2266", "output": "{1, 2, 103, 11, 1133, 206, 22, 2266}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012971", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'coddingm'", "output": "'coddingm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012972", "code": "from typing import List\ndef find_first_occurrence(data_changed_flags: List[int]) -> int:\n    for index, value in enumerate(data_changed_flags):\n        if value == 1:\n            return index\n    return -1\n", "entry_point": "find_first_occurrence", "input": "[1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32380_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012973", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'abc-12538xyz'", "output": "-12538", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012974", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[70]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012975", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'11Paper'", "output": "['11Paper']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "689", "output": "{53, 1, 689, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012977", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "116", "output": "161", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9482", "output": "{1, 2, 4741, 9482, 11, 431, 22, 862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9481", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012979", "code": "def count_unique_characters(input_string: str) -> int:\n    unique_chars = set()\n    for char in input_string:\n        if char.isalnum() or char.isspace():  # Consider alphanumeric characters and spaces\n            unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abc 123 cde'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87024_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012980", "code": "from typing import List\ndef sum_of_max_values(strings: List[str]) -> int:\n    total_sum = 0\n    for string in strings:\n        integers = [int(num) for num in string.split(',')]\n        max_value = max(integers)\n        total_sum += max_value\n    return total_sum\n", "entry_point": "sum_of_max_values", "input": "['10,5', '9']", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86134_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012981", "code": "def lcs_length(X, Y):\n    m, n = len(X), len(Y)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if X[i - 1] == Y[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'abcde', 'abcyde'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36552_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012982", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "43, 122", "output": "(223, 57)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012983", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7286", "output": "{1, 2, 3643, 7286}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012984", "code": "def filter_elements(iterable, include_values):\n    filtered_list = []\n    for value in iterable:\n        if value in include_values:\n            filtered_list.append(value)\n    return filtered_list\n", "entry_point": "filter_elements", "input": "[], [1, 2, 3]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46502_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012985", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[78, 79, 80]", "output": "79.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91403_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012986", "code": "def process_error_strings(error_strings):\n    error_dict = {}\n    for error_str in error_strings:\n        error_code = error_str[error_str.find('{')+1:error_str.find('}')]\n        error_message = error_str.split(' - ')[1]\n        error_dict[error_code] = error_message\n    return error_dict\n", "entry_point": "process_error_strings", "input": "['Error generated {201} - Created']", "output": "{'201': 'Created'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1364_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012987", "code": "def sum_multiples(nums):\n    total_sum = 0\n    for num in nums:\n        if num > 0 and (num % 3 == 0 or num % 5 == 0):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[15, 24, 10]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132311_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012988", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 5, 10]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012989", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "13, 2", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012990", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'h w d !'", "output": "{'h': 1, 'w': 1, 'd': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15027_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012991", "code": "from typing import List\ndef calculate_diff(lst: List[int]) -> int:\n    if len(lst) < 2:\n        return 0\n    else:\n        last_two_elements = lst[-2:]\n        return abs(last_two_elements[1] - last_two_elements[0])\n", "entry_point": "calculate_diff", "input": "[0, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112649_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012992", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "1, 60, 'foo'", "output": "{'foo': 60}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012993", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'http://www.opengih.2'", "output": "'xmlns:__NAMESPACE__=\"http://www.opengih.2\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012994", "code": "from typing import List\ndef find_last_target(nums: List[int], target: int) -> int:\n    left = 0\n    right = len(nums) - 1\n    while left + 1 < right:\n        mid = int(left + (right - left) / 2)\n        if nums[mid] == target:\n            left = mid\n        elif nums[mid] > target:\n            right = mid\n        elif nums[mid] < target:\n            left = mid\n    if nums[right] == target:\n        return right\n    if nums[left] == target:\n        return left\n    return -1\n", "entry_point": "find_last_target", "input": "[1, 2, 3, 3, 3, 3], 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72340_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012995", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'IPPIPPII', 'ME'", "output": "'Invalid status code: IPPIPPII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012996", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'y'", "output": "'y'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012997", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "19, [20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012998", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "1.1", "output": "'1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0012999", "code": "def extract_y_coordinates(coordinates):\n    y_coordinates = []  # Initialize an empty list to store y-coordinates\n    for coord in coordinates:\n        y_coordinates.append(coord[1])  # Extract y-coordinate (index 1) and append to the list\n    return y_coordinates\n", "entry_point": "extract_y_coordinates", "input": "[(0, 0), (1, 1), (2, 2)]", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19900_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013000", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[2, 6, 2, -1]", "output": "[2, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013001", "code": "from typing import List\ndef count_state_occurrences(states: List[int], target_state: int) -> int:\n    count = 0\n    for state in states:\n        if state == target_state:\n            count += 1\n    return count\n", "entry_point": "count_state_occurrences", "input": "[2, 2, 2, 1, 3, 4], 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145747_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013002", "code": "def find_lcs_length(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length", "input": "'abc', 'ac'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102514_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013003", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'cha'", "output": "'cha'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013004", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'musicsusibg'", "output": "'Musicsusibg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013005", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1014", "output": "{1, 2, 3, 6, 39, 169, 13, 78, 338, 1014, 26, 507}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1013", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013006", "code": "def convert_to_json(o):\n    if isinstance(o, (list, tuple)):\n        return [convert_to_json(oo) for oo in o]\n    if hasattr(o, 'to_json'):\n        return o.to_json()\n    if callable(o):\n        comps = [o.__module__] if o.__module__ != 'builtins' else []\n        if type(o) == type(convert_to_json):\n            comps.append(o.__name__)\n        else:\n            comps.append(o.__class__.__name__)\n        res = '.'.join(comps)\n        if type(o) == type(convert_to_json):\n            return res\n        return {'class': res}\n    return o\n", "entry_point": "convert_to_json", "input": "123", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112833_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013007", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'ueoeq\" some_value'", "output": "{'ueoeq\"': 'N/A'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013008", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{4: []}, 4", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013009", "code": "def extract_first_names(names):\n    first_names = []\n    for full_name in names:\n        first_name = full_name.split()[0]\n        first_names.append(first_name)\n    return first_names\n", "entry_point": "extract_first_names", "input": "['John Doe', 'Alice Smith', 'Bob Johnson']", "output": "['John', 'Alice', 'Bob']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75022_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013010", "code": "def encode_strings_to_bytes(strings):\n    byte_strings = [string.encode('utf-8') for string in strings]\n    return byte_strings\n", "entry_point": "encode_strings_to_bytes", "input": "['hello', 'world']", "output": "[b'hello', b'world']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102348_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013011", "code": "def calculate_luminance(r, g, b):\n    luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b\n    return round(luminance, 2)\n", "entry_point": "calculate_luminance", "input": "0, 0, 0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28393_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "130", "output": "{65, 1, 130, 2, 5, 10, 13, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt129", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013013", "code": "def apply_sparsity(epoch, initial_epoch, periodicity):\n    if (epoch - initial_epoch) >= 0 and (epoch - initial_epoch) % periodicity == 0:\n        return True\n    else:\n        return False\n", "entry_point": "apply_sparsity", "input": "0, 0, 1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92732_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013014", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1169", "output": "{1, 1169, 167, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1645", "output": "{1, 35, 5, 7, 329, 235, 1645, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7674", "output": "{1, 2, 3, 6, 7674, 3837, 2558, 1279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013017", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "10, 5.477225575051661", "output": "11.40175425099138", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013018", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 9, 3, 7, 9, 4, 8, 9]", "output": "[7, 10, 5, 10, 13, 9, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013019", "code": "def calculate_average_increase(dfs, followers):\n    incs = {}\n    for days in dfs:\n        total_increase = sum(followers[:days])\n        average_increase = total_increase / days\n        incs[days] = average_increase\n    return incs\n", "entry_point": "calculate_average_increase", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122612_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013020", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'11.1.1'", "output": "'11.1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4682", "output": "{1, 4682, 2, 2341}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013022", "code": "def sort_dates(dates):\n    def custom_sort(date):\n        year, month, day = map(int, date.split('-'))\n        return year, month, day\n    return sorted(dates, key=custom_sort)\n", "entry_point": "sort_dates", "input": "['2000-01-01', '1999-12-31']", "output": "['1999-12-31', '2000-01-01']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3897_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6093", "output": "{1, 3, 677, 9, 6093, 2031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013024", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[1, 2, 2, 3, 1, 4, 5, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013025", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013026", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "12", "output": "'T__11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013027", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 85, 80, 75, 70], 5", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013028", "code": "def relative_path(source_path, target_path):\n    source_dirs = source_path.split('/')\n    target_dirs = target_path.split('/')\n    # Find the common prefix\n    i = 0\n    while i < len(source_dirs) and i < len(target_dirs) and source_dirs[i] == target_dirs[i]:\n        i += 1\n    # Construct the relative path\n    relative_dirs = ['..' for _ in range(len(source_dirs) - i)] + target_dirs[i:]\n    return '/'.join(relative_dirs)\n", "entry_point": "relative_path", "input": "'/home/user/project/files', '/home/user'", "output": "'../..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72530_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013029", "code": "def word_pattern(pattern: str, input_str: str) -> bool:\n    words = input_str.split()\n    if len(pattern) != len(words):\n        return False\n    pattern_map = {}\n    seen_words = set()\n    for char, word in zip(pattern, words):\n        if char not in pattern_map:\n            if word in seen_words:\n                return False\n            pattern_map[char] = word\n            seen_words.add(word)\n        else:\n            if pattern_map[char] != word:\n                return False\n    return True\n", "entry_point": "word_pattern", "input": "'abba', 'dog cat cat dog'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40478_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013030", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'Hello, World!'", "output": "'Uryyb, Jbeyq!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013031", "code": "from typing import List\ndef remove_poisoned_data(predictions: List[int]) -> List[int]:\n    median = sorted(predictions)[len(predictions) // 2]\n    deviations = [abs(pred - median) for pred in predictions]\n    mad = sorted(deviations)[len(deviations) // 2]\n    threshold = 2 * mad\n    cleaned_predictions = [pred for pred in predictions if abs(pred - median) <= threshold]\n    return cleaned_predictions\n", "entry_point": "remove_poisoned_data", "input": "[10, 11, 12, 12, 12, 12, 12, 13, 14]", "output": "[12, 12, 12, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51414_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013032", "code": "def simulate_insert_roles(roles_list):\n    total_inserted = 0\n    for role_data in roles_list:\n        # Simulate inserting the role into the database\n        print(f\"Simulating insertion of role: {role_data['name']}\")\n        total_inserted += 1\n    return total_inserted\n", "entry_point": "simulate_insert_roles", "input": "[{'name': 'Admin'}, {'name': 'User'}]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36169_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3874", "output": "{1, 3874, 2, 298, 13, 1937, 149, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2945", "output": "{1, 2945, 5, 589, 19, 155, 95, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013035", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[1, 2, 3, 4, 5, 3]", "output": "[1, 4, 37, 16, 125, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013036", "code": "def sum_divisible_numbers(start, end, divisor):\n    total_sum = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_numbers", "input": "1, 18, 6", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119149_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013037", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 6, 12, 15, 6]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100977_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2270", "output": "{1, 2, 227, 5, 454, 10, 1135, 2270}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2269", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013039", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 5, 6, 7]", "output": "210", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013040", "code": "from typing import List\ndef find_longest_subarray_with_sum(nums: List[int], target_sum: int) -> List[int]:\n    sum_index_map = {0: -1}\n    current_sum = 0\n    max_length = 0\n    result = []\n    for i, num in enumerate(nums):\n        current_sum += num\n        if current_sum - target_sum in sum_index_map and i - sum_index_map[current_sum - target_sum] > max_length:\n            max_length = i - sum_index_map[current_sum - target_sum]\n            result = nums[sum_index_map[current_sum - target_sum] + 1:i + 1]\n        if current_sum not in sum_index_map:\n            sum_index_map[current_sum] = i\n    return result\n", "entry_point": "find_longest_subarray_with_sum", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26568_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013041", "code": "from typing import List, Dict\ndef convert_variable_types(variables: List[str]) -> Dict[str, str]:\n    variable_types = {}\n    for var in variables:\n        var_name, var_type = var.split(\":\")\n        var_name = var_name.strip()\n        var_type = var_type.strip()\n        variable_types[var_name] = var_type\n    return variable_types\n", "entry_point": "convert_variable_types", "input": "['_Population: int']", "output": "{'_Population': 'int'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46156_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013042", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "8", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013043", "code": "def generate_symmetric_banner(text, gap):\n    total_length = len(text) + gap\n    left_padding = (total_length - len(text)) // 2\n    right_padding = total_length - len(text) - left_padding\n    symmetric_banner = \" \" * left_padding + text + \" \" * right_padding\n    return symmetric_banner\n", "entry_point": "generate_symmetric_banner", "input": "'Hello, Wor!', 25", "output": "'            Hello, Wor!             '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92337_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013044", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "3, 4, -2", "output": "-12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013045", "code": "def is_permutation(A):\n    count = {}\n    N = len(A)\n    for i in range(N):\n        if A[i] not in count:\n            count[A[i]] = 0\n        count[A[i]] += 1\n        if count[A[i]] > 1:\n            return 0\n    values = count.keys()\n    if max(values) == N:\n        return 1\n    return 0\n", "entry_point": "is_permutation", "input": "[0, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53503_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013046", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2714", "output": "{1, 2, 1357, 46, 118, 23, 2714, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013047", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(3, 3, -1, 4, 1, -1, -1, -1, -1)", "output": "'3.3.-1.4.1.-1.-1.-1.-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013048", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1217", "output": "{1, 1217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013049", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013050", "code": "def calculate_train_info(total_loss, total_acc, i):\n    train_info = {}\n    train_info['loss'] = total_loss / float(i + 1)\n    train_info['train_accuracy'] = total_acc / float(i + 1)\n    return train_info\n", "entry_point": "calculate_train_info", "input": "20.8, 15.6, 0", "output": "{'loss': 20.8, 'train_accuracy': 15.6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45300_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013051", "code": "def my_count(lst, e):\n    res = 0\n    if type(lst) == list:\n        res = lst.count(e)\n    return res\n", "entry_point": "my_count", "input": "[5, 5, 5], 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128138_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013052", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    new_list = []\n    for i in range(len(lst) - 1):\n        new_list.append(lst[i] + lst[i + 1])\n    new_list.append(lst[-1] + lst[0])\n    return new_list\n", "entry_point": "process_list", "input": "[1, 1, 1, 2, 2]", "output": "[2, 2, 3, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64952_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013053", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[91, 89, 88, 70, 70, 85]", "output": "[91, 89, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013054", "code": "def is_leap(year):\n    # Check if the year is divisible by 4\n    if year % 4 == 0:\n        # Check if it is not divisible by 100 or if it is divisible by 400\n        if year % 100 != 0 or year % 400 == 0:\n            return True\n    return False\n", "entry_point": "is_leap", "input": "2024", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102062_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013055", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[90, 33, 90, 33, 32, 65, 32, 32, 32]", "output": "[90, 33, 90, 33, 32, 65, 32, 32, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013056", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.11.3'", "output": "(0, 11, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013057", "code": "from typing import List\ndef find_reverse_duplicates(lines: List[str]) -> List[str]:\n    results = []\n    for line in lines:\n        values = line.split()\n        history = set()\n        duplicates = []\n        for i in reversed(values):\n            if i not in history:\n                history.add(i)\n            elif i not in duplicates:\n                duplicates.insert(0, i)\n        results.append(' '.join(duplicates))\n    return results\n", "entry_point": "find_reverse_duplicates", "input": "['', '', 'a a']", "output": "['', '', 'a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105725_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013058", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4594", "output": "{1, 4594, 2, 2297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1542", "output": "{1, 2, 3, 771, 514, 1542, 6, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1541", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013060", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "498", "output": "{1, 2, 3, 166, 6, 498, 83, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013061", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "9", "output": "[0, 1, 1, 1, 2, 3, 6, 9, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013062", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'B'", "output": "['B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013063", "code": "def filter_models(models, threshold):\n    filtered_models = []\n    for model in models:\n        if model[\"accuracy\"] >= threshold:\n            filtered_models.append(model[\"name\"])\n    return filtered_models\n", "entry_point": "filter_models", "input": "[], 0.9", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120659_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013064", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "7", "output": "['1', '2', 'Fizz', '4', 'Buzz', 'Fizz', '7']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013065", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) <= 2:\n        return 0  # If the list has 0, 1, or 2 elements, return 0 as there are no extremes to exclude\n    min_val = min(numbers)\n    max_val = max(numbers)\n    numbers.remove(min_val)\n    numbers.remove(max_val)\n    return sum(numbers) / len(numbers)\n", "entry_point": "calculate_average_excluding_extremes", "input": "[2, 4, 5, 5, 9]", "output": "4.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132591_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013066", "code": "def highest_card_wins(player1_card, player2_card):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_rank = player1_card[:-1]\n    player2_rank = player2_card[:-1]\n    player1_value = card_values[player1_rank]\n    player2_value = card_values[player2_rank]\n    if player1_value > player2_value:\n        return 1\n    elif player1_value < player2_value:\n        return 2\n    else:\n        return \"It's a tie!\"\n", "entry_point": "highest_card_wins", "input": "'5H', '6D'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90012_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013067", "code": "def update_ranks(winner_rank, loser_rank, weighting):\n    winner_rank_transformed = 10 ** (winner_rank / 400)\n    opponent_rank_transformed = 10 ** (loser_rank / 400)\n    transformed_sum = winner_rank_transformed + opponent_rank_transformed\n    winner_score = winner_rank_transformed / transformed_sum\n    loser_score = opponent_rank_transformed / transformed_sum\n    winner_rank = winner_rank + weighting * (1 - winner_score)\n    loser_rank = loser_rank - weighting * loser_score\n    # Set a floor of 100 for the rankings.\n    winner_rank = 100 if winner_rank < 100 else winner_rank\n    loser_rank = 100 if loser_rank < 100 else loser_rank\n    winner_rank = float('{result:.2f}'.format(result=winner_rank))\n    loser_rank = float('{result:.2f}'.format(result=loser_rank))\n    return winner_rank, loser_rank\n", "entry_point": "update_ranks", "input": "1500, 1200, 32", "output": "(1504.83, 1195.17)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7826_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013068", "code": "def get_updated_value(filter_condition):\n    metadata = {}\n    if isinstance(filter_condition, str):\n        metadata[filter_condition] = 'default_value'\n    elif isinstance(filter_condition, list):\n        for condition in filter_condition:\n            metadata[condition] = 'default_value'\n    return metadata\n", "entry_point": "get_updated_value", "input": "'filter1'", "output": "{'filter1': 'default_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97050_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013069", "code": "from typing import List, Union, Optional, Tuple\nfrom collections import Counter\ndef most_common_element(lst: List[Union[int, any]]) -> Tuple[Optional[int], Optional[int]]:\n    int_list = [x for x in lst if isinstance(x, int)]\n    if not int_list:\n        return (None, None)\n    counter = Counter(int_list)\n    most_common = counter.most_common(1)[0]\n    return most_common\n", "entry_point": "most_common_element", "input": "[2, 2, 'a', 3, 1, 1]", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70044_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013070", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[2, 3, 5, 5, 3, 5, 3, 3, 5]", "output": "[5, 3, 3, 5, 3, 5, 5, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013071", "code": "def html_reverse_escape(string):\n    '''Reverse escapes HTML code in string into ASCII text.'''\n    return string.replace(\"&amp;\", \"&\").replace(\"&#39;\", \"'\").replace(\"&quot;\", '\"')\n", "entry_point": "html_reverse_escape", "input": "'happy'", "output": "'happy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68510_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "708", "output": "{1, 2, 3, 708, 354, 4, 6, 236, 12, 177, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt707", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2629", "output": "{1, 11, 2629, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013074", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "7, 3, 10", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013075", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[1, 2, 3, 3, 3, 9, 10, 10, 10]", "output": "[9, 3, 3, 3, 1, 2, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013076", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2006", "output": "{1, 2, 34, 1003, 17, 2006, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2005", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2201", "output": "{1, 2201, 71, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2200", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013078", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[3]", "output": "[3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013079", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "-4, 1", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013080", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[50.0, 150.8]", "output": "100.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013081", "code": "def calculate_total_amount(orders):\n    total_amount = 0\n    for order in orders:\n        total_amount += order['amount']\n    return total_amount\n", "entry_point": "calculate_total_amount", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50307_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013082", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for num1, num2 in zip(arr1, arr2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[1, 2, 3, 4], [4, 5, 6, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20129_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013083", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[15]", "output": "'0xf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013084", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 7, 7, 5, 3, 7, 4, 7, 8]", "output": "[3, 8, 9, 8, 7, 12, 10, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2989", "output": "{1, 7, 427, 2989, 49, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013086", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'gMMMggMMg'", "output": "'gMMMggMMg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013087", "code": "def generate_indented_list(n):\n    output = \"\"\n    for i in range(1, n + 1):\n        indent = \"    \" * (i - 1)  # Generate the appropriate level of indentation\n        output += f\"{i}. {indent}Item {i}\\n\"\n    return output\n", "entry_point": "generate_indented_list", "input": "0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95960_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013088", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4]", "output": "[1, 3, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013089", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5357", "output": "{1, 11, 5357, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6245", "output": "{1, 5, 1249, 6245}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013091", "code": "def extract_version_numbers(version):\n    try:\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "extract_version_numbers", "input": "'1.2.3'", "output": "(1, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56374_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013092", "code": "from collections import deque\ndef bfs(graph, start):\n    visited = set()\n    queue = deque([start])\n    traversal_order = []\n    while queue:\n        node = queue.popleft()\n        if node not in visited:\n            traversal_order.append(node)\n            visited.add(node)\n            queue.extend(neigh for neigh in graph.get(node, []) if neigh not in visited)\n    return traversal_order\n", "entry_point": "bfs", "input": "{6: []}, 6", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53696_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013093", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[7, 7]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013094", "code": "def split_input_target(chunk):\n    input_text = chunk[:-1]\n    target_text = chunk[1:]\n    return input_text, target_text\n", "entry_point": "split_input_target", "input": "'hhelheelo'", "output": "('hhelheel', 'helheelo')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41781_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013095", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "266", "output": "{1, 2, 133, 38, 7, 266, 14, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9341", "output": "{1, 9341}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013097", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[1, 5, 3, 3, 0, 1, 3, 1, 3]", "output": "[1, 6, 5, 6, 4, 6, 9, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2378", "output": "{1, 2, 1189, 41, 2378, 82, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2377", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013099", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "6, 3", "output": "'006'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013100", "code": "from typing import List\ndef get_unique_elements(input_list: List[int]) -> List[int]:\n    unique_elements = []\n    seen_elements = set()\n    for element in input_list:\n        if element not in seen_elements:\n            unique_elements.append(element)\n            seen_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[11, 6, 11, 10, 6, 8, 9, 9]", "output": "[11, 6, 10, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78256_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013101", "code": "def decode_order_type(order_type):\n    order_descriptions = {\n        '6': 'Last Plus Two',\n        '7': 'Last Plus Three',\n        '8': 'Sell1',\n        '9': 'Sell1 Plus One',\n        'A': 'Sell1 Plus Two',\n        'B': 'Sell1 Plus Three',\n        'C': 'Buy1',\n        'D': 'Buy1 Plus One',\n        'E': 'Buy1 Plus Two',\n        'F': 'Buy1 Plus Three',\n        'G': 'Five Level',\n        '0': 'Buy',\n        '1': 'Sell',\n        '0': 'Insert',\n        '1': 'Cancel'\n    }\n    price_type = order_type[0]\n    direction = order_type[1]\n    submit_status = order_type[2]\n    description = order_descriptions.get(price_type, 'Unknown') + ' ' + order_descriptions.get(direction, 'Unknown') + ' ' + order_descriptions.get(submit_status, 'Unknown')\n    return description\n", "entry_point": "decode_order_type", "input": "'C01'", "output": "'Buy1 Insert Cancel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95855_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013102", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[66, 66, 65, 64, 63]", "output": "[66, 66, 65]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013103", "code": "from typing import List\ndef latest_version(versions: List[str]) -> str:\n    latest_version = versions[0]\n    for version in versions[1:]:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['0.99.0', '1.00.0', '0.1.1']", "output": "'1.00.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138257_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013104", "code": "from datetime import datetime\ndef filter_items(items, last_updater_ignore):\n    filtered_items = []\n    for item in items:\n        updater = item.get('updater', '')\n        modified = datetime.strptime(item['modified_at'], '%Y-%m-%d').replace(tzinfo=None)\n        now = datetime.now()\n        if updater not in last_updater_ignore and updater != item['dev_owner'] and (now - modified).days < 5 and item['responsible'] == item['dev_owner']:\n            filtered_items.append(item)\n    return filtered_items\n", "entry_point": "filter_items", "input": "[], ''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102619_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1563", "output": "{3, 1, 1563, 521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "436", "output": "{1, 2, 4, 109, 436, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt435", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1226", "output": "{1, 1226, 2, 613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3609", "output": "{1, 3, 9, 401, 1203, 3609}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013109", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013110", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'10.22.11.beta3'", "output": "(10, 22, 11, 'beta3')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013111", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[74, 74, 74, 74], 4", "output": "74.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74521_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013112", "code": "def convert_to_indices(input_string):\n    alphabet = \"abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\\\"/\\\\|_@#$%^&*~`+-=<>()[]{} \"\n    dictionary = {char: idx for idx, char in enumerate(alphabet, start=1)}\n    indices_list = [dictionary[char] for char in input_string if char in dictionary]\n    return indices_list\n", "entry_point": "convert_to_indices", "input": "'hohello'", "output": "[8, 15, 8, 5, 12, 12, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126715_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013113", "code": "def bitonic(a, n):\n    for i in range(1, n):\n        if a[i] < a[i - 1]:\n            return i - 1\n    return -1\n", "entry_point": "bitonic", "input": "[1, 2, 3, 4, 2], 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106120_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5582", "output": "{1, 2, 5582, 2791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013115", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6997", "output": "{1, 6997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013116", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "1.0", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013117", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[0, 0, -1, 1, 5, 4, 0, 1]", "output": "[0, 0, -2, 2, 10, 8, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013118", "code": "def parse_verbosity(vargs):\n    verbosity_levels = {\n        'quiet': 0,\n        'normal': 1,\n        'verbose': 2,\n        'debug': 3\n    }\n    return verbosity_levels.get(vargs, 0)\n", "entry_point": "parse_verbosity", "input": "'debug'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71548_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013119", "code": "from typing import List\ndef min_items_to_buy(prices: List[int], budget: float) -> int:\n    prices.sort()  # Sort prices in ascending order\n    items_count = 0\n    for price in prices:\n        budget -= price\n        items_count += 1\n        if budget <= 0:\n            break\n    return items_count\n", "entry_point": "min_items_to_buy", "input": "[1, 2, 3, 4, 5], 15", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139036_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013120", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4741", "output": "{1, 11, 4741, 431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013122", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[2, 3, 5, 2, 4, 3, 1, 1, 5]", "output": "[2, 5, 10, 12, 16, 19, 20, 21, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013123", "code": "def colorize_log_message(message, log_level):\n    RESET_SEQ = \"\\033[0m\"\n    COLOR_SEQ = \"\\033[1;%dm\"\n    COL = {\n        'DEBUG': 34, 'INFO': 35,\n        'WARNING': 33, 'CRITICAL': 33, 'ERROR': 31\n    }\n    color_code = COL.get(log_level, 37)  # Default to white if log_level not found\n    colored_message = COLOR_SEQ % color_code + message + RESET_SEQ\n    return colored_message\n", "entry_point": "colorize_log_message", "input": "'This is an er message', 'UNKNOWN'", "output": "'\\x1b[1;37mThis is an er message\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1938_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013124", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 1, 5, 1, 3, 1, 2, 3]", "output": "[1, 6, 6, 4, 4, 3, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73916_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013125", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3229", "output": "{1, 3229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3228", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013126", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[2, 4, 10, 4, 5, 5, 6, 4], 8", "output": "[[2, 4, 10, 4, 5, 5, 6, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013127", "code": "def sum_of_squares_of_evens(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total_sum += num ** 2  # Add the square of the even number to the total sum\n    return total_sum\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 4, 14]", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8266_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013128", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[3, 3, 3], 10, 3", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013129", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[10]", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013130", "code": "def calculate_total_production_and_sales(records):\n    region_totals = {}\n    for record in records:\n        region = record['region']\n        production = record['production']\n        sales = record['sales']\n        if region in region_totals:\n            region_totals[region] = (region_totals[region][0] + production, region_totals[region][1] + sales)\n        else:\n            region_totals[region] = (production, sales)\n    return region_totals\n", "entry_point": "calculate_total_production_and_sales", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51915_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013131", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[80, 85, 88, 92, 100]", "output": "88.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101899_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013132", "code": "def count_connections(limbSeq):\n    unique_connections = set()\n    for connection in limbSeq:\n        unique_connections.add(tuple(sorted(connection)))  # Convert connection to tuple and sort for uniqueness\n    return len(unique_connections)\n", "entry_point": "count_connections", "input": "[(1, 2), (2, 1)]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83968_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013133", "code": "def filter_books(books, threshold):\n    filtered_books = []\n    for book in books:\n        if book.get(\"rating\", 0) >= threshold:\n            filtered_books.append(book)\n    return filtered_books\n", "entry_point": "filter_books", "input": "[{}, {}, {}, {}, {}, {}, {}], 0", "output": "[{}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111332_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "148", "output": "{1, 2, 4, 37, 74, 148}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt147", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013135", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "9, 3", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt3315", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013136", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 84, 86, 92, 100]", "output": "87.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35243_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013137", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5067", "output": "{1, 3, 9, 5067, 563, 1689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013138", "code": "def calculate_commission_rate(trading_volume_usd, user_type):\n    if user_type == 'taker':\n        if trading_volume_usd <= 100000:\n            return 0.001 * trading_volume_usd\n        elif trading_volume_usd <= 500000:\n            return 0.0008 * trading_volume_usd\n        else:\n            return 0.0006 * trading_volume_usd\n    elif user_type == 'maker':\n        if trading_volume_usd <= 100000:\n            return 0.0005 * trading_volume_usd\n        elif trading_volume_usd <= 500000:\n            return 0.0004 * trading_volume_usd\n        else:\n            return 0.0003 * trading_volume_usd\n", "entry_point": "calculate_commission_rate", "input": "75000, 'taker'", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77743_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013139", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            dp[i] = scores[i] + dp[i - 1]\n        else:\n            dp[i] = scores[i]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[10, 20, 5]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40146_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1618", "output": "{1, 1618, 2, 809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1617", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013141", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[1, 2, 7, 3, 4, 7]", "output": "[2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013142", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'kkey2=v2'", "output": "{'kkey2': 'v2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013143", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'dd919'", "output": "'dd919'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013144", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'www.example.com/no/scheme'", "output": "'www.example.com/no/scheme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013145", "code": "def scatter_nd_simple(data, indices, updates):\n    updated_data = [row[:] for row in data]  # Create a copy of the original data\n    for idx, update in zip(indices, updates):\n        row_idx, col_idx = idx\n        updated_data[row_idx][col_idx] += update\n    return updated_data\n", "entry_point": "scatter_nd_simple", "input": "[[1, 1, 3], [4, 5, 5]], [(0, 1), (1, 2)], [11, 21]", "output": "[[1, 12, 3], [4, 5, 26]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7645_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013146", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[4, 4, 4, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013147", "code": "def process_flash_messages(messages):\n    grouped_messages = {}\n    for message in messages:\n        message_type = message[\"type\"]\n        message_text = message[\"message\"]\n        if message_type in grouped_messages:\n            grouped_messages[message_type] += f\", {message_text}\"\n        else:\n            grouped_messages[message_type] = message_text\n    return grouped_messages\n", "entry_point": "process_flash_messages", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108300_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013148", "code": "def calculate_u(w, x0, n):\n    w0 = w + sum(x0)\n    u = [w0] * n\n    return u\n", "entry_point": "calculate_u", "input": "5, [6], 4", "output": "[11, 11, 11, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54111_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013149", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'AACCB'", "output": "{'A': 2, 'C': 2, 'B': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013150", "code": "def pi_svm_predict(positive_scores, test_data, threshold):\n    predicted_labels = []\n    for score in positive_scores:\n        if score >= threshold:\n            predicted_labels.append(1)  # Positive class\n        else:\n            predicted_labels.append(0)  # Unknown class\n    return predicted_labels\n", "entry_point": "pi_svm_predict", "input": "[5, 4, 7, 3], 'some_data', 5", "output": "[1, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127459_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013151", "code": "def euclid_gcd(a, b):\n    if not isinstance(a, int) or not isinstance(b, int):\n        return \"Invalid input, please provide integers.\"\n    a = abs(a)\n    b = abs(b)\n    while b != 0:\n        a, b = b, a % b\n    return a\n", "entry_point": "euclid_gcd", "input": "3, 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129293_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013152", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "47, 28, 55", "output": "47.481944444444444", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6859", "output": "{19, 1, 6859, 361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013154", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6365", "output": "{1, 67, 5, 335, 19, 1273, 6365, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013155", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'<KEY>', 'AIzBaIBB'", "output": "'AIzBaIBB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013156", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013157", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[1, 2, 4], 2", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013158", "code": "# Dictionary mapping widget names to actions or tools\nwidget_actions = {\n    \"update_rect_image\": \"Update rectangle image\",\n    \"pan\": \"Pan functionality\",\n    \"draw_line_w_drag\": \"Draw a line while dragging\",\n    \"draw_line_w_click\": \"Draw a line on click\",\n    \"draw_arrow_w_drag\": \"Draw an arrow while dragging\",\n    \"draw_arrow_w_click\": \"Draw an arrow on click\",\n    \"draw_rect_w_drag\": \"Draw a rectangle while dragging\",\n    \"draw_rect_w_click\": \"Draw a rectangle on click\",\n    \"draw_polygon_w_click\": \"Draw a polygon on click\",\n    \"draw_point_w_click\": \"Draw a point on click\",\n    \"modify_existing_shape\": \"Modify existing shape\",\n    \"color_selector\": \"Select color from color selector\",\n    \"save_kml\": \"Save as KML file\",\n    \"select_existing_shape\": \"Select an existing shape\",\n    \"remap_dropdown\": \"Remap dropdown selection\"\n}\ndef get_widget_action(widget_name):\n    return widget_actions.get(widget_name, \"Invalid Widget\")\n", "entry_point": "get_widget_action", "input": "'color_selector'", "output": "'Select color from color selector'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16004_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013159", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'aab'", "output": "{'a': 2, 'b': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013160", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'my_my_muoduem', 'some_attribute'", "output": "'Error: Module my_my_muoduem not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013161", "code": "def get_ZX_from_ZZ_XX(ZZ, XX):\n    if hasattr(ZZ, '__iter__') and len(ZZ) == len(XX):\n        return [(z, x) for z, x in zip(ZZ, XX)]\n    else:\n        return (ZZ, XX)\n", "entry_point": "get_ZX_from_ZZ_XX", "input": "[1, 2], ['a', 'b']", "output": "[(1, 'a'), (2, 'b')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141248_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013162", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[10, 15, 19, 20]", "output": "(20, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013163", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[0, 0, 1, 1, 2, 5, 5, 6, 10], 0", "output": "[0, 1, 1, 2, 5, 5, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013164", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'pnyjavatn'", "output": "'Binary path for pnyjavatn not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013165", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    total_sum = 0\n    for num in input_list:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[22]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67910_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013166", "code": "import string\ndef preprocess_sentences(sentences):\n    tokenized_sentences = []\n    for sentence in sentences:\n        # Remove punctuation and convert to lowercase\n        sentence = sentence.translate(str.maketrans('', '', string.punctuation)).lower()\n        # Tokenize using whitespace as delimiter\n        tokens = sentence.split()\n        tokenized_sentences.append(tokens)\n    return tokenized_sentences\n", "entry_point": "preprocess_sentences", "input": "['Hello, world!', 'Than.', 'You.']", "output": "[['hello', 'world'], ['than'], ['you']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49420_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013167", "code": "def sum_of_digits(n: int) -> int:\n    sum_digits = 0\n    for digit in str(n):\n        sum_digits += int(digit)\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99099_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013168", "code": "import math\ndef download_manager(file_sizes, download_speed):\n    total_time = 0\n    file_sizes.sort(reverse=True)  # Sort file sizes in descending order\n    for size in file_sizes:\n        time_to_download = size / download_speed\n        total_time += math.ceil(time_to_download)  # Round up to nearest whole number\n    return total_time\n", "entry_point": "download_manager", "input": "[5000, 5000], 100", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131368_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013169", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "17.0, 10.0", "output": "17.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2198", "output": "{1, 2, 7, 1099, 14, 2198, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2197", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013171", "code": "def extract_metadata(docstring):\n    metadata = {}\n    lines = docstring.split('\\n')\n    for line in lines:\n        if line.strip().startswith(':'):\n            key_value = line.strip().split(':', 1)\n            if len(key_value) == 2:\n                key = key_value[0][1:].strip()\n                value = key_value[1].strip()\n                metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "'\\n: \u521b\u5efa:\u6211\u65f6\u95f4:bilibili::\\n'", "output": "{'': '\u521b\u5efa:\u6211\u65f6\u95f4:bilibili::'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74221_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013172", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import wiasyncwrls'", "output": "'wiasyncwrls'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013173", "code": "def reverse_array(A):\n    B = []\n    for i in range(len(A) - 1, -1, -1):\n        B.append(A[i])\n    return B\n", "entry_point": "reverse_array", "input": "[1.0, 2.0, 3.0, 4.0]", "output": "[4.0, 3.0, 2.0, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34793_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013174", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "7", "output": "[1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013175", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4551", "output": "{1, 3, 37, 4551, 41, 1517, 111, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013176", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[90, 94.8, 92.8, 100]", "output": "93.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53561_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013177", "code": "def count_valid_groupings(n, k):\n    c1 = n // k\n    c2 = n // (k // 2)\n    if k % 2 == 1:\n        cnt = pow(c1, 3)\n    else:\n        cnt = pow(c1, 3) + pow(c2 - c1, 3)\n    return cnt\n", "entry_point": "count_valid_groupings", "input": "3, 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122726_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013178", "code": "def card_war_winner(N, deck1, deck2):\n    player1_score = 0\n    player2_score = 0\n    for i in range(N):\n        if deck1[i] > deck2[i]:\n            player1_score += 1\n        elif deck1[i] < deck2[i]:\n            player2_score += 1\n    if player1_score > player2_score:\n        return 1\n    elif player1_score < player2_score:\n        return 2\n    else:\n        return 0\n", "entry_point": "card_war_winner", "input": "1, [5], [5]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95440_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8810", "output": "{1, 2, 1762, 5, 8810, 10, 881, 4405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8809", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013180", "code": "def check_ram_size(ram_size):\n    SYSTEM_RAM_GB_MAIN = 64\n    SYSTEM_RAM_GB_SMALL = 2\n    if ram_size >= SYSTEM_RAM_GB_MAIN:\n        return \"Sufficient RAM size\"\n    elif ram_size >= SYSTEM_RAM_GB_SMALL:\n        return \"Insufficient RAM size\"\n    else:\n        return \"RAM size too small\"\n", "entry_point": "check_ram_size", "input": "1", "output": "'RAM size too small'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90224_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013181", "code": "def pack_subtasks(subtasks, bin_capacity):\n    bins = 0\n    current_bin_weight = 0\n    remaining_capacity = bin_capacity\n    for subtask in subtasks:\n        if subtask > bin_capacity:\n            bins += 1\n            current_bin_weight = 0\n            remaining_capacity = bin_capacity\n        if subtask <= remaining_capacity:\n            current_bin_weight += subtask\n            remaining_capacity -= subtask\n        else:\n            bins += 1\n            current_bin_weight = subtask\n            remaining_capacity = bin_capacity - subtask\n    if current_bin_weight > 0:\n        bins += 1\n    return bins\n", "entry_point": "pack_subtasks", "input": "[4, 5, 3, 2, 10], 10", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28590_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013182", "code": "def calculate_cumulative_sum(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 4, 2, 2, 4, 5]", "output": "[3, 7, 9, 11, 15, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126098_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013183", "code": "def calculate_edit_distance_median(edit_distances):\n    # Filter out edit distances equal to 0\n    filtered_distances = [dist for dist in edit_distances if dist != 0]\n    # Sort the filtered list\n    sorted_distances = sorted(filtered_distances)\n    length = len(sorted_distances)\n    if length == 0:\n        return 0\n    # Calculate the median\n    if length % 2 == 1:\n        return sorted_distances[length // 2]\n    else:\n        mid = length // 2\n        return (sorted_distances[mid - 1] + sorted_distances[mid]) / 2\n", "entry_point": "calculate_edit_distance_median", "input": "[3, 4]", "output": "3.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8147_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2663", "output": "{1, 2663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2662", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013185", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 87, 85, 80, 86], 5", "output": "85.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59721_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7699", "output": "{1, 7699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013187", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'jojohndj'", "output": "'jojohndj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013188", "code": "import typing\nFD_CLOEXEC = 1\nF_GETFD = 2\nF_SETFD = 3\ndef fcntl(fd: int, op: int, arg: int = 0) -> int:\n    if op == F_GETFD:\n        # Simulated logic to get file descriptor flags\n        return 777  # Placeholder value for demonstration\n    elif op == F_SETFD:\n        # Simulated logic to set file descriptor flags\n        return arg  # Placeholder value for demonstration\n    elif op == FD_CLOEXEC:\n        # Simulated logic to handle close-on-exec flag\n        return 1  # Placeholder value for demonstration\n    else:\n        raise ValueError(\"Invalid operation\")\n", "entry_point": "fcntl", "input": "0, F_SETFD, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147416_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013189", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'es_send_ge_as=True, '", "output": "{'es_send_ge_as': 'True', '': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013190", "code": "from typing import List\ndef calculate_average_score(scores: List[int], threshold: int) -> float:\n    valid_scores = [score for score in scores if score >= threshold]\n    if not valid_scores:\n        return 0.0  # Return 0 if no scores are above the threshold\n    total_valid_scores = sum(valid_scores)\n    average_score = total_valid_scores / len(valid_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[78, 79], 78", "output": "78.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74900_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013191", "code": "def cmdline(args):\n    variables = {}\n    processed_args = []\n    for arg in args:\n        if arg.startswith(\"--\"):\n            key_value = arg[2:].split(\"=\")\n            if len(key_value) == 2:\n                key, value = key_value\n                variables[key] = value\n        else:\n            processed_arg = arg\n            for var_key, var_value in variables.items():\n                processed_arg = processed_arg.replace(f\"${{{var_key}}}\", var_value)\n            processed_args.append(processed_arg)\n    return \" \".join(processed_args)\n", "entry_point": "cmdline", "input": "['--x=5', 'x=${x}']", "output": "'x=5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22008_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013192", "code": "from typing import List\ndef calculate_score(deck: List[int]) -> int:\n    score = 0\n    prev_card = None\n    for card in deck:\n        if card == prev_card:\n            score = 0\n        else:\n            score += card\n        prev_card = card\n    return score\n", "entry_point": "calculate_score", "input": "[10, 20, 30, 37]", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107329_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4729", "output": "{1, 4729}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013194", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[2, 1, 5, 0, 1, 2]", "output": "[1, 3, 6, 5, 1, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013195", "code": "from typing import List\ndef check_unique_service_names(service_names: List[str]) -> bool:\n    seen_names = set()\n    for name in service_names:\n        if name in seen_names:\n            return False\n        seen_names.add(name)\n    return True\n", "entry_point": "check_unique_service_names", "input": "[]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135580_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013196", "code": "import re\ndef fuzzy_finder(user_input, collection):\n    suggestions = []\n    pattern = '.*'.join(user_input)\n    regex = re.compile(pattern)\n    for item in collection:\n        match = regex.search(item)\n        if match:\n            suggestions.append(item)\n    return suggestions\n", "entry_point": "fuzzy_finder", "input": "'abc', ['abc', 'abdc']", "output": "['abc', 'abdc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25426_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013197", "code": "def jaccard_similarity_coefficient(x, y):\n    set_x = set(x)\n    set_y = set(y)\n    intersection_size = len(set_x.intersection(set_y))\n    union_size = len(set_x.union(set_y))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    return intersection_size / union_size\n", "entry_point": "jaccard_similarity_coefficient", "input": "[1, 2], [1, 2, 3, 4]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77613_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013198", "code": "def count_backtick_patterns(text: str) -> int:\n    count = 0\n    index = 0\n    while index < len(text) - 2:\n        if text[index] == '`' and text[index + 1] == '`' and text[index + 2] != '`':\n            count += 1\n            index += 2  # Skip the next two characters\n        index += 1\n    return count\n", "entry_point": "count_backtick_patterns", "input": "'`` a`` b'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14469_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013199", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "12.0, 9.0, 100", "output": "(1.0, 0.03333333333333333)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013200", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6905", "output": "{1, 5, 1381, 6905}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013201", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[2, -2, 1, 3, 3, -3, -3]", "output": "[2, -2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013202", "code": "def extract_base_directory(file_path):\n    base_dir = \"\"\n    for i in range(len(file_path) - 1, -1, -1):\n        if file_path[i] == '/':\n            base_dir = file_path[:i]\n            break\n    return base_dir\n", "entry_point": "extract_base_directory", "input": "'/home/user/documents/file.txt'", "output": "'/home/user/documents'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67520_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "853", "output": "{1, 853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013204", "code": "from itertools import permutations\ndef find_permutations(p):\n    nums = []\n    for n in p:\n        if n < 3330 and (n + 3330) in p:\n            nums.append(n)\n        elif (n - 3330) in p:\n            nums.append(n)\n    result = []\n    for n in nums:\n        if len(str(n)) < 4:\n            continue\n        chars = [x for x in str(n)]\n        perms = [''.join(perm) for perm in permutations(chars)]\n        if str(n) in perms and str(n + 3330) in perms and str(n + 6660) in perms:\n            if n in nums and n + 3330 in nums and n + 6660 in nums:\n                result.append((n, n + 3330, n + 6660))\n    return result\n", "entry_point": "find_permutations", "input": "[1, 2, 3]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94299_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013205", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[0, 1, 1, 1, 0]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013206", "code": "from typing import List\ndef calculate_sum_max_odd(input_list: List[int]) -> int:\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd if sum_even > 0 else 0\n", "entry_point": "calculate_sum_max_odd", "input": "[2, 4, 6, 8, 4, 7]", "output": "168", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134591_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013207", "code": "def perform_operation(operation=\"add\", operand1=0, operand2=0):\n    if operation == \"add\":\n        return operand1 + operand2\n    elif operation == \"subtract\":\n        return operand1 - operand2\n    elif operation == \"multiply\":\n        return operand1 * operand2\n    elif operation == \"divide\":\n        if operand2 != 0:\n            return operand1 / operand2\n        else:\n            return \"Error: Division by zero\"\n    else:\n        return \"Error: Invalid operation\"\n", "entry_point": "perform_operation", "input": "'add', 6, 6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52158_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013208", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5833", "output": "{1, 19, 5833, 307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013209", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 3, 5]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1915", "output": "{1, 1915, 5, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1914", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013211", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'ocrcErrco', 5, 5", "output": "'5: ocrcErrco'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013212", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'dwdd'", "output": "{'dwdd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013213", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'2.11.41.4..3', '010.5.0'", "output": "'2.11.41.4..3 to 010.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013214", "code": "def removeElement(nums, val):\n    \"\"\"\n    :type nums: List[int]\n    :type val: int\n    :rtype: int\n    \"\"\"\n    nums[:] = [num for num in nums if num != val]\n    return len(nums)\n", "entry_point": "removeElement", "input": "[1, 2, 3, 3, 3, 4, 5, 6, 3, 7], 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53354_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013215", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 85, 85.5, 86, 90]", "output": "85.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88301_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013216", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 0, 1, 2, 2, 1, 3]", "output": "[1, 3, 6, 4, 4, 5, 5, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013217", "code": "# Dictionary mapping route names to URL endpoints\nroute_urls = {\n    'me': '/me',\n    'put': '/users',\n    'show': '/users/<string:username>',\n    'search': '/users/search',\n    'user_news_feed': '/users/<string:uuid>/feed',\n    'follow': '/follow/<string:username>',\n    'unfollow': '/unfollow/<string:username>',\n    'followers': '/followers',\n    'following': '/following',\n    'groups': '/groups',\n    'create_group': '/groups',\n    'update_group': '/groups',\n    'delete_group': '/groups',\n    'show_group': '/groups/<string:uuid>',\n    'add_user_to_group': '/groups/<string:uuid>/add_user/<string:user_uuid>'\n}\ndef get_url_for_route(route_name):\n    return route_urls.get(route_name, 'Route not found')\n", "entry_point": "get_url_for_route", "input": "'show_group'", "output": "'/groups/<string:uuid>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44563_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013218", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 1, 3]", "output": "[5, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112058_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013219", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8953", "output": "{1, 1279, 8953, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8952", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "909", "output": "{1, 3, 101, 9, 909, 303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013221", "code": "def modify_list(int_list, str_list):\n    modified_list = int_list + [int(x) for x in str_list]  # Extend int_list with elements from str_list\n    modified_list.insert(0, 12)  # Insert 12 at the beginning of modified_list\n    modified_list.reverse()  # Reverse the elements of modified_list\n    modified_list.sort(reverse=True)  # Sort modified_list in descending order\n    return modified_list\n", "entry_point": "modify_list", "input": "[789, 456, 123], ['8', '7', '6']", "output": "[789, 456, 123, 12, 8, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50028_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013222", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    total_sum = 0\n    for num in input_list:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67910_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013223", "code": "def generate_package_info(setup_args):\n    package_info = \"\"\n    for key in ['name', 'description', 'license', 'url', 'maintainer']:\n        if key in setup_args:\n            package_info += f\"{key.capitalize()}: {setup_args[key]}\\n\"\n    return package_info\n", "entry_point": "generate_package_info", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9599", "output": "{1, 331, 29, 9599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013225", "code": "from typing import List, Dict\ndef filter_hosts(hosts: List[Dict[str, str]], status: str) -> List[str]:\n    filtered_hosts = []\n    for host in hosts:\n        if host['status'] == status:\n            filtered_hosts.append(host['name'])\n    return filtered_hosts\n", "entry_point": "filter_hosts", "input": "[], 'active'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95281_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013226", "code": "def time_diff(time1, time2):\n    def time_to_seconds(time_str):\n        h, m, s = map(int, time_str.split(':'))\n        return h * 3600 + m * 60 + s\n    total_seconds1 = time_to_seconds(time1)\n    total_seconds2 = time_to_seconds(time2)\n    time_difference = abs(total_seconds1 - total_seconds2)\n    return time_difference\n", "entry_point": "time_diff", "input": "'12:30:00', '12:30:00'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35063_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013227", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "0, {1: True, 2: False, 3: True, 4: True, 5: False}", "output": "[1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013228", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[20, 30, 10, 1]", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013229", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "3, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013230", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[20, 15, 17]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013231", "code": "def calculate_char_counts(strings):\n    char_counts = {}  # Initialize an empty dictionary to store the results\n    for string in strings:\n        char_counts[string] = len(string)  # Calculate the length of each string and store in the dictionary\n    return char_counts\n", "entry_point": "calculate_char_counts", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96287_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013232", "code": "def compute_dist_excluding_gaps(ref_seq, seq):\n    matching_count = 0\n    for ref_char, seq_char in zip(ref_seq, seq):\n        if ref_char != '-' and seq_char != '-' and ref_char == seq_char:\n            matching_count += 1\n    distance = 1 - (matching_count / len(seq))\n    return distance\n", "entry_point": "compute_dist_excluding_gaps", "input": "'A-B', 'C-D'", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47319_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013233", "code": "def process_contributions(contributions):\n    for contribution in contributions:\n        contribution['role'] = 1 if contribution['can_edit'] else 0\n        contribution['can_edit'] = contribution['role'] == 1\n    return contributions\n", "entry_point": "process_contributions", "input": "[{'can_edit': False}]", "output": "[{'can_edit': False, 'role': 0}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93886_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013234", "code": "def calculate_hamming_dist(uploaded_hash, db_store_hash):\n    count = 0\n    for i in range(len(uploaded_hash)):\n        if uploaded_hash[i] != db_store_hash[i]:\n            count += 1\n    return count\n", "entry_point": "calculate_hamming_dist", "input": "'abcde', 'abCde'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4669_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013235", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013236", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7591", "output": "{1, 7591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013237", "code": "from typing import List\ndef min_steps_to_reach_end(cave: List[int], threshold: int) -> int:\n    n = len(cave)\n    dp = [float('inf')] * n\n    dp[0] = 0\n    for i in range(1, n):\n        for j in range(i):\n            if abs(cave[i] - cave[j]) <= threshold:\n                dp[i] = min(dp[i], dp[j] + 1)\n    return dp[-1]\n", "entry_point": "min_steps_to_reach_end", "input": "[0, 1], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32739_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013238", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'rt'", "output": "'rt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013239", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1202", "output": "{601, 1, 1202, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013240", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 2, 2, 4, 5, 2, 5, 7]", "output": "[7, 7, 4, 9, 9, 4, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013241", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5959", "output": "{1, 59, 101, 5959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013242", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "9", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013243", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2311", "output": "{1, 2311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013244", "code": "def sum_divisible_by_3_and_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 15, 15, 15, 15]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55321_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013245", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "12, 5, 3", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013246", "code": "import re\ndef count_unique_words(text_content):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', text_content.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'h'", "output": "{'h': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013247", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[95, 100], 2", "output": "97.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013248", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "124, {}", "output": "'124-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013249", "code": "def sum_multiples_of_3_or_5(input_list):\n    total_sum = 0\n    seen_multiples = set()  # To avoid counting multiples of both 3 and 5 twice\n    for num in input_list:\n        if num % 3 == 0 and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n        elif num % 5 == 0 and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 6, 12]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26577_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013250", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "3996716944887174144, 1", "output": "3996716944887174144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013251", "code": "def simulate_reformat_temperature_data(raw_data):\n    # Simulate processing the data using a hypothetical script 'reformat_weather_data.py'\n    # In this simulation, we will simply reverse the input data as an example\n    reformatted_data = raw_data[::-1]\n    return reformatted_data\n", "entry_point": "simulate_reformat_temperature_data", "input": "'30,25,28,32,27'", "output": "'72,23,82,52,03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136307_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013252", "code": "def find_unique_number(nums):\n    unique_num = 0\n    for num in nums:\n        unique_num ^= num\n    return unique_num\n", "entry_point": "find_unique_number", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126841_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013253", "code": "def manipulate_presets(presets: list, status: str) -> list:\n    if status == 'add':\n        presets.append({'name': 'New Preset'})\n    elif status == 'remove':\n        if presets:\n            presets.pop()\n    elif status == 'clear':\n        presets.clear()\n    elif status == 'display':\n        return presets\n    else:\n        return 'Invalid status'\n    return presets\n", "entry_point": "manipulate_presets", "input": "[], 'add'", "output": "[{'name': 'New Preset'}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14782_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013254", "code": "def diagonal_difference(arr):\n    n = len(arr)\n    d1 = sum(arr[i][i] for i in range(n))  # Sum of main diagonal elements\n    d2 = sum(arr[i][n-i-1] for i in range(n))  # Sum of secondary diagonal elements\n    return abs(d1 - d2)\n", "entry_point": "diagonal_difference", "input": "[[10, 0, 0], [0, 20, 0], [0, 0, 5]]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25195_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3227", "output": "{1, 3227, 461, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3226", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8042", "output": "{1, 8042, 2, 4021}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8041", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013257", "code": "from typing import List\nfrom importlib.util import find_spec\nfrom importlib import import_module\nfrom types import ModuleType\ndef import_modules(module_names: List[str]) -> List[ModuleType]:\n    imported_modules = []\n    for module_name in module_names:\n        if find_spec(module_name):\n            try:\n                imported_module = import_module(module_name)\n                imported_modules.append(imported_module)\n            except ModuleNotFoundError:\n                pass\n    return imported_modules\n", "entry_point": "import_modules", "input": "['non_existing_module']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90950_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013258", "code": "def final_value(S):\n    X = 0\n    for c in S:\n        if c == 'L':\n            X = 2 * X\n        if c == 'R':\n            X = 2 * X + 1\n        if c == 'U':\n            X //= 2\n    return X\n", "entry_point": "final_value", "input": "'LRR'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33325_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5007", "output": "{1, 3, 1669, 5007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013260", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 5, 3, 5, 2, 5, 4, 5, 5]", "output": "[0, 6, 10, 24, 24, 50, 60, 84, 104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013261", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "{1}, {-3}, {3}, {4}", "output": "[1, -3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013262", "code": "def generate_url(endpoint_key: str, params: dict) -> str:\n    URL = {\n        'base': 'https://{platform}.api.riotgames.com/lol/{url}',\n        'champion-mastery-by-summoner-id': 'champion-mastery/v{version}/champion-masteries/by-summoner/{summoner_id}',\n        'champions-by-champion-id': 'platform/v{version}/champions/{champion_id}',\n        'champions': 'platform/v{version}/champions',\n        'league-by-summoner-id': 'league/v{version}/positions/by-summoner/{summoner_id}',\n        'lol-static-data': 'static-data/v{version}/{category}',\n        'lol-status': 'status/v{version}/shard-data',\n        'match-by-match-id': 'match/v{version}/matches/{match_id}',\n        'match-lists-by-account-id': 'match/v{version}/matchlists/by-account/{account_id}',\n        'spectator-by-summoner-id': 'spectator/v{version}/active-games/by-summoner/{summoner_id}',\n        'summoner-by-name': 'summoner/v{version}/summoners/by-name/{name}',\n    }\n    if endpoint_key not in URL:\n        return \"Endpoint key not found in URL dictionary\"\n    url_template = URL[endpoint_key]\n    formatted_url = url_template.format(**params)\n    return formatted_url\n", "entry_point": "generate_url", "input": "'invalid-endpoint', {}", "output": "'Endpoint key not found in URL dictionary'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93821_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013263", "code": "from collections import Counter\ndef task_scheduler(tasks, n):\n    task_freq = Counter(tasks)\n    max_freq = max(task_freq.values())\n    idle_time = (max_freq - 1) * n\n    for task, freq in task_freq.items():\n        idle_time -= min(freq, max_freq - 1)\n    idle_time = max(0, idle_time)\n    return len(tasks) + idle_time\n", "entry_point": "task_scheduler", "input": "['A', 'A', 'A', 'B', 'B', 'B'], 1", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48302_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013264", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "9, 0", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013265", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'folder/ho.txt'", "output": "'ho.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013266", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "871", "output": "{1, 67, 13, 871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013267", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "6", "output": "[1, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013268", "code": "from typing import List\nimport heapq\ndef reconstruct_sequence(freq_list: List[int]) -> List[int]:\n    pq = []\n    for i, freq in enumerate(freq_list):\n        heapq.heappush(pq, (freq, i+1))\n    result = []\n    while pq:\n        freq, elem = heapq.heappop(pq)\n        result.append(elem)\n        freq -= 1\n        if freq > 0:\n            heapq.heappush(pq, (freq, elem))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 3, 1, 2, 3, 3]", "output": "[1, 3, 4, 4, 2, 2, 2, 5, 5, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41932_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013269", "code": "from typing import List\ndef custom_reduce_product(nums: List[int]) -> int:\n    result = 1\n    for num in nums:\n        result *= num\n    return result\n", "entry_point": "custom_reduce_product", "input": "[1, 2, 3, 4, 5]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84659_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5038", "output": "{1, 2, 229, 458, 11, 5038, 22, 2519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5037", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013271", "code": "def reverseOnlyLetters(s: str) -> str:\n    i = 0\n    j = len(s) - 1\n    m = list(range(65, 91)) + list(range(97, 123))\n    s = list(s)\n    while i < j:\n        if ord(s[i]) not in m:\n            i += 1\n            continue\n        if ord(s[j]) not in m:\n            j -= 1\n            continue\n        s[i], s[j] = s[j], s[i]\n        i += 1\n        j -= 1\n    return \"\".join(s)\n", "entry_point": "reverseOnlyLetters", "input": "'aaad'", "output": "'daaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123278_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013272", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "2, 6", "output": "[3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013273", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'The quick brown fox'", "output": "'The,quick,brown,fox'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013274", "code": "def process_commands(input_str):\n    running_total = 0\n    commands = input_str.split()\n    for command in commands:\n        op = command[0]\n        if len(command) > 1:\n            num = int(command[1:])\n        else:\n            num = 0\n        if op == 'A':\n            running_total += num\n        elif op == 'S':\n            running_total -= num\n        elif op == 'M':\n            running_total *= num\n        elif op == 'D' and num != 0:\n            running_total //= num\n        elif op == 'R':\n            running_total = 0\n    return running_total\n", "entry_point": "process_commands", "input": "'R S1'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106417_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013275", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "79", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013276", "code": "def longest_consecutive_subsequence(lst):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1] + 1:\n            current_length += 1\n        else:\n            if current_length > max_length:\n                max_length = current_length\n                start_index = i - current_length\n            current_length = 1\n    if current_length > max_length:\n        max_length = current_length\n        start_index = len(lst) - current_length\n    return lst[start_index:start_index + max_length]\n", "entry_point": "longest_consecutive_subsequence", "input": "[2]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62550_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013277", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'filffileilfiflfe'", "output": "'filffileilfiflfe_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013278", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[2, 2, 2, 0, 1, 3, 8]", "output": "[0, 1, 2, 2, 2, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013279", "code": "def calculate_sentiment_score(text, sentiment_scores):\n    words = text.split()\n    total_score = 0\n    word_count = 0\n    for word in words:\n        word = word.lower().strip('.,!?')\n        if word in sentiment_scores:\n            total_score += sentiment_scores[word]\n            word_count += 1\n    if word_count == 0:\n        return 0\n    else:\n        return total_score / word_count\n", "entry_point": "calculate_sentiment_score", "input": "'', {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112397_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013280", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[1, 4, 4, 7]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013281", "code": "def closest_three_sum(nums, target):\n    nums.sort()\n    closest_sum = float('inf')\n    closest_diff = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            current_diff = abs(current_sum - target)\n            if current_diff < closest_diff:\n                closest_sum = current_sum\n                closest_diff = current_diff\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return current_sum\n    return closest_sum\n", "entry_point": "closest_three_sum", "input": "[-1, 0, 1, 2, 3], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34495_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013282", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "-3, -2", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013283", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'125/68950'", "output": "('125', '68950')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6197", "output": "{1, 6197}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6196", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013285", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "7", "output": "[1, 4, 2, 1, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013286", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2203", "output": "{1, 2203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013287", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'1.21.1', 8076", "output": "'http://1.21.1:8076'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013288", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    a, b = 0, 1\n    for _ in range(N):\n        fib_sum += a\n        a, b = b, a + b\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92640_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1769", "output": "{1, 29, 61, 1769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "495", "output": "{1, 33, 3, 99, 5, 165, 9, 11, 45, 495, 15, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013291", "code": "from typing import List\ndef calculate_average_test_score(test_scores: List[int]) -> int:\n    total_score = 0\n    for score in test_scores:\n        total_score += score\n    average = total_score / len(test_scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_test_score", "input": "[88, 88, 88, 87, 87]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87338_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2589", "output": "{1, 3, 2589, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8522", "output": "{1, 8522, 2, 4261}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013294", "code": "def check_word(word):\n    letters = [\"a\", \"e\", \"t\", \"o\", \"u\"]\n    if len(word) < 7:\n        return 2\n    if (word[1] in letters) and (word[6] in letters):\n        return 0\n    elif (word[1] in letters) or (word[6] in letters):\n        return 1\n    else:\n        return 2\n", "entry_point": "check_word", "input": "'hello'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56928_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013295", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'some.prefix.yCigConfig'", "output": "'yCig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013296", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'bc'", "output": "['bc', 'cb']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013297", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'UUR'", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013298", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[5.2, 5.2, 5.2]", "output": "5.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013299", "code": "from typing import List\ndef sum_divisible_by_divisor(numbers: List[float], divisor: float) -> float:\n    tolerance = 1e-7\n    total_sum = 0.0\n    for num in numbers:\n        if abs(num % divisor) < tolerance:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_divisor", "input": "[0.5, 1.1, 2.3], 1.0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129528_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013300", "code": "def calculate_average(nums: list) -> float:\n    if len(nums) <= 1:\n        return 0\n    min_val = min(nums)\n    max_val = max(nums)\n    remaining_nums = [num for num in nums if num != min_val and num != max_val]\n    if not remaining_nums:\n        return 0\n    return sum(remaining_nums) / len(remaining_nums)\n", "entry_point": "calculate_average", "input": "[1, 5, 5, 5, 9]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144900_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013301", "code": "def max_consecutive_elements(lst):\n    if not lst:\n        return 0\n    max_count = 0\n    current_count = 1\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1]:\n            current_count += 1\n        else:\n            max_count = max(max_count, current_count)\n            current_count = 1\n    max_count = max(max_count, current_count)\n    return max_count\n", "entry_point": "max_consecutive_elements", "input": "[1, 1, 2, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27992_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7928", "output": "{1, 2, 4, 8, 7928, 3964, 1982, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7927", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013303", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[3, 7, 1, 2, 4, 6, 5]", "output": "[2, 3, 1, 1, 1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013304", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "(9, 11, 31), 10", "output": "(0.9, 1.1, 31)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013305", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.0.0'", "output": "(1, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013306", "code": "def find_latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_version = tuple(map(int, latest_version.split('.')))\n            new_version = tuple(map(int, version.split('.')))\n            if new_version > current_version:\n                latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['22.20', '22.21', '22.19']", "output": "'22.21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92338_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013307", "code": "from typing import List\ndef maximize_min_distance(a: List[int], M: int) -> int:\n    a.sort()\n    def is_ok(mid):\n        last = a[0]\n        count = 1\n        for i in range(1, len(a)):\n            if a[i] - last >= mid:\n                count += 1\n                last = a[i]\n        return count >= M\n    left, right = 0, a[-1] - a[0]\n    while left < right:\n        mid = (left + right + 1) // 2\n        if is_ok(mid):\n            left = mid\n        else:\n            right = mid - 1\n    return left\n", "entry_point": "maximize_min_distance", "input": "[0, 5, 10], 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013308", "code": "def get_brand_purchase_deets(customers, purchases):\n    brand_purchase_deets = {}\n    for customer, purchase in zip(customers, purchases):\n        brand = purchase % 3\n        if customer not in brand_purchase_deets:\n            brand_purchase_deets[customer] = {}\n        if brand not in brand_purchase_deets[customer]:\n            brand_purchase_deets[customer][brand] = 1\n        else:\n            brand_purchase_deets[customer][brand] += 1\n    return brand_purchase_deets\n", "entry_point": "get_brand_purchase_deets", "input": "[1, 0, 2, -1], [0, 2, 4, 5]", "output": "{1: {0: 1}, 0: {2: 1}, 2: {1: 1}, -1: {2: 1}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14257_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5095", "output": "{1, 1019, 5, 5095}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013310", "code": "def split_video_names(video_files, threshold):\n    long_names = []\n    short_names = []\n    for video_file in video_files:\n        file_name, extension = video_file.split('.')\n        if len(file_name) >= threshold:\n            long_names.append(file_name)\n        else:\n            short_names.append(file_name)\n    return long_names, short_names\n", "entry_point": "split_video_names", "input": "[], 0", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9323_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013311", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[1, 3, 4, 5]", "output": "{1, 3, 4, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013312", "code": "def calculate_grayscale(r: int, g: int, b: int) -> int:\n    grayscale = int(0.299 * r + 0.587 * g + 0.114 * b)\n    return grayscale\n", "entry_point": "calculate_grayscale", "input": "0, 1, 8", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80937_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013313", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9077", "output": "{1, 29, 9077, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013314", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "886", "output": "{1, 2, 443, 886}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013315", "code": "def chatbot(user_input):\n    user_input = user_input.lower()  # Convert input to lowercase for case-insensitive matching\n    if \"hello\" in user_input or \"hi\" in user_input:\n        return \"Hello! How can I assist you today?\"\n    elif \"weather\" in user_input:\n        return \"The weather is sunny today.\"\n    elif \"bye\" in user_input or \"goodbye\" in user_input:\n        return \"Goodbye! Have a great day!\"\n    else:\n        return \"I'm sorry, I didn't understand that.\"\n", "entry_point": "chatbot", "input": "'goodbye'", "output": "'Goodbye! Have a great day!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98572_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013316", "code": "def process_env_list(env_list):\n    env_dict = {}\n    for env_name, is_visualized in env_list:\n        env_dict[env_name] = is_visualized\n    return env_dict\n", "entry_point": "process_env_list", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138945_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013317", "code": "def minimize_difference(A):\n    total = sum(A)\n    m = float('inf')\n    left_sum = 0\n    for n in A[:-1]:\n        left_sum += n\n        v = abs(total - 2 * left_sum)\n        if v < m:\n            m = v\n    return m\n", "entry_point": "minimize_difference", "input": "[1, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1116_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013318", "code": "def quickSort(A, si, ei):\n    comparison_count = [0]  # Initialize comparison count as a list to allow pass by reference\n    def partition(A, si, ei):\n        x = A[ei]  # x is pivot, last element\n        i = si - 1\n        for j in range(si, ei):\n            comparison_count[0] += 1  # Increment comparison count for each comparison made\n            if A[j] <= x:\n                i += 1\n                A[i], A[j] = A[j], A[i]\n        A[i + 1], A[ei] = A[ei], A[i + 1]\n        return i + 1\n    def _quickSort(A, si, ei):\n        if si < ei:\n            pi = partition(A, si, ei)\n            _quickSort(A, si, pi - 1)\n            _quickSort(A, pi + 1, ei)\n    _quickSort(A, si, ei)\n    return comparison_count[0]\n", "entry_point": "quickSort", "input": "[3, 6, 2, 8, 4, 1], 0, 5", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125182_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013319", "code": "from datetime import datetime\ndef match(pattern, observations):\n    operator_mapping = {\n        '=': lambda x, y: x == y,\n        '!=': lambda x, y: x != y,\n        '<=': lambda x, y: x <= y,\n        '>=': lambda x, y: x >= y,\n        'IN': lambda x, y: x in y,\n        'NOT IN': lambda x, y: x not in y\n    }\n    field, operator, timestamp_str = pattern.split(' ')\n    timestamp_str = timestamp_str[2:-2]  # Extract timestamp value without 't' and 'Z'\n    for observation in observations:\n        if field in observation:\n            observation_timestamp = observation[field]\n            if 'Z' in observation_timestamp:\n                observation_timestamp = datetime.strptime(observation_timestamp, \"t'%Y-%m-%dT%H:%M:%SZ'\")\n            else:\n                observation_timestamp = datetime.strptime(observation_timestamp, \"t'%Y-%m-%dT%H:%M:%S'\")\n            pattern_timestamp = datetime.strptime(timestamp_str, \"%Y-%m-%dT%H:%M:%S\")\n            if operator in operator_mapping:\n                if operator_mapping[operator](observation_timestamp, pattern_timestamp):\n                    return True\n    return False\n", "entry_point": "match", "input": "'nonexistent_field >= 2021-01-01T00:00:00', [{'some_field': 'value'}]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86759_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013320", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.622.2', 62", "output": "'2.622.2.62'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013321", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "4", "output": "[0, 0, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013322", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1501", "output": "1461", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013323", "code": "def find_longest_sequence(dice_rolls):\n    if not dice_rolls:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(dice_rolls)):\n        if dice_rolls[i] == dice_rolls[i - 1] + 1:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "find_longest_sequence", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10121_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3593", "output": "{1, 3593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013325", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "81, 1", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2987", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2795", "output": "{1, 65, 5, 2795, 43, 13, 559, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2794", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1011", "output": "{3, 1, 1011, 337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013328", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[85, 90, 91, 92, 92, 95]", "output": "91.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88301_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013329", "code": "def elementwise_division(a, b):\n    if isinstance(a[0], list):  # Check if a is a 2D list\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [[x / y for x, y in zip(row_a, row_b)] for row_a, row_b in zip(a, b)]\n    else:  # Assuming a and b are 1D lists\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [x / y for x, y in zip(a, b)]\n", "entry_point": "elementwise_division", "input": "[0.5, 0.5, 0.5], [1, 1, 1]", "output": "[0.5, 0.5, 0.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108971_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013330", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'gglglean_gg', 10", "output": "'gglglean_gg_high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013331", "code": "def extract_patterns(input_string):\n    patterns = set()\n    current_char = ''\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count >= 3:\n                patterns.add(current_char * char_count)\n            current_char = char\n            char_count = 1\n    if char_count >= 3:\n        patterns.add(current_char * char_count)\n    return list(patterns)\n", "entry_point": "extract_patterns", "input": "'ccc'", "output": "['ccc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59421_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "673", "output": "{1, 673}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013333", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'Mppy'", "output": "'mppy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013334", "code": "def maxTurbulenceSize(A):\n    ans = 1\n    start = 0\n    for i in range(1, len(A)):\n        c = (A[i-1] > A[i]) - (A[i-1] < A[i])\n        if c == 0:\n            start = i\n        elif i == len(A)-1 or c * ((A[i] > A[i+1]) - (A[i] < A[i+1])) != -1:\n            ans = max(ans, i - start + 1)\n            start = i\n    return ans\n", "entry_point": "maxTurbulenceSize", "input": "[1, 3, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41497_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013335", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[1, 10, 20, 30]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013336", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(0, 16, 16)", "output": "'0.16.16'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013337", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[99, 91, 80, 70, 50], 2", "output": "[99, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013338", "code": "def unicode_converter(input_string):\n    result = \"\"\n    for char in input_string:\n        code_point = ord(char)\n        result += f\"\\\\u{format(code_point, 'x')}\"\n    return result\n", "entry_point": "unicode_converter", "input": "'hel'", "output": "'\\\\u68\\\\u65\\\\u6c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4025_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1184", "output": "{1184, 1, 2, 32, 4, 37, 296, 8, 74, 592, 16, 148}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1183", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013340", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9157", "output": "{1, 9157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013341", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7916", "output": "{1, 2, 4, 7916, 3958, 1979}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7915", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013342", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "0.02, 1", "output": "0.02", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013343", "code": "def generate_composite_keyframe(keyframes):\n    composite_keyframe = {}\n    key_values_map = {}\n    for keyframe in keyframes:\n        key_time = keyframe['KeyTime']\n        key_values = keyframe['KeyValues']\n        if key_time in key_values_map:\n            key_values_map[key_time] = [sum(pair) for pair in zip(key_values_map[key_time], key_values)]\n        else:\n            key_values_map[key_time] = key_values\n    for key_time, key_values in key_values_map.items():\n        composite_keyframe[key_time] = key_values\n    return composite_keyframe\n", "entry_point": "generate_composite_keyframe", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66743_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013344", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'ex80', ''", "output": "'ws://ex80//sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013345", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7249", "output": "{7249, 1, 11, 659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013346", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[6, 2, 5, 1, 3]", "output": "[6, 2, 5, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013347", "code": "def string_replace(to_find_string: str, replace_string: str, target_string: str) -> str:\n    index = target_string.find(to_find_string)\n    if index == -1:\n        return target_string\n    beginning = target_string[:index]\n    end = target_string[index + len(to_find_string):]\n    new_string = beginning + replace_string + end\n    return new_string\n", "entry_point": "string_replace", "input": "'cat', 'dog', 'cat.'", "output": "'dog.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61704_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013348", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    # Sort the dictionary by values in descending order\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "word_frequency", "input": "'helllo'", "output": "{'helllo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86121_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013349", "code": "def translate_data_type(pandas_type):\n    pandas_datatype_names = {\n        'object': 'string',\n        'int64': 'integer',\n        'float64': 'double',\n        'bool': 'boolean',\n        'datetime64[ns]': 'datetime'\n    }\n    return pandas_datatype_names.get(pandas_type, 'unknown')\n", "entry_point": "translate_data_type", "input": "'int64'", "output": "'integer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9746_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013350", "code": "def candy(A):\n    candies = [1] * len(A)\n    # Forward pass\n    for i in range(1, len(A)):\n        if A[i] > A[i - 1]:\n            candies[i] = candies[i - 1] + 1\n    result = candies[-1]\n    # Backward pass\n    for i in range(len(A) - 2, -1, -1):\n        if A[i] > A[i + 1]:\n            candies[i] = max(candies[i], candies[i + 1] + 1)\n        result += candies[i]\n    return result\n", "entry_point": "candy", "input": "[1, 2, 3, 2, 1, 2]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54117_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6223", "output": "{1, 7, 6223, 49, 889, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013352", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'Hello world!'", "output": "'Hello                                 world!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013353", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[0, 3, 4, 1, 4, 1, 3, -1]", "output": "[0, 3, 7, 8, 12, 13, 16, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013354", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/users/adam', '/users/home'", "output": "'../home'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013355", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'module.o'", "output": "'o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013356", "code": "def calculate_total_time(jobs):\n    total_time = 0\n    for duration in jobs:\n        total_time += duration\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84145_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "874", "output": "{1, 2, 38, 874, 46, 19, 437, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7678", "output": "{1, 2, 11, 22, 698, 349, 7678, 3839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013359", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2517", "output": "{1, 3, 2517, 839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013360", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'user set XinXtett'", "output": "'XinXtett'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013361", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5271", "output": "{1, 3, 7, 753, 21, 5271, 251, 1757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013362", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5945", "output": "{1, 1189, 5, 41, 205, 145, 5945, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013363", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 90, 89, 85, 85, 79]", "output": "[99, 90, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148811_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013364", "code": "def extract_blocks(input_string):\n    blocks = []\n    inside_block = False\n    current_block = \"\"\n    for char in input_string:\n        if char == '\"' and not inside_block:\n            inside_block = True\n            current_block = \"\"\n        elif char == '\"' and inside_block:\n            inside_block = False\n            blocks.append(current_block)\n        elif inside_block:\n            current_block += char\n    return blocks\n", "entry_point": "extract_blocks", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141650_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013365", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6124", "output": "{1, 2, 4, 6124, 3062, 1531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6123", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013366", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[4, 6], 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013367", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[70, 72, 70], 3", "output": "70.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013368", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[2, 3, 7, 0, 8, 0, 7]", "output": "[0, 0, 2, 3, 7, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013369", "code": "from typing import List\ndef max_sum_subarray(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sum_subarray", "input": "[1, 1, 1, -1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101809_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013370", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'DoJohnDJoSmithJohnDJ'", "output": "'Do john d jo smith john d j'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3637", "output": "{1, 3637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013372", "code": "import logging\nimport urllib.request\nimport urllib.error\n# Configure logging\nlogging.basicConfig(level=logging.INFO)  # Set the logging level to INFO\ndef get_url_status(url):\n    if url is None:\n        return False\n    try:\n        response = urllib.request.urlopen(url)\n        return response.status == 200\n    except urllib.error.HTTPError as e:\n        logging.info('Error: %s' % e)\n    except Exception as e:\n        logging.warning('Error: %s' % e)\n    return False\n", "entry_point": "get_url_status", "input": "'http://www.example.com'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60754_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013373", "code": "from typing import List\ndef count_unique_requirements(requirements: List[int]) -> int:\n    unique_requirements = set()\n    for req in requirements:\n        unique_requirements.add(req)\n    return len(unique_requirements)\n", "entry_point": "count_unique_requirements", "input": "[1, 2, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112114_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013374", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[1, 1, 4, 3, 3, 5, 6, 6]", "output": "[1, 1, 4, 3, 3, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8561", "output": "{1, 1223, 8561, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013376", "code": "def find_missing_filings(corporation_numbers, historic_filings):\n    missing_filings = []\n    for corp_num in corporation_numbers:\n        if corp_num not in historic_filings:\n            missing_filings.append(corp_num)\n    return missing_filings\n", "entry_point": "find_missing_filings", "input": "[100, 101, 102, 103, 104, 105], [100, 101, 103, 105]", "output": "[102, 104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013377", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "['50', '51', '51']", "output": "50.7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2723", "output": "{1, 2723, 389, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7312", "output": "{1, 2, 4, 1828, 3656, 8, 457, 7312, 16, 914}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7311", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013380", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9479", "output": "{1, 9479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013381", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[10, 11, 13, 0, 5, 1], 4", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013382", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "176", "output": "{1, 2, 4, 8, 11, 44, 176, 16, 22, 88}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt175", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013383", "code": "K8S_DEPLOYMENT_SCHEMA = \"Deployment\"\nK8S_DAEMONSET_SCHEMA = \"DaemonSet\"\nK8S_JOB_SCHEMA = \"Job\"\nK8S_STATEFULSET_SCHEMA = \"StatefulSet\"\nK8S_SERVICE_SCHEMA = \"Service\"\nK8S_CONFIGMAP_SCHEMA = \"ConfigMap\"\nK8S_SECRET_SCHEMA = \"Secret\"\nK8S_INGRESS_SCHEMA = \"Ingress\"\nK8S_HPA_SCHEMA = \"HorizontalPodAutoscaler\"\nKRESOURCE_NAMES = [\n    \"Deployment\",\n    \"DaemonSet\",\n    \"Job\",\n    \"StatefulSet\",\n    \"Service\",\n    \"ConfigMap\",\n    \"Secret\",\n    \"Ingress\",\n    \"HorizontalPodAutoscaler\",\n]\nCONFIG_SCHEMA = [\n    K8S_DEPLOYMENT_SCHEMA,\n    K8S_DAEMONSET_SCHEMA,\n    K8S_JOB_SCHEMA,\n    K8S_STATEFULSET_SCHEMA,\n    K8S_SERVICE_SCHEMA,\n    K8S_CONFIGMAP_SCHEMA,\n    K8S_SECRET_SCHEMA,\n    K8S_INGRESS_SCHEMA,\n    K8S_HPA_SCHEMA,\n]\nCONFIG_SCHEMA_MAP = dict(zip(KRESOURCE_NAMES, CONFIG_SCHEMA))\ndef get_schema(resource_name):\n    return CONFIG_SCHEMA_MAP.get(resource_name)\n", "entry_point": "get_schema", "input": "'Service'", "output": "'Service'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41278_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013384", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0 and num % 3 == 0:\n            modified_list.append(num * 5)\n        elif num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:\n            modified_list.append(num ** 3)\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "process_integers", "input": "[6, 3, 6, 11, 4, 3, 4, 6]", "output": "[30, 27, 30, 11, 16, 27, 16, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2885_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013385", "code": "import re\nBIGQUERY_TABLE_FORMAT = re.compile(r'([\\w.:-]+:)?\\w+\\.\\w+$')\nGCS_URI_FORMAT = re.compile(r'gs://[\\w.-]+/[\\w/.-]+$')\ndef validate_input(input_str, input_type):\n    if input_type == \"bq_table\":\n        return bool(BIGQUERY_TABLE_FORMAT.match(input_str))\n    elif input_type == \"gcs_uri\":\n        return bool(GCS_URI_FORMAT.match(input_str))\n    else:\n        raise ValueError(\"Invalid input_type. Supported types are 'bq_table' and 'gcs_uri'.\")\n", "entry_point": "validate_input", "input": "'invalid_string', 'bq_table'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113681_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013386", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'123,456,789->xyz'", "output": "(['123', '456', '789'], 'xyz')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013387", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[-5, -5, 11]", "output": "275", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013388", "code": "def count_unique_users(chatroom_ids):\n    unique_users = set()\n    # Simulated data for users in each chatroom\n    chatroom_users = {\n        101: ['A', 'B', 'C'],\n        102: ['B', 'D'],\n        103: ['C', 'E'],\n        104: ['D', 'E']\n    }\n    for chatroom_id in chatroom_ids:\n        users_in_chatroom = chatroom_users.get(chatroom_id, [])\n        unique_users.update(users_in_chatroom)\n    return len(unique_users)\n", "entry_point": "count_unique_users", "input": "[101, 102]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116843_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013389", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[500, 601], 5", "output": "1105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013390", "code": "def calculate_avg_headcount(daily_menus, real_headcounts):\n    headcount_sum = {}\n    headcount_count = {}\n    for menu in daily_menus:\n        cafeteria_id = menu['cafeteria_id']\n        if cafeteria_id not in headcount_sum:\n            headcount_sum[cafeteria_id] = 0\n            headcount_count[cafeteria_id] = 0\n    for headcount in real_headcounts:\n        cafeteria_id = next((menu['cafeteria_id'] for menu in daily_menus if menu['date_id'] == headcount['date_id']), None)\n        if cafeteria_id:\n            headcount_sum[cafeteria_id] += headcount['n']\n            headcount_count[cafeteria_id] += 1\n    avg_headcount = {cafeteria_id: headcount_sum[cafeteria_id] / headcount_count[cafeteria_id] if headcount_count[cafeteria_id] > 0 else 0 for cafeteria_id in headcount_sum}\n    return avg_headcount\n", "entry_point": "calculate_avg_headcount", "input": "[{'cafeteria_id': 102}], []", "output": "{102: 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013391", "code": "def average_success_rate(successes, trials):\n    total_success_rate = 0.0\n    num_experiments = len(successes)\n    for success, trial in zip(successes, trials):\n        success_rate = float(success) / float(trial)\n        total_success_rate += success_rate\n    average_success_rate = total_success_rate / num_experiments\n    return average_success_rate\n", "entry_point": "average_success_rate", "input": "[1, 1], [2, 2]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138787_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013392", "code": "import math\ndef calculate_distances(array):\n    distances = []\n    for point in array:\n        x, y, z = point\n        distance = math.sqrt(x**2 + y**2 + z**2)\n        distances.append(round(distance, 3))  # Rounding to 3 decimal places\n    return distances\n", "entry_point": "calculate_distances", "input": "[(10, 0, 0), (0, 10, 0), (0, 0, 10)]", "output": "[10.0, 10.0, 10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110535_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013393", "code": "def calculate_bleed_damage(cards):\n    total_bleed_damage = 0\n    reset_value = 0  # Define the reset value here\n    for card in cards:\n        if card == reset_value:\n            total_bleed_damage = 0\n        else:\n            total_bleed_damage += card\n    return total_bleed_damage\n", "entry_point": "calculate_bleed_damage", "input": "[5.0, 5.0, 10.169999999999998]", "output": "20.169999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46599_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013394", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[10, 2, 0, 3, 2]", "output": "[12, 2, 3, 5, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013395", "code": "import re\nfrom typing import List\ndef extract_matches(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-zA-Z0-9]*\\b'  # Define the pattern for matching words\n    matches = re.findall(pattern, text)  # Find all matches in the text\n    unique_matches = list(set(matches))  # Get unique matches by converting to set and back to list\n    return unique_matches\n", "entry_point": "extract_matches", "input": "'userhost123'", "output": "['userhost123']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76446_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013396", "code": "def find_largest_region(sizedict):\n    max_size = 0\n    largest_region = ''\n    for region, size in sizedict.items():\n        if size > max_size:\n            max_size = size\n            largest_region = region\n    return largest_region\n", "entry_point": "find_largest_region", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6838", "output": "{1, 2, 263, 13, 526, 6838, 26, 3419}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6837", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013398", "code": "def sum_of_squares_even(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_squares_even", "input": "[10, 6, 2]", "output": "140", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10286_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013399", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / len(top_scores) if top_scores else 0.0\n", "entry_point": "average_top_scores", "input": "[85, 85, 86], 3", "output": "85.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123671_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013400", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[6, 2, 2, 0, 1, 1, 3, 7, 7]", "output": "[6, 2, 2, 0, 1, 1, 3, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7877", "output": "{1, 7877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013402", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'UUDDLLRR'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4863", "output": "{1, 3, 1621, 4863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5593", "output": "{1, 7, 329, 47, 17, 119, 5593, 799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013405", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[1, 2, 4, 4, 3, 3]", "output": "{1: 1, 2: 1, 4: 2, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013406", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-6, -7, -6, -6, -7, -4, 3, -3]", "output": "[6, 7, 6, 6, 7, 4, -3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013407", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 78, 78, 78, 85]", "output": "78.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108213_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "707", "output": "{1, 707, 101, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013409", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "-4", "output": "'https://www.kaiheila.cn/api/v-4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013410", "code": "def get_analysis_steps(population_size: int, method: int) -> list[int]:\n    steps_mapping = {\n        200: [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999],\n        500: [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999],\n        1000: [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999]\n    }\n    return steps_mapping.get(population_size, [])\n", "entry_point": "get_analysis_steps", "input": "300, 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120791_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5487", "output": "{1, 3, 1829, 5487, 177, 59, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013412", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "-3, 0, 3", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1273", "output": "{1, 67, 19, 1273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013414", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "559", "output": "{1, 43, 13, 559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013415", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filter3'", "output": "['filter3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013416", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MCCXLIX'", "output": "1249", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013417", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "None, 'apa'", "output": "'apa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013418", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[6, 1, 9, 5, 6, 6, 6, 6]", "output": "[1, 5, 6, 6, 6, 6, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9148", "output": "{1, 2, 4, 2287, 9148, 4574}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9147", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013420", "code": "def count_consecutive_doubles(s: str) -> int:\n    count = 0\n    for i in range(len(s) - 1):\n        if s[i] == s[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_consecutive_doubles", "input": "'aabbc'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35710_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013421", "code": "from typing import List\ndef check_snapshot(snapshot_hash: str, snapshot_hashes: List[str]) -> bool:\n    for h in snapshot_hashes:\n        if snapshot_hash == h:\n            return True\n    return False\n", "entry_point": "check_snapshot", "input": "'unique_hash', []", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5211_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013422", "code": "def filter_by_version(version_tuple, string_list):\n    filtered_list = []\n    for string in string_list:\n        first_element = int(string[0]) if string[0].isdigit() else None\n        if first_element in version_tuple:\n            filtered_list.append(string)\n    return filtered_list\n", "entry_point": "filter_by_version", "input": "(1, 2), ['apple', 'banana', 'grape']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121047_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013423", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7346", "output": "{3673, 1, 7346, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7345", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013424", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "'EEEEEEEEE'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013425", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'.22', 'formtools.as.Fg'", "output": "\"[.22]: 'formtools.as.Fg'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013426", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[87, 85, 80, 75, 70, 76]", "output": "[87, 85, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013427", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2974", "output": "{1, 2, 2974, 1487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2973", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013428", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'300 + 3'", "output": "303", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013429", "code": "def parse_list_of_lists(all_groups_str):\n    all_groups_str = all_groups_str.strip()[1:-1]  # Remove leading and trailing square brackets\n    groups = []\n    for line in all_groups_str.split(',\\n'):\n        group = [int(val) for val in line.strip()[1:-1].split(', ')]\n        groups.append(group)\n    return groups\n", "entry_point": "parse_list_of_lists", "input": "'[[9]]'", "output": "[[9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39140_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013430", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[28, 29, 30]", "output": "'29%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3741", "output": "{1, 129, 3, 3741, 43, 87, 29, 1247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013432", "code": "import ast\ndef extract_version_number(script_snippet):\n    tree = ast.parse(script_snippet)\n    version_number = None\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign):\n            for target in node.targets:\n                if isinstance(target, ast.Name) and target.id == '__version__':\n                    version_number = node.value.s\n                    break\n    return version_number\n", "entry_point": "extract_version_number", "input": "'__version__ = \"1.0\"'", "output": "'1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13915_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013433", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[5]", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013434", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'training:'", "output": "{'training': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013435", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[0, 3, 7, 3, 3, 7, 7, 10]", "output": "[3, 7, 3, 3, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013436", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'example file.txt'", "output": "'App/static/uploads/examplefile.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013437", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'Alice', 'Model'", "output": "'ALI_mod'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013438", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[5, 5, 5, 5, 5]", "output": "[0, 1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013439", "code": "def check_solution_stack(solution_stack):\n    for i in range(1, len(solution_stack)):\n        if solution_stack[i] <= solution_stack[i - 1]:\n            return False\n    return True\n", "entry_point": "check_solution_stack", "input": "[1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48449_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013440", "code": "def count_component_occurrences(layers, component_name):\n    total_count = 0\n    for layer_code in layers.values():\n        total_count += layer_code.count(component_name)\n    return total_count\n", "entry_point": "count_component_occurrences", "input": "{}, 'test_component'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40485_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013441", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'ethe quick brown fox', 4", "output": "('ethe', 'quick brown fox')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013442", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "200", "output": "b'\\xc8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013443", "code": "from typing import List, Dict\ndef word_frequency(input_list: List[str]) -> Dict[str, int]:\n    word_freq = {}\n    for word in input_list:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "['banana', 'banana', 'banana', 'banana', 'apple']", "output": "{'banana': 4, 'apple': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138906_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013444", "code": "def filter_underage_users(users):\n    eligible_users = []\n    for user in users:\n        if user.get(\"age\", 0) >= 18:\n            eligible_users.append(user[\"name\"])\n    return eligible_users\n", "entry_point": "filter_underage_users", "input": "[{'name': 'Alice', 'age': 17}, {'name': 'Bob', 'age': 16}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20818_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013445", "code": "TT_EQ = 'EQ'  # =\nTT_LPAREN = 'LPAREN'  # (\nTT_RPAREN = 'RPAREN'  # )\nTT_LSQUARE = 'LSQUARE'\nTT_RSQUARE = 'RSQUARE'\nTT_EE = 'EE'  # ==\nTT_NE = 'NE'  # !=\nTT_LT = 'LT'  # >\nTT_GT = 'GT'  # <\nTT_LTE = 'LTE'  # >=\nTT_GTE = 'GTE'  # <=\nTT_COMMA = 'COMMA'\nTT_ARROW = 'ARROW'\nTT_NEWLINE = 'NEWLINE'\nTT_EOF = 'EOF'\ndef lexer(code):\n    tokens = []\n    i = 0\n    while i < len(code):\n        char = code[i]\n        if char.isspace():\n            i += 1\n            continue\n        if char == '=':\n            tokens.append((TT_EQ, char))\n        elif char == '(':\n            tokens.append((TT_LPAREN, char))\n        elif char == ')':\n            tokens.append((TT_RPAREN, char))\n        elif char == '[':\n            tokens.append((TT_LSQUARE, char))\n        elif char == ']':\n            tokens.append((TT_RSQUARE, char))\n        elif char == '>':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_GTE, '>='))\n                i += 1\n            else:\n                tokens.append((TT_GT, char))\n        elif char == '<':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_LTE, '<='))\n                i += 1\n            else:\n                tokens.append((TT_LT, char))\n        elif char == '!':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_NE, '!='))\n                i += 1\n        elif char == ',':\n            tokens.append((TT_COMMA, char))\n        elif char == '-':\n            if i + 1 < len(code) and code[i + 1] == '>':\n                tokens.append((TT_ARROW, '->'))\n                i += 1\n        elif char.isdigit():\n            num = char\n            while i + 1 < len(code) and code[i + 1].isdigit():\n                num += code[i + 1]\n                i += 1\n            tokens.append(('NUM', num))\n        elif char.isalpha():\n            identifier = char\n            while i + 1 < len(code) and code[i + 1].isalnum():\n                identifier += code[i + 1]\n                i += 1\n            tokens.append(('ID', identifier))\n        elif char == '\\n':\n            tokens.append((TT_NEWLINE, char))\n        i += 1\n    tokens.append((TT_EOF, ''))  # End of file token\n    return tokens\n", "entry_point": "lexer", "input": "'10'", "output": "[('NUM', '10'), ('EOF', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28449_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013446", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'AB'", "output": "['AB', 'BA']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8853", "output": "{1, 3, 227, 2951, 39, 681, 13, 8853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013448", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4154", "output": "{1, 2, 67, 134, 4154, 2077, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013449", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'versionn.'", "output": "'versionn.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013450", "code": "def calculate_balance(transactions):\n    balance = 0\n    for transaction in transactions:\n        if transaction[\"type\"] == \"credit\":\n            balance += transaction[\"amount\"]\n        elif transaction[\"type\"] == \"debit\":\n            balance -= transaction[\"amount\"]\n    return balance\n", "entry_point": "calculate_balance", "input": "[{'type': 'debit', 'amount': 50}]", "output": "-50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129900_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013451", "code": "def min_steps_to_reach_farthest_position(positions):\n    if not positions:\n        return 0\n    n = len(positions)\n    if n == 1:\n        return 0\n    farthest = positions[0]\n    max_jump = positions[0]\n    steps = 1\n    for i in range(1, n):\n        if i > farthest:\n            return -1\n        if i > max_jump:\n            max_jump = farthest\n            steps += 1\n        farthest = max(farthest, i + positions[i])\n    return steps\n", "entry_point": "min_steps_to_reach_farthest_position", "input": "[1, 0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73765_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013452", "code": "def transform_none_to_empty(data):\n    for person in data:\n        for key, value in person.items():\n            if value is None:\n                person[key] = ''\n    return data\n", "entry_point": "transform_none_to_empty", "input": "[{}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9611_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013453", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmo.options.apps.Onfig'", "output": "('rdmo.options.apps', 'Onfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013454", "code": "def simulate_race(cars):\n    finishing_times = [(index, position / speed) for index, (position, speed) in enumerate(cars)]\n    finishing_times.sort(key=lambda x: x[1])\n    return [car[0] for car in finishing_times]\n", "entry_point": "simulate_race", "input": "[(2, 1), (5, 1), (1, 1), (3, 1)]", "output": "[2, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89590_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013455", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5114", "output": "{1, 5114, 2, 2557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5113", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013456", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1866", "output": "{1, 2, 3, 933, 6, 1866, 622, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013457", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[2, 4, 3, 3, 10, 7, 7]", "output": "[4, 8, 9, 9, 20, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013458", "code": "import re\ndef parse_routes(config_file):\n    route_mappings = {}\n    for line in config_file.split('\\n'):\n        match = re.match(r\"config.add_route\\('(\\w+)', '(.*)'\\)\", line)\n        if match:\n            route_name, route_path = match.groups()\n            route_mappings[route_name] = route_path\n    return route_mappings\n", "entry_point": "parse_routes", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122829_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013459", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'and'", "output": "'and'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013460", "code": "def score_answers(nq_gold_dict, nq_pred_dict):\n    long_answer_stats = {}\n    short_answer_stats = {}\n    for question_id, gold_answers in nq_gold_dict.items():\n        pred_answers = nq_pred_dict.get(question_id, [])\n        # Scoring mechanism for long answers (example scoring logic)\n        long_score = 0\n        for gold_answer in gold_answers:\n            if gold_answer in pred_answers:\n                long_score += 1\n        # Scoring mechanism for short answers (example scoring logic)\n        short_score = min(len(gold_answers), len(pred_answers))\n        long_answer_stats[question_id] = long_score\n        short_answer_stats[question_id] = short_score\n    return long_answer_stats, short_answer_stats\n", "entry_point": "score_answers", "input": "{2: ['A', 'B']}, {2: []}", "output": "({2: 0}, {2: 0})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78415_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013461", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'some_value', 'saample.reads.fa'", "output": "'saample_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013462", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "504", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7625", "output": "{1, 5, 7625, 305, 1525, 125, 25, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7624", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013464", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7417", "output": "{1, 7417}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013465", "code": "def count_older_ages(ages, threshold):\n    count = 0\n    for age in ages:\n        if age > threshold:\n            count += 1\n    return count\n", "entry_point": "count_older_ages", "input": "[21, 22, 23, 24, 25, 19, 18], 20", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135375_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013466", "code": "def process_value(a):\n    k = 'default_value'  # Define a default value for b\n    if a == 'w':\n        b = 'c'\n    elif a == 'y':\n        b = 'd'\n    else:\n        b = k  # Assign the default value if a does not match any condition\n    return b\n", "entry_point": "process_value", "input": "'w'", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149280_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013467", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kjakakiri/2'", "output": "'http://kjakakiri/2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9985", "output": "{1997, 1, 5, 9985}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013469", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[10, 8, 4]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4220_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013470", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "8.0, 0", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013471", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6707", "output": "{19, 1, 6707, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013472", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "124", "output": "142", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013473", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[3, 3, 4, 3, 3, 3, 3, 2]", "output": "[3, 3, 4, 3, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013474", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[1, 3, 3, 3, 5]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013475", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[5, 5, 4, 4, 1]", "output": "([5, 4, 1], [2, 2, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013476", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=Alice age=30 city=New'", "output": "{'name': 'Alice', 'age': '30', 'city': 'New'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013477", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'hbohbo.cohoagess:e'", "output": "'hbohbo.cohoagess:e/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2776", "output": "{1, 2, 4, 8, 1388, 694, 2776, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2775", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013479", "code": "def modified_decoded(testo):\n    result = ''\n    for i in testo:\n        result += i*2\n    return result\n", "entry_point": "modified_decoded", "input": "'hello'", "output": "'hheelllloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83772_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013480", "code": "def solve(num_stairs, points):\n    dp = [0] * (num_stairs + 1)\n    dp[1] = points[1]\n    for i in range(2, num_stairs + 1):\n        dp[i] = max(points[i] + dp[i - 1], dp[i - 2] + points[i])\n    return dp[num_stairs]\n", "entry_point": "solve", "input": "3, [0, 1, 2, 8]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147689_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7447", "output": "{1, 11, 677, 7447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013482", "code": "def simulate_train(commands):\n    position = 0\n    for command in commands:\n        if command == 'F' and position < 10:\n            position += 1\n        elif command == 'B' and position > -10:\n            position -= 1\n    return position\n", "entry_point": "simulate_train", "input": "['F', 'F', 'F']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105746_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013483", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'ie_igie_without_tag'", "output": "('ie_igie_without_tag', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013484", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[0, 7, 7, 8, 0, 0, 7, 7]", "output": "[0, 8, 9, 11, 4, 5, 13, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013485", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'ata/ayz'", "output": "'ata/ayz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3413", "output": "{1, 3413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013487", "code": "def validate_user_move(user_move, possible_moves):\n    if not possible_moves:\n        return \"No possible moves\"\n    valid = False\n    for possible_move in possible_moves:\n        if user_move == possible_move:  # Assuming user_move and possible_move are comparable\n            valid = True\n            break\n    if valid:\n        return \"Valid move\"\n    else:\n        return \"Invalid move\"\n", "entry_point": "validate_user_move", "input": "4, [1, 2, 3]", "output": "'Invalid move'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107547_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013488", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6189", "output": "{1, 3, 6189, 2063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013489", "code": "def count_older_ages(ages, threshold):\n    count = 0\n    for age in ages:\n        if age > threshold:\n            count += 1\n    return count\n", "entry_point": "count_older_ages", "input": "[21, 22, 23, 24, 25, 26, 18, 19], 20", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135375_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013490", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "0", "output": "'UNKNOWN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013491", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[3, 5, 3, 4, 4, 4, 3, 3]", "output": "[9, 25, 9, 8, 8, 8, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013492", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013493", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "13", "output": "377", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013494", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013495", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "2", "output": "'T__1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013496", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'isThis is a sample s'", "output": "'isThis is a sample s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013497", "code": "import re\ndef decode_entities(xml_string):\n    def replace_entity(match):\n        entity = match.group(0)\n        if entity == '&amp;':\n            return '&'\n        # Add more entity replacements as needed\n        return entity\n    return re.sub(r'&\\w+;', replace_entity, xml_string)\n", "entry_point": "decode_entities", "input": "'x>Souffl&amp;</x>'", "output": "'x>Souffl&</x>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69392_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013498", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    total_sum = 0\n    for num in input_list:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67910_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013499", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[[5], 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013500", "code": "def calculate_discounted_price(costs, discounts, rebate_factor):\n    total_cost = sum(costs)\n    total_discount = sum(discounts)\n    final_price = (total_cost - total_discount) * rebate_factor\n    if final_price < 0:\n        return 0\n    else:\n        return round(final_price, 2)\n", "entry_point": "calculate_discounted_price", "input": "[25, 25], [10, 10, 8.66], 1.0", "output": "21.34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12135_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013501", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9173", "output": "{1, 9173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013502", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013503", "code": "def min_abs_diff(nums):\n    nums.sort()\n    min_diff = float('inf')\n    for i in range(1, len(nums)):\n        diff = abs(nums[i] - nums[i-1])\n        min_diff = min(min_diff, diff)\n    return min_diff\n", "entry_point": "min_abs_diff", "input": "[0, 1, 10]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132683_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013504", "code": "def get_seq_len(sentence):\n    length = 0\n    for num in sentence:\n        length += 1\n        if num == 1:\n            break\n    return length\n", "entry_point": "get_seq_len", "input": "[0, 2, 3, 4, 5, 6, 7, 8, 1]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87843_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013505", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'WoWd!'", "output": "'JbJq!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013506", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(5, 5, 5, 9, 5, 8, 5, 8)", "output": "'5.5.5.9.5.8.5.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013507", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'JohnDJoSmith'", "output": "'John d jo smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013508", "code": "from typing import Dict, List\ndef GetUnneededFiles(abi_to_files: Dict[str, List[str]], abi: str) -> List[str]:\n    unneeded_files = []\n    for entry_abi, entry_files in abi_to_files.items():\n        if entry_abi != abi:\n            unneeded_files.extend(entry_files)\n    return unneeded_files\n", "entry_point": "GetUnneededFiles", "input": "{}, 'test_abi'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98558_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013509", "code": "def bubble_sort(elements):\n    while True:\n        swapped = False\n        for i in range(len(elements) - 1):\n            if elements[i] > elements[i + 1]:\n                # Swap elements\n                elements[i], elements[i + 1] = elements[i + 1], elements[i]\n                swapped = True\n        if not swapped:\n            break\n    return elements\n", "entry_point": "bubble_sort", "input": "[25, 25, 24, 9, 25]", "output": "[9, 24, 25, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115988_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013510", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "0, 0, -1632", "output": "-1632000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "467", "output": "{1, 467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013512", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4409", "output": "{1, 4409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013513", "code": "def str_to_bool(value):\n    true_values = {'true', 't', '1', 'yes', 'y'}\n    false_values = {'false', 'f', '0', 'no', 'n'}\n    if value.lower() in true_values:\n        return True\n    elif value.lower() in false_values:\n        return False\n    else:\n        raise ValueError(f'{value} is not a valid boolean value')\n", "entry_point": "str_to_bool", "input": "'no'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141972_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013514", "code": "def cleanup_query_string(url):\n    base_url, query_string = url.split('?') if '?' in url else (url, '')\n    if '#' in query_string:\n        query_string = query_string[:query_string.index('#')]\n    if query_string.endswith('?') and len(query_string) == 1:\n        query_string = ''\n    cleaned_url = base_url + ('?' + query_string if query_string else '')\n    return cleaned_url\n", "entry_point": "cleanup_query_string", "input": "'http://test.com/t.html?test=a&'", "output": "'http://test.com/t.html?test=a&'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64096_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013515", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "3, 8", "output": "[2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013516", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[4, 3, 1, 2, 5], 2, 1", "output": "[4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013517", "code": "def candy(A):\n    candies = [1] * len(A)\n    # Forward pass\n    for i in range(1, len(A)):\n        if A[i] > A[i - 1]:\n            candies[i] = candies[i - 1] + 1\n    result = candies[-1]\n    # Backward pass\n    for i in range(len(A) - 2, -1, -1):\n        if A[i] > A[i + 1]:\n            candies[i] = max(candies[i], candies[i + 1] + 1)\n        result += candies[i]\n    return result\n", "entry_point": "candy", "input": "[1, 2, 3, 2, 1]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54117_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013518", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8713", "output": "{1, 8713}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013519", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[10, [5], 2]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013520", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "99", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013521", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'abcdef'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5557", "output": "{1, 5557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013523", "code": "from typing import List, Dict, Union\ndef calculate_population_density(regions: List[Dict[str, Union[int, float]]]) -> float:\n    total_population = sum(region['population'] for region in regions)\n    total_area = sum(region['area'] for region in regions)\n    if total_area == 0:\n        return 0.0\n    return total_population / total_area\n", "entry_point": "calculate_population_density", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104740_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013524", "code": "def get_repo_name_from_url(url: str) -> str:\n    if not url:\n        return None\n    last_slash_index = url.rfind(\"/\")\n    last_suffix_index = url.rfind(\".git\")\n    if last_suffix_index < 0:\n        last_suffix_index = len(url)\n    if last_slash_index < 0 or last_suffix_index <= last_slash_index:\n        raise Exception(\"Invalid repo url {}\".format(url))\n    return url[last_slash_index + 1:last_suffix_index]\n", "entry_point": "get_repo_name_from_url", "input": "'https://github.com/user/repo.git'", "output": "'repo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4595_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013525", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "14, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013526", "code": "def check_win(p1):\n    winning_combination = {1, 3, 5, 6, 7, 8}\n    return winning_combination.issubset(p1)\n", "entry_point": "check_win", "input": "{1, 3, 5, 6, 7, 8}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55458_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013527", "code": "def calculate_luminance(r, g, b):\n    luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b\n    return round(luminance, 2)\n", "entry_point": "calculate_luminance", "input": "1, 4, 0", "output": "3.07", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28393_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013528", "code": "def count_qualifying_digits(data):\n    ans = 0\n    for line in data:\n        _, output = line.split(\" | \")\n        for digit in output.split():\n            if len(digit) in (2, 3, 4, 7):\n                ans += 1\n    return ans\n", "entry_point": "count_qualifying_digits", "input": "['input1 | 12', 'input2 | 1234', 'input3 | 123']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121913_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013529", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=0-0'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013530", "code": "from typing import List, Tuple\nfrom math import sqrt\ndef max_distance(points: List[Tuple[int, int]]) -> float:\n    max_dist = 0\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            max_dist = max(max_dist, distance)\n    return round(max_dist, 2)\n", "entry_point": "max_distance", "input": "[(0, 0), (15, 15)]", "output": "21.21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39213_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013531", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6299", "output": "{1, 6299}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013532", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "[], 3", "output": "'{v0, v1, v2}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013533", "code": "from typing import List\ndef convert_to_milliseconds(task_durations: List[int]) -> List[int]:\n    milliseconds_durations = [duration * 1000 for duration in task_durations]\n    return milliseconds_durations\n", "entry_point": "convert_to_milliseconds", "input": "[20, 19, 15, 20, 20, 15]", "output": "[20000, 19000, 15000, 20000, 20000, 15000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30331_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013534", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "8.3", "output": "8300000000000000710", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4045", "output": "{1, 5, 4045, 809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4044", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013536", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[4, 5, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013537", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "['15', '18', '20', '17', '18']", "output": "17.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013538", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[2, 2, 2, 2, 4, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013539", "code": "def cooking3(N, M, wig):\n    dp = [float('inf')] * (N + 1)\n    dp[0] = 0\n    for i in range(1, N + 1):\n        for w in wig:\n            if i - w >= 0:\n                dp[i] = min(dp[i], dp[i - w] + 1)\n    return dp[N] if dp[N] != float('inf') else -1\n", "entry_point": "cooking3", "input": "6, 3, [2, 2, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18807_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013540", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "60", "output": "{1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 60, 30}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt59", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6079", "output": "{1, 6079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013542", "code": "import unicodedata\nCOLOR_SCHEMES = {\n    'rainbow': [4, 7, 8, 3, 12, 2, 6],\n    'usa': [4, 0, 2],\n    'commie': [4, 8],\n    'spooky': [8, 7, 0],\n}\nSCHEME_ERRORS = {\n    'rainbow': \"I can't make a rainbow out of nothing!\",\n    'usa': \"I can't distribute FREEDOM out of nothing!\",\n    'commie': \"I need text to commie-ize!\",\n    'spooky': \"I need text to spookify!\",\n}\ndef apply_color_scheme(text, color_scheme):\n    if color_scheme not in COLOR_SCHEMES:\n        return SCHEME_ERRORS.get(color_scheme, \"Invalid color scheme selected!\")\n    colored_text = []\n    for idx, char in enumerate(text):\n        color_code = COLOR_SCHEMES[color_scheme][idx % len(COLOR_SCHEMES[color_scheme])]\n        colored_char = \"\\x03{0}{1}\\x03\".format(color_code, char)  # Using IRC color codes for demonstration\n        colored_text.append(colored_char)\n    transformed_text = \"\".join(colored_text)\n    return transformed_text\n", "entry_point": "apply_color_scheme", "input": "'', 'nonexistent_scheme'", "output": "'Invalid color scheme selected!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149351_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013543", "code": "import math\ndef adjust_to_tick(value, tick):\n    remainder = value % tick\n    adjusted_value = value - remainder\n    return adjusted_value\n", "entry_point": "adjust_to_tick", "input": "8.35, 0.25", "output": "8.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4653_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3464", "output": "{1, 2, 866, 1732, 4, 3464, 8, 433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3463", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4646", "output": "{1, 2, 101, 4646, 202, 46, 2323, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013546", "code": "def perform_operation(operation=\"add\", operand1=0, operand2=0):\n    if operation == \"add\":\n        return operand1 + operand2\n    elif operation == \"subtract\":\n        return operand1 - operand2\n    elif operation == \"multiply\":\n        return operand1 * operand2\n    elif operation == \"divide\":\n        if operand2 != 0:\n            return operand1 / operand2\n        else:\n            return \"Error: Division by zero\"\n    else:\n        return \"Error: Invalid operation\"\n", "entry_point": "perform_operation", "input": "'add', 2.5, 2.5", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52158_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013547", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3209", "output": "{1, 3209}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013548", "code": "def min_changes_to_alternate(s):\n    one = 0\n    zero = 0\n    for i in range(len(s)):\n        if i > 0 and s[i] == s[i-1]:\n            continue\n        if s[i] == \"1\":\n            one += 1\n        else:\n            zero += 1\n    return min(one, zero)\n", "entry_point": "min_changes_to_alternate", "input": "'001'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53461_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013549", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7786", "output": "{1, 2, 34, 229, 7786, 458, 17, 3893}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013550", "code": "def longest_palindromic_substring(s):\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    max_palindrome = \"\"\n    for i in range(len(s)):\n        # Odd-length palindrome\n        palindrome1 = expand_around_center(s, i, i)\n        # Even-length palindrome\n        palindrome2 = expand_around_center(s, i, i + 1)\n        if len(palindrome1) > len(max_palindrome):\n            max_palindrome = palindrome1\n        if len(palindrome2) > len(max_palindrome):\n            max_palindrome = palindrome2\n    return max_palindrome\n", "entry_point": "longest_palindromic_substring", "input": "'aaaaa'", "output": "'aaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137320_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013551", "code": "def count_pairs_sum_target(nums, target):\n    seen = {}\n    count = 0\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            count += 1\n        seen[num] = True\n    return count\n", "entry_point": "count_pairs_sum_target", "input": "[2, 4, 1, 5], 6", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48293_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013552", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[70, 72, 75], 3", "output": "72.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3301", "output": "{1, 3301}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013554", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[100, 95, 89, 85, 80, 66], 6", "output": "85.83333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013555", "code": "def parse_version(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "parse_version", "input": "'11.2.3'", "output": "(11, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18632_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013556", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "873", "output": "{1, 97, 3, 291, 9, 873}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013557", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "987654324", "output": "'987.654.324'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013558", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[0, 2, 3, 3, -3, 8, 8, 7, 9]", "output": "[0, 4, 9, 9, 9, 16, 16, 49, 81]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013559", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "442", "output": "{1, 2, 34, 26, 13, 17, 442, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013560", "code": "def process_integers(integer_list):\n    total = 0\n    for num in integer_list:\n        if num > 0:\n            total += num ** 2\n        elif num < 0:\n            total -= abs(num) / 2\n    return total\n", "entry_point": "process_integers", "input": "[4, -10]", "output": "11.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92247_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9277", "output": "{1, 9277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013562", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/234/anything_else'", "output": "'234'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013563", "code": "def extract_major_minor_version(version_string):\n    # Split the version string by the dot ('.') character\n    version_parts = version_string.split('.')\n    # Extract the major version\n    major_version = int(version_parts[0])\n    # Extract the minor version by removing non-numeric characters\n    minor_version = ''.join(filter(str.isdigit, version_parts[1]))\n    # Convert the major and minor version parts to integers\n    minor_version = int(minor_version)\n    # Return a tuple containing the major and minor version numbers\n    return major_version, minor_version\n", "entry_point": "extract_major_minor_version", "input": "'333143.3'", "output": "(333143, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141202_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013564", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[90, 90, 2, 2, 9, 9, 8, 7]", "output": "[100, 100, 4, 4, 729, 729, 64, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013565", "code": "import re\nre_date = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])$')\nre_time = re.compile(r'^([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?$')\nre_datetime = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])(\\D?([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?([zZ])?)?$')\nre_decimal = re.compile('^(\\d+)\\.(\\d+)$')\ndef validate_data_format(input_string: str) -> str:\n    if re.match(re_date, input_string):\n        return \"date\"\n    elif re.match(re_time, input_string):\n        return \"time\"\n    elif re.match(re_datetime, input_string):\n        return \"datetime\"\n    elif re.match(re_decimal, input_string):\n        return \"decimal\"\n    else:\n        return \"unknown\"\n", "entry_point": "validate_data_format", "input": "'14:30'", "output": "'time'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67151_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013566", "code": "from typing import List\ndef top_k_scores(scores: List[int], k: int) -> List[int]:\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    sorted_scores = sorted(score_freq.keys(), reverse=True)\n    result = []\n    unique_count = 0\n    for score in sorted_scores:\n        if unique_count == k:\n            break\n        result.append(score)\n        unique_count += 1\n    return result\n", "entry_point": "top_k_scores", "input": "[93, 89, 85, 76], 1", "output": "[93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108959_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013567", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene1.mut1,gene23'", "output": "[('gene1', 'mut1'), ('gene23',)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013568", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 2:\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 4)\n", "entry_point": "calculate_average", "input": "[77, 77]", "output": "77.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19408_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5817", "output": "{1, 3, 7, 1939, 21, 277, 5817, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013570", "code": "from typing import List\ndef above_average(scores: List[int]) -> float:\n    total_sum = sum(scores)\n    class_average = total_sum / len(scores)\n    above_avg_scores = [score for score in scores if score > class_average]\n    if above_avg_scores:\n        above_avg_sum = sum(above_avg_scores)\n        above_avg_count = len(above_avg_scores)\n        above_avg_average = above_avg_sum / above_avg_count\n        return above_avg_average\n    else:\n        return 0.0\n", "entry_point": "above_average", "input": "[40, 50, 51, 54]", "output": "51.666666666666664", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77722_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013571", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[3, 5, 4, 1, 3, 2, 2, 4]", "output": "[3, 8, 12, 13, 16, 18, 20, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013572", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2165", "output": "{1, 5, 433, 2165}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2164", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013573", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'11.5.3'", "output": "(11, 5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013574", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[[5, 7], [7, [6, 8]], [2, [3, [6]]]]", "output": "[5, 7, 7, 6, 8, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013575", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "10, 6", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013576", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "10, 0", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013577", "code": "from typing import List\ndef calculate_sum_and_max_odd(numbers: List[int]) -> int:\n    even_sum = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return even_sum * max_odd\n", "entry_point": "calculate_sum_and_max_odd", "input": "[8, 27]", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2830_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013578", "code": "def dechiffrer(morse_code):\n    morse_dict = {\n        '.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D', '.': 'E',\n        '..-.': 'F', '--.': 'G', '....': 'H', '..': 'I', '.---': 'J',\n        '-.-': 'K', '.-..': 'L', '--': 'M', '-.': 'N', '---': 'O',\n        '.--.': 'P', '--.-': 'Q', '.-.': 'R', '...': 'S', '-': 'T',\n        '..-': 'U', '...-': 'V', '.--': 'W', '-..-': 'X', '-.--': 'Y',\n        '--..': 'Z', '/': ' '\n    }\n    decoded_message = \"\"\n    words = morse_code.split('/')\n    for word in words:\n        characters = word.split()\n        for char in characters:\n            if char in morse_dict:\n                decoded_message += morse_dict[char]\n        decoded_message += ' '\n    return decoded_message.strip()\n", "entry_point": "dechiffrer", "input": "'.'", "output": "'E'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31381_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013579", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 10, 1, 1, 8, 8, 2, 3, 10]", "output": "[7, 11, 3, 4, 12, 13, 8, 10, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013580", "code": "def play_card_game(deck):\n    dp_include = [0] * len(deck)\n    dp_skip = [0] * len(deck)\n    dp_include[0] = deck[0]\n    dp_skip[0] = 0 if deck[0] % 3 == 0 else deck[0]\n    for i in range(1, len(deck)):\n        dp_include[i] = max(dp_skip[i-1] + deck[i], dp_include[i-1])\n        dp_skip[i] = max(dp_include[i-1] if deck[i] % 3 != 0 else 0, dp_skip[i-1])\n    return max(dp_include[-1], dp_skip[-1])\n", "entry_point": "play_card_game", "input": "[10, 11]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50885_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013581", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "2, 1, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013582", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2359", "output": "{337, 1, 7, 2359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013583", "code": "import os\ndef simulate_run(filename):\n    filesplit = filename.rsplit('.', 1)\n    if len(filesplit) < 2:\n        return \"Invalid filename format\"\n    second_part_length = len(filesplit[1])\n    filesplit[1] = f'%0{second_part_length}d'\n    modified_filename = '.'.join(filesplit)\n    directory = os.path.dirname(modified_filename)\n    directory_parts = os.path.basename(directory).rsplit(' ', 1)\n    if len(directory_parts) < 2:\n        return \"Frame number not found\"\n    filename_frame = directory_parts[1]\n    clipboard_content = f'{modified_filename} {filename_frame}'\n    return clipboard_content\n", "entry_point": "simulate_run", "input": "'C:/videos/2023/video.mp4'", "output": "'Frame number not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44297_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013584", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 15, 1, 5, 25]", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013585", "code": "def sum_multiples_3_and_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_and_5", "input": "[15, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95576_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013586", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6593", "output": "{1, 347, 19, 6593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "90", "output": "{1, 2, 3, 5, 6, 9, 10, 45, 15, 18, 90, 30}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt89", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013588", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[2]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013589", "code": "def generate_code_snippets(operator_names):\n    unary_operator_codes = {\n        \"UAdd\": (\"PyNumber_Positive\", 1),\n        \"USub\": (\"PyNumber_Negative\", 1),\n        \"Invert\": (\"PyNumber_Invert\", 1),\n        \"Repr\": (\"PyObject_Repr\", 1),\n        \"Not\": (\"UNARY_NOT\", 0),\n    }\n    rich_comparison_codes = {\n        \"Lt\": \"LT\",\n        \"LtE\": \"LE\",\n        \"Eq\": \"EQ\",\n        \"NotEq\": \"NE\",\n        \"Gt\": \"GT\",\n        \"GtE\": \"GE\",\n    }\n    output_snippets = []\n    for operator_name in operator_names:\n        if operator_name in unary_operator_codes:\n            output_snippets.append(unary_operator_codes[operator_name][0])\n        elif operator_name in rich_comparison_codes:\n            output_snippets.append(rich_comparison_codes[operator_name])\n    return output_snippets\n", "entry_point": "generate_code_snippets", "input": "['Add', 'Subtract', 'Multiply']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_547_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3734", "output": "{1, 2, 1867, 3734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013591", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013592", "code": "def z_arrange(s, numRows):\n    if numRows < 2 or numRows >= len(s):\n        return s\n    rows = ['' for _ in range(numRows)]\n    current_row = 0\n    direction = 1  # 1 for down, -1 for up\n    for char in s:\n        rows[current_row] += char\n        if current_row == 0:\n            direction = 1\n        elif current_row == numRows - 1:\n            direction = -1\n        current_row += direction\n    return ''.join(rows)\n", "entry_point": "z_arrange", "input": "'PAYPALISHIRING', 4", "output": "'PINALSIGYAHRPI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18743_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2511", "output": "{1, 3, 837, 9, 2511, 81, 279, 27, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013594", "code": "import json\ndef process_json(input_json):\n    output_json = {}\n    for key, value in input_json.items():\n        if not key.startswith('a'):\n            if isinstance(value, str):\n                output_json[key.upper()] = value.upper()\n    return output_json\n", "entry_point": "process_json", "input": "{'apple': 'fruit', 'apricot': 'fruit'}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149939_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013595", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "46", "output": "'000000000000002e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013596", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[2, 4, 1, 3]", "output": "(6, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013597", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'{'", "output": "'{\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013598", "code": "def calculate_interpolatability(list1, list2):\n    abs_diff_sum = 0\n    list1_sum = sum(list1)\n    for i in range(len(list1)):\n        abs_diff_sum += abs(list1[i] - list2[i])\n    interpolatability_score = abs_diff_sum / list1_sum\n    return round(interpolatability_score, 2)\n", "entry_point": "calculate_interpolatability", "input": "[50, 50], [58, 42]", "output": "0.16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140481_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013599", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "204", "output": "b'\\xcc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013600", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9301", "output": "{1, 131, 9301, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013601", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "29", "output": "'\\x1d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013602", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 6, 3, 0, 1, 3, 0]", "output": "[6, 9, 3, 1, 4, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112058_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013603", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[176, 176, 176, 176, 170], 4", "output": "176.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013604", "code": "def update_ssl_certificates(current_certificates, new_certificate):\n    updated_certificates = current_certificates.copy()  # Create a copy of the current certificates list\n    for i in range(len(updated_certificates)):\n        if updated_certificates[i] == new_certificate:\n            updated_certificates[i] = new_certificate\n            break\n    return updated_certificates\n", "entry_point": "update_ssl_certificates", "input": "[], 'new_cert.pem'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71071_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5392", "output": "{1, 2, 674, 4, 1348, 2696, 8, 5392, 16, 337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5391", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013606", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'hhap'", "output": "'Binary path for hhap not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013607", "code": "def filter_emails_by_account(email_addresses, account_id):\n    filtered_emails = []\n    for email_data in email_addresses:\n        if email_data.get('account_id') == account_id:\n            filtered_emails.append(email_data)\n    return filtered_emails\n", "entry_point": "filter_emails_by_account", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013608", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[4, 3, 4, 4, 1, 3, 6, 5]", "output": "[4, 4, 6, 7, 5, 8, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013609", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'app.config.wwathBCCConfigaaiw'", "output": "'wwathBCCConfigaaiw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013610", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013611", "code": "def process_gene_list(gene_list):\n    gene_dict = {}\n    for gene_entry in gene_list:\n        gene_name, transcripts = gene_entry.split(\":\")\n        gene_dict[gene_name] = transcripts.split(\",\")\n    return gene_dict\n", "entry_point": "process_gene_list", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38038_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013612", "code": "from datetime import datetime\ndef execute_command(cmd: str) -> str:\n    if cmd == \"HELLO\":\n        return \"Hello, World!\"\n    elif cmd == \"TIME\":\n        current_time = datetime.now().strftime(\"%H:%M\")\n        return current_time\n    elif cmd == \"GOODBYE\":\n        return \"Goodbye!\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "execute_command", "input": "'INVALID'", "output": "'Invalid command'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88933_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013613", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'1d'", "output": "86400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013614", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[250, 250, 250], 'add'", "output": "[750, 750, 750]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013615", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[12, 12, 0, 0]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4310", "output": "{1, 2, 5, 10, 2155, 431, 4310, 862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4309", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013617", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "31", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013618", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[8, 8, 8, 2, 2, 1, 1]", "output": "[8, 8, 8, 2, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013619", "code": "def getTotalPage(m, n):\n    page, remaining = divmod(m, n)\n    if remaining != 0:\n        return page + 1\n    else:\n        return page\n", "entry_point": "getTotalPage", "input": "4, 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50511_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013620", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "3, 4", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5739", "output": "{3, 1, 5739, 1913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013622", "code": "def longest_consecutive_primes(primes, n):\n    prime = [False, False] + [True] * (n - 1)\n    for i in range(2, int(n**0.5) + 1):\n        if prime[i]:\n            for j in range(i*i, n+1, i):\n                prime[j] = False\n    count = 0\n    ans = 0\n    for index, elem in enumerate(primes):\n        total_sum = 0\n        temp_count = 0\n        for i in range(index, len(primes)):\n            total_sum += primes[i]\n            temp_count += 1\n            if total_sum > n:\n                break\n            if prime[total_sum]:\n                if temp_count > count or (temp_count == count and primes[index] < ans):\n                    ans = total_sum\n                    count = temp_count\n    return ans, count\n", "entry_point": "longest_consecutive_primes", "input": "[2], 2", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91133_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013623", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'10.5.100'", "output": "(10, 5, 100)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013624", "code": "def count_unique_nodes(graph_str):\n    unique_nodes = set()\n    edges = graph_str.split('\\n')\n    for edge in edges:\n        nodes = edge.split('->')\n        for node in nodes:\n            unique_nodes.add(node.strip())\n    return len(unique_nodes)\n", "entry_point": "count_unique_nodes", "input": "'A -> B\\nB -> C\\nC -> D\\nD -> E'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17791_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013625", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "3, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013626", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "14", "output": "[7, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013627", "code": "def search(s: str, pattern: str) -> int:\n    if len(s) < len(pattern):\n        return 0\n    if s[:len(pattern)] == pattern:\n        return 1 + search(s[len(pattern):], pattern)\n    else:\n        return search(s[1:], pattern)\n", "entry_point": "search", "input": "'abcabcabcabc', 'abc'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118249_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013628", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'3.5'", "output": "'3.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013629", "code": "def longest_substring_with_k_distinct(s, k):\n    max_length = 0\n    start = 0\n    char_count = {}\n    for end in range(len(s)):\n        char_count[s[end]] = char_count.get(s[end], 0) + 1\n        while len(char_count) > k:\n            char_count[s[start]] -= 1\n            if char_count[s[start]] == 0:\n                del char_count[s[start]]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_substring_with_k_distinct", "input": "'aaabbbcc', 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18078_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013630", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'abcdef', 'ghijkl'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013631", "code": "def simulate_card_game(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    ties = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n        else:\n            ties += 1\n    return player1_wins, player2_wins, ties\n", "entry_point": "simulate_card_game", "input": "[1, 3, 5], [2, 3, 5]", "output": "(0, 1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74585_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4181", "output": "{1, 37, 4181, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013633", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[0, 0, 0, 0], [0, 0, 0, 16]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8158", "output": "{1, 2, 8158, 4079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1616", "output": "{1, 2, 4, 101, 808, 8, 202, 1616, 16, 404}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1615", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013636", "code": "def sum_multiples_of_divisor(numbers, divisor):\n    sum_multiples = 0\n    for num in numbers:\n        if num % divisor == 0:\n            sum_multiples += num\n    return sum_multiples\n", "entry_point": "sum_multiples_of_divisor", "input": "[5, 10, 15], 5", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74016_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013637", "code": "from typing import List, Tuple\ndef process_checkbox_state(initial_state: List[Tuple[int, int]], error_location: Tuple[int, int, int]) -> List[Tuple[int, int]]:\n    input_fields = {index: state for index, state in initial_state}\n    checkbox_state = error_location[1] if error_location[0] == error_location[2] else 1 - error_location[1]\n    for index, state in initial_state:\n        if index != error_location[0]:\n            input_fields[index] = checkbox_state\n    return [(index, input_fields[index]) for index in sorted(input_fields.keys())]\n", "entry_point": "process_checkbox_state", "input": "[(0, 0)], (0, 0, 0)", "output": "[(0, 0)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013638", "code": "def countdown_sequence(n):\n    if n <= 0:\n        return []\n    else:\n        return [n] + countdown_sequence(n - 1) + countdown_sequence(n - 2)\n", "entry_point": "countdown_sequence", "input": "4", "output": "[4, 3, 2, 1, 1, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94818_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013639", "code": "def assign_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        else:\n            grades.append('C')\n    return grades\n", "entry_point": "assign_grades", "input": "[80, 85, 82, 88, 83, 81]", "output": "['B', 'B', 'B', 'B', 'B', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4885_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013640", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "6", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013641", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[1, 1, 2, 0, 0, 1, 1, 3, 0]", "output": "[1, 1, 2, 0, 0, 1, 1, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013642", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are 0 or 1 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 76, 76, 76, 82]", "output": "76.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12123_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013643", "code": "FILE_STATUS = (\n    \"\u2601 Uploaded\",\n    \"\u231a Queued\",\n    \"\u2699 In Progress...\",\n    \"\u2705 Success!\",\n    \"\u274c Failed: file not found\",\n    \"\u274c Failed: unsupported file type\",\n    \"\u274c Failed: server error\",\n    \"\u274c Invalid column mapping, please fix it and re-upload the file.\",\n)\ndef get_file_status_message(index):\n    if 0 <= index < len(FILE_STATUS):\n        return FILE_STATUS[index]\n    else:\n        return \"Invalid status index\"\n", "entry_point": "get_file_status_message", "input": "6", "output": "'\u274c Failed: server error'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2319_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013644", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[17, 12, 10, 5]", "output": "(17, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013645", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'rspp, '", "output": "'add rspp, '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013646", "code": "def find_latest_version(versions):\n    def version_key(version):\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    sorted_versions = sorted(versions, key=version_key, reverse=True)\n    return sorted_versions[0]\n", "entry_point": "find_latest_version", "input": "['3.5.0', '3.6.0', '3.6.1']", "output": "'3.6.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42610_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013647", "code": "from typing import List\ndef process_data(data: List[int]) -> int:\n    result = 0\n    for num in data:\n        doubled_num = num * 2\n        if doubled_num % 3 == 0:\n            squared_num = doubled_num ** 2\n            result += squared_num\n    return result\n", "entry_point": "process_data", "input": "[3]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27077_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013648", "code": "def word_frequency(input_list):\n    word_freq = {}\n    for word in input_list:\n        word_lower = word.lower()\n        if word_lower in word_freq:\n            word_freq[word_lower] += 1\n        else:\n            word_freq[word_lower] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "['hello', 'Hello']", "output": "{'hello': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19486_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1367", "output": "{1, 1367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013650", "code": "import math\ndef calculate_cubeside(phys_core_per_node, mpi_rks, np_per_c):\n    total_np = phys_core_per_node * mpi_rks * np_per_c\n    cubeside = int(math.pow(total_np, 1/3))\n    return cubeside\n", "entry_point": "calculate_cubeside", "input": "0, 1, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43876_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013651", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'1', '0', 'cpu', '2.11'", "output": "'1.0-cpu-ml-scala2.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4852", "output": "{1, 2, 4, 4852, 2426, 1213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4851", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "44", "output": "{1, 2, 4, 11, 44, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013654", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "10.0", "output": "'10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013655", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[2, 3, 4, 5]", "output": "[4, 27, 16, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013656", "code": "from typing import List\ndef sum_with_next(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst) - 1):\n        result.append(lst[i] + lst[i + 1])\n    result.append(lst[-1] + lst[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[3, 2, 4, 3, 2, 1, 2]", "output": "[5, 6, 7, 5, 3, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111975_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013657", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'Mr John Smith    ', 13", "output": "'Mr%20John%20Smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013658", "code": "def sort_projections(projection_ids, weights):\n    projection_map = dict(zip(projection_ids, weights))\n    sorted_projections = sorted(projection_ids, key=lambda x: projection_map[x])\n    return sorted_projections\n", "entry_point": "sort_projections", "input": "[0, 2, 2, 2, 3, 3], [1, 2, 2, 2, 3, 3]", "output": "[0, 2, 2, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91067_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013659", "code": "def count_uppercase_letters(input_string):\n    uppercase_count = 0\n    for char in input_string:\n        if char.isupper():\n            uppercase_count += 1\n    return uppercase_count\n", "entry_point": "count_uppercase_letters", "input": "'ABCdef'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13975_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "361", "output": "{1, 19, 361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013661", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "787", "output": "{1, 787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013662", "code": "import math\ndef _3d_tetrahedrons(precision):\n    def volume_fast(a):\n        return a**3 / (6 * math.sqrt(2))\n    def volume_safe(a):\n        return a**3 / (6 * math.sqrt(2))\n    def volume_exact(a):\n        return a**3 / (6 * math.sqrt(2))\n    if precision == 'fast':\n        return volume_fast(10)  # Example edge length of 10 for demonstration\n    elif precision == 'safe':\n        return volume_safe(10)  # Example edge length of 10 for demonstration\n    elif precision == 'exact':\n        return volume_exact(10)  # Example edge length of 10 for demonstration\n    else:\n        return None  # Handle invalid precision levels\n", "entry_point": "_3d_tetrahedrons", "input": "'fast'", "output": "117.85113019775791", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77694_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6322", "output": "{1, 2, 58, 109, 6322, 3161, 218, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6321", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013664", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'fox'", "output": "'fox'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013665", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'longer'", "output": "'longer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013666", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[90, 91, 90, 85, 80]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013667", "code": "from typing import List, Dict, Any\ndef process_events(events: List[Dict[str, Any]]) -> Dict[str, List[str]]:\n    user_events = {}\n    for event in events:\n        event_type = event.get('type')\n        data = event.get('data', {})\n        if event_type == 'reaction_added' or event_type == 'reaction_removed':\n            user_id = data.get('user_id')\n            reaction = data.get('reaction')\n            if user_id:\n                user_events.setdefault(user_id, []).append(reaction)\n        elif event_type == 'app_mention':\n            user_id = data.get('user_id')\n            if user_id:\n                user_events.setdefault(user_id, [])\n        elif event_type == 'command':\n            user_id = data.get('user_id')\n            command = data.get('command')\n            if user_id:\n                user_events.setdefault(user_id, []).append(command)\n    return user_events\n", "entry_point": "process_events", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33206_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013668", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "26, 2", "output": "325", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt73", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013669", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3291", "output": "{3, 1, 1097, 3291}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "451", "output": "{11, 1, 451, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013671", "code": "import string\ndef encrypt_message(message, key):\n    accepted_keys = string.ascii_uppercase\n    encrypted_message = \"\"\n    # Validate the key\n    key_comp = key.replace(\" \", \"\")\n    if not set(key_comp).issubset(set(accepted_keys)):\n        raise ValueError(\"Key contains special characters or integers that are not acceptable values\")\n    # Repeat the key cyclically to match the length of the message\n    key = key * (len(message) // len(key)) + key[:len(message) % len(key)]\n    # Encrypt the message using One-Time Pad encryption\n    for m, k in zip(message, key):\n        encrypted_char = chr(((ord(m) - 65) + (ord(k) - 65)) % 26 + 65)\n        encrypted_message += encrypted_char\n    return encrypted_message\n", "entry_point": "encrypt_message", "input": "'REIJIVRBLCEOVISJIR', 'A'", "output": "'REIJIVRBLCEOVISJIR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111246_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013672", "code": "def simulate_train(commands):\n    position = 0\n    for command in commands:\n        if command == 'F' and position < 10:\n            position += 1\n        elif command == 'B' and position > -10:\n            position -= 1\n    return position\n", "entry_point": "simulate_train", "input": "['F', 'F', 'F', 'F']", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105746_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013673", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'Hello,l!H\\x00\\x01\\x02'", "output": "'Hello,l!H'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013674", "code": "def count_errors(words):\n    errors = 0\n    for word in words:\n        if not word.islower():\n            errors += 1\n    return errors\n", "entry_point": "count_errors", "input": "['hello', 'World', 'Python', 'code']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82716_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013675", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 40, 10, 20, 20]", "output": "[1, 2, 3, 4, 5, 4, 1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013676", "code": "def convert_risk_to_chinese(risk):\n    risk_mapping = {\n        'None': 'None',\n        'Low': '\u4f4e\u5371',\n        'Medium': '\u4e2d\u5371',\n        'High': '\u9ad8\u5371',\n        'Critical': '\u4e25\u91cd'\n    }\n    return risk_mapping.get(risk, 'Unknown')  # Return the Chinese risk level or 'Unknown' if not found\n", "entry_point": "convert_risk_to_chinese", "input": "'Critical'", "output": "'\u4e25\u91cd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46692_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013677", "code": "from typing import List\ndef weighted_sum(methods: List[tuple]) -> float:\n    total_weighted_sum = 0\n    for result, frames in methods:\n        total_weighted_sum += result * frames\n    return total_weighted_sum\n", "entry_point": "weighted_sum", "input": "[(5.0, 1)]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26992_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013678", "code": "def extract_major_version(version: str) -> int:\n    # Find the index of the first dot in the version string\n    dot_index = version.index('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version[:dot_index]\n    # Convert the extracted substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'34.0.0'", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39750_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013679", "code": "def calculate_average_score(scores: list) -> float:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 92, 91, 91, 93, 90, 89, 92, 93]", "output": "91.22222222222223", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100039_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2677", "output": "{1, 2677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4322", "output": "{2161, 1, 4322, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4321", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013682", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[2, 4, 4, 6, 6, 1, 1, 7]", "output": "[2, 4, 4, 6, 6, 1, 1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013683", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4006", "output": "{1, 2, 2003, 4006}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4005", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013684", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7955", "output": "{1, 37, 5, 43, 7955, 1591, 185, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013685", "code": "def most_common_numbers(data):\n    frequency = {}\n    # Count the frequency of each number\n    for num in data:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    most_common = [num for num, freq in frequency.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[5, 5, 5, 1, 2]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95940_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013686", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[0, 1, 2, 7, 0, 0, 3]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013687", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'AAABBBBDD'", "output": "{'A': 3, 'B': 4, 'D': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2398", "output": "{1, 2, 11, 109, 1199, 22, 218, 2398}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013689", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013690", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[5, 5, 4, 2, 2, 2]", "output": "[5, 5, 4, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5951", "output": "{1, 11, 541, 5951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013692", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9827", "output": "{1, 9827, 317, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4206", "output": "{1, 2, 3, 6, 4206, 2103, 1402, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013694", "code": "def is_power_of_two(num: int) -> bool:\n    if num <= 0:\n        return False\n    return num & (num - 1) == 0\n", "entry_point": "is_power_of_two", "input": "8", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9626_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013695", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4677", "output": "{1, 3, 4677, 1559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9187", "output": "{1, 9187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9186", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013697", "code": "from typing import List\ndef majority_element(nums: List[int]) -> int:\n    candidate = None\n    count = 0\n    for num in nums:\n        if count == 0:\n            candidate = num\n            count = 1\n        elif num == candidate:\n            count += 1\n        else:\n            count -= 1\n    return candidate\n", "entry_point": "majority_element", "input": "[4, 4, 4, 4, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126055_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013698", "code": "def calculate_trainable_params(total_params, non_trainable_params):\n    trainable_params = total_params - non_trainable_params\n    return trainable_params\n", "entry_point": "calculate_trainable_params", "input": "25000000, 232116", "output": "24767884", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112905_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013699", "code": "def max_product_of_two(nums):\n    if len(nums) < 2:\n        return 0\n    max_product = float('-inf')\n    second_max_product = float('-inf')\n    for num in nums:\n        if num > max_product:\n            second_max_product = max_product\n            max_product = num\n        elif num > second_max_product:\n            second_max_product = num\n    return max_product * second_max_product if max_product != float('-inf') and second_max_product != float('-inf') else 0\n", "entry_point": "max_product_of_two", "input": "[4, 5, 1, 2]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103728_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013700", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[10, 9, 7], [0, 1, 7]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013701", "code": "def get_parent_directory(file_path):\n    parent_dir = ''\n    for char in file_path[::-1]:\n        if char in ('/', '\\\\'):\n            break\n        parent_dir = char + parent_dir\n    return parent_dir\n", "entry_point": "get_parent_directory", "input": "'/home/user/ifi'", "output": "'ifi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48400_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013702", "code": "def spiralOrder(matrix):\n    if not matrix or not matrix[0]:\n        return []\n    res = []\n    rb, re, cb, ce = 0, len(matrix), 0, len(matrix[0])\n    while len(res) < len(matrix) * len(matrix[0]):\n        # Move right\n        for i in range(cb, ce):\n            res.append(matrix[rb][i])\n        rb += 1\n        # Move down\n        for i in range(rb, re):\n            res.append(matrix[i][ce - 1])\n        ce -= 1\n        # Move left\n        if rb < re:\n            for i in range(ce - 1, cb - 1, -1):\n                res.append(matrix[re - 1][i])\n            re -= 1\n        # Move up\n        if cb < ce:\n            for i in range(re - 1, rb - 1, -1):\n                res.append(matrix[i][cb])\n            cb += 1\n    return res\n", "entry_point": "spiralOrder", "input": "[[1]]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21236_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7753", "output": "{7753, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013704", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'1.0.0'", "output": "'0.9.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013705", "code": "def calculate_sum_of_values(data):\n    total_sum = 0\n    for key, value in data.items():\n        if isinstance(value, (int, float)):\n            if \"S2M\" in key or \"SKIN\" in key:\n                total_sum += value\n    return total_sum\n", "entry_point": "calculate_sum_of_values", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37811_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013706", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "10, 3", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013707", "code": "def calculate_reward(piece_past_movements, rewards=None):\n    rewards = rewards or {1: 0.8, 2: 0.9, 3: 1, 4: 0.9, 5: 0.5, 6: 0.25}\n    n_skips = 0\n    for movement in piece_past_movements:\n        if abs(movement) > 1:\n            n_skips += 1\n    score = rewards.get(n_skips, 0)\n    return score\n", "entry_point": "calculate_reward", "input": "[2, 3, 0, 0]", "output": "0.9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67309_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013708", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/ut'", "output": "'/tmp/ml4pl/data/ut'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013709", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[4, 4, 3, 2]", "output": "{4: 2, 3: 1, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013710", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[4]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013711", "code": "def find_first_duplicate(lst):\n    seen = set()\n    for num in lst:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 0, 2, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92633_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013712", "code": "def determine_game_winner(deck_a, deck_b):\n    rounds_won_a = 0\n    rounds_won_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            rounds_won_a += 1\n        elif card_b > card_a:\n            rounds_won_b += 1\n    if rounds_won_a > rounds_won_b:\n        return 'Player A'\n    elif rounds_won_b > rounds_won_a:\n        return 'Player B'\n    else:\n        return 'Tie'\n", "entry_point": "determine_game_winner", "input": "[1, 2, 3], [1, 2, 3]", "output": "'Tie'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12773_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013713", "code": "def maze_solver(maze):\n    def dfs(row, col, path):\n        if row < 0 or col < 0 or row >= len(maze) or col >= len(maze[0]) or maze[row][col] == '#':\n            return False\n        if row == len(maze) - 1 and col == len(maze[0]) - 1:\n            return True\n        if dfs(row + 1, col, path + ['D']):\n            return True\n        if dfs(row, col + 1, path + ['R']):\n            return True\n        if dfs(row + 1, col + 1, path + ['DR']):\n            return True\n        return False\n    path = []\n    dfs(0, 0, path)\n    return path\n", "entry_point": "maze_solver", "input": "[['#']]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144991_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013714", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[2, 0, 4, 3, 0]", "output": "[2, 2, 6, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013715", "code": "def sum_of_multiples(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 12, 1, 2]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59802_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013716", "code": "from typing import List, Tuple\ndef calculate_overall_bbox(bounding_boxes: List[Tuple[int, int, int, int]]) -> Tuple[int, int, int, int]:\n    x_min = min(box[0] for box in bounding_boxes)\n    y_min = min(box[1] for box in bounding_boxes)\n    x_max = max(box[2] for box in bounding_boxes)\n    y_max = max(box[3] for box in bounding_boxes)\n    return x_min, y_min, x_max, y_max\n", "entry_point": "calculate_overall_bbox", "input": "[(0, 0, 1, 1), (2, 2, 5, 5)]", "output": "(0, 0, 5, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78547_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013717", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "4", "output": "9783.93962050256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013718", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 2, 3, 4]", "output": "[1, 3, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013719", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 31]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013720", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "75", "output": "{1, 3, 5, 75, 15, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt74", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013721", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'1 1 +'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013722", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0.8, 0, 1", "output": "0.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1793", "output": "{1, 11, 163, 1793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1222", "output": "{1, 2, 611, 1222, 13, 47, 26, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013725", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "3, 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013726", "code": "def calculate_total_params(models):\n    total_params = 0\n    for model in models:\n        total_params += model['layers'] * model['params_per_layer']\n    return total_params\n", "entry_point": "calculate_total_params", "input": "[{'layers': 10, 'params_per_layer': 54}]", "output": "540", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45661_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013727", "code": "import re\ndef process_text(text):\n    re_check = re.compile(r\"^[a-z0-9_]+$\")\n    re_newlines = re.compile(r\"[\\r\\n\\x0b]+\")\n    re_multiplespaces = re.compile(r\"\\s{2,}\")\n    re_remindertext = re.compile(r\"( *)\\([^()]*\\)( *)\")\n    re_minuses = re.compile(r\"(?:^|(?<=[\\s/]))[-\\u2013](?=[\\dXY])\")\n    # Remove leading and trailing whitespace\n    text = text.strip()\n    # Replace multiple spaces with a single space\n    text = re_multiplespaces.sub(' ', text)\n    # Remove text enclosed within parentheses\n    text = re_remindertext.sub('', text)\n    # Replace '-' or '\u2013' with a space based on the specified conditions\n    text = re_minuses.sub(' ', text)\n    return text\n", "entry_point": "process_text", "input": "'ete( some random text )(H\u2013Xeo'", "output": "'ete(H\u2013Xeo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124316_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013728", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        if num >= 0:\n            total_sum += num\n            count += 1\n    if count == 0:\n        return 0  # To handle the case when there are no positive numbers\n    return total_sum / count\n", "entry_point": "calculate_average", "input": "[10.0, 10.0, 10.0, 5.0]", "output": "8.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013729", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[3, 7, 3, 5, 7, 1, 1, 1], 7", "output": "[[3, 7, 3, 5, 7, 1, 1], [1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013730", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8152", "output": "{1, 2, 4, 8, 4076, 2038, 8152, 1019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8151", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013731", "code": "from typing import List\ndef bubble_sort_and_count_swaps(arr: List[int]) -> int:\n    swaps = 0\n    n = len(arr)\n    for i in range(n):\n        for j in range(n - i - 1):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swaps += 1\n    return swaps\n", "entry_point": "bubble_sort_and_count_swaps", "input": "[3, 2, 4, 1, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135568_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013732", "code": "def largest_prime_factor(number):\n    factor = 2\n    while factor ** 2 <= number:\n        if number % factor == 0:\n            number //= factor\n        else:\n            factor += 1\n    return max(factor, number)\n", "entry_point": "largest_prime_factor", "input": "19797", "output": "6599", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80074_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013733", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[3, 2, 2, 3, 3, 4, 4, 1, 4]", "output": "[3, 5, 7, 10, 13, 17, 21, 22, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013734", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3443", "output": "{11, 1, 3443, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013735", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if N > len(sorted_scores):\n        N = len(sorted_scores)\n    return sum(sorted_scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[65, 60, 50, 40], 2", "output": "62.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132945_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4553", "output": "{1, 4553, 29, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013737", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'ThisIsThisIsCaTelCase'", "output": "'this_is_this_is_ca_tel_case'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013738", "code": "def categorize_logs(log_messages):\n    categorized_logs = {}\n    for log_level, message in log_messages:\n        if log_level in categorized_logs:\n            categorized_logs[log_level].append(message)\n        else:\n            categorized_logs[log_level] = [message]\n    return categorized_logs\n", "entry_point": "categorize_logs", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23503_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013739", "code": "def find_local_minima(grid):\n    def neighbors(i, j):\n        return {grid[i-1][j], grid[i+1][j], grid[i][j-1], grid[i][j+1]}\n    count = 0\n    for i in range(1, len(grid) - 1):\n        for j in range(1, len(grid[0]) - 1):\n            if all(grid[i][j] < neighbor for neighbor in neighbors(i, j)):\n                count += 1\n    return count\n", "entry_point": "find_local_minima", "input": "[[1, 1, 1], [1, 1, 1], [1, 1, 1]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24574_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013740", "code": "import uuid\ndef generate_product_uuid(existing_uuid):\n    # Convert the existing UUID to uppercase\n    existing_uuid_upper = existing_uuid.upper()\n    # Add the prefix 'PROD_' to the uppercase UUID\n    modified_uuid = 'PROD_' + existing_uuid_upper\n    return modified_uuid\n", "entry_point": "generate_product_uuid", "input": "'455054'", "output": "'PROD_455054'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91223_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013741", "code": "def insert_position(scores, new_score):\n    position = 0\n    for score in scores:\n        if new_score >= score:\n            position += 1\n        else:\n            break\n    return position\n", "entry_point": "insert_position", "input": "[10, 20, 30, 40, 50], 40", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26274_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4865", "output": "{1, 4865, 35, 5, 7, 139, 973, 695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4864", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013743", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[25, 15, 27]", "output": "67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013744", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[5, 1, 1, 2, 2, 4]", "output": "[25, 1, 1, 4, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013745", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[10, [5, 12], 0]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013746", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{1, 2, 3}, {4, 5, 6}", "output": "{1, 2, 3, 4, 5, 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013747", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "577", "output": "{577, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013748", "code": "from typing import List\ndef max_average_score(scores: List[int]) -> float:\n    max_avg = float('-inf')\n    window_sum = 0\n    window_size = 0\n    for score in scores:\n        window_sum += score\n        window_size += 1\n        if window_sum / window_size > max_avg:\n            max_avg = window_sum / window_size\n        if window_sum < 0:\n            window_sum = 0\n            window_size = 0\n    return max_avg\n", "entry_point": "max_average_score", "input": "[0, 2, 4, 5, -1]", "output": "2.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6333_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013749", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[4, 8, 12, 16, 76], 4", "output": "116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013750", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        if height > prev_height:\n            total_area += height\n        else:\n            total_area += prev_height\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[2, 3, 1, 4, 2]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147834_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013751", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.10.1000'", "output": "(0, 10, 1000)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013752", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "12", "output": "[12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013753", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6378", "output": "{1, 2, 3, 6, 1063, 6378, 2126, 3189}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6377", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013754", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "471", "output": "{1, 3, 157, 471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013755", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "33, 33", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013756", "code": "def affordable_options(gold, silver, copper):\n    vic = {\"Province\": 8, \"Duchy\": 5, \"Estate\": 2}\n    tres = {\"Gold\": 6, \"Silver\": 3, \"Copper\": 0}\n    money = gold * 3 + silver * 2 + copper\n    options = []\n    for coin, cost in tres.items():\n        if money >= cost:\n            options.append(coin)\n            break\n    for prov, cost in vic.items():\n        if money >= cost:\n            options.insert(0, prov)\n            break\n    return options\n", "entry_point": "affordable_options", "input": "1, 1, 0", "output": "['Duchy', 'Silver']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49027_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013757", "code": "def find_increase(lines):\n    increase = 0\n    for i in range(1, len(lines)):\n        if lines[i] > lines[i - 1]:\n            increase += 1\n    return increase\n", "entry_point": "find_increase", "input": "[1, 2, 3, 2, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53543_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013758", "code": "def find_smallest_cell(matrix):\n    N = len(matrix)\n    INF = 10 ** 18\n    smallest_value = INF\n    smallest_coords = (0, 0)\n    for y in range(N):\n        for x in range(N):\n            if matrix[y][x] < smallest_value:\n                smallest_value = matrix[y][x]\n                smallest_coords = (y, x)\n    return smallest_coords\n", "entry_point": "find_smallest_cell", "input": "[[0, 1], [1, 1]]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87658_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013759", "code": "def analyze_title(title, max_length):\n    violations = []\n    if not title:\n        violations.append(\"1: B6 Body message is missing\")\n    else:\n        if len(title) > max_length:\n            violations.append(f\"1: T1 Title exceeds max length ({len(title)}>{max_length}): \\\"{title}\\\"\")\n        if title[-1] in ['.', '!', '?']:\n            violations.append(f\"1: T3 Title has trailing punctuation ({title[-1]}): \\\"{title}\\\"\")\n    return '\\n'.join(violations)\n", "entry_point": "analyze_title", "input": "'This', 2", "output": "'1: T1 Title exceeds max length (4>2): \"This\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140551_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013760", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4027", "output": "{1, 4027}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4026", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013761", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "116", "output": "{1, 2, 4, 116, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt115", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013762", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "-2.5", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013763", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[10, 8, 5, 4], 18", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013764", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013765", "code": "def calculate_scores(classes):\n    scores = {}\n    vowels = 'aeiou'\n    for class_name in classes:\n        score = sum(ord(char) for char in class_name if char in vowels)\n        scores[class_name] = score\n    return scores\n", "entry_point": "calculate_scores", "input": "['anxiety', 'depression']", "output": "{'anxiety': 303, 'depression': 418}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62663_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013766", "code": "def dns_lookup(domains, domain_name):\n    if domain_name in domains:\n        return domains[domain_name]\n    else:\n        return \"Domain not found\"\n", "entry_point": "dns_lookup", "input": "{}, 'example.com'", "output": "'Domain not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104462_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013767", "code": "import ast\ndef count_entities(code_snippet):\n    tree = ast.parse(code_snippet)\n    variables = functions = classes = 0\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign):\n            variables += len(node.targets)\n        elif isinstance(node, ast.FunctionDef):\n            functions += 1\n        elif isinstance(node, ast.ClassDef):\n            classes += 1\n    return {\n        'variables': variables,\n        'functions': functions,\n        'classes': classes\n    }\n", "entry_point": "count_entities", "input": "'x = 5'", "output": "{'variables': 1, 'functions': 0, 'classes': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47175_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013768", "code": "from typing import List\ndef find_longest_subarray_with_sum(nums: List[int], target_sum: int) -> List[int]:\n    sum_index_map = {0: -1}\n    current_sum = 0\n    max_length = 0\n    result = []\n    for i, num in enumerate(nums):\n        current_sum += num\n        if current_sum - target_sum in sum_index_map and i - sum_index_map[current_sum - target_sum] > max_length:\n            max_length = i - sum_index_map[current_sum - target_sum]\n            result = nums[sum_index_map[current_sum - target_sum] + 1:i + 1]\n        if current_sum not in sum_index_map:\n            sum_index_map[current_sum] = i\n    return result\n", "entry_point": "find_longest_subarray_with_sum", "input": "[1, 2, 2, 3, 4], 5", "output": "[1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26568_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013769", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "1901, 1000", "output": "901", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013770", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[85] * 24 + [82]", "output": "84.88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143012_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013771", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[-1, -1, 1, 1, 2, 5, 5, 1, 5]", "output": "[0, 0, 6, 12, 24, 50, 66, 56, 104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013772", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/home/'", "output": "'/home'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013773", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num * 3)\n        if num % 5 == 0:\n            processed_list[-1] -= 5\n    return processed_list\n", "entry_point": "process_integers", "input": "[1, 38, 7]", "output": "[3, 40, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11311_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013774", "code": "def calculate_fmeasure(P, R):\n    return 2 * P * R / (P + R + 1e-10)\n", "entry_point": "calculate_fmeasure", "input": "0.8, 0.75", "output": "0.7741935483371489", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11462_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4021", "output": "{1, 4021}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4020", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013776", "code": "def getTotalPage(m, n):\n    page, remaining = divmod(m, n)\n    if remaining != 0:\n        return page + 1\n    else:\n        return page\n", "entry_point": "getTotalPage", "input": "6, 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50511_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013777", "code": "def shift_array(arr, k):\n    effective_shift = k % len(arr)\n    shifted_arr = []\n    for i in range(len(arr)):\n        new_index = (i + effective_shift) % len(arr)\n        shifted_arr.insert(new_index, arr[i])\n    return shifted_arr\n", "entry_point": "shift_array", "input": "[5, 1, 2, 0, 5, 1, 5, -1], 2", "output": "[5, -1, 5, 1, 2, 0, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145368_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013778", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 1:\n        return 0\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    return adjusted_sum / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[80, 82, 89, 86, 75]", "output": "84.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90214_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013779", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[4, 2, 5]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013780", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "84, 2, 42", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013781", "code": "def change_directory(current_dir: str, new_dir: str) -> str:\n    current_dirs = current_dir.split('/')\n    new_dirs = new_dir.split('/')\n    for directory in new_dirs:\n        if directory == '..':\n            if current_dirs:\n                current_dirs.pop()\n        else:\n            current_dirs.append(directory)\n    return '/'.join(current_dirs)\n", "entry_point": "change_directory", "input": "'/home/user', 'photos'", "output": "'/home/user/photos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140324_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013782", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'e:443'", "output": "('https', 'e', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013783", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "311", "output": "{1, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013784", "code": "from typing import List\ndef product_except_self(nums: List[int]) -> List[int]:\n    if not nums:\n        return None\n    n = len(nums)\n    result = [1] * n\n    prod = 1\n    # Calculate prefix products\n    for i in range(n):\n        result[i] = result[i] * prod\n        prod = prod * nums[i]\n    prod = 1\n    # Calculate suffix products and multiply with prefix products\n    for i in range(n-1, -1, -1):\n        result[i] = result[i] * prod\n        prod = prod * nums[i]\n    return result\n", "entry_point": "product_except_self", "input": "[1, 2, 3, 4]", "output": "[24, 12, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109090_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013785", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'oer'", "output": "{'oer': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013786", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "1, -4212, 1", "output": "-4212", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013787", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[3, 5, 2, 7, 5, 5, 4], 4", "output": "[5, 7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9517", "output": "{1, 307, 9517, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013789", "code": "def organize_dependencies(dependencies):\n    dependency_dict = {}\n    for module, dependency in dependencies:\n        if module in dependency_dict:\n            dependency_dict[module].append(dependency)\n        else:\n            dependency_dict[module] = [dependency]\n    return dependency_dict\n", "entry_point": "organize_dependencies", "input": "[('x', 'y'), ('x', 'z'), ('x', 't')]", "output": "{'x': ['y', 'z', 't']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63465_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013790", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 78.8, 79.6, 80.4, 90]", "output": "79.60000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137363_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5285", "output": "{1, 1057, 35, 5, 5285, 7, 755, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013792", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[85, 85, 85, 92, 92, 75, 75, 100]", "output": "{85: 3, 92: 2, 75: 2, 100: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013793", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'MgM'", "output": "'MgM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013794", "code": "from collections import Counter\ndef find_extra_char(s: str, t: str) -> str:\n    counter_s = Counter(s)\n    for ch in t:\n        if ch not in counter_s or counter_s[ch] == 0:\n            return ch\n        else:\n            counter_s[ch] -= 1\n", "entry_point": "find_extra_char", "input": "'', 'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136434_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5870", "output": "{1, 2, 5, 10, 587, 5870, 1174, 2935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5869", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013796", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'applemusic'", "output": "'Applemusic'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013797", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "44", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013798", "code": "def find_equal(lst):\n    seen = {}  # Dictionary to store elements and their indices\n    for i, num in enumerate(lst):\n        if num in seen:\n            return (seen[num], i)  # Return the indices of the first pair of equal elements\n        seen[num] = i\n    return None  # Return None if no pair of equal elements is found\n", "entry_point": "find_equal", "input": "['a', 'b', 'a']", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51954_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013799", "code": "def calculate_circle_area(radius):\n    # Define a constant for pi\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "8", "output": "201.06176", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78790_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013800", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "2147483648", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013801", "code": "from typing import List\ndef change(amount: int, coins: List[int]) -> int:\n    dp = [0] * (amount + 1)\n    dp[0] = 1\n    for coin in coins:\n        for i in range(coin, amount + 1):\n            dp[i] += dp[i - coin]\n    return dp[amount]\n", "entry_point": "change", "input": "5, []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71745_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013802", "code": "def serviceLane(width, cases):\n    result = []\n    for case in cases:\n        start, end = case\n        segment = width[start:end+1]\n        min_width = min(segment)\n        result.append(min_width)\n    return result\n", "entry_point": "serviceLane", "input": "[1, 2, 3], []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129083_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013803", "code": "def process_list(lst, threshold):\n    processed_list = []\n    for num in lst:\n        if num >= threshold:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_list", "input": "[5, 2, 5, 7, 10, 7, 10, 10, 6], 5", "output": "[25, 8, 25, 49, 100, 49, 100, 100, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88444_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013804", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[360], 1", "output": "360.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013805", "code": "def relativ2pixel(detection, frameHeight, frameWidth):\n    center_x, center_y = int(detection[0] * frameWidth), int(detection[1] * frameHeight)\n    width, height = int(detection[2] * frameWidth), int(detection[3] * frameHeight)\n    left, top = int(center_x - width / 2), int(center_y - height / 2)\n    return [left, top, width, height]\n", "entry_point": "relativ2pixel", "input": "[0.5, 0.5, 0.2, 0.3], 600, 800", "output": "[320, 210, 160, 180]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20169_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013806", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[0, 9, 8, 3, 5, 4], 5", "output": "[0, 4, 3, 3, 0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013807", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'3.21.110'", "output": "(3, 21, 110)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013808", "code": "def generate_timestamps(frequency, duration):\n    timestamps = []\n    for sec in range(0, duration+1, frequency):\n        hours = sec // 3600\n        minutes = (sec % 3600) // 60\n        seconds = sec % 60\n        timestamp = f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n        timestamps.append(timestamp)\n    return timestamps\n", "entry_point": "generate_timestamps", "input": "10, 30", "output": "['00:00:00', '00:00:10', '00:00:20', '00:00:30']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12595_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5071", "output": "{1, 11, 461, 5071}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013810", "code": "def calculate_circle_area(radius):\n    # Define a constant for pi\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "6", "output": "113.09724", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78790_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9983", "output": "{1, 67, 149, 9983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4438", "output": "{1, 2, 7, 2219, 14, 4438, 634, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4437", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2485", "output": "{1, 355, 35, 5, 7, 71, 497, 2485}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013814", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'1.31.2', \"'yy'\"", "output": "(1, 31, 2, 'yy')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013815", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[4, 2, 1, 6, 4, 9, 3, 5]", "output": "[6, 3, 7, 10, 13, 12, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013816", "code": "def custom_wrapper(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            modified_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            modified_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            modified_list.append(\"Buzz\")\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "custom_wrapper", "input": "[2, 3, 5, 6, 9, 7]", "output": "[2, 'Fizz', 'Buzz', 'Fizz', 'Fizz', 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139069_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013817", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[14, 2, 8, 10, 2, 4, 4, 2, 2]", "output": "[16, 4, 10, 12, 4, 6, 6, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45782_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013818", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/var/www', '/images/logo.png'", "output": "'/images/logo.png'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013819", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'boubbbbA', 'n (Ben)'", "output": "{'title': 'boubbbbA', 'contrib': 'n (Ben)'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013820", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "101.0, 99.0", "output": "(-50.5, 50.5, 86.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013821", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[5, 5, -1, 6, 5, 9, -2, 5]", "output": "[-2, -1, 5, 5, 5, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013822", "code": "def reverse_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each nucleotide with its complement\n    complemented_sequence = ''.join(complement_dict[nucleotide] for nucleotide in reversed_sequence)\n    return complemented_sequence\n", "entry_point": "reverse_complement", "input": "'ATCGATCGAA'", "output": "'TTCGATCGAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100926_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6911", "output": "{1, 6911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013824", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "\"I&#39;I'm codingm\"", "output": "\"I'I'm codingm\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013825", "code": "def extract_version_numbers(version_str):\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    revision = int(version_components[2].split('.')[0])  # Extract only the numeric part\n    return major, minor, revision\n", "entry_point": "extract_version_numbers", "input": "'4.0.0'", "output": "(4, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110593_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013826", "code": "def word_break(words, s):\n    word_set = set(words)\n    dp = [False] * (len(s) + 1)\n    dp[0] = True\n    for i in range(1, len(s) + 1):\n        for j in range(i):\n            if dp[j] and s[j:i] in word_set:\n                dp[i] = True\n                break\n    return dp[len(s)]\n", "entry_point": "word_break", "input": "['apple', 'pie'], 'applepie'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56861_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013827", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "737", "output": "{1, 67, 11, 737}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013828", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 5, 10, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013829", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'hl'", "output": "'lh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013830", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[7, 3, 4], 14", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013831", "code": "def longest_palindromic_substring(s):\n    size = len(s)\n    if size < 2:\n        return s\n    dp = [[False for _ in range(size)] for _ in range(size)]\n    maxLen = 1\n    start = 0\n    for j in range(1, size):\n        for i in range(0, j):\n            if s[i] == s[j]:\n                if j - i <= 2:\n                    dp[i][j] = True\n                else:\n                    dp[i][j] = dp[i + 1][j - 1]\n            if dp[i][j]:\n                curLen = j - i + 1\n                if curLen > maxLen:\n                    maxLen = curLen\n                    start = i\n    return s[start : start + maxLen]\n", "entry_point": "longest_palindromic_substring", "input": "'bbabababb'", "output": "'bbabababb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74617_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013832", "code": "def string_replace(to_find_string: str, replace_string: str, target_string: str) -> str:\n    index = target_string.find(to_find_string)\n    if index == -1:\n        return target_string\n    beginning = target_string[:index]\n    end = target_string[index + len(to_find_string):]\n    new_string = beginning + replace_string + end\n    return new_string\n", "entry_point": "string_replace", "input": "'f', '', 'ovfelaieca'", "output": "'ovelaieca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61704_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013833", "code": "from typing import List\ndef calculate_score(deck: List[int]) -> int:\n    score = 0\n    prev_card = None\n    for card in deck:\n        if card == prev_card:\n            score = 0\n        else:\n            score += card\n        prev_card = card\n    return score\n", "entry_point": "calculate_score", "input": "[10, 11, 20]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107329_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013834", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'aabbcc123'", "output": "{'a': 2, 'b': 2, 'c': 2, '1': 1, '2': 1, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013835", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2146", "output": "{1, 2146, 2, 37, 74, 1073, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013836", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4081", "output": "{1, 583, 7, 11, 77, 4081, 371, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013837", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    # Split the input string at the '.' character\n    app_name, config_class = default_app_config.split('.')[:2]\n    # Return a tuple containing the app name and configuration class name\n    return app_name, config_class\n", "entry_point": "parse_default_app_config", "input": "'gunmel.apps'", "output": "('gunmel', 'apps')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77517_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013838", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_kb = 0\n    for size in file_sizes:\n        total_size_kb += size / 1024  # Convert bytes to kilobytes\n    return int(total_size_kb)  # Return the total size in kilobytes as an integer\n", "entry_point": "calculate_total_size", "input": "[10240]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87932_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013839", "code": "from collections import deque\ndef find_task_index(N, K, T):\n    ans_dq = deque([0, 0, 0])\n    found = False\n    for i, t in enumerate(T):\n        ans_dq.append(t)\n        ans_dq.popleft()\n        if i >= 2 and sum(ans_dq) < K:\n            return i + 1\n    return -1\n", "entry_point": "find_task_index", "input": "3, 4, [1, 1, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22074_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013840", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "16, 16, 5", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013841", "code": "def remove_duplicates(input_string):\n    if not input_string:\n        return \"\"\n    result = input_string[0]  # Initialize result with the first character\n    for i in range(1, len(input_string)):\n        if input_string[i] != input_string[i - 1]:\n            result += input_string[i]\n    return result\n", "entry_point": "remove_duplicates", "input": "'hehhel'", "output": "'hehel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5338_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5269", "output": "{1, 11, 5269, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013843", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3364", "output": "{1, 2, 3364, 4, 841, 1682, 116, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3363", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013844", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[3, 3, 3, 3, 3, 1, 1, 1, 1]", "output": "[3, 3, 3, 3, 3, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013845", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 7, 14]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013846", "code": "from collections import Counter\ndef find_most_common_element(lst):\n    count = Counter(lst)\n    max_freq = max(count.values())\n    for num in lst:\n        if count[num] == max_freq:\n            return num\n", "entry_point": "find_most_common_element", "input": "[0, 0, 0, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135199_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013847", "code": "def map_variable_to_abbreviation(variable_name):\n    variable_mappings = {\n        '10m_u_component_of_wind': 'u10',\n        '10m_v_component_of_wind': 'v10',\n        '2m_dewpoint_temperature': 'd2m',\n        '2m_temperature': 't2m',\n        'cloud_base_height': 'cbh',\n        'precipitation_type': 'ptype',\n        'total_cloud_cover': 'tcc',\n        'total_precipitation': 'tp',\n        'runoff': 'ro',\n        'potential_evaporation': 'pev',\n        'evaporation': 'e',\n        'maximum_individual_wave_height': 'hmax',\n        'significant_height_of_combined_wind_waves_and_swell': 'swh',\n        'peak_wave_period': 'pp1d',\n        'sea_surface_temperature': 'sst'\n    }\n    if variable_name in variable_mappings:\n        return variable_mappings[variable_name]\n    else:\n        return \"Abbreviation not found\"\n", "entry_point": "map_variable_to_abbreviation", "input": "'2m_temperature'", "output": "'t2m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131015_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013848", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "3, 5", "output": "47.12388980384689", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013849", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "-1", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "956", "output": "{1, 2, 4, 239, 956, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt955", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013851", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4538", "output": "{1, 4538, 2, 2269}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013852", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[30, 48, 50, 52, 90]", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92389_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013853", "code": "def num_leading_zeros(class_num):\n    if class_num < 10:\n        return 4\n    elif class_num < 100:\n        return 3\n    elif class_num < 1000:\n        return 2\n    elif class_num < 10000:\n        return 1\n    else:\n        return 0\n", "entry_point": "num_leading_zeros", "input": "50", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18260_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013854", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[156, 157, 157, 157, 156]", "output": "157", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013855", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "188, 2", "output": "94", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9488", "output": "{1, 2, 1186, 4, 2372, 4744, 8, 9488, 16, 593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9487", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013857", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\begiSbe]'", "output": "'\\\\begiSbe]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013858", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> int:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[69, 70, 71]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105420_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013859", "code": "import re\nfrom typing import List\ndef extract_matches(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-zA-Z0-9]*\\b'  # Define the pattern for matching words\n    matches = re.findall(pattern, text)  # Find all matches in the text\n    unique_matches = list(set(matches))  # Get unique matches by converting to set and back to list\n    return unique_matches\n", "entry_point": "extract_matches", "input": "'sulasses'", "output": "['sulasses']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76446_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013860", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "7", "output": "'111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013861", "code": "def find_largest_number(int_list):\n    # Convert integers to strings for sorting\n    str_list = [str(num) for num in int_list]\n    # Custom sorting based on concatenation comparison\n    str_list.sort(key=lambda x: x*3, reverse=True)\n    # Join the sorted strings to form the largest number\n    max_num = \"\".join(str_list)\n    return max_num\n", "entry_point": "find_largest_number", "input": "[3, 3, 3, 1]", "output": "'3331'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86890_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013862", "code": "def combinationSum(candidates, target):\n    candidates.sort()\n    result = []\n    def combsum(candidates, target, start, path):\n        if target == 0:\n            result.append(path)\n            return\n        for i in range(start, len(candidates)):\n            if candidates[i] > target:\n                break\n            combsum(candidates, target - candidates[i], i, path + [candidates[i]])\n    combsum(candidates, target, 0, [])\n    return result\n", "entry_point": "combinationSum", "input": "[2, 3, 7], 7", "output": "[[2, 2, 3], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38211_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013863", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive > 0:\n        return sum_positive / count_positive\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[5, 6, 7, 12, 5, 5, 1]", "output": "5.857142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60830_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013864", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'Hello World', 0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013865", "code": "def find_runner_up(scores):\n    highest_score = float('-inf')\n    runner_up = float('-inf')\n    for score in scores:\n        if score > highest_score:\n            runner_up = highest_score\n            highest_score = score\n        elif score > runner_up and score != highest_score:\n            runner_up = score\n    return runner_up\n", "entry_point": "find_runner_up", "input": "[1, 0, -1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109289_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013866", "code": "def calculate_distances(S1, S2):\n    map = {}\n    initial = 0\n    distance = []\n    for i in range(26):\n        map[S1[i]] = i\n    for i in S2:\n        distance.append(abs(map[i] - initial))\n        initial = map[i]\n    return distance\n", "entry_point": "calculate_distances", "input": "'abcdefghijklmnopqrstuvwxyz', 'ccdefg'", "output": "[2, 0, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35345_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013867", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:22202]'", "output": "76561197960287930", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8245", "output": "{1, 97, 5, 485, 17, 1649, 8245, 85}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013869", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[4, 3, 3, 3, 4, 2, 0, 5]", "output": "[4, 4, 5, 6, 8, 7, 6, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8156", "output": "{1, 2, 4, 4078, 2039, 8156}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013871", "code": "def pig_latin_converter(input_string):\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    words = input_string.split()\n    pig_latin_words = []\n    for word in words:\n        if word[0] in vowels:\n            pig_latin_words.append(word + 'way')\n        else:\n            first_vowel_index = next((i for i, c in enumerate(word) if c in vowels), None)\n            if first_vowel_index is not None:\n                pig_latin_words.append(word[first_vowel_index:] + word[:first_vowel_index] + 'ay')\n            else:\n                pig_latin_words.append(word)  # Word has no vowels, keep it as it is\n    # Reconstruct the transformed words into a single string\n    output_string = ' '.join(pig_latin_words)\n    return output_string\n", "entry_point": "pig_latin_converter", "input": "'hello aelopr!'", "output": "'ellohay aelopr!way'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10322_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013872", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'loud'", "output": "{'loud': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013873", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7781", "output": "{1, 251, 7781, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013874", "code": "def get_polarities(input_list):\n    polarity_map = {\n        1: -1,\n        0: 1,\n        3: 0,\n        2: None\n    }\n    output_list = []\n    for num in input_list:\n        if num in polarity_map:\n            output_list.append(polarity_map[num])\n        else:\n            output_list.append('Unknown')\n    return output_list\n", "entry_point": "get_polarities", "input": "[1, 0, 2, 4, 5, 1, 0]", "output": "[-1, 1, None, 'Unknown', 'Unknown', -1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26756_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013875", "code": "app_name = \"welfare\"\nurlpatterns = [\n    (\"/\", \"welfare_index\"),\n    (\"/districts\", \"all_districts\"),\n    (\"/district/<str:district_code>\", \"district_schools\"),\n    (\"/school/<str:school_code>\", \"school_students\"),\n    (\"/view_services\", \"view_services\"),\n    (\"/create_service\", \"service_form\"),\n    (\"/edit_service/<int:code>\", \"service_form\"),\n    (\"/student/<int:code>\", \"student_view\"),\n    (\"/student/<int:student_code>/add_service\", \"student_service_form\"),\n    (\"/student/<int:student_code>/edit_service/<int:assoc_id>\", \"student_service_form\"),\n]\ndef find_view_function(url_path: str) -> str:\n    url_to_view = {path: view for path, view in urlpatterns}\n    for path, view in url_to_view.items():\n        if path == url_path:\n            return view\n    return \"Not Found\"\n", "entry_point": "find_view_function", "input": "'/view_services'", "output": "'view_services'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144446_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013876", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'37333'", "output": "37333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013877", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "1.99774345, 7", "output": "1.9977435", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013878", "code": "def find_pair_sum_indices(nums, target):\n    seen = {}  # Dictionary to store numbers seen so far along with their indices\n    for i, num in enumerate(nums):\n        diff = target - num\n        if diff in seen:\n            return (seen[diff], i)\n        seen[num] = i\n    return None\n", "entry_point": "find_pair_sum_indices", "input": "[1, 2], 3", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32000_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013879", "code": "from collections import deque\ndef magical_string(n):\n    if n == 0:\n        return 0\n    S = \"122\"\n    queue = deque(['1', '2'])\n    count = 1\n    for i in range(2, n):\n        next_num = queue.popleft()\n        if next_num == '1':\n            S += '2'\n            count += 1\n        else:\n            S += '1'\n        queue.append('1' if S[i] == '1' else '2')\n    return count\n", "entry_point": "magical_string", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49285_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013880", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9601", "output": "{1, 9601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013881", "code": "def remove_non_alphanumeric(input_str):\n    result = ''\n    for char in input_str:\n        if char.isalnum() or char == '_':\n            result += char\n    return result\n", "entry_point": "remove_non_alphanumeric", "input": "'he@ll#'", "output": "'hell'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139297_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9091", "output": "{1, 9091}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013883", "code": "def custom_wrapper(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            modified_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            modified_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            modified_list.append(\"Buzz\")\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "custom_wrapper", "input": "[15, 7, 1, 17, 2, 7, 1, 16]", "output": "['FizzBuzz', 7, 1, 17, 2, 7, 1, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139069_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013884", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[10, 12, 4, 11, 9, 9, 5]", "output": "([10, 12, 4], [11, 9, 9, 5])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013885", "code": "def cadastralSurvey(pMap):\n    def dfs(row, col):\n        if row < 0 or row >= len(pMap) or col < 0 or col >= len(pMap[0]) or pMap[row][col] == 0 or visited[row][col]:\n            return\n        visited[row][col] = True\n        for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n            dfs(row + dr, col + dc)\n    if not pMap:\n        return 0\n    rows, cols = len(pMap), len(pMap[0])\n    visited = [[False for _ in range(cols)] for _ in range(rows)]\n    distinct_plots = 0\n    for i in range(rows):\n        for j in range(cols):\n            if pMap[i][j] == 1 and not visited[i][j]:\n                dfs(i, j)\n                distinct_plots += 1\n    return distinct_plots\n", "entry_point": "cadastralSurvey", "input": "[[1, 0, 0, 0], [0, 0, 0, 0], [1, 0, 0, 1]]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42053_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013886", "code": "import os\ndef process_libraries(data, path, classpath_separator):\n    libstr = \"\"\n    for library in data.get(\"libraries\", []):\n        if \"rules\" in library and library[\"rules\"]:\n            current_path = os.path.join(path, \"libraries\")\n            lib_path, name, version = library[\"name\"].split(\":\")\n            for l in lib_path.split(\".\"):\n                current_path = os.path.join(current_path, l)\n            current_path = os.path.join(current_path, name, version)\n            native = library.get(\"native\", \"\")\n            if not native:\n                jar_filename = f\"{name}-{version}.jar\"\n            else:\n                jar_filename = f\"{name}-{version}-{native}.jar\"\n            current_path = os.path.join(current_path, jar_filename)\n            libstr += current_path + classpath_separator\n    return libstr\n", "entry_point": "process_libraries", "input": "{'libraries': []}, '/some/path', ':'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104591_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013887", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'abcdefgh'", "output": "(1, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013888", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6896", "output": "{1, 2, 4, 8, 431, 6896, 16, 3448, 1724, 862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6895", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013889", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[1, 1, 2, 2]", "output": "{1: 2, 2: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013890", "code": "def calculate_total_score(scores):\n    total_score = 0\n    for score in scores:\n        if score % 5 == 0 and score % 7 == 0:\n            total_score += score * 4\n        elif score % 5 == 0:\n            total_score += score * 2\n        elif score % 7 == 0:\n            total_score += score * 3\n        else:\n            total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[7, 10, 14, 15]", "output": "113", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93768_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013891", "code": "def process_error_handlers(error_handlers):\n    error_dict = {}\n    for code, template in reversed(error_handlers):\n        error_dict[code] = template\n    return error_dict\n", "entry_point": "process_error_handlers", "input": "[(200, 'success.html.j2')]", "output": "{200: 'success.html.j2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5735_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013892", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'haelhholoo'", "output": "['haelhholoo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013893", "code": "def count_unique_chars(strings):\n    unique_counts = []\n    for string in strings:\n        unique_chars = set()\n        for char in string.lower():\n            if char.isalpha():\n                unique_chars.add(char)\n        unique_counts.append(len(unique_chars))\n    return unique_counts\n", "entry_point": "count_unique_chars", "input": "['ABcd', 'xyZa', '1234abcd', 'mnop!']", "output": "[4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71955_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5471", "output": "{1, 5471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013895", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'ello stHiisi', 2", "output": "{'ello': 1, 'sthiisi': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013896", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7049", "output": "{1, 133, 7, 7049, 1007, 19, 371, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7048", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013897", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "18", "output": "{1, 2, 3, 6, 9, 18}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013898", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/test/path/txt'", "output": "'txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013899", "code": "def find_first_common_element(list_one, list_two):\n    \"\"\"Find and return the first common element between two lists.\"\"\"\n    for element in list_one:\n        if element in list_two:\n            return element\n    return None\n", "entry_point": "find_first_common_element", "input": "[1, 2, 3], [2, 4, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013900", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[90, 80, 80, 70, 60, 50, 40, 30]", "output": "[1, 2, 2, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013901", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'Event', 'Venue (Date)'", "output": "{'title': 'Event', 'contrib': 'Venue (Date)'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5902", "output": "{1, 2, 227, 454, 2951, 13, 5902, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5901", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013903", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'product=Apple quantity=5'", "output": "{'product': 'Apple', 'quantity': '5'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013904", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8997", "output": "{1, 3, 8997, 2999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013905", "code": "import re\ndef extract_unique_words(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Use regular expression to extract words excluding punctuation\n    words = re.findall(r'\\b\\w+\\b', text)\n    # Store unique words in a set\n    unique_words = set(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'Hpypon'", "output": "['hpypon']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103279_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013906", "code": "def extract_filename(log_location: str) -> str:\n    # Find the last occurrence of '/' to identify the start of the filename\n    start_index = log_location.rfind('/') + 1\n    # Find the position of the '.' before the extension\n    end_index = log_location.rfind('.')\n    # Extract the filename between the last '/' and the '.'\n    filename = log_location[start_index:end_index]\n    return filename\n", "entry_point": "extract_filename", "input": "'/var/log/tmp.log'", "output": "'tmp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13809_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013907", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[10, 10, 5], 5", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013908", "code": "def longest_common_substring(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    max_len = 0\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n                max_len = max(max_len, dp[i][j])\n    return max_len\n", "entry_point": "longest_common_substring", "input": "'abcxyz', 'abcdxyz'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58621_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013909", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "' pPyThAmMiNg '", "output": "'ppythamming_11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7432", "output": "{1, 2, 1858, 3716, 4, 929, 7432, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7431", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013911", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[0]", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt81", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013912", "code": "import re\ndef validate_uhl_system_number(uhl_system_number):\n    pattern = r'^([SRFG]\\d{7}|U\\d{7}.*|LB\\d{7}|RTD[\\-0-9]*)$'\n    if not uhl_system_number:\n        return True  # Empty string is considered invalid\n    if not re.match(pattern, uhl_system_number):\n        return True  # Input does not match the specified format rules\n    return False  # Input matches the specified format rules\n", "entry_point": "validate_uhl_system_number", "input": "'S1234567'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138825_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013913", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[0, 0, 0, 5, 3, 1, 2, 2, 4]", "output": "{0: 3, 5: 1, 3: 1, 1: 1, 2: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013914", "code": "def calculate_winner(game):\n    team1, team2, score1, score2 = game.split('_')\n    if int(score1) > int(score2):\n        return team1\n    elif int(score1) < int(score2):\n        return team2\n    else:\n        return \"Draw\"\n", "entry_point": "calculate_winner", "input": "'teamA_n_10_20'", "output": "'n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71038_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013915", "code": "def capitalize_last_letter(string):\n    modified_string = \"\"\n    for word in string.split():\n        if len(word) > 1:\n            modified_word = word[:-1] + word[-1].upper()\n        else:\n            modified_word = word.upper()\n        modified_string += modified_word + \" \"\n    return modified_string[:-1]  # Remove the extra space at the end\n", "entry_point": "capitalize_last_letter", "input": "'The'", "output": "'ThE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101043_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013916", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9586", "output": "{1, 9586, 2, 4793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013917", "code": "def calculate_range(data):\n    if not data:\n        return None  # Handle empty dataset\n    min_val = max_val = data[0]  # Initialize min and max values\n    for num in data[1:]:\n        if num < min_val:\n            min_val = num\n        elif num > max_val:\n            max_val = num\n    return max_val - min_val\n", "entry_point": "calculate_range", "input": "[0, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21170_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013918", "code": "import os\ndef configure_access(password):\n    if password:\n        return 'readwrite'\n    else:\n        return 'readonly'\n", "entry_point": "configure_access", "input": "''", "output": "'readonly'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133597_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013919", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "11", "output": "310464", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013920", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'python tur', 'oNrok'", "output": "'python tur oNrok'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013921", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coeff in coefficients[::-1]:\n        result = result * x + coeff\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[224, 2000], 6", "output": "12224", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110926_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013922", "code": "import json\ndef execute_and_format_result(input_data):\n    try:\n        result = eval(input_data)\n        if type(result) in [list, dict]:\n            return json.dumps(result, indent=4)\n        else:\n            return result\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "execute_and_format_result", "input": "'[1, 2, 3'", "output": "\"Error: '[' was never closed (<string>, line 1)\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97741_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013923", "code": "def find_unique_pairs(lst, target):\n    unique_pairs = set()\n    complements = set()\n    for num in lst:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[1, 2, 3, 4, 5, 6], 7", "output": "[(1, 6), (2, 5), (3, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29529_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013924", "code": "from typing import List\ndef sum_within_ranges(lower_bounds: List[int]) -> int:\n    total_sum = 0\n    for i in range(len(lower_bounds) - 1):\n        start = lower_bounds[i]\n        end = lower_bounds[i + 1]\n        total_sum += sum(range(start, end))\n    total_sum += lower_bounds[-1]  # Add the last lower bound\n    return total_sum\n", "entry_point": "sum_within_ranges", "input": "[-4]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29413_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013925", "code": "def parse_help_message(help_message):\n    category_commands = {}\n    lines = help_message.strip().split('\\n')\n    for line in lines:\n        category_start = line.find('Category: ') + len('Category: ')\n        category_end = line.find(', Commands:')\n        category = line[category_start:category_end].strip()\n        commands_start = line.find('Commands: `') + len('Commands: `')\n        commands_end = line.rfind('`')\n        commands = line[commands_start:commands_end].split(', ')\n        category_commands[category] = commands\n    return category_commands\n", "entry_point": "parse_help_message", "input": "'Category: , Commands: ``'", "output": "{'': ['']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115695_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013926", "code": "def organize_files(paths):\n    organized_files = {}\n    for path in paths:\n        extension = path.split('.')[-1].lower()\n        if extension in organized_files:\n            organized_files[extension].append(path)\n        else:\n            organized_files[extension] = [path]\n    return organized_files\n", "entry_point": "organize_files", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100877_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013927", "code": "import heapq\ndef top_k_frequent_elements(nums, k):\n    freq_map = {}\n    for num in nums:\n        freq_map[num] = freq_map.get(num, 0) + 1\n    heap = [(-freq, num) for num, freq in freq_map.items()]\n    heapq.heapify(heap)\n    top_k = []\n    for _ in range(k):\n        top_k.append(heapq.heappop(heap)[1])\n    return sorted(top_k)\n", "entry_point": "top_k_frequent_elements", "input": "[1, 1, 2, 2, 3, 3], 3", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76714_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013928", "code": "def map_lipid_to_headgroup(lipid_definitions):\n    lipidGroup = [\"CHOL\", \"PC\", \"PE\", \"SM\", \"PS\", \"Glyco\", \"PI\", \"PA\", \"PIPs\", \"CER\", \"Lyso\", \"DAG\"]\n    lipid_mapping = {}\n    for lipid_def in lipid_definitions:\n        lipid_type = lipid_def[0]\n        headgroup_group_id = lipidGroup.index(lipid_type)\n        lipid_mapping[lipid_type] = headgroup_group_id\n    return lipid_mapping\n", "entry_point": "map_lipid_to_headgroup", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126080_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013929", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'4000 - 800 + 33'", "output": "3233", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013930", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 4, 2, 2, 1, 1, -1, 1]", "output": "[4, 4, 6, 4, 5, -6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013931", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013932", "code": "def modify_p(str_line):\n    p = [1] * len(str_line)\n    mx = 1\n    id = 0\n    for i in range(len(str_line)):\n        if str_line[i].isdigit():\n            p[i] = max(p[i-1] + 1, mx)\n        else:\n            p[i] = 1\n    return p\n", "entry_point": "modify_p", "input": "'a1b2c3d4e'", "output": "[1, 2, 1, 2, 1, 2, 1, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149837_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013933", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[2, 2, 2, 4, 4, 6, 8, 3, 5]", "output": "[2, 2, 2, 4, 4, 6, 8, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013934", "code": "def count_pairs_divisible_by_3(nums):\n    nums.sort()\n    l_count = 0\n    m_count = 0\n    result = 0\n    for num in nums:\n        if num % 3 == 1:\n            l_count += 1\n        elif num % 3 == 2:\n            m_count += 1\n    result += l_count * m_count  # Pairs where one element leaves remainder 1 and the other leaves remainder 2\n    result += (l_count * (l_count - 1)) // 2  # Pairs where both elements leave remainder 1\n    result += (m_count * (m_count - 1)) // 2  # Pairs where both elements leave remainder 2\n    return result\n", "entry_point": "count_pairs_divisible_by_3", "input": "[1, 2, 4, 5, 7, 8]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47070_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013935", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[15, 14, 7, 12, 15, 14]", "output": "[7, 12, 14, 14, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013936", "code": "def count_unique_characters(words):\n    unique_counts = []\n    for word in words:\n        unique_chars = set(word)\n        unique_counts.append(len(unique_chars))\n    return unique_counts\n", "entry_point": "count_unique_characters", "input": "['abcd', 'abcde', 'abcdefgh']", "output": "[4, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86819_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013937", "code": "def get_learning_rate(epoch, lr_schedule):\n    closest_epoch = max(filter(lambda x: x <= epoch, lr_schedule.keys()))\n    return lr_schedule[closest_epoch]\n", "entry_point": "get_learning_rate", "input": "5, {1: 0.1, 5: 0.01, 10: 0.001}", "output": "0.01", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78080_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013938", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9595", "output": "{1, 5, 101, 19, 505, 9595, 95, 1919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013939", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[1, 1, 1, 1, 0, 0, 2]", "output": "{1: 4, 0: 2, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013940", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "'A+B-C*D'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013941", "code": "def unique_sum(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "unique_sum", "input": "[4, 7, 10, 11]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140817_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013942", "code": "def second_most_frequent(arr):\n    most_freq = None\n    second_most_freq = None\n    counter = {}\n    second_counter = {}\n    for n in arr:\n        counter.setdefault(n, 0)\n        counter[n] += 1\n        if counter[n] > counter.get(most_freq, 0):\n            second_most_freq = most_freq\n            most_freq = n\n        elif counter[n] > counter.get(second_most_freq, 0) and n != most_freq:\n            second_most_freq = n\n    return second_most_freq\n", "entry_point": "second_most_frequent", "input": "[4, 4, 4, 4, 3, 3, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120689_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013943", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3551", "output": "{1, 67, 53, 3551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013944", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[15.5, 16.0, 16.5, 16.5]", "output": "16.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4873", "output": "{1, 11, 443, 4873}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013946", "code": "def count_consecutive_i(input_str):\n    max_consecutive_i = 0\n    current_consecutive_i = 0\n    for char in input_str:\n        if char == 'i':\n            current_consecutive_i += 1\n            max_consecutive_i = max(max_consecutive_i, current_consecutive_i)\n        else:\n            current_consecutive_i = 0\n    return max_consecutive_i\n", "entry_point": "count_consecutive_i", "input": "'iiiiiiiii'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6207_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013947", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[3, 3, 4, 3, 1, 6, 5, 7]", "output": "[1, 6, 7, 7, 4, 7, 11, 12, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013948", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[12, 8, 12]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013949", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "' pygttg '", "output": "'pygttg_6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013950", "code": "from typing import List\ndef access_control(user_id: int, command: str, authorized_users: List[int]) -> str:\n    if command in ['start', 'help']:\n        return \"All users are allowed to execute this command.\"\n    elif command == 'rnv':\n        if user_id in authorized_users:\n            return \"User is authorized to execute the 'rnv' command.\"\n        else:\n            return \"User is not authorized to execute the 'rnv' command.\"\n    else:\n        if user_id in authorized_users:\n            return \"User is authorized to execute this command.\"\n        else:\n            return \"User is not authorized to execute this command.\"\n", "entry_point": "access_control", "input": "1, 'start', []", "output": "'All users are allowed to execute this command.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20154_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013951", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, 3, 4, 5, 6, -1, -2]", "output": "(6, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013952", "code": "from typing import List, Tuple\ndef card_game(deck1: List[int], deck2: List[int]) -> Tuple[int, int]:\n    score1, score2 = 0, 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score1 += 1\n        elif card2 > card1:\n            score2 += 1\n    return score1, score2\n", "entry_point": "card_game", "input": "[1, 1, 1, 1, 1, 1, 1], [2, 3, 4, 5, 6, 7, 8]", "output": "(0, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28513_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013953", "code": "def fizz_buzz(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            output_list.append('FizzBuzz')\n        elif num % 3 == 0:\n            output_list.append('Fizz')\n        elif num % 5 == 0:\n            output_list.append('Buzz')\n        else:\n            output_list.append(num)\n    return output_list\n", "entry_point": "fizz_buzz", "input": "[1, 2, 3, 4, 5, 15]", "output": "[1, 2, 'Fizz', 4, 'Buzz', 'FizzBuzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117515_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013954", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'Jake', 'dosesh'", "output": "'jdosesh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4952", "output": "{1, 2, 4, 8, 619, 2476, 1238, 4952}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4951", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013956", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "456, {}", "output": "'456-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013957", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'applicatin/apon; c='", "output": "('applicatin', 'apon', '', {'c': ''})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013958", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4102", "output": "{1, 2, 2051, 293, 4102, 7, 586, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013959", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 2, 4, 4, 4, 3]", "output": "[0, 1, 2, 2, 4, 4, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6153", "output": "{1, 2051, 3, 293, 7, 6153, 879, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013961", "code": "def count_invalid_parenthesis(string):\n    count = 0\n    for char in string:\n        if char == \"(\" or char == \"[\" or char == \"{\":\n            count += 1\n        elif char == \")\" or char == \"]\" or char == \"}\":\n            count -= 1\n    return abs(count)\n", "entry_point": "count_invalid_parenthesis", "input": "'()[]{}'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83794_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013962", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013963", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3029", "output": "{1, 13, 233, 3029}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3028", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013964", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 2, 1]", "output": "[5, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013965", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'python'", "output": "['python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013966", "code": "from typing import List, Tuple\ndef exceeds_capacity(bus_stops: List[Tuple[int, int]], capacity: int) -> bool:\n    passengers_count = 0\n    for pick_up, drop_off in bus_stops:\n        passengers_count += pick_up - drop_off\n        if passengers_count > capacity:\n            return True\n    return False\n", "entry_point": "exceeds_capacity", "input": "[(7, 0)], 5", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122685_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013967", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[-80, -83], 2", "output": "-81.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013968", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[1, 2, 3, 4, 0]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013969", "code": "def parse_inventory_data(data: str) -> dict:\n    inventory_dict = {}\n    pairs = data.split(',')\n    for pair in pairs:\n        try:\n            key, value = pair.split(':')\n            key = key.strip()\n            value = value.strip()\n            if value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            elif value.isdigit():\n                value = int(value)\n            inventory_dict[key] = value\n        except (ValueError, AttributeError):\n            # Handle parsing errors by skipping the current pair\n            pass\n    return inventory_dict\n", "entry_point": "parse_inventory_data", "input": "'name: John'", "output": "{'name': 'John'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83492_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013970", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'A', 'ABCDEFGHIJKLMNO'", "output": "0.06666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013971", "code": "def remove_negated_atoms(input_program):\n    rules = input_program.strip().split('\\n')\n    output_program = []\n    for rule in rules:\n        if ':-' in rule and any(literal.startswith('-') for literal in rule.split(':-', 1)[1].split(',')):\n            continue\n        output_program.append(rule)\n    return '\\n'.join(output_program)\n", "entry_point": "remove_negated_atoms", "input": "'f.'", "output": "'f.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89987_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013972", "code": "import re\ndef generate_code(input_string):\n    words = input_string.split()\n    code = ''\n    for word in words:\n        first_letter = re.search(r'[a-zA-Z]', word)\n        if first_letter:\n            code += first_letter.group().lower()\n    return code\n", "entry_point": "generate_code", "input": "'Hello under'", "output": "'hu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30063_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013973", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = scores[i] + exclude\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[5, 0, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60789_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7879", "output": "{1, 7879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7878", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013975", "code": "def filter_api_keys(api_dict):\n    filtered_dict = {}\n    for key, value in api_dict.items():\n        if \"key\" not in key.lower():\n            filtered_dict[key] = value\n    return filtered_dict\n", "entry_point": "filter_api_keys", "input": "{'apiKey': 'value1', 'private_key': 'value2', 'KEY123': 'value3'}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79420_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6305", "output": "{1, 6305, 65, 97, 5, 485, 13, 1261}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1159", "output": "{1, 19, 61, 1159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1158", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013978", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'1.0.1'", "output": "'1.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013979", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "692", "output": "{1, 2, 4, 173, 692, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt691", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013980", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5679", "output": "{1, 3, 1893, 9, 5679, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013981", "code": "def generate_heading(content, level):\n    heading_tags = {\n        1: \"h1\",\n        2: \"h2\",\n        3: \"h3\",\n        4: \"h4\",\n        5: \"h5\",\n        6: \"h6\"\n    }\n    if level not in heading_tags:\n        return \"Invalid heading level. Please provide a level between 1 and 6.\"\n    html_tag = heading_tags[level]\n    return \"<{}>{}</{}>\".format(html_tag, content, html_tag)\n", "entry_point": "generate_heading", "input": "'World', 4", "output": "'<h4>World</h4>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44780_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013982", "code": "def latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_major, current_minor, current_patch = map(int, version.split('.'))\n            latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n            if current_major > latest_major or \\\n                    (current_major == latest_major and current_minor > latest_minor) or \\\n                    (current_major == latest_major and current_minor == latest_minor and current_patch > latest_patch):\n                latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['0.0.1', '0.0.2']", "output": "'0.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94924_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013983", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[8]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96449_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013984", "code": "VERSIONS = {\n    'https://jsonfeed.org/version/1': 'json1',\n    'https://jsonfeed.org/version/1.1': 'json11',\n}\nFEED_FIELDS = (\n    ('title', 'title'),\n    ('icon', 'image'),\n    ('home_page_url', 'link'),\n    ('description', 'description'),\n)\ndef generate_feed_template(version, fields):\n    if version in VERSIONS:\n        template = {'version': VERSIONS[version]}\n        for field in fields:\n            for feed_field, template_field in FEED_FIELDS:\n                if field == feed_field:\n                    template[template_field] = ''\n        return template\n    return {}\n", "entry_point": "generate_feed_template", "input": "'https://jsonfeed.org/version/2', ('title', 'icon')", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31572_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013985", "code": "def generate_unique_constraints_sql(table_columns, constraint_type):\n    sql_commands = []\n    for table, columns in table_columns.items():\n        columns_str = ', '.join(columns)\n        constraint_name = f'unique_{table}_{columns[0]}'\n        sql_command = f'ALTER TABLE {table} ADD CONSTRAINT {constraint_name} UNIQUE ({columns_str});'\n        sql_commands.append(sql_command)\n    return sql_commands\n", "entry_point": "generate_unique_constraints_sql", "input": "{}, ''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34969_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013986", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            total = input_list[i] + input_list[i + 1]\n        elif i == len(input_list) - 1:\n            total = input_list[i] + input_list[i - 1]\n        else:\n            total = input_list[i - 1] + input_list[i] + input_list[i + 1]\n        output_list.append(total)\n    return output_list\n", "entry_point": "process_list", "input": "[1, 2, 3, 4]", "output": "[3, 6, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34585_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013987", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'servers.ServersConfig'", "output": "('servers', 'ServersConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013988", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[13, 13, 13, 12, 11, 10, 14, 15], 15", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013989", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[50, 20, 30, 6, 4, 50, 20]", "output": "[70, 50, 36, 10, 54, 70, 70]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013990", "code": "import re\nRE_NUMBER_VALIDATOR = re.compile(r'^\\d+[.,]\\d+$')\ndef validate_number_format(number: str) -> bool:\n    return bool(RE_NUMBER_VALIDATOR.match(number))\n", "entry_point": "validate_number_format", "input": "'123'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18098_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013991", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[4, 5, 5, 0, 0, 0, 1, 4]", "output": "[4, 1, 0, 0, 0, 5, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013992", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'Smit'", "output": "('Smit', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013993", "code": "def searchMatrix(matrix, target):\n    if not matrix or not matrix[0]:\n        return False\n    rows, cols = len(matrix), len(matrix[0])\n    row, col = 0, cols - 1\n    while row < rows and col >= 0:\n        if matrix[row][col] == target:\n            return True\n        elif matrix[row][col] > target:\n            col -= 1\n        else:\n            row += 1\n    return False\n", "entry_point": "searchMatrix", "input": "[[1, 2, 3], [4, 5, 6]], 0", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115380_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013994", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(0, 0), (0, 5), (-5, -5), (5, 5)]", "output": "{0: [0, 5], -5: [-5], 5: [5]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013995", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[2, 0], [2, -2], [3, 0, 0]]", "output": "[2, 0, 2, -2, 3, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt22", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013996", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'vyshnav mt cv df'", "output": "'Vyshnav Mt Cv Df'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013997", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaaabbbcDe'", "output": "'a4b3c1D1e1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013998", "code": "def sum_fibonacci(n):\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    sum_fib = 1\n    fib_prev = 0\n    fib_curr = 1\n    for _ in range(2, n):\n        fib_next = fib_prev + fib_curr\n        sum_fib += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46852_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0013999", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1036", "output": "{1, 2, 259, 4, 37, 518, 7, 74, 1036, 14, 148, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1035", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014000", "code": "def read_as_dict(result):\n    output = []\n    for row in result:\n        converted_row = {k: v for k, v in row.items()}\n        output.append(converted_row)\n    return output\n", "entry_point": "read_as_dict", "input": "[{}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145315_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014001", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[100, 35]", "output": "135.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014002", "code": "import re\ndef extract_version(input_string):\n    pattern = r\"\\{\\{(.+?)\\}\\}\"\n    match = re.search(pattern, input_string)\n    if match:\n        version_str = match.group(1)\n        try:\n            version_int = int(version_str.replace('.', ''))\n            return version_int\n        except ValueError:\n            return \"Invalid version format\"\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version", "input": "'Here is the version: {{a.b.c}}'", "output": "'Invalid version format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7205", "output": "{1, 1441, 131, 5, 7205, 11, 655, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014004", "code": "def find(char, string):\n    for c in string:\n        if c == char:\n            return True\n    return False\n", "entry_point": "find", "input": "'x', 'abc'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141417_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014005", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 34, 68]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014006", "code": "def calculate_weighted_average(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"The lengths of numbers and weights must be equal.\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    weighted_avg = weighted_sum / total_weight\n    return weighted_avg\n", "entry_point": "calculate_weighted_average", "input": "[2, 3, 4], [1, 1, 1]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131444_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014007", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[34, 3, 12, 2, 54], 5", "output": "[2, 3, 12, 34, 54]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014008", "code": "def get_file_extension(file_path):\n    # Find the last occurrence of the period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring starting from the last period to the end of the file path\n    if last_period_index != -1:  # Check if a period was found\n        file_extension = file_path[last_period_index:]\n        return file_extension\n    else:\n        return \"\"  # Return an empty string if no period was found\n", "entry_point": "get_file_extension", "input": "'myfile.gz'", "output": "'.gz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141157_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014009", "code": "import re\ndef extract_unique_words(text):\n    unique_words = set()\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word = ''.join(char for char in word if char.isalnum())\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'hhhell.'", "output": "['hhhell']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13022_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014010", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "14", "output": "'SELINUX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014011", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[(1, 50), (2, 75)]", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5378", "output": "{1, 5378, 2, 2689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5377", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014013", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[-2, -1, 3, -4, -2, 2, 3, 3, -1]", "output": "[-2, -3, 0, -4, -6, -4, -1, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014014", "code": "def sum_of_digit_squares(n):\n    sum_squares = 0\n    for digit in str(n):\n        digit_int = int(digit)\n        sum_squares += digit_int ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "12", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28638_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014015", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[40, 50, 50, 50, 60]", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105025_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014016", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'ipspsumi'", "output": "{'ipspsumi': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3761", "output": "{1, 3761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3033", "output": "{1, 3, 9, 337, 1011, 3033}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014019", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[3, 6, 10]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014020", "code": "def longest_subsequence_length(arr):\n    if len(arr) == 1:\n        return 1\n    ans = 1\n    sub_len = 1\n    prev = 2\n    for i in range(1, len(arr)):\n        if arr[i] > arr[i - 1] and prev != 0:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        elif arr[i] < arr[i - 1] and prev != 1:\n            sub_len += 1\n            ans = max(ans, sub_len)\n        else:\n            sub_len = 1\n        prev = 0 if arr[i] > arr[i - 1] else 1 if arr[i] < arr[i - 1] else 2\n    return ans\n", "entry_point": "longest_subsequence_length", "input": "[1, 2, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82692_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014021", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'app.config.sensoAtsenafig'", "output": "'sensoAtsenafig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014022", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[3, 4, 5, 6]", "output": "[3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6353", "output": "{1, 6353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014024", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "23", "output": "0.01826086956521739", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014025", "code": "def most_frequent_word(text):\n    word_freq = {}\n    # Split the text into individual words\n    words = text.split()\n    # Count the frequency of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    # Find the word with the highest frequency\n    most_frequent = max(word_freq, key=word_freq.get)\n    return most_frequent, word_freq[most_frequent]\n", "entry_point": "most_frequent_word", "input": "'wodrld foo'", "output": "('wodrld', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51755_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014026", "code": "def calculate_avg_headcount(daily_menus, real_headcounts):\n    headcount_sum = {}\n    headcount_count = {}\n    for menu in daily_menus:\n        cafeteria_id = menu['cafeteria_id']\n        if cafeteria_id not in headcount_sum:\n            headcount_sum[cafeteria_id] = 0\n            headcount_count[cafeteria_id] = 0\n    for headcount in real_headcounts:\n        cafeteria_id = next((menu['cafeteria_id'] for menu in daily_menus if menu['date_id'] == headcount['date_id']), None)\n        if cafeteria_id:\n            headcount_sum[cafeteria_id] += headcount['n']\n            headcount_count[cafeteria_id] += 1\n    avg_headcount = {cafeteria_id: headcount_sum[cafeteria_id] / headcount_count[cafeteria_id] if headcount_count[cafeteria_id] > 0 else 0 for cafeteria_id in headcount_sum}\n    return avg_headcount\n", "entry_point": "calculate_avg_headcount", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117877_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014027", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1503", "output": "1463", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014028", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'es_api_key=apikey123'", "output": "{'es_api_key': 'apikey123'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014029", "code": "def min_execution_time(tasks, cooldown):\n    cooldowns = {}\n    time = 0\n    for task in tasks:\n        if task in cooldowns and cooldowns[task] > time:\n            time = cooldowns[task]\n        time += 1\n        cooldowns[task] = time + cooldown\n    return time\n", "entry_point": "min_execution_time", "input": "['A', 'A', 'B', 'A'], 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133436_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014030", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['0.9.9', '1.0.0', '1.1.1']", "output": "'1.1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49230_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014031", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9937", "output": "{523, 1, 19, 9937}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014032", "code": "def encrypt_string(input_str):\n    encrypted_str = ''\n    for i in range(0, len(input_str)-1, 2):\n        encrypted_str += input_str[i+1] + input_str[i]\n    if len(input_str) % 2 != 0:\n        encrypted_str += input_str[-1]\n    return encrypted_str\n", "entry_point": "encrypt_string", "input": "'hello'", "output": "'ehllo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81450_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014033", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "11, 13", "output": "143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2825", "output": "{1, 5, 2825, 113, 565, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014035", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'This is a short text.'", "output": "'This is a short text.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014036", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'PytPythonHon'", "output": "{'pytpythonhon': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014037", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "13, 31", "output": "[13, 17, 19, 23, 29, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014038", "code": "def split_input_target(chunk):\n    input_text = chunk[:-1]\n    target_text = chunk[1:]\n    return input_text, target_text\n", "entry_point": "split_input_target", "input": "''", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41781_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014039", "code": "def plus_one(digits):\n    n = len(digits)\n    for i in range(n-1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    new_num = [0] * (n+1)\n    new_num[0] = 1\n    return new_num\n", "entry_point": "plus_one", "input": "[0]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123786_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014040", "code": "from typing import List\ndef plusOne(digits: List[int]) -> List[int]:\n    n = len(digits)\n    for i in range(n - 1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    return [1] + digits\n", "entry_point": "plusOne", "input": "[9, 9, 9, 9, 9, 9, 9, 9]", "output": "[1, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88559_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014041", "code": "def closest_three_sum(nums, target):\n    nums.sort()\n    closest_sum = float('inf')\n    closest_diff = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            current_diff = abs(current_sum - target)\n            if current_diff < closest_diff:\n                closest_sum = current_sum\n                closest_diff = current_diff\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return current_sum\n    return closest_sum\n", "entry_point": "closest_three_sum", "input": "[-1, -1, -3, 2, 4], -5", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34495_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014042", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "1.15, 1.0", "output": "1.15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014043", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014044", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[5, 0, -7, 5, 4, 2, -7, 5, 0]", "output": "[0, 5, 7, 2, 4, 5, 7, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014045", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[3, 3, 5, 1, 1, 4, 1, 3]", "output": "[6, 8, 6, 2, 5, 5, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014046", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024  # Convert bytes to kilobytes\n    return total_size_kb\n", "entry_point": "calculate_total_size", "input": "[10240, 2048, 2048]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73966_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014047", "code": "def sum_divisible_numbers(start, end, divisor):\n    sum_divisible = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            sum_divisible += num\n    return sum_divisible\n", "entry_point": "sum_divisible_numbers", "input": "1, 36, 12", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31930_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014048", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9461", "output": "{1, 9461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014049", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3646", "output": "{1, 2, 3646, 1823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014050", "code": "def max_consecutive_same_items(nums):\n    max_consecutive = 0\n    current_num = None\n    consecutive_count = 0\n    for num in nums:\n        if num == current_num:\n            consecutive_count += 1\n        else:\n            current_num = num\n            consecutive_count = 1\n        max_consecutive = max(max_consecutive, consecutive_count)\n    return max_consecutive\n", "entry_point": "max_consecutive_same_items", "input": "[1, 1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138973_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014051", "code": "def analyze_strings(strings):\n    positions = {}\n    most_common = ''\n    least_common = ''\n    for line in strings:\n        for i, c in enumerate(line):\n            v = positions.setdefault(i, {}).setdefault(c, 0)\n            positions[i][c] = v + 1\n    for p in positions.values():\n        s = sorted(p.items(), key=lambda kv: kv[1], reverse=True)\n        most_common += s[0][0]\n        least_common += s[-1][0]\n    return most_common, least_common\n", "entry_point": "analyze_strings", "input": "['abc', 'ghi']", "output": "('abc', 'ghi')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43933_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014052", "code": "def calculate_average_rates(products):\n    average_rates = {}\n    for product in products:\n        product_name = list(product.keys())[0]\n        rates = product[product_name]\n        average_rate = sum(rates) / len(rates)\n        average_rates[product_name] = average_rate\n    return average_rates\n", "entry_point": "calculate_average_rates", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53950_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014053", "code": "def slice_list(lst, start=None, end=None):\n    if start is not None and end is not None:\n        return lst[start:end]\n    elif start is not None:\n        return lst[start:]\n    elif end is not None:\n        return lst[:end]\n    else:\n        return lst\n", "entry_point": "slice_list", "input": "[10, 79, 100, 200], start=0, end=2", "output": "[10, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93892_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014054", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "834", "output": "{417, 1, 834, 2, 3, 6, 139, 278}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014055", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "166", "output": "{1, 2, 83, 166}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014056", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[75, 85, 70, 80, 100, 75, 90, 70]", "output": "[5, 3, 6, 4, 1, 5, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014057", "code": "def is_valid_parentheses(sequence: str) -> bool:\n    stack = []\n    mapping = {')': '('}\n    for char in sequence:\n        if char == '(':\n            stack.append(char)\n        elif char == ')':\n            if not stack or stack.pop() != '(':\n                return False\n    return len(stack) == 0\n", "entry_point": "is_valid_parentheses", "input": "'()'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11303_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014058", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[1, 1, 2, 2, 3, 4, 4, 12]", "output": "(3, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014059", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[10, 8, 7, 10, 8, 9, 10, 1, 7]", "output": "[10, 9, 9, 13, 12, 14, 16, 8, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014060", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'chh'", "output": "'chh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7226", "output": "{1, 7226, 2, 3613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014062", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2229", "output": "{1, 3, 2229, 743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2228", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014063", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 66527069, 1", "output": "66527069", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014064", "code": "def extract_module_names(script):\n    module_names = set()\n    for line in script.split('\\n'):\n        if line.strip().startswith('import'):\n            modules = line.split('import')[1].strip().split(',')\n            for module in modules:\n                module_names.add(module.strip())\n        elif line.strip().startswith('from'):\n            module = line.split('from')[1].split('import')[0].strip()\n            module_names.add(module)\n    return list(module_names)\n", "entry_point": "extract_module_names", "input": "'import colts'", "output": "['colts']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66749_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014065", "code": "def calculate_total_sum(videoFiles):\n    total_sum = 0\n    for video_file in videoFiles:\n        number = int(video_file.split('_')[1].split('.')[0])\n        total_sum += number\n    return total_sum\n", "entry_point": "calculate_total_sum", "input": "['video_30.mp4', 'video_40.mp4', 'video_30.mp4']", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146951_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014066", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'40.1.2'", "output": "(40, 1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014067", "code": "def process_input_files(path, input_files):\n    file_contents = {}\n    for file_name, file_path in input_files.items():\n        try:\n            with open(file_path, 'r') as file:\n                file_contents[file_name] = file.read()\n        except FileNotFoundError:\n            print(f\"File not found: {file_path}\")\n    return file_contents\n", "entry_point": "process_input_files", "input": "'dummy_path', {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108255_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2939", "output": "{1, 2939}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014069", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 85, 70, 70, 60, 50]", "output": "[100, 90, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014070", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<<IL>>>'", "output": "'<<IL>>>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014071", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 2, 2, 3, 2, 3]", "output": "[7, 4, 5, 5, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73916_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014072", "code": "def process_question(data):\n    question_id = data.get(\"question_id\")\n    if question_id:\n        return f\"Updating question with ID: {question_id}\"\n    else:\n        return \"No question ID provided, cannot update\"\n", "entry_point": "process_question", "input": "{}", "output": "'No question ID provided, cannot update'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76905_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014073", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'ThTh'", "output": "'ThTh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014074", "code": "def simulate_obfuscation(utils_path, project_path):\n    return f'{utils_path}/confuser/Confuser.CLI.exe {project_path} -n'\n", "entry_point": "simulate_obfuscation", "input": "'ss', 'C:/prjec'", "output": "'ss/confuser/Confuser.CLI.exe C:/prjec -n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52083_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014075", "code": "import ast\nfrom collections import defaultdict\ndef count_imports_from_code(code):\n    tree = ast.parse(code)\n    imports = defaultdict(int)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                imports[alias.name.split('.')[0]] += 1\n        elif isinstance(node, ast.ImportFrom):\n            imports[node.module] += 1\n    return dict(imports)\n", "entry_point": "count_imports_from_code", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39486_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014076", "code": "def rearrange_possible(a_list):\n    multi4 = len([a for a in a_list if a % 4 == 0])\n    odd_num = len([a for a in a_list if a % 2 != 0])\n    even_num = len(a_list) - odd_num\n    not4 = even_num - multi4\n    if not4 > 0:\n        if odd_num <= multi4:\n            return \"Yes\"\n        else:\n            return \"No\"\n    else:\n        if odd_num <= multi4 + 1:\n            return \"Yes\"\n        else:\n            return \"No\"\n", "entry_point": "rearrange_possible", "input": "[4, 4, 2, 1, 3]", "output": "'Yes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48198_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1999", "output": "{1, 1999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014078", "code": "def process_mesh_files(sfm_fp, mesh_fp, image_dp):\n    log_messages = []\n    if mesh_fp is not None:\n        log_messages.append(\"Found the following mesh file: \" + mesh_fp)\n    else:\n        log_messages.append(\"Request target mesh does not exist in this project.\")\n    return log_messages\n", "entry_point": "process_mesh_files", "input": "None, 'h/to//mte', None", "output": "['Found the following mesh file: h/to//mte']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140821_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014079", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[3, 1, 2, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014080", "code": "from typing import List\ndef jaccard_similarity(list1: List[int], list2: List[int]) -> float:\n    set1 = set(list1)\n    set2 = set(list2)\n    intersection_size = len(set1.intersection(set2))\n    union_size = len(set1.union(set2))\n    jaccard_index = intersection_size / union_size if union_size != 0 else 0\n    return round(jaccard_index, 2)\n", "entry_point": "jaccard_similarity", "input": "[1, 2, 3], [1, 2, 4, 5, 6, 7]", "output": "0.29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21146_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014081", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            dp[i] = scores[i] + dp[i - 1]\n        else:\n            dp[i] = scores[i]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[5, 10, 15, 18]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40146_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014082", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "'og:title=Title!'", "output": "{'og:title': 'Title!'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014083", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[3, 1, 55, 1, 3, 22, 0, 6, 0]", "output": "([3, 1, 55, 1, 3], [22, 0, 6, 0])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014084", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'ListChartsConFillIt'", "output": "'listchartsconfillit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014085", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1.3.3-22-gdf81228'", "output": "'1.3.3+22.gdf81228'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3987", "output": "{1, 3, 9, 1329, 3987, 443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014087", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "6", "output": "'1 1 2 2 3 4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014088", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 2, 4, 5, 5]", "output": "[5, 6, 9, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014089", "code": "from typing import List\ndef count_scrolls(scroll_heights: List[int]) -> int:\n    scroll_count = 0\n    for i in range(1, len(scroll_heights)):\n        if scroll_heights[i] > scroll_heights[i - 1]:\n            scroll_count += 1\n    return scroll_count\n", "entry_point": "count_scrolls", "input": "[1, 2, 3, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70066_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2611", "output": "{1, 2611, 373, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014091", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "97.0, 14, 8", "output": "(101.7336, 13.580000000000002, 8.846400000000001)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014092", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "11, 29", "output": "[11, 13, 17, 19, 23, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014093", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3502", "output": "{1, 2, 34, 103, 3502, 206, 17, 1751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3501", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014094", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[10], [20, 30]]", "output": "[10, 20, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014095", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'ping ping'", "output": "{'p': 2, 'i': 2, 'n': 2, 'g': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29002_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014096", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'hello:world;how*ae?you'", "output": "['hello', 'world', 'how', 'ae', 'you']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014097", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'5:30 PM', '2:17'", "output": "'7:47 PM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014098", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[3, 3, 3, 1, 2]", "output": "[(3, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014099", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 3, 1, 2, 2, 7, 1, 1, 1]", "output": "[7, 4, 3, 5, 6, 12, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25747_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014100", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'130.1.300'", "output": "(130, 1, 300)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014101", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[1, 2, 3, 5, 5]", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014102", "code": "def extract_log_messages(input_string):\n    unique_log_messages = set()\n    start_phrase = 'logger.debug(\"'\n    end_phrase = '\")'\n    start_index = input_string.find(start_phrase)\n    while start_index != -1:\n        end_index = input_string.find(end_phrase, start_index + len(start_phrase))\n        if end_index != -1:\n            log_message = input_string[start_index + len(start_phrase):end_index]\n            unique_log_messages.add(log_message)\n            start_index = input_string.find(start_phrase, end_index)\n        else:\n            break\n    return list(unique_log_messages)\n", "entry_point": "extract_log_messages", "input": "'logger.debug(\"Processingsult\")'", "output": "['Processingsult']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38515_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014103", "code": "def count_pairs_divisible_by_3(nums):\n    nums.sort()\n    l_count = 0\n    m_count = 0\n    result = 0\n    for num in nums:\n        if num % 3 == 1:\n            l_count += 1\n        elif num % 3 == 2:\n            m_count += 1\n    result += l_count * m_count  # Pairs where one element leaves remainder 1 and the other leaves remainder 2\n    result += (l_count * (l_count - 1)) // 2  # Pairs where both elements leave remainder 1\n    result += (m_count * (m_count - 1)) // 2  # Pairs where both elements leave remainder 2\n    return result\n", "entry_point": "count_pairs_divisible_by_3", "input": "[1, 1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47070_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014104", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3884", "output": "{1, 2, 4, 971, 3884, 1942}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3883", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014105", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[3, 4, 3, 3, 4, 4, 3, 2, 3]", "output": "[3, 4, 3, 3, 4, 4, 3, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014106", "code": "def maximum_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product_of_three", "input": "[5, 5, 6]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93080_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "733", "output": "{1, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014108", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 21", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014109", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[4, 4, 4, 8, 9, 7, 7, 1]", "output": "[4, 4, 4, 8, 9, 7, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014110", "code": "from typing import List\ndef single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "single_number", "input": "[2, 2, 3, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118847_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014111", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'Cchalon'", "output": "['Cchalon']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4087", "output": "{1, 67, 61, 4087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014113", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[37, 30, 91, 11, 35, 64, 37]", "output": "[11, 30, 35, 37, 37, 64, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014114", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'whelloorld'", "output": "['whelloorld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014115", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "583", "output": "{1, 11, 53, 583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014116", "code": "JOB_STATES = {\n    'Q': 'QUEUED',\n    'H': 'HELD',\n    'R': 'RUNNING',\n    'E': 'EXITING',\n    'T': 'MOVED',\n    'W': 'WAITING',\n    'S': 'SUSPENDED',\n    'C': 'COMPLETED',\n}\ndef map_job_states(job_state_codes):\n    job_state_mapping = {}\n    for code in job_state_codes:\n        if code in JOB_STATES:\n            job_state_mapping[code] = JOB_STATES[code]\n    return job_state_mapping\n", "entry_point": "map_job_states", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40681_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014117", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 7, 7, 1, 2, 3, 2, 1, 1]", "output": "[7, 8, 9, 4, 6, 8, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014118", "code": "def calculate_luminance(r, g, b):\n    luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b\n    return round(luminance, 2)\n", "entry_point": "calculate_luminance", "input": "255, 255, 255", "output": "255.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28393_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014119", "code": "def remove_consecutive_duplicates(s: str) -> str:\n    results = []\n    for c in s:\n        if len(results) == 0 or results[-1] != c:\n            results.append(c)\n    return \"\".join(results)\n", "entry_point": "remove_consecutive_duplicates", "input": "'aabbcc'", "output": "'abc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101236_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014120", "code": "def find_indices(nums, target):\n    num_indices = {}\n    for index, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], index]\n        num_indices[num] = index\n    return []\n", "entry_point": "find_indices", "input": "[1, 3, 4], 7", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23894_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014121", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'version.'", "output": "'version.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8813", "output": "{1, 1259, 8813, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014123", "code": "from collections import defaultdict\ndef find_original_song(alias):\n    music_aliases = {\n        'alias1': ['song1', 'song2'],\n        'alias2': ['song3']\n    }\n    original_songs = music_aliases.get(alias.lower(), [])\n    if original_songs:\n        return original_songs[0]\n    else:\n        return \"Alias not found\"\n", "entry_point": "find_original_song", "input": "'alias2'", "output": "'song3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5621_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014124", "code": "# Given set of valid PEN values\nVALID_PENS = {1588, 1234, 5678, 9999}  # Example valid PEN values\ndef validate_pen(pen):\n    return pen in VALID_PENS\n", "entry_point": "validate_pen", "input": "1234", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014125", "code": "def tokenize_unmatched_parentheses(tokens):\n    result = []\n    stack = []\n    for token in tokens:\n        temp = ''\n        for char in token:\n            if char == '(':\n                if temp:\n                    result.append(temp)\n                    temp = ''\n                stack.append('(')\n            elif char == ')':\n                if stack:\n                    stack.pop()\n                    if temp:\n                        result.append(temp)\n                        temp = ''\n                    result.append(')')\n                else:\n                    result.append(')')\n            else:\n                temp += char\n        if temp:\n            result.append(temp)\n    while stack:\n        result.append(stack.pop())\n    return result\n", "entry_point": "tokenize_unmatched_parentheses", "input": "['x(', 'y', 'z', ')']", "output": "['x', 'y', 'z', ')']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014126", "code": "from typing import List, Tuple\ndef above_average_count(scores: List[int]) -> Tuple[float, int]:\n    total_students = len(scores)\n    total_score = sum(scores)\n    average_score = round(total_score / total_students, 2)\n    above_average_count = sum(score > average_score for score in scores)\n    return average_score, above_average_count\n", "entry_point": "above_average_count", "input": "[70, 70, 70, 75, 75, 75, 75, 75, 75]", "output": "(73.33, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65850_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014127", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "0, 19.0", "output": "19.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014128", "code": "def calculate_easter_date(anno, m, n):\n    a = anno % 19\n    b = anno % 4\n    c = anno % 7\n    d = (19 * a + m) % 30\n    e = (2 * b + 4 * c + 6 * d + n) % 7\n    day = d + e\n    if day < 10:\n        day += 22\n        month = 3\n    else:\n        day -= 9\n        month = 4\n        if (day == 26) or ((day == 25) and (d == 28) and (e == 6) and (a > 10)):\n            day -= 7\n    # Adjust year if necessary\n    if month == 3 and day > 31:\n        day -= 31\n        month = 4\n    return day, month, anno\n", "entry_point": "calculate_easter_date", "input": "2016, 0, 1", "output": "(30, 3, 2016)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112411_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014129", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[1, 1, 2, 4, 2, 2, 4]", "output": "[2, 2, 4, 8, 4, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3758", "output": "{1, 2, 3758, 1879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2207", "output": "{1, 2207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014132", "code": "def find_most_common_token(tokens):\n    token_freq = {}\n    for token in tokens:\n        if token in token_freq:\n            token_freq[token] += 1\n        else:\n            token_freq[token] = 1\n    max_freq = 0\n    most_common_token = None\n    for token, freq in token_freq.items():\n        if freq > max_freq:\n            max_freq = freq\n            most_common_token = token\n    return most_common_token\n", "entry_point": "find_most_common_token", "input": "['apple', 'banana', 'apple']", "output": "'apple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103771_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014133", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "457, {}", "output": "'457-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014134", "code": "def zellerAlgorithm(year, month, day):\n    if month in [1, 2]:\n        y1 = year - 1\n        m1 = month + 12\n    else:\n        y1 = year\n        m1 = month\n    y2 = y1 % 100\n    c = y1 // 100\n    day_of_week = (day + (13 * (m1 + 1)) // 5 + y2 + y2 // 4 + c // 4 - 2 * c) % 7\n    return day_of_week\n", "entry_point": "zellerAlgorithm", "input": "2023, 1, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86862_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014135", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive > 0:\n        return sum_positive / count_positive\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[1, 2, 3, 5, 8, 9, 5]", "output": "4.714285714285714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60830_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014136", "code": "def unsolved_questions_count(questions):\n    unsolved_count = 0\n    for question in questions:\n        if not question['is_solved']:\n            unsolved_count += 1\n    return unsolved_count\n", "entry_point": "unsolved_questions_count", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109144_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014137", "code": "def find_modes(data):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in data:\n        frequency_dict[num] = frequency_dict.get(num, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[2, 2, 1]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69194_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014138", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import math'", "output": "'math'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9007", "output": "{1, 9007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2057", "output": "{1, 2057, 11, 17, 121, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014141", "code": "def min_divisor_expression(N):\n    ans = float('inf')  # Initialize ans to positive infinity\n    for n in range(1, int(N ** 0.5) + 1):\n        if N % n == 0:\n            ans = min(ans, n + N // n - 2)\n    return ans\n", "entry_point": "min_divisor_expression", "input": "49", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115935_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014142", "code": "import re\ndef check_program_names(programs):\n    secure_pattern = re.compile(r'^[\\w]+$')\n    return [bool(secure_pattern.match(program)) for program in programs]\n", "entry_point": "check_program_names", "input": "['program_one', 'Program2', 'program@Three']", "output": "[True, True, False]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5995_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5765", "output": "{1, 5, 1153, 5765}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014144", "code": "import re\ndef decode_entities(xml_string):\n    def replace_entity(match):\n        entity = match.group(0)\n        if entity == '&amp;':\n            return '&'\n        # Add more entity replacements as needed\n        return entity\n    return re.sub(r'&\\w+;', replace_entity, xml_string)\n", "entry_point": "decode_entities", "input": "'<x>Souffl&amp;</x>'", "output": "'<x>Souffl&</x>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014145", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'1.2.1', 8077", "output": "'http://1.2.1:8077'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014146", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'11.7.111'", "output": "(11, 7, 111)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014147", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'22..0.022..00.', 'forms.FlCo'", "output": "\"[22..0.022..00.]: 'forms.FlCo'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014148", "code": "def count_unique_words(strings):\n    unique_word_counts = {}\n    for string in strings:\n        words = string.split()\n        unique_words = set(word.lower() for word in words)\n        unique_word_counts[string] = len(unique_words)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "['World!', 'Hello, word!']", "output": "{'World!': 1, 'Hello, word!': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144864_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014149", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[13, 18, 7]", "output": "(18, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7376", "output": "{1, 2, 4, 3688, 8, 461, 7376, 16, 1844, 922}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014151", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[8, 9, 8, 1]", "output": "576", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014152", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'how hello world'", "output": "'woh olleh dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014153", "code": "def merge_metadata_dicts(metadata_dicts):\n    merged_dict = {}\n    for metadata_dict in metadata_dicts:\n        for key, value in metadata_dict.items():\n            if key in merged_dict:\n                if isinstance(value, dict):\n                    merged_dict[key] = merge_metadata_dicts([merged_dict[key], value])\n                elif isinstance(value, list):\n                    merged_dict[key] = list(set(merged_dict[key] + value))\n                else:\n                    if merged_dict[key] != value:\n                        merged_dict[key] = [merged_dict[key], value]\n            else:\n                merged_dict[key] = value\n    return merged_dict\n", "entry_point": "merge_metadata_dicts", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014154", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[84, 85, 85, 87, 86, 88, 90]", "output": "86.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117950_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014155", "code": "import re\ndef extract_code(title):\n    match = re.search(r\"\\w+-?\\d+\", title)\n    return match.group(0) if match else \"\"\n", "entry_point": "extract_code", "input": "'Here is the code: nProduct-123 for testing.'", "output": "'nProduct-123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13798_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014156", "code": "from typing import List\ndef count_unique_requirements(requirements: List[str]) -> int:\n    unique_requirements = set()\n    for requirement in requirements:\n        first_word = requirement.split()[0]\n        unique_requirements.add(first_word)\n    return len(unique_requirements)\n", "entry_point": "count_unique_requirements", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15130_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014157", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[0, 2, 2, 2, 2, 2, -1, 3]", "output": "{0: 1, 2: 5, -1: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5275", "output": "{1, 5, 211, 25, 5275, 1055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5274", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014159", "code": "def days_in_month(year, month):\n    if month == 2:\n        if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0):\n            return 29  # February in a leap year\n        else:\n            return 28  # February in a non-leap year\n    elif month in [4, 6, 9, 11]:\n        return 30\n    else:\n        return 31\n", "entry_point": "days_in_month", "input": "2021, 4", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41653_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014160", "code": "def calculate_video_duration(frames: int, fps: int) -> int:\n    total_duration = frames // fps\n    return total_duration\n", "entry_point": "calculate_video_duration", "input": "15, 1", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77453_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7473", "output": "{1, 3, 141, 47, 7473, 53, 2491, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6274", "output": "{3137, 1, 6274, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014163", "code": "import math\ndef calculate_total_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i]\n        x2, y2 = points[i + 1]\n        length = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n        total_length += length\n    return total_length\n", "entry_point": "calculate_total_length", "input": "[(0, 0), (1, 1)]", "output": "1.4142135623730951", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3574_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014164", "code": "def highest_card_wins(player1_card, player2_card):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_rank = player1_card[:-1]\n    player2_rank = player2_card[:-1]\n    player1_value = card_values[player1_rank]\n    player2_value = card_values[player2_rank]\n    if player1_value > player2_value:\n        return 1\n    elif player1_value < player2_value:\n        return 2\n    else:\n        return \"It's a tie!\"\n", "entry_point": "highest_card_wins", "input": "'10H', '10D'", "output": "\"It's a tie!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90012_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014165", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'B', 'B'], 1", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014166", "code": "import re\nfrom typing import Tuple, Optional\nIE_DESC = 'Redgifs user'\n_VALID_URL = r'https?://(?:www\\.)?redgifs\\.com/users/(?P<username>[^/?#]+)(?:\\?(?P<query>[^#]+))?'\n_PAGE_SIZE = 30\ndef process_redgifs_url(url: str) -> Tuple[str, Optional[str], int]:\n    match = re.match(_VALID_URL, url)\n    if match:\n        username = match.group('username')\n        query = match.group('query')\n        return username, query, _PAGE_SIZE\n    return '', None, _PAGE_SIZE\n", "entry_point": "process_redgifs_url", "input": "'https://www.redgifs.com/users/johndoe?tag=fun'", "output": "('johndoe', 'tag=fun', 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56955_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014167", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'tcandidatehe'", "output": "['tcandidatehe']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014168", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[10, 30, 30, 20, 20, 40, 20, 20, 30]", "output": "[0, 2, 2, 1, 1, 3, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014169", "code": "def calculate_acertos(dados, rerolagens):\n    if dados == 0:\n        return 0\n    def mostraResultado(arg1, arg2):\n        # Placeholder for the actual implementation of mostraResultado\n        # For the purpose of this problem, we will simulate its behavior\n        return arg2 // 2, arg2 // 3\n    acertos_normal, dados_normal = mostraResultado('defesa', dados)\n    acertos_final = acertos_normal\n    if rerolagens > 0 and acertos_normal < dados_normal:\n        acertos_rerolagem, dados_rerodados = mostraResultado('defesa', rerolagens)\n        acertos_final += acertos_rerolagem\n    if acertos_final > dados_normal:\n        acertos_final = dados_normal\n    return acertos_final\n", "entry_point": "calculate_acertos", "input": "12, 0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90056_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014170", "code": "from typing import List\ndef top_k_scores(scores: List[int], k: int) -> List[int]:\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    sorted_scores = sorted(score_freq.keys(), reverse=True)\n    result = []\n    unique_count = 0\n    for score in sorted_scores:\n        if unique_count == k:\n            break\n        result.append(score)\n        unique_count += 1\n    return result\n", "entry_point": "top_k_scores", "input": "[100, 100, 92, 88, 88, 70, 50], 3", "output": "[100, 92, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108959_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014171", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7338", "output": "{1, 2, 3, 6, 1223, 7338, 2446, 3669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014172", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 45, 10]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100977_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014173", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[2, 1, 2, 2, 1, 2, 1, 2]", "output": "[2, 2, 4, 5, 5, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014174", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[5, 7, 10], 6", "output": "[7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014175", "code": "from typing import Optional\ndef time_spec_to_seconds(spec: str) -> Optional[int]:\n    time_units = {'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1}\n    components = []\n    current_component = ''\n    for char in spec:\n        if char.isnumeric():\n            current_component += char\n        elif char in time_units:\n            if current_component:\n                components.append((int(current_component), char))\n                current_component = ''\n        else:\n            current_component = ''  # Reset if delimiter other than time unit encountered\n    if current_component:\n        components.append((int(current_component), 's'))  # Assume seconds if no unit specified\n    total_seconds = 0\n    last_unit_index = -1\n    for value, unit in components:\n        unit_index = 'wdhms'.index(unit)\n        if unit_index < last_unit_index:\n            return None  # Out of order, return None\n        total_seconds += value * time_units[unit]\n        last_unit_index = unit_index\n    return total_seconds\n", "entry_point": "time_spec_to_seconds", "input": "'1m'", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65809_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014176", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "10", "output": "[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2577", "output": "{1, 859, 3, 2577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014178", "code": "def sort_trades(trades):\n    # Define a custom key function to extract the timestamp for sorting\n    def get_timestamp(trade):\n        return trade[0]\n    # Sort the trades based on timestamps in descending order\n    sorted_trades = sorted(trades, key=get_timestamp, reverse=True)\n    return sorted_trades\n", "entry_point": "sort_trades", "input": "[(7, 6, 8), (7, 6, 8), (6, 8)]", "output": "[(7, 6, 8), (7, 6, 8), (6, 8)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41963_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "971", "output": "{1, 971}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014180", "code": "def generate_down_revision(revision):\n    down_revision = revision[::-1].lower()\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'89'", "output": "'98'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7052_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014181", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'1.12.1.12.11'", "output": "'1.12.1.12.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014182", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5836", "output": "{1, 2, 4, 2918, 5836, 1459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5835", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014183", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'aab!!!'", "output": "'aab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014184", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[80, 78, 78], 3", "output": "78.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014185", "code": "def reverse_words_in_string(input_string):\n    words = input_string.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words_in_string", "input": "'store'", "output": "'erots'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137200_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014186", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'2.1.9'", "output": "'2.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014187", "code": "from typing import List\ndef lift_simulation(people: int, lift: List[int]) -> str:\n    if people <= 0 and sum(lift) % 4 != 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people > 0:\n        return f\"There isn't enough space! {people} people in a queue!\\n\" + ' '.join(map(str, lift))\n    elif people <= 0 and sum(lift) == 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people <= 0:\n        return ' '.join(map(str, lift))\n", "entry_point": "lift_simulation", "input": "0, [80, 60, 80, 71, 50, 60, 71]", "output": "'80 60 80 71 50 60 71'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147066_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014188", "code": "def generate_rtl_description(struct_type: dict) -> str:\n    rtl_description = \"\"\n    for field, width in struct_type.items():\n        rtl_description += f\"signal {field}: std_logic_vector({width - 1} downto 0);\\n\"\n    return rtl_description\n", "entry_point": "generate_rtl_description", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37703_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014189", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "49", "output": "{1, 7, 49}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt48", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "279", "output": "{1, 3, 9, 279, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014191", "code": "START_DECODE_OFFSET = -8\n# Morse decoding chart to use. Included is standard international morse (A-Z, 0-9, spaces)\nMORSE_ENCODE_CHART={'A':'.-', 'B':'-...',\n                    'C':'-.-.', 'D':'-..', 'E':'.',\n                    'F':'..-.', 'G':'--.', 'H':'....',\n                    'I':'..', 'J':'.---', 'K':'-.-',\n                    'L':'.-..', 'M':'--', 'N':'-.',\n                    'O':'---', 'P':'.--.', 'Q':'--.-',\n                    'R':'.-.', 'S':'...', 'T':'-',\n                    'U':'..-', 'V':'...-', 'W':'.--',\n                    'X':'-..-', 'Y':'-.--', 'Z':'--..',\n                    '1':'.----', '2':'..---', '3':'...--',\n                    '4':'....-', '5':'.....', '6':'-....',\n                    '7':'--...', '8':'---..', '9':'----.',\n                    '0':'-----', ' ':'/'}\n# An inverted version of the decoding chart that is more useful for encoding. Shouldn't need to be changed.\nMORSE_DECODE_CHART = {a: b for b, a in MORSE_ENCODE_CHART.items()}\ndef encode_to_morse(text):\n    morse_code = []\n    for char in text.upper():\n        if char in MORSE_ENCODE_CHART:\n            morse_code.append(MORSE_ENCODE_CHART[char])\n        else:\n            morse_code.append(' ')  # Treat unknown characters as spaces\n    return ' '.join(morse_code)\n", "entry_point": "encode_to_morse", "input": "'WORLD'", "output": "'.-- --- .-. .-.. -..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71537_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2303", "output": "{1, 7, 329, 47, 49, 2303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014193", "code": "def check_zsk_at_origin(dnskeys):\n    zsk_count = 0\n    for rdata in dnskeys:\n        if rdata.get('flags', 0) & 256:  # Check if ZONE flag is set\n            zsk_count += 1\n    if zsk_count == 0:\n        return 'No ZSK found at origin'\n    else:\n        return f'{zsk_count} ZSK(s) found at origin'\n", "entry_point": "check_zsk_at_origin", "input": "[]", "output": "'No ZSK found at origin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147356_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014194", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 8]", "output": "[7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt45", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2554", "output": "{1, 2554, 2, 1277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2553", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014196", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1415", "output": "{1, 283, 5, 1415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014197", "code": "def authenticate_user(username: str, password: str) -> str:\n    valid_username = \"admin\"\n    valid_password = \"P@ssw0rd\"\n    if username == valid_username:\n        if password == valid_password:\n            return \"Authentication successful\"\n        else:\n            return \"Incorrect password\"\n    else:\n        return \"Unknown username\"\n", "entry_point": "authenticate_user", "input": "'admin', 'P@ssw0rd'", "output": "'Authentication successful'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121086_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014198", "code": "def calculate_even_sum(numbers):\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[2, 4, 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38409_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014199", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[85, 85, 85, 90, 80, 75], 6", "output": "[3, 0, 1, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014200", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 3, 2, 5, 0, 5, 2, 3]", "output": "[4, 5, 7, 5, 5, 7, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29487_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014201", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'venerl'", "output": "'venerl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014202", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 2, 8, 3, 2, 3, 8, 3]", "output": "[7, 3, 10, 6, 6, 8, 14, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014203", "code": "def Fibonacci_Tail(n, a=0, b=1):\n    if n == 0:\n        return a\n    if n == 1:\n        return b\n    return Fibonacci_Tail(n - 1, b, a + b)\n", "entry_point": "Fibonacci_Tail", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60234_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9449", "output": "{1, 859, 11, 9449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014205", "code": "from typing import List, Dict\ndef splitByPhrases(lines: List[str]) -> Dict[int, List[str]]:\n    newLines = {}\n    idx = 0\n    for line in lines:\n        phrases = line.split('.')\n        newLines[idx] = [phrase.strip() for phrase in phrases if phrase.strip()]\n        idx += 1\n    return newLines\n", "entry_point": "splitByPhrases", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112268_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014206", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[0, 0, 5, 5, 1, 1, 1, 2, 3]", "output": "{0: 2, 5: 2, 1: 3, 2: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014207", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 0, 0, 0], [0, 0, 0, 28]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014208", "code": "def calculate_score(accuracy):\n    if accuracy >= 0.92:\n        score = 10\n    elif accuracy >= 0.9:\n        score = 9\n    elif accuracy >= 0.85:\n        score = 8\n    elif accuracy >= 0.8:\n        score = 7\n    elif accuracy >= 0.75:\n        score = 6\n    elif accuracy >= 0.70:\n        score = 5\n    else:\n        score = 4\n    return score\n", "entry_point": "calculate_score", "input": "0.83", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22276_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014209", "code": "def count_unique_keywords(setup_config):\n    keywords = setup_config.get('keywords', [])\n    unique_keywords = set(keyword.lower() for keyword in keywords)\n    return len(unique_keywords)\n", "entry_point": "count_unique_keywords", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30710_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014210", "code": "def find_highest_bidder(bids):\n    highest_bidder = \"\"\n    highest_bid = 0\n    for bidder, bid_amount in bids:\n        if bid_amount > highest_bid or (bid_amount == highest_bid and bidder < highest_bidder):\n            highest_bidder = bidder\n            highest_bid = bid_amount\n    return highest_bidder\n", "entry_point": "find_highest_bidder", "input": "[('Alex', 200), ('Sam', 250), ('Zoe', 250)]", "output": "'Sam'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32734_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014211", "code": "def copy_fields(config, payload):\n    on = config.get('on', ['alert'])\n    copy_operations = config.get('cp', [])\n    for source, dest in copy_operations:\n        source_keys = source.split('/')\n        dest_keys = dest.split('/')\n        current = payload\n        for key in source_keys:\n            current = current.get(key, {})\n        data_to_copy = current\n        current = payload\n        for key in dest_keys[:-1]:\n            if key not in current:\n                current[key] = {}\n            current = current[key]\n        current[dest_keys[-1]] = data_to_copy\n    return payload\n", "entry_point": "copy_fields", "input": "{'cp': []}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9635_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014212", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'2 3,'", "output": "'2 3,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6723", "output": "{1, 2241, 3, 6723, 9, 747, 81, 83, 249, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014214", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-7, -7, -6, -2, -2, -4, 9, 9]", "output": "[-7, -7, -6, -4, -2, -2, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3791", "output": "{1, 223, 17, 3791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014216", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/some/directory/example.t'", "output": "'example.t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014217", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "7, 8, 12", "output": "(7, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014218", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014219", "code": "def reverse_string_in_special_way(string: str) -> str:\n    string = list(string)\n    left, right = 0, len(string) - 1\n    while left < right:\n        string[left], string[right] = string[right], string[left]\n        left += 1\n        right -= 1\n    return ''.join(string)\n", "entry_point": "reverse_string_in_special_way", "input": "'llhello'", "output": "'ollehll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21549_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014220", "code": "import time\ndef calculate_seconds_until_future_time(current_time, future_time):\n    return abs(future_time - current_time)\n", "entry_point": "calculate_seconds_until_future_time", "input": "0, 5000", "output": "5000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45249_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014221", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[20, 21, 15]", "output": "(21, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014222", "code": "# Define the plant_recommendation function\ndef plant_recommendation(care):\n    if care == 'low':\n        return 'aloe'\n    elif care == 'medium':\n        return 'pothos'\n    elif care == 'high':\n        return 'orchid'\n", "entry_point": "plant_recommendation", "input": "'low'", "output": "'aloe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50948_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014223", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-8, -12, -5, -9, -11, -7, -3, 4]", "output": "[-8, -12, -5, -9, -11, -7, -3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014224", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "8388628, 0", "output": "8388628", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014225", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'0.77.0'", "output": "(0, 77, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014226", "code": "from typing import List\ndef remove_non_integers(x: List) -> List:\n    return [element for element in x if isinstance(element, int)]\n", "entry_point": "remove_non_integers", "input": "[1.1, 2.2, 'text']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118715_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8048", "output": "{1, 2, 4, 8, 1006, 8048, 16, 503, 4024, 2012}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8047", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014228", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7097", "output": "{151, 1, 7097, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014229", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'100 + 78'", "output": "178", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014230", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3922", "output": "{1, 2, 37, 1961, 106, 74, 3922, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3921", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014231", "code": "def next_greater_permutation(n):\n    num = list(str(n))\n    i = len(num) - 2\n    while i >= 0:\n        if num[i] < num[i + 1]:\n            break\n        i -= 1\n    if i == -1:\n        return -1\n    j = len(num) - 1\n    while num[j] <= num[i]:\n        j -= 1\n    num[i], num[j] = num[j], num[i]\n    result = int(''.join(num[:i + 1] + num[i + 1:][::-1]))\n    return result if result < (1 << 31) else -1\n", "entry_point": "next_greater_permutation", "input": "534975", "output": "535479", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114170_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014232", "code": "def extract_major_minor_version(version_string):\n    # Split the version string by the dot ('.') character\n    version_parts = version_string.split('.')\n    # Extract the major version\n    major_version = int(version_parts[0])\n    # Extract the minor version by removing non-numeric characters\n    minor_version = ''.join(filter(str.isdigit, version_parts[1]))\n    # Convert the major and minor version parts to integers\n    minor_version = int(minor_version)\n    # Return a tuple containing the major and minor version numbers\n    return major_version, minor_version\n", "entry_point": "extract_major_minor_version", "input": "'3.142abc'", "output": "(3, 142)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141202_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014233", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4406", "output": "{1, 2, 2203, 4406}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014234", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014235", "code": "def mutations(inputs):\n    item_a = set(inputs[0].lower())\n    item_b = set(inputs[1].lower())\n    return item_b.issubset(item_a)\n", "entry_point": "mutations", "input": "['Hello World', 'hello']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114620_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014236", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "-3.005, 0, 2", "output": "-22.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014237", "code": "def extract_command_line_options(input_str):\n    options = {}\n    words = input_str.split()\n    i = 0\n    while i < len(words):\n        word = words[i]\n        if word.startswith('-'):\n            option = word.lstrip('-')\n            if i + 1 < len(words) and not words[i + 1].startswith('-'):\n                value = words[i + 1]\n                if '=' in value:\n                    value = value.split('=')[0] + '=' + value.split('=')[1]\n                i += 1\n            else:\n                value = None\n            options[option] = value\n        i += 1\n    return options\n", "entry_point": "extract_command_line_options", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37238_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014238", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'quickdog'", "output": "{'quickdog': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014239", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2434", "output": "{1, 2434, 2, 1217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2433", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014240", "code": "def GetNote(note_name, scale):\n    midi_val = (scale - 1) * 12  # MIDI value offset based on scale\n    # Dictionary to map note letters to MIDI offsets\n    note_offsets = {'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11}\n    note = note_name[0]\n    if note not in note_offsets:\n        raise ValueError(\"Invalid note name\")\n    midi_val += note_offsets[note]\n    if len(note_name) > 1:\n        modifier = note_name[1]\n        if modifier == 's' or modifier == '#':\n            midi_val += 1\n        else:\n            raise ValueError(\"Invalid note modifier\")\n    if note_name[:2] in ('es', 'e#', 'bs', 'b#'):\n        raise ValueError(\"Invalid note combination\")\n    return midi_val\n", "entry_point": "GetNote", "input": "'c#', 7", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24350_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014241", "code": "_allowed_prompt_params = {'none', 'login', 'consent', 'select_account'}\ndef filter_prompt_params(input_list):\n    filtered_list = []\n    for prompt_param in input_list:\n        if prompt_param in _allowed_prompt_params:\n            filtered_list.append(prompt_param)\n        else:\n            filtered_list.append('not_allowed')\n    return filtered_list\n", "entry_point": "filter_prompt_params", "input": "['abc', 'xyz', 'test']", "output": "['not_allowed', 'not_allowed', 'not_allowed']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71243_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014242", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[1, 2, 10, 3, 4, 5, 6, 10, 9]", "output": "[2, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014243", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "504403158265495560", "output": "'qsttag_bring_back_runaway_serfs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014244", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'123.45%'", "output": "'Chinese: \\nAlphanumeric: 123.45%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014245", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'3.1'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014246", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[50, 70, 70, 68.7142857142857, 100]", "output": "69.57142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50380_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014247", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 5, 4, 7, 5, 4, 5, 7]", "output": "[3, 6, 6, 10, 9, 9, 11, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014248", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[8, 8, 8, 15, 15, 15, 9, 9, 9]", "output": "{(8, 8, 8), (15, 15, 15), (9, 9, 9)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014249", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'test_logger', 20", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014250", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 88, 87, 70, 70, 85]", "output": "[90, 88, 87]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014251", "code": "def dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        raise ValueError(\"Vectors must be of the same length\")\n    result = 0\n    for i in range(len(vector1)):\n        result += vector1[i] * vector2[i]\n    return result\n", "entry_point": "dot_product", "input": "[1, 2], [-10, -8]", "output": "-26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105326_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3506", "output": "{1, 3506, 2, 1753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3505", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014253", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'hthhttpsh', 'e1/ede'", "output": "'hthhttpsh/e1/ede'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014254", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1945", "output": "{1, 1945, 5, 389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3391", "output": "{1, 3391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3390", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2858", "output": "{1, 2858, 2, 1429}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2857", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014257", "code": "from typing import List\nDIGIT_TO_CHAR = {\n    '0': ['0'],\n    '1': ['1'],\n    '2': ['a', 'b', 'c'],\n    '3': ['d', 'e', 'f'],\n    '4': ['g', 'h', 'i'],\n    '5': ['j', 'k', 'l'],\n    '6': ['m', 'n', 'o'],\n    '7': ['p', 'q', 'r', 's'],\n    '8': ['t', 'u', 'v'],\n    '9': ['w', 'x', 'y', 'z']\n}\nDEFAULT_NUMBER_OF_RESULTS = 7\nMAX_LENGTH_OF_NUMBER = 16\nMAX_COST = 150\ndef generate_combinations(input_number: str) -> List[str]:\n    results = []\n    def generate_combinations_recursive(current_combination: str, remaining_digits: str):\n        if not remaining_digits:\n            results.append(current_combination)\n            return\n        for char in DIGIT_TO_CHAR[remaining_digits[0]]:\n            new_combination = current_combination + char\n            new_remaining = remaining_digits[1:]\n            generate_combinations_recursive(new_combination, new_remaining)\n    generate_combinations_recursive('', input_number)\n    return results[:DEFAULT_NUMBER_OF_RESULTS]\n", "entry_point": "generate_combinations", "input": "'23'", "output": "['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133151_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014258", "code": "def count_gene_clusters_with_same_individual(gene_clusters):\n    ctr_cluster_within_subject = 0\n    for cluster in gene_clusters:\n        individual_gene_count = {}\n        for gene, individual in cluster.items():\n            individual_gene_count[individual] = individual_gene_count.get(individual, 0) + 1\n        for count in individual_gene_count.values():\n            if count > 1:\n                ctr_cluster_within_subject += 1\n    return ctr_cluster_within_subject\n", "entry_point": "count_gene_clusters_with_same_individual", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13334_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014259", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[-1, 0, 0, 2, -1, 5, 1]", "output": "[-1, 1, 2, 5, 3, 10, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014260", "code": "def unique_morse_code_words(words):\n    morse_code_mapping = {\n        'a': \".-\", 'b': \"-...\", 'c': \"-.-.\", 'd': \"-..\", 'e': \".\", 'f': \"..-.\",\n        'g': \"--.\", 'h': \"....\", 'i': \"..\", 'j': \".---\", 'k': \"-.-\", 'l': \".-..\",\n        'm': \"--\", 'n': \"-.\", 'o': \"---\", 'p': \".--.\", 'q': \"--.-\", 'r': \".-.\",\n        's': \"...\", 't': \"-\", 'u': \"..-\", 'v': \"...-\", 'w': \".--\", 'x': \"-..-\",\n        'y': \"-.--\", 'z': \"--..\"\n    }\n    unique_transformations = set()\n    for word in words:\n        morse_code = ''.join([morse_code_mapping[letter] for letter in word])\n        unique_transformations.add(morse_code)\n    return len(unique_transformations)\n", "entry_point": "unique_morse_code_words", "input": "['a', 'b']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115827_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014261", "code": "def move_player(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        # Check boundaries\n        x = max(-10, min(10, x))\n        y = max(-10, min(10, y))\n    return x, y\n", "entry_point": "move_player", "input": "['L', 'L']", "output": "(-2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2917", "output": "{1, 2917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014263", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[10, 1, 11, 7, 8, 2, 5, 10, 10], 9", "output": "[[10, 1, 11, 7, 8, 2, 5, 10, 10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014264", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(['x'], 4)", "output": "'x = 4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014265", "code": "def count_sentences(input_string):\n    ENDINGS = ['.', '!', '?', ';']\n    sentence_count = 0\n    in_sentence = False\n    for char in input_string:\n        if char in ENDINGS:\n            if not in_sentence:\n                sentence_count += 1\n                in_sentence = True\n        else:\n            in_sentence = False\n    return sentence_count\n", "entry_point": "count_sentences", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127733_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014266", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "'HELP:'", "output": "{'HELP': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014267", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9409", "output": "{1, 9409, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014268", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1934", "output": "{1, 2, 1934, 967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014269", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<jsmith@ee.org>'", "output": "('jsmith@ee.org', 'ee.org')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014270", "code": "def get_languages_to_compile(lang_configs, need_compile):\n    languages_to_compile = []\n    for lang, config in lang_configs.items():\n        if lang in need_compile:\n            languages_to_compile.append(lang)\n    return languages_to_compile\n", "entry_point": "get_languages_to_compile", "input": "{}, []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120122_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014271", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5351", "output": "{1, 5351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014272", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-200, -205, -220, -205], 4", "output": "-207.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014273", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[2, 2, 4, 3, 6, 6, 6]", "output": "[2, 2, 4, 3, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014274", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9249", "output": "{3083, 1, 3, 9249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014275", "code": "def calculate_welcome_email_lengths(course_emails):\n    email_lengths = {}\n    for course, email in course_emails:\n        email_lengths[course] = len(email) if email else 0\n    return email_lengths\n", "entry_point": "calculate_welcome_email_lengths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119420_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014276", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff28\uff45\uff4c\uff4c\uff4f'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014277", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[1, 0, 2, 4, 2, 3], 2", "output": "[2, 4, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014278", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "[]", "output": "'0.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2902", "output": "{1, 2, 1451, 2902}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2901", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014280", "code": "import re\nfrom typing import List\ndef _splitter(text: str) -> List[str]:\n    if len(text) == 0:\n        return []\n    if \"'\" not in text:\n        return [text]\n    return re.findall(\"'([^']+)'\", text)\n", "entry_point": "_splitter", "input": "\"'ehe['\"", "output": "['ehe[']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84189_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014281", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "368", "output": "{1, 2, 4, 8, 46, 368, 16, 23, 184, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt367", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014282", "code": "def longest_common_directory_path(paths):\n    if not paths:\n        return \"\"\n    common_path = paths[0]\n    for path in paths[1:]:\n        i = 0\n        while i < len(common_path) and i < len(path) and common_path[i] == path[i]:\n            i += 1\n        common_path = common_path[:i]\n    # Remove the file name if present in the common path\n    if '/' in common_path:\n        common_path = '/'.join(common_path.split('/')[:-1])\n    return common_path\n", "entry_point": "longest_common_directory_path", "input": "['/usr/bin/file1', '/usr/local/file2', '/usr/share/doc']", "output": "'/usr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103846_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014283", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 6, 0, 1, 6, 0, 6, 1]", "output": "[0, 7, 2, 4, 10, 5, 12, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25747_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014284", "code": "def calculate_average_score(applicants):\n    average_scores = {}\n    num_applicants = len(applicants)\n    for applicant in applicants:\n        for category, score in applicant.items():\n            average_scores[category] = average_scores.get(category, 0) + score\n    for category in average_scores:\n        average_scores[category] /= num_applicants\n    return average_scores\n", "entry_point": "calculate_average_score", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105987_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4183", "output": "{89, 1, 47, 4183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014286", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[6, -2, -6, 6, -4, -1, -4]", "output": "[-6, 2, 6, -6, 4, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014287", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5283", "output": "{1, 1761, 3, 5283, 9, 587}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5282", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014288", "code": "def padding_zeroes(result, num_digits: int):\n    str_result = str(result)\n    # Check if the input number contains a decimal point\n    if '.' in str_result:\n        decimal_index = str_result.index('.')\n        decimal_part = str_result[decimal_index + 1:]\n        padding_needed = num_digits - len(decimal_part)\n        str_result += \"0\" * padding_needed\n    else:\n        str_result += '.' + \"0\" * num_digits\n    return str_result[:str_result.index('.') + num_digits + 1]\n", "entry_point": "padding_zeroes", "input": "4.082, 6", "output": "'4.082000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26190_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7545", "output": "{1, 3, 5, 1509, 15, 2515, 503, 7545}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014290", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "5", "output": "'5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014291", "code": "def load_balancer(servers, request):\n    if not servers:\n        return None\n    if 'last_server' not in load_balancer.__dict__:\n        load_balancer.last_server = -1\n    load_balancer.last_server = (load_balancer.last_server + 1) % len(servers)\n    return servers[load_balancer.last_server]\n", "entry_point": "load_balancer", "input": "[0], None", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51038_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014292", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'1.0.0'", "output": "'1.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3451", "output": "{1, 7, 203, 493, 17, 119, 3451, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014294", "code": "def check_same_person(person1, person2, all_people_dict):\n    if person1 in all_people_dict and person2 in all_people_dict:\n        person1_photos = all_people_dict[person1]\n        person2_photos = all_people_dict[person2]\n        for photo in person1_photos:\n            if photo in person2_photos:\n                return True\n    return False\n", "entry_point": "check_same_person", "input": "'Alice', 'Bob', {'Alice': ['photo1', 'photo2']}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104563_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014295", "code": "def calculate_total_pages(data_count: int, page_size: int) -> int:\n    total_pages = data_count // page_size\n    if data_count % page_size != 0:\n        total_pages += 1\n    return total_pages\n", "entry_point": "calculate_total_pages", "input": "90, 10", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125536_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014296", "code": "from typing import List\ndef longest_subarray_length(nums: List[int]) -> int:\n    last_seen = {}\n    start = 0\n    max_length = 0\n    for end in range(len(nums)):\n        if nums[end] in last_seen and last_seen[nums[end]] >= start:\n            start = last_seen[nums[end]] + 1\n        last_seen[nums[end]] = end\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_subarray_length", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16612_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014297", "code": "import itertools\ndef count_unique_combinations(items, k):\n    unique_combinations = list(itertools.combinations(items, k))\n    return len(unique_combinations)\n", "entry_point": "count_unique_combinations", "input": "[], 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23071_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014298", "code": "import re\ndef extract_password(response_text):\n    password = re.findall(\"\\[[0-9]{2}\\.[0-9]{2}.[0-9]{4} [0-9]{2}::[0-9]{2}:[0-9]{2}\\] (.*)\\n\", response_text)[0]\n    return password\n", "entry_point": "extract_password", "input": "'[01.01.2023 12::00:00] P@$$w0rd123!\\n'", "output": "'P@$$w0rd123!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135431_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014299", "code": "# Define the statuses dictionary\nstatuses = {\n    1: 'Voting',\n    2: 'Innocent',\n    3: 'Guilty',\n}\n# Implement the get_status_display function\ndef get_status_display(status):\n    return statuses.get(status, 'Unknown')  # Return the status string or 'Unknown' if status code is not found\n", "entry_point": "get_status_display", "input": "0", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37325_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014300", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[10, 10, 10, 9, 9]", "output": "[10, 10, 10, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014301", "code": "def transpose_table(table):\n    max_row_length = max(len(row) for row in table)\n    transposed_table = []\n    for col_idx in range(max_row_length):\n        transposed_row = []\n        for row in table:\n            if col_idx < len(row):\n                transposed_row.append(row[col_idx])\n            else:\n                transposed_row.append(None)\n        transposed_table.append(transposed_row)\n    return transposed_table\n", "entry_point": "transpose_table", "input": "[[1, 4, 7], [2, None, 8], [3, 6, 9]]", "output": "[[1, 2, 3], [4, None, 6], [7, 8, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125766_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1094", "output": "{1, 2, 547, 1094}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1093", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014303", "code": "import typing\nFD_CLOEXEC = 1\nF_GETFD = 2\nF_SETFD = 3\ndef fcntl(fd: int, op: int, arg: int = 0) -> int:\n    if op == F_GETFD:\n        # Simulated logic to get file descriptor flags\n        return 777  # Placeholder value for demonstration\n    elif op == F_SETFD:\n        # Simulated logic to set file descriptor flags\n        return arg  # Placeholder value for demonstration\n    elif op == FD_CLOEXEC:\n        # Simulated logic to handle close-on-exec flag\n        return 1  # Placeholder value for demonstration\n    else:\n        raise ValueError(\"Invalid operation\")\n", "entry_point": "fcntl", "input": "10, F_SETFD, 999", "output": "999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147416_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014304", "code": "def calculate_final_balance(initial_balance, transactions):\n    balance = initial_balance\n    for transaction in transactions:\n        if transaction[\"type\"] == \"deposit\":\n            balance += transaction[\"amount\"]\n        elif transaction[\"type\"] == \"withdrawal\":\n            balance -= transaction[\"amount\"]\n    return balance\n", "entry_point": "calculate_final_balance", "input": "100, [{'type': 'deposit', 'amount': 5}]", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43701_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014305", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'some random text set bba,'", "output": "'bba,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3664", "output": "{1, 2, 4, 229, 1832, 8, 458, 3664, 16, 916}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3663", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014307", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "4, 8, 24", "output": "(0, 2, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014308", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[3, -2, 0, -2, 4, 0, 0, 4, 0]", "output": "[3, -1, 2, 1, 8, 5, 6, 11, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014309", "code": "from typing import List\nimport heapq\ndef min_time_to_complete_tasks(tasks: List[int], num_concurrent: int) -> int:\n    if not tasks:\n        return 0\n    tasks.sort()  # Sort tasks in ascending order of processing times\n    pq = []  # Priority queue to store the next available task to start\n    time = 0\n    running_tasks = []\n    for task in tasks:\n        while len(running_tasks) >= num_concurrent:\n            next_task_time, next_task = heapq.heappop(pq)\n            time = max(time, next_task_time)\n            running_tasks.remove(next_task)\n        time += task\n        running_tasks.append(task)\n        heapq.heappush(pq, (time, task))\n    return max(time, max(pq)[0])  # Return the maximum time taken to complete all tasks\n", "entry_point": "min_time_to_complete_tasks", "input": "[5, 6, 7, 8], 3", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10650_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014310", "code": "import re\ndef clean_slug(value, separator=None):\n    if separator == '-' or separator is None:\n        re_sep = '-'\n    else:\n        re_sep = '(?:-|%s)' % re.escape(separator)\n    value = re.sub(r'^%s+|%s+$' % (re_sep, re_sep), '', value)\n    if separator:\n        value = re.sub('%s+' % re_sep, separator, value)\n    return value\n", "entry_point": "clean_slug", "input": "'hello---worl---hed', separator='__'", "output": "'hello__worl__hed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141562_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014311", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[1, 2, 5, 1, 2, 5]", "output": "[1, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014312", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "5.0, 4.0, 100", "output": "(1.0, 0.075)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014313", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1192", "output": "{1, 2, 4, 1192, 8, 298, 596, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1191", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014314", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[1, 1, 2]", "output": "[1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014315", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3398", "output": "{1, 2, 1699, 3398}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014316", "code": "from typing import List, Tuple\ndef card_game(deck: List[int]) -> Tuple[int, int]:\n    score_player1 = 0\n    score_player2 = 0\n    for i in range(0, len(deck), 2):\n        if deck[i] > deck[i + 1]:\n            score_player1 += 1\n        else:\n            score_player2 += 1\n    return score_player1, score_player2\n", "entry_point": "card_game", "input": "[10, 1, 9, 2, 8, 3, 7, 4]", "output": "(4, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_218_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014317", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[1, 2, 3, 0, 0]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014318", "code": "def determine_action(hand_value):\n    non_ace = hand_value - 11\n    action = 'Hit' if non_ace <= 10 else 'Stand'\n    return action\n", "entry_point": "determine_action", "input": "22", "output": "'Stand'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101530_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014319", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5464", "output": "{1, 2, 4, 8, 683, 2732, 1366, 5464}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5463", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014320", "code": "def filter_test_records(test_records):\n    filtered_records = []\n    for record in test_records:\n        if record['status'] != 'aborted' or record['dut_id_set']:\n            filtered_records.append(record)\n    return filtered_records\n", "entry_point": "filter_test_records", "input": "[{'status': 'aborted', 'dut_id_set': []}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26320_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014321", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4490", "output": "{1, 2, 898, 449, 5, 2245, 4490, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4489", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014322", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6833", "output": "{1, 6833}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014323", "code": "def character_count(strings):\n    counts = {}\n    for string in strings:\n        count = sum(1 for char in string if char.isalpha())\n        counts[string] = count\n    return counts\n", "entry_point": "character_count", "input": "['one', 'two', 'three', 'four']", "output": "{'one': 3, 'two': 3, 'three': 5, 'four': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117648_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014324", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "21", "output": "[7, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014325", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[0, 0, 7, 8]", "output": "[0, 0, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5877", "output": "{1, 3, 1959, 9, 653, 5877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014327", "code": "def next_greater_permutation(n):\n    num = list(str(n))\n    i = len(num) - 2\n    while i >= 0:\n        if num[i] < num[i + 1]:\n            break\n        i -= 1\n    if i == -1:\n        return -1\n    j = len(num) - 1\n    while num[j] <= num[i]:\n        j -= 1\n    num[i], num[j] = num[j], num[i]\n    result = int(''.join(num[:i + 1] + num[i + 1:][::-1]))\n    return result if result < (1 << 31) else -1\n", "entry_point": "next_greater_permutation", "input": "326", "output": "362", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114170_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014328", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "12, 5", "output": "248832", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt53", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014329", "code": "def maximum_product(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[4, 4, 4]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38245_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014330", "code": "def simulate_reformat_temperature_data(raw_data):\n    # Simulate processing the data using a hypothetical script 'reformat_weather_data.py'\n    # In this simulation, we will simply reverse the input data as an example\n    reformatted_data = raw_data[::-1]\n    return reformatted_data\n", "entry_point": "simulate_reformat_temperature_data", "input": "'32,33,28,7'", "output": "'7,82,33,23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136307_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2078", "output": "{1, 2, 2078, 1039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2077", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8705", "output": "{1741, 1, 5, 8705}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014333", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4687", "output": "{1, 43, 109, 4687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014334", "code": "def simulate_card_game(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    ties = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n        else:\n            ties += 1\n    return player1_wins, player2_wins, ties\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5, 6, 7], [2, 3, 4, 5, 6, 7, 8]", "output": "(0, 7, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74585_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014335", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[12, 13]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014336", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[2, 4, 5, 2, 2, 2, 2]", "output": "[2, 2, 2, 2, 5, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014337", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[2, 3]", "output": "[4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014338", "code": "def organize_models(model_names):\n    organized_models = {}\n    for model_name in model_names:\n        if \".\" in model_name:\n            model_type, model = model_name.lower().split(\".\", 1)\n            organized_models.setdefault(model_type, []).append(model)\n    return organized_models\n", "entry_point": "organize_models", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76713_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014339", "code": "def find_missing(S):\n    full_set = set(range(10))\n    sum_S = sum(S)\n    sum_full_set = sum(full_set)\n    return sum_full_set - sum_S\n", "entry_point": "find_missing", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 9]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109203_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014340", "code": "def process_data(filter_logs, sequential_data):\n    # Process filter logs\n    filtered_logs = [line for line in filter_logs.split('\\n') if 'ERROR' not in line]\n    # Check for sequence in sequential data\n    sequence_exists = False\n    sequential_lines = sequential_data.split('\\n')\n    for i in range(len(sequential_lines) - 2):\n        if sequential_lines[i] == 'a start point' and sequential_lines[i + 1] == 'leads to' and sequential_lines[i + 2] == 'an ending':\n            sequence_exists = True\n            break\n    return (filtered_logs, sequence_exists)\n", "entry_point": "process_data", "input": "'ahbl', 'random line\\nanother line'", "output": "(['ahbl'], False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27152_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014341", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[80, 82]", "output": "162", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014342", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[80, 82, 86, 90, 81, 80]", "output": "83.16666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014343", "code": "def process_data(data_dict):\n    if 'testing' in data_dict:\n        data_dict['testing'] = not data_dict['testing']  # Toggle the 'testing' value\n    if 'meta' in data_dict:\n        meta_str = ','.join(map(str, data_dict['meta']))  # Convert 'meta' list to a comma-separated string\n    else:\n        meta_str = ''\n    return data_dict.get('testing', False), meta_str\n", "entry_point": "process_data", "input": "{'testing': True}", "output": "(False, '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87017_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014344", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6933", "output": "{1, 3, 6933, 2311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014345", "code": "def find_highest_score_index(scores):\n    highest_score = float('-inf')\n    highest_score_index = -1\n    for i in range(len(scores)):\n        if scores[i] > highest_score:\n            highest_score = scores[i]\n            highest_score_index = i\n        elif scores[i] == highest_score and i < highest_score_index:\n            highest_score_index = i\n    return highest_score_index\n", "entry_point": "find_highest_score_index", "input": "[1, 2, 5, 3, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57664_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014346", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9413", "output": "{1, 9413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "350", "output": "{1, 2, 35, 5, 70, 7, 10, 14, 175, 50, 25, 350}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt349", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014348", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['Doge1000', 'Doge2000', 'Doge1000', 'Doge10']", "output": "4010", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014349", "code": "def run_tests(test_cases, keyword):\n    executed_tests = []\n    for test_case in test_cases:\n        if keyword in test_case:\n            executed_tests.append(test_case)\n    return executed_tests\n", "entry_point": "run_tests", "input": "[], 'test'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33518_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014350", "code": "def generate_indented_list(n):\n    output = \"\"\n    for i in range(1, n + 1):\n        indent = \"    \" * (i - 1)  # Generate the appropriate level of indentation\n        output += f\"{i}. {indent}Item {i}\\n\"\n    return output\n", "entry_point": "generate_indented_list", "input": "3", "output": "'1. Item 1\\n2.     Item 2\\n3.         Item 3\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95960_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014351", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014352", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[100, 90, 80], 1", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014353", "code": "def next_element(some_list, current_index):\n    if not some_list:\n        return ''\n    next_index = (current_index + 1) % len(some_list)\n    return some_list[next_index]\n", "entry_point": "next_element", "input": "['apple', 'banana', 'cherry'], 1", "output": "'cherry'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54712_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014354", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'0.0.9'", "output": "'0.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014355", "code": "def compare_versions(installed_version, recommended_version):\n    installed_parts = list(map(int, installed_version.split('.')))\n    recommended_parts = list(map(int, recommended_version.split('.')))\n    for i in range(3):  # Compare major, minor, patch versions\n        if installed_parts[i] < recommended_parts[i]:\n            return \"Outdated\"\n        elif installed_parts[i] > recommended_parts[i]:\n            return \"Newer version installed\"\n    return \"Up to date\"\n", "entry_point": "compare_versions", "input": "'1.2.3', '1.2.3'", "output": "'Up to date'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51372_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014356", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[4, 4, 3, 1, 1, 3]", "output": "[16, 16, 27, 1, 1, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014357", "code": "from typing import List, Dict\ndef count_unique_log_messages(logs: List[str]) -> Dict[str, int]:\n    unique_logs = {}\n    for log in logs:\n        log_lower = log.lower()\n        if log_lower in unique_logs:\n            unique_logs[log_lower] += 1\n        else:\n            unique_logs[log_lower] = 1\n    return {log: freq for log, freq in unique_logs.items()}\n", "entry_point": "count_unique_log_messages", "input": "['rr', 'RR']", "output": "{'rr': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61335_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014358", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[1, 2, 3, 3], 4", "output": "[0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014359", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "3, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99400_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014360", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'111!@#Hello23$%^&*'", "output": "'111Hello23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014361", "code": "def play_card_game(deck_a, deck_b):\n    rounds = 0\n    while deck_a and deck_b:\n        rounds += 1\n        card_a = deck_a.pop(0)\n        card_b = deck_b.pop(0)\n        if card_a > card_b:\n            deck_a.extend([card_a, card_b])\n        elif card_b > card_a:\n            deck_b.extend([card_b, card_a])\n        else:  # War condition\n            war_cards = [card_a, card_b]\n            for _ in range(3):\n                if len(deck_a) == 0 or len(deck_b) == 0:\n                    break\n                war_cards.extend([deck_a.pop(0), deck_b.pop(0)])\n            if war_cards[-2] > war_cards[-1]:\n                deck_a.extend(war_cards)\n            else:\n                deck_b.extend(war_cards)\n    if not deck_a and not deck_b:\n        return \"Draw\"\n    elif not deck_a:\n        return \"Player B wins\"\n    else:\n        return \"Player A wins\"\n", "entry_point": "play_card_game", "input": "[10, 9, 8, 7], [1, 2, 3, 4]", "output": "'Player A wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103971_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014362", "code": "def matches_multi_constraint(constraints, provider_constraint):\n    for operator, version in constraints:\n        if operator == '>' and not provider_constraint[1] > version:\n            return False\n        elif operator == '<' and not provider_constraint[1] < version:\n            return False\n        elif operator == '==' and not provider_constraint[1] == version:\n            return False\n    return True\n", "entry_point": "matches_multi_constraint", "input": "[('>', 2), ('<', 5), ('==', 3)], ('provider', 3)", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36013_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014363", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "1, 122, 'fofooofoo'", "output": "{'fofooofoo': 122}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014364", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2439", "output": "{1, 3, 2439, 9, 813, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014365", "code": "def get_model_details(model_name):\n    DEPTH_MODELS = ('alexnet', 'resnet18', 'resnet50', 'vgg', 'sqznet')\n    DEPTH_DIMS = {'alexnet': 4096, 'resnet18': 512, 'resnet50': 2048, 'vgg': 4096, 'sqznet': 1024}\n    DEPTH_CHANNELS = {'alexnet': 256, 'resnet18': 256, 'resnet50': 1024, 'vgg': 512, 'sqznet': 512}\n    if model_name in DEPTH_MODELS:\n        return DEPTH_DIMS[model_name], DEPTH_CHANNELS[model_name]\n    else:\n        return \"Model not recognized\"\n", "entry_point": "get_model_details", "input": "'vgg'", "output": "(4096, 512)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125406_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014366", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7517", "output": "{1, 7517}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014367", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "'oooh'", "output": "'oooh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014368", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "13, 2", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt2375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014369", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for num1, num2 in zip(arr1, arr2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0, 5, 1], [10, 15, 2]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20129_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014370", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8446", "output": "{1, 2, 103, 41, 206, 82, 8446, 4223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014371", "code": "def extract_theme_info(theme_options):\n    extracted_info = []\n    for key, value in theme_options.items():\n        if key == 'note_bg':\n            extracted_info.append(f\"Note Background Color: {value}\")\n        elif key == 'note_border':\n            extracted_info.append(f\"Note Border Color: {value}\")\n        elif key == 'show_relbars':\n            extracted_info.append(f\"Show Relative Bars: {value}\")\n        elif key == 'logo_name':\n            extracted_info.append(f\"Logo Name: {value}\")\n        elif key == 'github_repo':\n            extracted_info.append(f\"GitHub Repository: {value}\")\n    return '\\n'.join(extracted_info)\n", "entry_point": "extract_theme_info", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6893_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014372", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 9, 10]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44965_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014373", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 1, 66555491", "output": "66555491", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014374", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "472", "output": "{1, 2, 4, 8, 236, 118, 472, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt471", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014375", "code": "def calculate_range(data):\n    if not data:\n        return None  # Handle empty dataset\n    min_val = max_val = data[0]  # Initialize min and max values\n    for num in data[1:]:\n        if num < min_val:\n            min_val = num\n        elif num > max_val:\n            max_val = num\n    return max_val - min_val\n", "entry_point": "calculate_range", "input": "[0, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21170_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014376", "code": "from typing import Dict, List\nfrom collections import deque\ndef bfs_traversal(graph: Dict[str, Dict[str, int]], start_node: str) -> List[str]:\n    result = []\n    queue = deque([start_node])\n    visited = set()\n    while queue:\n        node = queue.popleft()\n        result.append(node)\n        visited.add(node)\n        for neighbor in graph.get(node, {}):\n            if neighbor not in visited:\n                queue.append(neighbor)\n    return result[1:]  # Exclude the start_node itself\n", "entry_point": "bfs_traversal", "input": "{}, 'A'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136994_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6047", "output": "{1, 6047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014378", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014379", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'2', '0', 'cpu', '2.11'", "output": "'2.0-cpu-ml-scala2.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014380", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[13, 17]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50878_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014381", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo This is a test'", "output": "'This is a test'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014382", "code": "def scaled_mae(x, y, alpha):\n    # Calculate the absolute difference element-wise\n    abs_diff = [[abs(x[i][j] - y[i][j]) for j in range(len(x[i]))] for i in range(len(x))]\n    # Scale the absolute difference by alpha\n    scaled_loss = [[abs_diff[i][j] * alpha for j in range(len(abs_diff[i]))] for i in range(len(abs_diff))]\n    # Calculate the mean of the scaled loss\n    total_elements = len(x) * len(x[0])\n    mean_loss = sum(sum(row) for row in scaled_loss) / total_elements\n    return mean_loss\n", "entry_point": "scaled_mae", "input": "[[1, 2], [3, 4]], [[1, 2], [3, 3]], 1", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55030_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014383", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, -1, 7, 1, 8, 1, 4, 6, 1]", "output": "[1, 0, 9, 4, 12, 6, 10, 13, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1385", "output": "{1, 277, 5, 1385}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014385", "code": "def group_by_key(input_data):\n    grouped_data = {}\n    for data in input_data:\n        key_value = data['category']\n        if key_value in grouped_data:\n            grouped_data[key_value].append(data)\n        else:\n            grouped_data[key_value] = [data]\n    return grouped_data\n", "entry_point": "group_by_key", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93378_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014386", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'test_file.txt'", "output": "'test_file.txt.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014387", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[10, 15, 10]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014388", "code": "def calculate_difference(n):\n    sum_n = n * (n + 1) // 2\n    sq_sum_n = n * (n + 1) * (2 * n + 1) // 6\n    return (sum_n ** 2) - sq_sum_n\n", "entry_point": "calculate_difference", "input": "3", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102782_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014389", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "0, 0, 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014390", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "5", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014391", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[4, 5, 5]", "output": "4.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014392", "code": "def calculate_total_truck_count(_inbound_truck_raw_data, _outbound_truck_raw_data):\n    inbound_truck_count = len(_inbound_truck_raw_data)\n    outbound_truck_count = len(_outbound_truck_raw_data)\n    total_truck_count = inbound_truck_count + outbound_truck_count\n    return total_truck_count\n", "entry_point": "calculate_total_truck_count", "input": "[1, 2, 3, 4, 5], [6, 7, 8, 9, 10, 11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24222_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014393", "code": "def generate_url(owner, repo, token_auth):\n    return f'{owner}/{repo}/{token_auth}/'\n", "entry_point": "generate_url", "input": "'johnj_doe', 'my_projecc', 'aaba123'", "output": "'johnj_doe/my_projecc/aaba123/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8083_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014394", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 3, 4, 4]", "output": "[0, 1, 2, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014395", "code": "from typing import List\ndef max_simultaneous_muse_tools(locations: List[int]) -> int:\n    max_tools = float('inf')  # Initialize to positive infinity for comparison\n    for tools in locations:\n        max_tools = min(max_tools, tools)\n    return max_tools\n", "entry_point": "max_simultaneous_muse_tools", "input": "[2, 5, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65482_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014396", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "41, 10", "output": "1121099408", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014397", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/home/user/projects/other', '/home/user/projects/download'", "output": "'../download'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014398", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2138", "output": "{1, 2138, 2, 1069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014399", "code": "def elementwise_division(a, b):\n    if isinstance(a[0], list):  # Check if a is a 2D list\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [[x / y for x, y in zip(row_a, row_b)] for row_a, row_b in zip(a, b)]\n    else:  # Assuming a and b are 1D lists\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [x / y for x, y in zip(a, b)]\n", "entry_point": "elementwise_division", "input": "[10.0, 10.0, 10.0, 10.0], [1.0, 1.0, 1.0, 1.0]", "output": "[10.0, 10.0, 10.0, 10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108971_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014400", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[3, 6, 1, 2, 7, 3, 1, 14]", "output": "[2, 2, 1, 1, 3, 2, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "852", "output": "{1, 2, 3, 4, 6, 71, 426, 12, 142, 852, 213, 284}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt851", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014402", "code": "def is_list_of_strings(lst):\n    if not isinstance(lst, list):\n        return False\n    return all(isinstance(element, str) for element in lst)\n", "entry_point": "is_list_of_strings", "input": "['hello', 'world']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81444_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014403", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 5, 3], 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014404", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[1, 1, 2, 2, 10, 8]", "output": "(10, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014405", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'\\n  Wld\\n'", "output": "'Wld\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014406", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wxCustoeto'", "output": "'wx.adv.Custoeto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "493", "output": "{1, 29, 493, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt492", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014408", "code": "import math\nMAX_BRIGHT = 2.0\ndef rgb1(v):\n    r = 1 + math.cos(v * math.pi)\n    g = 0\n    b = 1 + math.sin(v * math.pi)\n    # Scale the RGB components based on the maximum brightness\n    r_scaled = int(MAX_BRIGHT * r)\n    g_scaled = int(MAX_BRIGHT * g)\n    b_scaled = int(MAX_BRIGHT * b)\n    return (r_scaled, g_scaled, b_scaled)\n", "entry_point": "rgb1", "input": "5 / 6", "output": "(0, 0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70015_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014409", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[1, 3, 0], 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014410", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'10.20.30'", "output": "(10, 20, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014411", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "12, 5", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014412", "code": "def min_divisor_expression(N):\n    ans = float('inf')  # Initialize ans to positive infinity\n    for n in range(1, int(N ** 0.5) + 1):\n        if N % n == 0:\n            ans = min(ans, n + N // n - 2)\n    return ans\n", "entry_point": "min_divisor_expression", "input": "10", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115935_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014413", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'KEY = VALUE'", "output": "{'KEY': 'VALUE'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014414", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[0]", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014415", "code": "def extract_view_names(urlpatterns):\n    view_names_dict = {}\n    for pattern in urlpatterns:\n        url_pattern, view_name = pattern\n        view_name = view_name.split('.')[0]  # Extracting just the view name without method call\n        if view_name not in view_names_dict:\n            view_names_dict[view_name] = []\n        view_names_dict[view_name].append(url_pattern)\n    return view_names_dict\n", "entry_point": "extract_view_names", "input": "[('^profile/$', 'ProfileView')]", "output": "{'ProfileView': ['^profile/$']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120998_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014416", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:  # Check if the list is empty\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 86]", "output": "85.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147453_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2383", "output": "{1, 2383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014418", "code": "def string_lengths(input_list):\n    result = {}  # Initialize an empty dictionary to store the string lengths\n    for string in input_list:\n        if string not in result:  # Check if the string is not already in the dictionary\n            result[string] = len(string)  # Add the string as key and its length as value\n    return result\n", "entry_point": "string_lengths", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': 5, 'banana': 6, 'cherry': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73001_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014419", "code": "def import_packages(packages, import_order):\n    global_namespace = {}\n    def import_package(package_name):\n        if package_name not in global_namespace:\n            package_contents = packages.get(package_name, {})\n            global_namespace[package_name] = package_contents\n            for dependency in package_contents:\n                import_package(dependency)\n    for package in import_order:\n        import_package(package)\n    return {k: v for package in import_order for k, v in global_namespace[package].items()}\n", "entry_point": "import_packages", "input": "{}, []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014420", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, -1, 1, 2, 6]", "output": "[-1, 2, 6, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014421", "code": "def insert_step(steps, new_step, position):\n    steps.insert(position, new_step)\n    return steps\n", "entry_point": "insert_step", "input": "[], 'visvavion', 0", "output": "['visvavion']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135735_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014422", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3958", "output": "{1, 2, 1979, 3958}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014423", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'data.file.com'", "output": "'data.file.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014424", "code": "import ast\ndef extract_test_cases_info(test_file_content: str) -> dict:\n    test_cases_info = {}\n    tree = ast.parse(test_file_content)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef) and node.name.startswith('test_'):\n            test_case_name = node.name.replace('test_', '')\n            assertion_targets = []\n            for sub_node in ast.walk(node):\n                if isinstance(sub_node, ast.Call) and isinstance(sub_node.func, ast.Attribute) and sub_node.func.attr == 'assertEqual':\n                    target = ast.unparse(sub_node.args[0]).strip()\n                    assertion_targets.append(target)\n            test_cases_info[test_case_name] = assertion_targets\n    return test_cases_info\n", "entry_point": "extract_test_cases_info", "input": "'\\ndef some_function():\\n    return True\\n'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136075_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9267", "output": "{3, 1, 9267, 3089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9266", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014426", "code": "def authenticate_user(username, password):\n    predefined_username = \"john_doe\"\n    predefined_password = \"secure_password\"\n    if username == predefined_username and password == predefined_password:\n        return (True, predefined_username)\n    else:\n        return (False, None)\n", "entry_point": "authenticate_user", "input": "'john_doe', 'secure_password'", "output": "(True, 'john_doe')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143028_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014427", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'88d8c0588d8c05<PASSWORD>', 'a8'", "output": "'88d8c0588d8c05a8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014428", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4517", "output": "{1, 4517}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014429", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'www.exe.com/nohems'", "output": "'www.exe.com/nohems'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014430", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.Doe@EE.COJ'", "output": "'john.doe@ee.coj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014431", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110001X'", "output": "['11100010', '11100011']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt60", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014432", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[2, 3, 2, 2, 3, 6, 7, 1, 3]", "output": "[2, 4, 4, 5, 7, 11, 13, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014433", "code": "def process_pairs(pair_list):\n    result = []\n    for pair in pair_list:\n        sorted_pair = tuple(sorted(pair))\n        if sorted_pair[0] != sorted_pair[1]:\n            result.append(sorted_pair)\n    return result\n", "entry_point": "process_pairs", "input": "[(2, 3), (5, 8), (2, 7)]", "output": "[(2, 3), (5, 8), (2, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19375_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "81", "output": "{1, 3, 9, 81, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt80", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014435", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9678", "output": "{1, 2, 3, 6, 4839, 1613, 9678, 3226}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9326", "output": "{1, 2, 9326, 4663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9325", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014437", "code": "from typing import List, Tuple\ndef exceeds_capacity(bus_stops: List[Tuple[int, int]], capacity: int) -> bool:\n    passengers_count = 0\n    for pick_up, drop_off in bus_stops:\n        passengers_count += pick_up - drop_off\n        if passengers_count > capacity:\n            return True\n    return False\n", "entry_point": "exceeds_capacity", "input": "[(0, 0), (5, 0), (3, 3)], 5", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122685_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014438", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "21, 5, 10", "output": "51090942171709440000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014439", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "15, [8, 16]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014440", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'1.02.1'", "output": "'1.02.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014441", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'zero'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014442", "code": "def min_execution_time(tasks, cooldown):\n    cooldowns = {}\n    time = 0\n    for task in tasks:\n        if task in cooldowns and cooldowns[task] > time:\n            time = cooldowns[task]\n        time += 1\n        cooldowns[task] = time + cooldown\n    return time\n", "entry_point": "min_execution_time", "input": "['A', 'A', 'B', 'A'], 1", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133436_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014443", "code": "def calculate_xor_checksum(input_string):\n    checksum = 0\n    for char in input_string:\n        checksum ^= ord(char)\n    return checksum\n", "entry_point": "calculate_xor_checksum", "input": "'e'", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56407_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014444", "code": "def count_marker_styles(markers):\n    marker_counts = {}\n    for marker in markers:\n        if marker in marker_counts:\n            marker_counts[marker] += 1\n        else:\n            marker_counts[marker] = 1\n    return marker_counts\n", "entry_point": "count_marker_styles", "input": "['D', 'o', 'o', '^']", "output": "{'D': 1, 'o': 2, '^': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148986_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014445", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3658", "output": "'1 hour, and 58 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014446", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "10", "output": "[10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014447", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'elklop', 120", "output": "[136, 164, 160, 164, 176, 180]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014448", "code": "def from_master_derivation_key(mdk):\n    # Implement the conversion from master derivation key to mnemonic phrase here\n    # This could involve decoding, processing, and converting the mdk appropriately\n    # For illustration purposes, let's assume a simple conversion method\n    mnemonic = mdk[::-1]  # Reversing the master derivation key as an example\n    return mnemonic\n", "entry_point": "from_master_derivation_key", "input": "'sample_master_derivation_key'", "output": "'yek_noitavired_retsam_elpmas'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129954_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014449", "code": "def calculate_salutes(hallway: str) -> int:\n    crosses = 0\n    right_count = 0\n    for char in hallway:\n        if char == \">\":\n            right_count += 1\n        elif char == \"<\":\n            crosses += right_count * 2\n    return crosses\n", "entry_point": "calculate_salutes", "input": "'>>>>>>><<<<'", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117936_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014450", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "157", "output": "{1, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014451", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Wel_me to __title__o'", "output": "'Wel_me to helloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014452", "code": "from typing import List, Dict\ndef get_collections_to_delete(category_ids_to_delete: List[str]) -> Dict[str, List[str]]:\n    collections = {\n        \"Collection 1\": [\"cat1\", \"cat4\"],\n        \"Collection 2\": [\"cat2\", \"cat5\"],\n        \"Collection 3\": [\"cat3\", \"cat6\"]\n    }\n    collections_to_delete = {}\n    for collection_name, category_ids in collections.items():\n        categories_to_delete = [cat_id for cat_id in category_ids if cat_id in category_ids_to_delete]\n        if categories_to_delete:\n            collections_to_delete[collection_name] = categories_to_delete\n    return collections_to_delete\n", "entry_point": "get_collections_to_delete", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97259_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014453", "code": "def min_divisor_expression(N):\n    ans = float('inf')  # Initialize ans to positive infinity\n    for n in range(1, int(N ** 0.5) + 1):\n        if N % n == 0:\n            ans = min(ans, n + N // n - 2)\n    return ans\n", "entry_point": "min_divisor_expression", "input": "8", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115935_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014454", "code": "def construct_target_url(url: str, host: str) -> str:\n    if url != '/':\n        return ''\n    domain = host + ':9001' if ':9001' not in host else host\n    target = 'http://' + domain + '/RPC2'\n    return target\n", "entry_point": "construct_target_url", "input": "'/', 'example.com'", "output": "'http://example.com:9001/RPC2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99855_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014455", "code": "def process_command_result_ciphers(command_result_ciphers):\n    ssl_ciphers = command_result_ciphers.get('CIPHERS', [])\n    ports_info = command_result_ciphers.get('PORTS', {})\n    ssl_ciphers_formatted = '\\n'.join([f\"- {cipher}\" for cipher in ssl_ciphers])\n    open_ports_formatted = '\\n'.join([f\"- {port} {info['STATE']} {info['SERVICE']}\" for port, info in ports_info.items() if isinstance(info, dict)])\n    return f\"SSL Ciphers:\\n{ssl_ciphers_formatted}\\n\\nOpen Ports:\\n{open_ports_formatted}\"\n", "entry_point": "process_command_result_ciphers", "input": "{'CIPHERS': [], 'PORTS': {}}", "output": "'SSL Ciphers:\\n\\n\\nOpen Ports:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142626_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014456", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1298", "output": "{1, 2, 649, 11, 1298, 118, 22, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014457", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5574", "output": "{1, 2, 3, 2787, 1858, 5574, 6, 929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014458", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<tag>t</tag>'", "output": "'t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014459", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110010X'", "output": "['11100100', '11100101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt25", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014460", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1238", "output": "{1, 2, 619, 1238}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014461", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3047", "output": "{1, 11, 277, 3047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014462", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7867", "output": "{1, 7867}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014463", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[5, 4, 3, 2, 1]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014464", "code": "import base64\ndef process_content(contents):\n    content_type, content_string = contents.split(',')\n    decoded_content = base64.b64decode(content_string)\n    return decoded_content\n", "entry_point": "process_content", "input": "'text/plain,SGVsbG8gV29ybGQh'", "output": "b'Hello World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133360_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1042", "output": "{1, 1042, 2, 521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1041", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014466", "code": "from typing import List\ndef get_unique_elements(input_list: List[int]) -> List[int]:\n    unique_elements = []\n    seen_elements = set()\n    for element in input_list:\n        if element not in seen_elements:\n            unique_elements.append(element)\n            seen_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[9, 4, 4, 5, 2, 5, 8, 9]", "output": "[9, 4, 5, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78256_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014467", "code": "from decimal import Decimal\ndef htdf_to_satoshi(amount_htdf):\n    amount_decimal = Decimal(str(amount_htdf))  # Convert input to Decimal\n    satoshi_value = int(amount_decimal * (10 ** 8))  # Convert HTDF to satoshi\n    return satoshi_value\n", "entry_point": "htdf_to_satoshi", "input": "'139623.71827296'", "output": "13962371827296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13302_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014468", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:  # Check if the list is empty\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[87.55555555555556, 87.55555555555556, 87.55555555555556]", "output": "87.55555555555556", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147453_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014469", "code": "def sum_except_self(input_list):\n    total_sum = sum(input_list)\n    output_list = [total_sum - num for num in input_list]\n    return output_list\n", "entry_point": "sum_except_self", "input": "[1, 2, 3, 4]", "output": "[9, 8, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8241_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014470", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "11", "output": "380", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014471", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[10, 1, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3167", "output": "{1, 3167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014473", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[1, 6]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014474", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[8], [29]]", "output": "[8, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014475", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'app.config.AuwalduConfig'", "output": "'AuwalduConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014476", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'TSp'", "output": "'TSp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014477", "code": "def pageCount(n, p):\n    # Calculate pages turned from the front\n    front_turns = p // 2\n    # Calculate pages turned from the back\n    if n % 2 == 0:\n        back_turns = (n - p) // 2\n    else:\n        back_turns = (n - p - 1) // 2\n    return min(front_turns, back_turns)\n", "entry_point": "pageCount", "input": "4, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96390_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "729", "output": "{1, 3, 9, 81, 243, 729, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014479", "code": "def spiralOrder(matrix):\n    if not matrix or not matrix[0]:\n        return []\n    res = []\n    rb, re, cb, ce = 0, len(matrix), 0, len(matrix[0])\n    while len(res) < len(matrix) * len(matrix[0]):\n        # Move right\n        for i in range(cb, ce):\n            res.append(matrix[rb][i])\n        rb += 1\n        # Move down\n        for i in range(rb, re):\n            res.append(matrix[i][ce - 1])\n        ce -= 1\n        # Move left\n        if rb < re:\n            for i in range(ce - 1, cb - 1, -1):\n                res.append(matrix[re - 1][i])\n            re -= 1\n        # Move up\n        if cb < ce:\n            for i in range(re - 1, rb - 1, -1):\n                res.append(matrix[i][cb])\n            cb += 1\n    return res\n", "entry_point": "spiralOrder", "input": "[[1, 2, 3, 4], [5, 6, 7, 8]]", "output": "[1, 2, 3, 4, 8, 7, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21236_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014480", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "' Python Proprammipg '", "output": "'python_proprammipg_18'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014481", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[12, 33, 1, 35, 2, 12, 34, 12], 4", "output": "[1, 2, 12, 12, 12, 33, 34, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014482", "code": "from typing import Dict, List\ndef filter_valid_processes(processes: Dict[str, str]) -> List[Dict[str, str]]:\n    valid_processes = []\n    for process_name, process_status in processes.items():\n        if process_status in ['running', 'stopped']:\n            valid_processes.append({'name': process_name, 'status': process_status})\n    return valid_processes\n", "entry_point": "filter_valid_processes", "input": "{'process1': 'terminated', 'process2': 'inactive'}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132162_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4226", "output": "{2113, 1, 4226, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3997", "output": "{1, 571, 3997, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014485", "code": "def calculate_edit_distance_median(edit_distances):\n    # Filter out edit distances equal to 0\n    filtered_distances = [dist for dist in edit_distances if dist != 0]\n    # Sort the filtered list\n    sorted_distances = sorted(filtered_distances)\n    length = len(sorted_distances)\n    if length == 0:\n        return 0\n    # Calculate the median\n    if length % 2 == 1:\n        return sorted_distances[length // 2]\n    else:\n        mid = length // 2\n        return (sorted_distances[mid - 1] + sorted_distances[mid]) / 2\n", "entry_point": "calculate_edit_distance_median", "input": "[0, 5, 5, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8147_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "156", "output": "{1, 2, 3, 4, 6, 39, 12, 13, 78, 52, 26, 156}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014487", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'address'", "output": "'address'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014488", "code": "from typing import List\ndef merge_sorted_lists(nums1: List[int], nums2: List[int]) -> List[int]:\n    merged = []\n    i, j = 0, 0\n    while i < len(nums1) and j < len(nums2):\n        if nums1[i] < nums2[j]:\n            merged.append(nums1[i])\n            i += 1\n        else:\n            merged.append(nums2[j])\n            j += 1\n    merged.extend(nums1[i:])\n    merged.extend(nums2[j:])\n    return merged\n", "entry_point": "merge_sorted_lists", "input": "[2, 3, 4, 5], [3, 4, 4, 4, 5, 5]", "output": "[2, 3, 3, 4, 4, 4, 4, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142881_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014489", "code": "import re\ndef input_url_source_check(input_url):\n    sources_regex = {\n        'syosetu': '((http:\\/\\/|https:\\/\\/)?(ncode.syosetu.com\\/n))(\\d{4}[a-z]{2}\\/?)$',\n        'example': 'https://www.example.com/.*'\n    }\n    for key, pattern in sources_regex.items():\n        regex = re.compile(pattern)\n        if re.match(regex, input_url):\n            return key\n    return False\n", "entry_point": "input_url_source_check", "input": "'https://www.example.com/test'", "output": "'example'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93592_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014490", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014491", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[1, 1, 2, 2, 3, 3, 4, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014492", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[1, 1, 2, 2, 3, 3]", "output": "[(1, 2), (2, 2), (3, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014493", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-12, -5, -9, -9, -11, -8, -8, 4]", "output": "[-12, -5, -9, -9, -11, -8, -8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014494", "code": "def prep_image(prefix, key, rgb):\n    formatted_rgb = f\"({rgb[0]}, {rgb[1]}, {rgb[2]})\"\n    return f\"{prefix}_{key}_{formatted_rgb}\"\n", "entry_point": "prep_image", "input": "'image', 'data', (255, 128, 0)", "output": "'image_data_(255, 128, 0)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22004_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014495", "code": "from typing import List\ndef can_cross_stones(stones: List[int]) -> bool:\n    n = len(stones)\n    dp = [[False] * (n + 1) for _ in range(n)]\n    dp[0][0] = True\n    for i in range(1, n):\n        for j in range(i):\n            k = stones[i] - stones[j]\n            if k > n:\n                continue\n            for x in (k - 1, k, k + 1):\n                if 0 <= x <= n:\n                    dp[i][k] |= dp[j][x]\n    return any(dp[-1])\n", "entry_point": "can_cross_stones", "input": "[0, 1, 3, 5, 6, 8]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70312_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014496", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[6, 8, 10]", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134450_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014497", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'5 1 2 0 3 4 9'", "output": "509", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014498", "code": "from typing import List\ndef weighted_sum(methods: List[tuple]) -> float:\n    total_weighted_sum = 0\n    for result, frames in methods:\n        total_weighted_sum += result * frames\n    return total_weighted_sum\n", "entry_point": "weighted_sum", "input": "[(0, 5), (1, 3), (-1, 3)]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26992_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014499", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'Big * Tech* Company *CEO*'", "output": "('Big', 'Tech* Company *CEO*')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014500", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014501", "code": "def encrypt_text(text: str, k: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        new_ascii = ord(char) + k\n        if new_ascii > 126:\n            new_ascii = 32 + (new_ascii - 127)\n        encrypted_text += chr(new_ascii)\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Vnqkc n+', 7", "output": "\"]uxrj'u2\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40126_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014502", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "8", "output": "1430", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014503", "code": "from typing import List, Dict\ndef get_student_subjects(student_id: int) -> List[Dict[str, str]]:\n    # Simulating database query results\n    subjects_data = {\n        1: [{\"id\": 1, \"name\": \"Math\"}, {\"id\": 2, \"name\": \"Science\"}],\n        2: [{\"id\": 3, \"name\": \"History\"}],\n        3: []\n    }\n    subjects = subjects_data.get(student_id, [])\n    if not subjects:\n        return [{\"result\": \"fail\", \"reason\": \"No subjects found\"}]\n    return subjects\n", "entry_point": "get_student_subjects", "input": "2", "output": "[{'id': 3, 'name': 'History'}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27485_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014504", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'bbbb'", "output": "'b4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014505", "code": "def construct_document_word_dict(document_word_pairs):\n    document_word_dict = {}\n    for document_id, word in document_word_pairs:\n        if document_id not in document_word_dict:\n            document_word_dict[document_id] = set()\n        document_word_dict[document_id].add(word)\n    # Convert sets to lists for the final output\n    document_word_dict = {doc_id: list(words) for doc_id, words in document_word_dict.items()}\n    return document_word_dict\n", "entry_point": "construct_document_word_dict", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85969_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014506", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'44.2.1444'", "output": "(44, 2, 1444)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014507", "code": "def average_evaluations(logs: list[dict]) -> float:\n    total_evaluations = sum(log.get('fevals', 0) for log in logs)\n    num_logs = len(logs)\n    if num_logs == 0:\n        return 0.0\n    return total_evaluations / num_logs\n", "entry_point": "average_evaluations", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9824_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014508", "code": "def custom_inclusion_tag(template_name, project_list):\n    return {'project_list': project_list}\n", "entry_point": "custom_inclusion_tag", "input": "None, []", "output": "{'project_list': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45847_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014509", "code": "def format_version(version_str: str) -> str:\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    version_integers = [int(component) for component in version_components]\n    # Format the version string as 'vX.Y.Z'\n    formatted_version = 'v' + '.'.join(map(str, version_integers))\n    return formatted_version\n", "entry_point": "format_version", "input": "'1.1213'", "output": "'v1.1213'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15533_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014510", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'city=Nek'", "output": "{'city': 'Nek'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014511", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[4, 3, 4, 0, 1, 5, 5, 6, 2]", "output": "[4, 3, 0, 1, 5, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014512", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1436", "output": "{1, 2, 4, 359, 718, 1436}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1435", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014513", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 7, 0, 5, 2, 7]", "output": "[12, 7, 5, 7, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51354_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014514", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6094", "output": "{1, 2, 3047, 554, 11, 6094, 277, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6093", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014515", "code": "def calculate(numbers):\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd\n", "entry_point": "calculate", "input": "[2, 4, 6, 5, 0]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115831_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014516", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 3, 5, 4, 0]", "output": "[4, 27, 125, 16, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014517", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'acabCCHAIN_IDdff312323345', ''", "output": "'acabCdff312323345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014518", "code": "def find_floor_position(parentheses: str) -> int:\n    floor = 0\n    position = 0\n    for char in parentheses:\n        position += 1\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        if floor == -1:\n            return position\n    return -1\n", "entry_point": "find_floor_position", "input": "'((((())))))'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95034_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014519", "code": "import re\ndef validate_entity_type(input_values, entity_type_regex):\n    pattern = re.compile(entity_type_regex)\n    for value in input_values:\n        if not pattern.match(value.strip()):\n            return False\n    return True\n", "entry_point": "validate_entity_type", "input": "['abc', '123', 'A1B2C3'], '^[A-Za-z0-9]+$'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57213_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014520", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[-1, 0, 1, 1, 2, 5, 6, 7, 7, 7], 7", "output": "[-1, 0, 1, 1, 2, 5, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4782", "output": "{1, 2, 3, 6, 4782, 2391, 1594, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014522", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'0.0.1'", "output": "(0, 0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014523", "code": "from typing import List\ndef reverse_strings(input_list: List[str]) -> List[str]:\n    return [s[::-1] for s in input_list if s.strip()]\n", "entry_point": "reverse_strings", "input": "['hello', 'world', 'python']", "output": "['olleh', 'dlrow', 'nohtyp']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014524", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "27, 2", "output": "351", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt99", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "751", "output": "{1, 751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4714", "output": "{1, 4714, 2, 2357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014527", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'pppath1t'", "output": "'Content for pppath1t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014528", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "12, 1", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014529", "code": "def calculate_final_time(b, max_var_fixed):\n    final_best_time = 0\n    for max_b, variable, fixed in max_var_fixed:\n        passed_bits = min(b, max_b)\n        b -= passed_bits\n        final_best_time += fixed + variable * passed_bits\n        if not b:\n            return final_best_time\n    return final_best_time\n", "entry_point": "calculate_final_time", "input": "10, [(10, 5, 6)]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41267_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014530", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'abbe'", "output": "'abbe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014531", "code": "def interpolate_string(template, values):\n    for key, value in values.items():\n        placeholder = \"${\" + key + \"}\"\n        template = template.replace(placeholder, str(value))\n    return template\n", "entry_point": "interpolate_string", "input": "'${NAME},', {}", "output": "'${NAME},'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26691_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014532", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014533", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "'W'", "output": "'W'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014534", "code": "def max_subset_sum_non_adjacent(arr):\n    inclusive = 0\n    exclusive = 0\n    for num in arr:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update inclusive as the sum of previous exclusive and current element\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[10, 1, 15, 1, 2]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38682_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014535", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[18, 19]", "output": "18.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014536", "code": "def validate_lst(element: list) -> bool:\n    '''\n    Return True if element is valid and False otherwise\n    '''\n    for item in range(1, 10):\n        if element.count(item) > 1:\n            return False\n    return True\n", "entry_point": "validate_lst", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68264_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2012", "output": "{1, 2, 4, 1006, 503, 2012}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2011", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014538", "code": "import re\n# Regex for form fields\nRE_EMAIL = re.compile(r'^[\\S]+@[\\S]+\\.[\\S]+$')\n# Form validation error messages\nRE_EMAIL_FAIL = \"That's not a valid email. Please try again.\"\nRE_EMAIL_SUCCESS = \"You will be the first to be updated!\"\ndef validate_email(email):\n    if RE_EMAIL.match(email):\n        return RE_EMAIL_SUCCESS\n    else:\n        return RE_EMAIL_FAIL\n", "entry_point": "validate_email", "input": "'example@example.com'", "output": "'You will be the first to be updated!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123274_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014539", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "14", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014540", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'abcdefgh', 'ijklmnopq'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2765", "output": "{1, 35, 5, 7, 553, 395, 2765, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "757", "output": "{1, 757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014543", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'world'", "output": "{'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014544", "code": "from typing import List\ndef max_difference_after(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    min_element = nums[0]\n    max_difference = 0\n    for num in nums[1:]:\n        difference = num - min_element\n        if difference > max_difference:\n            max_difference = difference\n        if num < min_element:\n            min_element = num\n    return max_difference\n", "entry_point": "max_difference_after", "input": "[1, 2, 3, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72615_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014545", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[100, 99, 98, 95, 95, 93, 100], 7", "output": "97.14285714285714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014546", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3557", "output": "{1, 3557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014547", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[1, 4, 5, 1, 1, 3, 3, 5, 5]", "output": "[0, 2, 3, 0, 0, 1, 1, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014548", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[2, 1, 3, 3]", "output": "[2, 1, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014549", "code": "from typing import List, Tuple\ndef find_pairs(nums: List[int], target: int) -> List[Tuple[int, int]]:\n    seen = set()\n    pairs = []\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            pairs.append((num, complement))\n        seen.add(num)\n    return pairs\n", "entry_point": "find_pairs", "input": "[8, 8], 16", "output": "[(8, 8)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97249_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014550", "code": "def rock_paper_scissors(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie!\"\n    elif (player1_choice == 'rock' and player2_choice == 'scissors') or \\\n         (player1_choice == 'scissors' and player2_choice == 'paper') or \\\n         (player1_choice == 'paper' and player2_choice == 'rock'):\n        return 'Player 1 wins!'\n    else:\n        return 'Player 2 wins!'\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'scissors'", "output": "'Player 1 wins!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127812_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014551", "code": "def sum_even_numbers(input_list):\n    total_sum = 0\n    for element in input_list:\n        if isinstance(element, str):\n            try:\n                num = int(element)\n                if num % 2 == 0:\n                    total_sum += num\n            except ValueError:\n                pass\n        elif isinstance(element, int) and element % 2 == 0:\n            total_sum += element\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[484, '484']", "output": "968", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120619_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014552", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[2, 4, 5, 6, 3], 5", "output": "[0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3106", "output": "{1, 3106, 2, 1553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3105", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014554", "code": "def calculate_balance(transactions):\n    balance = 0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'deposit':\n            balance += amount\n        elif transaction_type == 'withdrawal':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('deposit', 300)]", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34188_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014555", "code": "from typing import List\ndef process_data(data: List[int]) -> int:\n    result = 0\n    for num in data:\n        doubled_num = num * 2\n        if doubled_num % 3 == 0:\n            squared_num = doubled_num ** 2\n            result += squared_num\n    return result\n", "entry_point": "process_data", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27077_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014556", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5762", "output": "{2881, 1, 5762, 2, 67, 134, 43, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014557", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[90, 85, 80, 75, 75]", "output": "81.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9571", "output": "{1, 9571, 17, 563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014559", "code": "def transliterate_lines(source_text, mapping):\n    mapping_dict = dict(pair.split(':') for pair in mapping.split(','))\n    transliterated_text = ''.join(mapping_dict.get(char, char) for char in source_text)\n    return transliterated_text\n", "entry_point": "transliterate_lines", "input": "'hello', 'h:\u0266,e:\u025b,l:\u029f,o:\u0254'", "output": "'\u0266\u025b\u029f\u029f\u0254'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56181_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014560", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hellhellolo'", "output": "{'hellhellolo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014561", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[158]", "output": "158", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014562", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'ad'", "output": "'ad'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014563", "code": "from collections import Counter\ndef max_score(card, k):\n    c = Counter(card)\n    ans = 0\n    while k > 0:\n        tmp = c.pop(c.most_common(1)[0][0])\n        if k > tmp:\n            ans += tmp * tmp\n            k -= tmp\n        else:\n            ans += k * k\n            k = 0\n    return ans\n", "entry_point": "max_score", "input": "[], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62809_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014564", "code": "def smallest_unique(fronts, backs):\n    same_sides = {}\n    for i in range(len(fronts)):\n        if fronts[i] == backs[i]:\n            if fronts[i] not in same_sides:\n                same_sides[fronts[i]] = 0\n            same_sides[fronts[i]] += 1\n    min_side = 2345\n    for i in range(len(fronts)):\n        f, b = fronts[i], backs[i]\n        if f == b:\n            continue\n        if f not in same_sides:\n            min_side = min(min_side, f)\n        if b not in same_sides:\n            min_side = min(min_side, b)\n    if min_side == 2345:\n        min_side = 0\n    return min_side\n", "entry_point": "smallest_unique", "input": "[1, 2, 3], [2, 3, 4]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121336_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014565", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for num1, num2 in zip(arr1, arr2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0, 0, 0, 0], [0, 5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20129_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014566", "code": "def count_outside_entities(entities):\n    outside_count = 0\n    for entity in entities:\n        if entity.get(\"label\") == \"O\":\n            outside_count += 1\n    return outside_count\n", "entry_point": "count_outside_entities", "input": "[{'label': 'O'}, {'label': 'A'}, {'label': 'B'}]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95449_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014567", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'boubbA', ' (Begkulu)en)'", "output": "{'title': 'boubbA', 'contrib': ' (Begkulu)en)'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014568", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 7", "output": "823543", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014569", "code": "def calculate_areas(dimensions):\n    areas = []\n    for dimension in dimensions:\n        area = dimension[0] * dimension[1]\n        areas.append(area)\n    return areas\n", "entry_point": "calculate_areas", "input": "[(4, 5), (6, 5), (7, 8)]", "output": "[20, 30, 56]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77489_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014570", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6430", "output": "{1, 2, 643, 5, 1286, 10, 3215, 6430}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6429", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "547", "output": "{1, 547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014572", "code": "query = {\n    \"sideMovementLeft\": \"Moving left.\",\n    \"sideMovementRight\": \"Moving right.\",\n    \"invalidMovement\": \"Invalid movement direction.\"\n}\ndef leftRightMovement(directionS):\n    if directionS == \"left\":\n        response = query[\"sideMovementLeft\"]\n    elif directionS == \"right\":\n        response = query[\"sideMovementRight\"]\n    else:\n        response = query[\"invalidMovement\"]\n    return response\n", "entry_point": "leftRightMovement", "input": "'left'", "output": "'Moving left.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014573", "code": "from functools import reduce\nfrom operator import xor\ndef find_missing_integer(xs):\n    n = len(xs)\n    xor_xs = reduce(xor, xs)\n    xor_full = reduce(xor, range(1, n + 2))\n    return xor_xs ^ xor_full\n", "entry_point": "find_missing_integer", "input": "[1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77106_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014574", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8777", "output": "{8777, 1, 67, 131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014575", "code": "from typing import List\ndef find_starting_station(gas: List[int], cost: List[int]) -> int:\n    n = len(gas)\n    total_tank, curr_tank, start = 0, 0, 0\n    for i in range(n):\n        total_tank += gas[i] - cost[i]\n        curr_tank += gas[i] - cost[i]\n        if curr_tank < 0:\n            start = i + 1\n            curr_tank = 0\n    return start if total_tank >= 0 else -1\n", "entry_point": "find_starting_station", "input": "[1, 2], [1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42546_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014576", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "18", "output": "2584", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014577", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 2, 2, 2, 4, 0, 3, 3]", "output": "[7, 4, 4, 6, 4, 3, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014578", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[5, 5, 3, 2, 1, 1, 4, 6, 9]", "output": "[9, 6, 5, 5, 4, 3, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014579", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'10.0.0.025'", "output": "{'10.0.0.025': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014580", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6549", "output": "{1, 3, 37, 2183, 111, 177, 6549, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014581", "code": "def longest_consecutive(nums):\n    num_set = set(nums)\n    max_length = 0\n    for num in num_set:\n        if num - 1 not in num_set:\n            current_num = num\n            current_length = 1\n            while current_num + 1 in num_set:\n                current_num += 1\n                current_length += 1\n            max_length = max(max_length, current_length)\n    return max_length\n", "entry_point": "longest_consecutive", "input": "[1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126647_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014582", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[2, 6, 3]", "output": "[2, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014583", "code": "def extract_version_numbers(version_str):\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    revision = int(version_components[2].split('.')[0])  # Extract only the numeric part\n    return major, minor, revision\n", "entry_point": "extract_version_numbers", "input": "'44.0.0'", "output": "(44, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110593_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014584", "code": "def calculate_average_price(prices):\n    total_sum = sum(prices)\n    average_price = total_sum / len(prices)\n    rounded_average = round(average_price)\n    return rounded_average\n", "entry_point": "calculate_average_price", "input": "[133332]", "output": "133332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112291_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014585", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'Alan', 'module'", "output": "'ALA_mod'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014586", "code": "import re\nfrom typing import Union\ndef extract_earliest_year(text: str) -> Union[int, None]:\n    year_pattern = re.compile(r'(-?\\d{1,4}(AD|BC)?)')\n    matches = year_pattern.findall(text)\n    earliest_year = None\n    for match in matches:\n        year_str = match[0]\n        if year_str.endswith(('AD', 'BC')):\n            year_str = year_str[:-2]\n        year = int(year_str)\n        if earliest_year is None or year < earliest_year:\n            earliest_year = year\n    return earliest_year\n", "entry_point": "extract_earliest_year", "input": "'The years 21 AD and 50 AD will follow 20 AD.'", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148764_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014587", "code": "def extract_verbose_name(app_config_class: str) -> str:\n    for line in app_config_class.split('\\n'):\n        if 'verbose_name' in line:\n            verbose_name = line.split('=')[1].strip().strip('\"')\n            return verbose_name\n", "entry_point": "extract_verbose_name", "input": "'class AppConfig:\\n    name = \"my_app\"\\n    verbose_name = \"Rides\"'", "output": "'Rides'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93832_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014588", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "1.87", "output": "'1.87'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014589", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2017", "output": "{1, 2017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8057", "output": "{1, 1151, 8057, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014591", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[60.0, 67.0, 68.5, 69.25, 75.0]", "output": "68.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014592", "code": "def process_dependencies(dependencies):\n    dependency_dict = {}\n    for key, value in dependencies:\n        if key in dependency_dict:\n            dependency_dict[key].append(value)\n        else:\n            dependency_dict[key] = [value]\n    return dependency_dict\n", "entry_point": "process_dependencies", "input": "[('A', 'B'), ('B', 'C'), ('C', 'D')]", "output": "{'A': ['B'], 'B': ['C'], 'C': ['D']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147184_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014593", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[10, 20, 15, 30, 22], 52", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9239", "output": "{1, 9239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014595", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    while player1_deck and player2_deck:\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    return player1_score, player2_score\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]", "output": "(0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131386_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014596", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2202", "output": "{1, 2, 3, 6, 1101, 367, 2202, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014597", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[60, 65.6, 70]", "output": "65.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50380_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014598", "code": "def concatenate_string(s, n):\n    result = \"\"\n    for i in range(n):\n        result += s\n    return result\n", "entry_point": "concatenate_string", "input": "'hello', 3", "output": "'hellohellohello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24778_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014599", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[0, 1, 2, 3]", "output": "{0: 0, 1: 1, 2: 4, 3: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014600", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "11, 6", "output": "1771561", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt33", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014601", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "73", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2595", "output": "{1, 865, 3, 2595, 5, 519, 173, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014603", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average", "input": "[80, 85, 90]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102000_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014604", "code": "import ast\ndef extract_functions_and_classes(module_code):\n    module_ast = ast.parse(module_code)\n    functions = []\n    classes = []\n    for node in ast.walk(module_ast):\n        if isinstance(node, ast.FunctionDef):\n            functions.append(node.name)\n        elif isinstance(node, ast.ClassDef):\n            classes.append(node.name)\n    return functions, classes\n", "entry_point": "extract_functions_and_classes", "input": "'def func1():\\n    pass'", "output": "(['func1'], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53175_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4445", "output": "{1, 35, 5, 7, 889, 635, 4445, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014606", "code": "def average_string_length(lst):\n    total_length = 0\n    count = 0\n    for item in lst:\n        if isinstance(item, str):\n            total_length += len(item)\n            count += 1\n    if count == 0:\n        return 0\n    average_length = total_length / count\n    return round(average_length)\n", "entry_point": "average_string_length", "input": "['hello', 'worlds', 'python', 'banana']", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106752_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014607", "code": "def solution(array):\n    result = array.copy()  # Create a copy of the input array to avoid modifying the original array\n    for i in range(len(array) - 1):\n        if array[i] == 0 and array[i + 1] == 1:\n            result[i], result[i + 1] = result[i + 1], result[i]  # Swap the elements if the condition is met\n    return result\n", "entry_point": "solution", "input": "[0, 1, 1, 0, 0, 2, 3, 0, 2]", "output": "[1, 0, 1, 0, 0, 2, 3, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107637_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014608", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[4, 5, 5, 5]", "output": "(4, 125)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014609", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "-3, 0", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6086", "output": "{1, 2, 3043, 34, 6086, 358, 17, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014611", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1186", "output": "{593, 1, 1186, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014612", "code": "def parse_setup_dict(setup_dict):\n    name = setup_dict.get(\"name\", \"\")\n    author = setup_dict.get(\"author\", \"\")\n    author_email = setup_dict.get(\"author_email\", \"\")\n    install_requires = setup_dict.get(\"install_requires\", [])\n    return name, author, author_email, install_requires\n", "entry_point": "parse_setup_dict", "input": "{}", "output": "('', '', '', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52153_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014613", "code": "def unicode_converter(input_string):\n    result = \"\"\n    for char in input_string:\n        code_point = ord(char)\n        result += f\"\\\\u{format(code_point, 'x')}\"\n    return result\n", "entry_point": "unicode_converter", "input": "'hello'", "output": "'\\\\u68\\\\u65\\\\u6c\\\\u6c\\\\u6f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4025_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014614", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'is'", "output": "('', 'is')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014615", "code": "def determine_action(hand_value):\n    non_ace = hand_value - 11\n    action = 'Hit' if non_ace <= 10 else 'Stand'\n    return action\n", "entry_point": "determine_action", "input": "10", "output": "'Hit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101530_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014616", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "18", "output": "'WINMOBILE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014617", "code": "import ast\ndef evaluate_expression(expression: str) -> float:\n    tree = ast.parse(expression, mode='eval')\n    def evaluate_node(node):\n        if isinstance(node, ast.BinOp):\n            left = evaluate_node(node.left)\n            right = evaluate_node(node.right)\n            if isinstance(node.op, ast.Add):\n                return left + right\n            elif isinstance(node.op, ast.Sub):\n                return left - right\n            elif isinstance(node.op, ast.Mult):\n                return left * right\n            elif isinstance(node.op, ast.Div):\n                return left / right\n        elif isinstance(node, ast.Num):\n            return node.n\n        elif isinstance(node, ast.Expr):\n            return evaluate_node(node.value)\n        else:\n            raise ValueError(\"Invalid expression\")\n    return evaluate_node(tree.body)\n", "entry_point": "evaluate_expression", "input": "'200 + 23'", "output": "223", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124878_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014618", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[30, 29, 10, 20, 15]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014619", "code": "import ast\ndef count_sqlalchemy_modules(script):\n    sqlalchemy_modules = {}\n    tree = ast.parse(script)\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Import):\n            for alias in node.names:\n                if alias.name.startswith('sqlalchemy'):\n                    sqlalchemy_modules[alias.name] = sqlalchemy_modules.get(alias.name, 0) + 1\n        elif isinstance(node, ast.ImportFrom):\n            if node.module.startswith('sqlalchemy'):\n                module_name = f\"{node.module}.{node.names[0].name}\"\n                sqlalchemy_modules[module_name] = sqlalchemy_modules.get(module_name, 0) + 1\n    return sqlalchemy_modules\n", "entry_point": "count_sqlalchemy_modules", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116149_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014620", "code": "def shift_string(input_str, shift_value):\n    shift_value = abs(shift_value)\n    if shift_value == 0:\n        return input_str\n    if shift_value > len(input_str):\n        shift_value %= len(input_str)\n    if shift_value < 0:\n        shift_value = len(input_str) + shift_value\n    if shift_value > 0:\n        shifted_str = input_str[-shift_value:] + input_str[:-shift_value]\n    else:\n        shifted_str = input_str[shift_value:] + input_str[:shift_value]\n    return shifted_str\n", "entry_point": "shift_string", "input": "'ClassicalBinning', 2", "output": "'ngClassicalBinni'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14180_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014621", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'Hewlo Hl'", "output": "'Hewlo                                 Hl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014622", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 10, 30]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014623", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "25, 10", "output": "'25'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014624", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[5, 1, 2, 5, 0, 3, 1, 5]", "output": "[1, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "998", "output": "{1, 2, 499, 998}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt997", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6035", "output": "{1, 355, 5, 71, 17, 6035, 85, 1207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "485", "output": "{1, 5, 485, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014628", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'/path/to/paxt'", "output": "('paxt', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014629", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'M<EMAIL>'", "output": "'M<EMAIL>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014630", "code": "def frog_jump_time(A, X):\n    positions = set()\n    for time, position in enumerate(A):\n        positions.add(position)\n        if len(positions) == X:\n            return time\n    return -1\n", "entry_point": "frog_jump_time", "input": "[0, 1, 2, 3, 4], 5", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50166_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4825", "output": "{1, 193, 965, 5, 4825, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014632", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(2, 1, 0)", "output": "'2.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014633", "code": "from typing import List\ndef mad_libs(story: str, words: List[str]) -> str:\n    parts = story.split('{')  # Split the story based on placeholders\n    complete_story = parts[0]  # Initialize the complete story with the first part\n    for i in range(1, len(parts)):\n        placeholder, rest = parts[i].split('}', 1)  # Extract the placeholder number and the rest of the string\n        word_index = int(placeholder) - 1  # Convert placeholder number to index\n        complete_story += words[word_index] + rest  # Replace placeholder with word and add the rest\n    return complete_story\n", "entry_point": "mad_libs", "input": "'{1}', ['in']", "output": "'in'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103990_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014634", "code": "def extract_version_info(info_dict):\n    version_number = info_dict.get(\"version\", \"N/A\")\n    git_revision_id = info_dict.get(\"full-revisionid\", \"N/A\")\n    version_info_str = f\"Version: {version_number}, Git Revision: {git_revision_id}\"\n    return version_info_str\n", "entry_point": "extract_version_info", "input": "{}", "output": "'Version: N/A, Git Revision: N/A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5935_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014635", "code": "def extract_char_frequencies(input_string: str) -> dict:\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "extract_char_frequencies", "input": "'hhheeelo'", "output": "{'h': 3, 'e': 3, 'l': 1, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5034_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014636", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "[135, 135, 135, 135, 135]", "output": "135.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014637", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "-9, 2", "output": "-18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014638", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "987654321, 9", "output": "'987654321'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014639", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'H##111@@Hello&23!!ellol'", "output": "'H111Hello23ellol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014640", "code": "def count_unique_answers(groups):\n    total = 0\n    answers = set()\n    for line in groups:\n        if not line:\n            total += len(answers)\n            answers = set()\n        else:\n            for letter in line:\n                answers.add(letter)\n    return total\n", "entry_point": "count_unique_answers", "input": "['a', '']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49059_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014641", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6218", "output": "{1, 6218, 2, 3109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6217", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014642", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "-4, 8", "output": "-27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014643", "code": "def extract_verbose_name(class_name: str) -> str:\n    # Split the class name based on uppercase letters\n    words = [char if char.isupper() else ' ' + char for char in class_name]\n    verbose_name = ''.join(words).strip()\n    # Convert the verbose name to the desired format\n    verbose_name = verbose_name.replace('Config', '').replace('ADM', ' \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0414\u0435\u0434\u043e\u0432 \u041c\u043e\u0440\u043e\u0437\u043e\u0432')\n    return verbose_name\n", "entry_point": "extract_verbose_name", "input": "'ClubADMConfig'", "output": "'C l u b \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0414\u0435\u0434\u043e\u0432 \u041c\u043e\u0440\u043e\u0437\u043e\u0432C o n f i g'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42194_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014644", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1727", "output": "{1, 11, 157, 1727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014645", "code": "def find_divisible_sum(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "find_divisible_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147524_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014646", "code": "def min_eggs_needed(egg_weights, n):\n    dp = [float('inf')] * (n + 1)\n    dp[0] = 0\n    for w in range(1, n + 1):\n        for ew in egg_weights:\n            if w - ew >= 0:\n                dp[w] = min(dp[w], dp[w - ew] + 1)\n    return dp[n]\n", "entry_point": "min_eggs_needed", "input": "[1], 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108972_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014647", "code": "def reverse_words_order_and_swap_cases(sentence):\n    words = sentence.split()\n    reversed_words = [word.swapcase()[::-1] for word in words]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_words_order_and_swap_cases", "input": "'WWrlWd'", "output": "'DwLRww'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6578_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014648", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'JoJ.HN.Doe'", "output": "'jojhndoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014649", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[8, 10, 8, 8, 8, 7, 8, 8], 0", "output": "[8, 10, 8, 8, 8, 7, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014650", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1837", "output": "{1, 11, 1837, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1675", "output": "{1, 67, 5, 1675, 335, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1674", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014652", "code": "def simulate_card_game(deck1, deck2):\n    rounds_played = 0\n    while deck1 and deck2:\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        rounds_played += 1\n    return rounds_played\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84703_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014653", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[[10, 15], [13]]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014654", "code": "def create_image(pixel_values):\n    side_length = int(len(pixel_values) ** 0.5)\n    image = [[0 for _ in range(side_length)] for _ in range(side_length)]\n    for i in range(side_length):\n        for j in range(side_length):\n            image[i][j] = pixel_values[i * side_length + j]\n    return image\n", "entry_point": "create_image", "input": "[223, 128, 254, 160]", "output": "[[223, 128], [254, 160]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113012_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014655", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[4, 2, 3]", "output": "{4: 360, 2: 0, 3: 180}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014656", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(1, len(lst)):\n        abs_diff_sum += abs(lst[i] - lst[i - 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 5, 10, 5, 7]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72973_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014657", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "124, 3", "output": "'124'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4808", "output": "{1, 2, 2404, 4, 4808, 8, 1202, 601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4807", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014659", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "9", "output": "341", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014660", "code": "def validate_age(input_str):\n    if '-' in input_str:\n        start, end = input_str.split('-')\n        try:\n            start = int(start)\n            end = int(end)\n            return start <= end\n        except ValueError:\n            return False\n    else:\n        try:\n            int(input_str)\n            return True\n        except ValueError:\n            return False\n", "entry_point": "validate_age", "input": "'10-20'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42783_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014661", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014662", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "8, 11", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014663", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[82, 82, 82, 82, 82, 82, 82, 82, 86]", "output": "82.44444444444444", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81933_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014664", "code": "def flexible_sum(*args):\n    if len(args) < 3:\n        args += (30, 40)[len(args):]  # Assign default values if fewer than 3 arguments provided\n    return sum(args)\n", "entry_point": "flexible_sum", "input": "128", "output": "168", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74466_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014665", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'cherwatermelrnry'", "output": "['cherwatermelrnry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014666", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4971", "output": "{3, 1, 4971, 1657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014667", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 5, 1, 0, 5, 4, 1, 0]", "output": "[5, 2, 0, 20, 20, 6, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014668", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6010", "output": "{1, 2, 5, 10, 1202, 601, 6010, 3005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6009", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014669", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "385", "output": "{1, 385, 35, 5, 7, 11, 77, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014671", "code": "def calculate_grade(score1, score2):\n    if score1 >= 90 and score2 > 80:\n        return \"A\"\n    elif score1 >= 80 and score2 >= 70:\n        return \"B\"\n    elif score1 >= 70 and score2 >= 60:\n        return \"C\"\n    elif score1 == 75 or score2 <= 65:\n        return \"D\"\n    else:\n        return \"E\"\n", "entry_point": "calculate_grade", "input": "80, 70", "output": "'B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123969_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014672", "code": "from typing import List\ndef count_pairs_with_sum(arr: List[int], target: int) -> int:\n    num_freq = {}\n    pair_count = 0\n    for num in arr:\n        complement = target - num\n        if complement in num_freq and num_freq[complement] > 0:\n            pair_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_with_sum", "input": "[5, 5, 5, 5, 5], 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131287_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014673", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'worqu'", "output": "'worqu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014674", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[86, 84, 92, 65, 84, 88, 89, 88, 84]", "output": "[65, 84, 84, 84, 86, 88, 88, 89, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014675", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "21, 10", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014676", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3194", "output": "{1, 3194, 2, 1597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3193", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014677", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'hhttpxample.com', '1e/de'", "output": "'hhttpxample.com/1e/de'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014678", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[2, 1, 1]", "output": "[4, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014679", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[4, 5, 7, 9]", "output": "([4], [5, 7, 9])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014680", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[38, 0, 0], 2", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014681", "code": "from typing import List\ndef extract_phone_numbers(input_list: List[str]) -> List[str]:\n    phone_numbers = []\n    for phone_str in input_list:\n        numbers = phone_str.split(',')\n        for number in numbers:\n            cleaned_number = number.strip()\n            if cleaned_number:\n                phone_numbers.append(cleaned_number)\n    return phone_numbers\n", "entry_point": "extract_phone_numbers", "input": "['133232']", "output": "['133232']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103322_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014682", "code": "from typing import List\ndef find_min_abs_difference_pairs(arr: List[int]) -> List[List[int]]:\n    arr.sort()\n    min_diff = min(arr[i] - arr[i - 1] for i in range(1, len(arr)))\n    min_pairs = [[arr[i - 1], arr[i]] for i in range(1, len(arr)) if arr[i] - arr[i - 1] == min_diff]\n    return min_pairs\n", "entry_point": "find_min_abs_difference_pairs", "input": "[2, 2, 3, 3, 3, 3, 4, 4]", "output": "[[2, 2], [3, 3], [3, 3], [3, 3], [4, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128793_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014683", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[2, 2, 2, 2, 4, 4, 5, 6]", "output": "{2: 4, 4: 2, 5: 1, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014684", "code": "from typing import List\ndef calculate_average_score(scores: List[int], threshold: int) -> float:\n    valid_scores = [score for score in scores if score >= threshold]\n    if not valid_scores:\n        return 0.0  # Return 0 if no scores are above the threshold\n    total_valid_scores = sum(valid_scores)\n    average_score = total_valid_scores / len(valid_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[70, 80, 75, 76, 76], 70", "output": "75.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74900_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014685", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'coccoonve'", "output": "'coccoonve'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014686", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 89, 88, 85, 75]", "output": "[92, 89, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014687", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'ilebbii', 5", "output": "'nqjggnn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15986_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014688", "code": "def assign_grades(scores):\n    result_list = []\n    for score in scores:\n        if score >= 90:\n            result_list.append('A')\n        elif score >= 80:\n            result_list.append('B')\n        elif score >= 70:\n            result_list.append('C')\n        elif score >= 60:\n            result_list.append('D')\n        else:\n            result_list.append('F')\n    return result_list\n", "entry_point": "assign_grades", "input": "[65, 85, 75, 95, 50, 55, 62, 40]", "output": "['D', 'B', 'C', 'A', 'F', 'F', 'D', 'F']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90074_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014689", "code": "def get_json_support_level(django_version):\n    json_support_levels = {\n        (2, 2): 'has_jsonb_agg',\n        (3, 2): 'is_postgresql_10',\n        (4, 0): 'has_native_json_field'\n    }\n    for version, support_level in json_support_levels.items():\n        if django_version[:2] == version:\n            return support_level\n    return 'JSON support level not defined for this Django version'\n", "entry_point": "get_json_support_level", "input": "(2, 2)", "output": "'has_jsonb_agg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40645_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1695", "output": "{1, 3, 5, 15, 113, 339, 565, 1695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014691", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[5, 4, 2, 2, 4, 4, 2]", "output": "[5, 5, 4, 5, 8, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014692", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1132", "output": "{1, 2, 4, 1132, 566, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1131", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1697", "output": "{1, 1697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014694", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 7, 4, 5, 3, 3, 1, 4]", "output": "[8, 11, 9, 8, 6, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014695", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'ItmPorterPMX'", "output": "'itmporterpmx.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8311", "output": "{1, 8311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014697", "code": "def prime_sum(limit: int) -> int:\n    def sieve_of_eratosthenes(n):\n        primes = [True] * (n + 1)\n        primes[0] = primes[1] = False\n        p = 2\n        while p * p <= n:\n            if primes[p]:\n                for i in range(p * p, n + 1, p):\n                    primes[i] = False\n            p += 1\n        return [i for i in range(2, n) if primes[i]]\n    primes_below_limit = sieve_of_eratosthenes(limit)\n    return sum(primes_below_limit)\n", "entry_point": "prime_sum", "input": "7", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76811_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014698", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'dont_v2.it'", "output": "'dont_v3.it'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014699", "code": "def sum_divisible_by_3_not_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    return total\n", "entry_point": "sum_divisible_by_3_not_5", "input": "[3, 6, 9, 12]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59130_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7418", "output": "{1, 7418, 2, 3709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7417", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014701", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/porod/du/'", "output": "'/porod/du'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1323", "output": "{1, 3, 7, 9, 1323, 49, 147, 21, 441, 27, 189, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014703", "code": "def custom_balanced_accuracy_score(Y, Yh):\n    TP, TN, FP, FN = 0, 0, 0, 0\n    for true_label, pred_label in zip(Y, Yh):\n        if true_label == 1 and pred_label == 1:\n            TP += 1\n        elif true_label == 0 and pred_label == 0:\n            TN += 1\n        elif true_label == 0 and pred_label == 1:\n            FP += 1\n        elif true_label == 1 and pred_label == 0:\n            FN += 1\n    sensitivity = TP / (TP + FN) if TP + FN != 0 else 0.5\n    specificity = TN / (TN + FP) if TN + FP != 0 else 0.5\n    balanced_accuracy = 0.5 * (sensitivity + specificity)\n    return balanced_accuracy\n", "entry_point": "custom_balanced_accuracy_score", "input": "[1, 1, 0, 0], [0, 0, 1, 1]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142982_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014704", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3503", "output": "{1, 31, 113, 3503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014705", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[1, 1, 2, 2, 3], 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014706", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'Briefly.'", "output": "{'briefly': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40517_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014707", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2137", "output": "{2137, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014708", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9871", "output": "{1, 9871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014709", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[3, 3, 1, 1, 4, 0]", "output": "{3: 2, 1: 2, 4: 1, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014710", "code": "from typing import List\ndef count_aliases_with_substring(aliases: List[str], target_alias: str) -> int:\n    target_alias = target_alias.lower()\n    count = 0\n    for alias in aliases:\n        if target_alias in alias.lower():\n            count += 1\n    return count\n", "entry_point": "count_aliases_with_substring", "input": "['Caterpillar', 'Wildcat', 'Dog'], 'cat'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84444_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014711", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3725", "output": "{1, 5, 745, 3725, 149, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3724", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014712", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hellohello'", "output": "{'h': 2, 'e': 2, 'l': 4, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119981_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014713", "code": "from time import time\ndef calculate_evaluation_time(start_time: float) -> tuple:\n    current_time = time()\n    total_time_seconds = current_time - start_time\n    total_time_minutes = total_time_seconds / 60\n    return round(total_time_seconds, 1), round(total_time_minutes, 1)\n", "entry_point": "calculate_evaluation_time", "input": "time() - 857467060.7", "output": "(857467060.7, 14291117.7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9568_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014714", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'string_value_hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014715", "code": "import math\ndef getRow(rowIndex):\n    result = [1]\n    if rowIndex == 0:\n        return result\n    n = rowIndex\n    for i in range(int(math.ceil((float(rowIndex) + 1) / 2) - 1)):\n        result.append(result[-1] * n / (rowIndex - n + 1))\n        n -= 1\n    if rowIndex % 2 == 0:\n        result.extend(result[-2::-1])\n    else:\n        result.extend(result[::-1])\n    return result\n", "entry_point": "getRow", "input": "1", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127863_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014716", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[3, 3, 3, 3, 3, 4, 2, 1, 1]", "output": "{3: 5, 4: 1, 2: 1, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014717", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[90, 50, 70, 100, 80, 60, 90]", "output": "[2, 6, 4, 1, 3, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014718", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014719", "code": "def generate_config_summary(config):\n    summary = \"Experiment Configuration Summary:\\n\"\n    for key, value in config.items():\n        if key == 'SEED':\n            summary += f\"Seed Value: {value}\\n\"\n        elif key == 'DATASET':\n            summary += f\"Dataset: {value}\\n\"\n        elif key == 'NET':\n            summary += f\"Network: {value}\\n\"\n        elif key == 'GPU_ID':\n            summary += f\"GPU ID: {value}\\n\"\n        elif key == 'LR':\n            summary += f\"Learning Rate: {value}\\n\"\n        elif key == 'MAX_EPOCH':\n            summary += f\"Max Epochs: {value}\\n\"\n        elif key == 'EXP_NAME':\n            summary += f\"Experiment Name: {value}\\n\"\n        elif key == 'EXP_PATH':\n            summary += f\"Experiment Path: {value}\\n\"\n    return summary\n", "entry_point": "generate_config_summary", "input": "{}", "output": "'Experiment Configuration Summary:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59488_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014720", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[7, 9, 1, 10, 9, 5, 8, 7]", "output": "[1, 5, 7, 7, 8, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014721", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[0, 0, 8, 1, 1]", "output": "[8, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014722", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'xeeeoex800eamplexx', 'ggame12a3'", "output": "'ws://xeeeoex800eamplexx/ggame12a3/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014723", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "7, 3, 144", "output": "6.857142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6487", "output": "{1, 499, 13, 6487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014725", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 6, 8, 8, 8, 8, 12, 7, 7]", "output": "[4, 6, 8, 8, 8, 8, 12, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014726", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "13", "output": "'1101'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014727", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[2, 5, 1], 2", "output": "{(2, 5), (5, 1)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014728", "code": "def plus_one(digits):\n    n = len(digits)\n    for i in range(n-1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    new_num = [0] * (n+1)\n    new_num[0] = 1\n    return new_num\n", "entry_point": "plus_one", "input": "[9, 9, 9]", "output": "[1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123786_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9861", "output": "{1, 3, 9861, 519, 173, 19, 3287, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014730", "code": "def format_column_name(raw_column_name, year):\n    raw_column_name = '_'.join(raw_column_name.lower().split())\n    raw_column_name = raw_column_name.replace('_en_{}_'.format(year), '_')\n    formatted_column_name = raw_column_name.replace('\u00e9', 'e')  # Replace accented '\u00e9' with 'e'\n    return formatted_column_name\n", "entry_point": "format_column_name", "input": "'nl', 2023", "output": "'nl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25598_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014731", "code": "def categorize_weights(weights):\n    category_dict = {1: [], 2: [], 3: [], 4: []}\n    for weight in weights:\n        if weight <= 10:\n            category_dict[1].append(weight)\n        elif weight <= 20:\n            category_dict[2].append(weight)\n        elif weight <= 30:\n            category_dict[3].append(weight)\n        else:\n            category_dict[4].append(weight)\n    return category_dict\n", "entry_point": "categorize_weights", "input": "[15, 14, 14, 14]", "output": "{1: [], 2: [15, 14, 14, 14], 3: [], 4: []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1655_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014732", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) < 2:\n        return 0\n    numbers.remove(max(numbers))\n    numbers.remove(min(numbers))\n    if len(numbers) == 0:\n        return 0\n    average = sum(numbers) / len(numbers)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 3, 4, 5, 8]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122319_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014733", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[20, 20, 16, 8, 8]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014734", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9566", "output": "{1, 2, 9566, 4783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9565", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014735", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'23.722.5'", "output": "(23, 722, 5, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014736", "code": "def find_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    complement_sequence = ''\n    for nucleotide in dna_sequence:\n        complement_sequence += complement_dict.get(nucleotide.upper(), '')  # Handle case-insensitive input\n    return complement_sequence\n", "entry_point": "find_complement", "input": "'AAAAAAAACTCG'", "output": "'TTTTTTTTGAGC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101417_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014737", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 15, 5, 9]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91583_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014738", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'}'", "output": "'}\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014739", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[103, 102, 93, 72, 54]", "output": "[103, 102, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014740", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7299", "output": "{1, 2433, 3, 7299, 9, 811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014741", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 1, 1, 5, 5, 2]", "output": "[3, 3, 3, 15, 15, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014742", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "112345", "output": "'VCode-112345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5116", "output": "{1, 2, 4, 5116, 2558, 1279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5115", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8375", "output": "{1, 67, 5, 1675, 335, 8375, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014745", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "94.0, 96.0", "output": "(-47.0, 47.0, 89.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9917", "output": "{1, 211, 9917, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014747", "code": "import hashlib\ndef hash_passwords(users):\n    hashed_passwords = {}\n    for user in users:\n        if \"email\" in user and \"password\" in user:\n            email = user[\"email\"]\n            password = user[\"password\"]\n            hashed_password = hashlib.sha256(password.encode()).hexdigest()\n            hashed_passwords[email] = hashed_password\n    return hashed_passwords\n", "entry_point": "hash_passwords", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133157_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1331", "output": "{11, 1, 1331, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014749", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6806", "output": "{1, 2, 166, 41, 3403, 82, 83, 6806}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014750", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[91, 33, 66, 89, 89, 91, 89, 89]", "output": "[91, 33, 66, 90, 90, 91, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014751", "code": "def general_equivalence(gamma, M):\n    # Calculate equivalence of 1 STB of water/condensate to scf of gas\n    # V1stb = 132849 * (gamma / M)\n    V1stb = 132849 * (gamma / M)\n    return V1stb\n", "entry_point": "general_equivalence", "input": "1.0, 1.5", "output": "88566.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99354_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014752", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[78]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014753", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "7", "output": "152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014754", "code": "def longest_consecutive_zeros(N):\n    binary_str = bin(N)[2:]  # Convert N to binary and remove the '0b' prefix\n    max_zeros = 0\n    current_zeros = 0\n    for digit in binary_str:\n        if digit == '0':\n            current_zeros += 1\n            max_zeros = max(max_zeros, current_zeros)\n        else:\n            current_zeros = 0\n    return max_zeros\n", "entry_point": "longest_consecutive_zeros", "input": "64", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40346_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014755", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "10, 20", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014756", "code": "from functools import reduce\nfrom typing import List\ndef calculate_sum(input_list: List[int]) -> int:\n    return reduce(lambda x, y: x + y, input_list)\n", "entry_point": "calculate_sum", "input": "[10, 8, 4, 4]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50691_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014757", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, -20", "output": "-20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014758", "code": "def reverse_complement(Dna):\n    tt = {\n        'A': 'T',\n        'T': 'A',\n        'G': 'C',\n        'C': 'G',\n    }\n    ans = ''\n    for a in Dna:\n        ans += tt[a]\n    return ans[::-1]\n", "entry_point": "reverse_complement", "input": "'ATGC'", "output": "'GCAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99538_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014759", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[2, 2, 2, 0, 1, 2, 2, 1, 2]", "output": "[2, 4, 6, 6, 7, 9, 11, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014760", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "2, 54.5", "output": "109", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014761", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "300, 3", "output": "297", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014762", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6398", "output": "{1, 2, 7, 457, 14, 914, 6398, 3199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9873", "output": "{1, 3, 9, 1097, 9873, 3291}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014764", "code": "import math\ndef my_CribleEratosthene(n):\n    is_prime = [True] * (n+1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i*i, n+1, i):\n                is_prime[j] = False\n    primes = [num for num in range(2, n+1) if is_prime[num]]\n    return primes\n", "entry_point": "my_CribleEratosthene", "input": "17", "output": "[2, 3, 5, 7, 11, 13, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55274_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014765", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'filele2.t'", "output": "{'t': ['filele2.t']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014766", "code": "import sys\ndef get_open_command(platform, disk_location):\n    if platform == \"linux2\":\n        return 'xdg-open \"%s\"' % disk_location\n    elif platform == \"darwin\":\n        return 'open \"%s\"' % disk_location\n    elif platform == \"win32\":\n        return 'cmd.exe /C start \"Folder\" \"%s\"' % disk_location\n    else:\n        raise Exception(\"Platform '%s' is not supported.\" % platform)\n", "entry_point": "get_open_command", "input": "'darwin', '/Users/username/image.jpg'", "output": "'open \"/Users/username/image.jpg\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32294_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014767", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "4", "output": "'1 1 2 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014768", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[5, 5, 6]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014769", "code": "def generate_message_type(protocol: str, version: str, message_type: str) -> str:\n    return f\"{protocol}/{version}/{message_type}\"\n", "entry_point": "generate_message_type", "input": "'rrevcat', '1111.1.0', 'revorervee'", "output": "'rrevcat/1111.1.0/revorervee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147670_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014770", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'love'", "output": "'love'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014771", "code": "def simulate_card_game(player1_deck, player2_deck):\n    rounds_played = 0\n    while player1_deck and player2_deck:\n        rounds_played += 1\n        cards_in_play = [player1_deck.pop(0), player2_deck.pop(0)]\n        while cards_in_play[0] == cards_in_play[1]:\n            if len(player1_deck) < 3 or len(player2_deck) < 3:\n                return -1  # Game ends in a tie\n            cards_in_play.extend(player1_deck[:3] + player2_deck[:3])\n            del player1_deck[:3]\n            del player2_deck[:3]\n        if cards_in_play[0] > cards_in_play[1]:\n            player1_deck.extend(cards_in_play)\n        else:\n            player2_deck.extend(cards_in_play[::-1])\n    return rounds_played\n", "entry_point": "simulate_card_game", "input": "[5, 2], [5, 3]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68428_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014772", "code": "def custom_balanced_accuracy_score(Y, Yh):\n    TP, TN, FP, FN = 0, 0, 0, 0\n    for true_label, pred_label in zip(Y, Yh):\n        if true_label == 1 and pred_label == 1:\n            TP += 1\n        elif true_label == 0 and pred_label == 0:\n            TN += 1\n        elif true_label == 0 and pred_label == 1:\n            FP += 1\n        elif true_label == 1 and pred_label == 0:\n            FN += 1\n    sensitivity = TP / (TP + FN) if TP + FN != 0 else 0.5\n    specificity = TN / (TN + FP) if TN + FP != 0 else 0.5\n    balanced_accuracy = 0.5 * (sensitivity + specificity)\n    return balanced_accuracy\n", "entry_point": "custom_balanced_accuracy_score", "input": "[1, 1, 0, 0], [1, 0, 0, 1]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142982_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014773", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'aaabbcc'", "output": "'a3b2c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014774", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4903", "output": "{1, 4903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014775", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[109, 108, 72, 101, 112, 108, 107, 108]", "output": "'mlHeplkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014776", "code": "def calculate_max_trial_value(trial_values):\n    return max(trial_values)\n", "entry_point": "calculate_max_trial_value", "input": "[30, 15, 25]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15346_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014777", "code": "from functools import reduce\nfrom typing import List\ndef calculate_sum(input_list: List[int]) -> int:\n    return reduce(lambda x, y: x + y, input_list)\n", "entry_point": "calculate_sum", "input": "[7, 9]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50691_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014778", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['16143116']", "output": "16143116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014779", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[4, 6, 8, 4]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014780", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3187", "output": "{1, 3187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3186", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014781", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6873", "output": "{1, 3, 237, 79, 2291, 87, 6873, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7469", "output": "{1, 97, 7, 679, 11, 1067, 7469, 77}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014783", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'prefix f', 'prefix '", "output": "'f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014784", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[20, 18, 1, 3, 5]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014785", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[5, 6, 7]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014786", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[58, 59]", "output": "234", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014787", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014788", "code": "def process_segments(segments, species):\n    unique_names = set()\n    for segment in segments:\n        if segment[\"receptor\"] != \"IG\":\n            continue\n        functional = segment[\"imgt\"].get(\"imgt_functional\")\n        if functional != \"F\":\n            continue\n        v_part = segment[\"imgt\"][\"sequence_gapped_aa\"].replace(\".\", \"-\")[:108].ljust(108).replace(\" \", \"-\")\n        v_name = segment[\"gene\"]\n        name = f\"{species}_{v_name}\"\n        unique_names.add(name)\n    return list(unique_names)\n", "entry_point": "process_segments", "input": "[], 'SpeciesName'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23469_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6428", "output": "{1, 2, 4, 1607, 3214, 6428}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6427", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014790", "code": "from typing import List\ndef calculate_median(numbers: List[int]) -> float:\n    numbers.sort()\n    n = len(numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return float(numbers[n // 2])\n    else:  # Even number of elements\n        mid1 = numbers[n // 2 - 1]\n        mid2 = numbers[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[0]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95265_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1419", "output": "{1, 129, 3, 33, 1419, 11, 43, 473}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014792", "code": "def get_positions(arr, mask):\n    return [i for i, (token, istoken) in enumerate(zip(arr, mask)) if istoken]\n", "entry_point": "get_positions", "input": "['token1', 'not_a_token', 'token2'], [True, False, True]", "output": "[0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131757_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014793", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "947", "output": "{1, 947}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014794", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'<KEY>', 'AIzaSyC9XB'", "output": "'AIzaSyC9XB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3115", "output": "{1, 35, 5, 7, 3115, 623, 89, 445}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014796", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=500-'", "output": "(500, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6085", "output": "{1, 5, 1217, 6085}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6084", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014798", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "95.0, 15, 11", "output": "(97.2325, 14.25, 12.0175)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014799", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5395", "output": "{1, 65, 5, 13, 5395, 83, 1079, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014800", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'peheg.compeg.com'", "output": "'peheg.compeg.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014801", "code": "def banner_text(text, char):\n    if not text:\n        return \"\"\n    banner_length = len(text) + 4  # 2 characters padding on each side\n    top_bottom_banner = char * banner_length\n    middle_banner = f\"{char} {text} {char}\"\n    return f\"{top_bottom_banner}\\n{middle_banner}\\n{top_bottom_banner}\"\n", "entry_point": "banner_text", "input": "'Hello', '*'", "output": "'*********\\n* Hello *\\n*********'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1086_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014802", "code": "def bar(arr):\n    modified_arr = []\n    for i in range(len(arr)):\n        sum_except_current = sum(arr) - arr[i]\n        modified_arr.append(sum_except_current)\n    return modified_arr\n", "entry_point": "bar", "input": "[3, 2, 2, 6, 2, 2, 1, 3]", "output": "[18, 19, 19, 15, 19, 19, 20, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30502_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014803", "code": "def find_earliest_available_slot(meetings, duration):\n    meetings.sort(key=lambda x: x[0])  # Sort meetings based on start time\n    last_end_time = 0\n    for start_time, end_time in meetings:\n        if start_time - last_end_time >= duration:\n            return last_end_time, start_time\n        last_end_time = max(last_end_time, end_time)\n    return None\n", "entry_point": "find_earliest_available_slot", "input": "[(8, 10)], 8", "output": "(0, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46122_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014804", "code": "from typing import List\ndef process_image(pixels: List[int]) -> List[int]:\n    result = []\n    for pixel in pixels:\n        result.append(pixel * 2)\n    return result\n", "entry_point": "process_image", "input": "[100, 99, 49]", "output": "[200, 198, 98]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142011_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014805", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[3, 3, 1, 9]", "output": "[81, 9, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014806", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[2, 5, 2, 4, 4, 1, 4, 1]", "output": "[2, 5, 2, 4, 4, 1, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014807", "code": "def format_text(text: str) -> str:\n    formatted_text = \"\"\n    words = text.split()\n    for word in words:\n        if word.startswith('*') and word.endswith('*'):\n            formatted_text += word.strip('*').upper() + \" \"\n        elif word.startswith('_') and word.endswith('_'):\n            formatted_text += word.strip('_').lower() + \" \"\n        elif word.startswith('`') and word.endswith('`'):\n            formatted_text += word.strip('`')[::-1] + \" \"\n        else:\n            formatted_text += word + \" \"\n    return formatted_text.strip()\n", "entry_point": "format_text", "input": "'*Wd*'", "output": "'WD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10452_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7775", "output": "{1, 5, 1555, 311, 25, 7775}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7774", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8079", "output": "{1, 3, 2693, 8079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014810", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'d09db01006e<d09db10'", "output": "'d09db01006e<d09db10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014811", "code": "def find_earliest_bus_departure(t, busses):\n    for i in range(t, t + 1000):  # Check timestamps from t to t+1000\n        for bus in busses:\n            if i % bus == 0:  # Check if bus departs at current timestamp\n                return i\n", "entry_point": "find_earliest_bus_departure", "input": "930, [469]", "output": "938", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75100_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014812", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014813", "code": "import time\ndef calculate_seconds_until_future_time(current_time, future_time):\n    return abs(future_time - current_time)\n", "entry_point": "calculate_seconds_until_future_time", "input": "0, 5010", "output": "5010", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45249_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014814", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[2, 3, 4, 5, 6, 2, 3]", "output": "[2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014815", "code": "def calculate_total_characters(package_authors):\n    total_characters = 0\n    for author_name in package_authors.keys():\n        total_characters += len(author_name)\n    return total_characters\n", "entry_point": "calculate_total_characters", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014816", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3319", "output": "{1, 3319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014817", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5362", "output": "{1, 2, 7, 14, 5362, 2681, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014818", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'3 something 0 4 something 0 5'", "output": "345", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014819", "code": "CONTROL_PORT_READ_ENABLE_BIT    = 4\nCONTROL_GRAYDOT_KILL_BIT        = 5\nCONTROL_PORT_MODE_BIT           = 6\nCONTROL_PORT_MODE_COPY          = (0b01 << CONTROL_PORT_MODE_BIT)\nCONTROL_PORT_MODE_MASK          = (0b11 << CONTROL_PORT_MODE_BIT)\ndef apply_mask(control_value, control_mask) -> int:\n    masked_value = control_value & control_mask\n    return masked_value\n", "entry_point": "apply_mask", "input": "255, 146", "output": "146", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120473_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014820", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[50, 50, 50]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014821", "code": "def process_line(line):\n    start_br = line.find('[')\n    end_br = line.find(']')\n    conf_delim = line.find('::')\n    verb1 = line[:start_br].strip()\n    rel = line[start_br + 1: end_br].strip()\n    verb2 = line[end_br + 1: conf_delim].strip()\n    conf = line[conf_delim + 2:].strip()  # Skip the '::' delimiter\n    return verb1, rel, verb2, conf\n", "entry_point": "process_line", "input": "'Jumpe [lazy] :: dog'", "output": "('Jumpe', 'lazy', '', 'dog')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60093_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014822", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[4, 2, 3, 4, 1, 4, 3, 5, 3]", "output": "[16, 4, 27, 16, 1, 16, 27, 125, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014823", "code": "from typing import Tuple\ndef extract_version(version: str) -> Tuple[int, int]:\n    major, minor = map(int, version.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_version", "input": "'1.1'", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148416_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014824", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3709", "output": "{1, 3709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3708", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014825", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 10, 20, 31]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014826", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'file'", "output": "'file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014827", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "4.8, -1", "output": "0.20833333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014828", "code": "def calculate_similarity_score(str1, str2):\n    if len(str1) != len(str2):\n        raise ValueError(\"Input strings must have the same length\")\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            similarity_score += 1\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "'abc', 'xyz'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105365_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014829", "code": "def knapsack_max_value(weights, values, size):\n    def knapsack_helper(size, numItems):\n        if size < 0:\n            return None\n        if (numItems, size) in dp.keys():\n            return dp[(numItems, size)]\n        op1 = knapsack_helper(size - weights[numItems - 1], numItems - 1)\n        op2 = knapsack_helper(size, numItems - 1)\n        dp[(numItems, size)] = max(op1 + values[numItems - 1], op2) if op1 is not None else op2\n        return dp[(numItems, size)]\n    dp = {}\n    for i in range(size + 1):\n        dp[(0, i)] = 0\n    return knapsack_helper(size, len(weights))\n", "entry_point": "knapsack_max_value", "input": "[], [], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38750_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014830", "code": "def extract_unique_characters(input_string):\n    unique_chars = set()\n    for char in input_string:\n        if not char.isspace():\n            unique_chars.add(char)\n    return sorted(list(unique_chars))\n", "entry_point": "extract_unique_characters", "input": "'bdef'", "output": "['b', 'd', 'e', 'f']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89815_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014831", "code": "def count_e_letters(input_string):\n    count = 0\n    lowercase_input = input_string.lower()\n    for char in lowercase_input:\n        if char == 'e' or char == '\u00e9':\n            count += 1\n    return count\n", "entry_point": "count_e_letters", "input": "'eeeee\u00e9\u00e9'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15839_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014832", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[25, 25, 25, 25], 'add'", "output": "[100, 100, 100, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014833", "code": "def process_network_configurations(network_configs):\n    result = {}\n    for config in network_configs:\n        load_balancer_settings = {\n            'CrossZone': True,\n            'HealthCheck': {\n                'Target': 'HTTP:8080/error/noindex.html',\n                'HealthyThreshold': '2',\n                'UnhealthyThreshold': '5',\n                'Interval': '15',\n                'Timeout': '5'\n            },\n            'Listeners': [\n                {\n                    'LoadBalancerPort': '80',\n                    'Protocol': 'HTTP',\n                    'InstancePort': '80',\n                    'InstanceProtocol': 'HTTP'\n                }\n            ],\n            'Scheme': 'internet-facing',\n            'Subnets': config['public_subnets']\n        }\n        result[config['name']] = load_balancer_settings\n    return result\n", "entry_point": "process_network_configurations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85123_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014834", "code": "def extract_reward_and_constraints(reward_spec_dict: dict) -> tuple:\n    reward_spec = reward_spec_dict.get('reward')\n    constraints_spec = reward_spec_dict.get('constraint')\n    return reward_spec, constraints_spec\n", "entry_point": "extract_reward_and_constraints", "input": "{}", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75785_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014835", "code": "def modify_config_token(config):\n    if 'NotebookApp.token' in config:\n        config['NotebookApp.token'] = ''\n    else:\n        config['NotebookApp.token'] = ''\n    return config\n", "entry_point": "modify_config_token", "input": "{}", "output": "{'NotebookApp.token': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139327_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014836", "code": "batches = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]\ndef calculate_total_elements(batches):\n    total_elements = 0\n    for batch in batches:\n        total_elements += len(batch)\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28370_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014837", "code": "from typing import List\ndef sum_within_ranges(lower_bounds: List[int]) -> int:\n    total_sum = 0\n    for i in range(len(lower_bounds) - 1):\n        start = lower_bounds[i]\n        end = lower_bounds[i + 1]\n        total_sum += sum(range(start, end))\n    total_sum += lower_bounds[-1]  # Add the last lower bound\n    return total_sum\n", "entry_point": "sum_within_ranges", "input": "[0, -2]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29413_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014838", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[8, 10, 10], 2", "output": "[18, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3165", "output": "{1, 3, 5, 15, 211, 633, 3165, 1055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3164", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014840", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2371", "output": "{1, 2371}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014841", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'abcdefgh', 'ijklmnop'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42819_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "885", "output": "{1, 3, 5, 295, 15, 177, 885, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014843", "code": "def get_api_key(api_key_number):\n    api_keys = {\n        1: 'ELSEVIER_API_1',\n        2: 'ELSEVIER_API_2',\n        3: 'ELSEVIER_API_3',\n        4: 'ELSEVIER_API_4',\n    }\n    return api_keys.get(api_key_number, 'DEFAULT_API_KEY')\n", "entry_point": "get_api_key", "input": "4", "output": "'ELSEVIER_API_4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137352_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014844", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "868", "output": "{1, 2, 868, 4, 7, 28, 14, 434, 217, 124, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt867", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014845", "code": "def filter_predictions(predictions, factor):\n    filtered_predictions = [pred for pred in predictions if pred['factor'] == factor]\n    return filtered_predictions\n", "entry_point": "filter_predictions", "input": "[], 'some_factor'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27035_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014846", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'kcawal'", "output": "{'kcawal': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014847", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[3, 1, 3, 2, 0, 1, 2]", "output": "[3, 1, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014848", "code": "from typing import List, Any\nBUFFER = 5\ndef paginate(items: List[Any], page: int) -> List[Any]:\n    total_pages = (len(items) + BUFFER - 1) // BUFFER  # Calculate total number of pages\n    if page < 1 or page > total_pages:  # Check if page number is valid\n        return []\n    start_idx = (page - 1) * BUFFER\n    end_idx = min(start_idx + BUFFER, len(items))\n    return items[start_idx:end_idx]\n", "entry_point": "paginate", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2", "output": "[6, 7, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43724_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014849", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[6, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014850", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[3, 1, 7, 6, 5, 9, 12]", "output": "['Fizz', 1, 7, 'Fizz', 'Buzz', 'Fizz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014851", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[10, 1, 7]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014852", "code": "import re\ndef parse_migration_script(script):\n    upgrade_ops = []\n    downgrade_ops = []\n    upgrade_matches = re.findall(r\"create_index\\('(.*?)', '(.*?)', \\[(.*?)\\]\", script)\n    downgrade_matches = re.findall(r\"create_index\\('(.*?)', '(.*?)', \\[(.*?)\\]\", script)\n    for match in upgrade_matches:\n        index_name, table_name, columns = match\n        columns = [col.strip().strip('\"') for col in columns.split(\",\")]\n        upgrade_ops.append({'index_name': index_name, 'table_name': table_name, 'columns': columns})\n    for match in downgrade_matches:\n        index_name, table_name, columns = match\n        columns = [col.strip().strip('\"') for col in columns.split(\",\")]\n        downgrade_ops.append({'index_name': index_name, 'table_name': table_name, 'columns': columns})\n    return {'upgrade': upgrade_ops, 'downgrade': downgrade_ops}\n", "entry_point": "parse_migration_script", "input": "''", "output": "{'upgrade': [], 'downgrade': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38457_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014853", "code": "def sum_of_digit_squares(n):\n    sum_squares = 0\n    for digit in str(n):\n        digit_int = int(digit)\n        sum_squares += digit_int ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "633", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28638_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014854", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "29", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014855", "code": "def get_json_support_level(django_version):\n    json_support_levels = {\n        (2, 2): 'has_jsonb_agg',\n        (3, 2): 'is_postgresql_10',\n        (4, 0): 'has_native_json_field'\n    }\n    for version, support_level in json_support_levels.items():\n        if django_version[:2] == version:\n            return support_level\n    return 'JSON support level not defined for this Django version'\n", "entry_point": "get_json_support_level", "input": "(3, 2)", "output": "'is_postgresql_10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40645_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014856", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[3, 4, 5, 6]", "output": "{3: 180, 4: 360, 5: 540, 6: 720}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014857", "code": "def count_beautiful_triplets(d, arr):\n    beautiful_triplets_count = 0\n    for i in range(len(arr)):\n        if arr[i] + d in arr and arr[i] + 2*d in arr:\n            beautiful_triplets_count += 1\n    return beautiful_triplets_count\n", "entry_point": "count_beautiful_triplets", "input": "1, [1, 2, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97862_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014858", "code": "import json\ndef execute_and_format_result(input_data):\n    try:\n        result = eval(input_data)\n        if type(result) in [list, dict]:\n            return json.dumps(result, indent=4)\n        else:\n            return result\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "execute_and_format_result", "input": "'(2,)'", "output": "(2,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97741_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014859", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/u/utpu.txt'", "output": "'/tmp/ml4pl/data/u/utpu.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014860", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014861", "code": "def get_app_verbose_names(app_configs):\n    app_verbose_names = {}\n    for app_config in app_configs:\n        app_name = app_config.get('name')\n        verbose_name = app_config.get('verbose_name')\n        app_verbose_names[app_name] = verbose_name\n    return app_verbose_names\n", "entry_point": "get_app_verbose_names", "input": "[{'name': None, 'verbose_name': None}]", "output": "{None: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80626_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014862", "code": "import os\nfrom typing import List, Dict\ndef collect_package_data(PROJECT: str, folders: List[str]) -> Dict[str, List[str]]:\n    package_data = {}\n    for folder in folders:\n        files_list = []\n        for root, _, files in os.walk(os.path.join(PROJECT, folder)):\n            for filename in files:\n                files_list.append(filename)\n        package_data[folder] = files_list\n    return package_data\n", "entry_point": "collect_package_data", "input": "'/some/path', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77702_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014863", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[5, 6, 4, 2, 4, 1, 2]", "output": "[11, 10, 6, 6, 5, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014864", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0, 1, 2, -1, 0, 1, 2]", "output": "{0, 1, 2, -1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014865", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 3, 5, 4, 3, 7, 2, 3]", "output": "[4, 8, 9, 7, 10, 9, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "265", "output": "{1, 53, 5, 265}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014867", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "'pythonytin'", "output": "'pythonytin_10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4996", "output": "{1, 2498, 2, 4996, 4, 1249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4995", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014869", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "92", "output": "{50: 1, 20: 2, 10: 0, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014870", "code": "from functools import reduce\nfrom operator import xor\ndef find_missing_integer(xs):\n    n = len(xs)\n    xor_xs = reduce(xor, xs)\n    xor_full = reduce(xor, range(1, n + 2))\n    return xor_xs ^ xor_full\n", "entry_point": "find_missing_integer", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 10]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77106_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014871", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2027", "output": "{1, 2027}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2026", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014872", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-6, -7, -6, -4, 3, -7, -3, -5, -3]", "output": "[6, 7, 6, 4, -3, 7, 3, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014873", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[100, 90, 80, 70, 60, 50], 5", "output": "[100, 90, 80, 70, 60]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014874", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/any/directory/usetxt'", "output": "'usetxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014875", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'napps.some.middle.part.nndineConfng'", "output": "('napps', 'nndineConfng')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014876", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "57, 1, 57", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014877", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'2.11.0'", "output": "(2, 11, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "643", "output": "{1, 643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014879", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 4.0", "output": "50.26548245743669", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014880", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'wob.'", "output": "[('wob.', 'wobydler')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014881", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2867", "output": "{1, 2867, 61, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014882", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[0, 1, 0, 1, 5, 2, 1, 3]", "output": "[0, 2, 2, 4, 9, 7, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014883", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'ex'", "output": "'ex'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014884", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'njit(cache=False)'", "output": "'njit(cache=False)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9335", "output": "{1, 1867, 5, 9335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9334", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5714", "output": "{1, 5714, 2, 2857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014887", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3487", "output": "{1, 11, 317, 3487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014888", "code": "def extract_domain(url):\n    # Remove the protocol prefix\n    url = url.replace(\"http://\", \"\").replace(\"https://\", \"\")\n    # Extract the domain name\n    domain_parts = url.split(\"/\")\n    domain = domain_parts[0]\n    # Remove subdomains\n    domain_parts = domain.split(\".\")\n    if len(domain_parts) > 2:\n        domain = \".\".join(domain_parts[-2:])\n    return domain\n", "entry_point": "extract_domain", "input": "'http://htpwww.spate'", "output": "'htpwww.spate'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77353_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7426", "output": "{1, 7426, 2, 3713, 47, 79, 94, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014890", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5489", "output": "{11, 1, 5489, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014891", "code": "def convert(s: str) -> str:\n    result = \"\"\n    for c in s:\n        if c.isalpha():\n            if c.islower():\n                result += c.upper()\n            else:\n                result += c.lower()\n        elif c.isdigit():\n            result += '#'\n        else:\n            result += c\n    return result\n", "entry_point": "convert", "input": "'Hello123'", "output": "'hELLO###'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60962_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014892", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[10, 15, 17]", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014893", "code": "def string_modifier(strings):\n    modified_strings = []\n    for string in strings:\n        if string.startswith('B'):\n            modified_strings.append(string[1:])\n        else:\n            modified_strings.append('Hello, ' + string)\n    return modified_strings\n", "entry_point": "string_modifier", "input": "['Bob', 'Alice', 'Charlie']", "output": "['ob', 'Hello, Alice', 'Hello, Charlie']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130095_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2785", "output": "{1, 5, 557, 2785}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014895", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'part1_parpart1_subpart2.txt'", "output": "'parpart1_subpart2.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014896", "code": "def count_unique_evens(numbers):\n    unique_evens = set()\n    for num in numbers:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_evens", "input": "[0, 2, 4, 6, 8, 10]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30074_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014897", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "-100, -19.621513944223107", "output": "-19.621513944223107", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014898", "code": "def generate_unique_id(section_name):\n    length = len(section_name)\n    if length % 2 == 0:  # Even length\n        unique_id = section_name + str(length)\n    else:  # Odd length\n        unique_id = section_name[::-1] + str(length)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'ne_mndn'", "output": "'ndnm_en7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126473_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014899", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'/example/path/tolte.tx'", "output": "('tolte', '.tx')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014900", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1571", "output": "{1, 1571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014901", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'9'", "output": "['9']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014902", "code": "def filter_xgboost_params(params_dict):\n    filtered_params = {}\n    for key, value in params_dict.items():\n        if isinstance(value, (int, float)) and value > 0.5 and not key.startswith('c') and not key.endswith('t'):\n            filtered_params[key] = value\n    return filtered_params\n", "entry_point": "filter_xgboost_params", "input": "{'param1': 0.4, 'param2': 0.5}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66363_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014903", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9039", "output": "{1, 3, 131, 3013, 69, 393, 9039, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9038", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014904", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'example/123_456'", "output": "((123, 456), 'example')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014905", "code": "import re\nALLOWED_CHARS = re.compile(\n    r'[a-zA-Z0-9\\-\"\\'`\\|~!@#\\$%\\^&\\'\\*\\(\\)_\\[\\]{};:,\\.<>=\\+]+\"'\n)\ndef process_input(input_string):\n    if input_string is None:\n        return ''\n    processed_string = re.sub(ALLOWED_CHARS, '', input_string)\n    return processed_string\n", "entry_point": "process_input", "input": "'tees@'", "output": "'tees@'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94218_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014906", "code": "def count_unique_values(dictionary):\n    all_values = [value for values_list in dictionary.values() for value in values_list]\n    unique_values_count = len(set(all_values))\n    return unique_values_count\n", "entry_point": "count_unique_values", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99358_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014907", "code": "import math\ndef count_perfect_squares(numbers):\n    count = 0\n    for num in numbers:\n        if math.isqrt(num) ** 2 == num:\n            count += 1\n    return count\n", "entry_point": "count_perfect_squares", "input": "[4, 5, 6]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144234_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014908", "code": "def second_most_frequent(arr):\n    most_freq = None\n    second_most_freq = None\n    counter = {}\n    second_counter = {}\n    for n in arr:\n        counter.setdefault(n, 0)\n        counter[n] += 1\n        if counter[n] > counter.get(most_freq, 0):\n            second_most_freq = most_freq\n            most_freq = n\n        elif counter[n] > counter.get(second_most_freq, 0) and n != most_freq:\n            second_most_freq = n\n    return second_most_freq\n", "entry_point": "second_most_frequent", "input": "[1, 1, 3, 3, 3, 2, 2, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120689_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014909", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'ffilele2.ti1.p'", "output": "{'p': ['ffilele2.ti1.p']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014910", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[0, 1, 7, 2, 6, 4, 7, 8]", "output": "[7, 4, 6, 2, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014911", "code": "def most_frequent_word(text):\n    word_freq = {}\n    # Split the text into individual words\n    words = text.split()\n    # Count the frequency of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    # Find the word with the highest frequency\n    most_frequent = max(word_freq, key=word_freq.get)\n    return most_frequent, word_freq[most_frequent]\n", "entry_point": "most_frequent_word", "input": "'wolrwo'", "output": "('wolrwo', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51755_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014912", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "None, 'eaeapplepplee'", "output": "'eaeapplepplee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014913", "code": "def unique_sum(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "unique_sum", "input": "[1, 2, 4, 7, 9, 20, 19]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140817_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014914", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[20, 5, 20]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014915", "code": "def process_job_names(on_queue: str) -> dict:\n    job_names = on_queue.splitlines()\n    unique_job_names = set()\n    longest_job_name = ''\n    for job_name in job_names:\n        unique_job_names.add(job_name.strip())\n        if len(job_name) > len(longest_job_name):\n            longest_job_name = job_name.strip()\n    return {'unique_count': len(unique_job_names), 'longest_job_name': longest_job_name}\n", "entry_point": "process_job_names", "input": "'4'", "output": "{'unique_count': 1, 'longest_job_name': '4'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132971_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014916", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2263", "output": "{73, 1, 31, 2263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014917", "code": "from math import acos, degrees\ndef find_triangle_angles(a, b, c):\n    if a + b > c and b + c > a and a + c > b:  # Triangle inequality theorem check\n        first_angle = round(degrees(acos((b ** 2 + c ** 2 - a ** 2) / (2 * b * c))))\n        second_angle = round(degrees(acos((a ** 2 + c ** 2 - b ** 2) / (2 * a * c))))\n        third_angle = 180 - first_angle - second_angle\n        return sorted([first_angle, second_angle, third_angle])\n    else:\n        return None\n", "entry_point": "find_triangle_angles", "input": "75, 86, 95", "output": "[49, 59, 72]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40430_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1025", "output": "{1, 1025, 5, 41, 205, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1024", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014919", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcdefghij', 'klmnopqrst'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014920", "code": "def calculate_dot_product(vector1, vector2):\n    min_len = min(len(vector1), len(vector2))\n    dot_product_result = sum(vector1[i] * vector2[i] for i in range(min_len))\n    return dot_product_result\n", "entry_point": "calculate_dot_product", "input": "[1, 2], [4, 5]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135589_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014921", "code": "from typing import List, Dict, Union\ndef calculate_average_exchange_rate(data: List[Dict[str, Union[str, float]]], base_currency: str, target_currency: str) -> float:\n    sum_rates = 0\n    count = 0\n    for entry in data:\n        if entry['base'] == base_currency and entry['target'] == target_currency:\n            sum_rates += entry['rate']\n            count += 1\n        elif entry['base'] == target_currency and entry['target'] == base_currency:\n            sum_rates += 1 / entry['rate']\n            count += 1\n    return sum_rates / count if count > 0 else 0\n", "entry_point": "calculate_average_exchange_rate", "input": "[], 'USD', 'EUR'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104984_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014922", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "100, 200, 99, 99, 0", "output": "399", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014923", "code": "try:\n    _xrange = xrange\nexcept NameError:\n    _xrange = range  # Python 3 compatibility\ndef sum_of_evens(start, end):\n    sum_even = 0\n    for num in _xrange(start, end+1):\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_evens", "input": "0, 10", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141776_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014924", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3662", "output": "'1 hour 1 minute 2 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014925", "code": "from typing import Dict\ndef extract_translations(translations_str: str) -> Dict[str, str]:\n    translations = {}\n    segments = translations_str.split(',')\n    for segment in segments:\n        lang, trans = segment.split(':')\n        translations[lang.strip()] = trans.strip()\n    return translations\n", "entry_point": "extract_translations", "input": "'English: Hellenchur'", "output": "{'English': 'Hellenchur'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113559_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014926", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014927", "code": "def unique_counts(input_list):\n    # Creating an empty dictionary to store unique items and their counts\n    counts_dict = {}\n    # Bubble sort implementation (source: https://realpython.com/sorting-algorithms-python/)\n    def bubble_sort(arr):\n        n = len(arr)\n        for i in range(n):\n            for j in range(0, n-i-1):\n                if arr[j] > arr[j+1]:\n                    arr[j], arr[j+1] = arr[j+1], arr[j]\n    # Sorting the input list using bubble sort\n    sorted_list = input_list.copy()  # Create a copy to preserve the original list\n    bubble_sort(sorted_list)\n    # Counting unique items and their occurrences\n    current_item = None\n    count = 0\n    for item in sorted_list:\n        if item != current_item:\n            if current_item is not None:\n                counts_dict[current_item] = count\n            current_item = item\n            count = 1\n        else:\n            count += 1\n    counts_dict[current_item] = count  # Add count for the last item\n    return counts_dict\n", "entry_point": "unique_counts", "input": "['A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B']", "output": "{'A': 7, 'B': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146010_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014928", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'wlwr'", "output": "'wlwr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014929", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8254", "output": "{1, 2, 8254, 4127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8253", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014930", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'12112'", "output": "{12112}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014931", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014932", "code": "from typing import List\ndef calculate_total_loss(losses: List[float]) -> float:\n    total_loss = 0\n    for loss in losses:\n        total_loss += loss\n    return total_loss\n", "entry_point": "calculate_total_loss", "input": "[100.0, 100.5, 26.0]", "output": "226.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115377_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014933", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "649", "output": "{1, 649, 11, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014934", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "2, 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014935", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[111, 101, 72, 72, 111, 108, 108, 72]", "output": "'oeHHollH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2999", "output": "{1, 2999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014937", "code": "def calculate_range(data):\n    if not data:\n        return None  # Handle empty dataset\n    min_val = max_val = data[0]  # Initialize min and max values\n    for num in data[1:]:\n        if num < min_val:\n            min_val = num\n        elif num > max_val:\n            max_val = num\n    return max_val - min_val\n", "entry_point": "calculate_range", "input": "[0, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21170_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014938", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1402", "output": "{1, 1402, 2, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014939", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8066", "output": "{1, 8066, 2, 4033, 37, 74, 109, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014940", "code": "def find_modes(data):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in data:\n        frequency_dict[num] = frequency_dict.get(num, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[1, 1, 3, 3, 5, 5]", "output": "[1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69194_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014941", "code": "def calculate_factorial(n):\n    if n < 0:\n        return \"Factorial is not defined for negative numbers.\"\n    elif n == 0:\n        return 1\n    else:\n        return n * calculate_factorial(n - 1)\n", "entry_point": "calculate_factorial", "input": "4", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139159_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014942", "code": "def process_data(filter_logs, sequential_data):\n    # Process filter logs\n    filtered_logs = [line for line in filter_logs.split('\\n') if 'ERROR' not in line]\n    # Check for sequence in sequential data\n    sequence_exists = False\n    sequential_lines = sequential_data.split('\\n')\n    for i in range(len(sequential_lines) - 2):\n        if sequential_lines[i] == 'a start point' and sequential_lines[i + 1] == 'leads to' and sequential_lines[i + 2] == 'an ending':\n            sequence_exists = True\n            break\n    return (filtered_logs, sequence_exists)\n", "entry_point": "process_data", "input": "'blah blah ERblahO blah\\n', ''", "output": "(['blah blah ERblahO blah', ''], False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27152_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014943", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[57]", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014944", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'https:h', 'e1/de'", "output": "'https:h/e1/de'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014945", "code": "def extract_cookies(cookies):\n    cookie_dict = {}\n    cookie_pairs = cookies.split(';')\n    for pair in cookie_pairs:\n        pair = pair.strip()  # Remove leading/trailing whitespaces\n        if pair:\n            key, value = pair.split('=', 1)\n            cookie_dict[key] = value\n    return cookie_dict\n", "entry_point": "extract_cookies", "input": "'__utm1v=49280.22254'", "output": "{'__utm1v': '49280.22254'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120315_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014946", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2387", "output": "{1, 7, 11, 77, 2387, 341, 217, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014947", "code": "def get_seq_len(sentence):\n    length = 0\n    for num in sentence:\n        length += 1\n        if num == 1:\n            break\n    return length\n", "entry_point": "get_seq_len", "input": "[2, 3, 4, 5, 6, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87843_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014948", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'phheloyon'", "output": "{'phheloyon': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014949", "code": "def simulate_race(cars):\n    finishing_times = [(index, position / speed) for index, (position, speed) in enumerate(cars)]\n    finishing_times.sort(key=lambda x: x[1])\n    return [car[0] for car in finishing_times]\n", "entry_point": "simulate_race", "input": "[(20, 2), (40, 8), (60, 12), (1, 1)]", "output": "[3, 1, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89590_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014950", "code": "from typing import List\nfrom collections import deque\ndef shortest_distances(N: int, R: List[List[int]]) -> List[int]:\n    D = [-1] * N\n    D[0] = 0\n    queue = deque([0])\n    while queue:\n        nxt = queue.popleft()\n        for i in R[nxt]:\n            if D[i] == -1:\n                queue.append(i)\n                D[i] = D[nxt] + 1\n    return D\n", "entry_point": "shortest_distances", "input": "8, [[], [], [], [], [], [], [], []]", "output": "[0, -1, -1, -1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61964_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8665", "output": "{1733, 1, 8665, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014952", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[3, 7, 12]", "output": "252", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014953", "code": "def determine_movement_direction(keys):\n    if keys[0]:  # UP key pressed\n        return \"UP\"\n    elif keys[1]:  # DOWN key pressed\n        return \"DOWN\"\n    elif keys[2]:  # LEFT key pressed\n        return \"LEFT\"\n    elif keys[3]:  # RIGHT key pressed\n        return \"RIGHT\"\n    else:\n        return \"STAY\"\n", "entry_point": "determine_movement_direction", "input": "[False, True, False, False]", "output": "'DOWN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103609_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014954", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2348", "output": "{1, 2, 4, 587, 2348, 1174}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2347", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014955", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "9", "output": "[0, 1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014956", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 2, 3, 4, 5, 6, 7]", "output": "(6, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014957", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2401", "output": "{2401, 1, 7, 49, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014958", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "257", "output": "{1, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014959", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[10.0, 10.0, 10.0, 10.0, 10.0, 0.0]", "output": "8.333333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014960", "code": "def build_unique_users(queryset, ctype_as_string):\n    users = []\n    if ctype_as_string == 'comment':\n        for comment in queryset:\n            if comment.get('user') not in users:\n                users.append(comment.get('user'))\n    if ctype_as_string == 'contact':\n        for c in queryset:\n            if c.get('user') and c.get('user') not in users:\n                users.append(c.get('user'))\n    if not users:\n        return f\"Error finding content type: {ctype_as_string}\"\n    return users\n", "entry_point": "build_unique_users", "input": "[], 'cocncoctt'", "output": "'Error finding content type: cocncoctt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120280_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014961", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4783", "output": "{1, 4783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014962", "code": "def longest_consecutive_sequence(char_stream):\n    current_length = 0\n    longest_length = 0\n    for char in char_stream:\n        if char.isalpha():\n            current_length += 1\n        else:\n            longest_length = max(longest_length, current_length)\n            current_length = 0\n    longest_length = max(longest_length, current_length)  # Check for the last sequence\n    return longest_length\n", "entry_point": "longest_consecutive_sequence", "input": "'aaaaaaaaaaa'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83866_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014963", "code": "def remove_vowels(input_string):\n    vowels = 'aeiouAEIOU'\n    result = ''\n    for char in input_string:\n        if char not in vowels:\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'Hello, World!'", "output": "'Hll, Wrld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63540_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014964", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[6, 7, -1]", "output": "[6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014965", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[0, 1, 2, 3, 4, 28, 39]", "output": "'0, 1, 2, 3, 4, 28, 39'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014966", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9337", "output": "{1, 9337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014967", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'00:00:00', '00:15:15'", "output": "915", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014968", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'A', 4", "output": "'E'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20125_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014969", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('a')[0])  # Remove any additional alpha characters\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.20.2'", "output": "(0, 20, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101817_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014970", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[1, 1, 2, 3, 5, 1, 2, 3, 2]", "output": "[1, 1, 1, 2, 2, 2, 3, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014971", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[8, 7, 9, 9, 8, 9, 8, 7, 9], 0, 3", "output": "[24, 21, 27, 27, 24, 27, 24, 21, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014972", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1067", "output": "{11, 1, 1067, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014973", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014974", "code": "import imaplib\nimport poplib\ndef get_port(doc):\n    if 'incoming_port' not in doc:\n        if doc.get('use_imap'):\n            doc['incoming_port'] = imaplib.IMAP4_SSL_PORT if doc.get('use_ssl') else imaplib.IMAP4_PORT\n        else:\n            doc['incoming_port'] = poplib.POP3_SSL_PORT if doc.get('use_ssl') else poplib.POP3_PORT\n    return int(doc.get('incoming_port', 0))\n", "entry_point": "get_port", "input": "{'use_imap': False, 'use_ssl': False}", "output": "110", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99235_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014975", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[9, 3, 1, 8, 30, 1, 1, 30], 6", "output": "[[9, 3, 1, 8, 30, 1], [1, 30]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014976", "code": "DATA_LOCATION = \"C:/Users/gonca/Dev/valuvalu/security_analysis/vvsa/data\"\ndef extract_username(data_location):\n    # Split the path using the '/' delimiter\n    path_parts = data_location.split('/')\n    # Extract the username from the path\n    username = path_parts[2]\n    return username\n", "entry_point": "extract_username", "input": "'C:/Users/gonca/Dev/valuvalu/security_analysis/vvsa/data'", "output": "'gonca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90875_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9838", "output": "{1, 2, 9838, 4919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9837", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014978", "code": "from collections import Counter\ndef find_modes(data):\n    freq_dict = Counter(data)\n    max_freq = max(freq_dict.values())\n    modes = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[2, 2, 4, 4]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75133_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014979", "code": "import re\ndef clean_query(query: str) -> dict:\n    cleaned_query = query.upper()\n    if re.match(r'^AS\\d+$', cleaned_query):\n        return {\"cleanedValue\": cleaned_query, \"category\": \"asn\"}\n    elif cleaned_query.isalnum():\n        return {\"cleanedValue\": cleaned_query, \"category\": \"as-set\"}\n    else:\n        return {\"error\": \"Invalid query. A valid prefix is required.\"}\n", "entry_point": "clean_query", "input": "'foBOba'", "output": "{'cleanedValue': 'FOBOBA', 'category': 'as-set'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106273_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014980", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "697", "output": "{1, 697, 17, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014981", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[circular_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 2, 0, 3, 3, 3, 4, 4, 3]", "output": "[2, 2, 3, 6, 6, 7, 8, 7, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51677_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014982", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "0.66, 1", "output": "0.66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014983", "code": "def generate_jackknife_samples(data):\n    jackknife_samples = []\n    for i in range(len(data)):\n        jackknife_sample = data[:i] + data[i+1:]\n        jackknife_samples.append(jackknife_sample)\n    return jackknife_samples\n", "entry_point": "generate_jackknife_samples", "input": "[1, 2, 3, 4]", "output": "[[2, 3, 4], [1, 3, 4], [1, 2, 4], [1, 2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14608_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014984", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[0, 5, 5, 0]", "output": "[5, 10, 5, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014985", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the '.' delimiter\n    version_components = version_string.split('.')\n    # Extract major, minor, and patch version numbers\n    major_version = int(version_components[0])\n    minor_version = int(version_components[1])\n    patch_version = int(version_components[2])\n    return major_version, minor_version, patch_version\n", "entry_point": "extract_version_numbers", "input": "'4.2.10'", "output": "(4, 2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146914_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014986", "code": "import re\nDATE_RE = re.compile(r\"[0-9]{4}-[0-9]{2}-[0-9]{2}\")\nINVALID_IN_NAME_RE = re.compile(\"[^a-z0-9_]\")\ndef process_input(input_str):\n    # Check if input matches the date format pattern\n    is_date = bool(DATE_RE.match(input_str))\n    # Remove specific suffix if it exists\n    processed_str = input_str\n    if input_str.endswith(\"T00:00:00.000+00:00\"):\n        processed_str = input_str[:-19]\n    # Check for invalid characters based on the pattern\n    has_invalid_chars = bool(INVALID_IN_NAME_RE.search(input_str))\n    return (is_date, processed_str, has_invalid_chars)\n", "entry_point": "process_input", "input": "'2022-13'", "output": "(False, '2022-13', True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49598_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014987", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "795.0625, 1", "output": "795.05", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014988", "code": "import re\nurl_patterns = [\n    ('^upload/image/(?P<upload_to>.*)', 'RedactorUploadView.as_view(form_class=ImageForm)', 'redactor_upload_image'),\n    ('^upload/file/(?P<upload_to>.*)', 'RedactorUploadView.as_view(form_class=FileForm)', 'redactor_upload_file')\n]\ndef match_url_to_view(url):\n    for pattern, view, name in url_patterns:\n        if re.match(pattern, url):\n            return view\n    return None\n", "entry_point": "match_url_to_view", "input": "'upload/file/test.txt'", "output": "'RedactorUploadView.as_view(form_class=FileForm)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79002_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2582", "output": "{1, 2, 1291, 2582}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014990", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 89, 87], 3", "output": "88.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13203_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014991", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "-5, None", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014992", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "3.0, 0.01", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014993", "code": "def filter_rainy_cold(weather_data):\n    filtered_data = []\n    for data in weather_data:\n        condition, temperature = data.split(\",\")\n        if condition.strip().lower() == \"rainy\" and int(temperature) < 20:\n            filtered_data.append(data)\n    return filtered_data\n", "entry_point": "filter_rainy_cold", "input": "['sunny, 25', 'cloudy, 22']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80542_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014994", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4202", "output": "{1, 2, 4202, 11, 2101, 22, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014995", "code": "def is_list_of_strings(lst):\n    if not isinstance(lst, list):\n        return False\n    return all(isinstance(element, str) for element in lst)\n", "entry_point": "is_list_of_strings", "input": "42", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81444_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014996", "code": "def find_example_idx(n, cum_sums, idx=0):\n    N = len(cum_sums)\n    stack = [[0, N-1]]\n    while stack:\n        start, end = stack.pop()\n        search_i = (start + end) // 2\n        if start < end:\n            if n < cum_sums[search_i]:\n                stack.append([start, search_i])\n            else:\n                stack.append([search_i + 1, end])\n        else:\n            if n < cum_sums[start]:\n                return idx + start\n            else:\n                return idx + start + 1\n", "entry_point": "find_example_idx", "input": "5, [1, 2, 4, 6, 8]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89652_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014997", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[103, 101, 92, 88, 90, 101, 103]", "output": "[103, 101, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014998", "code": "def sum_of_squares_of_even_numbers(input_list):\n    sum_of_squares = 0\n    for num in input_list:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[2, 8]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113006_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0014999", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'BRGELIAN'", "output": "'NAILEGRB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015000", "code": "def process_values(x, y, raw_z):\n    z = None\n    if y > 145 and y <= 166 and x <= 18:\n        y = 145\n        x = 5\n    raw_z_int = int(raw_z)\n    if raw_z_int < 70:\n        z = 3\n    elif 70 <= raw_z_int <= 80:\n        z = 4\n    else:\n        z = 5\n    if 51 <= y <= 185 and 0 <= x <= 87:\n        return {'x': x, 'y': y, 'z': z}\n    return None\n", "entry_point": "process_values", "input": "18, 150, 75", "output": "{'x': 5, 'y': 145, 'z': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64164_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015001", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 1, 1, 3, 0, 3, 0, 1]", "output": "[1, 2, 3, 8, 4, 4, 4, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015002", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5996", "output": "{1, 2, 4, 5996, 2998, 1499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5995", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015003", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015004", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4877", "output": "{1, 4877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015005", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "-0.4, 1", "output": "-0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015006", "code": "def transform_iso_datetime(iso_datetime: str) -> str:\n    date_str, time_str = iso_datetime.split('T')\n    if '.' in time_str:\n        time_str = time_str.split('.')[0]  # Remove milliseconds if present\n    date_str = date_str.replace('-', '')  # Remove hyphens from date\n    time_str = time_str.replace(':', '')  # Remove colons from time\n    return date_str + 'T' + time_str\n", "entry_point": "transform_iso_datetime", "input": "'2018-12-23T05:10:00'", "output": "'20181223T051000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14024_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015007", "code": "def make_cls_name(base: str, replacement: str) -> str:\n    return base.replace(\"Base\", replacement)\n", "entry_point": "make_cls_name", "input": "'BaseBaseMoBaseBase', 'Ba'", "output": "'BaBaMoBaBa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120218_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015008", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7671", "output": "{1, 3, 2557, 7671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015009", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_counts = {}\n    for word in words:\n        word = word.strip('.,')  # Remove punctuation if present\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'umps'", "output": "{'umps': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117339_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015010", "code": "def generate_sequence(a, b, n):\n    output = \"\"\n    for num in range(1, n + 1):\n        if num % a == 0 and num % b == 0:\n            output += \"FB \"\n        elif num % a == 0:\n            output += \"F \"\n        elif num % b == 0:\n            output += \"B \"\n        else:\n            output += str(num) + \" \"\n    return output.rstrip()\n", "entry_point": "generate_sequence", "input": "4, 2, 11", "output": "'1 B 3 FB 5 B 7 FB 9 B 11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30858_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015011", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[2, 7, 6, 3, 7, 2]", "output": "[2, 3, 7, 7, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015012", "code": "def my_index2(l, x, default=False):\n    return l.index(x) if x in l else default\n", "entry_point": "my_index2", "input": "[1, 2, 3, 4], 5, default=-9", "output": "-9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117825_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015013", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'c8d8c8d8<PASSWORD>', 'd'", "output": "'c8d8c8d8d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015014", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "13", "output": "[1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015015", "code": "def parse_jupyter_config(config_code):\n    config_dict = {}\n    current_section = None\n    for line in config_code.split('\\n'):\n        line = line.strip()\n        if line.startswith('#') or not line:\n            continue\n        if line.startswith('c.'):\n            key_value = line.split(' = ')\n            key = key_value[0].split('.')[-1]\n            value = key_value[1].strip()\n            if current_section:\n                config_dict[current_section][key] = eval(value) if value.startswith(\"'\") else int(value)\n        elif line.startswith('# '):\n            current_section = line[2:-1]\n            config_dict[current_section] = {}\n    return config_dict\n", "entry_point": "parse_jupyter_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54487_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015016", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[1, 2, 4, 3, 4, 4]", "output": "[3, 6, 7, 7, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015017", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 3  # Multiply the last added element by 3\n    return processed_list\n", "entry_point": "process_integers", "input": "[22, 4, 22, 5, 4, 22, 4, 22]", "output": "[24, 6, 24, 4, 6, 24, 6, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82460_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015018", "code": "from typing import List\ndef degree(poly: List[int]) -> int:\n    deg = 0\n    for i in range(len(poly) - 1, -1, -1):\n        if poly[i] != 0:\n            deg = i\n            break\n    return deg\n", "entry_point": "degree", "input": "[0, 0, 0, 0, 0, 0, 0, 1]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116666_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015019", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[4, 6, 6, 1, 1, 1, 1, 7, 7]", "output": "[4, 6, 6, 1, 1, 1, 1, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015020", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "50, 6, 0", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015021", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i] + input_list[i+1])\n        elif i == len(input_list) - 1:\n            output_list.append(input_list[i-1] + input_list[i])\n        else:\n            output_list.append(input_list[i-1] + input_list[i] + input_list[i+1])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[0, 3, 3, 3, 6]", "output": "[3, 6, 9, 12, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13642_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015022", "code": "def encrypt_string(input_string):\n    encrypted_result = \"\"\n    for i, char in enumerate(input_string):\n        if char.isalpha():\n            shift_amount = i + 1\n            if char.islower():\n                encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n            else:\n                encrypted_char = chr((ord(char) - ord('A') + shift_amount) % 26 + ord('A'))\n        else:\n            encrypted_char = char\n        encrypted_result += encrypted_char\n    return encrypted_result\n", "entry_point": "encrypt_string", "input": "'He'", "output": "'Ig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110857_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015023", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'5.0.0'", "output": "(5, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015024", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[1, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015025", "code": "def find_primitive_type_index(primitive_type):\n    gltfPrimitiveTypeMap = ['PointList', 'LineList', 'LineStrip', 'LineStrip', 'TriangleList', 'TriangleStrip', 'TriangleFan']\n    for index, type_name in enumerate(gltfPrimitiveTypeMap):\n        if type_name == primitive_type:\n            return index\n    return -1\n", "entry_point": "find_primitive_type_index", "input": "'LineStrip'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32132_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015026", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3485", "output": "{1, 5, 41, 205, 17, 85, 697, 3485}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015027", "code": "import re\ndef process_text(input_text: str) -> str:\n    # Remove all characters that are not Cyrillic or alphanumeric\n    processed_text = re.sub(r\"[^\u0430-\u044f\u0410-\u042f0-9 ]+\", \"\", input_text)\n    # Replace double spaces with a single space\n    processed_text = re.sub('(  )', ' ', processed_text)\n    # Replace \"\\r\\n\" with a space\n    processed_text = processed_text.replace(\"\\r\\n\", \" \")\n    return processed_text\n", "entry_point": "process_text", "input": "'\u041f\u0440\u0438\u0432\u0438\u04381\u0438'", "output": "'\u041f\u0440\u0438\u0432\u0438\u04381\u0438'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100805_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015028", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/Docum/ex'", "output": "('C:/Users/Docum', 'ex')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015029", "code": "def determine_backend_type(config):\n    return config.get('backend_type', 'Unknown')\n", "entry_point": "determine_backend_type", "input": "{}", "output": "'Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97139_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9892", "output": "{1, 2, 4, 9892, 2473, 4946}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9891", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015031", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'abaefCHAIN_ID', '312325'", "output": "'abaef312325'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015032", "code": "def find_modes(data):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in data:\n        frequency_dict[num] = frequency_dict.get(num, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[6, 6, 1]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69194_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015033", "code": "def parse_allowed_tags(input_string):\n    tag_dict = {}\n    tag_list = input_string.split()\n    for tag in tag_list:\n        tag_parts = tag.split(':')\n        tag_name = tag_parts[0]\n        attributes = tag_parts[1:] if len(tag_parts) > 1 else []\n        tag_dict[tag_name] = attributes\n    return tag_dict\n", "entry_point": "parse_allowed_tags", "input": "'ttbdy'", "output": "{'ttbdy': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14310_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015034", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[4, 5, 1, 3]", "output": "[4, 5, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015035", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'Abb', 'B()'", "output": "{'title': 'Abb', 'contrib': 'B ()'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7934", "output": "{1, 2, 7934, 3967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015037", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'pI,', 1", "output": "'qJ,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20125_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015038", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 7, 3, 1, 5, 8, 3, 5]", "output": "[1, 8, 5, 4, 9, 13, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "962", "output": "{1, 962, 2, 481, 37, 74, 13, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9658", "output": "{1, 2, 11, 878, 22, 439, 9658, 4829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9657", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015041", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "3, 6, 10", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015042", "code": "def extract_csv_properties(csv_format_descriptor):\n    header_list = csv_format_descriptor.get(\"HeaderList\", [])\n    quote_symbol = csv_format_descriptor.get(\"QuoteSymbol\", \"\")\n    return {\n        \"HeaderList\": header_list,\n        \"QuoteSymbol\": quote_symbol\n    }\n", "entry_point": "extract_csv_properties", "input": "{}", "output": "{'HeaderList': [], 'QuoteSymbol': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23713_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015043", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "61", "output": "'='", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015044", "code": "def calculate_duration(n_frames, hop_length, sample_rate=44100):\n    total_duration = (n_frames - 1) * hop_length / sample_rate\n    return total_duration\n", "entry_point": "calculate_duration", "input": "12, 100", "output": "0.024943310657596373", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9810_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015045", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[-1, -2, 0], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015046", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "12", "output": "[12, 6, 3, 10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015047", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[0.5]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015048", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "82", "output": "0.45555555555555555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015049", "code": "def format_labels(labels):\n    formatted_labels = [label.capitalize() for label in labels.values()]\n    return ', '.join(formatted_labels)\n", "entry_point": "format_labels", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132109_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015050", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[10, 20, 15, 5, 10.65]", "output": "60.65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015051", "code": "def sum_divisible_by_3_not_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    return total\n", "entry_point": "sum_divisible_by_3_not_5", "input": "[3, 6, 9, 12, 9]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59130_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015052", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'\"test\"'", "output": "['test']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015053", "code": "def removeOuterParentheses(s: str) -> str:\n    result = \"\"\n    balance = 0\n    for c in s:\n        if c == '(' and balance > 0:\n            result += c\n        if c == ')' and balance > 1:\n            result += c\n        balance += 1 if c == '(' else -1\n    return result\n", "entry_point": "removeOuterParentheses", "input": "'((()))((()))'", "output": "'(())(())'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5654_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015054", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6130", "output": "{1, 2, 5, 613, 1226, 10, 6130, 3065}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6129", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015055", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[2, 2, 3, 3]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015056", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[100, 80]", "output": "-20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015057", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[6, 2, 1, 7, 4, 2, 6, 3, 7]", "output": "[36, 4, 1, 343, 16, 4, 36, 13, 343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015058", "code": "def categorize_value(value):\n    if value < 10:\n        return \"Low\"\n    elif 10 <= value < 20:\n        return \"Medium\"\n    else:\n        return \"High\"\n", "entry_point": "categorize_value", "input": "5", "output": "'Low'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40001_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4469", "output": "{1, 109, 4469, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015060", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'K8'", "output": "247", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015061", "code": "from typing import List\ndef total_likes(posts: List[dict]) -> int:\n    total_likes_count = 0\n    for post in posts:\n        total_likes_count += post.get(\"likes_count\", 0)\n    return total_likes_count\n", "entry_point": "total_likes", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97610_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015062", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)  # Round to 2 decimal places\n", "entry_point": "calculate_average_score", "input": "[70, 75, 75, 76, 80]", "output": "75.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40505_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015063", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3261", "output": "{1, 3, 3261, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3260", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015064", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[61]", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "35", "output": "{1, 35, 5, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt34", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015066", "code": "def find_equal(lst):\n    seen = {}  # Dictionary to store elements and their indices\n    for i, num in enumerate(lst):\n        if num in seen:\n            return (seen[num], i)  # Return the indices of the first pair of equal elements\n        seen[num] = i\n    return None  # Return None if no pair of equal elements is found\n", "entry_point": "find_equal", "input": "[1, 2, 3, 7, 7]", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51954_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015067", "code": "def simulate_packet_routing(nodes, packets):\n    total_forwarded_packets = 0\n    for i in range(len(nodes)):\n        forwarded_packets = min(nodes[i], packets[i])\n        total_forwarded_packets += forwarded_packets\n    return total_forwarded_packets\n", "entry_point": "simulate_packet_routing", "input": "[3, 2], [3, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65785_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5767", "output": "{73, 1, 79, 5767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015069", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[3], [1], [20, 29], [20, 29, 30], [3]]", "output": "[3, 1, 20, 29, 20, 29, 30, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2182", "output": "{1, 2, 1091, 2182}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015071", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'r12434'", "output": "'12434'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015072", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(100, 200), (200, 300), (300, 400)]", "output": "{100: [200], 200: [300], 300: [400]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015073", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[5, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015074", "code": "import math\nMAX_BRIGHT = 2.0\ndef rgb1(v):\n    r = 1 + math.cos(v * math.pi)\n    g = 0\n    b = 1 + math.sin(v * math.pi)\n    # Scale the RGB components based on the maximum brightness\n    r_scaled = int(MAX_BRIGHT * r)\n    g_scaled = int(MAX_BRIGHT * g)\n    b_scaled = int(MAX_BRIGHT * b)\n    return (r_scaled, g_scaled, b_scaled)\n", "entry_point": "rgb1", "input": "0.5", "output": "(2, 0, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70015_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015075", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[0, 2, 0, -1, 4, 5, 2, 2], 4", "output": "[[0, 2, 0, -1], [4, 5, 2, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015076", "code": "def replace_version(version1, version2):\n    new_version = version2 + version1[len(version2):]\n    return new_version\n", "entry_point": "replace_version", "input": "(3, 9, 1), (3, 9)", "output": "(3, 9, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17632_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015077", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_matn', 0", "output": "'\\n  .width(test_matn);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015078", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7042", "output": "{1, 7042, 2, 3521, 7, 1006, 14, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7041", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015079", "code": "def play_war_game(player1_deck, player2_deck):\n    rounds_played = 0\n    is_war = False\n    while player1_deck and player2_deck:\n        rounds_played += 1\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_deck.extend([card1, card2])\n        elif card2 > card1:\n            player2_deck.extend([card2, card1])\n        else:\n            is_war = True\n            war_cards = [card1, card2]\n            while is_war:\n                if len(player1_deck) < 4 or len(player2_deck) < 4:\n                    return f\"Both players ran out of cards after {rounds_played} rounds\"\n                for _ in range(3):\n                    war_cards.append(player1_deck.pop(0))\n                    war_cards.append(player2_deck.pop(0))\n                card1 = player1_deck.pop(0)\n                card2 = player2_deck.pop(0)\n                if card1 > card2:\n                    player1_deck.extend(war_cards)\n                    player1_deck.extend([card1, card2])\n                    is_war = False\n                elif card2 > card1:\n                    player2_deck.extend(war_cards)\n                    player2_deck.extend([card2, card1])\n                    is_war = False\n    if not player1_deck:\n        return f\"Player 2 wins after {rounds_played} rounds\"\n    else:\n        return f\"Player 1 wins after {rounds_played} rounds\"\n", "entry_point": "play_war_game", "input": "[2, 3, 4, 5, 6], [1, 7, 8, 9, 10]", "output": "'Player 2 wins after 7 rounds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58824_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015080", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[5, 7, 1, 3], 5", "output": "[12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015081", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'10.4.7'", "output": "(10, 4, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015082", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[1, 2, 3, 4, 8, 24]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015083", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "11, 37", "output": "[11, 13, 17, 19, 23, 29, 31, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015084", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "126", "output": "'2:06'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015085", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[102]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015086", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[2]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015087", "code": "def count_hex_matches(input_string):\n    UCI_VERSION = '5964e2fc6156c5f720eed7faecf609c3c6245e3d'\n    UCI_VERSION_lower = UCI_VERSION.lower()\n    input_string_lower = input_string.lower()\n    count = 0\n    for char in input_string_lower:\n        if char in UCI_VERSION_lower:\n            count += 1\n    return count\n", "entry_point": "count_hex_matches", "input": "'eefff4c'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86391_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015088", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'0.12.7.alpha3'", "output": "(0, 12, 7, 'alpha3')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015089", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "11", "output": "'02468101214161820'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015090", "code": "def sum_multiples_of_3_not_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_not_5", "input": "[3, 6, 9]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108735_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015091", "code": "from typing import List\ndef plusOne(digits: List[int]) -> List[int]:\n    n = len(digits)\n    for i in range(n - 1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    return [1] + digits\n", "entry_point": "plusOne", "input": "[9, 9, 9, 9, 9, 9, 9, 9, 9]", "output": "[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88559_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015092", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'0.1.9'", "output": "'0.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015093", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[90, 90, 85, 70, 75, 80]", "output": "[90, 90, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015094", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0, 1, 1, 4, 5]", "output": "[0, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015095", "code": "def find_missing_number(nums):\n    n = len(nums)\n    total_sum = n * (n + 1) // 2\n    for num in nums:\n        total_sum -= num\n    return total_sum\n", "entry_point": "find_missing_number", "input": "[0, 1, 2, 3, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79191_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015096", "code": "def get_updated_value(filter_condition):\n    metadata = {}\n    if isinstance(filter_condition, str):\n        metadata[filter_condition] = 'default_value'\n    elif isinstance(filter_condition, list):\n        for condition in filter_condition:\n            metadata[condition] = 'default_value'\n    return metadata\n", "entry_point": "get_updated_value", "input": "'filter2'", "output": "{'filter2': 'default_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97050_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015097", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'executable.exe'", "output": "'executable.exe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015098", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'aa'", "output": "{'aa': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015099", "code": "def get_host_address(pgLogin: dict) -> str:\n    host = pgLogin.get('host', '')  # Get the value associated with the 'host' key, default to empty string if not present\n    return host + (':5432' if host else '')  # Append ':5432' if host is not empty, else return empty string followed by ':5432'\n", "entry_point": "get_host_address", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111105_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015100", "code": "def find_highest_score_index(scores):\n    highest_score = float('-inf')\n    highest_score_index = -1\n    for i in range(len(scores)):\n        if scores[i] > highest_score:\n            highest_score = scores[i]\n            highest_score_index = i\n        elif scores[i] == highest_score and i < highest_score_index:\n            highest_score_index = i\n    return highest_score_index\n", "entry_point": "find_highest_score_index", "input": "[100, 90, 80]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57664_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015101", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Pyyl__title_Pocle'", "output": "'Pyyl__title_Pocle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015102", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "53, 2", "output": "1378", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "41", "output": "{1, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015104", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "8", "output": "256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015105", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'app.config.snsorArAtlig'", "output": "'snsorArAtlig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9317", "output": "{1, 9317, 7, 11, 77, 847, 1331, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015107", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'ppythonython'", "output": "{'ppythonython': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6507", "output": "{1, 3, 9, 6507, 241, 723, 2169, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015109", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9854", "output": "{1, 2, 13, 758, 26, 379, 9854, 4927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015110", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4911", "output": "{1, 3, 1637, 4911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015111", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0 and num % 3 == 0:\n            modified_list.append(num * 5)\n        elif num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:\n            modified_list.append(num ** 3)\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "process_integers", "input": "[6, 9, 6, 3, 11, 3, 3, 3, 2]", "output": "[30, 729, 30, 27, 11, 27, 27, 27, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2885_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015112", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "12", "output": "'UpdateLastTimeSync'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015113", "code": "import sys\ndef process_test_args(argv):\n    predefined_args = [\n        \"--cov\",\n        \"elasticsearch_dsl\",\n        \"--cov\",\n        \"test_elasticsearch_dsl.test_integration.test_examples\",\n        \"--verbose\",\n        \"--junitxml\",\n        \"junit.xml\",\n        \"--cov-report\",\n        \"xml\",\n    ]\n    if argv is None:\n        argv = predefined_args\n    else:\n        argv = argv[1:]\n    return argv\n", "entry_point": "process_test_args", "input": "['dummy_script_name', 'tee.p', 'test_pfile.p']", "output": "['tee.p', 'test_pfile.p']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92393_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015114", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'1.31.3', 'Edd'", "output": "(1, 31, 3, 'Edd')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015115", "code": "def extract_comments_from_script(script):\n    comments = []\n    for line in script.split('\\n'):\n        line = line.strip()\n        if line.startswith('#'):\n            comments.append(line)\n    return comments\n", "entry_point": "extract_comments_from_script", "input": "'   ##'", "output": "['##']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99748_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015116", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[42, 42, 42], 3", "output": "42.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015117", "code": "def parse_configuration(config_content):\n    config_dict = {}\n    for line in config_content.splitlines():\n        line = line.strip()\n        if line:\n            key, value = line.split('=')\n            key = key.strip()\n            value = value.strip()\n            if value.startswith('\"') and value.endswith('\"'):\n                value = value[1:-1]  # Remove double quotes from the value\n            elif value.isdigit():\n                value = int(value)\n            elif value.lower() == 'true' or value.lower() == 'false':\n                value = value.lower() == 'true'\n            config_dict[key] = value\n    return config_dict\n", "entry_point": "parse_configuration", "input": "'='", "output": "{'': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86951_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015118", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[4, 5, 10, 10, 4, 5, 10, 9]", "output": "[4, 4, 5, 5, 9, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015119", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "100, 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015120", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'example.com'", "output": "'example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015121", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'IPXPPIIPI', 'ME'", "output": "'Invalid status code: IPXPPIIPI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015122", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'eeom.comxample.'", "output": "'eeom.comxample.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015123", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'world!'", "output": "{'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15027_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015124", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[7, 5, 5, 3, 3, 1, 1, 2, 4]", "output": "[7, 5, 5, 3, 3, 1, 1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015125", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[5, 6, 7, 8, 9, 10]", "output": "7.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145902_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9125", "output": "{1, 1825, 5, 9125, 73, 365, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9124", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015127", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'C:\\\\UCtCmC:\\\\Cs'", "output": "'C:/UCtCmC:/Cs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015128", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2661", "output": "{1, 3, 2661, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015129", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[25, 30, 30, 30, 35]", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134450_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2255", "output": "{1, 451, 5, 41, 11, 205, 2255, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2254", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8607", "output": "{1, 3, 453, 19, 2869, 151, 57, 8607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015132", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "-3, 6, 10", "output": "'-3.6.10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015133", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[2, 3, 6, 2, 1]", "output": "[2, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015134", "code": "def find_pairs_sum_to_target(nums, target):\n    seen = {}\n    pairs = []\n    for num in nums:\n        diff = target - num\n        if diff in seen:\n            pairs.append((num, diff))\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs_sum_to_target", "input": "[1, 2, 4, 5], 6", "output": "[(4, 2), (5, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134600_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015135", "code": "import re\ndef repair_move_path(path: str) -> str:\n    # Define a regular expression pattern to match elements like '{org=>com}'\n    FILE_PATH_RENAME_RE = re.compile(r'\\{([^}]+)=>([^}]+)\\}')\n    # Replace the matched elements with the desired format using re.sub\n    return FILE_PATH_RENAME_RE.sub(r'\\2', path)\n", "entry_point": "repair_move_path", "input": "'{x=>ectec.d/c}'", "output": "'ectec.d/c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137172_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015136", "code": "def unique_counts(input_list):\n    # Creating an empty dictionary to store unique items and their counts\n    counts_dict = {}\n    # Bubble sort implementation (source: https://realpython.com/sorting-algorithms-python/)\n    def bubble_sort(arr):\n        n = len(arr)\n        for i in range(n):\n            for j in range(0, n-i-1):\n                if arr[j] > arr[j+1]:\n                    arr[j], arr[j+1] = arr[j+1], arr[j]\n    # Sorting the input list using bubble sort\n    sorted_list = input_list.copy()  # Create a copy to preserve the original list\n    bubble_sort(sorted_list)\n    # Counting unique items and their occurrences\n    current_item = None\n    count = 0\n    for item in sorted_list:\n        if item != current_item:\n            if current_item is not None:\n                counts_dict[current_item] = count\n            current_item = item\n            count = 1\n        else:\n            count += 1\n    counts_dict[current_item] = count  # Add count for the last item\n    return counts_dict\n", "entry_point": "unique_counts", "input": "['B', 'B', 'B', 'C']", "output": "{'B': 3, 'C': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146010_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015137", "code": "def final_position(movement_commands):\n    x, y = 0, 0\n    for command in movement_commands:\n        if command == 'UP':\n            y += 1\n        elif command == 'DOWN':\n            y -= 1\n        elif command == 'LEFT':\n            x -= 1\n        elif command == 'RIGHT':\n            x += 1\n    return (x, y)\n", "entry_point": "final_position", "input": "['DOWN']", "output": "(0, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105011_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015138", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'cat'", "output": "'Manual not available for cat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015139", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[8, 6, 4, 2, 1, 3, 5, 7]", "output": "[8, 6, 4, 2, 1, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015140", "code": "from typing import List\ndef dna_impact_factor(s: str, p: List[int], q: List[int]) -> List[int]:\n    response = ['T'] * len(p)\n    for i, nucleotide in enumerate(s):\n        for k, (start, end) in enumerate(zip(p, q)):\n            if start <= i <= end and nucleotide < response[k]:\n                response[k] = nucleotide\n    impact_factor = {'A': 1, 'C': 2, 'G': 3, 'T': 4}\n    return [impact_factor[n] for n in response]\n", "entry_point": "dna_impact_factor", "input": "'CCTTTAA', [0, 2, 5], [1, 4, 6]", "output": "[2, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94722_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015141", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[70, 80, 90, 100, 60]", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135847_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015142", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015143", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[3, 4, 4, 3]", "output": "[8, 9, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015144", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'example.json'", "output": "'example_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015145", "code": "def find_peak_index(arr):\n    for i in range(1, len(arr) - 1):\n        if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:\n            return i\n    return -1  # No peak found\n", "entry_point": "find_peak_index", "input": "[2, 2, 2]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94014_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015146", "code": "from typing import List\ndef sum_non_diagonal(matrix: List[List[int]]) -> int:\n    sum_non_diag = 0\n    n = len(matrix)\n    for i in range(n):\n        for j in range(n):\n            if i != j:  # Check if the element is not on the diagonal\n                sum_non_diag += matrix[i][j]\n    return sum_non_diag\n", "entry_point": "sum_non_diagonal", "input": "[[0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54102_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015147", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "'**I** process **.**   '", "output": "'I process .'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015148", "code": "def longest_increasing_subsequence_length(nums):\n    if not nums:\n        return 0\n    dp = [1] * len(nums)\n    for i in range(1, len(nums)):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence_length", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015149", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[11, 3, 1, 5, 5, 4, 4, 6, 4]", "output": "([11, 3, 1, 5, 5], [4, 4, 6, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015150", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "15", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015151", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6033", "output": "{1, 6033, 3, 2011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8906", "output": "{1, 2, 4453, 73, 8906, 146, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015153", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[5, 5, 6, 6, 2, 6]", "output": "[6, 2, 6, 6, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015154", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 4, 6, 3, 6, 4, 3, 3]", "output": "[9, 10, 9, 9, 10, 7, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015155", "code": "def euclid_gcd(a, b):\n    if not isinstance(a, int) or not isinstance(b, int):\n        return \"Invalid input, please provide integers.\"\n    a = abs(a)\n    b = abs(b)\n    while b != 0:\n        a, b = b, a % b\n    return a\n", "entry_point": "euclid_gcd", "input": "0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129293_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015156", "code": "def calculate_total_calories_per_category(food_items):\n    category_calories = {}\n    for item in food_items:\n        category = item[\"category\"]\n        calories = item[\"calories\"]\n        if category in category_calories:\n            category_calories[category] += calories\n        else:\n            category_calories[category] = calories\n    return category_calories\n", "entry_point": "calculate_total_calories_per_category", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84321_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015157", "code": "from typing import Union, List\ndef parse_driving_envs(driving_environments: str) -> Union[str, List[str]]:\n    driving_environments = driving_environments.split(',')\n    for driving_env in driving_environments:\n        if len(driving_env.split('_')) < 2:\n            raise ValueError(f'Invalid format for the driving environment {driving_env} (should be Suite_Town)')\n    if len(driving_environments) == 1:\n        return driving_environments[0]\n    return driving_environments\n", "entry_point": "parse_driving_envs", "input": "'Suite1_wn1,Suite2_Town2'", "output": "['Suite1_wn1', 'Suite2_Town2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141849_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015158", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'100.1.11'", "output": "(100, 1, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015159", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 1, 2, 2, -2, 2, -1, 1]", "output": "[5, 3, 4, 0, 0, 1, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015160", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1130", "output": "{1, 2, 226, 5, 1130, 10, 113, 565}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1129", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015161", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'use'", "output": "'use'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015162", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[-1, 0, 2, 1, 1, 0, 3, 1, 1, 0, 0]", "output": "[-1, 0, 2, 1, 1, 0, 3, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015163", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "5, 0", "output": "'O expoente tem que ser positivo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015164", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 25, 25, 20]", "output": "[42, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015165", "code": "def navigate_file_system(commands):\n    current_dir = \"root\"\n    for command in commands:\n        action, *directory = command.split()\n        if action == \"up\":\n            current_dir = \"root\"\n        elif action == \"down\":\n            if directory:\n                current_dir = directory[0]\n    return current_dir\n", "entry_point": "navigate_file_system", "input": "['down folder2']", "output": "'folder2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52349_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015166", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/path/to/example.tx'", "output": "'example.tx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015167", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\begilulr}'", "output": "'\\\\begilulr}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7427", "output": "{1, 7427, 1061, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015169", "code": "def calculate_total_price(menu_items):\n    total_price = sum(item[\"price\"] for item in menu_items)\n    return total_price\n", "entry_point": "calculate_total_price", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105001_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015170", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[82, 84, 76, 82, 76]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015171", "code": "def convert_attribute_name(original_name):\n    attribute_map = {\n        'api_version': 'apiVersion',\n        'authorization': 'authorization',\n        'bearer_token_file': 'bearerTokenFile',\n        'name': 'name',\n        'namespace': 'namespace',\n        'path_prefix': 'pathPrefix',\n        'port': 'port',\n        'scheme': 'scheme',\n        'timeout': 'timeout',\n        'tls_config': 'tlsConfig'\n    }\n    return attribute_map.get(original_name, 'Not Found')\n", "entry_point": "convert_attribute_name", "input": "'api_version'", "output": "'apiVersion'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120015_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015172", "code": "def count_unique_words(poem: str) -> int:\n    # Split the poem into individual words and convert them to lowercase\n    words = [word.lower() for word in poem.split()]\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Return the total number of unique words\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'Apple Banana Grape Orange Kiwi'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62859_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015173", "code": "def process_dependencies(dependencies):\n    dependency_dict = {}\n    for dependency in dependencies:\n        key, value = dependency\n        if key in dependency_dict:\n            dependency_dict[key].append(value)\n        else:\n            dependency_dict[key] = [value]\n    return dependency_dict\n", "entry_point": "process_dependencies", "input": "[('cat', 'meow'), ('dog', 'bark')]", "output": "{'cat': ['meow'], 'dog': ['bark']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49898_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015174", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "[2], [-2], [-1], [5]", "output": "[2, -2, -1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015175", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[70, 70, 70, 70, 70]", "output": "70.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015176", "code": "from typing import List\ndef count_items_above_average(items: List[int]) -> int:\n    if not items:\n        return 0\n    average_weight = sum(items) / len(items)\n    count = sum(1 for item in items if item > average_weight)\n    return count\n", "entry_point": "count_items_above_average", "input": "[1, 10, 10, 10, 10, 10, 10]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73147_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015177", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[100]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015178", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[5, 18, 141, 541]", "output": "[18, 141, 541]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015179", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[550, 550], 2", "output": "550.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015180", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "'\u043f\u0431\u0432\u0432\u0433'", "output": "[16, 1, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015181", "code": "def calculate_weighted_average(probabilities):\n    weighted_sum = 0\n    for value, probability in probabilities.items():\n        weighted_sum += value * probability\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "{0: 1.0}", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015182", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[8, 10]", "output": "[8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015183", "code": "def count_unique_numeric_elements(input_list):\n    unique_numeric_elements = set()\n    for element in input_list:\n        if isinstance(element, (int, float)):\n            unique_numeric_elements.add(element)\n    return len(unique_numeric_elements)\n", "entry_point": "count_unique_numeric_elements", "input": "[1, 2, 3, 4, 'hello', True]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9037_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015184", "code": "def find_smallest_divisible_number(digit1: int, digit2: int, k: int) -> int:\n    MAX_NUM_OF_DIGITS = 10\n    INT_MAX = 2**31-1\n    if digit1 < digit2:\n        digit1, digit2 = digit2, digit1\n    total = 2\n    for l in range(1, MAX_NUM_OF_DIGITS+1):\n        for mask in range(total):\n            curr, bit = 0, total>>1\n            while bit:\n                curr = curr*10 + (digit1 if mask&bit else digit2)\n                bit >>= 1\n            if k < curr <= INT_MAX and curr % k == 0:\n                return curr\n        total <<= 1\n    return -1\n", "entry_point": "find_smallest_divisible_number", "input": "3, 0, 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7656_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015185", "code": "def calculate_ascii_sum(input_string):\n    ascii_sum = 0\n    for char in input_string:\n        if char.isalpha():\n            ascii_sum += ord(char)\n    return ascii_sum\n", "entry_point": "calculate_ascii_sum", "input": "'AAAAAAAAAA'", "output": "650", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_293_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015186", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'tclclean_dttaerar', 'gru.hdf5s'", "output": "'tclclean_dttaerar/gru.hdf5s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015187", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(-1, -1, 3, -1, 0, 3, 1)", "output": "'-1.-1.3.-1.0.3.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015188", "code": "def simulate_reformat_temperature_data(raw_data):\n    # Simulate processing the data using a hypothetical script 'reformat_weather_data.py'\n    # In this simulation, we will simply reverse the input data as an example\n    reformatted_data = raw_data[::-1]\n    return reformatted_data\n", "entry_point": "simulate_reformat_temperature_data", "input": "'330,25,28,32,270,327'", "output": "'723,072,23,82,52,033'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136307_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015189", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[3, 3, 'hello', 4.5, None]", "output": "{3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015190", "code": "from typing import List\ndef average_absolute_differences(list1: List[int], list2: List[int]) -> float:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    absolute_diffs = [abs(x - y) for x, y in zip(list1, list2)]\n    average_diff = sum(absolute_diffs) / len(absolute_diffs)\n    return round(average_diff, 4)  # Rounding to 4 decimal places\n", "entry_point": "average_absolute_differences", "input": "[0, 2], [1, 3]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72862_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1963", "output": "{1, 1963, 13, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015192", "code": "def custom_multiply(*args):\n    if len(args) == 2 and all(isinstance(arg, int) for arg in args):\n        return args[0] * args[1]\n    elif len(args) == 1 and isinstance(args[0], int):\n        return args[0] * args[0]\n    else:\n        return -1\n", "entry_point": "custom_multiply", "input": "2, 4", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015193", "code": "def process_revision(revision):\n    # Extract the first 6 characters of the revision string in reverse order\n    key = revision[:6][::-1]\n    # Update the down_revision variable with the extracted value\n    global down_revision\n    down_revision = key\n    return down_revision\n", "entry_point": "process_revision", "input": "'0bb7cb'", "output": "'bc7bb0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39423_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015194", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[65, 85, 75, 65, 55, 75, 65, 65]", "output": "['D', 'B', 'C', 'D', 'E', 'C', 'D', 'D']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015195", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mtr.symtaConfim'", "output": "('mtr', 'symtaConfim')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015196", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8687", "output": "{1, 7, 73, 8687, 17, 119, 1241, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015197", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3], 2", "output": "150.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015198", "code": "import re\ndef count_word_occurrences(input_string):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word.isalpha():\n            word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'tewt'", "output": "{'tewt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99880_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015199", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 5, -3, 9, 1, 6, 1, 6]", "output": "[6, 2, 6, 10, 7, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015200", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5555", "output": "{1, 5, 101, 11, 5555, 55, 1111, 505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5554", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015201", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5689", "output": "{1, 5689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015202", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[3, 5, 1, 2, 3, 3]", "output": "[3, 5, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2953", "output": "{1, 2953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2952", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015204", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'Hello World', 'DDo', 2019", "output": "'HELDDO2019'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015205", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[3, 2, 1, 4, 5]", "output": "[3, 2, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015206", "code": "def extract_alias(source_url):\n    if ':' in source_url:\n        alias = source_url.split(':', 1)[0]\n        return alias\n    else:\n        return None\n", "entry_point": "extract_alias", "input": "'https:'", "output": "'https'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119573_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2498", "output": "{1, 2498, 2, 1249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015208", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'12'", "output": "['12']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015209", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 1, 2, 1]", "output": "[0, 1, 1, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015210", "code": "def max_subarray_sum(arr):\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[15, 20]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126221_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015211", "code": "def next_greater_permutation(n):\n    num = list(str(n))\n    i = len(num) - 2\n    while i >= 0:\n        if num[i] < num[i + 1]:\n            break\n        i -= 1\n    if i == -1:\n        return -1\n    j = len(num) - 1\n    while num[j] <= num[i]:\n        j -= 1\n    num[i], num[j] = num[j], num[i]\n    result = int(''.join(num[:i + 1] + num[i + 1:][::-1]))\n    return result if result < (1 << 31) else -1\n", "entry_point": "next_greater_permutation", "input": "123", "output": "132", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114170_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015212", "code": "import json\ndef process_post_request(request_body: str) -> str:\n    try:\n        post_data = json.loads(request_body)\n    except json.JSONDecodeError:\n        return 'Invalid Request'\n    if 'status' not in post_data:\n        return 'Invalid Request'\n    status = post_data['status']\n    if not isinstance(status, int):\n        return 'Invalid Status'\n    if status == 200:\n        return 'Status OK'\n    elif status == 404:\n        return 'Status Not Found'\n    else:\n        return 'Unknown Status'\n", "entry_point": "process_post_request", "input": "'{\"status\": \"200\"}'", "output": "'Invalid Status'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39582_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015213", "code": "def generate_forcefield_path(name):\n    base_directory = \"/path/to/forcefields/\"\n    forcefield_filename = f\"forcefield_{name}.txt\"\n    forcefield_path = base_directory + forcefield_filename\n    return forcefield_path\n", "entry_point": "generate_forcefield_path", "input": "'ettc'", "output": "'/path/to/forcefields/forcefield_ettc.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015214", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'worhhello wd hellohellold'", "output": "{'worhhello': 1, 'wd': 1, 'hellohellold': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015215", "code": "def count_alphanumeric_chars(text):\n    count = 0\n    for char in text:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abc123!'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10323_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015216", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[9, 3]", "output": "[9, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015217", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "-3", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015218", "code": "def merge_sorted_arrays(arr1, arr2):\n    merged = []\n    i, j = 0, 0\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] < arr2[j]:\n            merged.append(arr1[i])\n            i += 1\n        else:\n            merged.append(arr2[j])\n            j += 1\n    merged.extend(arr1[i:])\n    merged.extend(arr2[j:])\n    return merged\n", "entry_point": "merge_sorted_arrays", "input": "[2, 5, 8], [4, 4, 4, 6, 6, 6, 8]", "output": "[2, 4, 4, 4, 5, 6, 6, 6, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75408_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015219", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[10, 1, 3, 1, 4, 1, 1, 2]", "output": "[1, 1, 1, 1, 2, 3, 4, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "665", "output": "{1, 35, 5, 133, 7, 19, 665, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015221", "code": "def count_tag_occurrences(tags):\n    tag_counts = {}\n    for tag in tags:\n        if tag in tag_counts:\n            tag_counts[tag] += 1\n        else:\n            tag_counts[tag] = 1\n    return tag_counts\n", "entry_point": "count_tag_occurrences", "input": "['a', 'a', 'a', 'a', 'a', 'a', 'div', 'p']", "output": "{'a': 6, 'div': 1, 'p': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015222", "code": "def reweight_data(values, target):\n    distances = {value: abs(value - target) for value in values}\n    sum_distances = sum(distances.values())\n    reweighted_scores = {value: 1 - (distances[value] / sum_distances) for value in values}\n    return reweighted_scores\n", "entry_point": "reweight_data", "input": "[7, 1, 5], 7", "output": "{7: 1.0, 1: 0.25, 5: 0.75}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34894_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015223", "code": "def strings_with_digits(input_list):\n    output_list = []\n    for string in input_list:\n        for char in string:\n            if char.isdigit():\n                output_list.append(string)\n                break  # Break the inner loop once a digit is found in the string\n    return output_list\n", "entry_point": "strings_with_digits", "input": "['5jjkl12', '5jjkl', '123']", "output": "['5jjkl12', '5jjkl', '123']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43239_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015224", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[1, 2, 2, 3, 3, 4, 8]", "output": "[8, 4, 3, 3, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015225", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5470", "output": "{1, 2, 547, 5, 1094, 10, 2735, 5470}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5469", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015226", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'helthisoa'", "output": "['helthisoa']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015227", "code": "def extract_message_info(messages):\n    extracted_info = {}\n    for message in messages:\n        key, value = message.split('=')\n        key = key.strip()\n        value = value.strip().strip(\"'\")  # Remove leading/trailing spaces and single quotes\n        if key in extracted_info:\n            extracted_info[key].append(value)\n        else:\n            extracted_info[key] = [value]\n    return extracted_info\n", "entry_point": "extract_message_info", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110998_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015228", "code": "def match_route(requested_url, routes):\n    for route_pattern, controller_action in routes:\n        if requested_url == route_pattern:\n            return controller_action\n    return '404 Not Found'\n", "entry_point": "match_route", "input": "'some/invalid/url', []", "output": "'404 Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140881_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9067", "output": "{1, 9067}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015230", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, -1, -2, -3]", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015231", "code": "def remove_trailing_zeros(numbers):\n    modified_numbers = []\n    for num in numbers:\n        modified_num = float(str(num).rstrip('0').rstrip('.'))\n        modified_numbers.append(modified_num)\n    return modified_numbers\n", "entry_point": "remove_trailing_zeros", "input": "[3.14, 2.5, 6, 4]", "output": "[3.14, 2.5, 6.0, 4.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96890_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015232", "code": "def word_frequency(text):\n    text = text.lower()  # Convert text to lowercase\n    words = text.split()  # Split text into words\n    frequency_dict = {}  # Dictionary to store word frequencies\n    for word in words:\n        # Remove any punctuation marks if needed\n        word = word.strip('.,!?;:\"')\n        if word in frequency_dict:\n            frequency_dict[word] += 1\n        else:\n            frequency_dict[word] = 1\n    return frequency_dict\n", "entry_point": "word_frequency", "input": "'Python'", "output": "{'python': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117162_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015233", "code": "def process_snapshots(snapshot_ids, snapshot_info):\n    processed_snapshots = []\n    for snapshot_id in snapshot_ids:\n        if snapshot_id in snapshot_info:\n            snapshot_data = snapshot_info[snapshot_id]\n            processed_snapshots.append({\n                \"snapshot_id\": snapshot_id,\n                \"volume_id\": snapshot_data[\"volume_id\"],\n                \"encrypted\": snapshot_data[\"encrypted\"]\n            })\n    return processed_snapshots\n", "entry_point": "process_snapshots", "input": "[4, 5, 6], {1: {}, 2: {}, 3: {}}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114178_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015234", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8117", "output": "{1, 8117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015235", "code": "def sum_even_numbers(lst):\n    sum_even = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[20, 28]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145169_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015236", "code": "import re\ndef parse_level_builder_code(code):\n    objects_info = {}\n    lines = code.split('\\n')\n    for line in lines:\n        if 'lb.addObject' in line:\n            obj_type = re.search(r'\\.addObject\\((\\w+)\\.', line).group(1)\n            obj_name = re.search(r'\\.setName\\(\"(\\w+)\"\\)', line)\n            obj_name = obj_name.group(1) if obj_name else f'{obj_type}#{len(objects_info)+1}'\n            obj_details = {'type': obj_type}\n            for prop in re.findall(r',(\\w+)=(\\w+|\\d+|\\'\\w+\\')', line):\n                obj_details[prop[0]] = prop[1].strip(\"'\")\n            objects_info[obj_name] = obj_details\n    return objects_info\n", "entry_point": "parse_level_builder_code", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99668_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015237", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3373", "output": "{1, 3373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015238", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[7, 7, 1, 2, 1, 1, 7]", "output": "[7, 8, 3, 5, 5, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015239", "code": "def generate_code(input_string):\n    char_count = {}\n    for char in input_string:\n        char_count[char] = char_count.get(char, 0) + 1\n    code_chars = []\n    for char in input_string:\n        code_chars.extend([char] * char_count[char])\n    return ''.join(code_chars)\n", "entry_point": "generate_code", "input": "'he'", "output": "'he'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57609_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015240", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[2, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[2, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015241", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9817", "output": "{9817, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7057", "output": "{1, 7057}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015243", "code": "def extract_versions(dependencies):\n    component_versions = {}\n    for component, version in dependencies:\n        component_versions[component] = version\n    return component_versions\n", "entry_point": "extract_versions", "input": "[('toolA', 'v2.0.1'), ('toolB', '1.2')]", "output": "{'toolA': 'v2.0.1', 'toolB': '1.2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93181_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015244", "code": "CLIENT_TYPE = {\n    '--client_lua_path': \"lua\",\n    '--client_cs_path': \"cs\",\n    '--client_cpp_path': \"cpp\",\n    '--client_js_path': \"js\",\n    '--client_python_path': \"python\",\n}\ndef get_client_type(arguments):\n    for arg in arguments:\n        if arg in CLIENT_TYPE:\n            return CLIENT_TYPE[arg]\n    return \"Unknown client type\"\n", "entry_point": "get_client_type", "input": "['--unknown_flag']", "output": "'Unknown client type'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19100_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015245", "code": "def extract_unique_tags(html_content):\n    unique_tags = set()\n    tag = ''\n    inside_tag = False\n    for char in html_content:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n            tag = tag.strip()\n            if tag:\n                unique_tags.add(tag)\n            tag = ''\n        elif inside_tag:\n            if char.isalnum():\n                tag += char\n    return sorted(list(unique_tags))\n", "entry_point": "extract_unique_tags", "input": "'<body></body>'", "output": "['body']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126025_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015246", "code": "from typing import List\ndef remaining_people(line: List[int]) -> int:\n    shortest_height = float('inf')\n    shortest_index = 0\n    for i, height in enumerate(line):\n        if height < shortest_height:\n            shortest_height = height\n            shortest_index = i\n    return len(line[shortest_index:])\n", "entry_point": "remaining_people", "input": "[1, 5, 6, 7, 8, 9, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74868_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015247", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'Itmporter'", "output": "'itmporter.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015248", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[95, 95, 94, 90, 88]", "output": "[95, 95, 94]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015249", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5717", "output": "{1, 5717}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5716", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015250", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[3, 3, 4, 5, 5, 2, 2]", "output": "[3, 4, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1045", "output": "{1, 5, 11, 209, 19, 1045, 55, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1044", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015252", "code": "import re\ndef extract_version_number(input_string):\n    pattern = r'\\d+(\\.\\d+)+'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group()\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version_number", "input": "'Version 1.2.3'", "output": "'1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48611_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015253", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[99, 99, 85, 85, 85, 85, 92, 100, 76]", "output": "{99: 2, 85: 4, 92: 1, 100: 1, 76: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015254", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'HexHexolol'", "output": "b'HexHexolol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015255", "code": "def count_foo_occurrences(input_string):\n    count = 0\n    for i in range(len(input_string) - 2):\n        if input_string[i:i+3] == \"foo\":\n            count += 1\n    return count\n", "entry_point": "count_foo_occurrences", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48936_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015256", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'exaple'", "output": "['exaple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3121", "output": "{1, 3121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015258", "code": "def rotate_array(arr, s):\n    n = len(arr)\n    s = s % n\n    for _ in range(s):\n        store = arr[n-1]\n        for i in range(n-2, -1, -1):\n            arr[i+1] = arr[i]\n        arr[0] = store\n    return arr\n", "entry_point": "rotate_array", "input": "[1, 1, 5, 6], 2", "output": "[5, 6, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58826_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015259", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[540, 540, 141, 100, 99]", "output": "[141, 540, 540]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015260", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[7, 6, 6, -1, 6, 7, 6, 6]", "output": "[343, 46, 46, -1, 46, 343, 46, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015261", "code": "def calculate_total_plays(music):\n    total_plays = {}\n    for track, plays in music:\n        if track in total_plays:\n            total_plays[track] += plays\n        else:\n            total_plays[track] = plays\n    return total_plays\n", "entry_point": "calculate_total_plays", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1397_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2483", "output": "{1, 2483, 13, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015263", "code": "from typing import List\ndef select_best_genome(fitness_scores: List[int]) -> int:\n    best_index = 0\n    best_fitness = fitness_scores[0]\n    for i in range(1, len(fitness_scores)):\n        if fitness_scores[i] > best_fitness:\n            best_fitness = fitness_scores[i]\n            best_index = i\n    return best_index\n", "entry_point": "select_best_genome", "input": "[5, 4, 3, 2, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91198_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015264", "code": "def count_live_streams(live):\n    count = 0\n    for status in live:\n        if status == 1 or status == 2:\n            count += 1\n    return count\n", "entry_point": "count_live_streams", "input": "[1, 1, 2, 1, 1, 2, 2]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94184_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015265", "code": "def calculate_value(n, a):\n    mod = 10**9 + 7\n    answer = 0\n    sumation = sum(a)\n    for i in range(n-1):\n        sumation -= a[i]\n        answer += a[i] * sumation\n        answer %= mod\n    return answer\n", "entry_point": "calculate_value", "input": "5, [1, 2, 3, 4, 5]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102907_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015266", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[90, 80, 85], 3", "output": "[0, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015267", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "100.0, 37.70199999999999", "output": "62.29800000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015268", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[1, 3, 3, 4, 8]", "output": "(19, 5, 1, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015269", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'abc\\nde\\n'", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4942", "output": "{1, 2, 706, 353, 7, 2471, 4942, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4941", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015271", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[10, [20, 16]]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015272", "code": "def sum_adjacent_elements(input_list):\n    output_list = []\n    if not input_list:\n        return output_list\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "sum_adjacent_elements", "input": "[2, 3, 2, 2, 3, 2, 2, 2]", "output": "[5, 5, 4, 5, 5, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114935_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015273", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[1, 1, 0, 0, 2, 2, 3, 3], 4", "output": "[1, 0, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015274", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[1, 1, 2, 2, 3, 4, 4, 5]", "output": "{1: 2, 2: 2, 3: 1, 4: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015275", "code": "def generate_pairs(input_list):\n    pairs = []\n    for i in range(len(input_list) - 1):\n        pairs.append((input_list[i], input_list[i + 1]))\n    return pairs\n", "entry_point": "generate_pairs", "input": "[1, 2, 3, 4, 5]", "output": "[(1, 2), (2, 3), (3, 4), (4, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120584_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015276", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "-2.3, 1", "output": "-2.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015277", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "14", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015278", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[20, 20, 19]", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8097", "output": "{3, 1, 8097, 2699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015280", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "1, 7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015281", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average = round(average_score, 2)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[85.5, 86.1]", "output": "85.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105956_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015282", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'etsest2we'", "output": "('etsest2we', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015283", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[1, 3, 3, 2, 5, 2, 0, 3, 0]", "output": "[1, 3, 2, 5, 2, 0, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4955", "output": "{1, 4955, 5, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015285", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[90, 92, 95]", "output": "92.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015286", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'main', 'settings'", "output": "'SETTINGS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015287", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48656641'", "output": "b'HefA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015288", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[12, 18, 18]", "output": "[12, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015289", "code": "import re\n# Define the regular expression patterns for each file format\n_regexes = {\n    'pdb.gz': re.compile(r'\\.pdb\\.gz$'),\n    'mmcif': re.compile(r'\\.mmcif$'),\n    'sdf': re.compile(r'\\.sdf$'),\n    'xyz': re.compile(r'\\.xyz$'),\n    'sharded': re.compile(r'\\.sharded$')\n}\ndef identify_file_format(file_name):\n    for format_key, pattern in _regexes.items():\n        if pattern.search(file_name):\n            return format_key\n    return \"Unknown Format\"\n", "entry_point": "identify_file_format", "input": "'testfile.xyz'", "output": "'xyz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015290", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[2, 0, 4, 0, 3, 0, 2, 0, 2]", "output": "'aabbbbcccddee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015291", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 3, 9, 6, 7, 4, 2, 3, 7]", "output": "[1, 4, 11, 9, 11, 9, 8, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015292", "code": "def find_lcs_length(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length", "input": "'abcde', 'xyzabcde'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102514_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3436", "output": "{1, 2, 4, 3436, 1718, 859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3435", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015294", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'aaaabbaa'", "output": "'a4b2a2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015295", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 2, 1, 3, 4, 0, 3, 4, 2]", "output": "[4, 3, 4, 7, 4, 3, 7, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015296", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1'", "output": "(1,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015297", "code": "def process_projects(projects):\n    project_details = {}\n    for project in projects:\n        project_id = project['id']\n        details = {\n            'name': project['name'],\n            'description': project['description'],\n            'status': project['status']\n        }\n        project_details[project_id] = details\n    return project_details\n", "entry_point": "process_projects", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72366_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015298", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3746", "output": "{1873, 1, 3746, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3521", "output": "{1, 503, 3521, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015300", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'BRIAN'", "output": "'NAIRB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "48", "output": "{1, 2, 3, 4, 6, 8, 12, 48, 16, 24}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt47", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015302", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'world world'", "output": "['w', 'o', 'r', 'l', 'd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015303", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1702", "output": "{1, 2, 37, 1702, 74, 46, 851, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015304", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[3, 0, 0, 5, 2, 4]", "output": "[3, 0, 5, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015305", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "3", "output": "2.355", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015306", "code": "def calculate_ascii_sum(word_one, word_two):\n    longer_word_length = max(len(word_one), len(word_two))\n    shorter_word_length = min(len(word_one), len(word_two))\n    total_sum = 0\n    for i in range(shorter_word_length, longer_word_length):\n        if len(word_one) > len(word_two):\n            current_word_char = word_one[i]\n        else:\n            current_word_char = word_two[i]\n        total_sum += ord(current_word_char)\n    return total_sum\n", "entry_point": "calculate_ascii_sum", "input": "'', ''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134512_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015307", "code": "def generate_secret_key(property_id, stream_id):\n    concatenated_str = property_id + \"-\" + stream_id\n    ascii_sum = sum(ord(char) for char in concatenated_str)\n    secret_key = ascii_sum % 256\n    return secret_key\n", "entry_point": "generate_secret_key", "input": "'@', '0'", "output": "157", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135157_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3011", "output": "{1, 3011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8535", "output": "{1, 3, 5, 1707, 15, 8535, 569, 2845}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015310", "code": "def resample_time_series(data, season):\n    def seasons_resampler(months):\n        return [data[i] for i in range(len(data)) if i % 12 in months]\n    if season == \"winter\":\n        return seasons_resampler([11, 0, 1])  # December, January, February\n    elif season == \"spring\":\n        return seasons_resampler([2, 3, 4])  # March, April, May\n    elif season == \"summer\":\n        return seasons_resampler([5, 6, 7])  # June, July, August\n    elif season == \"autumn\":\n        return seasons_resampler([8, 9, 10])  # September, October, November\n    elif season == \"custom\":\n        # Implement custom resampling logic here\n        return None\n    elif season == \"yearly\":\n        return [sum(data[i:i+12]) for i in range(0, len(data), 12)]  # Resample to yearly values\n    else:\n        return \"Invalid season specified\"\n", "entry_point": "resample_time_series", "input": "[6.5] * 12, 'yearly'", "output": "[78.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58046_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9244", "output": "{1, 2, 4, 2311, 4622, 9244}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9243", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015312", "code": "def get_api_info(service_name):\n    api_services = {\n        \"GOOGLE\": (\"\", \"https://maps.googleapis.com/maps/api/directions/json?units=imperial\"),\n        \"MAPZEN\": (\"\", \"https://valhalla.mapzen.com/route\")\n    }\n    if service_name in api_services:\n        return api_services[service_name]\n    else:\n        return \"Service not found\"\n", "entry_point": "get_api_info", "input": "'MAPZEN'", "output": "('', 'https://valhalla.mapzen.com/route')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100358_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015313", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[1, 2, 3, 4, 1, 5, 3, 4]", "output": "[3, 5, 7, 5, 6, 8, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015314", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "3", "output": "'11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015315", "code": "def check_compatibility(version1, version2):\n    major1, minor1, patch1 = map(int, version1.split('.'))\n    major2, minor2, patch2 = map(int, version2.split('.'))\n    if major1 != major2:\n        return \"Incompatible\"\n    elif minor1 != minor2:\n        return \"Partially compatible\"\n    elif patch1 != patch2:\n        return \"Compatible with restrictions\"\n    else:\n        return \"Compatible\"\n", "entry_point": "check_compatibility", "input": "'1.0.0', '1.0.0'", "output": "'Compatible'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135189_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015316", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "12", "output": "3.4641016151", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015317", "code": "def zellerAlgorithm(year, month, day):\n    if month in [1, 2]:\n        y1 = year - 1\n        m1 = month + 12\n    else:\n        y1 = year\n        m1 = month\n    y2 = y1 % 100\n    c = y1 // 100\n    day_of_week = (day + (13 * (m1 + 1)) // 5 + y2 + y2 // 4 + c // 4 - 2 * c) % 7\n    return day_of_week\n", "entry_point": "zellerAlgorithm", "input": "2000, 1, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86862_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015318", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'dfmtmt'", "output": "'Dfmtmt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015319", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[1, 2, 4, 3, 5]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015320", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[10, 8, 18]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015321", "code": "def count_passed_students(scores):\n    pass_count = 0\n    for score in scores:\n        if score >= 50:\n            pass_count += 1\n    return pass_count\n", "entry_point": "count_passed_students", "input": "[50, 51, 60, 70, 45, 30]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140531_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015322", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[2, 2, 8, 8, 6, 6, 6]", "output": "[2, 2, 8, 8, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015323", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'exh'", "output": "'exh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5296", "output": "{1, 2, 4, 8, 331, 1324, 5296, 16, 662, 2648}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5295", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015325", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'bbb'", "output": "'b3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015326", "code": "from typing import List\nimport re\ndef extract_capitalized_words(text: str) -> List[str]:\n    capitalized_words = []\n    words = re.findall(r'\\b[A-Z][a-z.,]*\\b', text)\n    for word in words:\n        capitalized_words.append(word)\n    return capitalized_words\n", "entry_point": "extract_capitalized_words", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21895_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015327", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'ADV'", "output": "'ADV'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015328", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5711", "output": "{1, 5711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5710", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015329", "code": "def sum_of_squares_of_evens(lst):\n    sum_of_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 10]", "output": "104", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67089_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015330", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9427", "output": "{11, 1, 9427, 857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015331", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "27, 0", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015332", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    prev_score = None\n    ranks = []\n    for score in reversed(scores):\n        if score not in rank_dict:\n            if prev_score is not None and score < prev_score:\n                current_rank += 1\n            rank_dict[score] = current_rank\n        ranks.append(rank_dict[score])\n        prev_score = score\n    return ranks[::-1]\n", "entry_point": "calculate_ranks", "input": "[50, 50, 60, 60, 70, 70, 70, 70, 70]", "output": "[3, 3, 2, 2, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9219_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015333", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 3, 20]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122742_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3428", "output": "{1, 2, 3428, 4, 1714, 857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3427", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5597", "output": "{1, 29, 193, 5597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015336", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 4, 2, 5, 4, 4, 2, 2]", "output": "[9, 6, 7, 9, 8, 6, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015337", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "3.25, 1", "output": "3.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015338", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9299", "output": "{1, 9299, 17, 547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5645", "output": "{1, 5, 5645, 1129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015340", "code": "def my_count(lst, e):\n    res = 0\n    if type(lst) == list:\n        res = lst.count(e)\n    return res\n", "entry_point": "my_count", "input": "[5, 5], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128138_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015341", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "2, b=3, c=1, d=2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8471", "output": "{1, 43, 197, 8471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015343", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7768", "output": "{1, 2, 4, 8, 971, 3884, 1942, 7768}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7767", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015344", "code": "def average_rating_by_author(books, author_name):\n    total_rating = 0\n    count = 0\n    for book in books:\n        if book['author'] == author_name:\n            total_rating += book['rating']\n            count += 1\n    return total_rating / count if count > 0 else 0\n", "entry_point": "average_rating_by_author", "input": "[], 'Some Author'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123735_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015345", "code": "def get_algorithm_config(config_name):\n    default_config = {'mode': 'default'}\n    config_mapping = {\n        'videoonenet': {'mode': 'videoonenet', 'rho': 0.3},\n        'videoonenetadmm': {'mode': 'videoonenetadmm', 'rho': 0.3},\n        'videowaveletsparsityadmm': {'mode': 'videowaveletsparsityadmm', 'rho': 0.3, 'lambda_l1': 0.05},\n        'rnn': {'rnn': True},\n        'nornn': {'rnn': False}\n    }\n    return config_mapping.get(config_name, default_config)\n", "entry_point": "get_algorithm_config", "input": "'rnn'", "output": "{'rnn': True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36133_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015346", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'wandorwds'", "output": "{'wandorwds': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7587", "output": "{1, 2529, 3, 7587, 9, 843, 281, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015348", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'0.50'", "output": "'0.50.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015349", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'/homesedata', '2123455'", "output": "'/homesedata/2123455'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015350", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hhel'", "output": "{'h': 2, 'e': 1, 'l': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84684_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7508", "output": "{1, 2, 4, 3754, 7508, 1877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7507", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015352", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[1, 3, 5, 3, 4, 2, 2]", "output": "[1, 3, 5, 3, 4, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015353", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVfieldsir1/subdiir/extra_folder'", "output": "('HVfieldsir1/subdiir', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015354", "code": "def format_title(title):\n    words = title.split()\n    formatted_words = [word.capitalize().replace('-', '') for word in words]\n    formatted_title = ' '.join(formatted_words)\n    return formatted_title\n", "entry_point": "format_title", "input": "'pan'", "output": "'Pan'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13677_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015355", "code": "def count_valid_protein_sequences(sequences):\n    valid_count = 0\n    invalid_count = 0\n    nchar = set(['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V'])\n    for seq in sequences:\n        if all(char in nchar for char in seq):\n            valid_count += 1\n        else:\n            invalid_count += 1\n    return {'valid': valid_count, 'invalid': invalid_count}\n", "entry_point": "count_valid_protein_sequences", "input": "['ARN', 'DCE', 'XYZ', 'A1B']", "output": "{'valid': 2, 'invalid': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140445_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015356", "code": "def longestCommonPrefix(strings):\n    if not strings:\n        return \"\"\n    prefix = \"\"\n    for i, char in enumerate(strings[0]):\n        for string in strings[1:]:\n            if i >= len(string) or string[i] != char:\n                return prefix\n        prefix += char\n    return prefix\n", "entry_point": "longestCommonPrefix", "input": "['flower', 'flow', 'flight']", "output": "'fl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34254_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015357", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'dievice:'", "output": "{'dievice': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015358", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "0, 5", "output": "-25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015359", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[9, 3, 3, 8, 5]", "output": "[9, 3, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015360", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "89", "output": "0.49444444444444446", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015361", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'qdogquck', 8", "output": "'qdogquck'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015362", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'Hello, World. Thiis tesW!'", "output": "'Hello World Thiis tesW!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "197", "output": "{1, 197}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt196", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015364", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'concontainstains'", "output": "{'concontainstains': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015365", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'string_value_world'", "output": "'world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015366", "code": "def longest_consecutive_subsequence(lst):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1] + 1:\n            current_length += 1\n        else:\n            if current_length > max_length:\n                max_length = current_length\n                start_index = i - current_length\n            current_length = 1\n    if current_length > max_length:\n        max_length = current_length\n        start_index = len(lst) - current_length\n    return lst[start_index:start_index + max_length]\n", "entry_point": "longest_consecutive_subsequence", "input": "[5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62550_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015367", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'Speakers'", "output": "'Speakers'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015368", "code": "import importlib\ndef execute_function_from_module(module_name, function_name, *args, **kwargs):\n    try:\n        module = importlib.import_module(module_name)\n        function = getattr(module, function_name)\n        return function(*args, **kwargs)\n    except ModuleNotFoundError:\n        return f\"Module '{module_name}' not found.\"\n    except AttributeError:\n        return f\"Function '{function_name}' not found in module '{module_name}'.\"\n", "entry_point": "execute_function_from_module", "input": "'mraatmt', 'some_function'", "output": "\"Module 'mraatmt' not found.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133564_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015369", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "29, 3", "output": "3654", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015370", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[8, 8], 0", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015371", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'ho hell o'", "output": "{'ho': 1, 'hell': 1, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015372", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'key2'", "output": "'value2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015373", "code": "def process_files(files):\n    dic_all = {}\n    for f in files:\n        try:\n            with open(f) as file:\n                lines = file.readlines()\n                dic = {}\n                if lines:\n                    line = lines[0].strip()\n                    dic = eval(line)\n                    for key in dic:\n                        if key not in dic_all:\n                            dic_all[key] = str(dic[key])\n                        else:\n                            dic_all[key] = str(dic_all[key]) + \",\" + str(dic[key])\n        except FileNotFoundError:\n            print(f\"File '{f}' not found. Skipping this file.\")\n    for key in dic_all:\n        dic_all[key] = ''\n    return dic_all\n", "entry_point": "process_files", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21382_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015374", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2906", "output": "{1, 2906, 2, 1453}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015375", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "-4, 12", "output": "-12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015376", "code": "def highest_growth_rate_city(population_list):\n    highest_growth_rate = 0\n    city_with_highest_growth = None\n    for i in range(1, len(population_list)):\n        growth_rate = population_list[i] - population_list[i - 1]\n        if growth_rate > highest_growth_rate:\n            highest_growth_rate = growth_rate\n            city_with_highest_growth = f'City{i+1}'\n    return city_with_highest_growth\n", "entry_point": "highest_growth_rate_city", "input": "[90, 95, 97, 99, 100, 100, 150]", "output": "'City7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6843_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015377", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "68, 0", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015378", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[3, 0, 7, 1, 8, 6, 3, 7, 0]", "output": "'0-1-3-6-7-8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5965", "output": "{1, 5, 1193, 5965}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015380", "code": "from typing import List\ndef best_sum(target_sum: int, numbers: List[int]) -> List[int]:\n    table = [None] * (target_sum + 1)\n    table[0] = []\n    for i in range(target_sum + 1):\n        if table[i] is not None:\n            for num in numbers:\n                if i + num <= target_sum:\n                    if table[i + num] is None or len(table[i] + [num]) < len(table[i + num]):\n                        table[i + num] = table[i] + [num]\n    return table[target_sum]\n", "entry_point": "best_sum", "input": "7, [2, 5, 3]", "output": "[2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127929_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015381", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'rax, [rbx+r150x10]'", "output": "'add rax, [rbx+r150x10]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015382", "code": "from typing import List\ndef sum_of_squares_of_evens(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[10, 6, 4]", "output": "152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36404_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015383", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "17", "output": "1597", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015384", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "None, None, '3.5.1'", "output": "'3.5.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3569", "output": "{1, 83, 43, 3569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015386", "code": "SUFFIX = {'ng': 1e-9, '\u00b5g': 1e-6, 'ug': 1e-6, 'mg': 1e-3, 'g': 1, 'kg': 1e3}\ndef convert_weight(weight, from_suffix, to_suffix):\n    if from_suffix not in SUFFIX or to_suffix not in SUFFIX:\n        return \"Invalid suffix provided\"\n    # Convert weight to base unit (grams)\n    weight_in_grams = weight * SUFFIX[from_suffix]\n    # Convert base unit to target unit\n    converted_weight = weight_in_grams / SUFFIX[to_suffix]\n    return round(converted_weight, 2)\n", "entry_point": "convert_weight", "input": "500, 'g', 'kg'", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21722_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015387", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9399", "output": "{1, 3, 39, 13, 241, 723, 9399, 3133}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015388", "code": "from typing import List\ndef sum_double_duplicates(lst: List[int]) -> int:\n    element_freq = {}\n    total_sum = 0\n    # Count the frequency of each element in the list\n    for num in lst:\n        element_freq[num] = element_freq.get(num, 0) + 1\n    # Calculate the sum considering duplicates\n    for num, freq in element_freq.items():\n        if freq > 1:\n            total_sum += num * 2 * freq\n        else:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_double_duplicates", "input": "[4, 4, 5, 3, 2]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21856_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015389", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['Doge50']", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015390", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4043", "output": "{1, 4043, 13, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015391", "code": "import re\nimport argparse\ndef validate_aligner(aligner_str):\n    aligner_str = aligner_str.lower()\n    aligner_pattern = \"star|subread\"\n    if not re.match(aligner_pattern, aligner_str):\n        error = \"Aligner to be used (STAR|Subread)\"\n        raise argparse.ArgumentTypeError(error)\n    else:\n        return aligner_str\n", "entry_point": "validate_aligner", "input": "'star'", "output": "'star'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52623_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015392", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, 50", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015393", "code": "def max_subarray_sum(arr):\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 20, -5, 5]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54730_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015394", "code": "def jaccard_similarity(set1, set2):\n    intersection_size = len(set1.intersection(set2))\n    union_size = len(set1.union(set2))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    else:\n        return round(intersection_size / union_size, 2)\n", "entry_point": "jaccard_similarity", "input": "{1}, {1, 2, 3, 4}", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148714_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015395", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9602", "output": "{1, 9602, 2, 4801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9601", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015396", "code": "def extract_unique_fields(forms):\n    unique_fields = set()\n    for form in forms:\n        unique_fields.update(form['fields'])\n    return unique_fields\n", "entry_point": "extract_unique_fields", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12416_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015397", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[101, 92, 90, 85, 75, 60]", "output": "[101, 92, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23327_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015398", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[1, 3, 4, 3]", "output": "[4, 7, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015399", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5389", "output": "{1, 317, 5389, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015400", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[3, 3, 2, 4, 2, 2, 3, 3, 3]", "output": "[3, 6, 8, 12, 14, 16, 19, 22, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015401", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 10, 15, 19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015402", "code": "def calculate_precision(true_positives, false_positives):\n    if true_positives + false_positives == 0:\n        return -1\n    precision = true_positives / (true_positives + false_positives)\n    return precision\n", "entry_point": "calculate_precision", "input": "7, 2", "output": "0.7777777777777778", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116916_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015403", "code": "def check_lottery_result(player_numbers, winning_numbers):\n    num_matches = len(set(player_numbers).intersection(winning_numbers))\n    if num_matches == 3:\n        return \"Jackpot Prize\"\n    elif num_matches == 2:\n        return \"Smaller Prize\"\n    elif num_matches == 1:\n        return \"Consolation Prize\"\n    else:\n        return \"No Prize\"\n", "entry_point": "check_lottery_result", "input": "[5, 10, 20], [5, 10, 15]", "output": "'Smaller Prize'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52867_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1706", "output": "{1, 1706, 2, 853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1705", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015405", "code": "def find_second_largest(x, y, z):\n    # Find the minimum, maximum, and sum of the three numbers\n    minimum = min(x, y, z)\n    maximum = max(x, y, z)\n    total = x + y + z\n    # Calculate the second largest number\n    second_largest = total - minimum - maximum\n    return second_largest\n", "entry_point": "find_second_largest", "input": "10, 13, 20", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77878_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015406", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'PParParaPPa', 'hpppp'", "output": "'PParParaPPa.hpppp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015407", "code": "def modify_email(email_data):\n    # Modify the email by adding a new recipient to the \"To\" field\n    new_recipient = \"NewRecipient@example.com\"\n    email_data = email_data.replace(\"To: Recipient 1\", f\"To: Recipient 1, {new_recipient}\")\n    # Update the email subject to include \"Modified\"\n    email_data = email_data.replace(\"Subject: test mail\", \"Subject: Modified: test mail\")\n    return email_data\n", "entry_point": "modify_email", "input": "'Recipient'", "output": "'Recipient'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12643_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5938", "output": "{1, 5938, 2, 2969}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015409", "code": "def recognize_boolean(input_text):\n    input_text_lower = input_text.lower()\n    if input_text_lower in [\"true\", \"yes\"]:\n        return True\n    elif input_text_lower in [\"false\", \"no\"]:\n        return False\n    else:\n        return None\n", "entry_point": "recognize_boolean", "input": "'yes'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68090_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015410", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'appleapple', 'random'", "output": "'appleapple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015411", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'worldh'", "output": "{'worldh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015412", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6842", "output": "{1, 2, 11, 622, 22, 311, 6842, 3421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6841", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015413", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        if count + score_count[score] <= n:\n            top_scores.extend([score] * score_count[score])\n            count += score_count[score]\n        else:\n            remaining = n - count\n            top_scores.extend([score] * remaining)\n            break\n    return sum(top_scores) / n\n", "entry_point": "average_top_n_scores", "input": "[95, 95, 90, 90, 87, 88], 4", "output": "92.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13074_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015414", "code": "# Mock implementation of engine.get_default_dataset_headers\ndef get_default_dataset_headers(default_dataset_name):\n    # Mock dataset headers for demonstration\n    dataset_headers = {\n        'dataset1': ['header1', 'header2', 'header3'],\n        'dataset2': ['headerA', 'headerB', 'headerC']\n    }\n    # Check if the dataset name exists in the mock data\n    if default_dataset_name in dataset_headers:\n        return {'headers': dataset_headers[default_dataset_name]}\n    else:\n        return {'error': 'Dataset headers not found for the given dataset name'}\n", "entry_point": "get_default_dataset_headers", "input": "'dataset1'", "output": "{'headers': ['header1', 'header2', 'header3']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7882_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8793", "output": "{1, 3, 9, 977, 2931, 8793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015416", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 5, 3, 5, 5, 2]", "output": "[2, 6, 5, 8, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1115", "output": "{1, 1115, 5, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015418", "code": "def calculate_total_size_in_kb(file_sizes):\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "calculate_total_size_in_kb", "input": "[4096, 4096, 10216]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119982_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015419", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[5, 9]", "output": "[5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015420", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "-1.0, 0.1", "output": "-0.1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015421", "code": "def perform_operation(numbers, operation):\n    result = None\n    if operation == 'add':\n        result = sum(numbers)\n    elif operation == 'subtract':\n        result = numbers[0] - sum(numbers[1:])\n    elif operation == 'multiply':\n        result = 1\n        for num in numbers:\n            result *= num\n    elif operation == 'divide':\n        result = numbers[0]\n        for num in numbers[1:]:\n            result /= num\n    return result\n", "entry_point": "perform_operation", "input": "[200, 50, 50], 'subtract'", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121676_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015422", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "6, 4, 4", "output": "(0, 3, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015423", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9503", "output": "{1, 43, 13, 559, 17, 731, 221, 9503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015424", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "129", "output": "{1, 129, 3, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015425", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[12, 3, 8, 8, 12, 11, 0, 8, 8]", "output": "{(12, 3, 8), (8, 12, 11), (0, 8, 8)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015426", "code": "def count_open_TTT_events(events):\n    count = 0\n    for event in events:\n        if event.get('open_TTT_applications', False):\n            count += 1\n    return count\n", "entry_point": "count_open_TTT_events", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14470_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015427", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'\"hello world\" python code'", "output": "['hello world', 'python', 'code']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015428", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "122", "output": "212", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015429", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "1.6, 2", "output": "0.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015430", "code": "def simulate_card_game(deck1, deck2, rounds):\n    player1_wins = 0\n    player2_wins = 0\n    for _ in range(rounds):\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return f\"Player 1 wins {player1_wins} rounds, Player 2 wins {player2_wins} rounds\"\n", "entry_point": "simulate_card_game", "input": "[1], [2], 1", "output": "'Player 1 wins 0 rounds, Player 2 wins 1 rounds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77971_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015431", "code": "def calculate_total_hunger(food_items):\n    food_hunger_dict = {}\n    for food, hunger in food_items:\n        if food in food_hunger_dict:\n            food_hunger_dict[food] += hunger\n        else:\n            food_hunger_dict[food] = hunger\n    total_hunger = sum(food_hunger_dict.values())\n    return total_hunger\n", "entry_point": "calculate_total_hunger", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25226_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015432", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'file.txt.com'", "output": "'file.txt.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6946", "output": "{1, 6946, 2, 302, 46, 3473, 23, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015434", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_evens", "input": "[6, 10, 18]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121805_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015435", "code": "def create_grayscale_image(pixel_values):\n    num_rows = len(pixel_values) // 2\n    grayscale_image = [pixel_values[i:i+2] for i in range(0, len(pixel_values), 2)]\n    return grayscale_image\n", "entry_point": "create_grayscale_image", "input": "[50, 25, 51, 0, 52, 24, 0, 0]", "output": "[[50, 25], [51, 0], [52, 24], [0, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125826_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5795", "output": "{1, 5795, 5, 1159, 305, 19, 61, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5794", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015437", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'double_value_10'", "output": "'10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015438", "code": "def attribute_fixer(attribute, value):\n    valid_attributes = [\"health\", \"mana\", \"strength\"]\n    if attribute in valid_attributes and value > 0:\n        return True\n    else:\n        return False\n", "entry_point": "attribute_fixer", "input": "'health', 10", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37198_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015439", "code": "def brainfuck_interpreter(code, input_str):\n    memory = [0] * 30000  # Initialize memory tape with 30,000 cells\n    data_ptr = 0\n    input_ptr = 0\n    output = \"\"\n    def find_matching_bracket(code, current_ptr, direction):\n        count = 1\n        while count != 0:\n            current_ptr += direction\n            if code[current_ptr] == '[':\n                count += direction\n            elif code[current_ptr] == ']':\n                count -= direction\n        return current_ptr\n    while data_ptr < len(code):\n        char = code[data_ptr]\n        if char == '>':\n            data_ptr += 1\n        elif char == '<':\n            data_ptr -= 1\n        elif char == '+':\n            memory[data_ptr] = (memory[data_ptr] + 1) % 256\n        elif char == '-':\n            memory[data_ptr] = (memory[data_ptr] - 1) % 256\n        elif char == '.':\n            output += chr(memory[data_ptr])\n        elif char == ',':\n            if input_ptr < len(input_str):\n                memory[data_ptr] = ord(input_str[input_ptr])\n                input_ptr += 1\n        elif char == '[':\n            if memory[data_ptr] == 0:\n                data_ptr = find_matching_bracket(code, data_ptr, 1)\n        elif char == ']':\n            if memory[data_ptr] != 0:\n                data_ptr = find_matching_bracket(code, data_ptr, -1)\n        data_ptr += 1\n    return output\n", "entry_point": "brainfuck_interpreter", "input": "'. .', ''", "output": "'\\x00\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114726_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015440", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'nanopore', 'ssamle.reads.fa'", "output": "'ssamle_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015441", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6442", "output": "{1, 6442, 2, 3221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015442", "code": "def calculate_total_loss(loss_values):\n    total_loss = 0\n    for loss in loss_values:\n        total_loss += loss\n    return total_loss\n", "entry_point": "calculate_total_loss", "input": "[10.0, 19.07]", "output": "29.07", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134745_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8677", "output": "{1, 8677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015444", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 5, 4, 2]", "output": "[3, 7, 9, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015445", "code": "def evaluate_expression(expression):\n    return eval(expression)\n", "entry_point": "evaluate_expression", "input": "'-3'", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69875_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015446", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9718", "output": "{1, 2, 226, 43, 113, 9718, 86, 4859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9717", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7945", "output": "{1, 35, 227, 5, 7, 7945, 1135, 1589}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015448", "code": "def merge(left_array, right_array):\n    merged = []\n    left_pointer = right_pointer = 0\n    while left_pointer < len(left_array) and right_pointer < len(right_array):\n        if left_array[left_pointer] < right_array[right_pointer]:\n            merged.append(left_array[left_pointer])\n            left_pointer += 1\n        else:\n            merged.append(right_array[right_pointer])\n            right_pointer += 1\n    merged.extend(left_array[left_pointer:])\n    merged.extend(right_array[right_pointer:])\n    return merged\n", "entry_point": "merge", "input": "[1, 2, 3], [4, 5, 6]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74073_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015449", "code": "def process_page_info(page_info):\n    title = page_info.get('title', '')\n    subtitle = page_info.get('subtitle', '')\n    formatted_string = f\"Title: {title}\\nSubtitle: {subtitle}\"\n    return formatted_string\n", "entry_point": "process_page_info", "input": "{}", "output": "'Title: \\nSubtitle: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35915_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015450", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'bbbaabbbb'", "output": "'b3a2b4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015451", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'exmaple'", "output": "['exmaple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015452", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "19", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015453", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[4, 4, 6]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015454", "code": "def reduce_polymer(polymer):\n    stack = []\n    for unit in polymer:\n        if stack and unit.swapcase() == stack[-1]:\n            stack.pop()\n        else:\n            stack.append(unit)\n    return ''.join(stack)\n", "entry_point": "reduce_polymer", "input": "'dabdadabCaCBAdabdadabb'", "output": "'dabdadabCaCBAdabdadabb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51419_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015455", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_amtto', 5", "output": "'\\n  .width(test_amtto);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015456", "code": "def totalNQueens(n):\n    def is_safe(board, row, col):\n        for i in range(row):\n            if board[i] == col or abs(i - row) == abs(board[i] - col):\n                return False\n        return True\n    def backtrack(board, row):\n        nonlocal count\n        if row == n:\n            count += 1\n            return\n        for col in range(n):\n            if is_safe(board, row, col):\n                board[row] = col\n                backtrack(board, row + 1)\n    count = 0\n    board = [-1] * n\n    backtrack(board, 0)\n    return count\n", "entry_point": "totalNQueens", "input": "7", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107753_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015457", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[-9, 8, 1, -9, 7, -9]", "output": "[-729, 64, 1, -729, 343, -729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015458", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[6, 7, 8]", "output": "[6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015459", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[3, 3, 3, 3, 1, 1, 1, 1, 0]", "output": "[3, 3, 3, 3, 1, 1, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015460", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'ihsThis'", "output": "'ihsThis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015461", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{-4: []}, -4", "output": "[-4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015462", "code": "import re\nurl_patterns = [\n    ('^create-location/$', 'LocationSearchView.as_view()', 'location_create'),\n    ('^update-location/$', 'LocationUpdateView.as_view()', 'location_update'),\n    ('^delete-location/$', 'LocationDeleteView.as_view()', 'location_delete'),\n]\ndef resolve_view(url):\n    for pattern, view, view_name in url_patterns:\n        if re.match(pattern, url):\n            return view_name\n    return None\n", "entry_point": "resolve_view", "input": "'update-location/'", "output": "'location_update'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130411_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015463", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "0, 30, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015464", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[10, 3, 2, 11, 3, 9, 5, 6, 10]", "output": "[2, 3, 3, 5, 6, 9, 10, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015465", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[8, 7, 8, 3, 7, 2, 2]", "output": "[8, 8, 10, 6, 11, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015466", "code": "from sys import maxsize\ndef min_flips_to_order(string):\n    length = len(string)\n    flips_from_left = [0 for _ in range(length)]\n    flips_from_right = [0 for _ in range(length)]\n    flips = 0\n    for i in range(length):\n        if string[i] == \"y\":\n            flips += 1\n        flips_from_left[i] = flips\n    flips = 0\n    for i in range(length - 1, -1, -1):\n        if string[i] == \"x\":\n            flips += 1\n        flips_from_right[i] = flips\n    min_flips = maxsize\n    for i in range(1, length):\n        min_flips = min(min_flips, flips_from_left[i - 1] + flips_from_right[i])\n    return min_flips\n", "entry_point": "min_flips_to_order", "input": "''", "output": "9223372036854775807", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68247_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015467", "code": "def find_lcs_length(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length", "input": "'ABCDBD', 'ABDCAB'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102514_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1299", "output": "{3, 1, 1299, 433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015469", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[80, 100, 70, 80, 80, 80, 70, 90]", "output": "[3, 1, 4, 3, 3, 3, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015470", "code": "def count_users_with_one_post(post_counts):\n    user_post_count = {}\n    for count in post_counts:\n        if count in user_post_count:\n            user_post_count[count] += 1\n        else:\n            user_post_count[count] = 1\n    return user_post_count.get(1, 0)\n", "entry_point": "count_users_with_one_post", "input": "[1, 1, 2, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16257_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015471", "code": "def max_subset_sum_non_adjacent(arr):\n    inclusive = 0\n    exclusive = 0\n    for num in arr:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update inclusive as the sum of previous exclusive and current element\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[5, 1, 8]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38682_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015472", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'Some text AB.A more text'", "output": "[('AB', 'A')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015473", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "974", "output": "{1, 2, 974, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt973", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015474", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "2, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015475", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[100, 130]", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015476", "code": "def traffic_light_action(color):\n    if color == 'red':\n        return 'Stop'\n    elif color == 'green':\n        return 'GoGoGo'\n    elif color == 'yellow':\n        return 'Stop or Go fast'\n    else:\n        return 'Light is bad!!!'\n", "entry_point": "traffic_light_action", "input": "'red'", "output": "'Stop'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129716_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3737", "output": "{1, 3737, 101, 37}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015478", "code": "def highest_scoring_student(students):\n    if not students:\n        return None\n    highest_score = float('-inf')\n    highest_scoring_student = None\n    for student in students:\n        name, score = student\n        if score > highest_score:\n            highest_score = score\n            highest_scoring_student = name\n    return highest_scoring_student\n", "entry_point": "highest_scoring_student", "input": "[('John', 90), ('Alice', 92), ('Peter', 95), ('Bob', 88)]", "output": "'Peter'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93566_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1552", "output": "{1, 2, 194, 4, 388, 97, 776, 8, 1552, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1551", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015480", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'5 - 24'", "output": "-19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015481", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "14", "output": "377", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015482", "code": "def sum_of_multiples_of_3_and_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples_of_3_and_5", "input": "[15, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11094_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015483", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'5.0.10'", "output": "(5, 0, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015484", "code": "def custom_wrapper(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            modified_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            modified_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            modified_list.append(\"Buzz\")\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "custom_wrapper", "input": "[7, 7, 2, 2, 5, 3, 5, 3]", "output": "[7, 7, 2, 2, 'Buzz', 'Fizz', 'Buzz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139069_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7451", "output": "{1, 7451}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015486", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[150, 150, 150, 100], 3", "output": "150.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015487", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'progo'", "output": "{'p': 1, 'r': 1, 'o': 2, 'g': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29002_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015488", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "487", "output": "{1, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015489", "code": "def find_pairs(numbers, target):\n    num_dict = {}\n    result = []\n    for num in numbers:\n        diff = target - num\n        if diff in num_dict:\n            result.append((diff, num))\n        num_dict[num] = True\n    return result\n", "entry_point": "find_pairs", "input": "[2, 4, 8, 10], 12", "output": "[(4, 8), (2, 10)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61276_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015490", "code": "def total_collision_objects(scene_list):\n    total_collisions = 0\n    for scene in scene_list:\n        if scene['npc'] > scene['ego_spawn']:\n            total_collisions += scene['collision_spawn']\n    return total_collisions\n", "entry_point": "total_collision_objects", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85068_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015491", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'aaaabbbcc'", "output": "'a4b3c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015492", "code": "def evaluate_expression(operand1, operator, operand2):\n    if operator == '==':\n        return operand1 == operand2\n    elif operator == '!=':\n        return operand1 != operand2\n    elif operator == '<':\n        return operand1 < operand2\n    elif operator == '<=':\n        return operand1 <= operand2\n    elif operator == '>':\n        return operand1 > operand2\n    elif operator == '>=':\n        return operand1 >= operand2\n    elif operator == 'is':\n        return operand1 is operand2\n    elif operator == 'is not':\n        return operand1 is not operand2\n    elif operator == 'in':\n        return operand1 in operand2\n    elif operator == 'not in':\n        return operand1 not in operand2\n    else:\n        raise ValueError(\"Invalid operator\")\n", "entry_point": "evaluate_expression", "input": "1, '!=', 1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121990_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4090", "output": "{1, 2, 5, 10, 818, 409, 4090, 2045}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4089", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3928", "output": "{1, 2, 4, 8, 491, 1964, 982, 3928}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3927", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015495", "code": "from datetime import date, timedelta\ndef weeks_dates(wky):\n    # Parse week number and year from the input string\n    wk = int(wky[:2])\n    yr = int(wky[2:])\n    # Calculate the starting date of the year\n    start_date = date(yr, 1, 1)\n    start_date += timedelta(6 - start_date.weekday())\n    # Calculate the date range for the given week number and year\n    delta = timedelta(days=(wk - 1) * 7)\n    date_start = start_date + delta\n    date_end = date_start + timedelta(days=6)\n    # Format the date range as a string\n    date_range = f'{date_start} to {date_end}'\n    return date_range\n", "entry_point": "weeks_dates", "input": "'47447'", "output": "'0447-11-24 to 0447-11-30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143506_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015496", "code": "import json\ndef extract_keys(json_obj):\n    keys = set()\n    if isinstance(json_obj, dict):\n        for key, value in json_obj.items():\n            keys.add(key)\n            keys.update(extract_keys(value))\n    elif isinstance(json_obj, list):\n        for item in json_obj:\n            keys.update(extract_keys(item))\n    return keys\n", "entry_point": "extract_keys", "input": "{'a': 1, 'b': {'c': 2, 'd': 3}}", "output": "{'d', 'c', 'a', 'b'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122660_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015497", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<jEM'", "output": "'<jEM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7045", "output": "{1, 5, 1409, 7045}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7044", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015499", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'worlworllo'", "output": "'worlworllo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015500", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1305", "output": "{1, 3, 5, 261, 9, 45, 15, 145, 435, 87, 1305, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015501", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'10.3.25'", "output": "'10.3.26'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015502", "code": "from typing import List, Dict, Union, Tuple\ndef process_rules(rules: List[Dict[str, Union[str, bool]]]) -> Tuple[int, List[str]]:\n    active_count = 0\n    inactive_rules = []\n    for rule in rules:\n        if rule['status']:\n            active_count += 1\n        else:\n            inactive_rules.append(rule['name'])\n    return active_count, inactive_rules\n", "entry_point": "process_rules", "input": "[]", "output": "(0, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1553_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015503", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3177", "output": "{1, 353, 3, 1059, 9, 3177}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015504", "code": "def count_file_occurrences(file_lists):\n    file_count = {}\n    for sublist in file_lists:\n        for file_name in sublist:\n            if file_name in file_count:\n                file_count[file_name] += 1\n            else:\n                file_count[file_name] = 1\n    return file_count\n", "entry_point": "count_file_occurrences", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83514_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015505", "code": "def build_host_dict(project_id, instance_globs):\n    \"\"\"Builds a <instance-fake-hostname> => {ip: <instance_ip>, id: <instance_id} map\n       for given project_id and globs\"\"\"\n    result = {}\n    def _fetch_instances_data(project_id):\n        # Placeholder for fetching instances data\n        return [{'name': 'instance1', 'id': 1, 'status': 'running'},\n                {'name': 'instance2', 'id': 2, 'status': 'stopped'}]\n    def matches_any(instance_name, instance_globs):\n        # Placeholder for matching instance name with globs\n        return any(glob in instance_name for glob in instance_globs)\n    def _instance_ip(instance_data):\n        # Placeholder for extracting instance IP\n        return '192.168.1.1'\n    def _instance_hostname(project_id, instance_data):\n        # Placeholder for generating fake hostname\n        return f\"{project_id}-{instance_data['name']}\"\n    instances_data = _fetch_instances_data(project_id)\n    for instance_data in instances_data:\n        if not matches_any(instance_data['name'], instance_globs):\n            continue\n        minidata = {'ip': _instance_ip(instance_data),\n                    'id': instance_data['id'],\n                    'status': instance_data['status']}\n        result[_instance_hostname(project_id, instance_data)] = minidata\n    return result\n", "entry_point": "build_host_dict", "input": "123, []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76860_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015506", "code": "def calculate_total_score(metadata: dict) -> int:\n    total_score = 0\n    if 'part_data' in metadata:\n        for part in metadata['part_data']:\n            total_score += part.get('score', 0)\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144969_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015507", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[5, 2, 3, 16, 1, 2, 2, 1]", "output": "['Buzz', 2, 'Fizz', 16, 1, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015508", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 89, 88, 79, 79]", "output": "[99, 89, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015509", "code": "def setup_project(repo_name, repo_url, commit):\n    # Simulate importing necessary modules from solver-deps\n    def setup_minisat():\n        print(\"Setting up Minisat...\")\n    def setup_cms():\n        print(\"Setting up CMS...\")\n    def clone_repo_src(repo_name, repo_url, commit):\n        # Simulated function to clone the repository\n        return f\"{repo_name}_{commit}\"\n    # Simulate the process of setting up dependencies\n    setup_minisat()\n    setup_cms()\n    # Simulate cloning the repository\n    the_repo = clone_repo_src(repo_name, repo_url, commit)\n    # Simulate creating and setting up the build directory\n    build_dir = f\"{the_repo}/build\"\n    print(f\"Build directory path: {build_dir}\")\n    return build_dir\n", "entry_point": "setup_project", "input": "'vv', 'http://example.com/repo', '999a59aa9'", "output": "'vv_999a59aa9/build'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115797_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015510", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[5, 4, 2, 1, 3, 3, 4, 1, 1]", "output": "[125, 16, 4, 1, 37, 37, 16, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015511", "code": "import typing\ndef circular_sum(input_list: typing.List[int]) -> typing.List[int]:\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 0, 1, 2, 0, 3, 2]", "output": "[0, 1, 3, 2, 3, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4417_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015512", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_num = num + 2\n        else:\n            processed_num = max(num - 1, 0)  # Subtract 1 from odd numbers, ensure non-negativity\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_integers", "input": "[0, 1, 4, 8, 2, 5, 1, 0]", "output": "[2, 0, 6, 10, 4, 4, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98159_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015513", "code": "def move_player(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        # Check boundaries\n        x = max(-10, min(10, x))\n        y = max(-10, min(10, y))\n    return x, y\n", "entry_point": "move_player", "input": "['U', 'U']", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015514", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6387", "output": "{3, 1, 6387, 2129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015515", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[15, 16, 6, 16, 8, 16, 13]", "output": "['FizzBuzz', 16, 'Fizz', 16, 8, 16, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015516", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0.4812, 0, 10", "output": "4.812", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015517", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_excluding_extremes", "input": "[60, 67.25, 68.75, 70.25, 75]", "output": "68.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108103_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015518", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < n:\n            top_scores.append(score)\n        else:\n            min_score = min(top_scores)\n            if score > min_score:\n                top_scores.remove(min_score)\n                top_scores.append(score)\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[70, 71], 2", "output": "70.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015519", "code": "import re\ndef extract_keys(code_snippet):\n    pattern = r'[A-Z_]+='  # Regular expression pattern to match keys in all capital letters followed by an equal sign\n    keys = set(re.findall(pattern, code_snippet))  # Find all matches and store in a set for uniqueness\n    keys = [key.rstrip('=') for key in keys]  # Remove the trailing equal sign from each key\n    return keys\n", "entry_point": "extract_keys", "input": "'var = 10'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105622_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015520", "code": "def check_fib(num):\n    fib = [0, 1]\n    while fib[-1] < num:\n        fib.append(fib[-1] + fib[-2])\n    return num in fib\n", "entry_point": "check_fib", "input": "8", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118205_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015521", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[7, 7, 0, 8, 8, 9, 8, 7]", "output": "[0, 7, 7, 7, 8, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "774", "output": "{1, 2, 3, 387, 258, 774, 6, 129, 9, 43, 18, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt773", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015523", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "8", "output": "'1 1 2 2 3 4 4 4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015524", "code": "def get_nested_dict_value(dictionary, key):\n    if not dictionary:\n        return ''\n    keys = key.split('.')\n    value = dictionary\n    for k in keys:\n        if k in value:\n            value = value[k]\n        else:\n            return ''\n    return value if value else ''\n", "entry_point": "get_nested_dict_value", "input": "{}, 'a.b.c'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35031_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015525", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 12, 21]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106713_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015526", "code": "def sum_non_border_elements(matrix):\n    if len(matrix) < 3 or len(matrix[0]) < 3:\n        return 0  # Matrix is too small to have non-border elements\n    total_sum = 0\n    for i in range(1, len(matrix) - 1):\n        for j in range(1, len(matrix[0]) - 1):\n            total_sum += matrix[i][j]\n    return total_sum\n", "entry_point": "sum_non_border_elements", "input": "[[1, 1, 1], [1, 5, 1], [1, 1, 1]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88007_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015527", "code": "def generate_sequence(a, b, n):\n    output = \"\"\n    for num in range(1, n + 1):\n        if num % a == 0 and num % b == 0:\n            output += \"FB \"\n        elif num % a == 0:\n            output += \"F \"\n        elif num % b == 0:\n            output += \"B \"\n        else:\n            output += str(num) + \" \"\n    return output.rstrip()\n", "entry_point": "generate_sequence", "input": "3, 4, 14", "output": "'1 2 F B 5 F 7 B F 10 11 FB 13 14'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30858_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015528", "code": "def parse_file_format_definition(definition: str) -> dict:\n    field_definitions = definition.split('\\n')\n    format_dict = {}\n    for field_def in field_definitions:\n        field_name, data_type = field_def.split(':')\n        format_dict[field_name.strip()] = data_type.strip()\n    return format_dict\n", "entry_point": "parse_file_format_definition", "input": "'inintt:'", "output": "{'inintt': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143153_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015529", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No average to calculate if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[90, 91, 90, 92, 94]", "output": "91.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140002_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015530", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "11", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015531", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'helhellohhlelo'", "output": "b'\\x0e\\x00\\x00\\x00helhellohhlelo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015532", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    elif n == 1:\n        return 0\n    a, b = 0, 1\n    sum_fib = a + b\n    for _ in range(2, n):\n        a, b = b, a + b\n        sum_fib += b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146168_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015533", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3666", "output": "'1 hour, 1 minute, and 6 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015534", "code": "def parse_response(response):\n    key_value_pairs = response.split(',')\n    for pair in key_value_pairs:\n        key, value = pair.split('=')\n        if key.strip() == 'token':\n            return value.strip()\n    return None  # Return None if the key \"token\" is not found in the response\n", "entry_point": "parse_response", "input": "'user=john, token=atoken3, age=30'", "output": "'atoken3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108561_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015535", "code": "def truncatechars(value, arg):\n    try:\n        length = int(arg)\n    except ValueError:\n        return value  # Return original value if arg is not a valid integer\n    if len(value) > length:\n        return value[:length] + '...'  # Truncate and append '...' if length exceeds arg\n    return value  # Return original value if length is not greater than arg\n", "entry_point": "truncatechars", "input": "'Hellis WorlP!', '13'", "output": "'Hellis WorlP!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15483_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015536", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/hoe/ume', '/e/eexae'", "output": "'/hoe/ume//e/eexae'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5785", "output": "{89, 1, 65, 5, 1157, 13, 5785, 445}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1281", "output": "{1, 1281, 3, 7, 427, 21, 183, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015539", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-295.5, -295.5], 2", "output": "-295.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2401_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015540", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'examexamme.json'", "output": "'examexamme_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9382", "output": "{1, 2, 4691, 9382}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015542", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 9, 15, 25]", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75095_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015543", "code": "from typing import List, Tuple\ndef process_custom_choices(choices: dict, threshold: int) -> List[Tuple[str, str, int]]:\n    result = []\n    for key, sub_dict in choices.items():\n        for subkey, value in sub_dict.items():\n            if value >= threshold:\n                result.append((key, subkey, value))\n    return result\n", "entry_point": "process_custom_choices", "input": "{'fruit': {'apple': 5, 'banana': 7}, 'vegetable': {'carrot': 4}}, 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93842_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015544", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015545", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'31.10.0'", "output": "(31, 10, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015546", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "603", "output": "{1, 3, 67, 201, 9, 603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015547", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[1, 2, 3, 4, 10, 21, 22, 23, 24]", "output": "(1, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015548", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[5, 3, 6, 6, 0, 4, 6]", "output": "[10, 6, 12, 12, 0, 8, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015549", "code": "from typing import List\ndef min_items_to_buy(prices: List[int], budget: float) -> int:\n    prices.sort()  # Sort prices in ascending order\n    items_count = 0\n    for price in prices:\n        budget -= price\n        items_count += 1\n        if budget <= 0:\n            break\n    return items_count\n", "entry_point": "min_items_to_buy", "input": "[5, 10, 15, 20], 30.0", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139036_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015550", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 93, 92, 85, 85, 80]", "output": "[99, 93, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015551", "code": "def final_state(state):\n    final_state = state.copy()\n    for i in range(1, len(state)):\n        if state[i] != state[i - 1]:\n            final_state[i] = 0\n    return final_state\n", "entry_point": "final_state", "input": "[0, 0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82567_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015552", "code": "from typing import List\ndef maxProfit(prices: List[int]) -> int:\n    if not prices or len(prices) < 2:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[2, 3, 5, 10]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94869_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "607", "output": "{1, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015554", "code": "def calculate_average(scores):\n    if len(scores) <= 1:\n        return 0\n    min_score = min(scores)\n    scores.remove(min_score)\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 91, 90.2]", "output": "90.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36918_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015555", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'1.5.3'", "output": "(1, 5, 3, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015556", "code": "from typing import List\nimport math\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_bytes = sum(file_sizes)\n    total_kb = math.ceil(total_bytes / 1024)\n    return total_kb\n", "entry_point": "total_size_in_kb", "input": "[21505]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90092_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015557", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(6, 5, 0, 1, 6, 6, 7)", "output": "'6.5.0.1.6.6.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015558", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "123", "output": "'2:03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015559", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4642", "output": "{1, 4642, 2, 422, 11, 2321, 211, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015560", "code": "def has_odd_and_even(nums):\n    has_odd = False\n    has_even = False\n    for num in nums:\n        if num % 2 == 0:\n            has_even = True\n        else:\n            has_odd = True\n        if has_odd and has_even:\n            return True\n    return False\n", "entry_point": "has_odd_and_even", "input": "[1, 2]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71944_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2755", "output": "{1, 2755, 5, 551, 145, 19, 29, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015562", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'2.552'", "output": "(2, 552)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4065", "output": "{1, 4065, 3, 5, 1355, 813, 15, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015564", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'worlhelloh'", "output": "{'worlhelloh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015565", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1235", "output": "{1, 65, 5, 13, 1235, 19, 247, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1653", "output": "{1, 3, 551, 19, 1653, 87, 57, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9388", "output": "{1, 2, 4, 2347, 9388, 4694}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9387", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015568", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[[5], [5]]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2727", "output": "{1, 3, 101, 2727, 9, 909, 303, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015570", "code": "def count_unique_chars(string: str) -> int:\n    unique_chars = set()\n    for char in string:\n        unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "'ab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74408_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015571", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015572", "code": "def sum_except_self(input_list):\n    total_sum = sum(input_list)\n    output_list = [total_sum - num for num in input_list]\n    return output_list\n", "entry_point": "sum_except_self", "input": "[4, 2, 5, 1, 4, 1, 3, 4]", "output": "[20, 22, 19, 23, 20, 23, 21, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8241_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015573", "code": "def sum_even_numbers(input_list):\n    total_sum = 0\n    for element in input_list:\n        if isinstance(element, str):\n            try:\n                num = int(element)\n                if num % 2 == 0:\n                    total_sum += num\n            except ValueError:\n                pass\n        elif isinstance(element, int) and element % 2 == 0:\n            total_sum += element\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[240, '2']", "output": "242", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015574", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "5, [7, 14]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015575", "code": "from typing import List, Dict, Any\ndef count_valid_entries(data: List[Dict[str, Any]]) -> int:\n    valid_count = 0\n    for entry in data:\n        if (\n            entry.get('type') == 'contraindication' and\n            entry.get('id') and\n            any(tag.get('code') == 'HTEST' and tag.get('display') == 'test health data' for tag in entry.get('meta', {}).get('tag', [])) and\n            entry.get('text', {}).get('status') == 'generated'\n        ):\n            valid_count += 1\n    return valid_count\n", "entry_point": "count_valid_entries", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56053_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015576", "code": "from typing import List\ndef find_first_zero(arr: List[int]) -> int:\n    index = 0\n    for num in arr:\n        if num == 0:\n            return index\n        index += 1\n    return -1\n", "entry_point": "find_first_zero", "input": "[4, 7, 0]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79416_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015577", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 10, 15, 5]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14851_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015578", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9822", "output": "{1, 2, 3, 1637, 6, 3274, 4911, 9822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015579", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[3, 3, 3, 3, -2, 4]", "output": "{3: 4, -2: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015580", "code": "def process_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        if i < list_length - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 2, 1, 3, 1, 1]", "output": "[3, 3, 4, 4, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63579_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015581", "code": "def longest_increasing_path(heights):\n    def dfs(row, col, prev_height, path_length):\n        if row < 0 or row >= len(heights) or col < 0 or col >= len(heights[0]) or heights[row][col] <= prev_height or abs(heights[row][col] - prev_height) > 1:\n            return path_length\n        max_length = path_length\n        for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n            max_length = max(max_length, dfs(row + dr, col + dc, heights[row][col], path_length + 1))\n        return max_length\n    max_path_length = 0\n    for i in range(len(heights)):\n        for j in range(len(heights[0])):\n            max_path_length = max(max_path_length, dfs(i, j, heights[i][j], 1))\n    return max_path_length\n", "entry_point": "longest_increasing_path", "input": "[[1, 1], [1, 1]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44516_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015582", "code": "from typing import List, Tuple, Dict\ndef count_model_registrations(models: List[Tuple[str, str]]) -> Dict[str, int]:\n    model_counts = {}\n    for model_pair in models:\n        for model in model_pair:\n            if model in model_counts:\n                model_counts[model] += 1\n            else:\n                model_counts[model] = 1\n    return model_counts\n", "entry_point": "count_model_registrations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58497_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015583", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'rm/caw300535385114', 3282", "output": "'rm/caw3005353851143282'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015584", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 12, 7", "output": "(3148, 1602)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015585", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "1048577, 1", "output": "2097154", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015586", "code": "def extract_command_and_text(message):\n    # Find the index of the first space after \"!addcom\"\n    start_index = message.find(\"!addcom\") + len(\"!addcom\") + 1\n    # Extract the command by finding the index of the first space after the command\n    end_index_command = message.find(\" \", start_index)\n    command = message[start_index:end_index_command]\n    # Extract the text by finding the index of the first space after the command\n    text = message[end_index_command+1:]\n    return command, text\n", "entry_point": "extract_command_and_text", "input": "'!addcom greet Hello, how are you?'", "output": "('greet', 'Hello, how are you?')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33793_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015587", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'isand'", "output": "{'isand': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015588", "code": "def count_word_occurrences(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Tokenize the text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the counts\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_occurrences", "input": "'word,'", "output": "{'word,': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52489_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015589", "code": "def count_values_in_range(n, min_val, max_val):\n    count = 0\n    i = 0\n    while True:\n        i, sq = i + 1, i ** n\n        if sq in range(min_val, max_val + 1):\n            count += 1\n        if sq > max_val:\n            break\n    return count\n", "entry_point": "count_values_in_range", "input": "2, 1, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140446_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015590", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015591", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "7, 9", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015592", "code": "def sum_multiples(numbers):\n    total_sum = 0\n    seen = set()\n    for num in numbers:\n        if num in seen:\n            continue\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n            seen.add(num)\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[15, 10]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74591_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015593", "code": "def filter_dicts(input_list):\n    filtered_list = []\n    for dictionary in input_list:\n        if 'exclude_key' in dictionary and dictionary['exclude_key'] == 'exclude_value':\n            continue\n        filtered_list.append(dictionary)\n    return filtered_list\n", "entry_point": "filter_dicts", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30808_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015594", "code": "from typing import List, Dict\ndef count_file_formats(formats: List[str]) -> Dict[str, int]:\n    format_counts = {}\n    for file_format in formats:\n        lower_format = file_format.lower()\n        format_counts[lower_format] = format_counts.get(lower_format, 0) + 1\n    return format_counts\n", "entry_point": "count_file_formats", "input": "['nt', 'Nt', 'nT', 'n3', 'xml']", "output": "{'nt': 3, 'n3': 1, 'xml': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27769_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015595", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4207", "output": "{601, 1, 7, 4207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015596", "code": "def plate_validation(plate):\n    if len(plate) not in [6, 7]:\n        return False\n    if not plate[:3].isalpha():\n        return False\n    if not plate[-4:].isdigit():\n        return False\n    return True\n", "entry_point": "plate_validation", "input": "'ABC1234'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118079_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015597", "code": "def count_valid_groupings(n, k):\n    c1 = n // k\n    c2 = n // (k // 2)\n    if k % 2 == 1:\n        cnt = pow(c1, 3)\n    else:\n        cnt = pow(c1, 3) + pow(c2 - c1, 3)\n    return cnt\n", "entry_point": "count_valid_groupings", "input": "3, 3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122726_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015598", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{1, 4}, {5, 6}", "output": "{1, 4, 5, 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015599", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "-8388600, 0", "output": "-8388600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015600", "code": "def _do_set(env, symbol_name, value):\n    if not isinstance(symbol_name, str):\n        raise Exception(\"Symbol name must be a string.\")\n    env[symbol_name] = value\n    return env\n", "entry_point": "_do_set", "input": "{}, 'key1', 10", "output": "{'key1': 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15568_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015601", "code": "_escapes = [('a', '1'), ('b', '2'), ('c', '3')]  # Example escape rules\ndef escape_string(input_string):\n    for a, b in _escapes:\n        input_string = input_string.replace(a, b)\n    return input_string\n", "entry_point": "escape_string", "input": "'aaaaaab'", "output": "'1111112'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9621_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1390", "output": "{1, 2, 5, 10, 139, 1390, 278, 695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1389", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015603", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[5, 6, 7]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015604", "code": "def extract_country_code(url_path):\n    # Find the index of the first '/' after the initial '/'\n    start_index = url_path.find('/', 1) + 1\n    # Extract the country code using string slicing\n    country_code = url_path[start_index:-1]\n    return country_code\n", "entry_point": "extract_country_code", "input": "'/'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90290_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015605", "code": "from typing import List, Tuple, Any, Dict\ndef convert_settings(settings_list: List[Tuple[str, Any]]) -> Dict[str, Any]:\n    settings_dict = {}\n    for key, value in settings_list:\n        settings_dict[key] = value\n    return settings_dict\n", "entry_point": "convert_settings", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139910_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015606", "code": "def find_special_pairs(numbers):\n    count = 0\n    delta = len(numbers) // 2\n    for i in range(len(numbers)):\n        bi = (i + delta) % len(numbers)\n        if numbers[i] == numbers[bi]:\n            count += 1\n    return count\n", "entry_point": "find_special_pairs", "input": "[1, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102357_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015607", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 1, 1, 2, 1, 1]", "output": "[2, 2, 3, 3, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015608", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015609", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5971", "output": "{1, 5971, 853, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015610", "code": "def restore_original_str(s):\n    result = \"\"\n    i = 0\n    while i < len(s):\n        if s[i] == '#':\n            if i + 2 < len(s) and s[i + 2] == '=':\n                ascii_val = int(s[i + 1]) + int(s[i + 3])\n                result += chr(ascii_val)\n                i += 4\n            else:\n                result += chr(int(s[i + 1]))\n                i += 2\n        else:\n            result += s[i]\n            i += 1\n    return result\n", "entry_point": "restore_original_str", "input": "'X6023'", "output": "'X6023'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87838_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015611", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'hoellol'", "output": "{'hoellol': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015612", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "122", "output": "221", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015613", "code": "def parse_platform(curr_platform):\n    platform, compiler = curr_platform.split(\"_\")\n    output_folder_platform = \"\"\n    output_folder_compiler = \"\"\n    if platform.startswith(\"win\"):\n        output_folder_platform = \"Win\"\n        if \"vs2013\" in compiler:\n            output_folder_compiler = \"vc120\"\n        elif \"vs2015\" in compiler:\n            output_folder_compiler = \"vc140\"\n        elif \"vs2017\" in compiler:\n            output_folder_compiler = \"vc141\"\n    elif platform.startswith(\"darwin\"):\n        output_folder_platform = \"Mac\"\n        output_folder_compiler = \"clang\"\n    elif platform.startswith(\"linux\"):\n        output_folder_platform = \"Linux\"\n        output_folder_compiler = \"clang\"\n    return output_folder_platform, output_folder_compiler\n", "entry_point": "parse_platform", "input": "'unknown_compiler'", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142101_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015614", "code": "def calculate_name_value(name):\n    alphavalue = sum(ord(char) - 64 for char in name)\n    return alphavalue\n", "entry_point": "calculate_name_value", "input": "'CLOE'", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140001_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015615", "code": "def filter_stars(stars, distance_threshold):\n    filtered_star_names = []\n    for star in stars:\n        if star['distance'] >= distance_threshold:\n            filtered_star_names.append(star['name'])\n    return filtered_star_names\n", "entry_point": "filter_stars", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12297_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015616", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[1, 1, 2, 2, 3], 2", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015617", "code": "from typing import List\ndef split_list(lst: List[int], n: int) -> List[List[int]]:\n    if n == 1:\n        return [lst]\n    output = [[] for _ in range(n)]\n    for i, num in enumerate(lst):\n        output[i % n].append(num)\n    return output\n", "entry_point": "split_list", "input": "[8, 6, 2, 7, 3, 51, 6, 2, 6], 1", "output": "[[8, 6, 2, 7, 3, 51, 6, 2, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21886_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015618", "code": "def sum_of_multiples(N):\n    total_sum = 0\n    for num in range(1, N):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68043_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015619", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[1, 5, 3, 3, 3, 3, 4, 4, 2]", "output": "[5, 3, 3, 3, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015620", "code": "from collections import Counter\ndef find_extra_char(s: str, t: str) -> str:\n    counter_s = Counter(s)\n    for ch in t:\n        if ch not in counter_s or counter_s[ch] == 0:\n            return ch\n        else:\n            counter_s[ch] -= 1\n", "entry_point": "find_extra_char", "input": "'abc', 'abcd'", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136434_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015621", "code": "def map_files_to_paths(file_paths, root_dir):\n    file_dict = {}\n    for file_path in file_paths:\n        file_name = file_path.replace(root_dir + \"/\", \"\")\n        file_name_without_ext = file_name.split(\".\")[0]\n        if file_name_without_ext not in file_dict:\n            file_dict[file_name_without_ext] = file_path\n        else:\n            file_dict[file_name] = file_dict.pop(file_name_without_ext)  # Include extension for duplicate filenames\n    return file_dict\n", "entry_point": "map_files_to_paths", "input": "[], '/some/root/dir'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136035_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015622", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "110804", "output": "55402", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015623", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'542'", "output": "'542 542'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015624", "code": "def determine_client_type(client_id: str) -> str:\n    client_number = int(client_id.split('-')[-1])\n    if client_number < 100:\n        return \"OLD1-\" + str(client_number)\n    elif 100 <= client_number < 1000:\n        return \"OLD2-\" + str(client_number)\n    else:\n        return \"OLD3-\" + str(client_number)\n", "entry_point": "determine_client_type", "input": "'client-200'", "output": "'OLD2-200'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46850_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5787", "output": "{1, 3, 643, 1929, 9, 5787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015626", "code": "from typing import List, Dict\ndef splitByPhrases(lines: List[str]) -> Dict[int, List[str]]:\n    newLines = {}\n    idx = 0\n    for line in lines:\n        phrases = line.split('.')\n        newLines[idx] = [phrase.strip() for phrase in phrases if phrase.strip()]\n        idx += 1\n    return newLines\n", "entry_point": "splitByPhrases", "input": "[\"I'm Hello. s\"]", "output": "{0: [\"I'm Hello\", 's']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112268_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5638", "output": "{1, 2, 2819, 5638}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015628", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'language.'", "output": "'Language'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1136", "output": "{1, 2, 4, 71, 8, 142, 1136, 16, 568, 284}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1135", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015630", "code": "def generate_service_fields_map(COMPOSE_SERVICES, FIELDS):\n    service_fields_map = {}\n    for i in range(len(COMPOSE_SERVICES)):\n        service_fields_map[COMPOSE_SERVICES[i]] = FIELDS[i]\n    return service_fields_map\n", "entry_point": "generate_service_fields_map", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55009_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015631", "code": "def find_pairs_sum_to_target(nums, target):\n    seen = {}\n    pairs = []\n    for num in nums:\n        diff = target - num\n        if diff in seen:\n            pairs.append([num, diff])\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs_sum_to_target", "input": "[2, 5, 8], 10", "output": "[[8, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23906_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015632", "code": "def find_unique_inode(file_inodes):\n    unique_inode = 0\n    for inode in file_inodes:\n        unique_inode ^= inode\n    return unique_inode\n", "entry_point": "find_unique_inode", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61857_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015633", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 87, 86, 85, 85]", "output": "[92, 87, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015634", "code": "def modify_file_names(file_names):\n    modified_file_names = []\n    for file_name in file_names:\n        if file_name.endswith('.pyc'):\n            modified_file_names.append(file_name[:-3] + 'py')\n        else:\n            modified_file_names.append(file_name)\n    return modified_file_names\n", "entry_point": "modify_file_names", "input": "['scipt3.c']", "output": "['scipt3.c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66010_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015635", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[1, 2, 3, 4]", "output": "[1, 4, 9, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015636", "code": "def count_lines_of_code(files):\n    author_lines = {}\n    for file_data in files:\n        author = file_data.get('author')\n        content = file_data.get('content')\n        lines = content.split('\\n')\n        author_lines[author] = author_lines.get(author, 0) + len(lines)\n    return author_lines\n", "entry_point": "count_lines_of_code", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69159_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015637", "code": "import re\nDATE_RE = re.compile(r\"[0-9]{4}-[0-9]{2}-[0-9]{2}\")\nINVALID_IN_NAME_RE = re.compile(\"[^a-z0-9_]\")\ndef process_input(input_str):\n    # Check if input matches the date format pattern\n    is_date = bool(DATE_RE.match(input_str))\n    # Remove specific suffix if it exists\n    processed_str = input_str\n    if input_str.endswith(\"T00:00:00.000+00:00\"):\n        processed_str = input_str[:-19]\n    # Check for invalid characters based on the pattern\n    has_invalid_chars = bool(INVALID_IN_NAME_RE.search(input_str))\n    return (is_date, processed_str, has_invalid_chars)\n", "entry_point": "process_input", "input": "'2022-1200000:0_AB13'", "output": "(False, '2022-1200000:0_AB13', True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49598_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015638", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1137", "output": "{379, 1, 3, 1137}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015639", "code": "def calculate_sign(num):\n    if num < 0:\n        return -1\n    elif num > 0:\n        return 1\n    else:\n        return 0\n", "entry_point": "calculate_sign", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104894_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015640", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j - 1], dp[i][j - 1], dp[i - 1][j]) + 1\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcdefg', ''", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83349_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015641", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[3, 5, 7, 11, 13]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48394_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015642", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5866", "output": "{1, 2, 419, 838, 7, 5866, 14, 2933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015643", "code": "import os\ndef find_zip_or_egg_index(filename):\n    normalized_path = os.path.normpath(filename)\n    zip_index = normalized_path.find('.zip')\n    egg_index = normalized_path.find('.egg')\n    if zip_index != -1 and egg_index != -1:\n        return min(zip_index, egg_index)\n    elif zip_index != -1:\n        return zip_index\n    elif egg_index != -1:\n        return egg_index\n    else:\n        return -1\n", "entry_point": "find_zip_or_egg_index", "input": "'abcdefghijk.zip'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_581_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015644", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015645", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[5, 5, 2, 10, 1, 5, 10, 5]", "output": "[1, 2, 5, 5, 5, 5, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015646", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "613", "output": "{1, 613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015647", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015648", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7385", "output": "{1, 35, 1477, 5, 7, 211, 7385, 1055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "829", "output": "{1, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015650", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[-3, -9, 8, 4, 8, 1, -9]", "output": "[-27, -729, 64, 16, 64, 1, -729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015651", "code": "def count_words_with_a(description):\n    # Split the description into individual words\n    words = description.split()\n    # Initialize a counter for words containing 'a'\n    count = 0\n    # Iterate through each word and check for 'a'\n    for word in words:\n        if 'a' in word.lower():  # Case-insensitive check for 'a'\n            count += 1\n    return count\n", "entry_point": "count_words_with_a", "input": "'cat dog'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27946_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015652", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "10", "output": "'buzz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015653", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'12.345/67.890'", "output": "('12.345', '67.890')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015654", "code": "def evaluate_hyperparameters(model_name, hyperparameters):\n    if hyperparameters.get(\"learning_rate\") == 0.1 and \\\n       hyperparameters.get(\"hidden_size\") == 200 and \\\n       0 <= hyperparameters.get(\"epochs\") <= 10:\n        return True\n    return False\n", "entry_point": "evaluate_hyperparameters", "input": "'model_name', {'learning_rate': 0.0, 'hidden_size': 100, 'epochs': 5}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64171_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015655", "code": "import re\ndef is_valid_help_summary(help_summary):\n    # Check if the help summary starts with \"Prune\"\n    if not help_summary.startswith(\"Prune\"):\n        return False\n    # Extract the description enclosed in parentheses\n    description = re.search(r'\\((.*?)\\)', help_summary)\n    if not description:\n        return False\n    # Check if the help summary ends with the specific help usage pattern\n    if not help_summary.endswith(f\"\\nhelpUsage = \\\"\\\"\\\"\\n\"):\n        return False\n    return True\n", "entry_point": "is_valid_help_summary", "input": "'Help (This is a description)\\nhelpUsage = \"\"\"\\n'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69768_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015656", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JoJJ', 'DoSmithht', 'aMrM'", "output": "'JoJJ aMrM DoSmithht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015657", "code": "def calculate_polygon_area(vertices):\n    n = len(vertices)\n    area = 0.5 * abs(sum(vertices[i][0] * vertices[(i + 1) % n][1] for i in range(n))\n                     - sum(vertices[i][1] * vertices[(i + 1) % n][0] for i in range(n)))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (2, 0), (2, 2), (0, 2)]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22232_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015658", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[7, 3, 7]", "output": "[7, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015659", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "9", "output": "'SDL_LOG_CATEGORY_RESERVED1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015660", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "{'CONF_NUMBER': 6}", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015661", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'Parerr', 'hphhphpphp'", "output": "'Parerr.hphhphpphp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015662", "code": "def calculate_result(model_type, value):\n    dismodfun = {\n        'RDD': 'RDD',\n        'RRDD-E': 'RRDD',\n        'RRDD-R': 'RRDD',\n    }\n    if model_type in dismodfun:\n        if model_type == 'RDD':\n            return value ** 2\n        elif model_type == 'RRDD-E':\n            return value * 2\n        elif model_type == 'RRDD-R':\n            return value ** 3\n    else:\n        return 'Invalid model type'\n", "entry_point": "calculate_result", "input": "'RDD', 3.0", "output": "9.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83607_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2889", "output": "{1, 321, 3, 963, 2889, 9, 107, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015664", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3197", "output": "{1, 139, 3197, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3196", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015665", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'double_value_'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015666", "code": "def calculate_revenue(transactions):\n    total_revenue = 0.0\n    for transaction in transactions:\n        if 'refund' not in transaction['product']:\n            total_revenue += transaction['amount']\n    return total_revenue\n", "entry_point": "calculate_revenue", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23351_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015667", "code": "from typing import List, Union, Any\ndef count_unique_integers(input_list: List[Union[int, Any]]) -> int:\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[1, 2, 3, 'hello', 4.5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134437_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015668", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "795", "output": "{1, 3, 5, 265, 15, 53, 795, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt794", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015669", "code": "from typing import List, Tuple\nfrom numbers import Real\ndef find_unique_pairs(numbers: List[Real], target: Real) -> List[Tuple[Real, Real]]:\n    unique_pairs = set()\n    complements = set()\n    for num in numbers:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[1, 2], 3", "output": "[(1, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128394_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015670", "code": "def mastermind(secret_code, guesses):\n    feedback = []\n    for guess in guesses:\n        black_pegs = sum(1 for i in range(len(secret_code)) if secret_code[i] == guess[i])\n        white_pegs = sum(min(secret_code.count(color), guess.count(color)) for color in set(secret_code))\n        white_pegs -= black_pegs\n        feedback.append((black_pegs, white_pegs))\n    return feedback\n", "entry_point": "mastermind", "input": "'ABCD', []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66835_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015671", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2792", "output": "{1, 2, 4, 2792, 8, 1396, 698, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2791", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015672", "code": "import math\ndef calculate_quadratic_roots(term_matrix):\n    if len(term_matrix) == 2:\n        a, b, c = term_matrix[0][0], 0, 0\n    elif len(term_matrix) == 3:\n        a, b, c = term_matrix[0][0], term_matrix[1][0], 0\n    else:\n        a, b, c = term_matrix[0][0], term_matrix[1][0], term_matrix[2][0]\n    discriminant = b**2 - 4*a*c\n    if discriminant > 0:\n        root1 = (-b + math.sqrt(discriminant)) / (2*a)\n        root2 = (-b - math.sqrt(discriminant)) / (2*a)\n        return root1, root2\n    elif discriminant == 0:\n        root = -b / (2*a)\n        return root\n    else:\n        real_part = -b / (2*a)\n        imaginary_part = math.sqrt(abs(discriminant)) / (2*a)\n        return complex(real_part, imaginary_part), complex(real_part, -imaginary_part)\n", "entry_point": "calculate_quadratic_roots", "input": "[[1], [-3], [0]]", "output": "(3.0, 0.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015673", "code": "def convert_time_interval(minutes):\n    time_intervals = {\n        1: '1m',\n        3: '3m',\n        5: '5m',\n        15: '15m',\n        30: '30m',\n        60: '1h',\n        120: '2h',\n        240: '4h',\n        360: '6h',\n        480: '8h',\n        720: '12h',\n        1440: '1d',\n        4320: '3d',\n        10080: '1w',\n        43200: '1M'\n    }\n    if minutes in time_intervals:\n        return time_intervals[minutes]\n    else:\n        return \"Invalid time interval\"\n", "entry_point": "convert_time_interval", "input": "30", "output": "'30m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142859_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015674", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015675", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[5, 1, 3, 4, 2, 8]", "output": "[1, 2, 3, 4, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015676", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[9, 1, 10]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015677", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "992", "output": "{992, 1, 2, 32, 4, 8, 496, 16, 248, 124, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt991", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015678", "code": "def count_severities(severity_str):\n    severities = {}\n    for severity in severity_str.split(','):\n        severity = severity.strip()  # Remove leading and trailing spaces\n        if severity in severities:\n            severities[severity] += 1\n        else:\n            severities[severity] = 1\n    return severities\n", "entry_point": "count_severities", "input": "'Critical, HiLow, uCicalal'", "output": "{'Critical': 1, 'HiLow': 1, 'uCicalal': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5726_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015679", "code": "def generate_identifier(input_string):\n    char_count = {}\n    for char in input_string:\n        if char not in char_count:\n            char_count[char] = 1\n        else:\n            char_count[char] += 1\n    sorted_char_count = dict(sorted(char_count.items()))\n    identifier = ''.join(str(ord(char)) for char in sorted_char_count.keys())\n    return int(identifier)\n", "entry_point": "generate_identifier", "input": "'o'", "output": "111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73073_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015680", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[90, 75, 100]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015681", "code": "from typing import List\ndef count_odd_cells(n: int, m: int, indices: List[List[int]]) -> int:\n    row = [0] * n\n    col = [0] * m\n    ans = 0\n    for r, c in indices:\n        row[r] += 1\n        col[c] += 1\n    for i in range(n):\n        for j in range(m):\n            ans += (row[i] + col[j]) % 2\n    return ans\n", "entry_point": "count_odd_cells", "input": "3, 3, []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70394_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015682", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'Dooa'", "output": "[('Dooa', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015683", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'ffileifle'", "output": "'ffileifle_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015684", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'any.value.path', '1.22', ''", "output": "'1.22.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015685", "code": "from typing import List\ndef modified_binary_search(arr: List[int], target: int) -> int:\n    low, high = 0, len(arr) - 1\n    result = -1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            result = mid\n            high = mid - 1\n    return result\n", "entry_point": "modified_binary_search", "input": "[1, 2, 3, 6], 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97045_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015686", "code": "def most_common_numbers(data):\n    frequency = {}\n    # Count the frequency of each number\n    for num in data:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    most_common = [num for num, freq in frequency.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[3, 3, 2, 1]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95940_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015687", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "83", "output": "{1, 83}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt82", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "15", "output": "{1, 3, 5, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015689", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9121", "output": "{1, 9121, 1303, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015690", "code": "from typing import List\ndef max_contiguous_sum(lst: List[int]) -> int:\n    max_sum = lst[0]\n    current_sum = lst[0]\n    for num in lst[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_contiguous_sum", "input": "[2, 3, 4, -1, -2]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132431_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015691", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num > 1:\n            for i in range(2, int(num ** 0.5) + 1):\n                if num % i == 0:\n                    return False\n            return True\n        return False\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[3, 37]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145369_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015692", "code": "def consolidate_materials(data):\n    material_totals = {}\n    for entry in data:\n        material = entry['material']\n        amount = entry['amount']\n        if material in material_totals:\n            material_totals[material] += amount\n        else:\n            material_totals[material] = amount\n    return material_totals\n", "entry_point": "consolidate_materials", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30504_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015693", "code": "def replace_value(original_array, value_to_replace, new_value):\n    modified_array = [[new_value if element == value_to_replace else element for element in row] for row in original_array]\n    return modified_array\n", "entry_point": "replace_value", "input": "[[6, 2], [6], [6], [6]], 6, 5", "output": "[[5, 2], [5], [5], [5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148252_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015694", "code": "def count_unique_label_types(text_list, default_list):\n    unique_label_types = {}\n    for text, default in zip(text_list, default_list):\n        if text not in unique_label_types:\n            unique_label_types[text] = default\n    return unique_label_types\n", "entry_point": "count_unique_label_types", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111671_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015695", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3639", "output": "{1, 3, 1213, 3639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015696", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "'og:locale=eS\\n'", "output": "{'og:locale': 'eS'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015697", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[1, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015698", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[6, 9, 10]", "output": "540", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015699", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 0, 1, 3, 1, 2, 4, 0]", "output": "[0, 4, 3, 4, 4, 3, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015700", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'', '/w//w//va/w/imageso'", "output": "'/w//w//va/w/imageso'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015701", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[3, 4, 5]", "output": "([3, 4, 5], 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8044", "output": "{1, 2, 4, 8044, 4022, 2011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8043", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015703", "code": "import string\ndef count_word_occurrences(text):\n    def clean_word(word):\n        return word.strip(string.punctuation).lower()\n    word_counts = {}\n    words = text.split()\n    for word in words:\n        cleaned_word = clean_word(word)\n        if cleaned_word:\n            word_counts[cleaned_word] = word_counts.get(cleaned_word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'sshelwi.'", "output": "{'sshelwi': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4386_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015704", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2 and element not in common_elements:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 4, 8, 3], [8, 4, 2, 6, 7]", "output": "[2, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23619_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015705", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-15", "output": "-51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015706", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[9, 26, 27, 43, 43, 82, 82]", "output": "[9, 26, 27, 43, 43, 82, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015707", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "'http://age'", "output": "'age'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015708", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[8, 8, 7, 5, 2, 2]", "output": "[64, 64, 49, 25, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015709", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[6, 6, 7, 5, 3, 3, 3, 3]", "output": "[6, 6, 7, 5, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015710", "code": "def calculate_metrics(metrics: list) -> dict:\n    total = 0\n    count = 0\n    for metric in metrics:\n        if isinstance(metric, (int, float)):\n            total += metric\n            count += 1\n        elif isinstance(metric, str) and metric.isdigit():\n            total += int(metric)\n            count += 1\n    if count == 0:\n        return {'average': 0, 'count': 0}\n    else:\n        return {'average': total / count, 'count': count}\n", "entry_point": "calculate_metrics", "input": "[1493, 1494, '1497']", "output": "{'average': 1494.6666666666667, 'count': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46209_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015711", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[6, 6, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3844", "output": "{1, 2, 1922, 3844, 4, 961, 124, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3843", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015713", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "1", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015714", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "224", "output": "{224, 1, 2, 32, 4, 7, 8, 14, 112, 16, 56, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt223", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015715", "code": "def decode_order_type(order_type):\n    order_descriptions = {\n        '6': 'Last Plus Two',\n        '7': 'Last Plus Three',\n        '8': 'Sell1',\n        '9': 'Sell1 Plus One',\n        'A': 'Sell1 Plus Two',\n        'B': 'Sell1 Plus Three',\n        'C': 'Buy1',\n        'D': 'Buy1 Plus One',\n        'E': 'Buy1 Plus Two',\n        'F': 'Buy1 Plus Three',\n        'G': 'Five Level',\n        '0': 'Buy',\n        '1': 'Sell',\n        '0': 'Insert',\n        '1': 'Cancel'\n    }\n    price_type = order_type[0]\n    direction = order_type[1]\n    submit_status = order_type[2]\n    description = order_descriptions.get(price_type, 'Unknown') + ' ' + order_descriptions.get(direction, 'Unknown') + ' ' + order_descriptions.get(submit_status, 'Unknown')\n    return description\n", "entry_point": "decode_order_type", "input": "'CFF'", "output": "'Buy1 Buy1 Plus Three Buy1 Plus Three'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95855_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015716", "code": "def count_word_occurrences(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Tokenize the text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the counts\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_occurrences", "input": "'word,python'", "output": "{'word,python': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52489_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3103", "output": "{1, 107, 29, 3103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015718", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 4.0, 1.0", "output": "4.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015719", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "12, 4", "output": "'30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015720", "code": "def process_info(input_string):\n    char_count = {}\n    for char in input_string:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    return char_count\n", "entry_point": "process_info", "input": "'ww'", "output": "{'w': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28397_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015721", "code": "def custom_split(data, delimiters):\n    result = []\n    current_substring = \"\"\n    for char in data:\n        if char in delimiters:\n            if current_substring:\n                result.append(current_substring)\n                current_substring = \"\"\n        else:\n            current_substring += char\n    if current_substring:\n        result.append(current_substring)\n    return result\n", "entry_point": "custom_split", "input": "'apple bapana cherrorange', ' '", "output": "['apple', 'bapana', 'cherrorange']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10049_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015722", "code": "def get_error_description(error_code):\n    error_codes = {\n        70: \"File write error\",\n        80: \"File too big to upload\",\n        90: \"Failed to create local directory\",\n        100: \"Failed to create local file\",\n        110: \"Failed to delete directory\",\n        120: \"Failed to delete file\",\n        130: \"File not found\",\n        140: \"Maximum retry limit reached\",\n        150: \"Request failed\",\n        160: \"Cache not loaded\",\n        170: \"Migration failed\",\n        180: \"Download certificates error\",\n        190: \"User rejected\",\n        200: \"Update needed\",\n        210: \"Skipped\"\n    }\n    return error_codes.get(error_code, \"Unknown Error\")\n", "entry_point": "get_error_description", "input": "130", "output": "'File not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66002_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6824", "output": "{1, 2, 4, 6824, 8, 1706, 3412, 853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6823", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3199", "output": "{1, 7, 457, 3199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015725", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[2, 3, 4, 5]", "output": "[6, 8, 10, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015726", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(16, 18, 17)", "output": "'#101211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015727", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'hello', 'abcdefghello'", "output": "(7, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015728", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "4, 46.0", "output": "184", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015729", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[9, 9, 9, 8, 4, 4, 2]", "output": "[81, 81, 81, 64, 16, 16, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015730", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9682", "output": "{1, 2, 103, 4841, 206, 47, 9682, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015731", "code": "import os\ndef process_samples(sample_files):\n    if not isinstance(sample_files, list) or len(sample_files) == 0:\n        return \"Invalid input\"\n    n = len(sample_files)\n    if n != 1 and n != 2:\n        return \"Input must have 1 (single-end) or 2 (paired-end) elements.\"\n    readcmd = '--readFilesCommand gunzip -c' if sample_files[0].endswith('.gz') else ''\n    outprefix = os.path.dirname(sample_files[0]) + '/'\n    return readcmd, outprefix\n", "entry_point": "process_samples", "input": "['/some/directory/sample_file.txt']", "output": "('', '/some/directory/')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77400_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015732", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[8, 2, 3, 14, 10, 2, 4]", "output": "[10, 4, 4, 16, 12, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45782_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015733", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[0, 5, 8, 9]", "output": "[0, 10, 16, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015734", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/directory/some-lpden.txt'", "output": "'some-lpden'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015735", "code": "import re\ndef validate_network_address(address, schema):\n    if schema.get('type') == 'string' and 'pattern' in schema:\n        pattern = schema['pattern']\n        if re.match(pattern, address):\n            return True\n    return False\n", "entry_point": "validate_network_address", "input": "'any_string', {'type': 'string'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117902_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015736", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_evens", "input": "[14, 8, 6]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26745_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1181", "output": "{1, 1181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015738", "code": "def get_enabled_backends(backends):\n    enabled_backends = [backend for backend, enabled in backends.items() if enabled]\n    return enabled_backends\n", "entry_point": "get_enabled_backends", "input": "{'backend1': False, 'backend2': False}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75336_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015739", "code": "def maximum_product(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[1, 2, 4]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38245_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015740", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'helrld exaple'", "output": "['helrld', 'exaple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015741", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[1, 2, 4, 6]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "968", "output": "{1, 2, 484, 4, 968, 8, 11, 44, 242, 22, 88, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt967", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015743", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'rSmith', 6", "output": "'rSmith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015744", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'e*ee'", "output": "['e', 'ee']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3523", "output": "{1, 3523, 13, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015746", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'Please'", "output": "'Please'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015747", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'2.15'", "output": "(2, 15)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015748", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "7", "output": "[0, 1, 1, 1, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015749", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'set bba,y'", "output": "'bba,y'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2797", "output": "{1, 2797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015751", "code": "def calculate_dot_product(A, B):\n    if len(A) != len(B):\n        raise ValueError(\"Arrays must be of the same length\")\n    dot_product = sum(a * b for a, b in zip(A, B))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 1, 1, 1, 1, 1], [20, 20, 20, 20, 20, 19]", "output": "119", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105699_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9332", "output": "{1, 2, 4, 9332, 4666, 2333}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9331", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015753", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[0, -3, 1, 3, -2, -1, 1]", "output": "[-3, 4, 2, -5, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015754", "code": "def process_data(filter_logs, sequential_data):\n    # Process filter logs\n    filtered_logs = [line for line in filter_logs.split('\\n') if 'ERROR' not in line]\n    # Check for sequence in sequential data\n    sequence_exists = False\n    sequential_lines = sequential_data.split('\\n')\n    for i in range(len(sequential_lines) - 2):\n        if sequential_lines[i] == 'a start point' and sequential_lines[i + 1] == 'leads to' and sequential_lines[i + 2] == 'an ending':\n            sequence_exists = True\n            break\n    return (filtered_logs, sequence_exists)\n", "entry_point": "process_data", "input": "'ERblahO', 'a start point\\nnot leads to\\nan ending'", "output": "(['ERblahO'], False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27152_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015755", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#FF0000'", "output": "(255, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015756", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "548", "output": "{1, 2, 548, 4, 137, 274}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt547", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015757", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[10, 5, 9], 9", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015758", "code": "def calculate_similarity(v1, v2, cost_factor):\n    similarity_score = 0\n    for val1, val2 in zip(v1, v2):\n        dot_product = val1 * val2\n        cost = abs(val1 - val2)\n        similarity_score += dot_product * cost_factor * cost\n    return similarity_score\n", "entry_point": "calculate_similarity", "input": "[3, 4], [5, 6], 7", "output": "546", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115100_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015759", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-3, -1, -8, -3, -6, 9, 10, 9, 10]", "output": "[-8, -6, -3, -3, -1, 9, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015760", "code": "from typing import Any\ndef get_value_from_config(config: dict, key: str) -> Any:\n    keys = key.split('.')\n    def recursive_get_value(curr_dict, keys):\n        if not keys:\n            return curr_dict\n        current_key = keys.pop(0)\n        if current_key in curr_dict:\n            return recursive_get_value(curr_dict[current_key], keys)\n        else:\n            return None\n    result = recursive_get_value(config, keys)\n    return result if result is not None else \"Key not found\"\n", "entry_point": "get_value_from_config", "input": "{'x': {'y': 42}}, 'a.b.c'", "output": "'Key not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136155_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015761", "code": "def determine_security_level(security_settings):\n    if not security_settings:\n        return \"Low\"\n    if any(value is False for value in security_settings.values()):\n        return \"Medium\"\n    return \"High\"\n", "entry_point": "determine_security_level", "input": "{}", "output": "'Low'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14607_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015762", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4679", "output": "{1, 4679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015763", "code": "def process_commands(input_str):\n    running_total = 0\n    commands = input_str.split()\n    for command in commands:\n        op = command[0]\n        if len(command) > 1:\n            num = int(command[1:])\n        else:\n            num = 0\n        if op == 'A':\n            running_total += num\n        elif op == 'S':\n            running_total -= num\n        elif op == 'M':\n            running_total *= num\n        elif op == 'D' and num != 0:\n            running_total //= num\n        elif op == 'R':\n            running_total = 0\n    return running_total\n", "entry_point": "process_commands", "input": "'A10'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106417_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015764", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5671", "output": "{1, 107, 53, 5671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015765", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'setesteaId'", "output": "{'setesteaId': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015766", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "345", "output": "{1, 3, 5, 69, 15, 115, 23, 345}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015767", "code": "def validate_language_data(s):\n    for sample in s.values():\n        if len(sample) != 5:\n            return False\n        if abs(sample[3] - 3.63223180795) > 0:\n            return False\n        if abs(sample[4] - 1.289847282477176) > 1:\n            return False\n    return True\n", "entry_point": "validate_language_data", "input": "{'sample1': [0, 0, 0, 3.63223180795, 1.5]}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81116_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015768", "code": "def sum_manhattan_distances(points):\n    n = len(points)\n    xx = [point[0] for point in points]\n    yy = [point[1] for point in points]\n    xx.sort()\n    yy.sort()\n    ax = 0\n    ay = 0\n    cx = 0\n    cy = 0\n    for i in range(n):\n        ax += xx[i] * i - cx\n        cx += xx[i]\n        ay += yy[i] * i - cy\n        cy += yy[i]\n    return ax + ay\n", "entry_point": "sum_manhattan_distances", "input": "[(0, 0), (0, 0), (0, 0)]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65537_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015769", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6437", "output": "{1, 6437, 157, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015770", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'CC(=O)OCC(=O)O'", "output": "'CC(=O)OCC(=O)O'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015771", "code": "def rusher_wpbf(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "rusher_wpbf", "input": "[3, 3, 1, 4]", "output": "[6, 4, 5, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138675_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015772", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'11.1'", "output": "(11, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015773", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[3, 3, 0, 1, 4, 1, 0, 5, 4]", "output": "[6, 3, 1, 5, 5, 1, 5, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117452_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015774", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8482", "output": "{1, 8482, 2, 4241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8481", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015775", "code": "def longest_consecutive_subsequence(lst):\n    if not lst:\n        return []\n    lst.sort()\n    current_subsequence = [lst[0]]\n    longest_subsequence = []\n    for i in range(1, len(lst)):\n        if lst[i] == current_subsequence[-1] + 1:\n            current_subsequence.append(lst[i])\n        else:\n            if len(current_subsequence) > len(longest_subsequence):\n                longest_subsequence = current_subsequence\n            current_subsequence = [lst[i]]\n    if len(current_subsequence) > len(longest_subsequence):\n        longest_subsequence = current_subsequence\n    return longest_subsequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[7, 8]", "output": "[7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16310_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015776", "code": "def largest_rectangle_area(height):\n    stack = []\n    max_area = 0\n    height.append(0)  # Append a zero height bar to handle the case when all bars are in increasing order\n    for i in range(len(height)):\n        while stack and height[i] < height[stack[-1]]:\n            h = height[stack.pop()]\n            w = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, h * w)\n        stack.append(i)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95511_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015777", "code": "from typing import Set\ndef find_palindromes(english_words: Set[str]) -> Set[str]:\n    def is_palindrome(word: str) -> bool:\n        word = ''.join(char for char in word if char.isalpha()).lower()\n        return word == word[::-1]\n    palindromes = set()\n    for word in english_words:\n        if is_palindrome(word):\n            palindromes.add(word)\n    return palindromes\n", "entry_point": "find_palindromes", "input": "set()", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119213_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015778", "code": "def calculate_similarity(fingerprint1, fingerprint2):\n    intersection = fingerprint1.intersection(fingerprint2)\n    union = fingerprint1.union(fingerprint2)\n    if len(union) == 0:\n        return 0.0\n    else:\n        return len(intersection) / len(union)\n", "entry_point": "calculate_similarity", "input": "{1}, {1, 2, 3}", "output": "0.3333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78329_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015779", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "0.0452864, 2.0", "output": "1.0452864", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015780", "code": "def find_twice_chars(input_str):\n    char_count = {}\n    result = []\n    for char in input_str:\n        char_count[char] = char_count.get(char, 0) + 1\n        if char_count[char] == 2:\n            result.append(char)\n    return result\n", "entry_point": "find_twice_chars", "input": "'helloheell'", "output": "['l', 'h', 'e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135967_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015781", "code": "def generate_default_dict(keys, default_value):\n    result_dict = {}\n    for key in keys:\n        result_dict[key] = default_value\n    return result_dict\n", "entry_point": "generate_default_dict", "input": "[], None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91901_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7637", "output": "{1, 1091, 7637, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015783", "code": "def digitDifferenceSort(a):\n    def dg(n):\n        s = list(map(int, str(n)))\n        return max(s) - min(s)\n    ans = [(a[i], i) for i in range(len(a))]\n    A = sorted(ans, key=lambda x: (dg(x[0]), -x[1]))\n    return [c[0] for c in A]\n", "entry_point": "digitDifferenceSort", "input": "[888, 22, 23, 886, 22, 888]", "output": "[888, 22, 22, 888, 23, 886]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132098_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015784", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'rotation_vector'", "output": "'Value of rotation_vector'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015785", "code": "def longest_increasing_sequence(years):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    max_start_index = 0\n    for i in range(1, len(years)):\n        if years[i] > years[i - 1]:\n            current_length += 1\n            if current_length > max_length:\n                max_length = current_length\n                max_start_index = start_index\n        else:\n            current_length = 1\n            start_index = i\n    return years[max_start_index], max_length\n", "entry_point": "longest_increasing_sequence", "input": "[1988, 1989]", "output": "(1988, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87635_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015786", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 0, 2, 3, 7, 7, 7, 2]", "output": "[3, 1, 4, 6, 11, 12, 13, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015787", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1691", "output": "{19, 1, 1691, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3537", "output": "{1, 3, 131, 27, 9, 393, 3537, 1179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8378", "output": "{1, 2, 71, 142, 118, 8378, 59, 4189}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8377", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015790", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'abcdefgh', 'ijklmnop'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015791", "code": "def process_string(input_string):\n    if \"apple\" in input_string:\n        input_string = input_string.replace(\"apple\", \"orange\")\n    if \"banana\" in input_string:\n        input_string = input_string.replace(\"banana\", \"\")\n    if \"cherry\" in input_string:\n        input_string = input_string.replace(\"cherry\", \"CHERRY\")\n    return input_string\n", "entry_point": "process_string", "input": "'bananaI'", "output": "'I'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133930_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015792", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5159", "output": "{1, 737, 67, 7, 5159, 11, 77, 469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5158", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015793", "code": "def map_dataset_subset(dataset_name):\n    if dataset_name == \"train\":\n        return \"train_known\"\n    elif dataset_name == \"val\":\n        return \"train_unseen\"\n    elif dataset_name == \"test\":\n        return \"test_known\"\n    else:\n        return \"Invalid dataset subset name provided.\"\n", "entry_point": "map_dataset_subset", "input": "'train'", "output": "'train_known'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39576_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015794", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[2, 2, 2, 2, 2, 2, 2, 1, 1]", "output": "{2: 7, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015795", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[40, 91, 55, 40, 55]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015796", "code": "def deep_camel_case_transform(data):\n    if isinstance(data, dict):\n        camelized_data = {}\n        for key, value in data.items():\n            new_key = key.replace('_', ' ').title().replace(' ', '')\n            camelized_data[new_key] = deep_camel_case_transform(value)\n        return camelized_data\n    elif isinstance(data, list):\n        return [deep_camel_case_transform(item) for item in data]\n    else:\n        return data\n", "entry_point": "deep_camel_case_transform", "input": "'John'", "output": "'John'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50306_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015797", "code": "from collections import defaultdict\ndef topological_sort(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    # Build the graph and calculate in-degrees\n    for dep in dependencies:\n        graph[dep[1]].append(dep[0])\n        in_degree[dep[0]] += 1\n    # Initialize a queue with nodes having in-degree 0\n    queue = [node for node in graph if in_degree[node] == 0]\n    result = []\n    # Perform topological sort\n    while queue:\n        node = queue.pop(0)\n        result.append(node)\n        for neighbor in graph[node]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    return result if len(result) == len(graph) else []\n", "entry_point": "topological_sort", "input": "[('a', 'b'), ('b', 'c'), ('c', 'd')]", "output": "['d', 'c', 'b', 'a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48656_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015798", "code": "def get_string(key: str, strings: dict) -> str:\n    fallback_string = 'A fallback string'\n    if key in strings:\n        return strings[key]\n    else:\n        return fallback_string\n", "entry_point": "get_string", "input": "'non_existent_key', {}", "output": "'A fallback string'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100209_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015799", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015800", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/home/ume/', 'e/exaexatt'", "output": "'/home/ume//e/exaexatt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015801", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'de'", "output": "'de'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015802", "code": "def convert_currency(fr, to, value):\n    exchange_rates = {\n        'USD_EUR': 0.85,\n        'EUR_USD': 1.18,\n        # Add more exchange rates as needed\n    }\n    currency_pair = f'{fr}_{to}'\n    if currency_pair in exchange_rates:\n        exchange_rate = exchange_rates[currency_pair]\n        converted_value = float(value) * exchange_rate\n        return converted_value\n    else:\n        return None  # Return None if exchange rate not available for the specified currency pair\n", "entry_point": "convert_currency", "input": "'USD', 'EUR', 100.0", "output": "85.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115617_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015803", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[14, 7, 5, 15, 14, 14, 15, 14]", "output": "[5, 7, 14, 14, 14, 14, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015804", "code": "def parse_migration_operations(operations):\n    field_info = {}\n    for operation in operations:\n        model_name = operation['name']\n        fields = operation['fields']\n        for field in fields:\n            field_name, field_type, help_text, required, unique = field\n            field_info[field_name] = {\n                'type': field_type,\n                'help_text': help_text,\n                'required': required,\n                'unique': unique\n            }\n    return field_info\n", "entry_point": "parse_migration_operations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18281_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015805", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[0, 0, 0, 56], [0, 0, 0, 0]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70247_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015806", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "50, 2", "output": "1225", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1019", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015807", "code": "def generate_sequence(n):\n    if n <= 0:\n        return \"\"\n    sequence = \"A\"\n    current_char = \"A\"\n    for _ in range(n - 1):\n        if current_char == \"A\":\n            sequence += \"B\"\n            current_char = \"B\"\n        else:\n            sequence += \"AA\"\n            current_char = \"A\"\n    return sequence\n", "entry_point": "generate_sequence", "input": "12", "output": "'ABAABAABAABAABAAB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61941_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015808", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'1011'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015809", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[6, 6]", "output": "[6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt47", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015810", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/tmp', '/var/wwww/w/imageim/igmlo'", "output": "'/var/wwww/w/imageim/igmlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015811", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[1, 3, 5], [0, 3, 15]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126506_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3823", "output": "{1, 3823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015813", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[2, 2, 2]", "output": "[4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015814", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average excluding highest and lowest.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 87, 89, 90, 95]", "output": "88.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66758_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015815", "code": "def update_config(config: dict) -> dict:\n    updated_config = config.copy()  # Create a copy of the input config\n    # Update the 'task' key from 'PoseDetection' to 'ObjectDetection'\n    updated_config['task'] = 'ObjectDetection'\n    # Add a new key-value pair 'model': 'YOLOv5'\n    updated_config['model'] = 'YOLOv5'\n    return updated_config\n", "entry_point": "update_config", "input": "{}", "output": "{'task': 'ObjectDetection', 'model': 'YOLOv5'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98665_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015816", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9279", "output": "{1, 3, 1031, 9, 3093, 9279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015817", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2]", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015818", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4586", "output": "{1, 4586, 2, 2293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015819", "code": "def ascii_cipher(message, key):\n    def is_prime(n):\n        if n < 2:\n            return False\n        return all(n % i != 0 for i in range(2, round(pow(n, 0.5)) + 1) ) or n == 2\n    pfactor = max(i for i in range(2, abs(key) + 1) if is_prime(i) and key % i == 0) * (-1 if key < 0 else 1)\n    encrypted_message = ''.join(chr((ord(c) + pfactor) % 128) for c in message)\n    return encrypted_message\n", "entry_point": "ascii_cipher", "input": "'l)', 5", "output": "'q.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44495_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015820", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[5, 1, 1, 4, -1, 0, 0]", "output": "[5, 1, 4, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015821", "code": "def extract_config_info(config):\n    generator_info = config.get(\"generator\", {})\n    input_cse_enabled = generator_info.get(\"input_cse\", False)\n    loss_info = config.get(\"loss\", {})\n    gan_criterion_type = loss_info.get(\"gan_criterion\", {}).get(\"type\", \"\")\n    seg_weight = loss_info.get(\"gan_criterion\", {}).get(\"seg_weight\", 0.0)\n    return input_cse_enabled, gan_criterion_type, seg_weight\n", "entry_point": "extract_config_info", "input": "{'generator': {}, 'loss': {}}", "output": "(False, '', 0.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16194_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015822", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "-2.8000000000000003, -1", "output": "2.8000000000000003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015823", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'roc_a'", "output": "'roc_a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015824", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'   multiline\\n'", "output": "'multiline\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015825", "code": "def calculate_total_hunger(food_items):\n    food_hunger_dict = {}\n    for food, hunger in food_items:\n        if food in food_hunger_dict:\n            food_hunger_dict[food] += hunger\n        else:\n            food_hunger_dict[food] = hunger\n    total_hunger = sum(food_hunger_dict.values())\n    return total_hunger\n", "entry_point": "calculate_total_hunger", "input": "[('apple', 5), ('banana', 5)]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25226_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015826", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'1.12.1L-10'", "output": "'1.12.1L'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015827", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[1, 4, 1, 0, 0, 0, 0], 2", "output": "[5, 5, 1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9011", "output": "{1, 9011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9169", "output": "{1, 9169, 53, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7109", "output": "{1, 7109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7108", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "73", "output": "{73, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt72", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015832", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9746", "output": "{1, 2, 4873, 11, 9746, 886, 22, 443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015833", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'  W!o@r#l$d  '", "output": "'World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015834", "code": "def split_list(x, n):\n    x = list(x)\n    if n < 2:\n        return [x]\n    def gen():\n        m = len(x) / n\n        i = 0\n        for _ in range(n-1):\n            yield x[int(i):int(i + m)]\n            i += m\n        yield x[int(i):]\n    return list(gen())\n", "entry_point": "split_list", "input": "[8, 2, 6, 4, 6, 2, 9, 6, 3], 8", "output": "[[8], [2], [6], [4], [6], [2], [9], [6, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38553_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015835", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['* 5', '+ 10', '* 4'], 1", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015836", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "6", "output": "132", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015837", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[1, 2, 3, 10], 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015838", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "366", "output": "{1, 2, 3, 6, 366, 183, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015839", "code": "from typing import List\ndef play_card_game(deck: List[int]) -> str:\n    player1_sum = 0\n    player2_sum = 0\n    for i, card in enumerate(deck):\n        if i % 2 == 0:\n            player1_sum += card\n        else:\n            player2_sum += card\n    if player1_sum > player2_sum:\n        return \"Player 1\"\n    elif player2_sum > player1_sum:\n        return \"Player 2\"\n    else:\n        return \"Tie\"\n", "entry_point": "play_card_game", "input": "[1, 3, 2, 4]", "output": "'Player 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47107_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015840", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'pipipin g'", "output": "{'p': 3, 'i': 3, 'n': 1, 'g': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29002_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015841", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5716", "output": "{1, 2, 4, 2858, 5716, 1429}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5715", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "386", "output": "{1, 386, 2, 193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015843", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4506", "output": "{1, 2, 3, 6, 2253, 751, 4506, 1502}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4505", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015844", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "17", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015845", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        circular_sum = input_list[i] + input_list[(i + 1) % list_length]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 4, 7, 3, 3, 2, 7, 5]", "output": "[8, 11, 10, 6, 5, 9, 12, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117423_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015846", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabbbccDDDee'", "output": "'a3b3c2D3e2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015847", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[1, 2, 3, 4]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015848", "code": "def get_long_description_length(package_names):\n    long_descriptions = {\n        \"numpy\": \"Long description for numpy package...\",\n        \"requests\": \"Long description for requests package...\",\n        \"matplotlib\": \"Long description for matplotlib package...\"\n    }\n    package_lengths = {}\n    for package_name in package_names:\n        long_description = long_descriptions.get(package_name, \"\")\n        package_lengths[package_name] = len(long_description)\n    return package_lengths\n", "entry_point": "get_long_description_length", "input": "['ureruets']", "output": "{'ureruets': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48253_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3837", "output": "{1, 3, 3837, 1279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015850", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "5, 20, 100", "output": "[20, 20, 20, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015851", "code": "from typing import List\ndef max_stairs_sum(steps: List[int]) -> int:\n    if not steps:\n        return 0\n    if len(steps) == 1:\n        return steps[0]\n    n1 = steps[0]\n    n2 = steps[1]\n    for i in range(2, len(steps)):\n        t = steps[i] + max(n1, n2)\n        n1, n2 = n2, t\n    return max(n1, n2)\n", "entry_point": "max_stairs_sum", "input": "[8, 6, 4, 2]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100230_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015852", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[6, 6, 6, 6], 6", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015853", "code": "def max_equal_apples(apples):\n    total_apples = sum(apples)\n    if total_apples % len(apples) == 0:\n        return total_apples // len(apples)\n    else:\n        return 0\n", "entry_point": "max_equal_apples", "input": "[1, 2]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66277_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015854", "code": "def generate_combined_paths(paths):\n    def generate_combinations(current_path, remaining_paths, combined_paths):\n        if not remaining_paths:\n            combined_paths.add(current_path)\n            return\n        for path in remaining_paths[0]:\n            new_path = current_path + path\n            generate_combinations(new_path, remaining_paths[1:], combined_paths)\n    combined_paths = set()\n    generate_combinations('', paths, combined_paths)\n    return list(combined_paths)\n", "entry_point": "generate_combined_paths", "input": "[[]]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107434_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015855", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(3, 3, 3)", "output": "'3.3.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015856", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'C:\\\\Users\\\\JooC'", "output": "'C:/Users/JooC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015857", "code": "def weighted_average(values, weights):\n    if len(values) != len(weights):\n        raise ValueError(\"Lengths of values and weights must be the same.\")\n    weighted_sum = sum(value * weight for value, weight in zip(values, weights))\n    sum_weights = sum(weights)\n    return weighted_sum / sum_weights\n", "entry_point": "weighted_average", "input": "[19, 19], [1, 1]", "output": "19.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103808_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015858", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'2.5.0'", "output": "'2.5.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015859", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 11, 12, 13, 14, 15, 5, 25]", "output": "(6, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015860", "code": "def reverse_string_in_special_way(string: str) -> str:\n    string = list(string)\n    left, right = 0, len(string) - 1\n    while left < right:\n        string[left], string[right] = string[right], string[left]\n        left += 1\n        right -= 1\n    return ''.join(string)\n", "entry_point": "reverse_string_in_special_way", "input": "'world'", "output": "'dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21549_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015861", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "15", "output": "[15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015862", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[5, 5, 10], 15", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4939", "output": "{11, 1, 4939, 449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015864", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "98.24999999999999, 10", "output": "982.4999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015865", "code": "def generate_odd_triangle(n):\n    triangle = []\n    start_odd = 1\n    for i in range(1, n + 1):\n        row = [start_odd + 2*j for j in range(i)]\n        triangle.append(row)\n        start_odd += 2*i\n    return triangle\n", "entry_point": "generate_odd_triangle", "input": "3", "output": "[[1], [3, 5], [7, 9, 11]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132299_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015866", "code": "def process_error_strings(error_strings):\n    error_dict = {}\n    for error_str in error_strings:\n        error_code = error_str[error_str.find('{')+1:error_str.find('}')]\n        error_message = error_str.split(' - ')[1]\n        error_dict[error_code] = error_message\n    return error_dict\n", "entry_point": "process_error_strings", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1364_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015867", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'30a330a46'", "output": "'30a330FFFEa46'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015868", "code": "def calculate_average(nums: list) -> float:\n    if len(nums) <= 1:\n        return 0\n    min_val = min(nums)\n    max_val = max(nums)\n    remaining_nums = [num for num in nums if num != min_val and num != max_val]\n    if not remaining_nums:\n        return 0\n    return sum(remaining_nums) / len(remaining_nums)\n", "entry_point": "calculate_average", "input": "[4, 6, 8]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144900_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015869", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "2", "output": "'     2 B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015870", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 3, 3, 5, 2, 4, 3, 5]", "output": "[5, 6, 8, 7, 6, 7, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015871", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{4: []}, 4", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015872", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "20, 1", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015873", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "764", "output": "{1, 2, 4, 764, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt763", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015874", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[80, 89.5, 90]", "output": "89.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015875", "code": "def find_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    complement_sequence = ''\n    for nucleotide in dna_sequence:\n        complement_sequence += complement_dict.get(nucleotide.upper(), '')  # Handle case-insensitive input\n    return complement_sequence\n", "entry_point": "find_complement", "input": "'ACTCG'", "output": "'TGAGC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101417_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015876", "code": "def generate_url(owner, repo, token_auth):\n    return f'{owner}/{repo}/{token_auth}/'\n", "entry_point": "generate_url", "input": "'john_doe', 'my_project', 'abc123'", "output": "'john_doe/my_project/abc123/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8083_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015877", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[[10, 15], [4]]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015878", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'key1=new_value'", "output": "{'key1': 'new_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015879", "code": "def process_markup(text: str) -> str:\n    formatted_text = \"\"\n    stack = []\n    current_text = \"\"\n    for char in text:\n        if char == '[':\n            if current_text:\n                formatted_text += current_text\n                current_text = \"\"\n            stack.append(char)\n        elif char == ']':\n            tag = \"\".join(stack)\n            stack = []\n            if tag == \"[b]\":\n                current_text = f\"<b>{current_text}</b>\"\n            elif tag == \"[r]\":\n                current_text = f\"<span style='color:red'>{current_text}</span>\"\n            elif tag == \"[u]\":\n                current_text = f\"<u>{current_text}</u>\"\n        else:\n            current_text += char\n    formatted_text += current_text\n    return formatted_text\n", "entry_point": "process_markup", "input": "'drWorld/r/'", "output": "'drWorld/r/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63510_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015880", "code": "def generate_feature_names(number_of_gaussians):\n    feature_names = []\n    for i in range(number_of_gaussians):\n        feature_names += [f'mu{i+1}', f'sd{i+1}']\n    for i in range(number_of_gaussians):\n        for j in range(i+1, number_of_gaussians):\n            feature_names.append(f'overlap {i+1}-{j+1}')\n    return feature_names\n", "entry_point": "generate_feature_names", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61755_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015881", "code": "def calculate_chunk_range(selection, chunks):\n    chunk_range = []\n    for s, l in zip(selection, chunks):\n        if isinstance(s, slice):\n            start_chunk = s.start // l\n            end_chunk = (s.stop - 1) // l\n            chunk_range.append(list(range(start_chunk, end_chunk + 1)))\n        else:\n            chunk_range.append([s // l])\n    return chunk_range\n", "entry_point": "calculate_chunk_range", "input": "[slice(0, 4), 5], [1, 5]", "output": "[[0, 1, 2, 3], [1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128291_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015882", "code": "def process_integers(numbers, rule):\n    result = []\n    if rule == 'even':\n        result = sorted([num for num in numbers if num % 2 == 0])\n    elif rule == 'odd':\n        result = sorted([num for num in numbers if num % 2 != 0], reverse=True)\n    return result\n", "entry_point": "process_integers", "input": "[3, 5, 7, 2], 'odd'", "output": "[7, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015883", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[2, [0, 1], [3, [1, 3]]]", "output": "[2, 0, 1, 3, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5605", "output": "{1, 1121, 5, 5605, 295, 19, 59, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015885", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'.wxt.ttC'", "output": "'.wxt.ttC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015886", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'3.5.1'", "output": "'3.5.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015887", "code": "def sum_of_diagonals(mat):\n    res = 0\n    i, j = 0, 0\n    while j < len(mat):\n        res += mat[i][j]\n        i += 1\n        j += 1\n    i, j = 0, len(mat) - 1\n    while j >= 0:\n        if i != j:\n            res += mat[i][j]\n        i += 1\n        j -= 1\n    return res\n", "entry_point": "sum_of_diagonals", "input": "[[1, 0], [0, 1]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84275_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015888", "code": "def sum_of_diagonals(mat):\n    res = 0\n    i, j = 0, 0\n    while j < len(mat):\n        res += mat[i][j]\n        i += 1\n        j += 1\n    i, j = 0, len(mat) - 1\n    while j >= 0:\n        if i != j:\n            res += mat[i][j]\n        i += 1\n        j -= 1\n    return res\n", "entry_point": "sum_of_diagonals", "input": "[[5, 0, 1], [10, 10, 0], [4, 0, 5]]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84275_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015889", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[31, 32]", "output": "31.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015890", "code": "def compare_scores(player1_scores, player2_scores):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for score1, score2 in zip(player1_scores, player2_scores):\n        if score1 > score2:\n            rounds_won_player1 += 1\n        elif score2 > score1:\n            rounds_won_player2 += 1\n    return [rounds_won_player1, rounds_won_player2]\n", "entry_point": "compare_scores", "input": "[5, 6, 7, 2, 3, 4], [3, 2, 1, 6, 4, 5]", "output": "[3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107299_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015891", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "16", "output": "'10000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015892", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4072", "output": "{1, 2, 4, 4072, 8, 2036, 1018, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4071", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015893", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "25", "output": "[1, 1, 0, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "338", "output": "{1, 2, 169, 13, 338, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015895", "code": "import math\ndef calculate_padding(size):\n    next_power_of_2 = 2 ** math.ceil(math.log2(size))\n    return next_power_of_2 - size\n", "entry_point": "calculate_padding", "input": "10", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17732_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015896", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'ffoffbr'", "output": "'ffoffbr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015897", "code": "def calculate_moving_average(array, window_size):\n    moving_averages = []\n    for i in range(len(array) - window_size + 1):\n        window = array[i:i + window_size]\n        average = sum(window) / window_size\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[7, 8, 8, 11], 3", "output": "[7.666666666666667, 9.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41574_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015898", "code": "import string\ndef count_word_occurrences(text):\n    def clean_word(word):\n        return word.strip(string.punctuation).lower()\n    word_counts = {}\n    words = text.split()\n    for word in words:\n        cleaned_word = clean_word(word)\n        if cleaned_word:\n            word_counts[cleaned_word] = word_counts.get(cleaned_word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hhello'", "output": "{'hhello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4386_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015899", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 2, 2, 3, 3, 4, 4, 4, 5]", "output": "{1: 1, 2: 2, 3: 2, 4: 3, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015900", "code": "def map_source_to_file(source):\n    if source == 'A':\n        return 'art_source.txt'\n    elif source == 'C':\n        return 'clip_source.txt'\n    elif source == 'P':\n        return 'product_source.txt'\n    elif source == 'R':\n        return 'real_source.txt'\n    else:\n        return \"Unknown Source Type, only supports A C P R.\"\n", "entry_point": "map_source_to_file", "input": "'C'", "output": "'clip_source.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140499_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015901", "code": "def filter_versions(version_numbers, min_python_version):\n    filtered_versions = [version for version in version_numbers if version >= min_python_version]\n    return filtered_versions\n", "entry_point": "filter_versions", "input": "['3.7', '3.8', '3.9'], '3.8'", "output": "['3.8', '3.9']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42265_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015902", "code": "from typing import List\ndef generate_version_number(scene_files: List[str]) -> str:\n    highest_version = 0\n    for file in scene_files:\n        if file.startswith(\"file_v\"):\n            version = int(file.split(\"_v\")[1])\n            highest_version = max(highest_version, version)\n    new_version = highest_version + 1 if highest_version > 0 else 1\n    return f\"v{new_version}\"\n", "entry_point": "generate_version_number", "input": "['file_v5', 'file_v6', 'file_v7']", "output": "'v8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11750_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015903", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "6, 9", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015904", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6563", "output": "{1, 6563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6967", "output": "{1, 6967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015907", "code": "ENDPOINT_MAPPING = {\n    'robot_position': '/robotposition',\n    'cube_position': '/cubeposition',\n    'path': '/path',\n    'flag': '/flag'\n}\ndef generate_endpoint(resource_name):\n    return ENDPOINT_MAPPING.get(resource_name, 'Invalid resource')\n", "entry_point": "generate_endpoint", "input": "'flag'", "output": "'/flag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44396_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015908", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "12, 4", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015909", "code": "def process_help_section(path):\n    # Strip off the '/data/help/' part of the path\n    section = path.split('/', 3)[-1]\n    if section in ['install', 'overview', 'usage', 'examples', 'cloudhistory', 'changelog']:\n        return f\"Sending section: {section}\"\n    elif section.startswith('stage'):\n        stages_data = [{'name': stage_name, 'help': f\"Help for {stage_name}\"} for stage_name in ['stage1', 'stage2', 'stage3']]\n        return stages_data\n    else:\n        return f\"Could not find help section: {section}\"\n", "entry_point": "process_help_section", "input": "'/data/help/'", "output": "'Could not find help section: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99964_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015910", "code": "def count_package_occurrences(launch_components):\n    package_counts = {}\n    for component in launch_components:\n        package_name = component.get('package')\n        if package_name in package_counts:\n            package_counts[package_name] += 1\n        else:\n            package_counts[package_name] = 1\n    return package_counts\n", "entry_point": "count_package_occurrences", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13622_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015911", "code": "def longest_positive_sequence(lst):\n    max_length = 0\n    current_length = 0\n    for num in lst:\n        if num > 0:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    max_length = max(max_length, current_length)  # Check the last sequence\n    return max_length\n", "entry_point": "longest_positive_sequence", "input": "[-1, 1, 2, 3, 4, 5, 6, -2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95331_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015912", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015913", "code": "from typing import List\ndef process_numbers(numbers: List[int]) -> List[int]:\n    processed_numbers = []\n    for index, num in enumerate(numbers):\n        total = num + index\n        if total % 2 == 0:\n            processed_numbers.append(total ** 2)\n        else:\n            processed_numbers.append(total ** 3)\n    return processed_numbers\n", "entry_point": "process_numbers", "input": "[2, 3, 0, 2, 2, 4, 2, 3]", "output": "[4, 16, 4, 125, 36, 729, 64, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1098_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015914", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=100-'", "output": "(100, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015915", "code": "def sum_multiples_of_3_not_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_not_5", "input": "[9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108735_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015916", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'world'", "output": "'world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015917", "code": "def generate_output_muon_container(muon_container: str, muon_working_point: str, muon_isolation: str) -> str:\n    return f\"{muon_container}Calib_{muon_working_point}{muon_isolation}_%SYS%\"\n", "entry_point": "generate_output_muon_container", "input": "'MuonCollection', 'Tight', 'HighPT'", "output": "'MuonCollectionCalib_TightHighPT_%SYS%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69025_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015918", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'RRUUU'", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015919", "code": "import math\ndef mint_pizza(slices_per_person, slices_per_pizza):\n    total_slices_needed = sum(slices_per_person)\n    min_pizzas = math.ceil(total_slices_needed / slices_per_pizza)\n    return min_pizzas\n", "entry_point": "mint_pizza", "input": "[1], 8", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149850_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015920", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[30.0, 35.0]", "output": "32.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015921", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3171", "output": "{1, 1057, 3, 3171, 453, 7, 21, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015922", "code": "def broadcast_message(user_ids, message):\n    successful_deliveries = 0\n    for user_id in user_ids:\n        try:\n            # Simulating message delivery by printing the user ID\n            print(f\"Message delivered to user ID: {user_id}\")\n            successful_deliveries += 1\n        except Exception as e:\n            # Handle any exceptions that may occur during message delivery\n            print(f\"Failed to deliver message to user ID: {user_id}. Error: {e}\")\n    return successful_deliveries\n", "entry_point": "broadcast_message", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 'Hello, users!'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16498_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015923", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'#'", "output": "('#', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015924", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7970", "output": "{1, 7970, 2, 5, 10, 3985, 1594, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7969", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4483", "output": "{1, 4483}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015926", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4397", "output": "{1, 4397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015927", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    fib_prev, fib_curr = 0, 1\n    for _ in range(N):\n        fib_sum += fib_curr\n        fib_prev, fib_curr = fib_curr, fib_prev + fib_curr\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "19", "output": "10945", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41805_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015928", "code": "def count_severities(severity_str):\n    severities = {}\n    for severity in severity_str.split(','):\n        severity = severity.strip()  # Remove leading and trailing spaces\n        if severity in severities:\n            severities[severity] += 1\n        else:\n            severities[severity] = 1\n    return severities\n", "entry_point": "count_severities", "input": "'Low, '", "output": "{'Low': 1, '': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5726_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015929", "code": "def reverse(input_str):\n    reversed_str = ''\n    for i in range(len(input_str) - 1, -1, -1):\n        reversed_str += input_str[i]\n    return reversed_str\n", "entry_point": "reverse", "input": "'Ramen'", "output": "'nemaR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015930", "code": "def calculate_total_revenue(book_entries):\n    total_revenue = 0\n    for entry in book_entries:\n        total_revenue += entry['revenue']\n    return total_revenue\n", "entry_point": "calculate_total_revenue", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41751_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015931", "code": "def solution(A, B, K):\n    count = 0\n    if A % K == 0:\n        count += 1\n    for i in range(A + (A % K), B + 1, K):\n        count += 1\n    return count\n", "entry_point": "solution", "input": "1, 10, 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93792_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015932", "code": "import math\ndef calculate_distance_traveled(rotations_right, rotations_left, wheel_radius):\n    distance_right = wheel_radius * 2 * math.pi * rotations_right\n    distance_left = wheel_radius * 2 * math.pi * rotations_left\n    total_distance = (distance_right + distance_left) / 2\n    return total_distance\n", "entry_point": "calculate_distance_traveled", "input": "4, 4, 1", "output": "25.132741228718345", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15765_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015933", "code": "import re\n_VALID_URL = r'https?://(www\\.)?willow\\.tv/videos/(?P<id>[0-9a-z-_]+)'\n_GEO_COUNTRIES = ['US']\ndef validate_url_access(url: str, country: str) -> bool:\n    if country not in _GEO_COUNTRIES:\n        return False\n    pattern = re.compile(_VALID_URL)\n    match = pattern.match(url)\n    return bool(match)\n", "entry_point": "validate_url_access", "input": "'https://www.willow.tv/videos/abc-123', 'US'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16371_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015934", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "814", "output": "{1, 2, 37, 74, 11, 814, 22, 407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt813", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015935", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, -1, 3, 0, 3, 1, -1, -1, 1]", "output": "[2, 0, 5, 3, 7, 6, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015936", "code": "def max_consecutive_elements(lst):\n    if not lst:\n        return 0\n    max_count = 0\n    current_count = 1\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1]:\n            current_count += 1\n        else:\n            max_count = max(max_count, current_count)\n            current_count = 1\n    max_count = max(max_count, current_count)\n    return max_count\n", "entry_point": "max_consecutive_elements", "input": "[2, 2, 2, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27992_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015937", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "0, 18", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015938", "code": "import math\ndef find_max_ceiling_index(n, m, s):\n    mx = 0\n    ind = 0\n    for i in range(n):\n        if math.ceil(s[i] / m) >= mx:\n            mx = math.ceil(s[i] / m)\n            ind = i\n    return ind + 1\n", "entry_point": "find_max_ceiling_index", "input": "4, 2, [3, 5, 6, 7]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015939", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'Cecil'", "output": "'LICEC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9814", "output": "{1, 2, 7, 4907, 14, 9814, 1402, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9813", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015941", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[2, 5, 8, 10], 6", "output": "[4, 25, 512, 1000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015942", "code": "def filter_slack_messages(messages, user_id, keyword):\n    filtered_messages = []\n    for message in messages:\n        if message['user'] == user_id and keyword.lower() in message['text'].lower():\n            filtered_messages.append(message)\n    return filtered_messages\n", "entry_point": "filter_slack_messages", "input": "[], 'user123', 'important'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50895_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015943", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'njfhd'", "output": "'njfhd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015944", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'examplexheepe'", "output": "'examplexheepe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015945", "code": "from typing import List\ndef sum_of_powers(numbers: List[int], power: int) -> int:\n    result = 0\n    for num in numbers:\n        result += num ** power\n    return result\n", "entry_point": "sum_of_powers", "input": "[1], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38539_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015946", "code": "from collections import deque\ndef bfs(graph, start):\n    visited = set()\n    queue = deque([start])\n    traversal_order = []\n    while queue:\n        node = queue.popleft()\n        if node not in visited:\n            traversal_order.append(node)\n            visited.add(node)\n            queue.extend(neigh for neigh in graph.get(node, []) if neigh not in visited)\n    return traversal_order\n", "entry_point": "bfs", "input": "{4: [2], 2: [5], 5: []}, 4", "output": "[4, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53696_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015947", "code": "def extend_oid(base_oid, extension_tuple):\n    extended_oid = base_oid + extension_tuple\n    return extended_oid\n", "entry_point": "extend_oid", "input": "(1, 3, 6, 1, 5, 5, 7, 48), (7,)", "output": "(1, 3, 6, 1, 5, 5, 7, 48, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97535_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015948", "code": "from typing import List\ndef minTime(machines: List[int], goal: int) -> int:\n    def countItems(machines, days):\n        total = 0\n        for machine in machines:\n            total += days // machine\n        return total\n    low = 1\n    high = max(machines) * goal\n    while low < high:\n        mid = (low + high) // 2\n        if countItems(machines, mid) < goal:\n            low = mid + 1\n        else:\n            high = mid\n    return low\n", "entry_point": "minTime", "input": "[1], 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117103_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015949", "code": "import re\ndef process_string(input_string):\n    # Replace \"Kafka\" with \"Python\"\n    processed_string = input_string.replace(\"Kafka\", \"Python\")\n    # Remove digits from the string\n    processed_string = re.sub(r'\\d', '', processed_string)\n    # Reverse the string\n    processed_string = processed_string[::-1]\n    return processed_string\n", "entry_point": "process_string", "input": "'awesome'", "output": "'emosewa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55468_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015950", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "1, 46.9164118246687", "output": "4591.64118246687", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015951", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'09:15:00 PM'", "output": "'21:15:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015952", "code": "from datetime import datetime\ndef utc_to_unix_timestamp(iso_timestamp: str) -> int:\n    # Parse the input UTC timestamp string into a datetime object\n    dt_utc = datetime.fromisoformat(iso_timestamp.replace(\"Z\", \"+00:00\"))\n    # Calculate the Unix timestamp by converting datetime object to timestamp\n    unix_timestamp = int(dt_utc.timestamp())\n    return unix_timestamp\n", "entry_point": "utc_to_unix_timestamp", "input": "'2023-01-01T00:00:00Z'", "output": "1672531200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119762_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8787", "output": "{1, 3, 101, 303, 2929, 8787, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015954", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'21.2.16'", "output": "(21, 2, 16)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015955", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'  llo, World!   '", "output": "'llo, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015956", "code": "def move_player(movements):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    player_position = [0, 0]\n    for move in movements:\n        dx, dy = directions.get(move, (0, 0))\n        new_x = player_position[0] + dx\n        new_y = player_position[1] + dy\n        if 0 <= new_x < 5 and 0 <= new_y < 5:\n            player_position[0] = new_x\n            player_position[1] = new_y\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['D', 'D', 'R', 'R', 'R']", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144868_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015957", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:edXCS1012+02c+Ha0'", "output": "('edXCS1012', '02c', 'Ha0')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015958", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 3, -1, 2, 4, 2, 2, 0, 3]", "output": "[1, 4, 1, 5, 8, 7, 8, 7, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015959", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'hel hellod hoho'", "output": "'hoho hellod hel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015960", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 4], [4, 0]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015961", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', 1, -3", "output": "(2, -3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015962", "code": "def count_api_resources(api_routes):\n    resource_counts = {}\n    for route in api_routes:\n        resource_type = route.get('resource')\n        if resource_type in resource_counts:\n            resource_counts[resource_type] += 1\n        else:\n            resource_counts[resource_type] = 1\n    return resource_counts\n", "entry_point": "count_api_resources", "input": "[{'resource': None}] * 8", "output": "{None: 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99885_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015963", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'    eeo    '", "output": "['eeo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015964", "code": "def process_operations(initial_list, operations):\n    def add_value(lst, val):\n        return [num + val for num in lst]\n    def multiply_value(lst, val):\n        return [num * val for num in lst]\n    def reverse_list(lst):\n        return lst[::-1]\n    def negate_list(lst):\n        return [-num for num in lst]\n    operations = operations.split()\n    operations_iter = iter(operations)\n    result = initial_list.copy()\n    for op in operations_iter:\n        if op == 'A':\n            result = add_value(result, int(next(operations_iter)))\n        elif op == 'M':\n            result = multiply_value(result, int(next(operations_iter)))\n        elif op == 'R':\n            result = reverse_list(result)\n        elif op == 'N':\n            result = negate_list(result)\n    return result\n", "entry_point": "process_operations", "input": "[3, 6, 9, 12], 'R N'", "output": "[-12, -9, -6, -3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117757_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015965", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "42, 117", "output": "(222, 62)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015966", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1185", "output": "{1, 1185, 3, 5, 395, 237, 15, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3215", "output": "{1, 643, 5, 3215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015968", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[2, 4, 3, 1, 5, 4, 3, 3]", "output": "[7, 9, 8, 6, 10, 9, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015969", "code": "def maxTurbulenceSize(A):\n    ans = 1\n    start = 0\n    for i in range(1, len(A)):\n        c = (A[i-1] > A[i]) - (A[i-1] < A[i])\n        if c == 0:\n            start = i\n        elif i == len(A)-1 or c * ((A[i] > A[i+1]) - (A[i] < A[i+1])) != -1:\n            ans = max(ans, i - start + 1)\n            start = i\n    return ans\n", "entry_point": "maxTurbulenceSize", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41497_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015970", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[100, 85, 80, 70, 100, 85]", "output": "[100, 85, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015971", "code": "def reconstruct_message(packets):\n    packet_dict = {}\n    for packet in packets:\n        seq_num, data = packet.split(':')\n        packet_dict[int(seq_num)] = data\n    sorted_packets = sorted(packet_dict.items())\n    reconstructed_message = ''\n    for seq_num, data in sorted_packets:\n        if seq_num != len(reconstructed_message) + 1:\n            return \"Incomplete message\"\n        reconstructed_message += data\n    return reconstructed_message\n", "entry_point": "reconstruct_message", "input": "['1:A', '2:E', '3:D', '4:B', '5:C']", "output": "'AEDBC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124667_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015972", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'c'", "output": "['c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015973", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'exaeexame.json'", "output": "'exaeexame_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015974", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[95, 93, 92, 91, 83]", "output": "90.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3445", "output": "{1, 65, 5, 265, 13, 689, 3445, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "393", "output": "{1, 393, 3, 131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015977", "code": "def parse_version(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "parse_version", "input": "'0.0.33'", "output": "(0, 0, 33)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128188_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8345", "output": "{1, 8345, 5, 1669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015979", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'1141 51456.0'", "output": "(51456.0, 1141)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015980", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[1, 2, 2, 3, 5, 8, 8, 1]", "output": "[1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015981", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 3, 5, 5, 7, 5, 6, 3]", "output": "[7, 4, 7, 8, 11, 10, 12, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015982", "code": "def calculate_average_age(people):\n    total_age = 0\n    for person in people:\n        total_age += person['idade']\n    if len(people) == 0:\n        return 0  # Handle division by zero if the list is empty\n    else:\n        return total_age / len(people)\n", "entry_point": "calculate_average_age", "input": "[{'idade': 27}]", "output": "27.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52440_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015983", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[3, 1, 6, 3, 3, 1]", "output": "[3, 4, 10, 13, 16, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015984", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[0, 2, 4, 1, 2]", "output": "[0, 3, 6, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015985", "code": "from typing import List\ndef plusOne(digits: List[int]) -> List[int]:\n    n = len(digits)\n    for i in range(n - 1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    return [1] + digits\n", "entry_point": "plusOne", "input": "[9, 9, 9, 9, 9, 9]", "output": "[1, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88559_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015986", "code": "import logging\ndef process_detections(detections, user_id, team_id):\n    data = {\"detections\": [{\"id\": d['id']} for d in detections]}\n    # Simulating asynchronous tasks\n    def recalculate_user_stats(user_id):\n        # Code to recalculate user statistics\n        pass\n    def recalculate_team_stats(team_id):\n        # Code to recalculate team statistics\n        pass\n    recalculate_user_stats.delay = recalculate_user_stats  # Mocking asynchronous task\n    recalculate_team_stats.delay = recalculate_team_stats  # Mocking asynchronous task\n    recalculate_user_stats.delay(user_id)\n    recalculate_team_stats.delay(team_id)\n    num_detections = len(detections)\n    logger = logging.getLogger(__name__)\n    logger.info(\"Stored {} detections for user {}\".format(num_detections, user_id))\n    return data\n", "entry_point": "process_detections", "input": "[], 'user123', 'team456'", "output": "{'detections': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70067_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015987", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "6, 7, 9", "output": "(6, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015988", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'ex.pec'", "output": "'ex.pec.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2839", "output": "{1, 167, 17, 2839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015990", "code": "def capitalize_last_letter(string):\n    modified_string = \"\"\n    for word in string.split():\n        if len(word) > 1:\n            modified_word = word[:-1] + word[-1].upper()\n        else:\n            modified_word = word.upper()\n        modified_string += modified_word + \" \"\n    return modified_string[:-1]  # Remove the extra space at the end\n", "entry_point": "capitalize_last_letter", "input": "'tool'", "output": "'tooL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101043_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015991", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 0, 0, 1, 0, 2]", "output": "[1, 0, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7973", "output": "{1, 67, 7973, 7, 17, 1139, 469, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015993", "code": "# Define roles not authorized to delete an organization\nroles_not_authorized_to_delete = {\"IM\", \"SK\"}\n# Define roles not authorized to get a list of organizations\nroles_not_authorized_to_get = {\"IM\"}\ndef check_permission(role, action):\n    if action == \"delete\" and role in roles_not_authorized_to_delete:\n        return True\n    elif action == \"get\" and role in roles_not_authorized_to_get:\n        return True\n    return False\n", "entry_point": "check_permission", "input": "'IM', 'get'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17007_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015994", "code": "def weighted_avg(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"The lengths of numbers and weights must be equal.\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    return weighted_sum / total_weight\n", "entry_point": "weighted_avg", "input": "[24, 28], [1, 1]", "output": "26.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67800_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015995", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'KL.MNO'", "output": "[('KL', 'MNO')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015996", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'10s'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015997", "code": "def count_alphanumeric_chars(text):\n    count = 0\n    for char in text:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abc1'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10323_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1807", "output": "{1, 139, 13, 1807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0015999", "code": "from typing import List\ndef count_items_above_average(items: List[int]) -> int:\n    if not items:\n        return 0\n    average_weight = sum(items) / len(items)\n    count = sum(1 for item in items if item > average_weight)\n    return count\n", "entry_point": "count_items_above_average", "input": "[1, 2, 3, 10, 10, 10, 10, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73147_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016000", "code": "def snake_case(string):\n    return string.replace(\" \", \"_\").lower()\n", "entry_point": "snake_case", "input": "'HeHeO'", "output": "'heheo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78100_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016001", "code": "import keyword\ndef is_valid_name(ident: str) -> bool:\n    '''Determine if ident is a valid register or bitfield name.'''\n    if not isinstance(ident, str):\n        raise TypeError(\"expected str, but got {!r}\".format(type(ident)))\n    if not ident.isidentifier():\n        return False\n    if keyword.iskeyword(ident):\n        return False\n    return True\n", "entry_point": "is_valid_name", "input": "'my_variable'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17950_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016002", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "296", "output": "{1, 2, 4, 37, 296, 8, 74, 148}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt295", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016003", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[3, 4, 1, 3, 4]", "output": "[7, 5, 4, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016004", "code": "def max_non_contiguous_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = exclude + num\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_contiguous_sum", "input": "[20, 5, 8]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39163_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016005", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 3, 3, 2, 6, 3, 1, 3]", "output": "[3, 5, 6, 5, 8, 9, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016006", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[3, 3, 3, 4, -3, -2, -1]", "output": "[3, 3, 3, -2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016007", "code": "from typing import List, Union, Optional, Tuple\nfrom collections import Counter\ndef most_common_element(lst: List[Union[int, any]]) -> Tuple[Optional[int], Optional[int]]:\n    int_list = [x for x in lst if isinstance(x, int)]\n    if not int_list:\n        return (None, None)\n    counter = Counter(int_list)\n    most_common = counter.most_common(1)[0]\n    return most_common\n", "entry_point": "most_common_element", "input": "[2, 2, 2, 2, 1, 3, 4, 'hello', None]", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70044_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016008", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "189", "output": "'?189'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016009", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, -1, 4, 4, 4, 3]", "output": "[5, 2, 3, 8, 8, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016010", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'AD\u0430V'", "output": "'AD\u0430V'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016011", "code": "def reverse_words_in_string(s: str) -> str:\n    result = \"\"\n    word = \"\"\n    for char in s:\n        if char != ' ':\n            word = char + word\n        else:\n            result += word + ' '\n            word = \"\"\n    result += word  # Append the last word without a space\n    return result\n", "entry_point": "reverse_words_in_string", "input": "'world'", "output": "'dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88814_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5534", "output": "{1, 2, 5534, 2767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5533", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2216", "output": "{1, 2, 4, 2216, 8, 554, 1108, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2215", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016014", "code": "from typing import List\ndef merge_sorted_lists(nums1: List[int], nums2: List[int]) -> List[int]:\n    merged = []\n    i, j = 0, 0\n    while i < len(nums1) and j < len(nums2):\n        if nums1[i] < nums2[j]:\n            merged.append(nums1[i])\n            i += 1\n        else:\n            merged.append(nums2[j])\n            j += 1\n    merged.extend(nums1[i:])\n    merged.extend(nums2[j:])\n    return merged\n", "entry_point": "merge_sorted_lists", "input": "[2, 2, 4, 5], [2, 2, 3, 5, 6]", "output": "[2, 2, 2, 2, 3, 4, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142881_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016015", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "total_size_in_kb", "input": "[1024, 1024, 1024]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33137_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016016", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'1', '0'", "output": "'1.0.x'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9617", "output": "{1, 9617, 59, 163}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016018", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "7.8, 1", "output": "(7.8, 7.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016019", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'15 2 * 6 +'", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016020", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[3, 7, 2, 5]", "output": "[3, 8, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016021", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'foo.bar.appap.baz'", "output": "'appap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016022", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "414", "output": "{1, 2, 3, 69, 6, 9, 138, 46, 207, 18, 23, 414}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt413", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1003", "output": "{1, 1003, 17, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1002", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016025", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "446", "output": "{1, 2, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016026", "code": "import re\ndef extract_unique_words(text):\n    # Split the text into words using regular expressions\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Return a sorted list of unique words\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'example'", "output": "['example']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87039_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016027", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "4", "output": "['1', '2', '3', '4']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016028", "code": "import re\ndef extract_version(input_string):\n    pattern = r\"\\{\\{(.+?)\\}\\}\"\n    match = re.search(pattern, input_string)\n    if match:\n        version_str = match.group(1)\n        try:\n            version_int = int(version_str.replace('.', ''))\n            return version_int\n        except ValueError:\n            return \"Invalid version format\"\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version", "input": "'{{1.2.3}}'", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016029", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[49]", "output": "59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016030", "code": "import re\ndef validate_string(input_string):\n    pattern = '^[a-zA-Z0-9]{1,10}$'  # Pattern to match alphanumeric characters with a maximum length of 10\n    if re.match(pattern, input_string) and ' ' not in input_string:\n        return True\n    return False\n", "entry_point": "validate_string", "input": "'hello world'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32405_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016031", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 1, 3, -1, 3, -2, 4, 3]", "output": "[0, 2, 10, 6, 28, 15, 60, 70]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016032", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#FFA5F5'", "output": "(255, 165, 245)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6995", "output": "{1, 6995, 5, 1399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016034", "code": "def construct_path(path: str, name: str) -> str:\n    if path.endswith(\"/\"):\n        path = path[:-1]\n    if name.startswith(\"/\"):\n        name = name[1:]\n    return f\"{path}/{name}\"\n", "entry_point": "construct_path", "input": "'/h/ome', 'ujams.user_team_ljatse'", "output": "'/h/ome/ujams.user_team_ljatse'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82517_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016035", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[5, 7, 9, 5], 1", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016036", "code": "def calculate_score(points):\n    if points == 0:\n        score = 10\n    elif points < 7:\n        score = 7\n    elif points < 14:\n        score = 4\n    elif points < 18:\n        score = 1\n    elif points < 28:\n        score = 0\n    elif points < 35:\n        score = -3\n    else:\n        score = -4\n    return score\n", "entry_point": "calculate_score", "input": "35", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119346_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016037", "code": "def frequencies_map_with_map_from(lst):\n    from collections import Counter\n    return dict(map(lambda x: (x, lst.count(x)), set(lst)))\n", "entry_point": "frequencies_map_with_map_from", "input": "['bbbc', 'bbbc', 'bbbc', 'cddcacddda']", "output": "{'bbbc': 3, 'cddcacddda': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49570_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016038", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_evens", "input": "[2, 4, 6, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121805_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7651", "output": "{1, 7651, 1093, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7650", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016040", "code": "def extract_package_info(input_str):\n    # Split the input string by '=' and strip whitespace\n    parts = input_str.split('=')\n    package_name = parts[0].strip()\n    verbose_name = parts[1].strip().strip(\"'\")\n    # Create a dictionary with package name as key and verbose name as value\n    package_info = {package_name: verbose_name}\n    return package_info\n", "entry_point": "extract_package_info", "input": "\"= ''\"", "output": "{'': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140838_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016041", "code": "import collections\ndef rearrange_string(s: str, k: int) -> str:\n    res = []\n    d = collections.defaultdict(int)\n    # Count the frequency of each character\n    for c in s:\n        d[c] += 1\n    v = collections.defaultdict(int)\n    for i in range(len(s)):\n        c = None\n        for key in d:\n            if (not c or d[key] > d[c]) and d[key] > 0 and v[key] <= i + k:\n                c = key\n        if not c:\n            return ''\n        res.append(c)\n        d[c] -= 1\n        v[c] = i + k\n    return ''.join(res)\n", "entry_point": "rearrange_string", "input": "'aaaaaaaabc', 2", "output": "'aaaaaaaabc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4736_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016042", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "401", "output": "'Guest or disabled account'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016043", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2429", "output": "{1, 347, 2429, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2539", "output": "{1, 2539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016045", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'HetesoTWot'", "output": "'HetesoTWot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016046", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1013", "output": "{1, 1013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016047", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'set check'", "output": "'check'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016048", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6659", "output": "{1, 6659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016049", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6379", "output": "{1, 6379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016050", "code": "import re\ndef generate_slug(value):\n    def django_slugify(value):\n        # Placeholder for the default slugify method\n        return re.sub(r'[^a-z0-9-]', '', value.lower().replace(' ', '-'))\n    try:\n        from unidecode import unidecode\n        return re.sub(r'[^a-z0-9-]', '', unidecode(value.lower()))\n    except ImportError:\n        try:\n            from pytils.translit import slugify\n            return re.sub(r'[^a-z0-9-]', '', slugify(value.lower()))\n        except ImportError:\n            return re.sub(r'[^a-z0-9-]', '', django_slugify(value))\n", "entry_point": "generate_slug", "input": "'Hello World'", "output": "'hello-world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85241_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016051", "code": "def calculate_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:  # Odd number of elements\n        return sorted_nums[n // 2]\n    else:  # Even number of elements\n        mid_left = n // 2 - 1\n        mid_right = n // 2\n        return (sorted_nums[mid_left] + sorted_nums[mid_right]) / 2\n", "entry_point": "calculate_median", "input": "[7, 8, 9]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32741_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016052", "code": "def format_output(version: str, default_app_config: str) -> str:\n    version = version if version else '0.0'\n    default_app_config = default_app_config if default_app_config else 'default_config'\n    return f'[{version}] {default_app_config}'\n", "entry_point": "format_output", "input": "'..11.1.1.1.', 'dangodjanngo'", "output": "'[..11.1.1.1.] dangodjanngo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63589_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8186", "output": "{1, 8186, 2, 4093}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016054", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1341", "output": "{1, 3, 9, 149, 1341, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016055", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[16, 16, 16]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4372", "output": "{1, 2, 4, 1093, 2186, 4372}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4371", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016057", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'world'", "output": "'WoRlD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016058", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'2.0.996'", "output": "(2, 0, 996)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4431", "output": "{1, 3, 1477, 7, 4431, 211, 21, 633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016060", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[16, 4]", "output": "272", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4220_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2707", "output": "{1, 2707}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016062", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 1, 1, 1, -1, 5, 1, -1, 0]", "output": "[1, 2, 2, 0, 4, 6, 0, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016063", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v10.1.31.3'", "output": "'10.1.31.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016064", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'My Package n'", "output": "'my_package_n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "634", "output": "{1, 634, 2, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016066", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[2, 2, 4, 3, 1, 5, 3, 5]", "output": "[2, 4, 3, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016067", "code": "def find_second_smallest(nums):\n    if len(nums) < 2:\n        return None\n    smallest = second_smallest = float('inf')\n    for num in nums:\n        if num < smallest:\n            second_smallest = smallest\n            smallest = num\n        elif smallest < num < second_smallest:\n            second_smallest = num\n    return second_smallest\n", "entry_point": "find_second_smallest", "input": "[12, 13, 15, 20]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14329_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016068", "code": "def find_min_synaptic_conductance_time(synaptic_conductance_values):\n    min_value = synaptic_conductance_values[0]\n    min_time = 1\n    for i in range(1, len(synaptic_conductance_values)):\n        if synaptic_conductance_values[i] < min_value:\n            min_value = synaptic_conductance_values[i]\n            min_time = i + 1  # Time points start from 1\n    return min_time\n", "entry_point": "find_min_synaptic_conductance_time", "input": "[5, 3, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31704_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016069", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "8, 14", "output": "112", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3703", "output": "{1, 161, 7, 3703, 529, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016071", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[34, 0]", "output": "-34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8762", "output": "{1, 2, 674, 26, 13, 337, 8762, 4381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016073", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 3, 3, 3, 3, 3]", "output": "[4, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016074", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'aaarroca'", "output": "'aaarroca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016075", "code": "def process_integers(integer_list):\n    total = 0\n    for num in integer_list:\n        if num > 0:\n            total += num ** 2\n        elif num < 0:\n            total -= abs(num) / 2\n    return total\n", "entry_point": "process_integers", "input": "[-30, 5, 7]", "output": "59.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92247_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016076", "code": "def process_buttons(buttons):\n    if buttons is None:\n        return None\n    try:\n        if buttons.SUBCLASS_OF_ID == 0xe2e10ef2:\n            return buttons\n    except AttributeError:\n        pass\n    if not isinstance(buttons, list):\n        buttons = [[buttons]]\n    elif not isinstance(buttons[0], list):\n        buttons = [buttons]\n    is_inline = False\n    is_normal = False\n    rows = []\n    return buttons, is_inline, is_normal, rows\n", "entry_point": "process_buttons", "input": "[[4, 3, 4, 4]]", "output": "([[4, 3, 4, 4]], False, False, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147264_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016077", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 8, 9, 11, 10, 7]", "output": "[7, 9, 11, 14, 14, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016078", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'Convert This String'", "output": "'convert_this_string'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016079", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "4, 6", "output": "[0, 1, 2, 3, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016080", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'Parer', 'hppp'", "output": "'Parer.hppp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016081", "code": "def minimum_swaps(arr):\n    a = dict(enumerate(arr, 1))\n    b = {v: k for k, v in a.items()}\n    count = 0\n    for i in a:\n        x = a[i]\n        if x != i:\n            y = b[i]\n            a[y] = x\n            b[x] = y\n            count += 1\n    return count\n", "entry_point": "minimum_swaps", "input": "[2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125007_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016082", "code": "def validBraces(string):\n    valid = {'(': ')', '[': ']', '{': '}'}\n    stack = []\n    for char in string:\n        if char in valid:\n            stack.append(char)\n        elif stack and valid[stack[-1]] == char:\n            stack.pop()\n        else:\n            return False\n    return len(stack) == 0\n", "entry_point": "validBraces", "input": "'([)'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70139_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016083", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'PPPXXIPXPPIPIP', 'ME'", "output": "'Invalid status code: PPPXXIPXPPIPIP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016084", "code": "def next_greater_element(nums1, nums2):\n    next_greater = {}\n    stack = []\n    for num in nums2:\n        while stack and num > stack[-1]:\n            next_greater[stack.pop()] = num\n        stack.append(num)\n    result = [next_greater.get(num, -1) for num in nums1]\n    return result\n", "entry_point": "next_greater_element", "input": "[1, 2, 3, 4, 6, 7, 8], [5]", "output": "[-1, -1, -1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119101_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016085", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[-3, -4]", "output": "-7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016086", "code": "def format_package_info(package_info):\n    if 'name' in package_info and 'version' in package_info and 'description' in package_info:\n        return f\"Package: {package_info['name']}, Version: {package_info['version']}, Description: {package_info['description']}\"\n    else:\n        return \"Incomplete package information\"\n", "entry_point": "format_package_info", "input": "{'name': 'mypackage', 'version': '1.0'}", "output": "'Incomplete package information'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146218_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016087", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 39]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016088", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return 0\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence", "input": "[5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79079_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016089", "code": "SDL_HAT_CENTERED = 0x00\nSDL_HAT_UP = 0x01\nSDL_HAT_RIGHT = 0x02\nSDL_HAT_DOWN = 0x04\nSDL_HAT_LEFT = 0x08\nSDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP\nSDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN\nSDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP\nSDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN\ndef simulate_joystick_movement(current_position, direction):\n    if direction == 'UP':\n        return SDL_HAT_UP if current_position not in [SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_LEFTUP] else current_position\n    elif direction == 'RIGHT':\n        return SDL_HAT_RIGHT if current_position not in [SDL_HAT_RIGHT, SDL_HAT_RIGHTUP, SDL_HAT_RIGHTDOWN] else current_position\n    elif direction == 'DOWN':\n        return SDL_HAT_DOWN if current_position not in [SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN, SDL_HAT_LEFTDOWN] else current_position\n    elif direction == 'LEFT':\n        return SDL_HAT_LEFT if current_position not in [SDL_HAT_LEFT, SDL_HAT_LEFTUP, SDL_HAT_LEFTDOWN] else current_position\n    else:\n        return current_position\n", "entry_point": "simulate_joystick_movement", "input": "-1, 'INVALID'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77291_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5528", "output": "{1, 2, 4, 1382, 8, 2764, 691, 5528}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5527", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016091", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'  World\\n'", "output": "'World\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016092", "code": "def is_valid_time(time_str):\n    parts = time_str.split(':')\n    if len(parts) != 3:\n        return False\n    try:\n        hours, minutes, seconds = map(int, parts)\n    except ValueError:\n        return False\n    if not (0 <= hours <= 23 and 0 <= minutes <= 59 and 0 <= seconds <= 59):\n        return False\n    return True\n", "entry_point": "is_valid_time", "input": "'12:30:45'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99486_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016093", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[3, 1, 3, 7, 8, 2, 5, 5, 1]", "output": "[3, 1, 7, 8, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6121", "output": "{1, 6121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016095", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "139", "output": "(True, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8979", "output": "{1, 3, 41, 73, 123, 2993, 8979, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016097", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 7, 0, 1, 7, 7, 0]", "output": "[2, 8, 2, 4, 11, 12, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "57", "output": "{19, 1, 3, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt56", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016099", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if isinstance(num, int) and is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[41, 3]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148587_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3236", "output": "{1, 2, 4, 3236, 809, 1618}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3235", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016101", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[8, 3, 3, 10, 2, 9, 8, 8]", "output": "[8, 4, 5, 13, 6, 14, 14, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016102", "code": "import math\ndef calculate_disk_radius(solid_angle, distance):\n    # Calculate disk radius using the formula: radius = sqrt(solid_angle * distance^2)\n    radius = math.sqrt(solid_angle * distance**2)\n    return radius\n", "entry_point": "calculate_disk_radius", "input": "1, 2.6645825188948455", "output": "2.6645825188948455", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28379_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016103", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1497", "output": "1457", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016104", "code": "def bitonic(a, n):\n    for i in range(1, n):\n        if a[i] < a[i - 1]:\n            return i - 1\n    return -1\n", "entry_point": "bitonic", "input": "[1, 2, 3, 2], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106120_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016105", "code": "from typing import List, Tuple\ndef is_tree(network: List[Tuple[int, int]]) -> bool:\n    if len(network) != len(set(network)):\n        return False  # Check for duplicate connections\n    parent = {}\n    nodes = set()\n    for node1, node2 in network:\n        parent[node2] = node1\n        nodes.add(node1)\n        nodes.add(node2)\n    if len(parent) != len(nodes) - 1:\n        return False  # Check for correct number of edges\n    def dfs(node, visited):\n        if node in visited:\n            return False\n        visited.add(node)\n        for child in parent.keys():\n            if parent[child] == node:\n                if not dfs(child, visited):\n                    return False\n        return True\n    visited = set()\n    if not dfs(list(nodes)[0], visited):\n        return False\n    return len(visited) == len(nodes)\n", "entry_point": "is_tree", "input": "[(1, 2), (1, 2)]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13267_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016106", "code": "YEAR_CHOICES = (\n    (1, 'First'),\n    (2, 'Second'),\n    (3, 'Third'),\n    (4, 'Fourth'),\n    (5, 'Fifth'),\n)\ndef get_ordinal(year):\n    for num, ordinal in YEAR_CHOICES:\n        if num == year:\n            return ordinal\n    return \"Unknown\"\n", "entry_point": "get_ordinal", "input": "1", "output": "'First'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43813_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "575", "output": "{1, 5, 115, 23, 25, 575}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt574", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016108", "code": "def longest_palindromic_substring(s):\n    size = len(s)\n    if size < 2:\n        return s\n    dp = [[False for _ in range(size)] for _ in range(size)]\n    maxLen = 1\n    start = 0\n    for j in range(1, size):\n        for i in range(0, j):\n            if s[i] == s[j]:\n                if j - i <= 2:\n                    dp[i][j] = True\n                else:\n                    dp[i][j] = dp[i + 1][j - 1]\n            if dp[i][j]:\n                curLen = j - i + 1\n                if curLen > maxLen:\n                    maxLen = curLen\n                    start = i\n    return s[start : start + maxLen]\n", "entry_point": "longest_palindromic_substring", "input": "'babad'", "output": "'bab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74617_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016109", "code": "def card_game_winner(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return \"Player 1 wins\"\n    elif rounds_won_player2 > rounds_won_player1:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "card_game_winner", "input": "[1, 2, 3], [3, 2, 1]", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5149_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016110", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[1, 5, 11, 20], 11", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016111", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'wlwolo'", "output": "['wlwolo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016112", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "3, 4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1081", "output": "{1, 23, 47, 1081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016114", "code": "def missingNumber(array, n):\n    total = n*(n+1)//2\n    array_sum = sum(array)\n    return total - array_sum\n", "entry_point": "missingNumber", "input": "[6, 7, 8], 5", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114479_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016115", "code": "def generate_heading(content, level):\n    heading_tags = {\n        1: \"h1\",\n        2: \"h2\",\n        3: \"h3\",\n        4: \"h4\",\n        5: \"h5\",\n        6: \"h6\"\n    }\n    if level not in heading_tags:\n        return \"Invalid heading level. Please provide a level between 1 and 6.\"\n    html_tag = heading_tags[level]\n    return \"<{}>{}</{}>\".format(html_tag, content, html_tag)\n", "entry_point": "generate_heading", "input": "'Hello World', 3", "output": "'<h3>Hello World</h3>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44780_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016116", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[41, 40, 39, 20, 15]", "output": "[41, 40, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016117", "code": "def calculate_final_time(b, max_var_fixed):\n    final_best_time = 0\n    for max_b, variable, fixed in max_var_fixed:\n        passed_bits = min(b, max_b)\n        b -= passed_bits\n        final_best_time += fixed + variable * passed_bits\n        if not b:\n            return final_best_time\n    return final_best_time\n", "entry_point": "calculate_final_time", "input": "8, [(8, 7, 8)]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41267_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016118", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'aaabbc'", "output": "'a3b2c1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016119", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "325", "output": "352", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016120", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "14", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9361", "output": "{407, 1, 37, 11, 9361, 851, 23, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2669", "output": "{1, 2669, 17, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016123", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 88, 87, 87, 45, 66, 100]", "output": "[100, 88, 87]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016124", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'!H\\x00e\\x00d\\x00l\\x00!\\x00H,\\x00W\\x00H\\x00l\\x00d\\x00!'", "output": "'!Hedl!H,WHld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016125", "code": "def colorize_log_message(message, log_level):\n    RESET_SEQ = \"\\033[0m\"\n    COLOR_SEQ = \"\\033[1;%dm\"\n    COL = {\n        'DEBUG': 34, 'INFO': 35,\n        'WARNING': 33, 'CRITICAL': 33, 'ERROR': 31\n    }\n    color_code = COL.get(log_level, 37)  # Default to white if log_level not found\n    colored_message = COLOR_SEQ % color_code + message + RESET_SEQ\n    return colored_message\n", "entry_point": "colorize_log_message", "input": "'asThi er gas', 'UNKNOWN'", "output": "'\\x1b[1;37masThi er gas\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1938_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1021", "output": "{1, 1021}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1020", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016127", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7015", "output": "{1, 5, 7015, 305, 115, 23, 1403, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016128", "code": "from typing import List, Tuple\ndef classify_entries(line_numbers: List[int]) -> Tuple[List[int], List[int], List[int]]:\n    NOT_AN_ENTRY = set([\n        326, 330, 332, 692, 1845, 6016, 17859, 24005, 49675, 97466, 110519, 118045,\n        119186, 126386\n    ])\n    ALWAYS_AN_ENTRY = set([\n        12470, 17858, 60157, 60555, 60820, 75155, 75330, 77825, 83439, 84266,\n        94282, 97998, 102650, 102655, 102810, 102822, 102895, 103897, 113712,\n        113834, 119068, 123676\n    ])\n    always_starts_entry = [num for num in line_numbers if num in ALWAYS_AN_ENTRY]\n    never_starts_entry = [num for num in line_numbers if num in NOT_AN_ENTRY]\n    ambiguous_starts_entry = [num for num in line_numbers if num not in ALWAYS_AN_ENTRY and num not in NOT_AN_ENTRY]\n    return always_starts_entry, never_starts_entry, ambiguous_starts_entry\n", "entry_point": "classify_entries", "input": "[12470, 17858, 326, 330, 1, 5, 10]", "output": "([12470, 17858], [326, 330], [1, 5, 10])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61128_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016129", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9761", "output": "{1, 43, 227, 9761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016130", "code": "def min_moves_to_target(target):\n    return abs(target)\n", "entry_point": "min_moves_to_target", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63367_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9733", "output": "{1, 9733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016132", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "752", "output": "{1, 2, 4, 8, 47, 752, 16, 376, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt751", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016133", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'2.5.7'", "output": "(2, 5, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016134", "code": "def fairRations(arr):\n    total_loaves = 0\n    for i in range(len(arr) - 1):\n        if arr[i] % 2 != 0:\n            arr[i] += 1\n            arr[i + 1] += 1\n            total_loaves += 2\n    if arr[-1] % 2 != 0:\n        return 'NO'\n    else:\n        return total_loaves\n", "entry_point": "fairRations", "input": "[1, 1, 1, 1, 1, 1, 1, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50701_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016135", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "555", "output": "{1, 3, 5, 37, 555, 111, 15, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt554", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016136", "code": "def is_numeric(txt):\n    '''Confirms that the text is numeric'''\n    out = len(txt)\n    allowed_chars = set('0123456789-$%+.')  # Define the set of allowed characters\n    allowed_last_chars = set('1234567890%')  # Define the set of allowed last characters\n    for c in txt:\n        if c not in allowed_chars:\n            out = False\n            break\n    if out and txt[-1] not in allowed_last_chars:\n        out = False\n    return out\n", "entry_point": "is_numeric", "input": "'1234'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94372_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016137", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "6", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016138", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 4, 4, 2, 3, 3, 4, 0]", "output": "[9, 8, 6, 5, 6, 7, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125440_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3265", "output": "{1, 3265, 5, 653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016140", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "8, -3", "output": "[0, 1, -1, 6, -14, 47, -135, 412]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2386", "output": "{1, 2386, 2, 1193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016142", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4982", "output": "{1, 2, 106, 47, 53, 4982, 2491, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016143", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "7, 5, 3", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016144", "code": "def highest_non_duplicated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_duplicated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_duplicated_scores:\n        return max(non_duplicated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_duplicated_score", "input": "[45, 89, 67, 45, 23, 67]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79204_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016145", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[6, 6, 5, 5, 5, 2, 5, 6, 6]", "output": "[46, 46, 125, 125, 125, 4, 125, 46, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016146", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'Heellwehr'", "output": "{'heellwehr': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016147", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'abbabrr'", "output": "{'a': 2, 'b': 3, 'r': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016148", "code": "def generate_pattern(sequence: str, repetitions: int) -> str:\n    lines = []\n    forward_pattern = sequence\n    reverse_pattern = sequence[::-1]\n    for i in range(repetitions):\n        if i % 2 == 0:\n            lines.append(forward_pattern)\n        else:\n            lines.append(reverse_pattern)\n    return '\\n'.join(lines)\n", "entry_point": "generate_pattern", "input": "'ABCD', 3", "output": "'ABCD\\nDCBA\\nABCD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81413_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6198", "output": "{1, 2, 3, 6, 1033, 2066, 6198, 3099}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6197", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016150", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "'pppythammingythop'", "output": "'pppythammingythop_17'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016151", "code": "from typing import List\ndef weighted_sum(methods: List[tuple]) -> float:\n    total_weighted_sum = 0\n    for result, frames in methods:\n        total_weighted_sum += result * frames\n    return total_weighted_sum\n", "entry_point": "weighted_sum", "input": "[(8.0, 4), (0.2, 1)]", "output": "32.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26992_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016152", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016153", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[6, [5, [5, [8, 5], 6]], 5]", "output": "[6, 5, 5, 8, 5, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016154", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[7, 3, 4, 2, 6, 0, 6]", "output": "([7, 3, None, None, None], [4, 2, 6, 0, 6])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016155", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'10.11.0'", "output": "'10.10.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016156", "code": "import socket\ndef get_domain_name(ip_address):\n    try:\n        result = socket.gethostbyaddr(ip_address)\n        return list(result)[0]\n    except socket.herror:\n        return \"Domain name not found\"\n", "entry_point": "get_domain_name", "input": "'8.8.8.8'", "output": "'dns.google'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122690_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016157", "code": "from typing import List\ndef weighted_sum(methods: List[tuple]) -> float:\n    total_weighted_sum = 0\n    for result, frames in methods:\n        total_weighted_sum += result * frames\n    return total_weighted_sum\n", "entry_point": "weighted_sum", "input": "[(30, 1)]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26992_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016158", "code": "def count_substring(s: str, sub_s: str) -> int:\n    count = 0\n    for i in range(len(s) - len(sub_s) + 1):\n        if s[i:i+len(sub_s)] == sub_s:\n            count += 1\n    return count\n", "entry_point": "count_substring", "input": "'abababab', 'ab'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128804_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016159", "code": "from typing import List\ndef majority_element(nums: List[int]) -> int:\n    candidate = None\n    count = 0\n    for num in nums:\n        if count == 0:\n            candidate = num\n            count = 1\n        elif num == candidate:\n            count += 1\n        else:\n            count -= 1\n    return candidate\n", "entry_point": "majority_element", "input": "[0, 0, 0, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126055_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016160", "code": "def group_consecutive_indices(files):\n    files.sort()\n    grouped_files = []\n    current_group = []\n    for idx, path in files:\n        if not current_group or idx == current_group[-1][0] + 1:\n            current_group.append((idx, path))\n        else:\n            grouped_files.append(current_group)\n            current_group = [(idx, path)]\n    if current_group:\n        grouped_files.append(current_group)\n    return grouped_files\n", "entry_point": "group_consecutive_indices", "input": "[(1, '1.npz')]", "output": "[[(1, '1.npz')]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25085_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3764", "output": "{1, 2, 4, 941, 3764, 1882}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3763", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016162", "code": "import math\ndef euclidean_distance(point1, point2):\n    if not isinstance(point1, tuple) or not isinstance(point2, tuple) or len(point1) != 2 or len(point2) != 2:\n        raise ValueError(\"Both inputs must be tuples of length 2\")\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(1.0, 1.0), (1.0, 1.0)", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13433_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016163", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "90", "output": "'90'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016164", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'a'", "output": "['a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016165", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import wills'", "output": "'wills'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016166", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[2, 2, 2, 2, 2, 2]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016167", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "5, 5", "output": "[0, 1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016168", "code": "from collections import defaultdict\nfrom collections import deque\ndef resolve_migration_order(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    for app, migration in dependencies:\n        graph[(app, migration)] = []\n        in_degree[(app, migration)] = 0\n    for i in range(1, len(dependencies)):\n        for j in range(i):\n            if dependencies[i][0] == dependencies[j][0]:\n                graph[(dependencies[j][0], dependencies[j][1])].append((dependencies[i][0], dependencies[i][1]))\n                in_degree[(dependencies[i][0], dependencies[i][1])] += 1\n    queue = deque([node for node in in_degree if in_degree[node] == 0])\n    result = []\n    while queue:\n        current_node = queue.popleft()\n        result.append(current_node)\n        for neighbor in graph[current_node]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    if len(result) != len(dependencies):\n        return []\n    return result\n", "entry_point": "resolve_migration_order", "input": "[('a', '001'), ('b', '002')]", "output": "[('a', '001'), ('b', '002')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7270_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4614", "output": "{1, 2, 3, 2307, 1538, 4614, 6, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016170", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "'HlWordol,!dd', 'd'", "output": "'HlWordol,!d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016171", "code": "def op(image):\n    # Assuming image is represented as a list of RGB values for each pixel\n    # Convert RGB to grayscale by averaging the RGB values\n    grayscale_image = [(pixel[0] + pixel[1] + pixel[2]) // 3 for pixel in image]\n    return grayscale_image\n", "entry_point": "op", "input": "[(37, 37, 37), (37, 37, 37), (37, 37, 37)]", "output": "[37, 37, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48312_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016172", "code": "def maximum_product(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[-2, -3, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38245_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016173", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "6, -3", "output": "-18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016174", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 12, 15, 18, 20, 5, 8, 21, 30]", "output": "(5, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016175", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.Doe@EXAOM'", "output": "'john.doe@exaom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7089", "output": "{1, 417, 3, 139, 7089, 17, 51, 2363}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016177", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[10, 7, 11]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016178", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6794", "output": "{1, 2, 3397, 6794, 43, 79, 86, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6793", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016179", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[1, 1, 1, 1, 1, 1]", "output": "[0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016180", "code": "def simulate_editor_loading(loading_steps):\n    busy = False\n    block_displayed = False\n    for step in loading_steps:\n        resource, duration = step\n        if resource == \"JS\":\n            busy = True\n        elif resource == \"CSS\":\n            block_displayed = True\n        # Simulate loading duration\n        for _ in range(duration):\n            pass\n        if resource == \"JS\":\n            busy = False\n    if busy:\n        return \"busy\"\n    elif block_displayed:\n        return \"block_displayed\"\n    else:\n        return \"idle\"\n", "entry_point": "simulate_editor_loading", "input": "[]", "output": "'idle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69961_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016181", "code": "import math\ndef calculate_control_gain(nj, amplitude, frequency):\n    control_gain = nj * (amplitude * frequency)**0.5\n    return control_gain\n", "entry_point": "calculate_control_gain", "input": "1.7497999885701225, 4, 1", "output": "3.499599977140245", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136868_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016182", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(-2, 1, 2, -1, 0, 2)", "output": "'-2.1.2.-1.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016183", "code": "def remove_non_alphanumeric(input_str):\n    result = ''\n    for char in input_str:\n        if char.isalnum() or char == '_':\n            result += char\n    return result\n", "entry_point": "remove_non_alphanumeric", "input": "'he@llo!he#llo$hell3%h'", "output": "'hellohellohell3h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139297_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016184", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[5, 3, 8]", "output": "[8, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016185", "code": "def find_database_errors(error_codes):\n    database_errors = []\n    for description, code in error_codes.items():\n        if description.startswith(\"Database\") or \"database\" in description.lower():\n            if description.startswith(\"start_\"):\n                database_errors.append(code)\n    return database_errors\n", "entry_point": "find_database_errors", "input": "{'Connection Error': 1001, 'Data retrieval error': 1002}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9157_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1343", "output": "{1, 79, 17, 1343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "929", "output": "{1, 929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016188", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-7, -9, 1, 1, 3, 3, 4, 2]", "output": "[-7, -9, 1, 1, 3, 3, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016189", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'100 542 -214 0'", "output": "'542 -214'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016190", "code": "def generate_comment_stats(comments):\n    comment_stats = {}\n    for comment in comments:\n        post_id = comment['post_id']\n        comment_stats[post_id] = comment_stats.get(post_id, 0) + 1\n    return comment_stats\n", "entry_point": "generate_comment_stats", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131851_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016191", "code": "import os\ndef get_total_file_size(file_paths):\n    total_size = 0\n    for path in file_paths:\n        if os.path.isfile(path):\n            total_size += os.path.getsize(path)\n        elif os.path.isdir(path):\n            for dirpath, _, filenames in os.walk(path):\n                for filename in filenames:\n                    file_path = os.path.join(dirpath, filename)\n                    total_size += os.path.getsize(file_path)\n    return total_size\n", "entry_point": "get_total_file_size", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11655_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016192", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(3, 0, 10)", "output": "'3.0.10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016193", "code": "def generate_list(n):\n    res = []\n    for i in range(1, (n // 2) + 1):\n        res.append(i)\n    for i in range(-(n // 2), 0):\n        res.append(i)\n    return res\n", "entry_point": "generate_list", "input": "6", "output": "[1, 2, 3, -3, -2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88002_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016194", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4387", "output": "{107, 1, 4387, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2696", "output": "{1, 2, 674, 1348, 4, 2696, 8, 337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2695", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016196", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    # Sort the dictionary by values in descending order\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "word_frequency", "input": "'helllhwhlllo'", "output": "{'helllhwhlllo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86121_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016197", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'Hello wld'", "output": "'Hello                                 wld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016198", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "[558, 559, 560]", "output": "559.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016199", "code": "def parse_variable_assignments(input_list):\n    variables_dict = {}\n    for assignment in input_list:\n        variable, value = assignment.split('=')\n        variable = variable.strip()\n        value = value.strip().strip(\"'\")\n        variables_dict[variable] = value\n    return variables_dict\n", "entry_point": "parse_variable_assignments", "input": "[\"VERSION = '1'\", \"VEIRSION = '1'\"]", "output": "{'VERSION': '1', 'VEIRSION': '1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60089_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016200", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[5, 1, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143804_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016201", "code": "def count_tag_occurrences(tags):\n    tag_counts = {}\n    for tag in tags:\n        if tag in tag_counts:\n            tag_counts[tag] += 1\n        else:\n            tag_counts[tag] = 1\n    return tag_counts\n", "entry_point": "count_tag_occurrences", "input": "['a', 'a', 'a', 'div', 'div', 'p']", "output": "{'a': 3, 'div': 2, 'p': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5046_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016202", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'toverdog'", "output": "{'toverdog': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104136_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016203", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[38, 40]", "output": "'39%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016204", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[1, 1, 2, 2, -7, 6]", "output": "[-7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016205", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "786", "output": "{1, 2, 3, 131, 262, 6, 393, 786}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016206", "code": "def total_equal_candies(candies_weights):\n    alice_pos = 0\n    bob_pos = len(candies_weights) - 1\n    bob_current_weight = 0\n    alice_current_weight = 0\n    last_equal_candies_total_number = 0\n    while alice_pos <= bob_pos:\n        if alice_current_weight <= bob_current_weight:\n            alice_current_weight += candies_weights[alice_pos]\n            alice_pos += 1\n        else:\n            bob_current_weight += candies_weights[bob_pos]\n            bob_pos -= 1\n        if alice_current_weight == bob_current_weight:\n            last_equal_candies_total_number = alice_pos + (len(candies_weights) - bob_pos - 1)\n    return last_equal_candies_total_number\n", "entry_point": "total_equal_candies", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8053_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016207", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "'EEEE'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016208", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[-3, -2, -2, -2, -5, -3, -7, -3, -2]", "output": "[2, 3, 7, 3, 5, 2, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016209", "code": "import re\ndef associateEmojiToRoles(content):\n    result = dict()  # {emoji: role_id, ...}\n    info = re.findall(r'`?(\\S+)\\s*:? (\\d{18})`?', content)\n    for emoji, role_id in info:\n        result[emoji] = role_id\n    return result\n", "entry_point": "associateEmojiToRoles", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137679_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016210", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'KJavaotnKlin'", "output": "['KJavaotnKlin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016211", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8343", "output": "{1, 3, 103, 9, 81, 309, 8343, 27, 2781, 927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016212", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "380", "output": "{1, 2, 4, 5, 38, 10, 76, 19, 20, 380, 190, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt379", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016213", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[10, 10, 5, 0]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016214", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'orbitrap', 'negative'", "output": "{'tolerance': 0.005, 'mode': 'negative'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016215", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'World!'", "output": "'Jbeyq!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016216", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'   hello 123   '", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016217", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[1, 2], [3, 4]]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016218", "code": "def filter_vowel_starting_languages(languages):\n    vowels = ['a', 'e', 'i', 'o', 'u']\n    filtered_languages = []\n    for language in languages:\n        if language[0].lower() in vowels:\n            filtered_languages.append(language)\n    return filtered_languages\n", "entry_point": "filter_vowel_starting_languages", "input": "['Python', 'Java', 'C++']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110037_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016219", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "549", "output": "{1, 3, 549, 9, 183, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016220", "code": "def generate_log_message(task_type, log_line_type):\n    log_line_prefix = \"-***-\"\n    log_line_block_prefix = \"*** START\"\n    log_line_block_suffix = \"*** END\"\n    if task_type not in [\"Training\", \"Processing\"] or log_line_type not in [\"Prefix\", \"Block Prefix\", \"Block Suffix\"]:\n        return \"Invalid task_type or log_line_type provided.\"\n    if log_line_type == \"Prefix\":\n        return f\"{log_line_prefix} {task_type}\"\n    elif log_line_type == \"Block Prefix\":\n        return f\"{log_line_block_prefix} {task_type}\"\n    elif log_line_type == \"Block Suffix\":\n        return f\"{log_line_block_suffix} {task_type}\"\n", "entry_point": "generate_log_message", "input": "'Train', 'Prefix'", "output": "'Invalid task_type or log_line_type provided.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115556_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016221", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 75, 78, 82, 95]", "output": "78.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53561_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016222", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "3.4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016223", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7613", "output": "{1, 331, 7613, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016224", "code": "def calculate_transaction_fee(gas_amount, gas_prices):\n    total_fee = 0\n    for gas_price in gas_prices:\n        fee = gas_amount * gas_price[\"amount\"]\n        total_fee += fee\n    return total_fee\n", "entry_point": "calculate_transaction_fee", "input": "0, [{'amount': 1}, {'amount': 2}]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91952_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016225", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[10, 6, 6, 2, 10, 7, 11, 2]", "output": "[10, 7, 8, 5, 14, 12, 17, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016226", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'olo hdhd hel'", "output": "'Hel Hdhd Olo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016227", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[4, 15, 4, 12, 9, 17]", "output": "[19, 19, 16, 21, 26, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137992_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016228", "code": "def average_waiting_time(arrival_times, service_times):\n    current_time = 0\n    total_waiting_time = 0\n    for arrival, service in zip(arrival_times, service_times):\n        if current_time < arrival:\n            current_time = arrival\n        total_waiting_time += max(0, current_time - arrival)\n        current_time += service\n    return round(total_waiting_time / len(arrival_times), 2)\n", "entry_point": "average_waiting_time", "input": "[0, 1, 2], [1, 1, 1]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21438_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016229", "code": "def fibonacci_iterative(num):\n    if num <= 0:\n        return None\n    if num == 1:\n        return 0\n    if num == 2:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, num):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci_iterative", "input": "11", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73606_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016230", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'ab', 'Project'", "output": "'Invalid input'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016231", "code": "MOBILENET_RESTRICTIONS = [('Camera', 10), ('GPS', 8), ('Bluetooth', 9)]\ndef filter_mobile_restrictions(threshold):\n    restricted_features = [feature for feature, version in MOBILENET_RESTRICTIONS if version >= threshold]\n    return restricted_features\n", "entry_point": "filter_mobile_restrictions", "input": "10", "output": "['Camera']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92353_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016232", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://example.com/picture.jpg_150x150'", "output": "'https://example.com/picture.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016233", "code": "import re\ndef decode_entities(xml_string):\n    def replace_entity(match):\n        entity = match.group(0)\n        if entity == '&amp;':\n            return '&'\n        # Add more entity replacements as needed\n        return entity\n    return re.sub(r'&\\w+;', replace_entity, xml_string)\n", "entry_point": "decode_entities", "input": "'x>Souffl&a</x>'", "output": "'x>Souffl&a</x>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69392_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016234", "code": "def process_genetic_data(gncnt, cluster_data):\n    maxcnt = 0\n    maxgn = \"\"\n    totcnt = sum(gncnt.values())\n    for gn in gncnt.keys():\n        if gncnt[gn] > maxcnt:\n            maxcnt = gncnt[gn]\n            maxgn = gn\n    if maxcnt / (1.0 + totcnt) <= 0.5:\n        maxgn = \"\"  # Exclude if not majority\n    for row in cluster_data:\n        clusid = row['clusid']\n        desc = row.get('desc', \"\")\n        row['desc'] = desc\n        row['genename'] = maxgn  # Assign identified gene to every cluster\n    return cluster_data\n", "entry_point": "process_genetic_data", "input": "{}, []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15248_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016235", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[10, 8, 10, 8, 8, 9, 11, 11, 3]", "output": "([10, 8, 10, 8, 8], [9, 11, 11, 3])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016236", "code": "def sum_of_digit_squares(n):\n    sum_squares = 0\n    for digit in str(n):\n        digit_int = int(digit)\n        sum_squares += digit_int ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "921", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110328_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016237", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff28\uff57\uff4f\uff45\uff4c\uff4c\uff28'", "output": "'HwoellH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016238", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "5", "output": "[1, 4, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016239", "code": "CONTROL_PORT_READ_ENABLE_BIT    = 4\nCONTROL_GRAYDOT_KILL_BIT        = 5\nCONTROL_PORT_MODE_BIT           = 6\nCONTROL_PORT_MODE_COPY          = (0b01 << CONTROL_PORT_MODE_BIT)\nCONTROL_PORT_MODE_MASK          = (0b11 << CONTROL_PORT_MODE_BIT)\ndef apply_mask(control_value, control_mask) -> int:\n    masked_value = control_value & control_mask\n    return masked_value\n", "entry_point": "apply_mask", "input": "192, 192", "output": "192", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120473_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016240", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'9 x x 8 x x 7'", "output": "987", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016241", "code": "import re\ndef generate_code(input_string):\n    words = input_string.split()\n    code = ''\n    for word in words:\n        first_letter = re.search(r'[a-zA-Z]', word)\n        if first_letter:\n            code += first_letter.group().lower()\n    return code\n", "entry_point": "generate_code", "input": "'Hello world hey are you'", "output": "'hwhay'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30063_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016242", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[3, 3, 3, 3, 5, 12, 11, 3]", "output": "[6, 6, 6, 8, 17, 23, 14, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016243", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[5, 4, 3, 2], 14", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016244", "code": "def process_application_info(dictionary: dict) -> str:\n    if 'appUid' in dictionary and 'appVersion' in dictionary:\n        app_uid = dictionary.get('appUid')\n        app_version = dictionary.get('appVersion')\n        return f'Application ID: {app_uid}, Version: {app_version}'\n    else:\n        return 'Key missing'\n", "entry_point": "process_application_info", "input": "{'appUid': '12345'}", "output": "'Key missing'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86857_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8987", "output": "{1, 11, 43, 817, 209, 19, 473, 8987}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016246", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5783", "output": "{1, 5783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016247", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'HeHlLo'", "output": "'HeHlLo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016248", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-2, -1, 3]", "output": "[[-2, -1, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016249", "code": "def calculate_json_numbers_sum(data):\n    def extract_numbers(obj):\n        if isinstance(obj, int):\n            return obj\n        elif isinstance(obj, dict):\n            return sum(extract_numbers(value) for value in obj.values())\n        elif isinstance(obj, list):\n            return sum(extract_numbers(item) for item in obj)\n        else:\n            return 0\n    total_sum = extract_numbers(data)\n    return total_sum\n", "entry_point": "calculate_json_numbers_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101957_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016250", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:77777]'", "output": "76561197960343505", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016251", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hhhellloo'", "output": "{'h': 3, 'e': 1, 'l': 3, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119981_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016252", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'BoBBoBBB'", "output": "'BoBBoBBBEuroPython'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016253", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "15", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016254", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[1, 2, 12, 12, 12], 12", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016255", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "0.5, 'Hel!'", "output": "([('Content-type', 'text/plain')], 'Hel!')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5907", "output": "{1, 33, 3, 11, 1969, 5907, 179, 537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016257", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[1, 4, 4, 3, 5, 2, 4, 4, 4]", "output": "[4, 4, 4, 2, 5, 3, 4, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016258", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[75, 80, 82, 84, 88]", "output": "82.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117950_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016259", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[5, 0, 0], [0, 6, 0], [0, 0, 6]]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1145_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016260", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "''", "output": "('', None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016261", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "13", "output": "'SDL_LOG_CATEGORY_RESERVED5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2349", "output": "{1, 3, 261, 9, 2349, 783, 81, 87, 27, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016263", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[33.0]", "output": "33.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016264", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6478", "output": "{1, 2, 3239, 41, 6478, 79, 82, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016265", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-13", "output": "-31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016266", "code": "def count_unique_divisible(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0 and num not in unique_divisible_numbers:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible", "input": "[3, 6, 9, 3, 6, 10], 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121992_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016267", "code": "def sum_squared_differences(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    sum_squared_diff = 0\n    for num1, num2 in zip(list1, list2):\n        diff = num2 - num1\n        sum_squared_diff += diff ** 2\n    return sum_squared_diff\n", "entry_point": "sum_squared_differences", "input": "[0, 1], [2, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53280_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016268", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 2, 1, 2, 2, 3, 1, 0]", "output": "[6, 3, 3, 4, 5, 4, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016269", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "105, 3, 'ooofofofoo'", "output": "{'ooofofofoo': 315}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016270", "code": "def str_between(input_str: str, left: str, right: str) -> str:\n    left_index = input_str.find(left)\n    if left_index == -1:\n        return \"\"\n    right_index = input_str.find(right, left_index + len(left))\n    if right_index == -1:\n        return \"\"\n    return input_str[left_index + len(left):right_index]\n", "entry_point": "str_between", "input": "'Today is awesome day', 'is ', ' day'", "output": "'awesome'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96216_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016271", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'23 4.1'", "output": "(4.1, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9101", "output": "{1, 19, 9101, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1101", "output": "{1, 3, 1101, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016274", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6602", "output": "{1, 6602, 2, 3301}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6601", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016275", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'viusualc'", "output": "\"Operation type 'viusualc' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016276", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'\"\"'", "output": "['']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016277", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'303085', '284'", "output": "'303085284'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016278", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[29, 30, 32, 34, 35]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016279", "code": "from typing import List\ndef min_boats(people: List[int], limit: int) -> int:\n    people.sort()\n    left, right, boats = 0, len(people) - 1, 0\n    while left <= right:\n        if people[left] + people[right] <= limit:\n            left += 1\n        right -= 1\n        boats += 1\n    return boats\n", "entry_point": "min_boats", "input": "[1, 2, 2, 3, 3, 4, 5, 5, 5, 5], 6", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49829_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016280", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "50.68000000000001, 10", "output": "40.68000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016281", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "125, 10", "output": "'0000000125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016282", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'hello', 'hello'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016283", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[3, 3, 4, 4, 5]", "output": "[3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016284", "code": "from typing import List\ndef count_contours(contour_areas: List[int], threshold: int) -> int:\n    cumulative_sum = 0\n    contour_count = 0\n    for area in contour_areas:\n        cumulative_sum += area\n        contour_count += 1\n        if cumulative_sum >= threshold:\n            return contour_count\n    return contour_count\n", "entry_point": "count_contours", "input": "[3, 5, 1], 8", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21235_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5933", "output": "{1, 349, 5933, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016286", "code": "from typing import List\ndef _remove_trailing_zeros(numbers: List[float]) -> List[float]:\n    # Iterate through the list from the end and remove trailing zeros\n    while numbers and numbers[-1] == 0.0:\n        numbers.pop()\n    return numbers\n", "entry_point": "_remove_trailing_zeros", "input": "[0.0, 0.5, 0.0, 0.0, 1.0, 0.0, 0.0]", "output": "[0.0, 0.5, 0.0, 0.0, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148979_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016287", "code": "def generate_sequence(num):\n    if num == 0:\n        raise ValueError(\"Input number cannot be 0\")\n    elif num == 1:\n        return \"1\"\n    elif num == 2:\n        return \"1 1\"\n    answer = [None, 1, 1]\n    i = 3\n    while i <= num:\n        p = answer[answer[i - 1]] + answer[i - answer[i - 1]]\n        answer.append(p)\n        i += 1\n    almost = answer[1:]\n    final_answer = \" \".join(str(n) for n in almost)\n    return final_answer\n", "entry_point": "generate_sequence", "input": "9", "output": "'1 1 2 2 3 4 4 4 5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54145_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016288", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016289", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "4, 12", "output": "b'\\x0c\\x00\\x00\\x00\\x04\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016290", "code": "def execute_processes(processes):\n    total_time = 0\n    for process in processes:\n        for command in process:\n            total_time += len(command)\n    return total_time\n", "entry_point": "execute_processes", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82676_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016291", "code": "def generate_pseudonym(name):\n    pseudonym_count = {}\n    # Split the name into words\n    words = name.split()\n    pseudonym = ''.join(word[0].upper() for word in words)\n    if pseudonym in pseudonym_count:\n        pseudonym_count[pseudonym] += 1\n    else:\n        pseudonym_count[pseudonym] = 1\n    count = pseudonym_count[pseudonym]\n    return (pseudonym + str(count), sum(pseudonym_count.values()))\n", "entry_point": "generate_pseudonym", "input": "'Bob'", "output": "('B1', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11221_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016292", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[4.0, 0.5]", "output": "4.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016293", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 7, 11, 13, 19, 22]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48394_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016294", "code": "def custom_product_list(lst):\n    total_product = 1\n    for num in lst:\n        total_product *= num\n    result = [total_product // num for num in lst]\n    return result\n", "entry_point": "custom_product_list", "input": "[1, 2, 3, 4]", "output": "[24, 12, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81118_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016295", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 6, 7", "output": "(1941, 1602)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016296", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2986", "output": "{1, 2986, 2, 1493}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016297", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[4, 4, 3, 4, 5, 4]", "output": "[4, 8, 11, 15, 20, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016298", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 4.0, 1", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016299", "code": "def rock_paper_scissors(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"It's a tie!\"\n    elif (player1_choice == 'rock' and player2_choice == 'scissors') or \\\n         (player1_choice == 'scissors' and player2_choice == 'paper') or \\\n         (player1_choice == 'paper' and player2_choice == 'rock'):\n        return 'Player 1 wins!'\n    else:\n        return 'Player 2 wins!'\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'rock'", "output": "\"It's a tie!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127812_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016300", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "11", "output": "[11, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016301", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{4: []}, 4", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016302", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[4, 3, 4, 3, 2, 4, 1]", "output": "[4, 3, 4, 3, 2, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016303", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'o worlhloo'", "output": "'o oolhlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016304", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study1234_20220ststyx.txt'", "output": "(1234, '20220ststyx')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016305", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 60]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75095_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016306", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "16, 'mode', 'input'", "output": "{'response': 'InvalidPin', 'pin': 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016307", "code": "def calculate_similarity_score(values, threshold, max_score):\n    counter = 0\n    for value in values:\n        if threshold <= value <= max_score:\n            counter += 1\n    similarity_score = counter / len(values) if len(values) > 0 else 0\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "[2, 3, 6, 7], 3, 5", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115408_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016308", "code": "from typing import List\ndef max_sub_array(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sub_array", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80022_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016309", "code": "def rotate_array(arr, s):\n    n = len(arr)\n    s = s % n\n    for _ in range(s):\n        store = arr[n-1]\n        for i in range(n-2, -1, -1):\n            arr[i+1] = arr[i]\n        arr[0] = store\n    return arr\n", "entry_point": "rotate_array", "input": "[1, 1, 1, 4, 1, 10, 2, 4], 2", "output": "[2, 4, 1, 1, 1, 4, 1, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58826_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016310", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "3", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7331", "output": "{1, 7331}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016312", "code": "def calculate_file_size(chunk_lengths):\n    total_size = 0\n    seen_bytes = set()\n    for length in chunk_lengths:\n        total_size += length\n        for i in range(length - 1):\n            if total_size - i in seen_bytes:\n                total_size -= 1\n            seen_bytes.add(total_size - i)\n    return total_size\n", "entry_point": "calculate_file_size", "input": "[10, 10, 9]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134958_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016313", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[7, 6, 1, 1, 2, 2]", "output": "[7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016314", "code": "def f(bar):\n    # type: (Union[str, bytearray]) -> str\n    if isinstance(bar, bytearray):\n        return bar.decode('utf-8')  # Convert bytearray to string\n    elif isinstance(bar, str):\n        return bar  # Return the input string as is\n    else:\n        raise TypeError(\"Input must be a string or bytearray\")\n", "entry_point": "f", "input": "bytearray(b'Hello World')", "output": "'Hello World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47415_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016315", "code": "def calculate_average_color(colors):\n    total_colors = len(colors)\n    sum_red = sum(color[0] for color in colors)\n    sum_green = sum(color[1] for color in colors)\n    sum_blue = sum(color[2] for color in colors)\n    avg_red = int(sum_red / total_colors)\n    avg_green = int(sum_green / total_colors)\n    avg_blue = int(sum_blue / total_colors)\n    return (avg_red, avg_green, avg_blue)\n", "entry_point": "calculate_average_color", "input": "[(0, 127, 0), (0, 127, 0), (0, 127, 0)]", "output": "(0, 127, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138608_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016316", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8273", "output": "{8273, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016317", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://exmp.jpg_150x150'", "output": "'https://exmp.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016318", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "7", "output": "'024681012'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016319", "code": "from typing import List\ndef sum_multiples_of_3_or_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[6, 9, 12, 15]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148821_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016320", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[4, 4]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016321", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016322", "code": "SEARCH_TYPE_CHOICES = {\n    1: \"Consent\",\n    2: \"Search Warrant\",\n    3: \"Probable Cause\",\n    4: \"Search Incident to Arrest\",\n    5: \"Protective Frisk\",\n}\nSEARCH_BASIS_CHOICES = {\n    \"ER\": \"Erratic/Suspicious Behavior\",\n    \"OB\": \"Observation of Suspected Contraband\",\n    \"OI\": \"Other Official Information\",\n    \"SM\": \"Suspicious Movement\",\n    \"TIP\": \"Informant Tip\",\n    \"WTNS\": \"Witness Observation\",\n}\ndef generate_search_report(search_type, search_basis_list):\n    search_type_desc = SEARCH_TYPE_CHOICES.get(search_type, \"Unknown Search Type\")\n    search_basis_desc = [SEARCH_BASIS_CHOICES.get(code, \"Unknown Search Basis\") for code in search_basis_list]\n    report = f\"Search Type: {search_type_desc}\\nSearch Basis:\\n\"\n    report += \"\\n\".join([f\"- {desc}\" for desc in search_basis_desc])\n    return report\n", "entry_point": "generate_search_report", "input": "1, []", "output": "'Search Type: Consent\\nSearch Basis:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10752_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016323", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@ejohn.docom'", "output": "'ejohn.docom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016324", "code": "def colorize_log_message(message, log_level):\n    RESET_SEQ = \"\\033[0m\"\n    COLOR_SEQ = \"\\033[1;%dm\"\n    COL = {\n        'DEBUG': 34, 'INFO': 35,\n        'WARNING': 33, 'CRITICAL': 33, 'ERROR': 31\n    }\n    color_code = COL.get(log_level, 37)  # Default to white if log_level not found\n    colored_message = COLOR_SEQ % color_code + message + RESET_SEQ\n    return colored_message\n", "entry_point": "colorize_log_message", "input": "'asiansThis', 'UNKNOWN'", "output": "'\\x1b[1;37masiansThis\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1938_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016325", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016326", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'main', 'invalid_action'", "output": "'main'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016327", "code": "import math\ndef calculate_polygon_area(n, s):\n    if n < 3 or n > 12:\n        return \"Number of sides must be between 3 and 12.\"\n    area = (n * s**2) / (4 * math.tan(math.pi / n))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "5, 7.1", "output": "86.72926576368981", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29408_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016328", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "160", "output": "'?160'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016329", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'Pb-82'", "output": "'Pb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016330", "code": "from typing import List, Tuple\ndef has_circular_dependency(dependencies: List[Tuple[str, str]]) -> bool:\n    graph = {node: [] for _, node in dependencies}\n    for parent, child in dependencies:\n        graph[child].append(parent)\n    def dfs(node, visited, stack):\n        visited.add(node)\n        stack.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                if dfs(neighbor, visited, stack):\n                    return True\n            elif neighbor in stack:\n                return True\n        stack.remove(node)\n        return False\n    for node in graph:\n        if dfs(node, set(), set()):\n            return True\n    return False\n", "entry_point": "has_circular_dependency", "input": "[('A', 'A')]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62221_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016331", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[10, 11, 12], 11", "output": "[12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016332", "code": "def compare_scores(player1_scores, player2_scores):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for score1, score2 in zip(player1_scores, player2_scores):\n        if score1 > score2:\n            rounds_won_player1 += 1\n        elif score2 > score1:\n            rounds_won_player2 += 1\n    return [rounds_won_player1, rounds_won_player2]\n", "entry_point": "compare_scores", "input": "[0, 1, 2, 3], [1, 2, 3, 4]", "output": "[0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107299_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016333", "code": "from collections import deque\ndef find_max_element(nums):\n    d = deque(nums)\n    max_element = None\n    while d:\n        if d[0] >= d[-1]:\n            current_max = d.popleft()\n        else:\n            current_max = d.pop()\n        if max_element is None or current_max > max_element:\n            max_element = current_max\n    return max_element\n", "entry_point": "find_max_element", "input": "[1, 2, 3, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79887_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016334", "code": "def most_accessed_memory_address(memory_addresses):\n    address_count = {}\n    for address in memory_addresses:\n        if address in address_count:\n            address_count[address] += 1\n        else:\n            address_count[address] = 1\n    max_count = max(address_count.values())\n    most_accessed_addresses = [address for address, count in address_count.items() if count == max_count]\n    return min(most_accessed_addresses)\n", "entry_point": "most_accessed_memory_address", "input": "[20, 20, 30, 30, 40]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123494_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016335", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'name=Dime=28'", "output": "{'name': 'Dime=28'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016336", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[7, 3, -1, 1]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016337", "code": "def parse_file_format_definition(definition: str) -> dict:\n    field_definitions = definition.split('\\n')\n    format_dict = {}\n    for field_def in field_definitions:\n        field_name, data_type = field_def.split(':')\n        format_dict[field_name.strip()] = data_type.strip()\n    return format_dict\n", "entry_point": "parse_file_format_definition", "input": "'name: '", "output": "{'name': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143153_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016338", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "1234569", "output": "'1.234.569'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016339", "code": "def max_height(staircase):\n    max_height = 0\n    current_height = 0\n    for step in staircase:\n        if step == '+':\n            current_height += 1\n        elif step == '-':\n            current_height -= 1\n        max_height = max(max_height, current_height)\n    return max_height\n", "entry_point": "max_height", "input": "'++++'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46647_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016340", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016341", "code": "# Dictionary mapping route names to URL endpoints\nroute_urls = {\n    'me': '/me',\n    'put': '/users',\n    'show': '/users/<string:username>',\n    'search': '/users/search',\n    'user_news_feed': '/users/<string:uuid>/feed',\n    'follow': '/follow/<string:username>',\n    'unfollow': '/unfollow/<string:username>',\n    'followers': '/followers',\n    'following': '/following',\n    'groups': '/groups',\n    'create_group': '/groups',\n    'update_group': '/groups',\n    'delete_group': '/groups',\n    'show_group': '/groups/<string:uuid>',\n    'add_user_to_group': '/groups/<string:uuid>/add_user/<string:user_uuid>'\n}\ndef get_url_for_route(route_name):\n    return route_urls.get(route_name, 'Route not found')\n", "entry_point": "get_url_for_route", "input": "'me'", "output": "'/me'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44563_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016342", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 2:\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 4)\n", "entry_point": "calculate_average", "input": "[70, 79, 80.5, 90]", "output": "79.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19408_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016343", "code": "def count_nodes_with_gpu_count(nodes, target_gpu_count):\n    count = 0\n    for node in nodes:\n        gpu_count = node['limits']['gpu_count']\n        if gpu_count == target_gpu_count:\n            count += 1\n    return count\n", "entry_point": "count_nodes_with_gpu_count", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13865_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016344", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "6, 17, 99", "output": "[17, 17, 17, 16, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016345", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1573", "output": "{1, 1573, 11, 13, 143, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016346", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, -1, 2, 6, 2]", "output": "[-1, 4, 18, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016347", "code": "from typing import List\ndef calculate_total_characters(strings: List[str]) -> int:\n    total_chars = 0\n    concatenated_string = \"\"\n    for string in strings:\n        total_chars += len(string)\n        concatenated_string += string\n    total_chars += len(concatenated_string)\n    return total_chars\n", "entry_point": "calculate_total_characters", "input": "['hello', 'world', '!', 'Python']", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56126_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016348", "code": "from typing import List, Tuple\ndef find_pairs(lst: List[int], target_sum: int) -> List[Tuple[int, int]]:\n    seen_pairs = {}\n    result = []\n    for num in lst:\n        complement = target_sum - num\n        if complement in seen_pairs:\n            result.append((num, complement))\n        seen_pairs[num] = True\n    return result\n", "entry_point": "find_pairs", "input": "[3, 3], 6", "output": "[(3, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13694_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016349", "code": "def min_cost_path(grid):\n    if not grid:\n        return 0\n    rows, cols = len(grid), len(grid[0])\n    dp = [[0 for _ in range(cols)] for _ in range(rows)]\n    dp[0][0] = grid[0][0]\n    # Fill in the first row\n    for col in range(1, cols):\n        dp[0][col] = dp[0][col - 1] + grid[0][col]\n    # Fill in the first column\n    for row in range(1, rows):\n        dp[row][0] = dp[row - 1][0] + grid[row][0]\n    # Fill in the rest of the DP table\n    for row in range(1, rows):\n        for col in range(1, cols):\n            dp[row][col] = grid[row][col] + min(dp[row - 1][col], dp[row][col - 1])\n    return dp[rows - 1][cols - 1]\n", "entry_point": "min_cost_path", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26058_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016350", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'executable'", "output": "'executable'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5463", "output": "{1, 3, 9, 5463, 1821, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016352", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[2, 5, 8, 9, 9, 17, 3, 3, 3]", "output": "[0, 5, 0, 9, 9, 17, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016353", "code": "def calculate_time_differences(timestamps):\n    \"\"\"\n    Calculates the time duration between each consecutive pair of timestamps in seconds.\n    :param timestamps: A list of timestamps in seconds\n    :return: A list of time durations between each pair of timestamps\n    \"\"\"\n    time_differences = []\n    for i in range(len(timestamps) - 1):\n        time_diff = timestamps[i + 1] - timestamps[i]\n        time_differences.append(time_diff)\n    return time_differences\n", "entry_point": "calculate_time_differences", "input": "[0, 6, 13]", "output": "[6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34086_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016354", "code": "def process_wishlist_info(data: dict) -> str:\n    welcome_message = data.get(\"welcome\", \"\").upper()\n    documentation_url = f\"({data.get('documentation', '')})\"\n    return f\"[{welcome_message}] {documentation_url}\"\n", "entry_point": "process_wishlist_info", "input": "{}", "output": "'[] ()'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18109_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016355", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'us-east-1'", "output": "'us-east'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016356", "code": "def extract_domain_names(css_links):\n    domain_names = set()\n    for link in css_links:\n        domain = link.split('/')[2]\n        domain_names.add(domain)\n    return domain_names\n", "entry_point": "extract_domain_names", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44184_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016357", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "1", "output": "'     1 B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "306", "output": "{1, 2, 3, 34, 102, 6, 9, 17, 306, 51, 18, 153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016359", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7802", "output": "{1, 2, 166, 47, 83, 7802, 3901, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016360", "code": "def time_to_seconds(text):\n    time_units = text.split(\":\")\n    hours = int(time_units[0])\n    minutes = int(time_units[1])\n    seconds = int(time_units[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'222:30:45'", "output": "801045", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11606_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016361", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "(2, 1, 3, 2, 2, 3, 5, 3, 3)", "output": "(2, 1, 3, 2, 2, 3, 5, 3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016362", "code": "def generate_pseudonym(name):\n    pseudonym_count = {}\n    # Split the name into words\n    words = name.split()\n    pseudonym = ''.join(word[0].upper() for word in words)\n    if pseudonym in pseudonym_count:\n        pseudonym_count[pseudonym] += 1\n    else:\n        pseudonym_count[pseudonym] = 1\n    count = pseudonym_count[pseudonym]\n    return (pseudonym + str(count), sum(pseudonym_count.values()))\n", "entry_point": "generate_pseudonym", "input": "'John Smith'", "output": "('JS1', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11221_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8479", "output": "{1, 139, 61, 8479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016364", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[200, 150, 100, 3]", "output": "'7 minutes and 33 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016365", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'this'", "output": "'this'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016366", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5305", "output": "{1, 5305, 5, 1061}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016367", "code": "from typing import List, Union\ndef filter_satellite_objects(satellite_list: List[Union[int, str]]) -> List[str]:\n    filtered_satellites = [satellite for satellite in satellite_list if isinstance(satellite, str)]\n    return filtered_satellites\n", "entry_point": "filter_satellite_objects", "input": "[1, 'ISS', 2, 'Hubble', 3, 'GPS']", "output": "['ISS', 'Hubble', 'GPS']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113677_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016368", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[3, 4, 2]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016369", "code": "def extract_y_coordinates(coordinates):\n    y_coordinates = []  # Initialize an empty list to store y-coordinates\n    for coord in coordinates:\n        y_coordinates.append(coord[1])  # Extract y-coordinate (index 1) and append to the list\n    return y_coordinates\n", "entry_point": "extract_y_coordinates", "input": "[(10, 20), (30, 50)]", "output": "[20, 50]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19900_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016370", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "13", "output": "366912", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1583", "output": "{1, 1583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016372", "code": "def calculate_dataset_name_lengths(list_of_datasets):\n    dataset_name_lengths = {}\n    for dataset in list_of_datasets:\n        dataset_name_lengths[dataset] = len(dataset)\n    return dataset_name_lengths\n", "entry_point": "calculate_dataset_name_lengths", "input": "['roads', 'buildings', 'rivers']", "output": "{'roads': 5, 'buildings': 9, 'rivers': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31203_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "404", "output": "{1, 2, 4, 101, 202, 404}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt403", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016374", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'* Q**CEO*M*'", "output": "('', 'Q**CEO*M*')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016375", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'aacrch64'", "output": "'aacrch64'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016376", "code": "from math import gcd\ndef calculate_output(solutionsFound):\n    a = solutionsFound[0][0]\n    b = solutionsFound[0][1]\n    c = solutionsFound[1][0]\n    d = solutionsFound[1][1]\n    k = gcd(a - c, d - b)\n    h = gcd(a + c, d + b)\n    m = gcd(a + c, d - b)\n    l = gcd(a - c, d + b)\n    n = (k**2 + h**2) * (l**2 + m**2)\n    result1 = int((k**2 + h**2) / 2)\n    result2 = int((l**2 + m**2) / 2)\n    return [result1, result2]\n", "entry_point": "calculate_output", "input": "[(1, 0), (0, 1)]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73488_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016377", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "10, 10", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016378", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff57\uff4frld'", "output": "'world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016379", "code": "def calculate_unique_lattice_points(kmesh):\n    k1, k2, k3 = kmesh\n    Rlist = [(R1, R2, R3) for R1 in range(-k1 // 2 + 1, k1 // 2 + 1)\n             for R2 in range(-k2 // 2 + 1, k2 // 2 + 1)\n             for R3 in range(-k3 // 2 + 1, k3 // 2 + 1)]\n    unique_points = set(Rlist)  # Convert to set to remove duplicates\n    return len(unique_points)\n", "entry_point": "calculate_unique_lattice_points", "input": "(3, 3, 3)", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135054_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016380", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'444444.2.14'", "output": "(444444, 2, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016381", "code": "# Constants for data types\nB3_UTF8 = \"UTF8\"\nB3_BOOL = \"BOOL\"\nB3_SVARINT = \"SVARINT\"\nB3_COMPOSITE_DICT = \"COMPOSITE_DICT\"\nB3_COMPOSITE_LIST = \"COMPOSITE_LIST\"\nB3_FLOAT64 = \"FLOAT64\"\ndef detect_data_type(obj):\n    if isinstance(obj, str):\n        return B3_UTF8\n    if obj is True or obj is False:\n        return B3_BOOL\n    if isinstance(obj, int):\n        return B3_SVARINT\n    if isinstance(obj, dict):\n        return B3_COMPOSITE_DICT\n    if isinstance(obj, list):\n        return B3_COMPOSITE_LIST\n    if isinstance(obj, float):\n        return B3_FLOAT64\n    if PY2 and isinstance(obj, long):\n        return B3_SVARINT\n    return \"Unknown\"\n", "entry_point": "detect_data_type", "input": "True", "output": "'BOOL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49151_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016382", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1261", "output": "{1, 13, 1261, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1260", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016383", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[4, 4, 3, 3, 4, 4, 4, 4]", "output": "[4, 8, 11, 14, 18, 22, 26, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016384", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'helloheello'", "output": "{'helloheello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6015", "output": "{1, 3, 5, 15, 401, 1203, 2005, 6015}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016386", "code": "def dict_eq(dict1, dict2):\n    return dict1 == dict2\n", "entry_point": "dict_eq", "input": "{'a': 1, 'b': 2}, {'a': 1, 'b': 2}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106728_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016387", "code": "def count_passed_students(scores):\n    pass_count = 0\n    for score in scores:\n        if score >= 50:\n            pass_count += 1\n    return pass_count\n", "entry_point": "count_passed_students", "input": "[50, 50, 50, 50, 50, 50, 50, 40, 45]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140531_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016388", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'373777727.0.0'", "output": "373777727", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016389", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'loveoadn'", "output": "'loveoadn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016390", "code": "def extract_and_multiply(input_str):\n    # Extract the two numbers from the input string\n    num0 = float(input_str[1:4])\n    num1 = float(input_str[5:8])\n    # Calculate the product of the two numbers\n    product = num0 * num1\n    return product\n", "entry_point": "extract_and_multiply", "input": "'x123y123'", "output": "15129.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128114_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016391", "code": "def format_parameters(params):\n    formatted_params = []\n    for key, value in params.items():\n        if isinstance(value, list):\n            formatted_value = \"[\" + \", \".join(f'\"{item}\"' if isinstance(item, str) else str(item) for item in value) + \"]\"\n        else:\n            formatted_value = f'\"{value}\"'\n        formatted_params.append(f'{key}: {formatted_value}')\n    return '\\n'.join(formatted_params)\n", "entry_point": "format_parameters", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144098_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4917", "output": "{1, 33, 3, 1639, 11, 4917, 149, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016393", "code": "def sum_secondary_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][len(matrix) - i - 1]\n    return diagonal_sum\n", "entry_point": "sum_secondary_diagonal", "input": "[[1, 2], [3, 4]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25784_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016394", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "1", "output": "'Mercury'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016395", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[70, 80, 75, 85]", "output": "77.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143012_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016396", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'tothevero', 10", "output": "['tothevero']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016397", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'2.5'", "output": "(2, 5, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016398", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[7, 8, 10, 5, 5, 1, 2], 5", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016399", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1333", "output": "{1, 43, 1333, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016400", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "12", "output": "479001600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016401", "code": "def find_pairs_with_difference(nums, k):\n    unique_nums = set(nums)\n    pair_count = 0\n    for num in nums:\n        if num + k in unique_nums:\n            pair_count += 1\n        if num - k in unique_nums:\n            pair_count += 1\n        unique_nums.add(num)\n    return pair_count // 2  # Divide by 2 to avoid double counting pairs\n", "entry_point": "find_pairs_with_difference", "input": "[2, 3], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23679_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016402", "code": "def format_color_names(input_string):\n    predefined_words = [\"is\", \"a\", \"nice\"]\n    words = input_string.split()\n    formatted_words = []\n    for word in words:\n        if word.lower() not in predefined_words:\n            word = word.capitalize()\n        formatted_words.append(word)\n    formatted_string = ' '.join(formatted_words)\n    return formatted_string\n", "entry_point": "format_color_names", "input": "'rcrolore'", "output": "'Rcrolore'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25204_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016403", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[75, 80, 81, 83, 90]", "output": "81.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105264_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3966", "output": "{1, 2, 3, 6, 1322, 661, 3966, 1983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016405", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "7", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016406", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[3, 4, 5, 1, 9, 6, 7]", "output": "[4, 5, 1, 9, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016407", "code": "def merge_intervals(arr1, arr2):\n    l = min(min(arr1), min(arr2))\n    r = max(max(arr1), max(arr2))\n    return [l, r]\n", "entry_point": "merge_intervals", "input": "[2, 4, 6], [5, 9]", "output": "[2, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98126_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016408", "code": "def check_all_open(assessments):\n    for assessment in assessments:\n        if assessment['status'] != 'open':\n            return False\n    return True\n", "entry_point": "check_all_open", "input": "[{'status': 'open'}, {'status': 'open'}, {'status': 'open'}]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32321_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016409", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'2 + 3\\n2 * 2'", "output": "['5', '4']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016410", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@exaple.com'", "output": "'exaple.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016411", "code": "def file_linear_byte_offset(values, factor, coefficients):\n    total_sum = sum(value * multiplier * coefficient for value, multiplier, coefficient in zip(values, [1] * len(values), coefficients))\n    return total_sum * factor\n", "entry_point": "file_linear_byte_offset", "input": "[100, 472], 1, [1, 1]", "output": "572", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121000_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016412", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "21, ['25', 'x']", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1179", "output": "{1, 3, 131, 393, 9, 1179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016414", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "-1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7989", "output": "{1, 3, 7989, 2663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016416", "code": "def extract_verbose_name(class_name: str) -> str:\n    # Split the class name based on uppercase letters\n    words = [char if char.isupper() else ' ' + char for char in class_name]\n    verbose_name = ''.join(words).strip()\n    # Convert the verbose name to the desired format\n    verbose_name = verbose_name.replace('Config', '').replace('ADM', ' \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0414\u0435\u0434\u043e\u0432 \u041c\u043e\u0440\u043e\u0437\u043e\u0432')\n    return verbose_name\n", "entry_point": "extract_verbose_name", "input": "'ClubAuCM'", "output": "'C l u bA uCM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42194_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016417", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<john.doe@example.com>'", "output": "('john.doe@example.com', 'example.com')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016418", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'    Python is great!   '", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8886", "output": "{1, 2, 3, 6, 1481, 2962, 8886, 4443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016420", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "124, 4", "output": "'0124'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016421", "code": "def generate_list(size):\n    alphabet = list(map(chr, range(97, 123)))  # Generating a list of lowercase alphabets\n    m = alphabet[size-1::-1] + alphabet[:size]  # Creating the list 'm' based on the given size\n    return m\n", "entry_point": "generate_list", "input": "1", "output": "['a', 'a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44532_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016422", "code": "def calculate_circle_area(radius):\n    # Approximate the value of \u03c0 as 3.14159\n    pi = 3.14159\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = pi * (radius ** 2)\n    return area\n", "entry_point": "calculate_circle_area", "input": "7", "output": "153.93791", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46985_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016423", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'acarch6h4'", "output": "'acarch6h4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016424", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'Company *Name*'", "output": "('Company', 'Name')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016425", "code": "import re\ndef extract_entities(input_str):\n    entities = set()\n    lines = input_str.split('\\n')\n    for line in lines:\n        match = re.match(r'\\w+\\((\\w+)\\)\\.', line)\n        if match:\n            entities.add(match.group())\n        match = re.match(r'\\w+\\((\\w+)\\) :-', line)\n        if match:\n            entities.add(match.group())\n        matches = re.findall(r'\\w+\\((\\w+)\\)', line)\n        entities.update(matches)\n    return entities\n", "entry_point": "extract_entities", "input": "'num(2).\\n2'", "output": "{'2', 'num(2).'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72426_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5891", "output": "{1, 137, 5891, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016427", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3633", "output": "{1, 3, 7, 519, 173, 3633, 21, 1211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3632", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016428", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'sample'", "output": "'sample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016429", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    unique_scores = []\n    top_scores = []\n    for score in sorted_scores:\n        if score not in unique_scores:\n            unique_scores.append(score)\n            top_scores.append(score)\n            if len(top_scores) == n:\n                break\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[92, 91, 90, 89, 80], 5", "output": "88.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78119_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016430", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4393", "output": "{1, 23, 191, 4393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016431", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'amery'", "output": "{'amery': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016432", "code": "def simulate_card_war(player1_deck, player2_deck):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    return player1_points, player2_points\n", "entry_point": "simulate_card_war", "input": "[3, 1, 2], [2, 4, 5]", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3214_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9195", "output": "{1, 3, 5, 613, 9195, 1839, 15, 3065}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016434", "code": "def slice_list(lst, start=None, end=None):\n    if start is not None and end is not None:\n        return lst[start:end]\n    elif start is not None:\n        return lst[start:]\n    elif end is not None:\n        return lst[:end]\n    else:\n        return lst\n", "entry_point": "slice_list", "input": "[0, 1, 2, 3, 4, 71, 100, 18, 60, 9], 5, 9", "output": "[71, 100, 18, 60]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93892_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016435", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'ello', 1", "output": "{'ello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016436", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016437", "code": "def calculate_total_time(jobs):\n    total_time = 0\n    for duration in jobs:\n        total_time += duration\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[8, 8, 8]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84145_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016438", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[0, 2, 8, 34, 34, 44]", "output": "122", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016439", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3563", "output": "{1, 3563, 509, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016440", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'character'", "output": "'Tweet posted successfully: character'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016441", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5143", "output": "{1, 139, 37, 5143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016442", "code": "def longest_palindromic_substring(s):\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    max_palindrome = \"\"\n    for i in range(len(s)):\n        # Odd-length palindrome\n        palindrome1 = expand_around_center(s, i, i)\n        # Even-length palindrome\n        palindrome2 = expand_around_center(s, i, i + 1)\n        if len(palindrome1) > len(max_palindrome):\n            max_palindrome = palindrome1\n        if len(palindrome2) > len(max_palindrome):\n            max_palindrome = palindrome2\n    return max_palindrome\n", "entry_point": "longest_palindromic_substring", "input": "'aaaaaaaaa'", "output": "'aaaaaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137320_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016443", "code": "def calculate_bmi_and_health_risk(weight, height):\n    bmi = weight / (height ** 2)\n    if bmi < 18.5:\n        health_risk = 'Underweight'\n    elif 18.5 <= bmi < 25:\n        health_risk = 'Normal weight'\n    elif 25 <= bmi < 30:\n        health_risk = 'Overweight'\n    elif 30 <= bmi < 35:\n        health_risk = 'Moderately obese'\n    elif 35 <= bmi < 40:\n        health_risk = 'Severely obese'\n    else:\n        health_risk = 'Very severely obese'\n    return bmi, health_risk\n", "entry_point": "calculate_bmi_and_health_risk", "input": "70, 1.75", "output": "(22.857142857142858, 'Normal weight')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86783_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016444", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[0, 9, 9, 6, 3, 6, 6, 10]", "output": "[9, 9, 6, 3, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016445", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9943", "output": "{1, 163, 61, 9943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016446", "code": "def solution(array):\n    result = array.copy()  # Create a copy of the input array to avoid modifying the original array\n    for i in range(len(array) - 1):\n        if array[i] == 0 and array[i + 1] == 1:\n            result[i], result[i + 1] = result[i + 1], result[i]  # Swap the elements if the condition is met\n    return result\n", "entry_point": "solution", "input": "[0, 1, 0, 1, 0, 1, 0, 1]", "output": "[1, 0, 1, 0, 1, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107637_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016447", "code": "def max_non_overlapping_circles(radii):\n    radii.sort()\n    count = 0\n    max_radius = float('-inf')\n    for radius in radii:\n        if radius >= max_radius:\n            count += 1\n            max_radius = radius * 2\n    return count\n", "entry_point": "max_non_overlapping_circles", "input": "[1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114287_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016448", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9686", "output": "{1, 2, 167, 4843, 334, 9686, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9685", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016449", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[20, 20, 12, 0]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016450", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "949", "output": "{73, 1, 13, 949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016451", "code": "def is_sensible_sequence(butterflies):\n    if len(butterflies) < 2:\n        return True  # A sequence with less than 2 butterflies is always sensible\n    for i in range(len(butterflies) - 1):\n        current_butterfly = butterflies[i]\n        next_butterfly = butterflies[i + 1]\n        if current_butterfly[-1].lower() != next_butterfly[0].lower():\n            return False  # Sequence is not sensible\n    return True  # All pairs of adjacent butterflies satisfy the condition\n", "entry_point": "is_sensible_sequence", "input": "['Butterfly', 'Moth']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96667_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2679", "output": "{1, 3, 141, 47, 19, 2679, 57, 893}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016453", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[26], 1", "output": "26.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016454", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/out'", "output": "'/tmp/ml4pl/data/out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016455", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 0, 0, 0], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016456", "code": "def generate_pascals_triangle(num_rows):\n    triangle = []\n    for row in range(num_rows):\n        current_row = []\n        for col in range(row + 1):\n            if col == 0 or col == row:\n                current_row.append(1)\n            else:\n                current_row.append(triangle[row - 1][col - 1] + triangle[row - 1][col])\n        triangle.append(current_row)\n    return triangle\n", "entry_point": "generate_pascals_triangle", "input": "2", "output": "[[1], [1, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110086_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016457", "code": "def calculate_rank(scores, new_score):\n    rank = 1\n    for score in scores:\n        if new_score < score:\n            rank += 1\n        elif new_score == score:\n            break\n        else:\n            break\n    return rank\n", "entry_point": "calculate_rank", "input": "[5, 3], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29288_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016458", "code": "def filter_students(students):\n    filtered_students = []\n    for student in students:\n        if student.get(\"age\", 0) >= 18:\n            filtered_students.append(student)\n    return filtered_students\n", "entry_point": "filter_students", "input": "[{'age': 17}, {'age': 19}, {'name': 'Alice'}, {'age': 16}]", "output": "[{'age': 19}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20992_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9122", "output": "{1, 9122, 2, 4561}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016460", "code": "def find_duplicates(titlesAll):\n    unique_titles = set()\n    duplicate_titles = []\n    for title in titlesAll:\n        if title in unique_titles and title not in duplicate_titles:\n            duplicate_titles.append(title)\n        else:\n            unique_titles.add(title)\n    return duplicate_titles\n", "entry_point": "find_duplicates", "input": "['Title1', 'Title1', 'Title2', 'Title2', 'Title3']", "output": "['Title1', 'Title2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43791_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016461", "code": "def simulate_cli_helper(commands):\n    command_status = {}\n    for command in commands:\n        name = command['name']\n        code = command['code']\n        launched = command['launched']\n        # Initialize the command\n        command_status[name] = {'code': None, 'launched': False}\n        # Update the command status\n        command_status[name]['code'] = code\n        command_status[name]['launched'] = True\n    return command_status\n", "entry_point": "simulate_cli_helper", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65520_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016462", "code": "import math\nR0 = 6378137.0\necc = 0.0818191908425\ndef calculate_geocentric_radius(latitude):\n    # Convert latitude from degrees to radians\n    phi = math.radians(latitude)\n    # Calculate the geocentric radius\n    r = R0 / math.sqrt(1 - ecc**2 * math.sin(phi)**2)\n    return r\n", "entry_point": "calculate_geocentric_radius", "input": "45", "output": "6388838.290121116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113687_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016463", "code": "def find_largest_number(int_list):\n    # Convert integers to strings for sorting\n    str_list = [str(num) for num in int_list]\n    # Custom sorting based on concatenation comparison\n    str_list.sort(key=lambda x: x*3, reverse=True)\n    # Join the sorted strings to form the largest number\n    max_num = \"\".join(str_list)\n    return max_num\n", "entry_point": "find_largest_number", "input": "[9, 5, 34, 3, 3, 0]", "output": "'9534330'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86890_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016464", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 48", "output": "'48%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016465", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kikirjakauppa./'", "output": "'http://kikirjakauppa./'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016466", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016467", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'Petalppetali', 'Jjaajanene', 'Smit'", "output": "'Petalppetali Jjaajanene Smit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016468", "code": "# Step 1: Define the expected plaintext value\nexpected_plaintext = \"Hello, World!\"\n# Step 2: Implement a function to decrypt the message using the specified cipher\ndef decrypt_message(cipher, encrypted_message):\n    # Simulate decryption using the specified cipher\n    decrypted_message = f\"Decrypted: {encrypted_message}\"  # Placeholder decryption logic\n    return decrypted_message\n", "entry_point": "decrypt_message", "input": "'dummy_cipher', 'strssage'", "output": "'Decrypted: strssage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65674_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016469", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[3, 1, 1, 1, 3, 2, 6, 1]", "output": "[3, 1, 1, 1, 3, 2, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016470", "code": "def check_test_results(logs: str) -> int:\n    logs = logs.replace(\",\", \"\")  # Remove commas from the logs\n    words = logs.split()  # Split the logs into words\n    terms = ['failed', 'FAILURES']\n    for term in terms:\n        if term in words:\n            return 1  # Exit status 1 if any term is found\n    return 0  # Exit status 0 if none of the terms are found\n", "entry_point": "check_test_results", "input": "'failed'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90182_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016471", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[6, 0, 4, 0, 6, -1, 7, 5]", "output": "[6, 0, 4, 0, 6, -1, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1899", "output": "{1, 3, 9, 1899, 211, 633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016473", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[3, 3, 1, 1, 4, 2, 2]", "output": "[3, 1, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016474", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "[10, 10, 3]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5323", "output": "{1, 5323}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016476", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[0, 0, 0, 0]", "output": "[0, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8309", "output": "{1, 1187, 8309, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016478", "code": "MOBILENET_RESTRICTIONS = [('Camera', 10), ('GPS', 8), ('Bluetooth', 9)]\ndef filter_mobile_restrictions(threshold):\n    restricted_features = [feature for feature, version in MOBILENET_RESTRICTIONS if version >= threshold]\n    return restricted_features\n", "entry_point": "filter_mobile_restrictions", "input": "8", "output": "['Camera', 'GPS', 'Bluetooth']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92353_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016479", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'worlod!'", "output": "('', 'worlod!')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016480", "code": "def encrypt_text(text: str, k: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        new_ascii = ord(char) + k\n        if new_ascii > 126:\n            new_ascii = 32 + (new_ascii - 127)\n        encrypted_text += chr(new_ascii)\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Hello, World!', 5", "output": "'Mjqqt1%\\\\twqi&'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40126_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9862", "output": "{1, 2, 4931, 9862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9861", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016482", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016483", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'11:59:59 PM'", "output": "'23:59:59'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7253", "output": "{1, 7253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7252", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016485", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "0, 10, 0", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016486", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 75, 50, 20, 20]", "output": "[100, 75, 50]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016487", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8794", "output": "{1, 8794, 2, 4397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8793", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016488", "code": "def is_magic_square(matrix):\n    n = len(matrix)\n    # Check if it is a square matrix\n    if any(len(row) != n for row in matrix):\n        return False\n    target_sum = sum(matrix[0])  # Target sum for rows, columns, and diagonals\n    # Calculate sum of main diagonal\n    diagonal_sum = sum(matrix[i][i] for i in range(n))\n    if diagonal_sum != target_sum:\n        return False\n    # Calculate sum of anti-diagonal\n    anti_diagonal_sum = sum(matrix[i][n - i - 1] for i in range(n))\n    if anti_diagonal_sum != target_sum:\n        return False\n    # Check rows and columns\n    for i in range(n):\n        if sum(matrix[i]) != target_sum or sum(matrix[j][i] for j in range(n)) != target_sum:\n            return False\n    return True\n", "entry_point": "is_magic_square", "input": "[[8, 1, 6], [3, 5, 7], [4, 9, 2]]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94976_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016489", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[3, 2, 3, 4, 2, 0, 1, 4]", "output": "[5, 5, 7, 6, 2, 1, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016490", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'1.3.3'", "output": "(1, 3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016491", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "5, 3", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016492", "code": "def process_revision(revision):\n    # Extract the first 6 characters of the revision string in reverse order\n    key = revision[:6][::-1]\n    # Update the down_revision variable with the extracted value\n    global down_revision\n    down_revision = key\n    return down_revision\n", "entry_point": "process_revision", "input": "'0b7ccbxyz'", "output": "'bcc7b0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39423_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016493", "code": "from typing import List, Union\ndef sum_even_numbers(input_list: List[Union[int, str]]) -> int:\n    sum_even = 0\n    for element in input_list:\n        if isinstance(element, int):\n            if element % 2 == 0:\n                sum_even += element\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[-8]", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67584_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016494", "code": "def upgradeDriverCfg(version, dValue={}, dOption=[]):\n    \"\"\"Upgrade the config given by the dict dValue and dict dOption to the\n    latest version.\"\"\"\n    dQuantReplace = {}\n    if version == '1.0':\n        version = '1.1'\n        dValue['Enable demodulation'] = True\n    elif version == '1.1':\n        version = '1.2'\n        dValue['Enable logging'] = True\n        dQuantReplace['Missing logging quantity'] = 'Default logging value'\n    return (version, dValue, dOption, dQuantReplace)\n", "entry_point": "upgradeDriverCfg", "input": "'', {}, []", "output": "('', {}, [], {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47336_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016495", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tasks=addtasks'", "output": "{'field': 'tasks', 'value': 'addtasks'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016496", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1249", "output": "{1, 1249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016497", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'twld iwws'", "output": "{'twld': 1, 'iwws': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016498", "code": "def get_parent_directory(file_path):\n    # Split the file path into directory components\n    components = file_path.split('/')\n    # Join all components except the last one to get the parent directory path\n    parent_directory = '/'.join(components[:-1])\n    return parent_directory\n", "entry_point": "get_parent_directory", "input": "'path/to/filename.txt'", "output": "'path/to'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11463_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1119", "output": "{1, 3, 373, 1119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016500", "code": "from collections import deque\ndef new_year_chaos(n, q):\n    acc = 0\n    expect = list(range(1, n + 1))\n    q = deque(q)\n    while q:\n        iof = expect.index(q[0])\n        if iof > 2:\n            return 'Too chaotic'\n        else:\n            acc += iof\n            expect.remove(q[0])\n            q.popleft()\n    return acc\n", "entry_point": "new_year_chaos", "input": "2, [2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98787_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016501", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 5, 2", "output": "(1740, 529)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016502", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[4, 0, 5, 0, 3, 0, 3, 0, 4]", "output": "'aaaabbbbbcccdddeeee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016503", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 2, 2, 0, -3, -2, 0, 0]", "output": "[0, 3, 8, 9, 4, 15, 36, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016504", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[75, 75, 100, 101, 85, 73, 72]", "output": "{75: 2, 100: 1, 101: 1, 85: 1, 73: 1, 72: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016505", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max\n", "entry_point": "find_second_largest", "input": "[10, 20, 25]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84134_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016506", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[23, 45, 56]", "output": "(56, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016507", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 80, 70, 60, 60, 60]", "output": "[1, 2, 3, 4, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016508", "code": "# Simulated global variable to store open windows\nwindows = []\ndef close_windows(window_names):\n    global windows\n    for window_name in window_names:\n        if window_name in windows:\n            windows.remove(window_name)\n    return f\"Closed windows: {', '.join(window_names)}\"\n", "entry_point": "close_windows", "input": "['Window1', 'Window3']", "output": "'Closed windows: Window1, Window3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71818_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016509", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[1, 2, 2, 5, 8, 3]", "output": "[3, 4, 7, 13, 11, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137992_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016510", "code": "def split_into_chunks(data, chunk_size):\n    num_chunks = -(-len(data) // chunk_size)  # Calculate the number of chunks needed\n    chunks = []\n    for i in range(num_chunks):\n        start = i * chunk_size\n        end = (i + 1) * chunk_size\n        chunk = data[start:end]\n        if len(chunk) < chunk_size:\n            chunk += [None] * (chunk_size - len(chunk))  # Pad with None values if needed\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_into_chunks", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, None, None]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138006_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9997", "output": "{1, 13, 9997, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016512", "code": "import re\ndef generate_slug(value):\n    def django_slugify(value):\n        # Placeholder for the default slugify method\n        return re.sub(r'[^a-z0-9-]', '', value.lower().replace(' ', '-'))\n    try:\n        from unidecode import unidecode\n        return re.sub(r'[^a-z0-9-]', '', unidecode(value.lower()))\n    except ImportError:\n        try:\n            from pytils.translit import slugify\n            return re.sub(r'[^a-z0-9-]', '', slugify(value.lower()))\n        except ImportError:\n            return re.sub(r'[^a-z0-9-]', '', django_slugify(value))\n", "entry_point": "generate_slug", "input": "'wod'", "output": "'wod'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85241_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016513", "code": "from typing import List, Dict\ndef reverse_location_mapping(locations: List[str], location_index_mapping: Dict[str, int]) -> Dict[int, str]:\n    # Check if the input dictionary is a valid mapping of locations to indices\n    if not all(isinstance(idx, int) for idx in location_index_mapping.values()):\n        raise ValueError(\"Input dictionary is not a valid mapping of locations to indices.\")\n    # Create the reverse mapping\n    reverse_mapping = {idx: loc for loc, idx in location_index_mapping.items()}\n    return reverse_mapping\n", "entry_point": "reverse_location_mapping", "input": "[], {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145604_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016514", "code": "def generate_unique_id(section_name):\n    length = len(section_name)\n    if length % 2 == 0:  # Even length\n        unique_id = section_name + str(length)\n    else:  # Odd length\n        unique_id = section_name[::-1] + str(length)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'nnn_mnede'", "output": "'edenm_nnn9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126473_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016515", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4279", "output": "{1, 11, 389, 4279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7603", "output": "{1, 7603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016517", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "5", "output": "'./prespawned/version5_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016518", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'ggMMg2gMgMMgMM'", "output": "'ggMMg\u2082gMgMMgMM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016519", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3322", "output": "{1, 2, 11, 302, 22, 151, 3322, 1661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3321", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016520", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 66587294, 1", "output": "66587294", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016521", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaaDDeeee'", "output": "'a3D2e4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016522", "code": "def longest_increasing_sequence_length(nums):\n    if not nums:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "longest_increasing_sequence_length", "input": "[3, 4, 5, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79552_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016523", "code": "from typing import Optional\ndef time_spec_to_seconds(spec: str) -> Optional[int]:\n    time_units = {'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1}\n    components = []\n    current_component = ''\n    for char in spec:\n        if char.isnumeric():\n            current_component += char\n        elif char in time_units:\n            if current_component:\n                components.append((int(current_component), char))\n                current_component = ''\n        else:\n            current_component = ''  # Reset if delimiter other than time unit encountered\n    if current_component:\n        components.append((int(current_component), 's'))  # Assume seconds if no unit specified\n    total_seconds = 0\n    last_unit_index = -1\n    for value, unit in components:\n        unit_index = 'wdhms'.index(unit)\n        if unit_index < last_unit_index:\n            return None  # Out of order, return None\n        total_seconds += value * time_units[unit]\n        last_unit_index = unit_index\n    return total_seconds\n", "entry_point": "time_spec_to_seconds", "input": "'1w1d11m'", "output": "691860", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65809_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016524", "code": "def manhattan_distance(point1, point2):\n    x1, y1 = point1\n    x2, y2 = point2\n    return abs(x1 - x2) + abs(y1 - y2)\n", "entry_point": "manhattan_distance", "input": "(0, 0), (20, 0)", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128962_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016525", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "1, -0.002752466683524503", "output": "-0.0013762333417622515", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1417", "output": "{1, 1417, 109, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016527", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[0, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016528", "code": "import collections\ndef count_subarrays(a, k):\n    n = len(a)\n    s = [0] * (n + 1)\n    for i in range(n):\n        s[i + 1] = s[i] + a[i]\n    for i in range(1, n + 1):\n        s[i] = (s[i] - i) % k\n    cnt = collections.defaultdict(int)\n    cnt[0] = 1\n    res = 0\n    for i in range(1, n + 1):\n        res += cnt[s[i]]\n        cnt[s[i]] += 1\n        if i - (k - 1) >= 0:\n            cnt[s[i - (k - 1)]] -= 1\n    return res\n", "entry_point": "count_subarrays", "input": "[1, 1, 1], 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104413_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016529", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level_1': 250, 'level_2': 315}", "output": "565", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016530", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[93, 92, 92, 85, 78, 88]", "output": "[93, 92, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016531", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "18, 'mode', 'input'", "output": "{'response': 'InvalidPin', 'pin': 18}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016532", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3862", "output": "{1, 2, 1931, 3862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3861", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3875", "output": "{1, 3875, 5, 775, 25, 155, 125, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016534", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3587", "output": "{1, 3587, 17, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016535", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'text'", "output": "'<p>text</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016536", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[-1, 5, 24]", "output": "-120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8373", "output": "{1, 3, 8373, 2791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016538", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[[2], [3]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5647", "output": "{1, 5647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016540", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[3, 6, 2, 1, 2, 6]", "output": "[3, 6, 2, 1, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016541", "code": "def calculate_input_dim(env_name, ob_space):\n    def observation_size(space):\n        return len(space)\n    def goal_size(space):\n        return 0  # Assuming goal information size is 0\n    def box_size(space):\n        return 0  # Assuming box size is 0\n    def robot_state_size(space):\n        return len(space)\n    if env_name == 'PusherObstacle-v0':\n        input_dim = observation_size(ob_space) - goal_size(ob_space) - box_size(ob_space)\n    elif 'Sawyer' in env_name:\n        input_dim = robot_state_size(ob_space)\n    else:\n        raise NotImplementedError(\"Input dimension calculation not implemented for this environment\")\n    return input_dim\n", "entry_point": "calculate_input_dim", "input": "'PusherObstacle-v0', [0, 0, 0, 0, 0, 0, 0]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88440_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9442", "output": "{4721, 1, 9442, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016543", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9751", "output": "{1, 7, 199, 49, 1393, 9751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016544", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "1", "output": "'Skipped due to being older'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016545", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        if height > prev_height:\n            total_area += height\n        else:\n            total_area += prev_height\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[3, 5, 10, 10]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147834_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016546", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[5, 2, 1, 5, 9, 6]", "output": "[9, 6, 5, 5, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016547", "code": "def sum_with_next(lst):\n    new_list = []\n    for i in range(len(lst)):\n        if i < len(lst) - 1:\n            new_list.append(lst[i] + lst[i + 1])\n        else:\n            new_list.append(lst[i] + lst[0])\n    return new_list\n", "entry_point": "sum_with_next", "input": "[3, 4, -3, 7, -3, 4, -1, 2]", "output": "[7, 1, 4, 4, 1, 3, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34169_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016548", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[100, 90, 90, 90, 90, 80, 70, 70]", "output": "[1, 2, 2, 2, 2, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016549", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[0, 4, 4, 8, 8, 8, 5, 6, 7]", "output": "[0, 4, 4, 8, 8, 8, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016550", "code": "def count_unique_urls(url_patterns):\n    unique_urls = set()\n    for url_pattern in url_patterns:\n        normalized_url = ''.join(['a' if c == '{' or c == '}' else c for c in url_pattern])\n        unique_urls.add(normalized_url)\n    return len(unique_urls)\n", "entry_point": "count_unique_urls", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102147_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2697", "output": "{1, 3, 899, 2697, 93, 87, 29, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016552", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'01:30:20 AM'", "output": "'01:30:20'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016553", "code": "from typing import List, Tuple\nfrom collections import deque\ndef check_confirmations(transactions: List[Tuple[str, int]]) -> List[bool]:\n    confirmations = [0] * len(transactions)\n    pending_transactions = deque()\n    output = []\n    for transaction in transactions:\n        pending_transactions.append(transaction)\n    for _ in range(len(pending_transactions)):\n        current_transaction = pending_transactions.popleft()\n        confirmations[transactions.index(current_transaction)] += 1\n        if confirmations[transactions.index(current_transaction)] >= current_transaction[1]:\n            output.append(True)\n        else:\n            output.append(False)\n    return output\n", "entry_point": "check_confirmations", "input": "[('tx1', 1), ('tx2', 2), ('tx3', 1)]", "output": "[True, False, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69837_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016554", "code": "def compute_dist_excluding_gaps(ref_seq, seq):\n    matching_count = 0\n    for ref_char, seq_char in zip(ref_seq, seq):\n        if ref_char != '-' and seq_char != '-' and ref_char == seq_char:\n            matching_count += 1\n    distance = 1 - (matching_count / len(seq))\n    return distance\n", "entry_point": "compute_dist_excluding_gaps", "input": "'AAACCBB', 'AAAGGBG'", "output": "0.4285714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47319_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016555", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1499", "output": "{1, 1499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016556", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[0, 0, 0, 0], 1, 4", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016557", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Hhelohlo,'", "output": "['hhelohlo,']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016558", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[1, 1, 2, 3, 2, 2]", "output": "[2, 3, 5, 5, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016559", "code": "import math\ndef calculate_polygon_area(n, s):\n    area = (n * s**2) / (4 * math.tan(math.pi / n))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "5, 6", "output": "61.93718642120281", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48950_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016560", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "8, 97", "output": "776", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016561", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abcabbc#e'", "output": "['abcabbc', 'e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016562", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[10, 11, 10]", "output": "1100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016563", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hhorld!'", "output": "{'hhorld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016564", "code": "def most_common_element(input_list):\n    element_count = {}\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common = max(element_count, key=element_count.get)\n    return most_common\n", "entry_point": "most_common_element", "input": "[7, 7, 7, 2, 3]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6653_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016565", "code": "from typing import List\ndef rearrange_list(a_list: List[int]) -> int:\n    pivot = a_list[-1]\n    list_length = len(a_list)\n    for i in range(list_length - 2, -1, -1):  # Iterate from the second last element to the first\n        if a_list[i] > pivot:\n            a_list.insert(list_length, a_list.pop(i))  # Move the element to the right of the pivot\n    return a_list.index(pivot)\n", "entry_point": "rearrange_list", "input": "[1, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141863_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4303", "output": "{1, 331, 13, 4303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016567", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'hello_world_how_are_you'", "output": "'helloWorldHowAreYou'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016568", "code": "def simulate_card_game(deck_a, deck_b):\n    round_count = 0\n    history = set()\n    while round_count < 100 and deck_a and deck_b:\n        round_count += 1\n        current_state = (tuple(deck_a), tuple(deck_b))\n        if current_state in history:\n            return 'Draw'\n        history.add(current_state)\n        card_a, card_b = deck_a.pop(0), deck_b.pop(0)\n        if card_a > card_b:\n            deck_a.extend([card_a, card_b])\n        elif card_b > card_a:\n            deck_b.extend([card_b, card_a])\n        else:\n            if len(deck_a) < 3 or len(deck_b) < 3:\n                return 'Draw'\n            else:\n                war_cards = [card_a, card_b] + deck_a[:3] + deck_b[:3]\n                deck_a = deck_a[3:]\n                deck_b = deck_b[3:]\n                if war_cards[2] > war_cards[5]:\n                    deck_a.extend(war_cards)\n                else:\n                    deck_b.extend(war_cards)\n    if not deck_a:\n        return 'Player B'\n    elif not deck_b:\n        return 'Player A'\n    else:\n        return 'Draw'\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3], [4, 5, 6]", "output": "'Player B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98621_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016569", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "1022", "output": "'  1022 B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016570", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6333", "output": "{1, 3, 6333, 2111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016571", "code": "def calculate_project_cost(base_cost: float, cost_per_line: float, lines_of_code: int) -> float:\n    total_cost = base_cost + (lines_of_code * cost_per_line)\n    return total_cost\n", "entry_point": "calculate_project_cost", "input": "2000.0, 0.0, 0", "output": "2000.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125885_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016572", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'city=LA'", "output": "{'city': 'LA'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016573", "code": "def repeat_container(colors, container_name):\n    result = {}\n    for color in colors:\n        repetitions = len(color) // len(container_name)\n        result[color] = container_name * repetitions\n    return result\n", "entry_point": "repeat_container", "input": "['#3ae#f', '#33aeff'], 'container'", "output": "{'#3ae#f': '', '#33aeff': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112013_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016574", "code": "import re\nurl_patterns = [\n    (\"^add_cart$\", \"AddCartView\"),\n    (\"^$\", \"ShowCartView\"),\n    (\"^update_cart$\", \"UpdateCartView\"),\n    (\"^delete_cart$\", \"DeleteCartView\"),\n]\ndef resolve_view(url_path):\n    for pattern, view_class in url_patterns:\n        if re.match(pattern, url_path):\n            return view_class\n    return \"Page Not Found\"\n", "entry_point": "resolve_view", "input": "'add_cart'", "output": "'AddCartView'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149933_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016575", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_anit', 10", "output": "'\\n  .width(test_anit);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016576", "code": "def scatter_nd_simple(data, indices, updates):\n    updated_data = [row[:] for row in data]  # Create a copy of the original data\n    for idx, update in zip(indices, updates):\n        row_idx, col_idx = idx\n        updated_data[row_idx][col_idx] += update\n    return updated_data\n", "entry_point": "scatter_nd_simple", "input": "[[10, 2], [3, 20]], [(0, 0), (1, 1)], [1, 4]", "output": "[[11, 2], [3, 24]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7645_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016577", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(59, 22, 30, 50, 31, 61, 50, 61)", "output": "(61, 50, 61, 31, 50, 30, 22, 59)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016578", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'name'", "output": "'name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6654", "output": "{1, 2, 3, 6, 2218, 1109, 6654, 3327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016580", "code": "import itertools\ndef optimize_cooling_system(cooling_units, cooling_demand, cost_per_hour):\n    min_cost = float('inf')\n    for r in range(1, len(cooling_units) + 1):\n        for combo in itertools.combinations(cooling_units, r):\n            total_consumption = sum(combo)\n            total_cost = total_consumption * cost_per_hour\n            if total_consumption >= cooling_demand and total_cost < min_cost:\n                min_cost = total_cost\n    return min_cost\n", "entry_point": "optimize_cooling_system", "input": "[5], 5, -7.05024", "output": "-35.2512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67427_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016581", "code": "def count_connected_components(graph):\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph[node]:\n            if neighbor not in visited:\n                dfs(neighbor)\n    visited = set()\n    components = 0\n    for node in graph:\n        if node not in visited:\n            dfs(node)\n            components += 1\n    return components\n", "entry_point": "count_connected_components", "input": "{'A': ['B'], 'B': ['A'], 'C': ['D'], 'D': ['C']}", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83274_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016582", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-7, -7, -6, -6, -6, -5, -2, -1]", "output": "[-7, -7, -6, -6, -6, -5, -2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016583", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'OGJVD', 7", "output": "'VNQCK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016584", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 9, 7, 16, 6, 9, 6, 6]", "output": "[1, 9, 49, 343, 1296, 59049, 46656, 279936]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016585", "code": "def sum_of_squares(numbers):\n    total = sum(num**2 for num in numbers)\n    return total\n", "entry_point": "sum_of_squares", "input": "[7, 2]", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52852_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016586", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "4, 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016587", "code": "from typing import List\nimport heapq\ndef min_time_to_complete_tasks(tasks: List[int], num_concurrent: int) -> int:\n    if not tasks:\n        return 0\n    tasks.sort()  # Sort tasks in ascending order of processing times\n    pq = []  # Priority queue to store the next available task to start\n    time = 0\n    running_tasks = []\n    for task in tasks:\n        while len(running_tasks) >= num_concurrent:\n            next_task_time, next_task = heapq.heappop(pq)\n            time = max(time, next_task_time)\n            running_tasks.remove(next_task)\n        time += task\n        running_tasks.append(task)\n        heapq.heappush(pq, (time, task))\n    return max(time, max(pq)[0])  # Return the maximum time taken to complete all tasks\n", "entry_point": "min_time_to_complete_tasks", "input": "[10, 12, 12], 2", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10650_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016588", "code": "def calculate_error(list1, list2):\n    total_error = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_error\n", "entry_point": "calculate_error", "input": "[2, 3], [0, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33914_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016589", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "4, 25, 101", "output": "[26, 25, 25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1599", "output": "{1, 3, 39, 41, 13, 533, 123, 1599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016591", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 3, 3]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016592", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'[\"iteitem3temem3\"]'", "output": "['iteitem3temem3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016593", "code": "def inline_script_tag(html_code, script_tag):\n    start_tag = '<script>'\n    end_tag = '</script>'\n    script_start = script_tag.find(start_tag) + len(start_tag)\n    script_end = script_tag.find(end_tag)\n    script_content = script_tag[script_start:script_end]\n    modified_html = html_code.replace(script_tag, f'<script>{script_content}</script>')\n    return modified_html\n", "entry_point": "inline_script_tag", "input": "'</html>', \"<script>console.log('test');</script>\"", "output": "'</html>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41150_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016594", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "6.864700820757214, 5, 1.5", "output": "1.2431338805048096", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016595", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[80, 80, 75, 75]", "output": "77.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016596", "code": "def categorize_images(image_dict):\n    categories = {\n        'Anatomical': ('localizer', 'flair', 'ir_epi', 'mprage', 't2w'),\n        'Diffusion': ('dwi', 'dwi_derived', 'dwi_fieldmap', 'dwi_sbref'),\n        'Functional': ('bold', 'func_fieldmap', 'func_sbref'),\n        'Physiological': ('physio_log'),\n        'Unknown': ('unknown_type')\n    }\n    categorized_images = []\n    for image_name, sequence_type in image_dict.items():\n        for category, subcategories in categories.items():\n            if sequence_type in subcategories:\n                categorized_images.append((image_name, category))\n                break\n    return categorized_images\n", "entry_point": "categorize_images", "input": "{'image1': 'random_type1', 'image2': 'random_type2'}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134887_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016597", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[0, 2, 2, 2, 4, 0, 0]", "output": "[0, 2, 4, 6, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016598", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4]", "output": "[1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016599", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[30.0]", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016600", "code": "def simulate_card_war(player1_deck, player2_deck):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_points += 1\n        elif card2 > card1:\n            player2_points += 1\n    return player1_points, player2_points\n", "entry_point": "simulate_card_war", "input": "[2, 4, 5, 1, 3, 0], [1, 2, 3, 4, 5, 6]", "output": "(3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3214_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7724", "output": "{1, 2, 4, 1931, 7724, 3862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7723", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016602", "code": "def snake_case(string):\n    return string.replace(\" \", \"_\").lower()\n", "entry_point": "snake_case", "input": "'hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78100_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016603", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4253", "output": "{1, 4253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4252", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016604", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[2, 0, 3, 2, 0, 1, 0, 0]", "output": "[2, 0, 3, 2, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2743", "output": "{1, 211, 13, 2743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2742", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016606", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 5, 45]", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35742_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016607", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[5, 1, -5, 2, 9, 3, 2]", "output": "[6, -4, -3, 11, 12, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016608", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[0, 1, 2, 3, 5, 8, 13, 21, 34]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016609", "code": "def encrypt_decrypt_message(message, shift):\n    result = \"\"\n    for char in message:\n        if char.isupper():\n            result += chr((ord(char) - 65 + shift) % 26 + 65) if char.isupper() else char\n        elif char.islower():\n            result += chr((ord(char) - 97 + shift) % 26 + 97) if char.islower() else char\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt_decrypt_message", "input": "'eHlljCz,', 5", "output": "'jMqqoHe,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149832_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7489", "output": "{7489, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016611", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[5, 0], [6, 1], [2, 2]]", "output": "[[5], [6], [2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016612", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=-200'", "output": "(None, 200)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016613", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[1, 2, 3], 5", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016614", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "291", "output": "{3, 1, 291, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016615", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'E@Example.Com'", "output": "'e@example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016616", "code": "def generate_secret_key(property_id, stream_id):\n    concatenated_str = property_id + \"-\" + stream_id\n    ascii_sum = sum(ord(char) for char in concatenated_str)\n    secret_key = ascii_sum % 256\n    return secret_key\n", "entry_point": "generate_secret_key", "input": "'a', '9'", "output": "199", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135157_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016617", "code": "def find_min_temperature(temperatures):\n    min_temp = float('inf')  # Initialize min_temp to a large value\n    for temp in temperatures:\n        if temp < min_temp:\n            min_temp = temp\n    return min_temp\n", "entry_point": "find_min_temperature", "input": "[5, 10, 15]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36490_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016618", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "'http://ge'", "output": "'ge'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016619", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'gyroscope'", "output": "'Value of gyroscope'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016620", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6087", "output": "{1, 3, 2029, 6087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "758", "output": "{1, 2, 379, 758}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016622", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaaabbbrr'", "output": "{'a': 4, 'b': 3, 'r': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016623", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7313", "output": "{1, 7313, 103, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016624", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'2.5.1'", "output": "(2, 5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016625", "code": "def restore_original_str(s):\n    result = \"\"\n    i = 0\n    while i < len(s):\n        if s[i] == '#':\n            if i + 2 < len(s) and s[i + 2] == '=':\n                ascii_val = int(s[i + 1]) + int(s[i + 3])\n                result += chr(ascii_val)\n                i += 4\n            else:\n                result += chr(int(s[i + 1]))\n                i += 2\n        else:\n            result += s[i]\n            i += 1\n    return result\n", "entry_point": "restore_original_str", "input": "'1#0=0223'", "output": "'1\\x00223'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87838_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016626", "code": "def extract_app_name(config: str) -> str:\n    # Find the index of the equal sign\n    equal_index = config.index(\"=\")\n    # Extract the substring after the equal sign\n    app_name = config[equal_index + 1:]\n    # Strip any leading or trailing spaces\n    app_name = app_name.strip()\n    return app_name\n", "entry_point": "extract_app_name", "input": "'='", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77630_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016627", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 50, 30]", "output": "[1, 2, 3, 4, 5, 6, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016628", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "10", "output": "259", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016629", "code": "def strings_with_digits(input_list):\n    output_list = []\n    for string in input_list:\n        for char in string:\n            if char.isdigit():\n                output_list.append(string)\n                break  # Break the inner loop once a digit is found in the string\n    return output_list\n", "entry_point": "strings_with_digits", "input": "['123', 'abc', 'def4', 'ghi', '5jkl', 'xyz']", "output": "['123', 'def4', '5jkl']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43239_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016630", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 4, 6, 1, 3, 1, 3, 4]", "output": "[1, 5, 8, 4, 7, 6, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016631", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[9]", "output": "[9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt68", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "174", "output": "{1, 2, 3, 6, 174, 87, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt173", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016633", "code": "from typing import List\ndef delete_entities(entity_list: List[int], delete_ids: List[int]) -> List[int]:\n    return [entity for entity in entity_list if entity not in delete_ids]\n", "entry_point": "delete_entities", "input": "[7, 5, 9, 8, 8, 2, 8, 10], [1, 3, 4, 6, 10]", "output": "[7, 5, 9, 8, 8, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62424_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016634", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(2, 4, 3, 3, 3, 3, 3)", "output": "'2.4.3.3.3.3.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016635", "code": "def min_changes_to_anagram(bigger_str, smaller_str):\n    str_counter = {}\n    for char in bigger_str:\n        if char in str_counter:\n            str_counter[char] += 1\n        else:\n            str_counter[char] = 1\n    for char in smaller_str:\n        if char in str_counter:\n            str_counter[char] -= 1\n    needed_changes = 0\n    for counter in str_counter.values():\n        needed_changes += abs(counter)\n    return needed_changes\n", "entry_point": "min_changes_to_anagram", "input": "'zzzaaa', 'abc'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124427_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016636", "code": "CREATE = 'create'\nREPLACE = 'replace'\nUPDATE = 'update'\nDELETE = 'delete'\nALL = (CREATE, REPLACE, UPDATE, DELETE)\n_http_methods = {\n    CREATE: ('post',),\n    REPLACE: ('put',),\n    UPDATE: ('patch',),\n    DELETE: ('delete',)\n}\ndef get_http_methods(method):\n    return _http_methods.get(method, ('get',))  # Default to 'get' if method not found\n", "entry_point": "get_http_methods", "input": "UPDATE", "output": "('patch',)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23129_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016637", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'lhhello'", "output": "b'\\x07\\x00\\x00\\x00lhhello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016638", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -1, -2", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016639", "code": "def lcs_length(x, y):\n    m, n = len(x), len(y)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if x[i - 1] == y[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'a', 'ab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71926_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016640", "code": "from typing import List, Dict, Union\ndef process_user_data(user_data: List[Dict[str, Union[str, int]]]) -> Dict[str, Union[int, float]]:\n    unique_usernames = set()\n    total_age = 0\n    valid_users = 0\n    for user in user_data:\n        if 'username' in user and 'age' in user:\n            unique_usernames.add(user['username'])\n            total_age += user['age']\n            valid_users += 1\n    unique_usernames_count = len(unique_usernames)\n    average_age = total_age / valid_users if valid_users > 0 else 0\n    return {'unique_usernames': unique_usernames_count, 'average_age': average_age}\n", "entry_point": "process_user_data", "input": "[]", "output": "{'unique_usernames': 0, 'average_age': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17124_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016641", "code": "def normalize_scores(scores):\n    # Find the minimum and maximum scores in the input list\n    min_score = min(scores)\n    max_score = max(scores)\n    # Normalize each score using the formula (score - min_score) / (max_score - min_score)\n    normalized_scores = [(score - min_score) / (max_score - min_score) for score in scores]\n    return normalized_scores\n", "entry_point": "normalize_scores", "input": "[0, 1, 2, 3, 4]", "output": "[0.0, 0.25, 0.5, 0.75, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40897_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016642", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 0, -2, 0, 3, 4, 4, 2, 2]", "output": "[4, 0, 4, 0, 27, 16, 16, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016643", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mtr.symt.apps.MtrSncConfim'", "output": "('mtr.symt.apps', 'MtrSncConfim')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016644", "code": "def calculate_total_time_elapsed(frame_interval, num_frames):\n    time_interval = frame_interval * 10.0 / 60.0  # Calculate time interval for 10 frames in minutes\n    total_time_elapsed = time_interval * (num_frames / 10)  # Calculate total time elapsed in minutes\n    return total_time_elapsed\n", "entry_point": "calculate_total_time_elapsed", "input": "9.230519999999997, 100", "output": "15.384199999999995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24500_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016645", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "(9, 10, 10, 10)", "output": "[9.5, 10.0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016646", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[1, 1, 2, 2, 5, 6]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016647", "code": "from typing import List\nSUPPORTED_BACKENDS = [\n    'pycryptodomex',\n    'pysha3',\n]\ndef check_backend_availability(backend: str, supported_backends: List[str]) -> bool:\n    return backend in supported_backends\n", "entry_point": "check_backend_availability", "input": "'backendX', SUPPORTED_BACKENDS", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134615_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016648", "code": "def elementwise_division(a, b):\n    if isinstance(a[0], list):  # Check if a is a 2D list\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [[x / y for x, y in zip(row_a, row_b)] for row_a, row_b in zip(a, b)]\n    else:  # Assuming a and b are 1D lists\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [x / y for x, y in zip(a, b)]\n", "entry_point": "elementwise_division", "input": "[[2.0, 2.0], [3.0, 3.0]], [[1.0, 1.0], [1.0, 1.0]]", "output": "[[2.0, 2.0], [3.0, 3.0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108971_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016649", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[10, 8, 8], 0", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016650", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "1, -1, 7840", "output": "-7840", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1246", "output": "{1, 2, 7, 14, 623, 178, 89, 1246}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1245", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016652", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1111010X'", "output": "['11110100', '11110101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016653", "code": "def count_paths(n):\n    s = [[0] * 10 for _ in range(n + 1)]\n    s[1] = [0] + [1] * 9\n    mod = 1000 ** 3\n    for i in range(2, n + 1):\n        for j in range(0, 9 + 1):\n            if j >= 1:\n                s[i][j] += s[i - 1][j - 1]\n            if j <= 8:\n                s[i][j] += s[i - 1][j + 1]\n    return sum(s[n]) % mod\n", "entry_point": "count_paths", "input": "3", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21515_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016654", "code": "from typing import List\ndef find_pair(nums: List[int], target: int) -> List[int]:\n    cache = dict()\n    for index, value in enumerate(nums):\n        cache[target - value] = index\n    for index, value in enumerate(nums):\n        if value in cache and cache[value] != index:\n            return sorted([cache[value], index])\n    return []\n", "entry_point": "find_pair", "input": "[1, 2], 3", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143242_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1445", "output": "{1, 289, 5, 1445, 17, 85}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016656", "code": "def find_divisible_sum(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "find_divisible_sum", "input": "[15, 30]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147524_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016657", "code": "def next_greater_permutation(n):\n    num = list(str(n))\n    i = len(num) - 2\n    while i >= 0:\n        if num[i] < num[i + 1]:\n            break\n        i -= 1\n    if i == -1:\n        return -1\n    j = len(num) - 1\n    while num[j] <= num[i]:\n        j -= 1\n    num[i], num[j] = num[j], num[i]\n    result = int(''.join(num[:i + 1] + num[i + 1:][::-1]))\n    return result if result < (1 << 31) else -1\n", "entry_point": "next_greater_permutation", "input": "328", "output": "382", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114170_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2594", "output": "{1, 2594, 2, 1297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016659", "code": "def convert_attribute_name(original_name):\n    attribute_map = {\n        'api_version': 'apiVersion',\n        'authorization': 'authorization',\n        'bearer_token_file': 'bearerTokenFile',\n        'name': 'name',\n        'namespace': 'namespace',\n        'path_prefix': 'pathPrefix',\n        'port': 'port',\n        'scheme': 'scheme',\n        'timeout': 'timeout',\n        'tls_config': 'tlsConfig'\n    }\n    return attribute_map.get(original_name, 'Not Found')\n", "entry_point": "convert_attribute_name", "input": "'port'", "output": "'port'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120015_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016660", "code": "def colorize_log_message(message, log_level):\n    RESET_SEQ = \"\\033[0m\"\n    COLOR_SEQ = \"\\033[1;%dm\"\n    COL = {\n        'DEBUG': 34, 'INFO': 35,\n        'WARNING': 33, 'CRITICAL': 33, 'ERROR': 31\n    }\n    color_code = COL.get(log_level, 37)  # Default to white if log_level not found\n    colored_message = COLOR_SEQ % color_code + message + RESET_SEQ\n    return colored_message\n", "entry_point": "colorize_log_message", "input": "'asThi', 'UNKNOWN'", "output": "'\\x1b[1;37masThi\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1938_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016661", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8966", "output": "{1, 2, 4483, 8966}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016662", "code": "def encrypt(message):\n    encrypted_values = []\n    for char in message:\n        if char.isalpha():\n            position = ord(char.upper()) - ord('A') + 1\n            encrypted_values.append(position * 2)\n    return encrypted_values\n", "entry_point": "encrypt", "input": "'HELLOOL'", "output": "[16, 10, 24, 24, 30, 30, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40901_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016663", "code": "from typing import List\ndef process_image(pixels: List[int]) -> List[int]:\n    result = []\n    for pixel in pixels:\n        result.append(pixel * 2)\n    return result\n", "entry_point": "process_image", "input": "[49, 74, 200, 50, 76, 74]", "output": "[98, 148, 400, 100, 152, 148]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142011_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016664", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[4, 0], [3, 1], [1, 2]]", "output": "[[4], [3], [1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016665", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'0.1.0'", "output": "(0, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016666", "code": "def wheel(pos):\n    if pos < 0 or pos > 255:\n        return (0, 0, 0)\n    if pos < 85:\n        return (255 - pos * 3, pos * 3, 0)\n    if pos < 170:\n        pos -= 85\n        return (0, 255 - pos * 3, pos * 3)\n    pos -= 170\n    return (pos * 3, 0, 255 - pos * 3)\n", "entry_point": "wheel", "input": "42", "output": "(129, 126, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16803_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016667", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[720, 720, 720, 412]", "output": "'0:42:52'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016668", "code": "import math\ndef sieve_of_eratosthenes(limit):\n    is_prime = [True] * (limit + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(limit)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, limit + 1, i):\n                is_prime[j] = False\n    return [num for num in range(2, limit + 1) if is_prime[num]]\n", "entry_point": "sieve_of_eratosthenes", "input": "29", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112116_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016669", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "100, 50", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016670", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016671", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['* 4'], 10", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016672", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5798", "output": "{1, 2, 5798, 13, 2899, 26, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5797", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016673", "code": "def find_scan_uid(dataset: dict, video_uid: str) -> str:\n    if video_uid in dataset:\n        return dataset[video_uid]\n    else:\n        return \"Not found\"\n", "entry_point": "find_scan_uid", "input": "{}, 'nonexistent_video'", "output": "'Not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18707_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016674", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(40, 30)", "output": "(30, 40)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016675", "code": "from typing import List\ndef reconstruct_sequence(counts: List[int]) -> List[int]:\n    sequence = []\n    for i in range(len(counts)):\n        sequence.extend([i+1] * counts[i])\n    return sequence\n", "entry_point": "reconstruct_sequence", "input": "[4, 4, 2, 3]", "output": "[1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4314_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016676", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "8", "output": "['1', '2', '3', '4', '5', '6', '7', '8']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016677", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    \"\"\"\n    Calculates the sum of all even numbers in the input list.\n    Parameters:\n    numbers (List[int]): A list of integers.\n    Returns:\n    int: The sum of all even numbers in the input list.\n    \"\"\"\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[10, 12, 22]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43545_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016678", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'njfhnnjit(cache=False)'", "output": "'njfhnnjit(cache=False)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016679", "code": "def count_characters(strings):\n    char_counts = {}\n    for string in strings:\n        for char in string.lower():\n            if char.isalpha():\n                char_counts[char] = char_counts.get(char, 0) + 1\n    return char_counts\n", "entry_point": "count_characters", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55885_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1124", "output": "{1, 2, 4, 1124, 562, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1123", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4398", "output": "{1, 2, 3, 6, 4398, 2199, 1466, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016682", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'students'", "output": "'students'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016683", "code": "def calculate_gpu_memory_usage(processes):\n    max_memory_usage = max(processes)\n    total_memory_usage = sum(processes)\n    return max_memory_usage, total_memory_usage\n", "entry_point": "calculate_gpu_memory_usage", "input": "[1022, 1000, 1000, 1000, 579]", "output": "(1022, 4601)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48951_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016684", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1269", "output": "{1, 3, 423, 9, 141, 47, 1269, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016685", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1061", "output": "{1, 1061}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1060", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016686", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "3, 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016687", "code": "from typing import List, Dict, Any\ndef filter_dicts(input_list: List[Dict[str, Any]], key: str, value: Any) -> List[Dict[str, Any]]:\n    output_list = []\n    for d in input_list:\n        if key in d and d[key] == value:\n            output_list.append(d)\n    return output_list\n", "entry_point": "filter_dicts", "input": "[{'name': 'Alice'}, {'name': 'Bob'}], 'age', 30", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38213_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016688", "code": "def process_string(input_str):\n    if not input_str:\n        return 'EMPTY'\n    modified_str = ''\n    for i, char in enumerate(input_str[::-1]):\n        if char.isalpha():\n            if i % 2 == 1:\n                modified_str += char.upper()\n            else:\n                modified_str += char.lower()\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "process_string", "input": "''", "output": "'EMPTY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48299_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016689", "code": "def process_string(input_string):\n    if \"apple\" in input_string:\n        input_string = input_string.replace(\"apple\", \"orange\")\n    if \"banana\" in input_string:\n        input_string = input_string.replace(\"banana\", \"\")\n    if \"cherry\" in input_string:\n        input_string = input_string.replace(\"cherry\", \"CHERRY\")\n    return input_string\n", "entry_point": "process_string", "input": "'eaaIaIapple,'", "output": "'eaaIaIorange,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133930_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016690", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "7", "output": "153.94", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016691", "code": "def calculate_voltages(adc_readings: dict, vref: float) -> dict:\n    voltages = {}\n    for channel, adc_reading in adc_readings.items():\n        if channel < 7:\n            voltage = vref * 4.57 * adc_reading\n        else:\n            voltage = vref * adc_reading\n        voltages[channel] = voltage\n    return voltages\n", "entry_point": "calculate_voltages", "input": "{}, 5.0", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15055_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016692", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) <= 2:\n        return 0  # If the list has 0, 1, or 2 elements, return 0 as there are no extremes to exclude\n    min_val = min(numbers)\n    max_val = max(numbers)\n    numbers.remove(min_val)\n    numbers.remove(max_val)\n    return sum(numbers) / len(numbers)\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 2, 3, 4, 6, 7]", "output": "3.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132591_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4726", "output": "{1, 2, 34, 139, 17, 4726, 278, 2363}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6702", "output": "{1, 2, 3, 6, 6702, 3351, 2234, 1117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016695", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(2, 3, 3, 1, 3, 3, 2, 1)", "output": "'2.3.3.1.3.3.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016696", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{}, 0", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016697", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3811", "output": "{1, 3811, 37, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016698", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[101, 92, 91, 92, 85, 101]", "output": "[101, 92, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016699", "code": "def find_non_dup(A=[]):\n    if len(A) == 0:\n        return None\n    non_dup = [x for x in A if A.count(x) == 1]\n    return non_dup[-1]\n", "entry_point": "find_non_dup", "input": "[1, 2, 3, 4, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57269_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3889", "output": "{1, 3889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016701", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "10", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016702", "code": "from typing import List\ndef count_odd_cells(n: int, m: int, indices: List[List[int]]) -> int:\n    row = [0] * n\n    col = [0] * m\n    ans = 0\n    for r, c in indices:\n        row[r] += 1\n        col[c] += 1\n    for i in range(n):\n        for j in range(m):\n            ans += (row[i] + col[j]) % 2\n    return ans\n", "entry_point": "count_odd_cells", "input": "2, 3, [[0, 0], [0, 1], [1, 0], [1, 1], [0, 2], [1, 2]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70394_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5118", "output": "{1, 2, 3, 6, 1706, 853, 5118, 2559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016704", "code": "def find_min_temperature(temperatures):\n    min_temp = float('inf')  # Initialize min_temp to a large value\n    for temp in temperatures:\n        if temp < min_temp:\n            min_temp = temp\n    return min_temp\n", "entry_point": "find_min_temperature", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36490_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016705", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'bbcc'", "output": "'b2c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016706", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[10, 12, 14, 16, 16]", "output": "13.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016707", "code": "def sum_of_digit_squares(n: int) -> int:\n    total_sum = 0\n    for digit in str(n):\n        total_sum += int(digit) ** 2\n    return total_sum\n", "entry_point": "sum_of_digit_squares", "input": "711", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47266_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016708", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 87, 86, 50, 75]", "output": "[100, 87, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016709", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[60, 60, 60, 57], 4", "output": "59.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75916_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016710", "code": "def calculate_consecutive_ones(data_bit):\n    consecutive_count = 0\n    max_consecutive_count = 0\n    for bit in data_bit:\n        if bit == 1:\n            consecutive_count += 1\n            max_consecutive_count = max(max_consecutive_count, consecutive_count)\n        else:\n            consecutive_count = 0\n    return max_consecutive_count\n", "entry_point": "calculate_consecutive_ones", "input": "[1, 1, 1, 1, 0, 0]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42781_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016711", "code": "def count_set_bits(num):\n    count = 0\n    while num:\n        count += num & 1\n        num >>= 1\n    return count\n", "entry_point": "count_set_bits", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139196_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016712", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[6, 6, 0, 23, 1, 1, 6]", "output": "[6, 6, 0, 20, 1, 1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6736", "output": "{1, 2, 4, 421, 3368, 8, 842, 6736, 16, 1684}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6735", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016714", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[5, 10, 3]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016715", "code": "def find_increase(lines):\n    increase = 0\n    for i in range(1, len(lines)):\n        if lines[i] > lines[i - 1]:\n            increase += 1\n    return increase\n", "entry_point": "find_increase", "input": "[1, 2, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53543_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016716", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    max1, max2, max3 = float('-inf'), float('-inf'), float('-inf')\n    min1, min2 = float('inf'), float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, min1 * min2 * max1)\n", "entry_point": "max_product_of_three", "input": "[-1, -1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74922_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016717", "code": "import re\ndef is_valid_import(statement: str) -> bool:\n    components = statement.split()\n    if len(components) < 2:\n        return False\n    if components[0] not in ['import', 'from']:\n        return False\n    module_name = components[1]\n    if not re.match(r'^[a-zA-Z_][a-zA-Z0-9_.]*$', module_name):\n        return False\n    if len(components) > 2 and components[2] == 'import':\n        if len(components) < 4 or components[3] != 'as':\n            return False\n        if len(components) < 5 or not re.match(r'^[a-zA-Z_][a-zA-Z0-9_]*$', components[4]):\n            return False\n    return True\n", "entry_point": "is_valid_import", "input": "'import math'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47825_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016718", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'142:34'", "output": "(322, 52)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016719", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'URR'", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016720", "code": "def convert_memory_size(memory_size):\n    units = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n    conversion_rates = [1, 1024, 1024**2, 1024**3, 1024**4]\n    for idx, rate in enumerate(conversion_rates):\n        if memory_size < rate or idx == len(conversion_rates) - 1:\n            converted_size = memory_size / conversion_rates[idx - 1]\n            return f\"{converted_size:.2f} {units[idx - 1]}\"\n", "entry_point": "convert_memory_size", "input": "2048", "output": "'2.00 KB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149300_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016721", "code": "def filter_texts(texts, colors):\n    filtered_texts = {}\n    for i in range(len(texts)):\n        if i % 2 == 0:\n            filtered_texts[texts[i]] = colors[i]\n    return filtered_texts\n", "entry_point": "filter_texts", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016722", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8348", "output": "{1, 2, 4, 2087, 4174, 8348}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8347", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016723", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[5, 0, 6, 0, 5, 0, 6, 0, 5]", "output": "'aaaaabbbbbbcccccddddddeeeee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016724", "code": "def generate_lookup_id(existing_ids, new_name):\n    # Extract the first three characters of the new customer's name and convert to uppercase\n    lookup_prefix = new_name[:3].upper()\n    # Generate a unique number for the new customer based on existing customer IDs\n    existing_numbers = [int(cid[3:]) for cid in existing_ids if cid[3:].isdigit()]\n    unique_number = max(existing_numbers) + 1 if existing_numbers else 1\n    # Combine the extracted characters and unique number to form the lookup ID\n    lookup_id = f\"{lookup_prefix}{unique_number:03d}\"\n    return lookup_id\n", "entry_point": "generate_lookup_id", "input": "[], 'Jane'", "output": "'JAN001'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136556_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016725", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[10, 10, 12]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016726", "code": "from typing import List\ndef most_common_age(ages: List[int]) -> int:\n    age_freq = {}\n    for age in ages:\n        if age in age_freq:\n            age_freq[age] += 1\n        else:\n            age_freq[age] = 1\n    most_common = min(age_freq, key=lambda x: (-age_freq[x], x))\n    return most_common\n", "entry_point": "most_common_age", "input": "[35, 35, 35, 30, 30]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113386_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016727", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 9]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18834_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016728", "code": "def count_unique_even_numbers(lst):\n    unique_evens = set()\n    for num in lst:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_even_numbers", "input": "[2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111984_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016729", "code": "def from_master_derivation_key(mdk):\n    # Implement the conversion from master derivation key to mnemonic phrase here\n    # This could involve decoding, processing, and converting the mdk appropriately\n    # For illustration purposes, let's assume a simple conversion method\n    mnemonic = mdk[::-1]  # Reversing the master derivation key as an example\n    return mnemonic\n", "entry_point": "from_master_derivation_key", "input": "'sample_mast'", "output": "'tsam_elpmas'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129954_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016730", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6107", "output": "{1, 6107, 197, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016731", "code": "def max_product(nums):\n    max1 = float('-inf')\n    max2 = float('-inf')\n    min1 = float('inf')\n    min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, max1 * min1)\n", "entry_point": "max_product", "input": "[1, 5, 7]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14792_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8087", "output": "{1, 8087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016733", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[10, 16, 2, 8, 14, 4, 5], 6", "output": "[4, 4, 2, 2, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016734", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'ciosdings'", "output": "'iosdings'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016735", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[3, 6, 2, 8, 2, 6, 9, 8, 8]", "output": "[2, 2, 3, 6, 6, 8, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016736", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'10'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016737", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[36, 24, 37, 25, 12, 24, 91, 35, 92]", "output": "[12, 24, 24, 25, 35, 36, 37, 91, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016738", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6113", "output": "{1, 6113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4346", "output": "{1, 2, 41, 106, 82, 53, 4346, 2173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4345", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016740", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "1234567", "output": "'1.234.567'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016741", "code": "from typing import List\ndef _merge_small_intervals(buff: List[int], size: int) -> List[int]:\n    result = []\n    start = 0\n    end = 0\n    while end < len(buff):\n        while end < len(buff) - 1 and buff[end + 1] - buff[end] == 1:\n            end += 1\n        if end - start + 1 < size:\n            result.extend(buff[start:end + 1])\n        else:\n            result.extend(buff[start:end + 1])\n        end += 1\n        start = end\n    return result\n", "entry_point": "_merge_small_intervals", "input": "[6, 5, 3, 4, 6, 10, 4, 4], 1", "output": "[6, 5, 3, 4, 6, 10, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9378_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5473", "output": "{1, 5473, 13, 421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016743", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'308330a30ae8'", "output": "'308330FFFEa30ae8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016744", "code": "def convert_bitmap_to_active_bits(primary_bitmap):\n    active_data_elements = []\n    for i in range(len(primary_bitmap)):\n        if primary_bitmap[i] == '1':\n            active_data_elements.append(i + 1)  # Data element numbers start from 1\n    return active_data_elements\n", "entry_point": "convert_bitmap_to_active_bits", "input": "'100000000001'", "output": "[1, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53443_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016745", "code": "def has_consecutive_range(lst):\n    if not lst:\n        return False\n    sorted_lst = sorted(lst)\n    for i in range(len(sorted_lst) - 1):\n        if sorted_lst[i + 1] - sorted_lst[i] != 1:\n            return False\n    return True\n", "entry_point": "has_consecutive_range", "input": "[1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40207_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016746", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[70, 85, 88, 90, 95]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016747", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2363", "output": "{1, 2363, 139, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2362", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4129", "output": "{1, 4129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016749", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "19, 0, 15", "output": "121645100408832000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016750", "code": "def custom_split(data, delimiters):\n    result = []\n    current_substring = \"\"\n    for char in data:\n        if char in delimiters:\n            if current_substring:\n                result.append(current_substring)\n                current_substring = \"\"\n        else:\n            current_substring += char\n    if current_substring:\n        result.append(current_substring)\n    return result\n", "entry_point": "custom_split", "input": "'apple b', ' '", "output": "['apple', 'b']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10049_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016751", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'h'", "output": "[('h', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016752", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "12", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016753", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5811", "output": "{1, 3, 39, 13, 1937, 5811, 149, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016754", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'key3', 'devltdvdefault_valude'", "output": "'devltdvdefault_valude'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016755", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[1, 3, 3, 5, 1, 5, 5]", "output": "[1, 3, 3, 5, 1, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016756", "code": "def calculate_winner(game):\n    team1, team2, score1, score2 = game.split('_')\n    if int(score1) > int(score2):\n        return team1\n    elif int(score1) < int(score2):\n        return team2\n    else:\n        return \"Draw\"\n", "entry_point": "calculate_winner", "input": "'LiveTpool_Arsenal_3_2'", "output": "'LiveTpool'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71038_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016757", "code": "def calculate_max_trial_value(trial_values):\n    return max(trial_values)\n", "entry_point": "calculate_max_trial_value", "input": "[10, 15, 20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15346_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016758", "code": "def compareTriplets(a, b):\n    score_a = 0\n    score_b = 0\n    for i in range(3):\n        if a[i] > b[i]:\n            score_a += 1\n        elif a[i] < b[i]:\n            score_b += 1\n    return [score_a, score_b]\n", "entry_point": "compareTriplets", "input": "[5, 6, 7], [1, 2, 3]", "output": "[3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134718_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016759", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "212", "output": "{1, 2, 4, 106, 212, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt211", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016760", "code": "def sum_of_squares_even(numbers):\n    sum_even_squares = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_squares_even", "input": "[6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21139_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016761", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1381", "output": "{1, 1381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016762", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'rerre'", "output": "[('rerre', 'rerre')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016763", "code": "def parse(data):\n    key_start = data.find(':') + 2  # Find the start index of the key\n    key_end = data.find('=', key_start)  # Find the end index of the key\n    key = data[key_start:key_end].strip()  # Extract and strip the key\n    value_start = data.find('\"', key_end) + 1  # Find the start index of the value\n    value_end = data.rfind('\"')  # Find the end index of the value\n    value = data[value_start:value_end]  # Extract the value\n    # Unescape the escaped characters in the value\n    value = value.replace('\\\\\"', '\"').replace('\\\\\\\\', '\\\\')\n    return {key: [value]}  # Return the key-value pair as a dictionary\n", "entry_point": "parse", "input": "'key: \"\"{do= \"d\\\\\"\"'", "output": "{'\"\"{do': ['d\"']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85764_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016764", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "374", "output": "{1, 2, 34, 11, 17, 374, 22, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016765", "code": "def calculate_metrics(metrics: list) -> dict:\n    total = 0\n    count = 0\n    for metric in metrics:\n        if isinstance(metric, (int, float)):\n            total += metric\n            count += 1\n        elif isinstance(metric, str) and metric.isdigit():\n            total += int(metric)\n            count += 1\n    if count == 0:\n        return {'average': 0, 'count': 0}\n    else:\n        return {'average': total / count, 'count': count}\n", "entry_point": "calculate_metrics", "input": "[30, 20.5, 23.5, 25, 22, 22, 24, 24]", "output": "{'average': 23.875, 'count': 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46209_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016766", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 7", "output": "153.93804002589985", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016767", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[1, 2, 3, 3, 3, 3, 2]", "output": "[1, 3, 5, 6, 0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016768", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7267", "output": "{1, 7267, 169, 43, 13, 559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7266", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016769", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'30 + 5'", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016770", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[251]", "output": "251.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016771", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[1, 5, 6, 7, 3, 4, 8]", "output": "[1, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016772", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016773", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7654", "output": "{1, 2, 7654, 43, 178, 3827, 86, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016774", "code": "def findCellValue(num, xPos, yPos):\n    a, b = (min(xPos, num-1-yPos), 1) if yPos >= xPos else (min(yPos, num-1-xPos), -1)\n    return (4*num*a - 4*a*a - 2*a + b*(xPos+yPos) + (b>>1&1)*4*(num-a-1)) % 9 + 1\n", "entry_point": "findCellValue", "input": "3, 0, 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17971_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "567", "output": "{1, 3, 7, 9, 81, 21, 567, 27, 189, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016776", "code": "def process_env_variables(env_vars: dict) -> dict:\n    filtered_env_vars = {key: value for key, value in env_vars.items() if value != \"<stub>\"}\n    return filtered_env_vars\n", "entry_point": "process_env_variables", "input": "{'var1': '<stub>', 'var2': '<stub>', 'var3': '<stub>'}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50048_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016777", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'exeexampleample'", "output": "'exeexampleample_2123963461'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016778", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[4, 4], 0", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016779", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[0, 4, 3, 0, 0, 0]", "output": "[0, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016780", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3986", "output": "{1, 3986, 2, 1993}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016781", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7845", "output": "{1, 1569, 3, 5, 7845, 523, 15, 2615}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7844", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016782", "code": "import sys\nNOT_FINISHED = sys.float_info.max\nconfig_values = {\n    \"car_icons\": [\"icon0\", \"icon1\", \"icon2\", \"icon3\"],\n    \"circuit\": \"Sample Circuit\",\n    \"coord_host\": \"localhost\",\n    \"coord_port\": 8000,\n    \"finish_line_name\": \"Finish Line 1\",\n    \"num_lanes\": 4,\n    \"race_timeout\": 60,\n    \"servo_down_value\": 0,\n    \"servo_up_value\": 1,\n    \"track_name\": \"Local Track\"\n}\ndef get_config_value(config_name: str) -> float:\n    return config_values.get(config_name, NOT_FINISHED)\n", "entry_point": "get_config_value", "input": "'num_lanes'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117192_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016783", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016784", "code": "def skipVowels(word):\n    novowels = ''\n    for ch in word:\n        if ch.lower() in 'aeiou':\n            continue\n        novowels += ch\n    return novowels\n", "entry_point": "skipVowels", "input": "'watotud'", "output": "'wttd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120866_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016785", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'rax, '", "output": "'add rax, '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016786", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105369_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016787", "code": "from typing import List\ndef compress_label_map(label_map: List[List[int]]) -> List[List[int]]:\n    label_freq = {}\n    for row in label_map:\n        for label in row:\n            if label in label_freq:\n                label_freq[label] += 1\n            else:\n                label_freq[label] = 1\n    sorted_labels = sorted(label_freq, key=label_freq.get)\n    compressed_map = [[sorted_labels.index(label_freq) for label_freq in row] for row in label_map]\n    return compressed_map\n", "entry_point": "compress_label_map", "input": "[[3, 4, 4], [3, 1, 1], [3, 4, 4]]", "output": "[[1, 2, 2], [1, 0, 0], [1, 2, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135378_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016788", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'hi', 'abcdefghij'", "output": "(7, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5179", "output": "{1, 5179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016790", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'Heor'", "output": "'Heor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016791", "code": "def sum_of_multiples_of_3_or_5(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in multiples_set:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples_of_3_or_5", "input": "[5, 10, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33384_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016792", "code": "def categorize_files(file_list):\n    file_dict = {}\n    for file_name in file_list:\n        if '.' in file_name:\n            extension = file_name.split('.')[-1]\n            file_dict.setdefault(extension, []).append(file_name)\n        else:\n            file_dict.setdefault('No Extension', []).append(file_name)\n    return file_dict\n", "entry_point": "categorize_files", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7750_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016793", "code": "def calculate_total_epochs(batch_size, last_epoch, min_unit):\n    if last_epoch < min_unit:\n        return min_unit\n    else:\n        return last_epoch + min_unit\n", "entry_point": "calculate_total_epochs", "input": "1, 0, 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134381_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016794", "code": "from typing import List, Dict\ndef filter_commits(commits: List[Dict[str, str]], keyword: str) -> List[str]:\n    filtered_commits = []\n    for commit in commits:\n        if keyword in commit['message']:\n            filtered_commits.append(commit['sha1'])\n    return filtered_commits\n", "entry_point": "filter_commits", "input": "[], 'sample_keyword'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102031_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016795", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 8, 16, 32]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016796", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "578", "output": "{1, 578, 2, 289, 34, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt577", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4803", "output": "{3, 1, 1601, 4803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016798", "code": "def extract_version_number(file_path):\n    version = \"\"\n    found_v = False\n    for char in reversed(file_path):\n        if char.isdigit() or char == '.':\n            version = char + version\n            found_v = False\n        elif char == 'v' and not found_v:\n            found_v = True\n            version = char + version\n        elif found_v:\n            break\n    return version[1:]  # Exclude the 'v' at the beginning\n", "entry_point": "extract_version_number", "input": "'/path/to/v1'", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18270_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016799", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('a')[0])  # Remove any additional alpha characters\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.2.4'", "output": "(0, 2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101817_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016800", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'seven7'", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016801", "code": "def calculate_u(w, x0, n):\n    w0 = w + sum(x0)\n    u = [w0] * n\n    return u\n", "entry_point": "calculate_u", "input": "15, [2], 1", "output": "[17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54111_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016802", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2564", "output": "{1, 2, 1282, 2564, 4, 641}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2563", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016803", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'data/all.jso', None", "output": "('data/all.jso', 'data/all.jso')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016804", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "11", "output": "1365", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016805", "code": "def power(x, n):\n    p = 1\n    for i in range(n):\n        p *= x\n    return p\n", "entry_point": "power", "input": "6, 3", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145971_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016806", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[4, 2, 1, 4, 3, 1, 1, 3, 1], 3", "output": "[[4, 2, 1], [4, 3, 1], [1, 3, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016807", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8553", "output": "{2851, 1, 3, 8553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016808", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'w o l d !'", "output": "{'w': 1, 'o': 1, 'l': 1, 'd': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15027_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016809", "code": "def merge_sort_skip_multiples_of_3(arr):\n    def merge(left, right):\n        result = []\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] < right[j]:\n                result.append(left[i])\n                i += 1\n            else:\n                result.append(right[j])\n                j += 1\n        result.extend(left[i:])\n        result.extend(right[j:])\n        return result\n    def merge_sort(arr):\n        if len(arr) <= 1:\n            return arr\n        mid = len(arr) // 2\n        left = merge_sort(arr[:mid])\n        right = merge_sort(arr[mid:])\n        return merge(left, right)\n    multiples_of_3 = [num for num in arr if num % 3 == 0]\n    non_multiples_of_3 = [num for num in arr if num % 3 != 0]\n    sorted_non_multiples_of_3 = merge_sort(non_multiples_of_3)\n    result = []\n    i = j = 0\n    for num in arr:\n        if num % 3 == 0:\n            result.append(multiples_of_3[i])\n            i += 1\n        else:\n            result.append(sorted_non_multiples_of_3[j])\n            j += 1\n    return result\n", "entry_point": "merge_sort_skip_multiples_of_3", "input": "[5, 7, 7, 10, 12, 9, 10, 13]", "output": "[5, 7, 7, 10, 12, 9, 10, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15751_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016810", "code": "def count_pairs_sum_to_target(nums, target):\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            pair_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_sum_to_target", "input": "[1, 7, 3, 5, 3, 5], 8", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18234_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016811", "code": "def determine_user_message(session_dict):\n    if 'first_time_user' in session_dict:\n        if session_dict['first_time_user']:\n            return \"Welcome! Enjoy your first visit!\"\n        else:\n            return \"Welcome back!\"\n    else:\n        return \"Unknown user status\"\n", "entry_point": "determine_user_message", "input": "{}", "output": "'Unknown user status'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105448_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016812", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'11.2.3'", "output": "(11, 2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016813", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'abc!!!'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016814", "code": "def map_urls_to_views(url_patterns):\n    url_view_mapping = {}\n    for path, view_func in url_patterns:\n        url_view_mapping[path] = view_func\n    return url_view_mapping\n", "entry_point": "map_urls_to_views", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99905_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016815", "code": "import math\ndef calculate_sampled_rows(sampling_rate):\n    total_rows = 120000000  # Total number of rows in the dataset (120M records)\n    sampled_rows = math.ceil(total_rows * sampling_rate)\n    # Ensure at least one row is sampled\n    if sampled_rows == 0:\n        sampled_rows = 1\n    return sampled_rows\n", "entry_point": "calculate_sampled_rows", "input": "0.2001", "output": "24012000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18389_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016816", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "3, 4", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016817", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4082", "output": "{1, 2, 26, 13, 4082, 2041, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016818", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'5)'", "output": "'5)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8435", "output": "{1, 35, 5, 7, 241, 8435, 1205, 1687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016820", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2527", "output": "{1, 133, 7, 361, 19, 2527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016821", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4364", "output": "{1, 2, 1091, 4, 2182, 4364}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4363", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016822", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[8, 6, 2, 1, 1, 5, 5]", "output": "[8, 6, 2, 1, 1, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016823", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[1, 2, 7, 7]", "output": "47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016824", "code": "def DFSL(graph, start_node):\n    visited = set()\n    result = []\n    def dfs(node):\n        visited.add(node)\n        result.append(node)\n        for neighbor in graph[node]:\n            if neighbor[0] not in visited:\n                dfs(neighbor[0])\n    dfs(start_node)\n    return result\n", "entry_point": "DFSL", "input": "{4: []}, 4", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115111_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016825", "code": "def extract_package_info(setup_dict):\n    package_name = setup_dict.get('name', '')\n    version = setup_dict.get('version', '')\n    description = setup_dict.get('description', '')\n    author = setup_dict.get('author', '')\n    return package_name, version, description, author\n", "entry_point": "extract_package_info", "input": "{}", "output": "('', '', '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15053_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016826", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "275", "output": "{1, 5, 11, 275, 55, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt274", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016827", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 2, 1]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45837_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8683", "output": "{19, 1, 8683, 457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016829", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'Hello, World!'", "output": "b'Hello, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016830", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[0, 0, 2, 3, 4, 4]", "output": "[0, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016831", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[3, 3, 3, 3, 3], 3", "output": "[(3, 3, 3), (3, 3, 3), (3, 3, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016832", "code": "def my_index2(l, x, default=False):\n    return l.index(x) if x in l else default\n", "entry_point": "my_index2", "input": "[0, 2, 3], 1", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117825_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016833", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "619", "output": "{1, 619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016834", "code": "SCRABBLE_LETTER_VALUES = {\n    'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4,\n    'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3,\n    'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8,\n    'Y': 4, 'Z': 10\n}\ndef calculate_scrabble_points(word, n):\n    total_points = 0\n    for letter in word:\n        total_points += SCRABBLE_LETTER_VALUES.get(letter.upper(), 0)\n    total_points *= len(word)\n    if len(word) == n:\n        total_points += 50\n    return total_points\n", "entry_point": "calculate_scrabble_points", "input": "'HELLO', 5", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_169_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016835", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 7, 3, 5, 7, 7, 7, 5]", "output": "[4, 8, 5, 8, 11, 12, 13, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016836", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'aaabaaa'", "output": "'a3b1a3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016837", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'100011'", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016838", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5909", "output": "{1, 19, 5909, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016840", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3245", "output": "{1, 5, 295, 649, 11, 3245, 55, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016841", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'%o!e#H@e$e%'", "output": "'oeHee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016842", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5, 2, 1, 6, 2, 1, 5]", "output": "[1, 1, 2, 2, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt54", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016843", "code": "def matrix_analysis(m, numRows, numCols):\n    n = numRows * numCols\n    midn = int((n + 1) / 2)\n    less = greater = equal = 0\n    min_val = max_val = m[0][0]\n    total_sum = 0\n    for row in m:\n        for elem in row:\n            total_sum += elem\n            if elem < min_val:\n                min_val = elem\n            if elem > max_val:\n                max_val = elem\n    average = total_sum / n\n    maxltguess = float('-inf')\n    mingtguess = float('inf')\n    for row in m:\n        for elem in row:\n            if elem < average:\n                less += 1\n                if elem > maxltguess:\n                    maxltguess = elem\n            elif elem > average:\n                greater += 1\n                if elem < mingtguess:\n                    mingtguess = elem\n            else:\n                equal += 1\n    return less, greater, equal, min_val, max_val, average, maxltguess, mingtguess\n", "entry_point": "matrix_analysis", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3, 3", "output": "(4, 4, 1, 1, 9, 5.0, 4, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31341_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016844", "code": "from typing import List\nimport math\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_bytes = sum(file_sizes)\n    total_kb = math.ceil(total_bytes / 1024)\n    return total_kb\n", "entry_point": "total_size_in_kb", "input": "[8192]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90092_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016845", "code": "def calculate_scores(classes):\n    scores = {}\n    vowels = 'aeiou'\n    for class_name in classes:\n        score = sum(ord(char) for char in class_name if char in vowels)\n        scores[class_name] = score\n    return scores\n", "entry_point": "calculate_scores", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62663_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016846", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5045", "output": "{1, 5, 1009, 5045}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5044", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016847", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1923", "output": "{3, 1, 641, 1923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016848", "code": "def format_preferences(default_values: dict) -> str:\n    plist = {preference: int(value) if isinstance(value, bool) else value\n             for preference, value in default_values.items()}\n    preference_items = [\n        '{} = {};'.format(preference,\n                          plist[preference] if str(plist[preference]) else '\"\"')\n        for preference in sorted(plist)]\n    return '{{ {} }}'.format(' '.join(preference_items))\n", "entry_point": "format_preferences", "input": "{}", "output": "'{  }'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15256_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1882", "output": "{1, 1882, 2, 941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1881", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016850", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 7, 2, 1]", "output": "[3, 8, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016851", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'4 4 4'", "output": "'4 4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016852", "code": "def computeLargeMergedDiameters(dic_diamToMerge_costs, limit):\n    dic_mergedDiam = {}\n    dic_reversed_diams = {}\n    sorted_diameters = sorted(dic_diamToMerge_costs.keys())\n    i = 0\n    while i < len(sorted_diameters):\n        current_diameter = sorted_diameters[i]\n        current_cost = dic_diamToMerge_costs[current_diameter]\n        merged_diameter = current_diameter\n        merged_cost = current_cost\n        j = i + 1\n        while j < len(sorted_diameters):\n            next_diameter = sorted_diameters[j]\n            next_cost = dic_diamToMerge_costs[next_diameter]\n            if merged_diameter + next_diameter <= limit:\n                merged_diameter += next_diameter\n                merged_cost += next_cost\n                j += 1\n            else:\n                break\n        dic_mergedDiam[merged_diameter] = merged_cost\n        dic_reversed_diams[merged_diameter] = current_diameter if merged_diameter == current_diameter else sorted_diameters[j - 1]\n        i = j\n    return dic_mergedDiam, dic_reversed_diams\n", "entry_point": "computeLargeMergedDiameters", "input": "{}, 10", "output": "({}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69163_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016853", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "2.0", "output": "0.764", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016854", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "362, 16", "output": "'16A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016855", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'DDL'", "output": "(-1, -2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2154", "output": "{1, 2, 3, 6, 359, 2154, 718, 1077}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016857", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016858", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[1, 2, 3, 0, 5, 6, 10], 107, 1", "output": "[107, 107, 107, 0, 107, 107, 107]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016859", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[-5, -2, 10]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016860", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[6, 2, 5, 9, 5, 9]", "output": "[6, 2, 5, 9, 5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016861", "code": "def fill_matrix(s):\n    n = int((len(s) + 2) ** 0.5)  # Calculate the size of the square matrix\n    matrix = [['_' for _ in range(n)] for _ in range(n)]  # Initialize the square matrix\n    directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]  # Right, Down, Left, Up\n    direction_index = 0\n    row, col = 0, 0\n    for char in s:\n        matrix[row][col] = char\n        next_row, next_col = row + directions[direction_index][0], col + directions[direction_index][1]\n        if 0 <= next_row < n and 0 <= next_col < n and matrix[next_row][next_col] == '_':\n            row, col = next_row, next_col\n        else:\n            direction_index = (direction_index + 1) % 4\n            row, col = row + directions[direction_index][0], col + directions[direction_index][1]\n    return matrix\n", "entry_point": "fill_matrix", "input": "'ass'", "output": "[['a', 's'], ['_', 's']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1644_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016862", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 100, 101, 100, 99, 90]", "output": "[101, 100, 99]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016863", "code": "def handle_message(message):\n    message_actions = {\n        \"Sorry we couldn't find that article.\": \"No action\",\n        \"You can't report your article.\": \"No action\",\n        \"Only Admins can delete a reported article\": \"No action\",\n        \"You are not allowed to report twice\": \"No action\",\n        \"You successfully deleted the article\": \"Delete article\",\n        \"Only Admins can get reported article\": \"Get reported article\"\n    }\n    return message_actions.get(message, \"Unknown message\")\n", "entry_point": "handle_message", "input": "\"Sorry we couldn't find that article.\"", "output": "'No action'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51721_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016864", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4997", "output": "{1, 19, 4997, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016865", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "9", "output": "'121'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5156", "output": "{1, 2, 5156, 4, 1289, 2578}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016867", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[0, 2, 1, 4, 2, 3, 4, 2, 9]", "output": "[2, 1, 4, 2, 3, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8763", "output": "{1, 3, 69, 2921, 23, 8763, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016869", "code": "import re\nimport argparse\ndef validate_aligner(aligner_str):\n    aligner_str = aligner_str.lower()\n    aligner_pattern = \"star|subread\"\n    if not re.match(aligner_pattern, aligner_str):\n        error = \"Aligner to be used (STAR|Subread)\"\n        raise argparse.ArgumentTypeError(error)\n    else:\n        return aligner_str\n", "entry_point": "validate_aligner", "input": "'starstarsubread'", "output": "'starstarsubread'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52623_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1129", "output": "{1, 1129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016871", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'path/to/path/to/../to/.txt'", "output": "'path/to/path/to/.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016872", "code": "def transform_iso_datetime(iso_datetime: str) -> str:\n    date_str, time_str = iso_datetime.split('T')\n    if '.' in time_str:\n        time_str = time_str.split('.')[0]  # Remove milliseconds if present\n    date_str = date_str.replace('-', '')  # Remove hyphens from date\n    time_str = time_str.replace(':', '')  # Remove colons from time\n    return date_str + 'T' + time_str\n", "entry_point": "transform_iso_datetime", "input": "'2023-03-10T07:40:20'", "output": "'20230310T074020'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14024_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016873", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "1.0, 0.01", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016874", "code": "import re\ndef extract_unique_words(text):\n    # Split the text into words using regular expressions\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Return a sorted list of unique words\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'is'", "output": "['is']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87039_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016875", "code": "import re\n_VALID_URL = r'https?://(?:www\\.)?cbssports\\.com/[^/]+/(?:video|news)/(?P<id>[^/?#&]+)'\ndef extract_id_from_url(url):\n    match = re.match(_VALID_URL, url)\n    if match:\n        return match.group('id')\n    return None\n", "entry_point": "extract_id_from_url", "input": "'http://cbssports.com/some-type/video/abcde'", "output": "'abcde'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143680_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7503", "output": "{1, 3, 2501, 41, 7503, 183, 123, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016877", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'woomis'", "output": "{'woomis': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016878", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'789789 0 0'", "output": "789789", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016879", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'2.2'", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016880", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3239", "output": "{1, 41, 79, 3239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016881", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[10, 17, 13]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016882", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[1.0, 2.0, 3.0, 5.0]", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016883", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'-3'", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016884", "code": "def make_booking(flights, selected_flight, num_seats):\n    if selected_flight in flights:\n        if num_seats <= flights[selected_flight]:\n            flights[selected_flight] -= num_seats\n            return \"Business seat flight reservation successful\"\n        else:\n            return \"Selected flight not available\"\n    else:\n        return \"Selected flight not found\"\n", "entry_point": "make_booking", "input": "{'FL123': 10, 'FL456': 5}, 'FL999', 1", "output": "'Selected flight not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37128_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8818", "output": "{1, 8818, 2, 4409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016886", "code": "def format_command_usage(name, desc, usage_template):\n    return usage_template.format(name=name, desc=desc)\n", "entry_point": "format_command_usage", "input": "'iiil', 'e', '{name}{desc}>'", "output": "'iiile>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41916_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016887", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[5, 6, 7, 8, 9, 10]", "output": "[6, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016888", "code": "def rank_scores(scores):\n    score_counts = {}\n    for score in scores:\n        score_counts[score] = score_counts.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    ranks = {}\n    rank = 1\n    for score in unique_scores:\n        count = score_counts[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "rank_scores", "input": "[7, 8, 6, 7, 6, 9, 6, 5, 7]", "output": "[3, 2, 6, 3, 6, 1, 6, 9, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135203_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9524", "output": "{1, 2, 4, 2381, 9524, 4762}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9523", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016890", "code": "def concatenate_string(s, n):\n    result = \"\"\n    for i in range(n):\n        result += s\n    return result\n", "entry_point": "concatenate_string", "input": "'any_string', 0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24778_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016891", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 7, 1, 1, 3, 3, 3, 3]", "output": "[1, 8, 3, 4, 7, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016892", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'This is a sample', 'This is a sample text that continues.'", "output": "(0, 16)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016893", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 2, 7, 3, 2, 4, 3, 7]", "output": "[3, 3, 9, 6, 6, 9, 9, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016894", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "12", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016895", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "927", "output": "{1, 3, 103, 9, 309, 927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016896", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wxTextCtrl'", "output": "'wx.adv.TextCtrl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016897", "code": "def update_scores(dictionary_of_scores, list_to_return):\n    for player_id, score in dictionary_of_scores.items():\n        if player_id not in list_to_return:\n            list_to_return.append(score)\n    return list_to_return\n", "entry_point": "update_scores", "input": "{1: 1, 2: 2, 3: 0, 4: 3}, [1, 2]", "output": "[1, 2, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106802_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016898", "code": "def largest_prime_factor(N):\n    factor = 2\n    while factor * factor <= N:\n        if N % factor == 0:\n            N //= factor\n        else:\n            factor += 1\n    return max(factor, N)\n", "entry_point": "largest_prime_factor", "input": "197", "output": "197", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109160_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016899", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1406", "output": "{1, 2, 37, 38, 74, 19, 1406, 703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016900", "code": "def parse_test_cases(test_cases):\n    test_dict = {}\n    current_suite = None\n    for line in test_cases.splitlines():\n        if '.' in line or '/' in line:\n            current_suite = line.strip()\n            test_dict[current_suite] = []\n        elif current_suite:\n            test_dict[current_suite].append(line.strip())\n    return test_dict\n", "entry_point": "parse_test_cases", "input": "'ParamefrrizedTest/1.'", "output": "{'ParamefrrizedTest/1.': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88834_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016901", "code": "def concat_first_last_chars(strings):\n    result = []\n    for string in strings:\n        concatenated = string[0] + string[-1]\n        result.append(concatenated)\n    return result\n", "entry_point": "concat_first_last_chars", "input": "['df', 'xz', 'df', 'de', 'df', 'xz']", "output": "['df', 'xz', 'df', 'de', 'df', 'xz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109926_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016902", "code": "import re\ndef count_latex_command(content, latex_command):\n    # Use regular expression to find all occurrences of LaTeX commands\n    latex_commands = re.findall(r'\\\\[a-zA-Z]+', content)\n    # Count the occurrences of the specified LaTeX command\n    count = latex_commands.count(latex_command)\n    return count\n", "entry_point": "count_latex_command", "input": "'This is just a normal text without LaTeX.', '\\\\alpha'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145288_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016903", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4077", "output": "{1, 3, 453, 9, 4077, 1359, 151, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016904", "code": "def dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        raise ValueError(\"Vectors must be of the same length\")\n    result = 0\n    for i in range(len(vector1)):\n        result += vector1[i] * vector2[i]\n    return result\n", "entry_point": "dot_product", "input": "[4, 8], [4, 2]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105326_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016905", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hhellhellhelo'", "output": "{'hhellhellhelo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016906", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'456,7789'", "output": "{456, 7789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016907", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'abcde12345'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016908", "code": "def replicate_list_to_target(input_list, target_length):\n    sum_list = sum(input_list)\n    if sum_list >= target_length:\n        return input_list\n    replication_factor = (target_length - sum_list) // sum_list\n    replicated_list = input_list * replication_factor\n    remaining_length = target_length - len(replicated_list)\n    if remaining_length > 0:\n        replicated_list += input_list[:remaining_length]\n    return replicated_list\n", "entry_point": "replicate_list_to_target", "input": "[5, 3, 3, 2, 4, 3, 1], 7", "output": "[5, 3, 3, 2, 4, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29722_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016909", "code": "def findSubsetsThatSumToK(arr, k):\n    subsets = []\n    def generateSubsets(arr, index, current, current_sum, k, subsets):\n        if current_sum == k:\n            subsets.append(current[:])\n        if index == len(arr) or current_sum >= k:\n            return\n        for i in range(index, len(arr)):\n            current.append(arr[i])\n            generateSubsets(arr, i + 1, current, current_sum + arr[i], k, subsets)\n            current.pop()\n    generateSubsets(arr, 0, [], 0, k, subsets)\n    return subsets\n", "entry_point": "findSubsetsThatSumToK", "input": "[1, 2, 3, 4, 5], 7", "output": "[[1, 2, 4], [2, 5], [3, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127361_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016910", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest integers\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest integers and the largest integer\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[4, 5, 7, 1]", "output": "140", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118316_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016911", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[3, 0, 1, 2, 3]", "output": "[3, 1, 2, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016912", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3656", "output": "{1, 2, 1828, 4, 3656, 8, 457, 914}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3655", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016913", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[9, 8, 7, 6, 5, 4], 3", "output": "[(9, 8, 7), (8, 7, 6), (7, 6, 5), (6, 5, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016914", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2125", "output": "{1, 5, 425, 2125, 17, 85, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2124", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016915", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "254, 169, 2", "output": "'#FEA902'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016916", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "''", "output": "(None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016917", "code": "def generate_mutated_sequence(cutting_solutions, original_sequence):\n    new_sequence = list(original_sequence)\n    for solution in cutting_solutions:\n        if solution.get(\"n_mutations\", 0) == 0:\n            continue\n        start, mutated_seq = solution[\"mutated_region\"]\n        end = start + len(mutated_seq)\n        new_sequence[start:end] = list(mutated_seq)\n    return \"\".join(new_sequence)\n", "entry_point": "generate_mutated_sequence", "input": "[{'n_mutations': 1, 'mutated_region': (0, 'AA')}], ''", "output": "'AA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104355_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4083", "output": "{3, 1, 1361, 4083}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016919", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/prod/pct/'", "output": "'/prod/pct'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016920", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "11432345", "output": "'VCode-11432345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016921", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "4", "output": "'Read-Ack'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016922", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'4.2'", "output": "(4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016923", "code": "def simulate_packet_routing(nodes, packets):\n    total_forwarded_packets = 0\n    for i in range(len(nodes)):\n        forwarded_packets = min(nodes[i], packets[i])\n        total_forwarded_packets += forwarded_packets\n    return total_forwarded_packets\n", "entry_point": "simulate_packet_routing", "input": "[7, 7, 7], [5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65785_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016924", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[97, 79, 89, 96, 95], 5", "output": "[97, 79, 89, 96, 95]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016925", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "9877, 9", "output": "'000009877'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016926", "code": "import re\ndef count_word_occurrences(text):\n    word_count = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_word_occurrences", "input": "'containsfile'", "output": "{'containsfile': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90305_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016927", "code": "def count_test_cases(test_case_paths):\n    path_counts = {}\n    for path in test_case_paths:\n        if path in path_counts:\n            path_counts[path] += 1\n        else:\n            path_counts[path] = 1\n    return path_counts\n", "entry_point": "count_test_cases", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29018_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016928", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'add byte ptr [rax+0xffffff89], cl'", "output": "'add add byte ptr [rax+0xffffff89], cl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016929", "code": "def check_read_pairs(read_names):\n    read_pairs = {}\n    for name in read_names:\n        read_id, pair_suffix = name.split('/')\n        if read_id in read_pairs:\n            if read_pairs[read_id] != pair_suffix:\n                return False\n        else:\n            read_pairs[read_id] = pair_suffix\n    return True\n", "entry_point": "check_read_pairs", "input": "['read1/1', 'read1/1', 'read2/2', 'read3/3']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52460_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016930", "code": "def plus_one(digits):\n    n = len(digits)\n    for i in range(n-1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    new_num = [0] * (n+1)\n    new_num[0] = 1\n    return new_num\n", "entry_point": "plus_one", "input": "[9, 7, 7, 2, 8, 3, 0, 9, 3]", "output": "[9, 7, 7, 2, 8, 3, 0, 9, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123786_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016931", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'The answer is 20'", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016932", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 5, 3, 8, 4, 6, 3, 8]", "output": "[8, 8, 11, 12, 10, 9, 11, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016933", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[91], 1", "output": "91.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016934", "code": "import re\ndef extract_unique_words(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Use regular expression to extract words excluding punctuation\n    words = re.findall(r'\\b\\w+\\b', text)\n    # Store unique words in a set\n    unique_words = set(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'HEL pon pon hel'", "output": "['pon', 'hel']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103279_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016935", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'123!hggg'", "output": "'123!sttt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016936", "code": "def calculate_trainable_params(total_params, non_trainable_params):\n    trainable_params = total_params - non_trainable_params\n    return trainable_params\n", "entry_point": "calculate_trainable_params", "input": "24768882, 1000", "output": "24767882", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112905_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016937", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "'rWold'", "output": "[('WORD', 'rWold')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016938", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[20, 25, 25, 25, 30]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016939", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "6", "output": "130", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2489", "output": "{19, 1, 2489, 131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016941", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'age=3'", "output": "{'age': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016942", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 7, 5, 3, 7, 7, 4, 1]", "output": "[3, 8, 7, 6, 11, 12, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016943", "code": "def max_non_contiguous_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = exclude + num\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_contiguous_sum", "input": "[20, 0]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39163_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016944", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5, 7, 1, 6, 6, 5, 9, 7]", "output": "[1, 5, 5, 6, 6, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7807", "output": "{1, 211, 37, 7807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016946", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9034", "output": "{1, 9034, 2, 4517}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016947", "code": "def format_ranges(lst):\n    formatted_ranges = []\n    start = end = lst[0]\n    for i in range(1, len(lst)):\n        if lst[i] == end + 1:\n            end = lst[i]\n        else:\n            if end - start >= 2:\n                formatted_ranges.append(f\"{start}-{end}\")\n            else:\n                formatted_ranges.extend(str(num) for num in range(start, end + 1))\n            start = end = lst[i]\n    if end - start >= 2:\n        formatted_ranges.append(f\"{start}-{end}\")\n    else:\n        formatted_ranges.extend(str(num) for num in range(start, end + 1))\n    return ','.join(map(str, formatted_ranges))\n", "entry_point": "format_ranges", "input": "[19, 0, 5, 9, 11, 11, 10, 4]", "output": "'19,0,5,9,11,11,10,4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111612_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016948", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-7, -10, -8, -5, -7, -8, 3, 1, 4]", "output": "[-7, -10, -8, -5, -7, -8, 3, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016949", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alpha=1,be=2,gamma=3'", "output": "{'alpha': '1', 'be': '2', 'gamma': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016950", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'Mg2'", "output": "'Mg\u2082'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016951", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "2", "output": "'\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016952", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[3, 1, 3, 2, 2, 4, 1]", "output": "[2, 1, 2, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1494", "output": "{1, 2, 3, 6, 166, 9, 747, 498, 18, 83, 1494, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016954", "code": "def calculate_error_rates(acc_rate1, acc_rate5):\n    err_rate1 = 1 - acc_rate1\n    err_rate5 = 1 - acc_rate5\n    return err_rate1, err_rate5\n", "entry_point": "calculate_error_rates", "input": "2.15, 2.38", "output": "(-1.15, -1.38)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60400_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016955", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'2', '8', 'gpu'", "output": "'2.8-gpu-ml-scala2.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016956", "code": "def extract_and_multiply(input_str):\n    # Extract the two numbers from the input string\n    num0 = float(input_str[1:4])\n    num1 = float(input_str[5:8])\n    # Calculate the product of the two numbers\n    product = num0 * num1\n    return product\n", "entry_point": "extract_and_multiply", "input": "'x123x121'", "output": "14883.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128114_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016957", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4239", "output": "{1, 3, 1413, 9, 4239, 471, 27, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016958", "code": "def calculate_user_balances(transactions):\n    user_balances = {}\n    for transaction in transactions:\n        user_id = transaction[\"user_id\"]\n        amount = transaction[\"amount\"]\n        if user_id in user_balances:\n            user_balances[user_id] += amount\n        else:\n            user_balances[user_id] = amount\n    return user_balances\n", "entry_point": "calculate_user_balances", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14973_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016959", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'spotify_player'", "output": "'Spotify Player'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "635", "output": "{1, 635, 5, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016961", "code": "def count_substring(s: str, sub_s: str) -> int:\n    count = 0\n    for i in range(len(s) - len(sub_s) + 1):\n        if s[i:i+len(sub_s)] == sub_s:\n            count += 1\n    return count\n", "entry_point": "count_substring", "input": "'abcab', 'ab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128804_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016962", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'mma3=3'", "output": "{'mma3': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016963", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 1, 1, 1, 2, -1, 4, 3, 3]", "output": "{1: 4, 2: 1, -1: 1, 4: 1, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016964", "code": "import uuid\ndef generate_product_uuid(existing_uuid):\n    # Convert the existing UUID to uppercase\n    existing_uuid_upper = existing_uuid.upper()\n    # Add the prefix 'PROD_' to the uppercase UUID\n    modified_uuid = 'PROD_' + existing_uuid_upper\n    return modified_uuid\n", "entry_point": "generate_product_uuid", "input": "'550554'", "output": "'PROD_550554'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91223_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016965", "code": "def shortest_distance_to_char(S, C):\n    cp = [i for i, s in enumerate(S) if s == C]\n    result = []\n    for i, s in enumerate(S):\n        result.append(min(abs(i - x) for x in cp))\n    return result\n", "entry_point": "shortest_distance_to_char", "input": "'aCaCaC', 'C'", "output": "[1, 0, 1, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98860_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016966", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "987654320", "output": "'987.654.320'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7031", "output": "{89, 1, 79, 7031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016968", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[101, 102, 104, 103, 103]", "output": "[101, 104, 103, 103]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016969", "code": "import math\ndef sum_of_primes(n: int) -> int:\n    is_prime = [True] * (n + 1)\n    is_prime[0] = is_prime[1] = False\n    for i in range(2, int(math.sqrt(n)) + 1):\n        if is_prime[i]:\n            for j in range(i * i, n + 1, i):\n                is_prime[j] = False\n    return sum(i for i in range(2, n + 1) if is_prime[i])\n", "entry_point": "sum_of_primes", "input": "29", "output": "129", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79663_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016970", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[31]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97914_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016971", "code": "def filter_elements(iterable, include_values):\n    filtered_list = []\n    for value in iterable:\n        if value in include_values:\n            filtered_list.append(value)\n    return filtered_list\n", "entry_point": "filter_elements", "input": "[5], [5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46502_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016972", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(49, 61, 30, 60, 40, 59, 60)", "output": "(60, 59, 40, 60, 30, 61, 49)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016973", "code": "def extract_domain_name(url):\n    # Remove the protocol part of the URL\n    url = url.split(\"://\")[-1]\n    # Extract the domain name by splitting at the first single forward slash\n    domain_name = url.split(\"/\")[0]\n    return domain_name\n", "entry_point": "extract_domain_name", "input": "'http://wwatile'", "output": "'wwatile'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96968_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016974", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'eee'", "output": "'EEE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016975", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[7, 6, 2, 6, 4, 7, 6, 2]", "output": "[343, 36, 4, 36, 16, 343, 36, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016976", "code": "import string\ndef password_strength_checker(password):\n    score = 0\n    # Calculate length of the password\n    score += len(password)\n    # Check for presence of both uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for presence of at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for presence of at least one special character\n    if any(char in string.punctuation for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'A1b!'", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62688_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1931", "output": "{1, 1931}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016978", "code": "def calculate_easter_date(anno, m, n):\n    a = anno % 19\n    b = anno % 4\n    c = anno % 7\n    d = (19 * a + m) % 30\n    e = (2 * b + 4 * c + 6 * d + n) % 7\n    day = d + e\n    if day < 10:\n        day += 22\n        month = 3\n    else:\n        day -= 9\n        month = 4\n        if (day == 26) or ((day == 25) and (d == 28) and (e == 6) and (a > 10)):\n            day -= 7\n    # Adjust year if necessary\n    if month == 3 and day > 31:\n        day -= 31\n        month = 4\n    return day, month, anno\n", "entry_point": "calculate_easter_date", "input": "2024, 1, 0", "output": "(2, 4, 2024)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112411_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016979", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "43.67000000000001, 0", "output": "43.67000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016980", "code": "from typing import List\ndef best_sum(target_sum: int, numbers: List[int]) -> List[int]:\n    table = [None] * (target_sum + 1)\n    table[0] = []\n    for i in range(target_sum + 1):\n        if table[i] is not None:\n            for num in numbers:\n                if i + num <= target_sum:\n                    if table[i + num] is None or len(table[i] + [num]) < len(table[i + num]):\n                        table[i + num] = table[i] + [num]\n    return table[target_sum]\n", "entry_point": "best_sum", "input": "5, [5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127929_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016981", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "0.1, 100.0, 198.99999999999994", "output": "29.899999999999995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016982", "code": "def count_file_extensions(file_paths):\n    file_extensions_count = {}\n    # Split the input string by spaces to get individual file paths\n    paths = file_paths.strip().split()\n    for path in paths:\n        # Extract the file extension by splitting at the last '.' in the path\n        extension = path.split('.')[-1].lower() if '.' in path else ''\n        # Update the count of the file extension in the dictionary\n        file_extensions_count[extension] = file_extensions_count.get(extension, 0) + 1\n    return file_extensions_count\n", "entry_point": "count_file_extensions", "input": "'test_file.py/pat'", "output": "{'py/pat': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21533_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016983", "code": "def paginate_items(items, page_number):\n    ITEMS_PER_PAGE = 10  # Default value if settings not available\n    total_items = len(items)\n    total_pages = (total_items + ITEMS_PER_PAGE - 1) // ITEMS_PER_PAGE\n    if page_number < 1 or page_number > total_pages or not items:\n        return []\n    start_index = (page_number - 1) * ITEMS_PER_PAGE\n    end_index = min(start_index + ITEMS_PER_PAGE, total_items)\n    return items[start_index:end_index]\n", "entry_point": "paginate_items", "input": "[11], 1", "output": "[11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42452_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016984", "code": "import math\ndef calculate_nequat_nvert(n: int) -> tuple:\n    nequat = int(math.sqrt(math.pi * n))\n    nvert = nequat // 2\n    return nequat, nvert\n", "entry_point": "calculate_nequat_nvert", "input": "8", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142533_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016985", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[81, 70, 55, 50, 45, 40]", "output": "[81, 70, 55]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5581", "output": "{1, 5581}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016987", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[5, 3, 10, 3, 2, 2, 2, 4, 2]", "output": "[8, 13, 13, 5, 4, 4, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016988", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "5, 1", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1851", "output": "{3, 1, 1851, 617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016990", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hhhellh'", "output": "{'hhhellh': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016991", "code": "from typing import List, Dict, Any\ndef extract_values(entries: List[Dict[str, Any]], key: str) -> List[Any]:\n    extracted_values = []\n    for entry in entries:\n        if key in entry:\n            extracted_values.append(entry[key])\n    return extracted_values\n", "entry_point": "extract_values", "input": "[], 'any_key'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65944_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4637", "output": "{1, 4637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016993", "code": "def solve(num_stairs, points):\n    dp = [0] * (num_stairs + 1)\n    dp[1] = points[1]\n    for i in range(2, num_stairs + 1):\n        dp[i] = max(points[i] + dp[i - 1], dp[i - 2] + points[i])\n    return dp[num_stairs]\n", "entry_point": "solve", "input": "2, [0, 10, 11]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147689_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016994", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[2, 3, 3, 3, 4]", "output": "{2: 1, 3: 3, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016995", "code": "def unique_arrangements(elements, num_groups):\n    if num_groups == 1:\n        return 1\n    total_arrangements = 0\n    for i in range(1, len(elements) - num_groups + 2):\n        total_arrangements += unique_arrangements(elements[i:], num_groups - 1)\n    return total_arrangements\n", "entry_point": "unique_arrangements", "input": "[1, 2, 3, 4], 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71108_ipt35", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "469", "output": "{1, 67, 469, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016997", "code": "from typing import List\ndef count_subselectors(selectors: List[str], specific_selector: str) -> int:\n    count = 0\n    for selector in selectors:\n        if specific_selector in selector and selector != specific_selector:\n            count += 1\n    return count\n", "entry_point": "count_subselectors", "input": "[], 'any-selector'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29904_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016998", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "'123123'", "output": "[('NUMBER', '123123')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0016999", "code": "def count_attachments_per_volume(volume_attachments):\n    attachment_count = {}\n    for attachment in volume_attachments:\n        volume_id = attachment['id']\n        if volume_id in attachment_count:\n            attachment_count[volume_id] += 1\n        else:\n            attachment_count[volume_id] = 1\n    return attachment_count\n", "entry_point": "count_attachments_per_volume", "input": "[{'id': 'vol1'}]", "output": "{'vol1': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65413_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017000", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2023-01-01', '2023-01-02'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017001", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "6", "output": "[0, 0, 1, 3, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017002", "code": "def moving_average(nums, window_size):\n    moving_averages = []\n    window_sum = sum(nums[:window_size])\n    for i in range(window_size, len(nums)+1):\n        moving_averages.append(window_sum / window_size)\n        if i < len(nums):\n            window_sum = window_sum - nums[i - window_size] + nums[i]\n    return moving_averages\n", "entry_point": "moving_average", "input": "[8, 3, 11, 99, 8, 2, 11], 1", "output": "[8.0, 3.0, 11.0, 99.0, 8.0, 2.0, 11.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16719_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4913", "output": "{1, 289, 17, 4913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017004", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[4, 8, 7, 2, 1, 7, 1, 7, 7]", "output": "[16, 64, 343, 4, 1, 343, 1, 343, 343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017005", "code": "def calculate_total_length(strings):\n    total_length = 0\n    for element in strings:\n        if isinstance(element, str):\n            total_length += len(element)\n    return total_length\n", "entry_point": "calculate_total_length", "input": "['hello', 'world', '!']", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29136_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017006", "code": "def reconstruct_string(char_counts):\n    char_map = {chr(ord('a') + i): count for i, count in enumerate(char_counts)}\n    sorted_char_map = dict(sorted(char_map.items(), key=lambda x: x[1]))\n    result = ''\n    for char, count in sorted_char_map.items():\n        result += char * count\n    return result\n", "entry_point": "reconstruct_string", "input": "[2, 0, 2, 1, 0, 2] + [0] * 20", "output": "'daaccff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66252_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017007", "code": "def eval_levicivita(*args):\n    if len(args) < 2:\n        return 0\n    elif len(args) % 2 == 0:\n        return 1  # Initialize result as 1 for multiplication\n        for arg in args:\n            result *= arg\n    else:\n        return sum(args)\n", "entry_point": "eval_levicivita", "input": "", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73882_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017008", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[100, 95, 90, 90, 89]", "output": "92.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017009", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3241", "output": "{1, 463, 3241, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017010", "code": "def find_latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_version = tuple(map(int, latest_version.split('.')))\n            new_version = tuple(map(int, version.split('.')))\n            if new_version > current_version:\n                latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.1']", "output": "'1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92338_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017011", "code": "def find_modes(data):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in data:\n        frequency_dict[num] = frequency_dict.get(num, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[4, 4, 1, 2, 3]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69194_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017012", "code": "def process_numbers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            num += 3\n        else:\n            num *= 2\n        if num % 5 == 0:\n            num -= 7\n        if num < 0:\n            num = abs(num)\n        processed_list.append(num)\n    return processed_list\n", "entry_point": "process_numbers", "input": "[-1, 3, -1, 0, 3, -1, -1, -1, 3]", "output": "[2, 6, 2, 3, 6, 2, 2, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27256_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017013", "code": "def was_last_token(prev_prefix, prefix):\n    add_role = False\n    if prefix != 'I' and prev_prefix == 'I':\n        add_role = True\n    return add_role\n", "entry_point": "was_last_token", "input": "'I', 'A'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101433_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017014", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7107", "output": "{1, 2369, 3, 7107, 69, 103, 309, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017015", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[39]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75875_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "877", "output": "{1, 877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017017", "code": "def find_lcs_length(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if s1[i - 1] == s2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length", "input": "'ABCDEF', 'A1B2C3'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102514_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7055", "output": "{1, 1411, 5, 7055, 17, 83, 85, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017019", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 2, 3, 0, 6, -2, 4, -3, 4, 5, -2], 12", "output": "[0, 6, -2, 4, -3, 4, 5, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017020", "code": "import re\ndef verify_most_built_recipes_information(project_name):\n    # Simulate the behavior of verifying most built recipes information for a given project\n    default_message_present = False\n    choose_recipe_link_working = False\n    # Simulate checking for the default message and link functionality\n    if project_name == 'selenium-project':\n        default_message_present = True\n        choose_recipe_link_working = True\n    return default_message_present, choose_recipe_link_working\n", "entry_point": "verify_most_built_recipes_information", "input": "'selenium-project'", "output": "(True, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45147_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017021", "code": "def format_title(title):\n    words = title.split()\n    formatted_words = [word.capitalize().replace('-', '') for word in words]\n    formatted_title = ' '.join(formatted_words)\n    return formatted_title\n", "entry_point": "format_title", "input": "'panpin'", "output": "'Panpin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13677_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017022", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "88.0, 0", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017023", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'age=30'", "output": "{'age': '30'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017024", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "71", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017025", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "4, 11", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017026", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[10, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017027", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[4, 4, 3, 3, 0, 0]", "output": "[4, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017028", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'are'", "output": "('are', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017029", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[1, 2, 3, 4, 5]", "output": "[1, 3, 6, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017030", "code": "def sum_digits_power(n):\n    digit_sum = 0\n    num_digits = 0\n    temp = n\n    # Calculate the sum of digits\n    while temp > 0:\n        digit_sum += temp % 10\n        temp //= 10\n    # Calculate the number of digits\n    temp = n\n    while temp > 0:\n        num_digits += 1\n        temp //= 10\n    # Calculate the result\n    result = digit_sum ** num_digits\n    return result\n", "entry_point": "sum_digits_power", "input": "49000", "output": "371293", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137515_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017031", "code": "from typing import List\ndef sum_multiples(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples", "input": "[5, 10, 12, 15, 30]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40895_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017032", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'hhheoo'", "output": "b'\\x06\\x00\\x00\\x00hhheoo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017033", "code": "from typing import List\nfrom collections import deque\ndef bfs_distances(g: List[List[int]]) -> List[int]:\n    n = len(g)\n    d = [0] * n\n    visited = set()\n    que = deque([0])\n    cnt = 0\n    while que:\n        for _ in range(len(que)):\n            cur = que.popleft()\n            visited.add(cur)\n            d[cur] = cnt\n            for nxt in g[cur]:\n                if nxt not in visited:\n                    que.append(nxt)\n        cnt += 1\n    return d\n", "entry_point": "bfs_distances", "input": "[[1, 2], [3, 4], [5], [], [], []]", "output": "[0, 1, 1, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142858_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017034", "code": "from typing import List, Tuple\ndef process_command(cmd: str, args: List[str]) -> Tuple[str, List[str]]:\n    if cmd == 'debug':\n        cmd = 'dbm'\n        args = ['dbm', 'c']\n    return cmd, args\n", "entry_point": "process_command", "input": "'debug', ['some', 'args']", "output": "('dbm', ['dbm', 'c'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22372_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017035", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first participant as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 90, 80, 70, 70, 60]", "output": "[1, 2, 2, 4, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122200_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017036", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[80, 0, 80]", "output": "160", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017037", "code": "def simulate_vehicle(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        elif command == 'A':\n            y += 1\n        elif command == 'B':\n            y -= 1\n    return x, y\n", "entry_point": "simulate_vehicle", "input": "['R', 'R', 'R', 'B', 'B', 'B']", "output": "(3, -3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105598_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017038", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[5, 4, 3, 2, 5, 2, 3, 4, 2]", "output": "[25, 8, 9, 4, 25, 4, 9, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017039", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "8, 2", "output": "28.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1432", "output": "{1, 2, 4, 358, 8, 716, 179, 1432}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1431", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017041", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[14, 15]", "output": "14.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017042", "code": "def count_unique_dependencies(dependencies):\n    unique_dependencies_count = {}\n    for dependency in dependencies:\n        package, dependency_name = dependency.split()\n        if package in unique_dependencies_count:\n            unique_dependencies_count[package].add(dependency_name)\n        else:\n            unique_dependencies_count[package] = {dependency_name}\n    return {package: len(dependencies) for package, dependencies in unique_dependencies_count.items()}\n", "entry_point": "count_unique_dependencies", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1592_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017043", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8395", "output": "{1, 5, 73, 8395, 365, 1679, 115, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017044", "code": "def find_repeated_element(A):\n    count_dict = {}\n    for num in A:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    repeated_element = max(count_dict, key=count_dict.get)\n    return repeated_element\n", "entry_point": "find_repeated_element", "input": "[1, 3, 3, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99039_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017045", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[5]", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017046", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 2, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75875_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017047", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4496", "output": "{1, 2, 4, 1124, 2248, 8, 4496, 16, 562, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4495", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017048", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "1073741824, 6", "output": "1073741830", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017049", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[1, 3, 1, 3, 5]", "output": "{1: 2, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6056", "output": "{1, 2, 4, 6056, 8, 1514, 3028, 757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6055", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017051", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'examleft'", "output": "'App/static/uploads/examleft'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017052", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[100, 90, 90, 30, 10, 20], 4", "output": "[100, 90, 90, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4989", "output": "{1, 3, 4989, 1663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017054", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "\"'PyQuotesth'\"", "output": "'PyQuotesth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017055", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coeff in coefficients[::-1]:\n        result = result * x + coeff\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[1, -3], 1", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110926_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017056", "code": "import re\nWALIKI_SLUG_PATTERN = r'^[a-z0-9_-]+$'\ndef extract_valid_slugs(strings):\n    valid_slugs = []\n    for string in strings:\n        if re.match(WALIKI_SLUG_PATTERN, string):\n            valid_slugs.append(string)\n    return valid_slugs\n", "entry_point": "extract_valid_slugs", "input": "['Hello World', 'invalid slug', 'slug!@#', 'Another&Invalid']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116729_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017057", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8615", "output": "{1, 1723, 5, 8615}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8614", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017058", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'40-9'", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017059", "code": "def count_nodes(node):\n    node_count = 1  # Count the current node\n    children = node.get('children', [])\n    for child in children:\n        node_count += count_nodes(child)\n    return node_count\n", "entry_point": "count_nodes", "input": "{'children': []}", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132760_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017060", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4405", "output": "{1, 5, 4405, 881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4404", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017061", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "10", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017062", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "12", "output": "653", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017063", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[-1, 3, 2, 2, 3, -1, 0, 0]", "output": "[-1, 3, 2, 2, 3, -1, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017064", "code": "from typing import List, Dict, Union\ndef calculate_total_points(competition_type: str, results: List[Dict[str, Union[str, int]]]) -> Dict[str, int]:\n    total_points = {}\n    if competition_type == 'single':\n        for result in results:\n            athlete_name = result['athlete_name']\n            result_value = result['result_value']\n            total_points[athlete_name] = total_points.get(athlete_name, 0) + result_value\n    elif competition_type == 'race':\n        results.sort(key=lambda x: x['result_value'], reverse=True)\n        for i, result in enumerate(results):\n            athlete_name = result['athlete_name']\n            total_points[athlete_name] = total_points.get(athlete_name, 0) + (100 - 10*i)\n    elif competition_type == 'tournament':\n        for result in results:\n            athlete_name = result['athlete_name']\n            result_value = result['result_value']\n            total_points[athlete_name] = total_points.get(athlete_name, 0) + result_value\n    elif competition_type == 'robin':\n        for result in results:\n            athlete_name = result['athlete_name']\n            result_value = result['result_value']\n            total_points[athlete_name] = total_points.get(athlete_name, 0) + result_value\n    return total_points\n", "entry_point": "calculate_total_points", "input": "'single', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106352_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017065", "code": "def find_smallest_index(N, list_A, list_B):\n    a_sum = 0\n    b_sum = 0\n    for i in range(N):\n        a_sum += list_A[i]\n        b_sum += list_B[i]\n        if a_sum == b_sum:\n            return i + 1\n    return 0\n", "entry_point": "find_smallest_index", "input": "3, [1, 2, 3], [5, 1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111422_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6097", "output": "{1, 67, 871, 7, 13, 6097, 469, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017067", "code": "def determine_client_type(client_id: str) -> str:\n    client_number = int(client_id.split('-')[-1])\n    if client_number < 100:\n        return \"OLD1-\" + str(client_number)\n    elif 100 <= client_number < 1000:\n        return \"OLD2-\" + str(client_number)\n    else:\n        return \"OLD3-\" + str(client_number)\n", "entry_point": "determine_client_type", "input": "'client-50'", "output": "'OLD1-50'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46850_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4819", "output": "{1, 4819, 61, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017069", "code": "import re\nfrom typing import Tuple\ndef parse_revision_id(revision_id: str) -> Tuple[str, str]:\n    pattern = r'^(\\d)([0-9a-fA-F]{12})$'\n    match = re.match(pattern, revision_id)\n    if match:\n        revision_number = match.group(1)\n        hex_string = match.group(2)\n        password = hex_string[:6]\n        key = hex_string[6:]\n        return (password, key)\n    else:\n        return ('', '')\n", "entry_point": "parse_revision_id", "input": "'1fb3556fb3b3b'", "output": "('fb3556', 'fb3b3b')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33893_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017070", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48 65 66 C4 41'", "output": "b'Hef\\xc4A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017071", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "-5, 5", "output": "-20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017072", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(0, -1, 0, 0, 1)", "output": "'0.-1.0.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017073", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'1.2.0100deithat', '1.2.0'", "output": "'1.2.01.2.0100deithat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017074", "code": "def min_energy(energies):\n    min_energy_required = 0\n    current_energy = 0\n    for energy in energies:\n        current_energy += energy\n        if current_energy < 0:\n            min_energy_required += abs(current_energy)\n            current_energy = 0\n    return min_energy_required\n", "entry_point": "min_energy", "input": "[-10, -20, -12]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017075", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "1, 3", "output": "[0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017076", "code": "import re\ndef extract_code(title):\n    match = re.search(r\"\\w+-?\\d+\", title)\n    return match.group(0) if match else \"\"\n", "entry_point": "extract_code", "input": "'This title contains the code: PrPrPnPro23'", "output": "'PrPrPnPro23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13798_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017077", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[70, 69, 68, 65], 3", "output": "69.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52376_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017078", "code": "def custom_base_to_base10(custom_number, input_base):\n    numbers = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n    size = len(custom_number)\n    result = 0\n    for i in range(size):\n        digit_value = numbers.index(custom_number[size - 1 - i])\n        result += digit_value * (input_base ** i)\n    return result\n", "entry_point": "custom_base_to_base10", "input": "'123156', 10", "output": "123156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4122_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017079", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[3, 3, 6, 5, 2, 2, 1, 1, 0]", "output": "{3: 2, 6: 1, 5: 1, 2: 2, 1: 2, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017080", "code": "def max_non_overlapping_sticks(sticks, target):\n    sticks.sort()  # Sort the sticks in ascending order\n    selected_sticks = 0\n    total_length = 0\n    for stick in sticks:\n        if total_length + stick <= target:\n            selected_sticks += 1\n            total_length += stick\n    return selected_sticks\n", "entry_point": "max_non_overlapping_sticks", "input": "[1, 1, 1, 1, 1, 1, 2], 7", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122772_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017081", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -1.0, -0.2", "output": "-1.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017082", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[2, -1, 1, 2, 1, -1, 2]", "output": "[2, -1, 1, 2, 1, -1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017083", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[5, 1, 2, 5, 4, 3, 1]", "output": "[5, 6, 8, 13, 17, 20, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017084", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>This</p>'", "output": "'This'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017085", "code": "def count_unique_squares(group_of_squares: str) -> int:\n    squares_list = group_of_squares.split()  # Split the input string into individual square representations\n    unique_squares = set(squares_list)  # Convert the list into a set to remove duplicates\n    return len(unique_squares)  # Return the count of unique squares\n", "entry_point": "count_unique_squares", "input": "'1 1 1'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41414_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017086", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "'woft'", "output": "'Woft'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017087", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "-1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017088", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017089", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1043", "output": "{1, 1043, 149, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017090", "code": "def count_sentences(input_string):\n    ENDINGS = ['.', '!', '?', ';']\n    sentence_count = 0\n    in_sentence = False\n    for char in input_string:\n        if char in ENDINGS:\n            if not in_sentence:\n                sentence_count += 1\n                in_sentence = True\n        else:\n            in_sentence = False\n    return sentence_count\n", "entry_point": "count_sentences", "input": "'Hello there! How are you?'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127733_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017091", "code": "def reverse_string_in_special_way(string: str) -> str:\n    string = list(string)\n    left, right = 0, len(string) - 1\n    while left < right:\n        string[left], string[right] = string[right], string[left]\n        left += 1\n        right -= 1\n    return ''.join(string)\n", "entry_point": "reverse_string_in_special_way", "input": "'python'", "output": "'nohtyp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21549_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017092", "code": "from typing import List\ndef split_list(lst: List[int], n: int) -> List[List[int]]:\n    if n == 1:\n        return [lst]\n    output = [[] for _ in range(n)]\n    for i, num in enumerate(lst):\n        output[i % n].append(num)\n    return output\n", "entry_point": "split_list", "input": "[10, 20, 30, 40, 50, 60], 2", "output": "[[10, 30, 50], [20, 40, 60]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21886_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017093", "code": "def product_except_current(nums):\n    n = len(nums)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products of elements to the left of the current element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * nums[i - 1]\n    # Calculate products of elements to the right of the current element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * nums[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "product_except_current", "input": "[1, 2, 3, 4]", "output": "[24, 12, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106050_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9973", "output": "{1, 9973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017095", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[5, 7, 6, 1, 5, 5, 6, 7, 5]", "output": "[1, 5, 5, 5, 5, 6, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017096", "code": "import re\ndef extract_unique_words(text):\n    # Split the text into words using regular expressions\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Return a sorted list of unique words\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'LhHlLo'", "output": "['lhhllo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87039_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017097", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[34, 22, 12, 64, 11, 25, 12, 90, 34]", "output": "[11, 12, 12, 22, 25, 34, 34, 64, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017098", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[8, 3, 6, 2, 7], 3", "output": "[(8, 3, 6), (3, 6, 2), (6, 2, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017099", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "100.0, 50.0", "output": "(-50.0, 50.0, 135.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017100", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "18, 1", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017101", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 7, 14, 21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017102", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'Hello', '1..00110'", "output": "{'1..00110': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3176", "output": "{1, 2, 4, 3176, 8, 397, 1588, 794}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3175", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017104", "code": "def add_base_path_to_urls(url_patterns, base_path):\n    return [base_path + url for url in url_patterns]\n", "entry_point": "add_base_path_to_urls", "input": "[], '/base/path/'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8458", "output": "{1, 8458, 2, 4229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8457", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017106", "code": "def prepare_filename_string(input_string):\n    processed_string = input_string.replace(\"_\", \"-\").replace(\"|\", \"-\").replace(\" \", \"-\").replace(\"(\", \"\").replace(\")\", \"\").lower()\n    return processed_string\n", "entry_point": "prepare_filename_string", "input": "' '", "output": "'-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145297_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017107", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[10, 20, 30, 40, 50]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1843", "output": "{19, 1, 1843, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017109", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9129", "output": "{1, 3, 3043, 9129, 17, 51, 179, 537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017110", "code": "def generate_symmetric_banner(text, gap):\n    total_length = len(text) + gap\n    left_padding = (total_length - len(text)) // 2\n    right_padding = total_length - len(text) - left_padding\n    symmetric_banner = \" \" * left_padding + text + \" \" * right_padding\n    return symmetric_banner\n", "entry_point": "generate_symmetric_banner", "input": "'Hello, World!', 30", "output": "'               Hello, World!               '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92337_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017111", "code": "from typing import List\ndef count_ways_to_sum(arr: List[int], S: int) -> int:\n    dp = [0] * (S + 1)\n    dp[0] = 1\n    for num in arr:\n        for i in range(num, S + 1):\n            dp[i] += dp[i - num]\n    return dp[S]\n", "entry_point": "count_ways_to_sum", "input": "[1, 2, 3], 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51870_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017112", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[4, 0, 4, 0]", "output": "[4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017113", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "7", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017114", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'name=John age=30'", "output": "{'name': 'John', 'age': '30'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017115", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "1, 2", "output": "2.23606797749979", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017116", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[50, 2, 1]", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017117", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9726", "output": "{1, 2, 3, 6, 3242, 1621, 9726, 4863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2459", "output": "{1, 2459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017119", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5289", "output": "{1, 129, 3, 1763, 5289, 41, 43, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9853", "output": "{1, 59, 9853, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6739", "output": "{1, 6739, 293, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1448", "output": "{1, 2, 4, 1448, 8, 362, 724, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1447", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017123", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'8dd8c05c3e<PASSWORD>', 'ca'", "output": "'8dd8c05c3eca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017124", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[2, 0, -2, 2, 2, 2]", "output": "[4, 0, -4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017125", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'ppr prep!', 'PRETPREPX'", "output": "'pprprepPRETPREPX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017126", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'This is [an] example'", "output": "'This is \\x1b[38;5;196man\\x1b[0m example'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017127", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017128", "code": "_flav_dict = {\"g\": 21, \"d\": 1, \"u\": 2, \"s\": 3, \"c\": 4, \"b\": 5, \"t\": 6}\ndef get_particle(flav_str, skip_error=False):\n    particle = _flav_dict.get(flav_str[0])\n    if particle is None:\n        if not skip_error:\n            raise ValueError(f\"Could not understand the incoming flavour: {flav_str}. You can skip this error by using --no_pdf\")\n        else:\n            return None\n    if flav_str[-1] == \"~\":\n        particle = -particle\n    return particle\n", "entry_point": "get_particle", "input": "'s~'", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112786_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017129", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 2, 3, 8]", "output": "(3, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3237", "output": "{1, 3, 3237, 39, 13, 83, 1079, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017131", "code": "def replace_file_type(file_name, new_type):\n    \"\"\"\n    Replaces the file type extension of a given file name with a new type.\n    :param file_name: Original file name with extension\n    :param new_type: New file type extension\n    :return: Modified file name with updated extension\n    \"\"\"\n    file_name_parts = file_name.split(\".\")\n    if len(file_name_parts) > 1:  # Ensure there is a file extension to replace\n        file_name_parts[-1] = new_type  # Replace the last part (file extension) with the new type\n        return \".\".join(file_name_parts)  # Join the parts back together with \".\"\n    else:\n        return file_name  # Return the original file name if no extension found\n", "entry_point": "replace_file_type", "input": "'temp.old_extension', 'tdt'", "output": "'temp.tdt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41247_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017132", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[18, 25, 30]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017133", "code": "def reverse_words(input_string):\n    # Split the input string into individual words\n    words = input_string.split()\n    # Reverse each word in the list of words\n    reversed_words = [word[::-1] for word in words]\n    # Join the reversed words back together into a single string\n    reversed_string = ' '.join(reversed_words)\n    return reversed_string\n", "entry_point": "reverse_words", "input": "'hello world'", "output": "'olleh dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149182_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017134", "code": "import re\ndef clean_network_names(networks):\n    network_names_list = re.findall(\"(?:Profile\\s*:\\s)(.*)\", networks)\n    lis = network_names_list[0].split(\"\\\\r\\\\n\")\n    network_names = []\n    for i in lis:\n        if \":\" in i:\n            index = i.index(\":\")\n            network_names.append(i[index + 2 :])\n        else:\n            network_names.append(i)\n    cleaned_network_names = [name.strip() for name in network_names if name.strip()]\n    return cleaned_network_names\n", "entry_point": "clean_network_names", "input": "'Profile : WiFi2\\\\r\\\\nProfile : ProfileF'", "output": "['WiFi2', 'ProfileF']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144248_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017135", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7988", "output": "{1, 2, 4, 1997, 7988, 3994}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7987", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017136", "code": "def convert_bitmap_to_active_bits(primary_bitmap):\n    active_data_elements = []\n    for i in range(len(primary_bitmap)):\n        if primary_bitmap[i] == '1':\n            active_data_elements.append(i + 1)  # Data element numbers start from 1\n    return active_data_elements\n", "entry_point": "convert_bitmap_to_active_bits", "input": "'1'", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53443_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017137", "code": "def normalize_text(text):\n    normalized_text = []\n    word = \"\"\n    for char in text:\n        if char.isalnum():\n            word += char\n        elif word:\n            normalized_text.append(word)\n            word = \"\"\n    if word:\n        normalized_text.append(word)\n    return \" \".join(normalized_text).lower()\n", "entry_point": "normalize_text", "input": "'h'", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35252_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017138", "code": "def classify_superheroes(powers):\n    good_superheroes = []\n    evil_superheroes = []\n    total_good_power = 0\n    total_evil_power = 0\n    for power in powers:\n        if power > 0:\n            good_superheroes.append(power)\n            total_good_power += power\n        else:\n            evil_superheroes.append(power)\n            total_evil_power += power\n    return good_superheroes, evil_superheroes, total_good_power, total_evil_power\n", "entry_point": "classify_superheroes", "input": "[8, 10, 8, 7, 8, -5]", "output": "([8, 10, 8, 7, 8], [-5], 41, -5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7614_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017139", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 2, 2, 3, 1, 2, 2]", "output": "[3, 4, 5, 4, 3, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017140", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 2", "output": "12.566370614359172", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9383", "output": "{1, 11, 853, 9383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017142", "code": "def generate_unique_engine_name(existing_engine_names):\n    existing_numbers = set()\n    for name in existing_engine_names:\n        if name.startswith(\"engine\"):\n            try:\n                num = int(name[6:])  # Extract the number part after \"engine\"\n                existing_numbers.add(num)\n            except ValueError:\n                pass  # Ignore if the number part is not an integer\n    new_num = 1\n    while new_num in existing_numbers:\n        new_num += 1\n    return f\"engine{new_num}\"\n", "entry_point": "generate_unique_engine_name", "input": "['engine1']", "output": "'engine2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120274_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017143", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'rr'", "output": "'rr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017144", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "404", "output": "'OTP authentication failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017145", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1611", "output": "{1, 3, 9, 1611, 179, 537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017146", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "306783378, 1", "output": "306783378", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017147", "code": "def generate_place_names(n):\n    place_names = []\n    for i in range(1, n+1):\n        if i % 2 == 0 and i % 3 == 0:\n            place_names.append(\"Metropolis\")\n        elif i % 2 == 0:\n            place_names.append(\"City\")\n        elif i % 3 == 0:\n            place_names.append(\"Town\")\n        else:\n            place_names.append(str(i))\n    return place_names\n", "entry_point": "generate_place_names", "input": "1", "output": "['1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143516_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017148", "code": "def simulate_card_game(N, cards):\n    player_a_sum = 0\n    player_b_sum = 0\n    for i, card in enumerate(cards):\n        if i % 2 == 0:\n            player_a_sum += card\n        else:\n            player_b_sum += card\n    if player_a_sum > player_b_sum:\n        return \"Player A wins\"\n    elif player_b_sum > player_a_sum:\n        return \"Player B wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "simulate_card_game", "input": "4, [1, 3, 2, 4]", "output": "'Player B wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2279_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017149", "code": "TEST_THREAD_NETWORK_IDS = [\n    bytes.fromhex(\"fedcba9876543210\"),\n]\nTEST_WIFI_SSID = \"TestSSID\"\nTEST_WIFI_PASS = \"<PASSWORD>\"\nWIFI_NETWORK_FEATURE_MAP = 1\nTHREAD_NETWORK_FEATURE_MAP = 2\ndef get_network_feature_map(network_type):\n    if network_type == \"Wi-Fi\":\n        return WIFI_NETWORK_FEATURE_MAP\n    elif network_type == \"Thread\":\n        return THREAD_NETWORK_FEATURE_MAP\n    else:\n        return \"Invalid network type\"\n", "entry_point": "get_network_feature_map", "input": "'Thread'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132054_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017150", "code": "def split_list(x, n):\n    x = list(x)\n    if n < 2:\n        return [x]\n    def gen():\n        m = len(x) / n\n        i = 0\n        for _ in range(n-1):\n            yield x[int(i):int(i + m)]\n            i += m\n        yield x[int(i):]\n    return list(gen())\n", "entry_point": "split_list", "input": "[8, 1, 4, 1, 2, 9, 10], 2", "output": "[[8, 1, 4], [1, 2, 9, 10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38553_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017151", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 3, 3, 1, 3, 3, 3]", "output": "[3, 6, 9, 10, 13, 16, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5433", "output": "{1811, 1, 3, 5433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017153", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return None\n    nums.sort()\n    potential_product1 = nums[-1] * nums[-2] * nums[-3]\n    potential_product2 = nums[0] * nums[1] * nums[-1]\n    return max(potential_product1, potential_product2)\n", "entry_point": "max_product_of_three", "input": "[6, 6, 6, 2, -1]", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97311_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017154", "code": "def flexible_sum(*args):\n    if len(args) < 3:\n        args += (30, 40)[len(args):]  # Assign default values if fewer than 3 arguments provided\n    return sum(args)\n", "entry_point": "flexible_sum", "input": "70, 82", "output": "152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74466_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017155", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wx.Button'", "output": "'wx.Button'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017156", "code": "from typing import List\ndef min_time_to_complete(tasks: List[int], cooldown: int) -> int:\n    cooldowns = {}\n    time = 0\n    for task in tasks:\n        if task in cooldowns and cooldowns[task] > time:\n            time = cooldowns[task]\n        time += 1\n        cooldowns[task] = time + cooldown\n    return time\n", "entry_point": "min_time_to_complete", "input": "[1, 2, 1, 2, 1], 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1115_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017157", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "164", "output": "{1, 2, 4, 164, 41, 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt163", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3494", "output": "{1, 2, 1747, 3494}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6359", "output": "{1, 6359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017160", "code": "def find_movies_with_name(movies, name):\n    result = []\n    for movie in movies:\n        if name.lower() in movie['title'].lower():\n            result.append(movie['title'])\n    return result\n", "entry_point": "find_movies_with_name", "input": "[], 'test'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83327_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017161", "code": "def find_missing_ranges(nums, lower, upper):\n    result = []\n    nums = [lower - 1] + nums + [upper + 1]\n    for i in range(len(nums) - 1):\n        diff = nums[i + 1] - nums[i]\n        if diff == 2:\n            result.append(str(nums[i] + 1))\n        elif diff > 2:\n            result.append(f\"{nums[i] + 1}->{nums[i + 1] - 1}\")\n    return result\n", "entry_point": "find_missing_ranges", "input": "[1, 3, 50, 75, 100], 1, 100", "output": "['2', '4->49', '51->74', '76->99']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51417_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017162", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'dng'", "output": "{'dng': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017163", "code": "# Define the statuses dictionary\nstatuses = {\n    1: 'Voting',\n    2: 'Innocent',\n    3: 'Guilty',\n}\n# Implement the get_status_display function\ndef get_status_display(status):\n    return statuses.get(status, 'Unknown')  # Return the status string or 'Unknown' if status code is not found\n", "entry_point": "get_status_display", "input": "1", "output": "'Voting'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37325_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017164", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study1234_20220t101sxt.txt'", "output": "(1234, '20220t101sxt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017165", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "6, 4", "output": "1296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017166", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8601", "output": "{1, 3, 141, 47, 2867, 183, 8601, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017167", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "'http://www.example.com'", "output": "'www.example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017168", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[40, 40, 39, 35, 30]", "output": "[40, 40, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017169", "code": "def calculate_average(data, index):\n    \"\"\"\n    Function to calculate the average of a specific attribute in a list of data points.\n    Arguments:\n    data: List of data points.\n    index: Index of the attribute for which the average needs to be calculated.\n    Returns:\n    The average value of the specified attribute.\n    \"\"\"\n    attribute_values = [d[index] for d in data]\n    total_sum = sum(attribute_values)\n    average = total_sum / len(data)\n    return average\n", "entry_point": "calculate_average", "input": "[[10, 'a'], [20, 'b'], [30, 'c'], [40, 'd']], 0", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61889_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017170", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[5, 6, 7, 9, 9, 11, 2, 1, 2]", "output": "{(5, 6, 7), (9, 9, 11), (2, 1, 2)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017171", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8719", "output": "{1, 8719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017172", "code": "def get_ZX_from_ZZ_XX(ZZ, XX):\n    if hasattr(ZZ, '__iter__') and len(ZZ) == len(XX):\n        return [(z, x) for z, x in zip(ZZ, XX)]\n    else:\n        return (ZZ, XX)\n", "entry_point": "get_ZX_from_ZZ_XX", "input": "5, ['x', 'y', 'z']", "output": "(5, ['x', 'y', 'z'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141248_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017173", "code": "from typing import List, Tuple\ndef calculate_average_pixel_values(image: List[int]) -> Tuple[float, float, float, float]:\n    red_sum, green_sum, blue_sum, alpha_sum = 0, 0, 0, 0\n    for i in range(0, len(image), 4):\n        red_sum += image[i]\n        green_sum += image[i + 1]\n        blue_sum += image[i + 2]\n        alpha_sum += image[i + 3]\n    num_pixels = len(image) // 4\n    red_avg = round(red_sum / num_pixels, 2)\n    green_avg = round(green_sum / num_pixels, 2)\n    blue_avg = round(blue_sum / num_pixels, 2)\n    alpha_avg = round(alpha_sum / num_pixels, 2)\n    return red_avg, green_avg, blue_avg, alpha_avg\n", "entry_point": "calculate_average_pixel_values", "input": "[191, 63, 63, 191, 192, 64, 64, 191]", "output": "(191.5, 63.5, 63.5, 191.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96929_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017174", "code": "def get_addresses(mask, address):\n    addresses = ['']\n    for bit_mask, bit_address in zip(mask, format(address, '036b')):\n        if bit_mask == '0':\n            addresses = [addr + bit for addr, bit in zip(addresses, bit_address)]\n        elif bit_mask == '1':\n            addresses = [addr + '1' for addr in addresses]\n        elif bit_mask == 'X':\n            new_addresses = []\n            for addr in addresses:\n                new_addresses.append(addr + '0')\n                new_addresses.append(addr + '1')\n            addresses = new_addresses\n    return [int(addr, 2) for addr in addresses]\n", "entry_point": "get_addresses", "input": "'00000000000000000000000000000000000X', 38", "output": "[38, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128658_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017175", "code": "def calculate_file_size(chunk_lengths):\n    total_size = 0\n    seen_bytes = set()\n    for length in chunk_lengths:\n        total_size += length\n        for i in range(length - 1):\n            if total_size - i in seen_bytes:\n                total_size -= 1\n            seen_bytes.add(total_size - i)\n    return total_size\n", "entry_point": "calculate_file_size", "input": "[20, 18]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134958_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3329", "output": "{1, 3329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017177", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "102, 2", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017178", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[3, 4, 2, 5, 5, 5, 5, 2]", "output": "[27, 16, 4, 125, 125, 125, 125, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7142", "output": "{1, 2, 3571, 7142}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017180", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 90, 80, 80, 80, 70, 60]", "output": "[1, 2, 2, 4, 4, 4, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138156_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017181", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[8, 1, 4, 1, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017182", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8521", "output": "{8521, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017183", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-2, 7", "output": "-128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt70", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017184", "code": "from typing import List\nfrom math import sqrt\ndef process_integers(int_list: List[int], threshold: int) -> float:\n    filtered_integers = [x for x in int_list if x >= threshold]\n    squared_integers = [x**2 for x in filtered_integers]\n    sum_squared = sum(squared_integers)\n    return sqrt(sum_squared)\n", "entry_point": "process_integers", "input": "[4, 6, 8], 4", "output": "10.770329614269007", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15467_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017185", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3122", "output": "{1, 2, 7, 14, 3122, 1561, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017186", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'myl_mdule'", "output": "'myl_mdule'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017187", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[3, 1, 4, 3, 5, 2, 4, 4, 4]", "output": "[3, 4, 8, 11, 16, 18, 22, 26, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017188", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1026", "output": "b'\\x00\\x00\\x04\\x02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017189", "code": "def find_last_word_length(s: str) -> int:\n    reversed_string = s.strip()[::-1]  # Reverse the input string after removing leading/trailing spaces\n    length = 0\n    for char in reversed_string:\n        if char == ' ':\n            if length == 0:\n                continue\n            break\n        length += 1\n    return length\n", "entry_point": "find_last_word_length", "input": "'The cat'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93428_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "109", "output": "{1, 109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt108", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017191", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'helthisoo'", "output": "['helthisoo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017192", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[170, 170, 170]", "output": "170", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "759", "output": "{1, 33, 3, 69, 11, 23, 759, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017194", "code": "def FindPairsWithSum(Arr, Total):\n    pairs = []\n    seen = {}\n    for x in Arr:\n        diff = Total - x\n        if diff in seen:\n            pairs.append((x, diff))\n        seen[x] = True\n    return pairs\n", "entry_point": "FindPairsWithSum", "input": "[1, 2, 4, 7], 6", "output": "[(4, 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121436_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8999", "output": "{1, 8999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017196", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3658", "output": "'1 hr 58 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1977", "output": "{3, 1, 1977, 659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1976", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017198", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[4, 8, 1, 1, 3]", "output": "[8, 4, 1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017199", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'fReadil', ''", "output": "('fReadil', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017200", "code": "def linear_interpolate(x_values, y_values, x):\n    if x < x_values[0] or x > x_values[-1]:\n        return None  # x is outside the range of known x-coordinates\n    for i in range(len(x_values) - 1):\n        if x_values[i] <= x <= x_values[i + 1]:\n            x0, x1 = x_values[i], x_values[i + 1]\n            y0, y1 = y_values[i], y_values[i + 1]\n            return y0 + (y1 - y0) * (x - x0) / (x1 - x0)\n", "entry_point": "linear_interpolate", "input": "[2, 4], [20, 30], 3", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73017_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017201", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "887", "output": "{1, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017202", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'323.14.0'", "output": "(323, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017203", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 10, 15, 20, 5, 9, 21, 25, 30]", "output": "(4, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017204", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'pythohehlon'", "output": "{'pythohehlon': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017205", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'iMBig *ame*'", "output": "('iMBig', 'ame')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017206", "code": "def group_strings_by_length(strings):\n    grouped_strings = {}\n    for string in strings:\n        length = len(string)\n        if length not in grouped_strings:\n            grouped_strings[length] = []\n        grouped_strings[length].append(string)\n    return grouped_strings\n", "entry_point": "group_strings_by_length", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14045_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017207", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'fbfforffor'", "output": "'fbfforffor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017208", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3], 1", "output": "300.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017209", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'that', '11.11.2.0.02.0.0'", "output": "'11.11.2.0.02.0.0that'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017210", "code": "def text_transformation(text: str) -> str:\n    # Convert to lowercase, replace \"deprecated\" with \"obsolete\", strip whitespaces, and reverse the string\n    transformed_text = text.lower().replace(\"deprecated\", \"obsolete\").strip()[::-1]\n    return transformed_text\n", "entry_point": "text_transformation", "input": "'deprecated.'", "output": "'.etelosbo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19675_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017211", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'2.10.0'", "output": "'2.10.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017212", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "''", "output": "'<p></p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2929", "output": "{2929, 1, 101, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017214", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/user/files/docs', '/user/files/home/download'", "output": "'../home/download'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5763", "output": "{1, 1921, 3, 5763, 17, 113, 339, 51}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017216", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4647", "output": "{1, 3, 1549, 4647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9373", "output": "{1, 7, 103, 91, 13, 721, 1339, 9373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017218", "code": "from typing import List, Dict\ndef generate_output(last: List[int], classes: Dict[int, str], beamWidth: int) -> List[str]:\n    # Sort labelings by probability\n    last.sort(reverse=True)\n    # Get the most probable labelings based on beam width\n    bestLabelings = last[:beamWidth]\n    output = []\n    for bestLabeling in bestLabelings:\n        # Map labels to characters\n        res = ''.join([classes[bestLabeling]])\n        output.append(res)\n    return output\n", "entry_point": "generate_output", "input": "[], {}, 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66107_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017219", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017220", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "2, 12", "output": "4096", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017221", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "133", "output": "{1, 19, 133, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017222", "code": "def min_eggs_needed(egg_weights, n):\n    dp = [float('inf')] * (n + 1)\n    dp[0] = 0\n    for w in range(1, n + 1):\n        for ew in egg_weights:\n            if w - ew >= 0:\n                dp[w] = min(dp[w], dp[w - ew] + 1)\n    return dp[n]\n", "entry_point": "min_eggs_needed", "input": "[1], 51", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108972_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017223", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'.1'", "output": "'.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017224", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'2.22.6262'", "output": "(2, 22, 6262)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017225", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "10, b=5, c=5, d=8", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017226", "code": "def construct_path(path: str, name: str) -> str:\n    if path.endswith(\"/\"):\n        path = path[:-1]\n    if name.startswith(\"/\"):\n        name = name[1:]\n    return f\"{path}/{name}\"\n", "entry_point": "construct_path", "input": "'//e//h/', '/e//uuuseserujamsuseru_uja'", "output": "'//e//h/e//uuuseserujamsuseru_uja'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82517_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017227", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[2, 3, 5, 6]", "output": "'2-3-5-6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017228", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'https:peecom', '/apiata'", "output": "'https:peecom/apiata'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017229", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "find_single_number", "input": "[-2, 1, 1, 2, 2, 3, 3]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67406_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017230", "code": "# Dictionary mapping ANSI escape codes to substrings\nansi_to_substring = {\n    '\\x1b[91;1m': '+m',\n    '\\x1b[92;1m': '+h',\n    '\\x1b[93;1m': '+k',\n    '\\x1b[94;1m': '+b',\n    '\\x1b[95;1m': '+u',\n    '\\x1b[96;1m': '+c',\n    '\\x1b[97;1m': '+p',\n    '\\x1b[98;1m': '+w',\n    '\\x1b[0m': '+0'\n}\ndef decode(text):\n    for ansi_code, substring in ansi_to_substring.items():\n        text = text.replace(ansi_code, substring)\n    return text\n", "entry_point": "decode", "input": "'Hello\\x1b[98;1m, WWrld\\x1b[0m!'", "output": "'Hello+w, WWrld+0!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18500_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017231", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'PIP', 'ME'", "output": "'Invalid status code: PIP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017232", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[4, 0, 1]", "output": "[4, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017233", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "7", "output": "'13112221'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017234", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2243", "output": "{1, 2243}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4570", "output": "{1, 2, 5, 457, 10, 2285, 914, 4570}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4569", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017236", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[82]", "output": "[82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017237", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "7, 2", "output": "(3, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017238", "code": "def process_markup(text: str) -> str:\n    formatted_text = \"\"\n    stack = []\n    current_text = \"\"\n    for char in text:\n        if char == '[':\n            if current_text:\n                formatted_text += current_text\n                current_text = \"\"\n            stack.append(char)\n        elif char == ']':\n            tag = \"\".join(stack)\n            stack = []\n            if tag == \"[b]\":\n                current_text = f\"<b>{current_text}</b>\"\n            elif tag == \"[r]\":\n                current_text = f\"<span style='color:red'>{current_text}</span>\"\n            elif tag == \"[u]\":\n                current_text = f\"<u>{current_text}</u>\"\n        else:\n            current_text += char\n    formatted_text += current_text\n    return formatted_text\n", "entry_point": "process_markup", "input": "'[b]Hello[/b] [r]World[/r]'", "output": "'bHello/b rWorld/r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63510_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017239", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "9", "output": "512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017240", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "422", "output": "{1, 2, 211, 422}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017241", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[8, 10, 5, 11, 2, 10, 7, 10]", "output": "[8, 11, 7, 14, 6, 15, 13, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017242", "code": "import json\ndef convert_to_json_with_non_ascii(frecuencias):\n    data_mercado = json.dumps(frecuencias, ensure_ascii=False)\n    return data_mercado\n", "entry_point": "convert_to_json_with_non_ascii", "input": "{}", "output": "'{}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26379_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017243", "code": "def find_highest_ranks(detection_list):\n    highest_ranked_item = '-'\n    second_highest_ranked_item = '-'\n    for item in detection_list:\n        if highest_ranked_item == '-':\n            highest_ranked_item = item\n        else:\n            if detection_list[item]['rank'] > detection_list[highest_ranked_item]['rank']:\n                second_highest_ranked_item = highest_ranked_item\n                highest_ranked_item = item\n            elif second_highest_ranked_item == '-':\n                second_highest_ranked_item = item\n            else:\n                if detection_list[item]['rank'] > detection_list[second_highest_ranked_item]['rank']:\n                    second_highest_ranked_item = item\n    return highest_ranked_item, second_highest_ranked_item\n", "entry_point": "find_highest_ranks", "input": "{}", "output": "('-', '-')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017244", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study10001_20221125.txt'", "output": "(10001, '20221125')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017245", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[1, 3, 2, 4], [2, 4, 1, 3]", "output": "('Tie', 2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017246", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6918", "output": "{1, 2, 3, 3459, 2306, 6918, 6, 1153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6917", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017247", "code": "import re\ndef extract_strings(code_snippet):\n    return re.findall(r'\"(.*?)\"', code_snippet)\n", "entry_point": "extract_strings", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50912_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1898", "output": "{1, 2, 73, 1898, 13, 146, 949, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017249", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'rrrrorr', 10", "output": "'rrrrorr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017250", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3895", "output": "{1, 5, 41, 779, 205, 19, 3895, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "203", "output": "{1, 203, 29, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1", "output": "{1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017253", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 600.0), ('W', 300.0)]", "output": "300.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017254", "code": "def count_values_in_range(n, min_val, max_val):\n    count = 0\n    i = 0\n    while True:\n        i, sq = i + 1, i ** n\n        if sq in range(min_val, max_val + 1):\n            count += 1\n        if sq > max_val:\n            break\n    return count\n", "entry_point": "count_values_in_range", "input": "1, 0, 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140446_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017255", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1000110X'", "output": "['10001100', '10001101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017256", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "4, 5", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017257", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(5, 3, 2)", "output": "'5.3.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9781", "output": "{1, 9781}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017259", "code": "def fizz_buzz_transform(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "fizz_buzz_transform", "input": "[3, 5, 5, 5, 5]", "output": "['Fizz', 'Buzz', 'Buzz', 'Buzz', 'Buzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8969_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017260", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 72.5, 75]", "output": "72.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35243_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017261", "code": "from itertools import combinations\ndef find_minimum_value(sum_heights, to_sub, top):\n    minimum = -1\n    for r in range(len(to_sub) + 1):\n        for comb in combinations(to_sub, r):\n            value = sum(sum_heights) + sum(comb)\n            if value >= top and (minimum == -1 or minimum > value):\n                minimum = value\n    return minimum\n", "entry_point": "find_minimum_value", "input": "[50], [1, 2, 3, 4], 56", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131602_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017262", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[5, 6, 5, 3, 10]", "output": "5.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017263", "code": "def get_app_verbose_names(app_configs):\n    app_verbose_names = {}\n    for app_config in app_configs:\n        app_name = app_config.get('name')\n        verbose_name = app_config.get('verbose_name')\n        app_verbose_names[app_name] = verbose_name\n    return app_verbose_names\n", "entry_point": "get_app_verbose_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80626_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017264", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "15", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017265", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'oguitaristu'", "output": "{'oguitaristu': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40517_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017266", "code": "import json\ndef extract_title_from_json(input_json):\n    try:\n        title_value = input_json['title'][0]['value']\n        return title_value\n    except (KeyError, IndexError) as e:\n        return \"Title value not found in the JSON object.\"\n", "entry_point": "extract_title_from_json", "input": "{'name': 'example'}", "output": "'Title value not found in the JSON object.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017267", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'1.2.2'", "output": "'1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017268", "code": "from typing import List\ndef sum_multiples_of_3_or_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 12, 18]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93298_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017269", "code": "def count_unique_numeric_elements(input_list):\n    unique_numeric_elements = set()\n    for element in input_list:\n        if isinstance(element, (int, float)):\n            unique_numeric_elements.add(element)\n    return len(unique_numeric_elements)\n", "entry_point": "count_unique_numeric_elements", "input": "[1, 2, 3.0, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9037_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017270", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3664", "output": "'01:01:04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017271", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1418", "output": "{1, 1418, 2, 709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1417", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6676", "output": "{1, 2, 4, 1669, 3338, 6676}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6675", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017273", "code": "from collections import defaultdict, deque\ndef execute_tasks(workflow_graph):\n    indegree = defaultdict(int)\n    for tasks in workflow_graph.values():\n        for task in tasks:\n            indegree[task] += 1\n    queue = deque([task for task in workflow_graph if indegree[task] == 0])\n    order = []\n    while queue:\n        current_task = queue.popleft()\n        order.append(current_task)\n        for dependent_task in workflow_graph[current_task]:\n            indegree[dependent_task] -= 1\n            if indegree[dependent_task] == 0:\n                queue.append(dependent_task)\n    return order\n", "entry_point": "execute_tasks", "input": "{2: [], 3: []}", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108482_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017274", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1010", "output": "{1, 2, 5, 101, 202, 10, 1010, 505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1009", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017275", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1878", "output": "{1, 2, 3, 6, 939, 626, 1878, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017276", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2471", "output": "{1, 7, 353, 2471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017277", "code": "# Dictionary mapping ANSI escape codes to substrings\nansi_to_substring = {\n    '\\x1b[91;1m': '+m',\n    '\\x1b[92;1m': '+h',\n    '\\x1b[93;1m': '+k',\n    '\\x1b[94;1m': '+b',\n    '\\x1b[95;1m': '+u',\n    '\\x1b[96;1m': '+c',\n    '\\x1b[97;1m': '+p',\n    '\\x1b[98;1m': '+w',\n    '\\x1b[0m': '+0'\n}\ndef decode(text):\n    for ansi_code, substring in ansi_to_substring.items():\n        text = text.replace(ansi_code, substring)\n    return text\n", "entry_point": "decode", "input": "'WmWorl\\x1b[0m!!'", "output": "'WmWorl+0!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18500_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017278", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "633", "output": "633", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017279", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://exampl.jpg_150x150'", "output": "'https://exampl.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017280", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1089", "output": "{1089, 1, 3, 99, 33, 9, 363, 11, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017281", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1513", "output": "{89, 1, 1513, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1512", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017282", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[1, 2, 4, 8, 16]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017283", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1334", "output": "{1, 2, 46, 1334, 23, 58, 667, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017284", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hellhelloph'", "output": "{'hellhelloph': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8023", "output": "{1, 113, 71, 8023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017286", "code": "def fizz_buzz(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            output_list.append('FizzBuzz')\n        elif num % 3 == 0:\n            output_list.append('Fizz')\n        elif num % 5 == 0:\n            output_list.append('Buzz')\n        else:\n            output_list.append(num)\n    return output_list\n", "entry_point": "fizz_buzz", "input": "[2, 4, 3, 2, 2, 15, 5, 16]", "output": "[2, 4, 'Fizz', 2, 2, 'FizzBuzz', 'Buzz', 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117515_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017287", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'4.0.1.2'", "output": "(4, 0, 1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017288", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[1], [2]]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1111", "output": "{1, 11, 101, 1111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017290", "code": "def extract_characters(input_string, slice_obj):\n    start, stop, step = slice_obj.indices(len(input_string))\n    result = [input_string[i] for i in range(start, stop, step)]\n    return result\n", "entry_point": "extract_characters", "input": "'tSine', slice(0, 5, 1)", "output": "['t', 'S', 'i', 'n', 'e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83319_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017291", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "'xt*'", "output": "'xt*\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1917", "output": "{1, 3, 71, 9, 213, 27, 1917, 639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017293", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{4: [], 3: [4], 2: [3], 1: [2]}, 1", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8149", "output": "{1, 29, 8149, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017295", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[100, 100, 33]", "output": "233.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017296", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3353", "output": "{1, 479, 3353, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017297", "code": "def process_items(items):\n    health = 100  # Initial health value (assuming 100%)\n    processed_items = []\n    for item in items:\n        if item == \"stick\":\n            continue  # Skip adding \"stick\" to the processed list\n        elif item == \"health\":\n            health += 25  # Increase health by 25%\n        else:\n            processed_items.append(item)  # Add other items to the processed list\n    return processed_items, health\n", "entry_point": "process_items", "input": "['stick', 'health', 'health', 'coin']", "output": "(['coin'], 150)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134837_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017298", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        if not char.isspace():\n            char = char.lower()\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'is'", "output": "{'i': 1, 's': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36956_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017299", "code": "methods_allowed = ('GET',)\ndef check_method_allowed(http_method: str) -> bool:\n    return http_method in methods_allowed\n", "entry_point": "check_method_allowed", "input": "'GET'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103317_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017300", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2306", "output": "{1, 2306, 2, 1153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017301", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "'Hello, world!', ' world!'", "output": "'Hello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017302", "code": "from collections import defaultdict, deque\ndef find_task_order(dependencies):\n    graph = defaultdict(list)\n    indegree = defaultdict(int)\n    for dependency in dependencies:\n        parent, child = dependency\n        graph[parent].append(child)\n        indegree[child] += 1\n        indegree[parent]  # Ensure all tasks are included in indegree\n    tasks = set(graph.keys()).union(set(indegree.keys()))\n    queue = deque([task for task in tasks if indegree[task] == 0])\n    task_order = []\n    while queue:\n        current_task = queue.popleft()\n        task_order.append(current_task)\n        for dependent_task in graph[current_task]:\n            indegree[dependent_task] -= 1\n            if indegree[dependent_task] == 0:\n                queue.append(dependent_task)\n    return task_order if len(task_order) == len(tasks) else []\n", "entry_point": "find_task_order", "input": "[('C', 'A'), ('A', 'D'), ('D', 'B')]", "output": "['C', 'A', 'D', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8859_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017303", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1889", "output": "{1, 1889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017304", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0.00\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[79.88, 79.89, 79.9]", "output": "79.89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122959_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017305", "code": "def truncatechars(value, arg):\n    try:\n        length = int(arg)\n    except ValueError:\n        return value  # Return original value if arg is not a valid integer\n    if len(value) > length:\n        return value[:length] + '...'  # Truncate and append '...' if length exceeds arg\n    return value  # Return original value if length is not greater than arg\n", "entry_point": "truncatechars", "input": "'is', 2", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15483_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017306", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.config.'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017307", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2389", "output": "{1, 2389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3667", "output": "{19, 1, 3667, 193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017309", "code": "def count_unique_subsets(nums):\n    total_subsets = 0\n    n = len(nums)\n    for i in range(1, 2**n):\n        subset = [nums[j] for j in range(n) if (i >> j) & 1]\n        if subset:  # Ensure subset is not empty\n            total_subsets += 1\n    return total_subsets\n", "entry_point": "count_unique_subsets", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8]", "output": "511", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53823_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017310", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "473", "output": "{1, 11, 473, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017311", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "3, 5", "output": "243", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017312", "code": "def filter_vowels(strings):\n    vowels = ['a', 'e', 'i', 'o', 'u']\n    filtered_list = []\n    for string in strings:\n        if string[0].lower() in vowels:\n            filtered_list.append(string.lower())\n    return filtered_list\n", "entry_point": "filter_vowels", "input": "['banana', 'apple', 'orange', 'grape']", "output": "['apple', 'orange']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136900_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017313", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'hello world'", "output": "'world hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017314", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'1m'", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017315", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 7, 7]", "output": "(7, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017316", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[1, 1, 2, 3, 5, 6, 6]", "output": "[1, 1, 2, 3, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017317", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[0, 1, 2, 3]", "output": "[0, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017318", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[-2, 0, 0, 3, 1, 2, 2, 1, 1]", "output": "[-2, 0, 3, 4, 3, 4, 3, 2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017319", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3662", "output": "'01:01:02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017320", "code": "def calculate_grid_area(rows, columns, voxel_size):\n    # Calculate the side length of each cell\n    cell_side_length = voxel_size / 2\n    # Calculate the total number of cells in the grid\n    total_cells = rows * columns\n    # Calculate the area covered by a single cell\n    cell_area = cell_side_length ** 2\n    # Calculate the total area covered by the grid\n    total_area = total_cells * cell_area\n    return total_area\n", "entry_point": "calculate_grid_area", "input": "2, 2, 2.5", "output": "6.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70799_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017321", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "740.74", "output": "'R$:740,74'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017322", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7187", "output": "{1, 7187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7186", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017323", "code": "def filter_and_sort_keys(parameters):\n    completions = [key for key in parameters.keys() if \"iface\" not in key]\n    completions.sort(reverse=True)\n    return completions\n", "entry_point": "filter_and_sort_keys", "input": "{'ifaceA': 1, 'ifaceB': 2}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60399_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9271", "output": "{73, 1, 127, 9271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017325", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'thisIsCammelTTh'", "output": "'this_is_cammel_t_th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9731", "output": "{1, 9731, 37, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017327", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 88, 78, 75, 70]", "output": "[90, 88, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017328", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[6, 8, 10, 12, 3, 5, 9]", "output": "([6, 8, 10, 12], [3, 5, 9])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5386", "output": "{1, 5386, 2, 2693}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017330", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[1, 2, 3, 2, 5, 5, 4, 4]", "output": "[2, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3623", "output": "{1, 3623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017332", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "17, 31", "output": "[17, 19, 23, 29, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017333", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'r000001234r12324'", "output": "'000001234r12324'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2675", "output": "{1, 5, 107, 2675, 535, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2674", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2603", "output": "{19, 1, 137, 2603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017336", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else sorted_scores\n    return sum(top_scores) / len(top_scores) if top_scores else 0\n", "entry_point": "average_top_scores", "input": "[90, 85, 88, 88, 86], 5", "output": "87.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125675_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017337", "code": "def determine_memory_size(memory_addresses):\n    for address in memory_addresses:\n        if address >= 2**32:\n            return \"using 64 bits\"\n    return \"using 32 bits\"\n", "entry_point": "determine_memory_size", "input": "[4294967296]", "output": "'using 64 bits'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57219_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017338", "code": "def max_memory_usage(memory_usage, start_time, end_time):\n    if start_time < 0 or end_time >= len(memory_usage) or start_time > end_time:\n        return None  # Invalid time window\n    max_usage = float('-inf')  # Initialize to a very low value\n    for i in range(start_time, end_time + 1):\n        max_usage = max(max_usage, memory_usage[i])\n    return max_usage\n", "entry_point": "max_memory_usage", "input": "[30, 50, 60, 40, 20], 1, 2", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100213_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017339", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[4, 2, 4]", "output": "[2, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017340", "code": "from typing import List\nDIGIT_TO_CHAR = {\n    '0': ['0'],\n    '1': ['1'],\n    '2': ['a', 'b', 'c'],\n    '3': ['d', 'e', 'f'],\n    '4': ['g', 'h', 'i'],\n    '5': ['j', 'k', 'l'],\n    '6': ['m', 'n', 'o'],\n    '7': ['p', 'q', 'r', 's'],\n    '8': ['t', 'u', 'v'],\n    '9': ['w', 'x', 'y', 'z']\n}\nDEFAULT_NUMBER_OF_RESULTS = 7\nMAX_LENGTH_OF_NUMBER = 16\nMAX_COST = 150\ndef generate_combinations(input_number: str) -> List[str]:\n    results = []\n    def generate_combinations_recursive(current_combination: str, remaining_digits: str):\n        if not remaining_digits:\n            results.append(current_combination)\n            return\n        for char in DIGIT_TO_CHAR[remaining_digits[0]]:\n            new_combination = current_combination + char\n            new_remaining = remaining_digits[1:]\n            generate_combinations_recursive(new_combination, new_remaining)\n    generate_combinations_recursive('', input_number)\n    return results[:DEFAULT_NUMBER_OF_RESULTS]\n", "entry_point": "generate_combinations", "input": "'33'", "output": "['dd', 'de', 'df', 'ed', 'ee', 'ef', 'fd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133151_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017341", "code": "from typing import List, Optional\ndef update_page_title(playlists: Optional[List[str]]) -> str:\n    global page_title\n    if playlists is None or len(playlists) == 0:\n        page_title = \"No Playlists Found\"\n    else:\n        page_title = \"Playlists Found\"\n    return page_title\n", "entry_point": "update_page_title", "input": "None", "output": "'No Playlists Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85488_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017342", "code": "def extract_module_names(script):\n    module_names = set()\n    for line in script.split('\\n'):\n        if line.strip().startswith('import'):\n            modules = line.split('import')[1].strip().split(',')\n            for module in modules:\n                module_names.add(module.strip())\n        elif line.strip().startswith('from'):\n            module = line.split('from')[1].split('import')[0].strip()\n            module_names.add(module)\n    return list(module_names)\n", "entry_point": "extract_module_names", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66749_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017343", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[6, 0, 1, 6, 0, 1, 6, 0, 1, 2, 3, 4, 5]", "output": "[6, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017344", "code": "(_AT_BLOCKING, _AT_NONBLOCKING, _AT_SIGNAL) = range(3)\ndef get_constant_name(input_int):\n    constants = {_AT_BLOCKING: \"_AT_BLOCKING\", _AT_NONBLOCKING: \"_AT_NONBLOCKING\", _AT_SIGNAL: \"_AT_SIGNAL\"}\n    if input_int in constants:\n        return constants[input_int]\n    else:\n        return \"Out of range\"\n", "entry_point": "get_constant_name", "input": "1", "output": "'_AT_NONBLOCKING'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72958_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017345", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'testest_a', 10", "output": "'\\n  .width(testest_a);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017346", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'//www', 'images/logo.ing'", "output": "'//www/images/logo.ing'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017347", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[0, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017348", "code": "from typing import Optional\ndef time_spec_to_seconds(spec: str) -> Optional[int]:\n    time_units = {'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1}\n    components = []\n    current_component = ''\n    for char in spec:\n        if char.isnumeric():\n            current_component += char\n        elif char in time_units:\n            if current_component:\n                components.append((int(current_component), char))\n                current_component = ''\n        else:\n            current_component = ''  # Reset if delimiter other than time unit encountered\n    if current_component:\n        components.append((int(current_component), 's'))  # Assume seconds if no unit specified\n    total_seconds = 0\n    last_unit_index = -1\n    for value, unit in components:\n        unit_index = 'wdhms'.index(unit)\n        if unit_index < last_unit_index:\n            return None  # Out of order, return None\n        total_seconds += value * time_units[unit]\n        last_unit_index = unit_index\n    return total_seconds\n", "entry_point": "time_spec_to_seconds", "input": "'1s'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65809_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017349", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "488", "output": "{1, 2, 4, 488, 8, 244, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt487", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017350", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7361", "output": "{1, 433, 7361, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017351", "code": "def generate_unique_slug(base_string, existing_slugs):\n    counter = 1\n    slug = base_string\n    while slug in existing_slugs:\n        slug = f'{base_string}-{counter}'\n        counter += 1\n    return slug\n", "entry_point": "generate_unique_slug", "input": "'projet', []", "output": "'projet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44340_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017352", "code": "def calculate_7_day_avg(daily_cases):\n    moving_averages = []\n    for i in range(len(daily_cases)):\n        if i < 6:\n            moving_averages.append(0)  # Append 0 for days with insufficient data\n        else:\n            avg = sum(daily_cases[i-6:i+1]) / 7\n            moving_averages.append(avg)\n    return moving_averages\n", "entry_point": "calculate_7_day_avg", "input": "[0, 0, 0, 0, 0, 0, 1950]", "output": "[0, 0, 0, 0, 0, 0, 278.57142857142856]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43237_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017353", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "800.0, 1", "output": "799.9875", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017354", "code": "def reconstruct_string(char_counts):\n    char_map = {chr(ord('a') + i): count for i, count in enumerate(char_counts)}\n    sorted_char_map = dict(sorted(char_map.items(), key=lambda x: x[1]))\n    result = ''\n    for char, count in sorted_char_map.items():\n        result += char * count\n    return result\n", "entry_point": "reconstruct_string", "input": "[1, 0, 1, 1, 2, 0, 0, 2, 1] + [0] * 18", "output": "'acdieehh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66252_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017355", "code": "def calculate_submatrix_sum(ca, i, j):\n    n = len(ca)\n    m = len(ca[0])\n    prefix_sum = [[0 for _ in range(m)] for _ in range(n)]\n    for row in range(n):\n        for col in range(m):\n            prefix_sum[row][col] = ca[row][col]\n            if row > 0:\n                prefix_sum[row][col] += prefix_sum[row - 1][col]\n            if col > 0:\n                prefix_sum[row][col] += prefix_sum[row][col - 1]\n            if row > 0 and col > 0:\n                prefix_sum[row][col] -= prefix_sum[row - 1][col - 1]\n    submatrix_sum = prefix_sum[i][j]\n    return submatrix_sum\n", "entry_point": "calculate_submatrix_sum", "input": "[[1, 1], [1, 2]], 1, 1", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72883_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017356", "code": "def get_learning_rate(epoch, lr_schedule):\n    closest_epoch = max(filter(lambda x: x <= epoch, lr_schedule.keys()))\n    return lr_schedule[closest_epoch]\n", "entry_point": "get_learning_rate", "input": "5, {1: 0.01, 2: 0.005, 5: 0.0015, 10: 0.0001}", "output": "0.0015", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78080_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017357", "code": "import re\n# Dictionary mapping incorrect function names to correct function names\nfunction_mapping = {\n    'prit': 'print'\n}\ndef correct_function_names(code_snippet):\n    # Regular expression pattern to match function names\n    pattern = r'\\b(' + '|'.join(re.escape(key) for key in function_mapping.keys()) + r')\\b'\n    # Replace incorrect function names with correct function names\n    corrected_code = re.sub(pattern, lambda x: function_mapping[x.group()], code_snippet)\n    return corrected_code\n", "entry_point": "correct_function_names", "input": "'Pytho prit(elp)t'", "output": "'Pytho print(elp)t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116715_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017358", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, -3, 6, 2, 1, -3]", "output": "[-3, 3, 8, 3, -2, -3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017359", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "0, 9", "output": "b'\\t\\x00\\x00\\x00\\x00\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2372", "output": "{1, 1186, 2, 2372, 4, 593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2371", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017361", "code": "import math\ndef calculate_sampled_rows(sampling_rate):\n    total_rows = 120000000  # Total number of rows in the dataset (120M records)\n    sampled_rows = math.ceil(total_rows * sampling_rate)\n    # Ensure at least one row is sampled\n    if sampled_rows == 0:\n        sampled_rows = 1\n    return sampled_rows\n", "entry_point": "calculate_sampled_rows", "input": "1", "output": "120000000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18389_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017362", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3515", "output": "{1, 5, 37, 19, 185, 3515, 95, 703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017363", "code": "def days_exceeding_average(data, period_length):\n    result = []\n    avg_deaths = sum(data[:period_length]) / period_length\n    current_sum = sum(data[:period_length])\n    for i in range(period_length, len(data)):\n        if data[i] > avg_deaths:\n            result.append(i)\n        current_sum += data[i] - data[i - period_length]\n        avg_deaths = current_sum / period_length\n    return result\n", "entry_point": "days_exceeding_average", "input": "[3, 2, 4, 3, 5, 2, 7, 3, 6, 1], 5", "output": "[6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74675_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017364", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'eeeefg'", "output": "[('e', 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017365", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[[10, 5], [6, 10]]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017366", "code": "def most_common_numbers(data):\n    frequency = {}\n    # Count the frequency of each number\n    for num in data:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    most_common = [num for num, freq in frequency.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[1, 1, 5, 5]", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95940_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017367", "code": "import re\ndef parsing_text_to_label_set(text):\n    unique_labels = set()\n    labels_found = []\n    for word in text.split():\n        match = re.match(r'label(\\d+)', word)\n        if match:\n            label = match.group()\n            unique_labels.add(label)\n            labels_found.append(label)\n    labels_string = ' '.join(labels_found)\n    return unique_labels, labels_string\n", "entry_point": "parsing_text_to_label_set", "input": "'label2'", "output": "({'label2'}, 'label2')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103606_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7577", "output": "{1, 7577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017369", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'twitch'", "output": "'mixer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017370", "code": "def maximize_score(deck):\n    take = skip = 0\n    for card in deck:\n        new_take = skip + card\n        new_skip = max(take, skip)\n        take, skip = new_take, new_skip\n    return max(take, skip)\n", "entry_point": "maximize_score", "input": "[10, 1, 8, 1, 4]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91144_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017371", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{}, 6", "output": "'[0,0,0,0,0,0,0]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017372", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'wow'", "output": "{'w': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32626_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017373", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'bbbbbcccc'", "output": "'b5c4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017374", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'a', 'k'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017375", "code": "def calculate_sum_of_multiples(NUM):\n    total_sum = 0\n    for i in range(1, NUM):\n        if i % 3 == 0 or i % 5 == 0:\n            total_sum += i\n    return total_sum\n", "entry_point": "calculate_sum_of_multiples", "input": "20", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107367_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017376", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['Doge4', 'Doge6']", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017377", "code": "from typing import List\ndef max_sum_subarray(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sum_subarray", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101809_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017378", "code": "from typing import Tuple\ndef extract_version(version_str: str) -> Tuple[int, int, int]:\n    parts = version_str.split('.')\n    if len(parts) != 3:\n        return None\n    try:\n        major = int(parts[0])\n        minor = int(parts[1])\n        patch = int(parts[2])\n        return major, minor, patch\n    except ValueError:\n        return None\n", "entry_point": "extract_version", "input": "'3331.3.13'", "output": "(3331, 3, 13)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49339_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1162", "output": "{1, 2, 581, 166, 7, 1162, 14, 83}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1161", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017380", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'lohelloo'", "output": "{'lohelloo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017381", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2857", "output": "{1, 2857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017382", "code": "def sum_adjacent_elements(input_list):\n    output_list = []\n    if not input_list:\n        return output_list\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "sum_adjacent_elements", "input": "[1, 6, 4, 5, 3, 5, 3, 5]", "output": "[7, 10, 9, 8, 8, 8, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114935_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017383", "code": "import re\ndef process_twitter_text(text):\n    re_usernames = re.compile(\"@([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    re_hashtags = re.compile(\"#([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    replace_hashtags = \"<a href=\\\"http://twitter.com/search?q=%23\\\\1\\\">#\\\\1</a>\"\n    replace_usernames = \"<a href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a>\"\n    processed_text = re_usernames.sub(replace_usernames, text)\n    processed_text = re_hashtags.sub(replace_hashtags, processed_text)\n    return processed_text\n", "entry_point": "process_twitter_text", "input": "'outtwtwi'", "output": "'outtwtwi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76234_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3561", "output": "{1187, 1, 3, 3561}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017385", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[50, 49, 49, 30, 20], 3", "output": "49.333333333333336", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017386", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'C_C_NC_NN'", "output": "'No occurrences found for bond type C_C_NC_NN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017387", "code": "def max_score_with_constraint(scores, K):\n    n = len(scores)\n    dp = [-1] * (n + 1)\n    dp[0] = 0\n    for i in range(1, n + 1):\n        for j in range(i):\n            if dp[j] != -1 and abs(scores[i - 1] - scores[j]) > K:\n                dp[i] = max(dp[i], dp[j] + scores[i - 1])\n    return max(dp)\n", "entry_point": "max_score_with_constraint", "input": "[20, 30, 43], 15", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22565_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017388", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "37, 10", "output": "(3, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017389", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "1.444444444, 1", "output": "1.444444444", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017390", "code": "import re\ndef generate_product_url(product_name, existing_urls):\n    # Convert product name to lowercase and replace spaces with hyphens\n    url = product_name.lower().replace(' ', '-')\n    # Remove special characters using regular expression\n    url = re.sub(r'[^a-zA-Z0-9-]', '', url)\n    # Check if the URL is unique, if not, add a numerical suffix\n    suffix = 1\n    original_url = url\n    while url in existing_urls:\n        suffix += 1\n        url = f\"{original_url}-{suffix}\"\n    return url\n", "entry_point": "generate_product_url", "input": "'Blue T-Shirt', []", "output": "'blue-t-shirt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100510_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017391", "code": "def dailyTemperatures(temperatures):\n    stack = []\n    result = [0] * len(temperatures)\n    for i, temp in enumerate(temperatures):\n        while stack and temp > temperatures[stack[-1]]:\n            prev_index = stack.pop()\n            result[prev_index] = i - prev_index\n        stack.append(i)\n    return result\n", "entry_point": "dailyTemperatures", "input": "[30, 31]", "output": "[1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134803_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017392", "code": "def count_passed_students(scores):\n    pass_count = 0\n    for score in scores:\n        if score >= 50:\n            pass_count += 1\n    return pass_count\n", "entry_point": "count_passed_students", "input": "[50, 50, 50, 50, 50, 50, 50, 50, 50, 30, 40, 20]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140531_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017393", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8474", "output": "{1, 2, 38, 4237, 19, 8474, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017394", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "18, 18", "output": "0.018518518518518517", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017395", "code": "def clamp_numbers(numbers, lower_bound, upper_bound):\n    return [max(lower_bound, min(num, upper_bound)) for num in numbers]\n", "entry_point": "clamp_numbers", "input": "[4, 5, -1, 3, 0, 8, 3, -2, 10], -1, 3", "output": "[3, 3, -1, 3, 0, 3, 3, -1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51058_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017396", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 92, 88, 85, 80]", "output": "[95, 92, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1544", "output": "{1, 2, 386, 772, 4, 193, 1544, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1543", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017398", "code": "def calculate_crc(L):\n    poly32 = 0x1EDC6F41\n    rem = 0\n    for b in L:\n        rem = rem ^ (b << 24)\n        for _ in range(8):\n            if rem & 0x80000000:\n                rem = ((rem << 1) ^ poly32) & 0xFFFFFFFF\n            else:\n                rem = (rem << 1) & 0xFFFFFFFF\n    return rem\n", "entry_point": "calculate_crc", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97958_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017399", "code": "from typing import List, Tuple, Dict\ndef simulate_registry(operations: List[Tuple[str, str]]) -> Dict[str, bool]:\n    registry = {}\n    for operation, key in operations:\n        if operation == 'Create':\n            registry[key] = True\n        elif operation == 'Delete':\n            registry.pop(key, None)\n    return registry\n", "entry_point": "simulate_registry", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16848_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017400", "code": "def _add_encrypted_char(string, step, language):\n    eng_alphabet = [chr(i) for i in range(97, 123)] + [chr(i) for i in range(65, 91)]\n    rus_alphabet = [chr(i) for i in range(1072, 1104)] + [chr(i) for i in range(1040, 1072)]\n    alphabets = {'en': eng_alphabet, 'rus': rus_alphabet}\n    alphabet = alphabets.get(language)\n    alphabet_len = len(alphabet)\n    encoded_str = \"\"\n    for char in string:\n        if char.isupper():\n            required_index = (alphabet.index(char.lower()) + step) % (alphabet_len // 2) + (alphabet_len // 2)\n            encoded_str += alphabet[required_index].upper()\n        elif char.islower():\n            required_index = (alphabet.index(char) + step) % (alphabet_len // 2)\n            encoded_str += alphabet[required_index]\n        else:\n            encoded_str += char  # Keep non-alphabetic characters unchanged\n    return encoded_str\n", "entry_point": "_add_encrypted_char", "input": "'12345', 3, 'en'", "output": "'12345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99899_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017401", "code": "from typing import List\ndef unique_elements(lista: List[int]) -> List[int]:\n    seen = set()\n    result = []\n    for num in lista:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "unique_elements", "input": "[5, 5, 2, 1, 3, 4]", "output": "[5, 2, 1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139228_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017402", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "123, 5", "output": "'00123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017403", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "1000, 1.5012221088", "output": "1501.2221088", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2869", "output": "{1, 19, 2869, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017405", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '2.2.0', '2.3.0', '2.3.3', '2.3.4']", "output": "'2.3.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017406", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'Files\\\\Python\\\\script..pyC:\\\\m'", "output": "'Files\\\\Python\\\\script..pyC:\\\\m/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7954", "output": "{1, 2, 194, 97, 3977, 41, 7954, 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7953", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017408", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 1, 3, 1, 1, 3, 1, 3, 3]", "output": "[3, 4, 4, 2, 4, 4, 4, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017409", "code": "def simulate_ci_validation(environ, release_branch):\n    expected_env = {\n        'TRAVIS': 'True',\n        'TRAVIS_REPO_SLUG': 'repo',\n        'TRAVIS_BRANCH': release_branch,\n        'TRAVIS_COMMIT': None,\n        'TRAVIS_TAG': None,\n        'TRAVIS_PULL_REQUEST': 'false'\n    }\n    if all(key in environ and environ[key] == expected_env[key] for key in expected_env):\n        return 'Validation passed'\n    else:\n        return 'Validation failed'\n", "entry_point": "simulate_ci_validation", "input": "{'TRAVIS_REPO_SLUG': 'repo'}, 'main'", "output": "'Validation failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135222_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017410", "code": "import re\nimport argparse\ndef validate_aligner(aligner_str):\n    aligner_str = aligner_str.lower()\n    aligner_pattern = \"star|subread\"\n    if not re.match(aligner_pattern, aligner_str):\n        error = \"Aligner to be used (STAR|Subread)\"\n        raise argparse.ArgumentTypeError(error)\n    else:\n        return aligner_str\n", "entry_point": "validate_aligner", "input": "'starstrar'", "output": "'starstrar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52623_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017411", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017412", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "7, 14", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017413", "code": "def format_title_version(title: str, version: tuple) -> str:\n    version_str = \".\".join(map(str, version))\n    formatted_str = f'\"{title}\" version: {version_str}'\n    return formatted_str\n", "entry_point": "format_title_version", "input": "'Tessellation', (4, 0)", "output": "'\"Tessellation\" version: 4.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31803_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017414", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 6, 7, 6, 8, 6, 5]", "output": "[7, 7, 9, 9, 12, 11, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017415", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 6, 3, 3, 8, 8, 6]", "output": "[1, 7, 5, 6, 12, 13, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017416", "code": "from typing import List\ndef max_sub_array(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sub_array", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80022_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1015", "output": "{1, 35, 5, 7, 203, 145, 1015, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017418", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the '.' delimiter\n    version_components = version_string.split('.')\n    # Extract major, minor, and patch version numbers\n    major_version = int(version_components[0])\n    minor_version = int(version_components[1])\n    patch_version = int(version_components[2])\n    return major_version, minor_version, patch_version\n", "entry_point": "extract_version_numbers", "input": "'2.2.7'", "output": "(2, 2, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146914_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1007", "output": "{1, 19, 53, 1007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017420", "code": "def intersect(samples, counter=0):\n    if len(samples) == 1:\n        return samples[0]\n    a = samples[counter]\n    b = samples[counter+1:]\n    if len(b) == 1:\n        return a & b[0]\n    else:\n        counter += 1\n        return a & intersect(samples, counter)\n", "entry_point": "intersect", "input": "[{3, 4}, {1, 2, 3}, {3, 5, 6}]", "output": "{3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017421", "code": "def count_paths(grid):\n    def dfs(i, j):\n        if i < 0 or i >= len(grid) or j < 0 or j >= len(grid[0]):\n            return 0\n        if grid[i][j] == -1:\n            return 0\n        if i == len(grid) - 1 and j == len(grid[0]) - 1:\n            return 1\n        grid[i][j] = -1\n        paths = dfs(i + 1, j) + dfs(i, j + 1)\n        grid[i][j] = 0  # Reset the cell after exploration\n        return paths\n    return dfs(0, 0)\n", "entry_point": "count_paths", "input": "[[0, 0], [0, 0]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57044_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017422", "code": "def analyze_list(lst):\n    total = len(lst)\n    even_count = sum(1 for num in lst if num % 2 == 0)\n    total_sum = sum(lst)\n    return {'Total': total, 'Even': even_count, 'Sum': total_sum}\n", "entry_point": "analyze_list", "input": "[2, 2, 2, 2, 2, 2, 2, 9]", "output": "{'Total': 8, 'Even': 7, 'Sum': 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93656_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017423", "code": "def prefnum(InA=[], PfT=None, varargin=None):\n    # Non-zero value InA location indices:\n    IxZ = [i for i, val in enumerate(InA) if val > 0]\n    IsV = True\n    # Calculate sum of positive values, maximum value, and its index\n    sum_positive = sum(val for val in InA if val > 0)\n    max_value = max(InA)\n    max_index = InA.index(max_value)\n    return sum_positive, max_value, max_index\n", "entry_point": "prefnum", "input": "[0, 2, 5]", "output": "(7, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134376_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017424", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[-44], 1", "output": "-44.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017425", "code": "def compress_string(s1):\n    newStr = ''\n    char = ''\n    count = 0\n    for i in range(len(s1)):\n        if char != s1[i]:\n            if char != '':  # Add previous character and count to newStr\n                newStr += char + str(count)\n            char = s1[i]\n            count = 1\n        else:\n            count += 1\n    newStr += char + str(count)  # Add last character and count to newStr\n    if len(newStr) > len(s1):\n        return s1\n    return newStr\n", "entry_point": "compress_string", "input": "'abcde'", "output": "'abcde'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79600_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "358", "output": "{1, 2, 179, 358}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt357", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017427", "code": "import re\ndef process_twitter_text(text):\n    re_usernames = re.compile(\"@([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    re_hashtags = re.compile(\"#([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    replace_hashtags = \"<a href=\\\"http://twitter.com/search?q=%23\\\\1\\\">#\\\\1</a>\"\n    replace_usernames = \"<a href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a>\"\n    processed_text = re_usernames.sub(replace_usernames, text)\n    processed_text = re_hashtags.sub(replace_hashtags, processed_text)\n    return processed_text\n", "entry_point": "process_twitter_text", "input": "'Check'", "output": "'Check'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76234_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017428", "code": "def combination_sum(candidates, target):\n    result = []\n    def backtrack(current_combination, start_index, remaining_target):\n        if remaining_target == 0:\n            result.append(current_combination[:])\n            return\n        for i in range(start_index, len(candidates)):\n            if candidates[i] <= remaining_target:\n                current_combination.append(candidates[i])\n                backtrack(current_combination, i, remaining_target - candidates[i])\n                current_combination.pop()\n    backtrack([], 0, target)\n    return result\n", "entry_point": "combination_sum", "input": "[], 0", "output": "[[]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34241_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017429", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 7, 0, 1, 1, 8, 3, 1, 1]", "output": "[3, 8, 2, 4, 5, 13, 9, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017430", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 1, 1, 4, -1, -1, -1, 1, 4]", "output": "[1, 2, 12, -4, -5, -6, 7, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45837_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9401", "output": "{1, 7, 553, 79, 17, 119, 9401, 1343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017432", "code": "def count_events_with_keyword(events, keyword):\n    count = 0\n    for event in events:\n        if keyword.lower() in event[\"name\"].lower():\n            count += 1\n    return count\n", "entry_point": "count_events_with_keyword", "input": "[], 'example'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32695_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017433", "code": "def calculate_total_confirmed_cases(coronavirus_data):\n    total_confirmed = sum(country_data[\"confirmed\"] for country_data in coronavirus_data.values())\n    return total_confirmed\n", "entry_point": "calculate_total_confirmed_cases", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61121_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017434", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "14", "output": "377", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017435", "code": "def find_unique_inode(file_inodes):\n    unique_inode = 0\n    for inode in file_inodes:\n        unique_inode ^= inode\n    return unique_inode\n", "entry_point": "find_unique_inode", "input": "[1, 1, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61857_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017436", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[4, 2, 5, 0, -4, 1, 3, 3, 0]", "output": "[16, 4, 125, 0, 16, 1, 27, 27, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017437", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, -1, 5, 0]", "output": "[0, 0, 14, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017438", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 1, 5, -5, 5, 0, 5, -1]", "output": "[6, 6, 0, 0, 5, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017439", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[0, 4, 8, 16]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017440", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "6, 7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017441", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[5, 0, 0], [0, 5, 0], [0, 0, 5]]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128026_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017442", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "3, 4", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1562", "output": "{1, 2, 71, 11, 781, 142, 22, 1562}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017444", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'885, 92, 885, 2, 85, 8'", "output": "[885, 92, 885, 2, 85, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017445", "code": "from datetime import datetime\nTIME_FORMAT = \"%Y-%m-%d %H:%M:%S\"\ndef parse_log_message(log_message):\n    # Find the index of the first occurrence of ':'\n    colon_index = log_message.index(':')\n    # Extract timestamp, log level, and message based on the positions of '[' and ':'\n    timestamp = log_message[1:log_message.index(']')]\n    log_level = log_message[log_message.index(']')+2:colon_index]\n    message = log_message[colon_index+2:]\n    return timestamp, log_level, message\n", "entry_point": "parse_log_message", "input": "'[2022-01-1] : 0]ds'", "output": "('2022-01-1', '', '0]ds')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46891_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017446", "code": "def sum_absolute_differences(lst1, lst2):\n    total_diff = 0\n    for i in range(len(lst1)):\n        total_diff += abs(lst1[i] - lst2[i])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[1, 2], [3, 0]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24453_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017447", "code": "def circular_sum(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 1, 1, 1, 5, 5, 5]", "output": "[6, 2, 2, 6, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148378_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017448", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'C_NC_N'", "output": "'No occurrences found for bond type C_NC_N'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017449", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'07.05.2023'", "output": "'07.05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017450", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85.0, 87.0, 87.66666666666667]", "output": "86.55555555555556", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21931_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017451", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'BBBBB'", "output": "'tonga.cashregister.event.BBBBBCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017452", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[20, 20, 20, 16]", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017453", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "15", "output": "0.028", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017454", "code": "import string\ndef count_word_frequency(file_content):\n    word_freq = {}\n    text = file_content.lower()\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'text'", "output": "{'text': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3322_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017455", "code": "def maximize_profit(weights, profits, bag_capacity):\n    n = len(weights)\n    data = [(i, profits[i], weights[i]) for i in range(n)]\n    data.sort(key=lambda x: x[1] / x[2], reverse=True)\n    total_profit = 0\n    selected_items = []\n    remaining_capacity = bag_capacity\n    for i in range(n):\n        if data[i][2] <= remaining_capacity:\n            remaining_capacity -= data[i][2]\n            selected_items.append(data[i][0])\n            total_profit += data[i][1]\n        else:\n            break\n    return total_profit, selected_items\n", "entry_point": "maximize_profit", "input": "[10, 20, 30, 10, 20], [0, 0, 0, 40, 60], 30", "output": "(100, [3, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2609_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017456", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9926", "output": "{1, 2, 4963, 709, 9926, 7, 1418, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017457", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    i = 1\n    while i < len(nums):\n        if nums[i-1] == nums[i]:\n            nums.pop(i)\n            continue\n        i += 1\n    return len(nums)\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 3, 4, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119722_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017458", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8661", "output": "{1, 3, 8661, 2887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017459", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'programg'", "output": "'programg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017460", "code": "def fizzbuzz(num):\n    if num % 3 == 0 and num % 5 == 0:\n        return \"fizzbuzz\"\n    elif num % 3 == 0:\n        return \"fizz\"\n    elif num % 5 == 0:\n        return \"buzz\"\n    else:\n        return str(num)\n", "entry_point": "fizzbuzz", "input": "8", "output": "'8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127138_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017461", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'a.b.c.snsorArAtli'", "output": "'snsorArAtli'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017462", "code": "def relay_game(players):\n    num_relays = 4\n    current_relay = 0\n    active_player = 0\n    while current_relay < num_relays:\n        current_relay += 1\n        active_player = (active_player + 1) % len(players)\n    return players[active_player]\n", "entry_point": "relay_game", "input": "['Bob', 'Alice', 'Charlie']", "output": "'Alice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017463", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[78, 80, 81, 82, 80]", "output": "80.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017464", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "[10, 20, 30, 40]", "output": "[20.0, 30.0, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017465", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'project'", "output": "'project'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017466", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'aaaazzzzmm'", "output": "'zzzzmm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017467", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "'  worlld  '", "output": "'Worlld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "259", "output": "{1, 259, 37, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017469", "code": "def parse_command(command):\n    parts = command.split()\n    if len(parts) < 3:\n        return \"Invalid command\"\n    operation = parts[0]\n    num1 = float(parts[1])\n    num2 = float(parts[2])\n    if operation == 'add':\n        return num1 + num2\n    elif operation == 'subtract':\n        return num1 - num2\n    elif operation == 'multiply':\n        return num1 * num2\n    elif operation == 'divide':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Division by zero is not allowed\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "parse_command", "input": "'add 5 3'", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24855_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017470", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'e/123_4'", "output": "((123, 4), 'e')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017471", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5749", "output": "{1, 5749}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017472", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[2, 2, 3, 1, 4, 0, 0, 5, 5, 5]", "output": "[2, 3, 1, 4, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017473", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'thisIsCmThed'", "output": "'this_is_cm_thed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017474", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3601", "output": "{1, 277, 13, 3601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017475", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[3, 5, 9, 10]", "output": "[6, 10, 18, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017476", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2806", "output": "{1, 2, 46, 2806, 23, 122, 1403, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017477", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[0, 0, 23], [0, 0, 0]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017478", "code": "def upgrade_storage_pods(existing_config_map_data, new_entry_key, new_entry_value):\n    # Add a new entry to the existing configuration map data\n    existing_config_map_data[new_entry_key] = new_entry_value\n    return existing_config_map_data\n", "entry_point": "upgrade_storage_pods", "input": "{}, 'keykey33', 'va3'", "output": "{'keykey33': 'va3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129532_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4383", "output": "{1, 3, 487, 9, 1461, 4383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017480", "code": "def count_unique_characters(input_string: str) -> int:\n    unique_chars = set()\n    for char in input_string:\n        unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_characters", "input": "'abcde123456!'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82981_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6983", "output": "{1, 6983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017482", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'rs.some.middle.parts.Sersernig'", "output": "('rs', 'Sersernig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7730", "output": "{1, 2, 5, 773, 1546, 10, 7730, 3865}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7729", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7627", "output": "{1, 7627, 29, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7899", "output": "{3, 1, 7899, 2633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017486", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'sit', 3", "output": "'sit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017487", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'3.0.5'", "output": "(3, 0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017488", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7483", "output": "{1, 7483, 1069, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017489", "code": "from typing import List\ndef partition_generator(s: str) -> List[List[str]]:\n    def partition_helper(s: str, start: int, path: List[str], result: List[List[str]]):\n        if start == len(s):\n            result.append(path[:])\n            return\n        for i in range(start, len(s)):\n            if s[start:i+1] != \"\":\n                path.append(s[start:i+1])\n                partition_helper(s, i+1, path, result)\n                path.pop()\n    result = []\n    partition_helper(s, 0, [], result)\n    return result\n", "entry_point": "partition_generator", "input": "'aa'", "output": "[['a', 'a'], ['aa']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45306_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017490", "code": "def count_unique_fields(model_admins):\n    unique_fields_counts = []\n    for admin_config in model_admins:\n        list_display_fields = admin_config.get('list_display', ())\n        unique_fields_counts.append(len(set(list_display_fields)))\n    return unique_fields_counts\n", "entry_point": "count_unique_fields", "input": "[{}, {}, {}, {}, {}, {}]", "output": "[0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124194_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017491", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7330", "output": "{1, 7330, 2, 5, 10, 3665, 1466, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7329", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017492", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7655", "output": "{1, 1531, 5, 7655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7654", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017493", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-2, -6, -6, -8]", "output": "[-8, -6, -6, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6718", "output": "{1, 2, 6718, 3359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6717", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017495", "code": "def calculate_dot_product(list1, list2):\n    dot_product = 0\n    for i in range(len(list1)):\n        dot_product += list1[i] * list2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 2], [3, 3]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118702_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017496", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[80, 78, 76, 77, 75]", "output": "77.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017497", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'.2..', '.1.52.3.'", "output": "'.2.. to .1.52.3.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017498", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    max1, max2, max3 = float('-inf'), float('-inf'), float('-inf')\n    min1, min2 = float('inf'), float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[1, 3, 3]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145016_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017499", "code": "def count_files_in_directories(file_paths):\n    directory_counts = {}\n    for path in file_paths:\n        directories = path.split('/')\n        directory = directories[0]\n        if directory in directory_counts:\n            directory_counts[directory] += 1\n        else:\n            directory_counts[directory] = 1\n    return directory_counts\n", "entry_point": "count_files_in_directories", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109946_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017500", "code": "import sys\ndef package_installed(package_name):\n    if sys.version_info[0] == 2:\n        try:\n            import imp\n            imp.find_module(package_name)\n            return True\n        except ImportError:\n            return False\n    elif sys.version_info[0] == 3:\n        import importlib.util\n        spec = importlib.util.find_spec(package_name)\n        return spec is not None\n", "entry_point": "package_installed", "input": "'math'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146736_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017501", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "12", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7738", "output": "{1, 2, 73, 106, 146, 53, 7738, 3869}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017503", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'88'", "output": "{88}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017504", "code": "def calculate_total_kinetic_energy(masses, velocities):\n    total_kinetic_energy = sum(0.5 * mass * velocity**2 for mass, velocity in zip(masses, velocities))\n    return round(total_kinetic_energy, 2)\n", "entry_point": "calculate_total_kinetic_energy", "input": "[1, 1], [3, 2]", "output": "6.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128860_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017505", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[48], 1", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017506", "code": "import re\ndef simulate_command(env: dict, command: str) -> str:\n    def replace_env_var(match):\n        var_name = match.group(1)\n        return env.get(var_name, '')\n    # Regular expression pattern to match environment variables in the command string\n    env_var_pattern = r'\\$([A-Za-z_][A-Za-z0-9_]*)'\n    # Replace environment variables in the command string with their values\n    modified_command = re.sub(env_var_pattern, replace_env_var, command)\n    # Simulate command execution (for demonstration purposes, we just return the modified command)\n    return modified_command\n", "entry_point": "simulate_command", "input": "{'var1': 'ech', 'var2': 'PAT'}, '$var1$var2'", "output": "'echPAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29734_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017507", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5552", "output": "{1, 2, 4, 8, 1388, 5552, 16, 694, 2776, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5551", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017508", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "100, 1.97261676263597", "output": "-98.02738323736403", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017509", "code": "def calculate_score(accuracy):\n    if accuracy >= 0.92:\n        score = 10\n    elif accuracy >= 0.9:\n        score = 9\n    elif accuracy >= 0.85:\n        score = 8\n    elif accuracy >= 0.8:\n        score = 7\n    elif accuracy >= 0.75:\n        score = 6\n    elif accuracy >= 0.70:\n        score = 5\n    else:\n        score = 4\n    return score\n", "entry_point": "calculate_score", "input": "0.85", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22276_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017510", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'crypto'", "output": "\"Module 'crypto_ops' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017511", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[7, 8, 6]", "output": "[343, 512, 216]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017512", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1622", "output": "{1, 2, 811, 1622}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1621", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017513", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "512", "output": "{512, 1, 2, 256, 4, 128, 64, 32, 8, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt511", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017514", "code": "import math\ndef calculate_skewness(data):\n    n = len(data)\n    mean = sum(data) / n\n    variance = sum((x - mean) ** 2 for x in data) / n\n    std_dev = math.sqrt(variance)\n    skewness = (n / ((n - 1) * (n - 2))) * sum(((x - mean) / std_dev) ** 3 for x in data)\n    return skewness\n", "entry_point": "calculate_skewness", "input": "[-1, 0, 1]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66408_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017515", "code": "def encrypt_string(input_string, key):\n    if not key:\n        return input_string\n    encrypted_chars = []\n    key_length = len(key)\n    for i, char in enumerate(input_string):\n        key_char = key[i % key_length]\n        shift = ord(key_char)\n        encrypted_char = chr((ord(char) + shift) % 256)\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_string", "input": "'\u00d3\u00d0\u00ca\u00e5\u00d3\u00d0\u00d1', '\\x00'", "output": "'\u00d3\u00d0\u00ca\u00e5\u00d3\u00d0\u00d1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43650_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3335", "output": "{1, 5, 3335, 145, 115, 23, 667, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3334", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017517", "code": "import math\ndef pos_entropy(pos_tags):\n    pos_counts = {}\n    total_pos = len(pos_tags)\n    # Count the frequency of each POS tag\n    for pos in pos_tags:\n        pos_counts[pos] = pos_counts.get(pos, 0) + 1\n    # Calculate the probability of each POS tag and then the entropy\n    entropy = 0\n    for count in pos_counts.values():\n        probability = count / total_pos\n        entropy -= probability * math.log2(probability)\n    return entropy\n", "entry_point": "pos_entropy", "input": "['NOUN', 'VERB', 'ADJ']", "output": "1.584962500721156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114126_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017518", "code": "def compress_string(s1):\n    newStr = ''\n    char = ''\n    count = 0\n    for i in range(len(s1)):\n        if char != s1[i]:\n            if char != '':  # Add previous character and count to newStr\n                newStr += char + str(count)\n            char = s1[i]\n            count = 1\n        else:\n            count += 1\n    newStr += char + str(count)  # Add last character and count to newStr\n    if len(newStr) > len(s1):\n        return s1\n    return newStr\n", "entry_point": "compress_string", "input": "'aaabbcaa'", "output": "'a3b2c1a2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79600_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017519", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[10, 20, 11]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017520", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "8", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017521", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[20, 22, 22, 22, 24]", "output": "22.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134450_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3295", "output": "{1, 659, 5, 3295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017523", "code": "def process_colors(colors):\n    processed_colors = []\n    for color in colors:\n        if color is None:\n            processed_colors.append((0, 0, 0))\n        elif isinstance(color, str):\n            processed_colors.append(color.lower())\n        elif isinstance(color, tuple) and len(color) == 3:\n            processed_colors.append(tuple(value * 2 for value in color))\n    return processed_colors\n", "entry_point": "process_colors", "input": "['Red', None, (100, 150, 200)]", "output": "['red', (0, 0, 0), (200, 300, 400)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134444_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017524", "code": "def calculate_cube_volume(width, height, depth):\n    volume = width * height * depth\n    return volume\n", "entry_point": "calculate_cube_volume", "input": "100, 100, 2", "output": "20000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20357_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2689", "output": "{1, 2689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017526", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    return words[0] + ''.join(word.capitalize() for word in words[1:])\n", "entry_point": "snake_to_camel", "input": "'hello_wo_d'", "output": "'helloWoD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61108_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017527", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4330", "output": "{1, 2, 866, 5, 4330, 10, 433, 2165}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4329", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017528", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4906", "output": "{1, 2, 4906, 11, 2453, 22, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017529", "code": "from typing import Dict, List, Union\nSUPPORTED_STREAM_TYPES = ['video', 'audio']\ndef filter_supported_streams(streams: List[Dict[str, Union[str, int]]]) -> List[Dict[str, Union[str, int]]]:\n    filtered_streams = []\n    for stream in streams:\n        if stream.get('type') in SUPPORTED_STREAM_TYPES:\n            filtered_streams.append(stream)\n    return filtered_streams\n", "entry_point": "filter_supported_streams", "input": "[{'type': 'text'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103347_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017530", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1912", "output": "{1, 2, 4, 8, 239, 1912, 956, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1911", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017531", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "6", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017532", "code": "import math\ndef calculate_expression(x):\n    sqrt_x = math.sqrt(x)\n    log_x = math.log10(x)\n    result = sqrt_x + log_x\n    return result\n", "entry_point": "calculate_expression", "input": "4", "output": "2.6020599913279625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127737_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017533", "code": "from typing import List\ndef max_contiguous_sum(lst: List[int]) -> int:\n    max_sum = lst[0]\n    current_sum = lst[0]\n    for num in lst[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_contiguous_sum", "input": "[1, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132431_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017534", "code": "import re\ndef extract_host_name(query):\n    pattern = r'{host:(.*?)}'  # Regular expression pattern to match the host name\n    match = re.search(pattern, query)  # Search for the pattern in the query\n    if match:\n        host_name = match.group(1)  # Extract the host name from the matched pattern\n        return host_name\n    else:\n        return None  # Return None if no host name is found in the query\n", "entry_point": "extract_host_name", "input": "'Text before {host:willia} text after.'", "output": "'willia'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96307_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017535", "code": "def process_event_details(event):\n    resource_parts = []\n    data = {'Dimensions': []}\n    if 'pipeline' in event:\n        data['Dimensions'].append({\n            'Name': 'PipelineName',\n            'Value': event['pipeline']\n        })\n        resource_parts.append(event['pipeline'])\n    if 'stage' in event:\n        data['Dimensions'].append({\n            'Name': 'StageName',\n            'Value': event['stage']\n        })\n        resource_parts.append(event['stage'])\n    return data, resource_parts\n", "entry_point": "process_event_details", "input": "{}", "output": "({'Dimensions': []}, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7784_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5710", "output": "{1, 2, 5, 2855, 10, 5710, 1142, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5709", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017537", "code": "def divisible_count(x, y, k):\n    count_y = (k * (y // k + 1) - 1) // k\n    count_x = (k * ((x - 1) // k + 1) - 1) // k\n    return count_y - count_x\n", "entry_point": "divisible_count", "input": "4, 7, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144622_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017538", "code": "from typing import List\ndef most_frequent_bases(dna_sequence: str) -> List[str]:\n    base_count = {}\n    # Count the occurrences of each base\n    for base in dna_sequence:\n        if base in base_count:\n            base_count[base] += 1\n        else:\n            base_count[base] = 1\n    max_count = max(base_count.values())\n    most_frequent_bases = [base for base, count in base_count.items() if count == max_count]\n    return sorted(most_frequent_bases)\n", "entry_point": "most_frequent_bases", "input": "'AACCGGTT'", "output": "['A', 'C', 'G', 'T']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79013_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8837", "output": "{1, 8837}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017540", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5161", "output": "{1, 13, 397, 5161}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017542", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 4, 2]", "output": "[8, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017543", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[10, 8, 12, 8]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017544", "code": "# Dictionary mapping parameter names to values\nparameter_values = {\n    (0x80ED, 0x80E6): [1, 2, 4, 8, 12, 16],\n    # Add more parameter values as needed\n}\ndef get_color_table_parameters(target, pname):\n    if (target, pname) in parameter_values:\n        return parameter_values[(target, pname)]\n    else:\n        return []\n", "entry_point": "get_color_table_parameters", "input": "33005, 32998", "output": "[1, 2, 4, 8, 12, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11255_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9455", "output": "{1, 1891, 5, 9455, 305, 155, 61, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017546", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6957", "output": "{1, 3, 773, 9, 6957, 2319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017547", "code": "def sort_tuples(array):\n    return sorted(array, key=lambda x: x[1])\n", "entry_point": "sort_tuples", "input": "[(1, 10), (2, 20), (3, 30), (4, 40)]", "output": "[(1, 10), (2, 20), (3, 30), (4, 40)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36118_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017548", "code": "def apply_formatting(input_str):\n    style = ''\n    color = ''\n    # Extract style and color information from the input string\n    if '\\033[' in input_str:\n        start_idx = input_str.index('\\033[')\n        end_idx = input_str.index('m')\n        style_color = input_str[start_idx + 2:end_idx].split(';')\n        style = style_color[0]\n        color = style_color[1]\n    # Apply ANSI escape codes based on the extracted information\n    formatted_text = f'\\033[{style};{color}m{input_str[end_idx + 1:-4]}\\033[m'\n    return formatted_text\n", "entry_point": "apply_formatting", "input": "'\\x1b[1;31mHello, World\\x1b[0m'", "output": "'\\x1b[1;31mHello, World\\x1b[m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1962_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017549", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2486", "output": "{1, 2, 226, 11, 113, 2486, 22, 1243}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2485", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017550", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5072", "output": "{1, 2, 4, 2536, 8, 5072, 16, 1268, 634, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5071", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017551", "code": "def blueprint(rows):\n    blueprint_pattern = []\n    for i in range(1, rows + 1):\n        row = []\n        if i % 2 != 0:  # Odd row\n            for j in range(1, i + 1):\n                row.append(j)\n        else:  # Even row\n            for j in range(ord('A'), ord('A') + i):\n                row.append(chr(j))\n        blueprint_pattern.append(row)\n    return blueprint_pattern\n", "entry_point": "blueprint", "input": "3", "output": "[[1], ['A', 'B'], [1, 2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141993_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017552", "code": "def calculate_average_score(scores: list) -> float:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 90, 90, 90, 90, 89, 89]", "output": "89.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100039_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7277", "output": "{1, 19, 7277, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017554", "code": "def trap(heights):\n    if not heights:\n        return 0\n    left, right = 0, len(heights) - 1\n    left_max, right_max = 0, 0\n    trapped_water = 0\n    while left < right:\n        if heights[left] < heights[right]:\n            if heights[left] >= left_max:\n                left_max = heights[left]\n            else:\n                trapped_water += left_max - heights[left]\n            left += 1\n        else:\n            if heights[right] >= right_max:\n                right_max = heights[right]\n            else:\n                trapped_water += right_max - heights[right]\n            right -= 1\n    return trapped_water\n", "entry_point": "trap", "input": "[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54741_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017555", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'340.7.0'", "output": "(340, 7, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017556", "code": "def encrypt(text: str, shift: int) -> str:\n    result = ''\n    for char in text:\n        if char.islower():\n            new_pos = ord('a') + (ord(char) - ord('a') + shift) % 26\n            result += chr(new_pos)\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt", "input": "'qq', 0", "output": "'qq'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63260_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5794", "output": "{2897, 1, 5794, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5793", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017558", "code": "def count_qualifying_digits(data):\n    ans = 0\n    for line in data:\n        _, output = line.split(\" | \")\n        for digit in output.split():\n            if len(digit) in (2, 3, 4, 7):\n                ans += 1\n    return ans\n", "entry_point": "count_qualifying_digits", "input": "['123 | a', '456 | abcde', '789 | abcdef']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121913_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017559", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[4, 2, 0, 3]", "output": "{4: 16, 2: 4, 0: 0, 3: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017560", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 2, 3, 4, 5], 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13435_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017561", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[5, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017562", "code": "from typing import List\ndef countConstruct(target: str, wordBank: List[str]) -> int:\n    ways = [0] * (len(target) + 1)\n    ways[0] = 1\n    for i in range(len(target)):\n        if ways[i] > 0:\n            for word in wordBank:\n                if target[i:i+len(word)] == word:\n                    ways[i+len(word)] += ways[i]\n    return ways[len(target)]\n", "entry_point": "countConstruct", "input": "'purple', ['pur', 'p', 'le', 'ur']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94402_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "509", "output": "{1, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017564", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "2, 332", "output": "83.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017565", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4823", "output": "{1, 7, 13, 689, 371, 53, 4823, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017566", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'10.20.30-40'", "output": "(10, 20, 30, 40)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017567", "code": "from typing import List\ndef min_time_to_complete(tasks: List[int], cooldown: int) -> int:\n    cooldowns = {}\n    time = 0\n    for task in tasks:\n        if task in cooldowns and cooldowns[task] > time:\n            time = cooldowns[task]\n        time += 1\n        cooldowns[task] = time + cooldown\n    return time\n", "entry_point": "min_time_to_complete", "input": "[1, 2, 1, 2], 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017568", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'hello'", "output": "'olleh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017569", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[8, 9, 10]", "output": "720", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017570", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, -2, -1, 3, 4, -2, 4, 2, 4]", "output": "[1, -1, 1, 6, 8, 3, 10, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017571", "code": "def process_data(filter_logs, sequential_data):\n    # Process filter logs\n    filtered_logs = [line for line in filter_logs.split('\\n') if 'ERROR' not in line]\n    # Check for sequence in sequential data\n    sequence_exists = False\n    sequential_lines = sequential_data.split('\\n')\n    for i in range(len(sequential_lines) - 2):\n        if sequential_lines[i] == 'a start point' and sequential_lines[i + 1] == 'leads to' and sequential_lines[i + 2] == 'an ending':\n            sequence_exists = True\n            break\n    return (filtered_logs, sequence_exists)\n", "entry_point": "process_data", "input": "'NINFOblah', ''", "output": "(['NINFOblah'], False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27152_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017572", "code": "from typing import List, Dict\ndef validate_logs(logs: List[Dict[str, str]]) -> bool:\n    critical_log_found = False\n    for log in logs:\n        if log[\"levelname\"] == \"CRITICAL\":\n            if log[\"message\"] == \"'all' cannot be used with --show-profiles, please specify a single browser\":\n                return True\n            critical_log_found = True\n    return critical_log_found\n", "entry_point": "validate_logs", "input": "[]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35176_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017573", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[54, 54, 54, 50, 75, 100]", "output": "54.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017574", "code": "def count_message_types(messages):\n    message_counts = {}\n    for message in messages:\n        message_type = message.get('type')\n        if message_type:\n            message_counts[message_type] = message_counts.get(message_type, 0) + 1\n    return message_counts\n", "entry_point": "count_message_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114654_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017575", "code": "def sum_even_fibs(n):\n    if n <= 0:\n        return 0\n    a, b = 0, 1\n    total_sum = 0\n    while b <= n:\n        if b % 2 == 0:\n            total_sum += b\n        a, b = b, a + b\n    return total_sum\n", "entry_point": "sum_even_fibs", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8123_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017576", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'J'", "output": "'j'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017577", "code": "def max_non_overlapping_sticks(sticks, target):\n    sticks.sort()  # Sort the sticks in ascending order\n    selected_sticks = 0\n    total_length = 0\n    for stick in sticks:\n        if total_length + stick <= target:\n            selected_sticks += 1\n            total_length += stick\n    return selected_sticks\n", "entry_point": "max_non_overlapping_sticks", "input": "[1, 2, 3, 5, 8], 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122772_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017578", "code": "import json\ndef generate_response(postreqdata):\n    name = postreqdata.get('name', 'Unknown')\n    return \"hello world from \" + name\n", "entry_point": "generate_response", "input": "{}", "output": "'hello world from Unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142502_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017579", "code": "def calculate_median(data):\n    sorted_data = sorted(data)\n    n = len(sorted_data)\n    if n % 2 == 1:\n        return sorted_data[n // 2]\n    else:\n        mid1 = sorted_data[n // 2 - 1]\n        mid2 = sorted_data[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "calculate_median", "input": "[5, 6, 7, 8]", "output": "6.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16083_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017580", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3832", "output": "{1, 2, 4, 8, 3832, 1916, 958, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3831", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017581", "code": "def max_product(nums):\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[6, 7]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110237_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017582", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Hello, world!'", "output": "['hello', 'world']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017583", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[5, 7, 9]", "output": "(9, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017584", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[3, 5, 4, 3, 6, 3, 7, 8, 10]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017585", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 2, 3, 4, 5, 6]", "output": "[2, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017586", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4462", "output": "{1, 2, 194, 97, 4462, 46, 23, 2231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4461", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017587", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[17, 0, 0, 4, 19, 14, 18, 19]", "output": "[17, 34, 102, 4, 19, 14, 18, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017588", "code": "def filter_people_by_age(people, age_threshold):\n    result = []\n    for person in people:\n        if person.get(\"age\", 0) > age_threshold:\n            result.append(person.get(\"name\", \"\"))\n    return result\n", "entry_point": "filter_people_by_age", "input": "[{'name': 'Alice', 'age': 0}, {'name': 'Bob', 'age': 0}], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60150_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017589", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'Alice', ''", "output": "'alguest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017590", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[3, 12, 12, 5]", "output": "[3, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2569", "output": "{1, 367, 2569, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017592", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average\n", "entry_point": "calculate_average", "input": "[70, 75, 76, 80]", "output": "75.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143755_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017593", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'r l d r l d'", "output": "['r', 'l', 'd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017594", "code": "def count_values_in_range(n, min_val, max_val):\n    count = 0\n    i = 0\n    while True:\n        i, sq = i + 1, i ** n\n        if sq in range(min_val, max_val + 1):\n            count += 1\n        if sq > max_val:\n            break\n    return count\n", "entry_point": "count_values_in_range", "input": "2, 0, 81", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140446_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017595", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'Lorem', 5", "output": "['Lorem']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017596", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1] * 80, 100", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017597", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 5, 22]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27175_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017598", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "[], 2", "output": "'{v0, v1}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6878", "output": "{1, 2, 38, 362, 3439, 19, 181, 6878}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017600", "code": "def reconstruct_string(char_counts):\n    char_map = {chr(ord('a') + i): count for i, count in enumerate(char_counts)}\n    sorted_char_map = dict(sorted(char_map.items(), key=lambda x: x[1]))\n    result = ''\n    for char, count in sorted_char_map.items():\n        result += char * count\n    return result\n", "entry_point": "reconstruct_string", "input": "[2, 3, 1, 1]", "output": "'cdaabbb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66252_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "178", "output": "{89, 1, 178, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017602", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[4, 0, 5]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9009_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017603", "code": "def longest_consecutive_sequence_length(nums):\n    if not nums:\n        return 0\n    longest_length = 1\n    current_length = 1\n    for i in range(1, len(nums)):\n        if nums[i] > nums[i - 1]:\n            current_length += 1\n            longest_length = max(longest_length, current_length)\n        else:\n            current_length = 1\n    return longest_length\n", "entry_point": "longest_consecutive_sequence_length", "input": "[1, 2, 3, 4, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119725_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017604", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9367", "output": "{1, 323, 551, 493, 17, 19, 9367, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017606", "code": "def process_binary_patterns(bpatterns, mapping, output_value):\n    def found(num, bp):\n        print(f\"Found {num} for pattern {bp}\")\n    for bp in bpatterns:\n        if mapping[6] & bp >= bp:\n            found(5, bp)\n            break\n    for bp in bpatterns:\n        if mapping[9] & bp >= bp:\n            found(3, bp)\n            break\n    if len(bpatterns) == 1:\n        found(2, bpatterns[0])\n    return output_value.split()\n", "entry_point": "process_binary_patterns", "input": "[60], [0, 0, 0, 0, 0, 0, 60, 0, 0, 63], '3'", "output": "['3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8987_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017607", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'09:15:30 AM'", "output": "'09:15:30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017608", "code": "def sum_multiples_3_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 12, 30]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41452_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017609", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[36]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017610", "code": "def generate_indices(s):\n    modes = []\n    for i, c in enumerate(s):\n        modes += [i] * int(c)\n    return sorted(modes)\n", "entry_point": "generate_indices", "input": "'2231'", "output": "[0, 0, 1, 1, 2, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130187_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017611", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[67, 68, 69, 70, 71]", "output": "69.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92389_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017612", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6871", "output": "{1, 6871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017613", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'exexe'", "output": "'exexe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017614", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(0, 15, 0)", "output": "'0.15.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017615", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "4", "output": "'./prespawned/version4_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017616", "code": "from typing import List\ndef best_sum(target_sum: int, numbers: List[int]) -> List[int]:\n    table = [None] * (target_sum + 1)\n    table[0] = []\n    for i in range(target_sum + 1):\n        if table[i] is not None:\n            for num in numbers:\n                if i + num <= target_sum:\n                    if table[i + num] is None or len(table[i] + [num]) < len(table[i + num]):\n                        table[i + num] = table[i] + [num]\n    return table[target_sum]\n", "entry_point": "best_sum", "input": "8, [3, 5]", "output": "[3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127929_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017617", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3719", "output": "{1, 3719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017618", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[6, 6, 3, 2, 3, 10, 2, 4, 6]", "output": "[12, 9, 5, 5, 13, 12, 6, 10, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017619", "code": "from typing import Tuple\ndef final_position(directions: str, grid_size: int) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    x = max(-grid_size, min(grid_size, x))\n    y = max(-grid_size, min(grid_size, y))\n    return (x, y)\n", "entry_point": "final_position", "input": "'DD', 3", "output": "(0, -2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81995_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017620", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -30.0, -2.800000000000004", "output": "-32.800000000000004", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3509", "output": "{1, 11, 3509, 121, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017622", "code": "def fahrenheit_to_celsius(fahrenheit):\n    celsius = (5 * (fahrenheit - 32) / 9)\n    return celsius\n", "entry_point": "fahrenheit_to_celsius", "input": "98.6", "output": "37.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19191_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017623", "code": "import os\ndef serve_static_file(path):\n    routes = {\n        'bower_components': 'bower_components',\n        'modules': 'modules',\n        'styles': 'styles',\n        'scripts': 'scripts',\n        'fonts': 'fonts'\n    }\n    if path == 'robots.txt':\n        return 'robots.txt'\n    elif path == '404.html':\n        return '404.html'\n    elif path.startswith('fonts/'):\n        return os.path.join('fonts', path.split('/', 1)[1])\n    else:\n        for route, directory in routes.items():\n            if path.startswith(route + '/'):\n                return os.path.join(directory, path.split('/', 1)[1])\n    return '404.html'\n", "entry_point": "serve_static_file", "input": "'fonts/fsofe.ttf'", "output": "'fonts/fsofe.ttf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103383_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017624", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[1, 14, 10, 5, 20]", "output": "[15, 24, 15, 25, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9221", "output": "{1, 9221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1646", "output": "{1, 2, 1646, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017627", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[14, 14, 12], 13", "output": "[14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017628", "code": "def process_configuration(config_dict: dict, current_attributes: dict) -> dict:\n    updated_attributes = current_attributes.copy()\n    for key, value in config_dict.items():\n        if key in current_attributes:\n            updated_attributes[key] = value\n    return updated_attributes\n", "entry_point": "process_configuration", "input": "{'key1': 'value1'}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61800_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017629", "code": "import unicodedata\ndef count_unique_chars(input_string):\n    normalized_string = ''.join(c for c in unicodedata.normalize('NFD', input_string.lower()) if unicodedata.category(c) != 'Mn' and c.isalnum())\n    char_count = {}\n    for char in normalized_string:\n        char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'ccccc aaaaa fffff e 11 3'", "output": "{'c': 5, 'a': 5, 'f': 5, 'e': 1, '1': 2, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74363_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017630", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1019", "output": "b'\\x00\\x00\\x03\\xfb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017631", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'123456+XYZ56Z'", "output": "('123456', 'XYZ56Z', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017632", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[70, 75, 90, 60, 80, 95, 90, 55, 85], 6", "output": "[5, 2, 6, 8, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017633", "code": "from itertools import product\ndef calculate_cartesian_product_sum(list1, list2):\n    # Generate all pairs of elements from list1 and list2\n    pairs = product(list1, list2)\n    # Calculate the sum of the products of all pairs\n    sum_of_products = sum(a * b for a, b in pairs)\n    return sum_of_products\n", "entry_point": "calculate_cartesian_product_sum", "input": "[1, 2], [3, 4]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129453_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017634", "code": "def count_pairs_divisible_by_3(nums):\n    nums.sort()\n    l_count = 0\n    m_count = 0\n    result = 0\n    for num in nums:\n        if num % 3 == 1:\n            l_count += 1\n        elif num % 3 == 2:\n            m_count += 1\n    result += l_count * m_count  # Pairs where one element leaves remainder 1 and the other leaves remainder 2\n    result += (l_count * (l_count - 1)) // 2  # Pairs where both elements leave remainder 1\n    result += (m_count * (m_count - 1)) // 2  # Pairs where both elements leave remainder 2\n    return result\n", "entry_point": "count_pairs_divisible_by_3", "input": "[1, 4, 7, 2, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47070_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "979", "output": "{11, 1, 979, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017636", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'file2.'", "output": "{'': ['file2.']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1495", "output": "{1, 65, 5, 299, 13, 115, 23, 1495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017638", "code": "from typing import List\ndef sum_of_max_values(strings: List[str]) -> int:\n    total_sum = 0\n    for string in strings:\n        integers = [int(num) for num in string.split(',')]\n        max_value = max(integers)\n        total_sum += max_value\n    return total_sum\n", "entry_point": "sum_of_max_values", "input": "['60', '60', '60']", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86134_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017639", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[2, 10, 4, 8]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017640", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'start34middle12end567stop'", "output": "{34, 12, 567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017641", "code": "import math\nMAX_BRIGHT = 2.0\ndef rgb1(v):\n    r = 1 + math.cos(v * math.pi)\n    g = 0\n    b = 1 + math.sin(v * math.pi)\n    # Scale the RGB components based on the maximum brightness\n    r_scaled = int(MAX_BRIGHT * r)\n    g_scaled = int(MAX_BRIGHT * g)\n    b_scaled = int(MAX_BRIGHT * b)\n    return (r_scaled, g_scaled, b_scaled)\n", "entry_point": "rgb1", "input": "1", "output": "(0, 0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70015_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017642", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[-1, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017643", "code": "def radix_sort(array):\n    base = 10  # Base 10 for decimal integers\n    max_val = max(array)\n    col = 0\n    while max_val // 10 ** col > 0:\n        count_array = [0] * base\n        position = [0] * base\n        output = [0] * len(array)\n        for elem in array:\n            digit = elem // 10 ** col\n            count_array[digit % base] += 1\n        position[0] = 0\n        for i in range(1, base):\n            position[i] = position[i - 1] + count_array[i - 1]\n        for elem in array:\n            output[position[elem // 10 ** col % base]] = elem\n            position[elem // 10 ** col % base] += 1\n        array = output\n        col += 1\n    return output\n", "entry_point": "radix_sort", "input": "[2, 2, 801, 801, 801, 802]", "output": "[2, 2, 801, 801, 801, 802]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60721_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017644", "code": "def get_repo_name_from_url(url: str) -> str:\n    if not url:\n        return None\n    last_slash_index = url.rfind(\"/\")\n    last_suffix_index = url.rfind(\".git\")\n    if last_suffix_index < 0:\n        last_suffix_index = len(url)\n    if last_slash_index < 0 or last_suffix_index <= last_slash_index:\n        raise Exception(\"Invalid repo url {}\".format(url))\n    return url[last_slash_index + 1:last_suffix_index]\n", "entry_point": "get_repo_name_from_url", "input": "'https://example.com/path/to/pttps.git'", "output": "'pttps'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4595_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017645", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6938", "output": "{1, 6938, 2, 3469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017646", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[80, 83, 70, 75], 2", "output": "81.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017647", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[1, 5, 7, 3, 6]", "output": "[1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017648", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[1, 2, 2, 1, 4, 4, 4, 2]", "output": "[1, 2, 2, 1, 4, 4, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017649", "code": "import math\ndef calculate_nequat_nvert(n: int) -> tuple:\n    nequat = int(math.sqrt(math.pi * n))\n    nvert = nequat // 2\n    return nequat, nvert\n", "entry_point": "calculate_nequat_nvert", "input": "16", "output": "(7, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142533_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017650", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>abstract.</p>'", "output": "'abstract.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017651", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "(9, 0, -1, 9, 0, -1)", "output": "'9.0.-1.9.0.-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2763", "output": "{1, 3, 9, 2763, 307, 921}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8199", "output": "{1, 3, 8199, 9, 2733, 911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017654", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5319", "output": "{1, 3, 197, 5319, 9, 1773, 591, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017655", "code": "import sys\nimport xml.etree.ElementTree as ET\nimport json\nPY2 = sys.version_info[0] == 2\nPY3 = sys.version_info[0] == 3\nif PY2:\n    from StringIO import StringIO\n    from urllib2 import urlopen\n    from urllib2 import HTTPError\nelif PY3:\n    from io import StringIO\n    from urllib.request import urlopen\n    from urllib.error import HTTPError\ndef convert_data(url, output_format):\n    try:\n        response = urlopen(url)\n        data = response.read().decode('utf-8')\n        if output_format == 'xml':\n            root = ET.fromstring(data)\n            return ET.tostring(root, encoding='utf-8').decode('utf-8')\n        elif output_format == 'json':\n            return json.dumps(json.loads(data), indent=4)\n        else:\n            return \"Invalid output format. Please choose 'xml' or 'json'.\"\n    except HTTPError as e:\n        return f\"HTTP Error: {e.code}\"\n    except Exception as e:\n        return f\"An error occurred: {str(e)}\"\n", "entry_point": "convert_data", "input": "'http://example.com:ta', 'json'", "output": "\"An error occurred: nonnumeric port: 'ta'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108391_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017656", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[5, 2, 1, 4]", "output": "[5, 3, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4265", "output": "{1, 4265, 853, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017658", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'PPaarserare', 'hhphpphp'", "output": "'PPaarserare.hhphpphp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017659", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[5, 2, 2, 6, 3, 3, 0]", "output": "{5: 1, 2: 2, 6: 1, 3: 2, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9233", "output": "{1, 1319, 9233, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017661", "code": "# Define the positions and their corresponding bitmask values\npositions = {\n    'catcher': 1,\n    'first_base': 2,\n    'second_base': 4,\n    'third_base': 8,\n    'short_stop': 16,\n    'outfield': 32,\n    'left_field': 64,\n    'center_field': 128,\n    'right_field': 256,\n    'designated_hitter': 512,\n    'pitcher': 1024,\n    'starting_pitcher': 2048,\n    'relief_pitcher': 4096\n}\ndef get_eligible_positions(player_mask):\n    eligible_positions = []\n    for position, mask in positions.items():\n        if player_mask & mask:\n            eligible_positions.append(position)\n    return eligible_positions\n", "entry_point": "get_eligible_positions", "input": "26", "output": "['first_base', 'third_base', 'short_stop']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51303_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017662", "code": "def compress_string(input_string):\n    if not input_string:\n        return \"\"\n    compressed_string = \"\"\n    current_char = input_string[0]\n    char_count = 1\n    for i in range(1, len(input_string)):\n        if input_string[i] == current_char:\n            char_count += 1\n        else:\n            compressed_string += current_char + str(char_count)\n            current_char = input_string[i]\n            char_count = 1\n    compressed_string += current_char + str(char_count)\n    return compressed_string\n", "entry_point": "compress_string", "input": "'ccc'", "output": "'c3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107828_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9178", "output": "{1, 2, 706, 26, 353, 13, 4589, 9178}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017664", "code": "def score_answers(nq_gold_dict, nq_pred_dict):\n    long_answer_stats = {}\n    short_answer_stats = {}\n    for question_id, gold_answers in nq_gold_dict.items():\n        pred_answers = nq_pred_dict.get(question_id, [])\n        # Scoring mechanism for long answers (example scoring logic)\n        long_score = 0\n        for gold_answer in gold_answers:\n            if gold_answer in pred_answers:\n                long_score += 1\n        # Scoring mechanism for short answers (example scoring logic)\n        short_score = min(len(gold_answers), len(pred_answers))\n        long_answer_stats[question_id] = long_score\n        short_answer_stats[question_id] = short_score\n    return long_answer_stats, short_answer_stats\n", "entry_point": "score_answers", "input": "{3: ['gold_answer1'], 5: []}, {3: [], 5: []}", "output": "({3: 0, 5: 0}, {3: 0, 5: 0})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78415_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017665", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4069", "output": "{1, 13, 4069, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017666", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        patch = 0\n        minor += 1\n        if minor > 9:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'12.8.3'", "output": "'12.8.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58418_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017667", "code": "def transform_list(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(sum([x for j, x in enumerate(lst) if j != i]))\n    return result\n", "entry_point": "transform_list", "input": "[1, 2, 3, 4]", "output": "[9, 8, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88599_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017668", "code": "def count_unique_classes(dataset):\n    unique_classes = set()\n    for data_sample in dataset:\n        for class_label in data_sample:\n            unique_classes.add(class_label)\n    return len(unique_classes)\n", "entry_point": "count_unique_classes", "input": "[[1, 1, 2], [2, 3], [3, 4], [4, 4]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137982_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017669", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017670", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'worldhwolo'", "output": "{'worldhwolo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017671", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'key3', default='default_valud'", "output": "'default_valud'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017672", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are 0 or 1 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70.0, 79.0, 79.2, 79.4, 90.0]", "output": "79.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12123_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017673", "code": "from typing import Tuple\ndef final_position(moves: str, n: int) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position of the player\n    for move in moves:\n        if move == 'U' and y < n - 1:\n            y += 1\n        elif move == 'D' and y > 0:\n            y -= 1\n        elif move == 'L' and x > 0:\n            x -= 1\n        elif move == 'R' and x < n - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'UU', 3", "output": "(0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110789_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017674", "code": "from typing import List\ndef latest_version(versions: List[str]) -> str:\n    latest_version = versions[0]\n    for version in versions[1:]:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['1.8.0', '1.9.0', '1.9.1', '1.9.2']", "output": "'1.9.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138257_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017675", "code": "JOB_STATES = {\n    'Q': 'QUEUED',\n    'H': 'HELD',\n    'R': 'RUNNING',\n    'E': 'EXITING',\n    'T': 'MOVED',\n    'W': 'WAITING',\n    'S': 'SUSPENDED',\n    'C': 'COMPLETED',\n}\ndef map_job_states(job_state_codes):\n    job_state_mapping = {}\n    for code in job_state_codes:\n        if code in JOB_STATES:\n            job_state_mapping[code] = JOB_STATES[code]\n    return job_state_mapping\n", "entry_point": "map_job_states", "input": "['C', 'H']", "output": "{'C': 'COMPLETED', 'H': 'HELD'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40681_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017676", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 1, 1, 4, 1, 1, 5]", "output": "[1, 2, 5, 5, 2, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137556_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017677", "code": "def _clean_binary_segmentation(input, percentile):\n    sorted_input = sorted(input)\n    threshold_index = int(len(sorted_input) * percentile / 100)\n    below_percentile = sorted_input[:threshold_index]\n    equal_above_percentile = sorted_input[threshold_index:]\n    return below_percentile, equal_above_percentile\n", "entry_point": "_clean_binary_segmentation", "input": "[2, 4, 10, 10, 20, 40, 40, 10], 37.5", "output": "([2, 4, 10], [10, 10, 20, 40, 40])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96298_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017678", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[5, 2, 3, 4, 3, 5, 0, 3]", "output": "[7, 5, 7, 7, 8, 5, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017679", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[1, 8, 7, 6, 3, 2]", "output": "[1, 8, 7, 6, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017680", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'   hello   '", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017681", "code": "def remove_min_parentheses(s):\n    if not s:\n        return \"\"\n    s = list(s)\n    stack = []\n    for i, char in enumerate(s):\n        if char == \"(\":\n            stack.append(i)\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                s[i] = \"\"\n    while stack:\n        s[stack.pop()] = \"\"\n    return \"\".join(s)\n", "entry_point": "remove_min_parentheses", "input": "'(())((())(()))'", "output": "'(())((())(()))'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35267_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6695", "output": "{1, 65, 515, 5, 6695, 103, 13, 1339}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017683", "code": "def process_messages(input_str):\n    messages = {'Controller': [], 'Switch': []}\n    for message in input_str.split(','):\n        if message.startswith('C:'):\n            messages['Controller'].append(message[2:])\n        elif message.startswith('S:'):\n            messages['Switch'].append(message[2:])\n    return messages\n", "entry_point": "process_messages", "input": "'C:Controller'", "output": "{'Controller': ['Controller'], 'Switch': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43777_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017684", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        if count + score_count[score] <= n:\n            top_scores.extend([score] * score_count[score])\n            count += score_count[score]\n        else:\n            remaining = n - count\n            top_scores.extend([score] * remaining)\n            break\n    return sum(top_scores) / n\n", "entry_point": "average_top_n_scores", "input": "[92, 92, 92, 92], 4", "output": "92.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13074_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017685", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[5, 4, 3, 0]", "output": "[4, 4, 4, 4, 4, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017686", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "7", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017687", "code": "def modify_string(S):\n    if S == 'a':\n        return '-1'\n    else:\n        return 'a'\n", "entry_point": "modify_string", "input": "'a'", "output": "'-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10379_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017688", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[0, -1, 2, 2, -3]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017689", "code": "LOG_MESSAGES = {\n    \"sn.user.signup\": \"User signed up\",\n    \"sn.user.auth.challenge\": \"Authentication challenge initiated\",\n    \"sn.user.auth.challenge.success\": \"Authentication challenge succeeded\",\n    \"sn.user.auth.challenge.failure\": \"Authentication challenge failed\",\n    \"sn.user.2fa.disable\": \"Two-factor authentication disabled\",\n    \"sn.user.email.update\": \"Email updated\",\n    \"sn.user.password.reset\": \"Password reset initiated\",\n    \"sn.user.password.reset.success\": \"Password reset succeeded\",\n    \"sn.user.password.reset.failure\": \"Password reset failed\",\n    \"sn.user.invite\": \"User invited\",\n    \"sn.user.role.update\": \"User role updated\",\n    \"sn.user.profile.update\": \"User profile updated\",\n    \"sn.user.page.view\": \"User page viewed\",\n    \"sn.verify\": \"Verification initiated\"\n}\ndef get_log_message(log_event_type):\n    return LOG_MESSAGES.get(log_event_type, \"Unknown log event type\")\n", "entry_point": "get_log_message", "input": "'sn.user.password.reset.failure'", "output": "'Password reset failed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88021_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9883", "output": "{1, 9883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "321", "output": "{321, 1, 3, 107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017692", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'GEL'", "output": "'LEG'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017693", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[6, 6, 6, 6, 6, 1, 5, 5]", "output": "([6, 1, 5], [5, 1, 2])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017694", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "199", "output": "b'\\xc7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017695", "code": "def release_parking_slot(slot_to_release, parking_lot):\n    if slot_to_release in parking_lot:\n        parking_lot.remove(slot_to_release)\n    return parking_lot\n", "entry_point": "release_parking_slot", "input": "'B2', ['A1', 'C3', 'D4', 'B2']", "output": "['A1', 'C3', 'D4']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92956_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017696", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 30, 30, 62]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017697", "code": "from typing import List\nimport math\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_bytes = sum(file_sizes)\n    total_kb = math.ceil(total_bytes / 1024)\n    return total_kb\n", "entry_point": "total_size_in_kb", "input": "[19456]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90092_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017698", "code": "def generate_identifier(input_string):\n    char_count = {}\n    for char in input_string:\n        if char not in char_count:\n            char_count[char] = 1\n        else:\n            char_count[char] += 1\n    sorted_char_count = dict(sorted(char_count.items()))\n    identifier = ''.join(str(ord(char)) for char in sorted_char_count.keys())\n    return int(identifier)\n", "entry_point": "generate_identifier", "input": "'hl'", "output": "104108", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73073_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017699", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6907", "output": "{1, 6907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1077", "output": "{1, 3, 1077, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017701", "code": "def vector_add(vectors):\n    result = []\n    # Iterate over the elements of input vectors simultaneously\n    for elements in zip(*vectors):\n        result.append(sum(elements))\n    return result\n", "entry_point": "vector_add", "input": "[[10], [14]]", "output": "[24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79066_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6022", "output": "{1, 2, 3011, 6022}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6021", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9974", "output": "{1, 2, 4987, 9974}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9973", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017704", "code": "def generate_secret_key(property_id, stream_id):\n    concatenated_str = property_id + \"-\" + stream_id\n    ascii_sum = sum(ord(char) for char in concatenated_str)\n    secret_key = ascii_sum % 256\n    return secret_key\n", "entry_point": "generate_secret_key", "input": "'A', 'y'", "output": "231", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135157_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017705", "code": "def calculate_total_distance(distances):\n    total_distance = 0\n    for distance in distances:\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148213_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4754", "output": "{2377, 1, 4754, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017707", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1559", "output": "{1, 1559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017708", "code": "def duplicate_characters(input_str):\n    output_str = \"\"\n    for char in input_str:\n        output_str += char * 2\n    return output_str\n", "entry_point": "duplicate_characters", "input": "'World!'", "output": "'WWoorrlldd!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45209_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017709", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "10, -3", "output": "0.001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017710", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[0, 1, 6, 6, 8, 5, 3, 4, 10]", "output": "[4, 3, 5, 8, 6, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017711", "code": "from typing import List\ndef get_latest_supported_microversion(current_microversion: str, supported_microversions: List[str]) -> str:\n    current_major, current_minor = map(int, current_microversion.split('.'))\n    filtered_microversions = [microversion for microversion in supported_microversions if tuple(map(int, microversion.split('.'))) <= (current_major, current_minor)]\n    if not filtered_microversions:\n        return \"\"\n    return max(filtered_microversions)\n", "entry_point": "get_latest_supported_microversion", "input": "'202.1100', ['200.1000', '201.1000', '202.1000', '202.1100']", "output": "'202.1100'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24792_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017712", "code": "def find_first_common_element(list_one, list_two):\n    \"\"\"Find and return the first common element between two lists.\"\"\"\n    for element in list_one:\n        if element in list_two:\n            return element\n    return None\n", "entry_point": "find_first_common_element", "input": "[1, 2, 3], [1, 4, 5]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114546_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017713", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[2, 3, 6, 2]", "output": "[2, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017714", "code": "def closest_three_sum(nums, target):\n    nums.sort()\n    closest_sum = float('inf')\n    closest_diff = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            current_diff = abs(current_sum - target)\n            if current_diff < closest_diff:\n                closest_sum = current_sum\n                closest_diff = current_diff\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return current_sum\n    return closest_sum\n", "entry_point": "closest_three_sum", "input": "[-10, 1, 1], -8", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34495_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017715", "code": "from typing import List\ndef max_product(nums: List[int]) -> int:\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[2, 8]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91738_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017716", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4009", "output": "{19, 1, 4009, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4008", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017717", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[2, 2, 2, 4], 'add'", "output": "[10, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3812", "output": "{1, 2, 3812, 4, 1906, 953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3811", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017719", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "'some_user_id', -3", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017720", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(0, 0, 0), 52473", "output": "52473", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017721", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3511", "output": "{1, 3511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017722", "code": "from typing import List\ndef two_sum(nums: List[int], target: int) -> List[int]:\n    seen = {}  # Dictionary to store elements and their indices\n    for idx, num in enumerate(nums):\n        complement = target - num\n        if complement in seen:\n            return [seen[complement], idx]\n        seen[num] = idx\n    return []\n", "entry_point": "two_sum", "input": "[2, 3], 5", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50190_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4101", "output": "{1, 3, 4101, 1367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017724", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[1, 1, 2, 2, 3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017725", "code": "def longest_increasing_subsequence_length(nums):\n    if not nums:\n        return 0\n    dp = [1] * len(nums)\n    for i in range(1, len(nums)):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    return max(dp)\n", "entry_point": "longest_increasing_subsequence_length", "input": "[42]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34697_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017726", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "7, 1", "output": "'Enemy: 7, Own: 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017727", "code": "import re\ndef extract_trust_id(url):\n    # Define a regular expression pattern to match the trust ID in the URL format\n    pattern = r'trust\\+http://(\\d+)@.*'\n    # Use regex to search for the trust ID in the URL\n    match = re.search(pattern, url)\n    if match:\n        # Extract the trust ID from the matched group\n        trust_id = match.group(1)\n        return trust_id\n    else:\n        return None\n", "entry_point": "extract_trust_id", "input": "'trust+http://123456@some.domain.com'", "output": "'123456'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144796_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017728", "code": "def simulate_tcp(commands):\n    received_messages = []\n    is_open = False\n    current_message = \"\"\n    for command in commands:\n        if command == \"open\":\n            is_open = True\n        elif command == \"close\":\n            is_open = False\n            current_message = \"\"\n        elif command.startswith(\"send\"):\n            current_message = command.split(\" \", 1)[1]\n        elif command == \"receive\" and is_open:\n            received_messages.append(current_message)\n    return received_messages\n", "entry_point": "simulate_tcp", "input": "['close', 'receive']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50983_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7046", "output": "{1, 2, 3523, 7046, 13, 271, 26, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7045", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017730", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 7, 10, 20, 23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27175_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017731", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string.lower():\n        if char != ' ':\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hhhh eeee ll wr'", "output": "{'h': 4, 'e': 4, 'l': 2, 'w': 1, 'r': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69138_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017732", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[9, 8, 8, 8, 8]", "output": "[8, 8, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt69", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017733", "code": "def calculate_average_excluding_outliers(numbers, threshold):\n    if not numbers:\n        return 0\n    median = sorted(numbers)[len(numbers) // 2]\n    filtered_numbers = [num for num in numbers if abs(num - median) <= threshold * median]\n    if not filtered_numbers:\n        return 0\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_excluding_outliers", "input": "[15, 17, 18, 20, 25], 0.1", "output": "17.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65048_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017734", "code": "import re\ndef count_unique_words(text_content):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', text_content.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'helho'", "output": "{'helho': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017735", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1499", "output": "1459", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017736", "code": "def convert_bytes(num):\n    for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:\n        if num < 1024.0 and num > -1024.0:\n            return \"{0:.1f} {1}\".format(num, x)\n        num /= 1024.0\n", "entry_point": "convert_bytes", "input": "2048.0", "output": "'2.0 KB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132353_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017737", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[1, 2, [3], 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017738", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5743", "output": "{1, 5743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5742", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017739", "code": "import string\ndef encode_payload(payload):\n    encoded_payload = \"\"\n    i = 0\n    while i < len(payload):\n        if payload[i] == '%' and (i < len(payload) - 2) and payload[i + 1:i + 3].isalnum() and all(c in string.hexdigits for c in payload[i + 1:i + 3]):\n            encoded_payload += payload[i:i + 3]\n            i += 3\n        elif payload[i] != ' ':\n            encoded_payload += '%%%02X' % ord(payload[i])\n            i += 1\n        else:\n            encoded_payload += payload[i]\n            i += 1\n    return encoded_payload\n", "entry_point": "encode_payload", "input": "'%1'", "output": "'%25%31'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131939_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017740", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'310.10.0'", "output": "(310, 10, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017741", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9811", "output": "{1, 9811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017742", "code": "def my_pow(x: float, n: int) -> float:\n    if n == 0:\n        return 1\n    result = my_pow(x*x, abs(n) // 2)\n    if n % 2:\n        result *= x\n    if n < 0:\n        return 1 / result\n    return result\n", "entry_point": "my_pow", "input": "2, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125524_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8338", "output": "{1, 2, 4169, 11, 8338, 758, 22, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1588", "output": "{1, 2, 4, 397, 1588, 794}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1587", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017745", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "2, 6", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017746", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 3, 5, 8, 7, 12, 8, 2, 8, 9]", "output": "[8, 12, 8, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017747", "code": "def calculate_max_profit(K, A, B):\n    if B - A <= 2 or 1 + (K - 2) < A:\n        return K + 1\n    exchange_times, last = divmod(K - (A - 1), 2)\n    profit = B - A\n    return A + exchange_times * profit + last\n", "entry_point": "calculate_max_profit", "input": "12, 5, 7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88263_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017748", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[70, 80, 90, 75, 85, 65], 3", "output": "[2, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017749", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 5, 5, 4, 4, 4, 3, 4]", "output": "[9, 15, 15, 8, 8, 8, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5062", "output": "{1, 2, 2531, 5062}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5061", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017751", "code": "def repeatedString(s, n):\n    count_1 = n // len(s) * s.count('a')  # Count of 'a' in complete repetitions of s\n    remained_string = n % len(s)  # Number of characters left after complete repetitions\n    count_2 = s[:remained_string].count('a')  # Count of 'a' in the remaining characters\n    return count_1 + count_2\n", "entry_point": "repeatedString", "input": "'a', 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29420_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "238", "output": "{1, 2, 34, 7, 238, 14, 17, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017753", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "11, 5", "output": "462.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017754", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6931", "output": "{1, 6931, 29, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017755", "code": "def sum_of_even_squares(nums):\n    even_numbers = [num for num in nums if num % 2 == 0]\n    squared_even_numbers = [num**2 for num in even_numbers]\n    return sum(squared_even_numbers)\n", "entry_point": "sum_of_even_squares", "input": "[2, 10]", "output": "104", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75506_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017756", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2, 2, 2, 3, 3, 5, 3]", "output": "[4, 4, 4, 5, 6, 8, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89166_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017757", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[9, 9, 4, 5, 2, 8, 2], 6", "output": "[[9, 9, 4, 5, 2, 8], [2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5186", "output": "{1, 5186, 2, 2593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017759", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/home/user/other', '/home/user/ser/da'", "output": "'../ser/da'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017760", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'itei2, '", "output": "['itei2', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017761", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[5, 5, 3, 5, 8, 5, 5]", "output": "[125, 125, 37, 125, 64, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017762", "code": "from typing import List, Dict\ndef filter_logs(logs: List[Dict[str, str]], level: str) -> List[str]:\n    filtered_messages = [log['message'] for log in logs if log['level'] == level]\n    return filtered_messages\n", "entry_point": "filter_logs", "input": "[], 'error'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46242_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7851", "output": "{3, 1, 7851, 2617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017764", "code": "def elementwise_less_equal(v1, v2):\n    result = []\n    for val1, val2 in zip(v1, v2):\n        result.append(val1 <= val2)\n    return result\n", "entry_point": "elementwise_less_equal", "input": "[4, 5, 6, 3], [3, 4, 5, 3]", "output": "[False, False, False, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017765", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[33, 89, 25, 33, 89, 33, 33, 89]", "output": "[25, 33, 33, 33, 33, 89, 89, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017766", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'ac'", "output": "['ac', 'ca']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017767", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "6, 13", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017768", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[0, 1, 1], 'add'", "output": "[2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017769", "code": "def reverse_and_uppercase(string):\n    reversed_uppercase = string[::-1].upper()\n    return reversed_uppercase\n", "entry_point": "reverse_and_uppercase", "input": "'hello'", "output": "'OLLEH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45524_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017770", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[1, 2, 3]", "output": "[1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017771", "code": "def find_last_word_length(s: str) -> int:\n    reversed_string = s.strip()[::-1]  # Reverse the input string after removing leading/trailing spaces\n    length = 0\n    for char in reversed_string:\n        if char == ' ':\n            if length == 0:\n                continue\n            break\n        length += 1\n    return length\n", "entry_point": "find_last_word_length", "input": "'   This is a test   friend'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93428_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017772", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[2, 2, 3, 4, 8, 5, 5, 6, 9, 7]", "output": "[2, 3, 4, 8, 5, 6, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017773", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "76066.7, '0.00000'", "output": "'7.60667E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017774", "code": "import re\ndef filter_names(names):\n    pattern = r\"\\b[A-Z][a-z]+ [A-Z][a-z]+\\b\"\n    filtered_names = [name for name in names if re.match(pattern, name)]\n    return filtered_names\n", "entry_point": "filter_names", "input": "['John Doe', 'john doe', '123', 'John']", "output": "['John Doe']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141772_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017775", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[70, 70, 70, 70, 67], 5", "output": "69.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82034_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017776", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[4, 2, 3]", "output": "{4: 16, 2: 4, 3: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017777", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "5.5585036, 10", "output": "95.5585036", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017778", "code": "def determinant(matrix):\n    size = len(matrix)\n    if size == 1:\n        return matrix[0][0]\n    elif size == 2:\n        return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]\n    else:\n        det = 0\n        for i in range(size):\n            sign = (-1) ** i\n            submatrix = [row[:i] + row[i+1:] for row in matrix[1:]]\n            det += sign * matrix[0][i] * determinant(submatrix)\n        return det\n", "entry_point": "determinant", "input": "[[3, 0], [0, 3]]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37266_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017779", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[12, 15]", "output": "(15, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017780", "code": "def count_subarrays(nums, k):\n    prod = 1\n    res = 0\n    i, j = 0, 0\n    while j < len(nums):\n        prod *= nums[j]\n        if prod < k:\n            res += (j - i + 1)\n        elif prod >= k:\n            while prod >= k:\n                prod = prod // nums[i]\n                i += 1\n            res += (j - i + 1)\n        j += 1\n    return res\n", "entry_point": "count_subarrays", "input": "[10, 5, 2, 6], 100", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122589_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017781", "code": "import unicodedata\nGAP = '\\a'\ndef replace_gap_with_unicode(strings):\n    modified_strings = []\n    for string in strings:\n        modified_string = ''\n        for char in string:\n            if char == GAP:\n                modified_string += '<control>' + unicodedata.name(char, 'UNKNOWN').lower()\n            else:\n                modified_string += char\n        modified_strings.append(modified_string)\n    return modified_strings\n", "entry_point": "replace_gap_with_unicode", "input": "['acherrypc', '\\x07ana', 'aapp']", "output": "['acherrypc', '<control>unknownana', 'aapp']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84602_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017782", "code": "def process_line(line):\n    start_br = line.find('[')\n    end_br = line.find(']')\n    conf_delim = line.find('::')\n    verb1 = line[:start_br].strip()\n    rel = line[start_br + 1: end_br].strip()\n    verb2 = line[end_br + 1: conf_delim].strip()\n    conf = line[conf_delim + 2:].strip()  # Skip the '::' delimiter\n    return verb1, rel, verb2, conf\n", "entry_point": "process_line", "input": "'[lazy]:: dog'", "output": "('', 'lazy', '', 'dog')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60093_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017783", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[50, 2, 48, 2, 12, 48]", "output": "[50, 2, 48, 2, 12, 48]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017784", "code": "from typing import List, Tuple\nfrom numbers import Real\ndef find_unique_pairs(numbers: List[Real], target: Real) -> List[Tuple[Real, Real]]:\n    unique_pairs = set()\n    complements = set()\n    for num in numbers:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[3, 4, 4, 5], 8", "output": "[(4, 4), (3, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128394_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017785", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "-5, 2, 2, 3, 3, 3, 2", "output": "-1080", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017786", "code": "def extract_integer_parts(numbers):\n    integer_parts = []\n    for num in numbers:\n        num_str = str(num)\n        integer_part = int(num_str.split('.')[0])\n        integer_parts.append(integer_part)\n    return integer_parts\n", "entry_point": "extract_integer_parts", "input": "[3.5, 7.8, 10.2, 4.1]", "output": "[3, 7, 10, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64120_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017787", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'diThis dinner is not bad!nner'", "output": "'diThis dinner is good!nner'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017788", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "'wor - world lo'", "output": "'worworldlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017789", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[2, 6, 4, 4, 1, 1, 7], 4", "output": "[[2, 6, 4, 4], [1, 1, 7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017790", "code": "def extract_app_module(default_app_config: str) -> str:\n    parts = default_app_config.split('.')\n    app_module = '.'.join(parts[:-1])\n    return app_module\n", "entry_point": "extract_app_module", "input": "'o.'", "output": "'o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129893_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017791", "code": "rpc_method_handlers = {\n    'api.Repository': lambda: 'Handling Repository API',\n    'api.User': lambda: 'Handling User API'\n}\ndef execute_rpc_handler(api_endpoint: str):\n    if api_endpoint in rpc_method_handlers:\n        return rpc_method_handlers[api_endpoint]()\n    else:\n        return 'Handler not found'\n", "entry_point": "execute_rpc_handler", "input": "'api.User'", "output": "'Handling User API'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112368_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017792", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48648656CC'", "output": "b'Hd\\x86V\\xcc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017793", "code": "def elementwise_division(a, b):\n    if isinstance(a[0], list):  # Check if a is a 2D list\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [[x / y for x, y in zip(row_a, row_b)] for row_a, row_b in zip(a, b)]\n    else:  # Assuming a and b are 1D lists\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [x / y for x, y in zip(a, b)]\n", "entry_point": "elementwise_division", "input": "[5, 5, 5, 5], [1, 1, 1, 1]", "output": "[5.0, 5.0, 5.0, 5.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108971_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017794", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "454", "output": "{1, 2, 227, 454}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017795", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Hello hello, world!'", "output": "['hello', 'hello,', 'world!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017796", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[89, 89, 88, 85, 80]", "output": "[89, 89, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113414_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017797", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[4, 1, 0, 3, 4, 1]", "output": "[5, 1, 3, 7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5878", "output": "{1, 2, 2939, 5878}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017799", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2512", "output": "{1, 2, 4, 1256, 8, 2512, 16, 628, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2511", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017800", "code": "def average_absolute_difference(list1, list2):\n    if len(list1) != len(list2):\n        return \"Error: Input lists must have the same length.\"\n    abs_diff = [abs(x - y) for x, y in zip(list1, list2)]\n    avg_abs_diff = sum(abs_diff) / len(abs_diff)\n    return avg_abs_diff\n", "entry_point": "average_absolute_difference", "input": "[1, 2], [3]", "output": "'Error: Input lists must have the same length.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107856_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017801", "code": "from typing import List\ndef calculate_average(numbers: List[float]) -> float:\n    if len(numbers) < 3:\n        raise ValueError(\"Input list must contain at least 3 numbers.\")\n    min_val = min(numbers)\n    max_val = max(numbers)\n    total_sum = sum(numbers)\n    adjusted_sum = total_sum - min_val - max_val\n    return adjusted_sum / (len(numbers) - 2)\n", "entry_point": "calculate_average", "input": "[10, 20, 20, 20, 30]", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108311_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017802", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4667", "output": "{1, 4667, 13, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017803", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'sg.sg'", "output": "('sg', 'sg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017804", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'odwolowo'", "output": "{'odwolowo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017805", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "819", "output": "{1, 3, 7, 39, 9, 13, 273, 819, 117, 21, 91, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2071", "output": "{1, 19, 109, 2071}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017807", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[10, 9, 9, 9, 5, 4, 6, 8]", "output": "[10, 9, 9, 9, 8, 6, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017808", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1.0, 1.7551020408163265", "output": "1.7551020408163265", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017809", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "9", "output": "[1, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017810", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'2 4 +'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017811", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "5.5, 3", "output": "1.833333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017812", "code": "from typing import List\ndef count_runtime_classes(runtime_classes: List[dict]) -> dict:\n    class_count = {}\n    for runtime_class in runtime_classes:\n        class_name = runtime_class.get(\"name\")\n        if class_name in class_count:\n            class_count[class_name] += 1\n        else:\n            class_count[class_name] = 1\n    return class_count\n", "entry_point": "count_runtime_classes", "input": "[{'name': None}, {'name': None}, {'name': None}, {'name': None}]", "output": "{None: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69123_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4337", "output": "{1, 4337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017814", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'30+20'", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017815", "code": "def format_version(version_str: str) -> str:\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    version_integers = [int(component) for component in version_components]\n    # Format the version string as 'vX.Y.Z'\n    formatted_version = 'v' + '.'.join(map(str, version_integers))\n    return formatted_version\n", "entry_point": "format_version", "input": "'1.2.2.3'", "output": "'v1.2.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15533_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017816", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8426", "output": "{1, 2, 8426, 11, 4213, 22, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017817", "code": "import os\ndef relative_path(file_path, dir_path):\n    file_parts = file_path.split(os.sep)\n    dir_parts = dir_path.split(os.sep)\n    # Calculate the common prefix\n    i = 0\n    while i < len(file_parts) and i < len(dir_parts) and file_parts[i] == dir_parts[i]:\n        i += 1\n    # Calculate the relative path\n    rel_path = ['..' for _ in range(len(file_parts) - i - 1)] + dir_parts[i:]\n    return os.path.join(*rel_path)\n", "entry_point": "relative_path", "input": "'home/user/docs/report.txt', 'home/user/es'", "output": "'../es'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017818", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[4, 5, 1, 3, 3, 1, 4, 0, 2]", "output": "[9, 6, 4, 6, 4, 5, 4, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117452_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017819", "code": "import json\ndef process_debug_metadata(data: dict) -> dict:\n    def normalize_none_values(obj):\n        if isinstance(obj, dict):\n            return {k: normalize_none_values(v) for k, v in obj.items()}\n        elif isinstance(obj, list):\n            return [v if v is not None else [None] for v in obj]\n        return obj\n    normalized_data = normalize_none_values(data)\n    errors = []\n    for value in normalized_data.values():\n        if isinstance(value, str) and value.startswith('error:'):\n            errors.append(value)\n    to_json = json.dumps(normalized_data)\n    return {'errors': errors, 'to_json': to_json}\n", "entry_point": "process_debug_metadata", "input": "{}", "output": "{'errors': [], 'to_json': '{}'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67931_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017820", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[]", "output": "'0 minutes and 0 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017821", "code": "def get_webapp2_config(admin_settings: dict) -> str:\n    if '_webapp2_config' in admin_settings:\n        return admin_settings['_webapp2_config']\n    else:\n        return 'Key not found'\n", "entry_point": "get_webapp2_config", "input": "{}", "output": "'Key not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131382_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017822", "code": "import string\ndef encode_payload(payload):\n    encoded_payload = \"\"\n    i = 0\n    while i < len(payload):\n        if payload[i] == '%' and (i < len(payload) - 2) and payload[i + 1:i + 3].isalnum() and all(c in string.hexdigits for c in payload[i + 1:i + 3]):\n            encoded_payload += payload[i:i + 3]\n            i += 3\n        elif payload[i] != ' ':\n            encoded_payload += '%%%02X' % ord(payload[i])\n            i += 1\n        else:\n            encoded_payload += payload[i]\n            i += 1\n    return encoded_payload\n", "entry_point": "encode_payload", "input": "'hworlhd %1'", "output": "'%68%77%6F%72%6C%68%64 %25%31'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131939_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017823", "code": "def simulate_train(commands):\n    position = 0\n    for command in commands:\n        if command == 'F' and position < 10:\n            position += 1\n        elif command == 'B' and position > -10:\n            position -= 1\n    return position\n", "entry_point": "simulate_train", "input": "['F', 'F', 'F', 'F', 'F']", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105746_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017824", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 2, 3, 4, 5, 6]", "output": "(5, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017825", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[100, 92, 82, 70], 3", "output": "91.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86097_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017826", "code": "def generate_create_table_query(table_name, schema):\n    columns = [f\"{column} {data_type}\" for column, data_type in schema.items()]\n    columns_str = \",\\n\".join(columns)\n    query = f\"CREATE TABLE {table_name} (\\n{columns_str}\\n);\"\n    return query\n", "entry_point": "generate_create_table_query", "input": "'exame_teble', {}", "output": "'CREATE TABLE exame_teble (\\n\\n);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60598_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017827", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'tAbout', 'Dery (Begkulu)'", "output": "{'title': 'tAbout', 'contrib': 'Dery (Begkulu)'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017828", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[32, 31, 90, 10, 62, 32, 35, 32]", "output": "[10, 31, 32, 32, 32, 35, 62, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017829", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[37]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017830", "code": "def linear_regression_predict(x, y, x_val):\n    n = len(x)\n    xy = [x[i] * y[i] for i in range(n)]\n    x_square = [x[i] * x[i] for i in range(n)]\n    avg_x = sum(x) / n\n    avg_y = sum(y) / n\n    avg_xy = sum(xy) / n\n    avg_xsqr = sum(x_square) / n\n    m = ((avg_x * avg_y) - avg_xy) / (avg_x ** 2 - avg_xsqr)\n    c = avg_y - (m * avg_x)\n    return round((m * x_val + c), 2)\n", "entry_point": "linear_regression_predict", "input": "[1, 2, 3, 4], [3, 5, 7, 9], 5", "output": "11.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146286_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6332", "output": "{1, 2, 4, 1583, 6332, 3166}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6331", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017832", "code": "from typing import List\ndef get_unique_elements(input_list: List[int]) -> List[int]:\n    unique_elements = []\n    seen_elements = set()\n    for element in input_list:\n        if element not in seen_elements:\n            unique_elements.append(element)\n            seen_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[9, 8, 10, 2, 5]", "output": "[9, 8, 10, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78256_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017833", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'Hello, World. This is a test!'", "output": "'Hello World This is a test!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1369", "output": "{1369, 1, 37}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017835", "code": "import re\ndef remove_retweet(tweet):\n    return re.sub(r\"\\brt\\b\", \"\", tweet)\n", "entry_point": "remove_retweet", "input": "'rt Bug\u00fcn hava \u00e7ok g\u00fczel'", "output": "' Bug\u00fcn hava \u00e7ok g\u00fczel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62869_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017836", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9035", "output": "{1, 65, 5, 9035, 139, 13, 1807, 695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1634", "output": "{1, 1634, 2, 38, 43, 817, 19, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017838", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1446", "output": "{1, 2, 3, 482, 1446, 6, 241, 723}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7549", "output": "{1, 7549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017840", "code": "def get_repo_name_from_url(url: str) -> str:\n    if not url:\n        return None\n    last_slash_index = url.rfind(\"/\")\n    last_suffix_index = url.rfind(\".git\")\n    if last_suffix_index < 0:\n        last_suffix_index = len(url)\n    if last_slash_index < 0 or last_suffix_index <= last_slash_index:\n        raise Exception(\"Invalid repo url {}\".format(url))\n    return url[last_slash_index + 1:last_suffix_index]\n", "entry_point": "get_repo_name_from_url", "input": "'https://example.com/some/path/to/repo/u'", "output": "'u'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4595_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017841", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "14", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017842", "code": "def evaluate_expression(expression):\n    return eval(expression)\n", "entry_point": "evaluate_expression", "input": "'2 + 3'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69875_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017843", "code": "def modified_insertion_sort(arr):\n    def insertion_sort(arr):\n        for i in range(1, len(arr)):\n            key = arr[i]\n            j = i - 1\n            while j >= 0 and arr[j] > key:\n                arr[j + 1] = arr[j]\n                j -= 1\n            arr[j + 1] = key\n    sorted_arr = []\n    positive_nums = [num for num in arr if num > 0]\n    insertion_sort(positive_nums)\n    pos_index = 0\n    for num in arr:\n        if num > 0:\n            sorted_arr.append(positive_nums[pos_index])\n            pos_index += 1\n        else:\n            sorted_arr.append(num)\n    return sorted_arr\n", "entry_point": "modified_insertion_sort", "input": "[1, -3, 5, 6, -2, 4, 3]", "output": "[1, -3, 3, 4, -2, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66384_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017844", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "5, 15", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017845", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(targets=['x'], expr=11)", "output": "'x = 11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017846", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[0, 4, 4]", "output": "[0, 64, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017847", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'rroco_auc'", "output": "'rroco_auc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017848", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'3.0.16'", "output": "(3, 0, 16)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017849", "code": "def find_lyrics(allTimeList, lrcDict, getTime):\n    closest_index = 0\n    for n in range(len(allTimeList)):\n        tempTime = allTimeList[n]\n        if getTime < tempTime:\n            break\n        closest_index = n\n    if closest_index == 0:\n        return \"\u65f6\u95f4\u592a\u5c0f\"\n    else:\n        return lrcDict[allTimeList[closest_index - 1]]\n", "entry_point": "find_lyrics", "input": "[3.0, 4.0, 5.0], {}, 1.0", "output": "'\u65f6\u95f4\u592a\u5c0f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4813_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8878", "output": "{1, 2, 386, 193, 8878, 46, 23, 4439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8877", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017851", "code": "def count_word_frequencies(messages):\n    word_freq = {}\n    for message in messages:\n        words = message.lower().split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "['hello hello']", "output": "{'hello': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132213_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1114", "output": "{1, 1114, 2, 557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1113", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017853", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'1.111.5'", "output": "(1, 111, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017854", "code": "def count_word_occurrences(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Tokenize the text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the counts\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_occurrences", "input": "'python.python.'", "output": "{'python.python.': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52489_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017855", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "{'CONF_NUMBER': 7}", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1355", "output": "{1, 1355, 5, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017857", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "14", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017858", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3742", "output": "{1, 2, 3742, 1871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017859", "code": "def convert_to_fahrenheit(celsius_temps):\n    fahrenheit_temps = []\n    for celsius_temp in celsius_temps:\n        fahrenheit_temp = celsius_temp * 9/5 + 32\n        fahrenheit_temps.append(fahrenheit_temp)\n    return fahrenheit_temps\n", "entry_point": "convert_to_fahrenheit", "input": "[2.0, 1.0, 100.0, 1.0, 2.0, 1.0]", "output": "[35.6, 33.8, 212.0, 33.8, 35.6, 33.8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6499_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017860", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "-99.00000000000001", "output": "174.14999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017861", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "10", "output": "'X'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017862", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[-2, -2, 4, 0, -3, -3, 6], 1", "output": "[-2, -2, 4, 0, -3, -3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017863", "code": "def max_height(staircase):\n    max_height = 0\n    current_height = 0\n    for step in staircase:\n        if step == '+':\n            current_height += 1\n        elif step == '-':\n            current_height -= 1\n        max_height = max(max_height, current_height)\n    return max_height\n", "entry_point": "max_height", "input": "'++--'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46647_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017864", "code": "def find_closest_distance(links_profile, distance):\n    min_diff = float('inf')\n    closest_dist = None\n    for link in links_profile:\n        curr_diff = abs(link['dist'] - distance)\n        if curr_diff < min_diff:\n            min_diff = curr_diff\n            closest_dist = link['dist']\n    return closest_dist\n", "entry_point": "find_closest_distance", "input": "[{'dist': 24}, {'dist': 25}, {'dist': 26}], 25", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32325_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017865", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3951", "output": "{1, 3, 1317, 9, 3951, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017866", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'101.4.7'", "output": "(101, 4, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017867", "code": "from typing import List\ndef min_color_changes(colors: List[int], target_color: int) -> int:\n    dp = [[float('inf')] * 4 for _ in range(len(colors))]\n    for i in range(4):\n        dp[0][i] = int(colors[0] != i)\n    for i in range(1, len(colors)):\n        for j in range(4):\n            for k in range(4):\n                dp[i][j] = min(dp[i][j], dp[i-1][k] + int(colors[i] != j) + abs(j - target_color))\n    return min(dp[-1])\n", "entry_point": "min_color_changes", "input": "[1, 1, 1, 2, 2], 0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102770_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017868", "code": "def sum_fibonacci(N):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(N):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "5", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135288_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017869", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5, 6, 7, 8], [0, 3, 4, 5, 6, 7, 8, 9]", "output": "('Player 2 wins', 1, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017870", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7562", "output": "{1, 2, 3781, 38, 199, 7562, 398, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017871", "code": "from collections import Counter\nimport string\ndef find_top_words(text, n):\n    # Tokenize the text into words\n    words = text.lower().translate(str.maketrans('', '', string.punctuation)).split()\n    # Define common English stopwords\n    stop_words = set([\"i\", \"me\", \"my\", \"myself\", \"we\", \"our\", \"ours\", \"ourselves\", \"you\", \"your\", \"yours\", \"yourself\", \"yourselves\", \"he\", \"him\", \"his\", \"himself\", \"she\", \"her\", \"hers\", \"herself\", \"it\", \"its\", \"itself\", \"they\", \"them\", \"their\", \"theirs\", \"themselves\", \"what\", \"which\", \"who\", \"whom\", \"this\", \"that\", \"these\", \"those\", \"am\", \"is\", \"are\", \"was\", \"were\", \"be\", \"been\", \"being\", \"have\", \"has\", \"had\", \"having\", \"do\", \"does\", \"did\", \"doing\", \"a\", \"an\", \"the\", \"and\", \"but\", \"if\", \"or\", \"because\", \"as\", \"until\", \"while\", \"of\", \"at\", \"by\", \"for\", \"with\", \"about\", \"against\", \"between\", \"into\", \"through\", \"during\", \"before\", \"after\", \"above\", \"below\", \"to\", \"from\", \"up\", \"down\", \"in\", \"out\", \"on\", \"off\", \"over\", \"under\", \"again\", \"further\", \"then\", \"once\", \"here\", \"there\", \"when\", \"where\", \"why\", \"how\", \"all\", \"any\", \"both\", \"each\", \"few\", \"more\", \"most\", \"other\", \"some\", \"such\", \"no\", \"nor\", \"not\", \"only\", \"own\", \"same\", \"so\", \"than\", \"too\", \"very\", \"s\", \"t\", \"can\", \"will\", \"just\", \"don\", \"should\", \"now\"])\n    # Remove stopwords from the tokenized words\n    filtered_words = [word for word in words if word not in stop_words]\n    # Count the frequency of each word\n    word_freq = Counter(filtered_words)\n    # Sort the words based on their frequencies\n    sorted_words = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)\n    # Output the top N most frequent words along with their frequencies\n    top_words = sorted_words[:n]\n    return top_words\n", "entry_point": "find_top_words", "input": "'This is a sample', 1", "output": "[('sample', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52632_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017872", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[90, 82]", "output": "172", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017873", "code": "def shift_token(token):\n    shift_value = len(token)\n    shifted_token = \"\"\n    for char in token:\n        shifted_char = chr(((ord(char) - ord('a') + shift_value) % 26) + ord('a'))\n        shifted_token += shifted_char\n    return shifted_token\n", "entry_point": "shift_token", "input": "'abbc'", "output": "'effg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47692_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017874", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7132", "output": "{1, 2, 4, 3566, 1783, 7132}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7131", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017875", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "['F', 'F', 'F']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017876", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVAsubdiHVAC/fields/someOtherStuff'", "output": "('HVAsubdiHVAC/fields', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017877", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[50, 70]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017878", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[1, 3, 3, 6, 0, 4, 4]", "output": "([1, 3, 3, None], [6, 0, 4, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017879", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[10, 3, 5]", "output": "(10, 15)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017880", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "255", "output": "{1, 3, 5, 15, 17, 51, 85, 255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt254", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017881", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'iTstext'", "output": "'iTstext'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017882", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[3, 3, 5, 5, 4, 1, 1]", "output": "[3, 5, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017883", "code": "def get_ZX_from_ZZ_XX(ZZ, XX):\n    if hasattr(ZZ, '__iter__') and len(ZZ) == len(XX):\n        return [(z, x) for z, x in zip(ZZ, XX)]\n    else:\n        return (ZZ, XX)\n", "entry_point": "get_ZX_from_ZZ_XX", "input": "[0, 0, 3, 2, 0, 0, 2, 0], []", "output": "([0, 0, 3, 2, 0, 0, 2, 0], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141248_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017884", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 5, 2, 2, 1, 6, 5, 5]", "output": "[4, 125, 4, 4, 1, 46, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017885", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are 0 or 1 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[19, 20, 21, 22, 23]", "output": "21.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115816_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8591", "output": "{1, 71, 11, 781, 8591, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017887", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8872", "output": "{1, 2, 4, 8872, 8, 2218, 4436, 1109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8871", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017888", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "4", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017889", "code": "LOG_MESSAGES = {\n    \"sn.user.signup\": \"User signed up\",\n    \"sn.user.auth.challenge\": \"Authentication challenge initiated\",\n    \"sn.user.auth.challenge.success\": \"Authentication challenge succeeded\",\n    \"sn.user.auth.challenge.failure\": \"Authentication challenge failed\",\n    \"sn.user.2fa.disable\": \"Two-factor authentication disabled\",\n    \"sn.user.email.update\": \"Email updated\",\n    \"sn.user.password.reset\": \"Password reset initiated\",\n    \"sn.user.password.reset.success\": \"Password reset succeeded\",\n    \"sn.user.password.reset.failure\": \"Password reset failed\",\n    \"sn.user.invite\": \"User invited\",\n    \"sn.user.role.update\": \"User role updated\",\n    \"sn.user.profile.update\": \"User profile updated\",\n    \"sn.user.page.view\": \"User page viewed\",\n    \"sn.verify\": \"Verification initiated\"\n}\ndef get_log_message(log_event_type):\n    return LOG_MESSAGES.get(log_event_type, \"Unknown log event type\")\n", "entry_point": "get_log_message", "input": "'sn.user.profile.update'", "output": "'User profile updated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88021_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017890", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "12", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017891", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'thisIsCmTheT'", "output": "'this_is_cm_the_t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017892", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "3.5, 3.5", "output": "('0', '6')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017893", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1264", "output": "{1, 2, 4, 8, 79, 1264, 16, 632, 316, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1263", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017894", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[10, 4, 26, 25, 10, 43, 8, 26]", "output": "[4, 8, 10, 10, 25, 26, 26, 43]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017895", "code": "def filter_server_configs(server_configs, threshold):\n    filtered_servers = {}\n    for config in server_configs:\n        if config['limit'] > threshold:\n            filtered_servers[config['server']] = {'ip': config['ip'], 'port': config['port'], 'limit': config['limit']}\n    return filtered_servers\n", "entry_point": "filter_server_configs", "input": "[], 10", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146390_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017896", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'='", "output": "['=']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017897", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[8, 1, 8, 6, 3]", "output": "[8, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017898", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[10, 4, 9, 6, 10, 7, 9]", "output": "[4, 6, 7, 9, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017899", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[541, 541, 541]", "output": "[541, 541, 541]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017900", "code": "def calculate_average_scores(students):\n    average_scores = {}\n    for student in students:\n        name, scores = list(student.items())[0]\n        avg_score = round(sum(scores) / len(scores))\n        average_scores[name] = avg_score\n    return average_scores\n", "entry_point": "calculate_average_scores", "input": "[{'Alice': [81, 83]}]", "output": "{'Alice': 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13310_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017901", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'Redad', 'This is a description without the keyword.'", "output": "('Redad', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017902", "code": "def make_2D_custom(X, y=0):\n    if isinstance(X, list):\n        if all(isinstance(elem, list) for elem in X):\n            if len(X[0]) == 1:\n                X = [[elem[0], y] for elem in X]\n            return X\n        else:\n            X = [[elem, y] for elem in X]\n            return X\n    elif isinstance(X, int) or isinstance(X, float):\n        X = [[X, y]]\n        return X\n    else:\n        return X\n", "entry_point": "make_2D_custom", "input": "2, -1", "output": "[[2, -1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106690_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017903", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[1, 2, 3, 4, 5], 2", "output": "[3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017904", "code": "def find_twice_chars(input_str):\n    char_count = {}\n    result = []\n    for char in input_str:\n        char_count[char] = char_count.get(char, 0) + 1\n        if char_count[char] == 2:\n            result.append(char)\n    return result\n", "entry_point": "find_twice_chars", "input": "'ahbh'", "output": "['h']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135967_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017905", "code": "import re\nfrom collections import defaultdict\ndef count_unique_words(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Split the text into individual words\n    words = text.split()\n    # Create a dictionary to store word counts\n    word_counts = defaultdict(int)\n    # Iterate through the words and update the counts\n    for word in words:\n        word_counts[word] += 1\n    # Convert the defaultdict to a regular dictionary\n    unique_word_counts = dict(word_counts)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "'ellohel'", "output": "{'ellohel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90289_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4543", "output": "{1, 7, 649, 11, 77, 59, 413, 4543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017907", "code": "def count_unique_nodes(graph_str):\n    unique_nodes = set()\n    edges = graph_str.split('\\n')\n    for edge in edges:\n        nodes = edge.split('->')\n        for node in nodes:\n            unique_nodes.add(node.strip())\n    return len(unique_nodes)\n", "entry_point": "count_unique_nodes", "input": "'A -> B\\nB -> C\\nC -> D\\nD -> A'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17791_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017908", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'ell1'", "output": "'ELL#'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017909", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16186_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017910", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[3, 3, 2, 1, 1]", "output": "[3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017911", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'theTTihii'", "output": "'Tweet posted successfully: theTTihii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017912", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.settings.tConfig'", "output": "'tConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017913", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8938", "output": "{1, 2, 41, 8938, 109, 82, 4469, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017914", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[8, 9]", "output": "[8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt41", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017915", "code": "def rob_2(nums):\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob(nums):\n        prev_max = curr_max = 0\n        for num in nums:\n            temp = curr_max\n            curr_max = max(prev_max + num, curr_max)\n            prev_max = temp\n        return curr_max\n    include_first = rob(nums[1:]) + nums[0]\n    exclude_first = rob(nums[:-1])\n    return max(include_first, exclude_first)\n", "entry_point": "rob_2", "input": "[2, 7, 9, 3]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95871_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017916", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[3, 0, 3, 3, 0, 3, 0, 0]", "output": "[3, 3, 6, 9, 9, 12, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017917", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_excluding_extremes", "input": "[60, 70, 71, 72, 80]", "output": "71.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108103_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "679", "output": "{1, 7, 97, 679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017919", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7646", "output": "{1, 2, 7646, 3823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017920", "code": "import string\ndef encode_payload(payload):\n    encoded_payload = \"\"\n    i = 0\n    while i < len(payload):\n        if payload[i] == '%' and (i < len(payload) - 2) and payload[i + 1:i + 3].isalnum() and all(c in string.hexdigits for c in payload[i + 1:i + 3]):\n            encoded_payload += payload[i:i + 3]\n            i += 3\n        elif payload[i] != ' ':\n            encoded_payload += '%%%02X' % ord(payload[i])\n            i += 1\n        else:\n            encoded_payload += payload[i]\n            i += 1\n    return encoded_payload\n", "entry_point": "encode_payload", "input": "'hello world !'", "output": "'%68%65%6C%6C%6F %77%6F%72%6C%64 %21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131939_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017921", "code": "def get_algorithm_config(config_name):\n    default_config = {'mode': 'default'}\n    config_mapping = {\n        'videoonenet': {'mode': 'videoonenet', 'rho': 0.3},\n        'videoonenetadmm': {'mode': 'videoonenetadmm', 'rho': 0.3},\n        'videowaveletsparsityadmm': {'mode': 'videowaveletsparsityadmm', 'rho': 0.3, 'lambda_l1': 0.05},\n        'rnn': {'rnn': True},\n        'nornn': {'rnn': False}\n    }\n    return config_mapping.get(config_name, default_config)\n", "entry_point": "get_algorithm_config", "input": "'unknown_config'", "output": "{'mode': 'default'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36133_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017922", "code": "import datetime\ndef get_days_in_previous_month(current_date):\n    year, month, _ = map(int, current_date.split('-'))\n    # Calculate the previous month\n    if month == 1:\n        previous_month = 12\n        previous_year = year - 1\n    else:\n        previous_month = month - 1\n        previous_year = year\n    # Calculate the number of days in the previous month\n    if previous_month in [1, 3, 5, 7, 8, 10, 12]:\n        days_in_previous_month = 31\n    elif previous_month == 2:\n        if previous_year % 4 == 0 and (previous_year % 100 != 0 or previous_year % 400 == 0):\n            days_in_previous_month = 29\n        else:\n            days_in_previous_month = 28\n    else:\n        days_in_previous_month = 30\n    return days_in_previous_month\n", "entry_point": "get_days_in_previous_month", "input": "'2020-03-01'", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21493_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017923", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[5]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017924", "code": "def find_unique_number(nums):\n    unique_num = 0\n    for num in nums:\n        unique_num ^= num\n    return unique_num\n", "entry_point": "find_unique_number", "input": "[2, 2, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126841_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017925", "code": "def second_most_frequent(arr):\n    most_freq = None\n    second_most_freq = None\n    counter = {}\n    second_counter = {}\n    for n in arr:\n        counter.setdefault(n, 0)\n        counter[n] += 1\n        if counter[n] > counter.get(most_freq, 0):\n            second_most_freq = most_freq\n            most_freq = n\n        elif counter[n] > counter.get(second_most_freq, 0) and n != most_freq:\n            second_most_freq = n\n    return second_most_freq\n", "entry_point": "second_most_frequent", "input": "[5, 5, 5, 4, 4, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120689_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017926", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4361", "output": "{1, 7, 4361, 623, 49, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "348", "output": "{1, 2, 3, 4, 6, 12, 174, 116, 87, 58, 348, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt347", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017928", "code": "from typing import List, Tuple\ndef process_numbers(numbers: List[int]) -> Tuple[int, int]:\n    count = 0\n    total_sum = 0\n    for num in numbers:\n        count += 1\n        total_sum += num\n        if num == 999:\n            break\n    return count - 1, total_sum - 999  # Adjusting count and sum for excluding the terminating 999\n", "entry_point": "process_numbers", "input": "[6, 8, 999]", "output": "(2, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24887_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017929", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'howaryouuo'", "output": "{'howaryouuo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017930", "code": "def process_genetic_data(line):\n    def int_no_zero(s):\n        return int(s.lstrip('0')) if s.lstrip('0') else 0\n    indiv_name, marker_line = line.split(',')\n    markers = marker_line.replace('\\t', ' ').split(' ')\n    markers = [marker for marker in markers if marker != '']\n    if len(markers[0]) in [2, 4]:  # 2 digits per allele\n        marker_len = 2\n    else:\n        marker_len = 3\n    try:\n        allele_list = [(int_no_zero(marker[0:marker_len]), int_no_zero(marker[marker_len:]))\n                       for marker in markers]\n    except ValueError:  # Haploid\n        allele_list = [(int_no_zero(marker[0:marker_len]),)\n                       for marker in markers]\n    return indiv_name, allele_list, marker_len\n", "entry_point": "process_genetic_data", "input": "'e,1200'", "output": "('e', [(12, 0)], 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138215_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017931", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'ddddddddd'", "output": "'ddddddddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017932", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9199", "output": "{1, 9199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017933", "code": "def execute_code(code: str) -> str:\n    output = \"\"\n    variables = {}\n    statements = code.split(';')\n    for statement in statements:\n        if statement.strip().startswith('print'):\n            message = statement.split('\"')[1]\n            output += message + '\\n'\n        elif statement.strip().startswith('set'):\n            parts = statement.split('=')\n            var_name = parts[0].split()[-1].strip()\n            var_value = parts[1].strip().strip(';')\n            variables[var_name] = var_value\n    return output\n", "entry_point": "execute_code", "input": "'set w = 10; set x = 20; print(\"hello w, x\");'", "output": "'hello w, x\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52261_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017934", "code": "mod = 10 ** 9 + 7\ndef count_ways(S):\n    A = [0] * (S + 1)\n    A[0] = 1\n    for s in range(3, S + 1):\n        A[s] = (A[s-3] + A[s-1]) % mod\n    return A[S]\n", "entry_point": "count_ways", "input": "7", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7358_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017935", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "163", "output": "{1, 163}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7838", "output": "{1, 2, 7838, 3919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7837", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017937", "code": "def most_frequent_element(sequence):\n    frequency = {}\n    max_freq = 0\n    most_frequent_element = None\n    for num in sequence:\n        if num in frequency:\n            frequency[num] += 1\n        else:\n            frequency[num] = 1\n        if frequency[num] > max_freq:\n            max_freq = frequency[num]\n            most_frequent_element = num\n    return most_frequent_element\n", "entry_point": "most_frequent_element", "input": "[8, 8, 8, 2, 3, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23662_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017938", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'aabdddddd'", "output": "'dddddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017939", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "14, 1, 10", "output": "87178291200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017940", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'pppp roo'", "output": "{'p': 4, 'r': 1, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139810_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017941", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'teextext t'", "output": "{'teextext': 1, 't': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15367_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5253", "output": "{1, 3, 5253, 103, 17, 51, 309, 1751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5252", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017943", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/h/home/./documnt'", "output": "'/h/home/documnt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017944", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[92, 79, 85, 91, 79, 78, 91, 92]", "output": "[78, 79, 79, 85, 91, 91, 92, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "283", "output": "{1, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt282", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017946", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    prev_score = None\n    ranks = []\n    for score in reversed(scores):\n        if score not in rank_dict:\n            if prev_score is not None and score < prev_score:\n                current_rank += 1\n            rank_dict[score] = current_rank\n        ranks.append(rank_dict[score])\n        prev_score = score\n    return ranks[::-1]\n", "entry_point": "calculate_ranks", "input": "[10, 10, 10, 10, 10, 10, 10]", "output": "[1, 1, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9219_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017947", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[2, 1, 4, 2, 2, 1, -1, 4]", "output": "[4, -1, 1, 2, 2, 4, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017948", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "12344", "output": "'0000000000003038'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017949", "code": "def custom_product_list(lst):\n    total_product = 1\n    for num in lst:\n        total_product *= num\n    result = [total_product // num for num in lst]\n    return result\n", "entry_point": "custom_product_list", "input": "[2, 2, 2, 2, 2, 2]", "output": "[32, 32, 32, 32, 32, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81118_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017950", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[8, 100]", "output": "800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017951", "code": "def recursion_binary_search(arr, target):\n    if not arr:\n        return False\n    if len(arr) == 1:\n        return arr[0] == target\n    if target < arr[0] or target > arr[-1]:\n        return False\n    mid = len(arr) // 2\n    if arr[mid] == target:\n        return True\n    elif target < arr[mid]:\n        return recursion_binary_search(arr[:mid], target)\n    else:\n        return recursion_binary_search(arr[mid:], target)\n", "entry_point": "recursion_binary_search", "input": "[3], 3", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48156_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017952", "code": "def count_test_functions(test_functions):\n    device_count = {}\n    for test_func in test_functions:\n        device_type = test_func.split(\"(\")[-1].strip(\"')\\\"\")\n        if device_type in device_count:\n            device_count[device_type] += 1\n        else:\n            device_count[device_type] = 1\n    return device_count\n", "entry_point": "count_test_functions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62607_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017953", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'examp.:443'", "output": "('https', 'examp.', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017954", "code": "def count_common_substrings(s1, s2):\n    g1 = {}\n    for i in range(1, len(s1)):\n        g1[s1[i-1: i+1]] = g1.get(s1[i-1: i+1], 0) + 1\n    g2 = set()\n    for i in range(1, len(s2)):\n        g2.add(s2[i-1: i+1])\n    common_substrings = frozenset(g1.keys()) & g2\n    total_count = sum([g1[g] for g in common_substrings])\n    return total_count\n", "entry_point": "count_common_substrings", "input": "'abab', 'ab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53680_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017955", "code": "def get_storage_type(storage_path):\n    if storage_path.startswith(\"s3:\"):\n        return \"s3\"\n    elif storage_path.startswith(\"local:\"):\n        return \"local\"\n    else:\n        return \"Unknown\"\n", "entry_point": "get_storage_type", "input": "'s3:example'", "output": "'s3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80794_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017956", "code": "def find_equal(lst):\n    seen = {}  # Dictionary to store elements and their indices\n    for i, num in enumerate(lst):\n        if num in seen:\n            return (seen[num], i)  # Return the indices of the first pair of equal elements\n        seen[num] = i\n    return None  # Return None if no pair of equal elements is found\n", "entry_point": "find_equal", "input": "[1, 5, 2, 3, 5]", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51954_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017957", "code": "def generate_pascals_triangle(num_rows):\n    triangle = []\n    for row in range(num_rows):\n        current_row = []\n        for col in range(row + 1):\n            if col == 0 or col == row:\n                current_row.append(1)\n            else:\n                current_row.append(triangle[row - 1][col - 1] + triangle[row - 1][col])\n        triangle.append(current_row)\n    return triangle\n", "entry_point": "generate_pascals_triangle", "input": "3", "output": "[[1], [1, 1], [1, 2, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110086_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017958", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "100, 3.8, 70", "output": "962.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017959", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4179", "output": "{1, 3, 7, 199, 1393, 4179, 597, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017960", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[0, 4, 4, 8, 8, 8, 5, 1]", "output": "[0, 4, 4, 8, 8, 8, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017961", "code": "import re\nfrom collections import Counter\ndef most_common_word(s: str) -> str:\n    # Preprocess the input string\n    s = re.sub(r'[^\\w\\s]', '', s.lower())\n    # Split the string into words\n    words = s.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Find the most common word\n    most_common = max(word_freq, key=word_freq.get)\n    return most_common\n", "entry_point": "most_common_word", "input": "'Hello! hello there. Hello everyone!'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23655_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017962", "code": "def count_sublists_with_non_zero_or_negative_elements(gt):\n    count = 0\n    for sublist in gt:\n        for element in sublist:\n            if element != 0 and element != -1:\n                count += 1\n                break\n    return count\n", "entry_point": "count_sublists_with_non_zero_or_negative_elements", "input": "[[2], [-1], [0]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70406_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017963", "code": "import time\nSHUNT_OHMS = 0.1\nMAX_EXPECTED_AMPS = 0.2\ndef calculate_power_consumption(current_amps):\n    voltage_drop = current_amps * SHUNT_OHMS\n    power_consumption = current_amps * voltage_drop\n    return power_consumption\n", "entry_point": "calculate_power_consumption", "input": "0.15", "output": "0.00225", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31409_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017964", "code": "def can_form_palindrome(s: str) -> bool:\n    a_pointer, b_pointer = 0, len(s) - 1\n    while a_pointer <= b_pointer:\n        if s[a_pointer] != s[b_pointer]:\n            s1 = s[:a_pointer] + s[a_pointer + 1:]\n            s2 = s[:b_pointer] + s[b_pointer - 1:]\n            return s1 == s1[::-1] or s2 == s2[::-1]\n        a_pointer += 1\n        b_pointer -= 1\n    return True\n", "entry_point": "can_form_palindrome", "input": "'abca'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017965", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "5, 8", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017966", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'ph2ppattah'", "output": "'Content for ph2ppattah'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017967", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[100, 100, 90, 80, 70]", "output": "[1, 1, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017968", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8629", "output": "{1, 8629}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017969", "code": "def count_file_codes(codes):\n    file_code_counts = {}\n    for file_data in codes:\n        file_path = file_data['file']\n        file_codes = file_data['codes']\n        unique_codes = set(file_codes)\n        code_count = len(unique_codes)\n        file_code_counts[file_path] = code_count\n    return file_code_counts\n", "entry_point": "count_file_codes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35492_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017970", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'Smth is great', 4", "output": "'Smth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017971", "code": "def simulate_game(grid, instructions):\n    m, n = len(grid), len(grid[0])\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    x, y = 0, 0  # Initial position\n    for move in instructions:\n        dx, dy = directions[move]\n        new_x, new_y = x + dx, y + dy\n        if 0 <= new_x < m and 0 <= new_y < n and grid[new_x][new_y] == 0:\n            x, y = new_x, new_y\n    return x, y\n", "entry_point": "simulate_game", "input": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]], 'DDRR'", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90203_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017972", "code": "def convertToZigZag(s, numRows):\n    if numRows == 1:\n        return s\n    cycle = 2 * (numRows - 1)\n    zigzag_map = ['' for _ in range(numRows)]\n    for i in range(len(s)):\n        mod = i % cycle\n        row = mod if mod < numRows else 2 * (numRows - 1) - mod\n        zigzag_map[row] += s[i]\n    result = ''.join(zigzag_map)\n    return result\n", "entry_point": "convertToZigZag", "input": "'PAYPALISHIRING', 3", "output": "'PAHNAPLSIIGYIR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12827_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017973", "code": "import ast\ndef extract_default_app_config(code_snippet):\n    # Parse the code snippet as an abstract syntax tree (AST)\n    tree = ast.parse(code_snippet)\n    # Find the assignment node for default_app_config\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign) and len(node.targets) == 1:\n            target = node.targets[0]\n            if isinstance(target, ast.Name) and target.id == 'default_app_config':\n                value_node = node.value\n                if isinstance(value_node, ast.Str):\n                    return value_node.s\n    return None\n", "entry_point": "extract_default_app_config", "input": "\"default_app_config = 'my_default_config'\"", "output": "'my_default_config'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3187_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8462", "output": "{1, 2, 8462, 4231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8461", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017975", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'322.50.52'", "output": "(322, 50, 52, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017976", "code": "def parse_response(response):\n    key_value_pairs = response.split(',')\n    for pair in key_value_pairs:\n        key, value = pair.split('=')\n        if key.strip() == 'token':\n            return value.strip()\n    return None  # Return None if the key \"token\" is not found in the response\n", "entry_point": "parse_response", "input": "'user=admin, token=test'", "output": "'test'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108561_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7019", "output": "{1, 7019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9579", "output": "{1, 3, 103, 9579, 309, 3193, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017979", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'iThist.ss'", "output": "'iThist.ss'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017980", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'\\n'", "output": "([], [''])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5322", "output": "{1, 2, 3, 2661, 6, 5322, 1774, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5321", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017982", "code": "from typing import List, Tuple, Any, Dict\ndef convert_settings(settings_list: List[Tuple[str, Any]]) -> Dict[str, Any]:\n    settings_dict = {}\n    for key, value in settings_list:\n        settings_dict[key] = value\n    return settings_dict\n", "entry_point": "convert_settings", "input": "[('color', 'blue'), ('size', 'large')]", "output": "{'color': 'blue', 'size': 'large'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139910_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017983", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5144", "output": "{1, 2, 643, 4, 1286, 8, 2572, 5144}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5143", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017984", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7407", "output": "{1, 3, 2469, 9, 7407, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017985", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'hbo.com/'", "output": "'hbo.com/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017986", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017987", "code": "def process_job_names(on_queue: str) -> dict:\n    job_names = on_queue.splitlines()\n    unique_job_names = set()\n    longest_job_name = ''\n    for job_name in job_names:\n        unique_job_names.add(job_name.strip())\n        if len(job_name) > len(longest_job_name):\n            longest_job_name = job_name.strip()\n    return {'unique_count': len(unique_job_names), 'longest_job_name': longest_job_name}\n", "entry_point": "process_job_names", "input": "'  job4\\n  job4 \\njob4\\n'", "output": "{'unique_count': 1, 'longest_job_name': 'job4'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132971_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017988", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'+'", "output": "['+']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017989", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "3.003, 15.0, 10.0", "output": "75.075", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017990", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "2, [3, 0, 0, 3]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017991", "code": "def calculate_average_grade(grades):\n    grade_values = {'A': 95, 'B': 85, 'C': 75, 'D': 65, 'F': 30}  # Mapping of grades to numerical values\n    total_grade = sum(grade_values.get(grade, 0) for grade in grades)\n    average_grade = total_grade / len(grades)\n    if 90 <= average_grade <= 100:\n        letter_grade = 'A'\n    elif 80 <= average_grade < 90:\n        letter_grade = 'B'\n    elif 70 <= average_grade < 80:\n        letter_grade = 'C'\n    elif 60 <= average_grade < 70:\n        letter_grade = 'D'\n    else:\n        letter_grade = 'F'\n    return average_grade, letter_grade\n", "entry_point": "calculate_average_grade", "input": "['F', 'F', 'F', 'F', 'F']", "output": "(30.0, 'F')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101290_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017992", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[3, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017993", "code": "def validate_constants(constants_dict):\n    expected_values = {'UNKNOWN': 0, 'INFO': 1, 'LOW': 2, 'MEDIUM': 3, 'HIGH': 4}\n    for constant, expected_value in expected_values.items():\n        if constants_dict.get(constant) != expected_value:\n            return False\n    return True\n", "entry_point": "validate_constants", "input": "{'UNKNOWN': 0, 'HIGH': 5}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62091_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017994", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[-1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017995", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 7, 2, 3, 0, 0, 7, 0]", "output": "[3, 8, 4, 6, 4, 5, 13, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1204", "output": "{1, 2, 4, 7, 43, 172, 301, 14, 1204, 86, 602, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1203", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017997", "code": "def count_divisible_pairs(n):\n    count = 0\n    for a in range(n):\n        for b in range(a+1, n):\n            if (a + b) % n == 0:\n                count += 1\n    return count\n", "entry_point": "count_divisible_pairs", "input": "3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30636_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017998", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[1, 2, 2, 3, 3, 4, 5, 5]", "output": "{1: 1, 2: 2, 3: 2, 4: 1, 5: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0017999", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'po3,4])'", "output": "'po3,4])'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018000", "code": "def calculate_scores(scores):\n    n = len(scores)\n    calculated_scores = []\n    for i in range(n):\n        if i == 0:\n            new_score = scores[i] + scores[i + 1]\n        elif i == n - 1:\n            new_score = scores[i] + scores[i - 1]\n        else:\n            new_score = scores[i - 1] + scores[i] + scores[i + 1]\n        calculated_scores.append(new_score)\n    return calculated_scores\n", "entry_point": "calculate_scores", "input": "[10, 10, 7, 2, 6, 6, 6]", "output": "[20, 27, 19, 15, 14, 18, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90567_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018001", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[39]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018002", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'2', '3', 'cpu'", "output": "'2.3-cpu-ml-scala2.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5522", "output": "{1, 2, 2761, 11, 5522, 502, 22, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018004", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'w!!'", "output": "'w!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018005", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'path/to/folder/fiet'", "output": "'fiet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018006", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[8, 3, 8, 4, 7, 7]", "output": "[8, 3, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018007", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[3, 7, 7, 9]", "output": "[81, 49, 49, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018008", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'INVALID_STATE', 'any_action'", "output": "'INVALID_STATE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018009", "code": "def calculate_metrics(predicts, golds):\n    true_predict = 0\n    true = 0\n    predict = 0\n    for i in range(len(predicts)):\n        if predicts[i] == 1:\n            predict += 1\n        if golds[i] == 1:\n            true += 1\n        if predicts[i] == 1 and golds[i] == 1:\n            true_predict += 1\n    precision = (true_predict + 0.0) / (predict + 0.0) if predict > 0 else 0\n    recall = (true_predict + 0.0) / (true + 0.0) if true > 0 else 0\n    f1 = (2 * precision * recall) / (precision + recall) if predict > 0 and true > 0 else 0\n    return precision, recall, f1\n", "entry_point": "calculate_metrics", "input": "[0, 0, 0], [0, 0, 0]", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11471_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018010", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[58, 60]", "output": "118", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018011", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2872", "output": "{1, 2, 4, 359, 8, 718, 2872, 1436}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2871", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018012", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "8", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018013", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018014", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'examplexamme.json'", "output": "'examplexamme_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3311", "output": "{1, 7, 11, 43, 301, 77, 3311, 473}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018016", "code": "from typing import List, Tuple\ndef process_files(file_list: List[str]) -> Tuple[List[str], List[str]]:\n    valid_files = []\n    invalid_files = []\n    for file_name in file_list:\n        if file_name.split('-')[0].isdigit() and len(file_name.split('-')[0]) == 4 and file_name.endswith(\".yaml\"):\n            valid_files.append(file_name)\n        else:\n            invalid_files.append(file_name)\n    return valid_files, invalid_files\n", "entry_point": "process_files", "input": "[]", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10284_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6169", "output": "{1, 199, 6169, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018018", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[81, 81, 80, 80, 79]", "output": "80.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018019", "code": "def process_choices(choices):\n    result = {}\n    count = {}\n    for choice, display_name in choices:\n        if display_name in result:\n            if display_name in count:\n                count[display_name] += 1\n            else:\n                count[display_name] = 1\n            new_display_name = f\"{display_name}_{count[display_name]}\"\n            result[display_name].append(choice)\n            result[new_display_name] = [choice]\n        else:\n            result[display_name] = [choice]\n    return result\n", "entry_point": "process_choices", "input": "[('Drink', 'Coffee')]", "output": "{'Coffee': ['Drink']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104982_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018020", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'PAXUSDC'", "output": "('PAX', 'USDC')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018021", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "324", "output": "342", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018022", "code": "def search(s: str, pattern: str) -> int:\n    if len(s) < len(pattern):\n        return 0\n    if s[:len(pattern)] == pattern:\n        return 1 + search(s[len(pattern):], pattern)\n    else:\n        return search(s[1:], pattern)\n", "entry_point": "search", "input": "'abcabcabc', 'abc'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118249_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018023", "code": "def ltof(values):\n    \"\"\"\n    Converts the special integer-encoded doubles back into Python floats.\n    Args:\n    values (list or tuple): List of integer-encoded doubles.\n    Returns:\n    list: List of corresponding Python floats.\n    \"\"\"\n    assert isinstance(values, (tuple, list)), \"Input must be a list or tuple\"\n    return [int(val) / 1000. for val in values]\n", "entry_point": "ltof", "input": "[1000, 1249, 1249, 1000]", "output": "[1.0, 1.249, 1.249, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144669_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018024", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('a') if char.islower() else ord('A')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'abk', 2", "output": "'cdm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35219_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018025", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "3, 5, 13", "output": "0.8666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018026", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 8, 3, 6, 8, 9, 8]", "output": "[8, 6, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3868", "output": "{1, 2, 4, 967, 1934, 3868}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3867", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8803", "output": "{1, 8803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5206", "output": "{1, 2, 38, 137, 2603, 274, 19, 5206}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018030", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 93, 85, 90, 100, 80]", "output": "[100, 93, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8412_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018031", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[3, 5, 8, 2, 1]", "output": "(8, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018032", "code": "def remove_stop_words(search_term, stop_words):\n    # Split the search term into individual words\n    words = search_term.split()\n    # Filter out stop words from the list of words\n    filtered_words = [word for word in words if word.lower() not in stop_words]\n    # Join the remaining words back into a single string\n    filtered_search_term = ' '.join(filtered_words)\n    return filtered_search_term\n", "entry_point": "remove_stop_words", "input": "'hello dogovon world', {'hello', 'world'}", "output": "'dogovon'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79133_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018033", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 8", "output": "5764801", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt41", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018034", "code": "def validate_dataset(doc):\n    \"\"\"Check the document for errors and mistakes.\"\"\"\n    if 'variables' not in doc or not isinstance(doc['variables'], list) or not doc['variables']:\n        return False\n    for var in doc['variables']:\n        if not isinstance(var, dict) or 'title' not in var or 'class' not in var:\n            return False\n    if 'description' not in doc:\n        return False\n    return True\n", "entry_point": "validate_dataset", "input": "{'description': 'This is a dataset.'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51778_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018035", "code": "from typing import Union\ndef validate_hyperparameters(config: dict) -> dict:\n    valid_hyperparameters = {\n        'output_dir': str,\n        'batch_size': int,\n        'max_epochs': int,\n        'learning_rate': float,\n        'train_early_stopping': Union[int, type(None)],\n        'eval_early_stopping': Union[int, type(None)],\n        'steps_saving': Union[int, type(None)],\n        'seed': int,\n        'no_cuda': bool,\n        'verbose': bool\n    }\n    valid_config = {}\n    for key, value_type in valid_hyperparameters.items():\n        if key in config and isinstance(config[key], value_type):\n            valid_config[key] = config[key]\n    return valid_config\n", "entry_point": "validate_hyperparameters", "input": "{'random_key': 'some_value'}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107822_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018036", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 6, 9, 12, 15, 18]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50473_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018037", "code": "def reconstruct_string(char_counts):\n    char_map = {chr(ord('a') + i): count for i, count in enumerate(char_counts)}\n    sorted_char_map = dict(sorted(char_map.items(), key=lambda x: x[1]))\n    result = ''\n    for char, count in sorted_char_map.items():\n        result += char * count\n    return result\n", "entry_point": "reconstruct_string", "input": "[3, 3, 3, 0, 2, 3] + [0] * 20", "output": "'eeaaabbbcccfff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66252_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018038", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[50, 30, -1, 28]", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018039", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 7, 7]", "output": "[7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "494", "output": "{1, 2, 38, 13, 494, 19, 247, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018041", "code": "import re\ndef extract_version_number(file_content: str) -> str:\n    version_pattern = r\"__version__ = '[\\d\\.]+'\"\n    version_match = re.search(version_pattern, file_content)\n    if version_match:\n        version_number = version_match.group(0).split(\"'\")[1]\n        return version_number\n    else:\n        return \"Version number not found.\"\n", "entry_point": "extract_version_number", "input": "'This is just a text without a version.'", "output": "'Version number not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75014_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018042", "code": "def count_unique_subsets(nums):\n    total_subsets = 0\n    n = len(nums)\n    for i in range(1, 2**n):\n        subset = [nums[j] for j in range(n) if (i >> j) & 1]\n        if subset:  # Ensure subset is not empty\n            total_subsets += 1\n    return total_subsets\n", "entry_point": "count_unique_subsets", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "255", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53823_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018043", "code": "def remove_consecutive_duplicates(s: str) -> str:\n    results = []\n    for c in s:\n        if len(results) == 0 or results[-1] != c:\n            results.append(c)\n    return \"\".join(results)\n", "entry_point": "remove_consecutive_duplicates", "input": "'bbcceddeff'", "output": "'bcedef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101236_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "377", "output": "{1, 29, 13, 377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018045", "code": "import uuid\ndef generate_product_uuid(existing_uuid):\n    # Convert the existing UUID to uppercase\n    existing_uuid_upper = existing_uuid.upper()\n    # Add the prefix 'PROD_' to the uppercase UUID\n    modified_uuid = 'PROD_' + existing_uuid_upper\n    return modified_uuid\n", "entry_point": "generate_product_uuid", "input": "'4544504'", "output": "'PROD_4544504'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91223_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018046", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "'\u043f'", "output": "[16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018047", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[0]", "output": "[(0,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018048", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[0, 1, 4, 7, 8, 9, 6]", "output": "(35, 7, 0, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018049", "code": "# Constants\nMENLO_QUEUE_COMPONENT_CPU = \"cpu\"\nMENLO_QUEUE_COMPONENT_ETH = \"eth\"\nMENLO_QUEUE_COMPONENT_FC = \"fc\"\nMENLO_QUEUE_COMPONENT_UNKNOWN = \"unknown\"\nMENLO_QUEUE_INDEX_0 = \"0\"\nMENLO_QUEUE_INDEX_0_A = \"0_A\"\nMENLO_QUEUE_INDEX_0_B = \"0_B\"\nMENLO_QUEUE_INDEX_1 = \"1\"\nMENLO_QUEUE_INDEX_1_A = \"1_A\"\nMENLO_QUEUE_INDEX_1_B = \"1_B\"\nMENLO_QUEUE_INDEX_UNKNOWN = \"unknown\"\nSUSPECT_FALSE = \"false\"\nSUSPECT_NO = \"no\"\nSUSPECT_TRUE = \"true\"\nSUSPECT_YES = \"yes\"\n# Function to determine suspiciousness\ndef is_suspicious(component, index):\n    if (component == MENLO_QUEUE_COMPONENT_CPU and (index == MENLO_QUEUE_INDEX_0_A or index == MENLO_QUEUE_INDEX_1_B)) or \\\n       (component == MENLO_QUEUE_COMPONENT_ETH and (index == MENLO_QUEUE_INDEX_0 or index == MENLO_QUEUE_INDEX_1)) or \\\n       (component == MENLO_QUEUE_COMPONENT_FC and index == MENLO_QUEUE_INDEX_UNKNOWN):\n        return SUSPECT_TRUE\n    else:\n        return SUSPECT_FALSE\n", "entry_point": "is_suspicious", "input": "'cpu', '0_A'", "output": "'true'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2702_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018050", "code": "def radix_sort(array):\n    base = 10  # Base 10 for decimal integers\n    max_val = max(array)\n    col = 0\n    while max_val // 10 ** col > 0:\n        count_array = [0] * base\n        position = [0] * base\n        output = [0] * len(array)\n        for elem in array:\n            digit = elem // 10 ** col\n            count_array[digit % base] += 1\n        position[0] = 0\n        for i in range(1, base):\n            position[i] = position[i - 1] + count_array[i - 1]\n        for elem in array:\n            output[position[elem // 10 ** col % base]] = elem\n            position[elem // 10 ** col % base] += 1\n        array = output\n        col += 1\n    return output\n", "entry_point": "radix_sort", "input": "[24, 45, 90, 801]", "output": "[24, 45, 90, 801]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60721_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5126", "output": "{1, 2, 2563, 5126, 233, 11, 466, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018052", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8786", "output": "{1, 2, 4393, 46, 8786, 23, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018053", "code": "JIRA_DOMAIN = {'RD2': ['innodiv-hwacom.atlassian.net','innodiv-hwacom.atlassian.net'],\n               'RD5': ['srddiv5-hwacom.atlassian.net']}\nAPI_PREFIX  = 'rest/agile/1.0'\nSTORY_POINT_COL_NAME = {'10005': 'customfield_10027',\n                        '10006': 'customfield_10027',\n                        '10004': 'customfield_10026'\n}\ndef get_story_point_custom_field(project_id, issue_id):\n    if project_id in STORY_POINT_COL_NAME:\n        if issue_id in STORY_POINT_COL_NAME[project_id]:\n            return STORY_POINT_COL_NAME[project_id][issue_id]\n    return \"Not found\"\n", "entry_point": "get_story_point_custom_field", "input": "'99999', '10005'", "output": "'Not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37549_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018054", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "'og:title=T!'", "output": "{'og:title': 'T!'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018055", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'15 Sep 2012'", "output": "'Sep 15, 2012'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "623", "output": "{89, 1, 7, 623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018057", "code": "import re\nfrom typing import List\ndef _splitter(text: str) -> List[str]:\n    if len(text) == 0:\n        return []\n    if \"'\" not in text:\n        return [text]\n    return re.findall(\"'([^']+)'\", text)\n", "entry_point": "_splitter", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84189_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018058", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "1.8800000000000003", "output": "1880000000000000337", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6418", "output": "{1, 6418, 2, 3209}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6417", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018060", "code": "def process_revision(revision):\n    # Extract the first 6 characters of the revision string in reverse order\n    key = revision[:6][::-1]\n    # Update the down_revision variable with the extracted value\n    global down_revision\n    down_revision = key\n    return down_revision\n", "entry_point": "process_revision", "input": "'0b7cc0xyz'", "output": "'0cc7b0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39423_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "875", "output": "{1, 35, 5, 7, 875, 175, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018062", "code": "def count_player1_wins(cases):\n    player1_wins = 0\n    for outcome in cases:\n        if outcome == 'p1_wins':\n            player1_wins += 1\n        elif outcome == 'p1_and_p2_win':\n            player1_wins += 1  # Player 1 also wins in this case\n    return player1_wins\n", "entry_point": "count_player1_wins", "input": "['p1_wins', 'p1_wins', 'p1_and_p2_win', 'p1_and_p2_win']", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141851_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018063", "code": "import math\ndef calculate_total_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i]\n        x2, y2 = points[i + 1]\n        length = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n        total_length += length\n    return total_length\n", "entry_point": "calculate_total_length", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3574_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8741", "output": "{1, 8741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018065", "code": "def extract_text(input_text: str) -> str:\n    parts = input_text.split('<!DOCTYPE html>', 1)\n    return parts[0] if len(parts) > 1 else input_text\n", "entry_point": "extract_text", "input": "'first<!DOCTYPE html>'", "output": "'first'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21287_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018066", "code": "import re\nBLOCKED_KEYWORDS = [\"apple\", \"banana\", \"orange\"]\ndef replace_blocked_keywords(text):\n    modified_text = text.lower()\n    for keyword in BLOCKED_KEYWORDS:\n        modified_text = re.sub(r'\\b' + re.escape(keyword) + r'\\b', '*' * len(keyword), modified_text, flags=re.IGNORECASE)\n    return modified_text\n", "entry_point": "replace_blocked_keywords", "input": "'I like grapes'", "output": "'i like grapes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141680_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018067", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[2, 5]", "output": "150.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018068", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'3.2.10'", "output": "(3, 2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1954", "output": "{1, 1954, 2, 977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1953", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4723", "output": "{1, 4723}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018071", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8125", "output": "{1, 65, 5, 325, 13, 625, 125, 1625, 8125, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8124", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018072", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "16", "output": "[1, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018073", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    n = len(scores)\n    dp = [0] * n\n    dp[0] = scores[0]\n    for i in range(1, n):\n        if scores[i] > scores[i - 1]:\n            dp[i] = max(dp[i], dp[i - 1] + scores[i])\n        else:\n            dp[i] = dp[i - 1]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[5, 10, 12]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127370_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018074", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[2, 6, 3, 7]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018075", "code": "def generate_combinations(chars):\n    result = []\n    def generate(combination, remaining_chars, index):\n        if combination:\n            result.append(combination)\n        for i in range(index, len(remaining_chars)):\n            generate(combination + remaining_chars[i], remaining_chars, i + 1)\n    generate('', chars, 0)\n    return result\n", "entry_point": "generate_combinations", "input": "'abc'", "output": "['a', 'ab', 'abc', 'ac', 'b', 'bc', 'c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127744_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018076", "code": "def find_equal(lst):\n    seen = {}  # Dictionary to store elements and their indices\n    for i, num in enumerate(lst):\n        if num in seen:\n            return (seen[num], i)  # Return the indices of the first pair of equal elements\n        seen[num] = i\n    return None  # Return None if no pair of equal elements is found\n", "entry_point": "find_equal", "input": "[10, 5, 20, 5]", "output": "(1, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51954_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018077", "code": "def convert_risk_to_chinese(risk):\n    risk_mapping = {\n        'None': 'None',\n        'Low': '\u4f4e\u5371',\n        'Medium': '\u4e2d\u5371',\n        'High': '\u9ad8\u5371',\n        'Critical': '\u4e25\u91cd'\n    }\n    return risk_mapping.get(risk, 'Unknown')  # Return the Chinese risk level or 'Unknown' if not found\n", "entry_point": "convert_risk_to_chinese", "input": "'None'", "output": "'None'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46692_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018078", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8306", "output": "{1, 8306, 2, 4153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018079", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[8, 5, 7, 9, 9, 11, 11]", "output": "[16, 25, 49, 81, 81, 121, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018080", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[0, 2, 0, 5, 4, 1]", "output": "[2, 2, 5, 9, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018081", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[4, 3, 6, 2, 4, 6, 4]", "output": "[7, 9, 8, 6, 10, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018082", "code": "import math\ndef count_unique_sizes(determinants):\n    unique_sizes = set()\n    for det in determinants:\n        size = int(math.sqrt(det))\n        unique_sizes.add(size)\n    return len(unique_sizes)\n", "entry_point": "count_unique_sizes", "input": "[0, 1, 16]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74244_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018083", "code": "def count_file_extensions(file_extensions):\n    extension_count = {}\n    for ext in file_extensions:\n        ext_lower = ext.lower()\n        extension_count[ext_lower] = extension_count.get(ext_lower, 0) + 1\n    return extension_count\n", "entry_point": "count_file_extensions", "input": "['txt', 'jpg']", "output": "{'txt': 1, 'jpg': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137202_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9237", "output": "{1, 3, 9237, 3079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018085", "code": "def repeat_elements(lst, n):\n    result = []\n    for num in lst:\n        for _ in range(n):\n            result.append(num)\n    return result\n", "entry_point": "repeat_elements", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45000_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4671", "output": "{1, 3, 519, 9, 173, 1557, 27, 4671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018087", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://example.com/image.jpg_150x150'", "output": "'https://example.com/image.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018088", "code": "def process_revision(revision):\n    # Extract the first 6 characters of the revision string in reverse order\n    key = revision[:6][::-1]\n    # Update the down_revision variable with the extracted value\n    global down_revision\n    down_revision = key\n    return down_revision\n", "entry_point": "process_revision", "input": "'0b7ccf'", "output": "'fcc7b0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39423_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018089", "code": "def modify_template_name(template_name: str) -> str:\n    # Trim leading and trailing whitespace, convert to lowercase, and return\n    return template_name.strip().lower()\n", "entry_point": "modify_template_name", "input": "'mytemymyt'", "output": "'mytemymyt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116239_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2553", "output": "{1, 3, 37, 69, 111, 851, 23, 2553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018091", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[60]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018092", "code": "import math\ndef min_sum_pair(n):\n    dist = n\n    for i in range(1, math.floor(math.sqrt(n)) + 1):\n        if n % i == 0:\n            j = n // i\n            dist = min(dist, i + j - 2)\n    return dist\n", "entry_point": "min_sum_pair", "input": "8", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134268_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018093", "code": "def construct_path(path: str, name: str) -> str:\n    if path.endswith(\"/\"):\n        path = path[:-1]\n    if name.startswith(\"/\"):\n        name = name[1:]\n    return f\"{path}/{name}\"\n", "entry_point": "construct_path", "input": "'/homoe/', 'uuseserujamsuseuuese'", "output": "'/homoe/uuseserujamsuseuuese'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82517_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "401", "output": "{1, 401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018095", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2651", "output": "{11, 1, 2651, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2650", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "301", "output": "{1, 43, 301, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018097", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'ppackage'", "output": "'ppackage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018098", "code": "from typing import List\ndef format_table(table: List[List[str]]) -> str:\n    column_widths = [max(len(cell) for cell in col) for col in zip(*table)]\n    formatted_table = []\n    horizontal_line = '+-' + '-+-'.join('-' * width for width in column_widths) + '-+'\n    formatted_table.append(horizontal_line)\n    for row in table:\n        formatted_row = '| ' + ' | '.join(cell.ljust(width) for cell, width in zip(row, column_widths)) + ' |'\n        formatted_table.append(formatted_row)\n    formatted_table.append(horizontal_line)\n    return '\\n'.join(formatted_table)\n", "entry_point": "format_table", "input": "[['']]", "output": "'+--+\\n|  |\\n+--+'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94193_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018099", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8731", "output": "{1, 8731}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018100", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "14", "output": "395136", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018101", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3763", "output": "{1, 3763, 53, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018102", "code": "def calculate_total_cost(output):\n    total_cost = 0\n    lines = output.strip().split('\\n')\n    for line in lines:\n        cost_str = line.split()[1].split('@')[0]\n        total_cost += int(cost_str)\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "'ItemA 12@any_info'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1054_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5416", "output": "{1, 2, 4, 677, 5416, 8, 1354, 2708}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5415", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018104", "code": "from typing import List\ndef maximize_min_distance(a: List[int], M: int) -> int:\n    a.sort()\n    def is_ok(mid):\n        last = a[0]\n        count = 1\n        for i in range(1, len(a)):\n            if a[i] - last >= mid:\n                count += 1\n                last = a[i]\n        return count >= M\n    left, right = 0, a[-1] - a[0]\n    while left < right:\n        mid = (left + right + 1) // 2\n        if is_ok(mid):\n            left = mid\n        else:\n            right = mid - 1\n    return left\n", "entry_point": "maximize_min_distance", "input": "[1, 4, 7, 10], 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125115_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018105", "code": "SDL_HAT_CENTERED = 0x00\nSDL_HAT_UP = 0x01\nSDL_HAT_RIGHT = 0x02\nSDL_HAT_DOWN = 0x04\nSDL_HAT_LEFT = 0x08\nSDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP\nSDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN\nSDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP\nSDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN\ndef simulate_joystick_movement(current_position, direction):\n    if direction == 'UP':\n        return SDL_HAT_UP if current_position not in [SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_LEFTUP] else current_position\n    elif direction == 'RIGHT':\n        return SDL_HAT_RIGHT if current_position not in [SDL_HAT_RIGHT, SDL_HAT_RIGHTUP, SDL_HAT_RIGHTDOWN] else current_position\n    elif direction == 'DOWN':\n        return SDL_HAT_DOWN if current_position not in [SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN, SDL_HAT_LEFTDOWN] else current_position\n    elif direction == 'LEFT':\n        return SDL_HAT_LEFT if current_position not in [SDL_HAT_LEFT, SDL_HAT_LEFTUP, SDL_HAT_LEFTDOWN] else current_position\n    else:\n        return current_position\n", "entry_point": "simulate_joystick_movement", "input": "0, 'DOWN'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77291_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018106", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'Lis**t'", "output": "'Lis**t\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018107", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'hhhhle'", "output": "{'h': 4, 'l': 1, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84684_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1701", "output": "{1, 3, 1701, 7, 9, 81, 243, 21, 567, 27, 189, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018109", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 0, 0, 0], [26, 0, 0, 0]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018110", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[3, 4], [2, 1, [2]]]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt20", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2973", "output": "{1, 3, 2973, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6836", "output": "{1, 2, 4, 1709, 6836, 3418}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6835", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018113", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(1, 2), (1, 3), (2, 4), (2, 6), (3, 5)]", "output": "{1: [2, 3], 2: [4, 6], 3: [5]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018114", "code": "def generate_down_revision(revision):\n    down_revision = revision[::-1].lower()\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'89E'", "output": "'e98'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7052_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018115", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'whellloorld'", "output": "['whellloorld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018116", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[2, 4, 8]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018117", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'unknown_dataset', 229", "output": "229", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018118", "code": "def most_accessed_memory_address(memory_addresses):\n    address_count = {}\n    for address in memory_addresses:\n        if address in address_count:\n            address_count[address] += 1\n        else:\n            address_count[address] = 1\n    max_count = max(address_count.values())\n    most_accessed_addresses = [address for address, count in address_count.items() if count == max_count]\n    return min(most_accessed_addresses)\n", "entry_point": "most_accessed_memory_address", "input": "[19, 19, 19, 20, 20]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123494_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018119", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[6, 3, 3, 5]", "output": "{6: 1, 3: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018120", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[3, 3, 2, 2, 2, 2, 2, 2]", "output": "[3, 3, 2, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "158", "output": "{1, 2, 158, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018122", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[3, 4, 3, 4, 6, 8, 0, 9]", "output": "[5, 5, 10, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018123", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "'\"PyWt\"'", "output": "'PyWt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018124", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "9", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018125", "code": "def replace_digits(s: str) -> str:\n    result = []\n    prev_char = ''\n    for i, char in enumerate(s):\n        if char.isdigit():\n            result.append(chr(ord(prev_char) + int(char)))\n        else:\n            result.append(char)\n        prev_char = char\n    return ''.join(result)\n", "entry_point": "replace_digits", "input": "'a1'", "output": "'ab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43946_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1387", "output": "{19, 1, 1387, 73}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018127", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "1, 3", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018128", "code": "# Constants for data types\nB3_UTF8 = \"UTF8\"\nB3_BOOL = \"BOOL\"\nB3_SVARINT = \"SVARINT\"\nB3_COMPOSITE_DICT = \"COMPOSITE_DICT\"\nB3_COMPOSITE_LIST = \"COMPOSITE_LIST\"\nB3_FLOAT64 = \"FLOAT64\"\ndef detect_data_type(obj):\n    if isinstance(obj, str):\n        return B3_UTF8\n    if obj is True or obj is False:\n        return B3_BOOL\n    if isinstance(obj, int):\n        return B3_SVARINT\n    if isinstance(obj, dict):\n        return B3_COMPOSITE_DICT\n    if isinstance(obj, list):\n        return B3_COMPOSITE_LIST\n    if isinstance(obj, float):\n        return B3_FLOAT64\n    if PY2 and isinstance(obj, long):\n        return B3_SVARINT\n    return \"Unknown\"\n", "entry_point": "detect_data_type", "input": "{}", "output": "'COMPOSITE_DICT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49151_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018129", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[90, 91, 92, 90, 91]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018130", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[0, 0, 4, 4, 1, 1]", "output": "[0, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018131", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[2, 2, 0, 4, 0, 4, 4, 2]", "output": "[4, 2, 4, 4, 4, 8, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018132", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5771", "output": "{1, 5771, 29, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018133", "code": "def calculate_discounted_price(costs, discounts, rebate_factor):\n    total_cost = sum(costs)\n    total_discount = sum(discounts)\n    final_price = (total_cost - total_discount) * rebate_factor\n    if final_price < 0:\n        return 0\n    else:\n        return round(final_price, 2)\n", "entry_point": "calculate_discounted_price", "input": "[15, 15], [10, 9.92], 1.0", "output": "10.08", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12135_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7689", "output": "{1, 33, 2563, 3, 7689, 233, 11, 699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018135", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "-2", "output": "-20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018136", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'99.0.0'", "output": "'99.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018137", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8374", "output": "{1, 2, 106, 79, 53, 8374, 4187, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018138", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'string_value_Hi'", "output": "'Hi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018139", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[20, 30, 27]", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018140", "code": "def extract_file_extension(file_path):\n    # Find the last occurrence of the dot ('.') in the file path\n    dot_index = file_path.rfind('.')\n    # Check if a dot was found and the dot is not at the end of the file path\n    if dot_index != -1 and dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character after the last dot\n        return file_path[dot_index + 1:]\n    # Return an empty string if no extension found\n    return \"\"\n", "entry_point": "extract_file_extension", "input": "'/path/to/file.cs/'", "output": "'cs/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73936_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018141", "code": "def add_base_path_to_urls(url_patterns, base_path):\n    return [base_path + url for url in url_patterns]\n", "entry_point": "add_base_path_to_urls", "input": "['home/', 'about/'], '/myapp/'", "output": "['/myapp/home/', '/myapp/about/']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63882_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018142", "code": "def base64_encode(input_str):\n    base64_chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"\n    # Step 1: Convert input string to ASCII representation\n    ascii_vals = [ord(char) for char in input_str]\n    # Step 2: Convert ASCII to binary format\n    binary_str = ''.join(format(val, '08b') for val in ascii_vals)\n    # Step 3: Pad binary string to be a multiple of 6 bits\n    while len(binary_str) % 6 != 0:\n        binary_str += '0'\n    # Step 4: Map 6-bit binary chunks to base64 characters\n    base64_encoded = ''\n    for i in range(0, len(binary_str), 6):\n        chunk = binary_str[i:i+6]\n        base64_encoded += base64_chars[int(chunk, 2)]\n    # Step 5: Handle padding at the end\n    padding = len(binary_str) % 24\n    if padding == 12:\n        base64_encoded += '=='\n    elif padding == 18:\n        base64_encoded += '='\n    return base64_encoded\n", "entry_point": "base64_encode", "input": "'World!'", "output": "'V29ybGQh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132996_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9531", "output": "{1, 353, 3, 1059, 27, 3177, 9, 9531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018144", "code": "def min_edit_distance(source, target):\n    slen, tlen = len(source), len(target)\n    dist = [[0 for _ in range(tlen+1)] for _ in range(slen+1)]\n    for i in range(slen+1):\n        dist[i][0] = i\n    for j in range(tlen+1):\n        dist[0][j] = j\n    for i in range(slen):\n        for j in range(tlen):\n            cost = 0 if source[i] == target[j] else 1\n            dist[i+1][j+1] = min(\n                dist[i][j+1] + 1,   # deletion\n                dist[i+1][j] + 1,   # insertion\n                dist[i][j] + cost   # substitution\n            )\n    return dist[-1][-1]\n", "entry_point": "min_edit_distance", "input": "'abcdefg', 'hijklmn'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126361_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018145", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3345", "output": "{1, 3, 5, 15, 3345, 1115, 669, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018146", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1654", "output": "{1, 2, 827, 1654}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018147", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'LLDW'", "output": "'lldw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018148", "code": "import collections\ndef count_subarrays(a, k):\n    n = len(a)\n    s = [0] * (n + 1)\n    for i in range(n):\n        s[i + 1] = s[i] + a[i]\n    for i in range(1, n + 1):\n        s[i] = (s[i] - i) % k\n    cnt = collections.defaultdict(int)\n    cnt[0] = 1\n    res = 0\n    for i in range(1, n + 1):\n        res += cnt[s[i]]\n        cnt[s[i]] += 1\n        if i - (k - 1) >= 0:\n            cnt[s[i - (k - 1)]] -= 1\n    return res\n", "entry_point": "count_subarrays", "input": "[1, 1], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104413_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3317", "output": "{1, 107, 3317, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "239", "output": "{1, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018151", "code": "def evaluate_expression(tree):\n    if isinstance(tree, int):\n        return tree\n    else:\n        operator, *operands = tree\n        left_operand = evaluate_expression(operands[0])\n        right_operand = evaluate_expression(operands[1])\n        if operator == '+':\n            return left_operand + right_operand\n        elif operator == '-':\n            return left_operand - right_operand\n        elif operator == '*':\n            return left_operand * right_operand\n        elif operator == '/':\n            if right_operand == 0:\n                raise ZeroDivisionError(\"Division by zero\")\n            return left_operand / right_operand\n        else:\n            raise ValueError(\"Invalid operator\")\n", "entry_point": "evaluate_expression", "input": "['+', 10, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_972_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018152", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>p<p>is</p>'", "output": "'p<p>is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018153", "code": "def map_dataset_subset(dataset_name):\n    if dataset_name == \"train\":\n        return \"train_known\"\n    elif dataset_name == \"val\":\n        return \"train_unseen\"\n    elif dataset_name == \"test\":\n        return \"test_known\"\n    else:\n        return \"Invalid dataset subset name provided.\"\n", "entry_point": "map_dataset_subset", "input": "'test'", "output": "'test_known'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39576_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018154", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[3, 6, 9]", "output": "(9, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018155", "code": "def calculate_average(nums: list) -> float:\n    if len(nums) <= 1:\n        return 0\n    min_val = min(nums)\n    max_val = max(nums)\n    remaining_nums = [num for num in nums if num != min_val and num != max_val]\n    if not remaining_nums:\n        return 0\n    return sum(remaining_nums) / len(remaining_nums)\n", "entry_point": "calculate_average", "input": "[3, 4, 5, 8, 9]", "output": "5.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144900_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "146", "output": "{73, 1, 146, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018157", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "456, {456: 1}", "output": "'456-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018158", "code": "def count_unique_answers(groups):\n    total = 0\n    answers = set()\n    for line in groups:\n        if not line:\n            total += len(answers)\n            answers = set()\n        else:\n            for letter in line:\n                answers.add(letter)\n    return total\n", "entry_point": "count_unique_answers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49059_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018159", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "1000000000", "output": "'0.1 x 10^9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018160", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "0.833425, 4", "output": "0.8334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018161", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[9, 0, 5, 7, 8, 1, 8]", "output": "[9, 1, 7, 10, 12, 6, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018162", "code": "def count_pairs(nums, target):\n    num_freq = {}\n    pairs_count = 0\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            pairs_count += num_freq[complement]\n        if num in num_freq:\n            num_freq[num] += 1\n        else:\n            num_freq[num] = 1\n    return pairs_count\n", "entry_point": "count_pairs", "input": "[1, 1, 2, 4, 5, 3, 3], 6", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118136_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018163", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[5, 7, 2, -1, 7, 3, -2, 6, 0]", "output": "([5, 7, -1, 7, 3], [2, -2, 6, 0, None])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018164", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5306", "output": "{1, 2, 7, 14, 758, 5306, 379, 2653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018165", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "3", "output": "\"Parse error, expecting '>'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018166", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5431", "output": "{1, 5431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018167", "code": "def play_war_game(player1, player2):\n    rounds = 0\n    while player1 and player2:\n        rounds += 1\n        card1 = player1.pop(0)\n        card2 = player2.pop(0)\n        if card1 > card2:\n            player1.extend([card1, card2])\n        elif card2 > card1:\n            player2.extend([card2, card1])\n        else:  # War scenario\n            war_cards = [card1, card2]\n            for _ in range(3):\n                if player1 and player2:\n                    war_cards.append(player1.pop(0))\n                    war_cards.append(player2.pop(0))\n            if player1 and player2:\n                card1 = player1.pop(0)\n                card2 = player2.pop(0)\n                if card1 > card2:\n                    player1.extend(war_cards + [card1, card2])\n                else:\n                    player2.extend(war_cards + [card2, card1])\n    return rounds\n", "entry_point": "play_war_game", "input": "[2, 5, 10], [1, 3, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71478_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018168", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'example'", "output": "'example.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018169", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            result.append(input_list[i] + input_list[i + 1])\n        else:\n            result.append(input_list[i] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[1, -1, 6, -1, 7, 5, 3, -2]", "output": "[0, 5, 5, 6, 12, 8, 1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37203_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3130", "output": "{1, 2, 5, 10, 626, 313, 3130, 1565}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3129", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018171", "code": "from typing import List\ndef find_nearest(array: List[float], value: float) -> float:\n    if not array:\n        raise ValueError(\"Input array is empty\")\n    nearest_idx = 0\n    min_diff = abs(array[0] - value)\n    for i in range(1, len(array)):\n        diff = abs(array[i] - value)\n        if diff < min_diff:\n            min_diff = diff\n            nearest_idx = i\n    return array[nearest_idx]\n", "entry_point": "find_nearest", "input": "[5.0, 6.5, 6.9, 6.7, 8.0], 6.7", "output": "6.7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121237_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8702", "output": "{1, 2, 229, 38, 458, 19, 8702, 4351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018173", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[100, 10]", "output": "110", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018174", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'meeting, 08:30:00'", "output": "{'when': 'meeting', 'hour': '08:30:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018175", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[1800, 540, 57]", "output": "'0:39:57'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018176", "code": "def area_under_curve(x, y) -> float:\n    area = 0\n    for i in range(1, len(x)):\n        # Calculate the area of the trapezoid formed by two consecutive points\n        base = x[i] - x[i-1]\n        height_avg = (y[i] + y[i-1]) / 2\n        area += base * height_avg\n    return area\n", "entry_point": "area_under_curve", "input": "[0, 4], [0, 4]", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113501_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018177", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5, 5, 6]", "output": "[5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt53", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018178", "code": "from typing import List\ndef search_rotated_list(nums: List[int], target: int) -> bool:\n    start, end = 0, len(nums) - 1\n    while start <= end:\n        mid = (start + end) // 2\n        if nums[mid] == target:\n            return True\n        if nums[start] == nums[mid] == nums[end]:\n            start += 1\n            end -= 1\n        elif nums[start] <= nums[mid]:\n            if nums[start] <= target < nums[mid]:\n                end = mid - 1\n            else:\n                start = mid + 1\n        else:\n            if nums[mid] < target <= nums[end]:\n                start = mid + 1\n            else:\n                end = mid - 1\n    return False\n", "entry_point": "search_rotated_list", "input": "[2, 3, 1], 3", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130071_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018179", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "1, 10, 17", "output": "(1, 17)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018180", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "'\u0432\u0433'", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018181", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018182", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[95, 92, 90, 89, 88], 5", "output": "90.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111793_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018183", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'com.example.sensor.sensorAtlasConfi'", "output": "'sensorAtlasConfi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018184", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "4, 4, 3", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018185", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'1g'", "output": "'1t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5682", "output": "{1, 2, 3, 1894, 6, 5682, 947, 2841}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018187", "code": "def format_command_usage(name, desc, usage_template):\n    return usage_template.format(name=name, desc=desc)\n", "entry_point": "format_command_usage", "input": "'time', 'Measure time', '{name}'", "output": "'time'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41916_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018188", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[1, 2, 2, 3, 4, 5, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018189", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[20, 30, 40, 5]", "output": "450", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018190", "code": "def calculate_quadrilateral_area(vertices):\n    n = len(vertices)\n    area = 0\n    for i in range(n):\n        j = (i + 1) % n\n        area += vertices[i][0] * vertices[j][1]\n        area -= vertices[j][0] * vertices[i][1]\n    area = abs(area) / 2\n    return area\n", "entry_point": "calculate_quadrilateral_area", "input": "[(0, 0), (1, 0), (0, 1), (0, 0.5)]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57770_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018191", "code": "def read_as_dict(result):\n    output = []\n    for row in result:\n        converted_row = {k: v for k, v in row.items()}\n        output.append(converted_row)\n    return output\n", "entry_point": "read_as_dict", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145315_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1262", "output": "{1, 2, 1262, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018193", "code": "def calculate_sum(absolutes, signs):\n    answer = 0\n    for i in range(len(absolutes)):\n        if signs[i]:\n            answer += absolutes[i]\n        else:\n            answer -= absolutes[i]\n    return answer\n", "entry_point": "calculate_sum", "input": "[3, 1], [True, False]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18009_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018194", "code": "def min_operations(seq1, seq2):\n    size_x = len(seq1) + 1\n    size_y = len(seq2) + 1\n    matrix = [[0 for _ in range(size_y)] for _ in range(size_x)]\n    for x in range(1, size_x):\n        matrix[x][0] = x\n    for y in range(1, size_y):\n        matrix[0][y] = y\n    for x in range(1, size_x):\n        for y in range(1, size_y):\n            if seq1[x-1] == seq2[y-1]:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1],\n                    matrix[x][y-1] + 1\n                )\n            else:\n                matrix[x][y] = min(\n                    matrix[x-1][y] + 1,\n                    matrix[x-1][y-1] + 1,\n                    matrix[x][y-1] + 1\n                )\n    return matrix[size_x - 1][size_y - 1]\n", "entry_point": "min_operations", "input": "'abcdefghij', 'klmnopqrst'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43241_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2721", "output": "{3, 1, 2721, 907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018196", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 2, 3, 4, 10]", "output": "[2, 4, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3349", "output": "{197, 1, 3349, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018198", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "8", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018199", "code": "def unique_settings_keys(settings):\n    common_keys = {'DATABASES', 'INSTALLED_APPS', 'ALLOWED_HOSTS'}\n    return [key for key in settings.keys() if key not in common_keys]\n", "entry_point": "unique_settings_keys", "input": "{'DATABASES': {}, 'INSTALLED_APPS': [], 'ALLOWED_HOSTS': ['localhost']}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6803_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018200", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2674", "output": "{1, 2, 7, 14, 2674, 1337, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018201", "code": "def filter_entries(data, key, value):\n    filtered_entries = []\n    for entry in data:\n        if key in entry and entry[key] == value:\n            filtered_entries.append(entry)\n    return filtered_entries\n", "entry_point": "filter_entries", "input": "[], 'some_key', 'some_value'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145057_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018202", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'LUUU'", "output": "(-1, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "154", "output": "{1, 2, 7, 11, 77, 14, 22, 154}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018204", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[9, 7, 2, 7, 1, 1, 2, 1, 1]", "output": "[9, 8, 4, 10, 5, 6, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018205", "code": "def most_frequent_element(sequence):\n    frequency = {}\n    max_freq = 0\n    most_frequent_element = None\n    for num in sequence:\n        if num in frequency:\n            frequency[num] += 1\n        else:\n            frequency[num] = 1\n        if frequency[num] > max_freq:\n            max_freq = frequency[num]\n            most_frequent_element = num\n    return most_frequent_element\n", "entry_point": "most_frequent_element", "input": "[5, 5, 5, 4, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23662_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018206", "code": "ENDPOINT_MAPPING = {\n    'robot_position': '/robotposition',\n    'cube_position': '/cubeposition',\n    'path': '/path',\n    'flag': '/flag'\n}\ndef generate_endpoint(resource_name):\n    return ENDPOINT_MAPPING.get(resource_name, 'Invalid resource')\n", "entry_point": "generate_endpoint", "input": "'path'", "output": "'/path'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44396_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6099", "output": "{1, 321, 3, 107, 2033, 6099, 19, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018208", "code": "import re\nDATE_RE = re.compile(r\"[0-9]{4}-[0-9]{2}-[0-9]{2}\")\nINVALID_IN_NAME_RE = re.compile(\"[^a-z0-9_]\")\ndef process_input(input_str):\n    # Check if input matches the date format pattern\n    is_date = bool(DATE_RE.match(input_str))\n    # Remove specific suffix if it exists\n    processed_str = input_str\n    if input_str.endswith(\"T00:00:00.000+00:00\"):\n        processed_str = input_str[:-19]\n    # Check for invalid characters based on the pattern\n    has_invalid_chars = bool(INVALID_IN_NAME_RE.search(input_str))\n    return (is_date, processed_str, has_invalid_chars)\n", "entry_point": "process_input", "input": "'2000.000+00:00_A23'", "output": "(False, '2000.000+00:00_A23', True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49598_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018209", "code": "from typing import List\ndef min_transactions_to_equalize_shares(shares: List[int]) -> int:\n    total_shares = sum(shares)\n    target_shares = total_shares // len(shares)\n    transactions = 0\n    for share in shares:\n        transactions += max(0, target_shares - share)\n    return transactions\n", "entry_point": "min_transactions_to_equalize_shares", "input": "[0, 0, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91176_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018210", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "' world '", "output": "'world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018211", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018212", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[1, 2, 3, 4, 5, 6, 7], paginate_by=3, page=2", "output": "[4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018213", "code": "from typing import List\ndef has_path(grid: List[List[int]]) -> bool:\n    def dfs(row, col):\n        if row < 0 or col < 0 or row >= len(grid) or col >= len(grid[0]) or grid[row][col] == 1:\n            return False\n        if row == len(grid) - 1 and col == len(grid[0]) - 1:\n            return True\n        return dfs(row + 1, col) or dfs(row, col + 1)\n    return dfs(0, 0)\n", "entry_point": "has_path", "input": "[[0, 0], [0, 0]]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69760_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018214", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[5, -1, 3, 1, 1, 4, 2]", "output": "([5, -1, 3, 1, 1], [4, 2, None, None, None])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6537", "output": "{1, 6537, 3, 2179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018216", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'C_C_N'", "output": "'No occurrences found for bond type C_C_N'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018217", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "900, 0", "output": "900", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018218", "code": "def count_inversions(queue: list[int]) -> int:\n    def _merge_and_count_split(left: list[int], right: list[int]) -> tuple[list[int], int]:\n        merged = []\n        count_split = 0\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] <= right[j]:\n                merged.append(left[i])\n                i += 1\n            else:\n                merged.append(right[j])\n                count_split += len(left) - i\n                j += 1\n        merged.extend(left[i:])\n        merged.extend(right[j:])\n        return merged, count_split\n    def _count(queue: list[int]) -> tuple[list[int], int]:\n        if len(queue) > 1:\n            mid = len(queue) // 2\n            sorted_left, count_left = _count(queue[:mid])\n            sorted_right, count_right = _count(queue[mid:])\n            sorted_queue, count_split = _merge_and_count_split(sorted_left, sorted_right)\n            return sorted_queue, count_left + count_right + count_split\n        else:\n            return queue, 0\n    return _count(queue)[1]\n", "entry_point": "count_inversions", "input": "[2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117604_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018219", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "19", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018220", "code": "from typing import List\ndef process_numbers(numbers: List[int]) -> List[int]:\n    processed_numbers = []\n    for index, num in enumerate(numbers):\n        total = num + index\n        if total % 2 == 0:\n            processed_numbers.append(total ** 2)\n        else:\n            processed_numbers.append(total ** 3)\n    return processed_numbers\n", "entry_point": "process_numbers", "input": "[1, 2, 3, 4]", "output": "[1, 27, 125, 343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1098_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018221", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 2, 0, 7, 4, 1, 4, 3, 1]", "output": "[9, 4, 0, 21, 8, 3, 8, 9, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018222", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[2, 5, 1, 3, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143804_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018223", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6955", "output": "{1, 65, 5, 6955, 107, 13, 1391, 535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018225", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[89, 79, 84, 89, 62, 95], 6", "output": "[89, 79, 84, 89, 62, 95]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018226", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4965", "output": "{1, 993, 3, 5, 4965, 331, 15, 1655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "126", "output": "{1, 2, 3, 6, 7, 9, 42, 14, 18, 21, 126, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018228", "code": "from typing import List\ndef find_starting_station(gas: List[int], cost: List[int]) -> int:\n    n = len(gas)\n    total_tank, curr_tank, start = 0, 0, 0\n    for i in range(n):\n        total_tank += gas[i] - cost[i]\n        curr_tank += gas[i] - cost[i]\n        if curr_tank < 0:\n            start = i + 1\n            curr_tank = 0\n    return start if total_tank >= 0 else -1\n", "entry_point": "find_starting_station", "input": "[1, 2, 3], [2, 3, 4]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42546_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018229", "code": "def sum_even_numbers(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[1, 10, 20, 20]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17094_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018230", "code": "def prefnum(InA=[], PfT=None, varargin=None):\n    # Non-zero value InA location indices:\n    IxZ = [i for i, val in enumerate(InA) if val > 0]\n    IsV = True\n    # Calculate sum of positive values, maximum value, and its index\n    sum_positive = sum(val for val in InA if val > 0)\n    max_value = max(InA)\n    max_index = InA.index(max_value)\n    return sum_positive, max_value, max_index\n", "entry_point": "prefnum", "input": "[0, -1, -2, 0, 1]", "output": "(1, 1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134376_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018231", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3387", "output": "{3, 1, 3387, 1129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1053", "output": "{1, 3, 39, 9, 13, 81, 117, 27, 1053, 351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018233", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9742", "output": "{1, 2, 9742, 4871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018234", "code": "from collections import Counter\ndef getHint(secret: str, guess: str) -> str:\n    bulls = cows = 0\n    seen = Counter()\n    for s, g in zip(secret, guess):\n        if s == g:\n            bulls += 1\n        else:\n            if seen[s] < 0:\n                cows += 1\n            if seen[g] > 0:\n                cows += 1\n            seen[s] += 1\n            seen[g] -= 1\n    return \"{0}A{1}B\".format(bulls, cows)\n", "entry_point": "getHint", "input": "'1234', '5678'", "output": "'0A0B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78888_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5111", "output": "{1, 19, 269, 5111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018236", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[1, 3, 3, 3, 1]", "output": "[4, 6, 6, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018237", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/path/to/some-file.txt'", "output": "'some-file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6686", "output": "{1, 2, 6686, 3343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6685", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018239", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[4, 3, 5, 1]", "output": "[4, 3, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018240", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[0, 5, 3, 6, 2, 4, 5], 5", "output": "[[0, 5, 3, 6, 2], [4, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018241", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1103", "output": "{1, 1103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018242", "code": "from urllib.parse import urlparse, parse_qs\ndef parse_query_params(url: str) -> str:\n    parsed_url = urlparse(url)\n    query_params = parse_qs(parsed_url.query)\n    if 'tag' in query_params:\n        tags = query_params['tag']\n        return ','.join(tags)\n    return \"\"\n", "entry_point": "parse_query_params", "input": "'http://example.com?tag=foo'", "output": "'foo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51641_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018243", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'Sample'", "output": "['sample']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018244", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3934", "output": "{1, 2, 7, 14, 1967, 562, 281, 3934}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018245", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[82, 38, 27, 27, 26, 27, 8, 4, 3]", "output": "[3, 4, 8, 26, 27, 27, 27, 38, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018246", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[101, 100, 91, 85, 85, 40]", "output": "[101, 100, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23327_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018247", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'127.0.0.1:443'", "output": "('https', '127.0.0.1', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018248", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7, 8, 2], [1, 2, 3, 4, 6]", "output": "('Player 1 wins', 4, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018249", "code": "def calculate_precision(true_positives, false_positives):\n    if true_positives + false_positives == 0:\n        return -1\n    precision = true_positives / (true_positives + false_positives)\n    return precision\n", "entry_point": "calculate_precision", "input": "11, 1", "output": "0.9166666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116916_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018250", "code": "def count_waitlist_items(waitlist):\n    waitlist_counts = {}\n    for item in waitlist:\n        book_title = item[0]\n        waitlist_counts[book_title] = waitlist_counts.get(book_title, 0) + 1\n    return waitlist_counts\n", "entry_point": "count_waitlist_items", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31634_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018251", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "79, 'codcsocodoc.py'", "output": "'79_codcsocodoc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018252", "code": "def parse_dependencies(input_list):\n    dependencies_dict = {}\n    for item in input_list:\n        package, dependencies = item.split(':')\n        dependencies_dict[package] = dependencies.split(',')\n    return dependencies_dict\n", "entry_point": "parse_dependencies", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148061_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018253", "code": "def concatenate_words(string_list):\n    concatenated_words = []\n    for i in range(len(string_list) - 1):\n        words1 = string_list[i].split()\n        words2 = string_list[i + 1].split()\n        concatenated_word = words1[0] + words2[1]\n        concatenated_words.append(concatenated_word)\n    return concatenated_words\n", "entry_point": "concatenate_words", "input": "['One hello', 'Three four', 'Something six']", "output": "['Onefour', 'Threesix']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124678_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018254", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'data/all.jsod', None", "output": "('data/all.jsod', 'data/all.jsod')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018255", "code": "def calculate_dot_product(vector1, vector2):\n    dot_product = 0\n    for elem1, elem2 in zip(vector1, vector2):\n        dot_product += elem1 * elem2\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[3, 1, 0], [19, 0, 0]", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134459_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018256", "code": "import re\ndef count_unique_words(text):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'yyytaweython thello'", "output": "{'yyytaweython': 1, 'thello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33729_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3845", "output": "{1, 5, 3845, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3844", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018258", "code": "MOBILENET_RESTRICTIONS = [('Camera', 10), ('GPS', 8), ('Bluetooth', 9)]\ndef filter_mobile_restrictions(threshold):\n    restricted_features = [feature for feature, version in MOBILENET_RESTRICTIONS if version >= threshold]\n    return restricted_features\n", "entry_point": "filter_mobile_restrictions", "input": "9", "output": "['Camera', 'Bluetooth']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92353_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018259", "code": "def simulate_packet_routing(nodes, packets):\n    total_forwarded_packets = 0\n    for i in range(len(nodes)):\n        forwarded_packets = min(nodes[i], packets[i])\n        total_forwarded_packets += forwarded_packets\n    return total_forwarded_packets\n", "entry_point": "simulate_packet_routing", "input": "[5, 5], [5, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65785_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018260", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48'", "output": "b'H'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018261", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'+'", "output": "'+\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8011", "output": "{1, 8011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018263", "code": "def find_increase(lines):\n    increase = 0\n    for i in range(1, len(lines)):\n        if lines[i] > lines[i - 1]:\n            increase += 1\n    return increase\n", "entry_point": "find_increase", "input": "[1, 2, 3, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53543_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018264", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'elll1'", "output": "'ELLL#'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018265", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5718", "output": "{1, 2, 3, 6, 2859, 1906, 5718, 953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5717", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018266", "code": "def calculate_polygon_area(vertices):\n    n = len(vertices)\n    area = 0\n    for i in range(n):\n        j = (i + 1) % n\n        area += vertices[i][0] * vertices[j][1]\n        area -= vertices[j][0] * vertices[i][1]\n    area = abs(area) / 2\n    return area\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (0, 0), (0, 0)]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69969_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018267", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'hhho'", "output": "['hhho']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018268", "code": "def count_comments(file_content):\n    comment_count = 0\n    for line in file_content.split('\\n'):\n        if line.strip().startswith('#') or not line.strip():\n            comment_count += 1\n    return comment_count\n", "entry_point": "count_comments", "input": "'# Only this line counts as a comment'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41468_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018269", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'TTh', '11.1'", "output": "{'11.1': 'TTh'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018270", "code": "def extract_file_extension(name: str) -> str:\n    dot_index = name.rfind('.')\n    if dot_index == -1:  # If no dot is found\n        return \"\"\n    return name[dot_index + 1:]\n", "entry_point": "extract_file_extension", "input": "'settings.config'", "output": "'config'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89470_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018271", "code": "def calculate_u(w, x0, n):\n    w0 = w + sum(x0)\n    u = [w0] * n\n    return u\n", "entry_point": "calculate_u", "input": "0, [], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54111_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018272", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 13.0, 1", "output": "9.230769230769232", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018273", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[6, 6, 9, 9, 7, 5, 5, 5, 3]", "output": "[6, 6, 9, 9, 7, 5, 5, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018274", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[5, 3, 9, 2, 3, 4, 11, 8, 8]", "output": "[2, 3, 3, 4, 5, 8, 8, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018275", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[0, 1, 2, 3, 4, 5, 6], 1", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018276", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6434", "output": "{1, 6434, 2, 3217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6433", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018277", "code": "def merge_intervals(arr1, arr2):\n    l = min(min(arr1), min(arr2))\n    r = max(max(arr1), max(arr2))\n    return [l, r]\n", "entry_point": "merge_intervals", "input": "[3, 4, 5], [8, 9]", "output": "[3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98126_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018278", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'ie_igie_witimhoutag'", "output": "('ie_igie_witimhoutag', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018279", "code": "def generate_code(input_string):\n    result = \"\"\n    position = 1\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper()\n            result += str(position)\n            position += 1\n    return result\n", "entry_point": "generate_code", "input": "'HELLOWORLD'", "output": "'H1E2L3L4O5W6O7R8L9D10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4318_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018280", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[3, 3, 1, 1]", "output": "[3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018281", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4269", "output": "{1, 3, 4269, 1423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018282", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[2, 4, 4, 2, 2, 4, 5, 1, 3]", "output": "[2, 4, 4, 2, 2, 4, 5, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018283", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 0], [8, 8]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018284", "code": "def calculate_carbon_uptake_rate(growth_rate):\n    R_GLUC = 200\n    R_XYL = 50\n    R_FRUC = 200\n    R_GLYC = 2000\n    N_GLUC = 6\n    N_XYL = 5\n    total_carbon_uptake_rate = (R_GLUC * N_GLUC + R_XYL * N_XYL + R_FRUC * 6 + R_GLYC * 3) * growth_rate\n    return total_carbon_uptake_rate\n", "entry_point": "calculate_carbon_uptake_rate", "input": "0.6", "output": "5190.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50880_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1227", "output": "{3, 1, 409, 1227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1226", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018286", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[0, 21], [20, 0]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70247_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018287", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[20, 40, 60]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018288", "code": "def convert_log_levels(log_levels):\n    log_mapping = {0: 'DEBUG', 1: 'INFO', 2: 'WARNING', 3: 'ERROR'}\n    log_strings = [log_mapping[level] for level in log_levels]\n    return log_strings\n", "entry_point": "convert_log_levels", "input": "[1, 1, 3, 3]", "output": "['INFO', 'INFO', 'ERROR', 'ERROR']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93726_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018289", "code": "def calculate_project_cost(base_cost: float, cost_per_line: float, lines_of_code: int) -> float:\n    total_cost = base_cost + (lines_of_code * cost_per_line)\n    return total_cost\n", "entry_point": "calculate_project_cost", "input": "2000.0, 5.0419472, 500", "output": "4520.9736", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125885_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018290", "code": "import re\ndef count_word_occurrences(input_string):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word.isalpha():\n            word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'worsaworxt'", "output": "{'worsaworxt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99880_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018291", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filtee1er2fiter3'", "output": "['filtee1er2fiter3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6351", "output": "{1, 3, 2117, 73, 6351, 87, 219, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7318", "output": "{1, 2, 3659, 7318}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3141", "output": "{1, 3, 3141, 9, 1047, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018295", "code": "from typing import List\ndef total_visible_skyline(buildings: List[int]) -> int:\n    total_skyline = 0\n    max_height = 0\n    for height in buildings:\n        if height > max_height:\n            total_skyline += height - max_height\n            max_height = height\n    return total_skyline\n", "entry_point": "total_visible_skyline", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115607_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018296", "code": "def process_integers(nums):\n    modified_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            modified_nums.append(num + 2)\n        elif num % 2 != 0:\n            modified_nums.append(num * 3)\n        if num % 5 == 0:\n            modified_nums[-1] -= 5\n    return modified_nums\n", "entry_point": "process_integers", "input": "[5, 5, 8, 8]", "output": "[10, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79730_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018297", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3660", "output": "'1 hour, and 1 minute'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018298", "code": "def calculate_f1_score(y_true, y_pred):\n    tp = fp = fn = 0\n    for true_label, pred_label in zip(y_true, y_pred):\n        if true_label == 1 and pred_label == 1:\n            tp += 1\n        elif true_label == 0 and pred_label == 1:\n            fp += 1\n        elif true_label == 1 and pred_label == 0:\n            fn += 1\n    precision = tp / (tp + fp) if tp + fp > 0 else 0\n    recall = tp / (tp + fn) if tp + fn > 0 else 0\n    f1_score = 2 * (precision * recall) / (precision + recall) if precision + recall > 0 else 0\n    return round(f1_score, 2)\n", "entry_point": "calculate_f1_score", "input": "[1, 1, 1, 0], [1, 1, 0, 1]", "output": "0.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83345_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018299", "code": "def calculate_score(cards):\n    total_score = 0\n    ace_count = 0\n    for card in cards:\n        if card in ['J', 'Q', 'K']:\n            total_score += 10\n        elif card == 'A':\n            ace_count += 1\n        else:\n            total_score += card\n    for _ in range(ace_count):\n        if total_score + 11 <= 21:\n            total_score += 11\n        else:\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['J', 'Q', 'K', 'K']", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116780_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018300", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5281", "output": "{1, 5281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018301", "code": "def latest_versions(packages):\n    latest_versions_dict = {}\n    for package, version in packages:\n        if package not in latest_versions_dict:\n            latest_versions_dict[package] = version\n        else:\n            current_version = latest_versions_dict[package]\n            current_version_nums = list(map(int, current_version.split('.')))\n            new_version_nums = list(map(int, version.split('.')))\n            if new_version_nums > current_version_nums:\n                latest_versions_dict[package] = version\n    return latest_versions_dict\n", "entry_point": "latest_versions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89520_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018302", "code": "import math\ndef calculate_polygon_area(num_sides, side_length):\n    pi = math.pi\n    area = (num_sides * side_length ** 2) / (4 * math.tan(pi / num_sides))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "8, 7.0", "output": "236.59292911256333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120814_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018303", "code": "def calculate_average_score(scores):\n    if not scores:  # Check if the input list is empty\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[82, 83, 83]", "output": "82.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128899_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018304", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'test.com:80'", "output": "('http', 'test.com', 80)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018305", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'word', '1.1.000.1'", "output": "{'1.1.000.1': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018306", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "3, 1", "output": "[0, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018307", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[3, 3, 6, 4, 4, 4]", "output": "([3, 6, 4], [2, 1, 3])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018308", "code": "SDL_HAT_CENTERED = 0x00\nSDL_HAT_UP = 0x01\nSDL_HAT_RIGHT = 0x02\nSDL_HAT_DOWN = 0x04\nSDL_HAT_LEFT = 0x08\nSDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP\nSDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN\nSDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP\nSDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN\ndef simulate_joystick_movement(current_position, direction):\n    if direction == 'UP':\n        return SDL_HAT_UP if current_position not in [SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_LEFTUP] else current_position\n    elif direction == 'RIGHT':\n        return SDL_HAT_RIGHT if current_position not in [SDL_HAT_RIGHT, SDL_HAT_RIGHTUP, SDL_HAT_RIGHTDOWN] else current_position\n    elif direction == 'DOWN':\n        return SDL_HAT_DOWN if current_position not in [SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN, SDL_HAT_LEFTDOWN] else current_position\n    elif direction == 'LEFT':\n        return SDL_HAT_LEFT if current_position not in [SDL_HAT_LEFT, SDL_HAT_LEFTUP, SDL_HAT_LEFTDOWN] else current_position\n    else:\n        return current_position\n", "entry_point": "simulate_joystick_movement", "input": "0, 'RIGHT'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77291_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018309", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'hevc'", "output": "'H.265 (HEVC)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018310", "code": "def count_vowels_in_modules(module_names):\n    vowels = set('aeiou')\n    result = {}\n    for module_name in module_names:\n        vowel_count = sum(1 for char in module_name if char.lower() in vowels)\n        result[module_name] = vowel_count\n    return result\n", "entry_point": "count_vowels_in_modules", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22998_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018311", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[4, 4, 6, 5, 4, 4]", "output": "[8, 8, 12, 15, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018312", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "64, 0", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018313", "code": "import re\ndef clean_network_names(networks):\n    network_names_list = re.findall(\"(?:Profile\\s*:\\s)(.*)\", networks)\n    lis = network_names_list[0].split(\"\\\\r\\\\n\")\n    network_names = []\n    for i in lis:\n        if \":\" in i:\n            index = i.index(\":\")\n            network_names.append(i[index + 2 :])\n        else:\n            network_names.append(i)\n    cleaned_network_names = [name.strip() for name in network_names if name.strip()]\n    return cleaned_network_names\n", "entry_point": "clean_network_names", "input": "'Profile : WiFi100\\\\r\\\\nProfile : Network1'", "output": "['WiFi100', 'Network1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144248_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018314", "code": "def calculate_training_time(start_time, end_time):\n    start_h, start_m, start_s = map(int, start_time.split(':'))\n    end_h, end_m, end_s = map(int, end_time.split(':'))\n    total_seconds_start = start_h * 3600 + start_m * 60 + start_s\n    total_seconds_end = end_h * 3600 + end_m * 60 + end_s\n    training_time_seconds = total_seconds_end - total_seconds_start\n    return training_time_seconds\n", "entry_point": "calculate_training_time", "input": "'00:00:00', '202:10:20'", "output": "727820", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7459_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018315", "code": "def bank_queue(customers, num_tellers):\n    tellers = {i: [] for i in range(1, num_tellers + 1)}\n    for idx, customer in enumerate(customers):\n        teller_num = (idx % num_tellers) + 1\n        tellers[teller_num].append(customer)\n    return [tellers[i] for i in tellers]\n", "entry_point": "bank_queue", "input": "['Bob', 'Chare', 'David', 'David'], 1", "output": "[['Bob', 'Chare', 'David', 'David']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8593_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018316", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "53", "output": "'LIII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2894", "output": "{1, 2, 2894, 1447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2893", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018318", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'hoelwloo'", "output": "'h.o.e.l.w.l.o.o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018319", "code": "def render_template(template_data: dict) -> str:\n    template_name = template_data.get('template_name')\n    context = template_data.get('context', {})\n    # Load template content from file or predefined templates\n    # For simplicity, let's assume predefined templates\n    templates = {\n        'contests/create.html': '<html><body>{form}</body></html>'\n    }\n    if template_name in templates:\n        template_content = templates[template_name]\n        rendered_content = template_content.format(**context)\n        return rendered_content\n    else:\n        return \"Template not found\"\n", "entry_point": "render_template", "input": "{'template_name': 'nonexistent/template.html'}", "output": "'Template not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82001_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018320", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[5, 1, 2, 5, 5, 4, 5, 4]", "output": "[5, 6, 8, 13, 18, 22, 27, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018321", "code": "def calc_bmi(x, y):\n    ans = y / (x * x)\n    return ans\n", "entry_point": "calc_bmi", "input": "1.0, 1.037037037037037", "output": "1.037037037037037", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147555_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018322", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9859", "output": "{1, 9859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018323", "code": "import re\ndef count_word_occurrences(text):\n    word_count = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_word_occurrences", "input": "'tthis is aswords'", "output": "{'tthis': 1, 'is': 1, 'aswords': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90305_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018324", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(255, 0, 0)", "output": "'#FF0000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018325", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[4, 4, 3, 3, 3, 3, 3]", "output": "[4, 4, 9, 9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018326", "code": "def sum_multiples_of_divisor(numbers, divisor):\n    sum_multiples = 0\n    for num in numbers:\n        if num % divisor == 0:\n            sum_multiples += num\n    return sum_multiples\n", "entry_point": "sum_multiples_of_divisor", "input": "[40, 45, 50, 60], 5", "output": "195", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74016_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018327", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[85, 86, 86], 3", "output": "85.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79219_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018328", "code": "AMBIGUITY_VALUES = {\n    \"absent\": 0.00,\n    \"low\": 0.01,\n    \"high\": 0.02,\n}\ndef calculate_total_ambiguity_value(ambiguity_levels):\n    total_ambiguity_value = sum(AMBIGUITY_VALUES.get(level, 0) for level in ambiguity_levels)\n    return total_ambiguity_value\n", "entry_point": "calculate_total_ambiguity_value", "input": "['high', 'high', 'high', 'high']", "output": "0.08", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92876_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018329", "code": "def schedule_jobs(jobs):\n    # Sort the jobs based on their durations in ascending order\n    sorted_jobs = sorted(jobs, key=lambda x: x[1])\n    # Extract and return the job types in the sorted order\n    sorted_job_types = [job[0] for job in sorted_jobs]\n    return sorted_job_types\n", "entry_point": "schedule_jobs", "input": "[('Job3', 1)]", "output": "['Job3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16397_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018330", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4401", "output": "{1, 3, 163, 27, 9, 489, 4401, 1467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4400", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018331", "code": "def longest_consecutive_subsequence(input_list):\n    current_sequence = []\n    longest_sequence = []\n    for num in input_list:\n        if not current_sequence or num == current_sequence[-1] + 1:\n            current_sequence.append(num)\n        else:\n            if len(current_sequence) > len(longest_sequence):\n                longest_sequence = current_sequence\n            current_sequence = [num]\n    if len(current_sequence) > len(longest_sequence):\n        longest_sequence = current_sequence\n    return longest_sequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[9, 10]", "output": "[9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87901_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018332", "code": "def count_fields_added(operations):\n    model_field_count = {}\n    for operation in operations:\n        model_name = operation['model_name']\n        if model_name in model_field_count:\n            model_field_count[model_name] += 1\n        else:\n            model_field_count[model_name] = 1\n    return model_field_count\n", "entry_point": "count_fields_added", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76402_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018333", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[5, 6, 9, 2, 1, 5]", "output": "[1, 2, 5, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018334", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'cadaacc'", "output": "'cadaacc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018335", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'Wwoorld'", "output": "{'w': 2, 'o': 2, 'r': 1, 'l': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24606_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018336", "code": "def initialize_initial(observation_weights):\n    initial = observation_weights[0]\n    return initial\n", "entry_point": "initialize_initial", "input": "[[1, 2, 3]]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018337", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 3, 0, 0, 0, 0, 3, 3]", "output": "[1, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018338", "code": "def max_consecutive_wins(scores):\n    if not scores:\n        return 0\n    current_streak = 0\n    max_streak = 0\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            current_streak += 1\n        else:\n            current_streak = 1\n        max_streak = max(max_streak, current_streak)\n    return max_streak\n", "entry_point": "max_consecutive_wins", "input": "[1, 2, 3, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108217_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018339", "code": "def extract_authors(packages):\n    authors_dict = {}\n    for package_info in packages:\n        name, version, author = package_info\n        authors_dict[name] = author\n    return authors_dict\n", "entry_point": "extract_authors", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4259_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018340", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[2, 2, 4, 1, 2]", "output": "[4, 6, 5, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018341", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[10, 20, 15, 13], 60", "output": "58", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3238", "output": "{1, 2, 1619, 3238}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018343", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[5, 6]", "output": "5.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018344", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "6, 16", "output": "b'\\x10\\x00\\x00\\x00\\x06\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018345", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'<PASSWORD>', '8dd8c05ca'", "output": "'8dd8c05ca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018346", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "150, 1.0", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018347", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    unique_scores = []\n    top_scores = []\n    for score in sorted_scores:\n        if score not in unique_scores:\n            unique_scores.append(score)\n            top_scores.append(score)\n            if len(top_scores) == n:\n                break\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[90, 88, 87, 84, 78], 4", "output": "87.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78119_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018348", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 6, 4, 2, 4, 1, 1, 4]", "output": "[6, 8, 6, 16, 5, 6, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018349", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2038", "output": "{1, 2, 1019, 2038}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2037", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018350", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "26.4732332, 10.0", "output": "116.4732332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4711", "output": "{1, 673, 7, 4711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4710", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018352", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'2.1.4'", "output": "'2.1.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018353", "code": "def circular_sum(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2, 4, 0, 3, 2, -1, 3, 2]", "output": "[4, 6, 4, 3, 5, 1, 2, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148378_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018354", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "10.0, 9.0", "output": "45.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5995", "output": "{1, 545, 5, 11, 5995, 109, 1199, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018356", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'127.012', 8082", "output": "'http://127.012:8082'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2066", "output": "{1, 2066, 2, 1033}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "822", "output": "{1, 2, 3, 6, 137, 274, 822, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018359", "code": "from typing import Tuple\ndef split_with_escape(input_str: str, separator: str) -> Tuple[str, str]:\n    key = ''\n    val = ''\n    escaped = False\n    for i in range(len(input_str)):\n        if input_str[i] == '\\\\' and not escaped:\n            escaped = True\n        elif input_str[i] == separator and not escaped:\n            val = input_str[i+1:]\n            break\n        else:\n            if escaped:\n                key += input_str[i]\n                escaped = False\n            else:\n                key += input_str[i]\n    return key, val\n", "entry_point": "split_with_escape", "input": "'aabz=;', ';'", "output": "('aabz=', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12144_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018360", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "10.9", "output": "373.0634", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018361", "code": "import typing\nFD_CLOEXEC = 1\nF_GETFD = 2\nF_SETFD = 3\ndef fcntl(fd: int, op: int, arg: int = 0) -> int:\n    if op == F_GETFD:\n        # Simulated logic to get file descriptor flags\n        return 777  # Placeholder value for demonstration\n    elif op == F_SETFD:\n        # Simulated logic to set file descriptor flags\n        return arg  # Placeholder value for demonstration\n    elif op == FD_CLOEXEC:\n        # Simulated logic to handle close-on-exec flag\n        return 1  # Placeholder value for demonstration\n    else:\n        raise ValueError(\"Invalid operation\")\n", "entry_point": "fcntl", "input": "1, 2", "output": "777", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147416_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018362", "code": "from typing import List, Dict\ndef get_tags(tags: List[Dict[str, str]]) -> List[str]:\n    tag_list = [tag[\"name\"] for tag in tags]\n    return tag_list\n", "entry_point": "get_tags", "input": "[{'name': 'blueberry'}, {'name': 'strawberry'}]", "output": "['blueberry', 'strawberry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87975_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018363", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'pyothon'", "output": "'Binary path for pyothon not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018364", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 2, 8, 6, 1, 5, 8, 8, 8]", "output": "[3, 3, 10, 9, 5, 10, 14, 15, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018365", "code": "def find_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    complement_sequence = ''\n    for nucleotide in dna_sequence:\n        complement_sequence += complement_dict.get(nucleotide.upper(), '')  # Handle case-insensitive input\n    return complement_sequence\n", "entry_point": "find_complement", "input": "'ACTC'", "output": "'TGAG'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101417_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018366", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    excluded_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(excluded_scores)\n    average = total / len(excluded_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 76, 78, 78, 80]", "output": "77.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103708_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018367", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'con!'", "output": "'on!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018368", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[95]", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018369", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    elif n == 1:\n        return 0\n    a, b = 0, 1\n    sum_fib = a + b\n    for _ in range(2, n):\n        a, b = b, a + b\n        sum_fib += b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "12", "output": "232", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146168_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018370", "code": "def apply_custom_schemes(custom_schemes, input_string):\n    formatted_string = input_string\n    for scheme in custom_schemes:\n        if scheme[\"type\"] == \"prefix\":\n            formatted_string = scheme[\"value\"] + \"_\" + formatted_string\n        elif scheme[\"type\"] == \"suffix\":\n            formatted_string = formatted_string + scheme[\"value\"]\n        elif scheme[\"type\"] == \"replace\":\n            formatted_string = formatted_string.replace(scheme[\"old\"], scheme[\"new\"])\n    return formatted_string\n", "entry_point": "apply_custom_schemes", "input": "[{'type': 'suffix', 'value': 'p'}], 'p'", "output": "'pp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62177_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9", "output": "{1, 3, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018372", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[3, 8, 5, 5, 5, 5, 5, 5, 6]", "output": "(47, 9, 3, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7521", "output": "{1, 7521, 3, 69, 327, 2507, 109, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018374", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "17", "output": "479808", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018375", "code": "def max_difference(lst):\n    min_val = float('inf')\n    max_diff = 0\n    for num in lst:\n        min_val = min(min_val, num)\n        max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61803_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018376", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "3.135, 2", "output": "3.14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018377", "code": "def check_ram_size(ram_size):\n    SYSTEM_RAM_GB_MAIN = 64\n    SYSTEM_RAM_GB_SMALL = 2\n    if ram_size >= SYSTEM_RAM_GB_MAIN:\n        return \"Sufficient RAM size\"\n    elif ram_size >= SYSTEM_RAM_GB_SMALL:\n        return \"Insufficient RAM size\"\n    else:\n        return \"RAM size too small\"\n", "entry_point": "check_ram_size", "input": "64", "output": "'Sufficient RAM size'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90224_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6531", "output": "{1, 2177, 3, 6531, 933, 7, 21, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018379", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "11", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018380", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'AiAAiAlicelece', ''", "output": "'Sample Election: AiAAiAlicelece'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018381", "code": "def split_list(x, n):\n    x = list(x)\n    if n < 2:\n        return [x]\n    def gen():\n        m = len(x) / n\n        i = 0\n        for _ in range(n-1):\n            yield x[int(i):int(i + m)]\n            i += m\n        yield x[int(i):]\n    return list(gen())\n", "entry_point": "split_list", "input": "[6, 9, 8, 3, 3, 0, 3, 6, 3], 6", "output": "[[6], [9, 8], [3], [3, 0], [3], [6, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38553_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018382", "code": "def berge_dominance(set_a, set_b):\n    for b_element in set_b:\n        if not any(a_element >= b_element for a_element in set_a):\n            return False\n    return True\n", "entry_point": "berge_dominance", "input": "[1, 2], [3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7140_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018383", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "'[1, 2, 1, 5]'", "output": "[1, 2, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8409", "output": "{1, 3, 8409, 2803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018385", "code": "def generate_code(input_string):\n    char_count = {}\n    for char in input_string:\n        char_count[char] = char_count.get(char, 0) + 1\n    code_chars = []\n    for char in input_string:\n        code_chars.extend([char] * char_count[char])\n    return ''.join(code_chars)\n", "entry_point": "generate_code", "input": "'hello'", "output": "'hellllo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57609_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018386", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9205", "output": "{1, 1315, 35, 5, 7, 263, 1841, 9205}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018387", "code": "def filter_vowel_starting_languages(languages):\n    vowels = ['a', 'e', 'i', 'o', 'u']\n    filtered_languages = []\n    for language in languages:\n        if language[0].lower() in vowels:\n            filtered_languages.append(language)\n    return filtered_languages\n", "entry_point": "filter_vowel_starting_languages", "input": "['aPythojava', 'CSharp', 'Ruby', 'Javascript']", "output": "['aPythojava']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110037_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018388", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[4, 4, 1, 2, 4, 4, 2, 4, 4]", "output": "[4, 5, 3, 5, 8, 9, 8, 11, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018389", "code": "import logging\ndef mapLogLevels(levels):\n    log_level_map = {\n        logging.ERROR: 'ERROR',\n        logging.WARN: 'WARN',\n        logging.INFO: 'INFO',\n        logging.DEBUG: 'DEBUG'\n    }\n    result = {}\n    for level in levels:\n        result[level] = log_level_map.get(level, 'UNKNOWN')\n    return result\n", "entry_point": "mapLogLevels", "input": "[20, 40, 11]", "output": "{20: 'INFO', 40: 'ERROR', 11: 'UNKNOWN'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125844_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018390", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "333", "output": "{1, 3, 37, 9, 333, 111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018391", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else []\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "calculate_top_players_average", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30456_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018392", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "13", "output": "[13, 40, 20, 10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018393", "code": "def fizz_buzz_transform(numbers):\n    transformed_list = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            transformed_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            transformed_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            transformed_list.append(\"Buzz\")\n        else:\n            transformed_list.append(num)\n    return transformed_list\n", "entry_point": "fizz_buzz_transform", "input": "[3, 15, 7, 5, 1, 8, 10]", "output": "['Fizz', 'FizzBuzz', 7, 'Buzz', 1, 8, 'Buzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20136_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018394", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2859", "output": "{3, 1, 2859, 953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018395", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "1234565", "output": "'1.234.565'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018396", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'fbffoobr'", "output": "'fbffoobr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8031", "output": "{1, 3, 2677, 8031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018398", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[-10, -10, -1]", "output": "-100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018399", "code": "def num_leading_zeros(class_num):\n    if class_num < 10:\n        return 4\n    elif class_num < 100:\n        return 3\n    elif class_num < 1000:\n        return 2\n    elif class_num < 10000:\n        return 1\n    else:\n        return 0\n", "entry_point": "num_leading_zeros", "input": "0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18260_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018400", "code": "import time\ndef convert_epoch_time(seconds):\n    time_struct = time.gmtime(seconds)\n    formatted_time = time.strftime('%a %b %d %H:%M:%S %Y', time_struct)\n    return formatted_time\n", "entry_point": "convert_epoch_time", "input": "1", "output": "'Thu Jan 01 00:00:01 1970'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107337_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6423", "output": "{1, 3, 2141, 6423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018402", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 40", "output": "'40%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3532", "output": "{1, 2, 4, 1766, 3532, 883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3531", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4702", "output": "{1, 2, 4702, 2351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018405", "code": "import sys\nimport xml.etree.ElementTree as ET\nimport json\nPY2 = sys.version_info[0] == 2\nPY3 = sys.version_info[0] == 3\nif PY2:\n    from StringIO import StringIO\n    from urllib2 import urlopen\n    from urllib2 import HTTPError\nelif PY3:\n    from io import StringIO\n    from urllib.request import urlopen\n    from urllib.error import HTTPError\ndef convert_data(url, output_format):\n    try:\n        response = urlopen(url)\n        data = response.read().decode('utf-8')\n        if output_format == 'xml':\n            root = ET.fromstring(data)\n            return ET.tostring(root, encoding='utf-8').decode('utf-8')\n        elif output_format == 'json':\n            return json.dumps(json.loads(data), indent=4)\n        else:\n            return \"Invalid output format. Please choose 'xml' or 'json'.\"\n    except HTTPError as e:\n        return f\"HTTP Error: {e.code}\"\n    except Exception as e:\n        return f\"An error occurred: {str(e)}\"\n", "entry_point": "convert_data", "input": "'sa/hh', 'json'", "output": "\"An error occurred: unknown url type: 'sa/hh'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108391_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018406", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'world'", "output": "{'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018407", "code": "from typing import Dict, List, TypeVar, Union\nJsonTypeVar = TypeVar(\"JsonTypeVar\")\nJsonPrimitive = Union[str, float, int, bool, None]\nJsonDict = Dict[str, JsonTypeVar]\nJsonArray = List[JsonTypeVar]\nJson = Union[JsonPrimitive, JsonDict, JsonArray]\ndef count_primitive_values(json_data: Json) -> int:\n    count = 0\n    if isinstance(json_data, (str, float, int, bool, type(None))):\n        return 1\n    if isinstance(json_data, dict):\n        for value in json_data.values():\n            count += count_primitive_values(value)\n    elif isinstance(json_data, list):\n        for item in json_data:\n            count += count_primitive_values(item)\n    return count\n", "entry_point": "count_primitive_values", "input": "[1, 'string', None]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7551_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018408", "code": "def reverse_str(s, k):\n    result = ''\n    for i in range(0, len(s), 2*k):\n        result += s[i:i+k][::-1] + s[i+k:i+2*k]\n    return result\n", "entry_point": "reverse_str", "input": "'abcaefg', 3", "output": "'cbaaefg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58788_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018409", "code": "import urllib.request\ndef get_status_code(url: str) -> int:\n    try:\n        req = urllib.request.Request(url)\n        response = urllib.request.urlopen(req)\n        status_code = response.getcode()\n        return status_code\n    except urllib.error.HTTPError as e:\n        return e.code\n    except urllib.error.URLError as e:\n        return -1  # Return -1 for URL errors\n", "entry_point": "get_status_code", "input": "'http://www.example.com'", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92229_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018410", "code": "def calculate_total_cost(products: list) -> float:\n    total_cost = 0\n    for product in products:\n        cost = product['price'] * product['quantity']\n        total_cost += cost\n    if total_cost >= 100:\n        total_cost *= 0.9  # Apply 10% discount\n    elif total_cost >= 50:\n        total_cost *= 0.95  # Apply 5% discount\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "[{'price': 15, 'quantity': 3}]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138535_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018411", "code": "def calculate_running_average_accuracy(predicted_labels, true_labels):\n    total_correct = 0\n    total_predictions = 0\n    running_average_accuracy = []\n    for predicted, true in zip(predicted_labels, true_labels):\n        total_predictions += 1\n        if predicted == true:\n            total_correct += 1\n        current_accuracy = total_correct / total_predictions\n        running_average_accuracy.append(current_accuracy)\n    return running_average_accuracy\n", "entry_point": "calculate_running_average_accuracy", "input": "[1, 0, 1], [1, 1, 1]", "output": "[1.0, 0.5, 0.6666666666666666]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97593_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018412", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'helsneo'", "output": "'helsneo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018413", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[300, 299, 298], 3", "output": "299.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018414", "code": "def classify_playlists(playlists):\n    classified_playlists = {}\n    for playlist in playlists:\n        name = playlist['name']\n        num_songs = len(playlist['songs'])\n        is_featured = playlist['is_featured']\n        if num_songs >= 5 and is_featured:\n            classified_playlists[name] = 'showcase'\n        else:\n            classified_playlists[name] = 'competition'\n    return classified_playlists\n", "entry_point": "classify_playlists", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79374_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018415", "code": "from typing import List, Optional\ndef majority_element(nums: List[int]) -> Optional[int]:\n    counter = {}\n    for num in nums:\n        if num not in counter:\n            counter[num] = 1\n        else:\n            counter[num] += 1\n    for key, value in counter.items():\n        if value > len(nums) / 2:\n            return key\n    return None\n", "entry_point": "majority_element", "input": "[2, 2, 2, 3, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131165_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018416", "code": "def count_unique_amino_acids(sequence):\n    unique_amino_acids = set()\n    for amino_acid in sequence:\n        if amino_acid.isalpha():  # Check if the character is an alphabet\n            unique_amino_acids.add(amino_acid)\n    return len(unique_amino_acids)\n", "entry_point": "count_unique_amino_acids", "input": "'AB123!!'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31328_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018417", "code": "import os\ndef select_load_balancer_strategy(mode):\n    if mode == 'CPUOnlyLB':\n        return 'CPU Only Load Balancer'\n    elif mode == 'WeightedRandomLB':\n        cpu_ratio = float(os.environ.get('NBA_LOADBALANCER_CPU_RATIO', 1.0))\n        return f'Weighted Random Load Balancer with CPU Ratio: {cpu_ratio}'\n    else:\n        return 'Unknown Load Balancer Strategy'\n", "entry_point": "select_load_balancer_strategy", "input": "'CPUOnlyLB'", "output": "'CPU Only Load Balancer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57619_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018418", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 3, 6, 4], [6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41084_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018419", "code": "def validate_mac_address(sanitizedMACAddress):\n    items = sanitizedMACAddress.split(\":\")\n    if len(items) != 6:\n        return False\n    HEXADECIMAL_CHARS = set('0123456789ABCDEF')\n    for section in items:\n        if len(section) != 2:\n            return False\n        if not all(char.upper() in HEXADECIMAL_CHARS for char in section):\n            return False\n    return True\n", "entry_point": "validate_mac_address", "input": "'00:1A:2B:3C:4D:5E'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86991_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018420", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9131", "output": "{1, 9131, 397, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3246", "output": "{1, 2, 3, 6, 3246, 1623, 1082, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3245", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018422", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "20", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018423", "code": "from typing import List\ndef find_longest_chain(pairs: List[List[int]]) -> int:\n    pairs.sort(key=lambda p: p[1])\n    tmp = pairs[0]\n    ans = 1\n    for p in pairs:\n        if p[0] > tmp[1]:\n            tmp = p\n            ans += 1\n    return ans\n", "entry_point": "find_longest_chain", "input": "[[1, 2], [3, 4]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12887_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018424", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "0.9659999999999997, 9", "output": "8.727999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018425", "code": "def calculate_running_average_accuracy(predicted_labels, true_labels):\n    total_correct = 0\n    total_predictions = 0\n    running_average_accuracy = []\n    for predicted, true in zip(predicted_labels, true_labels):\n        total_predictions += 1\n        if predicted == true:\n            total_correct += 1\n        current_accuracy = total_correct / total_predictions\n        running_average_accuracy.append(current_accuracy)\n    return running_average_accuracy\n", "entry_point": "calculate_running_average_accuracy", "input": "[0, 1], [1, 0]", "output": "[0.0, 0.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97593_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018426", "code": "def count_active_inactive_images(images):\n    active_count = 0\n    inactive_count = 0\n    for image in images:\n        if image.get('is_active', False):\n            active_count += 1\n        else:\n            inactive_count += 1\n    return {'active_count': active_count, 'inactive_count': inactive_count}\n", "entry_point": "count_active_inactive_images", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "{'active_count': 0, 'inactive_count': 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79578_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018427", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 15, 20, 1, 5, 21, 30, 40]", "output": "(3, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018428", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[10, -2, 8, 0, 8, -3, 8, 4]", "output": "[8, 6, 8, 8, 5, 5, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018429", "code": "def find_lcs_length_optimized(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length_optimized", "input": "'ABC', 'AXYBC'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28396_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018430", "code": "def move_player(movements):\n    player_position = [0, 0]\n    winning_position = [3, 4]\n    for move in movements:\n        if move == 'U' and player_position[1] < 4:\n            player_position[1] += 1\n        elif move == 'D' and player_position[1] > 0:\n            player_position[1] -= 1\n        elif move == 'L' and player_position[0] > 0:\n            player_position[0] -= 1\n        elif move == 'R' and player_position[0] < 3:\n            player_position[0] += 1\n        if player_position == winning_position:\n            print(\"Congratulations, you won!\")\n            break\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['U', 'U', 'U', 'U', 'R', 'R', 'R']", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49262_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018431", "code": "def most_frequent_word(text):\n    word_freq = {}\n    # Split the text into individual words\n    words = text.split()\n    # Count the frequency of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    # Find the word with the highest frequency\n    most_frequent = max(word_freq, key=word_freq.get)\n    return most_frequent, word_freq[most_frequent]\n", "entry_point": "most_frequent_word", "input": "'hello hello hello'", "output": "('hello', 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51755_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018432", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3838", "output": "{1, 2, 101, 38, 202, 19, 3838, 1919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3837", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018433", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'author'", "output": "'authors'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018434", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'sergveeis.sergveeis'", "output": "('sergveeis', 'sergveeis')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018435", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7559", "output": "{1, 7559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018436", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "' Spaces  in  bet'", "output": "('', 'Spaces  in  bet')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018437", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'1.a'", "output": "'1.b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018438", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3032", "output": "{1, 2, 4, 8, 1516, 758, 3032, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3031", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018439", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'she Tomlot'", "output": "'Jane Tomlot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018440", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2599", "output": "{1, 23, 113, 2599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018441", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[60, 70, 80, 70, 70]", "output": "70.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018442", "code": "def max_square_submatrix(matrix):\n    n = len(matrix)\n    aux_matrix = [[0 for _ in range(n)] for _ in range(n)]\n    # Copy the first row and first column as is\n    for i in range(n):\n        aux_matrix[i][0] = matrix[i][0]\n        aux_matrix[0][i] = matrix[0][i]\n    max_size = 0\n    for i in range(1, n):\n        for j in range(1, n):\n            if matrix[i][j] == 1:\n                aux_matrix[i][j] = min(aux_matrix[i-1][j], aux_matrix[i][j-1], aux_matrix[i-1][j-1]) + 1\n                max_size = max(max_size, aux_matrix[i][j])\n    return max_size ** 2\n", "entry_point": "max_square_submatrix", "input": "[[0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17968_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018443", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        if num >= 0:\n            total_sum += num\n            count += 1\n    if count == 0:\n        return 0  # To handle the case when there are no positive numbers\n    return total_sum / count\n", "entry_point": "calculate_average", "input": "[10.2, 14.2]", "output": "12.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5697_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018444", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8524", "output": "{1, 2, 4, 4262, 8524, 2131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8523", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018445", "code": "from typing import List\ndef filter_strings_by_prefix(strings: List[str], prefix: str) -> List[str]:\n    filtered_strings = []\n    for string in strings:\n        if string.startswith(prefix):\n            filtered_strings.append(string)\n    return filtered_strings\n", "entry_point": "filter_strings_by_prefix", "input": "['apple', 'banana', 'apricot'], 'app'", "output": "['apple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49160_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018446", "code": "def calculate_acertos(dados, rerolagens):\n    if dados == 0:\n        return 0\n    def mostraResultado(arg1, arg2):\n        # Placeholder for the actual implementation of mostraResultado\n        # For the purpose of this problem, we will simulate its behavior\n        return arg2 // 2, arg2 // 3\n    acertos_normal, dados_normal = mostraResultado('defesa', dados)\n    acertos_final = acertos_normal\n    if rerolagens > 0 and acertos_normal < dados_normal:\n        acertos_rerolagem, dados_rerodados = mostraResultado('defesa', rerolagens)\n        acertos_final += acertos_rerolagem\n    if acertos_final > dados_normal:\n        acertos_final = dados_normal\n    return acertos_final\n", "entry_point": "calculate_acertos", "input": "15, 0", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90056_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018447", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(12, 12), 'fan_avg'", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018448", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_counts = {}\n    for word in words:\n        word = word.strip('.,')  # Remove punctuation if present\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'baarkas'", "output": "{'baarkas': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117339_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018449", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'helhe'", "output": "['helhe']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018450", "code": "def sum_even_numbers(input_list):\n    total_sum = 0\n    for element in input_list:\n        if isinstance(element, str):\n            try:\n                num = int(element)\n                if num % 2 == 0:\n                    total_sum += num\n            except ValueError:\n                pass\n        elif isinstance(element, int) and element % 2 == 0:\n            total_sum += element\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "['110', 100, 122]", "output": "332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120619_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018451", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8590", "output": "{1, 2, 5, 4295, 10, 8590, 1718, 859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8589", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018452", "code": "from typing import List\ndef count_double_clicks(click_times: List[int]) -> int:\n    if not click_times:\n        return 0\n    double_clicks = 0\n    prev_click_time = click_times[0]\n    for click_time in click_times[1:]:\n        if click_time - prev_click_time <= 640:\n            double_clicks += 1\n        prev_click_time = click_time\n    return double_clicks\n", "entry_point": "count_double_clicks", "input": "[100, 200, 300, 400, 500]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15147_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018453", "code": "import math\ndef get_total_pages(post_list, count):\n    total_posts = len(post_list)\n    total_pages = math.ceil(total_posts / count)\n    return total_pages\n", "entry_point": "get_total_pages", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90417_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018454", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'1234-5678-9012-3456.'", "output": "'XXXX-XXXX-XXXX-XXXX.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018455", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[2, 1, 13, 13, 17, 2, 1, 14]", "output": "[2, 1, 4, 4, 8, 2, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018456", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 0, 0, 0, 1]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018457", "code": "import math\ndef count_perfect_squares(numbers):\n    count = 0\n    for num in numbers:\n        if math.isqrt(num) ** 2 == num:\n            count += 1\n    return count\n", "entry_point": "count_perfect_squares", "input": "[0, 1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144234_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018458", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5631", "output": "{1, 3, 1877, 5631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018459", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018460", "code": "def get_polarities(input_list):\n    polarity_map = {\n        1: -1,\n        0: 1,\n        3: 0,\n        2: None\n    }\n    output_list = []\n    for num in input_list:\n        if num in polarity_map:\n            output_list.append(polarity_map[num])\n        else:\n            output_list.append('Unknown')\n    return output_list\n", "entry_point": "get_polarities", "input": "[5, 3, 3, 0, 0, 0, 3]", "output": "['Unknown', 0, 0, 1, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26756_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018461", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "-119", "output": "-911", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018462", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8572", "output": "{1, 2, 4, 8572, 4286, 2143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8571", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018463", "code": "def detect_anomalies(progress_data):\n    anomalies = []\n    for i in range(1, len(progress_data)):\n        percentage_change = (progress_data[i] - progress_data[i-1]) / progress_data[i-1] * 100\n        if abs(percentage_change) >= 20:\n            anomalies.append((i, progress_data[i], progress_data[i-1]))\n    return anomalies\n", "entry_point": "detect_anomalies", "input": "[41, 9, 11, 39]", "output": "[(1, 9, 41), (2, 11, 9), (3, 39, 11)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142857_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018464", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "1.5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4117", "output": "{1, 179, 4117, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018466", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "0", "output": "'https://www.kaiheila.cn/api/v0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018467", "code": "def rotate(arr, n):\n    for _ in range(n):\n        x = arr[-1]\n        for i in range(len(arr) - 1, 0, -1):\n            arr[i] = arr[i - 1]\n        arr[0] = x\n    return arr\n", "entry_point": "rotate", "input": "[1, 2, 3, 4, 4, 7, 7], 3", "output": "[4, 7, 7, 1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51969_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6856", "output": "{1, 2, 3428, 4, 6856, 8, 1714, 857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6855", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018469", "code": "def extract_file_names(file_paths):\n    file_dict = {}\n    for file_path in file_paths:\n        file_name = file_path.split('/')[-1].split('.')[0]\n        file_extension = file_path.split('.')[-1]\n        if file_extension in file_dict:\n            file_dict[file_extension].append(file_name)\n        else:\n            file_dict[file_extension] = [file_name]\n    return file_dict\n", "entry_point": "extract_file_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12533_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018470", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 2, 0, 2, 0, -1, 5, 2, 2]", "output": "[4, 2, 2, 2, -1, 4, 7, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112058_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018471", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[1, 7, 2]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018472", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[2, 4]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018473", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[10, 10, 10, 11]", "output": "10.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018474", "code": "import re\nLANDSAT_TILE_REGEX = \"(L)(C|O|T|E)(7|8|5|4)(\\d{3})(\\d{3})(\\d{7})(\\w{3})(\\d{2})\"\nLANDSAT_SHORT_REGEX = \"(L)(C|O|T|E)(7|8|5|4)(\\d{3})(\\d{3})(\\d{7})\"\nMODIS_TILE_REGEX = \"(M)(Y|O)(D)(\\d{2})(G|Q|A)(\\w{1}|\\d{1}).(A\\d{7}).(h\\d{2}v\\d{2}).(\\d{3}).(\\d{13})\"\nLANDSAT_PRODUCTS = [\"oli8\", \"tm4\", \"tm5\", \"etm7\", \"olitirs8\"]\ndef validate_product_id(product_id: str) -> str:\n    landsat_tile_pattern = re.compile(LANDSAT_TILE_REGEX)\n    landsat_short_pattern = re.compile(LANDSAT_SHORT_REGEX)\n    modis_pattern = re.compile(MODIS_TILE_REGEX)\n    if landsat_tile_pattern.match(product_id) or landsat_short_pattern.match(product_id):\n        return \"Valid Landsat Product ID\"\n    elif modis_pattern.match(product_id):\n        return \"Valid MODIS Product ID\"\n    else:\n        return \"Invalid Product ID\"\n", "entry_point": "validate_product_id", "input": "'LC81420382015100LGN00'", "output": "'Valid Landsat Product ID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103922_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4371", "output": "{1, 3, 141, 47, 1457, 4371, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018476", "code": "from typing import List\ndef sum_within_ranges(lower_bounds: List[int]) -> int:\n    total_sum = 0\n    for i in range(len(lower_bounds) - 1):\n        start = lower_bounds[i]\n        end = lower_bounds[i + 1]\n        total_sum += sum(range(start, end))\n    total_sum += lower_bounds[-1]  # Add the last lower bound\n    return total_sum\n", "entry_point": "sum_within_ranges", "input": "[-2, 0]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29413_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018477", "code": "def validate_role_actions(role_actions: dict) -> bool:\n    for role_name, allotted_actions in role_actions.items():\n        if not isinstance(role_name, str):\n            return False\n        if not all(isinstance(action_name, str) for action_name in allotted_actions):\n            return False\n        if len(set(allotted_actions)) != len(allotted_actions):\n            return False\n    return True\n", "entry_point": "validate_role_actions", "input": "{'admin': ['create', 'delete', 'update'], 'user': ['read', 'update']}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1528_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5333", "output": "{1, 5333}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7486", "output": "{1, 2, 197, 38, 394, 19, 7486, 3743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7485", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018480", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'examanothact'", "output": "'contracts/examanothact.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018481", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[0, 2, 2, 1, 5, 4, 4]", "output": "[4, 4, 5, 1, 2, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018482", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[3, 2, 1, 3, 3, 6, 2, 2]", "output": "[5, 3, 4, 6, 9, 8, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018483", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'r1r'", "output": "['r1r']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018484", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'30aea4e5638'", "output": "'30aea4FFFEe5638'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3026", "output": "{1, 2, 34, 1513, 17, 3026, 178, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018486", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[7, 7, 8, 8, 7, 2, 2, 2]", "output": "[7, 8, 10, 11, 11, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018487", "code": "def make_cls_name(base: str, replacement: str) -> str:\n    return base.replace(\"Base\", replacement)\n", "entry_point": "make_cls_name", "input": "'BaseB', 'seClass'", "output": "'seClassB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120218_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018488", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 88, 90, 86]", "output": "87.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5463_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2601", "output": "{1, 289, 867, 3, 9, 2601, 17, 51, 153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018490", "code": "def evaluate_expression(expression: str) -> int:\n    def evaluate_helper(tokens):\n        stack = []\n        for token in tokens:\n            if token == '(':\n                stack.append('(')\n            elif token == ')':\n                sub_expr = []\n                while stack[-1] != '(':\n                    sub_expr.insert(0, stack.pop())\n                stack.pop()  # Remove '('\n                stack.append(evaluate_stack(sub_expr))\n            else:\n                stack.append(token)\n        return evaluate_stack(stack)\n    def evaluate_stack(stack):\n        operators = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y}\n        res = int(stack.pop(0))\n        while stack:\n            operator = stack.pop(0)\n            operand = int(stack.pop(0))\n            res = operators[operator](res, operand)\n        return res\n    tokens = expression.replace('(', ' ( ').replace(')', ' ) ').split()\n    return evaluate_helper(tokens)\n", "entry_point": "evaluate_expression", "input": "'(1 - 6)'", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122820_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018491", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018492", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[10, 4, 5, 4, 2, 6, 6]", "output": "[10, 6, 6, 5, 4, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018493", "code": "from typing import List, Dict, Any\ndef validate_speaker_data(data: List[Dict[str, Any]]) -> bool:\n    for speaker_data in data:\n        if 'list_of_speakers_id' not in speaker_data or 'user_id' not in speaker_data:\n            return False\n    return True\n", "entry_point": "validate_speaker_data", "input": "[{'list_of_speakers_id': [1, 2, 3], 'user_id': 123}]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75079_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4495", "output": "{1, 899, 5, 4495, 145, 155, 29, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018495", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'1.2.0.2.0100deiacteex.0', '11.2.0'", "output": "'11.2.01.2.0.2.0100deiacteex.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018496", "code": "def calculate_difference(n):\n    square_of_sum = (n ** 2 * (n + 1) ** 2) / 4\n    sum_of_squares = (n * (n + 1) * ((2 * n) + 1)) / 6\n    return int(square_of_sum - sum_of_squares)\n", "entry_point": "calculate_difference", "input": "5", "output": "170", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42300_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018497", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "125", "output": "'2:05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018498", "code": "def generate_sequence(seed, length):\n    a = 1664525\n    c = 1013904223\n    m = 2**32\n    sequence = []\n    x = seed\n    for _ in range(length):\n        x = (a * x + c) % m\n        sequence.append(x)\n    return sequence\n", "entry_point": "generate_sequence", "input": "42, 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64118_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018499", "code": "def extract_altered_fields(migrations):\n    altered_fields_dict = {}\n    for model_name, field_alterations in migrations:\n        altered_fields = [field for field, success in field_alterations if success]\n        altered_fields_dict[model_name] = altered_fields\n    return altered_fields_dict\n", "entry_point": "extract_altered_fields", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10055_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018500", "code": "def calculate_train_info(total_loss, total_acc, i):\n    train_info = {}\n    train_info['loss'] = total_loss / float(i + 1)\n    train_info['train_accuracy'] = total_acc / float(i + 1)\n    return train_info\n", "entry_point": "calculate_train_info", "input": "102.0, 77.0, 3", "output": "{'loss': 25.5, 'train_accuracy': 19.25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45300_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018501", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 30]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018502", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mtr.symt.apps.Mtrim'", "output": "('mtr.symt.apps', 'Mtrim')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018503", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[15, 12, -1, -5, 0]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018504", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'orrr', 4", "output": "'orrr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018505", "code": "def sum_greater_than_average(arr):\n    if not arr:\n        return 0\n    avg = sum(arr) / len(arr)\n    filtered_elements = [num for num in arr if num > avg]\n    return sum(filtered_elements)\n", "entry_point": "sum_greater_than_average", "input": "[1, 3, 5, 7, 9]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30094_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018506", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0, -1, 0, -1, 0, -1]", "output": "{0, -1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018507", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[0, 5, 0, 3, 4, 4, 6, 3]", "output": "[0, 5, 5, 8, 12, 16, 22, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9829", "output": "{1, 9829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018509", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level1': 998}", "output": "998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2897", "output": "{2897, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018511", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018512", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 4, 4, 3, 3, 3, 3]", "output": "[4, 8, 9, 12, 15, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77019_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018513", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 6, 2, 4, 7, 2, 6]", "output": "[1, 36, 4, 16, 343, 4, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018514", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8659", "output": "{1, 8659, 1237, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018515", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'1.0.9'", "output": "'1.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018516", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "200, 100, 50, 68", "output": "418", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018517", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[10, 9, 8, 8]", "output": "8.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018518", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/he/../he/h/home/documnt/se'", "output": "'/he/h/home/documnt/se'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018519", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'ttte'", "output": "'ttte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018520", "code": "def group_strings_by_length(input_list):\n    grouped_strings = {}\n    for item in input_list:\n        if isinstance(item, str):\n            length = len(item)\n            if length not in grouped_strings:\n                grouped_strings[length] = [item]\n            else:\n                grouped_strings[length].append(item)\n    return grouped_strings\n", "entry_point": "group_strings_by_length", "input": "['worhellold', 'whelddwod']", "output": "{10: ['worhellold'], 9: ['whelddwod']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60102_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018521", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[2, 6, 1, 8, 0, 0, 7, 2, 2]", "output": "[2, 7, 3, 11, 4, 5, 13, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018522", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'Nyooydng'", "output": "{'nyooydng': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018523", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'ex80example', 'e12ame123'", "output": "'ws://ex80example/e12ame123/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018524", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018525", "code": "def sum_multiples_of_divisor(numbers, divisor):\n    sum_multiples = 0\n    for num in numbers:\n        if num % divisor == 0:\n            sum_multiples += num\n    return sum_multiples\n", "entry_point": "sum_multiples_of_divisor", "input": "[], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74016_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018526", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/base/path/sibling', '/base/path/ho'", "output": "'../ho'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018527", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[3, 4, 1, 5, 3, 1, 2, 2, 2]", "output": "[3, 7, 8, 13, 16, 17, 19, 21, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018528", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5741", "output": "{1, 5741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018529", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'exampl_path'", "output": "'exampl_path'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018530", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'#'", "output": "'#'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018531", "code": "def generate_fibonacci(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci", "input": "3", "output": "[0, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4928_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018532", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[50, 1, 55]", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5966", "output": "{1, 2, 38, 2983, 5966, 19, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018534", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[3, 1, 1, 5, 5, 1, 1, 0]", "output": "[1, 1, 1, 5, 1, 1, 1, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1171", "output": "{1, 1171}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018536", "code": "def sum_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0, 17]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117166_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018537", "code": "from typing import List\ndef weighted_sum(methods: List[tuple]) -> float:\n    total_weighted_sum = 0\n    for result, frames in methods:\n        total_weighted_sum += result * frames\n    return total_weighted_sum\n", "entry_point": "weighted_sum", "input": "[(5.0, 4)]", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26992_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018538", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < n:\n            top_scores.append(score)\n        else:\n            min_score = min(top_scores)\n            if score > min_score:\n                top_scores.remove(min_score)\n                top_scores.append(score)\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[44, 45, 46], 3", "output": "45.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018539", "code": "_flav_dict = {\"g\": 21, \"d\": 1, \"u\": 2, \"s\": 3, \"c\": 4, \"b\": 5, \"t\": 6}\ndef get_particle(flav_str, skip_error=False):\n    particle = _flav_dict.get(flav_str[0])\n    if particle is None:\n        if not skip_error:\n            raise ValueError(f\"Could not understand the incoming flavour: {flav_str}. You can skip this error by using --no_pdf\")\n        else:\n            return None\n    if flav_str[-1] == \"~\":\n        particle = -particle\n    return particle\n", "entry_point": "get_particle", "input": "'u'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112786_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018540", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "2, 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018541", "code": "def decode_cipher(encoded_str, shift):\n    decoded_str = ''\n    for char in encoded_str:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            decoded_char = chr((ord(char) - shift - base) % 26 + base)\n            decoded_str += decoded_char\n        else:\n            decoded_str += char\n    return decoded_str\n", "entry_point": "decode_cipher", "input": "'oqnb', 1", "output": "'npma'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69667_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018542", "code": "from typing import List\ndef remaining_people(line: List[int]) -> int:\n    shortest_height = float('inf')\n    shortest_index = 0\n    for i, height in enumerate(line):\n        if height < shortest_height:\n            shortest_height = height\n            shortest_index = i\n    return len(line[shortest_index:])\n", "entry_point": "remaining_people", "input": "[10, 20, 15, 5, 30, 25]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74868_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018543", "code": "def process_book_data(data):\n    attachment_names = set()\n    attachment_map = {}\n    for item in data:\n        if item['type'] == 'attachment':\n            attachment_names.add(item['name'])\n        elif item['type'] == 'author':\n            author_id = item['author_id']\n            for book_id in item['book_ids']:\n                for attachment_name in attachment_names:\n                    if attachment_name not in attachment_map:\n                        attachment_map[attachment_name] = []\n                    if book_id not in attachment_map[attachment_name]:\n                        attachment_map[attachment_name].append(book_id)\n    return attachment_map\n", "entry_point": "process_book_data", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105241_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018544", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "19", "output": "0.022105263157894735", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5497", "output": "{239, 1, 5497, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018546", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(1, 2, -1, -4, 1, 1, 0, 1)", "output": "'(1.2.-1.-4.1.1.0.1)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018547", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7043", "output": "{1, 7043}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018548", "code": "from typing import List\ndef manipulate_data(input_data: List[List[float]], sigma: float) -> List[List[float]]:\n    for row in input_data:\n        for col_idx, val in enumerate(row):\n            if col_idx != 0:  # Skip the \"Time\" column\n                row[col_idx] += sigma  # Apply noise\n                row[col_idx] *= sigma * sigma  # Set weight\n    return input_data\n", "entry_point": "manipulate_data", "input": "[], 1.0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59282_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018549", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "11", "output": "11.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018550", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 2, 3, 4], 5", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108386_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018551", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[5, 3, 1, 1, 2, 2, 2, 2, 4]", "output": "[5, 3, 1, 1, 2, 2, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018552", "code": "def reverse_with_replace(input_string):\n    # Replace \"redis\" with \"python\" in the input string\n    modified_string = input_string.replace(\"redis\", \"python\")\n    # Reverse the modified string\n    reversed_string = modified_string[::-1]\n    return reversed_string\n", "entry_point": "reverse_with_replace", "input": "'python'", "output": "'nohtyp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60196_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018553", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[6, 2, 1, 3, 5, 5, 5]", "output": "[6, 8, 9, 12, 17, 22, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018554", "code": "from typing import List\ndef select_best_genome(fitness_scores: List[int]) -> int:\n    best_index = 0\n    best_fitness = fitness_scores[0]\n    for i in range(1, len(fitness_scores)):\n        if fitness_scores[i] > best_fitness:\n            best_fitness = fitness_scores[i]\n            best_index = i\n    return best_index\n", "entry_point": "select_best_genome", "input": "[10, 20, 30, 40, 50]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91198_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018555", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'s textix'", "output": "{'s': 1, 'textix': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15367_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018556", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'foo=bar&baz=qux'", "output": "{'foo': 'bar', 'baz': 'qux'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018557", "code": "def caesar_cipher(text, shift):\n    result = \"\"\n    for char in text:\n        if char.isupper():\n            new_char = chr((ord(char) - 65 + shift) % 26 + 65)\n            result += new_char\n    return result\n", "entry_point": "caesar_cipher", "input": "'HELLO', 3", "output": "'KHOOR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7376_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5261", "output": "{1, 5261}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5260", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018559", "code": "from typing import List\ndef calculate_unique_views(view_ids: List[int]) -> int:\n    unique_views = set()\n    for view_id in view_ids:\n        unique_views.add(view_id)\n    return len(unique_views)\n", "entry_point": "calculate_unique_views", "input": "[1, 2, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46079_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018560", "code": "def parse_events_simple(s):\n    fields = []\n    lines = s.strip().split('\\n')\n    for line in lines:\n        if line.startswith(\"data:\"):\n            name, data = \"data\", line.split(\":\", 1)[1].strip()\n        elif line.startswith(\"id:\"):\n            name, data = \"id\", line.split(\":\", 1)[1].strip()\n        elif line.startswith(\"event:\"):\n            name, data = \"event\", line.split(\":\", 1)[1].strip()\n        else:\n            continue\n        fields.append((name, data))\n    return fields\n", "entry_point": "parse_events_simple", "input": "'event: '", "output": "[('event', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29131_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018561", "code": "import unicodedata\ndef count_unique_chars(input_string):\n    normalized_string = ''.join(c for c in unicodedata.normalize('NFD', input_string.lower()) if unicodedata.category(c) != 'Mn' and c.isalnum())\n    char_count = {}\n    for char in normalized_string:\n        char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'ffcae11'", "output": "{'f': 2, 'c': 1, 'a': 1, 'e': 1, '1': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74363_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018562", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[1, 7, 2, 1, 6, 1, 2, 2, 2]", "output": "[8, 9, 3, 7, 7, 3, 4, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018563", "code": "def calculate_average_grade(grades):\n    grade_values = {'A': 95, 'B': 85, 'C': 75, 'D': 65, 'F': 30}  # Mapping of grades to numerical values\n    total_grade = sum(grade_values.get(grade, 0) for grade in grades)\n    average_grade = total_grade / len(grades)\n    if 90 <= average_grade <= 100:\n        letter_grade = 'A'\n    elif 80 <= average_grade < 90:\n        letter_grade = 'B'\n    elif 70 <= average_grade < 80:\n        letter_grade = 'C'\n    elif 60 <= average_grade < 70:\n        letter_grade = 'D'\n    else:\n        letter_grade = 'F'\n    return average_grade, letter_grade\n", "entry_point": "calculate_average_grade", "input": "['C', 'D']", "output": "(70.0, 'C')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101290_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018564", "code": "def sum_of_lists(lists):\n    total_sum = 0\n    for inner_list in lists:\n        total_sum += sum(inner_list)\n    return total_sum\n", "entry_point": "sum_of_lists", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018565", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6238", "output": "{1, 2, 6238, 3119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018566", "code": "import math\ndef download_manager(file_sizes, download_speed):\n    total_time = 0\n    file_sizes.sort(reverse=True)  # Sort file sizes in descending order\n    for size in file_sizes:\n        time_to_download = size / download_speed\n        total_time += math.ceil(time_to_download)  # Round up to nearest whole number\n    return total_time\n", "entry_point": "download_manager", "input": "[90, 2], 2", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131368_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018567", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'pyt.'", "output": "'Pyt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018568", "code": "mod = 10 ** 9 + 7\ndef count_ways(S):\n    A = [0] * (S + 1)\n    A[0] = 1\n    for s in range(3, S + 1):\n        A[s] = (A[s-3] + A[s-1]) % mod\n    return A[S]\n", "entry_point": "count_ways", "input": "3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7358_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018569", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=0-'", "output": "(0, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018570", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "' Hol\u00e0 chicanos '", "output": "'Hol\u00e0 chicanos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018571", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'nammename'", "output": "'nammename'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018572", "code": "def generate_fibonacci_sequence(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "3", "output": "[0, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32126_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018573", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'5:15 PM', '2:20'", "output": "'7:35 PM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018574", "code": "def balancedSums(arr):\n    total_sum = sum(arr)\n    left_sum = 0\n    for i in range(len(arr)):\n        total_sum -= arr[i]\n        if left_sum == total_sum:\n            return i\n        left_sum += arr[i]\n    return -1\n", "entry_point": "balancedSums", "input": "[1, 2, 3, 0, 3, 3, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101017_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018575", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'__titl__o'", "output": "'__titl__o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018576", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5165", "output": "{1, 5, 5165, 1033}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5164", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1279", "output": "{1, 1279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018578", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'ueo\" \"some_value\"'", "output": "{'ueo\"': 'N/A'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018579", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[3, 0, 2, 0, 3, 0, 3, 0, 2]", "output": "'aaabbcccdddee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018580", "code": "def calculate_routes(m, n):\n    # Initialize a 2D array to store the number of routes to reach each cell\n    routes = [[0 for _ in range(n)] for _ in range(m)]\n    # Initialize the number of routes to reach the starting point as 1\n    routes[0][0] = 1\n    # Calculate the number of routes for each cell in the grid\n    for i in range(m):\n        for j in range(n):\n            if i > 0:\n                routes[i][j] += routes[i - 1][j]  # Add the number of routes from above cell\n            if j > 0:\n                routes[i][j] += routes[i][j - 1]  # Add the number of routes from left cell\n    # The number of routes to reach the destination is stored in the bottom-right cell\n    return routes[m - 1][n - 1]\n", "entry_point": "calculate_routes", "input": "6, 4", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9475_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018581", "code": "def count_even_odd(numbers):\n    even_count = 0\n    odd_count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n    return even_count, odd_count\n", "entry_point": "count_even_odd", "input": "[0, 2, 4, 1, 3, 5, 7, 9, 11]", "output": "(3, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51670_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018582", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9819", "output": "{1, 3, 1091, 3273, 9, 9819}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018583", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "[31.0, 10.0, 29.0, 9.0]", "output": "[30.0, 9.5, -2.0, -1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018584", "code": "def extract_optimization_levels(languages):\n    optimization_levels = {}\n    for lang in languages:\n        lang, opt_level = lang.split(\" = \")\n        if lang in optimization_levels:\n            optimization_levels[lang].append(int(opt_level))\n        else:\n            optimization_levels[lang] = [int(opt_level)]\n    return optimization_levels\n", "entry_point": "extract_optimization_levels", "input": "['cava = 3']", "output": "{'cava': [3]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72810_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018585", "code": "import re\ndef sub(message, regex):\n    parts = regex.split(\"/\")\n    pattern = parts[1]\n    replacement = parts[2]\n    flags = parts[3] if len(parts) > 3 else \"\"\n    count = 1\n    if \"g\" in flags:\n        count = 0\n    elif flags.isdigit():\n        count = int(flags)\n    return re.sub(pattern, replacement, message, count)\n", "entry_point": "sub", "input": "'Hello, World!', '/o/0/'", "output": "'Hell0, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32281_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018586", "code": "from typing import List\nMAX_FORCE = 10.0\nTARGET_VELOCITY = 5.0\nMULTIPLY = 2.0\ndef calculate_total_force(robot_velocities: List[float]) -> float:\n    total_force = sum([MAX_FORCE * (TARGET_VELOCITY - vel) * MULTIPLY for vel in robot_velocities])\n    return total_force\n", "entry_point": "calculate_total_force", "input": "[4.0, 4.0]", "output": "40.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22767_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9539", "output": "{1, 9539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018588", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'AllicAlicee', '2024 Presidential Election'", "output": "'Sample Election: AllicAlicee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018589", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "25, 7", "output": "480700", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt64", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1501", "output": "{1, 19, 1501, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018591", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3661", "output": "'1 hr 1 min 1 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018592", "code": "def get_file_extension(file_path):\n    # Find the last occurrence of the period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring starting from the last period to the end of the file path\n    if last_period_index != -1:  # Check if a period was found\n        file_extension = file_path[last_period_index:]\n        return file_extension\n    else:\n        return \"\"  # Return an empty string if no period was found\n", "entry_point": "get_file_extension", "input": "'file.cs'", "output": "'.cs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141157_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018593", "code": "import re\nTRAILING_WS_IN_CONTINUATION = re.compile(r'\\\\ \\s+\\n')\ndef remove_trailing_whitespace(input_string: str) -> str:\n    return TRAILING_WS_IN_CONTINUATION.sub(r'\\\\n', input_string)\n", "entry_point": "remove_trailing_whitespace", "input": "'1\\\\ \\n12323'", "output": "'1\\\\ \\n12323'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71646_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018594", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'name=Dima'", "output": "{'name': 'Dima'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018595", "code": "def deep_camel_case_transform(data):\n    if isinstance(data, dict):\n        camelized_data = {}\n        for key, value in data.items():\n            new_key = key.replace('_', ' ').title().replace(' ', '')\n            camelized_data[new_key] = deep_camel_case_transform(value)\n        return camelized_data\n    elif isinstance(data, list):\n        return [deep_camel_case_transform(item) for item in data]\n    else:\n        return data\n", "entry_point": "deep_camel_case_transform", "input": "'work'", "output": "'work'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50306_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018596", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "2", "output": "'oh la la'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018597", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'expr: COLON expr'", "output": "('expr', 'COLON expr', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7531", "output": "{1, 7531, 443, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9285", "output": "{1, 1857, 3, 5, 9285, 619, 15, 3095}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018600", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7599", "output": "{1, 3, 2533, 7599, 17, 51, 149, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018601", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "7", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4761", "output": "{1, 3, 69, 9, 207, 529, 1587, 23, 4761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018603", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'T'", "output": "'T'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018604", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coeff in coefficients[::-1]:\n        result = result * x + coeff\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[888813], 1", "output": "888813", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110926_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018605", "code": "def calculate_total_epochs(batch_size, last_epoch, min_unit):\n    if last_epoch < min_unit:\n        return min_unit\n    else:\n        return last_epoch + min_unit\n", "entry_point": "calculate_total_epochs", "input": "5, 5, 5", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134381_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018606", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[1, 2, 3]", "output": "{1, 2, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018607", "code": "def dummy(n):\n    total_sum = sum(range(1, n + 1))\n    return total_sum\n", "entry_point": "dummy", "input": "1003", "output": "503506", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124894_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018608", "code": "import re\ndef extract_email(api_info: str) -> str:\n    email_pattern = r'<([^<>]+)>'\n    match = re.search(email_pattern, api_info)\n    if match:\n        return match.group(1)\n    else:\n        return 'Email not found'\n", "entry_point": "extract_email", "input": "'<examply\"\"\" Accoum>'", "output": "'examply\"\"\" Accoum'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018609", "code": "from typing import List, Dict, Union\ndef update_contact_notes(profile_updates: List[Dict[str, Union[int, str]]]) -> List[str]:\n    updated_notes = []\n    for update in profile_updates:\n        try:\n            r = users[\"c_in\"].post(\n                f\"/api/v2/recipients/{update['pk']}/\",\n                {\n                    \"pk\": update['pk'],\n                    \"notes\": update['notes'],\n                },\n            )\n            if r.status_code == 200:\n                calvin.refresh_from_db()\n                updated_notes.append(calvin.notes)\n            else:\n                updated_notes.append(\"Update failed\")\n        except Exception as e:\n            updated_notes.append(\"Update failed\")\n    return updated_notes\n", "entry_point": "update_contact_notes", "input": "[{'pk': 9999, 'notes': 'Test note'}]", "output": "['Update failed']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11594_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018610", "code": "def process_form_fields(form_fields):\n    field_widget_map = {}\n    for field_info in form_fields:\n        field_name = field_info.get(\"field\")\n        widget_type = field_info.get(\"widget\")\n        field_widget_map[field_name] = widget_type\n    return field_widget_map\n", "entry_point": "process_form_fields", "input": "[{'field': None, 'widget': None}]", "output": "{None: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33401_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018611", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[4, 4, 4, 2, 2, 2, 2]", "output": "{4: 3, 2: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018612", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[3, 0, 0, 2.0, 2.0, 2.87]", "output": "2.29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018613", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcdefgh', 'ijklmnopq'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018614", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[-1, 1, 3, 2, -1, 5, -1, 3, 5]", "output": "[-1, 2, 5, 5, 3, 10, 5, 10, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018615", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7558", "output": "{1, 2, 3779, 7558}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8342", "output": "{1, 2, 194, 97, 4171, 43, 8342, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018617", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3447", "output": "{1, 3, 9, 3447, 1149, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7939", "output": "{1, 7939, 17, 467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018619", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'3w'", "output": "1814400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018620", "code": "import os\ndef determine_file_location(relative_root: str, location_type: str, root_folder: str = '') -> str:\n    MS_DATA = os.getenv('MS_DATA', '')  # Get the value of MS_DATA environment variable or default to empty string\n    if location_type == 'LOCAL':\n        full_path = os.path.join(root_folder, relative_root)\n    elif location_type == 'S3':\n        full_path = os.path.join('s3://' + root_folder, relative_root)\n    else:\n        raise ValueError(\"Invalid location type. Supported types are 'LOCAL' and 'S3'.\")\n    return full_path\n", "entry_point": "determine_file_location", "input": "'data/file.txt', 'S3', 'bucket-name'", "output": "'s3://bucket-name/data/file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7795_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018621", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[circular_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 3, 3, 2, 2, 4, 1, 1]", "output": "[4, 6, 5, 4, 6, 5, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51677_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018622", "code": "from typing import List\ndef single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "single_number", "input": "[-1, 1, 1]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118847_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018623", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 3, 2, 6, 6, 2, 7, 7, 2]", "output": "[7, 4, 4, 9, 10, 7, 13, 14, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25747_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018624", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "7", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7658", "output": "{1, 2, 547, 1094, 7, 7658, 14, 3829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7657", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6597", "output": "{1, 3, 6597, 9, 2199, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018627", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 25, 50]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018628", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[6, 2, 3, 2, 7, 3, 6, 3, 2]", "output": "[6, 3, 5, 5, 11, 8, 12, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018629", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'gglglean_', 10", "output": "'gglglean__high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018630", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.isupper():\n            encrypted_text += chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif char.islower():\n            encrypted_text += chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'svph!sv', 2", "output": "'uxrj!ux'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123131_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018631", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'UUUUR'", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018632", "code": "def generate_down_revision(revision):\n    down_revision = revision[::-1].lower()\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'898e1'", "output": "'1e898'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7052_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018633", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-9, -8, -8, -2, 9, 9, 9, 9, 10]", "output": "[-9, -8, -8, -2, 9, 9, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6875", "output": "{1, 5, 11, 625, 275, 55, 25, 6875, 125, 1375}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018635", "code": "def max_light_intensity(intensity_readings, threshold_start, threshold_end):\n    max_intensity = 0\n    scenario_started = False\n    for intensity in intensity_readings:\n        if not scenario_started and intensity >= threshold_start:\n            scenario_started = True\n            max_intensity = intensity\n        elif scenario_started:\n            if intensity < threshold_end:\n                break\n            max_intensity = max(max_intensity, intensity)\n    return max_intensity\n", "entry_point": "max_light_intensity", "input": "[], 1, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55367_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018636", "code": "def count_custom_list_display(registered_models, admin_classes):\n    custom_list_display_count = 0\n    for model, admin_class in registered_models.items():\n        if admin_class and admin_class in admin_classes:\n            if 'list_display' in admin_classes[admin_class]:\n                custom_list_display_count += 1\n    return custom_list_display_count\n", "entry_point": "count_custom_list_display", "input": "{}, {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19006_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018637", "code": "def find_basement_position(input_str):\n    floor = 0\n    for idx, char in enumerate(input_str):\n        if char == \"(\":\n            floor += 1\n        elif char == \")\":\n            floor -= 1\n        if floor == -1:\n            return idx + 1\n    return -1\n", "entry_point": "find_basement_position", "input": "'((()())()))'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129859_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018638", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "1, 10, 2", "output": "[1, 3, 5, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018639", "code": "def analyze_strings(strings):\n    positions = {}\n    most_common = ''\n    least_common = ''\n    for line in strings:\n        for i, c in enumerate(line):\n            v = positions.setdefault(i, {}).setdefault(c, 0)\n            positions[i][c] = v + 1\n    for p in positions.values():\n        s = sorted(p.items(), key=lambda kv: kv[1], reverse=True)\n        most_common += s[0][0]\n        least_common += s[-1][0]\n    return most_common, least_common\n", "entry_point": "analyze_strings", "input": "[]", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43933_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018640", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cbad', 'abcd'", "output": "'cbad'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018641", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 86, 87, 90]", "output": "86.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61985_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018642", "code": "import re\nfrom typing import List\ndef extract_matches(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-zA-Z0-9]*\\b'  # Define the pattern for matching words\n    matches = re.findall(pattern, text)  # Find all matches in the text\n    unique_matches = list(set(matches))  # Get unique matches by converting to set and back to list\n    return unique_matches\n", "entry_point": "extract_matches", "input": "'provbatcSpaesi'", "output": "['provbatcSpaesi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76446_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018643", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[10, 4, 1, 2, 3]", "output": "(10, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018644", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.DoeJoJo.DJe@Eo'", "output": "'john.doejojo.dje@eo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018645", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "6", "output": "'oh la laoh la laoh la la'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018646", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "915", "output": "{1, 3, 5, 15, 305, 915, 183, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt914", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018647", "code": "OUT_RECALL = 0.9\nOUT_PRECISION = 0.8\ndef weighted_average(recall: float, precision: float) -> float:\n    weighted_avg = (OUT_RECALL * recall + OUT_PRECISION * precision) / (OUT_RECALL + OUT_PRECISION)\n    return weighted_avg\n", "entry_point": "weighted_average", "input": "0.9, 0.69375", "output": "0.8029411764705883", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17070_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018648", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "'http://sub.domain.org'", "output": "'sub.domain.org'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018649", "code": "def apply_relu(input_list):\n    output_list = []\n    for num in input_list:\n        output_list.append(max(0, num))\n    return output_list\n", "entry_point": "apply_relu", "input": "[2.1, 2.0, -1.0, 2.0, 3.6]", "output": "[2.1, 2.0, 0, 2.0, 3.6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117710_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018650", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3559", "output": "{1, 3559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018651", "code": "def deep_camel_case_transform(data):\n    if isinstance(data, dict):\n        camelized_data = {}\n        for key, value in data.items():\n            new_key = key.replace('_', ' ').title().replace(' ', '')\n            camelized_data[new_key] = deep_camel_case_transform(value)\n        return camelized_data\n    elif isinstance(data, list):\n        return [deep_camel_case_transform(item) for item in data]\n    else:\n        return data\n", "entry_point": "deep_camel_case_transform", "input": "{'first_address': '123 Main St'}", "output": "{'FirstAddress': '123 Main St'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50306_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018652", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'hello world hello world'", "output": "{'hello': 2, 'world': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9448", "output": "{1, 2, 4, 9448, 8, 4724, 2362, 1181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9447", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018654", "code": "def sum_multiples_3_and_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_and_5", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95576_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018655", "code": "def count_temperatures_in_range(temperatures, min_kelvin, max_kelvin):\n    count = 0\n    for temp in temperatures:\n        if min_kelvin <= temp <= max_kelvin:\n            count += 1\n    return count\n", "entry_point": "count_temperatures_in_range", "input": "[240, 260, 270, 310], 250, 300", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141087_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018656", "code": "import re\ndef is_secure_revision(revision):\n    if len(revision) < 8:\n        return False\n    if not any(char.isupper() for char in revision):\n        return False\n    if not any(char.islower() for char in revision):\n        return False\n    if not any(char.isdigit() for char in revision):\n        return False\n    if not any(not char.isalnum() for char in revision):\n        return False\n    if re.search(r'(?i)PASSWORD', revision):\n        return False\n    return True\n", "entry_point": "is_secure_revision", "input": "'Ab3cdef&'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22390_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1127", "output": "{1, 161, 7, 1127, 49, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018658", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < n:\n            top_scores.append(score)\n        else:\n            min_score = min(top_scores)\n            if score > min_score:\n                top_scores.remove(min_score)\n                top_scores.append(score)\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[60, 70, 75, 80, 70], 4", "output": "73.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65534_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018659", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{1: 2, -1: 4}", "output": "[1, 1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018660", "code": "from typing import List\ndef delete_entities(entity_list: List[int], delete_ids: List[int]) -> List[int]:\n    return [entity for entity in entity_list if entity not in delete_ids]\n", "entry_point": "delete_entities", "input": "[5, 7, 10], [5, 10]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62424_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018661", "code": "def find_second_highest_score(scores):\n    unique_scores = list(set(scores))  # Remove duplicates\n    if len(unique_scores) < 2:\n        return None\n    else:\n        sorted_scores = sorted(unique_scores, reverse=True)\n        return sorted_scores[1]\n", "entry_point": "find_second_highest_score", "input": "[95, 90, 85]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32942_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018662", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8503", "output": "{1, 11, 773, 8503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018663", "code": "def validate_credentials(username, password):\n    if username == 'admin' and password == 'admin123':\n        return \"Welcome, admin!\"\n    elif username == 'guest' and password == 'guest123':\n        return \"Welcome, guest!\"\n    else:\n        return \"Invalid credentials!\"\n", "entry_point": "validate_credentials", "input": "'admin', 'admin123'", "output": "'Welcome, admin!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105999_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018664", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "-3, -1", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018665", "code": "def calculate_median(numbers):\n    sorted_numbers = sorted(numbers)\n    length = len(sorted_numbers)\n    if length % 2 == 1:  # Odd number of elements\n        return sorted_numbers[length // 2]\n    else:  # Even number of elements\n        mid_right = length // 2\n        mid_left = mid_right - 1\n        return (sorted_numbers[mid_left] + sorted_numbers[mid_right]) / 2\n", "entry_point": "calculate_median", "input": "[1, 2]", "output": "1.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15473_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018666", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9622", "output": "{1, 2, 34, 4811, 17, 9622, 566, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9621", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018667", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'1,'", "output": "'1,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018668", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018669", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3890", "output": "{1, 2, 5, 389, 778, 10, 3890, 1945}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3889", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018670", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[1, 2, 3, 7], 1", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018671", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmordmo.optionso.optrfir'", "output": "('rdmordmo.optionso', 'optrfir')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018672", "code": "def extract_text(input_text: str) -> str:\n    parts = input_text.split('<!DOCTYPE html>', 1)\n    return parts[0] if len(parts) > 1 else input_text\n", "entry_point": "extract_text", "input": "'TThis<!DOCTYPE html>'", "output": "'TThis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21287_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018673", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "'1+'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018674", "code": "def quote_converter(input_string):\n    output = []\n    in_quote = False\n    quote_char = None\n    for char in input_string:\n        if char == \"'\" or char == '\"':\n            if not in_quote:\n                in_quote = True\n                quote_char = char\n                output.append(char)\n            elif in_quote and char == quote_char:\n                output.append(char)\n                in_quote = False\n            else:\n                output.append('\"' if quote_char == \"'\" else \"'\")\n        elif char == '\\\\' and in_quote:\n            output.append(char)\n            output.append(input_string[input_string.index(char) + 1])\n        else:\n            output.append(char)\n    return ''.join(output)\n", "entry_point": "quote_converter", "input": "'\"qusaidid,\"'", "output": "'\"qusaidid,\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86289_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018675", "code": "def calculate_xor_checksum(input_string):\n    checksum = 0\n    for char in input_string:\n        checksum ^= ord(char)\n    return checksum\n", "entry_point": "calculate_xor_checksum", "input": "'h'", "output": "104", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56407_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018676", "code": "def simulate_password_reset(account, password, answer):\n    if not account or not password or not answer:\n        return 'Please complete all input fields.'\n    # Simulate password reset verification process\n    if account == 'valid_account' and password == 'valid_password' and answer == 'correct_answer':\n        return 'new_password123'  # Simulated new password\n    else:\n        return 'Password reset failed. Incorrect answer.'\n", "entry_point": "simulate_password_reset", "input": "'', 'valid_password', 'correct_answer'", "output": "'Please complete all input fields.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90006_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018677", "code": "def longest_palindromic_substring(s):\n    size = len(s)\n    if size < 2:\n        return s\n    dp = [[False for _ in range(size)] for _ in range(size)]\n    maxLen = 1\n    start = 0\n    for j in range(1, size):\n        for i in range(0, j):\n            if s[i] == s[j]:\n                if j - i <= 2:\n                    dp[i][j] = True\n                else:\n                    dp[i][j] = dp[i + 1][j - 1]\n            if dp[i][j]:\n                curLen = j - i + 1\n                if curLen > maxLen:\n                    maxLen = curLen\n                    start = i\n    return s[start : start + maxLen]\n", "entry_point": "longest_palindromic_substring", "input": "'xxabaabayy'", "output": "'abaaba'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74617_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018678", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3991", "output": "{1, 307, 13, 3991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018679", "code": "def convert_bitmap_to_active_bits(primary_bitmap):\n    active_data_elements = []\n    for i in range(len(primary_bitmap)):\n        if primary_bitmap[i] == '1':\n            active_data_elements.append(i + 1)  # Data element numbers start from 1\n    return active_data_elements\n", "entry_point": "convert_bitmap_to_active_bits", "input": "'100000000000000000000000000000000000000001'", "output": "[1, 42]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53443_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018680", "code": "def caesar_cipher(text, shift):\n    result = \"\"\n    for char in text:\n        if char.isupper():\n            new_char = chr((ord(char) - 65 + shift) % 26 + 65)\n            result += new_char\n    return result\n", "entry_point": "caesar_cipher", "input": "'OLSVSSO', 2", "output": "'QNUXUUQ'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7376_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018681", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[92, 88, 88, 85, 75]", "output": "[92, 88, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018682", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 10, 20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142484_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018683", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[40, 43, 43, 45]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018684", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '12:20:15'", "output": "1215", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018685", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[6.4, 8.4]", "output": "7.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018686", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "-6.0, 1", "output": "-6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018687", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'Hoicanos'", "output": "'Hoicanos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018688", "code": "def pageCount(n, p):\n    # Calculate pages turned from the front\n    front_turns = p // 2\n    # Calculate pages turned from the back\n    if n % 2 == 0:\n        back_turns = (n - p) // 2\n    else:\n        back_turns = (n - p - 1) // 2\n    return min(front_turns, back_turns)\n", "entry_point": "pageCount", "input": "10, 11", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96390_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018689", "code": "def calculate_res2net_parameters(layers, scales, width):\n    total_parameters = layers * (width * scales**2 + 3 * width)\n    return total_parameters\n", "entry_point": "calculate_res2net_parameters", "input": "2, 2, 9672", "output": "135408", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69497_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018690", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5756", "output": "{1, 2, 4, 5756, 2878, 1439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5755", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018692", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "8.5, 3.0", "output": "1.8333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2087", "output": "{1, 2087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018694", "code": "from typing import Dict, List\ndef calculate_weighted_sum(coefficients: Dict[str, List[float]], values: List[float]) -> float:\n    weighted_sums = []\n    for key, coeffs in coefficients.items():\n        weighted_sum = sum(c * v for c, v in zip(coeffs, values))\n        weighted_sums.append(weighted_sum)\n    return sum(weighted_sums)\n", "entry_point": "calculate_weighted_sum", "input": "{'a': [1, -1], 'b': [1, -1]}, [1, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135804_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018695", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'mmz'", "output": "'mmz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018696", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[5, 0, 1, 5]", "output": "[5, 1, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018697", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "143", "output": "{1, 11, 13, 143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1168", "output": "{1, 2, 4, 292, 584, 8, 73, 1168, 16, 146}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1167", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018699", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "9, 6", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018700", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[7, 7, 5, 7, 7, 5, 7], 1", "output": "[[7], [7], [5], [7], [7], [5], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018701", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7111", "output": "{1, 547, 13, 7111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018702", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(5, 5, 5)", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018703", "code": "def process_command(input_str):\n    x = input_str.split(' ')\n    com = x[0]\n    rest = x[1:]\n    return (com, rest)\n", "entry_point": "process_command", "input": "'witwhcexend'", "output": "('witwhcexend', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93382_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018704", "code": "import string\ndef encrypt_message(message, key):\n    accepted_keys = string.ascii_uppercase\n    encrypted_message = \"\"\n    # Validate the key\n    key_comp = key.replace(\" \", \"\")\n    if not set(key_comp).issubset(set(accepted_keys)):\n        raise ValueError(\"Key contains special characters or integers that are not acceptable values\")\n    # Repeat the key cyclically to match the length of the message\n    key = key * (len(message) // len(key)) + key[:len(message) % len(key)]\n    # Encrypt the message using One-Time Pad encryption\n    for m, k in zip(message, key):\n        encrypted_char = chr(((ord(m) - 65) + (ord(k) - 65)) % 26 + 65)\n        encrypted_message += encrypted_char\n    return encrypted_message\n", "entry_point": "encrypt_message", "input": "'EOVVVFBEOY', 'A'", "output": "'EOVVVFBEOY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111246_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "151", "output": "{1, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt150", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7466", "output": "{1, 7466, 2, 3733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018707", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "91", "output": "{50: 1, 20: 2, 10: 0, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018708", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "123, 0", "output": "123", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018709", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[10, 27, 10, 9, 9, 10]", "output": "'9]9889'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018710", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "8", "output": "[1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018711", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "-1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018712", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<EMA<<IL>>>IL>'", "output": "'<EMA<<IL>>>IL>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018713", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'1.2.23'", "output": "(1, 2, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018714", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'', 'smoothie'", "output": "['smoothie']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018715", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "2.909090909090909, 1", "output": "(2.909090909090909, 2.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018716", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[20, 30, 40]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018717", "code": "def move_player(movements):\n    player_position = [0, 0]\n    winning_position = [3, 4]\n    for move in movements:\n        if move == 'U' and player_position[1] < 4:\n            player_position[1] += 1\n        elif move == 'D' and player_position[1] > 0:\n            player_position[1] -= 1\n        elif move == 'L' and player_position[0] > 0:\n            player_position[0] -= 1\n        elif move == 'R' and player_position[0] < 3:\n            player_position[0] += 1\n        if player_position == winning_position:\n            print(\"Congratulations, you won!\")\n            break\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['R', 'R', 'U']", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49262_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8501", "output": "{1, 8501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018719", "code": "from typing import List, Dict, Tuple\ndef extract_package_versions(package_requirements: List[str]) -> Dict[str, Tuple[str, str]]:\n    package_versions = {}\n    for requirement in package_requirements:\n        parts = requirement.split('>=') if '>=' in requirement else requirement.split('==')\n        package_name = parts[0].strip()\n        if '>=' in requirement:\n            min_version, max_version = parts[1].split(', <')\n            max_version = max_version.replace(' ', '')\n        else:\n            min_version = max_version = None\n        package_versions[package_name] = (min_version, max_version)\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "['ase>=3.18, <4.0.0']", "output": "{'ase': ('3.18', '4.0.0')}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88535_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018720", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'none', -1, -1", "output": "(-1, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018721", "code": "def translate_russian_to_english(message):\n    translations = {\n        '\u041f\u0440\u0438\u043d\u044f\u043b\u0438!': 'Accepted!',\n        '\u0421\u043f\u0430\u0441\u0438\u0431\u043e': 'Thank you',\n        '\u0437\u0430': 'for',\n        '\u0432\u0430\u0448\u0443': 'your',\n        '\u0437\u0430\u044f\u0432\u043a\u0443.': 'application.'\n    }\n    translated_message = []\n    words = message.split()\n    for word in words:\n        translated_word = translations.get(word, word)\n        translated_message.append(translated_word)\n    return ' '.join(translated_message)\n", "entry_point": "translate_russian_to_english", "input": "'\u041f\u0440\u043f\u0430'", "output": "'\u041f\u0440\u043f\u0430'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111635_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018722", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'https://exammle.com', ''", "output": "'https://exammle.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3019", "output": "{1, 3019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8387", "output": "{1, 8387}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3367", "output": "{1, 481, 259, 37, 7, 3367, 13, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018726", "code": "def apply_path_replacements(path: str, replacements: dict) -> str:\n    result = \"\"\n    capturing_key = False\n    key = \"\"\n    for char in path:\n        if char == '{':\n            capturing_key = True\n        elif char == '}':\n            capturing_key = False\n            if key in replacements:\n                result += replacements[key]\n            else:\n                result += \"{\" + key + \"}\"\n            key = \"\"\n        elif capturing_key:\n            key += char\n        else:\n            result += char\n    return result\n", "entry_point": "apply_path_replacements", "input": "'/{key}//', {'key': 'CT'}", "output": "'/CT//'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47834_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018727", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "14.28, 0, 5", "output": "-108.345", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018728", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'aaacabcCdcabcCdcfCHAIN_ID12345', '2212345'", "output": "'aaacabcCdcabcCdcf221234512345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6939", "output": "{1, 257, 3, 771, 27, 2313, 9, 6939}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018730", "code": "def remove_min_parentheses(s):\n    if not s:\n        return \"\"\n    s = list(s)\n    stack = []\n    for i, char in enumerate(s):\n        if char == \"(\":\n            stack.append(i)\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                s[i] = \"\"\n    while stack:\n        s[stack.pop()] = \"\"\n    return \"\".join(s)\n", "entry_point": "remove_min_parentheses", "input": "'()'", "output": "'()'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35267_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018731", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[2, 9]", "output": "(9, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "362", "output": "{1, 362, 2, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018733", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "6", "output": "'22'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018734", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "113", "output": "{1, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018735", "code": "def generate_stairs(N):\n    stairs_ = []\n    for i in range(1, N + 1):\n        symb = \"#\" * i\n        empty = \" \" * (N - i)\n        stairs_.append(symb + empty)\n    return stairs_\n", "entry_point": "generate_stairs", "input": "3", "output": "['#  ', '## ', '###']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69687_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9863", "output": "{1, 1409, 7, 9863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7251", "output": "{3, 1, 7251, 2417}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018738", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[0, 3, 3, 1, 3, 1, 1, 0]", "output": "[0, 9, 9, 1, 9, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018739", "code": "def filter_pushes_by_type(pushes, push_type):\n    filtered_pushes = [push[\"title\"] for push in pushes if push[\"type\"] == push_type]\n    return filtered_pushes\n", "entry_point": "filter_pushes_by_type", "input": "[], 'any_type'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45541_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018740", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "1.0, 13.0, 100", "output": "(1.0, 0.023076923076923075)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018741", "code": "def count_names(input_str):\n    name_counts = {}\n    names = input_str.split(',')\n    for name in names:\n        name = name.strip().lower()\n        name_counts[name] = name_counts.get(name, 0) + 1\n    return name_counts\n", "entry_point": "count_names", "input": "'n, mjhm'", "output": "{'n': 1, 'mjhm': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64824_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018742", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "66", "output": "'B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018743", "code": "def count_pairs_with_difference(nums, k):\n    count = 0\n    num_set = set(nums)\n    for num in nums:\n        if num + k in num_set or num - k in num_set:\n            count += 1\n    return count\n", "entry_point": "count_pairs_with_difference", "input": "[1, 2, 3, 4], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1892_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018744", "code": "def validate_http_methods(http_methods):\n    ALLOWED_HTTP_METHODS = frozenset(('GET', 'POST', 'PUT', 'DELETE', 'PATCH'))\n    valid_methods = [method for method in http_methods if method in ALLOWED_HTTP_METHODS]\n    return valid_methods\n", "entry_point": "validate_http_methods", "input": "['OPTIONS', 'UPDATE', 'POST', 'PATCH']", "output": "['POST', 'PATCH']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92929_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6275", "output": "{1, 6275, 5, 1255, 25, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6274", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018746", "code": "import json\ndef extract_keys(json_obj):\n    keys = set()\n    if isinstance(json_obj, dict):\n        for key, value in json_obj.items():\n            keys.add(key)\n            keys.update(extract_keys(value))\n    elif isinstance(json_obj, list):\n        for item in json_obj:\n            keys.update(extract_keys(item))\n    return keys\n", "entry_point": "extract_keys", "input": "{}", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122660_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018747", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[7, 5, 5, 2, 4]", "output": "[7, 5, 5, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018748", "code": "import math\ndef calculateDownloadCost(fileSize, downloadSpeed, costPerGB):\n    fileSizeGB = fileSize / 1024  # Convert file size from MB to GB\n    downloadTime = fileSizeGB * 8 / downloadSpeed  # Calculate download time in seconds\n    totalCost = math.ceil(fileSizeGB) * costPerGB  # Round up downloaded GB and calculate total cost\n    return totalCost\n", "entry_point": "calculateDownloadCost", "input": "1024, 10, -33.959999999999994", "output": "-33.959999999999994", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44451_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018749", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "621", "output": "{1, 3, 69, 9, 621, 207, 23, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018750", "code": "def extract_iiif_info(iiif_config):\n    iiif_prefix = iiif_config.get('IIIF_API_PREFIX')\n    iiif_ui_url = iiif_config.get('IIIF_UI_URL')\n    iiif_previewer_params = iiif_config.get('IIIF_PREVIEWER_PARAMS', {}).get('size')\n    iiif_preview_template = iiif_config.get('IIIF_PREVIEW_TEMPLATE')\n    iiif_api_decorator_handler = iiif_config.get('IIIF_API_DECORATOR_HANDLER')\n    iiif_image_opener_handler = iiif_config.get('IIIF_IMAGE_OPENER_HANDLER')\n    return iiif_prefix, iiif_ui_url, iiif_previewer_params, iiif_preview_template, iiif_api_decorator_handler, iiif_image_opener_handler\n", "entry_point": "extract_iiif_info", "input": "{}", "output": "(None, None, None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7256_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018751", "code": "def cooking3(N, M, wig):\n    dp = [float('inf')] * (N + 1)\n    dp[0] = 0\n    for i in range(1, N + 1):\n        for w in wig:\n            if i - w >= 0:\n                dp[i] = min(dp[i], dp[i - w] + 1)\n    return dp[N] if dp[N] != float('inf') else -1\n", "entry_point": "cooking3", "input": "5, 2, [2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18807_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4388", "output": "{1, 2, 4388, 4, 1097, 2194}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4387", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018753", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "25, 'mode', 'output'", "output": "{'response': 'InvalidPin', 'pin': 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018754", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[6, 3, -2, 1, 2]", "output": "[6, 4, 0, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018755", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[2, 7, 9, 3, 1, 8]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91583_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018756", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1849", "output": "{1, 43, 1849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018757", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[1, -1, 5, 5, 5, 2]", "output": "([1, -1, 5, 5, 5], [2, None, None, None, None])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6481", "output": "{6481, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018759", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "6", "output": "0.4166666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018760", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[10, 8, 9]", "output": "162", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018761", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'JhoeSmDtS'", "output": "'Jhoe sm dt s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018762", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-3, 4, 9, -3, -7, -3, 9, 11]", "output": "[-7, -3, -3, -3, 4, 9, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8427", "output": "{1, 3, 8427, 53, 2809, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018764", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "6", "output": "'LOCK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018765", "code": "def bicubic_kernel(x, a=-0.50):\n    abs_x = abs(x)\n    if abs_x <= 1.0:\n        return (a + 2.0) * (abs_x ** 3.0) - (a + 3.0) * (abs_x ** 2.0) + 1\n    elif 1.0 < abs_x < 2.0:\n        return a * (abs_x ** 3) - 5.0 * a * (abs_x ** 2.0) + 8.0 * a * abs_x - 4.0 * a\n    else:\n        return 0.0\n", "entry_point": "bicubic_kernel", "input": "0.5", "output": "0.5625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11047_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018766", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "7", "output": "'UNKNOWN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018767", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[90, 90, 90, 90, 91]", "output": "90.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018768", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 78, 75, 70, 60, 50]", "output": "[92, 78, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018769", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[16, 4, 1, 1, 4, 4, 1]", "output": "[20, 5, 2, 5, 8, 5, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129188_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018770", "code": "def common_characters(s1: str, s2: str) -> int:\n    s1_dict = {}\n    s2_dict = {}\n    count = 0\n    for letter in s1:\n        s1_dict[letter] = s1.count(letter)\n        s1 = s1.replace(letter, \"\", 1)  # Remove the first occurrence of the letter\n    for letter in s2:\n        s2_dict[letter] = s2.count(letter)\n        s2 = s2.replace(letter, \"\", 1)  # Remove the first occurrence of the letter\n    for letter in s1_dict:\n        if letter in s2_dict:\n            count += min(s1_dict[letter], s2_dict[letter])\n    return count\n", "entry_point": "common_characters", "input": "'a', 'ab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29180_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018771", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'NaNchicanos'", "output": "'NaNchicanos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018772", "code": "def extract_github_info(url):\n    # Remove \"https://github.com/\" from the URL\n    url = url.replace(\"https://github.com/\", \"\")\n    # Split the remaining URL by \"/\"\n    parts = url.split(\"/\")\n    # Extract the username and repository name\n    username = parts[0]\n    repository = parts[1]\n    return (username, repository)\n", "entry_point": "extract_github_info", "input": "'https://github.com/ttps:/'", "output": "('ttps:', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146065_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018773", "code": "def find_min_max(numbers):\n    if not numbers:\n        return None\n    min_value = float('inf')\n    max_value = float('-inf')\n    for num in numbers:\n        if num < min_value:\n            min_value = num\n        if num > max_value:\n            max_value = num\n    return min_value, max_value\n", "entry_point": "find_min_max", "input": "[4, 8]", "output": "(4, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24169_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018774", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1841", "output": "{1, 7, 263, 1841}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1840", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018775", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 60]", "output": "[1, 2, 3, 4, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138156_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018776", "code": "def generate_headers(file_names, project_name):\n    HEADER_TEMPLATE = \"\"\"//\n{{filename}}\n{{project_name}}\nTHIS FILE IS GENERATED, DO NOT EDIT IT!\n\"\"\"\n    headers = []\n    for file_name in file_names:\n        header = HEADER_TEMPLATE.replace('{{filename}}', file_name)\n        header = header.replace('{{project_name}}', project_name)\n        headers.append(header)\n    return headers\n", "entry_point": "generate_headers", "input": "[], 'MyProject'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55724_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018777", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        if count + score_count[score] <= n:\n            top_scores.extend([score] * score_count[score])\n            count += score_count[score]\n        else:\n            remaining = n - count\n            top_scores.extend([score] * remaining)\n            break\n    return sum(top_scores) / n\n", "entry_point": "average_top_n_scores", "input": "[95, 95, 89, 84, 80], 3", "output": "93.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13074_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018778", "code": "import logging\ndef process_serial_data(data_str):\n    logging.info(\"Initializing data processing\")\n    data_dict = {}\n    pairs = data_str.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        data_dict[key] = value\n    return data_dict\n", "entry_point": "process_serial_data", "input": "'temperature:25,humidity:50'", "output": "{'temperature': '25', 'humidity': '50'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86728_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018779", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2666", "output": "{1, 2, 2666, 43, 1333, 86, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2665", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018780", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 1, 4, 4]", "output": "[0, 1, 2, 1, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018781", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "773", "output": "{1, 773}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9185", "output": "{1, 9185, 835, 5, 167, 11, 1837, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9184", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018783", "code": "def calculate_video_duration(frames: int, fps: int) -> int:\n    total_duration = frames // fps\n    return total_duration\n", "entry_point": "calculate_video_duration", "input": "12, 1", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77453_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1075", "output": "{1, 5, 43, 1075, 215, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1074", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018785", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2, 8]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018786", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{0: []}, 0", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018787", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[3, 1, 1, 1, 1]", "output": "[3, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018788", "code": "from typing import List\ndef traverse_matrix_counterclockwise(matrix: List[List[int]]) -> List[int]:\n    if not matrix:\n        return []\n    result = []\n    rows, cols = len(matrix), len(matrix[0])\n    directions = [(0, -1), (1, 0), (0, 1), (-1, 0)]  # left, down, right, up\n    direction_idx = 0\n    row, col = 0, 0\n    for _ in range(rows * cols):\n        result.append(matrix[row][col])\n        matrix[row][col] = None  # Mark visited\n        next_row, next_col = row + directions[direction_idx][0], col + directions[direction_idx][1]\n        if 0 <= next_row < rows and 0 <= next_col < cols and matrix[next_row][next_col] is not None:\n            row, col = next_row, next_col\n        else:\n            direction_idx = (direction_idx + 1) % 4\n            row, col = row + directions[direction_idx][0], col + directions[direction_idx][1]\n    return result\n", "entry_point": "traverse_matrix_counterclockwise", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[1, 4, 7, 8, 9, 6, 3, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33740_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018789", "code": "def parse_time_duration(duration_str):\n    # Split the duration string into hours, minutes, and seconds components\n    components = duration_str.split('h')\n    hours = int(components[0])\n    if 'm' in components[1]:\n        components = components[1].split('m')\n        minutes = int(components[0])\n    else:\n        minutes = 0\n    if 's' in components[1]:\n        components = components[1].split('s')\n        seconds = int(components[0])\n    else:\n        seconds = 0\n    # Calculate the total duration in seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "parse_time_duration", "input": "'27h22m0s'", "output": "98520", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1363_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018790", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'373337727'", "output": "373337727", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018791", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[[3], [6], [4], [3]]", "output": "[3, 6, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018792", "code": "def convert_colors_to_hex(config):\n    hex_colors = {}\n    colors = config.get(\"colors\", {})\n    for color_name, rgb_value in colors.items():\n        hex_value = \"#{:02x}{:02x}{:02x}\".format(*rgb_value)\n        hex_colors[color_name] = hex_value\n    return hex_colors\n", "entry_point": "convert_colors_to_hex", "input": "{'colors': {}}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84022_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018793", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "10, 4", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018794", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "15", "output": "610", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018795", "code": "import ast\nfrom typing import List\ndef extract_function_names(code: str) -> List[str]:\n    tree = ast.parse(code)\n    function_names = set()\n    for node in ast.walk(tree):\n        if isinstance(node, ast.FunctionDef):\n            function_names.add(node.name + '()')\n        elif isinstance(node, ast.Call) and isinstance(node.func, ast.Name):\n            function_names.add(node.func.id + '()')\n    return list(function_names)\n", "entry_point": "extract_function_names", "input": "'def test_func(): pass\\n# some other code'", "output": "['test_func()']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115842_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018796", "code": "def generate_unique_table_name(existing_table_names):\n    numeric_suffixes = [int(name.split(\"_\")[-1]) for name in existing_table_names]\n    unique_suffix = 1\n    while unique_suffix in numeric_suffixes:\n        unique_suffix += 1\n    return f\"table_name_{unique_suffix}\"\n", "entry_point": "generate_unique_table_name", "input": "['table_name_1', 'table_name_2', 'table_name_3']", "output": "'table_name_4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94699_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018797", "code": "def filter_areas(areas, keyword):\n    filtered_areas = []\n    for area in areas:\n        if keyword not in area.get(\"title\", \"\"):\n            filtered_areas.append(area)\n    return filtered_areas\n", "entry_point": "filter_areas", "input": "[{}, {}, {}, {}, {}, {}], 'some_keyword'", "output": "[{}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76978_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018798", "code": "def translate_data_type(pandas_type):\n    pandas_datatype_names = {\n        'object': 'string',\n        'int64': 'integer',\n        'float64': 'double',\n        'bool': 'boolean',\n        'datetime64[ns]': 'datetime'\n    }\n    return pandas_datatype_names.get(pandas_type, 'unknown')\n", "entry_point": "translate_data_type", "input": "'bool'", "output": "'boolean'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9746_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018799", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 5, 1, 4, 2, 1]", "output": "[1, 125, 1, 16, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018800", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'jug'", "output": "{'jug': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104136_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018801", "code": "def tomorrow(_):\n    return {i: i**2 for i in range(1, _+1)}\n", "entry_point": "tomorrow", "input": "4", "output": "{1: 1, 2: 4, 3: 9, 4: 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74523_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018802", "code": "def extract_frames(lidar_data, start_value):\n    frames = []\n    frame = []\n    for val in lidar_data:\n        if val == start_value:\n            if frame:\n                frames.append(frame)\n                frame = []\n        frame.append(val)\n    if frame:\n        frames.append(frame)\n    return frames\n", "entry_point": "extract_frames", "input": "[4, 4, 4, 1, 4, 5, 3, 4, 4], 0", "output": "[[4, 4, 4, 1, 4, 5, 3, 4, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49590_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018803", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 4, 0, 1, 4]", "output": "[8, 4, 1, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018804", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'5'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018805", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'lazyy', 5", "output": "['lazyy']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "995", "output": "{1, 995, 5, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018807", "code": "def calculate_hamming_dist(uploaded_hash, db_store_hash):\n    count = 0\n    for i in range(len(uploaded_hash)):\n        if uploaded_hash[i] != db_store_hash[i]:\n            count += 1\n    return count\n", "entry_point": "calculate_hamming_dist", "input": "'1111', '0000'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4669_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6277", "output": "{1, 6277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018809", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[4128], 1", "output": "4128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018810", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[6, 7, 8, 9, 10, 1], [5, 4, 3, 2, 1, 2]", "output": "('Player 1 wins', 5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018811", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "3", "output": "'SDL_LOG_CATEGORY_SYSTEM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018812", "code": "def radix_sort(array):\n    base = 10  # Base 10 for decimal integers\n    max_val = max(array)\n    col = 0\n    while max_val // 10 ** col > 0:\n        count_array = [0] * base\n        position = [0] * base\n        output = [0] * len(array)\n        for elem in array:\n            digit = elem // 10 ** col\n            count_array[digit % base] += 1\n        position[0] = 0\n        for i in range(1, base):\n            position[i] = position[i - 1] + count_array[i - 1]\n        for elem in array:\n            output[position[elem // 10 ** col % base]] = elem\n            position[elem // 10 ** col % base] += 1\n        array = output\n        col += 1\n    return output\n", "entry_point": "radix_sort", "input": "[66, 2, 45, 90, 24, 802, 75, 170]", "output": "[2, 24, 45, 66, 75, 90, 170, 802]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60721_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018813", "code": "from typing import List\ndef manipulate_devices(dev: List[str]) -> List[str]:\n    updated_devices = []\n    dfp_sensor_present = False\n    for device in dev:\n        updated_devices.append(device)\n        if device == 'dfpBinarySensor':\n            dfp_sensor_present = True\n    if not dfp_sensor_present:\n        updated_devices.append('dfpBinarySensor')\n    return updated_devices\n", "entry_point": "manipulate_devices", "input": "['sensor1', 'sensor1']", "output": "['sensor1', 'sensor1', 'dfpBinarySensor']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129800_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018814", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[3, 3, 4, 5, 1]", "output": "[6, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018815", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "11", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018816", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(16, 0, 0), 3271", "output": "60871", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018817", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = 0\n    exclude = 0\n    for num in scores:\n        new_include = max(num + exclude, include)\n        exclude = include\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[5, 1, 7]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9009_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018818", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4923", "output": "{1, 3, 547, 9, 1641, 4923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018819", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[-1, 1, 2, 7, 6, -2, 1, 7, 1]", "output": "[-2, -1, 1, 1, 1, 2, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018820", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 83, 90, 95]", "output": "86.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38748_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018821", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 2)  # Round the average to 2 decimal places\n", "entry_point": "calculate_average", "input": "[78, 79, 80, 81]", "output": "79.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47456_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018822", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "5", "output": "'Parse error, expecting \"\\'\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018823", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        if num >= 0:\n            total_sum += num\n            count += 1\n    if count == 0:\n        return 0  # To handle the case when there are no positive numbers\n    return total_sum / count\n", "entry_point": "calculate_average", "input": "[10, 11]", "output": "10.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5697_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018824", "code": "def findTwoNumbers(array, targetSum):\n    seen_numbers = set()\n    for num in array:\n        potential_match = targetSum - num\n        if potential_match in seen_numbers:\n            return [potential_match, num]\n        seen_numbers.add(num)\n    return []\n", "entry_point": "findTwoNumbers", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115301_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018825", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "221", "output": "{1, 13, 221, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018826", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'tltitlell'", "output": "'tltitlell'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018827", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4147", "output": "{1, 11, 13, 143, 4147, 377, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018828", "code": "def get_roles_with_both_event_access(roles_permissions):\n    sending_roles = set()\n    subscribing_roles = set()\n    for role, permissions in roles_permissions.items():\n        if \".*\" in permissions:\n            sending_roles.add(role)\n            subscribing_roles.add(role)\n        elif permissions:\n            sending_roles.add(role)\n    roles_with_both_access = list(sending_roles.intersection(subscribing_roles))\n    return roles_with_both_access\n", "entry_point": "get_roles_with_both_event_access", "input": "{'role1': [], 'role2': ['read'], 'role3': ['write']}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30742_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018829", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[100]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018830", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "1, 3, 0", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018831", "code": "import re\ndef sub(message, regex):\n    parts = regex.split(\"/\")\n    pattern = parts[1]\n    replacement = parts[2]\n    flags = parts[3] if len(parts) > 3 else \"\"\n    count = 1\n    if \"g\" in flags:\n        count = 0\n    elif flags.isdigit():\n        count = int(flags)\n    return re.sub(pattern, replacement, message, count)\n", "entry_point": "sub", "input": "'Hello, World!', '/H/o/1'", "output": "'oello, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32281_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018832", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Pyyelcle'", "output": "'Pyyelcle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018833", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[1, 6, 5]", "output": "[5, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018834", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "27", "output": "0.015555555555555555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018835", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[23.65, 23.67, 23.69]", "output": "23.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018836", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3031", "output": "{1, 433, 7, 3031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018837", "code": "def apply_patch_rules(original_str, patch_rules):\n    patched_str = original_str\n    for find_pattern, replace in patch_rules:\n        patched_str = patched_str.replace(find_pattern, replace)\n    return patched_str\n", "entry_point": "apply_patch_rules", "input": "'apple', [('e', '')]", "output": "'appl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12076_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018838", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1556", "output": "{1, 2, 4, 389, 778, 1556}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1555", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018839", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[5, [6], 5, [4, 4], 3, [6, 6, 6]]", "output": "[5, 6, 5, 4, 4, 3, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018840", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2258", "output": "{1, 2258, 2, 1129}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018841", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4910", "output": "{1, 2, 5, 10, 491, 4910, 982, 2455}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4909", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018842", "code": "import re\ndef template_substitution(template, substitutions):\n    def replace(match):\n        key = match.group(1)\n        return substitutions.get(key, match.group(0))\n    pattern = r'\\${(.*?)}'\n    return re.sub(pattern, replace, template)\n", "entry_point": "template_substitution", "input": "'${wi}${Are}${th}', {'wi': 'wi', 'Are': 'Are', 'th': 'th'}", "output": "'wiAreth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63163_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018843", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[5, 2, 3, 5, 4, 5, 1]", "output": "[1, 5, 4, 5, 3, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018844", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[7, 4]", "output": "('Rel Days 7 to 4', 'reldays7_4')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018845", "code": "def get_polarities(input_list):\n    polarity_map = {\n        1: -1,\n        0: 1,\n        3: 0,\n        2: None\n    }\n    output_list = []\n    for num in input_list:\n        if num in polarity_map:\n            output_list.append(polarity_map[num])\n        else:\n            output_list.append('Unknown')\n    return output_list\n", "entry_point": "get_polarities", "input": "[5, 1, 4, 1, 1, 1, 1]", "output": "['Unknown', -1, 'Unknown', -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26756_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018846", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "4.0", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018847", "code": "def calculate_ema(values, alpha):\n    ema_values = [values[0]]  # Initialize with the first value\n    for i in range(1, len(values)):\n        ema = alpha * values[i] + (1 - alpha) * ema_values[i - 1]\n        ema_values.append(ema)\n    return ema_values\n", "entry_point": "calculate_ema", "input": "[10, 20, 30, 40, 50], 0.5", "output": "[10, 15.0, 22.5, 31.25, 40.625]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117688_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018848", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "302", "output": "{1, 2, 302, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt301", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018849", "code": "def largest_prime_factor(N):\n    factor = 2\n    while factor * factor <= N:\n        if N % factor == 0:\n            N //= factor\n        else:\n            factor += 1\n    return max(factor, N)\n", "entry_point": "largest_prime_factor", "input": "4397", "output": "4397", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109160_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018850", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "'UUUUL'", "output": "(-1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018851", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "5", "output": "2.3219280948873626", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018852", "code": "import re\ndef process_text(input_text: str) -> str:\n    # Remove all characters that are not Cyrillic or alphanumeric\n    processed_text = re.sub(r\"[^\u0430-\u044f\u0410-\u042f0-9 ]+\", \"\", input_text)\n    # Replace double spaces with a single space\n    processed_text = re.sub('(  )', ' ', processed_text)\n    # Replace \"\\r\\n\" with a space\n    processed_text = processed_text.replace(\"\\r\\n\", \" \")\n    return processed_text\n", "entry_point": "process_text", "input": "'123'", "output": "'123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100805_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018853", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'eText**'", "output": "'eText**\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018854", "code": "def text_pair_classification(text1, text2):\n    text1 = text1.lower()\n    text2 = text2.lower()\n    words1 = set(text1.split())\n    words2 = set(text2.split())\n    common_words = words1.intersection(words2)\n    if common_words:\n        return \"Similar\"\n    elif not common_words and len(words1) == len(words2):\n        return \"Neutral\"\n    else:\n        return \"Different\"\n", "entry_point": "text_pair_classification", "input": "'apple banana', 'kiwi'", "output": "'Different'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16018_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018855", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018856", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "11.77759999999999, 10", "output": "101.77759999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018857", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[0, 0, 0]", "output": "[0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018858", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8555", "output": "{1, 5, 295, 8555, 1711, 145, 59, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8554", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018859", "code": "def sum_with_next_k(nums, k):\n    result = []\n    for i in range(len(nums) - k + 1):\n        result.append(sum(nums[i:i+k]))\n    return result\n", "entry_point": "sum_with_next_k", "input": "[2, 3, 7, 7, 3, 7, 8, 2], 3", "output": "[12, 17, 17, 17, 18, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73692_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018860", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018861", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "979", "output": "979", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018862", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'0.2.1'", "output": "(0, 2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8067", "output": "{3, 1, 2689, 8067}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018864", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "0, 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018865", "code": "def grouped(n, iterable, fillvalue=None):\n    groups = []\n    it = iter(iterable)\n    while True:\n        group = tuple(next(it, fillvalue) for _ in range(n))\n        if group == (fillvalue,) * n:\n            break\n        groups.append(group)\n    return groups\n", "entry_point": "grouped", "input": "2, [2, 4, 5, 7, 7, 4]", "output": "[(2, 4), (5, 7), (7, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32257_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4795", "output": "{1, 35, 5, 7, 137, 685, 4795, 959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4794", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018867", "code": "def sum_multiples_of_3_or_5(nums):\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12613_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018868", "code": "def move_player(movements):\n    player_position = [0, 0]\n    winning_position = [3, 4]\n    for move in movements:\n        if move == 'U' and player_position[1] < 4:\n            player_position[1] += 1\n        elif move == 'D' and player_position[1] > 0:\n            player_position[1] -= 1\n        elif move == 'L' and player_position[0] > 0:\n            player_position[0] -= 1\n        elif move == 'R' and player_position[0] < 3:\n            player_position[0] += 1\n        if player_position == winning_position:\n            print(\"Congratulations, you won!\")\n            break\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['U', 'U', 'U', 'U', 'R', 'R']", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49262_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018869", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(1, 4, -1, 4, 4, 3, 4, 4)", "output": "'1.4.-1.4.4.3.4.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018870", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    a, b = 0, 1\n    for _ in range(N):\n        fib_sum += a\n        a, b = b, a + b\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92640_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018871", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import helpers'", "output": "'helpers'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9679", "output": "{1, 9679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018873", "code": "def process_help_section(path):\n    # Strip off the '/data/help/' part of the path\n    section = path.split('/', 3)[-1]\n    if section in ['install', 'overview', 'usage', 'examples', 'cloudhistory', 'changelog']:\n        return f\"Sending section: {section}\"\n    elif section.startswith('stage'):\n        stages_data = [{'name': stage_name, 'help': f\"Help for {stage_name}\"} for stage_name in ['stage1', 'stage2', 'stage3']]\n        return stages_data\n    else:\n        return f\"Could not find help section: {section}\"\n", "entry_point": "process_help_section", "input": "'/data/help/unok'", "output": "'Could not find help section: unok'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99964_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018874", "code": "def merge_sort_skip_multiples_of_3(arr):\n    def merge(left, right):\n        result = []\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] < right[j]:\n                result.append(left[i])\n                i += 1\n            else:\n                result.append(right[j])\n                j += 1\n        result.extend(left[i:])\n        result.extend(right[j:])\n        return result\n    def merge_sort(arr):\n        if len(arr) <= 1:\n            return arr\n        mid = len(arr) // 2\n        left = merge_sort(arr[:mid])\n        right = merge_sort(arr[mid:])\n        return merge(left, right)\n    multiples_of_3 = [num for num in arr if num % 3 == 0]\n    non_multiples_of_3 = [num for num in arr if num % 3 != 0]\n    sorted_non_multiples_of_3 = merge_sort(non_multiples_of_3)\n    result = []\n    i = j = 0\n    for num in arr:\n        if num % 3 == 0:\n            result.append(multiples_of_3[i])\n            i += 1\n        else:\n            result.append(sorted_non_multiples_of_3[j])\n            j += 1\n    return result\n", "entry_point": "merge_sort_skip_multiples_of_3", "input": "[10, 8, 3, 10, 3]", "output": "[8, 10, 3, 10, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15751_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018875", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 80, 80], 3", "output": "83.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80206_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4142", "output": "{1, 2, 38, 109, 4142, 19, 2071, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "409", "output": "{1, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2218", "output": "{1, 2218, 2, 1109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2217", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018879", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 8, 3, 0]", "output": "[8, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018880", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "-3, -22, -11", "output": "-12131000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018881", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "1.9905600000000003, 2.0", "output": "2.9905600000000003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018882", "code": "def process_text(input_text: str) -> str:\n    manualMap = {\n        \"can't\": \"cannot\",\n        \"won't\": \"will not\",\n        \"don't\": \"do not\",\n        # Add more contractions as needed\n    }\n    articles = {\"a\", \"an\", \"the\"}\n    contractions = {v: k for k, v in manualMap.items()}\n    outText = []\n    tempText = input_text.lower().split()\n    for word in tempText:\n        word = manualMap.get(word, word)\n        if word not in articles:\n            outText.append(word)\n    for wordId, word in enumerate(outText):\n        if word in contractions:\n            outText[wordId] = contractions[word]\n    return ' '.join(outText)\n", "entry_point": "process_text", "input": "'quodog.v'", "output": "'quodog.v'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127920_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018883", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6391", "output": "{1, 581, 7, 11, 77, 913, 83, 6391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6390", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018884", "code": "def extract_base_info(cfg_dict):\n    perception_network_kwargs = cfg_dict.get('learner', {}).get('perception_network_kwargs', {})\n    sidetune_kwargs = perception_network_kwargs.get('extra_kwargs', {}).get('sidetune_kwargs', {})\n    base_class = sidetune_kwargs.get('base_class', None)\n    eval_only = sidetune_kwargs.get('base_kwargs', {}).get('eval_only', False)\n    return base_class, eval_only\n", "entry_point": "extract_base_info", "input": "{'learner': {}}", "output": "(None, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73241_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018885", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    sum_scores = sum(trimmed_scores)\n    average_score = sum_scores // len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[25, 27, 30, 28, 29, 90]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20544_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018886", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 2, 4, 4, 1, 5, 4]", "output": "[3, 6, 8, 5, 6, 9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125610_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018887", "code": "def simulate_game(grid, start, instructions):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    rows, cols = len(grid), len(grid[0])\n    x, y = start\n    for instruction in instructions:\n        dx, dy = directions[instruction]\n        x = (x + dx) % rows\n        y = (y + dy) % cols\n        if grid[x][y] == 1:  # Check if the new position is blocked\n            x, y = start  # Reset to the starting position\n    return x, y\n", "entry_point": "simulate_game", "input": "[[1]], (0, 0), []", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1807_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018888", "code": "from typing import List\ndef calculate_diff(lst: List[int]) -> int:\n    if len(lst) < 2:\n        return 0\n    else:\n        last_two_elements = lst[-2:]\n        return abs(last_two_elements[1] - last_two_elements[0])\n", "entry_point": "calculate_diff", "input": "[1, 2, 3, 4, 5, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112649_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018889", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/some/path/pt'", "output": "'pt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018890", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2613", "output": "{1, 3, 67, 871, 39, 201, 13, 2613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018891", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[-4, -2, 0, 2, 2, 5, 5, 6]", "output": "[-4, -2, 0, 2, 2, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018892", "code": "def reverse_words_in_string(s: str) -> str:\n    result = \"\"\n    word = \"\"\n    for char in s:\n        if char != ' ':\n            word = char + word\n        else:\n            result += word + ' '\n            word = \"\"\n    result += word  # Append the last word without a space\n    return result\n", "entry_point": "reverse_words_in_string", "input": "'hello world'", "output": "'olleh dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88814_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018893", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[1, 1, -2, -3]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018894", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'ffft file!@#.txtt'", "output": "'App/static/uploads/ffftfile.txtt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018895", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[1, 2, 4, 3, 3, 5, 2, 6]", "output": "[2, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018896", "code": "def find_max_cross_section(scan_shapes):\n    max_width, max_height, max_depth = 0, 0, 0\n    for shape in scan_shapes:\n        max_width = max(max_width, shape[2])\n        max_height = max(max_height, shape[1])\n        max_depth = max(max_depth, shape[0])\n    return max_depth, max_height, max_width\n", "entry_point": "find_max_cross_section", "input": "[(30, 20, 25), (15, 30, 10), (5, 10, 30)]", "output": "(30, 30, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103530_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018897", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "-1, 2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018898", "code": "def convert_to_fahrenheit(celsius_temps):\n    fahrenheit_temps = []\n    for celsius_temp in celsius_temps:\n        fahrenheit_temp = celsius_temp * 9/5 + 32\n        fahrenheit_temps.append(fahrenheit_temp)\n    return fahrenheit_temps\n", "entry_point": "convert_to_fahrenheit", "input": "[0, 0, 0]", "output": "[32.0, 32.0, 32.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6499_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018899", "code": "def rob_2(nums):\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob(nums):\n        prev_max = curr_max = 0\n        for num in nums:\n            temp = curr_max\n            curr_max = max(prev_max + num, curr_max)\n            prev_max = temp\n        return curr_max\n    include_first = rob(nums[1:]) + nums[0]\n    exclude_first = rob(nums[:-1])\n    return max(include_first, exclude_first)\n", "entry_point": "rob_2", "input": "[10, 2, 15, 4, 9]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95871_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018900", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[270]", "output": "270", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018901", "code": "from typing import List\nimport os\ndef manipulate_filenames(filenames: List[str]) -> List[str]:\n    manipulated_filenames = []\n    index = 0\n    for filename in filenames:\n        if filename == \"zuma.exe\" or filename == \"zuma.py\":\n            continue\n        if not os.path.exists(filename):\n            new_filename = str(index) + \".mp4\"\n            manipulated_filenames.append(new_filename)\n            index += 1\n        else:\n            manipulated_filenames.append(filename)\n    return manipulated_filenames\n", "entry_point": "manipulate_filenames", "input": "['testfile.txt']", "output": "['0.mp4']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110363_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018902", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "-4.005, 3, 10", "output": "-464.505", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018903", "code": "from typing import List\nfrom collections import Counter\nimport heapq\ndef top_k_frequent(nums: List[int], k: int) -> List[int]:\n    if k == len(nums):\n        return nums\n    # Count the frequency of each element\n    count = Counter(nums)\n    # Find the k most frequent elements\n    return heapq.nlargest(k, count.keys(), key=count.get)\n", "entry_point": "top_k_frequent", "input": "[2, 2, 1], 1", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139195_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018904", "code": "from typing import List, Tuple\ndef apply_substitutions(original: str, substitutions: List[Tuple[str, str, bool]]) -> str:\n    result = original\n    for target, replacement, global_replace in substitutions:\n        if global_replace:\n            result = result.replace(target, replacement)\n        else:\n            result = result.replace(target, replacement, 1)\n    return result\n", "entry_point": "apply_substitutions", "input": "'anything', [('anything', 'something', True)]", "output": "'something'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44966_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018905", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[6]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018906", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "123", "output": "'ossg.default.123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018907", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "11", "output": "[2, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018908", "code": "def sum_multiples_of_3_or_5(numbers):\n    multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples.add(num)\n    return sum(multiples)\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81475_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9076", "output": "{1, 2, 4, 9076, 4538, 2269}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9075", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018910", "code": "def calculate_total(data):\n    total_revenue = 0\n    total_profit = 0\n    for entry in data:\n        total_revenue += entry['revenue']\n        total_profit += entry['profit']\n    return total_revenue, total_profit\n", "entry_point": "calculate_total", "input": "[]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131837_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018911", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[2, 4, 2, 12, 2]", "output": "[4, 16, 4, 22, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018912", "code": "def calculate_language_capacity(gene, age, pleio):\n    start = (10 - pleio) * age\n    total_capacity = sum(gene[start:start + 10])\n    return max(0, total_capacity)\n", "entry_point": "calculate_language_capacity", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 7], 1, 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41245_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018913", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hehellohelrld'", "output": "['hehellohelrld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018914", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'3 Apr 1978'", "output": "'Apr 3, 1978'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018915", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1516", "output": "{1, 2, 4, 1516, 758, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1515", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018916", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'irrelevant', '111.22.', '55555555'", "output": "'111.22..55555555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018917", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7765", "output": "{1, 5, 7765, 1553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018918", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[122]", "output": "122", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018919", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6495", "output": "{1, 3, 5, 15, 433, 1299, 2165, 6495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018920", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7579", "output": "{1, 583, 11, 13, 143, 689, 53, 7579}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018921", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "19, 31", "output": "[19, 23, 29, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018922", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "'ttt.'", "output": "'<p>ttt.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018923", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "63", "output": "'01:03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018924", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'htttph'", "output": "'xmlns:__NAMESPACE__=\"htttph\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018925", "code": "def judge_command(command_str, expected_attributes):\n    if expected_attributes is None:\n        return False\n    command_attrs = command_str.split()\n    if len(command_attrs) != len(expected_attributes):\n        return False\n    for attr, expected_value in expected_attributes.items():\n        if attr == \"stream_id\":\n            if command_attrs[4] not in expected_value or command_attrs[5] not in expected_value:\n                return False\n        elif attr in command_attrs and command_attrs[command_attrs.index(attr) + 1] != expected_value:\n            return False\n    return True\n", "entry_point": "judge_command", "input": "'example command string', None", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2659_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018926", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[3, 2, 6, 2, 3, 3, 2, 2]", "output": "[3, 5, 11, 13, 16, 19, 21, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8318", "output": "{1, 2, 8318, 4159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018928", "code": "def calculate_word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Initialize a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation if needed\n        word = word.strip('.,')\n        # Update the word frequency dictionary\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'Why'", "output": "{'why': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88926_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018929", "code": "def repeat(word, times):\n    text = \"\"  # Initialize an empty string\n    for _ in range(times):\n        text += word  # Concatenate the word 'times' number of times\n    return text  # Return the concatenated result\n", "entry_point": "repeat", "input": "'hello', 3", "output": "'hellohellohello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106481_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018930", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1658", "output": "{1, 1658, 2, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1657", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018931", "code": "def count_qualifying_digits(data):\n    ans = 0\n    for line in data:\n        _, output = line.split(\" | \")\n        for digit in output.split():\n            if len(digit) in (2, 3, 4, 7):\n                ans += 1\n    return ans\n", "entry_point": "count_qualifying_digits", "input": "['abcd | ab', 'xyz | abcd', 'p | abcd ef', 'g | hijk lmn opq']", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121913_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018932", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[96]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018933", "code": "from typing import List\ndef get_latest_supported_microversion(current_microversion: str, supported_microversions: List[str]) -> str:\n    current_major, current_minor = map(int, current_microversion.split('.'))\n    filtered_microversions = [microversion for microversion in supported_microversions if tuple(map(int, microversion.split('.'))) <= (current_major, current_minor)]\n    if not filtered_microversions:\n        return \"\"\n    return max(filtered_microversions)\n", "entry_point": "get_latest_supported_microversion", "input": "'2.5', ['2.0', '2.1', '2.2', '2.3', '2.4', '2.5']", "output": "'2.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24792_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018934", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018935", "code": "def find_intersection(a, b):\n    i = 0\n    j = 0\n    ans = []\n    while i < len(a) and j < len(b):\n        if a[i] == b[j]:\n            ans.append(a[i])\n            i += 1\n            j += 1\n        elif a[i] < b[j]:\n            i += 1\n        else:\n            j += 1\n    return ans\n", "entry_point": "find_intersection", "input": "[1, 4, 5, 7, 24], [2, 3, 4, 7, 24, 30]", "output": "[4, 7, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74107_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9642", "output": "{1, 2, 3, 6, 1607, 9642, 3214, 4821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018937", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[1, 2, [3, 3]]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt26", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018938", "code": "def count_paths(n):\n    s = [[0] * 10 for _ in range(n + 1)]\n    s[1] = [0] + [1] * 9\n    mod = 1000 ** 3\n    for i in range(2, n + 1):\n        for j in range(0, 9 + 1):\n            if j >= 1:\n                s[i][j] += s[i - 1][j - 1]\n            if j <= 8:\n                s[i][j] += s[i - 1][j + 1]\n    return sum(s[n]) % mod\n", "entry_point": "count_paths", "input": "1", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21515_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018939", "code": "def max_product_of_three(nums):\n    nums.sort()\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Last three elements\n    product2 = nums[0] * nums[1] * nums[-1]    # First two and last element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[-3, -2, 9]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99666_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018940", "code": "def count_hex_matches(input_string):\n    UCI_VERSION = '5964e2fc6156c5f720eed7faecf609c3c6245e3d'\n    UCI_VERSION_lower = UCI_VERSION.lower()\n    input_string_lower = input_string.lower()\n    count = 0\n    for char in input_string_lower:\n        if char in UCI_VERSION_lower:\n            count += 1\n    return count\n", "entry_point": "count_hex_matches", "input": "'5964cdeeeeee'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86391_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018941", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmordmo.optionso.optofig'", "output": "('rdmordmo.optionso', 'optofig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018942", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018943", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018944", "code": "def find_repeated_element(A):\n    count_dict = {}\n    for num in A:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    repeated_element = max(count_dict, key=count_dict.get)\n    return repeated_element\n", "entry_point": "find_repeated_element", "input": "[4, 4, 4, 2, 5, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99039_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8548", "output": "{1, 2, 8548, 4, 4274, 2137}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8547", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018946", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 86, 50, 20]", "output": "[100, 90, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148811_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018947", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5973", "output": "{1, 33, 3, 1991, 11, 5973, 181, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018948", "code": "def simulate_game(grid, start, instructions):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    rows, cols = len(grid), len(grid[0])\n    x, y = start\n    for instruction in instructions:\n        dx, dy = directions[instruction]\n        x = (x + dx) % rows\n        y = (y + dy) % cols\n        if grid[x][y] == 1:  # Check if the new position is blocked\n            x, y = start  # Reset to the starting position\n    return x, y\n", "entry_point": "simulate_game", "input": "[[0, 1, 0], [0, 0, 0], [1, 0, 1]], (1, 1), 'D'", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1807_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018949", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "30", "output": "'30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018950", "code": "def can_convert_to_palindrome(string):\n    z, o = 0, 0\n    for c in string:\n        if c == '0':\n            z += 1\n        else:\n            o += 1\n    if z == 1 or o == 1:\n        return \"Yes\"\n    else:\n        return \"No\"\n", "entry_point": "can_convert_to_palindrome", "input": "'1110'", "output": "'Yes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118308_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6506", "output": "{1, 6506, 2, 3253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6505", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018952", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[2, 4, 0, 2, 5, 3, 4, 0]", "output": "[7, 9, 5, 7, 10, 8, 9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018953", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "8", "output": "[8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018954", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Some text. Thomas. Williams is an example.'", "output": "'Thomas Williams'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018955", "code": "def findSqrt(num):\n    l = 0\n    r = num\n    while l <= r:\n        mid = l + (r - l) // 2\n        if mid * mid == num:\n            return True\n        if mid * mid < num:\n            l = mid + 1\n        if mid * mid > num:\n            r = mid - 1\n    return False\n", "entry_point": "findSqrt", "input": "16", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63488_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018956", "code": "def find_last_number_less_than_five(numbers):\n    for num in reversed(numbers):\n        if num < 5:\n            return num\n    return None\n", "entry_point": "find_last_number_less_than_five", "input": "[10, 6, 5, 3, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109099_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018957", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'JohoeSmDtS'", "output": "'Johoe sm dt s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018958", "code": "def calculate_average_color(colors):\n    total_red = 0\n    total_green = 0\n    total_blue = 0\n    for color in colors:\n        total_red += color[0]\n        total_green += color[1]\n        total_blue += color[2]\n    avg_red = round(total_red / len(colors))\n    avg_green = round(total_green / len(colors))\n    avg_blue = round(total_blue / len(colors))\n    return (avg_red, avg_green, avg_blue)\n", "entry_point": "calculate_average_color", "input": "[(129, 86, 119)]", "output": "(129, 86, 119)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79256_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018959", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'hello worldheelholo'", "output": "'worldheelholo hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018960", "code": "def process_scores(class_to_scores: dict, threshold: int, negative_label: str) -> tuple:\n    if len(class_to_scores) == 0:\n        return negative_label, 0\n    # Return max score\n    class_name, score = max(class_to_scores.items(), key=lambda i: i[1])\n    # Return negative label if less than threshold\n    if score > threshold:\n        return class_name, score\n    else:\n        return negative_label, 0\n", "entry_point": "process_scores", "input": "{}, 50, 'NoPPasdaded'", "output": "('NoPPasdaded', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75960_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018961", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'1.71.1'", "output": "(1, 71, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018962", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "7, 3", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018963", "code": "def max_non_adjacent_sum(lst):\n    if not lst:\n        return 0\n    include = lst[0]\n    exclude = 0\n    for i in range(1, len(lst)):\n        new_include = exclude + lst[i]\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[10, 5, 20, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73038_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3427", "output": "{1, 3427, 149, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018965", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97914_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018966", "code": "import binascii\nfrom typing import Union\ndef scrub_input(hex_str_or_bytes: Union[str, bytes]) -> bytes:\n    if isinstance(hex_str_or_bytes, str):\n        hex_str_or_bytes = binascii.unhexlify(hex_str_or_bytes)\n    return hex_str_or_bytes\n", "entry_point": "scrub_input", "input": "'48656c6c6f66'", "output": "b'Hellof'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49478_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018967", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/User/Doceum/xam'", "output": "('C:/User/Doceum', 'xam')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018968", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'ppppp r oo'", "output": "{'p': 5, 'r': 1, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139810_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018969", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7492", "output": "{1, 3746, 2, 7492, 4, 1873}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7491", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2685", "output": "{1, 3, 5, 15, 179, 537, 2685, 895}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018971", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/Documents/extxt'", "output": "('C:/Users/Documents', 'extxt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018972", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'00:05:35'", "output": "335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018973", "code": "def extract_app_module(default_app_config: str) -> str:\n    parts = default_app_config.split('.')\n    app_module = '.'.join(parts[:-1])\n    return app_module\n", "entry_point": "extract_app_module", "input": "'oscar.apps.dashboard.DashboardConfig'", "output": "'oscar.apps.dashboard'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129893_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018974", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[3, 5]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018975", "code": "import heapq\ndef first_n_smallest(lst, n):\n    heap = [(val, idx) for idx, val in enumerate(lst)]\n    heapq.heapify(heap)\n    result = [heapq.heappop(heap) for _ in range(n)]\n    result.sort(key=lambda x: x[1])  # Sort based on original indices\n    return [val for val, _ in result]\n", "entry_point": "first_n_smallest", "input": "[4, 3, 1, 1, 3, 0, 4], 7", "output": "[4, 3, 1, 1, 3, 0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105636_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8242", "output": "{1, 2, 26, 13, 8242, 4121, 634, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8241", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8021", "output": "{1, 13, 8021, 617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8020", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1093", "output": "{1, 1093}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018979", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[5, 7, 2, 6, 5, 1, 0, 6]", "output": "[5, 8, 4, 9, 9, 6, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018980", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'1.2'", "output": "'1.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018981", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[25, 20, 20, 10], 3", "output": "[25, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018982", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 7, 2, 1, 4, 3, 2, 0]", "output": "[9, 21, 4, 3, 8, 9, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018983", "code": "def calculate(numbers):\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd\n", "entry_point": "calculate", "input": "[2, 6, 7]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115831_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018984", "code": "import re\ndef extract_namespaces(urlpatterns):\n    namespaces_dict = {}\n    for url_pattern in urlpatterns:\n        url = url_pattern[0]\n        namespace_match = re.search(r'namespace=\\'(.*?)\\'', url_pattern[1])\n        namespace = namespace_match.group(1) if namespace_match else None\n        namespaces_dict[url] = namespace\n    return namespaces_dict\n", "entry_point": "extract_namespaces", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7565_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018985", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1166", "output": "{1, 2, 583, 106, 11, 1166, 53, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9069", "output": "{1, 3, 9069, 3023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018987", "code": "import os\ndef process_path(environ: dict, document_root: str) -> str:\n    path_info = environ.get('PATH_INFO', '')  # Extract path_info from environ, default to empty string\n    if path_info.startswith('/'):\n        path_info = path_info[1:]  # Remove leading slash to make it relative\n    full_path = os.path.join(document_root, path_info)\n    if full_path == '':\n        full_path = '.'  # Set to working directory if empty\n    return full_path\n", "entry_point": "process_path", "input": "{}, '/var/www/haml'", "output": "'/var/www/haml/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92964_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018988", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[-1, -1, -1, 4, 3, 5, 5]", "output": "{-1: 3, 4: 1, 3: 1, 5: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018989", "code": "def max_score_before_game_ends(scores):\n    max_score = float('-inf')  # Initialize max_score to negative infinity\n    for score in scores:\n        if score <= max_score:\n            break  # Exit the loop if the current score is less than or equal to the max_score\n        max_score = max(max_score, score)  # Update max_score if the current score is greater\n    return max_score\n", "entry_point": "max_score_before_game_ends", "input": "[1, 2, 3, 4, 5, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31682_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018990", "code": "def count_unique_paths(graph_edges, start_vertex, end_vertex):\n    def dfs(current_vertex):\n        if current_vertex == end_vertex:\n            nonlocal unique_paths\n            unique_paths += 1\n            return\n        visited.add(current_vertex)\n        for edge in graph_edges:\n            source, destination = edge\n            if source == current_vertex and destination not in visited:\n                dfs(destination)\n        visited.remove(current_vertex)\n    unique_paths = 0\n    visited = set()\n    dfs(start_vertex)\n    return unique_paths\n", "entry_point": "count_unique_paths", "input": "[('A', 'B'), ('A', 'C'), ('B', 'D'), ('C', 'D')], 'A', 'D'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110326_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018991", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018992", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 20, 39]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27175_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018993", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018994", "code": "def process_messages(input_str):\n    messages = {'Controller': [], 'Switch': []}\n    for message in input_str.split(','):\n        if message.startswith('C:'):\n            messages['Controller'].append(message[2:])\n        elif message.startswith('S:'):\n            messages['Switch'].append(message[2:])\n    return messages\n", "entry_point": "process_messages", "input": "'S:Switch'", "output": "{'Controller': [], 'Switch': ['Switch']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43777_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018995", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[1, 1, 2, 3, 3, 4]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4535", "output": "{1, 907, 5, 4535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018997", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{1: []}, 1", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018998", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'foo=bauox'", "output": "{'foo': 'bauox'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0018999", "code": "def custom_split(data, delimiters):\n    result = []\n    current_substring = \"\"\n    for char in data:\n        if char in delimiters:\n            if current_substring:\n                result.append(current_substring)\n                current_substring = \"\"\n        else:\n            current_substring += char\n    if current_substring:\n        result.append(current_substring)\n    return result\n", "entry_point": "custom_split", "input": "'apple;banan;baeb', [';', ' ']", "output": "['apple', 'banan', 'baeb']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10049_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019000", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "7", "output": "'./prespawned/version7_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3119", "output": "{1, 3119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019002", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'five7'", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019003", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "126", "output": "'ossg.default.126'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019004", "code": "def extract_app_module(default_app_config: str) -> str:\n    parts = default_app_config.split('.')\n    app_module = '.'.join(parts[:-1])\n    return app_module\n", "entry_point": "extract_app_module", "input": "'oscar.apps.dashboons.a'", "output": "'oscar.apps.dashboons'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129893_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019005", "code": "def reconstruct_string(freq_list):\n    char_freq = {}\n    # Create a dictionary mapping characters to their frequencies\n    for i, freq in enumerate(freq_list):\n        char_freq[chr(i)] = freq\n    # Sort the characters by their ASCII values\n    sorted_chars = sorted(char_freq.keys())\n    result = \"\"\n    # Reconstruct the string based on the frequency list\n    for char in sorted_chars:\n        result += char * char_freq[char]\n    return result\n", "entry_point": "reconstruct_string", "input": "[1, 1, 2, 1, 1, 2, 1, 2]", "output": "'\\x00\\x01\\x02\\x02\\x03\\x04\\x05\\x05\\x06\\x07\\x07'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49716_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019006", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '2.0.5', '2.1.2', '2.1.3']", "output": "'2.1.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019007", "code": "def find_common_characters(primeira, segunda):\n    terceira = \"\"\n    for letra in primeira:\n        if letra in segunda and letra not in terceira:\n            terceira += letra\n    return terceira if terceira else \"Caracteres comuns n\u00e3o encontrados.\"\n", "entry_point": "find_common_characters", "input": "'hello', 'world'", "output": "'lo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34861_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019008", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "5", "output": "'111221'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019009", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4285", "output": "{857, 1, 5, 4285}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019010", "code": "from typing import List\ndef find_target_index(collection: List[int], target: int) -> int:\n    left, right = 0, len(collection) - 1\n    while left <= right:\n        mid = left + (right - left) // 2\n        if collection[mid] == target:\n            return mid\n        elif collection[mid] < target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return -1\n", "entry_point": "find_target_index", "input": "[1, 3, 5, 7], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29277_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019011", "code": "def count_ways(M, N, X):\n    if X > M * N:\n        return 0\n    ways = [[0 for _ in range(M * N + 1)] for _ in range(N + 1)]\n    for i in range(1, M + 1):\n        ways[1][i] = 1\n    for i in range(2, N + 1):\n        for j in range(1, X + 1):\n            for k in range(1, M + 1):\n                if j - k <= 0:\n                    continue\n                ways[i][j] += ways[i - 1][j - k]\n    return ways[N][X]\n", "entry_point": "count_ways", "input": "5, 3, 7", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138246_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019012", "code": "from typing import List\ndef map_flags_to_operations(flags: List[int]) -> str:\n    flag_mapping = {\n        1: \"os.O_CREAT\",\n        2: \"os.O_EXCL\",\n        4: \"os.O_WRONLY\"\n    }\n    operations = [flag_mapping[flag] for flag in flags]\n    return \" | \".join(operations)\n", "entry_point": "map_flags_to_operations", "input": "[2, 4, 1]", "output": "'os.O_EXCL | os.O_WRONLY | os.O_CREAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67277_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4254", "output": "{1, 2, 3, 709, 6, 1418, 2127, 4254}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4253", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019014", "code": "from typing import List, Optional\ndef update_page_title(playlists: Optional[List[str]]) -> str:\n    global page_title\n    if playlists is None or len(playlists) == 0:\n        page_title = \"No Playlists Found\"\n    else:\n        page_title = \"Playlists Found\"\n    return page_title\n", "entry_point": "update_page_title", "input": "['My Favorite Songs']", "output": "'Playlists Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85488_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019015", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[10, 2.5, 0], 'add'", "output": "[12.5, 12.5, 12.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019016", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'power', 0, 0", "output": "\"Error: Invalid operation type 'power'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019017", "code": "def __is_object_bound_column(column_name):\n    \"\"\"\n    Check if column is object bound attribute or method\n    :param column_name: column name to be checked\n    :return: True if column is object bound, False otherwise\n    \"\"\"\n    PY2SQL_OBJECT_ATTR_PREFIX = \"attr_\"\n    PY2SQL_OBJECT_METHOD_PREFIX = \"method_\"\n    PY2SQL_PRIMITIVE_TYPES_VALUE_COLUMN_NAME = \"value\"\n    PY2SQL_OBJECT_PYTHON_ID_COLUMN_NAME = \"id\"\n    return column_name.startswith(PY2SQL_OBJECT_ATTR_PREFIX) or \\\n           column_name.startswith(PY2SQL_OBJECT_METHOD_PREFIX) or \\\n           column_name == PY2SQL_PRIMITIVE_TYPES_VALUE_COLUMN_NAME or \\\n           column_name == PY2SQL_OBJECT_PYTHON_ID_COLUMN_NAME\n", "entry_point": "__is_object_bound_column", "input": "'attr_test'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28560_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019018", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5, 6, 6]", "output": "[5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt36", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019019", "code": "from typing import List\nfrom collections import deque\ndef shortest_distances(N: int, R: List[List[int]]) -> List[int]:\n    D = [-1] * N\n    D[0] = 0\n    queue = deque([0])\n    while queue:\n        nxt = queue.popleft()\n        for i in R[nxt]:\n            if D[i] == -1:\n                queue.append(i)\n                D[i] = D[nxt] + 1\n    return D\n", "entry_point": "shortest_distances", "input": "5, [[1, 2], [3], [3, 4], [], []]", "output": "[0, 1, 1, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61964_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019020", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'  He,  '", "output": "'He,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019021", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "1", "output": "78271.51696402048", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019022", "code": "def process_integers(input_list):\n    # Multiply each integer by 2\n    multiplied_list = [num * 2 for num in input_list]\n    # Subtract 10 from each integer\n    subtracted_list = [num - 10 for num in multiplied_list]\n    # Calculate the square of each integer\n    squared_list = [num ** 2 for num in subtracted_list]\n    # Find the sum of all squared integers\n    sum_squared = sum(squared_list)\n    return sum_squared\n", "entry_point": "process_integers", "input": "[9]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101819_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019023", "code": "def remove_none_values(d):\n    for key, value in list(d.items()):\n        if value is None:\n            del d[key]\n        elif isinstance(value, dict):\n            remove_none_values(value)\n    # Remove empty nested dictionaries\n    for key in list(d.keys()):\n        if isinstance(d[key], dict) and not d[key]:\n            del d[key]\n    return d\n", "entry_point": "remove_none_values", "input": "{'a': None, 'b': None}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76751_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019024", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[40, 45, 50, 46, 45]", "output": "45.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019025", "code": "def lcm(numbers):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    def lcm_two_numbers(x, y):\n        return x * y // gcd(x, y)\n    result = 1\n    for num in numbers:\n        result = lcm_two_numbers(result, num)\n    return result\n", "entry_point": "lcm", "input": "[8, 9]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84681_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019026", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'21.2.2'", "output": "'21.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019027", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 6, 1", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019028", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[4, 1, 4, 3, 0, 4, 4, 4]", "output": "[5, 5, 7, 3, 4, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019029", "code": "def calculate_average_dimensions(sizes_test):\n    total_height = sum(dimensions[0] for dimensions in sizes_test)\n    total_width = sum(dimensions[1] for dimensions in sizes_test)\n    num_images = len(sizes_test)\n    average_height = round(total_height / num_images, 2)\n    average_width = round(total_width / num_images, 2)\n    return (average_height, average_width)\n", "entry_point": "calculate_average_dimensions", "input": "[(100, 180), (100, 180)]", "output": "(100.0, 180.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95103_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2073", "output": "{1, 3, 691, 2073}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019031", "code": "def sum_non_border_elements(matrix):\n    if len(matrix) < 3 or len(matrix[0]) < 3:\n        return 0  # Matrix is too small to have non-border elements\n    total_sum = 0\n    for i in range(1, len(matrix) - 1):\n        for j in range(1, len(matrix[0]) - 1):\n            total_sum += matrix[i][j]\n    return total_sum\n", "entry_point": "sum_non_border_elements", "input": "[[0, 0, 0], [0, 4, 0], [0, 0, 0]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88007_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019032", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5774", "output": "{1, 2, 5774, 2887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5773", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019033", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'Saeasosn', 1, '181001011'", "output": "'Saeasosn - 01 [181001011].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5191", "output": "{1, 179, 29, 5191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019035", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1833", "output": "{1, 611, 3, 39, 1833, 13, 141, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019036", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'ooon'", "output": "'ooon'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019037", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4039", "output": "{577, 1, 7, 4039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4038", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5047", "output": "{1, 7, 103, 49, 721, 5047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019039", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average = round(average_score, 2)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[88, 89, 89]", "output": "88.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105956_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019040", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[94], 1", "output": "94.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111793_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019041", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[91, 91, 91, 91, 91, 0, 0]", "output": "91.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019042", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "' 48 46 F2 76 '", "output": "b'HF\\xf2v'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019043", "code": "def calculate_shortest_distance(directions):\n    position = (0, 0)\n    for direction in directions:\n        if direction == 'N':\n            position = (position[0], position[1] + 1)\n        elif direction == 'E':\n            position = (position[0] + 1, position[1])\n        elif direction == 'S':\n            position = (position[0], position[1] - 1)\n        elif direction == 'W':\n            position = (position[0] - 1, position[1])\n    return abs(position[0]) + abs(position[1])\n", "entry_point": "calculate_shortest_distance", "input": "'EEENN'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41048_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019044", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'lhhlo'", "output": "b'\\x05\\x00\\x00\\x00lhhlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019045", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "789, interface='eth1', direction='in'", "output": "'acl/789/interfaces/eth1_in'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019046", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4379", "output": "{1, 4379, 29, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019047", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[2, 1, 2]", "output": "[2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019048", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'Hello,', 7", "output": "'Olssv,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20125_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019049", "code": "def move_player(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        # Check boundaries\n        x = max(-10, min(10, x))\n        y = max(-10, min(10, y))\n    return x, y\n", "entry_point": "move_player", "input": "['L', 'L', 'U']", "output": "(-2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019050", "code": "def format_column_name(raw_column_name, year):\n    raw_column_name = '_'.join(raw_column_name.lower().split())\n    raw_column_name = raw_column_name.replace('_en_{}_'.format(year), '_')\n    formatted_column_name = raw_column_name.replace('\u00e9', 'e')  # Replace accented '\u00e9' with 'e'\n    return formatted_column_name\n", "entry_point": "format_column_name", "input": "'Revenue en 2021 eil', 2021", "output": "'revenue_eil'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25598_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7937", "output": "{1, 7937}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019052", "code": "def count_unique_subsets(nums):\n    total_subsets = 0\n    n = len(nums)\n    for i in range(1, 2**n):\n        subset = [nums[j] for j in range(n) if (i >> j) & 1]\n        if subset:  # Ensure subset is not empty\n            total_subsets += 1\n    return total_subsets\n", "entry_point": "count_unique_subsets", "input": "[1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53823_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019053", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 1, 4, -1, 2, 2, 1, 2]", "output": "[1, 2, 6, 5, 7, 9, 10, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019054", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 2, 7, 7, 1, 7, 1]", "output": "[3, 3, 9, 10, 5, 12, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019055", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'aata/ay'", "output": "'aata/ay'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019056", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[4, 1, 4, 3, 1, 2, 3]", "output": "[5, 5, 7, 4, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019057", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "4", "output": "[0, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019058", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[3, 1, 5, 6, 2]", "output": "[3, 1, 5, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019059", "code": "def extract(sra, outdir, tool=\"fastq-dump\"):\n    \"\"\"Generate a command statement for extracting SRA files based on the provided parameters.\"\"\"\n    if tool == \"fastq-dump\":\n        tool += \" --split-files\"\n    statement = \"\"\"%(tool)s --gzip --outdir %(outdir)s %(sra)s\"\"\" % locals()\n    return statement\n", "entry_point": "extract", "input": "'samssle.', 'o/pp', 'abi-dummmp'", "output": "'abi-dummmp --gzip --outdir o/pp samssle.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13474_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019060", "code": "def find_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    complement_sequence = ''\n    for nucleotide in dna_sequence:\n        complement_sequence += complement_dict.get(nucleotide.upper(), '')  # Handle case-insensitive input\n    return complement_sequence\n", "entry_point": "find_complement", "input": "'AT'", "output": "'TA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101417_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019061", "code": "def calculate_point_averages(points):\n    if not points:\n        return (0, 0)\n    sum_x = sum(point[0] for point in points)\n    sum_y = sum(point[1] for point in points)\n    avg_x = sum_x / len(points)\n    avg_y = sum_y / len(points)\n    return (avg_x, avg_y)\n", "entry_point": "calculate_point_averages", "input": "[(0, 0), (1, 0), (0, 1)]", "output": "(0.3333333333333333, 0.3333333333333333)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89551_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019062", "code": "from typing import List\ndef calculate_visible_skyline(building_heights: List[int]) -> int:\n    total_visible_skyline = 0\n    stack = []\n    for height in building_heights:\n        while stack and height > stack[-1]:\n            total_visible_skyline += stack.pop()\n        stack.append(height)\n    total_visible_skyline += sum(stack)\n    return total_visible_skyline\n", "entry_point": "calculate_visible_skyline", "input": "[6, 2, 3, 5, 4, 10, 7]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39592_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019063", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    prev_score = None\n    ranks = []\n    for score in reversed(scores):\n        if score not in rank_dict:\n            if prev_score is not None and score < prev_score:\n                current_rank += 1\n            rank_dict[score] = current_rank\n        ranks.append(rank_dict[score])\n        prev_score = score\n    return ranks[::-1]\n", "entry_point": "calculate_ranks", "input": "[80, 80, 80, 80, 90, 90, 100, 100]", "output": "[3, 3, 3, 3, 2, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9219_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019064", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{-2: []}, -2", "output": "[-2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019065", "code": "def calculate_difference(n):\n    square_of_sum = (n ** 2 * (n + 1) ** 2) / 4\n    sum_of_squares = (n * (n + 1) * ((2 * n) + 1)) / 6\n    return int(square_of_sum - sum_of_squares)\n", "entry_point": "calculate_difference", "input": "4", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42300_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6291", "output": "{1, 3, 27, 9, 233, 2097, 6291, 699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3886", "output": "{1, 2, 67, 134, 3886, 1943, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019068", "code": "def count_a_in_list(strings):\n    total_count = 0\n    for string in strings:\n        for char in string:\n            if char.lower() == 'a':\n                total_count += 1\n    return total_count\n", "entry_point": "count_a_in_list", "input": "['a', 'a', 'a']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113849_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019069", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-90, -90, -90, -85], 4", "output": "-88.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2401_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019070", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[1, 2, 3], [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144987_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019071", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[0, 1, 2, 3, 0, 1, 2]", "output": "[0, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019072", "code": "import math\ndef obs2state(obs, multiplier=1000):\n    x_pos = int(math.floor(obs[0] * multiplier))\n    y_pos = int(math.floor(obs[1] * multiplier))\n    y_vel = int(obs[2])\n    state_string = str(x_pos) + '_' + str(y_pos) + '_' + str(y_vel)\n    return state_string\n", "entry_point": "obs2state", "input": "[3.141, 2.718, 5.0]", "output": "'3141_2718_5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26561_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019073", "code": "def calculate_time_elapsed(start_time, end_time):\n    total_seconds = end_time - start_time\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return hours, minutes, seconds\n", "entry_point": "calculate_time_elapsed", "input": "0, 7205", "output": "(2, 0, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87493_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019074", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1909", "output": "{1, 83, 1909, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019075", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5943", "output": "{1, 3, 7, 849, 21, 5943, 283, 1981}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019076", "code": "def sum_of_squares_of_evens(lst):\n    sum_squares = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[10]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82447_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019077", "code": "from typing import List\ndef count_double_clicks(click_times: List[int]) -> int:\n    if not click_times:\n        return 0\n    double_clicks = 0\n    prev_click_time = click_times[0]\n    for click_time in click_times[1:]:\n        if click_time - prev_click_time <= 640:\n            double_clicks += 1\n        prev_click_time = click_time\n    return double_clicks\n", "entry_point": "count_double_clicks", "input": "[100, 200, 300, 400, 500, 600, 640]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15147_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019078", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{apple, bananaerry}'", "output": "['apple', 'bananaerry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019079", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'USDTBNB'", "output": "('USDT', 'BNB')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019080", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "108", "output": "{1, 2, 3, 36, 4, 6, 9, 108, 12, 18, 54, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt107", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019081", "code": "def total_points(test_cases):\n    total = 0\n    for test_case in test_cases:\n        total += test_case['points']\n    return total\n", "entry_point": "total_points", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148658_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019082", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4342", "output": "{1, 2, 167, 13, 334, 4342, 26, 2171}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019083", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1579", "output": "{1, 1579}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019084", "code": "def unique(sequence):\n    if len(sequence) == len(set(sequence)):\n        return True\n    else:\n        return False\n", "entry_point": "unique", "input": "[1, 2, 3]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65143_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019085", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[1, 1, 1], 4, [2, 1, 2]]", "output": "[1, 1, 1, 4, 2, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019086", "code": "def calculate_total_score(scores):\n    total_score = 0\n    for score in scores:\n        if score % 5 == 0 and score % 7 == 0:\n            total_score += score * 4\n        elif score % 5 == 0:\n            total_score += score * 2\n        elif score % 7 == 0:\n            total_score += score * 3\n        else:\n            total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[10, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93768_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019087", "code": "def get_file_type(file_path):\n    file_extension = file_path[file_path.rfind(\".\"):].lower()\n    file_types = {\n        \".py\": \"Python file\",\n        \".txt\": \"Text file\",\n        \".jpg\": \"Image file\",\n        \".png\": \"Image file\",\n        \".mp3\": \"Audio file\",\n        \".mp4\": \"Video file\"\n    }\n    return file_types.get(file_extension, \"Unknown file type\")\n", "entry_point": "get_file_type", "input": "'report.txt'", "output": "'Text file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12387_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019088", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "406", "output": "{1, 2, 7, 203, 14, 406, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019089", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[90, 85, 95, 80], 4", "output": "[2, 0, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019090", "code": "def maximize_profit(weights, profits, bag_capacity):\n    n = len(weights)\n    data = [(i, profits[i], weights[i]) for i in range(n)]\n    data.sort(key=lambda x: x[1] / x[2], reverse=True)\n    total_profit = 0\n    selected_items = []\n    remaining_capacity = bag_capacity\n    for i in range(n):\n        if data[i][2] <= remaining_capacity:\n            remaining_capacity -= data[i][2]\n            selected_items.append(data[i][0])\n            total_profit += data[i][1]\n        else:\n            break\n    return total_profit, selected_items\n", "entry_point": "maximize_profit", "input": "[40, 60], [100, 60], 100", "output": "(160, [0, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2609_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019091", "code": "def calculate_total_seconds(duration):\n    # Split the duration string into hours, minutes, and seconds\n    hours, minutes, seconds = map(int, duration.split(':'))\n    # Calculate the total number of seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "calculate_total_seconds", "input": "'0:0:30'", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40922_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019092", "code": "from typing import Dict, Optional\ndef process_metadata(metadata: Dict[str, Optional[str]]) -> str:\n    model_name = metadata.get('model_name', None)\n    input_data_type = metadata.get('input_data_type', None)\n    output_data_type = metadata.get('output_data_type', None)\n    output = []\n    if model_name:\n        output.append(f\"Model Name: {model_name}\")\n    if input_data_type:\n        output.append(f\"Input Data Type: {input_data_type}\")\n    if output_data_type:\n        output.append(f\"Output Data Type: {output_data_type}\")\n    return '\\n'.join(output)\n", "entry_point": "process_metadata", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132332_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019093", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "2.0, 10.0, 10.702499999999997", "output": "41.404999999999994", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019094", "code": "def find_increase(lines):\n    increase = 0\n    for i in range(1, len(lines)):\n        if lines[i] > lines[i - 1]:\n            increase += 1\n    return increase\n", "entry_point": "find_increase", "input": "[1, 2, 3, 4, 5, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53543_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019095", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 4, 5, 7, 8, 5, 7]", "output": "[1, 5, 10, 17, 25, 30, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019096", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "6", "output": "'VI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019097", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/utput.txt'", "output": "'/tmp/ml4pl/data/utput.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "645", "output": "{1, 129, 3, 5, 645, 43, 15, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019099", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[1, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019100", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "4793490, 1", "output": "4793490", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt25", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019101", "code": "from typing import Tuple\ndef final_position(directions: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'RRRRU'", "output": "(4, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93403_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019102", "code": "def longest_palindromic_substring(s):\n    size = len(s)\n    if size < 2:\n        return s\n    dp = [[False for _ in range(size)] for _ in range(size)]\n    maxLen = 1\n    start = 0\n    for j in range(1, size):\n        for i in range(0, j):\n            if s[i] == s[j]:\n                if j - i <= 2:\n                    dp[i][j] = True\n                else:\n                    dp[i][j] = dp[i + 1][j - 1]\n            if dp[i][j]:\n                curLen = j - i + 1\n                if curLen > maxLen:\n                    maxLen = curLen\n                    start = i\n    return s[start : start + maxLen]\n", "entry_point": "longest_palindromic_substring", "input": "'babaabab'", "output": "'babaabab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74617_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019103", "code": "import logging\n# Sample DATUM_DICT for testing\nDATUM_DICT = {\n    4326: \"WGS84\",\n    32633: \"WGS84 / UTM zone 33N\",\n    3857: \"WGS84 / Pseudo-Mercator\"\n}\ndef get_datum_and_zone(srid):\n    datum, zone = (None, None)\n    full_datum = DATUM_DICT.get(srid)\n    if full_datum is not None:\n        splits = full_datum.split()\n        datum = splits[0]\n        if len(splits) > 1:\n            try:\n                zone = int(splits[-1])\n            except ValueError as e:\n                logging.exception(e)\n    return datum, zone\n", "entry_point": "get_datum_and_zone", "input": "4326", "output": "('WGS84', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114114_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019104", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2, 2, 2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019105", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "4.0", "output": "1.528", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019106", "code": "def extract_view_names(url_patterns):\n    view_patterns_dict = {}\n    for url_pattern, view_name in url_patterns:\n        view_patterns_dict[view_name] = url_pattern\n    return view_patterns_dict\n", "entry_point": "extract_view_names", "input": "[('/products/', 'products')]", "output": "{'products': '/products/'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60902_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "717", "output": "{1, 3, 717, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt716", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8173", "output": "{1, 11, 8173, 743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019109", "code": "def encrypt_string(input_string, key):\n    if not key:\n        return input_string\n    encrypted_chars = []\n    key_length = len(key)\n    for i, char in enumerate(input_string):\n        key_char = key[i % key_length]\n        shift = ord(key_char)\n        encrypted_char = chr((ord(char) + shift) % 256)\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_string", "input": "'\\x8f\\x8c\\x9d\u00a7\\x96\\x90\u00a7', 'A'", "output": "'\u00d0\u00cd\u00de\u00e8\u00d7\u00d1\u00e8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43650_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019110", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 6, 3, 3, 0, 2, 1, 2]", "output": "[11, 9, 6, 3, 2, 3, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9869", "output": "{1, 139, 9869, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019112", "code": "import math\ndef calculate_path(R, D):\n    path = math.factorial(D + R - 1) // (math.factorial(R - 1) * math.factorial(D))\n    return path\n", "entry_point": "calculate_path", "input": "9, 5", "output": "1287", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141457_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019113", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'sigle-w-o'", "output": "['sigle-w-o']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019114", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "4, 3, 2", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019115", "code": "def max_profit_two_transactions(prices):\n    buy1 = buy2 = float('inf')\n    sell1 = sell2 = 0\n    for price in prices:\n        buy1 = min(buy1, price)\n        sell1 = max(sell1, price - buy1)\n        buy2 = max(buy2, sell1 - price)\n        sell2 = max(sell2, price + buy2)\n    buy2 = sell2 = 0\n    for price in reversed(prices):\n        sell2 = max(sell2, price)\n        buy2 = max(buy2, sell2 - price)\n        sell1 = max(sell1, buy2 + price)\n        buy1 = min(buy1, price)\n    return sell1\n", "entry_point": "max_profit_two_transactions", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120999_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019116", "code": "def maxTurbulenceSize(A):\n    ans = 1\n    start = 0\n    for i in range(1, len(A)):\n        c = (A[i-1] > A[i]) - (A[i-1] < A[i])\n        if c == 0:\n            start = i\n        elif i == len(A)-1 or c * ((A[i] > A[i+1]) - (A[i] < A[i+1])) != -1:\n            ans = max(ans, i - start + 1)\n            start = i\n    return ans\n", "entry_point": "maxTurbulenceSize", "input": "[9, 1, 8, 2, 7]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41497_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019117", "code": "def parse_platform(curr_platform):\n    platform, compiler = curr_platform.split(\"_\")\n    output_folder_platform = \"\"\n    output_folder_compiler = \"\"\n    if platform.startswith(\"win\"):\n        output_folder_platform = \"Win\"\n        if \"vs2013\" in compiler:\n            output_folder_compiler = \"vc120\"\n        elif \"vs2015\" in compiler:\n            output_folder_compiler = \"vc140\"\n        elif \"vs2017\" in compiler:\n            output_folder_compiler = \"vc141\"\n    elif platform.startswith(\"darwin\"):\n        output_folder_platform = \"Mac\"\n        output_folder_compiler = \"clang\"\n    elif platform.startswith(\"linux\"):\n        output_folder_platform = \"Linux\"\n        output_folder_compiler = \"clang\"\n    return output_folder_platform, output_folder_compiler\n", "entry_point": "parse_platform", "input": "'darwin_somecompiler'", "output": "('Mac', 'clang')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142101_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019118", "code": "from typing import List, Tuple\ndef apply_substitutions(original: str, substitutions: List[Tuple[str, str, bool]]) -> str:\n    result = original\n    for target, replacement, global_replace in substitutions:\n        if global_replace:\n            result = result.replace(target, replacement)\n        else:\n            result = result.replace(target, replacement, 1)\n    return result\n", "entry_point": "apply_substitutions", "input": "'foo', [('foo', 'bar', True)]", "output": "'bar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44966_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019119", "code": "def calculate_fbeta_score(y_true, y_pred, beta):\n    true_positives = sum([1 for yt, yp in zip(y_true, y_pred) if yt == 1 and yp == 1])\n    predicted_positives = sum([1 for yp in y_pred if yp == 1])\n    actual_positives = sum([1 for yt in y_true if yt == 1])\n    precision = true_positives / predicted_positives if predicted_positives > 0 else 0\n    recall = true_positives / actual_positives if actual_positives > 0 else 0\n    fbeta_score = (1 + beta**2) * (precision * recall) / ((beta**2 * precision) + recall) if (precision + recall) > 0 else 0\n    return round(fbeta_score, 2)\n", "entry_point": "calculate_fbeta_score", "input": "[1, 1, 0, 1], [1, 1, 1, 0], 1", "output": "0.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72725_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019120", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[1, 2, 3, 'hello']", "output": "[1, 2, 3, 'hello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019121", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "1", "output": "[0, 0, 0, 0, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7585", "output": "{1, 7585, 37, 5, 41, 1517, 205, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019123", "code": "def calculate_submatrix_sum(ca, i, j):\n    n = len(ca)\n    m = len(ca[0])\n    prefix_sum = [[0 for _ in range(m)] for _ in range(n)]\n    for row in range(n):\n        for col in range(m):\n            prefix_sum[row][col] = ca[row][col]\n            if row > 0:\n                prefix_sum[row][col] += prefix_sum[row - 1][col]\n            if col > 0:\n                prefix_sum[row][col] += prefix_sum[row][col - 1]\n            if row > 0 and col > 0:\n                prefix_sum[row][col] -= prefix_sum[row - 1][col - 1]\n    submatrix_sum = prefix_sum[i][j]\n    return submatrix_sum\n", "entry_point": "calculate_submatrix_sum", "input": "[[1, 2, 3], [4, 5, 0]], 1, 2", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72883_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019124", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "7", "output": "1.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019125", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'10.0.0'", "output": "(10, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019126", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[7, 6, 2, 6, 7, 5, 6], 7", "output": "[[7, 6, 2, 6, 7, 5, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019127", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmo.options.apponsConfig'", "output": "('rdmo.options', 'apponsConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019128", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2285", "output": "{1, 5, 457, 2285}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019129", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4983", "output": "{1, 33, 3, 453, 11, 4983, 151, 1661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8397", "output": "{1, 3, 933, 9, 8397, 2799, 311, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2473", "output": "{1, 2473}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019132", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'_'", "output": "'Exporting annotated corpus data for _.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019133", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@om'", "output": "'om'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019134", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hello hello world'", "output": "{'hello': 2, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019135", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[0, 1, 2, 1, 6, 5, 3, 6, 2]", "output": "[0, 2, 4, 4, 10, 10, 9, 13, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019136", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=Acite age=30y=Yk'", "output": "{'name': 'Acite', 'age': '30y=Yk'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019137", "code": "def process_operations(operations):\n    global state\n    state = 0  # Initialize global state variable\n    for operation in operations:\n        op, val = operation.split()\n        val = int(val)\n        if op == 'add':\n            state += val\n        elif op == 'subtract':\n            state -= val\n    return state\n", "entry_point": "process_operations", "input": "['add 5', 'subtract 5']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25209_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019138", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[5, 5, 4, 7, 7, 7, 3, 4, 4]", "output": "[5, 10, 14, 21, 28, 35, 38, 42, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1738", "output": "{1, 2, 869, 1738, 11, 79, 22, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019140", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'MggMM'", "output": "'MggMM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019141", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "-459", "output": "-954", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019142", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[3, 4, 0, 8, 0, 4, 0, 4]", "output": "[5, 8, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5587", "output": "{1, 5587, 37, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3070", "output": "{1, 2, 5, 614, 10, 307, 3070, 1535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3069", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019145", "code": "import math\n# Define the factorial function using recursion\ndef factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "10", "output": "3628800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52131_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019146", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "150.0, 75.0", "output": "(-75.0, 75.0, 110.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019147", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2147", "output": "{19, 1, 2147, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019148", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 1, 0, 3, 4, 2]", "output": "[5, 4, 1, 3, 7, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019149", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[20], [29], [4, 4, [28]], 4]", "output": "[20, 29, 4, 4, 28, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8166", "output": "{1, 2, 3, 2722, 8166, 6, 1361, 4083}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019151", "code": "def calculate_total_thickness(ply_thickness, stacking_sequence, num_plies):\n    total_thickness = 0\n    for angle in stacking_sequence:\n        total_thickness += ply_thickness * num_plies\n    return total_thickness\n", "entry_point": "calculate_total_thickness", "input": "73.80669239999997, [0], 1", "output": "73.80669239999997", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40077_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019152", "code": "def filter_allowed_languages(input_languages, allowed_languages):\n    allowed_languages_list = allowed_languages.split(',')\n    filtered_languages = [lang for lang in allowed_languages_list if lang in input_languages]\n    return ','.join(filtered_languages)\n", "entry_point": "filter_allowed_languages", "input": "[], 'English,French,Spanish'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122149_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2522", "output": "{1, 2, 194, 26, 97, 13, 1261, 2522}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019154", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'10.2.100'", "output": "(10, 2, 100)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019155", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'names'", "output": "([], ['names'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019156", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "987654319", "output": "'987.654.319'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019157", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 10, 20, 30, 40, 10, 50]", "output": "[1, 1, 2, 3, 4, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019158", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'TE=TING'", "output": "{'TE': 'TING'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019159", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'c'", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019160", "code": "import math\ndef calculate_distances(points):\n    distances = {}\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            distances[(points[i], points[j])] = distance\n    return distances\n", "entry_point": "calculate_distances", "input": "[(1, 1), (5, 5)]", "output": "{((1, 1), (5, 5)): 5.656854249492381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67685_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019161", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@lecom'", "output": "'lecom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019162", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "0", "output": "156543.03392804097", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019163", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7365", "output": "{1, 1473, 3, 5, 7365, 491, 15, 2455}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019164", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "100, 25", "output": "0.013333333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019165", "code": "import math\ndef get_total_pages(post_list, count):\n    total_posts = len(post_list)\n    total_pages = math.ceil(total_posts / count)\n    return total_pages\n", "entry_point": "get_total_pages", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], 5", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90417_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019166", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2367", "output": "{1, 3, 263, 9, 789, 2367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019167", "code": "def simulate_train(commands):\n    position = 0\n    for command in commands:\n        if command == 'F' and position < 10:\n            position += 1\n        elif command == 'B' and position > -10:\n            position -= 1\n    return position\n", "entry_point": "simulate_train", "input": "['F']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105746_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019168", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'a b'", "output": "'ab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019169", "code": "def round_to_grid(glyph_features, grid_size):\n    rounded_features = []\n    for feature in glyph_features:\n        rounded_value = round(feature / grid_size) * grid_size\n        rounded_features.append(rounded_value)\n    return rounded_features\n", "entry_point": "round_to_grid", "input": "[10.0, 15.0, 20.0], 5", "output": "[10, 15, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75720_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019170", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'amelortt'", "output": "{'amelortt': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019171", "code": "def process_query(query: str, operator: str) -> dict:\n    parts = [x.strip() for x in operator.split(query)]\n    assert len(parts) in (1, 3), \"Invalid query format\"\n    query_key = parts[0]\n    result = {query_key: {}}\n    return result\n", "entry_point": "process_query", "input": "'foo', '====='", "output": "{'=====': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13586_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019172", "code": "def extract_app_name(default_app_config):\n    # Split the input string using dot as the delimiter\n    config_parts = default_app_config.split('.')\n    # Extract the app name from the first part\n    app_name = config_parts[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'djangilsConfig.some.other.ClassName'", "output": "'djangilsConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64209_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019173", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "7.304000000000001", "output": "7304000000000001158", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019174", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1434", "output": "{1, 2, 3, 6, 717, 239, 1434, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1433", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019175", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[284]", "output": "284.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019176", "code": "def make_cls_name(base: str, replacement: str) -> str:\n    return base.replace(\"Base\", replacement)\n", "entry_point": "make_cls_name", "input": "'CCreateBaseMol', 'Creatr'", "output": "'CCreateCreatrMol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120218_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019177", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "9.260489, 5", "output": "9.26048", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019178", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "5", "output": "'Write-Ack'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9118", "output": "{1, 2, 194, 97, 47, 4559, 94, 9118}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019180", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'codpythone'", "output": "['codpythone']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019181", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 0, 1, 7, 2, 3, 2, 7, 3]", "output": "[3, 1, 3, 10, 6, 8, 8, 14, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019182", "code": "def parse_notebook_config(config_str: str) -> dict:\n    config_dict = {}\n    lines = config_str.split('\\n')\n    for line in lines:\n        key_value = line.split(' = ')\n        key = key_value[0].split('.')[-1]\n        value = key_value[1].strip(\"'\")\n        if value.isdigit():\n            value = int(value)\n        config_dict[key] = value\n    return config_dict\n", "entry_point": "parse_notebook_config", "input": "\"some.prefix.c888 = '88'\"", "output": "{'c888': 88}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133703_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019183", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[90, 35, 91, 39, 67, 34]", "output": "[90, 35, 91, 40, 67, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019184", "code": "def format_package_info(package_setup):\n    package_name = package_setup.get('name', '')\n    package_version = package_setup.get('version', '')\n    package_author = package_setup.get('author', '')\n    package_description = package_setup.get('description', '')\n    formatted_info = f\"Package: {package_name}\\nVersion: {package_version}\\nAuthor: {package_author}\\nDescription: {package_description}\"\n    return formatted_info\n", "entry_point": "format_package_info", "input": "{}", "output": "'Package: \\nVersion: \\nAuthor: \\nDescription: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47596_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019185", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[1, [3]], [6, 0, [2]], [4], [[1, 4], 6]]", "output": "[1, 3, 6, 0, 2, 4, 1, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019186", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "0", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019187", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "'Hello World! // some comment'", "output": "'helloworld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019188", "code": "import math\ndef calculate_distance_traveled(rotations_right, rotations_left, wheel_radius):\n    distance_right = wheel_radius * 2 * math.pi * rotations_right\n    distance_left = wheel_radius * 2 * math.pi * rotations_left\n    total_distance = (distance_right + distance_left) / 2\n    return total_distance\n", "entry_point": "calculate_distance_traveled", "input": "15, 8, 10", "output": "722.5663103256525", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15765_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019189", "code": "def calculate_total_elements(maxlag, disp_lag, dt):\n    # Calculate the total number of elements in the matrix\n    total_elements = 2 * int(disp_lag / dt) + 1\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "0, 26, 1", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39261_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019190", "code": "import typing\ndef circular_sum(input_list: typing.List[int]) -> typing.List[int]:\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1]", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4417_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019191", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "1, 54", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019192", "code": "def determine_winner(N, player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins\"\n    elif player2_wins > player1_wins:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "determine_winner", "input": "3, [1, 2, 3], [3, 4, 5]", "output": "'Player 2 wins'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31130_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7983", "output": "{1, 3, 2661, 9, 7983, 887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019194", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[7, 2, 2, 2], 4, 1", "output": "[7, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019195", "code": "import hmac\nimport base64\ndef verify_jwt(jwt: str, secret_key: str) -> bool:\n    parts = jwt.split('.')\n    if len(parts) != 3:\n        return False\n    header_payload = f\"{parts[0]}.{parts[1]}\".encode()\n    recreated_signature = base64.urlsafe_b64encode(hmac.new(secret_key.encode(), header_payload, 'sha256').digest()).rstrip(b'=').decode()\n    return recreated_signature == parts[2]\n", "entry_point": "verify_jwt", "input": "'header.payload', 'some_secret'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134597_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019196", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "12, 7", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019197", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[2, 6, 27]", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019198", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9836", "output": "{1, 2, 4, 9836, 4918, 2459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9835", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019199", "code": "def merge_lists(tds, tbs):\n    tas = []\n    # Append elements from tds in order\n    for element in tds:\n        tas.append(element)\n    # Append elements from tbs in reverse order\n    for element in reversed(tbs):\n        tas.append(element)\n    return tas\n", "entry_point": "merge_lists", "input": "[1, 2, 3], [4, 5, 6]", "output": "[1, 2, 3, 6, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146813_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019200", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'a di c'", "output": "'di'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019201", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2318", "output": "{1, 2, 38, 1159, 2318, 19, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019202", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[10, 9], 19", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019203", "code": "from typing import Optional\ndef copy_pin(source_pin_id: str, destination_board_id: str, media_path_or_id: Optional[str]) -> str:\n    # Check if source_pin_id and destination_board_id are valid identifiers\n    if not source_pin_id or not destination_board_id:\n        return \"Invalid source_pin_id or destination_board_id\"\n    # Copy the pin to the destination board\n    try:\n        # Copy logic here\n        if media_path_or_id:\n            return f\"Pin {source_pin_id} copied to board {destination_board_id} with media {media_path_or_id}\"\n        else:\n            return f\"Pin {source_pin_id} copied to board {destination_board_id}\"\n    except Exception as e:\n        return f\"Error copying pin: {str(e)}\"\n", "entry_point": "copy_pin", "input": "'123', '456', '789'", "output": "'Pin 123 copied to board 456 with media 789'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21308_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3865", "output": "{1, 773, 5, 3865}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3864", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019205", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[1, 5, 3, 1, 5, 1, 3]", "output": "[1, 5, 3, 1, 5, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019206", "code": "def dummy(n):\n    fibonacci_numbers = [0, 1]\n    while len(fibonacci_numbers) < n:\n        next_number = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        fibonacci_numbers.append(next_number)\n    return fibonacci_numbers[:n]\n", "entry_point": "dummy", "input": "13", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134685_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019207", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0.6, -1.0, 0.0", "output": "-0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019208", "code": "import itertools\ndef count_unique_combinations(items, k):\n    unique_combinations = list(itertools.combinations(items, k))\n    return len(unique_combinations)\n", "entry_point": "count_unique_combinations", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23071_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019209", "code": "def calculate(numbers):\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd\n", "entry_point": "calculate", "input": "[4, 7]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115831_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3759", "output": "{1, 3, 1253, 7, 3759, 179, 21, 537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019211", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[3, 6, 12]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019212", "code": "def sum_fibonacci(N):\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    elif N == 2:\n        return 1\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_fibonacci", "input": "13", "output": "376", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140036_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019213", "code": "def filter_dhcp_options(dhcp_options_list: list, vpc_id: str) -> list:\n    filtered_dhcp_options = [dhcp_option['DhcpOptionsId'] for dhcp_option in dhcp_options_list if dhcp_option.get('VpcId') == vpc_id]\n    return filtered_dhcp_options\n", "entry_point": "filter_dhcp_options", "input": "[], 'vpc-12345678'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11559_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019214", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3279", "output": "{1, 3, 1093, 3279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019215", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[103, 91, 90, 50, 103, 91]", "output": "[103, 91, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019216", "code": "def handle_job_application_submission(form_data):\n    context = {}\n    if 'Apply' in form_data:\n        context[\"showError\"] = True\n        # Simulating form validation\n        is_valid = True  # Assume form is valid for demonstration\n        if is_valid:\n            cleaned_data = {}  # Placeholder for cleaned form data\n            job_application = cleaned_data  # Placeholder for saved job application\n            # Return a success message or redirect response\n            return \"Job application saved successfully.\"\n    # If 'Apply' button was not clicked or form is invalid, return a response indicating no action needed\n    return \"No action needed.\"\n", "entry_point": "handle_job_application_submission", "input": "{}", "output": "'No action needed.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114558_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2787", "output": "{3, 1, 2787, 929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019218", "code": "def process_criteria(criteria: str) -> int:\n    name, operator = criteria.split(':')\n    result = ord(name[0]) & ord(operator[-1])\n    return result\n", "entry_point": "process_criteria", "input": "'0:1'", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137762_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019219", "code": "def calculate_total_time(jobs):\n    total_time = 0\n    for duration in jobs:\n        total_time += duration\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84145_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2105", "output": "{1, 421, 5, 2105}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2104", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019221", "code": "from typing import List\ndef calculate_score(deck: List[int]) -> int:\n    score = 0\n    prev_card = None\n    for card in deck:\n        if card == prev_card:\n            score = 0\n        else:\n            score += card\n        prev_card = card\n    return score\n", "entry_point": "calculate_score", "input": "[10, 15, 12, 19]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107329_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019222", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[0, 27, 0], [0, 0, 0]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59273_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019223", "code": "import re\ndef count_word_occurrences(text):\n    word_count = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_word_occurrences", "input": "'xtxext'", "output": "{'xtxext': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90305_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019224", "code": "# Define the memory protection constants and their attributes\nMEMORY_PROTECTION_ATTRIBUTES = {\n    0x01: ['PAGE_NOACCESS'],\n    0x02: ['PAGE_READONLY'],\n    0x04: ['PAGE_READWRITE'],\n    0x08: ['PAGE_WRITECOPY'],\n    0x100: ['PAGE_GUARD'],\n    0x200: ['PAGE_NOCACHE'],\n    0x400: ['PAGE_WRITECOMBINE'],\n    0x40000000: ['PAGE_TARGETS_INVALID', 'PAGE_TARGETS_NO_UPDATE']\n}\ndef get_protection_attributes(memory_protection):\n    attributes = []\n    for constant, attr_list in MEMORY_PROTECTION_ATTRIBUTES.items():\n        if memory_protection & constant:\n            attributes.extend(attr_list)\n    return attributes\n", "entry_point": "get_protection_attributes", "input": "3", "output": "['PAGE_NOACCESS', 'PAGE_READONLY']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63843_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019225", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "1, 3.52", "output": "3.52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019226", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'r'", "output": "'r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019227", "code": "import json\ndef find_email_details(requested_email):\n    # Predefined list of names and emails\n    data = [\n        {'name': 'Alice', 'email': 'alice@example.com'},\n        {'name': 'Bob', 'email': 'bob@example.com'},\n        {'name': 'Charlie', 'email': 'charlie@example.com'}\n    ]\n    for entry in data:\n        if entry['email'] == requested_email:\n            return json.dumps({'name': entry['name'], 'email': entry['email']})\n    return json.dumps({'error': 1})\n", "entry_point": "find_email_details", "input": "'bob@example.com'", "output": "'{\"name\": \"Bob\", \"email\": \"bob@example.com\"}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124254_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019228", "code": "from collections import defaultdict\ndef organize_dependencies(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    for dependency, _ in dependencies:\n        in_degree[dependency] = 0\n    for i in range(1, len(dependencies)):\n        if dependencies[i][0] != dependencies[i-1][0]:\n            graph[dependencies[i-1][0]].append(dependencies[i][0])\n            in_degree[dependencies[i][0]] += 1\n    queue = [dependency for dependency in in_degree if in_degree[dependency] == 0]\n    result = []\n    while queue:\n        current = queue.pop(0)\n        result.append(current)\n        for neighbor in graph[current]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    return result\n", "entry_point": "organize_dependencies", "input": "[('0002_updcae', None)]", "output": "['0002_updcae']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25215_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019229", "code": "def longest_consecutive_subsequence(input_list):\n    current_sequence = []\n    longest_sequence = []\n    for num in input_list:\n        if not current_sequence or num == current_sequence[-1] + 1:\n            current_sequence.append(num)\n        else:\n            if len(current_sequence) > len(longest_sequence):\n                longest_sequence = current_sequence\n            current_sequence = [num]\n    if len(current_sequence) > len(longest_sequence):\n        longest_sequence = current_sequence\n    return longest_sequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87901_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019230", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "474", "output": "{1, 2, 3, 6, 237, 79, 474, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019231", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'wowrlohel'", "output": "['wowrlohel']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019232", "code": "def generate_diamond_pattern(n):\n    diamond = []\n    # Generate the top half of the diamond\n    for i in range(1, n + 1):\n        if i == 1:\n            diamond.append(\" \" * (n - i) + \"*\")\n        else:\n            diamond.append(\" \" * (n - i) + \"*\" + \" \" * (2 * i - 2) + \"*\")\n    # Generate the bottom half of the diamond by mirroring the top half\n    for i in range(n - 1, 0, -1):\n        diamond.append(\" \" * (n - i) + \"*\" + \" \" * (2 * i - 2) + \"*\")\n    return diamond\n", "entry_point": "generate_diamond_pattern", "input": "3", "output": "['  *', ' *  *', '*    *', ' *  *', '  **']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33368_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019233", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'/pat/pat/directory'", "output": "\"Directory '/pat/pat/directory' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019234", "code": "def calculate_attention_scores(input_sequence, query_vector):\n    attention_scores = []\n    for vector in input_sequence:\n        dot_product = sum([x * y for x, y in zip(vector, query_vector)])\n        attention_scores.append(dot_product)\n    return attention_scores\n", "entry_point": "calculate_attention_scores", "input": "[[1.0, 2.0], [3.0, 4.5], [5.0, 7.0]], [1.0, 1.0]", "output": "[3.0, 7.5, 12.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101132_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019235", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wxt.Bto'", "output": "'wx.adv.t.Bto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019236", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[60, 60, 60]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9806_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019237", "code": "def process_version_number(version_number, env_variables):\n    if 'BITBUCKET_TAG' in env_variables:\n        return env_variables['BITBUCKET_TAG'].lstrip('v')\n    elif 'BUILD_SOURCEBRANCH' in env_variables:\n        full_tag_prefix = 'refs/tags/v'\n        return env_variables['BUILD_SOURCEBRANCH'][len(full_tag_prefix):]\n    else:\n        return version_number\n", "entry_point": "process_version_number", "input": "'base_version', {'BITBUCKET_TAG': 'v4.0.dev0'}", "output": "'4.0.dev0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32770_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "307", "output": "{1, 307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt306", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019239", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[9]", "output": "[9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019240", "code": "def extract_major_version(version):\n    first_dot_index = version.index('.')\n    major_version = int(version[:first_dot_index])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'11.0'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40723_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019241", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "13", "output": "[1, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019242", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[2000, 213]", "output": "'0:36:53'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019243", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "38, 1", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019244", "code": "def generate_url_view_mapping(urlpatterns):\n    url_view_mapping = {}\n    for url_pattern, view_name in urlpatterns:\n        url_view_mapping[url_pattern] = view_name\n    return url_view_mapping\n", "entry_point": "generate_url_view_mapping", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108722_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4533", "output": "{1, 3, 4533, 1511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019246", "code": "def generate_code_snippets(operator_names):\n    unary_operator_codes = {\n        \"UAdd\": (\"PyNumber_Positive\", 1),\n        \"USub\": (\"PyNumber_Negative\", 1),\n        \"Invert\": (\"PyNumber_Invert\", 1),\n        \"Repr\": (\"PyObject_Repr\", 1),\n        \"Not\": (\"UNARY_NOT\", 0),\n    }\n    rich_comparison_codes = {\n        \"Lt\": \"LT\",\n        \"LtE\": \"LE\",\n        \"Eq\": \"EQ\",\n        \"NotEq\": \"NE\",\n        \"Gt\": \"GT\",\n        \"GtE\": \"GE\",\n    }\n    output_snippets = []\n    for operator_name in operator_names:\n        if operator_name in unary_operator_codes:\n            output_snippets.append(unary_operator_codes[operator_name][0])\n        elif operator_name in rich_comparison_codes:\n            output_snippets.append(rich_comparison_codes[operator_name])\n    return output_snippets\n", "entry_point": "generate_code_snippets", "input": "['Eq', 'Not']", "output": "['EQ', 'UNARY_NOT']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_547_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019247", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4287", "output": "{1, 3, 1429, 4287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4286", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019248", "code": "import re\ndef analyze_version_pattern(version):\n    patterns = {\n        'NO_REPOSITORY_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_COMMITS_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_TAG_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'NO_TAG_DIRTY_VERSION_PATTERN': re.compile(r'^0.1.0SNAPSHOT\\w+$'),\n        'TAG_ON_HEAD_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+$'),\n        'TAG_ON_HEAD_DIRTY_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SNAPSHOT\\w+$'),\n        'TAG_NOT_ON_HEAD_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SHA\\w+$'),\n        'TAG_NOT_ON_HEAD_DIRTY_VERSION_PATTERN': re.compile(r'^\\d+\\.\\d+\\.\\d+SHA\\w+SNAPSHOT\\w+$')\n    }\n    for pattern_type, pattern in patterns.items():\n        if pattern.match(version):\n            return pattern_type\n    return \"Unknown\"\n", "entry_point": "analyze_version_pattern", "input": "'1.0.0'", "output": "'TAG_ON_HEAD_VERSION_PATTERN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39657_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019249", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[11, 6, 1, 1, 2, 2]", "output": "[11, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019250", "code": "def calculate_polygon_area(vertices):\n    if len(vertices) < 3:\n        return 0  # Not a valid polygon\n    area = 0\n    n = len(vertices)\n    x, y = zip(*vertices)\n    for i in range(n):\n        j = (i + 1) % n\n        area += x[i] * y[j] - x[j] * y[i]\n    return abs(area) / 2\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (5, 0), (5, 5), (0, 5)]", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104366_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1087", "output": "{1, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1086", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8774", "output": "{1, 2, 4387, 8774, 41, 107, 82, 214}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8773", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019253", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'rDEF'", "output": "'DEF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019254", "code": "# Step 1: Define the expected plaintext value\nexpected_plaintext = \"Hello, World!\"\n# Step 2: Implement a function to decrypt the message using the specified cipher\ndef decrypt_message(cipher, encrypted_message):\n    # Simulate decryption using the specified cipher\n    decrypted_message = f\"Decrypted: {encrypted_message}\"  # Placeholder decryption logic\n    return decrypted_message\n", "entry_point": "decrypt_message", "input": "'simple_cipher', 'trssaage'", "output": "'Decrypted: trssaage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65674_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019255", "code": "def parse_args_with_filter(r_args, threshold):\n    columns = r_args.get('columns', [])\n    args = {key: value for key, value in r_args.items() if key not in ('columns', 'api_key') and isinstance(value, int) and value >= threshold}\n    return columns, args\n", "entry_point": "parse_args_with_filter", "input": "{'api_key': 'some_value', 'value1': 5, 'value2': 3}, 10", "output": "([], {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86252_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "754", "output": "{1, 2, 26, 13, 754, 377, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019257", "code": "def find_min_path(triangle):\n    if not triangle:\n        return 0\n    for row in range(len(triangle) - 2, -1, -1):\n        for col in range(len(triangle[row])):\n            triangle[row][col] += min(triangle[row + 1][col], triangle[row + 1][col + 1])\n    return triangle[0][0]\n", "entry_point": "find_min_path", "input": "[[1], [0, 0]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139174_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019258", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    last_dot_index = default_app_config.rfind('.')\n    app_name = default_app_config[:last_dot_index]\n    config_class_name = default_app_config[last_dot_index + 1:]\n    return (app_name, config_class_name)\n", "entry_point": "parse_default_app_config", "input": "'mymt.appCo'", "output": "('mymt', 'appCo')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135777_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "671", "output": "{1, 11, 61, 671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019260", "code": "def assign_teams(candidates, team_capacities):\n    team_skill_levels = [0] * len(team_capacities)\n    assigned_teams = []\n    for candidate in candidates:\n        max_skill_team = None\n        max_skill = float('-inf')\n        for i, capacity in enumerate(team_capacities):\n            if team_skill_levels[i] + candidate <= capacity and team_skill_levels[i] > max_skill:\n                max_skill = team_skill_levels[i]\n                max_skill_team = i\n        if max_skill_team is None:\n            min_skill_team = team_skill_levels.index(min(team_skill_levels))\n            assigned_teams.append(min_skill_team)\n            team_skill_levels[min_skill_team] += candidate\n        else:\n            assigned_teams.append(max_skill_team)\n            team_skill_levels[max_skill_team] += candidate\n    return assigned_teams\n", "entry_point": "assign_teams", "input": "[3, 4, 2, 5], [5, 4, 5]", "output": "[0, 1, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58063_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019261", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'not_a_dataset', 220", "output": "220", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019262", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'nnNannNg.nnNannNg'", "output": "('nnNannNg', 'nnNannNg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019263", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "207", "output": "{1, 3, 69, 9, 207, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019264", "code": "def min_sum_path(grid):\n    m, n = len(grid), len(grid[0])\n    dp = [[0] * n for _ in range(m)]\n    for i in range(m):\n        for j in range(n):\n            if i == 0 and j == 0:\n                dp[i][j] = grid[0][0]\n            elif i == 0:\n                dp[i][j] = grid[i][j] + dp[i][j - 1]\n            elif j == 0:\n                dp[i][j] = grid[i][j] + dp[i - 1][j]\n            else:\n                dp[i][j] = grid[i][j] + min(dp[i - 1][j], dp[i][j - 1])\n    return dp[m - 1][n - 1]\n", "entry_point": "min_sum_path", "input": "[[1, 2], [2, 4]]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5160_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019265", "code": "def generate_pairs_string(data):\n    pairs = []\n    for item in data:\n        id_value = item.get('id')\n        type_value = item.get('type', 'None')\n        pairs.append(f'({id_value}, {type_value})')\n    return '[' + ', '.join(pairs) + ']'\n", "entry_point": "generate_pairs_string", "input": "[]", "output": "'[]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92718_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019266", "code": "def count_passed_students(scores):\n    pass_count = 0\n    for score in scores:\n        if score >= 50:\n            pass_count += 1\n    return pass_count\n", "entry_point": "count_passed_students", "input": "[50, 55, 60, 70, 75, 80, 90, 95, 30, 40]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140531_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019267", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "307, 0", "output": "307", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019268", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[8, 9, 1], 17", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019269", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'holnahp'", "output": "'holnahp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019270", "code": "def find_patterns(input_signal, pattern):\n    indices = []\n    pattern_length = len(pattern)\n    for i in range(len(input_signal) - pattern_length + 1):\n        if input_signal[i:i+pattern_length] == pattern:\n            indices.append(i)\n    return indices\n", "entry_point": "find_patterns", "input": "'xabcxabc', 'abc'", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127785_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019271", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'UUDDLLRR'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019272", "code": "def count_names(input_str):\n    name_counts = {}\n    names = input_str.split(',')\n    for name in names:\n        name = name.strip().lower()\n        name_counts[name] = name_counts.get(name, 0) + 1\n    return name_counts\n", "entry_point": "count_names", "input": "'john,'", "output": "{'john': 1, '': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64824_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019273", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'filename_parpart1_subpart2xt'", "output": "'parpart1_subpart2xt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019274", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'ehl'", "output": "[('e', 1), ('h', 1), ('l', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019275", "code": "from typing import List\ndef count_unique_requirements(requirements: List[int]) -> int:\n    unique_requirements = set()\n    for req in requirements:\n        unique_requirements.add(req)\n    return len(unique_requirements)\n", "entry_point": "count_unique_requirements", "input": "[1, 2, 2, 3, 4, 5, 5, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112114_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019276", "code": "import re\nDATE_RE = re.compile(r\"[0-9]{4}-[0-9]{2}-[0-9]{2}\")\nINVALID_IN_NAME_RE = re.compile(\"[^a-z0-9_]\")\ndef process_input(input_str):\n    # Check if input matches the date format pattern\n    is_date = bool(DATE_RE.match(input_str))\n    # Remove specific suffix if it exists\n    processed_str = input_str\n    if input_str.endswith(\"T00:00:00.000+00:00\"):\n        processed_str = input_str[:-19]\n    # Check for invalid characters based on the pattern\n    has_invalid_chars = bool(INVALID_IN_NAME_RE.search(input_str))\n    return (is_date, processed_str, has_invalid_chars)\n", "entry_point": "process_input", "input": "'2022-12-25020223'", "output": "(True, '2022-12-25020223', True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49598_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019277", "code": "def format_env_vars(env_dict, var_list):\n    formatted_pairs = []\n    for var in var_list:\n        if var in env_dict:\n            formatted_pairs.append(f\"{var}={env_dict[var]}\")\n    return formatted_pairs\n", "entry_point": "format_env_vars", "input": "{}, ['VAR1', 'VAR2']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16441_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019278", "code": "def calculate_median(numbers):\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 1:  # Odd number of elements\n        return sorted_numbers[n // 2]\n    else:  # Even number of elements\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (sorted_numbers[mid_left] + sorted_numbers[mid_right]) / 2\n", "entry_point": "calculate_median", "input": "[1.0, 2.0, 3.0]", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80358_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019279", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'rrTR'", "output": "'rTR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019280", "code": "from typing import List\ndef max_visible_buildings(buildings: List[int]) -> int:\n    if not buildings:\n        return 0\n    n = len(buildings)\n    lis = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if buildings[i] > buildings[j] and lis[i] < lis[j] + 1:\n                lis[i] = lis[j] + 1\n    return max(lis)\n", "entry_point": "max_visible_buildings", "input": "[1, 2, 3, 4, 5, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100979_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019281", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7563", "output": "{3, 1, 7563, 2521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4946", "output": "{2473, 1, 4946, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019283", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[2, 2, 3, 1, 4, 5, 5]", "output": "[2, 3, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019284", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'edifindt'", "output": "'edifindt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3946", "output": "{1, 3946, 2, 1973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019286", "code": "from collections import defaultdict\ndef organize_dependencies(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    for dependency, _ in dependencies:\n        in_degree[dependency] = 0\n    for i in range(1, len(dependencies)):\n        if dependencies[i][0] != dependencies[i-1][0]:\n            graph[dependencies[i-1][0]].append(dependencies[i][0])\n            in_degree[dependencies[i][0]] += 1\n    queue = [dependency for dependency in in_degree if in_degree[dependency] == 0]\n    result = []\n    while queue:\n        current = queue.pop(0)\n        result.append(current)\n        for neighbor in graph[current]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    return result\n", "entry_point": "organize_dependencies", "input": "[('a', 1), ('b', 2)]", "output": "['a', 'b']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25215_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019287", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'1.1.0'", "output": "(1, 1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019288", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 2, -2, 5, 0, 3, -1, 4]", "output": "[3, 3, 0, 8, 4, 8, 5, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019289", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'89,12356'", "output": "{89, 12356}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019290", "code": "def filter_seed_info(seed_info, threshold):\n    result = []\n    for key, value in seed_info.items():\n        if isinstance(value, str) and len(value) > threshold:\n            result.append(key)\n    return result\n", "entry_point": "filter_seed_info", "input": "{}, 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1049_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019291", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "278", "output": "{1, 2, 139, 278}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt277", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019292", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average_score", "input": "[90, 92, 94, 96, 98]", "output": "94", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77264_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019293", "code": "from typing import List\nfrom datetime import datetime\ndef earliest_date(dates: List[str]) -> str:\n    earliest_date = \"9999/12/31\"  # Initialize with a date far in the future\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, \"%Y/%m/%d\")\n        if date_obj < datetime.strptime(earliest_date, \"%Y/%m/%d\"):\n            earliest_date = date_str\n    return earliest_date\n", "entry_point": "earliest_date", "input": "[]", "output": "'9999/12/31'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128206_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019294", "code": "def generate_markdown_link(shape: dict) -> str:\n    alt_text = shape.get(\"String\", \"\") if shape.get(\"String\") else \"\"\n    filename = shape.get(\"exported_svg_filename\", shape.get(\"exported_filename\", \"\"))\n    link = \"![%(alt_text)s](%(filename)s)\" % {\"alt_text\": alt_text, \"filename\": filename}\n    return link\n", "entry_point": "generate_markdown_link", "input": "{}", "output": "'![]()'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21875_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019295", "code": "from typing import List, Union, Optional, Tuple\nfrom collections import Counter\ndef most_common_element(lst: List[Union[int, any]]) -> Tuple[Optional[int], Optional[int]]:\n    int_list = [x for x in lst if isinstance(x, int)]\n    if not int_list:\n        return (None, None)\n    counter = Counter(int_list)\n    most_common = counter.most_common(1)[0]\n    return most_common\n", "entry_point": "most_common_element", "input": "[3, 3, 3, 1, 2, 2]", "output": "(3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70044_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019296", "code": "import re\n_vowel = r\"[\u0430\u0435\u0451\u0438\u043e\u0443\u044b\u044d\u044e\u044f]\"\n_non_vowel = r\"[^\u0430\u0435\u0451\u0438\u043e\u0443\u044b\u044d\u044e\u044f]\"\n_re_perfective_gerund = re.compile(\n    r\"(((?P<ignore>[\u0430\u044f])(\u0432|\u0432\u0448\u0438|\u0432\u0448\u0438\u0441\u044c))|(\u0438\u0432|\u0438\u0432\u0448\u0438|\u0438\u0432\u0448\u0438\u0441\u044c|\u044b\u0432|\u044b\u0432\u0448\u0438|\u044b\u0432\u0448\u0438\u0441\u044c))$\"\n)\n_re_adjective = re.compile(\n    r\"(\u0435\u0435|\u0438\u0435|\u044b\u0435|\u043e\u0435|\u0438\u043c\u0438|\u044b\u043c\u0438|\u0435\u0439|\u0438\u0439|\u044b\u0439|\u043e\u0439|\u0435\u043c|\u0438\u043c|\u044b\u043c|\u043e\u043c|\u0435\u0433\u043e|\u043e\u0433\u043e|\u0435\u043c\u0443|\u043e\u043c\u0443|\u0438\u0445|\u044b\u0445|\"\n    r\"\u0443\u044e|\u044e\u044e|\u0430\u044f|\u044f\u044f|\u043e\u044e|\u0435\u044e)$\"\n)\n_re_participle = re.compile(\n    r\"(((?P<ignore>[\u0430\u044f])(\u0435\u043c|\u043d\u043d|\u0432\u0448|\u044e\u0449|\u0449))|(\u0438\u0432\u0448|\u044b\u0432\u0448|\u0443\u044e\u0449))$\"\n)\n_re_reflexive = re.compile(\n    r\"(\u0441\u044f|\u0441\u044c)$\"\n)\ndef analyze_russian_word(word):\n    endings = []\n    for regex in [_re_perfective_gerund, _re_adjective, _re_participle, _re_reflexive]:\n        match = regex.search(word)\n        if match:\n            endings.append(match.group())\n    return endings\n", "entry_point": "analyze_russian_word", "input": "'\u0441\u043e\u043b\u043d\u0446\u0435'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82667_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019297", "code": "import re\nfrom datetime import datetime\ndef process_string(input_string):\n    current_year = datetime.now().year\n    current_month = datetime.now().strftime('%m')\n    def replace_counter(match):\n        counter_format = match.group(0)\n        min_width = int(counter_format.split(':')[1][1:-1])  # Extract minimum width from the placeholder\n        return str(counter_format.format(counter=process_string.counter).zfill(min_width))\n    process_string.counter = 1\n    placeholders = {\n        '{year}': str(current_year),\n        '{month}': current_month,\n        '{counter:0[1-9]+[0-9]*d}': replace_counter\n    }\n    for placeholder, value in placeholders.items():\n        input_string = re.sub(re.escape(placeholder), str(value) if callable(value) else value, input_string)\n    process_string.counter += 1\n    return input_string\n", "entry_point": "process_string", "input": "'{{e{y{ea{'", "output": "'{{e{y{ea{'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112572_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019298", "code": "from typing import List, Dict\ndef extract_verbose_names(configs: List[str]) -> Dict[str, str]:\n    verbose_names = {}\n    for config in configs:\n        lines = config.split('\\n')\n        app_name = lines[0].split(\" = \")[1].strip(\"'\")\n        verbose_name = lines[1].split(\" = \")[1].strip(\"'\")\n        verbose_names[app_name] = verbose_name\n    return verbose_names\n", "entry_point": "extract_verbose_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139953_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9542", "output": "{1, 2, 4771, 9542, 13, 367, 26, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9541", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019300", "code": "def count_specific_operations(migration_operations, operation_type):\n    count = 0\n    for operation in migration_operations:\n        if operation.get('operation_type') == operation_type:\n            count += 1\n    return count\n", "entry_point": "count_specific_operations", "input": "[], 'migrate'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18684_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019301", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 2, 5, 4, 2, 2, 1, 4, 3]", "output": "[6, 7, 9, 6, 4, 3, 5, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8275", "output": "{1, 5, 331, 8275, 1655, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8274", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019303", "code": "def prepare_filename_string(input_string):\n    processed_string = input_string.replace(\"_\", \"-\").replace(\"|\", \"-\").replace(\" \", \"-\").replace(\"(\", \"\").replace(\")\", \"\").lower()\n    return processed_string\n", "entry_point": "prepare_filename_string", "input": "'name'", "output": "'name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145297_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019304", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'file.txtt'", "output": "'App/static/uploads/file.txtt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019305", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[7, 2, 6, 5, 4, 4, 4, 4]", "output": "[343, 4, 36, 125, 16, 16, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019306", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[1, 2, 2, 2, 3, 5, 2, 5]", "output": "[3, 4, 4, 5, 8, 7, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019307", "code": "def min_energy(energies):\n    min_energy_required = 0\n    current_energy = 0\n    for energy in energies:\n        current_energy += energy\n        if current_energy < 0:\n            min_energy_required += abs(current_energy)\n            current_energy = 0\n    return min_energy_required\n", "entry_point": "min_energy", "input": "[-10, -10, -10, -10, 6, -4, -6, 5]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78421_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019308", "code": "import re\ndef count_unique_words(text):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'python'", "output": "{'python': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33729_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4696", "output": "{1, 2, 4, 8, 587, 2348, 1174, 4696}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4695", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019310", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'BiBBilllll'", "output": "'tonga.cashregister.event.BiBBilllllCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019311", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 2]", "output": "[5, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019312", "code": "import re\nfrom collections import Counter\ndef most_common_word(s: str) -> str:\n    # Preprocess the input string\n    s = re.sub(r'[^\\w\\s]', '', s.lower())\n    # Split the string into words\n    words = s.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Find the most common word\n    most_common = max(word_freq, key=word_freq.get)\n    return most_common\n", "entry_point": "most_common_word", "input": "'hellloheellhtoberfest helloheellhtoberfest'", "output": "'hellloheellhtoberfest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23655_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019313", "code": "def generate_fizzbuzz_sequence(max_num):\n    res = []\n    for i in range(1, max_num + 1):\n        if i % 15 == 0:\n            res.append('fizzbuzz')\n        elif i % 3 == 0:\n            res.append('fizz')\n        elif i % 5 == 0:\n            res.append('buzz')\n        else:\n            res.append(str(i))\n    return ' '.join(res)\n", "entry_point": "generate_fizzbuzz_sequence", "input": "13", "output": "'1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47803_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019314", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[3, 2, 4, 4, 3, 1, 1]", "output": "[3, 3, 6, 7, 7, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019315", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "1, -58, 'fofofoooo'", "output": "{'fofofoooo': -58}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019316", "code": "from typing import List\ndef plusOne(digits: List[int]) -> List[int]:\n    n = len(digits)\n    for i in range(n - 1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    return [1] + digits\n", "entry_point": "plusOne", "input": "[9, 8, 9, 7, 8, 7, 8, 8, 7]", "output": "[9, 8, 9, 7, 8, 7, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88559_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019317", "code": "def filter_facilities(facilities, threshold):\n    filtered_facilities = []\n    for facility in facilities:\n        if facility['capacity'] > threshold:\n            filtered_facilities.append(facility)\n    return filtered_facilities\n", "entry_point": "filter_facilities", "input": "[{'capacity': 5}, {'capacity': 4}, {'capacity': 3}], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52222_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019318", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 7, 17]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50878_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019319", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[5, 1, 3, 1, 2, 4, 0, 5, 5]", "output": "[5, 2, 5, 4, 6, 9, 6, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019320", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9501", "output": "{1, 3, 9501, 3167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019321", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8026", "output": "{1, 8026, 2, 4013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019322", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "65", "output": "'A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019323", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5944", "output": "{1, 2, 4, 743, 8, 1486, 5944, 2972}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5943", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019324", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'\"heeexello\"'", "output": "['heeexello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019325", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[2, 2]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019326", "code": "def calculate_grade(score1, score2):\n    if score1 >= 90 and score2 > 80:\n        return \"A\"\n    elif score1 >= 80 and score2 >= 70:\n        return \"B\"\n    elif score1 >= 70 and score2 >= 60:\n        return \"C\"\n    elif score1 == 75 or score2 <= 65:\n        return \"D\"\n    else:\n        return \"E\"\n", "entry_point": "calculate_grade", "input": "90, 81", "output": "'A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123969_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019327", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import will_it_saturate.djangomportort'", "output": "'will_it_saturate.djangomportort'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019328", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2602", "output": "{1, 2602, 2, 1301}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2601", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "844", "output": "{1, 2, 4, 422, 844, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt843", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019330", "code": "def min_palindrome_cuts(s):\n    cut = [x for x in range(-1, len(s) + 1)]\n    for i in range(len(s)):\n        r1, r2 = 0, 0\n        # Odd palindrome\n        while i - r1 >= 0 and i + r1 < len(s) and s[i - r1] == s[i + r1]:\n            cut[i + r1 + 1] = min(cut[i + r1 + 1], cut[i - r1] + 1)\n            r1 += 1\n        # Even palindrome\n        while i - r2 >= 0 and i + r2 + 1 < len(s) and s[i - r2] == s[i + r2 + 1]:\n            cut[i + r2 + 2] = min(cut[i + r2 + 2], cut[i - r2] + 1)\n            r2 += 1\n    return cut[-1]\n", "entry_point": "min_palindrome_cuts", "input": "'aabbaacca'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96332_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019331", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    def perform_operation(operand1, operator, operand2):\n        if operator == '+':\n            return operand1 + operand2\n        elif operator == '-':\n            return operand1 - operand2\n        elif operator == '*':\n            return operand1 * operand2\n        elif operator == '/':\n            return operand1 / operand2\n    operators = {'+': 1, '-': 1, '*': 2, '/': 2}\n    output = []\n    operator_stack = []\n    for token in tokens:\n        if token.isdigit():\n            output.append(int(token))\n        elif token in operators:\n            while operator_stack and operators.get(token, 0) <= operators.get(operator_stack[-1], 0):\n                output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n            operator_stack.append(token)\n    while operator_stack:\n        output.append(perform_operation(output.pop(-2), operator_stack.pop(), output.pop()))\n    return output[0]\n", "entry_point": "evaluate_expression", "input": "'800 + 38'", "output": "838", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5718_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019332", "code": "import math\ndef calculate_terms(seq, wsize, l2):\n    term_c = 0\n    term_t = 0\n    term_g = 0\n    for i in range(len(seq) - wsize + 1):\n        window = seq[i:i+wsize]\n        freq_c = window.count('C') / wsize\n        freq_t = window.count('T') / wsize\n        freq_g = window.count('G') / wsize\n        if freq_c > 0:\n            term_c += (freq_c * math.log(freq_c) / l2)\n        if freq_t > 0:\n            term_t += (freq_t * math.log(freq_t) / l2)\n        if freq_g > 0:\n            term_g += (freq_g * math.log(freq_g) / l2)\n    return term_c, term_t, term_g\n", "entry_point": "calculate_terms", "input": "'AAA', 1, 2.0", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38443_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019333", "code": "from typing import List, Dict, Any\ndef filter_dynamodb_items(items: List[Dict[str, Any]], filter_attribute: str, filter_value: Any) -> List[Dict[str, Any]]:\n    filtered_items = []\n    for item in items:\n        if filter_attribute in item and item[filter_attribute] == filter_value:\n            filtered_items.append(item)\n    return filtered_items\n", "entry_point": "filter_dynamodb_items", "input": "[], 'attribute', 'value'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44894_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019334", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[2, 6, 9]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019335", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "70, 68", "output": "138", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019336", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1366", "output": "{1, 2, 683, 1366}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019337", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'Some'", "output": "'Some'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019338", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'aeag', 58", "output": "[58, 74, 58, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019339", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'knows'", "output": "'knows'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019340", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return None\n    nums.sort()\n    potential_product1 = nums[-1] * nums[-2] * nums[-3]\n    potential_product2 = nums[0] * nums[1] * nums[-1]\n    return max(potential_product1, potential_product2)\n", "entry_point": "max_product_of_three", "input": "[10, 11, 4]", "output": "440", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97311_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019341", "code": "from collections import deque\ndef count_connected_components(graph, N):\n    visited = [0] * (N + 1)  # Initialize visited list\n    cnt = 0  # Initialize count of connected components\n    def bfs(node):\n        queue = deque([node])\n        while queue:\n            n = queue.popleft()\n            for x in graph[n]:\n                if visited[x] == 0:\n                    queue.append(x)\n                    visited[x] = 1\n    for i in range(1, N + 1):\n        if visited[i] == 0:\n            bfs(i)\n            cnt += 1\n    return cnt\n", "entry_point": "count_connected_components", "input": "[], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128332_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019342", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['IgnoreMe', 'A', 'B', 'C']", "output": "'A B C'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019343", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "1997", "output": "'MCMXCVII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019344", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'A'", "output": "'A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019345", "code": "def extract_unique_values(data, key):\n    unique_values = set()\n    for entity in data:\n        if key in entity:\n            unique_values.add(entity[key])\n    return list(unique_values)\n", "entry_point": "extract_unique_values", "input": "[], 'nonexistent_key'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104936_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019346", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[5, 10, 15, 18]", "output": "[15, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019347", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[[30, 20], [21]]", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019348", "code": "def add_binary(a, b):\n    # Convert binary strings to decimal integers\n    int_a = int(a, 2)\n    int_b = int(b, 2)\n    # Add the decimal integers\n    sum_decimal = int_a + int_b\n    # Convert the sum back to binary representation\n    return bin(sum_decimal)[2:]\n", "entry_point": "add_binary", "input": "'10', '1000'", "output": "'1010'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38045_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019349", "code": "def can_watch_two_movies(flight_length, movie_lengths):\n    seen_lengths = set()\n    for length in movie_lengths:\n        remaining_time = flight_length - length\n        if remaining_time in seen_lengths:\n            return True\n        seen_lengths.add(length)\n    return False\n", "entry_point": "can_watch_two_movies", "input": "100, [60, 40]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101915_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019350", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/h/adm/n/dashboard/ome'", "output": "'/h/adm/n/dashboard/ome'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1473", "output": "{1, 3, 1473, 491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019352", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    n = len(scores)\n    dp = [0] * n\n    dp[0] = scores[0]\n    for i in range(1, n):\n        if scores[i] > scores[i - 1]:\n            dp[i] = max(dp[i], dp[i - 1] + scores[i])\n        else:\n            dp[i] = dp[i - 1]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[1, 2, 3, 4, 7]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127370_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019353", "code": "from typing import List, Tuple\ndef card_game(deck1: List[int], deck2: List[int]) -> Tuple[int, int]:\n    score1, score2 = 0, 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score1 += 1\n        elif card2 > card1:\n            score2 += 1\n    return score1, score2\n", "entry_point": "card_game", "input": "[6, 7, 8, 9, 10, 1], [1, 2, 3, 4, 5, 2]", "output": "(5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28513_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2276", "output": "{1, 2, 2276, 4, 1138, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2275", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019355", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[1, 1, 1, 1, 2, 2, 3]", "output": "[(1, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019356", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3023", "output": "{1, 3023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019357", "code": "def extract_text(input_text: str) -> str:\n    parts = input_text.split('<!DOCTYPE html>', 1)\n    return parts[0] if len(parts) > 1 else input_text\n", "entry_point": "extract_text", "input": "'secocn<!DOCTYPE html>'", "output": "'secocn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21287_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019358", "code": "def extract_filename(log_location: str) -> str:\n    # Find the last occurrence of '/' to identify the start of the filename\n    start_index = log_location.rfind('/') + 1\n    # Find the position of the '.' before the extension\n    end_index = log_location.rfind('.')\n    # Extract the filename between the last '/' and the '.'\n    filename = log_location[start_index:end_index]\n    return filename\n", "entry_point": "extract_filename", "input": "'/path/to/test.log'", "output": "'test'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13809_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019359", "code": "def max_product(nums):\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[7, 7]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110237_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019360", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[10, 10, 10], [6, 6, 6]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126506_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019361", "code": "def longest_subarray_with_distinct_elements(k):\n    n = len(k)\n    hashmap = dict()\n    j = 0\n    ans = 0\n    c = 0\n    for i in range(n):\n        if k[i] in hashmap and hashmap[k[i]] > 0:\n            while i > j and k[i] in hashmap and hashmap[k[i]] > 0:\n                hashmap[k[j]] -= 1\n                j += 1\n                c -= 1\n        hashmap[k[i]] = 1\n        c += 1\n        ans = max(ans, c)\n    return ans\n", "entry_point": "longest_subarray_with_distinct_elements", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37610_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019362", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9623", "output": "{1, 9623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3589", "output": "{1, 37, 3589, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019364", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8599", "output": "{1, 8599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019365", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[7, 7, 8, 8, 6, 13], 6", "output": "[7, 7, 8, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019366", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[90, 88, 87, 86, 85]", "output": "87.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019367", "code": "def count_inversions(queue: list[int]) -> int:\n    def _merge_and_count_split(left: list[int], right: list[int]) -> tuple[list[int], int]:\n        merged = []\n        count_split = 0\n        i = j = 0\n        while i < len(left) and j < len(right):\n            if left[i] <= right[j]:\n                merged.append(left[i])\n                i += 1\n            else:\n                merged.append(right[j])\n                count_split += len(left) - i\n                j += 1\n        merged.extend(left[i:])\n        merged.extend(right[j:])\n        return merged, count_split\n    def _count(queue: list[int]) -> tuple[list[int], int]:\n        if len(queue) > 1:\n            mid = len(queue) // 2\n            sorted_left, count_left = _count(queue[:mid])\n            sorted_right, count_right = _count(queue[mid:])\n            sorted_queue, count_split = _merge_and_count_split(sorted_left, sorted_right)\n            return sorted_queue, count_left + count_right + count_split\n        else:\n            return queue, 0\n    return _count(queue)[1]\n", "entry_point": "count_inversions", "input": "[2, 3, 8, 6, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117604_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019368", "code": "def FindOverkerns(city_populations, kern):\n    overkern_cities = []\n    for population in city_populations:\n        if population > kern:\n            overkern_cities.append(population)\n    return overkern_cities\n", "entry_point": "FindOverkerns", "input": "[50000, 75000, 100000, 60000], 70000", "output": "[75000, 100000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82686_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019369", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 5, 4, 5, 3, 6, 2, 1, 5]", "output": "[1, 6, 6, 8, 7, 11, 8, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019370", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3214", "output": "{1, 2, 3214, 1607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3213", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019371", "code": "import itertools\ndef generate_combinations(nums, k):\n    # Generate all combinations of size k\n    combinations = itertools.combinations(nums, k)\n    # Convert tuples to lists and store in result list\n    result = [list(comb) for comb in combinations]\n    return result\n", "entry_point": "generate_combinations", "input": "[1, 2, 3], 2", "output": "[[1, 2], [1, 3], [2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31218_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019372", "code": "def count_unique_chars(strings):\n    unique_char_counts = {}\n    for string in strings:\n        lowercase_string = string.lower()\n        unique_chars = {char for char in lowercase_string if char.isalpha()}\n        unique_char_counts[string] = len(unique_chars)\n    return unique_char_counts\n", "entry_point": "count_unique_chars", "input": "['Hello', 'World', 'Python']", "output": "{'Hello': 4, 'World': 5, 'Python': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84696_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019373", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'2.3.5'", "output": "(2, 3, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019374", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[7], 0", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019375", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[7, 5, 0, 8, 22, 6, -1, 5]", "output": "[12, 5, 8, 30, 28, 5, 4, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019376", "code": "import math\ndef normalized_entropy(probabilities):\n    entropy = -sum(p * math.log(p) for p in probabilities if p != 0)\n    total_events = len(probabilities)\n    normalized_entropy = entropy / math.log(total_events)\n    return normalized_entropy\n", "entry_point": "normalized_entropy", "input": "[0.25, 0.25, 0.25, 0.25]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24832_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019377", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'sers.some.other.text.SerservvCononfig'", "output": "('sers', 'SerservvCononfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019378", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[4, 3, 4, 5, 4, 0, 3, 3]", "output": "[16, 27, 16, 125, 16, 0, 27, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019379", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "10, 40", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019380", "code": "def minimize_difference(A):\n    total = sum(A)\n    m = float('inf')\n    left_sum = 0\n    for n in A[:-1]:\n        left_sum += n\n        v = abs(total - 2 * left_sum)\n        if v < m:\n            m = v\n    return m\n", "entry_point": "minimize_difference", "input": "[10, 5, 0]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1116_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019381", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[1, 4, 4, 3, 3, 4, 4, 1, 3]", "output": "[5, 8, 7, 6, 7, 8, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019382", "code": "from typing import List\ndef split_list(lst: List[int], n: int) -> List[List[int]]:\n    if n == 1:\n        return [lst]\n    output = [[] for _ in range(n)]\n    for i, num in enumerate(lst):\n        output[i % n].append(num)\n    return output\n", "entry_point": "split_list", "input": "[10, 60, 50, 1, 50, 6], 7", "output": "[[10], [60], [50], [1], [50], [6], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21886_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019383", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[3, 8, 15, 26, 30, 8]", "output": "[8, 26, 30, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7291", "output": "{1, 7291, 317, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019385", "code": "from typing import List\ndef modified_binary_search(arr: List[int], target: int) -> int:\n    low, high = 0, len(arr) - 1\n    result = -1\n    while low <= high:\n        mid = (low + high) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            low = mid + 1\n        else:\n            result = mid\n            high = mid - 1\n    return result\n", "entry_point": "modified_binary_search", "input": "[1, 2, 3], 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97045_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019386", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8936", "output": "{1, 2, 4, 8936, 8, 4468, 2234, 1117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8935", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019387", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[5, 0, 5, 0, 3, 0, 3, 0]", "output": "'aaaaabbbbbcccddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019388", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3507", "output": "{1, 3, 7, 167, 1169, 3507, 501, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019389", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1730", "output": "{1, 1730, 2, 865, 5, 10, 173, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1729", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019390", "code": "def sum_of_multiples(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 15, 18]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59802_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019391", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2307", "output": "{3, 1, 2307, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2306", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019393", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019394", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'you'", "output": "['you']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019395", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 3, 3, 0, 3, 1, -1, 3, 0]", "output": "[3, 6, 0, 12, 5, -6, 21, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019396", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "5", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "51", "output": "{3, 1, 51, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt50", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019398", "code": "import math\ndef inv_cdf_logistic(mu, s, p):\n    return mu + s * math.log(p / (1 - p))\n", "entry_point": "inv_cdf_logistic", "input": "-13.07669272463691, 1, 0.5", "output": "-13.07669272463691", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86075_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019399", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'helloworld'", "output": "'h.e.l.l.o.w.o.r.l.d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019400", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "1, 12", "output": "[12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1027", "output": "{1, 1027, 13, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1026", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019402", "code": "import re\ndef process_string(input_string):\n    # Replace \"Kafka\" with \"Python\"\n    processed_string = input_string.replace(\"Kafka\", \"Python\")\n    # Remove digits from the string\n    processed_string = re.sub(r'\\d', '', processed_string)\n    # Reverse the string\n    processed_string = processed_string[::-1]\n    return processed_string\n", "entry_point": "process_string", "input": "'mwessom'", "output": "'mossewm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55468_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019403", "code": "def longest_common_prefix(strs):\n    if not strs:\n        return \"\"\n    min_len = min(len(s) for s in strs)\n    prefix = \"\"\n    for i in range(min_len):\n        char = strs[0][i]\n        if all(s[i] == char for s in strs):\n            prefix += char\n        else:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "['fish', 'first', 'fence']", "output": "'f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48229_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "141", "output": "{1, 3, 141, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019405", "code": "def count_instances_of_type(instances, instance_type):\n    count = 0\n    for instance in instances:\n        if instance['type'] == instance_type:\n            count += 1\n    return count\n", "entry_point": "count_instances_of_type", "input": "[], 'any_type'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93749_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019406", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7093", "output": "{1, 173, 7093, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019407", "code": "def sum_of_pairs(lst, target):\n    seen = {}\n    pair_sum = 0\n    for num in lst:\n        complement = target - num\n        if complement in seen:\n            pair_sum += num + complement\n        seen[num] = True\n    return pair_sum\n", "entry_point": "sum_of_pairs", "input": "[10, 11, 1, 2, 3, 4], 21", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88231_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "262", "output": "{1, 2, 131, 262}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019409", "code": "from typing import List\ndef visible_skyline(buildings: List[int]) -> List[int]:\n    visible = []\n    max_height = 0\n    for building in buildings:\n        if building > max_height:\n            visible.append(building)\n            max_height = building\n    return visible\n", "entry_point": "visible_skyline", "input": "[1, 0, 2, 0, 4]", "output": "[1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46276_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019410", "code": "def calculate_min_max_sum(arr):\n    total_sum = sum(arr)\n    min_sum = total_sum - max(arr)\n    max_sum = total_sum - min(arr)\n    return min_sum, max_sum\n", "entry_point": "calculate_min_max_sum", "input": "[5, 5, 5, 10]", "output": "(15, 20)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17042_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019411", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "98.0, 98.0", "output": "(-49.0, 49.0, 87.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019412", "code": "import re\nfrom typing import List\ndef extract_words(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-z]{3,}y\\b'  # Define the pattern using regular expression\n    words = re.findall(pattern, text)  # Find all words matching the pattern\n    unique_words = list(set(words))    # Get unique words\n    return unique_words\n", "entry_point": "extract_words", "input": "'It is a ssunny day.'", "output": "['ssunny']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132295_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019413", "code": "def jaccard_index(set1, set2):\n    intersection_size = len(set1 & set2)\n    union_size = len(set1 | set2)\n    if union_size == 0:\n        return 0.00\n    else:\n        jaccard = intersection_size / union_size\n        return round(jaccard, 2)\n", "entry_point": "jaccard_index", "input": "{1, 2}, {1, 3}", "output": "0.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9565_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019414", "code": "def count_drawn_pieces(board):\n    drawn_pieces = 0\n    for row in board:\n        for cell in row:\n            if cell != 0:\n                drawn_pieces += 1\n    return drawn_pieces\n", "entry_point": "count_drawn_pieces", "input": "[[0, 0], [0, 0]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108525_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019415", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[8, 8, 30]", "output": "[8, 8, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019416", "code": "def process_categories(categories):\n    total_added = 0\n    for name, class_code in categories:\n        category = {'name': name, 'class_code': class_code}\n        try:\n            # Simulate adding the category by printing a message\n            print(f\"Adding category: {category['name']} with class code {category['class_code']}\")\n            total_added += 1\n        except Exception as e:\n            print(f\"Error adding category '{name}': {e}\")\n    return total_added\n", "entry_point": "process_categories", "input": "[('Category1', 'C001')]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60236_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019417", "code": "def max_distance(red_points, blue_points):\n    max_sum = 0\n    for red in red_points:\n        for blue in blue_points:\n            distance = abs(red - blue)\n            max_sum = max(max_sum, distance)\n    return max_sum\n", "entry_point": "max_distance", "input": "[0], [4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25133_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019418", "code": "from typing import List, Tuple, Dict\ndef apply_migrations(migrations: List[Tuple[str, str, str]]) -> Dict[str, List[str]]:\n    schema = {}\n    for model, field, _ in migrations:\n        if model not in schema:\n            schema[model] = [field]\n        else:\n            schema[model].append(field)\n    return schema\n", "entry_point": "apply_migrations", "input": "[('Product', 'name', 'dummy')]", "output": "{'Product': ['name']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82589_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019419", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'a', 19", "output": "'t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019420", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'MovigtBo'", "output": "'movigt_bo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019421", "code": "def remove_min_parentheses(s):\n    if not s:\n        return \"\"\n    s = list(s)\n    stack = []\n    for i, char in enumerate(s):\n        if char == \"(\":\n            stack.append(i)\n        elif char == \")\":\n            if stack:\n                stack.pop()\n            else:\n                s[i] = \"\"\n    while stack:\n        s[stack.pop()] = \"\"\n    return \"\".join(s)\n", "entry_point": "remove_min_parentheses", "input": "'(())(())'", "output": "'(())(())'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35267_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019422", "code": "def process_dashboard(yaml_contents: dict, dashboard_name: str) -> str:\n    if not yaml_contents:\n        return \"No dashboard data available\"\n    dashboards = yaml_contents.get('dashboards', [])\n    dashboard = next((d for d in dashboards if d['name'] == dashboard_name), None)\n    if dashboard:\n        return f\"Dashboard Name: {dashboard['name']}, Type: {dashboard['type']}, Data: {dashboard['data']}\"\n    else:\n        return \"Dashboard not found\"\n", "entry_point": "process_dashboard", "input": "{}, 'Any Dashboard Name'", "output": "'No dashboard data available'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102777_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019423", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[0, 1, -2, 0, -1, 4, -3, 0, 2]", "output": "[0, 1, -1, -1, -2, 2, -1, -1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019424", "code": "def calculate_total_length(strings):\n    total_length = 0\n    for element in strings:\n        if isinstance(element, str):\n            total_length += len(element)\n    return total_length\n", "entry_point": "calculate_total_length", "input": "['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29136_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019425", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        row = list(range(1, i + 1)) + [i] * (n - i)\n        pattern.append(row)\n    return pattern\n", "entry_point": "generate_pattern", "input": "2", "output": "[[1, 1], [1, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6444_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019426", "code": "def total_distance_traveled(numbers):\n    num_pos = [[0, 3], [1, 3], [2, 3], [0, 2], [1, 2], [2, 2], [0, 1], [1, 1], [2, 1], [1, 0]]\n    coords = {1: [0, 3], 2: [1, 3], 3: [2, 3], 4: [0, 2], 5: [1, 2], 6: [2, 2], 7: [0, 1], 8: [1, 1], 9: [2, 1], 0: [1, 0]}\n    total_distance = 0\n    current_position = coords[5]\n    for num in numbers:\n        next_position = coords[num]\n        dist_x, dist_y = next_position[0] - current_position[0], next_position[1] - current_position[1]\n        total_distance += abs(dist_x) + abs(dist_y)\n        current_position = next_position\n    return total_distance\n", "entry_point": "total_distance_traveled", "input": "[1, 0, 9, 8]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96023_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019427", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'220..0.0', 'rmflo'", "output": "\"[220..0.0]: 'rmflo'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019428", "code": "def List_Product(list):\n    L = []\n    for k in range(len(list[0])):\n        l = 1  # Reset product to 1 for each column\n        for i in range(len(list)):\n            l *= list[i][k]\n        L.append(l)\n    return L\n", "entry_point": "List_Product", "input": "[[1, 2, 2], [4, 4, 9], [7, 10, 9]]", "output": "[28, 80, 162]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130339_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019429", "code": "def generate_http_response(status_code, fileType=None):\n    if status_code == 200:\n        return f\"HTTP/1.1 200 OK\\r\\nContent-type: {fileType}\\r\\n\\r\\n\"\n    elif status_code == 301:\n        return \"HTTP/1.1 301 Moved Permanently\\r\\n\\r\\n\".encode()\n    elif status_code == 404:\n        return \"HTTP/1.1 404 Not Found\\r\\n\\r\\n\".encode()\n    elif status_code == 405:\n        return \"HTTP/1.1 405 Method Not Allowed\\r\\n\\r\\n\".encode()\n    else:\n        return \"Invalid status code\".encode()\n", "entry_point": "generate_http_response", "input": "301", "output": "b'HTTP/1.1 301 Moved Permanently\\r\\n\\r\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98337_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019430", "code": "def maximum_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product_of_three", "input": "[1, 2, 3, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93080_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019431", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019432", "code": "def calculate_train_info(total_loss, total_acc, i):\n    train_info = {}\n    train_info['loss'] = total_loss / float(i + 1)\n    train_info['train_accuracy'] = total_acc / float(i + 1)\n    return train_info\n", "entry_point": "calculate_train_info", "input": "12.25, 10.375, 0", "output": "{'loss': 12.25, 'train_accuracy': 10.375}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45300_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019433", "code": "def skipVowels(word):\n    novowels = ''\n    for ch in word:\n        if ch.lower() in 'aeiou':\n            continue\n        novowels += ch\n    return novowels\n", "entry_point": "skipVowels", "input": "'awetido'", "output": "'wtd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120866_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019434", "code": "def calculate_account_balances(transactions):\n    account_balances = {}\n    for account, amount in transactions:\n        if account in account_balances:\n            account_balances[account] += amount\n        else:\n            account_balances[account] = amount\n    return account_balances\n", "entry_point": "calculate_account_balances", "input": "[('Checking', 0)]", "output": "{'Checking': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43902_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019435", "code": "from typing import Tuple\ndef final_position(directions: str, grid_size: int) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    x = max(-grid_size, min(grid_size, x))\n    y = max(-grid_size, min(grid_size, y))\n    return (x, y)\n", "entry_point": "final_position", "input": "'UUUUUURR', 6", "output": "(2, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81995_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019436", "code": "def calculate_chunk_range(selection, chunks):\n    chunk_range = []\n    for s, l in zip(selection, chunks):\n        if isinstance(s, slice):\n            start_chunk = s.start // l\n            end_chunk = (s.stop - 1) // l\n            chunk_range.append(list(range(start_chunk, end_chunk + 1)))\n        else:\n            chunk_range.append([s // l])\n    return chunk_range\n", "entry_point": "calculate_chunk_range", "input": "[2, 14], [2, 2]", "output": "[[1], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128291_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019437", "code": "def sum_multiples_of_divisor(numbers, divisor):\n    sum_multiples = 0\n    for num in numbers:\n        if num % divisor == 0:\n            sum_multiples += num\n    return sum_multiples\n", "entry_point": "sum_multiples_of_divisor", "input": "[14, 28, 42, 10], 7", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74016_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019438", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9902", "output": "{1, 2, 9902, 4951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9901", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019439", "code": "def format_title(title):\n    words = title.split()\n    formatted_words = [word.capitalize().replace('-', '') for word in words]\n    formatted_title = ' '.join(formatted_words)\n    return formatted_title\n", "entry_point": "format_title", "input": "'administration'", "output": "'Administration'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13677_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019440", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[92, 87, 85, 78, 85, 90, 84, 87]", "output": "[78, 84, 85, 85, 87, 87, 90, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019441", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[20, 25, 26]", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019442", "code": "def generate_password(email):\n    # Extract domain name from email\n    domain = email.split('@')[-1]\n    # Reverse the domain name\n    reversed_domain = domain[::-1]\n    # Combine reversed domain with \"SecurePW\" to generate password\n    password = reversed_domain + \"SecurePW\"\n    return password\n", "entry_point": "generate_password", "input": "'user@example.com'", "output": "'moc.elpmaxeSecurePW'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104790_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019443", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[1, 1, 1, 2, 2, 3]", "output": "{1: 3, 2: 2, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019444", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'1 2 +'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019445", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'1.2.31'", "output": "(1, 2, 31)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019446", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "87", "output": "{1, 3, 29, 87}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt86", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019447", "code": "def process_numbers(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num * 5)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "process_numbers", "input": "[2, 9, 6, 3, 10, 1]", "output": "[4, 729, 30, 27, 100, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146375_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019448", "code": "import string\ndef count_word_frequency(file_content):\n    word_freq = {}\n    text = file_content.lower()\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'ifaiif'", "output": "{'ifaiif': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3322_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019449", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'pretixbase', 'PRETIXBASE'", "output": "'pretixbasePRETIXBASE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019450", "code": "def process_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        if i < list_length - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 1, 3, 1, 3, 2, 1, 1]", "output": "[2, 4, 4, 4, 5, 3, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63579_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019451", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[9, 10, 9]", "output": "[9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt74", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019452", "code": "import urllib.request\ndef get_status_codes(urls):\n    status_codes = {}\n    opener = urllib.request.build_opener(urllib.request.HTTPHandler)\n    for url in urls:\n        try:\n            request = urllib.request.Request(url)\n            request.get_method = lambda: 'GET'\n            response = opener.open(request)\n            status_codes[url] = response.getcode()\n        except Exception as e:\n            status_codes[url] = f\"Error: {str(e)}\"\n    return status_codes\n", "entry_point": "get_status_codes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57197_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019453", "code": "def process_values(x, y, raw_z):\n    z = None\n    if y > 145 and y <= 166 and x <= 18:\n        y = 145\n        x = 5\n    raw_z_int = int(raw_z)\n    if raw_z_int < 70:\n        z = 3\n    elif 70 <= raw_z_int <= 80:\n        z = 4\n    else:\n        z = 5\n    if 51 <= y <= 185 and 0 <= x <= 87:\n        return {'x': x, 'y': y, 'z': z}\n    return None\n", "entry_point": "process_values", "input": "7, 167, 85", "output": "{'x': 7, 'y': 167, 'z': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64164_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019454", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'  Candidate! '", "output": "['candidate']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019455", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[0, 9, -6, 0, 6, -1, 0, 15, 7]", "output": "[9, -15, 6, 6, -7, 1, 15, -8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019456", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max\n", "entry_point": "find_second_largest", "input": "[15, 12, 10, 8]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84134_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019457", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'illumina', 'sample_illumina.reads.fa'", "output": "'sample_illumina_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019458", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'aa_a_'", "output": "'aa_a_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "375", "output": "{1, 3, 5, 75, 15, 375, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019460", "code": "def calculate_field_lengths(order_by_list):\n    valid_order_by = [\n        'group__name', 'message_count', 'thread_count', 'reply_count',\n        'posters', 'flagged', 'category', 'state', 'member_count',\n        'owner_count', 'created_at', 'created_by', 'image_count',\n        'image_clicks', 'link_count', 'link_clicks', 'private', 'published',\n        'moderated', 'featured', 'member_list_published'\n    ]\n    field_lengths = {}\n    for field in reversed(order_by_list):\n        if field in valid_order_by:\n            field_lengths[field] = len(field)\n    return field_lengths\n", "entry_point": "calculate_field_lengths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121599_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019461", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[1, 3, 3, 4, 4, 6]", "output": "[1.41, 4.24, 4.24, 5.66, 5.66, 8.49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019462", "code": "def calculate_score(points):\n    if points == 0:\n        score = 10\n    elif points < 7:\n        score = 7\n    elif points < 14:\n        score = 4\n    elif points < 18:\n        score = 1\n    elif points < 28:\n        score = 0\n    elif points < 35:\n        score = -3\n    else:\n        score = -4\n    return score\n", "entry_point": "calculate_score", "input": "30", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119346_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019463", "code": "def simulate_card_game(deck_a, deck_b):\n    score_a = 0\n    score_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    return score_a, score_b\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7, 8, 9, 10, 2], [1, 2, 3, 4, 5, 5, 3]", "output": "(6, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31115_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019464", "code": "def calculate_average(nums: list) -> float:\n    if len(nums) <= 1:\n        return 0\n    min_val = min(nums)\n    max_val = max(nums)\n    remaining_nums = [num for num in nums if num != min_val and num != max_val]\n    if not remaining_nums:\n        return 0\n    return sum(remaining_nums) / len(remaining_nums)\n", "entry_point": "calculate_average", "input": "[2, 4, 6]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144900_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019465", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019466", "code": "def max_non_overlapping_circles(radii):\n    radii.sort()\n    count = 0\n    max_radius = float('-inf')\n    for radius in radii:\n        if radius >= max_radius:\n            count += 1\n            max_radius = radius * 2\n    return count\n", "entry_point": "max_non_overlapping_circles", "input": "[1, 2, 4, 8]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114287_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019467", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1816", "output": "{1, 2, 227, 4, 454, 8, 908, 1816}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1815", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019468", "code": "import math\ndef calculate_disk_radius(solid_angle, distance):\n    # Calculate disk radius using the formula: radius = sqrt(solid_angle * distance^2)\n    radius = math.sqrt(solid_angle * distance**2)\n    return radius\n", "entry_point": "calculate_disk_radius", "input": "1.8225, 10", "output": "13.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28379_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019469", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'aaabbcc123'", "output": "{'a': 3, 'b': 2, 'c': 2, '1': 1, '2': 1, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019470", "code": "from collections import defaultdict\ndef organize_dependencies(dependencies):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    for dependency, _ in dependencies:\n        in_degree[dependency] = 0\n    for i in range(1, len(dependencies)):\n        if dependencies[i][0] != dependencies[i-1][0]:\n            graph[dependencies[i-1][0]].append(dependencies[i][0])\n            in_degree[dependencies[i][0]] += 1\n    queue = [dependency for dependency in in_degree if in_degree[dependency] == 0]\n    result = []\n    while queue:\n        current = queue.pop(0)\n        result.append(current)\n        for neighbor in graph[current]:\n            in_degree[neighbor] -= 1\n            if in_degree[neighbor] == 0:\n                queue.append(neighbor)\n    return result\n", "entry_point": "organize_dependencies", "input": "[('a', None), ('c', None), ('e', None)]", "output": "['a', 'c', 'e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25215_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019471", "code": "def gameOutcome(button_states: tuple[bool, bool, bool]) -> str:\n    if all(button_states):\n        return \"Win\"\n    elif button_states.count(False) == 1:\n        return \"Neutral\"\n    else:\n        return \"Lose\"\n", "entry_point": "gameOutcome", "input": "(False, False, False)", "output": "'Lose'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136357_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019472", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "14", "output": "1015", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019473", "code": "def process_blog_data(blog_data):\n    blog_title = blog_data.get('title', '')\n    blog_content = blog_data.get('content', '')\n    formatted_comments = []\n    for comment in blog_data.get('comments', []):\n        user = comment.get('user', '')\n        text = comment.get('text', '')\n        formatted_comments.append(f\"{user}: {text}\")\n    formatted_output = f\"Blog Title: {blog_title}\\nContent: {blog_content}\\nComments:\\n\"\n    formatted_output += \"\\n\".join(formatted_comments)\n    return formatted_output\n", "entry_point": "process_blog_data", "input": "{}", "output": "'Blog Title: \\nContent: \\nComments:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52571_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019474", "code": "# Given enumeration of supported targets\nCPUS = {\n  'i686': [],\n  'amd64': ['generic', 'zen2', 'skylake', 'tremont'],\n  'arm64': ['cortex-a72'],\n  'riscv': ['sifive-u74'],\n  'power': ['pwr8', 'pwr9']\n}\ndef get_supported_cpu_models(architecture):\n    if architecture in CPUS:\n        return CPUS[architecture]\n    else:\n        return f\"No supported CPU models found for architecture '{architecture}'.\"\n", "entry_point": "get_supported_cpu_models", "input": "'amd64'", "output": "['generic', 'zen2', 'skylake', 'tremont']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57656_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019475", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# Hoe**bold**ll'", "output": "'Hoe**bold**ll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019476", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[3, 2, 2, 3, 4, 2, 4]", "output": "[9, 4, 4, 9, 8, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7101", "output": "{1, 3, 263, 9, 789, 27, 7101, 2367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019478", "code": "def find_version_conflicts(requires):\n    conflicts = {}\n    for requirement in requires:\n        package, version = requirement.split('==')\n        if package in conflicts:\n            if version not in conflicts[package]:\n                conflicts[package].append(version)\n        else:\n            conflicts[package] = [version]\n    conflicting_versions = {package: versions for package, versions in conflicts.items() if len(versions) > 1}\n    return conflicting_versions\n", "entry_point": "find_version_conflicts", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40393_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019479", "code": "def remove_duplicates(input_string):\n    if not input_string:\n        return \"\"\n    result = input_string[0]  # Initialize result with the first character\n    for i in range(1, len(input_string)):\n        if input_string[i] != input_string[i - 1]:\n            result += input_string[i]\n    return result\n", "entry_point": "remove_duplicates", "input": "'hello'", "output": "'helo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5338_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019480", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "29, 13", "output": "(2.230769230769231, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019481", "code": "def total_points(test_cases):\n    total = 0\n    for test_case in test_cases:\n        total += test_case['points']\n    return total\n", "entry_point": "total_points", "input": "[{'points': 7}]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148658_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019482", "code": "def calculate_total_loss(loss_values):\n    total_loss = 0\n    for loss in loss_values:\n        total_loss += loss\n    return total_loss\n", "entry_point": "calculate_total_loss", "input": "[10.0, 10.0, 10.0, 0.47]", "output": "30.47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134745_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019483", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'nanopore', 'sample_pacbsa.eads.reads.fa'", "output": "'sample_pacbsa.eads_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019484", "code": "def truncatechars(value, arg):\n    try:\n        length = int(arg)\n    except ValueError:\n        return value  # Return original value if arg is not a valid integer\n    if len(value) > length:\n        return value[:length] + '...'  # Truncate and append '...' if length exceeds arg\n    return value  # Return original value if length is not greater than arg\n", "entry_point": "truncatechars", "input": "'l123!5678!', 12", "output": "'l123!5678!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15483_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019485", "code": "def colorize_log_message(message, log_level):\n    RESET_SEQ = \"\\033[0m\"\n    COLOR_SEQ = \"\\033[1;%dm\"\n    COL = {\n        'DEBUG': 34, 'INFO': 35,\n        'WARNING': 33, 'CRITICAL': 33, 'ERROR': 31\n    }\n    color_code = COL.get(log_level, 37)  # Default to white if log_level not found\n    colored_message = COLOR_SEQ % color_code + message + RESET_SEQ\n    return colored_message\n", "entry_point": "colorize_log_message", "input": "'as', 'UNKNOWN_LOG_LEVEL'", "output": "'\\x1b[1;37mas\\x1b[0m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1938_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019486", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[5, 5, 5, 2, 3, 4]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019487", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[2, 3, 3, 3, 7, 7, 7, 8]", "output": "[4, 9, 9, 9, 16, 49, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019488", "code": "def process_object(object_name: str, object_category: str) -> tuple:\n    source_value = None\n    endpoint_url = None\n    if object_category == \"data_source\":\n        source_value = \"ds_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/ds_smart_status\"\n        object_category = \"data_name\"\n    elif object_category == \"data_host\":\n        source_value = \"dh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/dh_smart_status\"\n    elif object_category == \"metric_host\":\n        source_value = \"mh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/mh_smart_status\"\n    body = \"{'\" + object_category + \"': '\" + object_name + \"'}\"\n    return source_value, endpoint_url, body\n", "entry_point": "process_object", "input": "'bob', 'dddsasdadh'", "output": "(None, None, \"{'dddsasdadh': 'bob'}\")", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133706_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019489", "code": "def calculate_average_clouds_per_hour(clouds_per_hour, hours_observed):\n    total_clouds = sum(clouds_per_hour)\n    total_hours = len(hours_observed)\n    average_clouds_per_hour = total_clouds / total_hours\n    return average_clouds_per_hour\n", "entry_point": "calculate_average_clouds_per_hour", "input": "[10, 11, 11, 10, 11, 12], [0, 1, 2, 3, 4, 5]", "output": "10.833333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42405_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019490", "code": "import binascii\nimport string\ndef single_byte_xor_decrypt(hex_str):\n    bytes_data = binascii.unhexlify(hex_str)\n    max_score = 0\n    decrypted_message = \"\"\n    for key in range(256):\n        decrypted = ''.join([chr(byte ^ key) for byte in bytes_data])\n        score = sum([decrypted.count(char) for char in string.ascii_letters])\n        if score > max_score:\n            max_score = score\n            decrypted_message = decrypted\n    return decrypted_message\n", "entry_point": "single_byte_xor_decrypt", "input": "'76'", "output": "'v'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68268_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019491", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "533", "output": "{1, 13, 533, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019492", "code": "def total_cost(nums, A, B):\n    if B == 0:\n        return float(A)\n    k_m = 2 * A / B\n    count = 0\n    j_s = [nums[0]]\n    for i in range(1, len(nums)):\n        if nums[i] - nums[i - 1] <= k_m:\n            j_s.append(nums[i])\n        else:\n            count += A + (j_s[-1] - j_s[0]) / 2 * B\n            j_s = [nums[i]]\n    count += A + (j_s[-1] - j_s[0]) / 2 * B\n    return float(count)\n", "entry_point": "total_cost", "input": "[], 60.0, 0", "output": "60.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101200_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1649", "output": "{1, 97, 17, 1649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019494", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "54, [59]", "output": "295", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019495", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'DZZAAST'", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019496", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    i = 1\n    while i < len(nums):\n        if nums[i-1] == nums[i]:\n            nums.pop(i)\n            continue\n        i += 1\n    return len(nums)\n", "entry_point": "remove_duplicates", "input": "[1, 2, 2, 3, 4, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119722_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019497", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6614", "output": "{1, 2, 3307, 6614}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019498", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[10, [5, 4], 10]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5141", "output": "{1, 53, 5141, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019500", "code": "def transpose_matrix(l_2d):\n    transposed_matrix = []\n    for column in zip(*l_2d):\n        transposed_matrix.append(list(column))\n    return transposed_matrix\n", "entry_point": "transpose_matrix", "input": "[[0, 3], [1, 4], [2, 5]]", "output": "[[0, 1, 2], [3, 4, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136545_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019501", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[2, 5, 4, 6, 6, 1, 0, 5, 6, -1]", "output": "[2, 7, 11, 17, 23, 24, 24, 29, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019502", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'aaaabbbca'", "output": "'a4b3c1a1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019503", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'abcd1234'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019504", "code": "def count_unique_subsets(nums):\n    total_subsets = 0\n    n = len(nums)\n    for i in range(1, 2**n):\n        subset = [nums[j] for j in range(n) if (i >> j) & 1]\n        if subset:  # Ensure subset is not empty\n            total_subsets += 1\n    return total_subsets\n", "entry_point": "count_unique_subsets", "input": "[1, 2, 3]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53823_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019505", "code": "def parse_instruction(instruction: str) -> str:\n    # Split the instruction into destination and source operands\n    operands = instruction.split(',')\n    # Format the destination and source operands\n    dest = operands[0].strip()\n    source = operands[1].strip()\n    # Format memory operand by removing unnecessary spaces\n    source = source.replace(' ', '')\n    # Return the formatted instruction\n    return f\"add {dest}, {source}\"\n", "entry_point": "parse_instruction", "input": "'add rax, r8'", "output": "'add add rax, r8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6128_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019506", "code": "import json\ndef get_setting_value(settings, key, default):\n    if key in settings:\n        if settings[key] is not None and len(str(settings[key])) > 0:\n            ret = settings[key]\n        else:\n            ret = default\n    else:\n        ret = default\n    try:\n        json.dumps(dict(k=ret))\n    except UnicodeDecodeError:\n        ret = default\n    return ret\n", "entry_point": "get_setting_value", "input": "{}, 'some_key', 'defauelt'", "output": "'defauelt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139666_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019507", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'scsrape'", "output": "['scsrape']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019508", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[3, 3, 3, 2, 1, 1, 2, 1]", "output": "[3, 6, 9, 11, 12, 13, 15, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019509", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7467", "output": "{1, 3, 131, 393, 7467, 19, 2489, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019510", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "1, 13", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2330", "output": "{1, 2, 5, 233, 10, 1165, 466, 2330}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2329", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019512", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 2, 4, 6, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019513", "code": "def min_changes_to_anagram(bigger_str, smaller_str):\n    str_counter = {}\n    for char in bigger_str:\n        if char in str_counter:\n            str_counter[char] += 1\n        else:\n            str_counter[char] = 1\n    for char in smaller_str:\n        if char in str_counter:\n            str_counter[char] -= 1\n    needed_changes = 0\n    for counter in str_counter.values():\n        needed_changes += abs(counter)\n    return needed_changes\n", "entry_point": "min_changes_to_anagram", "input": "'abcde', 'abcd'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124427_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019514", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "1", "output": "{'int': '1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019515", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "total_size_in_kb", "input": "[11264]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33137_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3459", "output": "{3, 1, 1153, 3459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019517", "code": "from typing import List\ndef change(amount: int, coins: List[int]) -> int:\n    dp = [0] * (amount + 1)\n    dp[0] = 1\n    for coin in coins:\n        for i in range(coin, amount + 1):\n            dp[i] += dp[i - coin]\n    return dp[amount]\n", "entry_point": "change", "input": "10, [1, 2, 5]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71745_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019518", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "11", "output": "[0, 0, 1, 3, 6, 2, 7, 13, 20, 12, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019519", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'KTh'", "output": "'KTh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019520", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5825", "output": "{1, 5825, 5, 233, 1165, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019521", "code": "def count_common_substrings(s1, s2):\n    g1 = {}\n    for i in range(1, len(s1)):\n        g1[s1[i-1: i+1]] = g1.get(s1[i-1: i+1], 0) + 1\n    g2 = set()\n    for i in range(1, len(s2)):\n        g2.add(s2[i-1: i+1])\n    common_substrings = frozenset(g1.keys()) & g2\n    total_count = sum([g1[g] for g in common_substrings])\n    return total_count\n", "entry_point": "count_common_substrings", "input": "'abc', 'ab'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53680_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019522", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'1.0'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019523", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[('Level 1', 20), ('Level 2', 30), ('Level 3', 40), ('Level 4', 50)]", "output": "140", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019524", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1467", "output": "{1, 3, 163, 489, 9, 1467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019525", "code": "def jaccard_similarity_coefficient(x, y):\n    set_x = set(x)\n    set_y = set(y)\n    intersection_size = len(set_x.intersection(set_y))\n    union_size = len(set_x.union(set_y))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    return intersection_size / union_size\n", "entry_point": "jaccard_similarity_coefficient", "input": "[1, 2, 3, 4, 5], [2, 3, 6, 7]", "output": "0.2857142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77613_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019526", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'1.10.5.2'", "output": "(1, 10, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019527", "code": "import collections\npossible_show = {\n    'available': None,\n    'chat': 'chat',\n    'away': 'away',\n    'afk': 'away',\n    'dnd': 'dnd',\n    'busy': 'dnd',\n    'xa': 'xa'\n}\ndef process_status_message(status_message):\n    status, _, message = status_message.partition(':')\n    show = possible_show.get(status, 'available')\n    processed_message = message.strip() if message else ''\n    return show, processed_message\n", "entry_point": "process_status_message", "input": "'dnd: Do not disturb'", "output": "('dnd', 'Do not disturb')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35967_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019528", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[circular_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 1, 0, 4, 3, 2, 3, 1, 3]", "output": "[5, 1, 4, 7, 5, 5, 4, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51677_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3786", "output": "{1, 2, 3, 1893, 6, 3786, 1262, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019530", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'Mddemia', 7, '18100101'", "output": "'Mddemia - 07 [18100101].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019531", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1105", "output": "{1, 65, 5, 13, 1105, 17, 85, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1104", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019532", "code": "import logging\ndef process_serial_data(data_str):\n    logging.info(\"Initializing data processing\")\n    data_dict = {}\n    pairs = data_str.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        data_dict[key] = value\n    return data_dict\n", "entry_point": "process_serial_data", "input": "'ekkey1:value1,key2:vlukke3'", "output": "{'ekkey1': 'value1', 'key2': 'vlukke3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86728_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019533", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[-4, 1, 2, 3, 4]", "output": "-16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019534", "code": "def check_distance_exceeds_radius(coord1, coord2, radius):\n    (_X, _Y, _RGB) = (0, 1, 2)\n    distance_squared = (coord1[_X] - coord2[_X]) ** 2 + (coord1[_Y] - coord2[_Y]) ** 2\n    return distance_squared > radius ** 2\n", "entry_point": "check_distance_exceeds_radius", "input": "(0, 0, 255), (1, 1, 255), 2", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83990_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019535", "code": "import json\ndef on_message(message):\n    data = json.loads(message)\n    received_message = data.get('message', '')\n    print(f\"Received message: {received_message}\")\n    response_message = {\n        'message': f\"{received_message} - Received\"\n    }\n    return json.dumps(response_message)\n", "entry_point": "on_message", "input": "'{\"message\": \"123456\"}'", "output": "'{\"message\": \"123456 - Received\"}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99590_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019536", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[2, 2, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019537", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'ccvv'", "output": "'Ccvv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019538", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[0, 3, 1, 2, 4, 4, 5, 3, 99]", "output": "[3, 1, 2, 4, 4, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019539", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 1, 2, 0, 2, 0, 4, 2]", "output": "[5, 3, 2, 2, 2, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019540", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019541", "code": "def calculate_max_voltage(gain):\n    if gain == 1:\n        max_VOLT = 4.096\n    elif gain == 2:\n        max_VOLT = 2.048\n    elif gain == 4:\n        max_VOLT = 1.024\n    elif gain == 8:\n        max_VOLT = 0.512\n    elif gain == 16:\n        max_VOLT = 0.256\n    else:  # gain == 2/3\n        max_VOLT = 6.144\n    return max_VOLT\n", "entry_point": "calculate_max_voltage", "input": "2", "output": "2.048", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119884_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019542", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[20, 23]", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019543", "code": "from typing import List\ndef find_non_unique_machine_ids(machine_ids: List[str]) -> List[str]:\n    id_counts = {}\n    # Count occurrences of each machine ID\n    for machine_id in machine_ids:\n        id_counts[machine_id] = id_counts.get(machine_id, 0) + 1\n    # Filter out non-unique machine IDs\n    non_unique_ids = [id for id, count in id_counts.items() if count > 1]\n    return non_unique_ids\n", "entry_point": "find_non_unique_machine_ids", "input": "['abc123', 'abc123', 'def456', 'def456']", "output": "['abc123', 'def456']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102400_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019544", "code": "def calculate_reward(piece_past_movements, rewards=None):\n    rewards = rewards or {1: 0.8, 2: 0.9, 3: 1, 4: 0.9, 5: 0.5, 6: 0.25}\n    n_skips = 0\n    for movement in piece_past_movements:\n        if abs(movement) > 1:\n            n_skips += 1\n    score = rewards.get(n_skips, 0)\n    return score\n", "entry_point": "calculate_reward", "input": "[2, -3, 4, -5, 1.5, -2.5]", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67309_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019545", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "20, 4.75", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019546", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'07:07:00 AM'", "output": "'07:07:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019547", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[6, 5, 22, 3, 5, 5, 30], 1", "output": "[[6], [5], [22], [3], [5], [5], [30]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019548", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[5, 10, 20, 5, 10], 10", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019549", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6779", "output": "{1, 6779}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019550", "code": "def build_manual_similarity_map(data):\n    similarity_map = {}\n    for i in range(1, len(data)):\n        topic = data[0][i-1]\n        services = data[i]\n        if topic not in similarity_map:\n            similarity_map[topic] = []\n        similarity_map[topic].extend(services)\n    return similarity_map\n", "entry_point": "build_manual_similarity_map", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7748_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019551", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[1, 2], [3, [4]]]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019552", "code": "def extract_info_from_setup(setup_dict):\n    package_name = setup_dict.get('name', '')\n    version = setup_dict.get('version', '')\n    description = setup_dict.get('description', '')\n    author = setup_dict.get('author', '')\n    return package_name, version, description, author\n", "entry_point": "extract_info_from_setup", "input": "{}", "output": "('', '', '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4141_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7149", "output": "{1, 3, 7149, 2383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019554", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "796.0375, 2", "output": "796.0125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019555", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[], 3", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89007_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019556", "code": "def find_peak_hours(data):\n    max_value = float('-inf')\n    peak_hours = []\n    for i in range(len(data)):\n        if data[i] > max_value:\n            max_value = data[i]\n            peak_hours = [i]\n        elif data[i] == max_value:\n            peak_hours.append(i)\n    return peak_hours\n", "entry_point": "find_peak_hours", "input": "[5, 6, 7, 8, 9, 9, 9, 10]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54683_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019557", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'Ho! Hell?'", "output": "{'ho': 1, 'hell': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019558", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[1, 1], 2", "output": "{(1, 1)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019559", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "940", "output": "{1, 2, 4, 5, 10, 235, 940, 47, 20, 470, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt939", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019560", "code": "def count_patches(voxel_data):\n    def dfs(x, y, z, value):\n        if (x, y, z) in visited or not (0 <= x < len(voxel_data) and 0 <= y < len(voxel_data[0]) and 0 <= z < len(voxel_data[0][0])):\n            return\n        if voxel_data[x][y][z] != value:\n            return\n        visited.add((x, y, z))\n        for dx, dy, dz in [(1, 0, 0), (-1, 0, 0), (0, 1, 0), (0, -1, 0), (0, 0, 1), (0, 0, -1)]:\n            dfs(x + dx, y + dy, z + dz, value)\n    visited = set()\n    patch_count = 0\n    for x in range(len(voxel_data)):\n        for y in range(len(voxel_data[0])):\n            for z in range(len(voxel_data[0][0])):\n                if (x, y, z) not in visited:\n                    patch_count += 1\n                    dfs(x, y, z, voxel_data[x][y][z])\n    return patch_count\n", "entry_point": "count_patches", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61826_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7324", "output": "{1, 2, 4, 1831, 3662, 7324}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7323", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019562", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[80, 85, 85, 85, 84], 4", "output": "84.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019563", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 2, 2, 1, 4, 4, 1, 4]", "output": "[5, 4, 3, 5, 8, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019564", "code": "def longest_substring_within_budget(s, costs, budget):\n    start = 0\n    end = 0\n    current_cost = 0\n    max_length = 0\n    n = len(s)\n    while end < n:\n        current_cost += costs[ord(s[end]) - ord('a')]\n        while current_cost > budget:\n            current_cost -= costs[ord(s[start]) - ord('a')]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_substring_within_budget", "input": "'abcd', [1] * 26, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17714_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019565", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[50, 45, 42, 40, 40]", "output": "43.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019566", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "83.0, 0", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1615", "output": "{1, 323, 5, 1615, 17, 19, 85, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1614", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019568", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'PPlease edit'", "output": "'PPlease edit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019569", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019570", "code": "from itertools import combinations\ndef find_largest_triangle_area(points):\n    def triangle_area(x1, y1, x2, y2, x3, y3):\n        return abs(x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2) / 2\n    max_area = 0\n    for (x1, y1), (x2, y2), (x3, y3) in combinations(points, 3):\n        area = triangle_area(x1, y1, x2, y2, x3, y3)\n        max_area = max(max_area, area)\n    return max_area\n", "entry_point": "find_largest_triangle_area", "input": "[(0, 0), (2, 0), (1, 1)]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93237_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019571", "code": "def remove_vowels(string):\n    result = ''\n    for char in string:\n        if char not in 'aeiouAEIOU':\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'WellW,'", "output": "'WllW,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87966_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019572", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9946", "output": "{1, 9946, 2, 4973}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019573", "code": "def normalize_scores(scores):\n    # Find the minimum and maximum scores in the input list\n    min_score = min(scores)\n    max_score = max(scores)\n    # Normalize each score using the formula (score - min_score) / (max_score - min_score)\n    normalized_scores = [(score - min_score) / (max_score - min_score) for score in scores]\n    return normalized_scores\n", "entry_point": "normalize_scores", "input": "[0, 0, 0, 1, 32, 0, 0, 32]", "output": "[0.0, 0.0, 0.0, 0.03125, 1.0, 0.0, 0.0, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40897_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019574", "code": "def extract_top_module(module_path: str) -> str:\n    # Split the module_path string by dots\n    modules = module_path.split('.')\n    # Return the top-level module name\n    return modules[0]\n", "entry_point": "extract_top_module", "input": "'sentry'", "output": "'sentry'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40470_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "155", "output": "{1, 155, 5, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019576", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[21, 21, 21]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019577", "code": "_DEFAULT_CONFIG = {\n    'LITHOPS_CONFIG': {},\n    'STREAM_STDOUT': False,\n    'REDIS_EXPIRY_TIME': 300,\n    'REDIS_CONNECTION_TYPE': 'pubsubconn'\n}\n_config = _DEFAULT_CONFIG\ndef get_config_value(key):\n    return _config.get(key)\n", "entry_point": "get_config_value", "input": "'REDIS_EXPIRY_TIME'", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59658_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019578", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'11 * 3'", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019579", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'2010:615:10'", "output": "7272910", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019580", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5801", "output": "{1, 5801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019581", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2241", "output": "{1, 2241, 3, 9, 747, 83, 249, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019582", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'hello wehel'", "output": "'HeLlO WeHeL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019583", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "3", "output": "'FAN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019584", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "51534545345", "output": "'VCode-51534545345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019585", "code": "def max_consecutive_elements(lst):\n    if not lst:\n        return 0\n    max_count = 0\n    current_count = 1\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1]:\n            current_count += 1\n        else:\n            max_count = max(max_count, current_count)\n            current_count = 1\n    max_count = max(max_count, current_count)\n    return max_count\n", "entry_point": "max_consecutive_elements", "input": "[1, 1, 1, 2, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27992_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019586", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[3, 6, 3]", "output": "[3, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019587", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'the quick brown fox jumps jsumps'", "output": "['jsumps']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019588", "code": "from typing import List\ndef smallestRangeDifference(A: List[int], K: int) -> int:\n    A.sort()\n    ans = A[-1] - A[0]\n    for x, y in zip(A, A[1:]):\n        ans = min(ans, max(A[-1]-K, x+K) - min(A[0]+K, y-K))\n    return ans\n", "entry_point": "smallestRangeDifference", "input": "[1, 5], 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93507_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019589", "code": "from typing import List, Dict, Union\ndef count_unique_items(items: List[Union[str, int, float]]) -> Dict[Union[str, int, float], int]:\n    unique_items_count = {}\n    for item in items:\n        if isinstance(item, (str, int, float)):\n            unique_items_count[item] = unique_items_count.get(item, 0) + 1\n    return unique_items_count\n", "entry_point": "count_unique_items", "input": "[3, 3, 3, 3, 2, 2, 2, 2, 3.5]", "output": "{3: 4, 2: 4, 3.5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129093_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1486", "output": "{1, 2, 1486, 743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1485", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019591", "code": "def reverse_and_uppercase(string):\n    reversed_uppercase = string[::-1].upper()\n    return reversed_uppercase\n", "entry_point": "reverse_and_uppercase", "input": "'HEHEHHLH'", "output": "'HLHHEHEH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45524_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019592", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('W', 10.0)]", "output": "-10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019593", "code": "import math\ndef calculate_gaussian_coefficients(ndim):\n    p_i = math.pi\n    coefficients = 1 / (math.sqrt(2 * p_i) ** ndim)\n    return coefficients\n", "entry_point": "calculate_gaussian_coefficients", "input": "50", "output": "1.1104609502816172e-20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134730_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7355", "output": "{1, 7355, 5, 1471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019595", "code": "def construct_mapping(Gvs, f):\n    Hvs = []  # Placeholder for vertices or nodes of graph H\n    gf = {}\n    for v in range(len(f)):\n        fv = f[v]\n        if fv >= 0:\n            gf[Gvs[v]] = Hvs[fv] if Hvs else None\n        else:\n            gf[Gvs[v]] = None\n    return gf\n", "entry_point": "construct_mapping", "input": "[1, 2, 3, 4], [-1, -1, -1, -1]", "output": "{1: None, 2: None, 3: None, 4: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98043_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019596", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[90, 100, 70, 50, 50, 90, 70, 90]", "output": "[2, 1, 5, 7, 7, 2, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019597", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'15.12.2023'", "output": "'15.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2029", "output": "{1, 2029}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2028", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019599", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[-1, 5, 1]", "output": "[4, 6, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019600", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6055", "output": "{1, 865, 35, 5, 7, 6055, 173, 1211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2282", "output": "{1, 2, 163, 326, 7, 2282, 14, 1141}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019602", "code": "def calculate_distances(S1, S2):\n    map = {}\n    initial = 0\n    distance = []\n    for i in range(26):\n        map[S1[i]] = i\n    for i in S2:\n        distance.append(abs(map[i] - initial))\n        initial = map[i]\n    return distance\n", "entry_point": "calculate_distances", "input": "'abcdefghijklmnopqrstuvwxyz', 'f'", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35345_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019603", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'admin_Listl'", "output": "'listl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "282", "output": "{1, 2, 3, 6, 141, 47, 282, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019605", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "'UDLR'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3242", "output": "{1, 3242, 2, 1621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3241", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019607", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5457", "output": "{1, 321, 3, 107, 5457, 17, 51, 1819}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019608", "code": "def generate_code_snippets(operator_names):\n    unary_operator_codes = {\n        \"UAdd\": (\"PyNumber_Positive\", 1),\n        \"USub\": (\"PyNumber_Negative\", 1),\n        \"Invert\": (\"PyNumber_Invert\", 1),\n        \"Repr\": (\"PyObject_Repr\", 1),\n        \"Not\": (\"UNARY_NOT\", 0),\n    }\n    rich_comparison_codes = {\n        \"Lt\": \"LT\",\n        \"LtE\": \"LE\",\n        \"Eq\": \"EQ\",\n        \"NotEq\": \"NE\",\n        \"Gt\": \"GT\",\n        \"GtE\": \"GE\",\n    }\n    output_snippets = []\n    for operator_name in operator_names:\n        if operator_name in unary_operator_codes:\n            output_snippets.append(unary_operator_codes[operator_name][0])\n        elif operator_name in rich_comparison_codes:\n            output_snippets.append(rich_comparison_codes[operator_name])\n    return output_snippets\n", "entry_point": "generate_code_snippets", "input": "['Eq', 'Not', 'Eq', 'Eq']", "output": "['EQ', 'UNARY_NOT', 'EQ', 'EQ']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_547_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019609", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "300, 2", "output": "298", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019610", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'dievici:'", "output": "{'dievici': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019611", "code": "def calculate_total_seconds(duration):\n    # Split the duration string into hours, minutes, and seconds\n    hours, minutes, seconds = map(int, duration.split(':'))\n    # Calculate the total number of seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "calculate_total_seconds", "input": "'501:23:00'", "output": "1804980", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40922_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019612", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "6", "output": "[0, 1, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019613", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[3, 0, 0, 0, 3, 3]", "output": "[0, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019614", "code": "def calculate_string_difference(str1, str2):\n    len1, len2 = len(str1), len(str2)\n    max_len = max(len1, len2)\n    diff_count = 0\n    for i in range(max_len):\n        char1 = str1[i] if i < len1 else None\n        char2 = str2[i] if i < len2 else None\n        if char1 != char2:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_string_difference", "input": "'abc', 'defghijklmnop'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32682_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019615", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6775", "output": "{1, 5, 1355, 271, 6775, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6774", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019616", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'mus_icbg'", "output": "'Mus Icbg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019617", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'1.0.1.dev0'", "output": "'1.0.1.dev1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019618", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'313.133.5.1.0.33'", "output": "'313.133.5.1.0.33'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019619", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'33.113'", "output": "(33, 113)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019620", "code": "def get_framework_abbreviation(framework_name):\n    frameworks = {\n        'pytorch': 'PT',\n        'tensorflow': 'TF',\n        'keras': 'KS',\n        'caffe': 'CF'\n    }\n    lowercase_framework = framework_name.lower()\n    if lowercase_framework in frameworks:\n        return frameworks[lowercase_framework]\n    else:\n        return 'Unknown'\n", "entry_point": "get_framework_abbreviation", "input": "'keras'", "output": "'KS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019621", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'P24'", "output": "383", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019622", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[4, 3, -2, 1, 1, 2, 2]", "output": "[4, 3, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019623", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num + 2)\n        elif num % 2 != 0:\n            processed_nums.append(num * 3)\n        if num % 5 == 0:\n            processed_nums[-1] -= 5\n    return processed_nums\n", "entry_point": "process_integers", "input": "[38, 14, 3, 13, 14, 2, 38, 14, 38]", "output": "[40, 16, 9, 39, 16, 4, 40, 16, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65994_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019624", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "123, {123: 2}", "output": "'123-3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3989", "output": "{1, 3989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6979", "output": "{1, 6979, 997, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019627", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "2, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019628", "code": "_validation = {\n    'id': {'readonly': True},\n    'name': {'readonly': True},\n    'type': {'readonly': True},\n    'location': {'required': True},\n    'kind': {'readonly': True},\n    'state': {'readonly': True},\n    'fully_qualified_domain_name': {'readonly': True},\n}\ndef validate_data(data):\n    for key, rules in _validation.items():\n        if key in data:\n            if 'readonly' in rules and rules['readonly'] and data[key] != _validation[key]:\n                return False\n            if 'required' in rules and rules['required'] and not data[key]:\n                return False\n        else:\n            if 'required' in rules and rules['required']:\n                return False\n    return True\n", "entry_point": "validate_data", "input": "{'id': '123', 'name': 'Item X'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019629", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[0, 0, 0, -1, -1, 1, 2, 2, 2]", "output": "{0: 3, -1: 2, 1: 1, 2: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019630", "code": "def calculate_higher_temperature_hours(tokyo_temps, berlin_temps):\n    if len(tokyo_temps) != len(berlin_temps):\n        raise ValueError(\"Tokyo and Berlin temperature lists must have the same length.\")\n    total_hours = 0\n    for tokyo_temp, berlin_temp in zip(tokyo_temps, berlin_temps):\n        if tokyo_temp > berlin_temp:\n            total_hours += 1\n    return total_hours\n", "entry_point": "calculate_higher_temperature_hours", "input": "[10, 15, 20], [15, 20, 25]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82446_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019631", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[3, 2, 4, 1, 4, 1, 4]", "output": "[3, 2, 4, 1, 4, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019632", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[[10, 8], [5, 3, 5, 0]]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019633", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_points = 0\n    player2_points = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_points += card1 + card2\n        elif card2 > card1:\n            player2_points += card1 + card2\n    return player1_points, player2_points\n", "entry_point": "simulate_card_game", "input": "[4, 5, 12], [7, 10, 9]", "output": "(21, 26)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41508_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9987", "output": "{3, 1, 9987, 3329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019635", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[90, 22, 35, 22, 35, 33, 35, 35]", "output": "[22, 22, 33, 35, 35, 35, 35, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019636", "code": "def get_action_sequence(logical_form):\n    action_sequences = {\n        \"(count (fb:cell.cell.date (date 2000 -1 -1)))\": 'd -> [<n,<n,<n,d>>>, n, n, n]',\n        \"(argmax (number 1) (number 1) (fb:row.row.division fb:cell.2) (reverse (lambda x ((reverse fb:row.row.index) (var x)))))\": 'r -> [<n,<n,<#1,<<#2,#1>,#1>>>>, n, n, r, <n,r>]',\n        \"(and (number 1) (number 1))\": 'n -> [<#1,<#1,#1>>, n, n]'\n    }\n    if logical_form in action_sequences:\n        return action_sequences[logical_form]\n    else:\n        return None\n", "entry_point": "get_action_sequence", "input": "'(and (number 1) (number 1))'", "output": "'n -> [<#1,<#1,#1>>, n, n]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19301_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9303", "output": "{1, 3, 7, 1329, 21, 9303, 443, 3101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019638", "code": "def calculate_winner(game):\n    team1, team2, score1, score2 = game.split('_')\n    if int(score1) > int(score2):\n        return team1\n    elif int(score1) < int(score2):\n        return team2\n    else:\n        return \"Draw\"\n", "entry_point": "calculate_winner", "input": "'TeamA_TeamB_5_3'", "output": "'TeamA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71038_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019639", "code": "def count_connected_components(edges):\n    adj_list = {}\n    def dfs(node):\n        visited.add(node)\n        for neighbor in adj_list.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n    for edge in edges:\n        u, v = edge\n        adj_list.setdefault(u, []).append(v)\n        adj_list.setdefault(v, []).append(u)\n    visited = set()\n    component_count = 0\n    for node in adj_list.keys():\n        if node not in visited:\n            dfs(node)\n            component_count += 1\n    return component_count\n", "entry_point": "count_connected_components", "input": "[(1, 2), (3, 4), (5, 6), (7, 8)]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104083_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019640", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[264], 1", "output": "264", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019641", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[0, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019642", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, 3, -1, -2, -3]", "output": "(3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019643", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "10, 12, 1", "output": "240", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019644", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[5.0, 8.0, 9.0, 11.0]", "output": "8.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019645", "code": "def format_likes(names):\n    if len(names) == 0:\n        return 'no one likes this'\n    elif len(names) == 1:\n        return names[0] + ' likes this'\n    elif len(names) == 2:\n        return names[0] + ' and ' + names[1] + ' like this'\n    elif len(names) == 3:\n        return names[0] + ', ' + names[1] + ' and ' + names[2] + ' like this'\n    else:\n        return names[0] + ', ' + names[1] + ' and '+ str(len(names)-2) + ' others like this'\n", "entry_point": "format_likes", "input": "['Alice', 'Bob', 'Charlie', 'David']", "output": "'Alice, Bob and 2 others like this'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81584_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019646", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019647", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[1, 2, 0, 6, 2, 2, 3, 1, 1]", "output": "[1, 2, 0, 6, 2, 2, 3, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019648", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019649", "code": "from typing import List\nimport math\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_bytes = sum(file_sizes)\n    total_kb = math.ceil(total_bytes / 1024)\n    return total_kb\n", "entry_point": "total_size_in_kb", "input": "[4096, 4097]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90092_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019650", "code": "def generate_install_paths(installer_path, package_names):\n    install_paths_dict = {}\n    for package_name in package_names:\n        full_install_path = installer_path + package_name\n        install_paths_dict[package_name] = full_install_path\n    return install_paths_dict\n", "entry_point": "generate_install_paths", "input": "'', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120862_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019651", "code": "def determine_cases(jac_case, hess_case, design_info):\n    if jac_case == \"skip\" and hess_case == \"skip\":\n        raise ValueError(\"Jacobian and Hessian cannot both be skipped.\")\n    cases = []\n    if jac_case == \"skip\":\n        cases.append(\"hessian\")\n    elif hess_case == \"skip\":\n        cases.append(\"jacobian\")\n    else:\n        cases.extend([\"jacobian\", \"hessian\", \"robust\"])\n        if design_info is not None:\n            if \"psu\" in design_info:\n                cases.append(\"cluster_robust\")\n            if {\"strata\", \"psu\", \"fpc\"}.issubset(design_info):\n                cases.append(\"strata_robust\")\n    return cases\n", "entry_point": "determine_cases", "input": "'active', 'active', None", "output": "['jacobian', 'hessian', 'robust']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7669_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019652", "code": "def calculate_average_score(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[85, 89.16666666666667, 93]", "output": "89.16666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101899_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2614", "output": "{1, 2, 1307, 2614}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019654", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "1.0, 2.0", "output": "6.283185307179586", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "554", "output": "{1, 554, 2, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt553", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019656", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "1, 7", "output": "[0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019657", "code": "import re\ndef count_words(text):\n    word_counts = {}\n    # Split the text into individual words\n    words = text.split()\n    for word in words:\n        # Remove punctuation marks and convert to lowercase\n        cleaned_word = re.sub(r'[^\\w\\s]', '', word).lower()\n        # Update word count in the dictionary\n        if cleaned_word in word_counts:\n            word_counts[cleaned_word] += 1\n        else:\n            word_counts[cleaned_word] = 1\n    return word_counts\n", "entry_point": "count_words", "input": "'helloaa'", "output": "{'helloaa': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123802_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9925", "output": "{1, 1985, 5, 9925, 397, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9924", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019659", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 1, 1, 3, 3, 2, 1, 3, 3]", "output": "[1, 2, 3, 6, 7, 7, 7, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019660", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[5, 6, 6], 3", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019661", "code": "from typing import List\ndef count_visible_buildings(buildings: List[int]) -> int:\n    visible_count = 0\n    max_height = 0\n    for height in buildings[::-1]:\n        if height > max_height:\n            visible_count += 1\n            max_height = height\n    return visible_count\n", "entry_point": "count_visible_buildings", "input": "[1, 2, 3, 2, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17783_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019662", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "'H'", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3284", "output": "{1, 2, 4, 1642, 3284, 821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3283", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019664", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[1, 3, 7, 5, 7, 5, 8, 7, 9]", "output": "[3, 7, 5, 7, 5, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019665", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@ejohn.dodcm'", "output": "'ejohn.dodcm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019666", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "''", "output": "'EuroPython'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019667", "code": "import re\ndef extract_domain_name(url):\n    # Extract domain part from the URL\n    domain = re.search(r'(?<=://)([^/]+)', url).group(0)\n    # Remove subdomains and paths to isolate the main domain\n    domain_parts = domain.split('.')\n    if len(domain_parts) > 2:\n        if domain_parts[-2] in ['co', 'com', 'org', 'net', 'edu']:\n            domain = domain_parts[-3]\n        else:\n            domain = domain_parts[-2]\n    return domain\n", "entry_point": "extract_domain_name", "input": "'http://sutp:'", "output": "'sutp:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144557_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019668", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4678", "output": "{1, 2, 2339, 4678}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019669", "code": "from itertools import product\ndef calculate_cartesian_product_sum(list1, list2):\n    # Generate all pairs of elements from list1 and list2\n    pairs = product(list1, list2)\n    # Calculate the sum of the products of all pairs\n    sum_of_products = sum(a * b for a, b in pairs)\n    return sum_of_products\n", "entry_point": "calculate_cartesian_product_sum", "input": "[], [1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129453_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019670", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[28, 27, 27, 27, 25, 25, 24, 20], 8", "output": "[28, 27, 27, 27, 25, 25, 24, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019671", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[84.0, 84.0, 84.0]", "output": "84.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5463_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019672", "code": "def parse_launches(input_str):\n    launches_dict = {}\n    launches_list = input_str.split(',')\n    for launch_pair in launches_list:\n        date, description = launch_pair.split(':')\n        launches_dict[date] = description\n    return launches_dict\n", "entry_point": "parse_launches", "input": "'20I2-022-04-25:Launnh'", "output": "{'20I2-022-04-25': 'Launnh'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64743_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019673", "code": "from typing import List\ndef find_majority_element(nums: List[int]) -> int:\n    votes = 0\n    candidate = None\n    for num in nums:\n        if votes == 0:\n            candidate = num\n        if num == candidate:\n            votes += 1\n        else:\n            votes -= 1\n    return candidate\n", "entry_point": "find_majority_element", "input": "[0, 0, 0, 1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90449_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019674", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'1..README0', '1.001'", "output": "{'1.001': '1..README0'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019675", "code": "def twoSum(nums, index, tar):\n    check = set([])\n    appear = set([])\n    result = []\n    for i in range(index, len(nums)):\n        if tar - nums[i] in check:\n            if (tar - nums[i], nums[i]) not in appear:\n                result.append([tar - nums[i], nums[i]])\n            appear.add((tar - nums[i], nums[i]))\n        check.add(nums[i])\n    return result\n", "entry_point": "twoSum", "input": "[2, 7], 0, 9", "output": "[[2, 7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80777_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019676", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average\n", "entry_point": "calculate_average", "input": "[70, 79, 80, 81, 82, 90]", "output": "80.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143755_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019677", "code": "def flatten_list_of_lists(lst):\n    if not lst:\n        return []\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list_of_lists(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list_of_lists", "input": "[[1], [30, 30], [20, [20, 21]], [30, [30]]]", "output": "[1, 30, 30, 20, 20, 21, 30, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123870_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019678", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8551", "output": "{1, 503, 17, 8551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019679", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7554", "output": "{1, 7554, 3, 2, 3777, 6, 1259, 2518}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7553", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6501", "output": "{1, 33, 3, 6501, 197, 11, 591, 2167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019681", "code": "from typing import List, Tuple\ndef generate_permutations(input_list: List[int]) -> List[Tuple[int]]:\n    def generate(index: int):\n        if index == len(input_list):\n            result.append(tuple(input_list))\n        else:\n            for i in range(index, len(input_list)):\n                input_list[index], input_list[i] = input_list[i], input_list[index]\n                generate(index + 1)\n                input_list[index], input_list[i] = input_list[i], input_list[index]\n    result = []\n    generate(0)\n    return result\n", "entry_point": "generate_permutations", "input": "[]", "output": "[()]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13170_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6089", "output": "{1, 6089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019683", "code": "def generate_auth_token(github_repo, git_tag):\n    # Extract the first three characters of the GitHub repository name\n    repo_prefix = github_repo[:3]\n    # Extract the last three characters of the Git tag\n    tag_suffix = git_tag[-3:]\n    # Concatenate the extracted strings to form the authorization token\n    auth_token = repo_prefix + tag_suffix\n    return auth_token\n", "entry_point": "generate_auth_token", "input": "'hub', '0.0'", "output": "'hub0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37072_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019684", "code": "def process_dependencies(dependencies):\n    graph = {}\n    for dependency in dependencies:\n        if dependency[0] not in graph:\n            graph[dependency[0]] = []\n        graph[dependency[0]].append(dependency[1])\n    result = []\n    def dfs(component):\n        if component in graph:\n            for dependency in graph[component]:\n                if dependency not in result:\n                    dfs(dependency)\n        result.append(component)\n    for component in graph.keys():\n        if component not in result:\n            dfs(component)\n    return result[::-1]\n", "entry_point": "process_dependencies", "input": "[('X', 'Y'), ('Y', 'Z'), ('Z', 'W')]", "output": "['X', 'Y', 'Z', 'W']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115778_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019685", "code": "def calculate_res2net_parameters(layers, scales, width):\n    total_parameters = layers * (width * scales**2 + 3 * width)\n    return total_parameters\n", "entry_point": "calculate_res2net_parameters", "input": "100, 8, 13", "output": "87100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69497_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019686", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5057", "output": "{1, 5057, 13, 389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019687", "code": "def tomorrow(_):\n    return {i: i**2 for i in range(1, _+1)}\n", "entry_point": "tomorrow", "input": "2", "output": "{1: 1, 2: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74523_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019688", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7, 8], [1, 2, 3, 4]", "output": "('Player 1 wins', 4, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019689", "code": "import ast\ndef ast_to_literal(node):\n    if isinstance(node, ast.AST):\n        field_names = node._fields\n        res = {'constructor': node.__class__.__name__}\n        for field_name in field_names:\n            field = getattr(node, field_name, None)\n            field = ast_to_literal(field)\n            res[field_name] = field\n        return res\n    if isinstance(node, list):\n        res = []\n        for each in node:\n            res.append(ast_to_literal(each))\n        return res\n    return node\n", "entry_point": "ast_to_literal", "input": "'xxxxxxxx'", "output": "'xxxxxxxx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99020_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7847", "output": "{1, 1121, 133, 7, 7847, 19, 59, 413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019691", "code": "from typing import List\ndef minimize_task_completion_time(tasks: List[int], workers: int) -> int:\n    tasks.sort(reverse=True)\n    worker_times = [0] * workers\n    for task in tasks:\n        min_time_worker = worker_times.index(min(worker_times))\n        worker_times[min_time_worker] += task\n    return max(worker_times)\n", "entry_point": "minimize_task_completion_time", "input": "[6, 6], 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68875_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019692", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[94, 94, 92, 85, 80]", "output": "[94, 94, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019693", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'ListChartsConfig'", "output": "'listchartsconfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6904", "output": "{1, 2, 4, 8, 6904, 3452, 1726, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6903", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019695", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[5, 6, 7, 8, 9]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019696", "code": "from typing import List\ndef most_common_age(ages: List[int]) -> int:\n    age_freq = {}\n    for age in ages:\n        if age in age_freq:\n            age_freq[age] += 1\n        else:\n            age_freq[age] = 1\n    most_common = min(age_freq, key=lambda x: (-age_freq[x], x))\n    return most_common\n", "entry_point": "most_common_age", "input": "[30, 30, 30, 25, 20]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113386_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019697", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'ETHBTC'", "output": "('ETH', 'BTC')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2767", "output": "{1, 2767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019699", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 4", "output": "225.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019700", "code": "def format_messages(actions):\n    formatted_messages = {}\n    PACK_VERIFY_KEY = \"PACK_VERIFY_KEY\"\n    for action in actions:\n        if \"delete\" in action:\n            formatted_messages[action] = f'{action} \"{{{PACK_VERIFY_KEY}}}\"'\n        elif \"set\" in action:\n            formatted_messages[action] = f'{action} \"{{{PACK_VERIFY_KEY}}}\" to {{}}'\n    return formatted_messages\n", "entry_point": "format_messages", "input": "['update', 'create']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134938_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019701", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1877", "output": "{1, 1877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019702", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'11.31.2..'", "output": "'11.31.2..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019703", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[6, 6, 5, 8, 5, 6, 6]", "output": "[6, 7, 7, 11, 9, 11, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019704", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[-3, 4, 4, 4, 5, 5, 5]", "output": "[-27, 16, 16, 16, 125, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019705", "code": "def count_live_streams(live):\n    count = 0\n    for status in live:\n        if status == 1 or status == 2:\n            count += 1\n    return count\n", "entry_point": "count_live_streams", "input": "[1, 1, 1, 1, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94184_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019706", "code": "def count_album_logos(albums):\n    logo_counts = {}\n    for album in albums:\n        logo_path = album['album_logo']\n        logo_counts[logo_path] = logo_counts.get(logo_path, 0) + 1\n    return logo_counts\n", "entry_point": "count_album_logos", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102628_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019707", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[1, 9, 10]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019708", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "884", "output": "{1, 2, 26, 4, 68, 34, 13, 17, 884, 52, 442, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt883", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019709", "code": "def reshape_tensor(sizes, new_order):\n    reshaped_sizes = []\n    for index in new_order:\n        reshaped_sizes.append(sizes[index])\n    return reshaped_sizes\n", "entry_point": "reshape_tensor", "input": "[2, 4, 6, 5, 3], [0, 1, 2, 3, 4]", "output": "[2, 4, 6, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117209_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019710", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6419", "output": "{1, 131, 7, 49, 6419, 917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019711", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-2, 3", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt66", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019712", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'World!', 0", "output": "'World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019713", "code": "from datetime import date, timedelta\ndef weeks_dates(wky):\n    # Parse week number and year from the input string\n    wk = int(wky[:2])\n    yr = int(wky[2:])\n    # Calculate the starting date of the year\n    start_date = date(yr, 1, 1)\n    start_date += timedelta(6 - start_date.weekday())\n    # Calculate the date range for the given week number and year\n    delta = timedelta(days=(wk - 1) * 7)\n    date_start = start_date + delta\n    date_end = date_start + timedelta(days=6)\n    # Format the date range as a string\n    date_range = f'{date_start} to {date_end}'\n    return date_range\n", "entry_point": "weeks_dates", "input": "'4347'", "output": "'0047-10-27 to 0047-11-02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143506_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019714", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'knowfriend'", "output": "'knowfriend'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019715", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.621.0.5', 119", "output": "'2.621.0.5.119'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019716", "code": "def longest_consecutive_subsequence(lst):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1] + 1:\n            current_length += 1\n        else:\n            if current_length > max_length:\n                max_length = current_length\n                start_index = i - current_length\n            current_length = 1\n    if current_length > max_length:\n        max_length = current_length\n        start_index = len(lst) - current_length\n    return lst[start_index:start_index + max_length]\n", "entry_point": "longest_consecutive_subsequence", "input": "[9]", "output": "[9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62550_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019717", "code": "def generate_stairs(N):\n    stairs_ = []\n    for i in range(1, N + 1):\n        symb = \"#\" * i\n        empty = \" \" * (N - i)\n        stairs_.append(symb + empty)\n    return stairs_\n", "entry_point": "generate_stairs", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69687_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019718", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'east-2east-z'", "output": "'east-2east'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019719", "code": "def count_base_names(file_names):\n    base_name_counts = {}\n    for file_name in file_names:\n        base_name = file_name.split('.')[0]  # Extract base name by removing extension\n        base_name_counts[base_name] = base_name_counts.get(base_name, 0) + 1  # Update count\n    return base_name_counts\n", "entry_point": "count_base_names", "input": "['file1.txt', 'file2.png']", "output": "{'file1': 1, 'file2': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119966_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019720", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'eaepplee', None", "output": "'eaepplee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019721", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'base/path', 125", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019722", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "2, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019723", "code": "def longest_positive_sequence(lst):\n    max_length = 0\n    current_length = 0\n    for num in lst:\n        if num > 0:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    max_length = max(max_length, current_length)  # Check the last sequence\n    return max_length\n", "entry_point": "longest_positive_sequence", "input": "[-1, 0, 1, 2, 3, 4, 5, 0, -2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95331_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019724", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[5, 3, 4, 0, 4, 4]", "output": "([5, 3, None, None], [4, 0, 4, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019725", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'rs.some_other_part.sig'", "output": "('rs', 'sig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019726", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "7", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019727", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3188", "output": "{1, 2, 4, 3188, 1594, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3187", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019728", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[6, 6, 6, 10, 10]", "output": "[6, 6, 6, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3369", "output": "{1, 3, 1123, 3369}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019730", "code": "import re\n# Provided stopwords set\nstopwords = set([\"thank\", \"you\", \"the\", \"please\", \"me\", \"her\", \"his\", \"will\", \"just\", \"myself\", \"ourselves\", \"I\", \"yes\"])\n# Provided regular expression pattern for splitting\nspliter = re.compile(\"([#()!><])\")\ndef process_text(text):\n    tokens = []\n    for token in spliter.split(text):\n        token = token.strip()\n        if token and token not in stopwords:\n            tokens.append(token)\n    return tokens\n", "entry_point": "process_text", "input": "'Iift! !'", "output": "['Iift', '!', '!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45433_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019731", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7681", "output": "{1, 7681}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1055", "output": "{1, 211, 5, 1055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019733", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[5, 5, 5, 5, 10]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019734", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>>ps>si<pact.as</p>'", "output": "'>ps>si<pact.as'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019735", "code": "def word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        # Remove any punctuation from the word\n        word = ''.join(filter(str.isalnum, word))\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'Hello hello world horld!'", "output": "{'hello': 2, 'world': 1, 'horld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1515_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2425", "output": "{1, 97, 5, 485, 2425, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2424", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "641", "output": "{1, 641}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt640", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019738", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[85, 85, 85, 86, 86, 83, 83, 87]", "output": "{85: 3, 86: 2, 83: 2, 87: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019739", "code": "def extract_cluster_member(path):\n    cluster_member = None\n    segments = path.split(\"/\")\n    for segment in segments:\n        if segment.startswith(\"cluster:\"):\n            cluster_member = segment[8:].strip()\n            break\n    return cluster_member\n", "entry_point": "extract_cluster_member", "input": "'some/path/cluster:member1/more/segments'", "output": "'member1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129863_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019740", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[1, 2, 7, 3, 3, 2, 1, 9, 3]", "output": "[1, 3, 9, 6, 7, 7, 7, 16, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019741", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "9.560485123456, 6", "output": "9.560485", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019742", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'fo'", "output": "'fo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019743", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[5, 10, 15, 20, 25]", "output": "[15, 25, 35, 45, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019744", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are 0 or 1 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[0, 20, 20, 21, 21, 100]", "output": "20.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115816_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019745", "code": "def calculate_population_covariance(x, y):\n    n = len(x)\n    mean_x = sum(x) / n\n    mean_y = sum(y) / n\n    covariance_sum = sum((x[i] - mean_x) * (y[i] - mean_y) for i in range(n))\n    population_covariance = covariance_sum / n\n    return population_covariance\n", "entry_point": "calculate_population_covariance", "input": "[1, 2, 3], [2, 0, -4]", "output": "-2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55258_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7157", "output": "{1, 7157, 17, 421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019747", "code": "def parse_configuration(config_str):\n    config_data = {}\n    current_section = None\n    for line in config_str.split('\\n'):\n        line = line.strip()\n        if line.startswith('[') and line.endswith(']'):\n            current_section = line[1:-1]\n            config_data[current_section] = {}\n        elif '=' in line and current_section:\n            key, value = line.split('=', 1)\n            config_data[current_section][key.strip()] = value.strip()\n    return config_data\n", "entry_point": "parse_configuration", "input": "'[lix]'", "output": "{'lix': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14053_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019748", "code": "def process_flags(flag_list):\n    flags_dict = {}\n    for flag in flag_list:\n        flag_name, flag_value = flag.lstrip(\"-\").split(\"=\")\n        flags_dict[flag_name] = flag_value\n    return flags_dict\n", "entry_point": "process_flags", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83523_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019749", "code": "def generate_project_name(author, description):\n    if len(author) < 3 or len(description) < 3:\n        return \"Invalid input\"\n    project_name = author[:3].upper() + '_' + description[:3].lower()\n    return project_name\n", "entry_point": "generate_project_name", "input": "'Alice', 'fuse'", "output": "'ALI_fus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15313_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019750", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'me/a', '2123451'", "output": "'me/a/2123451'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019751", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[80, 81, 85, 90, 99]", "output": "85.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44067_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019752", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[5, 3, 4, 6, 2]", "output": "{5: 540, 3: 180, 4: 360, 6: 720, 2: 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019753", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019754", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[86, 85, 79, 60, 60, 60]", "output": "[86, 85, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019755", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello, this is Thomas. tg presenting the data.'", "output": "'Thomas tg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019756", "code": "def pushDominoes(dominoes: str) -> str:\n    forces = [0] * len(dominoes)\n    force = 0\n    # Calculate forces from the left\n    for i in range(len(dominoes)):\n        if dominoes[i] == 'R':\n            force = len(dominoes)\n        elif dominoes[i] == 'L':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] += force\n    # Calculate forces from the right\n    force = 0\n    for i in range(len(dominoes) - 1, -1, -1):\n        if dominoes[i] == 'L':\n            force = len(dominoes)\n        elif dominoes[i] == 'R':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] -= force\n    # Determine the final state of each domino\n    result = ''\n    for f in forces:\n        if f > 0:\n            result += 'R'\n        elif f < 0:\n            result += 'L'\n        else:\n            result += '.'\n    return result\n", "entry_point": "pushDominoes", "input": "'LLLLLLRR'", "output": "'LLLLLLRR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122559_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019757", "code": "from collections import deque\ndef bfs(graph, start):\n    visited = set()\n    queue = deque([start])\n    traversal_order = []\n    while queue:\n        node = queue.popleft()\n        if node not in visited:\n            traversal_order.append(node)\n            visited.add(node)\n            queue.extend(neigh for neigh in graph.get(node, []) if neigh not in visited)\n    return traversal_order\n", "entry_point": "bfs", "input": "{2: []}, 2", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53696_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019758", "code": "def num_leading_zeros(class_num):\n    if class_num < 10:\n        return 4\n    elif class_num < 100:\n        return 3\n    elif class_num < 1000:\n        return 2\n    elif class_num < 10000:\n        return 1\n    else:\n        return 0\n", "entry_point": "num_leading_zeros", "input": "250", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18260_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019759", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'f xx'", "output": "'f,xx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019760", "code": "def validate_sieve(script: str) -> bool:\n    valid_commands = [\"require\", \"set\"]  # Add more commands if needed\n    lines = script.splitlines()\n    for line in lines:\n        parts = line.strip().split()\n        if len(parts) < 2 or parts[0] not in valid_commands:\n            return False\n        if len(parts) > 2 and (not parts[1].startswith('\"') or not parts[-1].endswith('\"')):\n            return False\n    return True\n", "entry_point": "validate_sieve", "input": "'invalid_command example'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84987_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019761", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:  # Check if the list is empty\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 91]", "output": "85.375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147453_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019762", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5147", "output": "{1, 5147}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019763", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[49, 6, 8, 9, 6, 7, 6], 7", "output": "[[49, 6, 8, 9, 6, 7, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019764", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[10, 7, 6, 1], 3", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3755", "output": "{1, 3755, 5, 751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019766", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3342", "output": "{1, 2, 3, 6, 1671, 557, 3342, 1114}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019767", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'hello world goodbye', 1", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019768", "code": "from typing import List, Union, Any\ndef count_unique_integers(input_list: List[Union[int, Any]]) -> int:\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28911_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019769", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'soandorientaon'", "output": "'Value of soandorientaon'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "202", "output": "{1, 202, 2, 101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019771", "code": "import itertools\ndef generate_combinations(nums, k):\n    # Generate all combinations of size k\n    combinations = itertools.combinations(nums, k)\n    # Convert tuples to lists and store in result list\n    result = [list(comb) for comb in combinations]\n    return result\n", "entry_point": "generate_combinations", "input": "[1, 1, 1, 3, 3], 1", "output": "[[1], [1], [1], [3], [3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31218_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019772", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1828", "output": "{1, 2, 1828, 4, 457, 914}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1827", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019773", "code": "def find_smallest_cell(matrix):\n    N = len(matrix)\n    INF = 10 ** 18\n    smallest_value = INF\n    smallest_coords = (0, 0)\n    for y in range(N):\n        for x in range(N):\n            if matrix[y][x] < smallest_value:\n                smallest_value = matrix[y][x]\n                smallest_coords = (y, x)\n    return smallest_coords\n", "entry_point": "find_smallest_cell", "input": "[[3, 4, 5], [2, 6, 7], [1, 8, 9]]", "output": "(2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87658_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019774", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[85, 86, 87, 88, 89, 89, 89, 90, 90], 2", "output": "[7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019775", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[5, [5, 5], 5]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019776", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2032", "output": "{1, 2, 4, 8, 2032, 16, 1016, 508, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2031", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019777", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "4", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019778", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'le.s'", "output": "'le.s.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019779", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "100, 10, 5", "output": "(104.5, 10.0, 5.5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019780", "code": "def count_students_above_average(scores):\n    total_scores = len(scores)\n    total_sum = sum(scores)\n    average_score = total_sum / total_scores\n    count_above_average = 0\n    for score in scores:\n        if score >= average_score:\n            count_above_average += 1\n    return count_above_average\n", "entry_point": "count_students_above_average", "input": "[70, 80, 90]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84218_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019781", "code": "from typing import List\nimport heapq\ndef min_time_to_complete_tasks(tasks: List[int], num_concurrent: int) -> int:\n    if not tasks:\n        return 0\n    tasks.sort()  # Sort tasks in ascending order of processing times\n    pq = []  # Priority queue to store the next available task to start\n    time = 0\n    running_tasks = []\n    for task in tasks:\n        while len(running_tasks) >= num_concurrent:\n            next_task_time, next_task = heapq.heappop(pq)\n            time = max(time, next_task_time)\n            running_tasks.remove(next_task)\n        time += task\n        running_tasks.append(task)\n        heapq.heappush(pq, (time, task))\n    return max(time, max(pq)[0])  # Return the maximum time taken to complete all tasks\n", "entry_point": "min_time_to_complete_tasks", "input": "[5, 5, 4], 2", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10650_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019782", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[9, 0, 1, 1, 2, 2]", "output": "(9, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019783", "code": "def process_command(input_str):\n    x = input_str.split(' ')\n    com = x[0]\n    rest = x[1:]\n    return (com, rest)\n", "entry_point": "process_command", "input": "'withcoexend'", "output": "('withcoexend', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93382_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019784", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[3, 2, 5, 7]", "output": "[3, 2, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019785", "code": "def organize_courses(course_list):\n    categorized_courses = {}\n    for course in course_list:\n        if course.startswith(\"filter-ger-WAY\"):\n            category = course.split(\"-\")[-1]\n        elif course.startswith(\"filter-ger-\"):\n            category = course.split(\"-\")[-1].split(\"GER\")[-1]\n        else:\n            category = \"Writing\"\n        if category in categorized_courses:\n            categorized_courses[category].append(course)\n        else:\n            categorized_courses[category] = [course]\n    return categorized_courses\n", "entry_point": "organize_courses", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100388_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019786", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "8", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019787", "code": "def calculate_training_time(start_time, end_time):\n    start_h, start_m, start_s = map(int, start_time.split(':'))\n    end_h, end_m, end_s = map(int, end_time.split(':'))\n    total_seconds_start = start_h * 3600 + start_m * 60 + start_s\n    total_seconds_end = end_h * 3600 + end_m * 60 + end_s\n    training_time_seconds = total_seconds_end - total_seconds_start\n    return training_time_seconds\n", "entry_point": "calculate_training_time", "input": "'23:59:58', '00:00:00'", "output": "-86398", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7459_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019788", "code": "def find_min_synaptic_conductance_time(synaptic_conductance_values):\n    min_value = synaptic_conductance_values[0]\n    min_time = 1\n    for i in range(1, len(synaptic_conductance_values)):\n        if synaptic_conductance_values[i] < min_value:\n            min_value = synaptic_conductance_values[i]\n            min_time = i + 1  # Time points start from 1\n    return min_time\n", "entry_point": "find_min_synaptic_conductance_time", "input": "[10, 12, 15, 20, 25, 5]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31704_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019789", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "total_size_in_kb", "input": "[15360]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33137_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019790", "code": "def get_updated_value(filter_condition):\n    metadata = {}\n    if isinstance(filter_condition, str):\n        metadata[filter_condition] = 'default_value'\n    elif isinstance(filter_condition, list):\n        for condition in filter_condition:\n            metadata[condition] = 'default_value'\n    return metadata\n", "entry_point": "get_updated_value", "input": "None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97050_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019791", "code": "def generate_heading(content, level):\n    heading_tags = {\n        1: \"h1\",\n        2: \"h2\",\n        3: \"h3\",\n        4: \"h4\",\n        5: \"h5\",\n        6: \"h6\"\n    }\n    if level not in heading_tags:\n        return \"Invalid heading level. Please provide a level between 1 and 6.\"\n    html_tag = heading_tags[level]\n    return \"<{}>{}</{}>\".format(html_tag, content, html_tag)\n", "entry_point": "generate_heading", "input": "'WorlolWord', 2", "output": "'<h2>WorlolWord</h2>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44780_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019792", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "5, 0", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019793", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[90, 70, 50, 60, 32], 5", "output": "60.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019794", "code": "from typing import List, Tuple\ndef process_transactions(transactions: List[int]) -> Tuple[int, bool]:\n    balance = 0\n    destroy_contract = False\n    for transaction in transactions:\n        balance += transaction\n        if balance < 0:\n            destroy_contract = True\n            break\n    return balance, destroy_contract\n", "entry_point": "process_transactions", "input": "[3, 1, -9]", "output": "(-5, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9357_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019795", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "''", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019796", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/dolocantle.tlt'", "output": "('local', 'dolocantle.tlt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019797", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[92, 78, 70, 65, 50]", "output": "[92, 78, 70]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019798", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'4:4'", "output": "(4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019799", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'The final number is 8'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019800", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'Hello! World, This is a testext123'", "output": "'Hello_World_This_is_a_testext'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019801", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 2, 2, 8, 8, 10]", "output": "([2, 2, 2, 8, 8, 10], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019802", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[5, 5, 4, 1, 3, 2, 6, 6]", "output": "{5: 2, 4: 1, 1: 1, 3: 1, 2: 1, 6: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019803", "code": "def process_circular_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        output_list.append(input_list[i] + input_list[(i + 1) % len(input_list)])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[-3, 0, 1, 5, 3, 4, 3, 5]", "output": "[-3, 1, 6, 8, 7, 7, 8, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131123_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019804", "code": "def repeat_container(colors, container_name):\n    result = {}\n    for color in colors:\n        repetitions = len(color) // len(container_name)\n        result[color] = container_name * repetitions\n    return result\n", "entry_point": "repeat_container", "input": "[], 'box'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112013_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019805", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "14", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019806", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[-2, 1, 2, 2, 3, 3, 3]", "output": "{-2: 1, 1: 1, 2: 2, 3: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019807", "code": "def reverse_sentences(sentences):\n    reversed_sentences = []\n    for sentence in sentences:\n        words = sentence.split()\n        reversed_words = ' '.join(words[::-1])\n        reversed_sentences.append(reversed_words)\n    return reversed_sentences\n", "entry_point": "reverse_sentences", "input": "['hello world', 'python is awesome']", "output": "['world hello', 'awesome is python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4649", "output": "{1, 4649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019809", "code": "def generate_username(first_name: str, last_name: str, existing_usernames: list) -> str:\n    username = (first_name[0] + last_name).lower()\n    unique_username = username\n    counter = 1\n    while unique_username in existing_usernames:\n        unique_username = f\"{username}{counter}\"\n        counter += 1\n    return unique_username\n", "entry_point": "generate_username", "input": "'Nathan', 'Do', ['nathando', 'otherusername']", "output": "'ndo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82643_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019810", "code": "import string\ndef word_frequency(input_list):\n    word_freq = {}\n    for string in input_list:\n        words = string.split()\n        for word in words:\n            word = word.lower()\n            word = ''.join(char for char in word if char.isalnum())  # Remove non-alphanumeric characters\n            if word:\n                word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "['hello hello', 'oo', 'hho', 'h']", "output": "{'hello': 2, 'oo': 1, 'hho': 1, 'h': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63862_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3602", "output": "{1, 3602, 2, 1801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3601", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8267", "output": "{1, 8267, 1181, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8266", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3773", "output": "{1, 7, 11, 77, 49, 343, 539, 3773}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019814", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[0, 2, 1, 3, 2, 3, 1, 2, 3]", "output": "[0, 2, 3, 6, 8, 11, 12, 14, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019815", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "861", "output": "{1, 3, 7, 41, 21, 123, 861, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019816", "code": "def calculate_reward(piece_past_movements, rewards=None):\n    rewards = rewards or {1: 0.8, 2: 0.9, 3: 1, 4: 0.9, 5: 0.5, 6: 0.25}\n    n_skips = 0\n    for movement in piece_past_movements:\n        if abs(movement) > 1:\n            n_skips += 1\n    score = rewards.get(n_skips, 0)\n    return score\n", "entry_point": "calculate_reward", "input": "[0, 1, -1]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67309_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019817", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "4, 39, 42", "output": "16782000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019818", "code": "def parse_afni_output(output_string):\n    lines = output_string.splitlines()\n    values_list = []\n    for line in lines:\n        try:\n            float_value = float(line)\n            values_list.append(float_value)\n        except ValueError:\n            pass  # Ignore lines that are not valid float values\n    return values_list\n", "entry_point": "parse_afni_output", "input": "'3.14\\nnot a float\\n-2.5\\nrandom text\\n10.0'", "output": "[3.14, -2.5, 10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019819", "code": "def calculate(numbers):\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd\n", "entry_point": "calculate", "input": "[10, 10, 5]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115831_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019820", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        line = [i**2]\n        for j in range(i - 1):\n            line.append(line[-1] - 1)\n        pattern.append(line)\n    return pattern\n", "entry_point": "generate_pattern", "input": "3", "output": "[[1], [4, 3], [9, 8, 7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10987_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019821", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1023", "output": "{1, 33, 3, 11, 341, 31, 93, 1023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019822", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2845", "output": "{1, 5, 2845, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2844", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019823", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "405", "output": "'Incorrect app portal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019824", "code": "def apply_commits(commits):\n    repository = {}\n    for commit in commits:\n        operation, *args = commit.split()\n        filename = args[0]\n        if operation == 'A':\n            content = ' '.join(args[1:])\n            repository[filename] = content\n        elif operation == 'M':\n            content = ' '.join(args[1:])\n            if filename in repository:\n                repository[filename] = content\n        elif operation == 'D':\n            if filename in repository:\n                del repository[filename]\n    return repository\n", "entry_point": "apply_commits", "input": "['A file4.txt This ihs new file']", "output": "{'file4.txt': 'This ihs new file'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68646_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019825", "code": "import math\ndef calculate_avg_and_std_dev(word_lengths):\n    total_words = len(word_lengths)\n    avg_length = sum(word_lengths) / total_words\n    variance = sum((x - avg_length) ** 2 for x in word_lengths) / total_words\n    std_dev = math.sqrt(variance)\n    return avg_length, std_dev\n", "entry_point": "calculate_avg_and_std_dev", "input": "[3, 4, 5, 6]", "output": "(4.5, 1.118033988749895)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27792_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019826", "code": "def longest_increasing_sequence(temperatures):\n    longest_length = 0\n    current_length = 1\n    start_index = 0\n    current_start = 0\n    for i in range(1, len(temperatures)):\n        if temperatures[i] > temperatures[i - 1]:\n            current_length += 1\n            if current_length > longest_length:\n                longest_length = current_length\n                start_index = current_start\n        else:\n            current_length = 1\n            current_start = i\n    return start_index, longest_length\n", "entry_point": "longest_increasing_sequence", "input": "[1, 2, 3, 3, 4, 5, 6, 7, 8]", "output": "(3, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138378_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019827", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'/houser/app', 'la'", "output": "'/houser/app/la'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019828", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "13", "output": "[(1, 13), (13, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019829", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'3.3.3-333'", "output": "(3, 3, 3, 333)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019830", "code": "def total_char_count(str_list):\n    total_count = 0\n    for string in str_list:\n        total_count += len(string)\n    return total_count\n", "entry_point": "total_char_count", "input": "['Hello', 'Space', 'Rocks', '!!']", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1633", "output": "{1, 23, 71, 1633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1632", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019832", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8485", "output": "{1, 5, 1697, 8485}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019833", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2638", "output": "{1, 2, 2638, 1319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6548", "output": "{1, 2, 4, 1637, 3274, 6548}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6547", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019835", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019836", "code": "import sys\ndef get_open_command(platform, disk_location):\n    if platform == \"linux2\":\n        return 'xdg-open \"%s\"' % disk_location\n    elif platform == \"darwin\":\n        return 'open \"%s\"' % disk_location\n    elif platform == \"win32\":\n        return 'cmd.exe /C start \"Folder\" \"%s\"' % disk_location\n    else:\n        raise Exception(\"Platform '%s' is not supported.\" % platform)\n", "entry_point": "get_open_command", "input": "'linux2', '/var/log/messages'", "output": "'xdg-open \"/var/log/messages\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32294_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019837", "code": "def sum_of_largest_four(nums):\n    sorted_nums = sorted(nums, reverse=True)\n    return sum(sorted_nums[:4])\n", "entry_point": "sum_of_largest_four", "input": "[15, 20, 25, 10]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104402_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019838", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'Ma h\u00e9tf\u0151 van, \u00e9s hho\u00e9s'", "output": "'Ma Monday van, \u00e9s hho\u00e9s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019839", "code": "import math\ndef calculate_expression(x):\n    sqrt_x = math.sqrt(x)\n    log_x = math.log10(x)\n    result = sqrt_x + log_x\n    return result\n", "entry_point": "calculate_expression", "input": "5", "output": "2.9350379818358086", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127737_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019840", "code": "from typing import List\ndef split_list(lst: List[int], n: int) -> List[List[int]]:\n    if n == 1:\n        return [lst]\n    output = [[] for _ in range(n)]\n    for i, num in enumerate(lst):\n        output[i % n].append(num)\n    return output\n", "entry_point": "split_list", "input": "[3, 2, 10, 4, 5, 6, 8, 4], 6", "output": "[[3, 8], [2, 4], [10], [4], [5], [6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21886_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019841", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[5, 3, 2, 2, 2]", "output": "[2, 2, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019842", "code": "def mod_lcm(numbers, mod):\n    def lcm(x, y):\n        while y != 0:\n            z = x % y\n            x = y\n            y = z\n        return x\n    def modmlt(x, y):\n        return (x * y) % mod\n    def mod_lcm_two(x, y):\n        return modmlt(x, y) // lcm(x, y)\n    result = numbers[0]\n    for num in numbers[1:]:\n        result = mod_lcm_two(result, num)\n    return result % mod\n", "entry_point": "mod_lcm", "input": "[2, 1], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67695_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019843", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7495", "output": "{1, 1499, 5, 7495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019844", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'40.14.0.1.2140.2441'", "output": "(40, 14, 0, 1, 2140, 2441)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019845", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'user set     t'", "output": "'t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019846", "code": "import re\ndef extract_video_id(url):\n    IE_NAME = '9now.com.au'\n    _VALID_URL = r'https?://(?:www\\.)?9now\\.com\\.au/(?:[^/]+/){2}(?P<id>[^/?#]+)'\n    _GEO_COUNTRIES = ['AU']\n    if IE_NAME not in url:\n        return None\n    for country in _GEO_COUNTRIES:\n        if f'.{country.lower()}/' in url:\n            match = re.match(_VALID_URL, url)\n            if match:\n                return match.group('id')\n    return None\n", "entry_point": "extract_video_id", "input": "'https://www.9now.com.au/some-show/season/episo-3'", "output": "'episo-3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3694_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019847", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'aeerr'", "output": "['aeerr']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019848", "code": "def calculate_average_clouds_per_hour(clouds_per_hour, hours_observed):\n    total_clouds = sum(clouds_per_hour)\n    total_hours = len(hours_observed)\n    average_clouds_per_hour = total_clouds / total_hours\n    return average_clouds_per_hour\n", "entry_point": "calculate_average_clouds_per_hour", "input": "[10, 11, 12, 12, 13], [0, 1, 2, 3, 4]", "output": "11.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42405_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019849", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[70, 85, 90, 80], 1", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4585", "output": "{1, 35, 131, 5, 7, 4585, 655, 917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019851", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'itemem3'", "output": "['itemem3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019852", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'CCC_NNCNC_'", "output": "'No occurrences found for bond type CCC_NNCNC_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019853", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9029", "output": "{1, 9029}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9028", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019854", "code": "def bitonic(a, n):\n    for i in range(1, n):\n        if a[i] < a[i - 1]:\n            return i - 1\n    return -1\n", "entry_point": "bitonic", "input": "[5, 3], 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106120_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019855", "code": "def min_moves_to_target(target):\n    return abs(target)\n", "entry_point": "min_moves_to_target", "input": "-3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63367_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019856", "code": "def time_to_seconds(text):\n    time_units = text.split(\":\")\n    hours = int(time_units[0])\n    minutes = int(time_units[1])\n    seconds = int(time_units[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'25:52:32'", "output": "93152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11606_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019857", "code": "def get_data_form_template_path(model_id):\n    DATA_TEMPLATES = {1: 'forms/rtbh_rule.j2', 4: 'forms/ipv4_rule.j2', 6: 'forms/ipv6_rule.j2'}\n    DEFAULT_SORT = {1: 'ivp4', 4: 'source', 6: 'source'}\n    return DATA_TEMPLATES.get(model_id, DATA_TEMPLATES.get(1, 'forms/default_rule.j2'))\n", "entry_point": "get_data_form_template_path", "input": "6", "output": "'forms/ipv6_rule.j2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130729_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019858", "code": "from typing import Optional\ndef time_spec_to_seconds(spec: str) -> Optional[int]:\n    time_units = {'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1}\n    components = []\n    current_component = ''\n    for char in spec:\n        if char.isnumeric():\n            current_component += char\n        elif char in time_units:\n            if current_component:\n                components.append((int(current_component), char))\n                current_component = ''\n        else:\n            current_component = ''  # Reset if delimiter other than time unit encountered\n    if current_component:\n        components.append((int(current_component), 's'))  # Assume seconds if no unit specified\n    total_seconds = 0\n    last_unit_index = -1\n    for value, unit in components:\n        unit_index = 'wdhms'.index(unit)\n        if unit_index < last_unit_index:\n            return None  # Out of order, return None\n        total_seconds += value * time_units[unit]\n        last_unit_index = unit_index\n    return total_seconds\n", "entry_point": "time_spec_to_seconds", "input": "'1w1d11m1s'", "output": "691861", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65809_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019859", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "954", "output": "{1, 2, 3, 6, 9, 106, 18, 53, 954, 477, 318, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt953", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019860", "code": "def read_as_dict(result):\n    output = []\n    for row in result:\n        converted_row = {k: v for k, v in row.items()}\n        output.append(converted_row)\n    return output\n", "entry_point": "read_as_dict", "input": "[{}, {}, {}, {}]", "output": "[{}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145315_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019861", "code": "from typing import List\nMAX_FORCE = 10.0\nTARGET_VELOCITY = 5.0\nMULTIPLY = 2.0\ndef calculate_total_force(robot_velocities: List[float]) -> float:\n    total_force = sum([MAX_FORCE * (TARGET_VELOCITY - vel) * MULTIPLY for vel in robot_velocities])\n    return total_force\n", "entry_point": "calculate_total_force", "input": "[0.0, 10.0]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22767_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019862", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1393", "output": "{1, 199, 7, 1393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019863", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[1, 3, 12, 1, 35], 5", "output": "[1, 1, 3, 12, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019864", "code": "def mobile_phone_cipher(input_string: str) -> str:\n    T = {\n        'A': 21, 'B': 22, 'C': 23, 'D': 31, 'E': 32, 'F': 33,\n        'G': 41, 'H': 42, 'I': 43, 'J': 51, 'K': 52, 'L': 53,\n        'M': 61, 'N': 62, 'O': 63, 'P': 71, 'Q': 72, 'R': 73, 'S': 74,\n        'T': 81, 'U': 82, 'V': 83, 'W': 91, 'X': 92, 'Y': 93, 'Z': 94\n    }\n    output = \"\"\n    for char in input_string:\n        if char.isupper():\n            output += str(T.get(char, ''))\n        else:\n            output += char\n    return output\n", "entry_point": "mobile_phone_cipher", "input": "'HELLO'", "output": "'4232535363'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13172_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019865", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "3, 2", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019866", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[0, 3, 3, 4, 6, 6, 6]", "output": "[0, 3, 3, 4, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019867", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import fromuuuu'", "output": "'fromuuuu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019868", "code": "def dump_db(data):\n    if not data:\n        return \"No data to dump\"\n    columns = list(data[0].keys())\n    output = [','.join(columns)]\n    for record in data:\n        values = [str(record.get(col, '')) for col in columns]\n        output.append(','.join(values))\n    return '\\n'.join(output)\n", "entry_point": "dump_db", "input": "[{}, {}, {}, {}, {}, {}, {}]", "output": "'\\n\\n\\n\\n\\n\\n\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57639_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019869", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5495", "output": "{1, 35, 5, 7, 1099, 785, 5495, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5494", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019870", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "None, -9", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019871", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 3, 2, 7, 3, 3, 3, 2, 2]", "output": "[7, 4, 4, 10, 7, 8, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4513", "output": "{1, 4513}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4512", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019873", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[70, 80, 83, 88, 90]", "output": "83.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145058_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019874", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 10)]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019875", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2035", "output": "{1, 5, 37, 11, 2035, 55, 407, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5975", "output": "{1, 5, 1195, 239, 5975, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5974", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019877", "code": "from typing import List\ndef split_list(lst: List[int], n: int) -> List[List[int]]:\n    if n == 1:\n        return [lst]\n    output = [[] for _ in range(n)]\n    for i, num in enumerate(lst):\n        output[i % n].append(num)\n    return output\n", "entry_point": "split_list", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "[[1, 4, 7], [2, 5, 8], [3, 6, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21886_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4244", "output": "{1, 2, 4, 1061, 2122, 4244}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4243", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019879", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "115", "output": "'ossg.default.115'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019880", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(1, 2, 3)", "output": "'1.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019881", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "100.0, 'Hrld!'", "output": "([('Content-type', 'text/plain')], 'Hrld!')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019882", "code": "def calculate_tf_frequency(tf_names):\n    tf_frequency = {}\n    for tf_name in tf_names:\n        if tf_name in tf_frequency:\n            tf_frequency[tf_name] += 1\n        else:\n            tf_frequency[tf_name] = 1\n    return tf_frequency\n", "entry_point": "calculate_tf_frequency", "input": "['TF1', 'TF1', 'TF2', 'TF2', 'TF2', 'TF3']", "output": "{'TF1': 2, 'TF2': 3, 'TF3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24416_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019883", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[91, 91, 87, 86, 70]", "output": "[91, 87, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019884", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "11", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3687", "output": "{1, 3, 1229, 3687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019886", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[2, 6, 1, 0, 0]", "output": "[0, 0, 1, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019887", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "7", "output": "153.86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019888", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5987", "output": "{1, 5987}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019889", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\begiular}'", "output": "'\\\\begiular}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019890", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'#@!$%^&*()'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019891", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7005", "output": "{1, 3, 5, 15, 467, 1401, 7005, 2335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7004", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019892", "code": "def count_unique_nodes(graph_str):\n    unique_nodes = set()\n    edges = graph_str.split('\\n')\n    for edge in edges:\n        nodes = edge.split('->')\n        for node in nodes:\n            unique_nodes.add(node.strip())\n    return len(unique_nodes)\n", "entry_point": "count_unique_nodes", "input": "' A -> B\\n B -> A'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17791_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019893", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 6656291, 10", "output": "66562910", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019894", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[6.0, 7.6]", "output": "6.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019895", "code": "def find_max_checkpoint_less_than_threshold(SAVED_CHECKPOINTS, THRESHOLD):\n    sorted_checkpoints = sorted(SAVED_CHECKPOINTS)\n    max_checkpoint = -1\n    for checkpoint in sorted_checkpoints:\n        if checkpoint < THRESHOLD:\n            max_checkpoint = checkpoint\n        else:\n            break\n    return max_checkpoint\n", "entry_point": "find_max_checkpoint_less_than_threshold", "input": "[15000, 18000, 20000, 21000, 25000], 20001", "output": "20000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9150_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019896", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'hello'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019897", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "3, 5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019898", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 36], [0, 0]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019899", "code": "def extract_char_frequencies(input_string: str) -> dict:\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "extract_char_frequencies", "input": "'hellohello'", "output": "{'h': 2, 'e': 2, 'l': 4, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5034_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019900", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'data-science', 'machine-learning'", "output": "'data-science/machine-learning'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019901", "code": "def calculate_total_nft_value(transactions):\n    total_value = sum(transaction[\"value\"] for transaction in transactions)\n    return total_value\n", "entry_point": "calculate_total_nft_value", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24676_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019902", "code": "import os\nfrom pathlib import Path\nfrom typing import Tuple\ndef setup_env_path(file_path: str) -> Tuple[str, str]:\n    checkout_dir = Path(file_path).resolve().parent\n    parent_dir = checkout_dir.parent\n    if parent_dir != \"/\" and os.path.isdir(parent_dir / \"etc\"):\n        env_file = parent_dir / \"etc\" / \"env\"\n        default_var_root = parent_dir / \"var\"\n    else:\n        env_file = checkout_dir / \".env\"\n        default_var_root = checkout_dir / \"var\"\n    return str(env_file), str(default_var_root)\n", "entry_point": "setup_env_path", "input": "'/pa/path/th/somefile.txt'", "output": "('/pa/path/th/.env', '/pa/path/th/var')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10500_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019903", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[1, 2, 3, 5]", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019904", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'5.0.0'", "output": "'5.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7963", "output": "{1, 7963}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019906", "code": "def get_version(package_name, options):\n    versions = {\n        \"sigrok-firmware-fx2lafw\": {\n            \"debianpkg\": {\n                \"\": \"0.1.7-1\",\n                \"buster\": \"0.1.6-1\"\n            }\n        }\n    }\n    source = options.get(\"source\")\n    suite = options.get(\"suite\")\n    strip_release = options.get(\"strip_release\", 0)\n    if package_name in versions and source in versions[package_name]:\n        version = versions[package_name][source]\n        if suite and suite in version:\n            version = version[suite]\n        if strip_release:\n            version = version.split(\"-\")[0] if \"-\" in version else version\n        return version\n    else:\n        return \"Version information not found.\"\n", "entry_point": "get_version", "input": "'non-existing-package', {}", "output": "'Version information not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35873_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019907", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'img_e.png'", "output": "'e.png'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019908", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "60", "output": "'01:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019909", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[5, 7, 10, 12], 2", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8110", "output": "{1, 2, 5, 10, 811, 8110, 1622, 4055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8109", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019911", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[-12]", "output": "-12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97914_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019912", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[7, 3, 9, 1, 5]", "output": "(1, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019913", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6589", "output": "{1, 11, 6589, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019914", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'t'", "output": "{'t': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019915", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'userName \"email@example.com\"'", "output": "{'userName': 'email'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019916", "code": "def calculate_absolute_differences_sum(arr):\n    total_diff = 0\n    for i in range(1, len(arr)):\n        total_diff += abs(arr[i] - arr[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 3, 7, 13]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67231_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019917", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "5, [6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019918", "code": "from typing import List\ndef max_visible_buildings(buildings: List[int]) -> int:\n    if not buildings:\n        return 0\n    n = len(buildings)\n    lis = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if buildings[i] > buildings[j] and lis[i] < lis[j] + 1:\n                lis[i] = lis[j] + 1\n    return max(lis)\n", "entry_point": "max_visible_buildings", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100979_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019919", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    sum_scores = sum(scores) - min_score\n    return sum_scores / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[70, 80, 85, 71.25]", "output": "78.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82119_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019920", "code": "def calculate_mean_median(numbers):\n    # Calculate the mean\n    mean = sum(numbers) / len(numbers)\n    # Sort the list to find the median\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:\n        # If the list has an even number of elements\n        median = (sorted_numbers[n // 2 - 1] + sorted_numbers[n // 2]) / 2\n    else:\n        # If the list has an odd number of elements\n        median = sorted_numbers[n // 2]\n    return mean, median\n", "entry_point": "calculate_mean_median", "input": "[1, 2, 3, 3, 3, 4, 4, 4, 5]", "output": "(3.2222222222222223, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51463_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019921", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019922", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[1, 1, 1, 2, 3, 4]", "output": "{1: 3, 2: 1, 3: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019923", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[5, 2, 4, 2, 3, 3, 1, 4]", "output": "[125, 4, 16, 4, 37, 37, 1, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3454_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019924", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019925", "code": "def process_env_list(env_list):\n    env_dict = {}\n    for env_name, is_visualized in env_list:\n        env_dict[env_name] = is_visualized\n    return env_dict\n", "entry_point": "process_env_list", "input": "[('Acrobot-v1', False)]", "output": "{'Acrobot-v1': False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138945_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019926", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6362", "output": "{1, 6362, 2, 3181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2323", "output": "{1, 2323, 101, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019928", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'lo'", "output": "'lo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019929", "code": "def find_pattern_occurrences(text, pattern):\n    occurrences = []\n    pattern_len = len(pattern)\n    text_len = len(text)\n    for i in range(text_len - pattern_len + 1):\n        if text[i:i + pattern_len] == pattern:\n            occurrences.append((i, i + pattern_len))\n    return occurrences\n", "entry_point": "find_pattern_occurrences", "input": "'abcde', 'f'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91050_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019930", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8773", "output": "{1, 283, 8773, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019931", "code": "def calculate_area(length: int, width: int) -> int:\n    area = length * width\n    return area\n", "entry_point": "calculate_area", "input": "10, 12", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019932", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 1, 1, 1, 1, 1, 1, 1, 1], 9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13435_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019933", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "778", "output": "{1, 778, 2, 389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019934", "code": "def count_mirror_numbers(a, b):\n    cnt = 0\n    for i in range(a, b+1):\n        s = str(i)\n        s_r = s[::-1]\n        n = len(s) // 2\n        if s[:n] == s_r[:n]:\n            cnt += 1\n    return cnt\n", "entry_point": "count_mirror_numbers", "input": "0, 22", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19378_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019935", "code": "def calculate_training_time(start_time, end_time):\n    start_h, start_m, start_s = map(int, start_time.split(':'))\n    end_h, end_m, end_s = map(int, end_time.split(':'))\n    total_seconds_start = start_h * 3600 + start_m * 60 + start_s\n    total_seconds_end = end_h * 3600 + end_m * 60 + end_s\n    training_time_seconds = total_seconds_end - total_seconds_start\n    return training_time_seconds\n", "entry_point": "calculate_training_time", "input": "'00:00:00', '01:45:30'", "output": "6330", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7459_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019936", "code": "import os\ndef expanduser(path):\n    \"\"\"\n    Expand ~ and ~user constructions.\n    Includes a workaround for http://bugs.python.org/issue14768\n    \"\"\"\n    expanded = os.path.expanduser(path)\n    if path.startswith(\"~/\") and expanded.startswith(\"//\"):\n        expanded = expanded[1:]\n    return expanded\n", "entry_point": "expanduser", "input": "'~der'", "output": "'~der'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6640_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019937", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "12", "output": "{1, 2, 3, 4, 6, 12}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019938", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7165", "output": "{1, 5, 1433, 7165}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7164", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019939", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[88, 34, 89, 25, 34, 22, 64, 12, 88]", "output": "[12, 22, 25, 34, 34, 64, 88, 88, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019940", "code": "def calculate_similarity_score(str1, str2):\n    if len(str1) != len(str2):\n        raise ValueError(\"Input strings must have the same length\")\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            similarity_score += 1\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "'abcdefg', 'abcdefz'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105365_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019941", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'This is a test AB.AFEDA with some text.'", "output": "[('AB', 'AFEDA')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019942", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "10, 20", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019943", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "0, 29, 46", "output": "1786000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019944", "code": "def parse_variable_assignments(input_list):\n    variables_dict = {}\n    for assignment in input_list:\n        variable, value = assignment.split('=')\n        variable = variable.strip()\n        value = value.strip().strip(\"'\")\n        variables_dict[variable] = value\n    return variables_dict\n", "entry_point": "parse_variable_assignments", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60089_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "328", "output": "{1, 2, 164, 4, 328, 8, 41, 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt327", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019946", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27882_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019947", "code": "import re\ndef parse_liquid_expression(expression):\n    tokens = re.findall(r'\\{\\{.*?\\}\\}|\\{%.*?%\\}', expression)\n    tokens = [token.strip('{}% ') for token in tokens]\n    return tokens\n", "entry_point": "parse_liquid_expression", "input": "'{{ product_name | capitalize }}'", "output": "['product_name | capitalize']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104291_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019948", "code": "def process_categories(categories):\n    total_added = 0\n    for name, class_code in categories:\n        category = {'name': name, 'class_code': class_code}\n        try:\n            # Simulate adding the category by printing a message\n            print(f\"Adding category: {category['name']} with class code {category['class_code']}\")\n            total_added += 1\n        except Exception as e:\n            print(f\"Error adding category '{name}': {e}\")\n    return total_added\n", "entry_point": "process_categories", "input": "[('Category1', 'A1'), ('Category2', 'A2')]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60236_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019949", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "45556, 'etheth1eth10', 'iiii'", "output": "'acl/45556/interfaces/etheth1eth10_iiii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019950", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3793", "output": "{1, 3793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019951", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'1.0.10'", "output": "'1.0.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019952", "code": "import re\ndef process_twitter_text(text):\n    re_usernames = re.compile(\"@([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    re_hashtags = re.compile(\"#([0-9a-zA-Z+_]+)\", re.IGNORECASE)\n    replace_hashtags = \"<a href=\\\"http://twitter.com/search?q=%23\\\\1\\\">#\\\\1</a>\"\n    replace_usernames = \"<a href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a>\"\n    processed_text = re_usernames.sub(replace_usernames, text)\n    processed_text = re_hashtags.sub(replace_hashtags, processed_text)\n    return processed_text\n", "entry_point": "process_twitter_text", "input": "'ouo'", "output": "'ouo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76234_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019953", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '+':\n        return num1 + num2\n    elif operation == '-':\n        return num1 - num2\n    elif operation == '*':\n        return num1 * num2\n    elif operation == '/':\n        if num2 == 0:\n            return \"Error: Division by zero\"\n        return num1 / num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'/', 5, 0", "output": "'Error: Division by zero'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107177_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019954", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8105", "output": "{1, 8105, 1621, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8104", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019955", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[10, 9, 12, 10, 11, 14, 10], 0", "output": "[10, 9, 12, 10, 11, 14, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019956", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[5, 5, 1, 1, 0, 0, 4]", "output": "{5: 2, 1: 2, 0: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019957", "code": "def twoSum(nums, index, tar):\n    check = set([])\n    appear = set([])\n    result = []\n    for i in range(index, len(nums)):\n        if tar - nums[i] in check:\n            if (tar - nums[i], nums[i]) not in appear:\n                result.append([tar - nums[i], nums[i]])\n            appear.add((tar - nums[i], nums[i]))\n        check.add(nums[i])\n    return result\n", "entry_point": "twoSum", "input": "[2, 3, 3, 2], 0, 5", "output": "[[2, 3], [3, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80777_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019958", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'am!'", "output": "{'am': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019959", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'HNaNoNH'", "output": "'HNaNoNH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3219", "output": "{1, 3, 37, 111, 1073, 3219, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019961", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[3, 9]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019962", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"0.0.0\"\n    for version in versions:\n        version_parts = version.split('.')\n        if len(version_parts) != 3:\n            continue\n        major, minor, patch = map(int, version_parts)\n        current_version = (major, minor, patch)\n        if current_version > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['0.0.0', '0.1.0', 'invalid', '0.0.1']", "output": "'0.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45704_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019963", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 5]", "output": "[1, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019964", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[9, 15, 20]", "output": "[9, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019965", "code": "def next_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "next_semantic_version", "input": "'1.2.3'", "output": "'1.2.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143821_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019966", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "9, [4, 1, 4, 4, 2, 2, 7, 5, 4]", "output": "[1, 4, 4, 4, 2, 2, 5, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019967", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'abcdefghij', ''", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019968", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'see_exa'", "output": "'seeExa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019969", "code": "def compute_dist_excluding_gaps(ref_seq, seq):\n    matching_count = 0\n    for ref_char, seq_char in zip(ref_seq, seq):\n        if ref_char != '-' and seq_char != '-' and ref_char == seq_char:\n            matching_count += 1\n    distance = 1 - (matching_count / len(seq))\n    return distance\n", "entry_point": "compute_dist_excluding_gaps", "input": "'ABCDEFGH', 'ABCDEFG-'", "output": "0.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47319_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "115", "output": "{1, 115, 5, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019971", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2005", "output": "{1, 5, 401, 2005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2004", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019972", "code": "from typing import List, Optional\ndef most_frequent_element(lst: List[int]) -> Optional[int]:\n    if not lst:\n        return None\n    freq_count = {}\n    max_freq = 0\n    most_freq_element = None\n    for num in lst:\n        freq_count[num] = freq_count.get(num, 0) + 1\n        if freq_count[num] > max_freq:\n            max_freq = freq_count[num]\n            most_freq_element = num\n    return most_freq_element\n", "entry_point": "most_frequent_element", "input": "[1, 1, 1, 2, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62206_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019973", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9363", "output": "{3, 1, 9363, 3121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9362", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019975", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'854316246'", "output": "'85431624622485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019976", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'aabc,def,ghi->'", "output": "(['aabc', 'def', 'ghi'], '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019977", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[95, 95, 95, 95, 95], 5", "output": "95.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019978", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[2, 4, 5, 3, 6, 6, 5]", "output": "[6, 9, 8, 9, 12, 11, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019979", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3481", "output": "{1, 3481, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019980", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "703", "output": "{1, 19, 37, 703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "195", "output": "{1, 65, 3, 195, 5, 39, 13, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019982", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'Thhi'", "output": "'Thhi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019983", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[5, 5, 5, 5, 0, -1, -1, 2]", "output": "{5: 4, 0: 1, -1: 2, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019984", "code": "def extract_metadata(docstring):\n    metadata = {}\n    lines = docstring.split('\\n')\n    for line in lines:\n        if line.strip().startswith(':'):\n            key_value = line.strip().split(':', 1)\n            if len(key_value) == 2:\n                key = key_value[0][1:].strip()\n                value = key_value[1].strip()\n                metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "': :\u4f5c\u8005:\u8005::127\\n'", "output": "{'': ':\u4f5c\u8005:\u8005::127'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74221_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019985", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7203", "output": "{1, 2401, 3, 7203, 1029, 7, 49, 147, 21, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019986", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[40]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8270", "output": "{1, 2, 5, 4135, 10, 8270, 1654, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8269", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019988", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2836", "output": "{1, 2, 4, 709, 1418, 2836}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2835", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019989", "code": "_DEFAULT_CONFIG = {\n    'LITHOPS_CONFIG': {},\n    'STREAM_STDOUT': False,\n    'REDIS_EXPIRY_TIME': 300,\n    'REDIS_CONNECTION_TYPE': 'pubsubconn'\n}\n_config = _DEFAULT_CONFIG\ndef get_config_value(key):\n    return _config.get(key)\n", "entry_point": "get_config_value", "input": "'STREAM_STDOUT'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59658_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019990", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7349", "output": "{1, 7349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7348", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019991", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1574", "output": "{1, 2, 787, 1574}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019992", "code": "def pushDominoes(dominoes: str) -> str:\n    forces = [0] * len(dominoes)\n    force = 0\n    # Calculate forces from the left\n    for i in range(len(dominoes)):\n        if dominoes[i] == 'R':\n            force = len(dominoes)\n        elif dominoes[i] == 'L':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] += force\n    # Calculate forces from the right\n    force = 0\n    for i in range(len(dominoes) - 1, -1, -1):\n        if dominoes[i] == 'L':\n            force = len(dominoes)\n        elif dominoes[i] == 'R':\n            force = 0\n        else:\n            force = max(force - 1, 0)\n        forces[i] -= force\n    # Determine the final state of each domino\n    result = ''\n    for f in forces:\n        if f > 0:\n            result += 'R'\n        elif f < 0:\n            result += 'L'\n        else:\n            result += '.'\n    return result\n", "entry_point": "pushDominoes", "input": "'RR.L'", "output": "'RR.L'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122559_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8069", "output": "{1, 8069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019994", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "5", "output": "0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019995", "code": "def get_file_extension(filename):\n    file_extensions = {\n        'c': 'C',\n        'cpp': 'C++',\n        'java': 'Java',\n        'py': 'Python',\n        'html': 'HTML'\n    }\n    extension = filename.split('.')[-1]\n    if extension in file_extensions:\n        return file_extensions[extension]\n    else:\n        return 'Unknown'\n", "entry_point": "get_file_extension", "input": "'Example.java'", "output": "'Java'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94277_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019996", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "100.71428571428571, 0, 70", "output": "1007.1428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019997", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "Decimal('4.752000000000000667')", "output": "4752000000000000667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019998", "code": "def calculate_population_covariance(x, y):\n    n = len(x)\n    mean_x = sum(x) / n\n    mean_y = sum(y) / n\n    covariance_sum = sum((x[i] - mean_x) * (y[i] - mean_y) for i in range(n))\n    population_covariance = covariance_sum / n\n    return population_covariance\n", "entry_point": "calculate_population_covariance", "input": "[1, 2], [1, 2]", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55258_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0019999", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "1", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020000", "code": "from typing import List, Tuple\nfrom collections import deque\ndef check_confirmations(transactions: List[Tuple[str, int]]) -> List[bool]:\n    confirmations = [0] * len(transactions)\n    pending_transactions = deque()\n    output = []\n    for transaction in transactions:\n        pending_transactions.append(transaction)\n    for _ in range(len(pending_transactions)):\n        current_transaction = pending_transactions.popleft()\n        confirmations[transactions.index(current_transaction)] += 1\n        if confirmations[transactions.index(current_transaction)] >= current_transaction[1]:\n            output.append(True)\n        else:\n            output.append(False)\n    return output\n", "entry_point": "check_confirmations", "input": "[('tx1', 2), ('tx2', 2), ('tx3', 1)]", "output": "[False, False, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69837_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2742", "output": "{1, 2, 3, 6, 457, 914, 2742, 1371}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020002", "code": "def find_inconsistent_walls(dim, walls):\n    wall_errors = []\n    for y in range(dim-1):\n        for x in range(dim-1):\n            if (walls[x][y] & 1 != 0) != (walls[x][y+1] & 4 != 0):\n                wall_errors.append([(x,y), 'h'])\n            if (walls[x][y] & 2 != 0) != (walls[x+1][y] & 8 != 0):\n                wall_errors.append([(x,y), 'v'])\n    inconsistent_walls = []\n    for cell, wall_type in wall_errors:\n        if wall_type == 'v':\n            cell2 = (cell[0]+1, cell[1])\n            inconsistent_walls.append((cell, cell2))\n        else:\n            cell2 = (cell[0], cell[1]+1)\n            inconsistent_walls.append((cell, cell2))\n    return inconsistent_walls\n", "entry_point": "find_inconsistent_walls", "input": "2, [[0, 0], [0, 0]]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135655_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "136", "output": "{1, 2, 34, 68, 4, 136, 8, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt135", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020004", "code": "def count_backtick_patterns(text: str) -> int:\n    count = 0\n    index = 0\n    while index < len(text) - 2:\n        if text[index] == '`' and text[index + 1] == '`' and text[index + 2] != '`':\n            count += 1\n            index += 2  # Skip the next two characters\n        index += 1\n    return count\n", "entry_point": "count_backtick_patterns", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14469_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020005", "code": "def count_consecutive_doubles(s: str) -> int:\n    count = 0\n    for i in range(len(s) - 1):\n        if s[i] == s[i + 1]:\n            count += 1\n    return count\n", "entry_point": "count_consecutive_doubles", "input": "'aaabbb'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35710_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020006", "code": "def calculate_order_total(products):\n    total_price = 0\n    for product in products:\n        total_price += product['price']\n    return total_price\n", "entry_point": "calculate_order_total", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12251_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020007", "code": "def sliding_average(signal, window_size):\n    averages = []\n    for i in range(len(signal) - window_size + 1):\n        window_sum = sum(signal[i:i+window_size])\n        window_avg = window_sum / window_size\n        averages.append(window_avg)\n    return averages\n", "entry_point": "sliding_average", "input": "[5.8], 1", "output": "[5.8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25415_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020008", "code": "def calculate_max_vertical_deviation(image_dims, ground_truth_horizon, detected_horizon):\n    width, height = image_dims\n    def gt(x):\n        return ground_truth_horizon[0] * x + ground_truth_horizon[1]\n    def dt(x):\n        return detected_horizon[0] * x + detected_horizon[1]\n    if ground_truth_horizon is None or detected_horizon is None:\n        return None\n    max_deviation = max(abs(gt(0) - dt(0)), abs(gt(width) - dt(width)))\n    normalized_deviation = max_deviation / height\n    return normalized_deviation\n", "entry_point": "calculate_max_vertical_deviation", "input": "(90, 90), (0, 1), (0, 2)", "output": "0.011111111111111112", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_623_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020009", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8133", "output": "{1, 3, 8133, 2711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020010", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'tolte'", "output": "('tolte', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020011", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'DAHHSSDDDDHDD', 10", "output": "'NKRRCCNNNNRNN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020012", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "100, 'HelHelHeHe'", "output": "([('Content-type', 'text/plain')], 'HelHelHeHe')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "646", "output": "{1, 2, 323, 34, 646, 38, 17, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt645", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020014", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[2, 2, 3, -1, -1, -2, 5, 1, 1]", "output": "[2, 3, -1, -2, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1407", "output": "{1, 3, 67, 7, 201, 469, 21, 1407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "457", "output": "{1, 457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5843", "output": "{1, 5843}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020018", "code": "def count_non_whitespace_chars(input_string):\n    count = 0\n    for char in input_string:\n        if not char.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'Hello'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117092_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020019", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6335", "output": "{1, 35, 5, 7, 905, 1267, 181, 6335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6334", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020020", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 99, 90, 80, 70, 60]", "output": "[100, 99, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020021", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'Q18'", "output": "401", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020022", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "66, 0", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020023", "code": "from typing import List\ndef flatten(lst: List[List[int]]) -> List[int]:\n    output = []\n    for elements in lst:\n        output += elements\n    return output\n", "entry_point": "flatten", "input": "[[1, 2, 3], [4, 5], [6, 7, 8, 9]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135889_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020024", "code": "def simulate_operation(data, operation_type):\n    # Simulate processing data based on the operation type\n    # This function can be expanded to simulate different operations\n    if operation_type == 'taxaEntrega':\n        return [[1, 2, 3], [4, 5, 6]]  # Example simulated processed data\n    elif operation_type == 'atrasoMedio':\n        return [[7, 8, 9], [10, 11, 12]]  # Example simulated processed data\n    # Add simulations for other operation types as needed\n    return None  # Return None if operation type is not recognized\n", "entry_point": "simulate_operation", "input": "[], 'atrasoMedio'", "output": "[[7, 8, 9], [10, 11, 12]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127249_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020025", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "10.0, 3.795, 1000.0", "output": "886.4285714285714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020026", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'John', 'Doe'", "output": "'John Doe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020027", "code": "import re\ndef validate_uuid(uuid_str):\n    if len(uuid_str) != 36:\n        return False\n    pattern = re.compile(r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\n    if pattern.match(uuid_str):\n        return True\n    else:\n        return False\n", "entry_point": "validate_uuid", "input": "'123e4567-e89b-12d3-a456-426614174000'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13859_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020028", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "60.63076895225166, 50, 10", "output": "1.0630768952251657", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020029", "code": "def generate_pattern(n):\n    if n % 2 == 0:\n        return \"oh la la\" * (n // 2)\n    else:\n        return \"oh la la\" * (n // 2) + \"oh\"\n", "entry_point": "generate_pattern", "input": "10", "output": "'oh la laoh la laoh la laoh la laoh la la'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79138_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020030", "code": "from typing import List\ndef convert_to_milliseconds(task_durations: List[int]) -> List[int]:\n    milliseconds_durations = [duration * 1000 for duration in task_durations]\n    return milliseconds_durations\n", "entry_point": "convert_to_milliseconds", "input": "[8, 20, 22, 21]", "output": "[8000, 20000, 22000, 21000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30331_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020031", "code": "def generate_pseudonym(name):\n    pseudonym_count = {}\n    # Split the name into words\n    words = name.split()\n    pseudonym = ''.join(word[0].upper() for word in words)\n    if pseudonym in pseudonym_count:\n        pseudonym_count[pseudonym] += 1\n    else:\n        pseudonym_count[pseudonym] = 1\n    count = pseudonym_count[pseudonym]\n    return (pseudonym + str(count), sum(pseudonym_count.values()))\n", "entry_point": "generate_pseudonym", "input": "'Bob Cat'", "output": "('BC1', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11221_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020032", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[10, 20, 30, 40, 50], 2", "output": "[[10, 20], [30, 40], [50]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020033", "code": "def get_parent_directory(file_path):\n    # Split the file path into directory components\n    components = file_path.split('/')\n    # Join all components except the last one to get the parent directory path\n    parent_directory = '/'.join(components[:-1])\n    return parent_directory\n", "entry_point": "get_parent_directory", "input": "'path/somefile.txt'", "output": "'path'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11463_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020034", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[92, 92, 92, 85, 80]", "output": "[92, 92, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020035", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'config.settings.wgwgwg'", "output": "'wgwgwg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020036", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average", "input": "[90, 92, 92, 94]", "output": "92.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61371_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020037", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2231", "output": "{1, 23, 97, 2231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020038", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[4]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020039", "code": "def is_balanced_parentheses(s: str) -> bool:\n    stack = []\n    for char in s:\n        if char == \"(\":\n            stack.append(char)\n        elif char == \")\":\n            if not stack:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "is_balanced_parentheses", "input": "'(())'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124796_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020040", "code": "def find_min_path(triangle):\n    if not triangle:\n        return 0\n    for row in range(len(triangle) - 2, -1, -1):\n        for col in range(len(triangle[row])):\n            triangle[row][col] += min(triangle[row + 1][col], triangle[row + 1][col + 1])\n    return triangle[0][0]\n", "entry_point": "find_min_path", "input": "[[7], [2, 3], [5, 9, 6]]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139174_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020041", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020042", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7010", "output": "{1, 7010, 2, 5, 10, 3505, 1402, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7009", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020043", "code": "def extract_major_version(version: str) -> int:\n    # Find the index of the first dot in the version string\n    dot_index = version.find('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version[:dot_index] if dot_index != -1 else version\n    # Convert the substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'5.1.4'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134353_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020044", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020045", "code": "import os\nimport logging\ndef process_file(infilepath: str, outfilepath: str, output_format: str) -> str:\n    filename = os.path.basename(infilepath).split('.')[0]\n    logging.info(\"Reading fileprint... \" + infilepath)\n    output_file = f\"{outfilepath}/{filename}.{output_format}\"\n    return output_file\n", "entry_point": "process_file", "input": "'///path/a/t.txt', '///path/a', 'sv'", "output": "'///path/a/t.sv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139858_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020046", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    rounded_average_score = round(average_score)\n    return rounded_average_score\n", "entry_point": "calculate_average_score", "input": "[67, 69]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70866_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020047", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for i in range(len(arr1)):\n        total_diff += abs(arr1[i] - arr2[i])\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0], [10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136179_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020048", "code": "def parse_list_of_lists(all_groups_str):\n    all_groups_str = all_groups_str.strip()[1:-1]  # Remove leading and trailing square brackets\n    groups = []\n    for line in all_groups_str.split(',\\n'):\n        group = [int(val) for val in line.strip()[1:-1].split(', ')]\n        groups.append(group)\n    return groups\n", "entry_point": "parse_list_of_lists", "input": "'[[1, 2, 3, 4],\\n [5, 6, 7, 8]]'", "output": "[[1, 2, 3, 4], [5, 6, 7, 8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39140_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020049", "code": "def calculate_max_voltage(gain):\n    if gain == 1:\n        max_VOLT = 4.096\n    elif gain == 2:\n        max_VOLT = 2.048\n    elif gain == 4:\n        max_VOLT = 1.024\n    elif gain == 8:\n        max_VOLT = 0.512\n    elif gain == 16:\n        max_VOLT = 0.256\n    else:  # gain == 2/3\n        max_VOLT = 6.144\n    return max_VOLT\n", "entry_point": "calculate_max_voltage", "input": "4", "output": "1.024", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119884_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020050", "code": "def calculate_routes(m, n):\n    # Initialize a 2D array to store the number of routes to reach each cell\n    routes = [[0 for _ in range(n)] for _ in range(m)]\n    # Initialize the number of routes to reach the starting point as 1\n    routes[0][0] = 1\n    # Calculate the number of routes for each cell in the grid\n    for i in range(m):\n        for j in range(n):\n            if i > 0:\n                routes[i][j] += routes[i - 1][j]  # Add the number of routes from above cell\n            if j > 0:\n                routes[i][j] += routes[i][j - 1]  # Add the number of routes from left cell\n    # The number of routes to reach the destination is stored in the bottom-right cell\n    return routes[m - 1][n - 1]\n", "entry_point": "calculate_routes", "input": "7, 5", "output": "210", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9475_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1603", "output": "{1, 1603, 229, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020052", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2397", "output": "{1, 3, 141, 47, 17, 51, 2397, 799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2768", "output": "{1, 2, 4, 1384, 8, 173, 2768, 16, 692, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2767", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020054", "code": "import math\ndef find_max_ceiling_index(n, m, s):\n    mx = 0\n    ind = 0\n    for i in range(n):\n        if math.ceil(s[i] / m) >= mx:\n            mx = math.ceil(s[i] / m)\n            ind = i\n    return ind + 1\n", "entry_point": "find_max_ceiling_index", "input": "3, 1, [1, 3, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97191_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020055", "code": "def generate_status_message(shipment_status, payment_status):\n    if shipment_status == \"ORDERED\" and payment_status == \"NOT PAID\":\n        return \"Order placed, payment pending\"\n    elif shipment_status == \"SHIPPED\" and payment_status == \"PAID\":\n        return \"Order shipped and payment received\"\n    else:\n        return f\"Order status: {shipment_status}, Payment status: {payment_status}\"\n", "entry_point": "generate_status_message", "input": "'SHIPPED', 'PAID'", "output": "'Order shipped and payment received'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73464_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020056", "code": "def find_contiguous_sum(numbers, target):\n    start = 0\n    end = 1\n    current_sum = numbers[start] + numbers[end]\n    while end < len(numbers):\n        if current_sum == target:\n            return min(numbers[start:end+1]) + max(numbers[start:end+1])\n        elif current_sum < target:\n            end += 1\n            current_sum += numbers[end]\n        else:\n            current_sum -= numbers[start]\n            start += 1\n    return None  # If no contiguous set is found\n", "entry_point": "find_contiguous_sum", "input": "[1, 2, 3, 4], 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12627_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020057", "code": "def generate_error_endpoint(blueprint_name, url_prefix):\n    # Concatenate the URL prefix with the blueprint name to form the complete API endpoint URL\n    api_endpoint = f\"{url_prefix}/{blueprint_name}\"\n    return api_endpoint\n", "entry_point": "generate_error_endpoint", "input": "'reeer', ''", "output": "'/reeer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69413_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020058", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[5, 2, 8, 2, 0, 2, 3, 3, 2]", "output": "[5, 3, 10, 5, 4, 7, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020059", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 1, 5, 5, 4, 3, 2]", "output": "{1: 3, 5: 2, 4: 1, 3: 1, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020060", "code": "def custom_url_router(url_patterns):\n    url_mapping = {}\n    for pattern, view_func in url_patterns:\n        placeholders = [placeholder.strip('<>') for placeholder in pattern.split('/') if '<' in placeholder]\n        if not placeholders:\n            url_mapping[pattern] = view_func\n        else:\n            url_with_placeholders = pattern\n            for placeholder in placeholders:\n                url_with_placeholders = url_with_placeholders.replace(f'<{placeholder}>', f'<>{placeholder}')\n            url_mapping[url_with_placeholders] = view_func\n    return url_mapping\n", "entry_point": "custom_url_router", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87593_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020061", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'C:\\\\Program'", "output": "'C:\\\\Program/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020062", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "9, 1.0, 4.0", "output": "(1322, 1377)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020063", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'Hell&lt;3o'", "output": "'Hell<3o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020064", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[2, 7, 1, 1, 3, 1, 1, 1]", "output": "[1, 3, 1, 1, 2, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020065", "code": "def extract_authentication_classes(django_settings):\n    rest_framework_settings = django_settings.get(\"REST_FRAMEWORK\", {})\n    authentication_classes = rest_framework_settings.get(\"DEFAULT_AUTHENTICATION_CLASSES\", [])\n    if isinstance(authentication_classes, tuple):\n        authentication_classes = list(authentication_classes)\n    return authentication_classes\n", "entry_point": "extract_authentication_classes", "input": "{'OTHER_SETTINGS': {}}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122788_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020066", "code": "def containers_above_threshold(containers, threshold):\n    above_threshold_containers = []\n    for container, capacity in containers.items():\n        if capacity > threshold:\n            above_threshold_containers.append(container)\n    return above_threshold_containers\n", "entry_point": "containers_above_threshold", "input": "{}, 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110065_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2506", "output": "{1, 2, 1253, 358, 7, 2506, 14, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2505", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020068", "code": "def longest_substring_with_k_distinct(s, k):\n    max_length = 0\n    start = 0\n    char_count = {}\n    for end in range(len(s)):\n        char_count[s[end]] = char_count.get(s[end], 0) + 1\n        while len(char_count) > k:\n            char_count[s[start]] -= 1\n            if char_count[s[start]] == 0:\n                del char_count[s[start]]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_substring_with_k_distinct", "input": "'aabbccc', 3", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18078_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3625", "output": "{1, 5, 3625, 145, 725, 125, 25, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3624", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020070", "code": "import os\nimport logging\nlogger = logging.getLogger(__name__)\nOWNER_ID = os.getenv(\"OWNER_ID\")\nHELPER_SCRIPTS = {}\nBASE_URL = \"https://muquestionpapers.com/\"\nCOURSES_LIST = {'BE': 'be', 'ME': 'me', 'BSC': 'bs', \"BCOM\": 'bc', \"BAF\": 'ba', \"BBI\": 'bi', \"BFM\": 'bf', \"BMS\": 'bm', \"MCA\": 'mc'}\ndef generate_course_url(course_code, year):\n    if course_code not in COURSES_LIST:\n        return \"Invalid course code provided.\"\n    course_url = BASE_URL + COURSES_LIST[course_code] + str(year) + \"/\"\n    return course_url\n", "entry_point": "generate_course_url", "input": "'BE', 2022", "output": "'https://muquestionpapers.com/be2022/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141345_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020071", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[7, 7, 7, 1, 2, 3]", "output": "(7, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6183", "output": "{1, 3, 229, 6183, 9, 2061, 687, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020073", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "982", "output": "289", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020074", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[85, 88, 82, 81, 76, 77, 90], 7", "output": "82.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020075", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[1, 0, 1, 2, 5, 0, 4, 5]", "output": "[1, 0, 2, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020076", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020077", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "34", "output": "34.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020078", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1133", "output": "{1, 11, 1133, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020079", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'book'", "output": "'book'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020080", "code": "def calculate_average_age(ages):\n    total_age = sum(ages)\n    total_people = len(ages)\n    if total_people == 0:\n        return 0.0\n    average_age = total_age / total_people\n    return round(average_age, 2)\n", "entry_point": "calculate_average_age", "input": "[32.88, 32.9]", "output": "32.89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85168_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020081", "code": "from typing import Tuple\ndef final_position(directions: str, grid_size: int) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    x = max(-grid_size, min(grid_size, x))\n    y = max(-grid_size, min(grid_size, y))\n    return (x, y)\n", "entry_point": "final_position", "input": "'UUURRR', 3", "output": "(3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81995_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020082", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8341", "output": "{1, 19, 8341, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020083", "code": "def calculate_dot_product(vector1, vector2):\n    dot_product = 0\n    for elem1, elem2 in zip(vector1, vector2):\n        dot_product += elem1 * elem2\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[2, 3, 5], [10, 4, 6]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134459_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020084", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'HelHel\\\\x20Worl'", "output": "b'HelHel Worl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020085", "code": "def diagonal_difference(arr):\n    n = len(arr)\n    d1 = sum(arr[i][i] for i in range(n))  # Sum of main diagonal elements\n    d2 = sum(arr[i][n-i-1] for i in range(n))  # Sum of secondary diagonal elements\n    return abs(d1 - d2)\n", "entry_point": "diagonal_difference", "input": "[[1, 2], [0, 3]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25195_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020086", "code": "def calculate_similarity_score(str1, str2):\n    if len(str1) != len(str2):\n        raise ValueError(\"Input strings must have the same length\")\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        if char1 == char2:\n            similarity_score += 1\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "'apple', 'apple'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105365_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020087", "code": "from typing import List\ndef calculate_mode(numbers: List[int]) -> List[int]:\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    modes = [num for num, freq in frequency.items() if freq == max_freq]\n    if len(modes) == len(frequency):\n        return sorted(frequency.keys())\n    else:\n        return sorted(modes)\n", "entry_point": "calculate_mode", "input": "[2, 2, 2, 4, 4, 4, 1]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94710_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020088", "code": "def remove_stopwords(text, stopwords):\n    words = text.split()\n    filtered_words = [word for word in words if word.lower() not in stopwords]\n    return ' '.join(filtered_words)\n", "entry_point": "remove_stopwords", "input": "'The brown fox jumped', {'brown'}", "output": "'The fox jumped'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91862_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020089", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'foo.bar.appsAppfigConfig'", "output": "'appsAppfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020090", "code": "def evaluate_polynomial(coefs, x0):\n    result = 0\n    for coef in reversed(coefs):\n        result = coef + result * x0\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[27428570], 1", "output": "27428570", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86312_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020091", "code": "def combine_strings(func_name, str1, str2):\n    def ti(s1, s2):\n        return s1 + s2\n    def antya(s1, s2):\n        return s2 + s1\n    if func_name == \"ti\":\n        return ti(str1, str2)\n    elif func_name == \"antya\":\n        return antya(str1, str2)\n    else:\n        return \"Invalid function name\"\n", "entry_point": "combine_strings", "input": "'ti', 'u', 'ti'", "output": "'uti'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3414_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1901", "output": "{1, 1901}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020093", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "1", "output": "0.382", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020094", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'customers/10_20'", "output": "((10, 20), 'customers')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020095", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 88, 90, 92, 93, 95]", "output": "90.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113065_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020096", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'Python'", "output": "('Python', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020097", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "13", "output": "233", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020098", "code": "def extract_text(input_text: str) -> str:\n    parts = input_text.split('<!DOCTYPE html>', 1)\n    return parts[0] if len(parts) > 1 else input_text\n", "entry_point": "extract_text", "input": "'line<!DOCTYPE html> more text here'", "output": "'line'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21287_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020099", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[3, 4]", "output": "[3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020100", "code": "def merge_sorted_arrays(arr1, arr2):\n    merged = []\n    i, j = 0, 0\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] < arr2[j]:\n            merged.append(arr1[i])\n            i += 1\n        else:\n            merged.append(arr2[j])\n            j += 1\n    merged.extend(arr1[i:])\n    merged.extend(arr2[j:])\n    return merged\n", "entry_point": "merge_sorted_arrays", "input": "[2, 3, 5, 6, 7], [2, 4, 5, 6, 6, 7]", "output": "[2, 2, 3, 4, 5, 5, 6, 6, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75408_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020101", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5727", "output": "{1, 3, 69, 83, 1909, 23, 249, 5727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020102", "code": "def check_palindrome(input):\n    # Convert input to string for uniform processing\n    input_str = str(input).lower().replace(\" \", \"\")\n    # Check if the reversed string is equal to the original string\n    return input_str == input_str[::-1]\n", "entry_point": "check_palindrome", "input": "'racecar'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57138_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020103", "code": "def calculate_depth(path):\n    depth = 1\n    for char in path:\n        if char == '/':\n            depth += 1\n    return depth\n", "entry_point": "calculate_depth", "input": "'/a/b/c/d/e/f'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21386_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020104", "code": "def twoNumberSum(arr, n):\n    seen = set()\n    for num in arr:\n        diff = n - num\n        if diff in seen:\n            return [diff, num]\n        seen.add(num)\n    return []\n", "entry_point": "twoNumberSum", "input": "[-4, 0, 1, 9, 10], 5", "output": "[-4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7709_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6771", "output": "{1, 3, 37, 111, 2257, 6771, 183, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "592", "output": "{1, 2, 4, 37, 296, 8, 74, 592, 16, 148}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt591", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020107", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 4, 1, 2, 2, 3, 2, 3]", "output": "[6, 5, 3, 4, 5, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020108", "code": "def modified_insertion_sort(arr):\n    def insertion_sort(arr):\n        for i in range(1, len(arr)):\n            key = arr[i]\n            j = i - 1\n            while j >= 0 and arr[j] > key:\n                arr[j + 1] = arr[j]\n                j -= 1\n            arr[j + 1] = key\n    sorted_arr = []\n    positive_nums = [num for num in arr if num > 0]\n    insertion_sort(positive_nums)\n    pos_index = 0\n    for num in arr:\n        if num > 0:\n            sorted_arr.append(positive_nums[pos_index])\n            pos_index += 1\n        else:\n            sorted_arr.append(num)\n    return sorted_arr\n", "entry_point": "modified_insertion_sort", "input": "[2, 2, 2, 2, 6, 3, -3, 4]", "output": "[2, 2, 2, 2, 3, 4, -3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66384_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020109", "code": "from collections import defaultdict\ndef close_files_in_order(file_names):\n    graph = defaultdict(list)\n    for i in range(len(file_names) - 1):\n        graph[file_names[i]].append(file_names[i + 1])\n    def topological_sort(node, visited, stack):\n        visited.add(node)\n        for neighbor in graph[node]:\n            if neighbor not in visited:\n                topological_sort(neighbor, visited, stack)\n        stack.append(node)\n    visited = set()\n    stack = []\n    for file_name in file_names:\n        if file_name not in visited:\n            topological_sort(file_name, visited, stack)\n    return stack[::-1]\n", "entry_point": "close_files_in_order", "input": "['fil2', 'fifieflef']", "output": "['fil2', 'fifieflef']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25686_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020110", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'utc/imagesto.jpg'", "output": "('utc', 'imagesto.jpg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020111", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'heloorld!'", "output": "['heloorld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020112", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "2, 5", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020113", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 1, 2, 0, 6, 4, 0, 6]", "output": "[0, 2, 4, 3, 10, 9, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020114", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[10, 20, 30, 10], -1", "output": "-70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020115", "code": "# Define the memory protection constants and their attributes\nMEMORY_PROTECTION_ATTRIBUTES = {\n    0x01: ['PAGE_NOACCESS'],\n    0x02: ['PAGE_READONLY'],\n    0x04: ['PAGE_READWRITE'],\n    0x08: ['PAGE_WRITECOPY'],\n    0x100: ['PAGE_GUARD'],\n    0x200: ['PAGE_NOCACHE'],\n    0x400: ['PAGE_WRITECOMBINE'],\n    0x40000000: ['PAGE_TARGETS_INVALID', 'PAGE_TARGETS_NO_UPDATE']\n}\ndef get_protection_attributes(memory_protection):\n    attributes = []\n    for constant, attr_list in MEMORY_PROTECTION_ATTRIBUTES.items():\n        if memory_protection & constant:\n            attributes.extend(attr_list)\n    return attributes\n", "entry_point": "get_protection_attributes", "input": "1", "output": "['PAGE_NOACCESS']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63843_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020116", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'10 Nov 1995'", "output": "'Nov 10, 1995'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020117", "code": "def max_score_subset(scores):\n    scores.sort()\n    prev_score = prev_count = curr_score = curr_count = max_sum = 0\n    for score in scores:\n        if score == curr_score:\n            curr_count += 1\n        elif score == curr_score + 1:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        else:\n            prev_score, prev_count = curr_score, curr_count\n            curr_score, curr_count = score, 1\n        if prev_score == score - 1:\n            max_sum = max(max_sum, prev_count * prev_score + curr_count * curr_score)\n        else:\n            max_sum = max(max_sum, curr_count * curr_score)\n    return max_sum\n", "entry_point": "max_score_subset", "input": "[1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103662_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "244", "output": "{1, 2, 4, 244, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt243", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020119", "code": "from typing import List, Union, Optional, Tuple\nfrom collections import Counter\ndef most_common_element(lst: List[Union[int, any]]) -> Tuple[Optional[int], Optional[int]]:\n    int_list = [x for x in lst if isinstance(x, int)]\n    if not int_list:\n        return (None, None)\n    counter = Counter(int_list)\n    most_common = counter.most_common(1)[0]\n    return most_common\n", "entry_point": "most_common_element", "input": "[6, 6, 'a', 3.5]", "output": "(6, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70044_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6338", "output": "{1, 6338, 2, 3169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020121", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[3, 2, 1], [8, 4], [0, -1]]", "output": "[3, 2, 1, 8, 4, 0, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020122", "code": "from datetime import datetime\ndef find_earliest_dates(date_list):\n    dates = [datetime.strptime(date, \"%Y-%m-%d\").date() for date in date_list]\n    earliest_date = datetime.max.date()\n    for date in dates:\n        if date < earliest_date:\n            earliest_date = date\n    earliest_dates = [date.strftime(\"%Y-%m-%d\") for date in dates if date == earliest_date]\n    return earliest_dates\n", "entry_point": "find_earliest_dates", "input": "['2026-01-01', '2025-12-25', '2025-12-25']", "output": "['2025-12-25', '2025-12-25']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103769_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020123", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6386", "output": "{1, 2, 103, 206, 6386, 3193, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020124", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '13:14:25'", "output": "4465", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020125", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "632", "output": "{1, 2, 4, 8, 79, 632, 316, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt631", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5747", "output": "{1, 5747, 821, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020127", "code": "def trap_water(walls):\n    left, right = 0, len(walls) - 1\n    left_max, right_max = 0, 0\n    water_trapped = 0\n    while left < right:\n        if walls[left] < walls[right]:\n            if walls[left] <= left_max:\n                water_trapped += left_max - walls[left]\n            else:\n                left_max = walls[left]\n            left += 1\n        else:\n            if walls[right] <= right_max:\n                water_trapped += right_max - walls[right]\n            else:\n                right_max = walls[right]\n            right -= 1\n    return water_trapped\n", "entry_point": "trap_water", "input": "[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47373_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020128", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "9999", "output": "'Download aborted'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020129", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3262", "output": "{1, 2, 7, 233, 14, 466, 3262, 1631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020130", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "{1}, {3}, {5}", "output": "[1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "76", "output": "{1, 2, 4, 38, 76, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt75", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020132", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[5, 20, 10, 8, 14, 14, 20, 3], 10", "output": "[20, 10, 14, 14, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020133", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "94", "output": "{50: 1, 20: 2, 10: 0, 1: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020134", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'east-1'", "output": "'east'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020135", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[10, 10, 10, 11, 12, 35, 37, 92, 93]", "output": "[10, 10, 10, 11, 12, 35, 37, 92, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020136", "code": "def get_value(type_acquisition, model_input_size):\n    dict_size = {\n        \"SEM\": {\n            \"512\": 0.1,\n            \"256\": 0.2\n        },\n        \"TEM\": {\n            \"512\": 0.01\n        }\n    }\n    # Check if the type_acquisition and model_input_size exist in the dictionary\n    if type_acquisition in dict_size and model_input_size in dict_size[type_acquisition]:\n        return dict_size[type_acquisition][model_input_size]\n    else:\n        return \"Value not found\"\n", "entry_point": "get_value", "input": "'SEM', '512'", "output": "0.1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2685_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020137", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[193]", "output": "2316", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020138", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4277", "output": "{1, 611, 7, 329, 13, 47, 4277, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020139", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "'Hello-World dd'", "output": "'helloworlddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7729", "output": "{1, 59, 131, 7729}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020141", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "0, 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020142", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[3, 2, 1, 1, 0, 3, 3, 8]", "output": "[0, 1, 1, 2, 3, 3, 3, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020143", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'theot.'", "output": "'theot.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020144", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'aabbb'", "output": "'a2b3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020145", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6194", "output": "{1, 2, 163, 326, 38, 6194, 19, 3097}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6193", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020146", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5458", "output": "{2729, 1, 5458, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5457", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020147", "code": "from typing import List\ndef unique_paths_with_obstacles(grid: List[List[int]]) -> int:\n    m, n = len(grid), len(grid[0])\n    dp = [[0] * n for _ in range(m)]\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 1:\n                dp[i][j] = 0\n            elif i == 0 and j == 0:\n                dp[i][j] = 1\n            elif i == 0:\n                dp[i][j] = dp[i][j - 1]\n            elif j == 0:\n                dp[i][j] = dp[i - 1][j]\n            else:\n                dp[i][j] = dp[i - 1][j] + dp[i][j - 1]\n    return dp[m - 1][n - 1]\n", "entry_point": "unique_paths_with_obstacles", "input": "[[0, 0], [0, 0]]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83642_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020148", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[8, 2, 0, 6, 2, 0, 2, 6]", "output": "[8, 3, 2, 9, 6, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020149", "code": "def getTotalPage(m, n):\n    page, remaining = divmod(m, n)\n    if remaining != 0:\n        return page + 1\n    else:\n        return page\n", "entry_point": "getTotalPage", "input": "3, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50511_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020150", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 88, 87, 89, 91, 85]", "output": "88.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113065_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020151", "code": "def calculate_grayscale(r: int, g: int, b: int) -> int:\n    grayscale = int(0.299 * r + 0.587 * g + 0.114 * b)\n    return grayscale\n", "entry_point": "calculate_grayscale", "input": "1, 0, -30", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80937_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8728", "output": "{1, 2, 1091, 4, 2182, 8, 4364, 8728}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8727", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020153", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'word1 word2 word3 word4 word5', '1.1.0001.'", "output": "{'1.1.0001.': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020154", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[3, 5, 5, 10]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020155", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(2, 2, 3, 3, 2, 3, 3)", "output": "'2.2.3.3.2.3.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020156", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 39]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020157", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "[100, 50, 150, 200]", "output": "[125.0, 125.0, 50, 150]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020158", "code": "def broadcast_message(user_ids, message):\n    successful_deliveries = 0\n    for user_id in user_ids:\n        try:\n            # Simulating message delivery by printing the user ID\n            print(f\"Message delivered to user ID: {user_id}\")\n            successful_deliveries += 1\n        except Exception as e:\n            # Handle any exceptions that may occur during message delivery\n            print(f\"Failed to deliver message to user ID: {user_id}. Error: {e}\")\n    return successful_deliveries\n", "entry_point": "broadcast_message", "input": "[101, 102, 103, 104, 105, 106], 'Hello!'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16498_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "563", "output": "{1, 563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020160", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'281'", "output": "'281'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4978", "output": "{1, 2, 131, 262, 38, 4978, 19, 2489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020162", "code": "def str2bool(v):\n    \"\"\"\n    Converts a string to a boolean value based on accepted true values.\n    Args:\n    v (str): Input string to be converted to boolean.\n    Returns:\n    bool: True if the input string matches any of the accepted true values, False otherwise.\n    \"\"\"\n    return v.lower() in (\"yes\", \"true\", \"t\", \"1\")\n", "entry_point": "str2bool", "input": "'yes'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14520_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020163", "code": "def calculate_total_revenue(transactions):\n    total_revenue = 0\n    for transaction in transactions:\n        price = transaction.get('price', 0)\n        quantity = transaction.get('quantity', 0)\n        discount = transaction.get('discount', 0)\n        revenue = price * quantity - discount\n        total_revenue += revenue\n    return total_revenue\n", "entry_point": "calculate_total_revenue", "input": "[{'price': 0, 'quantity': 10, 'discount': 3}]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48372_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020164", "code": "from typing import List\ndef distribute_files(file_sizes: List[int], max_size: int) -> List[List[int]]:\n    folders = []\n    current_folder = []\n    current_size = 0\n    for file_size in file_sizes:\n        if current_size + file_size <= max_size:\n            current_folder.append(file_size)\n            current_size += file_size\n        else:\n            folders.append(current_folder)\n            current_folder = [file_size]\n            current_size = file_size\n    if current_folder:\n        folders.append(current_folder)\n    return folders\n", "entry_point": "distribute_files", "input": "[300, 801, 801, 801], 801", "output": "[[300], [801], [801], [801]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22508_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020165", "code": "def longest_substring_with_k_distinct(s, k):\n    left = 0\n    right = 0\n    letters = [0] * 26\n    maxnum = 0\n    result = 0\n    for per in s:\n        id_ = ord(per) - ord(\"A\")\n        letters[id_] += 1\n        maxnum = max(maxnum, letters[id_])\n        while right - left + 1 - maxnum > k:\n            letters[ord(s[left]) - ord(\"A\")] -= 1\n            left += 1\n        result = max(result, right - left + 1)\n        right += 1\n    return result\n", "entry_point": "longest_substring_with_k_distinct", "input": "'AA', 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140789_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020166", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 90, 86, 85, 70, 85]", "output": "[90, 86, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020167", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "0.0, 8.644984483718872", "output": "8.644984483718872", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020168", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'abcCHAIN_IDdef', '12345'", "output": "'abc12345def'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5444", "output": "{1, 2722, 2, 5444, 4, 1361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5443", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020170", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "1.0, 5.0, 100", "output": "(1.0, 0.06)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020171", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[5, 5, 5, 6, 2, 2, 3, 3]", "output": "{5: 3, 6: 1, 2: 2, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020172", "code": "def sum_squared_differences(a, b):\n    total_sum = 0\n    min_len = min(len(a), len(b))\n    for i in range(min_len):\n        diff = a[i] - b[i]\n        total_sum += diff ** 2\n    return total_sum\n", "entry_point": "sum_squared_differences", "input": "[10, 8], [6, 2]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148697_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020173", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 85, 87]", "output": "85.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5463_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020174", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2874", "output": "{1, 2, 3, 6, 2874, 1437, 958, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020175", "code": "import os\ndef serve_static_file(path):\n    routes = {\n        'bower_components': 'bower_components',\n        'modules': 'modules',\n        'styles': 'styles',\n        'scripts': 'scripts',\n        'fonts': 'fonts'\n    }\n    if path == 'robots.txt':\n        return 'robots.txt'\n    elif path == '404.html':\n        return '404.html'\n    elif path.startswith('fonts/'):\n        return os.path.join('fonts', path.split('/', 1)[1])\n    else:\n        for route, directory in routes.items():\n            if path.startswith(route + '/'):\n                return os.path.join(directory, path.split('/', 1)[1])\n    return '404.html'\n", "entry_point": "serve_static_file", "input": "'fonts/fontawesome.ttf'", "output": "'fonts/fontawesome.ttf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103383_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020176", "code": "import re\nTRAILING_WS_IN_CONTINUATION = re.compile(r'\\\\ \\s+\\n')\ndef remove_trailing_whitespace(input_string: str) -> str:\n    return TRAILING_WS_IN_CONTINUATION.sub(r'\\\\n', input_string)\n", "entry_point": "remove_trailing_whitespace", "input": "'1\\\\'", "output": "'1\\\\'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71646_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3909", "output": "{1, 3, 3909, 1303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3908", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020178", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'.13..10.7.2'", "output": "'.13..10.7.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020179", "code": "def calculate_dash_subsidy(block_height):\n    subsidy = 50  # Initial subsidy amount\n    halving_period = 210240\n    total_subsidy = 0\n    # Calculate the number of halving periods\n    halving_periods = (block_height - 1) // halving_period\n    # Calculate the total subsidy amount\n    if block_height <= halving_period:\n        total_subsidy = block_height * subsidy\n    else:\n        total_subsidy = halving_period * subsidy\n        for _ in range(halving_periods):\n            subsidy /= 2\n            total_subsidy += halving_period * subsidy\n        remaining_blocks = block_height - halving_period * (halving_periods + 1)\n        total_subsidy += remaining_blocks * subsidy\n    return total_subsidy\n", "entry_point": "calculate_dash_subsidy", "input": "500003", "output": "16762037.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52311_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020180", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[1, 2, 3], -14", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020181", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[0, 6, 5, 1, 1, 1, 1, 1]", "output": "[0, 7, 7, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020182", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = round(total_sum / total_students)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 93, 95, 94]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92897_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020183", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2690", "output": "{1345, 1, 2690, 2, 5, 10, 269, 538}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2689", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020184", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[3, 6, 9]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020185", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2529", "output": "{1, 2529, 3, 9, 843, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020186", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "10", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8530", "output": "{1, 2, 5, 4265, 1706, 10, 8530, 853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8529", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020188", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[100, 101, 101, 99, 101, 102, 108, 108, 101]", "output": "'deeceflle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020189", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "1999", "output": "'MCMXCIX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020190", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[10, 5, 3, 4]", "output": "[10, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2458", "output": "{1, 2458, 2, 1229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2457", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020192", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[2, 6, 4, 6, 6, 6, 5, 3, 1]", "output": "[2, 6, 4, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020193", "code": "def reduce_polymer(polymer):\n    stack = []\n    for unit in polymer:\n        if stack and unit.swapcase() == stack[-1]:\n            stack.pop()\n        else:\n            stack.append(unit)\n    return ''.join(stack)\n", "entry_point": "reduce_polymer", "input": "'dabCBAcaDA'", "output": "'dabCBAcaDA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51419_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020194", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1581", "output": "{1, 3, 1581, 527, 17, 51, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020195", "code": "def make_2D_custom(X, y=0):\n    if isinstance(X, list):\n        if all(isinstance(elem, list) for elem in X):\n            if len(X[0]) == 1:\n                X = [[elem[0], y] for elem in X]\n            return X\n        else:\n            X = [[elem, y] for elem in X]\n            return X\n    elif isinstance(X, int) or isinstance(X, float):\n        X = [[X, y]]\n        return X\n    else:\n        return X\n", "entry_point": "make_2D_custom", "input": "3, 1", "output": "[[3, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106690_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020196", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '0.9.9', '1.0.1']", "output": "'1.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34647_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020197", "code": "def custom_multiply(*args):\n    if len(args) == 2 and all(isinstance(arg, int) for arg in args):\n        return args[0] * args[1]\n    elif len(args) == 1 and isinstance(args[0], int):\n        return args[0] * args[0]\n    else:\n        return -1\n", "entry_point": "custom_multiply", "input": "5", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73921_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020198", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8038", "output": "{1, 2, 4019, 8038}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8037", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020199", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'name=Dime=n8'", "output": "{'name': 'Dime=n8'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020200", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 1, 0, 2, 1, 1, 2]", "output": "[4, 1, 2, 3, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020201", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[2, 7, 7, 8, 7, 1]", "output": "[2, 8, 9, 11, 11, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020202", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'RD'", "output": "(1, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1765", "output": "{1, 5, 1765, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020204", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'2.9.10'", "output": "'2.9.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020205", "code": "def count_unique_parent_directories(file_paths):\n    unique_directories = set()\n    for path in file_paths:\n        parent_dir = path.split(\"/\")[-2]  # Extract immediate parent directory\n        unique_directories.add(parent_dir)\n    unique_dir_count = {dir: 0 for dir in unique_directories}\n    for path in file_paths:\n        parent_dir = path.split(\"/\")[-2]\n        unique_dir_count[parent_dir] += 1\n    return unique_dir_count\n", "entry_point": "count_unique_parent_directories", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108146_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020206", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'2.5.9'", "output": "'2.6.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020207", "code": "def generateSecureToken(sCorpID, sEncodingAESKey):\n    concatenated_str = sCorpID + sEncodingAESKey\n    length = len(concatenated_str)\n    reversed_str = concatenated_str[::-1]\n    uppercase_str = reversed_str.upper()\n    secure_token = uppercase_str + str(length)\n    return secure_token\n", "entry_point": "generateSecureToken", "input": "'A111', '333133'", "output": "'331333111A10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75848_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020208", "code": "def transform_iso_datetime(iso_datetime: str) -> str:\n    date_str, time_str = iso_datetime.split('T')\n    if '.' in time_str:\n        time_str = time_str.split('.')[0]  # Remove milliseconds if present\n    date_str = date_str.replace('-', '')  # Remove hyphens from date\n    time_str = time_str.replace(':', '')  # Remove colons from time\n    return date_str + 'T' + time_str\n", "entry_point": "transform_iso_datetime", "input": "'2019-11-30T23:59:59'", "output": "'20191130T235959'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14024_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020209", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3595", "output": "{1, 3595, 5, 719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9837", "output": "{1, 3, 1093, 9, 9837, 3279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020211", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[0, -1, 0, 2, -1, 4, -2, 2]", "output": "[2, -2, 4, -1, 2, 0, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020212", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2781", "output": "{1, 3, 103, 9, 309, 27, 2781, 927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8248", "output": "{1, 2, 4, 1031, 8, 2062, 8248, 4124}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8247", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020214", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1102", "output": "{1, 2, 38, 551, 1102, 19, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1101", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020215", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'qtof', 'negative'", "output": "{'tolerance': 0.01, 'mode': 'negative'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020216", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "120, 0", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5329", "output": "{73, 1, 5329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020218", "code": "from typing import List\ndef total_visible_skyline(buildings: List[int]) -> int:\n    total_skyline = 0\n    max_height = 0\n    for height in buildings:\n        if height > max_height:\n            total_skyline += height - max_height\n            max_height = height\n    return total_skyline\n", "entry_point": "total_visible_skyline", "input": "[3, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115607_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020219", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[10, 15, 15, 19, 20, 8], 15", "output": "[15, 15, 19, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020220", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[9, 4, -1, -1, 1, 1, 7, 9]", "output": "[9, 5, 1, 2, 5, 6, 13, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020221", "code": "def format_document_title(data: dict) -> str:\n    title = data.get('title', None)\n    if title is not None:\n        return f\"Title: {title}\"\n    else:\n        return \"Untitled Document\"\n", "entry_point": "format_document_title", "input": "{}", "output": "'Untitled Document'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1117_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020222", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'<KEY>', 'AIzSBz1BB'", "output": "'AIzSBz1BB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020223", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[6, 5, 5, 4, 3, 2, 6]", "output": "[2, 3, 4, 5, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020224", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "105.0, 12.0, 14.0", "output": "(101.136, 12.6, 16.464000000000002)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020225", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 2, 3, 4, 5]", "output": "[1, 3, 6, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020226", "code": "# Sample list of event metadata dictionaries\nEVENTS = [\n    {'name': 'event1', 'event': {'attribute1': 10, 'attribute2': 20}},\n    {'name': 'event2', 'event': {'attribute1': 15, 'attribute2': 25}},\n    {'name': 'event3', 'event': {'attribute1': 20, 'attribute2': 30}},\n]\n# Function to calculate average attribute value\ndef calculate_average_attribute(attribute_name):\n    total = 0\n    count = 0\n    for event_meta in EVENTS:\n        if attribute_name in event_meta['event']:\n            total += event_meta['event'][attribute_name]\n            count += 1\n    if count == 0:\n        return 0\n    return total / count\n", "entry_point": "calculate_average_attribute", "input": "'attribute1'", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43110_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2269", "output": "{1, 2269}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020228", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "5", "output": "'https://www.kaiheila.cn/api/v5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020229", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[5, 9, 3, 9, 2, 1, 3, 9, 9]", "output": "[9, 9, 9, 9, 5, 3, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020230", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "2", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020231", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4629", "output": "{1, 3, 4629, 1543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020232", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[1, 4, 4, 5, 5, 8, 9, 9]", "output": "[1, 4, 4, 5, 5, 8, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020233", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9014", "output": "{1, 2, 4507, 9014}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9013", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020234", "code": "def determine_client_type(client_id: str) -> str:\n    client_number = int(client_id.split('-')[-1])\n    if client_number < 100:\n        return \"OLD1-\" + str(client_number)\n    elif 100 <= client_number < 1000:\n        return \"OLD2-\" + str(client_number)\n    else:\n        return \"OLD3-\" + str(client_number)\n", "entry_point": "determine_client_type", "input": "'client-99'", "output": "'OLD1-99'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46850_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020235", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[8, 4, 5, 9, 6, 9, 9, 6]", "output": "[8, 4, 5, 9, 6, 9, 9, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020236", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1437", "output": "{1, 3, 1437, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020237", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9895", "output": "{1, 1979, 5, 9895}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020238", "code": "def latest_supported_api_version(input_date):\n    supported_api_versions = [\n        '2019-02-02',\n        '2019-07-07',\n        '2019-12-12',\n        '2020-02-10',\n    ]\n    for version in reversed(supported_api_versions):\n        if input_date >= version:\n            return version\n    return 'No supported API version available'\n", "entry_point": "latest_supported_api_version", "input": "'2019-07-08'", "output": "'2019-07-07'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134418_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020239", "code": "from typing import List, Tuple\ndef longest_contiguous_subarray_above_threshold(temperatures: List[int], threshold: float) -> Tuple[int, int]:\n    start = 0\n    end = 0\n    max_length = 0\n    current_sum = 0\n    max_start = 0\n    while end < len(temperatures):\n        current_sum += temperatures[end]\n        while start <= end and current_sum / (end - start + 1) <= threshold:\n            current_sum -= temperatures[start]\n            start += 1\n        if end - start + 1 > max_length:\n            max_length = end - start + 1\n            max_start = start\n        end += 1\n    return max_start, max_start + max_length - 1\n", "entry_point": "longest_contiguous_subarray_above_threshold", "input": "[10, 10, 10, 15, 15, 10, 20, 20], 10", "output": "(3, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18174_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020240", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 2:\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 4)\n", "entry_point": "calculate_average", "input": "[80, 82, 84, 84, 90]", "output": "83.3333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19408_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020241", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'deitht', '1.21.012.100'", "output": "'1.21.012.100deitht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020242", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[15, 15]", "output": "(15, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020243", "code": "from collections import deque\ndef total_contaminated_nodes(n, cont1, g):\n    contaminated_nodes = {cont1}\n    queue = deque([cont1])\n    while queue:\n        current_node = queue.popleft()\n        for neighbor in range(n):\n            if neighbor not in contaminated_nodes and g[current_node][neighbor] == 1:\n                contaminated_nodes.add(neighbor)\n                queue.append(neighbor)\n    return len(contaminated_nodes)\n", "entry_point": "total_contaminated_nodes", "input": "1, 0, [[0]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91664_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020244", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[5, 2, 9, 9, 8, 6, 5, 2]", "output": "[9, 9, 8, 6, 5, 5, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020245", "code": "from typing import Union, List\ndef parse_driving_envs(driving_environments: str) -> Union[str, List[str]]:\n    driving_environments = driving_environments.split(',')\n    for driving_env in driving_environments:\n        if len(driving_env.split('_')) < 2:\n            raise ValueError(f'Invalid format for the driving environment {driving_env} (should be Suite_Town)')\n    if len(driving_environments) == 1:\n        return driving_environments[0]\n    return driving_environments\n", "entry_point": "parse_driving_envs", "input": "'ui2_Town2'", "output": "'ui2_Town2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141849_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020246", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "1", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020247", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "902", "output": "{1, 2, 451, 902, 41, 11, 82, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt901", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "747", "output": "{1, 3, 9, 747, 83, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020249", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5511", "output": "{1, 33, 3, 5511, 167, 11, 1837, 501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020250", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9404", "output": "{1, 2, 4, 2351, 9404, 4702}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9403", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020251", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'abcdef'", "output": "'cd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020252", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[98, 95, 89, 76, 85], 3", "output": "[98, 95, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020253", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8181", "output": "{1, 3, 101, 2727, 9, 909, 303, 81, 8181, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020254", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4738", "output": "{2369, 1, 4738, 2, 103, 206, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020255", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[14, 0, 0, 15, 14, 15, 16, 16]", "output": "[14, 28, 84, 15, 14, 15, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020256", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'datt/a/u'", "output": "'/tmp/ml4pl/datt/a/u'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9143", "output": "{1, 223, 41, 9143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9993", "output": "{3331, 1, 3, 9993}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9763", "output": "{1, 9763, 13, 751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020260", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[3, 4, 4, 3, 10, 7, 2, 8]", "output": "[7, 8, 7, 13, 17, 9, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020261", "code": "from typing import List\ndef max_distance(colors: List[int]) -> int:\n    color_indices = {}\n    max_dist = 0\n    for i, color in enumerate(colors):\n        if color not in color_indices:\n            color_indices[color] = i\n        else:\n            max_dist = max(max_dist, i - color_indices[color])\n    return max_dist\n", "entry_point": "max_distance", "input": "[1, 2, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93339_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020262", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "1", "output": "'https://www.kaiheila.cn/api/v1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020263", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 1, 2, 1, 1, 2, 4, 1, 2]", "output": "[1, 4, 3, 4, 10, 24, 7, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020264", "code": "from typing import List\ndef longest_subarray(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray", "input": "[1, 1, 1, 1, 1, 1, 1], 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33512_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020265", "code": "import string\ndef extract_unique_words(input_str):\n    translator = str.maketrans('', '', string.punctuation)  # Translator to remove punctuation\n    unique_words = []\n    seen_words = set()\n    for word in input_str.split():\n        cleaned_word = word.translate(translator).lower()\n        if cleaned_word not in seen_words:\n            seen_words.add(cleaned_word)\n            unique_words.append(cleaned_word)\n    return unique_words\n", "entry_point": "extract_unique_words", "input": "'Thha!'", "output": "['thha']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26247_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020266", "code": "from typing import List, Dict\ndef create_player_instances(player_names: List[str]) -> Dict[str, str]:\n    player_instances = {}\n    for player_name in player_names:\n        player_instances[player_name] = \"Player Instance Placeholder\"\n    return player_instances\n", "entry_point": "create_player_instances", "input": "['Charliha']", "output": "{'Charliha': 'Player Instance Placeholder'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19279_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020267", "code": "def calculate_higher_temperature_hours(tokyo_temps, berlin_temps):\n    if len(tokyo_temps) != len(berlin_temps):\n        raise ValueError(\"Tokyo and Berlin temperature lists must have the same length.\")\n    total_hours = 0\n    for tokyo_temp, berlin_temp in zip(tokyo_temps, berlin_temps):\n        if tokyo_temp > berlin_temp:\n            total_hours += 1\n    return total_hours\n", "entry_point": "calculate_higher_temperature_hours", "input": "[15, 20, 25, 30, 18, 22], [10, 15, 20, 29, 19, 25]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82446_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020268", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "371", "output": "{1, 371, 53, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020269", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2443", "output": "{1, 2443, 349, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020270", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[4, 2, 2, 4, 4, 3]", "output": "[2, 2, 2, 2, 4, 4, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020271", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5882", "output": "{1, 2, 34, 346, 173, 17, 5882, 2941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5881", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1076", "output": "{1, 2, 4, 269, 1076, 538}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1075", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020273", "code": "def generate_odd_triangle(n):\n    triangle = []\n    start_odd = 1\n    for i in range(1, n + 1):\n        row = [start_odd + 2*j for j in range(i)]\n        triangle.append(row)\n        start_odd += 2*i\n    return triangle\n", "entry_point": "generate_odd_triangle", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132299_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020274", "code": "def calculate_file_size(chunk_lengths):\n    total_size = 0\n    seen_bytes = set()\n    for length in chunk_lengths:\n        total_size += length\n        for i in range(length - 1):\n            if total_size - i in seen_bytes:\n                total_size -= 1\n            seen_bytes.add(total_size - i)\n    return total_size\n", "entry_point": "calculate_file_size", "input": "[5, 10, 7]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134958_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020275", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'orlHellld!,d!W'", "output": "'<strong>orlHellld!,d!W</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020276", "code": "def count_module_depths(module_names):\n    depth_counts = {}\n    for module_name in module_names:\n        depth = module_name.count('.')\n        depth_counts[depth] = depth_counts.get(depth, 0) + 1\n    return depth_counts\n", "entry_point": "count_module_depths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57844_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020277", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "4", "output": "'GARAGE_DOOR_OPENER'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020278", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'eiladi', 6", "output": "['eiladi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020279", "code": "def filter_investment_reports(investment_reports, threshold):\n    filtered_companies = [report['company_name'] for report in investment_reports if report['investment_amount'] >= threshold]\n    return filtered_companies\n", "entry_point": "filter_investment_reports", "input": "[], 1000", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1957_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020280", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1545", "output": "{1, 515, 3, 5, 103, 1545, 15, 309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020281", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'101110011'", "output": "371", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1223", "output": "{1, 1223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020283", "code": "def reverse_words_in_string(input_string):\n    words = input_string.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words_in_string", "input": "'dsts'", "output": "'stsd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137200_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5770", "output": "{1, 2, 1154, 577, 5, 2885, 5770, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5769", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020285", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'23 20 * 4 +'", "output": "464", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020286", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'d09db01006e<'", "output": "'d09db01006e<'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020287", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5570", "output": "{1, 5570, 2, 2785, 5, 10, 557, 1114}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5569", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020288", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[6, 2, 1, 1, 1, 3, 3, 3, 7]", "output": "[6, 2, 1, 1, 1, 3, 3, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020289", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            dp[i] = scores[i] + dp[i - 1]\n        else:\n            dp[i] = scores[i]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40146_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020290", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "13", "output": "[13, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020291", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[5, 4], [3, 6, 2], [4, [6, 5]]]", "output": "[5, 4, 3, 6, 2, 4, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020292", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[4, 0, 6, 0, 5, 0]", "output": "'aaaabbbbbbccccc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020293", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 2, 3, 4, 5, 6, 9]", "output": "[2, 4, 6, 8, 10, 12, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6067", "output": "{1, 6067}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6066", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020295", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 2, 4, 6, 8, 3]", "output": "[2, 4, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020296", "code": "def sum_fibonacci(N):\n    a, b = 0, 1\n    sum_fib = 0\n    for _ in range(N):\n        sum_fib += a\n        a, b = b, a + b\n    return sum_fib\n", "entry_point": "sum_fibonacci", "input": "11", "output": "143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89935_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020297", "code": "import re\ndef count_unique_words(data):\n    # Convert input string to lowercase\n    data = data.lower()\n    # Use regular expression to extract words excluding special characters and numbers\n    words = re.findall(r'\\b[a-z]+\\b', data)\n    # Count occurrences of each unique word\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'hlo'", "output": "{'hlo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131896_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020298", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'uemy_modmmm', 'any_attribute'", "output": "'Error: Module uemy_modmmm not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020299", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=123-456'", "output": "(123, 456)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020300", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'=CC(=O)OCCCC(='", "output": "'=CC(=O)OCCCC(='", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "961", "output": "{1, 961, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020302", "code": "def generate_code_snippets(operator_names):\n    unary_operator_codes = {\n        \"UAdd\": (\"PyNumber_Positive\", 1),\n        \"USub\": (\"PyNumber_Negative\", 1),\n        \"Invert\": (\"PyNumber_Invert\", 1),\n        \"Repr\": (\"PyObject_Repr\", 1),\n        \"Not\": (\"UNARY_NOT\", 0),\n    }\n    rich_comparison_codes = {\n        \"Lt\": \"LT\",\n        \"LtE\": \"LE\",\n        \"Eq\": \"EQ\",\n        \"NotEq\": \"NE\",\n        \"Gt\": \"GT\",\n        \"GtE\": \"GE\",\n    }\n    output_snippets = []\n    for operator_name in operator_names:\n        if operator_name in unary_operator_codes:\n            output_snippets.append(unary_operator_codes[operator_name][0])\n        elif operator_name in rich_comparison_codes:\n            output_snippets.append(rich_comparison_codes[operator_name])\n    return output_snippets\n", "entry_point": "generate_code_snippets", "input": "['UAdd', 'Eq', 'Not']", "output": "['PyNumber_Positive', 'EQ', 'UNARY_NOT']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_547_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020303", "code": "from typing import List\ndef max_contiguous_sum(lst: List[int]) -> int:\n    max_sum = lst[0]\n    current_sum = lst[0]\n    for num in lst[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_contiguous_sum", "input": "[5, 4, 3, 1]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132431_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020304", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5262", "output": "{1, 2, 3, 6, 2631, 877, 5262, 1754}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020305", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():  # Check if the character is a letter\n            if char_lower in char_count:\n                char_count[char_lower] += 1\n            else:\n                char_count[char_lower] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hhheeelllllo'", "output": "{'h': 3, 'e': 3, 'l': 5, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24964_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9805", "output": "{1, 37, 5, 1961, 265, 9805, 53, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9804", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020307", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 4, 4, -2, 6, -1, 3, 4]", "output": "[7, 8, 2, 4, 5, 2, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31739_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020308", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[0], [2]]", "output": "[0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020309", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'some.package.utils'", "output": "'utils'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020310", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'He'", "output": "{'he': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "134", "output": "{1, 2, 67, 134}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt133", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020312", "code": "def sum_divisible_by_3_not_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    return total\n", "entry_point": "sum_divisible_by_3_not_5", "input": "[6, 9]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59130_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020313", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[70, 70, 72.5, 72.5]", "output": "71.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21931_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020314", "code": "def map_source_to_file(source):\n    if source == 'A':\n        return 'art_source.txt'\n    elif source == 'C':\n        return 'clip_source.txt'\n    elif source == 'P':\n        return 'product_source.txt'\n    elif source == 'R':\n        return 'real_source.txt'\n    else:\n        return \"Unknown Source Type, only supports A C P R.\"\n", "entry_point": "map_source_to_file", "input": "'A'", "output": "'art_source.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140499_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020315", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 3  # Multiply the last added element by 3\n    return processed_list\n", "entry_point": "process_integers", "input": "[40, 10, 14, 4, 16, 7]", "output": "[42, 12, 16, 6, 18, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82460_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020316", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[3, 2, 2, 6, 2, 6]", "output": "[5, 4, 8, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13953_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020317", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'10:00:00', '10:10:00'", "output": "600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020318", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2294", "output": "{1, 2, 37, 74, 2294, 1147, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2293", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020319", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4748", "output": "{1, 2, 1187, 4, 2374, 4748}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4747", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020320", "code": "def calculate_total_score(scores):\n    total_score = 0\n    for score in scores:\n        if score % 5 == 0 and score % 7 == 0:\n            total_score += score * 4\n        elif score % 5 == 0:\n            total_score += score * 2\n        elif score % 7 == 0:\n            total_score += score * 3\n        else:\n            total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[-35, -10, -14, -1, 111]", "output": "-92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93768_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020321", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cbad', 'cccaabd'", "output": "'cccbaad'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020322", "code": "def sum_absolute_differences(list1, list2):\n    total_diff = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0], [0, 0, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92030_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020323", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[1, 1, 1, 2, 3]", "output": "1.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020324", "code": "def remove_non_alphanumeric(input_str):\n    result = ''\n    for char in input_str:\n        if char.isalnum() or char == '_':\n            result += char\n    return result\n", "entry_point": "remove_non_alphanumeric", "input": "'/h$e#h* h^e@l!'", "output": "'hehhel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139297_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020325", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[0, 6, -1, 1, 1, 3, 7]", "output": "[0, 6, -1, 1, 1, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6561", "output": "{1, 6561, 3, 9, 2187, 81, 243, 729, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1078", "output": "{1, 2, 98, 7, 11, 77, 14, 49, 1078, 22, 154, 539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1077", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020328", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020329", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'df'", "output": "'Df'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020330", "code": "from typing import List\ndef find_single_number(nums: List[int]) -> int:\n    single_num = 0\n    for num in nums:\n        single_num ^= num\n    return single_num\n", "entry_point": "find_single_number", "input": "[2, 2, 5, 5, 10, 10, 13]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121855_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020331", "code": "def unique_counts(input_list):\n    # Creating an empty dictionary to store unique items and their counts\n    counts_dict = {}\n    # Bubble sort implementation (source: https://realpython.com/sorting-algorithms-python/)\n    def bubble_sort(arr):\n        n = len(arr)\n        for i in range(n):\n            for j in range(0, n-i-1):\n                if arr[j] > arr[j+1]:\n                    arr[j], arr[j+1] = arr[j+1], arr[j]\n    # Sorting the input list using bubble sort\n    sorted_list = input_list.copy()  # Create a copy to preserve the original list\n    bubble_sort(sorted_list)\n    # Counting unique items and their occurrences\n    current_item = None\n    count = 0\n    for item in sorted_list:\n        if item != current_item:\n            if current_item is not None:\n                counts_dict[current_item] = count\n            current_item = item\n            count = 1\n        else:\n            count += 1\n    counts_dict[current_item] = count  # Add count for the last item\n    return counts_dict\n", "entry_point": "unique_counts", "input": "['AAA', 'BCC', 'BCC', 'BCC', 'BCC', 'BCC']", "output": "{'AAA': 1, 'BCC': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146010_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7914", "output": "{1, 2, 3, 6, 1319, 7914, 2638, 3957}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7913", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020333", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        if num >= 0:\n            total_sum += num\n            count += 1\n    if count == 0:\n        return 0  # To handle the case when there are no positive numbers\n    return total_sum / count\n", "entry_point": "calculate_average", "input": "[10]", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5697_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020334", "code": "def max_palindrome_length(s: str) -> int:\n    char_count = {}\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    max_length = 0\n    for count in char_count.values():\n        max_length += count if count % 2 == 0 else count - 1\n    return max_length\n", "entry_point": "max_palindrome_length", "input": "'aabbcc'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124507_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020335", "code": "def highest_scoring_student(students):\n    if not students:\n        return None\n    highest_score = float('-inf')\n    highest_scoring_student = None\n    for student in students:\n        name, score = student\n        if score > highest_score:\n            highest_score = score\n            highest_scoring_student = name\n    return highest_scoring_student\n", "entry_point": "highest_scoring_student", "input": "[('Emma', 95), ('John', 90), ('Alice', 80)]", "output": "'Emma'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93566_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020336", "code": "def calculate_total_plays(music):\n    total_plays = {}\n    for track, plays in music:\n        if track in total_plays:\n            total_plays[track] += plays\n        else:\n            total_plays[track] = plays\n    return total_plays\n", "entry_point": "calculate_total_plays", "input": "[('guitar', 100)]", "output": "{'guitar': 100}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1397_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020337", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'WOWOWORLLD'", "output": "'wowoworlld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020338", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "1, {3: True, 1: False, 2: False}", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3433", "output": "{1, 3433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020340", "code": "def bar(arr):\n    modified_arr = []\n    for i in range(len(arr)):\n        sum_except_current = sum(arr) - arr[i]\n        modified_arr.append(sum_except_current)\n    return modified_arr\n", "entry_point": "bar", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "[35, 34, 33, 32, 31, 30, 29, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30502_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020341", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[5, 7, 7, 7, 2, 7]", "output": "[5, 8, 9, 10, 6, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020342", "code": "def format_title(title):\n    words = title.split()\n    formatted_words = [word.capitalize().replace('-', '') for word in words]\n    formatted_title = ' '.join(formatted_words)\n    return formatted_title\n", "entry_point": "format_title", "input": "'adminin'", "output": "'Adminin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13677_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020343", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7219", "output": "{1, 7219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020344", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[85, 85, 85, 92, 92, 75, 75, 100]", "output": "{85: 3, 92: 2, 75: 2, 100: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020345", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[7, 3, 7]", "output": "[7, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020346", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'34e5638'", "output": "'34e563FFFE8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020347", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "6.0", "output": "113.1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56380_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020348", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[42]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020349", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'fo=bauox'", "output": "{'fo': 'bauox'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020350", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num * 3)\n        if num % 5 == 0:\n            processed_list[-1] -= 5\n    return processed_list\n", "entry_point": "process_integers", "input": "[6, 38, 1, 38, 4, 6, 1, 4]", "output": "[8, 40, 3, 40, 6, 8, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11311_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020351", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "54880.8, '0.00000'", "output": "'5.48808E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020352", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020353", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[3, 2, 1, 3, 3]", "output": "[5, 3, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112873_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020354", "code": "from typing import List\ndef reverse_strings(input_list: List[str]) -> List[str]:\n    reversed_list = []\n    for i in range(len(input_list) - 1, -1, -1):\n        reversed_list.append(input_list[i])\n    return reversed_list\n", "entry_point": "reverse_strings", "input": "['apple', 'banana', 'cherry']", "output": "['cherry', 'banana', 'apple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57617_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020355", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'2221.22.0.1'", "output": "(2221, 22, 0, '1')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020356", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'config.addressaa'", "output": "'addressaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020357", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 100.0), ('W', 20.0)]", "output": "80.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2045", "output": "{1, 5, 409, 2045}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2044", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020359", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4167", "output": "{1, 3, 4167, 9, 1389, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2623", "output": "{1, 43, 61, 2623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020361", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'Dwonder', 'Deon', 2020", "output": "'DWODEO2020'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020362", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6637", "output": "{1, 6637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020363", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'1.version0', '111..1'", "output": "{'111..1': '1.version0'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020364", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "23, 8", "output": "490314", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020365", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7088", "output": "{1, 2, 4, 8, 1772, 7088, 16, 886, 3544, 443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7087", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020366", "code": "def count_unique_taxids(taxids: dict) -> int:\n    unique_taxids = set()\n    for taxid in taxids.values():\n        unique_taxids.add(taxid)\n    return len(unique_taxids)\n", "entry_point": "count_unique_taxids", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100776_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020367", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[5, 4, 4, 5, 1, 5, 4]", "output": "[6, 5, 5, 6, 2, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020368", "code": "from collections import defaultdict\ndef find_shortest_subarray(arr):\n    freq = defaultdict(list)\n    for i, num in enumerate(arr):\n        freq[num].append(i)\n    max_freq = max(len(indices) for indices in freq.values())\n    shortest_length = float('inf')\n    for indices in freq.values():\n        if len(indices) == max_freq:\n            shortest_length = min(shortest_length, indices[-1] - indices[0] + 1)\n    return shortest_length\n", "entry_point": "find_shortest_subarray", "input": "[1, 2, 3, 1, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30490_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020369", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'double_value_2.3d'", "output": "'2.3d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020370", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "9", "output": "'9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020371", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "12", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020372", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'spacees'", "output": "'spacees'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020373", "code": "from typing import List\ndef perform_operation(float_list: List[float]) -> float:\n    result = float_list[0]  # Initialize result with the first number\n    for i in range(1, len(float_list)):\n        if i % 2 == 1:  # Odd index, subtract\n            result -= float_list[i]\n        else:  # Even index, add\n            result += float_list[i]\n    return result\n", "entry_point": "perform_operation", "input": "[1.0, 1.9]", "output": "-0.8999999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88957_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020374", "code": "def fill_matrix(s):\n    n = int((len(s) + 2) ** 0.5)  # Calculate the size of the square matrix\n    matrix = [['_' for _ in range(n)] for _ in range(n)]  # Initialize the square matrix\n    directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]  # Right, Down, Left, Up\n    direction_index = 0\n    row, col = 0, 0\n    for char in s:\n        matrix[row][col] = char\n        next_row, next_col = row + directions[direction_index][0], col + directions[direction_index][1]\n        if 0 <= next_row < n and 0 <= next_col < n and matrix[next_row][next_col] == '_':\n            row, col = next_row, next_col\n        else:\n            direction_index = (direction_index + 1) % 4\n            row, col = row + directions[direction_index][0], col + directions[direction_index][1]\n    return matrix\n", "entry_point": "fill_matrix", "input": "'same'", "output": "[['s', 'a'], ['e', 'm']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1644_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020375", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[15]", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020376", "code": "def sort_tuples(array):\n    return sorted(array, key=lambda x: x[1])\n", "entry_point": "sort_tuples", "input": "[('bird', 5), ('cat', 3), ('dog', 2)]", "output": "[('dog', 2), ('cat', 3), ('bird', 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36118_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020377", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[20, 40, 3]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5154", "output": "{1, 5154, 3, 2, 6, 2577, 1718, 859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1431", "output": "{1, 3, 9, 53, 1431, 27, 477, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020380", "code": "def keep_alive(token):\n    return f\"Keeping connection alive with token: {token}\"\n", "entry_point": "keep_alive", "input": "'rk'", "output": "'Keeping connection alive with token: rk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98656_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020381", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "135", "output": "{1, 3, 5, 135, 9, 45, 15, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020382", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[8, 8, 2, 4, 7, 6, 4]", "output": "[8, 9, 4, 7, 11, 11, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020383", "code": "def max_box_area(heights):\n    max_area = 0\n    left, right = 0, len(heights) - 1\n    while left < right:\n        width = right - left\n        min_height = min(heights[left], heights[right])\n        area = width * min_height\n        max_area = max(max_area, area)\n        if heights[left] < heights[right]:\n            left += 1\n        else:\n            right -= 1\n    return max_area\n", "entry_point": "max_box_area", "input": "[5, 5, 10, 2, 5]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135677_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020384", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'r01234DEADBEEF'", "output": "'01234DEADBEEF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1821", "output": "{1, 3, 1821, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020386", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4693", "output": "{1, 361, 13, 19, 4693, 247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020387", "code": "def reverse_string(input_string):\n    return input_string[::-1]\n", "entry_point": "reverse_string", "input": "'newsletter'", "output": "'rettelswen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18735_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020388", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8195", "output": "{1, 8195, 5, 1639, 745, 11, 149, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020389", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[9, 9, 9]", "output": "[1, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020390", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1661", "output": "{1, 11, 1661, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020391", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "104.0, 3.0, 7.0", "output": "(99.6216, 3.12, 7.498400000000001)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020392", "code": "def posix_quote_filter(input_string):\n    # Escape single quotes by doubling them\n    escaped_string = input_string.replace(\"'\", \"''\")\n    # Enclose the modified string in single quotes\n    return f\"'{escaped_string}'\"\n", "entry_point": "posix_quote_filter", "input": "'Dpanic!'", "output": "\"'Dpanic!'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125649_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020393", "code": "def get_full_party_name(party_abbr):\n    if party_abbr == \"gop\":\n        return \"Republican\"\n    elif party_abbr == \"dem\":\n        return \"Democrat\"\n    else:\n        return \"Independent\"\n", "entry_point": "get_full_party_name", "input": "'gop'", "output": "'Republican'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129194_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020394", "code": "def device_info(os):\n    if os == 'eos':\n        # Simulating the behavior of fetching version and model information for an EOS device\n        version_info = 'EOS Version X.Y.Z'\n        model_info = 'EOS Model ABC'\n        return version_info, model_info\n    else:\n        return 'Not supported on this platform'\n", "entry_point": "device_info", "input": "'eos'", "output": "('EOS Version X.Y.Z', 'EOS Model ABC')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84666_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020395", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[2, 3, -1, 2, 1, 2, 2]", "output": "[5, 2, 1, 3, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020396", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "62, 0", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020397", "code": "def count_errors(words):\n    errors = 0\n    for word in words:\n        if not word.islower():\n            errors += 1\n    return errors\n", "entry_point": "count_errors", "input": "['hello', 'world']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82716_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020398", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "34", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020399", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'orlHelloldWorl!'", "output": "'<strong>orlHelloldWorl!</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020400", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "74, 1.0", "output": "74", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020401", "code": "def calculate_f1_score(y_true, y_pred):\n    tp = fp = fn = 0\n    for true_label, pred_label in zip(y_true, y_pred):\n        if true_label == 1 and pred_label == 1:\n            tp += 1\n        elif true_label == 0 and pred_label == 1:\n            fp += 1\n        elif true_label == 1 and pred_label == 0:\n            fn += 1\n    precision = tp / (tp + fp) if tp + fp > 0 else 0\n    recall = tp / (tp + fn) if tp + fn > 0 else 0\n    f1_score = 2 * (precision * recall) / (precision + recall) if precision + recall > 0 else 0\n    return round(f1_score, 2)\n", "entry_point": "calculate_f1_score", "input": "[0, 0, 0, 0], [0, 0, 0, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83345_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020402", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[80, 85, 87.5, 90, 100]", "output": "87.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83310_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "424", "output": "{1, 2, 4, 424, 8, 106, 212, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt423", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020404", "code": "import errno\ndef process_socket_errors(sock_errors: dict) -> dict:\n    sockErrors = {errno.ESHUTDOWN: True,\n                  errno.ENOTCONN: True,\n                  errno.ECONNRESET: False,\n                  errno.ECONNREFUSED: False,\n                  errno.EAGAIN: False,\n                  errno.EWOULDBLOCK: False}\n    if hasattr(errno, 'EBADFD'):\n        sockErrors[errno.EBADFD] = True\n    ignore_status = {}\n    for error_code in sock_errors:\n        ignore_status[error_code] = sockErrors.get(error_code, False)\n    return ignore_status\n", "entry_point": "process_socket_errors", "input": "{104: None, 77: None}", "output": "{104: False, 77: True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12691_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020405", "code": "DRIVERS = {\n    \"ios\": \"cisco_ios\",\n    \"nxos\": \"cisco_nxos\",\n    \"nxos_ssh\": \"cisco_nxos\",\n    \"eos\": \"arista_eos\",\n    \"junos\": \"juniper_junos\",\n    \"iosxr\": \"cisco_xr\",\n}\ndef get_netmiko_driver(device_type):\n    return DRIVERS.get(device_type)\n", "entry_point": "get_netmiko_driver", "input": "'nxos'", "output": "'cisco_nxos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94921_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020406", "code": "def filter_files_in_directory(file_paths, directory_path):\n    files_within_directory = []\n    for file_path in file_paths:\n        if file_path.startswith(directory_path):\n            files_within_directory.append(file_path)\n    return files_within_directory\n", "entry_point": "filter_files_in_directory", "input": "[], 'any/directory/path'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115673_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020407", "code": "def calculate_gpu_memory_usage(processes):\n    max_memory_usage = max(processes)\n    total_memory_usage = sum(processes)\n    return max_memory_usage, total_memory_usage\n", "entry_point": "calculate_gpu_memory_usage", "input": "[1024, 896]", "output": "(1024, 1920)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48951_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020408", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'127127.012.012', 8084", "output": "'http://127127.012.012:8084'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020409", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[85, 85, 85, 84, 70], 4", "output": "84.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12185_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020410", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.1711.31'", "output": "(0, 1711, 31)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020411", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[10, 5, 5], 20", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020412", "code": "import re\ndef extract_message_id(fbl_report: str) -> str:\n    yandex_pattern = r'\\[(.*?)\\]'  # Pattern to match Yandex FBL message ID\n    gmail_pattern = r'\\{(.*?)\\}'   # Pattern to match Gmail FBL message ID\n    yandex_match = re.search(yandex_pattern, fbl_report)\n    gmail_match = re.search(gmail_pattern, fbl_report)\n    if yandex_match:\n        return yandex_match.group(1)\n    elif gmail_match:\n        return gmail_match.group(1)\n    else:\n        return \"Message ID not found\"\n", "entry_point": "extract_message_id", "input": "'[1jb6B3-0004MN-Dq]'", "output": "'1jb6B3-0004MN-Dq'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29165_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020413", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'dd09db10d91dd09'", "output": "'dd09db10d91dd09'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020414", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "880000000.0", "output": "'0.8800000000000001 x 10^8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020415", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[12, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020416", "code": "def construct_mapping(Gvs, f):\n    Hvs = []  # Placeholder for vertices or nodes of graph H\n    gf = {}\n    for v in range(len(f)):\n        fv = f[v]\n        if fv >= 0:\n            gf[Gvs[v]] = Hvs[fv] if Hvs else None\n        else:\n            gf[Gvs[v]] = None\n    return gf\n", "entry_point": "construct_mapping", "input": "[0, 1, 2, 4], [-1, -1, -1, -1]", "output": "{0: None, 1: None, 2: None, 4: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98043_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020417", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[55, 55, 55]", "output": "[55]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020418", "code": "from typing import List\ndef remove_poisoned_data(predictions: List[int]) -> List[int]:\n    median = sorted(predictions)[len(predictions) // 2]\n    deviations = [abs(pred - median) for pred in predictions]\n    mad = sorted(deviations)[len(deviations) // 2]\n    threshold = 2 * mad\n    cleaned_predictions = [pred for pred in predictions if abs(pred - median) <= threshold]\n    return cleaned_predictions\n", "entry_point": "remove_poisoned_data", "input": "[12, 10, 10, 9, 10, 12]", "output": "[12, 10, 10, 9, 10, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51414_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020419", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "892, 0", "output": "892", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020420", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1098", "output": "{1, 2, 3, 549, 6, 9, 1098, 366, 18, 183, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020421", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[90, 34, 33, 11, 12, 22, 89, 90]", "output": "[11, 12, 22, 33, 34, 89, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020422", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7197", "output": "{1, 3, 7197, 2399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7196", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020423", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6546", "output": "{1, 2, 3, 1091, 2182, 6, 3273, 6546}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6545", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020424", "code": "def highest_scoring_student(students):\n    if not students:\n        return None\n    highest_score = float('-inf')\n    highest_scoring_student = None\n    for student in students:\n        name, score = student\n        if score > highest_score:\n            highest_score = score\n            highest_scoring_student = name\n    return highest_scoring_student\n", "entry_point": "highest_scoring_student", "input": "[('Alice', 90), ('Bob', 85), ('Grace', 95), ('Eve', 70)]", "output": "'Grace'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93566_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020425", "code": "def calculate_dot_product(A, B):\n    if len(A) != len(B):\n        raise ValueError(\"Arrays must be of the same length\")\n    dot_product = sum(a * b for a, b in zip(A, B))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 6], [7, 5]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105699_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5157", "output": "{1, 3, 5157, 9, 1719, 27, 573, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020427", "code": "def longest_consecutive_subsequence(input_list):\n    current_sequence = []\n    longest_sequence = []\n    for num in input_list:\n        if not current_sequence or num == current_sequence[-1] + 1:\n            current_sequence.append(num)\n        else:\n            if len(current_sequence) > len(longest_sequence):\n                longest_sequence = current_sequence\n            current_sequence = [num]\n    if len(current_sequence) > len(longest_sequence):\n        longest_sequence = current_sequence\n    return longest_sequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[10]", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87901_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020428", "code": "def calculate_mode(data):\n    if not data:\n        return None\n    num_count = {}\n    for num in data:\n        num_count[num] = num_count.get(num, 0) + 1\n    max_count = max(num_count.values())\n    modes = [num for num, count in num_count.items() if count == max_count]\n    if len(modes) == len(data):\n        return None\n    elif len(modes) == 1:\n        return modes[0]\n    else:\n        return modes\n", "entry_point": "calculate_mode", "input": "[1, 1, 2, 2]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122141_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020429", "code": "def count_unique_queries(search_queries):\n    unique_queries_count = {}\n    for user_id, query_text in search_queries:\n        if user_id not in unique_queries_count:\n            unique_queries_count[user_id] = set()\n        unique_queries_count[user_id].add(query_text)\n    return {user_id: len(queries) for user_id, queries in unique_queries_count.items()}\n", "entry_point": "count_unique_queries", "input": "[(4, 'search1'), (4, 'search2'), (5, 'search3')]", "output": "{4: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29638_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020430", "code": "default_build_pattern = \"(bEXP_ARCH1|bSeriesTOC)\"\ndefault_process_pattern = \"(bKBD3|bSeriesTOC)\"\noptions = None\nSRC_CODES_TO_INCLUDE_PARAS = [\"GW\", \"SE\"]\nDATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE = [\"IPL\", \"ZBK\", \"NLP\", \"SE\", \"GW\"]\ndef process_source_code(source_code):\n    include_paragraphs = source_code in SRC_CODES_TO_INCLUDE_PARAS\n    create_update_notification = source_code not in DATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE\n    return include_paragraphs, create_update_notification\n", "entry_point": "process_source_code", "input": "'IPL'", "output": "(False, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46779_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020431", "code": "def simulate_roomba(n, m, instructions):\n    cleaned_cells = set()\n    roomba_position = (0, 0)\n    cleaned_cells.add(roomba_position)\n    for instruction in instructions:\n        x, y = roomba_position\n        if instruction == 'U' and x > 0:\n            roomba_position = (x - 1, y)\n        elif instruction == 'D' and x < n - 1:\n            roomba_position = (x + 1, y)\n        elif instruction == 'L' and y > 0:\n            roomba_position = (x, y - 1)\n        elif instruction == 'R' and y < m - 1:\n            roomba_position = (x, y + 1)\n        if roomba_position not in cleaned_cells:\n            cleaned_cells.add(roomba_position)\n    return len(cleaned_cells)\n", "entry_point": "simulate_roomba", "input": "2, 2, ['R', 'D']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110772_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020432", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020433", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'AA'", "output": "['AA', 'AA']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020434", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[100, 90, 80, 80, 70, 70, 54], 7", "output": "77.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020435", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'docu2.txt'", "output": "'docu2_v1.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2353", "output": "{1, 181, 13, 2353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020437", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1814", "output": "{1, 2, 907, 1814}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1813", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020438", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 6.666666666666667, 1", "output": "7.333333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020439", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[6, 7, 2, 3, 1, 7, 3]", "output": "[6, 8, 4, 6, 5, 12, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020440", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'4123 4.56561236'", "output": "(4.56561236, 4123)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020441", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "517", "output": "{1, 11, 517, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020442", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3389", "output": "{1, 3389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020443", "code": "from typing import List, Tuple\ndef total_area(rectangles: List[Tuple[int, int, int, int]]) -> int:\n    points = set()\n    total_area = 0\n    for rect in rectangles:\n        for x in range(rect[0], rect[2]):\n            for y in range(rect[1], rect[3]):\n                if (x, y) not in points:\n                    points.add((x, y))\n                    total_area += 1\n    return total_area\n", "entry_point": "total_area", "input": "[(1, 1, 4, 3), (4, 1, 6, 4), (2, 3, 4, 4)]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139460_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020444", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'1..-example'", "output": "'1..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020445", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6313", "output": "{107, 1, 6313, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020446", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[1, 1, 10, 10, 10, 2, 3, 4, 5, 6, 7, 8, 9], 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020447", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'image.png'", "output": "'image_v1.png'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020448", "code": "from typing import List\ndef search_documents(documents: List[str], query: str) -> List[int]:\n    result = []\n    query_lower = query.lower()\n    for i, doc in enumerate(documents):\n        if query_lower in doc.lower():\n            result.append(i)\n    return result\n", "entry_point": "search_documents", "input": "[], 'any query'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4084_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020449", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "2.6, 2", "output": "6.760000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020450", "code": "def calculate_similarity_score(values, threshold, max_score):\n    counter = 0\n    for value in values:\n        if threshold <= value <= max_score:\n            counter += 1\n    similarity_score = counter / len(values) if len(values) > 0 else 0\n    return similarity_score\n", "entry_point": "calculate_similarity_score", "input": "[1.0, 2.5, 3.0, 4.5, 6.0, 7.0, 8.0, 9.0], 2, 5", "output": "0.375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115408_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020451", "code": "def calculate_total_nodes(cell_nums):\n    # Extract dimensions of cells\n    cx, cy, cz = cell_nums\n    # Calculate total number of nodes\n    total_nodes = (cx + 1) * (cy + 1) * (cz + 1)\n    return total_nodes\n", "entry_point": "calculate_total_nodes", "input": "(0, 0, 0)", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85398_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020452", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 2, 4, 2, 4, 2]", "output": "[3, 6, 6, 6, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31739_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020453", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    if trimmed_scores:\n        return sum(trimmed_scores) / len(trimmed_scores)\n    else:\n        return 0\n", "entry_point": "calculate_average", "input": "[60, 63, 65, 67, 70]", "output": "65.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124520_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020454", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "2", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020455", "code": "def convert_nodes_to_latlon(nodes):\n    latlon_nodes = {}\n    for key, value in nodes.items():\n        lat = value[1] / 1000  # Simulated latitude conversion\n        lon = value[0] / 1000  # Simulated longitude conversion\n        latlon_nodes[key] = [lat, lon]\n    return latlon_nodes\n", "entry_point": "convert_nodes_to_latlon", "input": "{1: [2, 400], 2: [2, 400]}", "output": "{1: [0.4, 0.002], 2: [0.4, 0.002]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92519_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020456", "code": "import os\ndef expanduser(path):\n    \"\"\"\n    Expand ~ and ~user constructions.\n    Includes a workaround for http://bugs.python.org/issue14768\n    \"\"\"\n    expanded = os.path.expanduser(path)\n    if path.startswith(\"~/\") and expanded.startswith(\"//\"):\n        expanded = expanded[1:]\n    return expanded\n", "entry_point": "expanduser", "input": "'~jinjun/folderseents'", "output": "'~jinjun/folderseents'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6640_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020457", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[219]", "output": "2628", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020458", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020459", "code": "def manipulate_string(input_string: str) -> str:\n    # Step 1: Reverse the input string\n    reversed_string = input_string[::-1]\n    # Step 2: Capitalize the first letter of the reversed string\n    capitalized_string = reversed_string.capitalize()\n    # Step 3: Append the length of the original string\n    final_output = capitalized_string + str(len(input_string))\n    return final_output\n", "entry_point": "manipulate_string", "input": "'eo'", "output": "'Oe2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1099_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020460", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5017", "output": "{1, 5017, 29, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020461", "code": "def max_area(walls):\n    max_area = 0\n    left = 0\n    right = len(walls) - 1\n    while left < right:\n        width = right - left\n        height = min(walls[left], walls[right])\n        area = width * height\n        max_area = max(max_area, area)\n        if walls[left] < walls[right]:\n            left += 1\n        else:\n            right -= 1\n    return max_area\n", "entry_point": "max_area", "input": "[3, 2, 1, 4, 3]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100123_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020462", "code": "def max_distance(red_points, blue_points):\n    max_sum = 0\n    for red in red_points:\n        for blue in blue_points:\n            distance = abs(red - blue)\n            max_sum = max(max_sum, distance)\n    return max_sum\n", "entry_point": "max_distance", "input": "[0], [14]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25133_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020463", "code": "def parse_inventory_data(data: str) -> dict:\n    inventory_dict = {}\n    pairs = data.split(',')\n    for pair in pairs:\n        try:\n            key, value = pair.split(':')\n            key = key.strip()\n            value = value.strip()\n            if value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            elif value.isdigit():\n                value = int(value)\n            inventory_dict[key] = value\n        except (ValueError, AttributeError):\n            # Handle parsing errors by skipping the current pair\n            pass\n    return inventory_dict\n", "entry_point": "parse_inventory_data", "input": "'is_active: Tru'", "output": "{'is_active': 'Tru'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83492_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020464", "code": "import itertools\ndef generate_combinations(list1, list2):\n    return list(itertools.product(list1, list2))\n", "entry_point": "generate_combinations", "input": "[1, 2], ['A', 'B']", "output": "[(1, 'A'), (1, 'B'), (2, 'A'), (2, 'B')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19360_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "297", "output": "{1, 33, 99, 3, 9, 297, 11, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020466", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5443", "output": "{1, 5443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020467", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'aa'", "output": "'a2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020468", "code": "def calculate_score(cards):\n    total_score = 0\n    ace_count = 0\n    for card in cards:\n        if card in ['J', 'Q', 'K']:\n            total_score += 10\n        elif card == 'A':\n            ace_count += 1\n        else:\n            total_score += card\n    for _ in range(ace_count):\n        if total_score + 11 <= 21:\n            total_score += 11\n        else:\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "[10, 10, 10, 10, 10, 10]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116780_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020469", "code": "# Create a dictionary mapping command names to their hexadecimal values\ncommand_map = {\n    \"RDDSDR\": 0x0f,\n    \"SLPOUT\": 0x11,\n    \"GAMSET\": 0x26,\n    \"DISPOFF\": 0x28,\n    \"DISPON\": 0x29,\n    \"CASET\": 0x2a,\n    \"PASET\": 0x2b,\n    \"RAMWR\": 0x2c,\n    \"RAMRD\": 0x2e,\n    \"MADCTL\": 0x36,\n    \"VSCRSADD\": 0x37,\n    \"PIXSET\": 0x3a,\n    \"PWCTRLA\": 0xcb,\n    \"PWCRTLB\": 0xcf,\n    \"DTCTRLA\": 0xe8\n}\ndef get_command_value(command):\n    return command_map.get(command, None)\n", "entry_point": "get_command_value", "input": "'GAMSET'", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13569_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020470", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1024", "output": "{1024, 1, 2, 512, 4, 256, 128, 64, 8, 32, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1023", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020471", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1423", "output": "{1, 1423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020472", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'Python programming is fun'", "output": "['Python', 'programming', 'is', 'fun']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020473", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "2147483647, 1", "output": "2147483647", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020474", "code": "def parse_config_file(config_data: str) -> dict:\n    config_dict = {}\n    for line in config_data.split('\\n'):\n        line = line.strip()\n        if line and not line.startswith('#'):\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip()\n    return config_dict\n", "entry_point": "parse_config_file", "input": "'# This is a comment\\nDB_HOST=127.0.0.1\\n'", "output": "{'DB_HOST': '127.0.0.1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101724_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020475", "code": "def populate_rois_lod(rois):\n    rois_lod = [[]]  # Initialize with an empty sublist\n    for element in rois:\n        if isinstance(element, int):\n            rois_lod[-1].append(element)  # Add integer to the last sublist\n        elif isinstance(element, list):\n            rois_lod.append(element.copy())  # Create a new sublist with elements of the list\n    return rois_lod\n", "entry_point": "populate_rois_lod", "input": "[3, 5, 4, 2, [2, 3, 4, 2, 2]]", "output": "[[3, 5, 4, 2], [2, 3, 4, 2, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2890_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020476", "code": "from typing import List\ndef fast_moving_average(data: List[float], num_intervals: int) -> List[float]:\n    if len(data) < num_intervals:\n        return []\n    interval_size = len(data) // num_intervals\n    moving_avg = []\n    for i in range(num_intervals):\n        start = i * interval_size\n        end = start + interval_size if i < num_intervals - 1 else len(data)\n        interval_data = data[start:end]\n        avg = sum(interval_data) / len(interval_data) if interval_data else 0\n        moving_avg.append(avg)\n    return moving_avg\n", "entry_point": "fast_moving_average", "input": "[7.5], 1", "output": "[7.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98561_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020477", "code": "from typing import List\ndef find_min_abs_difference_pairs(arr: List[int]) -> List[List[int]]:\n    arr.sort()\n    min_diff = min(arr[i] - arr[i - 1] for i in range(1, len(arr)))\n    min_pairs = [[arr[i - 1], arr[i]] for i in range(1, len(arr)) if arr[i] - arr[i - 1] == min_diff]\n    return min_pairs\n", "entry_point": "find_min_abs_difference_pairs", "input": "[1, 1, 4, 4, 5, 5, 5]", "output": "[[1, 1], [4, 4], [5, 5], [5, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128793_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020478", "code": "from typing import List\ndef calculate_score(deck: List[int]) -> int:\n    score = 0\n    prev_card = None\n    for card in deck:\n        if card == prev_card:\n            score = 0\n        else:\n            score += card\n        prev_card = card\n    return score\n", "entry_point": "calculate_score", "input": "[34, 35]", "output": "69", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020479", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[7, 15]", "output": "[7, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020480", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'5h'", "output": "18000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5492", "output": "{1, 2, 4, 5492, 2746, 1373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5491", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020482", "code": "def has_permission_to_add_link(user_permissions: list) -> bool:\n    return 'write' in user_permissions\n", "entry_point": "has_permission_to_add_link", "input": "['read', 'delete']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28898_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020483", "code": "from typing import List\ndef remove_row_col(matrix: List[List[float]], row: int, col: int) -> List[List[float]]:\n    if len(matrix) != len(matrix[0]):\n        raise ValueError(\"Input matrix must be a square matrix\")\n    # Remove specified row\n    matrix.pop(row)\n    # Remove specified column\n    for row in matrix:\n        del row[col]\n    return matrix\n", "entry_point": "remove_row_col", "input": "[[2.0, 3.0], [4.0, 5.0]], 0, 1", "output": "[[4.0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10474_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020484", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'This'", "output": "('', 'This')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1964", "output": "{1, 2, 4, 491, 1964, 982}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1963", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020486", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[3, 6, 1, 1, 2, 2, 4, 4]", "output": "(3, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020487", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2369", "output": "{2369, 1, 103, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020488", "code": "def count_e_letters(input_string):\n    count = 0\n    lowercase_input = input_string.lower()\n    for char in lowercase_input:\n        if char == 'e' or char == '\u00e9':\n            count += 1\n    return count\n", "entry_point": "count_e_letters", "input": "'eeeeee'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15839_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020489", "code": "def find_nth_fibonacci(first, second, n):\n    if n == 1:\n        return first\n    elif n == 2:\n        return second\n    else:\n        for i in range(n - 2):\n            next_num = first + second\n            first, second = second, next_num\n        return next_num\n", "entry_point": "find_nth_fibonacci", "input": "100, 154, 3", "output": "254", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81618_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020490", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4168", "output": "{1, 2, 2084, 4, 4168, 8, 521, 1042}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4167", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020491", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[100, 100, 85, 81, 57]", "output": "84.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020492", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'examxample.jpgag'", "output": "'xample.jpgag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020493", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'U'", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4701", "output": "{1, 3, 4701, 1567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020495", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "9, 7", "output": "1.285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020496", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2118", "output": "{1, 2, 3, 1059, 706, 2118, 6, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020497", "code": "from collections import Counter\ndef task_scheduler(tasks, n):\n    task_freq = Counter(tasks)\n    max_freq = max(task_freq.values())\n    idle_time = (max_freq - 1) * n\n    for task, freq in task_freq.items():\n        idle_time -= min(freq, max_freq - 1)\n    idle_time = max(0, idle_time)\n    return len(tasks) + idle_time\n", "entry_point": "task_scheduler", "input": "['A', 'A', 'A', 'B', 'C'], 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48302_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020498", "code": "def count_unique_subjects(timetable):\n    unique_subjects = set()\n    for subjects in timetable.values():\n        unique_subjects.update(subjects)\n    return len(unique_subjects)\n", "entry_point": "count_unique_subjects", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14089_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020499", "code": "def min_changes_to_alternate(s):\n    one = 0\n    zero = 0\n    for i in range(len(s)):\n        if i > 0 and s[i] == s[i-1]:\n            continue\n        if s[i] == \"1\":\n            one += 1\n        else:\n            zero += 1\n    return min(one, zero)\n", "entry_point": "min_changes_to_alternate", "input": "'010101010101'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53461_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020500", "code": "def parse_dependencies(input_list):\n    dependencies_dict = {}\n    for item in input_list:\n        package, dependencies = item.split(':')\n        dependencies_dict[package] = dependencies.split(',')\n    return dependencies_dict\n", "entry_point": "parse_dependencies", "input": "['cart:pandsspanmpy']", "output": "{'cart': ['pandsspanmpy']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148061_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020501", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, -19.760479041916167", "output": "-19.760479041916167", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020502", "code": "def extract_message_info(messages):\n    extracted_info = {}\n    for message in messages:\n        key, value = message.split('=')\n        key = key.strip()\n        value = value.strip().strip(\"'\")  # Remove leading/trailing spaces and single quotes\n        if key in extracted_info:\n            extracted_info[key].append(value)\n        else:\n            extracted_info[key] = [value]\n    return extracted_info\n", "entry_point": "extract_message_info", "input": "[\"cmd = 'ls'l'\", \"cmd = 'lsl'\"]", "output": "{'cmd': [\"ls'l\", 'lsl']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110998_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020503", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7849", "output": "{1, 7849, 167, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020504", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[5, 0, 0, 16, 4, 5, 15, 10]", "output": "[5, 10, 30, 16, 4, 5, 15, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020505", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3668", "output": "'1 hr 1 min 8 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020506", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[1, 2, 3, 2, 2, 4, 2, 3]", "output": "[3, 5, 5, 4, 6, 6, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117452_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020507", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1500", "output": "1460", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9203", "output": "{1, 9203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020509", "code": "import ast\ndef transform_input_to_eval(code):\n    # Parse the code snippet into an Abstract Syntax Tree (AST)\n    tree = ast.parse(code)\n    # Function to recursively traverse the AST and make the required changes\n    def transform_node(node):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'input':\n            # Replace input(...) with eval(input(...))\n            node.func = ast.Attribute(value=ast.Name(id='eval', ctx=ast.Load()), attr='input', ctx=ast.Load())\n        for child_node in ast.iter_child_nodes(node):\n            transform_node(child_node)\n    # Apply the transformation to the AST\n    transform_node(tree)\n    # Generate the modified code snippet from the transformed AST\n    modified_code = ast.unparse(tree)\n    return modified_code\n", "entry_point": "transform_input_to_eval", "input": "'x'", "output": "'x'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68294_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020510", "code": "def combinationSum(candidates, target):\n    candidates.sort()\n    result = []\n    def combsum(candidates, target, start, path):\n        if target == 0:\n            result.append(path)\n            return\n        for i in range(start, len(candidates)):\n            if candidates[i] > target:\n                break\n            combsum(candidates, target - candidates[i], i, path + [candidates[i]])\n    combsum(candidates, target, 0, [])\n    return result\n", "entry_point": "combinationSum", "input": "[3, 6], 6", "output": "[[3, 3], [6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38211_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2837", "output": "{1, 2837}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020512", "code": "def simulate_dominoes_fall(dominoes):\n    dominoes = 'L' + dominoes + 'R'\n    ans = []\n    l = 0\n    for r in range(1, len(dominoes)):\n        if dominoes[r] == '.':\n            continue\n        cnt = r - l - 1\n        if l > 0:\n            ans.append(dominoes[l])\n        if dominoes[l] == dominoes[r]:\n            ans.append(dominoes[l] * cnt)\n        elif dominoes[l] == 'L' and dominoes[r] == 'R':\n            ans.append('.' * cnt)\n        else:\n            ans.append('R' * (cnt // 2) + '.' * (cnt % 2) + 'L' * (cnt // 2))\n        l = r\n    return ''.join(ans)\n", "entry_point": "simulate_dominoes_fall", "input": "'RRRR'", "output": "'RRRR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25847_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020513", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[4, 3, 2, 1, 4, 4, 3, 3, 4]", "output": "[4, 4, 4, 4, 8, 9, 9, 10, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020514", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[10, 8, 6, 2, 1, 3, 5]", "output": "[10, 8, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020515", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "21, 42", "output": "882", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020516", "code": "def generate_message_type(protocol: str, version: str, message_type: str) -> str:\n    return f\"{protocol}/{version}/{message_type}\"\n", "entry_point": "generate_message_type", "input": "'revocatrevocaton', '1111.1.00', 'reve'", "output": "'revocatrevocaton/1111.1.00/reve'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020517", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[70, 90, 60, 85, 50, 95], 3", "output": "[5, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020518", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[4, 5]", "output": "[4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020519", "code": "def calculate_mean_median(numbers):\n    # Calculate the mean\n    mean = sum(numbers) / len(numbers)\n    # Sort the list to find the median\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:\n        # If the list has an even number of elements\n        median = (sorted_numbers[n // 2 - 1] + sorted_numbers[n // 2]) / 2\n    else:\n        # If the list has an odd number of elements\n        median = sorted_numbers[n // 2]\n    return mean, median\n", "entry_point": "calculate_mean_median", "input": "[3.0, 3.0, 3.0, 3.0]", "output": "(3.0, 3.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51463_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020520", "code": "def get_aquarium_light_color(aquarium_id):\n    aquarium_data = {\n        1: {'default_mode': 'red', 'total_food_quantity': 50},\n        2: {'default_mode': 'blue', 'total_food_quantity': 30},\n        3: {'default_mode': 'green', 'total_food_quantity': 70}\n    }\n    if aquarium_id not in aquarium_data:\n        return 'Unknown'\n    default_mode = aquarium_data[aquarium_id]['default_mode']\n    total_food_quantity = aquarium_data[aquarium_id]['total_food_quantity']\n    if default_mode == 'red' and total_food_quantity < 40:\n        return 'dim red'\n    elif default_mode == 'blue' and total_food_quantity >= 50:\n        return 'bright blue'\n    elif default_mode == 'green':\n        return 'green'\n    else:\n        return default_mode\n", "entry_point": "get_aquarium_light_color", "input": "2", "output": "'blue'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20096_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020521", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[2, 1, 0]", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020522", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "15", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020523", "code": "def op(image):\n    # Assuming image is represented as a list of RGB values for each pixel\n    # Convert RGB to grayscale by averaging the RGB values\n    grayscale_image = [(pixel[0] + pixel[1] + pixel[2]) // 3 for pixel in image]\n    return grayscale_image\n", "entry_point": "op", "input": "[(150, 150, 150), (75, 75, 75), (37, 37, 37)]", "output": "[150, 75, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48312_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020524", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'1011011'", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020525", "code": "def rank_scores(scores):\n    score_counts = {}\n    for score in scores:\n        score_counts[score] = score_counts.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    ranks = {}\n    rank = 1\n    for score in unique_scores:\n        count = score_counts[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "rank_scores", "input": "[80, 50, 60, 90, 100, 50, 70, 50]", "output": "[3, 6, 5, 2, 1, 6, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135203_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020526", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'Bone'", "output": "'bone.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020527", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'2.10.5'", "output": "'2.10.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020528", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6543", "output": "{1, 3, 2181, 9, 6543, 727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3698", "output": "{1, 2, 43, 3698, 86, 1849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3697", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020530", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    num_rounds = min(len(player1_deck), len(player2_deck))\n    for round_num in range(num_rounds):\n        if player1_deck[round_num] > player2_deck[round_num]:\n            player1_score += 1\n        else:\n            player2_score += 1\n    return player1_score, player2_score\n", "entry_point": "simulate_card_game", "input": "[2, 1, 1, 1, 1, 1, 1, 1], [1, 3, 4, 5, 6, 7, 8, 9]", "output": "(1, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38237_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020531", "code": "def control_flow_replica(x):\n    if x < 0:\n        if x < -10:\n            return x * 2\n        else:\n            return x * 3\n    else:\n        if x > 10:\n            return x * 4\n        else:\n            return x * 5\n", "entry_point": "control_flow_replica", "input": "6", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17276_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020532", "code": "def extract_verbose_name(class_name: str) -> str:\n    # Split the class name based on uppercase letters\n    words = [char if char.isupper() else ' ' + char for char in class_name]\n    verbose_name = ''.join(words).strip()\n    # Convert the verbose name to the desired format\n    verbose_name = verbose_name.replace('Config', '').replace('ADM', ' \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0414\u0435\u0434\u043e\u0432 \u041c\u043e\u0440\u043e\u0437\u043e\u0432')\n    return verbose_name\n", "entry_point": "extract_verbose_name", "input": "'Clufig'", "output": "'C l u f i g'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42194_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9921", "output": "{1, 3, 9921, 3307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9920", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020534", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3583", "output": "{1, 3583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4793", "output": "{1, 4793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020536", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[90, 60, 70, 100, 80, 70, 70, 60, 70]", "output": "[2, 8, 4, 1, 3, 4, 4, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020537", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'# '", "output": "'<h1></h1>\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020538", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[80, 80]", "output": "160.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020539", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[2, 4, 6, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020540", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[10, 5, 9, 3], 24", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020541", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[4, 4, 4, 6, 8, 8, 8, 7, 7]", "output": "[8, 8, 8, 12, 16, 16, 16, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020542", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'thisIsCamelCased'", "output": "'this_is_camel_cased'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020543", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2915", "output": "{1, 2915, 5, 583, 265, 11, 53, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2914", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020544", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(1, 8, 5)", "output": "'1.8.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020545", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "0, 1, 'fofooofo'", "output": "{'fofooofo': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020546", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3674", "output": "{1, 2, 167, 11, 1837, 334, 22, 3674}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020547", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "11, 31", "output": "[11, 13, 17, 19, 23, 29, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020548", "code": "def filter_document_types(document_types, target_attribute, target_value):\n    filtered_list = [doc for doc in document_types if doc.get(target_attribute) == target_value]\n    return filtered_list\n", "entry_point": "filter_document_types", "input": "[], 'type', 'report'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138040_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020549", "code": "def substitute_inputs(org_dag, op_map):\n    new_dag = {}\n    for op in org_dag:\n        if op in op_map:\n            new_dag[op] = op_map[op]\n        else:\n            new_dag[op] = org_dag[op]\n    return new_dag\n", "entry_point": "substitute_inputs", "input": "{}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85053_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020550", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "633", "output": "{1, 3, 633, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt632", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020551", "code": "def process_list(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            processed_list.append(num)\n        else:\n            processed_list.append(num ** 2)  # Square the number if it's odd\n    processed_list.sort()  # Sort the processed list in ascending order\n    return processed_list\n", "entry_point": "process_list", "input": "[6, 6, 6, 8, 8, 12, 12]", "output": "[6, 6, 6, 8, 8, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111268_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3361", "output": "{1, 3361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020553", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "',WHlo,,', ','", "output": "',WHlo,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020554", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "' Pyth '", "output": "'pyth_4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020555", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2179", "output": "{1, 2179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020556", "code": "from typing import List\ndef calculate_moving_average(numbers: List[float], window_size: int) -> List[float]:\n    moving_averages = []\n    for i in range(len(numbers) - window_size + 1):\n        window_sum = sum(numbers[i:i+window_size])\n        window_avg = window_sum / window_size\n        moving_averages.append(window_avg)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[82.55555555555556], 1", "output": "[82.55555555555556]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33913_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6376", "output": "{1, 2, 4, 6376, 8, 3188, 1594, 797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020558", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'attnaatacanataaternal/xyzy'", "output": "'attnaatacanataaternal/xyzy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020559", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7793", "output": "{1, 7793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020560", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454397", "output": "'<t:1630454397>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020561", "code": "def extract_comments_from_script(script):\n    comments = []\n    for line in script.split('\\n'):\n        line = line.strip()\n        if line.startswith('#'):\n            comments.append(line)\n    return comments\n", "entry_point": "extract_comments_from_script", "input": "'    ###iss'", "output": "['###iss']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99748_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020562", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3207", "output": "{1, 3, 1069, 3207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020563", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        if not char.isspace():\n            char = char.lower()\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'This'", "output": "{'t': 1, 'h': 1, 'i': 1, 's': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36956_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020564", "code": "from typing import List\ndef calculate_average_test_score(test_scores: List[int]) -> int:\n    total_score = 0\n    for score in test_scores:\n        total_score += score\n    average = total_score / len(test_scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_test_score", "input": "[83]", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87338_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020565", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "256", "output": "{256, 1, 2, 128, 4, 64, 32, 8, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt255", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020566", "code": "def find_common_characters(primeira, segunda):\n    terceira = \"\"\n    for letra in primeira:\n        if letra in segunda and letra not in terceira:\n            terceira += letra\n    return terceira if terceira else \"Caracteres comuns n\u00e3o encontrados.\"\n", "entry_point": "find_common_characters", "input": "'abc', 'xyz'", "output": "'Caracteres comuns n\u00e3o encontrados.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34861_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020567", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[4, 1, 5, 8, 3, 7, 2, 5], 8", "output": "[[4, 1, 5, 8, 3, 7, 2, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020568", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8867", "output": "{1, 8867}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020569", "code": "def find_zero_sign_change(coefficients):\n    zero_loc = []\n    prev_sign = None\n    for i in range(len(coefficients)):\n        if coefficients[i] == 0:\n            zero_loc.append(i)\n        elif prev_sign is not None and coefficients[i] * prev_sign < 0:\n            zero_loc.append(i)\n        if coefficients[i] != 0:\n            prev_sign = 1 if coefficients[i] > 0 else -1\n    return zero_loc\n", "entry_point": "find_zero_sign_change", "input": "[1, -1, 0, 2, -2]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140511_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020570", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[10, 6]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38745_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020571", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[3, 9, 10, 27, 38, 43, 82]", "output": "[3, 9, 10, 27, 38, 43, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020572", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7121", "output": "{1, 7121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020573", "code": "SCRABBLE_LETTER_VALUES = {\n    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8,\n    'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1,\n    'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10\n}\ndef calculate_word_score(word, n):\n    if len(word) == 0:\n        return 0\n    wordScore = 0\n    lettersUsed = 0\n    for theLetter in word:\n        wordScore += SCRABBLE_LETTER_VALUES[theLetter]\n        lettersUsed += 1\n    wordScore *= lettersUsed\n    if lettersUsed == n:\n        wordScore += 50\n    return wordScore\n", "entry_point": "calculate_word_score", "input": "'competitive', 10", "output": "220", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38596_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020574", "code": "def calculate_information_measures(measure_names):\n    measures = {}\n    for measure_name in measure_names:\n        try:\n            if measure_name == 'Cumulative Residual Entropy':\n                from .cumulative_residual_entropy import cumulative_residual_entropy\n                measures[measure_name] = cumulative_residual_entropy()\n            elif measure_name == 'Extropy':\n                from .extropy import extropy\n                measures[measure_name] = extropy()\n            elif measure_name == 'Perplexity':\n                from .perplexity import perplexity\n                measures[measure_name] = perplexity()\n            elif measure_name == 'Renyi Entropy':\n                from .renyi_entropy import renyi_entropy\n                measures[measure_name] = renyi_entropy()\n            elif measure_name == 'Tsallis Entropy':\n                from .tsallis_entropy import tsallis_entropy\n                measures[measure_name] = tsallis_entropy()\n            else:\n                measures[measure_name] = \"Measure not found\"\n        except ImportError:\n            measures[measure_name] = \"Module not found\"\n    return measures\n", "entry_point": "calculate_information_measures", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43816_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2221", "output": "{1, 2221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020576", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'writing'", "output": "'writing'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020577", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "7", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020578", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return average\n", "entry_point": "calculate_average", "input": "[75, 80, 81, 84, 90]", "output": "81.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143755_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020579", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "9, 7", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020580", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'https://example.com/1', 'devices'", "output": "'https://example.com/1/devices'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020581", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'Alic', '2023 Presidential Election'", "output": "'Sample Election: Alic'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020582", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'listchartsconifllit'", "output": "'listchartsconifllit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020583", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[10, 2, 0], [0, 0, 0]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020584", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0, 22, 24, 60, 65, 67'", "output": "[0, 22, 24, 60, 65, 67]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020585", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'eileeeLaidi', 12", "output": "['eileeeLaidi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020586", "code": "def classify_superheroes(powers):\n    good_superheroes = []\n    evil_superheroes = []\n    total_good_power = 0\n    total_evil_power = 0\n    for power in powers:\n        if power > 0:\n            good_superheroes.append(power)\n            total_good_power += power\n        else:\n            evil_superheroes.append(power)\n            total_evil_power += power\n    return good_superheroes, evil_superheroes, total_good_power, total_evil_power\n", "entry_point": "classify_superheroes", "input": "[10, 5, 10, -15, -16, -6, 0]", "output": "([10, 5, 10], [-15, -16, -6, 0], 25, -37)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7614_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020587", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{ apple , banana , cherry }'", "output": "['apple', 'banana', 'cherry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020588", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['10 + 5', '6 * 2', '1 * 1']", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020589", "code": "def pack_subtasks(subtasks, bin_capacity):\n    bins = 0\n    current_bin_weight = 0\n    remaining_capacity = bin_capacity\n    for subtask in subtasks:\n        if subtask > bin_capacity:\n            bins += 1\n            current_bin_weight = 0\n            remaining_capacity = bin_capacity\n        if subtask <= remaining_capacity:\n            current_bin_weight += subtask\n            remaining_capacity -= subtask\n        else:\n            bins += 1\n            current_bin_weight = subtask\n            remaining_capacity = bin_capacity - subtask\n    if current_bin_weight > 0:\n        bins += 1\n    return bins\n", "entry_point": "pack_subtasks", "input": "[2, 2, 1, 3], 5", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28590_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020590", "code": "def calculate_values(lat_interval, lon_interval):\n    lat = (lat_interval[0] + lat_interval[1]) / 2\n    lon = (lon_interval[0] + lon_interval[1]) / 2\n    lat_err = abs(lat_interval[1] - lat_interval[0]) / 2\n    lon_err = abs(lon_interval[1] - lon_interval[0]) / 2\n    return lat, lon, lat_err, lon_err\n", "entry_point": "calculate_values", "input": "(30.0, 40.0), (120.0, 130.0)", "output": "(35.0, 125.0, 5.0, 5.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82906_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9393", "output": "{1, 3, 101, 303, 9393, 3131, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020592", "code": "def checkIfWin(board):\n    for i in range(0, len(board)):\n        if board[i][0] == board[i][1] == board[i][2] and board[i][0] != 0:\n            return board[i][0]\n        elif board[0][i] == board[1][i] == board[2][i] and board[0][i] != 0:\n            return board[0][i]\n    if board[0][0] == board[1][1] == board[2][2] and board[0][0] != 0:\n        return board[0][0]\n    elif board[0][2] == board[1][1] == board[2][0] and board[0][2] != 0:\n        return board[0][2]\n    return 0\n", "entry_point": "checkIfWin", "input": "[[1, 1, 1], [0, 0, 0], [0, 0, 0]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36840_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020593", "code": "def check_gateways(gateways, threshold):\n    online_gateways = sum(gateway[\"status\"] for gateway in gateways)\n    return online_gateways >= threshold\n", "entry_point": "check_gateways", "input": "[{'status': 1}, {'status': 0}, {'status': 0}], 3", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11219_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020594", "code": "_Stop = 5\n_Access = 9  \n_Controllers = 11  \n_Frame = 13  \n_Scanline = 15  \n_ScanlineCycle = 17  \n_SpriteZero = 19\n_Status = 21\n_EVENT_TYPES = [ _Stop, _Access, _Controllers, _Frame, _Scanline, _ScanlineCycle, _SpriteZero, _Status ]\ndef map_event_types_to_values(event_types):\n    event_type_mapping = {\n        '_Stop': _Stop,\n        '_Access': _Access,\n        '_Controllers': _Controllers,\n        '_Frame': _Frame,\n        '_Scanline': _Scanline,\n        '_ScanlineCycle': _ScanlineCycle,\n        '_SpriteZero': _SpriteZero,\n        '_Status': _Status\n    }\n    return {event_type: event_type_mapping[event_type] for event_type in event_types if event_type in event_type_mapping}\n", "entry_point": "map_event_types_to_values", "input": "['_Stop', '_Access', '_Frame']", "output": "{'_Stop': 5, '_Access': 9, '_Frame': 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101264_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020595", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "-3", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020596", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'programming'", "output": "'programming'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020597", "code": "import socket\ndef get_domain_name(ip_address):\n    try:\n        result = socket.gethostbyaddr(ip_address)\n        return list(result)[0]\n    except socket.herror:\n        return \"Domain name not found\"\n", "entry_point": "get_domain_name", "input": "'172.8.0.3'", "output": "'adsl-172-8-0-3.dsl.tpk2ks.sbcglobal.net'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122690_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9526", "output": "{1, 2, 866, 11, 433, 9526, 22, 4763}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020599", "code": "def sum_of_squares(nums: list[int]) -> int:\n    \"\"\"\n    Calculate the sum of squares of integers in the input list.\n    Args:\n    nums: A list of integers.\n    Returns:\n    The sum of the squares of the integers in the input list.\n    \"\"\"\n    return sum(num**2 for num in nums)\n", "entry_point": "sum_of_squares", "input": "[1, 2, 3, 4, 5]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57390_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020600", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'1:200:05 AM'", "output": "'01:200:05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020601", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'Hello Hello\\nworld world world'", "output": "{'world': 3, 'Hello': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020602", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'2.12.131..'", "output": "'2.12.131..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020603", "code": "def extract_x_coordinates(player_positions):\n    x_coordinates = []\n    for player in player_positions:\n        x_coordinates.append(player[0])\n    return x_coordinates\n", "entry_point": "extract_x_coordinates", "input": "[(2, 5), (2, 3), (6, 7)]", "output": "[2, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37716_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020604", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[0, -1, 13, 1, 6, 3, 1, 3]", "output": "[0, -1, 13, 1, 6, 3, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020605", "code": "def calculate_total_size_in_kb(file_sizes):\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "calculate_total_size_in_kb", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119982_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "245", "output": "{1, 35, 5, 7, 49, 245}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020607", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[4, -1, 3, 2, 1]", "output": "[3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020608", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[98, 95, 90, 85, 80]", "output": "[98, 95, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020609", "code": "def escape_html_tags(input_str: str) -> str:\n    escaped_str = \"\"\n    inside_tag = False\n    for char in input_str:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n        if inside_tag and (char == '<' or char == '>'):\n            escaped_str += f\"&lt;\" if char == '<' else \"&gt;\"\n        else:\n            escaped_str += char\n    return escaped_str\n", "entry_point": "escape_html_tags", "input": "'div>><dcapvv'", "output": "'div>>&lt;dcapvv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110429_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020610", "code": "def calculate_total_pages(data_count: int, page_size: int) -> int:\n    total_pages = data_count // page_size\n    if data_count % page_size != 0:\n        total_pages += 1\n    return total_pages\n", "entry_point": "calculate_total_pages", "input": "7, 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125536_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020611", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'22.25.121'", "output": "(22, 25, 121)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020612", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v1..00'", "output": "'1..00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020613", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "741", "output": "{1, 3, 741, 39, 13, 19, 247, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020614", "code": "def process_numbers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            num += 3\n        else:\n            num *= 2\n        if num % 5 == 0:\n            num -= 7\n        if num < 0:\n            num = abs(num)\n        processed_list.append(num)\n    return processed_list\n", "entry_point": "process_numbers", "input": "[2, 2, 3, 4, 5, 6]", "output": "[2, 2, 6, 7, 3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27256_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020615", "code": "def sum_of_squares_of_even_numbers(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108721_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020616", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[-1, 4, 3, 2]", "output": "[3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020617", "code": "def radix_sort(array):\n    base = 10  # Base 10 for decimal integers\n    max_val = max(array)\n    col = 0\n    while max_val // 10 ** col > 0:\n        count_array = [0] * base\n        position = [0] * base\n        output = [0] * len(array)\n        for elem in array:\n            digit = elem // 10 ** col\n            count_array[digit % base] += 1\n        position[0] = 0\n        for i in range(1, base):\n            position[i] = position[i - 1] + count_array[i - 1]\n        for elem in array:\n            output[position[elem // 10 ** col % base]] = elem\n            position[elem // 10 ** col % base] += 1\n        array = output\n        col += 1\n    return output\n", "entry_point": "radix_sort", "input": "[2, 2, 24, 75, 89, 90, 169, 800, 801]", "output": "[2, 2, 24, 75, 89, 90, 169, 800, 801]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60721_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5549", "output": "{1, 179, 5549, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020619", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3659", "output": "'01:00:59'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020620", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[2, 3, 5, 7, 8]", "output": "[4, 9, 16, 25, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020621", "code": "def calculate_polygon_area(vertices):\n    def shoelace_formula(vertices):\n        n = len(vertices)\n        area = 0.0\n        for i in range(n):\n            j = (i + 1) % n\n            area += vertices[i][0] * vertices[j][1] - vertices[j][0] * vertices[i][1]\n        return abs(area) / 2.0\n    if len(vertices) < 3:\n        raise InvalidPolygonError(\"A polygon must have at least 3 vertices!\")\n    return shoelace_formula(vertices)\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (1, 0), (1, 1), (0, 1)]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133384_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020622", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'11:01:03 PM'", "output": "'23:01:03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020623", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "'OvereOvThe'", "output": "['OvereOvThe']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020624", "code": "def filter_asf_catalog(catalog_entries, platform, start_date):\n    filtered_entries = []\n    for entry in catalog_entries:\n        if entry['platform'] == platform and entry['start_date'] >= start_date:\n            filtered_entries.append(entry)\n    return filtered_entries\n", "entry_point": "filter_asf_catalog", "input": "[], 'example_platform', '2022-01-01'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52423_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9881", "output": "{1, 9881, 241, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7874", "output": "{1, 7874, 2, 3937, 62, 127, 254, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4155", "output": "{1, 3, 5, 1385, 15, 277, 4155, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020628", "code": "import re\ndef remove_color_codes(text):\n    return re.sub('(\u00a7[0-9a-f])', '', text)\n", "entry_point": "remove_color_codes", "input": "'\u00a71TiiH'", "output": "'TiiH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50171_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020629", "code": "def general_convert_time(_time, to_places=2) -> str:\n    \"\"\"\n    Used to get a more readable time conversion\n    \"\"\"\n    def convert_time(_time):\n        # Placeholder for the convert_time function logic\n        return \"12 hours 30 minutes 45 seconds\"  # Placeholder return for testing\n    times = convert_time(_time).split(' ')\n    selected_times = times[:to_places]\n    if len(times) > to_places:\n        return ' '.join(selected_times) + (', ' if len(times) > to_places * 2 else '') + ' '.join(times[to_places:])\n    else:\n        return ' '.join(selected_times)\n", "entry_point": "general_convert_time", "input": "0", "output": "'12 hours, 30 minutes 45 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119806_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020630", "code": "def count_ways_to_climb_stairs(n):\n    if n == 0 or n == 1:\n        return 1\n    ways = [0] * (n + 1)\n    ways[0] = 1\n    ways[1] = 1\n    for i in range(2, n + 1):\n        ways[i] = ways[i - 1] + ways[i - 2]\n    return ways[n]\n", "entry_point": "count_ways_to_climb_stairs", "input": "10", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29461_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020631", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'nadine.NadineConfig'", "output": "('nadine', 'NadineConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "761", "output": "{1, 761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020633", "code": "def decode_order_type(order_type):\n    order_descriptions = {\n        '6': 'Last Plus Two',\n        '7': 'Last Plus Three',\n        '8': 'Sell1',\n        '9': 'Sell1 Plus One',\n        'A': 'Sell1 Plus Two',\n        'B': 'Sell1 Plus Three',\n        'C': 'Buy1',\n        'D': 'Buy1 Plus One',\n        'E': 'Buy1 Plus Two',\n        'F': 'Buy1 Plus Three',\n        'G': 'Five Level',\n        '0': 'Buy',\n        '1': 'Sell',\n        '0': 'Insert',\n        '1': 'Cancel'\n    }\n    price_type = order_type[0]\n    direction = order_type[1]\n    submit_status = order_type[2]\n    description = order_descriptions.get(price_type, 'Unknown') + ' ' + order_descriptions.get(direction, 'Unknown') + ' ' + order_descriptions.get(submit_status, 'Unknown')\n    return description\n", "entry_point": "decode_order_type", "input": "'C9F'", "output": "'Buy1 Sell1 Plus One Buy1 Plus Three'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95855_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7594", "output": "{1, 7594, 2, 3797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020635", "code": "def calculate_min_payment(balance, annualInterestRate):\n    totalMonths = 12\n    initialBalance = balance\n    monthlyPaymentRate = 0\n    monthlyInterestRate = annualInterestRate / totalMonths\n    while balance > 0:\n        for i in range(totalMonths):\n            balance = balance - monthlyPaymentRate + ((balance - monthlyPaymentRate) * monthlyInterestRate)\n        if balance > 0:\n            monthlyPaymentRate += 10\n            balance = initialBalance\n        elif balance <= 0:\n            break\n    return monthlyPaymentRate\n", "entry_point": "calculate_min_payment", "input": "4000, 0.12", "output": "360", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63181_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020636", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "32, 3", "output": "4960", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt271", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020637", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = scores[i] + exclude\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 15, 5, 8]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60789_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020638", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[91, 88, 77, 70, 60]", "output": "[91, 88, 77]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020639", "code": "def format_version(version: tuple) -> str:\n    if len(version) == 3:\n        return f\"v{version[0]}.{version[1]}.{version[2]}\"\n    elif len(version) == 2:\n        return f\"v{version[0]}.{version[1]}.0\"\n    elif len(version) == 1:\n        return f\"v{version[0]}.0.0\"\n", "entry_point": "format_version", "input": "(1, 3, 4)", "output": "'v1.3.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103483_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020640", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'Hello,World!'", "output": "'Hello,World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020641", "code": "def unit_converter(value, initial_unit, target_unit):\n    conversions = {\n        'kg': {'kg': 1, 'g': 1000, 'lb': 2.2, 'oz': 35.274, 'amu': 6.022e26},\n        'g': {'kg': 0.001, 'g': 1, 'lb': 0.0022, 'oz': 0.035274, 'amu': 6.022e23},\n        'lb': {'kg': 0.454545, 'g': 453.592, 'lb': 1, 'oz': 16, 'amu': 2.7316e26},\n        'oz': {'kg': 0.0283495, 'g': 28.3495, 'lb': 0.0625, 'oz': 1, 'amu': 1.70725e25},\n        'amu': {'kg': 1.66053886e-27, 'g': 1.66053886e-24, 'lb': 3.660861e-27, 'oz': 5.8573776e-26, 'amu': 1},\n        'C': {'C': 1, 'N': 1.602e-19, 'dyn': 1e5, 'J': 1, 'W': 1, 'eV': 1.602e-19, 'keV': 1.602e-16, 'MeV': 1.602e-13, 'GeV': 1.602e-10},\n        'N': {'C': 1.602e19, 'N': 1, 'dyn': 1e5, 'J': 1, 'W': 1, 'eV': 1.602e-19, 'keV': 1.602e-16, 'MeV': 1.602e-13, 'GeV': 1.602e-10},\n        'dyn': {'C': 1e-5, 'N': 0.00001, 'dyn': 1, 'J': 0.00001, 'W': 0.00001, 'eV': 1.602e-24, 'keV': 1.602e-21, 'MeV': 1.602e-18, 'GeV': 1.602e-15},\n        'J': {'C': 1, 'N': 1, 'dyn': 100000, 'J': 1, 'W': 1, 'eV': 6.242e18, 'keV': 6.242e15, 'MeV': 6.242e12, 'GeV': 6.242e9},\n        'W': {'C': 1, 'N': 1, 'dyn': 100000, 'J': 1, 'W': 1, 'eV': 6.242e18, 'keV': 6.242e15, 'MeV': 6.242e12, 'GeV': 6.242e9},\n        'eV': {'C': 6.242e18, 'N': 6.242e12, 'dyn': 6.242e24, 'J': 1.602e-19, 'W': 1.602e-19, 'eV': 1, 'keV': 0.001, 'MeV': 1e-6, 'GeV': 1e-9},\n        'keV': {'C': 6.242e21, 'N': 6.242e15, 'dyn': 6.242e18, 'J': 1.602e-16, 'W': 1.602e-16, 'eV': 1000, 'keV': 1, 'MeV': 0.001, 'GeV': 1e-6},\n        'MeV': {'C': 6.242e24, 'N': 6.242e18, 'dyn': 6.242e21, 'J': 1.602e-13, 'W': 1.602e-13, 'eV': 1e6, 'keV': 1000, 'MeV': 1, 'GeV': 0.001},\n        'GeV': {'C': 6.242e27, 'N': 6.242e21, 'dyn': 6.242e24, 'J': 1.602e-10, 'W': 1.602e-10, 'eV': 1e9, 'keV': 1e6, 'MeV': 1000, 'GeV': 1}\n    }\n    if initial_unit in conversions and target_unit in conversions[initial_unit]:\n        conversion_factor = conversions[initial_unit][target_unit]\n        converted_value = value * conversion_factor\n        return converted_value\n    else:\n        return \"Unsupported conversion\"\n", "entry_point": "unit_converter", "input": "1, 'kg', 'lb'", "output": "2.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77588_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020642", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7607", "output": "{1, 7607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6610", "output": "{1, 2, 5, 3305, 1322, 10, 6610, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6609", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020644", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum_result = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum_result)\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 6, 8, 5, 3, 4, 4, 5]", "output": "[11, 14, 13, 8, 7, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60286_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020645", "code": "def process_line(line):\n    start_br = line.find('[')\n    end_br = line.find(']')\n    conf_delim = line.find('::')\n    verb1 = line[:start_br].strip()\n    rel = line[start_br + 1: end_br].strip()\n    verb2 = line[end_br + 1: conf_delim].strip()\n    conf = line[conf_delim + 2:].strip()  # Skip the '::' delimiter\n    return verb1, rel, verb2, conf\n", "entry_point": "process_line", "input": "'[lazy]:theztgt::lazy]:theztgth'", "output": "('', 'lazy', ':theztgt', 'lazy]:theztgth')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60093_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020646", "code": "def process_list(input_list, threshold):\n    modified_list = []\n    current_sum = 0\n    for num in input_list:\n        if num < threshold:\n            modified_list.append(num)\n        else:\n            current_sum += num\n            modified_list.append(current_sum)\n    return modified_list\n", "entry_point": "process_list", "input": "[5, 1, 5, 4], 5", "output": "[5, 1, 10, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129571_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020647", "code": "def calculate_accuracy(test_y, pred_y):\n    if len(test_y) != len(pred_y):\n        raise ValueError(\"Length of true labels and predicted labels must be the same.\")\n    correct_predictions = sum(1 for true_label, pred_label in zip(test_y, pred_y) if true_label == pred_label)\n    total_predictions = len(test_y)\n    accuracy = (correct_predictions / total_predictions) * 100\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[1, 1, 0, 0], [1, 1, 1, 0]", "output": "75.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41043_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020648", "code": "def is_valid_constant_type(input_type: str) -> bool:\n    valid_constant_types = ['int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64',\n                            'uint64', 'float32', 'float64', 'char', 'byte', 'string']\n    invalid_constant_types = ['std_msgs/String', '/', 'String', 'time', 'duration', 'header']\n    if input_type in valid_constant_types and input_type not in invalid_constant_types:\n        return True\n    else:\n        return False\n", "entry_point": "is_valid_constant_type", "input": "'int32'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13111_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1546", "output": "{1, 1546, 2, 773}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1545", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020650", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    new_list = []\n    for i in range(len(lst) - 1):\n        new_list.append(lst[i] + lst[i + 1])\n    new_list.append(lst[-1] + lst[0])\n    return new_list\n", "entry_point": "process_list", "input": "[1, 3, 0, 5, 2, 3, 1, 4]", "output": "[4, 3, 5, 7, 5, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64952_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5039", "output": "{1, 5039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5038", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020652", "code": "import re\ndef extract_message_types(proto_definition):\n    message_types = re.findall(r\"message_types_by_name\\['(\\w+)'\\]\", proto_definition)\n    return list(set(message_types))\n", "entry_point": "extract_message_types", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14654_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020653", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "12", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020654", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[3, 3, 1, 6, 4, 2, 2, 4]", "output": "[6, 4, 7, 10, 6, 4, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9149", "output": "{1, 1307, 9149, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020656", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "'**upollmod**'", "output": "'upollmod'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1142", "output": "{1, 2, 571, 1142}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "323", "output": "{19, 1, 323, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020659", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[40, 56, 56, 56, 72]", "output": "56.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_559_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020660", "code": "def intToHuman(number):\n    B = 1000*1000*1000\n    M = 1000*1000\n    K = 1000\n    if number >= B:\n        numStr = f\"{number/B:.1f}\" + \"B\"\n    elif number >= M:\n        numStr = f\"{number/M:.1f}\" + \"M\"\n    elif number >= K:\n        numStr = f\"{number/K:.1f}\" + \"K\"\n    else:\n        numStr = str(int(number))\n    return numStr\n", "entry_point": "intToHuman", "input": "1200000000", "output": "'1.2B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61849_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020661", "code": "def find_lcs_length_optimized(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "find_lcs_length_optimized", "input": "'abc', 'ab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28396_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020662", "code": "def apply_replacements(replacements, input_string):\n    replacement_dict = {}\n    # Populate the replacement dictionary\n    for replacement in replacements:\n        old_word, new_word = replacement.split(\":\")\n        replacement_dict[old_word] = new_word\n    # Split the input string into words\n    words = input_string.split()\n    # Apply replacements to each word\n    for i in range(len(words)):\n        if words[i] in replacement_dict:\n            words[i] = replacement_dict[words[i]]\n    # Join the modified words back into a string\n    output_string = \" \".join(words)\n    return output_string\n", "entry_point": "apply_replacements", "input": "['a:eI', 'b:ke'], 'a b'", "output": "'eI ke'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5614_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020663", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=0-100'", "output": "(0, 100)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020664", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[40]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020665", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2091", "output": "{1, 3, 41, 2091, 17, 51, 697, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020666", "code": "from typing import List\nMAX_FORCE = 10.0\nTARGET_VELOCITY = 5.0\nMULTIPLY = 2.0\ndef calculate_total_force(robot_velocities: List[float]) -> float:\n    total_force = sum([MAX_FORCE * (TARGET_VELOCITY - vel) * MULTIPLY for vel in robot_velocities])\n    return total_force\n", "entry_point": "calculate_total_force", "input": "[6.0, 4.9]", "output": "-18.000000000000007", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22767_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020667", "code": "import re\ndef remove_color_codes(text):\n    return re.sub('(\u00a7[0-9a-f])', '', text)\n", "entry_point": "remove_color_codes", "input": "'\u00a71iHello\u00a7a'", "output": "'iHello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50171_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020668", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'DECLINED', 'FINISH'", "output": "'ENDED'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020669", "code": "def find_median(nums):\n    sorted_nums = sorted(nums)\n    n = len(sorted_nums)\n    if n % 2 == 1:\n        return sorted_nums[n // 2]\n    else:\n        mid1 = sorted_nums[n // 2 - 1]\n        mid2 = sorted_nums[n // 2]\n        return (mid1 + mid2) / 2\n", "entry_point": "find_median", "input": "[5, 6, 7, 8]", "output": "6.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40083_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020670", "code": "from typing import Tuple\nimport math\ndef calculate_distance(point1: Tuple[int, int], point2: Tuple[int, int]) -> float:\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0), (100, 100)", "output": "141.4213562373095", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60623_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020671", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        minor += 1\n        patch = 0\n    if minor > 9:\n        major += 1\n        minor = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'0.9.9'", "output": "'1.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97641_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020672", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'visualin'", "output": "\"Operation type 'visualin' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020673", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'hhelhe,ew'", "output": "['hhelhe', 'ew']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020674", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4813", "output": "{1, 4813}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020675", "code": "COLOR_RESOLUTIONS = {\n    'THE_1080_P': (1920, 1080),\n    'THE_4_K': (3840, 2160),\n    'THE_12_MP': (4056, 3040)\n}\nGRAY_RESOLUTIONS = {\n    'THE_720_P': (1280, 720),\n    'THE_800_P': (1280, 800),\n    'THE_400_P': (640, 400)\n}\ndef get_resolution_dimensions(resolution_type):\n    if resolution_type in COLOR_RESOLUTIONS:\n        return COLOR_RESOLUTIONS[resolution_type]\n    elif resolution_type in GRAY_RESOLUTIONS:\n        return GRAY_RESOLUTIONS[resolution_type]\n    else:\n        return \"Resolution type not found\"\n", "entry_point": "get_resolution_dimensions", "input": "'THE_800_P'", "output": "(1280, 800)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107378_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020676", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[8, 4, 0, 8, 8, 4, 8, 8]", "output": "[0, 4, 4, 8, 8, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020677", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'11:07:03PM'", "output": "'23:07:03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020678", "code": "from typing import List\nfrom heapq import heapify, heappop\ndef find_kth_largest(nums: List[int], k: int) -> int:\n    if not nums:\n        return None\n    # Create a max-heap by negating each element\n    heap = [-num for num in nums]\n    heapify(heap)\n    # Pop k-1 elements from the heap\n    for _ in range(k - 1):\n        heappop(heap)\n    # Return the kth largest element (negate the result)\n    return -heap[0]\n", "entry_point": "find_kth_largest", "input": "[1, 2, 3, 4, 5], 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124799_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020679", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 3, 9, 5, 3, 7]", "output": "[2, 4, 11, 8, 7, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1201", "output": "{1, 1201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1200", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4121", "output": "{1, 317, 13, 4121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020682", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[81, 81, 81, 81], 3", "output": "81.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132005_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020683", "code": "import json\ndef total_unique_services(json_data):\n    unique_services = set()\n    for host in json_data.values():\n        unique_services.update(host.keys())\n    return len(unique_services)\n", "entry_point": "total_unique_services", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50275_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020684", "code": "def generate_email(template_name, params):\n    \"\"\"\n    Generate a personalized email using a mock Jinja2 templating engine.\n    :param template_name: Name of the template to load\n    :type template_name: str\n    :param params: Dictionary containing parameters to render the template\n    :type params: dict\n    :return: Rendered email content\n    :rtype: str\n    \"\"\"\n    # Mock template rendering for demonstration\n    template_mapping = {\n        \"welcome_email\": \"Hello {{ recipient_name }},\\n\\nWelcome to our community!\\n\\nBest regards,\\n{{ sender_name }}\"\n    }\n    if template_name in template_mapping:\n        template = template_mapping[template_name]\n        rendered_email = template.replace(\"{{ recipient_name }}\", params.get(\"recipient_name\", \"\"))\n        rendered_email = rendered_email.replace(\"{{ sender_name }}\", params.get(\"sender_name\", \"\"))\n        return rendered_email\n    else:\n        return \"Template not found\"\n", "entry_point": "generate_email", "input": "'non_existent_template', {}", "output": "'Template not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57964_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020685", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "107.9, 10, 70", "output": "979.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020686", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "3, 9, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020687", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8182", "output": "{1, 2, 4091, 8182}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3478", "output": "{1, 2, 37, 74, 1739, 47, 3478, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020689", "code": "def reverse_capitalize(name):\n    reversed_name = name[::-1]  # Reverse the name\n    capitalized_name = reversed_name.upper()  # Capitalize the reversed name\n    return capitalized_name\n", "entry_point": "reverse_capitalize", "input": "'EDNA'", "output": "'ANDE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96308_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020690", "code": "def combinationSum(candidates, target):\n    candidates.sort()\n    result = []\n    def combsum(candidates, target, start, path):\n        if target == 0:\n            result.append(path)\n            return\n        for i in range(start, len(candidates)):\n            if candidates[i] > target:\n                break\n            combsum(candidates, target - candidates[i], i, path + [candidates[i]])\n    combsum(candidates, target, 0, [])\n    return result\n", "entry_point": "combinationSum", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38211_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020691", "code": "def calculate_discounted_price(costs, discounts, rebate_factor):\n    total_cost = sum(costs)\n    total_discount = sum(discounts)\n    final_price = (total_cost - total_discount) * rebate_factor\n    if final_price < 0:\n        return 0\n    else:\n        return round(final_price, 2)\n", "entry_point": "calculate_discounted_price", "input": "[10], [2.8], 1", "output": "7.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12135_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020692", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "-457", "output": "-754", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8488", "output": "{1, 2, 4, 1061, 8488, 8, 2122, 4244}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8487", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020694", "code": "def find_floor_crossing_index(parentheses):\n    floor = 0\n    for i, char in enumerate(parentheses, start=1):\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        else:\n            raise ValueError(\"Invalid character in input string\")\n        if floor == -1:\n            return i\n    return -1  # If floor never reaches -1\n", "entry_point": "find_floor_crossing_index", "input": "'(((())))())'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17635_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020695", "code": "def custom_wrapper(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            modified_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            modified_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            modified_list.append(\"Buzz\")\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "custom_wrapper", "input": "[2, 3, 6, 9]", "output": "[2, 'Fizz', 'Fizz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139069_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1125", "output": "{1, 225, 3, 5, 1125, 9, 75, 45, 15, 375, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1124", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020697", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "7", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020698", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[35, 33, 90, 33, 92, 90, 35, 33, 91]", "output": "[33, 33, 33, 35, 35, 90, 90, 91, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020699", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7842", "output": "{1, 7842, 2, 3, 6, 3921, 2614, 1307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7841", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020701", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5998", "output": "{1, 2, 5998, 2999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5997", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4084", "output": "{1, 2, 4, 4084, 2042, 1021}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4083", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020703", "code": "def format_version(version_str: str) -> str:\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    version_integers = [int(component) for component in version_components]\n    # Format the version string as 'vX.Y.Z'\n    formatted_version = 'v' + '.'.join(map(str, version_integers))\n    return formatted_version\n", "entry_point": "format_version", "input": "'1.21.2.33.2'", "output": "'v1.21.2.33.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15533_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020704", "code": "def map_source_to_file(source):\n    if source == 'A':\n        return 'art_source.txt'\n    elif source == 'C':\n        return 'clip_source.txt'\n    elif source == 'P':\n        return 'product_source.txt'\n    elif source == 'R':\n        return 'real_source.txt'\n    else:\n        return \"Unknown Source Type, only supports A C P R.\"\n", "entry_point": "map_source_to_file", "input": "'P'", "output": "'product_source.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140499_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020705", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/Docum/eCam'", "output": "('C:/Users/Docum', 'eCam')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9136", "output": "{1, 2, 4, 8, 2284, 9136, 16, 1142, 4568, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9135", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020707", "code": "from typing import Tuple\nimport math\ndef calculate_distance(point1: Tuple[int, int], point2: Tuple[int, int]) -> float:\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0), (0, 0)", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60623_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020708", "code": "from typing import List\ndef threeSumClosest(nums: List[int], target: int) -> int:\n    nums.sort()\n    closest_sum = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            if abs(current_sum - target) < abs(closest_sum - target):\n                closest_sum = current_sum\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return target  # Found an exact match, no need to continue\n    return closest_sum\n", "entry_point": "threeSumClosest", "input": "[-4, -1, -1, 0, 1, 2], -1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47065_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020709", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[4, 1, 2, 5, 0, 3, 2, -2, 2]", "output": "[4, 5, 7, 12, 12, 15, 17, 15, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020710", "code": "def simulate_roomba(n, m, instructions):\n    cleaned_cells = set()\n    roomba_position = (0, 0)\n    cleaned_cells.add(roomba_position)\n    for instruction in instructions:\n        x, y = roomba_position\n        if instruction == 'U' and x > 0:\n            roomba_position = (x - 1, y)\n        elif instruction == 'D' and x < n - 1:\n            roomba_position = (x + 1, y)\n        elif instruction == 'L' and y > 0:\n            roomba_position = (x, y - 1)\n        elif instruction == 'R' and y < m - 1:\n            roomba_position = (x, y + 1)\n        if roomba_position not in cleaned_cells:\n            cleaned_cells.add(roomba_position)\n    return len(cleaned_cells)\n", "entry_point": "simulate_roomba", "input": "3, 2, ['D', 'R', 'D', 'L']", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110772_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020711", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[9, 9, 1, 5, 2, 8, 7, 7, 7], 6", "output": "[[9, 9, 1, 5, 2, 8], [7, 7, 7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020712", "code": "def max_box_area(heights):\n    max_area = 0\n    left, right = 0, len(heights) - 1\n    while left < right:\n        width = right - left\n        min_height = min(heights[left], heights[right])\n        area = width * min_height\n        max_area = max(max_area, area)\n        if heights[left] < heights[right]:\n            left += 1\n        else:\n            right -= 1\n    return max_area\n", "entry_point": "max_box_area", "input": "[1, 8, 6, 2, 5, 4, 8, 3, 7, 4]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135677_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020713", "code": "def calculate_average_model(list_weights):\n    # Getting the shape of the 3D array\n    number_clients = len(list_weights)\n    size_outer = len(list_weights[0])\n    size_inner = len(list_weights[0][0])\n    # Constructing a new 2D array of zeros of the same size\n    newModel = [[0 for _ in range(size_inner)] for _ in range(size_outer)]\n    # Summing up values for all clients\n    for weights in list_weights:\n        for outerIndex, outerList in enumerate(weights):\n            for innerIndex, innerVal in enumerate(outerList):\n                newModel[outerIndex][innerIndex] += innerVal\n    # Calculating the average model by dividing by the total number of clients\n    averageModel = [[val // number_clients for val in innerList] for innerList in newModel]\n    return averageModel\n", "entry_point": "calculate_average_model", "input": "[[[3, 3], [5, 7]], [[3, 5], [5, 5]]]", "output": "[[3, 4], [5, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5642_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020714", "code": "from typing import List\ndef sum_multiples_3_5_unique(numbers: List[int]) -> int:\n    unique_multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            unique_multiples.add(num)\n    return sum(unique_multiples)\n", "entry_point": "sum_multiples_3_5_unique", "input": "[3, 5, 6, 10, 12]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57809_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020715", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5546", "output": "{1, 2, 5546, 47, 2773, 118, 59, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5545", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020716", "code": "import datetime\ndef frmtTime(timeStamp):\n    try:\n        timestamp_formats = [\"%Y-%m-%d %H:%M:%S.%f\", \"%Y-%m-%dT%H:%M:%S-%f\"]\n        for fmt in timestamp_formats:\n            try:\n                timestamp_obj = datetime.datetime.strptime(timeStamp, fmt)\n                formatted_timestamp = datetime.datetime.strftime(timestamp_obj, \"%Y-%m-%dT%H:%M:%S-0300\")\n                return formatted_timestamp\n            except ValueError:\n                pass\n        raise ValueError(\"Invalid timestamp format\")\n    except Exception as e:\n        return str(e)\n", "entry_point": "frmtTime", "input": "'2022-01-15 08:30:45.000000'", "output": "'2022-01-15T08:30:45-0300'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79609_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020717", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[-2, 2, 2, 2, 6, 1, 3, 5, 7]", "output": "[-2, 2, 2, 2, 6, 1, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020718", "code": "def concat(parameters, sep):\n    text = ''\n    for i in range(len(parameters)):\n        text += str(parameters[i])\n        if i != len(parameters) - 1:\n            text += sep\n        else:\n            text += '\\n'\n    return text\n", "entry_point": "concat", "input": "[4, 4, 3, 3], '---'", "output": "'4---4---3---3\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80875_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020719", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[8, 22, 34, 46]", "output": "(46, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020720", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[2, 4, 6, 1, 3, 5]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020721", "code": "def frequencies_map_with_map_from(lst):\n    from collections import Counter\n    return dict(map(lambda x: (x, lst.count(x)), set(lst)))\n", "entry_point": "frequencies_map_with_map_from", "input": "['a', 'a', 'a', 'bc', 'bc', 'c', 'aac']", "output": "{'bc': 2, 'a': 3, 'c': 1, 'aac': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49570_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020722", "code": "# Define the mapping between detector names and camera types\ndetector_camera_mapping = {\n    'EigerDetector': 'cam.EigerDetectorCam',\n    'FirewireLinDetector': 'cam.FirewireLinDetectorCam',\n    'FirewireWinDetector': 'cam.FirewireWinDetectorCam',\n    'GreatEyesDetector': 'cam.GreatEyesDetectorCam',\n    'LightFieldDetector': 'cam.LightFieldDetectorCam'\n}\n# Function to get the camera type based on the detector name\ndef get_camera_type(detector_name):\n    return detector_camera_mapping.get(detector_name, 'Detector not found')\n", "entry_point": "get_camera_type", "input": "'GreatEyesDetector'", "output": "'cam.GreatEyesDetectorCam'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_375_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020723", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[2, 2]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt36", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020724", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "0, [1, 2, 3, 4]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020725", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 2:\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 4)\n", "entry_point": "calculate_average", "input": "[80, 84, 85, 90]", "output": "84.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19408_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020726", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "0, 0, '+'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020727", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1030", "output": "b'\\x00\\x00\\x04\\x06'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020728", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[4, 5, 9]", "output": "(9, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020729", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[(1, 70), (2, 80)]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020730", "code": "def determine_displayed_columns(chatrooms):\n    cols = set()\n    for chatroom in chatrooms:\n        if chatroom.get('description'):\n            cols.add('description')\n        if chatroom.get('password'):\n            cols.add('password')\n    return cols\n", "entry_point": "determine_displayed_columns", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74520_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020731", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[8, 8, 9]", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020732", "code": "def fizz_buzz(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            output_list.append('FizzBuzz')\n        elif num % 3 == 0:\n            output_list.append('Fizz')\n        elif num % 5 == 0:\n            output_list.append('Buzz')\n        else:\n            output_list.append(num)\n    return output_list\n", "entry_point": "fizz_buzz", "input": "[3, 6, 4, 1, 1, 1, 9, 12]", "output": "['Fizz', 'Fizz', 4, 1, 1, 1, 'Fizz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117515_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020733", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 0, 0], [9, 9, 9]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020734", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[5, 4, 2, 7, 0, 5, 4]", "output": "[5, 4, 2, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1641", "output": "{1, 3, 547, 1641}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1640", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020736", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[0, 3, 3, 6, 5, 9, 8, 4, 1], 3", "output": "[0, 0, 0, 0, 2, 0, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020737", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'PIPIPII', 'ME'", "output": "'Invalid status code: PIPIPII'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020738", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8467", "output": "{1, 8467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020739", "code": "def count_supported_regions(id):\n    supported_regions = set()\n    if id.startswith('user-'):\n        supported_regions = {'US', 'EU'}\n    elif id.startswith('org-'):\n        supported_regions = {'US', 'EU', 'APAC'}\n    return len(supported_regions)\n", "entry_point": "count_supported_regions", "input": "'org-123'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94111_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020740", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'World!Wor!ld'", "output": "b'World!Wor!ld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020741", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2409", "output": "{1, 33, 3, 803, 2409, 73, 11, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020742", "code": "def encrypt(text: str, shift: int) -> str:\n    result = ''\n    for char in text:\n        if char.islower():\n            new_pos = ord('a') + (ord(char) - ord('a') + shift) % 26\n            result += chr(new_pos)\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt", "input": "'hello', 3", "output": "'khoor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63260_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020743", "code": "def maxScore(nums):\n    n = len(nums)\n    dp = [[0] * n for _ in range(n)]\n    for i in range(n):\n        dp[i][i] = nums[i]\n    for length in range(2, n + 1):\n        for i in range(n - length + 1):\n            j = i + length - 1\n            dp[i][j] = max(nums[i] - dp[i + 1][j], nums[j] - dp[i][j - 1])\n    return dp[0][n - 1]\n", "entry_point": "maxScore", "input": "[3, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80788_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020744", "code": "def calculate_name_value(name):\n    alphavalue = sum(ord(char) - 64 for char in name)\n    return alphavalue\n", "entry_point": "calculate_name_value", "input": "'ADORS'", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140001_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020745", "code": "def ip_to_int(ip_address):\n    octets = ip_address.split('.')\n    if len(octets) != 4:\n        return None\n    ip_int = 0\n    for i in range(4):\n        octet_int = int(octets[i])\n        if octet_int < 0 or octet_int > 255:\n            return None\n        ip_int += octet_int << (8 * (3 - i))\n    return ip_int\n", "entry_point": "ip_to_int", "input": "'192.168.1.1'", "output": "3232235777", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58857_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8647", "output": "{1, 8647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020747", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'0.0.99'", "output": "'0.0.100'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45821_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "496", "output": "{1, 2, 4, 8, 496, 16, 248, 124, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt495", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020749", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6262", "output": "{1, 2, 101, 202, 6262, 3131, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5993", "output": "{461, 1, 5993, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020751", "code": "import socket\ndef get_domain_name(ip_address):\n    try:\n        result = socket.gethostbyaddr(ip_address)\n        return list(result)[0]\n    except socket.herror:\n        return \"Domain name not found\"\n", "entry_point": "get_domain_name", "input": "'88.8.8.8'", "output": "'8.red-88-8-8.dynamicip.rima-tde.net'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122690_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7609", "output": "{1, 7609, 1087, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020753", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, -1, -1, 0, -1, 2, 2, -1, 0]", "output": "[0, -2, -1, -1, 1, 4, 1, -1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020754", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[5, 5, 5, 1, 1], 3", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020755", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'\u4f60\u597d world 15%'", "output": "'Chinese: \u4f60\u597d\\nAlphanumeric: world, 15%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020756", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "['F', 'F', 'F', 'F', 'F', 'F', 'B']", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020757", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[7, 6, 9, 1, 8, 7, 6, -1]", "output": "[9, 8, 7, 7, 6, 6, 1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020758", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(0, 3), fan='fan_in'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020759", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "0", "output": "'?0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020760", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7751", "output": "{337, 1, 23, 7751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020761", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'ggpythono'", "output": "'Binary path for ggpythono not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020762", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[4, 4, 2, 1, 5, 3, 2, 1, 5, 3]", "output": "[4, 2, 1, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020763", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'sampletext. le'", "output": "'Sampletext. le'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020764", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3619", "output": "{1, 3619, 517, 7, 329, 11, 77, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020765", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "19", "output": "4181", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020766", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'RRDD'", "output": "(2, -2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020767", "code": "def html_reverse_escape(string):\n    '''Reverse escapes HTML code in string into ASCII text.'''\n    return string.replace(\"&amp;\", \"&\").replace(\"&#39;\", \"'\").replace(\"&quot;\", '\"')\n", "entry_point": "html_reverse_escape", "input": "'Ip;'", "output": "'Ip;'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68510_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020768", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "' Wjohn-Doeord '", "output": "'Wjohn-Doeord'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020769", "code": "from typing import List, Tuple\ndef replace_links(link_replacements: List[Tuple[str, str]], text: str) -> str:\n    for old_link, new_link in link_replacements:\n        text = text.replace(old_link, new_link)\n    return text\n", "entry_point": "replace_links", "input": "[('https://example.com/', '')], 'link:https://example.com/'", "output": "'link:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75500_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020770", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'atshdata/input.sphp'", "output": "'atshdata/input.sphp_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020771", "code": "def count(char, word):\n    total = 0\n    for any in word:\n        if any == char:\n            total += 1\n    return total\n", "entry_point": "count", "input": "'a', 'banana'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47470_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020772", "code": "def generate_timestamps(frequency, duration):\n    timestamps = []\n    for sec in range(0, duration+1, frequency):\n        hours = sec // 3600\n        minutes = (sec % 3600) // 60\n        seconds = sec % 60\n        timestamp = f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n        timestamps.append(timestamp)\n    return timestamps\n", "entry_point": "generate_timestamps", "input": "13, 26", "output": "['00:00:00', '00:00:13', '00:00:26']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12595_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020773", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8249", "output": "{73, 1, 113, 8249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8248", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020774", "code": "from typing import List, Tuple, Dict\ndef apply_migrations(migrations: List[Tuple[str, str, str]]) -> Dict[str, List[str]]:\n    schema = {}\n    for model, field, operation in migrations:\n        if operation == 'AddField':\n            schema.setdefault(model, []).append(field)\n        elif operation == 'AlterField':\n            if model in schema:\n                if field in schema[model]:\n                    schema[model][schema[model].index(field)] = field  # Simulating AlterField operation\n                else:\n                    schema[model].append(field)  # Simulating AddField operation if field doesn't exist\n            else:\n                schema[model] = [field]  # Simulating AddField operation if model doesn't exist\n        elif operation == 'DeleteField':\n            if model in schema and field in schema[model]:\n                schema[model].remove(field)\n    return schema\n", "entry_point": "apply_migrations", "input": "[('Post', 'title', 'AddField')]", "output": "{'Post': ['title']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113044_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020775", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alphaalbeta=2,gaalp=3'", "output": "{'alphaalbeta': '2', 'gaalp': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020776", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "690, 1", "output": "691", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020777", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "69, 'cssodts.py'", "output": "'69_cssodts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020778", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "10", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020779", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[9, -6]", "output": "-54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020780", "code": "def evaluate_expression(expression):\n    expression = expression.replace('^', '**')  # Replace '^' with '**' for exponentiation\n    try:\n        result = eval(expression)  # Evaluate the expression\n        return result\n    except Exception as e:\n        return f\"Error: {e}\"  # Return an error message if evaluation fails\n", "entry_point": "evaluate_expression", "input": "'(2 + 3'", "output": "\"Error: '(' was never closed (<string>, line 1)\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72501_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020781", "code": "from typing import List, Optional\ndef find_unique_integer(items: List[int]) -> Optional[int]:\n    if len(items) == 0:\n        return None\n    unique_integer = items[0]\n    for item in items[1:]:\n        if item != unique_integer:\n            return None\n    return unique_integer\n", "entry_point": "find_unique_integer", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22544_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020782", "code": "from typing import List, Optional\ndef find_second_largest(nums: List[int]) -> Optional[int]:\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max if second_max != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116497_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020783", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "0.485", "output": "'0.48'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020784", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[5, 9]", "output": "(9, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020785", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[1, 2, 3, 4], 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020786", "code": "def calculate_average_time(entries):\n    total_hours = 0\n    total_minutes = 0\n    total_seconds = 0\n    for entry in entries:\n        total_hours += entry[0]\n        total_minutes += entry[1]\n        total_seconds += entry[2]\n    total_minutes += total_seconds // 60\n    total_seconds %= 60\n    total_hours += total_minutes // 60\n    total_minutes %= 60\n    average_hours = total_hours // len(entries)\n    average_minutes = total_minutes // len(entries)\n    average_seconds = total_seconds // len(entries)\n    return (average_hours, average_minutes, average_seconds)\n", "entry_point": "calculate_average_time", "input": "[(1, 10, 0), (1, 10, 0)]", "output": "(1, 10, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142342_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020787", "code": "def nested_list_depth(lst):\n    max_depth = 0\n    def calculate_depth(lst, current_depth):\n        nonlocal max_depth\n        for elem in lst:\n            if isinstance(elem, list):\n                max_depth = max(max_depth, calculate_depth(elem, current_depth + 1))\n        return current_depth\n    calculate_depth(lst, 1)\n    return max_depth\n", "entry_point": "nested_list_depth", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49579_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020788", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9981", "output": "{1, 3, 9, 1109, 9981, 3327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020790", "code": "def calculate_total_truck_count(_inbound_truck_raw_data, _outbound_truck_raw_data):\n    inbound_truck_count = len(_inbound_truck_raw_data)\n    outbound_truck_count = len(_outbound_truck_raw_data)\n    total_truck_count = inbound_truck_count + outbound_truck_count\n    return total_truck_count\n", "entry_point": "calculate_total_truck_count", "input": "[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12, 13]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24222_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "65", "output": "{65, 1, 13, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt64", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020792", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    max1, max2, max3 = float('-inf'), float('-inf'), float('-inf')\n    min1, min2 = float('inf'), float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, min1 * min2 * max1)\n", "entry_point": "max_product_of_three", "input": "[1, 1, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74922_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020793", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8", "output": "{8, 1, 2, 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020794", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "13", "output": "819", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4798", "output": "{1, 2, 4798, 2399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4797", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020796", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[40, 39, 27, 15, 10]", "output": "[40, 39, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020797", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[8, 8, 8, 8, 8, 8, 8, 8, 10]", "output": "8.222222222222221", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5101", "output": "{1, 5101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020799", "code": "from typing import List\ndef find_first_occurrence(data_changed_flags: List[int]) -> int:\n    for index, value in enumerate(data_changed_flags):\n        if value == 1:\n            return index\n    return -1\n", "entry_point": "find_first_occurrence", "input": "[0, 0, 0, 0, 0, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32380_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020800", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "15, 3", "output": "455", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt209", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020801", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'ie_without_tag'", "output": "('ie_without_tag', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020802", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "255, 170, 4", "output": "'#FFAA04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020803", "code": "def count_unique_amino_acids(sequence):\n    unique_amino_acids = set()\n    for amino_acid in sequence:\n        if amino_acid.isalpha():  # Check if the character is an alphabet\n            unique_amino_acids.add(amino_acid)\n    return len(unique_amino_acids)\n", "entry_point": "count_unique_amino_acids", "input": "'A, B, C, D1, E. F! G?'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31328_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020804", "code": "def next_element(some_list, current_index):\n    if not some_list:\n        return ''\n    next_index = (current_index + 1) % len(some_list)\n    return some_list[next_index]\n", "entry_point": "next_element", "input": "['apple', 'banana', 'cherry', 'date'], 2", "output": "'date'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54712_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020805", "code": "def sort_chromosomes(chromosomes):\n    CHROM = list(map(str, range(1, 23)))\n    CHROM.append(\"X\")\n    filtered_chromosomes = [chrom for chrom in chromosomes if chrom in CHROM]\n    sorted_chromosomes = sorted(filtered_chromosomes, key=lambda x: (int(x) if x.isdigit() else 23, x))\n    return sorted_chromosomes\n", "entry_point": "sort_chromosomes", "input": "['1', '3', '5', '22', 'X']", "output": "['1', '3', '5', '22', 'X']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54525_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1259", "output": "{1, 1259}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020807", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'o'", "output": "'o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020808", "code": "from typing import List\ndef unique_elements(lista: List[int]) -> List[int]:\n    seen = set()\n    result = []\n    for num in lista:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "unique_elements", "input": "[5, 5, 4, 2, 0, 1, 1]", "output": "[5, 4, 2, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139228_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6527", "output": "{1, 107, 61, 6527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020810", "code": "from typing import List\ndef count_unique_requirements(requirements: List[int]) -> int:\n    unique_requirements = set()\n    for req in requirements:\n        unique_requirements.add(req)\n    return len(unique_requirements)\n", "entry_point": "count_unique_requirements", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112114_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020811", "code": "import os\ndef construct_full_path(opt):\n    base_path = opt.get('datapath', '')  # Extract the value associated with the key 'datapath'\n    full_path = os.path.join(base_path, 'HotpotQA')  # Join the base path with 'HotpotQA'\n    return full_path\n", "entry_point": "construct_full_path", "input": "{}", "output": "'HotpotQA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88450_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020812", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020813", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'example.com'", "output": "'example.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020814", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[-3, -7, 8, 1, 10, 10]", "output": "[-27, -343, 64, 1, 100, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020815", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7736", "output": "{1, 2, 4, 967, 8, 1934, 7736, 3868}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7735", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020816", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'hggv'", "output": "'stte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020817", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0 and num % 3 == 0:\n            modified_list.append(num * 5)\n        elif num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:\n            modified_list.append(num ** 3)\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "process_integers", "input": "[6, 3, 6, 12, 2, 7, 4]", "output": "[30, 27, 30, 60, 4, 7, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2885_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020818", "code": "def tennis_set(s1, s2):\n    n1 = min(s1, s2)\n    n2 = max(s1, s2)\n    if n2 == 6:\n        return n1 < 5\n    return n2 == 7 and n1 >= 5 and n1 < n2\n", "entry_point": "tennis_set", "input": "4, 6", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116363_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020819", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[12, 5, 7, 10]", "output": "(12, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020820", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2039", "output": "{1, 2039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2038", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020821", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 4, 2, 3, 0, -1, 3, 0, -1]", "output": "[4, 4, 9, 0, -5, 18, 0, -8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020822", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 10, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2337", "output": "{1, 2337, 3, 41, 779, 19, 57, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020824", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 3, 3, 3, 1, 4, 3]", "output": "[3, 6, 9, 12, 13, 17, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020825", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[72, 73, 72, 73, 73]", "output": "72.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020826", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "88", "output": "{50: 1, 20: 1, 10: 1, 1: 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020827", "code": "def min_energy(energies):\n    min_energy_required = 0\n    current_energy = 0\n    for energy in energies:\n        current_energy += energy\n        if current_energy < 0:\n            min_energy_required += abs(current_energy)\n            current_energy = 0\n    return min_energy_required\n", "entry_point": "min_energy", "input": "[2, -5, -1, -3]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78421_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2075", "output": "{1, 5, 83, 25, 2075, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2074", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020829", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[25, 3, 3, 4, 3, 3, 5]", "output": "[28, 6, 7, 7, 6, 8, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020830", "code": "def get_method_signature(method_name, params):\n    param_types = ', '.join(params)\n    method_signature = f\"{method_name}({param_types})\"\n    return method_signature\n", "entry_point": "get_method_signature", "input": "'calculate', ['int', 'str', 'list']", "output": "'calculate(int, str, list)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93836_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020831", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'60 - 4'", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020832", "code": "def fit_to_grid(co: tuple, grid: float) -> tuple:\n    x = round(co[0] / grid) * grid\n    y = round(co[1] / grid) * grid\n    z = round(co[2] / grid) * grid\n    return round(x, 5), round(y, 5), round(z, 5)\n", "entry_point": "fit_to_grid", "input": "(3.54, 7.08, 7.08), 0.02", "output": "(3.54, 7.08, 7.08)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1385_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020833", "code": "def maximize_score(deck):\n    take = skip = 0\n    for card in deck:\n        new_take = skip + card\n        new_skip = max(take, skip)\n        take, skip = new_take, new_skip\n    return max(take, skip)\n", "entry_point": "maximize_score", "input": "[3, 2, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91144_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020834", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['* 5', '+ 66'], 1", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020835", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1.1.3-32g8'", "output": "'1.1.3+32g8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020836", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "85", "output": "{5: 1, 17: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4868", "output": "{1, 2, 2434, 4868, 4, 1217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4867", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020838", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'mindset.'", "output": "'mindset.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020839", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[5, 6, 0, 7]", "output": "[5, 6, 0, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020840", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[8]", "output": "[8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt37", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020841", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 0, 0, -2, 3, 2, -1]", "output": "[1, 0, -2, 1, 5, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020842", "code": "def get_sample_folder_path(platform):\n    platform_paths = {\n        \"UWP\": \"ArcGISRuntime.UWP.Viewer/Samples\",\n        \"WPF\": \"ArcGISRuntime.WPF.Viewer/Samples\",\n        \"Android\": \"Xamarin.Android/Samples\",\n        \"iOS\": \"Xamarin.iOS/Samples\",\n        \"Forms\": \"Shared/Samples\",\n        \"XFA\": \"Shared/Samples\",\n        \"XFI\": \"Shared/Samples\",\n        \"XFU\": \"Shared/Samples\"\n    }\n    if platform in platform_paths:\n        return platform_paths[platform]\n    else:\n        return \"Unknown platform provided\"\n", "entry_point": "get_sample_folder_path", "input": "'Android'", "output": "'Xamarin.Android/Samples'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70790_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020843", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'visualization'", "output": "\"Module 'visualization_ops' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020844", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'9 1 2 0 3 4 6'", "output": "906", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020845", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'Pagckage'", "output": "'pagckage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020846", "code": "def convert_log_levels(log_levels):\n    log_mapping = {0: 'DEBUG', 1: 'INFO', 2: 'WARNING', 3: 'ERROR'}\n    log_strings = [log_mapping[level] for level in log_levels]\n    return log_strings\n", "entry_point": "convert_log_levels", "input": "[1, 3, 0, 2]", "output": "['INFO', 'ERROR', 'DEBUG', 'WARNING']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93726_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020847", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "4.9", "output": "4900000000000000355", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020848", "code": "def iterativeBinarySearch(vector, wanted):\n    left_index = 0\n    right_index = len(vector) - 1\n    while left_index <= right_index:\n        pivot = (left_index + right_index) // 2\n        if vector[pivot] == wanted:\n            return pivot\n        elif vector[pivot] < wanted:\n            left_index = pivot + 1\n        else:\n            right_index = pivot - 1\n    return -1\n", "entry_point": "iterativeBinarySearch", "input": "[10, 20, 30, 42, 50], 42", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63734_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6184", "output": "{1, 2, 4, 773, 6184, 8, 1546, 3092}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6183", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020850", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[4, 4, 4, 4, 2, 2, 2, 5, 1]", "output": "{4: 4, 2: 3, 5: 1, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020851", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7927", "output": "{1, 7927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020852", "code": "from collections import deque\ndef max_island_size(grid):\n    if not grid:\n        return 0\n    def bfs(r, c):\n        size = 0\n        queue = deque([(r, c)])\n        visited.add((r, c))\n        while queue:\n            row, col = queue.popleft()\n            size += 1\n            for dr, dc in directions:\n                nr, nc = row + dr, col + dc\n                if 0 <= nr < length and 0 <= nc < width and grid[nr][nc] == 1 and (nr, nc) not in visited:\n                    queue.append((nr, nc))\n                    visited.add((nr, nc))\n        return size\n    width, length = len(grid[0]), len(grid)\n    directions = ((0, 1), (1, 0), (0, -1), (-1, 0))\n    max_size = 0\n    visited = set()\n    for r in range(length):\n        for c in range(width):\n            if grid[r][c] == 1 and (r, c) not in visited:\n                max_size = max(max_size, bfs(r, c))\n    return max_size\n", "entry_point": "max_island_size", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99825_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020853", "code": "def generate_answer_id(answer):\n    # Remove leading and trailing whitespaces, convert to lowercase, and replace spaces with underscores\n    modified_answer = answer.strip().lower().replace(\" \", \"_\")\n    # Append the length of the modified string to the Answer ID\n    answer_id = f\"{modified_answer}_{len(modified_answer)}\"\n    return answer_id\n", "entry_point": "generate_answer_id", "input": "'   pygtpytg   '", "output": "'pygtpytg_8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5320_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020854", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9803", "output": "{1, 9803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020855", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'00.1500'", "output": "'00.1500.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020856", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[96, 97, 97, 98, 100]", "output": "97.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44067_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020857", "code": "COMMANDS = {0: \"move_forward\", 1: \"go_down\", 2: \"rot_10_deg\",\n            3: \"go_up\", 4: \"take_off\", 5: \"land\", 6: \"idle\"}\ndef process_commands(commands):\n    actions = []\n    for command in commands:\n        if command in COMMANDS:\n            actions.append(COMMANDS[command])\n        else:\n            actions.append(\"unknown_command\")\n    return actions\n", "entry_point": "process_commands", "input": "[4, 4, 2, 1]", "output": "['take_off', 'take_off', 'rot_10_deg', 'go_down']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2283_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020858", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9533", "output": "{1, 9533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020859", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[50, 54, 29, 33, 22, 100, 45, 54, 89, 75]", "output": "52.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020860", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'/path/to/iid.py'", "output": "'iid'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9581", "output": "{1, 737, 67, 871, 11, 13, 9581, 143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020862", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "5", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020863", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 95, 96, 96, 100]", "output": "95.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118381_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020864", "code": "def sum_squared_differences(a, b):\n    total_sum = 0\n    min_len = min(len(a), len(b))\n    for i in range(min_len):\n        diff = a[i] - b[i]\n        total_sum += diff ** 2\n    return total_sum\n", "entry_point": "sum_squared_differences", "input": "[3, 1, 2], [0, 0, 0]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020865", "code": "def extract_variables(file_content):\n    extracted_variables = {}\n    # Extract LINEDIR value\n    linedir_start = file_content.find(\"LINEDIR=\") + len(\"LINEDIR=\")\n    linedir_end = file_content.find(\"\\n\", linedir_start)\n    linedir_value = file_content[linedir_start:linedir_end].strip()\n    # Extract LINE_VERSION value\n    line_version_start = file_content.find(\"LINE_VERSION=\") + len(\"LINE_VERSION=\")\n    line_version_end = file_content.find(\"\\n\", line_version_start)\n    line_version_value = file_content[line_version_start:line_version_end].strip()\n    extracted_variables['LINEDIR'] = linedir_value\n    extracted_variables['LINE_VERSION'] = line_version_value\n    return extracted_variables\n", "entry_point": "extract_variables", "input": "'LINEDIR=s\\nLINE_VERSION=\\n'", "output": "{'LINEDIR': 's', 'LINE_VERSION': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105382_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5955", "output": "{1, 1985, 3, 5955, 5, 1191, 397, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020867", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "3.7777777777777777, 1", "output": "(3.7777777777777777, 3.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020868", "code": "def calculate_avg_rmsd(new_rmsd_data_list_dict):\n    if not new_rmsd_data_list_dict:\n        return 0.0\n    total_rmsd = sum(new_rmsd_data_list_dict.values())\n    avg_rmsd = total_rmsd / len(new_rmsd_data_list_dict)\n    return avg_rmsd\n", "entry_point": "calculate_avg_rmsd", "input": "{}", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106257_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020869", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "'U'", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020870", "code": "def min_subarray_length(nums, target):\n    left = 0\n    size = len(nums)\n    res = size + 1\n    sub_sum = 0\n    for right in range(size):\n        sub_sum += nums[right]\n        while sub_sum >= target:\n            sub_length = (right - left + 1)\n            if sub_length < res:\n                res = sub_length\n            sub_sum -= nums[left]\n            left += 1\n    if res == (size + 1):\n        return 0\n    else:\n        return res\n", "entry_point": "min_subarray_length", "input": "[1, 2, 3, 4, 5, 1, 1, 2], 15", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127187_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020871", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2686", "output": "{1, 2, 34, 79, 17, 158, 2686, 1343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2685", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020872", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'helhdhdh'", "output": "'Helhdhdh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020873", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8963", "output": "{1, 8963}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020874", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/api/webhook/bhoo5/details'", "output": "'bhoo5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020875", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level1': 100, 'level2': 200, 'level3': 205}", "output": "505", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020876", "code": "SDL_HAT_CENTERED = 0x00\nSDL_HAT_UP = 0x01\nSDL_HAT_RIGHT = 0x02\nSDL_HAT_DOWN = 0x04\nSDL_HAT_LEFT = 0x08\nSDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP\nSDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN\nSDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP\nSDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN\ndef simulate_joystick_movement(current_position, direction):\n    if direction == 'UP':\n        return SDL_HAT_UP if current_position not in [SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_LEFTUP] else current_position\n    elif direction == 'RIGHT':\n        return SDL_HAT_RIGHT if current_position not in [SDL_HAT_RIGHT, SDL_HAT_RIGHTUP, SDL_HAT_RIGHTDOWN] else current_position\n    elif direction == 'DOWN':\n        return SDL_HAT_DOWN if current_position not in [SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN, SDL_HAT_LEFTDOWN] else current_position\n    elif direction == 'LEFT':\n        return SDL_HAT_LEFT if current_position not in [SDL_HAT_LEFT, SDL_HAT_LEFTUP, SDL_HAT_LEFTDOWN] else current_position\n    else:\n        return current_position\n", "entry_point": "simulate_joystick_movement", "input": "-5, 'INVALID'", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77291_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3054", "output": "{1, 2, 3, 6, 3054, 1527, 1018, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4569", "output": "{1, 3, 4569, 1523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020879", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3273", "output": "{1, 1091, 3, 3273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020880", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7709", "output": "{593, 1, 13, 7709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7708", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020881", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "-3", "output": "-30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9183", "output": "{1, 3, 3061, 9183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020883", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'wrrohello wr'", "output": "'wr wrrohello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020884", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'22.10009.1'", "output": "'22.10009.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2635", "output": "{1, 5, 2635, 527, 17, 85, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020886", "code": "def sum_indices(matrix):\n    rows, cols = len(matrix), len(matrix[0])\n    output = [[0 for _ in range(cols)] for _ in range(rows)]\n    for i in range(rows):\n        for j in range(cols):\n            output[i][j] = i + j + matrix[i][j]\n    return output\n", "entry_point": "sum_indices", "input": "[[], [], [], [], [], [], []]", "output": "[[], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4688_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020887", "code": "import time\ndef convert_epoch_time(seconds):\n    time_struct = time.gmtime(seconds)\n    formatted_time = time.strftime('%a %b %d %H:%M:%S %Y', time_struct)\n    return formatted_time\n", "entry_point": "convert_epoch_time", "input": "2", "output": "'Thu Jan 01 00:00:02 1970'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107337_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020888", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[1, 1, -1, 3, 1, 2, 0, 3]", "output": "[2, 0, 2, 4, 3, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020889", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'CC_C_NNCN'", "output": "'No occurrences found for bond type CC_C_NNCN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020890", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'abc_parpart1_sroot_xroo'", "output": "'parpart1_sroot_xroo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020891", "code": "from typing import List\ndef best_sum(target_sum: int, numbers: List[int]) -> List[int]:\n    table = [None] * (target_sum + 1)\n    table[0] = []\n    for i in range(target_sum + 1):\n        if table[i] is not None:\n            for num in numbers:\n                if i + num <= target_sum:\n                    if table[i + num] is None or len(table[i] + [num]) < len(table[i + num]):\n                        table[i + num] = table[i] + [num]\n    return table[target_sum]\n", "entry_point": "best_sum", "input": "9, [1, 3, 6, 5]", "output": "[3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127929_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020892", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4615", "output": "{1, 65, 355, 5, 4615, 71, 13, 923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4614", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020893", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[226]", "output": "2712", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4151", "output": "{593, 1, 7, 4151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4150", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020895", "code": "def convert_memory_size(memory_size):\n    units = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n    conversion_rates = [1, 1024, 1024**2, 1024**3, 1024**4]\n    for idx, rate in enumerate(conversion_rates):\n        if memory_size < rate or idx == len(conversion_rates) - 1:\n            converted_size = memory_size / conversion_rates[idx - 1]\n            return f\"{converted_size:.2f} {units[idx - 1]}\"\n", "entry_point": "convert_memory_size", "input": "1099511627776", "output": "'1024.00 GB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020896", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[3, 7, 3, 4, 7, 3, 7, 2, 3]", "output": "[9, 49, 9, 4, 49, 9, 49, 2, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020897", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'eHe'", "output": "b'eHe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020898", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'!@#a000aab$%'", "output": "'a000aab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020899", "code": "def get_framework_abbreviation(framework_name):\n    frameworks = {\n        'pytorch': 'PT',\n        'tensorflow': 'TF',\n        'keras': 'KS',\n        'caffe': 'CF'\n    }\n    lowercase_framework = framework_name.lower()\n    if lowercase_framework in frameworks:\n        return frameworks[lowercase_framework]\n    else:\n        return 'Unknown'\n", "entry_point": "get_framework_abbreviation", "input": "'caffe'", "output": "'CF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121670_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020900", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[3, 2, 2, 0]", "output": "[3, 2, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020901", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'mmdemima', 2, '108110010p'", "output": "'Mmdemima - 02 [108110010p].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020902", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[9, 9, 8, 9, 9, 17, 9, 8]", "output": "[9, 9, 8, 9, 9, 8, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020903", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'snav', 22", "output": "'snav22'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020904", "code": "GAS_LIMIT = 3141592\nGAS_PRICE = 20  # 20 shannon\ndef calculate_gas_cost(gas_limit, gas_price):\n    return gas_limit * gas_price\n", "entry_point": "calculate_gas_cost", "input": "2984510.5, GAS_PRICE", "output": "59690210.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79990_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020905", "code": "def process_integers(input_list):\n    # Multiply each integer by 2\n    multiplied_list = [num * 2 for num in input_list]\n    # Subtract 10 from each integer\n    subtracted_list = [num - 10 for num in multiplied_list]\n    # Calculate the square of each integer\n    squared_list = [num ** 2 for num in subtracted_list]\n    # Find the sum of all squared integers\n    sum_squared = sum(squared_list)\n    return sum_squared\n", "entry_point": "process_integers", "input": "[7, 7]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101819_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020906", "code": "import math\ndef calculate_polygon_area(n, s):\n    if n < 3 or n > 12:\n        return \"Number of sides must be between 3 and 12.\"\n    area = (n * s**2) / (4 * math.tan(math.pi / n))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "4, 5", "output": "25.000000000000004", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29408_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020907", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'orange;;'", "output": "['orange', '', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020908", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 1, 0, 4, 2, 6, 3, 6, 1]", "output": "[2, 1, 4, 6, 8, 9, 9, 7, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3044_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020909", "code": "def word_length_mapping(words):\n    word_length_dict = {}\n    for word in words:\n        word_length_dict[word] = len(word)\n    return word_length_dict\n", "entry_point": "word_length_mapping", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': 5, 'banana': 6, 'cherry': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55760_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020910", "code": "import itertools\ndef generate_combinations(nums, k):\n    # Generate all combinations of size k\n    combinations = itertools.combinations(nums, k)\n    # Convert tuples to lists and store in result list\n    result = [list(comb) for comb in combinations]\n    return result\n", "entry_point": "generate_combinations", "input": "[1, 4, 6, 7, 5, 7], 6", "output": "[[1, 4, 6, 7, 5, 7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31218_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020911", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9226", "output": "{1, 2, 4613, 1318, 7, 9226, 14, 659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020912", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[1, 0, 2, 4, 2, 2, 1, 2]", "output": "[1, 0, 2, 4, 2, 2, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020913", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6242", "output": "{1, 6242, 2, 3121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6241", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020914", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    prev_score = None\n    ranks = []\n    for score in reversed(scores):\n        if score not in rank_dict:\n            if prev_score is not None and score < prev_score:\n                current_rank += 1\n            rank_dict[score] = current_rank\n        ranks.append(rank_dict[score])\n        prev_score = score\n    return ranks[::-1]\n", "entry_point": "calculate_ranks", "input": "[90, 80, 80, 80, 90, 90, 90, 90, 100]", "output": "[2, 3, 3, 3, 2, 2, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9219_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020915", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[3, 3, 3, 3, 3, 2, 2, 2, 2]", "output": "[3, 3, 3, 3, 3, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020916", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "516", "output": "{1, 2, 3, 258, 516, 4, 129, 6, 43, 172, 12, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt515", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020917", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wxtEmyCuBTTONButto'", "output": "'wx.adv.tEmyCuBTTONButto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020918", "code": "def extract_view_names(url_patterns):\n    view_patterns_dict = {}\n    for url_pattern, view_name in url_patterns:\n        view_patterns_dict[view_name] = url_pattern\n    return view_patterns_dict\n", "entry_point": "extract_view_names", "input": "[('/login/', 'login')]", "output": "{'login': '/login/'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60902_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020919", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[9, 4, 10, 8]", "output": "[0, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020920", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[1, 4, 0, 1, 1, 0, 2, 2, 2, 0, 0, 0]", "output": "[1, 4, 0, 1, 1, 0, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020921", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[3, 4, 0, 0, 6, 8]", "output": "[5, 0, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020922", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 1, 2, 3, 2, 4, 4]", "output": "[2, 3, 5, 5, 6, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92643_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020923", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(0, 0, 0)", "output": "'0.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020924", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[0, 4, 1, -2, -1]", "output": "[4, -3, -3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020925", "code": "def extract_package_info(package_dict):\n    package_name = package_dict.get('name', '')\n    version = package_dict.get('version', '')\n    description = package_dict.get('description', '')\n    total_packages = len(package_dict.get('packages', []))\n    return package_name, version, description, total_packages\n", "entry_point": "extract_package_info", "input": "{}", "output": "('', '', '', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1030_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020926", "code": "def count_alphanumeric_chars(text):\n    count = 0\n    for char in text:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abcde1234'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10323_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020927", "code": "from typing import List, Tuple\ndef total_area(rectangles: List[Tuple[int, int, int, int]]) -> int:\n    points = set()\n    total_area = 0\n    for rect in rectangles:\n        for x in range(rect[0], rect[2]):\n            for y in range(rect[1], rect[3]):\n                if (x, y) not in points:\n                    points.add((x, y))\n                    total_area += 1\n    return total_area\n", "entry_point": "total_area", "input": "[(0, 0, 2, 2), (2, 0, 3, 3)]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139460_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020928", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            dp[i] = scores[i] + dp[i - 1]\n        else:\n            dp[i] = scores[i]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[10, 12, 15, 35]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40146_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020929", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(5, 10, 8, 1, 9, 8, 1, 8)", "output": "'5.10.8.1.9.8.1.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020930", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[120, 120, 120, 80], 3", "output": "120.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020931", "code": "def merge_WS_cal(vocab_dic, frequency, lambda_const):\n    # Update vocabulary dictionary using cal_words_fb logic\n    for word in frequency:\n        vocab_dic[word] = lambda_const * vocab_dic.get(word, 0) + (1 - lambda_const) * frequency[word]\n    # Calculate WS values for window words\n    WS_dic = {}\n    for word in frequency:\n        WS_dic.setdefault(word, 0)\n        if vocab_dic.get(word, 0):\n            WS_dic[word] = frequency[word] / float(vocab_dic[word])\n        else:\n            WS_dic[word] = 1\n    return WS_dic\n", "entry_point": "merge_WS_cal", "input": "{}, {}, 0.5", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52569_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020932", "code": "def snapBalancesMatchForToken(before, after, token_name):\n    if token_name in before and token_name in after:\n        return before[token_name] == after[token_name]\n    return False\n", "entry_point": "snapBalancesMatchForToken", "input": "{'tokenA': 100}, {}, 'tokenA'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34191_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020933", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "4, 2, 3", "output": "(0, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020934", "code": "def average_top_scores(scores):\n    scores.sort(reverse=True)\n    top_students = min(5, len(scores))\n    top_scores_sum = sum(scores[:top_students])\n    return top_scores_sum / top_students\n", "entry_point": "average_top_scores", "input": "[100, 98, 90, 92, 72]", "output": "90.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61425_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020935", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[3, 9]", "output": "[3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020936", "code": "def calculate_min_max_sum(arr):\n    total_sum = sum(arr)\n    min_sum = total_sum - max(arr)\n    max_sum = total_sum - min(arr)\n    return min_sum, max_sum\n", "entry_point": "calculate_min_max_sum", "input": "[5, 7, 10]", "output": "(12, 17)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17042_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020937", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[4, 7, 2, 7, 6, 5, 3]", "output": "[28, 8, 28, 24, 20, 12, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020938", "code": "def process_markup(text: str) -> str:\n    formatted_text = \"\"\n    stack = []\n    current_text = \"\"\n    for char in text:\n        if char == '[':\n            if current_text:\n                formatted_text += current_text\n                current_text = \"\"\n            stack.append(char)\n        elif char == ']':\n            tag = \"\".join(stack)\n            stack = []\n            if tag == \"[b]\":\n                current_text = f\"<b>{current_text}</b>\"\n            elif tag == \"[r]\":\n                current_text = f\"<span style='color:red'>{current_text}</span>\"\n            elif tag == \"[u]\":\n                current_text = f\"<u>{current_text}</u>\"\n        else:\n            current_text += char\n    formatted_text += current_text\n    return formatted_text\n", "entry_point": "process_markup", "input": "'[b]bell]dr'", "output": "'bbelldr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63510_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020939", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'/homesedat', '312345'", "output": "'/homesedat/312345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020940", "code": "def count_jolt_differences(adapters):\n    adapters.sort()\n    adapters = [0] + adapters + [adapters[-1] + 3]  # Add the charging outlet and device's built-in adapter\n    one_jolt_diff = 0\n    three_jolt_diff = 0\n    for i in range(1, len(adapters)):\n        diff = adapters[i] - adapters[i - 1]\n        if diff == 1:\n            one_jolt_diff += 1\n        elif diff == 3:\n            three_jolt_diff += 1\n    return one_jolt_diff * three_jolt_diff\n", "entry_point": "count_jolt_differences", "input": "[1, 4, 7]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144973_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020941", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'123456Z56Z'", "output": "('123456Z56Z', None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020942", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[4, 6, 6, 2, 4, 4, 5, 5]", "output": "[4, 6, 6, 2, 4, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020943", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[6, 6, 6]", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020944", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/home/cum/s', 'fipie.jpgltxt'", "output": "'/home/cum/s/fipie.jpgltxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1319", "output": "{1, 1319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020946", "code": "def calculate_range(data):\n    if not data:\n        return None  # Handle empty dataset\n    min_val = max_val = data[0]  # Initialize min and max values\n    for num in data[1:]:\n        if num < min_val:\n            min_val = num\n        elif num > max_val:\n            max_val = num\n    return max_val - min_val\n", "entry_point": "calculate_range", "input": "[0, 10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21170_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020947", "code": "import itertools\ndef unique_eigenvalue_differences(eigvals):\n    unique_eigvals = sorted(set(eigvals))\n    differences = {j - i for i, j in itertools.combinations(unique_eigvals, 2)}\n    return tuple(sorted(differences))\n", "entry_point": "unique_eigenvalue_differences", "input": "[]", "output": "()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124400_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020948", "code": "import re\ndef extract_primary_component(normalized_principal_name: str) -> str:\n    bare_principal = None\n    if normalized_principal_name:\n        match = re.match(r\"([^/@]+)(?:/[^@])?(?:@.*)?\", normalized_principal_name)\n        if match:\n            bare_principal = match.group(1)\n    return bare_principal\n", "entry_point": "extract_primary_component", "input": "'nimbusnimbus'", "output": "'nimbusnimbus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4075_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020949", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4790", "output": "{1, 2, 5, 10, 4790, 2395, 958, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4789", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020950", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1825", "output": "{1, 1825, 5, 73, 365, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020951", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[6, 0, 4, 5, 1, 0, 0]", "output": "[6, 1, 6, 8, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020952", "code": "from typing import List\ndef longest_winning_streak(goals: List[int]) -> int:\n    current_streak = 0\n    longest_streak = 0\n    for i in range(len(goals)):\n        if i == 0 or goals[i] > goals[i - 1]:\n            current_streak += 1\n        else:\n            current_streak = 0\n        longest_streak = max(longest_streak, current_streak)\n    return longest_streak\n", "entry_point": "longest_winning_streak", "input": "[1, 2, 3, 0]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10446_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020953", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "3.181055155875299, 0, 1", "output": "3.181055155875299", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020954", "code": "def multiply_and_filter_quantization(quantization_values, factor):\n    result = []\n    for value in quantization_values:\n        multiplied_value = value * factor\n        if multiplied_value.is_integer():\n            result.append(multiplied_value)\n    return result\n", "entry_point": "multiply_and_filter_quantization", "input": "[2.0, 3.0, 4.0, 6.0], 3", "output": "[6.0, 9.0, 12.0, 18.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103997_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1471", "output": "{1, 1471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020956", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6123", "output": "{1, 3, 39, 6123, 13, 471, 2041, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020957", "code": "def calculate_input_dim(env_name, ob_space):\n    def observation_size(space):\n        return len(space)\n    def goal_size(space):\n        return 0  # Assuming goal information size is 0\n    def box_size(space):\n        return 0  # Assuming box size is 0\n    def robot_state_size(space):\n        return len(space)\n    if env_name == 'PusherObstacle-v0':\n        input_dim = observation_size(ob_space) - goal_size(ob_space) - box_size(ob_space)\n    elif 'Sawyer' in env_name:\n        input_dim = robot_state_size(ob_space)\n    else:\n        raise NotImplementedError(\"Input dimension calculation not implemented for this environment\")\n    return input_dim\n", "entry_point": "calculate_input_dim", "input": "'PusherObstacle-v0', [0, 1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88440_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020958", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[5, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020959", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 66.544043, 1000000", "output": "66544043.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1537", "output": "{1, 53, 29, 1537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020961", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['ignore', 'X', 'Y', 'Z']", "output": "'X Y Z'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020962", "code": "def word_frequency(text):\n    text = text.lower()  # Convert text to lowercase\n    words = text.split()  # Split text into words\n    frequency_dict = {}  # Dictionary to store word frequencies\n    for word in words:\n        # Remove any punctuation marks if needed\n        word = word.strip('.,!?;:\"')\n        if word in frequency_dict:\n            frequency_dict[word] += 1\n        else:\n            frequency_dict[word] = 1\n    return frequency_dict\n", "entry_point": "word_frequency", "input": "'hel'", "output": "{'hel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117162_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020963", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'filename_parpart1root_partx'", "output": "'parpart1root_partx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2339", "output": "{1, 2339}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020965", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'11123#H1eH*!!'", "output": "'11123H1eH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020966", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6381", "output": "{1, 3, 709, 9, 6381, 2127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020967", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[2, 3, 9, 8, 6, 4, 8, 6, 9]", "output": "[5, 12, 17, 14, 10, 12, 14, 15, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020968", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2615", "output": "{1, 523, 5, 2615}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2614", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020969", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 200.0), ('W', 50.0)]", "output": "150.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020970", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[2, 2, 2], 10, 3", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020971", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo TThis'", "output": "'TThis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020972", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[2, 3, 4, 5, 6, -1]", "output": "[2, 3, 4, 5, 6, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1376", "output": "{1376, 1, 2, 32, 4, 8, 43, 172, 688, 16, 86, 344}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020974", "code": "def calculate_refresh_interval(refresh_timeout: int) -> int:\n    return refresh_timeout // 6\n", "entry_point": "calculate_refresh_interval", "input": "3600", "output": "600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13656_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1621", "output": "{1, 1621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "821", "output": "{1, 821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020977", "code": "from typing import List\nimport math\ndef calculate_hypotenuse(sides: List[int]) -> List[float]:\n    hypotenuses = []\n    for side in sides:\n        hypotenuse = round(math.sqrt(side ** 2 + side ** 2), 2)\n        hypotenuses.append(hypotenuse)\n    return hypotenuses\n", "entry_point": "calculate_hypotenuse", "input": "[6, 3, 4, 3, 5, 4, 3, 5]", "output": "[8.49, 4.24, 5.66, 4.24, 7.07, 5.66, 4.24, 7.07]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48514_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020978", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "123500, '.000E+00'", "output": "'1.235E+05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020979", "code": "def extract_frames(lidar_data, start_value):\n    frames = []\n    frame = []\n    for val in lidar_data:\n        if val == start_value:\n            if frame:\n                frames.append(frame)\n                frame = []\n        frame.append(val)\n    if frame:\n        frames.append(frame)\n    return frames\n", "entry_point": "extract_frames", "input": "[2, 1, 4, 4, 2, 2, 2, 2, 2], 2", "output": "[[2, 1, 4, 4], [2], [2], [2], [2], [2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49590_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020980", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9631", "output": "{1, 9631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020981", "code": "def organize_plugins(plugins):\n    loading_order = {'std': 1, 'math': 2, 'io': 3, 'wx': 4, 'xray': 5, 'xrf': 6, 'xafs': 7}\n    max_order = max(loading_order.values()) + 1\n    def key_func(plugin):\n        return loading_order.get(plugin, max_order)\n    return sorted(plugins, key=key_func)\n", "entry_point": "organize_plugins", "input": "['math', 'wx', 'std', 'io', 'plot']", "output": "['std', 'math', 'io', 'wx', 'plot']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10925_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020982", "code": "from typing import Dict\n# Define the number format constants\nFORMAT_GENERAL = 0\nFORMAT_DATE_XLSX14 = 1\nFORMAT_NUMBER_00 = 2\nFORMAT_DATE_TIME3 = 3\nFORMAT_PERCENTAGE_00 = 4\n# Dictionary mapping cell identifiers to number formats\ncell_formats: Dict[str, int] = {\n    'A1': FORMAT_GENERAL,\n    'A2': FORMAT_DATE_XLSX14,\n    'A3': FORMAT_NUMBER_00,\n    'A4': FORMAT_DATE_TIME3,\n    'A5': FORMAT_PERCENTAGE_00\n}\ndef check_number_format(cell: str, number_format: int) -> bool:\n    if cell in cell_formats:\n        return cell_formats[cell] == number_format\n    return False\n", "entry_point": "check_number_format", "input": "'A1', 0", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131224_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020983", "code": "def factorial(n):\n    if n == 0 or n == 1:\n        return 1\n    else:\n        return n * factorial(n - 1)\n", "entry_point": "factorial", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149792_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020984", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            dp[i] = scores[i] + dp[i - 1]\n        else:\n            dp[i] = scores[i]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[10, 20, 15, 22]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40146_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020985", "code": "def find_last_number_less_than_five(numbers):\n    for num in reversed(numbers):\n        if num < 5:\n            return num\n    return None\n", "entry_point": "find_last_number_less_than_five", "input": "[5, 6, 7, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109099_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020986", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020987", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 4, 4, 4, 1, 3]", "output": "[5, 8, 8, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137556_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020988", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "78", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020989", "code": "def validate_manifest(manifest: dict) -> bool:\n    required_keys = {\"title\", \"learningType\", \"inputDimensionality\"}\n    return all(key in manifest for key in required_keys)\n", "entry_point": "validate_manifest", "input": "{'learningType': 'someType', 'inputDimensionality': 2}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124174_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020990", "code": "def modify_dict(input_dict):\n    modified_dict = {}\n    for key, value in input_dict.items():\n        if isinstance(key, bool):\n            modified_dict[not key] = not value\n        else:\n            modified_dict[key] = value\n    sorted_modified_dict = dict(sorted(modified_dict.items()))\n    return sorted_modified_dict\n", "entry_point": "modify_dict", "input": "{False: True, 4: False, 6: True}", "output": "{True: False, 4: False, 6: True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6343_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020991", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'eom.com'", "output": "'eom.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020992", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[-4, 1, -2, 0, -1, 1, 2, 0]", "output": "[-3, -1, -2, -1, 0, 3, 2, -4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020993", "code": "def check_allocation_mismatch(resource_class, traits):\n    return any(trait == resource_class for trait in traits)\n", "entry_point": "check_allocation_mismatch", "input": "'Resource A', ['Resource B', 'Resource C']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141020_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020994", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'mus_icap'", "output": "'Mus Icap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "298", "output": "{1, 298, 2, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020996", "code": "import re\nimport argparse\ndef validate_aligner(aligner_str):\n    aligner_str = aligner_str.lower()\n    aligner_pattern = \"star|subread\"\n    if not re.match(aligner_pattern, aligner_str):\n        error = \"Aligner to be used (STAR|Subread)\"\n        raise argparse.ArgumentTypeError(error)\n    else:\n        return aligner_str\n", "entry_point": "validate_aligner", "input": "'starsttar'", "output": "'starsttar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52623_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020997", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 4, 14, 4, 4, 14, 2]", "output": "[6, 6, 16, 6, 6, 16, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45782_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3702", "output": "{1, 2, 3, 6, 617, 1234, 3702, 1851}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0020999", "code": "import re\ndef parse_setup_function(setup_call):\n    package_details = {}\n    # Regular expression pattern to match key-value pairs\n    pattern = r\"(\\w+)\\s*=\\s*['\\\"](.*?)['\\\"]\"\n    # Extract key-value pairs using regex\n    matches = re.findall(pattern, setup_call)\n    # Populate the package_details dictionary\n    for match in matches:\n        key, value = match\n        if key == 'packages':\n            value = value.split(',')\n            value = [pkg.strip() for pkg in value]\n        package_details[key] = value\n    return package_details\n", "entry_point": "parse_setup_function", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101702_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021000", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2222", "output": "{1, 2, 101, 202, 11, 2222, 22, 1111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4974", "output": "{1, 2, 3, 6, 4974, 2487, 1658, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4973", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021002", "code": "import collections\ndef rearrange_string(s: str, k: int) -> str:\n    res = []\n    d = collections.defaultdict(int)\n    # Count the frequency of each character\n    for c in s:\n        d[c] += 1\n    v = collections.defaultdict(int)\n    for i in range(len(s)):\n        c = None\n        for key in d:\n            if (not c or d[key] > d[c]) and d[key] > 0 and v[key] <= i + k:\n                c = key\n        if not c:\n            return ''\n        res.append(c)\n        d[c] -= 1\n        v[c] = i + k\n    return ''.join(res)\n", "entry_point": "rearrange_string", "input": "'aaabc', 2", "output": "'aaabc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4736_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3722", "output": "{1, 3722, 2, 1861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3721", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021004", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average", "input": "[90, 92, 93, 94, 100]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143747_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021005", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "215", "output": "{1, 43, 5, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021006", "code": "def custom_translate(original_text, translation_dict):\n    words = original_text.split()\n    translated_words = [translation_dict.get(word, word) for word in words]\n    translated_text = ' '.join(translated_words)\n    return translated_text\n", "entry_point": "custom_translate", "input": "'Hello,', {'Hello,': 'Hello,'}", "output": "'Hello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109587_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021007", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'pppppp', 0", "output": "'pppppp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021008", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8009", "output": "{8009, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8008", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021009", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'aThis rt text.'", "output": "'aThis rt text.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021010", "code": "from typing import List\ndef calculate_total_bloom(logs: List[List[int]]) -> int:\n    total_bloom = 0\n    for log in logs:\n        log_bloom = 0\n        for bloomable in log:\n            log_bloom |= bloomable\n        total_bloom |= log_bloom\n    return total_bloom\n", "entry_point": "calculate_total_bloom", "input": "[[1, 2], [4]]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67316_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021011", "code": "def odIDsStringFromDictionary(dictionary):\n    odIDs_list = []\n    for day, ids in dictionary.items():\n        fromID = 'None' if ids[0] is None else ids[0]\n        toID = 'None' if ids[1] is None else ids[1]\n        odIDs_list.append(f\"{day}: {fromID} - {toID}\")\n    return ','.join(odIDs_list)\n", "entry_point": "odIDsStringFromDictionary", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56715_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021012", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[5, 4, 0, 6, 1, 1]", "output": "[5, 4, 0, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021013", "code": "def is_locale_independent(path):\n    MEDIA_URL = \"/media/\"  # Example MEDIA_URL\n    LOCALE_INDEPENDENT_PATHS = [\"/public/\", \"/static/\"]  # Example LOCALE_INDEPENDENT_PATHS\n    if MEDIA_URL and path.startswith(MEDIA_URL):\n        return True\n    for pattern in LOCALE_INDEPENDENT_PATHS:\n        if pattern in path:\n            return True\n    return False\n", "entry_point": "is_locale_independent", "input": "'/media/images/photo.png'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74853_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021014", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9398", "output": "{1, 2, 37, 74, 9398, 4699, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021015", "code": "def product_except_current(nums):\n    n = len(nums)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products of elements to the left of the current element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * nums[i - 1]\n    # Calculate products of elements to the right of the current element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * nums[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "product_except_current", "input": "[0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106050_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021016", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "1, 1829, 1", "output": "1829", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1215", "output": "{1, 3, 5, 135, 9, 45, 15, 81, 243, 405, 27, 1215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021018", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'12.345/61.890'", "output": "('12.345', '61.890')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021019", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<<EIMAIL<EMAIL>>>'", "output": "'<<EIMAIL<EMAIL>>>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021020", "code": "from typing import List, Dict, Union, Tuple\ndef process_advances(advance_entries: List[Dict[str, Union[str, int]]]) -> Tuple[List[Dict[str, Union[str, int]]], int]:\n    total_allocated = 0\n    advances = []\n    for entry in advance_entries:\n        advances.append(entry)\n        total_allocated += entry.get(\"Amount\", 0)\n    return advances, total_allocated\n", "entry_point": "process_advances", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "([{}, {}, {}, {}, {}, {}, {}, {}], 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127428_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021021", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "14", "output": "'14'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021022", "code": "def parse_github_credentials(credentials):\n    github_dict = {}\n    for credential in credentials:\n        key, value = credential.split('=')\n        github_dict[key] = value\n    return github_dict\n", "entry_point": "parse_github_credentials", "input": "['TOKEN=token123', 'ORG=company']", "output": "{'TOKEN': 'token123', 'ORG': 'company'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120672_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021023", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<div>Welcome to the world</div>'", "output": "'Welcome to the world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4381", "output": "{337, 1, 13, 4381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021025", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5409", "output": "{1, 5409, 3, 9, 1803, 601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021026", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'quicThek'", "output": "'quicThek'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021027", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'hh'", "output": "'xmlns:__NAMESPACE__=\"hh\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021028", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'aacaccuracycuacy'", "output": "'aacaccuracycuacy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021029", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'is!'", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2941", "output": "{1, 2941, 17, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021031", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i] + input_list[i+1])\n        elif i == len(input_list) - 1:\n            output_list.append(input_list[i-1] + input_list[i])\n        else:\n            output_list.append(input_list[i-1] + input_list[i] + input_list[i+1])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[2, 3, 1, 3, 1, 3, 3]", "output": "[5, 6, 7, 5, 7, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13642_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021032", "code": "def merge_dictionaries(dict1, dict2):\n    merged_dict = dict(dict1)  # Create a copy of dict1 to start with\n    for key, value in dict2.items():\n        merged_dict[key] = value  # Update merged_dict with key-value pairs from dict2\n    return merged_dict\n", "entry_point": "merge_dictionaries", "input": "{}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11180_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021033", "code": "def capitalize_last_letter(string):\n    modified_string = \"\"\n    for word in string.split():\n        if len(word) > 1:\n            modified_word = word[:-1] + word[-1].upper()\n        else:\n            modified_word = word.upper()\n        modified_string += modified_word + \" \"\n    return modified_string[:-1]  # Remove the extra space at the end\n", "entry_point": "capitalize_last_letter", "input": "'saetxtnds'", "output": "'saetxtndS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101043_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021034", "code": "def count_pairs(nums, target):\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        if target - num in num_freq and num_freq[target - num] > 0:\n            pair_count += 1\n            num_freq[target - num] -= 1\n        else:\n            num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs", "input": "[1, 1, 2, 5, 3, 4, 3], 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82729_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021035", "code": "def transpose_matrix(matrix):\n    if not matrix:\n        return []\n    num_rows = len(matrix)\n    num_cols = len(matrix[0])\n    transpose = []\n    for col in range(num_cols):\n        new_row = []\n        for row in range(num_rows):\n            new_row.append(matrix[row][col])\n        transpose.append(new_row)\n    return transpose\n", "entry_point": "transpose_matrix", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[1, 4, 7], [2, 5, 8], [3, 6, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021036", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[1, 0, 0, 0, 1, 1, 0, 2] + [0] * 18", "output": "'aefhh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021037", "code": "def sequence_filter(skeleton, angle_indices):\n    \"\"\"This function checks whether a sequence of frames is sufficiently dense before being used for analysis.\n    Args:\n    skeleton (list): A sequence of frames.\n    angle_indices (list): A list of angle indices.\n    Returns:\n    list or int: Filtered angle indices based on the specified criteria.\n    \"\"\"\n    ratio = len(angle_indices) / len(skeleton)\n    if ratio > 0.7:\n        return angle_indices\n    else:\n        return 0\n", "entry_point": "sequence_filter", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83346_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021038", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[2, 1, 5, 4]", "output": "[2, 1, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7831", "output": "{1, 41, 191, 7831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021040", "code": "def format_device_info(expected_output):\n    formatted_info = []\n    for key, value in expected_output.items():\n        formatted_info.append(f\"{key.capitalize()}: {value}\")\n    return '\\n'.join(formatted_info)\n", "entry_point": "format_device_info", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109422_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021041", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "993", "output": "{1, 331, 3, 993}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021042", "code": "def highest_card_wins(player1_card, player2_card):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_rank = player1_card[:-1]\n    player2_rank = player2_card[:-1]\n    player1_value = card_values[player1_rank]\n    player2_value = card_values[player2_rank]\n    if player1_value > player2_value:\n        return 1\n    elif player1_value < player2_value:\n        return 2\n    else:\n        return \"It's a tie!\"\n", "entry_point": "highest_card_wins", "input": "'A\u2660', 'K\u2666'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90012_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021043", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('a')[0])  # Remove any additional alpha characters\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.2.0'", "output": "(0, 2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101817_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021044", "code": "import os\ndef determine_file_location(relative_root: str, location_type: str, root_folder: str = '') -> str:\n    MS_DATA = os.getenv('MS_DATA', '')  # Get the value of MS_DATA environment variable or default to empty string\n    if location_type == 'LOCAL':\n        full_path = os.path.join(root_folder, relative_root)\n    elif location_type == 'S3':\n        full_path = os.path.join('s3://' + root_folder, relative_root)\n    else:\n        raise ValueError(\"Invalid location type. Supported types are 'LOCAL' and 'S3'.\")\n    return full_path\n", "entry_point": "determine_file_location", "input": "'data/logs.txt', 'S3', 'log-bucket'", "output": "'s3://log-bucket/data/logs.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7795_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021045", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "8", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021046", "code": "def merge(left_array, right_array):\n    merged = []\n    left_pointer = right_pointer = 0\n    while left_pointer < len(left_array) and right_pointer < len(right_array):\n        if left_array[left_pointer] < right_array[right_pointer]:\n            merged.append(left_array[left_pointer])\n            left_pointer += 1\n        else:\n            merged.append(right_array[right_pointer])\n            right_pointer += 1\n    merged.extend(left_array[left_pointer:])\n    merged.extend(right_array[right_pointer:])\n    return merged\n", "entry_point": "merge", "input": "[4, 6, 6], [2, 4, 5, 6]", "output": "[2, 4, 4, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74073_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021047", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[10, 5, 6]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021048", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021049", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7179", "output": "{3, 1, 7179, 2393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7178", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6061", "output": "{1, 551, 11, 6061, 209, 19, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6060", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021051", "code": "from typing import List\ndef total_visible_skyline(buildings: List[int]) -> int:\n    total_skyline = 0\n    max_height = 0\n    for height in buildings:\n        if height > max_height:\n            total_skyline += height - max_height\n            max_height = height\n    return total_skyline\n", "entry_point": "total_visible_skyline", "input": "[1, 2, 1, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115607_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021052", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4542", "output": "{1, 2, 3, 6, 1514, 757, 4542, 2271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4541", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021054", "code": "def add_binary(a, b):\n    # Convert binary strings to decimal integers\n    int_a = int(a, 2)\n    int_b = int(b, 2)\n    # Add the decimal integers\n    sum_decimal = int_a + int_b\n    # Convert the sum back to binary representation\n    return bin(sum_decimal)[2:]\n", "entry_point": "add_binary", "input": "'10100', '10'", "output": "'10110'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38045_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021055", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'11.111.5'", "output": "(11, 111, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021056", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "200.0, 100.0", "output": "(-100.0, 100.0, 85.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021057", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[-2, 5, 6, 2, -1, -1, 3, 5, 2]", "output": "[3, 11, 8, 1, -2, 2, 8, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26581_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021058", "code": "def sum_multiples_of_3_not_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_not_5", "input": "[3, 12]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108735_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021059", "code": "def generate_response(message):\n    channel_id = 'CNCRFR7KP'\n    team_id = 'TE4VDPM2L'\n    user_id = 'UE6P69HFH'\n    response_url = \"no\"\n    channel_name = \"local\"\n    if \"lambda\" in message:\n        return \"lambda_function\"\n    if channel_id in message and team_id in message and user_id in message:\n        return \"channel_team_user\"\n    if response_url == \"no\" and \"no\" in message:\n        return \"no_response\"\n    if channel_name == \"local\" and \"local\" in message:\n        return \"local_channel\"\n    return \"No matching rule found.\"\n", "entry_point": "generate_response", "input": "'test lambda response'", "output": "'lambda_function'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78868_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021060", "code": "def zellerAlgorithm(year, month, day):\n    if month in [1, 2]:\n        y1 = year - 1\n        m1 = month + 12\n    else:\n        y1 = year\n        m1 = month\n    y2 = y1 % 100\n    c = y1 // 100\n    day_of_week = (day + (13 * (m1 + 1)) // 5 + y2 + y2 // 4 + c // 4 - 2 * c) % 7\n    return day_of_week\n", "entry_point": "zellerAlgorithm", "input": "2022, 5, 12", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86862_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021061", "code": "def process_integers(integer_list):\n    total = 0\n    for num in integer_list:\n        if num > 0:\n            total += num ** 2\n        elif num < 0:\n            total -= abs(num) / 2\n    return total\n", "entry_point": "process_integers", "input": "[-19]", "output": "-9.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92247_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021062", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[9, 16, 18, 27, 36, 45]", "output": "[9, 7, 9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021063", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[4, 4, 2, 1, 3, 4, 2, 9, 4]", "output": "[1, 2, 2, 3, 4, 4, 4, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021064", "code": "def calculate_dot_product(dense_vector, sparse_vector):\n    dot_product = 0.0\n    if isinstance(sparse_vector, dict):\n        for index, value in sparse_vector.items():\n            dot_product += value * dense_vector[index]\n    elif isinstance(sparse_vector, list):\n        for index, value in sparse_vector:\n            dot_product += value * dense_vector[index]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[2, 3, 1], {0: 1, 1: 2, 2: 3}", "output": "11.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143255_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021065", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'thisis'", "output": "['thisis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6884", "output": "{1, 2, 6884, 4, 3442, 1721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6883", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4474", "output": "{1, 4474, 2, 2237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021068", "code": "_HORNS_       = 0\n_SIDEBANDS_   = 1\n_FREQUENCY_   = 2\n_TIME_        = 3\n_COMAPDATA_ = {'spectrometer/tod': [_HORNS_, _SIDEBANDS_, _FREQUENCY_, _TIME_],\n               'spectrometer/MJD': [_TIME_],\n               'spectrometer/pixel_pointing/pixel_ra': [_HORNS_, _TIME_],\n               'spectrometer/pixel_pointing/pixel_dec': [_HORNS_, _TIME_],\n               'spectrometer/pixel_pointing/pixel_az': [_HORNS_, _TIME_],   \n               'spectrometer/pixel_pointing/pixel_el': [_HORNS_, _TIME_],\n               'spectrometer/frequency': [_SIDEBANDS_, _FREQUENCY_],\n               'spectrometer/time_average': [_HORNS_, _SIDEBANDS_, _FREQUENCY_],\n               'spectrometer/band_average': [_HORNS_, _SIDEBANDS_, _TIME_],\n               'spectrometer/bands': [_SIDEBANDS_],\n               'spectrometer/feeds': [_HORNS_]}\ndef process_data_file(data_path):\n    return _COMAPDATA_.get(data_path, \"Data path not found\")\n", "entry_point": "process_data_file", "input": "'spectrometer/frequency'", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117446_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021069", "code": "from typing import List, Tuple\ndef calculate_extra_points(course_list: List[Tuple[str, int]]) -> int:\n    total_points = 0\n    for course, points in course_list:\n        total_points += points\n    return total_points\n", "entry_point": "calculate_extra_points", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69310_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021070", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'PPytyiiin'", "output": "['PPytyiiin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021071", "code": "import json\nWEEKLY_FEED = {\n    'name': 'unpaywall-data-feed',\n    'bucket': 'unpaywall-data-feed',\n    'changefile-endpoint': 'feed/changefile',\n    'interval': 'week',\n    'file_dates': lambda filename: {\n        'from_date': filename.split(\"_\")[0].split(\"T\")[0],\n        'to_date': filename.split(\"_\")[2].split(\"T\")[0]\n    },\n}\ndef extract_dates_from_filename(filename):\n    return WEEKLY_FEED['file_dates'](filename)\n", "entry_point": "extract_dates_from_filename", "input": "'2022-01-01_data_ata.csv'", "output": "{'from_date': '2022-01-01', 'to_date': 'ata.csv'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56947_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021072", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "'   foronn   '", "output": "'foronn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4314", "output": "{1, 2, 3, 6, 2157, 719, 4314, 1438}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4313", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021074", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1231", "output": "{1, 1231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021075", "code": "import re\ndef extract_version(input_string):\n    pattern = r'__version__ = \"([^\"]+)\"'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group(1)\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version", "input": "'__version__ = \".1\"'", "output": "'.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101396_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021076", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[1, 0, 1, 1, 1, 4]", "output": "[1, 0, 1, 1, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021077", "code": "import math\ndef cosine_similarity(vector1, vector2):\n    dot_product = sum(v1 * v2 for v1, v2 in zip(vector1, vector2))\n    magnitude_v1 = math.sqrt(sum(v1 ** 2 for v1 in vector1))\n    magnitude_v2 = math.sqrt(sum(v2 ** 2 for v2 in vector2))\n    if magnitude_v1 == 0 or magnitude_v2 == 0:\n        return 0.0  # Handle division by zero\n    return dot_product / (magnitude_v1 * magnitude_v2)\n", "entry_point": "cosine_similarity", "input": "[0.0, 0.0], [1.0, 2.0]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94860_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021078", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[9, 8, 7, 7, 3, 2, 2, 1]", "output": "[81, 64, 49, 49, 9, 4, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021079", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'utc/imo.pg'", "output": "('utc', 'imo.pg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021080", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.14.33'", "output": "(3, 14, 33)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021081", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'datta/utput.txt'", "output": "'/tmp/ml4pl/datta/utput.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021082", "code": "def modify_cols(variable_and_features, variables_checked, cols):\n    modified_cols = []\n    for col in cols:\n        if col in variable_and_features and col in variables_checked:\n            modified_cols.append(col)\n    return modified_cols\n", "entry_point": "modify_cols", "input": "[1, 2, 4, 5], [2, 4, 6], [1, 2, 3, 4, 5]", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76871_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021083", "code": "def min_palindrome_cuts(s):\n    cut = [x for x in range(-1, len(s) + 1)]\n    for i in range(len(s)):\n        r1, r2 = 0, 0\n        # Odd palindrome\n        while i - r1 >= 0 and i + r1 < len(s) and s[i - r1] == s[i + r1]:\n            cut[i + r1 + 1] = min(cut[i + r1 + 1], cut[i - r1] + 1)\n            r1 += 1\n        # Even palindrome\n        while i - r2 >= 0 and i + r2 + 1 < len(s) and s[i - r2] == s[i + r2 + 1]:\n            cut[i + r2 + 2] = min(cut[i + r2 + 2], cut[i - r2] + 1)\n            r2 += 1\n    return cut[-1]\n", "entry_point": "min_palindrome_cuts", "input": "'abcdefghijkl'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96332_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021084", "code": "def get_char_width(char):\n    def _char_in_map(char, map):\n        for begin, end in map:\n            if char < begin:\n                break\n            if begin <= char <= end:\n                return True\n        return False\n    char = ord(char)\n    _COMBINING_CHARS = [(768, 879)]\n    _EAST_ASIAN_WILD_CHARS = [(11904, 55215)]  # Example range for East Asian wide characters\n    if _char_in_map(char, _COMBINING_CHARS):\n        return 0\n    if _char_in_map(char, _EAST_ASIAN_WILD_CHARS):\n        return 2\n    return 1\n", "entry_point": "get_char_width", "input": "'\u65e5'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65761_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7247", "output": "{1, 7247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1443", "output": "{1, 481, 3, 1443, 37, 39, 13, 111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021087", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7079", "output": "{1, 7079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021088", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{}, -1", "output": "[-1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021089", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[6, 7, 5, 1, 2, 1]", "output": "[[7], [2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7796", "output": "{1, 2, 4, 7796, 3898, 1949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7795", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021091", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6445", "output": "{1, 5, 6445, 1289}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021092", "code": "def diagnose(data):\n    char_counts = {}\n    for char in data:\n        if char in char_counts:\n            char_counts[char] += 1\n        else:\n            char_counts[char] = 1\n    return char_counts\n", "entry_point": "diagnose", "input": "'le'", "output": "{'l': 1, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98386_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021093", "code": "def translate(phrase):\n    vowels = \"aeiouAEIOU\"\n    translated_words = []\n    for word in phrase.split():\n        if word[0] in vowels:\n            translated_word = word + \"way\"\n        else:\n            translated_word = word[1:] + word[0] + \"ay\"\n        # Preserve original capitalization\n        if word.istitle():\n            translated_word = translated_word.capitalize()\n        elif word.isupper():\n            translated_word = translated_word.upper()\n        translated_words.append(translated_word)\n    return ' '.join(translated_words)\n", "entry_point": "translate", "input": "'Hello World'", "output": "'Ellohay Orldway'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133119_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7918", "output": "{1, 2, 37, 74, 107, 7918, 214, 3959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7917", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021095", "code": "def merge_intervals(arr1, arr2):\n    l = min(min(arr1), min(arr2))\n    r = max(max(arr1), max(arr2))\n    return [l, r]\n", "entry_point": "merge_intervals", "input": "[0], [5]", "output": "[0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98126_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021096", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[30, 20, 10], 1", "output": "[30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021097", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    excluded_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(excluded_scores)\n    average = total / len(excluded_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[67, 70, 70, 75, 71]", "output": "70.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103708_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5314", "output": "{2657, 1, 5314, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5313", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021099", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'qtof', 'separated'", "output": "{'tolerance': 0.01, 'mode': 'separated'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "465", "output": "{1, 3, 5, 15, 465, 155, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021101", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "0.05", "output": "2.5e-05", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021102", "code": "from typing import List\ndef most_frequent_item_id(item_ids: List[int]) -> int:\n    frequency = {}\n    for item_id in item_ids:\n        frequency[item_id] = frequency.get(item_id, 0) + 1\n    max_frequency = max(frequency.values())\n    most_frequent_ids = [item_id for item_id, freq in frequency.items() if freq == max_frequency]\n    return min(most_frequent_ids)\n", "entry_point": "most_frequent_item_id", "input": "[-2, -2, -2, 0, 1]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7393_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021103", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{2, 3}, {4, 5, 7}", "output": "{2, 3, 4, 5, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021104", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "12.740000000000004, 0.1", "output": "12.740000000000004", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5053", "output": "{1, 163, 5053, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021106", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "4, 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5066", "output": "{1, 2, 34, 2533, 5066, 298, 17, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7305", "output": "{1, 3, 2435, 5, 487, 7305, 15, 1461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021109", "code": "def duplicate_characters(input_str):\n    output_str = \"\"\n    for char in input_str:\n        output_str += char * 2\n    return output_str\n", "entry_point": "duplicate_characters", "input": "'Hello'", "output": "'HHeelllloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45209_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021110", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:\n            modified_list.append(num + 10)\n        elif num % 2 != 0:\n            modified_list.append(num - 5)\n        if num % 5 == 0:\n            modified_list[-1] *= 2  # Double the last element added\n    return modified_list\n", "entry_point": "process_integers", "input": "[3, 4, 12, 12, 14, -4, 2, 14, 3]", "output": "[-2, 14, 22, 22, 24, 6, 12, 24, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147631_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021111", "code": "def blueprint(rows):\n    blueprint_pattern = []\n    for i in range(1, rows + 1):\n        row = []\n        if i % 2 != 0:  # Odd row\n            for j in range(1, i + 1):\n                row.append(j)\n        else:  # Even row\n            for j in range(ord('A'), ord('A') + i):\n                row.append(chr(j))\n        blueprint_pattern.append(row)\n    return blueprint_pattern\n", "entry_point": "blueprint", "input": "1", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141993_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1019", "output": "{1, 1019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021113", "code": "def count_sublists_with_non_zero_or_negative_elements(gt):\n    count = 0\n    for sublist in gt:\n        for element in sublist:\n            if element != 0 and element != -1:\n                count += 1\n                break\n    return count\n", "entry_point": "count_sublists_with_non_zero_or_negative_elements", "input": "[[], [0], [-1]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70406_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021114", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[5, 10]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021115", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[18]", "output": "'0x12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021116", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[4, 4, 5, 5, 5, -1, 2, 1, -2]", "output": "{4: 2, 5: 3, -1: 1, 2: 1, 1: 1, -2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021117", "code": "from typing import List\ndef above_average_indices(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    average = sum(lst) / len(lst)\n    above_avg_indices = [i for i, num in enumerate(lst) if num > average]\n    return above_avg_indices\n", "entry_point": "above_average_indices", "input": "[1, 2, 6, 7, 8, 9, 0, 5]", "output": "[2, 3, 4, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142894_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2271", "output": "{1, 3, 757, 2271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021119", "code": "def process_allowed_hosts(allowed_hosts_str):\n    if not allowed_hosts_str:\n        return []\n    allowed_hosts = set()\n    for host in allowed_hosts_str.split(','):\n        host = host.strip()\n        if host:\n            allowed_hosts.add(host)\n    return list(allowed_hosts)\n", "entry_point": "process_allowed_hosts", "input": "'mm'", "output": "['mm']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75961_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021120", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, -1], 1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "511", "output": "{73, 1, 7, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021122", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "7, 8, 1", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021123", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6839", "output": "{1, 7, 977, 6839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021124", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'file'", "output": "'file_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021125", "code": "def text_converter(input_text, conversion_type):\n    words = input_text.split()\n    if conversion_type == \"reverse\":\n        converted_text = ' '.join(reversed(words))\n    elif conversion_type == \"capitalize\":\n        converted_text = ' '.join(word.capitalize() for word in words)\n    else:\n        return \"Invalid conversion type. Please choose 'reverse' or 'capitalize'.\"\n    return converted_text\n", "entry_point": "text_converter", "input": "'hello world', 'capitalize'", "output": "'Hello World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145071_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021126", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "0, 10, 1", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021127", "code": "import re\ndef repair_move_path(path: str) -> str:\n    # Define a regular expression pattern to match elements like '{org=>com}'\n    FILE_PATH_RENAME_RE = re.compile(r'\\{([^}]+)=>([^}]+)\\}')\n    # Replace the matched elements with the desired format using re.sub\n    return FILE_PATH_RENAME_RE.sub(r'\\2', path)\n", "entry_point": "repair_move_path", "input": "'/folder/xyz/{old_data.txt=>data.txt}'", "output": "'/folder/xyz/data.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137172_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021128", "code": "def organize_plugins(plugins):\n    loading_order = {'std': 1, 'math': 2, 'io': 3, 'wx': 4, 'xray': 5, 'xrf': 6, 'xafs': 7}\n    max_order = max(loading_order.values()) + 1\n    def key_func(plugin):\n        return loading_order.get(plugin, max_order)\n    return sorted(plugins, key=key_func)\n", "entry_point": "organize_plugins", "input": "['math', 'iioo', 'dstd']", "output": "['math', 'iioo', 'dstd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10925_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021129", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'orape'", "output": "['orape']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021130", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "4.60013862, 5", "output": "49.60013862", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021131", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021132", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4525", "output": "{1, 5, 905, 4525, 181, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4524", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021133", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 81, 80, 70, 50]", "output": "[100, 81, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021134", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'10:45:30, something else'", "output": "{'when': '10:45:30', 'hour': '10:45:30'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021135", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'hello worlheelholo'", "output": "'worlheelholo hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021136", "code": "def evaluate_expressions(expressions):\n    results = []\n    for expression in expressions:\n        result = eval(expression)\n        results.append(result)\n    return results\n", "entry_point": "evaluate_expressions", "input": "['4 + 4', '10 / 2', '3 * 5', '16 / 2', '30 + 3']", "output": "[8, 5.0, 15, 8.0, 33]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56248_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021137", "code": "from typing import List, Dict\nALLOWED_EXTENSIONS = ['png', 'jpg', 'jpeg']\ndef check_allowed_extensions(file_names: List[str]) -> Dict[str, bool]:\n    result = {}\n    for file_name in file_names:\n        extension = file_name.split('.')[-1].lower()\n        result[file_name] = extension in ALLOWED_EXTENSIONS\n    return result\n", "entry_point": "check_allowed_extensions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144182_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021138", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[25, 11, 63, 22, 90, 11, 64, 64, 12]", "output": "[11, 11, 12, 22, 25, 63, 64, 64, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021139", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'hello world'", "output": "'olleh dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021140", "code": "from collections import defaultdict, deque\ndef find_task_order(dependencies):\n    graph = defaultdict(list)\n    indegree = defaultdict(int)\n    for dependency in dependencies:\n        parent, child = dependency\n        graph[parent].append(child)\n        indegree[child] += 1\n        indegree[parent]  # Ensure all tasks are included in indegree\n    tasks = set(graph.keys()).union(set(indegree.keys()))\n    queue = deque([task for task in tasks if indegree[task] == 0])\n    task_order = []\n    while queue:\n        current_task = queue.popleft()\n        task_order.append(current_task)\n        for dependent_task in graph[current_task]:\n            indegree[dependent_task] -= 1\n            if indegree[dependent_task] == 0:\n                queue.append(dependent_task)\n    return task_order if len(task_order) == len(tasks) else []\n", "entry_point": "find_task_order", "input": "[('A', 'B'), ('B', 'C'), ('C', 'D')]", "output": "['A', 'B', 'C', 'D']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8859_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021141", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'scra!'", "output": "['scra']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021142", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[3, 3, 6, 5, 6, 3, 5, 0]", "output": "[6, 6, 12, 10, 12, 6, 10, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021143", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021144", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "1.941585, 5", "output": "1.94159", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021145", "code": "def calculate_max_vertical_deviation(image_dims, ground_truth_horizon, detected_horizon):\n    width, height = image_dims\n    def gt(x):\n        return ground_truth_horizon[0] * x + ground_truth_horizon[1]\n    def dt(x):\n        return detected_horizon[0] * x + detected_horizon[1]\n    if ground_truth_horizon is None or detected_horizon is None:\n        return None\n    max_deviation = max(abs(gt(0) - dt(0)), abs(gt(width) - dt(width)))\n    normalized_deviation = max_deviation / height\n    return normalized_deviation\n", "entry_point": "calculate_max_vertical_deviation", "input": "(100, 200), (1, 0), (1, 0)", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_623_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021146", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[1, 5, 4, 0, 4, 1]", "output": "[1, 125, 16, 0, 16, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021147", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8801", "output": "{1, 13, 8801, 677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021148", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8885", "output": "{1, 5, 1777, 8885}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021149", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/', 'css/style.cs'", "output": "'/css/style.cs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4919", "output": "{1, 4919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021151", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "9", "output": "[1, 0, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021152", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7382", "output": "{1, 2, 3691, 7382}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4251", "output": "{1, 3, 327, 39, 1417, 13, 109, 4251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021154", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[2, 2, 5]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122742_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021155", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7147", "output": "{1, 7147, 1021, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3908", "output": "{1, 1954, 2, 3908, 4, 977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3907", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021157", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4792", "output": "{1, 2, 4, 8, 1198, 599, 4792, 2396}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4791", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021158", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'eg.com'", "output": "'eg.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021159", "code": "def count_digit_one(n):\n    count = 0\n    for num in range(1, n + 1):\n        count += str(num).count('1')\n    return count\n", "entry_point": "count_digit_one", "input": "12", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41035_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021160", "code": "from typing import List, Tuple, Dict\ndef apply_migrations(migrations: List[Tuple[str, str, str]]) -> Dict[str, List[str]]:\n    schema = {}\n    for model, field, _ in migrations:\n        if model not in schema:\n            schema[model] = [field]\n        else:\n            schema[model].append(field)\n    return schema\n", "entry_point": "apply_migrations", "input": "[('Profile', 'bio', 'some_extra_info')]", "output": "{'Profile': ['bio']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82589_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021161", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[7, 0], [9, 1], [8, 2]]", "output": "[[7], [9], [8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7301", "output": "{1, 7301, 7, 49, 1043, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021163", "code": "from typing import List\ndef find_first_occurrence(data_changed_flags: List[int]) -> int:\n    for index, value in enumerate(data_changed_flags):\n        if value == 1:\n            return index\n    return -1\n", "entry_point": "find_first_occurrence", "input": "[0, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32380_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021164", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'helllhheoo'", "output": "b'\\n\\x00\\x00\\x00helllhheoo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021165", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9339", "output": "{1, 33, 3, 3113, 11, 283, 849, 9339}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021166", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'java programming language', 'London'", "output": "'java programming language London'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021167", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['1000', '+', '1000', '-', '4077']", "output": "-2077", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021168", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[-1, 4, 5, 0, 3, 4, 5, 0]", "output": "[-1, 5, 7, 3, 7, 9, 11, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021169", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[5, 9, 8, 7, 10, 8, 11]", "output": "8.285714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021170", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'examplehello he'", "output": "['examplehello', 'he']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021171", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "-1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021172", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021173", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'1.0.0'", "output": "'1.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021174", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[5, 10, 15, 25]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44965_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021175", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7285", "output": "{1, 5, 235, 47, 1457, 7285, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021176", "code": "def extract_major_version(version: str) -> int:\n    # Find the index of the first dot in the version string\n    dot_index = version.find('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version[:dot_index] if dot_index != -1 else version\n    # Convert the substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'513.0.0'", "output": "513", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134353_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021177", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'I&#3&#3'", "output": "'I&#3&#3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021178", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size = sum(file_sizes)\n    return total_size // 1024\n", "entry_point": "total_size_in_kb", "input": "[6144]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13519_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021179", "code": "def handle_command(command):\n    command_responses = {\n        \"!hello\": \"Hello there!\",\n        \"!time\": \"The current time is 12:00 PM.\",\n        \"!weather\": \"The weather today is sunny.\",\n        \"!help\": \"You can ask me about the time, weather, or just say hello!\"\n    }\n    return command_responses.get(command, \"Sorry, I don't understand that command.\")\n", "entry_point": "handle_command", "input": "'!time'", "output": "'The current time is 12:00 PM.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123108_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021180", "code": "def find_example_idx(n, cum_sums, idx=0):\n    N = len(cum_sums)\n    stack = [[0, N-1]]\n    while stack:\n        start, end = stack.pop()\n        search_i = (start + end) // 2\n        if start < end:\n            if n < cum_sums[search_i]:\n                stack.append([start, search_i])\n            else:\n                stack.append([search_i + 1, end])\n        else:\n            if n < cum_sums[start]:\n                return idx + start\n            else:\n                return idx + start + 1\n", "entry_point": "find_example_idx", "input": "4.1, [1, 2, 3, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89652_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021181", "code": "from typing import List\ndef count_scrolls(scroll_heights: List[int]) -> int:\n    scroll_count = 0\n    for i in range(1, len(scroll_heights)):\n        if scroll_heights[i] > scroll_heights[i - 1]:\n            scroll_count += 1\n    return scroll_count\n", "entry_point": "count_scrolls", "input": "[1, 2, 3, 1, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70066_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021182", "code": "from typing import List\ndef generate_table_name(existing_table_names: List[str]) -> str:\n    counter = 1\n    while True:\n        new_table_name = f\"new_tbl_{counter}\"\n        if new_table_name not in existing_table_names:\n            return new_table_name\n        counter += 1\n", "entry_point": "generate_table_name", "input": "['new_tbl_1']", "output": "'new_tbl_2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86287_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021183", "code": "def shortest_distance_to_char(S, C):\n    cp = [i for i, s in enumerate(S) if s == C]\n    result = []\n    for i, s in enumerate(S):\n        result.append(min(abs(i - x) for x in cp))\n    return result\n", "entry_point": "shortest_distance_to_char", "input": "'AAAAAAC', 'C'", "output": "[6, 5, 4, 3, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98860_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021184", "code": "def count_attachments_per_volume(volume_attachments):\n    attachment_count = {}\n    for attachment in volume_attachments:\n        volume_id = attachment['id']\n        if volume_id in attachment_count:\n            attachment_count[volume_id] += 1\n        else:\n            attachment_count[volume_id] = 1\n    return attachment_count\n", "entry_point": "count_attachments_per_volume", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65413_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021185", "code": "def unique_sum(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 != 0 or num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "unique_sum", "input": "[1, 2, 5, 10, 20]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140817_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1538", "output": "{1, 1538, 2, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021187", "code": "def encrypt_text(text: str, k: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        new_ascii = ord(char) + k\n        if new_ascii > 126:\n            new_ascii = 32 + (new_ascii - 127)\n        encrypted_text += chr(new_ascii)\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'VGcG', 5", "output": "'[LhL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40126_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021188", "code": "from typing import List\ndef count_elements_not_in_d(b: List[int], d: List[int]) -> int:\n    set_b = set(b)\n    set_d = set(d)\n    return len(set_b.difference(set_d))\n", "entry_point": "count_elements_not_in_d", "input": "[5], [1, 2, 3, 4]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83668_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021189", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "11", "output": "[0, 1, 1, 1, 2, 3, 6, 9, 15, 135, 150]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021190", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 88, 87, 82, 75], 3", "output": "88.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13203_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021191", "code": "def generate_response(status_code, headers):\n    # Mimic the behavior of start_response function\n    return []\n", "entry_point": "generate_response", "input": "200, {'Content-Type': 'text/html'}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1602_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021192", "code": "def calculate_max_trial_value(trial_values):\n    return max(trial_values)\n", "entry_point": "calculate_max_trial_value", "input": "[10, 15, 20, 25, 26]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15346_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "526", "output": "{1, 2, 526, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021194", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'dinner'", "output": "'dinner'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021195", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[33, 34, 34, 25, 64, 22, 89, 62]", "output": "[22, 25, 33, 34, 34, 62, 64, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021196", "code": "def count_special_pairs(n):\n    count = 0\n    for x in range(1, n + 1):\n        for y in range(x, n + 1, x):\n            if (n - (x + y)) % y == 0:\n                count += 1\n    return count\n", "entry_point": "count_special_pairs", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118433_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021197", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -5.0, -4.899999999999999", "output": "-9.899999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021198", "code": "def text_transformation(text: str) -> str:\n    # Convert to lowercase, replace \"deprecated\" with \"obsolete\", strip whitespaces, and reverse the string\n    transformed_text = text.lower().replace(\"deprecated\", \"obsolete\").strip()[::-1]\n    return transformed_text\n", "entry_point": "text_transformation", "input": "'This module is deprecated.'", "output": "'.etelosbo si eludom siht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021199", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "100", "output": "'?100'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021200", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1657", "output": "{1, 1657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021201", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "4", "output": "86", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021202", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[103, 104, 103, 104]", "output": "[103, 104, 103, 104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021203", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "7, 12", "output": "42.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7323", "output": "{3, 1, 2441, 7323}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021205", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 8, 16, 18, 2, 18, 19]", "output": "[1, 8, 49, 729, 16, 59049, 1000000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021206", "code": "def find_first_exceeded_day(tweet_counts):\n    for day, count in enumerate(tweet_counts):\n        if count > 200:\n            return day\n    return -1\n", "entry_point": "find_first_exceeded_day", "input": "[150, 180, 250, 190]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137540_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9543", "output": "{1, 3, 3181, 9543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021208", "code": "def concatenate_string(s, n):\n    result = \"\"\n    for i in range(n):\n        result += s\n    return result\n", "entry_point": "concatenate_string", "input": "'hlo', 6", "output": "'hlohlohlohlohlohlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24778_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021209", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import pandas'", "output": "'pandas'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021210", "code": "def process_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        if i < list_length - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 0, 2, -1, 1, 2, 0, 1]", "output": "[1, 2, 1, 0, 3, 2, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63579_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021211", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "22, 'mode', 1", "output": "{'response': 'InvalidPin', 'pin': 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021212", "code": "OUTPUT_TYPES = ((\".htm\", \"html\"),\n                (\".html\", \"html\"),\n                (\".xml\", \"xml\"),\n                (\".tag\", \"tag\"))\ndef get_file_type(extension: str) -> str:\n    for ext, file_type in OUTPUT_TYPES:\n        if extension == ext:\n            return file_type\n    return \"Unknown\"\n", "entry_point": "get_file_type", "input": "'.html'", "output": "'html'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7593_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9323", "output": "{1, 9323}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021214", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "1, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021215", "code": "from typing import Dict\ndef generate_bytecode_payload(code: str) -> Dict[str, str]:\n    \"\"\"Generate a payload containing only the creation bytecode.\n    :param code: The creation bytecode as hex string starting with :code:`0x`\n    :return: The payload dictionary to be sent to MythX\n    \"\"\"\n    if not code.startswith('0x'):\n        code = '0x' + code\n    return {\"bytecode\": code}\n", "entry_point": "generate_bytecode_payload", "input": "'1230x123456b'", "output": "{'bytecode': '0x1230x123456b'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72375_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021216", "code": "def bank_queue(customers, num_tellers):\n    tellers = {i: [] for i in range(1, num_tellers + 1)}\n    for idx, customer in enumerate(customers):\n        teller_num = (idx % num_tellers) + 1\n        tellers[teller_num].append(customer)\n    return [tellers[i] for i in tellers]\n", "entry_point": "bank_queue", "input": "[], 4", "output": "[[], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8593_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8327", "output": "{1, 11, 757, 8327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021218", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'some/directory/idfy_reid.py'", "output": "'idfy_reid'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021219", "code": "# Constants and data structures from the code snippet\nBRAIN_WAVES = {\n    'delta': (0.5, 4.0),\n    'theta': (4.0, 7.0),\n    'alpha': (7.0, 12.0),\n    'beta': (12.0, 30.0),\n}\n# Function to calculate the frequency range for a given brain wave type\ndef calculate_frequency_range(brain_wave_type):\n    if brain_wave_type in BRAIN_WAVES:\n        return BRAIN_WAVES[brain_wave_type]\n    else:\n        return \"Brain wave type not found in the dictionary.\"\n", "entry_point": "calculate_frequency_range", "input": "'alpha'", "output": "(7.0, 12.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67058_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021220", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[3, 2, 3, 2, 3, 2], 1", "output": "[4, 3, 4, 3, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021221", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8213", "output": "{1, 43, 8213, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8212", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021222", "code": "def merge_sorted_arrays(arr1, arr2):\n    merged = []\n    i, j = 0, 0\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] < arr2[j]:\n            merged.append(arr1[i])\n            i += 1\n        else:\n            merged.append(arr2[j])\n            j += 1\n    merged.extend(arr1[i:])\n    merged.extend(arr2[j:])\n    return merged\n", "entry_point": "merge_sorted_arrays", "input": "[1, 2, 3, 4], [5, 6, 7, 8]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75408_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021223", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "561", "output": "{1, 33, 3, 11, 561, 17, 51, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021224", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[49], 3", "output": "147", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021225", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2334", "output": "{1, 2, 3, 389, 6, 778, 1167, 2334}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021226", "code": "def parse_afni_output(output_string):\n    lines = output_string.splitlines()\n    values_list = []\n    for line in lines:\n        try:\n            float_value = float(line)\n            values_list.append(float_value)\n        except ValueError:\n            pass  # Ignore lines that are not valid float values\n    return values_list\n", "entry_point": "parse_afni_output", "input": "'3.11\\n'", "output": "[3.11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124534_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021227", "code": "def latest_version(versions):\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "latest_version", "input": "['5.2.1', '5.1.0', '4.9.8', '5.2.0']", "output": "'5.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109733_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021228", "code": "def calculate_series_sum(n):\n    sum_series = 0\n    term = 1\n    for _ in range(n):\n        sum_series += term\n        term = term**2 + 1\n    return sum_series\n", "entry_point": "calculate_series_sum", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19952_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021229", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt45", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021230", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'aryouuo'", "output": "{'aryouuo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021231", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'2.1..3', '10.5.0'", "output": "'2.1..3 to 10.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "604", "output": "{1, 2, 4, 302, 151, 604}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt603", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021233", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8215", "output": "{1, 5, 265, 1643, 53, 8215, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021234", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'resil.m'", "output": "[('resil.m', 'resil.m')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021235", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[25, 35, 34, 64, 12, 25, 35, 89]", "output": "[12, 25, 25, 34, 35, 35, 64, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021236", "code": "from typing import Dict, Any\nUNSET = object()\ndef construct_field_dict(additional_properties: Dict[str, Any], instantiations: Any, values_files: Any) -> Dict[str, Any]:\n    field_dict: Dict[str, Any] = {}\n    field_dict.update(additional_properties)\n    field_dict.update({\"instantiations\": instantiations})\n    if values_files is not UNSET:\n        field_dict[\"values_files\"] = values_files\n    return field_dict\n", "entry_point": "construct_field_dict", "input": "{}, 7, 'ift'", "output": "{'instantiations': 7, 'values_files': 'ift'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126733_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021237", "code": "def calculate_score(numbers):\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    if total > 30:\n        return \"High Score!\"\n    else:\n        return total\n", "entry_point": "calculate_score", "input": "[3, 6, 9]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123213_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021238", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[2, 2, 5, 1, 4, 4, 6, 6]", "output": "[2, 5, 1, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021239", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[2, 2, 4, 0, 3, 2, 2, 0]", "output": "[2, 2, 0, 0, 0, 0, 2, 2, 2, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021240", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[10, 10, 8, 6, 10, 10, 10, 10, 7]", "output": "([10, 10, 8, 6, 10, 10, 10, 10], [7])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021241", "code": "def organize_dependencies(dependencies):\n    dependency_dict = {}\n    for package, dependency in dependencies:\n        if package not in dependency_dict:\n            dependency_dict[package] = []\n        if dependency not in dependency_dict:\n            dependency_dict[dependency] = []\n        dependency_dict[package].append(dependency)\n    return dependency_dict\n", "entry_point": "organize_dependencies", "input": "[('x', 'y'), ('y', 'z'), ('z', 'x')]", "output": "{'x': ['y'], 'y': ['z'], 'z': ['x']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125817_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "782", "output": "{1, 2, 34, 391, 782, 46, 17, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021243", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7885", "output": "{1, 5, 1577, 7885, 19, 83, 95, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021244", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "4", "output": "2.06", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021245", "code": "def parse_query(query: str) -> str:\n    parts = query.split('==')\n    if len(parts) != 2:\n        return \"Invalid query format. Please provide a query in the format 'column == value'.\"\n    column = parts[0].strip()\n    value = parts[1].strip()\n    return f\"SELECT * FROM results WHERE {column} == {value}\"\n", "entry_point": "parse_query", "input": "'colv=cauluue == c'", "output": "'SELECT * FROM results WHERE colv=cauluue == c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98962_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021246", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'456,123,789'", "output": "{456, 123, 789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021247", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8579", "output": "{1, 8579, 373, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021248", "code": "from typing import List\ndef max_score_subset(scores: List[int], K: int) -> int:\n    scores.sort()\n    max_score = 0\n    left, right = 0, 1\n    while right < len(scores):\n        if scores[right] - scores[left] <= K:\n            max_score = max(max_score, scores[left] + scores[right])\n            right += 1\n        else:\n            left += 1\n    return max_score\n", "entry_point": "max_score_subset", "input": "[12, 14], 2", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94061_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021249", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[6, 7, 3, 0, 5, 5, 5, 8]", "output": "[36, 343, 27, 0, 125, 125, 125, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021250", "code": "def get_learning_rate(epoch, lr_schedule):\n    closest_epoch = max(filter(lambda x: x <= epoch, lr_schedule.keys()))\n    return lr_schedule[closest_epoch]\n", "entry_point": "get_learning_rate", "input": "10, {5: 0.001, 10: 0.0014}", "output": "0.0014", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78080_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021251", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(10, 0, 0), 1966", "output": "37966", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021252", "code": "from typing import Tuple\ndef remove_non_ascii(first: str, second: str) -> Tuple[str, str]:\n    first = first.encode(\"ascii\", \"ignore\").decode()\n    second = second.encode(\"ascii\", \"ignore\").decode()\n    return (first, second)\n", "entry_point": "remove_non_ascii", "input": "'H', 'WldW'", "output": "('H', 'WldW')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72401_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021253", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[1, 4, 3, 1, 7, 6, 2, 1]", "output": "[1, 4, 3, 1, 7, 6, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021254", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "955", "output": "{1, 955, 5, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021255", "code": "def rob_2(nums):\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob(nums):\n        prev_max = curr_max = 0\n        for num in nums:\n            temp = curr_max\n            curr_max = max(prev_max + num, curr_max)\n            prev_max = temp\n        return curr_max\n    include_first = rob(nums[1:]) + nums[0]\n    exclude_first = rob(nums[:-1])\n    return max(include_first, exclude_first)\n", "entry_point": "rob_2", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95871_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021256", "code": "import string\ndef count_unique_words(input_list):\n    word_counts = {}\n    for text in input_list:\n        words = text.split()\n        for word in words:\n            word = word.strip(string.punctuation).lower()\n            if word:\n                word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "['Hello world!', 'hello, world.']", "output": "{'hello': 2, 'world': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22776_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021257", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 3, 6, 8, 9]", "output": "[2, 6, 12, 16, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021258", "code": "batches = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]\ndef calculate_total_elements(batches):\n    total_elements = 0\n    for batch in batches:\n        total_elements += len(batch)\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "[[1, 2, 3], [4, 5], [6, 7, 8, 9]]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28370_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021259", "code": "def count_api_domains(all_apis):\n    domain_count = {}\n    for api in all_apis:\n        domain = api.split(\"//\")[-1].split(\"/\")[0]\n        domain_count[domain] = domain_count.get(domain, 0) + 1\n    return domain_count\n", "entry_point": "count_api_domains", "input": "['http://http:details/']", "output": "{'http:details': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142440_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021260", "code": "def calculate_average_position(points):\n    sum_x, sum_y, sum_z = 0, 0, 0\n    total_points = len(points)\n    for point in points:\n        sum_x += point[0]\n        sum_y += point[1]\n        sum_z += point[2]\n    avg_x = sum_x / total_points\n    avg_y = sum_y / total_points\n    avg_z = sum_z / total_points\n    return (avg_x, avg_y, avg_z)\n", "entry_point": "calculate_average_position", "input": "[(1, 1, 1), (2, 2, 2)]", "output": "(1.5, 1.5, 1.5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24711_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021261", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-14", "output": "-41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021262", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'p'", "output": "{'p': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8535_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021263", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'85, 885, 92, 78, 90, 890, 88'", "output": "[85, 885, 92, 78, 90, 890, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021264", "code": "from typing import List, Dict\ndef filter_news_by_query(news_list: List[Dict[str, str]], search_query: str) -> List[Dict[str, str]]:\n    filtered_news = []\n    for article in news_list:\n        if search_query.lower() in article[\"title\"].lower():\n            filtered_news.append(article)\n    return filtered_news\n", "entry_point": "filter_news_by_query", "input": "[], 'random query'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54057_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021265", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    rounded_average = round(average, 2)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[90.0, 92.0, 93.0, 91.48]", "output": "91.62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111776_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021266", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "10, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021267", "code": "def calculate_alignment_score(seq1, seq2, blosum_matrix):\n    alignment_score = 0\n    for i in range(len(seq1)):\n        alignment_score += blosum_matrix.get(seq1[i] + seq2[i], 0)\n    return alignment_score\n", "entry_point": "calculate_alignment_score", "input": "'AZ', 'BX', {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63129_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021268", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[1, 1, 2, 2, -2, -2, 5, 5, 4]", "output": "{1: 2, 2: 2, -2: 2, 5: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021269", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.config.Djcer'", "output": "'Djcer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7159", "output": "{1, 7159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7158", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021271", "code": "def card_game(player1_deck, player2_deck, max_rounds):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for _ in range(max_rounds):\n        if not player1_deck or not player2_deck:\n            break\n        card_player1 = player1_deck.pop(0)\n        card_player2 = player2_deck.pop(0)\n        if card_player1 > card_player2:\n            rounds_won_player1 += 1\n        elif card_player2 > card_player1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return 'Player 1 wins'\n    elif rounds_won_player2 > rounds_won_player1:\n        return 'Player 2 wins'\n    else:\n        return 'Draw'\n", "entry_point": "card_game", "input": "[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], 5", "output": "'Draw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85361_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021272", "code": "import math\ndef obs2state(obs, multiplier=1000):\n    x_pos = int(math.floor(obs[0] * multiplier))\n    y_pos = int(math.floor(obs[1] * multiplier))\n    y_vel = int(obs[2])\n    state_string = str(x_pos) + '_' + str(y_pos) + '_' + str(y_vel)\n    return state_string\n", "entry_point": "obs2state", "input": "[5.0, 4.0, 6]", "output": "'5000_4000_6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26561_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1294", "output": "{1, 2, 1294, 647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1293", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021274", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'HeHHello'", "output": "b'HeHHello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021275", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[2000, 98]", "output": "'0:34:58'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021276", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7522", "output": "{3761, 1, 7522, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8289", "output": "{1, 8289, 3, 9, 2763, 307, 921, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021278", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6470", "output": "{1, 2, 3235, 5, 6470, 647, 10, 1294}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6469", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5233", "output": "{1, 5233}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021280", "code": "def find_intersection(a, b):\n    i = 0\n    j = 0\n    ans = []\n    while i < len(a) and j < len(b):\n        if a[i] == b[j]:\n            ans.append(a[i])\n            i += 1\n            j += 1\n        elif a[i] < b[j]:\n            i += 1\n        else:\n            j += 1\n    return ans\n", "entry_point": "find_intersection", "input": "[], [1, 2, 3]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74107_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021281", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8881", "output": "{107, 1, 83, 8881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021282", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 18", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021283", "code": "def process_session_data(resp_data):\n    learning_language = resp_data.get(\"learningLanguage\", None)\n    challenge_types = resp_data.get(\"challengeTypes\", [])\n    skill_id = resp_data.get(\"skillId\", None)\n    return learning_language, challenge_types, skill_id\n", "entry_point": "process_session_data", "input": "{}", "output": "(None, [], None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25995_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021284", "code": "from typing import List\ndef max_score_subset(scores: List[int], K: int) -> int:\n    scores.sort()\n    max_score = 0\n    left, right = 0, 1\n    while right < len(scores):\n        if scores[right] - scores[left] <= K:\n            max_score = max(max_score, scores[left] + scores[right])\n            right += 1\n        else:\n            left += 1\n    return max_score\n", "entry_point": "max_score_subset", "input": "[1, 10, 12, 11], 2", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94061_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021285", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "6", "output": "[6, 3, 10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021286", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[4, 4, 6, 2]", "output": "(6, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021287", "code": "def reverse_words_in_string(s: str) -> str:\n    result = \"\"\n    word = \"\"\n    for char in s:\n        if char != ' ':\n            word = char + word\n        else:\n            result += word + ' '\n            word = \"\"\n    result += word  # Append the last word without a space\n    return result\n", "entry_point": "reverse_words_in_string", "input": "'woowlwow'", "output": "'wowlwoow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88814_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021288", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4847", "output": "{1, 131, 37, 4847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3269", "output": "{1, 467, 3269, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021290", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "161", "output": "'?161'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021291", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    total_sum = sum(scores)\n    adjusted_sum = total_sum - min_score\n    num_scores = len(scores) - 1  # Excluding the minimum score\n    return adjusted_sum / num_scores if num_scores > 0 else 0\n", "entry_point": "calculate_average_score", "input": "[83.71428571428571, 81.71428571428571, 80]", "output": "82.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140046_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021292", "code": "def manhattan_distance(point1, point2):\n    x1, y1 = point1\n    x2, y2 = point2\n    return abs(x1 - x2) + abs(y1 - y2)\n", "entry_point": "manhattan_distance", "input": "(0, 0), (0, 5)", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128962_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021293", "code": "def euclid_gcd(a, b):\n    if not isinstance(a, int) or not isinstance(b, int):\n        return \"Invalid input, please provide integers.\"\n    a = abs(a)\n    b = abs(b)\n    while b != 0:\n        a, b = b, a % b\n    return a\n", "entry_point": "euclid_gcd", "input": "8, 9", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129293_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1699", "output": "{1, 1699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "325", "output": "{65, 1, 5, 325, 13, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt324", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021296", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 23", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021297", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum_result = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum_result)\n    return output_list\n", "entry_point": "circular_sum", "input": "[9, 5, 6, 5, 2, 4, 7]", "output": "[14, 11, 11, 7, 6, 11, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60286_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021298", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5339", "output": "{19, 1, 5339, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021299", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[3, 3, 6, 1, 6, 1, 6, 6, 1, -1]", "output": "[3, 6, 12, 13, 19, 20, 26, 32, 33]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021300", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 2, 1, 3, 3, 6, 7, 7, 7]", "output": "[1, 3, 3, 6, 7, 11, 13, 14, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021301", "code": "def parse_launches(input_str):\n    launches_dict = {}\n    launches_list = input_str.split(',')\n    for launch_pair in launches_list:\n        date, description = launch_pair.split(':')\n        launches_dict[date] = description\n    return launches_dict\n", "entry_point": "parse_launches", "input": "'2022-04-25:Launch'", "output": "{'2022-04-25': 'Launch'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64743_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021302", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10  # Increment the last element in the list by 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 1, 6, 5, 6, 7, 4, 6, 5]", "output": "[16, 1, 46, 125, 46, 343, 16, 46, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82710_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021303", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "9.049, 1", "output": "9.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021304", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[4, 1, 1, 1, 1, 1, 1, 0, 7]", "output": "[0, 1, 1, 1, 1, 1, 1, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021305", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1027", "output": "b'\\x00\\x00\\x04\\x03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021306", "code": "def generate_response(message):\n    channel_id = 'CNCRFR7KP'\n    team_id = 'TE4VDPM2L'\n    user_id = 'UE6P69HFH'\n    response_url = \"no\"\n    channel_name = \"local\"\n    if \"lambda\" in message:\n        return \"lambda_function\"\n    if channel_id in message and team_id in message and user_id in message:\n        return \"channel_team_user\"\n    if response_url == \"no\" and \"no\" in message:\n        return \"no_response\"\n    if channel_name == \"local\" and \"local\" in message:\n        return \"local_channel\"\n    return \"No matching rule found.\"\n", "entry_point": "generate_response", "input": "'Please direct this to the local channel.'", "output": "'local_channel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78868_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021307", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[5, 14, 13, 13, 13, 12, 5]", "output": "'4BKSP===-4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021308", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'Hello, oello.'", "output": "{'hello': 1, 'oello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021309", "code": "def find_smallest(lst):\n    smallest = float('inf')  # Initialize with a large value\n    for num in lst:\n        if num < smallest:\n            smallest = num\n    return smallest\n", "entry_point": "find_smallest", "input": "[1, 5, 10]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80996_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021310", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[1, 3, 2, 3, 2, 1, 4, 1]", "output": "[1, 9, 4, 9, 4, 1, 8, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021311", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[1, 2, 1, 7, 2, 4, 1, 8]", "output": "[3, 3, 8, 9, 6, 5, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021312", "code": "def is_bow(text):\n    if not isinstance(text, dict):\n        return False\n    for key, value in text.items():\n        if not isinstance(key, str) or not isinstance(value, int) or value < 0 or key is None:\n            return False\n    return True\n", "entry_point": "is_bow", "input": "{'apple': 0, 'banana': 1}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94059_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021313", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9970", "output": "{1, 2, 5, 997, 1994, 10, 9970, 4985}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9969", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021314", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8018", "output": "{1, 2, 422, 38, 4009, 8018, 19, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8017", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021315", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "70, 'ca_coludc.py'", "output": "'70_ca_coludc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021316", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "5", "output": "[0, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021317", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'text'", "output": "{'text': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021318", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'authentication.'", "output": "'authentication.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021319", "code": "def max_non_overlapping_intervals(intervals):\n    if not intervals:\n        return 0\n    intervals.sort(key=lambda x: x[1])  # Sort intervals based on end times\n    count = 1\n    prev_end = intervals[0][1]\n    for interval in intervals[1:]:\n        if interval[0] >= prev_end:\n            count += 1\n            prev_end = interval[1]\n    return count\n", "entry_point": "max_non_overlapping_intervals", "input": "[(1, 2), (3, 4), (5, 6)]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62948_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021320", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6621", "output": "{1, 3, 6621, 2207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021321", "code": "def toggle_configurations(config, toggle):\n    if toggle == 'disable_lag':\n        if 'lacp=active' in config:\n            config.remove('lacp=active')\n            config.append('lacp=off')\n    elif toggle == 'active_lag':\n        if 'lacp=off' in config:\n            config.remove('lacp=off')\n            config.append('lacp=active')\n    elif toggle == 'enable_fallback':\n        for i, conf in enumerate(config):\n            if 'other_config:lacp-fallback-ab' in conf:\n                config[i] = 'other_config:lacp-fallback-ab=\"true\"'\n    elif toggle == 'disable_fallback':\n        for i, conf in enumerate(config):\n            if 'other_config:lacp-fallback-ab' in conf:\n                config[i] = 'other_config:lacp-fallback-ab=\"false\"'\n    return config\n", "entry_point": "toggle_configurations", "input": "[], 'disable_lag'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95482_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021322", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5098", "output": "{1, 5098, 2, 2549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021323", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'1.'", "output": "'<p>1.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4499", "output": "{11, 1, 409, 4499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021325", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021326", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "3.6666666666666665, 1", "output": "3.6666666666666665", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021327", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021328", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6316", "output": "{1, 2, 4, 1579, 6316, 3158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6315", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021329", "code": "def extract_package_info(package_details):\n    package_name = package_details.get('name', '')\n    version = package_details.get('version', '')\n    description = package_details.get('description', '')\n    url = package_details.get('url', '')\n    formatted_info = f\"Package: {package_name}\\nVersion: {version}\\nDescription: {description}\\nURL: {url}\"\n    return formatted_info\n", "entry_point": "extract_package_info", "input": "{}", "output": "'Package: \\nVersion: \\nDescription: \\nURL: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9168_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021330", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "13", "output": "[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021331", "code": "from typing import List\ndef calculate_total_characters(strings: List[str]) -> int:\n    total_chars = 0\n    concatenated_string = \"\"\n    for string in strings:\n        total_chars += len(string)\n        concatenated_string += string\n    total_chars += len(concatenated_string)\n    return total_chars\n", "entry_point": "calculate_total_characters", "input": "['hello', 'abc', 'i']", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56126_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4097", "output": "{1, 241, 4097, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021333", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "6", "output": "43", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021334", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 9, 9, 0, 4, 8, 9, 9]", "output": "[7, 10, 11, 3, 8, 13, 15, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021335", "code": "from typing import List\ndef minTime(machines: List[int], goal: int) -> int:\n    def countItems(machines, days):\n        total = 0\n        for machine in machines:\n            total += days // machine\n        return total\n    low = 1\n    high = max(machines) * goal\n    while low < high:\n        mid = (low + high) // 2\n        if countItems(machines, mid) < goal:\n            low = mid + 1\n        else:\n            high = mid\n    return low\n", "entry_point": "minTime", "input": "[1, 2], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117103_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021336", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcdefghijklmno', '12345678901234567'", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021337", "code": "import re\ndef extract_environment_variables(code_snippet):\n    env_var_counts = {}\n    env_var_pattern = re.compile(r'os.getenv\\(\"([^\"]+)\"\\)')\n    env_vars = env_var_pattern.findall(code_snippet)\n    for env_var in env_vars:\n        if env_var in env_var_counts:\n            env_var_counts[env_var] += 1\n        else:\n            env_var_counts[env_var] = 1\n    return env_var_counts\n", "entry_point": "extract_environment_variables", "input": "'os.getenv(\"GOOGLE_API_KEY\")'", "output": "{'GOOGLE_API_KEY': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98868_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021338", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "78, [14]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021339", "code": "def calculate_total_thickness(ply_thickness, stacking_sequence, num_plies):\n    total_thickness = 0\n    for angle in stacking_sequence:\n        total_thickness += ply_thickness * num_plies\n    return total_thickness\n", "entry_point": "calculate_total_thickness", "input": "0.00208, [0], 4", "output": "0.00832", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40077_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021340", "code": "def calculate_grayscale(r: int, g: int, b: int) -> int:\n    grayscale = int(0.299 * r + 0.587 * g + 0.114 * b)\n    return grayscale\n", "entry_point": "calculate_grayscale", "input": "0, 10, 0", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80937_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021341", "code": "def remove_vowels(string):\n    result = ''\n    for char in string:\n        if char not in 'aeiouAEIOU':\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'Hello,'", "output": "'Hll,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87966_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021342", "code": "def longest_common_subsequence(s1, s2):\n    m, n = len(s1), len(s2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m):\n        for j in range(n):\n            if s1[i] == s2[j]:\n                dp[i + 1][j + 1] = dp[i][j] + 1\n            else:\n                dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "'abcde', 'abxcde'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1697_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021343", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'8127.0.0.1 10.0.0.025'", "output": "{'8127.0.0.1': [], '10.0.0.025': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021344", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 3, 3, 4, 4]", "output": "[3, 6, 9, 13, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021345", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[1, 2, 3, 3, 5, 5, 6]", "output": "[3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021346", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 2, 1, 2, 5]", "output": "[3, 4, 3, 3, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89166_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021347", "code": "from collections import defaultdict\ndef process_dependencies(dependency_pairs):\n    num_heads = defaultdict(int)\n    tails = defaultdict(list)\n    heads = []\n    for h, t in dependency_pairs:\n        num_heads[t] += 1\n        if h in tails:\n            tails[h].append(t)\n        else:\n            tails[h] = [t]\n            heads.append(h)\n    ordered = [h for h in heads if h not in num_heads]\n    for h in ordered:\n        for t in tails[h]:\n            num_heads[t] -= 1\n            if not num_heads[t]:\n                ordered.append(t)\n    cyclic = [n for n, heads in num_heads.items() if heads]\n    return ordered, cyclic\n", "entry_point": "process_dependencies", "input": "[]", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128375_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021348", "code": "def process_revision(revision):\n    # Extract the first 6 characters of the revision string in reverse order\n    key = revision[:6][::-1]\n    # Update the down_revision variable with the extracted value\n    global down_revision\n    down_revision = key\n    return down_revision\n", "entry_point": "process_revision", "input": "'c'", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39423_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021349", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'asaabbpple'", "output": "'Asaabbpple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021350", "code": "def padding_zeroes(result, num_digits: int):\n    str_result = str(result)\n    # Check if the input number contains a decimal point\n    if '.' in str_result:\n        decimal_index = str_result.index('.')\n        decimal_part = str_result[decimal_index + 1:]\n        padding_needed = num_digits - len(decimal_part)\n        str_result += \"0\" * padding_needed\n    else:\n        str_result += '.' + \"0\" * num_digits\n    return str_result[:str_result.index('.') + num_digits + 1]\n", "entry_point": "padding_zeroes", "input": "3.76, 2", "output": "'3.76'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26190_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021351", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[2, 2, 2, 3, 3, 3, 3, 4, 4]", "output": "{2: 3, 3: 4, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021352", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[3, 5, 8, 6]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021353", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4415", "output": "{1, 883, 5, 4415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021354", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[6, 4, 7, 7, 2, 0, 2, 2]", "output": "[6, 5, 9, 10, 6, 5, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25747_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6263", "output": "{1, 6263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021356", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 8, 4, 8, 1, 3, 1, 1, 3]", "output": "[2, 9, 6, 11, 5, 8, 7, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021357", "code": "def count_unique_divisible_numbers(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible_numbers", "input": "[2, 2, 4, 5], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61726_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021358", "code": "import re\ndef extract_code(title):\n    match = re.search(r\"\\w+-?\\d+\", title)\n    return match.group(0) if match else \"\"\n", "entry_point": "extract_code", "input": "'Product-123'", "output": "'Product-123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13798_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021359", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "403", "output": "{1, 403, 13, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1801", "output": "{1, 1801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021361", "code": "def process_config(config_dict):\n    # Calculate the sum of values in 'AnnealingProgram'\n    annealing_sum = sum(config_dict.get('AnnealingProgram', []))\n    # Check if Debug is enabled or disabled\n    debug_status = 'Debugging Enabled' if config_dict.get('Debug', False) else 'Debugging Disabled'\n    # Check if ChiSquareCut1D is greater than ChiSquareCut2D\n    chi_square_comparison = config_dict.get('ChiSquareCut1D', 0) > config_dict.get('ChiSquareCut2D', 0)\n    return annealing_sum, debug_status, chi_square_comparison\n", "entry_point": "process_config", "input": "{'AnnealingProgram': [], 'Debug': False}", "output": "(0, 'Debugging Disabled', False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74261_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021362", "code": "import math\ndef calculate_quadratic_roots(term_matrix):\n    if len(term_matrix) == 2:\n        a, b, c = term_matrix[0][0], 0, 0\n    elif len(term_matrix) == 3:\n        a, b, c = term_matrix[0][0], term_matrix[1][0], 0\n    else:\n        a, b, c = term_matrix[0][0], term_matrix[1][0], term_matrix[2][0]\n    discriminant = b**2 - 4*a*c\n    if discriminant > 0:\n        root1 = (-b + math.sqrt(discriminant)) / (2*a)\n        root2 = (-b - math.sqrt(discriminant)) / (2*a)\n        return root1, root2\n    elif discriminant == 0:\n        root = -b / (2*a)\n        return root\n    else:\n        real_part = -b / (2*a)\n        imaginary_part = math.sqrt(abs(discriminant)) / (2*a)\n        return complex(real_part, imaginary_part), complex(real_part, -imaginary_part)\n", "entry_point": "calculate_quadratic_roots", "input": "[[1], [0]]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6034_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021363", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'apple, banana, cherry -> pear'", "output": "(['apple', 'banana', 'cherry'], 'pear')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021364", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'eeeL', 4", "output": "['eeeL']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021365", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "100, 12, 7", "output": "119", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021366", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'252.03.2020'", "output": "'252.03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021367", "code": "def binary_search(target, lst):\n    low = 0\n    high = len(lst) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if lst[mid] == target:\n            return mid\n        elif lst[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return low\n", "entry_point": "binary_search", "input": "8, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43298_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6082", "output": "{1, 6082, 2, 3041}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021369", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7825", "output": "{1, 5, 313, 7825, 25, 1565}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021370", "code": "def generate_api_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "generate_api_url", "input": "'https.com', '/userus'", "output": "'https.com/userus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62370_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021371", "code": "def evaluate_expressions(expressions):\n    results = []\n    for expression in expressions:\n        result = eval(expression)\n        results.append(result)\n    return results\n", "entry_point": "evaluate_expressions", "input": "['3 + 6', '1 + 1', '10']", "output": "[9, 2, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56248_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021372", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[1, 3, 4, 5, 29]", "output": "'1, 3, 4, 5, 29'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021373", "code": "def calculate_error(list1, list2):\n    total_error = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_error\n", "entry_point": "calculate_error", "input": "[0], [38]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33914_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021374", "code": "from typing import List\ndef getNoZeroIntegers(n: int) -> List[int]:\n    for i in range(1, n):\n        a = i\n        b = n - i\n        if \"0\" in str(a) or \"0\" in str(b):\n            continue\n        return [a, b]\n", "entry_point": "getNoZeroIntegers", "input": "8", "output": "[1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62474_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021375", "code": "def highest_growth_rate_city(population_list):\n    highest_growth_rate = 0\n    city_with_highest_growth = None\n    for i in range(1, len(population_list)):\n        growth_rate = population_list[i] - population_list[i - 1]\n        if growth_rate > highest_growth_rate:\n            highest_growth_rate = growth_rate\n            city_with_highest_growth = f'City{i+1}'\n    return city_with_highest_growth\n", "entry_point": "highest_growth_rate_city", "input": "[100, 150, 200, 300]", "output": "'City4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6843_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021376", "code": "def clamp_numbers(numbers, lower_bound, upper_bound):\n    return [max(lower_bound, min(num, upper_bound)) for num in numbers]\n", "entry_point": "clamp_numbers", "input": "[1, 2, 3, 4, 5], 3, 3", "output": "[3, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51058_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021377", "code": "def buf2int(byte_list):\n    if not byte_list:\n        return None\n    result = 0\n    for byte in byte_list:\n        result = (result << 8) | byte\n    return result\n", "entry_point": "buf2int", "input": "[1, 2]", "output": "258", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43489_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9197", "output": "{1, 541, 9197, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9196", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021379", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'dime', 1, 2", "output": "\"Error: Invalid operation type 'dime'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021380", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "76.5, 0", "output": "76", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021381", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "10", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021382", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[1, 1, 2, 2, 2, 3, 3, 4]", "output": "{1: 2, 2: 3, 3: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021383", "code": "def calculate_u(w, x0, n):\n    w0 = w + sum(x0)\n    u = [w0] * n\n    return u\n", "entry_point": "calculate_u", "input": "3, [1, 1, 1, 1], 8", "output": "[7, 7, 7, 7, 7, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54111_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9611", "output": "{1, 9611, 1373, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021385", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    rounded_average = round(average, 2)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[94, 94, 95, 95]", "output": "94.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111776_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021386", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[21]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021387", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'a=atdttass'", "output": "{'field': 'a', 'value': 'atdttass'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021388", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[5, 5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021389", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024  # Convert bytes to kilobytes\n    return total_size_kb\n", "entry_point": "calculate_total_size", "input": "[10240, 9216]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73966_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021390", "code": "def calculate_balance(initial_balance, transactions, account_id):\n    balances = {account_id: initial_balance}\n    for account, amount in transactions:\n        if account not in balances:\n            balances[account] = 0\n        balances[account] += amount\n    return balances.get(account_id, 0)\n", "entry_point": "calculate_balance", "input": "25, [], 'account_1'", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118421_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021391", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'Hello Word'", "output": "b'Hello Word'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021392", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "16, 0, 5", "output": "136", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021393", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(15, 15, 15)", "output": "'#0F0F0F'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021394", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1846", "output": "{1, 2, 71, 13, 142, 1846, 26, 923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021395", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "652", "output": "{1, 2, 163, 4, 326, 652}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt651", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021396", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[3, 7, 3, 7, 7, 7, 7, 3, 7]", "output": "[3, 8, 5, 10, 11, 12, 13, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5127", "output": "{1, 3, 1709, 5127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021398", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "718", "output": "{1, 2, 718, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt717", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021399", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[4, 7, 4, -1, 5, 7, -1]", "output": "[4, 7, -1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021400", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "138", "output": "{1, 2, 3, 69, 6, 138, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021401", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'CCHECKINN'", "output": "'CCHECKINN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021402", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 7, 0, 1, 0, 0, 2, 6]", "output": "[10, 7, 1, 1, 0, 2, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26581_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021403", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6309", "output": "{1, 3, 6309, 9, 2103, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021404", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'the quick b dog'", "output": "{'the': 1, 'quick': 1, 'b': 1, 'dog': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104136_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021405", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[3, 3, 2, 1, 54, 2, 3, 3], 4", "output": "[1, 2, 2, 3, 3, 3, 3, 54]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021406", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2607", "output": "{1, 33, 3, 869, 11, 237, 2607, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021407", "code": "def fibonacci_memo(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 1 or n == 2:\n        return 1\n    else:\n        result = fibonacci_memo(n - 1, memo) + fibonacci_memo(n - 2, memo)\n        memo[n] = result\n        return result\n", "entry_point": "fibonacci_memo", "input": "10", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33770_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021408", "code": "def extract_version(import_statement: str) -> str:\n    start_index = import_statement.find(\"__version__ = '\") + len(\"__version__ = '\")\n    end_index = import_statement.find(\"'\", start_index)\n    return import_statement[start_index:end_index]\n", "entry_point": "extract_version", "input": "\"__version__ = 'utils.evaluat'\"", "output": "'utils.evaluat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136730_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021409", "code": "def reverse(input_str):\n    reversed_str = ''\n    for i in range(len(input_str) - 1, -1, -1):\n        reversed_str += input_str[i]\n    return reversed_str\n", "entry_point": "reverse", "input": "'aRmen'", "output": "'nemRa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77619_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021410", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'Doe'", "output": "('Doe', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021411", "code": "import heapq\ndef top_k_frequent_elements(nums, k):\n    freq_map = {}\n    for num in nums:\n        freq_map[num] = freq_map.get(num, 0) + 1\n    heap = [(-freq, num) for num, freq in freq_map.items()]\n    heapq.heapify(heap)\n    top_k = []\n    for _ in range(k):\n        top_k.append(heapq.heappop(heap)[1])\n    return sorted(top_k)\n", "entry_point": "top_k_frequent_elements", "input": "[1, 1, 2, 2], 2", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76714_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021412", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8834", "output": "{4417, 1, 8834, 2, 7, 1262, 14, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9741", "output": "{1, 3, 9741, 3247, 17, 51, 573, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021414", "code": "YEAR_CHOICES = (\n    (1, 'First'),\n    (2, 'Second'),\n    (3, 'Third'),\n    (4, 'Fourth'),\n    (5, 'Fifth'),\n)\ndef get_ordinal(year):\n    for num, ordinal in YEAR_CHOICES:\n        if num == year:\n            return ordinal\n    return \"Unknown\"\n", "entry_point": "get_ordinal", "input": "4", "output": "'Fourth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43813_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021415", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[0, 6, 6, 1, 3, 6, 4, 3, 0]", "output": "[6, 6, 1, 3, 6, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021416", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[2, 2, 6, 1, 4, 5, 5, 6]", "output": "[2, 6, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021417", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{ apple, }'", "output": "['apple', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021418", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[101, 101, 101, 101, 101, 100, 75, 92]", "output": "{101: 5, 100: 1, 75: 1, 92: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7115", "output": "{1, 7115, 5, 1423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021420", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'9.99.999'", "output": "'9.99.1000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021421", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'python tutorial', 'New York'", "output": "'python tutorial New York'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021422", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[4, 5, 4, 5, 5, 6, 5]", "output": "[6, 5, 5, 5, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021423", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'D'", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021424", "code": "def find_median(arr):\n    arr.sort()\n    n = len(arr)\n    if n % 2 == 1:\n        return arr[n // 2]\n    else:\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (arr[mid_left] + arr[mid_right]) / 2\n", "entry_point": "find_median", "input": "[7, 9]", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141135_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021425", "code": "def simulate_ripple(grid, source_row, source_col):\n    source_height = grid[source_row][source_col]\n    rows, cols = len(grid), len(grid[0])\n    def manhattan_distance(row, col):\n        return abs(row - source_row) + abs(col - source_col)\n    result = [[0 for _ in range(cols)] for _ in range(rows)]\n    for row in range(rows):\n        for col in range(cols):\n            distance = manhattan_distance(row, col)\n            result[row][col] = max(grid[row][col], source_height - distance)\n    return result\n", "entry_point": "simulate_ripple", "input": "[[2, 2], [2, 2]], 0, 0", "output": "[[2, 2], [2, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32833_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021426", "code": "import binascii\nfrom typing import Union\ndef scrub_input(hex_str_or_bytes: Union[str, bytes]) -> bytes:\n    if isinstance(hex_str_or_bytes, str):\n        hex_str_or_bytes = binascii.unhexlify(hex_str_or_bytes)\n    return hex_str_or_bytes\n", "entry_point": "scrub_input", "input": "'48656c6c6f20576f726c64'", "output": "b'Hello World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49478_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021427", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1012", "output": "{1, 2, 4, 11, 44, 46, 1012, 22, 23, 506, 92, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1011", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021428", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2206", "output": "{1, 2, 2206, 1103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021429", "code": "def capitalize_last_letter(string):\n    modified_string = \"\"\n    for word in string.split():\n        if len(word) > 1:\n            modified_word = word[:-1] + word[-1].upper()\n        else:\n            modified_word = word.upper()\n        modified_string += modified_word + \" \"\n    return modified_string[:-1]  # Remove the extra space at the end\n", "entry_point": "capitalize_last_letter", "input": "'oor'", "output": "'ooR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101043_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021430", "code": "def round_grades(grades):\n    rounded_grades = []\n    for grade in grades:\n        if grade >= 38:\n            diff = 5 - grade % 5\n            if diff < 3:\n                grade += diff\n        rounded_grades.append(grade)\n    return rounded_grades\n", "entry_point": "round_grades", "input": "[75, 67, 40, 33, 91]", "output": "[75, 67, 40, 33, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112743_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021431", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454405", "output": "'<t:1630454405>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021432", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'eeeoom.comoom.comxac'", "output": "'eeeoom.comoom.comxac'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021433", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "12", "output": "[0, 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021434", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[0, 5, 2, 3]", "output": "[0, 5, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021435", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[5, 5, 5, 5, 0, 6, 0]", "output": "([5, 5, 5, 5], [0, 6, 0])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021436", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 4, 0, 1, 2, 0, 2]", "output": "[4, 0, 3, 8, 0, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021437", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "6, 15", "output": "(26, 17, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021438", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[1, 1, 1, 2, 1]", "output": "[0, 0, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021439", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[9, 4, 8, 18, 9, 45, 26, 53]", "output": "[9, 4, 8, 9, 9, 9, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021440", "code": "from typing import List\ndef maxFruits(tree: List[int]) -> int:\n    if not tree or len(tree) == 0:\n        return 0\n    left = 0\n    ans = 0\n    baskets = {}\n    for t, fruit in enumerate(tree):\n        baskets[fruit] = t\n        if len(baskets) > 2:\n            left = min(baskets.values())\n            del baskets[tree[left]]\n            left += 1\n        ans = max(ans, t - left + 1)\n    return ans\n", "entry_point": "maxFruits", "input": "[1, 2, 1, 1, 2, 2, 1]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77640_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021441", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'admin_ListChartsConFil'", "output": "'listchartsconfil'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021442", "code": "from typing import List\ndef sum_multiples_3_5_unique(numbers: List[int]) -> int:\n    unique_multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            unique_multiples.add(num)\n    return sum(unique_multiples)\n", "entry_point": "sum_multiples_3_5_unique", "input": "[3, 5, 9, 10]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57809_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "503", "output": "{1, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021444", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "0, 11", "output": "b'\\x0b\\x00\\x00\\x00\\x00\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021445", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'my package name'", "output": "'my_package_name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021446", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'elit.eiladi', 12", "output": "['elit.eiladi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021447", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[1, 1, 2, 2, 3, 3, 4, 4, 5, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021448", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "1, 1, -1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021449", "code": "from typing import List\ndef maximize_min_distance(a: List[int], M: int) -> int:\n    a.sort()\n    def is_ok(mid):\n        last = a[0]\n        count = 1\n        for i in range(1, len(a)):\n            if a[i] - last >= mid:\n                count += 1\n                last = a[i]\n        return count >= M\n    left, right = 0, a[-1] - a[0]\n    while left < right:\n        mid = (left + right + 1) // 2\n        if is_ok(mid):\n            left = mid\n        else:\n            right = mid - 1\n    return left\n", "entry_point": "maximize_min_distance", "input": "[0, 2, 4, 6], 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125115_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021450", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(5, 3, 7)", "output": "'5.3.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021451", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "186", "output": "{1, 2, 3, 6, 186, 93, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021452", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[8, 4, 9, 5, 10, 9]", "output": "[8, 5, 11, 8, 14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021453", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4255", "output": "{1, 5, 37, 851, 115, 23, 185, 4255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4254", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021454", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'AAAAABBBBBCCCCDDD'", "output": "{'A': 5, 'B': 5, 'C': 4, 'D': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021455", "code": "def fibonacci_memoization(n):\n    memo = {}\n    def fibonacci_helper(n):\n        if n in memo:\n            return memo[n]\n        if n <= 1:\n            return n\n        else:\n            result = fibonacci_helper(n - 1) + fibonacci_helper(n - 2)\n            memo[n] = result\n            return result\n    return fibonacci_helper(n)\n", "entry_point": "fibonacci_memoization", "input": "-2", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10382_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021456", "code": "def get_event_type(event: str, event_types: dict) -> str:\n    return event_types.get(event, event)\n", "entry_point": "get_event_type", "input": "'meeting', {'meeting': 'meetingmg'}", "output": "'meetingmg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138265_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021457", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 85, 89, 80, 70]", "output": "[90, 89, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8412_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021458", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(3, 0, 3, 1, 4, 4, 4, 2)", "output": "(2, 0, 3, 1, 4, 4, 4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2119", "output": "{1, 163, 13, 2119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021460", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "987654322", "output": "'987.654.322'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021461", "code": "def filter_and_sort_beats(beats, tempo_threshold, min_duration):\n    filtered_beats = []\n    for beat in beats:\n        if beat['tempo'] <= tempo_threshold and beat['duration'] >= min_duration:\n            filtered_beats.append(beat)\n    filtered_beats.sort(key=lambda x: x['tempo'], reverse=True)\n    return filtered_beats\n", "entry_point": "filter_and_sort_beats", "input": "[], 100, 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12852_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021462", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[200, 101, 5, 1], 100", "output": "301", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021463", "code": "import re\n# Dictionary mapping incorrect function names to correct function names\nfunction_mapping = {\n    'prit': 'print'\n}\ndef correct_function_names(code_snippet):\n    # Regular expression pattern to match function names\n    pattern = r'\\b(' + '|'.join(re.escape(key) for key in function_mapping.keys()) + r')\\b'\n    # Replace incorrect function names with correct function names\n    corrected_code = re.sub(pattern, lambda x: function_mapping[x.group()], code_snippet)\n    return corrected_code\n", "entry_point": "correct_function_names", "input": "'pprprit(\"Hello Pytht(Po'", "output": "'pprprit(\"Hello Pytht(Po'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116715_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021464", "code": "def padding_zeroes(result, num_digits: int):\n    str_result = str(result)\n    # Check if the input number contains a decimal point\n    if '.' in str_result:\n        decimal_index = str_result.index('.')\n        decimal_part = str_result[decimal_index + 1:]\n        padding_needed = num_digits - len(decimal_part)\n        str_result += \"0\" * padding_needed\n    else:\n        str_result += '.' + \"0\" * num_digits\n    return str_result[:str_result.index('.') + num_digits + 1]\n", "entry_point": "padding_zeroes", "input": "1, 0", "output": "'1.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26190_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1719", "output": "{1, 3, 9, 1719, 573, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1718", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021466", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[1, 2, 3, 4, 5]", "output": "[3, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021467", "code": "def get_skyline(buildings):\n    def merge(left, right):\n        merged = []\n        h1, h2 = 0, 0\n        i, j = 0, 0\n        while i < len(left) and j < len(right):\n            if left[i][0] < right[j][0]:\n                x, h1 = left[i]\n                i += 1\n            else:\n                x, h2 = right[j]\n                j += 1\n            max_h = max(h1, h2)\n            if not merged or max_h != merged[-1][1]:\n                merged.append([x, max_h])\n        merged.extend(left[i:] or right[j:])\n        return merged\n    def divide_and_conquer(buildings, start, end):\n        if start == end:\n            return [[buildings[start][0], buildings[start][2]], [buildings[start][1], 0]]\n        mid = (start + end) // 2\n        left = divide_and_conquer(buildings, start, mid)\n        right = divide_and_conquer(buildings, mid + 1, end)\n        return merge(left, right)\n    if not buildings:\n        return []\n    skyline = divide_and_conquer(buildings, 0, len(buildings) - 1)\n    return skyline\n", "entry_point": "get_skyline", "input": "[[2, 9, 10]]", "output": "[[2, 10], [9, 0]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75151_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021468", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'rrramet,ro', 11", "output": "'rrramet,ro'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021469", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 7, 7, 7]", "output": "[7, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021470", "code": "def generate_heading(content, level):\n    heading_tags = {\n        1: \"h1\",\n        2: \"h2\",\n        3: \"h3\",\n        4: \"h4\",\n        5: \"h5\",\n        6: \"h6\"\n    }\n    if level not in heading_tags:\n        return \"Invalid heading level. Please provide a level between 1 and 6.\"\n    html_tag = heading_tags[level]\n    return \"<{}>{}</{}>\".format(html_tag, content, html_tag)\n", "entry_point": "generate_heading", "input": "'WolWord', 6", "output": "'<h6>WolWord</h6>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44780_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021471", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[7, 3, 2, 2, 4, 4, 5, 5]", "output": "(7, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021472", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021473", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'unknown'", "output": "'unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021474", "code": "def sum_of_min_values(matrix):\n    total_min_sum = 0\n    for row in matrix:\n        min_value = min(row)\n        total_min_sum += min_value\n    return total_min_sum\n", "entry_point": "sum_of_min_values", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147997_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5619", "output": "{3, 1, 1873, 5619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021476", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7553", "output": "{1, 7553, 581, 7, 13, 83, 1079, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021477", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[4, 2, 1, 1, 1, 2, 4]", "output": "[8, 4, 2, 2, 2, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021478", "code": "def calculate_trainable_parameters(layers, units_per_layer):\n    total_params = 0\n    input_size = 7 * 7  # Assuming input size based on the environment\n    for _ in range(layers):\n        total_params += (input_size + 1) * units_per_layer\n        input_size = units_per_layer\n    return total_params\n", "entry_point": "calculate_trainable_parameters", "input": "3, 128", "output": "39424", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124974_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "558", "output": "{1, 2, 3, 6, 9, 558, 18, 279, 186, 93, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021480", "code": "from typing import List\ndef find_first_duplicate(A: List[int]) -> int:\n    seen = set()\n    for num in A:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[0, 1, 2, 1, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55340_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021481", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[14]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021482", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[4, 3, 1, 3, 4, 4, 1, 4, 4], 2, 9", "output": "[4, 3, 1, 3, 4, 4, 1, 4, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021483", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo World'", "output": "'World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021484", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[2, 4, 0, 6], 6", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021485", "code": "def split_into_chunks(data, chunk_size):\n    num_chunks = -(-len(data) // chunk_size)  # Calculate the number of chunks needed\n    chunks = []\n    for i in range(num_chunks):\n        start = i * chunk_size\n        end = (i + 1) * chunk_size\n        chunk = data[start:end]\n        if len(chunk) < chunk_size:\n            chunk += [None] * (chunk_size - len(chunk))  # Pad with None values if needed\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_into_chunks", "input": "[2, 3, 3, 2, 2, 4], 8", "output": "[[2, 3, 3, 2, 2, 4, None, None]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138006_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021486", "code": "def parse_help_message(help_message):\n    category_commands = {}\n    lines = help_message.strip().split('\\n')\n    for line in lines:\n        category_start = line.find('Category: ') + len('Category: ')\n        category_end = line.find(', Commands:')\n        category = line[category_start:category_end].strip()\n        commands_start = line.find('Commands: `') + len('Commands: `')\n        commands_end = line.rfind('`')\n        commands = line[commands_start:commands_end].split(', ')\n        category_commands[category] = commands\n    return category_commands\n", "entry_point": "parse_help_message", "input": "'Category: y, Commands: ``'", "output": "{'y': ['']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115695_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021487", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5219", "output": "{1, 5219, 17, 307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021488", "code": "def find_ultimate_question_index(questions):\n    for index, question in enumerate(questions):\n        if 'Answer to the Ultimate Question of Life, the Universe, and Everything' in question:\n            return index\n    return -1\n", "entry_point": "find_ultimate_question_index", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112316_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4034", "output": "{1, 4034, 2, 2017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021490", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'1h'", "output": "3600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021491", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "9", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021492", "code": "def traffic_light_cycle(durations):\n    total_time = sum(durations)  # Initialize total time to sum of all durations\n    # Add the time for the yellow light phase (which is the second element in the cycle)\n    total_time += durations[2]\n    return total_time\n", "entry_point": "traffic_light_cycle", "input": "[20, 25, 5]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34862_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021493", "code": "def count_unique_awards(users):\n    unique_awards = set()\n    for user in users:\n        unique_awards.update(user[\"awards\"])\n    return len(unique_awards)\n", "entry_point": "count_unique_awards", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119564_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021494", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'/home/user/ta', '12341'", "output": "'/home/user/ta/12341'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021495", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[3, 2, 2, -1]", "output": "[3, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021496", "code": "from typing import List\ndef maxProfit(prices: List[int]) -> int:\n    if not prices or len(prices) < 2:\n        return 0\n    max_profit = 0\n    min_price = prices[0]\n    for price in prices[1:]:\n        min_price = min(min_price, price)\n        max_profit = max(max_profit, price - min_price)\n    return max_profit\n", "entry_point": "maxProfit", "input": "[1, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94869_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021497", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average", "input": "[90, 92, 94, 96, 97]", "output": "94", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143747_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021498", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[85, 81, 80, 78, 79, 76]", "output": "[85, 81, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3605", "output": "{1, 515, 35, 5, 7, 103, 721, 3605}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021500", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "''", "output": "'Invalid URL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021501", "code": "def count_test_results(results):\n    pass_count = sum(1 for result in results if result)\n    fail_count = sum(1 for result in results if not result)\n    return (pass_count, fail_count)\n", "entry_point": "count_test_results", "input": "[True, True, False, False, False, False]", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7187_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021502", "code": "from typing import List\ndef process_commands(commands: List[str]) -> int:\n    result = 0\n    for command in commands:\n        parts = command.split()\n        command_name = parts[0]\n        arguments = list(map(int, parts[1:]))\n        if command_name == 'add':\n            result += sum(arguments)\n        elif command_name == 'subtract':\n            result -= arguments[0]\n            for arg in arguments[1:]:\n                result -= arg\n        elif command_name == 'multiply':\n            result *= arguments[0]\n            for arg in arguments[1:]:\n                result *= arg\n    return result\n", "entry_point": "process_commands", "input": "['add 1000', 'multiply 3', 'add 600']", "output": "3600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38199_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021503", "code": "# Sample data for demonstration\nLOCALEDIR = '/path/to/locales'\nlangcodes = ['en', 'fr', 'de', 'es', 'it']\ntranslates = {'en': 'English', 'fr': 'French', 'de': 'German', 'es': 'Spanish', 'it': 'Italian'}\ndef get_language_name(language_code):\n    return translates.get(language_code, \"Language not found\")\n", "entry_point": "get_language_name", "input": "'es'", "output": "'Spanish'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94235_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021504", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6425", "output": "{1, 257, 1285, 5, 6425, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6424", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021505", "code": "def calculate_accuracy(actual, predicted):\n    # Calculate the number of correct predictions\n    correct_predictions = sum([1 if x == y else 0 for x, y in zip(actual, predicted)])\n    # Calculate the total number of predictions\n    total_predictions = len(actual)\n    # Calculate the accuracy as a percentage\n    accuracy = (correct_predictions / total_predictions) * 100.0\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[0, 1, 0, 1], [0, 0, 1, 1]", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40560_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021506", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/b/'", "output": "'b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021507", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[139]", "output": "1668", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3963", "output": "{3, 1, 3963, 1321}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021509", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[9, 9, 9, 1, 2, 3]", "output": "[9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021510", "code": "from typing import List\ndef custom_reduce_product(nums: List[int]) -> int:\n    result = 1\n    for num in nums:\n        result *= num\n    return result\n", "entry_point": "custom_reduce_product", "input": "[5, 12, 8]", "output": "480", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84659_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021511", "code": "def generate_ui_output(translation_dict: dict) -> str:\n    output = \"\"\n    for key, value in translation_dict.items():\n        output += f\"{key}: {value}\\n\"\n    return output\n", "entry_point": "generate_ui_output", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76926_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021512", "code": "def find_two_largest(numbers):\n    largest = None\n    second_largest = None\n    for num in numbers:\n        if largest is None or num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and (second_largest is None or num > second_largest):\n            second_largest = num\n    return (largest, second_largest if second_largest is not None else None)\n", "entry_point": "find_two_largest", "input": "[1, 2, 3, 4, 5, 6]", "output": "(6, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99134_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021513", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-5, -6, -4, -5, -5, -4, -4, -4, -5]", "output": "[5, 6, 4, 5, 5, 4, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021514", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'INITIAL', 'UNKNOWN_EVENT'", "output": "'INITIAL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021515", "code": "def categorize_value(value):\n    if value < 10:\n        return \"Low\"\n    elif 10 <= value < 20:\n        return \"Medium\"\n    else:\n        return \"High\"\n", "entry_point": "categorize_value", "input": "20", "output": "'High'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40001_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021516", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "12", "output": "'1100'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021517", "code": "from typing import List\ndef max_loot_circle(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob_range(start, end):\n        max_loot = [0, nums[start]]\n        for i in range(start+1, end+1):\n            max_loot.append(max(max_loot[-1], max_loot[-2] + nums[i]))\n        return max_loot[-1]\n    return max(rob_range(0, len(nums)-2), rob_range(1, len(nums)-1))\n", "entry_point": "max_loot_circle", "input": "[5, 1, 6, 3, 5]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119426_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021518", "code": "def replace_with_index(text, chars):\n    modified_text = \"\"\n    for index, char in enumerate(text):\n        if char in chars:\n            modified_text += str(index)\n        else:\n            modified_text += char\n    return modified_text\n", "entry_point": "replace_with_index", "input": "'arid!x', 'aix'", "output": "'0r2d!5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29744_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021519", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4722", "output": "{1, 2, 3, 1574, 6, 4722, 787, 2361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4721", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021520", "code": "def generate_status_message(shipment_status, payment_status):\n    if shipment_status == \"ORDERED\" and payment_status == \"NOT PAID\":\n        return \"Order placed, payment pending\"\n    elif shipment_status == \"SHIPPED\" and payment_status == \"PAID\":\n        return \"Order shipped and payment received\"\n    else:\n        return f\"Order status: {shipment_status}, Payment status: {payment_status}\"\n", "entry_point": "generate_status_message", "input": "'ORDERED', 'NOT PAID'", "output": "'Order placed, payment pending'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73464_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021521", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'cc'", "output": "['cc', 'cc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5347", "output": "{1, 5347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021523", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[4, 4]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021524", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/path/to/hot'", "output": "'hot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6311", "output": "{1, 6311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021526", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'you are'", "output": "{'you': 1, 'are': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021527", "code": "# Define the error code mappings in the ret_dict dictionary\nret_dict = {\n    404: \"Not Found\",\n    500: \"Internal Server Error\",\n    403: \"Forbidden\",\n    400: \"Bad Request\"\n}\ndef response_string(code):\n    # Check if the error code exists in the ret_dict dictionary\n    return ret_dict.get(code, \"\uc815\ubcf4 \uc5c6\uc74c\")\n", "entry_point": "response_string", "input": "500", "output": "'Internal Server Error'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57903_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021528", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1006", "output": "{1, 2, 1006, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1005", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6293", "output": "{1, 899, 7, 203, 6293, 217, 29, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021530", "code": "def normalize_text(text):\n    normalized_text = []\n    word = \"\"\n    for char in text:\n        if char.isalnum():\n            word += char\n        elif word:\n            normalized_text.append(word)\n            word = \"\"\n    if word:\n        normalized_text.append(word)\n    return \" \".join(normalized_text).lower()\n", "entry_point": "normalize_text", "input": "'hell@hello'", "output": "'hell hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35252_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021531", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "1, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021532", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[5, 7, 12, 18]", "output": "[12, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021533", "code": "def find_highest_score(scores):\n    if not scores:\n        return None\n    highest_score = scores[0]\n    for score in scores[1:]:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[50, 80, 99]", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73697_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021534", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1997", "output": "{1, 1997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021535", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[1, 2]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021536", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'ont', 'saamaple.reads.fa'", "output": "'saamaple_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2174", "output": "{1, 2, 2174, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2173", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7064", "output": "{1, 2, 4, 1766, 8, 3532, 883, 7064}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7063", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021539", "code": "def chunk_list(input_list, chunk_size):\n    chunked_list = []\n    for index in range(0, len(input_list), chunk_size):\n        chunked_list.append(input_list[index : index + chunk_size])\n    return chunked_list\n", "entry_point": "chunk_list", "input": "[7, 8, 0, 3, 8, 3, 3, 8, 8], 5", "output": "[[7, 8, 0, 3, 8], [3, 3, 8, 8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50736_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021540", "code": "from urllib.parse import urlparse\ndef extract_domain_names(urls):\n    domain_names = []\n    for url in urls:\n        parsed_url = urlparse(url)\n        domain_names.append(parsed_url.netloc)\n    return list(set(domain_names))\n", "entry_point": "extract_domain_names", "input": "['http://ge1']", "output": "['ge1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9663_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021541", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "40.0, 1.5", "output": "38.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021542", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[1, 2, 1, 2, 3, 2, 1]", "output": "[1, 3, 4, 6, 9, 11, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021543", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "2, 56.5", "output": "113", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "916", "output": "{1, 2, 4, 229, 458, 916}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt915", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5948", "output": "{1, 2, 4, 1487, 5948, 2974}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5947", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021546", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "6, 0", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021547", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "99", "output": "'?99'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021548", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2373", "output": "{1, 3, 2373, 7, 113, 339, 21, 791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021549", "code": "def snake_case(string):\n    return string.replace(\" \", \"_\").lower()\n", "entry_point": "snake_case", "input": "'hhehheheh'", "output": "'hhehheheh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78100_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021550", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'aaabbbbcc23'", "output": "{'a': 3, 'b': 4, 'c': 2, '2': 1, '3': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021551", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5421", "output": "{1, 417, 3, 39, 139, 13, 5421, 1807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021552", "code": "import math\ndef calculate_distances(points):\n    distances = {}\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            distances[(points[i], points[j])] = distance\n    return distances\n", "entry_point": "calculate_distances", "input": "[(-5, 5), (-5, 5)]", "output": "{((-5, 5), (-5, 5)): 0.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67685_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021553", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[91, 90, 85, 80, 75, 70]", "output": "[91, 90, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021554", "code": "def calculate_name_value(name):\n    alphavalue = sum(ord(char) - 64 for char in name)\n    return alphavalue\n", "entry_point": "calculate_name_value", "input": "'T'", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140001_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021555", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'xeeeoxx', 'ge1e123'", "output": "'ws://xeeeoxx/ge1e123/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021556", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[1, 7], 5", "output": "[1, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7306", "output": "{1, 2, 3653, 7306, 13, 562, 281, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5547", "output": "{1, 129, 3, 5547, 43, 1849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021559", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8897", "output": "{1, 8897, 287, 7, 41, 1271, 217, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021560", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'21'", "output": "{'21': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021561", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/some_directory/start', '/some_directory/h'", "output": "'../h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021562", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2957", "output": "{1, 2957}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021563", "code": "def calculate_average_score(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score, 2)  # Round the average score to 2 decimal places\n", "entry_point": "calculate_average_score", "input": "[70, 78, 79, 82, 85]", "output": "79.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140998_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021564", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "6, 11", "output": "[1, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021565", "code": "def calculate_percentiles(data):\n    data.sort()  # Sort the input data in ascending order\n    percentiles = []\n    for i in range(10, 101, 10):\n        index = int(i / 100 * len(data))  # Calculate the index for the current percentile\n        percentiles.append(data[index - 1])  # Retrieve the value at the calculated index\n    return percentiles\n", "entry_point": "calculate_percentiles", "input": "[2, 2, 2, 2, 2, 2, 3, 3, 3]", "output": "[3, 2, 2, 2, 2, 2, 2, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82884_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021566", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'2'", "output": "['2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021567", "code": "from typing import Dict, List\ndef topological_sort(graph: Dict[int, List[int]]) -> List[int]:\n    visited = set()\n    post_order = []\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        post_order.append(node)\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node)\n    return post_order[::-1]\n", "entry_point": "topological_sort", "input": "{1: [5, 6], 5: [6]}", "output": "[1, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78090_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021568", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "343", "output": "{1, 7, 49, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt342", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021569", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "-3, 10", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021570", "code": "def maxTurbulenceSize(A):\n    ans = 1\n    start = 0\n    for i in range(1, len(A)):\n        c = (A[i-1] > A[i]) - (A[i-1] < A[i])\n        if c == 0:\n            start = i\n        elif i == len(A)-1 or c * ((A[i] > A[i+1]) - (A[i] < A[i+1])) != -1:\n            ans = max(ans, i - start + 1)\n            start = i\n    return ans\n", "entry_point": "maxTurbulenceSize", "input": "[9, 1, 8, 2, 7, 3, 6]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41497_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021571", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "11", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021572", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[10, 4], 10", "output": "140", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021573", "code": "def find_median(arr):\n    arr.sort()\n    n = len(arr)\n    if n % 2 == 1:\n        return arr[n // 2]\n    else:\n        mid_right = n // 2\n        mid_left = mid_right - 1\n        return (arr[mid_left] + arr[mid_right]) / 2\n", "entry_point": "find_median", "input": "[4.0]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141135_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021574", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 10, 0", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021575", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "126, 4", "output": "'0126'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021576", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110110X'", "output": "['11101100', '11101101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt26", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8817", "output": "{1, 2939, 3, 8817}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021578", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "5", "output": "'02468'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021579", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[4, 2, 1, 3, 3, 2, 3]", "output": "[4, 3, 3, 6, 7, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021580", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9017", "output": "{1, 127, 71, 9017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021581", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[3, 3, 3, 7, 4, 4, 1, 5]", "output": "[3, 7, 4, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021582", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "1, 0, 9.960000000000003", "output": "9.960000000000003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021583", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'naamlun_ame_that_exceedst'", "output": "'naamlun_ame_that_exceedst'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6013", "output": "{1, 859, 6013, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021585", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'41.24.4.0.1.22'", "output": "(41, 24, 4, 0, 1, 22)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021586", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[1, 5, 6, 6, 3, 1, 3, 6, 5]", "output": "[1, 5, 6, 6, 3, 1, 3, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021587", "code": "def replace_with_index(text, chars):\n    modified_text = \"\"\n    for index, char in enumerate(text):\n        if char in chars:\n            modified_text += str(index)\n        else:\n            modified_text += char\n    return modified_text\n", "entry_point": "replace_with_index", "input": "'world!', 'ol'", "output": "'w1r3d!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29744_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021588", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[2, 3, 4, 5, -1, -2]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021589", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0, -0.6140000000000001, None", "output": "-0.6140000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021590", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 4, 5, 8, 6, 3, 8]", "output": "[4, 8, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2733", "output": "{1, 3, 2733, 911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021592", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[5, 5, 0, 3]", "output": "[5, 5, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021593", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    round_num = 1\n    while player1_deck and player2_deck:\n        player1_card = player1_deck.pop(0)\n        player2_card = player2_deck.pop(0)\n        if player1_card > player2_card:\n            player1_score += 1\n        elif player2_card > player1_card:\n            player2_score += 1\n        round_num += 1\n    if player1_score > player2_score:\n        return \"Player 1 wins the game!\"\n    elif player2_score > player1_score:\n        return \"Player 2 wins the game!\"\n    else:\n        return \"It's a tie!\"\n", "entry_point": "simulate_card_game", "input": "[5, 4, 3], [1, 2, 3]", "output": "'Player 1 wins the game!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16584_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "501", "output": "{1, 3, 501, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021595", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'11', ''", "output": "'11p'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021596", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=ecity=Nacitnw'", "output": "{'name': 'ecity=Nacitnw'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021597", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "863", "output": "{1, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "963", "output": "{1, 321, 3, 963, 9, 107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021599", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_score = sorted_scores[N-1]\n    count_top_score = sorted_scores.count(top_score)\n    sum_top_scores = sum(sorted_scores[:sorted_scores.index(top_score) + count_top_score])\n    average = sum_top_scores / count_top_score\n    return average\n", "entry_point": "calculate_top_players_average", "input": "[100, 100, 100, 100], 4", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54118_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021600", "code": "SCRABBLE_LETTER_VALUES = {\n    'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4,\n    'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3,\n    'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8,\n    'Y': 4, 'Z': 10\n}\ndef calculate_scrabble_points(word, n):\n    total_points = 0\n    for letter in word:\n        total_points += SCRABBLE_LETTER_VALUES.get(letter.upper(), 0)\n    total_points *= len(word)\n    if len(word) == n:\n        total_points += 50\n    return total_points\n", "entry_point": "calculate_scrabble_points", "input": "'H', 1", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_169_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021601", "code": "import re\ndef extract_entities(input_str):\n    entities = set()\n    lines = input_str.split('\\n')\n    for line in lines:\n        match = re.match(r'\\w+\\((\\w+)\\)\\.', line)\n        if match:\n            entities.add(match.group())\n        match = re.match(r'\\w+\\((\\w+)\\) :-', line)\n        if match:\n            entities.add(match.group())\n        matches = re.findall(r'\\w+\\((\\w+)\\)', line)\n        entities.update(matches)\n    return entities\n", "entry_point": "extract_entities", "input": "'num(22).\\n22'", "output": "{'num(22).', '22'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8402", "output": "{4201, 1, 8402, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021603", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[2, 3, 5, 1, 2, 9, 2]", "output": "[1, 2, 2, 2, 3, 5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021604", "code": "def text_transformation(input_str):\n    modified_str = input_str.replace(\"python\", \"Java\", -1).replace(\"Python\", \"Java\", -1) \\\n                            .replace(\"django\", \"Spring\", -1).replace(\"Django\", \"Spring\", -1)\n    return modified_str\n", "entry_point": "text_transformation", "input": "'programming.'", "output": "'programming.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109960_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7811", "output": "{73, 1, 7811, 107}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021606", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'5m'", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021607", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'se_clle'", "output": "'seClle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021608", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'Python, Java Script, C#, Kotlin'", "output": "['Python', 'Java Script', 'C#', 'Kotlin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021609", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[2, 0, 2, 1, 0, 2, 0, 0]", "output": "[2, 2, 1, 2, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021610", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'I&#39;m'", "output": "\"I'm\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021611", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "626", "output": "{1, 626, 2, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt625", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021612", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "[3, 4]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021613", "code": "def insert_operators(nums, target):\n    def insert_operators_helper(nums, target, expression, index, current_val, prev_num):\n        if index == len(nums):\n            if current_val == target:\n                result.append(expression)\n            return\n        for op in ['+', '*']:\n            if op == '+':\n                insert_operators_helper(nums, target, f\"{expression}+{nums[index]}\", index + 1, current_val + nums[index], nums[index])\n            else:\n                insert_operators_helper(nums, target, f\"{expression}*{nums[index]}\", index + 1, current_val - prev_num + prev_num * nums[index], prev_num * nums[index])\n    result = []\n    insert_operators_helper(nums, target, str(nums[0]), 1, nums[0], nums[0])\n    return result\n", "entry_point": "insert_operators", "input": "[1, 2, 3], 5", "output": "['1*2+3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97957_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021614", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[1, 1, 3, 2, 3]", "output": "[1, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021615", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[3, 1, 2, 6, 4], 3", "output": "[6, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8013", "output": "{1, 3, 8013, 2671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021617", "code": "def get_assembly_prefix(presets, sv_reads):\n    if presets == \"pacbio\":\n        presets_wtdbg2 = \"rs\"\n    else:\n        presets_wtdbg2 = \"ont\"\n    prefix = sv_reads.replace(\".reads.fa\", \"\")\n    return prefix + \"_\" + presets_wtdbg2\n", "entry_point": "get_assembly_prefix", "input": "'generic', 'sample_pacsi.reads.fa'", "output": "'sample_pacsi_ont'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_391_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8733", "output": "{1, 3, 71, 41, 213, 123, 8733, 2911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021619", "code": "def skipVowels(word):\n    novowels = ''\n    for ch in word:\n        if ch.lower() in 'aeiou':\n            continue\n        novowels += ch\n    return novowels\n", "entry_point": "skipVowels", "input": "'aeiou'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120866_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021620", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'This is a test file.', '1.011.'", "output": "{'1.011.': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5999", "output": "{857, 1, 7, 5999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021622", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9847", "output": "{1, 43, 229, 9847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021623", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[22, 23, 34, 11, 11, 11, 90, 64]", "output": "[11, 11, 11, 22, 23, 34, 64, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021624", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'MoviMoviBtchrmogoto'", "output": "'movi_movi_btchrmogoto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8303", "output": "{1, 361, 8303, 19, 437, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021626", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[1, 6]", "output": "[1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt34", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021627", "code": "import time\ndef calculate_seconds_until_future_time(current_time, future_time):\n    return abs(future_time - current_time)\n", "entry_point": "calculate_seconds_until_future_time", "input": "0, 4995", "output": "4995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45249_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021628", "code": "def count_paths(n):\n    s = [[0] * 10 for _ in range(n + 1)]\n    s[1] = [0] + [1] * 9\n    mod = 1000 ** 3\n    for i in range(2, n + 1):\n        for j in range(0, 9 + 1):\n            if j >= 1:\n                s[i][j] += s[i - 1][j - 1]\n            if j <= 8:\n                s[i][j] += s[i - 1][j + 1]\n    return sum(s[n]) % mod\n", "entry_point": "count_paths", "input": "4", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21515_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8301", "output": "{1, 3, 8301, 2767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2019", "output": "{3, 1, 2019, 673}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2479", "output": "{1, 67, 37, 2479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021632", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "9, 2", "output": "'Enemy: 9, Own: 2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021633", "code": "def fairRations(arr):\n    total_loaves = 0\n    for i in range(len(arr) - 1):\n        if arr[i] % 2 != 0:\n            arr[i] += 1\n            arr[i + 1] += 1\n            total_loaves += 2\n    if arr[-1] % 2 != 0:\n        return 'NO'\n    else:\n        return total_loaves\n", "entry_point": "fairRations", "input": "[1, 2, 1, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50701_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021634", "code": "def process_info(input_string):\n    char_count = {}\n    for char in input_string:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    return char_count\n", "entry_point": "process_info", "input": "'weohed'", "output": "{'w': 1, 'e': 2, 'o': 1, 'h': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28397_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021635", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[17, 18, 19, 18, 20]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021636", "code": "ADMIN_THEME = \"admin\"\nDEFAULT_THEME = \"core\"\ndef get_theme(theme_name):\n    if theme_name == ADMIN_THEME:\n        return ADMIN_THEME\n    elif theme_name == DEFAULT_THEME:\n        return DEFAULT_THEME\n    else:\n        return \"Theme not found\"\n", "entry_point": "get_theme", "input": "'core'", "output": "'core'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36609_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021637", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[0, 5, 5, 5, 5, 8, 8, 7, 1]", "output": "(44, 9, 0, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021638", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "6", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021639", "code": "from typing import List\ndef above_average(scores: List[int]) -> float:\n    total_sum = sum(scores)\n    class_average = total_sum / len(scores)\n    above_avg_scores = [score for score in scores if score > class_average]\n    if above_avg_scores:\n        above_avg_sum = sum(above_avg_scores)\n        above_avg_count = len(above_avg_scores)\n        above_avg_average = above_avg_sum / above_avg_count\n        return above_avg_average\n    else:\n        return 0.0\n", "entry_point": "above_average", "input": "[70, 75, 80, 85]", "output": "82.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77722_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021640", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "50, 36, 3", "output": "50.600833333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021641", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[15, 20, 16, 20], 15", "output": "[15, 20, 16, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021642", "code": "# Step 1: Define the expected plaintext value\nexpected_plaintext = \"Hello, World!\"\n# Step 2: Implement a function to decrypt the message using the specified cipher\ndef decrypt_message(cipher, encrypted_message):\n    # Simulate decryption using the specified cipher\n    decrypted_message = f\"Decrypted: {encrypted_message}\"  # Placeholder decryption logic\n    return decrypted_message\n", "entry_point": "decrypt_message", "input": "'some_cipher', 'Encrypted:'", "output": "'Decrypted: Encrypted:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65674_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021643", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    # Split the input string at the '.' character\n    app_name, config_class = default_app_config.split('.')[:2]\n    # Return a tuple containing the app name and configuration class name\n    return app_name, config_class\n", "entry_point": "parse_default_app_config", "input": "'gunmel.appsnfig'", "output": "('gunmel', 'appsnfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77517_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021644", "code": "from typing import List\ndef minimize_task_completion_time(tasks: List[int], workers: int) -> int:\n    tasks.sort(reverse=True)\n    worker_times = [0] * workers\n    for task in tasks:\n        min_time_worker = worker_times.index(min(worker_times))\n        worker_times[min_time_worker] += task\n    return max(worker_times)\n", "entry_point": "minimize_task_completion_time", "input": "[4, 3, 4], 2", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68875_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021645", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'! 1l e l o@# 123$%'", "output": "'1lelo123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021646", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hworlelll'", "output": "{'hworlelll': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021647", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['2.0.0', '3.3.3', '3.3.4']", "output": "'3.3.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021648", "code": "def sum_even_numbers(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_numbers", "input": "[2, 4, 6, 8, 10, 16]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102825_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021649", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[3, 3, 3, 3, 3, 1, 1]", "output": "{3: 5, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021650", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'##a00!a000#aab0@'", "output": "'a00a000aab0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021651", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "128, 15", "output": "'000000000000128'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5230", "output": "{1, 2, 5, 10, 523, 5230, 1046, 2615}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5229", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021653", "code": "def total_cost(nums, A, B):\n    if B == 0:\n        return float(A)\n    k_m = 2 * A / B\n    count = 0\n    j_s = [nums[0]]\n    for i in range(1, len(nums)):\n        if nums[i] - nums[i - 1] <= k_m:\n            j_s.append(nums[i])\n        else:\n            count += A + (j_s[-1] - j_s[0]) / 2 * B\n            j_s = [nums[i]]\n    count += A + (j_s[-1] - j_s[0]) / 2 * B\n    return float(count)\n", "entry_point": "total_cost", "input": "[], 5.0, 0", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101200_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021654", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9023", "output": "{1, 7, 1289, 9023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "293", "output": "{1, 293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021656", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'wld'", "output": "'wld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "973", "output": "{1, 139, 973, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt972", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2587", "output": "{1, 2587, 13, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021659", "code": "def map_scim_attributes_to_userprofile(scim_filter: str) -> dict:\n    # Split the SCIM filter string by spaces\n    parts = scim_filter.split()\n    # Extract the SCIM attribute and value\n    scim_attribute = parts[0]\n    value = parts[-1].strip('\"')\n    # Map SCIM attributes to UserProfile fields\n    attribute_mapping = {\n        \"userName\": \"email\",\n        # Add more mappings as needed\n    }\n    # Return the mapping for the given SCIM attribute\n    return {scim_attribute: attribute_mapping.get(scim_attribute, \"N/A\")}\n", "entry_point": "map_scim_attributes_to_userprofile", "input": "'eqeqqqq eq'", "output": "{'eqeqqqq': 'N/A'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72592_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021660", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) < 3:\n        return 0  # Handle edge case where there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_excluding_extremes", "input": "[60, 65, 66, 67, 69, 80]", "output": "66.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108103_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021661", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1773", "output": "{1, 3, 197, 9, 1773, 591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021662", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1498", "output": "{1, 2, 7, 107, 749, 14, 214, 1498}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021663", "code": "import re\nTRAILING_WS_IN_CONTINUATION = re.compile(r'\\\\ \\s+\\n')\ndef remove_trailing_whitespace(input_string: str) -> str:\n    return TRAILING_WS_IN_CONTINUATION.sub(r'\\\\n', input_string)\n", "entry_point": "remove_trailing_whitespace", "input": "'123'", "output": "'123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71646_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021664", "code": "def count_blocks_in_level(level_config):\n    total_blocks = sum(sum(1 for block in row if block != 0) for row in level_config)\n    return total_blocks\n", "entry_point": "count_blocks_in_level", "input": "[[1, 1, 1, 1, 1], [1, 1, 0, 0]]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125401_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021665", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 8]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63873_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021666", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "(5, 10, 11), 3", "output": "(1.6666666666666667, 3.3333333333333335, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021667", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[70, 80, 80, 82, 84, 83, 90]", "output": "81.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91403_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021668", "code": "def modify_list(lst, threshold):\n    modified_lst = []\n    for num in lst:\n        if num >= threshold:\n            sum_greater = sum([x for x in lst if x >= threshold])\n            modified_lst.append(sum_greater)\n        else:\n            modified_lst.append(num)\n    return modified_lst\n", "entry_point": "modify_list", "input": "[7, 7, 8], 7", "output": "[22, 22, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28092_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021669", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "14", "output": "377", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021670", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[2, 1, -3, 2, 1, 2]", "output": "[4, 0, -4, 4, 0, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021671", "code": "def reverse_str(s, k):\n    result = ''\n    for i in range(0, len(s), 2*k):\n        result += s[i:i+k][::-1] + s[i+k:i+2*k]\n    return result\n", "entry_point": "reverse_str", "input": "'abcdefg', 2", "output": "'bacdfeg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58788_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021672", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 3, 1, 7, 1, 1, 5, 7]", "output": "[1, 4, 3, 10, 5, 6, 11, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021673", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    sum_scores_except_lowest = sum(sorted_scores[1:])\n    average = sum_scores_except_lowest / (len(scores) - 1)\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[90, 94, 95, 96, 91]", "output": "94.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71878_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021674", "code": "from typing import List, Tuple\ndef process_checkbox_state(initial_state: List[Tuple[int, int]], error_location: Tuple[int, int, int]) -> List[Tuple[int, int]]:\n    input_fields = {index: state for index, state in initial_state}\n    checkbox_state = error_location[1] if error_location[0] == error_location[2] else 1 - error_location[1]\n    for index, state in initial_state:\n        if index != error_location[0]:\n            input_fields[index] = checkbox_state\n    return [(index, input_fields[index]) for index in sorted(input_fields.keys())]\n", "entry_point": "process_checkbox_state", "input": "[], (0, 0, 0)", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021675", "code": "def generate_status_message(shipment_status, payment_status):\n    if shipment_status == \"ORDERED\" and payment_status == \"NOT PAID\":\n        return \"Order placed, payment pending\"\n    elif shipment_status == \"SHIPPED\" and payment_status == \"PAID\":\n        return \"Order shipped and payment received\"\n    else:\n        return f\"Order status: {shipment_status}, Payment status: {payment_status}\"\n", "entry_point": "generate_status_message", "input": "'PROCSSDE', 'NOTTN'", "output": "'Order status: PROCSSDE, Payment status: NOTTN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73464_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021676", "code": "def search_engine(query):\n    # Simulated database with search results and relevance scores\n    database = {\n        \"apple\": 0.8,\n        \"orange\": 0.6,\n        \"fruit\": 0.4\n    }\n    def evaluate_expression(expression):\n        if expression in database:\n            return database[expression]\n        elif expression == \"AND\":\n            return 1  # Simulated relevance score for AND operator\n        elif expression == \"OR\":\n            return 0.5  # Simulated relevance score for OR operator\n    def evaluate_query(query_tokens):\n        stack = []\n        for token in query_tokens:\n            if token == \"AND\":\n                operand1 = stack.pop()\n                operand2 = stack.pop()\n                stack.append(max(operand1, operand2))\n            elif token == \"OR\":\n                operand1 = stack.pop()\n                operand2 = stack.pop()\n                stack.append(max(operand1, operand2))\n            else:\n                stack.append(evaluate_expression(token))\n        return stack.pop()\n    query_tokens = query.split()\n    relevance_scores = [(token, evaluate_expression(token)) for token in query_tokens]\n    relevance_scores.sort(key=lambda x: x[1], reverse=True)\n    search_results = [{\"ID\": i, \"Relevance Score\": score} for i, (token, score) in enumerate(relevance_scores)]\n    return search_results\n", "entry_point": "search_engine", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23618_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021677", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'=CC(=O)OCOCCCCC'", "output": "'=CC(=O)OCOCCCCC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021678", "code": "def count_occurrences(input_list: list) -> dict:\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[1, 1, 2, 2, 3]", "output": "{1: 2, 2: 2, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114860_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021679", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 30, 30, 40, 40, 50]", "output": "[1, 2, 3, 3, 3, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021680", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'sngigsh'", "output": "'sngigsh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021681", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{3, 4}, {5, 7, 8}", "output": "{3, 4, 5, 7, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021682", "code": "import itertools\ndef unique_eigenvalue_differences(eigvals):\n    unique_eigvals = sorted(set(eigvals))\n    differences = {j - i for i, j in itertools.combinations(unique_eigvals, 2)}\n    return tuple(sorted(differences))\n", "entry_point": "unique_eigenvalue_differences", "input": "[0, 1, 4]", "output": "(1, 3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124400_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021683", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'xyz2273255244abc33773def'", "output": "{2273255244, 33773}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021684", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "1234566", "output": "'1.234.566'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021685", "code": "def format_ranges(lst):\n    formatted_ranges = []\n    start = end = lst[0]\n    for i in range(1, len(lst)):\n        if lst[i] == end + 1:\n            end = lst[i]\n        else:\n            if end - start >= 2:\n                formatted_ranges.append(f\"{start}-{end}\")\n            else:\n                formatted_ranges.extend(str(num) for num in range(start, end + 1))\n            start = end = lst[i]\n    if end - start >= 2:\n        formatted_ranges.append(f\"{start}-{end}\")\n    else:\n        formatted_ranges.extend(str(num) for num in range(start, end + 1))\n    return ','.join(map(str, formatted_ranges))\n", "entry_point": "format_ranges", "input": "[5, 14, 9, 5, 5, 17, 17]", "output": "'5,14,9,5,5,17,17'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111612_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021686", "code": "def consolidate(sets):\n    setlist = [s for s in sets if s]\n    for i, s1 in enumerate(setlist):\n        if s1:\n            for s2 in setlist[i+1:]:\n                intersection = s1.intersection(s2)\n                if intersection:\n                    s2.update(s1)\n                    s1.clear()\n                    s1 = s2\n    return [s for s in setlist if s]\n", "entry_point": "consolidate", "input": "[{4}, {6}, {8}, {5}]", "output": "[{4}, {6}, {8}, {5}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20502_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021687", "code": "def letter_counter(token, word):\n    count = 0\n    for letter in word:\n        if letter == token:\n            count += 1\n    return count\n", "entry_point": "letter_counter", "input": "'a', 'cat'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100580_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021688", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[[1, 0], [1, 7], [6, 7, 5, 7], [0]]", "output": "[1, 0, 1, 7, 6, 7, 5, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021689", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3745", "output": "{1, 3745, 35, 5, 7, 107, 749, 535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021690", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[2, 3, 2, 1, 4, 5, 5, 1]", "output": "[4, 13, 4, 1, 16, 125, 125, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021691", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[0, 8, 2, 7, 7, 3, 7, 9]", "output": "[8, 2, 7, 7, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021692", "code": "def subtract_numbers(a, b):\n    if b > a:\n        return abs(a - b)\n    else:\n        return a - b\n", "entry_point": "subtract_numbers", "input": "0, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84690_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021693", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[22, 29, 30]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021694", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'World!'", "output": "'<strong>World!</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021695", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6558", "output": "{1, 2, 3, 1093, 6, 2186, 3279, 6558}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021696", "code": "# Existing key mapping from the code snippet\n__key_mapping = {'a': 'A', 'b': 'B', 'c': 'C'}\n# Additional key mappings for extension\nextended_key_mapping = {'1': 'one', '2': 'two', '3': 'three'}\ndef translate_key_extended(e):\n    if 'key' in e and len(e['key']) > 0:\n        if e['key'] in __key_mapping:\n            return __key_mapping[e['key']]\n        elif e['key'] in extended_key_mapping:\n            return extended_key_mapping[e['key']]\n        else:\n            return e['key']\n    else:\n        if 'char' in e:\n            if e['char'] == '\\x08':\n                return 'backspace'\n            elif e['char'] == '\\t':\n                return 'tab'\n        return ''\n", "entry_point": "translate_key_extended", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40467_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021697", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[4, 2, 5, 5]", "output": "[4, 2, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4539", "output": "{1, 3, 1513, 267, 17, 51, 89, 4539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021699", "code": "def check_initialization(lines):\n    required_imports = {'os', 'sys', 'logging'}\n    required_variable = 'initialized = True'\n    required_version_import = 'from spooq2._version import __version__ as version_number'\n    found_imports = set()\n    found_variable = False\n    found_version_import = False\n    for line in lines:\n        if any(import_stmt in line for import_stmt in required_imports):\n            found_imports.update(import_stmt for import_stmt in required_imports if import_stmt in line)\n        if required_variable in line:\n            found_variable = True\n        if required_version_import in line:\n            found_version_import = True\n    return found_imports == required_imports and found_variable and found_version_import\n", "entry_point": "check_initialization", "input": "['import random', 'x = 5', 'def foo(): pass']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26908_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021700", "code": "def download_and_clean_files(file_ids):\n    downloaded_files = []\n    for file_id in file_ids:\n        print(f\"Downloading file with ID: {file_id}\")\n        downloaded_files.append(file_id)\n    # Simulate cleaning by removing file with ID 102\n    downloaded_files = [file_id for file_id in downloaded_files if file_id != 102]\n    return downloaded_files\n", "entry_point": "download_and_clean_files", "input": "[101, 102, 103]", "output": "[101, 103]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54622_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021701", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "1, 104, 104", "output": "[104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021702", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[3, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021703", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[170, 173, 175, 172, 177]", "output": "173", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021704", "code": "import re\ndef sub(message, regex):\n    parts = regex.split(\"/\")\n    pattern = parts[1]\n    replacement = parts[2]\n    flags = parts[3] if len(parts) > 3 else \"\"\n    count = 1\n    if \"g\" in flags:\n        count = 0\n    elif flags.isdigit():\n        count = int(flags)\n    return re.sub(pattern, replacement, message, count)\n", "entry_point": "sub", "input": "'Hello, World!', '/o/0/g'", "output": "'Hell0, W0rld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32281_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021705", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[], 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021706", "code": "from typing import List\ndef max_subarray_sum(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[-4]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120167_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021707", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4616", "output": "{1, 2, 1154, 2308, 4, 577, 4616, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4615", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021708", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "555, 7", "output": "'0000555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021709", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "2.64159, 5", "output": "2.64159", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021710", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'&Hellolt;'", "output": "'&Hellolt;'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021711", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6941", "output": "{1, 11, 6941, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1651", "output": "{1, 1651, 13, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1650", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021713", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'01:30:45 AM'", "output": "'01:30:45'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021714", "code": "from typing import Dict\ndef extract_translations(translations_str: str) -> Dict[str, str]:\n    translations = {}\n    segments = translations_str.split(',')\n    for segment in segments:\n        lang, trans = segment.split(':')\n        translations[lang.strip()] = trans.strip()\n    return translations\n", "entry_point": "extract_translations", "input": "'EEnglish: Hellrn'", "output": "{'EEnglish': 'Hellrn'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113559_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021715", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[3, 5]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021716", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'PrsPPP', 'hhppp'", "output": "'PrsPPP.hhppp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9364", "output": "{1, 2, 4, 2341, 4682, 9364}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9363", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8597", "output": "{1, 8597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021719", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[2, 3, 3, 3, 5, 0, 3, 0]", "output": "[5, 6, 6, 8, 5, 3, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112873_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021720", "code": "from typing import List, Dict, Union\ndef count_unique_items(items: List[Union[str, int, float]]) -> Dict[Union[str, int, float], int]:\n    unique_items_count = {}\n    for item in items:\n        if isinstance(item, (str, int, float)):\n            unique_items_count[item] = unique_items_count.get(item, 0) + 1\n    return unique_items_count\n", "entry_point": "count_unique_items", "input": "['bannana', 'bannana', 'cherry']", "output": "{'bannana': 2, 'cherry': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129093_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021721", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5653", "output": "{1, 5653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021722", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6874", "output": "{1, 2, 7, 491, 3437, 14, 982, 6874}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021723", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[1, 1, 2, 3]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021724", "code": "def count_non_whitespace_chars(input_string):\n    count = 0\n    for char in input_string:\n        if not char.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'HelloWorld123'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021725", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'teamworrk'", "output": "'teamworrk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021726", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9669", "output": "{1, 33, 3, 9669, 293, 11, 879, 3223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021727", "code": "def sum_of_primes(numbers):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 7, 29]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126564_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021728", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3945", "output": "{1, 3, 1315, 5, 263, 3945, 15, 789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021729", "code": "def calculate_cumulative_sum(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "calculate_cumulative_sum", "input": "[2, 4, 5, 6, 1, 1, 4, 3]", "output": "[2, 6, 11, 17, 18, 19, 23, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126098_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021730", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "438", "output": "{1, 2, 3, 6, 73, 146, 438, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt437", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021731", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[-27], 2", "output": "-27.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1522", "output": "{1, 1522, 2, 761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021733", "code": "def find_next_square(sq: int) -> int:\n    \"\"\"\n    Finds the next perfect square after the given number.\n    Args:\n    sq: An integer representing the input number.\n    Returns:\n    An integer representing the next perfect square if the input is a perfect square, otherwise -1.\n    \"\"\"\n    sqrt_of_sq = sq ** 0.5\n    return int((sqrt_of_sq + 1) ** 2) if sqrt_of_sq.is_integer() else -1\n", "entry_point": "find_next_square", "input": "4", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35410_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021734", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7261", "output": "{1, 137, 53, 7261}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7260", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021735", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021736", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hellowo'", "output": "{'hellowo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021737", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[5, 2, 1, 5, 6, 1, 3, 5]", "output": "[5, 3, 3, 8, 10, 6, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021738", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 2, 4, 2, 0, 0, -1, 2, 2]", "output": "[5, 6, 6, 2, 0, -1, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51354_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021739", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'=name=Dime=n8nam'", "output": "{'': 'name=Dime=n8nam'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021740", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "None, None, '1.1.9'", "output": "'1.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021741", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[5, 3, 0, 5, 5, 6, 5, 5]", "output": "[6, 4, 1, 6, 6, 7, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021742", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "3, 2", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7923", "output": "{1, 417, 3, 139, 2641, 7923, 19, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021744", "code": "def min_distance_to_parking(N, M, occupied_positions):\n    if M == 0:\n        return 1\n    occupied_positions.sort()\n    distances = [occupied_positions[0] - 1] + [occupied_positions[i] - occupied_positions[i - 1] - 1 for i in range(1, M)] + [N - occupied_positions[-1]]\n    return min(distances)\n", "entry_point": "min_distance_to_parking", "input": "5, 0, []", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38780_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3622", "output": "{1, 2, 1811, 3622}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3621", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021746", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'tth something else', 3", "output": "('tth', 'something else')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021747", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[1, 2], [1, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021748", "code": "def filter_shipping_zones(shipping_zones, threshold):\n    filtered_zones = [zone for zone in shipping_zones if zone[\"cost\"] <= threshold]\n    sorted_zones = sorted(filtered_zones, key=lambda x: x[\"name\"])\n    return sorted_zones\n", "entry_point": "filter_shipping_zones", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124051_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021749", "code": "def split_input_target(chunk):\n    input_text = chunk[:-1]\n    target_text = chunk[1:]\n    return input_text, target_text\n", "entry_point": "split_input_target", "input": "'helllo'", "output": "('helll', 'elllo')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41781_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021750", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "6, 16, 98", "output": "[17, 17, 16, 16, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021751", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[0, 9, 0, 10, 10, 3]", "output": "[10, 729, 10, 100, 100, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6421", "output": "{1, 6421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6420", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021753", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[16, 15, 10]", "output": "(16, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021754", "code": "import sys\ndef get_email_message_class(email_message_type):\n    email_message_classes = {\n        'EmailMessage': 'EmailMessage',\n        'EmailMultiAlternatives': 'EmailMultiAlternatives',\n        'MIMEImage': 'MIMEImage' if sys.version_info < (3, 0) else 'MIMEImage'\n    }\n    return email_message_classes.get(email_message_type, 'Unknown')\n", "entry_point": "get_email_message_class", "input": "'EmailMultiAlternatives'", "output": "'EmailMultiAlternatives'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140417_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021755", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "'Aliccecic'", "output": "'\"Aliccecic\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021756", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 80, 80]", "output": "[1, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021757", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "2", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021758", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[8, 8, 8]", "output": "[8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt67", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021759", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 2, 2, 0, 4, 1, 2, 4, 2]", "output": "[2, 4, 0, 16, 5, 12, 28, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45837_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021760", "code": "import math\ndef calculate_padding(size):\n    next_power_of_2 = 2 ** math.ceil(math.log2(size))\n    return next_power_of_2 - size\n", "entry_point": "calculate_padding", "input": "9", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17732_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021761", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'ppexem'", "output": "'ppexem_1050800243'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021762", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'divid', 1, 2", "output": "\"Error: Invalid operation type 'divid'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1054", "output": "{1, 2, 34, 527, 17, 62, 1054, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021764", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[2, 4, 3, 4, 4, 3, 4, 4]", "output": "[2, 4, 3, 4, 4, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021765", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'accuracy'", "output": "'accuracy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021766", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "1", "output": "['1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021767", "code": "def calculate_average_ascii(dataset):\n    char_count = {}\n    char_sum = {}\n    for data_point in dataset:\n        char = data_point[0]\n        ascii_val = ord(char)\n        if char in char_count:\n            char_count[char] += 1\n            char_sum[char] += ascii_val\n        else:\n            char_count[char] = 1\n            char_sum[char] = ascii_val\n    average_ascii = {char: char_sum[char] / char_count[char] for char in char_count}\n    return average_ascii\n", "entry_point": "calculate_average_ascii", "input": "['A', 'B', 'C']", "output": "{'A': 65.0, 'B': 66.0, 'C': 67.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54092_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021768", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "'og:desccrptiotime=2020-02-20'", "output": "{'og:desccrptiotime': '2020-02-20'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021769", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{0: 1, 2: 3, 4: 5}, 5", "output": "'[1,0,3,0,5,0]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2365", "output": "{1, 5, 11, 43, 55, 215, 473, 2365}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7519", "output": "{73, 1, 103, 7519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021772", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "539", "output": "{1, 7, 11, 77, 49, 539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021773", "code": "def check_pangram(s):\n    cleaned_str = ''.join(c for c in s.lower() if c.isalpha())\n    unique_chars = set(cleaned_str)\n    if len(unique_chars) == 26:\n        return \"pangram\"\n    else:\n        return \"not pangram\"\n", "entry_point": "check_pangram", "input": "'The quick brown fox jumps over the lazy dog'", "output": "'pangram'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23402_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021774", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'1.0.0'", "output": "(1, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021775", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[11, 33, 55, 22, 44]", "output": "([11, 33, 55], [22, 44])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021776", "code": "def generate_list(n):\n    res = []\n    for i in range(1, (n // 2) + 1):\n        res.append(i)\n    for i in range(-(n // 2), 0):\n        res.append(i)\n    return res\n", "entry_point": "generate_list", "input": "2", "output": "[1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88002_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021777", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    total = sum(scores)\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[89, 89, 90, 90, 90, 90, 90, 90, 90]", "output": "89.77777777777777", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45427_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021778", "code": "def calculate_unread_messages(topics, user):\n    total_unread_messages = 0\n    for topic in topics:\n        unread_messages = topic['unread_messages']\n        total_unread_messages += unread_messages.get(user, 0)\n    return total_unread_messages\n", "entry_point": "calculate_unread_messages", "input": "[], 'user'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16056_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021779", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5138", "output": "{1, 2, 7, 2569, 14, 367, 5138, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021780", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9908", "output": "{1, 2, 4, 2477, 9908, 4954}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9907", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021781", "code": "url_patterns = [\n    (\"/create-charge/\", \"checkout\"),\n    (\"/process-order/\", \"order\"),\n    (\"/user/profile/\", \"profile\"),\n]\ndef resolve_view(url: str) -> str:\n    for pattern, view_func in url_patterns:\n        if url == pattern:\n            return view_func\n    return \"Not Found\"\n", "entry_point": "resolve_view", "input": "'/user/profile/'", "output": "'profile'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62741_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021782", "code": "def process_form(form_data):\n    is_valid = False\n    cleaned_data = form_data.copy()\n    if 'int1' in form_data:\n        if form_data['int1'] > 0:\n            cleaned_data['int2'] = None\n            is_valid = True\n        elif form_data['int1'] < 0:\n            cleaned_data['int2'] = 0\n            is_valid = True\n    if 'int3' in form_data and form_data['int3'] is None:\n        is_valid = True\n    return is_valid, cleaned_data\n", "entry_point": "process_form", "input": "{}", "output": "(False, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51953_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021783", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[10, 6, 2, 1, 3, 5, 7]", "output": "[10, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021784", "code": "def process_list(lst, threshold):\n    processed_list = []\n    for num in lst:\n        if num >= threshold:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_list", "input": "[2, 8, 8, 8, 2, 8, 10, 8, 8], 7", "output": "[8, 64, 64, 64, 8, 64, 100, 64, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88444_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1149", "output": "{1, 3, 1149, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021786", "code": "import string\ndef password_strength_checker(password):\n    score = 0\n    # Calculate length of the password\n    score += len(password)\n    # Check for presence of both uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for presence of at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for presence of at least one special character\n    if any(char in string.punctuation for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'1aA@abcdefghijklm'", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62688_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021787", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6947", "output": "{1, 6947}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5861", "output": "{1, 5861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021789", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "12", "output": "3.5849625007211565", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021790", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5751", "output": "{1, 3, 71, 9, 81, 213, 5751, 27, 1917, 639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021791", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'ask_question', 'cancel'", "output": "'MAIN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021792", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'48656c6c6f20576f726c6421'", "output": "b'Hello World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021793", "code": "def calculate_training_time(start_time, end_time):\n    start_h, start_m, start_s = map(int, start_time.split(':'))\n    end_h, end_m, end_s = map(int, end_time.split(':'))\n    total_seconds_start = start_h * 3600 + start_m * 60 + start_s\n    total_seconds_end = end_h * 3600 + end_m * 60 + end_s\n    training_time_seconds = total_seconds_end - total_seconds_start\n    return training_time_seconds\n", "entry_point": "calculate_training_time", "input": "'00:00:00', '02:30:00'", "output": "9000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7459_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021794", "code": "from typing import List\ndef extract_dataset_providers(env_var: str) -> List[str]:\n    if not env_var:\n        return []\n    return env_var.split(',')\n", "entry_point": "extract_dataset_providers", "input": "'cirrocumrquetDt'", "output": "['cirrocumrquetDt']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18804_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021795", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[2, 3, 4, 2, 3, 2, 4, 2]", "output": "[2, 5, 9, 11, 14, 16, 20, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021796", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[5, 2, 7, 2, 2, 8]", "output": "[5, 3, 9, 5, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021797", "code": "def extract_optimization_levels(languages):\n    optimization_levels = {}\n    for lang in languages:\n        lang, opt_level = lang.split(\" = \")\n        if lang in optimization_levels:\n            optimization_levels[lang].append(int(opt_level))\n        else:\n            optimization_levels[lang] = [int(opt_level)]\n    return optimization_levels\n", "entry_point": "extract_optimization_levels", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72810_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021798", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'example.j.json'", "output": "'example.j_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021799", "code": "def html_reverse_escape(string):\n    '''Reverse escapes HTML code in string into ASCII text.'''\n    return string.replace(\"&amp;\", \"&\").replace(\"&#39;\", \"'\").replace(\"&quot;\", '\"')\n", "entry_point": "html_reverse_escape", "input": "'I&amp;aposhmp;'", "output": "'I&aposhmp;'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68510_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9358", "output": "{1, 2, 9358, 4679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9357", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021801", "code": "import math\ndef calculateDownloadCost(fileSize, downloadSpeed, costPerGB):\n    fileSizeGB = fileSize / 1024  # Convert file size from MB to GB\n    downloadTime = fileSizeGB * 8 / downloadSpeed  # Calculate download time in seconds\n    totalCost = math.ceil(fileSizeGB) * costPerGB  # Round up downloaded GB and calculate total cost\n    return totalCost\n", "entry_point": "calculateDownloadCost", "input": "3072, 1, 1.0", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44451_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021802", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "4", "output": "0.375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9627", "output": "{3, 1, 3209, 9627}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021804", "code": "def extract_text_from_paragraph_elements(paragraph_elements):\n    \"\"\"\n    Extracts text content from a list of ParagraphElement objects.\n    Args:\n        paragraph_elements: List of ParagraphElement objects\n    Returns:\n        List of text content extracted from each element\n    \"\"\"\n    extracted_text = []\n    for element in paragraph_elements:\n        text_run = element.get('textRun')\n        if text_run is None:\n            extracted_text.append('')\n        else:\n            extracted_text.append(text_run.get('content', ''))\n    return extracted_text\n", "entry_point": "extract_text_from_paragraph_elements", "input": "[{'textRun': None}] * 8", "output": "['', '', '', '', '', '', '', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35466_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021805", "code": "def merge_sorted_lists(arr1, arr2):\n    i, j = 0, 0\n    merged = []\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] < arr2[j]:\n            merged.append(arr1[i])\n            i += 1\n        else:\n            merged.append(arr2[j])\n            j += 1\n    merged.extend(arr1[i:])\n    merged.extend(arr2[j:])\n    return merged\n", "entry_point": "merge_sorted_lists", "input": "[1, 2, 3, 4, 5], [6, 8, 10, 11]", "output": "[1, 2, 3, 4, 5, 6, 8, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77340_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021806", "code": "def update_database_configurations(databases: dict, default_url: str) -> dict:\n    updated_databases = databases.copy()  # Create a copy to avoid modifying the original dictionary\n    for key, value in updated_databases.items():\n        if not value:  # Check if the value is empty or missing\n            updated_databases[key] = default_url\n    return updated_databases\n", "entry_point": "update_database_configurations", "input": "{}, 'http://default.url'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140525_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021807", "code": "from typing import List\ndef distribute_files(file_sizes: List[int], max_size: int) -> List[List[int]]:\n    folders = []\n    current_folder = []\n    current_size = 0\n    for file_size in file_sizes:\n        if current_size + file_size <= max_size:\n            current_folder.append(file_size)\n            current_size += file_size\n        else:\n            folders.append(current_folder)\n            current_folder = [file_size]\n            current_size = file_size\n    if current_folder:\n        folders.append(current_folder)\n    return folders\n", "entry_point": "distribute_files", "input": "[399, 602, 603, 396, 602, 398], 1001", "output": "[[399, 602], [603, 396], [602, 398]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22508_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021808", "code": "def filter_operations(operations, tag_to_filter):\n    filtered_operations = []\n    for operation in operations:\n        if tag_to_filter in operation.get('tags', []) and operation.get('auth', []):\n            filtered_operations.append(operation)\n    return filtered_operations\n", "entry_point": "filter_operations", "input": "[{'tags': ['tag1'], 'auth': []}, {'tags': ['tag2'], 'auth': []}], 'tag3'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25294_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021809", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'ocEemesrE', 8, 8", "output": "'8: ocEemesrE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1063", "output": "{1, 1063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021811", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import some.package.gfllorom'", "output": "'gfllorom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021812", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'lorem'", "output": "{'lorem': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021813", "code": "def calculate_balance(transactions):\n    balance = 0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'deposit':\n            balance += amount\n        elif transaction_type == 'withdrawal':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('deposit', 100), ('withdrawal', 400)]", "output": "-300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34188_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021814", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'wohehdrlod'", "output": "{'wohehdrlod': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021815", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "21, 5", "output": "'41'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021816", "code": "def calculate_video_duration(fps, total_frames):\n    total_duration = total_frames / fps\n    return round(total_duration, 2)\n", "entry_point": "calculate_video_duration", "input": "30, 938", "output": "31.27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131697_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021817", "code": "def normalize_text(text):\n    normalized_text = []\n    word = \"\"\n    for char in text:\n        if char.isalnum():\n            word += char\n        elif word:\n            normalized_text.append(word)\n            word = \"\"\n    if word:\n        normalized_text.append(word)\n    return \" \".join(normalized_text).lower()\n", "entry_point": "normalize_text", "input": "'hello worldh'", "output": "'hello worldh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35252_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021818", "code": "import re\nfrom typing import List\ndef extract_dois(text: str) -> List[str]:\n    dois_pattern = r'doi:\\d{2}\\.\\d{4}/\\w+'  # Regular expression pattern for matching DOIs\n    dois = re.findall(dois_pattern, text)\n    return dois\n", "entry_point": "extract_dois", "input": "'This paper was published with doi:10.2345/125'", "output": "['doi:10.2345/125']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75592_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021819", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'job: e'", "output": "{'job': 'e'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021820", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[1, 7, 9]", "output": "[81, 49, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021821", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "3, 3", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021822", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "10, 5", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021823", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'2..1.32'", "output": "'2..1.32'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021824", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 5, 6, 10]", "output": "5.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021825", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021826", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    # Use regular expression to extract words while ignoring non-alphanumeric characters\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'pythonworld'", "output": "{'pythonworld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115848_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021827", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5379", "output": "{1, 1793, 3, 5379, 33, 163, 489, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8285", "output": "{1, 5, 8285, 1657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9289", "output": "{9289, 1, 1327, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021830", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'1@e#l$o*1^2(3)'", "output": "'1elo123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021831", "code": "def map_material_components(material_components):\n    def map_location(location):\n        return f\"Standardized_{location}\"  # Adding a prefix to the location\n    standardized_mapping = {}\n    for component in material_components:\n        standardized_component = {\n            'name': component['name'],\n            'location': map_location(component['location']),\n            'attributes': component['attributes']\n        }\n        standardized_mapping[component['name']] = standardized_component\n    return standardized_mapping\n", "entry_point": "map_material_components", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114597_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021832", "code": "def solve(num_stairs, points):\n    dp = [0] * (num_stairs + 1)\n    dp[1] = points[1]\n    for i in range(2, num_stairs + 1):\n        dp[i] = max(points[i] + dp[i - 1], dp[i - 2] + points[i])\n    return dp[num_stairs]\n", "entry_point": "solve", "input": "5, [0, 0, 2, 5, 10, 0]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147689_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021833", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "8", "output": "['1', '2', 'Fizz', '4', 'Buzz', 'Fizz', '7', '8']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021834", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7601", "output": "{11, 1, 7601, 691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021835", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021836", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3699", "output": "{1, 3, 27, 9, 137, 1233, 3699, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2451", "output": "{1, 129, 3, 43, 817, 2451, 19, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021838", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[29, 28, 27]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021839", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[3, 3, 10, 9, 9, 9, 3, 3], 4", "output": "[[3, 3, 10, 9], [9, 9, 3, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021840", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'abcdef', 'abcdef'", "output": "(0, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021841", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'scrapete'", "output": "['scrapete']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021842", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'hello world ovorovr'", "output": "['ovorovr']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021843", "code": "def search_images(images, search_term):\n    filtered_images = []\n    for image in images:\n        if image[\"category\"] == search_term:\n            filtered_images.append(image)\n    return filtered_images\n", "entry_point": "search_images", "input": "[], 'cats'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136714_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021844", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4531", "output": "{1, 4531, 197, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021845", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'aternal/xyz'", "output": "'aternal/xyz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021846", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6134", "output": "{1, 2, 3067, 6134}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6133", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021847", "code": "def max_non_adjacent_score(scores):\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 0, 15, 0, 8, 0]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26474_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021848", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[1, 12, 2, 2, 3, 3]", "output": "(1, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021849", "code": "def categorize_weights(weights):\n    category_dict = {1: [], 2: [], 3: [], 4: []}\n    for weight in weights:\n        if weight <= 10:\n            category_dict[1].append(weight)\n        elif weight <= 20:\n            category_dict[2].append(weight)\n        elif weight <= 30:\n            category_dict[3].append(weight)\n        else:\n            category_dict[4].append(weight)\n    return category_dict\n", "entry_point": "categorize_weights", "input": "[5, 15, 25, 35]", "output": "{1: [5], 2: [15], 3: [25], 4: [35]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1655_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "564", "output": "{1, 2, 3, 4, 6, 12, 141, 47, 564, 282, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt563", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021851", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[2, 2]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021852", "code": "def validate_keys(dictionary):\n    keys_to_validate = ['created', 'lastImportDate', 'lastChangeDate', 'rowsCount', 'metadata', 'bucket', 'columnMetadata']\n    for key in keys_to_validate:\n        if key not in dictionary:\n            return False\n    return True\n", "entry_point": "validate_keys", "input": "{'created': '2023-01-01', 'rowsCount': 10}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114320_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021853", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(3, 6, 7, -1, 0, 1, 7)", "output": "'3.6.7.-1.0.1.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021854", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'cop_code: 91c'", "output": "{'cop_code': '91c'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021855", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "14, 5", "output": "2002.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021856", "code": "from typing import Dict\nunits: Dict[str, int] = {\n    \"cryptodoge\": 10 ** 6,\n    \"mojo\": 1,\n    \"colouredcoin\": 10 ** 3,\n}\ndef convert_mojos_to_unit(amount: int, target_unit: str) -> float:\n    if target_unit in units:\n        conversion_factor = units[target_unit]\n        converted_amount = amount / conversion_factor\n        return converted_amount\n    else:\n        return f\"Conversion to {target_unit} is not supported.\"\n", "entry_point": "convert_mojos_to_unit", "input": "10, 'cccccc'", "output": "'Conversion to cccccc is not supported.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24392_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021857", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "5", "output": "'SetSettings'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021858", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'distributedding:'", "output": "{'distributedding': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021859", "code": "def count_model_name_lengths(models):\n    name_length_count = {}\n    for model in models:\n        if model.isalpha():  # Check if the model name contains only alphabetic characters\n            name_length = len(model)\n            name_length_count[name_length] = name_length_count.get(name_length, 0) + 1\n    return name_length_count\n", "entry_point": "count_model_name_lengths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107432_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021860", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[3, 4, 5, 6, 7]", "output": "('Rel Days 3 to 7', 'reldays3_7')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021861", "code": "def maximum_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product_of_three", "input": "[-2, -2, 20]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93080_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021862", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[3]]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021863", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'10.10.10'", "output": "(10, 10, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021864", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[5, 5, 7, 1, -1, 6, 2, 2]", "output": "[5, 7, 1, -1, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021865", "code": "def calculate_project_cost(base_cost: float, cost_per_line: float, lines_of_code: int) -> float:\n    total_cost = base_cost + (lines_of_code * cost_per_line)\n    return total_cost\n", "entry_point": "calculate_project_cost", "input": "-2101.250599999999, -10, 200", "output": "-4101.250599999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125885_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021866", "code": "def find_missing(S):\n    full_set = set(range(10))\n    sum_S = sum(S)\n    sum_full_set = sum(full_set)\n    return sum_full_set - sum_S\n", "entry_point": "find_missing", "input": "[-119]", "output": "164", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109203_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021867", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[10, 23, 31, 33, 34, 63]", "output": "[10, 23, 31, 33, 34, 63]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021868", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "5, 2", "output": "[0, 1, 4, 11, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021869", "code": "def extract_unique_tags(html_content):\n    unique_tags = set()\n    tag = ''\n    inside_tag = False\n    for char in html_content:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n            tag = tag.strip()\n            if tag:\n                unique_tags.add(tag)\n            tag = ''\n        elif inside_tag:\n            if char.isalnum():\n                tag += char\n    return sorted(list(unique_tags))\n", "entry_point": "extract_unique_tags", "input": "'<p>This is a paragraph.</p>'", "output": "['p']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126025_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021870", "code": "def extract_package_info(package_metadata):\n    package_name = package_metadata.get('name', '')\n    package_version = package_metadata.get('version', '')\n    package_author = package_metadata.get('author', '')\n    dependencies = package_metadata.get('install_requires', [])\n    return package_name, package_version, package_author, dependencies\n", "entry_point": "extract_package_info", "input": "{}", "output": "('', '', '', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145989_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021871", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9194", "output": "{1, 9194, 2, 4597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9193", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2711", "output": "{1, 2711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2710", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021873", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'hthis'", "output": "['hthis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021874", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'abcd'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021875", "code": "def modify_template_name(template_name: str) -> str:\n    # Trim leading and trailing whitespace, convert to lowercase, and return\n    return template_name.strip().lower()\n", "entry_point": "modify_template_name", "input": "'  mytemmetmplateme   '", "output": "'mytemmetmplateme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116239_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021876", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9291", "output": "{1, 3, 163, 489, 9291, 19, 3097, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021878", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "11", "output": "0.45454545454545453", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021879", "code": "from typing import List\nDIGIT_TO_CHAR = {\n    '0': ['0'],\n    '1': ['1'],\n    '2': ['a', 'b', 'c'],\n    '3': ['d', 'e', 'f'],\n    '4': ['g', 'h', 'i'],\n    '5': ['j', 'k', 'l'],\n    '6': ['m', 'n', 'o'],\n    '7': ['p', 'q', 'r', 's'],\n    '8': ['t', 'u', 'v'],\n    '9': ['w', 'x', 'y', 'z']\n}\nDEFAULT_NUMBER_OF_RESULTS = 7\nMAX_LENGTH_OF_NUMBER = 16\nMAX_COST = 150\ndef generate_combinations(input_number: str) -> List[str]:\n    results = []\n    def generate_combinations_recursive(current_combination: str, remaining_digits: str):\n        if not remaining_digits:\n            results.append(current_combination)\n            return\n        for char in DIGIT_TO_CHAR[remaining_digits[0]]:\n            new_combination = current_combination + char\n            new_remaining = remaining_digits[1:]\n            generate_combinations_recursive(new_combination, new_remaining)\n    generate_combinations_recursive('', input_number)\n    return results[:DEFAULT_NUMBER_OF_RESULTS]\n", "entry_point": "generate_combinations", "input": "'222'", "output": "['aaa', 'aab', 'aac', 'aba', 'abb', 'abc', 'aca']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133151_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021880", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'Abc123!'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021881", "code": "def next_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "next_semantic_version", "input": "'2.9.9'", "output": "'3.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143821_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021882", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    for i in range(1, len(buildings) - 1):\n        total_area += min(buildings[i], buildings[i+1])\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[0, 1, 1, 0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58935_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021883", "code": "def bijective_dict(src):\n    ret = {}\n    for key, val in src.items():\n        if key in ret or val in ret:\n            return {}  # Input dictionary is not bijective\n        ret[key] = val\n        ret[val] = key\n    return ret\n", "entry_point": "bijective_dict", "input": "{1: 2, 2: 1}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122243_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021884", "code": "def max_non_adjacent_throughput(lst):\n    include = 0\n    exclude = 0\n    for num in lst:\n        new_include = max(num + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_throughput", "input": "[10, 5, 12, 5, 10]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74486_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021885", "code": "from typing import List\ndef count_pairs_sum_target(nums: List[int], target: int) -> int:\n    num_freq = {}\n    pair_count = 0\n    for num in nums:\n        complement = target - num\n        if complement in num_freq:\n            pair_count += num_freq[complement]\n        num_freq[num] = num_freq.get(num, 0) + 1\n    return pair_count\n", "entry_point": "count_pairs_sum_target", "input": "[1, 5, 2, 4, 3, 3], 6", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134075_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021886", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "3, 4", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021887", "code": "import string\ndef password_strength_checker(password):\n    score = 0\n    # Calculate length of the password\n    score += len(password)\n    # Check for presence of both uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for presence of at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for presence of at least one special character\n    if any(char in string.punctuation for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'Aa1!bcdE'", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62688_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021888", "code": "def transform_list(nums, transform):\n    transformed_list = []\n    for num in nums:\n        if transform == 'double':\n            transformed_list.append(num * 2)\n        elif transform == 'square':\n            transformed_list.append(num ** 2)\n        elif transform == 'add_one':\n            transformed_list.append(num + 1)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 2, 3, 4, 5], 'double'", "output": "[2, 4, 6, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45340_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021889", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[0, -1, 5, 4, 3, -1, 5, 2, 3]", "output": "[0, -1, 4, 8, 11, 10, 15, 17, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021890", "code": "def encrypt_string(input_string):\n    encrypted_result = \"\"\n    for i, char in enumerate(input_string):\n        if char.isalpha():\n            shift_amount = i + 1\n            if char.islower():\n                encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n            else:\n                encrypted_char = chr((ord(char) - ord('A') + shift_amount) % 26 + ord('A'))\n        else:\n            encrypted_char = char\n        encrypted_result += encrypted_char\n    return encrypted_result\n", "entry_point": "encrypt_string", "input": "'Hello, World!'", "output": "'Igopt, Exbwp!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110857_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021891", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'rDBEEF'", "output": "'DBEEF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021892", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[4, 8]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143850_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021893", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "6", "output": "'Data-Invalid'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3992", "output": "{1, 2, 4, 998, 8, 1996, 499, 3992}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3991", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021895", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'132:3'", "output": "(306, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021896", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'B', 'B', 'C'], 5", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021897", "code": "def largest_prime_factor(number):\n    factor = 2\n    while factor ** 2 <= number:\n        if number % factor == 0:\n            number //= factor\n        else:\n            factor += 1\n    return max(factor, number)\n", "entry_point": "largest_prime_factor", "input": "22", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80074_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021898", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 4, 5, 1, -1, 3, 0, 2, -1]", "output": "[8, 9, 6, 0, 2, 3, 2, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021899", "code": "def count_unique_words(strings):\n    unique_word_counts = {}\n    for string in strings:\n        words = string.split()\n        unique_words = set(word.lower() for word in words)\n        unique_word_counts[string] = len(unique_words)\n    return unique_word_counts\n", "entry_point": "count_unique_words", "input": "['Wordrl!', 'Wodrl!']", "output": "{'Wordrl!': 1, 'Wodrl!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144864_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021900", "code": "from typing import List\ndef is_gray_code_sequence(nums: List[int]) -> bool:\n    is_gray_code = True\n    for i in range(1, len(nums)):\n        xor_result = nums[i-1] ^ nums[i]\n        if xor_result & (xor_result - 1) != 0:\n            is_gray_code = False\n            break\n    return is_gray_code\n", "entry_point": "is_gray_code_sequence", "input": "[0, 1]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126372_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021901", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'02:30:15'", "output": "9015", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021902", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'million1112'", "output": "{'million1112': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021903", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'helloh'", "output": "'helloh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021904", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kirjakauppa.fi/124'", "output": "'http://kirjakauppa.fi/124'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5303", "output": "{1, 5303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021906", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    camel_case = words[0] + ''.join(word.capitalize() for word in words[1:])\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'hes_is_a'", "output": "'hesIsA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46573_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021907", "code": "def count_unique_dataflows(dataflows):\n    unique_dataflows_count = {}\n    for dataflow_id, category in dataflows:\n        if category in unique_dataflows_count:\n            unique_dataflows_count[category] += 1\n        else:\n            unique_dataflows_count[category] = 1\n    return unique_dataflows_count\n", "entry_point": "count_unique_dataflows", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17683_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021908", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2773", "output": "{1, 59, 2773, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021909", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[-10, 3, 6, 240]", "output": "-43200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021910", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[3, 2, 5, 1, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021911", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'tethtisxt'", "output": "{'tethtisxt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021912", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[0, 1, 1, 1, 1, 0]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021913", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[10, 19, 5, 3], 10", "output": "[29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021914", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8115", "output": "{1, 3, 5, 15, 2705, 8115, 1623, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021915", "code": "def custom_split(data, delimiters):\n    result = []\n    current_substring = \"\"\n    for char in data:\n        if char in delimiters:\n            if current_substring:\n                result.append(current_substring)\n                current_substring = \"\"\n        else:\n            current_substring += char\n    if current_substring:\n        result.append(current_substring)\n    return result\n", "entry_point": "custom_split", "input": "'apple,banrange', ','", "output": "['apple', 'banrange']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10049_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021916", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8481", "output": "{1, 8481, 3, 771, 33, 257, 2827, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021917", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8669", "output": "{1, 8669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021918", "code": "def find_most_frequent_objects(detections):\n    frequency_dict = {}\n    # Count the frequency of each object\n    for obj in detections:\n        frequency_dict[obj] = frequency_dict.get(obj, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    most_frequent_objects = [obj for obj, freq in frequency_dict.items() if freq == max_frequency]\n    return most_frequent_objects\n", "entry_point": "find_most_frequent_objects", "input": "[3, 3, 3, 1, 2]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33140_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021919", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8146", "output": "{1, 8146, 2, 4073}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021920", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "7", "output": "'13112221'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021921", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaaabbbrrr'", "output": "{'a': 4, 'b': 3, 'r': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021922", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[9, 10, 20, 30, 56]", "output": "(56, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021923", "code": "def split_list(x, n):\n    x = list(x)\n    if n < 2:\n        return [x]\n    def gen():\n        m = len(x) / n\n        i = 0\n        for _ in range(n-1):\n            yield x[int(i):int(i + m)]\n            i += m\n        yield x[int(i):]\n    return list(gen())\n", "entry_point": "split_list", "input": "[6, 3, 3, 10, 1, 0, 3], 4", "output": "[[6], [3, 3], [10, 1], [0, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38553_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021924", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[5, 6, 7, 4, 1]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021925", "code": "from typing import List\nDIGIT_TO_CHAR = {\n    '0': ['0'],\n    '1': ['1'],\n    '2': ['a', 'b', 'c'],\n    '3': ['d', 'e', 'f'],\n    '4': ['g', 'h', 'i'],\n    '5': ['j', 'k', 'l'],\n    '6': ['m', 'n', 'o'],\n    '7': ['p', 'q', 'r', 's'],\n    '8': ['t', 'u', 'v'],\n    '9': ['w', 'x', 'y', 'z']\n}\nDEFAULT_NUMBER_OF_RESULTS = 7\nMAX_LENGTH_OF_NUMBER = 16\nMAX_COST = 150\ndef generate_combinations(input_number: str) -> List[str]:\n    results = []\n    def generate_combinations_recursive(current_combination: str, remaining_digits: str):\n        if not remaining_digits:\n            results.append(current_combination)\n            return\n        for char in DIGIT_TO_CHAR[remaining_digits[0]]:\n            new_combination = current_combination + char\n            new_remaining = remaining_digits[1:]\n            generate_combinations_recursive(new_combination, new_remaining)\n    generate_combinations_recursive('', input_number)\n    return results[:DEFAULT_NUMBER_OF_RESULTS]\n", "entry_point": "generate_combinations", "input": "'2'", "output": "['a', 'b', 'c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133151_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021926", "code": "import importlib\ndef check_package_imports(package_names):\n    import_status = {}\n    for package in package_names:\n        try:\n            importlib.import_module(package)\n            import_status[package] = True\n        except ImportError:\n            import_status[package] = False\n    return import_status\n", "entry_point": "check_package_imports", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70913_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021927", "code": "def generate_matrix(n):\n    matriz = [[0 for _ in range(n)] for _ in range(n)]\n    for diagonal_principal in range(n):\n        matriz[diagonal_principal][diagonal_principal] = 2\n    for diagonal_secundaria in range(n):\n        matriz[diagonal_secundaria][n - 1 - diagonal_secundaria] = 3\n    for linha in range(n // 3, n - n // 3):\n        for coluna in range(n // 3, n - n // 3):\n            matriz[linha][coluna] = 1\n    return matriz\n", "entry_point": "generate_matrix", "input": "3", "output": "[[2, 0, 3], [0, 1, 0], [3, 0, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23096_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021928", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'hehd'", "output": "{'hehd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021929", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'visualic'", "output": "\"Operation type 'visualic' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021930", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'1121:223'", "output": "(4385, 547)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021931", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "415", "output": "{1, 83, 5, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021932", "code": "import uuid\ndef generate_product_uuid(existing_uuid):\n    # Convert the existing UUID to uppercase\n    existing_uuid_upper = existing_uuid.upper()\n    # Add the prefix 'PROD_' to the uppercase UUID\n    modified_uuid = 'PROD_' + existing_uuid_upper\n    return modified_uuid\n", "entry_point": "generate_product_uuid", "input": "'550e8400-e2d8'", "output": "'PROD_550E8400-E2D8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91223_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021933", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3670", "output": "{1, 2, 5, 10, 1835, 367, 3670, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3669", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021934", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 88, 92, 89]", "output": "89.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49545_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021935", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'abc, def, ghi -> jk'", "output": "(['abc', 'def', 'ghi'], 'jk')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3983", "output": "{1, 7, 569, 3983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021937", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'TTESTNE=TEGG'", "output": "{'TTESTNE': 'TEGG'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021938", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_kb = 0\n    for size in file_sizes:\n        total_size_kb += size / 1024  # Convert bytes to kilobytes\n    return int(total_size_kb)  # Return the total size in kilobytes as an integer\n", "entry_point": "calculate_total_size", "input": "[16384]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87932_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021939", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8353", "output": "{1, 8353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021940", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 3, 2, 1, 4, 3, 4, 4]", "output": "[7, 7, 5, 3, 5, 7, 7, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021941", "code": "def parse_vine_embed(tag_string: str) -> dict:\n    result = {}\n    if 'class=\"vine-embed\"' in tag_string:\n        src_start = tag_string.find('src=\"') + 5\n        src_end = tag_string.find('\"', src_start)\n        src = tag_string[src_start:src_end]\n        vine_id = src.split('/')[-1]\n        embed_type = src.split('/')[-2]\n        result[\"type\"] = \"reference\"\n        result[\"referent\"] = {\n            \"id\": src,\n            \"type\": \"vine\",\n            \"provider\": \"VineEmbedParser.provider\"\n        }\n    return result\n", "entry_point": "parse_vine_embed", "input": "'This is just a random string.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88334_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021942", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "10", "output": "[0, 1, 1, 1, 2, 3, 6, 9, 15, 135]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021943", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7726", "output": "{1, 2, 7726, 3863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021944", "code": "def count_invalid_parenthesis(string):\n    count = 0\n    for char in string:\n        if char == \"(\" or char == \"[\" or char == \"{\":\n            count += 1\n        elif char == \")\" or char == \"]\" or char == \"}\":\n            count -= 1\n    return abs(count)\n", "entry_point": "count_invalid_parenthesis", "input": "')'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83794_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021945", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[85, 90, 95, 100, 95]", "output": "93.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22350_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021946", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'job: EnggiAncNes'", "output": "{'job': 'EnggiAncNes'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021947", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "13, 4", "output": "715", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt451", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021948", "code": "def extract_variables(script):\n    variables = {}\n    for line in script.splitlines():\n        line = line.strip()\n        if line and \"=\" in line:\n            parts = line.split(\"=\")\n            variable_name = parts[0].strip()\n            variable_value = \"=\".join(parts[1:]).strip()\n            variables[variable_name] = variable_value\n    return variables\n", "entry_point": "extract_variables", "input": "'= '", "output": "{'': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38111_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021949", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "\"I&#39;I'm\"", "output": "\"I'I'm\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021950", "code": "from typing import Dict, List, Tuple\nEntryPointMap = Dict[str, Dict[str, str]]\ndef filter_entry_points(entry_points_map: EntryPointMap, group: str, name_length: int) -> List[Tuple[str, str]]:\n    filtered_entry_points = []\n    if group in entry_points_map:\n        for name, _ in entry_points_map[group].items():\n            if len(name) < name_length:\n                filtered_entry_points.append((group, name))\n    return filtered_entry_points\n", "entry_point": "filter_entry_points", "input": "{}, 'non_existing_group', 3", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97620_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8914", "output": "{4457, 1, 8914, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8913", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021952", "code": "def traverse_pre_order(node):\n    if not node:\n        return []\n    result = [node['value']]\n    if node['left']:\n        result += traverse_pre_order(node['left'])\n    if node['right']:\n        result += traverse_pre_order(node['right'])\n    return result\n", "entry_point": "traverse_pre_order", "input": "None", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49189_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021953", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[5, 4, 0, 6, 4, 3, 5, 6]", "output": "[6, 5, 1, 7, 5, 4, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021954", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/User/Docum/xam'", "output": "('C:/User/Docum', 'xam')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021955", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "['R', 'R', 'R'], 4, 4", "output": "(3, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021956", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num + 10)\n        elif num % 2 != 0:\n            modified_list.append(num - 5)\n        if num % 5 == 0:\n            modified_list[-1] *= 2  # Double the last added element\n    return modified_list\n", "entry_point": "process_integers", "input": "[-14, -14, 6, 3, -8, 1]", "output": "[-4, -4, 16, -2, 2, -4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30819_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021957", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 2, 2, 3, 2, 4]", "output": "[2, 4, 5, 5, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021958", "code": "def sum_multiples_of_3_not_5(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_not_5", "input": "[3, 9, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108735_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021959", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'hello'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "676", "output": "{1, 2, 4, 676, 169, 13, 338, 52, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt675", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021961", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "21", "output": "'ANDROID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021962", "code": "def count_marker_styles(markers):\n    marker_counts = {}\n    for marker in markers:\n        if marker in marker_counts:\n            marker_counts[marker] += 1\n        else:\n            marker_counts[marker] = 1\n    return marker_counts\n", "entry_point": "count_marker_styles", "input": "['sss', 'sss', 'D']", "output": "{'sss': 2, 'D': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148986_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021963", "code": "def generate_env_report(env_data):\n    report_lines = []\n    for env, data in env_data.items():\n        os = data.get('os', 'N/A')\n        python_version = data.get('python_version', 'N/A')\n        packages = ', '.join(data.get('packages', []))\n        report_lines.append(f\"Environment: {env}\\nOS: {os}\\nPython Version: {python_version}\\nPackages: {packages}\\n\")\n    return '\\n'.join(report_lines)\n", "entry_point": "generate_env_report", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140556_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2097", "output": "{1, 3, 9, 233, 2097, 699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021965", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[10, 12, 14]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021966", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4954", "output": "{1, 4954, 2, 2477}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4953", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4549", "output": "{1, 4549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021968", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -12.569399999999995, -10", "output": "-22.569399999999995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021969", "code": "from typing import List\ndef sum_of_reoccurring_data_points(data: List[int]) -> int:\n    frequency_map = {}\n    # Count the frequency of each data point\n    for num in data:\n        frequency_map[num] = frequency_map.get(num, 0) + 1\n    # Sum up the reoccurring data points\n    total_sum = sum(num for num, freq in frequency_map.items() if freq > 1)\n    return total_sum\n", "entry_point": "sum_of_reoccurring_data_points", "input": "[1, 1, 2, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146140_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021970", "code": "def process_reaction_tokens(tokens):\n    reaction_info = {}\n    for line in tokens.split('\\n'):\n        if line.startswith('[NAME:'):\n            reaction_info['name'] = line.split('[NAME:')[1][:-1]\n        elif line.startswith('[REAGENT:'):\n            reagent_info = line.split(':')\n            reaction_info.setdefault('reagents', []).append(reagent_info[4])\n        elif line.startswith('[PRODUCT:'):\n            product_info = line.split(':')\n            reaction_info['product'] = product_info[5]\n        elif line == '[SMELTER]':\n            reaction_info['facility'] = 'SMELTER'\n        elif line == '[FUEL]':\n            reaction_info['fuel_required'] = True\n    return reaction_info\n", "entry_point": "process_reaction_tokens", "input": "'[NAME:sme]'", "output": "{'name': 'sme'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125354_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021971", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1377", "output": "{1, 1377, 3, 9, 459, 17, 81, 51, 153, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021972", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9787", "output": "{1, 9787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7373", "output": "{73, 1, 101, 7373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021974", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[7, 2, 3, 6, 5, 2, 7, 6]", "output": "[14, 21, 42, 35, 14, 49, 42, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1595", "output": "{1, 5, 11, 145, 55, 1595, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1594", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021976", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-5, 5", "output": "-3125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt57", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021977", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "3, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021978", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "'token', 8, [1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021979", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9677", "output": "{1, 9677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021980", "code": "from typing import List\ndef are_permutations(list_1: List[int], list_2: List[int]) -> bool:\n    if len(list_1) != len(list_2):\n        return False\n    freq_dict = {}\n    for num in list_1:\n        freq_dict[num] = freq_dict.get(num, 0) + 1\n    for num in list_2:\n        if num not in freq_dict or freq_dict[num] == 0:\n            return False\n        freq_dict[num] -= 1\n    return True\n", "entry_point": "are_permutations", "input": "[1, 2], [1]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112294_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "184", "output": "{1, 2, 4, 8, 46, 23, 184, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt183", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021982", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97914_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021983", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[11, 13, 23, 13, 11, 13, 25, 24, 13]", "output": "[11, 11, 13, 13, 13, 13, 23, 24, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021984", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{1, 2}, {3}", "output": "{1, 2, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021985", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9967", "output": "{1, 9967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021986", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[7, 8, 8]", "output": "7.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2694", "output": "{1, 2, 3, 1347, 898, 2694, 6, 449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2693", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021988", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaaaaabbbbrrrcc'", "output": "{'a': 6, 'b': 4, 'r': 3, 'c': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021989", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "42.0, 0.0", "output": "42.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021990", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 2, 3, 4, 1, 4, 0, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89225_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021991", "code": "def trap_rainwater(buildings):\n    n = len(buildings)\n    if n <= 2:\n        return 0\n    left_max = [0] * n\n    right_max = [0] * n\n    left_max[0] = buildings[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], buildings[i])\n    right_max[n - 1] = buildings[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], buildings[i])\n    total_rainwater = 0\n    for i in range(1, n - 1):\n        total_rainwater += max(0, min(left_max[i], right_max[i]) - buildings[i])\n    return total_rainwater\n", "entry_point": "trap_rainwater", "input": "[4, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33165_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021992", "code": "def process_mesh_files(sfm_fp, mesh_fp, image_dp):\n    log_messages = []\n    if mesh_fp is not None:\n        log_messages.append(\"Found the following mesh file: \" + mesh_fp)\n    else:\n        log_messages.append(\"Request target mesh does not exist in this project.\")\n    return log_messages\n", "entry_point": "process_mesh_files", "input": "None, 'hhpat/mte', None", "output": "['Found the following mesh file: hhpat/mte']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140821_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021993", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-200, -150, -155], 3", "output": "-168.33333333333334", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132005_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021994", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5477", "output": "{1, 5477}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5476", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021995", "code": "def extract_version_numbers(version_str):\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    revision = int(version_components[2].split('.')[0])  # Extract only the numeric part\n    return major, minor, revision\n", "entry_point": "extract_version_numbers", "input": "'4.4.0'", "output": "(4, 4, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110593_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021996", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[25, 27, 29, 30, 31]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021997", "code": "def extract_unique_tags(html_content):\n    unique_tags = set()\n    tag = ''\n    inside_tag = False\n    for char in html_content:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n            tag = tag.strip()\n            if tag:\n                unique_tags.add(tag)\n            tag = ''\n        elif inside_tag:\n            if char.isalnum():\n                tag += char\n    return sorted(list(unique_tags))\n", "entry_point": "extract_unique_tags", "input": "'<aghl>'", "output": "['aghl']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126025_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021998", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'2.52abc'", "output": "(2, 52)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0021999", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[3, 3, 2, 3, 2, 3, 3, 3]", "output": "[6, 5, 5, 5, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022000", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "118", "output": "{1, 2, 59, 118}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022001", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'1.4.0', '1.5.0'", "output": "'1.4.0 to 1.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022002", "code": "def calculate_trainable_params(total_params, non_trainable_params):\n    trainable_params = total_params - non_trainable_params\n    return trainable_params\n", "entry_point": "calculate_trainable_params", "input": "24768889, 1000", "output": "24767889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112905_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022003", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[80, 88, 88, 88]", "output": "88.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022004", "code": "_escapes = [('a', '1'), ('b', '2'), ('c', '3')]  # Example escape rules\ndef escape_string(input_string):\n    for a, b in _escapes:\n        input_string = input_string.replace(a, b)\n    return input_string\n", "entry_point": "escape_string", "input": "'aaaaaaaaaa'", "output": "'1111111111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9621_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022005", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1011010X'", "output": "['10110100', '10110101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022006", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'*Title*'", "output": "('', 'Title')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022007", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9026", "output": "{1, 9026, 2, 4513}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022008", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5093", "output": "{1, 11, 5093, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5092", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022009", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[4, 3, 2]", "output": "[16, 9, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022010", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 1, 2, 2]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89225_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022011", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[6, 3, 3, 2, 2, 2, 2, 2]", "output": "[6, 3, 3, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022012", "code": "def detect_feature_points(points):\n    unique_points = set(points)\n    return len(unique_points)\n", "entry_point": "detect_feature_points", "input": "[(1, 2), (3, 4), (5, 6), (7, 8)]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102871_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022013", "code": "from typing import List, Optional\ndef find_second_largest(arr: List[int]) -> Optional[int]:\n    largest = second_largest = float('-inf')\n    for num in arr:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num != largest and num > second_largest:\n            second_largest = num\n    return second_largest if second_largest != float('-inf') else None\n", "entry_point": "find_second_largest", "input": "[40, 41, 40, 35]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116746_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022014", "code": "def extract_app_name(default_app_config):\n    # Split the input string using dot as the delimiter\n    config_parts = default_app_config.split('.')\n    # Extract the app name from the first part\n    app_name = config_parts[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'django_migratiotilsConfig.apps.AppConfig'", "output": "'django_migratiotilsConfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64209_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022015", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['420000000', '+', '312253']", "output": "420312253", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022016", "code": "def check_ending(data):\n    # Define your logic here to check if the data signifies the end of the transmission\n    # For demonstration purposes, let's assume the end sequence is a single byte with value 255\n    end_sequence = 255\n    return data == end_sequence\n", "entry_point": "check_ending", "input": "255", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120387_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022017", "code": "def get_positions(arr, mask):\n    return [i for i, (token, istoken) in enumerate(zip(arr, mask)) if istoken]\n", "entry_point": "get_positions", "input": "['A', 'B', 'C'], [False, True, False]", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131757_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022018", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cad', 'aaddcc'", "output": "'ccaadd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022019", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6393", "output": "{1, 2131, 3, 6393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022020", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "5, 1", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8391", "output": "{1, 3, 2797, 8391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8390", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022022", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0.26, -2, 0", "output": "-1.48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022023", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['20 + 30', '10 - 16']", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022024", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'H12'", "output": "179", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022025", "code": "def sort_nodes_by_name(nodes):\n    sorted_nodes = sorted(nodes, key=lambda x: x['node'])  # Sort nodes based on 'node' key\n    sorted_tuples = [(node['node'], node['score']) for node in sorted_nodes]  # Create list of tuples\n    return sorted_tuples\n", "entry_point": "sort_nodes_by_name", "input": "[{'node': 'X', 'score': 0.2}]", "output": "[('X', 0.2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107968_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022026", "code": "def remove_vowels(string):\n    result = ''\n    for char in string:\n        if char not in 'aeiouAEIOU':\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'WarlW!!'", "output": "'WrlW!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87966_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022027", "code": "def process_markup(text: str) -> str:\n    formatted_text = \"\"\n    stack = []\n    current_text = \"\"\n    for char in text:\n        if char == '[':\n            if current_text:\n                formatted_text += current_text\n                current_text = \"\"\n            stack.append(char)\n        elif char == ']':\n            tag = \"\".join(stack)\n            stack = []\n            if tag == \"[b]\":\n                current_text = f\"<b>{current_text}</b>\"\n            elif tag == \"[r]\":\n                current_text = f\"<span style='color:red'>{current_text}</span>\"\n            elif tag == \"[u]\":\n                current_text = f\"<u>{current_text}</u>\"\n        else:\n            current_text += char\n    formatted_text += current_text\n    return formatted_text\n", "entry_point": "process_markup", "input": "'[r]Wold[/r]'", "output": "'rWold/r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63510_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022028", "code": "def findTwoNumbers(array, targetSum):\n    seen_numbers = set()\n    for num in array:\n        potential_match = targetSum - num\n        if potential_match in seen_numbers:\n            return [potential_match, num]\n        seen_numbers.add(num)\n    return []\n", "entry_point": "findTwoNumbers", "input": "[6, 6], 12", "output": "[6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115301_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022029", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'SomePrefix SomSKFSKFSK', 'SomePrefix '", "output": "'SomSKFSKFSK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022030", "code": "def count_unique_divisible_numbers(numbers, divisor):\n    unique_divisible_numbers = set()\n    for num in numbers:\n        if num % divisor == 0:\n            unique_divisible_numbers.add(num)\n    return len(unique_divisible_numbers)\n", "entry_point": "count_unique_divisible_numbers", "input": "[2, 4, 6, 8, 10], 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61726_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022031", "code": "def cost(B):\n    n = len(B)\n    dp = [[0, 0] for _ in range(n)]\n    dp[0][1] = B[0]\n    for i in range(1, n):\n        dp[i][0] = max(dp[i-1][0], dp[i-1][1])\n        dp[i][1] = B[i] + dp[i-1][0]\n    return min(dp[-1][0], dp[-1][1])\n", "entry_point": "cost", "input": "[10, 0, 1]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37166_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022032", "code": "def decrypt(hex_to_uni, key):\n    decryp_text = \"\"\n    iteration = 0\n    for i in range(len(hex_to_uni)):\n        temp = ord(hex_to_uni[i]) ^ ord(key[iteration])\n        decryp_text += chr(temp)\n        iteration = (iteration + 1) % len(key)\n    return decryp_text\n", "entry_point": "decrypt", "input": "'<', 'A'", "output": "'}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_709_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022033", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[100, 100, 91, 91, 85, 80]", "output": "[100, 91, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4731", "output": "{1, 3, 1577, 19, 83, 249, 4731, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022035", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'3.722.5'", "output": "(3, 722, 5, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022036", "code": "from typing import List\ndef remove_vendor(vendor_name: str, vendor_list: List[str]) -> bool:\n    if vendor_name in vendor_list:\n        vendor_list.remove(vendor_name)\n        return True\n    return False\n", "entry_point": "remove_vendor", "input": "'VendorA', ['VendorA', 'VendorB', 'VendorC']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14983_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022037", "code": "def remove_none_values(d):\n    for key, value in list(d.items()):\n        if value is None:\n            del d[key]\n        elif isinstance(value, dict):\n            remove_none_values(value)\n    # Remove empty nested dictionaries\n    for key in list(d.keys()):\n        if isinstance(d[key], dict) and not d[key]:\n            del d[key]\n    return d\n", "entry_point": "remove_none_values", "input": "{'a': 1, 'aa': 2, 'b': None, 'nested': {'c': None}}", "output": "{'a': 1, 'aa': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76751_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022038", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'Hol\u00e0'", "output": "'Hol\u00e0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4587", "output": "{1, 417, 3, 33, 4587, 11, 139, 1529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022040", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[0, 2, 3, 3, 1, 4, 1, 4]", "output": "[2, 5, 6, 4, 5, 5, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022041", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "2, [2, 1, 3, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022042", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1585", "output": "{1, 317, 5, 1585}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022043", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[8, 4, 4, 2, 2, 0, 1, 7, 7]", "output": "[8, 4, 4, 2, 2, 0, 1, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022044", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'rclusur', 'any_id'", "output": "\"Provider submodule 'rclusur' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022045", "code": "def parse_verbosity(vargs):\n    verbosity_levels = {\n        'quiet': 0,\n        'normal': 1,\n        'verbose': 2,\n        'debug': 3\n    }\n    return verbosity_levels.get(vargs, 0)\n", "entry_point": "parse_verbosity", "input": "'normal'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71548_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022046", "code": "def parse_ini_string(ini_string: str) -> dict:\n    settings = {}\n    for line in ini_string.split('\\n'):\n        line = line.strip()\n        if not line or line.startswith('#'):\n            continue\n        key_value = line.split('=')\n        if len(key_value) == 2:\n            key = key_value[0].strip()\n            value = key_value[1].strip()\n            settings[key] = value\n    return settings\n", "entry_point": "parse_ini_string", "input": "'# Comment line\\n--delay = 0\\n'", "output": "{'--delay': '0'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86619_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022047", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5455", "output": "{1, 1091, 5, 5455}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022048", "code": "def compress_text(text: str) -> str:\n    if not text:\n        return \"\"\n    compressed_text = \"\"\n    current_char = text[0]\n    char_count = 1\n    for i in range(1, len(text)):\n        if text[i] == current_char:\n            char_count += 1\n        else:\n            compressed_text += current_char + str(char_count)\n            current_char = text[i]\n            char_count = 1\n    compressed_text += current_char + str(char_count)\n    return compressed_text\n", "entry_point": "compress_text", "input": "'helloabcc'", "output": "'h1e1l2o1a1b1c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148970_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022049", "code": "def calculate_min_payment(balance, annualInterestRate):\n    totalMonths = 12\n    initialBalance = balance\n    monthlyPaymentRate = 0\n    monthlyInterestRate = annualInterestRate / totalMonths\n    while balance > 0:\n        for i in range(totalMonths):\n            balance = balance - monthlyPaymentRate + ((balance - monthlyPaymentRate) * monthlyInterestRate)\n        if balance > 0:\n            monthlyPaymentRate += 10\n            balance = initialBalance\n        elif balance <= 0:\n            break\n    return monthlyPaymentRate\n", "entry_point": "calculate_min_payment", "input": "2000, 0.2", "output": "190", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63181_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022050", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) <= 1:\n        return None\n    min_val = min(numbers)\n    max_val = max(numbers)\n    numbers.remove(min_val)\n    numbers.remove(max_val)\n    if len(numbers) == 0:\n        return None\n    return sum(numbers) / len(numbers)\n", "entry_point": "calculate_average_excluding_extremes", "input": "[2, 3, 4, 5]", "output": "3.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148106_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6766", "output": "{1, 2, 34, 199, 6766, 398, 17, 3383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022052", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2235", "output": "{1, 3, 5, 745, 15, 149, 2235, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6177", "output": "{1, 6177, 3, 71, 2059, 213, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022054", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "3, 5.291502622129181", "output": "6.082762530298219", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022055", "code": "def get_node_list(heap):\n    node_list = [None, len(heap)] + [i for i in range(len(heap)) if heap[i] is not None]\n    return node_list\n", "entry_point": "get_node_list", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8]", "output": "[None, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133261_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022056", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 2, 3, 4, 4]", "output": "[4, 6, 6, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022057", "code": "from datetime import datetime, timedelta\ndef generate_dates(start_date, num_days):\n    dates_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days + 1):\n        dates_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return dates_list\n", "entry_point": "generate_dates", "input": "'2020-06-30', 2", "output": "['2020-06-30', '2020-07-01', '2020-07-02']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127239_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022058", "code": "def count_imports(code_str):\n    imports_count = {}\n    lines = code_str.split('\\n')\n    for line in lines:\n        if line.startswith('import'):\n            modules = line.split('import ')[1].split(',')\n            for module in modules:\n                module_name = module.strip().split(' ')[0]\n                imports_count[module_name] = imports_count.get(module_name, 0) + 1\n        elif line.startswith('from'):\n            module_name = line.split('from ')[1].split(' ')[0]\n            imports_count[module_name] = imports_count.get(module_name, 0) + 1\n    return imports_count\n", "entry_point": "count_imports", "input": "'import math'", "output": "{'math': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69594_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1173", "output": "{1, 3, 69, 391, 17, 51, 1173, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022060", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[2, 3, 10, 2, 7, 9, 10, 9]", "output": "[4, 27, 100, 4, 343, 729, 100, 729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7445", "output": "{1, 5, 1489, 7445}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022062", "code": "WINDOWS_PORTS = ['TEST', 'FOO', 'COM0', 'COM1', 'COM2', 'COM3', 'tty']\nMAC_PORTS = ['/dev/tty', '/dev/cu.usb', '/dev/tty.usbmodem0', '/dev/tty.usbmodem1', '/dev/tty.usbmodem2', '/dev/tty.usbmodem3']\nLINUX_PORTS = ['/dev/Bluetooth', '/dev/foo', '/dev/cu.ACM0', '/dev/cu.ACM1', '/dev/cu.ACM2', '/dev/cu.ACM3']\nNO_PORTS = ['/dev/tty', 'COMX', '/dev/tty.usbmodem', 'foo']\ndef get_available_ports(os_type):\n    if os_type.lower() == 'windows':\n        return [port for port in WINDOWS_PORTS if port.startswith('COM') or port.startswith('tty')]\n    elif os_type.lower() == 'mac':\n        return [port for port in MAC_PORTS]\n    elif os_type.lower() == 'linux':\n        return [port for port in LINUX_PORTS]\n    else:\n        return []\n", "entry_point": "get_available_ports", "input": "'windows'", "output": "['COM0', 'COM1', 'COM2', 'COM3', 'tty']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66089_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022063", "code": "import math\nMB = 1 << 20\nBUFF_SIZE = 10 * MB\ndef calculate_total_size(file_sizes):\n    total_size_in_bytes = sum(file_sizes)\n    total_size_in_mb = math.ceil(total_size_in_bytes / BUFF_SIZE)\n    return total_size_in_mb\n", "entry_point": "calculate_total_size", "input": "[83886080, 1048576]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31272_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022064", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[5, 2, 2, 2, 0, 1, 1, 4]", "output": "{5: 1, 2: 3, 0: 1, 1: 2, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022065", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[0, 1, 0, 2, 2, 1, 0]", "output": "[0, 0, 0, 4, 4, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022066", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "88", "output": "0.4888888888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7485", "output": "{1, 3, 5, 15, 499, 1497, 7485, 2495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "726", "output": "{1, 2, 3, 66, 33, 6, 363, 11, 242, 726, 22, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022069", "code": "def process_numbers(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n        elif num % 5 == 0:\n            total += 2 * num\n        else:\n            total -= num\n    return total\n", "entry_point": "process_numbers", "input": "[8, 5, 11, 10, 20, 2]", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25805_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5222", "output": "{1, 2, 5222, 7, 746, 14, 2611, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022071", "code": "def sum_of_squares_of_evens(input_list):\n    total = 0\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[10, 8, 6]", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147300_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022072", "code": "def extract_alphabetic_chars(words):\n    result = []\n    for word in words:\n        alphabetic_chars = ''.join([char for char in word if char.isalpha()])\n        result.append(alphabetic_chars)\n    return result\n", "entry_point": "extract_alphabetic_chars", "input": "['a1pple', 'o!range', 'ba@nana']", "output": "['apple', 'orange', 'banana']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "731", "output": "{1, 731, 17, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022074", "code": "def extract_app_name(default_app_config):\n    # Split the input string using dot as the delimiter\n    config_parts = default_app_config.split('.')\n    # Extract the app name from the first part\n    app_name = config_parts[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'django_migration_uts.config'", "output": "'django_migration_uts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64209_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022075", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9265", "output": "{1, 545, 5, 109, 17, 9265, 85, 1853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022076", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[1, 4, 5, 3, 5, 2, 7, 3, 2]", "output": "[[5], [5], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9459", "output": "{1, 3, 9, 3153, 9459, 1051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022078", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 2, 2, 7, -2, 2, 1, 3]", "output": "[5, 4, 9, 5, 0, 3, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51354_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022079", "code": "from collections import defaultdict\ndef count_tokens_per_role(role_bearer_tokens):\n    role_token_count = defaultdict(int)\n    for role_bearer_token in role_bearer_tokens:\n        role = role_bearer_token['role']\n        role_token_count[role] += 1\n    return dict(role_token_count)\n", "entry_point": "count_tokens_per_role", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118259_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022080", "code": "def eval_levicivita(*args):\n    if len(args) < 2:\n        return 0\n    elif len(args) % 2 == 0:\n        return 1  # Initialize result as 1 for multiplication\n        for arg in args:\n            result *= arg\n    else:\n        return sum(args)\n", "entry_point": "eval_levicivita", "input": "2, 3, 4", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73882_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022081", "code": "def calculate_moving_average(points, window):\n    def __calculate_moving_sums(points, window):\n        \"\"\" Calculates hr moving sums of the window len \"\"\"\n        time, hrs = zip(*points)\n        moving_sum = sum(hrs[0:window])\n        sums = [(time[0], moving_sum)]\n        for i, t in enumerate(time[1:-1 * window]):\n            moving_sum += hrs[i + window] - hrs[i]\n            sums.append((t, moving_sum))\n        return sums\n    moving_averages = []\n    moving_sums = __calculate_moving_sums(points, window)\n    for time, sum_hr in moving_sums:\n        moving_averages.append((time, sum_hr / window))\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[(1, 3.0), (2, 4.0)], 2", "output": "[(1, 3.5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8585_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022082", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[7, [6, [5, 4]], [2, 3], [2], 6]", "output": "[7, 6, 5, 4, 2, 3, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022083", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7667", "output": "{1, 451, 41, 11, 17, 7667, 697, 187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6932", "output": "{1, 2, 4, 1733, 3466, 6932}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6931", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022085", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "17, 17", "output": "0.0196078431372549", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022086", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'fiiffililleil'", "output": "'fiiffililleil_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022087", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4457", "output": "{1, 4457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022088", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "-1.5, 1", "output": "-1.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022089", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "96.0, 7.0, 10.0", "output": "(92.448, 6.720000000000001, 10.272)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022090", "code": "def highest_non_duplicated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_duplicated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_duplicated_scores:\n        return max(non_duplicated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_duplicated_score", "input": "[]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79204_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022091", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[2, 0, 4, 3]", "output": "{2: 4, 0: 0, 4: 16, 3: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022092", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022093", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8852", "output": "{1, 2, 4, 2213, 4426, 8852}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8851", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022094", "code": "def dechiffrer(morse_code):\n    morse_dict = {\n        '.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D', '.': 'E',\n        '..-.': 'F', '--.': 'G', '....': 'H', '..': 'I', '.---': 'J',\n        '-.-': 'K', '.-..': 'L', '--': 'M', '-.': 'N', '---': 'O',\n        '.--.': 'P', '--.-': 'Q', '.-.': 'R', '...': 'S', '-': 'T',\n        '..-': 'U', '...-': 'V', '.--': 'W', '-..-': 'X', '-.--': 'Y',\n        '--..': 'Z', '/': ' '\n    }\n    decoded_message = \"\"\n    words = morse_code.split('/')\n    for word in words:\n        characters = word.split()\n        for char in characters:\n            if char in morse_dict:\n                decoded_message += morse_dict[char]\n        decoded_message += ' '\n    return decoded_message.strip()\n", "entry_point": "dechiffrer", "input": "'. / .---'", "output": "'E J'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31381_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022095", "code": "def combine_subdomains(subdomains, domain):\n    combined_subdomains = []\n    for subdomain in subdomains:\n        if subdomain:\n            combined_subdomains.append(\"{0}.{1}\".format(subdomain, domain))\n    unique_subdomains = set(combined_subdomains)\n    print(\"   \\__ {0}: {1}\".format(\"Subdomains found\", len(unique_subdomains)))\n    return unique_subdomains\n", "entry_point": "combine_subdomains", "input": "[], 'example.com'", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55466_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2051", "output": "{1, 2051, 293, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022097", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "['a', 3.5, -1, 3, 4, 'hello']", "output": "{-1: 1, 3: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022098", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "70, 4", "output": "74", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022099", "code": "def calculate_precision(true_positives, false_positives):\n    if true_positives + false_positives == 0:\n        return -1\n    precision = true_positives / (true_positives + false_positives)\n    return precision\n", "entry_point": "calculate_precision", "input": "16, 5", "output": "0.7619047619047619", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116916_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2433", "output": "{1, 2433, 3, 811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022101", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[8, 0, 0, 1, -8, 0, 2]", "output": "[-8, 0, 1, -9, 8, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7162", "output": "{1, 7162, 2, 3581}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7161", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022103", "code": "def merge_sorted_arrays(arr1, arr2):\n    merged_list = []\n    while len(arr1) and len(arr2):\n        if arr1[0] < arr2[0]:\n            merged_list.append(arr1.pop(0))\n        else:\n            merged_list.append(arr2.pop(0))\n    merged_list += arr1\n    merged_list += arr2\n    return merged_list\n", "entry_point": "merge_sorted_arrays", "input": "[1, 2, 3], [4, 5, 6]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7628_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022104", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['10', '+', '20']", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2347", "output": "{1, 2347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3632", "output": "{1, 2, 227, 4, 454, 8, 908, 3632, 16, 1816}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3631", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022107", "code": "def format_numbers(numbers):\n    formatted_numbers = []\n    for num in numbers:\n        formatted_num = \"{:5.1f}\".format(num)[:5]  # Apply formatting rules\n        formatted_numbers.append(formatted_num)\n    return ' '.join(formatted_numbers)\n", "entry_point": "format_numbers", "input": "[3.1, 2.7, 123.5]", "output": "'  3.1   2.7 123.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116002_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022108", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'100 131 *'", "output": "13100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022109", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hello'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022110", "code": "from typing import List\ndef above_average_scores(scores: List[int]) -> List[int]:\n    if not scores:\n        return []\n    average_score = sum(scores) / len(scores)\n    above_average = [score for score in scores if score > average_score]\n    return above_average\n", "entry_point": "above_average_scores", "input": "[80, 82, 81, 85, 90, 85, 90]", "output": "[85, 90, 85, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44803_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022111", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'how'", "output": "['how']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022112", "code": "import re\ndef repair_move_path(path: str) -> str:\n    # Define a regular expression pattern to match elements like '{org=>com}'\n    FILE_PATH_RENAME_RE = re.compile(r'\\{([^}]+)=>([^}]+)\\}')\n    # Replace the matched elements with the desired format using re.sub\n    return FILE_PATH_RENAME_RE.sub(r'\\2', path)\n", "entry_point": "repair_move_path", "input": "'e/dir/{123=>4ile.docctec.c}'", "output": "'e/dir/4ile.docctec.c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137172_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022113", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 2, 2, 4, 5]", "output": "[0, 1, 2, 2, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "392", "output": "{1, 2, 98, 196, 4, 7, 392, 8, 14, 49, 56, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt391", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022115", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "6, 4", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022116", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'*Q**CE*Title***'", "output": "('', 'Q**CE*Title***')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022117", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:edX+C01+c0'", "output": "('edX', 'C01', 'c0')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022118", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "'Hello, world; this is T.'", "output": "'hello world this is t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022119", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[1, 5, 10, 12]", "output": "(1, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8729", "output": "{1, 7, 43, 203, 301, 8729, 29, 1247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022121", "code": "def calculate_mae(expected, predicted):\n    if len(expected) != len(predicted):\n        raise ValueError(\"Expected and predicted lists must have the same length.\")\n    mae = sum(abs(e - p) for e, p in zip(expected, predicted)) / len(expected)\n    return mae\n", "entry_point": "calculate_mae", "input": "[0.0], [2.6]", "output": "2.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022122", "code": "import re\ndef word_frequency(input_list):\n    word_freq = {}\n    for string in input_list:\n        words = re.findall(r'\\w+', string.lower())\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "['apple onge banana']", "output": "{'apple': 1, 'onge': 1, 'banana': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6380_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022123", "code": "def move_player(movements):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    player_position = [0, 0]\n    for move in movements:\n        dx, dy = directions.get(move, (0, 0))\n        new_x = player_position[0] + dx\n        new_y = player_position[1] + dy\n        if 0 <= new_x < 5 and 0 <= new_y < 5:\n            player_position[0] = new_x\n            player_position[1] = new_y\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['D', 'R', 'R']", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144868_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022124", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[85, 50, 88, 65, 40, 55, 30]", "output": "['B', 'E', 'B', 'D', 'E', 'E', 'E']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022125", "code": "def calculate_total_cost(cart):\n    total_cost = 0\n    for item in cart:\n        total_cost += item['price']\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "[{'price': 399.99}]", "output": "399.99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68062_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022126", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 0, 5, 4, -1, 2, 3]", "output": "[1, 1, 6, 10, 9, 11, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022127", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[5, 6, 0, 3, 1, 6, 5, 0, 0]", "output": "[5, 7, 2, 6, 5, 11, 11, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022128", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "1, -0.40041339283234834", "output": "-0.20020669641617417", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022129", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'WowOldRLD!'", "output": "{'wowoldrld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6294", "output": "{1, 2, 3, 6, 3147, 2098, 6294, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6293", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022131", "code": "import math\ndef euclidean_distance(point1, point2):\n    if not isinstance(point1, tuple) or not isinstance(point2, tuple) or len(point1) != 2 or len(point2) != 2:\n        raise ValueError(\"Both inputs must be tuples of length 2\")\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(0, 0), (8, 4)", "output": "8.94427190999916", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13433_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022132", "code": "def find_missing_number(nums):\n    n = len(nums)\n    total_sum = n * (n + 1) // 2\n    for num in nums:\n        total_sum -= num\n    return total_sum\n", "entry_point": "find_missing_number", "input": "[0, 1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022133", "code": "def custom_word_frequency(sentence: str, custom_punctuation: str) -> dict:\n    sentence = sentence.lower()\n    words = {}\n    for s in custom_punctuation:\n        sentence = sentence.replace(s, ' ')\n    for w in sentence.split():\n        if w.endswith('\\''):\n            w = w[:-1]\n        if w.startswith('\\''):\n            w = w[1:]\n        words[w] = words.get(w, 0) + 1\n    return words\n", "entry_point": "custom_word_frequency", "input": "'Wow!', '!'", "output": "{'wow': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9164_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022134", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[5, 3, 3]", "output": "[3, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022135", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6355", "output": "{1, 5, 41, 205, 6355, 1271, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022136", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1663", "output": "{1, 1663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1662", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022137", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['IGNORE', 'X', 'XA', '2', '1', '1', 'A1', '1']", "output": "'X XA 2 1 1 A1 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022138", "code": "def convert_integers(numbers):\n    converted_list = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            converted_list.append('even_odd')\n        elif num % 2 == 0:\n            converted_list.append('even')\n        elif num % 3 == 0:\n            converted_list.append('odd')\n        else:\n            converted_list.append(num)\n    return converted_list\n", "entry_point": "convert_integers", "input": "[1, 3, 4, 7, 1, 7, 4]", "output": "[1, 'odd', 'even', 7, 1, 7, 'even']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77525_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022139", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'WOWHRLWD'", "output": "'wowhrlwd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4894", "output": "{1, 2, 4894, 2447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4893", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022141", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[95, 95, 95, 95, 91], 5", "output": "94.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022142", "code": "from typing import List\ndef calculate_discount(current: List[float], reference: List[float]) -> List[float]:\n    list_discount = []\n    for i in range(len(current)):\n        c = current[i]\n        r = reference[i]\n        discount = (r - c) / r\n        list_discount.append(discount)\n    return list_discount\n", "entry_point": "calculate_discount", "input": "[2, 3, 5], [3, 4, 6]", "output": "[0.3333333333333333, 0.25, 0.16666666666666666]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121103_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022143", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'executableexe'", "output": "'executableexe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "777", "output": "{1, 259, 3, 37, 7, 777, 111, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022145", "code": "def calculate_average_living_area(dataset):\n    total_living_area = 0\n    house_count = 0\n    for house in dataset:\n        if house.get(\"GarageType\") is not None:\n            total_living_area += house.get(\"GrLivArea\")\n            house_count += 1\n    if house_count == 0:\n        return 0\n    average_living_area = total_living_area / house_count\n    return round(average_living_area)\n", "entry_point": "calculate_average_living_area", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10559_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022146", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2013", "output": "{1, 33, 3, 11, 61, 183, 2013, 671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022147", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9142", "output": "{1, 2, 7, 653, 14, 9142, 1306, 4571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022148", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[6, 10, 28, 40, 41, 49, 6, 10, 41]", "output": "'6, 10, 28, 40, 41, 49'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022149", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'Harvardd/Cx/202c'", "output": "('Harvardd', 'Cx', '202c')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022150", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[7, 6, 5, 4, 4, 2, 2, 1]", "output": "[7, 6, 5, 4, 4, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022151", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "418", "output": "{1, 418, 2, 38, 11, 209, 19, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt417", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022152", "code": "import re\nTRAILING_WS_IN_CONTINUATION = re.compile(r'\\\\ \\s+\\n')\ndef remove_trailing_whitespace(input_string: str) -> str:\n    return TRAILING_WS_IN_CONTINUATION.sub(r'\\\\n', input_string)\n", "entry_point": "remove_trailing_whitespace", "input": "'12323'", "output": "'12323'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71646_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022153", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'path2ppat'", "output": "'Content for path2ppat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022154", "code": "def decode_string(pattern):\n    result = \"\"\n    inside_underscore = False\n    underscore_chars = []\n    for char in pattern:\n        if char == '_':\n            if inside_underscore:\n                result += ''.join(reversed(underscore_chars))\n                underscore_chars = []\n            inside_underscore = not inside_underscore\n        else:\n            if inside_underscore:\n                underscore_chars.append(char)\n            else:\n                result += char\n    if underscore_chars:\n        result += ''.join(reversed(underscore_chars))\n    return result\n", "entry_point": "decode_string", "input": "'abc_def_ghi'", "output": "'abcfedghi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114886_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022155", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9547", "output": "{1, 9547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022156", "code": "def evaluate_expression(tokens):\n    def precedence(op):\n        if op in ['*', '/']:\n            return 2\n        elif op in ['+', '-']:\n            return 1\n        else:\n            return 0\n    def apply_operation(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n        elif operator == '/':\n            return a // b\n    stack = []\n    operands = []\n    operators = []\n    for token in tokens:\n        if token.isdigit():\n            operands.append(int(token))\n        elif token in ['+', '-', '*', '/']:\n            while operators and precedence(operators[-1]) >= precedence(token):\n                operands.append(apply_operation(operands, operators.pop()))\n            operators.append(token)\n        elif token == '(':\n            operators.append(token)\n        elif token == ')':\n            while operators[-1] != '(':\n                operands.append(apply_operation(operands, operators.pop()))\n            operators.pop()\n    while operators:\n        operands.append(apply_operation(operands, operators.pop()))\n    return operands[0]\n", "entry_point": "evaluate_expression", "input": "['6', '*', '7']", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30309_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022157", "code": "from typing import List\ndef extract_weather_icons(data: List[str]) -> List[str]:\n    left = 'http://www.weather.gov.sg/wp-content/themes/wiptheme/assets/img/'\n    right = '.png'\n    results = []\n    for i in data:\n        if 'wicon wicon-weather' in i:\n            s = i.split(\"wicon wicon-weather\")\n            if len(s) > 1:\n                icon_name = s[1][s[1].index(left)+len(left):s[1].index(right)].replace(\"-small\",\"\").replace(\"icon-\",\"\")\n                results.append(icon_name)\n    return results\n", "entry_point": "extract_weather_icons", "input": "['no weather here', 'another irrelevant string', 'just text']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95709_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022158", "code": "from typing import List\ndef sum_multiples_of_3_or_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 12, 15]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25649_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022159", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[201]", "output": "2412", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022160", "code": "import re\ndef extract_version_and_sha256(url):\n    # Define the regex patterns for version number and SHA256 hash value\n    version_pattern = r'(\\d+\\.\\d+\\.\\d+)'\n    sha256_pattern = r'[0-9a-f]{64}'\n    # Match the version number and SHA256 hash value in the URL\n    version_match = re.search(version_pattern, url)\n    sha256_match = re.search(sha256_pattern, url)\n    if version_match and sha256_match:\n        version = version_match.group(1)\n        sha256 = sha256_match.group()\n        return version, sha256\n    else:\n        return None, None\n", "entry_point": "extract_version_and_sha256", "input": "'example.com/resource'", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69716_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022161", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "1, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022162", "code": "def foo(*args):\n    result = {}\n    for idx, arg in enumerate(args):\n        key = chr(ord('a') + idx)  # Convert index to alphabet letter\n        result[key] = arg\n    return result\n", "entry_point": "foo", "input": "1, 2, 3", "output": "{'a': 1, 'b': 2, 'c': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59566_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022163", "code": "from typing import List, Dict, Any\ndef organize_configurations(configs: List[Dict[str, Any]]) -> Dict[str, Any]:\n    def add_config(node, path_components, name, content):\n        if not path_components:\n            node[name] = content\n        else:\n            head, *tail = path_components\n            if head not in node:\n                node[head] = {}\n            add_config(node[head], tail, name, content)\n    organized_configs = {}\n    for config in configs:\n        path_components = config[\"path\"].split(\"/\")\n        add_config(organized_configs, path_components, config[\"name\"], config[\"content\"])\n    return organized_configs\n", "entry_point": "organize_configurations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118937_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022164", "code": "from typing import List\ndef batch_tasks(tasks: List[int], batch_size: int) -> List[List[int]]:\n    batches = []\n    for i in range(0, len(tasks), batch_size):\n        batch = tasks[i:i + batch_size]\n        batches.append(batch)\n    return batches\n", "entry_point": "batch_tasks", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109016_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022165", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8557", "output": "{1, 43, 8557, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022166", "code": "import json\nWEEKLY_FEED = {\n    'name': 'unpaywall-data-feed',\n    'bucket': 'unpaywall-data-feed',\n    'changefile-endpoint': 'feed/changefile',\n    'interval': 'week',\n    'file_dates': lambda filename: {\n        'from_date': filename.split(\"_\")[0].split(\"T\")[0],\n        'to_date': filename.split(\"_\")[2].split(\"T\")[0]\n    },\n}\ndef extract_dates_from_filename(filename):\n    return WEEKLY_FEED['file_dates'](filename)\n", "entry_point": "extract_dates_from_filename", "input": "'___.json'", "output": "{'from_date': '', 'to_date': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56947_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022167", "code": "def getSkillGained(toonSkillPtsGained, toonId, track):\n    exp = 0\n    expList = toonSkillPtsGained.get(toonId, None)\n    if expList is not None:\n        exp = expList[track]\n    return int(exp + 0.5)\n", "entry_point": "getSkillGained", "input": "{}, 'toon_1', 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70352_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2209", "output": "{1, 2209, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8157", "output": "{1, 3, 8157, 2719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6922", "output": "{1, 6922, 2, 3461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6921", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022171", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'tlimit.he'", "output": "'Tweet posted successfully: tlimit.he'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022172", "code": "def count_values_in_range(n, min_val, max_val):\n    count = 0\n    i = 0\n    while True:\n        i, sq = i + 1, i ** n\n        if sq in range(min_val, max_val + 1):\n            count += 1\n        if sq > max_val:\n            break\n    return count\n", "entry_point": "count_values_in_range", "input": "2, 1, 144", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140446_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022173", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'thisIsCamThed'", "output": "'this_is_cam_thed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022174", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "50, 10, 10", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022175", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[7, 5, 2, 5, 5, 5, 6, 3]", "output": "[12, 7, 7, 10, 10, 11, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022176", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'example.yConnotstConfig'", "output": "'yConnotst'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022177", "code": "def calculate_error(list1, list2):\n    total_error = sum(abs(x - y) for x, y in zip(list1, list2))\n    return total_error\n", "entry_point": "calculate_error", "input": "[0, 0, 0, 0], [19, 0, 0, 0]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33914_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022178", "code": "def calculate_carbon_uptake_rate(growth_rate):\n    R_GLUC = 200\n    R_XYL = 50\n    R_FRUC = 200\n    R_GLYC = 2000\n    N_GLUC = 6\n    N_XYL = 5\n    total_carbon_uptake_rate = (R_GLUC * N_GLUC + R_XYL * N_XYL + R_FRUC * 6 + R_GLYC * 3) * growth_rate\n    return total_carbon_uptake_rate\n", "entry_point": "calculate_carbon_uptake_rate", "input": "3460.0 / 8650", "output": "3460.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50880_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022179", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'admin_listctsconillit'", "output": "'listctsconillit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022180", "code": "def convert_to_dict(tuple_list):\n    dic = {}\n    for pair in tuple_list:\n        dic[pair[0]] = pair[1]\n    return dic\n", "entry_point": "convert_to_dict", "input": "[(2, 'b')]", "output": "{2: 'b'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44836_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022181", "code": "def setup_project(repo_name, repo_url, commit):\n    # Simulate importing necessary modules from solver-deps\n    def setup_minisat():\n        print(\"Setting up Minisat...\")\n    def setup_cms():\n        print(\"Setting up CMS...\")\n    def clone_repo_src(repo_name, repo_url, commit):\n        # Simulated function to clone the repository\n        return f\"{repo_name}_{commit}\"\n    # Simulate the process of setting up dependencies\n    setup_minisat()\n    setup_cms()\n    # Simulate cloning the repository\n    the_repo = clone_repo_src(repo_name, repo_url, commit)\n    # Simulate creating and setting up the build directory\n    build_dir = f\"{the_repo}/build\"\n    print(f\"Build directory path: {build_dir}\")\n    return build_dir\n", "entry_point": "setup_project", "input": "'v ', 'http://example.com/repo.git', 'aaa5a9e'", "output": "'v _aaa5a9e/build'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115797_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022182", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[3, 1, 3, 4, 4, 3, 0, 3, 4]", "output": "[3, 4, 7, 11, 15, 18, 18, 21, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022183", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'eapapeaep', 'not_used'", "output": "'eapapeaep'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022184", "code": "def format_color_names(input_string):\n    predefined_words = [\"is\", \"a\", \"nice\"]\n    words = input_string.split()\n    formatted_words = []\n    for word in words:\n        if word.lower() not in predefined_words:\n            word = word.capitalize()\n        formatted_words.append(word)\n    formatted_string = ' '.join(formatted_words)\n    return formatted_string\n", "entry_point": "format_color_names", "input": "'Cmyc'", "output": "'Cmyc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25204_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022185", "code": "import errno\ndef process_socket_errors(sock_errors: dict) -> dict:\n    sockErrors = {errno.ESHUTDOWN: True,\n                  errno.ENOTCONN: True,\n                  errno.ECONNRESET: False,\n                  errno.ECONNREFUSED: False,\n                  errno.EAGAIN: False,\n                  errno.EWOULDBLOCK: False}\n    if hasattr(errno, 'EBADFD'):\n        sockErrors[errno.EBADFD] = True\n    ignore_status = {}\n    for error_code in sock_errors:\n        ignore_status[error_code] = sockErrors.get(error_code, False)\n    return ignore_status\n", "entry_point": "process_socket_errors", "input": "{76: None, 79: None, 75: None}", "output": "{76: False, 79: False, 75: False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12691_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022186", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[100, 136.8421052631579]", "output": "36.84210526315789", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022187", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'5-2'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4354", "output": "{1, 4354, 2, 2177, 7, 622, 14, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022189", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "121", "output": "{1, 11, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022190", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[10, 3, 26, 10, 27, 38, 9, 26]", "output": "[3, 9, 10, 10, 26, 26, 27, 38]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022191", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'Hellold!,'", "output": "'<strong>Hellold!,</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3815", "output": "{1, 545, 35, 5, 7, 3815, 109, 763}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022193", "code": "import math\ndef calculate_polygon_area(n, s):\n    area = (n * s**2) / (4 * math.tan(math.pi / n))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "4, 9.0", "output": "81.00000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48950_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022194", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[1, 5, 2, -2, 1, 5, 6, 2, -2]", "output": "[6, 7, 0, -1, 6, 11, 8, 0, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022195", "code": "from collections import namedtuple\n# Mock Feature class for demonstration purposes\nFeature = namedtuple('Feature', ['uniquename', 'species'])\nfeatures = [\n    Feature('human', 'homo_sapiens'),\n    Feature('dog', 'canis_lupus_familiaris'),\n    Feature('cat', 'felis_catus')\n]\ndef species(name):\n    try:\n        feat = next(feat for feat in features if feat.uniquename == name)\n        species_ = feat.species\n    except StopIteration:\n        species_ = 'Unknown'\n    return species_.replace('_', ' ').capitalize()\n", "entry_point": "species", "input": "'human'", "output": "'Homo sapiens'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77432_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022196", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 4, 3, 12, 4]", "output": "[4, 12, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8264", "output": "{1, 2, 4132, 4, 8264, 8, 1033, 2066}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8263", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022198", "code": "def calculate_max_vertical_deviation(image_dims, ground_truth_horizon, detected_horizon):\n    width, height = image_dims\n    def gt(x):\n        return ground_truth_horizon[0] * x + ground_truth_horizon[1]\n    def dt(x):\n        return detected_horizon[0] * x + detected_horizon[1]\n    if ground_truth_horizon is None or detected_horizon is None:\n        return None\n    max_deviation = max(abs(gt(0) - dt(0)), abs(gt(width) - dt(width)))\n    normalized_deviation = max_deviation / height\n    return normalized_deviation\n", "entry_point": "calculate_max_vertical_deviation", "input": "(100, 1), (0, 0), (0, 0.1)", "output": "0.1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_623_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022199", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 92, 90, 85, 85, 76, 76]", "output": "[99, 92, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022200", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'em0:amae0'", "output": "{'when': 'em0:amae0', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022201", "code": "def count_names(input_str):\n    name_counts = {}\n    names = input_str.split(',')\n    for name in names:\n        name = name.strip().lower()\n        name_counts[name] = name_counts.get(name, 0) + 1\n    return name_counts\n", "entry_point": "count_names", "input": "'Joh,'", "output": "{'joh': 1, '': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64824_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022202", "code": "def sum_with_index(input_list):\n    result = []\n    for index, value in enumerate(input_list):\n        result.append(value + index)\n    return result\n", "entry_point": "sum_with_index", "input": "[3, 7, 6, 3, 6, 6]", "output": "[3, 8, 8, 6, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49873_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3931", "output": "{1, 3931}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3821", "output": "{1, 3821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022205", "code": "def generate_resource_lists(max_id, list_count):\n    resource_lists = []\n    entries_per_list = max_id // list_count\n    remaining_count = max_id - (entries_per_list * list_count)\n    starting_index = 1\n    for i in range(1, list_count + 1):\n        ending_index = i * entries_per_list\n        resource_lists.append(list(range(starting_index, ending_index + 1)))\n        starting_index = ending_index + 1\n    if remaining_count:\n        starting_index = resource_lists[-1][-1] + 1\n        ending_index = starting_index + remaining_count\n        resource_lists.append(list(range(starting_index, ending_index)))\n    return resource_lists\n", "entry_point": "generate_resource_lists", "input": "12, 1", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104705_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022206", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'//hous', 'telattela'", "output": "'//hous/telattela'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "247", "output": "{1, 19, 13, 247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022208", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if N > len(sorted_scores):\n        N = len(sorted_scores)\n    return sum(sorted_scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[55, 55, 55], 3", "output": "55.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132945_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022209", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[10, 10]", "output": "[10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022210", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-12", "output": "-21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022211", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "544", "output": "{544, 1, 2, 34, 4, 68, 32, 136, 8, 272, 16, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt543", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022212", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "0.144, 2", "output": "1.144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022213", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'Hello', 'John', 2022", "output": "'HELJOH2022'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022214", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[2, 2, 2, 3, 3, 1, 4]", "output": "([2, 3, 1, 4], [3, 2, 1, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022215", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[5, -2, 4, 3, 1, 1, 2, 2]", "output": "[5, -2, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022216", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4395", "output": "{1, 3, 5, 293, 4395, 879, 15, 1465}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022217", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'xml_lsx'", "output": "'Exporting annotated corpus data for xml_lsx.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022218", "code": "def filter_dicts(input_list):\n    filtered_list = []\n    for dictionary in input_list:\n        if 'exclude_key' in dictionary and dictionary['exclude_key'] == 'exclude_value':\n            continue\n        filtered_list.append(dictionary)\n    return filtered_list\n", "entry_point": "filter_dicts", "input": "[{}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30808_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022219", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'AAAAA', 'IIIIII'", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "128", "output": "{128, 1, 2, 64, 4, 32, 8, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt127", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022221", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[1, 1, -1, -1, -1, 0, 2, 2, 2]", "output": "{1: 2, -1: 3, 0: 1, 2: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022222", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "4, 1", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022223", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[88, 88, 86, 78, 78, 75]", "output": "[88, 86, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3139", "output": "{73, 1, 3139, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022225", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[4, 2, 2, 4, 2, 2, 4, 2, 2]", "output": "[4, 2, 2, 4, 2, 2, 4, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022226", "code": "def find_nth_number(n):\n    current_num = 1\n    count = 1\n    while count <= n:\n        current_num *= 2\n        if current_num % 3 == 0:\n            continue\n        count += 1\n    return current_num\n", "entry_point": "find_nth_number", "input": "12", "output": "4096", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58329_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "214", "output": "{1, 2, 107, 214}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt213", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022228", "code": "def wheel(pos):\n    if pos < 0 or pos > 255:\n        return (0, 0, 0)\n    if pos < 85:\n        return (255 - pos * 3, pos * 3, 0)\n    if pos < 170:\n        pos -= 85\n        return (0, 255 - pos * 3, pos * 3)\n    pos -= 170\n    return (pos * 3, 0, 255 - pos * 3)\n", "entry_point": "wheel", "input": "43", "output": "(126, 129, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16803_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7054", "output": "{1, 2, 7054, 3527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7053", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022230", "code": "def radix_sort(array):\n    base = 10  # Base 10 for decimal integers\n    max_val = max(array)\n    col = 0\n    while max_val // 10 ** col > 0:\n        count_array = [0] * base\n        position = [0] * base\n        output = [0] * len(array)\n        for elem in array:\n            digit = elem // 10 ** col\n            count_array[digit % base] += 1\n        position[0] = 0\n        for i in range(1, base):\n            position[i] = position[i - 1] + count_array[i - 1]\n        for elem in array:\n            output[position[elem // 10 ** col % base]] = elem\n            position[elem // 10 ** col % base] += 1\n        array = output\n        col += 1\n    return output\n", "entry_point": "radix_sort", "input": "[24, 24, 24, 66, 89, 168, 170, 170]", "output": "[24, 24, 24, 66, 89, 168, 170, 170]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60721_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022231", "code": "def weighted_average(values, weights):\n    if len(values) != len(weights):\n        raise ValueError(\"Lengths of values and weights must be the same.\")\n    weighted_sum = sum(value * weight for value, weight in zip(values, weights))\n    sum_weights = sum(weights)\n    return weighted_sum / sum_weights\n", "entry_point": "weighted_average", "input": "[4, 4], [1, 1]", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103808_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022232", "code": "from typing import List\ndef average_absolute_differences(list1: List[int], list2: List[int]) -> float:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    absolute_diffs = [abs(x - y) for x, y in zip(list1, list2)]\n    average_diff = sum(absolute_diffs) / len(absolute_diffs)\n    return round(average_diff, 4)  # Rounding to 4 decimal places\n", "entry_point": "average_absolute_differences", "input": "[1, 2, 4, 7], [3, 5, 0, 9]", "output": "2.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72862_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022233", "code": "import json\ndef process_settings(settings_list):\n    settings_dict = {}\n    settings = []\n    for setting in settings_list:\n        key = setting['name'].upper()\n        settings_dict[key] = setting['value']\n        settings.append(setting)\n    settings_dict['settings'] = json.dumps(settings)\n    return settings_dict\n", "entry_point": "process_settings", "input": "[]", "output": "{'settings': '[]'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54267_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022234", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'The answer is 10'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022235", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'This is a test readme file.', '1.0'", "output": "{'1.0': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022236", "code": "from typing import List, Tuple\nfrom math import sqrt\ndef max_distance(points: List[Tuple[int, int]]) -> float:\n    max_dist = 0\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            max_dist = max(max_dist, distance)\n    return round(max_dist, 2)\n", "entry_point": "max_distance", "input": "[(0, 0), (1, 1)]", "output": "1.41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39213_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022237", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[10, 0], [1, 1], [8, 2]]", "output": "[[10], [1], [8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5734", "output": "{1, 2, 5734, 47, 2867, 122, 61, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022239", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'4.12.3'", "output": "'4.12.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022240", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3002", "output": "{1, 2, 38, 79, 19, 3002, 1501, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3001", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022241", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'2.5.1'", "output": "(2, 5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022242", "code": "def elementwise_division(a, b):\n    if isinstance(a[0], list):  # Check if a is a 2D list\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [[x / y for x, y in zip(row_a, row_b)] for row_a, row_b in zip(a, b)]\n    else:  # Assuming a and b are 1D lists\n        if len(a) != len(b):\n            raise ValueError(\"Input tensors must have the same length for element-wise division.\")\n        return [x / y for x, y in zip(a, b)]\n", "entry_point": "elementwise_division", "input": "[6, 17, 19], [2, 3, 1]", "output": "[3.0, 5.666666666666667, 19.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108971_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022243", "code": "FILE_STATUS = (\n    \"\u2601 Uploaded\",\n    \"\u231a Queued\",\n    \"\u2699 In Progress...\",\n    \"\u2705 Success!\",\n    \"\u274c Failed: file not found\",\n    \"\u274c Failed: unsupported file type\",\n    \"\u274c Failed: server error\",\n    \"\u274c Invalid column mapping, please fix it and re-upload the file.\",\n)\ndef get_file_status_message(index):\n    if 0 <= index < len(FILE_STATUS):\n        return FILE_STATUS[index]\n    else:\n        return \"Invalid status index\"\n", "entry_point": "get_file_status_message", "input": "3", "output": "'\u2705 Success!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2319_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022244", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(2, 5, 0)", "output": "'2.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1143", "output": "{1, 3, 9, 1143, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022246", "code": "def sort_projections(projection_ids, weights):\n    projection_map = dict(zip(projection_ids, weights))\n    sorted_projections = sorted(projection_ids, key=lambda x: projection_map[x])\n    return sorted_projections\n", "entry_point": "sort_projections", "input": "[4, 3, 3, 3, 3, 3, 2, 2], [1, 2, 2, 2, 2, 2, 3, 3]", "output": "[4, 3, 3, 3, 3, 3, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91067_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022247", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5571", "output": "{1, 1857, 3, 5571, 9, 619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5570", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "785", "output": "{1, 5, 785, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022249", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6827", "output": "{1, 6827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022250", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4161", "output": "{4161, 1, 3, 73, 1387, 19, 57, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022251", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'*Texet*'", "output": "'<em>Texet</em>\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022252", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022253", "code": "def custom_pad(x, k=8):\n    remainder = x % k\n    if remainder > 0:\n        x += k - remainder\n    return x\n", "entry_point": "custom_pad", "input": "25", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86362_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022254", "code": "import re\ndef check_passphrase_strength(passphrase: str) -> bool:\n    if passphrase:\n        regex = re.compile(r\"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$\")\n        return bool(regex.search(passphrase))\n    return False\n", "entry_point": "check_passphrase_strength", "input": "'Password1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65760_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7430", "output": "{1, 2, 3715, 5, 7430, 743, 10, 1486}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7429", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022256", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'my_gmmy_d', '0 1 **'", "output": "'my_gmmy_d_0_1_**'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022257", "code": "def split_list(x, n):\n    x = list(x)\n    if n < 2:\n        return [x]\n    def gen():\n        m = len(x) / n\n        i = 0\n        for _ in range(n-1):\n            yield x[int(i):int(i + m)]\n            i += m\n        yield x[int(i):]\n    return list(gen())\n", "entry_point": "split_list", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38553_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5561", "output": "{83, 1, 67, 5561}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5560", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022259", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'The quickup!'", "output": "{'the': 1, 'quickup': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022260", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[170, 171, 172]", "output": "171", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022261", "code": "def get_latest_version(versions: dict) -> tuple:\n    latest_version = None\n    latest_directory = None\n    for version, directory in versions.items():\n        if latest_version is None or version > latest_version:\n            latest_version = version\n            latest_directory = directory\n    return latest_version, latest_directory\n", "entry_point": "get_latest_version", "input": "{}", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66859_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022262", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[5, 6], 11", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022263", "code": "def count_blocks_in_level(level_config):\n    total_blocks = sum(sum(1 for block in row if block != 0) for row in level_config)\n    return total_blocks\n", "entry_point": "count_blocks_in_level", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125401_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022264", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[2, 2, 3, 3, 3, 4, 4]", "output": "([2, 3, 4], [2, 3, 2])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022265", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/home/user', '/home/dod'", "output": "'../dod'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022266", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "5", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022267", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3526", "output": "{1, 2, 1763, 3526, 41, 43, 82, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022268", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'tx.'", "output": "['tx']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022269", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'2.0.1.dev2'", "output": "(2, 0, 1, 'dev2')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022270", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "0, 24.5195, 10", "output": "-245.305", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022271", "code": "def reverse_words(input_string):\n    # Split the input string into individual words\n    words = input_string.split()\n    # Reverse each word in the list of words\n    reversed_words = [word[::-1] for word in words]\n    # Join the reversed words back together into a single string\n    reversed_string = ' '.join(reversed_words)\n    return reversed_string\n", "entry_point": "reverse_words", "input": "'rhelrld'", "output": "'dlrlehr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149182_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022272", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[4, 4, 4, 4, 4, 4, 4, 4], 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022273", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[75.0, 76.0, 77.0, 78.6, 80.0]", "output": "77.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_354_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022274", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "836", "output": "{1, 418, 2, 836, 4, 38, 11, 76, 44, 209, 19, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt835", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022275", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[2, 3, 1, 3, 9]", "output": "[2, 3, 1, 3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022276", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8921", "output": "{1, 11, 8921, 811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8920", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022277", "code": "def parse(data):\n    key_start = data.find(':') + 2  # Find the start index of the key\n    key_end = data.find('=', key_start)  # Find the end index of the key\n    key = data[key_start:key_end].strip()  # Extract and strip the key\n    value_start = data.find('\"', key_end) + 1  # Find the start index of the value\n    value_end = data.rfind('\"')  # Find the end index of the value\n    value = data[value_start:value_end]  # Extract the value\n    # Unescape the escaped characters in the value\n    value = value.replace('\\\\\"', '\"').replace('\\\\\\\\', '\\\\')\n    return {key: [value]}  # Return the key-value pair as a dictionary\n", "entry_point": "parse", "input": "'Some Random Text: s = \"{do}\" More Random Text'", "output": "{'s': ['{do}']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85764_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022278", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "132", "output": "(True, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022279", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{ap{ae,}'", "output": "['ap{ae', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022280", "code": "def maximize_score(deck):\n    take = skip = 0\n    for card in deck:\n        new_take = skip + card\n        new_skip = max(take, skip)\n        take, skip = new_take, new_skip\n    return max(take, skip)\n", "entry_point": "maximize_score", "input": "[10]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91144_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022281", "code": "def closest_three_sum(nums, target):\n    nums.sort()\n    closest_sum = float('inf')\n    closest_diff = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            current_diff = abs(current_sum - target)\n            if current_diff < closest_diff:\n                closest_sum = current_sum\n                closest_diff = current_diff\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return current_sum\n    return closest_sum\n", "entry_point": "closest_three_sum", "input": "[-10, -3, -2, -1, 0], -6", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34495_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022282", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(2, 1, 0, 1, 2, -1, 4, -1)", "output": "'(2.1.0.1.2.-1.4.-1)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022283", "code": "def group_notifications_by_type(notifications):\n    grouped_notifications = {}\n    for notification in notifications:\n        notification_type = notification.get('type')\n        if notification_type not in grouped_notifications:\n            grouped_notifications[notification_type] = []\n        grouped_notifications[notification_type].append(notification)\n    return grouped_notifications\n", "entry_point": "group_notifications_by_type", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "{None: [{}, {}, {}, {}, {}, {}, {}, {}]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74702_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022284", "code": "def fill_gaps(input_array):\n    def get_neighbors_avg(row, col):\n        neighbors = []\n        for r, c in [(row-1, col), (row+1, col), (row, col-1), (row, col+1)]:\n            if 0 <= r < len(input_array) and 0 <= c < len(input_array[0]) and input_array[r][c] != 'GAP':\n                neighbors.append(input_array[r][c])\n        return sum(neighbors) / len(neighbors) if neighbors else 0\n    output_array = [row[:] for row in input_array]  # Create a copy of the input array\n    for i in range(len(input_array)):\n        for j in range(len(input_array[0])):\n            if input_array[i][j] == 'GAP':\n                output_array[i][j] = get_neighbors_avg(i, j)\n    return output_array\n", "entry_point": "fill_gaps", "input": "[[], [], [], [], [], [], [], []]", "output": "[[], [], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131580_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022285", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5651", "output": "{1, 5651}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5650", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022286", "code": "def format_title_version(title: str, version: tuple) -> str:\n    version_str = \".\".join(map(str, version))\n    formatted_str = f'\"{title}\" version: {version_str}'\n    return formatted_str\n", "entry_point": "format_title_version", "input": "'Tesselo', (2, 4, 3, -1, 5, 3, 3, 4)", "output": "'\"Tesselo\" version: 2.4.3.-1.5.3.3.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31803_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022287", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[3, 3, 4, 5, -1, 0, 2, 1, 1]", "output": "[3, 4, 5, -1, 0, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022288", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'fghfgh', 3", "output": "'ijkijk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65928_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022289", "code": "def calculate_average(scores):\n    total = 0\n    for score in scores:\n        total += score\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[86.6, 86.6, 86.6, 86.6]", "output": "86.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3587_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022290", "code": "def replace_file_type(file_name, new_type):\n    \"\"\"\n    Replaces the file type extension of a given file name with a new type.\n    :param file_name: Original file name with extension\n    :param new_type: New file type extension\n    :return: Modified file name with updated extension\n    \"\"\"\n    file_name_parts = file_name.split(\".\")\n    if len(file_name_parts) > 1:  # Ensure there is a file extension to replace\n        file_name_parts[-1] = new_type  # Replace the last part (file extension) with the new type\n        return \".\".join(file_name_parts)  # Join the parts back together with \".\"\n    else:\n        return file_name  # Return the original file name if no extension found\n", "entry_point": "replace_file_type", "input": "'docut.txt', 'ppp'", "output": "'docut.ppp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41247_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022291", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "337", "output": "{337, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022292", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'1.7.1'", "output": "(1, 7, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022293", "code": "def calculate_moving_average(prices, window_size):\n    moving_averages = []\n    for i in range(window_size - 1, len(prices)):\n        average = sum(prices[i - window_size + 1:i + 1]) / window_size\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[64.0, 64.0, 64.0, 64.0], 4", "output": "[64.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42913_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5254", "output": "{1, 2, 2627, 37, 5254, 71, 74, 142}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5253", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022295", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[10, 11, 12, 13, 14], 13", "output": "[14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022296", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[4, 2, 3, 0, 5, 5, 5, 2, 5]", "output": "[4, 6, 9, 9, 14, 19, 24, 26, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022297", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'12.5.1'", "output": "(12, 5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022298", "code": "def calculate_total_score(miniatures, SIMPLE_MAX_PIXEL_DISTANCE):\n    total_score = 0\n    for miniature in miniatures:\n        width = miniature['width']\n        height = miniature['height']\n        maximum_distance_score = SIMPLE_MAX_PIXEL_DISTANCE * width * height\n        score = abs(width * height - maximum_distance_score)\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[{'width': 10, 'height': 10}], 1.5", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42215_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022299", "code": "def generate_attack_params(param_names):\n    attack_params_dict = {}\n    for param_name in param_names:\n        attack_params_dict[param_name] = None\n    return attack_params_dict\n", "entry_point": "generate_attack_params", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78247_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022300", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'lfille', 'This is a test description without the keyword.'", "output": "('lfille', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "410", "output": "{1, 2, 5, 41, 10, 205, 82, 410}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt409", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022302", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 2, 4, 3, 0, -1, 1, 2, 0]", "output": "[2, 3, 6, 6, 4, 4, 7, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022303", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[26, 20, 10, 10, 9, 15, 26, 26], 7", "output": "[26, 26, 26, 20, 15, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022304", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coeff in coefficients[::-1]:\n        result = result * x + coeff\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[1, 2], 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110926_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022305", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "50, 25", "output": "126410606437752", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt996", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1285", "output": "{1, 5, 1285, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022307", "code": "from typing import List\ndef count_elements_not_in_d(b: List[int], d: List[int]) -> int:\n    set_b = set(b)\n    set_d = set(d)\n    return len(set_b.difference(set_d))\n", "entry_point": "count_elements_not_in_d", "input": "[3, 4, 5], [1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83668_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6539", "output": "{1, 6539, 13, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022309", "code": "def find_runner_up(scores):\n    highest_score = float('-inf')\n    runner_up = float('-inf')\n    for score in scores:\n        if score > highest_score:\n            runner_up = highest_score\n            highest_score = score\n        elif score > runner_up and score != highest_score:\n            runner_up = score\n    return runner_up\n", "entry_point": "find_runner_up", "input": "[7, 6, 6, 5]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109289_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022310", "code": "def calculate_sum(*args):\n    total_sum = 0\n    print('Tuple: {}'.format(args))\n    for num in args:\n        total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3091_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022311", "code": "def resolve_coreferences(text):\n    pronouns = {'he': 'Tom', 'she': 'Jane', 'his': 'Tom\\'s', 'hers': 'Jane\\'s', 'its': 'the', 'it': 'the'}\n    words = text.split()\n    resolved_text = []\n    for word in words:\n        resolved_word = pronouns.get(word.lower(), word)\n        resolved_text.append(resolved_word)\n    return ' '.join(resolved_text)\n", "entry_point": "resolve_coreferences", "input": "'and'", "output": "'and'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58723_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022312", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "2.0, -1.7208639472984182", "output": "-3.4417278945968364", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022313", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9655", "output": "{1, 1931, 5, 9655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9654", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022314", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'exeh'", "output": "'exeh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022315", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 60]", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50473_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022316", "code": "from datetime import datetime\ndef calculate_date_difference(date1, date2):\n    # Parse the input date strings into datetime objects\n    date1_obj = datetime.strptime(date1, '%Y-%m-%d')\n    date2_obj = datetime.strptime(date2, '%Y-%m-%d')\n    # Calculate the absolute difference in days between the two dates\n    date_difference = abs((date1_obj - date2_obj).days)\n    return date_difference\n", "entry_point": "calculate_date_difference", "input": "'2023-01-01', '2023-01-27'", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6886", "output": "{1, 2, 6886, 11, 626, 3443, 22, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022318", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1311", "output": "{1, 3, 69, 19, 437, 23, 57, 1311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022319", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 1, 1, 5, 5, 2, 4, 4]", "output": "{1: 3, 5: 2, 2: 1, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022320", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'sID:ecere'", "output": "'sID:ecere'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022321", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1083", "output": "{1, 3, 361, 19, 57, 1083}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022322", "code": "from typing import List, Tuple\ndef process_transactions(transactions: List[int]) -> Tuple[int, bool]:\n    balance = 0\n    destroy_contract = False\n    for transaction in transactions:\n        balance += transaction\n        if balance < 0:\n            destroy_contract = True\n            break\n    return balance, destroy_contract\n", "entry_point": "process_transactions", "input": "[100, -40, -4]", "output": "(56, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9357_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022323", "code": "import json\ndef update_module_values(data):\n    for item in data:\n        if isinstance(item, dict):\n            module = item.get(\"@module\", \"\")\n            if \"beep_ep\" in module:\n                item[\"@module\"] = module.replace(\"beep_ep\", \"beep\")\n    return data\n", "entry_point": "update_module_values", "input": "[{}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102332_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022324", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "3, 5", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022325", "code": "from typing import List\nfrom collections import Counter\ndef top_k_frequent_words(words: List[str], k: int) -> List[str]:\n    word_freq = Counter(words)\n    sorted_words = sorted(word_freq.items(), key=lambda x: (-x[1], x[0]))\n    return [word for word, _ in sorted_words[:k]]\n", "entry_point": "top_k_frequent_words", "input": "['apple', 'apple', 'orange', 'banana', 'grape'], 1", "output": "['apple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70412_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022326", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 8, 8, 5, 5, 5, 1]", "output": "[1, 64, 64, 125, 125, 125, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022327", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[32, 23, 23, 22, 21, 15], 5", "output": "[32, 23, 23, 22, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022328", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cbad', 'ccccbbaaadd'", "output": "'ccccbbaaadd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022329", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'AB.CDFG'", "output": "[('AB', 'CDFG')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022330", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'1.21'", "output": "'1.21.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022331", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "10, 5, 3", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022332", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 2, 5]", "output": "[2, 4, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022333", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'25 + 1.5'", "output": "26.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022334", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'data/users/55_99'", "output": "((55, 99), 'data/users')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022335", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022336", "code": "import re\nfrom collections import Counter\ndef most_common_word(s: str) -> str:\n    # Preprocess the input string\n    s = re.sub(r'[^\\w\\s]', '', s.lower())\n    # Split the string into words\n    words = s.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Find the most common word\n    most_common = max(word_freq, key=word_freq.get)\n    return most_common\n", "entry_point": "most_common_word", "input": "'heellhtoberfest heellhtoberfest hello world'", "output": "'heellhtoberfest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23655_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022337", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/tmp', 'ime.p'", "output": "'/tmp/ime.p'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022338", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'mylme'", "output": "'mylme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022339", "code": "import math\ndef download_manager(file_sizes, download_speed):\n    total_time = 0\n    file_sizes.sort(reverse=True)  # Sort file sizes in descending order\n    for size in file_sizes:\n        time_to_download = size / download_speed\n        total_time += math.ceil(time_to_download)  # Round up to nearest whole number\n    return total_time\n", "entry_point": "download_manager", "input": "[100, 95, 1], 1", "output": "196", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131368_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022340", "code": "def move_player(movements):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    player_position = [0, 0]\n    for move in movements:\n        dx, dy = directions.get(move, (0, 0))\n        new_x = player_position[0] + dx\n        new_y = player_position[1] + dy\n        if 0 <= new_x < 5 and 0 <= new_y < 5:\n            player_position[0] = new_x\n            player_position[1] = new_y\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['D', 'D', 'D', 'R']", "output": "(3, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144868_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022341", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MCMXCIV'", "output": "1994", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022342", "code": "def count_students_above_average(scores):\n    total_scores = len(scores)\n    total_sum = sum(scores)\n    average_score = total_sum / total_scores\n    count_above_average = 0\n    for score in scores:\n        if score >= average_score:\n            count_above_average += 1\n    return count_above_average\n", "entry_point": "count_students_above_average", "input": "[70, 70, 70, 70, 70, 60, 50]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84218_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022343", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[0, -1, -5, 0]", "output": "[0, 1, 5, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022344", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "6", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022345", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "74", "output": "{1, 74, 2, 37}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt73", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022346", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'atata/ayz'", "output": "'atata/ayz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022347", "code": "def extract_info(openapi_doc):\n    version_start = openapi_doc.find(\"The version of the OpenAPI document:\") + len(\"The version of the OpenAPI document:\")\n    version_end = openapi_doc.find(\"\\n\", version_start)\n    version = openapi_doc[version_start:version_end].strip()\n    contact_start = openapi_doc.find(\"Contact:\") + len(\"Contact:\")\n    contact_end = openapi_doc.find(\">\", contact_start)\n    contact_email = openapi_doc[contact_start + 1:contact_end]\n    return version, contact_email\n", "entry_point": "extract_info", "input": "'The version of the OpenAPI document:\\n\\nContact:<10tht>'", "output": "('', '10tht')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30019_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022348", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[840], 70", "output": "840", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022349", "code": "import os\nimport logging\ndef process_file(infilepath: str, outfilepath: str, output_format: str) -> str:\n    filename = os.path.basename(infilepath).split('.')[0]\n    logging.info(\"Reading fileprint... \" + infilepath)\n    output_file = f\"{outfilepath}/{filename}.{output_format}\"\n    return output_file\n", "entry_point": "process_file", "input": "'//pathto/o/pp/inpule.txt', '//pathto/o/pp', 's'", "output": "'//pathto/o/pp/inpule.s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139858_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022350", "code": "def wheel(pos):\n    if pos < 0 or pos > 255:\n        return (0, 0, 0)\n    if pos < 85:\n        return (255 - pos * 3, pos * 3, 0)\n    if pos < 170:\n        pos -= 85\n        return (0, 255 - pos * 3, pos * 3)\n    pos -= 170\n    return (pos * 3, 0, 255 - pos * 3)\n", "entry_point": "wheel", "input": "45", "output": "(120, 135, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16803_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022351", "code": "def min_energy(energies):\n    min_energy_required = 0\n    current_energy = 0\n    for energy in energies:\n        current_energy += energy\n        if current_energy < 0:\n            min_energy_required += abs(current_energy)\n            current_energy = 0\n    return min_energy_required\n", "entry_point": "min_energy", "input": "[-2, -4, 2, 0, 0]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022352", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[5.0, 7.0, 9.0], 3", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022353", "code": "from typing import List, Dict\ndef word_frequency_counter(words: List[str]) -> Dict[str, int]:\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency_counter", "input": "['apph', 'banna', 'h']", "output": "{'apph': 1, 'banna': 1, 'h': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103792_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8269", "output": "{1, 8269}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8268", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022355", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 11", "output": "72.72727272727273", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022356", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3682", "output": "{1, 3682, 2, 7, 263, 526, 14, 1841}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3681", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022357", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'k', 1", "output": "'l'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6404", "output": "{1, 2, 3202, 6404, 4, 1601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6403", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022359", "code": "def calculate_max_drawdown_ratio(stock_prices):\n    if not stock_prices:\n        return 0.0\n    peak = stock_prices[0]\n    trough = stock_prices[0]\n    max_drawdown_ratio = 0.0\n    for price in stock_prices:\n        if price > peak:\n            peak = price\n            trough = price\n        elif price < trough:\n            trough = price\n            drawdown = peak - trough\n            drawdown_ratio = drawdown / peak\n            max_drawdown_ratio = max(max_drawdown_ratio, drawdown_ratio)\n    return max_drawdown_ratio\n", "entry_point": "calculate_max_drawdown_ratio", "input": "[100, 110, 102, 105, 108]", "output": "0.07272727272727272", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79546_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022360", "code": "def removeOuterParentheses(s: str) -> str:\n    result = \"\"\n    balance = 0\n    for c in s:\n        if c == '(' and balance > 0:\n            result += c\n        if c == ')' and balance > 1:\n            result += c\n        balance += 1 if c == '(' else -1\n    return result\n", "entry_point": "removeOuterParentheses", "input": "'((()))((()))((()))'", "output": "'(())(())(())'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5654_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022361", "code": "import math\ndef calculate_total_distance(tab_3d_x, tab_3d_y, tab_3d_z):\n    total_distance = 0\n    for i in range(1, len(tab_3d_x)):\n        distance = math.sqrt((tab_3d_x[i] - tab_3d_x[i-1])**2 + (tab_3d_y[i] - tab_3d_y[i-1])**2 + (tab_3d_z[i] - tab_3d_z[i-1])**2)\n        total_distance += distance\n    return total_distance\n", "entry_point": "calculate_total_distance", "input": "[0, 4], [0, 4], [0, 4]", "output": "6.928203230275509", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146764_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022362", "code": "from typing import Tuple\ndef version_to_string(version: Tuple[int, int, int]) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "version_to_string", "input": "(1, 5, 5, 8, 9, 5, 5, 9)", "output": "'1.5.5.8.9.5.5.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5202_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022363", "code": "def find_longest_sequence(dice_rolls):\n    if not dice_rolls:\n        return 0\n    current_length = 1\n    max_length = 1\n    for i in range(1, len(dice_rolls)):\n        if dice_rolls[i] == dice_rolls[i - 1] + 1:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 1\n    return max(max_length, current_length)\n", "entry_point": "find_longest_sequence", "input": "[3, 4, 5, 6, 8]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10121_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022364", "code": "def most_accessed_memory_address(memory_addresses):\n    address_count = {}\n    for address in memory_addresses:\n        if address in address_count:\n            address_count[address] += 1\n        else:\n            address_count[address] = 1\n    max_count = max(address_count.values())\n    most_accessed_addresses = [address for address, count in address_count.items() if count == max_count]\n    return min(most_accessed_addresses)\n", "entry_point": "most_accessed_memory_address", "input": "[40, 40, 40, 41, 42]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123494_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022365", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3707", "output": "{11, 1, 3707, 337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022366", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'helloo'", "output": "'helloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022367", "code": "def merge_intervals(arr1, arr2):\n    l = min(min(arr1), min(arr2))\n    r = max(max(arr1), max(arr2))\n    return [l, r]\n", "entry_point": "merge_intervals", "input": "[0, 5], [3, 9]", "output": "[0, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98126_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022368", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'roc-auc'", "output": "'roc_auc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022369", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[10, 20, 30, 1], 61", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022370", "code": "def max_score_with_constraint(scores, K):\n    n = len(scores)\n    dp = [-1] * (n + 1)\n    dp[0] = 0\n    for i in range(1, n + 1):\n        for j in range(i):\n            if dp[j] != -1 and abs(scores[i - 1] - scores[j]) > K:\n                dp[i] = max(dp[i], dp[j] + scores[i - 1])\n    return max(dp)\n", "entry_point": "max_score_with_constraint", "input": "[10, 20, 30], 10", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22565_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4755", "output": "{1, 3, 5, 15, 1585, 4755, 951, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022372", "code": "def calculate_total_duration(p1_dur, p2_dur):\n    total_duration = sum(p1_dur) + sum(p2_dur)\n    return total_duration\n", "entry_point": "calculate_total_duration", "input": "[2.5, 1.0], [2.3, 0.0073999999999995]", "output": "5.8073999999999995", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125907_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022373", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'tthat'", "output": "'tthat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022374", "code": "def calculate_dot_product(vector1, vector2):\n    if len(vector1) != len(vector2):\n        raise ValueError(\"Input vectors must have the same length\")\n    dot_product = 0\n    for i in range(len(vector1)):\n        dot_product += vector1[i] * vector2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[3, 6], [7, 7]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022375", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[4, 2, 6, 4, -1, 4, -2, -3, 3], 17", "output": "[4, 2, 6, 4, -1, 4, -2, -3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022376", "code": "def calculate_moving_average(prices, window_size):\n    moving_averages = []\n    for i in range(window_size - 1, len(prices)):\n        average = sum(prices[i - window_size + 1:i + 1]) / window_size\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[50, 55, 60, 65, 70, 75], 3", "output": "[55.0, 60.0, 65.0, 70.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42913_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022377", "code": "def reverse_words_in_quotes(input_string: str) -> str:\n    result = \"\"\n    in_quotes = False\n    current_word = \"\"\n    for char in input_string:\n        if char == '\"':\n            if in_quotes:\n                result += current_word[::-1]\n                current_word = \"\"\n            in_quotes = not in_quotes\n            result += '\"'\n        elif in_quotes:\n            if char == ' ':\n                result += current_word[::-1] + ' '\n                current_word = \"\"\n            else:\n                current_word += char\n        else:\n            result += char\n    return result\n", "entry_point": "reverse_words_in_quotes", "input": "'\"sc\"'", "output": "'\"cs\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35334_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3377", "output": "{1, 11, 307, 3377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022379", "code": "def sum_absolute_differences(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 0, 0], [37, 0, 0, 0]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145947_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022380", "code": "from typing import List\nfrom heapq import heapify, heappop\ndef find_kth_largest(nums: List[int], k: int) -> int:\n    if not nums:\n        return None\n    # Create a max-heap by negating each element\n    heap = [-num for num in nums]\n    heapify(heap)\n    # Pop k-1 elements from the heap\n    for _ in range(k - 1):\n        heappop(heap)\n    # Return the kth largest element (negate the result)\n    return -heap[0]\n", "entry_point": "find_kth_largest", "input": "[1, 2, 3, 4, 5], 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124799_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022381", "code": "def find_earliest_available_slot(meetings, duration):\n    meetings.sort(key=lambda x: x[0])  # Sort meetings based on start time\n    last_end_time = 0\n    for start_time, end_time in meetings:\n        if start_time - last_end_time >= duration:\n            return last_end_time, start_time\n        last_end_time = max(last_end_time, end_time)\n    return None\n", "entry_point": "find_earliest_available_slot", "input": "[(9, 10)], 9", "output": "(0, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46122_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022382", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[158]", "output": "1896", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022383", "code": "def check_list_elements(input_list):\n    for element in input_list:\n        if element is None or (isinstance(element, str) and not element):\n            return True\n    return False\n", "entry_point": "check_list_elements", "input": "['valid', 42, 3.14]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36393_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022384", "code": "import re\ndef generate_unique_slug(title: str, existing_slugs: set) -> str:\n    slug = re.sub(r'[^a-zA-Z0-9]+', '-', title.lower()).strip('-')\n    if slug in existing_slugs:\n        counter = 1\n        while f\"{slug}-{counter}\" in existing_slugs:\n            counter += 1\n        slug = f\"{slug}-{counter}\"\n    return slug\n", "entry_point": "generate_unique_slug", "input": "'Wod', set()", "output": "'wod'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127352_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022385", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[4, 5, 5, 11, 3, 0, -1, -1, 4]", "output": "[11, 5, 5, 4, 4, 3, 0, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022386", "code": "def movies_byDirector_language(movies):\n    organized_movies = {}\n    for movie in movies:\n        director = movie['director']\n        language = movie['language']\n        title = movie['title']\n        if director not in organized_movies:\n            organized_movies[director] = {}\n        if language not in organized_movies[director]:\n            organized_movies[director][language] = []\n        organized_movies[director][language].append(title)\n    return organized_movies\n", "entry_point": "movies_byDirector_language", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120217_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022387", "code": "def generateParentheses(n):\n    def generateParenthesesHelper(open_count, close_count, current_pattern, result):\n        if open_count == n and close_count == n:\n            result.append(current_pattern)\n            return\n        if open_count < n:\n            generateParenthesesHelper(open_count + 1, close_count, current_pattern + '(', result)\n        if close_count < open_count:\n            generateParenthesesHelper(open_count, close_count + 1, current_pattern + ')', result)\n    result = []\n    generateParenthesesHelper(0, 0, '', result)\n    return result\n", "entry_point": "generateParentheses", "input": "2", "output": "['(())', '()()']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74608_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022388", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "'Thixt.xt.xt'", "output": "'<p>Thixt.xt.xt</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022389", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'ppapat'", "output": "'Content for ppapat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022390", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'iJnyiinn'", "output": "['iJnyiinn']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022391", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7701", "output": "{1, 3, 453, 2567, 17, 51, 7701, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022392", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "8.0, 4.0", "output": "100.53096491487338", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022393", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 4.5, 1", "output": "4.95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022394", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'1.42.1.2.0', '1.5110151..2'", "output": "'1.42.1.2.0 to 1.5110151..2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022395", "code": "def generate_fibonacci(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci", "input": "1", "output": "[0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4928_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022396", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[4, 5, 4, 0, 4, 2, 6, 2]", "output": "[9, 9, 4, 4, 6, 8, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022397", "code": "from typing import List\ndef calculate_total_characters(strings: List[str]) -> int:\n    total_chars = 0\n    concatenated_string = \"\"\n    for string in strings:\n        total_chars += len(string)\n        concatenated_string += string\n    total_chars += len(concatenated_string)\n    return total_chars\n", "entry_point": "calculate_total_characters", "input": "['abcdefghij', 'klm']", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56126_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022398", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9103", "output": "{1, 9103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022399", "code": "from typing import List\ndef bubble_sort_and_count_swaps(arr: List[int]) -> int:\n    swaps = 0\n    n = len(arr)\n    for i in range(n):\n        for j in range(n - i - 1):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swaps += 1\n    return swaps\n", "entry_point": "bubble_sort_and_count_swaps", "input": "[3, 1, 2, 4]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135568_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022400", "code": "def sum_indices(matrix):\n    rows, cols = len(matrix), len(matrix[0])\n    output = [[0 for _ in range(cols)] for _ in range(rows)]\n    for i in range(rows):\n        for j in range(cols):\n            output[i][j] = i + j + matrix[i][j]\n    return output\n", "entry_point": "sum_indices", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[1, 3, 5], [5, 7, 9], [9, 11, 13]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4688_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022401", "code": "def move_zeros_to_end(list_of_numbers_as_strings):\n    non_zero_numbers = []\n    zero_numbers = []\n    for num_str in list_of_numbers_as_strings:\n        if num_str == \"0\":\n            zero_numbers.append(num_str)\n        else:\n            non_zero_numbers.append(num_str)\n    return non_zero_numbers + zero_numbers\n", "entry_point": "move_zeros_to_end", "input": "['3', '0', '5', '2', '0']", "output": "['3', '5', '2', '0', '0']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66548_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022402", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6053", "output": "{1, 6053}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022403", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "9", "output": "254016", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022404", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[55, 1, 5, 5, 2, 4, 4, 0]", "output": "([55, 1, 5, 5], [2, 4, 4, 0])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022405", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'aabeCHAIN_ID', '212345'", "output": "'aabe212345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022406", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2158", "output": "{1, 2, 166, 13, 2158, 83, 1079, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2157", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "582", "output": "{1, 2, 3, 291, 194, 582, 6, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022408", "code": "_escapes = [('a', '1'), ('b', '2'), ('c', '3')]  # Example escape rules\ndef escape_string(input_string):\n    for a, b in _escapes:\n        input_string = input_string.replace(a, b)\n    return input_string\n", "entry_point": "escape_string", "input": "'ab'", "output": "'12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9621_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022409", "code": "def find_nth_fibonacci(first, second, n):\n    if n == 1:\n        return first\n    elif n == 2:\n        return second\n    else:\n        for i in range(n - 2):\n            next_num = first + second\n            first, second = second, next_num\n        return next_num\n", "entry_point": "find_nth_fibonacci", "input": "5, 5, 3", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81618_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6103", "output": "{1, 359, 17, 6103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022411", "code": "def my_index2(l, x, default=False):\n    return l.index(x) if x in l else default\n", "entry_point": "my_index2", "input": "[], 10, default=-1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117825_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022412", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "56", "output": "'00:56'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022413", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[0, 1, 5, 1, 1, 0]", "output": "[0, 2, 7, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022414", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8006", "output": "{1, 2, 4003, 8006}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8005", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022415", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[1280, 80], 80", "output": "1360", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022416", "code": "def FindOverkerns(city_populations, kern):\n    overkern_cities = []\n    for population in city_populations:\n        if population > kern:\n            overkern_cities.append(population)\n    return overkern_cities\n", "entry_point": "FindOverkerns", "input": "[100000, 50000], 49000", "output": "[100000, 50000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82686_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022417", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[8, 4, 1, 8, 4, 8]", "output": "[1, 4, 4, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022418", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'   Hello,   '", "output": "'Hello,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022419", "code": "def get_framework_abbreviation(framework_name):\n    frameworks = {\n        'pytorch': 'PT',\n        'tensorflow': 'TF',\n        'keras': 'KS',\n        'caffe': 'CF'\n    }\n    lowercase_framework = framework_name.lower()\n    if lowercase_framework in frameworks:\n        return frameworks[lowercase_framework]\n    else:\n        return 'Unknown'\n", "entry_point": "get_framework_abbreviation", "input": "'tensorflow'", "output": "'TF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121670_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022420", "code": "def reverse_component_name(component_name: str) -> str:\n    words = component_name.split()  # Split the input string into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of the words and join them back\n    return reversed_words\n", "entry_point": "reverse_component_name", "input": "'KEF'", "output": "'KEF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55237_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8679", "output": "{1, 33, 3, 8679, 263, 11, 2893, 789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022422", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[85, 87, 87, 91, 91, 91, 83, 86, 86]", "output": "{85: 1, 87: 2, 91: 3, 83: 1, 86: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022423", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "50, 22, 5", "output": "5500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022424", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "12343", "output": "'0000000000003037'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022425", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "24.0", "output": "297.15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022426", "code": "from typing import List\ndef latest_version(versions: List[str]) -> str:\n    latest_version = versions[0]\n    for version in versions[1:]:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['1.0.0', '1.1.4', '1.1.5']", "output": "'1.1.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138257_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022427", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'1.31.1', \"'KeyKyeyey'\"", "output": "(1, 31, 1, 'KeyKyeyey')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022428", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'njhnnnmy_fahje'", "output": "'njhnnnmy_fahje'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022429", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[6604], 1", "output": "6604", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022430", "code": "def generate_error_endpoint(blueprint_name, url_prefix):\n    # Concatenate the URL prefix with the blueprint name to form the complete API endpoint URL\n    api_endpoint = f\"{url_prefix}/{blueprint_name}\"\n    return api_endpoint\n", "entry_point": "generate_error_endpoint", "input": "'rror', '/apiss'", "output": "'/apiss/rror'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69413_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022431", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "3, 38, 41", "output": "13121000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022432", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[2, 4, 2, 1, 2, 2, 2]", "output": "[6, 6, 3, 3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112873_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022433", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum_result = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum_result)\n    return output_list\n", "entry_point": "circular_sum", "input": "[7, 3, 8, 2, 7, 3, 4, 9]", "output": "[10, 11, 10, 9, 10, 7, 13, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60286_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022434", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else []\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "calculate_top_players_average", "input": "[100, 95, 90, 90, 78], 5", "output": "90.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30456_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022435", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022436", "code": "import re\ndef process_text(text):\n    re_check = re.compile(r\"^[a-z0-9_]+$\")\n    re_newlines = re.compile(r\"[\\r\\n\\x0b]+\")\n    re_multiplespaces = re.compile(r\"\\s{2,}\")\n    re_remindertext = re.compile(r\"( *)\\([^()]*\\)( *)\")\n    re_minuses = re.compile(r\"(?:^|(?<=[\\s/]))[-\\u2013](?=[\\dXY])\")\n    # Remove leading and trailing whitespace\n    text = text.strip()\n    # Replace multiple spaces with a single space\n    text = re_multiplespaces.sub(' ', text)\n    # Remove text enclosed within parentheses\n    text = re_remindertext.sub('', text)\n    # Replace '-' or '\u2013' with a space based on the specified conditions\n    text = re_minuses.sub(' ', text)\n    return text\n", "entry_point": "process_text", "input": "'tet'", "output": "'tet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124316_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022437", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 10, 20, 26]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022438", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "3, 4", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022439", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "4, 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022440", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0, 2, 22, 24, 60, 65, 670'", "output": "[0, 2, 22, 24, 60, 65, 670]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022441", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 1, 1, 1, 1]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022442", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 3, 5, 6, 6, 6]", "output": "[6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022443", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1154", "output": "{577, 1, 1154, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022444", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4423", "output": "{1, 4423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022445", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "12", "output": "233", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022446", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "49, 11", "output": "29135916264", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022447", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'path2'", "output": "'Content for path2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022448", "code": "def generate_bulk_index_queries(percolate_backing_index, percolate_ids):\n    bulk_queries = []\n    for percolate_id in percolate_ids:\n        bulk_query = {\n            \"index\": {\n                \"_index\": percolate_backing_index,\n                \"_id\": percolate_id\n            }\n        }\n        bulk_queries.append(bulk_query)\n    return bulk_queries\n", "entry_point": "generate_bulk_index_queries", "input": "'my_index', []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137949_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022449", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[2, -1, 5, 2, 2, 1, 1]", "output": "[2, 0, 7, 5, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022450", "code": "def fibonacci(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        fib_n = fibonacci(n-1, memo) + fibonacci(n-2, memo)\n        memo[n] = fib_n\n        return fib_n\n", "entry_point": "fibonacci", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17006_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022451", "code": "def format_toolchain_attributes(toolchain_config: dict) -> str:\n    formatted_attributes = \"Toolchain Attributes:\\n\"\n    for key, values in toolchain_config.items():\n        formatted_key = key.capitalize().replace(\"_\", \" \")\n        formatted_values = \", \".join(values)\n        formatted_attributes += f\"- {formatted_key}: {formatted_values}\\n\"\n    return formatted_attributes\n", "entry_point": "format_toolchain_attributes", "input": "{}", "output": "'Toolchain Attributes:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97896_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022452", "code": "def format_settings(settings_dict, indent_level=0):\n    formatted_settings = ''\n    for key, value in settings_dict.items():\n        if isinstance(value, dict):\n            formatted_settings += f\"{' ' * 4 * indent_level}{key}:\\n\"\n            formatted_settings += format_settings(value, indent_level + 1)\n        else:\n            formatted_value = f\"'{value}'\" if isinstance(value, str) else value\n            formatted_settings += f\"{' ' * 4 * indent_level}{key}: {formatted_value}\\n\"\n    return formatted_settings\n", "entry_point": "format_settings", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47324_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022453", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2092", "output": "{1, 2, 4, 523, 2092, 1046}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2091", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022454", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9701", "output": "{89, 1, 109, 9701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022455", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "[21, 'King', 'King', 'King']", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022456", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7114", "output": "{1, 7114, 2, 3557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7113", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022457", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "'polte'", "output": "('polte', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022458", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'worool'", "output": "'WoRoOl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022459", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[9, 9, 9, 1, 3, 3, 5, 6]", "output": "[9, 9, 9, 6, 5, 3, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022460", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5517", "output": "{1, 3, 613, 9, 5517, 1839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022461", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[7, 7, 3, 3, 3, 3]", "output": "[49, 49, 9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022462", "code": "def calculate_final_position(steps, STEP):\n    position = 0\n    for step in steps:\n        position += step * STEP\n    return position\n", "entry_point": "calculate_final_position", "input": "[972], 1", "output": "972", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52442_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022463", "code": "import errno\ndef process_socket_errors(sock_errors: dict) -> dict:\n    sockErrors = {errno.ESHUTDOWN: True,\n                  errno.ENOTCONN: True,\n                  errno.ECONNRESET: False,\n                  errno.ECONNREFUSED: False,\n                  errno.EAGAIN: False,\n                  errno.EWOULDBLOCK: False}\n    if hasattr(errno, 'EBADFD'):\n        sockErrors[errno.EBADFD] = True\n    ignore_status = {}\n    for error_code in sock_errors:\n        ignore_status[error_code] = sockErrors.get(error_code, False)\n    return ignore_status\n", "entry_point": "process_socket_errors", "input": "{77: 0, 108: 0}", "output": "{77: True, 108: True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12691_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022464", "code": "def extract_app_module(default_app_config: str) -> str:\n    parts = default_app_config.split('.')\n    app_module = '.'.join(parts[:-1])\n    return app_module\n", "entry_point": "extract_app_module", "input": "'oscarnications.apps.Comunoscar.app'", "output": "'oscarnications.apps.Comunoscar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129893_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022465", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9687", "output": "{1, 3, 3229, 9687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022466", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[1, 1, 2, 2, 3, 5]", "output": "[3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022467", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'00:00:00', '02:29:40'", "output": "8980", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022468", "code": "def isLongPressedName(name, typed):\n    idx = 0\n    for i in range(len(typed)):\n        if idx < len(name) and name[idx] == typed[i]:\n            idx += 1\n        elif i == 0 or typed[i] != typed[i-1]:\n            return False\n    return idx == len(name)\n", "entry_point": "isLongPressedName", "input": "'alex', 'aalexx'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105526_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022469", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[4, 5, 1, 2, 1, 5, 5, 5]", "output": "[1, 1, 2, 4, 5, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022470", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[4, 3, 6, 5, 4, 1, 3, 4, 4], 4", "output": "[3, 6, 5, 1, 3, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022471", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'lohello'", "output": "{'lohello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022472", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[20, 20, 20, 20], 4", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022473", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "2", "output": "[0, 0, 0, 0, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022474", "code": "def calculate_expression(z, x, y):\n    result = (z + x) * y - z\n    return result\n", "entry_point": "calculate_expression", "input": "0, 66554561, 1", "output": "66554561", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26383_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022475", "code": "def play_card_game(deck):\n    dp_include = [0] * len(deck)\n    dp_skip = [0] * len(deck)\n    dp_include[0] = deck[0]\n    dp_skip[0] = 0 if deck[0] % 3 == 0 else deck[0]\n    for i in range(1, len(deck)):\n        dp_include[i] = max(dp_skip[i-1] + deck[i], dp_include[i-1])\n        dp_skip[i] = max(dp_include[i-1] if deck[i] % 3 != 0 else 0, dp_skip[i-1])\n    return max(dp_include[-1], dp_skip[-1])\n", "entry_point": "play_card_game", "input": "[10, 5, 15, 3, 2]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50885_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022476", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(0.0, -1.4, 0, -1, 0, 0, 0)", "output": "'(0.0.-1.4.0.-1.0.0.0)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8633", "output": "{89, 1, 8633, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8632", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7501", "output": "{577, 1, 13, 7501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022479", "code": "def replace_non_bmp_chars(input_string: str, replacement_char: str) -> str:\n    return ''.join(replacement_char if ord(char) > 0xFFFF else char for char in input_string)\n", "entry_point": "replace_non_bmp_chars", "input": "'Hellooo,', ''", "output": "'Hellooo,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91568_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022480", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "77, 'codc.py'", "output": "'77_codc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5019", "output": "{1, 3, 7, 1673, 717, 239, 21, 5019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022482", "code": "def min_points_to_cover_intervals(intervals):\n    start = []\n    end = []\n    for i in intervals:\n        start.append(i[0])\n        end.append(i[1])\n    start.sort()\n    end.sort()\n    num = 0\n    s = e = 0\n    while s < len(start):\n        if start[s] >= end[e]:\n            e += 1\n        else:\n            num += 1\n        s += 1\n    return num\n", "entry_point": "min_points_to_cover_intervals", "input": "[(1, 3), (2, 4), (3, 5)]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30906_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022483", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "'Berlin', 12343", "output": "'https://www.fitx.de/fitnessstudios/12343'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022484", "code": "from typing import List\ndef find_disabled_com_ports(available_ports: List[str], enabled_ports: List[str]) -> List[str]:\n    disabled_ports = [port for port in available_ports if port not in enabled_ports]\n    return disabled_ports\n", "entry_point": "find_disabled_com_ports", "input": "['COM1', 'COM2', 'COM3', 'COM4'], ['COM2', 'COM4']", "output": "['COM1', 'COM3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14007_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022485", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'datsrapea.'", "output": "['datsrapea']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5153", "output": "{1, 5153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022487", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6541", "output": "{1, 211, 6541, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022488", "code": "def stringify_unique_list(input_list):\n    unique_elements = set()\n    for element in input_list:\n        unique_elements.add(element)\n    unique_list = list(unique_elements)\n    unique_list.sort()  # Sort the list if order matters\n    return '-'.join(map(str, unique_list))\n", "entry_point": "stringify_unique_list", "input": "[5, 3, 1, 4, 2]", "output": "'1-2-3-4-5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47002_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1918", "output": "{1, 2, 7, 137, 14, 274, 1918, 959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1917", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022490", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9799", "output": "{1, 239, 41, 9799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022491", "code": "def format_version(version_str: str) -> str:\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    version_integers = [int(component) for component in version_components]\n    # Format the version string as 'vX.Y.Z'\n    formatted_version = 'v' + '.'.join(map(str, version_integers))\n    return formatted_version\n", "entry_point": "format_version", "input": "'1.21.1.2.22'", "output": "'v1.21.1.2.22'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15533_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022492", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4479", "output": "{1, 3, 1493, 4479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022493", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "64, 6, 16", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9494", "output": "{1, 2, 101, 202, 4747, 47, 9494, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022495", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[0, 8, 8, 8, 8, 8, 8, 0, 0]", "output": "(48, 9, 0, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022496", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 3, 6, 12]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022497", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[[6], [2], [3, 4, 5], [6], [2]]", "output": "[6, 2, 3, 4, 5, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022498", "code": "def calculate_gpu_memory_usage(processes):\n    max_memory_usage = max(processes)\n    total_memory_usage = sum(processes)\n    return max_memory_usage, total_memory_usage\n", "entry_point": "calculate_gpu_memory_usage", "input": "[1023, 1000, 400, 137]", "output": "(1023, 2560)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48951_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022499", "code": "def generate_namespace_declaration(namespace_uri):\n    return f'xmlns:__NAMESPACE__=\"{namespace_uri}\"'\n", "entry_point": "generate_namespace_declaration", "input": "'heph'", "output": "'xmlns:__NAMESPACE__=\"heph\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127509_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022500", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[5, 6, 8, 9, 10]", "output": "[10, 12, 16, 18, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022501", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'Usaccessrter'", "output": "'Usaccessrter'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022502", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'im'", "output": "('im', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022503", "code": "def binary_search(target, lst):\n    low = 0\n    high = len(lst) - 1\n    while low <= high:\n        mid = (low + high) // 2\n        if lst[mid] == target:\n            return mid\n        elif lst[mid] < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return low\n", "entry_point": "binary_search", "input": "-1, [0, 1, 2, 3]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43298_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022504", "code": "def assign_grades(scores):\n    result_list = []\n    for score in scores:\n        if score >= 90:\n            result_list.append('A')\n        elif score >= 80:\n            result_list.append('B')\n        elif score >= 70:\n            result_list.append('C')\n        elif score >= 60:\n            result_list.append('D')\n        else:\n            result_list.append('F')\n    return result_list\n", "entry_point": "assign_grades", "input": "[90, 65, 85, 82, 81, 89]", "output": "['A', 'D', 'B', 'B', 'B', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90074_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022505", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8108", "output": "{1, 2, 4, 2027, 8108, 4054}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8107", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022506", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 3, 0, 4, 0, 3, -1, 3]", "output": "[3, 0, 12, 0, 15, -6, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022507", "code": "def max_subarray_sum(nums):\n    max_sum = nums[0]  # Initialize max_sum with the first element\n    current_sum = nums[0]  # Initialize current_sum with the first element\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[-6]", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22742_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022508", "code": "def find_empty_settings(settings_dict):\n    empty_keys = []\n    for key, value in settings_dict.items():\n        if value == '':\n            empty_keys.append(key)\n    return empty_keys\n", "entry_point": "find_empty_settings", "input": "{'key1': 'value1', 'key2': 'value2'}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75722_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022509", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4827", "output": "{3, 1, 1609, 4827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "687", "output": "{1, 3, 229, 687}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt686", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022511", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "93", "output": "{50: 1, 20: 2, 10: 0, 1: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022512", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'Alis'", "output": "'AlisEuroPython'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022513", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8639", "output": "{1, 163, 53, 8639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022514", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6691", "output": "{1, 6691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022515", "code": "def calculate_average(nums: list) -> float:\n    if len(nums) <= 1:\n        return 0\n    min_val = min(nums)\n    max_val = max(nums)\n    remaining_nums = [num for num in nums if num != min_val and num != max_val]\n    if not remaining_nums:\n        return 0\n    return sum(remaining_nums) / len(remaining_nums)\n", "entry_point": "calculate_average", "input": "[5.0, 6.0, 7.0, 7.0, 8.0]", "output": "6.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144900_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022516", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[5, 3, 5, 5, 5, 5, 5, 6]", "output": "[5, 8, 13, 18, 23, 28, 33, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022517", "code": "from typing import List\ndef maxFruits(tree: List[int]) -> int:\n    if not tree or len(tree) == 0:\n        return 0\n    left = 0\n    ans = 0\n    baskets = {}\n    for t, fruit in enumerate(tree):\n        baskets[fruit] = t\n        if len(baskets) > 2:\n            left = min(baskets.values())\n            del baskets[tree[left]]\n            left += 1\n        ans = max(ans, t - left + 1)\n    return ans\n", "entry_point": "maxFruits", "input": "[1, 2, 1, 2, 1, 2]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77640_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022518", "code": "def intersect(samples, counter=0):\n    if len(samples) == 1:\n        return samples[0]\n    a = samples[counter]\n    b = samples[counter+1:]\n    if len(b) == 1:\n        return a & b[0]\n    else:\n        counter += 1\n        return a & intersect(samples, counter)\n", "entry_point": "intersect", "input": "[{3, 4}, {1, 2, 3, 4}]", "output": "{3, 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6405_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022519", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "2.8, 1", "output": "2.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022520", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'one3seven'", "output": "137", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2437", "output": "{1, 2437}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "437", "output": "{1, 19, 437, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022523", "code": "# Constants representing baud rates\nbaud_rates = {\n    600: -1,\n    1200: 1200,\n    1800: -1,\n    2400: 2400,\n    4800: 4800,\n    9600: 9600,\n    14400: -1,\n    19200: 19200,\n    38400: 38400,\n    56000: -1,\n    57600: 57600,\n    76800: -1,\n    115200: 115200,\n    128000: -1,\n    256000: -1\n}\ndef is_valid_baud_rate(baud_rate: int) -> bool:\n    return baud_rate in baud_rates and baud_rates[baud_rate] != -1\n", "entry_point": "is_valid_baud_rate", "input": "9600", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36946_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022524", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "6", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022525", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "-5", "output": "'https://www.kaiheila.cn/api/v-5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "453", "output": "{1, 3, 453, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022527", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'woraword d'", "output": "{'woraword': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64619_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022528", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/tmp', 'image.jpg'", "output": "'/tmp/image.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022529", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documentstix'", "output": "('local', 'documentstix')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022530", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "80", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022531", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9767", "output": "{1, 9767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022532", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'foo oofff', 'foo'", "output": "'oofff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8282", "output": "{1, 2, 101, 41, 202, 4141, 82, 8282}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022534", "code": "def calculate_min_max_sum(arr):\n    total_sum = sum(arr)\n    min_sum = total_sum - max(arr)\n    max_sum = total_sum - min(arr)\n    return min_sum, max_sum\n", "entry_point": "calculate_min_max_sum", "input": "[8, 10, 12]", "output": "(18, 22)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17042_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022535", "code": "def longest_consecutive_subsequence(lst):\n    if not lst:\n        return []\n    lst.sort()\n    current_subsequence = [lst[0]]\n    longest_subsequence = []\n    for i in range(1, len(lst)):\n        if lst[i] == current_subsequence[-1] + 1:\n            current_subsequence.append(lst[i])\n        else:\n            if len(current_subsequence) > len(longest_subsequence):\n                longest_subsequence = current_subsequence\n            current_subsequence = [lst[i]]\n    if len(current_subsequence) > len(longest_subsequence):\n        longest_subsequence = current_subsequence\n    return longest_subsequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[6, 7, 8, 100]", "output": "[6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16310_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1805", "output": "{1, 5, 361, 1805, 19, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1804", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022537", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 2, 2, 2, 8, 10, 1, 3, 3]", "output": "([2, 2, 2, 2, 8, 10], [1, 3, 3])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022538", "code": "def evaluate_expression(expression: str) -> int:\n    def evaluate_helper(tokens):\n        stack = []\n        for token in tokens:\n            if token == '(':\n                stack.append('(')\n            elif token == ')':\n                sub_expr = []\n                while stack[-1] != '(':\n                    sub_expr.insert(0, stack.pop())\n                stack.pop()  # Remove '('\n                stack.append(evaluate_stack(sub_expr))\n            else:\n                stack.append(token)\n        return evaluate_stack(stack)\n    def evaluate_stack(stack):\n        operators = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y}\n        res = int(stack.pop(0))\n        while stack:\n            operator = stack.pop(0)\n            operand = int(stack.pop(0))\n            res = operators[operator](res, operand)\n        return res\n    tokens = expression.replace('(', ' ( ').replace(')', ' ) ').split()\n    return evaluate_helper(tokens)\n", "entry_point": "evaluate_expression", "input": "'100 + 100 + 100 + 33'", "output": "333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122820_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022539", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[0, 0, 0, 0, 0]", "output": "{0: 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022540", "code": "def max_product_of_two(nums):\n    if len(nums) < 2:\n        return 0\n    max_product = float('-inf')\n    second_max_product = float('-inf')\n    for num in nums:\n        if num > max_product:\n            second_max_product = max_product\n            max_product = num\n        elif num > second_max_product:\n            second_max_product = num\n    return max_product * second_max_product if max_product != float('-inf') and second_max_product != float('-inf') else 0\n", "entry_point": "max_product_of_two", "input": "[3, 4]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103728_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3347", "output": "{1, 3347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6452", "output": "{1, 2, 4, 1613, 6452, 3226}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6451", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022543", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[1, 4, 2, 3, 4, 1, 3, 0]", "output": "[1, 5, 6, 5, 7, 5, 4, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022544", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 2, 4, 5, 3, 4]", "output": "[7, 6, 6, 9, 8, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125440_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6410", "output": "{1, 2, 1282, 641, 5, 3205, 6410, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6409", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022546", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        if i == 0:\n            result.append(lst[i] + lst[i+1])\n        elif i == len(lst) - 1:\n            result.append(lst[i-1] + lst[i])\n        else:\n            result.append(lst[i-1] + lst[i] + lst[i+1])\n    return result\n", "entry_point": "process_list", "input": "[5, 3, 3, 5, 2, 4, 5, -1]", "output": "[8, 11, 11, 10, 11, 11, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145647_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022547", "code": "def calculate_string_difference(str1, str2):\n    len1, len2 = len(str1), len(str2)\n    max_len = max(len1, len2)\n    diff_count = 0\n    for i in range(max_len):\n        char1 = str1[i] if i < len1 else None\n        char2 = str2[i] if i < len2 else None\n        if char1 != char2:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_string_difference", "input": "'abcdefgh', 'ijklmnoq'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32682_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022548", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9428", "output": "{1, 2, 4, 4714, 9428, 2357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9427", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022549", "code": "import re\nREGEX_SPLITTER = \"([sS]?\\\\d+?\\\\s?[eExX-]\\\\d+)\"\nREGEX_EPISODE_SPLITTER = \"[sS]?(\\\\d+?)\\\\s?[eExX-](\\\\d+)\"\nREGEX_CLEANER = \"[^a-zA-Z0-9]+$\"\ndef extract_metadata(filename):\n    metadata = {}\n    # Extract show name, season number, and episode number using regular expressions\n    match = re.search(REGEX_SPLITTER, filename)\n    if match:\n        episode_match = re.search(REGEX_EPISODE_SPLITTER, match.group())\n        if episode_match:\n            metadata[\"show\"] = filename[:match.start()].strip().replace(\".\", \" \")\n            metadata[\"season\"] = int(episode_match.group(1))\n            metadata[\"episode\"] = int(episode_match.group(2))\n    return metadata\n", "entry_point": "extract_metadata", "input": "'3pFriends S1E3.mkv'", "output": "{'show': '3pFriends', 'season': 1, 'episode': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124325_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022550", "code": "def compress_string(input_string):\n    if not input_string:\n        return \"\"\n    compressed_string = \"\"\n    current_char = input_string[0]\n    char_count = 1\n    for i in range(1, len(input_string)):\n        if input_string[i] == current_char:\n            char_count += 1\n        else:\n            compressed_string += current_char + str(char_count)\n            current_char = input_string[i]\n            char_count = 1\n    compressed_string += current_char + str(char_count)\n    return compressed_string\n", "entry_point": "compress_string", "input": "'cccccccd'", "output": "'c7d1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107828_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022551", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{5: []}, 5", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4597", "output": "{1, 4597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022553", "code": "def _lik_formulae(lik):\n    lik_formulas = {\n        \"bernoulli\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"probit\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=\u03a6(x)\\n\",\n        \"binomial\": \" for y\u1d62 ~ Binom(\u03bc\u1d62=g(z\u1d62), n\u1d62) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"poisson\": \" for y\u1d62 ~ Poisson(\u03bb\u1d62=g(z\u1d62)) and g(x)=e\u02e3\\n\"\n    }\n    return lik_formulas.get(lik, \"\\n\")\n", "entry_point": "_lik_formulae", "input": "'poisson'", "output": "' for y\u1d62 ~ Poisson(\u03bb\u1d62=g(z\u1d62)) and g(x)=e\u02e3\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106790_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6671", "output": "{1, 953, 7, 6671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022555", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'00:02:30'", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022556", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[72, 72, 72, 72, 72]", "output": "72.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022557", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[3, 4, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022558", "code": "def count_price_crossings(stock_prices, target_price):\n    crossings = 0\n    for i in range(1, len(stock_prices)):\n        if (stock_prices[i] >= target_price and stock_prices[i - 1] < target_price) or \\\n           (stock_prices[i] < target_price and stock_prices[i - 1] >= target_price):\n            crossings += 1\n    return crossings\n", "entry_point": "count_price_crossings", "input": "[99, 101, 102, 98], 100", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022559", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 1, 2, 4, 1, 7, 1]", "output": "[2, 3, 6, 5, 8, 8, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022560", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[2, 3, 1, 4, 5, 2, 1, 4, 2]", "output": "[1, 1, 2, 2, 2, 3, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7907", "output": "{1, 7907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022562", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'RRRRD'", "output": "(4, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7481", "output": "{1, 7481}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022564", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "-125", "output": "-521", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022565", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 50, 60, 70]", "output": "[1, 2, 3, 4, 5, 5, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022566", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    unique_index = 0\n    for i in range(1, len(nums)):\n        if nums[i] != nums[unique_index]:\n            unique_index += 1\n            nums[unique_index] = nums[i]\n    return unique_index + 1\n", "entry_point": "remove_duplicates", "input": "[1, 1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58114_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022567", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[78, 77, 79, 76, 75, 78]", "output": "77.16666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21931_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022568", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3189", "output": "{1, 3, 3189, 1063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022569", "code": "def num_decodings(sequence):\n    N = len(sequence)\n    dp = [0] * (N + 1)\n    dp[0] = 1\n    dp[1] = 1\n    for i in range(2, N + 1):\n        if sequence[i - 1] == 0:\n            if sequence[i - 2] == 1 or sequence[i - 2] == 2:\n                dp[i] = dp[i - 2]\n            else:\n                return 0\n        elif 1 <= sequence[i - 1] <= 9:\n            dp[i] = dp[i - 1]\n        elif sequence[i - 1] == 1 or (sequence[i - 1] == 2 and sequence[i - 2] == 0):\n            dp[i] = dp[i - 1]\n        elif 10 <= sequence[i - 2] * 10 + sequence[i - 1] <= 26:\n            dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "num_decodings", "input": "[3, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62866_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022570", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6266", "output": "{1, 2, 482, 26, 13, 241, 6266, 3133}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4839", "output": "{1, 3, 1613, 4839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022572", "code": "def format_ranges(lst):\n    formatted_ranges = []\n    start = end = lst[0]\n    for i in range(1, len(lst)):\n        if lst[i] == end + 1:\n            end = lst[i]\n        else:\n            if end - start >= 2:\n                formatted_ranges.append(f\"{start}-{end}\")\n            else:\n                formatted_ranges.extend(str(num) for num in range(start, end + 1))\n            start = end = lst[i]\n    if end - start >= 2:\n        formatted_ranges.append(f\"{start}-{end}\")\n    else:\n        formatted_ranges.extend(str(num) for num in range(start, end + 1))\n    return ','.join(map(str, formatted_ranges))\n", "entry_point": "format_ranges", "input": "[0, 3, -2, 0, 13, 8, -6, 0]", "output": "'0,3,-2,0,13,8,-6,0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111612_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022573", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[34, 11, 64, 22, 90, 12, 25]", "output": "[11, 12, 22, 25, 34, 64, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022574", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7762", "output": "{1, 7762, 2, 3881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7761", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022575", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'RDEADBEEF'", "output": "'DEADBEEF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022576", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'amz'", "output": "'mz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "788", "output": "{1, 2, 4, 197, 394, 788}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt787", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022578", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "11", "output": "[11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022579", "code": "def character_frequency(input_string):\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "character_frequency", "input": "'hhhhhheeeelllloo'", "output": "{'h': 6, 'e': 4, 'l': 4, 'o': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6005_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022580", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3383", "output": "{1, 199, 17, 3383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022581", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3415", "output": "{1, 683, 5, 3415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022582", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'clsrcl', 'some_id'", "output": "\"Provider submodule 'clsrcl' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022583", "code": "def find_first_10_digits_sum(numbers_list):\n    # Convert strings to integers and sum them up\n    total_sum = sum(int(num) for num in numbers_list)\n    # Get the first 10 digits of the total sum\n    first_10_digits = str(total_sum)[:10]\n    return first_10_digits\n", "entry_point": "find_first_10_digits_sum", "input": "['100', '1000', '250', '18']", "output": "'1368'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7323_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022584", "code": "def sum_of_even_squares(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_even_squares", "input": "[14]", "output": "196", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59947_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022585", "code": "def max_consecutive_ones(n):\n    binary_str = bin(n)[2:]  # Convert n to binary and remove the '0b' prefix\n    max_ones = 0\n    current_ones = 0\n    for digit in binary_str:\n        if digit == '1':\n            current_ones += 1\n            max_ones = max(max_ones, current_ones)\n        else:\n            current_ones = 0\n    return max_ones\n", "entry_point": "max_consecutive_ones", "input": "7", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99433_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022586", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 3, 2, 2, 2, 1]", "output": "[3, 4, 6, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45837_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022587", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[7, 8]", "output": "[7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022588", "code": "import sys\ndef get_email_message_class(email_message_type):\n    email_message_classes = {\n        'EmailMessage': 'EmailMessage',\n        'EmailMultiAlternatives': 'EmailMultiAlternatives',\n        'MIMEImage': 'MIMEImage' if sys.version_info < (3, 0) else 'MIMEImage'\n    }\n    return email_message_classes.get(email_message_type, 'Unknown')\n", "entry_point": "get_email_message_class", "input": "'MIMEImage'", "output": "'MIMEImage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140417_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022589", "code": "def calculate_total_parameters(sa_dim, n_agents, hidden_size):\n    # Calculate parameters in the first linear layer\n    params_linear1 = (sa_dim * n_agents + 1) * hidden_size\n    # Calculate parameters in the second linear layer\n    params_linear2 = (hidden_size + 1) * hidden_size\n    # Calculate parameters in the output layer\n    params_output = hidden_size + 1\n    # Calculate total parameters in the MLP network\n    total_params = params_linear1 + params_linear2 + params_output\n    return total_params\n", "entry_point": "calculate_total_parameters", "input": "4, 31, 20", "output": "2941", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118493_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022590", "code": "def calculate_point_averages(points):\n    if not points:\n        return (0, 0)\n    sum_x = sum(point[0] for point in points)\n    sum_y = sum(point[1] for point in points)\n    avg_x = sum_x / len(points)\n    avg_y = sum_y / len(points)\n    return (avg_x, avg_y)\n", "entry_point": "calculate_point_averages", "input": "[(1, 3)]", "output": "(1.0, 3.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89551_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022591", "code": "def decode_secret_message(encoded_message, shift):\n    decoded_message = \"\"\n    for char in encoded_message:\n        if char.isalpha():\n            if char.islower():\n                decoded_message += chr(((ord(char) - ord('a') - shift) % 26) + ord('a'))\n            else:\n                decoded_message += chr(((ord(char) - ord('A') - shift) % 26) + ord('A'))\n        else:\n            decoded_message += char\n    return decoded_message\n", "entry_point": "decode_secret_message", "input": "'nGkGdkkn#Vnqkc', 3", "output": "'kDhDahhk#Sknhz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69063_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022592", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8104", "output": "{1, 2, 4, 8104, 8, 2026, 4052, 1013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8103", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022593", "code": "def find_starting_tokens(e):\n    starting_tokens = []\n    current_label = None\n    for i, label in enumerate(e):\n        if label != current_label:\n            starting_tokens.append(i)\n            current_label = label\n    return starting_tokens\n", "entry_point": "find_starting_tokens", "input": "[0, 1, 2, 3, 4]", "output": "[0, 1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022594", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[3, 5, 2, 4, 7]", "output": "[9, 25, 2, 4, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022595", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "41, 1", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022596", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4115", "output": "{1, 4115, 5, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022597", "code": "import re\n_VALID_URL = r'https?://(?:www\\.)?cbssports\\.com/[^/]+/(?:video|news)/(?P<id>[^/?#&]+)'\ndef extract_id_from_url(url):\n    match = re.match(_VALID_URL, url)\n    if match:\n        return match.group('id')\n    return None\n", "entry_point": "extract_id_from_url", "input": "'https://www.cbssports.com/some-team/video/12345'", "output": "'12345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143680_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022598", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[1.0, 2.75, 3.25, 2.25, 4.0]", "output": "2.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5284", "output": "{1, 2, 4, 5284, 1321, 2642}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5283", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022600", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4811", "output": "{283, 1, 4811, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022601", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6929", "output": "{1, 41, 169, 13, 6929, 533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022602", "code": "def process_cen_data(data: dict) -> str:\n    cen_id = data.get('cenId', '')\n    host_region_id = data.get('hostRegionId', '')\n    return f\"CEN ID: {cen_id}, Host Region ID: {host_region_id}\"\n", "entry_point": "process_cen_data", "input": "{}", "output": "'CEN ID: , Host Region ID: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96339_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022603", "code": "def parse_list_of_lists(all_groups_str):\n    all_groups_str = all_groups_str.strip()[1:-1]  # Remove leading and trailing square brackets\n    groups = []\n    for line in all_groups_str.split(',\\n'):\n        group = [int(val) for val in line.strip()[1:-1].split(', ')]\n        groups.append(group)\n    return groups\n", "entry_point": "parse_list_of_lists", "input": "'[[813]]'", "output": "[[813]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39140_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022604", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[5, 4, 3, 2, 1]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6461", "output": "{1, 7, 71, 91, 13, 497, 923, 6461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2086", "output": "{1, 2, 2086, 7, 298, 14, 1043, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022607", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[30, 10, 20]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022608", "code": "def password_strength_checker(password):\n    score = 0\n    # Check length of the password\n    score += len(password)\n    # Check for uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for special characters\n    special_characters = set('!@#$%^&*()_+-=[]{}|;:,.<>?')\n    if any(char in special_characters for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'aBcdEf'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26515_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022609", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1481", "output": "{1, 1481}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6206", "output": "{1, 2, 107, 214, 58, 29, 6206, 3103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022611", "code": "def remove_chucks(hebrew_word):\n    \"\"\" Hebrew numbering systems use 'chuck-chucks' (quotation\n        marks that aren't being used to signify a quotation) \n        in between letters that are meant as numerics rather \n        than words. This function removes the 'chuck-chucks' \n        from the input Hebrew word.\n        Args:\n        hebrew_word (str): A Hebrew word with 'chuck-chucks'.\n        Returns:\n        str: The Hebrew word with 'chuck-chucks' removed.\n    \"\"\"\n    chucks = ['\u05f4', '\u05f3', '\"', \"'\"]\n    for chuck in chucks:\n        while chuck in hebrew_word:\n            hebrew_word = hebrew_word.replace(chuck, '')\n    return hebrew_word\n", "entry_point": "remove_chucks", "input": "'\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9'", "output": "'\u05e9\u05e9\u05e9\u05e9\u05e9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31435_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022612", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4899", "output": "{1, 1633, 3, 4899, 69, 71, 213, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022613", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'Hello1233!'", "output": "'Hello1233'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022614", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[72]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022615", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6777", "output": "{1, 3, 9, 251, 753, 2259, 6777, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022616", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, -2, 4, -3, 1, -3]", "output": "[-2, 2, 1, -2, -2, -3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54598_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022617", "code": "def combination_sum(candidates, target):\n    result = []\n    def backtrack(current_combination, start_index, remaining_target):\n        if remaining_target == 0:\n            result.append(current_combination[:])\n            return\n        for i in range(start_index, len(candidates)):\n            if candidates[i] <= remaining_target:\n                current_combination.append(candidates[i])\n                backtrack(current_combination, i, remaining_target - candidates[i])\n                current_combination.pop()\n    backtrack([], 0, target)\n    return result\n", "entry_point": "combination_sum", "input": "[4], 4", "output": "[[4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34241_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8759", "output": "{1, 19, 461, 8759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022619", "code": "def custom_sort(num):\n    evens = sorted([x for x in num if x % 2 == 0], reverse=True)\n    odds = sorted([x for x in num if x % 2 != 0])\n    return evens + odds\n", "entry_point": "custom_sort", "input": "[8, 4, 0, 1, 5, 5, 5, 7]", "output": "[8, 4, 0, 1, 5, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84472_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022620", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[4]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022621", "code": "from typing import List\ndef contains_duplicate(nums: List[int]) -> bool:\n    return len(nums) != len(set(nums))\n", "entry_point": "contains_duplicate", "input": "[1, 2, 3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64587_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022622", "code": "from typing import List\ndef calculate_total_size(file_paths: List[str]) -> int:\n    total_size = 0\n    for path in file_paths:\n        if path.endswith('/'):\n            directory_files = [f for f in file_paths if f.startswith(path) and f != path]\n            total_size += calculate_total_size(directory_files)\n        else:\n            total_size += int(path.split('_')[-1].split('.')[0])  # Extract size from file path\n    return total_size\n", "entry_point": "calculate_total_size", "input": "['file1_5.txt', 'file2_10.txt']", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17322_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022623", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9309", "output": "{1, 321, 3, 107, 9309, 87, 29, 3103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022624", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5869", "output": "{1, 5869}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5868", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022625", "code": "def control_flow_replica(x):\n    if x < 0:\n        if x < -10:\n            return x * 2\n        else:\n            return x * 3\n    else:\n        if x > 10:\n            return x * 4\n        else:\n            return x * 5\n", "entry_point": "control_flow_replica", "input": "2", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17276_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022626", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 5, 4, 5]", "output": "[4, 125, 16, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022627", "code": "import re\ndef lexer(text):\n    tokens = []\n    rules = [\n        (r'if|else|while|for', 'keyword'),\n        (r'[a-zA-Z][a-zA-Z0-9]*', 'identifier'),\n        (r'\\d+', 'number'),\n        (r'[+\\-*/]', 'operator')\n    ]\n    for rule in rules:\n        pattern, token_type = rule\n        for token in re.findall(pattern, text):\n            tokens.append((token, token_type))\n    return tokens\n", "entry_point": "lexer", "input": "'1010'", "output": "[('1010', 'number')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24727_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022628", "code": "def max_box_area(heights):\n    max_area = 0\n    left, right = 0, len(heights) - 1\n    while left < right:\n        width = right - left\n        min_height = min(heights[left], heights[right])\n        area = width * min_height\n        max_area = max(max_area, area)\n        if heights[left] < heights[right]:\n            left += 1\n        else:\n            right -= 1\n    return max_area\n", "entry_point": "max_box_area", "input": "[4, 10, 6, 8, 5, 7]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135677_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022629", "code": "def process_integers(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 2 != 0:\n            result.append(num ** 3)\n        if num % 3 == 0:\n            result.append(num + 10)\n    return result\n", "entry_point": "process_integers", "input": "[-1, 3, 2, 8]", "output": "[-1, 27, 13, 4, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34954_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022630", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            new_pos = ord(char) + shift\n            if new_pos > ord('z'):\n                new_pos = new_pos - 26  # Wrap around the alphabet\n            encrypted_text += chr(new_pos)\n        else:\n            encrypted_text += char  # Keep non-letter characters unchanged\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'okhoor', 2", "output": "'qmjqqt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55105_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "250", "output": "{1, 2, 5, 10, 50, 25, 250, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt249", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022632", "code": "def maxScore(nums):\n    n = len(nums)\n    dp = [[0] * n for _ in range(n)]\n    for i in range(n):\n        dp[i][i] = nums[i]\n    for length in range(2, n + 1):\n        for i in range(n - length + 1):\n            j = i + length - 1\n            dp[i][j] = max(nums[i] - dp[i + 1][j], nums[j] - dp[i][j - 1])\n    return dp[0][n - 1]\n", "entry_point": "maxScore", "input": "[1, 1, 1, 1, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80788_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022633", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 4, 0, 3]", "output": "[4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7981", "output": "{1, 347, 7981, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022635", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[16, 6, 8]", "output": "768", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022636", "code": "def find_divisible_sum(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "find_divisible_sum", "input": "[15, 15]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147524_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022637", "code": "def max_distance(red_points, blue_points):\n    max_sum = 0\n    for red in red_points:\n        for blue in blue_points:\n            distance = abs(red - blue)\n            max_sum = max(max_sum, distance)\n    return max_sum\n", "entry_point": "max_distance", "input": "[0, 9], [0]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25133_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022638", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5001", "output": "{1, 5001, 3, 1667}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022639", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5885", "output": "{1, 5, 11, 107, 55, 535, 1177, 5885}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022640", "code": "from urllib.parse import urlparse\ndef transform_text(input_text):\n    def xml_escape(string):\n        return string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\"', '&quot;').replace(\"'\", '&apos;')\n    def static_url(url):\n        static_bucket_url = \"https://example.com/static/\"  # Example static bucket URL\n        relative_path = urlparse(url).path.split('/', 3)[-1]  # Extract relative path\n        return f\"{static_bucket_url}{relative_path}\"\n    escaped_text = xml_escape(input_text)\n    static_url_text = static_url(input_text)\n    return f\"{escaped_text} {static_url_text}\"\n", "entry_point": "transform_text", "input": "'a'", "output": "'a https://example.com/static/a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43461_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022641", "code": "def find_second_largest(x, y, z):\n    # Find the minimum, maximum, and sum of the three numbers\n    minimum = min(x, y, z)\n    maximum = max(x, y, z)\n    total = x + y + z\n    # Calculate the second largest number\n    second_largest = total - minimum - maximum\n    return second_largest\n", "entry_point": "find_second_largest", "input": "1, 2, 3", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77878_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022642", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8563", "output": "{1, 8563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022643", "code": "def get_release_date(version: str) -> str:\n    version_dates = {\n        \"4.5.1\": \"September 14, 2008\",\n        \"4.6.1\": \"July 30, 2009\",\n        \"4.7.1\": \"February 26, 2010\",\n        \"4.8\": \"November 26, 2010\",\n        \"4.9\": \"June 21, 2011\",\n        \"4.10\": \"March 29, 2012\",\n        \"4.11\": \"November 6, 2013\",\n        \"5.0\": \"November 24, 2014\",\n        \"5.1\": \"April 17, 2015\",\n        \"5.2\": \"March 18, 2016\",\n        \"5.3\": \"May 2, 2016\",\n        \"5.4\": \"October 22, 2016\",\n        \"5.5\": \"March 23, 2017\",\n        \"5.6\": \"September 27, 2017\",\n        \"5.7b1\": \"January 27, 2018\",\n        \"5.7b2\": \"February 12, 2018\",\n        \"5.7\": \"February 27, 2018\",\n        \"5.8 devel\": \"Version not found\"\n    }\n    return version_dates.get(version, \"Version not found\")\n", "entry_point": "get_release_date", "input": "'5.7'", "output": "'February 27, 2018'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110352_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022644", "code": "def card_war(player1, player2):\n    card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1, player2):\n        if card_values[card1] > card_values[card2]:\n            player1_wins += 1\n        elif card_values[card1] < card_values[card2]:\n            player2_wins += 1\n    if player1_wins > player2_wins:\n        return \"Player 1 wins.\"\n    elif player1_wins < player2_wins:\n        return \"Player 2 wins.\"\n    else:\n        return \"It's a tie.\"\n", "entry_point": "card_war", "input": "['2', '3', '4'], ['3', '4', '5']", "output": "'Player 2 wins.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147733_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022645", "code": "def sum_of_pairs(lst, target):\n    seen = {}\n    pair_sum = 0\n    for num in lst:\n        complement = target - num\n        if complement in seen:\n            pair_sum += num + complement\n        seen[num] = True\n    return pair_sum\n", "entry_point": "sum_of_pairs", "input": "[5, 3], 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88231_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022646", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[(1, 100), (2, 125), (3, 110)]", "output": "335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022647", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'2210.4.72'", "output": "(2210, 4, 72)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022648", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "0.028", "output": "'0.03'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022649", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[2, 7, 3, 5, 6, 4, 1, 5, 5]", "output": "[4, 343, 27, 125, 36, 16, 1, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022650", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "70", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022651", "code": "def get_earnings_color(notification_type):\n    # Define earnings notification colors and transparent PNG URL\n    EARNINGS_COLORS = {\n        \"beat\": \"20d420\",\n        \"miss\": \"d42020\",\n        \"no consensus\": \"000000\"\n    }\n    TRANSPARENT_PNG = \"https://cdn.major.io/wide-empty-transparent.png\"\n    # Return the color code based on the notification type\n    return EARNINGS_COLORS.get(notification_type.lower(), \"FFFFFF\")  # Default to white for invalid types\n", "entry_point": "get_earnings_color", "input": "'no consensus'", "output": "'000000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38125_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022652", "code": "def reverse_words_order_and_swap_cases(sentence):\n    words = sentence.split()\n    reversed_words = [word.swapcase()[::-1] for word in words]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_words_order_and_swap_cases", "input": "'Hello World'", "output": "'OLLEh DLROw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6578_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022653", "code": "def get_file_extension(file_path):\n    # Find the last occurrence of the period ('.') in the file path\n    last_period_index = file_path.rfind('.')\n    # Extract the substring starting from the last period to the end of the file path\n    if last_period_index != -1:  # Check if a period was found\n        file_extension = file_path[last_period_index:]\n        return file_extension\n    else:\n        return \"\"  # Return an empty string if no period was found\n", "entry_point": "get_file_extension", "input": "'data.csvz'", "output": "'.csvz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141157_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022654", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'4:99'", "output": "(4, 153)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1405", "output": "{1, 5, 1405, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1404", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022656", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5501", "output": "{1, 5501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5500", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022657", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hello hellhellhed'", "output": "{'hello': 1, 'hellhellhed': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2798", "output": "{1, 2, 2798, 1399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2797", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022659", "code": "def process_integers(integers, threshold):\n    modified_integers = []\n    running_sum = 0\n    for num in integers:\n        if num >= threshold:\n            num = running_sum\n            running_sum += num\n        modified_integers.append(num)\n    return modified_integers\n", "entry_point": "process_integers", "input": "[0, 0, 0, 0, 0, 0, 0, 0], 1", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83853_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022660", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, 0, 1, 1, 3, 1, 1, 1]", "output": "[1, 1, 2, 3, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022661", "code": "def extract_major_version(version):\n    dot_index = version.find('.')\n    if dot_index != -1:\n        return version[:dot_index]\n    else:\n        return version  # If no dot found, return the entire version string as major version\n", "entry_point": "extract_major_version", "input": "'2020'", "output": "'2020'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34102_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022662", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2938", "output": "{1, 2, 226, 26, 13, 113, 2938, 1469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022663", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "10", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022664", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_animation_width', 0", "output": "'\\n  .width(test_animation_width);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022665", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[circular_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 1, 0, 3, 2, 2]", "output": "[3, 1, 3, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51677_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022666", "code": "import os\ndef expand_env_variables(file_path):\n    def replace_env_var(match):\n        var_name = match.group(1)\n        return os.environ.get(var_name, f'%{var_name}%')\n    expanded_path = os.path.expandvars(file_path)\n    return expanded_path\n", "entry_point": "expand_env_variables", "input": "'%LOCALAPPDATA%\\\\spdyn-update'", "output": "'%LOCALAPPDATA%\\\\spdyn-update'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91923_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022667", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[0, 1, 2, 2, 3, 4, 4]", "output": "{0: 1, 1: 1, 2: 2, 3: 1, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022668", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1592", "output": "{1, 2, 4, 199, 8, 398, 1592, 796}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1591", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022669", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'2'", "output": "'3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022670", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        if height > prev_height:\n            total_area += height\n        else:\n            total_area += prev_height\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[2, 3, 4]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147834_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022671", "code": "def max_palindrome_length(s: str) -> int:\n    char_count = {}\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    max_length = 0\n    for count in char_count.values():\n        max_length += count if count % 2 == 0 else count - 1\n    return max_length\n", "entry_point": "max_palindrome_length", "input": "'aaaabbbb'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124507_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022672", "code": "from typing import List\ndef delete_entities(entity_list: List[int], delete_ids: List[int]) -> List[int]:\n    return [entity for entity in entity_list if entity not in delete_ids]\n", "entry_point": "delete_entities", "input": "[4, 1, 2, 3], [1, 2, 3]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62424_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8714", "output": "{1, 8714, 2, 4357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8713", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022674", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "532", "output": "{1, 2, 4, 133, 38, 7, 266, 76, 14, 19, 532, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt531", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022675", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7721", "output": "{1, 7, 1103, 7721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022676", "code": "# Define the statuses dictionary\nstatuses = {\n    1: 'Voting',\n    2: 'Innocent',\n    3: 'Guilty',\n}\n# Implement the get_status_display function\ndef get_status_display(status):\n    return statuses.get(status, 'Unknown')  # Return the status string or 'Unknown' if status code is not found\n", "entry_point": "get_status_display", "input": "3", "output": "'Guilty'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37325_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022677", "code": "def merge_sorted_arrays(arr1, arr2):\n    merged = []\n    i = j = 0\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] < arr2[j]:\n            merged.append(arr1[i])\n            i += 1\n        else:\n            merged.append(arr2[j])\n            j += 1\n    merged.extend(arr1[i:])\n    merged.extend(arr2[j:])\n    return merged\n", "entry_point": "merge_sorted_arrays", "input": "[2, 5, 5, 5, 7], [3, 5, 9, 10]", "output": "[2, 3, 5, 5, 5, 5, 7, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50645_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022678", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0  # Handle the case where there are no scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[95, 92, 90], 3", "output": "92.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44364_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022679", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8771", "output": "{1, 8771, 1253, 7, 49, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022680", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "-0.5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022681", "code": "def weighted_average(values, weights):\n    if len(values) != len(weights):\n        raise ValueError(\"Lengths of values and weights must be the same.\")\n    weighted_sum = sum(value * weight for value, weight in zip(values, weights))\n    sum_weights = sum(weights)\n    return weighted_sum / sum_weights\n", "entry_point": "weighted_average", "input": "[4, 6], [1, 1]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103808_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1799", "output": "{1, 7, 257, 1799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022683", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[9.2, 11.2]", "output": "10.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022684", "code": "def find_missing_number(L):\n    n = len(L) + 1\n    total_sum = n * (n + 1) // 2\n    list_sum = sum(L)\n    missing_number = total_sum - list_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149242_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022685", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'ABC'", "output": "{'A': 1, 'B': 1, 'C': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022686", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022687", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "182", "output": "{1, 2, 7, 13, 14, 182, 26, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022688", "code": "def find_min_max(numbers):\n    if not numbers:\n        return None\n    min_value = float('inf')\n    max_value = float('-inf')\n    for num in numbers:\n        if num < min_value:\n            min_value = num\n        if num > max_value:\n            max_value = num\n    return min_value, max_value\n", "entry_point": "find_min_max", "input": "[6, 10]", "output": "(6, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24169_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022689", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "5, 3, '+'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5663", "output": "{1, 7, 809, 5663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5662", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022691", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'sda', '1'", "output": "'sda1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022692", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7731", "output": "{1, 3, 9, 2577, 7731, 859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4471", "output": "{1, 263, 17, 4471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5962", "output": "{1, 2, 2981, 5962, 11, 271, 22, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022695", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9653", "output": "{1, 1379, 197, 7, 49, 9653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9553", "output": "{9553, 1, 233, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022697", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "70, 71", "output": "141", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022698", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "1073741824", "output": "'     1 GB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022699", "code": "def shift_token(token):\n    shift_value = len(token)\n    shifted_token = \"\"\n    for char in token:\n        shifted_char = chr(((ord(char) - ord('a') + shift_value) % 26) + ord('a'))\n        shifted_token += shifted_char\n    return shifted_token\n", "entry_point": "shift_token", "input": "'abcab'", "output": "'fghfg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47692_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022700", "code": "def count_unique_evens(lst):\n    unique_evens = set()\n    for num in lst:\n        if num % 2 == 0:\n            unique_evens.add(num)\n    return len(unique_evens)\n", "entry_point": "count_unique_evens", "input": "[2, 4, 6, 8, 10, 2, 4, 3, 9]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89922_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022701", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the period as the delimiter\n    version_parts = version_string.split('.')\n    # Convert the split parts into integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return the major, minor, and patch version numbers as a tuple\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.1120.12'", "output": "(0, 1120, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81674_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022702", "code": "from typing import List\ndef generate_directories(base_dir: str) -> List[str]:\n    subdirectories = [\"evaluation\", \"jobinfo\"]\n    return [f\"{base_dir}/{subdir}\" for subdir in subdirectories]\n", "entry_point": "generate_directories", "input": "'/mmlpr//'", "output": "['/mmlpr///evaluation', '/mmlpr///jobinfo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93666_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022703", "code": "def extract_domain(url):\n    # Remove the protocol prefix\n    url = url.replace(\"http://\", \"\").replace(\"https://\", \"\")\n    # Extract the domain name\n    domain_parts = url.split(\"/\")\n    domain = domain_parts[0]\n    # Remove subdomains\n    domain_parts = domain.split(\".\")\n    if len(domain_parts) > 2:\n        domain = \".\".join(domain_parts[-2:])\n    return domain\n", "entry_point": "extract_domain", "input": "'://anything'", "output": "':'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77353_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022704", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[63.0]", "output": "63.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022705", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[3, 5, 4, 11, 5, 7, 5, 7]", "output": "['Fizz', 'Buzz', 4, 11, 'Buzz', 7, 'Buzz', 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7017", "output": "{2339, 1, 3, 7017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022707", "code": "def is_permutation_palindrome(s: str) -> bool:\n    char_freq = {}\n    for char in s:\n        char_freq[char] = char_freq.get(char, 0) + 1\n    odd_count = 0\n    for freq in char_freq.values():\n        if freq % 2 != 0:\n            odd_count += 1\n            if odd_count > 1:\n                return False\n    return True\n", "entry_point": "is_permutation_palindrome", "input": "'aabb'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21329_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022708", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'this is a test'", "output": "['this', 'is', 'a', 'test']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022709", "code": "def calculate_kronecker_multiplications(dimensions):\n    total_multiplications = 1\n    for i in range(len(dimensions) - 1):\n        total_multiplications *= dimensions[i] * dimensions[i + 1]\n    return total_multiplications\n", "entry_point": "calculate_kronecker_multiplications", "input": "[400, 400]", "output": "160000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121015_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022710", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2447", "output": "{1, 2447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022711", "code": "def findCellValue(num, xPos, yPos):\n    a, b = (min(xPos, num-1-yPos), 1) if yPos >= xPos else (min(yPos, num-1-xPos), -1)\n    return (4*num*a - 4*a*a - 2*a + b*(xPos+yPos) + (b>>1&1)*4*(num-a-1)) % 9 + 1\n", "entry_point": "findCellValue", "input": "5, 4, 4", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17971_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022712", "code": "def calculate_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if str1[i - 1] == str2[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1\n    return dp[m][n]\n", "entry_point": "calculate_levenshtein_distance", "input": "'abcde', 'fghij'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42819_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022713", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "3, 2", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022714", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9641", "output": "{1, 9641, 311, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9640", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022715", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'ltllll'", "output": "'ltllll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022716", "code": "import math\ndef calculate_hypotenuse(side1, side2):\n    hypotenuse = math.sqrt(side1 ** 2 + side2 ** 2)\n    return hypotenuse\n", "entry_point": "calculate_hypotenuse", "input": "1, 3", "output": "3.1622776601683795", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57663_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022717", "code": "def count_emojis(input_string):\n    emoji_count = {}\n    # Split the input string into individual emojis\n    emojis = input_string.split()\n    # Count the occurrences of each unique emoji\n    for emoji in emojis:\n        if emoji in emoji_count:\n            emoji_count[emoji] += 1\n        else:\n            emoji_count[emoji] = 1\n    return emoji_count\n", "entry_point": "count_emojis", "input": "'\u2728\u2728\u2728'", "output": "{'\u2728\u2728\u2728': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128683_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022718", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "2, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022719", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8621", "output": "{1, 233, 37, 8621}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8620", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022720", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[0, 0, 0, 0], [80, 0, 0, 0]", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111620_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022721", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[-1, 5, 3, -1, 8, 9, 4, -1, 5]", "output": "[-1, -1, -1, 3, 4, 5, 5, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022722", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{-2: []}, -2", "output": "[-2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022723", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[5, 6, 5, 4, 3, 2, 2, 0, 6]", "output": "[5, 6, 4, 3, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022724", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'1.7'", "output": "'1.8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022725", "code": "def duplicate_characters(input_str):\n    duplicated_str = \"\"\n    for char in input_str:\n        duplicated_str += char * 2\n    return duplicated_str\n", "entry_point": "duplicate_characters", "input": "'hello'", "output": "'hheelllloo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6463_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022726", "code": "from typing import List, Dict\ndef count_blueprint_characters(blueprints: List[str]) -> Dict[str, int]:\n    blueprint_lengths = {}\n    for blueprint in blueprints:\n        if not blueprint[0].islower():\n            blueprint_lengths[blueprint] = len(blueprint)\n    return blueprint_lengths\n", "entry_point": "count_blueprint_characters", "input": "['aBlueprint', 'bDesign', 'cModel']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32471_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022727", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n + 1):\n        row = list(range(1, i + 1)) + [i] * (n - i)\n        pattern.append(row)\n    return pattern\n", "entry_point": "generate_pattern", "input": "3", "output": "[[1, 1, 1], [1, 2, 2], [1, 2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6444_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022728", "code": "def process_error_handlers(error_handlers):\n    error_dict = {}\n    for code, template in reversed(error_handlers):\n        error_dict[code] = template\n    return error_dict\n", "entry_point": "process_error_handlers", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5735_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022729", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[8, 12, 13, 14, 8, 15, 8, 14, 8]", "output": "[8, 8, 8, 8, 12, 13, 14, 14, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022730", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'resmil.m'", "output": "[('resmil.m', 'resmil.m')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022731", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[10] * 20, 10", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022732", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "7", "output": "140", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022733", "code": "from datetime import date, timedelta\ndef weeks_dates(wky):\n    # Parse week number and year from the input string\n    wk = int(wky[:2])\n    yr = int(wky[2:])\n    # Calculate the starting date of the year\n    start_date = date(yr, 1, 1)\n    start_date += timedelta(6 - start_date.weekday())\n    # Calculate the date range for the given week number and year\n    delta = timedelta(days=(wk - 1) * 7)\n    date_start = start_date + delta\n    date_end = date_start + timedelta(days=6)\n    # Format the date range as a string\n    date_range = f'{date_start} to {date_end}'\n    return date_range\n", "entry_point": "weeks_dates", "input": "'118989'", "output": "'8989-03-15 to 8989-03-21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143506_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022734", "code": "import base64\ndef modified_unbase64(s):\n    s_utf7 = '+' + s.replace(',', '/') + '-'\n    original_bytes = s_utf7.encode('utf-7')\n    original_string = original_bytes.decode('utf-7')\n    return original_string\n", "entry_point": "modified_unbase64", "input": "'SGVsvSGxkIQ='", "output": "'+SGVsvSGxkIQ=-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65108_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022735", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'2 + 3\\n10 * 2'", "output": "['5', '20']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8701", "output": "{1, 7, 11, 77, 113, 791, 1243, 8701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3524", "output": "{1, 2, 1762, 4, 3524, 881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3523", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022738", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 50, 60, 60, 70, 80]", "output": "[1, 2, 3, 4, 5, 6, 6, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022739", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "1, 26", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022740", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9497", "output": "{1, 9497}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022741", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "3", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022742", "code": "def round_to_sigfig(x, n=1):\n    import math as mt\n    def calculate_decimal_places(a, n):\n        if a != 0.0:\n            return -int(mt.floor(mt.log10(abs(a))) + (n - 1))\n        else:\n            return 0\n    rounded_numbers = [round(a, calculate_decimal_places(a, n)) for a in x]\n    return rounded_numbers\n", "entry_point": "round_to_sigfig", "input": "[0, 0.01, 0]", "output": "[0, 0.01, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149193_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022743", "code": "def grouped(n, iterable, fillvalue=None):\n    groups = []\n    it = iter(iterable)\n    while True:\n        group = tuple(next(it, fillvalue) for _ in range(n))\n        if group == (fillvalue,) * n:\n            break\n        groups.append(group)\n    return groups\n", "entry_point": "grouped", "input": "5, [7, 3, 1, 4, 3, 4, 4, 4, 1, 1]", "output": "[(7, 3, 1, 4, 3), (4, 4, 4, 1, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32257_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9608", "output": "{1, 2, 2402, 4804, 4, 9608, 8, 1201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9607", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022745", "code": "def convert_nodes_to_latlon(nodes):\n    latlon_nodes = {}\n    for key, value in nodes.items():\n        lat = value[1] / 1000  # Simulated latitude conversion\n        lon = value[0] / 1000  # Simulated longitude conversion\n        latlon_nodes[key] = [lat, lon]\n    return latlon_nodes\n", "entry_point": "convert_nodes_to_latlon", "input": "{1: (100, 200), 2: (300, 400)}", "output": "{1: [0.2, 0.1], 2: [0.4, 0.3]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92519_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9886", "output": "{1, 2, 9886, 4943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022747", "code": "def generate_forcefield_path(name):\n    base_directory = \"/path/to/forcefields/\"\n    forcefield_filename = f\"forcefield_{name}.txt\"\n    forcefield_path = base_directory + forcefield_filename\n    return forcefield_path\n", "entry_point": "generate_forcefield_path", "input": "'eeelecc'", "output": "'/path/to/forcefields/forcefield_eeelecc.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84731_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022748", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'hlelalow', 1", "output": "{'hlelalow': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022749", "code": "import json\ndef extract_stock_info(json_data):\n    company_name = json_data.get('company_name')\n    stock_symbol = json_data.get('stock_symbol')\n    stock_price = json_data.get('stock_price')\n    return company_name, stock_symbol, stock_price\n", "entry_point": "extract_stock_info", "input": "{}", "output": "(None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126654_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1383", "output": "{1, 3, 461, 1383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022751", "code": "def compress_string(s1):\n    newStr = ''\n    char = ''\n    count = 0\n    for i in range(len(s1)):\n        if char != s1[i]:\n            if char != '':  # Add previous character and count to newStr\n                newStr += char + str(count)\n            char = s1[i]\n            count = 1\n        else:\n            count += 1\n    newStr += char + str(count)  # Add last character and count to newStr\n    if len(newStr) > len(s1):\n        return s1\n    return newStr\n", "entry_point": "compress_string", "input": "'aaaccd'", "output": "'a3c2d1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79600_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022752", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'Clippnfig.something_else'", "output": "'Clippnfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022753", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022754", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7862", "output": "{1, 2, 3931, 7862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7861", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022755", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5155", "output": "{1, 5155, 5, 1031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022756", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'Hello'", "output": "{'Hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022757", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 1, 2, 3, 0, 1, 1]", "output": "[1, 2, 6, 7, 3, 3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7982", "output": "{1, 2, 614, 13, 7982, 307, 3991, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022759", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4348", "output": "{1, 2, 4, 4348, 2174, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4347", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022760", "code": "def from_master_derivation_key(mdk):\n    # Implement the conversion from master derivation key to mnemonic phrase here\n    # This could involve decoding, processing, and converting the mdk appropriately\n    # For illustration purposes, let's assume a simple conversion method\n    mnemonic = mdk[::-1]  # Reversing the master derivation key as an example\n    return mnemonic\n", "entry_point": "from_master_derivation_key", "input": "'savaton_key'", "output": "'yek_notavas'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129954_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022761", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6373", "output": "{1, 6373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022762", "code": "def missingNumber(array, n):\n    total = n*(n+1)//2\n    array_sum = sum(array)\n    return total - array_sum\n", "entry_point": "missingNumber", "input": "[1, 2, 3], 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114479_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022763", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[6, 3, 3, 4, 3]", "output": "[6, 9, 9, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022764", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "230", "output": "{1, 2, 5, 230, 10, 46, 115, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt229", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2732", "output": "{1, 2, 4, 683, 2732, 1366}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2731", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022766", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'30a330a46330303'", "output": "'30a330FFFEa46330303'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022767", "code": "def calculate_refresh_interval(refresh_timeout: int) -> int:\n    return refresh_timeout // 6\n", "entry_point": "calculate_refresh_interval", "input": "3594", "output": "599", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13656_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022768", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "15", "output": "610", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022769", "code": "def str_between(input_str: str, left: str, right: str) -> str:\n    left_index = input_str.find(left)\n    if left_index == -1:\n        return \"\"\n    right_index = input_str.find(right, left_index + len(left))\n    if right_index == -1:\n        return \"\"\n    return input_str[left_index + len(left):right_index]\n", "entry_point": "str_between", "input": "'Hello World!', 'Hello ', '!'", "output": "'World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96216_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022770", "code": "def summarize_model_config(config_dict):\n    summary = \"Model Configuration Summary:\\n\"\n    if \"attention_variant\" in config_dict and config_dict[\"attention_variant\"] is not None:\n        summary += f\"Attention Variant: {config_dict['attention_variant']}\\n\"\n    if \"mixed_precision\" in config_dict:\n        if config_dict[\"mixed_precision\"]:\n            summary += \"Mixed Precision: Enabled\\n\"\n        else:\n            summary += \"Mixed Precision: Disabled\\n\"\n    return summary\n", "entry_point": "summarize_model_config", "input": "{}", "output": "'Model Configuration Summary:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21820_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022771", "code": "def parse_time_duration(duration_str):\n    # Split the duration string into hours, minutes, and seconds components\n    components = duration_str.split('h')\n    hours = int(components[0])\n    if 'm' in components[1]:\n        components = components[1].split('m')\n        minutes = int(components[0])\n    else:\n        minutes = 0\n    if 's' in components[1]:\n        components = components[1].split('s')\n        seconds = int(components[0])\n    else:\n        seconds = 0\n    # Calculate the total duration in seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "parse_time_duration", "input": "'252h'", "output": "907200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1363_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022772", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4604", "output": "{1, 2, 4, 4604, 2302, 1151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4603", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022773", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "-5", "output": "0.03125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022774", "code": "def filter_elements(iterable, include_values):\n    filtered_list = []\n    for value in iterable:\n        if value in include_values:\n            filtered_list.append(value)\n    return filtered_list\n", "entry_point": "filter_elements", "input": "[1, 2, 4, 4, 4], [4]", "output": "[4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46502_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022775", "code": "def extract_characters(input_string, slice_obj):\n    start, stop, step = slice_obj.indices(len(input_string))\n    result = [input_string[i] for i in range(start, stop, step)]\n    return result\n", "entry_point": "extract_characters", "input": "'aSe', slice(0, 3, 1)", "output": "['a', 'S', 'e']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83319_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022776", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'sit', 3", "output": "['sit']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022777", "code": "from typing import List\ndef filter_by_percentage(input_list: List[int], percentage: float) -> List[int]:\n    if not input_list:\n        return []\n    max_value = max(input_list)\n    threshold = max_value * (percentage / 100)\n    filtered_list = [num for num in input_list if num >= threshold]\n    return filtered_list\n", "entry_point": "filter_by_percentage", "input": "[50, 40, 10], 80", "output": "[50, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19265_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022778", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[4, 3, 2, 8, 1, 7, 3, 5, 9]", "output": "[1, 2, 3, 3, 4, 5, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022779", "code": "def process_circular_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        output_list.append(input_list[i] + input_list[(i + 1) % len(input_list)])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[2, 4, 4, 5, 4, 4, 4]", "output": "[6, 8, 9, 9, 8, 8, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131123_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022780", "code": "import itertools\ndef count_unique_combinations(items, k):\n    unique_combinations = list(itertools.combinations(items, k))\n    return len(unique_combinations)\n", "entry_point": "count_unique_combinations", "input": "[1, 2, 3, 4], 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23071_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022781", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'3.20'", "output": "'3.20.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022782", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[5, 2, 4, 9, 1, 6, 2, 5, 9]", "output": "[9, 9, 6, 5, 5, 4, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022783", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'one3two5'", "output": "1325", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022784", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abababcab1def2ghaade3e4ee'", "output": "['abababcab', 'def', 'ghaade', 'e', 'ee']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1225", "output": "{1, 35, 5, 7, 1225, 175, 49, 245, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1224", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022786", "code": "import re\ndef extract_numbers(input_string):\n    # Define the pattern to match numbers enclosed within underscores and dots\n    pattern = re.compile(r\"_([0-9]+)\\.\")\n    # Use re.findall to extract all occurrences of the pattern in the input string\n    extracted_numbers = re.findall(pattern, input_string)\n    # Convert the extracted numbers from strings to integers using list comprehension\n    extracted_integers = [int(num) for num in extracted_numbers]\n    return extracted_integers\n", "entry_point": "extract_numbers", "input": "'_123.'", "output": "[123]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10395_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022787", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'ctypheehh'", "output": "'ctypheehh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022788", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[250, 252, 251, 296], 1, 4", "output": "262.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6037", "output": "{1, 6037}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6036", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022790", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 4, 7, 2, 8, 4, 3, 3]", "output": "[1, 5, 9, 5, 12, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022791", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    max_sum = arr[0]\n    current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 20, 15]", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39877_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022792", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8465", "output": "{1693, 1, 5, 8465}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022793", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'gg'", "output": "'Binary path for gg not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022794", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[1, 2, 3, 4, 5]", "output": "'1, 2, 3, 4, 5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022795", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'cengenC'", "output": "['cengenC']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022796", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[3, 1, 2, 3, 2, 3, 5, 1]", "output": "[3, 1, 2, 3, 2, 3, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022797", "code": "def extract_major_version(version_str):\n    # Find the index of the first dot in the version string\n    dot_index = version_str.find('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version_str[:dot_index] if dot_index != -1 else version_str\n    # Convert the extracted substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'111.0'", "output": "111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110094_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022798", "code": "def my_index2(l, x, default=False):\n    return l.index(x) if x in l else default\n", "entry_point": "my_index2", "input": "[1, 2, 3, 4], 10, default=-3", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117825_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022799", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4924", "output": "{1, 2, 4, 1231, 4924, 2462}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4923", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022800", "code": "def calculate_class_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_class_average", "input": "[85, 88, 88, 87, 90]", "output": "87.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82047_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022801", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[5, 6, 7, 8, 1], 4", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022802", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2993", "output": "{73, 1, 2993, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022803", "code": "MSG_DATE_SEP = \">>>:\"\nEND_MSG = \"THEEND\"\nALLOWED_KEYS = [\n    'q',\n    'e',\n    's',\n    'z',\n    'c',\n    '',\n]\ndef process_input(input_str):\n    if MSG_DATE_SEP in input_str:\n        index = input_str.find(MSG_DATE_SEP)\n        if index + len(MSG_DATE_SEP) < len(input_str):\n            char = input_str[index + len(MSG_DATE_SEP)]\n            if char in ALLOWED_KEYS:\n                return char\n    elif END_MSG in input_str:\n        return ''\n    return \"INVALID\"\n", "entry_point": "process_input", "input": "'>>>:q'", "output": "'q'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90484_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022804", "code": "def process_device_id(name):\n    if name.startswith('/') or ':' not in name:\n        return name\n    if ':' not in name:\n        raise ValueError(f\"Not a valid device ID: {name}\")\n    hexint = lambda v: int(v, 16)\n    vendor, product = map(hexint, name.split(':'))\n    return vendor, product\n", "entry_point": "process_device_id", "input": "'12:03'", "output": "(18, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115419_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022805", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "73, 'codts.py'", "output": "'73_codts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022806", "code": "heightGrowableTypes = [\"BitmapCanvas\", \"CodeEditor\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"RadioGroup\", \"StaticBox\", \"TextArea\", \"Tree\"]\nwidthGrowableTypes = [\"BitmapCanvas\", \"CheckBox\", \"Choice\", \"CodeEditor\", \"ComboBox\", \"HtmlWindow\", \"Image\", \"List\", \"MultiColumnList\", \"Notebook\", \"PasswordField\", \"RadioGroup\", \"Spinner\", \"StaticBox\", \"StaticText\", \"TextArea\", \"TextField\", \"Tree\"]\ngrowableTypes = [\"Gauge\", \"Slider\", \"StaticLine\"]\ndef getGrowthBehavior(elementType):\n    if elementType in growableTypes:\n        return \"Both-growable\"\n    elif elementType in heightGrowableTypes:\n        return \"Height-growable\"\n    elif elementType in widthGrowableTypes:\n        return \"Width-growable\"\n    else:\n        return \"Not-growable\"\n", "entry_point": "getGrowthBehavior", "input": "'Gauge'", "output": "'Both-growable'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41927_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022807", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8297", "output": "{1, 8297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022808", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'AB.CDE FG.HIJ KL.MNO'", "output": "[('AB', 'CDE'), ('FG', 'HIJ'), ('KL', 'MNO')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022809", "code": "from typing import List\ndef calculate_spectral_flux(power_spectra: List[List[float]]) -> List[float]:\n    spectral_flux_values = [0.0]  # Initialize with 0 for the first frame\n    for i in range(1, len(power_spectra)):\n        spectral_flux = sum(abs(curr - prev) for curr, prev in zip(power_spectra[i], power_spectra[i-1]))\n        spectral_flux_values.append(spectral_flux)\n    return spectral_flux_values\n", "entry_point": "calculate_spectral_flux", "input": "[[1.0, 2.0, 3.0], [1.0, 2.0, 3.0]]", "output": "[0.0, 0.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63428_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4638", "output": "{1, 2, 3, 773, 6, 1546, 2319, 4638}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5523", "output": "{1, 3, 7, 263, 1841, 5523, 789, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022812", "code": "def encrypt_decrypt_message(message, shift):\n    result = \"\"\n    for char in message:\n        if char.isupper():\n            result += chr((ord(char) - 65 + shift) % 26 + 65) if char.isupper() else char\n        elif char.islower():\n            result += chr((ord(char) - 97 + shift) % 26 + 97) if char.islower() else char\n        else:\n            result += char\n    return result\n", "entry_point": "encrypt_decrypt_message", "input": "'Qilfxl!', 1", "output": "'Rjmgym!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149832_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022813", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-2, 1", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt64", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022814", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7325", "output": "{1, 5, 293, 1465, 7325, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7324", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022815", "code": "def max_subset_sum_non_adjacent(arr):\n    inclusive = 0\n    exclusive = 0\n    for num in arr:\n        new_exclusive = max(inclusive, exclusive)  # Calculate the new exclusive value\n        inclusive = exclusive + num  # Update inclusive as the sum of previous exclusive and current element\n        exclusive = new_exclusive  # Update exclusive for the next iteration\n    return max(inclusive, exclusive)\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38682_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022816", "code": "def cleanup_query_string(url):\n    base_url, query_string = url.split('?') if '?' in url else (url, '')\n    if '#' in query_string:\n        query_string = query_string[:query_string.index('#')]\n    if query_string.endswith('?') and len(query_string) == 1:\n        query_string = ''\n    cleaned_url = base_url + ('?' + query_string if query_string else '')\n    return cleaned_url\n", "entry_point": "cleanup_query_string", "input": "'http://tesT.com/t.html?p=a#ignore'", "output": "'http://tesT.com/t.html?p=a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64096_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022817", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aabbccDDDeee'", "output": "'a2b2c2D3e3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022818", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'hhl'", "output": "'lhh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022819", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "0, -4", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022820", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022821", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{7: []}, 7", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022822", "code": "def repeat_container(colors, container_name):\n    result = {}\n    for color in colors:\n        repetitions = len(color) // len(container_name)\n        result[color] = container_name * repetitions\n    return result\n", "entry_point": "repeat_container", "input": "['#33aeff', '#a4c639'], 'container'", "output": "{'#33aeff': '', '#a4c639': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112013_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022823", "code": "from typing import List\ndef sum_divisible_by_two_and_three(numbers: List[int]) -> int:\n    divisible_sum = 0\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            divisible_sum += num\n    return divisible_sum\n", "entry_point": "sum_divisible_by_two_and_three", "input": "[6, 6, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125267_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022824", "code": "def calculate_salutes(hallway: str) -> int:\n    crosses = 0\n    right_count = 0\n    for char in hallway:\n        if char == \">\":\n            right_count += 1\n        elif char == \"<\":\n            crosses += right_count * 2\n    return crosses\n", "entry_point": "calculate_salutes", "input": "'>><'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117936_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022825", "code": "def sum_multiples_of_3_or_5(nums):\n    multiples = set()\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples:\n                total += num\n                multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[15, 30, 25]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66564_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022826", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:edX+CS1012+020'", "output": "('edX', 'CS1012', '020')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022827", "code": "def get_file_name(language: str) -> str:\n    file_names = {\n        'java': 'Main.java',\n        'c': 'main.c',\n        'cpp': 'main.cpp',\n        'python': 'main.py',\n        'js': 'main.js'\n    }\n    return file_names.get(language, 'Unknown')\n", "entry_point": "get_file_name", "input": "'java'", "output": "'Main.java'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108385_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022828", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[100, 4], 32", "output": "3328", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6133", "output": "{1, 6133}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022830", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 2, 12, 12, 12, 13]", "output": "([2, 2, 12, 12, 12], [13])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6857", "output": "{1, 6857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022832", "code": "def extract_and_multiply(input_str):\n    # Extract the two numbers from the input string\n    num0 = float(input_str[1:4])\n    num1 = float(input_str[5:8])\n    # Calculate the product of the two numbers\n    product = num0 * num1\n    return product\n", "entry_point": "extract_and_multiply", "input": "'a1.5_3.1'", "output": "4.65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128114_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022833", "code": "def top_three_scores(scores):\n    unique_scores = set(scores)\n    sorted_scores = sorted(unique_scores, reverse=True)\n    if len(sorted_scores) >= 3:\n        return sorted_scores[:3]\n    else:\n        return sorted_scores\n", "entry_point": "top_three_scores", "input": "[99, 86, 74, 60, 50]", "output": "[99, 86, 74]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99287_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022834", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "5, 1, '+'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022835", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "115016", "output": "57508", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022836", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char in char_frequency:\n            char_frequency[char] += 1\n        else:\n            char_frequency[char] = 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'helllo'", "output": "{'h': 1, 'e': 1, 'l': 3, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84684_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022837", "code": "from typing import List\ndef sum_even_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_even_numbers", "input": "[-4]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133880_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022838", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'11.20.100'", "output": "(11, 20, 100)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8122", "output": "{1, 2, 131, 262, 8122, 4061, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022840", "code": "from typing import List\ndef max_distance(colors: List[int]) -> int:\n    color_indices = {}\n    max_dist = 0\n    for i, color in enumerate(colors):\n        if color not in color_indices:\n            color_indices[color] = i\n        else:\n            max_dist = max(max_dist, i - color_indices[color])\n    return max_dist\n", "entry_point": "max_distance", "input": "[1, 2, 3, 4, 5, 6, 7, 1]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93339_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022841", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "(2.0, 4.0, 30), None", "output": "(2.0, 4.0, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022842", "code": "import math\ndef count_unique_sizes(determinants):\n    unique_sizes = set()\n    for det in determinants:\n        size = int(math.sqrt(det))\n        unique_sizes.add(size)\n    return len(unique_sizes)\n", "entry_point": "count_unique_sizes", "input": "[0, 1, 4, 9, 16, 25, 36]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74244_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022843", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "5.0", "output": "1.9100000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022844", "code": "import re\ndef extract_message_id(fbl_report: str) -> str:\n    yandex_pattern = r'\\[(.*?)\\]'  # Pattern to match Yandex FBL message ID\n    gmail_pattern = r'\\{(.*?)\\}'   # Pattern to match Gmail FBL message ID\n    yandex_match = re.search(yandex_pattern, fbl_report)\n    gmail_match = re.search(gmail_pattern, fbl_report)\n    if yandex_match:\n        return yandex_match.group(1)\n    elif gmail_match:\n        return gmail_match.group(1)\n    else:\n        return \"Message ID not found\"\n", "entry_point": "extract_message_id", "input": "'[1jb6]'", "output": "'1jb6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29165_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022845", "code": "def calculate_points(scores):\n    if not scores:\n        return 0\n    total_points = 0\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            total_points += 1\n        else:\n            total_points -= 1\n    return total_points\n", "entry_point": "calculate_points", "input": "[5, 4, 3, 2]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101160_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022846", "code": "def intToHuman(number):\n    B = 1000*1000*1000\n    M = 1000*1000\n    K = 1000\n    if number >= B:\n        numStr = f\"{number/B:.1f}\" + \"B\"\n    elif number >= M:\n        numStr = f\"{number/M:.1f}\" + \"M\"\n    elif number >= K:\n        numStr = f\"{number/K:.1f}\" + \"K\"\n    else:\n        numStr = str(int(number))\n    return numStr\n", "entry_point": "intToHuman", "input": "1500", "output": "'1.5K'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61849_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022847", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hwowohoh!'", "output": "['hwowohoh']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022848", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9703", "output": "{1, 31, 313, 9703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9702", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022849", "code": "def is_allowed(action, obj):\n    allowed_actions = ['read', 'write', 'entrust', 'move', 'transmute', 'derive', 'develop']\n    if action in allowed_actions:\n        return True\n    else:\n        return False\n", "entry_point": "is_allowed", "input": "'read', None", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40722_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8635", "output": "{1, 5, 11, 785, 55, 8635, 157, 1727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022851", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "24, 24", "output": "0.013888888888888888", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022852", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "253, 163, 0", "output": "'#FDA300'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022853", "code": "from typing import List\ndef sum_positive_integers(nums: List[int]) -> int:\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[10, 8, 6]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140850_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022854", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9115", "output": "{1, 9115, 5, 1823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9114", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022855", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1313", "output": "{1, 101, 13, 1313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5514", "output": "{1, 2, 3, 2757, 6, 5514, 1838, 919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022857", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "5", "output": "[0, 1, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022858", "code": "def getSkillGained(toonSkillPtsGained, toonId, track):\n    exp = 0\n    expList = toonSkillPtsGained.get(toonId, None)\n    if expList is not None:\n        exp = expList[track]\n    return int(exp + 0.5)\n", "entry_point": "getSkillGained", "input": "{1: [15, 20, 5]}, 1, 1", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70352_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022859", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "6", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022860", "code": "def text_transformation(text: str) -> str:\n    # Convert to lowercase, replace \"deprecated\" with \"obsolete\", strip whitespaces, and reverse the string\n    transformed_text = text.lower().replace(\"deprecated\", \"obsolete\").strip()[::-1]\n    return transformed_text\n", "entry_point": "text_transformation", "input": "'iis'", "output": "'sii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19675_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9419", "output": "{1, 9419}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022862", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6289", "output": "{331, 1, 6289, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5494", "output": "{1, 2, 67, 134, 41, 82, 5494, 2747}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5493", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022864", "code": "def highest_non_duplicated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_duplicated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_duplicated_scores:\n        return max(non_duplicated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_duplicated_score", "input": "[70, 80, 90, 85]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79204_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022865", "code": "def min_divisor_expression(N):\n    ans = float('inf')  # Initialize ans to positive infinity\n    for n in range(1, int(N ** 0.5) + 1):\n        if N % n == 0:\n            ans = min(ans, n + N // n - 2)\n    return ans\n", "entry_point": "min_divisor_expression", "input": "14", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115935_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022866", "code": "from typing import List\ndef sum_of_max_values(strings: List[str]) -> int:\n    total_sum = 0\n    for string in strings:\n        integers = [int(num) for num in string.split(',')]\n        max_value = max(integers)\n        total_sum += max_value\n    return total_sum\n", "entry_point": "sum_of_max_values", "input": "['100,200,300', '400,500,600', '700,800,900']", "output": "1800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86134_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022867", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[0, 1, 2, 3, 4, 8, 4, 2]", "output": "[0, 1, 2, 3, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022868", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "-3, -2", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022869", "code": "from typing import List\ndef max_product(nums: List[int]) -> int:\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[1, 3, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91738_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022870", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'my'", "output": "'my'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022871", "code": "def longest_consecutive_subsequence(lst):\n    if not lst:\n        return []\n    lst.sort()\n    current_subsequence = [lst[0]]\n    longest_subsequence = []\n    for i in range(1, len(lst)):\n        if lst[i] == current_subsequence[-1] + 1:\n            current_subsequence.append(lst[i])\n        else:\n            if len(current_subsequence) > len(longest_subsequence):\n                longest_subsequence = current_subsequence\n            current_subsequence = [lst[i]]\n    if len(current_subsequence) > len(longest_subsequence):\n        longest_subsequence = current_subsequence\n    return longest_subsequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[2, 3, 5, 7]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16310_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022872", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[8, 0, 1, 2, 1, 3, 18]", "output": "[8, 0, 1, 2, 1, 3, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022873", "code": "def sum_of_digits(n: int) -> int:\n    sum_digits = 0\n    for digit in str(n):\n        sum_digits += int(digit)\n    return sum_digits\n", "entry_point": "sum_of_digits", "input": "49", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99099_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022874", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "25, 2", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt48", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022875", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4141", "output": "{1, 101, 4141, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022876", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    fib_prev, fib_curr = 0, 1\n    for _ in range(N):\n        fib_sum += fib_curr\n        fib_prev, fib_curr = fib_curr, fib_prev + fib_curr\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "18", "output": "6764", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41805_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022877", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "(40.0, 40.0, 40.0, 40.0)", "output": "[40.0, 40.0, 0.0, 0.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022878", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'300535385114.dkr.ecrmazonaws.', 288", "output": "'300535385114.dkr.ecrmazonaws.288'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022879", "code": "import importlib\ndef module_loader(module_names):\n    loaded_modules = {}\n    for module_name in module_names:\n        try:\n            loaded_modules[module_name] = importlib.import_module('.' + module_name, package=__name__)\n        except ModuleNotFoundError:\n            loaded_modules[module_name] = None\n    return loaded_modules\n", "entry_point": "module_loader", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106874_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022880", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "5", "output": "[0, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022881", "code": "def parse_response(response):\n    key_value_pairs = response.split(',')\n    for pair in key_value_pairs:\n        key, value = pair.split('=')\n        if key.strip() == 'token':\n            return value.strip()\n    return None  # Return None if the key \"token\" is not found in the response\n", "entry_point": "parse_response", "input": "'token='", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108561_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022882", "code": "def calculate_cube_volume(width, height, depth):\n    volume = width * height * depth\n    return volume\n", "entry_point": "calculate_cube_volume", "input": "60, 7, 34", "output": "14280", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20357_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022883", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "350", "output": "'CCCL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022884", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 0, 9, 7, 1, 4, 0, 1]", "output": "[1, 1, 11, 10, 5, 9, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022885", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "10", "output": "683", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022886", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'citty: N'", "output": "{'citty': 'N'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022887", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'lllellAA', 'any_election_name'", "output": "'Sample Election: lllellAA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022888", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'file4.mfille1.pyd'", "output": "{'pyd': ['file4.mfille1.pyd']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022889", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[7, 6, 4, 2]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022890", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[4, 2, 0, 6, 1, 2, 3, 6]", "output": "[4, 2, 0, 6, 1, 2, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022891", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2289", "output": "{1, 3, 7, 327, 109, 2289, 21, 763}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022892", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[4, 1, 5, 0, 3, 4, 5, 1, 0, 3]", "output": "[4, 1, 5, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022893", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'123456+XYZZ'", "output": "('123456', 'XYZZ', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022894", "code": "def traffic_light_action(color):\n    if color == 'red':\n        return 'Stop'\n    elif color == 'green':\n        return 'GoGoGo'\n    elif color == 'yellow':\n        return 'Stop or Go fast'\n    else:\n        return 'Light is bad!!!'\n", "entry_point": "traffic_light_action", "input": "'green'", "output": "'GoGoGo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129716_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022895", "code": "def weighted_avg(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"The lengths of numbers and weights must be equal.\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    return weighted_sum / total_weight\n", "entry_point": "weighted_avg", "input": "[4.0, 5.0, 6.0], [1, 1, 1]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67800_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022896", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8443", "output": "{1, 8443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8442", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022897", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "820", "output": "{1, 2, 4, 5, 164, 41, 10, 205, 82, 820, 20, 410}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt819", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022898", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "5", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022899", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022900", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'oeHHello123ee'", "output": "'oeHHello123ee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022901", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'osmaxx.config'", "output": "'osmaxx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022902", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[2, 3, 5]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022903", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'ipsusametim'", "output": "{'ipsusametim': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022904", "code": "def extract_alias(source_url):\n    if ':' in source_url:\n        alias = source_url.split(':', 1)[0]\n        return alias\n    else:\n        return None\n", "entry_point": "extract_alias", "input": "'httmphe.com:somepath'", "output": "'httmphe.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119573_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022905", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[10, 0, 0, 19, 15, 15, 15]", "output": "[10, 20, 60, 19, 15, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022906", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'ddavdav_v10.sv_ag'", "output": "'ddavdav_v11.sv_ag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022907", "code": "def count_static_urls(urlpatterns):\n    static_url_count = 0\n    static_pattern = \"static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\"\n    for pattern in urlpatterns:\n        if static_pattern in pattern:\n            static_url_count += 1\n    return static_url_count\n", "entry_point": "count_static_urls", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63447_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022908", "code": "def convert_integers(numbers):\n    converted_list = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            converted_list.append('even_odd')\n        elif num % 2 == 0:\n            converted_list.append('even')\n        elif num % 3 == 0:\n            converted_list.append('odd')\n        else:\n            converted_list.append(num)\n    return converted_list\n", "entry_point": "convert_integers", "input": "[2, 4, 7, 1, 7, 7, 4, 2, 7]", "output": "['even', 'even', 7, 1, 7, 7, 'even', 'even', 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77525_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022909", "code": "def sum_of_squares_of_evens(lst):\n    total = 0\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_of_evens", "input": "[0, 2, 2, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97226_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022910", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[10, 7, 11, 8, 8, 1, 7]", "output": "[10, 8, 13, 11, 12, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022911", "code": "def is_happy(n):\n    seen = set()\n    while n not in seen:\n        seen.add(n)\n        new_n = 0\n        for char in str(n):\n            new_n += int(char) ** 2\n        n = new_n\n    return n == 1\n", "entry_point": "is_happy", "input": "1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52737_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022912", "code": "def sequence_filter(skeleton, angle_indices):\n    \"\"\"This function checks whether a sequence of frames is sufficiently dense before being used for analysis.\n    Args:\n    skeleton (list): A sequence of frames.\n    angle_indices (list): A list of angle indices.\n    Returns:\n    list or int: Filtered angle indices based on the specified criteria.\n    \"\"\"\n    ratio = len(angle_indices) / len(skeleton)\n    if ratio > 0.7:\n        return angle_indices\n    else:\n        return 0\n", "entry_point": "sequence_filter", "input": "[1, 2, 3, 4, 5], [10, 20, 30, 40]", "output": "[10, 20, 30, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83346_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022913", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'lss'", "output": "'Manual not available for lss'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022914", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[3, 2, 5, 2, 1, 5, 0, 3, 5]", "output": "[3, 3, 7, 5, 5, 10, 6, 10, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022915", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[5, 100, 104, 110, 8, 104], 104, 10", "output": "[5, 104, 104, 104, 8, 104]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022916", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 0, 4, 4, 3, 4, 1, 1, 4]", "output": "[3, 4, 8, 7, 7, 5, 2, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022917", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'89,123123956'", "output": "{89, 123123956}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6964", "output": "{1, 2, 4, 1741, 6964, 3482}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6963", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022919", "code": "def min_max_sum(nums, start_idx, end_idx):\n    included_range = nums[start_idx : end_idx+1]\n    min_val = min(included_range)\n    max_val = max(included_range)\n    return min_val + max_val\n", "entry_point": "min_max_sum", "input": "[0, 5, 6, 8, 4, 10, 14, 2], 1, 5", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111411_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022920", "code": "def count_debug_actions(actions):\n    debug_count = 0\n    for action in actions:\n        if \"debug\" in action[\"description\"].lower():\n            debug_count += 1\n    return debug_count\n", "entry_point": "count_debug_actions", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32267_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022921", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[4]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022922", "code": "def process_command(input_str):\n    x = input_str.split(' ')\n    com = x[0]\n    rest = x[1:]\n    return (com, rest)\n", "entry_point": "process_command", "input": "'execute'", "output": "('execute', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93382_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022923", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4066", "output": "{1, 4066, 2, 38, 107, 2033, 19, 214}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022924", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[4, 3, 3, 3, 2, 1, 4, 3]", "output": "[7, 6, 6, 5, 3, 5, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022925", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'key1 eke'", "output": "['key1', 'eke']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022926", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 3, 3, 3]", "output": "[7, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022927", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[3, 0, 5, 5, 6, 4]", "output": "{3: 1, 0: 1, 5: 2, 6: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022928", "code": "def parse_query(query: str) -> str:\n    parts = query.split('==')\n    if len(parts) != 2:\n        return \"Invalid query format. Please provide a query in the format 'column == value'.\"\n    column = parts[0].strip()\n    value = parts[1].strip()\n    return f\"SELECT * FROM results WHERE {column} == {value}\"\n", "entry_point": "parse_query", "input": "'=='", "output": "'SELECT * FROM results WHERE  == '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98962_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022929", "code": "def convert_escape_sequences(input_string):\n    output_string = ''\n    i = 0\n    while i < len(input_string):\n        if input_string[i:i+2] == '\\\\33':\n            output_string += chr(27)  # ASCII escape character (ESC)\n            i += 2\n        elif input_string[i:i+2] == '\\\\?':\n            output_string += '?'\n            i += 2\n        else:\n            output_string += input_string[i]\n            i += 1\n    return output_string\n", "entry_point": "convert_escape_sequences", "input": "'\\\\?252\\\\?'", "output": "'?252?'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78537_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022930", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'vyshnddfv'", "output": "'Vyshnddfv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022931", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "12.0, 1", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022932", "code": "# Define the dictionary with color names and BGR values\ncolor_dict = {\n    'BLACK': (0, 0, 0),\n    'BLUE': (255, 0, 0),\n    'CHOCOLATE': (30, 105, 210),\n    'CYAN': (255, 255, 0),\n    'GOLDEN': (32, 218, 165),\n    'GRAY': (155, 155, 155),\n    'GREEN': (0, 255, 0),\n    'LIGHT_BLUE': (255, 9, 2),\n    'MAGENTA': (255, 0, 255),\n    'ORANGE': (0, 69, 255),\n    'PURPLE': (128, 0, 128),\n    'PINK': (147, 20, 255),\n    'RED': (0, 0, 255),\n    'WHITE': (255, 255, 255),\n    'YELLOW': (0, 255, 255)\n}\ndef get_bgr(color_name):\n    return color_dict.get(color_name, \"Color not found\")\n", "entry_point": "get_bgr", "input": "'BLACK'", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89938_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022933", "code": "def sum_multiples_of_3_or_5(input_list):\n    multiples_set = set()\n    total_sum = 0\n    for num in input_list:\n        if num % 3 == 0 or num % 5 == 0:\n            if num not in multiples_set:\n                total_sum += num\n                multiples_set.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 10, 12]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51051_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022934", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[90, 22, 34, 12, 64, 25, 11]", "output": "[11, 12, 22, 25, 34, 64, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022935", "code": "def count_pairs_with_difference(nums, k):\n    count = 0\n    num_set = set(nums)\n    for num in nums:\n        if num + k in num_set or num - k in num_set:\n            count += 1\n    return count\n", "entry_point": "count_pairs_with_difference", "input": "[1, 2, 2, 3, 3, 4, 4, 5], 1", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1892_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022936", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "10.0, 12.0, 100", "output": "(1.0, 0.024999999999999998)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022937", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "26, 'mode', 'output'", "output": "{'response': 'InvalidPin', 'pin': 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022938", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[0, 2, 3, 1, 2, 4, 0, 2]", "output": "[2, 5, 4, 3, 6, 4, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022939", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'plt'", "output": "'plt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5135", "output": "{1, 65, 1027, 5, 395, 13, 5135, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022941", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    a, b = 0, 1\n    fib_sum = a\n    for _ in range(1, n):\n        a, b = b, a + b\n        fib_sum += a\n    return fib_sum\n", "entry_point": "fibonacci_sum", "input": "7", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117189_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7535", "output": "{1, 1507, 5, 137, 11, 685, 7535, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022943", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[3, 3, 3], 'add'", "output": "[9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022944", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "85300, 0", "output": "85300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022945", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3666", "output": "'01:01:06'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022946", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8638", "output": "{1, 2, 7, 617, 14, 1234, 8638, 4319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022947", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[150, 180]", "output": "'5 minutes and 30 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022948", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022949", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7143", "output": "{1, 3, 2381, 7143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022950", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/home/user/documents', 'example.txt'", "output": "'/home/user/documents/example.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3457", "output": "{1, 3457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3456", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022952", "code": "def process_integers(int_list):\n    sum_positive = 0\n    product_negative = 1\n    max_abs_diff = 0\n    for num in int_list:\n        if num > 0:\n            sum_positive += num\n        elif num < 0:\n            product_negative *= num\n    for i in range(len(int_list)):\n        for j in range(i + 1, len(int_list)):\n            diff = abs(int_list[i] - int_list[j])\n            if diff > max_abs_diff:\n                max_abs_diff = diff\n    return sum_positive, product_negative, max_abs_diff\n", "entry_point": "process_integers", "input": "[-2, -4]", "output": "(0, 8, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70320_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022953", "code": "def find_floor_position(parentheses: str) -> int:\n    floor = 0\n    position = 0\n    for char in parentheses:\n        position += 1\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        if floor == -1:\n            return position\n    return -1\n", "entry_point": "find_floor_position", "input": "'(()))'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95034_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022954", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1643", "output": "{1, 1643, 53, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022955", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "9", "output": "'9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022956", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8477", "output": "{1, 7, 173, 49, 1211, 8477}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8476", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022957", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(17, 1, 255)", "output": "'#1101FF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022958", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10  # Increment the last element in the list by 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[1, 2, 4, 4, 5, 3]", "output": "[1, 4, 16, 16, 125, 37]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82710_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022959", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2881", "output": "{2881, 1, 67, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022960", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[63, 94, 94, 96, 78, 96, 79, 79], 8", "output": "[63, 94, 94, 96, 78, 96, 79, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022961", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[1, 1, 4, 4, 2, 6, 6]", "output": "[1, 4, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022962", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'WelcisWWelcoe'", "output": "'WelcisWWelcoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022963", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[10, 8, 10, 9]", "output": "252", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1046", "output": "{1, 2, 523, 1046}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1045", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022965", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[63]", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022966", "code": "def get_aquarium_light_color(aquarium_id):\n    aquarium_data = {\n        1: {'default_mode': 'red', 'total_food_quantity': 50},\n        2: {'default_mode': 'blue', 'total_food_quantity': 30},\n        3: {'default_mode': 'green', 'total_food_quantity': 70}\n    }\n    if aquarium_id not in aquarium_data:\n        return 'Unknown'\n    default_mode = aquarium_data[aquarium_id]['default_mode']\n    total_food_quantity = aquarium_data[aquarium_id]['total_food_quantity']\n    if default_mode == 'red' and total_food_quantity < 40:\n        return 'dim red'\n    elif default_mode == 'blue' and total_food_quantity >= 50:\n        return 'bright blue'\n    elif default_mode == 'green':\n        return 'green'\n    else:\n        return default_mode\n", "entry_point": "get_aquarium_light_color", "input": "3", "output": "'green'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20096_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1373", "output": "{1, 1373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022968", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{bananaa, }'", "output": "['bananaa', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022969", "code": "import os\ndef extract_template_level_paths(target_level_path):\n    template_level_paths = []\n    if os.path.exists(target_level_path) and os.path.isdir(target_level_path):\n        for file_name in os.listdir(target_level_path):\n            file_path = os.path.join(target_level_path, file_name)\n            if os.path.isfile(file_path):\n                template_level_paths.append(file_path)\n    else:\n        print(\"Invalid target level path or directory does not exist.\")\n    return template_level_paths\n", "entry_point": "extract_template_level_paths", "input": "'/invalid/path/to/empty/directory'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69850_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022970", "code": "def custom_sort(numbers):\n    # Separate even and odd numbers\n    even_numbers = [num for num in numbers if num % 2 == 0]\n    odd_numbers = [num for num in numbers if num % 2 != 0]\n    # Sort both sublists\n    even_numbers.sort()\n    odd_numbers.sort()\n    # Concatenate the sorted even and odd sublists\n    sorted_numbers = even_numbers + odd_numbers\n    return sorted_numbers\n", "entry_point": "custom_sort", "input": "[8, 8, 8, 1, 1, 5, 7]", "output": "[8, 8, 8, 1, 1, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53365_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022971", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 19]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022972", "code": "def format_text(text: str) -> str:\n    formatted_text = \"\"\n    words = text.split()\n    for word in words:\n        if word.startswith('*') and word.endswith('*'):\n            formatted_text += word.strip('*').upper() + \" \"\n        elif word.startswith('_') and word.endswith('_'):\n            formatted_text += word.strip('_').lower() + \" \"\n        elif word.startswith('`') and word.endswith('`'):\n            formatted_text += word.strip('`')[::-1] + \" \"\n        else:\n            formatted_text += word + \" \"\n    return formatted_text.strip()\n", "entry_point": "format_text", "input": "'aa `paxe`'", "output": "'aa exap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10452_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7516", "output": "{1, 2, 4, 3758, 1879, 7516}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7515", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4273", "output": "{1, 4273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022975", "code": "import re\ndef extract_author_and_license(file_content):\n    author = None\n    license = None\n    author_match = re.search(r'@author: (.+)', file_content)\n    if author_match:\n        author = author_match.group(1)\n    license_match = re.search(r'@license: (.+)', file_content)\n    if license_match:\n        license = license_match.group(1)\n    return author, license\n", "entry_point": "extract_author_and_license", "input": "'@author: John e\\nSome other documentation here.'", "output": "('John e', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84774_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022976", "code": "def sum_squared_differences(a, b):\n    total_sum = 0\n    min_len = min(len(a), len(b))\n    for i in range(min_len):\n        diff = a[i] - b[i]\n        total_sum += diff ** 2\n    return total_sum\n", "entry_point": "sum_squared_differences", "input": "[12, 6], [0, 0]", "output": "180", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148697_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022977", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "119, 4", "output": "'0119'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4744", "output": "{1, 2, 1186, 2372, 4, 4744, 8, 593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4743", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022979", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            new_pos = ord(char) + shift\n            if new_pos > ord('z'):\n                new_pos = new_pos - 26  # Wrap around the alphabet\n            encrypted_text += chr(new_pos)\n        else:\n            encrypted_text += char  # Keep non-letter characters unchanged\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'ollolssvv', 1", "output": "'pmmpmttww'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55105_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022980", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 0, 3, 1, 3, 1, 2, 3, 2]", "output": "[1, 3, 4, 4, 4, 3, 5, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26581_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022981", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-16", "output": "-61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022982", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[3, 4, 1, 2, 3, 4, 3, 4, 5]", "output": "[7, 5, 3, 5, 7, 7, 7, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022983", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 1:\n        return 0\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    return adjusted_sum / (len(scores) - 1)\n", "entry_point": "calculate_average", "input": "[80, 90, 95, 89]", "output": "91.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90214_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022984", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7366", "output": "{1, 2, 3683, 7366, 58, 29, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022985", "code": "def transform_iso_datetime(iso_datetime: str) -> str:\n    date_str, time_str = iso_datetime.split('T')\n    if '.' in time_str:\n        time_str = time_str.split('.')[0]  # Remove milliseconds if present\n    date_str = date_str.replace('-', '')  # Remove hyphens from date\n    time_str = time_str.replace(':', '')  # Remove colons from time\n    return date_str + 'T' + time_str\n", "entry_point": "transform_iso_datetime", "input": "'2018-12-31T05:00:30'", "output": "'20181231T050030'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14024_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6253", "output": "{1, 481, 37, 169, 13, 6253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6252", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022987", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'appointment, at 10:45:30'", "output": "{'when': 'appointment', 'hour': '10:45:30'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022988", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "',Wol' + 'd', 'd'", "output": "',Wol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4833", "output": "{1, 4833, 3, 9, 1611, 179, 537, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022990", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[58], 50", "output": "[58]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022991", "code": "from typing import List\ndef filter_and_sort_v1_api_versions(input_data: List[dict], kind_filter: str) -> List[dict]:\n    filtered_data = [d for d in input_data if d.get('kind') == kind_filter]\n    sorted_data = sorted(filtered_data, key=lambda x: len(x.get('versions', [])), reverse=True)\n    return sorted_data\n", "entry_point": "filter_and_sort_v1_api_versions", "input": "[], 'some_kind'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98535_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022992", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[70, 40, 91, 90, 77, 91, 90]", "output": "[91, 90, 77]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022993", "code": "def play_card_game(player1_deck, player2_deck, max_rounds):\n    def play_round():\n        card1 = player1_deck.pop(0)\n        card2 = player2_deck.pop(0)\n        if card1 > card2:\n            player1_deck.extend([card1, card2])\n        elif card2 > card1:\n            player2_deck.extend([card2, card1])\n        else:  # War\n            if len(player1_deck) < 4 or len(player2_deck) < 4:\n                return -1  # Game ends in a draw\n            else:\n                war_cards = [card1, card2] + player1_deck[:3] + player2_deck[:3]\n                del player1_deck[:4]\n                del player2_deck[:4]\n                result = play_round()  # Recursive war\n                if result == 0:\n                    player1_deck.extend(war_cards)\n                elif result == 1:\n                    player2_deck.extend(war_cards)\n    for _ in range(max_rounds):\n        if not player1_deck:\n            return 1  # Player 2 wins\n        elif not player2_deck:\n            return 0  # Player 1 wins\n        result = play_round()\n        if result == -1:\n            return -1  # Game ends in a draw\n    return -1  # Max rounds reached without a winner\n", "entry_point": "play_card_game", "input": "[3, 4, 5], [1, 2], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40748_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022994", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 83, 87, 92, 84]", "output": "85.85714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49545_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8754", "output": "{1, 2, 3, 2918, 6, 8754, 1459, 4377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022996", "code": "DEBUG_MEMBER_LIST = [\n    503131177,\n]\ndef filter_debug_members(input_list):\n    output_list = []\n    for member_id in input_list:\n        if member_id in DEBUG_MEMBER_LIST:\n            output_list.append(member_id)\n    return output_list\n", "entry_point": "filter_debug_members", "input": "[503131177, 503131177]", "output": "[503131177, 503131177]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3668_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022997", "code": "def max_non_overlapping_movies(movies):\n    movies.sort(key=lambda x: x[1])  # Sort movies based on end day\n    count = 0\n    prev_end = -1\n    for movie in movies:\n        if movie[0] >= prev_end:\n            count += 1\n            prev_end = movie[1]\n    return count\n", "entry_point": "max_non_overlapping_movies", "input": "[(1, 3), (3, 5), (4, 6)]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64823_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022998", "code": "def analyze_environment_usage(code_snippet):\n    correct_count = 0\n    incorrect_count = 0\n    for line in code_snippet.split('\\n'):\n        line = line.strip()\n        if 'Environment' in line and 'autoescape' in line:\n            if 'autoescape=True' in line or 'autoescape=select_autoescape()' in line:\n                correct_count += 1\n            else:\n                incorrect_count += 1\n    return correct_count, incorrect_count\n", "entry_point": "analyze_environment_usage", "input": "'    Environment(autoescape=off)'", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50412_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0022999", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'22 * 16'", "output": "352", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023000", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[5, 0, 0, 3, 3, 4, 0, 4]", "output": "[5, 0, 3, 6, 7, 4, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112058_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023001", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        patch = 0\n        minor += 1\n        if minor > 9:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'4.9.9'", "output": "'5.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58418_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023002", "code": "def process_mesh_files(sfm_fp, mesh_fp, image_dp):\n    log_messages = []\n    if mesh_fp is not None:\n        log_messages.append(\"Found the following mesh file: \" + mesh_fp)\n    else:\n        log_messages.append(\"Request target mesh does not exist in this project.\")\n    return log_messages\n", "entry_point": "process_mesh_files", "input": "None, 'hpath/mte', None", "output": "['Found the following mesh file: hpath/mte']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140821_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3932", "output": "{1, 2, 4, 1966, 983, 3932}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3931", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023004", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'25'", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023005", "code": "def calculate_routes(m, n):\n    # Initialize a 2D array to store the number of routes to reach each cell\n    routes = [[0 for _ in range(n)] for _ in range(m)]\n    # Initialize the number of routes to reach the starting point as 1\n    routes[0][0] = 1\n    # Calculate the number of routes for each cell in the grid\n    for i in range(m):\n        for j in range(n):\n            if i > 0:\n                routes[i][j] += routes[i - 1][j]  # Add the number of routes from above cell\n            if j > 0:\n                routes[i][j] += routes[i][j - 1]  # Add the number of routes from left cell\n    # The number of routes to reach the destination is stored in the bottom-right cell\n    return routes[m - 1][n - 1]\n", "entry_point": "calculate_routes", "input": "2, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9475_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023006", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[79, 78, 77, 76]", "output": "78.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023007", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2195", "output": "{1, 2195, 5, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023008", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(targets=['result'], expr=5)", "output": "'result = 5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023009", "code": "def validate_transaction(values):\n    required = ['sender', 'recipient', 'amount']\n    if not all(k in values for k in required):\n        return 'Missing values', 400\n    # Simulating adding the transaction to a blockchain\n    index = 123  # Placeholder for the block index\n    response = {'message': f'Transaction will be added to Block {index}'}\n    return response\n", "entry_point": "validate_transaction", "input": "{'sender': 'Alice', 'recipient': 'Bob'}", "output": "('Missing values', 400)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119152_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023010", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[10, 8, 6, 4, 2]", "output": "220", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4220_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023011", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'abcde'", "output": "'c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023012", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "6.57371840135574, 5.0, 3.0", "output": "0.5245728004519133", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023013", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023014", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3794", "output": "{1, 2, 7, 1897, 14, 271, 3794, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3793", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1693", "output": "{1, 1693}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "201", "output": "{1, 67, 3, 201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt200", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023017", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'100'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1372", "output": "{1, 2, 98, 4, 196, 7, 28, 686, 14, 49, 343, 1372}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1371", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023019", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'BBBHHD'", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023020", "code": "def group_titles_by_year(archives):\n    titles_by_year = {}\n    for archive in archives:\n        for document in archive:\n            year = document['year']\n            title = document['title']\n            if year not in titles_by_year:\n                titles_by_year[year] = []\n            titles_by_year[year].append(title)\n    for year in titles_by_year:\n        titles_by_year[year] = sorted(titles_by_year[year])\n    return titles_by_year\n", "entry_point": "group_titles_by_year", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68651_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2374", "output": "{1, 2, 1187, 2374}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023022", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5373", "output": "{1, 3, 199, 9, 597, 27, 5373, 1791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1085", "output": "{1, 35, 5, 7, 217, 155, 1085, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1084", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023024", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "48, 15, 10", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023025", "code": "def count_words(input_string):\n    word_count = 0\n    words_list = input_string.split()\n    for word in words_list:\n        word_count += 1\n    return word_count\n", "entry_point": "count_words", "input": "'Hello world again'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132450_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023026", "code": "def getNthFib(n):\n    if n <= 0:\n        return \"Invalid input. n should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    fibArr = [0, 1]\n    for i in range(2, n):\n        fibArr.append(fibArr[i - 1] + fibArr[i - 2])\n    return fibArr[n - 1]\n", "entry_point": "getNthFib", "input": "10", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55443_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5613", "output": "{1, 3, 5613, 1871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6635", "output": "{1, 6635, 5, 1327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023029", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-5, 9", "output": "-1953125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt61", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023030", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'cluclusterstec', 'test_id'", "output": "\"Provider submodule 'cluclusterstec' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023031", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "504403158265495555", "output": "'qsttag_escort_lady'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023032", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[10, 10, 7, 1, -1]", "output": "700", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5851_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023033", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "3.954", "output": "'0.39540000000000003 x 10^0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023034", "code": "def string_replace(to_find_string: str, replace_string: str, target_string: str) -> str:\n    index = target_string.find(to_find_string)\n    if index == -1:\n        return target_string\n    beginning = target_string[:index]\n    end = target_string[index + len(to_find_string):]\n    new_string = beginning + replace_string + end\n    return new_string\n", "entry_point": "string_replace", "input": "'cat', 'dog', 'acat.i'", "output": "'adog.i'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61704_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023035", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7369", "output": "{1, 7369}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023036", "code": "import ast\ndef evaluate_expression(expression: str) -> float:\n    tree = ast.parse(expression, mode='eval')\n    def evaluate_node(node):\n        if isinstance(node, ast.BinOp):\n            left = evaluate_node(node.left)\n            right = evaluate_node(node.right)\n            if isinstance(node.op, ast.Add):\n                return left + right\n            elif isinstance(node.op, ast.Sub):\n                return left - right\n            elif isinstance(node.op, ast.Mult):\n                return left * right\n            elif isinstance(node.op, ast.Div):\n                return left / right\n        elif isinstance(node, ast.Num):\n            return node.n\n        elif isinstance(node, ast.Expr):\n            return evaluate_node(node.value)\n        else:\n            raise ValueError(\"Invalid expression\")\n    return evaluate_node(tree.body)\n", "entry_point": "evaluate_expression", "input": "'1 + 2'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124878_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023037", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'data/output.t'", "output": "'/tmp/ml4pl/data/output.t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023038", "code": "def parse_opengraph_config(config_str):\n    opengraph_dict = {}\n    for line in config_str.split('\\n'):\n        if '=' in line:\n            key, value = line.split('=')\n            opengraph_dict[key] = value\n    return opengraph_dict\n", "entry_point": "parse_opengraph_config", "input": "'og:url=https://oliz.io/ggpy/'", "output": "{'og:url': 'https://oliz.io/ggpy/'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26160_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023039", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[1, 1, 2, 2, 2, 5, 6, 3]", "output": "{1: 2, 2: 3, 5: 1, 6: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023040", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'dhhhello'", "output": "{'dhhhello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023041", "code": "from typing import List\ndef expand(maze: List[List[int]], fill: int) -> List[List[int]]:\n    length = len(maze)\n    res = [[fill] * (length * 2) for _ in range(length * 2)]\n    for i in range(length // 2, length // 2 + length):\n        for j in range(length // 2, length // 2 + length):\n            res[i][j] = maze[i - length // 2][j - length // 2]\n    return res\n", "entry_point": "expand", "input": "[], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134081_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023042", "code": "def calculate_absolute_differences(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "calculate_absolute_differences", "input": "[0, 9, 18]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116273_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023043", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5459", "output": "{1, 5459, 53, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "826", "output": "{1, 2, 7, 14, 118, 826, 59, 413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023045", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "17", "output": "'10001'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023046", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "-122", "output": "-221", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023047", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(5, 5), (6, 6), (7, 7), (8, 8)]", "output": "{5: [5], 6: [6], 7: [7], 8: [8]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023048", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4019", "output": "{1, 4019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4018", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023049", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'AB.FAFEDA'", "output": "[('AB', 'FAFEDA')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023050", "code": "from typing import List\ndef sum_with_next(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst) - 1):\n        result.append(lst[i] + lst[i + 1])\n    result.append(lst[-1] + lst[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 2, 2, 3, 2]", "output": "[3, 4, 5, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111975_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023051", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[2, 3, 9, 8, 0, 1, 0, 8]", "output": "[0, 0, 1, 2, 3, 8, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023052", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1509", "output": "{1, 3, 1509, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1197", "output": "{1, 3, 133, 7, 9, 171, 1197, 399, 19, 21, 57, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1196", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023054", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "1, 93.47826086956522", "output": "9247.826086956522", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023055", "code": "def translate(phrase):\n    vowels = \"aeiouAEIOU\"\n    translated_words = []\n    for word in phrase.split():\n        if word[0] in vowels:\n            translated_word = word + \"way\"\n        else:\n            translated_word = word[1:] + word[0] + \"ay\"\n        # Preserve original capitalization\n        if word.istitle():\n            translated_word = translated_word.capitalize()\n        elif word.isupper():\n            translated_word = translated_word.upper()\n        translated_words.append(translated_word)\n    return ' '.join(translated_words)\n", "entry_point": "translate", "input": "'Orld'", "output": "'Orldway'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133119_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023056", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            result.append(input_list[i] + input_list[i + 1])\n        else:\n            result.append(input_list[i] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[3, 2, 4, 2, 1, 1, 0, 4, 4]", "output": "[5, 6, 6, 3, 2, 1, 4, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37203_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023057", "code": "from typing import List\nfrom datetime import datetime, timedelta\ndef generate_date_list(start_date: str, num_days: int) -> List[str]:\n    date_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days):\n        date_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return date_list\n", "entry_point": "generate_date_list", "input": "'2022-10-20', 1", "output": "['2022-10-20']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94343_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023058", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[102, 101, 100]", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99506_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023059", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'shello,ts'", "output": "['shello,ts']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77980_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023060", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "None, -19", "output": "-9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3957", "output": "{1, 3, 3957, 1319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023062", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[2, 5, -1, -1, 1]", "output": "[2, 5, -1, -1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023063", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'1.0.0.1000'", "output": "(1, 0, 0, 1000)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8674", "output": "{1, 8674, 2, 4337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023065", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'37.0'", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4351", "output": "{1, 19, 229, 4351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4350", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023067", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[10, 15, 5, 0]", "output": "(15, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023068", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "83", "output": "{83: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023069", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[20, 10, 5, 1]", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023070", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[4, 0], [7, 1], [6, 0]]", "output": "[[6], [4], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023071", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "326", "output": "{1, 2, 163, 326}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt325", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023072", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[10, [15, 17]]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3659", "output": "{1, 3659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023074", "code": "def convert_to_dict(tuple_list):\n    dic = {}\n    for pair in tuple_list:\n        dic[pair[0]] = pair[1]\n    return dic\n", "entry_point": "convert_to_dict", "input": "[(1, 'a'), (2, 'b'), (3, 'c')]", "output": "{1: 'a', 2: 'b', 3: 'c'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44836_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023075", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4981", "output": "{1, 293, 4981, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023076", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3678", "output": "{1, 2, 3, 613, 6, 1226, 1839, 3678}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023077", "code": "from typing import List\ndef check_survey_labels(form_elements: List[str], html_content: str) -> bool:\n    for element in form_elements:\n        label = '<label>{}</label>'.format(element)\n        if label not in html_content:\n            return False\n    return True\n", "entry_point": "check_survey_labels", "input": "['Name', 'Email'], '<label>Name</label><input /><label>Email</label>'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47993_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023078", "code": "def fa_mime_type(mime_type):\n    mime_to_icon = {\n        'application/pdf': 'file-pdf-o',\n        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'file-excel-o',\n        'text/html': 'file-text-o'\n    }\n    return mime_to_icon.get(mime_type, 'file-o')\n", "entry_point": "fa_mime_type", "input": "'text/html'", "output": "'file-text-o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72858_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023079", "code": "def calculate_sum_of_multiples(NUM):\n    total_sum = 0\n    for i in range(1, NUM):\n        if i % 3 == 0 or i % 5 == 0:\n            total_sum += i\n    return total_sum\n", "entry_point": "calculate_sum_of_multiples", "input": "16", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107367_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023080", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[5, -2, 0, 2, 5, 6, 0, 7]", "output": "[-2, 0, 0, 2, 5, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023081", "code": "from typing import List\ndef get_unique_elements(input_list: List[int]) -> List[int]:\n    unique_elements = []\n    seen_elements = set()\n    for element in input_list:\n        if element not in seen_elements:\n            unique_elements.append(element)\n            seen_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[4, 5, 3, 5, 7, 4, 9, 2, 8, 2]", "output": "[4, 5, 3, 7, 9, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78256_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023082", "code": "def extract_scores(score):\n    score_names = [\"loss\", \"mse\", \"mae\", \"r2\"]\n    return {sn: sv for sn, sv in zip(score_names, score)}\n", "entry_point": "extract_scores", "input": "[0.1, 0.2, 0.3, 0.8]", "output": "{'loss': 0.1, 'mse': 0.2, 'mae': 0.3, 'r2': 0.8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9086_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023083", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "97, 1", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt4403", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2963", "output": "{1, 2963}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2962", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023085", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 7, 3, 3, 2, 3]", "output": "[9, 10, 6, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023086", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[28, 28, 21, 21, 21, 19, 19, 10], 8", "output": "[28, 28, 21, 21, 21, 19, 19, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023087", "code": "def calculate_cube_volume(width, height, depth):\n    volume = width * height * depth\n    return volume\n", "entry_point": "calculate_cube_volume", "input": "12, 12, 112", "output": "16128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20357_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023088", "code": "from string import ascii_lowercase\ndef extract_numerical_substrings(ts):\n    cur = []\n    res = set()\n    for c in ts:\n        if c in ascii_lowercase:\n            if cur:\n                s = ''.join(cur)\n                res.add(int(s))\n                cur = []\n        else:\n            cur.append(c)\n    else:\n        if cur:\n            s = ''.join(cur)\n            res.add(int(s))\n    return res\n", "entry_point": "extract_numerical_substrings", "input": "'a2266b2212c'", "output": "{2266, 2212}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8754_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023089", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'10 3.14'", "output": "(3.14, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023090", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'John', 'Doe'", "output": "'jdoe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023091", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "1, 2, 4", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3642", "output": "{1, 2, 3, 6, 3642, 1821, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3641", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023093", "code": "def LunarMonthDays(lunar_year, lunar_month):\n    # Define a dictionary to map lunar months to the number of days\n    lunar_month_days = {\n        1: 30, 2: 29, 3: 30, 4: 29, 5: 30, 6: 29, 7: 30, 8: 30, 9: 29, 10: 30, 11: 29, 12: 30\n    }\n    # Check if the lunar month is within the valid range\n    if lunar_month < 1 or lunar_month > 12:\n        return \"Invalid lunar month\"\n    # Return the number of days in the specified lunar month\n    return lunar_month_days[lunar_month]\n", "entry_point": "LunarMonthDays", "input": "2023, 1", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7829_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3202", "output": "{1601, 1, 3202, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023095", "code": "def score(dice):\n    score = 0\n    counts = [0] * 7  # Initialize counts for each dice face (index 1-6)\n    for roll in dice:\n        counts[roll] += 1\n    for i in range(1, 7):\n        if counts[i] >= 3:\n            if i == 1:\n                score += 1000\n            else:\n                score += i * 100\n            counts[i] -= 3\n    score += counts[1] * 100  # Add remaining 1's\n    score += counts[5] * 50   # Add remaining 5's\n    return score\n", "entry_point": "score", "input": "[1, 1, 1, 1, 1]", "output": "1200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95031_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023096", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/hom', 'exat'", "output": "'/hom/exat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023097", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[85, 88, 89, 84, 84, 80, 82]", "output": "[89, 88, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57187_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5142", "output": "{1, 2, 3, 6, 2571, 1714, 5142, 857}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023099", "code": "def evaluate_expression(tokens):\n    result, num, sign, stack = 0, 0, 1, []\n    operator = ['-', '+']\n    for token in tokens:\n        if token in operator:\n            result += sign * num\n            sign = 1 if token == '+' else -1\n            num = 0\n        else:\n            num = num * 10 + int(token)\n    result += sign * num\n    return result\n", "entry_point": "evaluate_expression", "input": "['533000', '+', '100', '+', '50', '+', '3']", "output": "533153", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48347_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023100", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "3, 4", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023101", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5074", "output": "{1, 2, 2537, 43, 5074, 118, 86, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6877", "output": "{1, 299, 13, 529, 23, 6877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023103", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "0.9, 1", "output": "0.9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023104", "code": "def dailyTemperatures(temperatures):\n    stack = []\n    result = [0] * len(temperatures)\n    for i, temp in enumerate(temperatures):\n        while stack and temp > temperatures[stack[-1]]:\n            prev_index = stack.pop()\n            result[prev_index] = i - prev_index\n        stack.append(i)\n    return result\n", "entry_point": "dailyTemperatures", "input": "[70, 71, 70, 70, 70]", "output": "[1, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134803_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023105", "code": "from typing import List\ndef extract_dataset_providers(env_var: str) -> List[str]:\n    if not env_var:\n        return []\n    return env_var.split(',')\n", "entry_point": "extract_dataset_providers", "input": "'cirrocumrquetDaaset'", "output": "['cirrocumrquetDaaset']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18804_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023106", "code": "import re\ndef decode_entities(xml_string):\n    def replace_entity(match):\n        entity = match.group(0)\n        if entity == '&amp;':\n            return '&'\n        # Add more entity replacements as needed\n        return entity\n    return re.sub(r'&\\w+;', replace_entity, xml_string)\n", "entry_point": "decode_entities", "input": "'<x>Souffl&amp;<xx>'", "output": "'<x>Souffl&<xx>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69392_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023107", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[1, 3, 2]", "output": "[1, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023108", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[10, 3, 9, 3, 8, 3, 11, 9, 9]", "output": "[3, 3, 3, 8, 9, 9, 9, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023109", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[9, 4, 7, 1]", "output": "[9, 5, 9, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023110", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "587", "output": "{1, 587}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6281", "output": "{1, 6281, 11, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023112", "code": "def simulate_login(username, password):\n    if username == 'abcdefg':\n        return 'Please Enter Valid Email Or Mobile Number'\n    elif password == '<PASSWORD>':\n        return 'Kindly Verify Your User Id Or Password And Try Again.'\n    elif username == '1234567899':\n        return 'User does not exist. Please sign up.'\n    elif username == 'valid_username' and password == 'valid_password':\n        return 'Login successful.'\n    else:\n        return 'Incorrect username or password. Please try again.'\n", "entry_point": "simulate_login", "input": "'1234567899', 'any_password'", "output": "'User does not exist. Please sign up.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145289_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7086", "output": "{1, 2, 3, 6, 7086, 3543, 2362, 1181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023114", "code": "def count_overlapping_intervals(intervals):\n    if not intervals:\n        return 0\n    intervals.sort(key=lambda x: x[0])  # Sort intervals based on start points\n    overlap_count = 0\n    for i in range(len(intervals) - 1):\n        if intervals[i][1] > intervals[i + 1][0]:\n            overlap_count += 1\n    return overlap_count\n", "entry_point": "count_overlapping_intervals", "input": "[[1, 3], [2, 5], [4, 6], [5, 7]]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143551_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023115", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(0, 3, 5, 4, 4, 1)", "output": "'0.3.5.4.4.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023116", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'330303'", "output": "'330303FFFE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023117", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'This!'", "output": "['this']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023118", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[7, 6, 6, 6, 6, 5, 5, 1, 1], 6", "output": "[[7, 6, 6, 6, 6, 5], [5, 1, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023119", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8219", "output": "{1, 8219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1796", "output": "{1, 2, 898, 1796, 4, 449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1795", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2830", "output": "{1, 2, 5, 1415, 10, 2830, 566, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2829", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8116", "output": "{1, 2, 4, 2029, 8116, 4058}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8115", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023123", "code": "def extract_session_names(file_paths):\n    session_files = {}\n    for path in file_paths:\n        if path.endswith('.raw'):\n            session_name = path.split('/')[-1].replace('.raw', '')\n            session_files.setdefault(session_name, []).append(path)\n    return session_files\n", "entry_point": "extract_session_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45982_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023124", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5482", "output": "{1, 5482, 2, 2741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5481", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023125", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1742", "output": "{1, 2, 67, 134, 871, 13, 1742, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1741", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023126", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'Hellothitttts'", "output": "'Hellothitttts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023127", "code": "def multiply_all_others(arr):\n    n = len(arr)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products to the left of each element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * arr[i - 1]\n    # Calculate products to the right of each element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * arr[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "multiply_all_others", "input": "[0, 0, 1, 2, 3, 4, 5]", "output": "[0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76715_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023128", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'ask_question', 'something_invalid'", "output": "'ask_question'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023129", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[5, 5, 0], 4", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8098", "output": "{1, 8098, 2, 4049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023131", "code": "def calculate_total_sum(videoFiles):\n    total_sum = 0\n    for video_file in videoFiles:\n        number = int(video_file.split('_')[1].split('.')[0])\n        total_sum += number\n    return total_sum\n", "entry_point": "calculate_total_sum", "input": "['video_10.mp4', 'video_20.mp4']", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146951_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023132", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "'UUU'", "output": "(0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023133", "code": "import string\ndef extract_unique_words(input_str):\n    translator = str.maketrans('', '', string.punctuation)  # Translator to remove punctuation\n    unique_words = []\n    seen_words = set()\n    for word in input_str.split():\n        cleaned_word = word.translate(translator).lower()\n        if cleaned_word not in seen_words:\n            seen_words.add(cleaned_word)\n            unique_words.append(cleaned_word)\n    return unique_words\n", "entry_point": "extract_unique_words", "input": "'Programming!'", "output": "['programming']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26247_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023134", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'Test message', 1, 2", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023135", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7309", "output": "{1, 7309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023136", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'BTCUSDT'", "output": "('BTC', 'USDT')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023137", "code": "def assign_grades(scores):\n    result_list = []\n    for score in scores:\n        if score >= 90:\n            result_list.append('A')\n        elif score >= 80:\n            result_list.append('B')\n        elif score >= 70:\n            result_list.append('C')\n        elif score >= 60:\n            result_list.append('D')\n        else:\n            result_list.append('F')\n    return result_list\n", "entry_point": "assign_grades", "input": "[65, 59, 59, 59, 65, 59, 65]", "output": "['D', 'F', 'F', 'F', 'D', 'F', 'D']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90074_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023138", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'LVI'", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9705", "output": "{1, 3235, 3, 5, 647, 9705, 15, 1941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023140", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "13", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1474", "output": "{1, 1474, 2, 737, 67, 134, 11, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023142", "code": "def find_common_elements(list1, list2):\n    # Find the common elements between the two lists using set intersection\n    common_elements = list(set(list1) & set(list2))\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[5, 7, 10], [7, 2, 3]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146440_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9875", "output": "{1, 5, 395, 79, 9875, 1975, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023144", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['1.0.0', '1.1.5', '2.0.19', '2.0.20', '2.0.0']", "output": "'2.0.20'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023145", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'10.15'", "output": "'10.15.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023146", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1247", "output": "{1, 43, 29, 1247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023147", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['2.7.5', '1.0.0', '2.6.5']", "output": "'2.7.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023148", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'ggo'", "output": "'Binary path for ggo not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023149", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'on lagei.'", "output": "'On lagei'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8815", "output": "{1, 1763, 5, 41, 43, 205, 8815, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023151", "code": "def parse_version(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "parse_version", "input": "'33.14.277'", "output": "(33, 14, 277)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65254_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023152", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'', 0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6453", "output": "{1, 3, 2151, 9, 717, 239, 6453, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023154", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "439", "output": "{1, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023155", "code": "from typing import List\nimport math\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_bytes = sum(file_sizes)\n    total_kb = math.ceil(total_bytes / 1024)\n    return total_kb\n", "entry_point": "total_size_in_kb", "input": "[10240]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90092_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "586", "output": "{1, 586, 2, 293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023157", "code": "def sum_multiples(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[5, 12, 15, 15]", "output": "47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14565_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023158", "code": "def extract_component_config(component_name, config_dict):\n    extracted_config = {}\n    for key, value in config_dict.items():\n        if component_name in key:\n            extracted_config[key] = value\n    return extracted_config\n", "entry_point": "extract_component_config", "input": "'component_x', {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38308_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023159", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 3, 4, 7, 2, 6, 3]", "output": "[2, 4, 6, 10, 6, 11, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023160", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8542", "output": "{1, 2, 8542, 4271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8541", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023161", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'eiladidossir', 12", "output": "['eiladidossir']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023162", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "10, 4", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023163", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6482", "output": "{1, 2, 7, 3241, 14, 463, 6482, 926}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6481", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023164", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[0, 0, 2, 4]", "output": "[0, 0, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023165", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6131", "output": "{1, 6131}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023166", "code": "def extract_unique_types(elements):\n    unique_types = set()  # Initialize an empty set to store unique types\n    for element in elements:\n        element_type = element.get(\"type\")  # Extract the type of the element\n        if isinstance(element_type, list):  # Check if the type is a list\n            unique_types.update(element_type)  # Add all types in the list to the set\n        else:\n            unique_types.add(element_type)  # Add the type to the set if not a list\n    return unique_types\n", "entry_point": "extract_unique_types", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29492_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023167", "code": "def password_strength_checker(password: str) -> int:\n    score = 0\n    # Length points\n    score += len(password)\n    # Uppercase and lowercase letters\n    if any(c.isupper() for c in password) and any(c.islower() for c in password):\n        score += 5\n    # Digit present\n    if any(c.isdigit() for c in password):\n        score += 5\n    # Special character present\n    special_chars = set(\"!@#$%^&*()_+-=[]{}|;:,.<>?\")\n    if any(c in special_chars for c in password):\n        score += 10\n    # Bonus points for pairs\n    for i in range(len(password) - 1):\n        if password[i].lower() == password[i + 1].lower() and password[i] != password[i + 1]:\n            score += 2\n    return score\n", "entry_point": "password_strength_checker", "input": "'AabB12!@'", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139577_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023168", "code": "def prepare_filename_string(input_string):\n    processed_string = input_string.replace(\"_\", \"-\").replace(\"|\", \"-\").replace(\" \", \"-\").replace(\"(\", \"\").replace(\")\", \"\").lower()\n    return processed_string\n", "entry_point": "prepare_filename_string", "input": "'nnm'", "output": "'nnm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145297_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8618", "output": "{1, 2, 8618, 139, 4309, 278, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8617", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023170", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'AIzaSBz1BB<KEY>', ''", "output": "'AIzaSBz1BB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023171", "code": "# Define the memory protection constants and their attributes\nMEMORY_PROTECTION_ATTRIBUTES = {\n    0x01: ['PAGE_NOACCESS'],\n    0x02: ['PAGE_READONLY'],\n    0x04: ['PAGE_READWRITE'],\n    0x08: ['PAGE_WRITECOPY'],\n    0x100: ['PAGE_GUARD'],\n    0x200: ['PAGE_NOCACHE'],\n    0x400: ['PAGE_WRITECOMBINE'],\n    0x40000000: ['PAGE_TARGETS_INVALID', 'PAGE_TARGETS_NO_UPDATE']\n}\ndef get_protection_attributes(memory_protection):\n    attributes = []\n    for constant, attr_list in MEMORY_PROTECTION_ATTRIBUTES.items():\n        if memory_protection & constant:\n            attributes.extend(attr_list)\n    return attributes\n", "entry_point": "get_protection_attributes", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63843_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023172", "code": "def decode_le_bytes(bytes):\n    value = 0\n    for b in reversed(bytes):\n        value = (value << 8) + b\n    return value\n", "entry_point": "decode_le_bytes", "input": "[18, 52, 86, 120]", "output": "2018915346", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111274_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023173", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "9, 14, 10", "output": "(9, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023174", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[2, 3, 4, 5, 6, 8], 3", "output": "[2, 4, 5, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023175", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6927", "output": "{1, 3, 2309, 6927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2382", "output": "{1, 2, 3, 6, 1191, 397, 2382, 794}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023177", "code": "def calculate_tracking_error(actual_size, desired_size):\n    vertical_error = desired_size[0] - actual_size[0]\n    horizontal_error = desired_size[1] - actual_size[1]\n    total_error = vertical_error**2 + horizontal_error**2\n    return total_error\n", "entry_point": "calculate_tracking_error", "input": "(0, 5), (10, 10)", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30005_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023178", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 3, 2, 2, 2, 2, 7, 3]", "output": "[7, 4, 4, 5, 6, 7, 13, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023179", "code": "from typing import List\ndef generate_version_number(scene_files: List[str]) -> str:\n    highest_version = 0\n    for file in scene_files:\n        if file.startswith(\"file_v\"):\n            version = int(file.split(\"_v\")[1])\n            highest_version = max(highest_version, version)\n    new_version = highest_version + 1 if highest_version > 0 else 1\n    return f\"v{new_version}\"\n", "entry_point": "generate_version_number", "input": "['file_v1', 'file_v2', 'file_v3']", "output": "'v4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11750_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023180", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023181", "code": "def update_download_status(incomplete_downloads):\n    updated_incomplete_downloads = []\n    for index, download in enumerate(incomplete_downloads):\n        if index % 2 == 0:  # Simulating successful download for odd-indexed files\n            continue\n        else:\n            updated_incomplete_downloads.append(download)\n    return updated_incomplete_downloads\n", "entry_point": "update_download_status", "input": "['file1', 'file2', 'file3']", "output": "['file2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48055_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023182", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', -3, -3", "output": "(-2, -3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023183", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9969", "output": "{1, 3, 9969, 3323}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8978", "output": "{1, 2, 67, 134, 4489, 8978}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023185", "code": "from typing import List\ndef bubble_sort_and_count_swaps(arr: List[int]) -> int:\n    swaps = 0\n    n = len(arr)\n    for i in range(n):\n        for j in range(n - i - 1):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swaps += 1\n    return swaps\n", "entry_point": "bubble_sort_and_count_swaps", "input": "[5, 4, 2, 1, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135568_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023186", "code": "def calculate_average_excluding_outliers(numbers, threshold):\n    if not numbers:\n        return 0\n    median = sorted(numbers)[len(numbers) // 2]\n    filtered_numbers = [num for num in numbers if abs(num - median) <= threshold * median]\n    if not filtered_numbers:\n        return 0\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_excluding_outliers", "input": "[15, 20, 25], 0.25", "output": "20.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65048_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023187", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[51], 10", "output": "[51]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023188", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.config.DjangAauocefig'", "output": "'DjangAauocefig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023189", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "3", "output": "{'int': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023190", "code": "def update_board(board):\n    new_board = board.copy()\n    for i in range(len(board)):\n        neighbors = sum(board[max(0, i-1):min(len(board), i+2)])\n        if board[i] == 0 and neighbors == 3:\n            new_board[i] = 1\n        elif board[i] == 1 and (neighbors < 2 or neighbors > 3):\n            new_board[i] = 0\n    return new_board\n", "entry_point": "update_board", "input": "[1, -1, 1, 0, 0, -1, 0]", "output": "[0, -1, 0, 0, 0, -1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104227_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023191", "code": "def rotate(arr, n):\n    for _ in range(n):\n        x = arr[-1]\n        for i in range(len(arr) - 1, 0, -1):\n            arr[i] = arr[i - 1]\n        arr[0] = x\n    return arr\n", "entry_point": "rotate", "input": "[3, 1, 3, 5, 6], 1", "output": "[6, 3, 1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51969_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023192", "code": "def generate_password(email):\n    # Extract domain name from email\n    domain = email.split('@')[-1]\n    # Reverse the domain name\n    reversed_domain = domain[::-1]\n    # Combine reversed domain with \"SecurePW\" to generate password\n    password = reversed_domain + \"SecurePW\"\n    return password\n", "entry_point": "generate_password", "input": "'user@xexxe'", "output": "'exxexSecurePW'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104790_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023193", "code": "def check_bet_equivalence(hash_bets, indices_bets, binaries_bets):\n    return hash_bets == indices_bets and indices_bets == binaries_bets\n", "entry_point": "check_bet_equivalence", "input": "1, 2, 3", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39072_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023194", "code": "def calculate_submatrix_sum(ca, i, j):\n    n = len(ca)\n    m = len(ca[0])\n    prefix_sum = [[0 for _ in range(m)] for _ in range(n)]\n    for row in range(n):\n        for col in range(m):\n            prefix_sum[row][col] = ca[row][col]\n            if row > 0:\n                prefix_sum[row][col] += prefix_sum[row - 1][col]\n            if col > 0:\n                prefix_sum[row][col] += prefix_sum[row][col - 1]\n            if row > 0 and col > 0:\n                prefix_sum[row][col] -= prefix_sum[row - 1][col - 1]\n    submatrix_sum = prefix_sum[i][j]\n    return submatrix_sum\n", "entry_point": "calculate_submatrix_sum", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2, 2", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72883_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023195", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'SpaacW'", "output": "('SpaacW', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023196", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'osiensound'", "output": "'Value of osiensound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9939", "output": "{3, 1, 9939, 3313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9938", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023198", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'BoBBBoBBBb'", "output": "'BoBBBoBBBbEuroPython'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023199", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "45647, 'eeh11', 'innn'", "output": "'acl/45647/interfaces/eeh11_innn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023200", "code": "from typing import List\ndef above_average(scores: List[int]) -> float:\n    total_sum = sum(scores)\n    class_average = total_sum / len(scores)\n    above_avg_scores = [score for score in scores if score > class_average]\n    if above_avg_scores:\n        above_avg_sum = sum(above_avg_scores)\n        above_avg_count = len(above_avg_scores)\n        above_avg_average = above_avg_sum / above_avg_count\n        return above_avg_average\n    else:\n        return 0.0\n", "entry_point": "above_average", "input": "[20, 30]", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77722_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023201", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "0, 4, '+'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023202", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "78, 78", "output": "156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023203", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return []\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    max_length = max(dp)\n    result = []\n    for i in range(n - 1, -1, -1):\n        if dp[i] == max_length:\n            result.append(nums[i])\n            max_length -= 1\n    return result[::-1]\n", "entry_point": "longest_increasing_subsequence", "input": "[2, 5, 10, 0, 1]", "output": "[2, 5, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20468_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023204", "code": "def calculate_averages(students):\n    total_age = 0\n    total_grade = 0\n    for student in students:\n        total_age += student[\"age\"]\n        total_grade += student[\"grade\"]\n    num_students = len(students)\n    average_age = round(total_age / num_students, 2)\n    average_grade = round(total_grade / num_students, 2)\n    return average_age, average_grade\n", "entry_point": "calculate_averages", "input": "[{'age': 25.0, 'grade': 87.0}, {'age': 25.0, 'grade': 88.6}]", "output": "(25.0, 87.8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50549_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023205", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/user/docs/solmees.txt'", "output": "'solmees'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023206", "code": "def find_earliest_date(dates):\n    earliest_date = dates[0]\n    for date in dates[1:]:\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date\n", "entry_point": "find_earliest_date", "input": "['2022-01-16', '2022-01-15', '2022-02-01']", "output": "'2022-01-15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110382_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9206", "output": "{1, 2, 4603, 9206}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023208", "code": "from typing import List\ndef min_ram_changes(devices: List[int]) -> int:\n    total_ram = sum(devices)\n    avg_ram = total_ram // len(devices)\n    changes_needed = sum(abs(avg_ram - ram) for ram in devices)\n    return changes_needed\n", "entry_point": "min_ram_changes", "input": "[8, 8, 0, 0]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74774_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023209", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4436", "output": "{1, 2, 4, 2218, 4436, 1109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4435", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023210", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['doge2000']", "output": "2000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023211", "code": "def count_battleships(board):\n    count = 0\n    for i in range(len(board)):\n        for j in range(len(board[0])):\n            if board[i][j] == 'X' and (i == 0 or board[i - 1][j] != 'X') and (j == 0 or board[i][j - 1] != 'X'):\n                count += 1\n    return count\n", "entry_point": "count_battleships", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32251_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023212", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return []\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    max_length = max(dp)\n    max_index = dp.index(max_length)\n    result = [nums[max_index]]\n    current_length = max_length - 1\n    for i in range(max_index - 1, -1, -1):\n        if dp[i] == current_length and nums[i] < result[-1]:\n            result.append(nums[i])\n            current_length -= 1\n    return result[::-1]\n", "entry_point": "longest_increasing_subsequence", "input": "[1, 11, 12, 13]", "output": "[1, 11, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9591_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023213", "code": "def parse_afni_output(output_string):\n    lines = output_string.splitlines()\n    values_list = []\n    for line in lines:\n        try:\n            float_value = float(line)\n            values_list.append(float_value)\n        except ValueError:\n            pass  # Ignore lines that are not valid float values\n    return values_list\n", "entry_point": "parse_afni_output", "input": "'-2.5'", "output": "[-2.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023214", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[10, 9, 7, 8, 9]", "output": "[7, 8, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt44", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023215", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'FiileFiles\\\\Python\\\\script.pyPr'", "output": "'FiileFiles\\\\Python\\\\script.pyPr/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023216", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[5, 10, 14, 1]", "output": "(14, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023217", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[0, 0, 2, 6, 2, 10]", "output": "[0, 0, 2, 6, 2, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023218", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "['F', 'F']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023219", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'files/docdata.txt', None", "output": "('files/docdata.txt', 'files/docdata.txt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023220", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'gdog'", "output": "{'gdog': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104136_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023221", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "69", "output": "'E'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023222", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "5, 6", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023223", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3896", "output": "{1, 2, 4, 487, 8, 974, 3896, 1948}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3895", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023224", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'308535385114308535385114', '279'", "output": "'308535385114308535385114279'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023225", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 2, 9]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023226", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[95, 95, 95, 95, 90]", "output": "94.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023227", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[3, 2, 5, 6, 3, 1]", "output": "[2, 1, 2, 2, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023228", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'1.102.5.2'", "output": "(1, 102, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023229", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023230", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "2, 3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023231", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "8", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023232", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'1234-5678-2-3'", "output": "'1234-5678-2-3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023233", "code": "def custom_product(nums):\n    product = 1\n    for num in nums:\n        product *= num\n    return product\n", "entry_point": "custom_product", "input": "[6, 8]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47092_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023234", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "23", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023235", "code": "def sum_multiples_of_3_or_5(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44443_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023236", "code": "def map_variable_to_abbreviation(variable_name):\n    variable_mappings = {\n        '10m_u_component_of_wind': 'u10',\n        '10m_v_component_of_wind': 'v10',\n        '2m_dewpoint_temperature': 'd2m',\n        '2m_temperature': 't2m',\n        'cloud_base_height': 'cbh',\n        'precipitation_type': 'ptype',\n        'total_cloud_cover': 'tcc',\n        'total_precipitation': 'tp',\n        'runoff': 'ro',\n        'potential_evaporation': 'pev',\n        'evaporation': 'e',\n        'maximum_individual_wave_height': 'hmax',\n        'significant_height_of_combined_wind_waves_and_swell': 'swh',\n        'peak_wave_period': 'pp1d',\n        'sea_surface_temperature': 'sst'\n    }\n    if variable_name in variable_mappings:\n        return variable_mappings[variable_name]\n    else:\n        return \"Abbreviation not found\"\n", "entry_point": "map_variable_to_abbreviation", "input": "'total_precipitation'", "output": "'tp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131015_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023237", "code": "def extract_char_frequencies(input_string: str) -> dict:\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "extract_char_frequencies", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023238", "code": "import re\ndef count_words(text):\n    word_counts = {}\n    # Split the text into individual words\n    words = text.split()\n    for word in words:\n        # Remove punctuation marks and convert to lowercase\n        cleaned_word = re.sub(r'[^\\w\\s]', '', word).lower()\n        # Update word count in the dictionary\n        if cleaned_word in word_counts:\n            word_counts[cleaned_word] += 1\n        else:\n            word_counts[cleaned_word] = 1\n    return word_counts\n", "entry_point": "count_words", "input": "'Hello!'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123802_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023239", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abc1a#def ghi'", "output": "['abc', 'a', 'def', 'ghi']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023240", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[4, 6, 6, 5]", "output": "[10, 12, 11, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023241", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "6, 6", "output": "46656", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023242", "code": "def count_active_inactive_images(images):\n    active_count = 0\n    inactive_count = 0\n    for image in images:\n        if image.get('is_active', False):\n            active_count += 1\n        else:\n            inactive_count += 1\n    return {'active_count': active_count, 'inactive_count': inactive_count}\n", "entry_point": "count_active_inactive_images", "input": "[]", "output": "{'active_count': 0, 'inactive_count': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79578_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023243", "code": "from typing import List, Dict\ndef filter_parties(parties: List[Dict[str, str]], ideology: str) -> List[str]:\n    filtered_parties = []\n    for party in parties:\n        if party.get('ideology') == ideology:\n            filtered_parties.append(party.get('name'))\n    return filtered_parties\n", "entry_point": "filter_parties", "input": "[], 'SomeIdeology'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61184_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023244", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "318", "output": "{1, 2, 3, 6, 106, 53, 318, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6704", "output": "{1, 2, 419, 4, 838, 8, 1676, 6704, 16, 3352}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6703", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023246", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[4, 4, 3, 3, 2, 1]", "output": "[4, 4, 3, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023247", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 88, 90, 94, 100]", "output": "90.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61985_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023248", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "4", "output": "[4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023249", "code": "def calculate_total_kinetic_energy(masses, velocities):\n    total_kinetic_energy = sum(0.5 * mass * velocity**2 for mass, velocity in zip(masses, velocities))\n    return round(total_kinetic_energy, 2)\n", "entry_point": "calculate_total_kinetic_energy", "input": "[1, 2, 3], [3, 4, 2]", "output": "26.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128860_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023250", "code": "def longest_equal_even_odd_subarray(arr):\n    diff_indices = {0: -1}\n    max_length = 0\n    diff = 0\n    for i, num in enumerate(arr):\n        diff += 1 if num % 2 != 0 else -1\n        if diff in diff_indices:\n            max_length = max(max_length, i - diff_indices[diff])\n        else:\n            diff_indices[diff] = i\n    return max_length\n", "entry_point": "longest_equal_even_odd_subarray", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99623_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8791", "output": "{1, 59, 149, 8791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023252", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'11.101130.30'", "output": "(11, 101130, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023253", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if N > len(sorted_scores):\n        N = len(sorted_scores)\n    return sum(sorted_scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[70, 70, 65], 3", "output": "68.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132945_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023254", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "15, 4", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023255", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "7", "output": "'SDL_LOG_CATEGORY_INPUT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5968", "output": "{1, 2, 4, 2984, 8, 746, 5968, 16, 1492, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5967", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8697", "output": "{1, 3, 39, 13, 2899, 8697, 669, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "705", "output": "{1, 705, 3, 5, 235, 141, 15, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023259", "code": "def dump_db(data):\n    if not data:\n        return \"No data to dump\"\n    columns = list(data[0].keys())\n    output = [','.join(columns)]\n    for record in data:\n        values = [str(record.get(col, '')) for col in columns]\n        output.append(','.join(values))\n    return '\\n'.join(output)\n", "entry_point": "dump_db", "input": "[]", "output": "'No data to dump'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57639_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023260", "code": "def count_paths(n):\n    s = [[0] * 10 for _ in range(n + 1)]\n    s[1] = [0] + [1] * 9\n    mod = 1000 ** 3\n    for i in range(2, n + 1):\n        for j in range(0, 9 + 1):\n            if j >= 1:\n                s[i][j] += s[i - 1][j - 1]\n            if j <= 8:\n                s[i][j] += s[i - 1][j + 1]\n    return sum(s[n]) % mod\n", "entry_point": "count_paths", "input": "2", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21515_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023261", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3663", "output": "'1 hr 1 min 3 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023262", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "6.6, 1", "output": "6.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt59", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023263", "code": "def optimize_circuit(template_circuits, main_circuit):\n    inverses = {template: template[::-1] for template in template_circuits}\n    optimized = main_circuit\n    for template, inverse in inverses.items():\n        optimized = optimized.replace(template, inverse)\n    return optimized\n", "entry_point": "optimize_circuit", "input": "['B'], 'A'", "output": "'A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7040_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023264", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[42, 50, 20, 4, 20, 34, 5]", "output": "[42, 50, 20, 4, 20, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023265", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1214", "output": "{1, 2, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1213", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023266", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[5, 0, 0, 60, 60, 60, 60, 61]", "output": "60.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023267", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "7", "output": "[(1, 7), (7, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023268", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[-3, -5, 6]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023269", "code": "def extract_peak_locations(peaks_or_locations):\n    dimensions = set()\n    for peak in peaks_or_locations:\n        dimensions.update(peak.keys())\n    peak_locations = []\n    for peak in peaks_or_locations:\n        location = []\n        for dim in dimensions:\n            location.append(peak.get(dim, 0.0))\n        peak_locations.append(location)\n    return peak_locations\n", "entry_point": "extract_peak_locations", "input": "[{}, {}, {}, {}, {}, {}, {}]", "output": "[[], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93547_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023270", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'abc-38xyz'", "output": "-38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023271", "code": "def concatenate_vectors(vector_arrays):\n    concatenated_list = []\n    for vector_array in vector_arrays:\n        for vector in vector_array:\n            concatenated_list.append(vector)\n    return concatenated_list\n", "entry_point": "concatenate_vectors", "input": "[[4], [4]]", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15071_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2267", "output": "{1, 2267}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2266", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "441", "output": "{1, 3, 7, 9, 49, 147, 21, 441, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023274", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['doge100']", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023275", "code": "def find_max_checkpoint_less_than_threshold(SAVED_CHECKPOINTS, THRESHOLD):\n    sorted_checkpoints = sorted(SAVED_CHECKPOINTS)\n    max_checkpoint = -1\n    for checkpoint in sorted_checkpoints:\n        if checkpoint < THRESHOLD:\n            max_checkpoint = checkpoint\n        else:\n            break\n    return max_checkpoint\n", "entry_point": "find_max_checkpoint_less_than_threshold", "input": "[15000, 18000, 20001, 19000], 21000", "output": "20001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9150_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023276", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "0, -1, -2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023277", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -5.0, 1.3880000000000012", "output": "-3.6119999999999988", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023278", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[90, 90, 90, 90, 84]", "output": "88.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023279", "code": "def count_surface_elements(_ptsOnSrf, _polyCrv, _panels):\n    surface_counts = {'Points': len(_ptsOnSrf), 'Curves': len(_polyCrv), 'Panels': len(_panels)}\n    return surface_counts\n", "entry_point": "count_surface_elements", "input": "[0, 1, 2, 3], [0, 1], [0, 1, 2]", "output": "{'Points': 4, 'Curves': 2, 'Panels': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124038_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023280", "code": "def reverse_words_in_string(input_string):\n    words = input_string.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words_in_string", "input": "'sUese'", "output": "'eseUs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137200_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023281", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVHVAC/fielbdir/somefile.txt'", "output": "('HVHVAC/fielbdir', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8972", "output": "{1, 2, 2243, 4, 4486, 8972}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8971", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023283", "code": "def diagnose(data):\n    char_counts = {}\n    for char in data:\n        if char in char_counts:\n            char_counts[char] += 1\n        else:\n            char_counts[char] = 1\n    return char_counts\n", "entry_point": "diagnose", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98386_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023284", "code": "def max_square_submatrix(matrix):\n    n = len(matrix)\n    aux_matrix = [[0 for _ in range(n)] for _ in range(n)]\n    # Copy the first row and first column as is\n    for i in range(n):\n        aux_matrix[i][0] = matrix[i][0]\n        aux_matrix[0][i] = matrix[0][i]\n    max_size = 0\n    for i in range(1, n):\n        for j in range(1, n):\n            if matrix[i][j] == 1:\n                aux_matrix[i][j] = min(aux_matrix[i-1][j], aux_matrix[i][j-1], aux_matrix[i-1][j-1]) + 1\n                max_size = max(max_size, aux_matrix[i][j])\n    return max_size ** 2\n", "entry_point": "max_square_submatrix", "input": "[[0, 0], [0, 1]]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17968_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023285", "code": "def parse_default_app_config(default_app_config):\n    # Split the input string at the last occurrence of '.'\n    split_index = default_app_config.rfind('.')\n    app_name = default_app_config[:split_index]\n    config_name = default_app_config[split_index + 1:]\n    # Create a dictionary with extracted values\n    parsed_info = {'app_name': app_name, 'config_name': config_name}\n    return parsed_info\n", "entry_point": "parse_default_app_config", "input": "'aappli.aapplia'", "output": "{'app_name': 'aappli', 'config_name': 'aapplia'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106533_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023286", "code": "import math\ndef getRow(rowIndex):\n    result = [1]\n    if rowIndex == 0:\n        return result\n    n = rowIndex\n    for i in range(int(math.ceil((float(rowIndex) + 1) / 2) - 1)):\n        result.append(result[-1] * n / (rowIndex - n + 1))\n        n -= 1\n    if rowIndex % 2 == 0:\n        result.extend(result[-2::-1])\n    else:\n        result.extend(result[::-1])\n    return result\n", "entry_point": "getRow", "input": "4", "output": "[1, 4.0, 6.0, 4.0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127863_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023287", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[0, 0, 1, 2, 5]", "output": "{0: 2, 1: 1, 2: 1, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023288", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[]", "output": "[0, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023289", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "11", "output": "'1011'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023290", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'wohrldhellwo'", "output": "'w.o.h.r.l.d.h.e.l.l.w.o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023291", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[5, 4, 2, 5, 3, 1, 6, 5]", "output": "[5, 9, 11, 16, 19, 20, 26, 31]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023292", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/folderA/folderB/mple.txt'", "output": "'mple.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5659", "output": "{1, 5659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1957", "output": "{1, 19, 1957, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1956", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023295", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "845", "output": "{1, 65, 5, 169, 13, 845}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt844", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023296", "code": "def create_address(params):\n    if params is None:\n        params = {}\n    address = \"\"\n    if 'street' in params:\n        address += params['street'] + \", \"\n    if 'city' in params:\n        address += params['city']\n    return address\n", "entry_point": "create_address", "input": "None", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93998_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023297", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4123", "output": "{1, 133, 7, 589, 19, 217, 4123, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023298", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'keye y'", "output": "['keye', 'y']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6371", "output": "{1, 6371, 277, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023300", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "'WordKeyword', 'Keyword'", "output": "'Word'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2725", "output": "{1, 545, 5, 2725, 109, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2724", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5527", "output": "{1, 5527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023303", "code": "def sum_of_diagonals(mat):\n    res = 0\n    i, j = 0, 0\n    while j < len(mat):\n        res += mat[i][j]\n        i += 1\n        j += 1\n    i, j = 0, len(mat) - 1\n    while j >= 0:\n        if i != j:\n            res += mat[i][j]\n        i += 1\n        j -= 1\n    return res\n", "entry_point": "sum_of_diagonals", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84275_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023304", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[10, 8, 10, 9, 5, 8, 9]", "output": "[10, 8, 9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023305", "code": "import os\ndef expanduser(path):\n    \"\"\"\n    Expand ~ and ~user constructions.\n    Includes a workaround for http://bugs.python.org/issue14768\n    \"\"\"\n    expanded = os.path.expanduser(path)\n    if path.startswith(\"~/\") and expanded.startswith(\"//\"):\n        expanded = expanded[1:]\n    return expanded\n", "entry_point": "expanduser", "input": "'se~/fseocold'", "output": "'se~/fseocold'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6640_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023306", "code": "def convert_integers(numbers):\n    converted_list = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            converted_list.append('even_odd')\n        elif num % 2 == 0:\n            converted_list.append('even')\n        elif num % 3 == 0:\n            converted_list.append('odd')\n        else:\n            converted_list.append(num)\n    return converted_list\n", "entry_point": "convert_integers", "input": "[4, 5, 3, 8]", "output": "['even', 5, 'odd', 'even']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77525_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023307", "code": "def calculate_cube_volume(width, height, depth):\n    volume = width * height * depth\n    return volume\n", "entry_point": "calculate_cube_volume", "input": "2, 3, 2793", "output": "16758", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20357_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023308", "code": "from typing import List\ndef calculate_max_score(scores: List[int]) -> int:\n    if not scores:\n        return 0\n    n = len(scores)\n    if n == 1:\n        return scores[0]\n    dp = [0] * n\n    dp[0] = scores[0]\n    dp[1] = max(scores[0], scores[1])\n    for i in range(2, n):\n        dp[i] = max(scores[i] + dp[i - 2], dp[i - 1])\n    return dp[-1]\n", "entry_point": "calculate_max_score", "input": "[10, 5, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64203_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023309", "code": "from typing import List\ndef custom_reduce_product(nums: List[int]) -> int:\n    result = 1\n    for num in nums:\n        result *= num\n    return result\n", "entry_point": "custom_reduce_product", "input": "[4, 4]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84659_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023310", "code": "def f(a, *, b=None, c=None, d=None):\n    if d is not None:\n        return a + b + c + d\n    elif c is not None:\n        return a + b + c\n    elif b is not None:\n        return a + b\n    else:\n        return a\n", "entry_point": "f", "input": "3, b=4, c=6", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103404_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2644", "output": "{1, 2, 4, 1322, 2644, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2643", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023312", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7593", "output": "{3, 1, 7593, 2531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023313", "code": "from typing import List, Tuple, Optional\ndef parse_tokens(text: str) -> List[Tuple[str, Optional[str]]]:\n    tokens = []\n    current_token = ''\n    for char in text:\n        if char.isalnum() or char in '._':\n            current_token += char\n        else:\n            if current_token:\n                if current_token.replace('.', '', 1).isdigit():\n                    tokens.append(('FLOAT', current_token))\n                else:\n                    tokens.append(('IDENTIFIER', current_token))\n                current_token = ''\n            if char == '(':\n                tokens.append(('LPAREN', None))\n            elif char == ')':\n                tokens.append(('RPAREN', None))\n            elif char == ',':\n                tokens.append((',', None))\n    if current_token:\n        if current_token.replace('.', '', 1).isdigit():\n            tokens.append(('FLOAT', current_token))\n        else:\n            tokens.append(('IDENTIFIER', current_token))\n    return tokens\n", "entry_point": "parse_tokens", "input": "'rr'", "output": "[('IDENTIFIER', 'rr')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40570_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023314", "code": "def module_name_lengths(modules):\n    module_lengths = {}\n    for module in modules:\n        if not module.startswith('.'):\n            module_lengths[module] = len(module)\n    return module_lengths\n", "entry_point": "module_name_lengths", "input": "['ucf101', 'hmdb51', 'cvpr_le']", "output": "{'ucf101': 6, 'hmdb51': 6, 'cvpr_le': 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107858_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023315", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\e\\\\beg}\\\\iula'", "output": "'\\\\e\\\\beg}\\\\iula'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023316", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'5.0.0'", "output": "(5, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023317", "code": "def find_pairs_sum_to_target(nums, target):\n    seen = {}\n    pairs = []\n    for num in nums:\n        diff = target - num\n        if diff in seen:\n            pairs.append([num, diff])\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs_sum_to_target", "input": "[1, 3], 4", "output": "[[3, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23906_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023318", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[7, [5], 9, 2, [6, 8], [6, [8]]]", "output": "[7, 5, 9, 2, 6, 8, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023319", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4465", "output": "{1, 5, 235, 47, 4465, 19, 893, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023320", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff57\uff4f\uff52\uff57\uff4c\uff44'", "output": "'worwld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023321", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'wtai1ss1t'", "output": "'<p>wtai1ss1t</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023322", "code": "def generate_error_endpoint(blueprint_name, url_prefix):\n    # Concatenate the URL prefix with the blueprint name to form the complete API endpoint URL\n    api_endpoint = f\"{url_prefix}/{blueprint_name}\"\n    return api_endpoint\n", "entry_point": "generate_error_endpoint", "input": "'ererrror', '/aiiaipis'", "output": "'/aiiaipis/ererrror'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69413_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023323", "code": "from typing import List\ndef above_average_scores(scores: List[int]) -> List[int]:\n    if not scores:\n        return []\n    average_score = sum(scores) / len(scores)\n    above_average = [score for score in scores if score > average_score]\n    return above_average\n", "entry_point": "above_average_scores", "input": "[70, 75, 80, 91, 90, 90, 85, 91]", "output": "[91, 90, 90, 85, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44803_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023324", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "'Headaer'", "output": "'Headaer\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023325", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    # Split the input string at the '.' character\n    app_name, config_class = default_app_config.split('.')[:2]\n    # Return a tuple containing the app name and configuration class name\n    return app_name, config_class\n", "entry_point": "parse_default_app_config", "input": "'gunmel.ap'", "output": "('gunmel', 'ap')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77517_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023326", "code": "def _clean_binary_segmentation(input, percentile):\n    sorted_input = sorted(input)\n    threshold_index = int(len(sorted_input) * percentile / 100)\n    below_percentile = sorted_input[:threshold_index]\n    equal_above_percentile = sorted_input[threshold_index:]\n    return below_percentile, equal_above_percentile\n", "entry_point": "_clean_binary_segmentation", "input": "[], 50", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96298_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023327", "code": "from typing import List\ndef total_images(pages: List[int]) -> int:\n    total_images_count = sum(pages)\n    return total_images_count\n", "entry_point": "total_images", "input": "[37]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29291_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023328", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'xyz,pqr->abc'", "output": "(['xyz', 'pqr'], 'abc')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1967", "output": "{1, 7, 281, 1967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023330", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[6, 7, 7, 12, 13, 13, 13, 13, 13]", "output": "[6, 7, 7, 12, 13, 13, 13, 13, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023331", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "802.0, 0", "output": "802.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023332", "code": "def pack_subtasks(subtasks, bin_capacity):\n    bins = 0\n    current_bin_weight = 0\n    remaining_capacity = bin_capacity\n    for subtask in subtasks:\n        if subtask > bin_capacity:\n            bins += 1\n            current_bin_weight = 0\n            remaining_capacity = bin_capacity\n        if subtask <= remaining_capacity:\n            current_bin_weight += subtask\n            remaining_capacity -= subtask\n        else:\n            bins += 1\n            current_bin_weight = subtask\n            remaining_capacity = bin_capacity - subtask\n    if current_bin_weight > 0:\n        bins += 1\n    return bins\n", "entry_point": "pack_subtasks", "input": "[5, 5, 5, 5, 5, 5], 5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28590_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023333", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[60, 80], 2", "output": "70.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023334", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[90, 91, 92, 91, 93]", "output": "91.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1503", "output": "{1, 3, 167, 9, 501, 1503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023336", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6961", "output": "{1, 6961}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023337", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import pdsp'", "output": "'pdsp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023338", "code": "import sys\ntry:\n    import cPickle as pickle  # Python 2.x\nexcept ImportError:\n    import pickle  # Python 3.x\ndef serialize_deserialize(obj):\n    # Serialize the object\n    serialized_obj = pickle.dumps(obj)\n    # Deserialize the byte stream\n    deserialized_obj = pickle.loads(serialized_obj)\n    return deserialized_obj\n", "entry_point": "serialize_deserialize", "input": "[2, 3, 3, 1, 3, 2, 1, 2]", "output": "[2, 3, 3, 1, 3, 2, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113484_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023339", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'name=Dima=namn==nam'", "output": "{'name': 'Dima=namn==nam'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023340", "code": "from typing import List\ndef calculate_sum_and_max_odd(numbers: List[int]) -> int:\n    even_sum = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return even_sum * max_odd\n", "entry_point": "calculate_sum_and_max_odd", "input": "[2, 8, 9]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2830_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023341", "code": "import re\ndef extract_url_patterns(code_snippet):\n    url_patterns = []\n    path_pattern = re.compile(r\"path\\(['\\\"](.*?)['\\\"].*?(\\w+)\\.as_view\\(\\)\")\n    router_pattern = re.compile(r\"router\\.register\\(r['\\\"](.*?)['\\\"],\\s*(\\w+)\")\n    path_matches = path_pattern.findall(code_snippet)\n    router_matches = router_pattern.findall(code_snippet)\n    for path_match in path_matches:\n        url_patterns.append((path_match[0], path_match[1]))\n    for router_match in router_matches:\n        url_patterns.append((router_match[0], router_match[1]))\n    return url_patterns\n", "entry_point": "extract_url_patterns", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33646_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2402", "output": "{1, 2402, 2, 1201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023343", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "5, 10", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023344", "code": "def simplify_string(input_str):\n    simplified_result = \"\"\n    for char in input_str:\n        if char == 'a':\n            continue\n        elif char == 'b':\n            simplified_result += 'z'\n        else:\n            simplified_result += char\n    return simplified_result[::-1]\n", "entry_point": "simplify_string", "input": "'abracadabra'", "output": "'rzdcrz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100095_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023345", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'ppatpexamexampathph'", "output": "'ppatpexamexampathph'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023346", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "416", "output": "{416, 1, 2, 32, 4, 104, 8, 13, 208, 16, 52, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt415", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3113", "output": "{283, 1, 11, 3113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023348", "code": "import math\ndef getRow(rowIndex):\n    result = [1]\n    if rowIndex == 0:\n        return result\n    n = rowIndex\n    for i in range(int(math.ceil((float(rowIndex) + 1) / 2) - 1)):\n        result.append(result[-1] * n / (rowIndex - n + 1))\n        n -= 1\n    if rowIndex % 2 == 0:\n        result.extend(result[-2::-1])\n    else:\n        result.extend(result[::-1])\n    return result\n", "entry_point": "getRow", "input": "2", "output": "[1, 2.0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127863_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023349", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7946", "output": "{1, 2, 3973, 137, 7946, 274, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023350", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "2, 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023351", "code": "def find_unique_element(A):\n    result = 0\n    for number in A:\n        result ^= number\n    return result\n", "entry_point": "find_unique_element", "input": "[1, 1, 2, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26858_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023352", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9347", "output": "{1, 9347, 13, 719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9346", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023353", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[1, 1, 2, -1, 2]", "output": "{1, 2, -1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023354", "code": "from datetime import datetime, timedelta\ndef filter_servers(server_list: list, server_type: str, last_check_days: int) -> list:\n    filtered_servers = []\n    today = datetime.now()\n    for server in server_list:\n        if all(server.get(field) and server[field] != 'null' for field in server.keys()) and \\\n           server['server_type'] == server_type and \\\n           today - datetime.strptime(server['last_check'], '%Y-%m-%d') <= timedelta(days=last_check_days):\n            filtered_servers.append(server['model_name'])\n    return filtered_servers\n", "entry_point": "filter_servers", "input": "[], 'web', 30", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70260_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023355", "code": "from typing import List, Tuple\ndef longest_contiguous_subarray_above_threshold(temperatures: List[int], threshold: float) -> Tuple[int, int]:\n    start = 0\n    end = 0\n    max_length = 0\n    current_sum = 0\n    max_start = 0\n    while end < len(temperatures):\n        current_sum += temperatures[end]\n        while start <= end and current_sum / (end - start + 1) <= threshold:\n            current_sum -= temperatures[start]\n            start += 1\n        if end - start + 1 > max_length:\n            max_length = end - start + 1\n            max_start = start\n        end += 1\n    return max_start, max_start + max_length - 1\n", "entry_point": "longest_contiguous_subarray_above_threshold", "input": "[1, 2, 1, 3, 5], 2.0", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18174_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023356", "code": "def find_min_synaptic_conductance_time(synaptic_conductance_values):\n    min_value = synaptic_conductance_values[0]\n    min_time = 1\n    for i in range(1, len(synaptic_conductance_values)):\n        if synaptic_conductance_values[i] < min_value:\n            min_value = synaptic_conductance_values[i]\n            min_time = i + 1  # Time points start from 1\n    return min_time\n", "entry_point": "find_min_synaptic_conductance_time", "input": "[0.5, 0.7, 0.6, 0.3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31704_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023357", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[10, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105369_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023358", "code": "from typing import List\ndef find_starting_station(gas: List[int], cost: List[int]) -> int:\n    n = len(gas)\n    total_tank, curr_tank, start = 0, 0, 0\n    for i in range(n):\n        total_tank += gas[i] - cost[i]\n        curr_tank += gas[i] - cost[i]\n        if curr_tank < 0:\n            start = i + 1\n            curr_tank = 0\n    return start if total_tank >= 0 else -1\n", "entry_point": "find_starting_station", "input": "[1, 2, 3, 4], [2, 1, 0, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42546_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023359", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'v9p9'", "output": "'v9p9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023360", "code": "def convert_risk_to_chinese(risk):\n    risk_mapping = {\n        'None': 'None',\n        'Low': '\u4f4e\u5371',\n        'Medium': '\u4e2d\u5371',\n        'High': '\u9ad8\u5371',\n        'Critical': '\u4e25\u91cd'\n    }\n    return risk_mapping.get(risk, 'Unknown')  # Return the Chinese risk level or 'Unknown' if not found\n", "entry_point": "convert_risk_to_chinese", "input": "'Medium'", "output": "'\u4e2d\u5371'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023361", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "100, 234.86210526315796", "output": "134.86210526315796", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023362", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[73, 73, 73, 73, 73]", "output": "73.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023363", "code": "import logging\ndef mapLogLevels(levels):\n    log_level_map = {\n        logging.ERROR: 'ERROR',\n        logging.WARN: 'WARN',\n        logging.INFO: 'INFO',\n        logging.DEBUG: 'DEBUG'\n    }\n    result = {}\n    for level in levels:\n        result[level] = log_level_map.get(level, 'UNKNOWN')\n    return result\n", "entry_point": "mapLogLevels", "input": "[20]", "output": "{20: 'INFO'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125844_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023364", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[5, 2, 5, 1]", "output": "[2, 2, 2, 2, 2, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023365", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'80'", "output": "{'80': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023366", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[1, 1, 4, 2, 3]", "output": "[2, 5, 6, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023367", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'uclient_ces_,,'", "output": "{'uclient_ces_': None, '': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4659", "output": "{3, 1, 4659, 1553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023369", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9651", "output": "{3, 1, 3217, 9651}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9650", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023370", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3628", "output": "{1, 2, 4, 907, 3628, 1814}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3627", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023371", "code": "def reverse_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each nucleotide with its complement\n    complemented_sequence = ''.join(complement_dict[nucleotide] for nucleotide in reversed_sequence)\n    return complemented_sequence\n", "entry_point": "reverse_complement", "input": "'ATA'", "output": "'TAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100926_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023372", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'ChlieDD'", "output": "[('ChlieDD', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1316", "output": "{1, 2, 1316, 4, 7, 329, 28, 14, 47, 658, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1315", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023374", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'ocErrcor ', 2, 2", "output": "'2: ocErrcor '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023375", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'le', 'any_election'", "output": "'Sample Election: le'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023376", "code": "from typing import List\ndef remove_duplicates(nums: List[int]) -> int:\n    i = 1\n    while i < len(nums):\n        if nums[i-1] == nums[i]:\n            nums.pop(i)\n            continue\n        i += 1\n    return len(nums)\n", "entry_point": "remove_duplicates", "input": "[1, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119722_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023377", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[0, 1, 1, -2, 1, 2, 4, 2]", "output": "[1, 2, -1, -1, 3, 6, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26581_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6778", "output": "{1, 6778, 2, 3389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1041", "output": "{1, 347, 3, 1041}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023380", "code": "def count_users_with_one_post(post_counts):\n    user_post_count = {}\n    for count in post_counts:\n        if count in user_post_count:\n            user_post_count[count] += 1\n        else:\n            user_post_count[count] = 1\n    return user_post_count.get(1, 0)\n", "entry_point": "count_users_with_one_post", "input": "[1, 1, 1, 1, 1]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16257_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023381", "code": "def calculate_dot_product(vector1, vector2):\n    dot_product = 0\n    for i in range(len(vector1)):\n        dot_product += vector1[i] * vector2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[3, 6], [7, 5]", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3479_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023382", "code": "def restore_original_str(s):\n    result = \"\"\n    i = 0\n    while i < len(s):\n        if s[i] == '#':\n            if i + 2 < len(s) and s[i + 2] == '=':\n                ascii_val = int(s[i + 1]) + int(s[i + 3])\n                result += chr(ascii_val)\n                i += 4\n            else:\n                result += chr(int(s[i + 1]))\n                i += 2\n        else:\n            result += s[i]\n            i += 1\n    return result\n", "entry_point": "restore_original_str", "input": "'#9' + '9' + '+' + 'X'", "output": "'\\t9+X'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87838_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023383", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2321", "output": "{1, 11, 2321, 211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023384", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'key1=value1'", "output": "{'key1': 'value1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7619", "output": "{19, 1, 401, 7619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023386", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2199", "output": "{1, 3, 733, 2199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023387", "code": "def total_distance_traveled(numbers):\n    num_pos = [[0, 3], [1, 3], [2, 3], [0, 2], [1, 2], [2, 2], [0, 1], [1, 1], [2, 1], [1, 0]]\n    coords = {1: [0, 3], 2: [1, 3], 3: [2, 3], 4: [0, 2], 5: [1, 2], 6: [2, 2], 7: [0, 1], 8: [1, 1], 9: [2, 1], 0: [1, 0]}\n    total_distance = 0\n    current_position = coords[5]\n    for num in numbers:\n        next_position = coords[num]\n        dist_x, dist_y = next_position[0] - current_position[0], next_position[1] - current_position[1]\n        total_distance += abs(dist_x) + abs(dist_y)\n        current_position = next_position\n    return total_distance\n", "entry_point": "total_distance_traveled", "input": "[4, 1, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96023_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023388", "code": "def find_smallest_divisible_number(digit1: int, digit2: int, k: int) -> int:\n    MAX_NUM_OF_DIGITS = 10\n    INT_MAX = 2**31-1\n    if digit1 < digit2:\n        digit1, digit2 = digit2, digit1\n    total = 2\n    for l in range(1, MAX_NUM_OF_DIGITS+1):\n        for mask in range(total):\n            curr, bit = 0, total>>1\n            while bit:\n                curr = curr*10 + (digit1 if mask&bit else digit2)\n                bit >>= 1\n            if k < curr <= INT_MAX and curr % k == 0:\n                return curr\n        total <<= 1\n    return -1\n", "entry_point": "find_smallest_divisible_number", "input": "9, 9, 1000", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7656_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023389", "code": "def get_release_date(version: str) -> str:\n    version_dates = {\n        \"4.5.1\": \"September 14, 2008\",\n        \"4.6.1\": \"July 30, 2009\",\n        \"4.7.1\": \"February 26, 2010\",\n        \"4.8\": \"November 26, 2010\",\n        \"4.9\": \"June 21, 2011\",\n        \"4.10\": \"March 29, 2012\",\n        \"4.11\": \"November 6, 2013\",\n        \"5.0\": \"November 24, 2014\",\n        \"5.1\": \"April 17, 2015\",\n        \"5.2\": \"March 18, 2016\",\n        \"5.3\": \"May 2, 2016\",\n        \"5.4\": \"October 22, 2016\",\n        \"5.5\": \"March 23, 2017\",\n        \"5.6\": \"September 27, 2017\",\n        \"5.7b1\": \"January 27, 2018\",\n        \"5.7b2\": \"February 12, 2018\",\n        \"5.7\": \"February 27, 2018\",\n        \"5.8 devel\": \"Version not found\"\n    }\n    return version_dates.get(version, \"Version not found\")\n", "entry_point": "get_release_date", "input": "'4.8'", "output": "'November 26, 2010'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110352_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023390", "code": "def longest_common_prefix(str1: str, str2: str) -> str:\n    prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            prefix += str1[i]\n        else:\n            break\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "'a', 'abc'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106464_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023391", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[2, 0, 0, 1, 0, 1, 1]", "output": "[2, 0, 1, 1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26581_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8919", "output": "{1, 3, 9, 8919, 2973, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023393", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4041", "output": "{1, 449, 1347, 3, 4041, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023394", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "9", "output": "'1001'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023395", "code": "# Define the constant GRAVITY\nGRAVITY = -9.81\ndef calculate_altitude(initial_altitude, initial_velocity, time_elapsed):\n    altitude = initial_altitude + (initial_velocity * time_elapsed) + (0.5 * GRAVITY * time_elapsed ** 2)\n    return altitude\n", "entry_point": "calculate_altitude", "input": "0, 15.008999999999999, 5", "output": "-47.58000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2441_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3082", "output": "{1, 2, 67, 1541, 134, 3082, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023397", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "-1", "output": "'-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023398", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[4, 4], 10, 4", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023399", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8386", "output": "{4193, 1, 8386, 2, 7, 1198, 14, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8385", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023400", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8956", "output": "{1, 2, 4, 8956, 4478, 2239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8955", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3790", "output": "{1, 2, 5, 1895, 10, 3790, 758, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3789", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023402", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'q(solruery)'", "output": "'q\\\\(solruery\\\\)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023403", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'my_dgdd_g_01', '1 * *'", "output": "'my_dgdd_g_01_1_*_*'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023404", "code": "def count_word_occurrences(message_body):\n    words = message_body.split()\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'hellhd'", "output": "{'hellhd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143603_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023405", "code": "def days_exceeding_average(data, period_length):\n    result = []\n    avg_deaths = sum(data[:period_length]) / period_length\n    current_sum = sum(data[:period_length])\n    for i in range(period_length, len(data)):\n        if data[i] > avg_deaths:\n            result.append(i)\n        current_sum += data[i] - data[i - period_length]\n        avg_deaths = current_sum / period_length\n    return result\n", "entry_point": "days_exceeding_average", "input": "[1, 2, 3, 4, 5, 10], 5", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74675_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023406", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[0, 5, 0, 5]", "output": "[5, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13953_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023407", "code": "def schedule_tasks(tasks):\n    def custom_sort_key(task):\n        return task[1], task[2], task[0]\n    sorted_tasks = sorted(tasks, key=custom_sort_key)\n    return [task[0] for task in sorted_tasks]\n", "entry_point": "schedule_tasks", "input": "[(2, 1, 0), (4, 1, 1), (3, 2, 0), (1, 3, 0)]", "output": "[2, 4, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59171_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023408", "code": "def topological_sort_dag(dag):\n    def dfs(node):\n        visited.add(node)\n        for neighbor in dag.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        topological_order.append(node)\n    topological_order = []\n    visited = set()\n    for node in dag:\n        if node not in visited:\n            dfs(node)\n    node_pred = {node: [] for node in dag}\n    for i in range(len(topological_order)):\n        for neighbor in dag.get(topological_order[i], []):\n            node_pred[neighbor].append(topological_order[i])\n    global_pred = {i: node for i, node in enumerate(reversed(topological_order))}\n    return node_pred, global_pred\n", "entry_point": "topological_sort_dag", "input": "{}", "output": "({}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148049_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6799", "output": "{1, 523, 13, 6799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023410", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[3, 2, 0, 0, 1]", "output": "[3, 3, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "341", "output": "{1, 11, 341, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023412", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'2.5.222'", "output": "(2, 5, 222)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023413", "code": "import os\nimport logging\ndef process_file(infilepath: str, outfilepath: str, output_format: str) -> str:\n    filename = os.path.basename(infilepath).split('.')[0]\n    logging.info(\"Reading fileprint... \" + infilepath)\n    output_file = f\"{outfilepath}/{filename}.{output_format}\"\n    return output_file\n", "entry_point": "process_file", "input": "'/path/to/file/te.txt', '/path/to/outt', 'scssv'", "output": "'/path/to/outt/te.scssv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139858_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023414", "code": "def extract_service_files(service_dir_list):\n    simulated_directory_structure = {\n        'systemd': ['service1.service', 'service2.service'],\n        'sites-available': ['nginx.conf', 'default'],\n    }\n    result = {}\n    for service_dir in service_dir_list:\n        service_name = service_dir.split('/')[-1]\n        files = simulated_directory_structure.get(service_name, [])\n        result[service_name] = files\n    return result\n", "entry_point": "extract_service_files", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114232_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023415", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            shifted_char = chr((ord(char) - ord('a') + shift) % 26 + ord('a')) if char.islower() else chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'knkknk', 0", "output": "'knkknk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138959_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023416", "code": "def filter_confidence(d, threshold):\n    filtered_dict = {}\n    for instance, confidence in d.items():\n        if confidence >= threshold:\n            filtered_dict[instance] = confidence\n    return filtered_dict\n", "entry_point": "filter_confidence", "input": "{'instance1': -0.1, 'instance2': -0.5}, 0", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80397_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3412", "output": "{1, 2, 4, 1706, 3412, 853}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3411", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023418", "code": "def create_image(pixel_values):\n    side_length = int(len(pixel_values) ** 0.5)\n    image = [[0 for _ in range(side_length)] for _ in range(side_length)]\n    for i in range(side_length):\n        for j in range(side_length):\n            image[i][j] = pixel_values[i * side_length + j]\n    return image\n", "entry_point": "create_image", "input": "[31, 192, 161, 129]", "output": "[[31, 192], [161, 129]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113012_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023419", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'myConfig.ad'", "output": "'ad'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023420", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4191", "output": "{1, 33, 3, 11, 1397, 127, 381, 4191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "985", "output": "{197, 1, 985, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023422", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2636", "output": "{1, 2, 4, 1318, 2636, 659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2635", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023423", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char == \" \":\n            encrypted_text += \" \"\n        else:\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'dahk', 3", "output": "'gdkn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51413_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023424", "code": "import re\ndef remove_retweet(tweet):\n    return re.sub(r\"\\brt\\b\", \"\", tweet)\n", "entry_point": "remove_retweet", "input": "'\u00e7ok'", "output": "'\u00e7ok'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62869_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "593", "output": "{593, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt592", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5387", "output": "{1, 5387}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023427", "code": "def reverse_words(s):\n    words = s.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words", "input": "'o world'", "output": "'o dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104568_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023428", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2188", "output": "{1, 2, 547, 4, 1094, 2188}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2187", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023429", "code": "def calculate_actual_power(P_instruct, SoC_current, SoC_max):\n    if P_instruct >= 0 and SoC_current == SoC_max:\n        P_actual = 0\n    elif P_instruct <= 0 and SoC_current == 0:\n        P_actual = 0\n    elif P_instruct > 0 and SoC_current == 0:\n        P_actual = P_instruct\n    elif P_instruct >= 0 and SoC_current <= (SoC_max - P_instruct):\n        P_actual = P_instruct\n    elif P_instruct <= 0 and SoC_current >= abs(P_instruct):\n        P_actual = P_instruct\n    elif P_instruct >= 0 and P_instruct > (SoC_max - SoC_current):\n        P_actual = SoC_max - SoC_current\n    elif P_instruct <= 0 and abs(P_instruct) > SoC_current:\n        P_actual = -SoC_current\n    return P_actual\n", "entry_point": "calculate_actual_power", "input": "5, 0, 10", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115015_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023430", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "8", "output": "'02468101214'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4891", "output": "{73, 1, 67, 4891}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023432", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'ehehe'", "output": "'ehehe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023433", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'hello world'", "output": "'World Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "470", "output": "{1, 2, 5, 10, 235, 47, 470, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt469", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023435", "code": "def calculate_input_channels(features, dropout):\n    input_channels = 0\n    for feature in features:\n        input_channels += features[feature][\"shape\"][0]\n    return input_channels\n", "entry_point": "calculate_input_channels", "input": "{}, 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16997_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6982", "output": "{1, 2, 3491, 6982}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023437", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4178", "output": "{1, 4178, 2, 2089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023438", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "10", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023439", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 2, 4, 2, 3, 6, 0, 4]", "output": "[3, 6, 6, 5, 9, 6, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023440", "code": "def two_sum_indices(nums, target):\n    num_indices = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], i]\n        num_indices[num] = i\n    return []\n", "entry_point": "two_sum_indices", "input": "[1, 2, 3, 4, 5, 6], 8", "output": "[2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94760_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023441", "code": "import re\ndef count_word_occurrences(text):\n    word_count = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_word_occurrences", "input": "'tthis'", "output": "{'tthis': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90305_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023442", "code": "from typing import List\ndef average_absolute_differences(list1: List[int], list2: List[int]) -> float:\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    absolute_diffs = [abs(x - y) for x, y in zip(list1, list2)]\n    average_diff = sum(absolute_diffs) / len(absolute_diffs)\n    return round(average_diff, 4)  # Rounding to 4 decimal places\n", "entry_point": "average_absolute_differences", "input": "[0, 0], [6, 6]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72862_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023443", "code": "def merge_lists(tds, tbs):\n    tas = []\n    # Append elements from tds in order\n    for element in tds:\n        tas.append(element)\n    # Append elements from tbs in reverse order\n    for element in reversed(tbs):\n        tas.append(element)\n    return tas\n", "entry_point": "merge_lists", "input": "[2, 5, 2, 5], [8, 6, 6]", "output": "[2, 5, 2, 5, 6, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146813_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023444", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'_l'", "output": "'Exporting annotated corpus data for _l.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023445", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cbad', 'cccccbbbaaaaddd'", "output": "'cccccbbbaaaaddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023446", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[6, 6, 6, 6, 9]", "output": "6.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4413", "output": "{1, 3, 4413, 1471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023448", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[8, 8]", "output": "[8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023449", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[102, 100, 99, 98, 97]", "output": "[102, 100, 99]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57187_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023450", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 3, 0, 4, 5, 6]", "output": "[0, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023451", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'clusterlu', 'dummy_id'", "output": "\"Provider submodule 'clusterlu' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023452", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'3.1.5.alpha'", "output": "(3, 1, 5, 'alpha')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023453", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "65", "output": "'01:05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023454", "code": "def convertages(data):\n    age_groups = list(data.keys())\n    data_points = list(data.values())\n    # Sort age groups based on numerical values\n    age_groups.sort(key=lambda x: int(x.split('-')[0]))\n    return data_points, age_groups\n", "entry_point": "convertages", "input": "{}", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128803_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023455", "code": "from typing import Dict, List\ndef topological_sort(graph: Dict[int, List[int]]) -> List[int]:\n    visited = set()\n    post_order = []\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        post_order.append(node)\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node)\n    return post_order[::-1]\n", "entry_point": "topological_sort", "input": "{6: [1], 1: []}", "output": "[6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78090_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023456", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2251", "output": "{1, 2251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023457", "code": "def calculate_average_params(tups):\n    weight_params = {}\n    for weight, param in tups:\n        if weight not in weight_params:\n            weight_params[weight] = [param, 1]\n        else:\n            weight_params[weight][0] += param\n            weight_params[weight][1] += 1\n    average_params = {weight: param_sum / count for weight, (param_sum, count) in weight_params.items()}\n    return average_params\n", "entry_point": "calculate_average_params", "input": "[(5.0, 2.0), (5.0, 3.0)]", "output": "{5.0: 2.5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12268_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023458", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[100, 100, 100, 100, 100, 0]", "output": "83.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5288", "output": "{1, 2, 4, 5288, 8, 1322, 2644, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5287", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023460", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "13", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023461", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0.00\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[82.0, 82.5]", "output": "82.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122959_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023462", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.10.51'", "output": "(1, 10, 51)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "948", "output": "{1, 2, 3, 4, 6, 12, 237, 79, 948, 474, 316, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt947", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023464", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6628", "output": "{1, 2, 6628, 4, 3314, 1657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6627", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023465", "code": "def generate_unique_id(section_name):\n    length = len(section_name)\n    if length % 2 == 0:  # Even length\n        unique_id = section_name + str(length)\n    else:  # Odd length\n        unique_id = section_name[::-1] + str(length)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'deleln'", "output": "'deleln6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126473_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023466", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "847", "output": "{1, 7, 11, 77, 847, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023467", "code": "def validate_form_submission(form_data: dict) -> bool:\n    if \"name\" not in form_data or not form_data[\"name\"]:\n        return False  # Name is missing or empty\n    if \"age\" in form_data and form_data[\"age\"] < 18:\n        return False  # Age is less than 18\n    if \"email\" in form_data and \"@\" not in form_data[\"email\"]:\n        return False  # Email is missing \"@\" symbol\n    return True  # All criteria met, form submission is valid\n", "entry_point": "validate_form_submission", "input": "{'age': 20, 'email': 'example.com'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90774_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023468", "code": "import keyword\ndef validate_collection_name(collection_name):\n    # List of Python keywords\n    python_keywords = keyword.kwlist\n    # Check if the collection name is empty\n    if not collection_name:\n        return False\n    # Check if the collection name starts with a number\n    if collection_name[0].isdigit():\n        return False\n    # Check if the collection name contains special characters other than underscore\n    if not collection_name.replace('_', '').isalnum():\n        return False\n    # Check if the collection name is a Python keyword\n    if collection_name in python_keywords:\n        return False\n    return True\n", "entry_point": "validate_collection_name", "input": "'my_collection1'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78726_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023469", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[1, 2, 4, 3, 0, 3]", "output": "[2, 8, 9, 0, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023470", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'1.21.2'", "output": "(1, 21, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023471", "code": "import math\ndef calculate_polygon_area(num_sides, side_length):\n    pi = math.pi\n    area = (num_sides * side_length ** 2) / (4 * math.tan(pi / num_sides))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "10, 11", "output": "930.9992699955143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120814_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023472", "code": "def prefnum(InA=[], PfT=None, varargin=None):\n    # Non-zero value InA location indices:\n    IxZ = [i for i, val in enumerate(InA) if val > 0]\n    IsV = True\n    # Calculate sum of positive values, maximum value, and its index\n    sum_positive = sum(val for val in InA if val > 0)\n    max_value = max(InA)\n    max_index = InA.index(max_value)\n    return sum_positive, max_value, max_index\n", "entry_point": "prefnum", "input": "[0, 0, 3, 4, 6, 10]", "output": "(23, 10, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134376_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023473", "code": "_HORNS_       = 0\n_SIDEBANDS_   = 1\n_FREQUENCY_   = 2\n_TIME_        = 3\n_COMAPDATA_ = {'spectrometer/tod': [_HORNS_, _SIDEBANDS_, _FREQUENCY_, _TIME_],\n               'spectrometer/MJD': [_TIME_],\n               'spectrometer/pixel_pointing/pixel_ra': [_HORNS_, _TIME_],\n               'spectrometer/pixel_pointing/pixel_dec': [_HORNS_, _TIME_],\n               'spectrometer/pixel_pointing/pixel_az': [_HORNS_, _TIME_],   \n               'spectrometer/pixel_pointing/pixel_el': [_HORNS_, _TIME_],\n               'spectrometer/frequency': [_SIDEBANDS_, _FREQUENCY_],\n               'spectrometer/time_average': [_HORNS_, _SIDEBANDS_, _FREQUENCY_],\n               'spectrometer/band_average': [_HORNS_, _SIDEBANDS_, _TIME_],\n               'spectrometer/bands': [_SIDEBANDS_],\n               'spectrometer/feeds': [_HORNS_]}\ndef process_data_file(data_path):\n    return _COMAPDATA_.get(data_path, \"Data path not found\")\n", "entry_point": "process_data_file", "input": "'spectrometer/pixel_pointing/pixel_dec'", "output": "[0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117446_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023474", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1395", "output": "{1, 3, 5, 9, 45, 15, 465, 1395, 279, 155, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023475", "code": "def findTwoNumbers(array, targetSum):\n    seen_numbers = set()\n    for num in array:\n        potential_match = targetSum - num\n        if potential_match in seen_numbers:\n            return [potential_match, num]\n        seen_numbers.add(num)\n    return []\n", "entry_point": "findTwoNumbers", "input": "[11, -1, 5, 8, 3], 10", "output": "[11, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115301_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023476", "code": "def modify_template_name(template_name: str) -> str:\n    # Trim leading and trailing whitespace, convert to lowercase, and return\n    return template_name.strip().lower()\n", "entry_point": "modify_template_name", "input": "' mytempl '", "output": "'mytempl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116239_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023477", "code": "def count_live_streams(live):\n    count = 0\n    for status in live:\n        if status == 1 or status == 2:\n            count += 1\n    return count\n", "entry_point": "count_live_streams", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94184_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "183", "output": "{1, 3, 61, 183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5755", "output": "{1, 5755, 5, 1151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5754", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023480", "code": "import json\ndef extract_role(json_obj):\n    try:\n        # Parse the JSON object\n        data = json.loads(json_obj)\n        # Access the \"role\" key and return its value\n        if 'result' in data and 'role' in data['result']:\n            return data['result']['role']\n        else:\n            return \"Role key not found in the JSON object.\"\n    except json.JSONDecodeError as e:\n        return f\"Error decoding JSON: {e}\"\n", "entry_point": "extract_role", "input": "'{\"result\": {\"role\": \"admin\"}}'", "output": "'admin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22479_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023481", "code": "def range_search(data, filters):\n    result = []\n    for item in data:\n        valid = True\n        for key, value in filters.items():\n            if \"==\" in value:\n                filter_key, filter_value = value.split(\"==\")\n                if item.get(key) != int(filter_value):\n                    valid = False\n                    break\n            else:\n                operator, filter_value = value[:2], int(value[2:])\n                if operator == \"<\" and not item.get(key) < filter_value:\n                    valid = False\n                    break\n                elif operator == \"<=\" and not item.get(key) <= filter_value:\n                    valid = False\n                    break\n                elif operator == \">\" and not item.get(key) > filter_value:\n                    valid = False\n                    break\n                elif operator == \">=\" and not item.get(key) >= filter_value:\n                    valid = False\n                    break\n        if valid:\n            result.append(item)\n    return result\n", "entry_point": "range_search", "input": "[{}, {}, {}, {}], {}", "output": "[{}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14448_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023482", "code": "def generate_api_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "generate_api_url", "input": "'hhttps.com', 'som/usseues'", "output": "'hhttps.comsom/usseues'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62370_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5258", "output": "{1, 2, 2629, 5258, 11, 239, 22, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5273", "output": "{1, 5273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023485", "code": "from typing import List\ndef min_steps_to_reach_end(cave: List[int], threshold: int) -> int:\n    n = len(cave)\n    dp = [float('inf')] * n\n    dp[0] = 0\n    for i in range(1, n):\n        for j in range(i):\n            if abs(cave[i] - cave[j]) <= threshold:\n                dp[i] = min(dp[i], dp[j] + 1)\n    return dp[-1]\n", "entry_point": "min_steps_to_reach_end", "input": "[1, 2, 3, 4], 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32739_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023486", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'30aea4e638'", "output": "'30aea4FFFEe638'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023487", "code": "def parse_vm_info(input_str):\n    vm_info = {}\n    entries = input_str.split('^')\n    for entry in entries:\n        vm_name, ip_address = entry.split(':')\n        vm_info[vm_name] = ip_address\n    return vm_info\n", "entry_point": "parse_vm_info", "input": "'VM1:192.8.1.3'", "output": "{'VM1': '192.8.1.3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46533_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023488", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'isWWelc'", "output": "'isWWelc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023489", "code": "def parse_command_line(args):\n    parsed_args = {}\n    current_flag = None\n    for arg in args:\n        if arg.startswith('-'):\n            current_flag = arg\n            parsed_args[current_flag] = None\n        else:\n            if current_flag:\n                parsed_args[current_flag] = arg\n                current_flag = None\n    return parsed_args\n", "entry_point": "parse_command_line", "input": "['-p', '--p', '-', '-f']", "output": "{'-p': None, '--p': None, '-': None, '-f': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113595_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023490", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6217", "output": "{6217, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023491", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "200", "output": "{1, 2, 100, 4, 5, 200, 40, 8, 10, 50, 20, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt199", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023492", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-1, -1, 2, 3]", "output": "[[-1, -1, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023493", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "4, 0", "output": "[0, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023494", "code": "def get_error_description(error_code):\n    error_codes = {\n        70: \"File write error\",\n        80: \"File too big to upload\",\n        90: \"Failed to create local directory\",\n        100: \"Failed to create local file\",\n        110: \"Failed to delete directory\",\n        120: \"Failed to delete file\",\n        130: \"File not found\",\n        140: \"Maximum retry limit reached\",\n        150: \"Request failed\",\n        160: \"Cache not loaded\",\n        170: \"Migration failed\",\n        180: \"Download certificates error\",\n        190: \"User rejected\",\n        200: \"Update needed\",\n        210: \"Skipped\"\n    }\n    return error_codes.get(error_code, \"Unknown Error\")\n", "entry_point": "get_error_description", "input": "80", "output": "'File too big to upload'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66002_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023495", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 2, 8, 9, 12]", "output": "864", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5851_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023496", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'primary'", "output": "'primary'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023497", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2404", "output": "{1, 2, 2404, 4, 1202, 601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2403", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023498", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[21]", "output": "'0x15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023499", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 20, 27]", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100977_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023500", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[2, 2, 4, 4, 4, 6, 4, 6, 4], 4", "output": "[[2, 2, 4, 4], [4, 6, 4, 6], [4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023501", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[1, 1, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5553", "output": "{1, 3, 9, 617, 5553, 1851}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023503", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "10", "output": "3.1622776602", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023504", "code": "from typing import List\ndef sum_multiples(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[3, 5, 18]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131686_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023505", "code": "def decrypt(encryptedText, key):\n    decryptedText = \"\"\n    key = key.lower().replace('\u0130', 'i')\n    encryptedText = encryptedText.lower()\n    i = 0\n    while i < len(encryptedText):\n        char = ord(encryptedText[i])\n        charOfKey = ord(key[i % len(key)])\n        if char >= 97 and char <= 122 and charOfKey >= 97 and charOfKey <= 122:\n            decryptedText += chr((char - charOfKey + 26) % 26 + 97)\n        else:\n            decryptedText += chr(char)\n        i += 1\n    return decryptedText\n", "entry_point": "decrypt", "input": "'mpcqzi', 'a'", "output": "'mpcqzi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70304_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023506", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'0 - 64'", "output": "-64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023507", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[3406], 1", "output": "3406", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023508", "code": "def find_pairs(arr, target_sum):\n    arr.sort()\n    left = 0\n    right = len(arr) - 1\n    count = 0\n    while left < right:\n        cur_sum = arr[left] + arr[right]\n        if cur_sum == target_sum:\n            print(target_sum, arr[left], arr[right])\n            count += 1\n            left += 1\n        elif cur_sum < target_sum:\n            left += 1\n        else:\n            right -= 1\n    print(\"Total pairs found:\", count)\n    return count\n", "entry_point": "find_pairs", "input": "[4, 6], 10", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73088_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023509", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[1, 3, 1, -1, 7, 9, 8, 0, 1]", "output": "[1, 4, 3, 2, 11, 14, 14, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5986", "output": "{1, 5986, 2, 41, 73, 2993, 146, 82}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023511", "code": "from typing import List\ndef filter_by_percentage(input_list: List[int], percentage: float) -> List[int]:\n    if not input_list:\n        return []\n    max_value = max(input_list)\n    threshold = max_value * (percentage / 100)\n    filtered_list = [num for num in input_list if num >= threshold]\n    return filtered_list\n", "entry_point": "filter_by_percentage", "input": "[], 50.0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19265_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023512", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[30.33, 30.33, 30.34]", "output": "30.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023513", "code": "def find_min_path(triangle):\n    if not triangle:\n        return 0\n    for row in range(len(triangle) - 2, -1, -1):\n        for col in range(len(triangle[row])):\n            triangle[row][col] += min(triangle[row + 1][col], triangle[row + 1][col + 1])\n    return triangle[0][0]\n", "entry_point": "find_min_path", "input": "[[2], [3, 4], [6, 5, 7], [4, 1, 8, 3]]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139174_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023514", "code": "def filter_achievements_by_keyword(achievements, keyword):\n    filtered_achievements = []\n    for achievement in achievements:\n        if keyword.lower() in achievement['AchievementTitle'].lower():\n            filtered_achievements.append(achievement)\n    return filtered_achievements\n", "entry_point": "filter_achievements_by_keyword", "input": "[], 'test'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85434_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023515", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'filtee1er2, filter3'", "output": "['filtee1er2', 'filter3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023516", "code": "def map_dataset_subset(dataset_name):\n    if dataset_name == \"train\":\n        return \"train_known\"\n    elif dataset_name == \"val\":\n        return \"train_unseen\"\n    elif dataset_name == \"test\":\n        return \"test_known\"\n    else:\n        return \"Invalid dataset subset name provided.\"\n", "entry_point": "map_dataset_subset", "input": "'val'", "output": "'train_unseen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39576_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023517", "code": "def sort_and_count_iterations(numcliente2):\n    num_list = [int(num) for num in numcliente2]\n    interacao = 0\n    for i in range(len(num_list)):\n        min_index = i\n        for j in range(i+1, len(num_list)):\n            if num_list[j] < num_list[min_index]:\n                min_index = j\n        if min_index != i:\n            interacao += 1\n            num_list[i], num_list[min_index] = num_list[min_index], num_list[i]\n    return interacao\n", "entry_point": "sort_and_count_iterations", "input": "'312'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49082_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023518", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'232231'", "output": "{'232231': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023519", "code": "def decode_text(int_list, reverse_word_index):\n    decoded_words = [reverse_word_index.get(i, '<UNK>') for i in int_list]\n    decoded_text = ' '.join(decoded_words)\n    return decoded_text\n", "entry_point": "decode_text", "input": "[1, 2, 3, 4, 5, 6], {}", "output": "'<UNK> <UNK> <UNK> <UNK> <UNK> <UNK>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48790_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023520", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[2], 1, 1", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4834", "output": "{2417, 1, 4834, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023522", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'unknown_dataset', 228", "output": "228", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023523", "code": "def convert_attribute_name(original_name):\n    attribute_map = {\n        'api_version': 'apiVersion',\n        'authorization': 'authorization',\n        'bearer_token_file': 'bearerTokenFile',\n        'name': 'name',\n        'namespace': 'namespace',\n        'path_prefix': 'pathPrefix',\n        'port': 'port',\n        'scheme': 'scheme',\n        'timeout': 'timeout',\n        'tls_config': 'tlsConfig'\n    }\n    return attribute_map.get(original_name, 'Not Found')\n", "entry_point": "convert_attribute_name", "input": "'name'", "output": "'name'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120015_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023524", "code": "def convert_memory_size(memory_size):\n    units = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n    conversion_rates = [1, 1024, 1024**2, 1024**3, 1024**4]\n    for idx, rate in enumerate(conversion_rates):\n        if memory_size < rate or idx == len(conversion_rates) - 1:\n            converted_size = memory_size / conversion_rates[idx - 1]\n            return f\"{converted_size:.2f} {units[idx - 1]}\"\n", "entry_point": "convert_memory_size", "input": "1048576", "output": "'1.00 MB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149300_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023525", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[-1, 0, 7, 7, 3, 7, 0, 3, 1]", "output": "[-1, 1, 9, 10, 7, 12, 6, 10, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5099", "output": "{1, 5099}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023527", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[10, 9, 9, 10]", "output": "[9, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt75", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023528", "code": "def map_message_ids_to_names(message_ids):\n    message_id_to_name = {\n        51: 'MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT',\n        52: 'MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT',\n        53: 'MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT',\n        54: 'MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA',\n        55: 'MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA',\n        56: 'MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST',\n        57: 'MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST',\n        58: 'MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT',\n        59: 'MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT',\n        60: 'MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT',\n        61: 'MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST',\n        62: 'MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT',\n        63: 'MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST',\n        64: 'MAVLINK_MSG_ID_STATE_CORRECTION',\n        66: 'MAVLINK_MSG_ID_REQUEST_DATA_STREAM'\n    }\n    result = {msg_id: message_id_to_name.get(msg_id, 'Unknown') for msg_id in message_ids}\n    return result\n", "entry_point": "map_message_ids_to_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132791_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023529", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'10.99'", "output": "'10.99.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023530", "code": "def find_common_elements(list1, list2):\n    common_elements = []\n    for element in list1:\n        if element in list2:\n            common_elements.append(element)\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[3, 4, 4, 4], [1, 4, 3, 2]", "output": "[3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41084_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023531", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "-0.20000000000000284, 0, 1", "output": "-0.20000000000000284", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023532", "code": "def format_config(config_dict):\n    formatted_config = \"\"\n    for key, value in config_dict.items():\n        formatted_config += f\"{key}={value}\\n\"\n    return formatted_config\n", "entry_point": "format_config", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42612_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023533", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene11egg'", "output": "[('gene11egg',)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023534", "code": "def get_terraform_outputs(layer):\n    outputs_dict = {}\n    if layer is not None:\n        for key, value in layer.get('outputs', {}).items():\n            outputs_dict[key] = value\n        if layer.get('parent'):\n            outputs_dict.update(get_terraform_outputs(layer['parent']))\n    return outputs_dict\n", "entry_point": "get_terraform_outputs", "input": "None", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68564_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2811", "output": "{3, 1, 2811, 937}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023536", "code": "from collections import defaultdict\ndef build_order(modules):\n    graph = defaultdict(list)\n    in_degree = defaultdict(int)\n    # Create the graph and calculate in-degrees\n    for module, dependencies in modules.items():\n        for dependency in dependencies:\n            graph[dependency].append(module)\n            in_degree[module] += 1\n    # Perform topological sort\n    build_order = []\n    queue = [module for module in modules if in_degree[module] == 0]\n    while queue:\n        current = queue.pop(0)\n        build_order.append(current)\n        for dependent in graph[current]:\n            in_degree[dependent] -= 1\n            if in_degree[dependent] == 0:\n                queue.append(dependent)\n    return build_order if len(build_order) == len(modules) else []\n", "entry_point": "build_order", "input": "{'A': ['B'], 'B': ['A']}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62984_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023537", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "1.8", "output": "1800000000000000044", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023538", "code": "def validate_resource(resource):\n    resource_validation = {\n        'destination': '1.1.1.1',\n        'communityString': 'public',\n        'uri': 'create_uri'\n    }\n    if 'timeout' in resource and resource['timeout'] < 0:\n        return False\n    for key, expected_value in resource_validation.items():\n        if key not in resource or resource[key] != expected_value:\n            return False\n    return True\n", "entry_point": "validate_resource", "input": "{'timeout': -1}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5108", "output": "{1, 2, 4, 5108, 2554, 1277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5107", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023540", "code": "def process_config(config_dict):\n    n_disc = config_dict.get('n_disc', 0)  # Default to 0 if key is missing\n    interval = config_dict.get('checkpoint_config', {}).get('interval', 0)  # Default to 0 if key is missing\n    output_dir = config_dict.get('custom_hooks', [{}])[0].get('output_dir', '')  # Default to empty string if key is missing\n    inception_pkl = config_dict.get('inception_pkl', '')  # Default to empty string if key is missing\n    return n_disc, interval, output_dir, inception_pkl\n", "entry_point": "process_config", "input": "{}", "output": "(0, 0, '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132345_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1671", "output": "{1, 3, 557, 1671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3326", "output": "{1, 2, 3326, 1663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3325", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023543", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'.looo'", "output": "'looo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023544", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "14, 5", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023545", "code": "def sum_excluding_last_row_and_column(matrix):\n    total_sum = 0\n    for i in range(len(matrix) - 1):  # Exclude the last row\n        for j in range(len(matrix[i]) - 1):  # Exclude the last column\n            total_sum += matrix[i][j]\n    return total_sum\n", "entry_point": "sum_excluding_last_row_and_column", "input": "[[4, 6, 1], [12, 0, 8], [0, 0, 0]]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79714_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023546", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "4", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023547", "code": "def process_query(query: str, operator: str) -> dict:\n    parts = [x.strip() for x in operator.split(query)]\n    assert len(parts) in (1, 3), \"Invalid query format\"\n    query_key = parts[0]\n    result = {query_key: {}}\n    return result\n", "entry_point": "process_query", "input": "'UNWANTED', '=========== '", "output": "{'===========': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13586_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023548", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023549", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[1, 2, 3, 3, 3, 3, 5, 2]", "output": "[1, 4, 27, 27, 27, 27, 125, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023550", "code": "def calculate_total_pages(data_count: int, page_size: int) -> int:\n    total_pages = data_count // page_size\n    if data_count % page_size != 0:\n        total_pages += 1\n    return total_pages\n", "entry_point": "calculate_total_pages", "input": "11, 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125536_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023551", "code": "def calculate_routes(m, n):\n    # Initialize a 2D array to store the number of routes to reach each cell\n    routes = [[0 for _ in range(n)] for _ in range(m)]\n    # Initialize the number of routes to reach the starting point as 1\n    routes[0][0] = 1\n    # Calculate the number of routes for each cell in the grid\n    for i in range(m):\n        for j in range(n):\n            if i > 0:\n                routes[i][j] += routes[i - 1][j]  # Add the number of routes from above cell\n            if j > 0:\n                routes[i][j] += routes[i][j - 1]  # Add the number of routes from left cell\n    # The number of routes to reach the destination is stored in the bottom-right cell\n    return routes[m - 1][n - 1]\n", "entry_point": "calculate_routes", "input": "5, 4", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9475_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023552", "code": "def get_fourth_time(time_list):\n    return time_list[3]\n", "entry_point": "get_fourth_time", "input": "['value1', 'value2', 'value3', '125418:10']", "output": "'125418:10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51840_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023553", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[3, 2, 0, 3, 1, 3, 4, 3, 3]", "output": "[5, 2, 3, 4, 4, 7, 7, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023554", "code": "def rounded_sum(numbers):\n    total_sum = sum(numbers)\n    rounded_sum = round(total_sum)\n    return rounded_sum\n", "entry_point": "rounded_sum", "input": "[10, 10.5, 1.0]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88747_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023555", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2133", "output": "{1, 3, 711, 9, 237, 79, 2133, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2132", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023556", "code": "def process_intervals(n_intervals_):\n    n_intervals_ = int(n_intervals_)\n    result = max(1, n_intervals_)\n    return result\n", "entry_point": "process_intervals", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7724_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023557", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'pdimeopwer', 5, 10", "output": "\"Error: Invalid operation type 'pdimeopwer'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023558", "code": "from typing import List, Dict\ndef deploy_to_servers(servers: List[str], branch: str) -> Dict[str, List[str]]:\n    deployment_actions = {\n        'git fetch',\n        'git reset --hard origin/%s' % branch,\n        'yes | ~/.nodenv/shims/npm install',\n        '~/.nodenv/shims/npm run build'\n    }\n    deployment_results = {}\n    for server in servers:\n        actions_performed = []\n        for action in deployment_actions:\n            actions_performed.append(action)\n        deployment_results[server] = actions_performed\n    return deployment_results\n", "entry_point": "deploy_to_servers", "input": "[], 'main'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141898_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023559", "code": "def extract_info(cred):\n    project_id = cred.get(\"project_id\", \"\")\n    client_email = cred.get(\"client_email\", \"\")\n    auth_uri = cred.get(\"auth_uri\", \"\")\n    formatted_info = f\"Project ID: {project_id}, Client Email: {client_email}, Auth URI: {auth_uri}\"\n    return formatted_info\n", "entry_point": "extract_info", "input": "{}", "output": "'Project ID: , Client Email: , Auth URI: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39672_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023560", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[1, 3, 5, 10]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023561", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "\"'otes'\"", "output": "'otes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023562", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "4.5", "output": "'4.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023563", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8407", "output": "{1, 1201, 7, 8407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023564", "code": "def simulate_dupterm(input_str):\n    modified_str = \"\"\n    for char in input_str:\n        if char.islower():\n            modified_str += char.upper()\n        elif char.isupper():\n            modified_str += char.lower()\n        elif char.isdigit():\n            modified_str += '#'\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "simulate_dupterm", "input": "'eeee'", "output": "'EEEE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137159_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023565", "code": "from collections import Counter\nimport re\ndef most_common_operators(expressions):\n    operators = []\n    for expr in expressions:\n        operators.extend(re.findall(r'[^a-zA-Z0-9\\s]', expr))\n    operator_counts = Counter(operators)\n    max_count = max(operator_counts.values())\n    most_common_operators = [op for op, count in operator_counts.items() if count == max_count]\n    return sorted(most_common_operators)\n", "entry_point": "most_common_operators", "input": "['(x + y) = z', '(a - b) = c', '(m * n) = p']", "output": "['(', ')', '=']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148452_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023566", "code": "def max_product_of_two(nums):\n    if len(nums) < 2:\n        return 0\n    max_product = float('-inf')\n    second_max_product = float('-inf')\n    for num in nums:\n        if num > max_product:\n            second_max_product = max_product\n            max_product = num\n        elif num > second_max_product:\n            second_max_product = num\n    return max_product * second_max_product if max_product != float('-inf') and second_max_product != float('-inf') else 0\n", "entry_point": "max_product_of_two", "input": "[3, 5, 1]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103728_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023567", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'101111011'", "output": "379", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023568", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[1, 2, 4, 5, 6]", "output": "[1, 2, 4, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "429", "output": "{1, 33, 3, 39, 11, 429, 13, 143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023570", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[1, 2, 5, 5, 5], 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023571", "code": "def extract_verbose_name(class_name: str) -> str:\n    # Split the class name based on uppercase letters\n    words = [char if char.isupper() else ' ' + char for char in class_name]\n    verbose_name = ''.join(words).strip()\n    # Convert the verbose name to the desired format\n    verbose_name = verbose_name.replace('Config', '').replace('ADM', ' \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0414\u0435\u0434\u043e\u0432 \u041c\u043e\u0440\u043e\u0437\u043e\u0432')\n    return verbose_name\n", "entry_point": "extract_verbose_name", "input": "'ClubCCfig'", "output": "'C l u bCC f i g'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42194_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023572", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[3, 7, 6, 6, 2, 6, 1]", "output": "[2, 3, 2, 2, 1, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023573", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kikirjakauppa./125'", "output": "'http://kikirjakauppa./125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023574", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8842", "output": "{1, 8842, 2, 4421}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8841", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023575", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'C3'", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023576", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "5", "output": "55533", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023577", "code": "def filter_builds(builds_list, allowed_buildtypes):\n    filtered_builds = []\n    allowed_versions = [\"9.0\", \"10\"]\n    for build in builds_list:\n        if build[\"build_type\"] in allowed_buildtypes and build[\"version\"] in allowed_versions:\n            filtered_builds.append(build)\n    return filtered_builds\n", "entry_point": "filter_builds", "input": "[], ['stable', 'beta']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15381_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023578", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[5, 8], 2", "output": "[[5, 8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3567", "output": "{1, 3, 1189, 41, 3567, 87, 123, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023580", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[0, 0, 0, 0, 0]", "output": "[(0, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023581", "code": "from decimal import Decimal\ndef htdf_to_satoshi(amount_htdf):\n    amount_decimal = Decimal(str(amount_htdf))  # Convert input to Decimal\n    satoshi_value = int(amount_decimal * (10 ** 8))  # Convert HTDF to satoshi\n    return satoshi_value\n", "entry_point": "htdf_to_satoshi", "input": "139618272", "output": "13961827200000000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13302_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023582", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'example'", "output": "['example']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023583", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'SampeiSIs'", "output": "'\u30b5\u30f3ampeiSIs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023584", "code": "def most_accessed_memory_address(memory_addresses):\n    address_count = {}\n    for address in memory_addresses:\n        if address in address_count:\n            address_count[address] += 1\n        else:\n            address_count[address] = 1\n    max_count = max(address_count.values())\n    most_accessed_addresses = [address for address, count in address_count.items() if count == max_count]\n    return min(most_accessed_addresses)\n", "entry_point": "most_accessed_memory_address", "input": "[18, 18, 18, 17, 19]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123494_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023585", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "569", "output": "{1, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023586", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n+1):\n        line = [str(num) for num in range(1, i+1)]\n        line += ['*'] * (i-1)\n        line += [str(num) for num in range(i, 0, -1)]\n        pattern.append(''.join(line))\n    return pattern\n", "entry_point": "generate_pattern", "input": "4", "output": "['11', '12*21', '123**321', '1234***4321']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29714_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023587", "code": "import ast\ndef ast_to_literal(node):\n    if isinstance(node, ast.AST):\n        field_names = node._fields\n        res = {'constructor': node.__class__.__name__}\n        for field_name in field_names:\n            field = getattr(node, field_name, None)\n            field = ast_to_literal(field)\n            res[field_name] = field\n        return res\n    if isinstance(node, list):\n        res = []\n        for each in node:\n            res.append(ast_to_literal(each))\n        return res\n    return node\n", "entry_point": "ast_to_literal", "input": "'xxxxxxxxx'", "output": "'xxxxxxxxx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99020_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023588", "code": "def fit_to_grid(co: tuple, grid: float) -> tuple:\n    x = round(co[0] / grid) * grid\n    y = round(co[1] / grid) * grid\n    z = round(co[2] / grid) * grid\n    return round(x, 5), round(y, 5), round(z, 5)\n", "entry_point": "fit_to_grid", "input": "(3.55, 7.1, 7.1), 0.05", "output": "(3.55, 7.1, 7.1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1385_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023589", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 91, 91, 85, 80, 75]", "output": "[92, 91, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023590", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'116243561'", "output": "'11624356162485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1135", "output": "{1, 227, 5, 1135}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023592", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/example', '/wwww/w/immimagog'", "output": "'/wwww/w/immimagog'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9530", "output": "{1, 2, 5, 10, 1906, 953, 9530, 4765}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9529", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9783", "output": "{1, 3, 9, 9783, 3261, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023595", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "24, 10", "output": "'24'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023596", "code": "def encode_day_of_week(dayOfWeek):\n    dayOfWeekEncoding = [0, 0, 0, 0, 0, 0]\n    if dayOfWeek < 7:\n        dayOfWeekEncoding[6 - dayOfWeek] = 1\n    else:\n        for i in range(6):\n            dayOfWeekEncoding[i] = -1\n    return dayOfWeekEncoding\n", "entry_point": "encode_day_of_week", "input": "3", "output": "[0, 0, 0, 1, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118734_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023597", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1303", "output": "{1, 1303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1302", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023598", "code": "def calculate_total_sum(videoFiles):\n    total_sum = 0\n    for video_file in videoFiles:\n        number = int(video_file.split('_')[1].split('.')[0])\n        total_sum += number\n    return total_sum\n", "entry_point": "calculate_total_sum", "input": "['video_6.mp4', 'video_10.mp4', 'video_20.mp4']", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146951_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023599", "code": "def find_unique_element(nums):\n    unique_element = 0\n    for num in nums:\n        unique_element ^= num\n    return unique_element\n", "entry_point": "find_unique_element", "input": "[2, 2, 6]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52306_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023600", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'hello  '", "output": "'hello  '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023601", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'www.example.com/no/schemeh'", "output": "'www.example.com/no/schemeh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023602", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['0.9.9', '1.0.0', '1.1.1', '1.1.2']", "output": "'1.1.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023603", "code": "def process_string(input_string):\n    if \"apple\" in input_string:\n        input_string = input_string.replace(\"apple\", \"orange\")\n    if \"banana\" in input_string:\n        input_string = input_string.replace(\"banana\", \"\")\n    if \"cherry\" in input_string:\n        input_string = input_string.replace(\"cherry\", \"CHERRY\")\n    return input_string\n", "entry_point": "process_string", "input": "'aIa'", "output": "'aIa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133930_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023604", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 3, 2, 3, 5, 2]", "output": "[3, 5, 5, 5, 8, 7, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023605", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'2 - 3'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6251", "output": "{1, 133, 7, 329, 6251, 47, 19, 893}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6250", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023607", "code": "def generate_decoder_dimensions(encode_dim, latent):\n    # Reverse the encoder dimensions list\n    decode_dim = list(reversed(encode_dim))\n    # Append the latent size at the end\n    decode_dim.append(latent)\n    return decode_dim\n", "entry_point": "generate_decoder_dimensions", "input": "[399, 3199, 1600, 1600, 398, 1601], 9", "output": "[1601, 398, 1600, 1600, 3199, 399, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112112_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023608", "code": "def calculate_sums(input_list):\n    sums = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            sums.append(input_list[i] + input_list[i + 1])\n        else:\n            sums.append(input_list[i] + input_list[0])\n    return sums\n", "entry_point": "calculate_sums", "input": "[1, 3, 4, 2, 4, 5, 2, 1]", "output": "[4, 7, 6, 6, 9, 7, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17409_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023609", "code": "import re\ndef remove_color_codes(text):\n    return re.sub('(\u00a7[0-9a-f])', '', text)\n", "entry_point": "remove_color_codes", "input": "'\u00a71Th'", "output": "'Th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50171_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023610", "code": "def process_profiles(profiles: list) -> tuple:\n    valid_profiles = [profile for profile in profiles if profile.get('first_name') and profile.get('last_name') and profile.get('date_birth')]\n    if not valid_profiles:\n        return 0, []\n    avg_friends = sum(profile['friends'] for profile in valid_profiles) / len(valid_profiles)\n    avg_restaurants = sum(profile['restaurants'] for profile in valid_profiles) / len(valid_profiles)\n    for profile in valid_profiles:\n        if not profile.get('image'):\n            profile['image'] = 'static/images/userdefault.jpg'\n    return avg_friends, valid_profiles\n", "entry_point": "process_profiles", "input": "[]", "output": "(0, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127938_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023611", "code": "def get_allocation_model_names(AllocModelConstructorsByName):\n    allocation_model_names = set()\n    for name in AllocModelConstructorsByName:\n        allocation_model_names.add(name)\n    return allocation_model_names\n", "entry_point": "get_allocation_model_names", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114506_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023612", "code": "# Define the error code mappings in the ret_dict dictionary\nret_dict = {\n    404: \"Not Found\",\n    500: \"Internal Server Error\",\n    403: \"Forbidden\",\n    400: \"Bad Request\"\n}\ndef response_string(code):\n    # Check if the error code exists in the ret_dict dictionary\n    return ret_dict.get(code, \"\uc815\ubcf4 \uc5c6\uc74c\")\n", "entry_point": "response_string", "input": "404", "output": "'Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57903_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023613", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "193", "output": "{1, 193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023614", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'ooWorld!,'", "output": "b'ooWorld!,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023615", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'33.5.1133.5'", "output": "'33.5.1133.5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023616", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "122, 8", "output": "'00000122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023617", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2507", "output": "{1, 2507, 109, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023618", "code": "def calculate_even_sum(numbers):\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[10, 10, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38409_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023619", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'Helworldlo'", "output": "'Helworldlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023620", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[2, 2, 4, 4, 5, 6]", "output": "{2: 2, 4: 2, 5: 1, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3097", "output": "{1, 19, 163, 3097}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023622", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'example_path'", "output": "'example_path'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023623", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(3, 1, 0)", "output": "'3.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023624", "code": "def generate_sequence(n):\n    if n <= 0:\n        return \"\"\n    sequence = \"A\"\n    current_char = \"A\"\n    for _ in range(n - 1):\n        if current_char == \"A\":\n            sequence += \"B\"\n            current_char = \"B\"\n        else:\n            sequence += \"AA\"\n            current_char = \"A\"\n    return sequence\n", "entry_point": "generate_sequence", "input": "2", "output": "'AB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61941_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023625", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 3, 4, 8, 4, 3, 3, 3]", "output": "[1, 4, 6, 11, 8, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023626", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[10, 6, 5, 4, 4, 1, 1]", "output": "[10, 6, 5, 4, 4, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8202", "output": "{1, 2, 3, 4101, 6, 8202, 2734, 1367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023628", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8517", "output": "{1, 3, 8517, 167, 17, 51, 501, 2839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023629", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-1, -2, -3]", "output": "[1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8473", "output": "{1, 37, 8473, 229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8472", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023631", "code": "from typing import List\ndef count_successful_commands(commands: List[str]) -> int:\n    successful_count = 0\n    for command in commands:\n        if \"error\" not in command.lower():\n            successful_count += 1\n    return successful_count\n", "entry_point": "count_successful_commands", "input": "['this command has an error', 'execute command']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32409_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023632", "code": "def sum_multiples_of_three(matrix):\n    total_sum = 0\n    for row in matrix:\n        for element in row:\n            if element % 3 == 0:\n                total_sum += element\n    return total_sum\n", "entry_point": "sum_multiples_of_three", "input": "[[3, 6, 9]]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149659_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023633", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[1, 2, 3, 4, 5], 5", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5758", "output": "{1, 2, 5758, 2879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023635", "code": "import os\ndef expanduser(path):\n    \"\"\"\n    Expand ~ and ~user constructions.\n    Includes a workaround for http://bugs.python.org/issue14768\n    \"\"\"\n    expanded = os.path.expanduser(path)\n    if path.startswith(\"~/\") and expanded.startswith(\"//\"):\n        expanded = expanded[1:]\n    return expanded\n", "entry_point": "expanduser", "input": "'~jinjun/older'", "output": "'~jinjun/older'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6640_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023636", "code": "from datetime import datetime\ndef execute_command(cmd: str) -> str:\n    if cmd == \"HELLO\":\n        return \"Hello, World!\"\n    elif cmd == \"TIME\":\n        current_time = datetime.now().strftime(\"%H:%M\")\n        return current_time\n    elif cmd == \"GOODBYE\":\n        return \"Goodbye!\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "execute_command", "input": "'GOODBYE'", "output": "'Goodbye!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88933_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4871", "output": "{1, 4871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023638", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[2, 3, 3, 2, 6, 2]", "output": "[5, 6, 5, 8, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13953_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023639", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if input_str.isdigit():\n        return ''.join(char for char in input_str if not char.isdigit())\n    if input_str.isalpha():\n        return input_str.upper()\n    return ''.join(char for char in input_str if char.isalnum())\n", "entry_point": "process_string", "input": "'Hello!123'", "output": "'Hello123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106942_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023640", "code": "def format_color_names(input_string):\n    predefined_words = [\"is\", \"a\", \"nice\"]\n    words = input_string.split()\n    formatted_words = []\n    for word in words:\n        if word.lower() not in predefined_words:\n            word = word.capitalize()\n        formatted_words.append(word)\n    formatted_string = ' '.join(formatted_words)\n    return formatted_string\n", "entry_point": "format_color_names", "input": "'favorite'", "output": "'Favorite'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25204_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023641", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[6.4]", "output": "6.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023642", "code": "from typing import List\ndef max_distance(colors: List[int]) -> int:\n    color_indices = {}\n    max_dist = 0\n    for i, color in enumerate(colors):\n        if color not in color_indices:\n            color_indices[color] = i\n        else:\n            max_dist = max(max_dist, i - color_indices[color])\n    return max_dist\n", "entry_point": "max_distance", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 1]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93339_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023643", "code": "def sum_divisible_by_3_not_5(nums):\n    total = 0\n    for num in nums:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    return total\n", "entry_point": "sum_divisible_by_3_not_5", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59130_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023644", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7555", "output": "{1, 7555, 5, 1511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7554", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023645", "code": "def reverse_integer(x: int) -> int:\n    limit = 2**31 // 10  # int_max/10\n    if x > 0:\n        sig = 1\n    elif x < 0:\n        sig = -1\n        x = -x\n    else:\n        return x\n    y = 0\n    while x:\n        if y > limit:\n            return 0\n        y = y * 10 + (x % 10)\n        x //= 10\n    return y * sig\n", "entry_point": "reverse_integer", "input": "-454", "output": "-454", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54874_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023646", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "'helllhl'", "output": "b'\\x07\\x00\\x00\\x00helllhl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023647", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9835", "output": "{1, 35, 5, 7, 9835, 1967, 281, 1405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023648", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9935", "output": "{1, 1987, 5, 9935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023649", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'admin_listclistchlistlt'", "output": "'listclistchlistlt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023650", "code": "def longest_increasing_path(heights):\n    def dfs(row, col, prev_height, path_length):\n        if row < 0 or row >= len(heights) or col < 0 or col >= len(heights[0]) or heights[row][col] <= prev_height or abs(heights[row][col] - prev_height) > 1:\n            return path_length\n        max_length = path_length\n        for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n            max_length = max(max_length, dfs(row + dr, col + dc, heights[row][col], path_length + 1))\n        return max_length\n    max_path_length = 0\n    for i in range(len(heights)):\n        for j in range(len(heights[0])):\n            max_path_length = max(max_path_length, dfs(i, j, heights[i][j], 1))\n    return max_path_length\n", "entry_point": "longest_increasing_path", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44516_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023651", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'Removing this SK', 'Removing this'", "output": "'SK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2104", "output": "{1, 2, 4, 263, 8, 526, 2104, 1052}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2103", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023653", "code": "from typing import List\ndef lift_simulation(people: int, lift: List[int]) -> str:\n    if people <= 0 and sum(lift) % 4 != 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people > 0:\n        return f\"There isn't enough space! {people} people in a queue!\\n\" + ' '.join(map(str, lift))\n    elif people <= 0 and sum(lift) == 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people <= 0:\n        return ' '.join(map(str, lift))\n", "entry_point": "lift_simulation", "input": "0, [50, 70]", "output": "'50 70'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147066_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023654", "code": "def simulate_login(username, password):\n    if username == 'abcdefg':\n        return 'Please Enter Valid Email Or Mobile Number'\n    elif password == '<PASSWORD>':\n        return 'Kindly Verify Your User Id Or Password And Try Again.'\n    elif username == '1234567899':\n        return 'User does not exist. Please sign up.'\n    elif username == 'valid_username' and password == 'valid_password':\n        return 'Login successful.'\n    else:\n        return 'Incorrect username or password. Please try again.'\n", "entry_point": "simulate_login", "input": "'abcdefg', 'any_password'", "output": "'Please Enter Valid Email Or Mobile Number'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145289_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023655", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'emore'", "output": "{'emore': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023656", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[0, 9, 18, 17, 5, 10, 9, 10]", "output": "[0, 9, 18, 17, 5, 10, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8770", "output": "{1, 8770, 2, 4385, 5, 10, 877, 1754}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8769", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1928", "output": "{1, 2, 482, 964, 4, 1928, 8, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1927", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023659", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[99, 98, 95, 95, 87]", "output": "94.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5889", "output": "{1, 5889, 3, 453, 39, 1963, 13, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023661", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[95, 98, 98, 98, 100]", "output": "98.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135847_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023662", "code": "def find_special_number(n: int) -> int:\n    prod = 1\n    sum_ = 0\n    while n > 0:\n        last_digit = n % 10\n        prod *= last_digit\n        sum_ += last_digit\n        n //= 10\n    return prod - sum_\n", "entry_point": "find_special_number", "input": "66", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121266_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023663", "code": "from typing import List\ndef rearrange_people(people: List[List[int]]) -> List[List[int]]:\n    rearranged_people = []\n    for person in people:\n        value, spaces = person\n        rearranged_people.insert(spaces, [value])\n    return rearranged_people\n", "entry_point": "rearrange_people", "input": "[[3, 0], [1, 1], [2, 2]]", "output": "[[3], [1], [2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108148_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023664", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7094", "output": "{1, 2, 3547, 7094}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7093", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023665", "code": "def generate_config_file(settings_dict):\n    config_lines = []\n    for section, options in settings_dict.items():\n        for option, value in options.items():\n            if isinstance(value, dict):\n                for sub_option, sub_value in value.items():\n                    config_lines.append(f'c.{section}.{option}.{sub_option} = {sub_value}')\n            else:\n                config_lines.append(f'c.{section}.{option} = {value}')\n    return '\\n'.join(config_lines)\n", "entry_point": "generate_config_file", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62773_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023666", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'1.11.5.2'", "output": "(1, 11, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023667", "code": "def sum_of_squares_odd_variables(variables):\n    sum_squares = 0\n    for var_name, init_value in variables.items():\n        if int(var_name.split('.')[-1][1:]) % 2 != 0:\n            sum_squares += init_value ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares_odd_variables", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32263_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023668", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'Hello,'", "output": "'<strong>Hello,</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023669", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5237", "output": "{1, 5237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4075", "output": "{1, 163, 5, 4075, 815, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4074", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023671", "code": "from typing import List\ndef sum_with_next(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst) - 1):\n        result.append(lst[i] + lst[i + 1])\n    result.append(lst[-1] + lst[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 2, 1, 2, 3, 5]", "output": "[3, 3, 3, 5, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111975_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023672", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num + 10)\n        elif num % 2 != 0:\n            modified_list.append(num - 5)\n        if num % 5 == 0:\n            modified_list[-1] *= 2  # Double the last added element\n    return modified_list\n", "entry_point": "process_integers", "input": "[4, 3, 8, 6, 3, 2, 3, 8, 8]", "output": "[14, -2, 18, 16, -2, 12, -2, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30819_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7894", "output": "{1, 2, 3947, 7894}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7893", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023674", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[6, 7, 7, 1, 6, 7, 7, 6, 7]", "output": "[6, 8, 9, 4, 10, 12, 13, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145676_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023675", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5215", "output": "{1, 35, 5, 7, 745, 1043, 149, 5215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023676", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'202.0.969'", "output": "(202, 0, 969)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023677", "code": "def process_doxygen_input(doxygen_input):\n    if not isinstance(doxygen_input, str):\n        return \"Error: the `doxygen_input` variable must be of type `str`.\"\n    doxyfile = doxygen_input == \"Doxyfile\"\n    return doxyfile\n", "entry_point": "process_doxygen_input", "input": "'Doxyfile'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55873_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023678", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[6, 5, 5, 6, 6, 1, 5]", "output": "[6, 6, 6, 5, 5, 5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023679", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[7, 3, 1, 2, 4, 8, 7]", "output": "[3, 2, 1, 1, 1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2505", "output": "{1, 835, 3, 5, 167, 2505, 15, 501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023681", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "4", "output": "[0, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023682", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "723", "output": "{3, 1, 723, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023683", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "5, 1769, 1", "output": "8845", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023684", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[0, 7, 7, 2, 6, 5, 5, 3, 4]", "output": "[7, 7, 2, 6, 5, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023685", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene1.mut1,gene2.mut'", "output": "[('gene1', 'mut1'), ('gene2', 'mut')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023686", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.Doe@Example.COJ'", "output": "'john.doe@example.coj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023687", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "2, 1", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023688", "code": "def calculate_class_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_class_average", "input": "[50, 60, 61, 61, 70]", "output": "60.666666666666664", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107452_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023689", "code": "from typing import List\ndef process_strings(ss: List[str]) -> int:\n    valid = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}\n    signs = {'+', '-'}\n    ns = []\n    if len(ss) == 0:\n        return 0\n    for v in ss:\n        if v in valid:\n            ns.append(v)\n            continue\n        if v in signs and not len(ns):\n            ns.append(v)\n            continue\n        break\n    if not ns or (len(ns) == 1 and ns[0] in signs):\n        return 0\n    r = int(''.join(ns))\n    if r < -2147483648:\n        return -2147483648\n    return r\n", "entry_point": "process_strings", "input": "['1', '2']", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44054_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1865", "output": "{1865, 1, 373, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1864", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2645", "output": "{1, 5, 529, 115, 2645, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023692", "code": "def calculate_xor_checksum(input_string):\n    checksum = 0\n    for char in input_string:\n        checksum ^= ord(char)\n    return checksum\n", "entry_point": "calculate_xor_checksum", "input": "'a'", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56407_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023693", "code": "def text_transformation(text: str) -> str:\n    # Convert to lowercase, replace \"deprecated\" with \"obsolete\", strip whitespaces, and reverse the string\n    transformed_text = text.lower().replace(\"deprecated\", \"obsolete\").strip()[::-1]\n    return transformed_text\n", "entry_point": "text_transformation", "input": "'siis'", "output": "'siis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19675_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023694", "code": "def word_length_mapping(words):\n    word_length_dict = {}\n    for word in words:\n        word_length_dict[word] = len(word)\n    return word_length_dict\n", "entry_point": "word_length_mapping", "input": "['baan', 'bnab', '']", "output": "{'baan': 4, 'bnab': 4, '': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55760_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023695", "code": "def custom_str2bool(input_str):\n    lower_input = input_str.lower()\n    if lower_input == 'true':\n        return True\n    elif lower_input == 'false':\n        return False\n    else:\n        return False\n", "entry_point": "custom_str2bool", "input": "'true'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19130_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7685", "output": "{1, 1537, 5, 7685, 265, 145, 53, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023697", "code": "def parse_recipes(recipes):\n    recipe_dict = {}\n    for recipe in recipes:\n        dish, ingredients_str = recipe.split(\":\")\n        ingredients = [ingredient.strip() for ingredient in ingredients_str.split(\",\")]\n        recipe_dict[dish.strip()] = ingredients\n    return recipe_dict\n", "entry_point": "parse_recipes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7062_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9544", "output": "{1, 2, 4772, 4, 9544, 8, 1193, 2386}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9543", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023699", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5505", "output": "{1, 5505, 3, 5, 1835, 1101, 15, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "508", "output": "{1, 2, 4, 508, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt507", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023701", "code": "def next_greater_permutation(n):\n    s = list(str(n))\n    i = len(s) - 1\n    while i - 1 >= 0 and s[i - 1] >= s[i]:\n        i -= 1\n    if i == 0:\n        return -1\n    j = len(s) - 1\n    while s[j] <= s[i - 1]:\n        j -= 1\n    s[i - 1], s[j] = s[j], s[i - 1]\n    s[i:] = s[i:][::-1]\n    res = int(''.join(s))\n    if res <= 2 ** 31 - 1:\n        return res\n    return -1\n", "entry_point": "next_greater_permutation", "input": "114", "output": "141", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41733_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2873", "output": "{1, 169, 13, 17, 2873, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023703", "code": "def calculate_statistical_prevalence(transactions):\n    item_count = {}\n    total_transactions = len(transactions)\n    for transaction in transactions:\n        for item in transaction:\n            item_count[item] = item_count.get(item, 0) + 1\n    statistical_prevalence = {item: count/total_transactions for item, count in item_count.items()}\n    return statistical_prevalence\n", "entry_point": "calculate_statistical_prevalence", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62425_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023704", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "2, 9", "output": "b'\\t\\x00\\x00\\x00\\x02\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023705", "code": "def calculate_balance(initial_balance, transactions, account_id):\n    balances = {account_id: initial_balance}\n    for account, amount in transactions:\n        if account not in balances:\n            balances[account] = 0\n        balances[account] += amount\n    return balances.get(account_id, 0)\n", "entry_point": "calculate_balance", "input": "100, [(1, 101)], 1", "output": "201", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118421_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4666", "output": "{1, 4666, 2, 2333}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4665", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023707", "code": "def parse_test_cases(test_cases):\n    test_dict = {}\n    current_suite = None\n    for line in test_cases.splitlines():\n        if '.' in line or '/' in line:\n            current_suite = line.strip()\n            test_dict[current_suite] = []\n        elif current_suite:\n            test_dict[current_suite].append(line.strip())\n    return test_dict\n", "entry_point": "parse_test_cases", "input": "'FirstTest.'", "output": "{'FirstTest.': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88834_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023708", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[75, 75, 75, 70], 4", "output": "73.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94918_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023709", "code": "import importlib\ndef custom_reload(module_name):\n    import sys\n    if module_name in sys.modules:\n        try:\n            importlib.reload(sys.modules[module_name])\n            return True\n        except Exception as e:\n            print(f\"Error reloading module '{module_name}': {e}\")\n            return False\n    else:\n        print(f\"Module '{module_name}' does not exist.\")\n        return False\n", "entry_point": "custom_reload", "input": "'sys'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85920_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023710", "code": "def construct_mapping(Gvs, f):\n    Hvs = []  # Placeholder for vertices or nodes of graph H\n    gf = {}\n    for v in range(len(f)):\n        fv = f[v]\n        if fv >= 0:\n            gf[Gvs[v]] = Hvs[fv] if Hvs else None\n        else:\n            gf[Gvs[v]] = None\n    return gf\n", "entry_point": "construct_mapping", "input": "[True, False], [-1, -1]", "output": "{True: None, False: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98043_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023711", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "1, 1", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3691", "output": "{1, 3691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023713", "code": "def construct_command(snakemake, config):\n    cmd = []\n    if \"filter_set\" in snakemake.get(\"wildcards\", {}):\n        if \"dkfz\" in snakemake[\"wildcards\"][\"filter_set\"]:\n            cmd.append(\"bcftools view -f .,PASS\")\n        if \"ebfilter\" in snakemake[\"wildcards\"][\"filter_set\"]:\n            threshold = config.get(\"dkfz_and_ebfilter\", {}).get(\"ebfilter_threshold\", 3)\n            cmd.append(\"bcftools view -e 'EB < {}'\".format(threshold))\n    return \" \".join(cmd)\n", "entry_point": "construct_command", "input": "{'wildcards': {}}, {}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58366_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023714", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first participant as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 80, 80, 70, 60, 50, 50]", "output": "[1, 2, 3, 3, 5, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122200_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023715", "code": "def reverse_complement(dna_sequence):\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each nucleotide with its complement\n    complemented_sequence = ''.join(complement_dict[nucleotide] for nucleotide in reversed_sequence)\n    return complemented_sequence\n", "entry_point": "reverse_complement", "input": "'ATCGA'", "output": "'TCGAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100926_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023716", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'wwllH'", "output": "{'wwllH': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2647", "output": "{1, 2647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023718", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[4, 4, 5, 6, 3, 2, 2]", "output": "{4: 2, 5: 1, 6: 1, 3: 1, 2: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023719", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "100, 46", "output": "146", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023720", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[3, 7, 3, 9, 9, 6, 9, 3, 9], 9", "output": "[[3, 7, 3, 9, 9, 6, 9, 3, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023721", "code": "from typing import List\ndef degree(poly: List[int]) -> int:\n    deg = 0\n    for i in range(len(poly) - 1, -1, -1):\n        if poly[i] != 0:\n            deg = i\n            break\n    return deg\n", "entry_point": "degree", "input": "[0, 0, 0, 0, 0, 0, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116666_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023722", "code": "def generate_timestamps(frequency, duration):\n    timestamps = []\n    for sec in range(0, duration+1, frequency):\n        hours = sec // 3600\n        minutes = (sec % 3600) // 60\n        seconds = sec % 60\n        timestamp = f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n        timestamps.append(timestamp)\n    return timestamps\n", "entry_point": "generate_timestamps", "input": "9, 18", "output": "['00:00:00', '00:00:09', '00:00:18']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12595_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023723", "code": "def sum_of_squares_excluding_multiples_of_3(N):\n    total_sum = 0\n    for num in range(1, N + 1):\n        if num % 3 != 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_excluding_multiples_of_3", "input": "7", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8056_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023724", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "(5.0, 5.5, 10), 1", "output": "(5.0, 5.5, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023725", "code": "def sum_greater_than_threshold(nums, threshold):\n    result = 0\n    for num in nums:\n        if num >= threshold:\n            result += num\n    return [result]\n", "entry_point": "sum_greater_than_threshold", "input": "[66], 66", "output": "[66]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115128_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023726", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(N, len(scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    average = top_scores_sum / num_students if num_students > 0 else 0.0\n    return average\n", "entry_point": "average_top_scores", "input": "[85, 84, 83], 3", "output": "84.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99565_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023727", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'Hexol'", "output": "b'Hexol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023728", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[5, 1, 2, 2, 2, 2, 6, 8]", "output": "[5, 1, 2, 2, 2, 2, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023729", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[300, 300, 300, 249], 1, 4", "output": "287.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023730", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 45", "output": "'45%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023731", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'1.0.110'", "output": "'1.0.111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023732", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[4, 4, 3, 3, 5, 6, 6]", "output": "[4, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023733", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmordmo.optionrdmo.optig'", "output": "('rdmordmo.optionrdmo', 'optig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023734", "code": "def generate_sequence(a, b, n):\n    output = \"\"\n    for num in range(1, n + 1):\n        if num % a == 0 and num % b == 0:\n            output += \"FB \"\n        elif num % a == 0:\n            output += \"F \"\n        elif num % b == 0:\n            output += \"B \"\n        else:\n            output += str(num) + \" \"\n    return output.rstrip()\n", "entry_point": "generate_sequence", "input": "3, 7, 16", "output": "'1 2 F 4 5 F B 8 F 10 11 F 13 B F 16'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30858_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023735", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "8", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8570", "output": "{1, 2, 5, 10, 1714, 857, 8570, 4285}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8569", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023737", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['4 + 4']", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023738", "code": "def calculate_output(n):\n    if n > 0:\n        return n + 1\n    elif n < 0:\n        return n\n    else:\n        return 1\n", "entry_point": "calculate_output", "input": "7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133216_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "357", "output": "{1, 3, 357, 7, 17, 51, 21, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023740", "code": "def generate_pattern(input_str):\n    pattern = []\n    for i, char in enumerate(input_str, start=1):\n        repeated_chars = [char] * i\n        pattern.append(\" \".join(repeated_chars))\n    return pattern\n", "entry_point": "generate_pattern", "input": "'hello'", "output": "['h', 'e e', 'l l l', 'l l l l', 'o o o o o']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67022_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023741", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'3.314.0'", "output": "(3, 314)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023742", "code": "BRIGHTNESS_TO_PRESET = {1: \"low\", 2: \"medium\", 3: \"high\"}\ndef convert_brightness_to_preset(brightness: int) -> str:\n    preset = BRIGHTNESS_TO_PRESET.get(brightness)\n    return preset if preset else \"Unknown\"\n", "entry_point": "convert_brightness_to_preset", "input": "1", "output": "'low'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134852_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023743", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "400, 20, 4", "output": "424", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023744", "code": "def calculate_total_time_elapsed(frame_interval, num_frames):\n    time_interval = frame_interval * 10.0 / 60.0  # Calculate time interval for 10 frames in minutes\n    total_time_elapsed = time_interval * (num_frames / 10)  # Calculate total time elapsed in minutes\n    return total_time_elapsed\n", "entry_point": "calculate_total_time_elapsed", "input": "31.358081535999993, 60", "output": "31.358081535999993", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24500_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8121", "output": "{3, 1, 8121, 2707}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8120", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023746", "code": "def calculate_char_frequency(input_string):\n    char_frequency = {}\n    for char in input_string:\n        if char.isalpha():\n            char_lower = char.lower()\n            char_frequency[char_lower] = char_frequency.get(char_lower, 0) + 1\n    return char_frequency\n", "entry_point": "calculate_char_frequency", "input": "'World'", "output": "{'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14987_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023747", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2547", "output": "{1, 3, 9, 849, 2547, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6233", "output": "{6233, 1, 271, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023749", "code": "def generate_unique_engine_name(existing_engine_names):\n    existing_numbers = set()\n    for name in existing_engine_names:\n        if name.startswith(\"engine\"):\n            try:\n                num = int(name[6:])  # Extract the number part after \"engine\"\n                existing_numbers.add(num)\n            except ValueError:\n                pass  # Ignore if the number part is not an integer\n    new_num = 1\n    while new_num in existing_numbers:\n        new_num += 1\n    return f\"engine{new_num}\"\n", "entry_point": "generate_unique_engine_name", "input": "[]", "output": "'engine1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120274_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2305", "output": "{461, 1, 5, 2305}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023751", "code": "def min_gas_stations(distances, max_distance):\n    stations = 0\n    remaining_distance = max_distance\n    for distance in distances:\n        if remaining_distance < distance:\n            stations += 1\n            remaining_distance = max_distance\n        remaining_distance -= distance\n    return stations\n", "entry_point": "min_gas_stations", "input": "[11, 12, 10, 10, 5], 10", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48197_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023752", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[10, 11, 9, 4, 10, 12, 4], 9", "output": "[10, 11, 10, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023753", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 4, 0, 3, -1, 3, 1, 3]", "output": "[5, 4, 3, 2, 2, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113927_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023754", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023755", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[5, 4, 4, 4, 3, 3, 4]", "output": "[9, 8, 8, 7, 6, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023756", "code": "def sum_of_largest_four(nums):\n    sorted_nums = sorted(nums, reverse=True)\n    return sum(sorted_nums[:4])\n", "entry_point": "sum_of_largest_four", "input": "[10, 10, 11, 11]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104402_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023757", "code": "def fizz_buzz(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            output_list.append('FizzBuzz')\n        elif num % 3 == 0:\n            output_list.append('Fizz')\n        elif num % 5 == 0:\n            output_list.append('Buzz')\n        else:\n            output_list.append(num)\n    return output_list\n", "entry_point": "fizz_buzz", "input": "[4, 16, 1, 2, 16, 2, 16, 1, 16]", "output": "[4, 16, 1, 2, 16, 2, 16, 1, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117515_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023758", "code": "def calculate_total_time_elapsed(frame_interval, num_frames):\n    time_interval = frame_interval * 10.0 / 60.0  # Calculate time interval for 10 frames in minutes\n    total_time_elapsed = time_interval * (num_frames / 10)  # Calculate total time elapsed in minutes\n    return total_time_elapsed\n", "entry_point": "calculate_total_time_elapsed", "input": "14.7456, 60", "output": "14.7456", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24500_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023759", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 80, 80, 80, 80, 50, 50]", "output": "[1, 2, 3, 3, 3, 3, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94997_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023760", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[35]", "output": "'0x23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023761", "code": "def sum_multiples_3_5(numbers):\n    sum_multiples = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            sum_multiples += num\n    return sum_multiples\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 6, 15, 9]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92358_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023762", "code": "def extract_module_name(import_statement):\n    # Split the import statement by spaces\n    components = import_statement.split()\n    # Extract the module name from the components\n    module_name = components[1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'import willsp'", "output": "'willsp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75298_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023763", "code": "def modify_django_app_name(app_name: str) -> str:\n    modified_name = \"\"\n    for char in app_name:\n        if char.isupper():\n            modified_name += \"_\" + char.lower()\n        else:\n            modified_name += char\n    return modified_name\n", "entry_point": "modify_django_app_name", "input": "'ReviewRatings'", "output": "'_review_ratings'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57025_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023764", "code": "def distance_to_camera(knownWidth, focalLength, perWidth):\n    # Compute and return the distance from the object to the camera\n    return (knownWidth * focalLength) / perWidth\n", "entry_point": "distance_to_camera", "input": "1, 412.4782608695652, 1", "output": "412.4782608695652", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71888_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023765", "code": "def next_element(some_list, current_index):\n    if not some_list:\n        return ''\n    next_index = (current_index + 1) % len(some_list)\n    return some_list[next_index]\n", "entry_point": "next_element", "input": "[], 0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54712_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023766", "code": "def generate_decoder_dimensions(encode_dim, latent):\n    # Reverse the encoder dimensions list\n    decode_dim = list(reversed(encode_dim))\n    # Append the latent size at the end\n    decode_dim.append(latent)\n    return decode_dim\n", "entry_point": "generate_decoder_dimensions", "input": "[397, 1599, 3199, 397, 398, 1600], 12", "output": "[1600, 398, 397, 3199, 1599, 397, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112112_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023767", "code": "def extract_github_info(url):\n    # Remove \"https://github.com/\" from the URL\n    url = url.replace(\"https://github.com/\", \"\")\n    # Split the remaining URL by \"/\"\n    parts = url.split(\"/\")\n    # Extract the username and repository name\n    username = parts[0]\n    repository = parts[1]\n    return (username, repository)\n", "entry_point": "extract_github_info", "input": "'https://github.com/an-dr/TheScript'", "output": "('an-dr', 'TheScript')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146065_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023768", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'SSDOO', 1", "output": "'TTEPP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023769", "code": "import binascii\nfrom typing import Union\ndef scrub_input(hex_str_or_bytes: Union[str, bytes]) -> bytes:\n    if isinstance(hex_str_or_bytes, str):\n        hex_str_or_bytes = binascii.unhexlify(hex_str_or_bytes)\n    return hex_str_or_bytes\n", "entry_point": "scrub_input", "input": "'48656c86c6'", "output": "b'Hel\\x86\\xc6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49478_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023770", "code": "def extract_prefix_words(data):\n    prefix_words_dict = {}\n    for item in data:\n        parts = item.split()\n        prefix = parts[0]\n        words = parts[1:]\n        if prefix in prefix_words_dict:\n            prefix_words_dict[prefix].extend(words)\n        else:\n            prefix_words_dict[prefix] = words\n    return prefix_words_dict\n", "entry_point": "extract_prefix_words", "input": "['pre1', 'p1']", "output": "{'pre1': [], 'p1': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60767_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023771", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[2, 10, 15, 1, 7, 6, 4, 1, 2]", "output": "{(2, 10, 15), (4, 1, 2), (1, 7, 6)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023772", "code": "def extract_info(metadata_dict):\n    info_list = []\n    for key, value in metadata_dict.items():\n        info_list.append(f\"{key.capitalize()}: {value}\")\n    return '\\n'.join(info_list)\n", "entry_point": "extract_info", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51622_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023773", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'rs.some.other.parts.SerservvConig'", "output": "('rs', 'SerservvConig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023774", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2987", "output": "{1, 2987, 29, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023775", "code": "def parse_afni_output(output_string):\n    lines = output_string.splitlines()\n    values_list = []\n    for line in lines:\n        try:\n            float_value = float(line)\n            values_list.append(float_value)\n        except ValueError:\n            pass  # Ignore lines that are not valid float values\n    return values_list\n", "entry_point": "parse_afni_output", "input": "'10.0'", "output": "[10.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023776", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8537", "output": "{8537, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023777", "code": "from typing import List\ndef map_flags_to_operations(flags: List[int]) -> str:\n    flag_mapping = {\n        1: \"os.O_CREAT\",\n        2: \"os.O_EXCL\",\n        4: \"os.O_WRONLY\"\n    }\n    operations = [flag_mapping[flag] for flag in flags]\n    return \" | \".join(operations)\n", "entry_point": "map_flags_to_operations", "input": "[1, 2, 4]", "output": "'os.O_CREAT | os.O_EXCL | os.O_WRONLY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67277_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023778", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'3129.10.0'", "output": "'3129.9.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023779", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'nincluded'", "output": "{'nincluded': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023780", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "100, 2", "output": "4950", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt4698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023781", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVHVAC/fdi2'", "output": "('HVHVAC/fdi2', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023782", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "8", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023783", "code": "import re\nfrom typing import Set\ndef process_mutations(raw_data: str) -> Set[str]:\n    muts = set()\n    text = re.sub('<[^<]+>', \"\", raw_data)  # Strip all xml tags\n    muts.update(re.findall(r'[A-Z]\\d+[A-Z]', text))  # Find patterns like P223Q\n    # Find patterns like \"223 A > T\", \"223 A &gt; T\" and convert them to canonical form \"223A>T\"\n    strings = re.findall(r'\\d+ *[ACGT]+ *(?:&gt;|>) *[ACGT]+', text)\n    for ss in strings:\n        m = re.search(r'(?P<pos>\\d+) *(?P<from>[ACGT]+) *(:?&gt;|>) *(?P<to>[ACGT]+)', ss)\n        mut = f\"{m.group('pos')}{m.group('from')}>{m.group('to')}\"\n        muts.add(mut)\n    return muts\n", "entry_point": "process_mutations", "input": "'Some text with mutation like 223 A > T'", "output": "{'223A>T'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93632_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023784", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "88", "output": "{2: 3, 11: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "568", "output": "{1, 2, 4, 71, 8, 142, 568, 284}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt567", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023786", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'eet'", "output": "'contracts/eet.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023787", "code": "def cut_log(p, n):\n    maximum = [0]  # Initialize the list to store maximum revenue for each rod length\n    for j in range(1, n + 1):\n        comp = -float(\"inf\")\n        for i in range(1, j + 1):\n            comp = max(p[i - 1] + maximum[j - i], comp)\n        maximum.append(comp)\n    return maximum[-1]\n", "entry_point": "cut_log", "input": "[1, 2], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113055_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023788", "code": "def modify_template_name(template_name: str) -> str:\n    # Trim leading and trailing whitespace, convert to lowercase, and return\n    return template_name.strip().lower()\n", "entry_point": "modify_template_name", "input": "'  MyTe  '", "output": "'myte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116239_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023789", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "27", "output": "[1, 1, 0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023790", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[8, 7, 8]", "output": "[7, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt46", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023791", "code": "def generate_list(n):\n    res = []\n    for i in range(1, (n // 2) + 1):\n        res.append(i)\n    for i in range(-(n // 2), 0):\n        res.append(i)\n    return res\n", "entry_point": "generate_list", "input": "10", "output": "[1, 2, 3, 4, 5, -5, -4, -3, -2, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88002_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023792", "code": "def circular_sum(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 3, 2, 1, 0, 3, 0]", "output": "[4, 5, 3, 1, 3, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148378_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023793", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[0, 4, 6, 5, 7, 7, 5]", "output": "[0, 4, 6, 7, 7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023794", "code": "def count_unique_maintainers(projects):\n    unique_maintainers = set()\n    for project in projects:\n        unique_maintainers.update(project.get(\"maintainers\", []))\n    return len(unique_maintainers)\n", "entry_point": "count_unique_maintainers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2621_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4765", "output": "{1, 5, 953, 4765}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4764", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023796", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2111", "output": "{1, 2111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023797", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "11", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023798", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'worldhello'", "output": "'w.o.r.l.d.h.e.l.l.o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023799", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[6, 8, 8, 6, 6, 6, 6, 1, 1]", "output": "[14, 16, 14, 12, 12, 12, 7, 2, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023800", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[3, 2, 4, 2, 5, 3, 4, 4, 5]", "output": "[9, 4, 8, 4, 25, 9, 8, 8, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023801", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[90, 70, 80, 85]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023802", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'00:00:00', '00:44:55'", "output": "2695", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023803", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'aaaa'", "output": "{'a': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023804", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[4, 8, 8, 6]", "output": "[4, 8, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023805", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2377", "output": "{2377, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023806", "code": "def custom_translate(input_string: str, replacements: dict) -> str:\n    for key, value in replacements.items():\n        input_string = input_string.replace(key, value)\n    return input_string\n", "entry_point": "custom_translate", "input": "'World!', {}", "output": "'World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70881_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023807", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1111110X'", "output": "['11111100', '11111101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt29", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023808", "code": "def reverse(input_str):\n    reversed_str = ''\n    for i in range(len(input_str) - 1, -1, -1):\n        reversed_str += input_str[i]\n    return reversed_str\n", "entry_point": "reverse", "input": "'mghngry!'", "output": "'!yrgnhgm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77619_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "507", "output": "{1, 3, 39, 169, 13, 507}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023810", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[80, 82, 78, 73, 60], 4", "output": "78.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023811", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'2\u4f60\u4f60'", "output": "'2\u4f60\u4f60'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7437", "output": "{1, 3, 67, 37, 201, 7437, 2479, 111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8041", "output": "{1, 8041, 11, 43, 187, 17, 473, 731}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023814", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "[37, 37, 37, 37, 38]", "output": "37.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023815", "code": "def calculate_salutes(hallway: str) -> int:\n    crosses = 0\n    right_count = 0\n    for char in hallway:\n        if char == \">\":\n            right_count += 1\n        elif char == \"<\":\n            crosses += right_count * 2\n    return crosses\n", "entry_point": "calculate_salutes", "input": "'>><<'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117936_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023816", "code": "def process_imports(imports):\n    import_mapping = {}\n    for import_stmt in imports:\n        if 'from' in import_stmt:\n            parts = import_stmt.split('from ')[1].split(' import ')\n            imported_module = parts[0]\n            imported_from = parts[1].split('.')[0] if '.' in parts[1] else None\n        else:\n            imported_module = import_stmt.split('import ')[1].split(' as ')[0]\n            imported_from = None\n        import_mapping[imported_module] = imported_from\n    return import_mapping\n", "entry_point": "process_imports", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43185_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023817", "code": "def parse_query(query: str) -> str:\n    parts = query.split('==')\n    if len(parts) != 2:\n        return \"Invalid query format. Please provide a query in the format 'column == value'.\"\n    column = parts[0].strip()\n    value = parts[1].strip()\n    return f\"SELECT * FROM results WHERE {column} == {value}\"\n", "entry_point": "parse_query", "input": "'== c'", "output": "'SELECT * FROM results WHERE  == c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98962_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023818", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[4, 2, 3, 5, 3, 1, 5, 4, 5]", "output": "[4, 2, 3, 5, 3, 1, 5, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023819", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'hhello'", "output": "{'hhello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023820", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[2, 1, 1, 0, 5, -1, 0, 5, 0, 0]", "output": "[2, 1, 1, 0, 5, -1, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023821", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023822", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9723", "output": "{1, 3, 7, 3241, 1389, 463, 21, 9723}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023823", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[20, 23]", "output": "'0x2b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023824", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'3.372727773'", "output": "(3, 372727773)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023825", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7333", "output": "{1, 7333}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023826", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[10, 5, 10, 15, 10, 15, 5, 10]", "output": "[1, 0, 1, 2, 1, 2, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023827", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "1", "output": "'0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023828", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "-3, -7", "output": "-21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4766", "output": "{1, 2, 4766, 2383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5011", "output": "{1, 5011}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5010", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6818", "output": "{1, 6818, 2, 7, 487, 974, 14, 3409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023832", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[0, 0, 0, 3, -2, 2, 2, 5]", "output": "{0: 3, 3: 1, -2: 1, 2: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023833", "code": "def even_odd_sort(lst):\n    left = 0\n    right = len(lst) - 1\n    while left < right:\n        if lst[left] % 2 != 0 and lst[right] % 2 == 0:\n            lst[left], lst[right] = lst[right], lst[left]\n        if lst[left] % 2 == 0:\n            left += 1\n        if lst[right] % 2 != 0:\n            right -= 1\n    return lst\n", "entry_point": "even_odd_sort", "input": "[6, 2, 4, 1, 5, 9, 1, 3, 5, 3]", "output": "[6, 2, 4, 1, 5, 9, 1, 3, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58082_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023834", "code": "def solve(num_stairs, points):\n    dp = [0] * (num_stairs + 1)\n    dp[1] = points[1]\n    for i in range(2, num_stairs + 1):\n        dp[i] = max(points[i] + dp[i - 1], dp[i - 2] + points[i])\n    return dp[num_stairs]\n", "entry_point": "solve", "input": "2, [0, 1, 0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147689_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023835", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3394", "output": "{1, 3394, 2, 1697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3393", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023836", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1069", "output": "{1, 1069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023837", "code": "def custom_word_frequency(sentence: str, custom_punctuation: str) -> dict:\n    sentence = sentence.lower()\n    words = {}\n    for s in custom_punctuation:\n        sentence = sentence.replace(s, ' ')\n    for w in sentence.split():\n        if w.endswith('\\''):\n            w = w[:-1]\n        if w.startswith('\\''):\n            w = w[1:]\n        words[w] = words.get(w, 0) + 1\n    return words\n", "entry_point": "custom_word_frequency", "input": "'beabeauul', ''", "output": "{'beabeauul': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9164_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023838", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'woorldhlohehd'", "output": "{'woorldhlohehd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023839", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(4, 1, 4, 7, 8, 1, 6, 1)", "output": "'4.1.4.7.8.1.6.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023840", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 11, 12, 13, 14, 5, 25, 30]", "output": "(5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023841", "code": "def simple_calculator(operation, num1, num2):\n    if operation == '**':\n        return num1 ** num2\n    elif operation == '*' or operation == '/':\n        return num1 * num2 if operation == '*' else num1 / num2\n    elif operation == '//' or operation == '%':\n        return num1 // num2 if operation == '//' else num1 % num2\n    elif operation == '+' or operation == '-':\n        return num1 + num2 if operation == '+' else num1 - num2\n    else:\n        return \"Invalid operation\"\n", "entry_point": "simple_calculator", "input": "'*', 3, 4", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63622_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4052", "output": "{1, 2, 4, 2026, 4052, 1013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4051", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023843", "code": "def count_valid_groupings(n, k):\n    c1 = n // k\n    c2 = n // (k // 2)\n    if k % 2 == 1:\n        cnt = pow(c1, 3)\n    else:\n        cnt = pow(c1, 3) + pow(c2 - c1, 3)\n    return cnt\n", "entry_point": "count_valid_groupings", "input": "8, 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122726_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023844", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'Hg-80'", "output": "'Hg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023845", "code": "import math\ndef calculate_distance_traveled(rotations_right, rotations_left, wheel_radius):\n    distance_right = wheel_radius * 2 * math.pi * rotations_right\n    distance_left = wheel_radius * 2 * math.pi * rotations_left\n    total_distance = (distance_right + distance_left) / 2\n    return total_distance\n", "entry_point": "calculate_distance_traveled", "input": "630, 630, 0.1", "output": "395.84067435231395", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15765_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023846", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9253", "output": "{1, 19, 9253, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9252", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023847", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'Sample'", "output": "{'sample': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023848", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6746", "output": "{1, 6746, 2, 3373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023849", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'11.131.3111'", "output": "'11.131.3112'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45821_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023850", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023851", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "0.5, 0.5", "output": "('0', '0')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023852", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'lovera'", "output": "'lovera'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023853", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "712", "output": "{1, 2, 356, 4, 712, 8, 178, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt711", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023854", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "142", "output": "{1, 2, 142, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023855", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "122", "output": "'2:02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023856", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[10, 20, 20, 30, 40, 50, 50]", "output": "'10, 20, 30, 40, 50'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023857", "code": "def generate_down_revision(input_revision: str) -> str:\n    down_revision = ''\n    for char in input_revision:\n        if char.isalnum():\n            if char == '9':\n                down_revision += '0'\n            else:\n                down_revision += chr(ord(char) + 1)\n        else:\n            down_revision += char\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'PASSO'", "output": "'QBTTP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118764_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023858", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'cihtiih'", "output": "'cihtiih'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023859", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'11.2'", "output": "'11.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023860", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[5, 6]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1002", "output": "{1, 2, 3, 6, 167, 1002, 334, 501}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1001", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023862", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "10, 2", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023863", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'itaohnems'", "output": "'itaohnems'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023864", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'1.42.1', '1.52.3'", "output": "'1.42.1 to 1.52.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023865", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[2, 4, 9, 5, 9, 9], 1", "output": "[[2], [4], [9], [5], [9], [9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023866", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "3", "output": "'Download interrupted by keyboard'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023867", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[5, 9, 2, 5, 2, 2, 9, 5]", "output": "[2, 2, 2, 5, 5, 5, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023868", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "'some_user_id', -2", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023869", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'sssnake_case_examplaee_exa'", "output": "'sssnakeCaseExamplaeeExa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023870", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "1, 1, 3", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023871", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'my_modmy_m', 'some_attribute'", "output": "'Error: Module my_modmy_m not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023872", "code": "def can_navigate_maze(maze):\n    def dfs(row, col):\n        if row < 0 or col < 0 or row >= len(maze) or col >= len(maze[0]) or maze[row][col] == 'X':\n            return False\n        if maze[row][col] == 'E':\n            return True\n        maze[row] = maze[row][:col] + 'X' + maze[row][col+1:]  # Mark current position as visited\n        directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]  # Right, Left, Down, Up\n        for dr, dc in directions:\n            if dfs(row + dr, col + dc):\n                return True\n        return False\n    for i in range(len(maze)):\n        for j in range(len(maze[0])):\n            if maze[i][j] == 'S':\n                return dfs(i, j)\n    return False\n", "entry_point": "can_navigate_maze", "input": "['XXXXX', 'XSXXX', 'XXXXX', 'XXXXX', 'XXXXX']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127163_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023873", "code": "def calculate_cube_volume(width, height, depth):\n    volume = width * height * depth\n    return volume\n", "entry_point": "calculate_cube_volume", "input": "16, 1, 1007", "output": "16112", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20357_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023874", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[45, 50, 51, 57.5, 100]", "output": "52.833333333333336", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50380_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023875", "code": "def longest_consecutive_primes(primes, n):\n    prime = [False, False] + [True] * (n - 1)\n    for i in range(2, int(n**0.5) + 1):\n        if prime[i]:\n            for j in range(i*i, n+1, i):\n                prime[j] = False\n    count = 0\n    ans = 0\n    for index, elem in enumerate(primes):\n        total_sum = 0\n        temp_count = 0\n        for i in range(index, len(primes)):\n            total_sum += primes[i]\n            temp_count += 1\n            if total_sum > n:\n                break\n            if prime[total_sum]:\n                if temp_count > count or (temp_count == count and primes[index] < ans):\n                    ans = total_sum\n                    count = temp_count\n    return ans, count\n", "entry_point": "longest_consecutive_primes", "input": "[2, 3, 5, 7, 11], 17", "output": "(17, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91133_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "709", "output": "{1, 709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt708", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023877", "code": "def transform_sql_query(sql_query):\n    modified_query = sql_query.replace(\"select\", \"SELECT\").replace(\"from\", \"FROM\").replace(\"where\", \"WHERE\")\n    return modified_query\n", "entry_point": "transform_sql_query", "input": "'rown1'", "output": "'rown1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96099_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023878", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[3, 1, 3, 3, 2]", "output": "[4, 4, 6, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023879", "code": "def categorize_items(categories):\n    categorized_items = {}\n    for category in categories:\n        category_name, items = category.split(':')\n        categorized_items[category_name] = items.split(',')\n    return categorized_items\n", "entry_point": "categorize_items", "input": "['Colors:red,blue,green']", "output": "{'Colors': ['red', 'blue', 'green']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116654_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023880", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8789", "output": "{1, 517, 11, 47, 17, 8789, 187, 799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023881", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[6, 7, 6, 4, 1, 6, 6, 7, 6]", "output": "[1, 4, 6, 6, 6, 6, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127731_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023882", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0.0\n    min_score = min(scores)\n    scores.remove(min_score)\n    if len(scores) == 0:\n        return 0.0\n    return sum(scores) / len(scores)\n", "entry_point": "calculate_average", "input": "[0, 100, 100, 100, 99]", "output": "99.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142282_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023883", "code": "def calculate_video_duration(frames: int, fps: int) -> int:\n    total_duration = frames // fps\n    return total_duration\n", "entry_point": "calculate_video_duration", "input": "12, 2", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77453_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023884", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[7, 3, 9, 0, 7, 9, 7, 7]", "output": "[0, 3, 7, 7, 7, 7, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023885", "code": "from typing import List, Dict\ndef word_frequency_counter(words: List[str]) -> Dict[str, int]:\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency_counter", "input": "['bapphhanana', 'banana']", "output": "{'bapphhanana': 1, 'banana': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103792_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023886", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'987654321'", "output": "'98765432162485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023887", "code": "import re\ndef render_template(template, context):\n    def replace(match):\n        key = match.group(1).strip()\n        return str(context.get(key, ''))\n    rendered_template = re.sub(r'{{\\s*(\\w+)\\s*}}', replace, template)\n    return rendered_template\n", "entry_point": "render_template", "input": "'{{nname', {}", "output": "'{{nname'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116811_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023888", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'456,123,78'", "output": "{456, 123, 78}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023889", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023890", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "-2.0", "output": "-0.764", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023891", "code": "def count_unique_characters(input_string):\n    char_counts = {}\n    for char in input_string:\n        if char.isalpha():\n            char = char.upper()\n            char_counts[char] = char_counts.get(char, 0) + 1\n    return char_counts\n", "entry_point": "count_unique_characters", "input": "'Hello!'", "output": "{'H': 1, 'E': 1, 'L': 2, 'O': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123807_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023892", "code": "import re\nfrom typing import List\ndef extract_matches(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-zA-Z0-9]*\\b'  # Define the pattern for matching words\n    matches = re.findall(pattern, text)  # Find all matches in the text\n    unique_matches = list(set(matches))  # Get unique matches by converting to set and back to list\n    return unique_matches\n", "entry_point": "extract_matches", "input": "'functionality'", "output": "['functionality']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76446_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023893", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[315, 315, 315, 315], 4", "output": "315.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023894", "code": "def process_string(input_string):\n    if \"apple\" in input_string:\n        input_string = input_string.replace(\"apple\", \"orange\")\n    if \"banana\" in input_string:\n        input_string = input_string.replace(\"banana\", \"\")\n    if \"cherry\" in input_string:\n        input_string = input_string.replace(\"cherry\", \"CHERRY\")\n    return input_string\n", "entry_point": "process_string", "input": "'cha'", "output": "'cha'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133930_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023895", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3666", "output": "'1 hour 1 minute 6 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023896", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabbbccDe'", "output": "'a3b3c2D1e1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60229_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023897", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[2, 3, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023898", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "'heoelllo'", "output": "{'str': 'heoelllo'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023899", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[2, 2, 2, 3, 4, 7]", "output": "[4, 4, 4, 27, 16, 343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023900", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "106.0, 78.0", "output": "(-53.0, 53.0, 107.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023901", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023902", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'3-50'", "output": "-47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023903", "code": "def timecode_to_frames(tc, framerate):\n    components = tc.split(':')\n    hours = int(components[0])\n    minutes = int(components[1])\n    seconds = int(components[2])\n    frames = int(components[3])\n    total_frames = frames + seconds * framerate + minutes * framerate * 60 + hours * framerate * 60 * 60\n    return total_frames\n", "entry_point": "timecode_to_frames", "input": "'00:00:00:00', 30", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42773_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023904", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "100, 80, 60, 46", "output": "286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023905", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'double_value_5.67'", "output": "'5.67'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023906", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[10, 20, 30, 40, 50, 60, 70]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023907", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1111000X'", "output": "['11110000', '11110001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt36", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023908", "code": "def calculate_span(a):\n    n = len(a)\n    stack = []\n    span = [0] * n\n    span[0] = 1\n    stack.append(0)\n    for i in range(1, n):\n        while stack and a[stack[-1]] <= a[i]:\n            stack.pop()\n        span[i] = i + 1 if not stack else i - stack[-1]\n        stack.append(i)\n    return span\n", "entry_point": "calculate_span", "input": "[10, 20, 30, 40, 20, 10, 5]", "output": "[1, 2, 3, 4, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22670_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023909", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'XXYZ'", "output": "('XXYZ', None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023910", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[20, 6, 10, 2]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023911", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'sample'", "output": "('', 'sample')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023912", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "5.31, 1.5", "output": "2.36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023913", "code": "def filter_items(things, attribute):\n    filtered_items = {}\n    for item_id, attributes in things.items():\n        if attribute in attributes:\n            filtered_items[item_id] = attributes\n    return filtered_items\n", "entry_point": "filter_items", "input": "{}, 'non_existent_attribute'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111552_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023914", "code": "def get_module_name(input_str: str) -> str:\n    input_str = input_str.strip()  # Remove leading and trailing whitespace\n    if not input_str:  # Check if the string is empty\n        return \"\"\n    parts = input_str.split('.')\n    return parts[-1] if len(parts) > 1 else input_str\n", "entry_point": "get_module_name", "input": "'my.package.logger'", "output": "'logger'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130472_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023915", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "92", "output": "{1, 2, 4, 46, 23, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt91", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023916", "code": "def convert_to_lowercase(input_list):\n    lowercase_list = []\n    for string in input_list:\n        lowercase_string = \"\"\n        for char in string:\n            if 'A' <= char <= 'Z':\n                lowercase_string += chr(ord(char) + 32)\n            else:\n                lowercase_string += char\n        lowercase_list.append(lowercase_string)\n    return lowercase_list\n", "entry_point": "convert_to_lowercase", "input": "['helll', 'hellllo']", "output": "['helll', 'hellllo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15076_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023917", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'BB'", "output": "['BB', 'BB']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023918", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 90, 89, 85, 80]", "output": "[92, 90, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023919", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023920", "code": "def calculate_score_frequencies(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequencies", "input": "[101, 101, 101, 84, 92, 100, 100]", "output": "{101: 3, 84: 1, 92: 1, 100: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103700_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023921", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5681", "output": "{1, 299, 13, 5681, 19, 437, 23, 247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023922", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6895", "output": "{1, 1379, 35, 5, 197, 7, 6895, 985}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6894", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023923", "code": "def fractional_knapsack(val, wt, wt_cap):\n    vals_per_wts = [(v / w, v, w) for (v, w) in zip(val, wt)]\n    sorted_vals_per_wts = sorted(vals_per_wts, reverse=True)\n    max_val = 0\n    total_wt = 0\n    for vw, v, w in sorted_vals_per_wts:\n        if total_wt + w <= wt_cap:\n            total_wt += w\n            max_val += v\n        else:\n            wt_remain = wt_cap - total_wt\n            max_val += vw * wt_remain\n            break\n    return max_val\n", "entry_point": "fractional_knapsack", "input": "[100, 120, 60], [20, 30, 10], 50", "output": "240.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64632_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023924", "code": "from typing import List\ndef sum_of_max_values(strings: List[str]) -> int:\n    total_sum = 0\n    for string in strings:\n        integers = [int(num) for num in string.split(',')]\n        max_value = max(integers)\n        total_sum += max_value\n    return total_sum\n", "entry_point": "sum_of_max_values", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86134_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023925", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average = total_sum / total_students\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[60, 62, 63, 63, 66]", "output": "63", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33090_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023926", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023927", "code": "import re\nfrom typing import List\nNUMERIC_VALUES = re.compile(r\"-?[\\d.]*\\d$\")\ndef count_numeric_strings(input_list: List[str]) -> int:\n    count = 0\n    for string in input_list:\n        if NUMERIC_VALUES.search(string):\n            count += 1\n    return count\n", "entry_point": "count_numeric_strings", "input": "['-2.5', '3', '10.0']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76559_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023928", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "10", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023929", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1902", "output": "{1, 2, 3, 6, 1902, 951, 634, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1901", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023930", "code": "def get_error_message(error_code):\n    error_codes = {\n        101: \"Invalid parameters\",\n        102: \"API does not exist\",\n        103: \"API method does not exist\",\n        104: \"API version not supported\",\n        105: \"Insufficient user privilege\",\n        106: \"Connection timeout\",\n        107: \"Multiple login detected\",\n        400: \"Invalid credentials\",\n        401: \"Guest or disabled account\",\n        402: \"Permission denied\",\n        403: \"OTP not specified\",\n        404: \"OTP authentication failed\",\n        405: \"Incorrect app portal\",\n        406: \"OTP code enforced\",\n        407: \"Maximum tries exceeded\"\n    }\n    default_error_message = \"Unknown error\"\n    return error_codes.get(error_code, default_error_message)\n", "entry_point": "get_error_message", "input": "403", "output": "'OTP not specified'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148909_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023931", "code": "def calculate_percent_bias(simulated, observed):\n    # Calculate the numerator of the formula\n    numerator = sum([s - o for s, o in zip(simulated, observed)])\n    # Calculate the denominator of the formula\n    denominator = sum(observed)\n    # Calculate the percent bias\n    B = 100.0 * numerator / denominator\n    return B\n", "entry_point": "calculate_percent_bias", "input": "[50, 70, 130], [60, 60, 120]", "output": "4.166666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44927_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023932", "code": "from typing import List\ndef generate_full_paths(resources: List[str], resource_root: str) -> List[str]:\n    full_paths = []\n    for resource in resources:\n        full_path = resource_root + '/' + resource\n        full_paths.append(full_path)\n    return full_paths\n", "entry_point": "generate_full_paths", "input": "[], '/home/user'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78756_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023933", "code": "def calculate_balance(initial_balance, transactions, account_id):\n    balances = {account_id: initial_balance}\n    for account, amount in transactions:\n        if account not in balances:\n            balances[account] = 0\n        balances[account] += amount\n    return balances.get(account_id, 0)\n", "entry_point": "calculate_balance", "input": "300, [('account_id', 2)], 'account_id'", "output": "302", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118421_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023934", "code": "def process_sky_areas(sky_areas, dict_completed):\n    processed_sky_areas_to_remove = {}\n    # Identify processed sky areas\n    for sky_area_id, sky_area in sky_areas.items():\n        if sky_area_id in dict_completed:\n            processed_sky_areas_to_remove[sky_area_id] = sky_area\n    # Remove processed sky areas after iteration\n    for processed_sky_area_id, processed_sky_area in processed_sky_areas_to_remove.items():\n        if processed_sky_area_id in sky_areas:\n            del sky_areas[processed_sky_area_id]\n        else:\n            print(\"Processed sky area does not exist: {0}\".format(processed_sky_area_id))\n    print(\"Already processed sky areas: {0}\".format(len(processed_sky_areas_to_remove)))\n    return list(processed_sky_areas_to_remove.keys())\n", "entry_point": "process_sky_areas", "input": "{'area1': 'data1', 'area2': 'data2'}, {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113425_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023935", "code": "def sum_multiples_3_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 30, 33]", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41452_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023936", "code": "def min_jumps(c):\n    jumps = 0\n    i = 0\n    while i < (len(c) - 2):\n        if c[i+2] == 0:\n            i += 2\n        else:\n            i += 1\n        jumps += 1\n    if c[-3] == 1:\n        jumps += 1\n    return jumps\n", "entry_point": "min_jumps", "input": "[0, 0, 1, 1, 0, 0]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90251_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023937", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, 2, 4, 2, 5, 2, 4, 2]", "output": "[3, 3, 6, 5, 9, 7, 10, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023938", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "18464", "output": "9232", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023939", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[4, 4, 2, 1, 6, 4, 2, 4]", "output": "[1, 2, 2, 4, 4, 4, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023940", "code": "def get_model_dependencies(migrations):\n    dependencies = {}\n    for model, dependency in reversed(migrations):\n        if model in dependencies:\n            dependencies[model].append(dependency)\n        else:\n            dependencies[model] = [dependency]\n    return dependencies\n", "entry_point": "get_model_dependencies", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145363_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023941", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023942", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'308535385114.dkrm/caffe2/', 286", "output": "'308535385114.dkrm/caffe2/286'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023943", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[1, 5, 3, 0, 1, 0, 8, 2, 2]", "output": "[1, 6, 5, 3, 5, 5, 14, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023944", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[-1, -1, -3, -3, 2, 4, -2, -2]", "output": "{-1: 2, -3: 2, 2: 1, 4: 1, -2: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023945", "code": "from typing import List\ndef sum_double_duplicates(lst: List[int]) -> int:\n    element_freq = {}\n    total_sum = 0\n    # Count the frequency of each element in the list\n    for num in lst:\n        element_freq[num] = element_freq.get(num, 0) + 1\n    # Calculate the sum considering duplicates\n    for num, freq in element_freq.items():\n        if freq > 1:\n            total_sum += num * 2 * freq\n        else:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_double_duplicates", "input": "[3, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21856_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023946", "code": "def get_unique_elements(s):\n    unique_elements = set()\n    for element in s:\n        if element not in unique_elements:\n            unique_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[1]", "output": "{1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73498_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023947", "code": "def manipulate_string(input_string: str) -> str:\n    # Step 1: Reverse the input string\n    reversed_string = input_string[::-1]\n    # Step 2: Capitalize the first letter of the reversed string\n    capitalized_string = reversed_string.capitalize()\n    # Step 3: Append the length of the original string\n    final_output = capitalized_string + str(len(input_string))\n    return final_output\n", "entry_point": "manipulate_string", "input": "'helloEo'", "output": "'Oeolleh7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1099_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023948", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7138", "output": "{1, 7138, 2, 166, 43, 3569, 83, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7137", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023949", "code": "def reverse_and_uppercase(string):\n    reversed_uppercase = string[::-1].upper()\n    return reversed_uppercase\n", "entry_point": "reverse_and_uppercase", "input": "'HEHELL'", "output": "'LLEHEH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45524_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023950", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "6", "output": "720", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023951", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 9", "output": "254.46900494077323", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023952", "code": "import re\ndef extract_version_number(input_string):\n    pattern = r'\\d+(\\.\\d+)+'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group()\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version_number", "input": "'The current version is 2.3'", "output": "'2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48611_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9961", "output": "{1423, 1, 9961, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023954", "code": "from typing import List\ndef merge_sorted_lists(nums1: List[int], nums2: List[int]) -> List[int]:\n    merged = []\n    i, j = 0, 0\n    while i < len(nums1) and j < len(nums2):\n        if nums1[i] < nums2[j]:\n            merged.append(nums1[i])\n            i += 1\n        else:\n            merged.append(nums2[j])\n            j += 1\n    merged.extend(nums1[i:])\n    merged.extend(nums2[j:])\n    return merged\n", "entry_point": "merge_sorted_lists", "input": "[1, 2, 3, 4, 4, 4], [4, 4, 4, 5, 6]", "output": "[1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142881_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023955", "code": "def repeat(word, times):\n    text = \"\"  # Initialize an empty string\n    for _ in range(times):\n        text += word  # Concatenate the word 'times' number of times\n    return text  # Return the concatenated result\n", "entry_point": "repeat", "input": "'llo', 1", "output": "'llo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106481_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023956", "code": "def calculate_weighted_average(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"The lengths of numbers and weights must be equal.\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    weighted_avg = weighted_sum / total_weight\n    return weighted_avg\n", "entry_point": "calculate_weighted_average", "input": "[6, 7, 8], [1, 1, 1]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131444_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023957", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "3, -2", "output": "0.1111111111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023958", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "5, 1", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023959", "code": "def format_color_names(input_string):\n    predefined_words = [\"is\", \"a\", \"nice\"]\n    words = input_string.split()\n    formatted_words = []\n    for word in words:\n        if word.lower() not in predefined_words:\n            word = word.capitalize()\n        formatted_words.append(word)\n    formatted_string = ' '.join(formatted_words)\n    return formatted_string\n", "entry_point": "format_color_names", "input": "'my'", "output": "'My'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25204_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023960", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'hot-dish'", "output": "'hot-dish'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023961", "code": "def elementwise_less_equal(v1, v2):\n    result = []\n    for val1, val2 in zip(v1, v2):\n        result.append(val1 <= val2)\n    return result\n", "entry_point": "elementwise_less_equal", "input": "[3, 4, 1, 2, 3], [2, 3, 2, 2, 3]", "output": "[False, False, True, True, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11405_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023962", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]  # Product of three largest elements\n    product2 = nums[0] * nums[1] * nums[-1]    # Product of two smallest elements and the largest element\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[5, 8, 14]", "output": "560", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125288_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023963", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9826", "output": "{1, 9826, 2, 578, 34, 289, 17, 4913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023964", "code": "def count_unique_dependencies(setup_dict):\n    dependencies = setup_dict.get('install_requires', [])\n    unique_dependencies = set(dependencies)\n    return len(unique_dependencies)\n", "entry_point": "count_unique_dependencies", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54838_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023965", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "'Thixt.x.'", "output": "'<p>Thixt.x.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023966", "code": "from typing import List, Tuple\ndef process_checkbox_state(initial_state: List[Tuple[int, int]], error_location: Tuple[int, int, int]) -> List[Tuple[int, int]]:\n    input_fields = {index: state for index, state in initial_state}\n    checkbox_state = error_location[1] if error_location[0] == error_location[2] else 1 - error_location[1]\n    for index, state in initial_state:\n        if index != error_location[0]:\n            input_fields[index] = checkbox_state\n    return [(index, input_fields[index]) for index in sorted(input_fields.keys())]\n", "entry_point": "process_checkbox_state", "input": "[(0, 1), (1, 0), (2, 0)], (0, 1, 0)", "output": "[(0, 1), (1, 1), (2, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116095_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023967", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[8, 10]", "output": "164", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146424_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023968", "code": "from typing import Iterable\ndef decode_run_length(compressed: Iterable[int]) -> list:\n    decoded = []\n    for count, value in zip(compressed[::2], compressed[1::2]):\n        decoded.extend([value] * count)\n    return decoded\n", "entry_point": "decode_run_length", "input": "[5, 2, 2, 4]", "output": "[2, 2, 2, 2, 2, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023969", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[2, 2, 34, 34]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023970", "code": "TARGET_CENTER = 'gear_target_details--center'\nX, Y = 0, 1  # Coordinate indices\nDESIRED_X_POSITION = 0.4\nDESIRED_Y_POSITION = 0.3\nCENTERING_X_TOLERANCE = 0.02\nCENTERING_Y_TOLERANCE = 0.02\nSPEEDS = {\n    'x_mostly_y': 0.3,\n    'xy': 0.4,\n    'y_only': 0.3,\n    'y_min': 0.1,\n    'y_max': 0.3,\n    'x_only': 0.5,\n    'x_bounds': 0.1\n}\ndef calculate_optimal_speed(current_position):\n    x, y = current_position\n    x_distance = abs(x - DESIRED_X_POSITION)\n    y_distance = abs(y - DESIRED_Y_POSITION)\n    if x_distance <= CENTERING_X_TOLERANCE and y_distance <= CENTERING_Y_TOLERANCE:\n        return SPEEDS['xy']\n    elif x_distance <= CENTERING_X_TOLERANCE:\n        return SPEEDS['x_only']\n    elif y_distance <= CENTERING_Y_TOLERANCE:\n        return SPEEDS['y_only']\n    elif x_distance > y_distance:\n        return SPEEDS['x_mostly_y']\n    else:\n        return SPEEDS['y_max']\n", "entry_point": "calculate_optimal_speed", "input": "(0.4, 0.26)", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97173_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023971", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[2, 3, 0, 5, 6, 1, 4]", "output": "[2, 3, 0, 5, 6, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023972", "code": "def generate_odd_triangle(n):\n    triangle = []\n    start_odd = 1\n    for i in range(1, n + 1):\n        row = [start_odd + 2*j for j in range(i)]\n        triangle.append(row)\n        start_odd += 2*i\n    return triangle\n", "entry_point": "generate_odd_triangle", "input": "4", "output": "[[1], [3, 5], [7, 9, 11], [13, 15, 17, 19]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132299_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023973", "code": "def convert_escape_sequences(input_string):\n    output_string = ''\n    i = 0\n    while i < len(input_string):\n        if input_string[i:i+2] == '\\\\33':\n            output_string += chr(27)  # ASCII escape character (ESC)\n            i += 2\n        elif input_string[i:i+2] == '\\\\?':\n            output_string += '?'\n            i += 2\n        else:\n            output_string += input_string[i]\n            i += 1\n    return output_string\n", "entry_point": "convert_escape_sequences", "input": "'\\\\?225h'", "output": "'?225h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78537_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023974", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[2, 1, 1, 26, 26]", "output": "26.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023975", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023976", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{1, 2, 3, 4, 5, 7}, set()", "output": "{1, 2, 3, 4, 5, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023977", "code": "from time import time\ndef calculate_evaluation_time(start_time: float) -> tuple:\n    current_time = time()\n    total_time_seconds = current_time - start_time\n    total_time_minutes = total_time_seconds / 60\n    return round(total_time_seconds, 1), round(total_time_minutes, 1)\n", "entry_point": "calculate_evaluation_time", "input": "time() + 172776558.2", "output": "(-172776558.2, -2879609.3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9568_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023978", "code": "from typing import List\ndef count_scrolls(scroll_heights: List[int]) -> int:\n    scroll_count = 0\n    for i in range(1, len(scroll_heights)):\n        if scroll_heights[i] > scroll_heights[i - 1]:\n            scroll_count += 1\n    return scroll_count\n", "entry_point": "count_scrolls", "input": "[1, 2, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70066_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023979", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'456,89,13'", "output": "{456, 89, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023980", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'21.121.1'", "output": "(21, 121, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6577", "output": "{1, 6577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023982", "code": "def generate_code_snippets(operator_names):\n    unary_operator_codes = {\n        \"UAdd\": (\"PyNumber_Positive\", 1),\n        \"USub\": (\"PyNumber_Negative\", 1),\n        \"Invert\": (\"PyNumber_Invert\", 1),\n        \"Repr\": (\"PyObject_Repr\", 1),\n        \"Not\": (\"UNARY_NOT\", 0),\n    }\n    rich_comparison_codes = {\n        \"Lt\": \"LT\",\n        \"LtE\": \"LE\",\n        \"Eq\": \"EQ\",\n        \"NotEq\": \"NE\",\n        \"Gt\": \"GT\",\n        \"GtE\": \"GE\",\n    }\n    output_snippets = []\n    for operator_name in operator_names:\n        if operator_name in unary_operator_codes:\n            output_snippets.append(unary_operator_codes[operator_name][0])\n        elif operator_name in rich_comparison_codes:\n            output_snippets.append(rich_comparison_codes[operator_name])\n    return output_snippets\n", "entry_point": "generate_code_snippets", "input": "['Eq', 'Not', 'Not', 'Not']", "output": "['EQ', 'UNARY_NOT', 'UNARY_NOT', 'UNARY_NOT']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_547_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023983", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[90, 89, 88, 87, 88]", "output": "88.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023984", "code": "def custom_multiply(*args):\n    if len(args) == 2 and all(isinstance(arg, int) for arg in args):\n        return args[0] * args[1]\n    elif len(args) == 1 and isinstance(args[0], int):\n        return args[0] * args[0]\n    else:\n        return -1\n", "entry_point": "custom_multiply", "input": "3, 4", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73921_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023985", "code": "def calculate_word_frequency(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Split the text into individual words\n    words = text.split()\n    # Initialize a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation if needed\n        word = word.strip('.,')\n        # Update the word frequency dictionary\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'beautiful'", "output": "{'beautiful': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88926_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023986", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 2, 1, 4, 6, 7, 1, 3, 3]", "output": "[9, 4, 3, 8, 12, 21, 3, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023987", "code": "def translate_russian_to_english(message):\n    translations = {\n        '\u041f\u0440\u0438\u043d\u044f\u043b\u0438!': 'Accepted!',\n        '\u0421\u043f\u0430\u0441\u0438\u0431\u043e': 'Thank you',\n        '\u0437\u0430': 'for',\n        '\u0432\u0430\u0448\u0443': 'your',\n        '\u0437\u0430\u044f\u0432\u043a\u0443.': 'application.'\n    }\n    translated_message = []\n    words = message.split()\n    for word in words:\n        translated_word = translations.get(word, word)\n        translated_message.append(translated_word)\n    return ' '.join(translated_message)\n", "entry_point": "translate_russian_to_english", "input": "'\u041f\u0440\u0438\u043d\u044f\u043b\u0438!'", "output": "'Accepted!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111635_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023988", "code": "import os\nfrom pathlib import Path\nfrom typing import Tuple\ndef setup_env_path(file_path: str) -> Tuple[str, str]:\n    checkout_dir = Path(file_path).resolve().parent\n    parent_dir = checkout_dir.parent\n    if parent_dir != \"/\" and os.path.isdir(parent_dir / \"etc\"):\n        env_file = parent_dir / \"etc\" / \"env\"\n        default_var_root = parent_dir / \"var\"\n    else:\n        env_file = checkout_dir / \".env\"\n        default_var_root = checkout_dir / \"var\"\n    return str(env_file), str(default_var_root)\n", "entry_point": "setup_env_path", "input": "'/pa/path/some_file.txt'", "output": "('/pa/path/.env', '/pa/path/var')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10500_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023989", "code": "def build_unique_users(queryset, ctype_as_string):\n    users = []\n    if ctype_as_string == 'comment':\n        for comment in queryset:\n            if comment.get('user') not in users:\n                users.append(comment.get('user'))\n    if ctype_as_string == 'contact':\n        for c in queryset:\n            if c.get('user') and c.get('user') not in users:\n                users.append(c.get('user'))\n    if not users:\n        return f\"Error finding content type: {ctype_as_string}\"\n    return users\n", "entry_point": "build_unique_users", "input": "[], 'concoctacttact'", "output": "'Error finding content type: concoctacttact'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120280_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023990", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'WoRoL'", "output": "'WoRoL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023991", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 3, 2, 7, 1, 1, 2, 2]", "output": "[2, 4, 4, 10, 5, 6, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2298", "output": "{1, 2, 3, 6, 2298, 1149, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023993", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'text'", "output": "'text'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023994", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3157", "output": "{1, 451, 7, 41, 11, 77, 3157, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023995", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "43", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023996", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 1, 4, 3, 2, 2, 1, 1, 2]", "output": "[2, 5, 7, 5, 4, 3, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51354_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023997", "code": "def find_max_items_sector(sectors, maxsector):\n    max_items = 0\n    max_sector = 0\n    sector_items = [0] * maxsector\n    for sector in sectors:\n        sector_items[sector - 1] += 1\n        if sector_items[sector - 1] > max_items:\n            max_items = sector_items[sector - 1]\n            max_sector = sector\n        elif sector_items[sector - 1] == max_items and sector < max_sector:\n            max_sector = sector\n    return max_sector\n", "entry_point": "find_max_items_sector", "input": "[8, 8, 8, 2, 2, 3, 4], 10", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105593_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023998", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[4, 4, 0, 1, 0, 4, 1, 4, 3]", "output": "[4, 8, 8, 9, 9, 13, 14, 18, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0023999", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024000", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[5, 5, 0, 1, 4]", "output": "[5, 5, 0, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6627", "output": "{1, 2209, 3, 6627, 141, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024002", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'test.tih'", "output": "['test.tih']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77980_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024003", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[3, 4, 8, 3, 2, 3, 4, 3]", "output": "[2, 3, 3, 3, 3, 4, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125717_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024004", "code": "def cooking3(N, M, wig):\n    dp = [float('inf')] * (N + 1)\n    dp[0] = 0\n    for i in range(1, N + 1):\n        for w in wig:\n            if i - w >= 0:\n                dp[i] = min(dp[i], dp[i - w] + 1)\n    return dp[N] if dp[N] != float('inf') else -1\n", "entry_point": "cooking3", "input": "1, 0, []", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18807_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024005", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1243", "output": "{11, 1, 1243, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024006", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9992", "output": "{1, 2, 2498, 4996, 4, 1249, 9992, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9991", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024007", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[0, 0, 0], [67, 0, 0]", "output": "67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106940_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024008", "code": "from typing import List, Tuple, Optional\ndef parse_tokens(text: str) -> List[Tuple[str, Optional[str]]]:\n    tokens = []\n    current_token = ''\n    for char in text:\n        if char.isalnum() or char in '._':\n            current_token += char\n        else:\n            if current_token:\n                if current_token.replace('.', '', 1).isdigit():\n                    tokens.append(('FLOAT', current_token))\n                else:\n                    tokens.append(('IDENTIFIER', current_token))\n                current_token = ''\n            if char == '(':\n                tokens.append(('LPAREN', None))\n            elif char == ')':\n                tokens.append(('RPAREN', None))\n            elif char == ',':\n                tokens.append((',', None))\n    if current_token:\n        if current_token.replace('.', '', 1).isdigit():\n            tokens.append(('FLOAT', current_token))\n        else:\n            tokens.append(('IDENTIFIER', current_token))\n    return tokens\n", "entry_point": "parse_tokens", "input": "'r)'", "output": "[('IDENTIFIER', 'r'), ('RPAREN', None)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40570_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024009", "code": "def autoset_eigNum(eigValues, rate=0.99):\n    eigValues_sorted = sorted(eigValues, reverse=True)\n    eigVals_total = sum(eigValues)\n    eigVals_sum = 0\n    for i in range(1, len(eigValues_sorted) + 1):\n        eigVals_sum += eigValues_sorted[i - 1]\n        if eigVals_sum / eigVals_total >= rate:\n            break\n    return i\n", "entry_point": "autoset_eigNum", "input": "[100, 30, 10, 10, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43245_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024010", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "10.0, 0", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024011", "code": "def generate_new_revision_identifier(original_revision, password):\n    new_revision = original_revision.replace('<PASSWORD>', password)\n    return new_revision\n", "entry_point": "generate_new_revision_identifier", "input": "'88d8c05a<PASSWORD>', ''", "output": "'88d8c05a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148215_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024012", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "'ob\\n**bold'", "output": "'ob\\n**bold\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024013", "code": "def max_non_overlapping_circles(radii):\n    radii.sort()\n    count = 0\n    max_radius = float('-inf')\n    for radius in radii:\n        if radius >= max_radius:\n            count += 1\n            max_radius = radius * 2\n    return count\n", "entry_point": "max_non_overlapping_circles", "input": "[1, 2, 4, 8, 16, 32, 64]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114287_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024014", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kjakjakatt2'", "output": "'http://kjakjakatt2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024015", "code": "import heapq\ndef top_k_frequent_elements(nums, k):\n    freq_map = {}\n    for num in nums:\n        freq_map[num] = freq_map.get(num, 0) + 1\n    heap = [(-freq, num) for num, freq in freq_map.items()]\n    heapq.heapify(heap)\n    top_k = []\n    for _ in range(k):\n        top_k.append(heapq.heappop(heap)[1])\n    return sorted(top_k)\n", "entry_point": "top_k_frequent_elements", "input": "[-1, 1, 2, -1, 1, 2, -1], 3", "output": "[-1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76714_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024016", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "12", "output": "[1, 1, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024017", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'\\n111\\n'", "output": "[['111']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5515", "output": "{1, 5515, 5, 1103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024019", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[1, 6, 5, 2, 2, 2, 2]", "output": "[6, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024020", "code": "def find_missing_number(nums):\n    n = len(nums)\n    expected_sum = (n * (n + 1)) // 2\n    actual_sum = sum(nums)\n    if expected_sum != actual_sum:\n        return expected_sum - actual_sum\n    return -1\n", "entry_point": "find_missing_number", "input": "list(range(37))", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115210_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1079", "output": "{1, 83, 13, 1079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024022", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zzzj'", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024023", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'Brown.'", "output": "{'brown': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024024", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "8", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024025", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'-80+8'", "output": "-72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024026", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "5, 10, 7", "output": "(5, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024027", "code": "def filter_flags(flags):\n    filtered_flags = [flag for flag in flags if \"HLA\" not in flag]\n    return filtered_flags\n", "entry_point": "filter_flags", "input": "['USA', 'UK', 'France']", "output": "['USA', 'UK', 'France']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34061_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8994", "output": "{1, 8994, 3, 2, 6, 4497, 2998, 1499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1426", "output": "{1, 2, 713, 46, 1426, 23, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3358", "output": "{1, 2, 73, 46, 1679, 146, 23, 3358}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3357", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024031", "code": "def extract_package_versions(package_list):\n    package_versions = {}\n    for package_info in package_list:\n        package_name, version = package_info.split('==')\n        package_versions[package_name] = version\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "['numpy==1.181']", "output": "{'numpy': '1.181'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6080_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024032", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3753", "output": "{1, 417, 3, 1251, 3753, 9, 139, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024033", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'xtexdemotet'", "output": "{'xtexdemotet': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024034", "code": "def reverse_words_in_string(s: str) -> str:\n    result = \"\"\n    word = \"\"\n    for char in s:\n        if char != ' ':\n            word = char + word\n        else:\n            result += word + ' '\n            word = \"\"\n    result += word  # Append the last word without a space\n    return result\n", "entry_point": "reverse_words_in_string", "input": "'hello wow'", "output": "'olleh wow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88814_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024035", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    return words[0] + ''.join(word.capitalize() for word in words[1:])\n", "entry_point": "snake_to_camel", "input": "'hello_world'", "output": "'helloWorld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61108_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "86", "output": "{1, 2, 43, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt85", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024037", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3155", "output": "{1, 3155, 5, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024038", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[1, 1]", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt50", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024039", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3109", "output": "{1, 3109}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3108", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024040", "code": "def find_min_synaptic_conductance_time(synaptic_conductance_values):\n    min_value = synaptic_conductance_values[0]\n    min_time = 1\n    for i in range(1, len(synaptic_conductance_values)):\n        if synaptic_conductance_values[i] < min_value:\n            min_value = synaptic_conductance_values[i]\n            min_time = i + 1  # Time points start from 1\n    return min_time\n", "entry_point": "find_min_synaptic_conductance_time", "input": "[3, 4, 5, 6, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31704_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024041", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'rofo'", "output": "'rofo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024042", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 6, 9]", "output": "[6, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024043", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5709", "output": "{1, 33, 3, 519, 11, 5709, 173, 1903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5708", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1894", "output": "{1, 2, 947, 1894}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1893", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024045", "code": "# Constants\nPIXIVUTIL_NOT_OK = -1\nPIXIVUTIL_OK = 0\nPIXIVUTIL_SKIP_OLDER = 1\nPIXIVUTIL_SKIP_BLACKLIST = 2\nPIXIVUTIL_KEYBOARD_INTERRUPT = 3\nPIXIVUTIL_SKIP_DUPLICATE = 4\nPIXIVUTIL_SKIP_LOCAL_LARGER = 5\nPIXIVUTIL_CHECK_DOWNLOAD = 6\nPIXIVUTIL_ABORTED = 9999\n# Dictionary mapping status codes to messages\nstatus_messages = {\n    PIXIVUTIL_NOT_OK: \"Download not successful\",\n    PIXIVUTIL_OK: \"Download successful\",\n    PIXIVUTIL_SKIP_OLDER: \"Skipped due to being older\",\n    PIXIVUTIL_SKIP_BLACKLIST: \"Skipped due to blacklist\",\n    PIXIVUTIL_KEYBOARD_INTERRUPT: \"Download interrupted by keyboard\",\n    PIXIVUTIL_SKIP_DUPLICATE: \"Skipped as duplicate\",\n    PIXIVUTIL_SKIP_LOCAL_LARGER: \"Skipped as local file is larger\",\n    PIXIVUTIL_CHECK_DOWNLOAD: \"Checking download\",\n    PIXIVUTIL_ABORTED: \"Download aborted\"\n}\n# Function to get message based on status code\ndef get_status_message(status_code):\n    return status_messages.get(status_code, \"Unknown status code\")\n", "entry_point": "get_status_message", "input": "-1", "output": "'Download not successful'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6778_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024046", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 2, 3, 3]", "output": "(3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024047", "code": "def extract_metadata(script):\n    metadata = {}\n    for line in script.split('\\n'):\n        if line.strip().startswith('__') and '=' in line:\n            key, value = line.split('=')[0].strip()[2:-2], line.split('=')[1].strip().strip('\"')\n            metadata[key] = value\n    return metadata\n", "entry_point": "extract_metadata", "input": "'__au_t__ = \"\"'", "output": "{'au_t': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54996_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024048", "code": "def process_data(data: str) -> str:\n    if data == \"photo_prod\":\n        return \"take_photo_product\"\n    elif data == \"rept_photo\":\n        return \"repeat_photo\"\n    else:\n        return \"invalid_command\"\n", "entry_point": "process_data", "input": "'photo_prod'", "output": "'take_photo_product'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135393_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024049", "code": "def separate_euler_angles(euler_angles):\n    x_components = [euler[0] for euler in euler_angles]\n    y_components = [euler[1] for euler in euler_angles]\n    z_components = [euler[2] for euler in euler_angles]\n    return x_components, y_components, z_components\n", "entry_point": "separate_euler_angles", "input": "[]", "output": "([], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61480_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024050", "code": "def count_numbers_with_same_first_last_digit(nums_str):\n    count = 0\n    for num_str in nums_str:\n        if num_str[0] == num_str[-1]:\n            count += 1\n    return count\n", "entry_point": "count_numbers_with_same_first_last_digit", "input": "['123', '222', '444', '678', '555']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139447_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8630", "output": "{1, 2, 5, 10, 8630, 4315, 1726, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8629", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024052", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6899", "output": "{1, 6899}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024053", "code": "from typing import List, Dict\ndef parse_import_statements(import_statements: List[str]) -> Dict[str, List[str]]:\n    import_mapping = {}\n    for statement in import_statements:\n        if statement.startswith(\"from \"):\n            parts = statement.split(\" import \")\n            module = parts[0].split(\"from \")[1].split(\" import \")[0]\n            symbols = [symbol.strip() for symbol in parts[1].split(\",\")]\n            import_mapping[module] = symbols\n    return import_mapping\n", "entry_point": "parse_import_statements", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99409_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024054", "code": "def rotate_matrix_clockwise(matrix):\n    # Transpose the matrix\n    transposed_matrix = [[matrix[j][i] for j in range(len(matrix))] for i in range(len(matrix))]\n    # Reverse each row to get the rotated matrix\n    rotated_matrix = [row[::-1] for row in transposed_matrix]\n    return rotated_matrix\n", "entry_point": "rotate_matrix_clockwise", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[7, 4, 1], [8, 5, 2], [9, 6, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105985_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024055", "code": "def character_frequency(input_string):\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "character_frequency", "input": "'hhheeelllllo'", "output": "{'h': 3, 'e': 3, 'l': 5, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6005_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024056", "code": "from typing import List\ndef remove_duplicates_keep_order(input_list: List) -> List:\n    new_list = []\n    for num in input_list:\n        if num not in new_list:\n            new_list.append(num)\n    return new_list\n", "entry_point": "remove_duplicates_keep_order", "input": "[5, 5, 0, 0, 2, 2]", "output": "[5, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40700_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024057", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8562", "output": "{1, 2, 3, 2854, 6, 8562, 1427, 4281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024058", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "0, 2", "output": "'02:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024059", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'hello'", "output": "[('l', 2)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024060", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[1] * 172, 1", "output": "172", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024061", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[2, [1], [3, 3]]", "output": "[2, 1, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024062", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "117", "output": "{1, 3, 39, 9, 13, 117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024063", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "5, 9", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024064", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "2, 12", "output": "4096", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024065", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'temmta'", "output": "'temmta'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024066", "code": "def calculate_dot_product(A, B):\n    if len(A) != len(B):\n        raise ValueError(\"Arrays must be of the same length\")\n    dot_product = sum(a * b for a, b in zip(A, B))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[15, 5], [4, 12]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105699_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024067", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[1, 1, 2, 2, 3, 3, -6, 8]", "output": "[-6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024068", "code": "def calculate_score_frequency(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    return score_freq\n", "entry_point": "calculate_score_frequency", "input": "[101, 101, 101, 101, 99, 75, 75, 100]", "output": "{101: 4, 99: 1, 75: 2, 100: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116771_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024069", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[100, 95, 91, 45], 4", "output": "82.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52376_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024070", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'ipum', 4", "output": "'ipum'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024071", "code": "from typing import List\ndef single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "single_number", "input": "[1, 1, 2, 2, 3, 3, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118847_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024072", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[1, 2, 2, 3, 4, 5, 6, 7]", "output": "[1, 2, 2, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94997_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024073", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "7", "output": "[0, 1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024074", "code": "def update_scores(dictionary_of_scores, list_to_return):\n    for player_id, score in dictionary_of_scores.items():\n        if player_id not in list_to_return:\n            list_to_return.append(score)\n    return list_to_return\n", "entry_point": "update_scores", "input": "{'player1': 3, 'player2': 1, 'player3': 2, 'player4': 3}, []", "output": "[3, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106802_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024075", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[10, 20, 30, 40, 50]", "output": "[30, 50, 70, 90, 60]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024076", "code": "def process_help_section(path):\n    # Strip off the '/data/help/' part of the path\n    section = path.split('/', 3)[-1]\n    if section in ['install', 'overview', 'usage', 'examples', 'cloudhistory', 'changelog']:\n        return f\"Sending section: {section}\"\n    elif section.startswith('stage'):\n        stages_data = [{'name': stage_name, 'help': f\"Help for {stage_name}\"} for stage_name in ['stage1', 'stage2', 'stage3']]\n        return stages_data\n    else:\n        return f\"Could not find help section: {section}\"\n", "entry_point": "process_help_section", "input": "'some/irrelevant/segments/w'", "output": "'Could not find help section: w'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99964_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024077", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'abc'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024078", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 0, 2, 7, 3, 6, 7, 0, 7]", "output": "[7, 1, 4, 10, 7, 11, 13, 7, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024079", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6017", "output": "{1, 6017, 11, 547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024080", "code": "def find_starting_tokens(e):\n    starting_tokens = []\n    current_label = None\n    for i, label in enumerate(e):\n        if label != current_label:\n            starting_tokens.append(i)\n            current_label = label\n    return starting_tokens\n", "entry_point": "find_starting_tokens", "input": "['A', 'B', 'C', 'D', 'E', 'F', 'G', 'G', 'H']", "output": "[0, 1, 2, 3, 4, 5, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47145_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024081", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'1'", "output": "['1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024082", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "1234.56", "output": "'R$:1234,56'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024083", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9368", "output": "{1, 2, 4, 2342, 8, 4684, 1171, 9368}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9367", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024084", "code": "def find_min_path(triangle):\n    if not triangle:\n        return 0\n    for row in range(len(triangle) - 2, -1, -1):\n        for col in range(len(triangle[row])):\n            triangle[row][col] += min(triangle[row + 1][col], triangle[row + 1][col + 1])\n    return triangle[0][0]\n", "entry_point": "find_min_path", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139174_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024085", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1111001X'", "output": "['11110010', '11110011']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt66", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024086", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'07:02:05'", "output": "25325", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024087", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{-1: 6, 4: 2}", "output": "[-1, -1, -1, -1, -1, -1, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024088", "code": "def generate_animation_expression(target_variable_name: str, width: int) -> str:\n    return f'\\n  .width({target_variable_name});'\n", "entry_point": "generate_animation_expression", "input": "'test_animatiot', 0", "output": "'\\n  .width(test_animatiot);'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133695_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024089", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "1", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024090", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "444.44", "output": "'R$:444,44'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024091", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(6, 0, 1, 1)", "output": "'6.0.1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024092", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[10, 4, 11, 1, 1, 4, 5, 10]", "output": "[14, 15, 12, 2, 5, 9, 15, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137992_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024093", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    parts = default_app_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'servServefig.anything_here.servServefig'", "output": "('servServefig', 'servServefig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26380_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024094", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3333", "output": "{1, 33, 3, 3333, 101, 11, 303, 1111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024095", "code": "from collections import defaultdict\ndef count_error_codes(error_codes):\n    error_code_counts = defaultdict(int)\n    defined_error_codes = {\n        'OK', 'INVALID_ARGUMENT', 'NOT_FOUND', 'UNAUTHENTICATED'\n    }\n    for error_code in error_codes:\n        if error_code in defined_error_codes:\n            error_code_counts[error_code] += 1\n    return dict(error_code_counts)\n", "entry_point": "count_error_codes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130944_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024096", "code": "def get_business_rules(form_name, rules_dict):\n    if form_name in rules_dict:\n        return rules_dict[form_name]\n    else:\n        return \"Form not found\"\n", "entry_point": "get_business_rules", "input": "'unknown_form', {}", "output": "'Form not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72048_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024097", "code": "def jaro_distance(str1, str2):\n    if not str1 and not str2:\n        return 0.0\n    len_str1 = len(str1)\n    len_str2 = len(str2)\n    if len_str1 == 0 or len_str2 == 0:\n        return 0.0\n    max_dist = max(len_str1, len_str2) // 2 - 1\n    matches = 0\n    transpositions = 0\n    matched_indices = set()\n    for i in range(len_str1):\n        start = max(0, i - max_dist)\n        end = min(i + max_dist + 1, len_str2)\n        for j in range(start, end):\n            if str1[i] == str2[j] and j not in matched_indices:\n                matches += 1\n                matched_indices.add(j)\n                break\n    if matches == 0:\n        return 0.0\n    for i, j in zip(range(len_str1), range(len_str2)):\n        if str1[i] != str2[j]:\n            transpositions += 1\n    transpositions //= 2\n    return (matches / len_str1 + matches / len_str2 + (matches - transpositions) / matches) / 3\n", "entry_point": "jaro_distance", "input": "'DWAYNE', 'DUANE'", "output": "0.7388888888888889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22884_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024098", "code": "from typing import List\ndef count_unique_activations(activations: List[str]) -> int:\n    unique_activations = set()\n    for activation in activations:\n        unique_activations.add(activation)\n    return len(unique_activations)\n", "entry_point": "count_unique_activations", "input": "['apple', 'banana']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3690_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024099", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6395", "output": "{1, 6395, 5, 1279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6394", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7833", "output": "{1, 3, 7, 2611, 21, 373, 7833, 1119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024101", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9211", "output": "{1, 9211, 61, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024102", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "0.65, 1.0", "output": "0.65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024103", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "-2", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024104", "code": "def findFirstBadVersion(versions, bad_version):\n    start = 0\n    end = len(versions) - 1\n    while start < end:\n        mid = start + (end - start) // 2\n        if versions[mid] >= bad_version:\n            end = mid\n        else:\n            start = mid + 1\n    if versions[start] == bad_version:\n        return start\n    elif versions[end] == bad_version:\n        return end\n    else:\n        return -1\n", "entry_point": "findFirstBadVersion", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 8", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1351_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024105", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[11, 1]", "output": "122", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024106", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[4, -5, 4, 1, -4, 7, 1, 7]", "output": "[7, 1, 7, 4, 1, 4, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024107", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[1, 2, 3, 4, 5]", "output": "[1, 3, 6, 10, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024108", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[1, 2, 3, 4]", "output": "{1: 1, 2: 4, 3: 9, 4: 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024109", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[2, 3, 3, 5, 2, 3, 1, 3, 2]", "output": "[5, 8, 5, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024110", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[0, 1, 2, 3, 4, 6]", "output": "[0, 1, 2, 3, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024111", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "13, 4", "output": "'31'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024112", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'tmodels', 'ggru.hf5sdr'", "output": "'tmodels/ggru.hf5sdr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024113", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[40, 0, 39]", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4505", "output": "{1, 5, 901, 265, 17, 53, 85, 4505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024115", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[0, 3, 3, 2, 4, 1]", "output": "{0: 1, 3: 2, 2: 1, 4: 1, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024116", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-2, 11", "output": "-2048", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt74", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024117", "code": "def count_paths(n):\n    s = [[0] * 10 for _ in range(n + 1)]\n    s[1] = [0] + [1] * 9\n    mod = 1000 ** 3\n    for i in range(2, n + 1):\n        for j in range(0, 9 + 1):\n            if j >= 1:\n                s[i][j] += s[i - 1][j - 1]\n            if j <= 8:\n                s[i][j] += s[i - 1][j + 1]\n    return sum(s[n]) % mod\n", "entry_point": "count_paths", "input": "6", "output": "222", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21515_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024118", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024119", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "481", "output": "{1, 13, 37, 481}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024120", "code": "import re\ndef extract_unique_words(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Use regular expression to extract words excluding punctuation\n    words = re.findall(r'\\b\\w+\\b', text)\n    # Store unique words in a set\n    unique_words = set(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'Hello, Pynn!'", "output": "['pynn', 'hello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103279_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024121", "code": "import math\ndef find_max_ceiling_index(n, m, s):\n    mx = 0\n    ind = 0\n    for i in range(n):\n        if math.ceil(s[i] / m) >= mx:\n            mx = math.ceil(s[i] / m)\n            ind = i\n    return ind + 1\n", "entry_point": "find_max_ceiling_index", "input": "6, 3, [2, 4, 5, 8, 1, 10]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97191_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024122", "code": "import re\nfrom typing import Tuple, Optional\nIE_DESC = 'Redgifs user'\n_VALID_URL = r'https?://(?:www\\.)?redgifs\\.com/users/(?P<username>[^/?#]+)(?:\\?(?P<query>[^#]+))?'\n_PAGE_SIZE = 30\ndef process_redgifs_url(url: str) -> Tuple[str, Optional[str], int]:\n    match = re.match(_VALID_URL, url)\n    if match:\n        username = match.group('username')\n        query = match.group('query')\n        return username, query, _PAGE_SIZE\n    return '', None, _PAGE_SIZE\n", "entry_point": "process_redgifs_url", "input": "'https://www.redgifs.com/users/johdoe?tag=fun'", "output": "('johdoe', 'tag=fun', 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56955_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024123", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "9", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024124", "code": "def migrate_database(migration_scripts, current_version):\n    def dfs(version):\n        if version not in visited:\n            visited.add(version)\n            for dependency in migration_scripts.get(version, []):\n                dfs(dependency)\n            order.append(version)\n    visited = set()\n    order = []\n    dfs(current_version)\n    return order[::-1]\n", "entry_point": "migrate_database", "input": "{2: []}, 2", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37332_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024125", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[5, 4, 4, 5, 5]", "output": "[125, 16, 16, 125, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024126", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "8", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024127", "code": "def parse(data):\n    key_start = data.find(':') + 2  # Find the start index of the key\n    key_end = data.find('=', key_start)  # Find the end index of the key\n    key = data[key_start:key_end].strip()  # Extract and strip the key\n    value_start = data.find('\"', key_end) + 1  # Find the start index of the value\n    value_end = data.rfind('\"')  # Find the end index of the value\n    value = data[value_start:value_end]  # Extract the value\n    # Unescape the escaped characters in the value\n    value = value.replace('\\\\\"', '\"').replace('\\\\\\\\', '\\\\')\n    return {key: [value]}  # Return the key-value pair as a dictionary\n", "entry_point": "parse", "input": "'some other text: ododo}o = \"\"'", "output": "{'ododo}o': ['']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85764_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024128", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "3, [6, 0, 0, 0, 6, 0, 0, 0, 6]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024129", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "[0, 9, 4]", "output": "'0.9.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "299", "output": "{1, 299, 13, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2074", "output": "{1, 2, 34, 122, 1037, 17, 2074, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024132", "code": "def sum_of_primes  (lst):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in lst:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_963_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024133", "code": "def convert_to_integers(strings):\n    result = []\n    for s in strings:\n        if s.isdigit():\n            result.append(int(s))\n        elif '.' in s:\n            result.append(float(s))\n        else:\n            result.append(sum(ord(c) for c in s))\n    return result\n", "entry_point": "convert_to_integers", "input": "['a', 'bbb', 'bbb', 'bbb', 'bbb']", "output": "[97, 294, 294, 294, 294]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25808_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024134", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tttasks=addtasksask'", "output": "{'field': 'tttasks', 'value': 'addtasksask'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024135", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[1, 6, 2, 7, 2, 2, 2, 2, 1]", "output": "[1, 46, 4, 343, 4, 4, 4, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024136", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "'URL:'", "output": "{'URL': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024137", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8207", "output": "{1, 283, 29, 8207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024138", "code": "def find_swap_indices(A):\n    tmp_min = idx_min = float('inf')\n    tmp_max = idx_max = -float('inf')\n    for i, elem in enumerate(reversed(A)):\n        tmp_min = min(elem, tmp_min)\n        if elem > tmp_min:\n            idx_min = i\n    for i, elem in enumerate(A):\n        tmp_max = max(elem, tmp_max)\n        if elem < tmp_max:\n            idx_max = i\n    idx_min = len(A) - 1 - idx_min\n    return [-1] if idx_max == idx_min else [idx_min, idx_max]\n", "entry_point": "find_swap_indices", "input": "[3, 2, 5, 4]", "output": "[0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96522_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024139", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'iissample'", "output": "'Iissample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024140", "code": "def broadcast_message(user_ids, message):\n    successful_deliveries = 0\n    for user_id in user_ids:\n        try:\n            # Simulating message delivery by printing the user ID\n            print(f\"Message delivered to user ID: {user_id}\")\n            successful_deliveries += 1\n        except Exception as e:\n            # Handle any exceptions that may occur during message delivery\n            print(f\"Failed to deliver message to user ID: {user_id}. Error: {e}\")\n    return successful_deliveries\n", "entry_point": "broadcast_message", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 'Sample Message'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16498_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2831", "output": "{1, 19, 149, 2831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024142", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1673", "output": "{1, 1673, 239, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024143", "code": "from typing import Tuple\ndef parse_default_app_config(default_app_config: str) -> Tuple[str, str]:\n    # Split the input string at the '.' character\n    app_name, config_class = default_app_config.split('.')[:2]\n    # Return a tuple containing the app name and configuration class name\n    return app_name, config_class\n", "entry_point": "parse_default_app_config", "input": "'gunmel.app'", "output": "('gunmel', 'app')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77517_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024144", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "10.0, 8, 1", "output": "15.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024145", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'orientation'", "output": "'Value of orientation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024146", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'A', 'A********'", "output": "0.1111111111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024147", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[10]", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024148", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[100, 90]", "output": "-10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024149", "code": "from typing import List\ndef rotate_image(image: List[List[int]]) -> List[List[int]]:\n    n = len(image)\n    # Transpose the matrix\n    for i in range(n):\n        for j in range(i+1, n):\n            image[i][j], image[j][i] = image[j][i], image[i][j]\n    # Reverse each row\n    for i in range(n):\n        image[i] = image[i][::-1]\n    return image\n", "entry_point": "rotate_image", "input": "[[1, 2], [3, 4]]", "output": "[[3, 1], [4, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43613_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024150", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[3, 1, 1, 24.0, 24.0, 24.0]", "output": "24.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024151", "code": "import binascii\nimport string\ndef single_byte_xor_decrypt(hex_str):\n    bytes_data = binascii.unhexlify(hex_str)\n    max_score = 0\n    decrypted_message = \"\"\n    for key in range(256):\n        decrypted = ''.join([chr(byte ^ key) for byte in bytes_data])\n        score = sum([decrypted.count(char) for char in string.ascii_letters])\n        if score > max_score:\n            max_score = score\n            decrypted_message = decrypted\n    return decrypted_message\n", "entry_point": "single_byte_xor_decrypt", "input": "'7a3d59'", "output": "'z=Y'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68268_ipt18", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024152", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[4, 4, 4, 1, 2, 3]", "output": "(4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024153", "code": "def filter_weight_dict(weight_dict, model_dict):\n    pretrained_dict = dict()\n    for k, v in weight_dict.items():\n        if \"conv\" in k and \"backbone\" not in k:\n            k = \"backbone.\" + k\n        if k in model_dict:\n            pretrained_dict[k] = v\n    model_dict.update(pretrained_dict)\n    return model_dict\n", "entry_point": "filter_weight_dict", "input": "{}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36659_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024154", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "255, 165, 0", "output": "'#FFA500'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024155", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'wolowHel'", "output": "{'wolowHel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024156", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[1, 8, 7, 7, 10, 3, 4, 97, 5], 10, 8", "output": "[1, 10, 7, 7, 10, 3, 4, 10, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024157", "code": "def process_help_section(path):\n    # Strip off the '/data/help/' part of the path\n    section = path.split('/', 3)[-1]\n    if section in ['install', 'overview', 'usage', 'examples', 'cloudhistory', 'changelog']:\n        return f\"Sending section: {section}\"\n    elif section.startswith('stage'):\n        stages_data = [{'name': stage_name, 'help': f\"Help for {stage_name}\"} for stage_name in ['stage1', 'stage2', 'stage3']]\n        return stages_data\n    else:\n        return f\"Could not find help section: {section}\"\n", "entry_point": "process_help_section", "input": "'/data/help/unknown'", "output": "'Could not find help section: unknown'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99964_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024158", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(10, 5), fan='fan_avg'", "output": "7.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024159", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7339", "output": "{1, 7339, 179, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024160", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3629", "output": "{1, 19, 3629, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024161", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "'This is a test string AFAB.FEDA to match the pattern.'", "output": "[('AFAB', 'FEDA')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024162", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[10, 9, 8, 7, 7, 7, 1]", "output": "[1, 7, 7, 7, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024163", "code": "def reverse_words(input_string):\n    # Split the input string into individual words\n    words = input_string.split()\n    # Reverse each word in the list of words\n    reversed_words = [word[::-1] for word in words]\n    # Join the reversed words back together into a single string\n    reversed_string = ' '.join(reversed_words)\n    return reversed_string\n", "entry_point": "reverse_words", "input": "'world'", "output": "'dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149182_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024164", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'bb.b.bb.'", "output": "'bb.b.bb.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024165", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3470", "output": "{1, 2, 5, 1735, 10, 3470, 694, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3469", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024166", "code": "from typing import List, Dict\ndef check_module_availability(module_names: List[str]) -> Dict[str, bool]:\n    availability_status = {}\n    for module_name in module_names:\n        try:\n            exec(f\"import {module_name}\")\n            availability_status[module_name] = True\n        except ImportError:\n            availability_status[module_name] = False\n    return availability_status\n", "entry_point": "check_module_availability", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134295_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024167", "code": "def find_indices(nums, target):\n    num_indices = {}\n    for index, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], index]\n        num_indices[num] = index\n    return []\n", "entry_point": "find_indices", "input": "[0, 1, 2, 3], 5", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23894_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024168", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    total = sum(scores)\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[75, 78, 80]", "output": "77.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45427_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "959", "output": "{1, 137, 7, 959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024170", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'si'", "output": "'Si'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024171", "code": "def transform_list(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(sum([x for j, x in enumerate(lst) if j != i]))\n    return result\n", "entry_point": "transform_list", "input": "[4, 1, 3, 3]", "output": "[7, 10, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88599_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2", "output": "{1, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024173", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1637", "output": "{1, 1637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024174", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9791", "output": "{1, 9791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024175", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7053", "output": "{1, 3, 7053, 2351}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3733", "output": "{1, 3733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024177", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'worHlddd'", "output": "{'worHlddd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024178", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5381", "output": "{1, 5381}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024179", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-5, 1", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt53", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024180", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1291", "output": "{1, 1291}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1290", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024181", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6286", "output": "{1, 2, 898, 449, 7, 3143, 6286, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024182", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3681", "output": "{1, 3681, 3, 9, 1227, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024183", "code": "def modify_list(input_list):\n    if len(input_list) > 7:\n        del input_list[4]  # Remove element at index 4\n        input_list[7] *= 2  # Double the value at index 7\n    return input_list\n", "entry_point": "modify_list", "input": "[8, 6, 0, 0, 1, 7, 7, 0, 0]", "output": "[8, 6, 0, 0, 7, 7, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59128_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9663", "output": "{1, 3, 3221, 9663}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9662", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024185", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "8", "output": "2.8284271247", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024186", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'XRBBUS'", "output": "('XRBBUS', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024187", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "16", "output": "136", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024188", "code": "from collections import Counter\nimport string\ndef find_top_words(text, n):\n    # Tokenize the text into words\n    words = text.lower().translate(str.maketrans('', '', string.punctuation)).split()\n    # Define common English stopwords\n    stop_words = set([\"i\", \"me\", \"my\", \"myself\", \"we\", \"our\", \"ours\", \"ourselves\", \"you\", \"your\", \"yours\", \"yourself\", \"yourselves\", \"he\", \"him\", \"his\", \"himself\", \"she\", \"her\", \"hers\", \"herself\", \"it\", \"its\", \"itself\", \"they\", \"them\", \"their\", \"theirs\", \"themselves\", \"what\", \"which\", \"who\", \"whom\", \"this\", \"that\", \"these\", \"those\", \"am\", \"is\", \"are\", \"was\", \"were\", \"be\", \"been\", \"being\", \"have\", \"has\", \"had\", \"having\", \"do\", \"does\", \"did\", \"doing\", \"a\", \"an\", \"the\", \"and\", \"but\", \"if\", \"or\", \"because\", \"as\", \"until\", \"while\", \"of\", \"at\", \"by\", \"for\", \"with\", \"about\", \"against\", \"between\", \"into\", \"through\", \"during\", \"before\", \"after\", \"above\", \"below\", \"to\", \"from\", \"up\", \"down\", \"in\", \"out\", \"on\", \"off\", \"over\", \"under\", \"again\", \"further\", \"then\", \"once\", \"here\", \"there\", \"when\", \"where\", \"why\", \"how\", \"all\", \"any\", \"both\", \"each\", \"few\", \"more\", \"most\", \"other\", \"some\", \"such\", \"no\", \"nor\", \"not\", \"only\", \"own\", \"same\", \"so\", \"than\", \"too\", \"very\", \"s\", \"t\", \"can\", \"will\", \"just\", \"don\", \"should\", \"now\"])\n    # Remove stopwords from the tokenized words\n    filtered_words = [word for word in words if word not in stop_words]\n    # Count the frequency of each word\n    word_freq = Counter(filtered_words)\n    # Sort the words based on their frequencies\n    sorted_words = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)\n    # Output the top N most frequent words along with their frequencies\n    top_words = sorted_words[:n]\n    return top_words\n", "entry_point": "find_top_words", "input": "'shocommonuld', 1", "output": "[('shocommonuld', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52632_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024189", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6517", "output": "{1, 931, 133, 7, 49, 19, 6517, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6516", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8937", "output": "{1, 993, 3, 2979, 8937, 9, 331, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5298", "output": "{1, 2, 3, 1766, 6, 5298, 883, 2649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024192", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4807", "output": "{1, 4807, 11, 209, 19, 437, 23, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4231", "output": "{1, 4231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024194", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7653", "output": "{1, 3, 7653, 2551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024195", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[2, 2, 2, 2, 1, 1, 1, 3, 3]", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024196", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6925", "output": "{1, 5, 1385, 6925, 277, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6924", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024197", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'hold'", "output": "'ol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024198", "code": "def calculate_forward_differences(input_list):\n    solution = input_list.copy()\n    fwd = [input_list[i+1] - input_list[i] for i in range(len(input_list)-1)]\n    return solution, fwd\n", "entry_point": "calculate_forward_differences", "input": "[5, 9, 14, 20, 27]", "output": "([5, 9, 14, 20, 27], [4, 5, 6, 7])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137495_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024199", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'10 5 25429642'", "output": "'25429642 5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024200", "code": "def generate_timestamps(frequency, duration):\n    timestamps = []\n    for sec in range(0, duration+1, frequency):\n        hours = sec // 3600\n        minutes = (sec % 3600) // 60\n        seconds = sec % 60\n        timestamp = f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n        timestamps.append(timestamp)\n    return timestamps\n", "entry_point": "generate_timestamps", "input": "12, 24", "output": "['00:00:00', '00:00:12', '00:00:24']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12595_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024201", "code": "def generate_training_script(dirs, train_script):\n    result = {}\n    for d in dirs:\n        result[d] = train_script.strip()\n    return result\n", "entry_point": "generate_training_script", "input": "['diir2'], '   traer.r.   '", "output": "{'diir2': 'traer.r.'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10476_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024202", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "989", "output": "{1, 43, 989, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt988", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024203", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'app.config.wwatig'", "output": "'wwatig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024204", "code": "def exclude_region(regions_list, new_region):\n    return [region for region in regions_list if region != new_region]\n", "entry_point": "exclude_region", "input": "['TWN', 'KOR', 'JPN'], 'JPN'", "output": "['TWN', 'KOR']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87825_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024205", "code": "from typing import List\ndef max_average_score(scores: List[int]) -> float:\n    max_avg = float('-inf')\n    window_sum = 0\n    window_size = 0\n    for score in scores:\n        window_sum += score\n        window_size += 1\n        if window_sum / window_size > max_avg:\n            max_avg = window_sum / window_size\n        if window_sum < 0:\n            window_sum = 0\n            window_size = 0\n    return max_avg\n", "entry_point": "max_average_score", "input": "[3, 4]", "output": "3.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6333_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024206", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8725", "output": "{1, 5, 1745, 8725, 25, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8724", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024207", "code": "def group_imports(imports):\n    import_groups = {}\n    for imp in imports:\n        level = imp.count('.')\n        module = imp.split(' ')[-1]\n        module = module.split('.')[-1] if '.' in module else module\n        if level in import_groups:\n            import_groups[level].append(module)\n        else:\n            import_groups[level] = [module]\n    return import_groups\n", "entry_point": "group_imports", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83524_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024208", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'22..0.0', 'forms.FormlCo'", "output": "\"[22..0.0]: 'forms.FormlCo'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024209", "code": "from typing import List\ndef sum_divisible_by_two_and_three(numbers: List[int]) -> int:\n    divisible_sum = 0\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            divisible_sum += num\n    return divisible_sum\n", "entry_point": "sum_divisible_by_two_and_three", "input": "[6, 12, 24]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125267_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1511", "output": "{1, 1511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024211", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'HeHell,Hello,ll,'", "output": "b'HeHell,Hello,ll,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024212", "code": "import re\n# Regular expression pattern\npattern = r'^gfs\\.t(?P<hour>\\d{2})z\\.pgrb2\\.1p00\\.f(?P<fhour>\\d{3})\\.(?P<runDTG>\\d{8})$'\n# JSON schema\nschema = {\n    \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"hour\": { \"type\": \"string\" },\n        \"fhour\": { \"type\": \"string\" },\n        \"runDTG\": { \"type\": \"string\" }\n    }\n}\ndef validate_filename(filename):\n    match = re.match(pattern, filename)\n    if not match:\n        return False\n    extracted_data = match.groupdict()\n    for key in extracted_data:\n        if key not in schema['properties'] or not isinstance(extracted_data[key], str):\n            return False\n    return True\n", "entry_point": "validate_filename", "input": "'gfs.t12z.pgrb2.1p00.f123.20210930'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60431_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024213", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5097", "output": "{1699, 1, 3, 5097}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5096", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024214", "code": "import os\nINSTALL_REQUIRES = [\n    'toolz>=0.9.0',\n]\nEXTRAS_REQUIRE = {\n    'bintrees': ['bintrees>=0.2.7'],\n    'cytoolz': ['cytoolz>=0.9.0'],\n    'docker': ['docker>=3.7.0'],\n    'sortedcontainers': ['sortedcontainers>=2.1.0'],\n}\ndef consolidate_package_dependencies(extras_require):\n    unique_packages = set()\n    for dependencies in extras_require.values():\n        unique_packages.update(set(dep.split('>=')[0] for dep in dependencies))\n    unique_packages.difference_update(set(dep.split('>=')[0] for dep in INSTALL_REQUIRES))\n    return sorted(list(unique_packages))\n", "entry_point": "consolidate_package_dependencies", "input": "{'some_key': ['toolz>=0.9.0']}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13393_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2162", "output": "{1, 2, 46, 47, 2162, 23, 1081, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2161", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024216", "code": "def first_repeating(n, arr):\n    seen = set()\n    for i in range(n):\n        if arr[i] in seen:\n            return arr[i]\n        seen.add(arr[i])\n    return -1\n", "entry_point": "first_repeating", "input": "6, [1, 2, 3, 5, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49861_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024217", "code": "def twoNumberSum(arr, n):\n    seen = set()\n    for num in arr:\n        diff = n - num\n        if diff in seen:\n            return [diff, num]\n        seen.add(num)\n    return []\n", "entry_point": "twoNumberSum", "input": "[11, -1], 10", "output": "[11, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7709_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024218", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4209", "output": "{1, 3, 69, 4209, 23, 183, 1403, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024219", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024220", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[95, 92, 90, 94, 76], 4", "output": "92.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024221", "code": "def simulate_card_game(deck_a, deck_b):\n    score_a = 0\n    score_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    return (score_a, score_b)\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5, 6, 7, 8], [2, 3, 4, 5, 6, 7, 8, 9]", "output": "(0, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1507_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024222", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', -5, -8", "output": "(-4, -8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024223", "code": "from typing import List\ndef calculate_score(deck: List[int]) -> int:\n    score = 0\n    prev_card = None\n    for card in deck:\n        if card == prev_card:\n            score = 0\n        else:\n            score += card\n        prev_card = card\n    return score\n", "entry_point": "calculate_score", "input": "[10, 20, 15, 12]", "output": "57", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107329_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024224", "code": "def filter_neutral(dataset):\n    filtered_dataset = [example for example in dataset if example['label'] != 'neutral']\n    return filtered_dataset\n", "entry_point": "filter_neutral", "input": "[{'label': 'neutral'}, {'label': 'neutral'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38079_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024225", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1324", "output": "{1, 2, 4, 331, 1324, 662}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1323", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024226", "code": "def filter_contacts_by_category(contacts, category_name):\n    filtered_contacts = []\n    for contact in contacts:\n        if contact['categoria'] == category_name and contact['show']:\n            filtered_contact = {\n                'name': contact['name'],\n                'last_name': contact['last_name'],\n                'phone': contact['phone']\n            }\n            filtered_contacts.append(filtered_contact)\n    return filtered_contacts\n", "entry_point": "filter_contacts_by_category", "input": "[], 'friend'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1202_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024227", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "1.5, 3.0, 2.25", "output": "7.875", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024228", "code": "def calculate_f1_score(precision, recall):\n    if precision == 0 or recall == 0:\n        return 0\n    f1_score = 2 * (precision * recall) / (precision + recall)\n    return f1_score\n", "entry_point": "calculate_f1_score", "input": "0, 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45834_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024229", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "1, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024230", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3573", "output": "{1, 3, 1191, 9, 397, 3573}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024231", "code": "def process_integers(integer_list):\n    total = 0\n    for num in integer_list:\n        if num > 0:\n            total += num ** 2\n        elif num < 0:\n            total -= abs(num) / 2\n    return total\n", "entry_point": "process_integers", "input": "[5, 3, -6]", "output": "31.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92247_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024232", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'s'", "output": "'s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024233", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "20, 10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024234", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "499", "output": "{1, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1681", "output": "{1, 1681, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024236", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6629", "output": "{1, 947, 6629, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024237", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[10, 15, 13]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024238", "code": "def sum_multiples_3_5(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 18, 21, 25]", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6779_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024239", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'Heo'", "output": "'Heo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024240", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "44, 10", "output": "'44'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024241", "code": "def sum_of_squares_of_evens(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_evens", "input": "[2, 2, 2, 4, 0]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96449_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024242", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'tasks=addttsks'", "output": "{'field': 'tasks', 'value': 'addttsks'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024243", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[108, 101, 108, 108, 101]", "output": "'lelle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024244", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[80, 79], 2", "output": "79.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74521_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024245", "code": "def filter_books(books, threshold):\n    filtered_books = []\n    for book in books:\n        if book.get(\"rating\", 0) >= threshold:\n            filtered_books.append(book)\n    return filtered_books\n", "entry_point": "filter_books", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111332_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024246", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[5, 6, 6, 7, 8, 8]", "output": "[5, 6, 6, 7, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt39", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024247", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8543", "output": "{1, 8543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7889", "output": "{1, 161, 1127, 7, 7889, 49, 23, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024249", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2551", "output": "{1, 2551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024250", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'110s'", "output": "110", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024251", "code": "def parse_version(version_str):\n    version_components = version_str.split('.')\n    major = int(version_components[0])\n    minor = int(version_components[1])\n    patch = int(version_components[2])\n    tag = version_components[3] if len(version_components) > 3 else None\n    return major, minor, patch, tag\n", "entry_point": "parse_version", "input": "'1.0.0'", "output": "(1, 0, 0, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144472_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024252", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 7, 3, 4, 8, 4, 8, 7, 5]", "output": "[2, 8, 5, 7, 12, 9, 14, 14, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024253", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'red'", "output": "'green'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024254", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abababcab123def@!gha'", "output": "['abababcab', 'def', 'gha']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024255", "code": "from typing import List\ndef total_size_in_kb(file_sizes: List[int]) -> int:\n    total_size = sum(file_sizes)\n    return total_size // 1024\n", "entry_point": "total_size_in_kb", "input": "[1024, 1024, 1024, 1024]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13519_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024256", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-593, -593, -593], 3", "output": "-593.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111793_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "150", "output": "{1, 2, 3, 5, 6, 10, 75, 15, 50, 150, 25, 30}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt149", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024258", "code": "import math\ndef calculate_distance_traveled(rotations_right, rotations_left, wheel_radius):\n    distance_right = wheel_radius * 2 * math.pi * rotations_right\n    distance_left = wheel_radius * 2 * math.pi * rotations_left\n    total_distance = (distance_right + distance_left) / 2\n    return total_distance\n", "entry_point": "calculate_distance_traveled", "input": "4, 5, 10", "output": "282.7433388230814", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15765_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2273", "output": "{1, 2273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024260", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[80, 78, 77, 75, 75, 76]", "output": "[80, 78, 77]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024261", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[5, 7, 4], 16", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6861", "output": "{1, 3, 6861, 2287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024263", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[5]", "output": "[10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024264", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'CharlieDoe'", "output": "[('CharlieDoe', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024265", "code": "def generate_url_path(app_name, view_name, *args):\n    url_mapping = {\n        'index': '',\n        'get_by_title': 'title/',\n        'get_filtered_films': 'filter/',\n        'vote_for_film': 'vote/',\n        'insert_film': 'insert/',\n        '_enum_ids': 'enum/',\n        '_get_by_id': 'id/'\n    }\n    if view_name in url_mapping:\n        url_path = f'/{app_name}/{url_mapping[view_name]}'\n        if args:\n            url_path += '/'.join(str(arg) for arg in args)\n        return url_path\n    else:\n        return 'Invalid view name'\n", "entry_point": "generate_url_path", "input": "'service_app', 'index'", "output": "'/service_app/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124830_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024266", "code": "def compile_source_code(lines):\n    # Filter out empty lines and strip leading/trailing whitespace\n    processed_lines = [line.strip() for line in lines if line.strip()]\n    # Join the processed lines with newline character\n    compiled_output = '\\n'.join(processed_lines)\n    return compiled_output\n", "entry_point": "compile_source_code", "input": "['', '   ', '\\t', '\\n']", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99804_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024267", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "-3", "output": "'https://www.kaiheila.cn/api/v-3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024268", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'<div>&lt;</div>'", "output": "'<'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024269", "code": "def shape(A):\n    num_rows = len(A)\n    num_cols = len(A[0]) if A else 0\n    return num_rows, num_cols\n", "entry_point": "shape", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]", "output": "(4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82705_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024270", "code": "def get_parent_directory(file_path):\n    parent_dir = ''\n    for char in file_path[::-1]:\n        if char in ('/', '\\\\'):\n            break\n        parent_dir = char + parent_dir\n    return parent_dir\n", "entry_point": "get_parent_directory", "input": "'/home/user/dadtm'", "output": "'dadtm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48400_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024271", "code": "def rotate_array(arr, s):\n    n = len(arr)\n    s = s % n\n    for _ in range(s):\n        store = arr[n-1]\n        for i in range(n-2, -1, -1):\n            arr[i+1] = arr[i]\n        arr[0] = store\n    return arr\n", "entry_point": "rotate_array", "input": "[11, 1, 2, 3, 4], 1", "output": "[4, 11, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58826_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024272", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{applba,}'", "output": "['applba', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024273", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'ttathataot'", "output": "'ttathataot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024274", "code": "def search_target(nums, target):\n    def find_pivot(nums):\n        start, end = 0, len(nums) - 1\n        while start < end:\n            mid = (start + end) // 2\n            if nums[mid] > nums[end]:\n                start = mid + 1\n            else:\n                end = mid\n        return start\n    def binary_search(start, end):\n        while start <= end:\n            mid = (start + end) // 2\n            if nums[mid] == target:\n                return mid\n            elif nums[mid] < target:\n                start = mid + 1\n            else:\n                end = mid - 1\n        return -1\n    pivot = find_pivot(nums)\n    if nums[pivot] <= target <= nums[-1]:\n        return binary_search(pivot, len(nums) - 1)\n    else:\n        return binary_search(0, pivot - 1)\n", "entry_point": "search_target", "input": "[5, 6, 7, 1, 2, 3, 4], 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44702_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024275", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return 0\n    max1 = max2 = max3 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[10, 8, 5]", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4670_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024276", "code": "def extract_major_version(version_string):\n    # Split the version string using the dot as the delimiter\n    version_parts = version_string.split('.')\n    # Extract the major version number (first element after splitting)\n    major_version = int(version_parts[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'3733.5.2'", "output": "3733", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48327_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8354", "output": "{4177, 1, 8354, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024278", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[1, 2, 3, 3, 3], 3", "output": "[1, 2, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024279", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    if not input_list:  # Base case: empty list\n        return 0\n    else:\n        return input_list.pop() + custom_sum(input_list)\n", "entry_point": "custom_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145591_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024280", "code": "def process_genetic_data(line):\n    def int_no_zero(s):\n        return int(s.lstrip('0')) if s.lstrip('0') else 0\n    indiv_name, marker_line = line.split(',')\n    markers = marker_line.replace('\\t', ' ').split(' ')\n    markers = [marker for marker in markers if marker != '']\n    if len(markers[0]) in [2, 4]:  # 2 digits per allele\n        marker_len = 2\n    else:\n        marker_len = 3\n    try:\n        allele_list = [(int_no_zero(marker[0:marker_len]), int_no_zero(marker[marker_len:]))\n                       for marker in markers]\n    except ValueError:  # Haploid\n        allele_list = [(int_no_zero(marker[0:marker_len]),)\n                       for marker in markers]\n    return indiv_name, allele_list, marker_len\n", "entry_point": "process_genetic_data", "input": "'Doe, 1200'", "output": "('Doe', [(12, 0)], 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138215_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024281", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'characterex', '1.1..201..0.2.0'", "output": "'1.1..201..0.2.0characterex'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024282", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "7", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024283", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) <= 2:\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 4)\n", "entry_point": "calculate_average", "input": "[70, 80, 80, 75, 90]", "output": "78.3333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19408_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024284", "code": "from typing import List, Dict\ndef sub_lists(lines: List[str], subdict: Dict[str, str]) -> List[str]:\n    newlines = []\n    for line in lines:\n        for tag, value in subdict.items():\n            line = line.replace(tag, value)\n        newlines.append(line)\n    return newlines\n", "entry_point": "sub_lists", "input": "[], {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024285", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] > scores[i - 1]:\n            dp[i] = scores[i] + dp[i - 1]\n        else:\n            dp[i] = scores[i]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[9, 10]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40146_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024286", "code": "def conditional_element_selection(condition, x, y):\n    result = []\n    for i in range(len(condition)):\n        result.append(x[i] if condition[i] else y[i])\n    return result\n", "entry_point": "conditional_element_selection", "input": "[True, False, True], [10, 100, 30], [1, 2, 3]", "output": "[10, 2, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96824_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024287", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[100, 80, 75, 75, 70, 70, 60, 55, 50], 8", "output": "73.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024288", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[90, 85, 85, 80, 70, 70]", "output": "[1, 2, 2, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024289", "code": "def generate_file_paths(GYP_FILE, FILE_GROUPS):\n    file_paths = {}\n    for file_group in FILE_GROUPS:\n        file_path = f\"{GYP_FILE.split('.')[0]}_{file_group}.html\"\n        file_paths[file_group] = [file_path]\n    return file_paths\n", "entry_point": "generate_file_paths", "input": "'sample_file.gyp', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130597_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024290", "code": "ERROR_MSG = \"\"\"\nCommand %s not recognised. \nValid commands are --help (-h) and --run (-r).\n\"\"\"\nFILE_NOT_FOUND_MSG = \"\"\"\nFile %s not found.\n\"\"\"\nFILE_NOT_PROVIDED_MSG = \"\"\"\nFile not provided. Usage: python tndm [command] [file]\n\"\"\"\ndef handle_error_message(command, file_name):\n    if command not in ['--help', '-h', '--run', '-r']:\n        return ERROR_MSG % command\n    elif not file_name:\n        return FILE_NOT_PROVIDED_MSG\n    else:\n        # Check if the file exists (simulated check)\n        if file_name not in ['file1.txt', 'file2.txt', 'file3.txt']:\n            return FILE_NOT_FOUND_MSG % file_name\n        else:\n            return None  # No error message\n", "entry_point": "handle_error_message", "input": "'--run', 'missing_file.txt'", "output": "'\\nFile missing_file.txt not found.\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84798_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024291", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[9, 0, 7, 8]", "output": "[9, 1, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "64", "output": "{64, 1, 2, 32, 4, 8, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt63", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024293", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo Ssy llo'", "output": "'Ssy llo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024294", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'woorldhlo'", "output": "{'woorldhlo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024295", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[70, 50, 42, 42, 10], 5", "output": "[70, 50, 42, 42, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024296", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6285", "output": "{1, 3, 419, 5, 1257, 6285, 2095, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6284", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024297", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[1, 0, 2, 0, 3]", "output": "[1, 0, 2, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024298", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3802", "output": "{1, 3802, 2, 1901}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024299", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'sssda', '1111'", "output": "'sssda1111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024300", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'<p>Hello</p>'", "output": "'Hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024301", "code": "def generate_struct(data, state):\n    struct = []\n    for i in range(len(data)):\n        for j in range(len(data)):\n            if data[i][j] > 0:\n                struct.append([state[i], state[j], {'label': data[i][j]}])\n    return struct\n", "entry_point": "generate_struct", "input": "[[5, 0], [0, 0]], ['Z', 'X']", "output": "[['Z', 'Z', {'label': 5}]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12465_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4922", "output": "{1, 2, 107, 46, 214, 23, 4922, 2461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4921", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024303", "code": "from typing import List, Tuple\ndef longest_contiguous_subarray_above_threshold(temperatures: List[int], threshold: float) -> Tuple[int, int]:\n    start = 0\n    end = 0\n    max_length = 0\n    current_sum = 0\n    max_start = 0\n    while end < len(temperatures):\n        current_sum += temperatures[end]\n        while start <= end and current_sum / (end - start + 1) <= threshold:\n            current_sum -= temperatures[start]\n            start += 1\n        if end - start + 1 > max_length:\n            max_length = end - start + 1\n            max_start = start\n        end += 1\n    return max_start, max_start + max_length - 1\n", "entry_point": "longest_contiguous_subarray_above_threshold", "input": "[4, 1, 2], 3", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18174_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024304", "code": "def character_frequency(input_string):\n    frequency_dict = {}\n    for char in input_string:\n        if char in frequency_dict:\n            frequency_dict[char] += 1\n        else:\n            frequency_dict[char] = 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "'hhheeelll'", "output": "{'h': 3, 'e': 3, 'l': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130080_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024305", "code": "def remove_chucks(hebrew_word):\n    \"\"\" Hebrew numbering systems use 'chuck-chucks' (quotation\n        marks that aren't being used to signify a quotation) \n        in between letters that are meant as numerics rather \n        than words. This function removes the 'chuck-chucks' \n        from the input Hebrew word.\n        Args:\n        hebrew_word (str): A Hebrew word with 'chuck-chucks'.\n        Returns:\n        str: The Hebrew word with 'chuck-chucks' removed.\n    \"\"\"\n    chucks = ['\u05f4', '\u05f3', '\"', \"'\"]\n    for chuck in chucks:\n        while chuck in hebrew_word:\n            hebrew_word = hebrew_word.replace(chuck, '')\n    return hebrew_word\n", "entry_point": "remove_chucks", "input": "'\u05f3\u05e9\u05f3\u05e9\u05f3\u05e9\u05f3\u05dd\u05f3'", "output": "'\u05e9\u05e9\u05e9\u05dd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31435_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024306", "code": "import string\ndef count_word_occurrences(text):\n    def clean_word(word):\n        return word.strip(string.punctuation).lower()\n    word_counts = {}\n    words = text.split()\n    for word in words:\n        cleaned_word = clean_word(word)\n        if cleaned_word:\n            word_counts[cleaned_word] = word_counts.get(cleaned_word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'wordld'", "output": "{'wordld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4386_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024307", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[(i + 1) % len(lst)])\n    return result\n", "entry_point": "process_list", "input": "[4, 1, 4, 3, 6, 4, 4, 1, 2]", "output": "[5, 5, 7, 9, 10, 8, 5, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36867_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024308", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[4, 4, 3, 5, 5, 5, 9, 11]", "output": "[8, 8, 9, 25, 25, 25, 81, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8847", "output": "{1, 3, 2949, 9, 8847, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024310", "code": "from typing import List\ndef simulate_game(grid: List[List[int]], instructions: str) -> int:\n    rows, cols = len(grid), len(grid[0])\n    row, col = 0, 0\n    for move in instructions:\n        if move == 'U' and row > 0:\n            row -= 1\n        elif move == 'D' and row < rows - 1:\n            row += 1\n        elif move == 'L' and col > 0:\n            col -= 1\n        elif move == 'R' and col < cols - 1:\n            col += 1\n    return grid[row][col]\n", "entry_point": "simulate_game", "input": "[[1, 2], [3, 4]], 'DR'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32528_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9058", "output": "{1, 9058, 2, 7, 647, 1294, 14, 4529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9057", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024312", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[2, 4, 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43663_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024313", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[7, 11, 11]", "output": "847", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5851_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024314", "code": "def convert_numbers(data):\n    converters = {\n        \"Number1\": lambda x: float(x.replace(\",\", \".\")),\n        \"Number2\": lambda x: float(x.replace(\",\", \".\")),\n        \"Number3\": lambda x: float(x.replace(\",\", \".\")),\n    }\n    converted_data = []\n    for row in data:\n        converted_row = {}\n        for key, value in row.items():\n            if key in converters:\n                try:\n                    converted_row[key] = converters[key](value)\n                except ValueError:\n                    converted_row[key] = value\n            else:\n                converted_row[key] = value\n        converted_data.append(converted_row)\n    return converted_data\n", "entry_point": "convert_numbers", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71966_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024315", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3985", "output": "{1, 3985, 797, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024316", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[2, 1, 3, 2, 1]", "output": "[2, 3, 6, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024317", "code": "def flatten_list(list_of_lists):\n    return [element for sublist in list_of_lists for element in sublist]\n", "entry_point": "flatten_list", "input": "[[1], [3, 3], [6]]", "output": "[1, 3, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23909_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024318", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[0, 1, 1, 2, 4, 5, 6, 6, -1, -1]", "output": "[0, 1, 2, 4, 5, 6, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024319", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    adjusted_sum = sum(scores) - min_score\n    num_scores = len(scores) - 1  # Exclude the minimum score\n    average_score = adjusted_sum / num_scores\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 88.25]", "output": "87.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97621_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024320", "code": "import platform\ndef humansize_bytes(nbytes):\n    fmt = '{0:>6} {1}'\n    if not isinstance(nbytes, int):\n        return 'ERROR'\n    if nbytes == 0:\n        return fmt.format(0, 'B')\n    i, suffixes = 0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB']\n    while nbytes >= 1024 and i < len(suffixes) - 1:\n        nbytes /= 1024.\n        i += 1\n    f = ('%.2f' % nbytes).rstrip('0').rstrip('.')\n    return fmt.format(f, suffixes[i])\n", "entry_point": "humansize_bytes", "input": "1024", "output": "'     1 KB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40176_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024321", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[10, 5, 4, 9]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024322", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 29, 28, 12, 34, 3, 34]", "output": "[1, 11, 100, 27, 2401, 243, 117649]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024323", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5542", "output": "{1, 2, 34, 163, 5542, 326, 17, 2771}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5541", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024324", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "53, ['20', 'x', '30', '59']", "output": "354", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024325", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'<KEY>', 'AIzaAA1B'", "output": "'AIzaAA1B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4174", "output": "{1, 2, 4174, 2087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4173", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024327", "code": "def extract_message(data):\n    if isinstance(data, dict) and \"message\" in data:\n        return data[\"message\"]\n    elif isinstance(data, str) and \"message=\" in data:\n        message = data.split(\"message=\")[1]\n        return message\n    else:\n        return \"Hello World!\"\n", "entry_point": "extract_message", "input": "{'message': 'Howdy'}", "output": "'Howdy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82781_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024328", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5246", "output": "{1, 2, 43, 86, 122, 61, 5246, 2623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5245", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024329", "code": "def process_tag(tag):\n    prep_token = ''\n    if tag.startswith('3sm', 2):\n        prep_token += 'e'\n    if tag.startswith('3sf', 2):\n        prep_token += 'i'\n    if tag.startswith('3p', 2):\n        prep_token += 'iad'\n    if tag.startswith('1s', 2):\n        prep_token += 'mi'\n    if tag.startswith('2s', 2):\n        prep_token += 'thu'\n    if tag.startswith('2p', 2):\n        prep_token += 'sibh'\n    if tag.startswith('1p', 2):\n        prep_token += 'sinn'\n    return prep_token\n", "entry_point": "process_tag", "input": "'ab2p'", "output": "'sibh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131185_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024330", "code": "def count_users_with_one_post(post_counts):\n    user_post_count = {}\n    for count in post_counts:\n        if count in user_post_count:\n            user_post_count[count] += 1\n        else:\n            user_post_count[count] = 1\n    return user_post_count.get(1, 0)\n", "entry_point": "count_users_with_one_post", "input": "[0, 2, 3, 4]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16257_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024331", "code": "def is_numeric(txt):\n    '''Confirms that the text is numeric'''\n    out = len(txt)\n    allowed_chars = set('0123456789-$%+.')  # Define the set of allowed characters\n    allowed_last_chars = set('1234567890%')  # Define the set of allowed last characters\n    for c in txt:\n        if c not in allowed_chars:\n            out = False\n            break\n    if out and txt[-1] not in allowed_last_chars:\n        out = False\n    return out\n", "entry_point": "is_numeric", "input": "'123456789'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94372_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024332", "code": "def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        val = arr[i]\n        j = i - 1\n        while j >= 0 and val < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = val\n    return arr\n", "entry_point": "insertion_sort", "input": "[5, 2, 0, 6, 5, 0, 8]", "output": "[0, 0, 2, 5, 5, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146060_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024333", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "7.85, 1.0", "output": "7.85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1195", "output": "{1, 1195, 5, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1194", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024335", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[1, 8, 9, 2, 7, 7, 2, 7]", "output": "[1, 9, 11, 5, 11, 12, 8, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024336", "code": "def decode_secret_message(encoded_message, shift):\n    decoded_message = \"\"\n    for char in encoded_message:\n        if char.isalpha():\n            if char.islower():\n                decoded_message += chr(((ord(char) - ord('a') - shift) % 26) + ord('a'))\n            else:\n                decoded_message += chr(((ord(char) - ord('A') - shift) % 26) + ord('A'))\n        else:\n            decoded_message += char\n    return decoded_message\n", "entry_point": "decode_secret_message", "input": "'nGknk', 1", "output": "'mFjmj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69063_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024337", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 8]", "output": "(8, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024338", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'img_ge.pn'", "output": "'ge.pn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024339", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[101, 93, 85, 80, 70]", "output": "[101, 93, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024340", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4601", "output": "{107, 1, 43, 4601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024341", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7184", "output": "{1, 2, 898, 4, 1796, 449, 3592, 8, 7184, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7183", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "363", "output": "{1, 33, 3, 363, 11, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt362", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024343", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "1", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024344", "code": "def extract_ends(nums):\n    if len(nums) < 2:\n        return [nums[0], nums[0]]\n    else:\n        return [nums[0], nums[-1]]\n", "entry_point": "extract_ends", "input": "[4]", "output": "[4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149286_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024345", "code": "def process_elements(elements):\n    unique_identifiers = {}\n    for identifier, char_repr, description in elements:\n        if identifier not in unique_identifiers:\n            unique_identifiers[identifier] = description\n    return unique_identifiers\n", "entry_point": "process_elements", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55338_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024346", "code": "def calculate_voltages(adc_readings: dict, vref: float) -> dict:\n    voltages = {}\n    for channel, adc_reading in adc_readings.items():\n        if channel < 7:\n            voltage = vref * 4.57 * adc_reading\n        else:\n            voltage = vref * adc_reading\n        voltages[channel] = voltage\n    return voltages\n", "entry_point": "calculate_voltages", "input": "{511: 1}, 617.3439999999999", "output": "{511: 617.3439999999999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15055_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024347", "code": "def process_line(line):\n    start_br = line.find('[')\n    end_br = line.find(']')\n    conf_delim = line.find('::')\n    verb1 = line[:start_br].strip()\n    rel = line[start_br + 1: end_br].strip()\n    verb2 = line[end_br + 1: conf_delim].strip()\n    conf = line[conf_delim + 2:].strip()  # Skip the '::' delimiter\n    return verb1, rel, verb2, conf\n", "entry_point": "process_line", "input": "'et [et] et :: th'", "output": "('et', 'et', 'et', 'th')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60093_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024348", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5673", "output": "{1, 3, 1891, 5673, 93, 183, 61, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024349", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[80, 70, 65, 46], 4", "output": "65.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52376_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024350", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "set(), set()", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024351", "code": "def count_non_whitespace_chars(s: str) -> int:\n    count = 0\n    for c in s:\n        if not c.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'a b c'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72891_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024352", "code": "def extract_verbose_setting(config_dict):\n    try:\n        verbose_str = config_dict.get(\"core\", {}).get(\"verbose\")\n        if verbose_str and verbose_str.lower() in [\"true\", \"false\"]:\n            return verbose_str.lower() == \"true\"\n    except KeyError:\n        pass\n    return False\n", "entry_point": "extract_verbose_setting", "input": "{}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40819_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024353", "code": "def get_updated_value(filter_condition):\n    metadata = {}\n    if isinstance(filter_condition, str):\n        metadata[filter_condition] = 'default_value'\n    elif isinstance(filter_condition, list):\n        for condition in filter_condition:\n            metadata[condition] = 'default_value'\n    return metadata\n", "entry_point": "get_updated_value", "input": "'filterfilier1r3'", "output": "{'filterfilier1r3': 'default_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97050_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024354", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[91, 88, 87, 85, 82, 79]", "output": "[91, 88, 87]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024355", "code": "def average_working_hours(census):\n    senior_citizens = [person for person in census if person[0] > 60]  # Filter senior citizens based on age\n    if not senior_citizens:\n        return 0  # Return 0 if there are no senior citizens in the dataset\n    working_hours_sum = sum(person[3] for person in senior_citizens)  # Calculate total working hours of senior citizens\n    senior_citizens_len = len(senior_citizens)  # Get the number of senior citizens\n    avg_working_hours = working_hours_sum / senior_citizens_len  # Compute average working hours\n    return avg_working_hours\n", "entry_point": "average_working_hours", "input": "[(60, 'John Doe', 'Engineer', 40), (55, 'Jane Smith', 'Teacher', 30)]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123665_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024356", "code": "def generate_default_dict(keys, default_value):\n    result_dict = {}\n    for key in keys:\n        result_dict[key] = default_value\n    return result_dict\n", "entry_point": "generate_default_dict", "input": "['b', 'ba', 'ab', 'a'], -2", "output": "{'b': -2, 'ba': -2, 'ab': -2, 'a': -2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91901_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024357", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "3", "output": "['1', '2', '3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024358", "code": "def interpret_program(program):\n    stack = []\n    for instruction in program:\n        if instruction.startswith(\"PUSH\"):\n            num = int(instruction.split()[1])\n            stack.append(num)\n        elif instruction == \"ADD\":\n            if len(stack) < 2:\n                return -1\n            stack.append(stack.pop() + stack.pop())\n        elif instruction == \"SUB\":\n            if len(stack) < 2:\n                return -1\n            b = stack.pop()\n            a = stack.pop()\n            stack.append(a - b)\n        elif instruction == \"MUL\":\n            if len(stack) < 2:\n                return -1\n            stack.append(stack.pop() * stack.pop())\n        elif instruction == \"DIV\":\n            if len(stack) < 2 or stack[-1] == 0:\n                return -1\n            b = stack.pop()\n            a = stack.pop()\n            stack.append(a // b)\n        else:\n            return -1\n    return stack if len(stack) == 1 else -1\n", "entry_point": "interpret_program", "input": "['PUSH 5', 'PUSH 2', 'INVALID']", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57155_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024359", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'@@@HHH!! ##2lHl**!!'", "output": "'HHH 2lHl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024360", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 0, 1, 4, 3]", "output": "[3, 1, 5, 7, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024361", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[1, 3, 1, 3]", "output": "[1, 2, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024362", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[1, 0, 2, 2, 1, 1, 0, 1] + [0] * 18", "output": "'accddefh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024363", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level1': 408}", "output": "408", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024364", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1354", "output": "{1, 1354, 2, 677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024365", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "2.5, 2.5", "output": "('0', '4')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024366", "code": "def time_to_seconds(text):\n    time_units = text.split(\":\")\n    hours = int(time_units[0])\n    minutes = int(time_units[1])\n    seconds = int(time_units[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'2:30:45'", "output": "9045", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11606_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024367", "code": "from typing import List\ndef process_image(pixels: List[int]) -> List[int]:\n    result = []\n    for pixel in pixels:\n        result.append(pixel * 2)\n    return result\n", "entry_point": "process_image", "input": "[100, 50, 200, 75]", "output": "[200, 100, 400, 150]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142011_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024368", "code": "def union_sets(set1, set2):\n    union_set = set1 | set2\n    return union_set\n", "entry_point": "union_sets", "input": "{0, 1, 2}, {4, 7}", "output": "{0, 1, 2, 4, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41892_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024369", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'my_modmmy_modd_m', 'foo'", "output": "'Error: Module my_modmmy_modd_m not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024370", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'foo_bar'", "output": "'foo.bar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024371", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[9, 5, 11, 2, 8, 7, 5, 8, 8]", "output": "[9, 6, 13, 5, 12, 12, 11, 15, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024372", "code": "def permuteUnique(nums):\n    def generate_permutations(curr_permutation, remaining_nums, result):\n        if not remaining_nums:\n            result.append(curr_permutation[:])\n            return\n        for i, num in enumerate(remaining_nums):\n            if i > 0 and remaining_nums[i] == remaining_nums[i - 1]:\n                continue\n            generate_permutations(curr_permutation + [num], remaining_nums[:i] + remaining_nums[i + 1:], result)\n    nums.sort()\n    result = []\n    generate_permutations([], nums, result)\n    return result\n", "entry_point": "permuteUnique", "input": "[1, 1, 2]", "output": "[[1, 1, 2], [1, 2, 1], [2, 1, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78091_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024373", "code": "def find_floor_crossing_index(parentheses):\n    floor = 0\n    for i, char in enumerate(parentheses, start=1):\n        if char == '(':\n            floor += 1\n        elif char == ')':\n            floor -= 1\n        else:\n            raise ValueError(\"Invalid character in input string\")\n        if floor == -1:\n            return i\n    return -1  # If floor never reaches -1\n", "entry_point": "find_floor_crossing_index", "input": "'((('", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17635_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024374", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/products'", "output": "'/products'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "541", "output": "{1, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024376", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[0, 0, -1, 1, 2, 5, 3, 3]", "output": "[-1, 1, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2109", "output": "{1, 3, 37, 111, 19, 57, 2109, 703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2108", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024378", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 1, 2, 1, 2, 2, 2]", "output": "[1, 2, 4, 3, 3, 5, 5, 6, 6, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9661", "output": "{1, 9661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024380", "code": "from datetime import datetime, timedelta\ndef generate_dates(start_date, num_days):\n    dates_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days + 1):\n        dates_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return dates_list\n", "entry_point": "generate_dates", "input": "'2023-10-01', -1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127239_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024381", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "15.48038359999998, 10", "output": "105.48038359999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024382", "code": "from collections import defaultdict\ndef find_shortest_subarray(arr):\n    freq = defaultdict(list)\n    for i, num in enumerate(arr):\n        freq[num].append(i)\n    max_freq = max(len(indices) for indices in freq.values())\n    shortest_length = float('inf')\n    for indices in freq.values():\n        if len(indices) == max_freq:\n            shortest_length = min(shortest_length, indices[-1] - indices[0] + 1)\n    return shortest_length\n", "entry_point": "find_shortest_subarray", "input": "[1, 2, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30490_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024383", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[93, 91, 88, 85, 80]", "output": "[93, 91, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024384", "code": "def sort_trades(trades):\n    # Define a custom key function to extract the timestamp for sorting\n    def get_timestamp(trade):\n        return trade[0]\n    # Sort the trades based on timestamps in descending order\n    sorted_trades = sorted(trades, key=get_timestamp, reverse=True)\n    return sorted_trades\n", "entry_point": "sort_trades", "input": "[(7, 7), (7,), (7, 8), (5, 5), (5,)]", "output": "[(7, 7), (7,), (7, 8), (5, 5), (5,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41963_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6817", "output": "{1, 401, 6817, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024386", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'2.11.9'", "output": "(2, 11, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024387", "code": "import re\nTRAILING_WS_IN_CONTINUATION = re.compile(r'\\\\ \\s+\\n')\ndef remove_trailing_whitespace(input_string: str) -> str:\n    return TRAILING_WS_IN_CONTINUATION.sub(r'\\\\n', input_string)\n", "entry_point": "remove_trailing_whitespace", "input": "'abc\\\\ \\n123'", "output": "'abc\\\\ \\n123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71646_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024388", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38745_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024389", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6161", "output": "{1, 101, 61, 6161}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024390", "code": "def longest_positive_sequence(lst):\n    max_length = 0\n    current_length = 0\n    for num in lst:\n        if num > 0:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    max_length = max(max_length, current_length)  # Check the last sequence\n    return max_length\n", "entry_point": "longest_positive_sequence", "input": "[1, 2, -1]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95331_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024391", "code": "def generate_full_file_name(suffix, extension):\n    return f\"{suffix}.{extension}\"\n", "entry_point": "generate_full_file_name", "input": "'PaerrsPe', 'hpphppph'", "output": "'PaerrsPe.hpphppph'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104828_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024392", "code": "def select_items(items, weights, max_weight):\n    assert isinstance(items, list)\n    assert isinstance(weights, list)\n    assert all(isinstance(i, int) for i in weights)\n    assert len(items) == len(weights)\n    assert len(items) > 0\n    already_taken = [0 for _ in items]\n    item_count = len(items)\n    max_weight = max(weights)\n    selected_indices = []\n    total_weight = 0\n    sorted_items = sorted(enumerate(zip(items, weights)), key=lambda x: x[1][1], reverse=True)\n    for index, (item, weight) in sorted_items:\n        if total_weight + weight <= max_weight:\n            total_weight += weight\n            already_taken[index] = 1\n            selected_indices.append(index)\n    return selected_indices\n", "entry_point": "select_items", "input": "['item0', 'item1', 'item2', 'item3'], [1, 1, 1, 3], 3", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7682_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024393", "code": "def extract_major_version(version):\n    first_dot_index = version.index('.')\n    major_version = int(version[:first_dot_index])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'1311.0'", "output": "1311", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40723_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024394", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[1, 1, 1, 3, 3, 3]", "output": "[(1, 3), (3, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024395", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "1, {1: True, 2: False, 3: False}", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024396", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        if height > prev_height:\n            total_area += height\n        else:\n            total_area += prev_height\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[5, 5, 5, 10]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147834_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "171", "output": "{1, 3, 9, 171, 19, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024398", "code": "def calculate_final_positions(starting_positions):\n    final_positions = []\n    num_objects = len(starting_positions)\n    for i in range(num_objects):\n        final_position = (starting_positions[i] + i) % num_objects\n        final_positions.append(final_position)\n    return final_positions\n", "entry_point": "calculate_final_positions", "input": "[2, 1, 2, 1, 1, 4, 1, 1]", "output": "[2, 2, 4, 4, 5, 1, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123191_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024399", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'3,4])matplotlib.pyplot'", "output": "'3,4])matplotlib.pyplot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024400", "code": "def calculate_even_sum(nums):\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[2, 4, 6, 10]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58921_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024401", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'BBBBBBBB'", "output": "'tonga.cashregister.event.BBBBBBBBCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024402", "code": "def dummy(n):\n    fibonacci_numbers = [0, 1]\n    while len(fibonacci_numbers) < n:\n        next_number = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        fibonacci_numbers.append(next_number)\n    return fibonacci_numbers[:n]\n", "entry_point": "dummy", "input": "9", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134685_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024403", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[2, 3, 3, 3, 2, 5, 3]", "output": "[5, 6, 6, 5, 7, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024404", "code": "def execute_opcodes(opcodes):\n    stack = []\n    pc = 0  # Program counter\n    while pc < len(opcodes):\n        opcode = opcodes[pc]\n        if opcode.startswith('PUSH'):\n            num = int(opcode[4:])\n            stack.append(num)\n        elif opcode.startswith('JMP'):\n            offset = int(opcode.split('_')[1])\n            pc += offset\n            continue\n        elif opcode.startswith('JMPIF'):\n            offset = int(opcode.split('_')[1])\n            if stack.pop():\n                pc += offset\n                continue\n        elif opcode == 'JMPEQ':\n            offset = int(opcode.split('_')[1])\n            if stack.pop() == stack.pop():\n                pc += offset\n                continue\n        pc += 1\n    return stack\n", "entry_point": "execute_opcodes", "input": "['PUSH 10', 'PUSH 11', 'PUSH 13']", "output": "[10, 11, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72950_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024405", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6002", "output": "{3001, 1, 6002, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6001", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024406", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'3.9.9'", "output": "'4.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024407", "code": "def process_flags(flag_list):\n    flags_dict = {}\n    for flag in flag_list:\n        flag_name, flag_value = flag.lstrip(\"-\").split(\"=\")\n        flags_dict[flag_name] = flag_value\n    return flags_dict\n", "entry_point": "process_flags", "input": "['--leing_raet=0.01']", "output": "{'leing_raet': '0.01'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83523_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024408", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'ipim'", "output": "{'ipim': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024409", "code": "def reverse_string(input_string):\n    return input_string[::-1]\n", "entry_point": "reverse_string", "input": "'newslnttee'", "output": "'eettnlswen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18735_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1126", "output": "{1, 2, 563, 1126}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024411", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[119]", "output": "119", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024412", "code": "def parse_arguments(argument_strings):\n    parsed_args = {}\n    for arg_str in argument_strings:\n        if '=' in arg_str:\n            arg_name, arg_value = arg_str.split('=')\n            arg_name = arg_name.lstrip('-')\n        else:\n            arg_name = arg_str.lstrip('-')\n            arg_value = None\n        parsed_args[arg_name] = arg_value\n    return parsed_args\n", "entry_point": "parse_arguments", "input": "['']", "output": "{'': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14002_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4936", "output": "{1, 2, 2468, 4, 4936, 8, 617, 1234}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4935", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024414", "code": "def shift_token(token):\n    shift_value = len(token)\n    shifted_token = \"\"\n    for char in token:\n        shifted_char = chr(((ord(char) - ord('a') + shift_value) % 26) + ord('a'))\n        shifted_token += shifted_char\n    return shifted_token\n", "entry_point": "shift_token", "input": "'acab'", "output": "'egef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47692_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024415", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'111000X'", "output": "['1110000', '1110001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt43", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024416", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'my_module'", "output": "'my_module'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9668", "output": "{1, 2, 4834, 9668, 4, 2417}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9667", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024418", "code": "import math\nMAX_BRIGHT = 2.0\ndef rgb1(v):\n    r = 1 + math.cos(v * math.pi)\n    g = 0\n    b = 1 + math.sin(v * math.pi)\n    # Scale the RGB components based on the maximum brightness\n    r_scaled = int(MAX_BRIGHT * r)\n    g_scaled = int(MAX_BRIGHT * g)\n    b_scaled = int(MAX_BRIGHT * b)\n    return (r_scaled, g_scaled, b_scaled)\n", "entry_point": "rgb1", "input": "0.25", "output": "(3, 0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70015_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1528", "output": "{1, 2, 4, 8, 1528, 764, 382, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1527", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024420", "code": "from collections import deque\ndef min_minutes_to_rot_all_oranges(grid):\n    if not grid or len(grid) == 0:\n        return 0\n    n = len(grid)\n    m = len(grid[0])\n    rotten = deque()\n    fresh_count = 0\n    minutes = 0\n    for i in range(n):\n        for j in range(m):\n            if grid[i][j] == 2:\n                rotten.append((i, j))\n            elif grid[i][j] == 1:\n                fresh_count += 1\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n    while rotten:\n        if fresh_count == 0:\n            return minutes\n        size = len(rotten)\n        for _ in range(size):\n            x, y = rotten.popleft()\n            for dx, dy in directions:\n                nx, ny = x + dx, y + dy\n                if 0 <= nx < n and 0 <= ny < m and grid[nx][ny] == 1:\n                    grid[nx][ny] = 2\n                    fresh_count -= 1\n                    rotten.append((nx, ny))\n        minutes += 1\n    return -1\n", "entry_point": "min_minutes_to_rot_all_oranges", "input": "[[0, 0, 0], [0, 1, 0], [0, 0, 0]]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1036_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024421", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "-2", "output": "'-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024422", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6887", "output": "{1, 97, 71, 6887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024423", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'1.0.5'", "output": "'1.0.5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024424", "code": "def process_data(filter_logs, sequential_data):\n    # Process filter logs\n    filtered_logs = [line for line in filter_logs.split('\\n') if 'ERROR' not in line]\n    # Check for sequence in sequential data\n    sequence_exists = False\n    sequential_lines = sequential_data.split('\\n')\n    for i in range(len(sequential_lines) - 2):\n        if sequential_lines[i] == 'a start point' and sequential_lines[i + 1] == 'leads to' and sequential_lines[i + 2] == 'an ending':\n            sequence_exists = True\n            break\n    return (filtered_logs, sequence_exists)\n", "entry_point": "process_data", "input": "'blah', 'something else'", "output": "(['blah'], False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27152_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024425", "code": "def largest_rectangle_area(height):\n    stack = []\n    max_area = 0\n    height.append(0)  # Append a zero height bar to handle the case when all bars are in increasing order\n    for i in range(len(height)):\n        while stack and height[i] < height[stack[-1]]:\n            h = height[stack.pop()]\n            w = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, h * w)\n        stack.append(i)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[6, 6, 6, 2]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95511_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7666", "output": "{1, 7666, 2, 3833}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7665", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024427", "code": "def tomorrow(_):\n    return {i: i**2 for i in range(1, _+1)}\n", "entry_point": "tomorrow", "input": "5", "output": "{1: 1, 2: 4, 3: 9, 4: 16, 5: 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74523_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024428", "code": "from types import SimpleNamespace\nkeyboards = SimpleNamespace(\n    main={'ask_question': 'ASK_QUESTION', 'settings': 'SETTINGS'},\n    ask_question={'cancel': 'MAIN', 'send_question': 'MAIN'}\n)\nstates = SimpleNamespace(\n    main='MAIN',\n    ask_question='ASK_QUESTION'\n)\ndef transition_state(current_state, keyboard_action):\n    if current_state in keyboards.__dict__ and keyboard_action in keyboards.__dict__[current_state]:\n        return keyboards.__dict__[current_state][keyboard_action]\n    return current_state\n", "entry_point": "transition_state", "input": "'ask_question', 'send_question'", "output": "'MAIN'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10848_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024429", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2445", "output": "{1, 3, 163, 5, 489, 2445, 815, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2444", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024430", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[0, 1, 2, 4, 5]", "output": "{0, 1, 2, 4, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024431", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[4, 1, 3, 5, 2, 2, 2], 2", "output": "[4, 1, 3, 5, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024432", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "'12ab'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9467", "output": "{1, 9467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024434", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[10, [5, 5]]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024435", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "3, 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024436", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'01.01.2000'", "output": "'01.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024437", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'abcdefghijk', 'mnoqrstuvwyz'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024438", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(1, 0, 4, 5, 4, 3)", "output": "'1.0.4.5.4.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024439", "code": "from typing import List\ndef max_sum_subarray(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sum_subarray", "input": "[7, 8]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101809_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024440", "code": "def replace_placeholders(sentences, dictionary):\n    updated_sentences = []\n    for sentence in sentences:\n        words = sentence.split()\n        updated_words = []\n        for word in words:\n            if word.startswith(\"<\") and word.endswith(\">\"):\n                placeholder = word[1:-1]\n                replacement = dictionary.get(placeholder, word)\n                updated_words.append(replacement)\n            else:\n                updated_words.append(word)\n        updated_sentence = \" \".join(updated_words)\n        updated_sentences.append(updated_sentence)\n    return updated_sentences\n", "entry_point": "replace_placeholders", "input": "[], {}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024441", "code": "def filter_sensors(sensors, threshold):\n    filtered_sensors = {}\n    for sensor in sensors:\n        if sensor['value'] >= threshold:\n            filtered_sensors[sensor['name']] = sensor['value']\n    return filtered_sensors\n", "entry_point": "filter_sensors", "input": "[], 5", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74395_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024442", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MCCXIII'", "output": "1213", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024443", "code": "def generate_fibonacci(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci", "input": "2", "output": "[0, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4928_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024444", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[20, 25, 25, 15, 10], 2", "output": "[25, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024445", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'moviMoviBtchro'", "output": "'movi_movi_btchro'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024446", "code": "def mesh_tree_depth(id):\n    if len(id) == 1:\n        return 0\n    else:\n        return id.count('.') + 1\n", "entry_point": "mesh_tree_depth", "input": "'a.b'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32418_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024447", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "52, 1", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024448", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'hhttps:httpaamlm', '1/devics'", "output": "'hhttps:httpaamlm/1/devics'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024449", "code": "from typing import List\ndef check_snapshot(snapshot_hash: str, snapshot_hashes: List[str]) -> bool:\n    for h in snapshot_hashes:\n        if snapshot_hash == h:\n            return True\n    return False\n", "entry_point": "check_snapshot", "input": "'abc123', ['def456', 'abc123', 'ghi789']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5211_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024450", "code": "from typing import List\ndef calculate_total_score(round_scores: List[int]) -> int:\n    total_score = 0\n    for score in round_scores:\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[73]", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80780_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024451", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'2.5.0'", "output": "'2.4.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024452", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'tll'", "output": "'tll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024453", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[4, 2, 3, 2, 5, 4, 4, 3]", "output": "[4, 6, 9, 11, 16, 20, 24, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024454", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2247", "output": "{1, 321, 3, 7, 2247, 107, 749, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024455", "code": "def process_operations(initial_list, operations):\n    def add_value(lst, val):\n        return [num + val for num in lst]\n    def multiply_value(lst, val):\n        return [num * val for num in lst]\n    def reverse_list(lst):\n        return lst[::-1]\n    def negate_list(lst):\n        return [-num for num in lst]\n    operations = operations.split()\n    operations_iter = iter(operations)\n    result = initial_list.copy()\n    for op in operations_iter:\n        if op == 'A':\n            result = add_value(result, int(next(operations_iter)))\n        elif op == 'M':\n            result = multiply_value(result, int(next(operations_iter)))\n        elif op == 'R':\n            result = reverse_list(result)\n        elif op == 'N':\n            result = negate_list(result)\n    return result\n", "entry_point": "process_operations", "input": "[2, 0, 1, 3, 5, 4, 1, 0], 'R'", "output": "[0, 1, 4, 5, 3, 1, 0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117757_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024456", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/2345/extra'", "output": "'2345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024457", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9051", "output": "{1, 3, 7, 3017, 1293, 431, 21, 9051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024458", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "128", "output": "'2:08'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024459", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "50", "output": "'L'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024460", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9507", "output": "{3, 1, 9507, 3169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024461", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "{'option2option1': {}}", "output": "('option2option1', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024462", "code": "import re\nfrom collections import Counter\ndef most_common_word(s: str) -> str:\n    # Preprocess the input string\n    s = re.sub(r'[^\\w\\s]', '', s.lower())\n    # Split the string into words\n    words = s.split()\n    # Count the frequency of each word\n    word_freq = Counter(words)\n    # Find the most common word\n    most_common = max(word_freq, key=word_freq.get)\n    return most_common\n", "entry_point": "most_common_word", "input": "'ihello ihello ihello ihello world hello'", "output": "'ihello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23655_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6823", "output": "{1, 6823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6822", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024464", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2014", "output": "{1, 2, 38, 106, 1007, 19, 53, 2014}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2013", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024465", "code": "def modify_django_app_name(app_name: str) -> str:\n    modified_name = \"\"\n    for char in app_name:\n        if char.isupper():\n            modified_name += \"_\" + char.lower()\n        else:\n            modified_name += char\n    return modified_name\n", "entry_point": "modify_django_app_name", "input": "'RevReviReings'", "output": "'_rev_revi_reings'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57025_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024466", "code": "def relative_path(source_path, target_path):\n    source_dirs = source_path.split('/')\n    target_dirs = target_path.split('/')\n    # Find the common prefix\n    i = 0\n    while i < len(source_dirs) and i < len(target_dirs) and source_dirs[i] == target_dirs[i]:\n        i += 1\n    # Construct the relative path\n    relative_dirs = ['..' for _ in range(len(source_dirs) - i)] + target_dirs[i:]\n    return '/'.join(relative_dirs)\n", "entry_point": "relative_path", "input": "'/a/b/c', '/home/user/document'", "output": "'../../../home/user/document'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72530_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024467", "code": "from typing import List\ndef is_slave_process(rank: int, args: List[str]) -> bool:\n    return rank == 1 or \"--tests-slave\" in args\n", "entry_point": "is_slave_process", "input": "1, []", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "579", "output": "{3, 1, 579, 193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024469", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2549", "output": "{1, 2549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024470", "code": "def fizz_buzz_transform(numbers):\n    transformed_list = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            transformed_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            transformed_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            transformed_list.append(\"Buzz\")\n        else:\n            transformed_list.append(num)\n    return transformed_list\n", "entry_point": "fizz_buzz_transform", "input": "[3, 7, 8, 6, 9, 5, 12]", "output": "['Fizz', 7, 8, 'Fizz', 'Fizz', 'Buzz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20136_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024471", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<div>ttoot</div>'", "output": "'ttoot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "724", "output": "{1, 2, 4, 362, 724, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt723", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024473", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "34", "output": "{1, 34, 2, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt33", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024474", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8147", "output": "{1, 8147}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9159", "output": "{1, 129, 3, 9159, 71, 43, 3053, 213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9158", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024476", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1598", "output": "{1, 2, 34, 47, 17, 94, 1598, 799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9094", "output": "{1, 2, 4547, 9094}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9093", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2861", "output": "{1, 2861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024479", "code": "def int_to_roman(num):\n    result = \"\"\n    roman_numerals = {\n        1000: \"M\",\n        900: \"CM\",\n        500: \"D\",\n        400: \"CD\",\n        100: \"C\",\n        90: \"XC\",\n        50: \"L\",\n        40: \"XL\",\n        10: \"X\",\n        9: \"IX\",\n        5: \"V\",\n        4: \"IV\",\n        1: \"I\"\n    }\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            result += numeral\n            num -= value\n    return result\n", "entry_point": "int_to_roman", "input": "49", "output": "'XLIX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139131_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024480", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[5, 5, 9, 6, 3, 2, 1, 1, 1]", "output": "[9, 6, 5, 5, 3, 2, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024481", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "0, -5", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024482", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[3, 3, 2, 0, 5, 4, 4]", "output": "{3: 2, 2: 1, 0: 1, 5: 1, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2918", "output": "{1, 2, 1459, 2918}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2917", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3305", "output": "{1, 5, 3305, 661}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6809", "output": "{619, 1, 6809, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024486", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/adma/'", "output": "'/adma'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024487", "code": "def handle_message(message):\n    message_actions = {\n        \"Sorry we couldn't find that article.\": \"No action\",\n        \"You can't report your article.\": \"No action\",\n        \"Only Admins can delete a reported article\": \"No action\",\n        \"You are not allowed to report twice\": \"No action\",\n        \"You successfully deleted the article\": \"Delete article\",\n        \"Only Admins can get reported article\": \"Get reported article\"\n    }\n    return message_actions.get(message, \"Unknown message\")\n", "entry_point": "handle_message", "input": "'You successfully deleted the article'", "output": "'Delete article'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51721_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024488", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'abcdefghij', 'abcdefghijxyz'", "output": "(0, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024489", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8828", "output": "{1, 2, 4, 8828, 4414, 2207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8827", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024490", "code": "ALPHABET = ['\u0430', '\u0431', '\u0432', '\u0433', '\u0434', '\u0435', '\u0451', '\u0436', '\u0437',\n            '\u0438', '\u0439', '\u043a', '\u043b', '\u043c', '\u043d', '\u043e', '\u043f', '\u0440',\n            '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', '\u0448', '\u0449',\n            '\u044a', '\u044b', '\u044c', '\u044d', '\u044e', '\u044f', ' ']\ndef decode_message(encoded_message):\n    indices = []\n    for char in encoded_message:\n        index = ALPHABET.index(char)\n        indices.append(index)\n    return indices\n", "entry_point": "decode_message", "input": "'\u043f\u0431\u0432\u0433\u0433'", "output": "[16, 1, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57684_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024491", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4841", "output": "{1, 103, 4841, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4840", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024492", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6883", "output": "{1, 6883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024493", "code": "def transform_sql_query(sql_query):\n    modified_query = sql_query.replace(\"select\", \"SELECT\").replace(\"from\", \"FROM\").replace(\"where\", \"WHERE\")\n    return modified_query\n", "entry_point": "transform_sql_query", "input": "'select * from eudta.f0006 '", "output": "'SELECT * FROM eudta.f0006 '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96099_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024494", "code": "def get_file_type(file_path):\n    file_extension = file_path[file_path.rfind(\".\"):].lower()\n    file_types = {\n        \".py\": \"Python file\",\n        \".txt\": \"Text file\",\n        \".jpg\": \"Image file\",\n        \".png\": \"Image file\",\n        \".mp3\": \"Audio file\",\n        \".mp4\": \"Video file\"\n    }\n    return file_types.get(file_extension, \"Unknown file type\")\n", "entry_point": "get_file_type", "input": "'script.py'", "output": "'Python file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12387_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024495", "code": "from typing import List\ndef process_numbers(numbers: List[int]) -> List[int]:\n    processed_numbers = []\n    for index, num in enumerate(numbers):\n        total = num + index\n        if total % 2 == 0:\n            processed_numbers.append(total ** 2)\n        else:\n            processed_numbers.append(total ** 3)\n    return processed_numbers\n", "entry_point": "process_numbers", "input": "[-1, 1, 4, 1, 2, 1]", "output": "[-1, 4, 36, 16, 36, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1098_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024496", "code": "def find_pairs(numbers, target):\n    num_dict = {}\n    result = []\n    for num in numbers:\n        diff = target - num\n        if diff in num_dict:\n            result.append((diff, num))\n        num_dict[num] = True\n    return result\n", "entry_point": "find_pairs", "input": "[1, 2, 9, 13], 15", "output": "[(2, 13)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61276_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024497", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'ososmaxx.results'", "output": "'ososmaxx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5974", "output": "{1, 2, 103, 2987, 206, 5974, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5973", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7972", "output": "{1, 2, 7972, 4, 1993, 3986}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7971", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024500", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4267", "output": "{1, 4267, 17, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4266", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024501", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 9, 18]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024502", "code": "def compress_sequence(input_list):\n    compressed_list = []\n    start = end = input_list[0]\n    for num in input_list[1:]:\n        if num == end + 1:\n            end = num\n        else:\n            compressed_list.extend([start, end])\n            start = end = num\n    compressed_list.extend([start, end])\n    return compressed_list\n", "entry_point": "compress_sequence", "input": "[10, 2, 7]", "output": "[10, 10, 2, 2, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143938_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024503", "code": "from typing import List, Tuple\ndef find_latest_version(versions: List[Tuple[int, int, int]]) -> Tuple[int, int, int]:\n    latest_version = versions[0]\n    for version in versions[1:]:\n        if version > latest_version:\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "[(1, 0, 0), (2, 0, 0), (2, 1, 4), (2, 1, 5)]", "output": "(2, 1, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46416_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024504", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[1, 2, 3, 7, 7, 7, 7, 4], 4", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024505", "code": "def longest_consec(strarr, k):\n    output, n = None, len(strarr)\n    if n == 0 or k > n or k <= 0:\n        return \"\"\n    for i in range(n - k + 1):\n        aux = ''\n        for j in range(i, i + k):\n            aux += strarr[j]\n        if output is None or len(output) < len(aux):\n            output = aux\n    return output\n", "entry_point": "longest_consec", "input": "['def', 'gh', 'ij', 'klmno'], 4", "output": "'defghijklmno'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107151_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024506", "code": "def detect_video(video_durations):\n    total_seconds = sum(video_durations)\n    total_minutes = total_seconds // 60\n    remaining_seconds = total_seconds % 60\n    return f\"{total_minutes} minutes and {remaining_seconds} seconds\"\n", "entry_point": "detect_video", "input": "[240]", "output": "'4 minutes and 0 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119061_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024507", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6757", "output": "{1, 29, 233, 6757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024508", "code": "from typing import List, Tuple\ndef calculate_stats(input_list: List[int]) -> Tuple[int, int, int, int]:\n    total = 0\n    count = 0\n    smallest = None\n    largest = None\n    for num in input_list:\n        total += num\n        count += 1\n        if smallest is None or num < smallest:\n            smallest = num\n        if largest is None or num > largest:\n            largest = num\n    return total, count, smallest, largest\n", "entry_point": "calculate_stats", "input": "[0, 9, 3, 4, 3, 3, 5]", "output": "(27, 7, 0, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120992_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024509", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'Hello, World!', 3", "output": "'Khoor, Zruog!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6632", "output": "{1, 2, 4, 6632, 8, 3316, 1658, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6631", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5518", "output": "{1, 2, 2759, 5518, 178, 89, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5517", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024512", "code": "# Define the dictionaries provided in the code snippet\nCT_N_Ca = {'d': 1.47, 'bb': True}\nCT_Ca_C = {'d': 1.53, 'bb': True, 'ang': [121]}\nCT_C_N = {'d': 1.32, 'bb': True, 'ang': [123]}\nCT_C_O = {'d': 1.24, 'bb': True}\nCT_C_Na = {'d': 1.352, 'bb': True}\nCT_C_Na_His = {'d': 1.37, 'bb': True}\nCT_C_Nd = {'d': 1.32, 'bb': True}\nCT_C_OH = {'d': 1.43, 'bb': True}\nCT_C_Od = {'d': 1.23, 'bb': True}\nCT_C_Na_Trp = {'d': 1.384, 'bb': True}\nCT_Car_Car_Trp = {'d': 1.384, 'bb': False, 'ang': [121.3]}\nCT_Car_Car = {'d': 1.41, 'bb': False, 'ang': [120]}\nCT_C_C = {'d': 1.535, 'bb': False, 'ang': [111.17]}\nCT_Cd_Cd = {'d': 1.339, 'bb': False, 'ang': [121.3]}\nCT_C_S = {'d': 1.83, 'bb': False, 'ang': [111.17]}\n# Create a function to calculate the average bond length for a given bond type\ndef calculate_average_bond_length(bond_type):\n    total_length = 0\n    count = 0\n    for key, value in globals().items():\n        if key.startswith('CT_') and key.endswith(bond_type):\n            total_length += value['d']\n            count += 1\n    if count == 0:\n        return f\"No occurrences found for bond type {bond_type}\"\n    return total_length / count\n", "entry_point": "calculate_average_bond_length", "input": "'N'", "output": "1.32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85392_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024513", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'6:00 PM', '2:15'", "output": "'8:15 PM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024514", "code": "def find_first_duplicate(lst):\n    seen = set()\n    for num in lst:\n        if num in seen:\n            return num\n        seen.add(num)\n    return -1\n", "entry_point": "find_first_duplicate", "input": "[1, 2, 3, 8, 5, 8]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92633_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024515", "code": "VOCAB_FILES_NAMES = {\"vocab_file\": \"spm.model\", \"tokenizer_file\": \"tokenizer.json\"}\nPRETRAINED_VOCAB_FILES_MAP = {\n    \"vocab_file\": {\n        \"microsoft/deberta-v2-xlarge\": \"https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/spm.model\",\n        \"microsoft/deberta-v2-xxlarge\": \"https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/spm.model\",\n        \"microsoft/deberta-v2-xlarge-mnli\": \"https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/spm.model\",\n        \"microsoft/deberta-v2-xxlarge-mnli\": \"https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/spm.model\",\n    }\n}\nPRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {\n    \"microsoft/deberta-v2-xlarge\": 512,\n    \"microsoft/deberta-v2-xxlarge\": 512,\n    \"microsoft/deberta-v2-xlarge-mnli\": 512,\n    \"microsoft/deberta-v2-xxlarge-mnli\": 512,\n}\ndef get_model_info(model_name):\n    if model_name in PRETRAINED_VOCAB_FILES_MAP[\"vocab_file\"]:\n        vocab_file_name = VOCAB_FILES_NAMES[\"vocab_file\"]\n        positional_embeddings_size = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES.get(model_name, None)\n        return (vocab_file_name, positional_embeddings_size) if positional_embeddings_size is not None else \"Model not found\"\n    else:\n        return \"Model not found\"\n", "entry_point": "get_model_info", "input": "'microsoft/deberta-v2-xlarge'", "output": "('spm.model', 512)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64705_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024516", "code": "from typing import List\ndef parentheses_placement(nums: List[int], target: int) -> bool:\n    def evaluate_expression(nums, target, current_sum, index):\n        if index == len(nums):\n            return current_sum == target\n        for i in range(index, len(nums)):\n            current_sum += nums[i]\n            if evaluate_expression(nums, target, current_sum, i + 1):\n                return True\n            current_sum -= nums[i]\n            current_sum *= nums[i]\n            if evaluate_expression(nums, target, current_sum, i + 1):\n                return True\n            current_sum //= nums[i]\n        return False\n    return evaluate_expression(nums, target, nums[0], 1)\n", "entry_point": "parentheses_placement", "input": "[1, 2, 3], 10", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118745_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024517", "code": "def extract_url_app_mapping(urlpatterns):\n    url_app_mapping = {}\n    for url_path, app_name in urlpatterns:\n        url_app_mapping[url_path] = app_name\n    return url_app_mapping\n", "entry_point": "extract_url_app_mapping", "input": "[('home/', 'home')]", "output": "{'home/': 'home'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84389_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024518", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "4, 10", "output": "[2, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024519", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[4, 4, 4, 4, 1, 2, 3]", "output": "{4: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024520", "code": "from typing import List\ndef unique_elements(lista: List[int]) -> List[int]:\n    seen = set()\n    result = []\n    for num in lista:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "unique_elements", "input": "[2, 1, 1, 3, 5, 2, 0, 5]", "output": "[2, 1, 3, 5, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139228_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024521", "code": "def get_weights(targets, n_weights, p_weights):\n    weights = []\n    for target in targets:\n        if target == 1:\n            weights.append(p_weights)\n        elif target == 0:\n            weights.append(n_weights)\n    return weights\n", "entry_point": "get_weights", "input": "[], None, None", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52482_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024522", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'worhhloelld'", "output": "['worhhloelld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024523", "code": "def find_id(sequence):\n    return sequence[0]\n", "entry_point": "find_id", "input": "[5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12545_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024524", "code": "from typing import List\ndef count_ways_to_sum(arr: List[int], S: int) -> int:\n    dp = [0] * (S + 1)\n    dp[0] = 1\n    for num in arr:\n        for i in range(num, S + 1):\n            dp[i] += dp[i - num]\n    return dp[S]\n", "entry_point": "count_ways_to_sum", "input": "[], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51870_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024525", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'ow', 0, 0", "output": "\"Error: Invalid operation type 'ow'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9437", "output": "{1, 9437}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9436", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024527", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "46", "output": "{1, 2, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt45", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024528", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef find_most_common_integer(data: List[int]) -> Tuple[int, int]:\n    counts = Counter(data)\n    most_common_int, count = counts.most_common(1)[0]\n    return most_common_int, count\n", "entry_point": "find_most_common_integer", "input": "[2, 2, 2, 1, 3, 4]", "output": "(2, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125257_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024529", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[4, 4, 5, 4]", "output": "[4, 8, 13, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024530", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "13, 0, 5", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024531", "code": "def caesar_cipher(text, shift):\n    result = \"\"\n    for char in text:\n        if char.isupper():\n            new_char = chr((ord(char) - 65 + shift) % 26 + 65)\n            result += new_char\n    return result\n", "entry_point": "caesar_cipher", "input": "'ADAAHSAHS', 6", "output": "'GJGGNYGNY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7376_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024532", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'sis'", "output": "'Tweet posted successfully: sis'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024533", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[5, 5, 3, 2, 2]", "output": "[5, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024534", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'qtof', 'combined'", "output": "{'tolerance': 0.01, 'mode': 'combined'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024535", "code": "def pangrams(s):\n    alphabet_set = set()\n    for char in s:\n        if char.isalpha():\n            alphabet_set.add(char.lower())\n    if len(alphabet_set) == 26:\n        return \"pangram\"\n    else:\n        return \"not pangram\"\n", "entry_point": "pangrams", "input": "'the quick brown fox jumps over the lazy dog'", "output": "'pangram'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111312_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024536", "code": "def latex_to_mathjax(command_type, latex_expression):\n    if command_type == 'ce':\n        return f'${latex_expression}$'\n    elif command_type == 'pu':\n        return f'${latex_expression}$${latex_expression}$'\n    else:\n        return 'Invalid command type'\n", "entry_point": "latex_to_mathjax", "input": "'pu', 'E = mc^2'", "output": "'$E = mc^2$$E = mc^2$'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11235_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024537", "code": "def _lik_formulae(lik):\n    lik_formulas = {\n        \"bernoulli\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"probit\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=\u03a6(x)\\n\",\n        \"binomial\": \" for y\u1d62 ~ Binom(\u03bc\u1d62=g(z\u1d62), n\u1d62) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"poisson\": \" for y\u1d62 ~ Poisson(\u03bb\u1d62=g(z\u1d62)) and g(x)=e\u02e3\\n\"\n    }\n    return lik_formulas.get(lik, \"\\n\")\n", "entry_point": "_lik_formulae", "input": "'bernoulli'", "output": "' for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=1/(1+e\u207b\u02e3)\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106790_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4001", "output": "{1, 4001}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4282", "output": "{1, 4282, 2, 2141}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024540", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "767", "output": "{1, 59, 13, 767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024541", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[4, 1, 2, 5, 5, 9]", "output": "[9, 5, 5, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "855", "output": "{1, 3, 5, 9, 171, 45, 15, 19, 855, 57, 285, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt854", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024543", "code": "def max_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate two potential products\n    product1 = nums[n-1] * nums[n-2] * nums[n-3]\n    product2 = nums[0] * nums[1] * nums[n-1]\n    return max(product1, product2)\n", "entry_point": "max_product_of_three", "input": "[1, 4, 5, 8]", "output": "160", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5851_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024544", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[50, 20, 16, 30, 3, 7]", "output": "116", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6142", "output": "{1, 2, 37, 166, 74, 83, 6142, 3071}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024546", "code": "def sum_of_digit_squares(n):\n    # Convert the integer to a string to access individual digits\n    n_str = str(n)\n    # Initialize the sum of squares\n    sum_squares = 0\n    # Iterate over each digit in the string representation of n\n    for digit in n_str:\n        # Convert the digit back to an integer, square it, and add to the sum\n        sum_squares += int(digit) ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "31", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77093_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024547", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'cffo!cfun!c'", "output": "'ffo!fun!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024548", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[7, 7, 4, 7, 6, 8, 2, 7]", "output": "[7, 7, 4, 7, 6, 8, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024549", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'30a30aea46'", "output": "'30a30aFFFEea46'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024550", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[5, 10, 15, 25]", "output": "65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024551", "code": "import sys\ndef eggDrop(n, k):\n    dp = [[0 for _ in range(k+1)] for _ in range(n+1)]\n    for j in range(1, k+1):\n        dp[1][j] = j\n    for i in range(2, n+1):\n        for j in range(1, k+1):\n            dp[i][j] = sys.maxsize\n            for x in range(1, j+1):\n                res = 1 + max(dp[i-1][x-1], dp[i][j-x])\n                dp[i][j] = min(dp[i][j], res)\n    return dp[n][k]\n", "entry_point": "eggDrop", "input": "1, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60035_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024552", "code": "def remove_duplicates(mylist):\n    unique_set = set()\n    result = []\n    for element in mylist:\n        if element not in unique_set:\n            unique_set.add(element)\n            result.append(element)\n    return result\n", "entry_point": "remove_duplicates", "input": "[1, 1, 3, 2, 4, 5, 3]", "output": "[1, 3, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92580_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1493", "output": "{1, 1493}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1492", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4509", "output": "{1, 3, 167, 9, 501, 27, 4509, 1503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024555", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "87", "output": "{3: 1, 29: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024556", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[101, 100, 73, 74, 99, 73, 100]", "output": "'edIJcId'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "801", "output": "{1, 801, 3, 9, 267, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024558", "code": "def generate_pascals_triangle(num_rows):\n    triangle = []\n    for row in range(num_rows):\n        current_row = []\n        for col in range(row + 1):\n            if col == 0 or col == row:\n                current_row.append(1)\n            else:\n                current_row.append(triangle[row - 1][col - 1] + triangle[row - 1][col])\n        triangle.append(current_row)\n    return triangle\n", "entry_point": "generate_pascals_triangle", "input": "1", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110086_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024559", "code": "def get_fields_by_type(schema_response, target_type):\n    fields_matching_type = []\n    fields = schema_response.get(\"schema\", {}).get(\"fields\", [])\n    for field in fields:\n        if field.get(\"type\") == target_type:\n            fields_matching_type.append(field.get(\"name\"))\n    return fields_matching_type\n", "entry_point": "get_fields_by_type", "input": "{'schema': {'fields': []}}, 'someType'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84031_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024560", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'\u00e9\u00e9s'", "output": "'\u00e9\u00e9s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6135", "output": "{1, 3, 5, 1227, 15, 6135, 409, 2045}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024562", "code": "def longest_consecutive_sequence(steps):\n    current_length = 0\n    max_length = 0\n    for step in steps:\n        if step != 0:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 0\n    return max_length\n", "entry_point": "longest_consecutive_sequence", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 0]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74155_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024563", "code": "def reverse_complement(Dna):\n    tt = {\n        'A': 'T',\n        'T': 'A',\n        'G': 'C',\n        'C': 'G',\n    }\n    ans = ''\n    for a in Dna:\n        ans += tt[a]\n    return ans[::-1]\n", "entry_point": "reverse_complement", "input": "'AATG'", "output": "'CATT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99538_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024564", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<div>Welcometoe thew</div>'", "output": "'Welcometoe thew'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024565", "code": "def calculate_total_price(cart):\n    total_price = 0\n    for product in cart:\n        total_price += product[\"price\"]\n    return total_price\n", "entry_point": "calculate_total_price", "input": "[{'price': 50}, {'price': 70}]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68876_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3643", "output": "{1, 3643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024567", "code": "def transform_none_to_empty(data):\n    for person in data:\n        for key, value in person.items():\n            if value is None:\n                person[key] = ''\n    return data\n", "entry_point": "transform_none_to_empty", "input": "[{}, {}]", "output": "[{}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9611_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024568", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4418", "output": "{2209, 1, 4418, 2, 47, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4417", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024569", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 2, 0, 2, -1, 2, 3, 0]", "output": "[2, 0, 6, -4, 10, 18, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60801_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024570", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'V'", "output": "'V'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9574", "output": "{1, 2, 4787, 9574}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024572", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2399", "output": "{1, 2399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024573", "code": "def count_unique_squares(group_of_squares: str) -> int:\n    squares_list = group_of_squares.split()  # Split the input string into individual square representations\n    unique_squares = set(squares_list)  # Convert the list into a set to remove duplicates\n    return len(unique_squares)  # Return the count of unique squares\n", "entry_point": "count_unique_squares", "input": "'squareA squareB'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41414_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024574", "code": "def tokenize(line):\n    tokens = []\n    word = \"\"\n    in_quote = False\n    for char in line:\n        if char == '\"':\n            if in_quote:\n                tokens.append(word)\n                word = \"\"\n                in_quote = False\n            else:\n                in_quote = True\n        elif char == ' ' and not in_quote:\n            if word:\n                tokens.append(word)\n                word = \"\"\n        else:\n            word += char\n    if word:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "' \"hello world\" exaple '", "output": "['hello world', 'exaple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103328_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4035", "output": "{1, 1345, 3, 4035, 5, 807, 269, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024576", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'E'", "output": "('E', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024577", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'raaar'", "output": "'raaar'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024578", "code": "def average_absolute_difference(list1, list2):\n    if len(list1) != len(list2):\n        return \"Error: Input lists must have the same length.\"\n    abs_diff = [abs(x - y) for x, y in zip(list1, list2)]\n    avg_abs_diff = sum(abs_diff) / len(abs_diff)\n    return avg_abs_diff\n", "entry_point": "average_absolute_difference", "input": "[0], [2]", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107856_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024579", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wxt.totC'", "output": "'wx.adv.t.totC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024580", "code": "def min_edit_distance(source, target):\n    slen, tlen = len(source), len(target)\n    dist = [[0 for _ in range(tlen+1)] for _ in range(slen+1)]\n    for i in range(slen+1):\n        dist[i][0] = i\n    for j in range(tlen+1):\n        dist[0][j] = j\n    for i in range(slen):\n        for j in range(tlen):\n            cost = 0 if source[i] == target[j] else 1\n            dist[i+1][j+1] = min(\n                dist[i][j+1] + 1,   # deletion\n                dist[i+1][j] + 1,   # insertion\n                dist[i][j] + cost   # substitution\n            )\n    return dist[-1][-1]\n", "entry_point": "min_edit_distance", "input": "'', 'aaaaaaaaaaaaaaaaa'", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126361_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024581", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'123456789'", "output": "'12345678952485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024582", "code": "def extract_app_name(default_app_config):\n    # Split the input string using dot as the delimiter\n    config_parts = default_app_config.split('.')\n    # Extract the app name from the first part\n    app_name = config_parts[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'djangd_django_dja.some_config'", "output": "'djangd_django_dja'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64209_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8594", "output": "{1, 8594, 2, 4297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1685", "output": "{337, 1, 5, 1685}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024585", "code": "from typing import List\ndef min_transactions_to_equalize_shares(shares: List[int]) -> int:\n    total_shares = sum(shares)\n    target_shares = total_shares // len(shares)\n    transactions = 0\n    for share in shares:\n        transactions += max(0, target_shares - share)\n    return transactions\n", "entry_point": "min_transactions_to_equalize_shares", "input": "[0, 0, 4, 12]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91176_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024586", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'owo'", "output": "{'owo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024587", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[95, 93, 92, 91, 85], 4", "output": "92.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94918_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024588", "code": "from typing import List\ndef process_commands(commands: List[str]) -> int:\n    result = 0\n    for command in commands:\n        parts = command.split()\n        command_name = parts[0]\n        arguments = list(map(int, parts[1:]))\n        if command_name == 'add':\n            result += sum(arguments)\n        elif command_name == 'subtract':\n            result -= arguments[0]\n            for arg in arguments[1:]:\n                result -= arg\n        elif command_name == 'multiply':\n            result *= arguments[0]\n            for arg in arguments[1:]:\n                result *= arg\n    return result\n", "entry_point": "process_commands", "input": "['subtract 50', 'add 2']", "output": "-48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38199_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024589", "code": "def count_valid_protein_sequences(sequences):\n    valid_count = 0\n    invalid_count = 0\n    nchar = set(['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V'])\n    for seq in sequences:\n        if all(char in nchar for char in seq):\n            valid_count += 1\n        else:\n            invalid_count += 1\n    return {'valid': valid_count, 'invalid': invalid_count}\n", "entry_point": "count_valid_protein_sequences", "input": "['ARN', 'DC', 'GHI', 'ABC']", "output": "{'valid': 3, 'invalid': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140445_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024590", "code": "def process_text(input_text: str) -> str:\n    manualMap = {\n        \"can't\": \"cannot\",\n        \"won't\": \"will not\",\n        \"don't\": \"do not\",\n        # Add more contractions as needed\n    }\n    articles = {\"a\", \"an\", \"the\"}\n    contractions = {v: k for k, v in manualMap.items()}\n    outText = []\n    tempText = input_text.lower().split()\n    for word in tempText:\n        word = manualMap.get(word, word)\n        if word not in articles:\n            outText.append(word)\n    for wordId, word in enumerate(outText):\n        if word in contractions:\n            outText[wordId] = contractions[word]\n    return ' '.join(outText)\n", "entry_point": "process_text", "input": "'a dog.'", "output": "'dog.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127920_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024591", "code": "def latex_to_mathjax(command_type, latex_expression):\n    if command_type == 'ce':\n        return f'${latex_expression}$'\n    elif command_type == 'pu':\n        return f'${latex_expression}$${latex_expression}$'\n    else:\n        return 'Invalid command type'\n", "entry_point": "latex_to_mathjax", "input": "'ce', 'a^2 + b^2 = c^2'", "output": "'$a^2 + b^2 = c^2$'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11235_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024592", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[6, 1, 0, 3, 3, -2, 4, 0]", "output": "[7, 1, 3, 6, 1, 2, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4707", "output": "{1, 1569, 3, 4707, 9, 523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024594", "code": "def calculate_average(scores):\n    if len(scores) < 2:\n        return 0\n    min_score = min(scores)\n    max_score = max(scores)\n    scores.remove(min_score)\n    scores.remove(max_score)\n    average = sum(scores) / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[85, 86, 87, 91, 92, 80, 100]", "output": "88.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121549_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024595", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[5, 1, 2, 1, 5, 5, 3]", "output": "[5, 6, 8, 9, 14, 19, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024596", "code": "from collections import defaultdict\ndef organize_items(items):\n    organized_data = defaultdict(set)\n    for item in items:\n        item_type = item[\"type\"]\n        item_path = item[\"path\"]\n        organized_data[item_type].add(item_path)\n    return dict(organized_data)\n", "entry_point": "organize_items", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90363_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024597", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8839", "output": "{1, 8839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2049", "output": "{1, 3, 683, 2049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2048", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024599", "code": "def max_subarray_sum(arr):\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 11, 12]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76765_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024600", "code": "def calculate_class_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_class_average", "input": "[70, 85, 90, 95, 100]", "output": "90.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82047_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024601", "code": "from typing import List, Optional\ndef find_most_frequent_integer(numbers: List[int]) -> Optional[int]:\n    if not numbers:\n        return None\n    frequency = {}\n    for num in numbers:\n        frequency[num] = frequency.get(num, 0) + 1\n    most_frequent = min(frequency, key=lambda x: (-frequency[x], x))\n    return most_frequent\n", "entry_point": "find_most_frequent_integer", "input": "[2, 2, 1, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18121_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024602", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "10, 5, 1", "output": "20.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024603", "code": "from typing import List\ndef segment_text(text: str) -> List[str]:\n    words = []\n    current_word = ''\n    for char in text:\n        if char == ' ' or char == '\\n':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "segment_text", "input": "'singlword'", "output": "['singlword']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55966_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1469", "output": "{1, 13, 1469, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024605", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2230", "output": "{1, 2, 5, 10, 2230, 1115, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2229", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024606", "code": "from typing import List\ndef most_common_elements(frequencies: List[int]) -> List[int]:\n    freq_map = {}\n    for i, freq in enumerate(frequencies):\n        if freq in freq_map:\n            freq_map[freq].append(i)\n        else:\n            freq_map[freq] = [i]\n    max_freq = max(freq_map.keys())\n    return sorted(freq_map[max_freq])\n", "entry_point": "most_common_elements", "input": "[1, 1, 1, 1, 1, 1, 10]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37692_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024607", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 0, -2, 1], 1", "output": "[1, 0, -2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024608", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'3d'", "output": "259200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024609", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['5 + 10', '2 * 7']", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024610", "code": "def calculate_average_rating(responses):\n    total_sum = 0\n    for response in responses:\n        total_sum += int(response)\n    average_rating = total_sum / len(responses)\n    return round(average_rating, 1)\n", "entry_point": "calculate_average_rating", "input": "['18', '18', '18', '18', '18', '18', '18', '18', '18', '18']", "output": "18.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100228_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024611", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, -11, -1.0", "output": "-12.100000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024612", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'fbfffob'", "output": "'fbfffob'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024613", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 1, -1, 1, -1, -1]", "output": "[5, 0, 0, 0, -2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024614", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 9, 15, 39]", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024615", "code": "from typing import List\ndef total_hours_above_threshold(task_hours: List[int], threshold: int) -> int:\n    total_hours = 0\n    for hours in task_hours:\n        if hours > threshold:\n            total_hours += hours\n    return total_hours\n", "entry_point": "total_hours_above_threshold", "input": "[20, 20, 21, 15], 15", "output": "61", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127109_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024616", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[85.0, 85.0, 86.0]", "output": "85.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024617", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'RDD'", "output": "(1, -2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024618", "code": "def count_words(input_string):\n    word_count = 0\n    words_list = input_string.split()\n    for word in words_list:\n        word_count += 1\n    return word_count\n", "entry_point": "count_words", "input": "'hello world this is me'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132450_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024619", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "18", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024620", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[3, 3, 5, 4, 4, 4, 4]", "output": "{3: 2, 5: 1, 4: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024621", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "715", "output": "{1, 65, 5, 11, 715, 13, 143, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt714", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024622", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'apple\\norange\\nbanana', 'be'", "output": "['be']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024623", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[2, 1, 2, 4, 1, 3, 2, 3, 3]", "output": "[5, 4, 4, 7, 2, 7, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024624", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2503", "output": "{1, 2503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024625", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/home/ue/hoocume/ts', 'exaexatxt'", "output": "'/home/ue/hoocume/ts/exaexatxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024626", "code": "def calculate_nested_sum(nested_list):\n    total_sum = 0\n    for element in nested_list:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += calculate_nested_sum(element)\n    return total_sum\n", "entry_point": "calculate_nested_sum", "input": "[[10, 20], [21]]", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91003_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024627", "code": "from itertools import product\ndef calculate_cartesian_product_sum(list1, list2):\n    # Generate all pairs of elements from list1 and list2\n    pairs = product(list1, list2)\n    # Calculate the sum of the products of all pairs\n    sum_of_products = sum(a * b for a, b in pairs)\n    return sum_of_products\n", "entry_point": "calculate_cartesian_product_sum", "input": "[2, 3], [5, 5]", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129453_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024628", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7204", "output": "{1, 2, 7204, 4, 1801, 3602}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7203", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024629", "code": "def count_coma_warriors(health_points):\n    coma_warriors = 0\n    for health in health_points:\n        if health == 0:\n            coma_warriors += 1\n    return coma_warriors\n", "entry_point": "count_coma_warriors", "input": "[0, 0, 5, 8]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115294_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3803", "output": "{1, 3803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9499", "output": "{1, 161, 7, 59, 1357, 23, 9499, 413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024632", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'Hel'", "output": "('', 'Hel')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024633", "code": "from typing import List\ndef max_non_adjacent_score(scores: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = exclude + score\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 0, 14, 0]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96838_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024634", "code": "from typing import Tuple\ndef split_with_escape(input_str: str, separator: str) -> Tuple[str, str]:\n    key = ''\n    val = ''\n    escaped = False\n    for i in range(len(input_str)):\n        if input_str[i] == '\\\\' and not escaped:\n            escaped = True\n        elif input_str[i] == separator and not escaped:\n            val = input_str[i+1:]\n            break\n        else:\n            if escaped:\n                key += input_str[i]\n                escaped = False\n            else:\n                key += input_str[i]\n    return key, val\n", "entry_point": "split_with_escape", "input": "'abza==:', ':'", "output": "('abza==', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12144_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024635", "code": "def evaluate_expression(expression: str) -> int:\n    def evaluate_helper(tokens):\n        stack = []\n        for token in tokens:\n            if token == '(':\n                stack.append('(')\n            elif token == ')':\n                sub_expr = []\n                while stack[-1] != '(':\n                    sub_expr.insert(0, stack.pop())\n                stack.pop()  # Remove '('\n                stack.append(evaluate_stack(sub_expr))\n            else:\n                stack.append(token)\n        return evaluate_stack(stack)\n    def evaluate_stack(stack):\n        operators = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y}\n        res = int(stack.pop(0))\n        while stack:\n            operator = stack.pop(0)\n            operand = int(stack.pop(0))\n            res = operators[operator](res, operand)\n        return res\n    tokens = expression.replace('(', ' ( ').replace(')', ' ) ').split()\n    return evaluate_helper(tokens)\n", "entry_point": "evaluate_expression", "input": "'20 + 3'", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122820_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024636", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[2, 2, 4, 5, 5, 5, 3, 6, 2]", "output": "[4, 4, 16, 25, 25, 25, 9, 36, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024637", "code": "import os\ndef expand_env_variables(file_path):\n    def replace_env_var(match):\n        var_name = match.group(1)\n        return os.environ.get(var_name, f'%{var_name}%')\n    expanded_path = os.path.expandvars(file_path)\n    return expanded_path\n", "entry_point": "expand_env_variables", "input": "'%LOCte%LOCALAPPDATA%%LOCALAPPDATA'", "output": "'%LOCte%LOCALAPPDATA%%LOCALAPPDATA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024638", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5503", "output": "{1, 5503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024639", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[1, 2, 2, 3, 5, 6]", "output": "([1, 2, 3, 5, 6], 17)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024640", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "5, 1, 2", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024641", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "6", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024642", "code": "import re\ndef process_string(input_string):\n    extracted_values = {'name': 'Unknown', 'age': 'Unknown', 'city': 'Unknown'}\n    pattern = r'(?:name=([^\\s,]+))?,?(?:age=([^\\s,]+))?,?(?:city=([^\\s,]+))?'\n    match = re.match(pattern, input_string)\n    if match:\n        extracted_values['name'] = match.group(1) if match.group(1) else 'Unknown'\n        extracted_values['age'] = match.group(2) if match.group(2) else 'Unknown'\n        extracted_values['city'] = match.group(3) if match.group(3) else 'Unknown'\n    return extracted_values\n", "entry_point": "process_string", "input": "'name=Bob,city=Los'", "output": "{'name': 'Bob', 'age': 'Unknown', 'city': 'Los'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136671_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024643", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'ffofoo=barbaux'", "output": "{'ffofoo': 'barbaux'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024644", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVAC/fields/some_file.txt'", "output": "('HVAC/fields', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024645", "code": "def apply_commits(commits):\n    repository = {}\n    for commit in commits:\n        operation, *args = commit.split()\n        filename = args[0]\n        if operation == 'A':\n            content = ' '.join(args[1:])\n            repository[filename] = content\n        elif operation == 'M':\n            content = ' '.join(args[1:])\n            if filename in repository:\n                repository[filename] = content\n        elif operation == 'D':\n            if filename in repository:\n                del repository[filename]\n    return repository\n", "entry_point": "apply_commits", "input": "['A file1 Hello World', 'D file1']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68646_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024646", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6271", "output": "{1, 6271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024647", "code": "def reverse(input_str):\n    reversed_str = ''\n    for i in range(len(input_str) - 1, -1, -1):\n        reversed_str += input_str[i]\n    return reversed_str\n", "entry_point": "reverse", "input": "'mhngry!'", "output": "'!yrgnhm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77619_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024648", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1108", "output": "{1, 2, 4, 554, 1108, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1107", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024649", "code": "from typing import List\ndef filter_by_percentage(input_list: List[int], percentage: float) -> List[int]:\n    if not input_list:\n        return []\n    max_value = max(input_list)\n    threshold = max_value * (percentage / 100)\n    filtered_list = [num for num in input_list if num >= threshold]\n    return filtered_list\n", "entry_point": "filter_by_percentage", "input": "[10, 20, 30, 40, 50], 60", "output": "[30, 40, 50]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19265_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024650", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5083", "output": "{1, 391, 299, 13, 17, 23, 5083, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1689", "output": "{1, 1689, 3, 563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024652", "code": "def split_list(x, n):\n    x = list(x)\n    if n < 2:\n        return [x]\n    def gen():\n        m = len(x) / n\n        i = 0\n        for _ in range(n-1):\n            yield x[int(i):int(i + m)]\n            i += m\n        yield x[int(i):]\n    return list(gen())\n", "entry_point": "split_list", "input": "[0, 7, 4, 5, 6, 10, 1, 10], 5", "output": "[[0], [7, 4], [5], [6, 10], [1, 10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38553_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5541", "output": "{1, 3, 5541, 1847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024654", "code": "def sort_and_count_iterations(numcliente2):\n    num_list = [int(num) for num in numcliente2]\n    interacao = 0\n    for i in range(len(num_list)):\n        min_index = i\n        for j in range(i+1, len(num_list)):\n            if num_list[j] < num_list[min_index]:\n                min_index = j\n        if min_index != i:\n            interacao += 1\n            num_list[i], num_list[min_index] = num_list[min_index], num_list[i]\n    return interacao\n", "entry_point": "sort_and_count_iterations", "input": "[5, 1, 4, 2, 3]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49082_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6582", "output": "{1, 2, 3, 6, 1097, 2194, 6582, 3291}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024656", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[30, 25, 20, 15, 10, 5], 3", "output": "[30, 25, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024657", "code": "def drop(lst, n):\n    return lst[n:]\n", "entry_point": "drop", "input": "[], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11747_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024658", "code": "def sum_divisible_by_num(n):\n    num = 11\n    sum_divisible = 0\n    for i in range(1, n+1):\n        if i % num == 0:\n            sum_divisible += i\n    return sum_divisible\n", "entry_point": "sum_divisible_by_num", "input": "33", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120437_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024659", "code": "from typing import Dict, List, TypeVar, Union\nJsonTypeVar = TypeVar(\"JsonTypeVar\")\nJsonPrimitive = Union[str, float, int, bool, None]\nJsonDict = Dict[str, JsonTypeVar]\nJsonArray = List[JsonTypeVar]\nJson = Union[JsonPrimitive, JsonDict, JsonArray]\ndef count_primitive_values(json_data: Json) -> int:\n    count = 0\n    if isinstance(json_data, (str, float, int, bool, type(None))):\n        return 1\n    if isinstance(json_data, dict):\n        for value in json_data.values():\n            count += count_primitive_values(value)\n    elif isinstance(json_data, list):\n        for item in json_data:\n            count += count_primitive_values(item)\n    return count\n", "entry_point": "count_primitive_values", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7551_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2481", "output": "{3, 1, 2481, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024661", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No average to calculate if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[75, 75, 80, 85]", "output": "77.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140002_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024662", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[4, 9, 5, 1, 4, 6, 5, 5, 5], 7", "output": "[[4, 9, 5, 1, 4, 6, 5], [5, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024663", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1g-3g1'", "output": "'1g+3g1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024664", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'H'", "output": "'H'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024665", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1009", "output": "{1, 1009}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1008", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024666", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "2", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024667", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_counts = {}\n    for word in words:\n        word = word.strip('.,')  # Remove punctuation if present\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'umups'", "output": "{'umups': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117339_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024668", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3126", "output": "{1, 2, 3, 6, 521, 1042, 3126, 1563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3125", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024669", "code": "import time\ndef calculate_seconds_until_future_time(current_time, future_time):\n    return abs(future_time - current_time)\n", "entry_point": "calculate_seconds_until_future_time", "input": "10000, 15006", "output": "5006", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45249_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024670", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 2, 1, 3, 1, 3, 3]", "output": "[5, 3, 4, 4, 4, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29487_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024671", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[1449], 1", "output": "1449", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024672", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'ggMgM'", "output": "'ggMgM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024673", "code": "def generate_pattern(n):\n    ans = []\n    cur = n\n    layer = 0\n    while cur > 0:\n        ans.append(cur)\n        if layer % 2 == 1:\n            offset = (cur - (1 << (layer - 1))) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << (layer - 1)) + offset\n            else:\n                cur = 0\n        else:\n            offset = ((1 << layer) - 1 - cur) // 2\n            layer -= 1\n            if layer > 0:\n                cur = (1 << layer) - 1 - offset\n            else:\n                cur = 0\n    ans.reverse()\n    return ans\n", "entry_point": "generate_pattern", "input": "9", "output": "[9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97890_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024674", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "'UPPORT_METHOD: RL:'", "output": "{'UPPORT_METHOD': 'RL:'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024675", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "process_circular_list", "input": "[30, 4, 7, -4, 8, 0, 6, -3]", "output": "[34, 11, 3, 4, 8, 6, 3, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20179_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024676", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'abcde1234!'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024677", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "2.335, 1", "output": "2.335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024678", "code": "def calculate_regression_coefficients(x, y):\n    if len(x) != len(y):\n        raise ValueError(\"Input lists x and y must have the same length\")\n    n = len(x)\n    mean_x = sum(x) / n\n    mean_y = sum(y) / n\n    SS_xx = sum((xi - mean_x) ** 2 for xi in x)\n    SS_xy = sum((xi - mean_x) * (yi - mean_y) for xi, yi in zip(x, y))\n    b_1 = SS_xy / SS_xx if SS_xx != 0 else 0  # Avoid division by zero\n    b_0 = mean_y - b_1 * mean_x\n    return b_0, b_1\n", "entry_point": "calculate_regression_coefficients", "input": "[0, 1, 2], [1.0, 2.0, 3.0]", "output": "(1.0, 1.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83034_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024679", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[91, 86, 86, 80, 75]", "output": "[91, 86, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4735", "output": "{1, 947, 5, 4735}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4734", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024681", "code": "def replace_non_bmp_chars(input_string: str, replacement_char: str) -> str:\n    return ''.join(replacement_char if ord(char) > 0xFFFF else char for char in input_string)\n", "entry_point": "replace_non_bmp_chars", "input": "'Helloo,', 'X'", "output": "'Helloo,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91568_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024682", "code": "def generate_species_section(type_translator):\n    species_section = '\\nspecies\\n'\n    for spec in type_translator:\n        name = type_translator[spec]\n        species_section += f'{name} {spec}\\n'\n    return species_section\n", "entry_point": "generate_species_section", "input": "{}", "output": "'\\nspecies\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62317_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024683", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'kitten', 'sitting'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024684", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, 3, -1, -2]", "output": "(3, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024685", "code": "def wheel(pos):\n    if pos < 0 or pos > 255:\n        return (0, 0, 0)\n    if pos < 85:\n        return (255 - pos * 3, pos * 3, 0)\n    if pos < 170:\n        pos -= 85\n        return (0, 255 - pos * 3, pos * 3)\n    pos -= 170\n    return (pos * 3, 0, 255 - pos * 3)\n", "entry_point": "wheel", "input": "44", "output": "(123, 132, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16803_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024686", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[1, 1, 2, 2, 3, 3, 4, 6]", "output": "[6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024687", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[1, 3, 1, 2, 6, 3, 4, 5, -1, 2, 3, 6]", "output": "[1, 3, 2, 6, 4, 5, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024688", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "1.609152, -2.0", "output": "-3.8274559999999997", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024689", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "2", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024690", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[95, 90, 79, 89, 85, 80], 4", "output": "[95, 90, 79, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024691", "code": "import math\ndef calculate_eccentric_anomaly(M, e):\n    E1 = M  # Initialise eccentric anomaly\n    residual = 1.0  # Initialise convergence residual\n    while residual >= 0.00001:\n        fn = E1 - (e*math.sin(E1)) - M\n        fd = 1 - (e*math.cos(E1))\n        E2 = E1 - (fn/fd)\n        residual = abs(E2 - E1)  # Compute residual\n        E1 = E2  # Update the eccentric anomaly\n    return E2\n", "entry_point": "calculate_eccentric_anomaly", "input": "1.5, 0.5", "output": "1.962189287578572", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115320_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024692", "code": "def filter_strings(strings, exclude_count):\n    filtered_strings = []\n    for string in strings:\n        if len(string) - exclude_count > 0:\n            filtered_strings.append(string)\n    return filtered_strings\n", "entry_point": "filter_strings", "input": "['a', 'b'], 1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140294_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024693", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=Alice'", "output": "{'name': 'Alice'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024694", "code": "def calculate_panel_area(TMCompletePanelWidth, GridSize, TMCompletePageHeight):\n    width = TMCompletePanelWidth - GridSize\n    height = TMCompletePageHeight / 7\n    area = width * height\n    return area\n", "entry_point": "calculate_panel_area", "input": "20.0, 10.0, 630.0", "output": "900.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103523_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024695", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8453", "output": "{1, 107, 8453, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024696", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[2, 1, 5, 2, 4, 2, 1, 3], 0", "output": "[2, 1, 5, 2, 4, 2, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024697", "code": "def encrypt_string(input_string, key):\n    if not key:\n        return input_string\n    encrypted_chars = []\n    key_length = len(key)\n    for i, char in enumerate(input_string):\n        key_char = key[i % key_length]\n        shift = ord(key_char)\n        encrypted_char = chr((ord(char) + shift) % 256)\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_string", "input": "'r}v\\x84', 'a'", "output": "'\u00d3\u00de\u00d7\u00e5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43650_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024698", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[-3, 0, 4, 1, 3, 5, 8]", "output": "[-3, 1, 6, 4, 7, 10, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116592_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024699", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3182", "output": "{1, 2, 37, 74, 43, 3182, 86, 1591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024700", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "'Header'", "output": "'Header\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024701", "code": "def process_commands(input_str):\n    running_total = 0\n    commands = input_str.split()\n    for command in commands:\n        op = command[0]\n        if len(command) > 1:\n            num = int(command[1:])\n        else:\n            num = 0\n        if op == 'A':\n            running_total += num\n        elif op == 'S':\n            running_total -= num\n        elif op == 'M':\n            running_total *= num\n        elif op == 'D' and num != 0:\n            running_total //= num\n        elif op == 'R':\n            running_total = 0\n    return running_total\n", "entry_point": "process_commands", "input": "'S3'", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106417_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024702", "code": "def factorial_digit_sum(n):\n    def factorial(num):\n        if num == 0:\n            return 1\n        return num * factorial(num - 1)\n    fact = factorial(n)\n    digit_sum = sum(int(digit) for digit in str(fact))\n    return digit_sum\n", "entry_point": "factorial_digit_sum", "input": "9", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75892_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024703", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[1, 2, 3, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024704", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "1.0", "output": "3.14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119846_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024705", "code": "import json\ndef process_post_request(request_body: str) -> str:\n    try:\n        post_data = json.loads(request_body)\n    except json.JSONDecodeError:\n        return 'Invalid Request'\n    if 'status' not in post_data:\n        return 'Invalid Request'\n    status = post_data['status']\n    if not isinstance(status, int):\n        return 'Invalid Status'\n    if status == 200:\n        return 'Status OK'\n    elif status == 404:\n        return 'Status Not Found'\n    else:\n        return 'Unknown Status'\n", "entry_point": "process_post_request", "input": "'{\"status\": 404}'", "output": "'Status Not Found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39582_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024706", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[2, 3, 4, 4, 5, 6]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024707", "code": "def calculate_average_without_negatives(numbers):\n    positive_sum = 0\n    positive_count = 0\n    for num in numbers:\n        if num >= 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        average = positive_sum / positive_count\n        return average\n    else:\n        return 0  # Return 0 if the list is empty or contains only negative numbers\n", "entry_point": "calculate_average_without_negatives", "input": "[10, 5]", "output": "7.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106804_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024708", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "9, 2", "output": "36.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024709", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4516", "output": "{1, 2, 4516, 4, 1129, 2258}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4515", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024710", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'brown', 5", "output": "['brown']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024711", "code": "def generate_dag_identifier(dag_name, schedule_interval):\n    return f\"{dag_name}_{schedule_interval.replace(' ', '_')}\"\n", "entry_point": "generate_dag_identifier", "input": "'dmmd', '0 1 ***'", "output": "'dmmd_0_1_***'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48509_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024712", "code": "def extract_comments_from_script(script):\n    comments = []\n    for line in script.split('\\n'):\n        line = line.strip()\n        if line.startswith('#'):\n            comments.append(line)\n    return comments\n", "entry_point": "extract_comments_from_script", "input": "'   ###ss\\nThis is not a comment.\\nAnother line.'", "output": "['###ss']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99748_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6499", "output": "{1, 67, 6499, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024714", "code": "def is_leap_year(year):\n    if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):\n        return True\n    else:\n        return False\n", "entry_point": "is_leap_year", "input": "2020", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46329_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024715", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'Tilonighs'", "output": "'Tilonighs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024716", "code": "_MIN_SERIAL = 10000000\ndef validate_serial_number(serial_number):\n    return serial_number >= _MIN_SERIAL\n", "entry_point": "validate_serial_number", "input": "9999999", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29014_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024717", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[5, 6, 3, 7, 8], 100, 6", "output": "[5, 100, 3, 100, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4237", "output": "{1, 19, 4237, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024719", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(5, 10), 'fan_in'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024720", "code": "def find_unique_pairs(lst, target):\n    unique_pairs = set()\n    complements = set()\n    for num in lst:\n        complement = target - num\n        if complement in complements:\n            unique_pairs.add((min(num, complement), max(num, complement)))\n        else:\n            complements.add(num)\n    return list(unique_pairs)\n", "entry_point": "find_unique_pairs", "input": "[0, 1, 3, 4], 4", "output": "[(1, 3), (0, 4)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29529_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024721", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "95", "output": "{50: 1, 20: 2, 10: 0, 1: 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024722", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024723", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=Alice age=rk'", "output": "{'name': 'Alice', 'age': 'rk'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024724", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "[0, 8, 10, -1, 4, 3, 4]", "output": "'0.8.10.-1.4.3.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024725", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, 50.05015045135406", "output": "50.05015045135406", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024726", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/path/to/some-file.tx'", "output": "'some-file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024727", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "2", "output": "'11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024728", "code": "OUT_RECALL = 0.9\nOUT_PRECISION = 0.8\ndef weighted_average(recall: float, precision: float) -> float:\n    weighted_avg = (OUT_RECALL * recall + OUT_PRECISION * precision) / (OUT_RECALL + OUT_PRECISION)\n    return weighted_avg\n", "entry_point": "weighted_average", "input": "-2, 0.70375", "output": "-0.7276470588235294", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17070_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024729", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[0, 1, 4, -7]", "output": "-28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024730", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[91.0]", "output": "91.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024731", "code": "def version_to_string(version):\n    return '.'.join(map(str, version))\n", "entry_point": "version_to_string", "input": "[0, 10, 8, 4, 7, 0]", "output": "'0.10.8.4.7.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90647_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024732", "code": "def can_rearrange_string(S):\n    char_count = {}\n    for char in S:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    for count in char_count.values():\n        if count != 2:\n            return \"No\"\n    return \"Yes\"\n", "entry_point": "can_rearrange_string", "input": "'aabb'", "output": "'Yes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92815_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024733", "code": "import os\ndef expand_env_variables(file_path):\n    def replace_env_var(match):\n        var_name = match.group(1)\n        return os.environ.get(var_name, f'%{var_name}%')\n    expanded_path = os.path.expandvars(file_path)\n    return expanded_path\n", "entry_point": "expand_env_variables", "input": "'%%LOCLAPdat'", "output": "'%%LOCLAPdat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91923_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024734", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8234", "output": "{1, 2, 358, 8234, 46, 179, 4117, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024735", "code": "# Implement the _deserial method to reverse the serialization process\ndef _deserial(serialized_obj):\n    # Assuming dataserializer.serialize returns a string representation of the object\n    # Here, we simply reverse the serialization by converting the string back to the original object\n    return eval(serialized_obj)\n", "entry_point": "_deserial", "input": "'4'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113073_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024736", "code": "def find_longest_common_prefix(strings):\n    if not strings:\n        return \"\"\n    lcp = \"\"\n    base = strings[0]\n    for i in range(len(base)):\n        for s in strings[1:]:\n            if i > len(s) - 1 or base[i] != s[i]:\n                return lcp\n        lcp += base[i]\n    return lcp\n", "entry_point": "find_longest_common_prefix", "input": "['flower', 'flight', 'flame']", "output": "'fl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43040_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024737", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num: int) -> bool:\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if isinstance(num, int) and is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 7, 11, 13, 19]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148587_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024738", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "6", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024739", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-725], 1", "output": "-725.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024740", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7292", "output": "{1, 2, 4, 7292, 3646, 1823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7291", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024741", "code": "def reorganize_events(events):\n    reorganized_events = []\n    prev = events[0]  # Initialize prev with the first event\n    # Reorganize events based on the inferred rule\n    for event in events:\n        # Implement the reorganization rule here\n        # For illustration purposes, let's assume the rule is to append events in reverse order\n        reorganized_events.insert(0, event)\n    return reorganized_events\n", "entry_point": "reorganize_events", "input": "['event1', 'event2', 'event3']", "output": "['event3', 'event2', 'event1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39084_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024742", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "124", "output": "'2:04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024743", "code": "def total_balance(transactions):\n    total = 0.0\n    for transaction in transactions:\n        total += transaction[\"amount\"]\n    return round(total, 2)\n", "entry_point": "total_balance", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65498_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024744", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[12, 11, 10, 8, 0, 5, 5, 0]", "output": "[0, 0, 5, 5, 8, 10, 11, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024745", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'33.114'", "output": "(33, 114)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024746", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[10, 5, 4, 10, 6]", "output": "[10, 4, 10, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024747", "code": "from typing import List\ndef count_unique_event_types(events: List[str]) -> int:\n    unique_events = set()\n    for event in events:\n        unique_events.add(event.lower())\n    return len(unique_events)\n", "entry_point": "count_unique_event_types", "input": "['Concert', 'concert', 'Workshop', 'workshop', 'Seminar']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14474_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024748", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[2, 2]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024749", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'120.12.11', 8078", "output": "'http://120.12.11:8078'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024750", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'11.1..'", "output": "'11.1..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024751", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.11.201'", "output": "(0, 11, 201)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6471", "output": "{1, 3, 6471, 9, 2157, 719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024753", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7631", "output": "{1, 587, 13, 7631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024754", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[5, 5, 4, 3, 0, 3, 1]", "output": "[5, 4, 3, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024755", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'in'", "output": "('in', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024756", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[-2, 0, 0, 0, 1, 1]", "output": "[-4, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024757", "code": "import re\nimport string\ndef convert_data(data_str):\n    if re.match(r'^-?\\d+$', data_str):  # Integer\n        return int(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+$', data_str):  # Float\n        return float(data_str)\n    elif re.match(r'^-?\\d+\\.\\d+i-?\\d+\\.\\d+$', data_str):  # Complex number\n        real, imag = map(float, re.findall(r'-?\\d+\\.\\d', data_str))\n        return complex(real, imag)\n    elif data_str.startswith(\"c(\") and data_str.endswith(\")\"):  # R language vector\n        data = re.findall(r'-?\\d+\\.\\d+|-?\\d+', data_str)\n        return [float(num) if '.' in num else int(num) for num in data]\n    else:  # String\n        return data_str\n", "entry_point": "convert_data", "input": "'1, 31i5 + '", "output": "'1, 31i5 + '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147310_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1521", "output": "{1, 3, 39, 9, 169, 13, 1521, 117, 507}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024759", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4772", "output": "{1, 2, 4, 4772, 1193, 2386}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4771", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024760", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[97]", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024761", "code": "SUFFIX = {'ng': 1e-9, '\u00b5g': 1e-6, 'ug': 1e-6, 'mg': 1e-3, 'g': 1, 'kg': 1e3}\ndef convert_weight(weight, from_suffix, to_suffix):\n    if from_suffix not in SUFFIX or to_suffix not in SUFFIX:\n        return \"Invalid suffix provided\"\n    # Convert weight to base unit (grams)\n    weight_in_grams = weight * SUFFIX[from_suffix]\n    # Convert base unit to target unit\n    converted_weight = weight_in_grams / SUFFIX[to_suffix]\n    return round(converted_weight, 2)\n", "entry_point": "convert_weight", "input": "2000.0, 'kg', 'g'", "output": "2000000.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21722_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024762", "code": "def class_name_normalize(class_name):\n    \"\"\"\n    Converts a string into a standardized class name format.\n    Args:\n    class_name (str): The input string with words separated by underscores.\n    Returns:\n    str: The converted class name format with each word starting with an uppercase letter followed by lowercase letters.\n    \"\"\"\n    part_list = []\n    for item in class_name.split(\"_\"):\n        part_list.append(\"{}{}\".format(item[0].upper(), item[1:].lower()))\n    return \"\".join(part_list)\n", "entry_point": "class_name_normalize", "input": "'suuge'", "output": "'Suuge'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55201_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4805", "output": "{1, 961, 5, 4805, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4804", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024764", "code": "def categorize_students(scores):\n    groups = {'A': [], 'B': [], 'C': []}\n    for score in scores:\n        if score >= 80:\n            groups['A'].append(score)\n        elif 60 <= score <= 79:\n            groups['B'].append(score)\n        else:\n            groups['C'].append(score)\n    return groups\n", "entry_point": "categorize_students", "input": "[86, 62, 61, 53, 59]", "output": "{'A': [86], 'B': [62, 61], 'C': [53, 59]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63935_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024765", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "2, 4", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024766", "code": "from collections import defaultdict\ndef find_shortest_subarray(arr):\n    freq = defaultdict(list)\n    for i, num in enumerate(arr):\n        freq[num].append(i)\n    max_freq = max(len(indices) for indices in freq.values())\n    shortest_length = float('inf')\n    for indices in freq.values():\n        if len(indices) == max_freq:\n            shortest_length = min(shortest_length, indices[-1] - indices[0] + 1)\n    return shortest_length\n", "entry_point": "find_shortest_subarray", "input": "[1, 2, 2, 1, 2, 3, 4, 2]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30490_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024767", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'p w o r l d p w o r l d'", "output": "['p', 'w', 'o', 'r', 'l', 'd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024768", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "0, 13, 3", "output": "27.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024769", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello, my name is Thomas. th'", "output": "'Thomas th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7465", "output": "{1493, 1, 5, 7465}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7464", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024771", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[3, 5, 2, 3, 3, 3, 5, 2, 4]", "output": "[3, 3, 5, 3, 2, 5, 3, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024772", "code": "def calculate_average_forward_adjust_factor(adjust_factor_data, target_exchange):\n    total_forward_adjust_factor = 0\n    total_stock_count = 0\n    for symbol, stock_data_list in adjust_factor_data.items():\n        for stock_data in stock_data_list:\n            if stock_data['exchange'] == target_exchange:\n                total_forward_adjust_factor += stock_data['foreAdjustFactor']\n                total_stock_count += 1\n    if total_stock_count == 0:\n        return 0  # Return 0 if no stocks found for the target exchange\n    average_forward_adjust_factor = total_forward_adjust_factor / total_stock_count\n    return average_forward_adjust_factor\n", "entry_point": "calculate_average_forward_adjust_factor", "input": "{}, 'NYSE'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142195_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024773", "code": "def generate_url(owner, repo, token_auth):\n    return f'{owner}/{repo}/{token_auth}/'\n", "entry_point": "generate_url", "input": "'john_dojoh', 'mproject', 'aab123'", "output": "'john_dojoh/mproject/aab123/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8083_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024774", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>Thiample abstract.</p><p>act.a</p>'", "output": "'Thiample abstract.</p><p>act.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024775", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[90, 88, 85, 70, 75]", "output": "[90, 88, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57187_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024776", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "12345", "output": "'VCode-12345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024777", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9905", "output": "{1, 35, 5, 7, 1415, 9905, 283, 1981}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024778", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 3, 4, 4, 3, 2, 0, 1, 0]", "output": "[3, 8, 12, 12, 10, 0, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77019_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024779", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "100, 48", "output": "148", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024780", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[10, [10, 10], [6]]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024781", "code": "from typing import List\ndef process_image(pixels: List[int]) -> List[int]:\n    result = []\n    for pixel in pixels:\n        result.append(pixel * 2)\n    return result\n", "entry_point": "process_image", "input": "[75, 51, 50, 50, 50, 50, 50]", "output": "[150, 102, 100, 100, 100, 100, 100]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142011_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8515", "output": "{1, 65, 8515, 131, 5, 1703, 13, 655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024783", "code": "def get_image_size(data, default_size):\n    if data.lower() == 'cub_200_2011':\n        return 224\n    elif data.lower() == 'dogs':\n        return 224\n    elif data.lower() == 'mit67':\n        return 224\n    elif data.lower() == 'stanford40':\n        return 224\n    else:\n        return default_size\n", "entry_point": "get_image_size", "input": "'unknown_data', 221", "output": "221", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63891_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024784", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'local_rank: 0, n_gpu: 4'", "output": "{'local_rank': 0, 'n_gpu': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024785", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'aaaccuracy__a_'", "output": "'aaaccuracy__a_'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024786", "code": "def quaternion_dot_product(q1, q2):\n    dot_product = sum(q1[i] * q2[i] for i in range(4))\n    return dot_product\n", "entry_point": "quaternion_dot_product", "input": "(10, 20, 30, 10), (1, 1, 1, 1)", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19068_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024787", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'0112.345/61.890.3170'", "output": "('0112.345', '61.890.3170')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024788", "code": "def find_larger(a, b):\n    avg = (a + b) / 2\n    diff_a = abs(avg - a)\n    diff_b = abs(avg - b)\n    return avg + diff_a\n", "entry_point": "find_larger", "input": "16.0, 0", "output": "16.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28640_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024789", "code": "def get_min_val(lrecords, i):\n    min_val = float('inf')  # Initialize with a value greater than any possible value\n    for sublist in lrecords:\n        if sublist[i] < min_val:\n            min_val = sublist[i]\n    return min_val\n", "entry_point": "get_min_val", "input": "[[3], [5], [-8], [10], [0]], 0", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56826_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024790", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "309", "output": "{1, 3, 309, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3767", "output": "{1, 3767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024792", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[3, 7, 10]", "output": "[3, 8, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024793", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "-4.0", "output": "-1.528", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024794", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "793.0875, 2", "output": "793.0625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024795", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "1, 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024796", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1412", "output": "{1, 2, 706, 1412, 4, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1411", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4318", "output": "{1, 2, 34, 2159, 17, 254, 4318, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4317", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8507", "output": "{1, 8507, 181, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024799", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[100, 101, 100, 99]", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4552", "output": "{1, 2, 2276, 4, 4552, 8, 1138, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4551", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024801", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'banana\\norange', 'applaa banana'", "output": "['applaa']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024802", "code": "def count_increasing_sums(lst):\n    num_increased = 0\n    for i in range(len(lst) - 2):\n        if lst[i] + lst[i+1] < lst[i+1] + lst[i+2]:\n            num_increased += 1\n    return num_increased\n", "entry_point": "count_increasing_sums", "input": "[1, 2, 3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14820_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024803", "code": "import string\ndef count_word_occurrences(text):\n    def clean_word(word):\n        return word.strip(string.punctuation).lower()\n    word_counts = {}\n    words = text.split()\n    for word in words:\n        cleaned_word = clean_word(word)\n        if cleaned_word:\n            word_counts[cleaned_word] = word_counts.get(cleaned_word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'helwo,sallold'", "output": "{'helwo,sallold': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4386_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024804", "code": "def longest_substring_within_budget(s, costs, budget):\n    start = 0\n    end = 0\n    current_cost = 0\n    max_length = 0\n    n = len(s)\n    while end < n:\n        current_cost += costs[ord(s[end]) - ord('a')]\n        while current_cost > budget:\n            current_cost -= costs[ord(s[start]) - ord('a')]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_substring_within_budget", "input": "'', [], 10", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17714_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024805", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "4.953644233454342, 10, 2", "output": "-2.523177883272829", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7259", "output": "{1, 7, 427, 1037, 17, 119, 7259, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024807", "code": "def calculate_product(nums):\n    product = 1\n    for num in nums:\n        if num != 0:\n            product *= num\n    return product\n", "entry_point": "calculate_product", "input": "[5, 100]", "output": "500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25506_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5521", "output": "{1, 5521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5520", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024809", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "20", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024810", "code": "def concatenate_vectors(vector_arrays):\n    concatenated_list = []\n    for vector_array in vector_arrays:\n        for vector in vector_array:\n            concatenated_list.append(vector)\n    return concatenated_list\n", "entry_point": "concatenate_vectors", "input": "[[4, 4], [5]]", "output": "[4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15071_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024811", "code": "import math\ndef find_max_ceiling_index(n, m, s):\n    mx = 0\n    ind = 0\n    for i in range(n):\n        if math.ceil(s[i] / m) >= mx:\n            mx = math.ceil(s[i] / m)\n            ind = i\n    return ind + 1\n", "entry_point": "find_max_ceiling_index", "input": "5, 2, [1, 2, 3, 4, 10]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97191_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9439", "output": "{1, 9439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024813", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 2, 4, 1, 3, 4, 2, 2]", "output": "[4, 6, 5, 4, 7, 6, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34035_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024814", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9941", "output": "{1, 9941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024815", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'4\\n'", "output": "[['4']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024816", "code": "def collatz_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = 3 * n + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "collatz_sequence", "input": "10", "output": "[10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16527_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024817", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'mSh '", "output": "('mSh', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024818", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[70]", "output": "[70]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39897_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8261", "output": "{1, 11, 8261, 751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8260", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024820", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "4, -3, -1", "output": "'4.-3.-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024821", "code": "ADMIN_THEME = \"admin\"\nDEFAULT_THEME = \"core\"\ndef get_theme(theme_name):\n    if theme_name == ADMIN_THEME:\n        return ADMIN_THEME\n    elif theme_name == DEFAULT_THEME:\n        return DEFAULT_THEME\n    else:\n        return \"Theme not found\"\n", "entry_point": "get_theme", "input": "'admin'", "output": "'admin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36609_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024822", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        if i == 0:\n            result.append(lst[i] + lst[i+1])\n        elif i == len(lst) - 1:\n            result.append(lst[i-1] + lst[i])\n        else:\n            result.append(lst[i-1] + lst[i] + lst[i+1])\n    return result\n", "entry_point": "process_list", "input": "[3, 5, 5, 3, 6, 2, 0, 5]", "output": "[8, 13, 13, 14, 11, 8, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145647_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024823", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[91, 90, 90, 85, 75]", "output": "[91, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024824", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[5, 3, 6, 10, 7, 1]", "output": "['Buzz', 'Fizz', 'Fizz', 'Buzz', 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024825", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 3, 2, 5, 1, 4]", "output": "[3, 5, 7, 6, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024826", "code": "import ast\ndef extract_static_settings(code_snippet):\n    settings_dict = {}\n    # Split the code snippet into lines\n    lines = code_snippet.strip().split('\\n')\n    for line in lines:\n        if 'STATIC' in line:\n            key, value = line.split(' = ')\n            key = key.strip()\n            try:\n                value = ast.literal_eval(value)\n            except (SyntaxError, ValueError):\n                value = value.strip()\n            settings_dict[key] = value\n    static_settings = {k: v for k, v in settings_dict.items() if 'STATIC' in k}\n    return static_settings\n", "entry_point": "extract_static_settings", "input": "'\\nx = 5\\ny = \"hello\"\\nfoo = [1, 2, 3]\\n'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91173_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024827", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 5, 2, 3, 3, 3]", "output": "[7, 9, 7, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127750_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024828", "code": "from unicodedata import normalize\n# Given data from the code snippet\nMAPPINGS = {\n    \"git\": {\"norm\": [\"g\", \"i\", \"t\"], \"ipa\": [\"\u0261\", \"\u026a\", \"t\"]},\n    \"moh\": {\"norm\": [\"m\", \"o\", \"h\"], \"ipa\": [\"m\", \"o\u028a\", \"h\"]},\n    \"str\": {\"norm\": [\"s\", \"t\", \"r\"], \"ipa\": [\"s\", \"t\", \"\u0279\"]}\n}\nIPA = {\n    k: [\n        normalize(\"NFC\", c)\n        for cs in [x for x in MAPPINGS[k][\"ipa\"]]\n        for c in cs.split()\n    ]\n    for k in MAPPINGS.keys()\n}\ndef generate_ipa(word):\n    if word in MAPPINGS:\n        return IPA[word]\n    else:\n        return None\n", "entry_point": "generate_ipa", "input": "'git'", "output": "['\u0261', '\u026a', 't']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35855_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "173", "output": "{1, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024830", "code": "from typing import List\ndef count_unique_ips(ip_ranges: List[str]) -> int:\n    total_ips = 0\n    for ip_range in ip_ranges:\n        ip, subnet_mask = ip_range.split('/')\n        subnet_mask = int(subnet_mask)\n        total_ips += 2**(32 - subnet_mask)\n    return total_ips\n", "entry_point": "count_unique_ips", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115362_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024831", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "1, 0", "output": "('1', '0')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024832", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9665", "output": "{1, 9665, 5, 1933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024833", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3403", "output": "{1, 83, 3403, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024834", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    camel_case = words[0] + ''.join(word.capitalize() for word in words[1:])\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'this_is_a_sample'", "output": "'thisIsASample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46573_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024835", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "7", "output": "[0, 0, 1, 3, 6, 2, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024836", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "93", "output": "0.5166666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3368", "output": "{1, 2, 4, 421, 3368, 8, 842, 1684}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3367", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024838", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8074", "output": "{1, 2, 4037, 8074, 11, 367, 22, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024839", "code": "def generate_sheet_type_summary(songs):\n    sheet_type_counts = {}\n    for song in songs:\n        sheet_type = song.get(\"sheet_type\")\n        sheet_type_counts[sheet_type] = sheet_type_counts.get(sheet_type, 0) + 1\n    return sheet_type_counts\n", "entry_point": "generate_sheet_type_summary", "input": "[{'sheet_type': None}]", "output": "{None: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111461_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024840", "code": "from typing import List\ndef max_stairs_sum(steps: List[int]) -> int:\n    if not steps:\n        return 0\n    if len(steps) == 1:\n        return steps[0]\n    n1 = steps[0]\n    n2 = steps[1]\n    for i in range(2, len(steps)):\n        t = steps[i] + max(n1, n2)\n        n1, n2 = n2, t\n    return max(n1, n2)\n", "entry_point": "max_stairs_sum", "input": "[10, 0, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100230_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024841", "code": "from typing import List\ndef max_visible_buildings(buildings: List[int]) -> int:\n    if not buildings:\n        return 0\n    n = len(buildings)\n    lis = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if buildings[i] > buildings[j] and lis[i] < lis[j] + 1:\n                lis[i] = lis[j] + 1\n    return max(lis)\n", "entry_point": "max_visible_buildings", "input": "[1, 3, 2, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100979_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024842", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "119", "output": "{1, 7, 17, 119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024843", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[0, 2, 3, 1, 4, 9]", "output": "[0, 3, 5, 4, 8, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024844", "code": "def count_framework_usage(projects):\n    framework_count = {}\n    for project in projects:\n        for framework in project['frameworks']:\n            framework_count[framework] = framework_count.get(framework, 0) + 1\n    return framework_count\n", "entry_point": "count_framework_usage", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41020_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024845", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[5, 4]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024846", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    # Use regular expression to extract words while ignoring non-alphanumeric characters\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'oeelleo'", "output": "{'oeelleo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115848_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024847", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'89,1123,6'", "output": "{89, 1123, 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024848", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    # Sort the dictionary by values in descending order\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "word_frequency", "input": "'hwhlll'", "output": "{'hwhlll': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86121_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024849", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'muupowery', 1, 2", "output": "\"Error: Invalid operation type 'muupowery'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024850", "code": "def process_list(input_list, threshold):\n    modified_list = []\n    current_sum = 0\n    for num in input_list:\n        if num < threshold:\n            modified_list.append(num)\n        else:\n            current_sum += num\n            modified_list.append(current_sum)\n    return modified_list\n", "entry_point": "process_list", "input": "[7, 4, 6, 8, 4, 9], 10", "output": "[7, 4, 6, 8, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129571_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024851", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'q quick', 1", "output": "('q', 'quick')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024852", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[0, 3, 3, 7, 3, 4, 1, 7]", "output": "[0, 4, 5, 10, 7, 9, 7, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60262_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024853", "code": "def reverse_words_in_string(input_string):\n    words = input_string.split()  # Split the input string into words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word\n    return ' '.join(reversed_words)  # Join the reversed words back together\n", "entry_point": "reverse_words_in_string", "input": "'storage'", "output": "'egarots'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137200_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024854", "code": "def extract_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'410.5.34'", "output": "(410, 5, 34)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11958_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024855", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[2, 4, 8]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024856", "code": "def calculate_f1_score(y_true, y_pred):\n    true_positives = sum([1 for true, pred in zip(y_true, y_pred) if true == 1 and pred >= 0.5])\n    predicted_positives = sum([1 for pred in y_pred if pred >= 0.5])\n    precision = true_positives / (predicted_positives + 1e-7)  # Adding epsilon to avoid division by zero\n    recall = true_positives / sum(y_true)\n    f1_score = 2 * ((precision * recall) / (precision + recall + 1e-7))\n    return f1_score\n", "entry_point": "calculate_f1_score", "input": "[1, 1, 1], [0.9, 0.8, 0.7]", "output": "0.9999999333333361", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_163_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024857", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "3, 34, 102", "output": "[34, 34, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024858", "code": "def encrypt_string(input_string, key):\n    if not key:\n        return input_string\n    encrypted_chars = []\n    key_length = len(key)\n    for i, char in enumerate(input_string):\n        key_char = key[i % key_length]\n        shift = ord(key_char)\n        encrypted_char = chr((ord(char) + shift) % 256)\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_string", "input": "'rlv', 'a'", "output": "'\u00d3\u00cd\u00d7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43650_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024859", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6801", "output": "{1, 6801, 3, 2267}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024860", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2713", "output": "{1, 2713}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024861", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[5, 5, 6, 6, 0, -1, 3, 2, 3, 2]", "output": "[5, 6, 0, -1, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024862", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'-3888'", "output": "-3888", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024863", "code": "def generate_setup_config_string(setup_config):\n    setup_str = \"\"\n    for key, value in setup_config.items():\n        if isinstance(value, list):\n            value = ', '.join(value)\n        setup_str += f\"{key}='{value}',\\n\"\n    return setup_str\n", "entry_point": "generate_setup_config_string", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36431_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024864", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "574", "output": "{1, 2, 7, 41, 14, 82, 574, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024865", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6205", "output": "{1, 5, 73, 365, 17, 85, 1241, 6205}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024866", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'LD'", "output": "'ld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024867", "code": "def skipVowels(word):\n    novowels = ''\n    for ch in word:\n        if ch.lower() in 'aeiou':\n            continue\n        novowels += ch\n    return novowels\n", "entry_point": "skipVowels", "input": "'watdohel'", "output": "'wtdhl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120866_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024868", "code": "def plus_one(digits):\n    n = len(digits)\n    for i in range(n-1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    new_num = [0] * (n+1)\n    new_num[0] = 1\n    return new_num\n", "entry_point": "plus_one", "input": "[1, 2, 3]", "output": "[1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123786_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024869", "code": "import logging\nLOG_LEVELS = {\n    \"CRITICAL\": logging.CRITICAL,\n    \"ERROR\": logging.ERROR,\n    \"WARNING\": logging.WARNING,\n    \"INFO\": logging.INFO,\n    \"DEBUG\": logging.DEBUG,\n}\nDEFAULT_LEVEL = \"WARNING\"\ndef convert_log_level(log_level):\n    return LOG_LEVELS.get(log_level, LOG_LEVELS.get(DEFAULT_LEVEL))\n", "entry_point": "convert_log_level", "input": "'ERROR'", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18272_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024870", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'aaaa'", "output": "'aaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024871", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[2, 4, 8, 4, 7, 9, 8, 7]", "output": "[2, 5, 10, 7, 11, 14, 14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024872", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "6", "output": "'\\t\\t\\t\\t\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024873", "code": "def calculate_quadrilateral_area(vertices):\n    n = len(vertices)\n    area = 0\n    for i in range(n):\n        j = (i + 1) % n\n        area += vertices[i][0] * vertices[j][1]\n        area -= vertices[j][0] * vertices[i][1]\n    area = abs(area) / 2\n    return area\n", "entry_point": "calculate_quadrilateral_area", "input": "[(0, 0), (0, 5), (5, 5), (5, 0)]", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57770_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024874", "code": "import re\n# Provided stopwords set\nstopwords = set([\"thank\", \"you\", \"the\", \"please\", \"me\", \"her\", \"his\", \"will\", \"just\", \"myself\", \"ourselves\", \"I\", \"yes\"])\n# Provided regular expression pattern for splitting\nspliter = re.compile(\"([#()!><])\")\ndef process_text(text):\n    tokens = []\n    for token in spliter.split(text):\n        token = token.strip()\n        if token and token not in stopwords:\n            tokens.append(token)\n    return tokens\n", "entry_point": "process_text", "input": "'Iift ! ! fIPlg'", "output": "['Iift', '!', '!', 'fIPlg']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45433_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024875", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'tesTi'", "output": "'tesTi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024876", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N > 0 else []\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "calculate_top_players_average", "input": "[90, 95, 100, 80], 2", "output": "97.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30456_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024877", "code": "def distance_to_camera(knownWidth, focalLength, perWidth):\n    # Compute and return the distance from the object to the camera\n    return (knownWidth * focalLength) / perWidth\n", "entry_point": "distance_to_camera", "input": "25, 149.16444444444443, 10", "output": "372.9111111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71888_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "233", "output": "{1, 233}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024879", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'10 * 3 + 5'", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024880", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7], 18", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024881", "code": "def find_repeated_element(A):\n    count_dict = {}\n    for num in A:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    repeated_element = max(count_dict, key=count_dict.get)\n    return repeated_element\n", "entry_point": "find_repeated_element", "input": "[5, 5, 1, 2]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99039_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024882", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'201..0.2100100deitht', '1.1..'", "output": "'1.1..201..0.2100100deitht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024883", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7799", "output": "{1, 11, 709, 7799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024884", "code": "import ast\ndef transform_input_to_eval(code):\n    # Parse the code snippet into an Abstract Syntax Tree (AST)\n    tree = ast.parse(code)\n    # Function to recursively traverse the AST and make the required changes\n    def transform_node(node):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'input':\n            # Replace input(...) with eval(input(...))\n            node.func = ast.Attribute(value=ast.Name(id='eval', ctx=ast.Load()), attr='input', ctx=ast.Load())\n        for child_node in ast.iter_child_nodes(node):\n            transform_node(child_node)\n    # Apply the transformation to the AST\n    transform_node(tree)\n    # Generate the modified code snippet from the transformed AST\n    modified_code = ast.unparse(tree)\n    return modified_code\n", "entry_point": "transform_input_to_eval", "input": "\"y = input('Enter a value: ')\"", "output": "\"y = eval.input('Enter a value: ')\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68294_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024885", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[4, 4, 9, 10, 10, 8]", "output": "[16, 16, 729, 100, 100, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9782", "output": "{1, 2, 67, 134, 73, 146, 9782, 4891}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024887", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[8, 0, 0, 7, 3, 0, 0, 3]", "output": "[8, 7, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024888", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3452", "output": "{1, 2, 4, 3452, 1726, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3451", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3826", "output": "{1, 3826, 2, 1913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024890", "code": "from typing import List\ndef sum_divisible_by_3_and_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30, 75]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80529_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024891", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'non_existent_key', 'ddefdevldalud'", "output": "'ddefdevldalud'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024892", "code": "def find_last_word_length(s: str) -> int:\n    reversed_string = s.strip()[::-1]  # Reverse the input string after removing leading/trailing spaces\n    length = 0\n    for char in reversed_string:\n        if char == ' ':\n            if length == 0:\n                continue\n            break\n        length += 1\n    return length\n", "entry_point": "find_last_word_length", "input": "'hello a     '", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93428_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024893", "code": "def trap(heights):\n    if not heights:\n        return 0\n    left, right = 0, len(heights) - 1\n    left_max, right_max = 0, 0\n    trapped_water = 0\n    while left < right:\n        if heights[left] < heights[right]:\n            if heights[left] >= left_max:\n                left_max = heights[left]\n            else:\n                trapped_water += left_max - heights[left]\n            left += 1\n        else:\n            if heights[right] >= right_max:\n                right_max = heights[right]\n            else:\n                trapped_water += right_max - heights[right]\n            right -= 1\n    return trapped_water\n", "entry_point": "trap", "input": "[1, 0, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54741_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2095", "output": "{1, 419, 5, 2095}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024895", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'gglea_fgg_', 10", "output": "'gglea_fgg__high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024896", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3422", "output": "{1, 2, 1711, 118, 58, 59, 29, 3422}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024897", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'HoH,o'", "output": "b'HoH,o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024898", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8983", "output": "{1, 691, 13, 8983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024899", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "-1, -0.07612536427576311", "output": "-0.038062682137881554", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024900", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6733", "output": "{1, 6733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024901", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "'Hd!!', '!'", "output": "'Hd!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4733", "output": "{1, 4733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4732", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024903", "code": "def absolute_reverse(lst):\n    result = []\n    for num in lst:\n        if num < 0:\n            result.append(-num)\n        else:\n            result.append(num)\n    return result[::-1]\n", "entry_point": "absolute_reverse", "input": "[5, -2, 5, -2, -2]", "output": "[2, 2, 5, 2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63160_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024904", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[0, 5, 4, 6, 1, 3, 5, 0, 6]", "output": "[0, 5, 4, 6, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024905", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "905", "output": "{1, 905, 5, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024906", "code": "def sum_greater_than_10(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 10:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_greater_than_10", "input": "[30, 35, 27]", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23086_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024907", "code": "def max_rectangle_area(buildings):\n    stack = []\n    max_area = 0\n    n = len(buildings)\n    for i in range(n):\n        while stack and buildings[i] < buildings[stack[-1]]:\n            height = buildings[stack.pop()]\n            width = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, height * width)\n        stack.append(i)\n    while stack:\n        height = buildings[stack.pop()]\n        width = n if not stack else n - stack[-1] - 1\n        max_area = max(max_area, height * width)\n    return max_area\n", "entry_point": "max_rectangle_area", "input": "[2, 1, 5, 6, 2, 3]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70831_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024908", "code": "EXCHANGES = ['binance', 'binanceus', 'coinbasepro', 'kraken']\nEXCHANGE_NAMES = ['Binance', 'Binance US', 'Coinbase Pro', 'Kraken']\nINTERVALS = ['1m', '5m', '15m', '30m', '1h', '12h', '1d']\ndef execute_trade(exchange_index, interval_index, trade_amount):\n    exchange_name = EXCHANGE_NAMES[exchange_index]\n    interval = INTERVALS[interval_index]\n    return f\"Trading {trade_amount} BTC on {exchange_name} at {interval} interval.\"\n", "entry_point": "execute_trade", "input": "1, 3, 0.5", "output": "'Trading 0.5 BTC on Binance US at 30m interval.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52795_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024909", "code": "def custom_replace(input_string: str, replacements: dict) -> str:\n    result = input_string\n    for key, value in replacements.items():\n        result = result.replace(key, value)\n    result = result.replace('It', 'Italic')  # Transformation logic for 'It'\n    result = result.replace('Regular', '')  # Transformation logic for 'Regular'\n    return result\n", "entry_point": "custom_replace", "input": "'awesoPu', {}", "output": "'awesoPu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32266_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024910", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'worlhe'", "output": "{'worlhe': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024911", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7025", "output": "{1, 5, 281, 7025, 25, 1405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7024", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024912", "code": "def calculate_total_epochs(batch_size, last_epoch, min_unit):\n    if last_epoch < min_unit:\n        return min_unit\n    else:\n        return last_epoch + min_unit\n", "entry_point": "calculate_total_epochs", "input": "32, 0, 5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134381_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024913", "code": "def extract_app_name(config_class_str):\n    # Find the index of 'name =' in the input string\n    name_index = config_class_str.find(\"name =\")\n    # Extract the substring starting from the app name\n    app_name_start = config_class_str.find(\"'\", name_index) + 1\n    app_name_end = config_class_str.find(\"'\", app_name_start)\n    # Return the extracted app name\n    return config_class_str[app_name_start:app_name_end]\n", "entry_point": "extract_app_name", "input": "\"name = 'ArkFundConfig(AppConfig)'\"", "output": "'ArkFundConfig(AppConfig)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66687_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024914", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'WOROLD'", "output": "'WOROLD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024915", "code": "def calculate_average_ascii(dataset):\n    char_count = {}\n    char_sum = {}\n    for data_point in dataset:\n        char = data_point[0]\n        ascii_val = ord(char)\n        if char in char_count:\n            char_count[char] += 1\n            char_sum[char] += ascii_val\n        else:\n            char_count[char] = 1\n            char_sum[char] = ascii_val\n    average_ascii = {char: char_sum[char] / char_count[char] for char in char_count}\n    return average_ascii\n", "entry_point": "calculate_average_ascii", "input": "['x', 'y', 'z']", "output": "{'x': 120.0, 'y': 121.0, 'z': 122.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54092_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024916", "code": "from typing import List\ndef two_sum(nums: List[int], target: int) -> List[int]:\n    seen = {}  # Dictionary to store elements and their indices\n    for idx, num in enumerate(nums):\n        complement = target - num\n        if complement in seen:\n            return [seen[complement], idx]\n        seen[num] = idx\n    return []\n", "entry_point": "two_sum", "input": "[2, 3, 1, 5], 7", "output": "[0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50190_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024917", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'100 + 83'", "output": "['183']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024918", "code": "from typing import List\ndef calculate_score(deck: List[int]) -> int:\n    score = 0\n    prev_card = None\n    for card in deck:\n        if card == prev_card:\n            score = 0\n        else:\n            score += card\n        prev_card = card\n    return score\n", "entry_point": "calculate_score", "input": "[5, 4, 3, 2]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107329_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024919", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'Alice', 'Smith', 'Marie'", "output": "'Alice Marie Smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024920", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4016", "output": "{1, 2, 4, 8, 1004, 4016, 16, 502, 2008, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4015", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024921", "code": "from typing import Tuple\nRGB = Tuple[int, int, int]\ndef hex_to_rgb(color_code: str) -> RGB:\n    # Extract the hexadecimal color code\n    color_code = color_code.lstrip('#').lstrip('0x')\n    # Convert the hexadecimal color code to RGB values\n    red = int(color_code[0:2], 16)\n    green = int(color_code[2:4], 16)\n    blue = int(color_code[4:6], 16)\n    return red, green, blue\n", "entry_point": "hex_to_rgb", "input": "'#123456'", "output": "(18, 52, 86)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29590_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024922", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[5, 3]", "output": "[5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024923", "code": "def top_and_tail(arr):\n    return arr[1:-1]\n", "entry_point": "top_and_tail", "input": "[1, 3, 7, 2, 5]", "output": "[3, 7, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86588_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024924", "code": "import re\ndef extract_unique_words(text):\n    # Split the text into words using regular expressions\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Return a sorted list of unique words\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'worl'", "output": "['worl']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87039_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9605", "output": "{1, 1921, 5, 9605, 17, 113, 565, 85}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024926", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 4]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115918_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7565", "output": "{1, 5, 1513, 7565, 17, 85, 89, 445}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024928", "code": "from typing import Tuple\ndef final_position(directions: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 'U':\n            y += 1\n        elif direction == 'D':\n            y -= 1\n        elif direction == 'L':\n            x -= 1\n        elif direction == 'R':\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "'UUR'", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93403_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024929", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "23, 4", "output": "'03:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024930", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'56+XYXZ'", "output": "('56', 'XYXZ', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024931", "code": "def delete_key(input_dict, key_to_delete):\n    if key_to_delete in input_dict:\n        del input_dict[key_to_delete]\n    return input_dict\n", "entry_point": "delete_key", "input": "{'some_key': 'some_value'}, 'some_key'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91728_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024932", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 5, 10, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024933", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(2, 5, 4, 4, 0, 5, 0, 0)", "output": "(0, 5, 4, 4, 0, 5, 0, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024934", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3321", "output": "{1, 3, 9, 41, 123, 369, 81, 1107, 3321, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024935", "code": "def translate_text(translations, text):\n    translated_words = []\n    for word in text.split():\n        translated_words.append(translations.get(word, word))\n    return ' '.join(translated_words)\n", "entry_point": "translate_text", "input": "{'rock': 'rock'}, 'rock,'", "output": "'rock,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45301_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024936", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'data/input'", "output": "'data/input_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024937", "code": "def get_covid_data(regions):\n    sample_data = {\n        \"England\": 1000,\n        \"Scotland\": 500,\n        \"Wales\": 300,\n        \"Northern Ireland\": 200\n    }\n    result = {}\n    for region in regions:\n        if region in sample_data:\n            result[region] = sample_data[region]\n        else:\n            result[region] = 0\n    return result\n", "entry_point": "get_covid_data", "input": "['Scotland']", "output": "{'Scotland': 500}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35707_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024938", "code": "import re\ndef clean_query(query: str) -> dict:\n    cleaned_query = query.upper()\n    if re.match(r'^AS\\d+$', cleaned_query):\n        return {\"cleanedValue\": cleaned_query, \"category\": \"asn\"}\n    elif cleaned_query.isalnum():\n        return {\"cleanedValue\": cleaned_query, \"category\": \"as-set\"}\n    else:\n        return {\"error\": \"Invalid query. A valid prefix is required.\"}\n", "entry_point": "clean_query", "input": "'AS64500'", "output": "{'cleanedValue': 'AS64500', 'category': 'asn'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106273_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024939", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2726", "output": "{1, 2, 2726, 47, 1363, 58, 29, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8891", "output": "{523, 1, 8891, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024941", "code": "from typing import List\ndef calculate_shopping_cart_total(product_names: List[str], product_prices: List[float]) -> float:\n    if len(product_names) != len(product_prices):\n        return -1\n    if not product_names or not product_prices:\n        return 0\n    total_amount = sum(product_prices)\n    return total_amount\n", "entry_point": "calculate_shopping_cart_total", "input": "['Apple', 'Banana', 'Orange'], [1.0, 0.5]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63450_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024942", "code": "def generate_feature_names(number_of_gaussians):\n    feature_names = []\n    for i in range(number_of_gaussians):\n        feature_names += [f'mu{i+1}', f'sd{i+1}']\n    for i in range(number_of_gaussians):\n        for j in range(i+1, number_of_gaussians):\n            feature_names.append(f'overlap {i+1}-{j+1}')\n    return feature_names\n", "entry_point": "generate_feature_names", "input": "2", "output": "['mu1', 'sd1', 'mu2', 'sd2', 'overlap 1-2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61755_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024943", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate the average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average_score)  # Return the average score as an integer\n", "entry_point": "calculate_average", "input": "[60, 70, 71, 72, 90]", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53668_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024944", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'hot dsish'", "output": "'hot_dsish'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024945", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[1, 3, 5, 5, 3, 2, 3, 5, 4], -2, 9", "output": "[1, 3, 5, 5, 3, 2, 3, 5, 4, -2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024946", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'lAlicelee', '2023 Local Election'", "output": "'Sample Election: lAlicelee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024947", "code": "def extract_y_coordinates(coordinates):\n    y_coordinates = []  # Initialize an empty list to store y-coordinates\n    for coord in coordinates:\n        y_coordinates.append(coord[1])  # Extract y-coordinate (index 1) and append to the list\n    return y_coordinates\n", "entry_point": "extract_y_coordinates", "input": "[(0, 5), (1, 7), (2, 3)]", "output": "[5, 7, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19900_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024948", "code": "from typing import List\ndef calculate_sum_max_odd(input_list: List[int]) -> int:\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd if sum_even > 0 else 0\n", "entry_point": "calculate_sum_max_odd", "input": "[2, 4, 63]", "output": "378", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134591_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024949", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[1, 3, 4, 3, 1, 2]", "output": "[4, 7, 7, 4, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024950", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "675", "output": "{1, 225, 3, 675, 5, 135, 9, 75, 45, 15, 25, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt674", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024951", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'linear_acceleration'", "output": "'Value of linear_acceleration'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024952", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6587", "output": "{1, 6587, 941, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024953", "code": "def calculate_dot_product(vector1, vector2):\n    min_len = min(len(vector1), len(vector2))\n    dot_product_result = sum(vector1[i] * vector2[i] for i in range(min_len))\n    return dot_product_result\n", "entry_point": "calculate_dot_product", "input": "[7], [7]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135589_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024954", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3558", "output": "{1, 2, 3, 1186, 3558, 6, 593, 1779}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4299", "output": "{3, 1, 1433, 4299}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024956", "code": "NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION = 0\nNOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION = 1\nNOTIFICATION_REPORTED_AS_FALLACY = 2\nNOTIFICATION_FOLLOWED_A_SPEAKER = 3\nNOTIFICATION_SUPPORTED_A_DECLARATION = 4\nNOTIFICATION_TYPES = (\n    (NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION, \"added-declaration-for-resolution\"),\n    (NOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION, \"added-declaration-for-declaration\"),\n    (NOTIFICATION_REPORTED_AS_FALLACY, \"reported-as-fallacy\"),\n    (NOTIFICATION_FOLLOWED_A_SPEAKER, \"followed\"),\n    (NOTIFICATION_SUPPORTED_A_DECLARATION, \"supported-a-declaration\"),\n)\ndef get_notification_message(notification_type):\n    for notification_tuple in NOTIFICATION_TYPES:\n        if notification_tuple[0] == notification_type:\n            return notification_tuple[1]\n    return \"Notification type not found\"\n", "entry_point": "get_notification_message", "input": "0", "output": "'added-declaration-for-resolution'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86427_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024957", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[5, 4, 3, 1, -1, 4, 0]", "output": "[5, 9, 12, 13, 12, 16, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024958", "code": "def radix_sort(array):\n    base = 10  # Base 10 for decimal integers\n    max_val = max(array)\n    col = 0\n    while max_val // 10 ** col > 0:\n        count_array = [0] * base\n        position = [0] * base\n        output = [0] * len(array)\n        for elem in array:\n            digit = elem // 10 ** col\n            count_array[digit % base] += 1\n        position[0] = 0\n        for i in range(1, base):\n            position[i] = position[i - 1] + count_array[i - 1]\n        for elem in array:\n            output[position[elem // 10 ** col % base]] = elem\n            position[elem // 10 ** col % base] += 1\n        array = output\n        col += 1\n    return output\n", "entry_point": "radix_sort", "input": "[2, 2, 23, 23, 88, 88, 802, 800]", "output": "[2, 2, 23, 23, 88, 88, 800, 802]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60721_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024959", "code": "def get_learning_rate(epoch, lr_schedule):\n    closest_epoch = max(filter(lambda x: x <= epoch, lr_schedule.keys()))\n    return lr_schedule[closest_epoch]\n", "entry_point": "get_learning_rate", "input": "10, {5: 0.01, 8: 0.001, 10: 4.4412}", "output": "4.4412", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78080_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024960", "code": "def simulate_reformat_temperature_data(raw_data):\n    # Simulate processing the data using a hypothetical script 'reformat_weather_data.py'\n    # In this simulation, we will simply reverse the input data as an example\n    reformatted_data = raw_data[::-1]\n    return reformatted_data\n", "entry_point": "simulate_reformat_temperature_data", "input": "'330,25,28,32,2,'", "output": "',2,23,82,52,033'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136307_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024961", "code": "def find_reachable_nodes(graph, start_node):\n    def dfs(graph, node, visited):\n        if node not in visited:\n            visited.append(node)\n            for n in graph.get(node, []):\n                dfs(graph, n, visited)\n    visited = []\n    dfs(graph, start_node, visited)\n    return visited\n", "entry_point": "find_reachable_nodes", "input": "{7: []}, 7", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34484_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024962", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "None, None, '9.9.9'", "output": "'10.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024963", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[4, 4, 5]", "output": "[16, 16, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5015", "output": "{1, 5, 295, 1003, 17, 85, 5015, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024965", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "-0.7", "output": "-0.00035", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024966", "code": "def custom_matrix_multiply(A, B):\n    result = []\n    for row_a, row_b in zip(A, B):\n        sum_a = sum(row_a)\n        sum_b = sum(row_b)\n        if sum_a > sum_b:\n            result_row = [a * b for a, b in zip(row_a, row_b)]\n        else:\n            result_row = [-a * b for a, b in zip(row_a, row_b)]\n        result.append(result_row)\n    return result\n", "entry_point": "custom_matrix_multiply", "input": "[[1, 2], [3, 4]], [[5, 6], [7, 8]]", "output": "[[-5, -12], [-21, -32]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148537_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024967", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[5, 4, 2, 2, 1, 1, 1, 1, 1]", "output": "[1, 1, 1, 1, 1, 2, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024968", "code": "import re\ndef extract_dataset(content):\n    pattern = re.compile(r\"([A-Z]{2,4})\\.([A-Z]+)\")\n    return pattern.findall(content)\n", "entry_point": "extract_dataset", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133947_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024969", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1929", "output": "{1, 1929, 3, 643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1411", "output": "{1, 83, 1411, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024971", "code": "import math\ndef count_perfect_squares(numbers):\n    count = 0\n    for num in numbers:\n        if math.isqrt(num) ** 2 == num:\n            count += 1\n    return count\n", "entry_point": "count_perfect_squares", "input": "[0, 1, 4, 9, 16]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144234_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024972", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6749", "output": "{1, 6749, 17, 397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6639", "output": "{1, 3, 2213, 6639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024974", "code": "def sum_of_squares_even(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 6, 12]", "output": "184", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15719_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024975", "code": "# Define the plant_recommendation function\ndef plant_recommendation(care):\n    if care == 'low':\n        return 'aloe'\n    elif care == 'medium':\n        return 'pothos'\n    elif care == 'high':\n        return 'orchid'\n", "entry_point": "plant_recommendation", "input": "'medium'", "output": "'pothos'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50948_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024976", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'bb.'", "output": "'bb.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4870", "output": "{1, 2, 2435, 5, 4870, 487, 10, 974}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4869", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024978", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "455, {}", "output": "'455-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024979", "code": "def count_passed_students(scores):\n    pass_count = 0\n    for score in scores:\n        if score >= 50:\n            pass_count += 1\n    return pass_count\n", "entry_point": "count_passed_students", "input": "[50, 60, 55, 70, 80, 45, 30]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140531_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024980", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9321", "output": "{1, 3, 3107, 39, 9321, 13, 717, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9320", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024981", "code": "def calculate_ways_to_choose(n, m):\n    # Calculate the numerator\n    numerator = 1\n    for i in range(n, n-m, -1):\n        numerator *= i\n    # Calculate the denominator\n    denominator = 1\n    for i in range(1, m+1):\n        denominator *= i\n    return numerator // denominator\n", "entry_point": "calculate_ways_to_choose", "input": "5, 2", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80080_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024982", "code": "def find_pairs_with_sum(nums, target):\n    seen = set()\n    pairs = []\n    for num in nums:\n        diff = target - num\n        if diff in seen:\n            pairs.append((num, diff))\n        seen.add(num)\n    return pairs\n", "entry_point": "find_pairs_with_sum", "input": "[3, 5, 7], 10", "output": "[(7, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108068_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024983", "code": "from typing import Tuple\ndef find_match(snippet: str, text: str) -> Tuple[int, int]:\n    for i in range(len(text) - len(snippet) + 1):\n        if text[i] == snippet[0] and text[i:i + len(snippet)] == snippet:\n            return i, i + len(snippet)\n    return 0, len(snippet)\n", "entry_point": "find_match", "input": "'abcdefghij', 'abcdefghij'", "output": "(0, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137921_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024984", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6433", "output": "{919, 1, 7, 6433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024985", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[8.0, 8.0, 8.0, 9.32]", "output": "8.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024986", "code": "def well_index(well_id):\n    well_id = well_id.upper()  # Convert to uppercase for consistency\n    row_letter = well_id[0]\n    column_number = int(well_id[1:])\n    row_number = ord(row_letter) - ord('A')  # Convert letter to row number (0-indexed)\n    return row_number * 24 + (column_number - 1)  # Calculate the index\n", "entry_point": "well_index", "input": "'C30'", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94310_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024987", "code": "def max_profit_two_transactions(prices):\n    buy1 = buy2 = float('inf')\n    sell1 = sell2 = 0\n    for price in prices:\n        buy1 = min(buy1, price)\n        sell1 = max(sell1, price - buy1)\n        buy2 = max(buy2, sell1 - price)\n        sell2 = max(sell2, price + buy2)\n    buy2 = sell2 = 0\n    for price in reversed(prices):\n        sell2 = max(sell2, price)\n        buy2 = max(buy2, sell2 - price)\n        sell1 = max(sell1, buy2 + price)\n        buy1 = min(buy1, price)\n    return sell1\n", "entry_point": "max_profit_two_transactions", "input": "[1, 5, 2, 6]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120999_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024988", "code": "def find_basement_position(input_str):\n    floor = 0\n    for idx, char in enumerate(input_str):\n        if char == \"(\":\n            floor += 1\n        elif char == \")\":\n            floor -= 1\n        if floor == -1:\n            return idx + 1\n    return -1\n", "entry_point": "find_basement_position", "input": "'(((()))))'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129859_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1867", "output": "{1, 1867}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024990", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7357", "output": "{1, 1051, 7357, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024991", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "43", "output": "'000000000000002b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024992", "code": "def longest_substring_with_k_distinct(s, k):\n    max_length = 0\n    start = 0\n    char_count = {}\n    for end in range(len(s)):\n        char_count[s[end]] = char_count.get(s[end], 0) + 1\n        while len(char_count) > k:\n            char_count[s[start]] -= 1\n            if char_count[s[start]] == 0:\n                del char_count[s[start]]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_substring_with_k_distinct", "input": "'AABBBCCCCC', 3", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18078_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6551", "output": "{1, 6551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024994", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[1, 5, 3, 3, 4, 6, 5, 2, 2]", "output": "[1, 25, 9, 9, 8, 12, 25, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2637", "output": "{1, 3, 293, 9, 2637, 879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1879", "output": "{1, 1879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1878", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024997", "code": "from typing import List\ndef max_subsequence_sum(values: List[int]) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    for value in values:\n        current_sum += value\n        max_sum = max(max_sum, current_sum)\n        if current_sum < 0:\n            current_sum = 0\n    return max_sum\n", "entry_point": "max_subsequence_sum", "input": "[10, 15]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58293_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024998", "code": "def main(numbers):\n    even_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "main", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27882_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0024999", "code": "def get_file_ext_from_url(url: str) -> str:\n    file_name_start = url.rfind('/') + 1\n    file_name_end = url.rfind('?') if '?' in url else len(url)\n    file_name = url[file_name_start:file_name_end]\n    dot_index = file_name.rfind('.')\n    if dot_index != -1:\n        return file_name[dot_index:]\n    else:\n        return ''\n", "entry_point": "get_file_ext_from_url", "input": "'http://example.com/document.txt'", "output": "'.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_292_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025000", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8012", "output": "{1, 2, 4, 4006, 8012, 2003}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8011", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9266", "output": "{1, 2, 226, 41, 113, 9266, 82, 4633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025002", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[3, 3, 3]", "output": "(3, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025003", "code": "def has_permission_to_add_link(user_permissions: list) -> bool:\n    return 'write' in user_permissions\n", "entry_point": "has_permission_to_add_link", "input": "['write']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28898_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025004", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[1, 2, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025005", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'sample'", "output": "{'sample': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15367_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025006", "code": "import re\ndef clean_slug(value, separator=None):\n    if separator == '-' or separator is None:\n        re_sep = '-'\n    else:\n        re_sep = '(?:-|%s)' % re.escape(separator)\n    value = re.sub(r'^%s+|%s+$' % (re_sep, re_sep), '', value)\n    if separator:\n        value = re.sub('%s+' % re_sep, separator, value)\n    return value\n", "entry_point": "clean_slug", "input": "'-hed-', '-'", "output": "'hed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141562_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025007", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[4, 7, 3, 5, 4]", "output": "[1, 3, 0, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025008", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "136", "output": "(True, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025009", "code": "def count_alphanumeric_chars(text):\n    count = 0\n    for char in text:\n        if char.isalnum():\n            count += 1\n    return count\n", "entry_point": "count_alphanumeric_chars", "input": "'abc1234!@'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10323_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025010", "code": "def findFirstBadVersion(versions, bad_version):\n    start = 0\n    end = len(versions) - 1\n    while start < end:\n        mid = start + (end - start) // 2\n        if versions[mid] >= bad_version:\n            end = mid\n        else:\n            start = mid + 1\n    if versions[start] == bad_version:\n        return start\n    elif versions[end] == bad_version:\n        return end\n    else:\n        return -1\n", "entry_point": "findFirstBadVersion", "input": "[1.0, 2.0, 3.0, 4.0, 4.9, 5.0, 6.0], 5.0", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1351_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025011", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[0, -1, 6, 6, 1, -1, 5, 5, 1]", "output": "[-1, 5, 12, 7, 0, 4, 10, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110342_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3170", "output": "{1, 3170, 2, 5, 10, 1585, 634, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3169", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025013", "code": "from typing import List\ndef _remove_trailing_zeros(numbers: List[float]) -> List[float]:\n    # Iterate through the list from the end and remove trailing zeros\n    while numbers and numbers[-1] == 0.0:\n        numbers.pop()\n    return numbers\n", "entry_point": "_remove_trailing_zeros", "input": "[1.0, 0.0, 0.4, 1.0, 0.0, 1.0, 0.0, 0.0]", "output": "[1.0, 0.0, 0.4, 1.0, 0.0, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148979_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025014", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[14, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[14, 28, 84, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025015", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "0", "output": "'0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3059", "output": "{1, 161, 133, 7, 19, 3059, 437, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025017", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "6, 5", "output": "7.810249675906654", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025018", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "\"'Pyt'\"", "output": "'Pyt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025019", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "11.0, 7", "output": "0.5714285714285714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025020", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4317", "output": "{1, 3, 4317, 1439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025021", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3657", "output": "'1 hour 57 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025022", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6416", "output": "{1, 2, 802, 4, 1604, 3208, 8, 6416, 16, 401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6415", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025023", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:9876]'", "output": "76561197960275604", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025024", "code": "def extract_python_version(input_string):\n    parts = input_string.split()\n    for part in parts:\n        if '.' in part:\n            return part\n", "entry_point": "extract_python_version", "input": "'Python version is 3.8.10 installed.'", "output": "'3.8.10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30856_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025025", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'wiiiitwordw'", "output": "'wiiiitwordw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025026", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "5, 101", "output": "505", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025027", "code": "from typing import List\ndef sum_with_next(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst) - 1):\n        result.append(lst[i] + lst[i + 1])\n    result.append(lst[-1] + lst[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 2, 4, 4, 4, 4, 2, 3]", "output": "[3, 6, 8, 8, 8, 6, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111975_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025028", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 15, 30]", "output": "53", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136598_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025029", "code": "def process_line(line):\n    start_br = line.find('[')\n    end_br = line.find(']')\n    conf_delim = line.find('::')\n    verb1 = line[:start_br].strip()\n    rel = line[start_br + 1: end_br].strip()\n    verb2 = line[end_br + 1: conf_delim].strip()\n    conf = line[conf_delim + 2:].strip()  # Skip the '::' delimiter\n    return verb1, rel, verb2, conf\n", "entry_point": "process_line", "input": "'Jumped over the [lazy] :: dog'", "output": "('Jumped over the', 'lazy', '', 'dog')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60093_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1358", "output": "{1, 2, 194, 97, 7, 679, 1358, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1357", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025031", "code": "import os\ndef process_file_paths(file_paths):\n    result = {}\n    for path in file_paths:\n        base_name = os.path.splitext(os.path.basename(path))[0]\n        directory = os.path.dirname(path)\n        if base_name in result:\n            result[base_name].append(directory)\n        else:\n            result[base_name] = [directory]\n    return result\n", "entry_point": "process_file_paths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32488_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025032", "code": "import string\ndef count_word_frequency(file_content):\n    word_freq = {}\n    text = file_content.lower()\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'thisext exx'", "output": "{'thisext': 1, 'exx': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3322_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025033", "code": "import re\ndef extractVolChapterFragmentPostfix(title):\n    title = title.replace('-', '.')  # Replace hyphens with periods for consistency\n    match = re.match(r'v(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:\\s*(.*))?$', title, re.IGNORECASE)\n    if match:\n        vol = match.group(1)\n        chp = match.group(2)\n        frag = match.group(3)\n        postfix = match.group(4)\n        return vol, chp, frag, postfix\n    else:\n        return None, None, None, None\n", "entry_point": "extractVolChapterFragmentPostfix", "input": "'v3.5 ..2'", "output": "('3', '5', None, '..2')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143168_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025034", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "5.5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025035", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "653", "output": "{1, 653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5422", "output": "{1, 2, 5422, 2711}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025037", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'vprue1'", "output": "('vprue1', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025038", "code": "def min_unsorted_subarray_length(nums):\n    n = len(nums)\n    sorted_nums = sorted(nums)\n    start, end = n + 1, -1\n    for i in range(n):\n        if nums[i] != sorted_nums[i]:\n            start = min(start, i)\n            end = max(end, i)\n    diff = end - start\n    return diff + 1 if diff > 0 else 0\n", "entry_point": "min_unsorted_subarray_length", "input": "[3, 2, 1, 7, 6, 5, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20405_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025039", "code": "def lcm(numbers):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    def lcm_two_numbers(x, y):\n        return x * y // gcd(x, y)\n    result = 1\n    for num in numbers:\n        result = lcm_two_numbers(result, num)\n    return result\n", "entry_point": "lcm", "input": "[36, 25, 91]", "output": "81900", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84681_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2804", "output": "{1, 2, 4, 2804, 1402, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2803", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025041", "code": "from typing import List\ndef count_successful_commands(commands: List[str]) -> int:\n    successful_count = 0\n    for command in commands:\n        if \"error\" not in command.lower():\n            successful_count += 1\n    return successful_count\n", "entry_point": "count_successful_commands", "input": "['start', 'run', 'execute', 'error in command']", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32409_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025042", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[7, 0, 8, 7, 2, 5, -1, 4, 7]", "output": "[7, 1, 10, 10, 6, 10, 5, 11, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025043", "code": "def extract_domain_name(url):\n    # Remove the protocol part of the URL\n    url = url.split(\"://\")[-1]\n    # Extract the domain name by splitting at the first single forward slash\n    domain_name = url.split(\"/\")[0]\n    return domain_name\n", "entry_point": "extract_domain_name", "input": "'http://www.ehtt'", "output": "'www.ehtt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96968_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "859", "output": "{1, 859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025045", "code": "def calculate_percentage(ts_idx, n):\n    count = len(ts_idx)\n    percentage = (count / n) * 100\n    return percentage\n", "entry_point": "calculate_percentage", "input": "[0, 0, 0, 0, 0, 0, 0, 0], 5", "output": "160.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54963_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025046", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<element>toot</element>'", "output": "'toot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025047", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'/pducts/'", "output": "'/pducts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025048", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8746", "output": "{1, 8746, 2, 4373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025049", "code": "import re\ndef count_word_occurrences(input_string):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word.isalpha():\n            word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'wa orld'", "output": "{'wa': 1, 'orld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99880_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025050", "code": "def findSubsetsThatSumToK(arr, k):\n    subsets = []\n    def generateSubsets(arr, index, current, current_sum, k, subsets):\n        if current_sum == k:\n            subsets.append(current[:])\n        if index == len(arr) or current_sum >= k:\n            return\n        for i in range(index, len(arr)):\n            current.append(arr[i])\n            generateSubsets(arr, i + 1, current, current_sum + arr[i], k, subsets)\n            current.pop()\n    generateSubsets(arr, 0, [], 0, k, subsets)\n    return subsets\n", "entry_point": "findSubsetsThatSumToK", "input": "[2, 2, 3, 5], 5", "output": "[[2, 3], [2, 3], [5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127361_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025051", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'double_value_2'", "output": "'2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025052", "code": "def sum_of_modified_tuples(tuples_list, n):\n    sums_list = []\n    for tup in tuples_list:\n        modified_tup = [num * n for num in tup]\n        sum_modified_tup = sum(modified_tup)\n        sums_list.append(sum_modified_tup)\n    return sums_list\n", "entry_point": "sum_of_modified_tuples", "input": "[(1, 3), (2, 4), (7, 7)], 3", "output": "[12, 18, 42]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60014_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5173", "output": "{1, 739, 5173, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025054", "code": "def most_common_element(input_list):\n    element_count = {}\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    most_common = max(element_count, key=element_count.get)\n    return most_common\n", "entry_point": "most_common_element", "input": "[6, 6, 6, 5, 5, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6653_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025055", "code": "def decode_secret_message(encoded_message, shift):\n    decoded_message = \"\"\n    for char in encoded_message:\n        if char.isalpha():\n            if char.islower():\n                decoded_message += chr(((ord(char) - ord('a') - shift) % 26) + ord('a'))\n            else:\n                decoded_message += chr(((ord(char) - ord('A') - shift) % 26) + ord('A'))\n        else:\n            decoded_message += char\n    return decoded_message\n", "entry_point": "decode_secret_message", "input": "'hAeAxeeh#Phkewh', 1", "output": "'gZdZwddg#Ogjdvg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69063_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025056", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[70, 68, 68, 68, 68, 68, 68], 7", "output": "68.28571428571429", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86097_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025057", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9049", "output": "{9049, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9048", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025058", "code": "def get_parent_directory(file_path):\n    parent_dir = ''\n    for char in file_path[::-1]:\n        if char in ('/', '\\\\'):\n            break\n        parent_dir = char + parent_dir\n    return parent_dir\n", "entry_point": "get_parent_directory", "input": "'/Some/Path/Pgra'", "output": "'Pgra'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48400_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025059", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1718", "output": "{1, 2, 859, 1718}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1717", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025060", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[64, 12, 24, 63, 64]", "output": "[12, 24, 63, 64, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2141", "output": "{1, 2141}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025062", "code": "def convert_integers(numbers):\n    converted_list = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            converted_list.append('even_odd')\n        elif num % 2 == 0:\n            converted_list.append('even')\n        elif num % 3 == 0:\n            converted_list.append('odd')\n        else:\n            converted_list.append(num)\n    return converted_list\n", "entry_point": "convert_integers", "input": "[3, 7, 2, 4, 1, 6, 1, 7]", "output": "['odd', 7, 'even', 'even', 1, 'even_odd', 1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77525_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025063", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 3, 0, 5, 0, 3, 3, 5]", "output": "[5, 3, 5, 5, 3, 6, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34035_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025064", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[8, 2, 8, 3, 0, 8]", "output": "{(8, 2, 8), (3, 0, 8)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025065", "code": "def sum_validated_data(list_data_for_valid):\n    total_sum = 0\n    for data in list_data_for_valid:\n        try:\n            num = float(data)\n            total_sum += num\n        except ValueError:\n            total_sum += 0\n    return total_sum\n", "entry_point": "sum_validated_data", "input": "['100.0', 'invalid', 'another_invalid', '0']", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19932_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025066", "code": "def generate_log_message(module_name):\n    return f\"Exporting annotated corpus data for {module_name}.\"\n", "entry_point": "generate_log_message", "input": "'xx'", "output": "'Exporting annotated corpus data for xx.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131792_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025067", "code": "def simulate_card_game(player1_deck, player2_deck):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return player1_wins, player2_wins\n", "entry_point": "simulate_card_game", "input": "[3, 5, 1, 2], [2, 4, 3, 5]", "output": "(2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47908_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025068", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "121", "output": "'ossg.default.121'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025069", "code": "def formingMagicSquare(s):\n    magic_squares = [\n        [[8, 1, 6], [3, 5, 7], [4, 9, 2]],\n        [[6, 1, 8], [7, 5, 3], [2, 9, 4]],\n        [[4, 9, 2], [3, 5, 7], [8, 1, 6]],\n        [[2, 9, 4], [7, 5, 3], [6, 1, 8]],\n        [[8, 3, 4], [1, 5, 9], [6, 7, 2]],\n        [[4, 3, 8], [9, 5, 1], [2, 7, 6]],\n        [[6, 7, 2], [1, 5, 9], [8, 3, 4]],\n        [[2, 7, 6], [9, 5, 1], [4, 3, 8]]\n    ]\n    min_cost = float('inf')\n    for magic_square in magic_squares:\n        cost = sum(abs(a - b) for row, magic_row in zip(s, magic_square) for a, b in zip(row, magic_row))\n        min_cost = min(min_cost, cost)\n    return min_cost\n", "entry_point": "formingMagicSquare", "input": "[[8, 1, 6], [3, 5, 7], [4, 9, 2]]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124103_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025070", "code": "def calculate_class_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_class_average", "input": "[55, 60, 62, 64, 70]", "output": "62.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107452_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025071", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5466", "output": "{1, 2, 3, 6, 2733, 911, 5466, 1822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3965", "output": "{1, 65, 5, 13, 305, 61, 793, 3965}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3964", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025073", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110100X'", "output": "['11101000', '11101001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt62", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025074", "code": "def calculate_stepper_positions(board_size, x_coord, y_coord):\n    _13x13_xMin = 735\n    _13x13_xMax = 3350\n    _13x13_yMin = 100\n    _13x13_yMax = 2890\n    _9x9_xMin = 1120\n    _9x9_xMax = 2940\n    _9x9_yMin = 560\n    _9x9_yMax = 2400\n    if board_size == 13:\n        x_position = int((_13x13_xMax - _13x13_xMin) * (x_coord / board_size) + _13x13_xMin)\n        y_position = int((_13x13_yMax - _13x13_yMin) * (y_coord / board_size) + _13x13_yMin)\n    elif board_size == 9:\n        x_position = int((_9x9_xMax - _9x9_xMin) * (x_coord / board_size) + _9x9_xMin)\n        y_position = int((_9x9_yMax - _9x9_yMin) * (y_coord / board_size) + _9x9_yMin)\n    else:\n        raise ValueError(\"Unsupported board size. Supported sizes are 9 and 13.\")\n    return x_position, y_position\n", "entry_point": "calculate_stepper_positions", "input": "13, 6, 10", "output": "(1941, 2246)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98234_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025075", "code": "def generate_wiktionary_url(snippet, query, lang):\n    query = query.replace(' ', '_')\n    if lang == 'fr':\n        return '\"%s\" - http://fr.wiktionary.org/wiki/%s' % (snippet, query)\n    elif lang == 'es':\n        return '\"%s\" - http://es.wiktionary.org/wiki/%s' % (snippet, query)\n    else:\n        return '\"%s\" - http://en.wiktionary.org/wiki/%s' % (snippet, query)\n", "entry_point": "generate_wiktionary_url", "input": "'wHeld', 'hlooe', 'en'", "output": "'\"wHeld\" - http://en.wiktionary.org/wiki/hlooe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98635_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025076", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[5, 10, 11]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025077", "code": "def sum_of_digit_squares(n):\n    # Convert the integer to a string to access individual digits\n    n_str = str(n)\n    # Initialize the sum of squares\n    sum_squares = 0\n    # Iterate over each digit in the string representation of n\n    for digit in n_str:\n        # Convert the digit back to an integer, square it, and add to the sum\n        sum_squares += int(digit) ** 2\n    return sum_squares\n", "entry_point": "sum_of_digit_squares", "input": "113", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77093_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025078", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[-1, 2, 1, -3]", "output": "[2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025079", "code": "def parse_config_file(config_data: str) -> dict:\n    config_dict = {}\n    for line in config_data.split('\\n'):\n        line = line.strip()\n        if line and not line.startswith('#'):\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip()\n    return config_dict\n", "entry_point": "parse_config_file", "input": "'DB_HOST = 12'", "output": "{'DB_HOST': '12'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101724_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025080", "code": "def tidy_objects(objects):\n    pushed_objects = []\n    for obj_name, in_container in objects:\n        if not in_container:\n            pushed_objects.append(obj_name)\n    return pushed_objects\n", "entry_point": "tidy_objects", "input": "[('backpack', False), ('book', True), ('pen', True)]", "output": "['backpack']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141612_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025081", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'The'", "output": "'The'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025082", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'javaclass.class'", "output": "'java javaclass'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025083", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7635", "output": "{1, 3, 5, 15, 2545, 7635, 1527, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025084", "code": "import re\ndef parse_math_syntax(text: str) -> str:\n    def replace_math(match):\n        math_content = match.group(1)\n        return f\"${math_content}$\"\n    return re.sub(r'\\$\\$(.*?)\\$\\$', replace_math, text)\n", "entry_point": "parse_math_syntax", "input": "'smammile'", "output": "'smammile'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3675_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6446", "output": "{1, 2, 293, 586, 11, 6446, 22, 3223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3522", "output": "{1, 3522, 3, 2, 1761, 6, 587, 1174}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025087", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7279", "output": "{1, 251, 29, 7279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025088", "code": "def calculate_average_depth(depths):\n    total_depth = 0\n    count = 0\n    for depth in depths:\n        if depth >= 0:\n            total_depth += depth\n            count += 1\n    if count == 0:\n        return 0  # Handle case when there are no valid depths\n    average_depth = round(total_depth / count, 2)\n    return average_depth\n", "entry_point": "calculate_average_depth", "input": "[3.9]", "output": "3.9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20373_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025089", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[1, 1, 4, 5, 3, 4, 4, 5]", "output": "[1, 1, 4, 'Buzz', 'Fizz', 4, 4, 'Buzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025090", "code": "import ast\ndef transform_input_to_eval(code):\n    # Parse the code snippet into an Abstract Syntax Tree (AST)\n    tree = ast.parse(code)\n    # Function to recursively traverse the AST and make the required changes\n    def transform_node(node):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'input':\n            # Replace input(...) with eval(input(...))\n            node.func = ast.Attribute(value=ast.Name(id='eval', ctx=ast.Load()), attr='input', ctx=ast.Load())\n        for child_node in ast.iter_child_nodes(node):\n            transform_node(child_node)\n    # Apply the transformation to the AST\n    transform_node(tree)\n    # Generate the modified code snippet from the transformed AST\n    modified_code = ast.unparse(tree)\n    return modified_code\n", "entry_point": "transform_input_to_eval", "input": "'y'", "output": "'y'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68294_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025091", "code": "def extract_peak_locations(peaks_or_locations):\n    dimensions = set()\n    for peak in peaks_or_locations:\n        dimensions.update(peak.keys())\n    peak_locations = []\n    for peak in peaks_or_locations:\n        location = []\n        for dim in dimensions:\n            location.append(peak.get(dim, 0.0))\n        peak_locations.append(location)\n    return peak_locations\n", "entry_point": "extract_peak_locations", "input": "[{}, {}, {}, {}, {}, {}]", "output": "[[], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93547_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025092", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "[1, 2, 4, 8, 3, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025093", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "12, 11, 20", "output": "(0, 6, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025094", "code": "def max_directory_depth(paths):\n    max_depth = 0\n    for path in paths:\n        depth = len(path.split('/'))\n        max_depth = max(max_depth, depth)\n    return max_depth\n", "entry_point": "max_directory_depth", "input": "['a/b', 'c']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67200_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025095", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-1, -1, 0, 1, 2]", "output": "[[-1, -1, 2], [-1, 0, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025096", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[6, 3, 4, 2, 2, 4, 2, 1, 6]", "output": "[6, 4, 6, 5, 6, 9, 8, 8, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025097", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "['R', 'R', 'R', 'R', 'R'], 10, 10", "output": "(5, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025098", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(255, 1, 16)", "output": "'#FF0110'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025099", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9887", "output": "{1, 9887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025100", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 7]", "output": "[0, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025101", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[1, 5, 0, 3, -1, 4]", "output": "[1, 6, 5, 3, 2, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025102", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    result = \"\"\n    current_char = s[0]\n    char_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            char_count += 1\n        else:\n            result += current_char + str(char_count)\n            current_char = s[i]\n            char_count = 1\n    result += current_char + str(char_count)\n    return s if len(result) >= len(s) else result\n", "entry_point": "compress_string", "input": "'adaaabbccccd'", "output": "'adaaabbccccd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92419_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025103", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[2, 0, 3, 0, 2, 2, 2, 1, 5]", "output": "[2, 2, 5, 5, 7, 9, 11, 12, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025104", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[6, 1, 4, 2, 3, 2, 2, 2, 3]", "output": "[6, 2, 6, 5, 7, 7, 8, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025105", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'def'", "output": "'def'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025106", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[7, 9, 4, 9, 7, 4, 7, 4]", "output": "[7, 10, 6, 12, 11, 9, 13, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025107", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'/home/user/data', '12345'", "output": "'/home/user/data/12345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025108", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025109", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3731", "output": "{1, 7, 41, 13, 3731, 533, 91, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025110", "code": "def count_non_whitespace_chars(lst):\n    total_count = 0\n    for string in lst:\n        # Remove whitespace characters and count non-whitespace characters\n        total_count += len(string.replace(\" \", \"\").replace(\"\\t\", \"\").replace(\"\\n\", \"\"))\n    return total_count\n", "entry_point": "count_non_whitespace_chars", "input": "['Code is great!', 'Lets count 14 chars']", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15095_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025111", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[90, 90, 81], 3", "output": "87.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025112", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[80, 90, 75, 85, 60, 70, 95], 1", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025113", "code": "def validate_params(input_params: dict) -> bool:\n    _validation = {\n        'device_id': {'required': True},\n        'module_id': {'required': False},\n        'site_id': {'required': True},\n    }\n    for key, value in _validation.items():\n        if value.get('required', False) and key not in input_params:\n            return False\n    return True\n", "entry_point": "validate_params", "input": "{}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134563_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025114", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[4, 2, 1, 3, 1, 5, 2, 2]", "output": "[6, 3, 4, 4, 6, 7, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025115", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[82, 82, 82, 82], 3", "output": "82.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59091_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025116", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'ab'", "output": "(1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025117", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'11.0.11.31.2..0.'", "output": "'11.0.11.31.2..0.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025118", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'aaa', 1", "output": "{'aaa': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025119", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'85, 92, 8'", "output": "[85, 92, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025120", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[[1, 2], [7], [3, [4, 5, 6]], [3], [2, 7]]", "output": "[1, 2, 7, 3, 4, 5, 6, 3, 2, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025121", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 4, 6, 1, 3, 5, 7]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9005", "output": "{1, 5, 9005, 1801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9004", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025123", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7886", "output": "{1, 2, 7886, 3943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025124", "code": "from typing import List\ndef max_product_of_three(nums: List[int]) -> int:\n    max1, max2, max3 = float('-inf'), float('-inf'), float('-inf')\n    min1, min2 = float('inf'), float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, min1 * min2 * max1)\n", "entry_point": "max_product_of_three", "input": "[2, 4, 5, -1, -2]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74922_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025125", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[94, 94, 93, 90, 85]", "output": "[94, 94, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025126", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "3, 4, 1", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025127", "code": "def calculate_total_size_in_kb(file_sizes):\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "calculate_total_size_in_kb", "input": "[11264]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119982_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025128", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5311", "output": "{1, 47, 113, 5311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025129", "code": "def symmetric_difference(*args):\n    element_count = {}\n    for s in args:\n        for elem in s:\n            element_count[elem] = element_count.get(elem, 0) + 1\n    symmetric_diff = [elem for elem, count in element_count.items() if count % 2 == 1]\n    return symmetric_diff\n", "entry_point": "symmetric_difference", "input": "{1}, {5}", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10090_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1515", "output": "{1, 3, 5, 101, 1515, 303, 15, 505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025131", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'foffffo=bauox'", "output": "{'foffffo': 'bauox'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025132", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "376", "output": "{1, 2, 4, 8, 47, 376, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt375", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025133", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2766", "output": "{1, 2, 3, 6, 1383, 461, 2766, 922}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025134", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'11Pap1er'", "output": "['11Pap1er']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025135", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "0, 5, 6", "output": "'0.5.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025136", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3041", "output": "{1, 3041}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025137", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8451", "output": "{1, 2817, 3, 8451, 9, 939, 313, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025138", "code": "def calculate_total_loss(loss_values):\n    total_loss = 0\n    for loss in loss_values:\n        total_loss += loss\n    return total_loss\n", "entry_point": "calculate_total_loss", "input": "[10.0, 4.2, 0.09999999999999964]", "output": "14.299999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134745_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025139", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[10, 15, 20, 26], 1", "output": "[26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025140", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, -3, 0, 6, 1, 5, 4], 3", "output": "[-3, 0, 6, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025141", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3665", "output": "'1 hour, 1 minute, and 5 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025142", "code": "from typing import List\ndef calculate_highest_score(scores: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = score + exclude\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "calculate_highest_score", "input": "[20, 10, 21]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24235_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025143", "code": "from typing import List\nfrom datetime import datetime\ndef earliest_date(dates: List[str]) -> str:\n    earliest_date = \"9999/12/31\"  # Initialize with a date far in the future\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, \"%Y/%m/%d\")\n        if date_obj < datetime.strptime(earliest_date, \"%Y/%m/%d\"):\n            earliest_date = date_str\n    return earliest_date\n", "entry_point": "earliest_date", "input": "['2021/05/15', '2022/01/10']", "output": "'2021/05/15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128206_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4149", "output": "{1, 3, 1383, 9, 461, 4149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025145", "code": "import os\ndef serve_static_file(path):\n    routes = {\n        'bower_components': 'bower_components',\n        'modules': 'modules',\n        'styles': 'styles',\n        'scripts': 'scripts',\n        'fonts': 'fonts'\n    }\n    if path == 'robots.txt':\n        return 'robots.txt'\n    elif path == '404.html':\n        return '404.html'\n    elif path.startswith('fonts/'):\n        return os.path.join('fonts', path.split('/', 1)[1])\n    else:\n        for route, directory in routes.items():\n            if path.startswith(route + '/'):\n                return os.path.join(directory, path.split('/', 1)[1])\n    return '404.html'\n", "entry_point": "serve_static_file", "input": "'styles/main.css'", "output": "'styles/main.css'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103383_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025146", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[15, 15.5, 16, 19]", "output": "16.375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025147", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6607", "output": "{1, 6607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025148", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'tateaxxstmple'", "output": "['tateaxxstmple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025149", "code": "def count_operation_type(operation_list, operation_type):\n    cktable = {-1: \"NON\", 0: \"KER\", 1: \"H2D\", 2: \"D2H\", 8: \"D2D\", 10: \"P2P\"}\n    count = 0\n    for op in operation_list:\n        if op == operation_type:\n            count += 1\n    return count\n", "entry_point": "count_operation_type", "input": "[1, 1, 1, 0, 2], 1", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88938_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025150", "code": "def generate_method_definitions(exist_param, no_param):\n    result = ''\n    exist_def = \"\"\"def %s(self, param=None):\n    return self._cmd(method=\"%s\", param=param)\"\"\"\n    no_def = \"\"\"def %s(self):\n    return self._cmd(method=\"%s\")\"\"\"\n    for x in exist_param:\n        result += exist_def % (x, x) + '\\n\\n'\n    for x in no_param:\n        result += no_def % (x, x) + '\\n\\n'\n    return result\n", "entry_point": "generate_method_definitions", "input": "[], []", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142690_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025151", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[1, 3, 4, 4, 1, 1, 2, 1, 4]", "output": "[1, 4, 8, 12, 13, 14, 16, 17, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025152", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[8, 2, 8, 3, 7, 8, 7, 8]", "output": "[8, 3, 10, 6, 11, 13, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4893", "output": "{1, 3, 7, 233, 21, 699, 4893, 1631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025154", "code": "def math_operation(a, b):\n    result = (a + b) * (a - b)\n    return result\n", "entry_point": "math_operation", "input": "7, 0", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51392_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025155", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[291]", "output": "291.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025156", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "find_latest_version", "input": "['11.5.0', '11.4.9', '10.2.15', '11.5.1']", "output": "'11.5.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112747_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025157", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "16", "output": "'VXWORKS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025158", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8567", "output": "{1, 659, 13, 8567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025159", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3666", "output": "'1 hr 1 min 6 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025160", "code": "def run(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "run", "input": "[2, 4]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16617_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4433", "output": "{1, 11, 13, 143, 4433, 403, 341, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025162", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "5, 3", "output": "'Enemy: 5, Own: 3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025163", "code": "def generate_sequence(n, m):\n    sequence = [0]  # Initialize with the first element\n    for i in range(1, n):\n        prev_element = sequence[-1]\n        new_element = prev_element * m + i\n        sequence.append(new_element)\n    return sequence\n", "entry_point": "generate_sequence", "input": "6, 3", "output": "[0, 1, 5, 18, 58, 179]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73186_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025164", "code": "import os\nimport pickle\nfrom typing import List, Dict, Tuple\ndef generate_experiment_summary(experiment_names: List[str]) -> Dict[str, Tuple[float, float]]:\n    summary = {}\n    for experiment in experiment_names:\n        file_path = experiment + '.pk'\n        if not os.path.exists(file_path):\n            print(f\"File '{file_path}' not found. Skipping experiment '{experiment}'.\")\n            continue\n        with open(file_path, 'rb') as f:\n            accuracy, loss = pickle.load(f)\n            summary[experiment] = (accuracy, loss)\n    return summary\n", "entry_point": "generate_experiment_summary", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92509_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025165", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3863", "output": "{1, 3863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3862", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025166", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'aaaabaaaa'", "output": "'a4b1a4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025167", "code": "def sum_divisible_numbers(start, end, divisor):\n    total_sum = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_numbers", "input": "5, 15, 5", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119149_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "271", "output": "{1, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025169", "code": "def encrypt_text(input_string):\n    encrypted_result = \"\"\n    for char in input_string:\n        ascii_val = ord(char)  # Get ASCII value of the character\n        encrypted_ascii = ascii_val + 1  # Increment ASCII value by 1\n        encrypted_char = chr(encrypted_ascii)  # Convert back to character\n        encrypted_result += encrypted_char  # Append to the encrypted result string\n    return encrypted_result\n", "entry_point": "encrypt_text", "input": "'hello'", "output": "'ifmmp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124153_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025170", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[0, 4, 4, 2, 2, 2, 1, 3]", "output": "{0: 1, 4: 2, 2: 3, 1: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025171", "code": "def clamp_numbers(numbers, lower_bound, upper_bound):\n    return [max(lower_bound, min(num, upper_bound)) for num in numbers]\n", "entry_point": "clamp_numbers", "input": "[0, 1, 4, -5, 3, 7, 5, 6], 1, 4", "output": "[1, 1, 4, 1, 3, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51058_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4293", "output": "{1, 3, 4293, 9, 81, 53, 1431, 27, 477, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025173", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9411", "output": "{3, 1, 9411, 3137}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025174", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "191", "output": "{1, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025175", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[2, 2, 1, 2, 2, 0, 1]", "output": "[4, 4, 1, 4, 4, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5533", "output": "{1, 11, 5533, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025177", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5176", "output": "{1, 2, 4, 647, 8, 1294, 5176, 2588}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5175", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025178", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8945", "output": "{1, 5, 8945, 1789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025179", "code": "from typing import List\ndef unique_elements(lista: List[int]) -> List[int]:\n    seen = set()\n    result = []\n    for num in lista:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "unique_elements", "input": "[2, 3]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139228_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025180", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "1, 1.5", "output": "1.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025181", "code": "def lookup_ip(domains, domain_name):\n    if domain_name in domains:\n        return domains[domain_name]\n    else:\n        return \"Domain not found\"\n", "entry_point": "lookup_ip", "input": "{}, 'example.com'", "output": "'Domain not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4252_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025182", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[65, 80, 75, 90, 70, 85, 85], 7", "output": "[3, 5, 6, 1, 2, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025183", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'Hello world 33'", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1553", "output": "{1, 1553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025185", "code": "def maze_game(grid):\n    path = []\n    def explore(x, y, path):\n        if x == len(grid) - 1 and y == len(grid[0]) - 1:\n            return True\n        if x < 0 or x >= len(grid) or y < 0 or y >= len(grid[0]) or grid[x][y] == 1:\n            return False\n        grid[x][y] = 1  # Mark as visited\n        if explore(x, y + 1, path) or explore(x + 1, y, path):\n            path.append((x, y))\n            return True\n        return False\n    if explore(0, 0, path):\n        path.append((len(grid) - 1, len(grid[0]) - 1))\n        return path[::-1]  # Reverse the path to get the correct order\n    return []\n", "entry_point": "maze_game", "input": "[[1, 0], [0, 0]]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60462_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025186", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'i'", "output": "{'i': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025187", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "84", "output": "0.4666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025188", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "0.0, 'world!'", "output": "([('Content-type', 'text/plain')], 'world!')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025189", "code": "def get_tree_location(file_path):\n    directories = file_path.split('/')\n    if len(directories) == 1:\n        return (directories[0], 'FIELD')\n    else:\n        parent_folder = '/'.join(directories[:2])  # Include only the first two directories\n        return (parent_folder, 'FIELD')\n", "entry_point": "get_tree_location", "input": "'HVHVAC/fielbdir2'", "output": "('HVHVAC/fielbdir2', 'FIELD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121356_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025190", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'orange; pear; grape'", "output": "['orange', 'pear', 'grape']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025191", "code": "def clamp_numbers(numbers, lower_bound, upper_bound):\n    return [max(lower_bound, min(num, upper_bound)) for num in numbers]\n", "entry_point": "clamp_numbers", "input": "[-3, 0, -2, 2, 1, 1.5, -2, -1, 8], -2, 1", "output": "[-2, 0, -2, 1, 1, 1, -2, -1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51058_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025192", "code": "def generate_log_message(task_type, log_line_type):\n    log_line_prefix = \"-***-\"\n    log_line_block_prefix = \"*** START\"\n    log_line_block_suffix = \"*** END\"\n    if task_type not in [\"Training\", \"Processing\"] or log_line_type not in [\"Prefix\", \"Block Prefix\", \"Block Suffix\"]:\n        return \"Invalid task_type or log_line_type provided.\"\n    if log_line_type == \"Prefix\":\n        return f\"{log_line_prefix} {task_type}\"\n    elif log_line_type == \"Block Prefix\":\n        return f\"{log_line_block_prefix} {task_type}\"\n    elif log_line_type == \"Block Suffix\":\n        return f\"{log_line_block_suffix} {task_type}\"\n", "entry_point": "generate_log_message", "input": "'Processing', 'Block Prefix'", "output": "'*** START Processing'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115556_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025193", "code": "def find_increase(lines):\n    increase = 0\n    for i in range(1, len(lines)):\n        if lines[i] > lines[i - 1]:\n            increase += 1\n    return increase\n", "entry_point": "find_increase", "input": "[3, 4, 4]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53543_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025194", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'uuu/adm/n/dashboard/'", "output": "'uuu/adm/n/dashboard'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025195", "code": "from typing import List, Union\ndef sum_even_numbers(input_list: List[Union[int, str]]) -> int:\n    sum_even = 0\n    for element in input_list:\n        if isinstance(element, int):\n            if element % 2 == 0:\n                sum_even += element\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[-2, -4, -4, -6]", "output": "-16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67584_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025196", "code": "def generate_pattern(n):\n    pattern = []\n    for i in range(1, n+1):\n        line = [str(num) for num in range(1, i+1)]\n        line += ['*'] * (i-1)\n        line += [str(num) for num in range(i, 0, -1)]\n        pattern.append(''.join(line))\n    return pattern\n", "entry_point": "generate_pattern", "input": "2", "output": "['11', '12*21']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29714_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025197", "code": "from typing import List\ndef interleave_lists(list1: List[int], list2: List[int]) -> List[int]:\n    result = []\n    index1, index2 = 0, 0\n    while index1 < len(list1) and index2 < len(list2):\n        result.append(list1[index1])\n        result.append(list2[index2])\n        index1 += 1\n        index2 += 1\n    result.extend(list1[index1:])\n    result.extend(list2[index2:])\n    return result\n", "entry_point": "interleave_lists", "input": "[1, 2, 3, 7], [4, 5, 6]", "output": "[1, 4, 2, 5, 3, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74515_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025198", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.1.2', 120", "output": "'2.1.2.120'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025199", "code": "import math\ndef calculate_gaussian_coefficients(ndim):\n    p_i = math.pi\n    coefficients = 1 / (math.sqrt(2 * p_i) ** ndim)\n    return coefficients\n", "entry_point": "calculate_gaussian_coefficients", "input": "52", "output": "1.7673534934784282e-21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134730_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025200", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1570", "output": "{1, 1570, 2, 5, 10, 785, 314, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1569", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025201", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[0, 1, 0]", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025202", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num == 0:\n            continue\n        elif num % 2 == 0:\n            modified_numbers.append(num ** 2)\n        elif num % 2 != 0:\n            modified_numbers.append(num ** 3)\n        else:\n            modified_numbers.append(abs(num))\n    return modified_numbers\n", "entry_point": "process_numbers", "input": "[2, 8, 4, 8, 2, -9, 2]", "output": "[4, 64, 16, 64, 4, -729, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26931_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025203", "code": "def count_player1_wins(cases):\n    player1_wins = 0\n    for outcome in cases:\n        if outcome == 'p1_wins':\n            player1_wins += 1\n        elif outcome == 'p1_and_p2_win':\n            player1_wins += 1  # Player 1 also wins in this case\n    return player1_wins\n", "entry_point": "count_player1_wins", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141851_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025204", "code": "def markdown_to_html(markdown_text):\n    html_text = \"\"\n    lines = markdown_text.split('\\n')\n    for line in lines:\n        if line.startswith('#'):\n            header_level = min(line.count('#'), 6)\n            header_text = line.strip('# ').strip()\n            html_text += f\"<h{header_level}>{header_text}</h{header_level}>\\n\"\n        elif line.startswith('- '):\n            list_item = line.strip('- ').strip()\n            html_text += f\"<li>{list_item}</li>\\n\"\n        else:\n            html_text += line + \"\\n\"\n    return html_text\n", "entry_point": "markdown_to_html", "input": "''", "output": "'\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143411_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025205", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'50 5 +'", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025206", "code": "from typing import List\ndef process_commands(commands: List[str], prefix: str) -> str:\n    processed_commands = [cmd.upper() for cmd in commands]\n    concatenated_commands = ' '.join(processed_commands)\n    processed_string = f\"{prefix} {concatenated_commands}\" if prefix else concatenated_commands\n    return processed_string\n", "entry_point": "process_commands", "input": "['run', 'jump', 'swim'], 'Action:'", "output": "'Action: RUN JUMP SWIM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90934_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3851", "output": "{1, 3851}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025208", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8143", "output": "{1, 479, 17, 8143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025209", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "10", "output": "{1, 10, 2, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7148", "output": "{1, 2, 4, 7148, 3574, 1787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7147", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025211", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[0, 0, 0, 0, -4, -4, -2, 3]", "output": "{0: 4, -4: 2, -2: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025212", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6763", "output": "{1, 6763}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025213", "code": "import hashlib\ndef sha1_mangle_key_lowercase(key):\n    \"\"\"Extension of sha1_mangle_key that converts the key to lowercase before hashing.\"\"\"\n    lowercase_key = key.lower()\n    encoded_key = lowercase_key.encode('utf-8')\n    return hashlib.sha1(encoded_key).hexdigest()\n", "entry_point": "sha1_mangle_key_lowercase", "input": "'HelloWorld'", "output": "'6adfb183a4a2c94a2f92dab5ade762a47889a5a1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145674_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025214", "code": "def findFirstBadVersion(versions, bad_version):\n    start = 0\n    end = len(versions) - 1\n    while start < end:\n        mid = start + (end - start) // 2\n        if versions[mid] >= bad_version:\n            end = mid\n        else:\n            start = mid + 1\n    if versions[start] == bad_version:\n        return start\n    elif versions[end] == bad_version:\n        return end\n    else:\n        return -1\n", "entry_point": "findFirstBadVersion", "input": "[1, 2, 3, 4, 5], 5", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1351_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025215", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4546", "output": "{1, 4546, 2, 2273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4545", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025216", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[60, 70, 75, 76, 90]", "output": "73.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92389_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025217", "code": "def generate_down_revision(revision):\n    down_revision = revision[::-1].lower()\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'11881'", "output": "'18811'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7052_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025218", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "' 4 4 '", "output": "b'D'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025219", "code": "def min_changes_to_anagram(bigger_str, smaller_str):\n    str_counter = {}\n    for char in bigger_str:\n        if char in str_counter:\n            str_counter[char] += 1\n        else:\n            str_counter[char] = 1\n    for char in smaller_str:\n        if char in str_counter:\n            str_counter[char] -= 1\n    needed_changes = 0\n    for counter in str_counter.values():\n        needed_changes += abs(counter)\n    return needed_changes\n", "entry_point": "min_changes_to_anagram", "input": "'abcdefghij', 'xyz'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124427_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025220", "code": "def sum_with_next_k(nums, k):\n    result = []\n    for i in range(len(nums) - k + 1):\n        result.append(sum(nums[i:i+k]))\n    return result\n", "entry_point": "sum_with_next_k", "input": "[2, 3, 3, 7, 5], 3", "output": "[8, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73692_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025221", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[4, 0, 2, 1]", "output": "{4: 16, 0: 0, 2: 4, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025222", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[8, 8, 5, 7, 4, 5, 1, 3]", "output": "[64, 64, 125, 343, 16, 125, 1, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025223", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'utc/images/photo.jpg'", "output": "('utc', 'images/photo.jpg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025224", "code": "def move_in_grid(grid, directions):\n    rows, cols = len(grid), len(grid[0])\n    x, y = 0, 0\n    for direction in directions:\n        if direction == 0:  # Up\n            x = max(0, x - 1)\n        elif direction == 1:  # Down\n            x = min(rows - 1, x + 1)\n        elif direction == 2:  # Left\n            y = max(0, y - 1)\n        elif direction == 3:  # Right\n            y = min(cols - 1, y + 1)\n    return grid[x][y]\n", "entry_point": "move_in_grid", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112178_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025225", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'exljacajavacccas.class'", "output": "'java exljacajavacccas'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025226", "code": "import re\nfrom typing import Tuple\ndef extract_twitter_handle(tweet: str) -> Tuple[str, str]:\n    handle_pattern = r'^(RT @)?@(\\w+):?\\s*'\n    match = re.match(handle_pattern, tweet)\n    if match:\n        twitter_handle = match.group(2)\n        rest_of_tweet = tweet.replace(match.group(0), '', 1)\n        return twitter_handle, rest_of_tweet.strip()\n    return '', tweet  # Return empty handle if no match found\n", "entry_point": "extract_twitter_handle", "input": "'@anotherhandle: Hello world!'", "output": "('anotherhandle', 'Hello world!')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113872_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025227", "code": "def html_color_to_rgb(color_name):\n    HTML_COLORS = {\n        'black': (0, 0, 0), 'green': (0, 128, 0),\n        'silver': (192, 192, 192), 'lime': (0, 255, 0),\n        'gray': (128, 128, 128), 'olive': (128, 128, 0),\n        'white': (255, 255, 255), 'yellow': (255, 255, 0),\n        'maroon': (128, 0, 0), 'navy': (0, 0, 128),\n        'red': (255, 0, 0), 'blue': (0, 0, 255),\n        'purple': (128, 0, 128), 'teal': (0, 128, 128),\n        'fuchsia': (255, 0, 255), 'aqua': (0, 255, 255),\n    }\n    return HTML_COLORS.get(color_name)\n", "entry_point": "html_color_to_rgb", "input": "'purple'", "output": "(128, 0, 128)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56036_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025228", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[100, 90, 39, 31, 31, 30, 10], 6", "output": "[100, 90, 39, 31, 31, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025229", "code": "def count_element_occurrences(dom_list):\n    element_count = {}\n    for element in dom_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    return element_count\n", "entry_point": "count_element_occurrences", "input": "['a_div', 'a_div', 'a_da_diviv']", "output": "{'a_div': 2, 'a_da_diviv': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31620_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025230", "code": "def extract_base_directory(file_path):\n    base_dir = \"\"\n    for i in range(len(file_path) - 1, -1, -1):\n        if file_path[i] == '/':\n            base_dir = file_path[:i]\n            break\n    return base_dir\n", "entry_point": "extract_base_directory", "input": "'/home/er/file.txt'", "output": "'/home/er'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67520_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025231", "code": "def nonogramrow(row):\n    segments = []\n    segment_length = 0\n    for cell in row:\n        if cell == 1:\n            segment_length = segment_length + 1 if segment_length > 0 else 1\n        else:\n            if segment_length > 0:\n                segments.append(segment_length)\n                segment_length = 0\n    if segment_length > 0:\n        segments.append(segment_length)\n    return segments\n", "entry_point": "nonogramrow", "input": "[1, 0, 1, 1]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33081_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9217", "output": "{709, 1, 13, 9217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025233", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[-1, 0, 1, 2, 5, 6, -1, 0, 5]", "output": "[-1, -1, 0, 0, 1, 2, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025234", "code": "def sort_projections(projection_ids, weights):\n    projection_map = dict(zip(projection_ids, weights))\n    sorted_projections = sorted(projection_ids, key=lambda x: projection_map[x])\n    return sorted_projections\n", "entry_point": "sort_projections", "input": "[1, 1, 2, 2, 2], [0, 0, 1, 1, 1]", "output": "[1, 1, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91067_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025235", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2248", "output": "{1, 2, 1124, 4, 2248, 8, 562, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2247", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025236", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'BTTCUSDT'", "output": "('BTTC', 'USDT')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025237", "code": "def generate_ans(pattern):\n    ans = []\n    for num in pattern:\n        if num % 2 == 0:\n            ans.append(num)\n        else:\n            ans.append(num ** 2)\n    return ans\n", "entry_point": "generate_ans", "input": "[2, 7, 7, 1, 6, 4, 8, 7, 1]", "output": "[2, 49, 49, 1, 6, 4, 8, 49, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88419_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025238", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9903", "output": "{1, 3, 3301, 9903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025239", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8187", "output": "{3, 1, 2729, 8187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8186", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025240", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    min_score = min(scores)\n    sum_excluding_min = sum(scores) - min_score\n    num_scores_excluding_min = len(scores) - 1\n    average_score = sum_excluding_min / num_scores_excluding_min\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 90, 85.71428571428571]", "output": "87.85714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24901_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025241", "code": "def format_title(title):\n    words = title.split()\n    formatted_words = [word.capitalize().replace('-', '') for word in words]\n    formatted_title = ' '.join(formatted_words)\n    return formatted_title\n", "entry_point": "format_title", "input": "'panel'", "output": "'Panel'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13677_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025242", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[30, 10, 40]", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025243", "code": "from typing import List, Tuple\ndef analyze_list(nums: List[int]) -> Tuple[int, int]:\n    even_sum = 0\n    odd_product = 1\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n        else:\n            odd_product *= num\n    return even_sum, odd_product\n", "entry_point": "analyze_list", "input": "[6, 5]", "output": "(6, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38434_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025244", "code": "def count_occurrences(input_list):\n    count_dict = {}\n    for element in input_list:\n        if element in count_dict:\n            count_dict[element] += 1\n        else:\n            count_dict[element] = 1\n    unique_elements = list(count_dict.keys())\n    counts = [count_dict[element] for element in unique_elements]\n    return unique_elements, counts\n", "entry_point": "count_occurrences", "input": "[6, 1, 5, 4, 2, 2, 3]", "output": "([6, 1, 5, 4, 2, 3], [1, 1, 1, 1, 2, 1])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79871_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025245", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 4, 3, 4, 2, 3]", "output": "[6, 7, 7, 6, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112058_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025246", "code": "def days_exceeding_average(data, period_length):\n    result = []\n    avg_deaths = sum(data[:period_length]) / period_length\n    current_sum = sum(data[:period_length])\n    for i in range(period_length, len(data)):\n        if data[i] > avg_deaths:\n            result.append(i)\n        current_sum += data[i] - data[i - period_length]\n        avg_deaths = current_sum / period_length\n    return result\n", "entry_point": "days_exceeding_average", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3", "output": "[3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025247", "code": "def generate_api_url(api_version: int) -> str:\n    API_URL_TEMPLATE = \"https://www.kaiheila.cn/api/v{}\"\n    return API_URL_TEMPLATE.format(api_version)\n", "entry_point": "generate_api_url", "input": "2", "output": "'https://www.kaiheila.cn/api/v2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143412_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025248", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[80], 2", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025249", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'Hello, World! 123'", "output": "'HelloWorld123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025250", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "4.35", "output": "59.41664999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025251", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'RU'", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025252", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "16, 5", "output": "4368", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt1397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025253", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[2, 1, 4, 1, 3, 6]", "output": "[4, 3, 8, 3, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025254", "code": "def prefnum(InA=[], PfT=None, varargin=None):\n    # Non-zero value InA location indices:\n    IxZ = [i for i, val in enumerate(InA) if val > 0]\n    IsV = True\n    # Calculate sum of positive values, maximum value, and its index\n    sum_positive = sum(val for val in InA if val > 0)\n    max_value = max(InA)\n    max_index = InA.index(max_value)\n    return sum_positive, max_value, max_index\n", "entry_point": "prefnum", "input": "[1, 2, 3, 8, 10]", "output": "(24, 10, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134376_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025255", "code": "import heapq\ndef first_n_smallest(lst, n):\n    heap = [(val, idx) for idx, val in enumerate(lst)]\n    heapq.heapify(heap)\n    result = [heapq.heappop(heap) for _ in range(n)]\n    result.sort(key=lambda x: x[1])  # Sort based on original indices\n    return [val for val, _ in result]\n", "entry_point": "first_n_smallest", "input": "[3, 2, 1], 2", "output": "[2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105636_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025256", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[65, 65, 65, 78, 78, 87, 87, 92, 92]", "output": "[65, 65, 65, 78, 78, 87, 87, 92, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025257", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[5, 5, 5, 4, 4, 4, 4]", "output": "[25, 25, 25, 8, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3359", "output": "{1, 3359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025259", "code": "def isLatestVersion(currentVersion, latestVersion):\n    current_versions = list(map(int, currentVersion.split('.')))\n    latest_versions = list(map(int, latestVersion.split('.')))\n    for cur_ver, lat_ver in zip(current_versions, latest_versions):\n        if cur_ver < lat_ver:\n            return False\n        elif cur_ver > lat_ver:\n            return True\n    return True\n", "entry_point": "isLatestVersion", "input": "'1.0', '1.1'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10898_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025260", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[1, 2]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025261", "code": "def calculate_max_profit(K, A, B):\n    if B - A <= 2 or 1 + (K - 2) < A:\n        return K + 1\n    exchange_times, last = divmod(K - (A - 1), 2)\n    profit = B - A\n    return A + exchange_times * profit + last\n", "entry_point": "calculate_max_profit", "input": "46, 20, 22", "output": "47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88263_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025262", "code": "import re\nTRAILING_WS_IN_CONTINUATION = re.compile(r'\\\\ \\s+\\n')\ndef remove_trailing_whitespace(input_string: str) -> str:\n    return TRAILING_WS_IN_CONTINUATION.sub(r'\\\\n', input_string)\n", "entry_point": "remove_trailing_whitespace", "input": "'11\\\\ \\n1233'", "output": "'11\\\\ \\n1233'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71646_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025263", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1073", "output": "{1, 37, 29, 1073}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025264", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[0, 1]", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025265", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6677", "output": "{1, 11, 6677, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025266", "code": "from typing import List\ndef calculate_max_score(scores: List[int]) -> int:\n    if not scores:\n        return 0\n    n = len(scores)\n    if n == 1:\n        return scores[0]\n    dp = [0] * n\n    dp[0] = scores[0]\n    dp[1] = max(scores[0], scores[1])\n    for i in range(2, n):\n        dp[i] = max(scores[i] + dp[i - 2], dp[i - 1])\n    return dp[-1]\n", "entry_point": "calculate_max_score", "input": "[3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64203_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025267", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(coefficients[i] * i)\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 3, 3, 1, 2, 3, 3, 2, 2]", "output": "[3, 6, 3, 8, 15, 18, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45837_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025268", "code": "def classify_superheroes(powers):\n    good_superheroes = []\n    evil_superheroes = []\n    total_good_power = 0\n    total_evil_power = 0\n    for power in powers:\n        if power > 0:\n            good_superheroes.append(power)\n            total_good_power += power\n        else:\n            evil_superheroes.append(power)\n            total_evil_power += power\n    return good_superheroes, evil_superheroes, total_good_power, total_evil_power\n", "entry_point": "classify_superheroes", "input": "[8, 6, 10, 6, -12, -12]", "output": "([8, 6, 10, 6], [-12, -12], 30, -24)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7614_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025269", "code": "def process_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        if i < list_length - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 3, 0, 0, 3, 3, 4, 3, 0]", "output": "[4, 3, 0, 3, 6, 7, 7, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63579_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "605", "output": "{1, 5, 11, 55, 121, 605}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025271", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[1, 2, 1, 2, 10, 0, 5, 0, 2]", "output": "{(1, 2, 1), (2, 10, 0), (5, 0, 2)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025272", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'thisIsCamelCase'", "output": "'this_is_camel_case'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025273", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'Hello World, this is a test.'", "output": "'Hello-World,-this-is-a-test.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025274", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3913", "output": "{1, 7, 3913, 43, 13, 301, 559, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025275", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'/patory'", "output": "\"Directory '/patory' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025276", "code": "def sum_multiples(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples", "input": "[15, 10, 5, 10]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135007_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025277", "code": "def calculate_average_excluding_extremes(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[80, 88, 88, 88, 96]", "output": "88.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83310_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025278", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 91, 90]", "output": "[99, 91, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025279", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'Hello,ld'", "output": "'Ifmmp-me'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025280", "code": "_escapes = [('a', '1'), ('b', '2'), ('c', '3')]  # Example escape rules\ndef escape_string(input_string):\n    for a, b in _escapes:\n        input_string = input_string.replace(a, b)\n    return input_string\n", "entry_point": "escape_string", "input": "'abc'", "output": "'123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9621_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025281", "code": "def calculate_average_age(people):\n    total_age = 0\n    for person in people:\n        total_age += person['idade']\n    if len(people) == 0:\n        return 0  # Handle division by zero if the list is empty\n    else:\n        return total_age / len(people)\n", "entry_point": "calculate_average_age", "input": "[{'idade': 25}]", "output": "25.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52440_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025282", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[20, 6, 8, 20, 6, 6, 6]", "output": "[6, 6, 6, 6, 8, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025283", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'Woo!'", "output": "['woo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025284", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'CCens'", "output": "'CCens'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025285", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Wel_mme'", "output": "'Wel_mme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025286", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'5-8-10-15-13'", "output": "-41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025287", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'onnotifcation'", "output": "'onnotifcation'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025288", "code": "from urllib.parse import urlparse\ndef process_url(enclosure: str, username: str = None, api_key: str = None) -> str:\n    parsed_url = urlparse(enclosure)\n    if username is not None:\n        url = '/vsigzip//vsicurl/%s://%s:%s@%s%s' % (parsed_url.scheme,\n                                                      username,\n                                                      api_key,\n                                                      parsed_url.netloc,\n                                                      parsed_url.path)\n    else:\n        url = '/vsigzip//vsicurl/%s://%s%s' % (parsed_url.scheme,\n                                               parsed_url.netloc,\n                                               parsed_url.path)\n    return url\n", "entry_point": "process_url", "input": "'fxamp', 'uuu', 'srektey'", "output": "'/vsigzip//vsicurl/://uuu:srektey@fxamp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108938_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025289", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "20, 0, 15", "output": "2432902008176640000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2983", "output": "{1, 19, 157, 2983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2982", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025291", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[10, 0, 13]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025292", "code": "def dna_to_rna(dna_strand):\n    pairs = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}\n    rna_complement = ''.join(pairs[n] for n in dna_strand)\n    return rna_complement\n", "entry_point": "dna_to_rna", "input": "'TGGCCACA'", "output": "'ACCGGUGU'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39038_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025293", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        if i == 0:\n            result.append(lst[i] + lst[i+1])\n        elif i == len(lst) - 1:\n            result.append(lst[i-1] + lst[i])\n        else:\n            result.append(lst[i-1] + lst[i] + lst[i+1])\n    return result\n", "entry_point": "process_list", "input": "[1, 1, 3, 1, 1, 1, 1, 1]", "output": "[2, 5, 5, 5, 3, 3, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145647_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025294", "code": "def calculate_average_perplexity(perplexity_eps, perplexity_value):\n    total_perplexity = 0\n    valid_count = 0\n    for i in range(1, len(perplexity_value)):\n        if abs(perplexity_value[i] - perplexity_value[i-1]) <= perplexity_eps:\n            total_perplexity += perplexity_value[i]\n            valid_count += 1\n    average_perplexity = total_perplexity / valid_count if valid_count > 0 else 0\n    return average_perplexity\n", "entry_point": "calculate_average_perplexity", "input": "1.0, []", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116735_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025295", "code": "def calculate_polygon_area(vertices):\n    n = len(vertices)\n    area = 0.5 * abs(sum(vertices[i][0] * vertices[(i + 1) % n][1] for i in range(n))\n                     - sum(vertices[i][1] * vertices[(i + 1) % n][0] for i in range(n)))\n    return area\n", "entry_point": "calculate_polygon_area", "input": "[(0, 0), (6, 0), (6, 6), (0, 6)]", "output": "36.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22232_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025296", "code": "def _sign(val, length):\n    \"\"\"\n    Convert unsigned integer to signed integer\n    Args:\n        val: Unsigned integer value\n        length: Number of bits used to represent the integer\n    Returns:\n        Signed integer value\n    \"\"\"\n    if val & (1 << (length - 1)):\n        return val - (1 << length)\n    return val\n", "entry_point": "_sign", "input": "8, 4", "output": "-8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126432_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025297", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[3, 3, 8]", "output": "[3, 4, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025298", "code": "def increment_workfile_version(current_version: str) -> str:\n    major, minor = current_version.split('.')\n    if minor == 'z':\n        major = str(int(major) + 1)\n        minor = 'a'\n    else:\n        minor = chr(ord(minor) + 1)\n    return f\"{major}.{minor}\"\n", "entry_point": "increment_workfile_version", "input": "'10.z'", "output": "'11.a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112263_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025299", "code": "def calculate_gpu_memory_usage(processes):\n    max_memory_usage = max(processes)\n    total_memory_usage = sum(processes)\n    return max_memory_usage, total_memory_usage\n", "entry_point": "calculate_gpu_memory_usage", "input": "[1023, 1020, 1019, 1000, 800]", "output": "(1023, 4862)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48951_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025300", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'22.5.1'", "output": "(22, 5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025301", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "4", "output": "'\\t\\t\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025302", "code": "def calculate_precision(true_positives, false_positives):\n    if true_positives + false_positives == 0:\n        return -1\n    precision = true_positives / (true_positives + false_positives)\n    return precision\n", "entry_point": "calculate_precision", "input": "21, 1", "output": "0.9545454545454546", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116916_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025303", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[2, 2, 2, 4, 4, 1, 1]", "output": "{2: 3, 4: 2, 1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025304", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7511", "output": "{1, 259, 37, 7, 203, 1073, 7511, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025305", "code": "def every(lst, f=1, start=0):\n    result = []\n    for i in range(start, len(lst), f):\n        result.append(lst[i])\n    return result\n", "entry_point": "every", "input": "[4, 5, 2]", "output": "[4, 5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105731_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025306", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "';=Dname=Dima=ge=28'", "output": "{'': 'Dname=Dima=ge=28'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025307", "code": "def split_into_chunks(data, chunk_size):\n    num_chunks = -(-len(data) // chunk_size)  # Calculate the number of chunks needed\n    chunks = []\n    for i in range(num_chunks):\n        start = i * chunk_size\n        end = (i + 1) * chunk_size\n        chunk = data[start:end]\n        if len(chunk) < chunk_size:\n            chunk += [None] * (chunk_size - len(chunk))  # Pad with None values if needed\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_into_chunks", "input": "[3, 6, 3, 6, 4, 6, 6, 3, 3], 5", "output": "[[3, 6, 3, 6, 4], [6, 6, 3, 3, None]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138006_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2036", "output": "{1, 2, 4, 2036, 1018, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2035", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025309", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{0: 2, 1: 2, 2: 3, 3: 4, 4: 0}, 4", "output": "'[2,2,3,4,0]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025310", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "8", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025311", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'path/to/t'", "output": "'t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025312", "code": "def calculate_max_drawdown_ratio(stock_prices):\n    if not stock_prices:\n        return 0.0\n    peak = stock_prices[0]\n    trough = stock_prices[0]\n    max_drawdown_ratio = 0.0\n    for price in stock_prices:\n        if price > peak:\n            peak = price\n            trough = price\n        elif price < trough:\n            trough = price\n            drawdown = peak - trough\n            drawdown_ratio = drawdown / peak\n            max_drawdown_ratio = max(max_drawdown_ratio, drawdown_ratio)\n    return max_drawdown_ratio\n", "entry_point": "calculate_max_drawdown_ratio", "input": "[12, 11]", "output": "0.08333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025313", "code": "import re\ndef find_unsubstituted_variables(input_string):\n    unsubstituted_variables = []\n    # Find all occurrences of ${} patterns in the input string\n    variables = re.findall(r'\\${(.*?)}', input_string)\n    for var in variables:\n        # Check if the variable is wrapped with Fn::Sub\n        if f'Fn::Sub(\"${{{var}}}\")' not in input_string:\n            unsubstituted_variables.append(var)\n    return unsubstituted_variables\n", "entry_point": "find_unsubstituted_variables", "input": "'Hello ${pla}, this is a test.'", "output": "['pla']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131499_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025314", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[2, 2, 1, 3, 2, 2, 2]", "output": "[2, 3, 3, 6, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025315", "code": "from typing import List\ndef calculate_total_time(tasks: List[int], cooldown: int) -> int:\n    last_occurrence = {}\n    time_elapsed = 0\n    for task_duration in tasks:\n        if task_duration not in last_occurrence or last_occurrence[task_duration] + cooldown <= time_elapsed:\n            time_elapsed += task_duration\n        else:\n            time_elapsed = last_occurrence[task_duration] + cooldown + task_duration\n        last_occurrence[task_duration] = time_elapsed\n    return time_elapsed\n", "entry_point": "calculate_total_time", "input": "[4, 6, 8], 0", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98461_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025316", "code": "def count_objective_combinations(objectives):\n    combination_count = {}\n    for obj in objectives:\n        key = (obj['objective'], obj['pretrain'], obj['fix_encoder'])\n        combination_count[key] = combination_count.get(key, 0) + 1\n    return combination_count\n", "entry_point": "count_objective_combinations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74543_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025317", "code": "def colour_to_hex(rgb):\n    # Convert each RGB value to its corresponding hexadecimal representation\n    hex_code = \"#{:02X}{:02X}{:02X}\".format(rgb[0], rgb[1], rgb[2])\n    return hex_code\n", "entry_point": "colour_to_hex", "input": "(16, 15, 14)", "output": "'#100F0E'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56406_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025318", "code": "TT_EQ = 'EQ'  # =\nTT_LPAREN = 'LPAREN'  # (\nTT_RPAREN = 'RPAREN'  # )\nTT_LSQUARE = 'LSQUARE'\nTT_RSQUARE = 'RSQUARE'\nTT_EE = 'EE'  # ==\nTT_NE = 'NE'  # !=\nTT_LT = 'LT'  # >\nTT_GT = 'GT'  # <\nTT_LTE = 'LTE'  # >=\nTT_GTE = 'GTE'  # <=\nTT_COMMA = 'COMMA'\nTT_ARROW = 'ARROW'\nTT_NEWLINE = 'NEWLINE'\nTT_EOF = 'EOF'\ndef lexer(code):\n    tokens = []\n    i = 0\n    while i < len(code):\n        char = code[i]\n        if char.isspace():\n            i += 1\n            continue\n        if char == '=':\n            tokens.append((TT_EQ, char))\n        elif char == '(':\n            tokens.append((TT_LPAREN, char))\n        elif char == ')':\n            tokens.append((TT_RPAREN, char))\n        elif char == '[':\n            tokens.append((TT_LSQUARE, char))\n        elif char == ']':\n            tokens.append((TT_RSQUARE, char))\n        elif char == '>':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_GTE, '>='))\n                i += 1\n            else:\n                tokens.append((TT_GT, char))\n        elif char == '<':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_LTE, '<='))\n                i += 1\n            else:\n                tokens.append((TT_LT, char))\n        elif char == '!':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_NE, '!='))\n                i += 1\n        elif char == ',':\n            tokens.append((TT_COMMA, char))\n        elif char == '-':\n            if i + 1 < len(code) and code[i + 1] == '>':\n                tokens.append((TT_ARROW, '->'))\n                i += 1\n        elif char.isdigit():\n            num = char\n            while i + 1 < len(code) and code[i + 1].isdigit():\n                num += code[i + 1]\n                i += 1\n            tokens.append(('NUM', num))\n        elif char.isalpha():\n            identifier = char\n            while i + 1 < len(code) and code[i + 1].isalnum():\n                identifier += code[i + 1]\n                i += 1\n            tokens.append(('ID', identifier))\n        elif char == '\\n':\n            tokens.append((TT_NEWLINE, char))\n        i += 1\n    tokens.append((TT_EOF, ''))  # End of file token\n    return tokens\n", "entry_point": "lexer", "input": "'y'", "output": "[('ID', 'y'), ('EOF', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28449_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025319", "code": "from math import sqrt\ndef calculate_distances(points):\n    distances = []\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            distances.append(distance)\n    return distances\n", "entry_point": "calculate_distances", "input": "[(0, 0), (3, 4), (1, 1)]", "output": "[5.0, 1.4142135623730951, 3.605551275463989]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64177_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025320", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9998", "output": "{1, 2, 9998, 4999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9997", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025321", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "10", "output": "[0, 0, 1, 3, 6, 2, 7, 13, 20, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025322", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "-10, 11, 'fofofofofoooooofo'", "output": "{'fofofofofoooooofo': -110}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025323", "code": "from typing import List, Tuple\nfrom math import sqrt\ndef max_distance(points: List[Tuple[int, int]]) -> float:\n    max_dist = 0\n    for i in range(len(points)):\n        for j in range(i+1, len(points)):\n            x1, y1 = points[i]\n            x2, y2 = points[j]\n            distance = sqrt((x2 - x1)**2 + (y2 - y1)**2)\n            max_dist = max(max_dist, distance)\n    return round(max_dist, 2)\n", "entry_point": "max_distance", "input": "[(0, 0), (13, 0)]", "output": "13.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39213_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025324", "code": "def process_numbers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_num = num + 2\n        else:\n            processed_num = num * 3\n        if processed_num % 3 == 0:\n            processed_num -= 3\n        processed_list.append(processed_num)\n    return processed_list\n", "entry_point": "process_numbers", "input": "[6, 6]", "output": "[8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89026_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025325", "code": "from typing import List\nimport queue\ndef get_bool_operators(query_string: str) -> List[str]:\n    bool_operators = queue.Queue()\n    for ch in query_string:\n        if ch == '&' or ch == '|':\n            bool_operators.put(ch)\n    return list(bool_operators.queue)\n", "entry_point": "get_bool_operators", "input": "'||'", "output": "['|', '|']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108905_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025326", "code": "def extract_content_types(file_data_list):\n    output_dict = {}\n    for file_data in file_data_list:\n        if \"_id\" in file_data and \"_content_type\" in file_data:\n            output_dict[file_data[\"_id\"]] = file_data[\"_content_type\"]\n    return output_dict\n", "entry_point": "extract_content_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61567_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9403", "output": "{1, 9403}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025328", "code": "def count_unique_chars(input_list):\n    unique_chars = set()\n    for string in input_list:\n        for char in string:\n            if char.isalnum():\n                unique_chars.add(char)\n    return len(unique_chars)\n", "entry_point": "count_unique_chars", "input": "['A', 'B', 'C', 'D', 'E', 'F', '1', '2', '3', '4', '5', '6']", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116447_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025329", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 10, 8]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18834_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025330", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4987", "output": "{1, 4987}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025331", "code": "def findMinMaxDifference(arr):\n    total_sum = sum(arr)\n    max_element = max(arr)\n    min_element = min(arr)\n    sum_without_max = total_sum - max_element\n    sum_without_min = total_sum - min_element\n    min_difference = abs(sum_without_max - sum(arr))\n    max_difference = abs(sum_without_min - sum(arr))\n    return min_difference, max_difference\n", "entry_point": "findMinMaxDifference", "input": "[2, 5, 7]", "output": "(7, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127521_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "22", "output": "{1, 2, 11, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025333", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2984", "output": "{1, 2, 4, 2984, 8, 746, 1492, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2983", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025334", "code": "def calc_minimum_travels(distances, k):\n    if not distances:\n        return 0\n    travels = 1\n    current_distance = distances[0]\n    for i in range(1, len(distances)):\n        if current_distance + distances[i] > k:\n            travels += 1\n            current_distance = distances[i]\n        else:\n            current_distance += distances[i]\n    return travels\n", "entry_point": "calc_minimum_travels", "input": "[10, 2, 1, 10, 2], 10", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20323_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025335", "code": "from typing import Dict, List\ndef topological_sort(graph: Dict[int, List[int]]) -> List[int]:\n    visited = set()\n    post_order = []\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        post_order.append(node)\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node)\n    return post_order[::-1]\n", "entry_point": "topological_sort", "input": "{2: [0, 1], 0: [1], 1: [6], 6: []}", "output": "[2, 0, 1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78090_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025336", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5599", "output": "{1, 11, 509, 5599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025337", "code": "def validateAdminServerProperty(config: dict) -> bool:\n    if 'admin_server_property' in config:\n        return False\n    return True\n", "entry_point": "validateAdminServerProperty", "input": "{}", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28544_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025338", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4112", "output": "{1, 2, 514, 4, 1028, 257, 2056, 8, 4112, 16}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4111", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025339", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[46, 46, 46]", "output": "1656", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025340", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9141", "output": "{1, 33, 3, 3047, 11, 9141, 277, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9140", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025341", "code": "from typing import List\ndef sum_of_evens(nums: List[int]) -> int:\n    even_sum = 0\n    for num in nums:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_of_evens", "input": "[8, 10, 12, 6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26745_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "835", "output": "{1, 835, 5, 167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025343", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025344", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9331", "output": "{1, 7, 43, 301, 9331, 1333, 217, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025345", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2978", "output": "{1, 2978, 2, 1489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2977", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025346", "code": "from typing import List\nfrom bisect import bisect_left\ndef relative_positions(h: List[int]) -> List[int]:\n    set_h = sorted(set(h))\n    result = []\n    for height in h:\n        pos = bisect_left(set_h, height)\n        result.append(pos)\n    return result\n", "entry_point": "relative_positions", "input": "[1, 3, 0, 1, 2, 1, 1, 0]", "output": "[1, 3, 0, 1, 2, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69881_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "562", "output": "{1, 562, 2, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025348", "code": "def generate_wiktionary_url(snippet, query, lang):\n    query = query.replace(' ', '_')\n    if lang == 'fr':\n        return '\"%s\" - http://fr.wiktionary.org/wiki/%s' % (snippet, query)\n    elif lang == 'es':\n        return '\"%s\" - http://es.wiktionary.org/wiki/%s' % (snippet, query)\n    else:\n        return '\"%s\" - http://en.wiktionary.org/wiki/%s' % (snippet, query)\n", "entry_point": "generate_wiktionary_url", "input": "'wwo', 'llo', 'en'", "output": "'\"wwo\" - http://en.wiktionary.org/wiki/llo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98635_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025349", "code": "def card_war(player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return player1_wins, player2_wins\n", "entry_point": "card_war", "input": "[1, 5, 1, 1, 1], [2, 4, 3, 4, 5]", "output": "(1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14853_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025350", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[3, 4, 4, 2, 3, 1]", "output": "[7, 8, 6, 5, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025351", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "6", "output": "'Saturn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025352", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "573", "output": "{1, 3, 573, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025353", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2966", "output": "{1, 2, 1483, 2966}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025355", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'tclclean_dttaera', 'ggrhsdr'", "output": "'tclclean_dttaera/ggrhsdr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025356", "code": "def simulate_card_game(deck1, deck2):\n    rounds_played = 0\n    while deck1 and deck2:\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        rounds_played += 1\n    return rounds_played\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4], [5, 6, 7, 8]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84703_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025357", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "513152", "output": "'VCode-513152'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025358", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[0, 1, 4, 6]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025359", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[8]", "output": "[8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025360", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1167", "output": "{1, 3, 389, 1167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025361", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'short.word.another.appleora'", "output": "'appleora'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025362", "code": "from typing import List\ndef longest_subarray_length(nums: List[int]) -> int:\n    last_seen = {}\n    start = 0\n    max_length = 0\n    for end in range(len(nums)):\n        if nums[end] in last_seen and last_seen[nums[end]] >= start:\n            start = last_seen[nums[end]] + 1\n        last_seen[nums[end]] = end\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_subarray_length", "input": "[1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16612_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9712", "output": "{1, 2, 4, 8, 9712, 16, 4856, 2428, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9711", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025364", "code": "def to_discord_format(unix_timestamp: int) -> str:\n    return f\"<t:{unix_timestamp}>\"\n", "entry_point": "to_discord_format", "input": "1630454401", "output": "'<t:1630454401>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127763_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025365", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[85, 84, 66, 50, 40]", "output": "[85, 84, 66]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025366", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[100, 100, 0], 3", "output": "66.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75916_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025367", "code": "from typing import List\ndef max_stairs_sum(steps: List[int]) -> int:\n    if not steps:\n        return 0\n    if len(steps) == 1:\n        return steps[0]\n    n1 = steps[0]\n    n2 = steps[1]\n    for i in range(2, len(steps)):\n        t = steps[i] + max(n1, n2)\n        n1, n2 = n2, t\n    return max(n1, n2)\n", "entry_point": "max_stairs_sum", "input": "[5, 8, 10, 5]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100230_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1874", "output": "{937, 1, 1874, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1873", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025369", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[3, 5, 2, 6], 8", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025370", "code": "from typing import Tuple\ndef split_with_escape(input_str: str, separator: str) -> Tuple[str, str]:\n    key = ''\n    val = ''\n    escaped = False\n    for i in range(len(input_str)):\n        if input_str[i] == '\\\\' and not escaped:\n            escaped = True\n        elif input_str[i] == separator and not escaped:\n            val = input_str[i+1:]\n            break\n        else:\n            if escaped:\n                key += input_str[i]\n                escaped = False\n            else:\n                key += input_str[i]\n    return key, val\n", "entry_point": "split_with_escape", "input": "'a==|', '|'", "output": "('a==', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12144_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1189", "output": "{1, 29, 1189, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025372", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        if i == 0:\n            result.append(lst[i] + lst[i+1])\n        elif i == len(lst) - 1:\n            result.append(lst[i-1] + lst[i])\n        else:\n            result.append(lst[i-1] + lst[i] + lst[i+1])\n    return result\n", "entry_point": "process_list", "input": "[1, 2, 3, 4, 5]", "output": "[3, 6, 9, 12, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145647_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025373", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'amazing'", "output": "'mzng'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025374", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=-1'", "output": "(None, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5812", "output": "{1, 2, 4, 1453, 5812, 2906}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5811", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025376", "code": "def generate_process_names(pids):\n    process_names = {}\n    for pid in pids:\n        if pid % 2 == 0 and pid % 3 == 0:\n            process_names[pid] = \"System User Process\"\n        elif pid % 2 == 0:\n            process_names[pid] = \"System Process\"\n        elif pid % 3 == 0:\n            process_names[pid] = \"User Process\"\n        else:\n            process_names[pid] = \"Unknown Process\"\n    return process_names\n", "entry_point": "generate_process_names", "input": "[2, 4]", "output": "{2: 'System Process', 4: 'System Process'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3943", "output": "{1, 3943}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3942", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025378", "code": "def splitp(p):\n    substrings = []\n    current_substring = \"\"\n    for char in p:\n        if char.isalpha():\n            current_substring += char\n        else:\n            if current_substring:\n                substrings.append(current_substring)\n                current_substring = \"\"\n    if current_substring:\n        substrings.append(current_substring)\n    return substrings\n", "entry_point": "splitp", "input": "'abababcab1def@ghaade!'", "output": "['abababcab', 'def', 'ghaade']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108005_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025379", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "1008", "output": "508536", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025380", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'\u4f60\u597d world 123.45%'", "output": "'Chinese: \u4f60\u597d\\nAlphanumeric: world, 123.45%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025381", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[1, 2, 3, 4, 5, 5, 5, 6, 7]", "output": "[1, 2, 3, 4, 5, 5, 5, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111970_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025382", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2077", "output": "{1, 67, 2077, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025383", "code": "def dict_to_ini_format(input_dict):\n    ini_str = \"[DEFAULT]\\n\"\n    for key, value in input_dict.items():\n        formatted_value = str(value).replace('\\n', '\\n\\t')\n        ini_str += f\"{key} = {formatted_value}\\n\"\n    return ini_str\n", "entry_point": "dict_to_ini_format", "input": "{}", "output": "'[DEFAULT]\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16218_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025384", "code": "import copy\ndef process_expansion_variables(media_block, content_version):\n    vars = copy.copy(media_block)\n    # Strip blacklisted keys\n    black_list = ['url', 'chapter_url']\n    for key in black_list:\n        if key in vars:\n            del vars[key]\n    # Add 'latest' expansion variable\n    vars['latest'] = '{}'.format(content_version)\n    return vars\n", "entry_point": "process_expansion_variables", "input": "{}, 'v1.2v1.2..3'", "output": "{'latest': 'v1.2v1.2..3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4404_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025385", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'dkkkdkkkdkkk', 3", "output": "'gnnngnnngnnn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025386", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, 4, 5, 3, 1, 1]", "output": "[4, 10, 9, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025387", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[11, 6, 7, 4]", "output": "[11, 7, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025388", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'***11123 Hlo*H!'", "output": "'11123HloH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025389", "code": "def process_audit_config(audit_config: dict) -> tuple:\n    # Update 'no_cache' key to True\n    audit_config['no_cache'] = True\n    # Remove 'enabled' key and store its value in is_enabled\n    is_enabled = audit_config.pop('enabled', False)\n    return audit_config, is_enabled\n", "entry_point": "process_audit_config", "input": "{}", "output": "({'no_cache': True}, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33329_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025390", "code": "import re\ndef sub(message, regex):\n    parts = regex.split(\"/\")\n    pattern = parts[1]\n    replacement = parts[2]\n    flags = parts[3] if len(parts) > 3 else \"\"\n    count = 1\n    if \"g\" in flags:\n        count = 0\n    elif flags.isdigit():\n        count = int(flags)\n    return re.sub(pattern, replacement, message, count)\n", "entry_point": "sub", "input": "'HelloWorld', '/o/0/g'", "output": "'Hell0W0rld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32281_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025391", "code": "def add_binary(a, b):\n    # Convert binary strings to decimal integers\n    int_a = int(a, 2)\n    int_b = int(b, 2)\n    # Add the decimal integers\n    sum_decimal = int_a + int_b\n    # Convert the sum back to binary representation\n    return bin(sum_decimal)[2:]\n", "entry_point": "add_binary", "input": "'111111', '111111'", "output": "'1111110'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38045_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025392", "code": "from typing import List, Tuple\ndef extract_positions(tracker_position_list: List[Tuple[int, int]], additional_tracker_positions: List[Tuple[int, int]]) -> List[Tuple[int, int]]:\n    full_list = []\n    for x in (tracker_position_list + additional_tracker_positions):\n        full_list.append((x[0], x[1]))\n    return full_list\n", "entry_point": "extract_positions", "input": "[(10, 10), (20, 20)], [(30, 30)]", "output": "[(10, 10), (20, 20), (30, 30)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2307_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025393", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "7.0", "output": "2.6457513111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025394", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7827", "output": "{3, 1, 7827, 2609}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025395", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3670", "output": "'01:01:10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025396", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hhelloello'", "output": "{'hhelloello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025397", "code": "def sum_of_modified_tuples(tuples_list, n):\n    sums_list = []\n    for tup in tuples_list:\n        modified_tup = [num * n for num in tup]\n        sum_modified_tup = sum(modified_tup)\n        sums_list.append(sum_modified_tup)\n    return sums_list\n", "entry_point": "sum_of_modified_tuples", "input": "[], 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60014_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025398", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[9, 5, 1, 2, 10, 1, 9, 0, 2], 9", "output": "[[9, 5, 1, 2, 10, 1, 9, 0, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025399", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2833", "output": "{1, 2833}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025400", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[8, 5, 5, 5, 3, 3, 3, 3]", "output": "[8, 5, 5, 5, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025401", "code": "# Define the errors dictionary\nerrors = {\n    1: \"Parse error, unexpected input\",\n    2: \"Parse error, unexpected '</'\",\n    3: \"Parse error, expecting '>'\",\n    4: \"Unterminated comment\",\n    5: \"Parse error, expecting \\\"'\\\"\",\n    6: \"Parse error, expecting '`'\",\n    7: \"Parse error, expecting variable (T_VARIABLE) or '{' or '$'\",\n    8: \"Unterminated tag\",\n    9: \"Parse error, expecting '.'\"\n}\n# Function to get error message based on error code\ndef get_error_message(error_code):\n    return errors.get(error_code, \"Unknown error code\")\n", "entry_point": "get_error_message", "input": "9", "output": "\"Parse error, expecting '.'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14777_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025402", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 0, 0, 0, 0], [44, 0, 0, 0, 0]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025403", "code": "def calculate_total_downtime_duration(downtimes):\n    total_duration = 0\n    for downtime in downtimes:\n        total_duration += downtime['start']\n    return total_duration\n", "entry_point": "calculate_total_downtime_duration", "input": "[{'start': 1632050000}]", "output": "1632050000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20590_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025404", "code": "from typing import List\ndef calculate_sum_times_length(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    return total_sum * len(numbers)\n", "entry_point": "calculate_sum_times_length", "input": "[28, 29]", "output": "114", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124810_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025405", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3327", "output": "{1, 3, 1109, 3327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025406", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5543", "output": "{1, 23, 241, 5543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025407", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[93, 78, 75, 70]", "output": "[93, 78, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8412_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025408", "code": "from typing import List, Optional, Tuple\ndef partition_odd_even(lst: List[int]) -> Tuple[List[Optional[int]], List[Optional[int]]]:\n    odd_elements = [num for num in lst if num % 2 != 0]\n    even_elements = [num for num in lst if num % 2 == 0]\n    max_len = max(len(odd_elements), len(even_elements))\n    odd_elements += [None] * (max_len - len(odd_elements))\n    even_elements += [None] * (max_len - len(even_elements))\n    return odd_elements, even_elements\n", "entry_point": "partition_odd_even", "input": "[1, 2, 3, 4, 5]", "output": "([1, 3, 5], [2, 4, None])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129934_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025409", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2020-02-28', '2020-03-03'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025410", "code": "from typing import List\ndef sum_divisible_by_two_and_three(numbers: List[int]) -> int:\n    divisible_sum = 0\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            divisible_sum += num\n    return divisible_sum\n", "entry_point": "sum_divisible_by_two_and_three", "input": "[6, 12, 12]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125267_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8452", "output": "{1, 2, 4226, 8452, 4, 2113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8451", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025412", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7278", "output": "{1, 2, 3, 6, 7278, 3639, 2426, 1213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7277", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025413", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3729", "output": "{1, 33, 3, 11, 3729, 113, 339, 1243}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3728", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025414", "code": "from collections import deque\ndef bfs_has_path(graph, start, end):\n    visited = set()\n    queue = deque([start])\n    while queue:\n        current_node = queue.popleft()\n        if current_node == end:\n            return True\n        visited.add(current_node)\n        for neighbor in graph.get(current_node, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n    return False\n", "entry_point": "bfs_has_path", "input": "{'A': ['B'], 'B': ['C'], 'C': ['A']}, 'D', 'A'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64727_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025415", "code": "GAIN_FOUR = 2\nGAIN_ONE = 0\nGAIN_TWO = 1\nMODE_CONTIN = 0\nMODE_SINGLE = 16\nOSMODE_STATE = 128\ndef calculate_gain(mode, rate):\n    if mode == MODE_CONTIN:\n        return rate * GAIN_ONE\n    elif mode == MODE_SINGLE:\n        return rate + GAIN_TWO\n    elif mode == OSMODE_STATE:\n        return rate - GAIN_FOUR\n    else:\n        return \"Invalid mode\"\n", "entry_point": "calculate_gain", "input": "MODE_CONTIN, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87824_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025416", "code": "import os\ndef serve_static_file(path):\n    routes = {\n        'bower_components': 'bower_components',\n        'modules': 'modules',\n        'styles': 'styles',\n        'scripts': 'scripts',\n        'fonts': 'fonts'\n    }\n    if path == 'robots.txt':\n        return 'robots.txt'\n    elif path == '404.html':\n        return '404.html'\n    elif path.startswith('fonts/'):\n        return os.path.join('fonts', path.split('/', 1)[1])\n    else:\n        for route, directory in routes.items():\n            if path.startswith(route + '/'):\n                return os.path.join(directory, path.split('/', 1)[1])\n    return '404.html'\n", "entry_point": "serve_static_file", "input": "'fonts/fotawesome.ttf'", "output": "'fonts/fotawesome.ttf'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103383_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7958", "output": "{1, 2, 3979, 173, 46, 7958, 23, 346}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025418", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[2, 3, 5, 3, 2, 3, 1, 3, 5]", "output": "[1, 5, 8, 8, 5, 5, 4, 4, 8, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025419", "code": "def count_test_results(results):\n    pass_count = sum(1 for result in results if result)\n    fail_count = sum(1 for result in results if not result)\n    return (pass_count, fail_count)\n", "entry_point": "count_test_results", "input": "[True, True, True, True, False, False, False]", "output": "(4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7187_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025420", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[3, 3, 3, 3, 3, 3]", "output": "[9, 9, 9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025421", "code": "def remove_chucks(hebrew_word):\n    \"\"\" Hebrew numbering systems use 'chuck-chucks' (quotation\n        marks that aren't being used to signify a quotation) \n        in between letters that are meant as numerics rather \n        than words. This function removes the 'chuck-chucks' \n        from the input Hebrew word.\n        Args:\n        hebrew_word (str): A Hebrew word with 'chuck-chucks'.\n        Returns:\n        str: The Hebrew word with 'chuck-chucks' removed.\n    \"\"\"\n    chucks = ['\u05f4', '\u05f3', '\"', \"'\"]\n    for chuck in chucks:\n        while chuck in hebrew_word:\n            hebrew_word = hebrew_word.replace(chuck, '')\n    return hebrew_word\n", "entry_point": "remove_chucks", "input": "'\u05f4\u05e9\u05e9\u05e9\u05e9\u05f4'", "output": "'\u05e9\u05e9\u05e9\u05e9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025422", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'1.10.1.10.1.10'", "output": "(1, 10, 1, 10, 1, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025423", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 2, 2, 3, 2, 6]", "output": "[7, 3, 4, 6, 6, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025424", "code": "from typing import List, Tuple\ndef find_pairs(lst: List[int], target_sum: int) -> List[Tuple[int, int]]:\n    seen_pairs = {}\n    result = []\n    for num in lst:\n        complement = target_sum - num\n        if complement in seen_pairs:\n            result.append((num, complement))\n        seen_pairs[num] = True\n    return result\n", "entry_point": "find_pairs", "input": "[6, -3, 5, -2], 3", "output": "[(-3, 6), (-2, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13694_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025425", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[6, 2, 7, 0, 2, 8, 6]", "output": "[0, 2, 2, 6, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025426", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'on'", "output": "'on'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025427", "code": "def trapped_rainwater(buildings):\n    if not buildings:\n        return 0\n    n = len(buildings)\n    left_max = [0] * n\n    right_max = [0] * n\n    left_max[0] = buildings[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], buildings[i])\n    right_max[n - 1] = buildings[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], buildings[i])\n    total_rainwater = 0\n    for i in range(n):\n        total_rainwater += max(0, min(left_max[i], right_max[i]) - buildings[i])\n    return total_rainwater\n", "entry_point": "trapped_rainwater", "input": "[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26473_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025428", "code": "def get_seq_len(sentence):\n    length = 0\n    for num in sentence:\n        length += 1\n        if num == 1:\n            break\n    return length\n", "entry_point": "get_seq_len", "input": "[1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87843_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025429", "code": "def extract_info(input_string: str) -> dict:\n    extracted_info = {}\n    pairs = input_string.split(',')\n    for pair in pairs:\n        key, value = pair.split(':')\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            value = int(value)\n        extracted_info[key] = value\n    return extracted_info\n", "entry_point": "extract_info", "input": "'cNity: N'", "output": "{'cNity': 'N'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118882_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025430", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'e/a', '21234521234555'", "output": "'e/a/21234521234555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5065", "output": "{1, 5065, 5, 1013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025432", "code": "OPENTHERM_MSG_TYPE = {\n    0b000: \"Read-Data\",\n    0b001: \"Write-Data\",\n    0b010: \"Invalid-Data\",\n    0b011: \"-reserved-\",\n    0b100: \"Read-Ack\",\n    0b101: \"Write-Ack\",\n    0b110: \"Data-Invalid\",\n    0b111: \"Unknown-DataId\",\n}\ndef decode_opentherm_message(binary_message):\n    if binary_message in OPENTHERM_MSG_TYPE:\n        return OPENTHERM_MSG_TYPE[binary_message]\n    else:\n        return \"Unknown Type\"\n", "entry_point": "decode_opentherm_message", "input": "0", "output": "'Read-Data'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29166_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6145", "output": "{1229, 1, 5, 6145}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6144", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025434", "code": "def reverse(input_str):\n    reversed_str = ''\n    for i in range(len(input_str) - 1, -1, -1):\n        reversed_str += input_str[i]\n    return reversed_str\n", "entry_point": "reverse", "input": "'robot'", "output": "'tobor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77619_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025435", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[32, 29, 29, 24, 24, 19, 15, 10], 6", "output": "[32, 29, 29, 24, 24, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025436", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[1, 1], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025437", "code": "import re\ndef get_tags(data):\n    pattern = r'<([a-zA-Z0-9]+)[^>]*>'\n    tags = re.findall(pattern, data)\n    unique_tags = list(set(tags))\n    return unique_tags\n", "entry_point": "get_tags", "input": "'<p></p>'", "output": "['p']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025438", "code": "def calc_minimum_travels(distances, k):\n    if not distances:\n        return 0\n    travels = 1\n    current_distance = distances[0]\n    for i in range(1, len(distances)):\n        if current_distance + distances[i] > k:\n            travels += 1\n            current_distance = distances[i]\n        else:\n            current_distance += distances[i]\n    return travels\n", "entry_point": "calc_minimum_travels", "input": "[3, 4, 2], 10", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20323_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025439", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "18, 10", "output": "'18'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025440", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "7", "output": "'\\t\\t\\t\\t\\t\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025441", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[6, 5], [5, 4], [0, 8], [6, 5]]", "output": "[6, 5, 5, 4, 0, 8, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025442", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[6, 1, 5, -1, 3, 4]", "output": "[6, 1, 5, -1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025443", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'1.1.22'", "output": "(1, 1, 22)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025444", "code": "from typing import List\ndef weighted_sum(methods: List[tuple]) -> float:\n    total_weighted_sum = 0\n    for result, frames in methods:\n        total_weighted_sum += result * frames\n    return total_weighted_sum\n", "entry_point": "weighted_sum", "input": "[(2.0, 10), (0.6, 1)]", "output": "20.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26992_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025445", "code": "from typing import List\ndef total_size_above_threshold(file_sizes: List[int], threshold: int) -> int:\n    total_size = 0\n    for size in file_sizes:\n        if size > threshold:\n            total_size += size\n    return total_size\n", "entry_point": "total_size_above_threshold", "input": "[200, 150, 150], 100", "output": "500", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13352_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025446", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'Do'", "output": "{'do': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "177", "output": "{3, 1, 177, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025448", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[5, 3, 8], 20", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025449", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'UUUUL'", "output": "(-1, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025450", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7477", "output": "{1, 7477}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7476", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025451", "code": "def calculate_weighted_average(probabilities):\n    weighted_sum = 0\n    for value, probability in probabilities.items():\n        weighted_sum += value * probability\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "{2.0: 0.7, 3.0: 0.3}", "output": "2.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63042_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025452", "code": "def increment_number(digits):\n    carry = 1\n    for i in range(len(digits) - 1, -1, -1):\n        digits[i] += carry\n        carry = digits[i] // 10\n        digits[i] %= 10\n        if carry == 0:\n            break\n    if carry == 1:\n        digits.insert(0, 1)\n    return digits\n", "entry_point": "increment_number", "input": "[4, 4, 1, 1, -1, 1, 4, -1, 4]", "output": "[4, 4, 1, 1, -1, 1, 4, -1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105438_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025453", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'tTeText\\n**xt**'", "output": "'tTeText\\n<strong>xt</strong>\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025454", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'/por/patoy'", "output": "\"Directory '/por/patoy' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025455", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'1.21.9'", "output": "'1.22.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025456", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'3+3'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025457", "code": "from typing import List\ndef calculate_sum_max_odd(input_list: List[int]) -> int:\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd if sum_even > 0 else 0\n", "entry_point": "calculate_sum_max_odd", "input": "[2, 4, 6, 3]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134591_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025458", "code": "GAS_LIMIT = 3141592\nGAS_PRICE = 20  # 20 shannon\ndef calculate_gas_cost(gas_limit, gas_price):\n    return gas_limit * gas_price\n", "entry_point": "calculate_gas_cost", "input": "GAS_LIMIT, GAS_PRICE", "output": "62831840", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79990_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025459", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'helhheow:ayhu'", "output": "['helhheow', 'ayhu']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025460", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'Tristriaining:'", "output": "{'Tristriaining': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025461", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7375", "output": "{1, 1475, 5, 295, 7375, 25, 59, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025462", "code": "def process_reaction_tokens(tokens):\n    reaction_info = {}\n    for line in tokens.split('\\n'):\n        if line.startswith('[NAME:'):\n            reaction_info['name'] = line.split('[NAME:')[1][:-1]\n        elif line.startswith('[REAGENT:'):\n            reagent_info = line.split(':')\n            reaction_info.setdefault('reagents', []).append(reagent_info[4])\n        elif line.startswith('[PRODUCT:'):\n            product_info = line.split(':')\n            reaction_info['product'] = product_info[5]\n        elif line == '[SMELTER]':\n            reaction_info['facility'] = 'SMELTER'\n        elif line == '[FUEL]':\n            reaction_info['fuel_required'] = True\n    return reaction_info\n", "entry_point": "process_reaction_tokens", "input": "'[NAME:sUM]'", "output": "{'name': 'sUM'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125354_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5827", "output": "{1, 5827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025464", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3964", "output": "{1, 2, 4, 3964, 1982, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3963", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025465", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "82", "output": "{2: 1, 41: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025466", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'hlo world'", "output": "'world hlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025467", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8007", "output": "{1, 3, 8007, 2669, 17, 51, 471, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "763", "output": "{1, 763, 109, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025469", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6064", "output": "{1, 2, 4, 8, 1516, 6064, 16, 758, 3032, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6063", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025470", "code": "def score(dice):\n    score = 0\n    counts = [0] * 7  # Initialize counts for each dice face (index 1-6)\n    for roll in dice:\n        counts[roll] += 1\n    for i in range(1, 7):\n        if counts[i] >= 3:\n            if i == 1:\n                score += 1000\n            else:\n                score += i * 100\n            counts[i] -= 3\n    score += counts[1] * 100  # Add remaining 1's\n    score += counts[5] * 50   # Add remaining 5's\n    return score\n", "entry_point": "score", "input": "[1, 1]", "output": "200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95031_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025471", "code": "def find_starting_tokens(e):\n    starting_tokens = []\n    current_label = None\n    for i, label in enumerate(e):\n        if label != current_label:\n            starting_tokens.append(i)\n            current_label = label\n    return starting_tokens\n", "entry_point": "find_starting_tokens", "input": "['A', 'B', 'C', 'D', 'E', 'E', 'F', 'G']", "output": "[0, 1, 2, 3, 4, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47145_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7396", "output": "{1, 2, 7396, 4, 43, 172, 3698, 86, 1849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7395", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025473", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3423", "output": "{1, 3, 163, 7, 489, 1141, 21, 3423}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025474", "code": "def process_integers(nums):\n    modified_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            modified_nums.append(num + 2)\n        elif num % 2 != 0:\n            modified_nums.append(num * 3)\n        if num % 5 == 0:\n            modified_nums[-1] -= 5\n    return modified_nums\n", "entry_point": "process_integers", "input": "[38, 3, 2, 8, 9]", "output": "[40, 9, 4, 10, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79730_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025475", "code": "def process_awards(awards_list):\n    awards_dict = {}\n    for award_string in awards_list:\n        if \"award_with_\" in award_string:\n            award_type = award_string.split(\"award_with_\")[-1]\n            terms = award_string.split(\"_with_\")[0]\n        elif \"award_without_\" in award_string:\n            award_type = award_string.split(\"award_without_\")[-1]\n            terms = \"No terms specified\"\n        elif \"tas_with_\" in award_string:\n            award_type = award_string.split(\"tas_with_\")[-1]\n            terms = award_string.split(\"_with_\")[0]\n        elif \"multiple_awards_with_\" in award_string:\n            award_type = award_string.split(\"multiple_awards_with_\")[-1]\n            terms = award_string.split(\"_with_\")[0]\n        elif \"tas_with_nonintuitive_agency\" in award_string:\n            award_type = \"tas_with_nonintuitive_agency\"\n            terms = \"Nonintuitive agency terms apply\"\n        awards_dict[award_type] = terms\n    return awards_dict\n", "entry_point": "process_awards", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68855_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025476", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2581", "output": "{89, 1, 29, 2581}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1847", "output": "{1, 1847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025478", "code": "def reconstruct_number(input_str):\n    parts = input_str.split()\n    hundreds = int(parts[0])\n    tens = int(parts[3])\n    units = int(parts[6])\n    original_number = hundreds * 100 + tens * 10 + units\n    return original_number\n", "entry_point": "reconstruct_number", "input": "'5 a 0 1 b 0 9'", "output": "519", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44641_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025479", "code": "def calculate_available_ips(start_ip, end_ip):\n    def ip_to_int(ip):\n        parts = ip.split('.')\n        return int(parts[0]) * 256**3 + int(parts[1]) * 256**2 + int(parts[2]) * 256 + int(parts[3])\n    start_int = ip_to_int(start_ip)\n    end_int = ip_to_int(end_ip)\n    total_ips = end_int - start_int + 1\n    available_ips = total_ips - 2  # Exclude network and broadcast addresses\n    return available_ips\n", "entry_point": "calculate_available_ips", "input": "'192.168.1.0', '192.168.1.9'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16242_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025480", "code": "def process_list(input_list):\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "process_list", "input": "[3, 4, 2, 5, 3]", "output": "[7, 6, 7, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137228_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025481", "code": "def calculate_next_pose_cell(view_cell, vtrans, vrot):\n    POSECELL_VTRANS_SCALING = 1.5  # Example scaling factor, you can adjust this as needed\n    vtrans = vtrans * POSECELL_VTRANS_SCALING\n    # Calculate the updated x, y, and theta indices based on the provided parameters\n    x = view_cell[0] + vtrans\n    y = view_cell[1] + vtrans\n    th = view_cell[2] + vrot\n    return (x, y, th)\n", "entry_point": "calculate_next_pose_cell", "input": "(-2.0, 8.0, 75.0), 10, 0", "output": "(13.0, 23.0, 75.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88582_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025482", "code": "def format_text(text: str) -> str:\n    formatted_text = \"\"\n    words = text.split()\n    for word in words:\n        if word.startswith('*') and word.endswith('*'):\n            formatted_text += word.strip('*').upper() + \" \"\n        elif word.startswith('_') and word.endswith('_'):\n            formatted_text += word.strip('_').lower() + \" \"\n        elif word.startswith('`') and word.endswith('`'):\n            formatted_text += word.strip('`')[::-1] + \" \"\n        else:\n            formatted_text += word + \" \"\n    return formatted_text.strip()\n", "entry_point": "format_text", "input": "'WOR*WORL*LD'", "output": "'WOR*WORL*LD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10452_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025483", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(15, 32, 45), 300", "output": "56265", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025484", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025485", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "2, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025486", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        sum_val = input_list[i] + input_list[(i + 1) % n]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 2, 1, 3, 4]", "output": "[3, 4, 3, 4, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149618_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025487", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'lovve'", "output": "'lovve'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025488", "code": "from typing import List\ndef filter_even_numbers(input_list: List[int]) -> List[int]:\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 2, 3, 10, 4, 5, 10, 7, 8, 9, 8]", "output": "[2, 10, 4, 10, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104933_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025489", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'1.0.3'", "output": "'1.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025490", "code": "import math\ndef calculate_gaussian_coefficients(ndim):\n    p_i = math.pi\n    coefficients = 1 / (math.sqrt(2 * p_i) ** ndim)\n    return coefficients\n", "entry_point": "calculate_gaussian_coefficients", "input": "54", "output": "2.8128304467782174e-22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134730_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025491", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "3, 13", "output": "39", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025492", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1345", "output": "{1345, 1, 269, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9629", "output": "{1, 9629}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1348", "output": "{1, 674, 2, 1348, 4, 337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1347", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025495", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "[2.5, 2.75, 10], 1", "output": "(2.5, 2.75, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025496", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'world'", "output": "{'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025497", "code": "def generate_indices(s):\n    modes = []\n    for i, c in enumerate(s):\n        modes += [i] * int(c)\n    return sorted(modes)\n", "entry_point": "generate_indices", "input": "'1321'", "output": "[0, 1, 1, 1, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130187_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025498", "code": "def merge_records(record, metadata, keys):\n    merged_values = []\n    for key in keys:\n        if key in record and key in metadata.get(\"metadata\", {}):\n            merged_values.append(record[key])\n    return \"_\".join(merged_values)\n", "entry_point": "merge_records", "input": "{}, {'metadata': {}}, []", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143198_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025499", "code": "def average_absolute_difference(list1, list2):\n    if len(list1) != len(list2):\n        return \"Error: Input lists must be of equal length\"\n    abs_diff = [abs(a - b) for a, b in zip(list1, list2)]\n    avg_abs_diff = sum(abs_diff) / len(abs_diff)\n    return avg_abs_diff\n", "entry_point": "average_absolute_difference", "input": "[1, 2, 3], [4, 5]", "output": "'Error: Input lists must be of equal length'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122239_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025500", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3747", "output": "{3, 1, 3747, 1249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3746", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025501", "code": "from typing import List, Dict\ndef count_user_ips(user_ips: List[str]) -> Dict[str, int]:\n    ip_count = {}\n    for ip in user_ips:\n        if ip in ip_count:\n            ip_count[ip] += 1\n        else:\n            ip_count[ip] = 1\n    return ip_count\n", "entry_point": "count_user_ips", "input": "['192.168.1.1', '192.168.1.1', '192.168.1.1']", "output": "{'192.168.1.1': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116403_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025502", "code": "from datetime import datetime\ndue_date_format = '%Y-%m-%d'\ndatepicker_date_format = '%m%d%Y'\ndef convert_datepicker_to_due_date(datepicker_date):\n    try:\n        # Parse the input date in datepicker format\n        parsed_date = datetime.strptime(datepicker_date, datepicker_date_format)\n        # Convert the parsed date to due date format\n        due_date = parsed_date.strftime(due_date_format)\n        return due_date\n    except ValueError:\n        return \"Invalid date format provided\"\n", "entry_point": "convert_datepicker_to_due_date", "input": "'07202021'", "output": "'2021-07-20'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3548_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025503", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9587", "output": "{1, 9587}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9586", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025504", "code": "from typing import List\ndef minimize_task_completion_time(tasks: List[int], workers: int) -> int:\n    tasks.sort(reverse=True)\n    worker_times = [0] * workers\n    for task in tasks:\n        min_time_worker = worker_times.index(min(worker_times))\n        worker_times[min_time_worker] += task\n    return max(worker_times)\n", "entry_point": "minimize_task_completion_time", "input": "[], 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68875_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025505", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "199", "output": "{1, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025506", "code": "def string_replace(to_find_string: str, replace_string: str, target_string: str) -> str:\n    index = target_string.find(to_find_string)\n    if index == -1:\n        return target_string\n    beginning = target_string[:index]\n    end = target_string[index + len(to_find_string):]\n    new_string = beginning + replace_string + end\n    return new_string\n", "entry_point": "string_replace", "input": "'cat', 'dog', 'cat.ox'", "output": "'dog.ox'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61704_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025507", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "4, 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025508", "code": "from typing import List\ndef calculate_total_test_cases(modules: List[int]) -> int:\n    total_test_cases = sum(modules)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "[18]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133094_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025509", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9885", "output": "{1, 3, 5, 15, 659, 1977, 9885, 3295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025510", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'HELLO', 'JOHN', 2023", "output": "'HELJOH2023'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025511", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "10", "output": "5555555553", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025512", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1258", "output": "{1, 2, 34, 37, 1258, 74, 17, 629}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025513", "code": "from math import acos, degrees\ndef find_triangle_angles(a, b, c):\n    if a + b > c and b + c > a and a + c > b:  # Triangle inequality theorem check\n        first_angle = round(degrees(acos((b ** 2 + c ** 2 - a ** 2) / (2 * b * c))))\n        second_angle = round(degrees(acos((a ** 2 + c ** 2 - b ** 2) / (2 * a * c))))\n        third_angle = 180 - first_angle - second_angle\n        return sorted([first_angle, second_angle, third_angle])\n    else:\n        return None\n", "entry_point": "find_triangle_angles", "input": "77, 77, 99", "output": "[50, 50, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40430_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025514", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "2, 2, 4", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025515", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3667", "output": "'1 hr 1 min 7 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025516", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "-2, -24, -16", "output": "-8656000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025517", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7647", "output": "{1, 3, 2549, 7647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025518", "code": "from typing import List\ndef find_maximal_subarray_sum(nums: List[int], k: int) -> int:\n    max_sum = float('-inf')\n    current_sum = 0\n    start = 0\n    for end in range(len(nums)):\n        current_sum += nums[end]\n        if end - start + 1 > k:\n            current_sum -= nums[start]\n            start += 1\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "find_maximal_subarray_sum", "input": "[4, 5, 3, 2], 3", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140720_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025519", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[4, 5, 1, 1, -1, 0, 4]", "output": "[9, 2, -1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025520", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'swollr'", "output": "{'swollr': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025521", "code": "def modulus_operation(x, denom):\n    result = []\n    for num in x:\n        result.append(num % denom)\n    return result\n", "entry_point": "modulus_operation", "input": "[2, 1, 5], 3", "output": "[2, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26909_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8047", "output": "{1, 619, 13, 8047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025523", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, 6.0, 6.5", "output": "12.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025524", "code": "from collections import namedtuple\nFunctionDefinition = namedtuple('FunctionDefinition', 'name params defaults body')\nAssignment = namedtuple('Assignment', 'targets expr')\nIfElse = namedtuple('IfElse', 'expr cond alt')\nWhile = namedtuple('While', 'cond body alt')\ndef generate_python_code(ast):\n    if isinstance(ast, FunctionDefinition):\n        params = ', '.join(ast.params)\n        defaults = ', '.join(f'{param}={value}' for param, value in ast.defaults.items())\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        return f'def {ast.name}({params}):{\"\" if not defaults else f\" {defaults}\"}\\n{body}'\n    if isinstance(ast, Assignment):\n        targets = ', '.join(ast.targets)\n        expr = generate_python_code(ast.expr)\n        return f'{targets} = {expr}'\n    if isinstance(ast, IfElse):\n        expr = generate_python_code(ast.expr)\n        cond = generate_python_code(ast.cond)\n        alt = generate_python_code(ast.alt)\n        return f'if {expr}:\\n{cond}\\nelse:\\n{alt}'\n    if isinstance(ast, While):\n        cond = generate_python_code(ast.cond)\n        body = '\\n'.join(generate_python_code(node) for node in ast.body)\n        alt = generate_python_code(ast.alt)\n        return f'while {cond}:\\n{body}\\nelse:\\n{alt}'\n    return str(ast)\n", "entry_point": "generate_python_code", "input": "Assignment(targets=['x'], expr=12)", "output": "'x = 12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137910_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025525", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 10)\n        elif num % 2 != 0:\n            processed_list.append(num - 5)\n        if num % 5 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[-8, -10, 8, 2, 6, 19]", "output": "[2, 0, 18, 12, 16, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135947_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025526", "code": "from typing import List, Dict\ndef process_data(infrule_list_of_dics: List[Dict[str, str]]) -> List[str]:\n    unique_infrules = set()\n    for entry in infrule_list_of_dics:\n        if 'inference rule' in entry:\n            unique_infrules.add(entry['inference rule'])\n    return list(unique_infrules)\n", "entry_point": "process_data", "input": "[{'inference rule': 'Rule 3'}]", "output": "['Rule 3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91803_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025527", "code": "import itertools\ndef optimize_cooling_system(cooling_units, cooling_demand, cost_per_hour):\n    min_cost = float('inf')\n    for r in range(1, len(cooling_units) + 1):\n        for combo in itertools.combinations(cooling_units, r):\n            total_consumption = sum(combo)\n            total_cost = total_consumption * cost_per_hour\n            if total_consumption >= cooling_demand and total_cost < min_cost:\n                min_cost = total_cost\n    return min_cost\n", "entry_point": "optimize_cooling_system", "input": "[1, 1], 1, -2.8900000000000023", "output": "-5.780000000000005", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67427_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025528", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[1, 4, 9, 16]", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025529", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'agee: '", "output": "{'agee': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025530", "code": "def count_pauli_words(num_wires):\n    if num_wires == 1:\n        return 2\n    else:\n        sub_count = count_pauli_words(num_wires - 1)\n        return 2 * sub_count + sub_count\n", "entry_point": "count_pauli_words", "input": "1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129484_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025531", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    fib_prev, fib_curr = 0, 1\n    for _ in range(N):\n        fib_sum += fib_curr\n        fib_prev, fib_curr = fib_curr, fib_prev + fib_curr\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "15", "output": "1596", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41805_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025532", "code": "_escapes = [('a', '1'), ('b', '2'), ('c', '3')]  # Example escape rules\ndef escape_string(input_string):\n    for a, b in _escapes:\n        input_string = input_string.replace(a, b)\n    return input_string\n", "entry_point": "escape_string", "input": "'aaaaa'", "output": "'11111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9621_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025533", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9777", "output": "{1, 3, 3259, 9777}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9776", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025534", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2588", "output": "{1, 2, 4, 647, 1294, 2588}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2587", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025535", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/Documents/example.txt'", "output": "('C:/Users/Documents', 'example.txt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025536", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'the'", "output": "{'the': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104136_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3337", "output": "{1, 71, 3337, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025538", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[0, 0, 3, 3, -1, 4, 3, 4]", "output": "[0, 3, 6, 2, 3, 7, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025539", "code": "def split_input_target(chunk):\n    input_text = chunk[:-1]\n    target_text = chunk[1:]\n    return input_text, target_text\n", "entry_point": "split_input_target", "input": "'hello'", "output": "('hell', 'ello')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41781_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025540", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "791", "output": "{1, 7, 113, 791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025541", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[5, 8, 3, 4, 2, 2, 2]", "output": "[5, 9, 5, 7, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3497", "output": "{1, 269, 3497, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025543", "code": "def rotate(arr, n):\n    for _ in range(n):\n        x = arr[-1]\n        for i in range(len(arr) - 1, 0, -1):\n            arr[i] = arr[i - 1]\n        arr[0] = x\n    return arr\n", "entry_point": "rotate", "input": "[6, 4, 6, 4, 1, 2, 4], 3", "output": "[1, 2, 4, 6, 4, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51969_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1263", "output": "{1, 3, 421, 1263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025545", "code": "def check_version_status(current_version, existing_version):\n    if current_version > existing_version:\n        return \"Update Required\"\n    elif current_version == existing_version:\n        return \"Up to Date\"\n    else:\n        return \"Downgrade Not Allowed\"\n", "entry_point": "check_version_status", "input": "1.0, 1.0", "output": "'Up to Date'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61614_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025546", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "1604.93", "output": "'R$:1604,93'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025547", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'mmmmqmqm', 1", "output": "'nnnnrnrn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29173_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025548", "code": "import math\ndef calculate_total_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i]\n        x2, y2 = points[i + 1]\n        length = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n        total_length += length\n    return total_length\n", "entry_point": "calculate_total_length", "input": "[(0, 0), (4, 4)]", "output": "5.656854249492381", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3574_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025549", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 1, 1, 2, 1, 3]", "output": "[3, 2, 3, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025550", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8198", "output": "{1, 2, 4099, 8198}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8197", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025551", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "1.0, 12.0, 1", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025552", "code": "def parse_version(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "parse_version", "input": "'0.0.3'", "output": "(0, 0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128188_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025553", "code": "import re\ndef extract_unique_words(comments):\n    unique_words = set()\n    # Split the comments into individual words\n    words = comments.split()\n    # Remove leading and trailing punctuation marks from each word\n    words = [re.sub(r'^\\W+|\\W+$', '', word) for word in words]\n    # Convert words to lowercase for case-insensitive comparison\n    words = [word.lower() for word in words]\n    # Add unique words to the set\n    unique_words.update(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'tdata.he'", "output": "['tdata.he']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41153_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025554", "code": "import math\ndef calculate_total_memory_size(program_memory_requirements, granule_size):\n    total_memory_required = sum(program_memory_requirements)\n    total_memory_required = math.ceil(total_memory_required / granule_size) * granule_size\n    return total_memory_required\n", "entry_point": "calculate_total_memory_size", "input": "[1281], 1", "output": "1281", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110476_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025555", "code": "TT_EQ = 'EQ'  # =\nTT_LPAREN = 'LPAREN'  # (\nTT_RPAREN = 'RPAREN'  # )\nTT_LSQUARE = 'LSQUARE'\nTT_RSQUARE = 'RSQUARE'\nTT_EE = 'EE'  # ==\nTT_NE = 'NE'  # !=\nTT_LT = 'LT'  # >\nTT_GT = 'GT'  # <\nTT_LTE = 'LTE'  # >=\nTT_GTE = 'GTE'  # <=\nTT_COMMA = 'COMMA'\nTT_ARROW = 'ARROW'\nTT_NEWLINE = 'NEWLINE'\nTT_EOF = 'EOF'\ndef lexer(code):\n    tokens = []\n    i = 0\n    while i < len(code):\n        char = code[i]\n        if char.isspace():\n            i += 1\n            continue\n        if char == '=':\n            tokens.append((TT_EQ, char))\n        elif char == '(':\n            tokens.append((TT_LPAREN, char))\n        elif char == ')':\n            tokens.append((TT_RPAREN, char))\n        elif char == '[':\n            tokens.append((TT_LSQUARE, char))\n        elif char == ']':\n            tokens.append((TT_RSQUARE, char))\n        elif char == '>':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_GTE, '>='))\n                i += 1\n            else:\n                tokens.append((TT_GT, char))\n        elif char == '<':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_LTE, '<='))\n                i += 1\n            else:\n                tokens.append((TT_LT, char))\n        elif char == '!':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_NE, '!='))\n                i += 1\n        elif char == ',':\n            tokens.append((TT_COMMA, char))\n        elif char == '-':\n            if i + 1 < len(code) and code[i + 1] == '>':\n                tokens.append((TT_ARROW, '->'))\n                i += 1\n        elif char.isdigit():\n            num = char\n            while i + 1 < len(code) and code[i + 1].isdigit():\n                num += code[i + 1]\n                i += 1\n            tokens.append(('NUM', num))\n        elif char.isalpha():\n            identifier = char\n            while i + 1 < len(code) and code[i + 1].isalnum():\n                identifier += code[i + 1]\n                i += 1\n            tokens.append(('ID', identifier))\n        elif char == '\\n':\n            tokens.append((TT_NEWLINE, char))\n        i += 1\n    tokens.append((TT_EOF, ''))  # End of file token\n    return tokens\n", "entry_point": "lexer", "input": "'x'", "output": "[('ID', 'x'), ('EOF', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28449_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025556", "code": "from typing import List, Dict\ndef count_blueprint_characters(blueprints: List[str]) -> Dict[str, int]:\n    blueprint_lengths = {}\n    for blueprint in blueprints:\n        if not blueprint[0].islower():\n            blueprint_lengths[blueprint] = len(blueprint)\n    return blueprint_lengths\n", "entry_point": "count_blueprint_characters", "input": "['admin', 'Admin']", "output": "{'Admin': 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32471_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7996", "output": "{1, 2, 4, 1999, 7996, 3998}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7995", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025558", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "80", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025559", "code": "def convert_to_padded_string(num, total_digits):\n    num_str = str(num)\n    if len(num_str) < total_digits:\n        padded_str = '0' * (total_digits - len(num_str)) + num_str\n    else:\n        padded_str = num_str\n    return padded_str\n", "entry_point": "convert_to_padded_string", "input": "9, 12", "output": "'000000000009'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41017_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025560", "code": "import math\ndef calculateDownloadCost(fileSize, downloadSpeed, costPerGB):\n    fileSizeGB = fileSize / 1024  # Convert file size from MB to GB\n    downloadTime = fileSizeGB * 8 / downloadSpeed  # Calculate download time in seconds\n    totalCost = math.ceil(fileSizeGB) * costPerGB  # Round up downloaded GB and calculate total cost\n    return totalCost\n", "entry_point": "calculateDownloadCost", "input": "10240, 20, 0.9922079999999998", "output": "9.922079999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44451_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025561", "code": "def extract_unique_tags(html_content):\n    unique_tags = set()\n    tag = ''\n    inside_tag = False\n    for char in html_content:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n            tag = tag.strip()\n            if tag:\n                unique_tags.add(tag)\n            tag = ''\n        elif inside_tag:\n            if char.isalnum():\n                tag += char\n    return sorted(list(unique_tags))\n", "entry_point": "extract_unique_tags", "input": "'<html></html>'", "output": "['html']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126025_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025562", "code": "def second_most_frequent(arr):\n    most_freq = None\n    second_most_freq = None\n    counter = {}\n    second_counter = {}\n    for n in arr:\n        counter.setdefault(n, 0)\n        counter[n] += 1\n        if counter[n] > counter.get(most_freq, 0):\n            second_most_freq = most_freq\n            most_freq = n\n        elif counter[n] > counter.get(second_most_freq, 0) and n != most_freq:\n            second_most_freq = n\n    return second_most_freq\n", "entry_point": "second_most_frequent", "input": "[2, 2, 2, 1, 1, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120689_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025563", "code": "def generate_full_path(directory_path, file_name):\n    return f\"{directory_path}/{file_name}\"\n", "entry_point": "generate_full_path", "input": "'/e', 'exaexat'", "output": "'/e/exaexat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49690_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025564", "code": "from typing import List\ndef max_contiguous_sum(lst: List[int]) -> int:\n    max_sum = lst[0]\n    current_sum = lst[0]\n    for num in lst[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_contiguous_sum", "input": "[2, -1, 5, 1]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132431_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025565", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'preprocessor_name'", "output": "('preprocessor_name', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025566", "code": "def word_frequency(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Initialize an empty dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the frequencies\n    for word in words:\n        # Remove punctuation from the word\n        word = ''.join(char for char in word if char.isalnum())\n        if word:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'hhelo'", "output": "{'hhelo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135280_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "342", "output": "{1, 2, 3, 6, 38, 9, 171, 114, 18, 19, 342, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt341", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025568", "code": "def get_std_dev(total_size: int, comm_size: int) -> float:\n    # Calculate the ratio of comm_size to total_size\n    ratio = comm_size / total_size\n    # Calculate the reciprocal of the ratio and normalize it\n    normalized_value = (1 / ratio) / (total_size * 3)\n    return normalized_value\n", "entry_point": "get_std_dev", "input": "21, 20", "output": "0.016666666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72252_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6226", "output": "{1, 2, 3113, 11, 6226, 566, 22, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6225", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025570", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[0, 0, -2, 4, 5, 1, 4, 4]", "output": "[0, 0, -4, 8, 25, 1, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025571", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'7', '9', 'cpu'", "output": "'7.9-cpu-ml-scala2.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025572", "code": "def update_variables(x, y):\n    if isinstance(x, int):\n        x += 5\n    if y is None:\n        y = 10\n    if x is not None and y is not None:\n        return x * y\n    else:\n        return (x if x is not None else 0) + (y if y is not None else 0) + 10\n", "entry_point": "update_variables", "input": "3, None", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22911_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025573", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[307, 307, 307], 3", "output": "307.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025574", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "9, 6", "output": "5005", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025575", "code": "from itertools import combinations\ndef find_minimum_value(sum_heights, to_sub, top):\n    minimum = -1\n    for r in range(len(to_sub) + 1):\n        for comb in combinations(to_sub, r):\n            value = sum(sum_heights) + sum(comb)\n            if value >= top and (minimum == -1 or minimum > value):\n                minimum = value\n    return minimum\n", "entry_point": "find_minimum_value", "input": "[10], [5, 1], 15", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131602_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025576", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'9'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025577", "code": "def encrypt_text(input_string):\n    encrypted_result = \"\"\n    for char in input_string:\n        ascii_val = ord(char)  # Get ASCII value of the character\n        encrypted_ascii = ascii_val + 1  # Increment ASCII value by 1\n        encrypted_char = chr(encrypted_ascii)  # Convert back to character\n        encrypted_result += encrypted_char  # Append to the encrypted result string\n    return encrypted_result\n", "entry_point": "encrypt_text", "input": "'ollo'", "output": "'pmmp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124153_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025578", "code": "from urllib.parse import urlparse, parse_qs\ndef extract_next_param(callback_url):\n    parsed_url = urlparse(callback_url)\n    query_params = parse_qs(parsed_url.query)\n    next_param = query_params.get('next', [None])[0]\n    return next_param\n", "entry_point": "extract_next_param", "input": "'http://example.com?next=httpe.com/dashboard'", "output": "'httpe.com/dashboard'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130300_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "483", "output": "{1, 161, 3, 483, 69, 7, 21, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025580", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "1", "output": "'1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025581", "code": "def check_proxy(proxy: str) -> str:\n    # Predefined list of bad proxies for simulation\n    bad_proxies = ['123.456.789.10', 'proxy.example.com', '111.222.333.444']\n    if proxy in bad_proxies:\n        return \"ERROR\"\n    else:\n        return \"None\"\n", "entry_point": "check_proxy", "input": "'123.456.789.10'", "output": "'ERROR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140067_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025582", "code": "import calendar\ndef monthName(List, i):\n    # Check if the index is within the bounds of the list\n    if 0 <= i < len(List):\n        # Get the full month name using the calendar module\n        full_month_name = calendar.month_name[i + 1]  # Adjust index since calendar starts from 1\n        return full_month_name\n    else:\n        return \"Invalid index\"\n", "entry_point": "monthName", "input": "['January', 'February', 'March'], 2", "output": "'March'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59051_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025583", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3533", "output": "{1, 3533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025584", "code": "import math\ndef euclidean_distance(point1, point2):\n    distance = math.sqrt((point2[0] - point1[0])**2 + (point2[1] - point1[1])**2 + (point2[2] - point1[2])**2)\n    return distance\n", "entry_point": "euclidean_distance", "input": "(0, 0, 0), (3, 3, 3)", "output": "5.196152422706632", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35659_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025585", "code": "import os\nfrom typing import Union\nimport pathlib\nTMP_ROOT = '/tmp/ml4pl'  # Example value for TMP_ROOT\ndef temporary_file_path(relpath: Union[str, pathlib.Path]):\n    \"\"\"Generate an absolute path for a temporary file.\n    Args:\n        relpath: A relative path.\n    Returns:\n        A concatenation of the ${ML4PL_TMP_ROOT} directory and the relative path.\n    \"\"\"\n    return os.environ.get(\"ML4PL_TMP_ROOT\", TMP_ROOT) + '/' + str(relpath)\n", "entry_point": "temporary_file_path", "input": "'datta/utput.txtd'", "output": "'/tmp/ml4pl/datta/utput.txtd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47604_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025586", "code": "def find_peak_index(arr):\n    for i in range(1, len(arr) - 1):\n        if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:\n            return i\n    return -1  # No peak found\n", "entry_point": "find_peak_index", "input": "[1, 2, 3, 4, 5, 5, 10, 8, 7]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94014_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9031", "output": "{1, 11, 821, 9031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025588", "code": "def count_padovan(n):\n    def padovan(m, memo):\n        if m in memo:\n            return memo[m]\n        if m < 3:\n            return 1\n        else:\n            p = padovan(m-2, memo) + padovan(m-3, memo)\n            memo[m] = p\n            return p\n    distinct_padovan = set()\n    for i in range(n+1):\n        distinct_padovan.add(padovan(i, {}))\n    return len(distinct_padovan)\n", "entry_point": "count_padovan", "input": "6", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59125_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025589", "code": "def calculate_sum_multiples(n):\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "calculate_sum_multiples", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15183_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025590", "code": "def max_palindrome_length(s: str) -> int:\n    char_count = {}\n    for char in s:\n        char_count[char] = char_count.get(char, 0) + 1\n    max_length = 0\n    for count in char_count.values():\n        max_length += count if count % 2 == 0 else count - 1\n    return max_length\n", "entry_point": "max_palindrome_length", "input": "'aa'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124507_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6617", "output": "{1, 6617, 13, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025592", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'options.apponsConfig'", "output": "('options', 'apponsConfig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4022", "output": "{1, 2, 2011, 4022}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4021", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025594", "code": "from typing import List\nimport os\ndef manipulate_filenames(filenames: List[str]) -> List[str]:\n    manipulated_filenames = []\n    index = 0\n    for filename in filenames:\n        if filename == \"zuma.exe\" or filename == \"zuma.py\":\n            continue\n        if not os.path.exists(filename):\n            new_filename = str(index) + \".mp4\"\n            manipulated_filenames.append(new_filename)\n            index += 1\n        else:\n            manipulated_filenames.append(filename)\n    return manipulated_filenames\n", "entry_point": "manipulate_filenames", "input": "['zuma.exe', 'zuma.py']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110363_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025595", "code": "def count_beautiful_triplets(d, arr):\n    beautiful_triplets_count = 0\n    for i in range(len(arr)):\n        if arr[i] + d in arr and arr[i] + 2*d in arr:\n            beautiful_triplets_count += 1\n    return beautiful_triplets_count\n", "entry_point": "count_beautiful_triplets", "input": "1, [1, 2, 3, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97862_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025596", "code": "def calculate_dot_product(vector1, vector2):\n    min_len = min(len(vector1), len(vector2))\n    dot_product_result = sum(vector1[i] * vector2[i] for i in range(min_len))\n    return dot_product_result\n", "entry_point": "calculate_dot_product", "input": "[1, 1, 1], [1, 1, 139]", "output": "141", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135589_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025597", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6679", "output": "{1, 6679}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6678", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025598", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[-5, -4, 1, 2]", "output": "[-4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025599", "code": "def custom_compare(s1, s2):\n    if s1 == s2:\n        return 0\n    if s1 and s2 and s1.isnumeric() and s2.isnumeric() and s1[0] != '0' and s2[0] != '0':\n        if float(s1) == float(s2):\n            return 0\n        elif float(s1) > float(s2):\n            return 1\n        else:\n            return 2\n    if s1 not in ['ALPHA', 'BETA', 'PREVIEW', 'RC', 'TRUNK']:\n        s1 = 'Z' + s1\n    if s2 not in ['ALPHA', 'BETA', 'PREVIEW', 'RC', 'TRUNK']:\n        s2 = 'Z' + s2\n    if s1 < s2:\n        return 1\n    else:\n        return 2\n", "entry_point": "custom_compare", "input": "'123', '123'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107308_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025600", "code": "from typing import List\ndef calculate_average_test_score(test_scores: List[int]) -> int:\n    total_score = 0\n    for score in test_scores:\n        total_score += score\n    average = total_score / len(test_scores)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average_test_score", "input": "[90, 89, 89]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87338_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025601", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "' Hello - World _ H '", "output": "'helloworldh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025602", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[[10, 15], [30]]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025603", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2135", "output": "{1, 35, 5, 7, 427, 305, 2135, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025604", "code": "def word_length_mapping(words):\n    word_length_dict = {}\n    for word in words:\n        word_length_dict[word] = len(word)\n    return word_length_dict\n", "entry_point": "word_length_mapping", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55760_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025605", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[10, 9, 10]", "output": "900", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025606", "code": "def sum_two_smallest_numbers(numbers):\n    # Sort the input list in ascending order\n    sorted_numbers = sorted(numbers)\n    # Return the sum of the first two elements of the sorted list\n    return sum(sorted_numbers[:2])\n", "entry_point": "sum_two_smallest_numbers", "input": "[3, 5, 10]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69985_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025607", "code": "def parse_api_info(api_info: str) -> dict:\n    api_details = {}\n    lines = api_info.strip().split('\\n')\n    for line in lines:\n        key, value = line.split(':', 1)\n        api_details[key.strip()] = value.strip()\n    return api_details\n", "entry_point": "parse_api_info", "input": "'EiHELP: n'", "output": "{'EiHELP': 'n'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116362_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025608", "code": "from typing import List, Tuple\ndef calculate_extra_points(course_list: List[Tuple[str, int]]) -> int:\n    total_points = 0\n    for course, points in course_list:\n        total_points += points\n    return total_points\n", "entry_point": "calculate_extra_points", "input": "[('Math', 2), ('Science', 3)]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69310_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025609", "code": "def create_users(user_list):\n    username_count = {}\n    final_usernames = []\n    for username, password in user_list:\n        if username in username_count:\n            username_count[username] += 1\n            new_username = f\"{username}{username_count[username]}\"\n        else:\n            username_count[username] = 0\n            new_username = username\n        final_usernames.append(new_username)\n    return final_usernames\n", "entry_point": "create_users", "input": "[('admin', '')]", "output": "['admin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72942_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025610", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'def my_function():'", "output": "'def my_function():'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025611", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "928", "output": "{928, 1, 2, 32, 4, 232, 8, 464, 16, 116, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt927", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025612", "code": "def convertframe2time(frame_idx):\n    hour = frame_idx // 3600\n    minutes = (frame_idx - 3600 * hour) // 60\n    seconds = (frame_idx - 3600 * hour) % 60\n    return '{0:02}:{1:02}:{2:02}'.format(hour, minutes, seconds)\n", "entry_point": "convertframe2time", "input": "3665", "output": "'01:01:05'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39815_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025613", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2313", "output": "{1, 257, 771, 3, 2313, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025614", "code": "from typing import List\ndef calculate_total(changes: List[int]) -> int:\n    return sum(changes)\n", "entry_point": "calculate_total", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125309_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025615", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5363", "output": "{1, 5363, 173, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5362", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025616", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8903", "output": "{1, 307, 29, 8903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8902", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025617", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "18", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025618", "code": "def compute_dist_excluding_gaps(ref_seq, seq):\n    matching_count = 0\n    for ref_char, seq_char in zip(ref_seq, seq):\n        if ref_char != '-' and seq_char != '-' and ref_char == seq_char:\n            matching_count += 1\n    distance = 1 - (matching_count / len(seq))\n    return distance\n", "entry_point": "compute_dist_excluding_gaps", "input": "'A---BCD', 'A---XYZ'", "output": "0.8571428571428572", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47319_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025619", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "9, 4", "output": "('5', '12')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025620", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025621", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'titleauthr'", "output": "'titleauthr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025622", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9047", "output": "{1, 83, 109, 9047}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025623", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_score = sorted_scores[N-1]\n    count_top_score = sorted_scores.count(top_score)\n    sum_top_scores = sum(sorted_scores[:sorted_scores.index(top_score) + count_top_score])\n    average = sum_top_scores / count_top_score\n    return average\n", "entry_point": "calculate_top_players_average", "input": "[395, 395, 395, 395], 4", "output": "395.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54118_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025624", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1110000X'", "output": "['11100000', '11100001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt34", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025625", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'HeHell,lllH'", "output": "b'HeHell,lllH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025626", "code": "def class_name_normalize(class_name):\n    \"\"\"\n    Converts a string into a standardized class name format.\n    Args:\n    class_name (str): The input string with words separated by underscores.\n    Returns:\n    str: The converted class name format with each word starting with an uppercase letter followed by lowercase letters.\n    \"\"\"\n    part_list = []\n    for item in class_name.split(\"_\"):\n        part_list.append(\"{}{}\".format(item[0].upper(), item[1:].lower()))\n    return \"\".join(part_list)\n", "entry_point": "class_name_normalize", "input": "'user_profile_manageu'", "output": "'UserProfileManageu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55201_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025627", "code": "def string_operations(input_string):\n    # Remove leading and trailing whitespace\n    input_string_stripped = input_string.strip()\n    # Extract substrings based on specified criteria\n    substring1 = input_string_stripped[2:6]  # Extract characters from index 2 to 5\n    substring2 = input_string_stripped[:3]   # Extract first 3 characters\n    substring3 = input_string_stripped[-3:]  # Extract last 3 characters\n    substring4 = input_string_stripped[-3]   # Extract character at index -3\n    return (substring1, substring2, substring3, substring4)\n", "entry_point": "string_operations", "input": "'  opo  '", "output": "('o', 'opo', 'opo', 'o')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53707_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025628", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "461", "output": "{1, 461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025629", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'some_directory/idfy__validation_request.py'", "output": "'idfy__validation_request'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025630", "code": "def divide_numbers(a, b):\n    result_float = a / b\n    result_int = a // b\n    return result_float, result_int\n", "entry_point": "divide_numbers", "input": "18.5, 7", "output": "(2.642857142857143, 2.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115700_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025631", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[4, 4, 2, 3, 3, 3, 3, 3]", "output": "[16, 16, 4, 9, 9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025632", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[210, 210, 210], 3", "output": "210.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025633", "code": "def find_second_largest(numbers):\n    largest = second_largest = float('-inf')\n    for num in numbers:\n        if num > largest:\n            second_largest = largest\n            largest = num\n        elif num > second_largest and num != largest:\n            second_largest = num\n    return second_largest\n", "entry_point": "find_second_largest", "input": "[10, 20, 30, 56, 57]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104207_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025634", "code": "def count_unique_words(text: str) -> int:\n    # Convert text to lowercase for case-insensitivity\n    text = text.lower()\n    # Split the text into words based on spaces\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Iterate through the words and add them to the set\n    for word in words:\n        # Consider punctuation marks as part of the words\n        cleaned_word = ''.join(char for char in word if char.isalnum())\n        unique_words.add(cleaned_word)\n    # Return the count of unique words\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'Hello world, Python is fun. Test example: words!'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2411_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025635", "code": "def calculate_total_population(continents):\n    total_population = 0\n    for continent_data in continents.values():\n        total_population += continent_data.get('population', 0)\n    return total_population\n", "entry_point": "calculate_total_population", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131857_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025636", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025637", "code": "def transform_list(lst):\n    def digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    transformed_list = []\n    for index, num in enumerate(lst):\n        transformed_num = digit_sum(num) ** index\n        transformed_list.append(transformed_num)\n    return transformed_list\n", "entry_point": "transform_list", "input": "[0, 7, 38]", "output": "[1, 7, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139113_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025638", "code": "def capitalize_last_letter(string):\n    modified_string = \"\"\n    for word in string.split():\n        if len(word) > 1:\n            modified_word = word[:-1] + word[-1].upper()\n        else:\n            modified_word = word.upper()\n        modified_string += modified_word + \" \"\n    return modified_string[:-1]  # Remove the extra space at the end\n", "entry_point": "capitalize_last_letter", "input": "'specific'", "output": "'specifiC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101043_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025639", "code": "def manipulate_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:  # Check if the number is even\n            modified_arr.append(num * 2)  # Double the value\n        else:\n            modified_arr.append(num ** 2)  # Square the value\n    return modified_arr\n", "entry_point": "manipulate_array", "input": "[1, 2, 3, 4, 5]", "output": "[1, 4, 9, 8, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30167_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025640", "code": "import math\ndef calculate_sampled_rows(sampling_rate):\n    total_rows = 120000000  # Total number of rows in the dataset (120M records)\n    sampled_rows = math.ceil(total_rows * sampling_rate)\n    # Ensure at least one row is sampled\n    if sampled_rows == 0:\n        sampled_rows = 1\n    return sampled_rows\n", "entry_point": "calculate_sampled_rows", "input": "0.0001", "output": "12000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18389_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025641", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['ignore', 'ZX', '1', '11']", "output": "'ZX 1 11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025642", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1496", "output": "1456", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025643", "code": "def min_cost_path(grid):\n    if not grid:\n        return 0\n    rows, cols = len(grid), len(grid[0])\n    dp = [[0 for _ in range(cols)] for _ in range(rows)]\n    dp[0][0] = grid[0][0]\n    # Fill in the first row\n    for col in range(1, cols):\n        dp[0][col] = dp[0][col - 1] + grid[0][col]\n    # Fill in the first column\n    for row in range(1, rows):\n        dp[row][0] = dp[row - 1][0] + grid[row][0]\n    # Fill in the rest of the DP table\n    for row in range(1, rows):\n        for col in range(1, cols):\n            dp[row][col] = grid[row][col] + min(dp[row - 1][col], dp[row][col - 1])\n    return dp[rows - 1][cols - 1]\n", "entry_point": "min_cost_path", "input": "[[1, 3], [4, 4]]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26058_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025644", "code": "def count_field_renaming_operations(migrations):\n    renaming_count = 0\n    for migration in migrations:\n        if migration['operation'] == 'RenameField':\n            renaming_count += 1\n    return renaming_count\n", "entry_point": "count_field_renaming_operations", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72582_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025645", "code": "import re\ndef username_validation(username):\n    pattern = r\"^[a-zA-Z][a-zA-Z0-9_]{2,22}[a-zA-Z0-9]$\"\n    if re.match(pattern, username):\n        return True\n    return False\n", "entry_point": "username_validation", "input": "'1user'", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44680_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025646", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num >= 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0.0  # Handle the case when there are no positive numbers in the list\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[5, 8, 7, 8, 9]", "output": "7.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45653_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025647", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'0.10.10-0'", "output": "(0, 10, 10, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025648", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'Thisthat'", "output": "'Thisthat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4991", "output": "{1, 161, 7, 713, 23, 217, 31, 4991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025650", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 3, 0, 0, 0, 0, 0, 3, 0, 0]", "output": "[1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7697", "output": "{1, 43, 179, 7697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7696", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025652", "code": "def reconstruct_string(freq_list):\n    char_freq = {}\n    # Create a dictionary mapping characters to their frequencies\n    for i, freq in enumerate(freq_list):\n        char_freq[chr(i)] = freq\n    # Sort the characters by their ASCII values\n    sorted_chars = sorted(char_freq.keys())\n    result = \"\"\n    # Reconstruct the string based on the frequency list\n    for char in sorted_chars:\n        result += char * char_freq[char]\n    return result\n", "entry_point": "reconstruct_string", "input": "[3, 1, 2]", "output": "'\\x00\\x00\\x00\\x01\\x02\\x02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49716_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025653", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "23", "output": "{1, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt22", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025654", "code": "def extract_version_components(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'5.12.30'", "output": "(5, 12, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66730_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025655", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 2), (2, 3)]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025656", "code": "def get_common_prefix(str1, str2):\n    common_prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            common_prefix += str1[i]\n        else:\n            break\n    return common_prefix\n", "entry_point": "get_common_prefix", "input": "'fluffy', 'feline'", "output": "'f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41977_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025657", "code": "def process_command(input_str):\n    x = input_str.split(' ')\n    com = x[0]\n    rest = x[1:]\n    return (com, rest)\n", "entry_point": "process_command", "input": "'argumencs'", "output": "('argumencs', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93382_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025658", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6357", "output": "{1, 3, 163, 2119, 39, 489, 13, 6357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025659", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "482", "output": "{1, 482, 2, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt481", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025660", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello, this is Thomas. Li.'", "output": "'Thomas Li '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025661", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[[0], [1], [1, 6], [1]]", "output": "[0, 1, 1, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025662", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3603", "output": "{3, 1, 3603, 1201}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3602", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025663", "code": "def sum_of_multiples(numbers):\n    total_sum = 0\n    seen_multiples = set()\n    for num in numbers:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total_sum += num\n            seen_multiples.add(num)\n    return total_sum\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 15, 20, 25]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120829_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025664", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[3, 4, 3, 1, 5, 2, 3, 3]", "output": "[7, 7, 4, 6, 7, 5, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025665", "code": "def rotate_2d_array(arr):\n    if not arr:\n        return arr\n    rows, cols = len(arr), len(arr[0])\n    # Transpose the matrix\n    for i in range(rows):\n        for j in range(i, cols):\n            arr[i][j], arr[j][i] = arr[j][i], arr[i][j]\n    # Reverse each row\n    for i in range(rows):\n        arr[i] = arr[i][::-1]\n    return arr\n", "entry_point": "rotate_2d_array", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[7, 4, 1], [8, 5, 2], [9, 6, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81190_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025666", "code": "def generate_context(title, location):\n    # Split the location string into name and location\n    name, location = location.split('(')\n    name = name.strip()\n    location = location.strip(')')\n    # Construct the context dictionary\n    context = {\n        'title': title,\n        'contrib': f'{name} ({location})'\n    }\n    return context\n", "entry_point": "generate_context", "input": "'AbtAbto', 'DD (e)'", "output": "{'title': 'AbtAbto', 'contrib': 'DD (e)'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114537_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025667", "code": "def ban_users(user_ids, usernames):\n    banned_users = []\n    for user_id in user_ids:\n        if user_id in usernames:\n            banned_users.append(usernames[user_id])\n    return banned_users\n", "entry_point": "ban_users", "input": "[], {'1': 'Alice', '2': 'Bob'}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141586_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025668", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'200.22'", "output": "'200.22.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025669", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'PPPALL', 0", "output": "'PPPALL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2139", "output": "{1, 3, 69, 713, 23, 2139, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025671", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2802", "output": "{1, 2, 3, 934, 6, 2802, 467, 1401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025672", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 3, 4, 4], 3", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025673", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 6", "output": "117649", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt39", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025674", "code": "def calculate_average_score(scores):\n    if len(scores) <= 2:\n        return 0  # Return 0 if there are less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score, 2)  # Round the average score to 2 decimal places\n", "entry_point": "calculate_average_score", "input": "[60, 65, 66, 67, 70]", "output": "66.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140998_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025675", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "255, 166, 0", "output": "'#FFA600'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025676", "code": "from typing import List\ndef calculate_average_visitors(visitors: List[int], start_day: int, end_day: int) -> float:\n    total_visitors = 0\n    num_days = end_day - start_day + 1\n    for day in range(start_day, end_day + 1):\n        total_visitors += visitors[day - 1]\n    average = total_visitors / num_days\n    return round(average, 2)\n", "entry_point": "calculate_average_visitors", "input": "[167, 168, 169, 167, 168, 172], 1, 6", "output": "168.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3681_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025677", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "1, 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025678", "code": "from typing import List, Any\ndef encode_and_append(pieces: List[str], value: Any) -> int:\n    encoded_value = str(value)  # Convert the value to a string\n    pieces.append(encoded_value)  # Append the encoded value to the list\n    return len(encoded_value)  # Return the size of the encoded value\n", "entry_point": "encode_and_append", "input": "[], 'apple'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7925_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025679", "code": "def evaluate_polynomial(coefs, x0):\n    result = 0\n    for coef in reversed(coefs):\n        result = coef + result * x0\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[468003], 0", "output": "468003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86312_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3594", "output": "{1, 2, 3, 1797, 6, 3594, 1198, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025681", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "196, 2", "output": "'11000100'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025682", "code": "def sum_of_multiples(numbers):\n    multiples_set = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            multiples_set.add(num)\n    return sum(multiples_set)\n", "entry_point": "sum_of_multiples", "input": "[3, 5, 6, 10]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59802_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025683", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[3, 5, 6, 7, 7]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025684", "code": "def count_borrowed_games(games):\n    borrowed_games_count = {}\n    for game in games:\n        borrower_id = game.get('borrower_id')\n        if borrower_id is not None:\n            borrowed_games_count[borrower_id] = borrowed_games_count.get(borrower_id, 0) + 1\n    return borrowed_games_count\n", "entry_point": "count_borrowed_games", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138371_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025685", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7690", "output": "{1, 2, 1538, 769, 5, 3845, 7690, 10}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7689", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025686", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cbad', 'ccbaaadddd'", "output": "'ccbaaadddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025687", "code": "def minimize_execution_time(N_PANELS, N_CORES, N_TASKS):\n    total_cores = N_PANELS * N_CORES\n    tasks_per_core = N_TASKS // total_cores\n    total_execution_time = N_TASKS / total_cores\n    return total_execution_time\n", "entry_point": "minimize_execution_time", "input": "1, 6, 35", "output": "5.833333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75544_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025688", "code": "def find_pipelines_with_param_value(pipelines: dict, param_name: str, param_value: str) -> list:\n    matching_pipelines = []\n    for pipeline_id, pipeline_config in pipelines.get(\"pipelines\", {}).items():\n        if param_name in pipeline_config and pipeline_config[param_name] == param_value:\n            matching_pipelines.append(pipeline_id)\n    return matching_pipelines\n", "entry_point": "find_pipelines_with_param_value", "input": "{}, 'example_param', 'example_value'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71942_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025689", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MMMCMXC'", "output": "3990", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025690", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6477", "output": "{1, 3, 6477, 2159, 17, 51, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6476", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025691", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'how r'", "output": "{'h': 1, 'o': 1, 'w': 1, 'r': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55166_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025692", "code": "def extend_oid(base_oid, extension_tuple):\n    extended_oid = base_oid + extension_tuple\n    return extended_oid\n", "entry_point": "extend_oid", "input": "(1, 3, 6, 1), (5, 5, 7, 48, 6)", "output": "(1, 3, 6, 1, 5, 5, 7, 48, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97535_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025693", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6310", "output": "{1, 2, 5, 6310, 10, 1262, 3155, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6309", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025694", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[1, 2, 4, 8]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025695", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "49, 128", "output": "(229, 51)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3631", "output": "{1, 3631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025697", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "534", "output": "{1, 2, 3, 6, 267, 178, 534, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt533", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025698", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'SECURITY_PASSWORD_HASH='", "output": "{'SECURITY_PASSWORD_HASH': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025699", "code": "def _double_or_string_value(x):\n    if x.startswith(\"double_value_\"):\n        return x[len(\"double_value_\"):]\n    elif x.startswith(\"string_value_\"):\n        return x[len(\"string_value_\"):]\n    raise ValueError(f\"Input {x} has neither double nor string values.\")\n", "entry_point": "_double_or_string_value", "input": "'double_value_2.34'", "output": "'2.34'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142908_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2103", "output": "{1, 3, 701, 2103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025701", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "[95, 88, 92]", "output": "'[95, 88, 92]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025702", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1906", "output": "{953, 1, 1906, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1905", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6388", "output": "{1, 2, 4, 6388, 3194, 1597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6387", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025704", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 1, 5, 3, 6, 3]", "output": "[6, 4, 6, 8, 9, 9, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025705", "code": "def twoNumberSum(arr, n):\n    seen = set()\n    for num in arr:\n        diff = n - num\n        if diff in seen:\n            return [diff, num]\n        seen.add(num)\n    return []\n", "entry_point": "twoNumberSum", "input": "[3, 5, -3, 9], 6", "output": "[-3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7709_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4534", "output": "{1, 2, 2267, 4534}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4533", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025707", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1066", "output": "{1, 2, 41, 1066, 13, 82, 533, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025708", "code": "def convert_markdown_to_rst(markdown_text):\n    try:\n        # Simulating the conversion process\n        # Replace Markdown headers with ReStructuredText headers\n        converted_text = markdown_text.replace('# ', '')  # Replace Markdown header syntax\n        converted_text = converted_text.replace('\\n', '\\n' + '=' * len(converted_text.splitlines()[0]) + '\\n\\n', 1)  # Add ReStructuredText header syntax\n        return converted_text\n    except Exception as e:\n        return \"Error converting Markdown to ReStructuredText: \" + str(e)\n", "entry_point": "convert_markdown_to_rst", "input": "'# Hello\\nThis is **bold** text.'", "output": "'Hello\\n=====\\n\\nThis is **bold** text.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24499_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025709", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'1.5.3'", "output": "(1, 5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025710", "code": "def simulate_robot_movement(commands):\n    position = 0\n    for command in commands:\n        if command == \"F\":\n            position += 1\n        elif command == \"B\":\n            position -= 1\n    return position\n", "entry_point": "simulate_robot_movement", "input": "['F', 'F', 'F', 'F', 'F', 'F', 'F']", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49058_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025711", "code": "def calculate_total_characters(strings):\n    total_characters = 0\n    for string in strings:\n        total_characters += len(string)\n    return total_characters\n", "entry_point": "calculate_total_characters", "input": "['Hello', ' ', 'World']", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17516_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025712", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1966", "output": "{1, 2, 1966, 983}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1965", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "730", "output": "{1, 2, 5, 73, 10, 365, 146, 730}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt729", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025714", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "190", "output": "{1, 2, 5, 38, 10, 19, 190, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt189", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025715", "code": "import re\nfrom typing import List\ndef tokenize(sentence: str) -> List[str]:\n    tokens = [\n        m.group()\n        for m in re.finditer(r\"[^\\W\\d_]+|\\s+|\\d+|\\S\", sentence)\n    ]\n    return tokens\n", "entry_point": "tokenize", "input": "'World!'", "output": "['World', '!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145249_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025716", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5791", "output": "{1, 5791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025717", "code": "def replace_version(version1, version2):\n    new_version = version2 + version1[len(version2):]\n    return new_version\n", "entry_point": "replace_version", "input": "(1, 0, 0, 0, -2, 1, 0, -2, 1), (2, -1, 3, 9)", "output": "(2, -1, 3, 9, -2, 1, 0, -2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17632_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025718", "code": "def move_player(input_str):\n    x, y = 0, 0\n    for move in input_str:\n        if move == 'U':\n            y = min(y + 1, 5)\n        elif move == 'D':\n            y = max(y - 1, -5)\n        elif move == 'L':\n            x = max(x - 1, -5)\n        elif move == 'R':\n            x = min(x + 1, 5)\n    return (x, y)\n", "entry_point": "move_player", "input": "'RD'", "output": "(1, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110197_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025719", "code": "from itertools import combinations\ndef max_even_subset_weight(weights, weight_limit):\n    max_weight = 0\n    for r in range(2, len(weights)+1, 2):  # Consider only even-sized subsets\n        for subset in combinations(weights, r):\n            if sum(subset) <= weight_limit:\n                max_weight = max(max_weight, sum(subset))\n    return max_weight\n", "entry_point": "max_even_subset_weight", "input": "[6, 8, 5], 14", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149945_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025720", "code": "import math\ndef calculate_expression(x):\n    sqrt_x = math.sqrt(x)\n    log_x = math.log10(x)\n    result = sqrt_x + log_x\n    return result\n", "entry_point": "calculate_expression", "input": "10", "output": "4.16227766016838", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127737_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025721", "code": "import os\ndef relative_path(file_path, dir_path):\n    file_parts = file_path.split(os.sep)\n    dir_parts = dir_path.split(os.sep)\n    # Calculate the common prefix\n    i = 0\n    while i < len(file_parts) and i < len(dir_parts) and file_parts[i] == dir_parts[i]:\n        i += 1\n    # Calculate the relative path\n    rel_path = ['..' for _ in range(len(file_parts) - i - 1)] + dir_parts[i:]\n    return os.path.join(*rel_path)\n", "entry_point": "relative_path", "input": "'A/Level1/Level2/Level3/Level4/file.txt', 'A/Uss/es'", "output": "'../../../../Uss/es'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32191_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025722", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[3, 5, 0, 2, 7, 7, 5, 7, 7]", "output": "[9, 15, 0, 4, 21, 21, 15, 21, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025723", "code": "from typing import List\ndef has_path(grid: List[List[int]]) -> bool:\n    def dfs(row, col):\n        if row < 0 or col < 0 or row >= len(grid) or col >= len(grid[0]) or grid[row][col] == 1:\n            return False\n        if row == len(grid) - 1 and col == len(grid[0]) - 1:\n            return True\n        return dfs(row + 1, col) or dfs(row, col + 1)\n    return dfs(0, 0)\n", "entry_point": "has_path", "input": "[[1, 0, 0], [1, 1, 0], [0, 1, 1]]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69760_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025724", "code": "def check_gateways(gateways, threshold):\n    online_gateways = sum(gateway[\"status\"] for gateway in gateways)\n    return online_gateways >= threshold\n", "entry_point": "check_gateways", "input": "[{'status': 1}, {'status': 0}], 1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11219_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6485", "output": "{1, 5, 6485, 1297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6484", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025726", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1479", "output": "{1, 3, 1479, 493, 17, 51, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025727", "code": "def concatenate_words(string_list):\n    concatenated_words = []\n    for i in range(len(string_list) - 1):\n        words1 = string_list[i].split()\n        words2 = string_list[i + 1].split()\n        concatenated_word = words1[0] + words2[1]\n        concatenated_words.append(concatenated_word)\n    return concatenated_words\n", "entry_point": "concatenate_words", "input": "['Hello there', 'Welcome Code']", "output": "['HelloCode']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124678_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025728", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "9.0", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025729", "code": "from collections import deque\ndef min_moves_to_target(grid, targetX, targetY):\n    rows, cols = len(grid), len(grid[0])\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n    queue = deque([(0, 0, 0)])  # (row, col, moves)\n    visited = set()\n    while queue:\n        row, col, moves = queue.popleft()\n        if row == targetX and col == targetY:\n            return moves\n        for dr, dc in directions:\n            new_row, new_col = row + dr, col + dc\n            if 0 <= new_row < rows and 0 <= new_col < cols and grid[new_row][new_col] == 0 and (new_row, new_col) not in visited:\n                queue.append((new_row, new_col, moves + 1))\n                visited.add((new_row, new_col))\n    return -1\n", "entry_point": "min_moves_to_target", "input": "[[0, 0], [1, 1]], 1, 0", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26935_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025730", "code": "def process_integers(integers, threshold):\n    modified_integers = []\n    running_sum = 0\n    for num in integers:\n        if num >= threshold:\n            num = running_sum\n            running_sum += num\n        modified_integers.append(num)\n    return modified_integers\n", "entry_point": "process_integers", "input": "[0, 0, 0, 0, 0], 1", "output": "[0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83853_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025731", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "114, ['17', 'x', '18', 'x', '118']", "output": "472", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1994", "output": "{1, 1994, 2, 997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025733", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2789", "output": "{1, 2789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025734", "code": "def remove_duplicates(input_string):\n    if not input_string:\n        return \"\"\n    result = input_string[0]  # Initialize result with the first character\n    for i in range(1, len(input_string)):\n        if input_string[i] != input_string[i - 1]:\n            result += input_string[i]\n    return result\n", "entry_point": "remove_duplicates", "input": "'hhheeeellooohhhheeeelloo'", "output": "'helohelo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5338_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "69", "output": "{1, 3, 69, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt68", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025736", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[10, 7, 1, 2, 1, 8, 1]", "output": "[-3, -6, 1, -1, 7, -7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025737", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'is'", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025738", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'MovingFreeBatchrm'", "output": "'moving_free_batchrm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025739", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3728", "output": "{1, 2, 4, 932, 1864, 8, 233, 3728, 16, 466}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3727", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025740", "code": "from typing import List\ndef calculate_differences(input_list: List[int]) -> List[int]:\n    differences = []\n    for i in range(1, len(input_list)):\n        diff = input_list[i] - input_list[i - 1]\n        differences.append(diff)\n    return differences\n", "entry_point": "calculate_differences", "input": "[0, 3, 7, -2, 1]", "output": "[3, 4, -9, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140362_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025741", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 2, 7]", "output": "[7, 3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132105_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2153", "output": "{2153, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025743", "code": "def extract_engine_details(config):\n    engine_details = config.get('engine', {})\n    engine_name = engine_details.get('name', 'Unknown')\n    engine_type = engine_details.get('type', 'Unknown')\n    engine_provider = engine_details.get('_provider', 'Unknown')\n    return engine_name, engine_type, engine_provider\n", "entry_point": "extract_engine_details", "input": "{}", "output": "('Unknown', 'Unknown', 'Unknown')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11807_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4467", "output": "{3, 1, 4467, 1489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025745", "code": "def filter_numbers(numbers):\n    filtered_numbers = []\n    for num in numbers:\n        if num % 3 == 0 and num > 10:\n            filtered_numbers.append(num)\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[12, 15, 18]", "output": "[12, 15, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59448_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025746", "code": "def count_tokens(input_string: str) -> dict:\n    token_counts = {}\n    for token in input_string:\n        if token in token_counts:\n            token_counts[token] += 1\n        else:\n            token_counts[token] = 1\n    return token_counts\n", "entry_point": "count_tokens", "input": "'AAABBBDDC'", "output": "{'A': 3, 'B': 3, 'D': 2, 'C': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1286_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025747", "code": "from typing import List\nfrom datetime import datetime\ndef earliest_date(dates: List[str]) -> str:\n    earliest_date = \"9999/12/31\"  # Initialize with a date far in the future\n    for date_str in dates:\n        date_obj = datetime.strptime(date_str, \"%Y/%m/%d\")\n        if date_obj < datetime.strptime(earliest_date, \"%Y/%m/%d\"):\n            earliest_date = date_str\n    return earliest_date\n", "entry_point": "earliest_date", "input": "['2020/11/30', '2021/01/01', '2020/12/01']", "output": "'2020/11/30'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128206_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025748", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 6, 3, 3, 6, 0, 6]", "output": "[1, 46, 37, 37, 46, 10, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025749", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9613", "output": "{1, 9613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025750", "code": "def generate_down_revision(input_revision: str) -> str:\n    down_revision = ''\n    for char in input_revision:\n        if char.isalnum():\n            if char == '9':\n                down_revision += '0'\n            else:\n                down_revision += chr(ord(char) + 1)\n        else:\n            down_revision += char\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'OPOPAWOR'", "output": "'PQPQBXPS'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118764_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025751", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'2.0.0.dev3'", "output": "'2.0.0.dev4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025752", "code": "CLIENT_TYPE = {\n    '--client_lua_path': \"lua\",\n    '--client_cs_path': \"cs\",\n    '--client_cpp_path': \"cpp\",\n    '--client_js_path': \"js\",\n    '--client_python_path': \"python\",\n}\ndef get_client_type(arguments):\n    for arg in arguments:\n        if arg in CLIENT_TYPE:\n            return CLIENT_TYPE[arg]\n    return \"Unknown client type\"\n", "entry_point": "get_client_type", "input": "['--client_cs_path']", "output": "'cs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19100_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025753", "code": "def generate_integer_list(sub_count):\n    integer_list = []\n    for i in range(sub_count):\n        integer_list.append(i)\n    return integer_list\n", "entry_point": "generate_integer_list", "input": "3", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108613_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025754", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "1.0, 6.0, 100", "output": "(1.0, 0.049999999999999996)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025755", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[9]", "output": "[9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025756", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5113", "output": "{1, 5113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025757", "code": "def simulate_card_game(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    ties = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n        else:\n            ties += 1\n    return player1_wins, player2_wins, ties\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4], [0, 1, 2, 3]", "output": "(4, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74585_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025758", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'Wor#Wl%Wd'", "output": "'WorWlWd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025759", "code": "def simulate_card_game(deck1, deck2):\n    player1_wins = 0\n    player2_wins = 0\n    ties = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n        else:\n            ties += 1\n    return player1_wins, player2_wins, ties\n", "entry_point": "simulate_card_game", "input": "[5, 4, 2, 2], [3, 4, 2, 4]", "output": "(1, 1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74585_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025760", "code": "def max3(x, y, z):\n    if x >= y:\n        if x >= z:\n            return x\n        else:\n            return z\n    else:\n        if y >= z:\n            return y\n        else:\n            return z\n", "entry_point": "max3", "input": "9, 4, 5", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116798_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025761", "code": "def flatten_lists(input_lists):\n    flattened_list = []\n    for sublist in input_lists:\n        for element in sublist:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_lists", "input": "[[1, 2], [3, 4], [5, 6], [7, 8]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63552_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025762", "code": "from typing import List, Set\ndef get_unique_ancestors(ancestors: List[int]) -> Set[int]:\n    return set(ancestors)\n", "entry_point": "get_unique_ancestors", "input": "[2, 3]", "output": "{2, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95405_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4481", "output": "{1, 4481}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025764", "code": "def calculate_file_size(chunk_lengths):\n    total_size = 0\n    seen_bytes = set()\n    for length in chunk_lengths:\n        total_size += length\n        for i in range(length - 1):\n            if total_size - i in seen_bytes:\n                total_size -= 1\n            seen_bytes.add(total_size - i)\n    return total_size\n", "entry_point": "calculate_file_size", "input": "[10, 10, 3]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134958_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9745", "output": "{1949, 1, 5, 9745}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025766", "code": "def format_train_attributes(train_attributes, attribute_names):\n    formatted_attributes_list = []\n    for attribute, value in train_attributes.items():\n        display_name = attribute_names.get(attribute, attribute)\n        formatted_attributes_list.append(f\"{display_name}: {value}\")\n    return '\\n'.join(formatted_attributes_list)\n", "entry_point": "format_train_attributes", "input": "{}, {}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025767", "code": "def character_frequency(input_string):\n    frequency_dict = {}\n    for char in input_string:\n        if char in frequency_dict:\n            frequency_dict[char] += 1\n        else:\n            frequency_dict[char] = 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "'he'", "output": "{'h': 1, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130080_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025768", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[10, 1, 9, 1, 1, 8, 8, -1, -2]", "output": "[10, 2, 11, 4, 5, 13, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025769", "code": "from typing import List\ndef card_game_winner(player1: List[int], player2: List[int]) -> str:\n    score_player1 = 0\n    score_player2 = 0\n    for card1, card2 in zip(player1, player2):\n        if card1 > card2:\n            score_player1 += 1\n        elif card2 > card1:\n            score_player2 += 1\n    if score_player1 > score_player2:\n        return \"Player 1\"\n    elif score_player2 > score_player1:\n        return \"Player 2\"\n    else:\n        return \"Draw\"\n", "entry_point": "card_game_winner", "input": "[1, 2, 3], [1, 2, 3]", "output": "'Draw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56310_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025770", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2143", "output": "{1, 2143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025771", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[[5, 4], 7, 2]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025772", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1031", "output": "{1, 1031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025773", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[4, 6]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025774", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[5, 0, 0, 23.14, 23.14, 23.14, 23.14, 23.14]", "output": "23.14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9919", "output": "{1, 7, 1417, 91, 13, 109, 763, 9919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025776", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6369", "output": "{1, 6369, 3, 579, 33, 193, 11, 2123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6368", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025777", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'int x = 10 + y'", "output": "['int', 'x', '=', '10', '+', 'y']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025778", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "-8, 3", "output": "-512", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025779", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'mmyou!y'", "output": "'mmyou!y'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025780", "code": "def total_characters(strings):\n    total_count = 0\n    for string in strings:\n        total_count += len(string)\n    return total_count\n", "entry_point": "total_characters", "input": "['abcdefgh', 'ijklmnop']", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61806_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025781", "code": "MON_PERIOD = 1\nMON_INTERVAL = 60\nTEMP_HIGH = 85.0\nTEMP_CRITICAL = 90.0\ndef temperature_monitor(temperature_readings):\n    consecutive_minutes = 0\n    for timestamp, temperature in temperature_readings:\n        if temperature > TEMP_CRITICAL:\n            consecutive_minutes += 1\n        else:\n            consecutive_minutes = 0\n        if consecutive_minutes >= MON_PERIOD:\n            return True\n    return False\n", "entry_point": "temperature_monitor", "input": "[(0, 85.0), (1, 89.0), (2, 90.0)]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66891_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025782", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    n = len(scores)\n    dp = [0] * n\n    dp[0] = scores[0]\n    for i in range(1, n):\n        if scores[i] > scores[i - 1]:\n            dp[i] = max(dp[i], dp[i - 1] + scores[i])\n        else:\n            dp[i] = dp[i - 1]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[5, 6, 7, 8]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127370_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025783", "code": "def unique_street_names(street_names):\n    unique_names = set()\n    for name in street_names:\n        unique_names.add(name.lower())\n    unique_names = sorted(list(unique_names))\n    return unique_names\n", "entry_point": "unique_street_names", "input": "['A', 'elm St', 'Main SM', 'mainmst']", "output": "['a', 'elm st', 'main sm', 'mainmst']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29367_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025784", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[8, 10, 10, 10, 12, 3, 9, 11]", "output": "([8, 10, 10, 10, 12], [3, 9, 11])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025785", "code": "def count_valid_groupings(n, k):\n    c1 = n // k\n    c2 = n // (k // 2)\n    if k % 2 == 1:\n        cnt = pow(c1, 3)\n    else:\n        cnt = pow(c1, 3) + pow(c2 - c1, 3)\n    return cnt\n", "entry_point": "count_valid_groupings", "input": "12, 3", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122726_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025786", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[100, 50, 60, 70, 80, 100, 60]", "output": "[1, 7, 5, 4, 3, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025787", "code": "def custom_split(data, delimiters):\n    result = []\n    current_substring = \"\"\n    for char in data:\n        if char in delimiters:\n            if current_substring:\n                result.append(current_substring)\n                current_substring = \"\"\n        else:\n            current_substring += char\n    if current_substring:\n        result.append(current_substring)\n    return result\n", "entry_point": "custom_split", "input": "'apple,banana,cherry.orangeb', [',']", "output": "['apple', 'banana', 'cherry.orangeb']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10049_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5090", "output": "{1, 5090, 2, 5, 10, 2545, 1018, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5089", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025789", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 5, 4, 7, 2, 5, 4, 9, 3]", "output": "[3, 6, 6, 10, 6, 10, 10, 16, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36880_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025790", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'2.62.0', 125", "output": "'2.62.0.125'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025791", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7897", "output": "{1, 7897, 53, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025792", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "25", "output": "{1, 5, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt24", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025793", "code": "from itertools import chain\ndef count_segments(starts, ends, points):\n    cnt = [0] * len(points)\n    start_points = zip(starts, ['l'] * len(starts), range(len(starts)))\n    end_points = zip(ends, ['r'] * len(ends), range(len(ends)))\n    point_points = zip(points, ['p'] * len(points), range(len(points)))\n    sort_list = chain(start_points, end_points, point_points)\n    sort_list = sorted(sort_list, key=lambda a: (a[0], a[1]))\n    segment_count = 0\n    for num, letter, index in sort_list:\n        if letter == 'l':\n            segment_count += 1\n        elif letter == 'r':\n            segment_count -= 1\n        else:\n            cnt[index] = segment_count\n    return cnt\n", "entry_point": "count_segments", "input": "[], [], []", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23716_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025794", "code": "COLOR_CODES = {\n    (0, 0, 255): 1,\n    (0, 123, 0): 2,\n    (255, 0, 0): 3,\n    (0, 0, 123): 4,\n    (123, 0, 0): 5,\n    (0, 123, 123): 6,\n    (0, 0, 0): 7,\n    (123, 123, 123): 8,\n    (189, 189, 189): 0  # unopened/opened blank\n}\ndef get_cell_value(color):\n    return COLOR_CODES.get(color, -1)\n", "entry_point": "get_cell_value", "input": "(0, 0, 255)", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16350_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2759", "output": "{89, 1, 31, 2759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025796", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[2, 3, 3, 3, 1, 1, 0, 6]", "output": "[2, 4, 5, 6, 5, 6, 6, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025797", "code": "def sum_of_squares_of_even(data):\n    total_sum = 0\n    for num in data:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_of_even", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93543_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025798", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'mymy_mole'", "output": "'mymy_mole'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025799", "code": "def process_numbers(nums):\n    if not nums:\n        return []\n    processed_nums = []\n    for i in range(len(nums) - 1):\n        processed_nums.append(nums[i] + nums[i + 1])\n    processed_nums.append(nums[-1] + nums[0])\n    return processed_nums\n", "entry_point": "process_numbers", "input": "[5, 10, 15]", "output": "[15, 25, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105716_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025800", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "8.0", "output": "3.056", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025801", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1993", "output": "{1, 1993}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1992", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025802", "code": "def min_valid_substrings(s, valids):\n    def helper(idx):\n        if idx == len(s):\n            return 0\n        ans = len(s)\n        for hi in range(idx, len(s)):\n            if (idx, hi) in valids:\n                ans = min(ans, helper(hi + 1) + 1)\n        return ans\n    if not s:\n        return 0\n    return helper(0) - 1\n", "entry_point": "min_valid_substrings", "input": "'abcdefg', {(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6)}", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71145_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7463", "output": "{1, 439, 17, 7463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025804", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 1, 2, 3, 0, 2, 1, 0]", "output": "[0, 1, 2, 3, 0, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025805", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "1342345", "output": "'VCode-1342345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025806", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'foarTTh', '.1'", "output": "{'.1': 'foarTTh'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025807", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/some/path/sere'", "output": "'sere'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025808", "code": "START_DECODE_OFFSET = -8\n# Morse decoding chart to use. Included is standard international morse (A-Z, 0-9, spaces)\nMORSE_ENCODE_CHART={'A':'.-', 'B':'-...',\n                    'C':'-.-.', 'D':'-..', 'E':'.',\n                    'F':'..-.', 'G':'--.', 'H':'....',\n                    'I':'..', 'J':'.---', 'K':'-.-',\n                    'L':'.-..', 'M':'--', 'N':'-.',\n                    'O':'---', 'P':'.--.', 'Q':'--.-',\n                    'R':'.-.', 'S':'...', 'T':'-',\n                    'U':'..-', 'V':'...-', 'W':'.--',\n                    'X':'-..-', 'Y':'-.--', 'Z':'--..',\n                    '1':'.----', '2':'..---', '3':'...--',\n                    '4':'....-', '5':'.....', '6':'-....',\n                    '7':'--...', '8':'---..', '9':'----.',\n                    '0':'-----', ' ':'/'}\n# An inverted version of the decoding chart that is more useful for encoding. Shouldn't need to be changed.\nMORSE_DECODE_CHART = {a: b for b, a in MORSE_ENCODE_CHART.items()}\ndef encode_to_morse(text):\n    morse_code = []\n    for char in text.upper():\n        if char in MORSE_ENCODE_CHART:\n            morse_code.append(MORSE_ENCODE_CHART[char])\n        else:\n            morse_code.append(' ')  # Treat unknown characters as spaces\n    return ' '.join(morse_code)\n", "entry_point": "encode_to_morse", "input": "'RRD'", "output": "'.-. .-. -..'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025809", "code": "def calculate_total_cost(meal_cost, tip_percent, tax_percent):\n    tip = (meal_cost * tip_percent) / 100\n    tax = (meal_cost * tax_percent) / 100\n    total_cost = meal_cost + tip + tax\n    rounded_total_cost = int(total_cost + 0.5)\n    return rounded_total_cost\n", "entry_point": "calculate_total_cost", "input": "171, 15, 10", "output": "214", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8148_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025810", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'Mdemia Season 3', 6, 1108100", "output": "'Mdemia S3 - 06 [1108100].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1766", "output": "{1, 2, 883, 1766}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025812", "code": "def extract_app_name(class_name: str) -> str:\n    prefix = 'admin_'\n    if class_name.startswith(prefix):\n        app_name = class_name[len(prefix):].lower()\n        return app_name\n    return class_name.lower()\n", "entry_point": "extract_app_name", "input": "'admin_ListChartsConfiList'", "output": "'listchartsconfilist'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125131_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025813", "code": "def tower_builder(n_floors):\n    times = 1\n    space = ((2 * n_floors - 1) // 2)\n    tower = []\n    for _ in range(n_floors):\n        tower.append((' ' * space) + ('*' * times) + (' ' * space))\n        times += 2\n        space -= 1\n    return tower\n", "entry_point": "tower_builder", "input": "2", "output": "[' * ', '***']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38158_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025814", "code": "def format_name(name):\n    if name.startswith('wx.'):\n        return name\n    if name.startswith('wx'):\n        return 'wx.adv.' + name[2:]\n    elif name.startswith('EVT_'):\n        return 'wx.adv.' + name\n    return name\n", "entry_point": "format_name", "input": "'wxt.Butto'", "output": "'wx.adv.t.Butto'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4438_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025815", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8653", "output": "{1, 8653, 17, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025816", "code": "def calculate_mse(predicted_values, actual_values):\n    if len(predicted_values) != len(actual_values):\n        raise ValueError(\"Length of predicted values and actual values must be the same.\")\n    n = len(predicted_values)\n    squared_diff_sum = sum((pred - actual) ** 2 for pred, actual in zip(predicted_values, actual_values))\n    mse = squared_diff_sum / n\n    return mse\n", "entry_point": "calculate_mse", "input": "[0.5, 0.5], [0, 1]", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1900_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025817", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3824", "output": "{1, 2, 4, 8, 239, 3824, 16, 1912, 956, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3823", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025818", "code": "def trap_water(walls):\n    left, right = 0, len(walls) - 1\n    left_max = right_max = water_trapped = 0\n    while left <= right:\n        if walls[left] <= walls[right]:\n            left_max = max(left_max, walls[left])\n            water_trapped += max(0, left_max - walls[left])\n            left += 1\n        else:\n            right_max = max(right_max, walls[right])\n            water_trapped += max(0, right_max - walls[right])\n            right -= 1\n    return water_trapped\n", "entry_point": "trap_water", "input": "[0, 1, 0, 2, 1, 0, 1, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50098_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025819", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'filffilfi'", "output": "'filffilfi_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025820", "code": "import re\ndef remove_retweet(tweet):\n    return re.sub(r\"\\brt\\b\", \"\", tweet)\n", "entry_point": "remove_retweet", "input": "'Bug\u00fcn'", "output": "'Bug\u00fcn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62869_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025821", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'1.10.3'", "output": "(1, 10, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025822", "code": "NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION = 0\nNOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION = 1\nNOTIFICATION_REPORTED_AS_FALLACY = 2\nNOTIFICATION_FOLLOWED_A_SPEAKER = 3\nNOTIFICATION_SUPPORTED_A_DECLARATION = 4\nNOTIFICATION_TYPES = (\n    (NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION, \"added-declaration-for-resolution\"),\n    (NOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION, \"added-declaration-for-declaration\"),\n    (NOTIFICATION_REPORTED_AS_FALLACY, \"reported-as-fallacy\"),\n    (NOTIFICATION_FOLLOWED_A_SPEAKER, \"followed\"),\n    (NOTIFICATION_SUPPORTED_A_DECLARATION, \"supported-a-declaration\"),\n)\ndef get_notification_message(notification_type):\n    for notification_tuple in NOTIFICATION_TYPES:\n        if notification_tuple[0] == notification_type:\n            return notification_tuple[1]\n    return \"Notification type not found\"\n", "entry_point": "get_notification_message", "input": "1", "output": "'added-declaration-for-declaration'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86427_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3313", "output": "{1, 3313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3312", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025824", "code": "def extract_text_from_paragraph_elements(paragraph_elements):\n    \"\"\"\n    Extracts text content from a list of ParagraphElement objects.\n    Args:\n        paragraph_elements: List of ParagraphElement objects\n    Returns:\n        List of text content extracted from each element\n    \"\"\"\n    extracted_text = []\n    for element in paragraph_elements:\n        text_run = element.get('textRun')\n        if text_run is None:\n            extracted_text.append('')\n        else:\n            extracted_text.append(text_run.get('content', ''))\n    return extracted_text\n", "entry_point": "extract_text_from_paragraph_elements", "input": "[{'textRun': None}] * 7", "output": "['', '', '', '', '', '', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35466_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025825", "code": "def word_frequency(text):\n    text = text.lower()  # Convert text to lowercase\n    words = text.split()  # Split text into words\n    frequency_dict = {}  # Dictionary to store word frequencies\n    for word in words:\n        # Remove any punctuation marks if needed\n        word = word.strip('.,!?;:\"')\n        if word in frequency_dict:\n            frequency_dict[word] += 1\n        else:\n            frequency_dict[word] = 1\n    return frequency_dict\n", "entry_point": "word_frequency", "input": "'hello wld'", "output": "{'hello': 1, 'wld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117162_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025826", "code": "def find_anomaly(numbers, preamble_size):\n    def is_valid(window, number):\n        for i in range(len(window)):\n            for j in range(i + 1, len(window)):\n                if window[i] + window[j] == number:\n                    return True\n        return False\n    window = numbers[:preamble_size]\n    for i in range(preamble_size, len(numbers)):\n        number = numbers[i]\n        if not is_valid(window, number):\n            return number\n        window.pop(0)\n        window.append(number)\n    return None\n", "entry_point": "find_anomaly", "input": "[5, 6, 7, 4], 3", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105708_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025827", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[8, 12, 6, 10, 3, 5, 7]", "output": "([8, 12, 6, 10], [3, 5, 7])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5701", "output": "{1, 5701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025829", "code": "def increment_version(version):\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Join the components back together to form the updated version number\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'1.1.0'", "output": "'1.1.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12435_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025830", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6459", "output": "{3, 1, 6459, 2153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025831", "code": "def calculate_gpu_memory_usage(processes):\n    max_memory_usage = max(processes)\n    total_memory_usage = sum(processes)\n    return max_memory_usage, total_memory_usage\n", "entry_point": "calculate_gpu_memory_usage", "input": "[1022, 500, 500, 500, 678]", "output": "(1022, 3200)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48951_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025832", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[89, 80, 51, 42, 41, 39, 39, 38, 37, 36], 7", "output": "[89, 80, 51, 42, 41, 39, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025833", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9519", "output": "{1, 3, 3173, 167, 9519, 19, 501, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025834", "code": "def calculate_sum_times_largest_odd(input_list):\n    largest_odd = float('-inf')\n    sum_even = 0\n    has_even = False\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n            has_even = True\n        elif num % 2 != 0 and num > largest_odd:\n            largest_odd = num\n    if has_even:\n        return sum_even * largest_odd\n    else:\n        return 0\n", "entry_point": "calculate_sum_times_largest_odd", "input": "[2, 4, 9]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140110_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025835", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[86.25, 86.25, 86.25, 86.25]", "output": "86.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025836", "code": "def calculate_mean_median(numbers):\n    # Calculate the mean\n    mean = sum(numbers) / len(numbers)\n    # Sort the list to find the median\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:\n        # If the list has an even number of elements\n        median = (sorted_numbers[n // 2 - 1] + sorted_numbers[n // 2]) / 2\n    else:\n        # If the list has an odd number of elements\n        median = sorted_numbers[n // 2]\n    return mean, median\n", "entry_point": "calculate_mean_median", "input": "[4, 4, 5]", "output": "(4.333333333333333, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51463_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025837", "code": "import math\ndef combs(n, k):\n    if k == 0 or k == n:\n        return 1\n    return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))\n", "entry_point": "combs", "input": "5, 2", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128662_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025838", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: int) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    result = []\n    while end < len(temperatures):\n        if max(temperatures[start:end+1]) - min(temperatures[start:end+1]) <= threshold:\n            if end - start + 1 > max_length:\n                max_length = end - start + 1\n                result = temperatures[start:end+1]\n            end += 1\n        else:\n            start += 1\n    return result\n", "entry_point": "longest_contiguous_subarray", "input": "[70, 69, 68, 69, 68, 71], 1", "output": "[69, 68, 69, 68]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105139_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2237", "output": "{1, 2237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025840", "code": "def calculate_total_size_in_kb(file_sizes):\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024\n    return total_size_kb\n", "entry_point": "calculate_total_size_in_kb", "input": "[6144]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119982_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025841", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "99", "output": "{1, 33, 3, 99, 9, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt98", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025842", "code": "def find_single_integer(nums):\n    integersDict = {}\n    for num in nums:\n        if num in integersDict:\n            integersDict[num] += 1\n        else:\n            integersDict[num] = 1\n    for integer in integersDict:\n        if integersDict[integer] != 3:\n            return integer\n    return nums[0]\n", "entry_point": "find_single_integer", "input": "[9, 1, 1, 1, 2, 2, 2]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39275_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025843", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[108, 109, 72, 109, 100, 109]", "output": "'lmHmdm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025844", "code": "def state_transition(current_state, event):\n    transitions = {\n        'INITIAL': {'START': 'CONNECTING'},\n        'CONNECTING': {'SUCCESS': 'ESTABLISHED', 'FAILURE': 'ERROR'},\n        'ESTABLISHED': {'VALIDATE': 'ACCEPTED', 'REJECT': 'DECLINED'},\n        'ACCEPTED': {'FINISH': 'ENDED'},\n        'DECLINED': {'FINISH': 'ENDED'},\n        'ERROR': {'RESET': 'ENDED'}\n    }\n    if current_state in transitions and event in transitions[current_state]:\n        return transitions[current_state][event]\n    else:\n        return current_state\n", "entry_point": "state_transition", "input": "'INITIAL', 'INVALID_EVENT'", "output": "'INITIAL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30124_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025845", "code": "def calculate_total_score(scores):\n    total_score = 0\n    for score in scores:\n        if score % 5 == 0 and score % 7 == 0:\n            total_score += score * 4\n        elif score % 5 == 0:\n            total_score += score * 2\n        elif score % 7 == 0:\n            total_score += score * 3\n        else:\n            total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93768_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025846", "code": "def attribute_count(containers, attribute, value):\n    count = 0\n    for container in containers:\n        if attribute in container and container[attribute] == value:\n            count += 1\n    return count\n", "entry_point": "attribute_count", "input": "[], 'color', 'blue'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106342_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025847", "code": "def parse_vm_info(input_str):\n    vm_info = {}\n    entries = input_str.split('^')\n    for entry in entries:\n        vm_name, ip_address = entry.split(':')\n        vm_info[vm_name] = ip_address\n    return vm_info\n", "entry_point": "parse_vm_info", "input": "'VM1:.168.1.2^VM3:192.168.1.3'", "output": "{'VM1': '.168.1.2', 'VM3': '192.168.1.3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46533_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025848", "code": "def calculate_matrix_sum(matrix, size):\n    total_sum = 0\n    for row in matrix:\n        total_sum += sum(row)\n    return total_sum\n", "entry_point": "calculate_matrix_sum", "input": "[], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64447_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025849", "code": "def solution(array):\n    result = array.copy()  # Create a copy of the input array to avoid modifying the original array\n    for i in range(len(array) - 1):\n        if array[i] == 0 and array[i + 1] == 1:\n            result[i], result[i + 1] = result[i + 1], result[i]  # Swap the elements if the condition is met\n    return result\n", "entry_point": "solution", "input": "[1, 1, 1, 0, 1, 1, 0, 1]", "output": "[1, 1, 1, 1, 0, 1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107637_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025850", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "206", "output": "{1, 2, 206, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025851", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[6, 5]", "output": "('Rel Days 6 to 5', 'reldays6_5')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025852", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[(1, 10), (2, 25), (3, 50)]", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025853", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[3, 3, 3, 3, 2, 2, 2, 0, 0]", "output": "[3, 3, 3, 3, 2, 2, 2, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025854", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[5, 5, 8, 10, -1, -1, 5]", "output": "[10, 8, 5, 5, 5, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025855", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[8, 8, 2, 7, 1]", "output": "[8, 9, 4, 10, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "525", "output": "{1, 3, 35, 5, 7, 105, 75, 525, 175, 15, 21, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt524", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025857", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'3.14.27'", "output": "(3, 14, 27)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025858", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[4, 6, 4, 6, 9, 8, 9]", "output": "[4, 4, 6, 6, 8, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025859", "code": "def calculate_return_percentage(investment, return_investment):\n    if investment == 0:\n        return 0\n    return_percent = (return_investment / abs(investment)) * 100\n    return return_percent\n", "entry_point": "calculate_return_percentage", "input": "100, 49.950248756218905", "output": "49.950248756218905", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45868_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025860", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "76, 'add_c_columaddts.sql'", "output": "'76_add_c_columaddts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025861", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "3", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025862", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "'key1 vae'", "output": "['key1', 'vae']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025863", "code": "from typing import List, Optional\ndef validate_patient_ages(ages: List[Optional[int]]) -> List[bool]:\n    validations = []\n    for age in ages:\n        if age is None:\n            validations.append(True)\n        elif isinstance(age, int) and 1 <= age <= 100:\n            validations.append(True)\n        else:\n            validations.append(False)\n    return validations\n", "entry_point": "validate_patient_ages", "input": "[None, 25, -1, 50, 75, 100]", "output": "[True, True, False, True, True, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16067_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025864", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(2, 3, 3, 3, 1, 1, 2, 1)", "output": "'2.3.3.3.1.1.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025865", "code": "def card_war(player1_cards, player2_cards):\n    player1_wins = 0\n    player2_wins = 0\n    for card1, card2 in zip(player1_cards, player2_cards):\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return player1_wins, player2_wins\n", "entry_point": "card_war", "input": "[5, 2], [3, 4]", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14853_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025866", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'trai1g: '", "output": "{'trai1g': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025867", "code": "def calculate_train_info(total_loss, total_acc, i):\n    train_info = {}\n    train_info['loss'] = total_loss / float(i + 1)\n    train_info['train_accuracy'] = total_acc / float(i + 1)\n    return train_info\n", "entry_point": "calculate_train_info", "input": "99.0, 76.0, 1", "output": "{'loss': 49.5, 'train_accuracy': 38.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025868", "code": "def process_network_info(network_info):\n    hypervisor_set = set()\n    server_set = set()\n    for network in network_info:\n        if network['type'] == 'hypervisor':\n            hypervisor_set.add(network['name'])\n        else:\n            server_set.add(network['name'])\n    return hypervisor_set, server_set\n", "entry_point": "process_network_info", "input": "[]", "output": "(set(), set())", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44889_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025869", "code": "def top_three_scores(scores):\n    unique_scores = list(set(scores))\n    unique_scores.sort(reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 92, 91, 89, 85, 85]", "output": "[100, 92, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123750_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025870", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 18]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025871", "code": "def process_criteria(criteria: str) -> int:\n    name, operator = criteria.split(':')\n    result = ord(name[0]) & ord(operator[-1])\n    return result\n", "entry_point": "process_criteria", "input": "'y:y'", "output": "121", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137762_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "566", "output": "{1, 2, 283, 566}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt565", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025873", "code": "from array import array\ndef high_and_low(numbers: str) -> str:\n    # Split the input string into individual numbers and convert them to integers\n    num_list = list(map(int, numbers.split()))\n    # Convert the list of numbers into an array of integers\n    num_array = array(\"i\", num_list)\n    # Find the maximum and minimum values in the array\n    max_num = max(num_array)\n    min_num = min(num_array)\n    # Return a formatted string containing the highest and lowest numbers\n    return f\"{max_num} {min_num}\"\n", "entry_point": "high_and_low", "input": "'-33'", "output": "'-33 -33'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96361_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025874", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[-1, 10, 5, 2]", "output": "[5, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025875", "code": "from typing import List\ndef chunker(seq: List[int], size: int) -> List[List[int]]:\n    chunks = []\n    for pos in range(0, len(seq), size):\n        chunks.append(seq[pos : pos + size])\n    return chunks\n", "entry_point": "chunker", "input": "[7, 2, 6, 2, 4, 4, 3], 7", "output": "[[7, 2, 6, 2, 4, 4, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102906_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025876", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[1, 2, 2, 3, 4, 5, 5, 1]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025877", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'1 + 2'", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025878", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "42, [8]", "output": "48", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025879", "code": "def calculate_average_cost(plans):\n    total_cost = sum(plan['cost'] for plan in plans)\n    average_cost = total_cost / len(plans) if len(plans) > 0 else 0\n    return round(average_cost, 2)\n", "entry_point": "calculate_average_cost", "input": "[{'cost': 70}, {'cost': 70}, {'cost': 60}]", "output": "66.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87062_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025880", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_right', 2, 3", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025881", "code": "def calculate_average_duration(test_cases):\n    total_duration = 0\n    passed_count = 0\n    for test_case in test_cases:\n        if test_case[\"status\"] == \"pass\":\n            total_duration += test_case[\"duration\"]\n            passed_count += 1\n    if passed_count == 0:\n        return 0  # To handle the case where there are no passed test cases\n    average_duration = total_duration / passed_count\n    return average_duration\n", "entry_point": "calculate_average_duration", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11612_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "655", "output": "{1, 131, 5, 655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt654", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025883", "code": "def count_unique_country_codes(country_codes):\n    unique_country_codes = set()\n    for code in country_codes:\n        unique_country_codes.add(code)\n    return len(unique_country_codes)\n", "entry_point": "count_unique_country_codes", "input": "['US', 'CA', 'FR', 'DE', 'JP', 'IN', 'BR']", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116809_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025884", "code": "def evaluate_polynomial(coefs, x0):\n    result = 0\n    for coef in reversed(coefs):\n        result = coef + result * x0\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[257], 1", "output": "257", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86312_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025885", "code": "import os\ndef find_root_directory(file_path):\n    if os.name == 'nt':  # Windows OS\n        path_parts = file_path.split('\\\\')\n        return path_parts[0] + '\\\\'\n    else:  # Unix-like OS\n        path_parts = file_path.split('/')\n        return '/' if path_parts[0] == '' else path_parts[0] + '/'\n", "entry_point": "find_root_directory", "input": "'C:\\\\Program FilenC:\\\\Pr'", "output": "'C:\\\\Program FilenC:\\\\Pr/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111896_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025886", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[1, 6, 6, 5, 1, 5, 4, 4]", "output": "[1, 6, 6, 5, 1, 5, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025887", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "100, {5: True, 1: True, 2: False, 3: False}", "output": "[5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025888", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[7, 1, 1, 1, 0, 7, 4, 2]", "output": "[8, 2, 2, 1, 7, 11, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025889", "code": "def convert_bitmap_to_active_bits(primary_bitmap):\n    active_data_elements = []\n    for i in range(len(primary_bitmap)):\n        if primary_bitmap[i] == '1':\n            active_data_elements.append(i + 1)  # Data element numbers start from 1\n    return active_data_elements\n", "entry_point": "convert_bitmap_to_active_bits", "input": "'100000000001000000001'", "output": "[1, 12, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53443_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025890", "code": "def organize_books(books):\n    author_to_titles = {}\n    for book in books:\n        title = book[\"title\"]\n        authors = book[\"authors\"]\n        for author in authors:\n            if author in author_to_titles:\n                author_to_titles[author].append(title)\n            else:\n                author_to_titles[author] = [title]\n    return author_to_titles\n", "entry_point": "organize_books", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42879_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025891", "code": "n_queue = [1, 2, 3, 4, 5]\ndef process_queue(queue, count):\n    for _ in range(count):\n        first_element = queue.pop(0)\n        queue.append(first_element ** 2)\n    return queue\n", "entry_point": "process_queue", "input": "[1, 2, 3, 4, 5], 3", "output": "[4, 5, 1, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44311_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025892", "code": "def create_image(pixel_values):\n    side_length = int(len(pixel_values) ** 0.5)\n    image = [[0 for _ in range(side_length)] for _ in range(side_length)]\n    for i in range(side_length):\n        for j in range(side_length):\n            image[i][j] = pixel_values[i * side_length + j]\n    return image\n", "entry_point": "create_image", "input": "[160, 130, 64, 253]", "output": "[[160, 130], [64, 253]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113012_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025893", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9893", "output": "{1, 13, 761, 9893}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025894", "code": "import math\ndef getRow(rowIndex):\n    result = [1]\n    if rowIndex == 0:\n        return result\n    n = rowIndex\n    for i in range(int(math.ceil((float(rowIndex) + 1) / 2) - 1)):\n        result.append(result[-1] * n / (rowIndex - n + 1))\n        n -= 1\n    if rowIndex % 2 == 0:\n        result.extend(result[-2::-1])\n    else:\n        result.extend(result[::-1])\n    return result\n", "entry_point": "getRow", "input": "5", "output": "[1, 5.0, 10.0, 10.0, 5.0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127863_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025895", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7243", "output": "{1, 7243}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025896", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 3, 4, 4, 6, 8, 9]", "output": "[4, 4, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025897", "code": "def sum_with_index(lst):\n    result = []\n    for idx, num in enumerate(lst):\n        result.append(num + idx)\n    return result\n", "entry_point": "sum_with_index", "input": "[4, 0, 1, 4, 1, 5]", "output": "[4, 1, 3, 7, 5, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63221_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025898", "code": "def manipulate_string(input_string: str) -> str:\n    # Step 1: Reverse the input string\n    reversed_string = input_string[::-1]\n    # Step 2: Capitalize the first letter of the reversed string\n    capitalized_string = reversed_string.capitalize()\n    # Step 3: Append the length of the original string\n    final_output = capitalized_string + str(len(input_string))\n    return final_output\n", "entry_point": "manipulate_string", "input": "'helloO'", "output": "'Oolleh6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1099_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025899", "code": "def sum_of_diagonals(mat):\n    res = 0\n    i, j = 0, 0\n    while j < len(mat):\n        res += mat[i][j]\n        i += 1\n        j += 1\n    i, j = 0, len(mat) - 1\n    while j >= 0:\n        if i != j:\n            res += mat[i][j]\n        i += 1\n        j -= 1\n    return res\n", "entry_point": "sum_of_diagonals", "input": "[[3, 1], [4, 6]]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84275_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025900", "code": "from typing import List\ndef threeSumClosest(nums: List[int], target: int) -> int:\n    nums.sort()\n    closest_sum = float('inf')\n    for i in range(len(nums) - 2):\n        left, right = i + 1, len(nums) - 1\n        while left < right:\n            current_sum = nums[i] + nums[left] + nums[right]\n            if abs(current_sum - target) < abs(closest_sum - target):\n                closest_sum = current_sum\n            if current_sum < target:\n                left += 1\n            elif current_sum > target:\n                right -= 1\n            else:\n                return target  # Found an exact match, no need to continue\n    return closest_sum\n", "entry_point": "threeSumClosest", "input": "[-1, -1, -1, 1], -3", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47065_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025901", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "100", "output": "{1, 2, 4, 100, 5, 10, 50, 20, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt99", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4042", "output": "{1, 2, 2021, 4042, 43, 47, 86, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4041", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025903", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # If there are 0 or 1 scores, return 0 as average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[65, 70, 72, 75, 80]", "output": "72.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12123_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025904", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4163", "output": "{1, 4163, 181, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025905", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "0, 0.01", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025906", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1885", "output": "{1, 65, 5, 13, 145, 29, 377, 1885}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025907", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'example', '1.00.0.1'", "output": "{'1.00.0.1': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025908", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'20 + 2'", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025909", "code": "def contains_duplicates(nums: [int]) -> bool:\n    return len(nums) != len(set(nums))\n", "entry_point": "contains_duplicates", "input": "[1, 2, 3]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49260_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7177", "output": "{1, 7177}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025911", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "'option2'", "output": "('option2', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025912", "code": "def is_valid_seed(seed: str) -> bool:\n    n = len(seed)\n    for i in range(1, n // 2 + 1):\n        if n % i == 0:\n            repeated_seq = seed[:i]\n            if all(seed[j:j+i] == repeated_seq for j in range(0, n, i)) and seed != repeated_seq:\n                return True\n    return False\n", "entry_point": "is_valid_seed", "input": "'abab'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143461_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025913", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "629", "output": "{1, 37, 629, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025914", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[89, 90, 91, 92, 93]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025915", "code": "import os\ndef process_uprojects(mac_uprojects, ue4_mac):\n    uprojects = []\n    for uproject_path in mac_uprojects:\n        uproject_name = os.path.basename(uproject_path).split('.')[0]\n        uprojects.append(\n            {\n                'uproject_path': uproject_path,\n                'ue4_path': ue4_mac,\n                'log_file': f'log/mac_{uproject_name}.log'\n            }\n        )\n    return uprojects\n", "entry_point": "process_uprojects", "input": "[], '/path/to/ue4_mac'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7226_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025916", "code": "IMAGE_CLASSIFICATION_BENCHMARKS = {\n    'task1': 'Benchmark info for task1 in image classification',\n    'task2': 'Benchmark info for task2 in image classification',\n}\nVISION_BENCHMARKS = {\n    'image_classification': IMAGE_CLASSIFICATION_BENCHMARKS,\n}\nNLP_BENCHMARKS = {\n    'task1': 'Benchmark info for task1 in NLP',\n}\nQAT_BENCHMARKS = {\n    'task1': 'Benchmark info for task1 in QAT',\n}\ndef get_benchmark_info(domain, task_type):\n    if domain in VISION_BENCHMARKS:\n        if task_type in VISION_BENCHMARKS[domain]:\n            return VISION_BENCHMARKS[domain][task_type]\n        else:\n            return \"Benchmark information for the task type is not available.\"\n    elif domain == 'NLP':\n        if task_type in NLP_BENCHMARKS:\n            return NLP_BENCHMARKS[task_type]\n        else:\n            return \"Benchmark information for the task type is not available.\"\n    elif domain == 'QAT':\n        if task_type in QAT_BENCHMARKS:\n            return QAT_BENCHMARKS[task_type]\n        else:\n            return \"Benchmark information for the task type is not available.\"\n    else:\n        return \"Domain not found.\"\n", "entry_point": "get_benchmark_info", "input": "'QAT', 'task1'", "output": "'Benchmark info for task1 in QAT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72628_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025917", "code": "def latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_major, current_minor, current_patch = map(int, version.split('.'))\n            latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n            if current_major > latest_major or \\\n                    (current_major == latest_major and current_minor > latest_minor) or \\\n                    (current_major == latest_major and current_minor == latest_minor and current_patch > latest_patch):\n                latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['1.0.0', '1.1.5', '1.2.3', '1.2.4']", "output": "'1.2.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94924_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025918", "code": "from typing import List\nSPACES = ' ' * 4\ndef indent_strings(strings: List[str]) -> List[str]:\n    indented_strings = []\n    for string in strings:\n        indented_strings.append(SPACES + string)\n    return indented_strings\n", "entry_point": "indent_strings", "input": "['Hello', 'World', 'Python']", "output": "['    Hello', '    World', '    Python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53541_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025919", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'00:00:00', '01:14:55'", "output": "4495", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025920", "code": "def climbStairs(n):\n    # Initialization\n    dp = [0] * (n + 1)\n    dp[0] = 1\n    dp[1] = 1\n    # Dynamic Programming\n    for i in range(2, n + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[n]\n", "entry_point": "climbStairs", "input": "8", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68582_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025921", "code": "def parse_launches(input_str):\n    launches_dict = {}\n    launches_list = input_str.split(',')\n    for launch_pair in launches_list:\n        date, description = launch_pair.split(':')\n        launches_dict[date] = description\n    return launches_dict\n", "entry_point": "parse_launches", "input": "'2022-0-10:Lch'", "output": "{'2022-0-10': 'Lch'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64743_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025922", "code": "def defragment_memory(blocks):\n    next_pos = 0\n    for i in range(len(blocks)):\n        if blocks[i] != 0:\n            blocks[next_pos], blocks[i] = blocks[i], blocks[next_pos]\n            next_pos += 1\n    while next_pos < len(blocks):\n        blocks[next_pos] = 0\n        next_pos += 1\n    return blocks\n", "entry_point": "defragment_memory", "input": "[2, 5, 1, 2, 1, 4, 5, 3, 1]", "output": "[2, 5, 1, 2, 1, 4, 5, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111320_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025923", "code": "import re\ndef alphanum(v: str) -> str:\n    \"\"\"Filters a string to only its alphanumeric characters.\"\"\"\n    return re.sub(r\"\\W+\", \"\", v)\n", "entry_point": "alphanum", "input": "'H@o$e#l%l^o!'", "output": "'Hoello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4337_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025924", "code": "def modified_sum_of_squares(n):\n    total = 0\n    for i in range(1, n + 1):\n        total += i * i\n    return total\n", "entry_point": "modified_sum_of_squares", "input": "9", "output": "285", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65611_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025925", "code": "def calculate_molecular_weight(chemical_formula):\n    # Atomic masses of elements\n    atomic_masses = {\n        'H': 1.008,\n        'He': 4.0026,\n        'Li': 6.94,\n        'Be': 9.0122,\n        'B': 10.81,\n        'C': 12.01,\n        'N': 14.01,\n        'O': 16.00,\n        'F': 19.00,\n        'Ne': 20.18,\n        # Add more elements as needed\n    }\n    # Parse chemical formula to extract elements and counts\n    elements = []\n    counts = []\n    current_element = ''\n    current_count = ''\n    for char in chemical_formula:\n        if char.isupper():\n            if current_element:\n                elements.append(current_element)\n                counts.append(int(current_count) if current_count else 1)\n                current_element = char\n                current_count = ''\n            else:\n                current_element = char\n        elif char.islower():\n            current_element += char\n        elif char.isdigit():\n            current_count += char\n    if current_element:\n        elements.append(current_element)\n        counts.append(int(current_count) if current_count else 1)\n    # Calculate total molecular weight\n    total_weight = sum(atomic_masses[element] * count for element, count in zip(elements, counts))\n    return total_weight\n", "entry_point": "calculate_molecular_weight", "input": "'C6H12O6'", "output": "180.156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122438_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025926", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 1, 6, 6, 9, 7, 7]", "output": "[7, 2, 8, 9, 13, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025927", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "1001", "output": "501501", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025928", "code": "def min_unsorted_subarray_length(nums):\n    n = len(nums)\n    sorted_nums = sorted(nums)\n    start, end = n + 1, -1\n    for i in range(n):\n        if nums[i] != sorted_nums[i]:\n            start = min(start, i)\n            end = max(end, i)\n    diff = end - start\n    return diff + 1 if diff > 0 else 0\n", "entry_point": "min_unsorted_subarray_length", "input": "[2, 3, 1, 4, 5]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20405_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025929", "code": "def calculate_average_without_outliers(numbers, threshold):\n    median = sorted(numbers)[len(numbers) // 2] if len(numbers) % 2 != 0 else sum(sorted(numbers)[len(numbers) // 2 - 1:len(numbers) // 2 + 1]) / 2\n    outliers = [num for num in numbers if abs(num - median) > threshold]\n    filtered_numbers = [num for num in numbers if num not in outliers]\n    if len(filtered_numbers) == 0:\n        return 0  # Return 0 if all numbers are outliers\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_without_outliers", "input": "[99.6, 100.6, 100.6, 101.6, 102.6], 0.5", "output": "100.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15753_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025930", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'example_contract'", "output": "'contracts/example_contract.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025931", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'   Hello, World!   '", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025932", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "100.0, 103.26086956521739", "output": "3.2608695652173907", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025933", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1623", "output": "{1, 3, 541, 1623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025934", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'EhElD'", "output": "'EhElD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025935", "code": "import re\ndef refine_song_title(song_title: str) -> str:\n    # Remove leading and trailing whitespaces\n    refined_title = song_title.strip()\n    # Convert the title to title case\n    refined_title = refined_title.title()\n    # Replace \"feat.\" with \"ft.\"\n    refined_title = refined_title.replace(\"Feat.\", \"ft.\").replace(\"feat.\", \"ft.\")\n    # Remove special characters except spaces, apostrophes, and hyphens\n    refined_title = re.sub(r'[^a-zA-Z0-9\\s\\'-]', '', refined_title)\n    return refined_title\n", "entry_point": "refine_song_title", "input": "'  Hello World feat. John-Doe  '", "output": "'Hello World ft John-Doe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29346_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025936", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JJJoJ', 'emith', 'MMariMarMarar'", "output": "'JJJoJ MMariMarMarar emith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025937", "code": "def rotate_2d_array(arr):\n    if not arr:\n        return arr\n    rows, cols = len(arr), len(arr[0])\n    # Transpose the matrix\n    for i in range(rows):\n        for j in range(i, cols):\n            arr[i][j], arr[j][i] = arr[j][i], arr[i][j]\n    # Reverse each row\n    for i in range(rows):\n        arr[i] = arr[i][::-1]\n    return arr\n", "entry_point": "rotate_2d_array", "input": "[[], [], [], [], [], [], [], [], []]", "output": "[[], [], [], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81190_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025938", "code": "def calculate_total_time_elapsed(frame_interval, num_frames):\n    time_interval = frame_interval * 10.0 / 60.0  # Calculate time interval for 10 frames in minutes\n    total_time_elapsed = time_interval * (num_frames / 10)  # Calculate total time elapsed in minutes\n    return total_time_elapsed\n", "entry_point": "calculate_total_time_elapsed", "input": "19.785362687999996, 100", "output": "32.975604479999994", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24500_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025939", "code": "from typing import List\ndef calculate_closest_average(hitoffsets: List[float]) -> int:\n    if not hitoffsets:\n        return 0\n    total_sum = sum(hitoffsets)\n    average = total_sum / len(hitoffsets)\n    closest_integer = round(average)\n    return closest_integer\n", "entry_point": "calculate_closest_average", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35525_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025940", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/any/base/path', '/var/wwww/imageim/geimlog'", "output": "'/var/wwww/imageim/geimlog'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025941", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'120.11', 8074", "output": "'http://120.11:8074'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025942", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "6, 3", "output": "216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025943", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8577", "output": "{1, 8577, 3, 9, 2859, 953}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025944", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3751", "output": "{1, 3751, 11, 341, 121, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025945", "code": "def count_substring_occurrences(larger_str, substring):\n    count = 0\n    start_index = 0\n    while start_index <= len(larger_str) - len(substring):\n        if larger_str[start_index:start_index + len(substring)] == substring:\n            count += 1\n            start_index += 1\n        else:\n            start_index += 1\n    return count\n", "entry_point": "count_substring_occurrences", "input": "'ab', 'a'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94062_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025946", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "17, 3", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025947", "code": "import math\ndef calculate_circle_area(radius):\n    # Calculate the area of the circle using the formula: area = \u03c0 * radius^2\n    area = math.pi * radius**2\n    # Round the area to two decimal places\n    rounded_area = round(area, 2)\n    return rounded_area\n", "entry_point": "calculate_circle_area", "input": "4.0", "output": "50.27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119846_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025948", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 1, 4, 1, 3, -2, 2, 1]", "output": "[1, 5, 5, 4, 1, 0, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73916_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025949", "code": "import math\ndef calculate_combinations(top_k):\n    if top_k < 2:\n        return 0  # No combinations possible with less than 2 embeddings\n    total_combinations = math.factorial(top_k) // math.factorial(top_k - 2)\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "6", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132126_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025950", "code": "from typing import List\ndef lift_simulation(people: int, lift: List[int]) -> str:\n    if people <= 0 and sum(lift) % 4 != 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people > 0:\n        return f\"There isn't enough space! {people} people in a queue!\\n\" + ' '.join(map(str, lift))\n    elif people <= 0 and sum(lift) == 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people <= 0:\n        return ' '.join(map(str, lift))\n", "entry_point": "lift_simulation", "input": "0, [70, 80]", "output": "'The lift has empty spots!\\n70 80'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147066_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2491", "output": "{1, 2491, 53, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025952", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2023-01-01', '2023-01-12'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025953", "code": "def count_severities(severity_str):\n    severities = {}\n    for severity in severity_str.split(','):\n        severity = severity.strip()  # Remove leading and trailing spaces\n        if severity in severities:\n            severities[severity] += 1\n        else:\n            severities[severity] = 1\n    return severities\n", "entry_point": "count_severities", "input": "', Critic'", "output": "{'': 1, 'Critic': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5726_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025954", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3178", "output": "{1, 2, 227, 454, 7, 3178, 14, 1589}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025955", "code": "def parse_mutation_input(instr):\n    init_split = instr.split(',')  # Split input string by commas\n    second_split = [tuple(i.split('.')) for i in init_split]  # Split each pair by periods to extract gene and mutation type\n    return second_split\n", "entry_point": "parse_mutation_input", "input": "'gene1.mu3ut'", "output": "[('gene1', 'mu3ut')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101583_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025956", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[3, 4], [2, [5, 5]]]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025957", "code": "def schedule_processes(procesos):\n    sorted_processes = sorted(procesos, key=lambda x: x[2])  # Sort processes based on burst time\n    scheduling_order = [process[0] for process in sorted_processes]  # Extract process IDs in the sorted order\n    return scheduling_order\n", "entry_point": "schedule_processes", "input": "[(0, 'name0', 3), (1, 'name1', 2), (2, 'name2', 1)]", "output": "[2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16469_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025958", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3743", "output": "{1, 19, 197, 3743}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3742", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025959", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[27]", "output": "[27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025960", "code": "def organize_dependencies(dependencies):\n    organized_deps = {}\n    for dep in dependencies:\n        extension = dep.split('.')[-1]\n        if extension in organized_deps:\n            organized_deps[extension].append(dep)\n        else:\n            organized_deps[extension] = [dep]\n    return organized_deps\n", "entry_point": "organize_dependencies", "input": "['li-u', 'li-tu', 'li-tu']", "output": "{'li-u': ['li-u'], 'li-tu': ['li-tu', 'li-tu']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36616_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025961", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5578", "output": "{1, 5578, 2, 2789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5577", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025962", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3154", "output": "{1, 2, 166, 38, 1577, 3154, 19, 83}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025963", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9219", "output": "{1, 3073, 3, 9219, 1317, 7, 21, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025964", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6542", "output": "{1, 2, 6542, 3271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6541", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025965", "code": "# Step 1: Define the 'data' variable with paper information\ndata = [\n    {'ID': '1', 'reference': 'Author1, Year1', 'title': 'Paper Title 1', 'abstract': 'Abstract of Paper 1'},\n    {'ID': '2', 'reference': 'Author2, Year2', 'title': 'Paper Title 2', 'abstract': 'Abstract of Paper 2'},\n    # Add more paper information as needed\n]\n# Step 2: Define a custom keyword extraction algorithm\ndef extract_keywords(text):\n    # Implement your custom keyword extraction algorithm here\n    # This can involve techniques like tokenization, frequency analysis, etc.\n    # For simplicity, let's split the text into words and consider each word as a keyword\n    return text.split()\n", "entry_point": "extract_keywords", "input": "'1of1.'", "output": "['1of1.']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110944_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025966", "code": "import re\ndef count_words(text):\n    word_counts = {}\n    # Split the text into individual words\n    words = text.split()\n    for word in words:\n        # Remove punctuation marks and convert to lowercase\n        cleaned_word = re.sub(r'[^\\w\\s]', '', word).lower()\n        # Update word count in the dictionary\n        if cleaned_word in word_counts:\n            word_counts[cleaned_word] += 1\n        else:\n            word_counts[cleaned_word] = 1\n    return word_counts\n", "entry_point": "count_words", "input": "'tworlt'", "output": "{'tworlt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123802_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025967", "code": "def convert(s: str) -> str:\n    result = \"\"\n    for c in s:\n        if c.isalpha():\n            if c.islower():\n                result += c.upper()\n            else:\n                result += c.lower()\n        elif c.isdigit():\n            result += '#'\n        else:\n            result += c\n    return result\n", "entry_point": "convert", "input": "'oo2Helo'", "output": "'OO#hELO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60962_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025968", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 2, 5, 4, 1]", "output": "[5, 7, 9, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31739_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025969", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'fo=bauoxf'", "output": "{'fo': 'bauoxf'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025970", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'mymy_mle'", "output": "'mymy_mle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025971", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.Doe@Example.com'", "output": "'john.doe@example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025972", "code": "from collections import Counter\ndef most_common_elements(input_list):\n    counter = Counter(input_list)\n    max_freq = max(counter.values())\n    most_common = sorted([(elem, freq) for elem, freq in counter.items() if freq == max_freq])\n    return most_common\n", "entry_point": "most_common_elements", "input": "[5, 5, 5]", "output": "[(5, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88222_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8302", "output": "{1, 2, 1186, 7, 8302, 14, 593, 4151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8301", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3095", "output": "{1, 619, 5, 3095}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025975", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3771", "output": "{1, 3, 419, 1257, 9, 3771}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025976", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[2, 2, 2, 2, 2, 1, 4, 0]", "output": "{2: 5, 1: 1, 4: 1, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025977", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[6, -6, 2, 3, 6]", "output": "[36, 216, 4, 9, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025978", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[2, 2, 2, 0, 0, 0, 1, 1, 3]", "output": "{2: 3, 0: 3, 1: 2, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025979", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'ad: '", "output": "{'ad': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025980", "code": "def generate_population(number_of_decision_variables, population_size_for_each_variable, total_population_size_limit):\n    total_population_needed = number_of_decision_variables * population_size_for_each_variable\n    if total_population_needed > total_population_size_limit:\n        scaling_factor = total_population_size_limit / total_population_needed\n        population_size_for_each_variable = int(population_size_for_each_variable * scaling_factor)\n    population_distribution = [population_size_for_each_variable] * number_of_decision_variables\n    remaining_population = total_population_size_limit - sum(population_distribution)\n    for i in range(remaining_population):\n        population_distribution[i % number_of_decision_variables] += 1\n    return population_distribution\n", "entry_point": "generate_population", "input": "7, 14, 98", "output": "[14, 14, 14, 14, 14, 14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22068_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025981", "code": "from typing import List\ndef sum_multiples_3_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[10, 15, 24]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36161_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025982", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8933", "output": "{1, 8933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025983", "code": "def heap_sort(arr):\n    def max_heapify(arr, n, i):\n        l = 2 * i + 1\n        r = 2 * i + 2\n        largest = i\n        if l < n and arr[largest] < arr[l]:\n            largest = l\n        if r < n and arr[largest] < arr[r]:\n            largest = r\n        if largest != i:\n            arr[largest], arr[i] = arr[i], arr[largest]\n            max_heapify(arr, n, largest)\n    def build_max_heap(arr):\n        for i in range(len(arr) // 2, -1, -1):\n            max_heapify(arr, len(arr), i)\n    build_max_heap(arr)\n    for i in range(len(arr) - 1, 0, -1):\n        arr[0], arr[i] = arr[i], arr[0]\n        max_heapify(arr, i, 0)\n    return arr\n", "entry_point": "heap_sort", "input": "[8, 7, 14, 5, 8, 7, 8]", "output": "[5, 7, 7, 8, 8, 8, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34115_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025984", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[5, 1, 1, 0, 6, 5, 8]", "output": "[0, 1, 1, 5, 5, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025985", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'gMMgg'", "output": "'gMMgg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025986", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "'    //comment'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025987", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[5, 5, -2, -2, 6, 1, 1]", "output": "[5, -2, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025988", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3142", "output": "{1, 2, 1571, 3142}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3141", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025989", "code": "def calculate_total_thickness(ply_thickness, stacking_sequence, num_plies):\n    total_thickness = 0\n    for angle in stacking_sequence:\n        total_thickness += ply_thickness * num_plies\n    return total_thickness\n", "entry_point": "calculate_total_thickness", "input": "173.09294208000003, [0, 30, 60, 90], 1", "output": "692.3717683200001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40077_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025990", "code": "def extract_y_coordinates(coordinates):\n    y_coordinates = []  # Initialize an empty list to store y-coordinates\n    for coord in coordinates:\n        y_coordinates.append(coord[1])  # Extract y-coordinate (index 1) and append to the list\n    return y_coordinates\n", "entry_point": "extract_y_coordinates", "input": "[(1, 200), (2, 400), (3, 600), (4, 800)]", "output": "[200, 400, 600, 800]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19900_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025991", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4849", "output": "{1, 13, 373, 4849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025992", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[4, 2, 1, 5, 2, 4, 3, 5, 2]", "output": "[4, 6, 7, 12, 14, 18, 21, 26, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025993", "code": "def can_issue_warning(user_roles):\n    moderation_roles = ['moderators', 'admins']  # Roles allowed to issue a warning\n    for role in user_roles:\n        if role in moderation_roles:\n            return True\n    return False\n", "entry_point": "can_issue_warning", "input": "['users']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117657_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025994", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'inint x = 10 + yt'", "output": "['inint', 'x', '=', '10', '+', 'yt']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4238", "output": "{1, 2, 163, 326, 2119, 13, 4238, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2279", "output": "{1, 43, 53, 2279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2278", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025997", "code": "from typing import List\ndef remove_non_integers(x: List) -> List:\n    return [element for element in x if isinstance(element, int)]\n", "entry_point": "remove_non_integers", "input": "['a', 1234, 123.45, 1235, 'hello', 1234, 1234]", "output": "[1234, 1235, 1234, 1234]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118715_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025998", "code": "def get_min_val(lrecords, i):\n    min_val = float('inf')  # Initialize with a value greater than any possible value\n    for sublist in lrecords:\n        if sublist[i] < min_val:\n            min_val = sublist[i]\n    return min_val\n", "entry_point": "get_min_val", "input": "[[5, 6], [4, 7], [8, 2]], 0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56826_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0025999", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2274", "output": "{1, 2274, 3, 2, 6, 1137, 758, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026000", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'wow'", "output": "['w']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026001", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4665", "output": "{1, 3, 5, 933, 15, 1555, 311, 4665}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026002", "code": "def correct_path(url_path):\n    is_root = url_path == \"/\"\n    is_admin = url_path.startswith(\"/admin\")\n    has_trailing = url_path.endswith(\"/\")\n    if not (is_root or is_admin) and has_trailing:\n        return url_path[:-1]\n    return url_path\n", "entry_point": "correct_path", "input": "'//produc//'", "output": "'//produc/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33721_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026003", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[-1, 1, 1, 5, 1, 0, 5, 2], 3", "output": "[-1, 1, 1, 5, 1, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026004", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3658", "output": "'1 hour 58 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026005", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4562", "output": "{1, 4562, 2, 2281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026006", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6523", "output": "{11, 1, 6523, 593}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026007", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{0: 0, 1: 0, 2: 2}, 2", "output": "'[0,0,2]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026008", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[0, 2, 3, 2, 3, 2, 0, 2, 2]", "output": "[0, 2, 5, 7, 10, 12, 12, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026009", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9298", "output": "{1, 9298, 2, 4649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9297", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026010", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9626", "output": "{1, 9626, 2, 4813}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9625", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026011", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "6", "output": "555555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026012", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo This'", "output": "'This'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9478", "output": "{1, 2, 4739, 677, 9478, 7, 1354, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026014", "code": "def extract_package_info(package_info):\n    unique_packages = set()\n    unique_entry_points = set()\n    for key, value in package_info.items():\n        if key == \"install_requires\" or key == \"tests_require\":\n            for package in value:\n                package_name = package.split(\">=\")[0]\n                unique_packages.add(package_name)\n        elif key == \"entry_points\":\n            for entry_point in value[\"dffml.operation\"]:\n                unique_entry_points.add(entry_point)\n    return list(unique_packages), list(unique_entry_points)\n", "entry_point": "extract_package_info", "input": "{}", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122112_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026015", "code": "from typing import List\ndef extract_strings_with_prefix(input_list: List[str], prefix: str) -> List[str]:\n    result = []\n    for string in input_list:\n        if string.startswith(prefix):\n            result.append(string)\n    return result\n", "entry_point": "extract_strings_with_prefix", "input": "['apple', 'orange', 'avocado', 'banana'], 'a'", "output": "['apple', 'avocado']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27665_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026016", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[8, 1, 5]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026017", "code": "def minStatuesNeeded(statues):\n    min_height = min(statues)\n    max_height = max(statues)\n    total_statues = len(statues)\n    # Calculate the number of additional statues needed to make the array consecutive\n    additional_statues = (max_height - min_height + 1) - total_statues\n    return additional_statues\n", "entry_point": "minStatuesNeeded", "input": "[1, 1, 2]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18434_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026018", "code": "def find_first_non_repeating_char(s):\n    char_count = {}\n    # Count occurrences of each character\n    for char in s:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    # Find the first non-repeating character\n    for i in range(len(s)):\n        if char_count[s[i]] == 1:\n            return i\n    return -1\n", "entry_point": "find_first_non_repeating_char", "input": "'abac'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63867_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026019", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 3, 2, 3, 5, 5, 4, 5, 4]", "output": "[4, 8, 6, 8, 10, 8, 6, 8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026020", "code": "def generate_review_urls(prof_id, course_name, review_id=None, vote=None):\n    base_url = '/reviews/'\n    if review_id:\n        return f'{base_url}{review_id}/{prof_id}/{course_name}'\n    elif vote:\n        return f'{base_url}{review_id}/{vote}/{prof_id}/{course_name}'\n    else:\n        return f'{base_url}{prof_id}/{course_name}'\n", "entry_point": "generate_review_urls", "input": "123, 'math101'", "output": "'/reviews/123/math101'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129147_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026021", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[7, 5, 1, 2, 4, 6]", "output": "[7, 5, 1, 2, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026022", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'60 51'", "output": "111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026023", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "1.8, 1.0", "output": "1.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3689", "output": "{1, 7, 3689, 527, 17, 119, 217, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026025", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "721", "output": "{1, 721, 103, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026026", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'/home/usedata', '15'", "output": "'/home/usedata/15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026027", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3235", "output": "{1, 3235, 5, 647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3234", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026028", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'apple', 'orange'", "output": "'apple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026029", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2933", "output": "{1, 419, 2933, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026030", "code": "def count_increases(depths):\n    increase_count = 0\n    for i in range(len(depths) - 3):\n        sum1 = sum(depths[i : i + 3])\n        sum2 = sum(depths[i + 1 : i + 4])\n        if sum1 < sum2:\n            increase_count += 1\n    return increase_count\n", "entry_point": "count_increases", "input": "[1, 2, 3, 4, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99474_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026031", "code": "from typing import Dict, Any\ndef format_resolver(config: Dict[str, Any]) -> Any:\n    if \"format\" in config:\n        format_type = config[\"format\"]\n        value = config.get(\"value\", \"\")\n        if format_type == \"uppercase\":\n            return value.upper()\n        elif format_type == \"lowercase\":\n            return value.lower()\n        elif format_type == \"titlecase\":\n            return value.title()\n    return config.get(\"value\", \"\")\n", "entry_point": "format_resolver", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56105_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026032", "code": "def merge_sorted_lists(list1, list2):\n    merged_list = []\n    i, j = 0, 0\n    while i < len(list1) and j < len(list2):\n        if list1[i] < list2[j]:\n            merged_list.append(list1[i])\n            i += 1\n        else:\n            merged_list.append(list2[j])\n            j += 1\n    merged_list.extend(list1[i:])\n    merged_list.extend(list2[j:])\n    return merged_list\n", "entry_point": "merge_sorted_lists", "input": "[1, 2, 2, 2, 4], [2, 3, 4, 4, 6]", "output": "[1, 2, 2, 2, 2, 3, 4, 4, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104249_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026033", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7083", "output": "{1, 3, 9, 7083, 787, 2361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026034", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'JohnDoeSmith'", "output": "'John doe smith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026035", "code": "def euclid_algorithm(area):\n    \"\"\"Return the largest square to subdivide area by.\"\"\"\n    height = area[0]\n    width = area[1]\n    maxdim = max(height, width)\n    mindim = min(height, width)\n    remainder = maxdim % mindim\n    if remainder == 0:\n        return mindim\n    else:\n        return euclid_algorithm((mindim, remainder))\n", "entry_point": "euclid_algorithm", "input": "(240, 480)", "output": "240", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64166_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026036", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'number:'", "output": "'number:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026037", "code": "def process_data_sum(data):\n    processed_data = {}\n    for record in data:\n        name = record['name']\n        value = record['value']\n        if name in processed_data:\n            processed_data[name] += value\n        else:\n            processed_data[name] = value\n    return processed_data\n", "entry_point": "process_data_sum", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35237_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026038", "code": "def categorize_students(scores):\n    groups = {'A': [], 'B': [], 'C': []}\n    for score in scores:\n        if score >= 80:\n            groups['A'].append(score)\n        elif 60 <= score <= 79:\n            groups['B'].append(score)\n        else:\n            groups['C'].append(score)\n    return groups\n", "entry_point": "categorize_students", "input": "[85, 60, 45, 45, 45]", "output": "{'A': [85], 'B': [60], 'C': [45, 45, 45]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63935_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026039", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'apple.banana.grapefruit.orange'", "output": "'grapefruit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "996", "output": "{1, 2, 3, 996, 4, 6, 166, 332, 12, 498, 83, 249}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt995", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026041", "code": "def fib_optimized(n, memo={}):\n    \"\"\"Optimized Fibonacci implementation using memoization.\"\"\"\n    if n in memo:\n        return memo[n]\n    if n <= 0:\n        return 0\n    if n == 1:\n        return 1\n    memo[n] = fib_optimized(n-1, memo) + fib_optimized(n-2, memo)\n    return memo[n]\n", "entry_point": "fib_optimized", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100034_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026042", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "5, 21", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026043", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'tthishs'", "output": "['tthishs']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026044", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3658", "output": "{1, 2, 1829, 3658, 118, 59, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3657", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026045", "code": "def generate_code(input_string):\n    result = \"\"\n    position = 1\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper()\n            result += str(position)\n            position += 1\n    return result\n", "entry_point": "generate_code", "input": "'ldhello'", "output": "'L1D2H3E4L5L6O7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4318_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026046", "code": "def find_lowest(lst):\n    lowest_positive = None\n    for num in lst:\n        if num > 0:\n            if lowest_positive is None or num < lowest_positive:\n                lowest_positive = num\n    return lowest_positive\n", "entry_point": "find_lowest", "input": "[-1, 0, 4, 5]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112303_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026047", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'X/C01/c0'", "output": "('X', 'C01', 'c0')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026048", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_repeated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_repeated_scores:\n        return max(non_repeated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_repeated_score", "input": "[88, 85, 93, 88]", "output": "93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144053_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026049", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[4, 6, 2, 5, 7, 2, 6]", "output": "[4, 6, 2, 2, 6, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026050", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[9, 6, 7, 6, 9, 9, 9]", "output": "[6, 6, 7, 9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026051", "code": "def calculate_average(num1, num2, num3):\n    total_sum = num1 + num2 + num3\n    average = total_sum / 3\n    return average\n", "entry_point": "calculate_average", "input": "23, 23, 23", "output": "23.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_179_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026052", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'1500:150:0'", "output": "5409000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026053", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[10, 8, 2]", "output": "160", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026054", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[1, 2, 0, 0, 2]", "output": "[3, 2, 0, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026055", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3385", "output": "{1, 677, 5, 3385}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026056", "code": "def remove_trailing_zeros(digits):\n    while digits and digits[-1] == 0:\n        digits.pop()\n    if not digits:\n        digits.append(0)\n    return digits\n", "entry_point": "remove_trailing_zeros", "input": "[0, 3, 5, 3, 2, 3, 2, 0, 0]", "output": "[0, 3, 5, 3, 2, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90678_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026057", "code": "def tweet_simulator(tweet):\n    if len(tweet) > 140:\n        return \"Tweet too long!\"\n    else:\n        return f\"Tweet posted successfully: {tweet}\"\n", "entry_point": "tweet_simulator", "input": "'sitsshors'", "output": "'Tweet posted successfully: sitsshors'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66698_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026058", "code": "from pathlib import Path\n# In case of apocalypse - use any of `api_mirrors`\nAPI_BASE = 'https://2ch.hk'\nhostname_mirrors = (\n    '2ch.hk',\n    '2ch.pm',\n    '2ch.re',\n    '2ch.tf',\n    '2ch.wf',\n    '2ch.yt',\n    '2-ch.so',\n)\napi_mirrors = tuple(f'https://{hostname}' for hostname in hostname_mirrors)\ndef find_mirror_url(url):\n    for mirror_url in api_mirrors:\n        if url == mirror_url:\n            return mirror_url\n    return \"Mirror not found\"\n", "entry_point": "find_mirror_url", "input": "'https://2ch.re'", "output": "'https://2ch.re'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105611_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026059", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'config.addresspp'", "output": "'addresspp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026060", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 10)\n        elif num % 2 != 0:\n            processed_list.append(num - 5)\n        if num % 5 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[5, 5, 8, 6, 4, 5, 4, 4]", "output": "[0, 0, 18, 16, 14, 0, 14, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135947_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026061", "code": "def longest_palindromic_substring(s):\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    max_palindrome = \"\"\n    for i in range(len(s)):\n        # Odd-length palindrome\n        palindrome1 = expand_around_center(s, i, i)\n        # Even-length palindrome\n        palindrome2 = expand_around_center(s, i, i + 1)\n        if len(palindrome1) > len(max_palindrome):\n            max_palindrome = palindrome1\n        if len(palindrome2) > len(max_palindrome):\n            max_palindrome = palindrome2\n    return max_palindrome\n", "entry_point": "longest_palindromic_substring", "input": "'xaaabbaay'", "output": "'aabbaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137320_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026062", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6306", "output": "{1, 6306, 2, 3, 6, 3153, 2102, 1051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026063", "code": "def reverse_string(input_str):\n    reversed_str = \"\"\n    for char in input_str[::-1]:\n        reversed_str += char\n    return reversed_str\n", "entry_point": "reverse_string", "input": "'programming'", "output": "'gnimmargorp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138749_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6667", "output": "{1, 6667, 59, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9095", "output": "{1, 5, 9095, 107, 17, 85, 535, 1819}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026066", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "5", "output": "[5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026067", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5849", "output": "{1, 5849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026068", "code": "def generate_down_revision(revision):\n    down_revision = revision[::-1].lower()\n    return down_revision\n", "entry_point": "generate_down_revision", "input": "'898'", "output": "'898'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7052_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026069", "code": "def remove_negated_atoms(input_program):\n    rules = input_program.strip().split('\\n')\n    output_program = []\n    for rule in rules:\n        if ':-' in rule and any(literal.startswith('-') for literal in rule.split(':-', 1)[1].split(',')):\n            continue\n        output_program.append(rule)\n    return '\\n'.join(output_program)\n", "entry_point": "remove_negated_atoms", "input": "':-|-'", "output": "':-|-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89987_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7409", "output": "{1, 239, 7409, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026071", "code": "def calculate_new_time(start, duration):\n    start_hours = (start.split()[0]).split(':')[0]\n    start_mins = (start.split()[0]).split(':')[1]\n    AM_PM = start.split()[1]\n    duration_hours = duration.split(':')[0]\n    duration_mins = duration.split(':')[1]\n    mins_24h = int(start_mins) + int(duration_mins)\n    hours_24h = int(start_hours) + (12 * (1 if AM_PM == 'PM' else 0)) + (mins_24h // 60) + int(duration_hours)\n    mins_24h = mins_24h % 60\n    days_24h = hours_24h // 24\n    hours_24h = hours_24h % 24\n    AM_PM_12h = \"PM\" if hours_24h >= 12 else \"AM\"\n    hours_12h = (hours_24h - 12) if AM_PM_12h == \"PM\" else hours_24h\n    if hours_12h == 0:\n        hours_12h += 12\n    mins_12h = mins_24h\n    new_time = str(hours_12h) + \":\" + str(mins_12h).rjust(2, \"0\") + \" \" + AM_PM_12h\n    return new_time\n", "entry_point": "calculate_new_time", "input": "'3:50 PM', '00:20'", "output": "'4:10 PM'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125139_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026072", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[175, 175, 176, 178, 176]", "output": "176", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026073", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[82, 83, 84, 85]", "output": "83.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53561_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026074", "code": "import re\nfrom collections import Counter\ndef most_common_word(strings):\n    word_freq = Counter()\n    for string in strings:\n        words = re.findall(r'\\b\\w+\\b', string.lower())\n        word_freq.update(words)\n    max_freq = max(word_freq.values())\n    most_common_words = [word for word, freq in word_freq.items() if freq == max_freq]\n    return min(most_common_words)\n", "entry_point": "most_common_word", "input": "['bealdb is great', 'bealdb, bealdb.', 'another word', 'word']", "output": "'bealdb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29664_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026075", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6511", "output": "{1, 383, 17, 6511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026076", "code": "def paginate(data, paginate_by, page):\n    total_elements = len(data)\n    total_pages = (total_elements + paginate_by - 1) // paginate_by\n    try:\n        page_number = int(page)\n    except ValueError:\n        page_number = 1\n    if page_number < 1:\n        page_number = 1\n    elif page_number > total_pages:\n        page_number = total_pages\n    start_index = (page_number - 1) * paginate_by\n    end_index = min(start_index + paginate_by, total_elements)\n    return data[start_index:end_index]\n", "entry_point": "paginate", "input": "[1, 1], 2, 1", "output": "[1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87256_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "854", "output": "{1, 2, 7, 427, 14, 854, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026078", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<EM<AAIL<'", "output": "'<EM<AAIL<'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026079", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1832", "output": "{1, 2, 4, 229, 1832, 8, 458, 916}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1831", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026080", "code": "def score_answers(nq_gold_dict, nq_pred_dict):\n    long_answer_stats = {}\n    short_answer_stats = {}\n    for question_id, gold_answers in nq_gold_dict.items():\n        pred_answers = nq_pred_dict.get(question_id, [])\n        # Scoring mechanism for long answers (example scoring logic)\n        long_score = 0\n        for gold_answer in gold_answers:\n            if gold_answer in pred_answers:\n                long_score += 1\n        # Scoring mechanism for short answers (example scoring logic)\n        short_score = min(len(gold_answers), len(pred_answers))\n        long_answer_stats[question_id] = long_score\n        short_answer_stats[question_id] = short_score\n    return long_answer_stats, short_answer_stats\n", "entry_point": "score_answers", "input": "{0: []}, {0: []}", "output": "({0: 0}, {0: 0})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78415_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026081", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8155", "output": "{1, 35, 5, 7, 233, 1165, 8155, 1631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026082", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum_result = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum_result)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 5, 4, 4, 4, 5, 5, 5]", "output": "[5, 9, 8, 8, 9, 10, 10, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60286_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026083", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4079", "output": "{1, 4079}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4078", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026084", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'wr'", "output": "('wr', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026085", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7541", "output": "{1, 7541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026086", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=cte'", "output": "{'name': 'cte'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026087", "code": "import typing\ndef circular_sum(input_list: typing.List[int]) -> typing.List[int]:\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 5, -2, 4, 2, 8]", "output": "[5, 3, 2, 6, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4417_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026088", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "1, 950", "output": "950", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026089", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('a')[0])  # Remove any additional alpha characters\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'0.2.400'", "output": "(0, 2, 400)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101817_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026090", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[-2, 3, 5, 5, 5, 7]", "output": "[-2, 1, 6, 11, 16, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026091", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6001", "output": "{1, 6001, 17, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "127", "output": "{1, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026093", "code": "def get_type_from_uri_status(uri, status_code):\n    URI = \"/rest/testuri\"\n    TYPE_V200 = \"typeV200\"\n    TYPE_V300 = \"typeV300\"\n    DEFAULT_VALUES = {\n        \"200\": {\"type\": TYPE_V200},\n        \"300\": {\"type\": TYPE_V300}\n    }\n    if status_code in DEFAULT_VALUES and uri == URI:\n        return DEFAULT_VALUES[status_code][\"type\"]\n    else:\n        return \"Unknown\"\n", "entry_point": "get_type_from_uri_status", "input": "'/rest/testuri', '300'", "output": "'typeV300'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6113_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026094", "code": "def process_info(input_string):\n    char_count = {}\n    for char in input_string:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    return char_count\n", "entry_point": "process_info", "input": "'world'", "output": "{'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28397_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026095", "code": "def extract_bucket_details(bucket_config):\n    bucket_name = bucket_config.get(\"name\")\n    location = bucket_config.get(\"location\")\n    logging_info = bucket_config.get(\"logging\", {})\n    log_bucket = logging_info.get(\"logBucket\")\n    log_prefix = logging_info.get(\"logObjectPrefix\")\n    return bucket_name, location, log_bucket, log_prefix\n", "entry_point": "extract_bucket_details", "input": "{}", "output": "(None, None, None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42233_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026096", "code": "def apply_migrations(migrations):\n    schema = {}\n    for model_name, field_name, _ in migrations:\n        if model_name not in schema:\n            schema[model_name] = []\n        schema[model_name].append(field_name)\n    return schema\n", "entry_point": "apply_migrations", "input": "[('employee', 'title', None)]", "output": "{'employee': ['title']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12982_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026097", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'UURRUU'", "output": "(2, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026098", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, -10.0, -8.799999999999997", "output": "-18.799999999999997", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026099", "code": "def calculate_file_sizes(files):\n    file_sizes = {}\n    for file, size in files:\n        file_extension = file.split('.')[-1]\n        if file_extension in file_sizes:\n            file_sizes[file_extension] += size\n        else:\n            file_sizes[file_extension] = size\n    return file_sizes\n", "entry_point": "calculate_file_sizes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11385_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026100", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4555", "output": "{1, 4555, 5, 911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4554", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026101", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "662", "output": "{1, 2, 331, 662}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "876", "output": "{1, 2, 3, 292, 4, 6, 73, 876, 12, 146, 438, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt875", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026103", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'0100022'", "output": "'0100022'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026104", "code": "def modify_cols(variable_and_features, variables_checked, cols):\n    modified_cols = []\n    for col in cols:\n        if col in variable_and_features and col in variables_checked:\n            modified_cols.append(col)\n    return modified_cols\n", "entry_point": "modify_cols", "input": "{'a', 'b'}, {'c', 'd'}, ['e', 'f']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76871_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026105", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'ip', 2", "output": "'ip'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026106", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 6, 0, 6, 0, 6, 4]", "output": "[7, 10, 6, 6, 6, 6, 10, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92643_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "486", "output": "{1, 2, 3, 162, 486, 6, 9, 81, 18, 243, 54, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt485", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4227", "output": "{3, 1, 1409, 4227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4226", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026109", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(3, 2, 12)", "output": "'3.2.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026110", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[6, 1], [0, 0]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5519_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026111", "code": "def format_output(version: str, default_app_config: str) -> str:\n    version = version if version else '0.0'\n    default_app_config = default_app_config if default_app_config else 'default_config'\n    return f'[{version}] {default_app_config}'\n", "entry_point": "format_output", "input": "None, None", "output": "'[0.0] default_config'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63589_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026112", "code": "def process_list(input_list):\n    # Remove negative numbers\n    input_list = [num for num in input_list if num >= 0]\n    # Remove duplicates\n    input_list = list(set(input_list))\n    # Sort the list in ascending order\n    input_list.sort()\n    return input_list\n", "entry_point": "process_list", "input": "[4, 4, 5, 6, -1, -2]", "output": "[4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27685_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7012", "output": "{1, 2, 7012, 4, 3506, 1753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7011", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026114", "code": "def accum(s):\n    modified_chars = []\n    for i, char in enumerate(s):\n        modified_chars.append((char.upper() + char.lower() * i))\n    return '-'.join(modified_chars)\n", "entry_point": "accum", "input": "'MJTKUBOU'", "output": "'M-Jj-Ttt-Kkkk-Uuuuu-Bbbbbb-Ooooooo-Uuuuuuuu'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97323_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026115", "code": "def find_unique_elements(input_list):\n    unique_elements = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[3, 2, 1, 5, 3, 5, 1, 2]", "output": "[3, 2, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23079_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026116", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[6, 10, 10, 10, 10]", "output": "[6, 10, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026117", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3223", "output": "{1, 11, 293, 3223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4166", "output": "{1, 2, 2083, 4166}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4165", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026119", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[2, 3, 5, 1, 2, 7, 10, 2, 7]", "output": "[1, 2, 2, 2, 3, 5, 7, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026120", "code": "import re\nimport subprocess\ndef generate_file_name(anime_name, episode_number, resolution):\n    anime_name = str(anime_name).replace(\"039T\", \"'\")\n    anime_name = re.sub(r'[^A-Za-z0-9\\ \\-\\' \\\\]+', '', str(anime_name)).title().strip().replace(\"Season \", \"S\")\n    episode_number = str(episode_number).zfill(2)\n    file_name = f\"{anime_name} - {episode_number} [{resolution}].mp4\"\n    try:\n        max_path = int(subprocess.check_output(['getconf', 'PATH_MAX', '/']))\n    except Exception:\n        max_path = 4096\n    if len(file_name) > max_path:\n        file_name = file_name[:max_path]\n    return file_name\n", "entry_point": "generate_file_name", "input": "'acahacademia', 8, '100010p'", "output": "'Acahacademia - 08 [100010p].mp4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52255_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026121", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "3, 3", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "849", "output": "{849, 1, 3, 283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026123", "code": "from typing import List, Dict, Union\ndef sort_analysis_options(analysis_options: List[Dict[str, Union[int, str]]]) -> List[Dict[str, Union[int, str]]]:\n    analysis_options.sort(key=lambda item: (item.get('priority', 100), item.get('text', '')))\n    return analysis_options\n", "entry_point": "sort_analysis_options", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56941_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026124", "code": "def process_data(input_list):\n    unique_list = list(set(input_list))  # Remove duplicates\n    sorted_list = sorted(unique_list)   # Sort in ascending order\n    total_sum = sum(sorted_list)         # Calculate sum\n    return (sorted_list, total_sum)\n", "entry_point": "process_data", "input": "[1, 1, 2, 2, 4, 5]", "output": "([1, 2, 4, 5], 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118042_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026125", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'music_bg'", "output": "'Music Bg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026126", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'Wangen b. D.'", "output": "'Wangen'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026127", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[2, 2, 5, 1, 2, 0, 5]", "output": "[2, 5, 1, 2, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026128", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2667", "output": "{1, 3, 7, 2667, 21, 889, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026129", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 47", "output": "'47%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026130", "code": "def min_edit_distance(source, target):\n    slen, tlen = len(source), len(target)\n    dist = [[0 for _ in range(tlen+1)] for _ in range(slen+1)]\n    for i in range(slen+1):\n        dist[i][0] = i\n    for j in range(tlen+1):\n        dist[0][j] = j\n    for i in range(slen):\n        for j in range(tlen):\n            cost = 0 if source[i] == target[j] else 1\n            dist[i+1][j+1] = min(\n                dist[i][j+1] + 1,   # deletion\n                dist[i+1][j] + 1,   # insertion\n                dist[i][j] + cost   # substitution\n            )\n    return dist[-1][-1]\n", "entry_point": "min_edit_distance", "input": "'abcdefghij', 'klmnopqrst'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126361_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026131", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[1, 1, 3, 2, 4, -1, 5, 5, -1]", "output": "[1, 2, 5, 5, 8, 4, 11, 12, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026132", "code": "def create_version_string(major, minor, patch):\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "create_version_string", "input": "6, -5, 0", "output": "'6.-5.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12045_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026133", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[2, 2, 4, 1, 3]", "output": "[2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "381", "output": "{1, 3, 381, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026135", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'pnyjapyp'", "output": "'Binary path for pnyjapyp not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026136", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[5, 5, 5, 7, 4, 7, 5, 5], 5", "output": "[[5, 5, 5, 7, 4], [7, 5, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026137", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "2, 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026138", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[5, 1, 9, 3, 8]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026139", "code": "def calculate_dot_product(A, B):\n    if len(A) != len(B):\n        raise ValueError(\"Arrays must be of the same length\")\n    dot_product = sum(a * b for a, b in zip(A, B))\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[2, 6], [5, 4]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105699_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026140", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[2, 0, 4, 0, 2, 0, 4]", "output": "'aabbbbccdddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026141", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[85, 75, 65, 65, 75, 65, 45, 65]", "output": "['B', 'C', 'D', 'D', 'C', 'D', 'E', 'D']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026142", "code": "from typing import Dict\nfields = {\n    'id': 'StringField',\n    'event_subject': 'StringField',\n    'event_object': 'StringField',\n    'created_at': 'DateTimeField',\n    'user_name': 'StringField',\n    'project_name': 'StringField',\n    'visit_ip': 'StringField',\n    'result': 'StringField',\n    'message': 'StringField',\n}\ndef find_fields_by_datatype(fields: Dict[str, str], target_type: str) -> list:\n    result_fields = []\n    for field_name, data_type in fields.items():\n        if data_type == target_type:\n            result_fields.append(field_name)\n    return result_fields\n", "entry_point": "find_fields_by_datatype", "input": "fields, 'IntegerField'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147319_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6862", "output": "{1, 2, 3431, 73, 6862, 47, 146, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6861", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9134", "output": "{1, 2, 9134, 4567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9133", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026145", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'.exceeds', '1.2.012'", "output": "'1.2.012.exceeds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026146", "code": "from typing import List, Dict\ndef count_model_name_characters(model_names: List[str]) -> Dict[str, int]:\n    model_name_lengths = {}\n    for name in model_names:\n        stripped_name = name.strip()\n        model_name_lengths[stripped_name] = len(stripped_name)\n    return model_name_lengths\n", "entry_point": "count_model_name_characters", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142970_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026147", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "101.0, 11, 6", "output": "(105.3834, 11.11, 6.7265999999999995)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026148", "code": "def lcm(numbers):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    def lcm_two_numbers(x, y):\n        return x * y // gcd(x, y)\n    result = 1\n    for num in numbers:\n        result = lcm_two_numbers(result, num)\n    return result\n", "entry_point": "lcm", "input": "[8, 9, 7, 13]", "output": "6552", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84681_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026149", "code": "def reverse_words_order_and_swap_cases(sentence):\n    words = sentence.split()\n    reversed_words = [word.swapcase()[::-1] for word in words]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_words_order_and_swap_cases", "input": "'Hello'", "output": "'OLLEh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6578_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026150", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[2, 1, 2, 3, 3, 3]", "output": "[7, 6, 7, 8, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026151", "code": "def calculate_score(result):\n    if result == \"win\":\n        return 3\n    elif result == \"loss\":\n        return -1\n    elif result == \"draw\":\n        return 0\n    else:\n        return \"Invalid result\"\n", "entry_point": "calculate_score", "input": "'loss'", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88276_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026152", "code": "def sum_with_next(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return [2 * lst[0]]  # Double the single element\n    result = [lst[i] + lst[(i + 1) % len(lst)] for i in range(len(lst))]\n    return result\n", "entry_point": "sum_with_next", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77175_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026153", "code": "def count_paths(tree, key, value):\n    def find_path(tree, key, value, path=()):\n        items = tree.get(\"children\", []) if isinstance(tree, dict) else tree\n        for item in items:\n            if item[key] == value:\n                yield (*path, item)\n            else:\n                yield from find_path(item, key, value, (*path, item))\n    paths = find_path(tree, key, value)\n    return sum(1 for _ in paths)\n", "entry_point": "count_paths", "input": "{}, 'some_key', 'some_value'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101318_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026154", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "625", "output": "{1, 5, 625, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt624", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026155", "code": "# Sample data for demonstration\nLOCALEDIR = '/path/to/locales'\nlangcodes = ['en', 'fr', 'de', 'es', 'it']\ntranslates = {'en': 'English', 'fr': 'French', 'de': 'German', 'es': 'Spanish', 'it': 'Italian'}\ndef get_language_name(language_code):\n    return translates.get(language_code, \"Language not found\")\n", "entry_point": "get_language_name", "input": "'de'", "output": "'German'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94235_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3013", "output": "{1, 131, 3013, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026157", "code": "def get_logging_category_name(category: int) -> str:\n    logging_categories = {\n        2: \"SDL_LOG_CATEGORY_ASSERT\",\n        3: \"SDL_LOG_CATEGORY_SYSTEM\",\n        4: \"SDL_LOG_CATEGORY_AUDIO\",\n        5: \"SDL_LOG_CATEGORY_VIDEO\",\n        6: \"SDL_LOG_CATEGORY_RENDER\",\n        7: \"SDL_LOG_CATEGORY_INPUT\",\n        8: \"SDL_LOG_CATEGORY_TEST\",\n        9: \"SDL_LOG_CATEGORY_RESERVED1\",\n        10: \"SDL_LOG_CATEGORY_RESERVED2\",\n        11: \"SDL_LOG_CATEGORY_RESERVED3\",\n        12: \"SDL_LOG_CATEGORY_RESERVED4\",\n        13: \"SDL_LOG_CATEGORY_RESERVED5\",\n        14: \"SDL_LOG_CATEGORY_RESERVED6\",\n        15: \"SDL_LOG_CATEGORY_RESERVED7\",\n        16: \"SDL_LOG_CATEGORY_RESERVED8\"\n    }\n    return logging_categories.get(category, \"Unknown Category\")\n", "entry_point": "get_logging_category_name", "input": "10", "output": "'SDL_LOG_CATEGORY_RESERVED2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137176_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026158", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026159", "code": "def calculate_overlaps(overlap_map: dict[tuple[float, float], int], minimal_overlap: int) -> int:\n    def overlap_map_to_overlaps(overlap_map: dict[tuple[float, float], int], minimal_overlap=2) -> int:\n        return len(list(filter(lambda val: val >= minimal_overlap, overlap_map.values())))\n    return overlap_map_to_overlaps(overlap_map, minimal_overlap)\n", "entry_point": "calculate_overlaps", "input": "{}, 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8510_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026160", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[2, 3, 4, 5, 6, 7, 8]", "output": "(2, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2877", "output": "{1, 3, 7, 137, 21, 411, 2877, 959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026162", "code": "import binascii\nfrom typing import Union\ndef scrub_input(hex_str_or_bytes: Union[str, bytes]) -> bytes:\n    if isinstance(hex_str_or_bytes, str):\n        hex_str_or_bytes = binascii.unhexlify(hex_str_or_bytes)\n    return hex_str_or_bytes\n", "entry_point": "scrub_input", "input": "'48656c486520576f726c64'", "output": "b'HelHe World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49478_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026163", "code": "def transform_sql_query(sql_query):\n    modified_query = sql_query.replace(\"select\", \"SELECT\").replace(\"from\", \"FROM\").replace(\"where\", \"WHERE\")\n    return modified_query\n", "entry_point": "transform_sql_query", "input": "'selfselect'", "output": "'selfSELECT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96099_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026164", "code": "def extract_major_version(version):\n    first_dot_index = version.index('.')\n    major_version = int(version[:first_dot_index])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'133.0.0'", "output": "133", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40723_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026165", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[5, -1, -1, 1, -2, 0, 6, 4, 4]", "output": "{5: 1, -1: 2, 1: 1, -2: 1, 0: 1, 6: 1, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026166", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026167", "code": "def remove_keyword(original_str, keyword):\n    if original_str.endswith(keyword):\n        return original_str[:-len(keyword)]\n    else:\n        return original_str\n", "entry_point": "remove_keyword", "input": "',WHlo, Wordolol', 'ol'", "output": "',WHlo, Wordol'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65923_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026168", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1495", "output": "1455", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026169", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8231", "output": "{1, 8231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8230", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026170", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 84, 82, 70, 70, 74, 74, 75]", "output": "[92, 84, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8412_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026171", "code": "def prime_factors(n):\n    factors = {}\n    divisor = 2\n    while n > 1:\n        if n % divisor == 0:\n            if divisor not in factors:\n                factors[divisor] = 1\n            else:\n                factors[divisor] += 1\n            n //= divisor\n        else:\n            divisor += 1\n    print(f'Finished processing for {n}')\n    return factors\n", "entry_point": "prime_factors", "input": "91", "output": "{7: 1, 13: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95561_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4047", "output": "{1, 3, 1349, 71, 4047, 19, 213, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4046", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026173", "code": "def calculate_center_point(bbox):\n    y_top, x_left, y_bottom, x_right = bbox\n    center_y = y_top + (y_bottom - y_top) / 2\n    center_x = x_left + (x_right - x_left) / 2\n    height = y_bottom - y_top\n    width = x_right - x_left\n    return [center_y, center_x, height, width]\n", "entry_point": "calculate_center_point", "input": "(5.0, 5.0, 15.0, 25.0)", "output": "[10.0, 15.0, 10.0, 20.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148458_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026174", "code": "from typing import List, Tuple\ndef find_pairs(nums: List[int], target: int) -> List[Tuple[int, int]]:\n    seen = set()\n    pairs = []\n    for num in nums:\n        complement = target - num\n        if complement in seen:\n            pairs.append((num, complement))\n        seen.add(num)\n    return pairs\n", "entry_point": "find_pairs", "input": "[0, 6, 1, 2, 3], 6", "output": "[(6, 0)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97249_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026175", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[25, 27, 28, 27]", "output": "26.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5178", "output": "{1, 2, 3, 6, 5178, 2589, 1726, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026177", "code": "def max_subarray_sum(nums):\n    max_sum = nums[0]\n    current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[-5, -6, -7]", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55199_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026178", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', 4, -7", "output": "(5, -7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026179", "code": "def load_params(parameters):\n    param_dict = {}\n    for param in parameters:\n        if '=' in param:\n            key, value = param.split('=')\n            param_dict[key] = value\n        else:\n            param_dict[param] = None\n    return param_dict\n", "entry_point": "load_params", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22405_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026180", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2122", "output": "{1, 2122, 2, 1061}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2121", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026181", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'worli'", "output": "{'worli': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64619_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026182", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[4, 5, 5], 3", "output": "4.666666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026183", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6641", "output": "{1, 29, 6641, 229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6640", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1741", "output": "{1, 1741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026185", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[1, 1, 2, 2, 3, 3, 0, -1, 5]", "output": "[0, -1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7033", "output": "{1, 541, 7033, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026187", "code": "import math\ndef normalized_entropy(probabilities):\n    entropy = -sum(p * math.log(p) for p in probabilities if p != 0)\n    total_events = len(probabilities)\n    normalized_entropy = entropy / math.log(total_events)\n    return normalized_entropy\n", "entry_point": "normalized_entropy", "input": "[0.1, 0.2, 0.3, 0.4]", "output": "0.9232196723355078", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24832_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4173", "output": "{1, 321, 3, 39, 107, 13, 4173, 1391}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4172", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026189", "code": "def longest_palindromic_substring(s):\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    max_palindrome = \"\"\n    for i in range(len(s)):\n        # Odd-length palindrome\n        palindrome1 = expand_around_center(s, i, i)\n        # Even-length palindrome\n        palindrome2 = expand_around_center(s, i, i + 1)\n        if len(palindrome1) > len(max_palindrome):\n            max_palindrome = palindrome1\n        if len(palindrome2) > len(max_palindrome):\n            max_palindrome = palindrome2\n    return max_palindrome\n", "entry_point": "longest_palindromic_substring", "input": "'bbaaaaaacc'", "output": "'aaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137320_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3614", "output": "{1, 2, 139, 13, 1807, 278, 26, 3614}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8153", "output": "{1, 8153, 263, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8152", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026192", "code": "def process_circular_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[6, -2, 7, -3, 3, 0, 1, 3]", "output": "[4, 5, 4, 0, 3, 1, 4, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76400_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026193", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[0, 0, 3, 6, 7, 7]", "output": "[0, 0, 9, 12, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026194", "code": "def calculate_total_volume(Ly, qF, nStretch):\n    # Calculate the volume of the rectangular prism\n    volume = Ly * Ly * (nStretch * Ly)\n    # Calculate the filled volume based on the fill factor\n    filled_volume = volume * qF\n    # Calculate the total volume of the 3D object\n    total_volume = filled_volume * nStretch\n    return total_volume\n", "entry_point": "calculate_total_volume", "input": "4, 1, 3", "output": "576", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90349_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8233", "output": "{1, 8233}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026196", "code": "from typing import List\ndef find_first_zero(arr: List[int]) -> int:\n    index = 0\n    for num in arr:\n        if num == 0:\n            return index\n        index += 1\n    return -1\n", "entry_point": "find_first_zero", "input": "[1, 2, 3, 4, 0]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79416_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026197", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "98, 2", "output": "4753", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt4501", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026198", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'Ppetpaliceppap', 'Ddojaaenej', 'Thhs'", "output": "'Ppetpaliceppap Ddojaaenej Thhs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026199", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "268", "output": "{1, 2, 67, 4, 134, 268}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt267", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026200", "code": "from typing import List, Dict\ndef process_gc_events(gc_events: List[str]) -> Dict[str, int]:\n    gcThrottledEventsInfo = {}\n    start_index = None\n    throttled_count = 0\n    for i, event in enumerate(gc_events):\n        if event == \"start\":\n            start_index = i\n            throttled_count = 0\n        elif event == \"end\":\n            if start_index is not None:\n                gcThrottledEventsInfo[f\"{start_index}-{i}\"] = throttled_count\n                start_index = None\n        elif event == \"throttled\" and start_index is not None:\n            throttled_count += 1\n    return gcThrottledEventsInfo\n", "entry_point": "process_gc_events", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91889_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026201", "code": "def timecode_to_frames(tc, framerate):\n    components = tc.split(':')\n    hours = int(components[0])\n    minutes = int(components[1])\n    seconds = int(components[2])\n    frames = int(components[3])\n    total_frames = frames + seconds * framerate + minutes * framerate * 60 + hours * framerate * 60 * 60\n    return total_frames\n", "entry_point": "timecode_to_frames", "input": "'01:03:39:15', 30", "output": "114585", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42773_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026202", "code": "def max_values_in_groups(input_list):\n    if not input_list:\n        return []\n    max_values = []\n    current_max = input_list[0]\n    current_group = input_list[0]\n    for num in input_list[1:]:\n        if num != current_group:\n            max_values.append(current_max)\n            current_max = num\n            current_group = num\n        else:\n            current_max = max(current_max, num)\n    max_values.append(current_max)\n    return max_values\n", "entry_point": "max_values_in_groups", "input": "[1, 1, 3, 3, 1, 2, 7, 3]", "output": "[1, 3, 1, 2, 7, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12158_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026203", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-5, 6, -7, 8]", "output": "[5, -6, 7, -8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026204", "code": "def convert_time(time_s):\n    time_s = int(time_s)  # Ensure int\n    out = []\n    days = time_s // 86400\n    if days == 1:\n        out.append(\"%i day\" % days)\n        time_s -= days * 86400\n    elif days >= 1:\n        out.append(\"%i days\" % days)\n        time_s -= days * 86400\n    hours = time_s // 3600\n    if hours >= 1:\n        out.append(\"%i hr\" % hours)\n        time_s -= hours * 3600\n    minutes = time_s // 60\n    if minutes >= 1:\n        out.append(\"%i min\" % minutes)\n        time_s -= minutes * 60\n    if time_s > 0:\n        out.append(\"%i sec\" % time_s)\n    return ' '.join(out)\n", "entry_point": "convert_time", "input": "3665", "output": "'1 hr 1 min 5 sec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134361_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026205", "code": "def calculate_available_ips(start_ip, end_ip):\n    def ip_to_int(ip):\n        parts = ip.split('.')\n        return int(parts[0]) * 256**3 + int(parts[1]) * 256**2 + int(parts[2]) * 256 + int(parts[3])\n    start_int = ip_to_int(start_ip)\n    end_int = ip_to_int(end_ip)\n    total_ips = end_int - start_int + 1\n    available_ips = total_ips - 2  # Exclude network and broadcast addresses\n    return available_ips\n", "entry_point": "calculate_available_ips", "input": "'192.168.1.0', '192.168.1.254'", "output": "253", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16242_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026206", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[2, 3, 4, 2, 5, 4, 4, 3]", "output": "[4, 27, 16, 4, 125, 16, 16, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026207", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3110", "output": "{1, 2, 5, 3110, 10, 622, 1555, 311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3109", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026208", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3453", "output": "{1, 3, 3453, 1151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026209", "code": "def largest_rectangle_area(height):\n    stack = []\n    max_area = 0\n    height.append(0)  # Append a zero height bar to handle the case when all bars are in increasing order\n    for i in range(len(height)):\n        while stack and height[i] < height[stack[-1]]:\n            h = height[stack.pop()]\n            w = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, h * w)\n        stack.append(i)\n    return max_area\n", "entry_point": "largest_rectangle_area", "input": "[8, 8, 8, 8, 5]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95511_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026210", "code": "def extract_module_names(imports):\n    module_names = set()\n    for imp in imports:\n        parts = imp.split()\n        if parts[0] == 'import':\n            module_names.add(parts[-1])\n        elif parts[0] == 'from':\n            if 'import' in parts:\n                idx = parts.index('import')\n                module_names.add(parts[idx + 1])\n            else:\n                idx = parts.index('as')\n                module_names.add(parts[idx + 1])\n    return sorted(list(module_names))\n", "entry_point": "extract_module_names", "input": "['import os', 'import sys', 'import math']", "output": "['math', 'os', 'sys']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68005_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026211", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5816", "output": "{1, 2, 4, 8, 1454, 727, 5816, 2908}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5815", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026212", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5630", "output": "{1, 2, 5, 1126, 10, 563, 5630, 2815}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5629", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026213", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "3, 4", "output": "37.69911184307752", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026214", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7048", "output": "{1, 2, 1762, 3524, 4, 7048, 8, 881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7047", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026215", "code": "def extract_app_name(default_app_config):\n    components = default_app_config.split('.')\n    app_name = components[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'ooso.something'", "output": "'ooso'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104283_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026216", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9172", "output": "{1, 2, 4, 4586, 9172, 2293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9171", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4778", "output": "{1, 4778, 2, 2389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026218", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = list(set(scores))  # Remove duplicates\n    unique_scores.sort(reverse=True)   # Sort in descending order\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 91, 78, 70, 75, 60]", "output": "[92, 91, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146699_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026219", "code": "from collections import deque\ndef min_minutes_to_rot_all_oranges(grid):\n    if not grid or len(grid) == 0:\n        return 0\n    n = len(grid)\n    m = len(grid[0])\n    rotten = deque()\n    fresh_count = 0\n    minutes = 0\n    for i in range(n):\n        for j in range(m):\n            if grid[i][j] == 2:\n                rotten.append((i, j))\n            elif grid[i][j] == 1:\n                fresh_count += 1\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n    while rotten:\n        if fresh_count == 0:\n            return minutes\n        size = len(rotten)\n        for _ in range(size):\n            x, y = rotten.popleft()\n            for dx, dy in directions:\n                nx, ny = x + dx, y + dy\n                if 0 <= nx < n and 0 <= ny < m and grid[nx][ny] == 1:\n                    grid[nx][ny] = 2\n                    fresh_count -= 1\n                    rotten.append((nx, ny))\n        minutes += 1\n    return -1\n", "entry_point": "min_minutes_to_rot_all_oranges", "input": "[[2, 1, 0, 0], [1, 1, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1036_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026220", "code": "def posix_quote_filter(input_string):\n    # Escape single quotes by doubling them\n    escaped_string = input_string.replace(\"'\", \"''\")\n    # Enclose the modified string in single quotes\n    return f\"'{escaped_string}'\"\n", "entry_point": "posix_quote_filter", "input": "'panpic!'", "output": "\"'panpic!'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125649_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026221", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[29, 31]", "output": "'30%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026222", "code": "def simulate_card_game(deck, threshold):\n    def helper(index, current_score):\n        if current_score > threshold:\n            return 0\n        if index >= len(deck):\n            return current_score\n        score_with_card = helper(index + 1, current_score + deck[index])\n        score_without_card = helper(index + 1, current_score)\n        return max(score_with_card, score_without_card)\n    return helper(0, 0)\n", "entry_point": "simulate_card_game", "input": "[5, 7, 1], 12", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75849_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026223", "code": "import re\ndef extract_column_additions(column_additions):\n    table_columns = {}\n    for column_addition in column_additions:\n        table_name = re.search(r\"'(.*?)'\", column_addition).group(1)\n        column_name = re.search(r\"sa.Column\\('(.*?)'\", column_addition).group(1)\n        if table_name in table_columns:\n            table_columns[table_name].append(column_name)\n        else:\n            table_columns[table_name] = [column_name]\n    return table_columns\n", "entry_point": "extract_column_additions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8964_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "54", "output": "{1, 2, 3, 6, 9, 18, 54, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt53", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026225", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average_score)\n", "entry_point": "calculate_average", "input": "[90, 94, 95, 96, 100]", "output": "95", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143747_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026226", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['doge10', 'doge20', 'doge30', 'doge20']", "output": "80", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026227", "code": "def sort_projections(projection_ids, weights):\n    projection_map = dict(zip(projection_ids, weights))\n    sorted_projections = sorted(projection_ids, key=lambda x: projection_map[x])\n    return sorted_projections\n", "entry_point": "sort_projections", "input": "[1, 3, 3, 3], [0, 1, 1, 1]", "output": "[1, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91067_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026228", "code": "from typing import List\ndef calculate_max_score(scores: List[int]) -> int:\n    if not scores:\n        return 0\n    n = len(scores)\n    if n == 1:\n        return scores[0]\n    dp = [0] * n\n    dp[0] = scores[0]\n    dp[1] = max(scores[0], scores[1])\n    for i in range(2, n):\n        dp[i] = max(scores[i] + dp[i - 2], dp[i - 1])\n    return dp[-1]\n", "entry_point": "calculate_max_score", "input": "[21]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64203_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026229", "code": "def evaluate_math_expression(expression: str) -> float:\n    def tokenize(expression):\n        tokens = []\n        num = ''\n        for char in expression:\n            if char.isdigit() or char == '.':\n                num += char\n            else:\n                if num:\n                    tokens.append(num)\n                    num = ''\n                if char.strip():\n                    tokens.append(char)\n        if num:\n            tokens.append(num)\n        return tokens\n    def infix_to_postfix(tokens):\n        precedence = {'+': 1, '-': 1, '*': 2, '/': 2}\n        postfix = []\n        stack = []\n        for token in tokens:\n            if token.isdigit() or '.' in token:\n                postfix.append(token)\n            elif token == '(':\n                stack.append(token)\n            elif token == ')':\n                while stack and stack[-1] != '(':\n                    postfix.append(stack.pop())\n                stack.pop()\n            else:\n                while stack and precedence.get(stack[-1], 0) >= precedence.get(token, 0):\n                    postfix.append(stack.pop())\n                stack.append(token)\n        while stack:\n            postfix.append(stack.pop())\n        return postfix\n    def evaluate_postfix(postfix):\n        stack = []\n        for token in postfix:\n            if token.isdigit() or '.' in token:\n                stack.append(float(token))\n            else:\n                operand2 = stack.pop()\n                operand1 = stack.pop()\n                if token == '+':\n                    stack.append(operand1 + operand2)\n                elif token == '-':\n                    stack.append(operand1 - operand2)\n                elif token == '*':\n                    stack.append(operand1 * operand2)\n                elif token == '/':\n                    stack.append(operand1 / operand2)\n        return stack[0]\n    tokens = tokenize(expression)\n    postfix_expression = infix_to_postfix(tokens)\n    result = evaluate_postfix(postfix_expression)\n    return result\n", "entry_point": "evaluate_math_expression", "input": "'30000 + 3333'", "output": "33333.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26567_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026230", "code": "def unicode_data_compressor(input_string: str) -> str:\n    compressed_output = \"\"\n    current_char = \"\"\n    char_count = 0\n    for char in input_string:\n        if char == current_char:\n            char_count += 1\n        else:\n            if char_count > 0:\n                compressed_output += current_char + str(char_count)\n            current_char = char\n            char_count = 1\n    if char_count > 0:\n        compressed_output += current_char + str(char_count)\n    return compressed_output\n", "entry_point": "unicode_data_compressor", "input": "'aaaab'", "output": "'a4b1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131864_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026231", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "987", "output": "{1, 3, 7, 329, 141, 47, 21, 987}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026232", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1463", "output": "{1, 133, 7, 11, 77, 209, 19, 1463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026233", "code": "def reverse_integer(x):\n    if x > 2**31 - 1 or x < -2**31:\n        return 0\n    is_negative = x < 0\n    x = abs(x)\n    reversed_x = int(str(x)[::-1])\n    if is_negative:\n        reversed_x *= -1\n    if reversed_x > 2**31 - 1 or reversed_x < -2**31:\n        return 0\n    return reversed_x\n", "entry_point": "reverse_integer", "input": "-126", "output": "-621", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143471_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026234", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_bytes = sum(file_sizes)\n    total_size_kb = total_size_bytes // 1024  # Convert bytes to kilobytes\n    return total_size_kb\n", "entry_point": "calculate_total_size", "input": "[10240, 1024]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73966_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026235", "code": "def convert_to_kelvin(celsius_temp):\n    absolute_zero_celsius = -273.15\n    if celsius_temp < absolute_zero_celsius:\n        raise ValueError(\"Temperature below absolute zero is not physically possible\")\n    return celsius_temp + 273.15\n", "entry_point": "convert_to_kelvin", "input": "27.0", "output": "300.15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118383_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026236", "code": "def co2(arr):\n    total_length = 0\n    for binary_str in arr:\n        total_length += len(binary_str)\n    return total_length\n", "entry_point": "co2", "input": "['0000', '1111', '0001']", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43201_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026237", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9645", "output": "{1, 3, 643, 5, 1929, 9645, 3215, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9644", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026238", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'ocErEroorE', -2, -2", "output": "'-2: ocErEroorE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026239", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "576.15", "output": "'R$:576,15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026240", "code": "def count_unique_country_codes(country_codes):\n    unique_country_codes = set()\n    for code in country_codes:\n        unique_country_codes.add(code)\n    return len(unique_country_codes)\n", "entry_point": "count_unique_country_codes", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116809_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026241", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'2.1.3', '2.3.1'", "output": "'2.1.3 to 2.3.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "78", "output": "{1, 2, 3, 6, 39, 13, 78, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt77", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026243", "code": "def match_url(url, patterns):\n    for path, view in patterns:\n        if url.startswith(path):\n            return view\n    return None\n", "entry_point": "match_url", "input": "'/about', [('/about', 'about_page')]", "output": "'about_page'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60273_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026244", "code": "def calculate_timebar_size(wSrcInch, hSrcInch, fig_dpi):\n    # Postulate size of the timebar in inches\n    wTrgInch = wSrcInch\n    hTrgInch = 0.3\n    # Find size of the timebar in pixels\n    wTrgPix = wTrgInch * fig_dpi\n    hTrgPix = hTrgInch * fig_dpi\n    # Find size of the timebar relative to the original image\n    wRel = wTrgInch / wSrcInch\n    hRel = hTrgInch / hSrcInch\n    return wRel, hRel\n", "entry_point": "calculate_timebar_size", "input": "0.3, 10.0, 100", "output": "(1.0, 0.03)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105081_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026245", "code": "def dump_data(data, format_name):\n    try:\n        if format_name == 'jas':\n            from .w_jas import jas_dump\n            return jas_dump(data)\n        elif format_name == 'markdown':\n            from .w_markdown import markdown_dump\n            return markdown_dump(data)\n        elif format_name == 'html':\n            from .w_html import html_dump\n            return html_dump(data)\n        else:\n            return 'Unsupported format'\n    except ImportError:\n        return 'Unsupported format'\n", "entry_point": "dump_data", "input": "data=None, format_name='xml'", "output": "'Unsupported format'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96904_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026246", "code": "def calculate_distances(S1, S2):\n    map = {}\n    initial = 0\n    distance = []\n    for i in range(26):\n        map[S1[i]] = i\n    for i in S2:\n        distance.append(abs(map[i] - initial))\n        initial = map[i]\n    return distance\n", "entry_point": "calculate_distances", "input": "'abcdefghijklmnopqrstuvwxyz', 'ddd'", "output": "[3, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35345_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026247", "code": "def reverse_pairing_bit_on_device_type(encoded_value: int) -> (bool, int):\n    pairing_bit = bool((encoded_value >> 7) & 1)\n    device_type = encoded_value & 127\n    return pairing_bit, device_type\n", "entry_point": "reverse_pairing_bit_on_device_type", "input": "133", "output": "(True, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58325_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5162", "output": "{1, 2, 5162, 178, 2581, 89, 58, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5161", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026249", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6586", "output": "{1, 2, 37, 74, 178, 89, 6586, 3293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026250", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'UDLR'", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026251", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[-1, 0, 1, 2, 6, 7, 7, 7]", "output": "[0, 2, 6, -1, 1, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026252", "code": "def parse_response(response):\n    key_value_pairs = response.split(',')\n    for pair in key_value_pairs:\n        key, value = pair.split('=')\n        if key.strip() == 'token':\n            return value.strip()\n    return None  # Return None if the key \"token\" is not found in the response\n", "entry_point": "parse_response", "input": "'key1=value1, token=unatok3, key2=value2'", "output": "'unatok3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108561_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026253", "code": "def count_positive_negative(numbers):\n    positive_count = 0\n    negative_count = 0\n    for num in numbers:\n        if num > 0:\n            positive_count += 1\n        elif num < 0:\n            negative_count += 1\n    return positive_count, negative_count\n", "entry_point": "count_positive_negative", "input": "[1, 2, 3]", "output": "(3, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97380_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026254", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'Fe-26'", "output": "'Fe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026255", "code": "def validate_temp_directories(container_name, ctx, stray_artifacts):\n    allowed_tmp_files = [\"hsperfdata_root\"]\n    def _run_cmd_on_container(container_name, ctx, command):\n        # Simulated function to run a command on the container and return the output\n        return \" \".join(allowed_tmp_files)  # Simulated output for demonstration\n    def _assert_artifact_free(output, stray_artifacts):\n        # Simulated function to assert the absence of stray artifacts in the output\n        return all(artifact not in output for artifact in stray_artifacts)\n    tmp = _run_cmd_on_container(container_name, ctx, \"ls -A /tmp\")\n    if not _assert_artifact_free(tmp, stray_artifacts):\n        return False\n    tmp_files = tmp.split()\n    for tmp_file in tmp_files:\n        if tmp_file not in allowed_tmp_files:\n            return False\n    var_tmp = _run_cmd_on_container(container_name, ctx, \"ls -A /var/tmp\")\n    if var_tmp.strip() != \"\":\n        return False\n    home = _run_cmd_on_container(container_name, ctx, \"ls -A ~\")\n    if not _assert_artifact_free(home, stray_artifacts):\n        return False\n    root = _run_cmd_on_container(container_name, ctx, \"ls -A /\")\n    if not _assert_artifact_free(root, stray_artifacts):\n        return False\n    return True\n", "entry_point": "validate_temp_directories", "input": "'my_container', 'my_context', ['stray_artifact']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68727_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026256", "code": "from typing import List, Tuple\ndef replace_links(link_replacements: List[Tuple[str, str]], text: str) -> str:\n    for old_link, new_link in link_replacements:\n        text = text.replace(old_link, new_link)\n    return text\n", "entry_point": "replace_links", "input": "[('t', '')], 'ant'", "output": "'an'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75500_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8558", "output": "{1, 2, 389, 778, 11, 8558, 22, 4279}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8557", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026258", "code": "REQUIRED_CONFIG = [\"user\", \"pass\", \"address\"]\ndef check_config(config):\n    for param in REQUIRED_CONFIG:\n        if param not in config:\n            return False\n    return True\n", "entry_point": "check_config", "input": "{'user': 'admin', 'pass': '1234'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143024_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026259", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4177", "output": "{4177, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026260", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2705", "output": "{1, 2705, 541, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026261", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[5, 2, 5, 5, 0, 3, 4, 4]", "output": "[15, 4, 15, 15, 0, 9, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "802", "output": "{401, 1, 802, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026263", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "2, 0", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026264", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/some/path/fi.tx'", "output": "'fi.tx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026265", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9793", "output": "{9793, 1, 1399, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026266", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6737", "output": "{6737, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026267", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 5, 0, 3, 4, 4, 3]", "output": "[6, 5, 3, 7, 8, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026268", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "'are'", "output": "{'are': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113443_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026269", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8857", "output": "{1, 8857, 17, 521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4979", "output": "{1, 4979, 13, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026271", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5786", "output": "{1, 2, 263, 11, 2893, 526, 22, 5786}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026272", "code": "from typing import List\ndef convert_to_milliseconds(task_durations: List[int]) -> List[int]:\n    milliseconds_durations = [duration * 1000 for duration in task_durations]\n    return milliseconds_durations\n", "entry_point": "convert_to_milliseconds", "input": "[20, 21, 20, 8]", "output": "[20000, 21000, 20000, 8000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30331_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026273", "code": "def get_longest_word(str_obj: str) -> str:\n    # Split the input string object based on the period delimiter\n    words = str_obj.split('.')\n    # Calculate the length of each label (word)\n    label_lengths = [len(word) for word in words]\n    # Find the index of the longest label\n    longest_index = label_lengths.index(max(label_lengths))\n    # Return the word corresponding to the longest label index\n    return words[longest_index]\n", "entry_point": "get_longest_word", "input": "'apple.orange.banana'", "output": "'orange'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101895_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026274", "code": "def count_unique_elements(data):\n    unique_counts = []\n    for row in data:\n        unique_counts.append(len(set(row)))\n    return unique_counts\n", "entry_point": "count_unique_elements", "input": "[[], [], [], [], []]", "output": "[0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96470_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026275", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[10, 42, 27, 8, 8, 26, 38, 43, 26]", "output": "[8, 8, 10, 26, 26, 27, 38, 42, 43]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026276", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "5", "output": "[(1, 5), (5, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026277", "code": "def find_max_product_pair(nums):\n    max_product = float('-inf')\n    pair = ()\n    min_diff = float('inf')\n    for i in range(len(nums)):\n        for j in range(i + 1, len(nums)):\n            product = nums[i] * nums[j]\n            if product > max_product:\n                max_product = product\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n            elif product == max_product and abs(nums[i] - nums[j]) < min_diff:\n                pair = (nums[i], nums[j])\n                min_diff = abs(nums[i] - nums[j])\n    return pair\n", "entry_point": "find_max_product_pair", "input": "[7, 9, 1, 2, -3]", "output": "(7, 9)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62899_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026278", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3233", "output": "{61, 1, 3233, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026279", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "2", "output": "'2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026280", "code": "def get_parent_directory(file_path):\n    # Split the file path into directory components\n    components = file_path.split('/')\n    # Join all components except the last one to get the parent directory path\n    parent_directory = '/'.join(components[:-1])\n    return parent_directory\n", "entry_point": "get_parent_directory", "input": "'pppath/to/fi/somefile.txt'", "output": "'pppath/to/fi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11463_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026281", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "10, 12, 5", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026282", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'apple; banana; che'", "output": "['apple', 'banana', 'che']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026283", "code": "def decode_cipher(encoded_str, shift):\n    decoded_str = ''\n    for char in encoded_str:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            decoded_char = chr((ord(char) - shift - base) % 26 + base)\n            decoded_str += decoded_char\n        else:\n            decoded_str += char\n    return decoded_str\n", "entry_point": "decode_cipher", "input": "'mmr', 1", "output": "'llq'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69667_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026284", "code": "import re\nfrom typing import List\ndef _splitter(text: str) -> List[str]:\n    if len(text) == 0:\n        return []\n    if \"'\" not in text:\n        return [text]\n    return re.findall(\"'([^']+)'\", text)\n", "entry_point": "_splitter", "input": "\"'n'\"", "output": "['n']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84189_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026285", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "5, 14, 8", "output": "[5, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026286", "code": "def process_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        if i < list_length - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 2, 0]", "output": "[2, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63579_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026287", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'us-st-a'", "output": "'us-st'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026288", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'CCC(=C)COO'", "output": "'CCC(=C)COO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026289", "code": "def extract_major_version(version):\n    first_dot_index = version.index('.')\n    major_version = int(version[:first_dot_index])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'18.0'", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40723_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026290", "code": "from typing import List\ndef average_top_n(scores: List[int], n: int) -> float:\n    if n <= 0 or len(scores) == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n", "input": "[70, 71, 72], 3", "output": "71.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48814_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026291", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1156", "output": "{1, 2, 578, 4, 1156, 289, 68, 34, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1155", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8491", "output": "{1, 8491, 1213, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026293", "code": "import re\ndef count_unique_words(text_content):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', text_content.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'alo'", "output": "{'alo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026294", "code": "from collections import deque\ndef bfsTraversal(graph, start_vertex):\n    queue = deque([start_vertex])\n    visited = set([start_vertex])\n    result = []\n    while queue:\n        current_vertex = queue.popleft()\n        result.append(current_vertex)\n        for neighbor in graph.get(current_vertex, []):\n            if neighbor not in visited:\n                queue.append(neighbor)\n                visited.add(neighbor)\n    return result\n", "entry_point": "bfsTraversal", "input": "{-2: []}, -2", "output": "[-2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97538_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026295", "code": "def calculate_length_penalty_weight(length_penalty_weight, source_length, system_length):\n    total_weight = length_penalty_weight * (source_length + system_length)\n    return total_weight\n", "entry_point": "calculate_length_penalty_weight", "input": "0.25, 15, 10", "output": "6.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105024_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026296", "code": "def fibonacci_sequence(n):\n    fib_sequence = [0, 1]\n    while len(fib_sequence) < n:\n        next_num = fib_sequence[-1] + fib_sequence[-2]\n        fib_sequence.append(next_num)\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "4", "output": "[0, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52360_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026297", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "7, 8", "output": "5764801", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026298", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[1, 1, 2, 3, 3, 4, 5, 5, 6]", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026299", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n < 2:\n        return n\n    memo[n] = fib(n-1, memo) + fib(n-2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9924_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026300", "code": "def count_unique_loggers(logging_conf):\n    unique_loggers = set()\n    def traverse_loggers(loggers_dict):\n        for key, value in loggers_dict.items():\n            if key == 'loggers':\n                for logger_key in value:\n                    unique_loggers.add(logger_key)\n            elif isinstance(value, dict):\n                traverse_loggers(value)\n    traverse_loggers(logging_conf)\n    return len(unique_loggers)\n", "entry_point": "count_unique_loggers", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79484_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026301", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "2, 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026302", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    non_repeated_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if non_repeated_scores:\n        return max(non_repeated_scores)\n    else:\n        return -1\n", "entry_point": "highest_non_repeated_score", "input": "[100, 100, 99, 101]", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144053_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026303", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'Iapples'", "output": "'Iapples'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026304", "code": "from typing import List\ndef sum_of_max_values(strings: List[str]) -> int:\n    total_sum = 0\n    for string in strings:\n        integers = [int(num) for num in string.split(',')]\n        max_value = max(integers)\n        total_sum += max_value\n    return total_sum\n", "entry_point": "sum_of_max_values", "input": "['500', '544', '0']", "output": "1044", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86134_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026305", "code": "from typing import List\ndef rearrange_list(a_list: List[int]) -> int:\n    pivot = a_list[-1]\n    list_length = len(a_list)\n    for i in range(list_length - 2, -1, -1):  # Iterate from the second last element to the first\n        if a_list[i] > pivot:\n            a_list.insert(list_length, a_list.pop(i))  # Move the element to the right of the pivot\n    return a_list.index(pivot)\n", "entry_point": "rearrange_list", "input": "[1, 2, 3, 4, 5, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141863_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026306", "code": "def sort_projections(projection_ids, weights):\n    projection_map = dict(zip(projection_ids, weights))\n    sorted_projections = sorted(projection_ids, key=lambda x: projection_map[x])\n    return sorted_projections\n", "entry_point": "sort_projections", "input": "[1, 2, 2, 2, 2, 2, 2, 2], [1, 2, 2, 2, 2, 2, 2, 2]", "output": "[1, 2, 2, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91067_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026307", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "162", "output": "{1, 162, 2, 3, 6, 9, 81, 18, 54, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt161", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026308", "code": "import re\ndef lexer(text):\n    tokens = []\n    rules = [\n        (r'if|else|while|for', 'keyword'),\n        (r'[a-zA-Z][a-zA-Z0-9]*', 'identifier'),\n        (r'\\d+', 'number'),\n        (r'[+\\-*/]', 'operator')\n    ]\n    for rule in rules:\n        pattern, token_type = rule\n        for token in re.findall(pattern, text):\n            tokens.append((token, token_type))\n    return tokens\n", "entry_point": "lexer", "input": "'10'", "output": "[('10', 'number')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24727_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026309", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'school'", "output": "'school'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026310", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[0, 2, 3, 1, 2, 0, 0, 2, 2] + [0] * 17", "output": "'bbcccdeehhii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026311", "code": "def convert_to_integer(s):\n    number_words = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n    result = ''\n    current_word = ''\n    for char in s:\n        if char.isnumeric():\n            result += char\n        else:\n            current_word += char\n            if current_word in number_words:\n                result += str(number_words.index(current_word))\n                current_word = ''\n    return int(result)\n", "entry_point": "convert_to_integer", "input": "'seven'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121370_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026312", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'eoexample.com'", "output": "'eoexample.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026313", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[1, 2, 2, 3, 4, 4, 5, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026314", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[70, 70, 70, 70, 70, 77]", "output": "71.17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143012_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026315", "code": "def evaluate_postfix(expression):\n    tokens = expression.split()\n    stack = []\n    for token in tokens:\n        if token.isdigit():\n            stack.append(int(token))\n        else:\n            operand2 = stack.pop()\n            operand1 = stack.pop()\n            if token == '+':\n                stack.append(operand1 + operand2)\n            elif token == '-':\n                stack.append(operand1 - operand2)\n            elif token == '*':\n                stack.append(operand1 * operand2)\n            elif token == '/':\n                stack.append(operand1 // operand2)  # Integer division for simplicity\n    return stack[0]\n", "entry_point": "evaluate_postfix", "input": "'20 2 +'", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126836_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026316", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    version_parts = version.split('.')\n    version_tuple = tuple(map(int, version_parts))\n    return version_tuple\n", "entry_point": "parse_version", "input": "'4.22'", "output": "(4, 22)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59922_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026317", "code": "def find_missing_number(arr):\n    n = len(arr)\n    sum_of_arr = sum(arr)\n    sum_of_n_no = (n * (n + 1)) // 2\n    missing_number = sum_of_n_no - sum_of_arr\n    return missing_number\n", "entry_point": "find_missing_number", "input": "list(range(24))", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97333_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026318", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[1, 2, 0, 1, 2, 0, 1, 2, 1]", "output": "[3, 2, 1, 3, 2, 1, 3, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026319", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4208", "output": "{1, 2, 4, 263, 8, 526, 4208, 16, 2104, 1052}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4207", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026320", "code": "def extract_base_filename(path):\n    if not path:\n        return \"\"\n    filename = path.split('/')[-1]\n    dot_index = filename.rfind('.')\n    if dot_index != -1 and not filename.startswith('.'):\n        return filename[:dot_index]\n    else:\n        return filename\n", "entry_point": "extract_base_filename", "input": "'/path/to/sse.txt'", "output": "'sse'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77299_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026321", "code": "def parse_configuration(config_content):\n    config_dict = {}\n    for line in config_content.splitlines():\n        line = line.strip()\n        if line:\n            key, value = line.split('=')\n            key = key.strip()\n            value = value.strip()\n            if value.startswith('\"') and value.endswith('\"'):\n                value = value[1:-1]  # Remove double quotes from the value\n            elif value.isdigit():\n                value = int(value)\n            elif value.lower() == 'true' or value.lower() == 'false':\n                value = value.lower() == 'true'\n            config_dict[key] = value\n    return config_dict\n", "entry_point": "parse_configuration", "input": "'bind=true'", "output": "{'bind': True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86951_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026322", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5086", "output": "{1, 2, 5086, 2543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5085", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026323", "code": "from typing import List\ndef sum_of_primes(numbers: List[int]) -> int:\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    total_sum = 0\n    for num in numbers:\n        if is_prime(num):\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_primes", "input": "[2, 3, 5, 17]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89523_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026324", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026325", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'@#a!!00. .a(0)0#0'", "output": "'a00a000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4623", "output": "{1, 3, 67, 1541, 69, 201, 4623, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026327", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\beSomlar}'", "output": "'\\\\beSomlar}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026328", "code": "from typing import List\ndef find_missing_number(nums: List[int]) -> int:\n    n = len(nums) + 1\n    expected_sum = n * (n + 1) // 2\n    total_sum = sum(nums)\n    missing_number = expected_sum - total_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "list(range(1, 41)) + [42]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101660_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8103", "output": "{1, 3, 37, 8103, 73, 2701, 111, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8102", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026330", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'com.example.app.sensorArAtlassnfig'", "output": "'sensorArAtlassnfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026331", "code": "from typing import List, Dict\ndef process_session(sessions: List[Dict[str, float]]) -> float:\n    total_duration = 0.0\n    for session in sessions:\n        duration = session[\"end_time\"] - session[\"start_time\"]\n        total_duration += duration\n    return total_duration\n", "entry_point": "process_session", "input": "[]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102452_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026332", "code": "def move_players_on_grid(grid, player_positions):\n    def is_valid_move(row, col):\n        return 0 <= row < len(grid) and 0 <= col < len(grid[0]) and grid[row][col] != 'X'\n    for player_pos in player_positions:\n        row, col = player_pos\n        for move in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n            new_row, new_col = row + move[0], col + move[1]\n            if is_valid_move(new_row, new_col):\n                grid[row][col] = 'E'\n                grid[new_row][new_col] = 'P'\n                player_pos = (new_row, new_col)\n                break\n    return grid\n", "entry_point": "move_players_on_grid", "input": "[['X']], []", "output": "[['X']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5161_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026333", "code": "import math\ndef calculate_result(x):\n    sinn = math.sin(math.radians(15))\n    son = math.exp(x) - 5 * x\n    mon = math.sqrt(x**2 + 1)\n    lnn = math.log(3 * x)\n    result = sinn + son / mon - lnn\n    return round(result, 10)\n", "entry_point": "calculate_result", "input": "8", "output": "361.8617085755", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26393_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026334", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[80]", "output": "[80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026335", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026336", "code": "def sum_of_squares(nums: list[int]) -> int:\n    \"\"\"\n    Calculate the sum of squares of integers in the input list.\n    Args:\n    nums: A list of integers.\n    Returns:\n    The sum of the squares of the integers in the input list.\n    \"\"\"\n    return sum(num**2 for num in nums)\n", "entry_point": "sum_of_squares", "input": "[8]", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57390_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026337", "code": "def evaluate_polynomial(coefs, x0):\n    result = 0\n    for coef in reversed(coefs):\n        result = coef + result * x0\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[7296313], 1", "output": "7296313", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86312_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026338", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "48, 26, 54", "output": "48.44833333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1831", "output": "{1, 1831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026340", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[-1, 0, 1, 1]", "output": "[-1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026341", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "'No Quotes'", "output": "'No Quotes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4375", "output": "{1, 35, 5, 7, 875, 175, 625, 4375, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026343", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5069", "output": "{1, 137, 37, 5069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026344", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9841", "output": "{1, 13, 757, 9841}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9840", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026345", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[10, 5, 9, 0]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026346", "code": "def port_scan(input_str):\n    def is_port_open(port):\n        return port % 3 == 0\n    result = {}\n    inputs = input_str.split()\n    for host_port in inputs:\n        if '-' in host_port:\n            host, port_range = host_port.split('-')\n            start_port = int(port_range.split('-')[0])\n            end_port = int(port_range.split('-')[1]) if '-' in port_range else start_port\n            open_ports = [port for port in range(start_port, end_port + 1) if is_port_open(port)]\n            result[host] = open_ports\n        else:\n            host = host_port\n            result[host] = []\n    return result\n", "entry_point": "port_scan", "input": "'23'", "output": "{'23': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113300_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026347", "code": "def clean(string_value):\n    \"\"\"Standardizes string values for lookup by removing case and special characters and spaces.\n    Args:\n        string_value (str): The lookup key to be transformed.\n    Returns:\n        str: The original value, but lowercase and without spaces, underscores, or dashes.\n    \"\"\"\n    cleaned_string = string_value.lower().strip().replace(\"_\", \"\").replace(\"-\", \"\").replace(\" \", \"\")\n    return cleaned_string\n", "entry_point": "clean", "input": "'He-l_l '", "output": "'hell'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131172_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026348", "code": "def calculate_firing_rate(spike_times):\n    total_spikes = len(spike_times)\n    total_time_duration = spike_times[-1] - spike_times[0]\n    firing_rate = total_spikes / total_time_duration if total_time_duration > 0 else 0\n    return firing_rate\n", "entry_point": "calculate_firing_rate", "input": "[0.0, 0.2, 0.4, 0.6, 0.8]", "output": "6.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17459_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026349", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026350", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5563", "output": "{1, 5563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5562", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026351", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "15", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026352", "code": "import re\ndef remove_color_codes(text):\n    return re.sub('(\u00a7[0-9a-f])', '', text)\n", "entry_point": "remove_color_codes", "input": "'\u00a71a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50171_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026353", "code": "def capitalize_first_letter(words):\n    capitalized_words = []\n    for word in words:\n        capitalized_words.append(word[0].capitalize() + word[1:])\n    return capitalized_words\n", "entry_point": "capitalize_first_letter", "input": "['apple', 'banana', 'cherry']", "output": "['Apple', 'Banana', 'Cherry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147148_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026354", "code": "def distance_to_camera(knownWidth, focalLength, perWidth):\n    # Compute and return the distance from the object to the camera\n    return (knownWidth * focalLength) / perWidth\n", "entry_point": "distance_to_camera", "input": "50, 72.38333333333334, 10", "output": "361.9166666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71888_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026355", "code": "def generate_new_version(version):\n    major, minor = version.split(\".\")\n    new_minor = \"{:.2f}\".format(float(minor) + 0.01)\n    new_version = f\"{major}.{new_minor}\"\n    return new_version\n", "entry_point": "generate_new_version", "input": "'5000.100'", "output": "'5000.100.01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72043_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026356", "code": "import re\ndef match_url(url, urlpatterns):\n    for pattern, view_name in urlpatterns:\n        if re.match(pattern, url):\n            return view_name\n    return None\n", "entry_point": "match_url", "input": "'/', [('^/$', 'homepage')]", "output": "'homepage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53079_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026357", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[2, 2, 6, 1, 5, 1]", "output": "[4, 12, 2, 10, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2327", "output": "{1, 179, 13, 2327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026359", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[90, 85, 85, 80, 75, 70]", "output": "[1, 2, 2, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93704_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026360", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026361", "code": "def move_player(commands):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n        # Check boundaries\n        x = max(-10, min(10, x))\n        y = max(-10, min(10, y))\n    return x, y\n", "entry_point": "move_player", "input": "['R']", "output": "(1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026362", "code": "def nested_list_sum(lst):\n    total_sum = 0\n    for element in lst:\n        if isinstance(element, int):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += nested_list_sum(element)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[1, 1], [2]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43700_ipt23", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026363", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "[], 6", "output": "'{v0, v1, v2, v3, v4, v5}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026364", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9325", "output": "{1, 5, 1865, 9325, 373, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9324", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026365", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "5", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026366", "code": "def reshape_tensor(sizes, new_order):\n    reshaped_sizes = []\n    for index in new_order:\n        reshaped_sizes.append(sizes[index])\n    return reshaped_sizes\n", "entry_point": "reshape_tensor", "input": "[2, 3, 4, 2], [0, 1, 2, 0, 2]", "output": "[2, 3, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117209_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026367", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8417", "output": "{1, 443, 19, 8417}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026368", "code": "def time_diff(time1, time2):\n    def time_to_seconds(time_str):\n        h, m, s = map(int, time_str.split(':'))\n        return h * 3600 + m * 60 + s\n    total_seconds1 = time_to_seconds(time1)\n    total_seconds2 = time_to_seconds(time2)\n    time_difference = abs(total_seconds1 - total_seconds2)\n    return time_difference\n", "entry_point": "time_diff", "input": "'23:59:59', '00:00:00'", "output": "86399", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35063_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026369", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "219", "output": "{3, 1, 219, 73}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026370", "code": "MAX_NUM_VERTICES = 2**32\nDEFAULT_MESH_COLOR = 180\ndef generate_mesh_colors(num_vertices, colors=None):\n    mesh_colors = {}\n    if colors is None:\n        colors = [DEFAULT_MESH_COLOR] * num_vertices\n    else:\n        colors += [DEFAULT_MESH_COLOR] * (num_vertices - len(colors))\n    for i, color in enumerate(colors):\n        mesh_colors[i] = color\n    return mesh_colors\n", "entry_point": "generate_mesh_colors", "input": "4", "output": "{0: 180, 1: 180, 2: 180, 3: 180}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117119_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026371", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[-4, 3, 2, 6]", "output": "-144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026372", "code": "def fibonacci_memoization(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        memo[n] = fibonacci_memoization(n - 1, memo) + fibonacci_memoization(n - 2, memo)\n        return memo[n]\n", "entry_point": "fibonacci_memoization", "input": "8", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10738_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2778", "output": "{1, 2, 3, 6, 1389, 463, 2778, 926}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026374", "code": "def find_last_number_less_than_five(numbers):\n    for num in reversed(numbers):\n        if num < 5:\n            return num\n    return None\n", "entry_point": "find_last_number_less_than_five", "input": "[5, 1, 2, 3, 0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109099_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026375", "code": "def format_output(version: str, app_config: str) -> str:\n    return f\"Version: {version}, Default App Config: {app_config}\"\n", "entry_point": "format_output", "input": "'1.0.01v', 'dig'", "output": "'Version: 1.0.01v, Default App Config: dig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138174_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026376", "code": "def generate_message(dev):\n    if 'Sainte Claire' in dev and dev['Sainte Claire']['count'] >= 3:\n        title = \"RU @ Sainte Claire?\"\n        body = \"Are you staying at Sainte Claire? I noticed your device had been detected there when I visited the Loca stand in the South Hall. You were detected by their network at the hotel reception %d times, so I guess that means you are checked in! :) I must have just missed you, I was by the hotel reception myself at %s which is when you were last seen there.\" % (\n            dev['Sainte Claire']['count'], dev['Sainte Claire']['last_seen'])\n        return (1, 200, title, title, body)\n    else:\n        return (0, 0, 0, '', '')\n", "entry_point": "generate_message", "input": "{}", "output": "(0, 0, 0, '', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112555_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026377", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[0], 5", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026378", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "'Berlin', 12347", "output": "'https://www.fitx.de/fitnessstudios/12347'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026379", "code": "def optimize(input_list):\n    unique_elements = set()\n    optimized_list = []\n    for element in input_list:\n        if element not in unique_elements:\n            unique_elements.add(element)\n            optimized_list.append(element)\n    return optimized_list\n", "entry_point": "optimize", "input": "[1, 0, 5]", "output": "[1, 0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92987_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026380", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "61", "output": "{1, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt60", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026381", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'Click'", "output": "'<p>Click</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026382", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[4, 1, 2, 2, 2, 4, 2, 4]", "output": "[4, 2, 4, 5, 6, 9, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026383", "code": "def simulate_card_game(deck_a, deck_b):\n    score_a = 0\n    score_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    return score_a, score_b\n", "entry_point": "simulate_card_game", "input": "[2, 5, 6, 1, 3, 2, 4], [1, 3, 2, 4, 5, 6, 7]", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026384", "code": "import string\ndef word_frequency(text):\n    word_freq = {}\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.split()\n    for word in words:\n        word = word.translate(translator).lower()\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'helleohello'", "output": "{'helleohello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11782_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026385", "code": "from typing import List\ndef compress_data(data: List[int]) -> List[int]:\n    compressed_data = []\n    last_element = None\n    for num in data:\n        if num != last_element:\n            compressed_data.append(num)\n            last_element = num\n    return compressed_data\n", "entry_point": "compress_data", "input": "[1, 2, 2, 3, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90115_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026386", "code": "def find_latest_version(versions):\n    def version_key(version):\n        major, minor, patch = map(int, version.split('.'))\n        return major, minor, patch\n    sorted_versions = sorted(versions, key=version_key, reverse=True)\n    return sorted_versions[0]\n", "entry_point": "find_latest_version", "input": "['1.3.0', '1.2.0', '1.0.0']", "output": "'1.3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42610_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026387", "code": "def calculate_area(vertices):\n    n = len(vertices)\n    area = 0\n    j = n - 1\n    for i in range(n):\n        area += (vertices[j][0] + vertices[i][0]) * (vertices[j][1] - vertices[i][1])\n        j = i\n    return abs(area) / 2\n", "entry_point": "calculate_area", "input": "[(0, 0), (3, 0), (3, 2), (0, 2)]", "output": "6.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75590_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026388", "code": "def max_power_level(data):\n    if not data:\n        return 0\n    inclusive = data[0]\n    exclusive = 0\n    for i in range(1, len(data)):\n        temp = inclusive\n        inclusive = max(inclusive, exclusive + data[i])\n        exclusive = temp\n    return max(inclusive, exclusive)\n", "entry_point": "max_power_level", "input": "[15, 0, 17]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5467_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026389", "code": "from typing import List\ndef product_of_max_min(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_num = max(nums)\n    min_num = min(nums)\n    return max_num * min_num\n", "entry_point": "product_of_max_min", "input": "[1, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147807_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026390", "code": "from typing import List\ndef find_nearest(array: List[float], value: float) -> float:\n    if not array:\n        raise ValueError(\"Input array is empty\")\n    nearest_idx = 0\n    min_diff = abs(array[0] - value)\n    for i in range(1, len(array)):\n        diff = abs(array[i] - value)\n        if diff < min_diff:\n            min_diff = diff\n            nearest_idx = i\n    return array[nearest_idx]\n", "entry_point": "find_nearest", "input": "[8.0, 9.0, 9.23, 10.0], 9.2", "output": "9.23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121237_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026391", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(4, 0, 1)", "output": "'4.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026392", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'my'", "output": "'my'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026393", "code": "def generate_test_file_name(file_name: str) -> str:\n    DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'\n    if file_name.endswith(DEFAULT_TEST_FILE_NAME_SUFFIX):\n        return file_name\n    else:\n        return file_name + DEFAULT_TEST_FILE_NAME_SUFFIX\n", "entry_point": "generate_test_file_name", "input": "'lee'", "output": "'lee.spec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148493_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026394", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2234", "output": "{1, 2234, 2, 1117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026395", "code": "from typing import List\ndef calculate_total_points(tasks: List[str]) -> int:\n    total_points = 0\n    for index, task in enumerate(tasks, start=1):\n        total_points += index * len(task)\n    return total_points\n", "entry_point": "calculate_total_points", "input": "['A', 'BB', 'CCC', 'DDDD']", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92687_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026396", "code": "def parse_variable_declarations(declarations):\n    variable_types = {}\n    for declaration in declarations:\n        parts = declaration.split(\":\")\n        variable_name = parts[0].strip()\n        variable_type = parts[1].split(\"=\")[0].strip()\n        variable_types[variable_name] = variable_type\n    return variable_types\n", "entry_point": "parse_variable_declarations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58972_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1829", "output": "{1, 59, 1829, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026398", "code": "import string\ndef word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Count word frequencies\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'oururma'", "output": "{'oururma': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40517_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026399", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "'any_token', 5, [0, 1, 2, 3, 4, 5]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026400", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'10.5.6'", "output": "'10.5.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9907", "output": "{1, 9907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026402", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9274", "output": "{1, 9274, 2, 4637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026403", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[3, 4, 5, 3, 4, 5]", "output": "[3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026404", "code": "def get_unique_elements(input_list):\n    unique_elements = list(set(input_list))\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[1, 1, 3, 4, 5]", "output": "[1, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106701_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026405", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        elif num % 2 != 0:\n            processed_list.append(num ** 3)\n        if num % 3 == 0:\n            processed_list[-1] += 10  # Increment the last element in the list by 10\n    return processed_list\n", "entry_point": "process_integers", "input": "[3, 4, 6, 1, 2, 2, 2, 2]", "output": "[37, 16, 46, 1, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82710_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026406", "code": "def calculate_moving_average(array, window_size):\n    moving_averages = []\n    for i in range(len(array) - window_size + 1):\n        window = array[i:i + window_size]\n        average = sum(window) / window_size\n        moving_averages.append(average)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[8, 10, 11], 2", "output": "[9.0, 10.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41574_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9736", "output": "{1, 2, 2434, 4868, 4, 1217, 9736, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9735", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026408", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "3", "output": "'024'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026409", "code": "AMBIGUITY_VALUES = {\n    \"absent\": 0.00,\n    \"low\": 0.01,\n    \"high\": 0.02,\n}\ndef calculate_total_ambiguity_value(ambiguity_levels):\n    total_ambiguity_value = sum(AMBIGUITY_VALUES.get(level, 0) for level in ambiguity_levels)\n    return total_ambiguity_value\n", "entry_point": "calculate_total_ambiguity_value", "input": "['low', 'low', 'low']", "output": "0.03", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92876_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026410", "code": "from typing import List\ndef find_starting_station(gas: List[int], cost: List[int]) -> int:\n    n = len(gas)\n    total_tank, curr_tank, start = 0, 0, 0\n    for i in range(n):\n        total_tank += gas[i] - cost[i]\n        curr_tank += gas[i] - cost[i]\n        if curr_tank < 0:\n            start = i + 1\n            curr_tank = 0\n    return start if total_tank >= 0 else -1\n", "entry_point": "find_starting_station", "input": "[1, 2, 3, 4, 5], [3, 4, 5, 1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42546_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026411", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[10, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026412", "code": "def validate_arguments(subreddit, sort_by, quantity):\n    valid_sort_options = [\"hot\", \"new\", \"top\", \"rising\"]  # Valid sorting options\n    if len([subreddit, sort_by, quantity]) != 3:\n        return \"Error: Exactly 3 arguments are required.\"\n    if not subreddit or not isinstance(subreddit, str):\n        return \"Error: Subreddit must be a non-empty string.\"\n    if sort_by not in valid_sort_options:\n        return \"Error: Invalid sorting option. Choose from 'hot', 'new', 'top', 'rising'.\"\n    if not quantity or not quantity.isdigit() or int(quantity) <= 0:\n        return \"Error: Quantity must be a positive integer.\"\n    return subreddit, sort_by, int(quantity)\n", "entry_point": "validate_arguments", "input": "'python', 'top', '10'", "output": "('python', 'top', 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135806_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026413", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[1, 1, 1, 0, 0, 6, 3]", "output": "{1: 3, 0: 2, 6: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026414", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "-1", "output": "'?-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5013", "output": "{1, 3, 1671, 9, 557, 5013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026416", "code": "def process_publication_data(publication_data):\n    formatted_publications = []\n    unique_journals = set()\n    unique_creators = set()\n    for publication in publication_data:\n        title = publication.get('title', 'Not available')\n        creator = publication.get('creator', 'Not available')\n        journal = publication.get('journal', 'Not available')\n        date = publication.get('date', 'Not available')\n        volume = publication.get('volume', 'Not available')\n        formatted_publication = f\"Title: {title}\\nCreator: {creator}\\nJournal: {journal}\\nDate: {date}\\nVolume: {volume}\"\n        formatted_publications.append(formatted_publication)\n        if journal != 'Not available':\n            unique_journals.add(journal)\n        if creator != 'Not available':\n            unique_creators.add(creator)\n    return formatted_publications, list(unique_journals), list(unique_creators)\n", "entry_point": "process_publication_data", "input": "[]", "output": "([], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128471_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026417", "code": "def absolute_diff_sum(lst):\n    if len(lst) < 2:\n        return 0\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i+1])\n    return abs_diff_sum\n", "entry_point": "absolute_diff_sum", "input": "[0, 8, 8, 0]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112129_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026418", "code": "def calculate_average(numbers, indices):\n    selected_numbers = [numbers[i] for i in indices]\n    avg_return = sum(selected_numbers) / len(selected_numbers)\n    return avg_return\n", "entry_point": "calculate_average", "input": "[35, 36, 39, 42, 50], [0, 1, 2]", "output": "36.666666666666664", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32648_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026419", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "None, None, '1.9.9'", "output": "'2.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026420", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 5, 15, 5]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4789", "output": "{1, 4789}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026422", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "97", "output": "'97'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026423", "code": "def find_top_scores(scores, K):\n    return scores[:K]\n", "entry_point": "find_top_scores", "input": "[97, 87, 79, 84, 97, 88, 65], 5", "output": "[97, 87, 79, 84, 97]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37875_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026424", "code": "def generate_event_name(class_name: str) -> str:\n    return 'tonga.cashregister.event.' + class_name + 'Created'\n", "entry_point": "generate_event_name", "input": "'Bill'", "output": "'tonga.cashregister.event.BillCreated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137083_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026425", "code": "EXCHANGES = ['binance', 'binanceus', 'coinbasepro', 'kraken']\nEXCHANGE_NAMES = ['Binance', 'Binance US', 'Coinbase Pro', 'Kraken']\nINTERVALS = ['1m', '5m', '15m', '30m', '1h', '12h', '1d']\ndef execute_trade(exchange_index, interval_index, trade_amount):\n    exchange_name = EXCHANGE_NAMES[exchange_index]\n    interval = INTERVALS[interval_index]\n    return f\"Trading {trade_amount} BTC on {exchange_name} at {interval} interval.\"\n", "entry_point": "execute_trade", "input": "0, 3, 3.52632", "output": "'Trading 3.52632 BTC on Binance at 30m interval.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52795_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026426", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[22, 25, 63, 64, 64, 64, 64, 64, 65]", "output": "[22, 25, 63, 64, 64, 64, 64, 64, 65]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026427", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "809", "output": "{1, 809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026428", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hhelloello'", "output": "['hhelloello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026429", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'01:05:02 AM'", "output": "'01:05:02'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026430", "code": "def extract_module_and_test_cases(code_snippet):\n    lines = code_snippet.split('\\n')\n    module_name = lines[0].split('/')[-1].strip()\n    test_cases = []\n    for line in lines:\n        if 'from cloudalbum.tests' in line:\n            test_case = line.split()[-1]\n            test_cases.append(test_case)\n    return {'module_name': module_name, 'test_cases': test_cases}\n", "entry_point": "extract_module_and_test_cases", "input": "'/path/to/module/AWS'", "output": "{'module_name': 'AWS', 'test_cases': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133977_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026431", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[10, 10, 11, 11, 10, 37, 92, 93]", "output": "[10, 10, 10, 11, 11, 37, 92, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026432", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "-1, 15, 4", "output": "[-1, 3, 7, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026433", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'imiim'", "output": "('imiim', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026434", "code": "def repeat(word, times):\n    text = \"\"  # Initialize an empty string\n    for _ in range(times):\n        text += word  # Concatenate the word 'times' number of times\n    return text  # Return the concatenated result\n", "entry_point": "repeat", "input": "'hello', 8", "output": "'hellohellohellohellohellohellohellohello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106481_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026435", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "0.0, -2375685080.673286", "output": "-2375685080.673286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026436", "code": "def custom_flatten(input_list):\n    flattened_list = []\n    # Flatten the list\n    for sublist in input_list:\n        for item in sublist:\n            flattened_list.append(item)\n    # Remove duplicates and sort\n    unique_sorted_list = []\n    for item in flattened_list:\n        if item not in unique_sorted_list:\n            unique_sorted_list.append(item)\n    unique_sorted_list.sort()\n    return unique_sorted_list\n", "entry_point": "custom_flatten", "input": "[[1], [2], [3], [4], [5]]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111051_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026437", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5377", "output": "{283, 1, 19, 5377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026438", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[1, 3, 2, 4, 8, 3, 6, 6, 0]", "output": "[6, 6, 3, 8, 4, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026439", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2299", "output": "{1, 11, 209, 19, 121, 2299}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026440", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[10, 1, 5, 6, 3, 6, 7, 6]", "output": "[10, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026441", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'789+DEF+GHI'", "output": "('789', 'DEF', 'GHI', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026442", "code": "from typing import List, Union\ndef recursive_sum(input_list: List[Union[int, List]]) -> int:\n    total = 0\n    for element in input_list:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += recursive_sum(element)\n    return total\n", "entry_point": "recursive_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8095_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026443", "code": "def find_second_highest_score(scores):\n    unique_scores = set(scores)\n    if len(unique_scores) < 2:\n        return -1\n    unique_scores.remove(max(unique_scores))\n    return max(unique_scores)\n", "entry_point": "find_second_highest_score", "input": "[90, 92, 91]", "output": "91", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99506_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026444", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[1, 2, 3, 4, 5]", "output": "[5, 4, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026445", "code": "import errno\ndef process_socket_errors(sock_errors: dict) -> dict:\n    sockErrors = {errno.ESHUTDOWN: True,\n                  errno.ENOTCONN: True,\n                  errno.ECONNRESET: False,\n                  errno.ECONNREFUSED: False,\n                  errno.EAGAIN: False,\n                  errno.EWOULDBLOCK: False}\n    if hasattr(errno, 'EBADFD'):\n        sockErrors[errno.EBADFD] = True\n    ignore_status = {}\n    for error_code in sock_errors:\n        ignore_status[error_code] = sockErrors.get(error_code, False)\n    return ignore_status\n", "entry_point": "process_socket_errors", "input": "{108: None, 104: None, 77: None}", "output": "{108: True, 104: False, 77: True}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12691_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026446", "code": "from functools import lru_cache\ndef count_contents(target, contents):\n    @lru_cache()\n    def rec_count(color):\n        if color not in contents:\n            return 0\n        return sum((1 + rec_count(child)) * count for child, count in contents[color].items())\n    return rec_count(target)\n", "entry_point": "count_contents", "input": "'blue', {}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43433_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "716", "output": "{1, 2, 4, 358, 716, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt715", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026448", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[3, 3, 8, 8]", "output": "[3, 3, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026449", "code": "def format_version(version):\n    major, minor, patch = version\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(4, 8, 9)", "output": "'4.8.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66488_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026450", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "'2H\u00e9ll\u00f23'", "output": "'2Hll3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026451", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1475", "output": "{1, 1475, 5, 295, 25, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1474", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6774", "output": "{1, 2, 3, 6, 1129, 2258, 6774, 3387}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6773", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026453", "code": "def calculate_total_elements(maxlag, disp_lag, dt):\n    # Calculate the total number of elements in the matrix\n    total_elements = 2 * int(disp_lag / dt) + 1\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "-1, -4, 2", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39261_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026454", "code": "def sum_of_squares_even(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 4, 6, 8]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_423_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026455", "code": "MAX_NUM_VERTICES = 2**32\nDEFAULT_MESH_COLOR = 180\ndef generate_mesh_colors(num_vertices, colors=None):\n    mesh_colors = {}\n    if colors is None:\n        colors = [DEFAULT_MESH_COLOR] * num_vertices\n    else:\n        colors += [DEFAULT_MESH_COLOR] * (num_vertices - len(colors))\n    for i, color in enumerate(colors):\n        mesh_colors[i] = color\n    return mesh_colors\n", "entry_point": "generate_mesh_colors", "input": "5, [255, 200, 150]", "output": "{0: 255, 1: 200, 2: 150, 3: 180, 4: 180}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117119_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026456", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "3", "output": "'21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026457", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9410", "output": "{4705, 1, 9410, 2, 5, 10, 941, 1882}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9409", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026458", "code": "def categorize_tasks(tasks):\n    categorized_tasks = {}\n    for task in tasks:\n        category = task.get('category', 'Uncategorized')\n        categorized_tasks.setdefault(category, []).append(task['name'])\n    return categorized_tasks\n", "entry_point": "categorize_tasks", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102321_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026459", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(0, 0, 0), 27213", "output": "27213", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026460", "code": "def simple_calculator(input_list):\n    result = float(input_list[0])\n    operation = None\n    for i in range(1, len(input_list), 2):\n        if input_list[i] in ['+', '-', '*', '/']:\n            operation = input_list[i]\n        else:\n            num = float(input_list[i])\n            if operation == '+':\n                result += num\n            elif operation == '-':\n                result -= num\n            elif operation == '*':\n                result *= num\n            elif operation == '/':\n                if num == 0:\n                    return \"Error: Division by zero\"\n                result /= num\n    return result\n", "entry_point": "simple_calculator", "input": "[0, '+', 5, '-', 5]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122722_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026461", "code": "def decode_desc(encoded_str):\n    decoded_dict = {}\n    for pair in encoded_str.split():\n        if '=' in pair:\n            key, value = pair.split('=', 1)  # Split by the first occurrence of '='\n            decoded_dict[key] = value\n    return decoded_dict\n", "entry_point": "decode_desc", "input": "'name=ecity=w'", "output": "{'name': 'ecity=w'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58893_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026462", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2746", "output": "{1, 2746, 2, 1373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026463", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 8, 10, 12, 3, 3, 5, 5, 9]", "output": "([2, 8, 10, 12], [3, 3, 5, 5, 9])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026464", "code": "def format_output(version: str, default_config: str) -> str:\n    formatted_version = f'[{version}]'\n    formatted_default_config = f\"'{default_config}'\"\n    formatted_output = f'{formatted_version}: {formatted_default_config}'\n    return formatted_output\n", "entry_point": "format_output", "input": "'02.20', 'rmflCo'", "output": "\"[02.20]: 'rmflCo'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125942_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026465", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[32, 33, 34]", "output": "'33%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026466", "code": "def get_os_name(os_code: int) -> str:\n    os_names = {\n        8: \"FREEBSD\",\n        9: \"IRIX\",\n        10: \"HPUX\",\n        11: \"MIRAPOINT\",\n        12: \"OPENBSD\",\n        13: \"SCO\",\n        14: \"SELINUX\",\n        15: \"DARWIN\",\n        16: \"VXWORKS\",\n        17: \"PSOS\",\n        18: \"WINMOBILE\",\n        19: \"IPHONE\",\n        20: \"JUNOS\",\n        21: \"ANDROID\",\n        65535: \"UNKNOWN\"\n    }\n    return os_names.get(os_code, \"UNKNOWN\")\n", "entry_point": "get_os_name", "input": "19", "output": "'IPHONE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122757_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026467", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'eag', 128", "output": "[144, 128, 152]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026468", "code": "from typing import List\ndef aggregate_ids(series: List[int]) -> str:\n    try:\n        unique_ids = list(set(series))  # Remove duplicates by converting to set and back to list\n        unique_ids.sort()  # Sort the unique IDs\n        return \", \".join(map(str, unique_ids))  # Convert IDs to strings and join with commas\n    except Exception:\n        return \"NA\"\n", "entry_point": "aggregate_ids", "input": "[50, 4, 30, 3, 4, 50]", "output": "'3, 4, 30, 50'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101965_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026469", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[-2, -2, -2, 1, 3]", "output": "[-2, -2, -2, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026470", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "1048576, 5", "output": "6291456", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026471", "code": "def iterative_sum(n):\n    total_sum = 0\n    for i in range(1, n+1):\n        total_sum += i\n    return total_sum\n", "entry_point": "iterative_sum", "input": "9", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127697_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026472", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if N > len(sorted_scores):\n        N = len(sorted_scores)\n    return sum(sorted_scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[-250, -251], 2", "output": "-250.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132945_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026473", "code": "def swap_array(arr):\n    result = []\n    for el in arr:\n        binary = bin(el)[2:]\n        ones_count = sum(int(digit) for digit in binary)\n        result.append(ones_count)\n    return result\n", "entry_point": "swap_array", "input": "[2, 3, 3, 7, 7, 2, 7]", "output": "[1, 2, 2, 3, 3, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45829_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026474", "code": "def sum_with_index(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "sum_with_index", "input": "[7, 1, 3, 2, 2, 3, 2, 6, 7]", "output": "[7, 2, 5, 5, 6, 8, 8, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14810_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026475", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "28, 3, 6", "output": "37.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026476", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "71868, '.0000'", "output": "'7.1868E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026477", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 41, 28, 15, 10, 5]", "output": "[42, 41, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026478", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1886", "output": "{1, 2, 41, 46, 943, 82, 23, 1886}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1885", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026479", "code": "def count_configurations(strings):\n    count = 0\n    for string in strings:\n        words = string.split()\n        for word in words:\n            if word.lower() == 'configuration':\n                count += 1\n    return count\n", "entry_point": "count_configurations", "input": "['hello', 'world']", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39028_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026480", "code": "from typing import List\ndef max_weight(weights: List[int], weight_limit: int) -> int:\n    n = len(weights)\n    dp = [0] * (weight_limit + 1)\n    for weight in weights:\n        for w in range(weight_limit, weight - 1, -1):\n            dp[w] = max(dp[w], dp[w - weight] + weight)\n    return dp[weight_limit]\n", "entry_point": "max_weight", "input": "[20, 15, 25, 2], 62", "output": "62", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29254_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026481", "code": "def calculate_min_max_sum(arr):\n    total_sum = sum(arr)\n    min_sum = total_sum - max(arr)\n    max_sum = total_sum - min(arr)\n    return min_sum, max_sum\n", "entry_point": "calculate_min_max_sum", "input": "[8, 12, 12]", "output": "(20, 24)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17042_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026482", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "100, 'Helello,'", "output": "([('Content-type', 'text/plain')], 'Helello,')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2671", "output": "{1, 2671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "398", "output": "{1, 2, 398, 199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt397", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026485", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[10, 10, 6]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38745_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026486", "code": "def calculate_tracking_error(actual_size, desired_size):\n    vertical_error = desired_size[0] - actual_size[0]\n    horizontal_error = desired_size[1] - actual_size[1]\n    total_error = vertical_error**2 + horizontal_error**2\n    return total_error\n", "entry_point": "calculate_tracking_error", "input": "(13, 0), (0, 4)", "output": "185", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30005_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026487", "code": "import math\ndef calc_knee_angle(points):\n    def angle_between_vectors(v1, v2):\n        dot_product = v1[0] * v2[0] + v1[1] * v2[1]\n        magnitude_v1 = math.sqrt(v1[0] ** 2 + v1[1] ** 2)\n        magnitude_v2 = math.sqrt(v2[0] ** 2 + v2[1] ** 2)\n        return math.degrees(math.acos(dot_product / (magnitude_v1 * magnitude_v2)))\n    vector1 = [points[1][0] - points[0][0], points[1][1] - points[0][1]]\n    vector2 = [points[2][0] - points[1][0], points[2][1] - points[1][1]]\n    start_angle = angle_between_vectors([1, 0], vector1)\n    knee_angle = angle_between_vectors(vector1, vector2)\n    return round(start_angle), round(knee_angle)\n", "entry_point": "calc_knee_angle", "input": "[(0, 0), (0, 1), (1, 2)]", "output": "(90, 45)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100988_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026488", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'textexbase64ae'", "output": "('textexbase64ae', '', '', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026489", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[3, 4, 5, 3, 3, 3, 3, 3]", "output": "[3, 4, 5, 3, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026490", "code": "def merge_two_dicts(x, y):\n    z = x.copy()  # Create a copy of dictionary x\n    z.update(y)   # Update dictionary z with entries from dictionary y\n    return z      # Return the merged dictionary\n", "entry_point": "merge_two_dicts", "input": "{}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69794_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026491", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'data/input.sh'", "output": "'data/input.sh_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026492", "code": "def expire_items(source_list, threshold):\n    updated_list = [item for item in source_list if item > threshold]\n    return updated_list\n", "entry_point": "expire_items", "input": "[5, 6, 7, 8], 7", "output": "[8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109182_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026493", "code": "from typing import List\ndef longest_subarray(arr: List[int], target: int) -> int:\n    start = 0\n    end = 0\n    curr_sum = 0\n    max_length = 0\n    while end < len(arr):\n        curr_sum += arr[end]\n        while curr_sum > target:\n            curr_sum -= arr[start]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_subarray", "input": "[2, 1, 3, 4, 5], 10", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40443_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7951", "output": "{1, 7951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026495", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'RRRD'", "output": "(3, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026496", "code": "from typing import List\ndef extract_module_names(imports: List[str]) -> List[str]:\n    module_names = set()\n    for imp in imports:\n        module_name = imp.split(\"from .\")[1].split(\" \")[0].split(\".\")[0]\n        module_names.add(module_name)\n    return list(module_names)\n", "entry_point": "extract_module_names", "input": "['from .spec_version import foo']", "output": "['spec_version']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35054_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026497", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "4", "output": "'1211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026498", "code": "from os import listdir\nfrom os.path import isdir, join\ndef filter_files(file_list):\n    filtered_files = []\n    for file_name in file_list:\n        if not isdir(file_name) and not file_name.startswith('.'):\n            filtered_files.append(file_name)\n    return filtered_files\n", "entry_point": "filter_files", "input": "['file2.py', 'file1.txt', '2y.p2y']", "output": "['file2.py', 'file1.txt', '2y.p2y']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127462_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026499", "code": "from typing import List, Tuple\ndef count_circle_intersections(circle_centers: List[Tuple[float, float]], radii: List[float]) -> int:\n    intersection_count = 0\n    n = len(circle_centers)\n    for i in range(n):\n        for j in range(i + 1, n):\n            center1, center2 = circle_centers[i], circle_centers[j]\n            distance = ((center1[0] - center2[0]) ** 2 + (center1[1] - center2[1]) ** 2) ** 0.5\n            if distance < radii[i] + radii[j]:\n                intersection_count += 1\n    return intersection_count\n", "entry_point": "count_circle_intersections", "input": "[(0, 0), (1, 0), (5, 0)], [2, 2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28351_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026500", "code": "def longest_substring_with_k_distinct(s, k):\n    max_length = 0\n    start = 0\n    char_count = {}\n    for end in range(len(s)):\n        char_count[s[end]] = char_count.get(s[end], 0) + 1\n        while len(char_count) > k:\n            char_count[s[start]] -= 1\n            if char_count[s[start]] == 0:\n                del char_count[s[start]]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n    return max_length\n", "entry_point": "longest_substring_with_k_distinct", "input": "'a' * 21, 1", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18078_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026501", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[1, 2, 2, 3, 4, 4, 6, 6]", "output": "[1, 2, 3, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026502", "code": "def process_columns(columns, widths):\n    column_widths = {}\n    for col, width in zip(columns, widths):\n        if width == 0:\n            column_widths[col] = None\n        else:\n            column_widths[col] = width\n    return column_widths\n", "entry_point": "process_columns", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60561_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026503", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'ping'", "output": "{'p': 1, 'i': 1, 'n': 1, 'g': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29002_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026504", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:edX+012+020'", "output": "('edX', '012', '020')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026505", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "6.74, 1", "output": "6.74", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt50", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026506", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'5.9.3'", "output": "'5.9.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026507", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'data/input.gdb/feature_cla'", "output": "'data/input.gdb/feature_cla_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026508", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', -4, 2", "output": "(-3, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026509", "code": "def generate_user_id(first_name: str, last_name: str) -> str:\n    if not first_name:\n        return \"unknown\"\n    elif not last_name:\n        return (first_name[:2] + \"guest\").lower().replace(\" \", \"\")\n    else:\n        return (first_name[0] + last_name).lower().replace(\" \", \"\")\n", "entry_point": "generate_user_id", "input": "'John', 'doesmith'", "output": "'jdoesmith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103118_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9721", "output": "{1, 9721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026511", "code": "def process_info(input_string):\n    char_count = {}\n    for char in input_string:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    return char_count\n", "entry_point": "process_info", "input": "'whwh'", "output": "{'w': 2, 'h': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28397_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026512", "code": "import math\ndef calculate_padding(size):\n    next_power_of_2 = 2 ** math.ceil(math.log2(size))\n    return next_power_of_2 - size\n", "entry_point": "calculate_padding", "input": "3", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17732_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026513", "code": "def highest_non_duplicate_score(scores):\n    score_freq = {}\n    # Count the frequency of each score\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    highest_unique_score = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_unique_score:\n            highest_unique_score = score\n    return highest_unique_score\n", "entry_point": "highest_non_duplicate_score", "input": "[50, 50, 99, 1, 2, 3]", "output": "99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92729_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026514", "code": "def sum_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    a, b = 0, 1\n    sum_fib = a\n    for _ in range(1, N):\n        a, b = b, a + b\n        sum_fib += a\n    return sum_fib\n", "entry_point": "sum_fibonacci_numbers", "input": "7", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13183_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026515", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6207", "output": "{1, 3, 2069, 6207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6206", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6631", "output": "{1, 19, 349, 6631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026517", "code": "from typing import List\ndef longest_divisible_subsequence(nums: List[int]) -> List[int]:\n    n = len(nums)\n    dp = [1] * n\n    prev = [-1] * n\n    for j in range(1, n):\n        for i in range(j):\n            if nums[j] % nums[i] == 0 and dp[i] + 1 > dp[j]:\n                dp[j] = dp[i] + 1\n                prev[j] = i\n    max_len = max(dp)\n    max_ind = dp.index(max_len)\n    res = [0] * max_len\n    index = max_ind\n    for i in range(max_len - 1, -1, -1):\n        res[i] = nums[index]\n        index = prev[index]\n    return res\n", "entry_point": "longest_divisible_subsequence", "input": "[12, 12, 48, 48]", "output": "[12, 12, 48, 48]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72675_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026518", "code": "def format_admin_settings(settings):\n    formatted_settings = \"Admin Site Settings:\\n\"\n    for key, value in settings.items():\n        formatted_settings += f\"- {key.capitalize().replace('_', ' ')}: {value}\\n\"\n    return formatted_settings\n", "entry_point": "format_admin_settings", "input": "{}", "output": "'Admin Site Settings:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102362_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026519", "code": "from typing import Tuple\ndef simulate_drone_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_drone_movement", "input": "'RR'", "output": "(2, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67918_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026520", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "62", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026521", "code": "def process_strings(strings, min_length, max_length):\n    result = {}\n    for string in strings:\n        if min_length <= len(string) <= max_length and any(char.isdigit() for char in string):\n            length = len(string)\n            result[length] = result.get(length, 0) + 1\n    return result\n", "entry_point": "process_strings", "input": "['a1bc', '12', 'ab', 'cd'], 2, 4", "output": "{4: 1, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132122_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7311", "output": "{1, 3, 2437, 7311}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7310", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026523", "code": "def calculate_sum_of_digits(port, connection_key):\n    total_sum = 0\n    for digit in str(port) + str(connection_key):\n        total_sum += int(digit)\n    return total_sum\n", "entry_point": "calculate_sum_of_digits", "input": "999, 8", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102611_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026524", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[98, 99, 100], 2", "output": "99.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65666_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9759", "output": "{1, 3, 3253, 9759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026526", "code": "from typing import List\ndef remove_vendor(vendor_name: str, vendor_list: List[str]) -> bool:\n    if vendor_name in vendor_list:\n        vendor_list.remove(vendor_name)\n        return True\n    return False\n", "entry_point": "remove_vendor", "input": "'VendorX', ['VendorA', 'VendorB', 'VendorC']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14983_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026527", "code": "def highest_sales_day(sales):\n    total_sales = sum(sales)\n    average_sales = total_sales / len(sales)\n    max_sales = 0\n    max_sales_day = 0\n    for i, items_sold in enumerate(sales):\n        if items_sold > max_sales:\n            max_sales = items_sold\n            max_sales_day = i\n    return max_sales_day\n", "entry_point": "highest_sales_day", "input": "[5, 10, 15, 7]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20896_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026528", "code": "def count_file_extensions(file_paths):\n    extension_count = {}\n    for file_path in file_paths:\n        file_name, file_extension = file_path.rsplit('.', 1)\n        file_extension = file_extension.lower()\n        if file_extension in extension_count:\n            extension_count[file_extension] += 1\n        else:\n            extension_count[file_extension] = 1\n    return extension_count\n", "entry_point": "count_file_extensions", "input": "['file1.p', 'file2.p', 'file3.p']", "output": "{'p': 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19521_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026529", "code": "def process_time_series(time_series_data):\n    result = {}\n    for series in time_series_data:\n        sum_values = 0\n        count_values = 0\n        for value in series[\"values\"]:\n            if value >= 0:\n                sum_values += value\n                count_values += 1\n        if count_values > 0:\n            result[series[\"name\"]] = sum_values / count_values\n    return result\n", "entry_point": "process_time_series", "input": "[{'name': 'series1', 'values': [-1, -2, -3]}]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68471_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026530", "code": "def euclid_algorithm(area):\n    \"\"\"Return the largest square to subdivide area by.\"\"\"\n    height = area[0]\n    width = area[1]\n    maxdim = max(height, width)\n    mindim = min(height, width)\n    remainder = maxdim % mindim\n    if remainder == 0:\n        return mindim\n    else:\n        return euclid_algorithm((mindim, remainder))\n", "entry_point": "euclid_algorithm", "input": "(400, 800)", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64166_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026531", "code": "def assign_ranks(scores):\n    score_rank = {}\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    for score in unique_scores:\n        score_rank[score] = rank\n        rank += 1\n    return [score_rank[score] for score in scores]\n", "entry_point": "assign_ranks", "input": "[100, 90, 80, 90, 100, 70, 90, 70]", "output": "[1, 2, 3, 2, 1, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50813_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026532", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(6, 3, 4, 3, 5, 5, 3)", "output": "'6.3.4.3.5.5.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026533", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[7.88]", "output": "7.88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026534", "code": "def calculate_bmi_and_health_risk(weight, height):\n    bmi = weight / (height ** 2)\n    if bmi < 18.5:\n        health_risk = 'Underweight'\n    elif 18.5 <= bmi < 25:\n        health_risk = 'Normal weight'\n    elif 25 <= bmi < 30:\n        health_risk = 'Overweight'\n    elif 30 <= bmi < 35:\n        health_risk = 'Moderately obese'\n    elif 35 <= bmi < 40:\n        health_risk = 'Severely obese'\n    else:\n        health_risk = 'Very severely obese'\n    return bmi, health_risk\n", "entry_point": "calculate_bmi_and_health_risk", "input": "495.13665747774075, 1", "output": "(495.13665747774075, 'Very severely obese')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86783_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026535", "code": "from typing import Any, Dict, List\ndef count_log_levels(log_entries: List[Dict[str, str]]) -> Dict[str, int]:\n    log_level_count = {}\n    for entry in log_entries:\n        log_level = entry.get('level')\n        if log_level in log_level_count:\n            log_level_count[log_level] += 1\n        else:\n            log_level_count[log_level] = 1\n    return log_level_count\n", "entry_point": "count_log_levels", "input": "[{}, {}, {}, {}, {}, {}]", "output": "{None: 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52355_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026536", "code": "def custom_reverse(lst):\n    start = 0\n    end = len(lst) - 1\n    while start < end:\n        lst[start], lst[end] = lst[end], lst[start]\n        start += 1\n        end -= 1\n    return lst\n", "entry_point": "custom_reverse", "input": "[2, 3, 5, 4, 3, 5, 1, 3]", "output": "[3, 1, 5, 3, 4, 5, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123873_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026537", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'par'", "output": "'<p>par</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026538", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'lhoell'", "output": "{'lhoell': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026539", "code": "def calculate_average_excluding_extremes(nums):\n    if len(nums) <= 2:\n        return 0  # Return 0 if the list has 0, 1, or 2 elements\n    # Remove the maximum and minimum values from the list\n    nums.remove(max(nums))\n    nums.remove(min(nums))\n    # Calculate the sum of the remaining values\n    sum_remaining = sum(nums)\n    # Calculate the average\n    average = sum_remaining / len(nums)\n    return average\n", "entry_point": "calculate_average_excluding_extremes", "input": "[4, 6, 5, 9, 5]", "output": "5.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72044_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026540", "code": "def process_event(event: str, values: list) -> str:\n    if event == \"click\":\n        return f\"Clicked with values: {values}\"\n    elif event == \"hover\":\n        return f\"Hovered with values: {values}\"\n    elif event == \"submit\":\n        return f\"Submitted with values: {values}\"\n    else:\n        return \"Unknown event\"\n", "entry_point": "process_event", "input": "'click', [1, 2, 3]", "output": "'Clicked with values: [1, 2, 3]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96210_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2454", "output": "{1, 2, 3, 6, 1227, 818, 2454, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026542", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "46, 30, 58", "output": "46.51611111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026543", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9734", "output": "{1, 2, 4867, 9734, 314, 157, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1891", "output": "{1, 1891, 61, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1890", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026545", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "2.8512000000000004", "output": "2851200000000000400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026546", "code": "def get_planet_name(n):\n    planet_mapping = {\n        1: 'Mercury',\n        2: 'Venus',\n        3: 'Earth',\n        4: 'Mars',\n        5: 'Jupiter',\n        6: 'Saturn',\n        7: 'Uranus',\n        8: 'Neptune'\n    }\n    if 1 <= n <= 8:\n        return planet_mapping[n]\n    else:\n        return \"Invalid Planet Number\"\n", "entry_point": "get_planet_name", "input": "5", "output": "'Jupiter'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97284_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026547", "code": "def calculate_ranks(scores):\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    rank = 1\n    ranks = {}\n    for score in unique_scores:\n        count = score_count[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "calculate_ranks", "input": "[2, 10, 5, 6, 4, 2, 3, 6]", "output": "[7, 1, 4, 2, 5, 7, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130066_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026548", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MMXLV'", "output": "2045", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026549", "code": "def get_gitref(commit_hashes):\n    prefix_count = {}\n    result = []\n    for commit_hash in commit_hashes:\n        for i in range(1, len(commit_hash) + 1):\n            prefix = commit_hash[:i]\n            if prefix in prefix_count:\n                prefix_count[prefix] += 1\n            else:\n                prefix_count[prefix] = 1\n    for commit_hash in commit_hashes:\n        for i in range(1, len(commit_hash) + 1):\n            prefix = commit_hash[:i]\n            if prefix_count[prefix] == 1:\n                result.append(prefix)\n                break\n    return result\n", "entry_point": "get_gitref", "input": "['a1b2c', 'a1b2e', 'a1b2g']", "output": "['a1b2c', 'a1b2e', 'a1b2g']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108012_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026550", "code": "def parse_launches(input_str):\n    launches_dict = {}\n    launches_list = input_str.split(',')\n    for launch_pair in launches_list:\n        date, description = launch_pair.split(':')\n        launches_dict[date] = description\n    return launches_dict\n", "entry_point": "parse_launches", "input": "'2022-01-10:Launch'", "output": "{'2022-01-10': 'Launch'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64743_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026551", "code": "def hex_to_raw(hex_str: str) -> bytes:\n    # Remove whitespaces from the input hexadecimal string\n    hex_str_clean = ''.join(hex_str.split())\n    # Convert the cleaned hexadecimal string to raw bytes\n    raw_bytes = bytes.fromhex(hex_str_clean)\n    return raw_bytes\n", "entry_point": "hex_to_raw", "input": "'44 85 65'", "output": "b'D\\x85e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56876_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026552", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "46, 2", "output": "(23, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026553", "code": "import math\ndef calculate_control_gain(nj, amplitude, frequency):\n    control_gain = nj * (amplitude * frequency)**0.5\n    return control_gain\n", "entry_point": "calculate_control_gain", "input": "10.5734997044498, 1, 1", "output": "10.5734997044498", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136868_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8299", "output": "{1, 8299, 193, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026555", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'pfxxample'", "output": "'App/static/uploads/pfxxample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026556", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1266", "output": "{1, 2, 3, 422, 6, 1266, 211, 633}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026557", "code": "def find_nth_digit(n):\n    if n < 10:\n        return n\n    i = 1\n    length = 0\n    cnt = 9\n    while length + cnt * i < n:\n        length += cnt * i\n        cnt *= 10\n        i += 1\n    num = pow(10, i-1) - 1 + (n - length + 1) // i\n    index = (n - length - 1) % i\n    return int(str(num)[index])\n", "entry_point": "find_nth_digit", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103487_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3871", "output": "{1, 7, 553, 79, 49, 3871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026559", "code": "def decode_named_generators(encoded_string):\n    named_generators = {}\n    pairs = encoded_string.split(',')\n    for pair in pairs:\n        key, value = pair.split('=')\n        named_generators[key] = value\n    return named_generators\n", "entry_point": "decode_named_generators", "input": "'alpha=1,beta=2,aamma=3'", "output": "{'alpha': '1', 'beta': '2', 'aamma': '3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83014_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026560", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "556, 6", "output": "'000556'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026561", "code": "def calculate_positive_product(int_list):\n    product = 1\n    for num in int_list:\n        if num > 0:\n            product *= num\n    return product if product > 1 else 0\n", "entry_point": "calculate_positive_product", "input": "[12, 8]", "output": "96", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63989_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026562", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[2, 4, 6, 6, 7]", "output": "126", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026563", "code": "from datetime import datetime\ndef find_earliest_dates(date_list):\n    dates = [datetime.strptime(date, \"%Y-%m-%d\").date() for date in date_list]\n    earliest_date = datetime.max.date()\n    for date in dates:\n        if date < earliest_date:\n            earliest_date = date\n    earliest_dates = [date.strftime(\"%Y-%m-%d\") for date in dates if date == earliest_date]\n    return earliest_dates\n", "entry_point": "find_earliest_dates", "input": "['2023-11-08', '2023-11-09', '2023-12-01']", "output": "['2023-11-08']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103769_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026564", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5164", "output": "{1, 2, 4, 1291, 5164, 2582}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5163", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026565", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'sales/1001_1002'", "output": "((1001, 1002), 'sales')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6339", "output": "{3, 1, 6339, 2113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1887", "output": "{1, 3, 37, 111, 17, 51, 629, 1887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026568", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7526", "output": "{1, 2, 7526, 71, 106, 142, 3763, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026569", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Even number\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:  # Multiple of 3\n            modified_list.append(num + 10)\n        else:  # Odd number\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[4, 3, 2, 3, 5, 3, 5]", "output": "[16, 13, 4, 13, 125, 13, 125]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144930_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026570", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'The'", "output": "['The']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026571", "code": "def flatten_list(nested_list):\n    flattened_list = []\n    for element in nested_list:\n        if isinstance(element, list):\n            flattened_list.extend(flatten_list(element))\n        else:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_list", "input": "[[[4], 5], [7, [7]], [6, 7, [4]], 6, [5]]", "output": "[4, 5, 7, 7, 6, 7, 4, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17691_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026572", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4294", "output": "{1, 2, 2147, 226, 4294, 38, 113, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4293", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026573", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5826", "output": "{2913, 1, 5826, 2, 3, 6, 971, 1942}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026574", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'ddav_v10.sv'", "output": "'ddav_v11.sv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3175", "output": "{1, 5, 3175, 25, 635, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3174", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026576", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[6.0, 6.0, 7.0, 8.0]", "output": "6.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026577", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8585", "output": "{1, 5, 101, 8585, 17, 1717, 85, 505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026578", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    seen_multiples = set()\n    for num in nums:\n        if (num % 3 == 0 or num % 5 == 0) and num not in seen_multiples:\n            total += num\n            seen_multiples.add(num)\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[3, 5, 15, 20, 30]", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75095_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026579", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6451", "output": "{1, 6451}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026580", "code": "def html_reverse_escape(string):\n    '''Reverse escapes HTML code in string into ASCII text.'''\n    return string.replace(\"&amp;\", \"&\").replace(\"&#39;\", \"'\").replace(\"&quot;\", '\"')\n", "entry_point": "html_reverse_escape", "input": "'I&amp;aposo;m'", "output": "'I&aposo;m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68510_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026581", "code": "def count_package_files(package_data):\n    total_files = sum(len(files) for files in package_data.values())\n    return total_files\n", "entry_point": "count_package_files", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71104_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026582", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5799", "output": "{1, 3, 1933, 5799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5798", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026583", "code": "def format_column_name(raw_column_name, year):\n    raw_column_name = '_'.join(raw_column_name.lower().split())\n    raw_column_name = raw_column_name.replace('_en_{}_'.format(year), '_')\n    formatted_column_name = raw_column_name.replace('\u00e9', 'e')  # Replace accented '\u00e9' with 'e'\n    return formatted_column_name\n", "entry_point": "format_column_name", "input": "'sreves', 2023", "output": "'sreves'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25598_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026584", "code": "def reverse_just_single_quotes(value):\n    result = \"\"\n    i = 0\n    while i < len(value):\n        if value[i:i+5] == \"&#39;\":\n            result += \"'\"\n            i += 4  # Skip the next two characters\n        else:\n            result += value[i]\n        i += 1\n    return result\n", "entry_point": "reverse_just_single_quotes", "input": "'I&#'", "output": "'I&#'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76701_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026585", "code": "def computeLargeMergedDiameters(dic_diamToMerge_costs, limit):\n    dic_mergedDiam = {}\n    dic_reversed_diams = {}\n    sorted_diameters = sorted(dic_diamToMerge_costs.keys())\n    i = 0\n    while i < len(sorted_diameters):\n        current_diameter = sorted_diameters[i]\n        current_cost = dic_diamToMerge_costs[current_diameter]\n        merged_diameter = current_diameter\n        merged_cost = current_cost\n        j = i + 1\n        while j < len(sorted_diameters):\n            next_diameter = sorted_diameters[j]\n            next_cost = dic_diamToMerge_costs[next_diameter]\n            if merged_diameter + next_diameter <= limit:\n                merged_diameter += next_diameter\n                merged_cost += next_cost\n                j += 1\n            else:\n                break\n        dic_mergedDiam[merged_diameter] = merged_cost\n        dic_reversed_diams[merged_diameter] = current_diameter if merged_diameter == current_diameter else sorted_diameters[j - 1]\n        i = j\n    return dic_mergedDiam, dic_reversed_diams\n", "entry_point": "computeLargeMergedDiameters", "input": "{1.5: 30, 0.144: 0}, 1.644", "output": "({1.644: 30}, {1.644: 1.5})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69163_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026586", "code": "from typing import Tuple\ndef split_with_escape(input_str: str, separator: str) -> Tuple[str, str]:\n    key = ''\n    val = ''\n    escaped = False\n    for i in range(len(input_str)):\n        if input_str[i] == '\\\\' and not escaped:\n            escaped = True\n        elif input_str[i] == separator and not escaped:\n            val = input_str[i+1:]\n            break\n        else:\n            if escaped:\n                key += input_str[i]\n                escaped = False\n            else:\n                key += input_str[i]\n    return key, val\n", "entry_point": "split_with_escape", "input": "'a==abz;', ';'", "output": "('a==abz', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12144_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1439", "output": "{1, 1439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026588", "code": "def get_updated_value(filter_condition):\n    metadata = {}\n    if isinstance(filter_condition, str):\n        metadata[filter_condition] = 'default_value'\n    elif isinstance(filter_condition, list):\n        for condition in filter_condition:\n            metadata[condition] = 'default_value'\n    return metadata\n", "entry_point": "get_updated_value", "input": "'fififilterfflier1r3l'", "output": "{'fififilterfflier1r3l': 'default_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97050_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026589", "code": "def parse_command_line(args):\n    parsed_args = {}\n    current_flag = None\n    for arg in args:\n        if arg.startswith('-'):\n            current_flag = arg\n            parsed_args[current_flag] = None\n        else:\n            if current_flag:\n                parsed_args[current_flag] = arg\n                current_flag = None\n    return parsed_args\n", "entry_point": "parse_command_line", "input": "['-p', '0', '-f', 'output.txt']", "output": "{'-p': '0', '-f': 'output.txt'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113595_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026590", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[4, 9, 50, 40, 3]", "output": "[13, 59, 90, 43, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026591", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for index, element in enumerate(input_list):\n        result_list.append(element + index)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[2, 7, 1, 9, 3, 6, 2, 8]", "output": "[2, 8, 3, 12, 7, 11, 8, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111435_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026592", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7652", "output": "{1, 2, 7652, 4, 3826, 1913}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7651", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026593", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1.228'", "output": "'1.228'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026594", "code": "def parse_config_file(file_content: str) -> dict:\n    config_data = {}\n    for line in file_content.strip().split('\\n'):\n        key, value = line.split('=')\n        config_data[key] = value\n    return config_data\n", "entry_point": "parse_config_file", "input": "'key1=new_va\\n'", "output": "{'key1': 'new_va'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73269_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026595", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'exampleexom:443'", "output": "('https', 'exampleexom', 443)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026596", "code": "from typing import List, Dict\ndef process_file_names(file_names: List[str]) -> Dict[str, List[str]]:\n    processed_data = {}\n    for file_name in file_names:\n        base_name, extension = file_name.split('_')\n        version, file_type = extension.split('.')\n        version = '.'.join(version[2:])\n        if base_name not in processed_data:\n            processed_data[base_name] = []\n        processed_data[base_name].append((version, file_name, f\"{base_name}_py{version}.txt\"))\n    return processed_data\n", "entry_point": "process_file_names", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78932_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026597", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'sdetails'", "output": "'sdetails'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026598", "code": "def maxTurbulenceSize(A):\n    ans = 1\n    start = 0\n    for i in range(1, len(A)):\n        c = (A[i-1] > A[i]) - (A[i-1] < A[i])\n        if c == 0:\n            start = i\n        elif i == len(A)-1 or c * ((A[i] > A[i+1]) - (A[i] < A[i+1])) != -1:\n            ans = max(ans, i - start + 1)\n            start = i\n    return ans\n", "entry_point": "maxTurbulenceSize", "input": "[1, 3, 2, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41497_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8438", "output": "{1, 2, 4219, 8438}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8437", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026600", "code": "def card_game(player_a, player_b):\n    rounds_a_won = 0\n    rounds_b_won = 0\n    ties = 0\n    for card_a, card_b in zip(player_a, player_b):\n        if card_a > card_b:\n            rounds_a_won += 1\n        elif card_b > card_a:\n            rounds_b_won += 1\n        else:\n            ties += 1\n    return rounds_a_won, rounds_b_won, ties\n", "entry_point": "card_game", "input": "[5, 6, 2, 1, 0], [3, 4, 3, 2, 1]", "output": "(2, 3, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34362_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026601", "code": "def process_revision(revision):\n    specific_value = 'd09db0106be9'\n    if revision == '<PASSWORD>':\n        return specific_value\n    else:\n        return revision\n", "entry_point": "process_revision", "input": "'ddd91dd0909db01'", "output": "'ddd91dd0909db01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53179_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026602", "code": "def character_frequency(input_string):\n    frequency_dict = {}\n    for char in input_string:\n        if char in frequency_dict:\n            frequency_dict[char] += 1\n        else:\n            frequency_dict[char] = 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "'hello'", "output": "{'h': 1, 'e': 1, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130080_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026603", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'eexexe.on.json'", "output": "'eexexe.on_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026604", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "10, 6", "output": "'Enemy: 10, Own: 6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026605", "code": "def quickSort(A, si, ei):\n    comparison_count = [0]  # Initialize comparison count as a list to allow pass by reference\n    def partition(A, si, ei):\n        x = A[ei]  # x is pivot, last element\n        i = si - 1\n        for j in range(si, ei):\n            comparison_count[0] += 1  # Increment comparison count for each comparison made\n            if A[j] <= x:\n                i += 1\n                A[i], A[j] = A[j], A[i]\n        A[i + 1], A[ei] = A[ei], A[i + 1]\n        return i + 1\n    def _quickSort(A, si, ei):\n        if si < ei:\n            pi = partition(A, si, ei)\n            _quickSort(A, si, pi - 1)\n            _quickSort(A, pi + 1, ei)\n    _quickSort(A, si, ei)\n    return comparison_count[0]\n", "entry_point": "quickSort", "input": "[1, 2], 0, 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125182_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026606", "code": "# Define the add function to add two integers\ndef add(a, b):\n    return a + b\n", "entry_point": "add", "input": "-3, -1", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132304_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026607", "code": "def load_external_repository(repositories, repository):\n    if repository not in repositories:\n        return []\n    dependencies = []\n    for dep in repositories[repository]:\n        dependencies.extend(load_external_repository(repositories, dep))\n    return dependencies + repositories[repository]\n", "entry_point": "load_external_repository", "input": "{'repo1': ['repo2'], 'repo2': []}, 'nonexistent_repo'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82575_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026608", "code": "import typing\ndef circular_sum(input_list: typing.List[int]) -> typing.List[int]:\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4]", "output": "[7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4417_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026609", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[1, 2, 4, 2, 4, 5, 3]", "output": "[1, 4, 16, 4, 16, 125, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026610", "code": "def clamp_numbers(numbers, lower_bound, upper_bound):\n    return [max(lower_bound, min(num, upper_bound)) for num in numbers]\n", "entry_point": "clamp_numbers", "input": "[8, 3, 3, -2, -5, 3], 0, 6", "output": "[6, 3, 3, 0, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51058_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026611", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6224", "output": "{1, 2, 4, 389, 3112, 8, 778, 6224, 16, 1556}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6223", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026612", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "248", "output": "{1, 2, 4, 8, 248, 124, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt247", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026613", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'L3ine\\n\\n'", "output": "[['L3ine']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026614", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "75", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026615", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'Sth', 3", "output": "'Sth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026616", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 5), (2, 5), (3, 5)]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026617", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[8, 9, 10]", "output": "[512, 729, 1000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1969", "output": "{11, 1, 1969, 179}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026619", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7741", "output": "{1, 7741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026620", "code": "# Implement the _deserial method to reverse the serialization process\ndef _deserial(serialized_obj):\n    # Assuming dataserializer.serialize returns a string representation of the object\n    # Here, we simply reverse the serialization by converting the string back to the original object\n    return eval(serialized_obj)\n", "entry_point": "_deserial", "input": "'(10,)'", "output": "(10,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113073_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026621", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "'a'", "output": "('a', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026622", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "0, -6", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026623", "code": "from collections import defaultdict\ndef process_dependencies(dependency_pairs):\n    num_heads = defaultdict(int)\n    tails = defaultdict(list)\n    heads = []\n    for h, t in dependency_pairs:\n        num_heads[t] += 1\n        if h in tails:\n            tails[h].append(t)\n        else:\n            tails[h] = [t]\n            heads.append(h)\n    ordered = [h for h in heads if h not in num_heads]\n    for h in ordered:\n        for t in tails[h]:\n            num_heads[t] -= 1\n            if not num_heads[t]:\n                ordered.append(t)\n    cyclic = [n for n, heads in num_heads.items() if heads]\n    return ordered, cyclic\n", "entry_point": "process_dependencies", "input": "[('d', 'e'), ('k', 'f')]", "output": "(['d', 'k', 'e', 'f'], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128375_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026624", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1707", "output": "{3, 1, 1707, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026625", "code": "def dummy(n):\n    fibonacci_numbers = [0, 1]\n    while len(fibonacci_numbers) < n:\n        next_number = fibonacci_numbers[-1] + fibonacci_numbers[-2]\n        fibonacci_numbers.append(next_number)\n    return fibonacci_numbers[:n]\n", "entry_point": "dummy", "input": "12", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134685_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026626", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.14.23'", "output": "(3, 14, 23)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026627", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6759", "output": "{1, 3, 6759, 9, 2253, 751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026628", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[1, 1, 3, 3, 4, 4, -2, 2]", "output": "[-2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026629", "code": "def feature_match(features1, features2):\n    for feature in features1:\n        if feature in features2:\n            return True\n    return False\n", "entry_point": "feature_match", "input": "['a', 'b', 'c'], ['b', 'd', 'e']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15673_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026630", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "19", "output": "0.29858214173896974", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "463", "output": "{1, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026632", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1219", "output": "{1, 1219, 53, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1218", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026633", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 54", "output": "'54%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5426", "output": "{1, 5426, 2, 2713}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5425", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026635", "code": "from typing import List\ndef most_frequent_bases(dna_sequence: str) -> List[str]:\n    base_count = {}\n    # Count the occurrences of each base\n    for base in dna_sequence:\n        if base in base_count:\n            base_count[base] += 1\n        else:\n            base_count[base] = 1\n    max_count = max(base_count.values())\n    most_frequent_bases = [base for base, count in base_count.items() if count == max_count]\n    return sorted(most_frequent_bases)\n", "entry_point": "most_frequent_bases", "input": "'ATAT'", "output": "['A', 'T']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79013_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026636", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4854", "output": "{1, 2, 3, 6, 809, 1618, 4854, 2427}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026637", "code": "def execute_code(AddrSize):\n    tape = [0] * (2 * AddrSize)  # Initialize tape with zeros\n    def Mark(C, L):\n        if C == L:\n            tape[C] = 0\n            return\n        tape[C] = 1\n        Mark(C + 1, L)\n        tape[C] = 0\n        Mark(C + 1, L)\n    Mark(0, AddrSize)\n    pointer = 0\n    while pointer < len(tape):\n        if tape[pointer] == 1:\n            pointer += 1\n            while tape[pointer] == 1:\n                tape[pointer] = 0\n                pointer += 1\n            tape[pointer] = 1\n        pointer += 1\n    return tape\n", "entry_point": "execute_code", "input": "6", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134403_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026638", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "5, 4", "output": "625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt56", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026639", "code": "def translate_cds_manual(cds: str, translation_table: str) -> str:\n    # Define the standard genetic code mapping codons to amino acids\n    genetic_code = {\n        'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',\n        'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',\n        'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',\n        'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R',\n        'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L',\n        'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P',\n        'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q',\n        'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R',\n        'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V',\n        'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A',\n        'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E',\n        'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G',\n        'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S',\n        'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L',\n        'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_',\n        'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'\n    }\n    # Clean out whitespace and convert the DNA sequence to uppercase\n    cds = \"\".join(cds.split()).upper()\n    # Translate the DNA sequence into a protein sequence using the genetic code\n    protein = ''\n    for i in range(0, len(cds), 3):\n        codon = cds[i:i+3]\n        if codon in genetic_code:\n            amino_acid = genetic_code[codon]\n            if amino_acid != '_':  # Stop codon\n                protein += amino_acid\n            else:\n                break  # Stop translation at the stop codon\n        else:\n            protein += 'X'  # Unknown codon represented as 'X'\n    return protein\n", "entry_point": "translate_cds_manual", "input": "'TTT ZZZ', ''", "output": "'FX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11123_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026640", "code": "def process_queue(tasks, n):\n    time_taken = 0\n    while tasks:\n        processing = tasks[:n]\n        max_time = max(processing)\n        time_taken += max_time\n        tasks = tasks[n:]\n    return time_taken\n", "entry_point": "process_queue", "input": "[2], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31967_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026641", "code": "def custom_wrapper(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            modified_list.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            modified_list.append(\"Fizz\")\n        elif num % 5 == 0:\n            modified_list.append(\"Buzz\")\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "custom_wrapper", "input": "[1, 3, 5, 15, 7, 6]", "output": "[1, 'Fizz', 'Buzz', 'FizzBuzz', 7, 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139069_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026642", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[], 1, 0", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026643", "code": "import re\nfrom typing import List\ndef extract_patterns(input_str: str) -> List[str]:\n    pattern = r'\"(.*?)\"'  # Regular expression pattern to match substrings within double quotes\n    return re.findall(pattern, input_str)\n", "entry_point": "extract_patterns", "input": "'Here is a \"samplee\" in the text.'", "output": "['samplee']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69903_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026644", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[-2, 2, 5, 0, 1, 2, 3, 2]", "output": "[-2, 0, 5, 5, 6, 8, 11, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026645", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "36", "output": "{1, 2, 3, 36, 4, 6, 9, 12, 18}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt35", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026646", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[0, 1, 1, 2, 3, 4, 5, 5, 6]", "output": "[0, 1, 1, 2, 3, 4, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026647", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[1800, 600, 225]", "output": "'0:43:45'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026648", "code": "import re\nBLOCKED_KEYWORDS = [\"apple\", \"banana\", \"orange\"]\ndef replace_blocked_keywords(text):\n    modified_text = text.lower()\n    for keyword in BLOCKED_KEYWORDS:\n        modified_text = re.sub(r'\\b' + re.escape(keyword) + r'\\b', '*' * len(keyword), modified_text, flags=re.IGNORECASE)\n    return modified_text\n", "entry_point": "replace_blocked_keywords", "input": "'lieke'", "output": "'lieke'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141680_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "807", "output": "{1, 3, 269, 807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026650", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "9.4", "output": "277.45040000000006", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026651", "code": "SCRABBLE_LETTER_VALUES = {\n    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8,\n    'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1,\n    'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10\n}\ndef calculate_word_score(word, n):\n    if len(word) == 0:\n        return 0\n    wordScore = 0\n    lettersUsed = 0\n    for theLetter in word:\n        wordScore += SCRABBLE_LETTER_VALUES[theLetter]\n        lettersUsed += 1\n    wordScore *= lettersUsed\n    if lettersUsed == n:\n        wordScore += 50\n    return wordScore\n", "entry_point": "calculate_word_score", "input": "'f', 1", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38596_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7327", "output": "{1, 431, 17, 7327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026653", "code": "def transliterate_lines(source_text, mapping):\n    mapping_dict = dict(pair.split(':') for pair in mapping.split(','))\n    transliterated_text = ''.join(mapping_dict.get(char, char) for char in source_text)\n    return transliterated_text\n", "entry_point": "transliterate_lines", "input": "'k\u0254\u0278\u0278\u028c\u028c', 'k:k,\u0254:\u0254,\u0278:\u0278,\u028c:\u028c'", "output": "'k\u0254\u0278\u0278\u028c\u028c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56181_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026654", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "340", "output": "{1, 2, 34, 4, 5, 68, 170, 10, 17, 340, 85, 20}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt339", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026655", "code": "def compare_versions(version1, version2):\n    v1 = list(map(int, version1.split('.')))\n    v2 = list(map(int, version2.split('.')))\n    for i in range(3):  # Compare major, minor, and patch versions\n        if v1[i] > v2[i]:\n            return \"First version is greater\"\n        elif v1[i] < v2[i]:\n            return \"Second version is greater\"\n    return \"Versions are equal\"\n", "entry_point": "compare_versions", "input": "'1.0.0', '0.9.9'", "output": "'First version is greater'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136117_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026656", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9406", "output": "{1, 2, 9406, 4703}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026657", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[0, 0, 1, 1, 3, 7, 1, 3]", "output": "[0, 1, 2, 4, 10, 8, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113927_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026658", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "6", "output": "['1', '2', '3', '4', '5', '6']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026659", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4341", "output": "{1, 3, 4341, 1447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026660", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7858", "output": "{3929, 1, 7858, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7857", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026661", "code": "import sys\nDEFAULT_SERVER_UPTIME = 21 * 24 * 60 * 60\nMIN_SERVER_UPTIME = 1 * 24 * 60 * 60\nDEFAULT_MAX_APP_LEASE = 7 * 24 * 60 * 60\nDEFAULT_THRESHOLD = 0.9\ndef calculate_total_uptime(lease_durations):\n    total_uptime = 0\n    for lease_duration in lease_durations:\n        server_uptime = min(max(lease_duration, MIN_SERVER_UPTIME), DEFAULT_MAX_APP_LEASE)\n        total_uptime += server_uptime\n    return total_uptime\n", "entry_point": "calculate_total_uptime", "input": "[604800, 604800, 604800, 604800, 604800, 172801]", "output": "3196801", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10263_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026662", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "12", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026663", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 5, 5, 2, 3, 3, 1, 5]", "output": "[9, 10, 7, 5, 6, 4, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026664", "code": "def process_integers(input_list):\n    result = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            result.append(num ** 2)  # Square the even number\n        else:\n            result.append(num ** 3)  # Cube the odd number\n    return result\n", "entry_point": "process_integers", "input": "[5, 1, 1, 7, 6, 4, 5, 1]", "output": "[125, 1, 1, 343, 36, 16, 125, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20560_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026665", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-5, 9, -7, 8, 0, 8, 1, -1]", "output": "[5, -9, 7, -8, 0, -8, -1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026666", "code": "def calculate_word_frequencies(file_content: str) -> dict:\n    word_freq = {}\n    lines = file_content.split('\\n')\n    for line in lines:\n        words = line.split()\n        for word in words:\n            word_freq[word] = word_freq.get(word, 0) + 1\n    sorted_word_freq = dict(sorted(word_freq.items(), key=lambda x: x[1], reverse=True))\n    return sorted_word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'worlrd'", "output": "{'worlrd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100420_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026667", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[3, 1, 1, 5, 3, 1, 1, 1, 1]", "output": "[3, 0, 0, 5, 3, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026668", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[-3, 4, 3, 4, 4, 3, 4, 3], 2, 3", "output": "[-3, 4, 3, 2, 4, 4, 3, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026669", "code": "def calculate_error_rates(acc_rate1, acc_rate5):\n    err_rate1 = 1 - acc_rate1\n    err_rate5 = 1 - acc_rate5\n    return err_rate1, err_rate5\n", "entry_point": "calculate_error_rates", "input": "-4.38, -2.4521616000000006", "output": "(5.38, 3.4521616000000006)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60400_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026670", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7985", "output": "{1, 1597, 5, 7985}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026671", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4511", "output": "{1, 347, 13, 4511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026672", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5345", "output": "{1, 5, 1069, 5345}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5344", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026673", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'theonpen.'", "output": "'theonpen.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026674", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[4, 2, 2, 4, 4, 5, 9, 7]", "output": "[4, 2, 2, 4, 4, 5, 9, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026675", "code": "from collections import Counter\nimport string\ndef find_top_words(text, n):\n    # Tokenize the text into words\n    words = text.lower().translate(str.maketrans('', '', string.punctuation)).split()\n    # Define common English stopwords\n    stop_words = set([\"i\", \"me\", \"my\", \"myself\", \"we\", \"our\", \"ours\", \"ourselves\", \"you\", \"your\", \"yours\", \"yourself\", \"yourselves\", \"he\", \"him\", \"his\", \"himself\", \"she\", \"her\", \"hers\", \"herself\", \"it\", \"its\", \"itself\", \"they\", \"them\", \"their\", \"theirs\", \"themselves\", \"what\", \"which\", \"who\", \"whom\", \"this\", \"that\", \"these\", \"those\", \"am\", \"is\", \"are\", \"was\", \"were\", \"be\", \"been\", \"being\", \"have\", \"has\", \"had\", \"having\", \"do\", \"does\", \"did\", \"doing\", \"a\", \"an\", \"the\", \"and\", \"but\", \"if\", \"or\", \"because\", \"as\", \"until\", \"while\", \"of\", \"at\", \"by\", \"for\", \"with\", \"about\", \"against\", \"between\", \"into\", \"through\", \"during\", \"before\", \"after\", \"above\", \"below\", \"to\", \"from\", \"up\", \"down\", \"in\", \"out\", \"on\", \"off\", \"over\", \"under\", \"again\", \"further\", \"then\", \"once\", \"here\", \"there\", \"when\", \"where\", \"why\", \"how\", \"all\", \"any\", \"both\", \"each\", \"few\", \"more\", \"most\", \"other\", \"some\", \"such\", \"no\", \"nor\", \"not\", \"only\", \"own\", \"same\", \"so\", \"than\", \"too\", \"very\", \"s\", \"t\", \"can\", \"will\", \"just\", \"don\", \"should\", \"now\"])\n    # Remove stopwords from the tokenized words\n    filtered_words = [word for word in words if word not in stop_words]\n    # Count the frequency of each word\n    word_freq = Counter(filtered_words)\n    # Sort the words based on their frequencies\n    sorted_words = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)\n    # Output the top N most frequent words along with their frequencies\n    top_words = sorted_words[:n]\n    return top_words\n", "entry_point": "find_top_words", "input": "'fy', 1", "output": "[('fy', 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52632_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026676", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1329", "output": "{1, 3, 443, 1329}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1328", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026677", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4612", "output": "{1, 2, 2306, 4612, 4, 1153}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4611", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026678", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1286", "output": "{1, 2, 643, 1286}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1285", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026679", "code": "from typing import List\nFILESIZE = 3\nFILESIZE_MULTIPLIER = 4\ndef calculate_total_file_size(file_sizes: List[int]) -> int:\n    total_size = sum(FILESIZE * FILESIZE_MULTIPLIER * size for size in file_sizes)\n    return total_size\n", "entry_point": "calculate_total_file_size", "input": "[195]", "output": "2340", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38012_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026680", "code": "def count_unique_chars(strings):\n    unique_char_counts = {}\n    for string in strings:\n        lowercase_string = string.lower()\n        unique_chars = {char for char in lowercase_string if char.isalpha()}\n        unique_char_counts[string] = len(unique_chars)\n    return unique_char_counts\n", "entry_point": "count_unique_chars", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84696_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026681", "code": "import re\ndef parse_sort_order_from_aux_info(aux_info):\n    pattern = r'/N:(\\d+(?:,\\d+)*)'  # Regular expression pattern to match '/N:x,y,z,...'\n    match = re.search(pattern, aux_info)\n    if match:\n        nums_str = match.group(1)  # Extract the comma-separated integers\n        nums = tuple(map(int, nums_str.split(',')))  # Convert the string of integers to a tuple of integers\n        return nums\n    else:\n        return ()  # Return an empty tuple if the pattern is not found\n", "entry_point": "parse_sort_order_from_aux_info", "input": "'/N:1,2,3,45'", "output": "(1, 2, 3, 45)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64045_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026682", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[3, 3, 4, 6, 5, 4, 7, 6], 4", "output": "[[3, 3, 4, 6], [5, 4, 7, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026683", "code": "import math\ndef calculate_rms(numbers):\n    if not numbers:\n        return None  # Handle empty input list\n    sum_of_squares = sum(num ** 2 for num in numbers)\n    mean_square = sum_of_squares / len(numbers)\n    rms = math.sqrt(mean_square)\n    return rms\n", "entry_point": "calculate_rms", "input": "[4.4860896112315904, -4.4860896112315904]", "output": "4.4860896112315904", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107421_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026684", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6921", "output": "{1, 769, 2307, 3, 6921, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6920", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026685", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'/6'", "output": "('', '6')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026686", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(3, 4, 1, 0, 2, 4)", "output": "'(3.4.1.0.2.4)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026687", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'', '1.11.2', '555'", "output": "'1.11.2.555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026688", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "22", "output": "[11, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026689", "code": "def categorize_fault_type(fault_type):\n    keyword_to_category = {\n        'keypair': 'KeyPair',\n        'publickey': 'PublicKey',\n        'privatekey': 'PrivateKey',\n        'helm-release': 'Helm Release',\n        'install': 'Installation',\n        'delete': 'Deletion',\n        'pod-status': 'Pod Status',\n        'kubernetes-cluster': 'Kubernetes',\n        'connection': 'Connection',\n        'helm-not-updated': 'Helm Version',\n        'helm-version-check': 'Helm Version Check',\n        'helm-not-installed': 'Helm Installation',\n        'check-helm-installed': 'Helm Installation Check',\n        'helm-registry-path-fetch': 'Helm Registry Path',\n        'helm-chart-pull': 'Helm Chart Pull',\n        'helm-chart-export': 'Helm Chart Export',\n        'kubernetes-get-version': 'Kubernetes Version'\n    }\n    categories = []\n    for keyword, category in keyword_to_category.items():\n        if keyword in fault_type:\n            categories.append(category)\n    return categories\n", "entry_point": "categorize_fault_type", "input": "'install helm-not-installed issue'", "output": "['Installation', 'Helm Installation']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138910_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026690", "code": "def calculate_expression(expression):\n    result = 0\n    current_number = 0\n    operator = '+'\n    for char in expression:\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        elif char in ['+', '-']:\n            if operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            operator = char\n    if operator == '+':\n        result += current_number\n    else:\n        result -= current_number\n    return result\n", "entry_point": "calculate_expression", "input": "'280'", "output": "280", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120351_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026691", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[1, 6, 3, 3, 7, 0, 0, 2]", "output": "[1, 7, 10, 13, 20, 20, 20, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026692", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "2, -1", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026693", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "5", "output": "2.2360679775", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3289", "output": "{1, 11, 299, 13, 143, 23, 3289, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026695", "code": "def sum_main_diagonal(matrix):\n    diagonal_sum = 0\n    for i in range(len(matrix)):\n        diagonal_sum += matrix[i][i]\n    return diagonal_sum\n", "entry_point": "sum_main_diagonal", "input": "[[2, 1], [0, 3]]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5519_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3491", "output": "{1, 3491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026697", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8454", "output": "{1, 2, 3, 4227, 2818, 8454, 6, 1409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026698", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6403", "output": "{19, 1, 6403, 337}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026699", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[5, 7, 7, 6, 7, 7, 8, 5]", "output": "[5, 8, 9, 9, 11, 12, 14, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53884_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026700", "code": "def find_nth_ugly_number(n):\n    ugly_nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for i in range(1, n):\n        next_ugly = min(2 * ugly_nums[p2], 3 * ugly_nums[p3], 5 * ugly_nums[p5])\n        ugly_nums.append(next_ugly)\n        if next_ugly == 2 * ugly_nums[p2]:\n            p2 += 1\n        if next_ugly == 3 * ugly_nums[p3]:\n            p3 += 1\n        if next_ugly == 5 * ugly_nums[p5]:\n            p5 += 1\n    return ugly_nums[-1]\n", "entry_point": "find_nth_ugly_number", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106137_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026701", "code": "def modify_list(input_list):\n    input_list.insert(3, 7)  # Insert 7 at index 3\n    input_list.pop()  # Remove the last element\n    input_list.reverse()  # Reverse the list\n    return input_list\n", "entry_point": "modify_list", "input": "[6, 4, 3, 4, 4, 8, 1, 8, 9]", "output": "[8, 1, 8, 4, 4, 7, 3, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29418_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026702", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'2.0'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5299", "output": "{1, 5299, 757, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026704", "code": "def average_string_length(lst):\n    total_length = 0\n    count = 0\n    for item in lst:\n        if isinstance(item, str):\n            total_length += len(item)\n            count += 1\n    if count == 0:\n        return 0\n    average_length = total_length / count\n    return round(average_length)\n", "entry_point": "average_string_length", "input": "['abcdef', 'abcdefgh']", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106752_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026705", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[2, 2, 3, 8, 10, 5, 7, 11]", "output": "[4, 4, 9, 16, 20, 25, 49, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026706", "code": "def calculate_average_grades(grades_list):\n    averages = []\n    for grades in grades_list:\n        if not grades:\n            averages.append(0)\n        else:\n            avg_grade = round(sum(grades) / len(grades))\n            averages.append(avg_grade)\n    return averages\n", "entry_point": "calculate_average_grades", "input": "[[90], [80], [75]]", "output": "[90, 80, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51959_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026707", "code": "def generate_stairs(N):\n    stairs_ = []\n    for i in range(1, N + 1):\n        symb = \"#\" * i\n        empty = \" \" * (N - i)\n        stairs_.append(symb + empty)\n    return stairs_\n", "entry_point": "generate_stairs", "input": "4", "output": "['#   ', '##  ', '### ', '####']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69687_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026708", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4962", "output": "{1, 4962, 2, 3, 6, 2481, 1654, 827}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026709", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'com.example.sena'", "output": "'sena'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026710", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'!eHeHeHe'", "output": "'!eHeHeHe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026711", "code": "def min_jumps(c):\n    jumps = 0\n    i = 0\n    while i < (len(c) - 2):\n        if c[i+2] == 0:\n            i += 2\n        else:\n            i += 1\n        jumps += 1\n    if c[-3] == 1:\n        jumps += 1\n    return jumps\n", "entry_point": "min_jumps", "input": "[0, 0, 1, 0, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90251_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026712", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'iterations: 100, ch_sz: 32'", "output": "{'iterations': '100', 'ch_sz': '32'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1477", "output": "{1, 211, 1477, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1476", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026714", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[10.0]", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026715", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[5, 1, 2, 2]", "output": "[5, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026716", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "90", "output": "{50: 1, 20: 2, 10: 0, 1: 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026717", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "',testtihs!'", "output": "'testtihs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026718", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7873", "output": "{1, 7873}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026719", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9673", "output": "{1, 9673, 17, 569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026720", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'wt'", "output": "{'wt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026721", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'MMCCLIII'", "output": "2253", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026722", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8935", "output": "{1, 1787, 5, 8935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026723", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'uus'", "output": "'uus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026724", "code": "def generate_color_code(input_string: str) -> str:\n    input_string = input_string.lower()\n    # Calculate numerical values based on the characters of the input string\n    r = sum(ord(char) for char in input_string) % 256\n    g = sum(ord(char) * 2 for char in input_string) % 256\n    b = sum(ord(char) * 3 for char in input_string) % 256\n    # Format the RGB components into a valid hexadecimal RGB color code\n    color_code = \"#{:02x}{:02x}{:02x}\".format(r, g, b)\n    return color_code\n", "entry_point": "generate_color_code", "input": "'9'", "output": "'#3972ab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129271_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1678", "output": "{1, 2, 1678, 839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026726", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[1, 3, 3, 7, 7, 9]", "output": "[81, 49, 49, 9, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026727", "code": "from typing import List\ndef reconstruct_sequence(counts: List[int]) -> List[int]:\n    sequence = []\n    for i in range(len(counts)):\n        sequence.extend([i+1] * counts[i])\n    return sequence\n", "entry_point": "reconstruct_sequence", "input": "[1, 3, 1, 3, 2, 3]", "output": "[1, 2, 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4314_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026728", "code": "def calculate_bedroc(y_true, y_pred, alpha):\n    n = len(y_true)\n    scores = list(zip(y_true, y_pred))\n    scores.sort(key=lambda x: x[1], reverse=True)\n    bedroc_sum = 0\n    for i, (true_label, _) in enumerate(scores):\n        bedroc_sum += (1 / n) * (2**(-alpha * (i + 1) / n) * true_label)\n    return bedroc_sum\n", "entry_point": "calculate_bedroc", "input": "[0, 0, 0], [0.1, 0.5, 0.3], alpha=1", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3022_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1597", "output": "{1, 1597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026730", "code": "from typing import List\ndef calculate_derivative(coefficients: List[int]) -> List[int]:\n    derivative = []\n    for i in range(1, len(coefficients)):\n        derivative.append(coefficients[i] * i)\n    return derivative\n", "entry_point": "calculate_derivative", "input": "[0, -1, 4, 4, 6, 5, 4, 4]", "output": "[-1, 8, 12, 24, 25, 24, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27308_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026731", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "9", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4198", "output": "{1, 2, 2099, 4198}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4197", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026733", "code": "from typing import List, Optional\ndef find_unique_integer(items: List[int]) -> Optional[int]:\n    if len(items) == 0:\n        return None\n    unique_integer = items[0]\n    for item in items[1:]:\n        if item != unique_integer:\n            return None\n    return unique_integer\n", "entry_point": "find_unique_integer", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22544_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026734", "code": "def reverse_complement(dna_sequence: str) -> str:\n    # Dictionary mapping each base to its complementary base\n    complement_dict = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}\n    # Reverse the input DNA sequence\n    reversed_sequence = dna_sequence[::-1]\n    # Replace each base with its complementary base\n    reverse_complement_sequence = ''.join(complement_dict[base] for base in reversed_sequence)\n    return reverse_complement_sequence\n", "entry_point": "reverse_complement", "input": "'GGATCG'", "output": "'CGATCC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67367_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5759", "output": "{1, 443, 13, 5759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026736", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "-2147483645, 1", "output": "-2147483645", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026737", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3787", "output": "{1, 3787, 541, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026738", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2927", "output": "{1, 2927}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026739", "code": "from typing import List\ndef filter_integers(lst: List[int], threshold: int) -> List[int]:\n    filtered_list = []\n    for num in lst:\n        if num >= threshold:\n            filtered_list.append(num)\n    return filtered_list\n", "entry_point": "filter_integers", "input": "[1, 10, 20, 15], 10", "output": "[10, 20, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88118_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026740", "code": "import math\ndef find_primes(start, end):\n    is_prime = [True] * (end + 1)\n    is_prime[0] = is_prime[1] = False\n    for num in range(2, int(math.sqrt(end)) + 1):\n        if is_prime[num]:\n            for multiple in range(num * num, end + 1, num):\n                is_prime[multiple] = False\n    primes = [num for num in range(max(2, start), end + 1) if is_prime[num]]\n    return primes\n", "entry_point": "find_primes", "input": "17, 23", "output": "[17, 19, 23]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107581_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026741", "code": "import math\ndef calc_knee_angle(points):\n    def angle_between_vectors(v1, v2):\n        dot_product = v1[0] * v2[0] + v1[1] * v2[1]\n        magnitude_v1 = math.sqrt(v1[0] ** 2 + v1[1] ** 2)\n        magnitude_v2 = math.sqrt(v2[0] ** 2 + v2[1] ** 2)\n        return math.degrees(math.acos(dot_product / (magnitude_v1 * magnitude_v2)))\n    vector1 = [points[1][0] - points[0][0], points[1][1] - points[0][1]]\n    vector2 = [points[2][0] - points[1][0], points[2][1] - points[1][1]]\n    start_angle = angle_between_vectors([1, 0], vector1)\n    knee_angle = angle_between_vectors(vector1, vector2)\n    return round(start_angle), round(knee_angle)\n", "entry_point": "calc_knee_angle", "input": "[(0, 0), (0, 1), (0, -1)]", "output": "(90, 180)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100988_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026742", "code": "def get_type_from_uri_status(uri, status_code):\n    URI = \"/rest/testuri\"\n    TYPE_V200 = \"typeV200\"\n    TYPE_V300 = \"typeV300\"\n    DEFAULT_VALUES = {\n        \"200\": {\"type\": TYPE_V200},\n        \"300\": {\"type\": TYPE_V300}\n    }\n    if status_code in DEFAULT_VALUES and uri == URI:\n        return DEFAULT_VALUES[status_code][\"type\"]\n    else:\n        return \"Unknown\"\n", "entry_point": "get_type_from_uri_status", "input": "'/rest/testuri', '200'", "output": "'typeV200'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6113_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026743", "code": "def count_set_bits(num):\n    count = 0\n    while num:\n        count += num & 1\n        num >>= 1\n    return count\n", "entry_point": "count_set_bits", "input": "0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139196_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026744", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'2.5.0'", "output": "(2, 5, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026745", "code": "from typing import List\ndef find_missing_number(nums: List[int]) -> int:\n    n = len(nums) + 1\n    expected_sum = n * (n + 1) // 2\n    total_sum = sum(nums)\n    missing_number = expected_sum - total_sum\n    return missing_number\n", "entry_point": "find_missing_number", "input": "list(range(1, 33))", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101660_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026746", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'<p>b&gt;</p>'", "output": "'b>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026747", "code": "def highest_performance_score(scores):\n    if not scores:\n        return None\n    max_score = scores[0]  # Initialize max_score with the first score in the list\n    for score in scores:\n        if score > max_score:\n            max_score = score\n    return max_score\n", "entry_point": "highest_performance_score", "input": "[80, 95, 97, 90]", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109212_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026748", "code": "def format_package_info(package_config):\n    name = package_config.get(\"name\", \"\")\n    version = package_config.get(\"version\", \"\")\n    entry_points = package_config.get(\"entry_points\", {})\n    console_script = entry_points.get(\"console_scripts\", [\"\"])[0]\n    formatted_string = f\"Package: {name}\\nVersion: {version}\\nConsole Script: {console_script}\"\n    return formatted_string\n", "entry_point": "format_package_info", "input": "{}", "output": "'Package: \\nVersion: \\nConsole Script: '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1307_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026749", "code": "def extract_app_name(default_app_config):\n    # Split the input string using dot as the delimiter\n    config_parts = default_app_config.split('.')\n    # Extract the app name from the first part\n    app_name = config_parts[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'dngo_miapps.some_other_config'", "output": "'dngo_miapps'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64209_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026750", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "123, {123: 1}", "output": "'123-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026751", "code": "def parse_frame_message(frame_message):\n    message_type = frame_message[0]\n    if message_type in ['t', 'T']:\n        return frame_message[5:]  # Extract the payload starting from index 5\n    elif message_type in ['r', 'R']:\n        return frame_message[1:]  # Extract the identifier starting from index 1\n    else:\n        return \"Invalid message type\"\n", "entry_point": "parse_frame_message", "input": "'t1234'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84884_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026752", "code": "from typing import List\nimport heapq\ndef reconstruct_sequence(freq_list: List[int]) -> List[int]:\n    pq = []\n    for i, freq in enumerate(freq_list):\n        heapq.heappush(pq, (freq, i+1))\n    result = []\n    while pq:\n        freq, elem = heapq.heappop(pq)\n        result.append(elem)\n        freq -= 1\n        if freq > 0:\n            heapq.heappush(pq, (freq, elem))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[1, 1]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41932_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026753", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[2, 5, 4, 6, 13, 5, 2, 3, 2]", "output": "'1435=4121'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026754", "code": "def fibonacci_sum(n: int) -> int:\n    if n <= 0:\n        return 0\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    sum_fib = 1  # Initialize sum with the second term (1)\n    prev, curr = 0, 1  # Initialize the first two terms\n    for _ in range(2, n):\n        next_term = prev + curr\n        sum_fib += next_term\n        prev, curr = curr, next_term\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "13", "output": "376", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76019_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026755", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5745", "output": "{1, 3, 5, 15, 5745, 1915, 1149, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5744", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026756", "code": "def count_word_occurrences(text):\n    # Convert text to lowercase for case insensitivity\n    text = text.lower()\n    # Tokenize the text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through the words and update the counts\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_occurrences", "input": "'pyhhonlworpy'", "output": "{'pyhhonlworpy': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52489_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026757", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[18, 5, 9, 18, 5, 6, 7, 6, 15]", "output": "[5, 5, 6, 6, 7, 9, 15, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026758", "code": "def extract_versions(dependencies):\n    component_versions = {}\n    for component, version in dependencies:\n        if component in component_versions:\n            if version > component_versions[component]:\n                component_versions[component] = version\n        else:\n            component_versions[component] = version\n    return component_versions\n", "entry_point": "extract_versions", "input": "[('00521', 'core'), ('00521', '1.0'), ('00521', '0.5')]", "output": "{'00521': 'core'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55419_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026759", "code": "def convert_to_short_prefix(long_variable_name):\n    mappings = {\n        \"SHORT_NEW_TABLE_PREFIX\": \"n!\",\n        \"SHORT_DELTA_TABLE_PREFIX\": \"c!\",\n        \"SHORT_RENAMED_TABLE_PREFIX\": \"o!\",\n        \"SHORT_INSERT_TRIGGER_PREFIX\": \"i!\",\n        \"SHORT_UPDATE_TRIGGER_PREFIX\": \"u!\",\n        \"SHORT_DELETE_TRIGGER_PREFIX\": \"d!\",\n        \"OSC_LOCK_NAME\": \"OnlineSchemaChange\"\n    }\n    return mappings.get(long_variable_name, \"Unknown\")\n", "entry_point": "convert_to_short_prefix", "input": "'OSC_LOCK_NAME'", "output": "'OnlineSchemaChange'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139316_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026760", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[10, 9, 2, 1, 10, 9, 7, 9, 11]", "output": "[1, 2, 7, 9, 9, 9, 10, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026761", "code": "from typing import List\ndef process_data(data: List[int]) -> int:\n    result = 0\n    for num in data:\n        doubled_num = num * 2\n        if doubled_num % 3 == 0:\n            squared_num = doubled_num ** 2\n            result += squared_num\n    return result\n", "entry_point": "process_data", "input": "[3, 3]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27077_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026762", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2084", "output": "{1, 2, 2084, 4, 521, 1042}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2083", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026763", "code": "def power(x, n):\n    p = 1\n    for i in range(n):\n        p *= x\n    return p\n", "entry_point": "power", "input": "2, 8", "output": "256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145971_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026764", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1193", "output": "{1, 1193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5539", "output": "{1, 5539, 29, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5538", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026766", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[38, 25, 27, 8, 37]", "output": "[8, 25, 27, 37, 38]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026767", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2341", "output": "{1, 2341}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2340", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026768", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2021", "output": "{1, 43, 2021, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2020", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026769", "code": "from typing import List\ndef calculate_top_players_average(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_score = sorted_scores[N-1]\n    count_top_score = sorted_scores.count(top_score)\n    sum_top_scores = sum(sorted_scores[:sorted_scores.index(top_score) + count_top_score])\n    average = sum_top_scores / count_top_score\n    return average\n", "entry_point": "calculate_top_players_average", "input": "[557, 557, 557, 557, 557], 3", "output": "557.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54118_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026770", "code": "from typing import List\ndef above_average_scores(scores: List[int]) -> List[int]:\n    if not scores:\n        return []\n    average_score = sum(scores) / len(scores)\n    above_average = [score for score in scores if score > average_score]\n    return above_average\n", "entry_point": "above_average_scores", "input": "[70, 75, 76, 70, 80, 90, 85]", "output": "[80, 90, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44803_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026771", "code": "def calculate_meditation_time(level: int) -> int:\n    # Each hero meditation cycle takes 10 seconds to complete\n    time_per_cycle = 10\n    total_time = level * time_per_cycle\n    return total_time\n", "entry_point": "calculate_meditation_time", "input": "4", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5039_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026772", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0 and num % 3 == 0:\n            modified_list.append(num * 5)\n        elif num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 3 == 0:\n            modified_list.append(num ** 3)\n        else:\n            modified_list.append(num)\n    return modified_list\n", "entry_point": "process_integers", "input": "[4, 12, 4, 8, 7, 3, 3, 7, 4]", "output": "[16, 60, 16, 64, 7, 27, 27, 7, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2885_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026773", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[10, 10, 14]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026774", "code": "def calculate_total_nft_value(transactions):\n    total_value = sum(transaction[\"value\"] for transaction in transactions)\n    return total_value\n", "entry_point": "calculate_total_nft_value", "input": "[{'value': 50}, {'value': 25}]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24676_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6191", "output": "{151, 1, 41, 6191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6190", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026776", "code": "def can_reach_end(steps):\n    max_reach = 0\n    for i in range(len(steps)):\n        if i > max_reach:\n            return False\n        max_reach = max(max_reach, i + steps[i])\n        if max_reach >= len(steps) - 1:\n            return True\n    return False\n", "entry_point": "can_reach_end", "input": "[0, 1]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17546_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026777", "code": "def calculate_remaining_balance(balance, annualInterestRate, monthlyPaymentRate):\n    for _ in range(12):\n        min_payment = monthlyPaymentRate * balance\n        unpaid_balance = balance - min_payment\n        balance = unpaid_balance * (1 + annualInterestRate / 12)\n    return round(balance, 2)\n", "entry_point": "calculate_remaining_balance", "input": "100.0, 0.0, 1.0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101986_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026778", "code": "def convert_log_levels(log_levels):\n    log_mapping = {0: 'DEBUG', 1: 'INFO', 2: 'WARNING', 3: 'ERROR'}\n    log_strings = [log_mapping[level] for level in log_levels]\n    return log_strings\n", "entry_point": "convert_log_levels", "input": "[1, 3, 0, 3, 0]", "output": "['INFO', 'ERROR', 'DEBUG', 'ERROR', 'DEBUG']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93726_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026779", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[4, 3, 2, 2, 2, 2, 1]", "output": "[16, 9, 4, 4, 4, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026780", "code": "DOMAIN = \"fitx\"\nICON = \"mdi:weight-lifter\"\nCONF_LOCATIONS = 'locations'\nCONF_ID = 'id'\nATTR_ADDRESS = \"address\"\nATTR_STUDIO_NAME = \"studioName\"\nATTR_ID = CONF_ID\nATTR_URL = \"url\"\nDEFAULT_ENDPOINT = \"https://www.fitx.de/fitnessstudios/{id}\"\nREQUEST_METHOD = \"GET\"\nREQUEST_AUTH = None\nREQUEST_HEADERS = None\nREQUEST_PAYLOAD = None\nREQUEST_VERIFY_SSL = True\ndef generate_fitx_url(location, id):\n    url = DEFAULT_ENDPOINT.replace('{id}', str(id))\n    return url.format(id=id)\n", "entry_point": "generate_fitx_url", "input": "location='AnyLocation', id=12341", "output": "'https://www.fitx.de/fitnessstudios/12341'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22630_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026781", "code": "def handle_message(message):\n    message_actions = {\n        \"Sorry we couldn't find that article.\": \"No action\",\n        \"You can't report your article.\": \"No action\",\n        \"Only Admins can delete a reported article\": \"No action\",\n        \"You are not allowed to report twice\": \"No action\",\n        \"You successfully deleted the article\": \"Delete article\",\n        \"Only Admins can get reported article\": \"Get reported article\"\n    }\n    return message_actions.get(message, \"Unknown message\")\n", "entry_point": "handle_message", "input": "'Only Admins can get reported article'", "output": "'Get reported article'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51721_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2287", "output": "{1, 2287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2286", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026783", "code": "from typing import List\ndef process_list(input_list: List[int], add_value: int, multiply_factor: int) -> List[int]:\n    modified_list = []\n    for num in input_list:\n        modified_num = (num + add_value) * multiply_factor\n        modified_list.append(modified_num)\n    return modified_list\n", "entry_point": "process_list", "input": "[2, 3, 4], 4, 2", "output": "[12, 14, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99923_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2110", "output": "{1, 2, 5, 422, 10, 211, 2110, 1055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2109", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026785", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[2, 4, 3, 4, 3, 3, 4]", "output": "[6, 7, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026786", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[9, 2, 3, 3, 2, 11]", "output": "{(9, 2, 3), (3, 2, 11)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026787", "code": "def fibonacci_iterative(num):\n    if num <= 0:\n        return None\n    if num == 1:\n        return 0\n    if num == 2:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, num):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci_iterative", "input": "6", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73606_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026788", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4759", "output": "{1, 4759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4758", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5819", "output": "{1, 11, 529, 23, 5819, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026790", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6319", "output": "{89, 1, 71, 6319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026791", "code": "def parse_setup_dict(setup_dict):\n    package_name = setup_dict.get('name', '')\n    author = setup_dict.get('author', '')\n    dependencies = setup_dict.get('install_requires', [])\n    return package_name, author, dependencies\n", "entry_point": "parse_setup_dict", "input": "{}", "output": "('', '', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103935_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026792", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'hello'", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026793", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'0.50.0'", "output": "(0, 50, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026794", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[4, 3, 2, 4, 3, 1, 4, 1, 3]", "output": "[7, 5, 6, 7, 4, 5, 5, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026795", "code": "def parse_config_file(config_data: str) -> dict:\n    config_dict = {}\n    for line in config_data.split('\\n'):\n        line = line.strip()\n        if line and not line.startswith('#'):\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip()\n    return config_dict\n", "entry_point": "parse_config_file", "input": "'DB_HOST=localhost'", "output": "{'DB_HOST': 'localhost'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101724_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026796", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'*Title*Company *Name*'", "output": "('', 'Title*Company *Name*')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1507", "output": "{11, 1, 137, 1507}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1506", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026798", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "504403158265495558", "output": "'qsttag_hunt_down_fugitive'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026799", "code": "import re\ndef process_html_string(input_str):\n    # Remove HTML tags\n    processed_str = re.sub(\"(<([^>]+)>)\", \"\", input_str)\n    # Replace escape sequences with corresponding characters\n    processed_str = processed_str.replace('&nbsp;', \" \") \\\n                                .replace('&lt;', \"<\") \\\n                                .replace('&gt;', \">\") \\\n                                .replace('&amp;', \"&\") \\\n                                .replace('&quot;', '\"')\n    return processed_str\n", "entry_point": "process_html_string", "input": "'<span>HHelello</span>'", "output": "'HHelello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30108_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3644", "output": "{1, 2, 4, 911, 3644, 1822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3643", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026801", "code": "def calculate_similarity(v1, v2, cost_factor):\n    similarity_score = 0\n    for val1, val2 in zip(v1, v2):\n        dot_product = val1 * val2\n        cost = abs(val1 - val2)\n        similarity_score += dot_product * cost_factor * cost\n    return similarity_score\n", "entry_point": "calculate_similarity", "input": "[1, 1], [1, 1], 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115100_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026802", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'quick'", "output": "'quick'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "553", "output": "{1, 7, 79, 553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026804", "code": "def character_count(strings):\n    counts = {}\n    for string in strings:\n        count = sum(1 for char in string if char.isalpha())\n        counts[string] = count\n    return counts\n", "entry_point": "character_count", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117648_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026805", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'ld!'", "output": "'<strong>ld!</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026806", "code": "def sortArrayByParity(A):\n    return sorted(A, key=lambda x: (x % 2 == 0, x if x % 2 == 0 else -x))\n", "entry_point": "sortArrayByParity", "input": "[1, 1, 1, 0, 2, 2, 2, 4, 4]", "output": "[1, 1, 1, 0, 2, 2, 2, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57118_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026807", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'pet', 'jaj', 'ssmitmsit'", "output": "'Pet Jaj Ssmitmsit'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026808", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'string'", "output": "'string'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026809", "code": "def calculate_sums(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i < len(input_list) - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "calculate_sums", "input": "[5, 2, 3, 7]", "output": "[7, 5, 10, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117452_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026810", "code": "import re\ndef doCssContentCompress(css_content):\n    # CSS compression algorithm\n    css_content = re.sub(r'\\s*([{};])\\s*', r'\\1', css_content)  # Remove unnecessary whitespace\n    css_content = re.sub(r',\\s*', ',', css_content)  # Remove whitespace after commas\n    css_content = re.sub(r'\\s*([{}])\\s*', r'\\1', css_content)  # Remove whitespace inside selectors\n    # Handle specific scenarios for margin and padding compression\n    if 'margin' in css_content:\n        css_content = re.sub(r'margin:\\s*([^;]+)', r'margin:\\1', css_content)\n    if 'padding' in css_content:\n        css_content = re.sub(r'padding:\\s*([^;]+)', r'padding:\\1', css_content)\n    return css_content\n", "entry_point": "doCssContentCompress", "input": "'sold'", "output": "'sold'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9038_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026811", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'ffofffbr'", "output": "'ffofffbr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026812", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    top_three = sorted_scores[:3]\n    return top_three\n", "entry_point": "top_three_scores", "input": "[42, 42, 39, 35, 30]", "output": "[42, 42, 39]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108529_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026813", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-2, 10, 4, 4, -7, -2, 0, 9]", "output": "[-7, -2, -2, 0, 4, 4, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026814", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[74, 74, 74, 74, 74, 74, 74, 74, 75]", "output": "74.11111111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21931_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026815", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'hhttp:https://examm', '1111//edede1'", "output": "'hhttp:https://examm/1111//edede1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026816", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'30.1.30'", "output": "(30, 1, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135428_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026817", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1775", "output": "{1, 355, 5, 71, 1775, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1774", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026818", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9043", "output": "{1, 9043}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "591", "output": "{1, 3, 197, 591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026820", "code": "def url_format(slug):\n    return slug.replace(\" \", \"_\")\n", "entry_point": "url_format", "input": "'heollo'", "output": "'heollo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48334_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026821", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8002", "output": "{4001, 1, 8002, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8001", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026822", "code": "def extract_major_version(version: str) -> int:\n    dot_index = version.find('.')\n    if dot_index == -1:\n        return int(version)\n    return int(version[:dot_index])\n", "entry_point": "extract_major_version", "input": "'101'", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116121_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3499", "output": "{1, 3499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3498", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026824", "code": "def encrypt(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha() and char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt", "input": "'abcxyz', 2", "output": "'cdezab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87639_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026825", "code": "import re\ndef process_text(input_text: str) -> str:\n    # Remove all characters that are not Cyrillic or alphanumeric\n    processed_text = re.sub(r\"[^\u0430-\u044f\u0410-\u042f0-9 ]+\", \"\", input_text)\n    # Replace double spaces with a single space\n    processed_text = re.sub('(  )', ' ', processed_text)\n    # Replace \"\\r\\n\" with a space\n    processed_text = processed_text.replace(\"\\r\\n\", \" \")\n    return processed_text\n", "entry_point": "process_text", "input": "'\u042d\u0442\u043e'", "output": "'\u042d\u0442\u043e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100805_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026826", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "1, 5", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026827", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8135", "output": "{1, 1627, 5, 8135}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026828", "code": "import heapq\ndef reconstruct_sequence(freq_list):\n    heap = [(freq, num) for num, freq in enumerate(freq_list, 1) if freq > 0]\n    heapq.heapify(heap)\n    result = []\n    while heap:\n        freq, num = heapq.heappop(heap)\n        result.append(num)\n        if freq - 1 > 0:\n            heapq.heappush(heap, (freq - 1, num))\n    return result\n", "entry_point": "reconstruct_sequence", "input": "[2, 2, 0, 1, 1, 0, 3, 1, 1]", "output": "[4, 5, 8, 9, 1, 1, 2, 2, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62820_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8459", "output": "{11, 1, 8459, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026830", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[1, 1, 3, 3, 4, 4]", "output": "[1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8238", "output": "{1, 2, 3, 6, 8238, 4119, 2746, 1373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8237", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026832", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'Au-79'", "output": "'Au'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026833", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026834", "code": "def calculate_average_dimensions(sizes_test):\n    total_height = sum(dimensions[0] for dimensions in sizes_test)\n    total_width = sum(dimensions[1] for dimensions in sizes_test)\n    num_images = len(sizes_test)\n    average_height = round(total_height / num_images, 2)\n    average_width = round(total_width / num_images, 2)\n    return (average_height, average_width)\n", "entry_point": "calculate_average_dimensions", "input": "[(100, 150), (105, 155), (105, 165)]", "output": "(103.33, 156.67)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95103_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026835", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "15", "output": "4.777314267823516", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026836", "code": "def lcm(numbers):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    def lcm_two_numbers(x, y):\n        return x * y // gcd(x, y)\n    result = 1\n    for num in numbers:\n        result = lcm_two_numbers(result, num)\n    return result\n", "entry_point": "lcm", "input": "[8, 3, 25, 13]", "output": "7800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84681_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1035", "output": "{1, 3, 5, 69, 9, 1035, 45, 207, 15, 115, 23, 345}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026838", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "6, 7", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026839", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7034", "output": "{1, 7034, 2, 3517}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026840", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[5, 9, 4, 6, 8, 5, 4, 8], 2", "output": "[[5, 9], [4, 6], [8, 5], [4, 8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026841", "code": "from typing import List, Dict\ndef parse_admin_attributes(attributes: List[str]) -> Dict[str, str]:\n    attribute_mapping = {}\n    for attribute_str in attributes:\n        attribute_name, attribute_value = attribute_str.split('=')\n        attribute_mapping[attribute_name.strip()] = attribute_value.strip()\n    return attribute_mapping\n", "entry_point": "parse_admin_attributes", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121439_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026842", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "456, 'any_interface'", "output": "'acl/456/interfaces'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026843", "code": "def extract_config_info(config_str):\n    parts = config_str.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "extract_config_info", "input": "'walfigCow'", "output": "('walfigCow', 'walfigCow')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24681_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026844", "code": "def sum_of_primes  (lst):\n    def is_prime(num):\n        if num < 2:\n            return False\n        for i in range(2, int(num ** 0.5) + 1):\n            if num % i == 0:\n                return False\n        return True\n    prime_sum = 0\n    for num in lst:\n        if is_prime(num):\n            prime_sum += num\n    return prime_sum\n", "entry_point": "sum_of_primes", "input": "[5, 7, 11, 13, 2]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_963_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026845", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'10.10.10'", "output": "'10.10.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026846", "code": "def convert_to_hex(dataInInt):\n    hex_string = format(dataInInt, '016x')  # Convert integer to 16-character hexadecimal string\n    return hex_string\n", "entry_point": "convert_to_hex", "input": "39", "output": "'0000000000000027'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14001_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026847", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'91.9.0'", "output": "'91.9.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026848", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7, 8, 8, 8, 8, 9, 9, 10]", "output": "[7, 8, 8, 8, 8, 9, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt49", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026849", "code": "def process_strings(input_list):\n    output_list = []\n    for line in input_list:\n        parts = line.split()\n        integers = [int(num) for num in parts if num.isdigit()]  # Extract integers from the line\n        text = ' '.join([part for part in parts if not part.isdigit()])  # Extract text from the line\n        # Calculate the sum of integers in the line\n        sum_integers = sum(integers)\n        # Append the formatted string to the output list\n        output_list.append(f'{text.strip()} - {sum_integers}')\n    return output_list\n", "entry_point": "process_strings", "input": "['Ao5the5', 'AoA']", "output": "['Ao5the5 - 0', 'AoA - 0']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103074_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026850", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmo.optionptofi'", "output": "('rdmo', 'optionptofi')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026851", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[6, 1, 1, 5, 5, 2, 6, 2, 6]", "output": "[36, 1, 1, 125, 125, 4, 36, 4, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5167", "output": "{1, 5167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026853", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5177", "output": "{1, 31, 167, 5177}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5176", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026854", "code": "def process_json_data(json_data):\n    dataset_name = json_data.get('Dataset Name', None)\n    sequence_name_list = json_data.get('Sequence Name List', None)\n    if 'Sequences' not in json_data:\n        json_data['Sequences'] = []\n    return dataset_name, sequence_name_list\n", "entry_point": "process_json_data", "input": "{}", "output": "(None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16496_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026855", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5947", "output": "{19, 1, 5947, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026856", "code": "def longest_consecutive_subsequence(lst):\n    if not lst:\n        return []\n    lst.sort()\n    current_subsequence = [lst[0]]\n    longest_subsequence = []\n    for i in range(1, len(lst)):\n        if lst[i] == current_subsequence[-1] + 1:\n            current_subsequence.append(lst[i])\n        else:\n            if len(current_subsequence) > len(longest_subsequence):\n                longest_subsequence = current_subsequence\n            current_subsequence = [lst[i]]\n    if len(current_subsequence) > len(longest_subsequence):\n        longest_subsequence = current_subsequence\n    return longest_subsequence\n", "entry_point": "longest_consecutive_subsequence", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16310_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026857", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 7, 9, 3, 7, 7, 4, 8, 5]", "output": "[4, 8, 11, 6, 11, 12, 10, 15, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67396_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026858", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1523", "output": "{1, 1523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026859", "code": "def posix_quote_filter(input_string):\n    # Escape single quotes by doubling them\n    escaped_string = input_string.replace(\"'\", \"''\")\n    # Enclose the modified string in single quotes\n    return f\"'{escaped_string}'\"\n", "entry_point": "posix_quote_filter", "input": "'nic!'", "output": "\"'nic!'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125649_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026860", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'dolor', 5", "output": "'dolor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026861", "code": "def validBraces(string):\n    valid = {'(': ')', '[': ']', '{': '}'}\n    stack = []\n    for char in string:\n        if char in valid:\n            stack.append(char)\n        elif stack and valid[stack[-1]] == char:\n            stack.pop()\n        else:\n            return False\n    return len(stack) == 0\n", "entry_point": "validBraces", "input": "'{[()]}'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70139_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026862", "code": "def calculate_values(lat_interval, lon_interval):\n    lat = (lat_interval[0] + lat_interval[1]) / 2\n    lon = (lon_interval[0] + lon_interval[1]) / 2\n    lat_err = abs(lat_interval[1] - lat_interval[0]) / 2\n    lon_err = abs(lon_interval[1] - lon_interval[0]) / 2\n    return lat, lon, lat_err, lon_err\n", "entry_point": "calculate_values", "input": "(50, 60), (140, 150)", "output": "(55.0, 145.0, 5.0, 5.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82906_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026863", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'studenprimary'", "output": "'studenprimary'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026864", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'sID:Ucet'", "output": "'sID:Ucet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026865", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "701", "output": "{1, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt700", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026866", "code": "def manipulate_list(lst):\n    if not lst:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1][::-1]\n", "entry_point": "manipulate_list", "input": "[0, 6, 9, 1, 10]", "output": "[1, 9, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67882_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026867", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'app.config.eag'", "output": "'eag'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026868", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7237", "output": "{1, 7237}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7236", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026869", "code": "def banner_text(text, char):\n    if not text:\n        return \"\"\n    banner_length = len(text) + 4  # 2 characters padding on each side\n    top_bottom_banner = char * banner_length\n    middle_banner = f\"{char} {text} {char}\"\n    return f\"{top_bottom_banner}\\n{middle_banner}\\n{top_bottom_banner}\"\n", "entry_point": "banner_text", "input": "'', '*'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1086_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026870", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'text.'", "output": "'Text.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026871", "code": "def min_sum_of_squared_differences(a):\n    s = float(\"inf\")\n    for i in range(min(a), max(a) + 1):\n        t = 0\n        for j in a:\n            t += (j - i) ** 2\n        s = min(s, t)\n    return s\n", "entry_point": "min_sum_of_squared_differences", "input": "[1, 3, 5, 8, 10]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139350_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026872", "code": "def count_sentences(input_string):\n    ENDINGS = ['.', '!', '?', ';']\n    sentence_count = 0\n    in_sentence = False\n    for char in input_string:\n        if char in ENDINGS:\n            if not in_sentence:\n                sentence_count += 1\n                in_sentence = True\n        else:\n            in_sentence = False\n    return sentence_count\n", "entry_point": "count_sentences", "input": "\"Hello! How are you? I'm fine.\"", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127733_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026873", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'CC', 2", "output": "'EE'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026874", "code": "def remove_consecutive_spaces(input_str):\n    input_list = list(input_str)\n    i = 0\n    while i <= len(input_list) - 1:\n        if input_list[i] == ' ' and input_list[i - 1] == ' ':\n            del input_list[i]\n        else:\n            i += 1\n    modified_str = ''.join(input_list)\n    return modified_str\n", "entry_point": "remove_consecutive_spaces", "input": "'Hello    '", "output": "'Hello '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92998_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026875", "code": "from typing import Tuple\nimport math\ndef calculate_distance(point1: Tuple[int, int], point2: Tuple[int, int]) -> float:\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0), (6, 4)", "output": "7.211102550927978", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60623_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026876", "code": "from typing import List\ndef add_index_to_element(lst: List[int]) -> List[int]:\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[0, 1, 3, 0, 1, 1]", "output": "[0, 2, 5, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105781_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026877", "code": "def extract_module_names(import_statements):\n    module_names = set()\n    for statement in import_statements:\n        components = statement.split()\n        if components[0] == 'from':\n            module_name = components[1]\n            if components[2] == 'import':\n                module_name += '.' + components[3]\n        else:\n            module_name = components[1]\n        module_names.add(module_name)\n    return module_names\n", "entry_point": "extract_module_names", "input": "['import sys', 'import os', 'import numpy']", "output": "{'os', 'sys', 'numpy'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72926_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5493", "output": "{1, 3, 5493, 1831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5492", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026879", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[60, 65]", "output": "62.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21931_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026880", "code": "def calculate_string_difference(str1, str2):\n    len1, len2 = len(str1), len(str2)\n    max_len = max(len1, len2)\n    diff_count = 0\n    for i in range(max_len):\n        char1 = str1[i] if i < len1 else None\n        char2 = str2[i] if i < len2 else None\n        if char1 != char2:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_string_difference", "input": "'abcdefghi', 'xyzxyzxyz'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32682_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026881", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'hhelhe:wo'", "output": "['hhelhe', 'wo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7389", "output": "{1, 3, 9, 821, 7389, 2463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7388", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026883", "code": "def get_repo_name_from_url(url: str) -> str:\n    if not url:\n        return None\n    last_slash_index = url.rfind(\"/\")\n    last_suffix_index = url.rfind(\".git\")\n    if last_suffix_index < 0:\n        last_suffix_index = len(url)\n    if last_slash_index < 0 or last_suffix_index <= last_slash_index:\n        raise Exception(\"Invalid repo url {}\".format(url))\n    return url[last_slash_index + 1:last_suffix_index]\n", "entry_point": "get_repo_name_from_url", "input": "'https://github.com/username/project.git'", "output": "'project'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4595_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2597", "output": "{1, 2597, 7, 49, 371, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026885", "code": "def rock_paper_scissors(player1_choice, player2_choice):\n    if player1_choice == player2_choice:\n        return \"Tie\"\n    elif (player1_choice == \"rock\" and player2_choice == \"scissors\") or \\\n         (player1_choice == \"scissors\" and player2_choice == \"paper\") or \\\n         (player1_choice == \"paper\" and player2_choice == \"rock\"):\n        return \"Player 1\"\n    else:\n        return \"Player 2\"\n", "entry_point": "rock_paper_scissors", "input": "'rock', 'scissors'", "output": "'Player 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1648", "output": "{1, 2, 4, 103, 8, 206, 1648, 16, 824, 412}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1647", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026887", "code": "def generate_fibonacci_sequence(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "1", "output": "[0, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32126_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026888", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'potlib1ap'", "output": "'potlib1ap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "28", "output": "{1, 2, 4, 7, 14, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026890", "code": "def real_basename(path):\n    \"\"\"Extracts the base name from the given path.\"\"\"\n    if path.endswith('/'):\n        return None\n    return path.rsplit('/', 1)[1]\n", "entry_point": "real_basename", "input": "'/home/user/docs/fi.txhome'", "output": "'fi.txhome'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30238_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026891", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[5, 10, 15]", "output": "750", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026892", "code": "import os\ndef construct_csv_path(new_employee_data, filepath):\n    _, filename = os.path.split(filepath)\n    csvpath = os.path.join(\"output\", filename)\n    return csvpath\n", "entry_point": "construct_csv_path", "input": "None, '/some/path/orfile.csv'", "output": "'output/orfile.csv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122802_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026893", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2801", "output": "{1, 2801}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2800", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026894", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5407", "output": "{1, 5407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5406", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026895", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "8, 0", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026896", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2769", "output": "{1, 3, 39, 71, 13, 2769, 213, 923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026897", "code": "from math import log10\ndef produce(n):\n    squiral = [[0 for _ in range(n)] for _ in range(n)]\n    directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]  # right, down, left, up\n    r, c = n // 2, n // 2  # Start from the center\n    num = n * n\n    direction_idx = 0\n    for i in range(1, num + 1):\n        squiral[r][c] = i\n        dr, dc = directions[direction_idx]\n        new_r, new_c = r + dr, c + dc\n        if 0 <= new_r < n and 0 <= new_c < n and squiral[new_r][new_c] == 0:\n            r, c = new_r, new_c\n        else:\n            direction_idx = (direction_idx + 1) % 4\n            dr, dc = directions[direction_idx]\n            r, c = r + dr, c + dc\n    return squiral\n", "entry_point": "produce", "input": "3", "output": "[[7, 8, 9], [6, 1, 2], [5, 4, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107021_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026898", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/45/'", "output": "'45'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026899", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    current_operator = '+'\n    for i in range(len(expression)):\n        if expression[i].isdigit():\n            current_number = current_number * 10 + int(expression[i])\n        if expression[i] in ['+', '-'] or i == len(expression) - 1:\n            if current_operator == '+':\n                result += current_number\n            else:\n                result -= current_number\n            current_number = 0\n            current_operator = expression[i]\n    return result\n", "entry_point": "basic_calculator", "input": "'100 + 200 + 40 - 17'", "output": "323", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98928_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026900", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'100 * 8 + 65'", "output": "865", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026901", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'88590,8'", "output": "[88590, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026902", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-9, -8, -8, -7, -7, 4, 10, 11]", "output": "[-9, -8, -8, -7, -7, 4, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026903", "code": "from typing import List\ndef closest_integer(numbers: List[int], target: int) -> int:\n    closest = None\n    min_diff = float('inf')\n    for num in numbers:\n        diff = abs(num - target)\n        if diff < min_diff or (diff == min_diff and num < closest):\n            min_diff = diff\n            closest = num\n    return closest\n", "entry_point": "closest_integer", "input": "[1, 2, 3], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84051_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026904", "code": "def simulate_game(grid, start, instructions):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    rows, cols = len(grid), len(grid[0])\n    x, y = start\n    for instruction in instructions:\n        dx, dy = directions[instruction]\n        x = (x + dx) % rows\n        y = (y + dy) % cols\n        if grid[x][y] == 1:  # Check if the new position is blocked\n            x, y = start  # Reset to the starting position\n    return x, y\n", "entry_point": "simulate_game", "input": "[[0, 0], [0, 1]], (0, 0), ['R']", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1807_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026905", "code": "from typing import Dict, Union, List, Optional, Set\nChampionInfo = Dict[str, Union[str, List[str]]]\nMetadata = Optional[str]\nNames = List[str]\ndef filter_champions(champion_info: List[ChampionInfo], metadata: Metadata, names: Names) -> Set[str]:\n    filtered_champions = set()\n    for champion in champion_info:\n        if champion[\"name\"] in names and champion.get(\"difficulty\") == metadata:\n            filtered_champions.add(champion[\"name\"])\n    return filtered_champions\n", "entry_point": "filter_champions", "input": "[], None, []", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47962_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026906", "code": "def count_drugs_by_category(drugs):\n    category_count = {}\n    for drug in drugs:\n        category = drug['category']\n        category_count[category] = category_count.get(category, 0) + 1\n    return category_count\n", "entry_point": "count_drugs_by_category", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107435_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026907", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7567", "output": "{1, 161, 7, 329, 7567, 47, 23, 1081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026908", "code": "def distribute_sum_evenly(n, s):\n    if s // n < 1:\n        return [-1]\n    number = s // n\n    left = s % n\n    arr = [number] * n\n    for i in range(n - 1, n - 1 - left, -1):\n        arr[i] += 1\n    return arr\n", "entry_point": "distribute_sum_evenly", "input": "7, 7", "output": "[1, 1, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114981_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026909", "code": "import re\ndef extract_features(lines, pattern):\n    features = set()\n    for line in lines:\n        matches = re.findall(pattern, line)\n        features.update(matches)\n    return features\n", "entry_point": "extract_features", "input": "[], ''", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27012_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026910", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5043", "output": "{1, 3, 41, 1681, 5043, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026911", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "917", "output": "{1, 131, 917, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt916", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026912", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'agehbohobocohgess:esh'", "output": "'agehbohobocohgess:esh/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026913", "code": "def split_into_chunks(lst, n):\n    result = []\n    for i in range(0, len(lst), n):\n        result.append(lst[i:i + n])\n    return result\n", "entry_point": "split_into_chunks", "input": "[1, 7, 5, 8, 4, 6, 6, 6], 2", "output": "[[1, 7], [5, 8], [4, 6], [6, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56789_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026914", "code": "def calculate_mse(predicted_values, actual_values):\n    if len(predicted_values) != len(actual_values):\n        raise ValueError(\"Input lists must have the same length\")\n    squared_errors = [(pred - actual) ** 2 for pred, actual in zip(predicted_values, actual_values)]\n    mse = sum(squared_errors) / len(predicted_values)\n    return mse\n", "entry_point": "calculate_mse", "input": "[1.0, 2.0, 3.0], [1.0, 2.0, 3.0]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109164_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026915", "code": "def dumb_round(num: float) -> str:\n    num_str = str(num)\n    integer_part, decimal_part = num_str.split('.')\n    if decimal_part == '0':\n        return integer_part\n    rounded_decimal = round(num, 2)\n    rounded_str = str(rounded_decimal)\n    if rounded_str.endswith('.0'):\n        return rounded_str[:-2]\n    return rounded_str\n", "entry_point": "dumb_round", "input": "3.075", "output": "'3.08'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139524_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026916", "code": "from typing import List, Tuple\ndef card_game(deck1: List[int], deck2: List[int]) -> Tuple[int, int]:\n    score1, score2 = 0, 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score1 += 1\n        elif card2 > card1:\n            score2 += 1\n    return score1, score2\n", "entry_point": "card_game", "input": "[5, 3, 4, 6, 2], [1, 2, 2, 4, 3]", "output": "(4, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28513_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026917", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'BC'", "output": "['BC', 'CB']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4757", "output": "{1, 67, 4757, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026919", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3664", "output": "'1 hour 1 minute 4 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026920", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[1, [2, 3], 5]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026921", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'watermeln'", "output": "['watermeln']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026922", "code": "def class_name_normalize(class_name):\n    \"\"\"\n    Converts a string into a standardized class name format.\n    Args:\n    class_name (str): The input string with words separated by underscores.\n    Returns:\n    str: The converted class name format with each word starting with an uppercase letter followed by lowercase letters.\n    \"\"\"\n    part_list = []\n    for item in class_name.split(\"_\"):\n        part_list.append(\"{}{}\".format(item[0].upper(), item[1:].lower()))\n    return \"\".join(part_list)\n", "entry_point": "class_name_normalize", "input": "'user_pfile_manager'", "output": "'UserPfileManager'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55201_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026923", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "0.954", "output": "'0.954 x 10^-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026924", "code": "def calculate_char_frequency(input_string):\n    input_string = input_string.upper()\n    frequency = {}\n    for char in input_string:\n        if char != \" \":\n            if char in frequency:\n                frequency[char] += 1\n            else:\n                frequency[char] = 1\n    return frequency\n", "entry_point": "calculate_char_frequency", "input": "'H E H'", "output": "{'H': 2, 'E': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50071_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8845", "output": "{1, 5, 1769, 8845, 305, 145, 61, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8844", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026926", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt34", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026927", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[1, 1, 1, 1]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026928", "code": "def map_rule_name_to_value(rule_name):\n    rule_mapping = {\n        \"RULE_pi\": 3,\n        \"RULE_theta\": 4,\n        \"RULE_freezeTime\": 5,\n        \"RULE_timeVarDecl\": 6,\n        \"RULE_objVarDecl\": 7,\n        \"RULE_varList\": 8,\n        \"RULE_interval\": 9,\n        \"RULE_funcBB\": 10,\n        \"RULE_funcAreaTau\": 11,\n        \"RULE_funcRatioAreaTau\": 12,\n        \"RULE_funcDist\": 13,\n        \"RULE_funcLatDist\": 14,\n        \"RULE_funcLonDist\": 15,\n        \"RULE_funcRatioLatLon\": 16,\n        \"RULE_funcAreaTheta\": 17\n    }\n    return rule_mapping.get(rule_name, -1)\n", "entry_point": "map_rule_name_to_value", "input": "'RULE_funcDist'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137133_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026929", "code": "import re\ndef count_unique_words(text):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'It'", "output": "{'it': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33729_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026930", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "194", "output": "{1, 194, 2, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt193", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026931", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "83, 1", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt3150", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026932", "code": "def dump_db(data):\n    if not data:\n        return \"No data to dump\"\n    columns = list(data[0].keys())\n    output = [','.join(columns)]\n    for record in data:\n        values = [str(record.get(col, '')) for col in columns]\n        output.append(','.join(values))\n    return '\\n'.join(output)\n", "entry_point": "dump_db", "input": "[{}, {}, {}, {}, {}, {}, {}, {}]", "output": "'\\n\\n\\n\\n\\n\\n\\n\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57639_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026933", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[9, 7, 15, 8, 7, 7, 15, 9]", "output": "[7, 7, 7, 8, 9, 9, 15, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026934", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 3, 4, 4, 3, 3, 3, 3]", "output": "[5, 7, 8, 7, 6, 6, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52080_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026935", "code": "def transform_to_dict_list(batch_dict):\n    # Create dict_batch with keys from the first dictionary in batch_dict\n    keys = batch_dict[0].keys()\n    dict_batch = dict.fromkeys(keys)\n    for k in keys:\n        dict_batch[k] = list()\n    # Populate dict_batch with values from batch_dict\n    for bat in batch_dict:\n        for k, v in bat.items():\n            dict_batch[k].append(v)\n    return dict_batch\n", "entry_point": "transform_to_dict_list", "input": "[{'a': 3, 'b': 2}]", "output": "{'a': [3], 'b': [2]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85253_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026936", "code": "def construct_query_string(payload: dict) -> str:\n    filtered_payload = {k: v for k, v in payload.items() if v is not None}\n    sorted_payload = sorted(filtered_payload.items(), key=lambda x: x[0])\n    query_string = '&'.join([f'{k}={v}' for k, v in sorted_payload])\n    return query_string\n", "entry_point": "construct_query_string", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_157_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026937", "code": "import re\ndef count_unique_words(data):\n    # Convert input string to lowercase\n    data = data.lower()\n    # Use regular expression to extract words excluding special characters and numbers\n    words = re.findall(r'\\b[a-z]+\\b', data)\n    # Count occurrences of each unique word\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'Hello world'", "output": "{'hello': 1, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131896_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026938", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'.'", "output": "'.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026939", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "5", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026940", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8623", "output": "{1, 8623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026941", "code": "def timeout_category(timeout):\n    KEEPALIVE_TIMEOUT = 10e-6\n    RECOVERY_TIMEOUT = 1e-3\n    if timeout <= KEEPALIVE_TIMEOUT:\n        return \"Keep-Alive Timeout\"\n    elif timeout <= RECOVERY_TIMEOUT:\n        return \"Recovery Timeout\"\n    else:\n        return \"Unknown Timeout\"\n", "entry_point": "timeout_category", "input": "0.0001", "output": "'Recovery Timeout'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22338_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026942", "code": "def swap_adjacent_integers(lst):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(lst) - 1):\n            if lst[i] > lst[i + 1]:\n                lst[i], lst[i + 1] = lst[i + 1], lst[i]\n                swapped = True\n    return lst\n", "entry_point": "swap_adjacent_integers", "input": "[2, 2, 3, 2, 3, 4, 4, 5, 5]", "output": "[2, 2, 2, 3, 3, 4, 4, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1161_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026943", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'mme0'", "output": "{'when': 'mme0', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026944", "code": "def modified_insertion_sort(arr):\n    def insertion_sort(arr):\n        for i in range(1, len(arr)):\n            key = arr[i]\n            j = i - 1\n            while j >= 0 and arr[j] > key:\n                arr[j + 1] = arr[j]\n                j -= 1\n            arr[j + 1] = key\n    sorted_arr = []\n    positive_nums = [num for num in arr if num > 0]\n    insertion_sort(positive_nums)\n    pos_index = 0\n    for num in arr:\n        if num > 0:\n            sorted_arr.append(positive_nums[pos_index])\n            pos_index += 1\n        else:\n            sorted_arr.append(num)\n    return sorted_arr\n", "entry_point": "modified_insertion_sort", "input": "[0, 2, -1, 2, 4]", "output": "[0, 2, -1, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66384_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026945", "code": "def find_earliest_date(dates):\n    earliest_date = \"9999-12-31\"  # Initialize with a date later than any in the list\n    for date in dates:\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date\n", "entry_point": "find_earliest_date", "input": "['-20-122', '0000-01-01', '2023-12-31']", "output": "'-20-122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14644_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026946", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "209", "output": "{19, 1, 11, 209}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026947", "code": "def process_network_interface(command):\n    if command.startswith(\"ifconfig\"):\n        interface = command.split(\" \")[1] if len(command.split(\" \")) > 1 else None\n        if interface == \"wlan0\":\n            return f\"{interface}: <interface information>\"\n        else:\n            return f\"{interface}: error fetching interface information: Device not found\"\n    else:\n        return \"\"\n", "entry_point": "process_network_interface", "input": "'ifconfig wlan0'", "output": "'wlan0: <interface information>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66686_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026948", "code": "def analyze_test_suite(test_results):\n    for result in test_results:\n        if not result:\n            return \"Some tests failed\"\n    return \"All tests passed\"\n", "entry_point": "analyze_test_suite", "input": "[True, True, True]", "output": "'All tests passed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33736_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026949", "code": "def select_fittest(population, mode):\n    if mode not in ['min', 'max']:\n        raise ValueError('Mode must be either \"min\" or \"max\"')\n    if mode == 'min':\n        fittest_individual = min(population, key=lambda x: x['fitness'])\n    else:\n        fittest_individual = max(population, key=lambda x: x['fitness'])\n    return fittest_individual\n", "entry_point": "select_fittest", "input": "[{'fitness': 75}, {'fitness': 80}, {'fitness': 90}], 'min'", "output": "{'fitness': 75}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54142_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026950", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "14, 5", "output": "'Enemy: 14, Own: 5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7604", "output": "{1, 2, 4, 1901, 7604, 3802}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7603", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026952", "code": "def format_color_names(input_string):\n    predefined_words = [\"is\", \"a\", \"nice\"]\n    words = input_string.split()\n    formatted_words = []\n    for word in words:\n        if word.lower() not in predefined_words:\n            word = word.capitalize()\n        formatted_words.append(word)\n    formatted_string = ' '.join(formatted_words)\n    return formatted_string\n", "entry_point": "format_color_names", "input": "'color'", "output": "'Color'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25204_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026953", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[1, 1, 3, 6, 4, 5, 4, 1, 4]", "output": "[1, 1, 3, 6, 4, 5, 4, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026954", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "15", "output": "423360", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026955", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'tye'", "output": "'tye'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026956", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[5, 6]", "output": "[5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026957", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[7, 2, 3, 7, 7, 7, 2, 2, 7]", "output": "[7, 3, 5, 10, 11, 12, 8, 9, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026958", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "18469", "output": "55408", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt14", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026959", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[0, 1, 3, 3, 3, 5, 5, 5, 7, 9], 3", "output": "[0, 1, 3, 3, 5, 5, 5, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026960", "code": "def calculate_time_elapsed(start_time, end_time):\n    total_seconds = end_time - start_time\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return hours, minutes, seconds\n", "entry_point": "calculate_time_elapsed", "input": "0, 7203", "output": "(2, 0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87493_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026961", "code": "def merge(left_array, right_array):\n    merged = []\n    left_pointer = right_pointer = 0\n    while left_pointer < len(left_array) and right_pointer < len(right_array):\n        if left_array[left_pointer] < right_array[right_pointer]:\n            merged.append(left_array[left_pointer])\n            left_pointer += 1\n        else:\n            merged.append(right_array[right_pointer])\n            right_pointer += 1\n    merged.extend(left_array[left_pointer:])\n    merged.extend(right_array[right_pointer:])\n    return merged\n", "entry_point": "merge", "input": "[2, 4, 5], [2, 3, 3, 4, 5, 5, 6, 7]", "output": "[2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74073_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026962", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1721", "output": "{1, 1721}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1720", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026963", "code": "def prepare_filename_string(input_string):\n    processed_string = input_string.replace(\"_\", \"-\").replace(\"|\", \"-\").replace(\" \", \"-\").replace(\"(\", \"\").replace(\")\", \"\").lower()\n    return processed_string\n", "entry_point": "prepare_filename_string", "input": "'mmy fi  nml'", "output": "'mmy-fi--nml'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145297_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026964", "code": "def html_reverse_escape(string):\n    '''Reverse escapes HTML code in string into ASCII text.'''\n    return string.replace(\"&amp;\", \"&\").replace(\"&#39;\", \"'\").replace(\"&quot;\", '\"')\n", "entry_point": "html_reverse_escape", "input": "'II&amp;apos;m fe & happy;'", "output": "'II&apos;m fe & happy;'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68510_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026965", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026966", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9541", "output": "{1, 9541, 7, 329, 203, 47, 1363, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9540", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026967", "code": "def quickSort(A, si, ei):\n    comparison_count = [0]  # Initialize comparison count as a list to allow pass by reference\n    def partition(A, si, ei):\n        x = A[ei]  # x is pivot, last element\n        i = si - 1\n        for j in range(si, ei):\n            comparison_count[0] += 1  # Increment comparison count for each comparison made\n            if A[j] <= x:\n                i += 1\n                A[i], A[j] = A[j], A[i]\n        A[i + 1], A[ei] = A[ei], A[i + 1]\n        return i + 1\n    def _quickSort(A, si, ei):\n        if si < ei:\n            pi = partition(A, si, ei)\n            _quickSort(A, si, pi - 1)\n            _quickSort(A, pi + 1, ei)\n    _quickSort(A, si, ei)\n    return comparison_count[0]\n", "entry_point": "quickSort", "input": "[], 0, -1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125182_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026968", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if len(scores) >= N:\n        top_scores = sorted_scores[:N]\n    else:\n        top_scores = sorted_scores\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[65], 1", "output": "65.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148544_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026969", "code": "from itertools import count\ndef recaman_sequence(n):\n    \"\"\"Generate a modified version of Recaman's sequence up to the nth element\"\"\"\n    seen = set()\n    a = 0\n    result = []\n    for i in range(n):\n        result.append(a)\n        seen.add(a)\n        c = a - i\n        if c < 0 or c in seen:\n            c = a + i\n        a = c\n    return result\n", "entry_point": "recaman_sequence", "input": "5", "output": "[0, 0, 1, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18161_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026970", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 4, 6, 2, 2, 4, 3]", "output": "[4, 6, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026971", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zzc'", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026972", "code": "def determine_winner(deck_a, deck_b):\n    score_a = 0\n    score_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    if score_a > score_b:\n        return 'Player A'\n    elif score_b > score_a:\n        return 'Player B'\n    else:\n        return 'Tie'\n", "entry_point": "determine_winner", "input": "[5, 3], [1, 2]", "output": "'Player A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21245_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026973", "code": "def convert_to_short_prefix(long_variable_name):\n    mappings = {\n        \"SHORT_NEW_TABLE_PREFIX\": \"n!\",\n        \"SHORT_DELTA_TABLE_PREFIX\": \"c!\",\n        \"SHORT_RENAMED_TABLE_PREFIX\": \"o!\",\n        \"SHORT_INSERT_TRIGGER_PREFIX\": \"i!\",\n        \"SHORT_UPDATE_TRIGGER_PREFIX\": \"u!\",\n        \"SHORT_DELETE_TRIGGER_PREFIX\": \"d!\",\n        \"OSC_LOCK_NAME\": \"OnlineSchemaChange\"\n    }\n    return mappings.get(long_variable_name, \"Unknown\")\n", "entry_point": "convert_to_short_prefix", "input": "'SHORT_NEW_TABLE_PREFIX'", "output": "'n!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139316_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026974", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[2, 6, 6, 5, 7, 6, 8, 5, 6]", "output": "[2, 7, 8, 8, 11, 11, 14, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026975", "code": "def calculate_statistical_prevalence(transactions):\n    item_count = {}\n    total_transactions = len(transactions)\n    for transaction in transactions:\n        for item in transaction:\n            item_count[item] = item_count.get(item, 0) + 1\n    statistical_prevalence = {item: count/total_transactions for item, count in item_count.items()}\n    return statistical_prevalence\n", "entry_point": "calculate_statistical_prevalence", "input": "[[2, 3, 4, 5]]", "output": "{2: 1.0, 3: 1.0, 4: 1.0, 5: 1.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62425_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026976", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[7, 7, 4, 6, 6, 6, 6, 5]", "output": "{7: 2, 4: 1, 6: 4, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3649", "output": "{3649, 1, 89, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026978", "code": "def calculate_total_score(scores):\n    total_score = 0\n    for score in scores:\n        if score % 5 == 0 and score % 7 == 0:\n            total_score += score * 4\n        elif score % 5 == 0:\n            total_score += score * 2\n        elif score % 7 == 0:\n            total_score += score * 3\n        else:\n            total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[-5, -6, -8, -10, -15, -20, 7]", "output": "-93", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93768_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026979", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4271", "output": "{1, 4271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026980", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[6]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9070", "output": "{1, 2, 5, 10, 907, 9070, 1814, 4535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9069", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026982", "code": "def process_message(template, values):\n    final_message = template\n    for key, value in values.items():\n        placeholder = \"{\" + key + \"}\"\n        final_message = final_message.replace(placeholder, value)\n    return final_message\n", "entry_point": "process_message", "input": "'\u5220\u9664\u5931\u8d25:{io}', {}", "output": "'\u5220\u9664\u5931\u8d25:{io}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57242_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026983", "code": "def convert_full_width_to_half_width(text):\n    OFFSET = ord('\uff10') - ord('0')  # Calculate the offset between full-width and half-width characters\n    char_map = {chr(ord('\uff10') + i): chr(ord('\uff10') + i - OFFSET) for i in range(10)}  # Numbers\n    char_map.update({chr(ord('\uff21') + i): chr(ord('\uff21') + i - OFFSET) for i in range(26)})  # Uppercase letters\n    char_map.update({chr(ord('\uff41') + i): chr(ord('\uff41') + i - OFFSET) for i in range(26)})  # Lowercase letters\n    processed_text = text.translate(str.maketrans(char_map))\n    return processed_text\n", "entry_point": "convert_full_width_to_half_width", "input": "'\uff28\uff28\uff4c\uff28\uff4c\uff4f'", "output": "'HHlHlo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128402_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026984", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'app_config.addressaapp'", "output": "'addressaapp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026985", "code": "def count_services_and_briefs(loaded_data: dict) -> dict:\n    services_count = {category: len(services) for category, services in loaded_data.get('services', {}).items()}\n    briefs_count = {category: len(briefs) for category, briefs in loaded_data.get('briefs', {}).items()}\n    return {'services': services_count, 'briefs': briefs_count}\n", "entry_point": "count_services_and_briefs", "input": "{}", "output": "{'services': {}, 'briefs': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66207_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6152", "output": "{1, 2, 1538, 3076, 4, 769, 6152, 8}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6151", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026987", "code": "GAS_LIMIT = 3141592\nGAS_PRICE = 20  # 20 shannon\ndef calculate_gas_cost(gas_limit, gas_price):\n    return gas_limit * gas_price\n", "entry_point": "calculate_gas_cost", "input": "2356191, GAS_PRICE", "output": "47123820", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79990_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026988", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "37", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5705", "output": "{1, 35, 163, 5, 7, 5705, 815, 1141}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026990", "code": "ONE_HOUR = 3600\ndef hours_ago(delta_seconds: int) -> str:\n    hours = delta_seconds // ONE_HOUR\n    return \"over {} hours ago\".format(hours)\n", "entry_point": "hours_ago", "input": "3600", "output": "'over 1 hours ago'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47586_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026991", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6754", "output": "{1, 6754, 2, 614, 11, 3377, 307, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8611", "output": "{1, 8611, 109, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "316", "output": "{1, 2, 4, 79, 316, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt315", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026994", "code": "from typing import List\ndef fast_moving_average(data: List[float], num_intervals: int) -> List[float]:\n    if len(data) < num_intervals:\n        return []\n    interval_size = len(data) // num_intervals\n    moving_avg = []\n    for i in range(num_intervals):\n        start = i * interval_size\n        end = start + interval_size if i < num_intervals - 1 else len(data)\n        interval_data = data[start:end]\n        avg = sum(interval_data) / len(interval_data) if interval_data else 0\n        moving_avg.append(avg)\n    return moving_avg\n", "entry_point": "fast_moving_average", "input": "[5, 5, 5, 6], 2", "output": "[5.0, 5.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98561_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026995", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'words'", "output": "{'words': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026996", "code": "def convert_version_tuple_to_string(version_info):\n    return '.'.join(str(s) for s in version_info)\n", "entry_point": "convert_version_tuple_to_string", "input": "(1, 0, 0, 3)", "output": "'1.0.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46123_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026997", "code": "def calculate_z_score(value, mean, std):\n    z_score = (value - mean) / std\n    return z_score\n", "entry_point": "calculate_z_score", "input": "-4.780267563671315, 0, 1", "output": "-4.780267563671315", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41589_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026998", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[100, 88, 87, 51, 43, 20, 20, 10], 8", "output": "[100, 88, 87, 51, 43, 20, 20, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0026999", "code": "def grouped(n, iterable, fillvalue=None):\n    groups = []\n    it = iter(iterable)\n    while True:\n        group = tuple(next(it, fillvalue) for _ in range(n))\n        if group == (fillvalue,) * n:\n            break\n        groups.append(group)\n    return groups\n", "entry_point": "grouped", "input": "4, [2, 2, 6, 3, 7, 3, 7, -1]", "output": "[(2, 2, 6, 3), (7, 3, 7, -1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32257_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027000", "code": "import re\ndef get_http_status_code(response_message):\n    # Regular expression pattern to extract the status code\n    pattern = r'HTTP/\\d\\.\\d (\\d{3})'\n    # Search for the status code in the response message\n    match = re.search(pattern, response_message)\n    if match:\n        status_code = int(match.group(1))\n        # Check if the status code is recognized\n        if status_code in [400, 411, 404, 200, 505]:\n            return status_code\n        else:\n            return \"Unrecognized HTTP Status Code\"\n    else:\n        return \"Invalid HTTP Response Message\"\n", "entry_point": "get_http_status_code", "input": "'HTTP/1.1 404 Not Found'", "output": "404", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127986_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027001", "code": "def calculate_average_speed(dc, time_per_cycle, num_cycles):\n    total_time = num_cycles * time_per_cycle\n    total_rotations = num_cycles * 2\n    average_speed = (total_rotations / total_time) * 60\n    return average_speed\n", "entry_point": "calculate_average_speed", "input": "10, 9, 1", "output": "13.333333333333332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98410_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027002", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[50, 89, 75, 74, 73, 89]", "output": "[89, 75, 74]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "736", "output": "{736, 1, 2, 32, 4, 8, 46, 368, 16, 23, 184, 92}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt735", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027004", "code": "def execute_commands(commands, starting_value):\n    result = starting_value\n    for command in commands:\n        operation, value = command.split()\n        value = int(value)\n        if operation == '+':\n            result += value\n        elif operation == '*':\n            result *= value\n    return result\n", "entry_point": "execute_commands", "input": "['+ 10'], 1", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107729_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027005", "code": "def calculate_average_score(scores):\n    count = scores[0]\n    win1 = scores[1]\n    win2 = scores[2]\n    total_score = sum(scores[3:])\n    average_score = total_score / count\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[4, 1, 1, 20, 20, 24]", "output": "16.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6579_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027006", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2469", "output": "{1, 3, 2469, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027007", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "'[5]'", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027008", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "1, {0: True, 1: False, 2: False, 3: False, 4: False, 5: True}", "output": "[0, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027009", "code": "COMMANDS = {0: \"move_forward\", 1: \"go_down\", 2: \"rot_10_deg\",\n            3: \"go_up\", 4: \"take_off\", 5: \"land\", 6: \"idle\"}\ndef process_commands(commands):\n    actions = []\n    for command in commands:\n        if command in COMMANDS:\n            actions.append(COMMANDS[command])\n        else:\n            actions.append(\"unknown_command\")\n    return actions\n", "entry_point": "process_commands", "input": "[2, 3, 3]", "output": "['rot_10_deg', 'go_up', 'go_up']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2283_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027010", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "-4.2644", "output": "-0.0021322000000000003", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027011", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7151", "output": "{1, 7151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7150", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5453", "output": "{1, 133, 7, 41, 779, 5453, 19, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027013", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7763", "output": "{1, 7763, 1109, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7762", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027014", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8227", "output": "{19, 1, 8227, 433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8226", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027015", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8612", "output": "{1, 2, 8612, 4, 2153, 4306}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8611", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027016", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'hhhhhxyz'", "output": "[('h', 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027017", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 1, 4, 3, 1, 4, 1, 3, 0]", "output": "[3, 5, 7, 4, 5, 5, 4, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027018", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "713", "output": "{1, 713, 31, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027019", "code": "def simulate_keypad(inputs):\n    combination = []\n    x, y = 1, 1\n    keypad = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n    for line in inputs:\n        for inp in line:\n            if inp == \"D\" and y < 2:\n                y += 1\n            elif inp == \"U\" and y > 0:\n                y -= 1\n            elif inp == \"L\" and x > 0:\n                x -= 1\n            elif inp == \"R\" and x < 2:\n                x += 1\n        combination.append(keypad[y][x])\n    return combination\n", "entry_point": "simulate_keypad", "input": "['']", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57112_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027020", "code": "def calculate_total_truck_count(_inbound_truck_raw_data, _outbound_truck_raw_data):\n    inbound_truck_count = len(_inbound_truck_raw_data)\n    outbound_truck_count = len(_outbound_truck_raw_data)\n    total_truck_count = inbound_truck_count + outbound_truck_count\n    return total_truck_count\n", "entry_point": "calculate_total_truck_count", "input": "[1, 2, 3, 4, 5], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24222_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027021", "code": "import os\ndef get_filename_ext(filepath):\n    base_name = os.path.basename(filepath)\n    name, ext = os.path.splitext(base_name)\n    return name, ext\n", "entry_point": "get_filename_ext", "input": "''", "output": "('', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84746_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027022", "code": "def scientific_notation(num):\n    # Extract mantissa and exponent\n    mantissa, exponent = f\"{num:e}\".split('e')\n    # Convert mantissa to the required format\n    mantissa = float(mantissa) / 10\n    return f\"{mantissa} x 10^{int(exponent)}\"\n", "entry_point": "scientific_notation", "input": "2.7678", "output": "'0.27677999999999997 x 10^0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19323_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027023", "code": "def extract_email_domains(emails):\n    domain_user_mapping = {}\n    for email in emails:\n        username, domain = email.split('@')\n        if domain not in domain_user_mapping:\n            domain_user_mapping[domain] = []\n        domain_user_mapping[domain].append(username)\n    return domain_user_mapping\n", "entry_point": "extract_email_domains", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69139_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4526", "output": "{1, 2, 73, 4526, 146, 2263, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4525", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027025", "code": "def generate_portables_mention_string(portables_channel_ids):\n    portables_channel_mentions = [f'<#{id}>' for id in portables_channel_ids]\n    if len(portables_channel_mentions) == 1:\n        return portables_channel_mentions[0]\n    else:\n        return ', '.join(portables_channel_mentions[:-1]) + ', or ' + portables_channel_mentions[-1]\n", "entry_point": "generate_portables_mention_string", "input": "[123, 456, 789]", "output": "'<#123>, <#456>, or <#789>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60152_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027026", "code": "from typing import List\ndef customer_queue(customers: List[str]) -> int:\n    customers_served = 0\n    for customer in customers:\n        customers_served += 1\n    return customers_served\n", "entry_point": "customer_queue", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138411_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027027", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'ovdo', 4", "output": "['ovdo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027028", "code": "from typing import List\ndef maxProductDifference(nums: List[int]) -> int:\n    min1 = min2 = float('inf')\n    max1 = max2 = float('-inf')\n    for n in nums:\n        if n <= min1:\n            min1, min2 = n, min1\n        elif n < min2:\n            min2 = n\n        if n >= max1:\n            max1, max2 = n, max1\n        elif n > max2:\n            max2 = n\n    return max1 * max2 - min1 * min2\n", "entry_point": "maxProductDifference", "input": "[1, 2, 4, 8]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61599_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027029", "code": "def validarCPF(cpf):\n    if len(cpf) != 14 or not cpf[:3].isdigit() or not cpf[4:7].isdigit() or not cpf[8:11].isdigit() or not cpf[12:].isdigit() or cpf[3] != '.' or cpf[7] != '.' or cpf[11] != '-':\n        return False\n    cpf_digits = [int(d) for d in cpf if d.isdigit()]\n    # Calculate first check digit\n    sum_1 = sum(cpf_digits[i] * (10 - i) for i in range(9))\n    check_digit_1 = (sum_1 * 10) % 11 if (sum_1 * 10) % 11 < 10 else 0\n    # Calculate second check digit\n    sum_2 = sum(cpf_digits[i] * (11 - i) for i in range(10))\n    check_digit_2 = (sum_2 * 10) % 11 if (sum_2 * 10) % 11 < 10 else 0\n    return check_digit_1 == cpf_digits[9] and check_digit_2 == cpf_digits[10]\n", "entry_point": "validarCPF", "input": "'123.456.789-09'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51383_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027030", "code": "def split_into_chunks(data, chunk_size):\n    num_chunks = -(-len(data) // chunk_size)  # Calculate the number of chunks needed\n    chunks = []\n    for i in range(num_chunks):\n        start = i * chunk_size\n        end = (i + 1) * chunk_size\n        chunk = data[start:end]\n        if len(chunk) < chunk_size:\n            chunk += [None] * (chunk_size - len(chunk))  # Pad with None values if needed\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_into_chunks", "input": "[3, 5, 6, 5, 1, 2, 2], 4", "output": "[[3, 5, 6, 5], [1, 2, 2, None]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138006_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027031", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "[1]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027032", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6797", "output": "{1, 971, 6797, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027033", "code": "def balancedSums(arr):\n    total_sum = sum(arr)\n    left_sum = 0\n    for i in range(len(arr)):\n        total_sum -= arr[i]\n        if left_sum == total_sum:\n            return i\n        left_sum += arr[i]\n    return -1\n", "entry_point": "balancedSums", "input": "[1, -2, 1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101017_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027034", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'example', '.1.011.'", "output": "{'.1.011.': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027035", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'the window is open.'", "output": "'the user defined window is open.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027036", "code": "def custom_transform(input_dict):\n    if 'A' in input_dict and 'B' in input_dict and 'C' in input_dict:\n        sum_values = input_dict['A'] + input_dict['B'] + input_dict['C']\n        result_dict = {'Result': sum_values}\n        return result_dict\n    else:\n        return {'Result': 'Invalid input dictionary'}\n", "entry_point": "custom_transform", "input": "{'A': 10}", "output": "{'Result': 'Invalid input dictionary'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41767_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027037", "code": "def extract_author(source_code):\n    author = 'Author not found'\n    for line in source_code.split('\\n'):\n        if '__author__ =' in line:\n            start_index = line.find(\"'\") + 1\n            end_index = line.find(\"'\", start_index)\n            author = line[start_index:end_index]\n            break\n    return author\n", "entry_point": "extract_author", "input": "'def some_function():\\n    pass'", "output": "'Author not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119727_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4749", "output": "{1, 3, 4749, 1583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4748", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027039", "code": "from typing import Type, Optional\ndef determine_type(input_value):\n    def is_optional(t: Type) -> bool:\n        return getattr(t, \"__origin__\", None) is Optional\n    def unwrap_optional(t: Type) -> Type:\n        return t.__args__[0]\n    if is_optional(type(input_value)):\n        return f\"Optional[{unwrap_optional(type(input_value)).__name__}]\"\n    return type(input_value).__name__\n", "entry_point": "determine_type", "input": "10", "output": "'int'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22148_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8247", "output": "{1, 3, 2749, 8247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8246", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027041", "code": "def reverse_words(input_string):\n    # Split the input string into individual words\n    words = input_string.split()\n    # Reverse each word in the list of words\n    reversed_words = [word[::-1] for word in words]\n    # Join the reversed words back together into a single string\n    reversed_string = ' '.join(reversed_words)\n    return reversed_string\n", "entry_point": "reverse_words", "input": "'hello wheld'", "output": "'olleh dlehw'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149182_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027042", "code": "from typing import Tuple\ndef parse_tunnel_proxy_path(proxy_path: str) -> Tuple[str, str, int]:\n    parts = proxy_path.split(':')\n    if len(parts) == 2:\n        host = parts[0]\n        port = int(parts[1])\n        if port == 80:\n            protocol = \"http\"\n        elif port == 443:\n            protocol = \"https\"\n        else:\n            raise ValueError(\"Invalid port number for HTTP/HTTPS\")\n        return protocol, host, port\n    else:\n        raise ValueError(\"Invalid proxy path format\")\n", "entry_point": "parse_tunnel_proxy_path", "input": "'exam1le.com:80'", "output": "('http', 'exam1le.com', 80)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140783_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027043", "code": "import time\ndef calculate_seconds_until_future_time(current_time, future_time):\n    return abs(future_time - current_time)\n", "entry_point": "calculate_seconds_until_future_time", "input": "0, 5001", "output": "5001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45249_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027044", "code": "def process_students(students):\n    remaining_students = 0\n    total_grade = 0\n    for student in students:\n        if student[\"age\"] >= 18:\n            remaining_students += 1\n            total_grade += student[\"grade\"]\n    average_grade = total_grade / remaining_students if remaining_students > 0 else 0\n    return remaining_students, average_grade\n", "entry_point": "process_students", "input": "[]", "output": "(0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39319_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027045", "code": "def generate_network_policy_name(security_group_id):\n    SG_LABEL_PREFIX = 'sg.projectcalico.org/openstack-'\n    SG_NAME_PREFIX = 'ossg.default.'\n    # Construct the label for the security group\n    sg_label = SG_LABEL_PREFIX + str(security_group_id)\n    # Construct the NetworkPolicy name for the security group\n    sg_name = SG_NAME_PREFIX + str(security_group_id)\n    return sg_name\n", "entry_point": "generate_network_policy_name", "input": "119", "output": "'ossg.default.119'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10764_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027046", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1715", "output": "{1, 35, 5, 7, 49, 1715, 245, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1714", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027047", "code": "def process_operations(initial_list, operations):\n    def add_value(lst, val):\n        return [num + val for num in lst]\n    def multiply_value(lst, val):\n        return [num * val for num in lst]\n    def reverse_list(lst):\n        return lst[::-1]\n    def negate_list(lst):\n        return [-num for num in lst]\n    operations = operations.split()\n    operations_iter = iter(operations)\n    result = initial_list.copy()\n    for op in operations_iter:\n        if op == 'A':\n            result = add_value(result, int(next(operations_iter)))\n        elif op == 'M':\n            result = multiply_value(result, int(next(operations_iter)))\n        elif op == 'R':\n            result = reverse_list(result)\n        elif op == 'N':\n            result = negate_list(result)\n    return result\n", "entry_point": "process_operations", "input": "[], 'A 5 M 1 R N'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117757_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027048", "code": "def process_image_name(image_name):\n    if image_name:\n        return image_name[4:]\n    else:\n        return \"\"\n", "entry_point": "process_image_name", "input": "'Exammple.jpgaajpg'", "output": "'mple.jpgaajpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57962_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027049", "code": "def get_sample_folder_path(platform):\n    platform_paths = {\n        \"UWP\": \"ArcGISRuntime.UWP.Viewer/Samples\",\n        \"WPF\": \"ArcGISRuntime.WPF.Viewer/Samples\",\n        \"Android\": \"Xamarin.Android/Samples\",\n        \"iOS\": \"Xamarin.iOS/Samples\",\n        \"Forms\": \"Shared/Samples\",\n        \"XFA\": \"Shared/Samples\",\n        \"XFI\": \"Shared/Samples\",\n        \"XFU\": \"Shared/Samples\"\n    }\n    if platform in platform_paths:\n        return platform_paths[platform]\n    else:\n        return \"Unknown platform provided\"\n", "entry_point": "get_sample_folder_path", "input": "'UWP'", "output": "'ArcGISRuntime.UWP.Viewer/Samples'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70790_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2731", "output": "{1, 2731}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2730", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5845", "output": "{1, 835, 35, 5, 7, 167, 1169, 5845}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5844", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027052", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[2, 4, 6, 8]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027053", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4958", "output": "{1, 2, 67, 37, 134, 74, 2479, 4958}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027054", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[3, 9, 12, 18]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027055", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5725", "output": "{1, 1145, 5, 229, 25, 5725}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5724", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027056", "code": "def sum_of_largest_four(nums):\n    sorted_nums = sorted(nums, reverse=True)\n    return sum(sorted_nums[:4])\n", "entry_point": "sum_of_largest_four", "input": "[10, 11, 15, 16, 5, 4]", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104402_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027057", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[4, 3]", "output": "[3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027058", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1659", "output": "{1, 3, 7, 553, 237, 79, 21, 1659}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1658", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027059", "code": "from typing import List\ndef most_common_prefix(strings: List[str]) -> str:\n    if not strings:\n        return \"\"\n    common_prefix = \"\"\n    for i, char in enumerate(strings[0]):\n        for string in strings[1:]:\n            if i >= len(string) or string[i] != char:\n                return common_prefix\n        common_prefix += char\n    return common_prefix\n", "entry_point": "most_common_prefix", "input": "['apple', 'application', 'apricot', 'ap']", "output": "'ap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38674_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027060", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'formatting.'", "output": "'<p>formatting.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027061", "code": "QUOTE_CHAR = '*'  # Define the QUOTE_CHAR constant\ndef dequote(name: str):\n    \"\"\"Split company *name* to organisation and title.\"\"\"\n    parts = name.split(QUOTE_CHAR)\n    org = parts[0].strip()\n    cnt = name.count(QUOTE_CHAR)\n    if cnt == 2:\n        title = parts[1].strip()\n    elif cnt > 2:\n        title = QUOTE_CHAR.join(parts[1:])\n    else:\n        title = name\n    return org, title.strip()\n", "entry_point": "dequote", "input": "'M*Q**CEO*e*'", "output": "('M', 'Q**CEO*e*')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47840_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027062", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'07:05:04AM'", "output": "'07:05:04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027063", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'SSSA'", "output": "'NSSA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027064", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3371", "output": "{1, 3371}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2698", "output": "{1, 2, 1349, 38, 71, 2698, 142, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2697", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027066", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7419", "output": "{3, 1, 2473, 7419}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027067", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 1", "output": "3.141592653589793", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1982", "output": "{1, 2, 1982, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4809", "output": "{1, 1603, 3, 229, 7, 4809, 687, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4808", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027070", "code": "def f(method):\n    if method == 'GET':\n        return \"<h1>MyClub Event Calendar get</h1>\"\n    elif method == 'POST':\n        return \"<h1>MyClub Event Calendar post</h1>\"\n    else:\n        return \"<h1>MyClub Event Calendar</h1>\"\n", "entry_point": "f", "input": "'POST'", "output": "'<h1>MyClub Event Calendar post</h1>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106549_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027071", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "1.0, 1.0", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027072", "code": "def trapped_rainwater(buildings):\n    if not buildings:\n        return 0\n    n = len(buildings)\n    left_max = [0] * n\n    right_max = [0] * n\n    left_max[0] = buildings[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], buildings[i])\n    right_max[n - 1] = buildings[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], buildings[i])\n    total_rainwater = 0\n    for i in range(n):\n        total_rainwater += max(0, min(left_max[i], right_max[i]) - buildings[i])\n    return total_rainwater\n", "entry_point": "trapped_rainwater", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26473_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027073", "code": "def process_circular_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        output_list.append(input_list[i] + input_list[(i + 1) % len(input_list)])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_circular_list", "input": "[2, -1, 7, 0, 7, -1, 5, 1]", "output": "[1, 6, 7, 7, 6, 4, 6, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131123_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027074", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "1", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027075", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'imim'", "output": "('imim', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027076", "code": "def prepare_filename_string(input_string):\n    processed_string = input_string.replace(\"_\", \"-\").replace(\"|\", \"-\").replace(\" \", \"-\").replace(\"(\", \"\").replace(\")\", \"\").lower()\n    return processed_string\n", "entry_point": "prepare_filename_string", "input": "'my_file'", "output": "'my-file'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145297_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027077", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'Twitch User ID Type Change'", "output": "'mixer streamer channel category update'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027078", "code": "import json\ndef convert_to_json_with_status(input_dict: dict) -> tuple:\n    json_str = json.dumps(input_dict)\n    return json_str, 201  # HTTP status code 201 represents CREATED\n", "entry_point": "convert_to_json_with_status", "input": "{}", "output": "('{}', 201)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56044_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027079", "code": "def generate_tabs(num):\n    tabs = \"\"\n    for _ in range(num):\n        tabs += \"\\t\"\n    return tabs\n", "entry_point": "generate_tabs", "input": "3", "output": "'\\t\\t\\t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130507_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027080", "code": "def character_frequency(input_string):\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "character_frequency", "input": "'hellohe'", "output": "{'h': 2, 'e': 2, 'l': 2, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6005_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027081", "code": "def inline_script_tag(html_code, script_tag):\n    start_tag = '<script>'\n    end_tag = '</script>'\n    script_start = script_tag.find(start_tag) + len(start_tag)\n    script_end = script_tag.find(end_tag)\n    script_content = script_tag[script_start:script_end]\n    modified_html = html_code.replace(script_tag, f'<script>{script_content}</script>')\n    return modified_html\n", "entry_point": "inline_script_tag", "input": "'</body>', \"<script>alert('test')</script>\"", "output": "'</body>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41150_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027082", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[4, 1, 6, 5, 6, 1, 1, 2, -1]", "output": "[5, 7, 11, 11, 7, 2, 3, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112058_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027083", "code": "def run(input_list):\n    unique_list = []\n    for num in input_list:\n        if num not in unique_list:\n            unique_list.append(num)\n    unique_list.sort()\n    return unique_list\n", "entry_point": "run", "input": "[0, 1, 2, 3, 6]", "output": "[0, 1, 2, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116261_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027084", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1274", "output": "{1, 2, 98, 26, 7, 13, 14, 49, 182, 1274, 91, 637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027085", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'Soundlien'", "output": "{'soundlien': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027086", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'moviBtchrmo'", "output": "'movi_btchrmo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027087", "code": "from typing import List, Union\nimport decimal\nDecimalT = decimal.Decimal\nNumberT = Union[float, int]\ndef max_abs_difference(numbers: List[NumberT]) -> NumberT:\n    max_diff = DecimalT('-Infinity')  # Initialize with a very small value\n    for i in range(len(numbers)):\n        for j in range(i + 1, len(numbers)):\n            diff = abs(numbers[i] - numbers[j])  # Calculate absolute difference\n            max_diff = max(max_diff, diff)  # Update max_diff if a larger difference is found\n    return max_diff\n", "entry_point": "max_abs_difference", "input": "[0, 10, 5, 20]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79683_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027088", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1853", "output": "{1, 109, 1853, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1852", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027089", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[12, 4, 6, 7, 6, 4, 4, 7], 3", "output": "[12, 4, 6, 7, 6, 4, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3282", "output": "{1, 2, 3, 547, 1094, 6, 1641, 3282}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3281", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027091", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, 25, 25, 50, 50, 75]", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027092", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[1, 3, 4, 5, 6, 1, 4, 5, 5]", "output": "[1, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027093", "code": "from typing import List\nfrom collections import Counter\ndef top_k_frequent_words(words: List[str], k: int) -> List[str]:\n    word_freq = Counter(words)\n    sorted_words = sorted(word_freq.items(), key=lambda x: (-x[1], x[0]))\n    return [word for word, _ in sorted_words[:k]]\n", "entry_point": "top_k_frequent_words", "input": "['apple', 'apple', 'banana', 'banana', 'cherry'], 2", "output": "['apple', 'banana']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70412_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027094", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'2.55'", "output": "(2, 55)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027095", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "850", "output": "{1, 2, 34, 5, 425, 170, 10, 17, 850, 50, 85, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt849", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027096", "code": "def calculate_pages(total_items, items_per_page, max_items_per_page):\n    if total_items <= items_per_page:\n        return 1\n    elif total_items <= max_items_per_page:\n        return -(-total_items // items_per_page)  # Ceiling division to handle remaining items\n    else:\n        return -(-total_items // max_items_per_page)  # Ceiling division based on max items per page\n", "entry_point": "calculate_pages", "input": "21, 5, 10", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143482_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027097", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return int(average)  # Return the average as an integer\n", "entry_point": "calculate_average", "input": "[70, 77, 77, 78]", "output": "77", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99126_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5649", "output": "{1, 3, 7, 807, 269, 5649, 21, 1883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027099", "code": "def find_largest_number(int_list):\n    # Convert integers to strings for sorting\n    str_list = [str(num) for num in int_list]\n    # Custom sorting based on concatenation comparison\n    str_list.sort(key=lambda x: x*3, reverse=True)\n    # Join the sorted strings to form the largest number\n    max_num = \"\".join(str_list)\n    return max_num\n", "entry_point": "find_largest_number", "input": "[4]", "output": "'4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86890_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027100", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: int) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    result = []\n    while end < len(temperatures):\n        if max(temperatures[start:end+1]) - min(temperatures[start:end+1]) <= threshold:\n            if end - start + 1 > max_length:\n                max_length = end - start + 1\n                result = temperatures[start:end+1]\n            end += 1\n        else:\n            start += 1\n    return result\n", "entry_point": "longest_contiguous_subarray", "input": "[70, 75, 72, 74, 71, 72, 80], 3", "output": "[72, 74, 71, 72]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105139_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027101", "code": "NDMAX = -2048\nPDMAX = 2047\nNVMAX = -4.096\nPVMAX = 4.096\ndef voltage_to_adc(voltage):\n    adc_range = PDMAX - NDMAX\n    voltage_range = PVMAX - NVMAX\n    adc_output = (voltage - NVMAX) / voltage_range * adc_range + NDMAX\n    return int(round(adc_output))  # Round to the nearest integer\n", "entry_point": "voltage_to_adc", "input": "-1.3", "output": "-650", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143445_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027102", "code": "def calculate_similarity(fingerprint1, fingerprint2):\n    intersection = fingerprint1.intersection(fingerprint2)\n    union = fingerprint1.union(fingerprint2)\n    if len(union) == 0:\n        return 0.0\n    else:\n        return len(intersection) / len(union)\n", "entry_point": "calculate_similarity", "input": "{1, 2}, {1, 3, 4}", "output": "0.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78329_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027103", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[1, 2, 3, 4, 5, 6]", "output": "([1, 3, 5], [2, 4, 6])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027104", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'3.4.5', '1.221.2', '555555'", "output": "'1.221.2.555555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027105", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[1, 2, 4, 5, 5, 5, 5, 5, 7]", "output": "[1, 2, 4, 5, 5, 5, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027106", "code": "def compareTriplets(a, b):\n    score_a = 0\n    score_b = 0\n    for i in range(3):\n        if a[i] > b[i]:\n            score_a += 1\n        elif a[i] < b[i]:\n            score_b += 1\n    return [score_a, score_b]\n", "entry_point": "compareTriplets", "input": "[5, 6, 3], [4, 5, 3]", "output": "[2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134718_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027107", "code": "import math\ndef min_sum_pair(n):\n    dist = n\n    for i in range(1, math.floor(math.sqrt(n)) + 1):\n        if n % i == 0:\n            j = n // i\n            dist = min(dist, i + j - 2)\n    return dist\n", "entry_point": "min_sum_pair", "input": "32", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134268_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027108", "code": "def power(x, n):\n    p = 1\n    for i in range(n):\n        p *= x\n    return p\n", "entry_point": "power", "input": "-1, 1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145971_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027109", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "3", "output": "'./prespawned/version3_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027110", "code": "# Define the statuses dictionary\nstatuses = {\n    1: 'Voting',\n    2: 'Innocent',\n    3: 'Guilty',\n}\n# Implement the get_status_display function\ndef get_status_display(status):\n    return statuses.get(status, 'Unknown')  # Return the status string or 'Unknown' if status code is not found\n", "entry_point": "get_status_display", "input": "2", "output": "'Innocent'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37325_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4323", "output": "{1, 1441, 3, 4323, 33, 131, 393, 11}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4322", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027112", "code": "def f(bar):\n    # type: (Union[str, bytearray]) -> str\n    if isinstance(bar, bytearray):\n        return bar.decode('utf-8')  # Convert bytearray to string\n    elif isinstance(bar, str):\n        return bar  # Return the input string as is\n    else:\n        raise TypeError(\"Input must be a string or bytearray\")\n", "entry_point": "f", "input": "'xyz'", "output": "'xyz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47415_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027113", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 4, 2, 4, 2, 6, 1, 4]", "output": "[4, 6, 6, 6, 8, 7, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110145_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027114", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 4, 2, 7, 2, 8, 2, 6]", "output": "[6, 6, 9, 9, 10, 10, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89166_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027115", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[85, 85, 84]", "output": "[85, 85, 84]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027116", "code": "import re\nfrom collections import Counter\ndef word_count(text):\n    stop_words = {'the', 'is', 'and', 'in'}  # Common English stop words\n    words = re.findall(r'\\b\\w+\\b', text.lower())  # Tokenize the text into words\n    word_counts = Counter(word for word in words if word not in stop_words)\n    return dict(word_counts)\n", "entry_point": "word_count", "input": "'you'", "output": "{'you': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98545_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027117", "code": "from typing import Dict, Any, Union\nVizPayload = Dict[str, Any]\ndef format_visualization_payload(payload: VizPayload) -> str:\n    formatted_payload = []\n    for key in ['title', 'data', 'labels', 'colors', 'type']:\n        if key in payload:\n            formatted_payload.append(f\"{key.capitalize()}: {payload[key]}\")\n    return '\\n'.join(formatted_payload)\n", "entry_point": "format_visualization_payload", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1008_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "846", "output": "{1, 2, 3, 6, 423, 9, 141, 846, 47, 18, 282, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027119", "code": "def next_semantic_version(version):\n    parts = list(map(int, version.split('.')))\n    major, minor, patch = parts + [0] * (3 - len(parts))  # Ensure we have all three parts\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_semantic_version", "input": "'9.0.0'", "output": "'9.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23923_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027120", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4210", "output": "{1, 2, 5, 421, 842, 10, 4210, 2105}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4209", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027121", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # Handle edge case where there are less than 2 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average", "input": "[80, 88, 90, 91, 95]", "output": "89.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41209_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027122", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[1, 6, 4, -4, -1, -6]", "output": "[1, 36, 16, 16, 1, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027123", "code": "def get_solver_options(solver_name):\n    LBFGSB_options = {'disp': 10, 'maxfun': 5000, 'maxiter': 5000, 'gtol': 1e-8}\n    SLSQP_options = {'disp': True, 'maxiter': 1000}\n    TrustConstr_options = {'verbose': 3, 'gtol': 1e-5}\n    TrustNewton_options = {'gtol': 1e-5}\n    TrustConstr2_options = {'verbose': 0, 'gtol': 1e-6}\n    default_opts = {'L-BFGS-B': LBFGSB_options, \n                    'l-bfgs-b': LBFGSB_options,\n                    'lbfgsb': LBFGSB_options,\n                    'LBFGSB': LBFGSB_options,\n                    'SLSQP': SLSQP_options,\n                    'slsqp': SLSQP_options,\n                    'trust-constr': TrustConstr_options,\n                    'trust-ncg': TrustNewton_options}\n    solver_name = solver_name.lower()\n    return default_opts.get(solver_name, LBFGSB_options)\n", "entry_point": "get_solver_options", "input": "'SLSQP'", "output": "{'disp': True, 'maxiter': 1000}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101311_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027124", "code": "import logging\ndef mapLogLevels(levels):\n    log_level_map = {\n        logging.ERROR: 'ERROR',\n        logging.WARN: 'WARN',\n        logging.INFO: 'INFO',\n        logging.DEBUG: 'DEBUG'\n    }\n    result = {}\n    for level in levels:\n        result[level] = log_level_map.get(level, 'UNKNOWN')\n    return result\n", "entry_point": "mapLogLevels", "input": "[10, 30, 9]", "output": "{10: 'DEBUG', 30: 'WARN', 9: 'UNKNOWN'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125844_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027125", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9685", "output": "{1, 65, 5, 745, 13, 1937, 9685, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027126", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5241", "output": "{3, 1, 5241, 1747}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5240", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027127", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'evveeh'", "output": "'evveeh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027128", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Hello Thomas. ith is here.'", "output": "'Thomas ith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027129", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "445556, 'eeth1eth', 'iiiiiinni'", "output": "'acl/445556/interfaces/eeth1eth_iiiiiinni'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027130", "code": "def search_items(search_fields, items, keyword):\n    result = []\n    for item in items:\n        for field in search_fields:\n            if field in item and keyword in str(item[field]):\n                result.append(item)\n                break\n    return result\n", "entry_point": "search_items", "input": "[], ['name', 'description'], 'keyword'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36735_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027131", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 0, 1, 3, 4, 5, 5]", "output": "[2, 1, 4, 7, 9, 10, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027132", "code": "def extract_version_numbers(version_str):\n    try:\n        major, minor, patch = map(int, version_str.split('.'))\n        return major, minor, patch\n    except (ValueError, AttributeError):\n        return None\n", "entry_point": "extract_version_numbers", "input": "'2.5.1'", "output": "(2, 5, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39759_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027133", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'ThdThsThisasedTh'", "output": "'thd_ths_thisased_th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027134", "code": "def calculate_average_depth(depths):\n    total_depth = 0\n    count = 0\n    for depth in depths:\n        if depth >= 0:\n            total_depth += depth\n            count += 1\n    if count == 0:\n        return 0  # Handle case when there are no valid depths\n    average_depth = round(total_depth / count, 2)\n    return average_depth\n", "entry_point": "calculate_average_depth", "input": "[4.1, 4.12, 4.14]", "output": "4.12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20373_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027135", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "44.97700000000001, 0", "output": "44.97700000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027136", "code": "def reorderSpaces(text: str) -> str:\n    total_spaces = text.count(' ')\n    words = text.split()\n    if len(words) == 1:\n        return words[0] + ' ' * total_spaces\n    spaces_between_words = total_spaces // (len(words) - 1) if len(words) > 1 else 0\n    spaces_at_end = total_spaces % (len(words) - 1) if len(words) > 1 else total_spaces\n    return (' ' * spaces_between_words).join(words) + ' ' * spaces_at_end\n", "entry_point": "reorderSpaces", "input": "'hello'", "output": "'hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94297_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027137", "code": "def get_parent_directory(file_path):\n    # Split the file path into directory components\n    components = file_path.split('/')\n    # Join all components except the last one to get the parent directory path\n    parent_directory = '/'.join(components[:-1])\n    return parent_directory\n", "entry_point": "get_parent_directory", "input": "'ppath/po/ath/file.txt'", "output": "'ppath/po/ath'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11463_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027138", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'someprefix_parpart1_sroot_partxroot'", "output": "'parpart1_sroot_partxroot'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7778", "output": "{1, 7778, 2, 3889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "169", "output": "{1, 169, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1187", "output": "{1, 1187}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1186", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027142", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "' 23Wd1Wd'", "output": "' 23Wd1Wd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027143", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2605", "output": "{1, 5, 2605, 521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2604", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027144", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst or len(lst) == 1:\n        return lst\n    first_element = lst.pop(0)\n    modified_list = [num * first_element for num in lst]\n    modified_list.append(first_element)\n    return modified_list\n", "entry_point": "process_list", "input": "[4, 7, 5, 6, 2, 6, 5, 5]", "output": "[28, 20, 24, 8, 24, 20, 20, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122566_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027145", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "92", "output": "'92'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027146", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8589", "output": "{1, 3, 7, 1227, 8589, 2863, 21, 409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027147", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "3", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027148", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 4, 1, 6]", "output": "[6, 5, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110316_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027149", "code": "def determine_winner(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    if player1_score > player2_score:\n        return 1\n    elif player2_score > player1_score:\n        return 2\n    else:\n        return 0\n", "entry_point": "determine_winner", "input": "[3, 5, 7], [2, 1, 4]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137063_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027150", "code": "def modify_array(arr):\n    modified_arr = []\n    for num in arr:\n        if num % 2 == 0:\n            modified_arr.append(num * 2)\n        else:\n            modified_arr.append(num ** 2)\n    return modified_arr\n", "entry_point": "modify_array", "input": "[4, 2, 3, 4, 5, 3, 4]", "output": "[8, 4, 9, 8, 25, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5262_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027151", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'ddef'", "output": "'ddef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027152", "code": "def get_command_name(command_int):\n    commands = {\n        3: \"Telemetry\",\n        4: \"GetSettings\",\n        5: \"SetSettings\",\n        6: \"GetGestures\",\n        7: \"SaveGesture\",\n        8: \"DeleteGesture\",\n        9: \"PerformGestureId\",\n        10: \"PerformGestureRaw\",\n        11: \"SetPositions\",\n        12: \"UpdateLastTimeSync\",\n        13: \"GetTelemetry\",\n        14: \"StartTelemetry\",\n        15: \"StopTelemetry\",\n        16: \"GetMioPatterns\",\n        17: \"SetMioPatterns\"\n    }\n    return commands.get(command_int, \"Unknown Command\")\n", "entry_point": "get_command_name", "input": "14", "output": "'StartTelemetry'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81920_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027153", "code": "def generate_notification_message(text):\n    if \"KTU\" in text:\n        text = text.replace(\"KTU\", \"*KTU*\")\n    if \"http\" in text or \"https\" in text:\n        text = text.replace(\"http\", \"<URL>\").replace(\"https\", \"<URL>\")\n    if \"notification\" in text:\n        text = \"\ud83d\udce2 New s add *KTU* notification: \" + text\n    return text\n", "entry_point": "generate_notification_message", "input": "'onoCheckonou'", "output": "'onoCheckonou'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53218_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027154", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "2.25, 1", "output": "2.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027155", "code": "def calculate_class_weight(total_samples: int, num_classes: int, class_samples: int) -> float:\n    class_weight = total_samples / (num_classes * class_samples)\n    return class_weight\n", "entry_point": "calculate_class_weight", "input": "50, 4, 7", "output": "1.7857142857142858", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69664_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6170", "output": "{1, 2, 5, 617, 10, 3085, 1234, 6170}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6169", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027157", "code": "def process_list(lst):\n    negatives = [num for num in lst if num < 0]\n    positives = [num for num in lst if num > 0]\n    if negatives:\n        min_negative = min(negatives)\n        lst = [num for num in lst if num != min_negative]\n    if positives:\n        max_positive = max(positives)\n        lst = [num for num in lst if num != max_positive]\n    return lst\n", "entry_point": "process_list", "input": "[-1, 10, 3, 2, 2, 6, 5, 3]", "output": "[3, 2, 2, 6, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147724_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027158", "code": "def format_version(version_str: str) -> str:\n    # Split the version string by '.'\n    version_components = version_str.split('.')\n    # Convert components to integers\n    version_integers = [int(component) for component in version_components]\n    # Format the version string as 'vX.Y.Z'\n    formatted_version = 'v' + '.'.join(map(str, version_integers))\n    return formatted_version\n", "entry_point": "format_version", "input": "'1.2.23'", "output": "'v1.2.23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15533_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027159", "code": "def parse_vm_info(input_str):\n    vm_info = {}\n    entries = input_str.split('^')\n    for entry in entries:\n        vm_name, ip_address = entry.split(':')\n        vm_info[vm_name] = ip_address\n    return vm_info\n", "entry_point": "parse_vm_info", "input": "'V3:VM1.1^VM2:192.16.1.313V3'", "output": "{'V3': 'VM1.1', 'VM2': '192.16.1.313V3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46533_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027160", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'33.5311.0.3'", "output": "'33.5311.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3316", "output": "{1, 2, 4, 3316, 1658, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3315", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027162", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "2147483647, 2", "output": "2147483649", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027163", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'eS21 Dec 11842De'", "output": "'Dec eS21, 11842De'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027164", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[2, 4, 6, 8, 10, 8]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027165", "code": "def calculate_ranks(scores):\n    rank_dict = {}\n    current_rank = 1\n    ranks = []\n    for score in scores:\n        if score in rank_dict:\n            ranks.append(rank_dict[score])\n        else:\n            rank_dict[score] = current_rank\n            ranks.append(current_rank)\n            current_rank += 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 90, 90, 85, 80, 75]", "output": "[1, 2, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149455_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027166", "code": "def encode_string(input_string):\n    try:\n        # Try encoding the input string to check if it's already in UTF-8 format\n        encoded_bytes = input_string.encode('utf-8')\n        return encoded_bytes\n    except UnicodeEncodeError:\n        # If encoding raises an error, encode the string into UTF-8 format\n        return input_string.encode('utf-8')\n", "entry_point": "encode_string", "input": "'Helll,Hllo, \u4f60\u597d'", "output": "b'Helll,Hllo, \\xe4\\xbd\\xa0\\xe5\\xa5\\xbd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103372_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027167", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'ParallelContext'", "output": "'SerialContext'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "172", "output": "{1, 2, 4, 43, 172, 86}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt171", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027169", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[80, 75, 72, 60, 50], 3", "output": "75.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4091", "output": "{1, 4091}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027171", "code": "def flatten_params(params):\n    def flatten_params_recursive(param_list):\n        flat_list = []\n        for param in param_list:\n            if isinstance(param, list):\n                flat_list.extend(flatten_params_recursive(param))\n            else:\n                flat_list.append(param)\n        return flat_list\n    return flatten_params_recursive(params)\n", "entry_point": "flatten_params", "input": "[[7], [3], [1, 0], [7], [1]]", "output": "[7, 3, 1, 0, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133707_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027172", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'m_yl_le'", "output": "'m_yl_le'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027173", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7295", "output": "{1, 1459, 5, 7295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027174", "code": "def totalNQueens(n):\n    def is_safe(board, row, col):\n        for i in range(row):\n            if board[i] == col or abs(i - row) == abs(board[i] - col):\n                return False\n        return True\n    def backtrack(board, row):\n        nonlocal count\n        if row == n:\n            count += 1\n            return\n        for col in range(n):\n            if is_safe(board, row, col):\n                board[row] = col\n                backtrack(board, row + 1)\n    count = 0\n    board = [-1] * n\n    backtrack(board, 0)\n    return count\n", "entry_point": "totalNQueens", "input": "4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107753_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027175", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'QZA'", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5941", "output": "{1, 13, 457, 5941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5940", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027177", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'prettixb', 'PRETIXBASEPR'", "output": "'prettixbPRETIXBASEPR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027178", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[4, 4, 4, 1, 3, 5]", "output": "[4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "812", "output": "{1, 2, 4, 7, 203, 812, 14, 116, 406, 58, 28, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt811", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027180", "code": "from typing import List\ndef sum_divisible_by_3_and_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30, 60, 105]", "output": "210", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80529_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027181", "code": "def calculate_moving_average(nums, k):\n    moving_averages = []\n    for i in range(len(nums) - k + 1):\n        window_sum = sum(nums[i:i+k])\n        moving_averages.append(window_sum / k)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[4.0, 4.0, 4.0, 5.0], 2", "output": "[4.0, 4.0, 4.5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143205_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027182", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'descriptwo'", "output": "'descriptwo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027183", "code": "def extract_digits(str_input):\n    final_str = \"\"\n    for char in str_input:\n        if char.isdigit():  # Check if the character is a digit\n            final_str += char\n    return final_str\n", "entry_point": "extract_digits", "input": "'abc3xyz1!@#6def'", "output": "'316'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132906_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027184", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9327", "output": "{1, 3, 3109, 9327}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9326", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027185", "code": "def calculate_total_photons(energy_bins, number_of_photons):\n    total_photons = 0\n    for energy, photons in zip(energy_bins, number_of_photons):\n        total_photons += energy * photons\n    return total_photons\n", "entry_point": "calculate_total_photons", "input": "[10, 20, 25], [10, 10, 10]", "output": "550", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106074_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027186", "code": "def sum_of_even_numbers(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_of_even_numbers", "input": "[42]", "output": "42", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4238_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7387", "output": "{89, 1, 83, 7387}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7386", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027188", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[5, 3, -1, 4, 4, 0, 3, 4]", "output": "[5, 8, 7, 11, 15, 15, 18, 22]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027189", "code": "import re\nre_date = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])$')\nre_time = re.compile(r'^([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?$')\nre_datetime = re.compile(r'^(\\d{4})\\D?(0[1-9]|1[0-2])\\D?([12]\\d|0[1-9]|3[01])(\\D?([01]\\d|2[0-3])\\D?([0-5]\\d)\\D?([0-5]\\d)?\\D?(\\d{3,6})?([zZ])?)?$')\nre_decimal = re.compile('^(\\d+)\\.(\\d+)$')\ndef validate_data_format(input_string: str) -> str:\n    if re.match(re_date, input_string):\n        return \"date\"\n    elif re.match(re_time, input_string):\n        return \"time\"\n    elif re.match(re_datetime, input_string):\n        return \"datetime\"\n    elif re.match(re_decimal, input_string):\n        return \"decimal\"\n    else:\n        return \"unknown\"\n", "entry_point": "validate_data_format", "input": "'2023-03-15 14:30:00'", "output": "'datetime'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67151_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027190", "code": "def generate_property_metadata(prop, descriptions):\n    metadata = {\n        \"description\": descriptions.get(prop, '')\n    }\n    if prop == '@owner_id':\n        metadata['name'] = 'owner_id'\n    return metadata\n", "entry_point": "generate_property_metadata", "input": "'@nonexistent_id', {}", "output": "{'description': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127315_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027191", "code": "def generate_identifier(name, label):\n    # Remove non-alphanumeric characters from the name\n    name = ''.join(char for char in name if char.isalnum())\n    # Concatenate lowercase name and uppercase label\n    identifier = name.lower() + label.upper()\n    # Truncate the identifier if it exceeds 20 characters\n    if len(identifier) > 20:\n        identifier = identifier[:20]\n    return identifier\n", "entry_point": "generate_identifier", "input": "'PPRPRETIP!!!', 'PRETPR'", "output": "'pprpretipPRETPR'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128956_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027192", "code": "def find_triplets(nums):\n    nums.sort()\n    n = len(nums)\n    result = []\n    for i in range(n - 2):\n        if i > 0 and nums[i] == nums[i - 1]:\n            continue\n        left, right = i + 1, n - 1\n        while left < right:\n            total = nums[i] + nums[left] + nums[right]\n            if total == 0:\n                result.append([nums[i], nums[left], nums[right]])\n                while left < right and nums[left] == nums[left + 1]:\n                    left += 1\n                while left < right and nums[right] == nums[right - 1]:\n                    right -= 1\n                left += 1\n                right -= 1\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    return result\n", "entry_point": "find_triplets", "input": "[-1, 0, 1, 2]", "output": "[[-1, 0, 1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13016_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027193", "code": "def generate_stairs(N):\n    stairs_ = []\n    for i in range(1, N + 1):\n        symb = \"#\" * i\n        empty = \" \" * (N - i)\n        stairs_.append(symb + empty)\n    return stairs_\n", "entry_point": "generate_stairs", "input": "2", "output": "['# ', '##']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69687_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027194", "code": "def sum_absolute_differences(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    total_diff = 0\n    for num1, num2 in zip(list1, list2):\n        total_diff += abs(num1 - num2)\n    return total_diff\n", "entry_point": "sum_absolute_differences", "input": "[0, 0, 7], [0, 0, 21]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145947_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027195", "code": "def categorize_fixtures(fixtures):\n    categorized_fixtures = {'LED': [], 'Conventional': [], 'Mover': []}\n    for fixture in fixtures:\n        source = fixture['source']\n        categorized_fixtures[source].append(fixture)\n    return categorized_fixtures\n", "entry_point": "categorize_fixtures", "input": "[]", "output": "{'LED': [], 'Conventional': [], 'Mover': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49243_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027196", "code": "from typing import List\ndef sum_within_ranges(lower_bounds: List[int]) -> int:\n    total_sum = 0\n    for i in range(len(lower_bounds) - 1):\n        start = lower_bounds[i]\n        end = lower_bounds[i + 1]\n        total_sum += sum(range(start, end))\n    total_sum += lower_bounds[-1]  # Add the last lower bound\n    return total_sum\n", "entry_point": "sum_within_ranges", "input": "[-9]", "output": "-9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29413_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027197", "code": "def sum_digits_power(n):\n    digit_sum = 0\n    num_digits = 0\n    temp = n\n    # Calculate the sum of digits\n    while temp > 0:\n        digit_sum += temp % 10\n        temp //= 10\n    # Calculate the number of digits\n    temp = n\n    while temp > 0:\n        num_digits += 1\n        temp //= 10\n    # Calculate the result\n    result = digit_sum ** num_digits\n    return result\n", "entry_point": "sum_digits_power", "input": "19000", "output": "100000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137515_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027198", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'2353'", "output": "2353", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027199", "code": "def generate_symmetric_banner(text, gap):\n    total_length = len(text) + gap\n    left_padding = (total_length - len(text)) // 2\n    right_padding = total_length - len(text) - left_padding\n    symmetric_banner = \" \" * left_padding + text + \" \" * right_padding\n    return symmetric_banner\n", "entry_point": "generate_symmetric_banner", "input": "'HeeHello,', 27", "output": "'             HeeHello,              '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92337_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027200", "code": "def process_polymer(orig, to_remove, max_len):\n    polymer = []\n    for i in range(len(orig)):\n        if max_len > 0 and len(polymer) >= max_len:\n            return None\n        if to_remove and orig[i].lower() == to_remove:\n            continue\n        polymer.append(orig[i])\n        end_pair = polymer[len(polymer)-2:]\n        while len(polymer) > 1 and end_pair[0] != end_pair[1] and end_pair[0].lower() == end_pair[1].lower():\n            polymer = polymer[:-2]\n            end_pair = polymer[len(polymer)-2:]\n    return ''.join(polymer)\n", "entry_point": "process_polymer", "input": "'dCaCBAca', '', 10", "output": "'dCaCBAca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127128_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027201", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'Error', 0, 0", "output": "'0: Error'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027202", "code": "def get_formatted_name(first, middle=None, last=None):\n    \"\"\"Generate a neatly formatted full name\"\"\"\n    if middle is not None and last is not None:\n        full_name = f\"{first} {middle} {last}\"\n    elif middle is None and last is not None:\n        full_name = f\"{first} {last}\"\n    else:\n        full_name = first\n    return full_name.title()\n", "entry_point": "get_formatted_name", "input": "'Peli', 'Jaene', 'Smmith'", "output": "'Peli Jaene Smmith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137961_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5317", "output": "{1, 13, 409, 5317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027204", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[4, 3, 2, 0, 3, 0, 5, 3, 0]", "output": "[8, 9, 4, 0, 9, 0, 15, 9, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027205", "code": "def circular_sum(input_list):\n    return [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n", "entry_point": "circular_sum", "input": "[4, 6, 4, 0, 5, 0, 3]", "output": "[10, 10, 4, 5, 5, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43564_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027206", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7919", "output": "{1, 7919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7918", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027207", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "4", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027208", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "33.5, 0, True", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027209", "code": "import re\nfrom typing import List\ndef _splitter(text: str) -> List[str]:\n    if len(text) == 0:\n        return []\n    if \"'\" not in text:\n        return [text]\n    return re.findall(\"'([^']+)'\", text)\n", "entry_point": "_splitter", "input": "\"'here'\"", "output": "['here']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84189_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9377", "output": "{1, 9377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9376", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027211", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[85, 85, 101, 101, 102]", "output": "[102, 101, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44822_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027212", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'dats'", "output": "'dats_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027213", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'!!'", "output": "'!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027214", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027215", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[100, 100, 100, 84], 'add'", "output": "[384, 384, 384, 384]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027216", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 3", "output": "343", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt36", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027217", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5982", "output": "{1, 2, 3, 997, 6, 1994, 2991, 5982}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027218", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'<KEY>K'", "output": "'password123K'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027219", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    return words[0] + ''.join(word.capitalize() for word in words[1:])\n", "entry_point": "snake_to_camel", "input": "'d'", "output": "'d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61108_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027220", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5073", "output": "{89, 1, 3, 267, 5073, 19, 57, 1691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5072", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027221", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9202", "output": "{1, 2, 43, 107, 9202, 214, 86, 4601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027222", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[-1, -2]", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97914_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027223", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9273", "output": "{1, 33, 3, 281, 11, 843, 3091, 9273}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027224", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[5, 6, 7, 4, 0, 3, 1, -1]", "output": "[5, 11, 18, 22, 22, 25, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027225", "code": "def count_unique_modules(imports):\n    unique_modules = {}\n    for import_line in imports:\n        if 'import ' in import_line:\n            modules = import_line.split('import ')[1].split(',')\n        else:\n            modules = import_line.split('from ')[1].split(' import ')[0].split(',')\n        for module in modules:\n            module = module.strip().split(' as ')[0].split('.')[-1]\n            unique_modules[module] = unique_modules.get(module, 0) + 1\n    return unique_modules\n", "entry_point": "count_unique_modules", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111712_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027226", "code": "def calculate_remaining_calls(api_limit, calls_made):\n    remaining_calls = api_limit - calls_made\n    return remaining_calls\n", "entry_point": "calculate_remaining_calls", "input": "300, 1", "output": "299", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91825_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027227", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'.13..2'", "output": "'.13..3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027228", "code": "import json\ndef extract_keys(json_obj):\n    keys = set()\n    if isinstance(json_obj, dict):\n        for key, value in json_obj.items():\n            keys.add(key)\n            keys.update(extract_keys(value))\n    elif isinstance(json_obj, list):\n        for item in json_obj:\n            keys.update(extract_keys(item))\n    return keys\n", "entry_point": "extract_keys", "input": "{'type': 'example', 'number': 1}", "output": "{'type', 'number'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122660_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027229", "code": "def replace_last_occurrence(path, to_replace, replacement):\n    # Find the index of the last occurrence of 'to_replace' in 'path'\n    last_index = path.rfind(to_replace)\n    if last_index == -1:\n        return path  # If 'to_replace' not found, return the original path\n    # Split the path into two parts based on the last occurrence of 'to_replace'\n    path_before = path[:last_index]\n    path_after = path[last_index + len(to_replace):]\n    # Replace the last occurrence of 'to_replace' with 'replacement'\n    modified_path = path_before + replacement + path_after\n    return modified_path\n", "entry_point": "replace_last_occurrence", "input": "'/home/user/documents/', 'documents', 'docultx'", "output": "'/home/user/docultx/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140432_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027230", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 2, 3, 6, 6, 4, 5]", "output": "[6, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027231", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[8, 7, 3, 5, 1, 2, 4, 3], 8", "output": "[[8, 7, 3, 5, 1, 2, 4, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027232", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if N > len(sorted_scores):\n        N = len(sorted_scores)\n    return sum(sorted_scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[-556], 1", "output": "-556.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132945_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027233", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8905", "output": "{1, 65, 5, 8905, 137, 13, 685, 1781}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027234", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'', 'New York'", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027235", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'cv'", "output": "'Cv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027236", "code": "def concat(parameters, sep):\n    text = ''\n    for i in range(len(parameters)):\n        text += str(parameters[i])\n        if i != len(parameters) - 1:\n            text += sep\n        else:\n            text += '\\n'\n    return text\n", "entry_point": "concat", "input": "[4, 4, 1, 2, 4, 4, 4], '--'", "output": "'4--4--1--2--4--4--4\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80875_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027237", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'paragraph.'", "output": "'<p>paragraph.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027238", "code": "import os\nfrom typing import List, Dict\ndef collect_package_data(PROJECT: str, folders: List[str]) -> Dict[str, List[str]]:\n    package_data = {}\n    for folder in folders:\n        files_list = []\n        for root, _, files in os.walk(os.path.join(PROJECT, folder)):\n            for filename in files:\n                files_list.append(filename)\n        package_data[folder] = files_list\n    return package_data\n", "entry_point": "collect_package_data", "input": "'/path/to/project', ['ic', 'templates']", "output": "{'ic': [], 'templates': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77702_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027239", "code": "def calculate_even_sum(numbers):\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[12, 14]", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38409_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027240", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 60)]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027241", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[2, 2, 3, 3]", "output": "[5, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027242", "code": "def solution(s):\n    start = 0\n    end = len(s) - 1\n    while start < len(s) and not s[start].isalnum():\n        start += 1\n    while end >= 0 and not s[end].isalnum():\n        end -= 1\n    return s[start:end+1]\n", "entry_point": "solution", "input": "'     '", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114817_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027243", "code": "def sum_multiples_3_5(nums):\n    total_sum = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_5", "input": "[15, 20, 30, 1]", "output": "65", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41452_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027244", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num * 3)\n        if num % 5 == 0:\n            processed_list[-1] -= 5\n    return processed_list\n", "entry_point": "process_integers", "input": "[14, 1, 1, 3, 2, 2, 2]", "output": "[16, 3, 3, 9, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11311_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027245", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'0.5.20'", "output": "(0, 5, 20)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027246", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7787", "output": "{1, 7787, 13, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027247", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'character'", "output": "'character'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027248", "code": "def filter_keys(dictionary):\n    filtered_dict = {}\n    for key, value in dictionary.items():\n        if \"key\" not in key.lower():\n            filtered_dict[key] = value\n    return filtered_dict\n", "entry_point": "filter_keys", "input": "{'key': 1, 'anotherKey': 2}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2678_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027249", "code": "angle = lambda n: (n - 2) * 180\ndef polygon_info(sides_list):\n    result_dict = {}\n    for n in sides_list:\n        result_dict[n] = angle(n)\n    return result_dict\n", "entry_point": "polygon_info", "input": "[3, 4]", "output": "{3: 180, 4: 360}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148873_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027250", "code": "def trap_rainwater(buildings):\n    n = len(buildings)\n    if n <= 2:\n        return 0\n    left_max = [0] * n\n    right_max = [0] * n\n    left_max[0] = buildings[0]\n    for i in range(1, n):\n        left_max[i] = max(left_max[i - 1], buildings[i])\n    right_max[n - 1] = buildings[n - 1]\n    for i in range(n - 2, -1, -1):\n        right_max[i] = max(right_max[i + 1], buildings[i])\n    total_rainwater = 0\n    for i in range(1, n - 1):\n        total_rainwater += max(0, min(left_max[i], right_max[i]) - buildings[i])\n    return total_rainwater\n", "entry_point": "trap_rainwater", "input": "[0, 1, 0, 1, 0, 2, 1, 0, 1, 0, 3]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33165_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027251", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7051", "output": "{11, 1, 641, 7051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027252", "code": "def extract_major_version(version: str) -> int:\n    dot_index = version.find('.')\n    if dot_index == -1:\n        return int(version)\n    return int(version[:dot_index])\n", "entry_point": "extract_major_version", "input": "'1011001'", "output": "1011001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116121_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027253", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[4, 7, 11]", "output": "[4, 7, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027254", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2851", "output": "{1, 2851}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2850", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027255", "code": "def find_pattern_occurrences(text, pattern):\n    occurrences = []\n    pattern_len = len(pattern)\n    text_len = len(text)\n    for i in range(text_len - pattern_len + 1):\n        if text[i:i + pattern_len] == pattern:\n            occurrences.append((i, i + pattern_len))\n    return occurrences\n", "entry_point": "find_pattern_occurrences", "input": "'ababab', 'ab'", "output": "[(0, 2), (2, 4), (4, 6)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91050_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027256", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[40], 1", "output": "40.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027257", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5", "output": "{1, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5677", "output": "{1, 811, 5677, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5676", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027259", "code": "def gpu_utilization_summary(utilization_list, threshold):\n    total_utilization = 0\n    max_utilization = 0\n    num_gpus_exceed_threshold = 0\n    for utilization in utilization_list:\n        total_utilization += utilization\n        max_utilization = max(max_utilization, utilization)\n        if utilization > threshold:\n            num_gpus_exceed_threshold += 1\n    average_utilization = total_utilization / len(utilization_list)\n    return average_utilization, max_utilization, num_gpus_exceed_threshold\n", "entry_point": "gpu_utilization_summary", "input": "[90.1, 85.0, 75.0, 70.0, 72.5], 80.0", "output": "(78.52000000000001, 90.1, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17695_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027260", "code": "ALLOWED_OPTIONS = ['OPTION_HIDE_WATCHED', 'OPTION_USE_AUTH_URL', 'OPTION_SEARCH_LIMIT', 'CONF_KODI_INSTANCE', 'CONF_SENSOR_RECENTLY_ADDED_TVSHOW', 'CONF_SENSOR_RECENTLY_ADDED_MOVIE', 'CONF_SENSOR_PLAYLIST', 'CONF_SENSOR_SEARCH']\ndef filter_config_options(config_options: dict) -> dict:\n    filtered_options = {key: value for key, value in config_options.items() if key in ALLOWED_OPTIONS}\n    return filtered_options\n", "entry_point": "filter_config_options", "input": "{'OPTION_OTHER': 1, 'CONF_SENSOR_OTHER': 2}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10317_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027261", "code": "def calculate_max_drawdown_ratio(stock_prices):\n    if not stock_prices:\n        return 0.0\n    peak = stock_prices[0]\n    trough = stock_prices[0]\n    max_drawdown_ratio = 0.0\n    for price in stock_prices:\n        if price > peak:\n            peak = price\n            trough = price\n        elif price < trough:\n            trough = price\n            drawdown = peak - trough\n            drawdown_ratio = drawdown / peak\n            max_drawdown_ratio = max(max_drawdown_ratio, drawdown_ratio)\n    return max_drawdown_ratio\n", "entry_point": "calculate_max_drawdown_ratio", "input": "[3.0, 5.0, 6.0, 5.0]", "output": "0.16666666666666666", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79546_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027262", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[2, 2, 1, 4, 6, 0, 1, 2]", "output": "[2, 6, 2, 0, 1, 1, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027263", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1145", "output": "{1, 5, 229, 1145}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1144", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027264", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        total_sum += num\n        count += 1\n    if count == 0:\n        return 0.00\n    average = total_sum / count\n    return round(average, 2)\n", "entry_point": "calculate_average", "input": "[30, 30, 30, 31.0]", "output": "30.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82361_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027265", "code": "def get_values(dict, endIndex):\n    acc = \"[\"\n    for i in range(0, endIndex + 1):\n        val = dict.get(i, 0)  # Get value for key i, default to 0 if key not present\n        acc += str(val)  # Add value to accumulator\n        if i != endIndex:\n            acc += \",\"\n    return acc + \"]\"\n", "entry_point": "get_values", "input": "{0: 0, 1: 5, 2: 1, 3: 2, 4: 1, 5: 0}, 7", "output": "'[0,5,1,2,1,0,0,0]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112034_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027266", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[0, 1, 1, 3, 1]", "output": "[0, 1, 2, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027267", "code": "def fibonacci(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, N + 1):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci", "input": "12", "output": "144", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55951_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027268", "code": "def GetNote(note_name, scale):\n    midi_val = (scale - 1) * 12  # MIDI value offset based on scale\n    # Dictionary to map note letters to MIDI offsets\n    note_offsets = {'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11}\n    note = note_name[0]\n    if note not in note_offsets:\n        raise ValueError(\"Invalid note name\")\n    midi_val += note_offsets[note]\n    if len(note_name) > 1:\n        modifier = note_name[1]\n        if modifier == 's' or modifier == '#':\n            midi_val += 1\n        else:\n            raise ValueError(\"Invalid note modifier\")\n    if note_name[:2] in ('es', 'e#', 'bs', 'b#'):\n        raise ValueError(\"Invalid note combination\")\n    return midi_val\n", "entry_point": "GetNote", "input": "'c#', 2", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24350_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027269", "code": "def count_unique_integers(input_list):\n    unique_integers = set()\n    for element in input_list:\n        if isinstance(element, int):\n            unique_integers.add(element)\n    return len(unique_integers)\n", "entry_point": "count_unique_integers", "input": "[7]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135265_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027270", "code": "from typing import List\ndef modified_shell_sort(arr: List[int], h: int) -> List[int]:\n    n = len(arr)\n    while h > 0:\n        for i in range(h, n):\n            temp = arr[i]\n            j = i\n            while j >= h and arr[j - h] > temp:\n                arr[j] = arr[j - h]\n                j -= h\n            arr[j] = temp\n        h //= 2\n    return arr\n", "entry_point": "modified_shell_sort", "input": "[54, 35, 34, 35, 33], 2", "output": "[33, 34, 35, 35, 54]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100246_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027271", "code": "def split_ramps(ramps):\n    individual_exposures = []\n    for ramp in ramps:\n        individual_exposures.extend(ramp)\n    return individual_exposures\n", "entry_point": "split_ramps", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92307_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5636", "output": "{1, 2, 2818, 5636, 4, 1409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5635", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027273", "code": "def calculate_bmi(weight, height):\n    bmi = weight / (height ** 2)\n    return round(bmi, 2)\n", "entry_point": "calculate_bmi", "input": "70.5, 1.75", "output": "23.02", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124353_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027274", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'!!aab0##'", "output": "'aab0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027275", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'pathp1'", "output": "'Content for pathp1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027276", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hwo'", "output": "['hwo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027277", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7573", "output": "{1, 7573}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7572", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027278", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[2, 0, 3, 1, 1, 4, 4]", "output": "[2, 3, 4, 2, 5, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113927_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7771", "output": "{19, 1, 409, 7771}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027280", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 3, 2, 2, 4, 1]", "output": "[1, 7, 4, 4, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027281", "code": "def convert_to_binary(n):\n    binary_str = ''\n    while n != 0:\n        binary_str = str(n % 2) + binary_str\n        n //= 2\n    return binary_str\n", "entry_point": "convert_to_binary", "input": "7", "output": "'111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15737_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027282", "code": "def generate_permutations(s):\n    if len(s) == 1:\n        return [s]\n    permutations = []\n    for i, char in enumerate(s):\n        for perm in generate_permutations(s[:i] + s[i+1:]):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'AC'", "output": "['AC', 'CA']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13343_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027283", "code": "from datetime import datetime\ndef find_earliest_date(dates):\n    earliest_date = datetime.max\n    for date_str in dates:\n        date = datetime.strptime(date_str, \"%Y-%m-%d\")\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date.strftime(\"%Y-%m-%d\")\n", "entry_point": "find_earliest_date", "input": "['2023-01-15', '2023-01-16', '2023-01-20']", "output": "'2023-01-15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55665_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027284", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[3, 9, 2, 2, 8, 7, 2, 2], 2", "output": "[[3, 9], [2, 2], [8, 7], [2, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027285", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[1, 2, 5]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027286", "code": "MAX_CHAR_TEXTO = 10000\ndef process_text(input_text):\n    if len(input_text) <= MAX_CHAR_TEXTO:\n        return input_text\n    else:\n        return input_text[:MAX_CHAR_TEXTO] + \"...\"\n", "entry_point": "process_text", "input": "'the'", "output": "'the'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104424_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027287", "code": "def most_common_numbers(data):\n    frequency = {}\n    # Count the frequency of each number\n    for num in data:\n        frequency[num] = frequency.get(num, 0) + 1\n    max_freq = max(frequency.values())\n    most_common = [num for num, freq in frequency.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[6, 6, 1]", "output": "[6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95940_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027288", "code": "def double_elements(input_list):\n    doubled_list = []\n    for num in input_list:\n        doubled_list.append(num * 2)\n    return doubled_list\n", "entry_point": "double_elements", "input": "[1, 2, 3, 4]", "output": "[2, 4, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99064_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027289", "code": "from typing import List\ndef max_product(nums: List[int]) -> int:\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[4, 7, 1, 2, 3]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91738_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5399", "output": "{1, 5399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027291", "code": "def separate_even_odd(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    return even_numbers, odd_numbers\n", "entry_point": "separate_even_odd", "input": "[4, 10, 4, 10, 10, 10, 10, 4]", "output": "([4, 10, 4, 10, 10, 10, 10, 4], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79993_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027292", "code": "sales = [50, 54, 29, 33, 22, 100, 45, 54, 89, 75]\ndef calculate_median(sales_list):\n    sorted_sales = sorted(sales_list)\n    n = len(sorted_sales)\n    if n % 2 == 0:\n        median = (sorted_sales[n//2 - 1] + sorted_sales[n//2]) / 2\n    else:\n        median = sorted_sales[n//2]\n    return median\n", "entry_point": "calculate_median", "input": "[70, 72, 74, 75, 82, 84]", "output": "74.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113873_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027293", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7459", "output": "{1, 7459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027294", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 3, 3, 3, 3]", "output": "[6, 6, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027295", "code": "def find_subarray_sum_indices(nums):\n    cumulative_sums = {0: -1}\n    cumulative_sum = 0\n    result = []\n    for index, num in enumerate(nums):\n        cumulative_sum += num\n        if cumulative_sum in cumulative_sums:\n            result = [cumulative_sums[cumulative_sum] + 1, index]\n            return result\n        cumulative_sums[cumulative_sum] = index\n    return result\n", "entry_point": "find_subarray_sum_indices", "input": "[1, 2, 3]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56814_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027296", "code": "import math\ndef find_max_ceiling_index(n, m, s):\n    mx = 0\n    ind = 0\n    for i in range(n):\n        if math.ceil(s[i] / m) >= mx:\n            mx = math.ceil(s[i] / m)\n            ind = i\n    return ind + 1\n", "entry_point": "find_max_ceiling_index", "input": "3, 1, [1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97191_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027297", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\e\\\\beg}giula'", "output": "'\\\\e\\\\beg}giula'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027298", "code": "def count_a_in_list(strings):\n    total_count = 0\n    for string in strings:\n        for char in string:\n            if char.lower() == 'a':\n                total_count += 1\n    return total_count\n", "entry_point": "count_a_in_list", "input": "['a', 'aaa']", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113849_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027299", "code": "def circular_sum(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 2, 4, 4, 0, 2]", "output": "[2, 6, 8, 4, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148378_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027300", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "4", "output": "'0246'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027301", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1074", "output": "{1, 2, 3, 358, 6, 1074, 179, 537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1073", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027302", "code": "def format_duration(seconds):\n    hours = seconds // 3600\n    minutes = (seconds % 3600) // 60\n    remaining_seconds = seconds % 60\n    duration_parts = []\n    if hours:\n        duration_parts.append(f\"{hours} {'hour' if hours == 1 else 'hours'}\")\n    if minutes:\n        duration_parts.append(f\"{minutes} {'minute' if minutes == 1 else 'minutes'}\")\n    if remaining_seconds:\n        duration_parts.append(f\"{remaining_seconds} {'second' if remaining_seconds == 1 else 'seconds'}\")\n    if len(duration_parts) == 0:\n        return \"0 seconds\"\n    elif len(duration_parts) == 1:\n        return duration_parts[0]\n    else:\n        return ', '.join(duration_parts[:-1]) + f\", and {duration_parts[-1]}\"\n", "entry_point": "format_duration", "input": "3661", "output": "'1 hour, 1 minute, and 1 second'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85373_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027303", "code": "from urllib.parse import unquote\ndef decode_query_string(query: str) -> dict:\n    decoded_query = {}\n    pairs = query.split('&')\n    for pair in pairs:\n        key, value = pair.split('=')\n        decoded_key = unquote(key)\n        decoded_value = unquote(value)\n        decoded_query[decoded_key] = decoded_value\n    return decoded_query\n", "entry_point": "decode_query_string", "input": "'fbfbazqfbaz=uqxx'", "output": "{'fbfbazqfbaz': 'uqxx'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149137_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027304", "code": "def parse_test_cases(test_cases):\n    test_dict = {}\n    current_suite = None\n    for line in test_cases.splitlines():\n        if '.' in line or '/' in line:\n            current_suite = line.strip()\n            test_dict[current_suite] = []\n        elif current_suite:\n            test_dict[current_suite].append(line.strip())\n    return test_dict\n", "entry_point": "parse_test_cases", "input": "'gtest_main.c'", "output": "{'gtest_main.c': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88834_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027305", "code": "def calculate_state_areas(cities):\n    state_areas = {}\n    for city in cities:\n        state_name = city[\"stateName\"]\n        if state_name not in state_areas:\n            state_areas[state_name] = [0, 0]\n        state_areas[state_name][0] += city[\"landArea\"]\n        state_areas[state_name][1] += city[\"waterArea\"]\n    return {state: tuple(areas) for state, areas in state_areas.items()}\n", "entry_point": "calculate_state_areas", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114405_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027306", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1468", "output": "{1, 2, 4, 367, 1468, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1467", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027307", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "132", "output": "{1, 2, 3, 132, 66, 4, 33, 6, 11, 44, 12, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt131", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027308", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5875", "output": "{1, 5, 235, 47, 5875, 1175, 25, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5874", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027309", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "6", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027310", "code": "def compute_pr_inversion(input_list):\n    results = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            results.append(num ** 2)  # Square the even number\n        else:\n            results.append(num ** 3)  # Cube the odd number\n    return results\n", "entry_point": "compute_pr_inversion", "input": "[6, 5, 6, 3, 3, 5, 1, 5, 1]", "output": "[36, 125, 36, 27, 27, 125, 1, 125, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49757_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027311", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9637", "output": "{1, 419, 9637, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9636", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027312", "code": "import sys\ndef calculate_memory_usage(obj):\n    if isinstance(obj, (int, float)):\n        return sys.getsizeof(obj)\n    elif isinstance(obj, str):\n        return sys.getsizeof(obj)\n    elif isinstance(obj, list) or isinstance(obj, tuple):\n        return sum(calculate_memory_usage(item) for item in obj)\n    elif isinstance(obj, dict):\n        return sum(calculate_memory_usage(key) + calculate_memory_usage(value) for key, value in obj.items())\n    else:\n        return 0  # Handle other data types if needed\n", "entry_point": "calculate_memory_usage", "input": "1", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11596_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027313", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[-1, -1, -1, -1, 0, 0, 1, 2, 3]", "output": "{-1: 4, 0: 2, 1: 1, 2: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027314", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5737", "output": "{1, 5737}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027315", "code": "def find_lowest(lst):\n    lowest_positive = None\n    for num in lst:\n        if num > 0:\n            if lowest_positive is None or num < lowest_positive:\n                lowest_positive = num\n    return lowest_positive\n", "entry_point": "find_lowest", "input": "[1, 2, 3, -4, 0]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112303_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027316", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6394", "output": "{1, 2, 139, 46, 278, 23, 6394, 3197}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6393", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5447", "output": "{1, 419, 13, 5447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027318", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 5, 4, 3, 4, 3, 4]", "output": "[8, 9, 7, 7, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99008_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027319", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'C:\\\\Users\\\\AnyFile.txt'", "output": "'C:\\\\Users'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027320", "code": "def custom_operation(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "custom_operation", "input": "[3, 3, 1, 2, 3, 2, 0]", "output": "[27, 27, 1, 4, 27, 4, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90758_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027321", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6530", "output": "{1, 6530, 2, 3265, 5, 10, 653, 1306}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6529", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027322", "code": "def dump_db(data):\n    if not data:\n        return \"No data to dump\"\n    columns = list(data[0].keys())\n    output = [','.join(columns)]\n    for record in data:\n        values = [str(record.get(col, '')) for col in columns]\n        output.append(','.join(values))\n    return '\\n'.join(output)\n", "entry_point": "dump_db", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "'\\n\\n\\n\\n\\n\\n\\n\\n\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57639_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027323", "code": "def calculate_ranges(phys_t, phys_p):\n    t_min = -0.5 * phys_t\n    t_max = 0.5 * phys_t\n    p_min = 185.0 - phys_p\n    p_max = 185.0\n    return (t_min, t_max, p_min, p_max)\n", "entry_point": "calculate_ranges", "input": "104.0, 76.0", "output": "(-52.0, 52.0, 109.0, 185.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49827_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "818", "output": "{409, 1, 818, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "618", "output": "{1, 2, 3, 6, 103, 618, 206, 309}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt617", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027326", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[6, 1, 3, 5, 5]", "output": "[7, 4, 8, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89166_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027327", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[2, 4, 15, 15]", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027328", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "6.1356989, 6", "output": "6.135698", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "783", "output": "{1, 3, 261, 9, 783, 87, 27, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027330", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'John.Do.Jo'", "output": "'johndojo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027331", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'woHwoHorolrd'", "output": "'woHwoHorolrd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027332", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6065", "output": "{1, 6065, 5, 1213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6064", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027333", "code": "def perform_list_operation(input_list, command):\n    if command == \"min\":\n        return min(input_list)\n    elif command == \"add\":\n        input_list.append(6)  # Adding 6 as an example, can be modified for a specific item\n        return input_list\n    elif command == \"count\":\n        return input_list.count(2)  # Counting occurrences of 2 as an example\n    elif command == \"type\":\n        return type(input_list)\n    elif command == \"copy\":\n        new_list = input_list.copy()\n        return new_list\n    elif command == \"extend\":\n        input_list.extend([4, 5, 6, 7])  # Extending with specific items\n        return input_list\n    elif command == \"index\":\n        return input_list.index(7)  # Finding the index of 7 as an example\n    elif command == \"insert\":\n        input_list.insert(2, 100)  # Inserting 100 at index 2 as an example\n        return input_list\n    elif command == \"remove\":\n        input_list.remove(100)  # Removing 100 as an example\n        return input_list\n    elif command == \"reverse\":\n        input_list.reverse()\n        return input_list\n    elif command == \"sort\":\n        input_list.sort()\n        return input_list\n    else:\n        return \"Invalid command\"\n", "entry_point": "perform_list_operation", "input": "[1, 2, 3, 4, 5], 'add'", "output": "[1, 2, 3, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63626_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027334", "code": "def calculate_score(cards):\n    total_score = 0\n    ace_count = 0\n    for card in cards:\n        if card in ['J', 'Q', 'K']:\n            total_score += 10\n        elif card == 'A':\n            ace_count += 1\n        else:\n            total_score += card\n    for _ in range(ace_count):\n        if total_score + 11 <= 21:\n            total_score += 11\n        else:\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "[10, 11, 11, 11, 11, 1]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116780_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027335", "code": "def sum_abs_diff(arr1, arr2):\n    total_diff = 0\n    for i in range(len(arr1)):\n        total_diff += abs(arr1[i] - arr2[i])\n    return total_diff\n", "entry_point": "sum_abs_diff", "input": "[0, 4, 8], [0, 0, 0]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136179_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027336", "code": "def calculate_file_size(chunk_lengths):\n    total_size = 0\n    seen_bytes = set()\n    for length in chunk_lengths:\n        total_size += length\n        for i in range(length - 1):\n            if total_size - i in seen_bytes:\n                total_size -= 1\n            seen_bytes.add(total_size - i)\n    return total_size\n", "entry_point": "calculate_file_size", "input": "[10, 10, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134958_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027337", "code": "from math import acos, degrees\ndef find_triangle_angles(a, b, c):\n    if a + b > c and b + c > a and a + c > b:  # Triangle inequality theorem check\n        first_angle = round(degrees(acos((b ** 2 + c ** 2 - a ** 2) / (2 * b * c))))\n        second_angle = round(degrees(acos((a ** 2 + c ** 2 - b ** 2) / (2 * a * c))))\n        third_angle = 180 - first_angle - second_angle\n        return sorted([first_angle, second_angle, third_angle])\n    else:\n        return None\n", "entry_point": "find_triangle_angles", "input": "6, 8, 10", "output": "[37, 53, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40430_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027338", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9155", "output": "{1, 9155, 5, 1831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9154", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027339", "code": "def extract_domain(url):\n    # Remove the protocol prefix\n    url = url.replace(\"http://\", \"\").replace(\"https://\", \"\")\n    # Extract the domain name\n    domain_parts = url.split(\"/\")\n    domain = domain_parts[0]\n    # Remove subdomains\n    domain_parts = domain.split(\".\")\n    if len(domain_parts) > 2:\n        domain = \".\".join(domain_parts[-2:])\n    return domain\n", "entry_point": "extract_domain", "input": "'http://htpwhw.exhttps:/somepath'", "output": "'htpwhw.exhttps:'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77353_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027340", "code": "def fill_gaps(input_array):\n    def get_neighbors_avg(row, col):\n        neighbors = []\n        for r, c in [(row-1, col), (row+1, col), (row, col-1), (row, col+1)]:\n            if 0 <= r < len(input_array) and 0 <= c < len(input_array[0]) and input_array[r][c] != 'GAP':\n                neighbors.append(input_array[r][c])\n        return sum(neighbors) / len(neighbors) if neighbors else 0\n    output_array = [row[:] for row in input_array]  # Create a copy of the input array\n    for i in range(len(input_array)):\n        for j in range(len(input_array[0])):\n            if input_array[i][j] == 'GAP':\n                output_array[i][j] = get_neighbors_avg(i, j)\n    return output_array\n", "entry_point": "fill_gaps", "input": "[[], [], [], [], []]", "output": "[[], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131580_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027341", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8429", "output": "{1, 8429}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8428", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027342", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'2.14.0'", "output": "(2, 14, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116372_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027343", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'co!'", "output": "'o!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027344", "code": "def max_rectangle_area(buildings):\n    stack = []\n    max_area = 0\n    n = len(buildings)\n    for i in range(n):\n        while stack and buildings[i] < buildings[stack[-1]]:\n            height = buildings[stack.pop()]\n            width = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, height * width)\n        stack.append(i)\n    while stack:\n        height = buildings[stack.pop()]\n        width = n if not stack else n - stack[-1] - 1\n        max_area = max(max_area, height * width)\n    return max_area\n", "entry_point": "max_rectangle_area", "input": "[5, 5, 5, 5, 5]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70831_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027345", "code": "def calculate_cumulative_sum(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "calculate_cumulative_sum", "input": "[5, 4, 3, 1, 3, 4, 1, 6]", "output": "[5, 9, 12, 13, 16, 20, 21, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126098_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027346", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "8", "output": "[1, 3, 5, 7, 9, 11, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027347", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    unique_scores = []\n    top_scores = []\n    for score in sorted_scores:\n        if score not in unique_scores:\n            unique_scores.append(score)\n            top_scores.append(score)\n            if len(top_scores) == n:\n                break\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[87, 86, 80, 75], 2", "output": "86.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78119_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027348", "code": "def categorize_requirements(requirements):\n    categorized_requirements = {'regular': [], 'development': []}\n    for req in requirements:\n        req_type, req_name = req.split(': ', 1)\n        if req_type == 'req':\n            categorized_requirements['regular'].append(req_name)\n        elif req_type == 'dev':\n            categorized_requirements['development'].append(req_name)\n    return categorized_requirements\n", "entry_point": "categorize_requirements", "input": "[]", "output": "{'regular': [], 'development': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115764_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027349", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1861", "output": "{1, 1861}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1860", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027350", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    camel_case = words[0] + ''.join(word.capitalize() for word in words[1:])\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'ts_a_sample'", "output": "'tsASample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46573_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3813", "output": "{1, 3, 3813, 41, 1271, 123, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027352", "code": "def longest_consecutive(nums):\n    num_set = set(nums)\n    max_length = 0\n    for num in num_set:\n        if num - 1 not in num_set:\n            current_num = num\n            current_length = 1\n            while current_num + 1 in num_set:\n                current_num += 1\n                current_length += 1\n            max_length = max(max_length, current_length)\n    return max_length\n", "entry_point": "longest_consecutive", "input": "[1, 2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126647_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027353", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8359", "output": "{1, 643, 13, 8359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027354", "code": "from collections import deque\ndef shortest_path_bfs(graph, start, end):\n    if start not in graph or end not in graph:\n        return []\n    queue = deque([start])\n    visited = {start: None}\n    while queue:\n        node = queue.popleft()\n        if node == end:\n            path = []\n            while node is not None:\n                path.append(node)\n                node = visited[node]\n            return path[::-1]\n        for neighbor in graph[node]:\n            if neighbor not in visited:\n                visited[neighbor] = node\n                queue.append(neighbor)\n    return []\n", "entry_point": "shortest_path_bfs", "input": "{'A': ['B'], 'B': ['A']}, 'C', 'D'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91280_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027355", "code": "import os\ndef get_absolute_path(root_path, file_path):\n    if os.path.isabs(file_path):\n        return file_path\n    else:\n        return os.path.join(root_path, file_path)\n", "entry_point": "get_absolute_path", "input": "'/home/user', 'documents/file.txt'", "output": "'/home/user/documents/file.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76069_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027356", "code": "def count_unique_paths(graph_edges, start_vertex, end_vertex):\n    def dfs(current_vertex):\n        if current_vertex == end_vertex:\n            nonlocal unique_paths\n            unique_paths += 1\n            return\n        visited.add(current_vertex)\n        for edge in graph_edges:\n            source, destination = edge\n            if source == current_vertex and destination not in visited:\n                dfs(destination)\n        visited.remove(current_vertex)\n    unique_paths = 0\n    visited = set()\n    dfs(start_vertex)\n    return unique_paths\n", "entry_point": "count_unique_paths", "input": "[('A', 'B')], 'A', 'B'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110326_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1519", "output": "{1, 7, 1519, 49, 217, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1518", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1732", "output": "{1, 2, 866, 1732, 4, 433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1731", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027359", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "'token', 1, ['A', 'B', 'C']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027360", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[109]", "output": "109", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027361", "code": "def replace_with_index(text, chars):\n    modified_text = \"\"\n    for index, char in enumerate(text):\n        if char in chars:\n            modified_text += str(index)\n        else:\n            modified_text += char\n    return modified_text\n", "entry_point": "replace_with_index", "input": "'hwhw4h!7dhrr', '47'", "output": "'hwhw4h!7dhrr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29744_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027362", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/users/', '/home/ud'", "output": "'../home/ud'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027363", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'eThisxample'", "output": "'eThisxample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027364", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'abc'", "output": "(1, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027365", "code": "def calculate_average_without_outliers(numbers, threshold):\n    median = sorted(numbers)[len(numbers) // 2] if len(numbers) % 2 != 0 else sum(sorted(numbers)[len(numbers) // 2 - 1:len(numbers) // 2 + 1]) / 2\n    outliers = [num for num in numbers if abs(num - median) > threshold]\n    filtered_numbers = [num for num in numbers if num not in outliers]\n    if len(filtered_numbers) == 0:\n        return 0  # Return 0 if all numbers are outliers\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_without_outliers", "input": "[14, 16, 17, 18, 19, 20], 2", "output": "17.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15753_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027366", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "664", "output": "{1, 2, 4, 166, 8, 332, 83, 664}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt663", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027367", "code": "def process_reaction_tokens(tokens):\n    reaction_info = {}\n    for line in tokens.split('\\n'):\n        if line.startswith('[NAME:'):\n            reaction_info['name'] = line.split('[NAME:')[1][:-1]\n        elif line.startswith('[REAGENT:'):\n            reagent_info = line.split(':')\n            reaction_info.setdefault('reagents', []).append(reagent_info[4])\n        elif line.startswith('[PRODUCT:'):\n            product_info = line.split(':')\n            reaction_info['product'] = product_info[5]\n        elif line == '[SMELTER]':\n            reaction_info['facility'] = 'SMELTER'\n        elif line == '[FUEL]':\n            reaction_info['fuel_required'] = True\n    return reaction_info\n", "entry_point": "process_reaction_tokens", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125354_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027368", "code": "def remove_prefix(description, pv_root):\n    if description.startswith(pv_root):\n        return description[len(pv_root):].lstrip()\n    return description\n", "entry_point": "remove_prefix", "input": "'Some description SKK', 'Some description '", "output": "'SKK'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30270_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027369", "code": "def find_largest_smallest(nums):\n    if not nums:\n        return None\n    largest = smallest = nums[0]\n    for num in nums[1:]:\n        if num > largest:\n            largest = num\n        elif num < smallest:\n            smallest = num\n    return (largest, smallest)\n", "entry_point": "find_largest_smallest", "input": "[10, 20, 30, 56, 7]", "output": "(56, 7)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136952_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027370", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[('level1', 70), ('level2', 80), ('level3', 90), ('level4', 40)]", "output": "280", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027371", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "5.0, 1.0", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027372", "code": "def process_input_string(input_string):\n    if isinstance(input_string, bytes):\n        return input_string.decode(\"utf-8\")\n    else:\n        return input_string\n", "entry_point": "process_input_string", "input": "'Python is awesome!'", "output": "'Python is awesome!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6292_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027373", "code": "def batch_process_numbers(numbers):\n    return ['FizzBuzz' if num % 3 == 0 and num % 5 == 0 else 'Fizz' if num % 3 == 0 else 'Buzz' if num % 5 == 0 else num for num in numbers]\n", "entry_point": "batch_process_numbers", "input": "[1, 2, 3, 4, 5, 15]", "output": "[1, 2, 'Fizz', 4, 'Buzz', 'FizzBuzz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109377_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027374", "code": "def sum_even_numbers(numbers):\n    sum_even = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_even_numbers", "input": "[0, 2, 4, 8, 12, 40]", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33776_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5149", "output": "{1, 19, 5149, 271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027376", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'web-development/', '/html'", "output": "'web-development//html'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027377", "code": "def romanToInt(s: str) -> int:\n    roman_values = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    result = 0\n    for i in range(len(s) - 1):\n        if roman_values[s[i]] < roman_values[s[i + 1]]:\n            result -= roman_values[s[i]]\n        else:\n            result += roman_values[s[i]]\n    result += roman_values[s[-1]]  # Add the value of the last symbol\n    return result\n", "entry_point": "romanToInt", "input": "'III'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17436_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027378", "code": "def parse_version(version_str):\n    major, minor, patch = map(int, version_str.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.147.0'", "output": "(3, 147, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50937_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027379", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 2, 4, 3, 4, 2, 4]", "output": "[6, 5, 6, 7, 7, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73916_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027380", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4362", "output": "{1, 2, 3, 2181, 6, 4362, 1454, 727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027381", "code": "from typing import List, Dict, Union\ndef calculate_conversion_rate(data: List[Dict[str, Union[str, int]]]) -> float:\n    total_value_converted = 0\n    total_value_all = 0\n    for lead in data:\n        if lead[\"Lead Status\"] == \"Converted\":\n            total_value_converted += lead[\"Lead Value\"]\n        total_value_all += lead[\"Lead Value\"]\n    if total_value_all == 0:\n        return 0.0\n    else:\n        return total_value_converted / total_value_all\n", "entry_point": "calculate_conversion_rate", "input": "[{'Lead Status': 'Converted', 'Lead Value': 100}]", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131089_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027382", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6533", "output": "{1, 139, 6533, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6532", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027383", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "16", "output": "16.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027384", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3183", "output": "{1, 3, 1061, 3183}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3182", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027385", "code": "from typing import List\ndef evaluate_operations(operations: List[str]) -> int:\n    result = 0\n    for operation in operations:\n        operand1, operator, operand2 = operation.split()\n        operand1, operand2 = int(operand1), int(operand2)\n        if operator == '+':\n            result += operand1 + operand2\n        elif operator == '-':\n            result += operand1 - operand2\n        elif operator == '*':\n            result += operand1 * operand2\n        elif operator == '/':\n            result += operand1 // operand2  # Integer division for simplicity\n    return result\n", "entry_point": "evaluate_operations", "input": "['10 + 20', '3 + 0']", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56989_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027386", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "8", "output": "'./prespawned/version8_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027387", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 0, 7, 4, 4, 1, 4, 4, 1]", "output": "[16, 0, 343, 16, 16, 1, 16, 16, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027388", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[2, -1, 1, 1, 1, 4, 2, 2, 1], 0, 9", "output": "[2, -1, 1, 1, 1, 4, 2, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027389", "code": "def total_cost(nums, A, B):\n    if B == 0:\n        return float(A)\n    k_m = 2 * A / B\n    count = 0\n    j_s = [nums[0]]\n    for i in range(1, len(nums)):\n        if nums[i] - nums[i - 1] <= k_m:\n            j_s.append(nums[i])\n        else:\n            count += A + (j_s[-1] - j_s[0]) / 2 * B\n            j_s = [nums[i]]\n    count += A + (j_s[-1] - j_s[0]) / 2 * B\n    return float(count)\n", "entry_point": "total_cost", "input": "[0], 3.0, 0", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101200_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027390", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'BBoBBo'", "output": "'BBoBBoEuroPython'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027391", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'zzz'", "output": "'zzz'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8761", "output": "{1, 8761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027393", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7413", "output": "{1, 353, 3, 1059, 7, 2471, 7413, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027394", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'inapps.something.NannNg'", "output": "('inapps', 'NannNg')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027395", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 89, 88, 80], 4", "output": "86.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13203_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5802", "output": "{1, 2, 3, 6, 967, 5802, 1934, 2901}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027397", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2419", "output": "{1, 2419, 59, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027398", "code": "import re\ndef format_text(text: str):\n    \"\"\"\n    Removes unwanted characters\n    Replaces spaces with underscores\n    \"\"\"\n    # Define a regular expression pattern to match unwanted characters\n    whitelist = re.compile(r'[^a-zA-Z ]+')\n    # Remove unwanted characters and replace spaces with underscores\n    processed_text = re.sub(whitelist, '', text).replace(' ', '_')\n    return processed_text\n", "entry_point": "format_text", "input": "'ttext'", "output": "'ttext'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47776_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027399", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[5, 5, 1, 2, 2, 4, 0, 5]", "output": "[25, 25, 1, 4, 4, 16, 0, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027400", "code": "from typing import List, Dict\ndef calculate_attack_frequency(dataset: List[int]) -> Dict[int, int]:\n    attack_frequencies = {}\n    for attack in dataset:\n        attack_frequencies[attack] = attack_frequencies.get(attack, 0) + 1\n    return attack_frequencies\n", "entry_point": "calculate_attack_frequency", "input": "[3, 0, 4, 4, 4, 2, 1, -1]", "output": "{3: 1, 0: 1, 4: 3, 2: 1, 1: 1, -1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97745_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027401", "code": "def process_markup(text: str) -> str:\n    formatted_text = \"\"\n    stack = []\n    current_text = \"\"\n    for char in text:\n        if char == '[':\n            if current_text:\n                formatted_text += current_text\n                current_text = \"\"\n            stack.append(char)\n        elif char == ']':\n            tag = \"\".join(stack)\n            stack = []\n            if tag == \"[b]\":\n                current_text = f\"<b>{current_text}</b>\"\n            elif tag == \"[r]\":\n                current_text = f\"<span style='color:red'>{current_text}</span>\"\n            elif tag == \"[u]\":\n                current_text = f\"<u>{current_text}</u>\"\n        else:\n            current_text += char\n    formatted_text += current_text\n    return formatted_text\n", "entry_point": "process_markup", "input": "'d/'", "output": "'d/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63510_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027402", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[0, -49, 49, 0, 1, 0]", "output": "-99", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027403", "code": "def sum_of_min_values(matrix):\n    total_min_sum = 0\n    for row in matrix:\n        min_value = min(row)\n        total_min_sum += min_value\n    return total_min_sum\n", "entry_point": "sum_of_min_values", "input": "[[2, 3, 4], [2, 5]]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147997_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7898", "output": "{1, 2, 359, 11, 3949, 718, 22, 7898}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027405", "code": "def stable_descending_sort(arr):\n    indexed_arr = [(value, index) for index, value in enumerate(arr)]\n    sorted_arr = sorted(indexed_arr, key=lambda x: (-x[0], x[1]))\n    return [value for value, _ in sorted_arr]\n", "entry_point": "stable_descending_sort", "input": "[1, 1, 1, 2, 2, 3, 4]", "output": "[4, 3, 2, 2, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34570_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027406", "code": "from typing import List\ndef _remove_trailing_zeros(numbers: List[float]) -> List[float]:\n    # Iterate through the list from the end and remove trailing zeros\n    while numbers and numbers[-1] == 0.0:\n        numbers.pop()\n    return numbers\n", "entry_point": "_remove_trailing_zeros", "input": "[0.6, 0.0, -0.5, 6.6, 1.0, 0.0, 0.0]", "output": "[0.6, 0.0, -0.5, 6.6, 1.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148979_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1933", "output": "{1, 1933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027408", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'s1', '22'", "output": "'s1p22'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3730", "output": "{1, 2, 5, 1865, 746, 10, 3730, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3729", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027410", "code": "def max_product(nums):\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[3, 4]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2090_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027411", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[6, 4]", "output": "('Rel Days 6 to 4', 'reldays6_4')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027412", "code": "from typing import List\ndef calculate_total_size(file_sizes: List[int]) -> int:\n    total_size_kb = 0\n    for size in file_sizes:\n        total_size_kb += size / 1024  # Convert bytes to kilobytes\n    return int(total_size_kb)  # Return the total size in kilobytes as an integer\n", "entry_point": "calculate_total_size", "input": "[17408]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87932_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027413", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "7, 7", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027414", "code": "def find_distance(text: str, word1: str, word2: str) -> int:\n    words = text.split()\n    pos_word1 = pos_word2 = -1\n    min_distance = len(words)  # Initialize with a large value\n    for i, word in enumerate(words):\n        if word == word1:\n            pos_word1 = i\n        elif word == word2:\n            pos_word2 = i\n        if pos_word1 != -1 and pos_word2 != -1:\n            distance = abs(pos_word1 - pos_word2) - 1\n            min_distance = min(min_distance, distance)\n    return min_distance\n", "entry_point": "find_distance", "input": "'hello there this is a test word awesome', 'this', 'awesome'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41646_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027415", "code": "def calculate_max_udp_packet_size(mtu_size: int) -> int:\n    # Assuming a constant UDS header size for simplicity\n    uds_header_size = 40  # bytes\n    # Calculate the maximum UDP packet size that can be sent over UDS\n    max_udp_packet_size = mtu_size - uds_header_size\n    return max_udp_packet_size\n", "entry_point": "calculate_max_udp_packet_size", "input": "1498", "output": "1458", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121479_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027416", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[9, 13, 17, 36, 47, 3, 8, 36]", "output": "[22, 30, 53, 83, 50, 11, 44, 45]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027417", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5212", "output": "{1, 2, 4, 2606, 1303, 5212}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5211", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027418", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[6], [5, 2], [4, [5, 2]], [2]]", "output": "[6, 5, 2, 4, 5, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70356_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027419", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2259", "output": "{1, 3, 9, 753, 2259, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027420", "code": "def calculate_f1_score(y_true, y_pred):\n    tp = fp = fn = 0\n    for true_label, pred_label in zip(y_true, y_pred):\n        if true_label == 1 and pred_label == 1:\n            tp += 1\n        elif true_label == 0 and pred_label == 1:\n            fp += 1\n        elif true_label == 1 and pred_label == 0:\n            fn += 1\n    precision = tp / (tp + fp) if tp + fp > 0 else 0\n    recall = tp / (tp + fn) if tp + fn > 0 else 0\n    f1_score = 2 * (precision * recall) / (precision + recall) if precision + recall > 0 else 0\n    return round(f1_score, 2)\n", "entry_point": "calculate_f1_score", "input": "[1, 0, 1], [1, 1, 0]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83345_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027421", "code": "from typing import List\ndef process_list(lst: List[int], target: int) -> List[int]:\n    if target in lst:\n        lst.remove(target)\n    else:\n        lst.append(target)\n        lst.sort()\n    return lst\n", "entry_point": "process_list", "input": "[8, 1, 4, 4, 4, 4], 4", "output": "[8, 1, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25547_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027422", "code": "from typing import List, Union\ndef process_list(numbers: List[int]) -> Union[int, str]:\n    if not numbers:\n        return \"Empty list provided.\"\n    if not all(isinstance(num, int) for num in numbers):\n        return \"Invalid input type. Please provide a list of integers.\"\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "process_list", "input": "[10, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136264_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027423", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 2, 3, 2, 3]", "output": "[2, 3, 5, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116160_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027424", "code": "def split_date_without_year(date_str):\n    day, month, _ = date_str.split('.')\n    return f\"{day}.{month}\"\n", "entry_point": "split_date_without_year", "input": "'318.09.2023'", "output": "'318.09'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44882_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027425", "code": "def snake_case(string):\n    return string.replace(\" \", \"_\").lower()\n", "entry_point": "snake_case", "input": "'HHeHHeH'", "output": "'hhehheh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78100_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5837", "output": "{1, 13, 449, 5837}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5836", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027427", "code": "def calculate_duration(n_frames, hop_length, sample_rate=44100):\n    total_duration = (n_frames - 1) * hop_length / sample_rate\n    return total_duration\n", "entry_point": "calculate_duration", "input": "54, 10", "output": "0.012018140589569161", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9810_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027428", "code": "def sum_multiples_of_divisor(nums, divisor):\n    total_sum = 0\n    for num in nums:\n        if num % divisor == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_divisor", "input": "[6, 12], 6", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44846_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027429", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[6, 6, 5, 4, 4, 7]", "output": "{6: 2, 5: 1, 4: 2, 7: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027430", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "25, 3", "output": "2300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt68", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027431", "code": "from typing import List, Dict\ndef extract_blueprint_modules(blueprints: List[str]) -> Dict[str, str]:\n    blueprint_modules = {}\n    for blueprint in blueprints:\n        module_name = f\"demo.api.{blueprint}.views\"\n        blueprint_modules[blueprint] = module_name\n    return blueprint_modules\n", "entry_point": "extract_blueprint_modules", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61812_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027432", "code": "import math\ndef calculate_sin(x):\n    \"\"\"\n    Calculate the sine of the input angle x in radians.\n    Args:\n    x (float): Angle in radians\n    Returns:\n    float: Sine of the input angle x\n    \"\"\"\n    return math.sin(x)\n", "entry_point": "calculate_sin", "input": "math.asin(0.5506855425976378)", "output": "0.5506855425976378", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88101_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027433", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1510", "output": "{1, 2, 5, 1510, 10, 302, 755, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1509", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027434", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[1, 3, 4, 1, 5, 6]", "output": "[1, 3, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027435", "code": "from typing import List\ndef calculate_total_characters(strings: List[str]) -> int:\n    total_chars = 0\n    concatenated_string = \"\"\n    for string in strings:\n        total_chars += len(string)\n        concatenated_string += string\n    total_chars += len(concatenated_string)\n    return total_chars\n", "entry_point": "calculate_total_characters", "input": "['abcdefghij', 'klmnopqrstuvw']", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56126_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027436", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'any.initial.path', '11.', '55'", "output": "'11..55'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027437", "code": "from typing import List\ndef merge_sorted_arrays(nums1: List[int], nums2: List[int]) -> List[int]:\n    sorted_array = []\n    nums1_index, nums2_index = 0, 0\n    while nums1_index < len(nums1) and nums2_index < len(nums2):\n        num1, num2 = nums1[nums1_index], nums2[nums2_index]\n        if num1 <= num2:\n            sorted_array.append(num1)\n            nums1_index += 1\n        else:\n            sorted_array.append(num2)\n            nums2_index += 1\n    sorted_array.extend(nums1[nums1_index:])\n    sorted_array.extend(nums2[nums2_index:])\n    return sorted_array\n", "entry_point": "merge_sorted_arrays", "input": "[1, 2, 3, 4, 5, 5], [2, 3, 4, 5, 5, 6]", "output": "[1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90744_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027438", "code": "colors = {\n    'black': (0, 0, 0),\n    'red': (255, 0, 0),\n    'orange': (255, 152, 0),\n    'deep_orange': (255, 87, 34),\n    'brown': (121, 85, 72),\n    'green': (0, 128, 0),\n    'light_green': (139, 195, 74),\n    'teal': (0, 150, 136),\n    'blue': (33, 150, 136),\n    'purple': (156, 39, 176),\n    'pink': (234, 30, 99),\n    'deep_purple': (103, 58, 183)\n}\ndef get_rgb(color_name):\n    if color_name in colors:\n        return colors[color_name]\n    for key in colors:\n        if color_name in key:\n            return colors[key]\n    return 'Color not found'\n", "entry_point": "get_rgb", "input": "'green'", "output": "(0, 128, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100168_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027439", "code": "import re\nurl_patterns = [\n    (\"^add_cart$\", \"AddCartView\"),\n    (\"^$\", \"ShowCartView\"),\n    (\"^update_cart$\", \"UpdateCartView\"),\n    (\"^delete_cart$\", \"DeleteCartView\"),\n]\ndef resolve_view(url_path):\n    for pattern, view_class in url_patterns:\n        if re.match(pattern, url_path):\n            return view_class\n    return \"Page Not Found\"\n", "entry_point": "resolve_view", "input": "'update_cart'", "output": "'UpdateCartView'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149933_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027440", "code": "import sys\ndef get_open_command(platform, disk_location):\n    if platform == \"linux2\":\n        return 'xdg-open \"%s\"' % disk_location\n    elif platform == \"darwin\":\n        return 'open \"%s\"' % disk_location\n    elif platform == \"win32\":\n        return 'cmd.exe /C start \"Folder\" \"%s\"' % disk_location\n    else:\n        raise Exception(\"Platform '%s' is not supported.\" % platform)\n", "entry_point": "get_open_command", "input": "'linux2', '/home/user/manual.pdf'", "output": "'xdg-open \"/home/user/manual.pdf\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32294_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027441", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'  expr : Cexpr :  '", "output": "('expr', 'Cexpr', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027442", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[93, 89, 75, 70, 65, 60, 75]", "output": "[93, 89, 75]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027443", "code": "def train(numbers):\n    product_even = 1\n    sum_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            product_even *= num\n        else:\n            sum_odd += num\n    return product_even + sum_odd\n", "entry_point": "train", "input": "[15, 1]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144802_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027444", "code": "time_convert = {\"s\": 1, \"m\": 60, \"h\": 3600, \"d\": 86400}\ndef convert_time_to_seconds(time):\n    try:\n        if len(time) < 2 or not time[-1].isalpha() or time[-1] not in time_convert:\n            raise ValueError\n        return int(time[:-1]) * time_convert[time[-1]]\n    except:\n        raise ValueError\n", "entry_point": "convert_time_to_seconds", "input": "'13320m'", "output": "799200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61701_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027445", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[0, 4, 4, 4, -1, 4, 3, 4, 4]", "output": "[4, 8, 12, -4, 20, 18, 28, 32]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027446", "code": "import re\ndef extract_urls_and_emails(text):\n    protocol = u\"(?:http|ftp|news|nntp|telnet|gopher|wais|file|prospero)\"\n    mailto = u\"mailto\"\n    url_body = u\"\\S+[0-9A-Za-z/]\"\n    url = u\"<?(?:{0}://|{1}:|www\\.){2}>?\".format(protocol, mailto, url_body)\n    url_re = re.compile(url, re.I)\n    localpart_border = u\"[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~]\"\n    localpart_inside = u\"[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~.]\"\n    localpart = u\"{0}{1}*\".format(localpart_border, localpart_inside)\n    subdomain_start = u\"[A-Za-z]\"\n    subdomain_inside = u\"[A-Za-z0-9\\\\-]\"\n    subdomain_end = u\"[A-Za-z0-9]\"\n    subdomain = u\"{0}{1}*{2}\".format(subdomain_start, subdomain_inside, subdomain_end)\n    domain = u\"{0}(?:\\\\.{1})*\".format(subdomain, subdomain)\n    email_str = u\"{0}@{1}\".format(localpart, domain)\n    email_re = re.compile(email_str)\n    urls = url_re.findall(text)\n    emails = email_re.findall(text)\n    return urls + emails\n", "entry_point": "extract_urls_and_emails", "input": "'Contact us at info@example.com'", "output": "['info@example.com']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34293_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8027", "output": "{1, 8027, 349, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8026", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027448", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'CC(=CC(=C)CO)CC'", "output": "'CC(=CC(=C)CO)CC'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027449", "code": "from typing import List\ndef above_average_scores(scores: List[int]) -> List[int]:\n    if not scores:\n        return []\n    average_score = sum(scores) / len(scores)\n    above_average = [score for score in scores if score > average_score]\n    return above_average\n", "entry_point": "above_average_scores", "input": "[79, 79, 78, 85, 0, 1]", "output": "[79, 79, 78, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44803_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027450", "code": "def define_estados_finais(estados, estados_finais):\n    finais = [estado for estado in estados if estado in estados_finais]\n    return finais\n", "entry_point": "define_estados_finais", "input": "['q1', 'q2', 'q3', 'q4'], ['q1', 'q3', 'q5']", "output": "['q1', 'q3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12488_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027451", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2771", "output": "{1, 2771, 163, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2770", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3999", "output": "{1, 129, 3, 43, 1333, 3999, 93, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027453", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2453", "output": "{1, 11, 2453, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027454", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / N if N <= len(scores) else sum(scores) / len(scores)\n", "entry_point": "average_top_scores", "input": "[45, 30, 20], 1", "output": "45.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108478_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027455", "code": "from urllib.parse import urlparse, parse_qs\ndef count_urls_with_keyword(urls, keyword):\n    count = 0\n    keyword = keyword.lower()\n    for url in urls:\n        parsed_url = urlparse(url)\n        query_params = parse_qs(parsed_url.query)\n        if keyword in url.lower() or any(keyword in str(value).lower() for value in query_params.values()):\n            count += 1\n    return count\n", "entry_point": "count_urls_with_keyword", "input": "['http://www.nokeyword.com', 'http://anotherrandomsite.org'], 'example'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43148_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027456", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'xx80example', '1gg1e1gga'", "output": "'ws://xx80example/1gg1e1gga/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027457", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1100X'", "output": "['11000', '11001']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt50", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027458", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "43, 31, 57", "output": "43.5325", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1297", "output": "{1, 1297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027460", "code": "def format_scientific(val, format):\n    comma_index = format.find('.')\n    digits = 0\n    i = comma_index + 1\n    # Count the number of zeros after the decimal point in the format string\n    while i < len(format):\n        if format[i] == '0':\n            digits += 1\n        else:\n            break\n        i += 1\n    # Format the value in scientific notation with the determined precision\n    return ('{:.' + str(digits) + 'E}').format(val)\n", "entry_point": "format_scientific", "input": "78400, '0.000'", "output": "'7.840E+04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95941_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027461", "code": "def process_assets(assets):\n    asset_dict = {}\n    for asset in assets:\n        asset_id = asset[\"asset_id\"]\n        tag_id = asset[\"tag_id\"]\n        if asset_id in asset_dict:\n            asset_dict[asset_id].append(tag_id)\n        else:\n            asset_dict[asset_id] = [tag_id]\n    result = [{\"asset_id\": key, \"tag_ids\": value} for key, value in asset_dict.items()]\n    return result\n", "entry_point": "process_assets", "input": "[{'asset_id': 1, 'tag_id': 101}]", "output": "[{'asset_id': 1, 'tag_ids': [101]}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134701_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027462", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[-5, -3, 10]", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3599", "output": "{1, 59, 61, 3599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3598", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027464", "code": "def longest_substring_within_budget(s, costs, budget):\n    start = 0\n    end = 0\n    current_cost = 0\n    max_length = 0\n    n = len(s)\n    while end < n:\n        current_cost += costs[ord(s[end]) - ord('a')]\n        while current_cost > budget:\n            current_cost -= costs[ord(s[start]) - ord('a')]\n            start += 1\n        max_length = max(max_length, end - start + 1)\n        end += 1\n    return max_length\n", "entry_point": "longest_substring_within_budget", "input": "'aaaaaa', [1] * 26, 6", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17714_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027465", "code": "def reshape_tensor(sizes, new_order):\n    reshaped_sizes = []\n    for index in new_order:\n        reshaped_sizes.append(sizes[index])\n    return reshaped_sizes\n", "entry_point": "reshape_tensor", "input": "[2, 4, 4, 5], [0, 1, 2, 3]", "output": "[2, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117209_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027466", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3127", "output": "{1, 59, 53, 3127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3126", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027467", "code": "import heapq\ndef first_n_smallest(lst, n):\n    heap = [(val, idx) for idx, val in enumerate(lst)]\n    heapq.heapify(heap)\n    result = [heapq.heappop(heap) for _ in range(n)]\n    result.sort(key=lambda x: x[1])  # Sort based on original indices\n    return [val for val, _ in result]\n", "entry_point": "first_n_smallest", "input": "[2, 1, 3, 1, 2], 4", "output": "[2, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105636_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6623", "output": "{1, 179, 37, 6623}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6622", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027469", "code": "def update_label_path(original_label_path, new_parent_label_path, new_label):\n    original_labels = original_label_path.split('.')\n    new_parent_labels = new_parent_label_path.split('.')\n    # Append the new label to the new parent label path\n    new_label_path = new_parent_labels + [new_label]\n    # Join the new parent label path with the new label\n    updated_label_path = '.'.join(new_label_path)\n    return updated_label_path\n", "entry_point": "update_label_path", "input": "'1.2.3', '11.2211.2', '5555'", "output": "'11.2211.2.5555'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67426_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027470", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8969", "output": "{1, 8969}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027471", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4304", "output": "{1, 2, 4, 2152, 8, 269, 4304, 16, 1076, 538}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4303", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027472", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[5, 1, 8, 0, 6, 2, 5, 0]", "output": "[6, 9, 8, 6, 8, 7, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027473", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "830", "output": "{1, 2, 5, 166, 10, 83, 830, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt829", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027474", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1239", "output": "{1, 3, 7, 177, 21, 1239, 59, 413}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027475", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "479", "output": "{1, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027476", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "4", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027477", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1245", "output": "{1, 3, 5, 15, 83, 249, 1245, 415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027478", "code": "def calculate_total_kinetic_energy(masses, velocities):\n    total_kinetic_energy = sum(0.5 * mass * velocity**2 for mass, velocity in zip(masses, velocities))\n    return round(total_kinetic_energy, 2)\n", "entry_point": "calculate_total_kinetic_energy", "input": "[2, 2], [3, 1]", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128860_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027479", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1178", "output": "{1, 2, 38, 589, 19, 1178, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1177", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027480", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "25, 25, '+'", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027481", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "274", "output": "{137, 1, 274, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027482", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'mee0 0:a0'", "output": "{'when': 'mee0 0:a0', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5954", "output": "{2977, 1, 5954, 2, 229, 458, 13, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5953", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027484", "code": "def reverse_insertion_sort(arr) -> list:\n    n = len(arr)\n    for i in range(1, n):\n        swap_index = i\n        for j in range(i-1, -1, -1):\n            if arr[swap_index] > arr[j]:  # Modified condition for descending order\n                arr[swap_index], arr[j] = arr[j], arr[swap_index]\n                swap_index -= 1\n            else:\n                break\n    return arr\n", "entry_point": "reverse_insertion_sort", "input": "[10, 9, 8, 8, 4, 2]", "output": "[10, 9, 8, 8, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3711_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027485", "code": "def one_hot_mux_test(DW, N):\n    results = []\n    dut_i = 0\n    for i in range(N):\n        dut_i |= (i % DW) << (i * DW)\n    for i in range(N):\n        sel = 1 << i\n        output = i % DW\n        results.append(output)\n    return results\n", "entry_point": "one_hot_mux_test", "input": "2, 4", "output": "[0, 1, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63359_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027486", "code": "import re\ndef count_unique_words(text):\n    unique_words = set()\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return len(unique_words)\n", "entry_point": "count_unique_words", "input": "'apple banana grape orange mango kiwi pear'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122190_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027487", "code": "def custom_sort(lst):\n    custom_key = lambda x: x + 100*(x % 2)\n    return sorted(lst, key=custom_key)\n", "entry_point": "custom_sort", "input": "[1, 3, 6, 0, -1, 1]", "output": "[0, 6, -1, 1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24137_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027488", "code": "def longest_common_prefix(strs):\n    if not strs:\n        return 0\n    prefix = strs[0]\n    for string in strs[1:]:\n        i = 0\n        while i < len(prefix) and i < len(string) and prefix[i] == string[i]:\n            i += 1\n        prefix = prefix[:i]\n    return len(prefix)\n", "entry_point": "longest_common_prefix", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027489", "code": "def detect_file_type(filename):\n    if filename[-3:] == 'csv':\n        return 'csv'\n    elif filename[-4:] in ['xlsx', 'xls']:\n        return 'excel'\n    else:\n        return 'autre'\n", "entry_point": "detect_file_type", "input": "'file.csv'", "output": "'csv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149095_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027490", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4442", "output": "{1, 4442, 2, 2221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4441", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027491", "code": "import math\ndef calculate_supershape_area(a, b):\n    # Calculate the area of the supershape using the formula: Area = \u03c0 * a * b\n    area = math.pi * a * b\n    return area\n", "entry_point": "calculate_supershape_area", "input": "8, 5", "output": "125.66370614359172", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59986_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027492", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'mzg'", "output": "'mzg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027493", "code": "input_tokenizer = {\n    'en-bg': '-l en -a',\n    'en-cs': '-l en -a',\n    'en-de': '-l en -a',\n    'en-el': '-l en -a',\n    'en-hr': '-l en -a',\n    'en-it': '-l en -a',\n    'en-nl': '-l en -a',\n    'en-pl': '-l en -a',\n    'en-pt': '-l en -a',\n    'en-ru': '-l en -a',\n    'en-zh': '-l en -a'\n}\ndef get_input_tokenizer(language_pair):\n    return input_tokenizer.get(language_pair, 'Tokenizer not found')\n", "entry_point": "get_input_tokenizer", "input": "'en-bg'", "output": "'-l en -a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90753_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027494", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "11", "output": "76.43702828517625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027495", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "{'CONF_NUMBER': 18}", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027496", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1532", "output": "{1, 2, 4, 1532, 766, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1531", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027497", "code": "from typing import List\ndef format_squares(input_list: List[int]) -> List[str]:\n    formatted_squares = []\n    for num in input_list:\n        square = num ** 2\n        square_str = str(square)\n        while len(square_str) < 4:\n            square_str = '0' + square_str\n        formatted_squares.append(square_str)\n    return formatted_squares\n", "entry_point": "format_squares", "input": "[3, 12, 25]", "output": "['0009', '0144', '0625']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128876_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027498", "code": "def extract_project_info(data_dict):\n    project_title = data_dict.get(\"title\", \"\")\n    us_url = data_dict.get(\"us_url\", \"\")\n    uk_url = data_dict.get(\"uk_url\", \"\")\n    active = data_dict.get(\"active\", False)\n    db_name = data_dict.get(\"db_name\", \"\")\n    require_region = data_dict.get(\"require_region\", False)\n    num_urls = 2 if us_url and uk_url else 1 if us_url or uk_url else 0\n    has_limit_maps = bool(data_dict.get(\"limit_maps\", []))\n    return (project_title, [us_url, uk_url], active, db_name, require_region, num_urls, has_limit_maps)\n", "entry_point": "extract_project_info", "input": "{}", "output": "('', ['', ''], False, '', False, 0, False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22815_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027499", "code": "CREATE = 'create'\nREPLACE = 'replace'\nUPDATE = 'update'\nDELETE = 'delete'\nALL = (CREATE, REPLACE, UPDATE, DELETE)\n_http_methods = {\n    CREATE: ('post',),\n    REPLACE: ('put',),\n    UPDATE: ('patch',),\n    DELETE: ('delete',)\n}\ndef get_http_methods(method):\n    return _http_methods.get(method, ('get',))  # Default to 'get' if method not found\n", "entry_point": "get_http_methods", "input": "'replace'", "output": "('put',)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23129_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027500", "code": "def extract_semantic_version(version):\n    version_parts = version.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(''.join(filter(str.isdigit, version_parts[2])))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'0.0.0'", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111562_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027501", "code": "def calculate_total_score(levels):\n    total_score = 0\n    for level, points in levels:\n        total_score += points\n    return total_score\n", "entry_point": "calculate_total_score", "input": "[(1, 50), (2, 50)]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91558_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027502", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[1, 2], 3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027503", "code": "import typing\ndef circular_sum(input_list: typing.List[int]) -> typing.List[int]:\n    output_list = []\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(circular_sum)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 2, 4, 2, 2, 2]", "output": "[6, 5, 6, 6, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4417_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027504", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6163", "output": "{1, 6163}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6162", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027505", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    if N > len(sorted_scores):\n        N = len(sorted_scores)\n    return sum(sorted_scores[:N]) / N\n", "entry_point": "average_top_scores", "input": "[-30, -30, -20], 3", "output": "-26.666666666666668", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132945_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027506", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5847", "output": "{1, 3, 1949, 5847}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5846", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027507", "code": "def negate_integers(lst):\n    modified_list = []\n    for num in lst:\n        if num < 0:\n            modified_list.append(abs(num))\n        else:\n            modified_list.append(-num)\n    return modified_list\n", "entry_point": "negate_integers", "input": "[-3, -5, 8, -2, 1, -2, -2, -3]", "output": "[3, 5, -8, 2, -1, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84603_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027508", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[1, 2, 7, 0, 1, 5, 7, 3]", "output": "[1, 3, 9, 3, 5, 10, 13, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027509", "code": "def sum_with_index(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "sum_with_index", "input": "[7, 2, 8, 3, 1, 8, 9, 6]", "output": "[7, 3, 10, 6, 5, 13, 15, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123581_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027510", "code": "def sum_of_digits(n):\n    if n < 10:\n        return n\n    else:\n        return n % 10 + sum_of_digits(n // 10)\n", "entry_point": "sum_of_digits", "input": "87", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141098_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027511", "code": "def max_sum_path(matrix):\n    if not matrix:\n        return []\n    rows, cols = len(matrix), len(matrix[0])\n    memo = [[0] * cols for _ in range(rows)]\n    for i in range(rows):\n        for j in range(cols):\n            if i == 0:\n                memo[i][j] = matrix[i][j]\n            else:\n                memo[i][j] = matrix[i][j] + max(memo[i-1][j], memo[i-1][j-1] if j > 0 else 0)\n    max_sum = max(memo[-1])\n    max_index = memo[-1].index(max_sum)\n    path = [max_index]\n    for i in range(rows - 1, 0, -1):\n        if max_index == 0 or memo[i-1][max_index] > memo[i-1][max_index-1]:\n            max_index -= 1\n        path.insert(0, max_index)\n    return path\n", "entry_point": "max_sum_path", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92471_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027512", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{cherr}'", "output": "['cherr']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027513", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[1, 6, 9, 7, 8, 6], 5", "output": "[[1, 6, 9, 7, 8], [6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027514", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3905", "output": "{3905, 1, 355, 5, 71, 11, 781, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3904", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027515", "code": "from typing import List, Tuple\ndef classify_entries(line_numbers: List[int]) -> Tuple[List[int], List[int], List[int]]:\n    NOT_AN_ENTRY = set([\n        326, 330, 332, 692, 1845, 6016, 17859, 24005, 49675, 97466, 110519, 118045,\n        119186, 126386\n    ])\n    ALWAYS_AN_ENTRY = set([\n        12470, 17858, 60157, 60555, 60820, 75155, 75330, 77825, 83439, 84266,\n        94282, 97998, 102650, 102655, 102810, 102822, 102895, 103897, 113712,\n        113834, 119068, 123676\n    ])\n    always_starts_entry = [num for num in line_numbers if num in ALWAYS_AN_ENTRY]\n    never_starts_entry = [num for num in line_numbers if num in NOT_AN_ENTRY]\n    ambiguous_starts_entry = [num for num in line_numbers if num not in ALWAYS_AN_ENTRY and num not in NOT_AN_ENTRY]\n    return always_starts_entry, never_starts_entry, ambiguous_starts_entry\n", "entry_point": "classify_entries", "input": "[6, 10, 327, 330, 8, 8, 8, 6]", "output": "([], [330], [6, 10, 327, 8, 8, 8, 6])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61128_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027516", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[0, 1, 2, 2, 3, 4, 1, 0]", "output": "[1, 3, 4, 5, 7, 5, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113927_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027517", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5585", "output": "{1, 5585, 5, 1117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027518", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[1, 2, 4, 1, 0], 3", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027519", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num + 2)\n        elif num % 2 != 0:\n            processed_nums.append(num * 3)\n        if num % 5 == 0:\n            processed_nums[-1] -= 5\n    return processed_nums\n", "entry_point": "process_integers", "input": "[3, 2, 16, 38]", "output": "[9, 4, 18, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65994_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027520", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1361", "output": "{1361, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027521", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "'Fox'", "output": "['Fox']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027522", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6334", "output": "{1, 2, 6334, 3167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027523", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8951", "output": "{1, 8951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027524", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6811", "output": "{1, 7, 139, 973, 49, 6811}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6810", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027525", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[3, 2, 7, 2, 2, 7, 7, 2], 4", "output": "[[3, 2, 7, 2], [2, 7, 7, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4055", "output": "{1, 811, 5, 4055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027527", "code": "from datetime import date, timedelta\ndef weeks_dates(wky):\n    # Parse week number and year from the input string\n    wk = int(wky[:2])\n    yr = int(wky[2:])\n    # Calculate the starting date of the year\n    start_date = date(yr, 1, 1)\n    start_date += timedelta(6 - start_date.weekday())\n    # Calculate the date range for the given week number and year\n    delta = timedelta(days=(wk - 1) * 7)\n    date_start = start_date + delta\n    date_end = date_start + timedelta(days=6)\n    # Format the date range as a string\n    date_range = f'{date_start} to {date_end}'\n    return date_range\n", "entry_point": "weeks_dates", "input": "'118943'", "output": "'8943-03-17 to 8943-03-23'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143506_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027528", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "97", "output": "{1, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt96", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027529", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[6, 2, 1, 2, 5, 6]", "output": "[6, 2, 1, 2, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027530", "code": "from typing import List\ndef format_friends_list(friends: List[str]) -> str:\n    if len(friends) == 0:\n        return \"\"\n    elif len(friends) == 1:\n        return friends[0]\n    else:\n        formatted_friends = ', '.join(friends[:-1]) + ', and ' + friends[-1]\n        return formatted_friends\n", "entry_point": "format_friends_list", "input": "['Alice']", "output": "'Alice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3512_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027531", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[-9, 7, -10, 8, -8, -1, -5, 7]", "output": "[-9, -10, -8, -1, -5, 7, 8, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027532", "code": "def decoder(corrupted_encoding, corruption_info):\n    # Reverse the corruption process to recover the original state\n    original_state = corrupted_encoding - corruption_info\n    return original_state\n", "entry_point": "decoder", "input": "131.3761, 0.0", "output": "131.3761", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25588_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027533", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "202", "output": "b'\\xca'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027534", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'3.14.27.42'", "output": "(3, 14, 27, 42)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027535", "code": "def find_longest_common_prefix(strings):\n    if not strings:\n        return \"\"\n    lcp = \"\"\n    base = strings[0]\n    for i in range(len(base)):\n        for s in strings[1:]:\n            if i > len(s) - 1 or base[i] != s[i]:\n                return lcp\n        lcp += base[i]\n    return lcp\n", "entry_point": "find_longest_common_prefix", "input": "['dog', 'cat', 'fish']", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43040_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027536", "code": "def count_unique_rotations(rotations):\n    unique_rotations = set()\n    for rotation_constant in rotations.values():\n        unique_rotations.add(rotation_constant)\n    return len(unique_rotations)\n", "entry_point": "count_unique_rotations", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90264_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1505", "output": "{1, 1505, 35, 5, 7, 43, 301, 215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7223", "output": "{1, 31, 233, 7223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2129", "output": "{2129, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027540", "code": "def has_balanced_delimiters(contents: str) -> bool:\n    stack = []\n    opening_delimiters = \"({[\"\n    closing_delimiters = \")}]\"\n    delimiter_pairs = {')': '(', '}': '{', ']': '['}\n    for char in contents:\n        if char in opening_delimiters:\n            stack.append(char)\n        elif char in closing_delimiters:\n            if not stack or stack[-1] != delimiter_pairs[char]:\n                return False\n            stack.pop()\n    return len(stack) == 0\n", "entry_point": "has_balanced_delimiters", "input": "'[{()}]'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105254_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027541", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2181", "output": "{1, 3, 2181, 727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027542", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3449", "output": "{1, 3449}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027543", "code": "def find_anomaly(numbers, preamble_size):\n    def is_valid(window, number):\n        for i in range(len(window)):\n            for j in range(i + 1, len(window)):\n                if window[i] + window[j] == number:\n                    return True\n        return False\n    window = numbers[:preamble_size]\n    for i in range(preamble_size, len(numbers)):\n        number = numbers[i]\n        if not is_valid(window, number):\n            return number\n        window.pop(0)\n        window.append(number)\n    return None\n", "entry_point": "find_anomaly", "input": "[1, 2, 0], 2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105708_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027544", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'spss'", "output": "'spss'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027545", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[2, 3, 2, 1, 3, 1, 1, 2, 1]", "output": "[4, 27, 4, 1, 27, 1, 1, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027546", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_indices = {}\n    for i, score in enumerate(scores):\n        if score not in score_indices:\n            score_indices[score] = []\n        score_indices[score].append(i)\n    top_players = []\n    for score in sorted(score_indices.keys(), reverse=True):\n        top_players.extend(score_indices[score])\n        if len(top_players) >= k:\n            break\n    return [scores[i] for i in top_players[:k]]\n", "entry_point": "top_k_players", "input": "[30, 30, 25, 20, 15], 3", "output": "[30, 30, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102587_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027547", "code": "from typing import List\ndef convert_to_js_bool(bool_list: List[bool]) -> List[str]:\n    js_bool_list = []\n    for boolean in bool_list:\n        if boolean:\n            js_bool_list.append('true')\n        else:\n            js_bool_list.append('false')\n    return js_bool_list\n", "entry_point": "convert_to_js_bool", "input": "[True, False, True]", "output": "['true', 'false', 'true']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142907_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027548", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2151", "output": "{1, 3, 2151, 9, 717, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2150", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027549", "code": "# Dictionary mapping token values to token names\ntoken_map = {\n    1: 'T__0',\n    2: 'T__1',\n    3: 'T__2',\n    4: 'T__3',\n    5: 'T__4',\n    6: 'T__5',\n    7: 'T__6',\n    8: 'T__7',\n    9: 'T__8',\n    10: 'T__9',\n    11: 'T__10',\n    12: 'T__11',\n    13: 'JAVASCRIPTIDENTIFIER',\n    14: 'STRING'\n}\ndef get_token_name(token_value):\n    return token_map.get(token_value, 'UNKNOWN')\n", "entry_point": "get_token_name", "input": "5", "output": "'T__4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16071_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027550", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[30, [10], [7]]", "output": "47", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027551", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hh,,lo'", "output": "{'h': 2, ',': 2, 'l': 1, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15027_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7947", "output": "{1, 3, 9, 7947, 883, 2649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027553", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "'Hello'", "output": "[('WORD', 'Hello')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027554", "code": "def levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost)\n    return dp[m][n]\n", "entry_point": "levenshtein_distance", "input": "'abcd', 'efgh'", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101077_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027555", "code": "import re\nimport math\ndef max_llk_estim_hist_theta_variable(obs):\n    n = len(obs)  # Number of islands is the total count of observed values\n    M = sum(obs) / n  # Migration rate is the average of observed values\n    theta = 1 / M  # Estimated parameter theta is the reciprocal of migration rate\n    # Calculate the log-likelihood function value\n    llk = 0\n    for x in obs:\n        llk += math.log(M) - M * x\n    return [n, M, theta, llk]\n", "entry_point": "max_llk_estim_hist_theta_variable", "input": "[20, 20, 20, 20, 20]", "output": "[5, 20.0, 0.05, -1985.02133863223]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96495_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027556", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 2, 4, 2, 2, 2, 5, 2]", "output": "[2, 3, 6, 5, 6, 7, 11, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027557", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "8, [2, 3, 5, 8, 2, 2, 4, 4]", "output": "[3, 2, 8, 5, 2, 2, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027558", "code": "import re\ndef process_morphological_info(text):\n    rxWordsRNC = re.compile('<w>(<ana.*?/(?:ana)?>)([^<>]+)</w>', flags=re.DOTALL)\n    rxAnalysesRNC = re.compile('<ana *([^<>]+)(?:></ana>|/>)\\\\s*')\n    rxAnaFieldRNC = re.compile('([^ <>\"=]+) *= *\"([^<>\"]+)')\n    morphological_info = {}\n    for match in rxWordsRNC.finditer(text):\n        analyses = rxAnalysesRNC.findall(match.group(1))\n        for analysis in analyses:\n            fields = rxAnaFieldRNC.findall(analysis)\n            for field in fields:\n                key, value = field\n                morphological_info.setdefault(key, []).append(value)\n    return morphological_info\n", "entry_point": "process_morphological_info", "input": "''", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138839_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027559", "code": "from typing import List\ndef max_score(deck: List[int]) -> int:\n    include = 0\n    exclude = 0\n    for card in deck:\n        new_include = exclude + card\n        exclude, include = max(exclude, include), new_include\n    return max(include, exclude)\n", "entry_point": "max_score", "input": "[10, 1, 6, 7]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78968_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027560", "code": "def process_string(input_string):\n    modified_string = input_string.replace(\"python\", \"Java\").replace(\"code\", \"\").replace(\"snippet\", \"program\")\n    return modified_string\n", "entry_point": "process_string", "input": "'I love python code snippet'", "output": "'I love Java  program'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6573_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7405", "output": "{1, 5, 1481, 7405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7404", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027562", "code": "def modify_list_elements(lst):\n    if len(lst) == 1:\n        return [lst[0], lst[0]]\n    elif len(lst) == 2:\n        return [x**2 for x in lst]\n    elif len(lst) == 3:\n        return [x**3 for x in lst]\n    elif len(lst) == 4:\n        return [x**4 for x in lst]\n    else:\n        raise ValueError(\"Input list length must be between 1 and 4.\")\n", "entry_point": "modify_list_elements", "input": "[2, 3, 4, 5]", "output": "[16, 81, 256, 625]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17040_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027563", "code": "def parse_list_of_lists(all_groups_str):\n    all_groups_str = all_groups_str.strip()[1:-1]  # Remove leading and trailing square brackets\n    groups = []\n    for line in all_groups_str.split(',\\n'):\n        group = [int(val) for val in line.strip()[1:-1].split(', ')]\n        groups.append(group)\n    return groups\n", "entry_point": "parse_list_of_lists", "input": "'[[8]]'", "output": "[[8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39140_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027564", "code": "def calculate_result(num_list, num):\n    # Calculate the sum of twice each element in the list and subtract the second input number\n    result = sum(2 * x for x in num_list) - num\n    return result\n", "entry_point": "calculate_result", "input": "[10, 10, 10], 5", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113116_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027565", "code": "def increment_counter(counter, increment_by):\n    counter += increment_by\n    return counter\n", "entry_point": "increment_counter", "input": "5, 5", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101634_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027566", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5609", "output": "{1, 5609, 79, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027567", "code": "def toggle_trash_bin_relay(relay_id: int, state: int) -> str:\n    if relay_id == 1 and state == 1:\n        return \"Relay toggled successfully\"\n    elif relay_id not in [1, 2, 3]:  # Assuming relay IDs 1, 2, 3 are valid\n        return \"Relay ID not found\"\n    else:\n        return \"Failed to toggle relay\"\n", "entry_point": "toggle_trash_bin_relay", "input": "1, 1", "output": "'Relay toggled successfully'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121601_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027568", "code": "g_key = \"password123\"\ndef replace_key(string):\n    global g_key\n    return string.replace(\"<KEY>\", g_key)\n", "entry_point": "replace_key", "input": "'for'", "output": "'for'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68922_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027569", "code": "def custom_lexer(content):\n    tokens = []\n    for word in content.split():\n        token_type = 'WORD' if word.isalpha() else 'NUMBER' if word.isdigit() else None\n        if token_type:\n            tokens.append((token_type, word))\n    return tokens\n", "entry_point": "custom_lexer", "input": "'World'", "output": "[('WORD', 'World')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52848_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027570", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[2, 4, 6, 7, 7, 5, 1, 1, 1]", "output": "[2, 4, 6, 7, 7, 5, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027571", "code": "def encrypt_text(text: str) -> str:\n    encrypted_chars = []\n    for idx, char in enumerate(text):\n        shift_amount = idx % 26\n        encrypted_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_text", "input": "'hwo'", "output": "'hxq'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24966_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027572", "code": "def calculate_average_score(scores):\n    if not scores:\n        return 0.00\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[89.44]", "output": "89.44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122959_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027573", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "10", "output": "3.321928094887362", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027574", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'add(a,\\n'", "output": "'add(a,\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7393", "output": "{1, 7393}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027576", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5813", "output": "{1, 5813}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027577", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'me/hom', 'templatesla'", "output": "'me/hom/templatesla'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027578", "code": "_Stop = 5\n_Access = 9  \n_Controllers = 11  \n_Frame = 13  \n_Scanline = 15  \n_ScanlineCycle = 17  \n_SpriteZero = 19\n_Status = 21\n_EVENT_TYPES = [ _Stop, _Access, _Controllers, _Frame, _Scanline, _ScanlineCycle, _SpriteZero, _Status ]\ndef map_event_types_to_values(event_types):\n    event_type_mapping = {\n        '_Stop': _Stop,\n        '_Access': _Access,\n        '_Controllers': _Controllers,\n        '_Frame': _Frame,\n        '_Scanline': _Scanline,\n        '_ScanlineCycle': _ScanlineCycle,\n        '_SpriteZero': _SpriteZero,\n        '_Status': _Status\n    }\n    return {event_type: event_type_mapping[event_type] for event_type in event_types if event_type in event_type_mapping}\n", "entry_point": "map_event_types_to_values", "input": "['_NonExistentEvent']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101264_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027579", "code": "def calculate_average_excluding_outliers(numbers, threshold):\n    if not numbers:\n        return 0\n    median = sorted(numbers)[len(numbers) // 2]\n    filtered_numbers = [num for num in numbers if abs(num - median) <= threshold * median]\n    if not filtered_numbers:\n        return 0\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_excluding_outliers", "input": "[20, 21, 22, 23, 24], 0.1", "output": "22.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65048_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027580", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[88, 88, 88, 88, 88, 88, 88, 88, 89]", "output": "88.11111111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81933_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027581", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[3, 3, 3, 3, 3, 3]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027582", "code": "from typing import List\ndef are_permutations(list_1: List[int], list_2: List[int]) -> bool:\n    if len(list_1) != len(list_2):\n        return False\n    freq_dict = {}\n    for num in list_1:\n        freq_dict[num] = freq_dict.get(num, 0) + 1\n    for num in list_2:\n        if num not in freq_dict or freq_dict[num] == 0:\n            return False\n        freq_dict[num] -= 1\n    return True\n", "entry_point": "are_permutations", "input": "[1, 2, 2, 3], [3, 2, 1, 2]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112294_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027583", "code": "from typing import List\ndef count_instances(instance_counts: List[int]) -> int:\n    total_count = 0\n    for count in instance_counts:\n        # Check conditions and exclude instances accordingly\n        if count > 0:  # Exclude instances with empty file attribute\n            if count % 2 != 0:  # Exclude instances where device is a test device\n                if count != 7:  # Exclude instances marked as deleted\n                    total_count += count\n    return total_count\n", "entry_point": "count_instances", "input": "[5, 5, 5, 5, 1]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34440_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3338", "output": "{1, 3338, 2, 1669}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3337", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027585", "code": "LABEL = \"RANDOM_LANCEMATE\"\nJOBS = (\"Mecha Pilot\", \"Arena Pilot\", \"Recon Pilot\", \"Mercenary\", \"Bounty Hunter\")\ndef generate_id(job_title):\n    shortened_title = job_title[:3].lower()\n    if job_title in JOBS:\n        return f\"{LABEL}_{shortened_title}\"\n    else:\n        return \"Invalid Job Title\"\n", "entry_point": "generate_id", "input": "'Mecha Pilot'", "output": "'RANDOM_LANCEMATE_mec'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7478_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027586", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "5, 1", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027587", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "30", "output": "{1, 2, 3, 5, 6, 10, 15, 30}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt29", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027588", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'00:00:01', '00:00:03'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027589", "code": "NDMAX = -2048\nPDMAX = 2047\nNVMAX = -4.096\nPVMAX = 4.096\ndef voltage_to_adc(voltage):\n    adc_range = PDMAX - NDMAX\n    voltage_range = PVMAX - NVMAX\n    adc_output = (voltage - NVMAX) / voltage_range * adc_range + NDMAX\n    return int(round(adc_output))  # Round to the nearest integer\n", "entry_point": "voltage_to_adc", "input": "-2.959", "output": "-1480", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143445_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027590", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9402", "output": "{1, 2, 3, 6, 9402, 4701, 3134, 1567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9401", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027591", "code": "import re\nDATE_RE = re.compile(r\"[0-9]{4}-[0-9]{2}-[0-9]{2}\")\nINVALID_IN_NAME_RE = re.compile(\"[^a-z0-9_]\")\ndef process_input(input_str):\n    # Check if input matches the date format pattern\n    is_date = bool(DATE_RE.match(input_str))\n    # Remove specific suffix if it exists\n    processed_str = input_str\n    if input_str.endswith(\"T00:00:00.000+00:00\"):\n        processed_str = input_str[:-19]\n    # Check for invalid characters based on the pattern\n    has_invalid_chars = bool(INVALID_IN_NAME_RE.search(input_str))\n    return (is_date, processed_str, has_invalid_chars)\n", "entry_point": "process_input", "input": "'200:00_A23'", "output": "(False, '200:00_A23', True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49598_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027592", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5498", "output": "{1, 5498, 2, 2749}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027593", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'1.9.9'", "output": "'2.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129755_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027594", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7746", "output": "{1, 7746, 3, 2, 3873, 6, 1291, 2582}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027595", "code": "def find_triplets(nums, n):\n    nums.sort()\n    ans = []\n    for k in range(len(nums)):\n        target = -nums[k]\n        i, j = k + 1, len(nums) - 1\n        while i < j:\n            s = nums[i] + nums[j]\n            if s < target:\n                i += 1\n            elif s > target:\n                j -= 1\n            else:\n                ans.append((nums[k], nums[i], nums[j]))\n                i += 1\n                j -= 1\n    return list(set(ans))\n", "entry_point": "find_triplets", "input": "[-5, 1, 4, -4, 0, -1], 0", "output": "[(-5, 1, 4), (-4, 0, 4), (-1, 0, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55668_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027596", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[9, 10]", "output": "9.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027597", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5831", "output": "{833, 1, 7, 5831, 17, 49, 119, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027598", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1257", "output": "{1, 419, 3, 1257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7782", "output": "{1, 2, 3, 2594, 7782, 6, 1297, 3891}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7781", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027600", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4717", "output": "{89, 1, 53, 4717}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4716", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027601", "code": "def wrap_line_helper(line, line_length):\n    words = line.split()\n    wrapped_lines = []\n    current_line = \"\"\n    for word in words:\n        if len(current_line) + len(word) <= line_length:\n            current_line += word + \" \"\n        else:\n            wrapped_lines.append(current_line.strip())\n            current_line = word + \" \"\n    if current_line:\n        wrapped_lines.append(current_line.strip())\n    return \"\\n\".join(wrapped_lines)\n", "entry_point": "wrap_line_helper", "input": "'orr', 3", "output": "'orr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58583_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027602", "code": "def flatten_lists(input_lists):\n    flattened_list = []\n    for sublist in input_lists:\n        for element in sublist:\n            flattened_list.append(element)\n    return flattened_list\n", "entry_point": "flatten_lists", "input": "[[9, 2, 1, 2, 3, 9, 2, 9, 2, 9, 2]]", "output": "[9, 2, 1, 2, 3, 9, 2, 9, 2, 9, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63552_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027603", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'02.1'", "output": "'02.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027604", "code": "def embed_sequences(seqs, vec_dict, embedding_size):\n    embeddings = []\n    seqs_keys = []\n    missing_3mers = set()\n    for key, seq in seqs.items():\n        embedding = []\n        for i in range(len(seq) - 2):\n            three_mer = seq[i:i+3]\n            if three_mer in vec_dict:\n                embedding.extend(vec_dict[three_mer])\n            else:\n                missing_3mers.add(three_mer)\n        if len(embedding) > 0:\n            embeddings.append(embedding)\n            seqs_keys.append(key)\n    return embeddings, seqs_keys, missing_3mers\n", "entry_point": "embed_sequences", "input": "{}, {}, 100", "output": "([], [], set())", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68873_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027605", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'\"hello world\" python'", "output": "['hello world', 'python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027606", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3277", "output": "{1, 29, 3277, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3276", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027607", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'5000+323'", "output": "5323", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027608", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4222", "output": "{1, 2, 4222, 2111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027609", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "5.85", "output": "107.45864999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2626", "output": "{1, 2626, 2, 1313, 101, 202, 13, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2625", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027611", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'1239'", "output": "{1239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027612", "code": "def process_command(input_str):\n    x = input_str.split(' ')\n    com = x[0]\n    rest = x[1:]\n    return (com, rest)\n", "entry_point": "process_command", "input": "'execute command with amens'", "output": "('execute', ['command', 'with', 'amens'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93382_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027613", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "50, 63", "output": "113", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027614", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        sum_val = input_list[i] + input_list[(i + 1) % n]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 0, 5, 1, 0, 2, 4, 0]", "output": "[3, 2, 5, 6, 1, 2, 6, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149618_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027615", "code": "def autocomplete_results(autocomplete_type, query):\n    music_pieces = [\n        {\"name\": \"Tristan und Isolde\", \"composer\": \"Wagner\"},\n        {\"name\": \"Carmen\", \"composer\": \"Bizet\"},\n        {\"name\": \"La Boh\u00e8me\", \"composer\": \"Puccini\"},\n        {\"name\": \"Swan Lake\", \"composer\": \"Tchaikovsky\"}\n    ]\n    results = []\n    for piece in music_pieces:\n        if autocomplete_type == \"name\" and query.lower() in piece[\"name\"].lower():\n            results.append({\"label\": piece[\"name\"]})\n        elif autocomplete_type == \"composer\" and query.lower() in piece[\"composer\"].lower():\n            results.append({\"label\": piece[\"composer\"]})\n    return results\n", "entry_point": "autocomplete_results", "input": "'composer', 'Wagner'", "output": "[{'label': 'Wagner'}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133721_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027616", "code": "def calculate_span(a):\n    n = len(a)\n    stack = []\n    span = [0] * n\n    span[0] = 1\n    stack.append(0)\n    for i in range(1, n):\n        while stack and a[stack[-1]] <= a[i]:\n            stack.pop()\n        span[i] = i + 1 if not stack else i - stack[-1]\n        stack.append(i)\n    return span\n", "entry_point": "calculate_span", "input": "[100, 80, 60, 70, 60, 75, 85]", "output": "[1, 1, 1, 2, 1, 4, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22670_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027617", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "3, 11, 4", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027618", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4204", "output": "{1, 2, 4, 4204, 2102, 1051}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4203", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027619", "code": "from typing import List\ndef perform_operation(float_list: List[float]) -> float:\n    result = float_list[0]  # Initialize result with the first number\n    for i in range(1, len(float_list)):\n        if i % 2 == 1:  # Odd index, subtract\n            result -= float_list[i]\n        else:  # Even index, add\n            result += float_list[i]\n    return result\n", "entry_point": "perform_operation", "input": "[10.0, 2.0, 5.2]", "output": "13.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88957_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027620", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[91] * 10, 10", "output": "91.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027621", "code": "from typing import List\ndef get_unique_elements(input_list: List[int]) -> List[int]:\n    unique_elements = []\n    seen_elements = set()\n    for element in input_list:\n        if element not in seen_elements:\n            unique_elements.append(element)\n            seen_elements.add(element)\n    return unique_elements\n", "entry_point": "get_unique_elements", "input": "[3, 5, 3, 2, 5, 7, 8, 8, 8]", "output": "[3, 5, 2, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78256_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027622", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[5, 5, 2, -5, -1, -1, 2]", "output": "[25, 25, 4, 125, 1, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027623", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7817", "output": "{1, 7817}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027624", "code": "def max_product_of_three(nums):\n    if len(nums) < 3:\n        return 0\n    max1 = max2 = max3 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max3 = max2\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max3 = max2\n            max2 = num\n        elif num > max3:\n            max3 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2 * max3, max1 * min1 * min2)\n", "entry_point": "max_product_of_three", "input": "[2, 6, 8, 12]", "output": "576", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4670_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027625", "code": "def escape_html_tags(input_str: str) -> str:\n    escaped_str = \"\"\n    inside_tag = False\n    for char in input_str:\n        if char == '<':\n            inside_tag = True\n        elif char == '>':\n            inside_tag = False\n        if inside_tag and (char == '<' or char == '>'):\n            escaped_str += f\"&lt;\" if char == '<' else \"&gt;\"\n        else:\n            escaped_str += char\n    return escaped_str\n", "entry_point": "escape_html_tags", "input": "'<div><g</span></div>'", "output": "'&lt;div>&lt;g&lt;/span>&lt;/div>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110429_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5169", "output": "{1, 3, 1723, 5169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027627", "code": "import importlib\ndef execute_provider_function(provider_submodule, provider_id):\n    try:\n        # Dynamically import the provider submodule\n        provider_module = importlib.import_module(f\".{provider_submodule}\", package=\"ckan_cloud_operator.providers\")\n        # Retrieve the necessary provider functions\n        provider_functions = providers_helpers.get_provider_functions(provider_submodule, provider_id)\n        # Execute the specific function based on the provider ID\n        if provider_id == 'cluster':\n            result = cluster_manager.execute(provider_functions)\n        elif provider_id == 'kamatera':\n            result = kamatera_manager.execute(provider_functions)\n        else:\n            result = \"Function not found for the given provider ID\"\n        return result\n    except ModuleNotFoundError:\n        return f\"Provider submodule '{provider_submodule}' not found\"\n    except AttributeError:\n        return f\"Provider function for ID '{provider_id}' not found\"\n", "entry_point": "execute_provider_function", "input": "'lusrter', 'some_id'", "output": "\"Provider submodule 'lusrter' not found\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101444_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027628", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaaaabbrrcd'", "output": "{'a': 5, 'b': 2, 'r': 2, 'c': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027629", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'sample', '10'", "output": "{'10': 'sample'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5654", "output": "{1, 2, 514, 257, 11, 2827, 5654, 22}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5653", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027631", "code": "from typing import List\ndef calculate_unique_views(view_ids: List[int]) -> int:\n    unique_views = set()\n    for view_id in view_ids:\n        unique_views.add(view_id)\n    return len(unique_views)\n", "entry_point": "calculate_unique_views", "input": "[1, 2, 2, 3, 1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46079_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027632", "code": "def map_users_to_family_groups(users, family_groups):\n    user_to_group_mapping = {}\n    for group_id, group in enumerate(family_groups, start=1):\n        for user_id in group['users']:\n            user_to_group_mapping[user_id] = group_id\n    return user_to_group_mapping\n", "entry_point": "map_users_to_family_groups", "input": "[], []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123185_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027633", "code": "def fn_brute(n, i, prob_id):\n    if prob_id < 10:\n        return sum(range(1, n + 1))\n    elif 10 <= prob_id <= 20:\n        result = 1\n        for num in range(1, n + 1):\n            result *= num\n        return result\n    else:\n        return i ** n\n", "entry_point": "fn_brute", "input": "10, 0, 15", "output": "3628800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106229_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027634", "code": "def reverseOnlyLetters(s: str) -> str:\n    i = 0\n    j = len(s) - 1\n    m = list(range(65, 91)) + list(range(97, 123))\n    s = list(s)\n    while i < j:\n        if ord(s[i]) not in m:\n            i += 1\n            continue\n        if ord(s[j]) not in m:\n            j -= 1\n            continue\n        s[i], s[j] = s[j], s[i]\n        i += 1\n        j -= 1\n    return \"\".join(s)\n", "entry_point": "reverseOnlyLetters", "input": "'aaaaaad'", "output": "'daaaaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123278_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027635", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38745_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027636", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'lllhwd!'", "output": "{'l': 3, 'h': 1, 'w': 1, 'd': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15027_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027637", "code": "from typing import List\ndef _merge_small_intervals(buff: List[int], size: int) -> List[int]:\n    result = []\n    start = 0\n    end = 0\n    while end < len(buff):\n        while end < len(buff) - 1 and buff[end + 1] - buff[end] == 1:\n            end += 1\n        if end - start + 1 < size:\n            result.extend(buff[start:end + 1])\n        else:\n            result.extend(buff[start:end + 1])\n        end += 1\n        start = end\n    return result\n", "entry_point": "_merge_small_intervals", "input": "[1, 2, 3, 5, 6, 8, 9, 10], 2", "output": "[1, 2, 3, 5, 6, 8, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9378_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027638", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2913", "output": "{2913, 1, 3, 971}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2912", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027639", "code": "def count_words_in_sentences(sentences):\n    word_count_dict = {}\n    for sentence in sentences:\n        words = sentence.split()\n        word_count_dict[sentence] = len(words)\n    return word_count_dict\n", "entry_point": "count_words_in_sentences", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147467_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027640", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'AAAA<KEY>9XA', 'za'", "output": "'AAAAza9XA'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027641", "code": "def process_integers(input_list):\n    modified_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            modified_list.append(num ** 2)\n        elif num % 2 != 0:\n            modified_list.append(num ** 3)\n        if num % 3 == 0:\n            modified_list[-1] += 10  # Increment the last added element by 10\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 7, 1, 4, 6, 6]", "output": "[1, 343, 1, 16, 46, 46]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108858_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027642", "code": "def generate_code(input_string):\n    result = \"\"\n    position = 1\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper()\n            result += str(position)\n            position += 1\n    return result\n", "entry_point": "generate_code", "input": "'WORLD'", "output": "'W1O2R3L4D5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4318_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027643", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'njideahjene'", "output": "'njideahjene'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027644", "code": "def get_permission_required(permissions_map, url):\n    default_permission = 'is_superuser'\n    return permissions_map.get(url, default_permission)\n", "entry_point": "get_permission_required", "input": "{}, 'http://example.com/non_existing_path'", "output": "'is_superuser'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91587_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027645", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2923", "output": "{1, 2923, 37, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027646", "code": "import re\nPATHREGEX = re.compile('^((?:local)|(?:utc))/?(.*)$')\ndef extract_path_info(path):\n    match = PATHREGEX.match(path)\n    if match:\n        timezone = match.group(1)\n        remaining_path = match.group(2)\n        return timezone, remaining_path\n    else:\n        return None\n", "entry_point": "extract_path_info", "input": "'local/documents/file.txt'", "output": "('local', 'documents/file.txt')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79498_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027647", "code": "def modify_exp_name(exp_name, scale):\n    if 'ffhq' in exp_name:\n        exp_name = exp_name.replace('ffhq', 'stylegan2')\n    if scale >= 10:\n        exp_name += '_high_res'\n    else:\n        exp_name += '_low_res'\n    return exp_name\n", "entry_point": "modify_exp_name", "input": "'glean_ffhq_16x', 16", "output": "'glean_stylegan2_16x_high_res'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92889_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027648", "code": "def process_list(lst):\n    result = []\n    for index, num in enumerate(lst):\n        result.append((num + index) * index)\n    return result\n", "entry_point": "process_list", "input": "[0, 0, 0, 0, 0, 2, 0, 0]", "output": "[0, 1, 4, 9, 16, 35, 36, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27232_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027649", "code": "def calculate_video_duration(frames: int, fps: int) -> int:\n    total_duration = frames // fps\n    return total_duration\n", "entry_point": "calculate_video_duration", "input": "4, 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77453_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027650", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'cb'", "output": "['cb', 'bc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027651", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[85, 85, 80, 79, 75, 70]", "output": "[85, 80, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43620_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027652", "code": "def extract_top_module(module_path: str) -> str:\n    # Split the module_path string by dots\n    modules = module_path.split('.')\n    # Return the top-level module name\n    return modules[0]\n", "entry_point": "extract_top_module", "input": "'sesestsessetoolssesttr.module'", "output": "'sesestsessetoolssesttr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40470_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027653", "code": "def calculate_class_average(scores):\n    if len(scores) < 3:\n        return \"Not enough scores to calculate average.\"\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return round(average, 2)\n", "entry_point": "calculate_class_average", "input": "[70, 80, 82, 82, 90]", "output": "81.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82047_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027654", "code": "from typing import List\ndef findMaxConsecutiveOnes(nums: List[int]) -> int:\n    i, j = 0, 0\n    ans = 0\n    while j < len(nums):\n        if nums[j] == 0:\n            ans = max(ans, j - i)\n            i = j + 1\n        j += 1\n    return max(ans, j - i)\n", "entry_point": "findMaxConsecutiveOnes", "input": "[1, 1, 1, 1, 1, 1, 1, 0, 1, 1]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29322_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027655", "code": "def filter_numbers(numbers, lower_bound, upper_bound):\n    filtered_numbers = [num for num in numbers if lower_bound <= num <= upper_bound]\n    return filtered_numbers\n", "entry_point": "filter_numbers", "input": "[0.1, 0.2, 0.3, 0.4], 0.1, 0.3", "output": "[0.1, 0.2, 0.3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42613_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027656", "code": "def snake_to_dotted_lower(snake_str):\n    words = snake_str.split('_')  # Split the snake_case string into words\n    lower_words = [word.lower() for word in words]  # Convert each word to lowercase\n    dotted_lower_str = '.'.join(lower_words)  # Join the lowercase words with a dot separator\n    return dotted_lower_str\n", "entry_point": "snake_to_dotted_lower", "input": "'fbffor'", "output": "'fbffor'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65462_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027657", "code": "def process_numbers(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num * 5)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "process_numbers", "input": "[7, 8, 0, 9, 7, 8, 1, 30, 8]", "output": "[7, 64, 0, 729, 7, 64, 1, 150, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146375_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027658", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'dadatiencea-scie', 'oyp/h/ht/'", "output": "'dadatiencea-scie/oyp/h/ht'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027659", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "-2, 1", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027660", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'Is.'", "output": "{'is': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027661", "code": "def process_options(options):\n    name = options.get('full_name', None)\n    client_name = options.get('client_name', None)\n    schema_name = options.get('schema_name', None)\n    domain_url = options.get('domain_url', None)\n    languages = options.get('languages', 'en')\n    post_command = options.get('post_command', None)\n    return name, client_name, schema_name, domain_url, languages, post_command\n", "entry_point": "process_options", "input": "{}", "output": "(None, None, None, None, 'en', None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30874_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027662", "code": "def longest_common_prefix(revision_ids):\n    if not revision_ids:\n        return \"\"\n    prefix = \"\"\n    for i in range(len(revision_ids[0])):\n        char = revision_ids[0][i]\n        for revision_id in revision_ids[1:]:\n            if i >= len(revision_id) or revision_id[i] != char:\n                return prefix\n        prefix += char\n    return prefix\n", "entry_point": "longest_common_prefix", "input": "['8efa45d83a3', '8efa45d83a3abc', '8efa45d83a3xyz']", "output": "'8efa45d83a3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33691_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027663", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6807", "output": "{1, 3, 2269, 6807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027664", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / len(top_scores) if top_scores else 0.0\n", "entry_point": "average_top_scores", "input": "[90, 90, 85, 79], 4", "output": "86.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123671_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027665", "code": "from typing import List\ndef unique_elements(lista: List[int]) -> List[int]:\n    seen = set()\n    result = []\n    for num in lista:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "unique_elements", "input": "[6, 2, 6, 1, 5, 2]", "output": "[6, 2, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139228_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027666", "code": "from typing import List\ndef convert_to_milliseconds(task_durations: List[int]) -> List[int]:\n    milliseconds_durations = [duration * 1000 for duration in task_durations]\n    return milliseconds_durations\n", "entry_point": "convert_to_milliseconds", "input": "[16, 8, 8, 19, 20, 18]", "output": "[16000, 8000, 8000, 19000, 20000, 18000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30331_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027667", "code": "def minimize_waiting_time(models):\n    models.sort()  # Sort models based on training time in ascending order\n    total_waiting_time = 0\n    current_time = 0\n    for model_time in models:\n        total_waiting_time += current_time\n        current_time += model_time\n    return total_waiting_time\n", "entry_point": "minimize_waiting_time", "input": "[5, 5, 10, 15]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57803_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027668", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:MIT+6.001+Spring20co'", "output": "('MIT', '6.001', 'Spring20co')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027669", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'accelerometer'", "output": "'Value of accelerometer'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027670", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[89, 88, 76, 50, 45]", "output": "[89, 88, 76]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027671", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3085", "output": "{1, 5, 3085, 617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3084", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027672", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'-10 -10 + -1'", "output": "-21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5405", "output": "{1, 5, 235, 47, 115, 23, 1081, 5405}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5404", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027674", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "'is'", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027675", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1071", "output": "{1, 3, 357, 7, 9, 1071, 17, 51, 21, 119, 153, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027676", "code": "def lemmatizer(word_lemmas, words):\n    result = {}\n    for word in words:\n        if word in word_lemmas:\n            result[word] = word_lemmas[word]\n    return result\n", "entry_point": "lemmatizer", "input": "{}, ['run', 'jump', 'swim']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7145_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027677", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7063", "output": "{1, 7, 1009, 7063}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027678", "code": "def transform_list(input_list):\n    output_list = [num + index for index, num in enumerate(input_list)]\n    return output_list\n", "entry_point": "transform_list", "input": "[2, 3, 1, 0, 7, 0, 2, 1]", "output": "[2, 4, 3, 3, 11, 5, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117964_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027679", "code": "def top_three_scores(scores):\n    unique_scores = set(scores)\n    sorted_scores = sorted(unique_scores, reverse=True)\n    if len(sorted_scores) >= 3:\n        return sorted_scores[:3]\n    else:\n        return sorted_scores\n", "entry_point": "top_three_scores", "input": "[100, 89, 88, 70, 70]", "output": "[100, 89, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99287_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027680", "code": "def evaluate_expression(expression):\n    tokens = expression.split()\n    if len(tokens) == 3:  # Arithmetic operation\n        num1, operator, num2 = tokens\n        num1, num2 = int(num1), int(num2)\n        if operator == '+':\n            return num1 + num2\n        elif operator == '-':\n            return num1 - num2\n        elif operator == '*':\n            return num1 * num2\n        elif operator == '/':\n            return num1 / num2\n    elif len(tokens) == 2:  # Comparison or logical operation\n        operator = tokens[0]\n        if operator == 'not':\n            return not eval(tokens[1])\n        elif operator == 'and':\n            return all(eval(token) for token in tokens[1:])\n        elif operator == 'or':\n            return any(eval(token) for token in tokens[1:])\n    return None  # Invalid expression format\n", "entry_point": "evaluate_expression", "input": "'6 * 6'", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109464_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8439", "output": "{1, 97, 3, 291, 2813, 87, 8439, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027682", "code": "def cumulative_minimum(lst):\n    result = []\n    current_min = float('inf')\n    for num in lst:\n        current_min = min(current_min, num)\n        result.append(current_min)\n    return result\n", "entry_point": "cumulative_minimum", "input": "[3, 1, 1, 1, 1, 1, 1, 1, 1]", "output": "[3, 1, 1, 1, 1, 1, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62075_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027683", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'world'", "output": "'w.o.r.l.d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027684", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[65, 78, 79, 84, 85, 86, 87, 87, 91]", "output": "[65, 78, 79, 84, 85, 86, 87, 87, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027685", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "4", "output": "[1, 3, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027686", "code": "def process_object(object_name: str, object_category: str) -> tuple:\n    source_value = None\n    endpoint_url = None\n    if object_category == \"data_source\":\n        source_value = \"ds_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/ds_smart_status\"\n        object_category = \"data_name\"\n    elif object_category == \"data_host\":\n        source_value = \"dh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/dh_smart_status\"\n    elif object_category == \"metric_host\":\n        source_value = \"mh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/mh_smart_status\"\n    body = \"{'\" + object_category + \"': '\" + object_name + \"'}\"\n    return source_value, endpoint_url, body\n", "entry_point": "process_object", "input": "'ejttt', 'dddsasdathd'", "output": "(None, None, \"{'dddsasdathd': 'ejttt'}\")", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133706_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027687", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[3, 2.5, 3.5, 1, 3.5, 2.5, 3]", "output": "[6, 5.0, 7.0, 2, 7.0, 5.0, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027688", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9346", "output": "{4673, 1, 9346, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9345", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027689", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{0: 3}", "output": "[0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027690", "code": "def calculate_cumulative_sum(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "calculate_cumulative_sum", "input": "[5, 1, 1]", "output": "[5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126098_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8727", "output": "{1, 3, 2909, 8727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027692", "code": "def count_consecutive_i(input_str):\n    max_consecutive_i = 0\n    current_consecutive_i = 0\n    for char in input_str:\n        if char == 'i':\n            current_consecutive_i += 1\n            max_consecutive_i = max(max_consecutive_i, current_consecutive_i)\n        else:\n            current_consecutive_i = 0\n    return max_consecutive_i\n", "entry_point": "count_consecutive_i", "input": "'iiiiiiiiiii'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6207_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027693", "code": "def to_weird_case(string):\n    recase = lambda s: \"\".join([c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(s)])\n    return \" \".join([recase(word) for word in string.split(\" \")])\n", "entry_point": "to_weird_case", "input": "'Ee H'", "output": "'Ee H'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20447_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027694", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5867", "output": "{1, 5867}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5866", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027695", "code": "def calculate_values(lat_interval, lon_interval):\n    lat = (lat_interval[0] + lat_interval[1]) / 2\n    lon = (lon_interval[0] + lon_interval[1]) / 2\n    lat_err = abs(lat_interval[1] - lat_interval[0]) / 2\n    lon_err = abs(lon_interval[1] - lon_interval[0]) / 2\n    return lat, lon, lat_err, lon_err\n", "entry_point": "calculate_values", "input": "(10, 20), (100, 110)", "output": "(15.0, 105.0, 5.0, 5.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82906_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027696", "code": "def sort_list_with_minus_one(a):\n    non_negatives = [x for x in a if x != -1]\n    non_negatives.sort()\n    negatives = [x for x in a if x == -1]\n    sorted_list = non_negatives + negatives\n    return sorted_list\n", "entry_point": "sort_list_with_minus_one", "input": "[0, 0, 1, 2, 2, 3, -1, -1]", "output": "[0, 0, 1, 2, 2, 3, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76613_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027697", "code": "def reshape_tensor(sizes, new_order):\n    reshaped_sizes = []\n    for index in new_order:\n        reshaped_sizes.append(sizes[index])\n    return reshaped_sizes\n", "entry_point": "reshape_tensor", "input": "[3, 4, 5], [0, 1, 2, 2, 2, 0, 0, 0, 0]", "output": "[3, 4, 5, 5, 5, 3, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117209_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027698", "code": "def max_score_before_game_ends(scores):\n    max_score = float('-inf')  # Initialize max_score to negative infinity\n    for score in scores:\n        if score <= max_score:\n            break  # Exit the loop if the current score is less than or equal to the max_score\n        max_score = max(max_score, score)  # Update max_score if the current score is greater\n    return max_score\n", "entry_point": "max_score_before_game_ends", "input": "[5, 8, 10, 11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31682_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027699", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9784", "output": "{1, 2, 4, 1223, 8, 2446, 9784, 4892}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9783", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027700", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3873", "output": "{1291, 1, 3, 3873}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3872", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027701", "code": "def display_selected_values(values):\n    formatted_values = ', '.join(['\"{}\"'.format(value) for value in values])\n    return 'You have selected {}'.format(formatted_values)\n", "entry_point": "display_selected_values", "input": "['banana', 'banana']", "output": "'You have selected \"banana\", \"banana\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61579_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027702", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'line'", "output": "([], ['line'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027703", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4439", "output": "{1, 23, 193, 4439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027704", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "'  Holl\u00e0  '", "output": "'Holl\u00e0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027705", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1483", "output": "{1, 1483}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1482", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027706", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6385", "output": "{1, 5, 6385, 1277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6384", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027707", "code": "def modify_string(input_str: str) -> str:\n    modified_str = input_str.replace('\\\\begin{table}[H]\\n\\\\begin{tabular', '\\\\begin{table}\\n\\\\begin{tabular')\n    if '\\\\begin{table}\\n\\\\begin{tabular' in modified_str:\n        modified_str += ' - Table Found'\n    return modified_str\n", "entry_point": "modify_string", "input": "'\\\\begin{tabH]'", "output": "'\\\\begin{tabH]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135354_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027708", "code": "from typing import List\ndef read_scores(content: str) -> List[int]:\n    scores_str = content.strip().split(',')\n    scores = [int(score) for score in scores_str]\n    return scores\n", "entry_point": "read_scores", "input": "'85, 92, 885, 2, 8'", "output": "[85, 92, 885, 2, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98689_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027709", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "1.0, 801.456", "output": "801.456", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027710", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6985", "output": "{1, 5, 6985, 11, 1397, 55, 635, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027711", "code": "# Constants from the code snippet\nDOCKER_IMAGE_PATH_BASE = \"308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/\"\nDOCKER_IMAGE_VERSION = 287\n# Function to construct Docker image paths\ndef construct_image_paths(base_path, version):\n    return f\"{base_path}{version}\"\n", "entry_point": "construct_image_paths", "input": "'303528', 1", "output": "'3035281'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70138_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027712", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[9, 9, 9, 7, 3, 2, 2, 10]", "output": "[9, 9, 9, 7, 3, 2, 2, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027713", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'python'", "output": "'Binary path for python not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027714", "code": "def modify_list(int_list, str_list):\n    modified_list = int_list + [int(x) for x in str_list]  # Extend int_list with elements from str_list\n    modified_list.insert(0, 12)  # Insert 12 at the beginning of modified_list\n    modified_list.reverse()  # Reverse the elements of modified_list\n    modified_list.sort(reverse=True)  # Sort modified_list in descending order\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 2, 3, 4], ['5', '6', '7', '8', '9']", "output": "[12, 9, 8, 7, 6, 5, 4, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50028_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027715", "code": "def lcs_length(X, Y):\n    m, n = len(X), len(Y)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if X[i - 1] == Y[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'abc', ''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36552_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027716", "code": "from typing import List\ndef sum_divisible_by_3_and_5(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_3_and_5", "input": "[15, 30, 45, 75]", "output": "165", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80529_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027717", "code": "def jaccard_similarity_coefficient(x, y):\n    set_x = set(x)\n    set_y = set(y)\n    intersection_size = len(set_x.intersection(set_y))\n    union_size = len(set_x.union(set_y))\n    if union_size == 0:  # Handle division by zero\n        return 0.0\n    return intersection_size / union_size\n", "entry_point": "jaccard_similarity_coefficient", "input": "[1, 2, 3], [2, 3, 4, 5]", "output": "0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77613_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027718", "code": "def sum_except_self(input_list):\n    total_sum = sum(input_list)\n    output_list = [total_sum - num for num in input_list]\n    return output_list\n", "entry_point": "sum_except_self", "input": "[1, 1, 3]", "output": "[4, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8241_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027719", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4295", "output": "{1, 859, 5, 4295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4294", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027720", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 2, 1, 2, 3, 2, 3, 3, 2]", "output": "[3, 3, 3, 5, 7, 7, 9, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027721", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5594", "output": "{1, 5594, 2, 2797}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5593", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027722", "code": "from typing import List\ndef bubble_sort(arr: List[int]) -> List[int]:\n    n = len(arr)\n    for i in range(n):\n        swapped = False\n        for j in range(n - 1 - i):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n                swapped = True\n        if not swapped:\n            break\n    return arr\n", "entry_point": "bubble_sort", "input": "[5, 4, 3, 2, 1]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100970_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027723", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'JavaScripp,'", "output": "['JavaScripp', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027724", "code": "import math\ndef custom_round(value, order, as_int=True, round_op=None):\n    if round_op is None:\n        round_op = round\n    if order == 0:\n        value = round(float(value))\n        return int(value) if as_int else value\n    scale = math.pow(10, order)\n    value = scale * round_op(float(value) / scale)\n    return int(value) if as_int else value\n", "entry_point": "custom_round", "input": "100, 0", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136731_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "825", "output": "{1, 33, 3, 5, 165, 11, 75, 15, 275, 55, 825, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt824", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027726", "code": "def grouped(portfolios, size):\n    result = []\n    for i in range(0, len(portfolios), size):\n        result.append(portfolios[i:i + size])\n    return result\n", "entry_point": "grouped", "input": "[3, 8, 2, 10, 4, 7, 7, 6], 8", "output": "[[3, 8, 2, 10, 4, 7, 7, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78525_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027727", "code": "def calculate_average_price(prices):\n    total_sum = sum(prices)\n    average_price = total_sum / len(prices)\n    rounded_average = round(average_price)\n    return rounded_average\n", "entry_point": "calculate_average_price", "input": "[175001]", "output": "175001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112291_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027728", "code": "def calculate_trainable_parameters(layers, units_per_layer):\n    total_params = 0\n    input_size = 7 * 7  # Assuming input size based on the environment\n    for _ in range(layers):\n        total_params += (input_size + 1) * units_per_layer\n        input_size = units_per_layer\n    return total_params\n", "entry_point": "calculate_trainable_parameters", "input": "1, 1674", "output": "83700", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124974_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027729", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1117", "output": "{1, 1117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027730", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7337", "output": "{1, 7337, 11, 23, 253, 667, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7336", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027731", "code": "def calculate_forward_differences(input_list):\n    solution = input_list.copy()\n    fwd = [input_list[i+1] - input_list[i] for i in range(len(input_list)-1)]\n    return solution, fwd\n", "entry_point": "calculate_forward_differences", "input": "[13, 20, 13, 27, 27, 20]", "output": "([13, 20, 13, 27, 27, 20], [7, -7, 14, 0, -7])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137495_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027732", "code": "from collections import defaultdict\ndef install_order(dependencies):\n    graph = defaultdict(set)\n    packages = set()\n    for package, dependency in dependencies:\n        graph[package].add(dependency)\n        packages.add(package)\n        packages.add(dependency)\n    def topological_sort(package, visited, stack):\n        visited.add(package)\n        for dependency in graph[package]:\n            if dependency not in visited:\n                topological_sort(dependency, visited, stack)\n        stack.append(package)\n    visited = set()\n    stack = []\n    for package in packages:\n        if package not in visited:\n            topological_sort(package, visited, stack)\n    return stack[::-1]\n", "entry_point": "install_order", "input": "[('x', 'y'), ('y', 'z')]", "output": "['x', 'y', 'z']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2940_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027733", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[34, 34, 34]", "output": "102", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027734", "code": "from typing import List\ndef has_path(maze: List[List[int]]) -> bool:\n    def dfs(row, col):\n        if row < 0 or col < 0 or row >= len(maze) or col >= len(maze[0]) or maze[row][col] == 1 or visited[row][col]:\n            return False\n        if row == len(maze) - 1 and col == len(maze[0]) - 1:\n            return True\n        visited[row][col] = True\n        if dfs(row + 1, col) or dfs(row, col + 1):\n            return True\n        return False\n    visited = [[False for _ in range(len(maze[0]))] for _ in range(len(maze))]\n    return dfs(0, 0)\n", "entry_point": "has_path", "input": "[[0, 0], [0, 0]]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37727_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027735", "code": "def find_unique_number(nums):\n    unique_num = 0\n    for num in nums:\n        unique_num ^= num\n    return unique_num\n", "entry_point": "find_unique_number", "input": "[1, 1, 2, 2, 4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126841_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027736", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6522", "output": "{1, 2, 3, 6, 6522, 3261, 2174, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6521", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027737", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[2, 2, 3, 3, 7, 11]", "output": "(7, 11)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027738", "code": "def calculate_product(nums):\n    product = 1\n    for num in nums:\n        if num != 0:\n            product *= num\n    return product\n", "entry_point": "calculate_product", "input": "[12, 10, 24, 0, 0]", "output": "2880", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25506_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027739", "code": "def generate_fibonacci_sequence(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci_sequence", "input": "2", "output": "[0, 1, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32126_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027740", "code": "from typing import List\ndef find_first_occurrence(data_changed_flags: List[int]) -> int:\n    for index, value in enumerate(data_changed_flags):\n        if value == 1:\n            return index\n    return -1\n", "entry_point": "find_first_occurrence", "input": "[0, 0, 0, 0, 1]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32380_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027741", "code": "def search(s: str, pattern: str) -> int:\n    if len(s) < len(pattern):\n        return 0\n    if s[:len(pattern)] == pattern:\n        return 1 + search(s[len(pattern):], pattern)\n    else:\n        return search(s[1:], pattern)\n", "entry_point": "search", "input": "'abcabc', 'abc'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118249_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027742", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[98, 97, 90, 85]", "output": "[98, 97, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140877_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7798", "output": "{1, 2, 7, 557, 14, 7798, 1114, 3899}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7797", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3490", "output": "{1, 3490, 2, 5, 10, 1745, 698, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3489", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027745", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6535", "output": "{1, 1307, 5, 6535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027746", "code": "def custom_sort(array):\n    even_nums = []\n    odd_nums = []\n    for num in array:\n        if num % 2 == 0:\n            even_nums.append(num)\n        else:\n            odd_nums.append(num)\n    even_nums.sort()\n    odd_nums.sort(reverse=True)\n    return even_nums + odd_nums\n", "entry_point": "custom_sort", "input": "[8, 6, 4, 2, 5, 7, 1, 3]", "output": "[2, 4, 6, 8, 7, 5, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98658_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027747", "code": "import re\ndef extract_info(text, pattern):\n    match = re.search(pattern, text)\n    return match.group() if match else None\n", "entry_point": "extract_info", "input": "'The total price is $25.99', '\\\\$\\\\d+\\\\.\\\\d{2}'", "output": "'$25.99'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55939_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9727", "output": "{1, 137, 71, 9727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027749", "code": "def duplicate_characters(name):\n    duplicated_name = \"\"\n    for char in name:\n        duplicated_name += char * 2\n    return duplicated_name\n", "entry_point": "duplicate_characters", "input": "'BacpkTF'", "output": "'BBaaccppkkTTFF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49603_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027750", "code": "def count_connections(limbSeq):\n    unique_connections = set()\n    for connection in limbSeq:\n        unique_connections.add(tuple(sorted(connection)))  # Convert connection to tuple and sort for uniqueness\n    return len(unique_connections)\n", "entry_point": "count_connections", "input": "[(1, 2), (2, 1), (3, 4), (5, 6)]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83968_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027751", "code": "def compress_string(input_string):\n    if not input_string:\n        return \"\"\n    compressed_string = \"\"\n    current_char = input_string[0]\n    char_count = 1\n    for i in range(1, len(input_string)):\n        if input_string[i] == current_char:\n            char_count += 1\n        else:\n            compressed_string += current_char + str(char_count)\n            current_char = input_string[i]\n            char_count = 1\n    compressed_string += current_char + str(char_count)\n    return compressed_string\n", "entry_point": "compress_string", "input": "'ccccd'", "output": "'c4d1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107828_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027752", "code": "def generate_launch_command(file_name):\n    if file_name.endswith('.class'):\n        # Java class file\n        class_name = file_name[:-6]  # Remove the '.class' extension\n        return f'java {class_name}'\n    elif file_name.endswith('.exe'):\n        # Executable binary file with '.exe' extension\n        return file_name\n    else:\n        # Executable binary file without extension\n        return file_name\n", "entry_point": "generate_launch_command", "input": "'aexexejale'", "output": "'aexexejale'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1698_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027753", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3661", "output": "{1, 523, 3661, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027754", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "11", "output": "'XI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027755", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int, int]:\n    major, minor, patch_build = version.split('.')\n    patch, build = patch_build.split('-')\n    return int(major), int(minor), int(patch), int(build)\n", "entry_point": "parse_version", "input": "'5.0.0-123'", "output": "(5, 0, 0, 123)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133455_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027756", "code": "def rank_scores(scores):\n    score_counts = {}\n    for score in scores:\n        score_counts[score] = score_counts.get(score, 0) + 1\n    unique_scores = sorted(set(scores), reverse=True)\n    ranks = {}\n    rank = 1\n    for score in unique_scores:\n        count = score_counts[score]\n        for _ in range(count):\n            ranks[score] = rank\n        rank += count\n    return [ranks[score] for score in scores]\n", "entry_point": "rank_scores", "input": "[40, 100, 30, 100, 50, 10, 40]", "output": "[4, 1, 6, 1, 3, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135203_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027757", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[1, 3, 3, 4, 1, 4, 1, 4]", "output": "[1, 4, 7, 11, 12, 16, 17, 21]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40119_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027758", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1487", "output": "{1, 1487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027759", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "3, 22", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027760", "code": "def maximum_product(nums):\n    nums.sort()\n    n = len(nums)\n    # Calculate the two potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    # Return the maximum of the two products\n    return max(product1, product2)\n", "entry_point": "maximum_product", "input": "[2, 4, 7, -1, -2]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34437_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027761", "code": "import math\ndef calculate_disk_area(zpos, ypos, hw):\n    radius = hw\n    area = math.pi * radius**2\n    return area\n", "entry_point": "calculate_disk_area", "input": "0, 0, 6.0", "output": "113.09733552923255", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111295_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027762", "code": "def InsertionSort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and key < arr[j]:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "InsertionSort", "input": "[5, 1, 9, 2, 5, 1, 17, 9, 8]", "output": "[1, 1, 2, 5, 5, 8, 9, 9, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027763", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[34, 90, 11, 35, 91, 35, 89, 90, 92]", "output": "[11, 34, 35, 35, 89, 90, 90, 91, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027764", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6974", "output": "{1, 2, 11, 22, 634, 317, 6974, 3487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6973", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027765", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8606", "output": "{1, 2, 331, 13, 4303, 662, 26, 8606}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8605", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027766", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "543", "output": "{1, 3, 181, 543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027767", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "5, 5, 5", "output": "75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027768", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3665", "output": "{3665, 1, 5, 733}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027769", "code": "def calculate_project_cost(base_cost: float, cost_per_line: float, lines_of_code: int) -> float:\n    total_cost = base_cost + (lines_of_code * cost_per_line)\n    return total_cost\n", "entry_point": "calculate_project_cost", "input": "900.0, 0.359, 1", "output": "900.359", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125885_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027770", "code": "def calculate_total_cost(output):\n    total_cost = 0\n    lines = output.strip().split('\\n')\n    for line in lines:\n        cost_str = line.split()[1].split('@')[0]\n        total_cost += int(cost_str)\n    return total_cost\n", "entry_point": "calculate_total_cost", "input": "'Item 1@desc\\nItem 2@desc'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1054_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6657", "output": "{1, 6657, 3, 7, 2219, 21, 951, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027772", "code": "def rotate_array(arr, s):\n    n = len(arr)\n    s = s % n\n    for _ in range(s):\n        store = arr[n-1]\n        for i in range(n-2, -1, -1):\n            arr[i+1] = arr[i]\n        arr[0] = store\n    return arr\n", "entry_point": "rotate_array", "input": "[4, 2, 10, 11, 0, -1, -1, -1], 1", "output": "[-1, 4, 2, 10, 11, 0, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58826_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027773", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "41, 13", "output": "(23, 19, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027774", "code": "from typing import Tuple\ndef parse_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'3.14.727'", "output": "(3, 14, 727)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47030_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027775", "code": "def format_log_message(message: str, context: dict) -> str:\n    timestamp = context.get(\"timestamp\", \"\")\n    severity = context.get(\"severity\", \"\")\n    function_name = context.get(\"function_name\", \"\")\n    formatted_message = \"[{}] {} - Function '{}': {}\".format(timestamp, severity, function_name, message)\n    return formatted_message\n", "entry_point": "format_log_message", "input": "'comped', {}", "output": "\"[]  - Function '': comped\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31595_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027776", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4306", "output": "{2153, 1, 4306, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4305", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027777", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[4.0, 4.5]", "output": "4.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027778", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6063", "output": "{1, 129, 3, 2021, 43, 141, 6063, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6062", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027779", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[4, 6, 6, 1, 4, 1, 1, 1]", "output": "[16, 36, 36, 1, 16, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027780", "code": "NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION = 0\nNOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION = 1\nNOTIFICATION_REPORTED_AS_FALLACY = 2\nNOTIFICATION_FOLLOWED_A_SPEAKER = 3\nNOTIFICATION_SUPPORTED_A_DECLARATION = 4\nNOTIFICATION_TYPES = (\n    (NOTIFICATION_ADDED_DECLARATION_FOR_RESOLUTION, \"added-declaration-for-resolution\"),\n    (NOTIFICATION_ADDED_DECLARATION_FOR_DECLARATION, \"added-declaration-for-declaration\"),\n    (NOTIFICATION_REPORTED_AS_FALLACY, \"reported-as-fallacy\"),\n    (NOTIFICATION_FOLLOWED_A_SPEAKER, \"followed\"),\n    (NOTIFICATION_SUPPORTED_A_DECLARATION, \"supported-a-declaration\"),\n)\ndef get_notification_message(notification_type):\n    for notification_tuple in NOTIFICATION_TYPES:\n        if notification_tuple[0] == notification_type:\n            return notification_tuple[1]\n    return \"Notification type not found\"\n", "entry_point": "get_notification_message", "input": "3", "output": "'followed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86427_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027781", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'https://examp.jpg_150x150'", "output": "'https://examp.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027782", "code": "def shift_token(token):\n    shift_value = len(token)\n    shifted_token = \"\"\n    for char in token:\n        shifted_char = chr(((ord(char) - ord('a') + shift_value) % 26) + ord('a'))\n        shifted_token += shifted_char\n    return shifted_token\n", "entry_point": "shift_token", "input": "'ababcbca'", "output": "'ijijkjki'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47692_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027783", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'example.com:8080', 'game123'", "output": "'ws://example.com:8080/game123/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027784", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9161", "output": "{1, 9161}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027785", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'hhellello'", "output": "{'hhellello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113237_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027786", "code": "def reverse_words(text):\n    words = text.split()  # Split the input text into individual words\n    reversed_words = [word[::-1] for word in words]  # Reverse each word using slicing\n    return ' '.join(reversed_words)  # Join the reversed words back into a single string\n", "entry_point": "reverse_words", "input": "'heo world'", "output": "'oeh dlrow'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145784_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027787", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8545", "output": "{1, 5, 8545, 1709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027788", "code": "def generate_pattern(sequence: str, repetitions: int) -> str:\n    lines = []\n    forward_pattern = sequence\n    reverse_pattern = sequence[::-1]\n    for i in range(repetitions):\n        if i % 2 == 0:\n            lines.append(forward_pattern)\n        else:\n            lines.append(reverse_pattern)\n    return '\\n'.join(lines)\n", "entry_point": "generate_pattern", "input": "'ABAABDDD', 1", "output": "'ABAABDDD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81413_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8821", "output": "{1, 8821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027790", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "' KJotKnK '", "output": "['KJotKnK']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027791", "code": "def extract_terms(glossary, language=None):\n    terms = []\n    if language:\n        if language in glossary:\n            terms.append(glossary[language])\n    else:\n        terms = list(glossary.values())\n    return terms\n", "entry_point": "extract_terms", "input": "{}, language='en'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84316_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027792", "code": "def string_operations(input_string):\n    # Remove leading and trailing whitespace\n    input_string_stripped = input_string.strip()\n    # Extract substrings based on specified criteria\n    substring1 = input_string_stripped[2:6]  # Extract characters from index 2 to 5\n    substring2 = input_string_stripped[:3]   # Extract first 3 characters\n    substring3 = input_string_stripped[-3:]  # Extract last 3 characters\n    substring4 = input_string_stripped[-3]   # Extract character at index -3\n    return (substring1, substring2, substring3, substring4)\n", "entry_point": "string_operations", "input": "' progrg '", "output": "('ogrg', 'pro', 'grg', 'g')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53707_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027793", "code": "def lcm(numbers):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    def lcm_two_numbers(x, y):\n        return x * y // gcd(x, y)\n    result = 1\n    for num in numbers:\n        result = lcm_two_numbers(result, num)\n    return result\n", "entry_point": "lcm", "input": "[16, 25, 9, 19]", "output": "68400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84681_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027794", "code": "def preorder_traversal(root):\n    if not root:\n        return []\n    result = []\n    stack = [root]\n    while stack:\n        node = stack.pop()\n        result.append(node['val'])\n        if 'children' in node:\n            for child in reversed(node['children']):\n                stack.append(child)\n    return result\n", "entry_point": "preorder_traversal", "input": "None", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120361_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027795", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5397", "output": "{1, 257, 3, 771, 7, 1799, 5397, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027796", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[43, 27]", "output": "[27, 43]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027797", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6591", "output": "{1, 3, 39, 169, 13, 2197, 507, 6591}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6590", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4010", "output": "{1, 2, 802, 5, 4010, 10, 401, 2005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4009", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027799", "code": "from typing import List\ndef sum_positive_numbers(lst: List[int]) -> int:\n    sum_positive = 0\n    for num in lst:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_numbers", "input": "[8, 8]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92631_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027800", "code": "def myPow(x, n):\n    if n < 0:\n        x = 1 / x\n        n = -n\n    if n == 0:\n        return 1\n    half = myPow(x, n // 2)\n    if n % 2 == 0:\n        return half * half\n    else:\n        return half * half * x\n", "entry_point": "myPow", "input": "0.7, 1", "output": "0.7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100752_ipt40", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027801", "code": "from collections import deque\ndef find_task_index(N, K, T):\n    ans_dq = deque([0, 0, 0])\n    found = False\n    for i, t in enumerate(T):\n        ans_dq.append(t)\n        ans_dq.popleft()\n        if i >= 2 and sum(ans_dq) < K:\n            return i + 1\n    return -1\n", "entry_point": "find_task_index", "input": "3, 14, [5, 5, 5]", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22074_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027802", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5946", "output": "{1, 2, 3, 6, 5946, 2973, 1982, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5945", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027803", "code": "def calculate_cube_volume(width, height, depth):\n    volume = width * height * depth\n    return volume\n", "entry_point": "calculate_cube_volume", "input": "3, 5, 658", "output": "9870", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20357_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027804", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'07:00:00 AM'", "output": "'07:00:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027805", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'path/to/some/ftxt'", "output": "'path/to/some/ftxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027806", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8995", "output": "{1, 257, 8995, 35, 5, 1285, 7, 1799}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8994", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027807", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "'this is a sample sentence with TThFoxe'", "output": "['TThFoxe']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027808", "code": "from typing import List, Dict, Union\ndef sort_analysis_options(analysis_options: List[Dict[str, Union[int, str]]]) -> List[Dict[str, Union[int, str]]]:\n    analysis_options.sort(key=lambda item: (item.get('priority', 100), item.get('text', '')))\n    return analysis_options\n", "entry_point": "sort_analysis_options", "input": "[{}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56941_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027809", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7933", "output": "{1, 7933}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7932", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027810", "code": "def color_success(input_string):\n    ENDC = '\\033[0m'\n    OKGREEN = '\\033[92m'\n    words = input_string.split()\n    modified_words = []\n    for word in words:\n        if word.lower() == \"success\":\n            modified_words.append(f\"{OKGREEN}{word}{ENDC}\")\n        else:\n            modified_words.append(word)\n    return ' '.join(modified_words)\n", "entry_point": "color_success", "input": "'teamworrkoproject'", "output": "'teamworrkoproject'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92007_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027811", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3446", "output": "{1, 2, 1723, 3446}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3445", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027812", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[0, 2, 2, 5, 2, 3, 5, 9]", "output": "[2, 2, 5, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027813", "code": "BUCKET = \"vcm-ml-experiments\"\nPROJECT = \"microphysics-emulation\"\ndef generate_unique_identifier(input_string):\n    modified_input = input_string.replace(\" \", \"_\")\n    unique_identifier = f\"{PROJECT}-{BUCKET}-{modified_input}-{len(modified_input)}\"\n    return unique_identifier.lower()\n", "entry_point": "generate_unique_identifier", "input": "'dn'", "output": "'microphysics-emulation-vcm-ml-experiments-dn-2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32673_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027814", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "85.0", "output": "0.4722222222222222", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027815", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2416", "output": "{1, 2, 4, 8, 302, 2416, 16, 151, 1208, 604}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2415", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027816", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9474", "output": "{1, 9474, 3, 2, 4737, 6, 1579, 3158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9473", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027817", "code": "def process_sentence(sentence):\n    # Rule 1: Replace \"Python\" with \"programming\"\n    modified_sentence = sentence.replace(\"Python\", \"programming\")\n    # Rule 2: Capitalize the first letter if the sentence starts with a lowercase letter\n    if modified_sentence[0].islower():\n        modified_sentence = modified_sentence[0].upper() + modified_sentence[1:]\n    # Rule 3: Remove the period if the sentence ends with it\n    if modified_sentence.endswith('.'):\n        modified_sentence = modified_sentence[:-1]\n    return modified_sentence\n", "entry_point": "process_sentence", "input": "'i'", "output": "'I'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4557_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027818", "code": "from typing import List\ndef format_friends_list(friends: List[str]) -> str:\n    if len(friends) == 0:\n        return \"\"\n    elif len(friends) == 1:\n        return friends[0]\n    else:\n        formatted_friends = ', '.join(friends[:-1]) + ', and ' + friends[-1]\n        return formatted_friends\n", "entry_point": "format_friends_list", "input": "['Alice', 'Bob', 'Charlie']", "output": "'Alice, Bob, and Charlie'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3512_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2497", "output": "{1, 11, 2497, 227}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027820", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "10, 3", "output": "('7', '12')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027821", "code": "def sum_of_squares_of_even_numbers(nums):\n    sum_of_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108721_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027822", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5077", "output": "{1, 5077}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5076", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027823", "code": "from typing import Tuple\ndef extract_version_components(version: str) -> Tuple[int, int, int]:\n    # Split the version string using the dot as the delimiter\n    version_parts = version.split('.')\n    # Extract major, minor, and patch versions\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2].split('-')[0])  # Remove any additional labels like 'dev'\n    return major, minor, patch\n", "entry_point": "extract_version_components", "input": "'3.7.0'", "output": "(3, 7, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124643_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027824", "code": "def find_smallest_m(n):\n    m = 1\n    while m <= 1000:  # Limiting the search to avoid infinite loop\n        product = n * m\n        if '7' in str(product):\n            return m\n        m += 1\n    return -1\n", "entry_point": "find_smallest_m", "input": "7", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6315_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027825", "code": "def calculate_balances(transactions):\n    balances = {}\n    for transaction in transactions:\n        account = transaction[\"account\"]\n        amount = transaction[\"amount\"]\n        if account in balances:\n            balances[account] += amount\n        else:\n            balances[account] = amount\n    return balances\n", "entry_point": "calculate_balances", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28340_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027826", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9737", "output": "{1, 7, 9737, 107, 13, 749, 1391, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027827", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[2, 3, 9, 10, 26, 26, 27, 27, 38]", "output": "[2, 3, 9, 10, 26, 26, 27, 27, 38]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6503", "output": "{1, 929, 7, 6503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6502", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027829", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'fmoref'", "output": "'<p>fmoref</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027830", "code": "def parse_inventory_data(data: str) -> dict:\n    inventory_dict = {}\n    pairs = data.split(',')\n    for pair in pairs:\n        try:\n            key, value = pair.split(':')\n            key = key.strip()\n            value = value.strip()\n            if value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            elif value.isdigit():\n                value = int(value)\n            inventory_dict[key] = value\n        except (ValueError, AttributeError):\n            # Handle parsing errors by skipping the current pair\n            pass\n    return inventory_dict\n", "entry_point": "parse_inventory_data", "input": "'cage: 30, ig: N'", "output": "{'cage': 30, 'ig': 'N'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83492_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027831", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8111", "output": "{1, 8111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8110", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027832", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average_score = sum(trimmed_scores) / len(trimmed_scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[80, 85, 90, 95, 100, 70, 80, 60, 100]", "output": "85.71428571428571", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145058_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027833", "code": "def sum_of_largest_four(nums):\n    sorted_nums = sorted(nums, reverse=True)\n    return sum(sorted_nums[:4])\n", "entry_point": "sum_of_largest_four", "input": "[10, 10, 9, 8, 1, 1, 1]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104402_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027834", "code": "def cumulative_sum(input_list):\n    output_list = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        output_list.append(running_sum)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[3, 0, 2, 1, 0, 0, 0]", "output": "[3, 3, 5, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88731_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027835", "code": "def weighted_average(numbers, weights):\n    if len(numbers) != len(weights):\n        raise ValueError(\"Input lists must have the same length\")\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    return weighted_sum / total_weight\n", "entry_point": "weighted_average", "input": "[2, 4], [1, 1]", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42724_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027836", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4333", "output": "{1, 619, 4333, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4332", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "139", "output": "{1, 139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt138", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027838", "code": "def cumulative_sum(input_list):\n    cumulative_sum = 0\n    result = []\n    for num in input_list:\n        cumulative_sum += num\n        result.append(cumulative_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[1, -1, 0, -2, 3, 1, -1, -1]", "output": "[1, 0, 0, -2, 1, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134923_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027839", "code": "def insert_into_list(arr, num, position):\n    b = arr[:position] + [num] + arr[position:]\n    return b\n", "entry_point": "insert_into_list", "input": "[3, 4, 3, 6, 1, 4, 4, 4, 3], 4, 5", "output": "[3, 4, 3, 6, 1, 4, 4, 4, 4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30277_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027840", "code": "def process_job_names(on_queue: str) -> dict:\n    job_names = on_queue.splitlines()\n    unique_job_names = set()\n    longest_job_name = ''\n    for job_name in job_names:\n        unique_job_names.add(job_name.strip())\n        if len(job_name) > len(longest_job_name):\n            longest_job_name = job_name.strip()\n    return {'unique_count': len(unique_job_names), 'longest_job_name': longest_job_name}\n", "entry_point": "process_job_names", "input": "'job1j\\n'", "output": "{'unique_count': 1, 'longest_job_name': 'job1j'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132971_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027841", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 2, 3, 3, -1, 4, 2]", "output": "[3, 5, 6, 2, 3, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73916_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027842", "code": "def thousandSeparator(n: int) -> str:\n    num = str(n)\n    result = []\n    while len(num) > 3:\n        result.append(num[-3:])\n        num = num[:-3]\n    if len(num) > 0:\n        result.append(num)\n    return '.'.join(result[::-1])\n", "entry_point": "thousandSeparator", "input": "1234564", "output": "'1.234.564'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138088_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027843", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[5, 6, 7, 4, 3, 4, 2], 99, 5", "output": "[99, 99, 99, 4, 3, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027844", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[3, 5, 1, 6, 7, 2, 9]", "output": "[1, 2, 3, 5, 6, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027845", "code": "def next_element(some_list, current_index):\n    if not some_list:\n        return ''\n    next_index = (current_index + 1) % len(some_list)\n    return some_list[next_index]\n", "entry_point": "next_element", "input": "['apple', 'banana', 'orange'], 2", "output": "'apple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54712_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027846", "code": "def generate_sequence(a, b, n):\n    output = \"\"\n    for num in range(1, n + 1):\n        if num % a == 0 and num % b == 0:\n            output += \"FB \"\n        elif num % a == 0:\n            output += \"F \"\n        elif num % b == 0:\n            output += \"B \"\n        else:\n            output += str(num) + \" \"\n    return output.rstrip()\n", "entry_point": "generate_sequence", "input": "3, 5, 8", "output": "'1 2 F 4 B F 7 8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30858_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027847", "code": "from typing import List\ndef circular_sum(input_list: List[int]) -> List[int]:\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "circular_sum", "input": "[1, 4, 3, 5, 3, 3]", "output": "[5, 7, 8, 8, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123146_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027848", "code": "def sum_divisible_numbers(start, end, divisor):\n    sum_divisible = 0\n    for num in range(start, end + 1):\n        if num % divisor == 0:\n            sum_divisible += num\n    return sum_divisible\n", "entry_point": "sum_divisible_numbers", "input": "10, 25, 5", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31930_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027849", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "394", "output": "{1, 394, 2, 197}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt393", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027850", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[4, 0, 2, 0, 4, 0, 1]", "output": "'aaaabbccccd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027851", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "67, 0", "output": "67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027852", "code": "from typing import List\ndef calculate_sum_and_max_odd(numbers: List[int]) -> int:\n    even_sum = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return even_sum * max_odd\n", "entry_point": "calculate_sum_and_max_odd", "input": "[2, 4, 21]", "output": "126", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2830_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027853", "code": "from collections import Counter\ndef reconstruct_string(freq_list):\n    char_freq = [(chr(ord('a') + i), freq) for i, freq in enumerate(freq_list) if freq > 0]\n    char_freq.sort(key=lambda x: x[1])\n    reconstructed_string = \"\"\n    for char, freq in char_freq:\n        reconstructed_string += char * freq\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[2, 2, 6, 0, 0, 0, 4, 5] + [0] * 18", "output": "'aabbgggghhhhhcccccc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27067_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027854", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3309", "output": "{1, 3, 3309, 1103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3308", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027855", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1613", "output": "{1, 1613}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1612", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "27", "output": "{3, 1, 27, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt26", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027857", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "''", "output": "'\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027858", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'Asvph!', 1", "output": "'Btwqi!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027859", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'854313123'", "output": "'85431312302485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027860", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4023", "output": "{1, 3, 9, 149, 4023, 27, 1341, 447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027861", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5797", "output": "{1, 5797, 11, 527, 17, 341, 187, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027862", "code": "def find_longest_message(messages):\n    longest_message = \"\"\n    for message in messages:\n        if len(message) > len(longest_message):\n            longest_message = message\n    return longest_message\n", "entry_point": "find_longest_message", "input": "['hello', 'msg', 'abc', 'messageyloe']", "output": "'messageyloe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149378_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027863", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8361", "output": "{1, 929, 3, 2787, 8361, 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027864", "code": "import re\nSTART_TEXT = \"\"\"\n {},\n     I\u2019m **[ImgBB](telegram.me/xImgBBbot)**. I can upload images on **ImgBB.com** & generate shareable link for it! \n do press **Help** for more information about the process.\n\"\"\"\ndef clean_text(text):\n    # Remove Markdown formatting\n    text = re.sub(r'\\*\\*(.*?)\\*\\*', r'\\1', text)  # Remove bold formatting\n    text = re.sub(r'\\[(.*?)\\]\\((.*?)\\)', r'\\1', text)  # Remove link formatting\n    # Remove extra spaces\n    text = ' '.join(text.split())\n    return text\n", "entry_point": "clean_text", "input": "'[&&](http://example.com)'", "output": "'&&'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39680_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027865", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[4, 2, 6, 2, 3, 6]", "output": "[6, 8, 8, 5, 9, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99008_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027866", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = \"\"\n    for i in range(0, len(freq_list), 2):\n        char = chr(ord('a') + i // 2)  # Calculate the character based on ASCII value\n        frequency = freq_list[i]\n        reconstructed_string += char * frequency\n    return reconstructed_string\n", "entry_point": "reconstruct_string", "input": "[3, 0, 2, 0, 1]", "output": "'aaabbc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67404_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027867", "code": "def find_mismatched_elements(input_list):\n    mismatched_elements = [(index, value) for index, value in enumerate(input_list) if index != value]\n    return mismatched_elements\n", "entry_point": "find_mismatched_elements", "input": "[7, 1]", "output": "[(0, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128835_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027868", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "4", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027869", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'tca', 'g5s'", "output": "'tca/g5s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027870", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'game_rotation_vector'", "output": "'Value of game_rotation_vector'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027871", "code": "def maximize_score(deck):\n    take = skip = 0\n    for card in deck:\n        new_take = skip + card\n        new_skip = max(take, skip)\n        take, skip = new_take, new_skip\n    return max(take, skip)\n", "entry_point": "maximize_score", "input": "[11]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91144_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027872", "code": "import math\nfrom typing import List\ndef calculate_total_quantity(items: List[int]) -> int:\n    total_quantity = 0\n    for item in items:\n        rounded_quantity = math.floor(math.sqrt(item))\n        total_quantity += rounded_quantity\n    return total_quantity\n", "entry_point": "calculate_total_quantity", "input": "[9, 9, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84239_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027873", "code": "def assign_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        else:\n            grades.append('C')\n    return grades\n", "entry_point": "assign_grades", "input": "[75, 85, 85, 85, 85, 85, 85, 85]", "output": "['C', 'B', 'B', 'B', 'B', 'B', 'B', 'B']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4885_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027874", "code": "def calculate_skyline_area(buildings):\n    total_area = 0\n    prev_height = 0\n    for height in buildings:\n        if height > prev_height:\n            total_area += height\n        else:\n            total_area += prev_height\n        prev_height = height\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[4, 4, 4, 4, 4, 4]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147834_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027875", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "454, {}", "output": "'454-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027876", "code": "import re\ndef convert_time_when_param(value: str, splitter: str = ',') -> dict:\n    parts = value.split(splitter, 1)\n    event = parts[0].strip()\n    time_match = re.search(r'\\b\\d{2}:\\d{2}:\\d{2}\\b', value)\n    time = time_match.group() if time_match else '00:00:00'\n    return {'when': event, 'hour': time}\n", "entry_point": "convert_time_when_param", "input": "'0:a'", "output": "{'when': '0:a', 'hour': '00:00:00'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39129_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7691", "output": "{1, 7691}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7690", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8758", "output": "{1, 2, 302, 8758, 151, 58, 4379, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027879", "code": "def calculate_chunk_range(selection, chunks):\n    chunk_range = []\n    for s, l in zip(selection, chunks):\n        if isinstance(s, slice):\n            start_chunk = s.start // l\n            end_chunk = (s.stop - 1) // l\n            chunk_range.append(list(range(start_chunk, end_chunk + 1)))\n        else:\n            chunk_range.append([s // l])\n    return chunk_range\n", "entry_point": "calculate_chunk_range", "input": "[4, slice(4, 8)], [2, 2]", "output": "[[2], [2, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128291_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027880", "code": "def is_spy_number(n):\n    str_num = str(n)\n    sum_of_digits = 0\n    product_of_digits = 1\n    for digit in str_num:\n        digit_int = int(digit)\n        sum_of_digits += digit_int\n        product_of_digits *= digit_int\n    if sum_of_digits == product_of_digits:\n        return True\n    else:\n        return False\n", "entry_point": "is_spy_number", "input": "1", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105904_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027881", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[42, 42, 42, 42, 43]", "output": "42.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6866", "output": "{1, 6866, 2, 3433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027883", "code": "def extract_file_extension(file_path):\n    # Find the index of the last period '.' character in the file path\n    last_dot_index = file_path.rfind('.')\n    # Check if a period '.' was found and it is not the last character in the string\n    if last_dot_index != -1 and last_dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character immediately after the last period\n        file_extension = file_path[last_dot_index + 1:]\n        return file_extension\n    else:\n        # If no extension found or the period is the last character, return None\n        return None\n", "entry_point": "extract_file_extension", "input": "'/some/path/to/file.ff'", "output": "'ff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51602_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3647", "output": "{1, 7, 521, 3647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3646", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027885", "code": "def binary_to_decimal(binary_str):\n    decimal = 0\n    for i in range(len(binary_str) - 1, -1, -1):\n        if binary_str[i] == '1':\n            decimal += 2**(len(binary_str) - 1 - i)\n    return decimal\n", "entry_point": "binary_to_decimal", "input": "'1011100'", "output": "92", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55222_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027886", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[9, 9, 9, 7, 3, 3, 1]", "output": "[81, 81, 81, 49, 9, 9, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027887", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9098", "output": "{1, 9098, 2, 4549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027888", "code": "from typing import List\ndef merge_sorted_lists(nums1: List[int], nums2: List[int]) -> List[int]:\n    merged = []\n    i, j = 0, 0\n    while i < len(nums1) and j < len(nums2):\n        if nums1[i] < nums2[j]:\n            merged.append(nums1[i])\n            i += 1\n        else:\n            merged.append(nums2[j])\n            j += 1\n    merged.extend(nums1[i:])\n    merged.extend(nums2[j:])\n    return merged\n", "entry_point": "merge_sorted_lists", "input": "[1, 2, 2, 2], [2, 2, 3, 3, 4, 4, 5]", "output": "[1, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142881_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027889", "code": "def weighted_average(numbers, weights):\n    if len(numbers) != len(weights):\n        return \"Error: Number of elements in 'numbers' and 'weights' lists must be equal.\"\n    weighted_sum = sum(num * weight for num, weight in zip(numbers, weights))\n    total_weight = sum(weights)\n    if total_weight == 0:\n        return \"Error: Total weight cannot be zero.\"\n    return weighted_sum / total_weight\n", "entry_point": "weighted_average", "input": "[4.0, 4.2, 4.4], [1, 1, 1]", "output": "4.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_524_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027890", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "865", "output": "{1, 5, 865, 173}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt864", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027891", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'11100XX'", "output": "['1110000', '1110001', '1110010', '1110011']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt45", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027892", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[5, 8, 1, 4], 2", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027893", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2515", "output": "{1, 2515, 5, 503}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2514", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027894", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 10, 24, 15]", "output": "44", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027895", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "512315251", "output": "'VCode-512315251'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027896", "code": "def nested_sum(nested_data):\n    total_sum = 0\n    for element in nested_data:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, (list, tuple)):\n            total_sum += nested_sum(element)\n    return total_sum\n", "entry_point": "nested_sum", "input": "[10, [5, [15]], 19]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13704_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027897", "code": "from typing import List\ndef regular_programming_duration(test_cases: List[str]) -> List[int]:\n    results = []\n    for test_case in test_cases:\n        total_duration = 0\n        consecutive_ones = 0\n        for i, char in enumerate(test_case):\n            if char == '1':\n                consecutive_ones += 1\n            if char == '0' or i == len(test_case) - 1:\n                total_duration += consecutive_ones\n                consecutive_ones = 0\n        results.append(total_duration)\n    return results\n", "entry_point": "regular_programming_duration", "input": "['11110', '1110', '110']", "output": "[4, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123797_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027898", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 68, 30]", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027899", "code": "def calculate_result(model_type, value):\n    dismodfun = {\n        'RDD': 'RDD',\n        'RRDD-E': 'RRDD',\n        'RRDD-R': 'RRDD',\n    }\n    if model_type in dismodfun:\n        if model_type == 'RDD':\n            return value ** 2\n        elif model_type == 'RRDD-E':\n            return value * 2\n        elif model_type == 'RRDD-R':\n            return value ** 3\n    else:\n        return 'Invalid model type'\n", "entry_point": "calculate_result", "input": "'RRDD-E', 5.0", "output": "10.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83607_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027900", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4627", "output": "{1, 4627, 661, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4626", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027901", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8095", "output": "{1, 1619, 5, 8095}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027902", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4567", "output": "{1, 4567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027903", "code": "def process_numbers(numbers):\n    sum_even = 0\n    max_odd = 0\n    for num in numbers:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    result = sum_even * max_odd if max_odd != 0 else 0\n    return result\n", "entry_point": "process_numbers", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110971_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027904", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'thittttts'", "output": "'thittttts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027905", "code": "def process_copy_commands(copy_commands):\n    copy_mapping = {}\n    for command in copy_commands:\n        parts = command.split()\n        source_file = parts[1]\n        destination_dir = parts[2]\n        if destination_dir not in copy_mapping:\n            copy_mapping[destination_dir] = [source_file]\n        else:\n            copy_mapping[destination_dir].append(source_file)\n    return copy_mapping\n", "entry_point": "process_copy_commands", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144745_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027906", "code": "from typing import List\ndef fibonacci_sequence(n: int) -> List[int]:\n    if n == 0:\n        return [0]\n    elif n == 1:\n        return [0, 1]\n    fib_sequence = [0, 1]\n    a, b = 0, 1\n    for _ in range(2, n):\n        next_fib = a + b\n        fib_sequence.append(next_fib)\n        a, b = b, next_fib\n    return fib_sequence\n", "entry_point": "fibonacci_sequence", "input": "10", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71217_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027907", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[9, 9]", "output": "[9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027908", "code": "def process_info(input_string):\n    char_count = {}\n    for char in input_string:\n        if char in char_count:\n            char_count[char] += 1\n        else:\n            char_count[char] = 1\n    return char_count\n", "entry_point": "process_info", "input": "'wwww'", "output": "{'w': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28397_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027909", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6761", "output": "{1, 6761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027910", "code": "import binascii\nfrom typing import Union\ndef scrub_input(hex_str_or_bytes: Union[str, bytes]) -> bytes:\n    if isinstance(hex_str_or_bytes, str):\n        hex_str_or_bytes = binascii.unhexlify(hex_str_or_bytes)\n    return hex_str_or_bytes\n", "entry_point": "scrub_input", "input": "'456c6c6f2f576f726c64'", "output": "b'Ello/World'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49478_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027911", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "6, 7", "output": "279936", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt41", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027912", "code": "def extract_publication_titles(json_data, keyword):\n    titles = []\n    publications = json_data.get(\"publications\", [])\n    for publication in publications:\n        if keyword in publication.get(\"tags\", []):\n            titles.append(publication[\"title\"])\n    return titles\n", "entry_point": "extract_publication_titles", "input": "{}, 'example_keyword'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117677_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027913", "code": "def process_list(lst, threshold):\n    processed_list = []\n    for num in lst:\n        if num >= threshold:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_list", "input": "[2, 10, 6, 4, 2, 2, 6, 2, 6], 3", "output": "[8, 100, 36, 16, 8, 8, 36, 8, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88444_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027914", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8444", "output": "{1, 2, 4, 8444, 4222, 2111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8443", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027915", "code": "def get_next_version(registry, image, version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "get_next_version", "input": "None, None, '1.0.9'", "output": "'1.1.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53860_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027916", "code": "def calculate_cumulative_sum(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "calculate_cumulative_sum", "input": "[5, 4, 4, 2, 2, 4, 1, 4]", "output": "[5, 9, 13, 15, 17, 21, 22, 26]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126098_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027917", "code": "def calculate_average(data):\n    total_noisy_add = sum(sample[0] for sample in data)\n    total_std_add = sum(sample[1] for sample in data)\n    average_noisy_add = total_noisy_add / len(data)\n    average_std_add = total_std_add / len(data)\n    return (average_noisy_add, average_std_add)\n", "entry_point": "calculate_average", "input": "[(3.0, 7.0), (3.0, 7.0), (3.0, 7.0)]", "output": "(3.0, 7.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73285_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027918", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8854", "output": "{1, 2, 38, 233, 4427, 466, 19, 8854}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8853", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027919", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3007", "output": "{1, 31, 97, 3007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027920", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "98, 13, 3", "output": "(107.4178, 12.74, 3.3221999999999996)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027921", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[5, 9, 5, 2, 9, 9, 2]", "output": "[125, 729, 125, 4, 729, 729, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027922", "code": "def process_preprocessor(preprocessor):\n    if isinstance(preprocessor, str):\n        preprocessor_name, preprocessor_options = preprocessor, {}\n    elif isinstance(preprocessor, dict):\n        (preprocessor_name, preprocessor_options), = (*preprocessor.items(),)\n    return preprocessor_name, preprocessor_options\n", "entry_point": "process_preprocessor", "input": "{'value2': {}}", "output": "('value2', {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96208_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027923", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1001110X'", "output": "['10011100', '10011101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027924", "code": "import re\nimport pathlib\ndef count_words_in_readme(readme_content, version_number):\n    words = re.findall(r'\\w+', readme_content)\n    word_count = len(words)\n    result = {version_number: word_count}\n    return result\n", "entry_point": "count_words_in_readme", "input": "'test', '1.001.0'", "output": "{'1.001.0': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147949_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027925", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "5, -1", "output": "0.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027926", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5961", "output": "{5961, 1, 3, 1987}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027927", "code": "def canonicalize_smiles(smiles):\n    # Implement the canonicalization process for the given SMILES string\n    # Add your code here to generate the canonicalized version of the input SMILES\n    # Placeholder return statement\n    return smiles  # Placeholder, replace with actual canonicalization logic\n", "entry_point": "canonicalize_smiles", "input": "'CC(=O)OC=CC(=O'", "output": "'CC(=O)OC=CC(=O'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38970_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027928", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{0: 3, 1: 1, 3: 1, 4: 1}", "output": "[0, 0, 0, 1, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027929", "code": "def count_occurrences(input_data):\n    occurrences = {}\n    for line in input_data:\n        xID, jobID, sOccur, timestamp = line.split('\\t')\n        occurrences[sOccur] = occurrences.get(sOccur, 0) + 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "['1\\t101\\tE\\t2023-01-01 00:00:00']", "output": "{'E': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124808_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027930", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "514", "output": "{1, 514, 2, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt513", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027931", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'Sample'", "output": "{'sample': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027932", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[1, 3, 5, 9], 3", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027933", "code": "def divisible_count(x, y, k):\n    count_y = (k * (y // k + 1) - 1) // k\n    count_x = (k * ((x - 1) // k + 1) - 1) // k\n    return count_y - count_x\n", "entry_point": "divisible_count", "input": "10, 25, 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144622_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027934", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'snake_case_example'", "output": "'snakeCaseExample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027935", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'Saamapei'", "output": "'\u30b5\u30f3aamapei'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027936", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[6, 5, 0, 2, 1, 1, 4, -1, 7]", "output": "[6, 1, 5, 1, 0, 4, 2, -1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027937", "code": "def password_strength_checker(password):\n    score = 0\n    # Check length of the password\n    score += len(password)\n    # Check for uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for special characters\n    special_characters = set('!@#$%^&*()_+-=[]{}|;:,.<>?')\n    if any(char in special_characters for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'abcdefghij'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26515_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027938", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2737", "output": "{1, 161, 391, 7, 2737, 17, 119, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027939", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[2, 2, 5, 5, 1, 6, 6]", "output": "[2, 5, 1, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027940", "code": "def snakelize(input_string):\n    # Replace spaces with underscores and convert to lowercase\n    snake_case_string = input_string.replace(\" \", \"_\").lower()\n    return snake_case_string\n", "entry_point": "snakelize", "input": "'convert'", "output": "'convert'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38688_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027941", "code": "def sum_numeric_elements(matrix):\n    total_sum = 0\n    for element in matrix:\n        if isinstance(element, (int, float)):\n            total_sum += element\n        elif isinstance(element, list):\n            total_sum += sum_numeric_elements(element)\n    return total_sum\n", "entry_point": "sum_numeric_elements", "input": "[[10, 20], 28]", "output": "58", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22497_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7818", "output": "{1, 2, 3, 3909, 6, 7818, 2606, 1303}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027943", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1784", "output": "{1, 2, 4, 8, 1784, 892, 446, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1783", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027944", "code": "def identify_unique_individuals(actions):\n    unique_individuals = set()\n    for action in actions:\n        words = action.split()\n        for word in words:\n            if word.istitle():  # Check if the word is capitalized (assumed to be a name)\n                unique_individuals.add(word)\n    return list(unique_individuals)\n", "entry_point": "identify_unique_individuals", "input": "['Omolewas went to the market.']", "output": "['Omolewas']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25231_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2531", "output": "{1, 2531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027946", "code": "def reverse_words_in_string(s: str) -> str:\n    result = \"\"\n    word = \"\"\n    for char in s:\n        if char != ' ':\n            word = char + word\n        else:\n            result += word + ' '\n            word = \"\"\n    result += word  # Append the last word without a space\n    return result\n", "entry_point": "reverse_words_in_string", "input": "'hello'", "output": "'olleh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88814_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027947", "code": "def find_audio_peaks(audio_data):\n    peaks = []\n    peak = []\n    for i in range(1, len(audio_data) - 1):\n        if audio_data[i] > audio_data[i - 1] and audio_data[i] > audio_data[i + 1]:\n            peak.append(audio_data[i])\n        elif peak:\n            peaks.append(peak)\n            peak = []\n    if peak:\n        peaks.append(peak)\n    return peaks\n", "entry_point": "find_audio_peaks", "input": "[0, 1, 3, 2, 4, 5, 3, 6, 7, 5]", "output": "[[3], [5], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81469_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027948", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "11", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027949", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[6, 3, 0, 5, 3, 4]", "output": "[9, 3, 5, 8, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027950", "code": "def num_trees(n):\n    def _num_trees(A, dp={}):\n        if A == 1:\n            return 1\n        if A not in dp:\n            s = 0\n            for i in range(1, A):\n                s += _num_trees(i) * _num_trees(A - i)\n            dp[A] = s\n        return dp[A]\n    return _num_trees(n + 1)\n", "entry_point": "num_trees", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74700_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027951", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1433", "output": "{1, 1433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1432", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027952", "code": "from typing import List\ndef concatenate_valid_streams(validstreams: List[str], delimiter: str) -> str:\n    valid_streams = [stream for stream in validstreams if stream]\n    return delimiter.join(valid_streams)\n", "entry_point": "concatenate_valid_streams", "input": "['stream1', 'stream2', 'stream3'], '-'", "output": "'stream1-stream2-stream3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2553_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2186", "output": "{1, 2186, 2, 1093}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027954", "code": "def count_video_extensions(filenames):\n    video_extensions = {'.3g2', '.3gp', '.3gp2', '.3gpp', '.60d', '.ajp', '.asf', '.asx', '.avchd', '.avi', '.bik',\n                        '.bix', '.box', '.cam', '.dat', '.divx', '.dmf', '.dv', '.dvr-ms', '.evo', '.flc', '.fli',\n                        '.flic', '.flv', '.flx', '.gvi', '.gvp', '.h264', '.m1v', '.m2p', '.m2ts', '.m2v', '.m4e',\n                        '.m4v', '.mjp', '.mjpeg', '.mjpg', '.mkv', '.moov', '.mov', '.movhd', '.movie', '.movx', '.mp4',\n                        '.mpe', '.mpeg', '.mpg', '.mpv', '.mpv2', '.mxf', '.nsv', '.nut', '.ogg', '.ogm', '.ogv', '.omf',\n                        '.ps', '.qt', '.ram', '.rm', '.rmvb', '.swf', '.ts', '.vfw', '.vid', '.video', '.viv', '.vivo',\n                        '.vob', '.vro', '.wm', '.wmv', '.wmx', '.wrap', '.wvx', '.wx', '.x264', '.xvid'}\n    video_extension_count = {}\n    for filename in filenames:\n        _, extension = filename.rsplit('.', 1)\n        extension = '.' + extension.lower()\n        if extension in video_extensions:\n            video_extension_count[extension[1:]] = video_extension_count.get(extension[1:], 0) + 1\n    return video_extension_count\n", "entry_point": "count_video_extensions", "input": "['file1.txt', 'document.doc', 'image.jpg']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9068_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027955", "code": "from typing import List\ndef sum_of_powers(numbers: List[int], power: int) -> int:\n    result = 0\n    for num in numbers:\n        result += num ** power\n    return result\n", "entry_point": "sum_of_powers", "input": "[2], 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38539_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027956", "code": "def calculate_interpolatability(list1, list2):\n    abs_diff_sum = 0\n    list1_sum = sum(list1)\n    for i in range(len(list1)):\n        abs_diff_sum += abs(list1[i] - list2[i])\n    interpolatability_score = abs_diff_sum / list1_sum\n    return round(interpolatability_score, 2)\n", "entry_point": "calculate_interpolatability", "input": "[10, 10], [8, 12]", "output": "0.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140481_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027957", "code": "def calculate_dot_product(vector1, vector2):\n    dot_product = 0\n    for elem1, elem2 in zip(vector1, vector2):\n        dot_product += elem1 * elem2\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 2, 3, 4], [4, 5, 3, 2]", "output": "31", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134459_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027958", "code": "def calculate_temporal_window(temporal_dilation, temporal_numseq):\n    temporal_window = temporal_dilation * (temporal_numseq - 1) + 1\n    return temporal_window\n", "entry_point": "calculate_temporal_window", "input": "8, 10", "output": "73", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131732_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027959", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'DWO', 'JOH', 2027", "output": "'DWOJOH2027'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2422", "output": "{1, 2, 7, 173, 14, 2422, 346, 1211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2421", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027961", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3727", "output": "{1, 3727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027962", "code": "from typing import List\nimport functools\ndef maximumScore1(nums: List[int], mult: List[int]) -> int:\n    @functools.lru_cache(maxsize=2000)\n    def dp(left, i):\n        if i >= len(mult):\n            return 0\n        right = len(nums) - 1 - (i - left)\n        return max(mult[i] * nums[left] + dp(left+1, i+1), mult[i] * nums[right] + dp(left, i+1))\n    return dp(0, 0)\n", "entry_point": "maximumScore1", "input": "[1, 2, 3], [3]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146067_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027963", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No meaningful average if less than 3 scores\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 85, 85, 86, 90]", "output": "85.33333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57154_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027964", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[12, 12, 7, 7, 7, 12, 7, 8]", "output": "[12, 13, 9, 10, 11, 17, 13, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027965", "code": "def modify_list(lst):\n    modified_list = []\n    for num in lst:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value for even numbers\n        else:\n            modified_list.append(num * 3)  # Triple the value for odd numbers\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 3, 2, -1, 3, 3]", "output": "[3, 9, 4, -3, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16833_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027966", "code": "def get_device_name(device_id: int) -> str:\n    device_map = {\n        3: \"FAN\",\n        4: \"GARAGE_DOOR_OPENER\",\n        5: \"LIGHTING\",\n        6: \"LOCK\",\n        7: \"OUTLET\",\n        8: \"SWITCH\",\n        9: \"THERMOSTAT\",\n        10: \"SENSOR\",\n        11: \"SECURITY_SYSTEM\",\n        12: \"DOOR\",\n        13: \"WINDOW\",\n        14: \"WINDOW_COVERING\",\n        15: \"PROGRAMMABLE_SWITCH\",\n        16: \"RESERVED\",\n        17: \"IP_CAMERA\"\n    }\n    return device_map.get(device_id, \"Unknown Device\")\n", "entry_point": "get_device_name", "input": "16", "output": "'RESERVED'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127698_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027967", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'whellowlowolo'", "output": "['whellowlowolo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027968", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1030", "output": "{1, 2, 515, 5, 1030, 103, 10, 206}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1029", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027969", "code": "def extract_module_and_class(input_string):\n    last_dot_index = input_string.rfind('.')\n    if last_dot_index != -1:\n        module_name = input_string[:last_dot_index]\n        class_name = input_string[last_dot_index + 1:]\n        return module_name, class_name\n    else:\n        return None, None\n", "entry_point": "extract_module_and_class", "input": "'rdmo.optionptofig'", "output": "('rdmo', 'optionptofig')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84856_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9929", "output": "{1, 9929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027971", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "59", "output": "{1, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt58", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027972", "code": "def maximumWealth(accounts: list[list[int]]) -> int:\n    max_wealth = 0\n    for customer_accounts in accounts:\n        wealth = sum(customer_accounts)\n        max_wealth = max(max_wealth, wealth)\n    return max_wealth\n", "entry_point": "maximumWealth", "input": "[[1, 2, 3], [4, 0], [2]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95130_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027973", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "500", "output": "{1, 2, 4, 5, 100, 10, 50, 500, 20, 25, 250, 125}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt499", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027974", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[5, 10, 15]", "output": "[15, 25, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027975", "code": "def product(*args):\n    result = 1\n    for n in args:\n        result *= n\n    return result\n", "entry_point": "product", "input": "5, 5, 5, 5", "output": "625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97974_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027976", "code": "def find_non_dup(A=[]):\n    if len(A) == 0:\n        return None\n    non_dup = [x for x in A if A.count(x) == 1]\n    return non_dup[-1]\n", "entry_point": "find_non_dup", "input": "[1, 2, 1, 3, 4, 4, 5, 6, 7]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57269_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027977", "code": "def solve(num_stairs, points):\n    dp = [0] * (num_stairs + 1)\n    dp[1] = points[1]\n    for i in range(2, num_stairs + 1):\n        dp[i] = max(points[i] + dp[i - 1], dp[i - 2] + points[i])\n    return dp[num_stairs]\n", "entry_point": "solve", "input": "3, [0, 5, 6, 5]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147689_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027978", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9559", "output": "{1, 869, 11, 79, 9559, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027979", "code": "import re\nLOREM_IPSUM = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis\nunde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab\nillo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia\nvoluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi\nnesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non\nnumquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,\nquis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem\nvel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum\nfugiat quo voluptas nulla pariatur?\n\"\"\"\ndef count_word_occurrences(input_string):\n    cleaned_lorem_ipsum = re.sub(r'[^\\w\\s]', '', LOREM_IPSUM.lower())\n    lorem_words = cleaned_lorem_ipsum.split()\n    word_frequencies = {}\n    input_words = input_string.lower().split()\n    for word in input_words:\n        word_frequencies[word] = lorem_words.count(word)\n    return word_frequencies\n", "entry_point": "count_word_occurrences", "input": "'aamet'", "output": "{'aamet': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88081_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027980", "code": "def normalize_semver_version(version):\n    \"\"\"\n    Normalize a non-valid semver version string to a valid semver version string by adding '.0' if needed.\n    :param version: Input version string to be normalized\n    :type version: str\n    :return: Normalized semver version string\n    :rtype: str\n    \"\"\"\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version\n", "entry_point": "normalize_semver_version", "input": "'00.22'", "output": "'00.22.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_922_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027981", "code": "def calculate_sum_as_float(numbers):\n    # Calculate the sum of the integers in the input list\n    sum_of_numbers = sum(numbers)\n    # Convert the sum to a floating-point number\n    sum_as_float = float(sum_of_numbers)\n    return sum_as_float\n", "entry_point": "calculate_sum_as_float", "input": "[136]", "output": "136.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10655_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027982", "code": "def calculate_d_modulo(n):\n    d = [0] * (n + 1)\n    d[1] = 1\n    d[2] = 3\n    for i in range(3, n + 1):\n        d[i] = (d[i - 1] % 10007 + (d[i - 2] * 2) % 10007) % 10007\n    return d[n]\n", "entry_point": "calculate_d_modulo", "input": "7", "output": "85", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29490_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027983", "code": "from typing import List\ndef format_products(product_list: List[str]) -> List[str]:\n    formatted_list = []\n    for product_str in product_list:\n        tokens = product_str.split()\n        formatted_product = \"B-\" + tokens[0].split(\"-\")[1]  # Extracting the product type\n        formatted_list.append(formatted_product)\n    return formatted_list\n", "entry_point": "format_products", "input": "['alpha-product', 'beta-product']", "output": "['B-product', 'B-product']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49093_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027984", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'jover umps', 5", "output": "('jover', 'umps')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027985", "code": "def migrate_list(input_list, target):\n    non_target_elements = [num for num in input_list if num != target]\n    target_elements = [num for num in input_list if num == target]\n    return non_target_elements + target_elements\n", "entry_point": "migrate_list", "input": "[1, 1, 3, 3, 4, 4, 4, 4, 4], 4", "output": "[1, 1, 3, 3, 4, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5989_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027986", "code": "def resample_time_series(data, season):\n    def seasons_resampler(months):\n        return [data[i] for i in range(len(data)) if i % 12 in months]\n    if season == \"winter\":\n        return seasons_resampler([11, 0, 1])  # December, January, February\n    elif season == \"spring\":\n        return seasons_resampler([2, 3, 4])  # March, April, May\n    elif season == \"summer\":\n        return seasons_resampler([5, 6, 7])  # June, July, August\n    elif season == \"autumn\":\n        return seasons_resampler([8, 9, 10])  # September, October, November\n    elif season == \"custom\":\n        # Implement custom resampling logic here\n        return None\n    elif season == \"yearly\":\n        return [sum(data[i:i+12]) for i in range(0, len(data), 12)]  # Resample to yearly values\n    else:\n        return \"Invalid season specified\"\n", "entry_point": "resample_time_series", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'spring'", "output": "[3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58046_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027987", "code": "def count_sets_in_range(lower_bound, upper_bound):\n    sets_values = {\n        'PBIC_AC2DC': 4,\n        'PBIC_DC2AC': 5,\n        'PESS_C': 6,\n        'PESS_DC': 7,\n        'RESS': 8,\n        'EESS': 9,\n        'PMG': 10,\n        'PPV': 11,\n        'PWP': 12,\n        'PL_AC': 13,\n        'PL_UAC': 14,\n        'PL_DC': 15,\n        'PL_UDC': 16,\n        'NX': 17\n    }\n    count = 0\n    for set_name, value in sets_values.items():\n        if lower_bound <= value <= upper_bound:\n            count += 1\n    return count\n", "entry_point": "count_sets_in_range", "input": "4, 7", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111795_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027988", "code": "def bubble_sort_descending(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr[j] < arr[j+1]:\n                arr[j], arr[j+1] = arr[j+1], arr[j]\n    return arr\n", "entry_point": "bubble_sort_descending", "input": "[5, 9, 4, 10, 1, -1, 4, 9, 7]", "output": "[10, 9, 9, 7, 5, 4, 4, 1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123916_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027989", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'1:30:45'", "output": "5445", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027990", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6835", "output": "{1, 6835, 5, 1367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027991", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[100, 1, 1, 1]", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027992", "code": "from typing import List\ndef last_successful_step(steps: List[int]) -> int:\n    last_successful = 0\n    for step in steps:\n        if step > last_successful + 1:\n            return last_successful\n        last_successful = step\n    return steps[-1]\n", "entry_point": "last_successful_step", "input": "[0, 1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132617_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027993", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1564", "output": "{1, 2, 34, 4, 68, 391, 782, 92, 46, 17, 23, 1564}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1563", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027994", "code": "def solve(s):\n    assert 0 < len(s) < 1000\n    a_string = s.split(' ')\n    s = ' '.join((word.capitalize() for word in a_string))\n    return s\n", "entry_point": "solve", "input": "'t'", "output": "'T'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104273_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027995", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7959", "output": "{1, 3, 7, 1137, 21, 7959, 379, 2653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027996", "code": "import re\ndef split_languages(input_string):\n    language_list = re.split(',', input_string)\n    cleaned_list = [language.strip() for language in language_list]\n    return cleaned_list\n", "entry_point": "split_languages", "input": "'KiotllinPyiin'", "output": "['KiotllinPyiin']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61519_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027997", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[4, 1, 4, 3, 4, 5, 3, 5, 4]", "output": "[4, 2, 6, 6, 8, 10, 9, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027998", "code": "import re\ndef remove_credit_cards(text: str) -> str:\n    pattern = r'\\b(?:\\d{4}[-\\s]?){3}\\d{4}\\b'\n    masked_text = re.sub(pattern, 'XXXX-XXXX-XXXX-XXXX', text)\n    return masked_text\n", "entry_point": "remove_credit_cards", "input": "'car1234-5678-2-3d'", "output": "'car1234-5678-2-3d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121039_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0027999", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9099", "output": "{1, 3, 9, 9099, 337, 1011, 3033, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028000", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "504403158265495557", "output": "'qsttag_collect_taxes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028001", "code": "def max_total_score(scores):\n    if not scores:\n        return 0\n    n = len(scores)\n    dp = [0] * n\n    dp[0] = scores[0]\n    for i in range(1, n):\n        if scores[i] > scores[i - 1]:\n            dp[i] = max(dp[i], dp[i - 1] + scores[i])\n        else:\n            dp[i] = dp[i - 1]\n    return max(dp)\n", "entry_point": "max_total_score", "input": "[5, 9, 10]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127370_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028002", "code": "def control_flow_replica(x):\n    if x < 0:\n        if x < -10:\n            return x * 2\n        else:\n            return x * 3\n    else:\n        if x > 10:\n            return x * 4\n        else:\n            return x * 5\n", "entry_point": "control_flow_replica", "input": "3", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17276_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1726", "output": "{1, 2, 1726, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1725", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028004", "code": "def calculate_dot_product(list1, list2):\n    dot_product = 0\n    for i in range(len(list1)):\n        dot_product += list1[i] * list2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[1, 4, 7], [3, 5, 2]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118702_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028005", "code": "def generate_unique_id(section_name):\n    length = len(section_name)\n    if length % 2 == 0:  # Even length\n        unique_id = section_name + str(length)\n    else:  # Odd length\n        unique_id = section_name[::-1] + str(length)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'nn_model'", "output": "'nn_model8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126473_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028006", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'hoeDJoJohnDoS'", "output": "'hoe d jo john do s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028007", "code": "# calculate.py\ndef multiply(a, b):\n    return a * b\n", "entry_point": "multiply", "input": "2, 7", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16948_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028008", "code": "def generate_symmetric_banner(text, gap):\n    total_length = len(text) + gap\n    left_padding = (total_length - len(text)) // 2\n    right_padding = total_length - len(text) - left_padding\n    symmetric_banner = \" \" * left_padding + text + \" \" * right_padding\n    return symmetric_banner\n", "entry_point": "generate_symmetric_banner", "input": "'HeeHell,', 26", "output": "'             HeeHell,             '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92337_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028009", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'halie'", "output": "[('halie', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028010", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6553", "output": "{1, 6553}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6552", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028011", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[4, 4, 0, 1, 4, 5, 5]", "output": "[4, 5, 2, 4, 8, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6239", "output": "{1, 367, 17, 6239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6238", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028013", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[5, 5, 5, 1, 2, 2, 6, 6, 6]", "output": "[5, 5, 5, 1, 2, 2, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028014", "code": "RTOL_VALUE = 0.0005  # 0.05 %\ndef calculate_relative_tolerance(percentage):\n    \"\"\"\n    Calculate the relative tolerance based on the given percentage value.\n    Parameters:\n    percentage (float): The percentage value for which the relative tolerance needs to be calculated.\n    Returns:\n    float: The calculated relative tolerance.\n    \"\"\"\n    relative_tolerance = percentage * RTOL_VALUE\n    return relative_tolerance\n", "entry_point": "calculate_relative_tolerance", "input": "-3.3", "output": "-0.00165", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143546_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028015", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[5, 6, 8]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028016", "code": "def calculate_dot_product(vector1, vector2):\n    min_len = min(len(vector1), len(vector2))\n    dot_product_result = sum(vector1[i] * vector2[i] for i in range(min_len))\n    return dot_product_result\n", "entry_point": "calculate_dot_product", "input": "[8], [5]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135589_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028017", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'respmil.m'", "output": "[('respmil.m', 'respmil.m')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028018", "code": "# Function to parse the Chinese character code and return its pinyin pronunciation\ndef parse_hanzi(code):\n    pinyin_dict = {\n        'U+4E00': 'y\u012b',\n        'U+4E8C': '\u00e8r',\n        'U+4E09': 's\u0101n',\n        'U+4E5D': 'ji\u01d4'\n        # Add more mappings as needed\n    }\n    alternate_dict = {\n        'U+4E00': {'pinyin': 'y\u012b', 'code': '4E00'},\n        'U+4E8C': {'pinyin': '\u00e8r', 'code': '4E8C'},\n        'U+4E09': {'pinyin': 's\u0101n', 'code': '4E09'},\n        'U+4E5D': {'pinyin': 'ji\u01d4', 'code': '4E5D'}\n        # Add more alternate mappings as needed\n    }\n    pinyin = pinyin_dict.get(code)\n    if not pinyin:\n        alternate = alternate_dict.get(code)\n        if alternate:\n            pinyin = alternate['pinyin']\n            extra = '  => U+{0}'.format(alternate['code'])\n            if ',' in pinyin:\n                first_pinyin, extra_pinyin = pinyin.split(',', 1)\n                pinyin = first_pinyin\n                extra += '  ?-> ' + extra_pinyin\n        else:\n            pinyin = 'Pinyin not available'\n    return pinyin\n", "entry_point": "parse_hanzi", "input": "'U+4E5D'", "output": "'ji\u01d4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30788_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028019", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "26, 16", "output": "'1A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028020", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"0.0.0\"\n    for version in versions:\n        version_parts = version.split('.')\n        if len(version_parts) != 3:\n            continue\n        major, minor, patch = map(int, version_parts)\n        current_version = (major, minor, patch)\n        if current_version > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['invalid', '1.0', '2.0.0.1']", "output": "'0.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45704_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "585", "output": "{1, 65, 3, 195, 5, 39, 585, 9, 13, 45, 15, 117}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt584", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028022", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "11", "output": "'./prespawned/version11_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4715", "output": "{1, 5, 41, 4715, 205, 943, 115, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4714", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028024", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[2, 5, 3, 5, 2, 2, 2, 3, 5]", "output": "[2, 6, 5, 8, 6, 7, 8, 10, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028025", "code": "def find_average_patterns(lst):\n    pattern_count = 0\n    for i in range(1, len(lst) - 1):\n        if lst[i] * 2 == lst[i-1] + lst[i+1]:\n            pattern_count += 1\n    return pattern_count\n", "entry_point": "find_average_patterns", "input": "[2, 4, 6, 4, 2, 4, 6, 4, 2, 4, 6, 4]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88691_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028026", "code": "def distance_to_camera(knownWidth, focalLength, perWidth):\n    # Compute and return the distance from the object to the camera\n    return (knownWidth * focalLength) / perWidth\n", "entry_point": "distance_to_camera", "input": "359.4230769230769, 1, 1", "output": "359.4230769230769", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71888_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028027", "code": "def process_integers(int_list, target):\n    modified_list = []\n    for num in int_list:\n        if num < target:\n            modified_list.append(num ** 2)\n        else:\n            modified_list.append(num ** 3)\n    return modified_list\n", "entry_point": "process_integers", "input": "[6, 10, 7, 7, 10, 9, 9, 9, 7], 10", "output": "[36, 1000, 49, 49, 1000, 81, 81, 81, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36844_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028028", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "897179356.114138, 0.0", "output": "-897179356.114138", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028029", "code": "import json\ndef on_message(message):\n    data = json.loads(message)\n    received_message = data.get('message', '')\n    print(f\"Received message: {received_message}\")\n    response_message = {\n        'message': f\"{received_message} - Received\"\n    }\n    return json.dumps(response_message)\n", "entry_point": "on_message", "input": "'{\"message\": \"Good morning\"}'", "output": "'{\"message\": \"Good morning - Received\"}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99590_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028030", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "260", "output": "{1, 2, 130, 260, 4, 65, 5, 10, 13, 52, 20, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt259", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028031", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028032", "code": "def reverse(s):\n    reversed_str = ''\n    for char in reversed(s):\n        if not char.isalnum() and not char.isspace():\n            reversed_str += char\n    for char in reversed(s):\n        if char.isalnum() or char.isspace():\n            reversed_str = char + reversed_str\n    return reversed_str\n", "entry_point": "reverse", "input": "'X'", "output": "'X'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115692_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028033", "code": "def parse_version(version_str):\n    parts = version_str.split('.')\n    if len(parts) != 3:\n        return None\n    try:\n        major = int(parts[0])\n        minor = int(parts[1])\n        patch = int(parts[2])\n        return major, minor, patch\n    except ValueError:\n        return None\n", "entry_point": "parse_version", "input": "'3.13.12'", "output": "(3, 13, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52090_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028034", "code": "import os\ndef relative_path(start_dir, target_dir):\n    common_prefix = os.path.commonpath([start_dir, target_dir])\n    start_relative = os.path.relpath(start_dir, common_prefix)\n    target_relative = os.path.relpath(target_dir, common_prefix)\n    if start_relative == '.':\n        return target_relative\n    else:\n        return os.path.join('..', target_relative)\n", "entry_point": "relative_path", "input": "'/home/user/documents', '/home/user/downloads'", "output": "'../downloads'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53189_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028035", "code": "from typing import List\ndef remaining_people(line: List[int]) -> int:\n    shortest_height = float('inf')\n    shortest_index = 0\n    for i, height in enumerate(line):\n        if height < shortest_height:\n            shortest_height = height\n            shortest_index = i\n    return len(line[shortest_index:])\n", "entry_point": "remaining_people", "input": "[1, 2, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74868_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028036", "code": "from typing import List\ndef find_unique_elements(nums: List[int]) -> List[int]:\n    xor_result = 0\n    for num in nums:\n        xor_result ^= num\n    rightmost_set_bit = xor_result & -xor_result\n    unique1 = 0\n    unique2 = 0\n    for num in nums:\n        if num & rightmost_set_bit:\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "find_unique_elements", "input": "[2, 2, 4, 4, 3, 9]", "output": "[3, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117050_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028037", "code": "from typing import Tuple\ndef simulate_turtle_movement(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0\n    for cmd in commands:\n        if cmd == 'U':\n            y += 1\n        elif cmd == 'D':\n            y -= 1\n        elif cmd == 'L':\n            x -= 1\n        elif cmd == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_turtle_movement", "input": "'U'", "output": "(0, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_305_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028038", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'fun'", "output": "['fun']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028039", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 2, 3, 5, 0], 4", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "693", "output": "{1, 33, 3, 99, 7, 231, 9, 11, 77, 693, 21, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028041", "code": "def find_highest_score_index(scores):\n    highest_score = float('-inf')\n    highest_score_index = -1\n    for i in range(len(scores)):\n        if scores[i] > highest_score:\n            highest_score = scores[i]\n            highest_score_index = i\n        elif scores[i] == highest_score and i < highest_score_index:\n            highest_score_index = i\n    return highest_score_index\n", "entry_point": "find_highest_score_index", "input": "[5, 3, 7, 8, 10, 6]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57664_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028042", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7468", "output": "{1, 2, 4, 1867, 7468, 3734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7467", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028043", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study10000_20220520.txt'", "output": "(10000, '20220520')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028044", "code": "def find_duplicates(xs):\n    seen = set()\n    duplicates = []\n    for x in xs:\n        if x in seen:\n            if x not in duplicates:\n                duplicates.append(x)\n        else:\n            seen.add(x)\n    return duplicates\n", "entry_point": "find_duplicates", "input": "[0, 1, 0, 2, 3, 2]", "output": "[0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2241_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028045", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2081", "output": "{1, 2081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028046", "code": "def remove_underscore_keys(input_dict: dict) -> dict:\n    return {key: value for key, value in input_dict.items() if not key.startswith('_')}\n", "entry_point": "remove_underscore_keys", "input": "{'_key1': 1, '_key2': 2}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41236_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028047", "code": "# Define the dictionary with color names and BGR values\ncolor_dict = {\n    'BLACK': (0, 0, 0),\n    'BLUE': (255, 0, 0),\n    'CHOCOLATE': (30, 105, 210),\n    'CYAN': (255, 255, 0),\n    'GOLDEN': (32, 218, 165),\n    'GRAY': (155, 155, 155),\n    'GREEN': (0, 255, 0),\n    'LIGHT_BLUE': (255, 9, 2),\n    'MAGENTA': (255, 0, 255),\n    'ORANGE': (0, 69, 255),\n    'PURPLE': (128, 0, 128),\n    'PINK': (147, 20, 255),\n    'RED': (0, 0, 255),\n    'WHITE': (255, 255, 255),\n    'YELLOW': (0, 255, 255)\n}\ndef get_bgr(color_name):\n    return color_dict.get(color_name, \"Color not found\")\n", "entry_point": "get_bgr", "input": "'RED'", "output": "(0, 0, 255)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89938_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028048", "code": "def split_input_target(chunk):\n    input_text = chunk[:-1]\n    target_text = chunk[1:]\n    return input_text, target_text\n", "entry_point": "split_input_target", "input": "'hhellloeelo'", "output": "('hhellloeel', 'hellloeelo')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41781_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028049", "code": "from typing import List\ndef above_average_scores(scores: List[int]) -> List[int]:\n    if not scores:\n        return []\n    average_score = sum(scores) / len(scores)\n    above_average = [score for score in scores if score > average_score]\n    return above_average\n", "entry_point": "above_average_scores", "input": "[80, 80, 80, 80, 90, 90, 90, 90, 90]", "output": "[90, 90, 90, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44803_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028050", "code": "import heapq\ndef first_n_smallest(lst, n):\n    heap = [(val, idx) for idx, val in enumerate(lst)]\n    heapq.heapify(heap)\n    result = [heapq.heappop(heap) for _ in range(n)]\n    result.sort(key=lambda x: x[1])  # Sort based on original indices\n    return [val for val, _ in result]\n", "entry_point": "first_n_smallest", "input": "[3, 1, 2, 4], 2", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105636_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028051", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5606", "output": "{1, 2, 2803, 5606}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5605", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028052", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[89], 1", "output": "89.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94918_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028053", "code": "def generate_pythagorean_triples(limit):\n    triples = []\n    for a in range(1, limit + 1):\n        for b in range(a, limit + 1):\n            c = (a**2 + b**2)**0.5\n            if c.is_integer() and c <= limit:\n                triples.append((a, b, int(c)))\n    return triples\n", "entry_point": "generate_pythagorean_triples", "input": "13", "output": "[(3, 4, 5), (5, 12, 13), (6, 8, 10)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41271_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028054", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'ipsum', 5", "output": "['ipsum']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028055", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'Hello 123!!@#'", "output": "'Hello 123'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9589", "output": "{1, 43, 9589, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9588", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028057", "code": "def encrypt_string(input_string, shift):\n    encrypted_string = ''\n    for char in input_string:\n        if char.islower():\n            encrypted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_string += encrypted_char\n        else:\n            encrypted_string += char\n    return encrypted_string\n", "entry_point": "encrypt_string", "input": "'mm', 1", "output": "'nn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142963_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028058", "code": "def calculate_training_time(epochs: int, time_per_epoch: float) -> int:\n    total_training_time = epochs * time_per_epoch\n    return int(total_training_time)\n", "entry_point": "calculate_training_time", "input": "204, 1.0", "output": "204", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147727_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028059", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[5, 5, 2, 2, 1, 4, 3]", "output": "{5: 2, 2: 2, 1: 1, 4: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028060", "code": "def extract_app_config_name(config_str: str) -> str:\n    components = config_str.split('.')\n    return components[-1]\n", "entry_point": "extract_app_config_name", "input": "'some.config.Derg'", "output": "'Derg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50428_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028061", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    fib_prev, fib_curr = 0, 1\n    for _ in range(N):\n        fib_sum += fib_curr\n        fib_prev, fib_curr = fib_curr, fib_prev + fib_curr\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "13", "output": "609", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41805_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028062", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1981", "output": "{1, 283, 1981, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1980", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028063", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3001", "output": "{1, 3001}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3000", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028064", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'A', 'B'], 3", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028065", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2619", "output": "{1, 97, 3, 291, 27, 873, 9, 2619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028066", "code": "def add_index_to_element(input_list):\n    result_list = []\n    for i, num in enumerate(input_list):\n        result_list.append(num + i)\n    return result_list\n", "entry_point": "add_index_to_element", "input": "[0, 2, 1, 2, 1, 7, 2, 1]", "output": "[0, 3, 3, 5, 5, 12, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13680_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028067", "code": "def process_contact_form(form_data):\n    if 'email' in form_data:\n        # Simulate sending emails using the provided email address\n        email_address = form_data['email']\n        # Add your email sending simulation logic here\n        # For demonstration purposes, we will print a message\n        print(f\"Email sent to: {email_address}\")\n        return True\n    return False\n", "entry_point": "process_contact_form", "input": "{}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126827_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028068", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "-9, 1", "output": "-9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028069", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3723", "output": "{1, 3, 73, 3723, 17, 51, 1241, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028070", "code": "def dec2ascii(num: int) -> str:\n    if num < 0 or num > 127:\n        raise ValueError(\"Input integer must be within the valid ASCII range (0 to 127)\")\n    ascii_text = chr(num)\n    return ascii_text\n", "entry_point": "dec2ascii", "input": "97", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134623_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028071", "code": "def caesar_cipher(text, shift):\n    result = \"\"\n    for char in text:\n        if char.isupper():\n            new_char = chr((ord(char) - 65 + shift) % 26 + 65)\n            result += new_char\n    return result\n", "entry_point": "caesar_cipher", "input": "'ASVPH', 1", "output": "'BTWQI'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7376_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028072", "code": "def snake_to_camel(snake_str):\n    words = snake_str.split('_')\n    camel_words = [words[0]] + [word.capitalize() for word in words[1:]]\n    camel_case = ''.join(camel_words)\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'hello_wolow_are_you'", "output": "'helloWolowAreYou'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125061_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028073", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/', '/css/sty.c'", "output": "'/css/sty.c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028074", "code": "def process_user_input(cd):\n    when = cd.get('when', None)\n    not_when = cd.get('not_when', None)\n    tags = cd.get('tags', [])\n    edited = cd.get('cp_id', None)\n    invalid = []\n    return when, not_when, tags, edited, invalid\n", "entry_point": "process_user_input", "input": "{}", "output": "(None, None, [], None, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117041_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028075", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7263", "output": "{1, 3, 807, 9, 269, 2421, 27, 7263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7262", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028076", "code": "def extract_top_module(module_path: str) -> str:\n    # Split the module_path string by dots\n    modules = module_path.split('.')\n    # Return the top-level module name\n    return modules[0]\n", "entry_point": "extract_top_module", "input": "'sesentry'", "output": "'sesentry'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40470_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1174", "output": "{1, 2, 587, 1174}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1173", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028078", "code": "def compute_period(mod):\n    a, b = 0, 1\n    period = 0\n    for _ in range(mod * mod):\n        a, b = b, (a + b) % mod\n        if a == 0 and b == 1:\n            return period + 1\n        period += 1\n    return period\n", "entry_point": "compute_period", "input": "4", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104024_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028079", "code": "def process_input_string(input_string):\n    if isinstance(input_string, bytes):\n        return input_string.decode(\"utf-8\")\n    else:\n        return input_string\n", "entry_point": "process_input_string", "input": "b'Pyothison'", "output": "'Pyothison'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6292_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028080", "code": "def sum_of_squares_of_even_numbers(input_list):\n    sum_of_squares = 0\n    for num in input_list:\n        if num % 2 == 0:\n            sum_of_squares += num ** 2\n    return sum_of_squares\n", "entry_point": "sum_of_squares_of_even_numbers", "input": "[2, 4, 6]", "output": "56", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113006_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028081", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 15", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028082", "code": "from typing import List\ndef find_two_distinct_elements(nums: List[int]) -> tuple:\n    xor = 0\n    for num in nums:\n        xor ^= num\n    xor = xor & -xor\n    a, b = 0, 0\n    for num in nums:\n        if num & xor:\n            a ^= num\n        else:\n            b ^= num\n    return a, b\n", "entry_point": "find_two_distinct_elements", "input": "[4, 8, 0, 0, 2, 2, 6, 6]", "output": "(4, 8)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77585_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028083", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[2], [3], [1, [3, 3]]]", "output": "[2, 3, 1, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028084", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'example.on.json'", "output": "'example.on_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028085", "code": "def generate_gateway_id(wifi_mac: str) -> str:\n    # Extract the first 3 bytes of the MAC address\n    first_part = wifi_mac[:6]\n    # Append 'FFFE' to the first part\n    middle_part = 'FFFE'\n    # Extract the last 3 bytes of the MAC address\n    last_part = wifi_mac[6:]\n    # Concatenate the parts to form the Gateway ID\n    gateway_id = first_part + middle_part + last_part\n    return gateway_id\n", "entry_point": "generate_gateway_id", "input": "'30830aea4e38'", "output": "'30830aFFFEea4e38'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31952_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028086", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "'[1]'", "output": "[1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028087", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(map(str, version))\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(-1, 3, 7, 0, -1, 5, 3)", "output": "'-1.3.7.0.-1.5.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18962_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028088", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[60, 0, 64]", "output": "124", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028089", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[15, 8, 7, 14]", "output": "[15, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7479", "output": "{1, 3, 9, 277, 7479, 27, 2493, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028091", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5423", "output": "{1, 11, 493, 5423, 17, 187, 29, 319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5422", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6655", "output": "{1, 5, 11, 1331, 55, 121, 605, 6655}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6654", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028093", "code": "from typing import List, Tuple\ndef find_pairs(lst: List[int], target_sum: int) -> List[Tuple[int, int]]:\n    seen_pairs = {}\n    result = []\n    for num in lst:\n        complement = target_sum - num\n        if complement in seen_pairs:\n            result.append((num, complement))\n        seen_pairs[num] = True\n    return result\n", "entry_point": "find_pairs", "input": "[1, 3, 6, 4], 9", "output": "[(6, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13694_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028094", "code": "def generateSecureToken(sCorpID, sEncodingAESKey):\n    concatenated_str = sCorpID + sEncodingAESKey\n    length = len(concatenated_str)\n    reversed_str = concatenated_str[::-1]\n    uppercase_str = reversed_str.upper()\n    secure_token = uppercase_str + str(length)\n    return secure_token\n", "entry_point": "generateSecureToken", "input": "'ABCC123A', '131131311'", "output": "'113131131A321CCBA17'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75848_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028095", "code": "def process_operations(operations):\n    global state\n    state = 0  # Initialize global state variable\n    for operation in operations:\n        op, val = operation.split()\n        val = int(val)\n        if op == 'add':\n            state += val\n        elif op == 'subtract':\n            state -= val\n    return state\n", "entry_point": "process_operations", "input": "['add 15']", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25209_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028096", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'abc-31x25y8@!'", "output": "-31258", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028097", "code": "def calculate_ascii_sum(word_one, word_two):\n    longer_word_length = max(len(word_one), len(word_two))\n    shorter_word_length = min(len(word_one), len(word_two))\n    total_sum = 0\n    for i in range(shorter_word_length, longer_word_length):\n        if len(word_one) > len(word_two):\n            current_word_char = word_one[i]\n        else:\n            current_word_char = word_two[i]\n        total_sum += ord(current_word_char)\n    return total_sum\n", "entry_point": "calculate_ascii_sum", "input": "'', 'a'", "output": "97", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134512_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "294", "output": "{1, 2, 3, 98, 294, 6, 7, 42, 14, 49, 147, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt293", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028099", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5002", "output": "{1, 2, 2501, 41, 5002, 82, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5001", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028100", "code": "CJ_PATH = r''\nCOOKIES_PATH = r''\nCHAN_ID = ''\nVID_ID = ''\ndef replace_variables(input_string, variable_type):\n    if variable_type == 'CHAN_ID':\n        return input_string.replace('CHAN_ID', CHAN_ID)\n    elif variable_type == 'VID_ID':\n        return input_string.replace('VID_ID', VID_ID)\n    else:\n        return input_string\n", "entry_point": "replace_variables", "input": "'CHAN_IDan', 'CHAN_ID'", "output": "'an'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27344_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028101", "code": "from typing import List\ndef max_score_subset(scores: List[int], K: int) -> int:\n    scores.sort()\n    max_score = 0\n    left, right = 0, 1\n    while right < len(scores):\n        if scores[right] - scores[left] <= K:\n            max_score = max(max_score, scores[left] + scores[right])\n            right += 1\n        else:\n            left += 1\n    return max_score\n", "entry_point": "max_score_subset", "input": "[10, 13, 2, 1], 3", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94061_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "650", "output": "{1, 2, 130, 65, 5, 325, 650, 10, 13, 50, 25, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt649", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028103", "code": "def map_choices_to_descriptions(choices):\n    choices_dict = {}\n    for choice, description in choices:\n        choices_dict[choice] = description\n    return choices_dict\n", "entry_point": "map_choices_to_descriptions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115679_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028104", "code": "def setup_project(repo_name, repo_url, commit):\n    # Simulate importing necessary modules from solver-deps\n    def setup_minisat():\n        print(\"Setting up Minisat...\")\n    def setup_cms():\n        print(\"Setting up CMS...\")\n    def clone_repo_src(repo_name, repo_url, commit):\n        # Simulated function to clone the repository\n        return f\"{repo_name}_{commit}\"\n    # Simulate the process of setting up dependencies\n    setup_minisat()\n    setup_cms()\n    # Simulate cloning the repository\n    the_repo = clone_repo_src(repo_name, repo_url, commit)\n    # Simulate creating and setting up the build directory\n    build_dir = f\"{the_repo}/build\"\n    print(f\"Build directory path: {build_dir}\")\n    return build_dir\n", "entry_point": "setup_project", "input": "'v2.3v2STP33', 'dummy_url', '99a59aa79'", "output": "'v2.3v2STP33_99a59aa79/build'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115797_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028105", "code": "def process_data(data: str) -> str:\n    if data == \"photo_prod\":\n        return \"take_photo_product\"\n    elif data == \"rept_photo\":\n        return \"repeat_photo\"\n    else:\n        return \"invalid_command\"\n", "entry_point": "process_data", "input": "'rept_photo'", "output": "'repeat_photo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135393_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5678", "output": "{1, 2, 34, 167, 5678, 334, 17, 2839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5677", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028107", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3028", "output": "{1, 2, 4, 1514, 3028, 757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3027", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3035", "output": "{1, 3035, 5, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3034", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028109", "code": "def reverse_string_custom(string):\n    reversed_string = \"\"\n    for i in range(len(string) - 1, -1, -1):\n        reversed_string += string[i]\n    return reversed_string\n", "entry_point": "reverse_string_custom", "input": "'hhheellohh'", "output": "'hholleehhh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_828_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028110", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7797", "output": "{1, 3, 69, 2599, 113, 339, 7797, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028111", "code": "def count_and_say(n):\n    if n == 1:\n        return '1'\n    current = '1'\n    for _ in range(n - 1):\n        next_term = ''\n        i = 0\n        while i < len(current):\n            count = 1\n            while i + 1 < len(current) and current[i] == current[i + 1]:\n                count += 1\n                i += 1\n            next_term += str(count) + current[i]\n            i += 1\n        current = next_term\n    return current\n", "entry_point": "count_and_say", "input": "3", "output": "'21'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103717_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028112", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1577", "output": "{1, 83, 19, 1577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028113", "code": "from typing import List\ndef merge_sorted_arrays(nums1: List[int], nums2: List[int]) -> List[int]:\n    sorted_array = []\n    nums1_index, nums2_index = 0, 0\n    while nums1_index < len(nums1) and nums2_index < len(nums2):\n        num1, num2 = nums1[nums1_index], nums2[nums2_index]\n        if num1 <= num2:\n            sorted_array.append(num1)\n            nums1_index += 1\n        else:\n            sorted_array.append(num2)\n            nums2_index += 1\n    sorted_array.extend(nums1[nums1_index:])\n    sorted_array.extend(nums2[nums2_index:])\n    return sorted_array\n", "entry_point": "merge_sorted_arrays", "input": "[4, 4, 5, 5], [1, 3, 4, 5, 5, 6, 6, 7]", "output": "[1, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90744_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028114", "code": "def space_replacer(input_string: str) -> str:\n    modified_string = \"\"\n    for char in input_string:\n        if char == ' ':\n            modified_string += ' ' * 33\n        else:\n            modified_string += char\n    return modified_string\n", "entry_point": "space_replacer", "input": "'world!'", "output": "'world!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64901_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028115", "code": "def parse_config_file(config_data: str) -> dict:\n    config_dict = {}\n    for line in config_data.split('\\n'):\n        line = line.strip()\n        if line and not line.startswith('#'):\n            key, value = line.split('=')\n            config_dict[key.strip()] = value.strip()\n    return config_dict\n", "entry_point": "parse_config_file", "input": "'DB_PORT = 5432'", "output": "{'DB_PORT': '5432'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101724_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028116", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "242", "output": "{1, 2, 11, 242, 22, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt241", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028117", "code": "def custom_round(number):\n    \"\"\"Round a floating-point number to the nearest integer.\"\"\"\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    if decimal_part > 0.5 or (decimal_part == 0.5 and integer_part % 2 != 0):\n        return integer_part + 1 if number >= 0 else integer_part - 1\n    else:\n        return integer_part\n", "entry_point": "custom_round", "input": "5.4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147339_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9567", "output": "{1, 3, 1063, 9, 3189, 9567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9566", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028119", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "893", "output": "{1, 19, 893, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028120", "code": "from typing import Tuple\ndef find_block_dimensions(string: str) -> Tuple[int, int]:\n    lines = string.strip().split('\\n')\n    max_chars = 0\n    total_rows = 0\n    for line in lines:\n        num_chars = len(line.strip())\n        if num_chars > 0:\n            total_rows += 1\n            max_chars = max(max_chars, num_chars)\n    return total_rows, max_chars\n", "entry_point": "find_block_dimensions", "input": "'hi\\nok\\nno'", "output": "(3, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40341_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4419", "output": "{1, 1473, 3, 4419, 9, 491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028122", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "8.0, 11.0", "output": "44.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028123", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9262", "output": "{1, 2, 421, 842, 11, 9262, 22, 4631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028124", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2217", "output": "{3, 1, 2217, 739}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028125", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> int:\n    mod_remainder = {0: -1}  # Initialize with 0 remainder at index -1\n    max_length = 0\n    cum_sum = 0\n    for i, num in enumerate(arr):\n        cum_sum += num\n        remainder = cum_sum % k\n        if remainder in mod_remainder:\n            max_length = max(max_length, i - mod_remainder[remainder])\n        else:\n            mod_remainder[remainder] = i\n    return max_length\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[1, 2, 3, 4, -2, -3, -5], 7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13435_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028126", "code": "def process_dependencies(dependencies):\n    dependency_dict = {}\n    for key, value in dependencies:\n        if key in dependency_dict:\n            dependency_dict[key].append(value)\n        else:\n            dependency_dict[key] = [value]\n    return dependency_dict\n", "entry_point": "process_dependencies", "input": "[('X', 'Y'), ('Y', 'Z'), ('Z', 'W')]", "output": "{'X': ['Y'], 'Y': ['Z'], 'Z': ['W']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147184_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028127", "code": "def find_latest_version(versions):\n    latest_version = \"0.0.0\"\n    for version in versions:\n        version_parts = list(map(int, version.split(\".\")))\n        latest_parts = list(map(int, latest_version.split(\".\")))\n        if version_parts > latest_parts:\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['2.3.5', '2.3.4', '1.0.0', '1.9.9', '2.0.0', '2.3.6']", "output": "'2.3.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12565_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028128", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7883", "output": "{1, 7883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028129", "code": "def repeat(character: str, counter: int) -> str:\n    \"\"\"Repeat returns character repeated `counter` times.\"\"\"\n    word = \"\"\n    for _ in range(counter):\n        word += character\n    return word\n", "entry_point": "repeat", "input": "'a', 3", "output": "'aaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60016_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028130", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'acarchh4'", "output": "'acarchh4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028131", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9307", "output": "{1, 9307, 227, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9306", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028132", "code": "from typing import List\ndef sum_with_reverse(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i-1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[1, 3, 2, 2, 3, 2, 4, 3]", "output": "[4, 7, 4, 5, 5, 4, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36756_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028133", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'test:1'", "output": "('test', '1')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028134", "code": "def process_integers(integers, threshold):\n    modified_integers = []\n    running_sum = 0\n    for num in integers:\n        if num >= threshold:\n            num = running_sum\n            running_sum += num\n        modified_integers.append(num)\n    return modified_integers\n", "entry_point": "process_integers", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0], 1", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83853_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028135", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'peheg.com'", "output": "'peheg.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028136", "code": "import textwrap\ndef process_multiline_string(multiline_string, sep='\\n'):\n    multiline_string = textwrap.dedent(multiline_string)\n    string_list = multiline_string.split(sep)\n    if not string_list[0]:\n        string_list = string_list[1:]\n    if not string_list[-1]:\n        string_list = string_list[:-1]\n    return ''.join([s + '\\n' for s in string_list])\n", "entry_point": "process_multiline_string", "input": "'\\nstWorlmumultiltinedH\\n'", "output": "'stWorlmumultiltinedH\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24171_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028137", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[85, 95, 70, 80, 75, 90], 2", "output": "[1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028138", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[44]", "output": "'0x2c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8769", "output": "{8769, 1, 3, 37, 2923, 237, 79, 111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8768", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028140", "code": "from typing import List\ndef longest_contiguous_subarray(temperatures: List[int], threshold: int) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    result = []\n    while end < len(temperatures):\n        if max(temperatures[start:end+1]) - min(temperatures[start:end+1]) <= threshold:\n            if end - start + 1 > max_length:\n                max_length = end - start + 1\n                result = temperatures[start:end+1]\n            end += 1\n        else:\n            start += 1\n    return result\n", "entry_point": "longest_contiguous_subarray", "input": "[74, 74], 0", "output": "[74, 74]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105139_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028141", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "4, 5", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028142", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[2, 10]", "output": "(2, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028143", "code": "def caesar_encode(phrase: str, shift: int) -> str:\n    def shift_char(char, shift):\n        if char.islower():\n            return chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n        elif char.isupper():\n            return chr(((ord(char) - ord('A') + shift) % 26) + ord('A'))\n        else:\n            return char\n    encoded_phrase = \"\"\n    for char in phrase:\n        encoded_phrase += shift_char(char, shift)\n    return encoded_phrase\n", "entry_point": "caesar_encode", "input": "'Dahhk,D,', 10", "output": "'Nkrru,N,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45321_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028144", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2438", "output": "{1, 2, 1219, 2438, 106, 46, 53, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2437", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028145", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9779", "output": "{1, 7, 11, 77, 9779, 1397, 889, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028146", "code": "from datetime import datetime\ndef calculate_date_difference(date1, date2):\n    # Parse the input date strings into datetime objects\n    date1_obj = datetime.strptime(date1, '%Y-%m-%d')\n    date2_obj = datetime.strptime(date2, '%Y-%m-%d')\n    # Calculate the absolute difference in days between the two dates\n    date_difference = abs((date1_obj - date2_obj).days)\n    return date_difference\n", "entry_point": "calculate_date_difference", "input": "'2023-01-01', '2023-05-24'", "output": "143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86815_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028147", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[5, 3, 5, 5, 4, 5, 4, 5, 5]", "output": "[5, 4, 7, 8, 8, 10, 10, 12, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028148", "code": "from typing import List, Dict, Any\ndef calculate_sum(items: List[Dict[str, Any]]) -> int:\n    total_sum = 0\n    for item in items:\n        total_sum += item.get('value', 0)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127662_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028149", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9370", "output": "{1, 2, 5, 937, 10, 4685, 1874, 9370}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9369", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028150", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_unique_words", "input": "' hellhellolo '", "output": "{'hellhellolo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24986_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028151", "code": "from typing import List\nimport heapq\ndef min_time_to_complete_tasks(tasks: List[int], num_concurrent: int) -> int:\n    if not tasks:\n        return 0\n    tasks.sort()  # Sort tasks in ascending order of processing times\n    pq = []  # Priority queue to store the next available task to start\n    time = 0\n    running_tasks = []\n    for task in tasks:\n        while len(running_tasks) >= num_concurrent:\n            next_task_time, next_task = heapq.heappop(pq)\n            time = max(time, next_task_time)\n            running_tasks.remove(next_task)\n        time += task\n        running_tasks.append(task)\n        heapq.heappush(pq, (time, task))\n    return max(time, max(pq)[0])  # Return the maximum time taken to complete all tasks\n", "entry_point": "min_time_to_complete_tasks", "input": "[8, 8, 8, 8], 4", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10650_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028152", "code": "from typing import List\ndef sum_of_powers(numbers: List[int], power: int) -> int:\n    result = 0\n    for num in numbers:\n        result += num ** power\n    return result\n", "entry_point": "sum_of_powers", "input": "[3, 5], 2", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38539_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028153", "code": "def calculate_load_stress_factor(technology_id):\n    piL = technology_id * 0.382\n    return piL\n", "entry_point": "calculate_load_stress_factor", "input": "-3.0", "output": "-1.146", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81060_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028154", "code": "import math\ndef calculate_gaussian_coefficients(ndim):\n    p_i = math.pi\n    coefficients = 1 / (math.sqrt(2 * p_i) ** ndim)\n    return coefficients\n", "entry_point": "calculate_gaussian_coefficients", "input": "57", "output": "1.7859683233248457e-23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134730_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028155", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8634", "output": "{1, 2, 3, 6, 8634, 4317, 2878, 1439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028156", "code": "from typing import Dict\ndef count_total_vdi_profiles(stationwise_vdi_profiles: Dict[str, dict]) -> int:\n    total_count = 0\n    for station in stationwise_vdi_profiles.values():\n        total_count += len(station.get('vdi400Rows', [])) + len(station.get('vdi765Rows', []))\n    return total_count\n", "entry_point": "count_total_vdi_profiles", "input": "{}", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130449_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028157", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "4", "output": "[4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028158", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[100, 90, 80, 70, 60]", "output": "[100, 90, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028159", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'aaarch64'", "output": "'aaarch64'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028160", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[2, 4, 6, 8]", "output": "[2, 4, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6182", "output": "{1, 2, 6182, 11, 562, 3091, 22, 281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6181", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028162", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6157", "output": "{1, 131, 6157, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6156", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028163", "code": "def damerau_levenshtein_distance(str1, str2):\n    m, n = len(str1), len(str2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            cost = 0 if str1[i - 1] == str2[j - 1] else 1\n            dp[i][j] = min(dp[i-1][j] + 1, dp[i][j-1] + 1, dp[i-1][j-1] + cost)\n            if i > 1 and j > 1 and str1[i-1] == str2[j-2] and str1[i-2] == str2[j-1]:\n                dp[i][j] = min(dp[i][j], dp[i-2][j-2] + 1)\n    return dp[m][n]\n", "entry_point": "damerau_levenshtein_distance", "input": "'abcde', 'fghij'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7600_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028164", "code": "from typing import List, Tuple\ndef task_queue(tasks: List[Tuple[int, int]]) -> int:\n    current_time = 0\n    for task_id, task_duration in tasks:\n        current_time += task_duration\n    return current_time\n", "entry_point": "task_queue", "input": "[(1, 10), (2, 10), (3, 10)]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81017_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028165", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[1, 1, 2, 3]", "output": "{1: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028166", "code": "def leastInterval(tasks, n):\n    task_freq = [0] * 26\n    for task in tasks:\n        task_freq[ord(task) - ord('A')] += 1\n    task_freq.sort(reverse=True)\n    max_freq = task_freq[0]\n    max_count = task_freq.count(max_freq)\n    return max((max_freq - 1) * (n + 1) + max_count, len(tasks))\n", "entry_point": "leastInterval", "input": "['A', 'A', 'A', 'B'], 23", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29790_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028167", "code": "def calculate_total_loss(loss_values):\n    total_loss = 0\n    for loss in loss_values:\n        total_loss += loss\n    return total_loss\n", "entry_point": "calculate_total_loss", "input": "[20.0, 25.0, 0.190000000000005]", "output": "45.190000000000005", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134745_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028168", "code": "def generate_pattern(n):\n    pattern_lines = []\n    current_line = [1]  # Start with the first line containing only 1\n    for i in range(1, n + 1):\n        next_line = [current_line[j] + j + 1 for j in range(len(current_line))]\n        pattern_lines.append(' '.join(map(str, current_line)))\n        current_line = next_line\n    return pattern_lines\n", "entry_point": "generate_pattern", "input": "2", "output": "['1', '2']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028169", "code": "def max_consecutive_elements(lst):\n    if not lst:\n        return 0\n    max_count = 0\n    current_count = 1\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1]:\n            current_count += 1\n        else:\n            max_count = max(max_count, current_count)\n            current_count = 1\n    max_count = max(max_count, current_count)\n    return max_count\n", "entry_point": "max_consecutive_elements", "input": "[1, 1, 1, 1, 1, 3, 4, 5]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27992_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028170", "code": "def count_guid_characters(guids):\n    guid_counts = {}\n    for guid in guids:\n        cleaned_guid = guid.replace(' ', '')\n        character_count = len(cleaned_guid)\n        guid_counts[cleaned_guid] = character_count\n    return guid_counts\n", "entry_point": "count_guid_characters", "input": "['abc 123', 'def 456', 'ghi 789']", "output": "{'abc123': 6, 'def456': 6, 'ghi789': 6}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107302_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028171", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'hello:world,how|are*you'", "output": "['hello', 'world', 'how', 'are', 'you']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028172", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1525", "output": "{1, 5, 305, 1525, 25, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1524", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028173", "code": "IMAGE_WIDTH = 84\nIMAGE_HEIGHT = 84\nNUM_CHANNELS = 4\ndef calculate_memory_required(batch_size):\n    image_memory = IMAGE_WIDTH * IMAGE_HEIGHT * NUM_CHANNELS\n    total_memory = image_memory * batch_size\n    return total_memory\n", "entry_point": "calculate_memory_required", "input": "16", "output": "451584", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133570_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028174", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2455", "output": "{1, 491, 5, 2455}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028175", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2467", "output": "{1, 2467}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2466", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028176", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9638", "output": "{1, 2, 9638, 79, 4819, 122, 61, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9637", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028177", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'bbbbbbbaaaacccc'", "output": "'b7a4c4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028178", "code": "def calculate_distances(S1, S2):\n    map = {}\n    initial = 0\n    distance = []\n    for i in range(26):\n        map[S1[i]] = i\n    for i in S2:\n        distance.append(abs(map[i] - initial))\n        initial = map[i]\n    return distance\n", "entry_point": "calculate_distances", "input": "'abcdefghijklmnopqrstuvwxyz', 'xyzabc'", "output": "[23, 1, 1, 25, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35345_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "617", "output": "{1, 617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt616", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028180", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1409", "output": "{1, 1409}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1408", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028181", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1990", "output": "{1, 2, 995, 5, 1990, 199, 10, 398}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1989", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028182", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1084", "output": "{1, 2, 4, 271, 1084, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1083", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028183", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[6, 1, 4, 2, 3, 2, 2, 5, 4]", "output": "[6, 4, 2, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028184", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "14", "output": "'XIV'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028185", "code": "from typing import Tuple\nimport math\ndef calculate_distance(point1: Tuple[int, int], point2: Tuple[int, int]) -> float:\n    x1, y1 = point1\n    x2, y2 = point2\n    distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0), (5, 5)", "output": "7.0710678118654755", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60623_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028186", "code": "def solution(s):\n    start = 0\n    end = len(s) - 1\n    while start < len(s) and not s[start].isalnum():\n        start += 1\n    while end >= 0 and not s[end].isalnum():\n        end -= 1\n    return s[start:end+1]\n", "entry_point": "solution", "input": "'#@123_.def!!'", "output": "'123_.def'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114817_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6181", "output": "{1, 883, 6181, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6180", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028188", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{-1: 5}", "output": "[-1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028189", "code": "def max_nested_parentheses_depth(input_str):\n    depth = 0\n    max_depth = 0\n    for char in input_str:\n        if char == '(':\n            depth += 1\n            max_depth = max(max_depth, depth)\n        elif char == ')':\n            depth -= 1\n    return max_depth\n", "entry_point": "max_nested_parentheses_depth", "input": "'(((((( )))))))'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80515_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028190", "code": "def find_nth_fibonacci(first, second, n):\n    if n == 1:\n        return first\n    elif n == 2:\n        return second\n    else:\n        for i in range(n - 2):\n            next_num = first + second\n            first, second = second, next_num\n        return next_num\n", "entry_point": "find_nth_fibonacci", "input": "5, 10, 3", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81618_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9302", "output": "{1, 2, 4651, 9302}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9301", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028192", "code": "def timeToSeconds(t: str) -> int:\n    \"\"\"\n    Convert the parsed time string from config.yaml to seconds\n    Args:\n        t (str): Supported format \"hh:mm:ss\"\n    Returns:\n        int: Total of seconds\n    \"\"\"\n    n = [int(x) for x in t.split(\":\")]\n    n[0] = n[0] * 60 * 60\n    n[1] = n[1] * 60\n    return sum(n)\n", "entry_point": "timeToSeconds", "input": "'306:40:05'", "output": "1104005", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58368_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028193", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9538", "output": "{1, 9538, 2, 4769, 38, 19, 502, 251}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028194", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "817", "output": "{1, 19, 43, 817}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4334", "output": "{1, 2, 197, 394, 11, 4334, 22, 2167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028196", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[10, 10, 10, 3]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123355_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028197", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'my_group/78_1011'", "output": "((78, 1011), 'my_group')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028198", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4492", "output": "{1, 2, 1123, 4, 2246, 4492}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4491", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028199", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 3  # Multiply the last added element by 3\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 40, 40, 4, 16, 40, 4, 8, 8]", "output": "[6, 42, 42, 6, 18, 42, 6, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82460_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028200", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1449", "output": "{1, 161, 3, 483, 69, 7, 1449, 9, 207, 21, 23, 63}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028201", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2379", "output": "{1, 3, 39, 2379, 13, 183, 793, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028202", "code": "def find_attack_class(attacks, target_attack):\n    if target_attack in attacks:\n        return attacks[target_attack]\n    else:\n        return \"Attack not found\"\n", "entry_point": "find_attack_class", "input": "{'fire': 'element', 'water': 'element'}, 'electric'", "output": "'Attack not found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35732_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028203", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "958", "output": "{1, 2, 958, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt957", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028204", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char == \" \":\n            encrypted_text += \" \"\n        else:\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'axeehw', 5", "output": "'fcjjmb'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51413_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028205", "code": "def findSubsetsThatSumToK(arr, k):\n    subsets = []\n    def generateSubsets(arr, index, current, current_sum, k, subsets):\n        if current_sum == k:\n            subsets.append(current[:])\n        if index == len(arr) or current_sum >= k:\n            return\n        for i in range(index, len(arr)):\n            current.append(arr[i])\n            generateSubsets(arr, i + 1, current, current_sum + arr[i], k, subsets)\n            current.pop()\n    generateSubsets(arr, 0, [], 0, k, subsets)\n    return subsets\n", "entry_point": "findSubsetsThatSumToK", "input": "[4, 4], 4", "output": "[[4], [4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127361_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028206", "code": "def convert_to_byte_string(input_string: str) -> bytes:\n    if input_string is None:\n        return b'\\xff\\xff\\xff\\xff'\n    elif not input_string:\n        return b'\\x00\\x00\\x00\\x00'\n    else:\n        length_bytes = len(input_string).to_bytes(4, byteorder='little')\n        return length_bytes + input_string.encode()\n", "entry_point": "convert_to_byte_string", "input": "''", "output": "b'\\x00\\x00\\x00\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131726_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028207", "code": "def camel_to_snake(input_str):\n    output_str = \"\"\n    for i, char in enumerate(input_str):\n        if char.isupper() and i > 0:\n            output_str += \"_\"\n        output_str += char.lower()\n    return output_str\n", "entry_point": "camel_to_snake", "input": "'tchrMoMom'", "output": "'tchr_mo_mom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114334_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028208", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'njfhn'", "output": "'njfhn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028209", "code": "def feature_match(features1, features2):\n    for feature in features1:\n        if feature in features2:\n            return True\n    return False\n", "entry_point": "feature_match", "input": "[1, 2, 3], [4, 5, 6]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15673_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6026", "output": "{1, 2, 131, 3013, 262, 6026, 46, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6025", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028211", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8735", "output": "{1, 1747, 5, 8735}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8734", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028212", "code": "from typing import List\ndef remove_adjacent_duplicates(nums: List[int]) -> List[int]:\n    result = []\n    last_seen = None\n    for num in nums:\n        if num != last_seen:\n            result.append(num)\n            last_seen = num\n    return result\n", "entry_point": "remove_adjacent_duplicates", "input": "[0, 0, 4, 0, 2, 4]", "output": "[0, 4, 0, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80400_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028213", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'joverhes', 8", "output": "'joverhes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028214", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'helll'", "output": "['helll']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028215", "code": "def simulate_login(username, password):\n    if username == 'abcdefg':\n        return 'Please Enter Valid Email Or Mobile Number'\n    elif password == '<PASSWORD>':\n        return 'Kindly Verify Your User Id Or Password And Try Again.'\n    elif username == '1234567899':\n        return 'User does not exist. Please sign up.'\n    elif username == 'valid_username' and password == 'valid_password':\n        return 'Login successful.'\n    else:\n        return 'Incorrect username or password. Please try again.'\n", "entry_point": "simulate_login", "input": "'valid_username', 'valid_password'", "output": "'Login successful.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145289_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028216", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8339", "output": "{1, 8339, 269, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8338", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028217", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'-388'", "output": "-388", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028218", "code": "import heapq\ndef top_k_frequent_elements(nums, k):\n    freq_map = {}\n    for num in nums:\n        freq_map[num] = freq_map.get(num, 0) + 1\n    heap = [(-freq, num) for num, freq in freq_map.items()]\n    heapq.heapify(heap)\n    top_k = []\n    for _ in range(k):\n        top_k.append(heapq.heappop(heap)[1])\n    return sorted(top_k)\n", "entry_point": "top_k_frequent_elements", "input": "[-1, -1, 1, 1, 2, 2, 3, 3], 4", "output": "[-1, 1, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76714_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028219", "code": "def calculate_transition_probabilities(sequences):\n    transition_probs = {}\n    for seq in sequences:\n        for i in range(len(seq) - 1):\n            current_element = seq[i]\n            next_element = seq[i + 1]\n            if current_element not in transition_probs:\n                transition_probs[current_element] = {}\n            if next_element not in transition_probs[current_element]:\n                transition_probs[current_element][next_element] = 0\n            transition_probs[current_element][next_element] += 1\n    for current_element, transitions in transition_probs.items():\n        total_transitions = sum(transitions.values())\n        for next_element in transitions:\n            transition_probs[current_element][next_element] /= total_transitions\n    return transition_probs\n", "entry_point": "calculate_transition_probabilities", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30693_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028220", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[9, 0, 1, 2, 6]", "output": "[9, 0, 1, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028221", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5713", "output": "{5713, 1, 29, 197}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5712", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028222", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[3, 5, 3, 4, 5, 13, 3, 5, 2]", "output": "'24234=241'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028223", "code": "def generate_next_page_message(page_number: int) -> str:\n    flag = page_number + 1\n    message = f'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f{flag}'\n    return message\n", "entry_point": "generate_next_page_message", "input": "3", "output": "'\u6b64\u9875\u5df2\u4e0b\u8f7d\u5b8c\u6210\uff0c\u4e0b\u4e00\u9875\u662f4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103148_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028224", "code": "def calculate_balance(initial_balance, transactions, account_id):\n    balances = {account_id: initial_balance}\n    for account, amount in transactions:\n        if account not in balances:\n            balances[account] = 0\n        balances[account] += amount\n    return balances.get(account_id, 0)\n", "entry_point": "calculate_balance", "input": "100, [('12345', 201)], '12345'", "output": "301", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118421_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028225", "code": "def calculate_weighted_average(probabilities):\n    weighted_sum = 0\n    for value, probability in probabilities.items():\n        weighted_sum += value * probability\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "{12.3: 1}", "output": "12.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63042_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028226", "code": "def linear_interpolate(x_values, y_values, x):\n    if x < x_values[0] or x > x_values[-1]:\n        return None  # x is outside the range of known x-coordinates\n    for i in range(len(x_values) - 1):\n        if x_values[i] <= x <= x_values[i + 1]:\n            x0, x1 = x_values[i], x_values[i + 1]\n            y0, y1 = y_values[i], y_values[i + 1]\n            return y0 + (y1 - y0) * (x - x0) / (x1 - x0)\n", "entry_point": "linear_interpolate", "input": "[10, 20], [20, 40], 15", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73017_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028227", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'iteitem3temem3 ]'", "output": "['iteitem3temem3 ]']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028228", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "10", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028229", "code": "def count_occurrences(input_list):\n    occurrences = {}\n    for num in input_list:\n        if num in occurrences:\n            occurrences[num] += 1\n        else:\n            occurrences[num] = 1\n    return occurrences\n", "entry_point": "count_occurrences", "input": "[3, 3, 3, 4, 1, 2, 0]", "output": "{3: 3, 4: 1, 1: 1, 2: 1, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19399_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028230", "code": "def count_increasing_sums(lst):\n    num_increased = 0\n    for i in range(len(lst) - 2):\n        if lst[i] + lst[i+1] < lst[i+1] + lst[i+2]:\n            num_increased += 1\n    return num_increased\n", "entry_point": "count_increasing_sums", "input": "[1, 2, 3, 2]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14820_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028231", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5211", "output": "{1, 193, 3, 579, 27, 1737, 9, 5211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028232", "code": "def process_transactions(transactions):\n    account_balances = {}\n    for from_account, to_account, amount in transactions:\n        if from_account not in account_balances:\n            account_balances[from_account] = 0\n        if to_account not in account_balances:\n            account_balances[to_account] = 0\n        if account_balances[from_account] >= amount:\n            account_balances[from_account] -= amount\n            account_balances[to_account] += amount\n    return account_balances\n", "entry_point": "process_transactions", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128894_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028233", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6803", "output": "{1, 6803}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028234", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'323.3'", "output": "(323, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028235", "code": "from typing import List\ndef min_steps_to_reach_end(cave: List[int], threshold: int) -> int:\n    n = len(cave)\n    dp = [float('inf')] * n\n    dp[0] = 0\n    for i in range(1, n):\n        for j in range(i):\n            if abs(cave[i] - cave[j]) <= threshold:\n                dp[i] = min(dp[i], dp[j] + 1)\n    return dp[-1]\n", "entry_point": "min_steps_to_reach_end", "input": "[0, 1, 2, 3, 4], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32739_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028236", "code": "def modifyString(input_string):\n    if \"tests\" in input_string and \"Tir\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\").replace(\"Tir\", \"success\")\n    elif \"tests\" in input_string:\n        input_string = input_string.replace(\"tests\", \"pass\")\n    elif \"Tir\" in input_string:\n        input_string = input_string.replace(\"Tir\", \"success\")\n    return input_string\n", "entry_point": "modifyString", "input": "'ttesti'", "output": "'ttesti'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99773_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028237", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[70, 75, 80, 90, 88, 88, 85, 86]", "output": "87.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028238", "code": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n = n // 2\n        else:\n            n = (n * 3) + 1\n        sequence.append(n)\n    return sequence\n", "entry_point": "generate_sequence", "input": "13", "output": "[13, 40, 20, 10, 5, 16, 8, 4, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98591_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028239", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4367", "output": "{1, 11, 397, 4367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028240", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'bdwoown'", "output": "{'bdwoown': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028241", "code": "def count_elements_in_expression(expression: str) -> int:\n    operands_count = 0\n    operators_count = 0\n    for char in expression:\n        if char.isdigit() or char.isalpha():\n            operands_count += 1\n        elif char in ['+', '-', '*', '/']:\n            operators_count += 1\n    return operands_count + operators_count\n", "entry_point": "count_elements_in_expression", "input": "'a+b'", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11983_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028242", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1399", "output": "{1, 1399}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1398", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028243", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 90, 85, 87, 82, 81, 76], 6", "output": "85.83333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12185_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028244", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9057", "output": "{1, 3, 9057, 3019}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9056", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028245", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3849", "output": "{1283, 1, 3, 3849}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3848", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028246", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5818", "output": "{1, 5818, 2, 2909}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5817", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028247", "code": "def calculate_bullet_position(initial_position, time_elapsed):\n    GRAVITY = 0.75\n    FPS = 60\n    updated_position = initial_position - (GRAVITY * time_elapsed / FPS)\n    return updated_position\n", "entry_point": "calculate_bullet_position", "input": "798.06875, 2.5", "output": "798.0375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49712_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028248", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4478", "output": "{1, 2, 4478, 2239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028249", "code": "def convert_to_html(text):\n    html_output = \"\"\n    lines = text.split('\\n')\n    for line in lines:\n        if line.startswith('* '):\n            html_output += f\"<li>{line[2:]}</li>\"\n        else:\n            line = line.replace('*', '<b>').replace('*', '</b>')\n            line = line.replace('_', '<i>').replace('_', '</i>')\n            line = line.replace('[', '<a href=\"').replace('](', '\">').replace(')', '</a>')\n            html_output += f\"<p>{line}</p>\"\n    return html_output\n", "entry_point": "convert_to_html", "input": "'texinformation.t'", "output": "'<p>texinformation.t</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137641_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028250", "code": "def add_index_to_element(arr):\n    result = []\n    for i, num in enumerate(arr):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[-1, 0, 4, 2, 2, 4]", "output": "[-1, 1, 6, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7397_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028251", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'v1.0.0'", "output": "'1.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028252", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7815", "output": "{1, 3, 5, 7815, 521, 2605, 15, 1563}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7814", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028253", "code": "def calculate_doge_sum(a):\n    total_sum = 0\n    for doge_str in a:\n        numeric_part = int(doge_str[4:])\n        total_sum += numeric_part\n    return total_sum\n", "entry_point": "calculate_doge_sum", "input": "['Doge1000']", "output": "1000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68959_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028254", "code": "def merge(left_array, right_array):\n    merged = []\n    left_pointer = right_pointer = 0\n    while left_pointer < len(left_array) and right_pointer < len(right_array):\n        if left_array[left_pointer] < right_array[right_pointer]:\n            merged.append(left_array[left_pointer])\n            left_pointer += 1\n        else:\n            merged.append(right_array[right_pointer])\n            right_pointer += 1\n    merged.extend(left_array[left_pointer:])\n    merged.extend(right_array[right_pointer:])\n    return merged\n", "entry_point": "merge", "input": "[2, 2, 3, 3, 4], [1, 2, 5, 6, 6, 6, 6]", "output": "[1, 2, 2, 2, 3, 3, 4, 5, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74073_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8205", "output": "{1, 3, 547, 5, 1641, 8205, 2735, 15}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028256", "code": "def similarity_func(str1: str, str2: str) -> int:\n    similarity_score = 0\n    for char1, char2 in zip(str1, str2):\n        similarity_score += abs(ord(char1) - ord(char2))\n    return similarity_score\n", "entry_point": "similarity_func", "input": "'abcdeh', 'pqrstb'", "output": "81", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146933_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028257", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "1004", "output": "504510", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028258", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9481", "output": "{1, 19, 9481, 499}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9480", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028259", "code": "def encrypt_string(input_string, key):\n    if not key:\n        return input_string\n    encrypted_chars = []\n    key_length = len(key)\n    for i, char in enumerate(input_string):\n        key_char = key[i % key_length]\n        shift = ord(key_char)\n        encrypted_char = chr((ord(char) + shift) % 256)\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_string", "input": "'\\x8f\\x8c\\x8c\\x9d\\x92\\x89\\x90\u00a4\\x96', 'A'", "output": "'\u00d0\u00cd\u00cd\u00de\u00d3\u00ca\u00d1\u00e5\u00d7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43650_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028260", "code": "def count_unique_chars(input_string):\n    char_count = {}\n    for char in input_string:\n        if char.islower() or char.isdigit():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_chars", "input": "'bbbaaaa'", "output": "{'b': 3, 'a': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139003_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028261", "code": "def calculate_version_upgrade(start_revision: str, end_revision: str) -> str:\n    start_parts = start_revision.split('.')\n    end_parts = end_revision.split('.')\n    upgrade_str = f'{start_revision} to {end_revision}'\n    for i in range(len(start_parts)):\n        if start_parts[i] != end_parts[i]:\n            upgrade_str = f'{start_revision} to {end_revision}'\n            break\n    return upgrade_str\n", "entry_point": "calculate_version_upgrade", "input": "'..2', '1.1111.5.0.2'", "output": "'..2 to 1.1111.5.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43303_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028262", "code": "from typing import List, Dict, Union\ndef filter_persons(data: List[Dict[str, Union[str, int]]], max_age: int, occupation: str) -> List[Dict[str, Union[str, int]]]:\n    filtered_persons = []\n    for person in data:\n        if person[\"age\"] <= max_age and person[\"occupation\"] == occupation:\n            filtered_persons.append(person)\n    return filtered_persons\n", "entry_point": "filter_persons", "input": "[], 30, 'Engineer'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78376_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028263", "code": "def filter_even_numbers(nums):\n    even_numbers = []\n    for num in nums:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 4, 3, 2, 4, 5, 2, 4]", "output": "[4, 2, 4, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6201_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028264", "code": "def fill_gaps(input_array):\n    def get_neighbors_avg(row, col):\n        neighbors = []\n        for r, c in [(row-1, col), (row+1, col), (row, col-1), (row, col+1)]:\n            if 0 <= r < len(input_array) and 0 <= c < len(input_array[0]) and input_array[r][c] != 'GAP':\n                neighbors.append(input_array[r][c])\n        return sum(neighbors) / len(neighbors) if neighbors else 0\n    output_array = [row[:] for row in input_array]  # Create a copy of the input array\n    for i in range(len(input_array)):\n        for j in range(len(input_array[0])):\n            if input_array[i][j] == 'GAP':\n                output_array[i][j] = get_neighbors_avg(i, j)\n    return output_array\n", "entry_point": "fill_gaps", "input": "[[], [], [], [], [], [], [], [], []]", "output": "[[], [], [], [], [], [], [], [], []]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131580_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028265", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[1, 1, 1, 3, 'a', 2.5]", "output": "{1: 3, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028266", "code": "def analyze_names(names):\n    name_counts = {}\n    for name in names:\n        name_counts[name] = name_counts.get(name, 0) + 1\n    sorted_names = sorted(name_counts.items(), key=lambda x: x[1], reverse=True)\n    top_names = [name for name, _ in sorted_names[:3]]\n    return {\"total_unique_names\": len(name_counts), \"top_names\": top_names}\n", "entry_point": "analyze_names", "input": "[]", "output": "{'total_unique_names': 0, 'top_names': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43866_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028267", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'fillback'", "output": "'fillback'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028268", "code": "from math import ceil\ndef find_shortest_waiting_time(earliest_time, bus_ids):\n    departure_times = {}\n    for bus_id in bus_ids:\n        wait = ceil(earliest_time / bus_id) * bus_id - earliest_time\n        departure_times[wait] = bus_id\n    shortest_wait = min(departure_times.keys())\n    return shortest_wait * departure_times[shortest_wait]\n", "entry_point": "find_shortest_waiting_time", "input": "3, [9, 12, 15]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112168_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028269", "code": "def update_did_chain_id(did, chain_id):\n    split_did = did.split(\"CHAIN_ID\")\n    split_did.insert(1, chain_id)  # Insert the new chain ID at index 1\n    uplink_did = \"\".join(split_did)  # Concatenate the split parts\n    return uplink_did\n", "entry_point": "update_did_chain_id", "input": "'acabcCCHAIN_IDdcabcCdff12132145', ''", "output": "'acabcCdcabcCdff12132145'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36047_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2089", "output": "{1, 2089}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2088", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028271", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[90, 97, -1]", "output": "93.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028272", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'ENV=development'", "output": "{'ENV': 'development'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028273", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1148", "output": "{1, 2, 4, 164, 7, 41, 28, 14, 82, 1148, 574, 287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1147", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028274", "code": "# Define the function to calculate total retry time\ndef calculate_total_retry_time(retry_count, retry_wait):\n    total_retry_time = retry_count * retry_wait\n    return total_retry_time\n", "entry_point": "calculate_total_retry_time", "input": "3, 5", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118261_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028275", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'naamveng_column_name_that_exceeds_t'", "output": "'naamveng_column_name_that_exceeds_t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028276", "code": "from collections.abc import Iterable\ndef as_iterable(object) -> Iterable:\n    if isinstance(object, Iterable):\n        return object\n    else:\n        return [object]\n", "entry_point": "as_iterable", "input": "0", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40333_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028277", "code": "def get_common_prefix(str1, str2):\n    common_prefix = \"\"\n    min_len = min(len(str1), len(str2))\n    for i in range(min_len):\n        if str1[i] == str2[i]:\n            common_prefix += str1[i]\n        else:\n            break\n    return common_prefix\n", "entry_point": "get_common_prefix", "input": "'car', 'care'", "output": "'car'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41977_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028278", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2406", "output": "{1, 2, 3, 802, 2406, 6, 401, 1203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028279", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(59, 50, 51, 9, 61, 40, 50)", "output": "(50, 40, 61, 9, 51, 50, 59)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028280", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 3.25, 1.0", "output": "3.575", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028281", "code": "RACK_SIZE_PX = 20\nMARGIN_HEIGHT = 2\ndef calculate_rack_height(units):\n    if units <= 0:\n        return 0\n    margin = (units - 1) * MARGIN_HEIGHT\n    return units * RACK_SIZE_PX + margin\n", "entry_point": "calculate_rack_height", "input": "3", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17751_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2572", "output": "{1, 2, 643, 4, 1286, 2572}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2571", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028283", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4297", "output": "{1, 4297}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028284", "code": "def digit_sum_transform(numbers):\n    def calculate_digit_sum(num):\n        return sum(int(digit) for digit in str(num))\n    result = [calculate_digit_sum(num) for num in numbers]\n    return result\n", "entry_point": "digit_sum_transform", "input": "[14, 24, 2, 13, 16]", "output": "[5, 6, 2, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27427_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028285", "code": "def calculate_avg_instances_per_fold(instances_num, folds_num):\n    return instances_num // folds_num\n", "entry_point": "calculate_avg_instances_per_fold", "input": "32, 2", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36670_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028286", "code": "import math\ndef calculate_line_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i][\"x\"], points[i][\"y\"]\n        x2, y2 = points[i + 1][\"x\"], points[i + 1][\"y\"]\n        distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n        total_length += distance\n    return total_length\n", "entry_point": "calculate_line_length", "input": "[{'x': 0, 'y': 0}, {'x': 3, 'y': 4}]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142229_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028287", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    total_score = sum(scores)\n    average_score = total_score / len(scores)\n    return round(average_score, 2)\n", "entry_point": "calculate_average_score", "input": "[70, 75, 76, 76]", "output": "74.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143012_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028288", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'worhel'", "output": "{'worhel': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028289", "code": "def capitalize_first_letter(words):\n    capitalized_words = []\n    for word in words:\n        capitalized_words.append(word[0].capitalize() + word[1:])\n    return capitalized_words\n", "entry_point": "capitalize_first_letter", "input": "['cy', 'ccrrycc', 'cy', 'ccherryc']", "output": "['Cy', 'Ccrrycc', 'Cy', 'Ccherryc']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028290", "code": "def circular_sum(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, -1, 0, 5, 0, -1, 4]", "output": "[2, -1, 5, 5, -1, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148378_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028291", "code": "def extract_package_versions(package_list):\n    package_versions = {}\n    for package_str in package_list:\n        package_name, version = package_str.split('=')\n        package_versions[package_name] = version\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "['matpnutlib=3.1']", "output": "{'matpnutlib': '3.1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27939_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9119", "output": "{1, 11, 829, 9119}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9118", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028293", "code": "import re\ndef calculate_real_length(string):\n    length = 0\n    for char in string:\n        if re.search(\"^[a-zA-Z\\*\\!\\?]$\", char):\n            length += 1\n        else:\n            length += 2\n    return length\n", "entry_point": "calculate_real_length", "input": "'abcde'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41828_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028294", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'randomString_parpart12.txt'", "output": "'parpart12.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028295", "code": "from warnings import warn\ntry:\n    import scipy\n    enable_sparse = True\nexcept ImportError:\n    enable_sparse = False\n    warn(\"SciPy can't be imported. Sparse matrix support is disabled.\")\ndef process_numbers(numbers):\n    result = 0 if enable_sparse else 1  # Initialize result based on SciPy import status\n    for num in numbers:\n        if enable_sparse:\n            result += num  # Sum numbers if SciPy is imported\n        else:\n            result *= num  # Multiply numbers if SciPy is not imported\n    return result\n", "entry_point": "process_numbers", "input": "[3, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80798_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028296", "code": "def calculate_total_score(level_scores):\n    total_score = 0\n    for level, score in level_scores.items():\n        total_score += score\n    return total_score\n", "entry_point": "calculate_total_score", "input": "{'level1': 200, 'level2': 150, 'level3': 296}", "output": "646", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76175_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028297", "code": "def get_elem_symbol(element_str):\n    parts = element_str.split('-')\n    if len(parts) != 2 or not parts[1].isdigit():\n        raise ValueError(\"Invalid input format\")\n    element_name = ''.join(filter(str.isalpha, parts[0]))\n    if not element_name:\n        raise ValueError(\"Invalid element name\")\n    return element_name.capitalize()\n", "entry_point": "get_elem_symbol", "input": "'fef-123'", "output": "'Fef'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10254_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028298", "code": "from typing import List\ndef lift_simulation(people: int, lift: List[int]) -> str:\n    if people <= 0 and sum(lift) % 4 != 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people > 0:\n        return f\"There isn't enough space! {people} people in a queue!\\n\" + ' '.join(map(str, lift))\n    elif people <= 0 and sum(lift) == 0:\n        return \"The lift has empty spots!\\n\" + ' '.join(map(str, lift))\n    elif sum(lift) % 4 == 0 and people <= 0:\n        return ' '.join(map(str, lift))\n", "entry_point": "lift_simulation", "input": "0, [1, 1, 1]", "output": "'The lift has empty spots!\\n1 1 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147066_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028299", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "22", "output": "0.01909090909090909", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028300", "code": "import math\ndef calculate_rms(numbers):\n    if not numbers:\n        return None  # Handle empty input list\n    sum_of_squares = sum(num ** 2 for num in numbers)\n    mean_square = sum_of_squares / len(numbers)\n    rms = math.sqrt(mean_square)\n    return rms\n", "entry_point": "calculate_rms", "input": "[9, 0, 0]", "output": "5.196152422706632", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028301", "code": "def map_styles_to_bjcp_categories(styles):\n    style_to_bjcp_mapping = {\n        'IPA': '21A',\n        'Stout': '16A',\n        'Pilsner': '2B'\n    }\n    result = {}\n    for style in styles:\n        if style in style_to_bjcp_mapping:\n            result[style] = style_to_bjcp_mapping[style]\n    return result\n", "entry_point": "map_styles_to_bjcp_categories", "input": "['Lager', 'Sour Ale']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114929_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028302", "code": "def validate_http_methods(http_methods):\n    ALLOWED_HTTP_METHODS = frozenset(('GET', 'POST', 'PUT', 'DELETE', 'PATCH'))\n    valid_methods = [method for method in http_methods if method in ALLOWED_HTTP_METHODS]\n    return valid_methods\n", "entry_point": "validate_http_methods", "input": "['GET', 'POST', 'PUT', 'DELETE']", "output": "['GET', 'POST', 'PUT', 'DELETE']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92929_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028303", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9671", "output": "{1, 19, 509, 9671}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9670", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028304", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<john.doe@eoh>'", "output": "('john.doe@eoh', 'eoh')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028305", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch > 9:\n        patch = 0\n        minor += 1\n        if minor > 9:\n            minor = 0\n            major += 1\n    return f'{major}.{minor}.{patch}'\n", "entry_point": "increment_version", "input": "'33.9.9'", "output": "'34.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58418_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028306", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N] if N <= len(scores) else sorted_scores\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 91, 92, 92, 91], 5", "output": "91.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122471_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028307", "code": "def calculate_even_sum(numbers):\n    even_sum = sum(num for num in numbers if num % 2 == 0)\n    return even_sum\n", "entry_point": "calculate_even_sum", "input": "[10, 10]", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38409_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028308", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "11", "output": "66", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9223", "output": "{1, 401, 23, 9223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028310", "code": "def accum(s):\n    modified_chars = []\n    for i, char in enumerate(s):\n        modified_chars.append((char.upper() + char.lower() * i))\n    return '-'.join(modified_chars)\n", "entry_point": "accum", "input": "'Emm'", "output": "'E-Mm-Mmm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97323_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028311", "code": "def calculate_moving_average(nums, k):\n    moving_averages = []\n    for i in range(len(nums) - k + 1):\n        window_sum = sum(nums[i:i+k])\n        moving_averages.append(window_sum / k)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[1.0, 2.0, 3.0, 4.0, 5.0], 3", "output": "[2.0, 3.0, 4.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143205_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028312", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "779", "output": "{19, 1, 779, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt778", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028313", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "-65, 5, 'ooofofofofooooo'", "output": "{'ooofofofofooooo': -325}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028314", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[3, 3, 3, 2, 2, 2, -3, -4, 1]", "output": "{3: 3, 2: 3, -3: 1, -4: 1, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028315", "code": "def extract_char_frequencies(input_string: str) -> dict:\n    char_freq = {}\n    for char in input_string:\n        if char in char_freq:\n            char_freq[char] += 1\n        else:\n            char_freq[char] = 1\n    return char_freq\n", "entry_point": "extract_char_frequencies", "input": "'helo'", "output": "{'h': 1, 'e': 1, 'l': 1, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5034_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028316", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1586", "output": "{1, 2, 26, 13, 1586, 793, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7857", "output": "{1, 97, 3, 291, 27, 9, 873, 7857, 81, 2619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028318", "code": "def convert_hungarian_days(input_string):\n    days_mapping = {\n        \"h\u00e9tf\u0151\": \"Monday\",\n        \"kedd\": \"Tuesday\",\n        \"szerda\": \"Wednesday\",\n        \"cs\u00fct\u00f6rt\u00f6k\": \"Thursday\",\n        \"p\u00e9ntek\": \"Friday\",\n        \"szombat\": \"Saturday\",\n        \"vas\u00e1rnap\": \"Sunday\"\n    }\n    for hungarian_day, english_day in days_mapping.items():\n        input_string = input_string.replace(hungarian_day, english_day)\n        input_string = input_string.replace(hungarian_day.capitalize(), english_day)\n    return input_string\n", "entry_point": "convert_hungarian_days", "input": "'hho\u00e9s'", "output": "'hho\u00e9s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101349_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028319", "code": "def calculate_banknotes(valor):\n    valores = [50, 20, 10, 1]\n    banknotes_count = {}\n    for i in valores:\n        banknotes_count[i] = valor // i\n        valor %= i\n    return banknotes_count\n", "entry_point": "calculate_banknotes", "input": "97", "output": "{50: 1, 20: 2, 10: 0, 1: 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101501_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028320", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9319", "output": "{1, 9319}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9318", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028321", "code": "from typing import List, Tuple\nimport importlib\ndef check_packages(packages: List[str]) -> Tuple[bool, List[str]]:\n    failed_packages = []\n    for package in packages:\n        try:\n            importlib.import_module(package)\n        except ImportError:\n            failed_packages.append(package)\n    return len(failed_packages) == 0, failed_packages\n", "entry_point": "check_packages", "input": "['os', 'sys']", "output": "(True, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92784_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028322", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1221", "output": "{1, 33, 3, 1221, 37, 11, 111, 407}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1220", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028323", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "417", "output": "{3, 1, 417, 139}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028324", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7435", "output": "{1, 7435, 5, 1487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028325", "code": "import re\ndef clean_slug(value, separator=None):\n    if separator == '-' or separator is None:\n        re_sep = '-'\n    else:\n        re_sep = '(?:-|%s)' % re.escape(separator)\n    value = re.sub(r'^%s+|%s+$' % (re_sep, re_sep), '', value)\n    if separator:\n        value = re.sub('%s+' % re_sep, separator, value)\n    return value\n", "entry_point": "clean_slug", "input": "'hello++++worl++++hedd'", "output": "'hello++++worl++++hedd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141562_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028326", "code": "def classify_superheroes(powers):\n    good_superheroes = []\n    evil_superheroes = []\n    total_good_power = 0\n    total_evil_power = 0\n    for power in powers:\n        if power > 0:\n            good_superheroes.append(power)\n            total_good_power += power\n        else:\n            evil_superheroes.append(power)\n            total_evil_power += power\n    return good_superheroes, evil_superheroes, total_good_power, total_evil_power\n", "entry_point": "classify_superheroes", "input": "[6, 7, 6, 7, 6, -1, -13, 0]", "output": "([6, 7, 6, 7, 6], [-1, -13, 0], 32, -14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7614_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028327", "code": "def character_frequency(input_string):\n    freq_dict = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            if char in freq_dict:\n                freq_dict[char] += 1\n            else:\n                freq_dict[char] = 1\n    return freq_dict\n", "entry_point": "character_frequency", "input": "'world'", "output": "{'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65596_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028328", "code": "def longest_increasing_subsequence(nums):\n    if not nums:\n        return []\n    n = len(nums)\n    dp = [1] * n\n    for i in range(1, n):\n        for j in range(i):\n            if nums[i] > nums[j]:\n                dp[i] = max(dp[i], dp[j] + 1)\n    max_length = max(dp)\n    max_index = dp.index(max_length)\n    result = [nums[max_index]]\n    current_length = max_length - 1\n    for i in range(max_index - 1, -1, -1):\n        if dp[i] == current_length and nums[i] < result[-1]:\n            result.append(nums[i])\n            current_length -= 1\n    return result[::-1]\n", "entry_point": "longest_increasing_subsequence", "input": "[3, 10]", "output": "[3, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9591_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028329", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[99, 92, 88]", "output": "[99, 92, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51944_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028330", "code": "def calculate_name_value(name):\n    alphavalue = sum(ord(char) - 64 for char in name)\n    return alphavalue\n", "entry_point": "calculate_name_value", "input": "'X'", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140001_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8751", "output": "{1, 3, 2917, 8751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028332", "code": "def extract_platform_names(platforms):\n    platform_names = []\n    for platform in platforms:\n        if isinstance(platform, tuple):\n            platform_names.append(platform[0])\n        else:\n            platform_names.append(platform)\n    return platform_names\n", "entry_point": "extract_platform_names", "input": "['ZARA', 'H&M', 'ASOS', 'MANGO']", "output": "['ZARA', 'H&M', 'ASOS', 'MANGO']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14241_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028333", "code": "def process_buttons(buttons):\n    if buttons is None:\n        return None\n    try:\n        if buttons.SUBCLASS_OF_ID == 0xe2e10ef2:\n            return buttons\n    except AttributeError:\n        pass\n    if not isinstance(buttons, list):\n        buttons = [[buttons]]\n    elif not isinstance(buttons[0], list):\n        buttons = [buttons]\n    is_inline = False\n    is_normal = False\n    rows = []\n    return buttons, is_inline, is_normal, rows\n", "entry_point": "process_buttons", "input": "[[3, 2, 2, 3, 3, 2]]", "output": "([[3, 2, 2, 3, 3, 2]], False, False, [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147264_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028334", "code": "def calculate_enum_union(enum_list):\n    enum_union = 0\n    for enum in enum_list:\n        enum_union |= enum\n    return enum_union\n", "entry_point": "calculate_enum_union", "input": "[1, 2, 4]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43521_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6773", "output": "{1, 13, 6773, 521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6772", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028336", "code": "from typing import List, Dict, Union\ndef process_faq_entries(entries: List[Dict[str, Union[int, str]]], threshold: int) -> List[Dict[str, Union[int, str]]]:\n    filtered_entries = [entry for entry in entries if entry['views'] >= threshold]\n    sorted_entries = sorted(filtered_entries, key=lambda x: len(x['question']), reverse=True)\n    processed_entries = [{'id': entry['id'], 'question': entry['question'], 'answer': entry['answer']} for entry in sorted_entries]\n    return processed_entries\n", "entry_point": "process_faq_entries", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69045_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028337", "code": "import json\ndef execute_and_format_result(input_data):\n    try:\n        result = eval(input_data)\n        if type(result) in [list, dict]:\n            return json.dumps(result, indent=4)\n        else:\n            return result\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "execute_and_format_result", "input": "'[1, 2, 2]'", "output": "'[\\n    1,\\n    2,\\n    2\\n]'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97741_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028338", "code": "def jaccard_index(set1, set2):\n    intersection_size = len(set1 & set2)\n    union_size = len(set1 | set2)\n    if union_size == 0:\n        return 0.00\n    else:\n        jaccard = intersection_size / union_size\n        return round(jaccard, 2)\n", "entry_point": "jaccard_index", "input": "{1, 2}, {1, 2, 3, 4, 5}", "output": "0.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9565_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028339", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2866", "output": "{1, 2866, 2, 1433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028340", "code": "def longest_substring_with_k_distinct(s, k):\n    left = 0\n    right = 0\n    letters = [0] * 26\n    maxnum = 0\n    result = 0\n    for per in s:\n        id_ = ord(per) - ord(\"A\")\n        letters[id_] += 1\n        maxnum = max(maxnum, letters[id_])\n        while right - left + 1 - maxnum > k:\n            letters[ord(s[left]) - ord(\"A\")] -= 1\n            left += 1\n        result = max(result, right - left + 1)\n        right += 1\n    return result\n", "entry_point": "longest_substring_with_k_distinct", "input": "'', 0", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140789_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028341", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6668", "output": "{1, 2, 1667, 4, 3334, 6668}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6667", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028342", "code": "def evaluate_expression(expression):\n    tokens = []\n    current_token = ''\n    for char in expression:\n        if char.isdigit():\n            current_token += char\n        else:\n            if current_token:\n                tokens.append(int(current_token))\n                current_token = ''\n            if char in ['+', '-']:\n                tokens.append(char)\n    if current_token:\n        tokens.append(int(current_token))\n    result = tokens[0]\n    operator = None\n    for token in tokens[1:]:\n        if token in ['+', '-']:\n            operator = token\n        else:\n            if operator == '+':\n                result += token\n            elif operator == '-':\n                result -= token\n    return result\n", "entry_point": "evaluate_expression", "input": "'30 + 5'", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132846_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028343", "code": "from typing import List\ndef sum_non_diagonal(matrix: List[List[int]]) -> int:\n    sum_non_diag = 0\n    n = len(matrix)\n    for i in range(n):\n        for j in range(n):\n            if i != j:  # Check if the element is not on the diagonal\n                sum_non_diag += matrix[i][j]\n    return sum_non_diag\n", "entry_point": "sum_non_diagonal", "input": "[[0, 1, 2], [3, 0, 4], [1, 2, 0]]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54102_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028344", "code": "def execute_program(program):\n    regs = {}\n    largest_seen = None\n    for line in program:\n        reg, op, val, _, cond_reg, cond_op, cond_val = line.split()\n        val = int(val)\n        cond_val = int(cond_val)\n        if cond_reg not in regs:\n            regs[cond_reg] = 0\n        if eval(f\"{regs.get(cond_reg, 0)} {cond_op} {cond_val}\"):\n            if reg not in regs:\n                regs[reg] = 0\n            if op == \"inc\":\n                regs[reg] += val\n            elif op == \"dec\":\n                regs[reg] -= val\n            if largest_seen is None or regs[reg] > largest_seen:\n                largest_seen = regs[reg]\n    return largest_seen\n", "entry_point": "execute_program", "input": "['x inc 50 if x < 100', 'x inc 50 if x == 50']", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128619_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028345", "code": "def get_file_name(language: str) -> str:\n    file_names = {\n        'java': 'Main.java',\n        'c': 'main.c',\n        'cpp': 'main.cpp',\n        'python': 'main.py',\n        'js': 'main.js'\n    }\n    return file_names.get(language, 'Unknown')\n", "entry_point": "get_file_name", "input": "'python'", "output": "'main.py'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108385_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028346", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'bbbbbbbacccc'", "output": "'b7a1c4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028347", "code": "import sys\nDEFAULT_SERVER_UPTIME = 21 * 24 * 60 * 60\nMIN_SERVER_UPTIME = 1 * 24 * 60 * 60\nDEFAULT_MAX_APP_LEASE = 7 * 24 * 60 * 60\nDEFAULT_THRESHOLD = 0.9\ndef calculate_total_uptime(lease_durations):\n    total_uptime = 0\n    for lease_duration in lease_durations:\n        server_uptime = min(max(lease_duration, MIN_SERVER_UPTIME), DEFAULT_MAX_APP_LEASE)\n        total_uptime += server_uptime\n    return total_uptime\n", "entry_point": "calculate_total_uptime", "input": "[604800, 86400]", "output": "691200", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10263_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028348", "code": "def max_non_overlapping_movies(movies):\n    movies.sort(key=lambda x: x[1])  # Sort movies based on end day\n    count = 0\n    prev_end = -1\n    for movie in movies:\n        if movie[0] >= prev_end:\n            count += 1\n            prev_end = movie[1]\n    return count\n", "entry_point": "max_non_overlapping_movies", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64823_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028349", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5806", "output": "{1, 2, 5806, 2903}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028350", "code": "def calculate_parlay_payout(odds):\n    \"\"\"\n    Calculate the potential payout for a parlay bet based on the provided odds.\n    :param odds: List. A list of odds for individual wagers in decimal format.\n    :return: Potential payout for the parlay bet in decimal terms.\n    \"\"\"\n    payout = 1\n    for odd in odds:\n        payout *= odd\n    return payout\n", "entry_point": "calculate_parlay_payout", "input": "[2.0, 2.7]", "output": "5.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15672_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9518", "output": "{1, 2, 9518, 4759}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9517", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028352", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'htthtxample.chm', '111111/de1/de1'", "output": "'htthtxample.chm/111111/de1/de1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028353", "code": "def detect_anomalies(progress_data):\n    anomalies = []\n    for i in range(1, len(progress_data)):\n        percentage_change = (progress_data[i] - progress_data[i-1]) / progress_data[i-1] * 100\n        if abs(percentage_change) >= 20:\n            anomalies.append((i, progress_data[i], progress_data[i-1]))\n    return anomalies\n", "entry_point": "detect_anomalies", "input": "[11, 11, 44]", "output": "[(2, 44, 11)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142857_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2362", "output": "{1, 2362, 2, 1181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2361", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028355", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "7", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028356", "code": "def sum_of_positive_squares(nums):\n    total = 0\n    for num in nums:\n        if num > 0:\n            total += num ** 2\n    return total\n", "entry_point": "sum_of_positive_squares", "input": "[9, 1]", "output": "82", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125624_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028357", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[92, 89, 87, 75, 89, 80]", "output": "[92, 89, 87]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028358", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 0, 1, 3, 1, 4, 3]", "output": "[2, 1, 4, 4, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028359", "code": "def count_word_frequency(text: str) -> dict:\n    # Remove punctuation marks\n    text = ''.join(char for char in text if char.isalnum() or char.isspace())\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Count word frequency\n    word_freq = {}\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'hello hello world'", "output": "{'hello': 2, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65881_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028360", "code": "from collections import deque\ndef execute_tasks(tasks):\n    total_time = 0\n    queue = deque()\n    for task in tasks:\n        wait_time = task[\"task_id\"] - (total_time % task[\"task_id\"])\n        if wait_time == 0:\n            total_time += task[\"execution_time\"]\n        else:\n            queue.append((task, wait_time))\n    while queue:\n        task, wait_time = queue.popleft()\n        total_time += wait_time + task[\"execution_time\"]\n        for queued_task in queue:\n            queued_task = (queued_task[0], queued_task[1] - wait_time)\n    return total_time\n", "entry_point": "execute_tasks", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144407_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028361", "code": "def process_allowed_chats(allowed_chats: str) -> set[int]:\n    if allowed_chats == '':\n        return set()\n    chat_ids = allowed_chats.split(',')\n    chat_ids = set(map(int, chat_ids))\n    return chat_ids\n", "entry_point": "process_allowed_chats", "input": "'112'", "output": "{112}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135413_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028362", "code": "from typing import List\ndef get_filter_list(filter_header: str) -> List[str]:\n    if filter_header is None:\n        return []\n    filters = [item.strip() for item in filter_header.rstrip(\",\").split(\",\")]\n    return filters\n", "entry_point": "get_filter_list", "input": "'err,'", "output": "['err']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127466_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028363", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "57, ['59', 'x', 'x']", "output": "118", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028364", "code": "def calculate_regression_coefficients(x, y):\n    if len(x) != len(y):\n        raise ValueError(\"Input lists x and y must have the same length\")\n    n = len(x)\n    mean_x = sum(x) / n\n    mean_y = sum(y) / n\n    SS_xx = sum((xi - mean_x) ** 2 for xi in x)\n    SS_xy = sum((xi - mean_x) * (yi - mean_y) for xi, yi in zip(x, y))\n    b_1 = SS_xy / SS_xx if SS_xx != 0 else 0  # Avoid division by zero\n    b_0 = mean_y - b_1 * mean_x\n    return b_0, b_1\n", "entry_point": "calculate_regression_coefficients", "input": "[1, 2, 3], [-4, -3, -2]", "output": "(-5.0, 1.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83034_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028365", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'some.other.prefix.ttsttsigConfig'", "output": "'ttsttsig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028366", "code": "def calculate_average_excluding_negatives(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return round(sum_positive / count_positive, 2)\n", "entry_point": "calculate_average_excluding_negatives", "input": "[9.0, 8.0, 9.01, -2, -3]", "output": "8.67", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140194_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028367", "code": "from typing import List\ndef generate_unique_id(description: str, group: str, includes: List[str]) -> str:\n    # Convert description, group, and includes to lowercase\n    description = description.lower()\n    group = group.lower()\n    includes = [inc.lower() for inc in includes]\n    # Replace spaces in description with underscores\n    description = description.replace(' ', '_')\n    # Concatenate the lowercase description, group, and includes with underscores\n    unique_id = '_'.join([description, group] + includes)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'setup', 'basic', ['basic']", "output": "'setup_basic_basic'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31992_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028368", "code": "import re\ndef repair_move_path(path: str) -> str:\n    # Define a regular expression pattern to match elements like '{org=>com}'\n    FILE_PATH_RENAME_RE = re.compile(r'\\{([^}]+)=>([^}]+)\\}')\n    # Replace the matched elements with the desired format using re.sub\n    return FILE_PATH_RENAME_RE.sub(r'\\2', path)\n", "entry_point": "repair_move_path", "input": "'/dirfile.d/{d=>c}'", "output": "'/dirfile.d/c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137172_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028369", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8504", "output": "{1, 2, 4, 1063, 8, 2126, 8504, 4252}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8503", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028370", "code": "def iterative_sum(n):\n    sum_total = 0\n    for i in range(1, n+1):\n        sum_total += i\n    return sum_total\n", "entry_point": "iterative_sum", "input": "6", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18877_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3205", "output": "{1, 5, 641, 3205}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028372", "code": "def extract_major_version(version: str) -> int:\n    try:\n        major_version = int(version.split('.')[0])\n        return major_version\n    except (ValueError, IndexError):\n        return -1\n", "entry_point": "extract_major_version", "input": "'9.0'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140809_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5611", "output": "{1, 5611, 181, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028374", "code": "def extract_app_name(default_app_config):\n    # Split the input string using dot as the delimiter\n    config_parts = default_app_config.split('.')\n    # Extract the app name from the first part\n    app_name = config_parts[0]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'django_migo_migra.apps'", "output": "'django_migo_migra'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64209_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028375", "code": "def file_management(file_operations):\n    existing_files = set()\n    for operation, file_name in file_operations:\n        if operation == \"create\" and file_name not in existing_files:\n            existing_files.add(file_name)\n        elif operation == \"delete\" and file_name in existing_files:\n            existing_files.remove(file_name)\n    return existing_files\n", "entry_point": "file_management", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105953_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028376", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1022", "output": "b'\\x00\\x00\\x03\\xfe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1090", "output": "{1, 1090, 2, 545, 5, 10, 109, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1089", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028378", "code": "from typing import List\ndef most_frequent_item_id(item_ids: List[int]) -> int:\n    frequency = {}\n    for item_id in item_ids:\n        frequency[item_id] = frequency.get(item_id, 0) + 1\n    max_frequency = max(frequency.values())\n    most_frequent_ids = [item_id for item_id, freq in frequency.items() if freq == max_frequency]\n    return min(most_frequent_ids)\n", "entry_point": "most_frequent_item_id", "input": "[3, 3, 3, 1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7393_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028379", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'COLOON::'", "output": "('COLOON', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028380", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3994", "output": "{1, 3994, 2, 1997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3993", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028381", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3274", "output": "{1, 3274, 2, 1637}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3273", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028382", "code": "import struct\nMESSENGER_STATE_COOKIE_TYPE = 123  # Example value, replace with actual value\nPUBLIC_KEY_LENGTH = 64  # Example value, replace with actual value\nPRIVATE_KEY_LENGTH = 32  # Example value, replace with actual value\ndef make_subheader(h_type, h_length):\n    return (\n        struct.pack(\"<I\", h_length) +\n        struct.pack(\"<H\", h_type) +\n        struct.pack(\"<H\", MESSENGER_STATE_COOKIE_TYPE)\n    )\n", "entry_point": "make_subheader", "input": "3, 11", "output": "b'\\x0b\\x00\\x00\\x00\\x03\\x00{\\x00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113482_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028383", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "478", "output": "{1, 2, 478, 239}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028384", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028385", "code": "def add_index_to_element(input_list):\n    output_list = []\n    for index, element in enumerate(input_list):\n        output_list.append(element + index)\n    return output_list\n", "entry_point": "add_index_to_element", "input": "[1, 4, 6, 4, 2, 7, 5, 6, 6]", "output": "[1, 5, 8, 7, 6, 12, 11, 13, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5500_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028386", "code": "def flexible_sum(*args):\n    if len(args) < 3:\n        args += (30, 40)[len(args):]  # Assign default values if fewer than 3 arguments provided\n    return sum(args)\n", "entry_point": "flexible_sum", "input": "60, 70, 20", "output": "150", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74466_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028387", "code": "def analyze_title(title, max_length):\n    violations = []\n    if not title:\n        violations.append(\"1: B6 Body message is missing\")\n    else:\n        if len(title) > max_length:\n            violations.append(f\"1: T1 Title exceeds max length ({len(title)}>{max_length}): \\\"{title}\\\"\")\n        if title[-1] in ['.', '!', '?']:\n            violations.append(f\"1: T3 Title has trailing punctuation ({title[-1]}): \\\"{title}\\\"\")\n    return '\\n'.join(violations)\n", "entry_point": "analyze_title", "input": "'Tahaaa', 4", "output": "'1: T1 Title exceeds max length (6>4): \"Tahaaa\"'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140551_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028388", "code": "import math\ndef process_coordinates(coordinates):\n    if len(coordinates) % 2 != 0:\n        raise ValueError(\"Coordinates list should have an even number of elements\")\n    processed_coordinates = []\n    for i in range(0, len(coordinates), 2):\n        x, y = coordinates[i], coordinates[i + 1]\n        distance = round(math.sqrt(x**2 + y**2))\n        processed_coordinates.append(distance)\n    return processed_coordinates\n", "entry_point": "process_coordinates", "input": "[5, 12, 8, 15, 6, 8, 0, 8]", "output": "[13, 17, 10, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54422_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028389", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6843", "output": "{3, 1, 6843, 2281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028390", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[10, 6, 10]", "output": "600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028391", "code": "from typing import List\ndef calculate_sum_and_max_odd(numbers: List[int]) -> int:\n    even_sum = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return even_sum * max_odd\n", "entry_point": "calculate_sum_and_max_odd", "input": "[0, 2, 99]", "output": "198", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2830_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028392", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i-1][j] + dp[i][j-1]\n    return dp[m-1][n-1]\n", "entry_point": "unique_paths", "input": "6, 7", "output": "462", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99400_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028393", "code": "def calculate_transaction_fee(gas_amount, gas_prices):\n    total_fee = 0\n    for gas_price in gas_prices:\n        fee = gas_amount * gas_price[\"amount\"]\n        total_fee += fee\n    return total_fee\n", "entry_point": "calculate_transaction_fee", "input": "1000.0, [{'amount': 12.0}, {'amount': 24.0}]", "output": "36000.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91952_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028394", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3071", "output": "{1, 83, 37, 3071}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028395", "code": "def calculate_average_score(scores: list) -> float:\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[85, 84, 86, 84, 84.125]", "output": "84.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100039_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8081", "output": "{1, 8081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028397", "code": "import re\n# Provided stopwords set\nstopwords = set([\"thank\", \"you\", \"the\", \"please\", \"me\", \"her\", \"his\", \"will\", \"just\", \"myself\", \"ourselves\", \"I\", \"yes\"])\n# Provided regular expression pattern for splitting\nspliter = re.compile(\"([#()!><])\")\ndef process_text(text):\n    tokens = []\n    for token in spliter.split(text):\n        token = token.strip()\n        if token and token not in stopwords:\n            tokens.append(token)\n    return tokens\n", "entry_point": "process_text", "input": "'wliggift ! i'", "output": "['wliggift', '!', 'i']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45433_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028398", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "42", "output": "{'int': '42'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028399", "code": "def calculate_average(numbers):\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    if count_positive == 0:\n        return 0\n    else:\n        return sum_positive / count_positive\n", "entry_point": "calculate_average", "input": "[6, 6, 6.5]", "output": "6.166666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67796_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028400", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'ttitle'", "output": "'ttitle'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6202", "output": "{1, 2, 7, 14, 886, 6202, 443, 3101}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6201", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028402", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[1, 1, 1, 1, 2]", "output": "[2, 2, 2, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028403", "code": "def last(arr, n):\n    if n > len(arr):\n        return 'invalid'\n    elif n == 0:\n        return []\n    return arr[len(arr) - n:]\n", "entry_point": "last", "input": "[1, 2, 3, 4, 9, 9, 9, 9], 4", "output": "[9, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31110_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028404", "code": "def process_integers(int_list):\n    processed_list = []\n    for num in int_list:\n        if num < 0:\n            num = abs(num)\n        if num % 2 == 0:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_integers", "input": "[4, 6, 7, 2, 2, 4, 4, 1, 4]", "output": "[16, 36, 343, 4, 4, 16, 16, 1, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45144_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028405", "code": "import collections\ndef rearrange_string(s: str, k: int) -> str:\n    res = []\n    d = collections.defaultdict(int)\n    # Count the frequency of each character\n    for c in s:\n        d[c] += 1\n    v = collections.defaultdict(int)\n    for i in range(len(s)):\n        c = None\n        for key in d:\n            if (not c or d[key] > d[c]) and d[key] > 0 and v[key] <= i + k:\n                c = key\n        if not c:\n            return ''\n        res.append(c)\n        d[c] -= 1\n        v[c] = i + k\n    return ''.join(res)\n", "entry_point": "rearrange_string", "input": "'aaab', 2", "output": "'aaab'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4736_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028406", "code": "def determine_movement_direction(keys):\n    if keys[0]:  # UP key pressed\n        return \"UP\"\n    elif keys[1]:  # DOWN key pressed\n        return \"DOWN\"\n    elif keys[2]:  # LEFT key pressed\n        return \"LEFT\"\n    elif keys[3]:  # RIGHT key pressed\n        return \"RIGHT\"\n    else:\n        return \"STAY\"\n", "entry_point": "determine_movement_direction", "input": "[True, False, False, False]", "output": "'UP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103609_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028407", "code": "def max_subset_sum_non_adjacent(arr):\n    incl = 0\n    excl = 0\n    for i in arr:\n        new_excl = max(incl, excl)  # Calculate the new value for excl\n        incl = excl + i  # Update incl to be excl + current element\n        excl = new_excl  # Update excl for the next iteration\n    return max(incl, excl)  # Return the maximum of incl and excl\n", "entry_point": "max_subset_sum_non_adjacent", "input": "[5, 10, 5, 8]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143195_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028408", "code": "def calculate_point_averages(points):\n    if not points:\n        return (0, 0)\n    sum_x = sum(point[0] for point in points)\n    sum_y = sum(point[1] for point in points)\n    avg_x = sum_x / len(points)\n    avg_y = sum_y / len(points)\n    return (avg_x, avg_y)\n", "entry_point": "calculate_point_averages", "input": "[(3.0, 4.0)]", "output": "(3.0, 4.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89551_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028409", "code": "def calculate_balance(transactions):\n    balance = 0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'deposit':\n            balance += amount\n        elif transaction_type == 'withdrawal':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('deposit', 1000), ('withdrawal', 200)]", "output": "800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34188_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028410", "code": "def generate_file_path(agent: str, energy: str) -> str:\n    top_path = './experiments_results/gym/' + agent + '/'\n    if 'Energy0' in energy:\n        ene_sub = '_E0'\n    elif 'EnergyOne' in energy:\n        ene_sub = '_E1'\n    if agent == 'HalfCheetah':\n        abrv = 'HC'\n    elif agent == 'HalfCheetahHeavy':\n        abrv = 'HCheavy'\n    elif agent == 'FullCheetah':\n        abrv = 'FC'\n    else:\n        abrv = agent\n    return top_path + abrv + ene_sub\n", "entry_point": "generate_file_path", "input": "'HalfCheetah', 'Energy0'", "output": "'./experiments_results/gym/HalfCheetah/HC_E0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76201_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028411", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1370", "output": "{1, 2, 5, 137, 10, 685, 274, 1370}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1369", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028412", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@exaple.co'", "output": "'exaple.co'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028413", "code": "def calculate_regression_coefficients(x, y):\n    if len(x) != len(y):\n        raise ValueError(\"Input lists x and y must have the same length\")\n    n = len(x)\n    mean_x = sum(x) / n\n    mean_y = sum(y) / n\n    SS_xx = sum((xi - mean_x) ** 2 for xi in x)\n    SS_xy = sum((xi - mean_x) * (yi - mean_y) for xi, yi in zip(x, y))\n    b_1 = SS_xy / SS_xx if SS_xx != 0 else 0  # Avoid division by zero\n    b_0 = mean_y - b_1 * mean_x\n    return b_0, b_1\n", "entry_point": "calculate_regression_coefficients", "input": "[0, 1, 2, 3], [0.5, 1.5, 2.5, 3.5]", "output": "(0.5, 1.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83034_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028414", "code": "def evaluate_computational_graph(x_var, y_var, bias_var):\n    # Step 1: Perform the multiplication of x_var and y_var\n    mul_out_var = x_var * y_var\n    # Step 2: Multiply the first intermediate result with bias_var\n    final_intermediate_result = mul_out_var * bias_var\n    # Step 3: Perform element-wise addition of the first and second intermediate results\n    final_output = mul_out_var + final_intermediate_result\n    return final_output\n", "entry_point": "evaluate_computational_graph", "input": "5, 3, 2", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66023_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028415", "code": "from typing import List\nPART_PENALTY = 10  # Example value\ndef calculate_total_penalty(penalties_list: List[int]) -> int:\n    total_penalty = PART_PENALTY\n    for penalty in penalties_list:\n        total_penalty += penalty\n    return total_penalty\n", "entry_point": "calculate_total_penalty", "input": "[10, 10, 10, 6]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145342_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028416", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2609", "output": "{1, 2609}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2608", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028417", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 2, 1, 4]", "output": "[3, 3, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028418", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'epppe'", "output": "'epppe_3134794701'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028419", "code": "def next_version(version: str) -> str:\n    parts = version.split('.')\n    major, minor, patch_dev = parts[0], parts[1], parts[2]\n    if len(parts) > 3:\n        dev = parts[3]\n        next_dev = int(dev[3:]) + 1\n        return f\"{major}.{minor}.{patch_dev}.dev{next_dev}\"\n    else:\n        patch = int(patch_dev)\n        if patch < 9:\n            next_patch = patch + 1\n            return f\"{major}.{minor}.{next_patch}\"\n        else:\n            minor = int(minor) + 1\n            return f\"{major}.{minor}.0\"\n", "entry_point": "next_version", "input": "'3.4.5'", "output": "'3.4.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7622_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028420", "code": "from typing import Tuple\ndef remove_non_ascii(first: str, second: str) -> Tuple[str, str]:\n    first = first.encode(\"ascii\", \"ignore\").decode()\n    second = second.encode(\"ascii\", \"ignore\").decode()\n    return (first, second)\n", "entry_point": "remove_non_ascii", "input": "'H\u00e9l\u00e8lo', 'W\u00f6rld!'", "output": "('Hllo', 'Wrld!')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72401_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028421", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[5, 4, 3, 2, 1]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028422", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7233", "output": "{7233, 1, 2411, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028423", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3299", "output": "{1, 3299}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3298", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028424", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "1, 2, 3, 4, 6", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028425", "code": "def addset_custom(dictionary, key, value):\n    if key in dictionary:\n        dictionary[key] = value\n    else:\n        dictionary[key] = value\n    return dictionary\n", "entry_point": "addset_custom", "input": "{}, 'bar', 2", "output": "{'bar': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90518_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028426", "code": "def frequency_dictionary(words):\n    freqs = {}\n    for word in words:\n        if word not in freqs:\n            freqs[word] = 0\n        freqs[word] += 1\n    return freqs\n", "entry_point": "frequency_dictionary", "input": "[0, 0, 0, 1, 1, 2, 2, 2, 2]", "output": "{0: 3, 1: 2, 2: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146019_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028427", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'capwd'", "output": "'Manual not available for capwd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028428", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[60, 55], 2", "output": "57.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52376_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028429", "code": "def extract_major_minor_version(version_string):\n    major, minor = map(int, version_string.split('.')[:2])\n    return major, minor\n", "entry_point": "extract_major_minor_version", "input": "'3.14'", "output": "(3, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86777_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028430", "code": "def modify_list(lst):\n    if len(lst) == 0:\n        return []\n    elif len(lst) == 1:\n        return lst\n    else:\n        return lst[1:-1]\n", "entry_point": "modify_list", "input": "[1, 2, 2, 6, 3, 5, 6, 7]", "output": "[2, 2, 6, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81811_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028431", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[0, 3, 8, 9]", "output": "[0, 6, 16, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028432", "code": "def fibonacci_sum(n):\n    if n <= 0:\n        return 0\n    elif n == 1:\n        return 0\n    a, b = 0, 1\n    sum_fib = a + b\n    for _ in range(2, n):\n        a, b = b, a + b\n        sum_fib += b\n    return sum_fib\n", "entry_point": "fibonacci_sum", "input": "11", "output": "143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146168_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028433", "code": "from typing import List\ndef max_loot_circle(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    if len(nums) == 1:\n        return nums[0]\n    def rob_range(start, end):\n        max_loot = [0, nums[start]]\n        for i in range(start+1, end+1):\n            max_loot.append(max(max_loot[-1], max_loot[-2] + nums[i]))\n        return max_loot[-1]\n    return max(rob_range(0, len(nums)-2), rob_range(1, len(nums)-1))\n", "entry_point": "max_loot_circle", "input": "[6, 1, 2, 8, 7]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119426_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "254", "output": "{1, 2, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt253", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028435", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hwoworoh'", "output": "['hwoworoh']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028436", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[85, 83, 85, 84, 84], 5", "output": "84.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86097_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028437", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[5, 10], [0, 0]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028438", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6196", "output": "{1, 2, 4, 1549, 6196, 3098}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6195", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028439", "code": "def determine_next_system(token, ship, systems):\n    # Define the rule to determine the next system based on the ship number\n    next_system = (ship % len(systems)) + 1\n    return next_system\n", "entry_point": "determine_next_system", "input": "None, 2, [0, 1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92455_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028440", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9715", "output": "{1, 67, 5, 335, 145, 9715, 1943, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9714", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028441", "code": "def final_coordinates(routes):\n    x, y = 0, 0  # Initialize traveler's coordinates\n    for route in routes:\n        for direction in route:\n            if direction == 'N':\n                y += 1\n            elif direction == 'S':\n                y -= 1\n            elif direction == 'E':\n                x += 1\n            elif direction == 'W':\n                x -= 1\n    return (x, y)\n", "entry_point": "final_coordinates", "input": "[['E', 'S']]", "output": "(1, -1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23024_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028442", "code": "def solve(n, m):\n    size = len(m) // n\n    main_diagonal_sum = sum(m[i*(size+1)] for i in range(n))\n    return main_diagonal_sum\n", "entry_point": "solve", "input": "2, [1, 0, 0, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73096_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028443", "code": "def correct_flux(flux_obs, z):\n    '''\n    Args:\n    flux_obs (int) - observed flux\n    z (int) - redshift\n    Returns:\n    int - redshift corrected flux\n    '''\n    flux_emit = (z * flux_obs) + flux_obs\n    return flux_emit\n", "entry_point": "correct_flux", "input": "15, 1", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3522_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028444", "code": "from typing import List\ndef sum_of_binary_numbers(numbers: List[int]) -> int:\n    total_sum = 0\n    for num in numbers:\n        binary_num = bin(num)[2:]\n        total_sum += int(binary_num, 2)\n    return total_sum\n", "entry_point": "sum_of_binary_numbers", "input": "[49]", "output": "49", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028445", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 3, 1, 1, 3, 3]", "output": "[5, 6, 4, 2, 4, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028446", "code": "def encrypt_string(input_string, key):\n    if not key:\n        return input_string\n    encrypted_chars = []\n    key_length = len(key)\n    for i, char in enumerate(input_string):\n        key_char = key[i % key_length]\n        shift = ord(key_char)\n        encrypted_char = chr((ord(char) + shift) % 256)\n        encrypted_chars.append(encrypted_char)\n    return ''.join(encrypted_chars)\n", "entry_point": "encrypt_string", "input": "'hello', 'key'", "output": "'\u00d3\u00ca\u00e5\u00d7\u00d4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43650_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028447", "code": "NDMAX = -2048\nPDMAX = 2047\nNVMAX = -4.096\nPVMAX = 4.096\ndef voltage_to_adc(voltage):\n    adc_range = PDMAX - NDMAX\n    voltage_range = PVMAX - NVMAX\n    adc_output = (voltage - NVMAX) / voltage_range * adc_range + NDMAX\n    return int(round(adc_output))  # Round to the nearest integer\n", "entry_point": "voltage_to_adc", "input": "-3.7", "output": "-1850", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143445_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028448", "code": "from typing import List\ndef remove_duplicates(elements: List) -> List:\n    unique_elements = []\n    for element in elements:\n        if element not in unique_elements:\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[4, 6, 4, 3, -1, -1, 2, 2]", "output": "[4, 6, 3, -1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26735_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028449", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7271", "output": "{1, 11, 661, 7271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028450", "code": "def every(lst, f=1, start=0):\n    result = []\n    for i in range(start, len(lst), f):\n        result.append(lst[i])\n    return result\n", "entry_point": "every", "input": "[1, 6, 8, 6, 8]", "output": "[1, 6, 8, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105731_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028451", "code": "from typing import Dict, List\ndef topological_sort(graph: Dict[int, List[int]]) -> List[int]:\n    visited = set()\n    post_order = []\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        post_order.append(node)\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node)\n    return post_order[::-1]\n", "entry_point": "topological_sort", "input": "{3: [4], 4: [1], 1: [5]}", "output": "[3, 4, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78090_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028452", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1569", "output": "{523, 1, 3, 1569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028453", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "9", "output": "'0246810121416'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028454", "code": "def extract_module_name(import_statement: str) -> str:\n    components = import_statement.split()\n    module_name = components[-1].split('.')[-1]\n    return module_name\n", "entry_point": "extract_module_name", "input": "'from some.package import get_logger'", "output": "'get_logger'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143552_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028455", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7583", "output": "{1, 7583}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7582", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028456", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'helloehelloe'", "output": "{'helloehelloe': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028457", "code": "def fizzbuzz_converter(numbers):\n    result = []\n    for num in numbers:\n        if num % 3 == 0 and num % 5 == 0:\n            result.append('FizzBuzz')\n        elif num % 3 == 0:\n            result.append('Fizz')\n        elif num % 5 == 0:\n            result.append('Buzz')\n        else:\n            result.append(num)\n    return result\n", "entry_point": "fizzbuzz_converter", "input": "[1, 3, 5, 15, 7, 3]", "output": "[1, 'Fizz', 'Buzz', 'FizzBuzz', 7, 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118176_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028458", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[2, 0, 1, 5, 2, 0, 1, 5]", "output": "[2, 0, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4301", "output": "{1, 391, 11, 4301, 17, 23, 187, 253}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4300", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028460", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "11", "output": "[1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028461", "code": "def update_image_urls(posts, suffix):\n    updated_posts = []\n    for post in posts:\n        updated_post = post.copy()\n        updated_post['image_url'] = f\"{updated_post['image_url']}{suffix}\"\n        updated_posts.append(updated_post)\n    return updated_posts\n", "entry_point": "update_image_urls", "input": "[], 'suffix'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113551_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028462", "code": "def rot13(message: str) -> str:\n    def shift_char(char, shift):\n        if 'A' <= char <= 'Z':\n            return chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n        elif 'a' <= char <= 'z':\n            return chr((ord(char) - ord('a') + shift) % 26 + ord('a'))\n        else:\n            return char\n    encrypted_message = ''.join(shift_char(char, 13) for char in message)\n    return encrypted_message\n", "entry_point": "rot13", "input": "'WoWo!rlld!'", "output": "'JbJb!eyyq!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112715_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028463", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6211", "output": "{1, 6211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028464", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9453", "output": "{1, 3, 69, 137, 9453, 3151, 23, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9452", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028465", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'phone_numbers'", "output": "'phone_numbers'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028466", "code": "def posix_quote_filter(input_string):\n    # Escape single quotes by doubling them\n    escaped_string = input_string.replace(\"'\", \"''\")\n    # Enclose the modified string in single quotes\n    return f\"'{escaped_string}'\"\n", "entry_point": "posix_quote_filter", "input": "'panncpic!'", "output": "\"'panncpic!'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125649_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028467", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2931", "output": "{3, 1, 2931, 977}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2930", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028468", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6959", "output": "{1, 6959}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6958", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028469", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            shifted_char = chr((ord(char) - ord('a') + shift) % 26 + ord('a')) if char.islower() else chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'olssov', 2", "output": "'qnuuqx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138959_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028470", "code": "from typing import Tuple\ndef calculate_final_position(commands: str) -> Tuple[int, int]:\n    x, y = 0, 0  # Initial position\n    movements = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}\n    for command in commands:\n        dx, dy = movements.get(command, (0, 0))\n        x += dx\n        y += dy\n    return x, y\n", "entry_point": "calculate_final_position", "input": "'RRRRUU'", "output": "(4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84889_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028471", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'epppem'", "output": "'epppem_74356046'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028472", "code": "def sum_of_squares(lst):\n    sum_squares = 0\n    for num in lst:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[8, 7, 4, 2]", "output": "133", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36660_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028473", "code": "from typing import Union\ngas_coef = {0: 1.000, 1: 1.400, 2: 0.446, 3: 0.785, 4: 0.515, 5: 0.610, 6: 0.500,\n            7: 0.250, 8: 0.410, 9: 0.350, 10: 0.300, 11: 0.250, 12: 0.260, 13: 1.000,\n            14: 0.740, 15: 0.790, 16: 1.010, 17: 1.000, 18: 1.400, 19: 1.400, 20: 1.000,\n            21: 0.510, 22: 0.990, 23: 0.710, 24: 1.400, 25: 0.985, 26: 0.630, 27: 0.280,\n            28: 0.620, 29: 1.360}\nres_range = {0: \"100\", 1: \"1e3\", 2: \"10e3\", 3: \"100e3\", 4: \"1e6\", 5: \"10e6\", 6: \"100e6\", 7: \"200e6\"}\ndef calculate_gas_flow(resistance: int) -> Union[float, str]:\n    if resistance in res_range:\n        gas_coefficient = gas_coef[resistance]\n        return gas_coefficient * resistance\n    else:\n        return \"Invalid Resistance Range\"\n", "entry_point": "calculate_gas_flow", "input": "5", "output": "3.05", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21888_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028474", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8335", "output": "{1, 1667, 5, 8335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8334", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028475", "code": "from collections import Counter\ndef find_modes(data):\n    freq_dict = Counter(data)\n    max_freq = max(freq_dict.values())\n    modes = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[0, 0, 1, 1, 2, 2, 3, 4, 5]", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75133_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028476", "code": "def populate_rois_lod(rois):\n    rois_lod = [[]]  # Initialize with an empty sublist\n    for element in rois:\n        if isinstance(element, int):\n            rois_lod[-1].append(element)  # Add integer to the last sublist\n        elif isinstance(element, list):\n            rois_lod.append(element.copy())  # Create a new sublist with elements of the list\n    return rois_lod\n", "entry_point": "populate_rois_lod", "input": "[1, [5, 6, 7, 4], [4, 3], [5, 6]]", "output": "[[1], [5, 6, 7, 4], [4, 3], [5, 6]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2890_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028477", "code": "def concat(parameters, sep):\n    text = ''\n    for i in range(len(parameters)):\n        text += str(parameters[i])\n        if i != len(parameters) - 1:\n            text += sep\n        else:\n            text += '\\n'\n    return text\n", "entry_point": "concat", "input": "[1, 4, 14, 22, 24], ''", "output": "'14142224\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80875_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028478", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[95, 92, 91, 90, 91, 80]", "output": "91.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10096_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028479", "code": "def calc_minimum_travels(distances, k):\n    if not distances:\n        return 0\n    travels = 1\n    current_distance = distances[0]\n    for i in range(1, len(distances)):\n        if current_distance + distances[i] > k:\n            travels += 1\n            current_distance = distances[i]\n        else:\n            current_distance += distances[i]\n    return travels\n", "entry_point": "calc_minimum_travels", "input": "[3, 1, 3], 4", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20323_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028480", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "19", "output": "19.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028481", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kirjakaupppa.i/k24'", "output": "'http://kirjakaupppa.i/k24'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028482", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[5, 20]", "output": "[5, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028483", "code": "def gameOutcome(button_states: tuple[bool, bool, bool]) -> str:\n    if all(button_states):\n        return \"Win\"\n    elif button_states.count(False) == 1:\n        return \"Neutral\"\n    else:\n        return \"Lose\"\n", "entry_point": "gameOutcome", "input": "(True, True, True)", "output": "'Win'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136357_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028484", "code": "mappings = {\n    \"event1\": \"action1\",\n    \"event2\": \"action2\",\n    \"event3\": \"action3\"\n}\ndef process_event(event):\n    return mappings.get(event, 'No action found')\n", "entry_point": "process_event", "input": "'event1'", "output": "'action1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108152_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028485", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char.isalpha():\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'He'", "output": "{'h': 1, 'e': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32626_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028486", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "10.85741099999998, 10.0", "output": "100.85741099999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028487", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[1, 1, 6, 6, 6, -1, 4, 3, 3]", "output": "{1: 2, 6: 3, -1: 1, 4: 1, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028488", "code": "def split_into_chunks(data, chunk_size):\n    num_chunks = -(-len(data) // chunk_size)  # Calculate the number of chunks needed\n    chunks = []\n    for i in range(num_chunks):\n        start = i * chunk_size\n        end = (i + 1) * chunk_size\n        chunk = data[start:end]\n        if len(chunk) < chunk_size:\n            chunk += [None] * (chunk_size - len(chunk))  # Pad with None values if needed\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_into_chunks", "input": "[1, 7, 2, 5, 4, 6, 5, 7], 1", "output": "[[1], [7], [2], [5], [4], [6], [5], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138006_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028489", "code": "def extract_fields(input_string):\n    fields = input_string.split('+')\n    if len(fields) < 4:\n        fields.extend([None] * (4 - len(fields)))\n    return tuple(fields)\n", "entry_point": "extract_fields", "input": "'56+XYZ'", "output": "('56', 'XYZ', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80422_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028490", "code": "def find_earliest_date(dates):\n    earliest_date = dates[0]  # Initialize with the first date in the list\n    for date in dates[1:]:\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date\n", "entry_point": "find_earliest_date", "input": "['202-01', '202-16', '201-15']", "output": "'201-15'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133862_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028491", "code": "def combination_sum(candidates, target):\n    result = []\n    def backtrack(current_combination, start_index, remaining_target):\n        if remaining_target == 0:\n            result.append(current_combination[:])\n            return\n        for i in range(start_index, len(candidates)):\n            if candidates[i] <= remaining_target:\n                current_combination.append(candidates[i])\n                backtrack(current_combination, i, remaining_target - candidates[i])\n                current_combination.pop()\n    backtrack([], 0, target)\n    return result\n", "entry_point": "combination_sum", "input": "[5], 5", "output": "[[5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34241_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028492", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[17, 541, 541]", "output": "[17, 541, 541]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028493", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'pythn'", "output": "'Binary path for pythn not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9527", "output": "{1361, 1, 7, 9527}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9526", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028495", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "17", "output": "0.024705882352941175", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028496", "code": "def binary_operation(a, b):\n    if a % 2 == 0 and b % 2 == 0:  # Both inputs are even\n        return a + b\n    elif a % 2 != 0 and b % 2 != 0:  # Both inputs are odd\n        return a * b\n    else:  # One input is even and the other is odd\n        return abs(a - b)\n", "entry_point": "binary_operation", "input": "1, 7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111403_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028497", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1724", "output": "{1, 2, 4, 431, 1724, 862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1723", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028498", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "372", "output": "{1, 2, 3, 4, 6, 12, 372, 186, 124, 93, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt371", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "746", "output": "{1, 746, 2, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt745", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028500", "code": "def apply_formatting(input_str):\n    style = ''\n    color = ''\n    # Extract style and color information from the input string\n    if '\\033[' in input_str:\n        start_idx = input_str.index('\\033[')\n        end_idx = input_str.index('m')\n        style_color = input_str[start_idx + 2:end_idx].split(';')\n        style = style_color[0]\n        color = style_color[1]\n    # Apply ANSI escape codes based on the extracted information\n    formatted_text = f'\\033[{style};{color}m{input_str[end_idx + 1:-4]}\\033[m'\n    return formatted_text\n", "entry_point": "apply_formatting", "input": "'\\x1b[7;3a m\\x1b[m'", "output": "'\\x1b[7;3a m\\x1b[m'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1962_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028501", "code": "def manage_course_registrations(commands):\n    courses = {}\n    def addCourse(command):\n        course, student = command.split(\" : \")\n        if course in courses:\n            courses[course].append(student)\n        else:\n            courses[course] = [student]\n    for command in commands:\n        addCourse(command)\n    return courses\n", "entry_point": "manage_course_registrations", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028502", "code": "def extract_frames(lidar_data, start_value):\n    frames = []\n    frame = []\n    for val in lidar_data:\n        if val == start_value:\n            if frame:\n                frames.append(frame)\n                frame = []\n        frame.append(val)\n    if frame:\n        frames.append(frame)\n    return frames\n", "entry_point": "extract_frames", "input": "[1, 4, 3, 5, 2, 3, 4, 4], 0", "output": "[[1, 4, 3, 5, 2, 3, 4, 4]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49590_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028503", "code": "import re\ndef increment_file_version(file_name):\n    base_name, extension = file_name.rsplit('.', 1)\n    match = re.search(r'_v(\\d+)$', base_name)\n    if match:\n        version_number = int(match.group(1)) + 1\n        new_base_name = base_name[:match.start()] + f\"_v{version_number}\"\n    else:\n        new_base_name = f\"{base_name}_v1\"\n    return f\"{new_base_name}.{extension}\"\n", "entry_point": "increment_file_version", "input": "'data_v10.csv'", "output": "'data_v11.csv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14196_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028504", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5579", "output": "{1, 5579, 797, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028505", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'Hello!'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028506", "code": "def calculate_average_scores(results):\n    unitag_scores = {}\n    unitag_counts = {}\n    for unitag, score in results:\n        if unitag in unitag_scores:\n            unitag_scores[unitag] += score\n            unitag_counts[unitag] += 1\n        else:\n            unitag_scores[unitag] = score\n            unitag_counts[unitag] = 1\n    average_scores = {unitag: unitag_scores[unitag] / unitag_counts[unitag] for unitag in unitag_scores}\n    return average_scores\n", "entry_point": "calculate_average_scores", "input": "[(401, 80.0)]", "output": "{401: 80.0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3220_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028507", "code": "# Create a dictionary mapping command names to their hexadecimal values\ncommand_map = {\n    \"RDDSDR\": 0x0f,\n    \"SLPOUT\": 0x11,\n    \"GAMSET\": 0x26,\n    \"DISPOFF\": 0x28,\n    \"DISPON\": 0x29,\n    \"CASET\": 0x2a,\n    \"PASET\": 0x2b,\n    \"RAMWR\": 0x2c,\n    \"RAMRD\": 0x2e,\n    \"MADCTL\": 0x36,\n    \"VSCRSADD\": 0x37,\n    \"PIXSET\": 0x3a,\n    \"PWCTRLA\": 0xcb,\n    \"PWCRTLB\": 0xcf,\n    \"DTCTRLA\": 0xe8\n}\ndef get_command_value(command):\n    return command_map.get(command, None)\n", "entry_point": "get_command_value", "input": "'DISPON'", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13569_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028508", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9374", "output": "{1, 2, 43, 109, 4687, 86, 218, 9374}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028509", "code": "def find_highest_score(student_scores):\n    highest_score = 0\n    for score in student_scores:\n        if score > highest_score:\n            highest_score = score\n    return highest_score\n", "entry_point": "find_highest_score", "input": "[45, 67, 89]", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8042_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028510", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "596", "output": "{1, 2, 4, 298, 596, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt595", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028511", "code": "def generate_song_id(song_title, artist_name, release_year):\n    # Extract the first three letters of the song title and artist name\n    song_prefix = song_title[:3].upper().ljust(3, '0')\n    artist_prefix = artist_name[:3].upper().ljust(3, '0')\n    # Convert the release year to a string\n    year_str = str(release_year)\n    # Combine the components to form the unique identifier\n    unique_id = f\"{song_prefix}{artist_prefix}{year_str}\"\n    return unique_id\n", "entry_point": "generate_song_id", "input": "'WORLD', 'JOHN', 2025", "output": "'WORJOH2025'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86508_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028512", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[34, 32, 33, 34, 32, 32, 32, 36]", "output": "[32, 32, 32, 32, 33, 34, 34, 36]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028513", "code": "def count_unique_words(input_string):\n    word_counts = {}\n    words = input_string.lower().split()\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hellhellhed'", "output": "{'hellhellhed': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22444_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028514", "code": "def generate_next_row(row):\n    next_row = [1]  # Initialize with the first element as 1\n    for i in range(1, len(row)):\n        next_row.append(row[i-1] + row[i])  # Perform element-wise addition\n    next_row.append(1)  # Add the last element as 1\n    return next_row\n", "entry_point": "generate_next_row", "input": "[1, 3, 3, 1]", "output": "[1, 4, 6, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105504_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028515", "code": "import binascii\nimport zlib\ndef generate_unique_key(input_string):\n    # Convert the input string to its hexadecimal representation\n    hex_representation = input_string.encode('utf-8').hex()\n    # Calculate the CRC32 checksum of the hexadecimal representation\n    checksum = zlib.crc32(binascii.unhexlify(hex_representation))\n    # Combine the original string with the checksum to form the unique key\n    unique_key = f\"{input_string}_{checksum}\"\n    return unique_key\n", "entry_point": "generate_unique_key", "input": "'ple'", "output": "'ple_1595932734'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128898_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028516", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "6", "output": "'312211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028517", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3562", "output": "{1, 2, 137, 3562, 13, 274, 1781, 26}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028518", "code": "def calculate_span(a):\n    n = len(a)\n    stack = []\n    span = [0] * n\n    span[0] = 1\n    stack.append(0)\n    for i in range(1, n):\n        while stack and a[stack[-1]] <= a[i]:\n            stack.pop()\n        span[i] = i + 1 if not stack else i - stack[-1]\n        stack.append(i)\n    return span\n", "entry_point": "calculate_span", "input": "[10, 20, 30, 5, 40, 50, 60, 10]", "output": "[1, 2, 3, 1, 5, 6, 7, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22670_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028519", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "10, 177.54056319999998", "output": "1775.4056319999997", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028520", "code": "def soma(a, b):\n    # Calculate the sum of the two integers\n    total = a + b\n    # Check if the sum is greater than 10\n    if total > 10:\n        return total * 2\n    else:\n        return total\n", "entry_point": "soma", "input": "0, 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120268_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028521", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[2, 4, 4, 5, 6, 7, 7, 7]", "output": "[2, 4, 4, 5, 6, 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028522", "code": "def format_title(title):\n    words = title.split()\n    formatted_words = [word.capitalize().replace('-', '') for word in words]\n    formatted_title = ' '.join(formatted_words)\n    return formatted_title\n", "entry_point": "format_title", "input": "'pang-o-lin'", "output": "'Pangolin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13677_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028523", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7090", "output": "{1, 2, 5, 709, 1418, 10, 7090, 3545}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7089", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028524", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'prc_auc'", "output": "'pr_auc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028525", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2559", "output": "{1, 3, 853, 2559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028526", "code": "from typing import List, Dict\nCT_LEDGER_PREFIX = 'ledger:'\nATTACHMENT_PREFIX = 'attachment:'\nCT_LEDGER_STOCK = 'stock'\nCT_LEDGER_REQUESTED = 'ct-requested'\nCT_LEDGER_APPROVED = 'ct-approved'\ndef summarize_ledger_entries(ledger_entries: List[str]) -> Dict[str, int]:\n    ledger_type_counts = {CT_LEDGER_STOCK: 0, CT_LEDGER_REQUESTED: 0, CT_LEDGER_APPROVED: 0}\n    for entry in ledger_entries:\n        prefix, entry_type = entry.split(':')\n        if prefix == CT_LEDGER_PREFIX:\n            if entry_type in ledger_type_counts:\n                ledger_type_counts[entry_type] += 1\n    return ledger_type_counts\n", "entry_point": "summarize_ledger_entries", "input": "[]", "output": "{'stock': 0, 'ct-requested': 0, 'ct-approved': 0}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144201_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028527", "code": "def calculate(expression):\n    return eval(expression)\n", "entry_point": "calculate", "input": "'3 + 5'", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37800_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028528", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'tootthttt'", "output": "\"Directory 'tootthttt' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028529", "code": "from typing import List\ndef get_leaves(obj: dict) -> List:\n    leaves = []\n    for value in obj.values():\n        if isinstance(value, dict):\n            leaves.extend(get_leaves(value))\n        else:\n            leaves.append(value)\n    return leaves\n", "entry_point": "get_leaves", "input": "{'a': 2, 'b': {'c': 3, 'd': {'e': 2}}}", "output": "[2, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11830_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028530", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7673", "output": "{1, 7673}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7672", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028531", "code": "def organize_datasets(dataset_names):\n    dataset_mapping = {}\n    for dataset_name in dataset_names:\n        if dataset_name in globals():\n            dataset_mapping[dataset_name] = globals()[dataset_name]\n    return dataset_mapping\n", "entry_point": "organize_datasets", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130581_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028532", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'another_cntract'", "output": "'contracts/another_cntract.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028533", "code": "def two_sum_indices(nums, target):\n    num_indices = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], i]\n        num_indices[num] = i\n    return []\n", "entry_point": "two_sum_indices", "input": "[1, 3, 5, 2, 4, 6], 11", "output": "[2, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94760_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028534", "code": "def process_roi_params(instrument, separation):\n    roi_params = {}\n    if instrument == \"qtof\":\n        roi_params.update({\"tolerance\": 0.01})\n    elif instrument == \"orbitrap\":\n        roi_params.update({\"tolerance\": 0.005})\n    else:\n        msg = \"valid `instrument` are qtof and orbitrap\"\n        raise ValueError(msg)\n    roi_params[\"mode\"] = separation\n    return roi_params\n", "entry_point": "process_roi_params", "input": "'orbitrap', 'combined'", "output": "{'tolerance': 0.005, 'mode': 'combined'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76072_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028535", "code": "def reverse_convert_metric(original_metric):\n    conversion_dict = {\n        \"pr_auc\": [\"prc_auc\", \"prc-auc\"],\n        \"roc_auc\": [\"auc\", \"roc-auc\"]\n    }\n    for key, values in conversion_dict.items():\n        if original_metric in values:\n            return key\n    return original_metric\n", "entry_point": "reverse_convert_metric", "input": "'rrocaucauc'", "output": "'rrocaucauc'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91321_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028536", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(sum_val)\n    return result\n", "entry_point": "circular_sum", "input": "[0, 2, 1, 3, -1, 3]", "output": "[2, 3, 4, 2, 2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4506_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3137", "output": "{3137, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3136", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028538", "code": "def play_game(target_x, target_y):\n    # Calculate the Manhattan distance between starting position (0, 0) and target position\n    steps_x = abs(target_x)\n    steps_y = abs(target_y)\n    # Return the sum of absolute differences as the minimum number of steps\n    return steps_x + steps_y\n", "entry_point": "play_game", "input": "0, 4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76087_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028539", "code": "def runSim(input_list, param):\n    total = sum(input_list) * param\n    return total\n", "entry_point": "runSim", "input": "[6578], 1", "output": "6578", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36389_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028540", "code": "def math_power(n, p):\n    if p == 0:\n        return 1\n    elif p < 0:\n        return 1 / math_power(n, -p)\n    else:\n        return n * math_power(n, p - 1)\n", "entry_point": "math_power", "input": "3.43, 2", "output": "11.7649", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65525_ipt37", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028541", "code": "def manipulate_string(input_string):\n    modified_string = input_string.replace(\"neuron\", \"synapse\")\n    modified_string = modified_string.replace(\"ParallelContext\", \"SerialContext\")\n    modified_string = modified_string.replace(\"CHECKING\", \"VERIFYING\")\n    return modified_string\n", "entry_point": "manipulate_string", "input": "'neuron'", "output": "'synapse'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95622_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028542", "code": "def calculate_final_price(initial_price, increase_percentage, decrease_percentage):\n    increase_amount = initial_price * (increase_percentage / 100)\n    final_price = initial_price + increase_amount\n    decrease_amount = final_price * (decrease_percentage / 100)\n    final_price -= decrease_amount\n    return final_price, increase_amount, decrease_amount\n", "entry_point": "calculate_final_price", "input": "99.0, 5.0, 4.0", "output": "(99.792, 4.95, 4.158)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123266_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028543", "code": "def organize_files_by_extension(tracked_files):\n    files_by_extension = {}\n    files = tracked_files.split('\\n')\n    for file in files:\n        file_parts = file.split('.')\n        if len(file_parts) > 1:\n            extension = file_parts[-1]\n            files_by_extension.setdefault(extension, []).append(file)\n    return files_by_extension\n", "entry_point": "organize_files_by_extension", "input": "'file.md'", "output": "{'md': ['file.md']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130191_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028544", "code": "def calculate_combined_score(phenotype, fitness, morale):\n    if phenotype is not None:\n        combined_score = fitness * morale\n    else:\n        combined_score = fitness + morale\n    return combined_score\n", "entry_point": "calculate_combined_score", "input": "None, 0.5, 0.5", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41743_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "476", "output": "{1, 2, 34, 4, 68, 7, 28, 238, 14, 17, 119, 476}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt475", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028546", "code": "import string\ndef count_word_frequencies(long_description):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    long_description = long_description.lower()\n    long_description = long_description.translate(str.maketrans('', '', string.punctuation))\n    # Split the text into words\n    words = long_description.split()\n    # Count the frequency of each word\n    word_freq = {}\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequencies", "input": "'repeatsam'", "output": "{'repeatsam': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56904_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028547", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[90, 90, 90, 70, 85, 80, 75], 7", "output": "[0, 1, 2, 4, 5, 6, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028548", "code": "def count_invalid_parenthesis(string):\n    count = 0\n    for char in string:\n        if char == \"(\" or char == \"[\" or char == \"{\":\n            count += 1\n        elif char == \")\" or char == \"]\" or char == \"}\":\n            count -= 1\n    return abs(count)\n", "entry_point": "count_invalid_parenthesis", "input": "'((('", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83794_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028549", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'us-1a'", "output": "'us'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028550", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[10, 12]", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028551", "code": "def parse_cookie(query: str) -> dict:\n    res = {}\n    if query:\n        data = query.split(';')\n        for pair in data:\n            if '=' in pair:\n                key, *value_parts = pair.split('=')\n                value = '='.join(value_parts)\n                res[key] = value\n    return res\n", "entry_point": "parse_cookie", "input": "'namn=Dime=28'", "output": "{'namn': 'Dime=28'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12693_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3397", "output": "{1, 43, 3397, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028553", "code": "def calculate_eps(epsilon_start: float, steps: int) -> float:\n    eps = epsilon_start\n    eps /= steps\n    return eps\n", "entry_point": "calculate_eps", "input": "0.9899999999999999, 1", "output": "0.9899999999999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81437_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028554", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7069", "output": "{1, 7069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7068", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028555", "code": "def is_valid_layer_sequence(layers):\n    for i in range(len(layers) - 1):\n        if layers[i] == layers[i + 1]:\n            return False\n    return True\n", "entry_point": "is_valid_layer_sequence", "input": "[1, 1]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48211_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028556", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) >= 3:\n        return unique_scores[:3]\n    else:\n        return unique_scores\n", "entry_point": "top_three_scores", "input": "[70, 75, 80, 90, 92, 86]", "output": "[92, 90, 86]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142769_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028557", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[4, 4, 4, 4, 2, 2, 3, 5]", "output": "{4: 4, 2: 2, 3: 1, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3923", "output": "{1, 3923}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3922", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028559", "code": "def calculate_circular_sums(input_list):\n    result = []\n    if not input_list:\n        return result\n    for i in range(len(input_list)):\n        circular_sum = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum)\n    return result\n", "entry_point": "calculate_circular_sums", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24752_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028560", "code": "def authenticate_lti_request(consumer_key, shared_secret, lti_parameters):\n    if consumer_key in lti_parameters and lti_parameters[consumer_key] == shared_secret:\n        return True\n    return False\n", "entry_point": "authenticate_lti_request", "input": "'key1', 'secret1', {'key2': 'secret2'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118781_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8222", "output": "{1, 2, 8222, 4111}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8221", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028562", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'apple,ge'", "output": "['apple', 'ge']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028563", "code": "def calculate_absolute_difference(list1, list2):\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference", "input": "[0, 2, 6], [5, 7, 3]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136421_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028564", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3161", "output": "{3161, 1, 109, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3160", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028565", "code": "from typing import List, Union, Optional, Tuple\nfrom collections import Counter\ndef most_common_element(lst: List[Union[int, any]]) -> Tuple[Optional[int], Optional[int]]:\n    int_list = [x for x in lst if isinstance(x, int)]\n    if not int_list:\n        return (None, None)\n    counter = Counter(int_list)\n    most_common = counter.most_common(1)[0]\n    return most_common\n", "entry_point": "most_common_element", "input": "[5, 5, 3, 'hello', 1]", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70044_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028566", "code": "def make_2D_custom(X, y=0):\n    if isinstance(X, list):\n        if all(isinstance(elem, list) for elem in X):\n            if len(X[0]) == 1:\n                X = [[elem[0], y] for elem in X]\n            return X\n        else:\n            X = [[elem, y] for elem in X]\n            return X\n    elif isinstance(X, int) or isinstance(X, float):\n        X = [[X, y]]\n        return X\n    else:\n        return X\n", "entry_point": "make_2D_custom", "input": "5, 10", "output": "[[5, 10]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106690_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028567", "code": "def calculate_average(num1, num2, num3):\n    total_sum = num1 + num2 + num3\n    average = total_sum / 3\n    return average\n", "entry_point": "calculate_average", "input": "20.0, 20.0, 21.0", "output": "20.333333333333332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_179_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028568", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "12", "output": "'./prespawned/version12_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8581", "output": "{1, 8581}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8580", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028570", "code": "def simulate_train(commands):\n    position = 0\n    for command in commands:\n        if command == 'F' and position < 10:\n            position += 1\n        elif command == 'B' and position > -10:\n            position -= 1\n    return position\n", "entry_point": "simulate_train", "input": "['F', 'F', 'F', 'F', 'F', 'F', 'F', 'F']", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105746_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028571", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2710", "output": "{1, 2, 5, 10, 1355, 271, 2710, 542}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2709", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028572", "code": "def prefnum(InA=[], PfT=None, varargin=None):\n    # Non-zero value InA location indices:\n    IxZ = [i for i, val in enumerate(InA) if val > 0]\n    IsV = True\n    # Calculate sum of positive values, maximum value, and its index\n    sum_positive = sum(val for val in InA if val > 0)\n    max_value = max(InA)\n    max_index = InA.index(max_value)\n    return sum_positive, max_value, max_index\n", "entry_point": "prefnum", "input": "[10] + [1] * 39", "output": "(49, 10, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134376_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028573", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "531", "output": "{1, 3, 9, 177, 531, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028574", "code": "def extract_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "extract_even_numbers", "input": "[4, 0, 6, 0, 0, 1, 3, 5]", "output": "[4, 0, 6, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138034_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028575", "code": "from math import log10\ndef log2_custom(n):\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    return log10(n) / log10(2)\n", "entry_point": "log2_custom", "input": "14", "output": "3.8073549220576037", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122808_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028576", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[73, 108, 109, 72, 112, 100, 109, 101, 109]", "output": "'IlmHpdmem'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028577", "code": "def login(username, password):\n    credentials = {\n        \"user1\": \"password1\",\n        \"user2\": \"password2\"\n    }\n    if username in credentials and credentials[username] == password:\n        # Generate JWT token (for simplicity, just concatenate username and a secret key)\n        jwt_token = username + \"_secretkey\"\n        return {\"jwt\": jwt_token}\n    else:\n        return {\"error\": \"Invalid username or password\"}\n", "entry_point": "login", "input": "'user1', 'password1'", "output": "{'jwt': 'user1_secretkey'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89772_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028578", "code": "def calculate_total_perimeter(shapes):\n    total_perimeter = 0\n    for shape in shapes:\n        perimeter = sum(shape[\"sides\"])\n        total_perimeter += perimeter\n    return total_perimeter\n", "entry_point": "calculate_total_perimeter", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142186_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028579", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i + 1 < len(input_list):\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[3, 4, 3, 4, 2, 4, 3, 4]", "output": "[7, 7, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54766_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028580", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[10, 5, 8]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028581", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "96", "output": "{96, 1, 2, 3, 32, 4, 6, 8, 12, 48, 16, 24}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt95", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028582", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'details'", "output": "'details'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028583", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '2.0.0', '3.5.2', '3.9.9', '4.0.0']", "output": "'4.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49230_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2509", "output": "{1, 13, 193, 2509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2508", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028585", "code": "def extract_readme_content(readme_content, version_number):\n    readme_dict = {version_number: readme_content}\n    return readme_dict\n", "entry_point": "extract_readme_content", "input": "'Tihis', '111.100.1'", "output": "{'111.100.1': 'Tihis'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24103_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028586", "code": "def process_image(option: str, image_url: str = None, uploaded_image: str = None) -> str:\n    if option == 'library':\n        # Process example image from library\n        return 'Processed example image from library'\n    elif option == 'url' and image_url:\n        # Process image downloaded from URL\n        return 'Processed image downloaded from URL'\n    elif option == 'upload' and uploaded_image:\n        # Process uploaded image\n        return 'Processed uploaded image'\n    else:\n        return 'Invalid option or missing image data'\n", "entry_point": "process_image", "input": "'library'", "output": "'Processed example image from library'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138019_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028587", "code": "def generate_list(size):\n    alphabet = list(map(chr, range(97, 123)))  # Generating a list of lowercase alphabets\n    m = alphabet[size-1::-1] + alphabet[:size]  # Creating the list 'm' based on the given size\n    return m\n", "entry_point": "generate_list", "input": "2", "output": "['b', 'a', 'a', 'b']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44532_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028588", "code": "def rgb_to_hex(red, green, blue):\n    def clamp(x):\n        return max(0, min(x, 255))\n    red = clamp(red)\n    green = clamp(green)\n    blue = clamp(blue)\n    hex_red = hex(red)[2:].zfill(2)\n    hex_green = hex(green)[2:].zfill(2)\n    hex_blue = hex(blue)[2:].zfill(2)\n    return f\"#{hex_red.upper()}{hex_green.upper()}{hex_blue.upper()}\"\n", "entry_point": "rgb_to_hex", "input": "255, 168, 1", "output": "'#FFA801'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22199_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028589", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3947", "output": "{1, 3947}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3946", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028590", "code": "from typing import List, Tuple\ndef above_average_count(scores: List[int]) -> Tuple[float, int]:\n    total_students = len(scores)\n    total_score = sum(scores)\n    average_score = round(total_score / total_students, 2)\n    above_average_count = sum(score > average_score for score in scores)\n    return average_score, above_average_count\n", "entry_point": "above_average_count", "input": "[90, 90, 90, 90, 90, 90, 85, 85, 85, 85]", "output": "(88.0, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65850_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028591", "code": "def generate_order_numbers(models):\n    sorted_models = sorted(models, key=lambda x: x[\"centre\"])\n    order_numbers = [i + 1 for i in range(len(sorted_models))]\n    return order_numbers\n", "entry_point": "generate_order_numbers", "input": "[{'centre': 10}, {'centre': 5}]", "output": "[1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147970_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028592", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6406", "output": "{1, 2, 3203, 6406}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6405", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7767", "output": "{1, 3, 9, 7767, 2589, 863}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028594", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "7", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt27", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028595", "code": "# Custom sorting function to extract numerical value and sort based on it\ndef custom_sort(greeting):\n    return int(greeting.split()[-1])\n", "entry_point": "custom_sort", "input": "'This is number 5'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115133_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028596", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[1, 1, 2, 2, 3, 5]", "output": "{1: 2, 2: 2, 3: 1, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028597", "code": "from typing import List\ndef process_list(lst: List[int]) -> List[int]:\n    if not lst:\n        return []\n    new_list = []\n    for i in range(len(lst) - 1):\n        new_list.append(lst[i] + lst[i + 1])\n    new_list.append(lst[-1] + lst[0])\n    return new_list\n", "entry_point": "process_list", "input": "[2, 2, 1, 4]", "output": "[4, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64952_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028598", "code": "def replace_with_last_day_value(input_list):\n    if not input_list:\n        return []\n    result = []\n    current_value = input_list[0]\n    count = 1\n    for i in range(1, len(input_list)):\n        if input_list[i] == current_value:\n            count += 1\n        else:\n            result.extend([current_value] * count)\n            current_value = input_list[i]\n            count = 1\n    result.extend([current_value] * count)\n    return result\n", "entry_point": "replace_with_last_day_value", "input": "[1, 1, 3, 0, 3, 5, 2, 1, 1]", "output": "[1, 1, 3, 0, 3, 5, 2, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42326_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028599", "code": "import statistics\ndef min_expression_value(N):\n    m = int(round(statistics.mean(N)))  # Calculate the mean of the list\n    d = int(statistics.median(N))       # Calculate the median of the list\n    min_sum = float('inf')  # Initialize minimum sum to infinity\n    for i in range(m, d, (d > m) - (d < m)):\n        current_sum = sum((n - i)**2 + abs(n - i) for n in N)\n        min_sum = min(min_sum, current_sum)\n    return min_sum // 2\n", "entry_point": "min_expression_value", "input": "[1, 2, 5]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25394_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028600", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "-5, 7", "output": "-78125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt59", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028601", "code": "def process_numbers(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n        elif num % 5 == 0:\n            total += 2 * num\n        else:\n            total -= num\n    return total\n", "entry_point": "process_numbers", "input": "[10, 1, 5]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25805_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8929", "output": "{1, 8929}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028603", "code": "def find_latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_version = tuple(map(int, latest_version.split('.')))\n            new_version = tuple(map(int, version.split('.')))\n            if new_version > current_version:\n                latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['1.0.0', '2.0.0', '2.0.1']", "output": "'2.0.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92338_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028604", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8449", "output": "{1, 8449, 7, 71, 17, 497, 119, 1207}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028605", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 1, 2, 1, 2, 2]", "output": "[5, 4, 3, 3, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131162_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028606", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "7, 28, 51", "output": "26931000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028607", "code": "from itertools import combinations, chain\ndef calculate_total_circuits(num_controls):\n    total_circuits = 2 ** num_controls\n    return total_circuits\n", "entry_point": "calculate_total_circuits", "input": "5", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95878_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028608", "code": "import time\ndef simulate_response_delay(delay: float, content: str) -> tuple:\n    time.sleep(delay / 1000)  # Convert delay from milliseconds to seconds\n    response_headers = [(\"Content-type\", \"text/plain\")]  # Assuming text/plain content-type\n    return response_headers, content\n", "entry_point": "simulate_response_delay", "input": "100.0, 'HelHeHe'", "output": "([('Content-type', 'text/plain')], 'HelHeHe')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30838_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028609", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5695", "output": "{1, 67, 5, 335, 17, 1139, 85, 5695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "267", "output": "{3, 1, 267, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt266", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028611", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[6, 5, 1, 2, 2, 1, 1]", "output": "[11, 6, 3, 4, 3, 2, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31739_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028612", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'tao'", "output": "{'tao': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028613", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[6, 6, 6]", "output": "108", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028614", "code": "def sum_adjacent_elements(input_list):\n    output_list = []\n    if not input_list:\n        return output_list\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "sum_adjacent_elements", "input": "[1, 5, 0, 10, -2, 9, -2, 6]", "output": "[6, 5, 10, 8, 7, 7, 4, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114935_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028615", "code": "def normalize_text(text):\n    normalized_text = []\n    word = \"\"\n    for char in text:\n        if char.isalnum():\n            word += char\n        elif word:\n            normalized_text.append(word)\n            word = \"\"\n    if word:\n        normalized_text.append(word)\n    return \" \".join(normalized_text).lower()\n", "entry_point": "normalize_text", "input": "'%^lworld@!#h'", "output": "'lworld h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35252_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028616", "code": "TOKEN_TYPE = ((0, 'PUBLIC_KEY'), (1, 'PRIVATE_KEY'), (2, 'AUTHENTICATION TOKEN'), (4, 'OTHER'))\ndef get_token_type_verbose(token_type: int) -> str:\n    token_type_mapping = dict(TOKEN_TYPE)\n    return token_type_mapping.get(token_type, 'Unknown Token Type')\n", "entry_point": "get_token_type_verbose", "input": "1", "output": "'PRIVATE_KEY'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149682_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028617", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[-1]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028618", "code": "def decode_large_communities(attribute_values):\n    if len(attribute_values) % 3 != 0:\n        raise ValueError(\"Invalid number of octet values for LARGE COMMUNITIES attribute\")\n    communities = set()\n    for i in range(0, len(attribute_values), 3):\n        community = tuple(attribute_values[i:i+3])\n        communities.add(community)\n    return communities\n", "entry_point": "decode_large_communities", "input": "[1, 7, 6, 1, 5, 10, 11, 1, 2]", "output": "{(1, 7, 6), (1, 5, 10), (11, 1, 2)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117734_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028619", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1937", "output": "{1, 1937, 13, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028620", "code": "def calculate_percentage_increase(numbers):\n    if len(numbers) < 2:\n        return 0  # If there are less than 2 numbers, return 0 as there is no increase\n    first_number = numbers[0]\n    last_number = numbers[-1]\n    percentage_increase = ((last_number - first_number) / first_number) * 100\n    return percentage_increase\n", "entry_point": "calculate_percentage_increase", "input": "[5, 5]", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12877_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028621", "code": "def final_position(movement_commands):\n    x, y = 0, 0\n    for command in movement_commands:\n        if command == 'UP':\n            y += 1\n        elif command == 'DOWN':\n            y -= 1\n        elif command == 'LEFT':\n            x -= 1\n        elif command == 'RIGHT':\n            x += 1\n    return (x, y)\n", "entry_point": "final_position", "input": "['LEFT', 'UP', 'DOWN']", "output": "(-1, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105011_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028622", "code": "def longest_consecutive(nums):\n    num_set = set(nums)\n    max_length = 0\n    for num in num_set:\n        if num - 1 not in num_set:\n            current_num = num\n            current_length = 1\n            while current_num + 1 in num_set:\n                current_num += 1\n                current_length += 1\n            max_length = max(max_length, current_length)\n    return max_length\n", "entry_point": "longest_consecutive", "input": "[10]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126647_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028623", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4135", "output": "{1, 827, 5, 4135}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4134", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028624", "code": "def custom_sum(lst):\n    total_sum = 0\n    for num in lst:\n        total_sum += num\n    return total_sum\n", "entry_point": "custom_sum", "input": "[17]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18834_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028625", "code": "from typing import List\ndef top_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    indexed_scores.sort(key=lambda x: (-x[0], x[1]))  # Sort by score descending, index ascending\n    top_k_students = [index for _, index in indexed_scores[:k]]\n    return top_k_students\n", "entry_point": "top_students", "input": "[90, 80, 50, 60, 90, 100, 70], 7", "output": "[5, 0, 4, 1, 6, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27923_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028626", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7523", "output": "{1, 7523}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7522", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028627", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(2, 6, 1, 9, 11, 1, 12, 9)", "output": "'2.6.1.9.11.1.12.9'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028628", "code": "def custom_trim_string(value: str) -> str:\n    start = 0\n    end = len(value)\n    # Find the start position\n    while start < len(value) and value[start].isspace():\n        start += 1\n    # Find the end position\n    while end > start and value[end - 1].isspace():\n        end -= 1\n    return value[start:end]\n", "entry_point": "custom_trim_string", "input": "'   ,Heo,   '", "output": "',Heo,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028629", "code": "def generate_wiktionary_url(snippet, query, lang):\n    query = query.replace(' ', '_')\n    if lang == 'fr':\n        return '\"%s\" - http://fr.wiktionary.org/wiki/%s' % (snippet, query)\n    elif lang == 'es':\n        return '\"%s\" - http://es.wiktionary.org/wiki/%s' % (snippet, query)\n    else:\n        return '\"%s\" - http://en.wiktionary.org/wiki/%s' % (snippet, query)\n", "entry_point": "generate_wiktionary_url", "input": "'Heello', 'looll', 'en'", "output": "'\"Heello\" - http://en.wiktionary.org/wiki/looll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98635_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6626", "output": "{1, 6626, 2, 3313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6625", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028631", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1018", "output": "{1, 1018, 2, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1017", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028632", "code": "def solution(s):\n    start = 0\n    end = len(s) - 1\n    while start < len(s) and not s[start].isalnum():\n        start += 1\n    while end >= 0 and not s[end].isalnum():\n        end -= 1\n    return s[start:end+1]\n", "entry_point": "solution", "input": "'@@@abcdefghijklmn.p###'", "output": "'abcdefghijklmn.p'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114817_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028633", "code": "from typing import List\ndef most_common_numbers(frequencies: List[int]) -> List[int]:\n    freq_dict = {}\n    for num, freq in enumerate(frequencies):\n        if freq > 0:\n            freq_dict[num] = freq\n    max_freq = max(freq_dict.values())\n    most_common = [num for num, freq in freq_dict.items() if freq == max_freq]\n    return sorted(most_common)\n", "entry_point": "most_common_numbers", "input": "[0, 0, 1, 0, 0, 1, 1]", "output": "[2, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6154_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2281", "output": "{1, 2281}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2280", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028635", "code": "def calculate_sum_of_evens(lst):\n    sum_of_evens = 0\n    for num in lst:\n        if num % 2 == 0:\n            sum_of_evens += num\n    return sum_of_evens\n", "entry_point": "calculate_sum_of_evens", "input": "[6, 8, 10, 12]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100953_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028636", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "600, 50, 1", "output": "651", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028637", "code": "import math\ndef calculate_sin(x):\n    \"\"\"\n    Calculate the sine of the input angle x in radians.\n    Args:\n    x (float): Angle in radians\n    Returns:\n    float: Sine of the input angle x\n    \"\"\"\n    return math.sin(x)\n", "entry_point": "calculate_sin", "input": "0.0", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88101_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028638", "code": "def parse_default_app_config(default_config):\n    parts = default_config.split('.')\n    app_name = parts[0]\n    config_class_name = parts[-1]\n    return app_name, config_class_name\n", "entry_point": "parse_default_app_config", "input": "'nnNaCong.nnNaCong'", "output": "('nnNaCong', 'nnNaCong')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122668_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028639", "code": "TASK_STATUS = [\n    ('TD', 'To Do'),\n    ('IP', 'In Progress'),\n    ('QA', 'Testing'),\n    ('DO', 'Done'),\n]\nTASK_PRIORITY = [\n    ('ME', 'Medium'),\n    ('HI', 'Highest'),\n    ('HG', 'High'),\n    ('LO', 'Lowest'),\n]\ndef get_task_description(status_code: str, priority_code: str) -> str:\n    status_desc = next((desc for code, desc in TASK_STATUS if code == status_code), None)\n    priority_desc = next((desc for code, desc in TASK_PRIORITY if code == priority_code), None)\n    if status_desc and priority_desc:\n        return f'{status_desc} - {priority_desc}'\n    else:\n        return 'Invalid status code: ' + status_code if not status_desc else 'Invalid priority code: ' + priority_code\n", "entry_point": "get_task_description", "input": "'PPIP', 'ME'", "output": "'Invalid status code: PPIP'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16795_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028640", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1g.3g1.3.3-22.gdf812281'", "output": "'1g.3g1.3.3+22.gdf812281'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028641", "code": "import math\ndef combs(n, k):\n    if k == 0 or k == n:\n        return 1\n    return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))\n", "entry_point": "combs", "input": "8, 4", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128662_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028642", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char.isalpha():\n            base = ord('A') if char.isupper() else ord('a')\n            encrypted_char = chr((ord(char) - base + shift) % 26 + base)\n            encrypted_text += encrypted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'World!oH,', 1", "output": "'Xpsme!pI,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20125_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028643", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[1, 5, 3, 2]", "output": "[1, 5, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028644", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7911", "output": "{1, 3, 293, 7911, 9, 2637, 879, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028645", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1684", "output": "{1, 2, 4, 421, 842, 1684}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1683", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028646", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1504", "output": "{1504, 1, 2, 32, 4, 8, 47, 752, 16, 376, 188, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1503", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028647", "code": "def square_elements(input_list):\n    result = []\n    for num in input_list:\n        result.append(num ** 2)\n    return result\n", "entry_point": "square_elements", "input": "[2, 3, 2, 0, 3, 3]", "output": "[4, 9, 4, 0, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53704_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028648", "code": "def generate_unique_id(section_name):\n    length = len(section_name)\n    if length % 2 == 0:  # Even length\n        unique_id = section_name + str(length)\n    else:  # Odd length\n        unique_id = section_name[::-1] + str(length)\n    return unique_id\n", "entry_point": "generate_unique_id", "input": "'nnn_mdel'", "output": "'nnn_mdel8'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126473_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1314", "output": "{1, 1314, 2, 3, 6, 9, 73, 657, 146, 18, 438, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1313", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028650", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2817", "output": "{1, 2817, 3, 9, 939, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2816", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028651", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}  # Dictionary to store scores and their original positions\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))  # Sort scores in descending order\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[32, 30, 30, 23, 21, 15, 10], 6", "output": "[32, 30, 30, 23, 21, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133636_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028652", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[1, 1, 3], [2], [1, 1], [2, 3], [2]]", "output": "[1, 1, 3, 2, 1, 1, 2, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028653", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[8, 2, 3, 6, 7, 8, 8]", "output": "[8, 2, 6, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028654", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7374", "output": "{1, 2, 3, 6, 3687, 1229, 7374, 2458}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7373", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028655", "code": "def convert_memory_size(memory_size):\n    units = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n    conversion_rates = [1, 1024, 1024**2, 1024**3, 1024**4]\n    for idx, rate in enumerate(conversion_rates):\n        if memory_size < rate or idx == len(conversion_rates) - 1:\n            converted_size = memory_size / conversion_rates[idx - 1]\n            return f\"{converted_size:.2f} {units[idx - 1]}\"\n", "entry_point": "convert_memory_size", "input": "1023", "output": "'1023.00 Bytes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149300_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028656", "code": "import re\nre_punc = re.compile(r'[!\"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\']')\narticles = set([\"a\", \"an\", \"the\"])\ndef normalize_answer(s):\n    \"\"\"\n    Lower text, remove punctuation, articles, and extra whitespace.\n    Args:\n    s: A string representing the input text to be normalized.\n    Returns:\n    A string with the input text normalized as described.\n    \"\"\"\n    s = s.lower()\n    s = re_punc.sub(\" \", s)\n    s = \" \".join([word for word in s.split() if word not in articles])\n    s = \" \".join(s.split())\n    return s\n", "entry_point": "normalize_answer", "input": "'do'", "output": "'do'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46089_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2708", "output": "{1, 2, 4, 677, 1354, 2708}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2707", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028658", "code": "import re\ndef categorize_substrings(text):\n    re_han = re.compile(\"([\\u4E00-\\u9FD5]+)\")\n    re_skip = re.compile(\"([a-zA-Z0-9]+(?:\\.\\d+)?%?)\")\n    substrings = re.findall(re_han, text)\n    chinese_substrings = \", \".join(substrings)\n    substrings = re.findall(re_skip, text)\n    alphanumeric_substrings = \", \".join(substrings)\n    return f\"Chinese: {chinese_substrings}\\nAlphanumeric: {alphanumeric_substrings}\"\n", "entry_point": "categorize_substrings", "input": "'1'", "output": "'Chinese: \\nAlphanumeric: 1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39837_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028659", "code": "def mean_reciprocal_rank(relevance_scores, rel_docs_per_query):\n    total_reciprocal_rank = 0\n    for scores in relevance_scores:\n        relevant_indices = [i for i, score in enumerate(scores) if score == 1]\n        if relevant_indices:\n            reciprocal_rank = 1 / (relevant_indices[0] + 1)\n            total_reciprocal_rank += reciprocal_rank\n    return total_reciprocal_rank / len(relevance_scores) if relevance_scores else 0\n", "entry_point": "mean_reciprocal_rank", "input": "[[1], [0]], 2", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12257_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028660", "code": "def prepare_ffmpeg_arguments(instance):\n    audio_in_args = []\n    audio_filters = []\n    audio_out_args = []\n    audio_inputs = instance.get(\"audio\")\n    if not audio_inputs:\n        return audio_in_args, audio_filters, audio_out_args\n    for audio_input in audio_inputs:\n        audio_in_args.append(audio_input[\"input_file\"])\n        audio_filters.extend(audio_input.get(\"filters\", []))\n        audio_out_args.append(audio_input[\"output_file\"])\n    return audio_in_args, audio_filters, audio_out_args\n", "entry_point": "prepare_ffmpeg_arguments", "input": "{}", "output": "([], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16538_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028661", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1268", "output": "{1, 2, 4, 1268, 634, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1267", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028662", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6361", "output": "{1, 6361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028663", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "26, 2", "output": "(13, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028664", "code": "from typing import List\ndef batch_split(iterable: List[int], n: int) -> List[List[int]]:\n    batches = []\n    l = len(iterable)\n    for i in range(0, l, n):\n        batches.append(iterable[i:i + n])\n    return batches\n", "entry_point": "batch_split", "input": "[30, 8, 8, 40, 9, 8], 5", "output": "[[30, 8, 8, 40, 9], [8]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79399_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028665", "code": "def calculate_average(numbers):\n    total_sum = 0\n    count = 0\n    for num in numbers:\n        if num >= 0:\n            total_sum += num\n            count += 1\n    if count == 0:\n        return 0  # To handle the case when there are no positive numbers\n    return total_sum / count\n", "entry_point": "calculate_average", "input": "[12.0]", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5697_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028666", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    total_top_scores = sum(top_scores)\n    return total_top_scores / n\n", "entry_point": "average_top_n_scores", "input": "[79, 78, 74, 56, 40, 30], 4", "output": "71.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64994_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028667", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7707", "output": "{1, 3, 7, 2569, 1101, 367, 21, 7707}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7706", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028668", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5657", "output": "{1, 5657}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028669", "code": "import re\ndef count_unique_words(text):\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'ld'", "output": "{'ld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64619_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028670", "code": "def simulate_race(cars):\n    finishing_times = [(index, position / speed) for index, (position, speed) in enumerate(cars)]\n    finishing_times.sort(key=lambda x: x[1])\n    return [car[0] for car in finishing_times]\n", "entry_point": "simulate_race", "input": "[(10, 5), (20, 4), (30, 3)]", "output": "[0, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89590_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028671", "code": "def parse_version(version_str):\n    # Split the version number string using the dot as the delimiter\n    version_parts = version_str.split('.')\n    # Convert the version number components to integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return a tuple containing the major, minor, and patch version numbers\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.1.6'", "output": "(1, 1, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42795_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028672", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9562", "output": "{1, 2, 7, 683, 4781, 14, 1366, 9562}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9561", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028673", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1082", "output": "{1, 1082, 2, 541}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028674", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6937", "output": "{1, 991, 6937, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028675", "code": "def generate_webpage_url(host: str, port: int) -> str:\n    return f\"http://{host}:{port}\"\n", "entry_point": "generate_webpage_url", "input": "'127.0..', 8079", "output": "'http://127.0..:8079'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142595_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028676", "code": "def calculate_weighted_sum(input_list):\n    if len(input_list) != 3 or not all(isinstance(elem, list) for elem in input_list[1:]):\n        return \"Invalid input format. Expected [Ncontainer, derivatives, weights].\"\n    Ncontainer, derivatives, weights = input_list\n    if len(derivatives) != len(weights):\n        return \"Number of derivatives and weights should be the same.\"\n    weighted_sum = sum(derivative * weight for derivative, weight in zip(derivatives, weights))\n    return weighted_sum\n", "entry_point": "calculate_weighted_sum", "input": "[[], [8, 4], [2, 4]]", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35925_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028677", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8962", "output": "{1, 8962, 2, 4481}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8961", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028678", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'sampple'", "output": "'Sampple'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028679", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'snava', '11'", "output": "'snava11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028680", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4904", "output": "{1, 2, 4, 613, 4904, 8, 1226, 2452}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4903", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6199", "output": "{1, 6199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6198", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028682", "code": "def normalize_local_part(local_part):\n    if not local_part:\n        return None\n    normalized_local_part = local_part.replace(\".\", \"\").lower()\n    return normalized_local_part\n", "entry_point": "normalize_local_part", "input": "'John.D'", "output": "'johnd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2471_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028683", "code": "def split_text_into_chunks(text):\n    lines = text.split(\"\\n\")\n    chunks = []\n    chunk = []\n    for line in lines:\n        if line.strip():  # Check if the line is not empty\n            chunk.append(line)\n        else:\n            if chunk:  # Check if the chunk is not empty\n                chunks.append(chunk)\n                chunk = []\n    if chunk:  # Add the last chunk if not empty\n        chunks.append(chunk)\n    return chunks\n", "entry_point": "split_text_into_chunks", "input": "'22'", "output": "[['22']]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14685_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028684", "code": "def maxPower(s):\n    if not s:\n        return 0\n    max_power = 1\n    current_power = 1\n    current_char = s[0]\n    current_count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            current_count += 1\n        else:\n            current_char = s[i]\n            current_count = 1\n        max_power = max(max_power, current_count)\n    return max_power\n", "entry_point": "maxPower", "input": "'aaaaaaaaaaa'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40173_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028685", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "7, [1, 2, 3, 4, 5, 6, 7]", "output": "[2, 1, 4, 3, 6, 5, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028686", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "7, 4", "output": "2401", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt37", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028687", "code": "def separate_negatives(arr):\n    negatives = []\n    non_negatives = []\n    for num in arr:\n        if num < 0:\n            negatives.append(num)\n        else:\n            non_negatives.append(num)\n    return negatives + non_negatives\n", "entry_point": "separate_negatives", "input": "[1, -7, -4, -11, -3, -5, -3, -3]", "output": "[-7, -4, -11, -3, -5, -3, -3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93396_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028688", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'eheohelo'", "output": "['eheohelo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028689", "code": "def calculate_total_time(task_times):\n    total_time = 0\n    for index, time in enumerate(task_times):\n        if index % 2 == 0:  # Check if the task is at an even index\n            time *= 2  # Double the time for even-indexed tasks\n        total_time += time  # Add the modified time to the total time\n    return total_time\n", "entry_point": "calculate_total_time", "input": "[10, 2, 5, 3, 5, 1]", "output": "46", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116575_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028690", "code": "def tokenize(code):\n    tokens = []\n    words = code.split()\n    for word in words:\n        tokens.append(word)\n    return tokens\n", "entry_point": "tokenize", "input": "'x1'", "output": "['x1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145195_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028691", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num ** 2)\n        elif num % 2 != 0:\n            processed_nums.append(num ** 3)\n        if num % 3 == 0:\n            processed_nums[-1] += 10\n    return processed_nums\n", "entry_point": "process_integers", "input": "[1, 7, 7, 5, 1, 6, 7]", "output": "[1, 343, 343, 125, 1, 46, 343]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54483_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028692", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "901", "output": "{1, 53, 901, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028693", "code": "def consecutive_abs_diff_sum(lst):\n    total_diff = 0\n    for i in range(1, len(lst)):\n        total_diff += abs(lst[i] - lst[i-1])\n    return total_diff\n", "entry_point": "consecutive_abs_diff_sum", "input": "[0, 5, 15, 23]", "output": "23", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133117_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028694", "code": "def modify_list(numbers):\n    modified_list = []\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num * 2)  # Double the value\n        else:\n            modified_list.append(num * 3)  # Triple the value\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 5, 4, -1, 7, 8, 3]", "output": "[3, 15, 8, -3, 21, 16, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114167_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028695", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1359", "output": "{1, 3, 453, 9, 1359, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1358", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028696", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "6.333333333333333, 1", "output": "5.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028697", "code": "def has_duplicate_device_paths(device_paths):\n    seen_paths = set()\n    for path in device_paths:\n        if path in seen_paths:\n            return True\n        seen_paths.add(path)\n    return False\n", "entry_point": "has_duplicate_device_paths", "input": "['/dev/video0', '/dev/audio0', '/dev/video0']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141362_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028698", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'prooging/', 'htpoythhonml'", "output": "'prooging/htpoythhonml'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028699", "code": "TT_EQ = 'EQ'  # =\nTT_LPAREN = 'LPAREN'  # (\nTT_RPAREN = 'RPAREN'  # )\nTT_LSQUARE = 'LSQUARE'\nTT_RSQUARE = 'RSQUARE'\nTT_EE = 'EE'  # ==\nTT_NE = 'NE'  # !=\nTT_LT = 'LT'  # >\nTT_GT = 'GT'  # <\nTT_LTE = 'LTE'  # >=\nTT_GTE = 'GTE'  # <=\nTT_COMMA = 'COMMA'\nTT_ARROW = 'ARROW'\nTT_NEWLINE = 'NEWLINE'\nTT_EOF = 'EOF'\ndef lexer(code):\n    tokens = []\n    i = 0\n    while i < len(code):\n        char = code[i]\n        if char.isspace():\n            i += 1\n            continue\n        if char == '=':\n            tokens.append((TT_EQ, char))\n        elif char == '(':\n            tokens.append((TT_LPAREN, char))\n        elif char == ')':\n            tokens.append((TT_RPAREN, char))\n        elif char == '[':\n            tokens.append((TT_LSQUARE, char))\n        elif char == ']':\n            tokens.append((TT_RSQUARE, char))\n        elif char == '>':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_GTE, '>='))\n                i += 1\n            else:\n                tokens.append((TT_GT, char))\n        elif char == '<':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_LTE, '<='))\n                i += 1\n            else:\n                tokens.append((TT_LT, char))\n        elif char == '!':\n            if i + 1 < len(code) and code[i + 1] == '=':\n                tokens.append((TT_NE, '!='))\n                i += 1\n        elif char == ',':\n            tokens.append((TT_COMMA, char))\n        elif char == '-':\n            if i + 1 < len(code) and code[i + 1] == '>':\n                tokens.append((TT_ARROW, '->'))\n                i += 1\n        elif char.isdigit():\n            num = char\n            while i + 1 < len(code) and code[i + 1].isdigit():\n                num += code[i + 1]\n                i += 1\n            tokens.append(('NUM', num))\n        elif char.isalpha():\n            identifier = char\n            while i + 1 < len(code) and code[i + 1].isalnum():\n                identifier += code[i + 1]\n                i += 1\n            tokens.append(('ID', identifier))\n        elif char == '\\n':\n            tokens.append((TT_NEWLINE, char))\n        i += 1\n    tokens.append((TT_EOF, ''))  # End of file token\n    return tokens\n", "entry_point": "lexer", "input": "'= 10'", "output": "[('EQ', '='), ('NUM', '10'), ('EOF', '')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28449_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028700", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 3, 2, 1, 2, 6, 2, 3, 1]", "output": "[1, 4, 4, 4, 6, 11, 8, 10, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028701", "code": "import re\ndef extract_numbers(input_string):\n    # Define the pattern to match numbers enclosed within underscores and dots\n    pattern = re.compile(r\"_([0-9]+)\\.\")\n    # Use re.findall to extract all occurrences of the pattern in the input string\n    extracted_numbers = re.findall(pattern, input_string)\n    # Convert the extracted numbers from strings to integers using list comprehension\n    extracted_integers = [int(num) for num in extracted_numbers]\n    return extracted_integers\n", "entry_point": "extract_numbers", "input": "'_123._456.'", "output": "[123, 456]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10395_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028702", "code": "def transform_list(lst, target, threshold):\n    result = []\n    for num in lst:\n        if num >= threshold:\n            result.append(target)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "transform_list", "input": "[4, 1, 96, 4, 1, 0, 100, 200], 96, 96", "output": "[4, 1, 96, 4, 1, 0, 96, 96]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61671_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028703", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "4, 19", "output": "(28, 13, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028704", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5266", "output": "{2633, 1, 5266, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5265", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028705", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[3, 3, 3, 3, 3, 1, 2, 1, 2]", "output": "{3: 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028706", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'tunkll'", "output": "'tunkll'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028707", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 3  # Multiply the last added element by 3\n    return processed_list\n", "entry_point": "process_integers", "input": "[22, 22, 4, 10, 40, 40, 40, 40]", "output": "[24, 24, 6, 12, 42, 42, 42, 42]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82460_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028708", "code": "from typing import List\ndef bubble_sort(unsorted_array: List[int]) -> List[int]:\n    n = len(unsorted_array)\n    for i in range(n):\n        swapped = False\n        for j in range(0, n-i-1):\n            if unsorted_array[j] > unsorted_array[j+1]:\n                unsorted_array[j], unsorted_array[j+1] = unsorted_array[j+1], unsorted_array[j]\n                swapped = True\n        if not swapped:\n            break\n    return unsorted_array\n", "entry_point": "bubble_sort", "input": "[11, 22, 10, 22, 11, 35]", "output": "[10, 11, 11, 22, 22, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15180_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028709", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "112, -16, 1", "output": "-1792", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028710", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "938", "output": "{1, 2, 67, 134, 7, 938, 14, 469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028711", "code": "from typing import List\ndef fast_moving_average(data: List[float], num_intervals: int) -> List[float]:\n    if len(data) < num_intervals:\n        return []\n    interval_size = len(data) // num_intervals\n    moving_avg = []\n    for i in range(num_intervals):\n        start = i * interval_size\n        end = start + interval_size if i < num_intervals - 1 else len(data)\n        interval_data = data[start:end]\n        avg = sum(interval_data) / len(interval_data) if interval_data else 0\n        moving_avg.append(avg)\n    return moving_avg\n", "entry_point": "fast_moving_average", "input": "[6.0, 6.0, 8.0, 7.0, 5.0, 6.0, 5.0, 5.0], 4", "output": "[6.0, 7.5, 5.5, 5.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98561_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028712", "code": "def make_cls_name(base: str, replacement: str) -> str:\n    return base.replace(\"Base\", replacement)\n", "entry_point": "make_cls_name", "input": "'BCreaeteMoBase', 'BasaB'", "output": "'BCreaeteMoBasaB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120218_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028713", "code": "from typing import List, Tuple\ndef calculate_balance(transactions: List[Tuple[str, float]]) -> float:\n    balance = 0.0\n    for transaction_type, amount in transactions:\n        if transaction_type == 'D':\n            balance += amount\n        elif transaction_type == 'W':\n            balance -= amount\n    return balance\n", "entry_point": "calculate_balance", "input": "[('D', 200.0), ('W', 100.0)]", "output": "100.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60719_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028714", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "4, 4", "output": "70", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028715", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4529", "output": "{647, 1, 4529, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028716", "code": "import re\ndef extract_version_info(version_str):\n    version_info = {}\n    pattern = r\"v(?P<version>[0-9]+(?:\\.[0-9]+)*)(?P<dev>\\.dev[0-9]+\\+g[0-9a-f]+)?(?P<date>\\.d[0-9]+)?\"\n    match = re.match(pattern, version_str)\n    if match:\n        version_info['version'] = match.group('version')\n        if match.group('dev'):\n            version_info['dev'] = int(match.group('dev').split('.dev')[1].split('+')[0])\n            version_info['git_commit'] = match.group('dev').split('+g')[1]\n        if match.group('date'):\n            version_info['date'] = int(match.group('date').split('.d')[1])\n    return version_info\n", "entry_point": "extract_version_info", "input": "'v33.d202'", "output": "{'version': '33', 'date': 202}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47059_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028717", "code": "def format_title_version(title: str, version: tuple) -> str:\n    version_str = \".\".join(map(str, version))\n    formatted_str = f'\"{title}\" version: {version_str}'\n    return formatted_str\n", "entry_point": "format_title_version", "input": "'Ttionees', (4, 0, 1, 4, 0, 0, 2)", "output": "'\"Ttionees\" version: 4.0.1.4.0.0.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31803_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028718", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "41, 35, 1", "output": "41.58361111111111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028719", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "'ththihh'", "output": "'ththihh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028720", "code": "from collections import Counter\nfrom typing import List, Tuple\ndef most_common_character(input_string: str) -> List[Tuple[str, int]]:\n    char_freq = Counter(input_string)\n    max_freq = max(char_freq.values())\n    most_common_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    most_common_chars.sort()\n    return [(char, max_freq) for char in most_common_chars]\n", "entry_point": "most_common_character", "input": "'eeeeee'", "output": "[('e', 6)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130322_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028721", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[5, 6, 10, 1, 0, 2, 7, 5, 6]", "output": "[0, 1, 2, 5, 5, 6, 6, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028722", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'addd'", "output": "'ddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028723", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3149", "output": "{1, 67, 3149, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3148", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028724", "code": "from typing import List\ndef longest_subarray_sum_divisible_by_k(arr: List[int], k: int) -> List[int]:\n    mod_index = {0: -1}\n    running_sum = 0\n    max_len = 0\n    start_index = 0\n    for i, num in enumerate(arr):\n        running_sum = (running_sum + num) % k\n        if running_sum in mod_index:\n            if i - mod_index[running_sum] > max_len:\n                max_len = i - mod_index[running_sum]\n                start_index = mod_index[running_sum] + 1\n        else:\n            mod_index[running_sum] = i\n    return arr[start_index:start_index + max_len]\n", "entry_point": "longest_subarray_sum_divisible_by_k", "input": "[4, 2, 0, -2, -1, 6, -3, -1, -3, -3, -4], 8", "output": "[6, -3, -1, -3, -3, -4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74177_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5834", "output": "{1, 5834, 2, 2917}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5833", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028726", "code": "def calculate_average_score(scores):\n    total_score = 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 100]", "output": "90.83333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49545_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028727", "code": "def obscure_phone(phone_number, format_type):\n    number = ''.join(filter(str.isdigit, phone_number))[-4:]\n    obscured_number = ''\n    for char in phone_number[:-4]:\n        if char.isdigit():\n            obscured_number += '*'\n        else:\n            obscured_number += char\n    if format_type == 'E164':\n        return '+' + '*' * (len(phone_number) - 4) + number\n    elif format_type == 'INTERNATIONAL':\n        return '+*' + ' ***-***-' + '*' * len(number) + number\n    elif format_type == 'NATIONAL':\n        return '(***) ***-' + '*' * len(number) + number\n    elif format_type == 'RFC3966':\n        return 'tel:+*' + '-***-***-' + '*' * len(number) + number\n", "entry_point": "obscure_phone", "input": "'55555555551234', 'INTERNATIONAL'", "output": "'+* ***-***-****1234'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94268_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028728", "code": "def angle_to_position(angle: int) -> float:\n    SERVO_MAX_ANGLE = 180\n    # Calculate normalized value\n    normalized = angle / SERVO_MAX_ANGLE\n    # Ensure the value is within the range [0, 1]\n    normalized = max(0, min(normalized, 1))\n    return normalized\n", "entry_point": "angle_to_position", "input": "91", "output": "0.5055555555555555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107115_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028729", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'s'", "output": "'s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028730", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "17", "output": "1597", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028731", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028732", "code": "from decimal import Decimal\ndef htdf_to_satoshi(amount_htdf):\n    amount_decimal = Decimal(str(amount_htdf))  # Convert input to Decimal\n    satoshi_value = int(amount_decimal * (10 ** 8))  # Convert HTDF to satoshi\n    return satoshi_value\n", "entry_point": "htdf_to_satoshi", "input": "113961821", "output": "11396182100000000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13302_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028733", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            total = input_list[i] + input_list[i + 1]\n        elif i == len(input_list) - 1:\n            total = input_list[i] + input_list[i - 1]\n        else:\n            total = input_list[i - 1] + input_list[i] + input_list[i + 1]\n        output_list.append(total)\n    return output_list\n", "entry_point": "process_list", "input": "[4, 5, 4, 2, 4, 2, 5]", "output": "[9, 13, 11, 10, 8, 11, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34585_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028734", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[5, 7, 11, 3]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "674", "output": "{337, 1, 674, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028736", "code": "def calculate_max_voltage(gain):\n    if gain == 1:\n        max_VOLT = 4.096\n    elif gain == 2:\n        max_VOLT = 2.048\n    elif gain == 4:\n        max_VOLT = 1.024\n    elif gain == 8:\n        max_VOLT = 0.512\n    elif gain == 16:\n        max_VOLT = 0.256\n    else:  # gain == 2/3\n        max_VOLT = 6.144\n    return max_VOLT\n", "entry_point": "calculate_max_voltage", "input": "16", "output": "0.256", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119884_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028737", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[-1, 2, 12, 3, 11, 2, 0, 0]", "output": "[-1, 2, 12, 3, 11, 2, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028738", "code": "def sum_divisible_by_2_and_3(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0 and num % 3 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_2_and_3", "input": "[6, 6, 6, 6, 6]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87733_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028739", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[-1, -1, 4, 1, 3, 0, 2, 2]", "output": "[-1, -2, 2, 3, 6, 6, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028740", "code": "import re\ndef parse_level_builder_code(code):\n    objects_info = {}\n    lines = code.split('\\n')\n    for line in lines:\n        if 'lb.addObject' in line:\n            obj_type = re.search(r'\\.addObject\\((\\w+)\\.', line).group(1)\n            obj_name = re.search(r'\\.setName\\(\"(\\w+)\"\\)', line)\n            obj_name = obj_name.group(1) if obj_name else f'{obj_type}#{len(objects_info)+1}'\n            obj_details = {'type': obj_type}\n            for prop in re.findall(r',(\\w+)=(\\w+|\\d+|\\'\\w+\\')', line):\n                obj_details[prop[0]] = prop[1].strip(\"'\")\n            objects_info[obj_name] = obj_details\n    return objects_info\n", "entry_point": "parse_level_builder_code", "input": "'lb.addObject(Star.add())'", "output": "{'Star#1': {'type': 'Star'}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99668_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028741", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7846", "output": "{1, 2, 3923, 7846}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7403", "output": "{11, 1, 7403, 673}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7402", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028743", "code": "def card_game(player_a, player_b):\n    rounds_a_won = 0\n    rounds_b_won = 0\n    ties = 0\n    for card_a, card_b in zip(player_a, player_b):\n        if card_a > card_b:\n            rounds_a_won += 1\n        elif card_b > card_a:\n            rounds_b_won += 1\n        else:\n            ties += 1\n    return rounds_a_won, rounds_b_won, ties\n", "entry_point": "card_game", "input": "[1, 2, 3, 4, 5], [0, 1, 2, 3, 4]", "output": "(5, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34362_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "639", "output": "{1, 3, 71, 9, 213, 639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028745", "code": "def check_configuration_validity(config):\n    settings_seen = set()\n    for item in config:\n        if not isinstance(item, dict) or 'setting' not in item or 'value' not in item:\n            return False\n        if not isinstance(item['setting'], str) or not item['setting']:\n            return False\n        if item['setting'] in settings_seen:\n            return False\n        settings_seen.add(item['setting'])\n    return True\n", "entry_point": "check_configuration_validity", "input": "[1, {'setting': 'A', 'value': 10}]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103457_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028746", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6411", "output": "{3, 1, 6411, 2137}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028747", "code": "def _make_divisible(v, divisor, min_value=None):\n    if min_value is None:\n        min_value = divisor\n    new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)\n    if new_v < 0.9 * v:\n        new_v += divisor\n    return new_v\n", "entry_point": "_make_divisible", "input": "22.5, 8", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83533_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028748", "code": "from typing import List\ndef max_difference_after(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    min_element = nums[0]\n    max_difference = 0\n    for num in nums[1:]:\n        difference = num - min_element\n        if difference > max_difference:\n            max_difference = difference\n        if num < min_element:\n            min_element = num\n    return max_difference\n", "entry_point": "max_difference_after", "input": "[4, 5, 10]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72615_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028749", "code": "def calculate_forward_differences(input_list):\n    solution = input_list.copy()\n    fwd = [input_list[i+1] - input_list[i] for i in range(len(input_list)-1)]\n    return solution, fwd\n", "entry_point": "calculate_forward_differences", "input": "[9, 9, 13, 14, 13, 9, 13]", "output": "([9, 9, 13, 14, 13, 9, 13], [0, 4, 1, -1, -4, 4])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137495_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028750", "code": "def calculate_average_execution_time(experiment_results):\n    total_time = 0\n    scikit_count = 0\n    for experiment in experiment_results:\n        if experiment[\"name\"] == \"scikit\":\n            total_time += experiment[\"execution_time\"]\n            scikit_count += 1\n    if scikit_count == 0:\n        return 0  # To handle division by zero if there are no \"scikit\" experiments\n    return total_time / scikit_count\n", "entry_point": "calculate_average_execution_time", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83366_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028751", "code": "def max_sum_from_grid(grid):\n    max_row_values = [max(row) for row in grid]\n    return sum(max_row_values)\n", "entry_point": "max_sum_from_grid", "input": "[[1, 2, 3], [0, 1, 3]]", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41541_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028752", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1986", "output": "{1, 1986, 3, 2, 993, 6, 331, 662}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1985", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028753", "code": "def extract_domain(email):\n    at_index = email.index('@')  # Find the index of the \"@\" symbol\n    domain = email[at_index + 1:]  # Extract the domain name\n    return domain\n", "entry_point": "extract_domain", "input": "'user@examplejjoh'", "output": "'examplejjoh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67858_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028754", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "29", "output": "{1, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt28", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028755", "code": "def sum_of_even_squares(nums):\n    sum_even_squares = 0\n    for num in nums:\n        if num % 2 == 0:\n            sum_even_squares += num ** 2\n    return sum_even_squares\n", "entry_point": "sum_of_even_squares", "input": "[10, 12]", "output": "244", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4220_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028756", "code": "def modify_sentence(sentence):\n    # Split the input sentence into a list of words\n    word_list = sentence.split(' ')\n    # Join the list of words using a comma as the separator\n    modified_sentence = ','.join(word_list)\n    return modified_sentence\n", "entry_point": "modify_sentence", "input": "'The quick brobrownx'", "output": "'The,quick,brobrownx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109235_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028757", "code": "from functools import reduce\nfrom operator import xor\ndef find_missing_integer(xs):\n    n = len(xs)\n    xor_xs = reduce(xor, xs)\n    xor_full = reduce(xor, range(1, n + 2))\n    return xor_xs ^ xor_full\n", "entry_point": "find_missing_integer", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77106_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028758", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'11s', '1221111122111'", "output": "'11s1221111122111'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028759", "code": "STARLARK_BINARY_PATH = {\n    \"java\": \"external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark\",\n    \"go\": \"external/net_starlark_go/cmd/starlark/*/starlark\",\n    \"rust\": \"external/starlark-rust/target/debug/starlark-repl\",\n}\nSTARLARK_TESTDATA_PATH = \"test_suite/\"\ndef get_starlark_binary_path(language):\n    if language in STARLARK_BINARY_PATH:\n        return STARLARK_BINARY_PATH[language].replace('*', STARLARK_TESTDATA_PATH)\n    else:\n        return f\"Binary path for {language} not found.\"\n", "entry_point": "get_starlark_binary_path", "input": "'ggoggggpyhoo'", "output": "'Binary path for ggoggggpyhoo not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91141_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028760", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return [input_list[0] * 2]\n    else:\n        output_list = []\n        for i in range(len(input_list) - 1):\n            output_list.append(input_list[i] + input_list[i + 1])\n        output_list.append(input_list[-1] + input_list[0])\n        return output_list\n", "entry_point": "process_list", "input": "[2, 5, 42, 20, 40, 20, 1, 1, 41]", "output": "[7, 47, 62, 60, 60, 21, 2, 42, 43]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5835_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028761", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'30s'", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028762", "code": "def text_wrap(input_string, max_width):\n    words = input_string.split()\n    wrapped_lines = []\n    current_line = words[0]\n    for word in words[1:]:\n        if len(current_line) + len(word) + 1 <= max_width:\n            current_line += ' ' + word\n        else:\n            wrapped_lines.append(current_line)\n            current_line = word\n    wrapped_lines.append(current_line)\n    return wrapped_lines\n", "entry_point": "text_wrap", "input": "'cdnsectetur', 11", "output": "['cdnsectetur']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117293_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028763", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[9, 9, 9, 9, 9, 7, 3, 3]", "output": "[9, 9, 9, 9, 9, 7, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028764", "code": "def replace_max_with_sum(input_list):\n    max_val = max(input_list)\n    sum_except_max = sum(input_list) - max_val\n    output_list = [sum_except_max if x == max_val else x for x in input_list]\n    return output_list\n", "entry_point": "replace_max_with_sum", "input": "[3, 7, 2, 7, 26, 7]", "output": "[3, 7, 2, 7, 26, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95801_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028765", "code": "import re\ndef count_word_occurrences(text):\n    text = re.sub(r'[^\\w\\s]', '', text.lower())  # Remove punctuation and convert to lowercase\n    words = text.split()  # Split text into words\n    word_counts = {}\n    for word in words:\n        if word in word_counts:\n            word_counts[word] += 1\n        else:\n            word_counts[word] = 1\n    return word_counts\n", "entry_point": "count_word_occurrences", "input": "'HelloE'", "output": "{'helloe': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126419_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028766", "code": "def swap_adjacent(int_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(int_list) - 1):\n            if int_list[i] > int_list[i + 1]:\n                int_list[i], int_list[i + 1] = int_list[i + 1], int_list[i]\n                swapped = True\n    return int_list\n", "entry_point": "swap_adjacent", "input": "[-2, 7, 0, 2, 0, 5, 7]", "output": "[-2, 0, 0, 2, 5, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137816_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028767", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4159", "output": "{1, 4159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4158", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028768", "code": "def generate_manual(command_name):\n    manuals = {\n        \"ls\": {\n            \"description\": \"List directory contents\",\n            \"additional_info\": \"Use this command to display the files and directories in the current directory\"\n        },\n        \"pwd\": {\n            \"description\": \"Print name of current/working directory\",\n            \"additional_info\": \"This command prints the full pathname of the current working directory\"\n        }\n        # Add more commands and their descriptions here\n    }\n    if command_name in manuals:\n        manual_text = f\"Manual for {command_name}:\\n--------------------------------\\n\"\n        manual_text += f\"Description: {manuals[command_name]['description']}\\n\"\n        manual_text += f\"Additional Information: {manuals[command_name]['additional_info']}\"\n        return manual_text\n    else:\n        return f\"Manual not available for {command_name}\"\n", "entry_point": "generate_manual", "input": "'capcapwdclswdcls'", "output": "'Manual not available for capcapwdclswdcls'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51570_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028769", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'15 Sep 2022'", "output": "'Sep 15, 2022'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028770", "code": "# The function f(a) increments the input a by 2\ndef f(a):\n    a += 2\n    return a\n", "entry_point": "f", "input": "-2", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48508_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028771", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "722", "output": "{1, 2, 38, 361, 722, 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt721", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028772", "code": "def get_data_form_template_path(model_id):\n    DATA_TEMPLATES = {1: 'forms/rtbh_rule.j2', 4: 'forms/ipv4_rule.j2', 6: 'forms/ipv6_rule.j2'}\n    DEFAULT_SORT = {1: 'ivp4', 4: 'source', 6: 'source'}\n    return DATA_TEMPLATES.get(model_id, DATA_TEMPLATES.get(1, 'forms/default_rule.j2'))\n", "entry_point": "get_data_form_template_path", "input": "4", "output": "'forms/ipv4_rule.j2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130729_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028773", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[3, 2, 5, 4, 1, 1, 2, 2]", "output": "[5, 7, 9, 5, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31739_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028774", "code": "def calculate_combinations(ob_size, act_size):\n    def factorial(n):\n        if n == 0:\n            return 1\n        return n * factorial(n - 1)\n    total_combinations = factorial(ob_size + act_size) // (factorial(ob_size) * factorial(act_size))\n    return total_combinations\n", "entry_point": "calculate_combinations", "input": "8, 5", "output": "1287", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135801_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028775", "code": "def extend_oid(base_oid, extension_tuple):\n    extended_oid = base_oid + extension_tuple\n    return extended_oid\n", "entry_point": "extend_oid", "input": "(4, 4), (5, 6, 9, 6, 9, 5, 6)", "output": "(4, 4, 5, 6, 9, 6, 9, 5, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97535_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028776", "code": "import math\ndef calculate_distance(point_a, point_b):\n    x_diff = point_b[0] - point_a[0]\n    y_diff = point_b[1] - point_a[1]\n    z_diff = point_b[2] - point_a[2]\n    distance = math.sqrt(x_diff**2 + y_diff**2 + z_diff**2)\n    return distance\n", "entry_point": "calculate_distance", "input": "(0, 0, 0), (5, 5, 4.47213595499958)", "output": "8.366600265340756", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94468_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028777", "code": "def process_string(input_string):\n    modified_string = input_string.replace(\"python\", \"Java\").replace(\"code\", \"\").replace(\"snippet\", \"program\")\n    return modified_string\n", "entry_point": "process_string", "input": "'III'", "output": "'III'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6573_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028778", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4574", "output": "{1, 2, 4574, 2287}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028779", "code": "def compress_string(s: str) -> str:\n    if not s:\n        return \"\"\n    compressed = \"\"\n    current_char = s[0]\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == current_char:\n            count += 1\n        else:\n            compressed += current_char + str(count)\n            current_char = s[i]\n            count = 1\n    compressed += current_char + str(count)\n    return compressed\n", "entry_point": "compress_string", "input": "'aaabcc'", "output": "'a3b1c2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144981_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028780", "code": "def serviceLane(width, cases):\n    result = []\n    for case in cases:\n        start, end = case\n        segment = width[start:end+1]\n        min_width = min(segment)\n        result.append(min_width)\n    return result\n", "entry_point": "serviceLane", "input": "[2, 2, 4, 5], [(0, 1), (1, 2)]", "output": "[2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129083_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028781", "code": "def increment_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'8.9.9'", "output": "'9.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144556_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028782", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "8", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028783", "code": "def validate_message_fields(msg_dict):\n    MSG_FIELDS = {\n        'uuid_ref': {'key': 'uuid_ref', 'required': True},\n        'data_location': {'key': 'data_location', 'required': True},\n        'meta_location': {'key': 'meta_location', 'required': True},\n        'data_type': {'key': 'data_type', 'required': False},\n        'metadata': {'key': 'metadata', 'required': False},\n    }\n    for field, properties in MSG_FIELDS.items():\n        if properties['required'] and field not in msg_dict:\n            return False\n    return True\n", "entry_point": "validate_message_fields", "input": "{'data_location': 'some/location', 'meta_location': 'meta/location'}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111583_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028784", "code": "def countingSortDescending(a):\n    max_val = max(a)\n    b = [0] * (max_val + 1)\n    c = []\n    for i in range(len(a)):\n        b[a[i]] += 1\n    for i in range(len(b) - 1, -1, -1):  # Traverse b in reverse order for descending sort\n        if b[i] != 0:\n            for j in range(b[i]):\n                c.append(i)\n    return c\n", "entry_point": "countingSortDescending", "input": "[4, 3, 2, 2, 2, 2, 2, 2, 2]", "output": "[4, 3, 2, 2, 2, 2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27250_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028785", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8447", "output": "{1, 8447}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028786", "code": "from math import ceil\ndef generate_progress_bar(index, max_value):\n    progress_bar = '\u2588\u2589\u258a\u258b\u258c\u258d\u258e\u258f'\n    pb_size = len(progress_bar)\n    if index < 0 or index > max_value:\n        raise IndexError(f'index ({index}) out of range [0, {max_value}]')\n    k = ceil(max_value / pb_size) * pb_size / max_value\n    new_index = int(round(index * k))\n    full_block_count = new_index // pb_size\n    part_block = new_index % pb_size\n    if part_block == 0:\n        result = progress_bar[0] * full_block_count\n    else:\n        result = progress_bar[0] * full_block_count + progress_bar[pb_size - part_block]\n    space_filler = ' ' * (int(ceil(max_value / pb_size)) - len(result))\n    return '|' + result + space_filler + '|'\n", "entry_point": "generate_progress_bar", "input": "6, 8", "output": "'|\u258a|'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107333_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028787", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[6, 1, 6, 5, 7, 5, 3, 1, 1]", "output": "[6, 7, 13, 18, 25, 30, 33, 34, 35]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028788", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'honmanors', 109", "output": "[137, 165, 161, 157, 109, 161, 165, 177, 181]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028789", "code": "def add_index_to_element(input_list):\n    return [num + idx for idx, num in enumerate(input_list)]\n", "entry_point": "add_index_to_element", "input": "[2, 5, 3, 0, 0, 3]", "output": "[2, 6, 5, 3, 4, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42906_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028790", "code": "def calculate_chunk_size(default_chunk_size: int, min_number_rows: int, max_line_length: int) -> int:\n    chunk_size = max(default_chunk_size, min_number_rows * max_line_length)\n    return chunk_size\n", "entry_point": "calculate_chunk_size", "input": "70, 7, 14", "output": "98", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138163_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028791", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[0, 3, 5, 3]", "output": "[3, 8, 8, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028792", "code": "def get_resources(input_list):\n    if not input_list:\n        return []\n    elif len(input_list) == 1:\n        return input_list\n    else:\n        return [input_list[0], input_list[-1]]\n", "entry_point": "get_resources", "input": "[6, 5]", "output": "[6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22883_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028793", "code": "def sound_url(host, game_id):\n    return \"ws://{}/{}/sound\".format(host, game_id)\n", "entry_point": "sound_url", "input": "'xeexeex8', 'ggga'", "output": "'ws://xeexeex8/ggga/sound'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31514_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028794", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5513", "output": "{1, 5513, 37, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5512", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028795", "code": "def translate_russian_to_english(message):\n    translations = {\n        '\u041f\u0440\u0438\u043d\u044f\u043b\u0438!': 'Accepted!',\n        '\u0421\u043f\u0430\u0441\u0438\u0431\u043e': 'Thank you',\n        '\u0437\u0430': 'for',\n        '\u0432\u0430\u0448\u0443': 'your',\n        '\u0437\u0430\u044f\u0432\u043a\u0443.': 'application.'\n    }\n    translated_message = []\n    words = message.split()\n    for word in words:\n        translated_word = translations.get(word, word)\n        translated_message.append(translated_word)\n    return ' '.join(translated_message)\n", "entry_point": "translate_russian_to_english", "input": "'\u0437\u0430\u044f\u0432\u043a\u0443.'", "output": "'application.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111635_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028796", "code": "from typing import List\ndef find_latest_version(versions: List[str]) -> str:\n    latest_version = \"\"\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if not latest_version or (major, minor, patch) > tuple(map(int, latest_version.split('.'))):\n            latest_version = version\n    return latest_version\n", "entry_point": "find_latest_version", "input": "['4.0.0', '4.1.0', '3.9.9', '4.2.0']", "output": "'4.2.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49230_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028797", "code": "import json\nfrom typing import List\ndef load_items(s: str) -> List[str]:\n    try:\n        # Try to parse the input string as a JSON list\n        return json.loads(s.replace(\"'\", '\"'))\n    except json.JSONDecodeError:\n        # If JSON parsing fails, split the string by commas and strip whitespace\n        return list(map(lambda x: x.strip(), s.split(',')))\n", "entry_point": "load_items", "input": "'[\"\"]'", "output": "['']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4393_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028798", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3259", "output": "{1, 3259}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3258", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028799", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8975", "output": "{1, 1795, 5, 359, 8975, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8974", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028800", "code": "def find_indices(nums, target):\n    num_indices = {}\n    for index, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], index]\n        num_indices[num] = index\n    return []\n", "entry_point": "find_indices", "input": "[2, 3, 4], 6", "output": "[0, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23894_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028801", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "355", "output": "{1, 355, 5, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt354", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028802", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6257", "output": "{1, 6257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6256", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1244", "output": "{1, 2, 4, 622, 311, 1244}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1243", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028804", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3439", "output": "{1, 19, 181, 3439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3438", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028805", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'<EMAIL>1'", "output": "'<EMAIL>1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028806", "code": "from typing import List, Dict\ndef convert_variable_types(variables: List[str]) -> Dict[str, str]:\n    variable_types = {}\n    for var in variables:\n        var_name, var_type = var.split(\":\")\n        var_name = var_name.strip()\n        var_type = var_type.strip()\n        variable_types[var_name] = var_type\n    return variable_types\n", "entry_point": "convert_variable_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46156_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028807", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<john.doe@le.com>'", "output": "('john.doe@le.com', 'le.com')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028808", "code": "def categorize_weights(weights):\n    category_dict = {1: [], 2: [], 3: [], 4: []}\n    for weight in weights:\n        if weight <= 10:\n            category_dict[1].append(weight)\n        elif weight <= 20:\n            category_dict[2].append(weight)\n        elif weight <= 30:\n            category_dict[3].append(weight)\n        else:\n            category_dict[4].append(weight)\n    return category_dict\n", "entry_point": "categorize_weights", "input": "[]", "output": "{1: [], 2: [], 3: [], 4: []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1655_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028809", "code": "def two_sum_indices(nums, target):\n    num_indices = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in num_indices:\n            return [num_indices[complement], i]\n        num_indices[num] = i\n    return []\n", "entry_point": "two_sum_indices", "input": "[2, 3], 5", "output": "[0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94760_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028810", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5846", "output": "{1, 2, 37, 74, 2923, 79, 5846, 158}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5845", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028811", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'0.1.10'", "output": "'0.1.11'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028812", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[3, 0, 1, 3, 2, 4, 3]", "output": "[8, 5, 6, 8, 7, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028813", "code": "def get_prn_from_nmea_id(nmea_id):\n    if nmea_id is None or not isinstance(nmea_id, int):\n        raise TypeError(\"NMEA ID must be a non-null integer\")\n    if nmea_id < 0:\n        return \"?-1\"\n    elif nmea_id == 0:\n        return \"?0\"\n    elif 0 < nmea_id <= 255:\n        return f\"?{nmea_id}\"\n    else:\n        return \"?255\"\n", "entry_point": "get_prn_from_nmea_id", "input": "190", "output": "'?190'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21933_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028814", "code": "def process_queue(tasks, n):\n    time_taken = 0\n    while tasks:\n        processing = tasks[:n]\n        max_time = max(processing)\n        time_taken += max_time\n        tasks = tasks[n:]\n    return time_taken\n", "entry_point": "process_queue", "input": "[8, 1, 2], 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31967_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028815", "code": "def populate_rois_lod(rois):\n    rois_lod = [[]]  # Initialize with an empty sublist\n    for element in rois:\n        if isinstance(element, int):\n            rois_lod[-1].append(element)  # Add integer to the last sublist\n        elif isinstance(element, list):\n            rois_lod.append(element.copy())  # Create a new sublist with elements of the list\n    return rois_lod\n", "entry_point": "populate_rois_lod", "input": "[6, 2, 2, 5, 6, 5, 1, 2]", "output": "[[6, 2, 2, 5, 6, 5, 1, 2]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2890_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028816", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string based on the dot ('.') separator\n    config_parts = default_config.split('.')\n    # Extract the second element from the resulting list, which represents the <app_name>\n    app_name = config_parts[1]\n    return app_name\n", "entry_point": "extract_app_name", "input": "'config.addrsapps'", "output": "'addrsapps'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87458_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028817", "code": "def calculate_score(cards):\n    total_score = 0\n    for card in cards:\n        if isinstance(card, int):\n            total_score += card\n        elif card in ['Jack', 'Queen', 'King']:\n            total_score += 10\n        elif card == 'Ace':\n            total_score += 1\n    return total_score\n", "entry_point": "calculate_score", "input": "['Jack', 'Queen', 'Ace', 'Ace']", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22349_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028818", "code": "from datetime import datetime, timedelta\nEXPIRATION_DAYS = 30\nSAFE_PERIOD = timedelta(days=7)\ndef calculate_total_charged_amount(orders, wirecard_transactions):\n    valid_orders = []\n    for order in orders:\n        order_date = datetime.strptime(order[\"order_date\"], \"%Y-%m-%d\")\n        if datetime.now() - order_date <= SAFE_PERIOD and datetime.now() - order_date <= timedelta(days=EXPIRATION_DAYS):\n            valid_orders.append(order)\n    total_charged_amount = 0\n    for order in valid_orders:\n        for transaction in wirecard_transactions:\n            if transaction[\"order_hash\"] == FAKE_WIRECARD_ORDER_HASH:  # Assuming FAKE_WIRECARD_ORDER_HASH is the key to match orders\n                total_charged_amount += order[\"charge_amount\"]\n                break\n    return total_charged_amount\n", "entry_point": "calculate_total_charged_amount", "input": "[], [{'order_hash': 'FAKE_WIRECARD_ORDER_HASH', 'some_other_key': 0}]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101330_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8752", "output": "{1, 2, 547, 4, 1094, 8, 2188, 8752, 16, 4376}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8751", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028820", "code": "from typing import Tuple\ndef extract_version_numbers(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'1.3.33'", "output": "(1, 3, 33)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11335_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028821", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[2, 2, 2, 6]", "output": "{2: 3, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028822", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[0, 9, -2, 7, -3, 11, -3, 9]", "output": "[9, 7, 5, 4, 8, 8, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71075_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028823", "code": "def calculate_weighted_average(probabilities):\n    weighted_sum = 0\n    for value, probability in probabilities.items():\n        weighted_sum += value * probability\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "{-4.296: 1.0}", "output": "-4.296", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63042_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028824", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'world worl'", "output": "{'worl': 1, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028825", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9904", "output": "{1, 2, 4, 8, 619, 2476, 9904, 16, 1238, 4952}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9903", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028826", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9807", "output": "{1, 3, 3269, 7, 9807, 467, 21, 1401}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028827", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[2, 2, 2, 1, 1, 1, -5, 0]", "output": "[4, 4, 4, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028828", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[1, [3, 2], 4, [1, [1]]]", "output": "[1, 3, 2, 4, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028829", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3685", "output": "{1, 737, 67, 5, 3685, 11, 335, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028830", "code": "def convert_duration(duration):\n    minutes = duration // 60\n    seconds = duration % 60\n    return f\"{minutes}:{seconds:02d}\"\n", "entry_point": "convert_duration", "input": "127", "output": "'2:07'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114570_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028831", "code": "def calculate_average(results):\n    if not results:\n        return 0  # Handle empty list case\n    total_sum = sum(results)\n    average = total_sum / len(results)\n    rounded_average = round(average)\n    return rounded_average\n", "entry_point": "calculate_average", "input": "[16]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125546_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028832", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[8, 8, 7, 8, 9, 9]", "output": "[8, 9, 9, 11, 13, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028833", "code": "# Dictionary mapping widget names to actions or tools\nwidget_actions = {\n    \"update_rect_image\": \"Update rectangle image\",\n    \"pan\": \"Pan functionality\",\n    \"draw_line_w_drag\": \"Draw a line while dragging\",\n    \"draw_line_w_click\": \"Draw a line on click\",\n    \"draw_arrow_w_drag\": \"Draw an arrow while dragging\",\n    \"draw_arrow_w_click\": \"Draw an arrow on click\",\n    \"draw_rect_w_drag\": \"Draw a rectangle while dragging\",\n    \"draw_rect_w_click\": \"Draw a rectangle on click\",\n    \"draw_polygon_w_click\": \"Draw a polygon on click\",\n    \"draw_point_w_click\": \"Draw a point on click\",\n    \"modify_existing_shape\": \"Modify existing shape\",\n    \"color_selector\": \"Select color from color selector\",\n    \"save_kml\": \"Save as KML file\",\n    \"select_existing_shape\": \"Select an existing shape\",\n    \"remap_dropdown\": \"Remap dropdown selection\"\n}\ndef get_widget_action(widget_name):\n    return widget_actions.get(widget_name, \"Invalid Widget\")\n", "entry_point": "get_widget_action", "input": "'draw_line_w_click'", "output": "'Draw a line on click'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16004_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028834", "code": "def calculate_final_balance(initial_balance, transactions):\n    balance = initial_balance\n    for transaction in transactions:\n        if transaction[\"type\"] == \"deposit\":\n            balance += transaction[\"amount\"]\n        elif transaction[\"type\"] == \"withdrawal\":\n            balance -= transaction[\"amount\"]\n    return balance\n", "entry_point": "calculate_final_balance", "input": "100, [{'type': 'deposit', 'amount': 1}]", "output": "101", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43701_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028835", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_list.append(cumulative_sum)\n    return cumulative_list\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 4, 2, 4, 3, 3, 5, 1, 1]", "output": "[1, 5, 7, 11, 14, 17, 22, 23, 24]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54659_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028836", "code": "JOB_STATES = {\n    'Q': 'QUEUED',\n    'H': 'HELD',\n    'R': 'RUNNING',\n    'E': 'EXITING',\n    'T': 'MOVED',\n    'W': 'WAITING',\n    'S': 'SUSPENDED',\n    'C': 'COMPLETED',\n}\ndef map_job_states(job_state_codes):\n    job_state_mapping = {}\n    for code in job_state_codes:\n        if code in JOB_STATES:\n            job_state_mapping[code] = JOB_STATES[code]\n    return job_state_mapping\n", "entry_point": "map_job_states", "input": "['C']", "output": "{'C': 'COMPLETED'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40681_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028837", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9124", "output": "{1, 2, 9124, 4, 2281, 4562}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9123", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028838", "code": "def clean_text(text):\n    return None if text is None else text.strip(\"'\\\"\")\n", "entry_point": "clean_text", "input": "\"'Ptyth'\"", "output": "'Ptyth'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132650_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028839", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[1, 2, 2, 2, 2, 2, 2, 4, 3]", "output": "{1: 1, 2: 6, 4: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028840", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9699", "output": "{1, 3233, 3, 9699, 53, 183, 61, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028841", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "-8.5, 1", "output": "-8.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028842", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            output_list.append(num + 10)\n        elif num % 2 != 0:\n            output_list.append(num - 5)\n        if num % 5 == 0:\n            output_list[-1] *= 2\n    return output_list\n", "entry_point": "process_integers", "input": "[16, 16, 16, 16, 17, 17, 17]", "output": "[26, 26, 26, 26, 12, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148920_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028843", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1213", "output": "{1, 1213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1212", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028844", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "53", "output": "{1, 53}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt52", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028845", "code": "def extract_package_names(requirements):\n    package_names = []\n    for requirement in requirements:\n        package_name = requirement.split('==')[0]\n        package_names.append(package_name)\n    return sorted(package_names)\n", "entry_point": "extract_package_names", "input": "['a==1.0.0']", "output": "['a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22477_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028846", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'919'", "output": "919", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028847", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[4, 2, 0]", "output": "[4, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028848", "code": "def calculate_resolution(zoom_level):\n    return (2 * 20037508.342789244) / (256 * pow(2, zoom_level))\n", "entry_point": "calculate_resolution", "input": "14", "output": "9.554628535647032", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47397_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028849", "code": "months = {\n    'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4,\n    'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8,\n    'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12\n}\ndef convert_date(input_date):\n    day, month_abbr, year = input_date.split()\n    month_num = months[month_abbr]\n    month_name = list(months.keys())[list(months.values()).index(month_num)]\n    output_date = f\"{month_name} {day}, {year}\"\n    return output_date\n", "entry_point": "convert_date", "input": "'15 Sep 2182'", "output": "'Sep 15, 2182'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147577_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028850", "code": "def calculate_total_bags(stack, must_contain):\n    numbags = 0\n    while len(stack) != 0:\n        bag, n = stack.pop()\n        numbags += n\n        if bag in must_contain:\n            for innerbag, m in must_contain[bag]:\n                stack.append((innerbag, n * m))\n    return numbags - 1\n", "entry_point": "calculate_total_bags", "input": "[], {}", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17568_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028851", "code": "SINGLE_BYTE_MAX = 0xF0\nMIDDLE_BYTE_MASK = 0x80\nTERMINAL_BYTE_MASK = 0x00\ndef encode_integer(value: int) -> bytes:\n    if value <= SINGLE_BYTE_MAX:\n        return bytes([value])\n    encoded_bytes = []\n    while value > 0:\n        byte = value & 0x7F\n        value >>= 7\n        if value > 0:\n            byte |= MIDDLE_BYTE_MASK\n        else:\n            byte |= TERMINAL_BYTE_MASK\n        encoded_bytes.insert(0, byte)\n    return bytes(encoded_bytes)\n", "entry_point": "encode_integer", "input": "197", "output": "b'\\xc5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71476_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9107", "output": "{1, 9107, 1301, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9106", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028853", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3766", "output": "{1, 2, 7, 269, 14, 3766, 538, 1883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028854", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6653", "output": "{1, 6653}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028855", "code": "def f(method):\n    if method == 'GET':\n        return \"<h1>MyClub Event Calendar get</h1>\"\n    elif method == 'POST':\n        return \"<h1>MyClub Event Calendar post</h1>\"\n    else:\n        return \"<h1>MyClub Event Calendar</h1>\"\n", "entry_point": "f", "input": "'GET'", "output": "'<h1>MyClub Event Calendar get</h1>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106549_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028856", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8949", "output": "{1, 3, 2983, 19, 8949, 471, 57, 157}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028857", "code": "def format_service_options(options_list):\n    output = \"Service Initialization Details:\\n\"\n    for idx, option in enumerate(options_list, start=1):\n        api_key = option.get('api_key', 'N/A')\n        app_key = option.get('app_key', 'N/A')\n        output += f\"Option {idx} - API Key: {api_key}, App Key: {app_key}\\n\"\n    return output\n", "entry_point": "format_service_options", "input": "[]", "output": "'Service Initialization Details:\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14863_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028858", "code": "def convert_to_month_names(month_numbers):\n    month_dict = {\n        \"01\": \"January\",\n        \"02\": \"February\",\n        \"03\": \"March\",\n        \"04\": \"April\",\n        \"05\": \"May\",\n        \"06\": \"June\",\n        \"07\": \"July\",\n        \"08\": \"August\",\n        \"09\": \"September\",\n        \"10\": \"October\",\n        \"11\": \"November\",\n        \"12\": \"December\",\n    }\n    result = []\n    for month_num in month_numbers:\n        if month_num in month_dict:\n            result.append(month_dict[month_num])\n        else:\n            result.append(\"Invalid Month\")\n    return result\n", "entry_point": "convert_to_month_names", "input": "['00', '05', '05']", "output": "['Invalid Month', 'May', 'May']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132280_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028859", "code": "def remove_c(my_string):\n    newStr = \"\"\n    for char in my_string:\n        if char.lower() != 'c':\n            newStr += char\n    return newStr\n", "entry_point": "remove_c", "input": "'coding is on!'", "output": "'oding is on!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81499_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028860", "code": "def calculate_power(base, exponent):\n    if exponent <= 0:\n        return 'O expoente tem que ser positivo'\n    result = 1\n    for _ in range(exponent):\n        result *= base\n    return result\n", "entry_point": "calculate_power", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6230_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028861", "code": "from typing import List\ndef convert_to_floats(str_list: List[str]) -> List[float]:\n    float_list = []\n    for s in str_list:\n        f = round(float(s), 2)\n        float_list.append(f)\n    return float_list\n", "entry_point": "convert_to_floats", "input": "['3.14', '2.72', '42']", "output": "[3.14, 2.72, 42.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59989_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028862", "code": "from typing import List, Dict\nimport os\ndef count_files_per_directory(file_paths: List[str]) -> Dict[str, int]:\n    file_count_per_directory = {}\n    for file_path in file_paths:\n        directory_name = os.path.basename(os.path.dirname(file_path))\n        file_count_per_directory[directory_name] = file_count_per_directory.get(directory_name, 0) + 1\n    return file_count_per_directory\n", "entry_point": "count_files_per_directory", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109919_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028863", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[3, -1, 0, -1]", "output": "[3, 0, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48112_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028864", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'chtiih'", "output": "'chtiih'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028865", "code": "def calculate_distances(S1, S2):\n    map = {}\n    initial = 0\n    distance = []\n    for i in range(26):\n        map[S1[i]] = i\n    for i in S2:\n        distance.append(abs(map[i] - initial))\n        initial = map[i]\n    return distance\n", "entry_point": "calculate_distances", "input": "'abcdefghijklmnopqrstuvwxyz', 's'", "output": "[18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35345_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028866", "code": "def transliterate(input_str):\n    # Rule 1: Replace leading 'S' with '\u30b5\u30f3'\n    if input_str.startswith('S'):\n        input_str = '\u30b5\u30f3' + input_str[1:]\n    # Rule 2: Ignore glottal stop (')\n    input_str = input_str.replace(\"'\", \"\")\n    # Rule 3: Replace double 'i' with '\u30a4\u30b7\u30a4'\n    input_str = input_str.replace('ii', '\u30a4\u30b7\u30a4')\n    return input_str\n", "entry_point": "transliterate", "input": "'Samapei'", "output": "'\u30b5\u30f3amapei'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22142_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028867", "code": "def calculate_dot_product(list1, list2):\n    dot_product = 0\n    for i in range(len(list1)):\n        dot_product += list1[i] * list2[i]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[2, 3, 5], [1, 4, 3]", "output": "29", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118702_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028868", "code": "def math_operation(num):\n    if num % 2 == 0:  # Check if the number is even\n        return num // 2  # Return input divided by 2 for even numbers\n    else:\n        return num * 3 + 1  # Return input multiplied by 3 and incremented by 1 for odd numbers\n", "entry_point": "math_operation", "input": "68", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40076_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028869", "code": "from typing import List\ndef smallestRangeDifference(A: List[int], K: int) -> int:\n    A.sort()\n    ans = A[-1] - A[0]\n    for x, y in zip(A, A[1:]):\n        ans = min(ans, max(A[-1]-K, x+K) - min(A[0]+K, y-K))\n    return ans\n", "entry_point": "smallestRangeDifference", "input": "[0, 8], 2", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93507_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028870", "code": "def decode_secret_message(encoded_message, shift):\n    decoded_message = \"\"\n    for char in encoded_message:\n        if char.isalpha():\n            if char.islower():\n                decoded_message += chr(((ord(char) - ord('a') - shift) % 26) + ord('a'))\n            else:\n                decoded_message += chr(((ord(char) - ord('A') - shift) % 26) + ord('A'))\n        else:\n            decoded_message += char\n    return decoded_message\n", "entry_point": "decode_secret_message", "input": "'sp', 3", "output": "'pm'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69063_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028871", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[[1, 2], [3, [4]], [5, 6, [7, 8]]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028872", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1549", "output": "{1, 1549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1548", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028873", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "87", "output": "'qst_learn_where_merchant_brother_is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028874", "code": "def extract_version_numbers(version_str):\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_numbers", "input": "'373731'", "output": "(373731,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80792_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028875", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[35, 39, 39, 45]", "output": "39.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105025_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028876", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3979", "output": "{1, 3979, 173, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3978", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028877", "code": "def next_stage(stage, choice):\n    if stage == 2 and choice == 2:\n        return 3\n    elif stage == 3 and choice == 1:\n        return 1\n    elif stage == 3 and choice == 2:\n        return 3\n    else:\n        return stage  # Return the same stage if no specific rule matches\n", "entry_point": "next_stage", "input": "7, 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99872_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028878", "code": "def get_original_image_link(input_url):\n    suffix = \"_150x150\"\n    if suffix in input_url:\n        index = input_url.index(suffix)\n        return input_url[:index]\n    return input_url\n", "entry_point": "get_original_image_link", "input": "'/ex_150x150'", "output": "'/ex'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97680_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028879", "code": "from collections import deque\ndef min_minutes_to_rot_all_oranges(grid):\n    if not grid or len(grid) == 0:\n        return 0\n    n = len(grid)\n    m = len(grid[0])\n    rotten = deque()\n    fresh_count = 0\n    minutes = 0\n    for i in range(n):\n        for j in range(m):\n            if grid[i][j] == 2:\n                rotten.append((i, j))\n            elif grid[i][j] == 1:\n                fresh_count += 1\n    directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]\n    while rotten:\n        if fresh_count == 0:\n            return minutes\n        size = len(rotten)\n        for _ in range(size):\n            x, y = rotten.popleft()\n            for dx, dy in directions:\n                nx, ny = x + dx, y + dy\n                if 0 <= nx < n and 0 <= ny < m and grid[nx][ny] == 1:\n                    grid[nx][ny] = 2\n                    fresh_count -= 1\n                    rotten.append((nx, ny))\n        minutes += 1\n    return -1\n", "entry_point": "min_minutes_to_rot_all_oranges", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1036_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028880", "code": "import math\ndef inv_cdf_logistic(mu, s, p):\n    return mu + s * math.log(p / (1 - p))\n", "entry_point": "inv_cdf_logistic", "input": "-7.181624211135693, 1, 0.5", "output": "-7.181624211135693", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86075_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028881", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4859", "output": "{1, 4859, 43, 113}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028882", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5491", "output": "{1, 289, 323, 17, 19, 5491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028883", "code": "def encrypt_text(text, shift):\n    encrypted_text = \"\"\n    for char in text:\n        if char == \" \":\n            encrypted_text += \" \"\n        else:\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'hello world', 3", "output": "'khoor zruog'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51413_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7586", "output": "{1, 7586, 2, 3793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028885", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[34, 25, 91, 22, 25, 34, 25]", "output": "[22, 25, 25, 25, 34, 34, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028886", "code": "def sum_even_fibonacci(fibonacci_list):\n    even_sum = 0\n    for num in fibonacci_list:\n        if num % 2 == 0:\n            even_sum += num\n    return even_sum\n", "entry_point": "sum_even_fibonacci", "input": "[2, 34, 1, 3, 5]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63942_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028887", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[1, 1, 1, 1, 1, 6]", "output": "{1: 5, 6: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028888", "code": "order_params = [\n    'accelerometer', 'game_rotation_vector', 'gyroscope',\n    'gyroscope_uncalibrated', 'linear_acceleration', 'orientation',\n    'rotation_vector', 'sound'\n]\norder_types = ['mean', 'min', 'max', 'std']\n# Simulated function to retrieve parameter values\ndef get_param_value(param):\n    return f\"Value of {param}\"\n", "entry_point": "get_param_value", "input": "'gyroscope_uncalibrated'", "output": "'Value of gyroscope_uncalibrated'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83025_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028889", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(1, 2)]", "output": "{1: [2]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028890", "code": "def generate_telegram_url(api_token):\n    URL_BASE = 'https://api.telegram.org/file/bot'\n    complete_url = URL_BASE + api_token + '/'\n    return complete_url\n", "entry_point": "generate_telegram_url", "input": "'PUETERE'", "output": "'https://api.telegram.org/file/botPUETERE/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139134_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028891", "code": "def simulate_card_game(deck_a, deck_b):\n    score_a, score_b = 0, 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            score_a += 1\n        elif card_b > card_a:\n            score_b += 1\n    return score_a, score_b\n", "entry_point": "simulate_card_game", "input": "[5, 6, 7, 8, 9, 1, 2], [4, 3, 2, 1, 0, 2, 3]", "output": "(5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77887_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028892", "code": "from typing import List\ndef sum_with_next(lst: List[int]) -> List[int]:\n    result = []\n    for i in range(len(lst) - 1):\n        result.append(lst[i] + lst[i + 1])\n    result.append(lst[-1] + lst[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[3, 2, 0, 4, 1, 3, 2, 3]", "output": "[5, 2, 4, 5, 4, 5, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111975_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028893", "code": "def calculate_average(numbers):\n    total_sum = 0\n    for num in numbers:\n        total_sum += num\n    average = total_sum / len(numbers)\n    return average\n", "entry_point": "calculate_average", "input": "[16, 16, 16, 16, 16, 16, 16, 16, 18]", "output": "16.22222222222222", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142119_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028894", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[15, 5, 10]", "output": "(15, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028895", "code": "from typing import List\ndef find_unique_elements(arr: List[int]) -> List[int]:\n    unique_set = set()\n    unique_list = []\n    for num in arr:\n        if num not in unique_set:\n            unique_set.add(num)\n            unique_list.append(num)\n    return unique_list\n", "entry_point": "find_unique_elements", "input": "[3, 2, 3, 1, 4, 1, 2]", "output": "[3, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19846_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028896", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7991", "output": "{1, 131, 61, 7991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028897", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4898", "output": "{1, 4898, 2, 79, 2449, 62, 158, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028898", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9015", "output": "{1, 3, 5, 1803, 15, 9015, 601, 3005}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028899", "code": "def nthUglyNumber(n):\n    ugly = [1]\n    p2 = p3 = p5 = 0\n    next_multiple_of_2 = 2\n    next_multiple_of_3 = 3\n    next_multiple_of_5 = 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_of_2, next_multiple_of_3, next_multiple_of_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_of_2:\n            p2 += 1\n            next_multiple_of_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_of_3:\n            p3 += 1\n            next_multiple_of_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_of_5:\n            p5 += 1\n            next_multiple_of_5 = ugly[p5] * 5\n    return ugly[-1]\n", "entry_point": "nthUglyNumber", "input": "3", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114260_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028900", "code": "def calculate_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first participant as 1\n    current_rank = 1\n    prev_score = scores[0]\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)\n        else:\n            current_rank = i + 1\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[100, 100, 100, 100, 101, 102, 103, 104, 104]", "output": "[1, 1, 1, 1, 5, 6, 7, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122200_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028901", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "12345, {1: False, 2: False, 3: True, -1: True}", "output": "[3, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028902", "code": "def calculate_class_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_class_average", "input": "[50, 60, 61.5, 62, 100]", "output": "61.166666666666664", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107452_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028903", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[3, 1, 0, 2, 2, 3, 3]", "output": "[3, 4, 4, 6, 8, 11, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028904", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4699", "output": "{1, 4699, 37, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028905", "code": "def flatten_list(nested_list):\n    result = []\n    def flatten_recursive(nested):\n        for item in nested:\n            if isinstance(item, int):\n                result.append(item)\n            elif isinstance(item, list):\n                flatten_recursive(item)\n    flatten_recursive(nested_list)\n    return result\n", "entry_point": "flatten_list", "input": "[[4], 1, [[5], [5]], 9, [8]]", "output": "[4, 1, 5, 5, 9, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38451_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028906", "code": "def process_genetic_data(line):\n    def int_no_zero(s):\n        return int(s.lstrip('0')) if s.lstrip('0') else 0\n    indiv_name, marker_line = line.split(',')\n    markers = marker_line.replace('\\t', ' ').split(' ')\n    markers = [marker for marker in markers if marker != '']\n    if len(markers[0]) in [2, 4]:  # 2 digits per allele\n        marker_len = 2\n    else:\n        marker_len = 3\n    try:\n        allele_list = [(int_no_zero(marker[0:marker_len]), int_no_zero(marker[marker_len:]))\n                       for marker in markers]\n    except ValueError:  # Haploid\n        allele_list = [(int_no_zero(marker[0:marker_len]),)\n                       for marker in markers]\n    return indiv_name, allele_list, marker_len\n", "entry_point": "process_genetic_data", "input": "'78Eve, 55500'", "output": "('78Eve', [(555, 0)], 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138215_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028907", "code": "def modify_email(email_data):\n    # Modify the email by adding a new recipient to the \"To\" field\n    new_recipient = \"NewRecipient@example.com\"\n    email_data = email_data.replace(\"To: Recipient 1\", f\"To: Recipient 1, {new_recipient}\")\n    # Update the email subject to include \"Modified\"\n    email_data = email_data.replace(\"Subject: test mail\", \"Subject: Modified: test mail\")\n    return email_data\n", "entry_point": "modify_email", "input": "'RethienTo:t'", "output": "'RethienTo:t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12643_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028908", "code": "def ulen(s):\n    stripped_string = s.strip()\n    return len(stripped_string)\n", "entry_point": "ulen", "input": "'   Hello World   '", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3080_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028909", "code": "def bicubic_kernel(x, a=-0.50):\n    abs_x = abs(x)\n    if abs_x <= 1.0:\n        return (a + 2.0) * (abs_x ** 3.0) - (a + 3.0) * (abs_x ** 2.0) + 1\n    elif 1.0 < abs_x < 2.0:\n        return a * (abs_x ** 3) - 5.0 * a * (abs_x ** 2.0) + 8.0 * a * abs_x - 4.0 * a\n    else:\n        return 0.0\n", "entry_point": "bicubic_kernel", "input": "1.5", "output": "-0.0625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11047_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028910", "code": "def modify_string(input_string):\n    if \"python\" in input_string.lower() and \"code\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\", 1)\n        input_string = input_string.replace(\"code\", \"practice\", 1)\n    elif \"python\" in input_string.lower():\n        input_string = input_string.replace(\"python\", \"Java\")\n    elif \"code\" in input_string.lower():\n        input_string = input_string.replace(\"code\", \"practice\")\n    return input_string\n", "entry_point": "modify_string", "input": "'pythonp'", "output": "'Javap'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81896_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028911", "code": "def filter_metrics(metrics, threshold):\n    filtered_metrics = []\n    for metric in metrics:\n        if metric[\"value\"] > threshold:\n            filtered_metrics.append(metric)\n    return filtered_metrics\n", "entry_point": "filter_metrics", "input": "[], 10", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33183_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028912", "code": "from typing import List\ndef sum_multiples_3_5_unique(numbers: List[int]) -> int:\n    unique_multiples = set()\n    for num in numbers:\n        if num % 3 == 0 or num % 5 == 0:\n            unique_multiples.add(num)\n    return sum(unique_multiples)\n", "entry_point": "sum_multiples_3_5_unique", "input": "[3, 5, 10]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57809_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028913", "code": "def ajax_switch_site(website):\n    print(f\"Switching to {website}\")\n    return website\n", "entry_point": "ajax_switch_site", "input": "'exexample.comampcom'", "output": "'exexample.comampcom'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51380_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028914", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9619", "output": "{1, 9619}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9618", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028915", "code": "import re\ndef parse_dependencies_info(code_snippet):\n    dependencies_info = {}\n    pattern = r\"depends_on\\('([^']*)',.*version='([^']*)'(?:, sha256='([^']*)')?\"\n    matches = re.findall(pattern, code_snippet)\n    for match in matches:\n        dependency_name, version, sha256 = match\n        dependencies_info[dependency_name] = {'version': version, 'sha256': sha256 if sha256 else None}\n    return dependencies_info\n", "entry_point": "parse_dependencies_info", "input": "'This is a sample code without dependencies.'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8646_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028916", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "273", "output": "{1, 3, 7, 39, 13, 273, 21, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt272", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028917", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'TTTTmieii'", "output": "'TTTTmieii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028918", "code": "def dailyTemperatures(temperatures):\n    stack = []\n    result = [0] * len(temperatures)\n    for i, temp in enumerate(temperatures):\n        while stack and temp > temperatures[stack[-1]]:\n            prev_index = stack.pop()\n            result[prev_index] = i - prev_index\n        stack.append(i)\n    return result\n", "entry_point": "dailyTemperatures", "input": "[73, 74, 75, 71, 69, 72, 76, 73]", "output": "[1, 1, 4, 2, 1, 1, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134803_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028919", "code": "def transform_list(input_list):\n    transformed_list = []\n    # Double the value of each integer and add it to the transformed list\n    for num in input_list:\n        transformed_list.append(num * 2)\n    # Remove duplicates by converting the list to a set and back to a list\n    transformed_list = list(set(transformed_list))\n    # Sort the list in ascending order\n    transformed_list.sort()\n    return transformed_list\n", "entry_point": "transform_list", "input": "[1, 2, 6, 10]", "output": "[2, 4, 12, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40709_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028920", "code": "def generate_widget(y, period, pipeline):\n    total_value = y * period\n    widget_dict = {pipeline: total_value}\n    return widget_dict\n", "entry_point": "generate_widget", "input": "-96, 2, 'fofo'", "output": "{'fofo': -192}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13273_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028921", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "7, 16", "output": "(25, 16, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028922", "code": "def integer_operations(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num + 10)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num + 5)\n    return result\n", "entry_point": "integer_operations", "input": "[2, 2, 3, 2, 0, 1, 1, 9]", "output": "[4, 4, 27, 4, 10, 6, 6, 729]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47391_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028923", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    scores.sort(reverse=True)\n    num_students = len(scores)\n    if num_students < 5:\n        return sum(scores) / num_students\n    else:\n        return sum(scores[:5]) / 5\n", "entry_point": "top5_average", "input": "[90, 90, 88, 89, 88]", "output": "89.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20175_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028924", "code": "def calculate_accuracy(y_true, y_pred):\n    if len(y_true) != len(y_pred):\n        raise ValueError(\"Length of true labels and predicted labels must be the same.\")\n    correct_predictions = 0\n    total_predictions = len(y_true)\n    for true_label, pred_label in zip(y_true, y_pred):\n        if true_label == pred_label:\n            correct_predictions += 1\n    accuracy = correct_predictions / total_predictions\n    return accuracy\n", "entry_point": "calculate_accuracy", "input": "[1, 0, 1, 0], [1, 1, 0, 0]", "output": "0.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38023_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1461", "output": "{1, 3, 1461, 487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028926", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9215", "output": "{1, 97, 5, 485, 19, 1843, 95, 9215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028927", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6709", "output": "{1, 6709}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6708", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028928", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "413", "output": "{1, 59, 413, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028929", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[1, 2, 0, 3, 2, 1, 5, 2]", "output": "[1, 3, 2, 6, 6, 6, 11, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71511_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028930", "code": "def authenticate_user(username, password):\n    valid_username = 'admin'\n    valid_password = 'password123'\n    if username == valid_username and password == valid_password:\n        return 'Authentication successful!'\n    else:\n        return 'Invalid username and password pair.'\n", "entry_point": "authenticate_user", "input": "'admin', 'password123'", "output": "'Authentication successful!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6081_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028931", "code": "def filter_even_numbers(input_list):\n    even_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n    return even_numbers\n", "entry_point": "filter_even_numbers", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[2, 4, 6, 8, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125329_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028932", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5842", "output": "{1, 2, 2921, 46, 5842, 23, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5841", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028933", "code": "def max_steps(staircase):\n    if not staircase:\n        return 0\n    prev1 = prev2 = 0\n    for steps in staircase:\n        current = max(prev1 + steps, prev2 + steps)\n        prev1, prev2 = prev2, current\n    return max(prev1, prev2)\n", "entry_point": "max_steps", "input": "[7, 1, 6, 2]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37966_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028934", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'4+2'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028935", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "123, 1", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028936", "code": "from itertools import combinations\ndef find_minimum_value(sum_heights, to_sub, top):\n    minimum = -1\n    for r in range(len(to_sub) + 1):\n        for comb in combinations(to_sub, r):\n            value = sum(sum_heights) + sum(comb)\n            if value >= top and (minimum == -1 or minimum > value):\n                minimum = value\n    return minimum\n", "entry_point": "find_minimum_value", "input": "[50], [1], 51", "output": "51", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131602_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028937", "code": "def remove_non_alphanumeric(input_str):\n    result = ''\n    for char in input_str:\n        if char.isalnum() or char == '_':\n            result += char\n    return result\n", "entry_point": "remove_non_alphanumeric", "input": "'h'", "output": "'h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139297_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028938", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'you?oyoWHello'", "output": "('you?oyoWHello', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028939", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7334", "output": "{1, 2, 386, 193, 7334, 38, 19, 3667}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7333", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028940", "code": "def generate_error_endpoint(blueprint_name, url_prefix):\n    # Concatenate the URL prefix with the blueprint name to form the complete API endpoint URL\n    api_endpoint = f\"{url_prefix}/{blueprint_name}\"\n    return api_endpoint\n", "entry_point": "generate_error_endpoint", "input": "'erorts', '/apirors'", "output": "'/apirors/erorts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69413_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028941", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'2.2.2'", "output": "'2.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028942", "code": "from typing import List, Tuple\ndef process_numbers(numbers: List[int]) -> Tuple[int, int]:\n    count = 0\n    total_sum = 0\n    for num in numbers:\n        count += 1\n        total_sum += num\n        if num == 999:\n            break\n    return count - 1, total_sum - 999  # Adjusting count and sum for excluding the terminating 999\n", "entry_point": "process_numbers", "input": "[10, 20, 30, 15, 5, 11, 20, 0, 999]", "output": "(8, 111)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24887_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028943", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028944", "code": "def max_total_height(crops):\n    min_height = min(crops)\n    total_height = min_height * len(crops)\n    return total_height\n", "entry_point": "max_total_height", "input": "[5, 5, 5, 5, 5, 5, 5]", "output": "35", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109252_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028945", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "839", "output": "{1, 839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028946", "code": "from typing import List, Dict\ndef parse_admin_attributes(attributes: List[str]) -> Dict[str, str]:\n    attribute_mapping = {}\n    for attribute_str in attributes:\n        attribute_name, attribute_value = attribute_str.split('=')\n        attribute_mapping[attribute_name.strip()] = attribute_value.strip()\n    return attribute_mapping\n", "entry_point": "parse_admin_attributes", "input": "['another_key= another_value']", "output": "{'another_key': 'another_value'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121439_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028947", "code": "def calculate_time_differences(time_seq):\n    time_diff = []\n    for i in range(1, len(time_seq)):\n        diff = time_seq[i] - time_seq[i - 1]\n        time_diff.append(diff)\n    return time_diff\n", "entry_point": "calculate_time_differences", "input": "[0, 6, 15, -1, -1, 6, 7, 14]", "output": "[6, 9, -16, 0, 7, 1, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11826_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028948", "code": "def generate_feature_names(number_of_gaussians):\n    feature_names = []\n    for i in range(number_of_gaussians):\n        feature_names += [f'mu{i+1}', f'sd{i+1}']\n    for i in range(number_of_gaussians):\n        for j in range(i+1, number_of_gaussians):\n            feature_names.append(f'overlap {i+1}-{j+1}')\n    return feature_names\n", "entry_point": "generate_feature_names", "input": "1", "output": "['mu1', 'sd1']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61755_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028949", "code": "def most_frequent_char(input_string):\n    input_string = input_string.lower().replace(\" \", \"\")\n    char_freq = {}\n    max_freq = 0\n    for char in input_string:\n        if char.isalpha():\n            char_freq[char] = char_freq.get(char, 0) + 1\n            max_freq = max(max_freq, char_freq[char])\n    most_frequent_chars = [char for char, freq in char_freq.items() if freq == max_freq]\n    return most_frequent_chars\n", "entry_point": "most_frequent_char", "input": "'rgrgm mgmr'", "output": "['r', 'g', 'm']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105115_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028950", "code": "def calculate_video_duration(fps, total_frames):\n    total_duration = total_frames / fps\n    return round(total_duration, 2)\n", "entry_point": "calculate_video_duration", "input": "30, 900", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131697_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028951", "code": "def calculate_diff(string1, string2):\n    if len(string1) != len(string2):\n        return \"Strings are of different length\"\n    diff_count = 0\n    for i in range(len(string1)):\n        if string1[i] != string2[i]:\n            diff_count += 1\n    return diff_count\n", "entry_point": "calculate_diff", "input": "'abcde', 'abfde'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98507_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028952", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'sentence'", "output": "{'sentence': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028953", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[1, 3, 5, 4, 3, 5, 4, 2, 4]", "output": "[4, 8, 9, 7, 8, 9, 6, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89166_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028954", "code": "def convert(s: str) -> str:\n    result = \"\"\n    for c in s:\n        if c.isalpha():\n            if c.islower():\n                result += c.upper()\n            else:\n                result += c.lower()\n        elif c.isdigit():\n            result += '#'\n        else:\n            result += c\n    return result\n", "entry_point": "convert", "input": "'llHello012'", "output": "'LLhELLO###'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60962_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028955", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5529", "output": "{1, 97, 3, 291, 19, 1843, 5529, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028956", "code": "from typing import List\ndef distribute_candies(num_people: int, candies: int, k: int) -> List[int]:\n    i = k // num_people\n    j = k % num_people if k % num_people != 0 else num_people\n    remain = candies - i * (i - 1) * num_people // 2  # Remaining candies after k rounds\n    res = []\n    for ind in range(1, num_people + 1):\n        if ind < j:\n            res.append((i + 1) * i // 2 * num_people + (i + 1) * ind)\n        else:\n            tmp = (i * (i - 1) // 2 * num_people if i > 0 else 0) + i * ind\n            if ind == j:\n                res.append(tmp + remain)\n            else:\n                res.append(tmp)\n    return res\n", "entry_point": "distribute_candies", "input": "1, 17, 0", "output": "[17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75055_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028957", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[3, 3, 1, 1, 0, 0, 0, 1, 3]", "output": "'aaabbbcdhiii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028958", "code": "def oembed_status(request):\n    if 'format' in request and request.get('format') == 'xml':\n        return 501\n    if not request or 'url' not in request or not request.get('url'):\n        return 400\n    return 200\n", "entry_point": "oembed_status", "input": "{}", "output": "400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138270_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028959", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[4, 9, 5, 7, 16, 18, 0]", "output": "[0, 9, 5, 7, 0, 18, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028960", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'EBIIL', 3", "output": "'HELLO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028961", "code": "def longest_palindromic_substring(s):\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    max_palindrome = \"\"\n    for i in range(len(s)):\n        # Odd-length palindrome\n        palindrome1 = expand_around_center(s, i, i)\n        # Even-length palindrome\n        palindrome2 = expand_around_center(s, i, i + 1)\n        if len(palindrome1) > len(max_palindrome):\n            max_palindrome = palindrome1\n        if len(palindrome2) > len(max_palindrome):\n            max_palindrome = palindrome2\n    return max_palindrome\n", "entry_point": "longest_palindromic_substring", "input": "'aaaa'", "output": "'aaaa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137320_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028962", "code": "def bubble_sort(A):\n    n = len(A)\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(n-1):\n            if A[i] > A[i+1]:\n                A[i], A[i+1] = A[i+1], A[i]\n                swapped = True\n    return A\n", "entry_point": "bubble_sort", "input": "[90, 35, 11, 91, 89, 34, 90, 91, 90]", "output": "[11, 34, 35, 89, 90, 90, 90, 91, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3392_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028963", "code": "def load_model_path(version: int) -> str:\n    file_path = f\"./prespawned/version{version}_trained.pkl\"\n    return file_path\n", "entry_point": "load_model_path", "input": "2", "output": "'./prespawned/version2_trained.pkl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145300_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028964", "code": "def maximum_product_of_three(nums):\n    nums.sort()\n    n = len(nums)\n    # Potential products\n    product1 = nums[-1] * nums[-2] * nums[-3]\n    product2 = nums[0] * nums[1] * nums[-1]\n    return max(product1, product2)\n", "entry_point": "maximum_product_of_three", "input": "[-10, 2, 4, 5]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93080_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028965", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[4, 4, 4, 4, 2, 3]", "output": "{4: 4, 2: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028966", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4289", "output": "{1, 4289}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4288", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028967", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4378", "output": "{1, 2, 199, 11, 2189, 398, 22, 4378}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4377", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028968", "code": "def bubble_sort(inputList):\n    listCount = len(inputList)\n    for x in range(listCount - 1):\n        alreadySorted = True\n        print('Iteration', x)\n        for y in range(x+1, listCount):  # Fix the loop range\n            if inputList[x] > inputList[y]:\n                temp = inputList[x]\n                inputList[x] = inputList[y]\n                inputList[y] = temp\n                alreadySorted = False\n        if alreadySorted:\n            continue\n    return inputList\n", "entry_point": "bubble_sort", "input": "[90, 25, 23, 23, 23, 90]", "output": "[23, 23, 23, 25, 90, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127065_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028969", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4053", "output": "{1, 193, 3, 579, 7, 1351, 4053, 21}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1034", "output": "{1, 2, 517, 1034, 11, 47, 22, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028971", "code": "def calculate_duration(start_time, elapsed_seconds):\n    start_seconds = start_time[0] * 3600 + start_time[1] * 60 + start_time[2]\n    end_seconds = start_seconds + elapsed_seconds\n    total_duration = end_seconds % (24 * 3600)  # Ensure end time is within a 24-hour period\n    return total_duration\n", "entry_point": "calculate_duration", "input": "(15, 19, 43), 1000", "output": "56183", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112372_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028972", "code": "def snake_to_camel(s):\n    words = s.split('_')\n    camel_case = words[0] + ''.join(word.capitalize() for word in words[1:])\n    return camel_case\n", "entry_point": "snake_to_camel", "input": "'hethes_ia'", "output": "'hethesIa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46573_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028973", "code": "from typing import Tuple\ndef extract_version_number(version_str: str) -> Tuple[int, ...]:\n    version_parts = version_str.split('.')\n    version_numbers = tuple(int(part) for part in version_parts)\n    return version_numbers\n", "entry_point": "extract_version_number", "input": "'102.5.2'", "output": "(102, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41173_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028974", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5366", "output": "{1, 2, 2683, 5366}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028975", "code": "def generate_url_config(url_patterns):\n    config = []\n    for pattern in url_patterns:\n        if 'ViewSet' in pattern['view']:\n            config.append(f\"router.register(r'{pattern['pattern']}', views.{pattern['view']})\")\n        else:\n            config.append(f\"path('{pattern['pattern']}', {pattern['view']})\")\n    config.append(\"path('', include(router.urls))\")\n    return config\n", "entry_point": "generate_url_config", "input": "[]", "output": "[\"path('', include(router.urls))\"]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74738_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028976", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[8, 8, 8, 5, 5, 5, 9, 9]", "output": "([8, 8, 8], [5, 5, 5, 9, 9])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028977", "code": "def custom_fibonacci_sequence(nterms):\n    sequence = [0, 1]\n    for i in range(2, nterms):\n        if i % 3 == 0:\n            next_element = sequence[i - 1] * sequence[i - 2]\n        else:\n            next_element = sequence[i - 1] + sequence[i - 2]\n        sequence.append(next_element)\n    return sequence[:nterms]\n", "entry_point": "custom_fibonacci_sequence", "input": "4", "output": "[0, 1, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43324_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028978", "code": "def manipulate_list(input_list):\n    # Filter out even numbers, square each remaining number, and sort in descending order\n    modified_list = sorted([num**2 for num in input_list if num % 2 != 0], reverse=True)\n    return modified_list\n", "entry_point": "manipulate_list", "input": "[9, 7, 7, 3, 3, 3]", "output": "[81, 49, 49, 9, 9, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123237_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028979", "code": "import re\ndef count_words_frequency(text, top_n):\n    words = {}\n    wordlike = re.compile(r\"[a-zA-Z']+\")\n    for word in wordlike.findall(text):\n        word = word.lower()\n        words[word] = words.get(word, 0) + 1\n    sorted_words = dict(sorted(words.items(), key=lambda x: x[1], reverse=True))\n    top_n_words = {k: sorted_words[k] for k in list(sorted_words)[:top_n]}\n    return top_n_words\n", "entry_point": "count_words_frequency", "input": "'', 5", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114975_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028980", "code": "def transform_list(input_list):\n    transformed_list = []\n    for i in range(len(input_list) - 1):\n        transformed_list.append(input_list[i] + input_list[i + 1])\n    transformed_list.append(input_list[-1] + input_list[0])\n    return transformed_list\n", "entry_point": "transform_list", "input": "[8, 1, 3, 2, 2, 3, 5, 3]", "output": "[9, 4, 5, 4, 5, 8, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8539_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028981", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1017", "output": "{1, 3, 9, 113, 339, 1017}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028982", "code": "def generate_file_path(agent: str, energy: str) -> str:\n    top_path = './experiments_results/gym/' + agent + '/'\n    if 'Energy0' in energy:\n        ene_sub = '_E0'\n    elif 'EnergyOne' in energy:\n        ene_sub = '_E1'\n    if agent == 'HalfCheetah':\n        abrv = 'HC'\n    elif agent == 'HalfCheetahHeavy':\n        abrv = 'HCheavy'\n    elif agent == 'FullCheetah':\n        abrv = 'FC'\n    else:\n        abrv = agent\n    return top_path + abrv + ene_sub\n", "entry_point": "generate_file_path", "input": "'FullCheetah', 'EnergyOne'", "output": "'./experiments_results/gym/FullCheetah/FC_E1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76201_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028983", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6031", "output": "{1, 163, 37, 6031}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6030", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028984", "code": "from typing import List\ndef filter_numbers(num_list: str) -> List[int]:\n    unique_numbers = set()\n    for num_str in num_list.split(','):\n        num_str = num_str.strip()\n        if num_str.isdigit():\n            unique_numbers.add(int(num_str))\n    return sorted(list(unique_numbers))\n", "entry_point": "filter_numbers", "input": "'0, 2, 67, 220'", "output": "[0, 2, 67, 220]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48885_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028985", "code": "import re\ndef refine_abstract(abstract: str) -> str:\n    refined_abstract = re.sub(r'^\\s*<p>', '', abstract)  # Remove leading <p> tags with optional whitespace\n    refined_abstract = re.sub(r'</p>\\s*$', '', refined_abstract)  # Remove trailing </p> tags with optional whitespace\n    return refined_abstract\n", "entry_point": "refine_abstract", "input": "'<p>This is a sample abstract.</p>'", "output": "'This is a sample abstract.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6465_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028986", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "694", "output": "{1, 2, 347, 694}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt693", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1987", "output": "{1, 1987}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1986", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028988", "code": "import datetime\ndef custom_json_dumps(data):\n    if isinstance(data, dict):\n        items = []\n        for key, value in data.items():\n            items.append(f'\"{key}\": {custom_json_dumps(value)}')\n        return \"{\" + \", \".join(items) + \"}\"\n    elif isinstance(data, list):\n        items = []\n        for item in data:\n            items.append(custom_json_dumps(item))\n        return \"[\" + \", \".join(items) + \"]\"\n    elif isinstance(data, str):\n        return f'\"{data}\"'\n    elif isinstance(data, bool):\n        return \"true\" if data else \"false\"\n    elif isinstance(data, (int, float)):\n        return str(data)\n    elif data is None:\n        return \"null\"\n    elif isinstance(data, datetime.datetime):\n        return f'\"{data.isoformat()}\"'\n    else:\n        raise TypeError(f\"Unsupported type: {type(data)}\")\n", "entry_point": "custom_json_dumps", "input": "95", "output": "'95'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103295_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028989", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8174", "output": "{1, 2, 67, 134, 8174, 4087, 122, 61}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8173", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028990", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'some/path/to/idfy_rest_idfy_residfyest.py'", "output": "'idfy_rest_idfy_residfyest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028991", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2751", "output": "{1, 3, 131, 7, 393, 917, 21, 2751}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2750", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028992", "code": "import math\ndef longest_linked_list_chain(a, b, n):\n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    sequence = [a + b * i for i in range(n)]\n    chain_length = sequence[0]\n    for num in sequence[1:]:\n        chain_length = gcd(chain_length, num)\n    return chain_length\n", "entry_point": "longest_linked_list_chain", "input": "128, 128, 3", "output": "128", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146773_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028993", "code": "from typing import List\ndef average_top_scores(scores: List[int], n: int) -> float:\n    scores.sort(reverse=True)\n    top_score = scores[n - 1]\n    total_sum = sum(score for score in scores[:n])\n    count = scores[:n].count(top_score)\n    return total_sum / count\n", "entry_point": "average_top_scores", "input": "[169, 169], 2", "output": "169.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18676_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028994", "code": "def rotate_array(arr, s):\n    n = len(arr)\n    s = s % n\n    for _ in range(s):\n        store = arr[n-1]\n        for i in range(n-2, -1, -1):\n            arr[i+1] = arr[i]\n        arr[0] = store\n    return arr\n", "entry_point": "rotate_array", "input": "[2, 11, -1, 2, 6, 4], 2", "output": "[6, 4, 2, 11, -1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58826_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028995", "code": "def fibonacci_dp(n):\n    if n <= 1:\n        return n\n    fib = [0] * (n + 1)\n    fib[1] = 1\n    for i in range(2, n + 1):\n        fib[i] = fib[i - 1] + fib[i - 2]\n    return fib[n]\n", "entry_point": "fibonacci_dp", "input": "21", "output": "10946", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93077_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028996", "code": "def count_price_crossings(stock_prices, target_price):\n    crossings = 0\n    for i in range(1, len(stock_prices)):\n        if (stock_prices[i] >= target_price and stock_prices[i - 1] < target_price) or \\\n           (stock_prices[i] < target_price and stock_prices[i - 1] >= target_price):\n            crossings += 1\n    return crossings\n", "entry_point": "count_price_crossings", "input": "[90, 95, 85], 100", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142697_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028997", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5468", "output": "{1, 2, 4, 2734, 1367, 5468}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5467", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028998", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9899", "output": "{19, 1, 9899, 521}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0028999", "code": "def extract_filename(log_location: str) -> str:\n    # Find the last occurrence of '/' to identify the start of the filename\n    start_index = log_location.rfind('/') + 1\n    # Find the position of the '.' before the extension\n    end_index = log_location.rfind('.')\n    # Extract the filename between the last '/' and the '.'\n    filename = log_location[start_index:end_index]\n    return filename\n", "entry_point": "extract_filename", "input": "'/path/to/python-ant.logtest'", "output": "'python-ant'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13809_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029000", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2033", "output": "{107, 1, 19, 2033}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029001", "code": "def sort_chromosomes(chromosomes):\n    CHROM = list(map(str, range(1, 23)))\n    CHROM.append(\"X\")\n    filtered_chromosomes = [chrom for chrom in chromosomes if chrom in CHROM]\n    sorted_chromosomes = sorted(filtered_chromosomes, key=lambda x: (int(x) if x.isdigit() else 23, x))\n    return sorted_chromosomes\n", "entry_point": "sort_chromosomes", "input": "['3']", "output": "['3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54525_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029002", "code": "def parse_callback_data(data: str):\n    field, value = data.split(\"=\")\n    return {\"field\": field, \"value\": value}\n", "entry_point": "parse_callback_data", "input": "'s=addtss'", "output": "{'field': 's', 'value': 'addtss'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52406_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029003", "code": "from typing import List\ndef populate_array(mappings: dict) -> List[int]:\n    result = []\n    for key, value in mappings.items():\n        result.extend([key] * value)\n    return result\n", "entry_point": "populate_array", "input": "{2: 1}", "output": "[2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141363_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029004", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4487", "output": "{1, 641, 7, 4487}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4486", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029005", "code": "def extract_file_extension(file_path):\n    # Find the index of the last period '.' character in the file path\n    last_dot_index = file_path.rfind('.')\n    # Check if a period '.' was found and it is not the last character in the string\n    if last_dot_index != -1 and last_dot_index < len(file_path) - 1:\n        # Extract the substring starting from the character immediately after the last period\n        file_extension = file_path[last_dot_index + 1:]\n        return file_extension\n    else:\n        # If no extension found or the period is the last character, return None\n        return None\n", "entry_point": "extract_file_extension", "input": "'example.//ff'", "output": "'//ff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51602_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029006", "code": "def calculate_bounce_time(wall_position, target_position, ball_speed):\n    JUMP_TIME_MULTIPLIER = 1.1  # Constant for adjusting bounce time\n    distance_to_target = abs(target_position - wall_position)\n    time_to_target = distance_to_target / ball_speed\n    adjusted_time = time_to_target * JUMP_TIME_MULTIPLIER\n    return adjusted_time\n", "entry_point": "calculate_bounce_time", "input": "0, 23, 1.0", "output": "25.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60989_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029007", "code": "from collections import Counter\ndef multimax1(iterable):\n    if iterable is None:\n        return []\n    record = Counter(iterable)\n    max_count = max(record.values())\n    most_common = [key for key, count in record.items() if count == max_count]\n    return most_common\n", "entry_point": "multimax1", "input": "[2, 2, 3, 3, 1]", "output": "[2, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125891_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029008", "code": "import re\ndef extract_unique_words(text):\n    # Remove punctuation marks\n    text = re.sub(r'[^\\w\\s]', '', text)\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    unique_words = set()\n    for word in words:\n        unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'tthissthis'", "output": "['tthissthis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77312_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029009", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 0, 0], [5, 0, 0]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20864_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029010", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9575", "output": "{1, 5, 9575, 25, 1915, 383}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9574", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029011", "code": "import ast\ndef ast_to_literal(node):\n    if isinstance(node, ast.AST):\n        field_names = node._fields\n        res = {'constructor': node.__class__.__name__}\n        for field_name in field_names:\n            field = getattr(node, field_name, None)\n            field = ast_to_literal(field)\n            res[field_name] = field\n        return res\n    if isinstance(node, list):\n        res = []\n        for each in node:\n            res.append(ast_to_literal(each))\n        return res\n    return node\n", "entry_point": "ast_to_literal", "input": "'xxxx'", "output": "'xxxx'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99020_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029012", "code": "def follow_redirect(url_mappings, starting_url):\n    visited = set()\n    current_url = starting_url\n    while current_url in url_mappings:\n        if current_url in visited:\n            return \"Loop detected\"\n        visited.add(current_url)\n        current_url = url_mappings[current_url]\n    return current_url\n", "entry_point": "follow_redirect", "input": "{'/start': '/middle', '/middle': '/hho//'}, '/start'", "output": "'/hho//'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56408_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029013", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{ ap }'", "output": "['ap']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029014", "code": "import argparse\ndef calculate_processing_time(pitch_range, yaw_range):\n    return pitch_range * yaw_range\n", "entry_point": "calculate_processing_time", "input": "30.0, 35.0", "output": "1050.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92798_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029015", "code": "def calculate_bunkers(items, bunker_capacity, box_capacity):\n    total_boxes = items // box_capacity\n    total_bunkers = total_boxes // bunker_capacity\n    if items % box_capacity > 0:\n        total_bunkers += 1\n    return total_bunkers\n", "entry_point": "calculate_bunkers", "input": "0, 1, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101691_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029016", "code": "from typing import List, Union, Optional, Tuple\nfrom collections import Counter\ndef most_common_element(lst: List[Union[int, any]]) -> Tuple[Optional[int], Optional[int]]:\n    int_list = [x for x in lst if isinstance(x, int)]\n    if not int_list:\n        return (None, None)\n    counter = Counter(int_list)\n    most_common = counter.most_common(1)[0]\n    return most_common\n", "entry_point": "most_common_element", "input": "[3, 3, 3, 3, 1, 'hello', 5.5]", "output": "(3, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70044_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029017", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4366", "output": "{1, 2, 37, 2183, 74, 4366, 118, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029018", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "5", "output": "[1, 3, 5, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029019", "code": "from typing import List\ndef max_average_score(scores: List[int]) -> float:\n    max_avg = float('-inf')\n    window_sum = 0\n    window_size = 0\n    for score in scores:\n        window_sum += score\n        window_size += 1\n        if window_sum / window_size > max_avg:\n            max_avg = window_sum / window_size\n        if window_sum < 0:\n            window_sum = 0\n            window_size = 0\n    return max_avg\n", "entry_point": "max_average_score", "input": "[5]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6333_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029020", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3365", "output": "{1, 5, 673, 3365}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029021", "code": "def count_unique_numbers(input_list):\n    unique_numbers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_numbers_count:\n                unique_numbers_count[element] += 1\n            else:\n                unique_numbers_count[element] = 1\n    return unique_numbers_count\n", "entry_point": "count_unique_numbers", "input": "[3, 3, 4, 4, 2, 5, 0]", "output": "{3: 2, 4: 2, 2: 1, 5: 1, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103113_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029022", "code": "def calculate_total_frames(video_duration, frame_rate, interval):\n    frames_per_second = frame_rate * interval\n    total_frames_generated = frames_per_second * video_duration\n    return total_frames_generated\n", "entry_point": "calculate_total_frames", "input": "1, -1054, 4", "output": "-4216", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3823_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029023", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2215", "output": "{1, 443, 5, 2215}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2214", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029024", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6821", "output": "{1, 19, 6821, 359}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6820", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029025", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "[2]", "output": "2.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029026", "code": "def generate_combinations(input_list, start_index=0):\n    if start_index == len(input_list):\n        return [()]\n    combinations = []\n    for i in range(start_index, len(input_list)):\n        for sub_combination in generate_combinations(input_list, i + 1):\n            combinations.append((input_list[i],) + sub_combination)\n    return combinations\n", "entry_point": "generate_combinations", "input": "[-1]", "output": "[(-1,)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115727_ipt70", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029027", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[100, 90, 80, 80, 60, 50]", "output": "[1, 2, 3, 3, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2822", "output": "{1, 2, 1411, 34, 2822, 166, 17, 83}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2821", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029029", "code": "def parse_command(command):\n    parts = command.split()\n    if len(parts) < 3:\n        return \"Invalid command\"\n    operation = parts[0]\n    num1 = float(parts[1])\n    num2 = float(parts[2])\n    if operation == 'add':\n        return num1 + num2\n    elif operation == 'subtract':\n        return num1 - num2\n    elif operation == 'multiply':\n        return num1 * num2\n    elif operation == 'divide':\n        if num2 != 0:\n            return num1 / num2\n        else:\n            return \"Division by zero is not allowed\"\n    else:\n        return \"Invalid command\"\n", "entry_point": "parse_command", "input": "'add 2.0 2.0'", "output": "4.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24855_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029030", "code": "def generate_pythagorean_triples(limit):\n    triples = []\n    for a in range(1, limit + 1):\n        for b in range(a, limit + 1):\n            c = (a**2 + b**2)**0.5\n            if c.is_integer() and c <= limit:\n                triples.append((a, b, int(c)))\n    return triples\n", "entry_point": "generate_pythagorean_triples", "input": "5", "output": "[(3, 4, 5)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41271_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029031", "code": "def process_version(version):\n    if \"-\" in version:\n        parts = version.split(\"-\")\n        modified_version = parts[0] + \"+\" + \".\".join(parts[1:])\n        return modified_version\n    return version\n", "entry_point": "process_version", "input": "'1.3.3122-gdf81228'", "output": "'1.3.3122+gdf81228'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75938_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029032", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'o, World!'", "output": "b'o, World!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029033", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'WorWorldHello, World!!ld!!'", "output": "'<strong>WorWorldHello, World!!ld!!</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029034", "code": "def max_non_adjacent_score(scores):\n    if not scores:\n        return 0\n    dp = [0] * len(scores)\n    dp[0] = scores[0]\n    for i in range(1, len(scores)):\n        if i == 1:\n            dp[i] = max(scores[i], dp[i-1])\n        else:\n            dp[i] = max(scores[i] + dp[i-2], dp[i-1])\n    return max(dp)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 1, 34]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96682_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029035", "code": "def min_valid_substrings(s, valids):\n    def helper(idx):\n        if idx == len(s):\n            return 0\n        ans = len(s)\n        for hi in range(idx, len(s)):\n            if (idx, hi) in valids:\n                ans = min(ans, helper(hi + 1) + 1)\n        return ans\n    if not s:\n        return 0\n    return helper(0) - 1\n", "entry_point": "min_valid_substrings", "input": "'abcde', {(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)}", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029036", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2384", "output": "{1, 2, 4, 1192, 8, 298, 2384, 16, 596, 149}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2383", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029037", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'programming'", "output": "['programming']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029038", "code": "def check_html_tags(html_elements):\n    stack = []\n    tag_map = {\"<div>\": \"</div>\", \"<p>\": \"</p>\", \"<span>\": \"</span>\"}  # Define the mapping of opening to closing tags\n    for element in html_elements:\n        if element in tag_map:\n            stack.append(element)\n        elif element == tag_map.get(stack[-1], None):\n            stack.pop()\n        else:\n            return False\n    return len(stack) == 0\n", "entry_point": "check_html_tags", "input": "['<div>', '</p>']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119351_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029039", "code": "def comment_out_magics(source):\n    \"\"\"\n    Comment out lines starting with magic commands denoted by '%'.\n    \"\"\"\n    filtered = []\n    in_string = False\n    for line in source.splitlines():\n        if in_string:\n            if \"'\" in line:\n                in_string = False\n        else:\n            if \"'\" in line:\n                in_string = True\n            elif line.strip().startswith('%'):\n                line = '# ' + line\n        filtered.append(line)\n    return '\\n'.join(filtered)\n", "entry_point": "comment_out_magics", "input": "'inline'", "output": "'inline'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37739_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029040", "code": "def assign_grades(scores):\n    result_list = []\n    for score in scores:\n        if score >= 90:\n            result_list.append('A')\n        elif score >= 80:\n            result_list.append('B')\n        elif score >= 70:\n            result_list.append('C')\n        elif score >= 60:\n            result_list.append('D')\n        else:\n            result_list.append('F')\n    return result_list\n", "entry_point": "assign_grades", "input": "[90, 90, 90, 90, 90, 90, 90]", "output": "['A', 'A', 'A', 'A', 'A', 'A', 'A']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90074_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029041", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1614", "output": "{1, 2, 3, 6, 807, 269, 1614, 538}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029042", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 2, 3], 2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029043", "code": "from typing import List\ndef calculate_total_resistance(resistances: List[float]) -> float:\n    total_resistance = sum(resistances)\n    return total_resistance\n", "entry_point": "calculate_total_resistance", "input": "[84]", "output": "84", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98927_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029044", "code": "def parse_vm_info(input_str):\n    vm_info = {}\n    entries = input_str.split('^')\n    for entry in entries:\n        vm_name, ip_address = entry.split(':')\n        vm_info[vm_name] = ip_address\n    return vm_info\n", "entry_point": "parse_vm_info", "input": "'V68.1.2VM1:192.168.3'", "output": "{'V68.1.2VM1': '192.168.3'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46533_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029045", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9927", "output": "{1, 3, 9927, 9, 3309, 1103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9926", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029046", "code": "def caesar_cipher(plaintext, shift):\n    encrypted_text = \"\"\n    for char in plaintext:\n        if char == ' ':\n            encrypted_text += ' '\n        else:\n            encrypted_char = chr((ord(char) - ord('A') + shift) % 26 + ord('A'))\n            encrypted_text += encrypted_char\n    return encrypted_text\n", "entry_point": "caesar_cipher", "input": "'WORLD', 2", "output": "'YQTNF'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126426_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029047", "code": "def remove_vowels(string):\n    result = ''\n    for char in string:\n        if char not in 'aeiouAEIOU':\n            result += char\n    return result\n", "entry_point": "remove_vowels", "input": "'World!'", "output": "'Wrld!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87966_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029048", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'-11'", "output": "-11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029049", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'5440 16 0'", "output": "5456", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2361", "output": "{787, 1, 3, 2361}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029051", "code": "def top_three_scores(scores):\n    unique_scores = set(scores)\n    sorted_scores = sorted(unique_scores, reverse=True)\n    if len(sorted_scores) >= 3:\n        return sorted_scores[:3]\n    else:\n        return sorted_scores\n", "entry_point": "top_three_scores", "input": "[101, 100, 89, 50, 50, 60]", "output": "[101, 100, 89]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99287_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029052", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6829", "output": "{1, 6829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029053", "code": "def extract_numerical_version(version_string):\n    numerical_version = ''.join(filter(lambda x: x.isdigit() or x == '.', version_string))\n    numerical_version = numerical_version.replace('.', '', 1)  # Remove the first occurrence of '.'\n    try:\n        return float(numerical_version)\n    except ValueError:\n        return None\n", "entry_point": "extract_numerical_version", "input": "'3'", "output": "3.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59934_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029054", "code": "from typing import List, Union\ndef calculate_positive_average(data: List[Union[int, float]]) -> float:\n    positive_sum = 0\n    positive_count = 0\n    for num in data:\n        if isinstance(num, (int, float)) and num > 0:\n            positive_sum += num\n            positive_count += 1\n    if positive_count > 0:\n        return positive_sum / positive_count\n    else:\n        return 0\n", "entry_point": "calculate_positive_average", "input": "[10, 8, 5, 7.5, 10.1875]", "output": "8.1375", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15683_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029055", "code": "def generate_api_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "generate_api_url", "input": "'https://api.example.m/', 'users/uss'", "output": "'https://api.example.m/users/uss'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62370_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3489", "output": "{3, 1, 3489, 1163}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029057", "code": "def extract_version_numbers(version_string):\n    # Split the version string using the period as the delimiter\n    version_parts = version_string.split('.')\n    # Convert the split parts into integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return the major, minor, and patch version numbers as a tuple\n    return major, minor, patch\n", "entry_point": "extract_version_numbers", "input": "'2.1220.12'", "output": "(2, 1220, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81674_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029058", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 2)\n        elif num % 2 != 0:\n            processed_list.append(num - 1)\n        if num % 3 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[2, 14, 26, 2, 14]", "output": "[4, 16, 28, 4, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45782_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029059", "code": "def theta_python(theta1, theta2):\n    ew = theta1 + 180\n    ns = -1 * (theta2 - 179)  # Calculate the north-south direction\n    return ew, ns\n", "entry_point": "theta_python", "input": "46, 125", "output": "(226, 54)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90731_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029060", "code": "def reconstruct_string(freq_list):\n    reconstructed_string = []\n    for i, freq in enumerate(freq_list):\n        if freq > 0:\n            char = chr(97 + i)  # ASCII value of 'a' is 97\n            reconstructed_string.extend([char] * freq)\n    return ''.join(reconstructed_string)\n", "entry_point": "reconstruct_string", "input": "[0, 0, 0, 0, 1] + [0] * 21", "output": "'e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100113_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029061", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8785", "output": "{1, 35, 5, 7, 1255, 8785, 251, 1757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029062", "code": "import time\ndef custom_function(n):\n    return n * (n + 1) // 2\n", "entry_point": "custom_function", "input": "12", "output": "78", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22385_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029063", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "537", "output": "{1, 3, 179, 537}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt536", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029064", "code": "def find_three_largest_numbers(nums):\n    three_largest = [float('-inf'), float('-inf'), float('-inf')]  # Initialize with negative infinity\n    for num in nums:\n        if num > three_largest[2]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = three_largest[2]\n            three_largest[2] = num\n        elif num > three_largest[1]:\n            three_largest[0] = three_largest[1]\n            three_largest[1] = num\n        elif num > three_largest[0]:\n            three_largest[0] = num\n    return sorted(three_largest)\n", "entry_point": "find_three_largest_numbers", "input": "[1, 2, 3, 4, 5, 16, 540, 541]", "output": "[16, 540, 541]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105544_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029065", "code": "import collections\nESTIMATE_MAP = collections.OrderedDict({\n    \"-999999999\": \"too few samples\",\n    \"-888888888\": \"not applicable\",\n    \"-666666666\": \"estimate can't be calculated\",\n    \"*\": \"significantly different from most current year\",\n    \"C\": \"controlled so don't use tests\",\n    # \"+\": \"\",\n    # \"-\": \"falls in the lowest interval\"\n})\ndef get_estimate_descriptions(estimate_codes):\n    descriptions = []\n    for code in estimate_codes:\n        description = ESTIMATE_MAP.get(code, \"Unknown code\")\n        descriptions.append(description)\n    return descriptions\n", "entry_point": "get_estimate_descriptions", "input": "['ABC', 'XYZ', '123']", "output": "['Unknown code', 'Unknown code', 'Unknown code']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106487_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029066", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "'a'", "output": "{'str': 'a'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029067", "code": "def calculate_total_test_cases(unit_tests, functional_tests, other_tests):\n    total_test_cases = unit_tests + (2 * functional_tests) + (0.5 * other_tests)\n    return total_test_cases\n", "entry_point": "calculate_total_test_cases", "input": "11, 4, 1", "output": "19.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145173_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3046", "output": "{1, 2, 1523, 3046}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3045", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029069", "code": "from typing import List, Tuple\ndef calculate_extra_points(course_list: List[Tuple[str, int]]) -> int:\n    total_points = 0\n    for course, points in course_list:\n        total_points += points\n    return total_points\n", "entry_point": "calculate_extra_points", "input": "[('Math', 8)]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69310_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029070", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6172", "output": "{1, 2, 4, 1543, 3086, 6172}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6171", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029071", "code": "def find_most_common_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    # Find the maximum count\n    max_count = max(element_count.values())\n    # Filter elements with counts equal to the maximum count\n    most_common_elements = {key: value for key, value in element_count.items() if value == max_count}\n    return most_common_elements\n", "entry_point": "find_most_common_elements", "input": "[2, 2, 2]", "output": "{2: 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19184_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5391", "output": "{1, 3, 1797, 9, 5391, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5390", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029073", "code": "def evaluate_polynomial(coefs, x0):\n    result = 0\n    for coef in reversed(coefs):\n        result = coef + result * x0\n    return result\n", "entry_point": "evaluate_polynomial", "input": "[-4303284302], 0", "output": "-4303284302", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86312_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029074", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(1, 3, 1, 2, 0, -1, 0, 0, -1)", "output": "'(1.3.1.2.0.-1.0.0.-1)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029075", "code": "from typing import List, Tuple\ndef classify_entries(line_numbers: List[int]) -> Tuple[List[int], List[int], List[int]]:\n    NOT_AN_ENTRY = set([\n        326, 330, 332, 692, 1845, 6016, 17859, 24005, 49675, 97466, 110519, 118045,\n        119186, 126386\n    ])\n    ALWAYS_AN_ENTRY = set([\n        12470, 17858, 60157, 60555, 60820, 75155, 75330, 77825, 83439, 84266,\n        94282, 97998, 102650, 102655, 102810, 102822, 102895, 103897, 113712,\n        113834, 119068, 123676\n    ])\n    always_starts_entry = [num for num in line_numbers if num in ALWAYS_AN_ENTRY]\n    never_starts_entry = [num for num in line_numbers if num in NOT_AN_ENTRY]\n    ambiguous_starts_entry = [num for num in line_numbers if num not in ALWAYS_AN_ENTRY and num not in NOT_AN_ENTRY]\n    return always_starts_entry, never_starts_entry, ambiguous_starts_entry\n", "entry_point": "classify_entries", "input": "[12470, 330, 326, 10, 327, 331]", "output": "([12470], [330, 326], [10, 327, 331])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61128_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029076", "code": "import re\ndef count_unique_words(input_string):\n    word_count = {}\n    words = re.findall(r'\\b\\w+\\b', input_string.lower())\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'worldworld'", "output": "{'worldworld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113237_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029077", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4990", "output": "{1, 2, 5, 998, 10, 499, 4990, 2495}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4989", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029078", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'Wol!'", "output": "{'wol': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029079", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[10, 10, 10, 10, 1, 3, 5, 7]", "output": "[10, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029080", "code": "import os\ndef construct_template_dir(app_config_path, dirname):\n    if not app_config_path:\n        return \"Error: app_config path is missing\"\n    template_dir = os.path.join(app_config_path, dirname)\n    return template_dir\n", "entry_point": "construct_template_dir", "input": "'/home/userapp', ''", "output": "'/home/userapp/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50484_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029081", "code": "def what_eval(input_str):\n    results = []\n    expressions = input_str.strip().split('\\n')\n    for expr in expressions:\n        result = eval(expr)\n        results.append(str(result))\n    return results\n", "entry_point": "what_eval", "input": "'5.0\\n9'", "output": "['5.0', '9']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70772_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029082", "code": "import re\ndef process_string(input_string):\n    # Replace \"Kafka\" with \"Python\"\n    processed_string = input_string.replace(\"Kafka\", \"Python\")\n    # Remove digits from the string\n    processed_string = re.sub(r'\\d', '', processed_string)\n    # Reverse the string\n    processed_string = processed_string[::-1]\n    return processed_string\n", "entry_point": "process_string", "input": "'a'", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55468_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029083", "code": "def modify_search_query(query, city):\n    query = query.replace('%20', ' ')\n    if city in query:  # City is already in query\n        return query\n    if len(query.strip()) == 0:\n        return ''\n    return '%s %s' % (query, city)\n", "entry_point": "modify_search_query", "input": "'jav0prg%20%20%20ue', 'Nrkew'", "output": "'jav0prg   ue Nrkew'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87589_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029084", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "[7, 1, 0]", "output": "7.0710678118654755", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029085", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'500 + 30 + 5'", "output": "535", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029086", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3211", "output": "{1, 169, 3211, 13, 19, 247}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029087", "code": "def count_integer_frequency(input_list):\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[3, 4, 1, 5]", "output": "{3: 1, 4: 1, 1: 1, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24826_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029088", "code": "from typing import List\ndef sort_by_binary_ones(arr: List[int]) -> List[int]:\n    def custom_sort(x):\n        return bin(x).count('1'), x\n    return sorted(arr, key=custom_sort)\n", "entry_point": "sort_by_binary_ones", "input": "[1, 3, 6, 6, 6, 6]", "output": "[1, 3, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144123_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029089", "code": "def parse_github_credentials(credentials):\n    github_dict = {}\n    for credential in credentials:\n        key, value = credential.split('=')\n        github_dict[key] = value\n    return github_dict\n", "entry_point": "parse_github_credentials", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120672_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029090", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo Say something'", "output": "'Say something'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029091", "code": "ENDPOINT_MAPPING = {\n    'robot_position': '/robotposition',\n    'cube_position': '/cubeposition',\n    'path': '/path',\n    'flag': '/flag'\n}\ndef generate_endpoint(resource_name):\n    return ENDPOINT_MAPPING.get(resource_name, 'Invalid resource')\n", "entry_point": "generate_endpoint", "input": "'robot_position'", "output": "'/robotposition'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44396_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029092", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7078", "output": "{1, 2, 3539, 7078}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7077", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029093", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9635", "output": "{1, 9635, 5, 1927, 41, 235, 205, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9634", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029094", "code": "def process_list(nums, target):\n    output = []\n    index = 0\n    for num in nums:\n        output.append(num + target)\n        index = (index + 1) % len(nums)\n    return output\n", "entry_point": "process_list", "input": "[0, 0, -1, 3, 3, 0, -1, 1, 0], 0", "output": "[0, 0, -1, 3, 3, 0, -1, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101999_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029095", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5666", "output": "{1, 5666, 2, 2833}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5665", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029096", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5956", "output": "{1, 2978, 2, 5956, 4, 1489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5955", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029097", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "431", "output": "{1, 431}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt430", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9381", "output": "{1, 3, 9381, 177, 53, 3127, 59, 159}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9380", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029099", "code": "def duplicate_characters(name):\n    duplicated_name = \"\"\n    for char in name:\n        duplicated_name += char * 2\n    return duplicated_name\n", "entry_point": "duplicate_characters", "input": "'Backpack'", "output": "'BBaacckkppaacckk'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49603_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029100", "code": "import os\ndef calculate_average_execution_time(results_dir, benchmarks):\n    average_times = {}\n    for benchmark in benchmarks:\n        result_file = os.path.join(results_dir, f'{benchmark}.txt')\n        if os.path.exists(result_file):\n            with open(result_file, 'r') as file:\n                times = [float(line.strip()) for line in file]\n                average_time = sum(times) / len(times) if times else 0\n                average_times[benchmark] = average_time\n        else:\n            average_times[benchmark] = 0\n    return average_times\n", "entry_point": "calculate_average_execution_time", "input": "'some/directory', []", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3126_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029101", "code": "def max_area(walls):\n    max_area = 0\n    left = 0\n    right = len(walls) - 1\n    while left < right:\n        width = right - left\n        height = min(walls[left], walls[right])\n        area = width * height\n        max_area = max(max_area, area)\n        if walls[left] < walls[right]:\n            left += 1\n        else:\n            right -= 1\n    return max_area\n", "entry_point": "max_area", "input": "[6, 8, 5, 10, 6]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100123_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029102", "code": "import time\ndef convert_epoch_time(seconds):\n    time_struct = time.gmtime(seconds)\n    formatted_time = time.strftime('%a %b %d %H:%M:%S %Y', time_struct)\n    return formatted_time\n", "entry_point": "convert_epoch_time", "input": "-3600", "output": "'Wed Dec 31 23:00:00 1969'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107337_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2681", "output": "{2681, 1, 383, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2680", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029104", "code": "def rearrange_string(s):\n    s = list(s)\n    left, right = 0, len(s) - 1\n    while left < right:\n        while left < right and s[left].islower():\n            left += 1\n        while left < right and s[right].isupper():\n            right -= 1\n        if left < right:\n            s[left], s[right] = s[right], s[left]\n    return ''.join(s)\n", "entry_point": "rearrange_string", "input": "'cabbaDDABD'", "output": "'cabbaDDABD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134334_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "13", "output": "{1, 13}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029106", "code": "def process_list(num_list, operation):\n    if operation == 'add':\n        return [num + idx for idx, num in enumerate(num_list)]\n    elif operation == 'subtract':\n        return [num - idx for idx, num in enumerate(num_list)]\n    elif operation == 'multiply':\n        return [num * idx for idx, num in enumerate(num_list)]\n    else:\n        return None\n", "entry_point": "process_list", "input": "[3, 5, 7, 9], 'add'", "output": "[3, 6, 9, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17472_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029107", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'5', '1', 'cpu'", "output": "'5.1-cpu-ml-scala2.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4262", "output": "{1, 2, 2131, 4262}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4261", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029109", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "20", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029110", "code": "from typing import List, Dict\nimport ast\ndef extract_package_versions(package_list: List[str]) -> Dict[str, str]:\n    code = \"\"\"\nfrom distutils.core import setup\nsetup(\n    name='ATEC_wenle',\n    version='0.1dev',\n    packages=['',],\n    license='',\n    # long_description=open('README.txt').read(),\n)\n\"\"\"\n    tree = ast.parse(code)\n    package_versions = {}\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'setup':\n            for keyword in node.keywords:\n                if keyword.arg == 'name':\n                    package_name = keyword.value.s\n                elif keyword.arg == 'version':\n                    package_version = keyword.value.s\n            if package_name in package_list:\n                package_versions[package_name] = package_version\n    return package_versions\n", "entry_point": "extract_package_versions", "input": "['ATEC_wenle']", "output": "{'ATEC_wenle': '0.1dev'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95881_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8767", "output": "{1, 11, 797, 8767}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8766", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029112", "code": "def encrypt(message):\n    encrypted_values = []\n    for char in message:\n        if char.isalpha():\n            position = ord(char.upper()) - ord('A') + 1\n            encrypted_values.append(position * 2)\n    return encrypted_values\n", "entry_point": "encrypt", "input": "'HELLOHHLLH'", "output": "[16, 10, 24, 24, 30, 16, 16, 24, 24, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40901_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029113", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'Hello'", "output": "'hELLO'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029114", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6945", "output": "{1, 6945, 3, 5, 2315, 1389, 15, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6944", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029115", "code": "def add_index_to_element(lst):\n    result = []\n    for index, element in enumerate(lst):\n        if isinstance(element, int):\n            result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[8, 11, 3, 10, 0, 10, 7]", "output": "[8, 12, 5, 13, 4, 15, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102338_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029116", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2082", "output": "{1, 2082, 3, 2, 6, 1041, 694, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2081", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029117", "code": "def validate_dict(input_dict):\n    validation = {\n        'start': {'required': True},\n        'end': {'required': True},\n    }\n    attribute_map = {\n        'start': {'key': 'start', 'type': 'int'},\n        'end': {'key': 'end', 'type': 'int'},\n        'step': {'key': 'step', 'type': 'int'},\n    }\n    for key, value in validation.items():\n        if value['required'] and key not in input_dict:\n            return False\n    for key, attr_info in attribute_map.items():\n        if key in input_dict:\n            if not isinstance(input_dict[key], eval(attr_info['type'])):\n                return False\n    return True\n", "entry_point": "validate_dict", "input": "{'step': 1}", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138319_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029118", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2586", "output": "{1, 2, 3, 6, 1293, 431, 2586, 862}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2585", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029119", "code": "import itertools\ndef calculate_ribbon(data):\n    orders = [(int(d) for d in line.split('x')) for line in data.splitlines() if line.strip()]\n    total_ribbon = 0\n    for l, w, h in orders:\n        perimeter = sum(sorted((l, w, h))[:2]) * 2\n        bow = l * w * h\n        total_ribbon += perimeter + bow\n    return total_ribbon\n", "entry_point": "calculate_ribbon", "input": "'2x3x4'", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50623_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029120", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'3.6.9'", "output": "'3.6.10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029121", "code": "def assign_grades(scores):\n    result_list = []\n    for score in scores:\n        if score >= 90:\n            result_list.append('A')\n        elif score >= 80:\n            result_list.append('B')\n        elif score >= 70:\n            result_list.append('C')\n        elif score >= 60:\n            result_list.append('D')\n        else:\n            result_list.append('F')\n    return result_list\n", "entry_point": "assign_grades", "input": "[85, 95, 75, 92, 72, 98]", "output": "['B', 'A', 'C', 'A', 'C', 'A']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90074_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029122", "code": "def process_data(mode, list_data, tab_data):\n    result_dict = {}\n    if mode == 1 or mode == 2:\n        for i in range(len(list_data)):\n            aa = list_data[i]\n            elt = float(tab_data[i])\n            result_dict[aa] = elt\n    elif mode == 0:\n        for i in range(len(list_data)):\n            state = list_data[i]\n            elt = tab_data[i]\n            if elt == \"*\":\n                result_dict[state] = None\n            else:\n                result_dict[state] = float(elt)\n    return result_dict\n", "entry_point": "process_data", "input": "0, ['A', 'B', 'C'], ['1.2', '3.4', '*']", "output": "{'A': 1.2, 'B': 3.4, 'C': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120993_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029123", "code": "from typing import List\ndef square_elements(input_list: List[int]) -> List[int]:\n    squared_list = []\n    for num in input_list:\n        squared_list.append(num * num)\n    return squared_list\n", "entry_point": "square_elements", "input": "[3, 3, 3, 2, 2, 6, 1]", "output": "[9, 9, 9, 4, 4, 36, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67270_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029124", "code": "def rearrange_sentence(scrambled_sentence: str) -> str:\n    words = scrambled_sentence.split()  # Split the input sentence into a list of words\n    rearranged_sentence = ' '.join(sorted(words))  # Sort the words and join them back into a sentence\n    return rearranged_sentence\n", "entry_point": "rearrange_sentence", "input": "'development'", "output": "'development'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36597_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029125", "code": "# Define the constant PI\nPI = 3.14\n# Function to calculate the area of a circle\ndef calculate_circle_area(radius):\n    area = PI * radius**2\n    return area\n", "entry_point": "calculate_circle_area", "input": "5", "output": "78.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75011_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029126", "code": "def divide(dividend, divisor):\n    sign = 1 if (dividend >= 0) == (divisor >= 0) else -1\n    dd = abs(dividend)\n    dr = abs(divisor)\n    if dd < dr:\n        return 0\n    if dd == dr:\n        return sign\n    if dr == 1:\n        dd = dd if sign > 0 else -dd\n        return min(2 ** 31 - 1, dd)\n    res = 1\n    while dd > dr + dr:\n        dr += dr\n        res += res\n    return sign * (res + divide(dd - dr, abs(divisor)))\n", "entry_point": "divide", "input": "2340, 2", "output": "1170", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113359_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029127", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3081", "output": "{1, 1027, 3, 39, 3081, 13, 237, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3080", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029128", "code": "def truncate_decimal(x, digit):\n    if isinstance(x, int):\n        return x\n    try:\n        digit_ = pow(10, digit)\n        x = int(x * digit_) / digit_\n    except Exception as e:\n        print(f\"x_round error: x = {x}, error: {e}\")\n    return x\n", "entry_point": "truncate_decimal", "input": "0, 1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54319_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029129", "code": "def find_pairs(lst, target_sum):\n    seen = {}\n    pairs = []\n    for num in lst:\n        complement = target_sum - num\n        if complement in seen:\n            pairs.append((num, complement))\n        seen[num] = True\n    return pairs\n", "entry_point": "find_pairs", "input": "[7, 7], 14", "output": "[(7, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52644_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029130", "code": "def shift_string(input_str, shift_value):\n    shift_value = abs(shift_value)\n    if shift_value == 0:\n        return input_str\n    if shift_value > len(input_str):\n        shift_value %= len(input_str)\n    if shift_value < 0:\n        shift_value = len(input_str) + shift_value\n    if shift_value > 0:\n        shifted_str = input_str[-shift_value:] + input_str[:-shift_value]\n    else:\n        shifted_str = input_str[shift_value:] + input_str[:shift_value]\n    return shifted_str\n", "entry_point": "shift_string", "input": "'ClassicalCln', 1", "output": "'nClassicalCl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14180_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029131", "code": "def generate_export_url(user: dict, file_name: str) -> str:\n    user_id = user.get('id', '')\n    return f'http://example.com/{user_id}/{file_name}'\n", "entry_point": "generate_export_url", "input": "{'name': 'some_user'}, 'expoepox'", "output": "'http://example.com//expoepox'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43416_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029132", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4937", "output": "{4937, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029133", "code": "import ast\ndef extract_functions_and_classes(module_code):\n    module_ast = ast.parse(module_code)\n    functions = []\n    classes = []\n    for node in ast.walk(module_ast):\n        if isinstance(node, ast.FunctionDef):\n            functions.append(node.name)\n        elif isinstance(node, ast.ClassDef):\n            classes.append(node.name)\n    return functions, classes\n", "entry_point": "extract_functions_and_classes", "input": "'class MyClass:\\n    pass'", "output": "([], ['MyClass'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53175_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029134", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[2, 3, 3, 4, 3, 3, 3]", "output": "[5, 6, 7, 7, 6, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34035_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029135", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6382", "output": "{1, 2, 6382, 3191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6381", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029136", "code": "def parse_version(version_str):\n    # Split the version string based on the '.' delimiter\n    version_parts = version_str.split('.')\n    # Convert each part to an integer\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'1.10.5'", "output": "(1, 10, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134861_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029137", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7529", "output": "{1, 7529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029138", "code": "def modify_list(input_list):\n    input_list.insert(3, 7)  # Insert 7 at index 3\n    input_list.pop()  # Remove the last element\n    input_list.reverse()  # Reverse the list\n    return input_list\n", "entry_point": "modify_list", "input": "[2, 6, 3, 0, 8, 3, 1, 3, 5]", "output": "[3, 1, 3, 8, 0, 7, 3, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29418_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029139", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9013", "output": "{1, 9013}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9012", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4085", "output": "{1, 5, 43, 817, 19, 4085, 215, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4084", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029141", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "444", "output": "{1, 2, 3, 4, 37, 6, 74, 12, 111, 148, 444, 222}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt443", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029142", "code": "from typing import List\ndef calculate_visible_skyline(building_heights: List[int]) -> int:\n    total_visible_skyline = 0\n    stack = []\n    for height in building_heights:\n        while stack and height > stack[-1]:\n            total_visible_skyline += stack.pop()\n        stack.append(height)\n    total_visible_skyline += sum(stack)\n    return total_visible_skyline\n", "entry_point": "calculate_visible_skyline", "input": "[3, 6, 2, 5, 8]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39592_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029143", "code": "def min_energy(energies):\n    min_energy_required = 0\n    current_energy = 0\n    for energy in energies:\n        current_energy += energy\n        if current_energy < 0:\n            min_energy_required += abs(current_energy)\n            current_energy = 0\n    return min_energy_required\n", "entry_point": "min_energy", "input": "[-10, -15, -16]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78421_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029144", "code": "def count_severities(severity_str):\n    severities = {}\n    for severity in severity_str.split(','):\n        severity = severity.strip()  # Remove leading and trailing spaces\n        if severity in severities:\n            severities[severity] += 1\n        else:\n            severities[severity] = 1\n    return severities\n", "entry_point": "count_severities", "input": "', itical'", "output": "{'': 1, 'itical': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5726_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029145", "code": "from datetime import datetime\ndef find_earliest_date(dates):\n    earliest_date = datetime.max\n    for date_str in dates:\n        date = datetime.strptime(date_str, \"%Y-%m-%d\")\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date.strftime(\"%Y-%m-%d\")\n", "entry_point": "find_earliest_date", "input": "['2021-07-10', '2021-07-20', '2021-08-01']", "output": "'2021-07-10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55665_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029146", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'11111011X'", "output": "['111110110', '111110111']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt57", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029147", "code": "def reverse_help_message(help_message):\n    words = help_message.split()  # Split the help message into individual words\n    reversed_words = ' '.join(reversed(words))  # Reverse the order of words and join them back\n    return reversed_words\n", "entry_point": "reverse_help_message", "input": "'the'", "output": "'the'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79053_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029148", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7006", "output": "{1, 2, 226, 3503, 113, 62, 7006, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7005", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029149", "code": "import string\ndef calculate_word_frequency(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove punctuation marks\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    # Split text into words\n    words = text.split()\n    # Create a dictionary to store word frequencies\n    word_freq = {}\n    # Iterate through words and update frequencies\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequency", "input": "'xtexdemonstratet'", "output": "{'xtexdemonstratet': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89208_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029150", "code": "def update_scores(ball_name, left, right):\n    left_score = left\n    right_score = right\n    if ball_name == \"ball_left\":\n        left_score += 1\n    if ball_name == \"ball_right\":\n        right_score += 1\n    print(\"=====================================================\")\n    print(\"\\t Left \\t\\t\\t Right\\t\")\n    print(\"\\t  {}  \\t\\t\\t   {} \\t\".format(left_score, right_score))\n    print(\"=====================================================\")\n    return left_score, right_score\n", "entry_point": "update_scores", "input": "'ball_left', 1, 1", "output": "(2, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21046_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029151", "code": "def extract_major_version(version):\n    major_version = int(version.split('.')[0])\n    return major_version\n", "entry_point": "extract_major_version", "input": "'300.1.2'", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104028_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029152", "code": "def count_well_formed_tilings(N):\n    if N == 1:\n        return 1\n    if N == 2:\n        return 2\n    dp = [0] * (N + 1)\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, N + 1):\n        dp[i] = dp[i - 1] + dp[i - 2]\n    return dp[N]\n", "entry_point": "count_well_formed_tilings", "input": "10", "output": "89", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122844_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029153", "code": "def modify_string(input_string):\n    replacements = {\n        \"twitch\": \"mixer\",\n        \"user\": \"streamer\",\n        \"id\": \"channel\",\n        \"type\": \"category\",\n        \"change\": \"update\"\n    }\n    modified_words = []\n    words = input_string.split()\n    for word in words:\n        modified_word = replacements.get(word.lower(), word)\n        modified_words.append(modified_word)\n    return ' '.join(modified_words)\n", "entry_point": "modify_string", "input": "'type'", "output": "'category'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126834_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029154", "code": "from typing import List\ndef max_profit(prices: List[int], k: int) -> int:\n    if not prices or k == 0:\n        return 0\n    n = len(prices)\n    if k >= n // 2:\n        return sum([prices[i+1] - prices[i] if prices[i+1] > prices[i] else 0 for i in range(n-1)])\n    G = [[0] * n for _ in range(k+1)]\n    for i in range(1, k+1):\n        L = [0] * n\n        for j in range(1, n):\n            p = prices[j] - prices[j-1]\n            L[j] = max(G[i-1][j-1] + p, L[j-1] + p)\n            G[i][j] = max(G[i][j-1], L[j])\n    return G[-1][-1]\n", "entry_point": "max_profit", "input": "[1, 5, 9, 13, 17], 4", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68511_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029155", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7209", "output": "{1, 801, 2403, 3, 9, 7209, 267, 81, 89, 27}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029156", "code": "def process_users(users):\n    updated_users = []\n    for user in users:\n        if '@' not in user.get('email', ''):\n            continue\n        username = user.get('username', '')\n        password = user.get('password', '')\n        if len(username) < 3:\n            username = 'Guest'\n        if len(password) < 6:\n            password = 'Password123'\n        updated_users.append({'email': user['email'], 'username': username, 'password': password})\n    return updated_users\n", "entry_point": "process_users", "input": "[{'email': 'userexample.com'}, {'email': 'testuser.com'}]", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36216_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029157", "code": "# Function to calculate word frequencies\ndef calculate_word_frequencies(input_string):\n    word_freq = {}\n    # Step 1: Tokenize the input string into individual words\n    words = input_string.split()\n    # Step 2: Count the occurrences of each word\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "calculate_word_frequencies", "input": "'hello'", "output": "{'hello': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94108_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029158", "code": "def denormalize(x, x_min, x_max):\n    if x_max is None:\n        _range = 1\n    else:\n        _range = x_max - x_min\n    return x * _range + x_min\n", "entry_point": "denormalize", "input": "0.6800000000000005, 10, 12", "output": "11.360000000000001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10574_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029159", "code": "def extract_semver(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semver", "input": "'2.5.22222'", "output": "(2, 5, 22222)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135012_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029160", "code": "def triangle_area(base, height):\n    '''\n    triangle_area: Calculates the area of a right-angled triangle\n    base: Length of the base of the triangle\n    height: Length of the height of the triangle\n    '''\n    return 0.5 * base * height\n", "entry_point": "triangle_area", "input": "17.0, 3.0", "output": "25.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146852_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029161", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "204", "output": "{1, 2, 3, 68, 4, 102, 6, 34, 204, 12, 17, 51}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt203", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029162", "code": "def verify_patch_modules(patches):\n    execution_functions = {}\n    for patch in patches:\n        if patch.startswith(\"finally:\"):\n            continue\n        module_name = patch.split()[1]\n        if module_name not in execution_functions:\n            return False\n        execution_functions[module_name] = True\n    return True\n", "entry_point": "verify_patch_modules", "input": "['patch 1', 'moduleA']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131669_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029163", "code": "def findDecentNumber(n):\n    # Check if it is possible to form a decent number with n digits\n    if n < 3 or n == 4:\n        return -1\n    # Determine the maximum number of times 5 and 3 can appear in the decent number\n    num_fives = n - (n % 3)\n    num_threes = n - num_fives\n    # Construct the largest decent number based on the constraints\n    decent_number = '5' * num_fives + '3' * num_threes\n    return int(decent_number)\n", "entry_point": "findDecentNumber", "input": "9", "output": "555555555", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97813_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029164", "code": "def find_odd_integer(lst):\n    result = 0\n    for num in lst:\n        result ^= num\n    return result\n", "entry_point": "find_odd_integer", "input": "[5, 6, 6]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77305_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029165", "code": "def replace_yiddish_characters(input_str):\n    mapping = {\n        '\u05d0\u05b8': '\u05d0',\n        '\u05d0\u05b7': '\u05d0',\n        '\u05f2\u05b7': '\u05d9\u05d9',\n        '\u05f2': '\u05d9\u05d9',\n        '\u05e4\u05bf': '\u05e4',\n        '\u05d1\u05bf': '\u05d1',\n        '\u05f1': '\u05d5\u05d9',\n        '\u05f0': '\u05d5\u05d5',\n        '\u05e4\u05bc': '\u05e4'\n    }\n    for key, value in mapping.items():\n        input_str = input_str.replace(key, value)\n    return input_str\n", "entry_point": "replace_yiddish_characters", "input": "'\u05d0\u05d1\u05bf\u05e4\u05bc'", "output": "'\u05d0\u05d1\u05e4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140367_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029166", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6297", "output": "{2099, 1, 6297, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6296", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029167", "code": "def generate_acl_url(aclid, interface=None, direction=None):\n    base_url = 'acl'\n    if interface is None and direction is None:\n        return base_url\n    elif interface is not None and direction is None:\n        return f'acl/{aclid}/interfaces'\n    elif interface is not None and direction is not None:\n        return f'acl/{aclid}/interfaces/{interface}_{direction}'\n", "entry_point": "generate_acl_url", "input": "47789894, 'ethe0', 'ninn'", "output": "'acl/47789894/interfaces/ethe0_ninn'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64534_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029168", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3893", "output": "{1, 3893, 17, 229}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3892", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029169", "code": "from typing import List\nimport re\nimport socket\ndef validate_configuration(allowed_hosts: List[str], secret_key: str) -> bool:\n    def is_valid_host(host: str) -> bool:\n        try:\n            socket.inet_aton(host)  # Check if it's a valid IP address\n            return True\n        except socket.error:\n            try:\n                socket.gethostbyname(host)  # Check if it's a valid domain name\n                return True\n            except socket.gaierror:\n                return False\n    def is_valid_secret_key(key: str) -> bool:\n        return \"secret\" not in key.lower() and \"password\" not in key.lower()\n    for host in allowed_hosts:\n        if not is_valid_host(host):\n            return False\n    if not is_valid_secret_key(secret_key):\n        return False\n    return True\n", "entry_point": "validate_configuration", "input": "['192.168.1.1', 'example.com'], 'My134Key'", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116936_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029170", "code": "def int_to_binary_list(num):\n    if num < 0:\n        raise ValueError('Input must be non-negative')\n    if num == 0:\n        return [0]\n    binary_list = []\n    while num > 0:\n        num, remainder = divmod(num, 2)\n        binary_list.append(remainder)\n    return binary_list[::-1]\n", "entry_point": "int_to_binary_list", "input": "13", "output": "[1, 1, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4955_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029171", "code": "def classify_superheroes(powers):\n    good_superheroes = []\n    evil_superheroes = []\n    total_good_power = 0\n    total_evil_power = 0\n    for power in powers:\n        if power > 0:\n            good_superheroes.append(power)\n            total_good_power += power\n        else:\n            evil_superheroes.append(power)\n            total_evil_power += power\n    return good_superheroes, evil_superheroes, total_good_power, total_evil_power\n", "entry_point": "classify_superheroes", "input": "[9, 10, 6, 10, 8, 9, -15]", "output": "([9, 10, 6, 10, 8, 9], [-15], 52, -15)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7614_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029172", "code": "import re\ndef word_frequency(text):\n    word_freq = {}\n    # Tokenize the text into words\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        # Convert word to lowercase\n        word = word.lower()\n        # Remove punctuation marks\n        word = re.sub(r'[^\\w\\s]', '', word)\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "word_frequency", "input": "'bdwown'", "output": "{'bdwown': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23210_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029173", "code": "def count_even_odd(numbers):\n    even_count = 0\n    odd_count = 0\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n    return even_count, odd_count\n", "entry_point": "count_even_odd", "input": "[0, 2, 4, 6, 1, 3, 5]", "output": "(4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51670_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029174", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'4.1.0'", "output": "'4.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029175", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "6, 1", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029176", "code": "def process_a_user_id(a_user_id, counter):\n    # Implement the logic to process a user ID and update the counter\n    # For demonstration purposes, let's increment the counter by 1 for each user ID processed\n    counter += 1\n    return counter\n", "entry_point": "process_a_user_id", "input": "0, -1", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21284_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029177", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[2, 3, 3, 8, 8, 8, 5, 7, 7]", "output": "[4, 9, 9, 16, 16, 16, 25, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029178", "code": "def min_swaps_to_sort(nums):\n    count_1 = nums.count(1)\n    count_2 = nums.count(2)\n    count_3 = nums.count(3)\n    swaps = 0\n    for i in range(count_1):\n        if nums[i] != 1:\n            if nums[i] == 2:\n                if count_1 > 0:\n                    count_1 -= 1\n                    swaps += 1\n                else:\n                    count_3 -= 1\n                    swaps += 2\n            elif nums[i] == 3:\n                count_3 -= 1\n                swaps += 1\n    for i in range(count_1, count_1 + count_2):\n        if nums[i] != 2:\n            count_3 -= 1\n            swaps += 1\n    return swaps\n", "entry_point": "min_swaps_to_sort", "input": "[2, 1, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124017_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029179", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3471", "output": "{1, 3, 1157, 39, 267, 13, 3471, 89}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3470", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029180", "code": "def max_tapes(tape_lengths, target_length):\n    total_tapes = 0\n    for length in tape_lengths:\n        total_tapes += length // target_length\n    return total_tapes\n", "entry_point": "max_tapes", "input": "[10, 5, 0], 1", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65392_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029181", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1757", "output": "{1, 251, 1757, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029182", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hhelo'", "output": "['hhelo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029183", "code": "def set_config_default_item(config: dict, key, default):\n    if key not in config:\n        config[key] = default\n    return config\n", "entry_point": "set_config_default_item", "input": "{}, 'ccc', 4", "output": "{'ccc': 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98978_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029184", "code": "def cumulative_sum(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[0]]  # Initialize output list with the first element\n    cumulative = input_list[0]  # Initialize cumulative sum\n    for num in input_list[1:]:\n        cumulative += num\n        output_list.append(cumulative)\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[5, 3, 3, 3, 2, 2, 2, 0]", "output": "[5, 8, 11, 14, 16, 18, 20, 20]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63356_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029185", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2525", "output": "{1, 5, 101, 505, 2525, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2524", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029186", "code": "import os\ndefaults = {\n    'key1': 'value1',\n    'key2': 'value2'\n}\ndef get(name, default=None):\n    cur_def = defaults.get(name, default)\n    if cur_def is None and default is not None:\n        cur_def = default\n    retval = os.getenv(name, cur_def)\n    return retval\n", "entry_point": "get", "input": "'nonexistent_key', 'default_value'", "output": "'default_value'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72738_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029187", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6685", "output": "{1, 35, 5, 7, 1337, 955, 6685, 191}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029188", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'eaeappleppee', 'someRandomWord'", "output": "'eaeappleppee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029189", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8469", "output": "{1, 3, 2823, 9, 941, 8469}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8468", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029190", "code": "def total_price(cart):\n    total = 0\n    for item in cart:\n        total += item[\"price\"]\n    return total\n", "entry_point": "total_price", "input": "[{'price': 5.0}, {'price': 7.5}]", "output": "12.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23365_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029191", "code": "def filter_images_by_category(images, category):\n    filtered_images = []\n    for image in images:\n        if image.get('pic_category') == category:\n            filtered_images.append(image)\n    return filtered_images\n", "entry_point": "filter_images_by_category", "input": "[], 'landscape'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47738_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029192", "code": "import re\ndef text_manipulation(input_text):\n    match = re.search(r'\\becho\\s(.*)', input_text)\n    if match:\n        return match.group(1)\n    else:\n        return input_text\n", "entry_point": "text_manipulation", "input": "'echo HellloSsy llo'", "output": "'HellloSsy llo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111877_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029193", "code": "def max_sum_non_adjacent_parity(lst):\n    odd_sum = even_sum = 0\n    for num in lst:\n        if num % 2 == 0:  # Even number\n            even_sum, odd_sum = max(even_sum, odd_sum), even_sum + num\n        else:  # Odd number\n            even_sum, odd_sum = max(even_sum, odd_sum + num), odd_sum\n    return max(odd_sum, even_sum)\n", "entry_point": "max_sum_non_adjacent_parity", "input": "[9, 8]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_85540_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029194", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'1.0.11.3.0'", "output": "'1.0.11.3.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029195", "code": "def cumulative_sum(input_list):\n    result = []\n    cum_sum = 0\n    for num in input_list:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[3, 1, 3, 2]", "output": "[3, 4, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57457_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029196", "code": "def calculate_data_size(data_dir, batch_size, num_workers):\n    # Number of images in train and valid directories (example values)\n    num_train_images = 1000\n    num_valid_images = 500\n    # Calculate total data size for training and validation sets\n    total_data_size_train = num_train_images * batch_size\n    total_data_size_valid = num_valid_images * batch_size\n    # Adjust data size based on the number of workers\n    total_data_size_train *= (1 + (num_workers - 1) * 0.1)\n    total_data_size_valid *= (1 + (num_workers - 1) * 0.1)\n    return total_data_size_train, total_data_size_valid\n", "entry_point": "calculate_data_size", "input": "'some_directory', 60, 1", "output": "(60000.0, 30000.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75732_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029197", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7108", "output": "{1, 2, 3554, 7108, 4, 1777}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7107", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029198", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2463", "output": "{1, 3, 821, 2463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2462", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029199", "code": "def count_unique_words(text):\n    word_counts = {}\n    text = text.lower()\n    words = text.split()\n    for word in words:\n        clean_word = ''.join(char for char in word if char.isalnum())\n        if clean_word:\n            word_counts[clean_word] = word_counts.get(clean_word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'hodog'", "output": "{'hodog': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11372_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029200", "code": "from typing import List, Any\nimport copy\ndef copy_pack(existing_pack: List[Any]) -> List[Any]:\n    new_pack = []\n    for item in existing_pack:\n        new_pack.append(copy.deepcopy(item))\n    return new_pack\n", "entry_point": "copy_pack", "input": "[5, 3, 3, 1, 2, 4, 5]", "output": "[5, 3, 3, 1, 2, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124330_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029201", "code": "def extract_region(availability_zone: str) -> str:\n    # Split the availability zone string into region and zone letter\n    region, zone_letter = availability_zone.rsplit(\"-\", 1)\n    return region\n", "entry_point": "extract_region", "input": "'usus-a'", "output": "'usus'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98517_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029202", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'woo heel worl'", "output": "'worl heel woo'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029203", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        output_list.append(input_list[i] + input_list[next_index])\n    return output_list\n", "entry_point": "circular_sum", "input": "[0, 5, 0, 3, 3, 6, 2, 6]", "output": "[5, 5, 3, 6, 9, 8, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105317_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029204", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8887", "output": "{1, 8887}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029205", "code": "import math\nMAX_BRIGHT = 2.0\ndef rgb1(v):\n    r = 1 + math.cos(v * math.pi)\n    g = 0\n    b = 1 + math.sin(v * math.pi)\n    # Scale the RGB components based on the maximum brightness\n    r_scaled = int(MAX_BRIGHT * r)\n    g_scaled = int(MAX_BRIGHT * g)\n    b_scaled = int(MAX_BRIGHT * b)\n    return (r_scaled, g_scaled, b_scaled)\n", "entry_point": "rgb1", "input": "1.2", "output": "(0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70015_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029206", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9897", "output": "{3, 1, 9897, 3299}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029207", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "3", "output": "['1', '2', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029208", "code": "def delete_duplicates(nums):\n    return list(set(nums))\n", "entry_point": "delete_duplicates", "input": "[2, 3, 3, 4, 5, 6, 7, 7]", "output": "[2, 3, 4, 5, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93018_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029209", "code": "def card_game(player_a, player_b):\n    rounds_a_won = 0\n    rounds_b_won = 0\n    ties = 0\n    for card_a, card_b in zip(player_a, player_b):\n        if card_a > card_b:\n            rounds_a_won += 1\n        elif card_b > card_a:\n            rounds_b_won += 1\n        else:\n            ties += 1\n    return rounds_a_won, rounds_b_won, ties\n", "entry_point": "card_game", "input": "[5, 1, 2, 3, 4], [1, 2, 3, 4, 6]", "output": "(1, 4, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34362_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029210", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "831", "output": "{1, 3, 277, 831}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt830", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029211", "code": "def find_second_largest(nums):\n    first_max = second_max = float('-inf')\n    for num in nums:\n        if num > first_max:\n            second_max = first_max\n            first_max = num\n        elif num > second_max and num != first_max:\n            second_max = num\n    return second_max\n", "entry_point": "find_second_largest", "input": "[10, 20, 15]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84134_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029212", "code": "import os\ndef serve_static_file(path):\n    routes = {\n        'bower_components': 'bower_components',\n        'modules': 'modules',\n        'styles': 'styles',\n        'scripts': 'scripts',\n        'fonts': 'fonts'\n    }\n    if path == 'robots.txt':\n        return 'robots.txt'\n    elif path == '404.html':\n        return '404.html'\n    elif path.startswith('fonts/'):\n        return os.path.join('fonts', path.split('/', 1)[1])\n    else:\n        for route, directory in routes.items():\n            if path.startswith(route + '/'):\n                return os.path.join(directory, path.split('/', 1)[1])\n    return '404.html'\n", "entry_point": "serve_static_file", "input": "'robots.txt'", "output": "'robots.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103383_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029213", "code": "from typing import Tuple\ndef zeroTest(double: float, value: float) -> Tuple[str, str]:\n    lower = double - value\n    upper = double + value - 1\n    if lower < 0:\n        upper -= lower\n        lower = 0\n    return str(int(lower)), str(int(upper))\n", "entry_point": "zeroTest", "input": "-3, -3", "output": "('0', '-7')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44721_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029214", "code": "def longest_positive_sequence(lst):\n    max_length = 0\n    current_length = 0\n    for num in lst:\n        if num > 0:\n            current_length += 1\n        else:\n            max_length = max(max_length, current_length)\n            current_length = 0\n    max_length = max(max_length, current_length)  # Check the last sequence\n    return max_length\n", "entry_point": "longest_positive_sequence", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95331_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029215", "code": "def extract_integers(input_string):\n    array = []\n    i = 0\n    while i < len(input_string):\n        if input_string[i] == '[':\n            i += 1\n        elif input_string[i] == ']':\n            break\n        elif input_string[i].isdigit() or input_string[i] == '-':\n            j = i\n            temp = ''\n            while input_string[j] != ',' and input_string[j] != ']':\n                temp += input_string[j]\n                j += 1\n                i = j\n            array.append(int(temp))\n        else:\n            i += 1\n    return array\n", "entry_point": "extract_integers", "input": "'[1, 2, 3, 4, 5]'", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15817_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029216", "code": "def remove_comments(string, markers):\n    output = []\n    for line in string.split(\"\\n\"):\n        containsCommentIndicator = \"\"\n        for c in line:\n            if c in markers:\n                containsCommentIndicator = c\n                break\n        if containsCommentIndicator != \"\":\n            line = line[:line.find(containsCommentIndicator)]\n        line = line.rstrip(\" \")\n        output.append(line)\n    return '\\n'.join(output)\n", "entry_point": "remove_comments", "input": "'Helloa // This comment will be removed', '//'", "output": "'Helloa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146648_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029217", "code": "def filter_non_nickelback_songs(songs):\n    non_nickelback_songs = {song[1] for song in songs if song[0] != 'Nickelback'}\n    return non_nickelback_songs\n", "entry_point": "filter_non_nickelback_songs", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39863_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029218", "code": "def sum_greater_than_average(lst):\n    if not lst:\n        return 0  # Return 0 for an empty list\n    avg = sum(lst) / len(lst)\n    sum_greater = sum(num for num in lst if num > avg)\n    return sum_greater\n", "entry_point": "sum_greater_than_average", "input": "[0, 0, 0, 33]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126305_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029219", "code": "def arrayMaxConsecutiveSum(inputArray, k):\n    arr = [sum(inputArray[:k])]\n    for i in range(1, len(inputArray) - (k - 1)):\n        arr.append(arr[i - 1] - inputArray[i - 1] + inputArray[i + k - 1])\n    sort_arr = sorted(arr)\n    return sort_arr[-1]\n", "entry_point": "arrayMaxConsecutiveSum", "input": "[4, 4, 1, 2], 2", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129836_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029220", "code": "def base_converter(num, base):\n    if base < 2 or base > 16:\n        return \"Invalid base. Please choose a base between 2 and 16.\"\n    hex_map = {10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}\n    if num == 0:\n        return '0'\n    converted_num = []\n    while num > 0:\n        remainder = num % base\n        if remainder >= 10:\n            converted_num.append(hex_map[remainder])\n        else:\n            converted_num.append(str(remainder))\n        num //= base\n    converted_num.reverse()\n    return ''.join(converted_num)\n", "entry_point": "base_converter", "input": "6, 2", "output": "'110'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32696_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029221", "code": "def custom_split(text, min_char):\n    if len(text) <= min_char:\n        return text\n    for i in range(min_char, len(text)):\n        if text[i] == ' ':\n            return text[:i], text[i+1:]\n    return text[:min_char], text[min_char:]\n", "entry_point": "custom_split", "input": "'browbrownn', 4", "output": "('brow', 'brownn')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91712_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029222", "code": "def remove_duplicates(input_list):\n    seen_elements = set()\n    output_list = []\n    for element in input_list:\n        if element not in seen_elements:\n            output_list.append(element)\n            seen_elements.add(element)\n    return output_list\n", "entry_point": "remove_duplicates", "input": "[5, 1, 7, 0, 5, 1, 7, 0]", "output": "[5, 1, 7, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18902_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029223", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "824", "output": "{1, 2, 4, 103, 8, 206, 824, 412}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt823", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029224", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "584", "output": "{1, 2, 292, 4, 584, 8, 73, 146}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt583", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029225", "code": "def filter_valid_error_handlers(error_handlers):\n    valid_error_handlers = {}\n    for error_code, handler in error_handlers.items():\n        if 400 <= error_code <= 599:\n            valid_error_handlers[error_code] = handler\n    return valid_error_handlers\n", "entry_point": "filter_valid_error_handlers", "input": "{200: 'handler1', 300: 'handler2', 600: 'handler3'}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33687_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029226", "code": "from typing import Tuple\ndef extract_symbols(pair: str) -> Tuple[str, str]:\n    original_length = len(pair)\n    if original_length < 6:\n        return pair, ''\n    valid_sources = ['USDT', 'BUSD', 'BTC', 'ETH']\n    for source in valid_sources:\n        array = pair.split(source)\n        if len(array) > 1:\n            return array[0], source\n    return pair, ''\n", "entry_point": "extract_symbols", "input": "'ETHBUSD'", "output": "('ETH', 'BUSD')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99946_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029227", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'a0000'", "output": "'a0000'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029228", "code": "def character_frequency(char_list):\n    frequency_dict = {}\n    for char in char_list:\n        if char in frequency_dict:\n            frequency_dict[char] += 1\n        else:\n            frequency_dict[char] = 1\n    return frequency_dict\n", "entry_point": "character_frequency", "input": "['a', 'a', 'a', 'b', 'b', 'c']", "output": "{'a': 3, 'b': 2, 'c': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6497_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029229", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "20", "output": "0.020999999999999998", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029230", "code": "def pow_recursive(x, n):\n    if n == 0:\n        return 1\n    else:\n        return x * pow_recursive(x, n - 1)\n", "entry_point": "pow_recursive", "input": "6, 5", "output": "7776", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77530_ipt17", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029231", "code": "def dummy(n):\n    return n * (n + 1) // 2\n", "entry_point": "dummy", "input": "995", "output": "495510", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26776_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029232", "code": "def maximize_treasure(grid):\n    if not grid:\n        return 0\n    rows, cols = len(grid), len(grid[0])\n    dp = [[0] * cols for _ in range(rows)]\n    dp[0][0] = grid[0][0]\n    for i in range(1, rows):\n        dp[i][0] = dp[i - 1][0] + grid[i][0]\n    for j in range(1, cols):\n        dp[0][j] = dp[0][j - 1] + grid[0][j]\n    for i in range(1, rows):\n        for j in range(1, cols):\n            dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + grid[i][j]\n    return dp[rows - 1][cols - 1]\n", "entry_point": "maximize_treasure", "input": "[[1, 2, 3], [0, 0, 6], [0, 0, 0]]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88564_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029233", "code": "def login_system(username, password):\n    if username == \"admin\" and password == \"password123\":\n        return \"Login successful\"\n    else:\n        return \"Login failed\"\n", "entry_point": "login_system", "input": "'admin', 'password123'", "output": "'Login successful'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18101_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029234", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5942", "output": "{1, 2, 2971, 5942}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5941", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029235", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[11], 0", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029236", "code": "def generate_log_message(task_type, log_line_type):\n    log_line_prefix = \"-***-\"\n    log_line_block_prefix = \"*** START\"\n    log_line_block_suffix = \"*** END\"\n    if task_type not in [\"Training\", \"Processing\"] or log_line_type not in [\"Prefix\", \"Block Prefix\", \"Block Suffix\"]:\n        return \"Invalid task_type or log_line_type provided.\"\n    if log_line_type == \"Prefix\":\n        return f\"{log_line_prefix} {task_type}\"\n    elif log_line_type == \"Block Prefix\":\n        return f\"{log_line_block_prefix} {task_type}\"\n    elif log_line_type == \"Block Suffix\":\n        return f\"{log_line_block_suffix} {task_type}\"\n", "entry_point": "generate_log_message", "input": "'Training', 'Prefix'", "output": "'-***- Training'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115556_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029237", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'daashp'", "output": "'daashp_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029238", "code": "from typing import List\ndef simulate_card_game(deck: List[int]) -> List[int]:\n    if len(deck) == 1:\n        return deck\n    middle_index = len(deck) // 2\n    if len(deck) % 2 != 0:\n        middle_card = [deck.pop(middle_index)]\n    half1 = simulate_card_game(deck[:middle_index])\n    half2 = simulate_card_game(deck[middle_index:])\n    result = []\n    for card1, card2 in zip(half1, half2):\n        result.extend([card1, card2])\n    if len(half1) > len(half2):\n        result.append(half1[-1])\n    elif len(half2) > len(half1):\n        result.append(half2[-1])\n    if len(deck) % 2 != 0:\n        result.extend(middle_card)\n    return result\n", "entry_point": "simulate_card_game", "input": "[3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17300_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029239", "code": "def escape_solr_query(query):\n    \"\"\"\n    Escape special chars for Solr queries.\n    \"\"\"\n    chars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '\"', '~', '*', '?',\n             ':', '/', ' ']\n    for char in chars:\n        query = query.replace(char, '\\\\' + char)\n    return query\n", "entry_point": "escape_solr_query", "input": "'&&'", "output": "'\\\\&&'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149995_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029240", "code": "import os\ndef process_samples(sample_files):\n    if not isinstance(sample_files, list) or len(sample_files) == 0:\n        return \"Invalid input\"\n    n = len(sample_files)\n    if n != 1 and n != 2:\n        return \"Input must have 1 (single-end) or 2 (paired-end) elements.\"\n    readcmd = '--readFilesCommand gunzip -c' if sample_files[0].endswith('.gz') else ''\n    outprefix = os.path.dirname(sample_files[0]) + '/'\n    return readcmd, outprefix\n", "entry_point": "process_samples", "input": "[]", "output": "'Invalid input'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77400_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029241", "code": "import importlib\ndef load_and_return_attribute(module_name: str, attribute: str) -> str:\n    try:\n        print(f\"Loading {module_name}...\")\n        hub_module = importlib.import_module(module_name)\n        return f\"Loaded {module_name}.{attribute}...\"\n    except ModuleNotFoundError:\n        return f\"Error: Module {module_name} not found.\"\n", "entry_point": "load_and_return_attribute", "input": "'my_mod', 'some_attribute'", "output": "'Error: Module my_mod not found.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122876_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029242", "code": "def replace_spaces(S: str, length: int) -> str:\n    res = []\n    for c in S[:length]:\n        if c == ' ':\n            c = '%20'\n        res.append(c)\n    return ''.join(res)\n", "entry_point": "replace_spaces", "input": "'Mr. Smith', 2", "output": "'Mr'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88290_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029243", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4739", "output": "{1, 4739, 677, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029244", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'grape'", "output": "['grape']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029245", "code": "ENTITY_LINK = {\n    'biomaterial': 'biomaterials',\n    'process': 'processes',\n    'file': 'files',\n    'protocol': 'protocols',\n    'project': 'projects',\n    'submission_envelope': 'submissionEnvelopes'\n}\ndef map_entity_types(entity_types):\n    plural_forms = []\n    for entity_type in entity_types:\n        if entity_type in ENTITY_LINK:\n            plural_forms.append(ENTITY_LINK[entity_type])\n    return plural_forms\n", "entry_point": "map_entity_types", "input": "['biomaterial', 'process', 'file']", "output": "['biomaterials', 'processes', 'files']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56933_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029246", "code": "def calculate_average_params(tups):\n    weight_params = {}\n    for weight, param in tups:\n        if weight not in weight_params:\n            weight_params[weight] = [param, 1]\n        else:\n            weight_params[weight][0] += param\n            weight_params[weight][1] += 1\n    average_params = {weight: param_sum / count for weight, (param_sum, count) in weight_params.items()}\n    return average_params\n", "entry_point": "calculate_average_params", "input": "[(2.1, 0.01), (2.1, 0.03), (0.1, 0.03)]", "output": "{2.1: 0.02, 0.1: 0.03}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12268_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029247", "code": "def process_object(object_name: str, object_category: str) -> tuple:\n    source_value = None\n    endpoint_url = None\n    if object_category == \"data_source\":\n        source_value = \"ds_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/ds_smart_status\"\n        object_category = \"data_name\"\n    elif object_category == \"data_host\":\n        source_value = \"dh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/dh_smart_status\"\n    elif object_category == \"metric_host\":\n        source_value = \"mh_smart_status\"\n        endpoint_url = \"/services/trackme/v1/smart_status/mh_smart_status\"\n    body = \"{'\" + object_category + \"': '\" + object_name + \"'}\"\n    return source_value, endpoint_url, body\n", "entry_point": "process_object", "input": "'objtect', 'dastdata_hosd'", "output": "(None, None, \"{'dastdata_hosd': 'objtect'}\")", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133706_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029248", "code": "import re\ndef count_unique_words(text):\n    word_counts = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_counts[word] = word_counts.get(word, 0) + 1\n    return word_counts\n", "entry_point": "count_unique_words", "input": "'ypyytho'", "output": "{'ypyytho': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33729_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029249", "code": "def calculate_video_duration(fps, total_frames):\n    total_duration = total_frames / fps\n    return round(total_duration, 2)\n", "entry_point": "calculate_video_duration", "input": "30, 999", "output": "33.3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131697_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029250", "code": "def longest_common_subsequence(text1, text2):\n    m, n = len(text1), len(text2)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m):\n        for j in range(n):\n            if text1[i] == text2[j]:\n                dp[i+1][j+1] = dp[i][j] + 1\n            else:\n                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])\n    return dp[m][n]\n", "entry_point": "longest_common_subsequence", "input": "'123456789', '987654321123456789'", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14619_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029251", "code": "from typing import List\ndef top_k_players(scores: List[int], k: int) -> List[int]:\n    score_positions = {}\n    for i, score in enumerate(scores):\n        if score not in score_positions:\n            score_positions[score] = i\n    sorted_scores = sorted(scores, key=lambda x: (-x, score_positions[x]))\n    return sorted_scores[:k]\n", "entry_point": "top_k_players", "input": "[28, 26, 25, 19, 19, 16, 15, 15, 9], 9", "output": "[28, 26, 25, 19, 19, 16, 15, 15, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4161_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029252", "code": "def sum_of_squares_even(numbers):\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:  # Check if the number is even\n            total += num ** 2  # Add the square of the even number to the total\n    return total\n", "entry_point": "sum_of_squares_even", "input": "[2, 2]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15719_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029253", "code": "def format_version(version_tuple):\n    if len(version_tuple) != 3 or not all(isinstance(v, int) for v in version_tuple):\n        raise ValueError(\"Invalid version tuple format\")\n    major, minor, patch = version_tuple\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "format_version", "input": "(1, 2, 1)", "output": "'1.2.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48315_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029254", "code": "def generate_node_string(node_values, total_nodes):\n    node_strings = [\"v\" + str(x) for x in range(total_nodes)]\n    output_string = \"{\" + \", \".join(node_strings) + \"}\"\n    return output_string\n", "entry_point": "generate_node_string", "input": "None, 4", "output": "'{v0, v1, v2, v3}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74263_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029255", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "123", "output": "{3, 1, 123, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt122", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029256", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[9, 9, 10, 10, 10]", "output": "[9, 9, 10, 10, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt77", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029257", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[0, 1, 2, 2, 7, 7, 7, 10]", "output": "[0, 1, 2, 2, 7, 7, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029258", "code": "def findUniqueNumbers(A):\n    xor_result = 0\n    for num in A:\n        xor_result ^= num\n    bit_position = 0\n    while xor_result & 1 == 0:\n        bit_position += 1\n        xor_result >>= 1\n    unique1 = unique2 = 0\n    for num in A:\n        if num & (1 << bit_position):\n            unique1 ^= num\n        else:\n            unique2 ^= num\n    return [unique1, unique2]\n", "entry_point": "findUniqueNumbers", "input": "[7, 10, 2, 2, 3, 3]", "output": "[7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147279_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029259", "code": "def count_valid_rearrangements(n, s):\n    MOD = int(1e9 + 7)\n    dp = [1] * n\n    for c in s:\n        if c == \">\":\n            dp = list(reversed([sum(dp[:i+1]) % MOD for i in range(n)]))\n        elif c == \"<\":\n            dp = [sum(dp[i:]) % MOD for i in range(n)]\n    return sum(dp) % MOD\n", "entry_point": "count_valid_rearrangements", "input": "1, ''", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137165_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029260", "code": "from typing import List\ndef min_boats(people: List[int], limit: int) -> int:\n    people.sort()\n    left, right, boats = 0, len(people) - 1, 0\n    while left <= right:\n        if people[left] + people[right] <= limit:\n            left += 1\n        right -= 1\n        boats += 1\n    return boats\n", "entry_point": "min_boats", "input": "[1, 2, 3, 5, 6], 8", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49829_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029261", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9190", "output": "{1, 2, 5, 9190, 10, 1838, 4595, 919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9189", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1233", "output": "{1, 3, 9, 137, 1233, 411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1232", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029263", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "4", "output": "['1', '2', 'Fizz', '4']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029264", "code": "from typing import Union\ndef split_items_by_count(item_list: Union[list, tuple], part_count: int) -> list:\n    if not item_list:\n        return []\n    total_parts = len(item_list) // part_count\n    remaining_items = len(item_list) % part_count\n    result_list = [item_list[part_count * i : part_count * (i + 1)] for i in range(total_parts)]\n    if remaining_items:\n        result_list.append(item_list[-remaining_items:])\n    return result_list\n", "entry_point": "split_items_by_count", "input": "[5, 5, 6, 3, 5, 6, 9, 5], 8", "output": "[[5, 5, 6, 3, 5, 6, 9, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19246_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029265", "code": "def circular_sum(input_list):\n    output_list = []\n    n = len(input_list)\n    for i in range(n):\n        if i < n - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 6, 5, 3]", "output": "[6, 9, 11, 8, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64950_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029266", "code": "def remove_special_filename(filenames):\n    return [filename for filename in filenames if filename != '__init__']\n", "entry_point": "remove_special_filename", "input": "['file1', 'file2', 'file3']", "output": "['file1', 'file2', 'file3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125420_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029267", "code": "def moeda(n):\n    # Format the number as a string with two decimal places\n    final = f'R$:{n:.2f}'\n    # Replace the decimal point \".\" with a comma \",\"\n    final = final.replace('.', ',')\n    return final\n", "entry_point": "moeda", "input": "674.1", "output": "'R$:674,10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137968_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029268", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < 5:\n            top_scores.append(score)\n            top_scores.sort(reverse=True)\n        else:\n            if score > top_scores[-1]:\n                top_scores[-1] = score\n                top_scores.sort(reverse=True)\n    if len(scores) < 5:\n        return sum(scores) / len(scores)\n    else:\n        return sum(top_scores) / 5\n", "entry_point": "calculate_top5_average", "input": "[50, 50, 50, 50, 50]", "output": "50.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81242_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029269", "code": "def interpreter(program: str) -> str:\n    # Split the program string by the comment indicator '//'\n    parts = program.split('//')\n    # Extract the program code part before the comment\n    code = parts[0]\n    # Remove all spaces and convert to lowercase\n    modified_code = code.replace(' ', '').lower()\n    return modified_code\n", "entry_point": "interpreter", "input": "'    hnot?world! // this is a comment'", "output": "'hnot?world!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84299_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029270", "code": "def reverse_words(s: str) -> str:\n    list_s = s.split(' ')\n    for i in range(len(list_s)):\n        list_s[i] = list_s[i][::-1]\n    return ' '.join(list_s)\n", "entry_point": "reverse_words", "input": "'Code Code Let Lee'", "output": "'edoC edoC teL eeL'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97113_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029271", "code": "def every(lst, f=1, start=0):\n    result = []\n    for i in range(start, len(lst), f):\n        result.append(lst[i])\n    return result\n", "entry_point": "every", "input": "[1, 2, 3, 4, 5, 6, 7, 8], f=2, start=1", "output": "[2, 4, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105731_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029272", "code": "def convertToWave(N, arr):\n    for i in range(1, N, 2):\n        arr[i], arr[i - 1] = arr[i - 1], arr[i]\n    return arr\n", "entry_point": "convertToWave", "input": "7, [0, 6, 2, 0, 6, 6, 1]", "output": "[6, 0, 0, 2, 6, 6, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146312_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029273", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(10, 5), fan='fan_in'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029274", "code": "import math\ndef count_visible_squares(w, h):\n    total_squares = w * h\n    invisible_squares = w + h - math.gcd(w, h)\n    visible_squares = total_squares - invisible_squares\n    return visible_squares\n", "entry_point": "count_visible_squares", "input": "5, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110148_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029275", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4411", "output": "{11, 1, 401, 4411}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029276", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9491", "output": "{1, 9491}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9490", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029277", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "2.71825, 3", "output": "2.718", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029278", "code": "def get_root(file):\n    \"\"\"Returns the root part of the filename\n    Args:\n    file (str): The input filename\n    Returns:\n    str: The root part of the filename\n    \"\"\"\n    parts = file.split(\"_\")\n    root_parts = \"_\".join(parts[1:]) if len(parts) > 1 else \"\"\n    return root_parts\n", "entry_point": "get_root", "input": "'header_parpart1_s2.txt'", "output": "'parpart1_s2.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59272_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029279", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8797", "output": "{1, 19, 8797, 463}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029280", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 8, 8, 8, 9, 7]", "output": "[3, 9, 10, 11, 13, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029281", "code": "def extract_unique_words(text):\n    # Convert text to lowercase and split into words\n    words = text.lower().split()\n    # Remove leading and trailing whitespaces from each word\n    words = [word.strip() for word in words]\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hhworod!'", "output": "['hhworod!']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22122_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029282", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2427", "output": "{3, 1, 2427, 809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029283", "code": "def generate_encrypted_token(input_string):\n    # Custom encryption mechanism (for demonstration purposes)\n    encrypted_token = \"\"\n    for char in input_string:\n        encrypted_token += chr(ord(char) + 1)  # Shift each character by 1 (simple encryption)\n    return encrypted_token\n", "entry_point": "generate_encrypted_token", "input": "'Hello, World'", "output": "'Ifmmp-!Xpsme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56961_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029284", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'WORLLD'", "output": "'worlld'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029285", "code": "import math\ndef sum_divisors(n: int) -> int:\n    answer = 0\n    i = 1\n    while i * i < n + 1:\n        if n % i == 0:\n            if i == n // i:\n                answer += i\n            else:\n                answer += i + n // i\n        i += 1\n    return answer\n", "entry_point": "sum_divisors", "input": "22", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134530_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029286", "code": "def extract_app_name(default_config: str) -> str:\n    # Split the input string by dot separator and extract the last part\n    parts = default_config.split('.')\n    app_config_class = parts[-1]\n    # Remove the \"Config\" suffix from the class name to get the app name\n    app_name = app_config_class.replace(\"Config\", \"\")\n    return app_name\n", "entry_point": "extract_app_name", "input": "'com.example.tstdjgppsppfgConfig'", "output": "'tstdjgppsppfg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23074_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029287", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5361", "output": "{1, 3, 5361, 1787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5360", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029288", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "' Wd\ud83d\ude0a'", "output": "' Wd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029289", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1835", "output": "{1, 1835, 5, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029290", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9938", "output": "{4969, 1, 9938, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9937", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029291", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "695", "output": "{1, 139, 5, 695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029292", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7041", "output": "{2347, 1, 7041, 3}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029293", "code": "def calculate_ranks(scores):\n    ranks = [1] * len(scores)\n    for i in range(1, len(scores)):\n        if scores[i] == scores[i - 1]:\n            ranks[i] = ranks[i - 1]\n        else:\n            ranks[i] = i + 1\n    return ranks\n", "entry_point": "calculate_ranks", "input": "[10, 20, 30, 40, 40]", "output": "[1, 2, 3, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111970_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029294", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2753", "output": "{1, 2753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029295", "code": "def running_average_max(stream, window_size):\n    if not stream or window_size <= 0:\n        return 0\n    max_running_avg = float('-inf')\n    window_sum = 0\n    for i in range(len(stream)):\n        window_sum += stream[i]\n        if i >= window_size:\n            window_sum -= stream[i - window_size]\n        if i >= window_size - 1:\n            current_avg = window_sum / window_size\n            max_running_avg = max(max_running_avg, current_avg)\n    return max_running_avg\n", "entry_point": "running_average_max", "input": "[1, 5, 6, 8, 7, 2, 8], 7", "output": "5.285714285714286", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73192_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029296", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2971", "output": "{1, 2971}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2970", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029297", "code": "from typing import Tuple\ndef split_course_key(key: str) -> Tuple[str, str, str]:\n    if key.startswith(\"course-v1:\"):\n        organization, course, run = key[10:].split(\"+\")\n    else:\n        organization, course, run = key.split(\"/\")\n    return organization, course, run\n", "entry_point": "split_course_key", "input": "'course-v1:edX+CS101+2020'", "output": "('edX', 'CS101', '2020')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4628_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029298", "code": "def calculate_waiting_time(arrival, bus_ids):\n    bus_ids = [int(n) for n in bus_ids if n != 'x']\n    waiting_time = [(n - arrival % n, n) for n in bus_ids]\n    min_time = waiting_time[0][0]\n    first_bus = waiting_time[0][1]\n    for minutes, bus in waiting_time[1:]:\n        if minutes < min_time:\n            min_time = minutes\n            first_bus = bus\n    return min_time * first_bus\n", "entry_point": "calculate_waiting_time", "input": "3, ['8']", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39405_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029299", "code": "def total_legs(animal_list):\n    total_legs_count = 0\n    animals = animal_list.split(',')\n    for animal in animals:\n        name, legs = animal.split(':')\n        total_legs_count += int(legs)\n    return total_legs_count\n", "entry_point": "total_legs", "input": "'dog:4,cat:4,bird:4'", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23053_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029300", "code": "def diagonal_difference(arr, n):\n    mtotal = 0\n    stotal = 0\n    for i in range(n):\n        mtotal += arr[i][i]\n        stotal += arr[n - 1 - i][i]\n    return abs(mtotal - stotal)\n", "entry_point": "diagonal_difference", "input": "[[1, 2, 3], [4, 8, 6], [7, 8, 4]], 3", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112700_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029301", "code": "from typing import List, Tuple, Set, Union\ndef create_ngram_set(input_list: List[int], ngram_value: int) -> Union[Set[Tuple[int, int]], List[Tuple[int, int, int]]]:\n    if ngram_value == 2:\n        return set(zip(*[input_list[i:] for i in range(ngram_value)]))\n    elif ngram_value == 3:\n        return list(zip(*[input_list[i:] for i in range(ngram_value)]))\n    else:\n        raise ValueError(\"Unsupported ngram_value. Supported values are 2 and 3.\")\n", "entry_point": "create_ngram_set", "input": "[11, 22, 33, 44], 3", "output": "[(11, 22, 33), (22, 33, 44)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58868_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1271", "output": "{1, 31, 41, 1271}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1270", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029303", "code": "def calculate_error_rates(acc_rate1, acc_rate5):\n    err_rate1 = 1 - acc_rate1\n    err_rate5 = 1 - acc_rate5\n    return err_rate1, err_rate5\n", "entry_point": "calculate_error_rates", "input": "-2.331, 7.0812", "output": "(3.331, -6.0812)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60400_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029304", "code": "def max_rectangle_area(buildings):\n    stack = []\n    max_area = 0\n    n = len(buildings)\n    for i in range(n):\n        while stack and buildings[i] < buildings[stack[-1]]:\n            height = buildings[stack.pop()]\n            width = i if not stack else i - stack[-1] - 1\n            max_area = max(max_area, height * width)\n        stack.append(i)\n    while stack:\n        height = buildings[stack.pop()]\n        width = n if not stack else n - stack[-1] - 1\n        max_area = max(max_area, height * width)\n    return max_area\n", "entry_point": "max_rectangle_area", "input": "[4, 4, 4, 0, 1, 2]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70831_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029305", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5479", "output": "{1, 5479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029306", "code": "from typing import List\ndef isWordGuessed(secretWord: str, lettersGuessed: List[str]) -> bool:\n    isAinB = [char in lettersGuessed for char in secretWord]\n    return all(isAinB)\n", "entry_point": "isWordGuessed", "input": "'apple', ['a', 'p', 'l', 'e']", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36145_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029307", "code": "def calculate_average(scores):\n    if len(scores) <= 2:\n        return 0  # No scores to calculate average\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the lowest and highest scores\n    average = sum(trimmed_scores) / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[70, 83.6, 90]", "output": "83.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35243_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029308", "code": "import string\n# letters, numbers, and space\nALLOWED_CHARS = f\"{string.ascii_letters} {string.digits}\"\ndef filter_allowed_chars(input_string):\n    filtered_chars = [char for char in input_string if char in ALLOWED_CHARS]\n    filtered_string = ''.join(filtered_chars)\n    return filtered_string\n", "entry_point": "filter_allowed_chars", "input": "'H@ 2lH3%!'", "output": "'H 2lH3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130924_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029309", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'13.133..1.03.3'", "output": "'13.133..1.03.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029310", "code": "def simulate_gibbs_sampler(probabilities, num_iterations):\n    for _ in range(num_iterations):\n        updated_probabilities = [0] * len(probabilities)\n        for i in range(len(probabilities)):\n            neighbor_sum = 0\n            if i > 0:\n                neighbor_sum += probabilities[i - 1]\n            if i < len(probabilities) - 1:\n                neighbor_sum += probabilities[i + 1]\n            updated_probabilities[i] = (probabilities[i] + neighbor_sum) / 2\n        probabilities = updated_probabilities\n    return probabilities\n", "entry_point": "simulate_gibbs_sampler", "input": "[], 5", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22969_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029311", "code": "def perform_operation(num1: int, num2: int, operator: str) -> int:\n    if operator not in ['+', '-']:\n        raise Exception(\"Error: Operator must be '+' or '-'.\")\n    if operator == '+':\n        return num1 + num2\n    elif operator == '-':\n        return num1 - num2\n", "entry_point": "perform_operation", "input": "3, 4, '+'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123558_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029312", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7805", "output": "{1, 35, 5, 7, 1561, 1115, 7805, 223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7804", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029313", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1951", "output": "{1, 1951}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1950", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029314", "code": "def find_pairs(return_value):\n    pairs = []\n    for a2 in range(1, return_value + 1):\n        if return_value % a2 == 0:\n            b2 = return_value // a2\n            pairs.append((a2, b2))\n    return pairs\n", "entry_point": "find_pairs", "input": "3", "output": "[(1, 3), (3, 1)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144518_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029315", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7037", "output": "{1, 227, 7037, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7036", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029316", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1211", "output": "{1, 1211, 173, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029317", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7557", "output": "{1, 33, 3, 7557, 229, 11, 687, 2519}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029318", "code": "# Step 1: Define the mapping dictionary\nUSER2SOLRFIELDNAME_MAP = {\n    \"author\": \"authors\",\n    \"title\": \"titles\",\n    \"category\": \"categories\",\n    # Add more mappings as needed\n}\n# Step 2: Implement the conversion function\ndef user2solrfieldname(user_key_name):\n    \"\"\"\n    Convert a user variation of a standard field name to a standard Solr schema name\n    >>> user2solrfieldname(\"author\")\n    'authors'\n    \"\"\"\n    return USER2SOLRFIELDNAME_MAP.get(user_key_name, user_key_name)\n", "entry_point": "user2solrfieldname", "input": "'title'", "output": "'titles'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97996_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029319", "code": "def find_non_dup(A=[]):\n    if len(A) == 0:\n        return None\n    non_dup = [x for x in A if A.count(x) == 1]\n    return non_dup[-1]\n", "entry_point": "find_non_dup", "input": "[1, 1, 2, 3, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57269_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029320", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[5, 6, 7, 1, 8, 6, 6, 5], 6", "output": "[[5, 6, 7, 1, 8, 6], [6, 5]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029321", "code": "from typing import List\ndef convert_sequence(sequence: str, alphabet: dict) -> List[int]:\n    numerical_values = []\n    for char in sequence:\n        numerical_values.append(alphabet.get(char, -1))\n    return numerical_values\n", "entry_point": "convert_sequence", "input": "'xxxxxxxxx', {'a': 1, 'b': 2, 'c': 3}", "output": "[-1, -1, -1, -1, -1, -1, -1, -1, -1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130476_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029322", "code": "def modular_inverse(a, m):\n    def egcd(a, b):\n        if a == 0:\n            return (b, 0, 1)\n        else:\n            g, x, y = egcd(b % a, a)\n            return (g, y - (b // a) * x, x)\n    g, x, y = egcd(a, m)\n    if g != 1:\n        return None\n    else:\n        return x % m\n", "entry_point": "modular_inverse", "input": "1, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35681_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029323", "code": "def control_flow_replica(x):\n    if x < 0:\n        if x < -10:\n            return x * 2\n        else:\n            return x * 3\n    else:\n        if x > 10:\n            return x * 4\n        else:\n            return x * 5\n", "entry_point": "control_flow_replica", "input": "-1", "output": "-3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17276_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029324", "code": "def longestPalindromeSubstring(s: str) -> str:\n    if not s:\n        return \"\"\n    def expandAroundCenter(left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return s[left + 1:right]\n    longest_palindrome = \"\"\n    for i in range(len(s)):\n        palindrome_odd = expandAroundCenter(i, i)\n        palindrome_even = expandAroundCenter(i, i + 1)\n        if len(palindrome_odd) > len(longest_palindrome):\n            longest_palindrome = palindrome_odd\n        if len(palindrome_even) > len(longest_palindrome):\n            longest_palindrome = palindrome_even\n    return longest_palindrome\n", "entry_point": "longestPalindromeSubstring", "input": "'arara'", "output": "'arara'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15337_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029325", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[-2, -4, -3, -3, 2, -3, -3, -3]", "output": "[-4, -8, -4, -4, 4, -4, -4, -4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029326", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "365", "output": "{73, 1, 5, 365}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt364", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029327", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2770", "output": "{1, 2, 5, 1385, 554, 10, 2770, 277}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2769", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029328", "code": "def count_question_occurrences(questions):\n    question_occurrences = {}\n    for question_dict in questions:\n        question_text = question_dict[\"text\"]\n        if question_text in question_occurrences:\n            question_occurrences[question_text] += 1\n        else:\n            question_occurrences[question_text] = 1\n    return question_occurrences\n", "entry_point": "count_question_occurrences", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114672_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029329", "code": "def add_index_to_element(input_list):\n    result = []\n    for index, element in enumerate(input_list):\n        result.append(element + index)\n    return result\n", "entry_point": "add_index_to_element", "input": "[4, 3, 5, 3, 7, 3, 7, 3]", "output": "[4, 4, 7, 6, 11, 8, 13, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50435_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029330", "code": "def convert_seconds_to_time(seconds):\n    units = [\n        ('day', 86400),\n        ('hour', 3600),\n        ('minute', 60),\n        ('second', 1)\n    ]\n    if seconds == 0:\n        return '0 secs'\n    parts = []\n    for unit, div in units:\n        amount, seconds = divmod(int(seconds), div)\n        if amount > 0:\n            parts.append('{} {}{}'.format(\n                amount, unit, '' if amount == 1 else 's'))\n    return ' '.join(parts)\n", "entry_point": "convert_seconds_to_time", "input": "3665", "output": "'1 hour 1 minute 5 seconds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125708_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029331", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2967", "output": "{1, 129, 3, 69, 43, 2967, 23, 989}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2966", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029332", "code": "def concatenate_words(string_list):\n    concatenated_words = []\n    for i in range(len(string_list) - 1):\n        words1 = string_list[i].split()\n        words2 = string_list[i + 1].split()\n        concatenated_word = words1[0] + words2[1]\n        concatenated_words.append(concatenated_word)\n    return concatenated_words\n", "entry_point": "concatenate_words", "input": "['Coding something', 'this is great']", "output": "['Codingis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124678_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029333", "code": "def calculate_absolute_differences_sum(lst):\n    abs_diff_sum = 0\n    for i in range(len(lst) - 1):\n        abs_diff_sum += abs(lst[i] - lst[i + 1])\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_differences_sum", "input": "[0, 12, 36]", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27175_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029334", "code": "MUTATION_COMPLEMENTS = {\n    \"CtoG\": \"GtoC\",\n    \"CtoA\": \"GtoT\",\n    \"AtoT\": \"TtoA\",\n    \"CtoT\": \"GtoA\",\n    \"AtoC\": \"TtoG\",\n    \"AtoG\": \"TtoC\",\n}\ndef get_complement_mutation(mutation_type):\n    if mutation_type in MUTATION_COMPLEMENTS:\n        return MUTATION_COMPLEMENTS[mutation_type]\n    else:\n        return \"Mutation type not found.\"\n", "entry_point": "get_complement_mutation", "input": "'CtoA'", "output": "'GtoT'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147742_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029335", "code": "from typing import Sequence\ndef sum_of_even_numbers(numbers: Sequence[int]) -> int:\n    total = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[60, 40, 20]", "output": "120", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97193_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029336", "code": "def generate_username(first_name: str, last_name: str, existing_usernames: list) -> str:\n    username = (first_name[0] + last_name).lower()\n    unique_username = username\n    counter = 1\n    while unique_username in existing_usernames:\n        unique_username = f\"{username}{counter}\"\n        counter += 1\n    return unique_username\n", "entry_point": "generate_username", "input": "'j', 'dddd', ['jdddd']", "output": "'jdddd1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82643_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029337", "code": "def convert_camel_to_human(name):\n    out = name[0]\n    for char in name[1:]:\n        if char.isupper():\n            out += \" %s\" % char.lower()\n        else:\n            out += char\n    return out\n", "entry_point": "convert_camel_to_human", "input": "'DoJohnDJoSmJohnD'", "output": "'Do john d jo sm john d'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130254_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029338", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6415", "output": "{1, 1283, 5, 6415}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6414", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029339", "code": "def reverse_words_order(input_str):\n    # Split the input string into individual words\n    words = input_str.split()\n    # Reverse the order of the words\n    reversed_words = words[::-1]\n    # Join the reversed words back together with spaces\n    reversed_str = ' '.join(reversed_words)\n    return reversed_str\n", "entry_point": "reverse_words_order", "input": "'hello world'", "output": "'world hello'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17200_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029340", "code": "import re\ndef remove_not_alpha_num(string):\n    return re.sub('[^0-9a-zA-Z]+', '', string)\n", "entry_point": "remove_not_alpha_num", "input": "'!!a00!!'", "output": "'a00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7581_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029341", "code": "import math\ndef construct_rectangle(area):\n    width = int(math.sqrt(area))\n    while area % width != 0:\n        width -= 1\n    return [area // width, width]\n", "entry_point": "construct_rectangle", "input": "12", "output": "[4, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64843_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029342", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "475", "output": "{1, 5, 19, 25, 475, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt474", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029343", "code": "import os\ndef extract_config_sources(default_config_dirs):\n    unique_sources = set()\n    for config_dir in default_config_dirs:\n        abs_path = os.path.expanduser(config_dir)\n        if os.path.isdir(abs_path):\n            files = os.listdir(abs_path)\n            for file in files:\n                source_name = file.split('.')[0]  # Extract source name from file name\n                unique_sources.add(source_name)\n    return list(unique_sources)\n", "entry_point": "extract_config_sources", "input": "['/non/existent/directory', '/another/fake/path']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34542_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029344", "code": "from typing import List\ndef compute_service_descriptor(compute_service_attributes: List[str], base_url: str) -> str:\n    assets_url = '/'.join(compute_service_attributes)\n    computed_service_descriptor = f\"{base_url}/{assets_url}/compute\"\n    return computed_service_descriptor\n", "entry_point": "compute_service_descriptor", "input": "['httphtssets'], 'http://localho'", "output": "'http://localho/httphtssets/compute'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135182_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029345", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'/path/to/jwt_validation_request.py'", "output": "'jwt_validation_request'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029346", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'watermelogrape,manneapple'", "output": "['watermelogrape', 'manneapple']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029347", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8511", "output": "{1, 3, 2837, 8511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029348", "code": "def basic_calculator(expression: str) -> int:\n    result = 0\n    current_number = 0\n    operation = '+'\n    for i, char in enumerate(expression):\n        if char.isdigit():\n            current_number = current_number * 10 + int(char)\n        if not char.isdigit() or i == len(expression) - 1:\n            if operation == '+':\n                result += current_number\n            elif operation == '-':\n                result -= current_number\n            current_number = 0\n            operation = char\n    return result\n", "entry_point": "basic_calculator", "input": "'2-119'", "output": "-117", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14263_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029349", "code": "def extract_package_info(package_config):\n    name = package_config.get('name', '')\n    version = package_config.get('version', '')\n    description = package_config.get('description', '')\n    author = package_config.get('author', '')\n    packages = package_config.get('packages', [])\n    return (name, version, description, author, packages)\n", "entry_point": "extract_package_info", "input": "{}", "output": "('', '', '', '', [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27164_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029350", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2807", "output": "{1, 401, 7, 2807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029351", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    if len(scores) < 3:\n        raise ValueError(\"At least 3 scores are required to calculate the average.\")\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average_score", "input": "[17, 18, 20, 18.8]", "output": "18.4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134450_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029352", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[100, 95, 90, 91, 92, 93, 87], 7", "output": "92.57142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12185_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029353", "code": "import ast\ndef transform_input_to_eval(code):\n    # Parse the code snippet into an Abstract Syntax Tree (AST)\n    tree = ast.parse(code)\n    # Function to recursively traverse the AST and make the required changes\n    def transform_node(node):\n        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == 'input':\n            # Replace input(...) with eval(input(...))\n            node.func = ast.Attribute(value=ast.Name(id='eval', ctx=ast.Load()), attr='input', ctx=ast.Load())\n        for child_node in ast.iter_child_nodes(node):\n            transform_node(child_node)\n    # Apply the transformation to the AST\n    transform_node(tree)\n    # Generate the modified code snippet from the transformed AST\n    modified_code = ast.unparse(tree)\n    return modified_code\n", "entry_point": "transform_input_to_eval", "input": "'aa'", "output": "'aa'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68294_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029354", "code": "from typing import List\ndef remove_poisoned_data(predictions: List[int]) -> List[int]:\n    median = sorted(predictions)[len(predictions) // 2]\n    deviations = [abs(pred - median) for pred in predictions]\n    mad = sorted(deviations)[len(deviations) // 2]\n    threshold = 2 * mad\n    cleaned_predictions = [pred for pred in predictions if abs(pred - median) <= threshold]\n    return cleaned_predictions\n", "entry_point": "remove_poisoned_data", "input": "[12, 12, 12, 12, 10, 10, 11, 11, 50]", "output": "[12, 12, 12, 12, 10, 10, 11, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51414_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029355", "code": "def process_query(query: str, operator: str) -> dict:\n    parts = [x.strip() for x in operator.split(query)]\n    assert len(parts) in (1, 3), \"Invalid query format\"\n    query_key = parts[0]\n    result = {query_key: {}}\n    return result\n", "entry_point": "process_query", "input": "' ', '>>=====>  '", "output": "{'>>=====>': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13586_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029356", "code": "def calculate_element(n: int) -> int:\n    result = 1\n    for i in range(1, n + 1):\n        result *= i\n    return result\n", "entry_point": "calculate_element", "input": "7", "output": "5040", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111277_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2985", "output": "{1, 3, 995, 5, 199, 2985, 15, 597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2843", "output": "{1, 2843}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2842", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029359", "code": "def bar(arr):\n    modified_arr = []\n    for i in range(len(arr)):\n        sum_except_current = sum(arr) - arr[i]\n        modified_arr.append(sum_except_current)\n    return modified_arr\n", "entry_point": "bar", "input": "[1, 2, 3, 4, 5]", "output": "[14, 13, 12, 11, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30502_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029360", "code": "def update_scores(dictionary_of_scores, list_to_return):\n    for player_id, score in dictionary_of_scores.items():\n        if player_id not in list_to_return:\n            list_to_return.append(score)\n    return list_to_return\n", "entry_point": "update_scores", "input": "{1: 1, 2: 1, 3: 3}, []", "output": "[1, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106802_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029361", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5926", "output": "{1, 2, 2963, 5926}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5925", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029362", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'bihil', 95", "output": "[99, 127, 123, 127, 139]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4791", "output": "{1, 3, 1597, 4791}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4790", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029364", "code": "from typing import List\ndef calculate_skyline_area(buildings: List[int]) -> int:\n    total_area = 0\n    for i in range(1, len(buildings) - 1):\n        total_area += min(buildings[i], buildings[i+1])\n    return total_area\n", "entry_point": "calculate_skyline_area", "input": "[-1, -2, -1, -2]", "output": "-4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58935_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029365", "code": "def normalize_text(text):\n    normalized_text = []\n    word = \"\"\n    for char in text:\n        if char.isalnum():\n            word += char\n        elif word:\n            normalized_text.append(word)\n            word = \"\"\n    if word:\n        normalized_text.append(word)\n    return \" \".join(normalized_text).lower()\n", "entry_point": "normalize_text", "input": "'Hello, World!'", "output": "'hello world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35252_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029366", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'1.0.0'", "output": "(1, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84608_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029367", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2969", "output": "{1, 2969}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2968", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029368", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5629", "output": "{1, 13, 433, 5629}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5628", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029369", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6154", "output": "{1, 2, 34, 3077, 6154, 362, 17, 181}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6153", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029370", "code": "def find_max_frequency(lst):\n    max_value = None\n    max_frequency = 0\n    frequency_dict = {}\n    for num in lst:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n        if frequency_dict[num] > max_frequency or (frequency_dict[num] == max_frequency and num > max_value):\n            max_value = num\n            max_frequency = frequency_dict[num]\n    return max_value, max_frequency\n", "entry_point": "find_max_frequency", "input": "[6, 6, 6, 6, 1, 2]", "output": "(6, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65256_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029371", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3419", "output": "{1, 3419, 13, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3418", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029372", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8276", "output": "{1, 2, 4, 4138, 8276, 2069}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8275", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029373", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1275", "output": "{1, 3, 5, 425, 75, 15, 17, 51, 85, 25, 1275, 255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1274", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029374", "code": "def max_difference(lst):\n    min_val = float('inf')\n    max_diff = 0\n    for num in lst:\n        min_val = min(min_val, num)\n        max_diff = max(max_diff, num - min_val)\n    return max_diff\n", "entry_point": "max_difference", "input": "[0, 9]", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61803_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029375", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2417", "output": "{2417, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2416", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029376", "code": "import os\nimport logging\ndef process_file(infilepath: str, outfilepath: str, output_format: str) -> str:\n    filename = os.path.basename(infilepath).split('.')[0]\n    logging.info(\"Reading fileprint... \" + infilepath)\n    output_file = f\"{outfilepath}/{filename}.{output_format}\"\n    return output_file\n", "entry_point": "process_file", "input": "'/patho/inpule.txt', '/patho', 'scssv'", "output": "'/patho/inpule.scssv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139858_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4661", "output": "{1, 59, 4661, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4660", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029378", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7813", "output": "{601, 1, 13, 7813}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7812", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029379", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'whello!'", "output": "['whello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029380", "code": "import re\nfrom typing import Tuple\nBINANCE_SYMBOL_SPLITTER = re.compile(r\"^(\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$\")\ndef parse_trading_pair(trading_pair: str) -> Tuple[str, str]:\n    match = BINANCE_SYMBOL_SPLITTER.match(trading_pair)\n    if match:\n        base_currency = match.group(1)\n        quote_currency = match.group(2)\n        return base_currency, quote_currency\n    else:\n        raise ValueError(\"Invalid trading pair format\")\n", "entry_point": "parse_trading_pair", "input": "'UDSTSBNB'", "output": "('UDSTS', 'BNB')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26367_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029381", "code": "def parse_file_format_definition(definition: str) -> dict:\n    field_definitions = definition.split('\\n')\n    format_dict = {}\n    for field_def in field_definitions:\n        field_name, data_type = field_def.split(':')\n        format_dict[field_name.strip()] = data_type.strip()\n    return format_dict\n", "entry_point": "parse_file_format_definition", "input": "'age: name'", "output": "{'age': 'name'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143153_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029382", "code": "def parse_markdown(markdown_text):\n    html_output = \"\"\n    in_list = False\n    for line in markdown_text.split('\\n'):\n        if line.startswith(\"#\"):\n            header_level = line.count(\"#\")\n            html_output += f\"<h{header_level}>{line.strip('# ').strip()}</h{header_level}>\\n\"\n        elif line.startswith(\"**\") and line.endswith(\"**\"):\n            html_output += f\"<strong>{line.strip('**')}</strong>\\n\"\n        elif line.startswith(\"*\") and line.endswith(\"*\"):\n            html_output += f\"<em>{line.strip('*')}</em>\\n\"\n        elif line.startswith(\"-\"):\n            if not in_list:\n                html_output += \"<ul>\\n\"\n                in_list = True\n            html_output += f\"  <li>{line.strip('- ').strip()}</li>\\n\"\n        else:\n            if in_list:\n                html_output += \"</ul>\\n\"\n                in_list = False\n            html_output += f\"{line}\\n\"\n    if in_list:\n        html_output += \"</ul>\\n\"\n    return html_output\n", "entry_point": "parse_markdown", "input": "'Text*'", "output": "'Text*\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137891_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029383", "code": "def custom_shell_sort(alist):\n    gap = len(alist) // 2\n    while gap > 0:\n        for i in range(gap, len(alist)):\n            val = alist[i]\n            j = i\n            while j >= gap and alist[j - gap] > val:\n                alist[j] = alist[j - gap]\n                j -= gap\n            alist[j] = val\n        gap //= 2\n    return alist\n", "entry_point": "custom_shell_sort", "input": "[25, 63, 25, 13, 26, 24, 25, 63]", "output": "[13, 24, 25, 25, 25, 26, 63, 63]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30491_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029384", "code": "from typing import List\ndef sum_unique_elements(arr: List[int]) -> int:\n    element_count = {}\n    # Count occurrences of each element\n    for num in arr:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_sum = 0\n    # Sum up unique elements\n    for num, count in element_count.items():\n        if count == 1:\n            unique_sum += num\n    return unique_sum\n", "entry_point": "sum_unique_elements", "input": "[7, 6, 2, 2]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39286_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029385", "code": "def ind_cost(guess, actual):\n    return max(abs(guess - actual), (86400 - abs(guess - actual)))\n", "entry_point": "ind_cost", "input": "0, 0", "output": "86400", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40494_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029386", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 42", "output": "'42%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029387", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalnum():\n            char_count[char_lower] = char_count.get(char_lower, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hhh eell33 1 2'", "output": "{'h': 3, 'e': 2, 'l': 2, '3': 2, '1': 1, '2': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64902_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029388", "code": "def move_zeros_to_end(nums):\n    non_zeros = [num for num in nums if num != 0]\n    zeros = [0] * nums.count(0)\n    return non_zeros + zeros\n", "entry_point": "move_zeros_to_end", "input": "[-2, 11, -1, 2, -2, -2, 0, 0, 0]", "output": "[-2, 11, -1, 2, -2, -2, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17259_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029389", "code": "def average_age_by_role(users_data: dict, role: str) -> float:\n    users = users_data.get(\"users\", [])\n    users_with_role = [user for user in users if user.get(\"role\") == role]\n    if not users_with_role:\n        return 0\n    total_age = sum(user.get(\"age\", 0) for user in users_with_role)\n    average_age = total_age / len(users_with_role)\n    return average_age\n", "entry_point": "average_age_by_role", "input": "{'users': []}, 'admin'", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137155_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029390", "code": "def calculate_sum_of_squares(A, B, C):\n    sum_of_squares = A**2 + B**2 + C**2\n    return sum_of_squares\n", "entry_point": "calculate_sum_of_squares", "input": "9, 1, 1", "output": "83", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17827_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029391", "code": "from typing import List\ndef get_longest_word(text: str) -> List[str]:\n    words = text.split()\n    max_length = max(len(word) for word in words)\n    longest_words = [word for word in words if len(word) == max_length]\n    return longest_words\n", "entry_point": "get_longest_word", "input": "'hello world kquick'", "output": "['kquick']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119897_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029392", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6569", "output": "{1, 6569}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6568", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029393", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[3.0, 0.0, 0.0], 'subtract'", "output": "[3.0, 3.0, 3.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt16", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029394", "code": "def filter_words_by_frequency(words: dict, threshold: int) -> list:\n    filtered_words = []\n    for word, frequency in words.items():\n        if frequency > threshold:\n            filtered_words.append(word)\n    return filtered_words\n", "entry_point": "filter_words_by_frequency", "input": "{'word1': 0}, 0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53919_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029395", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "0, 8", "output": "8.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029396", "code": "from typing import List\ndef calculate_top_n_average(scores: List[int], n: int) -> float:\n    score_count = {}\n    for score in scores:\n        score_count[score] = score_count.get(score, 0) + 1\n    unique_scores = sorted(score_count.keys(), reverse=True)\n    top_scores = []\n    count = 0\n    for score in unique_scores:\n        count += score_count[score]\n        top_scores.extend([score] * score_count[score])\n        if count >= n:\n            break\n    return sum(top_scores) / n\n", "entry_point": "calculate_top_n_average", "input": "[-176], 1", "output": "-176.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38084_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029397", "code": "def classify_temperatures(temperatures):\n    classifications = []\n    for temp in temperatures:\n        if temp > 100:\n            classifications.append('Steam')\n        elif temp < 0:\n            classifications.append('Ice')\n        else:\n            classifications.append('Water')\n    return classifications\n", "entry_point": "classify_temperatures", "input": "[50, 101, -10, 10]", "output": "['Water', 'Steam', 'Ice', 'Water']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29517_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029398", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1797", "output": "{1, 3, 1797, 599}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1796", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029399", "code": "import re\ndef expand_template(template, variables):\n    def replace_var(match):\n        var_name = match.group(1)\n        return str(variables.get(var_name, match.group(0)))\n    dbrace_re = re.compile(r'\\{\\{([a-zA-Z_][\\w-]*)\\}\\}')\n    expanded_template = dbrace_re.sub(replace_var, template)\n    return expanded_template\n", "entry_point": "expand_template", "input": "'{{agY{o{}}}', {}", "output": "'{{agY{o{}}}'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45002_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029400", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5879", "output": "{1, 5879}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5878", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029401", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5041", "output": "{1, 5041, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029402", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    total = sum(scores)\n    average = total / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 85, 90, 87, 90, 87, 84]", "output": "86.14285714285714", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45427_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029403", "code": "def even_odd_sort(input_list):\n    even_numbers = []\n    odd_numbers = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_numbers.append(num)\n        else:\n            odd_numbers.append(num)\n    even_numbers.sort()\n    odd_numbers.sort()\n    return (even_numbers, odd_numbers)\n", "entry_point": "even_odd_sort", "input": "[2, 4, 6, 3, 6, 10, 10, 3]", "output": "([2, 4, 6, 6, 10, 10], [3, 3])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98797_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029404", "code": "from typing import List, Dict\ndef square_mapping(input_list: List[int]) -> Dict[int, int]:\n    mapping = {}\n    for num in input_list:\n        mapping[num] = num ** 2\n    return mapping\n", "entry_point": "square_mapping", "input": "[4, 1, 0, 3, 2]", "output": "{4: 16, 1: 1, 0: 0, 3: 9, 2: 4}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137398_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029405", "code": "def count_unique_words(input_string):\n    input_string = input_string.lower()\n    words = input_string.split()\n    word_count = {}\n    for word in words:\n        if word in word_count:\n            word_count[word] += 1\n        else:\n            word_count[word] = 1\n    return word_count\n", "entry_point": "count_unique_words", "input": "'zlazy'", "output": "{'zlazy': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104136_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029406", "code": "from typing import List, Tuple\ndef card_game(deck: List[int]) -> Tuple[int, int]:\n    score_player1 = 0\n    score_player2 = 0\n    for i in range(0, len(deck), 2):\n        if deck[i] > deck[i + 1]:\n            score_player1 += 1\n        else:\n            score_player2 += 1\n    return score_player1, score_player2\n", "entry_point": "card_game", "input": "[1, 2, 2, 3, 3, 4, 4, 5]", "output": "(0, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_218_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029407", "code": "def max_score_with_constraint(scores, K):\n    n = len(scores)\n    dp = [-1] * (n + 1)\n    dp[0] = 0\n    for i in range(1, n + 1):\n        for j in range(i):\n            if dp[j] != -1 and abs(scores[i - 1] - scores[j]) > K:\n                dp[i] = max(dp[i], dp[j] + scores[i - 1])\n    return max(dp)\n", "entry_point": "max_score_with_constraint", "input": "[5, 25, 38], 10", "output": "38", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22565_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029408", "code": "def calculate_avg_gpu_memory_usage(memory_values):\n    total_memory = 0\n    num_valid_values = 0\n    for value in memory_values:\n        if value >= 0:\n            total_memory += value\n            num_valid_values += 1\n    if num_valid_values == 0:\n        return 0\n    avg_memory_usage = total_memory / num_valid_values\n    return avg_memory_usage\n", "entry_point": "calculate_avg_gpu_memory_usage", "input": "[80, 85, 100, 92]", "output": "89.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116446_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6083", "output": "{1, 6083, 869, 7, 553, 11, 77, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6082", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029410", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[1, 5, 2, 3]", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029411", "code": "def parse_configuration(config):\n    settings = {}\n    for line in config.split('\\n'):\n        if line.strip():  # Skip empty lines\n            name, value = line.split('=')\n            settings[name.strip()] = value.strip()\n    return settings\n", "entry_point": "parse_configuration", "input": "'= TTeTrue'", "output": "{'': 'TTeTrue'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82974_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029412", "code": "def get_available_participants(chat_id: int, participants: dict) -> list:\n    available_participants = [participant_id for participant_id, is_available in participants.items() if is_available]\n    return available_participants\n", "entry_point": "get_available_participants", "input": "0, {-1: True}", "output": "[-1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39443_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029413", "code": "# Define the roles and their whitelisted attributes\nroles = {\n    'contract_create_role': ['title', 'description', 'status'],\n    'contract_edit_role': ['title', 'description', 'status', 'period', 'items', 'terminationDetails'],\n    'view_value_role_esco': ['amount_escp']\n}\ndef filter_attributes(role, attributes):\n    if role in roles:\n        return [attr for attr in attributes if attr in roles[role]]\n    else:\n        return []\n", "entry_point": "filter_attributes", "input": "'non_existent_role', ['some_attribute']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66491_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029414", "code": "def custom_unescape_str_to_bytes(input_str):\n    result = bytearray()\n    i = 0\n    while i < len(input_str):\n        if input_str[i] == '\\\\':\n            i += 1\n            if input_str[i] == 'n':\n                result.append(10)  # newline\n            elif input_str[i] == 't':\n                result.append(9)  # tab\n            elif input_str[i] == 'r':\n                result.append(13)  # carriage return\n            elif input_str[i] == 'x':\n                result.append(int(input_str[i+1:i+3], 16))  # hexadecimal value\n                i += 2\n            else:\n                result.append(ord(input_str[i]))  # handle other escape sequences\n        else:\n            result.append(ord(input_str[i]))\n        i += 1\n    return bytes(result)\n", "entry_point": "custom_unescape_str_to_bytes", "input": "'Hello\\\\r'", "output": "b'Hello\\r'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35631_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029415", "code": "try:\n    import ujson as json_lib\nexcept ImportError:\n    import json as json_lib\ndef process_json_data(data: dict) -> dict:\n    try:\n        json_data = json_lib.loads(json_lib.dumps(data))\n        return json_data\n    except Exception as e:\n        print(f\"Error processing JSON data: {e}\")\n        return {}\n", "entry_point": "process_json_data", "input": "{1, 2, 3}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77413_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029416", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9447", "output": "{1, 3, 67, 9447, 201, 3149, 141, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9446", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029417", "code": "import os\ndef generate_migration_name(MIGRATION_INDEX, current_script_file):\n    base_name = os.path.splitext(os.path.basename(current_script_file))[0]\n    migration_name = f\"{MIGRATION_INDEX}_{base_name}\"\n    return migration_name\n", "entry_point": "generate_migration_name", "input": "75, 'add_columns_to_instruments.py'", "output": "'75_add_columns_to_instruments'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029418", "code": "def sum_positive_integers(nums):\n    sum_positive = 0\n    for num in nums:\n        if num > 0:\n            sum_positive += num\n    return sum_positive\n", "entry_point": "sum_positive_integers", "input": "[2]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105369_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029419", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'gMMgMMggMMg'", "output": "'gMMgMMggMMg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029420", "code": "def generate_string_by_multiplying_index(n):\n    result = \"\"\n    for i in range(n):\n        result += str(i * 2)\n    return result\n", "entry_point": "generate_string_by_multiplying_index", "input": "0", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55076_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9110", "output": "{1, 2, 5, 10, 4555, 911, 9110, 1822}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9109", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029422", "code": "def process_list(input_list):\n    processed_list = []\n    for i in range(len(input_list) - 1):\n        processed_list.append(input_list[i] + input_list[i + 1])\n    processed_list.append(input_list[-1] + input_list[0])\n    return processed_list\n", "entry_point": "process_list", "input": "[2, 4, 3, 4, 4, 3, 2]", "output": "[6, 7, 7, 8, 7, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44220_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029423", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9258", "output": "{1, 2, 3, 6, 1543, 9258, 3086, 4629}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9257", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029424", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hhloel'", "output": "['hhloel']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3479", "output": "{1, 7, 71, 49, 497, 3479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029426", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7870", "output": "{1, 2, 5, 1574, 10, 787, 7870, 3935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7869", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029427", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "9", "output": "'31131211131221'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029428", "code": "def extract_info(version_str, description_str):\n    version_numbers = version_str.split('.')\n    major = int(version_numbers[0])\n    minor = int(version_numbers[1])\n    patch = int(version_numbers[2])\n    description = description_str.strip(\"'\")\n    return major, minor, patch, description\n", "entry_point": "extract_info", "input": "'1.31.3', \"'yKey'\"", "output": "(1, 31, 3, 'yKey')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39023_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029429", "code": "def convert_aot_to_dialog2010(aot_tag):\n    if aot_tag.startswith('S'):\n        return 'N' + aot_tag[1:]\n    elif aot_tag.startswith('V'):\n        return 'V' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('A'):\n        return 'A' + aot_tag.split('=')[0][1:]\n    elif aot_tag.startswith('ADV'):\n        return 'ADV' + aot_tag[3:]\n    elif aot_tag.startswith('PR'):\n        return 'PR' + aot_tag[2:]\n    elif aot_tag.startswith('CONJ'):\n        return 'CONJ' + aot_tag[4:]\n    elif aot_tag.startswith('PART'):\n        return 'PART' + aot_tag[4:]\n    elif aot_tag.startswith('NUM'):\n        return 'NUM' + aot_tag[3:]\n    elif aot_tag.startswith('INTJ'):\n        return 'INTJ' + aot_tag[4:]\n    else:\n        return 'UNKNOWN'\n", "entry_point": "convert_aot_to_dialog2010", "input": "'S'", "output": "'N'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133604_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029430", "code": "def convert_to_indices(input_string):\n    alphabet = \"abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\\\"/\\\\|_@#$%^&*~`+-=<>()[]{} \"\n    dictionary = {char: idx for idx, char in enumerate(alphabet, start=1)}\n    indices_list = [dictionary[char] for char in input_string if char in dictionary]\n    return indices_list\n", "entry_point": "convert_to_indices", "input": "'hohelo'", "output": "[8, 15, 8, 5, 12, 15]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126715_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029431", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2885", "output": "{577, 1, 5, 2885}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2884", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029432", "code": "from typing import List\ndef remaining_people(line: List[int]) -> int:\n    shortest_height = float('inf')\n    shortest_index = 0\n    for i, height in enumerate(line):\n        if height < shortest_height:\n            shortest_height = height\n            shortest_index = i\n    return len(line[shortest_index:])\n", "entry_point": "remaining_people", "input": "[10]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74868_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029433", "code": "def simulate_war_game(deck1, deck2):\n    table = []  # Cards on the table during a \"war\" round\n    while deck1 and deck2:  # Continue the game while both players have cards\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        table.extend([card1, card2])  # Place the revealed cards on the table\n        if card1 > card2:\n            deck1.extend(table)  # Player 1 wins the round\n            table.clear()\n        elif card2 > card1:\n            deck2.extend(table)  # Player 2 wins the round\n            table.clear()\n        else:  # \"War\" condition\n            if len(deck1) < 4 or len(deck2) < 4:\n                return 0 if len(deck2) < 4 else 1  # One player doesn't have enough cards for a \"war\"\n            table.extend(deck1[:3] + deck2[:3])  # Place additional cards face down\n            del deck1[:3]\n            del deck2[:3]\n    return 0 if deck2 else 1  # Return the index of the winning player\n", "entry_point": "simulate_war_game", "input": "[5, 4, 3, 2, 1], [1]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67979_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "872", "output": "{1, 2, 4, 872, 8, 109, 436, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt871", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029435", "code": "from typing import List\ndef count_state_occurrences(states: List[int], target_state: int) -> int:\n    count = 0\n    for state in states:\n        if state == target_state:\n            count += 1\n    return count\n", "entry_point": "count_state_occurrences", "input": "[1, 1, 1, 1, 2, 3], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145747_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029436", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'acrch6h4'", "output": "'acrch6h4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029437", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8014", "output": "{1, 2, 8014, 4007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8013", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029438", "code": "from typing import Union\nNode = Union[int, float, str, dict, list]\ndef pluck(node: Node, path: str) -> Node:\n    def get_value(curr_node, curr_path):\n        if not curr_path:\n            return curr_node\n        key, *remain = curr_path.split('.')\n        if isinstance(curr_node, dict):\n            return get_value(curr_node.get(key), '.'.join(remain))\n        elif isinstance(curr_node, list):\n            try:\n                index = int(key)\n                return get_value(curr_node[index], '.'.join(remain))\n            except (IndexError, ValueError):\n                return node\n        else:\n            return node\n    return get_value(node, path)\n", "entry_point": "pluck", "input": "{}, 'some.non.existing.path'", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114089_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029439", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[4, 5, 4]", "output": "[4, 5, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029440", "code": "POSTGRES_COLUMN_NAME_LIMIT = 63\ndef _verified_column_name(column_name, limit=POSTGRES_COLUMN_NAME_LIMIT):\n    if len(column_name) > limit:\n        raise Exception('Column name {} is too long. Postgres limit is {}.'.format(column_name, limit))\n    return column_name\n", "entry_point": "_verified_column_name", "input": "'naamveng_column_name_that_exceedst'", "output": "'naamveng_column_name_that_exceedst'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100546_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029441", "code": "import math\ndef calculate_sin(x):\n    \"\"\"\n    Calculate the sine of the input angle x in radians.\n    Args:\n    x (float): Angle in radians\n    Returns:\n    float: Sine of the input angle x\n    \"\"\"\n    return math.sin(x)\n", "entry_point": "calculate_sin", "input": "-math.pi / 2", "output": "-1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88101_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029442", "code": "def sum_of_squares(nums: list[int]) -> int:\n    \"\"\"\n    Calculate the sum of squares of integers in the input list.\n    Args:\n    nums: A list of integers.\n    Returns:\n    The sum of the squares of the integers in the input list.\n    \"\"\"\n    return sum(num**2 for num in nums)\n", "entry_point": "sum_of_squares", "input": "[4, 1]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57390_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029443", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[6, 6, 7, 7, 10, 10, 9, 5, 5]", "output": "[6, 7, 10, 9, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029444", "code": "from typing import List\ndef total_breakdowns(broke_on: List[int], n: int) -> int:\n    total = 0\n    for i in range(1, n+1):\n        total += broke_on[i]\n    return total\n", "entry_point": "total_breakdowns", "input": "[0, 1, 1], 2", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12136_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029445", "code": "from typing import List\ndef top_k_scores(scores: List[int], k: int) -> List[int]:\n    score_freq = {}\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    sorted_scores = sorted(score_freq.keys(), reverse=True)\n    result = []\n    unique_count = 0\n    for score in sorted_scores:\n        if unique_count == k:\n            break\n        result.append(score)\n        unique_count += 1\n    return result\n", "entry_point": "top_k_scores", "input": "[93, 93, 92, 85, 83, 83, 80], 4", "output": "[93, 92, 85, 83]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108959_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029446", "code": "def find_middle(s):\n    length = len(s)\n    if length % 2 == 0:  # Even length\n        return s[length // 2 - 1:length // 2 + 1]\n    else:  # Odd length\n        return s[length // 2]\n", "entry_point": "find_middle", "input": "'e'", "output": "'e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48259_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029447", "code": "def custom_division(a, b):\n    b = float(b)\n    if b == 0:\n        c = 0\n        print('Cannot divide by 0.')\n        return c\n    else:\n        a = float(a)\n        c = round(a / b, 9)\n        return c\n", "entry_point": "custom_division", "input": "7.0, 3", "output": "2.333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24537_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029448", "code": "def find_median(scores):\n    sorted_scores = sorted(scores)\n    n = len(sorted_scores)\n    if n % 2 == 0:\n        mid1 = sorted_scores[n // 2 - 1]\n        mid2 = sorted_scores[n // 2]\n        return (mid1 + mid2) / 2\n    else:\n        return sorted_scores[n // 2]\n", "entry_point": "find_median", "input": "[80, 85, 87, 90, 95]", "output": "87", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23420_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029449", "code": "def reverse_and_capitalize_words(input_string):\n    words = input_string.split()\n    reversed_words = [word.capitalize() for word in reversed(words)]\n    return ' '.join(reversed_words)\n", "entry_point": "reverse_and_capitalize_words", "input": "'helh'", "output": "'Helh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35931_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029450", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[50, 81, 81, 69, 60, 45, 39]", "output": "[81, 69, 60]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029451", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6727", "output": "{1, 961, 7, 6727, 217, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6726", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029452", "code": "import json\ndef process_event_data(event_json):\n    event_id = event_json.get('event_id')\n    timestamp = event_json.get('timestamp')\n    indicators = event_json.get('indicators', [])\n    indicator_count = len(indicators)\n    event_data = {event_id: (timestamp, indicator_count)}\n    return event_data\n", "entry_point": "process_event_data", "input": "{}", "output": "{None: (None, 0)}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58949_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029453", "code": "def linear_regression(signal):\n    x_mean = sum(range(len(signal))) / len(signal)\n    y_mean = sum(signal) / len(signal)\n    numerator = sum((i - x_mean) * (signal[i] - y_mean) for i in range(len(signal)))\n    denominator = sum((i - x_mean)**2 for i in range(len(signal)))\n    slope = numerator / denominator\n    intercept = y_mean - slope * x_mean\n    return slope, intercept\n", "entry_point": "linear_regression", "input": "[1.0, 3.0, 5.0, 7.0]", "output": "(2.0, 1.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103845_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029454", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "79", "output": "{1, 79}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt78", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029455", "code": "def extract_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'10.20.300'", "output": "(10, 20, 300)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141507_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029456", "code": "def sum_of_fibonacci_numbers(N: int) -> int:\n    if N <= 0:\n        return 0\n    elif N == 1:\n        return 0\n    fib_sum = 1\n    fib_prev, fib_curr = 0, 1\n    for _ in range(2, N):\n        fib_next = fib_prev + fib_curr\n        fib_sum += fib_next\n        fib_prev, fib_curr = fib_curr, fib_next\n    return fib_sum\n", "entry_point": "sum_of_fibonacci_numbers", "input": "7", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40912_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029457", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5807", "output": "{1, 5807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5806", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029458", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'a'", "output": "['a']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029459", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "991", "output": "{1, 991}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt990", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029460", "code": "def remove_duplicates(input_string):\n    if not input_string:\n        return \"\"\n    result = input_string[0]  # Initialize result with the first character\n    for i in range(1, len(input_string)):\n        if input_string[i] != input_string[i - 1]:\n            result += input_string[i]\n    return result\n", "entry_point": "remove_duplicates", "input": "'eheehe'", "output": "'ehehe'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5338_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029461", "code": "def find_special_number(n: int) -> int:\n    prod = 1\n    sum_ = 0\n    while n > 0:\n        last_digit = n % 10\n        prod *= last_digit\n        sum_ += last_digit\n        n //= 10\n    return prod - sum_\n", "entry_point": "find_special_number", "input": "10", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121266_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029462", "code": "import itertools\nimport string\ndef all_possible_word_cases(word):\n    letters = string.ascii_lowercase + string.ascii_uppercase\n    variations = []\n    for combo in itertools.product(*([letter.lower(), letter.upper()] for letter in word)):\n        variations.append(\"\".join(combo))\n    return variations\n", "entry_point": "all_possible_word_cases", "input": "'o'", "output": "['o', 'O']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125039_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029463", "code": "def convert_risk_to_chinese(risk):\n    risk_mapping = {\n        'None': 'None',\n        'Low': '\u4f4e\u5371',\n        'Medium': '\u4e2d\u5371',\n        'High': '\u9ad8\u5371',\n        'Critical': '\u4e25\u91cd'\n    }\n    return risk_mapping.get(risk, 'Unknown')  # Return the Chinese risk level or 'Unknown' if not found\n", "entry_point": "convert_risk_to_chinese", "input": "'Low'", "output": "'\u4f4e\u5371'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46692_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029464", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'125/6890'", "output": "('125', '6890')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029465", "code": "def process_schemas_titles(types_dict):\n    processed_dict = {\n        type_name: type_title\n        for type_name, type_title in types_dict.items()\n        if 'title' in type_title\n    }\n    processed_dict['@type'] = ['JSONSchemas']\n    return processed_dict\n", "entry_point": "process_schemas_titles", "input": "{}", "output": "{'@type': ['JSONSchemas']}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77262_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029466", "code": "def get_pretty_codec_name(codec):\n    codec_mapping = {\n        'h264': 'H.264 (AVC)',\n        'hevc': 'H.265 (HEVC)'\n    }\n    return codec_mapping.get(codec, codec)\n", "entry_point": "get_pretty_codec_name", "input": "'hhevcehv'", "output": "'hhevcehv'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65764_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029467", "code": "def calculate_total_variance(var_bias, var_weight):\n    # Assuming a simple CNN model with one convolutional layer\n    num_bias_params = 1  # Assuming one bias parameter\n    num_weight_params = 9  # Assuming a 3x3 kernel with 1 input channel and 1 output channel\n    total_variance = var_bias * num_bias_params + var_weight * num_weight_params\n    return total_variance\n", "entry_point": "calculate_total_variance", "input": "2.45039399999999, 12.5", "output": "114.95039399999999", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10759_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029468", "code": "def simulate_rabbit_population(generations):\n    if generations <= 0:\n        return 0\n    mature_rabbits = 0\n    newborn_rabbits = 1\n    for _ in range(generations):\n        total_rabbits = mature_rabbits + newborn_rabbits\n        mature_rabbits, newborn_rabbits = total_rabbits, mature_rabbits\n    return total_rabbits\n", "entry_point": "simulate_rabbit_population", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74044_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029469", "code": "def calculate_bmi_and_health_risk(weight, height):\n    bmi = weight / (height ** 2)\n    if bmi < 18.5:\n        health_risk = 'Underweight'\n    elif 18.5 <= bmi < 25:\n        health_risk = 'Normal weight'\n    elif 25 <= bmi < 30:\n        health_risk = 'Overweight'\n    elif 30 <= bmi < 35:\n        health_risk = 'Moderately obese'\n    elif 35 <= bmi < 40:\n        health_risk = 'Severely obese'\n    else:\n        health_risk = 'Very severely obese'\n    return bmi, health_risk\n", "entry_point": "calculate_bmi_and_health_risk", "input": "5.698228131710036, 1.0", "output": "(5.698228131710036, 'Underweight')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86783_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029470", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2827", "output": "{11, 1, 2827, 257}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2826", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029471", "code": "def cumulative_sum_until_negative(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        if num < 0:\n            break\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum_until_negative", "input": "[1, 2, 2, -1]", "output": "[1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44133_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029472", "code": "def calculate_total_elements(dim_xtrain, dim_xtest):\n    total_elements = dim_xtrain + dim_xtest\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "70, 73", "output": "143", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15327_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029473", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[5, 0, 0, 2, 3, 0]", "output": "[5, 0, 2, 5, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128301_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029474", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'12:00:00 AM'", "output": "'00:00:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029475", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[2, 5, 9, 1, 3, 2, 2]", "output": "[2, 6, 11, 4, 7, 7, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029476", "code": "import time\ndef calculate_server_uptime(start_time: float, stop_time: float) -> float:\n    return stop_time - start_time\n", "entry_point": "calculate_server_uptime", "input": "0.0, -342811685.56102467", "output": "-342811685.56102467", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76955_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029477", "code": "def climb_stairs(n):\n    if n == 1:\n        return 1\n    if n == 2:\n        return 2\n    dp = [-1 for _ in range(n+1)]\n    dp[0] = 0\n    dp[1] = 1\n    dp[2] = 2\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2]\n    return dp[n]\n", "entry_point": "climb_stairs", "input": "7", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143500_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029478", "code": "def average_excluding_ends(nums):\n    if len(nums) < 3:\n        return 0\n    sum_excluding_ends = sum(nums[1:-1])\n    average = sum_excluding_ends / (len(nums) - 2)\n    return average\n", "entry_point": "average_excluding_ends", "input": "[1, 3, 4, 1]", "output": "3.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119787_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029479", "code": "def calculate_avg_restarts(restarts):\n    if not restarts:\n        return 0\n    total_restarts = sum(restarts)\n    avg_restarts = total_restarts / len(restarts)\n    return avg_restarts\n", "entry_point": "calculate_avg_restarts", "input": "[2, 2, 2, 2, 3]", "output": "2.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28064_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029480", "code": "from typing import List\ndef sum_nested_list(arr: List) -> int:\n    total = 0\n    for element in arr:\n        if isinstance(element, int):\n            total += element\n        elif isinstance(element, list):\n            total += sum_nested_list(element)\n    return total\n", "entry_point": "sum_nested_list", "input": "[[10], [11]]", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34524_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029481", "code": "def generate_filter_pairs(filters):\n    filter_pairs = []\n    for i in range(len(filters)):\n        for j in range(i+1, len(filters)):\n            filter_pairs.append((filters[i], filters[j]))\n    return filter_pairs\n", "entry_point": "generate_filter_pairs", "input": "['u', 'g', 'r']", "output": "[('u', 'g'), ('u', 'r'), ('g', 'r')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46274_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029482", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4353", "output": "{1, 3, 1451, 4353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4352", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029483", "code": "from typing import List, Tuple\ndef total_area(rectangles: List[Tuple[int, int, int, int]]) -> int:\n    points = set()\n    total_area = 0\n    for rect in rectangles:\n        for x in range(rect[0], rect[2]):\n            for y in range(rect[1], rect[3]):\n                if (x, y) not in points:\n                    points.add((x, y))\n                    total_area += 1\n    return total_area\n", "entry_point": "total_area", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139460_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029484", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "367", "output": "{1, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029485", "code": "def parse_arguments(args):\n    language_id = None\n    codes = {}\n    if len(args) < 2:\n        return None, {}\n    language_id = args[0]\n    for arg in args[1:]:\n        key_value = arg.split('=')\n        if len(key_value) == 2:\n            key, value = key_value\n            codes[key] = value\n    return language_id, codes\n", "entry_point": "parse_arguments", "input": "['112', 'other=English']", "output": "('112', {'other': 'English'})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146515_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029486", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2612", "output": "{1, 2, 4, 653, 2612, 1306}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2611", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029487", "code": "def generate_output_filename(name: str) -> str:\n    # Extract the name part by removing the \".json\" extension\n    name_part = name.replace('.json', '')\n    # Append \"_filtered.txt\" to the extracted name\n    output_name = name_part + \"_filtered.txt\"\n    return output_name\n", "entry_point": "generate_output_filename", "input": "'exammle.on.json'", "output": "'exammle.on_filtered.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4148_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029488", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[0, 0]", "output": "[0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt53", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029489", "code": "from typing import Tuple\ndef extract_semantic_version(version: str) -> Tuple[int, int, int]:\n    major, minor, patch = map(int, version.split('.'))\n    return major, minor, patch\n", "entry_point": "extract_semantic_version", "input": "'3.0.10'", "output": "(3, 0, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142766_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029490", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6479", "output": "{1, 11, 589, 6479, 209, 19, 341, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6478", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029491", "code": "def convert_version_to_string(version: tuple) -> str:\n    version_str = '.'.join(str(v) for v in version)\n    return version_str\n", "entry_point": "convert_version_to_string", "input": "(1, 4, 11, 10, 12, 9, 11, 3)", "output": "'1.4.11.10.12.9.11.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54215_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029492", "code": "import re\ndef count_unique_words(text):\n    word_freq = {}\n    text = text.lower()\n    words = re.findall(r'\\b\\w+\\b', text)\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    unique_words_freq = {k: v for k, v in sorted(word_freq.items())}\n    return unique_words_freq\n", "entry_point": "count_unique_words", "input": "'iis'", "output": "{'iis': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101466_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029493", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'john.doe@example.com'", "output": "'john.doe@example.com'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029494", "code": "def days_in_month(year, month):\n    if month == 2:\n        if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0):\n            return 29  # February in a leap year\n        else:\n            return 28  # February in a non-leap year\n    elif month in [4, 6, 9, 11]:\n        return 30\n    else:\n        return 31\n", "entry_point": "days_in_month", "input": "2021, 2", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41653_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029495", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'ovetr', 5", "output": "['ovetr']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029496", "code": "from typing import List\ndef longest_even_subarray(arr: List[int]) -> List[int]:\n    start = end = max_start = max_end = -1\n    max_length = 0\n    for i, num in enumerate(arr):\n        if (num % 2 == 0):\n            if start == -1:\n                start = i\n            end = i\n            if end - start + 1 > max_length:\n                max_start = start\n                max_end = end\n                max_length = end - start + 1\n        else:\n            start = -1\n    return arr[max_start:max_end+1]\n", "entry_point": "longest_even_subarray", "input": "[1, 3, 2, 0, 0, 8, 5, 7]", "output": "[2, 0, 0, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145995_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029497", "code": "from typing import List, Tuple\ndef process_transactions(transactions: List[int]) -> Tuple[int, bool]:\n    balance = 0\n    destroy_contract = False\n    for transaction in transactions:\n        balance += transaction\n        if balance < 0:\n            destroy_contract = True\n            break\n    return balance, destroy_contract\n", "entry_point": "process_transactions", "input": "[10, 15, -20, -30]", "output": "(-25, True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9357_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029498", "code": "def simulate_water_flow(containers):\n    n = len(containers)\n    result = [0] * n\n    for i in range(n):\n        capacity = min(i, containers[i])\n        result[i] = capacity\n        if i < n - 1:\n            overflow = max(0, containers[i] - capacity)\n            result[i + 1] += overflow\n    return result\n", "entry_point": "simulate_water_flow", "input": "[0, 0, 2, 3, 1, 1, 0, 3, 0]", "output": "[0, 0, 2, 3, 1, 1, 0, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78476_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3092", "output": "{1, 2, 4, 773, 1546, 3092}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3091", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029500", "code": "from datetime import datetime\ndef find_earliest_date(dates):\n    earliest_date = datetime.max\n    for date_str in dates:\n        date = datetime.strptime(date_str, \"%Y-%m-%d\")\n        if date < earliest_date:\n            earliest_date = date\n    return earliest_date.strftime(\"%Y-%m-%d\")\n", "entry_point": "find_earliest_date", "input": "['2025-01-01', '2024-01-01']", "output": "'2024-01-01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55665_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029501", "code": "def count_non_whitespace_chars(input_string):\n    count = 0\n    for char in input_string:\n        if not char.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'Hello! W'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117092_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6023", "output": "{1, 19, 317, 6023}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6022", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029503", "code": "def sum_unique(*args):\n    unique_integers = set()\n    for num in args:\n        unique_integers.add(num)\n    return sum(unique_integers)\n", "entry_point": "sum_unique", "input": "100, 110, 120, 7", "output": "337", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115003_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029504", "code": "def calculate_moving_average(nums, k):\n    moving_averages = []\n    for i in range(len(nums) - k + 1):\n        window_sum = sum(nums[i:i+k])\n        moving_averages.append(window_sum / k)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[2.0, 3.0, 5.0], 3", "output": "[3.3333333333333335]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143205_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029505", "code": "def censor_email(email):\n    if email == \"<EMAIL>\":\n        return \"<CENSORED>\"\n    return email\n", "entry_point": "censor_email", "input": "'>'", "output": "'>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116051_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029506", "code": "def generate_election_status(voter_name: str, election_name: str) -> str:\n    return f\"Sample Election: {voter_name}\"\n", "entry_point": "generate_election_status", "input": "'AiAlice', 'DummyElection'", "output": "'Sample Election: AiAlice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17782_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029507", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1095", "output": "{1, 3, 5, 1095, 73, 365, 15, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1094", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029508", "code": "def calculate_input_dim(env_name, ob_space):\n    def observation_size(space):\n        return len(space)\n    def goal_size(space):\n        return 0  # Assuming goal information size is 0\n    def box_size(space):\n        return 0  # Assuming box size is 0\n    def robot_state_size(space):\n        return len(space)\n    if env_name == 'PusherObstacle-v0':\n        input_dim = observation_size(ob_space) - goal_size(ob_space) - box_size(ob_space)\n    elif 'Sawyer' in env_name:\n        input_dim = robot_state_size(ob_space)\n    else:\n        raise NotImplementedError(\"Input dimension calculation not implemented for this environment\")\n    return input_dim\n", "entry_point": "calculate_input_dim", "input": "'PusherObstacle-v0', [1, 2, 3]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88440_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029509", "code": "from typing import List\ndef min_items_to_buy(prices: List[int], budget: float) -> int:\n    prices.sort()  # Sort prices in ascending order\n    items_count = 0\n    for price in prices:\n        budget -= price\n        items_count += 1\n        if budget <= 0:\n            break\n    return items_count\n", "entry_point": "min_items_to_buy", "input": "[10, 10, 10, 10, 10, 10], 60.0", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139036_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029510", "code": "def find_middle_point(i, j, size):\n    row_i, col_i = i // size, i % size\n    row_j, col_j = j // size, j % size\n    mid_row = (row_i + row_j) // 2\n    mid_col = (col_i + col_j) // 2\n    return mid_row * size + mid_col\n", "entry_point": "find_middle_point", "input": "1, 1, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116034_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029511", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9255", "output": "{1, 3, 5, 9255, 617, 3085, 15, 1851}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9254", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029512", "code": "from typing import List\ndef longest_contiguous_subarray_above_threshold(temperatures: List[int], threshold: float) -> List[int]:\n    start = 0\n    end = 0\n    max_length = 0\n    max_start = 0\n    current_sum = 0\n    while end < len(temperatures):\n        current_sum += temperatures[end]\n        if end - start > 0:\n            average = current_sum / (end - start + 1)\n            if average < threshold:\n                current_sum -= temperatures[start]\n                start += 1\n        if end - start + 1 > max_length:\n            max_length = end - start + 1\n            max_start = start\n        end += 1\n    return temperatures[max_start:max_start + max_length]\n", "entry_point": "longest_contiguous_subarray_above_threshold", "input": "[50, 60, 70, 80, 80, 55], 75", "output": "[70, 80, 80]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3642_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029513", "code": "def calculate_average_height(student_heights):\n    total = sum(student_heights)\n    length = len(student_heights)\n    average_height = round(total / length)\n    return average_height\n", "entry_point": "calculate_average_height", "input": "[165, 168, 171]", "output": "168", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64279_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029514", "code": "def frequencies_map_with_map_from(lst):\n    from collections import Counter\n    return dict(map(lambda x: (x, lst.count(x)), set(lst)))\n", "entry_point": "frequencies_map_with_map_from", "input": "['d', 'd', 'd', 'a', 'c', 'c', 'c']", "output": "{'d': 3, 'c': 3, 'a': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49570_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029515", "code": "def calculate_sums(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "calculate_sums", "input": "[3, 2, 3, 10, 4, 10, 5, 4, 2]", "output": "[5, 5, 13, 14, 14, 15, 9, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137992_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1607", "output": "{1, 1607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1606", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029517", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'0.99.0'", "output": "'0.98.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029518", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 95, 92, 90, 88]", "output": "[95, 95, 92]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029519", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "911", "output": "{1, 911}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt910", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029520", "code": "def append_path_segment(base_url: str, path_segment: str) -> str:\n    if base_url.endswith(\"/\"):\n        return base_url + path_segment\n    else:\n        return base_url + \"/\" + path_segment\n", "entry_point": "append_path_segment", "input": "'https:hth', '1/de'", "output": "'https:hth/1/de'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71422_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9053", "output": "{1, 11, 9053, 823}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029522", "code": "def calculate_average_without_outliers(numbers, threshold):\n    median = sorted(numbers)[len(numbers) // 2] if len(numbers) % 2 != 0 else sum(sorted(numbers)[len(numbers) // 2 - 1:len(numbers) // 2 + 1]) / 2\n    outliers = [num for num in numbers if abs(num - median) > threshold]\n    filtered_numbers = [num for num in numbers if num not in outliers]\n    if len(filtered_numbers) == 0:\n        return 0  # Return 0 if all numbers are outliers\n    return sum(filtered_numbers) / len(filtered_numbers)\n", "entry_point": "calculate_average_without_outliers", "input": "[99.5, 99.9, 100.0], 0.5", "output": "99.8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15753_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029523", "code": "def parse_file_format_definition(definition: str) -> dict:\n    field_definitions = definition.split('\\n')\n    format_dict = {}\n    for field_def in field_definitions:\n        field_name, data_type = field_def.split(':')\n        format_dict[field_name.strip()] = data_type.strip()\n    return format_dict\n", "entry_point": "parse_file_format_definition", "input": "'height: '", "output": "{'height': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143153_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029524", "code": "def simulate_card_game(deck):\n    drawn_cards = []\n    remaining_deck = deck.copy()\n    while remaining_deck:\n        drawn_card = remaining_deck.pop(0)\n        drawn_cards.append(drawn_card)\n        if drawn_card % 2 == 0 and remaining_deck:\n            remaining_deck.pop(0)\n        elif remaining_deck:\n            remaining_deck.append(remaining_deck.pop(0))\n    return drawn_cards\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3, 4, 5, 6]", "output": "[1, 3, 5, 2, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62093_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029525", "code": "def generate_binary_string(n):\n    l = [''] * (n + 1)\n    size = 1\n    m = 1\n    while size <= n:\n        i = 0\n        while i < m and (size + i) <= n:\n            l[size + i] = \"1\" + l[size - m + i]\n            i += 1\n        i = 0\n        while i < m and (size + m + i) <= n:\n            l[size + m + i] = \"2\" + l[size - m + i]\n            i += 1\n        m = m << 1\n        size = size + m\n    return l[n]\n", "entry_point": "generate_binary_string", "input": "11", "output": "'211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111802_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029526", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'<KEY>', 'AAzaAyC9XB'", "output": "'AAzaAyC9XB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029527", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "738", "output": "{1, 738, 3, 2, 6, 9, 41, 369, 82, 18, 246, 123}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt737", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029528", "code": "def nested_list_sum(nested_list):\n    total_sum = 0\n    for item in nested_list:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, list):\n            total_sum += nested_list_sum(item)\n    return total_sum\n", "entry_point": "nested_list_sum", "input": "[[10, 5], [7, [12]]]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31116_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029529", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3425", "output": "{1, 3425, 5, 137, 685, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3424", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029530", "code": "def _clean_binary_segmentation(input, percentile):\n    sorted_input = sorted(input)\n    threshold_index = int(len(sorted_input) * percentile / 100)\n    below_percentile = sorted_input[:threshold_index]\n    equal_above_percentile = sorted_input[threshold_index:]\n    return below_percentile, equal_above_percentile\n", "entry_point": "_clean_binary_segmentation", "input": "[3, 4, 6, 9, 9, 35, 47], 43", "output": "([3, 4, 6], [9, 9, 35, 47])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96298_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029531", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "7", "output": "64", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029532", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "10", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029533", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "6", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029534", "code": "from typing import List\ndef custom_shuffle(lst: List[int]) -> List[int]:\n    n = len(lst)\n    mid = n // 2\n    first_half = lst[:mid]\n    second_half = lst[mid:]\n    shuffled_list = []\n    for i in range(mid):\n        shuffled_list.append(first_half[i])\n        shuffled_list.append(second_half[i])\n    # If the list length is odd, add the last element from the second half\n    if n % 2 != 0:\n        shuffled_list.append(second_half[-1])\n    return shuffled_list\n", "entry_point": "custom_shuffle", "input": "[0, 2, 3, 6, 5, 2]", "output": "[0, 6, 2, 5, 3, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11950_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029535", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "982", "output": "{1, 2, 491, 982}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt981", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029536", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5929", "output": "{1, 7, 5929, 11, 77, 847, 49, 121, 539}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5928", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029537", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "789", "output": "{1, 3, 789, 263}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt788", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029538", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "734", "output": "{1, 2, 734, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt733", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029539", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7510", "output": "{1, 2, 5, 10, 3755, 751, 7510, 1502}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7509", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029540", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5601", "output": "{1, 1867, 3, 5601}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5600", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029541", "code": "def word_frequency(text):\n    text = text.lower()  # Convert text to lowercase\n    words = text.split()  # Split text into words\n    frequency_dict = {}  # Dictionary to store word frequencies\n    for word in words:\n        # Remove any punctuation marks if needed\n        word = word.strip('.,!?;:\"')\n        if word in frequency_dict:\n            frequency_dict[word] += 1\n        else:\n            frequency_dict[word] = 1\n    return frequency_dict\n", "entry_point": "word_frequency", "input": "'hellhelloo'", "output": "{'hellhelloo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117162_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029542", "code": "def process_list(lst, threshold):\n    processed_list = []\n    for num in lst:\n        if num >= threshold:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_list", "input": "[6, 6, 2, 10, 6, 2], 10", "output": "[216, 216, 8, 100, 216, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88444_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029543", "code": "def _lik_formulae(lik):\n    lik_formulas = {\n        \"bernoulli\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"probit\": \" for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=\u03a6(x)\\n\",\n        \"binomial\": \" for y\u1d62 ~ Binom(\u03bc\u1d62=g(z\u1d62), n\u1d62) and g(x)=1/(1+e\u207b\u02e3)\\n\",\n        \"poisson\": \" for y\u1d62 ~ Poisson(\u03bb\u1d62=g(z\u1d62)) and g(x)=e\u02e3\\n\"\n    }\n    return lik_formulas.get(lik, \"\\n\")\n", "entry_point": "_lik_formulae", "input": "'probit'", "output": "' for y\u1d62 ~ Bern(\u03bc\u1d62=g(z\u1d62)) and g(x)=\u03a6(x)\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106790_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3778", "output": "{1, 3778, 2, 1889}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3777", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029545", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9808", "output": "{1, 2, 4, 613, 4904, 8, 1226, 9808, 16, 2452}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9807", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029546", "code": "def parse_config(config_snippet: str) -> dict:\n    settings = {}\n    lines = config_snippet.split('\\n')\n    for line in lines:\n        if '=' in line:\n            setting, value = line.split('=', 1)\n            setting = setting.strip().split('.')[-1]\n            value = value.strip()\n            if value.isdigit():\n                value = int(value)\n            elif value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            settings[setting] = value\n    return settings\n", "entry_point": "parse_config", "input": "'NotebookAppt='", "output": "{'NotebookAppt': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123614_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029547", "code": "from typing import List\ndef calculate_average_score(scores: List[int]) -> float:\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]  # Exclude the first and last elements\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores) if len(trimmed_scores) > 0 else 0\n    return round(average, 2)\n", "entry_point": "calculate_average_score", "input": "[10, 17, 18, 20, 25]", "output": "18.33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145902_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029548", "code": "def ramsey_R2(n):\n    if n == 1:\n        return 2\n    elif n == 2:\n        return 3\n    else:\n        r_prev = 2\n        r_current = 3\n        for i in range(3, n + 1):\n            r_next = r_current + r_prev\n            r_prev, r_current = r_current, r_next\n        return r_current\n", "entry_point": "ramsey_R2", "input": "7", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12581_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029549", "code": "def average_absolute_difference(list1, list2):\n    if len(list1) != len(list2):\n        return \"Error: Input lists must have the same length.\"\n    abs_diff = [abs(x - y) for x, y in zip(list1, list2)]\n    avg_abs_diff = sum(abs_diff) / len(abs_diff)\n    return avg_abs_diff\n", "entry_point": "average_absolute_difference", "input": "[1, 2, 3, 4], [2, 2.5, 4, 6]", "output": "1.125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107856_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029550", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3907", "output": "{1, 3907}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3906", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029551", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[2, 5, 1, 1, 9, 2, 6, 1]", "output": "[1, 1, 1, 2, 2, 5, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029552", "code": "def get_unique_ids(adet):\n    unique_ids = {}\n    current_id = 101  # Starting identifier value\n    for detector in adet:\n        unique_ids[detector] = current_id\n        current_id += 1\n    return unique_ids\n", "entry_point": "get_unique_ids", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102441_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029553", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1101110X'", "output": "['11011100', '11011101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt22", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029554", "code": "def find_lock_value(possible_lock_vals, target_index):\n    if not possible_lock_vals:\n        return None\n    effective_index = target_index % len(possible_lock_vals)\n    return possible_lock_vals[effective_index]\n", "entry_point": "find_lock_value", "input": "[4], 0", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83896_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029555", "code": "def custom_round(value, decimal_places):\n    rounded_value = int(value * 10**decimal_places + 0.5) / 10**decimal_places\n    return rounded_value\n", "entry_point": "custom_round", "input": "0.95, 1", "output": "1.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125124_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029556", "code": "def count_elements(input_list):\n    element_counts = {}\n    for element in input_list:\n        if element in element_counts:\n            element_counts[element] += 1\n        else:\n            element_counts[element] = 1\n    return element_counts\n", "entry_point": "count_elements", "input": "[4, 4, 4, 4, 2, 2, 1, 1, 5]", "output": "{4: 4, 2: 2, 1: 2, 5: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79113_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029557", "code": "import re\ndef sub(message, regex):\n    parts = regex.split(\"/\")\n    pattern = parts[1]\n    replacement = parts[2]\n    flags = parts[3] if len(parts) > 3 else \"\"\n    count = 1\n    if \"g\" in flags:\n        count = 0\n    elif flags.isdigit():\n        count = int(flags)\n    return re.sub(pattern, replacement, message, count)\n", "entry_point": "sub", "input": "'Hello, World!', '/World/Wd/'", "output": "'Hello, Wd!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32281_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029558", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1842", "output": "{1, 2, 3, 614, 6, 1842, 307, 921}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1841", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029559", "code": "def calculate_sum_list(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list)):\n        next_index = (i + 1) % len(input_list)\n        result.append(input_list[i] + input_list[next_index])\n    return result\n", "entry_point": "calculate_sum_list", "input": "[1, 2, 3, 4]", "output": "[3, 5, 7, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30004_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029560", "code": "def password_strength_checker(password):\n    score = 0\n    # Check length of the password\n    score += len(password)\n    # Check for uppercase and lowercase letters\n    if any(char.isupper() for char in password) and any(char.islower() for char in password):\n        score += 5\n    # Check for at least one digit\n    if any(char.isdigit() for char in password):\n        score += 5\n    # Check for special characters\n    special_characters = set('!@#$%^&*()_+-=[]{}|;:,.<>?')\n    if any(char in special_characters for char in password):\n        score += 10\n    return score\n", "entry_point": "password_strength_checker", "input": "'ab'", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26515_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4071", "output": "{1, 3, 69, 4071, 1357, 177, 23, 59}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4070", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029562", "code": "def find_unique_highest_score(scores):\n    score_freq = {}\n    # Populate the dictionary with score frequencies\n    for score in scores:\n        score_freq[score] = score_freq.get(score, 0) + 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "find_unique_highest_score", "input": "[88, 70, 70, 75]", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142470_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029563", "code": "def process_results(result, task):\n    res = {}\n    if result and task.get('result'):\n        res[\"result\"] = {\n            \"compile_output\": task['result'].get('compile_output'),\n            \"compile_error\": task['result'].get('compile_error'),\n            \"execute_output\": task['result'].get('execute_output'),\n            \"execute_error\": task['result'].get('execute_error'),\n        }\n    else:\n        res[\"result\"] = None\n    return res\n", "entry_point": "process_results", "input": "None, {'example_key': 'value'}", "output": "{'result': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139282_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029564", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "[14.5, 10.0, 10], 2", "output": "(7.25, 5.0, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029565", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = []\n    running_sum = 0\n    for num in input_list:\n        running_sum += num\n        cumulative_sum.append(running_sum)\n    return cumulative_sum\n", "entry_point": "calculate_cumulative_sum", "input": "[2, 3, 2, 3, 1, 0, 0, 2]", "output": "[2, 5, 7, 10, 11, 11, 11, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4321_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029566", "code": "import string\ndef generate_unique_words(text):\n    unique_words = set()\n    for word in text.split():\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return list(unique_words)\n", "entry_point": "generate_unique_words", "input": "'Wlowolo'", "output": "['wlowolo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77669_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029567", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[4, 4, 8, 8, 8, 5, 5, 7, 7]", "output": "[8, 8, 16, 16, 16, 25, 25, 49, 49]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029568", "code": "def sum_of_squares_even_numbers(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 2 == 0:\n            total_sum += num ** 2\n    return total_sum\n", "entry_point": "sum_of_squares_even_numbers", "input": "[6, 6]", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35843_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029569", "code": "from typing import List\ndef max_sum_subarray(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sum_subarray", "input": "[2, 3, -1, 5, 2]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101809_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029570", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6901", "output": "{1, 67, 6901, 103}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6900", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029571", "code": "def generate_histogram(input_list):\n    histogram = {}\n    for num in input_list:\n        if num in histogram:\n            histogram[num] += 1\n        else:\n            histogram[num] = 1\n    return histogram\n", "entry_point": "generate_histogram", "input": "[1, 1, 1, 1, 2, 2, 2, 3, 3]", "output": "{1: 4, 2: 3, 3: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98167_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029572", "code": "def modify_description(long_description, version):\n    if len(long_description) > 100:\n        modified_description = long_description + version\n    else:\n        modified_description = version + long_description\n    return modified_description\n", "entry_point": "modify_description", "input": "'is', '11.2.01.210.2.0'", "output": "'11.2.01.210.2.0is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67688_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029573", "code": "from typing import List\ndef top_k_students(scores: List[int], k: int) -> List[int]:\n    indexed_scores = [(score, index) for index, score in enumerate(scores)]\n    sorted_scores = sorted(indexed_scores, key=lambda x: (-x[0], x[1]))\n    top_k_indices = [student[1] for student in sorted_scores[:k]]\n    return top_k_indices\n", "entry_point": "top_k_students", "input": "[80, 88, 95, 82, 85, 84, 78, 90], 5", "output": "[2, 7, 1, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33531_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029574", "code": "import re\ndef markdown_to_html(markdown_content):\n    # Convert headers\n    markdown_content = re.sub(r'^(#+)\\s(.*)$', lambda x: f'<h{x.group(1).count(\"#\")}>' + x.group(2) + f'</h{x.group(1).count(\"#\")}>', markdown_content, flags=re.MULTILINE)\n    # Convert bold text\n    markdown_content = re.sub(r'\\*\\*(.*?)\\*\\*', r'<strong>\\1</strong>', markdown_content)\n    # Convert italic text\n    markdown_content = re.sub(r'\\*(.*?)\\*', r'<em>\\1</em>', markdown_content)\n    # Convert paragraphs\n    paragraphs = re.split(r'\\n{2,}', markdown_content)\n    markdown_content = '\\n'.join([f'<p>{p}</p>' for p in paragraphs])\n    return markdown_content\n", "entry_point": "markdown_to_html", "input": "'#'", "output": "'<p>#</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24130_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029575", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9766", "output": "{1, 2, 514, 257, 9766, 38, 19, 4883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9765", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029576", "code": "def concatenate_common_chars(strings):\n    chars_used_in_all = set(''.join(strings))\n    each_count = dict([(char, 0) for char in chars_used_in_all])\n    for char in chars_used_in_all:\n        for string in strings:\n            count = string.count(char)\n            if string == strings[0]:\n                min_count = count\n            min_count = min(min_count, count)\n        each_count[char] = min_count\n    res = [char * count for char, count in each_count.items()]\n    ans = \"\".join(res)\n    return ans\n", "entry_point": "concatenate_common_chars", "input": "['a', 'a', 'a']", "output": "'a'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130513_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029577", "code": "from typing import List\ndef sanitize_pg_array(pg_array: str) -> List[str]:\n    if not isinstance(pg_array, str):\n        return pg_array\n    return list(map(str.strip, pg_array.strip(\"{}\").split(\",\")))\n", "entry_point": "sanitize_pg_array", "input": "'{ cherry }'", "output": "['cherry']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105480_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029578", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1897", "output": "{1, 7, 271, 1897}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1896", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029579", "code": "def move_player(movements):\n    directions = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1)}\n    player_position = [0, 0]\n    for move in movements:\n        dx, dy = directions.get(move, (0, 0))\n        new_x = player_position[0] + dx\n        new_y = player_position[1] + dy\n        if 0 <= new_x < 5 and 0 <= new_y < 5:\n            player_position[0] = new_x\n            player_position[1] = new_y\n    return tuple(player_position)\n", "entry_point": "move_player", "input": "['D', 'D', 'D', 'D', 'R', 'R', 'R', 'R']", "output": "(4, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144868_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029580", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "10, 8, 12", "output": "(0, 5, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029581", "code": "def total_legs(animal_list):\n    total_legs_count = 0\n    animals = animal_list.split(',')\n    for animal in animals:\n        name, legs = animal.split(':')\n        total_legs_count += int(legs)\n    return total_legs_count\n", "entry_point": "total_legs", "input": "'cat:4,dog:4,ant:2'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23053_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029582", "code": "def calculate_sum(numbers):\n    total_sum = sum(numbers)\n    return total_sum\n", "entry_point": "calculate_sum", "input": "[79]", "output": "79", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1674_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029583", "code": "def next_greater_permutation(n):\n    num = list(str(n))\n    i = len(num) - 2\n    while i >= 0:\n        if num[i] < num[i + 1]:\n            break\n        i -= 1\n    if i == -1:\n        return -1\n    j = len(num) - 1\n    while num[j] <= num[i]:\n        j -= 1\n    num[i], num[j] = num[j], num[i]\n    result = int(''.join(num[:i + 1] + num[i + 1:][::-1]))\n    return result if result < (1 << 31) else -1\n", "entry_point": "next_greater_permutation", "input": "125", "output": "152", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114170_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029584", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9061", "output": "{1, 9061, 41, 13, 17, 533, 697, 221}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9060", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029585", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6662", "output": "{1, 2, 3331, 6662}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6661", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029586", "code": "from os.path import sep as os_sep\ndef get_adjusted_path_string(path_string):\n    for separator in ['\\\\\\\\', '\\\\', '/', '//']:\n        path_string = path_string.replace(separator, os_sep)\n    return path_string\n", "entry_point": "get_adjusted_path_string", "input": "'C:\\\\C:\\\\Users\\\\John\\\\DocumentsU'", "output": "'C:/C:/Users/John/DocumentsU'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_27058_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029587", "code": "from typing import List, Dict\ndef analyze_migration_commands(commands: List[str]) -> Dict[str, List[str]]:\n    table_columns = {}\n    for command in commands:\n        parts = command.split(\"'\")\n        table_name = parts[3]\n        column_name = parts[-2].strip(\"[]\")\n        if table_name in table_columns:\n            table_columns[table_name].append(column_name)\n        else:\n            table_columns[table_name] = [column_name]\n    return table_columns\n", "entry_point": "analyze_migration_commands", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58250_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029588", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 95, 81, 70, 60]", "output": "[95, 95, 81]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113414_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029589", "code": "def next_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        patch += 1\n    elif minor < 9:\n        minor += 1\n        patch = 0\n    else:\n        major += 1\n        minor = 0\n        patch = 0\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'42.2.2'", "output": "'42.2.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93587_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029590", "code": "def sum_after_third_removed(nums):\n    if len(nums) < 3:\n        return sum(nums)\n    del nums[2]  # Remove the third element\n    return sum(nums)\n", "entry_point": "sum_after_third_removed", "input": "[1, 2, 10, 10]", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112008_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029591", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8666", "output": "{1, 2, 7, 619, 4333, 14, 1238, 8666}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8665", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029592", "code": "import re\nre_punc = re.compile(r'[!\"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\']')\narticles = set([\"a\", \"an\", \"the\"])\ndef normalize_answer(s):\n    \"\"\"\n    Lower text, remove punctuation, articles, and extra whitespace.\n    Args:\n    s: A string representing the input text to be normalized.\n    Returns:\n    A string with the input text normalized as described.\n    \"\"\"\n    s = s.lower()\n    s = re_punc.sub(\" \", s)\n    s = \" \".join([word for word in s.split() if word not in articles])\n    s = \" \".join(s.split())\n    return s\n", "entry_point": "normalize_answer", "input": "', fox!'", "output": "'fox'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46089_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029593", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7461", "output": "{1, 3, 7461, 9, 2487, 829}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7460", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029594", "code": "def process_list(input_list):\n    odd_numbers = [num for num in input_list if num % 2 != 0]\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    if odd_numbers and not even_numbers:\n        return sorted(odd_numbers, reverse=True)\n    elif even_numbers and not odd_numbers:\n        return sorted(even_numbers)\n    else:\n        return sorted(odd_numbers, reverse=True) + sorted(even_numbers)\n", "entry_point": "process_list", "input": "[5, 1, 2, 2, 2, 2, 2, 4]", "output": "[5, 1, 2, 2, 2, 2, 2, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21680_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029595", "code": "import re\nBYTE_RANGE_RE = re.compile(r'^bytes=(\\d*)-(\\d*)$')\ndef parse_byte_range(byte_range):\n    if byte_range.strip() == '':\n        return None, None\n    m = BYTE_RANGE_RE.match(byte_range)\n    if not m:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    first, last = [int(x) if x else None for x in m.groups()]\n    if last is not None and first is not None and last < first:\n        raise ValueError('Invalid byte range %s' % byte_range)\n    return first, last\n", "entry_point": "parse_byte_range", "input": "'bytes=1000-2000'", "output": "(1000, 2000)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76865_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029596", "code": "def multiply_return(a, b):\n    if a == 0 or b == 0:\n        return 0\n    else:\n        return a * b\n", "entry_point": "multiply_return", "input": "5, -6", "output": "-30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149254_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029597", "code": "def format_version(version: tuple) -> str:\n    if len(version) == 3:\n        return f\"v{version[0]}.{version[1]}.{version[2]}\"\n    elif len(version) == 2:\n        return f\"v{version[0]}.{version[1]}.0\"\n    elif len(version) == 1:\n        return f\"v{version[0]}.0.0\"\n", "entry_point": "format_version", "input": "(3,)", "output": "'v3.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103483_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029598", "code": "def cleanse_column(column_name):\n    cleansed_name = \"\"\n    for char in column_name:\n        if char == ' ':\n            cleansed_name += '_'\n        elif char in ['(', ')']:\n            pass\n        else:\n            cleansed_name += char\n    return cleansed_name\n", "entry_point": "cleanse_column", "input": "'dish'", "output": "'dish'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103332_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029599", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1761", "output": "{1, 587, 3, 1761}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1760", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029600", "code": "import re\nDATE_RE = re.compile(r\"[0-9]{4}-[0-9]{2}-[0-9]{2}\")\nINVALID_IN_NAME_RE = re.compile(\"[^a-z0-9_]\")\ndef process_input(input_str):\n    # Check if input matches the date format pattern\n    is_date = bool(DATE_RE.match(input_str))\n    # Remove specific suffix if it exists\n    processed_str = input_str\n    if input_str.endswith(\"T00:00:00.000+00:00\"):\n        processed_str = input_str[:-19]\n    # Check for invalid characters based on the pattern\n    has_invalid_chars = bool(INVALID_IN_NAME_RE.search(input_str))\n    return (is_date, processed_str, has_invalid_chars)\n", "entry_point": "process_input", "input": "'2022-BC123'", "output": "(False, '2022-BC123', True)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49598_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029601", "code": "def Binominal_float(n: int, k: int) -> float:\n    if k > n:\n        return 0.0\n    result = 1.0\n    if k > n - k:\n        k = n - k\n    for i in range(1, k + 1):\n        result *= n\n        result /= i\n        n -= 1\n    return result\n", "entry_point": "Binominal_float", "input": "10, 3", "output": "120.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21461_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029602", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5618", "output": "{1, 2, 106, 5618, 53, 2809}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5617", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029603", "code": "label = \"user defined window\"\ndef replace_window(input_str):\n    input_lower = input_str.lower()\n    modified_str = input_lower.replace(\"window\", label)\n    return modified_str\n", "entry_point": "replace_window", "input": "'TheOnP.'", "output": "'theonp.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144137_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029604", "code": "def apply_relu(input_list):\n    output_list = []\n    for num in input_list:\n        output_list.append(max(0, num))\n    return output_list\n", "entry_point": "apply_relu", "input": "[-1, 2.0]", "output": "[0, 2.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117710_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029605", "code": "def calculate_total_seconds(duration):\n    # Split the duration string into hours, minutes, and seconds\n    hours, minutes, seconds = map(int, duration.split(':'))\n    # Calculate the total number of seconds\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "calculate_total_seconds", "input": "'01:02:45'", "output": "3765", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40922_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029606", "code": "from typing import List\nREGON9_WEIGHTS = [8, 9, 2, 3, 4, 5, 6, 7]\nREGON14_WEIGHTS = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]\ndef convert_regon(regon: str) -> str:\n    if not regon.isdigit() or len(regon) != 9:\n        raise ValueError(\"Input REGON must be a 9-digit string\")\n    regon_digits = [int(digit) for digit in regon]\n    checksum = sum(digit * weight for digit, weight in zip(regon_digits, REGON9_WEIGHTS)) % 11\n    checksum = 0 if checksum == 10 else checksum\n    return regon + str(checksum) + ''.join(str(weight) for weight in REGON14_WEIGHTS)\n", "entry_point": "convert_regon", "input": "'583543561'", "output": "'58354356152485097361248'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39684_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029607", "code": "import math\ndef calculate_nequat_nvert(n: int) -> tuple:\n    nequat = int(math.sqrt(math.pi * n))\n    nvert = nequat // 2\n    return nequat, nvert\n", "entry_point": "calculate_nequat_nvert", "input": "6", "output": "(4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142533_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029608", "code": "def open_new_periods(old_periods):\n    new_periods = []\n    for old_period in old_periods:\n        new_period = old_period + 1\n        new_periods.append(new_period)\n    return new_periods\n", "entry_point": "open_new_periods", "input": "[5, 3, 3, 2, 3, 2, 3]", "output": "[6, 4, 4, 3, 4, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106899_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029609", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if N > len(scores):\n        N = len(scores)\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[-50, -45], 2", "output": "-47.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2401_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029610", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4036", "output": "{1, 2, 2018, 4, 4036, 1009}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4035", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029611", "code": "from typing import List\nfrom collections import deque\ndef bfs_distances(g: List[List[int]]) -> List[int]:\n    n = len(g)\n    d = [0] * n\n    visited = set()\n    que = deque([0])\n    cnt = 0\n    while que:\n        for _ in range(len(que)):\n            cur = que.popleft()\n            visited.add(cur)\n            d[cur] = cnt\n            for nxt in g[cur]:\n                if nxt not in visited:\n                    que.append(nxt)\n        cnt += 1\n    return d\n", "entry_point": "bfs_distances", "input": "[[], [], [], [], [], [], [], []]", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142858_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029612", "code": "def nth_ugly_number(n):\n    ugly = [1]\n    p2, p3, p5 = 0, 0, 0\n    next_multiple_2, next_multiple_3, next_multiple_5 = 2, 3, 5\n    for i in range(1, n):\n        next_ugly = min(next_multiple_2, next_multiple_3, next_multiple_5)\n        ugly.append(next_ugly)\n        if next_ugly == next_multiple_2:\n            p2 += 1\n            next_multiple_2 = ugly[p2] * 2\n        if next_ugly == next_multiple_3:\n            p3 += 1\n            next_multiple_3 = ugly[p3] * 3\n        if next_ugly == next_multiple_5:\n            p5 += 1\n            next_multiple_5 = ugly[p5] * 5\n    return ugly[n-1]\n", "entry_point": "nth_ugly_number", "input": "14", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68674_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029613", "code": "def count_non_whitespace_chars(s: str) -> int:\n    count = 0\n    for c in s:\n        if not c.isspace():\n            count += 1\n    return count\n", "entry_point": "count_non_whitespace_chars", "input": "'10abcde fgh'", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72891_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029614", "code": "def parse_index_expression(index_expr):\n    parts = index_expr.split(':')\n    parsed_parts = []\n    for part in parts:\n        if part.strip():  # Check if the part is not empty after stripping whitespace\n            parsed_parts.append(part.strip())\n        else:\n            parsed_parts.append(None)\n    # Ensure the parsed_parts list has exactly 3 elements\n    while len(parsed_parts) < 3:\n        parsed_parts.append(None)\n    return tuple(parsed_parts)\n", "entry_point": "parse_index_expression", "input": "'COLON expr COLON::'", "output": "('COLON expr COLON', None, None)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52508_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029615", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "5, 5", "output": "7.0710678118654755", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029616", "code": "import logging\ndef mapLogLevels(levels):\n    log_level_map = {\n        logging.ERROR: 'ERROR',\n        logging.WARN: 'WARN',\n        logging.INFO: 'INFO',\n        logging.DEBUG: 'DEBUG'\n    }\n    result = {}\n    for level in levels:\n        result[level] = log_level_map.get(level, 'UNKNOWN')\n    return result\n", "entry_point": "mapLogLevels", "input": "[40, 10, 30]", "output": "{40: 'ERROR', 10: 'DEBUG', 30: 'WARN'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125844_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029617", "code": "def calculate_order_total(products):\n    total_price = 0\n    for product in products:\n        total_price += product['price']\n    return total_price\n", "entry_point": "calculate_order_total", "input": "[{'price': 50}, {'price': 50}]", "output": "100", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12251_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029618", "code": "from typing import List\ndef calculate_positive_average(numbers: List[int]) -> float:\n    sum_positive = 0\n    count_positive = 0\n    for num in numbers:\n        if num > 0:\n            sum_positive += num\n            count_positive += 1\n    return sum_positive / count_positive if count_positive > 0 else 0\n", "entry_point": "calculate_positive_average", "input": "[8, 8, 8, 8, 8, 8, 10, 11]", "output": "8.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93156_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029619", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string.lower():\n        if char != ' ':\n            if char in char_count:\n                char_count[char] += 1\n            else:\n                char_count[char] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'world! r'", "output": "{'w': 1, 'o': 1, 'r': 2, 'l': 1, 'd': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69138_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029620", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N == 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 80, 75, 60], 4", "output": "76.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75916_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029621", "code": "def add_suffix_based_on_length(strings):\n    modified_strings = []\n    for string in strings:\n        suffix = 'even' if len(string) % 2 == 0 else 'odd'\n        modified_strings.append(string + suffix)\n    return modified_strings\n", "entry_point": "add_suffix_based_on_length", "input": "['aabapalaebananabanana']", "output": "['aabapalaebananabananaodd']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82324_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029622", "code": "def leaky_relu(x, alpha):\n    return x if x >= 0 else alpha * x\n", "entry_point": "leaky_relu", "input": "-51.744, 1.0", "output": "-51.744", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63441_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029623", "code": "import sys\n# Define the mapping of operation types to module names\nOPERATION_MODULES = {\n    \"compression\": \"compression_ops\",\n    \"crypto\": \"crypto_ops\",\n    \"encoding\": \"encoding_ops\",\n    \"misc\": \"misc_ops\",\n    \"parsing\": \"parsing_ops\",\n    \"search\": \"search_ops\",\n    \"visualization\": \"visualization_ops\",\n    \"xor\": \"xor_ops\"\n}\ndef perform_operation(operation_type):\n    if operation_type in OPERATION_MODULES:\n        module_name = OPERATION_MODULES[operation_type]\n        try:\n            # Dynamically import the module\n            module = __import__(module_name, fromlist=[''])\n            # Execute the operation if it exists\n            if hasattr(module, f\"perform_{operation_type}_operation\"):\n                operation_func = getattr(module, f\"perform_{operation_type}_operation\")\n                return operation_func()\n            else:\n                return f\"No operation found for type '{operation_type}'\"\n        except ImportError:\n            return f\"Module '{module_name}' not found\"\n    else:\n        return f\"Operation type '{operation_type}' not supported\"\n", "entry_point": "perform_operation", "input": "'vivisualviuu'", "output": "\"Operation type 'vivisualviuu' not supported\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111087_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029624", "code": "def find_ranks(scores):\n    ranks = [1]  # Initialize the rank of the first player as 1\n    prev_score = scores[0]\n    current_rank = 1\n    for i in range(1, len(scores)):\n        if scores[i] == prev_score:\n            ranks.append(current_rank)  # Assign the same rank as the previous player\n        else:\n            current_rank = i + 1  # Update the rank\n            ranks.append(current_rank)\n            prev_score = scores[i]\n    return ranks\n", "entry_point": "find_ranks", "input": "[10, 20, 30, 40]", "output": "[1, 2, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140753_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029625", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4205", "output": "{1, 5, 841, 4205, 145, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4204", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029626", "code": "def extract_numerical_version(version_string):\n    numerical_version = ''.join(filter(lambda x: x.isdigit() or x == '.', version_string))\n    numerical_version = numerical_version.replace('.', '', 1)  # Remove the first occurrence of '.'\n    try:\n        return float(numerical_version)\n    except ValueError:\n        return None\n", "entry_point": "extract_numerical_version", "input": "'version 1.3141.5911'", "output": "13141.5911", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59934_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029627", "code": "def add_index_to_element(lst):\n    result = []\n    for i, num in enumerate(lst):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[3, 3, 9, 8, 10, 8, 1, 3]", "output": "[3, 4, 11, 11, 14, 13, 7, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126904_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029628", "code": "def convert_time(time_str):\n    hours, minutes, seconds = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:] == \"PM\"\n    if is_pm and hours != 12:\n        hours += 12\n    elif not is_pm and hours == 12:\n        hours = 0\n    return f\"{hours:02d}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "convert_time", "input": "'07:305:04PM'", "output": "'19:305:04'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124283_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029629", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2783", "output": "{1, 11, 23, 121, 253, 2783}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2782", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029630", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3937", "output": "{1, 127, 3937, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3936", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029631", "code": "from typing import List\ndef generate_modified_fizzbuzz_sequence(n: int) -> List[str]:\n    result = []\n    for i in range(1, n+1):\n        if i % 3 == 0 and i % 5 == 0:\n            result.append(\"FizzBuzz\")\n        elif i % 3 == 0:\n            result.append(\"Fizz\")\n        elif i % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(i))\n    return result\n", "entry_point": "generate_modified_fizzbuzz_sequence", "input": "6", "output": "['1', '2', 'Fizz', '4', 'Buzz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26940_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029632", "code": "def extract_module_name(file_path):\n    # Split the file path using '/'\n    path_parts = file_path.split('/')\n    # Get the last part of the path which represents the file name\n    file_name = path_parts[-1]\n    # Split the file name using '.'\n    name_parts = file_name.split('.')\n    # Return the first part of the split file name as the module name\n    return name_parts[0]\n", "entry_point": "extract_module_name", "input": "'/home/user/projects/jwt_vaiuest.py'", "output": "'jwt_vaiuest'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55134_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029633", "code": "def translate_js(js_code):\n    # Define a mapping of JavaScript constructs to Python equivalents\n    mapping = {\n        'function': 'def',\n        'return': 'return',\n        'if': 'if',\n        'else': 'else',\n        'for': 'for',\n        'while': 'while',\n        'true': 'True',\n        'false': 'False',\n        'null': 'None',\n        'undefined': 'None',\n        '==': '==',\n        '!=': '!=',\n        '+': '+',\n        '-': '-',\n        '*': '*',\n        '/': '/',\n        '%': '%',\n        '<': '<',\n        '>': '>',\n        '<=': '<=',\n        '>=': '>=',\n        '&&': 'and',\n        '||': 'or',\n        '===': '==',\n        '!==': '!=',\n    }\n    # Perform the translation based on the mapping\n    translated_code = ''\n    lines = js_code.split('\\n')\n    for line in lines:\n        tokens = line.split()\n        if tokens:\n            translated_line = ' '.join([mapping.get(token, token) for token in tokens])\n            translated_code += translated_line + '\\n'\n    return translated_code\n", "entry_point": "translate_js", "input": "'add(a,b;'", "output": "'add(a,b;\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5656_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029634", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3143", "output": "{1, 7, 449, 3143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3142", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029635", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "950", "output": "{1, 2, 5, 38, 10, 50, 19, 950, 25, 475, 190, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt949", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029636", "code": "import math\ndef calculate_total_length(points):\n    total_length = 0\n    for i in range(len(points) - 1):\n        x1, y1 = points[i]\n        x2, y2 = points[i + 1]\n        length = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)\n        total_length += length\n    return total_length\n", "entry_point": "calculate_total_length", "input": "[(0, 0), (3, 4)]", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3574_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029637", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5732", "output": "{1, 2, 5732, 4, 2866, 1433}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5731", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029638", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4670", "output": "{1, 2, 5, 934, 10, 467, 4670, 2335}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4669", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029639", "code": "def calculate_total_frames(frames_per_clip, total_clips):\n    total_frames = frames_per_clip * total_clips\n    return total_frames\n", "entry_point": "calculate_total_frames", "input": "11, 54", "output": "594", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119068_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029640", "code": "def recursivo_minmax_1x(sequencia_numerica):\n    if len(sequencia_numerica) == 1:\n        return sequencia_numerica[0], sequencia_numerica[0]\n    if len(sequencia_numerica) == 2:\n        return (sequencia_numerica[0], sequencia_numerica[1]) if sequencia_numerica[0] < sequencia_numerica[1] else (sequencia_numerica[1], sequencia_numerica[0])\n    mid = len(sequencia_numerica) // 2\n    min1, max1 = recursivo_minmax_1x(sequencia_numerica[:mid])\n    min2, max2 = recursivo_minmax_1x(sequencia_numerica[mid:])\n    return min(min1, min2), max(max1, max2)\n", "entry_point": "recursivo_minmax_1x", "input": "[10, 12]", "output": "(10, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5349_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029641", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            sum_adjacent = input_list[i] + input_list[i+1]\n        elif i == len(input_list) - 1:\n            sum_adjacent = input_list[i-1] + input_list[i]\n        else:\n            sum_adjacent = input_list[i-1] + input_list[i] + input_list[i+1]\n        output_list.append(sum_adjacent)\n    return output_list\n", "entry_point": "process_list", "input": "[0, 5, 6, 0]", "output": "[5, 11, 11, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78422_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029642", "code": "def calculate_trainable_params(total_params, non_trainable_params):\n    trainable_params = total_params - non_trainable_params\n    return trainable_params\n", "entry_point": "calculate_trainable_params", "input": "24767883, 0", "output": "24767883", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112905_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029643", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6634", "output": "{1, 2, 6634, 107, 3317, 214, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6633", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029644", "code": "def circular_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        sum_val = input_list[i] + input_list[(i + 1) % len(input_list)]\n        output_list.append(sum_val)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 4, 2, 1, 0, 1, 1, 2]", "output": "[7, 6, 3, 1, 1, 2, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92643_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029645", "code": "def calc_kf(q, Kt):\n    \"\"\"Calculate the dynamic stress concentration factor Kf.\n    :param float q: Notch Sensitivity\n    :param float Kt: Stress concentration theoretical factor\n    :return: Dynamic stress concentration factor Kf\n    :rtype: float\n    \"\"\"\n    Kf = 1 + q * (Kt - 1)\n    return Kf\n", "entry_point": "calc_kf", "input": "1, 6.1474324", "output": "6.1474324", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112140_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029646", "code": "def find_min_positive_constant(constants):\n    min_positive = None\n    for constant in constants:\n        if constant > 0 and (min_positive is None or constant < min_positive):\n            min_positive = constant\n    return min_positive\n", "entry_point": "find_min_positive_constant", "input": "[9e+59, 1e+60, -1, 0]", "output": "9e+59", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115319_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029647", "code": "from typing import List\ndef maximize_min_distance(a: List[int], M: int) -> int:\n    a.sort()\n    def is_ok(mid):\n        last = a[0]\n        count = 1\n        for i in range(1, len(a)):\n            if a[i] - last >= mid:\n                count += 1\n                last = a[i]\n        return count >= M\n    left, right = 0, a[-1] - a[0]\n    while left < right:\n        mid = (left + right + 1) // 2\n        if is_ok(mid):\n            left = mid\n        else:\n            right = mid - 1\n    return left\n", "entry_point": "maximize_min_distance", "input": "[0, 8, 16], 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125115_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029648", "code": "def max_non_contiguous_sum(nums):\n    include = 0\n    exclude = 0\n    for num in nums:\n        new_include = exclude + num\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_contiguous_sum", "input": "[12, 1, 6, 5, 6]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39163_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029649", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3693", "output": "{1, 3, 3693, 1231}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3692", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029650", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3935", "output": "{1, 787, 5, 3935}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3934", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029651", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1529", "output": "{1, 11, 139, 1529}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1528", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029652", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3034", "output": "{1, 2, 37, 41, 74, 1517, 82, 3034}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3033", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029653", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'example_contr'", "output": "'contracts/example_contr.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029654", "code": "def parse_docker_image(image):\n    parts = image.rsplit(\":\", 1)\n    name = parts[0]\n    tag = parts[1] if len(parts) > 1 else \"latest\"\n    return name, tag\n", "entry_point": "parse_docker_image", "input": "'www.registry.io/test'", "output": "('www.registry.io/test', 'latest')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119700_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029655", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7117", "output": "{1, 11, 7117, 647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7116", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029656", "code": "def sum_with_reverse(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + lst[-i - 1])\n    return result\n", "entry_point": "sum_with_reverse", "input": "[0, 2, 0, 1, 4, 4, 4]", "output": "[4, 6, 4, 2, 4, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10204_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029657", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5665", "output": "{1, 5665, 515, 5, 103, 11, 1133, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5664", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029658", "code": "def parse_platform(curr_platform):\n    platform, compiler = curr_platform.split(\"_\")\n    output_folder_platform = \"\"\n    output_folder_compiler = \"\"\n    if platform.startswith(\"win\"):\n        output_folder_platform = \"Win\"\n        if \"vs2013\" in compiler:\n            output_folder_compiler = \"vc120\"\n        elif \"vs2015\" in compiler:\n            output_folder_compiler = \"vc140\"\n        elif \"vs2017\" in compiler:\n            output_folder_compiler = \"vc141\"\n    elif platform.startswith(\"darwin\"):\n        output_folder_platform = \"Mac\"\n        output_folder_compiler = \"clang\"\n    elif platform.startswith(\"linux\"):\n        output_folder_platform = \"Linux\"\n        output_folder_compiler = \"clang\"\n    return output_folder_platform, output_folder_compiler\n", "entry_point": "parse_platform", "input": "'win_vs2015'", "output": "('Win', 'vc140')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142101_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029659", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) <= 1:\n        return None\n    min_val = min(numbers)\n    max_val = max(numbers)\n    numbers.remove(min_val)\n    numbers.remove(max_val)\n    if len(numbers) == 0:\n        return None\n    return sum(numbers) / len(numbers)\n", "entry_point": "calculate_average_excluding_extremes", "input": "[5, 6, 7, 9, 10]", "output": "7.333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148106_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029660", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'clean_dtta', 's'", "output": "'clean_dtta/s'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029661", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[3, 7, 3, 3, 3, 4, 10, 6, 8]", "output": "([3, 7, 3, 3, 3], [4, 10, 6, 8])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029662", "code": "from typing import List\ndef undo_all_alters(data: List[int]) -> List[int]:\n    initial_entries = [0, 1, 2, 3]  # Initial database entries\n    if not data:\n        return initial_entries\n    else:\n        return data[:len(initial_entries)]\n", "entry_point": "undo_all_alters", "input": "[3, 4, 3, 0, 5, 6]", "output": "[3, 4, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127522_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029663", "code": "def cumulative_sum(lst):\n    result = []\n    cum_sum = 0\n    for num in lst:\n        cum_sum += num\n        result.append(cum_sum)\n    return result\n", "entry_point": "cumulative_sum", "input": "[3, 0, -2, 2, 3]", "output": "[3, 3, 1, 3, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136488_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029664", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5371", "output": "{1, 5371, 131, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029665", "code": "def is_numeric(txt):\n    '''Confirms that the text is numeric'''\n    out = len(txt)\n    allowed_chars = set('0123456789-$%+.')  # Define the set of allowed characters\n    allowed_last_chars = set('1234567890%')  # Define the set of allowed last characters\n    for c in txt:\n        if c not in allowed_chars:\n            out = False\n            break\n    if out and txt[-1] not in allowed_last_chars:\n        out = False\n    return out\n", "entry_point": "is_numeric", "input": "''", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94372_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029666", "code": "from typing import List\ndef count_unique_requirements(requirements: List[int]) -> int:\n    unique_requirements = set()\n    for req in requirements:\n        unique_requirements.add(req)\n    return len(unique_requirements)\n", "entry_point": "count_unique_requirements", "input": "[1, 2, 3, 1, 2]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112114_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029667", "code": "def find_anomaly(numbers, preamble_size):\n    def is_valid(window, number):\n        for i in range(len(window)):\n            for j in range(i + 1, len(window)):\n                if window[i] + window[j] == number:\n                    return True\n        return False\n    window = numbers[:preamble_size]\n    for i in range(preamble_size, len(numbers)):\n        number = numbers[i]\n        if not is_valid(window, number):\n            return number\n        window.pop(0)\n        window.append(number)\n    return None\n", "entry_point": "find_anomaly", "input": "[4, 5, 3], 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105708_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029668", "code": "def calculate_average(num1, num2, num3):\n    total_sum = num1 + num2 + num3\n    average = total_sum / 3\n    return average\n", "entry_point": "calculate_average", "input": "20, 21, 23", "output": "21.333333333333332", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_179_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029669", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3577", "output": "{1, 7, 73, 49, 3577, 511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3576", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029670", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[-2, 7, 8, 2, 2, 8]", "output": "[-2, 5, 13, 15, 17, 25]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029671", "code": "from typing import List\ndef get_latest_supported_microversion(current_microversion: str, supported_microversions: List[str]) -> str:\n    current_major, current_minor = map(int, current_microversion.split('.'))\n    filtered_microversions = [microversion for microversion in supported_microversions if tuple(map(int, microversion.split('.'))) <= (current_major, current_minor)]\n    if not filtered_microversions:\n        return \"\"\n    return max(filtered_microversions)\n", "entry_point": "get_latest_supported_microversion", "input": "'12.1', ['12.0', '12.1', '11.5', '11.0']", "output": "'12.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24792_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029672", "code": "def fit_to_grid(co: tuple, grid: float) -> tuple:\n    x = round(co[0] / grid) * grid\n    y = round(co[1] / grid) * grid\n    z = round(co[2] / grid) * grid\n    return round(x, 5), round(y, 5), round(z, 5)\n", "entry_point": "fit_to_grid", "input": "(3.0, 5.0, 2.0), 1.0", "output": "(3.0, 5.0, 2.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_1385_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029673", "code": "def extract_major_version(version_str):\n    # Find the index of the first dot in the version string\n    dot_index = version_str.find('.')\n    # Extract the substring from the start of the version string up to the first dot\n    major_version_str = version_str[:dot_index] if dot_index != -1 else version_str\n    # Convert the extracted substring to an integer and return it as the major version number\n    return int(major_version_str)\n", "entry_point": "extract_major_version", "input": "'21111.1'", "output": "21111", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110094_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029674", "code": "# Predefined DNS mapping\ndns_mapping = {\n    \"www.example.com\": \"192.168.1.1\",\n    \"mail.example.com\": \"192.168.1.2\",\n    \"ftp.example.com\": \"192.168.1.3\"\n}\ndef resolve_dns(query_domain):\n    if query_domain in dns_mapping:\n        return dns_mapping[query_domain]\n    else:\n        return \"Domain not found\"\n", "entry_point": "resolve_dns", "input": "'mail.example.com'", "output": "'192.168.1.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141450_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029675", "code": "def find_mismatched_elements(input_list):\n    mismatched_elements = [(index, value) for index, value in enumerate(input_list) if index != value]\n    return mismatched_elements\n", "entry_point": "find_mismatched_elements", "input": "[0, 2, 4, 1, 4, 0]", "output": "[(1, 2), (2, 4), (3, 1), (5, 0)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128835_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029676", "code": "def merge_topics(part1: str, part2: str) -> str:\n    # Remove trailing slashes from part1 and part2\n    p1 = part1.rstrip('/')\n    p2 = part2.rstrip('/')\n    # Concatenate the cleaned parts with a single slash in between\n    merged_topic = p1 + '/' + p2\n    return merged_topic\n", "entry_point": "merge_topics", "input": "'daprooencea-scie', 'machinehlarnpyp'", "output": "'daprooencea-scie/machinehlarnpyp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139364_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029677", "code": "from datetime import datetime\ndef calculate_date_difference(date1, date2):\n    # Parse the input date strings into datetime objects\n    date1_obj = datetime.strptime(date1, '%Y-%m-%d')\n    date2_obj = datetime.strptime(date2, '%Y-%m-%d')\n    # Calculate the absolute difference in days between the two dates\n    date_difference = abs((date1_obj - date2_obj).days)\n    return date_difference\n", "entry_point": "calculate_date_difference", "input": "'2023-01-01', '2023-01-16'", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86815_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029678", "code": "import os\ndef generate_log_file_name(addon_name):\n    base_name = addon_name.lower().replace(\" \", \"_\") + \".log\"\n    log_file_name = base_name\n    counter = 1\n    while os.path.exists(log_file_name):\n        log_file_name = f\"{base_name.split('.')[0]}_{counter}.log\"\n        counter += 1\n    return log_file_name\n", "entry_point": "generate_log_file_name", "input": "'pmx'", "output": "'pmx.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17156_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029679", "code": "from typing import Tuple\ndef process_text(text: str) -> Tuple[str, str]:\n    segmented = text.split(' ', 1)\n    prefix, remainder = segmented if len(segmented) == 2 else [text, '']\n    return prefix, remainder.lstrip()\n", "entry_point": "process_text", "input": "'you?'", "output": "('you?', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115436_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029680", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "8", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029681", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6147", "output": "{1, 2049, 3, 6147, 9, 683}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6146", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029682", "code": "def process_string(input_str):\n    if not input_str:\n        return 'EMPTY'\n    modified_str = ''\n    for i, char in enumerate(input_str[::-1]):\n        if char.isalpha():\n            if i % 2 == 1:\n                modified_str += char.upper()\n            else:\n                modified_str += char.lower()\n        else:\n            modified_str += char\n    return modified_str\n", "entry_point": "process_string", "input": "'Hello,'", "output": "',OlLeH'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48299_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029683", "code": "from typing import List\ndef sum_multiples_of_3_or_5(nums: List[int]) -> int:\n    unique_multiples = set()\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            unique_multiples.add(num)\n    return sum(unique_multiples)\n", "entry_point": "sum_multiples_of_3_or_5", "input": "[3, 5, 6, 9, 10, 12, 15]", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38269_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029684", "code": "def simulate_api_request(route, method, data=None):\n    routes = {\n        '/': 'index.html',\n        '/app.js': 'app.js',\n        '/favicon.ico': 'favicon.ico',\n        '/api/list': {'GET': lambda: {'puzzles': solvers.puzzle_list()}},\n        '/api/solve': {\n            'POST': lambda: {'pzprv3': solvers.solve(data['pzprv3'], data['different_from'])}\n        }\n    }\n    if route not in routes:\n        return '404 Not Found'\n    if method not in routes[route]:\n        return '405 Method Not Allowed'\n    if method == 'POST':\n        return routes[route][method]()\n    else:\n        return routes[route]\n", "entry_point": "simulate_api_request", "input": "'/api/list', 'POST'", "output": "'405 Method Not Allowed'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138582_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029685", "code": "def custom_multiply(*args):\n    if len(args) == 2 and all(isinstance(arg, int) for arg in args):\n        return args[0] * args[1]\n    elif len(args) == 1 and isinstance(args[0], int):\n        return args[0] * args[0]\n    else:\n        return -1\n", "entry_point": "custom_multiply", "input": "", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73921_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029686", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8357", "output": "{1, 137, 61, 8357}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8356", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029687", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[17, 17]", "output": "(17, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029688", "code": "def cleanInt(numberString):\n    exportString = \"\"\n    for char in numberString:\n        if char in \"1234567890+-\":\n            exportString += char\n    floatNumber = float(exportString)\n    roundedNumber = round(floatNumber)\n    return int(roundedNumber)\n", "entry_point": "cleanInt", "input": "'abc+125xyz'", "output": "125", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78207_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029689", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1492", "output": "{1, 2, 4, 746, 1492, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1491", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029690", "code": "from typing import List, Tuple\ndef process_numbers(numbers: List[int]) -> Tuple[int, int]:\n    count = 0\n    total_sum = 0\n    for num in numbers:\n        count += 1\n        total_sum += num\n        if num == 999:\n            break\n    return count - 1, total_sum - 999  # Adjusting count and sum for excluding the terminating 999\n", "entry_point": "process_numbers", "input": "[10, 10, 10, 999]", "output": "(3, 30)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24887_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029691", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6397", "output": "{1, 6397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6396", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029692", "code": "def calculate_probability_of_winning(N):\n    total_outcomes = N * N  # Total number of possible outcomes\n    favorable_outcomes = (N * (N - 1)) // 2  # Number of favorable outcomes for Player 1 to win\n    probability_of_winning = favorable_outcomes / total_outcomes\n    return probability_of_winning\n", "entry_point": "calculate_probability_of_winning", "input": "3", "output": "0.3333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126436_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029693", "code": "def play_card_game(player1_deck, player2_deck):\n    player1_score = 0\n    player2_score = 0\n    for card1, card2 in zip(player1_deck, player2_deck):\n        if card1 > card2:\n            player1_score += 1\n        elif card2 > card1:\n            player2_score += 1\n    if player1_score > player2_score:\n        return \"Player 1 wins\"\n    elif player2_score > player1_score:\n        return \"Player 2 wins\"\n    else:\n        return \"It's a tie\"\n", "entry_point": "play_card_game", "input": "[1, 1, 1], [1, 1, 1]", "output": "\"It's a tie\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147223_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029694", "code": "from collections import defaultdict\ndef find_original_song(alias):\n    music_aliases = {\n        'alias1': ['song1', 'song2'],\n        'alias2': ['song3']\n    }\n    original_songs = music_aliases.get(alias.lower(), [])\n    if original_songs:\n        return original_songs[0]\n    else:\n        return \"Alias not found\"\n", "entry_point": "find_original_song", "input": "'alias1'", "output": "'song1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5621_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029695", "code": "def MakePartition(block_dev, part):\n    \"\"\"Helper function to build Linux device path for storage partition.\"\"\"\n    return '%s%s%s' % (block_dev, 'p' if block_dev[-1].isdigit() else '', part)\n", "entry_point": "MakePartition", "input": "'sdnvnvme0n', 12", "output": "'sdnvnvme0n12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81264_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029696", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3988", "output": "{1, 2, 4, 997, 1994, 3988}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3987", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029697", "code": "from unittest import mock\nimport sys\ndef mock_modules(modules_to_mock):\n    mocked_modules = {}\n    for key in modules_to_mock:\n        for module_name in list(sys.modules.keys()):\n            if key in module_name:\n                mocked_modules[module_name] = mock.MagicMock()\n    return mocked_modules\n", "entry_point": "mock_modules", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91791_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029698", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "[-3, -3, -3, -2, -2, -2, 2, 4, -1]", "output": "{-3: 3, -2: 3, 2: 1, 4: 1, -1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029699", "code": "import time\ncache = {}\ncache_size = 5  # Define the maximum size of the cache\ndef get_page_content(path):\n    key = 'pages-' + path\n    if key in cache:\n        cache[key]['last_accessed'] = time.time()\n        return cache[key]['content']\n    else:\n        if len(cache) >= cache_size:\n            lru_page = min(cache, key=lambda x: cache[x]['last_accessed'])\n            del cache[lru_page]\n        # Simulating page content retrieval\n        content = f\"Content for {path}\"\n        cache[key] = {'content': content, 'last_accessed': time.time()}\n        return content\n", "entry_point": "get_page_content", "input": "'papat'", "output": "'Content for papat'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40365_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029700", "code": "def get_archive_name(host_system):\n    if host_system == \"windows\":\n        return 'jpegsr9c.zip'\n    else:\n        return 'jpegsrc.v9c.tar.gz'\n", "entry_point": "get_archive_name", "input": "'windows'", "output": "'jpegsr9c.zip'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78138_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029701", "code": "def remove_duplicates(data):\n    unique_set = set()\n    result = []\n    for item in data:\n        if item not in unique_set:\n            unique_set.add(item)\n            result.append(item)\n    return result\n", "entry_point": "remove_duplicates", "input": "[1, 5, 2, 0, 3]", "output": "[1, 5, 2, 0, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26227_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029702", "code": "def get_reward(win_type_nm):\n    if win_type_nm == 'jackpot':\n        return \"Congratulations! You've won the jackpot!\"\n    elif win_type_nm == 'bonus':\n        return \"Great job! You've earned a bonus reward!\"\n    elif win_type_nm == 'match':\n        return \"Nice! You've matched a win!\"\n    else:\n        return \"Sorry, no reward this time. Try again!\"\n", "entry_point": "get_reward", "input": "'jackpot'", "output": "\"Congratulations! You've won the jackpot!\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97895_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029703", "code": "def get_condition_val_str(metadata_row_list):\n    l = list(metadata_row_list.copy())\n    del l[0]\n    condition_str = \" \".join(l)\n    condition_str = condition_str.replace('\"', '')\n    condition_str = condition_str.replace(',', ' ')\n    return condition_str\n", "entry_point": "get_condition_val_str", "input": "['ignore', '1', '22', 'Z', '11', '1', '2', 'Z']", "output": "'1 22 Z 11 1 2 Z'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80310_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029704", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'mmylmdule'", "output": "'mmylmdule'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029705", "code": "def extract_user_name(default_user):\n    # Find the last occurrence of the word \"set\" in the string\n    set_index = default_user.rfind(\"set\")\n    # Extract the user name substring after the last occurrence of \"set\"\n    user_name = default_user[set_index + 3:].strip()\n    return user_name\n", "entry_point": "extract_user_name", "input": "'Please ensure to set tynibba,yet'", "output": "'tynibba,yet'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3523_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029706", "code": "def past(h, m, s):\n    return (3600 * h + 60 * m + s) * 1000\n", "entry_point": "past", "input": "-2, 31, 47", "output": "-5293000", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29543_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029707", "code": "def process_list(lst):\n    length = len(lst)\n    if length % 2 == 1:  # Odd number of elements\n        middle_index = length // 2\n        return lst[:middle_index] + lst[middle_index + 1:]\n    else:  # Even number of elements\n        middle_index = length // 2\n        return lst[:middle_index - 1] + lst[middle_index + 1:]\n", "entry_point": "process_list", "input": "[1, 2, 5, 42, 4, 3, 0]", "output": "[1, 2, 5, 4, 3, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52704_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029708", "code": "import re\ndef extract_unique_words(text):\n    # Convert text to lowercase\n    text = text.lower()\n    # Use regular expression to extract words excluding punctuation\n    words = re.findall(r'\\b\\w+\\b', text)\n    # Store unique words in a set\n    unique_words = set(words)\n    return list(unique_words)\n", "entry_point": "extract_unique_words", "input": "'wolhpytonloeld'", "output": "['wolhpytonloeld']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103279_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029709", "code": "from typing import List, Dict\ndef categorize_tests(tests: List[str]) -> Dict[str, List[str]]:\n    categorized_tests = {}\n    for test in tests:\n        first_letter = test[0].lower()\n        categorized_tests.setdefault(first_letter, []).append(test)\n    return categorized_tests\n", "entry_point": "categorize_tests", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113117_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029710", "code": "def product_except_current(nums):\n    n = len(nums)\n    left_products = [1] * n\n    right_products = [1] * n\n    result = [1] * n\n    # Calculate products of elements to the left of the current element\n    for i in range(1, n):\n        left_products[i] = left_products[i - 1] * nums[i - 1]\n    # Calculate products of elements to the right of the current element\n    for i in range(n - 2, -1, -1):\n        right_products[i] = right_products[i + 1] * nums[i + 1]\n    # Multiply left and right products to get the final result\n    for i in range(n):\n        result[i] = left_products[i] * right_products[i]\n    return result\n", "entry_point": "product_except_current", "input": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106050_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029711", "code": "def calculate_distance(steps):\n    distance = steps  # Each step corresponds to 1 unit distance\n    return distance\n", "entry_point": "calculate_distance", "input": "71", "output": "71", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92266_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029712", "code": "def count_character_occurrences(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_character_occurrences", "input": "'World!'", "output": "{'w': 1, 'o': 1, 'r': 1, 'l': 1, 'd': 1, '!': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87306_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029713", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1478", "output": "{1, 2, 739, 1478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029714", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[0, -2, 0, 2, -1, 0, 0, -1, 2]", "output": "[0, -1, 2, 5, 3, 5, 6, 6, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029715", "code": "import re\ndef extract_entities(text):\n    entities = {\n        'Apple': 'organization',\n        'Google': 'organization',\n        'Cupertino, California': 'location',\n        'Mountain View': 'location'\n    }\n    output = {}\n    sentences = re.split(r'[.!?]', text)\n    for sentence in sentences:\n        words = sentence.split()\n        for word in words:\n            entity_type = entities.get(word, None)\n            if entity_type:\n                output[word] = entity_type\n    return output\n", "entry_point": "extract_entities", "input": "'Apple is a tech company.'", "output": "{'Apple': 'organization'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_131495_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029716", "code": "def add_cache(l):\n    if \"cache=True\" in l:  # Check if \"cache=True\" already exists in the line\n        return l\n    if l.endswith('t'):  # If the line ends with 't', add \"(cache=True)\" directly after the line\n        l += \"(cache=True)\"\n    elif l.endswith(')') and \"cache\" not in l:  # If the line ends with ')' and does not contain \"cache\", add \",cache=True)\" before the closing parenthesis\n        l = l[:-1] + \",cache=True)\"\n    return l\n", "entry_point": "add_cache", "input": "'jit(nopython=True)'", "output": "'jit(nopython=True,cache=True)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43619_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029717", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2043", "output": "{1, 3, 227, 681, 9, 2043}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2042", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029718", "code": "def build_unique_users(queryset, ctype_as_string):\n    users = []\n    if ctype_as_string == 'comment':\n        for comment in queryset:\n            if comment.get('user') not in users:\n                users.append(comment.get('user'))\n    if ctype_as_string == 'contact':\n        for c in queryset:\n            if c.get('user') and c.get('user') not in users:\n                users.append(c.get('user'))\n    if not users:\n        return f\"Error finding content type: {ctype_as_string}\"\n    return users\n", "entry_point": "build_unique_users", "input": "[], 'coctaccct'", "output": "'Error finding content type: coctaccct'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120280_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029719", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5033", "output": "{1, 719, 5033, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5032", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029720", "code": "from typing import List, Dict\ndef count_unique_log_messages(logs: List[str]) -> Dict[str, int]:\n    unique_logs = {}\n    for log in logs:\n        log_lower = log.lower()\n        if log_lower in unique_logs:\n            unique_logs[log_lower] += 1\n        else:\n            unique_logs[log_lower] = 1\n    return {log: freq for log, freq in unique_logs.items()}\n", "entry_point": "count_unique_log_messages", "input": "['warninerrorg', 'R', 'Rr']", "output": "{'warninerrorg': 1, 'r': 1, 'rr': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61335_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029721", "code": "def max_non_adjacent_sum(scores):\n    if not scores:\n        return 0\n    include = scores[0]\n    exclude = 0\n    for i in range(1, len(scores)):\n        new_include = exclude + scores[i]\n        new_exclude = max(include, exclude)\n        include = new_include\n        exclude = new_exclude\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_sum", "input": "[90]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11847_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029722", "code": "from typing import List\ndef count_integer_frequency(input_list: List) -> dict:\n    frequency_dict = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in frequency_dict:\n                frequency_dict[element] += 1\n            else:\n                frequency_dict[element] = 1\n    return frequency_dict\n", "entry_point": "count_integer_frequency", "input": "[2, 2, 2, 2, 4, 0, 3, 3, 1]", "output": "{2: 4, 4: 1, 0: 1, 3: 2, 1: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13209_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029723", "code": "def latest_version(versions):\n    latest_version = None\n    for version in versions:\n        if latest_version is None:\n            latest_version = version\n        else:\n            current_major, current_minor, current_patch = map(int, version.split('.'))\n            latest_major, latest_minor, latest_patch = map(int, latest_version.split('.'))\n            if current_major > latest_major or \\\n                    (current_major == latest_major and current_minor > latest_minor) or \\\n                    (current_major == latest_major and current_minor == latest_minor and current_patch > latest_patch):\n                latest_version = version\n    return latest_version\n", "entry_point": "latest_version", "input": "['3.9.5', '4.0.0']", "output": "'4.0.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94924_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029724", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2192", "output": "{1, 2, 4, 548, 1096, 8, 137, 2192, 16, 274}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2191", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029725", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "557", "output": "{1, 557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029726", "code": "def binary_to_decimal(binary_str: str) -> int:\n    decimal_value = 0\n    for char in binary_str:\n        if char not in ['0', '1']:\n            raise ValueError(\"Input contains non-binary characters\")\n        decimal_value = decimal_value * 2 + int(char)\n    return decimal_value\n", "entry_point": "binary_to_decimal", "input": "'10010100'", "output": "148", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7509_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029727", "code": "def process_operations(initial_list, operations):\n    def add_value(lst, val):\n        return [num + val for num in lst]\n    def multiply_value(lst, val):\n        return [num * val for num in lst]\n    def reverse_list(lst):\n        return lst[::-1]\n    def negate_list(lst):\n        return [-num for num in lst]\n    operations = operations.split()\n    operations_iter = iter(operations)\n    result = initial_list.copy()\n    for op in operations_iter:\n        if op == 'A':\n            result = add_value(result, int(next(operations_iter)))\n        elif op == 'M':\n            result = multiply_value(result, int(next(operations_iter)))\n        elif op == 'R':\n            result = reverse_list(result)\n        elif op == 'N':\n            result = negate_list(result)\n    return result\n", "entry_point": "process_operations", "input": "[5, 3, 6, 5, 4, 5], ''", "output": "[5, 3, 6, 5, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117757_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029728", "code": "def counting_sort_modified(arr):\n    if not arr:\n        return arr\n    min_val = min(arr)\n    max_val = max(arr)\n    size = max_val - min_val + 1\n    counting_arr = [0] * size\n    for num in arr:\n        counting_arr[num - min_val] += 1\n    for i in range(1, size):\n        counting_arr[i] += counting_arr[i - 1]\n    sorted_arr = [0] * len(arr)\n    for num in reversed(arr):\n        sorted_arr[counting_arr[num - min_val] - 1] = num\n        counting_arr[num - min_val] -= 1\n    return sorted_arr\n", "entry_point": "counting_sort_modified", "input": "[-7, -7, -6, 10, 10, 10, 10, 8, 11]", "output": "[-7, -7, -6, 8, 10, 10, 10, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45483_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029729", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    top_scores = []\n    for score in scores:\n        if len(top_scores) < n:\n            top_scores.append(score)\n        else:\n            min_score = min(top_scores)\n            if score > min_score:\n                top_scores.remove(min_score)\n                top_scores.append(score)\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[70, 75, 80, 82, 86, 81], 4", "output": "82.25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65534_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029730", "code": "def calculate_execution_time(timestamps):\n    total_time = 0\n    for i in range(0, len(timestamps), 2):\n        total_time += timestamps[i + 1] - timestamps[i]\n    return total_time\n", "entry_point": "calculate_execution_time", "input": "[1, 5, 5, 10, 10, 16, 16, 17]", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57086_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029731", "code": "def min_trips(k, weights):\n    total_trips = sum((x + k - 1) // k for x in weights)\n    min_trips_needed = (total_trips + 1) // 2\n    return min_trips_needed\n", "entry_point": "min_trips", "input": "5, [5, 5, 5]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5487_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029732", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3076", "output": "{1, 2, 1538, 3076, 4, 769}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3075", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029733", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7547", "output": "{1, 7547}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7546", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029734", "code": "def sum_divisible(arr, divisor):\n    total_sum = 0\n    for row in arr:\n        for element in row:\n            if element % divisor == 0:\n                total_sum += element\n    return total_sum\n", "entry_point": "sum_divisible", "input": "[[10, 20], [20]], 10", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137508_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029735", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6649", "output": "{1, 109, 61, 6649}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029736", "code": "def generate_output_path(input_path):\n    if input_path.endswith(\".shp\"):\n        out_features = input_path[:-4] + \"_background\"\n    else:\n        out_features = input_path + \"_background\"\n    return out_features\n", "entry_point": "generate_output_path", "input": "'data/another_input'", "output": "'data/another_input_background'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50371_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029737", "code": "def plus_one(digits):\n    n = len(digits)\n    for i in range(n-1, -1, -1):\n        if digits[i] < 9:\n            digits[i] += 1\n            return digits\n        digits[i] = 0\n    new_num = [0] * (n+1)\n    new_num[0] = 1\n    return new_num\n", "entry_point": "plus_one", "input": "[9, 9, 9, 9, 9]", "output": "[1, 0, 0, 0, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123786_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029738", "code": "def calculate_sums(input_list, k):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - k + 1):\n        output_list.append(sum(input_list[i:i+k]))\n    return output_list\n", "entry_point": "calculate_sums", "input": "[1, 5, 8, 2, 7], 3", "output": "[14, 15, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144298_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029739", "code": "def process_list(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        if i < list_length - 1:\n            output_list.append(input_list[i] + input_list[i + 1])\n        else:\n            output_list.append(input_list[i] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[0, 1, 2, 1, 2, 4]", "output": "[1, 3, 3, 3, 6, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63579_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029740", "code": "from typing import List\ndef simulate_file_system(starting_dir: str, commands: List[str]) -> List[str]:\n    current_dir = starting_dir\n    result = [current_dir]\n    for command in commands:\n        if command.startswith(\"cd\"):\n            directory = command.split()[1]\n            current_dir += \"/\" + directory\n        elif command == \"pwd\":\n            result.append(current_dir)\n    return result\n", "entry_point": "simulate_file_system", "input": "'/hom', ['cd hoser', 'pwd']", "output": "['/hom', '/hom/hoser']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115898_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029741", "code": "def max_non_adjacent_score(scores):\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[10, 0, 15, 0, 12]", "output": "37", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26474_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029742", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5223", "output": "{1, 3, 1741, 5223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5222", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029743", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "925", "output": "{1, 5, 37, 185, 925, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt924", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029744", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7367", "output": "{1, 139, 53, 7367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7366", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029745", "code": "from typing import List\ndef minTime(machines: List[int], goal: int) -> int:\n    def countItems(machines, days):\n        total = 0\n        for machine in machines:\n            total += days // machine\n        return total\n    low = 1\n    high = max(machines) * goal\n    while low < high:\n        mid = (low + high) // 2\n        if countItems(machines, mid) < goal:\n            low = mid + 1\n        else:\n            high = mid\n    return low\n", "entry_point": "minTime", "input": "[2, 2, 2], 10", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117103_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029746", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num % 2 == 0:\n            processed_nums.append(num + 2)\n        elif num % 2 != 0:\n            processed_nums.append(num * 3)\n        if num % 5 == 0:\n            processed_nums[-1] -= 5\n    return processed_nums\n", "entry_point": "process_integers", "input": "[38, 2, 3, 16, 3, 4, 16, 16]", "output": "[40, 4, 9, 18, 9, 6, 18, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65994_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029747", "code": "def strip_strings(lst):\n    result = []\n    for s in lst:\n        result.append(s.strip())\n    return result\n", "entry_point": "strip_strings", "input": "['  hello  ', '  world  ', '  python  ']", "output": "['hello', 'world', 'python']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20526_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029748", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7551", "output": "{1, 3, 839, 9, 2517, 7551}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7550", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029749", "code": "def solution(i):\n    return float(i)\n", "entry_point": "solution", "input": "30", "output": "30.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18861_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029750", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6070", "output": "{1, 2, 5, 10, 6070, 3035, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6069", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029751", "code": "def sum_multiples_3_or_5(n: int) -> int:\n    total_sum = 0\n    for num in range(1, n):\n        if num % 3 == 0 or num % 5 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_3_or_5", "input": "6", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10997_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029752", "code": "def generate_pattern(n):\n    if n == 0:\n        return []\n    elif n == 1:\n        return [0]\n    elif n == 2:\n        return [0, 1]\n    pattern = [0, 1]\n    for i in range(2, n):\n        pattern.append(pattern[i-1] + pattern[i-2])\n    return pattern\n", "entry_point": "generate_pattern", "input": "8", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12709_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029753", "code": "def time_to_seconds(time: str) -> int:\n    time_split = time.split(\":\")\n    hours = int(time_split[0])\n    minutes = int(time_split[1])\n    seconds = int(time_split[2])\n    total_seconds = hours * 3600 + minutes * 60 + seconds\n    return total_seconds\n", "entry_point": "time_to_seconds", "input": "'02:20:53'", "output": "8453", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65110_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029754", "code": "def assign_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        else:\n            grades.append('C')\n    return grades\n", "entry_point": "assign_grades", "input": "[70, 90, 70, 85, 85, 85, 85, 90]", "output": "['C', 'A', 'C', 'B', 'B', 'B', 'B', 'A']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4885_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029755", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4829", "output": "{1, 11, 4829, 439}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4828", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029756", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4017", "output": "{1, 3, 39, 103, 13, 4017, 309, 1339}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4016", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029757", "code": "def calculate_min_max_sum(arr):\n    total_sum = sum(arr)\n    min_sum = total_sum - max(arr)\n    max_sum = total_sum - min(arr)\n    return min_sum, max_sum\n", "entry_point": "calculate_min_max_sum", "input": "[4, 5, 9]", "output": "(9, 14)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_17042_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029758", "code": "from typing import Dict, List, TypeVar, Union\nJsonTypeVar = TypeVar(\"JsonTypeVar\")\nJsonPrimitive = Union[str, float, int, bool, None]\nJsonDict = Dict[str, JsonTypeVar]\nJsonArray = List[JsonTypeVar]\nJson = Union[JsonPrimitive, JsonDict, JsonArray]\ndef count_primitive_values(json_data: Json) -> int:\n    count = 0\n    if isinstance(json_data, (str, float, int, bool, type(None))):\n        return 1\n    if isinstance(json_data, dict):\n        for value in json_data.values():\n            count += count_primitive_values(value)\n    elif isinstance(json_data, list):\n        for item in json_data:\n            count += count_primitive_values(item)\n    return count\n", "entry_point": "count_primitive_values", "input": "['hello', 42]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7551_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029759", "code": "def find_largest_number(int_list):\n    # Convert integers to strings for sorting\n    str_list = [str(num) for num in int_list]\n    # Custom sorting based on concatenation comparison\n    str_list.sort(key=lambda x: x*3, reverse=True)\n    # Join the sorted strings to form the largest number\n    max_num = \"\".join(str_list)\n    return max_num\n", "entry_point": "find_largest_number", "input": "[7, 6, 6, 4, 4, 3, 3]", "output": "'7664433'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86890_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029760", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "14", "output": "14", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029761", "code": "def log_message(message, level, threshold):\n    if level >= threshold:\n        return f\"{level}: {message}\"\n    return \"\"\n", "entry_point": "log_message", "input": "'gWgg', 7, 5", "output": "'7: gWgg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34813_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029762", "code": "def calculate_levenshtein_distance(ref_tokens, hyp_tokens):\n    dp = [[0 for _ in range(len(hyp_tokens) + 1)] for _ in range(len(ref_tokens) + 1)]\n    for i in range(len(ref_tokens) + 1):\n        dp[i][0] = i\n    for j in range(len(hyp_tokens) + 1):\n        dp[0][j] = j\n    for i in range(1, len(ref_tokens) + 1):\n        for j in range(1, len(hyp_tokens) + 1):\n            if ref_tokens[i - 1] == hyp_tokens[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1\n    return dp[len(ref_tokens)][len(hyp_tokens)]\n", "entry_point": "calculate_levenshtein_distance", "input": "['cat'], ['bat']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111342_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029763", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8167", "output": "{1, 8167}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8166", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029764", "code": "def convert_escape_sequences(input_string):\n    output_string = ''\n    i = 0\n    while i < len(input_string):\n        if input_string[i:i+2] == '\\\\33':\n            output_string += chr(27)  # ASCII escape character (ESC)\n            i += 2\n        elif input_string[i:i+2] == '\\\\?':\n            output_string += '?'\n            i += 2\n        else:\n            output_string += input_string[i]\n            i += 1\n    return output_string\n", "entry_point": "convert_escape_sequences", "input": "'H\\\\?25h5h'", "output": "'H?25h5h'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78537_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029765", "code": "from typing import List, Tuple\ndef card_game(deck1: List[int], deck2: List[int]) -> Tuple[int, int]:\n    score1, score2 = 0, 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            score1 += 1\n        elif card2 > card1:\n            score2 += 1\n    return score1, score2\n", "entry_point": "card_game", "input": "[2, 1], [1, 2]", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28513_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029766", "code": "from typing import List\ndef calculate_total_fishes(fishes: List[int], initial_fishes: int, days: int) -> int:\n    total_fishes = initial_fishes\n    for day in range(days):\n        total_fishes += fishes[day % len(fishes)]  # Use modulo to cycle through the growth pattern\n    return total_fishes\n", "entry_point": "calculate_total_fishes", "input": "[0], -1, 1", "output": "-1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55644_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029767", "code": "import re\nre_token = re.compile('([!#$%&\\'*+\\-.0-9A-Z^_`a-z|~]+)')\nre_qstring = re.compile(r'\"(([\\t !\\x23-\\x5b\\x5d-\\xff]|\\\\[\\x00-\\x7f])*)\"')\nre_qpair = re.compile(r'\\\\([\\x00-\\x7f])')\nre_qvalue = re.compile('[qQ]=(1(\\.0{0,3})?|0(\\.[0-9]{0,3})?)')\ndef parse_query_string(query):\n    tokens = []\n    pos = 0\n    while pos < len(query):\n        if query[pos] == '\"':\n            match = re_qstring.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        else:\n            match = re_token.match(query, pos)\n            if match:\n                tokens.append(match.group(1))\n                pos = match.end()\n        pos += 1\n    return tokens\n", "entry_point": "parse_query_string", "input": "''", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145846_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029768", "code": "import importlib\ndef execute_function_from_module(module_name, function_name, *args, **kwargs):\n    try:\n        module = importlib.import_module(module_name)\n        function = getattr(module, function_name)\n        return function(*args, **kwargs)\n    except ModuleNotFoundError:\n        return f\"Module '{module_name}' not found.\"\n    except AttributeError:\n        return f\"Function '{function_name}' not found in module '{module_name}'.\"\n", "entry_point": "execute_function_from_module", "input": "'tmat', 'some_function_name'", "output": "\"Module 'tmat' not found.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133564_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029769", "code": "from typing import List\ndef merge_sort(arr: List[int]) -> List[int]:\n    def merge(arr, l, m, r):\n        n1 = m - l + 1\n        n2 = r - m\n        L = arr[l:m + 1]\n        R = arr[m + 1:r + 1]\n        i = j = 0\n        k = l\n        while i < n1 and j < n2:\n            if L[i] <= R[j]:\n                arr[k] = L[i]\n                i += 1\n            else:\n                arr[k] = R[j]\n                j += 1\n            k += 1\n        while i < n1:\n            arr[k] = L[i]\n            i += 1\n            k += 1\n        while j < n2:\n            arr[k] = R[j]\n            j += 1\n            k += 1\n    def merge_sort_helper(arr, l, r):\n        if l < r:\n            m = (l + r) // 2\n            merge_sort_helper(arr, l, m)\n            merge_sort_helper(arr, m + 1, r)\n            merge(arr, l, m, r)\n    merge_sort_helper(arr, 0, len(arr) - 1)\n    return arr\n", "entry_point": "merge_sort", "input": "[3, 8, 8, 9, 26, 26, 27, 82]", "output": "[3, 8, 8, 9, 26, 26, 27, 82]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25059_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029770", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[2, 6, 4, 3, 3, 9, 3, 3, 3]", "output": "[2, 6, 4, 3, 3, 9, 3, 3, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029771", "code": "def extract_major_version(version: str) -> int:\n    dot_index = version.find('.')\n    if dot_index == -1:\n        return int(version)\n    return int(version[:dot_index])\n", "entry_point": "extract_major_version", "input": "'1001'", "output": "1001", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116121_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029772", "code": "def average_top_scores(scores, N):\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if not top_scores:\n        return 0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[85.0, 85.5, 86.0], 3", "output": "85.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59721_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029773", "code": "def extract_file_name(file_path):\n    # Split the file path using the '/' delimiter\n    path_elements = file_path.split('/')\n    # Extract the file name with extension from the last element of the split list\n    file_name = path_elements[-1]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/folderA/folderB/pathexampetxt'", "output": "'pathexampetxt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100013_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029774", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4015", "output": "{1, 803, 5, 73, 11, 365, 4015, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4014", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029775", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1270", "output": "{1, 2, 5, 10, 1270, 635, 254, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1269", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029776", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1118", "output": "{1, 2, 43, 13, 559, 86, 26, 1118}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1117", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029777", "code": "# Define the function to set pin properties\ndef set_pin_property(pin, property, value):\n    # Hypothetical function to check if the pin is valid\n    def isValidPin(pin):\n        # Assume implementation here\n        pass\n    # Check if the pin is valid\n    if not isValidPin(pin):\n        return {'response': 'InvalidPin', 'pin': pin}\n    # Determine the mode value based on the property type\n    mode = None\n    if property == 'mode':\n        mode = 'GPIO.' + str(value)\n    # Return the dictionary with the action or error response\n    return {'response': 'PropertySet', 'pin': pin, 'mode': mode, 'value': value}\n", "entry_point": "set_pin_property", "input": "19, 'mode', 0", "output": "{'response': 'InvalidPin', 'pin': 19}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89131_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029778", "code": "def correct_typo(code_snippet):\n    corrected_code = code_snippet.replace('install_requireent', 'install_requires')\n    return corrected_code\n", "entry_point": "correct_typo", "input": "']'", "output": "']'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26763_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029779", "code": "import os\nUPLOAD_PREFIX = 'App/static/'\nUPLOAD_DIR = 'uploads/'\ndef generate_file_path(file_name):\n    # Sanitize the file name by removing spaces and special characters\n    sanitized_file_name = ''.join(c for c in file_name if c.isalnum() or c in ['.', '_', '-'])\n    # Generate the initial file path\n    file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    # Check if the file path already exists, if so, modify the file name to make it unique\n    while os.path.exists(file_path):\n        base_name, extension = os.path.splitext(sanitized_file_name)\n        base_name += '_copy'\n        sanitized_file_name = base_name + extension\n        file_path = os.path.join(UPLOAD_PREFIX, UPLOAD_DIR, sanitized_file_name)\n    return file_path\n", "entry_point": "generate_file_path", "input": "'fillte'", "output": "'App/static/uploads/fillte'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116703_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029780", "code": "from typing import List, Optional\ndef validate_patient_ages(ages: List[Optional[int]]) -> List[bool]:\n    validations = []\n    for age in ages:\n        if age is None:\n            validations.append(True)\n        elif isinstance(age, int) and 1 <= age <= 100:\n            validations.append(True)\n        else:\n            validations.append(False)\n    return validations\n", "entry_point": "validate_patient_ages", "input": "[None, 50, 150, None]", "output": "[True, True, False, True]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16067_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029781", "code": "def calculate_average_score(scores):\n    total_score = 0\n    if not scores:\n        return 0\n    for score in scores:\n        total_score += score\n    average_score = total_score / len(scores)\n    return average_score\n", "entry_point": "calculate_average_score", "input": "[92, 92, 92, 92, 92]", "output": "92.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81933_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029782", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1070", "output": "{1, 2, 5, 10, 107, 1070, 214, 535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1069", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029783", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8961", "output": "{1, 8961, 3, 103, 2987, 309, 87, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8960", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029784", "code": "def custom_product_list(lst):\n    total_product = 1\n    for num in lst:\n        total_product *= num\n    result = [total_product // num for num in lst]\n    return result\n", "entry_point": "custom_product_list", "input": "[4, 5, 1, 2, 3]", "output": "[30, 24, 120, 60, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81118_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029785", "code": "from typing import List, Tuple\ndef is_tree(network: List[Tuple[int, int]]) -> bool:\n    if len(network) != len(set(network)):\n        return False  # Check for duplicate connections\n    parent = {}\n    nodes = set()\n    for node1, node2 in network:\n        parent[node2] = node1\n        nodes.add(node1)\n        nodes.add(node2)\n    if len(parent) != len(nodes) - 1:\n        return False  # Check for correct number of edges\n    def dfs(node, visited):\n        if node in visited:\n            return False\n        visited.add(node)\n        for child in parent.keys():\n            if parent[child] == node:\n                if not dfs(child, visited):\n                    return False\n        return True\n    visited = set()\n    if not dfs(list(nodes)[0], visited):\n        return False\n    return len(visited) == len(nodes)\n", "entry_point": "is_tree", "input": "[(1, 2), (2, 3)]", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13267_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029786", "code": "from typing import Tuple\ndef parse_file_path(file_path: str) -> Tuple[str, str]:\n    # Find the last occurrence of '/' in the file path\n    last_slash_index = file_path.rfind('/')\n    # Extract the directory path and file name\n    directory_path = file_path[:last_slash_index]\n    file_name = file_path[last_slash_index + 1:]\n    return directory_path, file_name\n", "entry_point": "parse_file_path", "input": "'C:/Users/Docus/exam'", "output": "('C:/Users/Docus', 'exam')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97231_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029787", "code": "def extract_filename(log_location: str) -> str:\n    # Find the last occurrence of '/' to identify the start of the filename\n    start_index = log_location.rfind('/') + 1\n    # Find the position of the '.' before the extension\n    end_index = log_location.rfind('.')\n    # Extract the filename between the last '/' and the '.'\n    filename = log_location[start_index:end_index]\n    return filename\n", "entry_point": "extract_filename", "input": "'/path/to/plogtt.txt'", "output": "'plogtt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13809_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029788", "code": "def calculate_ir2(r2, dr):\n    if dr == 0:\n        raise ValueError(\"Division by zero is not allowed.\")\n    ir2 = r2 / dr\n    return ir2\n", "entry_point": "calculate_ir2", "input": "2.5, 1", "output": "2.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79345_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029789", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4451", "output": "{1, 4451}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4450", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029790", "code": "def determine_game_winner(deck_a, deck_b):\n    rounds_won_a = 0\n    rounds_won_b = 0\n    for card_a, card_b in zip(deck_a, deck_b):\n        if card_a > card_b:\n            rounds_won_a += 1\n        elif card_b > card_a:\n            rounds_won_b += 1\n    if rounds_won_a > rounds_won_b:\n        return 'Player A'\n    elif rounds_won_b > rounds_won_a:\n        return 'Player B'\n    else:\n        return 'Tie'\n", "entry_point": "determine_game_winner", "input": "[3, 5, 7], [1, 2, 3]", "output": "'Player A'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12773_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029791", "code": "import shlex\ndef split(s):\n    if '\"' not in s:\n        return s.split(' ')\n    try:\n        return list(shlex.split(s))\n    except ValueError:\n        return None\n", "entry_point": "split", "input": "'codpythote'", "output": "['codpythote']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129262_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029792", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[79], 1", "output": "79.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59091_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029793", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3806", "output": "{1, 2, 11, 173, 1903, 22, 346, 3806}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3805", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029794", "code": "def generate_cache_key(identifier):\n    VCODE_KEY = 'VCode-%s'\n    cache_key = VCODE_KEY % identifier\n    return cache_key\n", "entry_point": "generate_cache_key", "input": "'51234512345'", "output": "'VCode-51234512345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133592_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029795", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(10, 10, 20, 21, 9, 10, 20, 41)", "output": "(41, 20, 10, 9, 21, 20, 10, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029796", "code": "def minimize_waiting_time(models):\n    models.sort()  # Sort models based on training time in ascending order\n    total_waiting_time = 0\n    current_time = 0\n    for model_time in models:\n        total_waiting_time += current_time\n        current_time += model_time\n    return total_waiting_time\n", "entry_point": "minimize_waiting_time", "input": "[4, 4, 4, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57803_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029797", "code": "def increment_version(version):\n    x, y, z = map(int, version.split('.'))\n    z += 1\n    if z == 10:\n        z = 0\n        y += 1\n        if y == 10:\n            y = 0\n            x += 1\n    return f'{x}.{y}.{z}'\n", "entry_point": "increment_version", "input": "'2.5.1'", "output": "'2.5.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116395_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029798", "code": "def split_video_names(video_files, threshold):\n    long_names = []\n    short_names = []\n    for video_file in video_files:\n        file_name, extension = video_file.split('.')\n        if len(file_name) >= threshold:\n            long_names.append(file_name)\n        else:\n            short_names.append(file_name)\n    return long_names, short_names\n", "entry_point": "split_video_names", "input": "['video3.mp4', 'my_l_vie.mkv'], 9", "output": "([], ['video3', 'my_l_vie'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9323_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029799", "code": "from collections import defaultdict\ndef process_dependencies(dependency_pairs):\n    num_heads = defaultdict(int)\n    tails = defaultdict(list)\n    heads = []\n    for h, t in dependency_pairs:\n        num_heads[t] += 1\n        if h in tails:\n            tails[h].append(t)\n        else:\n            tails[h] = [t]\n            heads.append(h)\n    ordered = [h for h in heads if h not in num_heads]\n    for h in ordered:\n        for t in tails[h]:\n            num_heads[t] -= 1\n            if not num_heads[t]:\n                ordered.append(t)\n    cyclic = [n for n, heads in num_heads.items() if heads]\n    return ordered, cyclic\n", "entry_point": "process_dependencies", "input": "[(100, 200), (200, 300), (300, 400), (400, 100)]", "output": "([], [200, 300, 400, 100])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128375_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029800", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7354", "output": "{1, 7354, 2, 3677}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7353", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029801", "code": "from typing import List\ndef sum_double_duplicates(lst: List[int]) -> int:\n    element_freq = {}\n    total_sum = 0\n    # Count the frequency of each element in the list\n    for num in lst:\n        element_freq[num] = element_freq.get(num, 0) + 1\n    # Calculate the sum considering duplicates\n    for num, freq in element_freq.items():\n        if freq > 1:\n            total_sum += num * 2 * freq\n        else:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_double_duplicates", "input": "[2, 3, 3, 5]", "output": "19", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21856_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029802", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "2, 12, 3", "output": "[2, 5, 8, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029803", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4283", "output": "{1, 4283}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4282", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029804", "code": "from typing import List\ndef transform_list(original_list: List[int]) -> List[int]:\n    return [num + index for index, num in enumerate(original_list)]\n", "entry_point": "transform_list", "input": "[5, 2, 1, 4]", "output": "[5, 3, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102122_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029805", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1454", "output": "{1, 2, 1454, 727}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1453", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029806", "code": "def find_modes(data):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in data:\n        frequency_dict[num] = frequency_dict.get(num, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[3, 3, 5, 5, 1]", "output": "[3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69194_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029807", "code": "from typing import List, Tuple\n# Custom exceptions defined as in the code snippet\ncustom_exceptions = {\n    \"mil.\": \"milion\",\n    \"wob.\": \"wobydler\",\n    \"resp.\": \"resp.\"\n}\ndef custom_tokenizer(text: str) -> List[Tuple[str, str]]:\n    tokens = []\n    words = text.split()\n    for word in words:\n        if word in custom_exceptions:\n            tokens.append((word, custom_exceptions[word]))\n        else:\n            tokens.append((word, word))  # If no exception, use the word itself\n    return tokens\n", "entry_point": "custom_tokenizer", "input": "'r.respmesp.e'", "output": "[('r.respmesp.e', 'r.respmesp.e')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64113_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029808", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9955", "output": "{1, 9955, 5, 1991, 905, 11, 181, 55}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9954", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029809", "code": "from typing import List\ndef countConstruct(target: str, wordBank: List[str]) -> int:\n    ways = [0] * (len(target) + 1)\n    ways[0] = 1\n    for i in range(len(target)):\n        if ways[i] > 0:\n            for word in wordBank:\n                if target[i:i+len(word)] == word:\n                    ways[i+len(word)] += ways[i]\n    return ways[len(target)]\n", "entry_point": "countConstruct", "input": "'hello', ['hell', 'o']", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94402_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029810", "code": "def merge_metadata(default_metadata, additional_metadata):\n    merged_metadata = default_metadata.copy()\n    for key, value in additional_metadata.items():\n        merged_metadata[key] = value\n    return merged_metadata\n", "entry_point": "merge_metadata", "input": "{}, {}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134168_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029811", "code": "def extract_command_and_text(message):\n    # Find the index of the first space after \"!addcom\"\n    start_index = message.find(\"!addcom\") + len(\"!addcom\") + 1\n    # Extract the command by finding the index of the first space after the command\n    end_index_command = message.find(\" \", start_index)\n    command = message[start_index:end_index_command]\n    # Extract the text by finding the index of the first space after the command\n    text = message[end_index_command+1:]\n    return command, text\n", "entry_point": "extract_command_and_text", "input": "'!addcom  usage:re'", "output": "('', 'usage:re')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33793_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029812", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8434", "output": "{4217, 1, 8434, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8433", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029813", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5899", "output": "{1, 347, 5899, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5898", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029814", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'07:05:09 AM'", "output": "'07:05:09'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029815", "code": "from typing import List\nUNET3D_MIN_ACCURACY = 0.90\nUNET3D_MAX_ACCURACY = 0.98\ndef calculate_average_accuracy(accuracy_values: List[float]) -> float:\n    sum_accuracy = 0\n    count = 0\n    for accuracy in accuracy_values:\n        if UNET3D_MIN_ACCURACY <= accuracy <= UNET3D_MAX_ACCURACY:\n            sum_accuracy += accuracy\n            count += 1\n    if count == 0:\n        return 0  # Return 0 if no valid accuracies found to avoid division by zero\n    return sum_accuracy / count\n", "entry_point": "calculate_average_accuracy", "input": "[0.94, 0.94, 0.96]", "output": "0.9466666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25983_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029816", "code": "def postprocess_list(input_list):\n    postprocessed_list = []\n    for index, value in enumerate(input_list):\n        postprocessed_list.append(value + index)\n    return postprocessed_list\n", "entry_point": "postprocess_list", "input": "[3, 8, 2, 9, 2, 2, 6, 7]", "output": "[3, 9, 4, 12, 6, 7, 12, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135116_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029817", "code": "SDL_HAT_CENTERED = 0x00\nSDL_HAT_UP = 0x01\nSDL_HAT_RIGHT = 0x02\nSDL_HAT_DOWN = 0x04\nSDL_HAT_LEFT = 0x08\nSDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP\nSDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN\nSDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP\nSDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN\ndef simulate_joystick_movement(current_position, direction):\n    if direction == 'UP':\n        return SDL_HAT_UP if current_position not in [SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_LEFTUP] else current_position\n    elif direction == 'RIGHT':\n        return SDL_HAT_RIGHT if current_position not in [SDL_HAT_RIGHT, SDL_HAT_RIGHTUP, SDL_HAT_RIGHTDOWN] else current_position\n    elif direction == 'DOWN':\n        return SDL_HAT_DOWN if current_position not in [SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN, SDL_HAT_LEFTDOWN] else current_position\n    elif direction == 'LEFT':\n        return SDL_HAT_LEFT if current_position not in [SDL_HAT_LEFT, SDL_HAT_LEFTUP, SDL_HAT_LEFTDOWN] else current_position\n    else:\n        return current_position\n", "entry_point": "simulate_joystick_movement", "input": "0, 'UP'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77291_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029818", "code": "def remove_non_alphanumeric(input_str):\n    result = ''\n    for char in input_str:\n        if char.isalnum() or char == '_':\n            result += char\n    return result\n", "entry_point": "remove_non_alphanumeric", "input": "'hello!@#hello*()hell3'", "output": "'hellohellohell3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139297_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029819", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7737", "output": "{2579, 1, 3, 7737}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7736", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029820", "code": "def count_frequency(input_list):\n    frequency_dict = {}  # Initialize an empty dictionary\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 1, 1, 5, 4, 4]", "output": "{1: 3, 5: 1, 4: 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54055_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029821", "code": "def assign_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        else:\n            grades.append('C')\n    return grades\n", "entry_point": "assign_grades", "input": "[70, 85, 82, 90, 75, 75, 75]", "output": "['C', 'B', 'B', 'A', 'C', 'C', 'C']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4885_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029822", "code": "def filter_integers_above_m(lst, m):\n    result = [num for num in lst if num > m]\n    return result\n", "entry_point": "filter_integers_above_m", "input": "[10, 12, 12, 12, 5], 11", "output": "[12, 12, 12]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48543_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029823", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7949", "output": "{1, 7949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7948", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029824", "code": "import re\ndef extract_urls_and_emails(text):\n    protocol = u\"(?:http|ftp|news|nntp|telnet|gopher|wais|file|prospero)\"\n    mailto = u\"mailto\"\n    url_body = u\"\\S+[0-9A-Za-z/]\"\n    url = u\"<?(?:{0}://|{1}:|www\\.){2}>?\".format(protocol, mailto, url_body)\n    url_re = re.compile(url, re.I)\n    localpart_border = u\"[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~]\"\n    localpart_inside = u\"[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~.]\"\n    localpart = u\"{0}{1}*\".format(localpart_border, localpart_inside)\n    subdomain_start = u\"[A-Za-z]\"\n    subdomain_inside = u\"[A-Za-z0-9\\\\-]\"\n    subdomain_end = u\"[A-Za-z0-9]\"\n    subdomain = u\"{0}{1}*{2}\".format(subdomain_start, subdomain_inside, subdomain_end)\n    domain = u\"{0}(?:\\\\.{1})*\".format(subdomain, subdomain)\n    email_str = u\"{0}@{1}\".format(localpart, domain)\n    email_re = re.compile(email_str)\n    urls = url_re.findall(text)\n    emails = email_re.findall(text)\n    return urls + emails\n", "entry_point": "extract_urls_and_emails", "input": "'http://www.empll.um'", "output": "['http://www.empll.um']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34293_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029825", "code": "def add_index_to_element(lst):\n    result = []\n    for i in range(len(lst)):\n        result.append(lst[i] + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 7, -1, 3, 0, 0, 0]", "output": "[2, 8, 1, 6, 4, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141376_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029826", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'paragrap.'", "output": "'<p>paragrap.</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029827", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9833", "output": "{1, 9833}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9832", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029828", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2876", "output": "{1, 2, 4, 719, 2876, 1438}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2875", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029829", "code": "from math import factorial\ndef numcombi(n, r):\n    ret = 1\n    for i in range(r):\n        ret = ret * (n - i)\n    return int(ret / factorial(r))\n", "entry_point": "numcombi", "input": "38, 10", "output": "472733756", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84953_ipt477", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029830", "code": "from typing import Dict\ndef extract_translations(translations_str: str) -> Dict[str, str]:\n    translations = {}\n    segments = translations_str.split(',')\n    for segment in segments:\n        lang, trans = segment.split(':')\n        translations[lang.strip()] = trans.strip()\n    return translations\n", "entry_point": "extract_translations", "input": "'English: Hchur'", "output": "{'English': 'Hchur'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113559_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029831", "code": "def fibonacci_recursive(n):\n    ''' Returns the nth Fibonacci number using a recursive approach. '''\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n", "entry_point": "fibonacci_recursive", "input": "7", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39667_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029832", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1025", "output": "b'\\x00\\x00\\x04\\x01'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029833", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[0, -2, 8]", "output": "-16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029834", "code": "import re\nfrom typing import List\ndef extract_words(text: str) -> List[str]:\n    pattern = r'\\b[a-z][a-z]{3,}y\\b'  # Define the pattern using regular expression\n    words = re.findall(pattern, text)  # Find all words matching the pattern\n    unique_words = list(set(words))    # Get unique words\n    return unique_words\n", "entry_point": "extract_words", "input": "'This text contains sysunny.'", "output": "['sysunny']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132295_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029835", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[5, 3, 3, 3, 3]", "output": "405", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029836", "code": "def highest_product_of_three(list_of_ints):\n    if len(list_of_ints) < 3:\n        raise ValueError(\"Input list must contain at least three integers\")\n    lowest = min(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    highest = max(list_of_ints[0], list_of_ints[1], list_of_ints[2])\n    lowest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_two = list_of_ints[0] * list_of_ints[1]\n    highest_product_of_three = list_of_ints[0] * list_of_ints[1] * list_of_ints[2]\n    for i in range(2, len(list_of_ints)):\n        current = list_of_ints[i]\n        highest_product_of_three = max(highest_product_of_three,\n                                       current * highest_product_of_two,\n                                       current * lowest_product_of_two)\n        highest_product_of_two = max(highest_product_of_two,\n                                     current * highest,\n                                     current * lowest)\n        lowest_product_of_two = min(lowest_product_of_two,\n                                    current * highest,\n                                    current * lowest)\n        highest = max(highest, current)\n        lowest = min(lowest, current)\n    return highest_product_of_three\n", "entry_point": "highest_product_of_three", "input": "[5, 6, 10]", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128534_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029837", "code": "def longest_palindromic_substring(s):\n    size = len(s)\n    if size < 2:\n        return s\n    dp = [[False for _ in range(size)] for _ in range(size)]\n    maxLen = 1\n    start = 0\n    for j in range(1, size):\n        for i in range(0, j):\n            if s[i] == s[j]:\n                if j - i <= 2:\n                    dp[i][j] = True\n                else:\n                    dp[i][j] = dp[i + 1][j - 1]\n            if dp[i][j]:\n                curLen = j - i + 1\n                if curLen > maxLen:\n                    maxLen = curLen\n                    start = i\n    return s[start : start + maxLen]\n", "entry_point": "longest_palindromic_substring", "input": "'b'", "output": "'b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74617_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029838", "code": "from urllib.parse import quote\ndef quote_filepath(url):\n    if '://' in url:\n        scheme, _, path = url.partition('://')\n    else:\n        scheme = ''\n        path = url\n    encoded_path = quote(path)\n    return '{}{}'.format(scheme, encoded_path)\n", "entry_point": "quote_filepath", "input": "'spaceshttpswww.exwithth spcs'", "output": "'spaceshttpswww.exwithth%20spcs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39859_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029839", "code": "def generate_permutations(input_string):\n    if len(input_string) == 1:\n        return [input_string]\n    permutations = []\n    for i, char in enumerate(input_string):\n        remaining_chars = input_string[:i] + input_string[i+1:]\n        for perm in generate_permutations(remaining_chars):\n            permutations.append(char + perm)\n    return permutations\n", "entry_point": "generate_permutations", "input": "'b'", "output": "['b']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_90222_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029840", "code": "def calculate_submatrix_sum(ca, i, j):\n    n = len(ca)\n    m = len(ca[0])\n    prefix_sum = [[0 for _ in range(m)] for _ in range(n)]\n    for row in range(n):\n        for col in range(m):\n            prefix_sum[row][col] = ca[row][col]\n            if row > 0:\n                prefix_sum[row][col] += prefix_sum[row - 1][col]\n            if col > 0:\n                prefix_sum[row][col] += prefix_sum[row][col - 1]\n            if row > 0 and col > 0:\n                prefix_sum[row][col] -= prefix_sum[row - 1][col - 1]\n    submatrix_sum = prefix_sum[i][j]\n    return submatrix_sum\n", "entry_point": "calculate_submatrix_sum", "input": "[[5, 6], [1, 0], [2, 2]], 1, 1", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72883_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029841", "code": "def generate_fibonacci(limit):\n    fibonacci_sequence = []\n    a, b = 0, 1\n    while a <= limit:\n        fibonacci_sequence.append(a)\n        a, b = b, a + b\n    return fibonacci_sequence\n", "entry_point": "generate_fibonacci", "input": "0", "output": "[0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4928_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029842", "code": "def calculate_average_position(points):\n    sum_x, sum_y, sum_z = 0, 0, 0\n    total_points = len(points)\n    for point in points:\n        sum_x += point[0]\n        sum_y += point[1]\n        sum_z += point[2]\n    avg_x = sum_x / total_points\n    avg_y = sum_y / total_points\n    avg_z = sum_z / total_points\n    return (avg_x, avg_y, avg_z)\n", "entry_point": "calculate_average_position", "input": "[(4, 5, 6), (4, 5, 6), (4, 5, 6)]", "output": "(4.0, 5.0, 6.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24711_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029843", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    translator = str.maketrans('', '', string.punctuation)\n    words = text.translate(translator).lower().split()\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'ttthis ttthis ttthis'", "output": "['ttthis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46682_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029844", "code": "def calculate_time_elapsed(start_time, end_time):\n    total_seconds = end_time - start_time\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return hours, minutes, seconds\n", "entry_point": "calculate_time_elapsed", "input": "0, 7199", "output": "(1, 59, 59)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87493_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029845", "code": "# Define the process_raster_files function\ndef process_raster_files(outdir=None, pixel_type=None, filelist=[]):\n    # Initialize necessary lists\n    mosaiclist = []\n    yearlist = []\n    daylist = []\n    productlist = []\n    tilelist = []\n    suffixlist = []\n    output_filelist = []\n    # Process the input parameters\n    if outdir is not None:\n        OUT = outdir\n    if pixel_type is None:\n        pixel_type = \"32_BIT_FLOAT\"\n    # Process the filelist\n    # Placeholder logic for filelist processing\n    for file in filelist:\n        # Placeholder processing steps\n        mosaiclist.append(\"mosaic_\" + file)\n        yearlist.append(\"year_\" + file)\n        daylist.append(\"day_\" + file)\n        productlist.append(\"product_\" + file)\n        tilelist.append(\"tile_\" + file)\n        suffixlist.append(\"suffix_\" + file)\n        output_filelist.append(\"output_\" + file)\n    # Return the processed lists\n    return mosaiclist, yearlist, daylist, productlist, tilelist, suffixlist, output_filelist\n", "entry_point": "process_raster_files", "input": "outdir=None, pixel_type=None, filelist=[]", "output": "([], [], [], [], [], [], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146900_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029846", "code": "def calculate_total_duration(song_durations):\n    total_seconds = sum(song_durations)\n    hours = total_seconds // 3600\n    minutes = (total_seconds % 3600) // 60\n    seconds = total_seconds % 60\n    return f\"{hours}:{minutes:02d}:{seconds:02d}\"\n", "entry_point": "calculate_total_duration", "input": "[1200, 600, 533]", "output": "'0:38:53'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124405_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029847", "code": "def fibonacci_iterative(num):\n    if num <= 0:\n        return None\n    if num == 1:\n        return 0\n    if num == 2:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, num):\n        a, b = b, a + b\n    return b\n", "entry_point": "fibonacci_iterative", "input": "9", "output": "21", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73606_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029848", "code": "def process_query(query: str, operator: str) -> dict:\n    parts = [x.strip() for x in operator.split(query)]\n    assert len(parts) in (1, 3), \"Invalid query format\"\n    query_key = parts[0]\n    result = {query_key: {}}\n    return result\n", "entry_point": "process_query", "input": "' ', '=='", "output": "{'==': {}}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13586_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029849", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:  # If the number is even\n            processed_list.append(num * 2)\n        else:  # If the number is odd\n            processed_list.append(num ** 2)\n    return sorted(processed_list)\n", "entry_point": "process_integers", "input": "[0, 0, 1, 4, 5, 7, 9, 9]", "output": "[0, 0, 1, 8, 25, 49, 81, 81]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137588_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029850", "code": "import json\ndef execute_and_format_result(input_data):\n    try:\n        result = eval(input_data)\n        if type(result) in [list, dict]:\n            return json.dumps(result, indent=4)\n        else:\n            return result\n    except Exception as e:\n        return f\"Error: {str(e)}\"\n", "entry_point": "execute_and_format_result", "input": "'(11,)'", "output": "(11,)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97741_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029851", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9535", "output": "{1, 1907, 5, 9535}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9534", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029852", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "631", "output": "{1, 631}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt630", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029853", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4881", "output": "{1, 1627, 3, 4881}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4880", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029854", "code": "def add_five_to_list(input_list):\n    result_list = []\n    for num in input_list:\n        result_list.append(num + 5)\n    return result_list\n", "entry_point": "add_five_to_list", "input": "[2, 4, 4, 1, 4]", "output": "[7, 9, 9, 6, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86115_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029855", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalpha():  # Check if the character is a letter\n            if char_lower in char_count:\n                char_count[char_lower] += 1\n            else:\n                char_count[char_lower] = 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'woorld'", "output": "{'w': 1, 'o': 2, 'r': 1, 'l': 1, 'd': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24964_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029856", "code": "def look_and_say(n):\n    result = \"1\"\n    for _ in range(2, n + 1):\n        next_term = \"\"\n        count = 1\n        for i in range(1, len(result)):\n            if result[i] == result[i - 1]:\n                count += 1\n            else:\n                next_term += str(count) + result[i - 1]\n                count = 1\n        next_term += str(count) + result[-1]\n        result = next_term\n    return result\n", "entry_point": "look_and_say", "input": "4", "output": "'1211'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51234_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029857", "code": "DRIVERS = {\n    \"ios\": \"cisco_ios\",\n    \"nxos\": \"cisco_nxos\",\n    \"nxos_ssh\": \"cisco_nxos\",\n    \"eos\": \"arista_eos\",\n    \"junos\": \"juniper_junos\",\n    \"iosxr\": \"cisco_xr\",\n}\ndef get_netmiko_driver(device_type):\n    return DRIVERS.get(device_type)\n", "entry_point": "get_netmiko_driver", "input": "'ios'", "output": "'cisco_ios'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94921_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029858", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "2, 11", "output": "22", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029859", "code": "def reconstruct_string(freq_list):\n    char_freq = {}\n    # Create a dictionary mapping characters to their frequencies\n    for i, freq in enumerate(freq_list):\n        char_freq[chr(i)] = freq\n    # Sort the characters by their ASCII values\n    sorted_chars = sorted(char_freq.keys())\n    result = \"\"\n    # Reconstruct the string based on the frequency list\n    for char in sorted_chars:\n        result += char * char_freq[char]\n    return result\n", "entry_point": "reconstruct_string", "input": "[1, 1, 2, 3, 1, 2, 1]", "output": "'\\x00\\x01\\x02\\x02\\x03\\x03\\x03\\x04\\x05\\x05\\x06'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49716_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029860", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'mdimeupow', 0, 1", "output": "\"Error: Invalid operation type 'mdimeupow'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029861", "code": "def calculate_total_thickness(ply_thickness, stacking_sequence, num_plies):\n    total_thickness = 0\n    for angle in stacking_sequence:\n        total_thickness += ply_thickness * num_plies\n    return total_thickness\n", "entry_point": "calculate_total_thickness", "input": "10.0, [0, 15, 30, 45], -4.003674675", "output": "-160.146987", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40077_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029862", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4211", "output": "{1, 4211}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4210", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029863", "code": "def generate_abi_path(contractname):\n    contracts_dir = \"contracts\"\n    abi_file = contractname\n    if not abi_file.endswith(\".abi\"):\n        abi_file = contracts_dir + \"/\" + contractname + \".abi\"\n    return abi_file\n", "entry_point": "generate_abi_path", "input": "'et'", "output": "'contracts/et.abi'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73753_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029864", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7664", "output": "{1, 2, 4, 8, 7664, 16, 3832, 1916, 958, 479}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7663", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029865", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5331", "output": "{3, 1, 5331, 1777}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5330", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029866", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8497", "output": "{1, 293, 29, 8497}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8496", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029867", "code": "def extract_version(version_str):\n    version_parts = version_str.split('-')\n    return version_parts[0]\n", "entry_point": "extract_version", "input": "'11.12.1L1.-extra'", "output": "'11.12.1L1.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029868", "code": "def generate_place_names(n):\n    place_names = []\n    for i in range(1, n+1):\n        if i % 2 == 0 and i % 3 == 0:\n            place_names.append(\"Metropolis\")\n        elif i % 2 == 0:\n            place_names.append(\"City\")\n        elif i % 3 == 0:\n            place_names.append(\"Town\")\n        else:\n            place_names.append(str(i))\n    return place_names\n", "entry_point": "generate_place_names", "input": "0", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143516_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029869", "code": "def sort_list(input_list):\n    sorted_list = sorted(input_list)\n    return sorted_list\n", "entry_point": "sort_list", "input": "[5, 2, 9, 1, 7]", "output": "[1, 2, 5, 7, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132551_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029870", "code": "from pathlib import Path\nimport re\ndef parse_filename(filename):\n    stem = Path(filename).stem\n    study_id, date = stem.split('_')\n    study_id = int(re.sub('study', '', study_id))\n    # Additional processing can be added here for date conversion if needed\n    return (study_id, date)\n", "entry_point": "parse_filename", "input": "'study1234_2022001.txt'", "output": "(1234, '2022001')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74786_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029871", "code": "def split_words(s: str):\n    words = []\n    raw_words = s.split()\n    for raw_word in raw_words:\n        words.append(raw_word)\n    return words\n", "entry_point": "split_words", "input": "'Pig'", "output": "['Pig']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48020_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029872", "code": "from typing import List\ndef most_frequent_item_id(item_ids: List[int]) -> int:\n    frequency = {}\n    for item_id in item_ids:\n        frequency[item_id] = frequency.get(item_id, 0) + 1\n    max_frequency = max(frequency.values())\n    most_frequent_ids = [item_id for item_id, freq in frequency.items() if freq == max_frequency]\n    return min(most_frequent_ids)\n", "entry_point": "most_frequent_item_id", "input": "[1, 2, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7393_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029873", "code": "def database_connection_status(operations):\n    cursor_open = True\n    driver_open = True\n    for operation in operations:\n        if \"cur.close()\" in operation:\n            cursor_open = False\n        elif \"driver.close()\" in operation:\n            driver_open = False\n    if not cursor_open and not driver_open:\n        return \"Cursor and Driver Closed\"\n    elif not cursor_open:\n        return \"Cursor Closed\"\n    elif not driver_open:\n        return \"Driver Closed\"\n    else:\n        return \"Both Open\"\n", "entry_point": "database_connection_status", "input": "[]", "output": "'Both Open'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20644_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029874", "code": "def customSortString(S, T):\n    char_index = {char: index for index, char in enumerate(S)}\n    sorted_T = sorted(T, key=lambda x: char_index.get(x, len(S)))\n    return ''.join(sorted_T)\n", "entry_point": "customSortString", "input": "'cad', 'ccad'", "output": "'ccad'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54445_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029875", "code": "from unittest.mock import MagicMock, call\ndef update_dictionary(input_dict: dict) -> dict:\n    updated_dict = input_dict.copy()\n    updated_dict['LC_CTYPE'] = 'en_US.UTF'\n    mock_dict = MagicMock()\n    mock_os = MagicMock()\n    mock_os.environ.copy.return_value = mock_dict\n    updated_dict.update(mock_dict.return_value)\n    mock_os.environ.clear()\n    return updated_dict\n", "entry_point": "update_dictionary", "input": "{}", "output": "{'LC_CTYPE': 'en_US.UTF'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72894_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029876", "code": "from typing import List\ndef remove_poisoned_data(predictions: List[int]) -> List[int]:\n    median = sorted(predictions)[len(predictions) // 2]\n    deviations = [abs(pred - median) for pred in predictions]\n    mad = sorted(deviations)[len(deviations) // 2]\n    threshold = 2 * mad\n    cleaned_predictions = [pred for pred in predictions if abs(pred - median) <= threshold]\n    return cleaned_predictions\n", "entry_point": "remove_poisoned_data", "input": "[13, 13, 13, 13, 13, 12, 14]", "output": "[13, 13, 13, 13, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51414_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029877", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "838", "output": "{1, 2, 419, 838}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt837", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029878", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3785", "output": "{1, 3785, 5, 757}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3784", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029879", "code": "def calculate_absolute_difference_sum(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "calculate_absolute_difference_sum", "input": "[0, 10, 20], [10, 30, 45]", "output": "55", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79907_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029880", "code": "def calculate_average(data):\n    total_noisy_add = sum(sample[0] for sample in data)\n    total_std_add = sum(sample[1] for sample in data)\n    average_noisy_add = total_noisy_add / len(data)\n    average_std_add = total_std_add / len(data)\n    return (average_noisy_add, average_std_add)\n", "entry_point": "calculate_average", "input": "[(4.0, 5.0)]", "output": "(4.0, 5.0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73285_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029881", "code": "def quick_sort(lst):\n    def partition(lst, first, last):\n        pivot = lst[last]\n        lo = first\n        hi = last - 1\n        while lo <= hi:\n            while lo <= hi and lst[lo] < pivot:\n                lo += 1\n            while lo <= hi and pivot < lst[hi]:\n                hi -= 1\n            if lo <= hi:\n                lst[lo], lst[hi] = lst[hi], lst[lo]\n                lo += 1\n                hi -= 1\n        lst[lo], lst[last] = lst[last], lst[lo]\n        return lo\n    def quick_sort_helper(lst, first, last):\n        if first < last:\n            pivot_index = partition(lst, first, last)\n            quick_sort_helper(lst, first, pivot_index - 1)\n            quick_sort_helper(lst, pivot_index + 1, last)\n    quick_sort_helper(lst, 0, len(lst) - 1)\n    return lst\n", "entry_point": "quick_sort", "input": "[3, 7, 9, 3, 9, 2, 3, 9, 11]", "output": "[2, 3, 3, 3, 7, 9, 9, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_121623_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029882", "code": "def sum_positive_numbers(int_list):\n    total_sum = 0\n    for num in int_list:\n        if num > 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_positive_numbers", "input": "[5, 5, 5]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103568_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029883", "code": "def navigate_maze(maze):\n    def dfs(x, y, path):\n        if x < 0 or x >= len(maze) or y < 0 or y >= len(maze[0]) or maze[x][y] == '#':\n            return False\n        if x == len(maze) - 1 and y == len(maze[0]) - 1:\n            return True\n        maze[x][y] = '#'  # Mark current cell as visited\n        if dfs(x + 1, y, path + 'D'):\n            return True\n        if dfs(x - 1, y, path + 'U'):\n            return True\n        if dfs(x, y + 1, path + 'R'):\n            return True\n        if dfs(x, y - 1, path + 'L'):\n            return True\n        maze[x][y] = ' '  # Unmark current cell if no valid path found\n        return False\n    start_x, start_y = 0, 0\n    path = ''\n    if dfs(start_x, start_y, path):\n        return path\n    else:\n        return 'No path found'\n", "entry_point": "navigate_maze", "input": "[['#', ' ', ' '], ['#', '#', ' '], [' ', ' ', ' ']]", "output": "'No path found'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84368_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029884", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4037", "output": "{1, 11, 4037, 367}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4036", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029885", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7705", "output": "{1, 67, 1541, 5, 335, 115, 23, 7705}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029886", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6590", "output": "{1, 2, 5, 1318, 10, 659, 6590, 3295}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6589", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029887", "code": "# Define the _split_string function to process the input string based on the offset\ndef _split_string(string, offset):\n    data = []\n    for i in string:\n        tile = offset + (ord(i) - ord('a')) * 4\n        data.append(tile)\n    return data\n", "entry_point": "_split_string", "input": "'qqx', 2", "output": "[66, 66, 94]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34458_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029888", "code": "from typing import List\ndef process_image(pixels: List[int]) -> List[int]:\n    result = []\n    for pixel in pixels:\n        result.append(pixel * 2)\n    return result\n", "entry_point": "process_image", "input": "[76, 51, 50, 50, 50, 99, 53, 51]", "output": "[152, 102, 100, 100, 100, 198, 106, 102]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142011_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029889", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3598", "output": "{1, 2, 514, 257, 7, 1799, 3598, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3597", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029890", "code": "def selection_sort_scores(scores):\n    for i in range(len(scores)):\n        min_index = i\n        for j in range(i+1, len(scores)):\n            if scores[j] < scores[min_index]:\n                min_index = j\n        scores[i], scores[min_index] = scores[min_index], scores[i]\n    return scores\n", "entry_point": "selection_sort_scores", "input": "[86, 91, 87, 79, 78, 86, 90, 65]", "output": "[65, 78, 79, 86, 86, 87, 90, 91]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125725_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029891", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[7, 1, 1, 1, 1, 2, 3, 7]", "output": "[7, 2, 3, 4, 5, 7, 9, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029892", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aaabrrb'", "output": "{'a': 3, 'b': 2, 'r': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029893", "code": "import math\ndef root_sum_of_squares(x):\n    if isinstance(x, list):\n        return math.sqrt(sum([i**2 for i in x]))\n    else:\n        return x\n", "entry_point": "root_sum_of_squares", "input": "[7]", "output": "7.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99036_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029894", "code": "def extract_hook_id(url_path):\n    # Find the index of the first '/' after 'webhook/'\n    start_index = url_path.find('/webhook/') + len('/webhook/')\n    # Find the index of the next '/' after the start_index\n    end_index = url_path.find('/', start_index)\n    # Extract the hook_id using the start and end indices\n    hook_id = url_path[start_index:end_index]\n    return hook_id\n", "entry_point": "extract_hook_id", "input": "'/webhook/12345/somepath'", "output": "'12345'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34398_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029895", "code": "def process_string(input_str):\n    if not input_str:\n        return \"\"\n    if \"native.repository_name()\" in input_str:\n        input_str = input_str.replace(\"native.repository_name()\", \"GENDIR\")\n    if \"external/\" in input_str:\n        index = input_str.index(\"external/\")\n        input_str = input_str[:index]\n    return input_str\n", "entry_point": "process_string", "input": "'anataaxabcanataaternal/xyzy'", "output": "'anataaxabcanataaternal/xyzy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19792_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029896", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6203", "output": "{1, 6203}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6202", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029897", "code": "def chemical_reaction(o, c, h):\n    water = 0\n    co2 = 0\n    methane = 0\n    if o >= 2 and c >= 1:\n        if 2 * c >= o:\n            co2 = o // 2\n            c -= co2\n            o -= co2 * 2\n        else:\n            co2 = c\n            c -= co2\n            o -= co2 * 2\n    if c >= 1 and h >= 4:\n        if c * 4 >= h:\n            methane = h // 4\n        else:\n            methane = c\n    return water, co2, methane\n", "entry_point": "chemical_reaction", "input": "8, 6, 8", "output": "(0, 4, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127102_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029898", "code": "from typing import List\ndef max_subarray_sum(arr: List[int]) -> int:\n    if not arr:\n        return 0\n    max_sum = current_sum = arr[0]\n    for num in arr[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_subarray_sum", "input": "[10, 5, 7, 12]", "output": "34", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41355_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029899", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8565", "output": "{1, 3, 5, 2855, 15, 1713, 8565, 571}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029900", "code": "def simulate_card_game(deck1, deck2, rounds):\n    player1_wins = 0\n    player2_wins = 0\n    for _ in range(rounds):\n        card1 = deck1.pop(0)\n        card2 = deck2.pop(0)\n        if card1 > card2:\n            player1_wins += 1\n        elif card2 > card1:\n            player2_wins += 1\n    return f\"Player 1 wins {player1_wins} rounds, Player 2 wins {player2_wins} rounds\"\n", "entry_point": "simulate_card_game", "input": "[1, 2, 3], [2, 3, 4], 3", "output": "'Player 1 wins 0 rounds, Player 2 wins 3 rounds'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77971_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029901", "code": "def reverse_string(input_str):\n    reversed_str = \"\"\n    for char in input_str[::-1]:\n        reversed_str += char\n    return reversed_str\n", "entry_point": "reverse_string", "input": "'hello'", "output": "'olleh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138749_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029902", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "8", "output": "[1, 4, 2, 1, 4, 2, 1, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029903", "code": "from typing import List\ndef calculate_average(scores: List[int]) -> float:\n    if len(scores) < 2:\n        return 0\n    max_score = max(scores)\n    min_score = min(scores)\n    scores.remove(max_score)\n    scores.remove(min_score)\n    average = sum(scores) / (len(scores) or 1)\n    return round(average, 1)\n", "entry_point": "calculate_average", "input": "[95, 85, 90, 91, 91]", "output": "90.7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13266_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029904", "code": "def increment_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "increment_version", "input": "'1.130.0'", "output": "'1.130.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45821_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029905", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'hbo.com/ps'", "output": "'hbo.com/ps/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029906", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 1", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029907", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "3, 4", "output": "5.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029908", "code": "def replace_floating_bit(v):\n    result = []\n    v0 = v.replace(\"X\", \"0\", 1)\n    v1 = v.replace(\"X\", \"1\", 1)\n    if v0.count(\"X\") == 0:\n        result.extend([v0, v1])\n        return result\n    result.extend(replace_floating_bit(v0))\n    result.extend(replace_floating_bit(v1))\n    return result\n", "entry_point": "replace_floating_bit", "input": "'1010110X'", "output": "['10101100', '10101101']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92437_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029909", "code": "from functools import reduce\nfrom operator import xor\ndef find_missing_integer(xs):\n    n = len(xs)\n    xor_xs = reduce(xor, xs)\n    xor_full = reduce(xor, range(1, n + 2))\n    return xor_xs ^ xor_full\n", "entry_point": "find_missing_integer", "input": "[1, 2, 3, 4, 5, 6]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77106_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029910", "code": "import math\ndef sector_area(radius, angle):\n    return 0.5 * radius**2 * angle\n", "entry_point": "sector_area", "input": "5.0, -0.8455009333734524", "output": "-10.568761667168156", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122978_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029911", "code": "def extract_domain(url):\n    protocol_index = url.find(\"://\")\n    if protocol_index == -1:\n        return \"Invalid URL\"\n    domain_start = protocol_index + 3\n    path_index = url.find(\"/\", domain_start)\n    if path_index == -1:\n        return url[domain_start:]\n    return url[domain_start:path_index]\n", "entry_point": "extract_domain", "input": "'http://subh'", "output": "'subh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7494_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029912", "code": "def highest_score(deck, target):\n    def helper(index, total):\n        if total > target:\n            return 0\n        if index == len(deck):\n            return total\n        # Draw the card at index\n        draw_score = helper(index + 1, total + deck[index])\n        # Skip the card at index\n        skip_score = helper(index + 1, total)\n        return max(draw_score, skip_score)\n    return helper(0, 0)\n", "entry_point": "highest_score", "input": "[10, 8, 8], 26", "output": "26", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109972_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029913", "code": "def count_numbers(numbers):\n    inside_count = 0\n    outside_count = 0\n    for num in numbers:\n        if num >= 10 and num <= 20:\n            inside_count += 1\n        else:\n            outside_count += 1\n    return inside_count, outside_count\n", "entry_point": "count_numbers", "input": "[10, 12, 15, 20, 5, 25, -1]", "output": "(4, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84948_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029914", "code": "import base64\ndef modified_unbase64(s):\n    s_utf7 = '+' + s.replace(',', '/') + '-'\n    original_bytes = s_utf7.encode('utf-7')\n    original_string = original_bytes.decode('utf-7')\n    return original_string\n", "entry_point": "modified_unbase64", "input": "'SGV'", "output": "'+SGV-'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65108_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029915", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4162", "output": "{1, 4162, 2, 2081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4161", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029916", "code": "from typing import List\ndef max_sub_array(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sub_array", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80022_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029917", "code": "def find_largest_and_difference(numbers):\n    largest = max(numbers)\n    numbers.remove(largest)\n    second_largest = max(numbers)\n    difference = largest - second_largest\n    return largest, difference\n", "entry_point": "find_largest_and_difference", "input": "[11, 11, 5, 7]", "output": "(11, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21739_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029918", "code": "def process_event(event: str, values: list) -> str:\n    if event == \"click\":\n        return f\"Clicked with values: {values}\"\n    elif event == \"hover\":\n        return f\"Hovered with values: {values}\"\n    elif event == \"submit\":\n        return f\"Submitted with values: {values}\"\n    else:\n        return \"Unknown event\"\n", "entry_point": "process_event", "input": "'hover', ['a', 'b', 'c']", "output": "\"Hovered with values: ['a', 'b', 'c']\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96210_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029919", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2265", "output": "{1, 3, 5, 453, 15, 755, 151, 2265}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2264", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029920", "code": "def generate_version_macros(torch_version):\n    TORCH_MAJOR = int(torch_version.split('.')[0])\n    TORCH_MINOR = int(torch_version.split('.')[1])\n    version_ge_1_1 = []\n    if (TORCH_MAJOR > 1) or (TORCH_MAJOR == 1 and TORCH_MINOR > 0):\n        version_ge_1_1 = ['-DVERSION_GE_1_1']\n    version_ge_1_3 = []\n    if (TORCH_MAJOR > 1) or (TORCH_MAJOR == 1 and TORCH_MINOR > 2):\n        version_ge_1_3 = ['-DVERSION_GE_1_3']\n    version_ge_1_5 = []\n    if (TORCH_MAJOR > 1) or (TORCH_MAJOR == 1 and TORCH_MINOR > 4):\n        version_ge_1_5 = ['-DVERSION_GE_1_5']\n    version_dependent_macros = version_ge_1_1 + version_ge_1_3 + version_ge_1_5\n    return version_dependent_macros\n", "entry_point": "generate_version_macros", "input": "'1.3'", "output": "['-DVERSION_GE_1_1', '-DVERSION_GE_1_3']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21970_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029921", "code": "def calculate_total_log_size(max_file_size_bytes, backup_count):\n    total_size = max_file_size_bytes + (max_file_size_bytes * backup_count)\n    return total_size\n", "entry_point": "calculate_total_log_size", "input": "-4194302, 0", "output": "-4194302", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42513_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029922", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "127, {}", "output": "'127-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029923", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "9", "output": "105", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029924", "code": "def score(dice):\n    score = 0\n    counts = [0] * 7  # Initialize counts for each dice face (index 1-6)\n    for roll in dice:\n        counts[roll] += 1\n    for i in range(1, 7):\n        if counts[i] >= 3:\n            if i == 1:\n                score += 1000\n            else:\n                score += i * 100\n            counts[i] -= 3\n    score += counts[1] * 100  # Add remaining 1's\n    score += counts[5] * 50   # Add remaining 5's\n    return score\n", "entry_point": "score", "input": "[1, 1, 1, 1, 1, 5, 5, 5]", "output": "1700", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95031_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029925", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2488", "output": "{1, 2, 4, 8, 622, 311, 2488, 1244}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2487", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029926", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2099", "output": "{1, 2099}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029927", "code": "GAIN_FOUR = 2\nGAIN_ONE = 0\nGAIN_TWO = 1\nMODE_CONTIN = 0\nMODE_SINGLE = 16\nOSMODE_STATE = 128\ndef calculate_gain(mode, rate):\n    if mode == MODE_CONTIN:\n        return rate * GAIN_ONE\n    elif mode == MODE_SINGLE:\n        return rate + GAIN_TWO\n    elif mode == OSMODE_STATE:\n        return rate - GAIN_FOUR\n    else:\n        return \"Invalid mode\"\n", "entry_point": "calculate_gain", "input": "16, 10", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87824_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029928", "code": "def parse_mimetype(mime_string):\n    parts = mime_string.split(';')\n    type_subtype = parts[0].lower().split('/')\n    mime_type = type_subtype[0]\n    subtype = type_subtype[1] if len(type_subtype) > 1 else ''\n    suffix = ''\n    if '+' in subtype:\n        subtype, suffix = subtype.split('+')\n    params = {}\n    for part in parts[1:]:\n        key_value = part.split('=')\n        key = key_value[0].strip().lower()\n        value = key_value[1].strip().strip('\"') if len(key_value) > 1 else ''\n        params[key] = value\n    return mime_type, subtype, suffix, params\n", "entry_point": "parse_mimetype", "input": "'text/plain; base64='", "output": "('text', 'plain', '', {'base64': ''})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4062_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029929", "code": "def convert_numbers_to_subscript(input_str):\n    # Dictionary mapping regular numbers to subscript Unicode equivalents\n    subscript_mapping = {\n        '0': '\u2080', '1': '\u2081', '2': '\u2082', '3': '\u2083', '4': '\u2084',\n        '5': '\u2085', '6': '\u2086', '7': '\u2087', '8': '\u2088', '9': '\u2089'\n    }\n    # Initialize an empty string to store the result\n    result = \"\"\n    # Iterate over each character in the input string\n    for char in input_str:\n        # Check if the character is a digit\n        if char.isdigit():\n            # Replace the digit with its subscript Unicode equivalent\n            result += subscript_mapping[char]\n        else:\n            result += char\n    return result\n", "entry_point": "convert_numbers_to_subscript", "input": "'Mg'", "output": "'Mg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10533_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029930", "code": "def maxsumseq(sequence):\n    start, end, sum_start = -1, -1, -1\n    maxsum_, sum_ = 0, 0\n    for i, x in enumerate(sequence):\n        sum_ += x\n        if maxsum_ < sum_:\n            maxsum_ = sum_\n            start, end = sum_start, i\n        elif sum_ < 0:\n            sum_ = 0\n            sum_start = i\n    return sequence[start + 1:end + 1]\n", "entry_point": "maxsumseq", "input": "[-2, 1, 1, -1, 1, 0, 1, -3]", "output": "[1, 1, -1, 1, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12391_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029931", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7835", "output": "{1, 7835, 5, 1567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7834", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029932", "code": "def process_subscripts(subscripts):\n    in_subs, out_sub = subscripts.split('->')\n    in_subs = in_subs.split(',')\n    out_sub = out_sub.strip()\n    in_subs = [in_sub.strip() for in_sub in in_subs]\n    if not '->' in subscripts:\n        out_sub = ''\n        shared_chars = set.intersection(*[set(sub) for sub in in_subs])\n        for subs in in_subs:\n            for char in subs:\n                if char not in shared_chars:\n                    out_sub += char\n    return in_subs, out_sub\n", "entry_point": "process_subscripts", "input": "'abc, def, -> jklm'", "output": "(['abc', 'def', ''], 'jklm')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_89608_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029933", "code": "def normalize_path(path: str) -> str:\n    stack = []\n    elements = path.split('/')\n    for element in elements:\n        if element == '..':\n            if stack:\n                stack.pop()\n        elif element and element != '.':\n            stack.append(element)\n    normalized_path = '/' + '/'.join(stack)\n    return normalized_path\n", "entry_point": "normalize_path", "input": "'/folder/../home.t'", "output": "'/home.t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60825_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029934", "code": "def generate_integers(start, stop, step):\n    return list(range(start, stop, step))\n", "entry_point": "generate_integers", "input": "-2, 12, 1", "output": "[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107724_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029935", "code": "def calculate_remaining_time(timeout: int, current_time: int) -> int:\n    remaining_time = timeout - current_time\n    return remaining_time\n", "entry_point": "calculate_remaining_time", "input": "889, 0", "output": "889", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143645_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029936", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2683", "output": "{1, 2683}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029937", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2699", "output": "{1, 2699}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2698", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029938", "code": "def safe_add(x, y):\n    if not isinstance(x, int) or not isinstance(y, int):\n        raise TypeError(\"Inputs must be integers\")\n    result = x + y\n    if (x > 0 and y > 0 and result < 0) or (x < 0 and y < 0 and result > 0):\n        raise OverflowError(\"Integer overflow occurred\")\n    return result\n", "entry_point": "safe_add", "input": "2147483647, -1", "output": "2147483646", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36227_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029939", "code": "def sum_of_squares(arr):\n    sum_squares = 0\n    for num in arr:\n        sum_squares += num ** 2\n    return sum_squares\n", "entry_point": "sum_of_squares", "input": "[2, 6]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48456_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029940", "code": "def find_fourth_number(numbers):\n    fourth_number = sum(numbers)\n    return fourth_number\n", "entry_point": "find_fourth_number", "input": "[10, 10, 10]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31253_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029941", "code": "def calculate_percentage_change(buying_rate, selling_rate):\n    return ((selling_rate - buying_rate) / buying_rate) * 100\n", "entry_point": "calculate_percentage_change", "input": "1.0, -9.486166007905139", "output": "-1048.6166007905138", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3941_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029942", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8578", "output": "{1, 8578, 2, 4289}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8577", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029943", "code": "def generate_code(input_string):\n    result = \"\"\n    position = 1\n    for char in input_string:\n        if char.isalpha():\n            result += char.upper()\n            result += str(position)\n            position += 1\n    return result\n", "entry_point": "generate_code", "input": "'Hello'", "output": "'H1E2L3L4O5'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4318_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029944", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[5, 6, 5, 2, 2, 4, 4, 2]", "output": "[5, 11, 16, 18, 20, 24, 28, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029945", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(40, 61, 41, 20, 60, 41)", "output": "(41, 60, 20, 41, 61, 40)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029946", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "3", "output": "1.7320508076", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029947", "code": "def sum_excluding_diagonal(matrix):\n    total_sum = 0\n    for i in range(len(matrix)):\n        for j in range(len(matrix[i])):\n            if i != j:\n                total_sum += matrix[i][j]\n    return total_sum\n", "entry_point": "sum_excluding_diagonal", "input": "[[0, 10, 5], [4, 0, 6], [3, 2, 0]]", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136840_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029948", "code": "def custom_bold(text):\n    return '<strong>{}</strong>'.format(text)\n", "entry_point": "custom_bold", "input": "'Hello, World!'", "output": "'<strong>Hello, World!</strong>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4303_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029949", "code": "def get_parent_directory(path):\n    if path[-1] in ['/', '\\\\']:  # Check if the path ends with a separator\n        path = path[:-1]  # Remove the trailing separator if present\n    separator_index = max(path.rfind('/'), path.rfind('\\\\'))  # Find the last occurrence of '/' or '\\'\n    if separator_index == -1:  # If no separator found, return the root directory\n        return path if path[1] in [':', '/'] else path[0]\n    else:\n        return path[:separator_index]\n", "entry_point": "get_parent_directory", "input": "'C:\\\\/home/Admin/somefile.txt'", "output": "'C:\\\\/home/Admin'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22512_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029950", "code": "def increment_version(version):\n    components = version.split('.')\n    last_component = int(components[-1]) + 1\n    components[-1] = str(last_component)\n    return '.'.join(components)\n", "entry_point": "increment_version", "input": "'0..70'", "output": "'0..71'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146085_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029951", "code": "from typing import List\ndef buy_and_sell_stock_twice(prices: List[float]) -> float:\n    first_buy = second_buy = float('-inf')\n    first_sell = second_sell = 0.0\n    for price in prices:\n        first_buy = max(first_buy, -price)\n        first_sell = max(first_sell, first_buy + price)\n        second_buy = max(second_buy, first_sell - price)\n        second_sell = max(second_sell, second_buy + price)\n    return second_sell\n", "entry_point": "buy_and_sell_stock_twice", "input": "[5, 15, 4, 5]", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106873_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029952", "code": "def find_missing_number(nums):\n    n = len(nums)\n    expected_sum = (n * (n + 1)) // 2\n    actual_sum = sum(nums)\n    if expected_sum != actual_sum:\n        return expected_sum - actual_sum\n    return -1\n", "entry_point": "find_missing_number", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]", "output": "17", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115210_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029953", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "88", "output": "{1, 2, 4, 8, 11, 44, 22, 88}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt87", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029954", "code": "from typing import List\ndef max_sub_array(nums: List[int]) -> int:\n    if not nums:\n        return 0\n    max_sum = current_sum = nums[0]\n    for num in nums[1:]:\n        current_sum = max(num, current_sum + num)\n        max_sum = max(max_sum, current_sum)\n    return max_sum\n", "entry_point": "max_sub_array", "input": "[3, 5, 4]", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_80022_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029955", "code": "from typing import List\ndef degree(poly: List[int]) -> int:\n    deg = 0\n    for i in range(len(poly) - 1, -1, -1):\n        if poly[i] != 0:\n            deg = i\n            break\n    return deg\n", "entry_point": "degree", "input": "[0]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116666_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029956", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2504", "output": "{1, 2, 1252, 4, 2504, 8, 626, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2503", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029957", "code": "def get_fourth_time(time_list):\n    return time_list[3]\n", "entry_point": "get_fourth_time", "input": "['08:00', '12:30', '15:45', '18:10']", "output": "'18:10'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51840_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029958", "code": "from typing import List\ndef count_unique_requirements(requirements: List[int]) -> int:\n    unique_requirements = set()\n    for req in requirements:\n        unique_requirements.add(req)\n    return len(unique_requirements)\n", "entry_point": "count_unique_requirements", "input": "[1, 2, 3, 4, 5, 6, 7, 1, 2, 3]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112114_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029959", "code": "def modify_list(result):\n    for i in range(len(result)):\n        if result[i] % 2 == 0:  # If the element is even\n            result[i] *= 2\n        else:  # If the element is odd\n            result[i] -= 1\n    return result\n", "entry_point": "modify_list", "input": "[0, -2, 0, -4, 2, 0, 0, -4, 2]", "output": "[0, -4, 0, -8, 4, 0, 0, -8, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92786_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029960", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3411", "output": "{1, 3, 9, 1137, 3411, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3410", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029961", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3098", "output": "{1, 3098, 2, 1549}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3097", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029962", "code": "def mergeSort(elements):\n    if len(elements) <= 1:\n        return elements\n    middle = len(elements) // 2\n    left = mergeSort(elements[:middle])\n    right = mergeSort(elements[middle:])\n    if left == [] or right == []:\n        return left or right\n    result = []\n    i, j = 0, 0\n    while i < len(left) and j < len(right):\n        if left[i] < right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "mergeSort", "input": "[43]", "output": "[43]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45004_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029963", "code": "def generate_post_id(user_id, user_posts):\n    if user_id not in user_posts:\n        user_posts[user_id] = 1\n    else:\n        user_posts[user_id] += 1\n    post_number = user_posts[user_id]\n    return f\"{user_id}-{post_number}\"\n", "entry_point": "generate_post_id", "input": "459, {}", "output": "'459-1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139224_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029964", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[4, 0, 1, 4, 1, 2, 0, 1]", "output": "[4, 1, 5, 5, 3, 2, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029965", "code": "def score_status(enemy_score, own_score):\n    return f\"Enemy: {enemy_score}, Own: {own_score}\"\n", "entry_point": "score_status", "input": "12, -2", "output": "'Enemy: 12, Own: -2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94364_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029966", "code": "import json\ndef process_model_config(model_options: str) -> dict:\n    model_cfg = {}\n    if model_options is not None:\n        try:\n            model_cfg = json.loads(model_options)\n        except json.JSONDecodeError:\n            print(\"Invalid JSON format. Returning an empty dictionary.\")\n    return model_cfg\n", "entry_point": "process_model_config", "input": "'{\"key1\": \"value1\", \"key2\": \"value2\"}'", "output": "{'key1': 'value1', 'key2': 'value2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46465_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029967", "code": "def filter_elements(iterable, include_values):\n    filtered_list = []\n    for value in iterable:\n        if value in include_values:\n            filtered_list.append(value)\n    return filtered_list\n", "entry_point": "filter_elements", "input": "[4, 4, 1, 2, 3], {1, 2, 4}", "output": "[4, 4, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46502_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029968", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4486", "output": "{1, 2, 2243, 4486}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4485", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029969", "code": "def Reverse(a):\n    if a.strip():  # Check if the input string contains non-whitespace characters\n        return ' '.join(map(str, a.split()[::-1]))\n    else:\n        return a\n", "entry_point": "Reverse", "input": "'   '", "output": "'   '", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52155_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029970", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1459", "output": "{1, 1459}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1458", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029971", "code": "def final_position(commands, rows, cols):\n    x, y = 0, 0\n    for command in commands:\n        if command == 'U' and y < cols - 1:\n            y += 1\n        elif command == 'D' and y > 0:\n            y -= 1\n        elif command == 'L' and x > 0:\n            x -= 1\n        elif command == 'R' and x < rows - 1:\n            x += 1\n    return x, y\n", "entry_point": "final_position", "input": "['R', 'R', 'R', 'U'], 4, 4", "output": "(3, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111606_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029972", "code": "def get_calibration_file_extension(cal_mode):\n    extensions = {\n        0: \".jpg\",\n        1: \".yaml\",\n        2: \".xml\"\n    }\n    return extensions.get(cal_mode, \"Unknown\")\n", "entry_point": "get_calibration_file_extension", "input": "0", "output": "'.jpg'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65114_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029973", "code": "def extract_name(message):\n    first_name = \"Thomas\"\n    dot_index = message.find(first_name + \".\") + len(first_name) + 1\n    last_name = message[dot_index:].split()[0]\n    formatted_last_name = last_name.replace(\".\", \" \")\n    return f\"{first_name} {formatted_last_name}\"\n", "entry_point": "extract_name", "input": "'Thomas. everyone,'", "output": "'Thomas everyone,'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95698_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029974", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[7, 3, 3, 8, 5, 9, 9, 5]", "output": "[7, 3, 8, 5, 9]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029975", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    # Count occurrences of each element\n    for element in input_list:\n        if element in element_count:\n            element_count[element] += 1\n        else:\n            element_count[element] = 1\n    unique_elements = [element for element, count in element_count.items() if count == 1]\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[4, 0, 7, 1, 1, 2, 2]", "output": "[4, 0, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122034_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029976", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5584", "output": "{1, 2, 4, 2792, 8, 5584, 16, 1396, 698, 349}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5583", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029977", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8455", "output": "{1, 5, 8455, 19, 89, 1691, 445, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029978", "code": "def max_consecutive_sum(arr, k):\n    window_sum = sum(arr[:k])  # Calculate initial window sum\n    max_sum = window_sum\n    for i in range(k, len(arr)):\n        window_sum = window_sum - arr[i - k] + arr[i]  # Update window sum\n        max_sum = max(max_sum, window_sum)  # Update max sum\n    return max_sum\n", "entry_point": "max_consecutive_sum", "input": "[8, 8, 8, 8], 4", "output": "32", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118112_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029979", "code": "def extract_task_module(task_input):\n    if isinstance(task_input, str):\n        return task_input\n    elif callable(task_input):\n        return task_input.__module__\n    elif hasattr(task_input, '__module__'):\n        return task_input.__module__\n    else:\n        raise ValueError(\"Unsupported task input type\")\n", "entry_point": "extract_task_module", "input": "'myl_e'", "output": "'myl_e'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96712_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029980", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[3, 3, 4, 4, 0, 0, 0, 2]", "output": "{3: 2, 4: 2, 0: 3, 2: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029981", "code": "def atbash2text(encrypted_text):\n    decrypted_text = \"\"\n    for char in encrypted_text:\n        if char.isupper():\n            decrypted_text += chr(ord('Z') + ord('A') - ord(char))\n        elif char.islower():\n            decrypted_text += chr(ord('z') + ord('a') - ord(char))\n        else:\n            decrypted_text += char\n    return decrypted_text\n", "entry_point": "atbash2text", "input": "'1223!gg2g'", "output": "'1223!tt2t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_124926_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029982", "code": "def swap_first_last(input_tuple):\n    if len(input_tuple) < 2:\n        return input_tuple  # No swapping needed for tuples with less than 2 elements\n    first, *middle, last = input_tuple\n    return (last, *middle, first)\n", "entry_point": "swap_first_last", "input": "(2, 5, 5, 1, 0, 2, 5, 0)", "output": "(0, 5, 5, 1, 0, 2, 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25947_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029983", "code": "import re\ndef about_page(fb_url: str) -> str:\n    if '/pages/' not in fb_url:\n        fb_url = re.sub('facebook.com\\/', 'facebook.com/pg/', fb_url)\n    fb_url = re.sub('\\/$', '', fb_url)\n    fb_url = fb_url + '/about/?ref=page_internal'\n    return fb_url\n", "entry_point": "about_page", "input": "'hbo.com/pages'", "output": "'hbo.com/pages/about/?ref=page_internal'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40353_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029984", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[1, 3, 1, 5, 4, 7]", "output": "[4, 4, 6, 9, 11, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71786_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029985", "code": "def validate_timestamps(timestamps):\n    for timestamp in timestamps:\n        start_time, end_time = timestamp\n        if start_time < 0 or end_time < 0 or start_time >= end_time:\n            return False\n    return True\n", "entry_point": "validate_timestamps", "input": "[(-1, 5)]", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52767_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029986", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[2, 3, 1, 3, 4, 0, 5, 5, 3]", "output": "[5, 4, 4, 7, 4, 5, 10, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78520_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029987", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2914", "output": "{1, 2914, 2, 47, 1457, 62, 94, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2913", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029988", "code": "from typing import List\ndef calculate_top5_average(scores: List[int]) -> float:\n    if not scores:\n        return 0\n    sorted_scores = sorted(scores, reverse=True)\n    num_students = min(5, len(sorted_scores))\n    top_scores_sum = sum(sorted_scores[:num_students])\n    return top_scores_sum / num_students\n", "entry_point": "calculate_top5_average", "input": "[90, 91, 92, 94, 89]", "output": "91.2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99994_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029989", "code": "def get_quest_tag(quest_id):\n    quest_tags = {\n        87: \"qst_learn_where_merchant_brother_is\",\n        88: \"qst_save_relative_of_merchant\",\n        89: \"qst_save_town_from_bandits\",\n        90: \"qst_quests_end\",\n        504403158265495552: \"qsttag_deliver_message\",\n        504403158265495553: \"qsttag_deliver_message_to_enemy_lord\",\n        504403158265495554: \"qsttag_raise_troops\",\n        504403158265495555: \"qsttag_escort_lady\",\n        504403158265495556: \"qsttag_deal_with_bandits_at_lords_village\",\n        504403158265495557: \"qsttag_collect_taxes\",\n        504403158265495558: \"qsttag_hunt_down_fugitive\",\n        504403158265495559: \"qsttag_kill_local_merchant\",\n        504403158265495560: \"qsttag_bring_back_runaway_serfs\",\n        504403158265495561: \"qsttag_follow_spy\",\n        504403158265495562: \"qsttag_capture_enemy_hero\"\n    }\n    return quest_tags.get(quest_id, \"Quest ID not found\")\n", "entry_point": "get_quest_tag", "input": "89", "output": "'qst_save_town_from_bandits'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134551_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029990", "code": "def extract_file_name(path: str) -> str:\n    # Find the last occurrence of '/'\n    last_separator_index = path.rfind('/')\n    # Extract the file name\n    file_name = path[last_separator_index + 1:]\n    return file_name\n", "entry_point": "extract_file_name", "input": "'/folder/example.'", "output": "'example.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109712_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029991", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'Hello, hello world!'", "output": "{'hello': 2, 'world': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029992", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1379", "output": "{1, 1379, 197, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1378", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029993", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation and convert to lowercase\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator).lower()\n    # Split text into words\n    words = text.split()\n    # Use a set to store unique words\n    unique_words = set()\n    # Add unique words to the set\n    for word in words:\n        unique_words.add(word)\n    # Convert set to sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hellohello'", "output": "['hellohello']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75610_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029994", "code": "def cumulative_sum(nums):\n    cumulative_sums = []\n    cum_sum = 0\n    for num in nums:\n        cum_sum += num\n        cumulative_sums.append(cum_sum)\n    return cumulative_sums\n", "entry_point": "cumulative_sum", "input": "[2, 4, 4, 1, 1, 3, 4]", "output": "[2, 6, 10, 11, 12, 15, 19]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35878_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029995", "code": "from typing import List\ndef sum_multiples_3_5(nums: List[int]) -> int:\n    total = 0\n    for num in nums:\n        if num % 3 == 0 or num % 5 == 0:\n            total += num\n    return total\n", "entry_point": "sum_multiples_3_5", "input": "[15, 18, 21]", "output": "54", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106713_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029996", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7234", "output": "{1, 7234, 2, 3617}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7233", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029997", "code": "def process_integers(input_list):\n    processed_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            processed_list.append(num + 10)\n        elif num % 2 != 0:\n            processed_list.append(num - 5)\n        if num % 5 == 0:\n            processed_list[-1] *= 2  # Double the last element added\n    return processed_list\n", "entry_point": "process_integers", "input": "[8, 6, 3, -8, -10, 6, 4]", "output": "[18, 16, -2, 2, 0, 16, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71116_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029998", "code": "def extract_version(version_string):\n    version_parts = version_string.split('.')\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    return major, minor, patch\n", "entry_point": "extract_version", "input": "'1.11.5'", "output": "(1, 11, 5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55096_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0029999", "code": "def max_total_score(scores):\n    max_score = 0\n    current_score = 0\n    for i in range(len(scores)):\n        skip_score = current_score + (scores[i - 2] if i >= 2 else 0)\n        current_score = max(skip_score, current_score + scores[i])\n        max_score = max(max_score, current_score)\n    return max_score\n", "entry_point": "max_total_score", "input": "[70, 0, 71, 0]", "output": "141", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26076_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030000", "code": "def replace_key(g_key, weather_api_key):\n    updated_g_key = g_key.replace(\"<KEY>\", weather_api_key)\n    return updated_g_key\n", "entry_point": "replace_key", "input": "'<KEY>', 'AIzaAAC9X1BB1B'", "output": "'AIzaAAC9X1BB1B'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12285_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030001", "code": "def findNthUglyNumber(n: int) -> int:\n    nums = [1]\n    p2, p3, p5 = 0, 0, 0\n    for _ in range(1, n):\n        n2 = 2 * nums[p2]\n        n3 = 3 * nums[p3]\n        n5 = 5 * nums[p5]\n        next_ugly = min(n2, n3, n5)\n        nums.append(next_ugly)\n        if next_ugly == n2:\n            p2 += 1\n        if next_ugly == n3:\n            p3 += 1\n        if next_ugly == n5:\n            p5 += 1\n    return nums[-1]\n", "entry_point": "findNthUglyNumber", "input": "9", "output": "10", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46339_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030002", "code": "def choisirMot(suggestion, motAuHasard):\n    if suggestion:\n        return suggestion\n    else:\n        return motAuHasard\n", "entry_point": "choisirMot", "input": "'apeapp', None", "output": "'apeapp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126140_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030003", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9556", "output": "{1, 2, 4, 4778, 9556, 2389}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9555", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030004", "code": "def reverse_tuple(tup):\n    # Convert the input tuple to a list\n    tup_list = list(tup)\n    # Reverse the list using list slicing\n    reversed_list = tup_list[::-1]\n    # Convert the reversed list back to a tuple\n    reversed_tuple = tuple(reversed_list)\n    return reversed_tuple\n", "entry_point": "reverse_tuple", "input": "(50, 40, 51, 40, 50, 60, 50, 59, 22)", "output": "(22, 59, 50, 60, 50, 40, 51, 40, 50)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84520_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030005", "code": "def find_common_elements(list1, list2):\n    # Find the common elements between the two lists using set intersection\n    common_elements = list(set(list1) & set(list2))\n    return common_elements\n", "entry_point": "find_common_elements", "input": "[1, 2, 3, 5], [0, 5, 6]", "output": "[5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146440_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030006", "code": "from typing import List\ndef reverse_insertion_sort(comp: int) -> List[int]:\n    lst = []\n    n = 0\n    while comp > 0:\n        n += 1\n        if comp <= n:\n            lst.insert(0, n)\n            comp -= 1\n            n = 0\n        else:\n            lst.append(n)\n            comp -= n\n    return lst\n", "entry_point": "reverse_insertion_sort", "input": "10", "output": "[1, 2, 4, 1, 2, 3, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73545_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030007", "code": "def generateMatrix(n: int) -> [[int]]:\n    def fillMatrix(matrix, top, bottom, left, right, num):\n        if top > bottom or left > right:\n            return\n        # Fill top row\n        for i in range(left, right + 1):\n            matrix[top][i] = num\n            num += 1\n        top += 1\n        # Fill right column\n        for i in range(top, bottom + 1):\n            matrix[i][right] = num\n            num += 1\n        right -= 1\n        # Fill bottom row\n        if top <= bottom:\n            for i in range(right, left - 1, -1):\n                matrix[bottom][i] = num\n                num += 1\n            bottom -= 1\n        # Fill left column\n        if left <= right:\n            for i in range(bottom, top - 1, -1):\n                matrix[i][left] = num\n                num += 1\n            left += 1\n        fillMatrix(matrix, top, bottom, left, right, num)\n    matrix = [[None for _ in range(n)] for _ in range(n)]\n    fillMatrix(matrix, 0, n - 1, 0, n - 1, 1)\n    return matrix\n", "entry_point": "generateMatrix", "input": "1", "output": "[[1]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_97938_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030008", "code": "def increment_version(version: str) -> str:\n    # Split the version number into major, minor, and patch components\n    major, minor, patch = map(int, version.split('.'))\n    # Increment the patch component by 1\n    patch += 1\n    # Convert the components back to strings and join them\n    updated_version = f\"{major}.{minor}.{patch}\"\n    return updated_version\n", "entry_point": "increment_version", "input": "'5.5.5'", "output": "'5.5.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_22042_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030009", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:9765]'", "output": "76561197960275493", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030010", "code": "from typing import List, Any\nBUFFER = 5\ndef paginate(items: List[Any], page: int) -> List[Any]:\n    total_pages = (len(items) + BUFFER - 1) // BUFFER  # Calculate total number of pages\n    if page < 1 or page > total_pages:  # Check if page number is valid\n        return []\n    start_idx = (page - 1) * BUFFER\n    end_idx = min(start_idx + BUFFER, len(items))\n    return items[start_idx:end_idx]\n", "entry_point": "paginate", "input": "[1, 2, 3, 4, 5], 1", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43724_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030011", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "'  Wd12Hll Wrrd! 123Wd\\x80'", "output": "'  Wd12Hll Wrrd! 123Wd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030012", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8059", "output": "{1, 8059}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8058", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030013", "code": "from typing import List\ndef most_common_prefix(strings: List[str]) -> str:\n    if not strings:\n        return \"\"\n    common_prefix = \"\"\n    for i, char in enumerate(strings[0]):\n        for string in strings[1:]:\n            if i >= len(string) or string[i] != char:\n                return common_prefix\n        common_prefix += char\n    return common_prefix\n", "entry_point": "most_common_prefix", "input": "['flower', 'flight', 'flame', 'fl']", "output": "'fl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38674_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030014", "code": "def sum_abs_diffs(list1, list2):\n    total_diff = 0\n    for i in range(len(list1)):\n        total_diff += abs(list1[i] - list2[i])\n    return total_diff\n", "entry_point": "sum_abs_diffs", "input": "[0, 0, 0], [4, 0, 0]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126506_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030015", "code": "collatz_memo = {1: 1}\ndef collatz_length(n):\n    if n in collatz_memo:\n        return collatz_memo[n]\n    elif n % 2 == 0:\n        collatz_memo[n] = 1 + collatz_length(n // 2)\n    else:\n        collatz_memo[n] = 1 + collatz_length(3 * n + 1)\n    return collatz_memo[n]\n", "entry_point": "collatz_length", "input": "4", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54573_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030016", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8675", "output": "{1, 8675, 5, 1735, 25, 347}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8674", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030017", "code": "def circular_sum(input_list):\n    output_list = []\n    list_length = len(input_list)\n    for i in range(list_length):\n        next_index = (i + 1) % list_length\n        sum_value = input_list[i] + input_list[next_index]\n        output_list.append(sum_value)\n    return output_list\n", "entry_point": "circular_sum", "input": "[3, 3, 4, 5, 2, 2, 1]", "output": "[6, 7, 9, 7, 4, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110145_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030018", "code": "def fill_tile(n):\n    if n == 0 or n == 1 or n == 2:\n        return 1\n    dp = [0] * (n+1)\n    dp[0], dp[1], dp[2] = 1, 1, 1\n    for i in range(3, n+1):\n        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]\n    return dp[n]\n", "entry_point": "fill_tile", "input": "14", "output": "2209", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54480_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030019", "code": "def generate_list(size):\n    alphabet = list(map(chr, range(97, 123)))  # Generating a list of lowercase alphabets\n    m = alphabet[size-1::-1] + alphabet[:size]  # Creating the list 'm' based on the given size\n    return m\n", "entry_point": "generate_list", "input": "3", "output": "['c', 'b', 'a', 'a', 'b', 'c']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44532_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030020", "code": "import ast\ndef extract_version_number(script_snippet):\n    tree = ast.parse(script_snippet)\n    version_number = None\n    for node in ast.walk(tree):\n        if isinstance(node, ast.Assign):\n            for target in node.targets:\n                if isinstance(target, ast.Name) and target.id == '__version__':\n                    version_number = node.value.s\n                    break\n    return version_number\n", "entry_point": "extract_version_number", "input": "'__version__ = \"2.5.7\"'", "output": "'2.5.7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13915_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030021", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9113", "output": "{1, 9113, 13, 701}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9112", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030022", "code": "import math\ndef wind_speed_magnitude(north_component, east_component):\n    # Calculate the wind speed magnitude using the formula: speed = sqrt(u^2 + v^2)\n    speed = math.sqrt(north_component**2 + east_component**2)\n    return speed\n", "entry_point": "wind_speed_magnitude", "input": "5, 3", "output": "5.830951894845301", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5141_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030023", "code": "def process_authors(simple_author_1):\n    list_tokenize_name = simple_author_1.split(\"and\")\n    authors_list = []\n    for tokenize_name in list_tokenize_name:\n        splitted = tokenize_name.split(\",\")\n        if len(splitted) > 1:\n            authors_list.append((splitted[0].strip(), splitted[1].strip()))\n        else:\n            tokenize_name = tokenize_name.split()\n            if len(tokenize_name) > 1:\n                authors_list.append((tokenize_name[0], tokenize_name[1]))\n            else:\n                authors_list.append((tokenize_name[0], ''))\n    return authors_list\n", "entry_point": "process_authors", "input": "'Alice, Bob'", "output": "[('Alice', 'Bob')]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82337_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030024", "code": "def calculate_digital_root(n):\n    n = str(n)\n    sum_digits = 0\n    for digit in n:\n        sum_digits += int(digit)\n    if sum_digits < 10:\n        return sum_digits\n    else:\n        return calculate_digital_root(sum_digits)\n", "entry_point": "calculate_digital_root", "input": "17", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118599_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030025", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "9", "output": "'IX'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030026", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3475", "output": "{1, 5, 139, 3475, 695, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3474", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030027", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 88, 88, 84, 76]", "output": "[95, 88, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113414_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030028", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5245", "output": "{1, 5, 5245, 1049}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5244", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030029", "code": "def calculate_product(int_list):\n    product = 1\n    for num in int_list:\n        product *= num\n    return product if int_list else 1\n", "entry_point": "calculate_product", "input": "[]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129401_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030030", "code": "from typing import List\ndef generate_final_tx_hex(components: List[int]) -> str:\n    final_tx = sum(components)\n    return hex(final_tx)\n", "entry_point": "generate_final_tx_hex", "input": "[28]", "output": "'0x1c'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35557_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030031", "code": "def increment_and_return(initial_value):\n    original_value = initial_value\n    initial_value += 10\n    return str(original_value)\n", "entry_point": "increment_and_return", "input": "7", "output": "'7'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96167_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030032", "code": "def process_string(input_string):\n    items = []\n    if ';' in input_string:\n        first = True\n        for tmp in input_string.split(';'):\n            if not first and tmp.startswith(' '):\n                tmp = tmp[1:]\n            items.append(tmp)\n            first = False\n    else:\n        items = [input_string]\n    return items\n", "entry_point": "process_string", "input": "'appcherryle;'", "output": "['appcherryle', '']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98221_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030033", "code": "import re\nimport datetime\ndef convert_duration_to_seconds(val):\n    match = re.match(r'^(\\d+)([smhdwy])$', val)\n    if not match:\n        raise ValueError(\"Invalid input format\")\n    unit = {\n        's': 'seconds',\n        'm': 'minutes',\n        'h': 'hours',\n        'd': 'days',\n        'w': 'weeks',\n    }[match.group(2)]\n    td = datetime.timedelta(**{unit: int(match.group(1))})\n    return (td.days * 86400) + td.seconds\n", "entry_point": "convert_duration_to_seconds", "input": "'5m'", "output": "300", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49310_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030034", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7099", "output": "{1, 7099, 229, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7098", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030035", "code": "def calculate_total_hunger(food_items):\n    food_hunger_dict = {}\n    for food, hunger in food_items:\n        if food in food_hunger_dict:\n            food_hunger_dict[food] += hunger\n        else:\n            food_hunger_dict[food] = hunger\n    total_hunger = sum(food_hunger_dict.values())\n    return total_hunger\n", "entry_point": "calculate_total_hunger", "input": "[('apple', 3), ('banana', 5)]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25226_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030036", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    output_list = [input_list[i] + input_list[(i + 1) % len(input_list)] for i in range(len(input_list))]\n    return output_list\n", "entry_point": "process_list", "input": "[3, 3, 4, 2, 4, 2, 1, 0]", "output": "[6, 7, 6, 6, 6, 3, 1, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19673_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030037", "code": "def calculate_cumulative_power(input_list):\n    cumulative_power = []\n    total = 0\n    for num in input_list:\n        total += num\n        cumulative_power.append(total)\n    return cumulative_power\n", "entry_point": "calculate_cumulative_power", "input": "[1, 7, 3, 5, 3, 1, 1, 7, 1]", "output": "[1, 8, 11, 16, 19, 20, 21, 28, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15134_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030038", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5171", "output": "{1, 5171}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030039", "code": "from typing import List\ndef convert_to_milliseconds(task_durations: List[int]) -> List[int]:\n    milliseconds_durations = [duration * 1000 for duration in task_durations]\n    return milliseconds_durations\n", "entry_point": "convert_to_milliseconds", "input": "[5, 10, 15, 20]", "output": "[5000, 10000, 15000, 20000]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30331_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030040", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5871", "output": "{1, 3, 1957, 103, 5871, 19, 309, 57}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030041", "code": "def insert_position(scores, new_score):\n    position = 0\n    for score in scores:\n        if new_score >= score:\n            position += 1\n        else:\n            break\n    return position\n", "entry_point": "insert_position", "input": "[80, 90], 90", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26274_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030042", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5294", "output": "{1, 2, 5294, 2647}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5293", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030043", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9511", "output": "{1, 9511}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9510", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030044", "code": "def circular_sum(input_list):\n    result = []\n    for i in range(len(input_list)):\n        circular_sum_value = input_list[i] + input_list[(i + 1) % len(input_list)]\n        result.append(circular_sum_value)\n    return result\n", "entry_point": "circular_sum", "input": "[2, 4, 2, 2, 2, 1, 1, 1, 4]", "output": "[6, 6, 4, 4, 3, 2, 2, 5, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113927_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030045", "code": "def extract_app_config(default_app_config: str) -> str:\n    # Split the input string by dot ('.')\n    config_parts = default_app_config.split('.')\n    # Extract the last element which represents the class name\n    app_config_class = config_parts[-1]\n    return app_config_class\n", "entry_point": "extract_app_config", "input": "'some.module.path.snsorArAtlasnfig'", "output": "'snsorArAtlasnfig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16096_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030046", "code": "def sum_divisible_by_2_and_3(input_list):\n    total_sum = 0\n    for num in input_list:\n        if num % 2 == 0 and num % 3 == 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_divisible_by_2_and_3", "input": "[6, 6, 12]", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87733_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030047", "code": "from typing import List\ndef find_disabled_com_ports(available_ports: List[str], enabled_ports: List[str]) -> List[str]:\n    disabled_ports = [port for port in available_ports if port not in enabled_ports]\n    return disabled_ports\n", "entry_point": "find_disabled_com_ports", "input": "['COM1', 'COM2', 'COM3'], ['COM1', 'COM2', 'COM3']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_14007_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030048", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4643", "output": "{1, 4643}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030049", "code": "SEPARATOR = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']\ndef custom_word_splitter(string: str) -> list:\n    result = ''\n    for char in string:\n        if char in SEPARATOR:\n            result += ' '\n        else:\n            result += char\n    words = []\n    current_word = ''\n    for char in result:\n        if char == ' ':\n            if current_word:\n                words.append(current_word)\n                current_word = ''\n        else:\n            current_word += char\n    if current_word:\n        words.append(current_word)\n    return words\n", "entry_point": "custom_word_splitter", "input": "'hhelhe:eh'", "output": "['hhelhe', 'eh']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16613_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030050", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "455", "output": "{1, 65, 35, 5, 7, 455, 13, 91}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt454", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030051", "code": "from typing import List\ndef reverse_mask(mask: List[int]) -> List[int]:\n    reversed_mask = []\n    for i in range(len(mask) - 1, -1, -1):\n        reversed_mask.append(mask[i])\n    return reversed_mask\n", "entry_point": "reverse_mask", "input": "[0, 2, 2]", "output": "[2, 2, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9004_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030052", "code": "def longest_palindromic_substring(s):\n    if not s:\n        return \"\"\n    start, end = 0, 0\n    def expand_around_center(s, left, right):\n        while left >= 0 and right < len(s) and s[left] == s[right]:\n            left -= 1\n            right += 1\n        return right - left - 1\n    for i in range(len(s)):\n        len1 = expand_around_center(s, i, i)\n        len2 = expand_around_center(s, i, i + 1)\n        max_len = max(len1, len2)\n        if max_len > end - start:\n            start = i - (max_len - 1) // 2\n            end = i + max_len // 2\n    return s[start:end+1]\n", "entry_point": "longest_palindromic_substring", "input": "'dddddddd'", "output": "'dddddddd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19837_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030053", "code": "def handle_translation_error(error_type):\n    error_messages = {\n        \"DetectionError\": \"Error detecting the language of the input text.\",\n        \"DetectionNotSupportedError\": \"Language detection is not supported for this engine.\",\n        \"TranslationError\": \"Error performing or parsing the translation.\",\n        \"EngineApiError\": \"An error reported by the translation service API.\",\n        \"UnsupportedLanguagePairError\": \"The specified language pair is not supported for translation.\",\n        \"InvalidISO6391CodeError\": \"Invalid ISO-639-1 language code provided.\",\n        \"AlignmentNotSupportedError\": \"Alignment is not supported for this language combination.\"\n    }\n    return error_messages.get(error_type, \"Unknown translation error\")\n", "entry_point": "handle_translation_error", "input": "'TranslationError'", "output": "'Error performing or parsing the translation.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_48630_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030054", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "538", "output": "{1, 538, 2, 269}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt537", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030055", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "857", "output": "{857, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt856", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030056", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6518", "output": "{1, 2, 3259, 6518}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6517", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030057", "code": "def process_list(input_list, threshold):\n    modified_list = []\n    current_sum = 0\n    for num in input_list:\n        if num < threshold:\n            modified_list.append(num)\n        else:\n            current_sum += num\n            modified_list.append(current_sum)\n    return modified_list\n", "entry_point": "process_list", "input": "[1, 3, 5, 2, 8], 5", "output": "[1, 3, 5, 2, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129571_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030058", "code": "def calculate_digit_sum(number):\n    sum = 0\n    while number != 0:\n        modulus = number % 10\n        sum += modulus\n        number //= 10  # Use integer division to get the next digit\n    return sum\n", "entry_point": "calculate_digit_sum", "input": "7", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95112_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030059", "code": "def simulate_market_diff(symbols):\n    results = []\n    def subscribe_market_diff(symbol):\n        nonlocal results\n        results.append({'stream': 'marketDiff', 'symbol': symbol})  # Simulated message\n    for symbol in symbols:\n        subscribe_market_diff(symbol)\n    for result in results:\n        if result.get('stream') == 'marketDiff':\n            return result\n", "entry_point": "simulate_market_diff", "input": "['BTC']", "output": "{'stream': 'marketDiff', 'symbol': 'BTC'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32092_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030060", "code": "from numbers import Integral\ndef is_lone_coo(where):\n    \"\"\"Check if ``where`` has been specified as a single coordinate triplet.\"\"\"\n    return len(where) == 3 and isinstance(where[0], Integral)\n", "entry_point": "is_lone_coo", "input": "(1, 2, 3)", "output": "True", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106857_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030061", "code": "import re\ndef redact_sensitive_info(input_str):\n    # Define regular expressions to match the patterns to be replaced\n    pattern1 = r'(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])'\n    pattern2 = r'(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])'\n    # Replace the patterns with 'SECRET' in the input string\n    redacted_str = re.sub(pattern1, 'SECRET', input_str)\n    redacted_str = re.sub(pattern2, 'SECRET', redacted_str)\n    return redacted_str\n", "entry_point": "redact_sensitive_info", "input": "'IID'", "output": "'IID'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93780_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030062", "code": "from typing import List\ndef custom_sum(input_list: List[int]) -> int:\n    if not input_list:  # Base case: empty list\n        return 0\n    else:\n        return input_list.pop() + custom_sum(input_list)\n", "entry_point": "custom_sum", "input": "[4]", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145591_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030063", "code": "from typing import List\ndef unique_pairs_sum(numbers: List[int], target: int) -> int:\n    unique_pairs = set()\n    total_sum = 0\n    for num in numbers:\n        complement = target - num\n        if complement in unique_pairs:\n            total_sum += num + complement\n            unique_pairs.remove(complement)\n        else:\n            unique_pairs.add(num)\n    return total_sum\n", "entry_point": "unique_pairs_sum", "input": "[4, 5], 9", "output": "9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_9277_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030064", "code": "def filter_and_sort_even_numbers(input_list):\n    # Filter out even numbers from the input list\n    even_numbers = [num for num in input_list if num % 2 == 0]\n    # Sort the even numbers in descending order\n    even_numbers.sort(reverse=True)\n    return even_numbers\n", "entry_point": "filter_and_sort_even_numbers", "input": "[1, 3, 6, 6, 6, 5, 2]", "output": "[6, 6, 6, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19600_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030065", "code": "import os\ndef generate_unique_file_path(input_string: str) -> str:\n    base_path = f\"{input_string}\"\n    suffix = 1\n    file_path = f\"{base_path}_{suffix}\"\n    while os.path.exists(file_path):\n        suffix += 1\n        file_path = f\"{base_path}_{suffix}\"\n    return file_path\n", "entry_point": "generate_unique_file_path", "input": "'ffileile'", "output": "'ffileile_1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104438_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030066", "code": "from typing import List, Tuple\ndef process_envi_data(data: str) -> Tuple[List[str], List[str]]:\n    data = data.strip()\n    data = data.replace(\"description = {\\n\", \"description = {\")\n    data = data.replace(\"band names = {\\n\", \"band names = {\")\n    lines = data.split(\"\\n\")\n    bandname_lines = []\n    non_bandname_lines = []\n    for line in lines:\n        if \"band names = {\" in line:\n            bandname_lines.append(line)\n        else:\n            non_bandname_lines.append(line)\n    return bandname_lines, non_bandname_lines\n", "entry_point": "process_envi_data", "input": "'nmee'", "output": "([], ['nmee'])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140212_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030067", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[9, 7, 8, 7, 4, 7, 1, 7]", "output": "[9, 8, 10, 10, 8, 12, 7, 14]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030068", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5014", "output": "{1, 2, 2507, 109, 46, 5014, 23, 218}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5013", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030069", "code": "from typing import List\ndef dna_impact_factor(s: str, p: List[int], q: List[int]) -> List[int]:\n    response = ['T'] * len(p)\n    for i, nucleotide in enumerate(s):\n        for k, (start, end) in enumerate(zip(p, q)):\n            if start <= i <= end and nucleotide < response[k]:\n                response[k] = nucleotide\n    impact_factor = {'A': 1, 'C': 2, 'G': 3, 'T': 4}\n    return [impact_factor[n] for n in response]\n", "entry_point": "dna_impact_factor", "input": "'TTTTTT', [0, 0, 0, 0, 0], [5, 5, 5, 5, 5]", "output": "[4, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94722_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030070", "code": "def counting_sort(array):\n    max_element = max(array)\n    count = [0] * (max_element + 1)\n    for num in array:\n        count[num] += 1\n    for i in range(1, len(count)):\n        count[i] += count[i - 1]\n    result = [0] * len(array)\n    for num in array:\n        result[count[num] - 1] = num\n        count[num] -= 1\n    return result\n", "entry_point": "counting_sort", "input": "[5, 1, 6, 2, 6, 8]", "output": "[1, 2, 5, 6, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55301_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030071", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    if len(unique_scores) <= 3:\n        return unique_scores\n    else:\n        return unique_scores[:3]\n", "entry_point": "top_three_scores", "input": "[100, 79, 78, 79, 50, 60]", "output": "[100, 79, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132512_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030072", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4559", "output": "{1, 47, 97, 4559}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4558", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030073", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9934", "output": "{1, 2, 9934, 4967}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030074", "code": "from typing import List\ndef calculate_max_score(scores: List[int]) -> int:\n    if not scores:\n        return 0\n    n = len(scores)\n    if n == 1:\n        return scores[0]\n    dp = [0] * n\n    dp[0] = scores[0]\n    dp[1] = max(scores[0], scores[1])\n    for i in range(2, n):\n        dp[i] = max(scores[i] + dp[i - 2], dp[i - 1])\n    return dp[-1]\n", "entry_point": "calculate_max_score", "input": "[10, 20, 30]", "output": "40", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64203_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030075", "code": "def sum_divisible_elements(matrix, divisor):\n    sum_divisible = 0\n    for row in matrix:\n        for element in row:\n            if element % divisor == 0:\n                sum_divisible += element\n    return sum_divisible\n", "entry_point": "sum_divisible_elements", "input": "[[10], [20], [20]], 10", "output": "50", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13345_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030076", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1985", "output": "{1, 1985, 5, 397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030077", "code": "def process_integers(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 2 == 0:  # Check if the number is even\n            output_list.append(num ** 2)  # Square the even number\n        else:\n            output_list.append(num ** 3)  # Cube the odd number\n    return output_list\n", "entry_point": "process_integers", "input": "[0, 4, 3, 5, 4]", "output": "[0, 16, 27, 125, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122191_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030078", "code": "def process_error_handlers(error_handlers):\n    error_dict = {}\n    for code, template in reversed(error_handlers):\n        error_dict[code] = template\n    return error_dict\n", "entry_point": "process_error_handlers", "input": "[(403, 'forbidden.html.j2')]", "output": "{403: 'forbidden.html.j2'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_5735_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030079", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "866", "output": "{433, 1, 866, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt865", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030080", "code": "def parse_group_name(group_name):\n    idx = group_name.rfind('/')\n    if idx < 0:\n        raise ValueError('Bad group name: ' + group_name)\n    prefix = group_name[:idx]\n    vv = group_name[idx+1:].split('_')\n    if len(vv) != 2:\n        raise ValueError('Bad group name: ' + group_name)\n    return tuple([int(v) for v in vv]), prefix\n", "entry_point": "parse_group_name", "input": "'my_group/789_1011'", "output": "((789, 1011), 'my_group')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119263_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030081", "code": "def process_list(input_list):\n    result = []\n    for index, num in enumerate(input_list):\n        if num >= 0:\n            result.append(num + index)\n    return result\n", "entry_point": "process_list", "input": "[2, 0, 10, 10, 4]", "output": "[2, 1, 12, 13, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36366_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030082", "code": "def coordinates_to_dict(coordinates):\n    coord_dict = {}\n    for x, y in coordinates:\n        if x not in coord_dict:\n            coord_dict[x] = [y]\n        else:\n            coord_dict[x].append(y)\n    return coord_dict\n", "entry_point": "coordinates_to_dict", "input": "[(5, 10), (10, 15), (15, 20)]", "output": "{5: [10], 10: [15], 15: [20]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63199_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030083", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9532", "output": "{1, 2, 4, 2383, 9532, 4766}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9531", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030084", "code": "def simple_remove_letters(text: str) -> str:\n    # Remove commas\n    text = text.replace(\",\", \"\")\n    # Remove periods\n    text = text.replace(\".\", \"\")\n    return text\n", "entry_point": "simple_remove_letters", "input": "'is'", "output": "'is'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96124_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030085", "code": "from typing import Dict\nunits: Dict[str, int] = {\n    \"cryptodoge\": 10 ** 6,\n    \"mojo\": 1,\n    \"colouredcoin\": 10 ** 3,\n}\ndef convert_mojos_to_unit(amount: int, target_unit: str) -> float:\n    if target_unit in units:\n        conversion_factor = units[target_unit]\n        converted_amount = amount / conversion_factor\n        return converted_amount\n    else:\n        return f\"Conversion to {target_unit} is not supported.\"\n", "entry_point": "convert_mojos_to_unit", "input": "10, 'coloucolcoin'", "output": "'Conversion to coloucolcoin is not supported.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24392_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030086", "code": "from typing import List\ndef top5_average(scores: List[int]) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_students = min(5, len(sorted_scores))\n    return sum(sorted_scores[:top_students]) / top_students\n", "entry_point": "top5_average", "input": "[100, 98, 98, 95, 92]", "output": "96.6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120880_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030087", "code": "def ungetc_simulate(c, file_ptr):\n    # Decrement the file pointer position by 1\n    file_ptr -= 1\n    # Return the character c masked with 0xff\n    return c & 0xff\n", "entry_point": "ungetc_simulate", "input": "60, 0", "output": "60", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84262_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030088", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3053", "output": "{1, 43, 3053, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3052", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030089", "code": "def cfg_string_to_list(input_string):\n    if \",\" in input_string:\n        output_list = input_string.split(\",\")\n    else:\n        output_list = [input_string]\n    return output_list\n", "entry_point": "cfg_string_to_list", "input": "'apple,ba,watwae'", "output": "['apple', 'ba', 'watwae']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53992_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030090", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1335", "output": "{1, 3, 5, 267, 15, 1335, 89, 445}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1334", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030091", "code": "def incrementInteger(arr):\n    carry = 1\n    for i in range(len(arr) - 1, -1, -1):\n        arr[i] += carry\n        carry = arr[i] // 10\n        arr[i] %= 10\n        if carry == 0:\n            break\n    if carry:\n        arr.insert(0, carry)\n    return arr\n", "entry_point": "incrementInteger", "input": "[2, 6, 2, 6, 6, 3, 6]", "output": "[2, 6, 2, 6, 6, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54452_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030092", "code": "def search_communities(communities, search_query):\n    result = []\n    for community in communities:\n        if search_query.lower() in community['city'].lower():\n            result.append(community['name'])\n    return result\n", "entry_point": "search_communities", "input": "[], 'SomeCity'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7973_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030093", "code": "def get_gpio_pin_number(conf):\n    if isinstance(conf, int):\n        return conf\n    return conf['CONF_NUMBER']\n", "entry_point": "get_gpio_pin_number", "input": "{'CONF_NUMBER': 5}", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137835_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030094", "code": "def longest_common_prefix(strs):\n    if not strs:\n        return 0\n    prefix = strs[0]\n    for string in strs[1:]:\n        i = 0\n        while i < len(prefix) and i < len(string) and prefix[i] == string[i]:\n            i += 1\n        prefix = prefix[:i]\n    return len(prefix)\n", "entry_point": "longest_common_prefix", "input": "['flower', 'flow', 'flight']", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138731_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030095", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2741", "output": "{1, 2741}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2740", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030096", "code": "import re\ndef count_word_frequency(text):\n    word_freq = {}\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        word_freq[word] = word_freq.get(word, 0) + 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'worlld'", "output": "{'worlld': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84514_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030097", "code": "def find_unique_elements(input_list):\n    seen = set()\n    unique_elements = []\n    for element in input_list:\n        if element not in seen:\n            seen.add(element)\n            unique_elements.append(element)\n    return unique_elements\n", "entry_point": "find_unique_elements", "input": "[1, 1, 5, 7, 4, 4]", "output": "[1, 5, 7, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105191_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030098", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3101", "output": "{1, 443, 3101, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3100", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030099", "code": "import string\ndef process_text(text: str) -> str:\n    # Remove all punctuation\n    text = text.translate(str.maketrans(\"\", \"\", string.punctuation))\n    # Convert all upper case to lower case\n    text = text.lower()\n    return text\n", "entry_point": "process_text", "input": "'THH!'", "output": "'thh'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66156_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030100", "code": "from difflib import SequenceMatcher\ndef calculate_similarity_ratio(str1, str2):\n    matcher = SequenceMatcher(None, str1, str2)\n    match = matcher.find_longest_match(0, len(str1), 0, len(str2))\n    longest_common_subsequence_length = match.size\n    max_length = max(len(str1), len(str2))\n    if max_length == 0:\n        return 1.0  # Handle case where both strings are empty\n    similarity_ratio = longest_common_subsequence_length / max_length\n    return similarity_ratio\n", "entry_point": "calculate_similarity_ratio", "input": "'abc', 'aaz'", "output": "0.3333333333333333", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126755_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030101", "code": "def error_ratio(actual, expected):\n    return (actual - expected) / expected\n", "entry_point": "error_ratio", "input": "13.0, 8.0", "output": "0.625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61189_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030102", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1375", "output": "{1, 5, 11, 275, 55, 25, 125, 1375}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1374", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030103", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7493", "output": "{1, 59, 7493, 127}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7492", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030104", "code": "from typing import List\nimport heapq\ndef min_time_to_complete_tasks(tasks: List[int], num_concurrent: int) -> int:\n    if not tasks:\n        return 0\n    tasks.sort()  # Sort tasks in ascending order of processing times\n    pq = []  # Priority queue to store the next available task to start\n    time = 0\n    running_tasks = []\n    for task in tasks:\n        while len(running_tasks) >= num_concurrent:\n            next_task_time, next_task = heapq.heappop(pq)\n            time = max(time, next_task_time)\n            running_tasks.remove(next_task)\n        time += task\n        running_tasks.append(task)\n        heapq.heappush(pq, (time, task))\n    return max(time, max(pq)[0])  # Return the maximum time taken to complete all tasks\n", "entry_point": "min_time_to_complete_tasks", "input": "[10, 11, 12], 3", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10650_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030105", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7383", "output": "{1, 321, 3, 69, 107, 23, 7383, 2461}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7382", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030106", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2308", "output": "{1, 2, 1154, 2308, 4, 577}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2307", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030107", "code": "def top_three_scores(scores):\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[101, 91, 90, 80, 70, 60, 50]", "output": "[101, 91, 90]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139938_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030108", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4441", "output": "{4441, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030109", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 93, 90, 94, 85, 80]", "output": "[95, 94, 93]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030110", "code": "def split_odd_even(input_list):\n    odd_list = []\n    even_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    return odd_list, even_list\n", "entry_point": "split_odd_even", "input": "[5, 5, 3, 3, 5, 6, 8, 6]", "output": "([5, 5, 3, 3, 5], [6, 8, 6])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144374_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030111", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3695", "output": "{1, 739, 5, 3695}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3694", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030112", "code": "def parse_platform(curr_platform):\n    platform, compiler = curr_platform.split(\"_\")\n    output_folder_platform = \"\"\n    output_folder_compiler = \"\"\n    if platform.startswith(\"win\"):\n        output_folder_platform = \"Win\"\n        if \"vs2013\" in compiler:\n            output_folder_compiler = \"vc120\"\n        elif \"vs2015\" in compiler:\n            output_folder_compiler = \"vc140\"\n        elif \"vs2017\" in compiler:\n            output_folder_compiler = \"vc141\"\n    elif platform.startswith(\"darwin\"):\n        output_folder_platform = \"Mac\"\n        output_folder_compiler = \"clang\"\n    elif platform.startswith(\"linux\"):\n        output_folder_platform = \"Linux\"\n        output_folder_compiler = \"clang\"\n    return output_folder_platform, output_folder_compiler\n", "entry_point": "parse_platform", "input": "'win_unknown'", "output": "('Win', '')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142101_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030113", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3346", "output": "{1, 2, 7, 1673, 14, 239, 3346, 478}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3345", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030114", "code": "GAIN_FOUR = 2\nGAIN_ONE = 0\nGAIN_TWO = 1\nMODE_CONTIN = 0\nMODE_SINGLE = 16\nOSMODE_STATE = 128\ndef calculate_gain(mode, rate):\n    if mode == MODE_CONTIN:\n        return rate * GAIN_ONE\n    elif mode == MODE_SINGLE:\n        return rate + GAIN_TWO\n    elif mode == OSMODE_STATE:\n        return rate - GAIN_FOUR\n    else:\n        return \"Invalid mode\"\n", "entry_point": "calculate_gain", "input": "16, 5", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87824_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030115", "code": "def count_unique_sub_users(commands):\n    unique_sub_users = set()\n    for command in commands:\n        if command.startswith(\"iam delete-sub-user --sub-user '\") and command.endswith(\"'\"):\n            sub_user = command.split(\"'\")[1]\n            unique_sub_users.add(sub_user)\n    return len(unique_sub_users)\n", "entry_point": "count_unique_sub_users", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118463_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030116", "code": "def camel_to_snake_case(input_string):\n    snake_case_string = input_string[0].lower()\n    for char in input_string[1:]:\n        if char.isupper():\n            snake_case_string += '_' + char.lower()\n        else:\n            snake_case_string += char.lower()\n    return snake_case_string\n", "entry_point": "camel_to_snake_case", "input": "'TisIsCmhThd'", "output": "'tis_is_cmh_thd'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41276_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030117", "code": "def sum_consecutive_pairs(input_list):\n    output_list = []\n    for i in range(0, len(input_list), 2):\n        if i == len(input_list) - 1:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + input_list[i + 1])\n    return output_list\n", "entry_point": "sum_consecutive_pairs", "input": "[3, 4, 2, 3, 3]", "output": "[7, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143188_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030118", "code": "def fizz_buzz(input_list):\n    output_list = []\n    for num in input_list:\n        if num % 3 == 0 and num % 5 == 0:\n            output_list.append('FizzBuzz')\n        elif num % 3 == 0:\n            output_list.append('Fizz')\n        elif num % 5 == 0:\n            output_list.append('Buzz')\n        else:\n            output_list.append(num)\n    return output_list\n", "entry_point": "fizz_buzz", "input": "[1, 4, 3, 6, 9]", "output": "[1, 4, 'Fizz', 'Fizz', 'Fizz']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_117515_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030119", "code": "def calculate_moving_average(nums, k):\n    moving_averages = []\n    for i in range(len(nums) - k + 1):\n        window_sum = sum(nums[i:i+k])\n        moving_averages.append(window_sum / k)\n    return moving_averages\n", "entry_point": "calculate_moving_average", "input": "[3.0], 1", "output": "[3.0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143205_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030120", "code": "def parse_yaml(yaml_str):\n    def parse_value(value):\n        if value.startswith('{') and value.endswith('}'):\n            return parse_yaml(value[1:-1])\n        try:\n            return int(value)\n        except ValueError:\n            return value.strip()\n    yaml_dict = {}\n    pairs = yaml_str.split(',')\n    for pair in pairs:\n        key_value = pair.split(':', 1)\n        key = key_value[0].strip()\n        value = key_value[1].strip()\n        yaml_dict[key] = parse_value(value)\n    return yaml_dict\n", "entry_point": "parse_yaml", "input": "'address: '", "output": "{'address': ''}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102075_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030121", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4430", "output": "{1, 2, 5, 2215, 10, 4430, 886, 443}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4429", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030122", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4189", "output": "{1, 59, 4189, 71}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030123", "code": "import re\nBLOCKED_KEYWORDS = [\"apple\", \"banana\", \"orange\"]\ndef replace_blocked_keywords(text):\n    modified_text = text.lower()\n    for keyword in BLOCKED_KEYWORDS:\n        modified_text = re.sub(r'\\b' + re.escape(keyword) + r'\\b', '*' * len(keyword), modified_text, flags=re.IGNORECASE)\n    return modified_text\n", "entry_point": "replace_blocked_keywords", "input": "'iii'", "output": "'iii'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141680_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030124", "code": "def generate_package_name(name):\n    path = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    return path\n", "entry_point": "generate_package_name", "input": "'Yme'", "output": "'yme'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21989_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030125", "code": "def parse_version(version_str):\n    # Split the version number string using the dot as the delimiter\n    version_parts = version_str.split('.')\n    # Convert the version number components to integers\n    major = int(version_parts[0])\n    minor = int(version_parts[1])\n    patch = int(version_parts[2])\n    # Return a tuple containing the major, minor, and patch version numbers\n    return major, minor, patch\n", "entry_point": "parse_version", "input": "'363.31.36'", "output": "(363, 31, 36)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42795_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030126", "code": "def generate_lower_version(existing_version):\n    # Parse the existing version number\n    major, minor, patch = map(int, existing_version.split('.'))\n    # Decrease the version number\n    if minor > 0:\n        new_version = f\"{major}.{minor-1}.0\"\n    else:\n        new_version = f\"{major-1}.9.0\"\n    return new_version\n", "entry_point": "generate_lower_version", "input": "'2.55.0'", "output": "'2.54.0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69517_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030127", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4934", "output": "{1, 2, 2467, 4934}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4933", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030128", "code": "def results_dict_kpi_check(benchmark_config, results_dict, threshold):\n    for kpi_key, kpi_threshold in benchmark_config.items():\n        if kpi_key in results_dict:\n            if results_dict[kpi_key] > kpi_threshold:\n                return 1  # Failure code if KPI value exceeds threshold\n        else:\n            return 1  # Failure code if KPI key is missing in results dictionary\n    return 0  # Success code if all KPI values are within threshold\n", "entry_point": "results_dict_kpi_check", "input": "{'kpi1': 10, 'kpi2': 20}, {'kpi1': 5, 'kpi2': 15}, None", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31521_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030129", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2936", "output": "{1, 2, 4, 8, 367, 2936, 1468, 734}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2935", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030130", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6413", "output": "{1, 583, 11, 6413, 53, 121}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6412", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030131", "code": "from typing import List, Dict\ndef get_tags(tags: List[Dict[str, str]]) -> List[str]:\n    tag_list = [tag[\"name\"] for tag in tags]\n    return tag_list\n", "entry_point": "get_tags", "input": "[{'name': 'apple'}, {'name': 'orange'}]", "output": "['apple', 'orange']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87975_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030132", "code": "import os\ndef construct_file_path(coord_path, accid):\n    return os.path.join(coord_path, accid)\n", "entry_point": "construct_file_path", "input": "'am/home/user/datae/a', '112344541'", "output": "'am/home/user/datae/a/112344541'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107400_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030133", "code": "import os\ndef process_file_name(file_name):\n    short_name = os.path.splitext(file_name)[0]\n    if not short_name + '.com' == file_name:\n        raise SyntaxError('Problem interpreting file name. Period in file name?')\n    out_name = short_name + '.out'\n    return out_name\n", "entry_point": "process_file_name", "input": "'photo.jppg.com'", "output": "'photo.jppg.out'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4575_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030134", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7615", "output": "{1, 1523, 5, 7615}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7614", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030135", "code": "def convert_to_single_currency(money):\n    converted_money = money.copy()  # Create a copy of the original list\n    # Convert Currency 1 to Currency 2\n    converted_money[1] = converted_money[0] * 2\n    # Convert Currency 2 to Currency 3\n    converted_money[2] = converted_money[1] * 3\n    return converted_money\n", "entry_point": "convert_to_single_currency", "input": "[5, 0, 0]", "output": "[5, 10, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30675_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030136", "code": "def best_stock(data):\n    max_price = 0\n    best_stock = ''\n    for stock, price in data.items():\n        if price > max_price:\n            max_price = price\n            best_stock = stock\n    return best_stock\n", "entry_point": "best_stock", "input": "{}", "output": "''", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_147578_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030137", "code": "def find_largest_set(sets):\n    max_set = set()\n    max_size = 0\n    for s in sets:\n        if len(s) > max_size:\n            max_set = s\n            max_size = len(s)\n    return max_set\n", "entry_point": "find_largest_set", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_19085_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030138", "code": "import re\ndef clean_network_names(networks):\n    network_names_list = re.findall(\"(?:Profile\\s*:\\s)(.*)\", networks)\n    lis = network_names_list[0].split(\"\\\\r\\\\n\")\n    network_names = []\n    for i in lis:\n        if \":\" in i:\n            index = i.index(\":\")\n            network_names.append(i[index + 2 :])\n        else:\n            network_names.append(i)\n    cleaned_network_names = [name.strip() for name in network_names if name.strip()]\n    return cleaned_network_names\n", "entry_point": "clean_network_names", "input": "'Profile : W\\\\r\\\\n'", "output": "['W']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144248_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030139", "code": "from typing import List\ndef average_top_n_scores(scores: List[int], n: int) -> float:\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:n]\n    if not top_scores:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_n_scores", "input": "[200], 1", "output": "200.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141696_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030140", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5803", "output": "{1, 5803, 829, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5802", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030141", "code": "from typing import List\ndef add_index_to_element(nums: List[int]) -> List[int]:\n    result = []\n    for i, num in enumerate(nums):\n        result.append(num + i)\n    return result\n", "entry_point": "add_index_to_element", "input": "[1, 2, 0, 6, 4, 3, 3, 4]", "output": "[1, 3, 2, 9, 8, 8, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110489_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030142", "code": "import os\ndef absolute_path(base_path, file_name):\n    return os.path.join(base_path, file_name)\n", "entry_point": "absolute_path", "input": "'ttmodtcra', 'gru.hdfries.npy'", "output": "'ttmodtcra/gru.hdfries.npy'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_55467_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030143", "code": "def convert_version_tuple_to_string(version_info):\n    version_string = \".\".join([str(v) for v in version_info])\n    return version_string\n", "entry_point": "convert_version_tuple_to_string", "input": "(2, 3, 2, 3, 3, 1, 1, 2)", "output": "'2.3.2.3.3.1.1.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12346_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030144", "code": "from typing import Iterable\ndef target_matches_any(target: str, expected_targets: Iterable[str]) -> bool:\n    if target == \"*\":\n        return True\n    for expected in expected_targets:\n        if target == expected or expected == \"*\":\n            return True\n    return False\n", "entry_point": "target_matches_any", "input": "'apple', ['banana', 'orange']", "output": "False", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11534_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030145", "code": "def generate_sequence(n):\n    sequence = []\n    current_term = 1\n    for _ in range(n):\n        sequence.append(current_term)\n        if current_term % 2 == 0:\n            current_term //= 2\n        else:\n            current_term = 3 * current_term + 1\n    return sequence\n", "entry_point": "generate_sequence", "input": "3", "output": "[1, 4, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34120_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030146", "code": "def decrypt(encryptedText, key):\n    decryptedText = \"\"\n    key = key.lower().replace('\u0130', 'i')\n    encryptedText = encryptedText.lower()\n    i = 0\n    while i < len(encryptedText):\n        char = ord(encryptedText[i])\n        charOfKey = ord(key[i % len(key)])\n        if char >= 97 and char <= 122 and charOfKey >= 97 and charOfKey <= 122:\n            decryptedText += chr((char - charOfKey + 26) % 26 + 97)\n        else:\n            decryptedText += chr(char)\n        i += 1\n    return decryptedText\n", "entry_point": "decrypt", "input": "'ztttsjzttmpmptttsjs', 'a'", "output": "'ztttsjzttmpmptttsjs'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70304_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030147", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[10, 15, 15], 'add'", "output": "[40, 40, 40]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030148", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1371", "output": "{3, 1, 1371, 457}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1370", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030149", "code": "def max_index_multiplier(nums):\n    max_multiplier = 0\n    for i, num in enumerate(nums):\n        index_multiplier = i * num\n        max_multiplier = max(max_multiplier, index_multiplier)\n    return max_multiplier\n", "entry_point": "max_index_multiplier", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98912_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030150", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5757", "output": "{1, 3, 101, 303, 19, 57, 5757, 1919}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5756", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030151", "code": "import re\nSMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\\.?|via|vs\\.?'\nPUNCT = \"[!\\\"#$%&'\u2018()*+,-./:;?@[\\\\\\\\\\\\]_`{|}~]\"\nSMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I)\nINLINE_PERIOD = re.compile(r'[a-zA-Z][.][a-zA-Z]')\nUC_ELSEWHERE = re.compile(r'%s*?[a-zA-Z]+[A-Z]+?' % PUNCT)\nCAPFIRST = re.compile(r\"^%s*?([A-Za-z])\" % PUNCT)\nSMALL_FIRST = re.compile(r'^(%s*)(%s)\\b' % (PUNCT, SMALL), re.I)\nSMALL_LAST = re.compile(r'\\b(%s)%s?$' % (SMALL, PUNCT), re.I)\nSUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)\ndef correct_capitalization(text):\n    text = text.strip()\n    text = CAPFIRST.sub(lambda m: m.group(0).upper(), text)\n    text = INLINE_PERIOD.sub(lambda m: m.group(0).replace('.', '. '), text)\n    text = UC_ELSEWHERE.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_FIRST.sub(lambda m: m.group(0).upper(), text)\n    text = SMALL_LAST.sub(lambda m: m.group(0).upper(), text)\n    text = SUBPHRASE.sub(lambda m: m.group(0).upper(), text)\n    return text\n", "entry_point": "correct_capitalization", "input": "'text. sample'", "output": "'Text. sample'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130633_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030152", "code": "from collections import Counter\ndef max_score(card, k):\n    c = Counter(card)\n    ans = 0\n    while k > 0:\n        tmp = c.pop(c.most_common(1)[0][0])\n        if k > tmp:\n            ans += tmp * tmp\n            k -= tmp\n        else:\n            ans += k * k\n            k = 0\n    return ans\n", "entry_point": "max_score", "input": "[1], 1", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62809_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030153", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7193", "output": "{1, 7193}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030154", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1883", "output": "{1, 1883, 269, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1882", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030155", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "-1", "output": "{'int': '-1'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030156", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4786", "output": "{2393, 1, 4786, 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4785", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030157", "code": "def calculate_score(numbers):\n    total = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total += num\n    if total > 30:\n        return \"High Score!\"\n    else:\n        return total\n", "entry_point": "calculate_score", "input": "[3, 6, 9, 9]", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123213_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030158", "code": "import logging\ndef update_logger_level(logger_name, level):\n    # Retrieve the logger object based on the provided logger_name\n    logger = logging.getLogger(logger_name)\n    # Set the logging level of the logger to the input level\n    logger.setLevel(level)\n    # Return the updated logging level\n    return logger.getEffectiveLevel()\n", "entry_point": "update_logger_level", "input": "'my_logger', 25", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142129_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030159", "code": "def count_distinct_items(collection):\n    distinct_items = set(collection)\n    return len(distinct_items)\n", "entry_point": "count_distinct_items", "input": "['a', 'b', 'c', 'd']", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33388_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030160", "code": "import os\ndef fullServerPath(base, path):\n    if isinstance(path, str):\n        if path and path[0] not in ('/', '.'):\n            return os.path.join(base, path)\n        else:\n            return path\n    else:\n        return path\n", "entry_point": "fullServerPath", "input": "'/some/base/path', '/vaa/im/ges/logong'", "output": "'/vaa/im/ges/logong'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67991_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030161", "code": "from collections import Counter\ndef char_counter(text):\n    char_counts = Counter(text)\n    modified_text = ''.join([f\"{char}{count}\" for char, count in char_counts.items()])\n    return modified_text\n", "entry_point": "char_counter", "input": "'aaa'", "output": "'a3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105653_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030162", "code": "import struct\nDEK_LEN_BYTES = 4\ndef encode_dek_length(dek_length):\n    try:\n        # Pack the DEK length into a byte array of fixed size\n        encoded_length = struct.pack('>I', dek_length)\n        # Ensure the byte array is of the specified length\n        if len(encoded_length) != DEK_LEN_BYTES:\n            raise ValueError(\"Invalid DEK length encoding\")\n        return encoded_length\n    except struct.error as e:\n        print(f\"Error encoding DEK length: {e}\")\n        return None\n", "entry_point": "encode_dek_length", "input": "1023", "output": "b'\\x00\\x00\\x03\\xff'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_3297_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030163", "code": "from typing import List\ndef get_selinux_state(policies: List[str]) -> str:\n    enforcing_count = 0\n    permissive_count = 0\n    for policy in policies:\n        if policy == \"enforcing\":\n            enforcing_count += 1\n        elif policy == \"permissive\":\n            permissive_count += 1\n    if enforcing_count == len(policies):\n        return \"enforcing\"\n    elif permissive_count == len(policies):\n        return \"permissive\"\n    else:\n        return \"mixed\"\n", "entry_point": "get_selinux_state", "input": "['permissive']", "output": "'permissive'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24751_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030164", "code": "def find_first_call_instruction(instruction_list, begin, call_instruction):\n    '''\n    Returns the address of the instruction below the first occurrence of the specified call instruction.\n    '''\n    prev_instruction = None\n    for instruction in instruction_list[begin:]:\n        if prev_instruction is not None and prev_instruction == call_instruction:\n            return instruction\n        prev_instruction = instruction\n", "entry_point": "find_first_call_instruction", "input": "[0, 1, 2, 3, 4, 5], 0, 4", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137706_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030165", "code": "def process_list(input_list):\n    if not input_list:\n        return []\n    total_sum = sum(input_list)\n    if total_sum > 100:\n        return [num for num in input_list if num % 2 == 0]\n    else:\n        return [num**2 for num in input_list]\n", "entry_point": "process_list", "input": "[20, 48, 30, 5]", "output": "[20, 48, 30]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18073_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030166", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[7, 4, 1, 7, 4, 1]", "output": "[7, 4, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030167", "code": "from decimal import Decimal\ndef toWei(ether):\n    return int(Decimal(ether) * Decimal('1000000000000000000'))\n", "entry_point": "toWei", "input": "9.96", "output": "9960000000000000852", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61433_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030168", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N <= 0:\n        return 0.0\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    if len(top_scores) == 0:\n        return 0.0\n    return sum(top_scores) / len(top_scores)\n", "entry_point": "average_top_scores", "input": "[90, 85, 83, 85], 4", "output": "85.75", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94918_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030169", "code": "def process_string(s):\n    if s.islower():\n        return s.upper()\n    return s\n", "entry_point": "process_string", "input": "'woorolrd'", "output": "'WOOROLRD'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45268_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030170", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3877", "output": "{1, 3877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3876", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030171", "code": "def remove_duplicates(follower_ids):\n    seen_ids = set()\n    unique_follower_ids = []\n    for follower_id in follower_ids:\n        if follower_id not in seen_ids:\n            seen_ids.add(follower_id)\n            unique_follower_ids.append(follower_id)\n    return unique_follower_ids\n", "entry_point": "remove_duplicates", "input": "[4, 4, 7, 9, 8, 5, 9, 5]", "output": "[4, 7, 9, 8, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122528_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030172", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[65, 50, 92, 95, 64, 55, 75]", "output": "['D', 'E', 'A', 'A', 'D', 'E', 'C']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030173", "code": "def find_top_authors(publications):\n    max_publications = max(publications)\n    top_authors = [i+1 for i, pubs in enumerate(publications) if pubs == max_publications]\n    return top_authors\n", "entry_point": "find_top_authors", "input": "[5, 7, 9, 10]", "output": "[4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68606_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030174", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8003", "output": "{1, 8003, 53, 151}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8002", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030175", "code": "def shortest_distance_to_char(S, C):\n    cp = [i for i, s in enumerate(S) if s == C]\n    result = []\n    for i, s in enumerate(S):\n        result.append(min(abs(i - x) for x in cp))\n    return result\n", "entry_point": "shortest_distance_to_char", "input": "'bbaab', 'a'", "output": "[2, 1, 0, 0, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98860_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030176", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'boook'", "output": "'boook'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt21", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030177", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'hello, wool'", "output": "'h.e.l.l.o.,. .w.o.o.l'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030178", "code": "def extract_version_numbers(version_str: str) -> tuple[int, int, int, int]:\n    version_parts = version_str.split('.')\n    version_numbers = []\n    for part in version_parts:\n        try:\n            version_numbers.append(int(part))\n        except ValueError:\n            version_numbers.append(0)\n    # Ensure the tuple has exactly 4 elements by padding with zeros if needed\n    version_numbers.extend([0] * (4 - len(version_numbers)))\n    return tuple(version_numbers)\n", "entry_point": "extract_version_numbers", "input": "'2'", "output": "(2, 0, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88537_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030179", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    def time_to_seconds(timestamp):\n        hours, minutes, seconds = map(int, timestamp.split(':'))\n        return hours * 3600 + minutes * 60 + seconds\n    seconds1 = time_to_seconds(timestamp1)\n    seconds2 = time_to_seconds(timestamp2)\n    elapsed_seconds = seconds2 - seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'12:00:00', '14:49:55'", "output": "10195", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4070_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030180", "code": "from typing import List\ndef top_three_scores(scores: List[int]) -> List[int]:\n    unique_scores = sorted(set(scores), reverse=True)\n    return unique_scores[:3] if len(unique_scores) >= 3 else unique_scores\n", "entry_point": "top_three_scores", "input": "[93, 88, 89, 70, 85]", "output": "[93, 89, 88]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60095_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030181", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9597", "output": "{1, 3, 7, 457, 21, 1371, 9597, 3199}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9596", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030182", "code": "def calculate_total_elements(maxlag, disp_lag, dt):\n    # Calculate the total number of elements in the matrix\n    total_elements = 2 * int(disp_lag / dt) + 1\n    return total_elements\n", "entry_point": "calculate_total_elements", "input": "0, -6, 2", "output": "-5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39261_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030183", "code": "def color_cycle(text: str) -> str:\n    text = text.replace(\"red\", \"temp_placeholder\").replace(\"green\", \"blue\").replace(\"blue\", \"red\").replace(\"temp_placeholder\", \"green\")\n    return text\n", "entry_point": "color_cycle", "input": "'agrapeapes.'", "output": "'agrapeapes.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73026_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030184", "code": "def modify_string(input_string):\n    if len(input_string) % 2 == 1:  # Check if the length of the input string is odd\n        return input_string + input_string[::-1]  # Concatenate the input string with its reverse\n    else:\n        return input_string + \"EuroPython\"  # Concatenate the input string with \"EuroPython\"\n", "entry_point": "modify_string", "input": "'BBoBBlisa'", "output": "'BBoBBlisaasilBBoBB'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_30770_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030185", "code": "def escape_text(text: str) -> str:\n    escaped_text = ''\n    for char in text:\n        if char == '[':\n            escaped_text += '\\x1b[38;5;196m'\n        elif char == ']':\n            escaped_text += '\\x1b[0m'\n        else:\n            escaped_text += char\n    return escaped_text\n", "entry_point": "escape_text", "input": "'Thises'", "output": "'Thises'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_73825_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030186", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6793", "output": "{1, 6793}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6792", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030187", "code": "import re\ndef format_version_tag(tag):\n    if tag.startswith('v'):\n        return tag[1:]\n    return tag\n", "entry_point": "format_version_tag", "input": "'.v1.'", "output": "'.v1.'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115534_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030188", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7505", "output": "{1, 5, 395, 79, 7505, 19, 1501, 95}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030189", "code": "try:\n    _xrange = xrange\nexcept NameError:\n    _xrange = range  # Python 3 compatibility\ndef sum_of_evens(start, end):\n    sum_even = 0\n    for num in _xrange(start, end+1):\n        if num % 2 == 0:\n            sum_even += num\n    return sum_even\n", "entry_point": "sum_of_evens", "input": "0, 16", "output": "72", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141776_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030190", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1438", "output": "{1, 2, 1438, 719}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1437", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030191", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7999", "output": "{1, 19, 421, 7999}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7998", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030192", "code": "from typing import List\ndef single_number(nums: List[int]) -> int:\n    result = 0\n    for num in nums:\n        result ^= num\n    return result\n", "entry_point": "single_number", "input": "[1, 2, 2, 3, 3]", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118847_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030193", "code": "def highest_non_repeated_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    highest_non_repeated = -1\n    for score, freq in score_freq.items():\n        if freq == 1 and score > highest_non_repeated:\n            highest_non_repeated = score\n    return highest_non_repeated\n", "entry_point": "highest_non_repeated_score", "input": "[3, 2, 1, 2, 1, -1]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12537_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030194", "code": "def slice_list(lst, start=None, end=None):\n    if start is not None and end is not None:\n        return lst[start:end]\n    elif start is not None:\n        return lst[start:]\n    elif end is not None:\n        return lst[:end]\n    else:\n        return lst\n", "entry_point": "slice_list", "input": "[79]", "output": "[79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_93892_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030195", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8366", "output": "{1, 2, 8366, 47, 178, 4183, 89, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8365", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030196", "code": "def sum_abs_diff(list1, list2):\n    if len(list1) != len(list2):\n        raise ValueError(\"Input lists must have the same length\")\n    abs_diff_sum = 0\n    for num1, num2 in zip(list1, list2):\n        abs_diff_sum += abs(num1 - num2)\n    return abs_diff_sum\n", "entry_point": "sum_abs_diff", "input": "[1, 8], [1, 1]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_111620_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030197", "code": "def calculate_mean_median(numbers):\n    # Calculate the mean\n    mean = sum(numbers) / len(numbers)\n    # Sort the list to find the median\n    sorted_numbers = sorted(numbers)\n    n = len(sorted_numbers)\n    if n % 2 == 0:\n        # If the list has an even number of elements\n        median = (sorted_numbers[n // 2 - 1] + sorted_numbers[n // 2]) / 2\n    else:\n        # If the list has an odd number of elements\n        median = sorted_numbers[n // 2]\n    return mean, median\n", "entry_point": "calculate_mean_median", "input": "[3, 3, 3]", "output": "(3.0, 3)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51463_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030198", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[3, 5]", "output": "[3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030199", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8051", "output": "{1, 83, 8051, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8050", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030200", "code": "def parse_version(version_str):\n    parts = version_str.split('.')\n    if len(parts) != 3:\n        return None\n    try:\n        major = int(parts[0])\n        minor = int(parts[1])\n        patch = int(parts[2])\n        return major, minor, patch\n    except ValueError:\n        return None\n", "entry_point": "parse_version", "input": "'3.14.2'", "output": "(3, 14, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_52090_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030201", "code": "import re\nfrom typing import List\ndef extract_unique_words(text: str) -> List[str]:\n    unique_words = set()\n    # Split text into words using regular expression\n    words = re.findall(r'\\b\\w+\\b', text.lower())\n    for word in words:\n        unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'ahelllo'", "output": "['ahelllo']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8776_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030202", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8171", "output": "{1, 8171}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8170", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030203", "code": "def convert_to_decimal(d, m, s):\n    return d + (m + s/60) / 60\n", "entry_point": "convert_to_decimal", "input": "49, 37, 2", "output": "49.617222222222225", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_110698_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030204", "code": "def get_daystr(plotdays):\n    if len(plotdays) > 1:\n        daystr = 'Rel Days %d to %d' % (plotdays[0], plotdays[-1])\n        savestr = 'reldays%d_%d' % (plotdays[0], plotdays[-1])\n    else:\n        daystr = 'Rel Day %d' % plotdays[0]\n        savestr = 'relday%d' % plotdays[0]\n    return daystr, savestr\n", "entry_point": "get_daystr", "input": "[6, 3]", "output": "('Rel Days 6 to 3', 'reldays6_3')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_115441_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030205", "code": "def method1(n: int, m: int) -> int:\n    def custom_gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n    abs_product = abs(n * m)\n    gcd_value = custom_gcd(n, m)\n    return abs_product // gcd_value\n", "entry_point": "method1", "input": "4, 8", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_96722_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030206", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1557", "output": "{1, 3, 519, 9, 173, 1557}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1556", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030207", "code": "def format_version(version: str, build_number: int = 0) -> str:\n    version_info = list(map(int, version.split('.'))) + [build_number]\n    return '.'.join(map(str, version_info))\n", "entry_point": "format_version", "input": "'1.0.5', 122", "output": "'1.0.5.122'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137046_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030208", "code": "def process_numbers(numbers):\n    modified_numbers = []\n    for num in numbers:\n        if num % 2 == 0:  # Even number\n            modified_numbers.append(num * 2)\n        else:  # Odd number\n            modified_numbers.append(num ** 2)\n    return sorted(modified_numbers)\n", "entry_point": "process_numbers", "input": "[2, 2, 3, 8, 8, 10, 10, 7, 11]", "output": "[4, 4, 9, 16, 16, 20, 20, 49, 121]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_112306_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030209", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3669", "output": "{1, 3, 3669, 1223}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3668", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030210", "code": "def rearrange_list(num):\n    bp = -1\n    for i in range(len(num) - 1):\n        if num[i] < num[i + 1]:\n            bp = i\n    if bp == -1:\n        return sorted(num, reverse=True)\n    rest = num[bp:]\n    local_max = None\n    for i in rest:\n        if i > rest[0] and (local_max is None or i < local_max):\n            local_max = i\n    rest.pop(rest.index(local_max))\n    rest = sorted(rest)\n    return num[:bp] + [local_max] + rest\n", "entry_point": "rearrange_list", "input": "[2, 2, 2, 2]", "output": "[2, 2, 2, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_40963_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030211", "code": "from typing import List\ndef min_boats(people: List[int], limit: int) -> int:\n    people.sort()\n    left, right, boats = 0, len(people) - 1, 0\n    while left <= right:\n        if people[left] + people[right] <= limit:\n            left += 1\n        right -= 1\n        boats += 1\n    return boats\n", "entry_point": "min_boats", "input": "[50, 50, 50, 50, 50, 50, 50, 50], 100", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49829_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030212", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[70, 60]", "output": "[70, 60]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66383_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030213", "code": "def find_min_max(a, b, c):\n    min_val = min(a, b, c)\n    max_val = max(a, b, c)\n    return min_val, max_val\n", "entry_point": "find_min_max", "input": "4, 10, 15", "output": "(4, 15)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_76276_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030214", "code": "def extract_names(full_name):\n    first_name = ''\n    last_name = ''\n    has_been_a_space = False\n    for letter in full_name:\n        if letter == ' ':\n            has_been_a_space = True\n        elif has_been_a_space:\n            last_name += letter\n        else:\n            first_name += letter\n    return first_name, last_name\n", "entry_point": "extract_names", "input": "'John DoeSmhit'", "output": "('John', 'DoeSmhit')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128410_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030215", "code": "def find_modes(data):\n    frequency_dict = {}\n    # Count the frequency of each element\n    for num in data:\n        frequency_dict[num] = frequency_dict.get(num, 0) + 1\n    max_frequency = max(frequency_dict.values())\n    modes = [num for num, freq in frequency_dict.items() if freq == max_frequency]\n    return sorted(modes)\n", "entry_point": "find_modes", "input": "[1, 1, 3, 3, 7, 7]", "output": "[1, 3, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69194_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030216", "code": "def custom_base_to_base10(custom_number, input_base):\n    numbers = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n    size = len(custom_number)\n    result = 0\n    for i in range(size):\n        digit_value = numbers.index(custom_number[size - 1 - i])\n        result += digit_value * (input_base ** i)\n    return result\n", "entry_point": "custom_base_to_base10", "input": "'52', 10", "output": "52", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4122_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030217", "code": "def latest_version(versions):\n    latest = '0.0.0'  # Initialize with a minimum version\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        latest_major, latest_minor, latest_patch = map(int, latest.split('.'))\n        if major > latest_major or (major == latest_major and minor > latest_minor) or (major == latest_major and minor == latest_minor and patch > latest_patch):\n            latest = version\n    return latest\n", "entry_point": "latest_version", "input": "['0.0.0', '0.0.1', '0.0.2', '0.0.3']", "output": "'0.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149527_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030218", "code": "def nested_sum(data):\n    total_sum = 0\n    for item in data:\n        if isinstance(item, int):\n            total_sum += item\n        elif isinstance(item, float):\n            total_sum += round(item, 2)\n        elif isinstance(item, list):\n            total_sum += nested_sum(item)\n        elif isinstance(item, dict):\n            total_sum += nested_sum(item.values())\n    return total_sum\n", "entry_point": "nested_sum", "input": "[10, 15.0, [5, 5.0], {'key': 1}]", "output": "36.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104921_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030219", "code": "def count_valid_characters(input_string):\n    count = 0\n    for char in input_string:\n        if char.isalnum():  # Check if the character is alphanumeric\n            count += 1\n    return count\n", "entry_point": "count_valid_characters", "input": "'abc12'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56297_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030220", "code": "def generate_pseudonym(name):\n    pseudonym_count = {}\n    # Split the name into words\n    words = name.split()\n    pseudonym = ''.join(word[0].upper() for word in words)\n    if pseudonym in pseudonym_count:\n        pseudonym_count[pseudonym] += 1\n    else:\n        pseudonym_count[pseudonym] = 1\n    count = pseudonym_count[pseudonym]\n    return (pseudonym + str(count), sum(pseudonym_count.values()))\n", "entry_point": "generate_pseudonym", "input": "'John Doe'", "output": "('JD1', 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11221_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030221", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3134", "output": "{1, 2, 3134, 1567}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3133", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030222", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3574", "output": "{1, 2, 1787, 3574}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3573", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030223", "code": "def calculate_max_phi(nStrips):\n    maxPhi = 1.2 * 0.35 / nStrips\n    return maxPhi\n", "entry_point": "calculate_max_phi", "input": "16", "output": "0.02625", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67423_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030224", "code": "def process_integers(int_list):\n    modified_list = []\n    for num in int_list:\n        if num % 2 == 0:  # Check if the number is even\n            modified_list.append(num ** 2)  # Square the even number\n        else:\n            modified_list.append(num ** 3)  # Cube the odd number\n    return modified_list\n", "entry_point": "process_integers", "input": "[1, 5, 4, 5, 1, 1]", "output": "[1, 125, 16, 125, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29423_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030225", "code": "def prefnum(InA=[], PfT=None, varargin=None):\n    # Non-zero value InA location indices:\n    IxZ = [i for i, val in enumerate(InA) if val > 0]\n    IsV = True\n    # Calculate sum of positive values, maximum value, and its index\n    sum_positive = sum(val for val in InA if val > 0)\n    max_value = max(InA)\n    max_index = InA.index(max_value)\n    return sum_positive, max_value, max_index\n", "entry_point": "prefnum", "input": "[2, 10, 8, 10, 11, 3, 5]", "output": "(49, 11, 4)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134376_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030226", "code": "def extract_lat_lng_from_url(url_path):\n    parts = url_path.split('/')\n    if len(parts) == 2:\n        lat, lng = parts\n        return (lat, lng)\n    else:\n        return None\n", "entry_point": "extract_lat_lng_from_url", "input": "'12.345/60'", "output": "('12.345', '60')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_114972_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030227", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3882", "output": "{1, 2, 3, 6, 647, 3882, 1294, 1941}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3881", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030228", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9186", "output": "{1, 9186, 3, 2, 6, 4593, 3062, 1531}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9185", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030229", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5146", "output": "{1, 2, 166, 2573, 83, 5146, 62, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5145", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030230", "code": "def generate_supported_response_types(input_list):\n    supported_types = {}\n    for response_type in input_list:\n        supported_types[response_type] = [response_type]\n        for other_type in input_list:\n            if other_type != response_type:\n                combined_type = f\"{response_type} {other_type}\"\n                supported_types.setdefault(response_type, []).append(combined_type)\n    return supported_types\n", "entry_point": "generate_supported_response_types", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16155_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030231", "code": "def sort_print(list_, level=0):\n    \"\"\"Sort list with step prints\"\"\"\n    if len(list_) > 1:\n        pivot = list_[0]\n        lower = [i for i in list_[1:] if i <= pivot]\n        greater = [i for i in list_[1:] if i > pivot]\n        print(\"  \" * level, lower, \"<\", pivot, \"<\", greater)\n        result = sort_print(lower, level + 1) + [pivot] + sort_print(greater, level + 1)\n        print(\"  \" * level, \">\", result)\n        return result\n    return list_\n", "entry_point": "sort_print", "input": "[5, 8, 5, 8]", "output": "[5, 5, 8, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42832_ipt30", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030232", "code": "def extract_migration_info(operations):\n    extracted_info = []\n    for operation in operations:\n        model_name = operation.get('name')\n        fields_info = [{'name': field[0], 'type': field[1]} for field in operation.get('fields', [])]\n        extracted_info.append({'model_name': model_name, 'fields': fields_info})\n    return {'operations': extracted_info}\n", "entry_point": "extract_migration_info", "input": "[]", "output": "{'operations': []}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74637_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030233", "code": "from typing import List\ndef calculate_total_time(tasks: List[int], cooldown: int) -> int:\n    last_occurrence = {}\n    time_elapsed = 0\n    for task_duration in tasks:\n        if task_duration not in last_occurrence or last_occurrence[task_duration] + cooldown <= time_elapsed:\n            time_elapsed += task_duration\n        else:\n            time_elapsed = last_occurrence[task_duration] + cooldown + task_duration\n        last_occurrence[task_duration] = time_elapsed\n    return time_elapsed\n", "entry_point": "calculate_total_time", "input": "[5], 0", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98461_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030234", "code": "def convert_id3_to_id64(id3):\n    if not isinstance(id3, str):\n        raise TypeError(\"Input must be a string\")\n    if not id3.startswith(\"[U:1:\") or not id3.endswith(\"]\"):\n        raise ValueError(\"Invalid Steam ID3 format\")\n    try:\n        account_id = int(id3[5:-1])\n        id64 = 76561197960265728 + account_id\n        return id64\n    except ValueError:\n        raise ValueError(\"Invalid account ID in Steam ID3 format\")\n", "entry_point": "convert_id3_to_id64", "input": "'[U:1:12345]'", "output": "76561197960278073", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28837_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030235", "code": "def count_frequency(int_list):\n    frequency_dict = {}\n    for num in int_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "count_frequency", "input": "[1, 1, 1, 1, 1, 0, 0, 2, 4]", "output": "{1: 5, 0: 2, 2: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87787_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030236", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(1, 2, 3)", "output": "'(1.2.3)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030237", "code": "def calculate_average_score(scores):\n    total_sum = sum(scores)\n    total_students = len(scores)\n    average_score = total_sum / total_students\n    rounded_average = round(average_score, 2)\n    return rounded_average\n", "entry_point": "calculate_average_score", "input": "[83, 84]", "output": "83.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105956_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030238", "code": "def construct_api_endpoint(base_url, auth_header, token):\n    # Replace the ${token} placeholder in the authorization header with the provided token\n    formatted_auth_header = auth_header.replace('${token}', token)\n    # Construct the complete API endpoint URL\n    api_endpoint_url = base_url\n    return api_endpoint_url, formatted_auth_header\n", "entry_point": "construct_api_endpoint", "input": "'httpm/api', '${token}', 'ken'", "output": "('httpm/api', 'ken')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50270_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030239", "code": "def process_matrices(matrix, w):\n    if w is not None:\n        X = matrix[0] / w\n        C = matrix[1] / w\n        y = matrix[2]\n    else:\n        X, C, y = matrix\n    return X, C, y\n", "entry_point": "process_matrices", "input": "[7.0, 3.0, 10], 1", "output": "(7.0, 3.0, 10)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_34015_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030240", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5091", "output": "{3, 1, 5091, 1697}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5090", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030241", "code": "CREATE = 'create'\nREPLACE = 'replace'\nUPDATE = 'update'\nDELETE = 'delete'\nALL = (CREATE, REPLACE, UPDATE, DELETE)\n_http_methods = {\n    CREATE: ('post',),\n    REPLACE: ('put',),\n    UPDATE: ('patch',),\n    DELETE: ('delete',)\n}\ndef get_http_methods(method):\n    return _http_methods.get(method, ('get',))  # Default to 'get' if method not found\n", "entry_point": "get_http_methods", "input": "'delete'", "output": "('delete',)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23129_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030242", "code": "import string\ndef extract_unique_words(text):\n    unique_words = set()\n    words = text.split()\n    for word in words:\n        word = word.strip(string.punctuation).lower()\n        if word:\n            unique_words.add(word)\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'world!sis'", "output": "['world!sis']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77980_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030243", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8131", "output": "{1, 8131, 173, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030244", "code": "import errno\ndef process_socket_errors(sock_errors: dict) -> dict:\n    sockErrors = {errno.ESHUTDOWN: True,\n                  errno.ENOTCONN: True,\n                  errno.ECONNRESET: False,\n                  errno.ECONNREFUSED: False,\n                  errno.EAGAIN: False,\n                  errno.EWOULDBLOCK: False}\n    if hasattr(errno, 'EBADFD'):\n        sockErrors[errno.EBADFD] = True\n    ignore_status = {}\n    for error_code in sock_errors:\n        ignore_status[error_code] = sockErrors.get(error_code, False)\n    return ignore_status\n", "entry_point": "process_socket_errors", "input": "{104: None, 105: None, 103: None}", "output": "{104: False, 105: False, 103: False}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12691_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030245", "code": "def convert_ascii_to_string(ascii_list):\n    # Convert each ASCII value to its corresponding character and concatenate them\n    data = \"\".join(chr(val) for val in ascii_list)\n    return data\n", "entry_point": "convert_ascii_to_string", "input": "[111, 109, 109, 112]", "output": "'ommp'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32679_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030246", "code": "def generate_unique_table_name(table_prefix: str, existing_table_names: list) -> str:\n    counter = 1\n    while True:\n        new_table_name = f\"{table_prefix}_{counter}\"\n        if new_table_name not in existing_table_names:\n            return new_table_name\n        counter += 1\n    return None\n", "entry_point": "generate_unique_table_name", "input": "'users', ['users_1']", "output": "'users_2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_120462_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030247", "code": "def extract_x_coordinates(player_positions):\n    x_coordinates = []\n    for player in player_positions:\n        x_coordinates.append(player[0])\n    return x_coordinates\n", "entry_point": "extract_x_coordinates", "input": "[(1,), (3,), (5,)]", "output": "[1, 3, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37716_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030248", "code": "def generateParentheses(n):\n    def generateParenthesesHelper(open_count, close_count, current_pattern, result):\n        if open_count == n and close_count == n:\n            result.append(current_pattern)\n            return\n        if open_count < n:\n            generateParenthesesHelper(open_count + 1, close_count, current_pattern + '(', result)\n        if close_count < open_count:\n            generateParenthesesHelper(open_count, close_count + 1, current_pattern + ')', result)\n    result = []\n    generateParenthesesHelper(0, 0, '', result)\n    return result\n", "entry_point": "generateParentheses", "input": "-1", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74608_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030249", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[1, 2, 3, 7, 4, 5, 6]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030250", "code": "import unicodedata\ndef validate_string(input_string):\n    valid_chars = ['\\n', '\\r']\n    return \"\".join(ch for ch in input_string if unicodedata.category(ch)[0] != \"C\" or ch in valid_chars)\n", "entry_point": "validate_string", "input": "'!H\\x00l!Hld!\\nd!\\n'", "output": "'!Hl!Hld!\\nd!\\n'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7327_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030251", "code": "from re import compile as re_compile\ndef extract_package_names(package_list):\n    PACKAGE_RE = re_compile(\"symbiflow-arch-defs-([a-zA-Z0-9_-]+)-[a-z0-9]\")\n    unique_names = set()\n    for package_name in package_list:\n        match = PACKAGE_RE.match(package_name)\n        if match:\n            unique_names.add(match.group(1))\n    return unique_names\n", "entry_point": "extract_package_names", "input": "[]", "output": "set()", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13089_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030252", "code": "def extract_content(html_element):\n    start_index = html_element.find('>') + 1\n    end_index = html_element.rfind('<')\n    return html_element[start_index:end_index]\n", "entry_point": "extract_content", "input": "'<tag>th</tag>'", "output": "'th'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_20347_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030253", "code": "def generate_telegram_url(api_token):\n    URL_BASE = 'https://api.telegram.org/file/bot'\n    complete_url = URL_BASE + api_token + '/'\n    return complete_url\n", "entry_point": "generate_telegram_url", "input": "'PUPPU'", "output": "'https://api.telegram.org/file/botPUPPU/'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139134_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030254", "code": "from datetime import datetime\ndef days_between_dates(start_date_str, end_date_str):\n    start_date = datetime.strptime(start_date_str, \"%Y-%m-%d\")\n    end_date = datetime.strptime(end_date_str, \"%Y-%m-%d\")\n    # Calculate the total number of days between the two dates\n    total_days = (end_date - start_date).days + 1\n    # Account for leap years\n    leap_years = sum(1 for year in range(start_date.year, end_date.year + 1) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0)\n    # Adjust total days for leap years\n    total_days -= leap_years\n    return total_days\n", "entry_point": "days_between_dates", "input": "'2021-01-01', '2021-01-27'", "output": "27", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10120_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030255", "code": "def categorize_grades(scores):\n    grades = []\n    for score in scores:\n        if score >= 90:\n            grades.append('A')\n        elif score >= 80:\n            grades.append('B')\n        elif score >= 70:\n            grades.append('C')\n        elif score >= 60:\n            grades.append('D')\n        else:\n            grades.append('E')\n    return grades\n", "entry_point": "categorize_grades", "input": "[75, 72, 85, 55, 50, 90, 95, 40]", "output": "['C', 'C', 'B', 'E', 'E', 'A', 'A', 'E']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61629_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030256", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7723", "output": "{1, 7723}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030257", "code": "from typing import List\ndef extract_dependencies(package_name: str) -> List[str]:\n    setup_config = {\n        \"name\": \"lean_proof_recording\",\n        \"version\": \"0.0.1\",\n        \"packages\": [\"lean_proof_recording\"],\n        \"package_data\": {},\n        \"install_requires\": [\n            \"mpmath\",\n            \"pandas\",\n            \"jsonlines\",\n            \"tqdm\",\n        ],\n    }\n    if setup_config[\"name\"] == package_name:\n        return setup_config[\"install_requires\"]\n    else:\n        return []\n", "entry_point": "extract_dependencies", "input": "'lean_proof_recording'", "output": "['mpmath', 'pandas', 'jsonlines', 'tqdm']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_61259_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030258", "code": "def _calculate_fan(linear_weight_shape, fan=\"fan_in\"):\n    fan_out, fan_in = linear_weight_shape\n    if fan == \"fan_in\":\n        f = fan_in\n    elif fan == \"fan_out\":\n        f = fan_out\n    elif fan == \"fan_avg\":\n        f = (fan_in + fan_out) / 2\n    else:\n        raise ValueError(\"Invalid fan option\")\n    return f\n", "entry_point": "_calculate_fan", "input": "(10, 5), 'fan_in'", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132614_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030259", "code": "import sys\ndef convert_to_native_string(string):\n    if sys.version_info[0] < 3:  # Check if Python 2\n        return string.encode()\n    else:  # Python 3 or higher\n        return string.encode()\n", "entry_point": "convert_to_native_string", "input": "'Worl'", "output": "b'Worl'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83320_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030260", "code": "def generate_pairs(elements):\n    pairs = []\n    for i in range(len(elements)):\n        for j in range(i + 1, len(elements)):\n            pairs.append((elements[i], elements[j]))\n    return pairs\n", "entry_point": "generate_pairs", "input": "[1, 2, 3]", "output": "[(1, 2), (1, 3), (2, 3)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139721_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030261", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8209", "output": "{1, 8209}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8208", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030262", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9066", "output": "{1, 2, 3, 6, 1511, 9066, 3022, 4533}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9065", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030263", "code": "from typing import Union, List\ndef parse_driving_envs(driving_environments: str) -> Union[str, List[str]]:\n    driving_environments = driving_environments.split(',')\n    for driving_env in driving_environments:\n        if len(driving_env.split('_')) < 2:\n            raise ValueError(f'Invalid format for the driving environment {driving_env} (should be Suite_Town)')\n    if len(driving_environments) == 1:\n        return driving_environments[0]\n    return driving_environments\n", "entry_point": "parse_driving_envs", "input": "'Suite1_Town1'", "output": "'Suite1_Town1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141849_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030264", "code": "def chunked(ids, chunk_size):\n    return [ids[i:i + chunk_size] for i in range(0, len(ids), chunk_size)]\n", "entry_point": "chunked", "input": "[1, 6, 3, 5, 1, 9, 5, 4, 7], 2", "output": "[[1, 6], [3, 5], [1, 9], [5, 4], [7]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91774_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030265", "code": "def get_account_description(account_code):\n    account_type = {\n        \"ma\": \"manager\",\n        \"em\": \"employee\",\n        \"hr\": \"hr\"\n    }\n    return account_type.get(account_code, \"Unknown account type\")\n", "entry_point": "get_account_description", "input": "'em'", "output": "'employee'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137661_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030266", "code": "def timecode_to_frames(tc, framerate):\n    components = tc.split(':')\n    hours = int(components[0])\n    minutes = int(components[1])\n    seconds = int(components[2])\n    frames = int(components[3])\n    total_frames = frames + seconds * framerate + minutes * framerate * 60 + hours * framerate * 60 * 60\n    return total_frames\n", "entry_point": "timecode_to_frames", "input": "'01:36:00:00', 30", "output": "172800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42773_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030267", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4078", "output": "{1, 2, 4078, 2039}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4077", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030268", "code": "def broadcast_message(user_ids, message):\n    successful_deliveries = 0\n    for user_id in user_ids:\n        try:\n            # Simulating message delivery by printing the user ID\n            print(f\"Message delivered to user ID: {user_id}\")\n            successful_deliveries += 1\n        except Exception as e:\n            # Handle any exceptions that may occur during message delivery\n            print(f\"Failed to deliver message to user ID: {user_id}. Error: {e}\")\n    return successful_deliveries\n", "entry_point": "broadcast_message", "input": "['user1', 'user2', 'user3', 'user4', 'user5', 'user6', 'user7'], 'Hello!'", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_16498_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030269", "code": "def parse_es_conn_config_params(input_string):\n    config_params = {}\n    for param in input_string.split(','):\n        param = param.strip()\n        if '=' in param:\n            key, value = param.split('=')\n            config_params[key.strip()] = value.strip()\n        else:\n            config_params[param] = None\n    return config_params\n", "entry_point": "parse_es_conn_config_params", "input": "'es_send_gety_as=True, '", "output": "{'es_send_gety_as': 'True', '': None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133460_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030270", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1739", "output": "{1, 1739, 37, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1738", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030271", "code": "def sort_modules(modules):\n    def custom_sort(module):\n        return (-module[1], module[0])\n    sorted_modules = sorted(modules, key=custom_sort)\n    sorted_module_names = [module[0] for module in sorted_modules]\n    return sorted_module_names\n", "entry_point": "sort_modules", "input": "[('X', 3), ('Y', 2), ('Z', 1)]", "output": "['X', 'Y', 'Z']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65686_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030272", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9582", "output": "{1, 2, 3, 6, 9582, 4791, 3194, 1597}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9581", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030273", "code": "def calculate_total_amount(buy_price, quantity):\n    try:\n        buy_price = int(buy_price)\n        quantity = int(quantity)\n        total_amount = buy_price * quantity\n        return total_amount\n    except ValueError:\n        return \"Invalid input. Please enter valid numeric values for buy price and quantity.\"\n", "entry_point": "calculate_total_amount", "input": "3, 8", "output": "24", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82872_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030274", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1325", "output": "{1, 5, 265, 1325, 53, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1324", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030275", "code": "def convert_scan_codes_to_ascii(scan_codes):\n    SCAN_CODES = {\n        0: None, 1: 'ESC', 2: '1', 3: '2', 4: '3', 5: '4', 6: '5', 7: '6', 8: '7', 9: '8',\n        10: '9', 11: '0', 12: '-', 13: '=', 14: 'BKSP', 15: 'TAB', 16: 'Q', 17: 'W', 18: 'E', 19: 'R',\n        20: 'T', 21: 'Y', 22: '', 23: 'I', 24: 'O', 25: 'P', 26: '[', 27: ']', 28: 'CRLF', 29: 'LCTRL',\n        30: 'A', 31: 'S', 32: 'D', 33: 'F', 34: 'G', 35: 'H', 36: 'J', 37: 'K', 38: 'L', 39: ';',\n        40: '\"', 41: '`', 42: 'LSHFT', 43: '\\\\', 44: 'Z', 45: 'X', 46: 'C', 47: 'V', 48: 'B', 49: 'N',\n        50: 'M', 51: ',', 52: '.', 53: '/', 54: 'RSHFT', 56: 'LALT', 100: 'RALT'\n    }\n    result = \"\"\n    for code in scan_codes:\n        if code in SCAN_CODES and SCAN_CODES[code] is not None:\n            result += SCAN_CODES[code]\n    return result\n", "entry_point": "convert_scan_codes_to_ascii", "input": "[2, 8, 6, 13, 3, 11, 18, 31, 46, 2]", "output": "'175=20ESC1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82404_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030276", "code": "def latest_version(versions):\n    latest_major = latest_minor = latest_patch = 0\n    for version in versions:\n        major, minor, patch = map(int, version.split('.'))\n        if major > latest_major:\n            latest_major, latest_minor, latest_patch = major, minor, patch\n        elif major == latest_major:\n            if minor > latest_minor:\n                latest_minor, latest_patch = minor, patch\n            elif minor == latest_minor and patch > latest_patch:\n                latest_patch = patch\n    return f\"{latest_major}.{latest_minor}.{latest_patch}\"\n", "entry_point": "latest_version", "input": "['1.0.0', '1.2.3', '2.1.0', '2.1.1', '2.2.0', '2.2.1', '2.2.2']", "output": "'2.2.2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109733_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030277", "code": "def find_highest_insertions(predicted_insertions):\n    max_insertions = 0\n    max_index = -1\n    for index, insertions in enumerate(predicted_insertions):\n        if insertions > max_insertions:\n            max_insertions = insertions\n            max_index = index\n    return max_insertions, max_index\n", "entry_point": "find_highest_insertions", "input": "[10, 15, 5, 0, 18, 19, 20]", "output": "(20, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91276_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030278", "code": "def calculate_average(scores):\n    if len(scores) <= 1:\n        return 0\n    min_score = min(scores)\n    scores.remove(min_score)\n    total_sum = sum(scores)\n    average = total_sum / len(scores)\n    return average\n", "entry_point": "calculate_average", "input": "[80, 90, 91, 91]", "output": "90.66666666666667", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36918_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030279", "code": "def longest_consecutive_subsequence(lst):\n    max_length = 1\n    current_length = 1\n    start_index = 0\n    for i in range(1, len(lst)):\n        if lst[i] == lst[i - 1] + 1:\n            current_length += 1\n        else:\n            if current_length > max_length:\n                max_length = current_length\n                start_index = i - current_length\n            current_length = 1\n    if current_length > max_length:\n        max_length = current_length\n        start_index = len(lst) - current_length\n    return lst[start_index:start_index + max_length]\n", "entry_point": "longest_consecutive_subsequence", "input": "[3]", "output": "[3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_62550_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030280", "code": "def break_string_into_lines(s, k):\n    words = s.split()\n    lines = []\n    current_line = []\n    current_length = 0\n    for word in words:\n        if current_length + len(word) + len(current_line) <= k:\n            current_line.append(word)\n            current_length += len(word)\n        else:\n            lines.append(\" \".join(current_line))\n            current_line = [word]\n            current_length = len(word)\n    if current_line:\n        lines.append(\" \".join(current_line))\n    return lines if lines else None\n", "entry_point": "break_string_into_lines", "input": "'dog', 3", "output": "['dog']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68174_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030281", "code": "import math\ndef count_perfect_squares(numbers):\n    count = 0\n    for num in numbers:\n        if math.isqrt(num) ** 2 == num:\n            count += 1\n    return count\n", "entry_point": "count_perfect_squares", "input": "[0, 1, 4, 9, 16, 25, 36]", "output": "7", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144234_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030282", "code": "def convert_integers(numbers):\n    converted_list = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            converted_list.append('even_odd')\n        elif num % 2 == 0:\n            converted_list.append('even')\n        elif num % 3 == 0:\n            converted_list.append('odd')\n        else:\n            converted_list.append(num)\n    return converted_list\n", "entry_point": "convert_integers", "input": "[7, 7, 7, 4, 7, 2, 7, 7, 7]", "output": "[7, 7, 7, 'even', 7, 'even', 7, 7, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_77525_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030283", "code": "from typing import Optional\ndef validate_version(version: Optional[str]) -> Optional[str]:\n    if not version:  # Check if version is empty or None\n        return None\n    for char in version:\n        if char in \" \\t()\":  # Check for disallowed characters\n            return None\n    return version\n", "entry_point": "validate_version", "input": "'.11.0.3'", "output": "'.11.0.3'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37790_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030284", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2213", "output": "{1, 2213}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2212", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030285", "code": "def modify_list(int_list, str_list):\n    modified_list = int_list + [int(x) for x in str_list]  # Extend int_list with elements from str_list\n    modified_list.insert(0, 12)  # Insert 12 at the beginning of modified_list\n    modified_list.reverse()  # Reverse the elements of modified_list\n    modified_list.sort(reverse=True)  # Sort modified_list in descending order\n    return modified_list\n", "entry_point": "modify_list", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], []", "output": "[12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50028_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030286", "code": "def sum_multiples_of_three_not_five(numbers):\n    total_sum = 0\n    for num in numbers:\n        if num % 3 == 0 and num % 5 != 0:\n            total_sum += num\n    return total_sum\n", "entry_point": "sum_multiples_of_three_not_five", "input": "[6, 9]", "output": "15", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11697_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030287", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5614", "output": "{1, 2, 802, 7, 5614, 14, 401, 2807}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5613", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030288", "code": "def get_appropriate_arch(kernel_arch: str) -> str:\n    DIB_MAP = {\n        'x86_64': 'amd64',\n        'aarch64': 'arm64',\n    }\n    CIRROS_MAP = {\n        'ppc64le': 'powerpc',\n        'aarch64': 'arm',\n    }\n    dib_arch = DIB_MAP.get(kernel_arch)\n    cirros_arch = CIRROS_MAP.get(kernel_arch)\n    if dib_arch:\n        return dib_arch\n    elif cirros_arch:\n        return cirros_arch\n    else:\n        return kernel_arch\n", "entry_point": "get_appropriate_arch", "input": "'a6ahah6'", "output": "'a6ahah6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148598_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030289", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'3.0'", "output": "(3, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030290", "code": "def remove_largest_pow2(lst):\n    def is_power_of_2(n):\n        return n & (n - 1) == 0 and n != 0\n    def remove_power_of_2(n):\n        while is_power_of_2(n):\n            n //= 2\n        return n\n    return [remove_power_of_2(num) for num in lst]\n", "entry_point": "remove_largest_pow2", "input": "[15, 5, 0, 5, 3, 15, 0, 0]", "output": "[15, 5, 0, 5, 3, 15, 0, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_28248_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030291", "code": "def find_pairs_with_sum(nums, target):\n    seen = set()\n    pairs = []\n    for num in nums:\n        diff = target - num\n        if diff in seen:\n            pairs.append((num, diff))\n        seen.add(num)\n    return pairs\n", "entry_point": "find_pairs_with_sum", "input": "[7, 8, 0, 1, 2], 15", "output": "[(8, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108068_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030292", "code": "def emailExtractor(item):\n    if \"<\" in item:\n        start = item.find(\"<\") + 1\n        stop = item.find(\">\")\n        email = item[start:stop]\n    else:\n        email = item.split(\":\")[1].strip().replace('\"', \"\")\n    if \"@\" not in email:\n        domain = False\n    else:\n        domain = email.split(\"@\")[1].replace('\"', \"\")\n    return email, domain\n", "entry_point": "emailExtractor", "input": "'<jsmitSmith>'", "output": "('jsmitSmith', False)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32379_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030293", "code": "def power(a, n):\n    if n == 0:\n        return 1\n    if n < 0:\n        return 1 / power(a, -n)\n    if n % 2 == 0:\n        return power(a * a, n // 2)\n    else:\n        return a * power(a, n - 1)\n", "entry_point": "power", "input": "2, 3", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_63692_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030294", "code": "def calculate_average_excluding_extremes(numbers):\n    if len(numbers) <= 2:\n        return 0  # If the list has 0, 1, or 2 elements, return 0 as there are no extremes to exclude\n    min_val = min(numbers)\n    max_val = max(numbers)\n    numbers.remove(min_val)\n    numbers.remove(max_val)\n    return sum(numbers) / len(numbers)\n", "entry_point": "calculate_average_excluding_extremes", "input": "[1, 2.5, 2.5, 3.0, 4]", "output": "2.6666666666666665", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132591_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030295", "code": "def find_max_cross_section(scan_shapes):\n    max_width, max_height, max_depth = 0, 0, 0\n    for shape in scan_shapes:\n        max_width = max(max_width, shape[2])\n        max_height = max(max_height, shape[1])\n        max_depth = max(max_depth, shape[0])\n    return max_depth, max_height, max_width\n", "entry_point": "find_max_cross_section", "input": "[(15, 10, 30), (5, 25, 20), (10, 15, 35)]", "output": "(15, 25, 35)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_103530_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030296", "code": "def cumulative_sum_list(input_list):\n    output_list = []\n    cumulative_sum = 0\n    for num in input_list:\n        cumulative_sum += num\n        output_list.append(cumulative_sum)\n    return output_list\n", "entry_point": "cumulative_sum_list", "input": "[3, 4, 3, 2, 3, 2]", "output": "[3, 7, 10, 12, 15, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94639_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030297", "code": "def construct_full_url(base_url, endpoint):\n    return base_url + endpoint\n", "entry_point": "construct_full_url", "input": "'htthmthtttmple.com', '/api/d/t'", "output": "'htthmthtttmple.com/api/d/t'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49295_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030298", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4184", "output": "{1, 2, 4, 8, 523, 2092, 1046, 4184}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4183", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030299", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3887", "output": "{1, 169, 299, 13, 3887, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3886", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030300", "code": "def phone_avg_use_cpu(cpu):\n    if not cpu:\n        return \"0%\"\n    avg_cpu = round(sum(cpu) / len(cpu))\n    return str(avg_cpu) + \"%\"\n", "entry_point": "phone_avg_use_cpu", "input": "[25, 27, 29]", "output": "'27%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70807_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030301", "code": "def calculate_weighted_average(values, weights):\n    if len(values) != len(weights):\n        raise ValueError(\"Values and weights lists must have the same length.\")\n    weighted_sum = sum(value * weight for value, weight in zip(values, weights))\n    return weighted_sum\n", "entry_point": "calculate_weighted_average", "input": "[10, 5], [2, 2.3]", "output": "31.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65743_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030302", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8498", "output": "{1, 2, 7, 14, 8498, 4249, 1214, 607}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8497", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030303", "code": "import string\ndef analyze_text(text):\n    word_freq = {}\n    for word in text.split():\n        cleaned_word = ''.join(char for char in word if char.isalnum()).lower()\n        if cleaned_word:\n            word_freq[cleaned_word] = word_freq.get(cleaned_word, 0) + 1\n    return word_freq\n", "entry_point": "analyze_text", "input": "'hellworldhelloo'", "output": "{'hellworldhelloo': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35421_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030304", "code": "def SpaceToDash(texto):\n    return texto.replace(\" \", \"-\")\n", "entry_point": "SpaceToDash", "input": "'thtttts'", "output": "'thtttts'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_122126_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030305", "code": "def replace_empty_strings_with_none(data):\n    if isinstance(data, dict):\n        for key, value in data.items():\n            data[key] = replace_empty_strings_with_none(value)\n    elif isinstance(data, list):\n        for i, element in enumerate(data):\n            data[i] = replace_empty_strings_with_none(element)\n    elif data == '':\n        data = None\n    return data\n", "entry_point": "replace_empty_strings_with_none", "input": "'John'", "output": "'John'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135388_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030306", "code": "def GetNote(note_name, scale):\n    midi_val = (scale - 1) * 12  # MIDI value offset based on scale\n    # Dictionary to map note letters to MIDI offsets\n    note_offsets = {'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11}\n    note = note_name[0]\n    if note not in note_offsets:\n        raise ValueError(\"Invalid note name\")\n    midi_val += note_offsets[note]\n    if len(note_name) > 1:\n        modifier = note_name[1]\n        if modifier == 's' or modifier == '#':\n            midi_val += 1\n        else:\n            raise ValueError(\"Invalid note modifier\")\n    if note_name[:2] in ('es', 'e#', 'bs', 'b#'):\n        raise ValueError(\"Invalid note combination\")\n    return midi_val\n", "entry_point": "GetNote", "input": "'cs', 0", "output": "-11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24350_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030307", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[95, 83, 66, 50, 45, 30]", "output": "[95, 83, 66]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030308", "code": "SPECIAL_NAMES = {\n    'Freienbach SOB, Bahnhof': ('Freienbach SOB', 'Freienbach'),\n    'Herrliberg-Feldmeilen,Bhf West': ('Bahnhof West', 'Herrliberg-Feldmeilen'),\n    'Neue Forch': ('Neue Forch', 'Z\u00fcrich'),\n    'O<NAME>': ('O<NAME>', 'Oberrieden'),\n    'Spital Zollikerberg': ('Spital', 'Zollikerberg'),\n    'Triemli': ('Triemli', 'Z\u00fcrich'),\n    'Zentrum Glatt': ('Zentrum Glatt', 'Wallisellen'),\n}\nSPECIAL_CITIES = {\n    'Affoltern a. A.': 'Affoltern am Albis',\n    'Wangen b. D.': 'Wangen'\n}\ndef correct_city_name(city_name):\n    if city_name in SPECIAL_CITIES:\n        return SPECIAL_CITIES[city_name]\n    elif city_name in SPECIAL_NAMES:\n        return f\"{SPECIAL_NAMES[city_name][0]}, {SPECIAL_NAMES[city_name][1]}\"\n    else:\n        return city_name\n", "entry_point": "correct_city_name", "input": "'b'", "output": "'b'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2124_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030309", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8889", "output": "{3, 1, 8889, 2963}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8888", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030310", "code": "from typing import List\ndef anonymize_strings(strings: List[str]) -> List[str]:\n    anonymized_strings = []\n    for string in strings:\n        anonymized_string = string[0] + '*' * (len(string) - 2) + string[-1]\n        anonymized_strings.append(anonymized_string)\n    return anonymized_strings\n", "entry_point": "anonymize_strings", "input": "['hello', 'world', 'python']", "output": "['h***o', 'w***d', 'p****n']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_44127_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030311", "code": "def add_index_to_element(nums):\n    result = []\n    for idx, num in enumerate(nums):\n        result.append(num + idx)\n    return result\n", "entry_point": "add_index_to_element", "input": "[2, 2, 4, 1, 2, 8, 2]", "output": "[2, 3, 6, 4, 6, 13, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42098_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030312", "code": "from typing import List\ndef remove_poisoned_data(predictions: List[int]) -> List[int]:\n    median = sorted(predictions)[len(predictions) // 2]\n    deviations = [abs(pred - median) for pred in predictions]\n    mad = sorted(deviations)[len(deviations) // 2]\n    threshold = 2 * mad\n    cleaned_predictions = [pred for pred in predictions if abs(pred - median) <= threshold]\n    return cleaned_predictions\n", "entry_point": "remove_poisoned_data", "input": "[12, 10, 9, 12, 11]", "output": "[12, 10, 9, 12, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_51414_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030313", "code": "def count_altered_fields(migrations):\n    altered_fields = set()\n    for model, field in migrations:\n        altered_fields.add((model, field))\n    return len(altered_fields)\n", "entry_point": "count_altered_fields", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_46900_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030314", "code": "from typing import List\ndef rotate_image(image: List[List[int]]) -> List[List[int]]:\n    n = len(image)\n    # Transpose the matrix\n    for i in range(n):\n        for j in range(i+1, n):\n            image[i][j], image[j][i] = image[j][i], image[i][j]\n    # Reverse each row\n    for i in range(n):\n        image[i] = image[i][::-1]\n    return image\n", "entry_point": "rotate_image", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[7, 4, 1], [8, 5, 2], [9, 6, 3]]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43613_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030315", "code": "def convert_time_custom(t):\n    minutes = int(t // 60)\n    seconds = int(t % 60)\n    time_str = f\"{minutes:02}:{seconds:02}\"\n    return time_str\n", "entry_point": "convert_time_custom", "input": "58", "output": "'00:58'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65527_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030316", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3193", "output": "{1, 103, 3193, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3192", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030317", "code": "def sum_with_index(lst):\n    result = [num + idx for idx, num in enumerate(lst)]\n    return result\n", "entry_point": "sum_with_index", "input": "[1, 0, 2, 1, 2, 2]", "output": "[1, 1, 4, 4, 6, 7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88768_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030318", "code": "def tomorrow(_):\n    return {i: i**2 for i in range(1, _+1)}\n", "entry_point": "tomorrow", "input": "3", "output": "{1: 1, 2: 4, 3: 9}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74523_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030319", "code": "def get_setting(settings, setting_name, default=None):\n    if setting_name in settings:\n        return settings[setting_name]\n    return default\n", "entry_point": "get_setting", "input": "{'eyey': 'eyey'}, 'eyey'", "output": "'eyey'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60054_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030320", "code": "from typing import List\ndef count_unique_integers(input_list: List) -> dict:\n    unique_integers_count = {}\n    for element in input_list:\n        if isinstance(element, int):\n            if element in unique_integers_count:\n                unique_integers_count[element] += 1\n            else:\n                unique_integers_count[element] = 1\n    return unique_integers_count\n", "entry_point": "count_unique_integers", "input": "['a', 3.5, 3, 3, 3, 0, 'hello', None]", "output": "{3: 3, 0: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35434_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030321", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "841", "output": "{841, 1, 29}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt840", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030322", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[88, 88, 78, 50, 30]", "output": "[88, 88, 78]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030323", "code": "from typing import List\ndef average_top_scores(scores: List[int], N: int) -> float:\n    if N >= len(scores):\n        return sum(scores) / len(scores)\n    sorted_scores = sorted(scores, reverse=True)\n    top_scores = sorted_scores[:N]\n    return sum(top_scores) / N\n", "entry_point": "average_top_scores", "input": "[100, 90, 85, 85, 80, 77, 61, 50], 7", "output": "82.57142857142857", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132005_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030324", "code": "def process_numbers(numbers):\n    result = []\n    for num in numbers:\n        if num % 2 == 0 and num % 3 == 0:\n            result.append(num * 5)\n        elif num % 2 == 0:\n            result.append(num ** 2)\n        elif num % 3 == 0:\n            result.append(num ** 3)\n        else:\n            result.append(num)\n    return result\n", "entry_point": "process_numbers", "input": "[9, 10, 3, 9, 10, 3, 3]", "output": "[729, 100, 27, 729, 100, 27, 27]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146375_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030325", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4685", "output": "{1, 5, 937, 4685}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4684", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030326", "code": "def encrypt_text(text: str, shift: int) -> str:\n    encrypted_text = \"\"\n    for char in text:\n        if char.islower():\n            shifted_char = chr(((ord(char) - ord('a') + shift) % 26) + ord('a'))\n            encrypted_text += shifted_char\n        else:\n            encrypted_text += char\n    return encrypted_text\n", "entry_point": "encrypt_text", "input": "'hello', 5", "output": "'mjqqt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65928_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030327", "code": "def calculate_dot_product(dense_vector, sparse_vector):\n    dot_product = 0.0\n    if isinstance(sparse_vector, dict):\n        for index, value in sparse_vector.items():\n            dot_product += value * dense_vector[index]\n    elif isinstance(sparse_vector, list):\n        for index, value in sparse_vector:\n            dot_product += value * dense_vector[index]\n    return dot_product\n", "entry_point": "calculate_dot_product", "input": "[], {}", "output": "0.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143255_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030328", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2649", "output": "{2649, 1, 3, 883}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2648", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030329", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4007", "output": "{1, 4007}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4006", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030330", "code": "def process_folders(folder_paths):\n    netFolders = []\n    netClass = []\n    for folder_path in folder_paths:\n        if \"rede_3\" in folder_path:\n            folder_name_parts = folder_path.split(\"/\")[-1].split(\"_\")\n            class_name = folder_name_parts[-1].lower()\n        else:\n            class_name = \"rede1_positive\"\n        netFolders.append(folder_path)\n        netClass.append(class_name)\n    return netFolders, netClass\n", "entry_point": "process_folders", "input": "[]", "output": "([], [])", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94520_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030331", "code": "def get_config(base_base_path: str):\n    return base_base_path\n", "entry_point": "get_config", "input": "'examplexhexape'", "output": "'examplexhexape'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38961_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030332", "code": "def generate_forcefield_path(name):\n    base_directory = \"/path/to/forcefields/\"\n    forcefield_filename = f\"forcefield_{name}.txt\"\n    forcefield_path = base_directory + forcefield_filename\n    return forcefield_path\n", "entry_point": "generate_forcefield_path", "input": "'etati'", "output": "'/path/to/forcefields/forcefield_etati.txt'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84731_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030333", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'', 'appble bape'", "output": "['bape', 'appble']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030334", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2653", "output": "{1, 379, 2653, 7}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2652", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030335", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7871", "output": "{1, 463, 17, 7871}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7870", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030336", "code": "import logging\ndef process_detections(detections, user_id, team_id):\n    data = {\"detections\": [{\"id\": d['id']} for d in detections]}\n    # Simulating asynchronous tasks\n    def recalculate_user_stats(user_id):\n        # Code to recalculate user statistics\n        pass\n    def recalculate_team_stats(team_id):\n        # Code to recalculate team statistics\n        pass\n    recalculate_user_stats.delay = recalculate_user_stats  # Mocking asynchronous task\n    recalculate_team_stats.delay = recalculate_team_stats  # Mocking asynchronous task\n    recalculate_user_stats.delay(user_id)\n    recalculate_team_stats.delay(team_id)\n    num_detections = len(detections)\n    logger = logging.getLogger(__name__)\n    logger.info(\"Stored {} detections for user {}\".format(num_detections, user_id))\n    return data\n", "entry_point": "process_detections", "input": "[{'id': 7}], user_id=123, team_id=456", "output": "{'detections': [{'id': 7}]}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_70067_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030337", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9505", "output": "{1, 1901, 5, 9505}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9504", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030338", "code": "def perform_operation(operation, num1, num2):\n    try:\n        if operation == 'sum':\n            from .sum import SumController\n            result = SumController().operate(num1, num2)\n        elif operation == 'subtract':\n            from .subtract import SubtractController\n            result = SubtractController().operate(num1, num2)\n        elif operation == 'multiply':\n            from .multiply import MultiplyController\n            result = MultiplyController().operate(num1, num2)\n        elif operation == 'divide':\n            from .divide import DivideController\n            result = DivideController().operate(num1, num2)\n        else:\n            return f\"Error: Invalid operation type '{operation}'\"\n    except ImportError:\n        return f\"Error: Controller for '{operation}' not found\"\n    return result\n", "entry_point": "perform_operation", "input": "'mdwee', 1, 2", "output": "\"Error: Invalid operation type 'mdwee'\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142128_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030339", "code": "def calculate_class_name_lengths(api_manager_classes):\n    filtered_classes = [cls for cls in api_manager_classes if not cls.startswith('_')]\n    class_name_lengths = {cls: len(cls) for cls in filtered_classes}\n    return class_name_lengths\n", "entry_point": "calculate_class_name_lengths", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127028_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030340", "code": "def calculate_metrics(predicts, golds):\n    true_predict = 0\n    true = 0\n    predict = 0\n    for i in range(len(predicts)):\n        if predicts[i] == 1:\n            predict += 1\n        if golds[i] == 1:\n            true += 1\n        if predicts[i] == 1 and golds[i] == 1:\n            true_predict += 1\n    precision = (true_predict + 0.0) / (predict + 0.0) if predict > 0 else 0\n    recall = (true_predict + 0.0) / (true + 0.0) if true > 0 else 0\n    f1 = (2 * precision * recall) / (precision + recall) if predict > 0 and true > 0 else 0\n    return precision, recall, f1\n", "entry_point": "calculate_metrics", "input": "[1, 1, 1], [1, 0, 0]", "output": "(0.3333333333333333, 1.0, 0.5)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11471_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030341", "code": "def format_version(version_tuple):\n    # Convert each element in the version tuple to a string\n    version_str = '.'.join(map(str, version_tuple))\n    # Enclose the version string in parentheses\n    formatted_version = f\"({version_str})\"\n    return formatted_version\n", "entry_point": "format_version", "input": "(0.0, -1, 1, 4.0)", "output": "'(0.0.-1.1.4.0)'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_56274_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030342", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[40, 55, 69, 88, 89]", "output": "[89, 88, 69]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_39274_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030343", "code": "def calculate_elapsed_time(timestamp1, timestamp2):\n    h1, m1, s1 = map(int, timestamp1.split(':'))\n    h2, m2, s2 = map(int, timestamp2.split(':'))\n    total_seconds1 = h1 * 3600 + m1 * 60 + s1\n    total_seconds2 = h2 * 3600 + m2 * 60 + s2\n    if total_seconds2 < total_seconds1:\n        total_seconds2 += 86400  # Add 24 hours (86400 seconds) for the new day\n    elapsed_seconds = total_seconds2 - total_seconds1\n    return elapsed_seconds\n", "entry_point": "calculate_elapsed_time", "input": "'00:00:00', '23:30:00'", "output": "84600", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_47943_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030344", "code": "def process_list(input_list):\n    output_list = []\n    for i in range(len(input_list) - 1):\n        output_list.append(input_list[i] + input_list[i + 1])\n    output_list.append(input_list[-1] + input_list[0])\n    return output_list\n", "entry_point": "process_list", "input": "[4, 2, 4, 4, 2, 4, 2]", "output": "[6, 6, 8, 6, 6, 6, 6]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_137556_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030345", "code": "def simulate_robot_movement(commands):\n    x, y = 0, 0  # Initial position of the robot\n    for command in commands:\n        if command == 'U':\n            y += 1\n        elif command == 'D':\n            y -= 1\n        elif command == 'L':\n            x -= 1\n        elif command == 'R':\n            x += 1\n    return x, y\n", "entry_point": "simulate_robot_movement", "input": "['U', 'U', 'L', 'L']", "output": "(-2, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_84808_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030346", "code": "def generate_odd_numbers(n):\n    return [2*i + 1 for i in range(n)]\n", "entry_point": "generate_odd_numbers", "input": "9", "output": "[1, 3, 5, 7, 9, 11, 13, 15, 17]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107921_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030347", "code": "def process_tick_parameters(tick_params):\n    tick_dict = {}\n    for param in tick_params:\n        which, axis, direction = param.split(',')\n        which = which.split('=')[1]\n        axis = axis.split('=')[1]\n        direction = direction.split('=')[1]\n        key = (which, axis)\n        if key not in tick_dict:\n            tick_dict[key] = []\n        tick_dict[key].append(direction)\n    return tick_dict\n", "entry_point": "process_tick_parameters", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38977_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030348", "code": "def calculate_statistics(input_data):\n    student_data = {}\n    subject_grades = {}\n    for line in input_data:\n        parts = line.strip().split(',')\n        student_name = parts[0]\n        grades = list(map(int, parts[1:]))\n        student_data[student_name] = {\n            'grades': grades,\n            'average_grade': sum(grades) / len(grades),\n            'highest_grade': max(grades),\n            'highest_grade_subject': grades.index(max(grades)) + 1\n        }\n        for i, grade in enumerate(grades):\n            if i + 1 not in subject_grades:\n                subject_grades[i + 1] = []\n            subject_grades[i + 1].append(grade)\n    class_avg_per_subject = {subject: sum(grades) / len(grades) for subject, grades in subject_grades.items()}\n    return student_data, class_avg_per_subject\n", "entry_point": "calculate_statistics", "input": "[]", "output": "({}, {})", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_104467_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030349", "code": "def sum_fibonacci_numbers(N):\n    if N <= 0:\n        return 0\n    fib_sum = 0\n    a, b = 0, 1\n    for _ in range(N):\n        fib_sum += a\n        a, b = b, a + b\n    return fib_sum\n", "entry_point": "sum_fibonacci_numbers", "input": "4", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92640_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030350", "code": "def binary_search(target):\n    low = 1\n    high = 20\n    while low <= high:\n        mid = (low + high) // 2\n        if mid == target:\n            return mid\n        elif mid < target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n", "entry_point": "binary_search", "input": "20", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_105379_ipt19", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030351", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3531", "output": "{1, 321, 3, 33, 3531, 11, 107, 1177}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3530", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030352", "code": "from typing import List\ndef evil_count(dead_players: List[int]) -> List[int]:\n    evil_counts = []\n    evil_count = 0\n    for dead_count in dead_players:\n        evil_count += dead_count\n        evil_counts.append(evil_count)\n    return evil_counts\n", "entry_point": "evil_count", "input": "[0, 1, 5, 0, 4, 5, -1, -1]", "output": "[0, 1, 6, 6, 10, 15, 14, 13]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49586_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030353", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8393", "output": "{1, 7, 8393, 11, 77, 109, 1199, 763}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8392", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030354", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3858", "output": "{1, 2, 3, 643, 1286, 6, 1929, 3858}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3857", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030355", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3061", "output": "{1, 3061}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3060", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030356", "code": "def extract_version(version_str):\n    major, minor = version_str.split('.')\n    minor = ''.join(filter(str.isdigit, minor))  # Extract only numeric characters\n    return int(major), int(minor)\n", "entry_point": "extract_version", "input": "'5.12'", "output": "(5, 12)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119592_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030357", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2410", "output": "{1, 2, 482, 5, 2410, 10, 241, 1205}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2409", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030358", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9305", "output": "{9305, 1, 1861, 5}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9304", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030359", "code": "def format_music_app_name(name: str) -> str:\n    words = name.split('_')  # Split the input string by underscores\n    formatted_words = [word.capitalize() for word in words]  # Capitalize the first letter of each word\n    formatted_name = ' '.join(formatted_words)  # Join the modified words with spaces\n    return formatted_name\n", "entry_point": "format_music_app_name", "input": "'spotier'", "output": "'Spotier'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_57869_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030360", "code": "def newton_sqrt(n):\n    x = n  # Initial guess\n    while True:\n        next_x = 0.5 * (x + n / x)\n        if abs(x - next_x) < 1e-10:\n            return round(next_x, 10)  # Return with 10 decimal places precision\n        x = next_x\n", "entry_point": "newton_sqrt", "input": "11", "output": "3.3166247904", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82814_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030361", "code": "import importlib\ndef get_module_functions(modules):\n    functions_dict = {}\n    for module_name in modules:\n        try:\n            module = importlib.import_module(module_name)\n            functions = [func for func in dir(module) if callable(getattr(module, func)) and not func.startswith('_')]\n            functions_dict[module_name] = functions\n        except ModuleNotFoundError:\n            print(f\"Module '{module_name}' not found.\")\n    return functions_dict\n", "entry_point": "get_module_functions", "input": "['nonexistent_module1', 'random_module_that_does_not_exist']", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_119325_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030362", "code": "def calculate_expression(expression):\n    expression = expression.replace(\" \", \"\")  # Remove spaces from the input expression\n    operators = {'+': 1, '-': 1, '*': 2}  # Define operator precedence\n    def apply_operator(operands, operator):\n        b = operands.pop()\n        a = operands.pop()\n        if operator == '+':\n            return a + b\n        elif operator == '-':\n            return a - b\n        elif operator == '*':\n            return a * b\n    operands = []\n    operators_stack = []\n    i = 0\n    while i < len(expression):\n        if expression[i].isdigit():\n            operand = 0\n            while i < len(expression) and expression[i].isdigit():\n                operand = operand * 10 + int(expression[i])\n                i += 1\n            operands.append(operand)\n        elif expression[i] in operators:\n            while operators_stack and operators_stack[-1] in operators and operators[operators_stack[-1]] >= operators[expression[i]]:\n                operands.append(apply_operator(operands, operators_stack.pop()))\n            operators_stack.append(expression[i])\n            i += 1\n    while operators_stack:\n        operands.append(apply_operator(operands, operators_stack.pop()))\n    return operands[0]\n", "entry_point": "calculate_expression", "input": "'10 + 3'", "output": "13", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_140440_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030363", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3145", "output": "{1, 5, 37, 3145, 17, 629, 85, 185}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3144", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030364", "code": "def get_formatted_name(first_name, last_name, middle_name=None):\n    if middle_name:\n        full_name = f\"{first_name} {middle_name} {last_name}\"\n    else:\n        full_name = f\"{first_name} {last_name}\"\n    return full_name\n", "entry_point": "get_formatted_name", "input": "'JoJ', 'DoSSmith', 'Mar'", "output": "'JoJ Mar DoSSmith'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29071_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030365", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3243", "output": "{1, 3, 69, 3243, 141, 47, 23, 1081}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3242", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030366", "code": "from typing import List, Dict, Union, Tuple\ndef process_advances(advance_entries: List[Dict[str, Union[str, int]]]) -> Tuple[List[Dict[str, Union[str, int]]], int]:\n    total_allocated = 0\n    advances = []\n    for entry in advance_entries:\n        advances.append(entry)\n        total_allocated += entry.get(\"Amount\", 0)\n    return advances, total_allocated\n", "entry_point": "process_advances", "input": "[{}, {}, {}, {}, {}, {}]", "output": "([{}, {}, {}, {}, {}, {}], 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_127428_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030367", "code": "def calculate_area(vertices):\n    n = len(vertices)\n    area = 0\n    j = n - 1\n    for i in range(n):\n        area += (vertices[j][0] + vertices[i][0]) * (vertices[j][1] - vertices[i][1])\n        j = i\n    return abs(area) / 2\n", "entry_point": "calculate_area", "input": "[(0, 0), (4, 0), (4, 3), (0, 3)]", "output": "12.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_75590_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030368", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "18468", "output": "9234", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030369", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3] if len(sorted_scores) >= 3 else sorted_scores\n", "entry_point": "top_three_scores", "input": "[85, 85, 85]", "output": "[85, 85, 85]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72561_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030370", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5129", "output": "{1, 223, 5129, 23}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5128", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030371", "code": "def in_place_insertion_sort(the_list):\n    i = 1\n    while i < len(the_list):\n        elem = the_list[i]\n        sorted_iterator = i - 1\n        while elem < the_list[sorted_iterator] and sorted_iterator >= 0:\n            the_list[sorted_iterator + 1] = the_list[sorted_iterator]\n            sorted_iterator -= 1\n        the_list[sorted_iterator + 1] = elem\n        i += 1\n    return the_list\n", "entry_point": "in_place_insertion_sort", "input": "[5, 9, 3, 2, 11, 5, 0, 9]", "output": "[0, 2, 3, 5, 5, 9, 9, 11]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94421_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030372", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2702", "output": "{1, 2, 386, 193, 7, 1351, 2702, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2701", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030373", "code": "def filter_functions(functions_list):\n    invisible_functions = []\n    for func_name in functions_list:\n        if 'null' in func_name:\n            invisible_functions.append(func_name)\n    return invisible_functions\n", "entry_point": "filter_functions", "input": "['functionA', 'functionB']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79752_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030374", "code": "def pairs(b, _k):\n    count = 0\n    b_set = set(b)\n    for x in b:\n        if x + _k in b_set:\n            count += 1\n    return count\n", "entry_point": "pairs", "input": "[1, 3, 5, 7], 2", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_132408_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030375", "code": "def next_semantic_version(version):\n    major, minor, patch = map(int, version.split('.'))\n    if patch < 9:\n        return f\"{major}.{minor}.{patch + 1}\"\n    elif minor < 9:\n        return f\"{major}.{minor + 1}.0\"\n    else:\n        return f\"{major + 1}.0.0\"\n", "entry_point": "next_semantic_version", "input": "'3.4.5'", "output": "'3.4.6'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_143821_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030376", "code": "def truncatechars(value, arg):\n    try:\n        length = int(arg)\n    except ValueError:\n        return value  # Return original value if arg is not a valid integer\n    if len(value) > length:\n        return value[:length] + '...'  # Truncate and append '...' if length exceeds arg\n    return value  # Return original value if length is not greater than arg\n", "entry_point": "truncatechars", "input": "'PPyHeon', '8'", "output": "'PPyHeon'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_15483_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030377", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8696", "output": "{1, 2, 4, 8, 8696, 4348, 2174, 1087}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8695", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030378", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[92, 87, 79, 75, 65, 60]", "output": "[92, 87, 79]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113414_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030379", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1859", "output": "{1, 1859, 169, 11, 13, 143}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030380", "code": "def long_division(dividend, divisor):\n    if divisor == 0:\n        return \"Error: Division by zero\"\n    quotient = 0\n    remainder = 0\n    for digit in str(dividend):\n        partial_dividend = remainder * 10 + int(digit)\n        quotient_digit = partial_dividend // divisor\n        remainder = partial_dividend % divisor\n        quotient = quotient * 10 + quotient_digit\n    return quotient, remainder\n", "entry_point": "long_division", "input": "10, 0", "output": "'Error: Division by zero'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66316_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030381", "code": "def clean_text(input_str):\n    if input_str is None or input_str == \"NaN\":\n        return \"\"\n    return input_str.strip()\n", "entry_point": "clean_text", "input": "' HolHol\u00e0\u00e0 '", "output": "'HolHol\u00e0\u00e0'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29172_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030382", "code": "def calculate_depth(path):\n    depth = 1\n    for char in path:\n        if char == '/':\n            depth += 1\n    return depth\n", "entry_point": "calculate_depth", "input": "'/a/b/c/d/e'", "output": "6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21386_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030383", "code": "import os\ndef expanduser(path):\n    \"\"\"\n    Expand ~ and ~user constructions.\n    Includes a workaround for http://bugs.python.org/issue14768\n    \"\"\"\n    expanded = os.path.expanduser(path)\n    if path.startswith(\"~/\") and expanded.startswith(\"//\"):\n        expanded = expanded[1:]\n    return expanded\n", "entry_point": "expanduser", "input": "'~user/documents'", "output": "'~user/documents'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6640_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030384", "code": "def filter_population(pop, n_survive=None):\n    if len(pop) == 0:\n        return []\n    if n_survive is None:\n        n_survive = len(pop)\n    n_survive = min(n_survive, len(pop))\n    return pop[:n_survive]\n", "entry_point": "filter_population", "input": "[1, 2, 3, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79025_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030385", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2449", "output": "{1, 2449, 79, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2448", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030386", "code": "def group_students_by_age(students):\n    age_groups = {}\n    for student in students:\n        age = student['age']\n        name = student['name']\n        if age in age_groups:\n            age_groups[age].append(name)\n        else:\n            age_groups[age] = [name]\n    return age_groups\n", "entry_point": "group_students_by_age", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24764_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030387", "code": "def swap_adjacent_elements(input_list):\n    swapped = True\n    while swapped:\n        swapped = False\n        for i in range(len(input_list) - 1):\n            if input_list[i] > input_list[i + 1]:\n                input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n                swapped = True\n    return input_list\n", "entry_point": "swap_adjacent_elements", "input": "[5, 5, 1, 4, 3, 5, 4, 2, 5]", "output": "[1, 2, 3, 4, 4, 5, 5, 5, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2817_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030388", "code": "def add_hours(current_hour, hours_to_add):\n    new_hour = (current_hour + hours_to_add) % 24\n    return f'{new_hour:02d}:00'\n", "entry_point": "add_hours", "input": "0, 1", "output": "'01:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49261_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030389", "code": "def highest_unique_score(scores):\n    score_freq = {}\n    for score in scores:\n        if score in score_freq:\n            score_freq[score] += 1\n        else:\n            score_freq[score] = 1\n    unique_scores = [score for score, freq in score_freq.items() if freq == 1]\n    if not unique_scores:\n        return -1\n    else:\n        return max(unique_scores)\n", "entry_point": "highest_unique_score", "input": "[2, 3, 4, 4]", "output": "3", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95943_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030390", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "56", "output": "{1, 2, 4, 7, 8, 14, 56, 28}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt55", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030391", "code": "from typing import List\ndef calculate_total_parameters(layers: List[str]) -> int:\n    param_formulas = {\n        'nn.Conv2d': lambda in_channels, out_channels, kernel_size: (in_channels * out_channels * kernel_size**2) + out_channels,\n        'nn.Linear': lambda in_features, out_features: in_features * out_features\n    }\n    total_params = 0\n    for layer in layers:\n        if layer.startswith('nn.Conv2d'):\n            in_channels, out_channels, kernel_size = 3, 64, 3  # Example values for demonstration\n            total_params += param_formulas['nn.Conv2d'](in_channels, out_channels, kernel_size)\n        elif layer.startswith('nn.Linear'):\n            in_features, out_features = 512, 256  # Example values for demonstration\n            total_params += param_formulas['nn.Linear'](in_features, out_features)\n    return total_params\n", "entry_point": "calculate_total_parameters", "input": "['nn.Conv2d', 'nn.Conv2d', 'nn.Linear']", "output": "134656", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149773_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030392", "code": "def max_non_adjacent_score(scores):\n    include = 0\n    exclude = 0\n    for score in scores:\n        new_include = max(score + exclude, include)\n        exclude = max(include, exclude)\n        include = new_include\n    return max(include, exclude)\n", "entry_point": "max_non_adjacent_score", "input": "[20, 1, 21]", "output": "41", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_26474_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030393", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7639", "output": "{1, 7639}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7638", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030394", "code": "import os\ndef determine_file_location(relative_root: str, location_type: str, root_folder: str = '') -> str:\n    MS_DATA = os.getenv('MS_DATA', '')  # Get the value of MS_DATA environment variable or default to empty string\n    if location_type == 'LOCAL':\n        full_path = os.path.join(root_folder, relative_root)\n    elif location_type == 'S3':\n        full_path = os.path.join('s3://' + root_folder, relative_root)\n    else:\n        raise ValueError(\"Invalid location type. Supported types are 'LOCAL' and 'S3'.\")\n    return full_path\n", "entry_point": "determine_file_location", "input": "'logs/error.log', 'LOCAL', '/var'", "output": "'/var/logs/error.log'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7795_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030395", "code": "def curate(pop):\n    seen = set()\n    result = []\n    for num in pop:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "curate", "input": "[5, 5, 7, 2, 2, 1, 0]", "output": "[5, 7, 2, 1, 0]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_37145_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030396", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5228", "output": "{1, 2, 4, 5228, 2614, 1307}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5227", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030397", "code": "def rectify_data(data):\n    seen = set()\n    result = []\n    for num in data:\n        if num not in seen:\n            seen.add(num)\n            result.append(num)\n    return result\n", "entry_point": "rectify_data", "input": "[0, 5, 0, 1, 2, 5, 1]", "output": "[0, 5, 1, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91882_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030398", "code": "def reverseByMiddles(arr):\n    n = len(arr)\n    limit = n // 2\n    for i in range(limit):\n        temp = arr[i]\n        arr[i] = arr[(n - 1) - i]\n        arr[(n - 1) - i] = temp\n    return arr\n", "entry_point": "reverseByMiddles", "input": "[4, 4, 0, 5]", "output": "[5, 0, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_13878_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030399", "code": "def analyze_list(lst):\n    count_dict = {}\n    for num in lst:\n        if num in count_dict:\n            count_dict[num] += 1\n        else:\n            count_dict[num] = 1\n    return count_dict\n", "entry_point": "analyze_list", "input": "[4, 4, 2, 2, 2, 1, 1, 5, 3]", "output": "{4: 2, 2: 3, 1: 2, 5: 1, 3: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_23201_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030400", "code": "def convert_time_to_24_hour_format(time_str):\n    hour, minute, second = map(int, time_str[:-2].split(':'))\n    is_pm = time_str[-2:].lower() == 'pm'\n    if is_pm and hour < 12:\n        hour += 12\n    elif not is_pm and hour == 12:\n        hour = 0\n    return f'{hour:02d}:{minute:02d}:{second:02d}'\n", "entry_point": "convert_time_to_24_hour_format", "input": "'12:30:00 AM'", "output": "'00:30:00'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_92250_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030401", "code": "def calculate_derivative(coefficients):\n    derivative_coefficients = []\n    for i in range(1, len(coefficients)):\n        derivative_coefficients.append(i * coefficients[i])\n    return derivative_coefficients\n", "entry_point": "calculate_derivative", "input": "[1, 3, 4, -2, 3, 3, 0, 3, 2]", "output": "[3, 8, -6, 12, 15, 0, 21, 16]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87280_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030402", "code": "def cut_log(p, n):\n    maximum = [0]  # Initialize the list to store maximum revenue for each rod length\n    for j in range(1, n + 1):\n        comp = -float(\"inf\")\n        for i in range(1, j + 1):\n            comp = max(p[i - 1] + maximum[j - i], comp)\n        maximum.append(comp)\n    return maximum[-1]\n", "entry_point": "cut_log", "input": "[1, 5, 8, 9, 10, 17, 17, 20, 24, 30], 10", "output": "30", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_113055_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030403", "code": "from collections import Counter\ndef count_frequency(input_list):\n    # Create a Counter object from the input list\n    frequency_counter = Counter(input_list)\n    # Convert the Counter object to a dictionary and return it\n    return dict(frequency_counter)\n", "entry_point": "count_frequency", "input": "[1, 1, 1, 2, 2, 3, 4]", "output": "{1: 3, 2: 2, 3: 1, 4: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_95993_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030404", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8859", "output": "{3, 1, 2953, 8859}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8858", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030405", "code": "def max_area(walls):\n    max_area = 0\n    left = 0\n    right = len(walls) - 1\n    while left < right:\n        width = right - left\n        height = min(walls[left], walls[right])\n        area = width * height\n        max_area = max(max_area, area)\n        if walls[left] < walls[right]:\n            left += 1\n        else:\n            right -= 1\n    return max_area\n", "entry_point": "max_area", "input": "[4, 1, 3, 5, 4, 2, 0, 4]", "output": "28", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100123_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030406", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1758", "output": "{1, 2, 3, 293, 6, 586, 879, 1758}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1757", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030407", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3293", "output": "{89, 1, 37, 3293}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3292", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030408", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8651", "output": "{1, 8651, 211, 41}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8650", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030409", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5427", "output": "{1, 3, 67, 27, 9, 201, 1809, 81, 5427, 603}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5426", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030410", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "706", "output": "{1, 706, 2, 353}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt705", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030411", "code": "def generate_review_urls(prof_id, course_name, review_id=None, vote=None):\n    base_url = '/reviews/'\n    if review_id:\n        return f'{base_url}{review_id}/{prof_id}/{course_name}'\n    elif vote:\n        return f'{base_url}{review_id}/{vote}/{prof_id}/{course_name}'\n    else:\n        return f'{base_url}{prof_id}/{course_name}'\n", "entry_point": "generate_review_urls", "input": "'123123', 'm1ath10t1', '456456'", "output": "'/reviews/456456/123123/m1ath10t1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129147_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030412", "code": "def count_word_frequencies(s):\n    s_dict = {}\n    for word in s.split():\n        cleaned_word = word.strip(',.!\"')\n        if cleaned_word:\n            if cleaned_word not in s_dict:\n                s_dict[cleaned_word] = 1\n            else:\n                s_dict[cleaned_word] += 1\n    return s_dict\n", "entry_point": "count_word_frequencies", "input": "'yyvve'", "output": "{'yyvve': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_106650_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030413", "code": "def v3(major: str, feature: str, ml_type: str = None, scala_version: str = \"2.12\") -> str:\n    if ml_type and ml_type.lower() not in [\"cpu\", \"gpu\"]:\n        raise ValueError('\"ml_type\" can only be \"cpu\" or \"gpu\"!')\n    version_string = f\"{major}.{feature}.x\" if not ml_type else f\"{major}.{feature}-{ml_type}-ml-scala{scala_version}\"\n    return version_string\n", "entry_point": "v3", "input": "'4', '2', 'gpu'", "output": "'4.2-gpu-ml-scala2.12'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_32273_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030414", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5189", "output": "{1, 5189}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5188", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030415", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3898", "output": "{1, 3898, 2, 1949}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3897", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030416", "code": "def total_bags_required(rules, bag_color):\n    total_bags = 1  # Account for the current bag itself\n    contained_bags = rules.get(bag_color, [])\n    for contained_bag_color, quantity in contained_bags:\n        total_bags += quantity * total_bags_required(rules, contained_bag_color)\n    return total_bags\n", "entry_point": "total_bags_required", "input": "{}, 'red'", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145955_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030417", "code": "def calculate_scrabble_score(word):\n    letter_values = {\n        'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,\n        'D': 2, 'G': 2,\n        'B': 3, 'C': 3, 'M': 3, 'P': 3,\n        'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,\n        'K': 5,\n        'J': 8, 'X': 8,\n        'Q': 10, 'Z': 10\n    }\n    total_score = 0\n    for letter in word:\n        total_score += letter_values[letter]\n    return total_score\n", "entry_point": "calculate_scrabble_score", "input": "'QQ'", "output": "20", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_59136_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030418", "code": "from typing import List\ndef calculate_sum_and_max_odd(numbers: List[int]) -> int:\n    even_sum = 0\n    max_odd = float('-inf')\n    for num in numbers:\n        if num % 2 == 0:\n            even_sum += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return even_sum * max_odd\n", "entry_point": "calculate_sum_and_max_odd", "input": "[2, 4, 3]", "output": "18", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_2830_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030419", "code": "def calculate_padding(original_height, original_width):\n    ph = ((original_height - 1) // 32 + 1) * 32\n    pw = ((original_width - 1) // 32 + 1) * 32\n    top = ph - original_height\n    right = pw - original_width\n    bottom = 0\n    left = 0\n    return (top, right, bottom, left)\n", "entry_point": "calculate_padding", "input": "10, 10", "output": "(22, 22, 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133154_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030420", "code": "def first_ten_digits_of_sum(numbers):\n    number_list = numbers.split()\n    def sum_of_list(number_list):\n        sum_of_list = 0\n        for element in number_list:\n            sum_of_list += int(element)\n        return sum_of_list\n    def first_ten_digits_of_number(number):\n        string = str(number)\n        return int(string[:10])\n    sum_of_list_result = sum_of_list(number_list)\n    first_ten_digits = first_ten_digits_of_number(sum_of_list_result)\n    return first_ten_digits\n", "entry_point": "first_ten_digits_of_sum", "input": "'1000 1600 2000 56'", "output": "4656", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81397_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030421", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7217", "output": "{1, 7, 1031, 7217}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7216", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030422", "code": "def filter_urls_with_prefix(urls, prefix):\n    filtered_urls = [url for url in urls if url.lower().startswith(prefix.lower())]\n    return filtered_urls\n", "entry_point": "filter_urls_with_prefix", "input": "[], 'http://'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66639_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030423", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "611", "output": "{1, 611, 13, 47}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt610", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030424", "code": "# Step 1: Define the expected plaintext value\nexpected_plaintext = \"Hello, World!\"\n# Step 2: Implement a function to decrypt the message using the specified cipher\ndef decrypt_message(cipher, encrypted_message):\n    # Simulate decryption using the specified cipher\n    decrypted_message = f\"Decrypted: {encrypted_message}\"  # Placeholder decryption logic\n    return decrypted_message\n", "entry_point": "decrypt_message", "input": "'dummy_cipher', 'Encsssage'", "output": "'Decrypted: Encsssage'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_65674_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030425", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "657", "output": "{1, 3, 9, 73, 657, 219}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt656", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030426", "code": "from typing import List, Dict\ndef find_authors(messages: List[Dict[str, str]], keyword: str) -> List[str]:\n    authors_set = set()\n    for message in messages:\n        if keyword in message['content']:\n            authors_set.add(message['author'])\n    return list(authors_set)\n", "entry_point": "find_authors", "input": "[], 'test'", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107322_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030427", "code": "from typing import List\ndef calculate_sum_max_odd(input_list: List[int]) -> int:\n    sum_even = 0\n    max_odd = float('-inf')\n    for num in input_list:\n        if num % 2 == 0:\n            sum_even += num\n        elif num % 2 != 0 and num > max_odd:\n            max_odd = num\n    return sum_even * max_odd if sum_even > 0 else 0\n", "entry_point": "calculate_sum_max_odd", "input": "[2, 8, 9]", "output": "90", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134591_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030428", "code": "def hash(data):\n    eax = 0\n    edi = 0\n    for i in data:\n        edi = 0xffffffff & (eax << 7)\n        eax = 0xffffffff & (edi - eax)\n        eax = eax + (0xff & i)\n    edi = 0xffffffff & (eax << 7)\n    eax = 0xffffffff & (edi - eax)\n    return eax\n", "entry_point": "hash", "input": "[]", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_126875_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030429", "code": "def find_unique_elements(input_list):\n    element_count = {}\n    for num in input_list:\n        element_count[num] = element_count.get(num, 0) + 1\n    unique_elements = [key for key, value in element_count.items() if value == 1]\n    return [num for num in input_list if num in unique_elements]\n", "entry_point": "find_unique_elements", "input": "[-2, 1, 1]", "output": "[-2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_123469_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030430", "code": "def _add_encrypted_char(string, step, language):\n    eng_alphabet = [chr(i) for i in range(97, 123)] + [chr(i) for i in range(65, 91)]\n    rus_alphabet = [chr(i) for i in range(1072, 1104)] + [chr(i) for i in range(1040, 1072)]\n    alphabets = {'en': eng_alphabet, 'rus': rus_alphabet}\n    alphabet = alphabets.get(language)\n    alphabet_len = len(alphabet)\n    encoded_str = \"\"\n    for char in string:\n        if char.isupper():\n            required_index = (alphabet.index(char.lower()) + step) % (alphabet_len // 2) + (alphabet_len // 2)\n            encoded_str += alphabet[required_index].upper()\n        elif char.islower():\n            required_index = (alphabet.index(char) + step) % (alphabet_len // 2)\n            encoded_str += alphabet[required_index]\n        else:\n            encoded_str += char  # Keep non-alphabetic characters unchanged\n    return encoded_str\n", "entry_point": "_add_encrypted_char", "input": "'Hello, World!', 3, 'en'", "output": "'Khoor, Zruog!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_99899_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030431", "code": "def arabic_to_roman(num):\n    if not 0 < num < 4000:\n        raise ValueError(\"Input number must be between 1 and 3999\")\n    roman_numerals = {\n        1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',\n        100: 'C', 90: 'XC', 50: 'L', 40: 'XL',\n        10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I'\n    }\n    roman_numeral = ''\n    for value, numeral in roman_numerals.items():\n        while num >= value:\n            roman_numeral += numeral\n            num -= value\n    return roman_numeral\n", "entry_point": "arabic_to_roman", "input": "5", "output": "'V'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_4095_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030432", "code": "def construct_mapping(Gvs, f):\n    Hvs = []  # Placeholder for vertices or nodes of graph H\n    gf = {}\n    for v in range(len(f)):\n        fv = f[v]\n        if fv >= 0:\n            gf[Gvs[v]] = Hvs[fv] if Hvs else None\n        else:\n            gf[Gvs[v]] = None\n    return gf\n", "entry_point": "construct_mapping", "input": "[1, 2, 3], [-1, -1, -1]", "output": "{1: None, 2: None, 3: None}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_98043_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030433", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'toist'", "output": "'toist'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030434", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "794", "output": "{1, 794, 2, 397}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt793", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030435", "code": "def transform_and_sort(nums):\n    # Filter out negative integers, square positive integers, and store in a new list\n    squared_positives = [num**2 for num in nums if num > 0]\n    # Sort the squared positive integers in descending order\n    squared_positives.sort(reverse=True)\n    return squared_positives\n", "entry_point": "transform_and_sort", "input": "[7, 2, 1, 1, -3, 0]", "output": "[49, 4, 1, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31736_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030436", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7792", "output": "{1, 2, 4, 487, 8, 974, 7792, 16, 3896, 1948}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7791", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030437", "code": "def remove_duplicates(input_list):\n    unique_elements = []\n    seen = set()\n    for num in input_list:\n        if num not in seen:\n            seen.add(num)\n            unique_elements.append(num)\n    return unique_elements\n", "entry_point": "remove_duplicates", "input": "[3, 5, 5, 8, 2, 2]", "output": "[3, 5, 8, 2]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_100727_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030438", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1781", "output": "{1, 13, 137, 1781}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1780", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030439", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6568", "output": "{1, 2, 4, 6568, 8, 1642, 3284, 821}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6567", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030440", "code": "def process_description(short_desc, long_desc):\n    words = long_desc.split()\n    python_count = sum(1 for word in words if \"Python\" in word.lower())\n    return short_desc, python_count\n", "entry_point": "process_description", "input": "'wrfillei', ''", "output": "('wrfillei', 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_129487_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030441", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5839", "output": "{1, 5839}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5838", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030442", "code": "def quick_sort(arr):\n    if len(arr) <= 1:\n        return arr\n    else:\n        pivot = arr[0]\n        less_than_pivot = [x for x in arr[1:] if x <= pivot]\n        greater_than_pivot = [x for x in arr[1:] if x > pivot]\n        return quick_sort(less_than_pivot) + [pivot] + quick_sort(greater_than_pivot)\n", "entry_point": "quick_sort", "input": "[7]", "output": "[7]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_102544_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030443", "code": "def get_corresponding_irreps(irreps_in1, irreps_in2, irreps_out=None):\n    irreps_in1 = [irrep for irrep in irreps_in1]\n    irreps_in2 = [irrep for irrep in irreps_in2]\n    if irreps_out is not None:\n        irreps_out = [irrep for irrep in irreps_out]\n    num_irreps = min(len(irreps_in1), len(irreps_in2))\n    if irreps_out is not None:\n        corresponding_irreps = [(irreps_in1[i], irreps_in2[i]) for i in range(num_irreps) if irreps_in1[i] in irreps_out or irreps_in2[i] in irreps_out]\n    else:\n        corresponding_irreps = [(irreps_in1[i], irreps_in2[i]) for i in range(num_irreps)]\n    return corresponding_irreps\n", "entry_point": "get_corresponding_irreps", "input": "[2, 3, 4], [6, 7, 8], [2, 3, 6, 7]", "output": "[(2, 6), (3, 7)]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43029_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030444", "code": "def extract_unique_types(elements):\n    unique_types = set()  # Initialize an empty set to store unique types\n    for element in elements:\n        element_type = element.get(\"type\")  # Extract the type of the element\n        if isinstance(element_type, list):  # Check if the type is a list\n            unique_types.update(element_type)  # Add all types in the list to the set\n        else:\n            unique_types.add(element_type)  # Add the type to the set if not a list\n    return unique_types\n", "entry_point": "extract_unique_types", "input": "[{'type': None}, {'type': 'DD'}]", "output": "{None, 'DD'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29492_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030445", "code": "def extract_app_config_class(default_config):\n    # Split the input string using dot as the separator\n    config_parts = default_config.split('.')\n    # Return the last element of the list\n    return config_parts[-1]\n", "entry_point": "extract_app_config_class", "input": "'module.submodule.wwathBCCConfigaaig'", "output": "'wwathBCCConfigaaig'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78766_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030446", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "317", "output": "{1, 317}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt316", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030447", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4579", "output": "{19, 1, 4579, 241}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4578", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030448", "code": "import re\ndef extract_version(input_string):\n    pattern = r'__version__ = \"([^\"]+)\"'\n    match = re.search(pattern, input_string)\n    if match:\n        return match.group(1)\n    else:\n        return \"Version number not found\"\n", "entry_point": "extract_version", "input": "'__version__ = \"2.7.1\"'", "output": "'2.7.1'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_101396_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030449", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "85", "output": "{1, 5, 85, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt84", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030450", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1565", "output": "{1, 5, 1565, 313}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1564", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030451", "code": "def process_text(text):\n    single_quotes = []\n    double_quotes = []\n    modified_text = \"\"\n    single_quote_count = 0\n    double_quote_count = 0\n    in_quote = False\n    current_quote = \"\"\n    for char in text:\n        if char == \"'\":\n            single_quote_count += 1\n            if in_quote:\n                in_quote = False\n                single_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        elif char == '\"':\n            double_quote_count += 1\n            if in_quote:\n                in_quote = False\n                double_quotes.append(current_quote)\n                current_quote = \"\"\n            else:\n                in_quote = True\n        if in_quote:\n            current_quote += char\n        else:\n            modified_text += char.replace(\"'\", '\"')\n    return modified_text, single_quotes, double_quotes, single_quote_count, double_quote_count\n", "entry_point": "process_text", "input": "''", "output": "('', [], [], 0, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148503_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030452", "code": "def feature_extraction(input_data):\n    total_sum = 0\n    for num in input_data:\n        processed_num = ((num * 2) - 1) ** 2\n        total_sum += processed_num\n    return total_sum\n", "entry_point": "feature_extraction", "input": "[4.5, 4.5, 4.5, 4.5]", "output": "256.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_41584_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030453", "code": "def calculate_total_card_value(card_entries, start_year, end_year):\n    total_value = 0\n    for card in card_entries:\n        if start_year <= card['year'] <= end_year:\n            total_value += card['value']\n    return total_value\n", "entry_point": "calculate_total_card_value", "input": "[], 2000, 2020", "output": "0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38327_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030454", "code": "def parse_inventory_data(data: str) -> dict:\n    inventory_dict = {}\n    pairs = data.split(',')\n    for pair in pairs:\n        try:\n            key, value = pair.split(':')\n            key = key.strip()\n            value = value.strip()\n            if value.lower() == 'true':\n                value = True\n            elif value.lower() == 'false':\n                value = False\n            elif value.isdigit():\n                value = int(value)\n            inventory_dict[key] = value\n        except (ValueError, AttributeError):\n            # Handle parsing errors by skipping the current pair\n            pass\n    return inventory_dict\n", "entry_point": "parse_inventory_data", "input": "'city: New'", "output": "{'city': 'New'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_83492_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030455", "code": "def sum_of_factorial_digits(num):\n    fact_total = 1\n    while num != 1:\n        fact_total *= num\n        num -= 1\n    fact_total_str = str(fact_total)\n    sum_total = sum(int(digit) for digit in fact_total_str)\n    return sum_total\n", "entry_point": "sum_of_factorial_digits", "input": "14", "output": "45", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_145190_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030456", "code": "def calculate_cumulative_sum(input_list):\n    cumulative_sum = 0\n    cumulative_sums = []\n    for num in input_list:\n        cumulative_sum += num\n        cumulative_sums.append(cumulative_sum)\n    return cumulative_sums\n", "entry_point": "calculate_cumulative_sum", "input": "[1, 4, 6, 5, 1, 3, 3, 1, 5]", "output": "[1, 5, 11, 16, 17, 20, 23, 24, 29]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_6612_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030457", "code": "from collections.abc import Iterable\ndef flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, Iterable) and not isinstance(item, str):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten_list", "input": "[[2], [3, 3], [4]]", "output": "[2, 3, 3, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64555_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030458", "code": "def count_names(input_str):\n    name_counts = {}\n    names = input_str.split(',')\n    for name in names:\n        name = name.strip().lower()\n        name_counts[name] = name_counts.get(name, 0) + 1\n    return name_counts\n", "entry_point": "count_names", "input": "',,mrymarkry'", "output": "{'': 2, 'mrymarkry': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64824_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030459", "code": "def normalize_path(file_path: str) -> str:\n    # Replace backslashes with forward slashes\n    file_path = file_path.replace(\"\\\\\", \"/\")\n    # Split the path into components\n    components = file_path.split(\"/\")\n    normalized_path = []\n    for component in components:\n        if component == \"..\":\n            if normalized_path:\n                normalized_path.pop()\n        elif component and component != \".\":\n            normalized_path.append(component)\n    return \"/\".join(normalized_path)\n", "entry_point": "normalize_path", "input": "'u/path/../path/os'", "output": "'u/path/os'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_36800_ipt12", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030460", "code": "def relay_game(players):\n    num_relays = 4\n    current_relay = 0\n    active_player = 0\n    while current_relay < num_relays:\n        current_relay += 1\n        active_player = (active_player + 1) % len(players)\n    return players[active_player]\n", "entry_point": "relay_game", "input": "['ABboblice', 'Player2', 'Player3', 'Player4']", "output": "'ABboblice'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_11380_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030461", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1975", "output": "{1, 5, 395, 79, 1975, 25}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1974", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030462", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "5723", "output": "{1, 5723, 59, 97}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt5722", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030463", "code": "def top_three_scores(scores):\n    sorted_scores = sorted(scores, reverse=True)\n    return sorted_scores[:3]\n", "entry_point": "top_three_scores", "input": "[89, 89, 76, 70]", "output": "[89, 89, 76]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45517_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030464", "code": "def process_queue(tasks, n):\n    time_taken = 0\n    while tasks:\n        processing = tasks[:n]\n        max_time = max(processing)\n        time_taken += max_time\n        tasks = tasks[n:]\n    return time_taken\n", "entry_point": "process_queue", "input": "[4], 1", "output": "4", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31967_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030465", "code": "def custom_sum_double(a, b):\n    if a == b:\n        return (a + b) * 2\n    else:\n        return a + b\n", "entry_point": "custom_sum_double", "input": "-10, 4", "output": "-6", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148127_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030466", "code": "def convert_string_format(input_string):\n    if not input_string:\n        return \"\"\n    has_lower = any(char.islower() for char in input_string)\n    has_upper = any(char.isupper() for char in input_string)\n    if has_lower and not has_upper:\n        return input_string.upper()\n    elif has_upper and not has_lower:\n        return input_string.lower()\n    else:\n        return ''.join(char.lower() if char.isupper() else char.upper() for char in input_string)\n", "entry_point": "convert_string_format", "input": "'WORLD'", "output": "'world'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_31894_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030467", "code": "def odd_even_bubble_sort(arr):\n    n = len(arr)\n    sorted = False\n    while not sorted:\n        sorted = True\n        for i in range(0, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n        for i in range(1, n-1, 2):\n            if arr[i] > arr[i+1]:\n                arr[i], arr[i+1] = arr[i+1], arr[i]\n                sorted = False\n    return arr\n", "entry_point": "odd_even_bubble_sort", "input": "[10, 5, 2, 1, 1]", "output": "[1, 1, 2, 5, 10]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_38447_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030468", "code": "def find_smallest_divisible_number(digit1: int, digit2: int, k: int) -> int:\n    MAX_NUM_OF_DIGITS = 10\n    INT_MAX = 2**31-1\n    if digit1 < digit2:\n        digit1, digit2 = digit2, digit1\n    total = 2\n    for l in range(1, MAX_NUM_OF_DIGITS+1):\n        for mask in range(total):\n            curr, bit = 0, total>>1\n            while bit:\n                curr = curr*10 + (digit1 if mask&bit else digit2)\n                bit >>= 1\n            if k < curr <= INT_MAX and curr % k == 0:\n                return curr\n        total <<= 1\n    return -1\n", "entry_point": "find_smallest_divisible_number", "input": "8, 8, 8", "output": "88", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7656_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030469", "code": "def delete_non_ascii(s: str) -> str:\n    result = ''\n    for char in s:\n        if ord(char) <= 127:\n            result += char\n    return result\n", "entry_point": "delete_non_ascii", "input": "'WdWd!!'", "output": "'WdWd!!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_54037_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030470", "code": "def parse_log_message(log_message):\n    parts = log_message.split(',')\n    extracted_values = {}\n    for part in parts:\n        key, value = part.split(':')\n        key = key.strip().replace(' ', '_')\n        value = value.strip()\n        if key in ['local_rank', 'n_gpu']:\n            extracted_values[key] = int(value)\n        elif key in ['distributed_training', 'fp16']:\n            extracted_values[key] = value.lower() == 'true'\n        else:\n            extracted_values[key] = value\n    return extracted_values\n", "entry_point": "parse_log_message", "input": "'device: GPU, memory_usage: 8GB'", "output": "{'device': 'GPU', 'memory_usage': '8GB'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_10266_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030471", "code": "def getPosition(board, num):\n    n = len(board)\n    x = n - 1 - (num - 1) // n\n    y = (num - 1) % n\n    if x % 2 == 1:\n        y = n - 1 - y\n    return x, y\n", "entry_point": "getPosition", "input": "[[0] * 3 for _ in range(3)], 5", "output": "(1, 1)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_29326_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030472", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2441", "output": "{1, 2441}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2440", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030473", "code": "def product_exclude_zeros(nums):\n    product = 1\n    has_non_zero = False\n    for num in nums:\n        if num != 0:\n            product *= num\n            has_non_zero = True\n    return product if has_non_zero else 0\n", "entry_point": "product_exclude_zeros", "input": "[-5, -6, 8, 10, -2]", "output": "-4800", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_118135_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030474", "code": "def manage_geodatabases(operations):\n    existing_geodatabases = set()\n    for operation in operations:\n        if operation.startswith(\"CreateFileGDB\"):\n            geodatabase_name = operation.split(\" \")[1]\n            existing_geodatabases.add(geodatabase_name)\n        elif operation.startswith(\"DeleteGDB\"):\n            geodatabase_name = operation.split(\" \")[1]\n            if geodatabase_name in existing_geodatabases:\n                existing_geodatabases.remove(geodatabase_name)\n    return list(existing_geodatabases)\n", "entry_point": "manage_geodatabases", "input": "['CreateFileGDB MyGDB', 'DeleteGDB MyGDB']", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138948_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030475", "code": "from typing import Dict, List\ndef topological_sort(graph: Dict[int, List[int]]) -> List[int]:\n    visited = set()\n    post_order = []\n    def dfs(node):\n        visited.add(node)\n        for neighbor in graph.get(node, []):\n            if neighbor not in visited:\n                dfs(neighbor)\n        post_order.append(node)\n    for node in graph.keys():\n        if node not in visited:\n            dfs(node)\n    return post_order[::-1]\n", "entry_point": "topological_sort", "input": "{1: [5], 4: [1], 6: []}", "output": "[6, 4, 1, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_78090_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030476", "code": "def custom_activation(x):\n    return x**2 + 2*x + 1\n", "entry_point": "custom_activation", "input": "5", "output": "36", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_125356_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030477", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[2, 3, -7, 2, 2, 2, 2]", "output": "[4, 9, 343, 4, 4, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030478", "code": "def zero_pad(num: int, num_digits: int) -> str:\n    num_str = str(num)\n    num_zeros = max(0, num_digits - len(num_str))\n    padded_num = f\"{num_str:0>{num_digits}}\"\n    return padded_num\n", "entry_point": "zero_pad", "input": "120, 3", "output": "'120'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_33097_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030479", "code": "import re\ndef sentim_preprocess(input_data):\n    text = input_data.get(\"text\", \"\")\n    # Convert text to lowercase\n    text = text.lower()\n    # Remove special characters and punctuation marks\n    text = re.sub(r'[^a-zA-Z0-9\\s]', '', text)\n    # Tokenize the text into words\n    words = text.split()\n    return words\n", "entry_point": "sentim_preprocess", "input": "{'text': ''}", "output": "[]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25581_ipt2", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030480", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "683", "output": "{1, 683}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt682", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030481", "code": "def parse_input(input_str):\n    data_dict = {}\n    pairs = input_str.split()\n    for pair in pairs:\n        key, value = pair.split('=')\n        if key in data_dict:\n            if isinstance(data_dict[key], list):\n                data_dict[key].append(value)\n            else:\n                data_dict[key] = [data_dict[key], value]\n        else:\n            data_dict[key] = value\n    return data_dict\n", "entry_point": "parse_input", "input": "'name=Alice'", "output": "{'name': 'Alice'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_141150_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030482", "code": "def convert_numbers(data):\n    converters = {\n        \"Number1\": lambda x: float(x.replace(\",\", \".\")),\n        \"Number2\": lambda x: float(x.replace(\",\", \".\")),\n        \"Number3\": lambda x: float(x.replace(\",\", \".\")),\n    }\n    converted_data = []\n    for row in data:\n        converted_row = {}\n        for key, value in row.items():\n            if key in converters:\n                try:\n                    converted_row[key] = converters[key](value)\n                except ValueError:\n                    converted_row[key] = value\n            else:\n                converted_row[key] = value\n        converted_data.append(converted_row)\n    return converted_data\n", "entry_point": "convert_numbers", "input": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "output": "[{}, {}, {}, {}, {}, {}, {}, {}, {}]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71966_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030483", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "373", "output": "{1, 373}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt372", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030484", "code": "def reverse_int(num):\n    if num == 0:\n        return 0\n    sign = -1 if num < 0 else 1\n    num_str = str(abs(num))\n    reversed_num_str = num_str[::-1]\n    reversed_num = int(reversed_num_str) * sign\n    return reversed_num\n", "entry_point": "reverse_int", "input": "-9", "output": "-9", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_58794_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030485", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "6674", "output": "{1, 2, 71, 3337, 142, 47, 6674, 94}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt6673", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030486", "code": "def calculate_average(scores):\n    if len(scores) < 3:\n        return 0\n    sorted_scores = sorted(scores)\n    trimmed_scores = sorted_scores[1:-1]\n    total = sum(trimmed_scores)\n    average = total / len(trimmed_scores)\n    return average\n", "entry_point": "calculate_average", "input": "[60, 69.5, 80]", "output": "69.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_50380_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030487", "code": "def contain(value, limit):\n    if value < 0:\n        return value + limit\n    elif value >= limit:\n        return value - limit\n    else:\n        return value\n", "entry_point": "contain", "input": "1, 2", "output": "1", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_18505_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030488", "code": "def markdown_to_html(markdown_text):\n    lines = markdown_text.split('\\n')\n    html_lines = []\n    in_list = False\n    for line in lines:\n        line = line.strip()\n        if line.startswith('* '):\n            if not in_list:\n                html_lines.append('<ul>')\n                in_list = True\n            html_lines.append(f'<li>{line[2:]}</li>')\n        else:\n            if in_list:\n                html_lines.append('</ul>')\n                in_list = False\n            html_lines.append(f'<p>{line}</p>')\n    if in_list:\n        html_lines.append('</ul>')\n    return '\\n'.join(html_lines)\n", "entry_point": "markdown_to_html", "input": "'pha'", "output": "'<p>pha</p>'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_116521_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030489", "code": "def add_dots(input_string: str) -> str:\n    result = []\n    for i in range(len(input_string) - 1):\n        result.append(input_string[i])\n        result.append('.')\n    result.append(input_string[-1])\n    return ''.join(result)\n", "entry_point": "add_dots", "input": "'wlo'", "output": "'w.l.o'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91534_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030490", "code": "def add_index_to_element(lst):\n    return [num + idx for idx, num in enumerate(lst)]\n", "entry_point": "add_index_to_element", "input": "[7, 1, 2, 7, 1, 1, 0, 1]", "output": "[7, 2, 4, 10, 5, 6, 6, 8]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_134187_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030491", "code": "def calculate_message_lengths(messages):\n    start_message = messages.get('start_message', [''])[0]\n    message_lengths = {lang: len(start_message) for lang in messages.get('start_message', [])[1:]}\n    return message_lengths\n", "entry_point": "calculate_message_lengths", "input": "{'start_message': ['']}", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_107613_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030492", "code": "def cumulative_sum(input_list):\n    output_list = []\n    for i in range(len(input_list)):\n        if i == 0:\n            output_list.append(input_list[i])\n        else:\n            output_list.append(input_list[i] + output_list[i - 1])\n    return output_list\n", "entry_point": "cumulative_sum", "input": "[2, 3, 4, 3, 3, 3]", "output": "[2, 5, 9, 12, 15, 18]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_60832_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030493", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4802", "output": "{2401, 1, 4802, 2, 98, 7, 686, 14, 49, 343}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4801", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030494", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1819", "output": "{107, 1, 1819, 17}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1818", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030495", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9489", "output": "{1, 3163, 3, 9489}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9488", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030496", "code": "def reconstruct_string(freq_list):\n    char_freq = {}\n    # Create a dictionary mapping characters to their frequencies\n    for i, freq in enumerate(freq_list):\n        char_freq[chr(i)] = freq\n    # Sort the characters by their ASCII values\n    sorted_chars = sorted(char_freq.keys())\n    result = \"\"\n    # Reconstruct the string based on the frequency list\n    for char in sorted_chars:\n        result += char * char_freq[char]\n    return result\n", "entry_point": "reconstruct_string", "input": "[2, 1, 1, 1, 0, 2, 2]", "output": "'\\x00\\x00\\x01\\x02\\x03\\x05\\x05\\x06\\x06'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_49716_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030497", "code": "def modify_email(email_data):\n    # Modify the email by adding a new recipient to the \"To\" field\n    new_recipient = \"NewRecipient@example.com\"\n    email_data = email_data.replace(\"To: Recipient 1\", f\"To: Recipient 1, {new_recipient}\")\n    # Update the email subject to include \"Modified\"\n    email_data = email_data.replace(\"Subject: test mail\", \"Subject: Modified: test mail\")\n    return email_data\n", "entry_point": "modify_email", "input": "'tes'", "output": "'tes'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12643_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030498", "code": "def sol(n):\n    if n % 2 == 0:\n        return n // 2\n    else:\n        return 3 * n + 1\n", "entry_point": "sol", "input": "18466", "output": "9233", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_45522_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030499", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8255", "output": "{1, 65, 5, 13, 1651, 635, 127, 8255}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8254", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030500", "code": "def countdown_sequence(n):\n    if n <= 0:\n        return []\n    else:\n        return [n] + countdown_sequence(n - 1) + countdown_sequence(n - 2)\n", "entry_point": "countdown_sequence", "input": "2", "output": "[2, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94818_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030501", "code": "from typing import List\ndef max_product(nums: List[int]) -> int:\n    if len(nums) < 2:\n        return 0\n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    for num in nums:\n        if num > max1:\n            max2 = max1\n            max1 = num\n        elif num > max2:\n            max2 = num\n        if num < min1:\n            min2 = min1\n            min1 = num\n        elif num < min2:\n            min2 = num\n    return max(max1 * max2, min1 * min2)\n", "entry_point": "max_product", "input": "[5, 5]", "output": "25", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_91738_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030502", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2543", "output": "{1, 2543}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2542", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030503", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "'The Quick BhOverey DTg'", "output": "['The', 'Quick', 'BhOverey', 'DTg']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030504", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7131", "output": "{3, 1, 7131, 2377}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7130", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030505", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8826", "output": "{1, 2, 3, 6, 8826, 4413, 2942, 1471}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8825", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030506", "code": "def calculate_edit_distance_median(edit_distances):\n    # Filter out edit distances equal to 0\n    filtered_distances = [dist for dist in edit_distances if dist != 0]\n    # Sort the filtered list\n    sorted_distances = sorted(filtered_distances)\n    length = len(sorted_distances)\n    if length == 0:\n        return 0\n    # Calculate the median\n    if length % 2 == 1:\n        return sorted_distances[length // 2]\n    else:\n        mid = length // 2\n        return (sorted_distances[mid - 1] + sorted_distances[mid]) / 2\n", "entry_point": "calculate_edit_distance_median", "input": "[1, 2, 3]", "output": "2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8147_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030507", "code": "def sum_with_next(input_list):\n    if not input_list:\n        return []\n    result = []\n    for i in range(len(input_list) - 1):\n        result.append(input_list[i] + input_list[i + 1])\n    result.append(input_list[-1] + input_list[0])\n    return result\n", "entry_point": "sum_with_next", "input": "[2, 3, 0, 2, 0, 4, 2, 2]", "output": "[5, 3, 2, 2, 4, 6, 4, 4]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148131_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030508", "code": "def extract_uppercase_words(text):\n    words = text.split()\n    uppercase_words = [word for word in words if word and word[0].isupper()]\n    return uppercase_words\n", "entry_point": "extract_uppercase_words", "input": "'Jumpms'", "output": "['Jumpms']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_68195_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030509", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1787", "output": "{1, 1787}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1786", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030510", "code": "def get_final_schema_state(migrations):\n    schema_state = {}\n    for migration in migrations:\n        model_name, field_name, _, _ = migration\n        if model_name in schema_state:\n            schema_state[model_name].append(field_name)\n        else:\n            schema_state[model_name] = [field_name]\n    return schema_state\n", "entry_point": "get_final_schema_state", "input": "[]", "output": "{}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_66435_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030511", "code": "def process_integers(nums):\n    processed_nums = []\n    for num in nums:\n        if num > 0:\n            processed_nums.append(num ** 2)\n        elif num < 0:\n            processed_nums.append(abs(num) ** 3)\n    return processed_nums\n", "entry_point": "process_integers", "input": "[-7, 1, -8, 1, -4, -5, 1]", "output": "[343, 1, 512, 1, 64, 125, 1]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_8107_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030512", "code": "def modify_string(input_str):\n    name = \"hello\"\n    if \"__title__\" in input_str:\n        return input_str.replace(\"__title__\", name)\n    else:\n        return input_str\n", "entry_point": "modify_string", "input": "'Python is awesome'", "output": "'Python is awesome'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149877_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030513", "code": "def generate_file_paths(original_path, obj):\n    file_name, file_extension = original_path.split(\"/\")[-1].split(\".\")\n    json_ld_path = original_path\n    pretty_xml_path = original_path.replace(\".json\", \".rdf\")\n    return (json_ld_path, pretty_xml_path)\n", "entry_point": "generate_file_paths", "input": "'fils/data/data.csv', None", "output": "('fils/data/data.csv', 'fils/data/data.csv')", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_82_ipt13", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030514", "code": "def rearrange_numbers(input_list):\n    even_list = []\n    odd_list = []\n    for num in input_list:\n        if num % 2 == 0:\n            even_list.append(num)\n        else:\n            odd_list.append(num)\n    rearranged_list = even_list + odd_list\n    return rearranged_list\n", "entry_point": "rearrange_numbers", "input": "[4, 2, 6, 3, 1, 1, 5, 9, 5, 3]", "output": "[4, 2, 6, 3, 1, 1, 5, 9, 5, 3]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_135850_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030515", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8643", "output": "{1, 2881, 3, 8643, 67, 129, 201, 43}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8642", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030516", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2545", "output": "{1, 5, 2545, 509}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2544", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030517", "code": "def simulate_card_game(deck1, deck2):\n    rounds_won_player1 = 0\n    rounds_won_player2 = 0\n    for card1, card2 in zip(deck1, deck2):\n        if card1 > card2:\n            rounds_won_player1 += 1\n        elif card2 > card1:\n            rounds_won_player2 += 1\n    if rounds_won_player1 > rounds_won_player2:\n        return (\"Player 1 wins\", rounds_won_player1, rounds_won_player2)\n    elif rounds_won_player2 > rounds_won_player1:\n        return (\"Player 2 wins\", rounds_won_player1, rounds_won_player2)\n    else:\n        return (\"Tie\", rounds_won_player1, rounds_won_player2)\n", "entry_point": "simulate_card_game", "input": "[8, 7, 9, 5, 6, 0, 0], [1, 2, 3, 4, 5, 6, 7]", "output": "('Player 1 wins', 5, 2)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_146837_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030518", "code": "def custom_filter(numbers, threshold=None):\n    if threshold is None:\n        return [num for num in numbers if num % 2 == 0]\n    else:\n        return [num for num in numbers if num % 2 == 0 and num >= threshold]\n", "entry_point": "custom_filter", "input": "[10, 6, 6, 28, 28, 5, 11, 3]", "output": "[10, 6, 6, 28, 28]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_71423_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030519", "code": "def convert_to_integers(strings):\n    result = []\n    for s in strings:\n        if s.isdigit():\n            result.append(int(s))\n        elif '.' in s:\n            result.append(float(s))\n        else:\n            result.append(sum(ord(c) for c in s))\n    return result\n", "entry_point": "convert_to_integers", "input": "['123', '45.6', 'abc']", "output": "[123, 45.6, 294]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_25808_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030520", "code": "import string\ndef count_word_frequency(text):\n    # Preprocess the text: convert to lowercase and remove punctuation\n    text = text.lower()\n    text = text.translate(str.maketrans('', '', string.punctuation))\n    word_freq = {}\n    words = text.split()\n    for word in words:\n        if word in word_freq:\n            word_freq[word] += 1\n        else:\n            word_freq[word] = 1\n    return word_freq\n", "entry_point": "count_word_frequency", "input": "'alsfilmso'", "output": "{'alsfilmso': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_53646_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030521", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8667", "output": "{1, 321, 3, 963, 27, 2889, 9, 107, 81, 8667}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8666", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030522", "code": "def calculate_word_score(word):\n    letter_scores = {chr(i): i - ord('a') + 1 for i in range(ord('a'), ord('z') + 1)}\n    total_score = sum(letter_scores.get(char, 0) for char in word.lower())\n    return total_score\n", "entry_point": "calculate_word_score", "input": "'zzoa'", "output": "68", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_130161_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030523", "code": "from typing import List\nfrom datetime import datetime, timedelta\ndef generate_date_list(start_date: str, num_days: int) -> List[str]:\n    date_list = []\n    current_date = datetime.strptime(start_date, \"%Y-%m-%d\")\n    for _ in range(num_days):\n        date_list.append(current_date.strftime(\"%Y-%m-%d\"))\n        current_date += timedelta(days=1)\n    return date_list\n", "entry_point": "generate_date_list", "input": "'2022-10-01', 3", "output": "['2022-10-01', '2022-10-02', '2022-10-03']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_94343_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030524", "code": "def perform_operation(numbers, operation):\n    if operation == \"add\":\n        return [sum(numbers)] * len(numbers)\n    elif operation == \"subtract\":\n        return [numbers[0] - sum(numbers[1:])] * len(numbers)\n    elif operation == \"multiply\":\n        result = 1\n        for num in numbers:\n            result *= num\n        return [result] * len(numbers)\n    elif operation == \"divide\":\n        result = numbers[0]\n        for num in numbers[1:]:\n            if num != 0:\n                result /= num\n        return [result] * len(numbers)\n    else:\n        raise ValueError(\"Invalid operation identifier\")\n", "entry_point": "perform_operation", "input": "[108, 0, 0], 'subtract'", "output": "[108, 108, 108]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_108616_ipt15", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030525", "code": "from math import factorial\ndef calculate_S(a):\n    a_str = str(a)\n    S = 0\n    for i, digit in enumerate(a_str):\n        S += factorial(len(a_str) - i) * int(digit)\n    return S\n", "entry_point": "calculate_S", "input": "52", "output": "12", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_149081_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030526", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3435", "output": "{1, 3, 5, 229, 3435, 687, 15, 1145}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3434", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030527", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    for char in input_string:\n        char_lower = char.lower()\n        if char_lower.isalnum():\n            char_count[char_lower] = char_count.get(char_lower, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "'hh33elo'", "output": "{'h': 2, '3': 2, 'e': 1, 'l': 1, 'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_64902_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030528", "code": "import os\ndef count_python_files(directory):\n    if not os.path.exists(directory):\n        return f\"Directory '{directory}' does not exist.\"\n    total_count = 0\n    with os.scandir(directory) as entries:\n        for entry in entries:\n            if entry.is_file() and entry.name.endswith('.py'):\n                total_count += 1\n            elif entry.is_dir():\n                total_count += count_python_files(entry.path)\n    return total_count\n", "entry_point": "count_python_files", "input": "'to/patoryy'", "output": "\"Directory 'to/patoryy' does not exist.\"", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_72466_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030529", "code": "def simple_serializer(data):\n    if isinstance(data, int):\n        return {\"int\": str(data)}\n    elif isinstance(data, str):\n        return {\"str\": data}\n    elif isinstance(data, list):\n        result = {}\n        for i, item in enumerate(data):\n            result[f\"list{i}\"] = simple_serializer(item)\n        return result\n", "entry_point": "simple_serializer", "input": "0", "output": "{'int': '0'}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_845_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030530", "code": "def calculate_frequency(input_list):\n    frequency_dict = {}\n    for num in input_list:\n        if num in frequency_dict:\n            frequency_dict[num] += 1\n        else:\n            frequency_dict[num] = 1\n    return frequency_dict\n", "entry_point": "calculate_frequency", "input": "[2, 2, 2, 2, 5, 5, 1, 7]", "output": "{2: 4, 5: 2, 1: 1, 7: 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24228_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030531", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "7754", "output": "{1, 7754, 2, 3877}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt7753", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030532", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9055", "output": "{1, 1811, 5, 9055}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9054", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030533", "code": "def validate_and_normalize_email(email):\n    if not email or '@' not in email:\n        raise ValueError(\"Invalid email address\")\n    username, domain = email.split('@')\n    normalized_email = f\"{username.lower()}@{domain.lower()}\"\n    return normalized_email\n", "entry_point": "validate_and_normalize_email", "input": "'John.Doe@Example.CJJ'", "output": "'john.doe@example.cjj'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_43857_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030534", "code": "def parse_sent_msg(msg):\n    ctr, frame_time = msg.split()\n    frame_time = float(frame_time)\n    ctr = int(ctr)\n    return frame_time, ctr\n", "entry_point": "parse_sent_msg", "input": "'123 4.5145656'", "output": "(4.5145656, 123)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_12181_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030535", "code": "def _parse_version(version_str):\n    components = version_str.split('.')\n    while len(components) < 3:\n        components.append('0')  # Pad with zeros if components are missing\n    major, minor, patch = map(int, components)\n    return major, minor, patch\n", "entry_point": "_parse_version", "input": "'12.1211'", "output": "(12, 1211, 0)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67095_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030536", "code": "def calculate_sum(n):\n    x = 3\n    result = x + n\n    return result\n", "entry_point": "calculate_sum", "input": "2", "output": "5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_86035_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030537", "code": "def next_version(version: str) -> str:\n    major, minor, patch = map(int, version.split('.'))\n    patch += 1\n    if patch == 10:\n        patch = 0\n        minor += 1\n        if minor == 10:\n            minor = 0\n            major += 1\n    return f\"{major}.{minor}.{patch}\"\n", "entry_point": "next_version", "input": "'1.23.3'", "output": "'1.23.4'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81159_ipt5", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030538", "code": "import string\ndef extract_unique_words(text):\n    # Remove punctuation marks from the text\n    translator = str.maketrans('', '', string.punctuation)\n    text = text.translate(translator)\n    # Tokenize the text into words and convert to lowercase\n    words = text.lower().split()\n    # Use a set to store unique words\n    unique_words = set(words)\n    # Convert the set to a sorted list and return\n    return sorted(list(unique_words))\n", "entry_point": "extract_unique_words", "input": "'hwoworor'", "output": "['hwoworor']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_142656_ipt1", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030539", "code": "from typing import List, Optional, Tuple\ndef find_target_indices(nums: List[int], target: int) -> Optional[Tuple[int, int]]:\n    complement_dict = {}\n    for i, num in enumerate(nums):\n        complement = target - num\n        if complement in complement_dict:\n            return (complement_dict[complement], i)\n        complement_dict[num] = i\n    return None\n", "entry_point": "find_target_indices", "input": "[1, 2, 4, 0, 0, 0, 8], 12", "output": "(2, 6)", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_133300_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030540", "code": "from typing import List, Any\ndef encode_and_append(pieces: List[str], value: Any) -> int:\n    encoded_value = str(value)  # Convert the value to a string\n    pieces.append(encoded_value)  # Append the encoded value to the list\n    return len(encoded_value)  # Return the size of the encoded value\n", "entry_point": "encode_and_append", "input": "[], 'Hello World'", "output": "11", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_7925_ipt7", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030541", "code": "def sum_of_even_numbers(nums):\n    total = 0\n    for num in nums:\n        if num % 2 == 0:\n            total += num\n    return total\n", "entry_point": "sum_of_even_numbers", "input": "[-2]", "output": "-2", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_109345_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030542", "code": "def max_cycles_saved(cycles):\n    n = len(cycles)\n    dp = [0] * (n + 1)\n    for i in range(n):\n        dp[i+1] = max(dp[i] + cycles[i], dp[i])\n    return dp[n]\n", "entry_point": "max_cycles_saved", "input": "[10, 12, 11]", "output": "33", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_87854_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030543", "code": "def longest_consecutive_sequence(steps):\n    current_length = 0\n    max_length = 0\n    for step in steps:\n        if step != 0:\n            current_length += 1\n            max_length = max(max_length, current_length)\n        else:\n            current_length = 0\n    return max_length\n", "entry_point": "longest_consecutive_sequence", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 0]", "output": "8", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74155_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030544", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "8824", "output": "{1, 2, 4, 8, 1103, 8824, 4412, 2206}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt8823", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030545", "code": "def percent_str(expected, received):\n    output = int((received / expected) * 100)  # Correct calculation for percentage\n    return str(output) + \"%\"\n", "entry_point": "percent_str", "input": "100, 51", "output": "'51%'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_67883_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030546", "code": "import re\nimport html\ndef process_description(desc: str) -> str:\n    word_break = False\n    for word in re.split(r'\\s|-', desc):\n        if len(word) > 40:\n            word_break = True\n    desc = html.escape(desc)\n    if word_break:\n        desc = '<span style=\"wordBreak: break-word\">' + desc + '</span>'\n    return desc\n", "entry_point": "process_description", "input": "'supercalifragilisialidocious'", "output": "'supercalifragilisialidocious'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_74059_ipt3", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030547", "code": "from typing import Union\ndef get_major_version(version: str) -> Union[int, None]:\n    parts = version.split('.')\n    if len(parts) >= 1:\n        try:\n            major_version = int(parts[0])\n            return major_version\n        except ValueError:\n            return None\n    else:\n        return None\n", "entry_point": "get_major_version", "input": "'22235335'", "output": "22235335", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_81435_ipt11", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030548", "code": "def not_bad(s):\n    s_not = s.find('not')\n    s_bad = s.find('bad')\n    if s_not != -1 and s_bad != -1 and s_bad > s_not:\n        s = s[:s_not] + 'good' + s[s_bad+3:]\n    return s\n", "entry_point": "not_bad", "input": "'This dinner is not that bad!'", "output": "'This dinner is good!'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_148303_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030549", "code": "def validate_url(url: str) -> str:\n    if not url.startswith(\"http://\"):\n        url = \"http://\" + url\n    return url\n", "entry_point": "validate_url", "input": "'kjakakihtt2'", "output": "'http://kjakakihtt2'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_138882_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030550", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4169", "output": "{4169, 1, 11, 379}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030551", "code": "from typing import List\ndef generate_shopping_list(fridge: str, recipe: str) -> List[str]:\n    fridge_ingredients = set(fridge.split('\\n'))\n    recipe_ingredients = set(recipe.lower().split())\n    shopping_list = list(recipe_ingredients - fridge_ingredients)\n    return shopping_list\n", "entry_point": "generate_shopping_list", "input": "'', 'bbabanana'", "output": "['bbabanana']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24784_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030552", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "1705", "output": "{1, 5, 1705, 11, 341, 55, 155, 31}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt1704", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030553", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9041", "output": "{9041, 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9040", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030554", "code": "def custom_operations(nums):\n    total_sum = sum(nums)\n    if total_sum > 10:\n        return [nums[2], nums[1], nums[0]]  # Reverse the list if sum is greater than 10\n    else:\n        return [nums[1], nums[2], nums[0]]  # Rotate the list to the left if sum is less than or equal to 10\n", "entry_point": "custom_operations", "input": "[5, 6, 1]", "output": "[1, 6, 5]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_144371_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030555", "code": "def calculate_letter_frequencies(TEXT):\n    letter_frequencies = {}\n    for char in TEXT:\n        if char in letter_frequencies:\n            letter_frequencies[char] += 1\n        else:\n            letter_frequencies[char] = 1\n    return letter_frequencies\n", "entry_point": "calculate_letter_frequencies", "input": "'aabbrr'", "output": "{'a': 2, 'b': 2, 'r': 2}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_42907_ipt9", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030556", "code": "from typing import List\ndef calculate_total_cost(items: List[float], discount: int) -> float:\n    total_cost = sum(items)\n    discounted_cost = total_cost - (total_cost * (discount / 100))\n    return discounted_cost\n", "entry_point": "calculate_total_cost", "input": "[20.0, 20.0, 20.0], 20", "output": "48.0", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_128130_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030557", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "466", "output": "{1, 466, 2, 233}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt465", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030558", "code": "# Step 1: Create a dictionary to store version-checksum mappings\nversion_checksum_map = {\n    '4.4.1': 'c0033e524aa9e05ed18879641ffe6e0f',\n    '4.4.0': '8e626a1708ceff83412180d2ff2f3e57',\n    '4.3.1': '971eee85d630eb4bafcd52531c79673f',\n    '4.3.0': '5961164fe908faf798232a265ed48c73',\n    '4.2.2': '4ac8ae11f1eef4920bf4a5383e13ab50',\n    '4.2.1': 'de583ee9c84db6296269ce7de0afb63f',\n    '4.2.0': 'fc535e4e020a41cd2b55508302b155bb',\n    '4.1.1': '51376850c46fb006e1f8d1cd353507c5',\n    '4.1.0': '638a43e4f8a15872f749090c3f0827b6'\n}\n# Step 2: Implement the get_checksum function\ndef get_checksum(version: str) -> str:\n    return version_checksum_map.get(version, \"Version not found\")\n", "entry_point": "get_checksum", "input": "'4.3.1'", "output": "'971eee85d630eb4bafcd52531c79673f'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_79238_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030559", "code": "def count_file_extensions(file_paths):\n    file_extensions_count = {}\n    # Split the input string by spaces to get individual file paths\n    paths = file_paths.strip().split()\n    for path in paths:\n        # Extract the file extension by splitting at the last '.' in the path\n        extension = path.split('.')[-1].lower() if '.' in path else ''\n        # Update the count of the file extension in the dictionary\n        file_extensions_count[extension] = file_extensions_count.get(extension, 0) + 1\n    return file_extensions_count\n", "entry_point": "count_file_extensions", "input": "'file1.txt'", "output": "{'txt': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_21533_ipt8", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030560", "code": "def count_unique_characters(input_string):\n    char_count = {}\n    input_string = input_string.lower()\n    for char in input_string:\n        if char != ' ':\n            char_count[char] = char_count.get(char, 0) + 1\n    return char_count\n", "entry_point": "count_unique_characters", "input": "' o '", "output": "{'o': 1}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_139810_ipt4", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030561", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9753", "output": "{1, 3, 3251, 9753}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9752", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030562", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "9689", "output": "{1, 9689}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt9688", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030563", "code": "from typing import List\ndef custom_min(nums: List[float]) -> float:\n    if not nums:\n        raise ValueError(\"Input list cannot be empty\")\n    min_value = nums[0]  # Initialize min_value with the first element\n    for num in nums[1:]:  # Iterate from the second element\n        if num < min_value:\n            min_value = num\n    return min_value\n", "entry_point": "custom_min", "input": "[-10.5, 0.0, -5.0, 5.0, -10.0]", "output": "-10.5", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_69430_ipt0", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030564", "code": "def remove_vowels(input_string):\n    vowels = \"aeiou\"\n    result = ''.join(char for char in input_string if char not in vowels)\n    return result\n", "entry_point": "remove_vowels", "input": "'z'", "output": "'z'", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_24049_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030565", "code": "def process_list(lst, threshold):\n    processed_list = []\n    for num in lst:\n        if num >= threshold:\n            processed_list.append(num ** 2)\n        else:\n            processed_list.append(num ** 3)\n    return processed_list\n", "entry_point": "process_list", "input": "[4, 6, 7, 5, 8, 4], 5", "output": "[64, 36, 49, 25, 64, 64]", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_88444_ipt6", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030566", "code": "import math\ndef test_ldc(a, b):\n    if a == 0 and b == 0:\n        raise ValueError(\"Both numbers cannot be zero\")\n    elif a == 0 or b == 0:\n        return 0\n    else:\n        return (a * b) // math.gcd(a, b)\n", "entry_point": "test_ldc", "input": "16, 1", "output": "16", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_35003_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030567", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "3206", "output": "{1, 2, 1603, 229, 3206, 7, 458, 14}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt3205", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030568", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "2169", "output": "{1, 3, 9, 241, 723, 2169}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt2168", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030569", "code": "from time import time\ndef factors(n):\n    return set([x for i in range(1, int(n**0.5) + 1) if n % i == 0 for x in (i, n//i)])\n", "entry_point": "factors", "input": "4985", "output": "{1, 4985, 5, 997}", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "bwd_mnl_136947_ipt4984", "provenance_class": "model-generated", "licence": "mit"}
{"id": "pyx/0030570", "code": "import re\ndef extract_variables(query):\n    # Regular expression pattern to match variables in SPARQL query\n    pattern = r'\\?[\\w]+'\n    # Find all matches of variables in the query\n    variables = re.findall(pattern, query)\n    # Return a list of distinct variables\n    return list(set(variables))", "entry_point": "extract_variables", "input": "'??p'", "output": "['?p']", "source": "pyx", "source_repo": "semcoder/PyX", "source_revision": "7f328668db983ff1d52deec102f65c4ca117e094", "source_file": "pyx.jsonl", "source_id": "fwd_mnl_16424_ipt10", "provenance_class": "model-generated", "licence": "mit"}
{"id": "execution_trace/0030571", "code": "def collect(item, bucket=[]):\n    bucket.append(item)\n    return bucket\n\ndef demo():\n    first = collect(\"a\")\n    second = collect(\"b\")\n    return (first, second, first is second)", "entry_point": "demo", "input": "", "output": "(['a', 'b', 'a', 'b'], ['a', 'b', 'a', 'b'], True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200001wp2osjhk0zm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030572", "code": "records = [\n    {\"name\": \"ida\", \"dept\": \"ops\", \"years\": 4},\n    {\"name\": \"ben\", \"dept\": \"eng\", \"years\": 4},\n    {\"name\": \"cy\", \"dept\": \"eng\", \"years\": 7},\n]\n\ndef rank():\n    ordered = sorted(records, key=lambda r: (r[\"dept\"], -r[\"years\"], r[\"name\"]))\n    return [(r[\"dept\"], r[\"name\"], r[\"years\"]) for r in ordered]", "entry_point": "rank", "input": "", "output": "[('eng', 'cy', 7), ('eng', 'ben', 4), ('ops', 'ida', 4)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200011wp22kb81bve", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030573", "code": "from collections import Counter\n\ndef tally():\n    counts = Counter(\"pear fig pear plum fig date\".split())\n    return (counts.most_common(2), counts[\"kiwi\"], len(counts))", "entry_point": "tally", "input": "", "output": "([('pear', 2), ('fig', 2)], 0, 4)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200021wp23qmbd6xs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030574", "code": "def resolve(flag):\n    try:\n        if flag:\n            return \"from-try\"\n        raise ValueError(\"bad flag\")\n    except ValueError:\n        return \"from-except\"\n    finally:\n        print(\"cleanup ran\")\n\ndef demo():\n    return (resolve(True), resolve(False))", "entry_point": "demo", "input": "", "output": "('from-try', 'from-except')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200031wp2jpynnp7y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030575", "code": "import copy\n\ndef demo():\n    grid = [[0, 1], [2, 3]]\n    shallow = list(grid)\n    deep = copy.deepcopy(grid)\n    grid[0][0] = 99\n    return (shallow[0][0], deep[0][0], shallow[0] is grid[0])", "entry_point": "demo", "input": "", "output": "(99, 0, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200041wp2vszakqde", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030576", "code": "def demo():\n    loose = []\n    for factor in range(1, 4):\n        loose.append(lambda x: x * factor)\n    bound = [lambda x, factor=factor: x * factor for factor in range(1, 4)]\n    return ([f(10) for f in loose], [f(10) for f in bound])", "entry_point": "demo", "input": "", "output": "([30, 30, 30], [10, 20, 30])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200051wp25947eul8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030577", "code": "from itertools import groupby\n\ntickets = [\"ops-3\", \"eng-1\", \"ops-9\", \"eng-4\"]\n\ndef team_of(ticket):\n    return ticket.split(\"-\")[0]\n\ndef demo():\n    raw = [(team, list(g)) for team, g in groupby(tickets, key=team_of)]\n    tidy = [(team, list(g)) for team, g in groupby(sorted(tickets), key=team_of)]\n    return (raw, tidy)", "entry_point": "demo", "input": "", "output": "([('ops', ['ops-3']), ('eng', ['eng-1']), ('ops', ['ops-9']), ('eng', ['eng-4'])], [('eng', ['eng-1', 'eng-4']), ('ops', ['ops-3', 'ops-9'])])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200061wp24z0nxfpf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030578", "code": "def demo():\n    config = {\"retries\": 3}\n    kept = config.setdefault(\"retries\", 10)\n    added = config.setdefault(\"timeout\", 30)\n    return (kept, added, config.get(\"timeout\", 99), sorted(config.items()))", "entry_point": "demo", "input": "", "output": "(3, 30, 30, [('retries', 3), ('timeout', 30)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200071wp2lcgno27p", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030579", "code": "class ParseError(Exception):\n    pass\n\ndef parse_port(raw):\n    try:\n        return int(raw)\n    except ValueError:\n        raise ParseError(\"not a port: \" + raw) from None\n\ndef demo():\n    results = []\n    for raw in [\"8080\", \"https\"]:\n        try:\n            results.append(parse_port(raw))\n        except ParseError as exc:\n            results.append(type(exc).__name__ + \": \" + str(exc))\n    return results", "entry_point": "demo", "input": "", "output": "[8080, 'ParseError: not a port: https']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8200081wp28tpa14hx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030580", "code": "def demo():\n    path = \"a/b/c/d\"\n    parts = path.split(\"/\")\n    return (parts[::-1], \"/\".join(parts[1:-1]), path.partition(\"/\"), path[::2])", "entry_point": "demo", "input": "", "output": "(['d', 'c', 'b', 'a'], 'b/c', ('a', '/', 'b/c/d'), 'abcd')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskf3c8300091wp29wn8ecs7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030581", "code": "from collections import defaultdict\n\ndef index_by_initial(names):\n    buckets = defaultdict(list)\n    for name in names:\n        buckets[name[0]].append(name)\n    missing = buckets[\"z\"]\n    return (dict(buckets), missing, \"z\" in buckets)", "entry_point": "index_by_initial", "input": "['ana', 'arjun', 'bela', 'cy']", "output": "({'a': ['ana', 'arjun'], 'b': ['bela'], 'c': ['cy'], 'z': []}, [], True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd460000x6p2765o8s86", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030582", "code": "from collections import deque\n\ndef shuffle_queue():\n    q = deque([1, 2, 3, 4], maxlen=4)\n    q.rotate(1)\n    snapshot = list(q)\n    q.appendleft(99)\n    return (snapshot, list(q), q.maxlen)", "entry_point": "shuffle_queue", "input": "", "output": "([4, 1, 2, 3], [99, 4, 1, 2], 4)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470001x6p23240prqe", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030583", "code": "from collections import OrderedDict\n\ndef reorder():\n    od = OrderedDict([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\n    od.move_to_end(\"a\")\n    first = list(od.keys())\n    od.move_to_end(\"c\", last=False)\n    return (first, list(od.keys()))", "entry_point": "reorder", "input": "", "output": "(['b', 'c', 'a'], ['c', 'b', 'a'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470003x6p208eutk8e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030584", "code": "from collections import Counter\n\ndef counter_math():\n    left = Counter(a=3, b=1)\n    right = Counter(a=1, b=4)\n    return (dict(left - right), dict(left + right), dict(left & right))", "entry_point": "counter_math", "input": "", "output": "({'a': 2}, {'a': 4, 'b': 5}, {'a': 1, 'b': 1})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470004x6p2uwirhw78", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030585", "code": "from functools import lru_cache\n\ncalls = []\n\n@lru_cache(maxsize=None)\ndef slow_square(n):\n    calls.append(n)\n    return n * n\n\ndef demo_cache():\n    results = [slow_square(4), slow_square(4), slow_square(5)]\n    return (results, calls)", "entry_point": "demo_cache", "input": "", "output": "([16, 16, 25], [4, 5])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470005x6p2foxxbcs1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030586", "code": "from functools import partial\n\ndef power(base, exponent):\n    return base ** exponent\n\ndef demo_partial():\n    square = partial(power, exponent=2)\n    cube_of_two = partial(power, 2)\n    return (square(7), cube_of_two(3))", "entry_point": "demo_partial", "input": "", "output": "(49, 8)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470006x6p2krj21lmm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030587", "code": "from functools import reduce\n\ndef fold():\n    numbers = [3, 1, 4, 1, 5]\n    total = reduce(lambda a, b: a + b, numbers)\n    seeded = reduce(lambda a, b: a + b, numbers, 100)\n    largest = reduce(lambda a, b: a if a > b else b, numbers)\n    return (total, seeded, largest)", "entry_point": "fold", "input": "", "output": "(14, 114, 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470007x6p222pr0xuz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030588", "code": "from functools import wraps\n\ndef announce(fn):\n    @wraps(fn)\n    def inner(*args, **kwargs):\n        return fn(*args, **kwargs) * 2\n    return inner\n\ndef plain(fn):\n    def inner(*args, **kwargs):\n        return fn(*args, **kwargs)\n    return inner\n\n@announce\ndef base(x):\n    \"\"\"docstring here\"\"\"\n    return x + 1\n\n@plain\ndef other(x):\n    return x\n\ndef demo_wraps():\n    return (base(4), base.__name__, base.__doc__, other.__name__)", "entry_point": "demo_wraps", "input": "", "output": "(10, 'base', 'docstring here', 'inner')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470008x6p2phg7werx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030589", "code": "class Base:\n    def greet(self):\n        return \"base\"\n\nclass Left(Base):\n    def greet(self):\n        return \"left->\" + super().greet()\n\nclass Right(Base):\n    def greet(self):\n        return \"right->\" + super().greet()\n\nclass Both(Left, Right):\n    pass\n\ndef demo_mro():\n    return (Both().greet(), [c.__name__ for c in Both.__mro__])", "entry_point": "demo_mro", "input": "", "output": "('left->right->base', ['Both', 'Left', 'Right', 'Base', 'object'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd470009x6p2zmftr2s5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030590", "code": "class Temperature:\n    def __init__(self, celsius):\n        self._celsius = celsius\n\n    @property\n    def fahrenheit(self):\n        return self._celsius * 9 / 5 + 32\n\n    @fahrenheit.setter\n    def fahrenheit(self, value):\n        self._celsius = (value - 32) * 5 / 9\n\ndef demo_property():\n    t = Temperature(100)\n    before = t.fahrenheit\n    t.fahrenheit = 32\n    return (before, t._celsius)", "entry_point": "demo_property", "input": "", "output": "(212.0, 0.0)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000ax6p223kae635", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030591", "code": "class Counter:\n    total = 0\n\n    def bump(self):\n        self.total += 1\n        return self.total\n\ndef demo_shadowing():\n    a = Counter()\n    b = Counter()\n    first = a.bump()\n    second = a.bump()\n    return (first, second, b.total, Counter.total, \"total\" in a.__dict__)", "entry_point": "demo_shadowing", "input": "", "output": "(1, 2, 0, 0, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000dx6p2ggiej64m", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030592", "code": "class Resource:\n    def __init__(self, log):\n        self.log = log\n\n    def __enter__(self):\n        self.log.append(\"enter\")\n        return self\n\n    def __exit__(self, exc_type, exc, tb):\n        self.log.append(\"exit:\" + (exc_type.__name__ if exc_type else \"clean\"))\n        return True\n\ndef demo_context():\n    log = []\n    with Resource(log):\n        log.append(\"body\")\n    with Resource(log):\n        raise ValueError(\"boom\")\n    return log", "entry_point": "demo_context", "input": "", "output": "['enter', 'body', 'exit:clean', 'enter', 'exit:ValueError']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000ex6p25pphz9hy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030593", "code": "def noisy_range(n):\n    for i in range(n):\n        print(\"yielding\", i)\n        yield i\n\ndef demo_lazy():\n    gen = noisy_range(3)\n    print(\"created\")\n    first = next(gen)\n    print(\"got\", first)\n    return list(gen)", "entry_point": "demo_lazy", "input": "", "output": "[1, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000fx6p2w5qkhnld", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030594", "code": "def demo_next_default():\n    it = iter([10, 20])\n    a = next(it)\n    b = next(it)\n    c = next(it, \"empty\")\n    try:\n        next(it)\n        d = \"no error\"\n    except StopIteration:\n        d = \"StopIteration\"\n    return (a, b, c, d)", "entry_point": "demo_next_default", "input": "", "output": "(10, 20, 'empty', 'StopIteration')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000gx6p29j30ysdj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030595", "code": "def demo_generator_expr():\n    squares = (x * x for x in range(4))\n    first_pass = list(squares)\n    second_pass = list(squares)\n    return (first_pass, second_pass)", "entry_point": "demo_generator_expr", "input": "", "output": "([0, 1, 4, 9], [])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000hx6p2cnnrr8b4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030596", "code": "from itertools import accumulate, chain, islice\n\ndef demo_itertools():\n    running = list(accumulate([1, 2, 3, 4]))\n    joined = list(chain([1, 2], \"ab\"))\n    window = list(islice(range(10), 2, 7, 2))\n    return (running, joined, window)", "entry_point": "demo_itertools", "input": "", "output": "([1, 3, 6, 10], [1, 2, 'a', 'b'], [2, 4, 6])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000ix6p20pacmnuw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030597", "code": "def demo_zip_truncate():\n    names = [\"a\", \"b\", \"c\"]\n    scores = [1, 2]\n    paired = list(zip(names, scores))\n    unzipped = list(zip(*paired))\n    return (paired, unzipped)", "entry_point": "demo_zip_truncate", "input": "", "output": "([('a', 1), ('b', 2)], [('a', 'b'), (1, 2)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000jx6p2kajq3aon", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030598", "code": "def truthy(value):\n    print(\"checking\", value)\n    return value > 2\n\ndef demo_short_circuit():\n    any_result = any(truthy(v) for v in [1, 3, 5])\n    print(\"---\")\n    all_result = all(truthy(v) for v in [3, 1, 5])\n    return (any_result, all_result)", "entry_point": "demo_short_circuit", "input": "", "output": "(True, False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000kx6p2it2r85a5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030599", "code": "def demo_sort_stability():\n    rows = [(\"b\", 2), (\"a\", 2), (\"c\", 1)]\n    by_number = sorted(rows, key=lambda r: r[1])\n    in_place = list(rows)\n    returned = in_place.sort()\n    return (by_number, returned, in_place)", "entry_point": "demo_sort_stability", "input": "", "output": "([('c', 1), ('b', 2), ('a', 2)], None, [('a', 2), ('b', 2), ('c', 1)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000lx6p2pn9rllgy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030600", "code": "def demo_dict_comprehension():\n    pairs = [(\"a\", 1), (\"b\", 2), (\"a\", 3)]\n    collapsed = {k: v for k, v in pairs}\n    merged = {**{\"a\": 0, \"z\": 9}, **collapsed}\n    return (collapsed, merged, len(pairs))", "entry_point": "demo_dict_comprehension", "input": "", "output": "({'a': 3, 'b': 2}, {'a': 3, 'z': 9, 'b': 2}, 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000mx6p2eh1owurq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030601", "code": "def demo_dict_removal():\n    data = {\"a\": 1, \"b\": 2, \"c\": 3}\n    popped = data.pop(\"b\")\n    missing = data.pop(\"zz\", \"default\")\n    last = data.popitem()\n    return (popped, missing, last, data)", "entry_point": "demo_dict_removal", "input": "", "output": "(2, 'default', ('c', 3), {'a': 1})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000nx6p27w17ork7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030602", "code": "def demo_slice_assign():\n    nums = [0, 1, 2, 3, 4, 5]\n    nums[1:3] = [\"a\", \"b\", \"c\"]\n    copy = nums[:]\n    nums[::2] = [None] * len(nums[::2])\n    return (copy, nums)", "entry_point": "demo_slice_assign", "input": "", "output": "([0, 'a', 'b', 'c', 3, 4, 5], [None, 'a', None, 'c', None, 4, None])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd47000ox6p2dkksi4nv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030603", "code": "def demo_repeated_refs():\n    shared = [[]] * 3\n    shared[0].append(\"x\")\n    independent = [[] for _ in range(3)]\n    independent[0].append(\"y\")\n    return (shared, independent, shared[1] is shared[2])", "entry_point": "demo_repeated_refs", "input": "", "output": "([['x'], ['x'], ['x']], [['y'], [], []], True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000px6p2v14vqo4a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030604", "code": "def demo_tuple_mutation():\n    holder = ([1], \"fixed\")\n    try:\n        holder[0] += [2]\n        outcome = \"no error\"\n    except TypeError as exc:\n        outcome = type(exc).__name__\n    return (outcome, holder)", "entry_point": "demo_tuple_mutation", "input": "", "output": "('TypeError', ([1, 2], 'fixed'))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000qx6p2n2wi82p4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030605", "code": "def demo_unpacking():\n    first, *middle, last = [1, 2, 3, 4, 5]\n    (a, b), c = (1, 2), 3\n    return (first, middle, last, a, b, c)", "entry_point": "demo_unpacking", "input": "", "output": "(1, [2, 3, 4], 5, 1, 2, 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000rx6p2ub50qz4y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030606", "code": "def demo_floor_division():\n    return (\n        7 // 2, -7 // 2,\n        7 % 3, -7 % 3,\n        divmod(-7, 2),\n    )", "entry_point": "demo_floor_division", "input": "", "output": "(3, -4, 1, 2, (-4, 1))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000sx6p2gt75dfwh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030607", "code": "def demo_rounding():\n    return (round(0.5), round(1.5), round(2.5), round(2.675, 2), round(-1.5))", "entry_point": "demo_rounding", "input": "", "output": "(0, 2, 2, 2.67, -2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000tx6p25c19vws9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030608", "code": "def demo_float_precision():\n    total = 0.1 + 0.2\n    return (total, total == 0.3, abs(total - 0.3) < 1e-9, 1 / 3)", "entry_point": "demo_float_precision", "input": "", "output": "(0.30000000000000004, False, True, 0.3333333333333333)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000ux6p22d5tlcj7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030609", "code": "def demo_string_methods():\n    raw = \"  Report-2024-final.txt  \"\n    trimmed = raw.strip()\n    return (\n        trimmed.split(\"-\"),\n        trimmed.rsplit(\"-\", 1),\n        trimmed.replace(\"-\", \"_\", 1),\n        trimmed.endswith(\".txt\"),\n    )", "entry_point": "demo_string_methods", "input": "", "output": "(['Report', '2024', 'final.txt'], ['Report-2024', 'final.txt'], 'Report_2024-final.txt', True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000vx6p2qp65b639", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030610", "code": "def demo_formatting():\n    value = 3.14159\n    name = \"pi\"\n    return (\n        \"{:.2f}\".format(value),\n        \"{:>8}\".format(name),\n        \"{:08.3f}\".format(value),\n        f\"{name:*^9}\",\n    )", "entry_point": "demo_formatting", "input": "", "output": "('3.14', '      pi', '0003.142', '***pi****')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000wx6p29wilm6gc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030611", "code": "import re\n\ndef demo_regex():\n    text = \"id=12, id=345, name=ada\"\n    numbers = re.findall(r\"id=(\\d+)\", text)\n    masked = re.sub(r\"\\d+\", \"#\", text)\n    match = re.search(r\"name=(\\w+)\", text)\n    return (numbers, masked, match.group(1), match.span())", "entry_point": "demo_regex", "input": "", "output": "(['12', '345'], 'id=#, id=#, name=ada', 'ada', (15, 23))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000xx6p26i7nnib7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030612", "code": "import json\n\ndef demo_json():\n    payload = {\"b\": 2, \"a\": [1, {\"c\": None}], \"flag\": True}\n    text = json.dumps(payload, sort_keys=True)\n    restored = json.loads(text)\n    return (text, restored[\"a\"][1][\"c\"], restored == payload)", "entry_point": "demo_json", "input": "", "output": "('{\"a\": [1, {\"c\": null}], \"b\": 2, \"flag\": true}', None, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000yx6p27d6tmmfu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030613", "code": "def make_counter():\n    count = 0\n\n    def bump():\n        nonlocal count\n        count += 1\n        return count\n\n    return bump\n\ndef demo_nonlocal():\n    first = make_counter()\n    second = make_counter()\n    return (first(), first(), second())", "entry_point": "demo_nonlocal", "input": "", "output": "(1, 2, 1)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd48000zx6p2kejqm7xx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030614", "code": "def classify(n):\n    for candidate in range(2, n):\n        if n % candidate == 0:\n            return (\"composite\", candidate)\n    else:\n        return (\"prime\", None)\n\ndef demo_for_else():\n    return (classify(9), classify(7))", "entry_point": "demo_for_else", "input": "", "output": "(('composite', 3), ('prime', None))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd480010x6p2wy5lhlet", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030615", "code": "def demo_try_else():\n    log = []\n    for raw in [\"5\", \"oops\"]:\n        try:\n            value = int(raw)\n        except ValueError:\n            log.append(\"except\")\n        else:\n            log.append(\"else:\" + str(value))\n        finally:\n            log.append(\"finally\")\n    return log", "entry_point": "demo_try_else", "input": "", "output": "['else:5', 'finally', 'except', 'finally']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd480011x6p2zei9p4qw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030616", "code": "def demo_walrus():\n    readings = [4, 8, 1, 9]\n    kept = []\n    while readings and (current := readings.pop(0)) < 9:\n        kept.append(current)\n    return (kept, readings, current)", "entry_point": "demo_walrus", "input": "", "output": "([4, 8, 1], [], 9)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd480012x6p25xexstzj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030617", "code": "def tally(*args, sep=\"-\", **kwargs):\n    return (args, sep, sorted(kwargs.items()))\n\ndef demo_signature():\n    return (tally(1, 2, sep=\"+\", mode=\"fast\"), tally())", "entry_point": "demo_signature", "input": "", "output": "(((1, 2), '+', [('mode', 'fast')]), ((), '-', []))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmskfpd480013x6p2eg5i0jjb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030618", "code": "def fib_memo(n, cache={}):\n    if n in cache:\n        return cache[n]\n    if n <= 1:\n        return n\n    cache[n] = fib_memo(n - 1, cache) + fib_memo(n - 2, cache)\n    return cache[n]\n\ndef fib_sequence(count):\n    return [fib_memo(i) for i in range(count)]", "entry_point": "fib_sequence", "input": "10", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl0015dmp2r0v8hlyy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030619", "code": "def flatten(nested):\n    result = []\n    for item in nested:\n        if isinstance(item, list):\n            result.extend(flatten(item))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten", "input": "[1, [2, 3, [4, [5, 6]], 7], 8]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl0018dmp2el6rff6e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030620", "code": "class Node:\n    def __init__(self, value, next=None):\n        self.value = value\n        self.next = next\n\ndef linked_list_to_list(head):\n    out = []\n    while head:\n        out.append(head.value)\n        head = head.next\n    return out\n\ndef build_and_walk():\n    head = Node(1, Node(2, Node(3, Node(4))))\n    return linked_list_to_list(head)", "entry_point": "build_and_walk", "input": "", "output": "[1, 2, 3, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001cdmp2iet1jnom", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030621", "code": "def custom_sort(records):\n    return sorted(records, key=lambda r: (-r[1], r[0]))", "entry_point": "custom_sort", "input": "[('apple', 3), ('banana', 5), ('cherry', 3), ('date', 5)]", "output": "[('banana', 5), ('date', 5), ('apple', 3), ('cherry', 3)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001edmp2hgo5ornw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030622", "code": "def try_finally_demo(x):\n    log = []\n    try:\n        if x < 0:\n            raise ValueError(\"negative\")\n        log.append(\"processed\")\n        return x * 2\n    except ValueError as e:\n        log.append(f\"error: {e}\")\n        return -1\n    finally:\n        log.append(\"cleanup\")\n    return log", "entry_point": "try_finally_demo", "input": "-5", "output": "-1", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001fdmp242km4ilp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030623", "code": "def make_counter():\n    count = 0\n    def increment(step=1):\n        nonlocal count\n        count += step\n        return count\n    return increment\n\ndef run_counter():\n    inc = make_counter()\n    inc(3)\n    inc(2)\n    return inc(5)", "entry_point": "run_counter", "input": "", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001gdmp272796quj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030624", "code": "def apply_decorator():\n    def logged(func):\n        calls = []\n        def wrapper(*args, **kwargs):\n            result = func(*args, **kwargs)\n            calls.append((args, result))\n            return result\n        wrapper.calls = calls\n        return wrapper\n\n    @logged\n    def square(x):\n        return x * x\n\n    square(2)\n    square(3)\n    square(4)\n    return square.calls", "entry_point": "apply_decorator", "input": "", "output": "[((2,), 4), ((3,), 9), ((4,), 16)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001idmp2po1v4lzd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030625", "code": "def default_arg_pitfall(value, bucket=[]):\n    bucket.append(value)\n    return bucket\n\ndef run_pitfall():\n    a = default_arg_pitfall(1)\n    b = default_arg_pitfall(2)\n    return a, b", "entry_point": "run_pitfall", "input": "", "output": "([1, 2, 1, 2], [1, 2, 1, 2])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001kdmp2w35m9my5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030626", "code": "def chained_comparisons(a, b, c):\n    return a < b < c, a < b > c", "entry_point": "chained_comparisons", "input": "1, 5, 10", "output": "(True, False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001ldmp27xl7ddf4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030627", "code": "class Animal:\n    def speak(self):\n        return \"...\"\n\nclass Dog(Animal):\n    def speak(self):\n        return \"Woof\"\n\nclass Cat(Animal):\n    def speak(self):\n        return \"Meow\"\n\ndef speak_all(animals):\n    return [a.speak() for a in animals]", "entry_point": "speak_all", "input": "[Dog(), Cat(), Animal()]", "output": "['Woof', 'Meow', '...']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001mdmp253fhlc9x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030628", "code": "def walrus_demo(nums):\n    result = []\n    i = 0\n    while (n := nums[i] if i < len(nums) else None) is not None:\n        result.append(n * 2)\n        i += 1\n    return result", "entry_point": "walrus_demo", "input": "[1, 2, 3]", "output": "[2, 4, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001odmp2u9t9o5sk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030629", "code": "def generator_pipeline(n):\n    def squares():\n        for i in range(n):\n            yield i * i\n    return list(x for x in squares() if x % 2 == 0)", "entry_point": "generator_pipeline", "input": "10", "output": "[0, 4, 16, 36, 64]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001rdmp21hfk09gv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030630", "code": "class Temperature:\n    def __init__(self, celsius):\n        self._celsius = celsius\n\n    @property\n    def fahrenheit(self):\n        return self._celsius * 9 / 5 + 32\n\n    @fahrenheit.setter\n    def fahrenheit(self, value):\n        self._celsius = (value - 32) * 5 / 9\n\ndef convert_round_trip():\n    t = Temperature(25)\n    f = t.fahrenheit\n    t.fahrenheit = 100\n    return round(f, 2), round(t._celsius, 2)", "entry_point": "convert_round_trip", "input": "", "output": "(77.0, 37.78)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001sdmp2givupg1f", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030631", "code": "def custom_exception_demo():\n    class InsufficientFundsError(Exception):\n        def __init__(self, balance, amount):\n            self.balance = balance\n            self.amount = amount\n            super().__init__(f\"Cannot withdraw {amount}, balance is {balance}\")\n\n    def withdraw(balance, amount):\n        if amount > balance:\n            raise InsufficientFundsError(balance, amount)\n        return balance - amount\n\n    try:\n        withdraw(50, 100)\n    except InsufficientFundsError as e:\n        return str(e), e.balance, e.amount", "entry_point": "custom_exception_demo", "input": "", "output": "('Cannot withdraw 100, balance is 50', 50, 100)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001tdmp26yej0i1k", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030632", "code": "def binary_search(arr, target):\n    lo, hi = 0, len(arr) - 1\n    while lo <= hi:\n        mid = (lo + hi) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid - 1\n    return -1", "entry_point": "binary_search", "input": "[1, 3, 5, 7, 9, 11, 13], 9", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65yl001udmp2lkajjzn0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030633", "code": "import itertools\ndef pairwise_products(nums):\n    return [a * b for a, b in itertools.combinations(nums, 2)]", "entry_point": "pairwise_products", "input": "[1, 2, 3, 4]", "output": "[2, 3, 4, 6, 8, 12]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym001wdmp2pm5n7obm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030634", "code": "def recursive_sum_digits(n):\n    if n < 10:\n        return n\n    return n % 10 + recursive_sum_digits(n // 10)", "entry_point": "recursive_sum_digits", "input": "987654", "output": "39", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym001zdmp2lspm4jta", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030635", "code": "def slicing_tricks(lst):\n    return lst[::2], lst[::-1], lst[1:-1], lst[-3:]", "entry_point": "slicing_tricks", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "([0, 2, 4, 6, 8], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [1, 2, 3, 4, 5, 6, 7, 8], [7, 8, 9])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0020dmp25eg7nx6x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030636", "code": "def context_manager_demo():\n    class Resource:\n        def __init__(self, name):\n            self.name = name\n            self.log = []\n        def __enter__(self):\n            self.log.append(f\"open:{self.name}\")\n            return self\n        def __exit__(self, exc_type, exc_val, exc_tb):\n            self.log.append(f\"close:{self.name}\")\n            return False\n\n    r = Resource(\"db\")\n    with r:\n        r.log.append(\"using\")\n    return r.log", "entry_point": "context_manager_demo", "input": "", "output": "['open:db', 'using', 'close:db']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0021dmp2fu55zszn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030637", "code": "def deep_update(base, updates):\n    for key, value in updates.items():\n        if isinstance(value, dict) and isinstance(base.get(key), dict):\n            deep_update(base[key], value)\n        else:\n            base[key] = value\n    return base", "entry_point": "deep_update", "input": "{'a': 1, 'b': {'c': 2, 'd': 3}}, {'b': {'c': 20, 'e': 4}, 'f': 5}", "output": "{'a': 1, 'b': {'c': 20, 'd': 3, 'e': 4}, 'f': 5}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0022dmp2202rqi5h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030638", "code": "def lru_style_cache():\n    from functools import lru_cache\n\n    calls = []\n\n    @lru_cache(maxsize=None)\n    def expensive(n):\n        calls.append(n)\n        return n * n\n\n    expensive(4)\n    expensive(4)\n    expensive(5)\n    expensive(4)\n    return calls, expensive(5)", "entry_point": "lru_style_cache", "input": "", "output": "([4, 5], 25)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0024dmp2jsgsbo3f", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030639", "code": "def validate_and_transform(records):\n    valid = []\n    errors = []\n    for r in records:\n        try:\n            age = int(r[\"age\"])\n            if age < 0:\n                raise ValueError(\"negative age\")\n            valid.append({\"name\": r[\"name\"], \"age\": age})\n        except (KeyError, ValueError) as e:\n            errors.append(str(e))\n    return valid, errors", "entry_point": "validate_and_transform", "input": "[{'name': 'A', 'age': '30'}, {'name': 'B', 'age': '-5'}, {'name': 'C'}]", "output": "([{'name': 'A', 'age': 30}], ['negative age', \"'age'\"])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0025dmp2hbik6tq3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030640", "code": "class ReadOnlyDict:\n    def __init__(self, data):\n        self._data = dict(data)\n    def __getitem__(self, key):\n        return self._data[key]\n    def __setitem__(self, key, value):\n        raise TypeError(\"read-only\")\n    def __repr__(self):\n        return f\"ReadOnlyDict({self._data})\"\n\ndef try_mutate():\n    d = ReadOnlyDict({\"a\": 1})\n    try:\n        d[\"a\"] = 2\n    except TypeError as e:\n        return str(e), d[\"a\"]", "entry_point": "try_mutate", "input": "", "output": "('read-only', 1)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0027dmp2wyqlwn0p", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030641", "code": "def sort_stability_demo(items):\n    return sorted(items, key=lambda x: x[0])", "entry_point": "sort_stability_demo", "input": "[(1, 'a'), (2, 'b'), (1, 'c'), (2, 'd'), (1, 'e')]", "output": "[(1, 'a'), (1, 'c'), (1, 'e'), (2, 'b'), (2, 'd')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym0029dmp2fn3fu20h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030642", "code": "def exception_chaining_demo():\n    def parse(value):\n        try:\n            return int(value)\n        except ValueError as e:\n            raise RuntimeError(\"parse failed\") from e\n\n    try:\n        parse(\"abc\")\n    except RuntimeError as e:\n        return str(e), type(e.__cause__).__name__", "entry_point": "exception_chaining_demo", "input": "", "output": "('parse failed', 'ValueError')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym002admp2k44z2fdq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030643", "code": "def kwargs_and_args_demo(*args, **kwargs):\n    return sum(args) + sum(kwargs.values()), sorted(kwargs.keys())", "entry_point": "kwargs_and_args_demo", "input": "1, 2, 3, x=10, y=20", "output": "(36, ['x', 'y'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym002cdmp20zjm36jy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030644", "code": "def find_duplicates_with_index(items):\n    seen = {}\n    dupes = []\n    for i, item in enumerate(items):\n        if item in seen:\n            dupes.append((item, seen[item], i))\n        else:\n            seen[item] = i\n    return dupes", "entry_point": "find_duplicates_with_index", "input": "['a', 'b', 'a', 'c', 'b', 'b']", "output": "[('a', 0, 2), ('b', 1, 4), ('b', 1, 5)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym002edmp24r7p7ur2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030645", "code": "def class_method_and_static_demo():\n    class Circle:\n        pi = 3.14159\n        def __init__(self, radius):\n            self.radius = radius\n        @classmethod\n        def unit_circle(cls):\n            return cls(1)\n        @staticmethod\n        def area_for(radius):\n            return Circle.pi * radius * radius\n        def area(self):\n            return Circle.area_for(self.radius)\n\n    c = Circle.unit_circle()\n    return c.area(), Circle.area_for(3)", "entry_point": "class_method_and_static_demo", "input": "", "output": "(3.14159, 28.274309999999996)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsms65ym002fdmp2sv8l9ze7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030646", "code": "def safe_divs(pairs):\n    out = []\n    for a, b in pairs:\n        try:\n            out.append(round(a / b, 3))\n        except ZeroDivisionError:\n            out.append(None)\n    return out", "entry_point": "safe_divs", "input": "[(10, 4), (1, 0)]", "output": "[2.5, None]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me0037dmp2dnd6rlsg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030647", "code": "def flatten(nested):\n    out = []\n    for item in nested:\n        if isinstance(item, list):\n            out.extend(item)\n        else:\n            out.append(item)\n    return out", "entry_point": "flatten", "input": "[1, [2, 3], 4, [5]]", "output": "[1, 2, 3, 4, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me0038dmp2g8ln771t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030648", "code": "def group_parity(nums):\n    groups = {'even': [], 'odd': []}\n    for n in nums:\n        groups['even' if n % 2 == 0 else 'odd'].append(n)\n    return groups", "entry_point": "group_parity", "input": "[1, 2, 3, 4, 5]", "output": "{'even': [2, 4], 'odd': [1, 3, 5]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me0039dmp2sd0scuw6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030649", "code": "def unique_sorted(items):\n    return sorted(set(items))", "entry_point": "unique_sorted", "input": "[3, 1, 2, 3, 1, 4]", "output": "[1, 2, 3, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me003admp23gvj9ios", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030650", "code": "def word_lengths(sentence):\n    return {w: len(w) for w in sentence.split()}", "entry_point": "word_lengths", "input": "'the quick brown'", "output": "{'the': 3, 'quick': 5, 'brown': 5}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me003bdmp2q8mw3cbt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030651", "code": "def clamp_all(values, low, high):\n    return [max(low, min(v, high)) for v in values]", "entry_point": "clamp_all", "input": "[5, -3, 15], 0, 10", "output": "[5, 0, 10]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me003cdmp2aso8su1o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030652", "code": "def fib(n):\n    a, b = 0, 1\n    seq = []\n    for _ in range(n):\n        seq.append(a)\n        a, b = b, a + b\n    return seq", "entry_point": "fib", "input": "7", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me003ddmp2z9zdhdt7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030653", "code": "def merge_dicts(a, b):\n    result = dict(a)\n    result.update(b)\n    return result", "entry_point": "merge_dicts", "input": "{'x': 1, 'y': 2}, {'y': 9, 'z': 3}", "output": "{'x': 1, 'y': 9, 'z': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt31me003edmp25clx0lg4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030654", "code": "def first_letters(words):\n    return [w[0] for w in words]", "entry_point": "first_letters", "input": "['tree', 'quiet', 'brown']", "output": "['t', 'q', 'b']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003hdmp2i68pnij5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030655", "code": "def running_max(nums):\n    best = nums[0]\n    out = []\n    for n in nums:\n        best = max(best, n)\n        out.append(best)\n    return out", "entry_point": "running_max", "input": "[1, 3, 2, 5, 4]", "output": "[1, 3, 3, 5, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003idmp2srnydpyp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030656", "code": "def dedupe_keep_order(seq):\n    seen = set()\n    out = []\n    for x in seq:\n        if x not in seen:\n            seen.add(x)\n            out.append(x)\n    return out", "entry_point": "dedupe_keep_order", "input": "[3, 1, 3, 2, 1, 4]", "output": "[3, 1, 2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003jdmp2a67oiimk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030657", "code": "def digit_sums(nums):\n    return [sum(int(d) for d in str(abs(n))) for n in nums]", "entry_point": "digit_sums", "input": "[12345, -99]", "output": "[15, 18]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003kdmp2m0ue36m9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030658", "code": "def invert_mapping(d):\n    return {v: k for k, v in d.items()}", "entry_point": "invert_mapping", "input": "{'a': 1, 'b': 2, 'c': 3}", "output": "{1: 'a', 2: 'b', 3: 'c'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003ldmp2fyfinuci", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030659", "code": "def first_repeated(nums):\n    seen = set()\n    for n in nums:\n        if n in seen:\n            return n\n        seen.add(n)\n    return None", "entry_point": "first_repeated", "input": "[2, 4, 6, 4, 8]", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003ndmp27a8e4gov", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030660", "code": "def normalize(scores):\n    lo, hi = min(scores), max(scores)\n    span = hi - lo\n    return [round((s - lo) / span, 2) for s in scores]", "entry_point": "normalize", "input": "[10, 20, 30]", "output": "[0.0, 0.5, 1.0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003odmp21bz19ele", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030661", "code": "def stack_ops(commands):\n    stack = []\n    for op in commands:\n        if op == 'pop':\n            stack.pop()\n        else:\n            stack.append(op)\n    return stack", "entry_point": "stack_ops", "input": "['a', 'b', 'pop', 'c']", "output": "['a', 'c']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003pdmp2a9wxm3j6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030662", "code": "def rle_encode(s):\n    if not s:\n        return []\n    out = []\n    prev = s[0]\n    count = 1\n    for ch in s[1:]:\n        if ch == prev:\n            count += 1\n        else:\n            out.append((prev, count))\n            prev = ch\n            count = 1\n    out.append((prev, count))\n    return out", "entry_point": "rle_encode", "input": "'aaabbc'", "output": "[('a', 3), ('b', 2), ('c', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003qdmp2qhof64wq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030663", "code": "def price_after_tax(prices, rate):\n    return [round(p * (1 + rate), 2) for p in prices]", "entry_point": "price_after_tax", "input": "[100, 250], 0.08", "output": "[108.0, 270.0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003rdmp2tdati42s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030664", "code": "def sum_by_key(records):\n    totals = {}\n    for r in records:\n        totals[r['cat']] = totals.get(r['cat'], 0) + r['amt']\n    return totals", "entry_point": "sum_by_key", "input": "[{'cat': 'x', 'amt': 5}, {'cat': 'y', 'amt': 2}, {'cat': 'x', 'amt': 3}]", "output": "{'x': 8, 'y': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003sdmp2cahx7s60", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030665", "code": "def all_balanced(strings):\n    pairs = {')': '(', ']': '[', '}': '{'}\n    result = []\n    for s in strings:\n        stack = []\n        ok = True\n        for ch in s:\n            if ch in '([{':\n                stack.append(ch)\n            elif ch in pairs:\n                if not stack or stack.pop() != pairs[ch]:\n                    ok = False\n                    break\n        result.append(ok and not stack)\n    return result", "entry_point": "all_balanced", "input": "['(a[b]{c})', '(]']", "output": "[True, False]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsmt6sqa003tdmp2yconun9n", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030666", "code": "def compact_ranges(nums):\n    if not nums: return []\n    out=[]; start=prev=nums[0]\n    for x in nums[1:]:\n        if x==prev+1: prev=x; continue\n        out.append((start,prev)); start=prev=x\n    out.append((start,prev)); return out", "entry_point": "compact_ranges", "input": "[1, 2, 3, 5, 8, 9]", "output": "[(1, 3), (5, 5), (8, 9)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005k6zp2hj2zuiq0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030667", "code": "def invert_counts(items):\n    d={}\n    for x in items: d[x]=d.get(x,0)+1\n    return sorted((v,k) for k,v in d.items())", "entry_point": "invert_counts", "input": "['b', 'a', 'b', 'c', 'a', 'b']", "output": "[(1, 'c'), (2, 'a'), (3, 'b')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005l6zp2v50vvnda", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030668", "code": "def zigzag(nums):\n    return [x if i%2==0 else -x for i,x in enumerate(nums)]", "entry_point": "zigzag", "input": "[4, 1, -2, 3]", "output": "[4, -1, -2, -3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005m6zp23fioo3ow", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030669", "code": "def merge_defaults(defaults, override):\n    out=defaults.copy(); out.update({k:v for k,v in override.items() if v is not None}); return out", "entry_point": "merge_defaults", "input": "{'a': 1, 'b': 2}, {'b': 5, 'c': None, 'd': 9}", "output": "{'a': 1, 'b': 5, 'd': 9}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005n6zp2csodixha", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030670", "code": "def window_sums(nums,k):\n    if k<=0 or k>len(nums): return []\n    s=sum(nums[:k]); out=[s]\n    for i in range(k,len(nums)):\n        s+=nums[i]-nums[i-k]; out.append(s)\n    return out", "entry_point": "window_sums", "input": "[2, 5, -1, 4, 3], 3", "output": "[6, 8, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005o6zp2dejfcpub", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030671", "code": "def safe_ints(values):\n    out=[]\n    for v in values:\n        try: out.append(int(v))\n        except (ValueError,TypeError): out.append(None)\n    return out", "entry_point": "safe_ints", "input": "['12', '-3', 'x', None, '04']", "output": "[12, -3, None, None, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005p6zp2rfqiyxyh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030672", "code": "def transpose(rows):\n    return [list(col) for col in zip(*rows)] if rows else []", "entry_point": "transpose", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[1, 4], [2, 5], [3, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005q6zp2a3ly97qc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030673", "code": "def unique_last(items):\n    seen=set(); out=[]\n    for x in reversed(items):\n        if x not in seen: seen.add(x); out.append(x)\n    return list(reversed(out))", "entry_point": "unique_last", "input": "['a', 'b', 'a', 'c', 'b']", "output": "['a', 'c', 'b']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005r6zp2s663vi7e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030674", "code": "def classify(nums):\n    return {'neg':sum(x<0 for x in nums),'zero':sum(x==0 for x in nums),'pos':sum(x>0 for x in nums)}", "entry_point": "classify", "input": "[-2, 0, 3, 4, 0, -1]", "output": "{'neg': 2, 'zero': 2, 'pos': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7k005s6zp2tb93tm85", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030675", "code": "def rotate_matrix(m):\n    return [list(row) for row in zip(*m[::-1])]", "entry_point": "rotate_matrix", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[4, 1], [5, 2], [6, 3]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7l005t6zp2orp4mrzs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030676", "code": "def nested_get(obj,path,default=None):\n    cur=obj\n    for key in path:\n        if not isinstance(cur,dict) or key not in cur: return default\n        cur=cur[key]\n    return cur", "entry_point": "nested_get", "input": "{'a': {'b': 7}}, ['a', 'b']", "output": "7", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7l005u6zp2jw9sxqku", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030677", "code": "def rank_scores(scores):\n    vals=sorted(set(scores),reverse=True)\n    ranks={v:i+1 for i,v in enumerate(vals)}\n    return [ranks[x] for x in scores]", "entry_point": "rank_scores", "input": "[90, 70, 90, 50, 70]", "output": "[1, 2, 1, 3, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7l005v6zp2bjn6zgkr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030678", "code": "def flatten_once(items):\n    out=[]\n    for x in items:\n        out.extend(x if isinstance(x,list) else [x])\n    return out", "entry_point": "flatten_once", "input": "[[1, 2], 3, [], [4, [5]]]", "output": "[1, 2, 3, 4, [5]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7l005w6zp27h5yuhmv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030679", "code": "def diff_keys(a,b):\n    keys=set(a)|set(b)\n    return sorted(k for k in keys if a.get(k)!=b.get(k))", "entry_point": "diff_keys", "input": "{'a': 1, 'b': 2, 'd': None}, {'a': 1, 'b': 3, 'c': 4}", "output": "['b', 'c']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m005x6zp2tg2qj3f3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030680", "code": "def encode_runs(s):\n    if not s:return []\n    out=[]; ch=s[0]; n=1\n    for c in s[1:]:\n        if c==ch:n+=1\n        else:out.append((ch,n));ch=c;n=1\n    out.append((ch,n));return out", "entry_point": "encode_runs", "input": "'aaabbccccaa'", "output": "[('a', 3), ('b', 2), ('c', 4), ('a', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m005y6zp2mc7bf5a7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030681", "code": "def bucket(nums,size):\n    out={}\n    for x in nums:\n        k=(x//size)*size\n        out.setdefault(k,[]).append(x)\n    return out", "entry_point": "bucket", "input": "[1, 9, 10, 11, 19, 20], 10", "output": "{0: [1, 9], 10: [10, 11, 19], 20: [20]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m005z6zp2lzi01jq8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030682", "code": "def pairwise_delta(nums):\n    return [b-a for a,b in zip(nums,nums[1:])]", "entry_point": "pairwise_delta", "input": "[10, 13, 8, 8, 20]", "output": "[3, -5, 0, 12]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m00606zp277m1l1vm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030683", "code": "def normalize_record(r):\n    return {k.strip().lower(): (v.strip() if isinstance(v,str) else v) for k,v in r.items()}", "entry_point": "normalize_record", "input": "{' Name ': ' Ada ', 'AGE': 36}", "output": "{'name': 'Ada', 'age': 36}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m00616zp205npvp25", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030684", "code": "def take_until(nums,limit):\n    out=[]; total=0\n    for x in nums:\n        if total+x>limit: break\n        out.append(x); total+=x\n    return out,total", "entry_point": "take_until", "input": "[3, 4, 5, 1], 10", "output": "([3, 4], 7)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m00626zp2niq0ghji", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030685", "code": "def intersection_ordered(a,b):\n    allowed=set(b); seen=set(); out=[]\n    for x in a:\n        if x in allowed and x not in seen: seen.add(x); out.append(x)\n    return out", "entry_point": "intersection_ordered", "input": "[3, 1, 2, 3, 4, 2], [2, 3, 9]", "output": "[3, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsnc3d7m00636zp2q5zkdrvj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030686", "code": "def f(xs):\n return [x*x for x in xs if x%2]", "entry_point": "f", "input": "[1, 2, 3, 4, 5]", "output": "[1, 9, 25]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qn900ak6zp2ou1ubwfs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030687", "code": "def f(s):\n return {c:s.count(c) for c in sorted(set(s))}", "entry_point": "f", "input": "'banana'", "output": "{'a': 3, 'b': 1, 'n': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qn900al6zp2ieg6wc71", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030688", "code": "def f(xs):\n a=0\n for i,x in enumerate(xs): a+=i*x\n return a", "entry_point": "f", "input": "[3, 4, 5]", "output": "14", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qn900am6zp2o1017uh4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030689", "code": "def f(n):\n return sum(i for i in range(n+1) if i%3==0)", "entry_point": "f", "input": "10", "output": "18", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qn900an6zp22woinimi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030690", "code": "def f(d):\n return sorted(d.items(), key=lambda p:(-p[1],p[0]))", "entry_point": "f", "input": "{'b': 2, 'a': 2, 'c': 1}", "output": "[('a', 2), ('b', 2), ('c', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qn900ao6zp2ao3ifi6i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030691", "code": "def f(xs):\n return list(zip(xs,xs[1:]))", "entry_point": "f", "input": "[4, 7, 9]", "output": "[(4, 7), (7, 9)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qn900ap6zp2pgftznkt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030692", "code": "def f(xs):\n return [sum(xs[:i]) for i in range(len(xs)+1)]", "entry_point": "f", "input": "[2, -1, 3]", "output": "[0, 2, 1, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00ar6zp21dgmzedj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030693", "code": "def f(n):\n a,b=0,1\n for _ in range(n): a,b=b,a+b\n return a", "entry_point": "f", "input": "8", "output": "21", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00as6zp27fkmefbi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030694", "code": "def f(xs):\n return max(enumerate(xs),key=lambda p:p[1])", "entry_point": "f", "input": "[5, 9, 9, 2]", "output": "(1, 9)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00at6zp2epzu6444", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030695", "code": "def f(s):\n return s[::2],s[1::2]", "entry_point": "f", "input": "'abcdefg'", "output": "('aceg', 'bdf')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00au6zp20n1dn9eb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030696", "code": "def f(xs):\n return all(a<=b for a,b in zip(xs,xs[1:]))", "entry_point": "f", "input": "[1, 1, 3, 2]", "output": "False", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00av6zp2dqeifczh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030697", "code": "def f(xs):\n return sorted(set(xs), reverse=True)[1]", "entry_point": "f", "input": "[4, 1, 4, 3, 2]", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00aw6zp2r24f0blp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030698", "code": "def f(s):\n from collections import Counter\n return Counter(s).most_common(2)", "entry_point": "f", "input": "'mississippi'", "output": "[('i', 4), ('s', 4)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00ax6zp2tv6a5vwz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030699", "code": "def f(x):\n try:return 100//x\n except ZeroDivisionError:return None", "entry_point": "f", "input": "4", "output": "25", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00ay6zp2l56j8bab", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030700", "code": "def f(xs):\n return {x:i for i,x in enumerate(xs)}", "entry_point": "f", "input": "['a', 'b', 'a']", "output": "{'a': 2, 'b': 1}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00az6zp2lezxzmbm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030701", "code": "def f(n):\n return [i for i in range(n) if all(i%d for d in range(2,int(i**.5)+1)) and i>1]", "entry_point": "f", "input": "12", "output": "[2, 3, 5, 7, 11]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b06zp2zd2n1ugx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030702", "code": "def f(rows):\n return list(map(list,zip(*rows)))", "entry_point": "f", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[1, 4], [2, 5], [3, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b16zp274gz4vu3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030703", "code": "def f(xs):\n return [x for x in xs if xs.count(x)==1]", "entry_point": "f", "input": "[1, 2, 1, 3, 4, 3]", "output": "[2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b36zp2amh9wsg9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030704", "code": "def f(n):\n return divmod(n,60)", "entry_point": "f", "input": "367", "output": "(6, 7)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b46zp2vsn4gdtl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030705", "code": "def f(xs):\n return min(xs,key=lambda x:(abs(x),x))", "entry_point": "f", "input": "[-3, 2, -2, 5]", "output": "-2", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b56zp2fjgg13to", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030706", "code": "def f(s):\n return [p for p in s.split(',') if p]", "entry_point": "f", "input": "'a,,b,c,'", "output": "['a', 'b', 'c']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b66zp2fsd9xno7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030707", "code": "def f(xs):\n return sum(x<0 for x in xs),sum(x==0 for x in xs),sum(x>0 for x in xs)", "entry_point": "f", "input": "[-2, 0, 3, 4, 0]", "output": "(1, 2, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b76zp2diwyb3st", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030708", "code": "def f(a,b):\n return sorted(set(a)&set(b))", "entry_point": "f", "input": "[1, 2, 3, 3], [2, 3, 4]", "output": "[2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b86zp2eyxxg698", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030709", "code": "def f(xs,k):\n return [xs[i:i+k] for i in range(0,len(xs),k)]", "entry_point": "f", "input": "[1, 2, 3, 4, 5], 2", "output": "[[1, 2], [3, 4], [5]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00b96zp2ri7k951l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030710", "code": "def f(d):\n return sum(v for k,v in d.items() if k.startswith('x'))", "entry_point": "f", "input": "{'x1': 3, 'y': 8, 'x2': 4}", "output": "7", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00ba6zp25nlwkblx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030711", "code": "def f(s):\n return s == s[::-1]", "entry_point": "f", "input": "'level'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00bb6zp2czvyle8c", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030712", "code": "def f(xs):\n return [b-a for a,b in zip(xs,xs[1:])]", "entry_point": "f", "input": "[3, 8, 6, 10]", "output": "[5, -2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmso86qna00bc6zp2s6gkvemp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030713", "code": "def word_freq(text):\n    freq = {}\n    for w in text.split():\n        freq[w] = freq.get(w, 0) + 1\n    return sorted(freq.items())", "entry_point": "word_freq", "input": "'a b a c b a'", "output": "[('a', 3), ('b', 2), ('c', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0002ctp2qii51bdk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030714", "code": "class Stack:\n    def __init__(self):\n        self.data = []\n    def push(self, x):\n        self.data.append(x)\n    def pop(self):\n        return self.data.pop()\n    def peek(self):\n        return self.data[-1]\n\ndef stack_ops():\n    s = Stack()\n    s.push(1)\n    s.push(2)\n    s.push(3)\n    s.pop()\n    s.push(5)\n    return (s.peek(), len(s.data))", "entry_point": "stack_ops", "input": "", "output": "(5, 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0003ctp2zexklme7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030715", "code": "def merge_intervals(intervals):\n    intervals = sorted(intervals)\n    merged = []\n    for start, end in intervals:\n        if merged and start <= merged[-1][1]:\n            merged[-1] = (merged[-1][0], max(merged[-1][1], end))\n        else:\n            merged.append((start, end))\n    return merged", "entry_point": "merge_intervals", "input": "[(1, 3), (2, 6), (8, 10), (15, 18)]", "output": "[(1, 6), (8, 10), (15, 18)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0004ctp2137s2ov4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030716", "code": "def flatten(nested):\n    result = []\n    for item in nested:\n        if isinstance(item, list):\n            result.extend(flatten(item))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten", "input": "[1, [2, 3, [4, 5]], 6, [7]]", "output": "[1, 2, 3, 4, 5, 6, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0006ctp21ozcdeu6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030717", "code": "def char_count_map(s):\n    from collections import Counter\n    c = Counter(s)\n    return dict(sorted(c.items()))", "entry_point": "char_count_map", "input": "'mississippi'", "output": "{'i': 4, 'm': 1, 'p': 2, 's': 4}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0007ctp2yoqjb9a9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030718", "code": "def rotate_list(lst, k):\n    if not lst:\n        return lst\n    k = k % len(lst)\n    return lst[-k:] + lst[:-k]", "entry_point": "rotate_list", "input": "[1, 2, 3, 4, 5], 2", "output": "[4, 5, 1, 2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0008ctp2a4c6cx15", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030719", "code": "def is_balanced(s):\n    stack = []\n    pairs = {')':'(', ']':'[', '}':'{'}\n    for ch in s:\n        if ch in '([{':\n            stack.append(ch)\n        elif ch in ')]}':\n            if not stack or stack.pop() != pairs[ch]:\n                return False\n    return not stack", "entry_point": "is_balanced", "input": "'([{}])'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6wv0009ctp2ipjsuyvx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030720", "code": "def gen_squares(n):\n    def sq():\n        for i in range(n):\n            yield i * i\n    return list(sq())", "entry_point": "gen_squares", "input": "6", "output": "[0, 1, 4, 9, 16, 25]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000actp2ew30hct5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030721", "code": "def try_finally_demo():\n    log = []\n    try:\n        log.append('try')\n        raise ValueError('boom')\n    except ValueError as e:\n        log.append(f'except:{e}')\n    finally:\n        log.append('finally')\n    return log", "entry_point": "try_finally_demo", "input": "", "output": "['try', 'except:boom', 'finally']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000bctp2xn6m0ifa", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030722", "code": "def matrix_transpose(m):\n    return [list(row) for row in zip(*m)]", "entry_point": "matrix_transpose", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[1, 4], [2, 5], [3, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000cctp22nmb1dqv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030723", "code": "def binary_search(arr, target):\n    lo, hi = 0, len(arr) - 1\n    while lo <= hi:\n        mid = (lo + hi) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid - 1\n    return -1", "entry_point": "binary_search", "input": "[1, 3, 5, 7, 9, 11], 7", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000dctp286q9j66z", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030724", "code": "def default_dict_demo():\n    from collections import defaultdict\n    d = defaultdict(list)\n    for k, v in [('a',1),('b',2),('a',3)]:\n        d[k].append(v)\n    return dict(d)", "entry_point": "default_dict_demo", "input": "", "output": "{'a': [1, 3], 'b': [2]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000ectp21o6izba3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030725", "code": "def slice_tricks(s):\n    return (s[::-1], s[1:-1], s[::2])", "entry_point": "slice_tricks", "input": "'abcdefgh'", "output": "('hgfedcba', 'bcdefg', 'aceg')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000fctp2s7vmficn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030726", "code": "def sum_with_default_arg(lst, acc=None):\n    if acc is None:\n        acc = []\n    acc.append(sum(lst))\n    return acc", "entry_point": "sum_with_default_arg", "input": "[1, 2, 3]", "output": "[6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000gctp2bmubxfi2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030727", "code": "def zip_longest_demo():\n    from itertools import zip_longest\n    return list(zip_longest([1,2,3], ['a','b'], fillvalue='X'))", "entry_point": "zip_longest_demo", "input": "", "output": "[(1, 'a'), (2, 'b'), (3, 'X')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000hctp291s78r9t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030728", "code": "def recursive_factorial(n):\n    if n <= 1:\n        return 1\n    return n * recursive_factorial(n - 1)", "entry_point": "recursive_factorial", "input": "6", "output": "720", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000ictp2yf6ejk23", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030729", "code": "def set_ops(a, b):\n    sa, sb = set(a), set(b)\n    return (sorted(sa & sb), sorted(sa | sb), sorted(sa - sb))", "entry_point": "set_ops", "input": "[1, 2, 3, 4], [3, 4, 5, 6]", "output": "([3, 4], [1, 2, 3, 4, 5, 6], [1, 2])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000jctp29v8o8zs4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030730", "code": "def enumerate_demo(items):\n    return [f'{i}:{v}' for i, v in enumerate(items, start=1)]", "entry_point": "enumerate_demo", "input": "['x', 'y', 'z']", "output": "['1:x', '2:y', '3:z']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000lctp2yyz7kppt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030731", "code": "def list_comp_nested():\n    return [[i*j for j in range(3)] for i in range(3)]", "entry_point": "list_comp_nested", "input": "", "output": "[[0, 0, 0], [0, 1, 2], [0, 2, 4]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000mctp2lcd1lk4l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030732", "code": "def tuple_unpack_star(items):\n    first, *middle, last = items\n    return (first, middle, last)", "entry_point": "tuple_unpack_star", "input": "[1, 2, 3, 4, 5]", "output": "(1, [2, 3, 4], 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000octp2dhb2q6zr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030733", "code": "def while_else_demo(n):\n    i = 2\n    while i < n:\n        if n % i == 0:\n            return False\n        i += 1\n    else:\n        return True", "entry_point": "while_else_demo", "input": "17", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000pctp2wuql4cqi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030734", "code": "def sorted_with_key(items):\n    return sorted(items, key=lambda x: (-x[1], x[0]))", "entry_point": "sorted_with_key", "input": "[('a', 2), ('b', 3), ('c', 2)]", "output": "[('b', 3), ('a', 2), ('c', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000qctp2kqonlklt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030735", "code": "def nested_dict_update():\n    d = {'a': {'x': 1}, 'b': {'y': 2}}\n    d['a']['z'] = 99\n    d.setdefault('c', {})['w'] = 5\n    return d", "entry_point": "nested_dict_update", "input": "", "output": "{'a': {'x': 1, 'z': 99}, 'b': {'y': 2}, 'c': {'w': 5}}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000rctp2yfttzt5s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030736", "code": "def chained_comparison(a, b, c):\n    return a < b < c", "entry_point": "chained_comparison", "input": "1, 5, 10", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000sctp23xzfrw36", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030737", "code": "def bytes_ops():\n    b = bytes([104, 101, 108, 108, 111])\n    return (b, b.decode(), len(b))", "entry_point": "bytes_ops", "input": "", "output": "(b'hello', 'hello', 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsoiw6ww000tctp23q7zs99g", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030738", "code": "def fib_seq(n):\n    cache = {0: 0, 1: 1}\n    for i in range(2, n + 1):\n        cache[i] = cache[i - 1] + cache[i - 2]\n    return [cache[i] for i in range(n + 1)]", "entry_point": "fib_seq", "input": "7", "output": "[0, 1, 1, 2, 3, 5, 8, 13]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000f7vp2s4nxh626", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030739", "code": "class ValidationError(Exception):\n    pass\n\ndef validate_age(age):\n    try:\n        if age < 0:\n            raise ValidationError(\"negative age\")\n        return age * 2\n    except ValidationError as e:\n        return f\"error: {e}\"", "entry_point": "validate_age", "input": "5", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000g7vp2wwlc5kvb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030740", "code": "def compare_sets(a, b):\n    return {\n        \"union\": sorted(a | b),\n        \"intersection\": sorted(a & b),\n        \"difference\": sorted(a - b)\n    }", "entry_point": "compare_sets", "input": "{1, 2, 3, 4}, {3, 4, 5}", "output": "{'union': [1, 2, 3, 4, 5], 'intersection': [3, 4], 'difference': [1, 2]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000h7vp2g6rrkp6v", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030741", "code": "def top_scores(records, n):\n    return sorted(records, key=lambda r: (-r[1], r[0]))[:n]", "entry_point": "top_scores", "input": "[('alice', 90), ('bob', 95), ('carol', 90), ('dave', 95)], 3", "output": "[('bob', 95), ('dave', 95), ('alice', 90)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000j7vp23qk98jyo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030742", "code": "def even_squares(nums):\n    for n in nums:\n        if n % 2 == 0:\n            yield n * n\n\ndef sum_even_squares(nums):\n    return sum(even_squares(nums))", "entry_point": "sum_even_squares", "input": "[1, 2, 3, 4, 5, 6]", "output": "56", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000k7vp2odtofi47", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030743", "code": "def safe_factorial(n):\n    if n < 0:\n        raise ValueError(\"n must be non-negative\")\n    if n == 0:\n        return 1\n    return n * safe_factorial(n - 1)\n\ndef try_factorial(n):\n    try:\n        return safe_factorial(n)\n    except ValueError as e:\n        return str(e)", "entry_point": "try_factorial", "input": "5", "output": "120", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000l7vp22s6oyzqf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030744", "code": "def index_map(items):\n    return {item: idx for idx, item in enumerate(items) if len(item) > 2}", "entry_point": "index_map", "input": "['a', 'cat', 'dog', 'it', 'fish']", "output": "{'cat': 1, 'dog': 2, 'fish': 4}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000m7vp2rr3l0mcu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030745", "code": "def divide_safe(a, b):\n    try:\n        result = a / b\n    except ZeroDivisionError:\n        return \"cannot divide by zero\"\n    except TypeError:\n        return \"invalid types\"\n    else:\n        return round(result, 2)", "entry_point": "divide_safe", "input": "10, 4", "output": "2.5", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjl000n7vp224dpj4xk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030746", "code": "def group_by_parity(nums):\n    groups = {\"even\": [], \"odd\": []}\n    for n in nums:\n        key = \"even\" if n % 2 == 0 else \"odd\"\n        groups[key].append(n)\n    return groups", "entry_point": "group_by_parity", "input": "[5, 8, 3, 12, 7, 2]", "output": "{'even': [8, 12, 2], 'odd': [5, 3, 7]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmspwitjm000o7vp23dxlwsjg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030747", "code": "def fib(n, memo=None):\n    if memo is None:\n        memo = {}\n    if n <= 1:\n        return n\n    if n not in memo:\n        memo[n] = fib(n - 1, memo) + fib(n - 2, memo)\n    return memo[n]", "entry_point": "fib", "input": "10", "output": "55", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs001ze0p2jrqfx2y6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030748", "code": "def binary_search(arr, target):\n    lo, hi = 0, len(arr) - 1\n    while lo <= hi:\n        mid = (lo + hi) // 2\n        if arr[mid] == target:\n            return mid\n        elif arr[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid - 1\n    return -1", "entry_point": "binary_search", "input": "[2, 5, 8, 12, 16, 23, 38, 56, 72, 91], 23", "output": "5", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0020e0p21tx642mr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030749", "code": "def transpose(matrix):\n    return [list(row) for row in zip(*matrix)]", "entry_point": "transpose", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[1, 4, 7], [2, 5, 8], [3, 6, 9]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0021e0p22mfpiqi0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030750", "code": "def word_frequency(text):\n    words = text.lower().split()\n    freq = {}\n    for word in words:\n        freq[word] = freq.get(word, 0) + 1\n    return dict(sorted(freq.items()))", "entry_point": "word_frequency", "input": "'to be or not to be that is the question'", "output": "{'be': 2, 'is': 1, 'not': 1, 'or': 1, 'question': 1, 'that': 1, 'the': 1, 'to': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0022e0p2w1lkfihx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030751", "code": "def flatten(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten(item))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten", "input": "[1, [2, [3, [4, 5]], 6], 7, [8, 9]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0023e0p2chvd1n9r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030752", "code": "def running_max(values):\n    result = []\n    current = float('-inf')\n    for v in values:\n        current = max(current, v)\n        result.append(current)\n    return result", "entry_point": "running_max", "input": "[3, 1, 4, 1, 5, 9, 2, 6, 5]", "output": "[3, 3, 4, 4, 5, 9, 9, 9, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0024e0p21q7b2w9t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030753", "code": "def deep_merge(base, override):\n    result = dict(base)\n    for k, v in override.items():\n        if k in result and isinstance(result[k], dict) and isinstance(v, dict):\n            result[k] = deep_merge(result[k], v)\n        else:\n            result[k] = v\n    return result", "entry_point": "deep_merge", "input": "{'a': {'x': 1, 'y': 2}, 'b': 3}, {'a': {'y': 99, 'z': 0}, 'c': 4}", "output": "{'a': {'x': 1, 'y': 99, 'z': 0}, 'b': 3, 'c': 4}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0025e0p2xy76025p", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030754", "code": "def count_vowels_consonants(s):\n    vowels = set('aeiouAEIOU')\n    v_count = sum(1 for c in s if c in vowels)\n    c_count = sum(1 for c in s if c.isalpha() and c not in vowels)\n    return {'vowels': v_count, 'consonants': c_count}", "entry_point": "count_vowels_consonants", "input": "'Hello World'", "output": "{'vowels': 3, 'consonants': 7}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijs0026e0p2jjnv7qve", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030755", "code": "def rotate_list(lst, k):\n    if not lst:\n        return lst\n    n = len(lst)\n    k = k % n\n    return lst[-k:] + lst[:-k] if k else list(lst)", "entry_point": "rotate_list", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[5, 6, 7, 1, 2, 3, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt0027e0p2xg3dj7hf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030756", "code": "def rle_encode(s):\n    if not s:\n        return []\n    result = []\n    count = 1\n    for i in range(1, len(s)):\n        if s[i] == s[i - 1]:\n            count += 1\n        else:\n            result.append((s[i - 1], count))\n            count = 1\n    result.append((s[-1], count))\n    return result", "entry_point": "rle_encode", "input": "'aaabbccddddee'", "output": "[('a', 3), ('b', 2), ('c', 2), ('d', 4), ('e', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt0028e0p23f6xd9b6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030757", "code": "def chunk_list(lst, size):\n    return [lst[i:i + size] for i in range(0, len(lst), size)]", "entry_point": "chunk_list", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3", "output": "[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt0029e0p2pggsig1c", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030758", "code": "def are_anagrams(s1, s2):\n    return sorted(s1.lower().replace(' ', '')) == sorted(s2.lower().replace(' ', ''))", "entry_point": "are_anagrams", "input": "'listen', 'silent'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002ae0p2hlzm00gj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030759", "code": "def prime_factors(n):\n    factors = []\n    d = 2\n    while d * d <= n:\n        while n % d == 0:\n            factors.append(d)\n            n //= d\n        d += 1\n    if n > 1:\n        factors.append(n)\n    return factors", "entry_point": "prime_factors", "input": "360", "output": "[2, 2, 2, 3, 3, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002be0p24nrygwj9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030760", "code": "from collections import OrderedDict\n\nclass LRUCache:\n    def __init__(self, capacity):\n        self.capacity = capacity\n        self.cache = OrderedDict()\n\n    def get(self, key):\n        if key not in self.cache:\n            return -1\n        self.cache.move_to_end(key)\n        return self.cache[key]\n\n    def put(self, key, value):\n        if key in self.cache:\n            self.cache.move_to_end(key)\n        self.cache[key] = value\n        if len(self.cache) > self.capacity:\n            self.cache.popitem(last=False)\n\ndef simulate_lru(ops):\n    cache = LRUCache(3)\n    results = []\n    for op, *args in ops:\n        if op == 'put':\n            cache.put(args[0], args[1])\n        elif op == 'get':\n            results.append(cache.get(args[0]))\n    return results", "entry_point": "simulate_lru", "input": "[('put', 1, 'a'), ('put', 2, 'b'), ('put', 3, 'c'), ('get', 1), ('put', 4, 'd'), ('get', 2), ('get', 1), ('get', 4)]", "output": "['a', -1, 'a', 'd']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002ce0p2gajtgfln", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030761", "code": "def zip_with_fill(list1, list2, fill=None):\n    length = max(len(list1), len(list2))\n    result = []\n    for i in range(length):\n        a = list1[i] if i < len(list1) else fill\n        b = list2[i] if i < len(list2) else fill\n        result.append((a, b))\n    return result", "entry_point": "zip_with_fill", "input": "[1, 2, 3, 4], ['a', 'b'], fill=0", "output": "[(1, 'a'), (2, 'b'), (3, 0), (4, 0)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002de0p20ts6p8zm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030762", "code": "def cumsum_until(values, threshold):\n    total = 0\n    result = []\n    for v in values:\n        total += v\n        result.append(total)\n        if total >= threshold:\n            break\n    return result", "entry_point": "cumsum_until", "input": "[5, 3, 8, 2, 7, 4], 20", "output": "[5, 8, 16, 18, 25]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002ee0p2f5yni7f2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030763", "code": "def merge_sorted(arr1, arr2):\n    result = []\n    i = j = 0\n    while i < len(arr1) and j < len(arr2):\n        if arr1[i] <= arr2[j]:\n            result.append(arr1[i])\n            i += 1\n        else:\n            result.append(arr2[j])\n            j += 1\n    result.extend(arr1[i:])\n    result.extend(arr2[j:])\n    return result", "entry_point": "merge_sorted", "input": "[1, 4, 6, 8, 10], [2, 3, 5, 7, 9, 11]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002ge0p2bo2wdgr5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030764", "code": "def group_by(items, key_fn):\n    groups = {}\n    for item in items:\n        k = key_fn(item)\n        groups.setdefault(k, []).append(item)\n    return groups", "entry_point": "group_by", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], lambda x: 'even' if x % 2 == 0 else 'odd'", "output": "{'odd': [1, 3, 5, 7, 9], 'even': [2, 4, 6, 8]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002he0p22hij72ds", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030765", "code": "def is_balanced(s):\n    stack = []\n    pairs = {')': '(', ']': '[', '}': '{'}\n    for char in s:\n        if char in '([{':\n            stack.append(char)\n        elif char in ')]}' :\n            if not stack or stack[-1] != pairs[char]:\n                return False\n            stack.pop()\n    return len(stack) == 0", "entry_point": "is_balanced", "input": "'({[a+b]*c}-d)'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrbjijt002ie0p2ploixy71", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030766", "code": "def segment_sums(values):\n    out=[]\n    cur=0\n    for x in values:\n        if x is None:\n            out.append(cur)\n            cur=0\n        else:\n            cur += x\n    out.append(cur)\n    return out\n", "entry_point": "segment_sums", "input": "[2, 3, None, -1, 4, None, 7]", "output": "[5, 3, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrfjbt40023y8p2zp9ryms4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030767", "code": "def rotate_map(pairs, k):\n    d=dict(pairs)\n    keys=sorted(d)\n    return [(key, d[key] + i*k) for i, key in enumerate(keys)]\n", "entry_point": "rotate_map", "input": "[('b', 2), ('a', 5), ('c', 1)], 3", "output": "[('a', 5), ('b', 5), ('c', 7)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrfjbt40024y8p20wzabymf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030768", "code": "from collections import deque\n\ndef bounded_queue(values, limit):\n    q=deque()\n    dropped=[]\n    for x in values:\n        q.append(x)\n        if len(q)>limit:\n            dropped.append(q.popleft())\n    return list(q), dropped\n", "entry_point": "bounded_queue", "input": "[4, 1, 9, 2, 8], 3", "output": "([9, 2, 8], [4, 1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrfjbt40025y8p2xkup6vgq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030769", "code": "def parity_fold(nums):\n    acc=0\n    out=[]\n    for i,x in enumerate(nums):\n        acc = acc + x if i % 2 == 0 else acc - x\n        out.append(acc)\n    return out\n", "entry_point": "parity_fold", "input": "[5, 2, 7, 3]", "output": "[5, 3, 10, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrfjbt40026y8p2r6rccn9w", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030770", "code": "def lookup_chain(mapping, keys):\n    cur=mapping\n    for k in keys:\n        try:\n            cur=cur[k]\n        except (KeyError, TypeError, IndexError):\n            return 'missing'\n    return cur\n", "entry_point": "lookup_chain", "input": "{'a': {'b': [10, 20]}}, ['a', 'b', 1]", "output": "20", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrfjbt40027y8p2r6jeyxf8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030771", "code": "def safe_divide(a, b):\n    try:\n        return a / b\n    except ZeroDivisionError:\n        return None", "entry_point": "safe_divide", "input": "10, 2", "output": "5.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg4wst003xy8p2yo6ua2wo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030772", "code": "def count_chars(s):\n    from collections import Counter\n    return dict(Counter(s))", "entry_point": "count_chars", "input": "'banana'", "output": "{'b': 1, 'a': 3, 'n': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg4wsu003yy8p28085utng", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030773", "code": "class Stack:\n    def __init__(self):\n        self.items = []\n    def push(self, x):\n        self.items.append(x)\n    def pop(self):\n        return self.items.pop()\n\ndef stack_demo():\n    s = Stack()\n    s.push(1)\n    s.push(2)\n    s.push(3)\n    a = s.pop()\n    b = s.pop()\n    return (a, b, s.items)", "entry_point": "stack_demo", "input": "", "output": "(3, 2, [1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg4wsu003zy8p2018cqu42", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030774", "code": "def fib_gen(n):\n    a, b = 0, 1\n    result = []\n    for _ in range(n):\n        result.append(a)\n        a, b = b, a+b\n    return result", "entry_point": "fib_gen", "input": "7", "output": "[0, 1, 1, 2, 3, 5, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg4wsu0040y8p2c7nvrbmr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030775", "code": "def merge_dicts(d1, d2):\n    merged = d1.copy()\n    merged.update(d2)\n    return merged", "entry_point": "merge_dicts", "input": "{'a': 1, 'b': 2}, {'b': 3, 'c': 4}", "output": "{'a': 1, 'b': 3, 'c': 4}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg5dm70041y8p2gh9pyzno", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030776", "code": "def try_finally_demo():\n    log = []\n    try:\n        log.append('try')\n        raise ValueError('oops')\n    except ValueError as e:\n        log.append(f'caught: {e}')\n    finally:\n        log.append('finally')\n    return log", "entry_point": "try_finally_demo", "input": "", "output": "['try', 'caught: oops', 'finally']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg7uni0043y8p2g4jvoq9l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030777", "code": "def default_mutable(lst=[]):\n    lst.append(1)\n    return lst", "entry_point": "default_mutable", "input": "", "output": "[1, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg7uni0045y8p2l27dvf1s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030778", "code": "def zip_sum(a, b):\n    return [x+y for x, y in zip(a, b)]", "entry_point": "zip_sum", "input": "[1, 2, 3], [10, 20, 30, 40]", "output": "[11, 22, 33]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg7uni0048y8p25535s2zc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030779", "code": "def recursive_sum(lst):\n    if not lst:\n        return 0\n    return lst[0] + recursive_sum(lst[1:])", "entry_point": "recursive_sum", "input": "[1, 2, 3, 4, 5]", "output": "15", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg7uni004by8p20qbeqk5l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030780", "code": "def set_operations(a, b):\n    return {'union': sorted(a | b), 'intersection': sorted(a & b), 'diff': sorted(a - b)}", "entry_point": "set_operations", "input": "{1, 2, 3, 4}, {3, 4, 5, 6}", "output": "{'union': [1, 2, 3, 4, 5, 6], 'intersection': [3, 4], 'diff': [1, 2]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg7uni004cy8p2qi6wn2es", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030781", "code": "def slice_demo(s):\n    return (s[::2], s[::-1], s[1:4])", "entry_point": "slice_demo", "input": "'abcdefgh'", "output": "('aceg', 'hgfedcba', 'bcd')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8gp1004ey8p216tavi35", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030782", "code": "import itertools\ndef combo_demo(items, r):\n    return list(itertools.combinations(items, r))", "entry_point": "combo_demo", "input": "[1, 2, 3], 2", "output": "[(1, 2), (1, 3), (2, 3)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8gp1004fy8p2mri1qcdt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030783", "code": "def multiple_return(x):\n    if x > 0:\n        return 'positive', x\n    elif x < 0:\n        return 'negative', -x\n    return 'zero', 0", "entry_point": "multiple_return", "input": "5", "output": "('positive', 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8m8m004hy8p2zz9k68uw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030784", "code": "class Animal:\n    def speak(self):\n        return 'generic sound'\n\nclass Dog(Animal):\n    def speak(self):\n        return 'woof'\n\ndef animal_demo():\n    animals = [Animal(), Dog()]\n    return [a.speak() for a in animals]", "entry_point": "animal_demo", "input": "", "output": "['generic sound', 'woof']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8yka004iy8p25em8b0ah", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030785", "code": "def all_any_demo(nums):\n    return (all(n > 0 for n in nums), any(n < 0 for n in nums))", "entry_point": "all_any_demo", "input": "[1, 2, -3, 4]", "output": "(False, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8yka004ly8p2u05xfuat", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030786", "code": "def string_methods_demo(s):\n    return (s.strip().upper(), s.replace('a', 'X'), s.split(','))", "entry_point": "string_methods_demo", "input": "'  banana,apple,cherry  '", "output": "('BANANA,APPLE,CHERRY', '  bXnXnX,Xpple,cherry  ', ['  banana', 'apple', 'cherry  '])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8yka004my8p2jdapux77", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030787", "code": "def lambda_sort_demo(pairs):\n    return sorted(pairs, key=lambda p: (-p[1], p[0]))", "entry_point": "lambda_sort_demo", "input": "[('x', 1), ('y', 2), ('z', 1)]", "output": "[('y', 2), ('x', 1), ('z', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg8yka004ny8p25v3wlpjn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030788", "code": "def try_else_demo(x):\n    try:\n        result = 10 / x\n    except ZeroDivisionError:\n        return 'error'\n    else:\n        return round(result, 2)", "entry_point": "try_else_demo", "input": "2", "output": "5.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004oy8p21w1j15jr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030789", "code": "def list_vs_tuple_unpack():\n    a, *b, c = [1, 2, 3, 4, 5]\n    return (a, b, c)", "entry_point": "list_vs_tuple_unpack", "input": "", "output": "(1, [2, 3, 4], 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004py8p2rpodfc6u", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030790", "code": "def deep_copy_demo():\n    import copy\n    original = {'a': [1, 2, 3]}\n    shallow = original.copy()\n    deep = copy.deepcopy(original)\n    original['a'].append(4)\n    return (shallow, deep)", "entry_point": "deep_copy_demo", "input": "", "output": "({'a': [1, 2, 3, 4]}, {'a': [1, 2, 3]})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004qy8p20rzuom6z", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030791", "code": "def flatten_dict(d, prefix=''):\n    result = {}\n    for k, v in d.items():\n        key = f'{prefix}.{k}' if prefix else k\n        if isinstance(v, dict):\n            result.update(flatten_dict(v, key))\n        else:\n            result[key] = v\n    return result", "entry_point": "flatten_dict", "input": "{'a': 1, 'b': {'c': 2, 'd': {'e': 3}}}", "output": "{'a': 1, 'b.c': 2, 'b.d.e': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004sy8p2lwgsugub", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030792", "code": "def while_break_continue(n):\n    result = []\n    i = 0\n    while i < n:\n        i += 1\n        if i % 2 == 0:\n            continue\n        if i > 7:\n            break\n        result.append(i)\n    return result", "entry_point": "while_break_continue", "input": "10", "output": "[1, 3, 5, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004uy8p2zf0iwevd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030793", "code": "def multi_assignment():\n    x = y = z = 5\n    x += 1\n    return (x, y, z)", "entry_point": "multi_assignment", "input": "", "output": "(6, 5, 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004vy8p2zhhmofpv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030794", "code": "def chained_comparison(x):\n    return 0 < x < 10", "entry_point": "chained_comparison", "input": "5", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m71004xy8p2e2420igy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030795", "code": "def none_coalesce(a, b):\n    return a if a is not None else b", "entry_point": "none_coalesce", "input": "None, 5", "output": "5", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m710052y8p2usc5fzhe", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030796", "code": "def matrix_transpose(m):\n    return list(zip(*m))", "entry_point": "matrix_transpose", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[(1, 4), (2, 5), (3, 6)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m720053y8p2hmeho25y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030797", "code": "def negative_indexing(lst):\n    return (lst[-1], lst[-2], lst[-len(lst)])", "entry_point": "negative_indexing", "input": "[10, 20, 30, 40, 50]", "output": "(50, 40, 10)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m720057y8p2n5vw3bcj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030798", "code": "def dict_ordering():\n    d = {}\n    d['z'] = 1\n    d['a'] = 2\n    d['m'] = 3\n    return list(d.keys())", "entry_point": "dict_ordering", "input": "", "output": "['z', 'a', 'm']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrg9m720058y8p27saqul7r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030799", "code": "def window_sums(values, size):\n    return [sum(values[i:i+size]) for i in range(len(values)-size+1)]", "entry_point": "window_sums", "input": "[3, -1, 4, 2, 5], 3", "output": "[6, 5, 11]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira006yy8p2ue0o1c0t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030800", "code": "def window_sums(values, size):\n    return [sum(values[i:i+size]) for i in range(len(values)-size+1)]", "entry_point": "window_sums", "input": "[10, 0, -2, 7], 2", "output": "[10, -2, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira006zy8p2fisa3the", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030801", "code": "def alternating_total(values):\n    return sum(v if i % 2 == 0 else -v for i, v in enumerate(values))", "entry_point": "alternating_total", "input": "[8, 3, 5, 2]", "output": "8", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0070y8p2e0cka3t8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030802", "code": "def alternating_total(values):\n    return sum(v if i % 2 == 0 else -v for i, v in enumerate(values))", "entry_point": "alternating_total", "input": "[1, 9, 2, 8, 3]", "output": "-11", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0071y8p2xm72loa3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030803", "code": "def prefix_minima(values):\n    out=[]\n    cur=float('inf')\n    for v in values:\n        cur=min(cur,v); out.append(cur)\n    return out", "entry_point": "prefix_minima", "input": "[7, 4, 9, 2, 6]", "output": "[7, 4, 4, 2, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0072y8p27dh1pd1u", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030804", "code": "def prefix_minima(values):\n    out=[]\n    cur=float('inf')\n    for v in values:\n        cur=min(cur,v); out.append(cur)\n    return out", "entry_point": "prefix_minima", "input": "[0, -1, 3, -5, 2]", "output": "[0, -1, -1, -5, -5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0073y8p2ur4g0e1k", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030805", "code": "def bounded_product(values, cap):\n    total=1\n    for v in values:\n        total*=v\n        if total>cap: return cap\n    return total", "entry_point": "bounded_product", "input": "[2, 3, 5], 20", "output": "20", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0074y8p28tbrw2q9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030806", "code": "def bounded_product(values, cap):\n    total=1\n    for v in values:\n        total*=v\n        if total>cap: return cap\n    return total", "entry_point": "bounded_product", "input": "[2, 3, 2], 20", "output": "12", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0075y8p2azk2uw8v", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030807", "code": "def difference_chain(values):\n    rows=[values]\n    while len(rows[-1])>1:\n        prev=rows[-1]; rows.append([b-a for a,b in zip(prev,prev[1:])])\n    return rows", "entry_point": "difference_chain", "input": "[2, 5, 11, 20]", "output": "[[2, 5, 11, 20], [3, 6, 9], [3, 3], [0]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0076y8p2qn2o8osr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030808", "code": "def difference_chain(values):\n    rows=[values]\n    while len(rows[-1])>1:\n        prev=rows[-1]; rows.append([b-a for a,b in zip(prev,prev[1:])])\n    return rows", "entry_point": "difference_chain", "input": "[1, 4, 9, 16]", "output": "[[1, 4, 9, 16], [3, 5, 7], [2, 2], [0]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0077y8p2oaqbs5bc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030809", "code": "def rotate_blocks(values, size):\n    out=[]\n    for i in range(0,len(values),size):\n        block=values[i:i+size]\n        out.extend(block[1:]+block[:1])\n    return out", "entry_point": "rotate_blocks", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[2, 3, 1, 5, 6, 4, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0078y8p2rvl8xi8h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030810", "code": "def rotate_blocks(values, size):\n    out=[]\n    for i in range(0,len(values),size):\n        block=values[i:i+size]\n        out.extend(block[1:]+block[:1])\n    return out", "entry_point": "rotate_blocks", "input": "[9, 8, 7, 6, 5], 2", "output": "[8, 9, 6, 7, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira0079y8p2u2uyrxrf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030811", "code": "def count_transitions(values):\n    return sum(a != b for a,b in zip(values,values[1:]))", "entry_point": "count_transitions", "input": "[1, 1, 2, 2, 3, 1]", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira007ay8p2gfci6v3s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030812", "code": "def count_transitions(values):\n    return sum(a != b for a,b in zip(values,values[1:]))", "entry_point": "count_transitions", "input": "[5, 5, 5, 5]", "output": "0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira007by8p2zrqj9gzj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030813", "code": "def zigzag_merge(left, right):\n    out=[]\n    for i in range(max(len(left),len(right))):\n        if i<len(left): out.append(left[i])\n        if i<len(right): out.append(right[-1-i])\n    return out", "entry_point": "zigzag_merge", "input": "[1, 2, 3], [7, 8, 9, 10]", "output": "[1, 10, 2, 9, 3, 8, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0ira007cy8p2w3hnwz7m", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030814", "code": "def zigzag_merge(left, right):\n    out=[]\n    for i in range(max(len(left),len(right))):\n        if i<len(left): out.append(left[i])\n        if i<len(right): out.append(right[-1-i])\n    return out", "entry_point": "zigzag_merge", "input": "[4, 5], [1, 2]", "output": "[4, 2, 5, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007dy8p2swlfu0i2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030815", "code": "def rank_values(values):\n    order={v:i+1 for i,v in enumerate(sorted(set(values)))}\n    return [order[v] for v in values]", "entry_point": "rank_values", "input": "[40, 10, 20, 10]", "output": "[3, 1, 2, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007ey8p2q6vslrus", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030816", "code": "def rank_values(values):\n    order={v:i+1 for i,v in enumerate(sorted(set(values)))}\n    return [order[v] for v in values]", "entry_point": "rank_values", "input": "[3, -1, 3, 7, 0]", "output": "[3, 1, 3, 4, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007fy8p2tgcudf40", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030817", "code": "def clamped_deltas(values, limit):\n    return [max(-limit,min(limit,b-a)) for a,b in zip(values,values[1:])]", "entry_point": "clamped_deltas", "input": "[2, 10, 7, 20], 5", "output": "[5, -3, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007gy8p237joknta", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030818", "code": "def clamped_deltas(values, limit):\n    return [max(-limit,min(limit,b-a)) for a,b in zip(values,values[1:])]", "entry_point": "clamped_deltas", "input": "[0, -9, -8, 4], 3", "output": "[-3, 1, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007hy8p2vo0hxq2e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030819", "code": "def pair_products(values):\n    return [values[i]*values[-1-i] for i in range((len(values)+1)//2)]", "entry_point": "pair_products", "input": "[2, 3, 4, 5]", "output": "[10, 12]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007iy8p2avuq2cud", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030820", "code": "def pair_products(values):\n    return [values[i]*values[-1-i] for i in range((len(values)+1)//2)]", "entry_point": "pair_products", "input": "[1, -2, 3, -4, 5]", "output": "[5, 8, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007jy8p2yvj5e5l8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030821", "code": "def running_mod(values, modulus):\n    total=0; out=[]\n    for v in values:\n        total=(total+v)%modulus; out.append(total)\n    return out", "entry_point": "running_mod", "input": "[7, 8, 9, 10], 6", "output": "[1, 3, 0, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007ky8p26yzmg5q4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030822", "code": "def running_mod(values, modulus):\n    total=0; out=[]\n    for v in values:\n        total=(total+v)%modulus; out.append(total)\n    return out", "entry_point": "running_mod", "input": "[5, -3, 11], 7", "output": "[5, 2, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007ly8p23qizndaa", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030823", "code": "def collapse_runs(values):\n    out=[]\n    for v in values:\n        if not out or out[-1]!=v: out.append(v)\n    return out", "entry_point": "collapse_runs", "input": "[1, 1, 2, 2, 2, 3, 1, 1]", "output": "[1, 2, 3, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007my8p2ojvpe7z5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030824", "code": "def collapse_runs(values):\n    out=[]\n    for v in values:\n        if not out or out[-1]!=v: out.append(v)\n    return out", "entry_point": "collapse_runs", "input": "[4, 4, 4, 2, 4]", "output": "[4, 2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007ny8p2vz7lc94h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030825", "code": "def weighted_index(values):\n    return sum((i+1)*v for i,v in enumerate(values))", "entry_point": "weighted_index", "input": "[3, 1, 4, 1]", "output": "21", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007oy8p28cp1yv48", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030826", "code": "def weighted_index(values):\n    return sum((i+1)*v for i,v in enumerate(values))", "entry_point": "weighted_index", "input": "[2, -1, 5]", "output": "15", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007py8p2z6jobb6t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030827", "code": "def mirror_sum(values):\n    return [a+b for a,b in zip(values,reversed(values))]", "entry_point": "mirror_sum", "input": "[1, 2, 3, 4]", "output": "[5, 5, 5, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007qy8p2vtblkhdh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030828", "code": "def mirror_sum(values):\n    return [a+b for a,b in zip(values,reversed(values))]", "entry_point": "mirror_sum", "input": "[5, -1, 0]", "output": "[5, -2, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007ry8p2f438nggp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030829", "code": "def threshold_groups(values, threshold):\n    low=[v for v in values if v<threshold]\n    high=[v for v in values if v>=threshold]\n    return [low,high]", "entry_point": "threshold_groups", "input": "[8, 2, 7, 1, 9], 7", "output": "[[2, 1], [8, 7, 9]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007sy8p2y72alqu5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030830", "code": "def threshold_groups(values, threshold):\n    low=[v for v in values if v<threshold]\n    high=[v for v in values if v>=threshold]\n    return [low,high]", "entry_point": "threshold_groups", "input": "[0, -3, 4, 2], 1", "output": "[[0, -3], [4, 2]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007ty8p2pggu1z24", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030831", "code": "def circular_differences(values):\n    return [values[(i+1)%len(values)]-v for i,v in enumerate(values)]", "entry_point": "circular_differences", "input": "[2, 5, 9]", "output": "[3, 4, -7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007uy8p2x9dmda5k", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030832", "code": "def circular_differences(values):\n    return [values[(i+1)%len(values)]-v for i,v in enumerate(values)]", "entry_point": "circular_differences", "input": "[10, 7, 7, 1]", "output": "[-3, 0, -6, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007vy8p2qysol362", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030833", "code": "def take_until_repeat(values):\n    seen=set(); out=[]\n    for v in values:\n        if v in seen: break\n        seen.add(v); out.append(v)\n    return out", "entry_point": "take_until_repeat", "input": "[3, 1, 4, 1, 5]", "output": "[3, 1, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007wy8p2ejpsimh6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030834", "code": "def take_until_repeat(values):\n    seen=set(); out=[]\n    for v in values:\n        if v in seen: break\n        seen.add(v); out.append(v)\n    return out", "entry_point": "take_until_repeat", "input": "[2, 7, 9, 2]", "output": "[2, 7, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007xy8p2mmxsf0yf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030835", "code": "def staircase_fill(start, steps):\n    out=[]; value=start\n    for step in steps:\n        value+=step; out.append(value)\n    return out", "entry_point": "staircase_fill", "input": "10, [1, 2, -3, 4]", "output": "[11, 13, 10, 14]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007yy8p2i50oegnp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030836", "code": "def staircase_fill(start, steps):\n    out=[]; value=start\n    for step in steps:\n        value+=step; out.append(value)\n    return out", "entry_point": "staircase_fill", "input": "0, [5, -2, -2, 1]", "output": "[5, 3, 1, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb007zy8p24vmuhwit", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030837", "code": "def odd_even_balance(values):\n    return sum(v for v in values if v%2)-sum(v for v in values if v%2==0)", "entry_point": "odd_even_balance", "input": "[1, 2, 3, 4, 5]", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0080y8p25vqmwvbc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030838", "code": "def odd_even_balance(values):\n    return sum(v for v in values if v%2)-sum(v for v in values if v%2==0)", "entry_point": "odd_even_balance", "input": "[6, 7, 8, 9]", "output": "2", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0081y8p2bii3i3wi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030839", "code": "def bounded_gaps(values, bound):\n    return [abs(b-a)<=bound for a,b in zip(values,values[1:])]", "entry_point": "bounded_gaps", "input": "[1, 4, 8, 10], 3", "output": "[True, False, True]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0082y8p2c133kyls", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030840", "code": "def bounded_gaps(values, bound):\n    return [abs(b-a)<=bound for a,b in zip(values,values[1:])]", "entry_point": "bounded_gaps", "input": "[5, 1, 0, 7], 4", "output": "[True, True, False]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0083y8p2u7creluo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030841", "code": "def segment_totals(values, marker):\n    out=[]; total=0\n    for v in values:\n        if v==marker: out.append(total); total=0\n        else: total+=v\n    out.append(total)\n    return out", "entry_point": "segment_totals", "input": "[2, 3, 0, 4, 0, 5, 1], 0", "output": "[5, 4, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0084y8p2gw6cg11i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030842", "code": "def segment_totals(values, marker):\n    out=[]; total=0\n    for v in values:\n        if v==marker: out.append(total); total=0\n        else: total+=v\n    out.append(total)\n    return out", "entry_point": "segment_totals", "input": "[1, -1, 9, 2, 9, 3], 9", "output": "[0, 2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0085y8p22078tuy1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030843", "code": "def index_peaks(values):\n    return [i for i in range(1,len(values)-1) if values[i]>values[i-1] and values[i]>values[i+1]]", "entry_point": "index_peaks", "input": "[1, 5, 2, 6, 3, 4]", "output": "[1, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0086y8p2wbqhfwfj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030844", "code": "def index_peaks(values):\n    return [i for i in range(1,len(values)-1) if values[i]>values[i-1] and values[i]>values[i+1]]", "entry_point": "index_peaks", "input": "[9, 8, 7, 8, 7]", "output": "[3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0087y8p2k2mjhsg2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030845", "code": "def rolling_range(values, size):\n    return [max(values[i:i+size])-min(values[i:i+size]) for i in range(len(values)-size+1)]", "entry_point": "rolling_range", "input": "[3, 8, 2, 7, 5], 3", "output": "[6, 6, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0088y8p2zczm29bs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030846", "code": "def rolling_range(values, size):\n    return [max(values[i:i+size])-min(values[i:i+size]) for i in range(len(values)-size+1)]", "entry_point": "rolling_range", "input": "[10, 9, 6, 8], 2", "output": "[1, 3, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb0089y8p2r3b89c5r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030847", "code": "def stable_partition(values, divisor):\n    return [v for v in values if v%divisor==0]+[v for v in values if v%divisor!=0]", "entry_point": "stable_partition", "input": "[5, 6, 4, 9, 8], 2", "output": "[6, 4, 8, 5, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb008ay8p26g7zoed1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030848", "code": "def stable_partition(values, divisor):\n    return [v for v in values if v%divisor==0]+[v for v in values if v%divisor!=0]", "entry_point": "stable_partition", "input": "[3, 10, 15, 8, 20], 5", "output": "[10, 15, 20, 3, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrh0irb008by8p2fiif8dfg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030849", "code": "def merge_intervals(intervals):\n    intervals = sorted(intervals)\n    merged = []\n    for start, end in intervals:\n        if merged and start <= merged[-1][1]:\n            merged[-1] = (merged[-1][0], max(merged[-1][1], end))\n        else:\n            merged.append((start, end))\n    return merged", "entry_point": "merge_intervals", "input": "[(5, 8), (1, 3), (2, 6), (10, 12)]", "output": "[(1, 8), (10, 12)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iip0000jmp283390488", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030850", "code": "def rotate_and_flag(matrix):\n    rotated = [list(row) for row in zip(*matrix[::-1])]\n    flags = [sum(row) % 2 == 0 for row in rotated]\n    return rotated, flags", "entry_point": "rotate_and_flag", "input": "[[1, 2], [3, 4]]", "output": "([[3, 1], [4, 2]], [True, True])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0001jmp2o0hw4p3t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030851", "code": "def parse_versions(tags):\n    parsed = []\n    for tag in tags:\n        try:\n            parts = tuple(int(p) for p in tag.lstrip('v').split('.'))\n            parsed.append(parts)\n        except ValueError:\n            parsed.append(None)\n    return sorted(p for p in parsed if p is not None), parsed.count(None)", "entry_point": "parse_versions", "input": "['v1.2.10', 'v1.2.3', 'beta', 'v0.9']", "output": "([(0, 9), (1, 2, 3), (1, 2, 10)], 1)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0002jmp233jr833y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030852", "code": "def dedupe_keep_last(pairs):\n    seen = {}\n    for key, value in pairs:\n        seen[key] = value\n    return list(seen.items())", "entry_point": "dedupe_keep_last", "input": "[('a', 1), ('b', 2), ('a', 3), ('c', 4), ('b', 5)]", "output": "[('a', 3), ('b', 5), ('c', 4)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0003jmp2go483anz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030853", "code": "def bucket_grades(scores):\n    buckets = {'high': [], 'mid': [], 'low': []}\n    for name, score in scores.items():\n        key = 'high' if score >= 85 else 'mid' if score >= 60 else 'low'\n        buckets[key].append(name)\n    return {k: sorted(v) for k, v in buckets.items() if v}", "entry_point": "bucket_grades", "input": "{'ana': 91, 'bo': 60, 'cy': 59, 'di': 85}", "output": "{'high': ['ana', 'di'], 'mid': ['bo'], 'low': ['cy']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0004jmp2waisuzyp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030854", "code": "def safe_lookup_chain(data, path):\n    current = data\n    trail = []\n    for key in path.split('.'):\n        try:\n            current = current[key]\n            trail.append(key)\n        except (KeyError, TypeError):\n            return {'found': False, 'trail': trail}\n    return {'found': True, 'value': current, 'trail': trail}", "entry_point": "safe_lookup_chain", "input": "{'a': {'b': {'c': 7}}}, 'a.b.x'", "output": "{'found': False, 'trail': ['a', 'b']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0006jmp2d7atu5qv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030855", "code": "def window_max(values, k):\n    if k <= 0 or k > len(values):\n        raise ValueError('bad window')\n    return [max(values[i:i + k]) for i in range(len(values) - k + 1)]\n\ndef try_windows(values, sizes):\n    out = {}\n    for k in sizes:\n        try:\n            out[k] = window_max(values, k)\n        except ValueError as e:\n            out[k] = str(e)\n    return out", "entry_point": "try_windows", "input": "[3, 1, 4, 1, 5], [2, 6]", "output": "{2: [3, 4, 4, 5], 6: 'bad window'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0007jmp2a5k9bh05", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030856", "code": "def interleave_uneven(*seqs):\n    result = []\n    i = 0\n    while any(i < len(s) for s in seqs):\n        for s in seqs:\n            if i < len(s):\n                result.append(s[i])\n        i += 1\n    return result", "entry_point": "interleave_uneven", "input": "[1, 2, 3], ['a'], [True, False]", "output": "[1, 'a', True, 2, False, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0008jmp2bbg6qua1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030857", "code": "def balance_report(entries):\n    balance = 0\n    low = 0\n    overdrafts = 0\n    for amount in entries:\n        balance += amount\n        if balance < low:\n            low = balance\n        if balance < 0:\n            overdrafts += 1\n    return {'final': balance, 'lowest': low, 'overdraft_steps': overdrafts}", "entry_point": "balance_report", "input": "[100, -150, 30, -20, 80]", "output": "{'final': 40, 'lowest': -50, 'overdraft_steps': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq0009jmp24nfyyby8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030858", "code": "def expand_ranges(spec):\n    pages = set()\n    for part in spec.split(','):\n        part = part.strip()\n        if '-' in part:\n            a, b = part.split('-')\n            pages.update(range(int(a), int(b) + 1))\n        else:\n            pages.add(int(part))\n    return sorted(pages)", "entry_point": "expand_ranges", "input": "'1, 4-6, 5, 9'", "output": "[1, 4, 5, 6, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq000ajmp26a8mrqmq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030859", "code": "def summarize_types(values):\n    from collections import Counter\n    counts = Counter(type(v).__name__ for v in values)\n    return sorted(counts.items(), key=lambda kv: (-kv[1], kv[0]))", "entry_point": "summarize_types", "input": "[1, 'a', 2.0, True, 'b', None, 3]", "output": "[('int', 2), ('str', 2), ('NoneType', 1), ('bool', 1), ('float', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsrk8iiq000bjmp2t4okouzv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030860", "code": "def flatten_once(nested):\n    result = []\n    for item in nested:\n        if isinstance(item, list):\n            result.extend(item)\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten_once", "input": "[[1, 2], 3, [4, [5, 6]]]", "output": "[1, 2, 3, 4, [5, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007gjmp24693qh9o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030861", "code": "def count_vowels(s):\n    vowels = set('aeiouAEIOU')\n    return sum(1 for ch in s if ch in vowels)", "entry_point": "count_vowels", "input": "'Hello World'", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007hjmp24m04bdab", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030862", "code": "def merge_dicts_sum(d1, d2):\n    result = dict(d1)\n    for k, v in d2.items():\n        result[k] = result.get(k, 0) + v\n    return result", "entry_point": "merge_dicts_sum", "input": "{'a': 1, 'b': 2}, {'b': 3, 'c': 4}", "output": "{'a': 1, 'b': 5, 'c': 4}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007ijmp21vviay6o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030863", "code": "def rotating_cipher(text, shift):\n    result = []\n    for ch in text:\n        if ch.isalpha():\n            base = ord('A') if ch.isupper() else ord('a')\n            result.append(chr((ord(ch) - base + shift) % 26 + base))\n        else:\n            result.append(ch)\n    return ''.join(result)", "entry_point": "rotating_cipher", "input": "'Xyz!', 3", "output": "'Abc!'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007jjmp2rfwsojd9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030864", "code": "def partition_even_odd(nums):\n    evens = [x for x in nums if x % 2 == 0]\n    odds = [x for x in nums if x % 2 != 0]\n    return evens, odds", "entry_point": "partition_even_odd", "input": "[1, 2, 3, 4, 5, 6]", "output": "([2, 4, 6], [1, 3, 5])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007kjmp2dfwba04x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030865", "code": "def cumulative_max(values):\n    if not values:\n        return []\n    result = [values[0]]\n    for v in values[1:]:\n        result.append(max(result[-1], v))\n    return result", "entry_point": "cumulative_max", "input": "[3, 1, 4, 1, 5, 9, 2, 6]", "output": "[3, 3, 4, 4, 5, 9, 9, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007ljmp29yn7yjjx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030866", "code": "def word_frequency(sentence):\n    freq = {}\n    for word in sentence.split():\n        freq[word] = freq.get(word, 0) + 1\n    return freq", "entry_point": "word_frequency", "input": "'the cat sat on the mat the cat'", "output": "{'the': 3, 'cat': 2, 'sat': 1, 'on': 1, 'mat': 1}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007mjmp2lafub73t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030867", "code": "def safe_divide(a, b):\n    try:\n        result = a / b\n    except ZeroDivisionError:\n        return (None, 'division by zero')\n    return (result, 'ok')", "entry_point": "safe_divide", "input": "10, 4", "output": "(2.5, 'ok')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007njmp2p0ghw1j2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030868", "code": "def deduplicate_preserve_order(seq):\n    seen = set()\n    result = []\n    for item in seq:\n        if item not in seen:\n            seen.add(item)\n            result.append(item)\n    return result", "entry_point": "deduplicate_preserve_order", "input": "[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]", "output": "[3, 1, 4, 5, 9, 2, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007ojmp2zjk35ocu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030869", "code": "def matrix_diagonal_sum(matrix):\n    return sum(matrix[i][i] for i in range(len(matrix)))", "entry_point": "matrix_diagonal_sum", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "15", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007pjmp2f7lww1cf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030870", "code": "def chunked(lst, n):\n    return [lst[i:i+n] for i in range(0, len(lst), n)]", "entry_point": "chunked", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007qjmp2uwfw24av", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030871", "code": "def clamp(value, lo, hi):\n    return max(lo, min(value, hi))\n\ndef clamp_list(values, lo, hi):\n    return [clamp(v, lo, hi) for v in values]", "entry_point": "clamp_list", "input": "[-5, 0, 3, 7, 10, 15], 0, 10", "output": "[0, 0, 3, 7, 10, 10]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007rjmp2bmcjmm3r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030872", "code": "def nested_sum(data):\n    total = 0\n    for item in data:\n        if isinstance(item, list):\n            total += nested_sum(item)\n        else:\n            total += item\n    return total", "entry_point": "nested_sum", "input": "[1, [2, 3], [4, [5, 6]], 7]", "output": "28", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007sjmp2mw7ivr38", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030873", "code": "def most_common(items):\n    freq = {}\n    for item in items:\n        freq[item] = freq.get(item, 0) + 1\n    return max(freq, key=freq.get)", "entry_point": "most_common", "input": "['apple', 'banana', 'apple', 'cherry', 'banana', 'apple']", "output": "'apple'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007tjmp2d7sbal7k", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030874", "code": "def zip_with_index(items, start=0):\n    return [(i + start, item) for i, item in enumerate(items)]", "entry_point": "zip_with_index", "input": "['a', 'b', 'c'], start=1", "output": "[(1, 'a'), (2, 'b'), (3, 'c')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007ujmp2jglrz2a4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030875", "code": "def interleave(a, b):\n    result = []\n    for x, y in zip(a, b):\n        result.extend([x, y])\n    if len(a) > len(b):\n        result.extend(a[len(b):])\n    elif len(b) > len(a):\n        result.extend(b[len(a):])\n    return result", "entry_point": "interleave", "input": "[1, 3, 5], [2, 4]", "output": "[1, 2, 3, 4, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007wjmp2wmzkgzkt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030876", "code": "def transpose(matrix):\n    if not matrix or not matrix[0]:\n        return []\n    return [[row[i] for row in matrix] for i in range(len(matrix[0]))]", "entry_point": "transpose", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[1, 4], [2, 5], [3, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3ma007xjmp2kzoylwhw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030877", "code": "def count_palindromes(words):\n    return sum(1 for w in words if w == w[::-1])", "entry_point": "count_palindromes", "input": "['racecar', 'hello', 'level', 'world', 'madam']", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb007yjmp2im72inmd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030878", "code": "def group_by_first_letter(words):\n    groups = {}\n    for word in words:\n        key = word[0].lower()\n        groups.setdefault(key, []).append(word)\n    return groups", "entry_point": "group_by_first_letter", "input": "['Apple', 'ant', 'Banana', 'bee', 'avocado']", "output": "{'a': ['Apple', 'ant', 'avocado'], 'b': ['Banana', 'bee']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb007zjmp2qtd1s1fg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030879", "code": "def sliding_window_sum(lst, window):\n    if window > len(lst):\n        return []\n    return [sum(lst[i:i+window]) for i in range(len(lst) - window + 1)]", "entry_point": "sliding_window_sum", "input": "[1, 2, 3, 4, 5], 3", "output": "[6, 9, 12]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb0080jmp2fj12d96t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030880", "code": "def compress_runs(lst):\n    if not lst:\n        return []\n    result = [(lst[0], 1)]\n    for item in lst[1:]:\n        if item == result[-1][0]:\n            result[-1] = (result[-1][0], result[-1][1] + 1)\n        else:\n            result.append((item, 1))\n    return result", "entry_point": "compress_runs", "input": "[1, 1, 2, 3, 3, 3, 1]", "output": "[(1, 2), (2, 1), (3, 3), (1, 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb0081jmp2j3d25r6e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030881", "code": "def invert_dict(d):\n    inverted = {}\n    for k, v in d.items():\n        inverted.setdefault(v, []).append(k)\n    return inverted", "entry_point": "invert_dict", "input": "{'a': 1, 'b': 2, 'c': 1, 'd': 3}", "output": "{1: ['a', 'c'], 2: ['b'], 3: ['d']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb0082jmp2aoyfmgov", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030882", "code": "def apply_until_stable(func, value, max_steps=100):\n    for _ in range(max_steps):\n        next_val = func(value)\n        if next_val == value:\n            return value\n        value = next_val\n    return value", "entry_point": "apply_until_stable", "input": "lambda x: x // 2 if x > 1 else x, 64", "output": "1", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb0083jmp2tsp9n5bk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030883", "code": "def parse_key_value(pairs, sep='='):\n    result = {}\n    for pair in pairs:\n        if sep in pair:\n            k, _, v = pair.partition(sep)\n            result[k.strip()] = v.strip()\n    return result", "entry_point": "parse_key_value", "input": "['name = Alice', 'age = 30', 'invalid', 'city = Paris']", "output": "{'name': 'Alice', 'age': '30', 'city': 'Paris'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssht3mb0084jmp28kds0eff", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030884", "code": "def running_median(values):\n    import heapq\n    lo, hi = [], []\n    result = []\n    for v in values:\n        if not lo or v <= -lo[0]:\n            heapq.heappush(lo, -v)\n        else:\n            heapq.heappush(hi, v)\n        if len(lo) > len(hi) + 1:\n            heapq.heappush(hi, -heapq.heappop(lo))\n        elif len(hi) > len(lo):\n            heapq.heappush(lo, -heapq.heappop(hi))\n        if len(lo) == len(hi):\n            result.append((-lo[0] + hi[0]) / 2)\n        else:\n            result.append(float(-lo[0]))\n    return result", "entry_point": "running_median", "input": "[5, 2, 8, 1, 9]", "output": "[5.0, 3.5, 5.0, 3.5, 5.0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshvjsl00a8jmp2e2m89pfo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030885", "code": "def word_frequencies_top_n(text, n):\n    import re\n    from collections import Counter\n    words = re.findall(r\"[a-z']+\", text.lower())\n    counts = Counter(words)\n    return sorted(counts.items(), key=lambda kv: (-kv[1], kv[0]))[:n]", "entry_point": "word_frequencies_top_n", "input": "'The quick brown fox. The Fox jumps! the dog barks, the dog runs.', 3", "output": "[('the', 4), ('dog', 2), ('fox', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshxe3w00bnjmp2l5a00u7g", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030886", "code": "def safe_divide_chain(pairs):\n    results = []\n    for a, b in pairs:\n        try:\n            results.append(a / b)\n        except ZeroDivisionError:\n            results.append(None)\n        except TypeError:\n            results.append('type_error')\n    return results", "entry_point": "safe_divide_chain", "input": "[(10, 2), (5, 0), ('x', 2), (9, 3)]", "output": "[5.0, None, 'type_error', 3.0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshxwcg00bojmp2kbm7qxyi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030887", "code": "def memoized_fib(n, cache=None):\n    if cache is None:\n        cache = {}\n    if n in cache:\n        return cache[n]\n    if n <= 1:\n        return n\n    result = memoized_fib(n - 1, cache) + memoized_fib(n - 2, cache)\n    cache[n] = result\n    return result\n\ndef fib_sequence(count):\n    return [memoized_fib(i) for i in range(count)]", "entry_point": "fib_sequence", "input": "10", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshypqd00bpjmp2yjz9ar9r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030888", "code": "def flatten_nested(data, depth=0):\n    result = []\n    for item in data:\n        if isinstance(item, list) and depth < 2:\n            result.extend(flatten_nested(item, depth + 1))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten_nested", "input": "[1, [2, 3, [4, [5, 6]]], 7, [8]]", "output": "[1, 2, 3, 4, [5, 6], 7, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3200bqjmp2yddnr01j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030889", "code": "def group_anagrams(words):\n    groups = {}\n    for w in words:\n        key = ''.join(sorted(w))\n        groups.setdefault(key, []).append(w)\n    return sorted(groups.values(), key=lambda g: (-len(g), g[0]))", "entry_point": "group_anagrams", "input": "['eat', 'tea', 'tan', 'ate', 'nat', 'bat']", "output": "[['eat', 'tea', 'ate'], ['tan', 'nat'], ['bat']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300brjmp25ku495m8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030890", "code": "def sliding_window_max(nums, k):\n    from collections import deque\n    dq = deque()\n    result = []\n    for i, n in enumerate(nums):\n        while dq and nums[dq[-1]] <= n:\n            dq.pop()\n        dq.append(i)\n        if dq[0] <= i - k:\n            dq.popleft()\n        if i >= k - 1:\n            result.append(nums[dq[0]])\n    return result", "entry_point": "sliding_window_max", "input": "[1, 3, -1, -3, 5, 3, 6, 7], 3", "output": "[3, 3, 5, 5, 6, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300bsjmp2mnt4tg5r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030891", "code": "class RateLimiter:\n    def __init__(self, limit):\n        self.limit = limit\n        self.count = 0\n        self.history = []\n\n    def allow(self, ts):\n        self.history = [t for t in self.history if t > ts - 10]\n        if len(self.history) < self.limit:\n            self.history.append(ts)\n            return True\n        return False\n\ndef simulate(events):\n    rl = RateLimiter(2)\n    return [rl.allow(t) for t in events]", "entry_point": "simulate", "input": "[1, 2, 3, 12, 13, 25]", "output": "[True, True, False, True, True, True]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300btjmp2gd4k94bj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030892", "code": "def matrix_transpose_and_sum(matrix):\n    transposed = list(zip(*matrix))\n    row_sums = [sum(row) for row in transposed]\n    return transposed, row_sums", "entry_point": "matrix_transpose_and_sum", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "([(1, 4), (2, 5), (3, 6)], [5, 7, 9])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300bujmp2rc52bm9l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030893", "code": "def parse_kv_config(text):\n    config = {}\n    for line in text.strip().split('\\n'):\n        line = line.strip()\n        if not line or line.startswith('#'):\n            continue\n        if '=' not in line:\n            raise ValueError(f'bad line: {line}')\n        k, v = line.split('=', 1)\n        k, v = k.strip(), v.strip()\n        if v.isdigit():\n            v = int(v)\n        elif v in ('true', 'false'):\n            v = v == 'true'\n        config[k] = v\n    return config", "entry_point": "parse_kv_config", "input": "'# config\\nhost = localhost\\nport=8080\\ndebug=true\\n\\nretries = 3'", "output": "{'host': 'localhost', 'port': 8080, 'debug': True, 'retries': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300bvjmp2jhqmnf7o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030894", "code": "def decorator_call_counter():\n    calls = {}\n    def decorator(fn):\n        def wrapper(*args):\n            calls[fn.__name__] = calls.get(fn.__name__, 0) + 1\n            return fn(*args)\n        return wrapper\n    return decorator, calls\n\ndef build():\n    dec, calls = decorator_call_counter()\n\n    @dec\n    def add(a, b):\n        return a + b\n\n    results = [add(1, 2), add(3, 4), add(5, 6)]\n    return results, calls", "entry_point": "build", "input": "", "output": "([3, 7, 11], {'add': 3})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300bwjmp24h0r63l9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030895", "code": "def bracket_validity_stack(s):\n    pairs = {')': '(', ']': '[', '}': '{'}\n    stack = []\n    for ch in s:\n        if ch in '([{':\n            stack.append(ch)\n        elif ch in ')]}':\n            if not stack or stack.pop() != pairs[ch]:\n                return False\n    return not stack\n\ndef check_all(strings):\n    return [bracket_validity_stack(s) for s in strings]", "entry_point": "check_all", "input": "['(a[b]{c})', '([)]', '((()))', '{[()]}(']", "output": "[True, False, True, False]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300bxjmp2jfcuteta", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030896", "code": "def generator_chain(n):\n    def evens():\n        for i in range(n):\n            if i % 2 == 0:\n                yield i\n    def squares(gen):\n        for v in gen:\n            yield v * v\n    return list(squares(evens()))", "entry_point": "generator_chain", "input": "10", "output": "[0, 4, 16, 36, 64]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300byjmp22g0rf2od", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030897", "code": "def dedupe_preserve_order_with_key(items, key):\n    seen = set()\n    result = []\n    for item in items:\n        k = key(item)\n        if k not in seen:\n            seen.add(k)\n            result.append(item)\n    return result\n\ndef dedupe_by_id(items):\n    return dedupe_preserve_order_with_key(items, lambda d: d['id'])", "entry_point": "dedupe_by_id", "input": "[{'id': 1, 'v': 'a'}, {'id': 2, 'v': 'b'}, {'id': 1, 'v': 'c'}]", "output": "[{'id': 1, 'v': 'a'}, {'id': 2, 'v': 'b'}]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300bzjmp21oo82fux", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030898", "code": "def custom_exception_chain():\n    class ValidationError(Exception):\n        pass\n\n    def validate(age):\n        if age < 0:\n            raise ValidationError('negative age')\n        if age > 150:\n            raise ValidationError('unrealistic age')\n        return age\n\n    results = []\n    for age in [25, -5, 200, 40]:\n        try:\n            results.append(validate(age))\n        except ValidationError as e:\n            results.append(str(e))\n    return results", "entry_point": "custom_exception_chain", "input": "", "output": "[25, 'negative age', 'unrealistic age', 40]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300c0jmp2z1klnw2h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030899", "code": "def binary_search_insert_position(sorted_list, targets):\n    import bisect\n    return [bisect.bisect_left(sorted_list, t) for t in targets]", "entry_point": "binary_search_insert_position", "input": "[1, 3, 5, 7, 9, 11], [0, 4, 5, 12, 8]", "output": "[0, 2, 2, 6, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300c1jmp2kthupyjq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030900", "code": "def context_manager_log():\n    log = []\n\n    class Timer:\n        def __init__(self, name):\n            self.name = name\n        def __enter__(self):\n            log.append(f'enter:{self.name}')\n            return self\n        def __exit__(self, exc_type, exc_val, exc_tb):\n            log.append(f'exit:{self.name}')\n            return exc_type is ValueError\n\n    with Timer('a'):\n        log.append('inside_a')\n    try:\n        with Timer('b'):\n            log.append('inside_b')\n            raise ValueError('boom')\n    except ValueError:\n        log.append('caught_outside')\n    return log", "entry_point": "context_manager_log", "input": "", "output": "['enter:a', 'inside_a', 'exit:a', 'enter:b', 'inside_b', 'exit:b']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300c2jmp2139cqdf8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030901", "code": "def multi_key_sort_with_ties(records):\n    return sorted(records, key=lambda r: (-r['score'], r['name']))", "entry_point": "multi_key_sort_with_ties", "input": "[{'name': 'bob', 'score': 90}, {'name': 'amy', 'score': 90}, {'name': 'cid', 'score': 95}, {'name': 'ann', 'score': 90}]", "output": "[{'name': 'cid', 'score': 95}, {'name': 'amy', 'score': 90}, {'name': 'ann', 'score': 90}, {'name': 'bob', 'score': 90}]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsshzf3300c3jmp2umrfq2xl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030902", "code": "def countdown(n):\n    while n > 0:\n        yield n\n        n -= 1\n\ndef take_then_check(n, k):\n    gen = countdown(n)\n    taken = []\n    exhausted_early = False\n    for _ in range(k):\n        try:\n            taken.append(next(gen))\n        except StopIteration:\n            exhausted_early = True\n            break\n    remaining = list(gen)\n    return taken, remaining, exhausted_early", "entry_point": "take_then_check", "input": "3, 5", "output": "([3, 2, 1], [], True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssibcce00fijmp25knukchb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030903", "code": "def classify(n):\n    log = []\n    try:\n        if n == 0:\n            raise ZeroDivisionError(\"zero\")\n        result = 100 / n\n    except ZeroDivisionError as e:\n        log.append(f\"error:{e}\")\n        result = None\n    else:\n        log.append(\"no-error\")\n    finally:\n        log.append(\"done\")\n    return result, log", "entry_point": "classify", "input": "0", "output": "(None, ['error:zero', 'done'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssic2tm00fjjmp2sjbrdya3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030904", "code": "def word_stats(words):\n    lengths = {w: len(w) for w in words if not w.startswith(\"_\")}\n    unique_lengths = {len(w) for w in words if len(w) > 2}\n    return lengths, sorted(unique_lengths)", "entry_point": "word_stats", "input": "['hi', '_skip', 'hello', 'ok', 'world', '_x']", "output": "({'hi': 2, 'hello': 5, 'ok': 2, 'world': 5}, [5])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00g6jmp2su60wlfg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030905", "code": "import itertools\n\ndef group_consecutive(values):\n    result = []\n    for key, group in itertools.groupby(values):\n        result.append((key, len(list(group))))\n    return result", "entry_point": "group_consecutive", "input": "[1, 1, 2, 2, 2, 1, 3, 3]", "output": "[(1, 2), (2, 3), (1, 1), (3, 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00g8jmp225vepn84", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030906", "code": "def rank_scores(entries):\n    return sorted(entries, key=lambda e: (-e[1], e[0]))", "entry_point": "rank_scores", "input": "[('bob', 90), ('amy', 95), ('cid', 90), ('dee', 95), ('al', 90)]", "output": "[('amy', 95), ('dee', 95), ('al', 90), ('bob', 90), ('cid', 90)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00g9jmp2gbetuiq4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030907", "code": "def accumulate(value, bucket=[]):\n    bucket.append(value)\n    return bucket", "entry_point": "accumulate", "input": "1", "output": "[1, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00gajmp2rvt5ru5a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030908", "code": "class SuppressValueError:\n    def __enter__(self):\n        return self\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        return exc_type is ValueError\n\ndef run_with_suppress():\n    log = []\n    with SuppressValueError():\n        log.append(\"before\")\n        raise ValueError(\"bad\")\n        log.append(\"never\")\n    log.append(\"after\")\n    return log", "entry_point": "run_with_suppress", "input": "", "output": "['before', 'after']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00gbjmp26857gtmw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030909", "code": "class Temperature:\n    def __init__(self, celsius):\n        self._celsius = celsius\n\n    @property\n    def celsius(self):\n        return self._celsius\n\n    @celsius.setter\n    def celsius(self, value):\n        if value < -273.15:\n            raise ValueError(\"too cold\")\n        self._celsius = value\n\n    @property\n    def fahrenheit(self):\n        return self._celsius * 9 / 5 + 32\n\ndef adjust(temp_c, delta):\n    t = Temperature(temp_c)\n    try:\n        t.celsius += delta\n        return round(t.fahrenheit, 2)\n    except ValueError:\n        return \"invalid\"", "entry_point": "adjust", "input": "20, 5", "output": "77.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00gdjmp2xoat1j3x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030910", "code": "def parse_int(s):\n    try:\n        return int(s)\n    except ValueError as e:\n        raise RuntimeError(f\"bad value: {s}\") from e\n\ndef safe_parse(values):\n    results = []\n    for v in values:\n        try:\n            results.append(parse_int(v))\n        except RuntimeError as e:\n            results.append((str(e), type(e.__cause__).__name__))\n    return results", "entry_point": "safe_parse", "input": "['12', 'abc', '-5']", "output": "[12, ('bad value: abc', 'ValueError'), -5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00ggjmp2dwwom0bh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030911", "code": "def transform(seq):\n    reversed_seq = seq[::-1]\n    every_other = seq[1::2]\n    middle_out = seq[len(seq)//4 : -(len(seq)//4)] if len(seq) >= 4 else seq\n    return reversed_seq, every_other, middle_out", "entry_point": "transform", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "([9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [1, 3, 5, 7, 9], [2, 3, 4, 5, 6, 7])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00ghjmp2mh8xk9cs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030912", "code": "def make_multipliers_bad():\n    return [lambda x: x * i for i in range(3)]\n\ndef make_multipliers_fixed():\n    return [lambda x, i=i: x * i for i in range(3)]\n\ndef apply_all(funcs, x):\n    return [f(x) for f in funcs]", "entry_point": "apply_all", "input": "make_multipliers_bad(), 10", "output": "[20, 20, 20]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00gijmp270pxaguh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030913", "code": "def merge_records(records):\n    merged = {}\n    for r in records:\n        key = r[\"id\"]\n        if key not in merged:\n            merged[key] = {\"id\": key, \"tags\": set(), \"total\": 0}\n        merged[key][\"tags\"].update(r.get(\"tags\", []))\n        merged[key][\"total\"] += r.get(\"amount\", 0)\n    return [\n        {\"id\": k, \"tags\": sorted(v[\"tags\"]), \"total\": v[\"total\"]}\n        for k, v in sorted(merged.items())\n    ]", "entry_point": "merge_records", "input": "[{'id': 1, 'tags': ['a', 'b'], 'amount': 10}, {'id': 2, 'tags': ['c'], 'amount': 5}, {'id': 1, 'tags': ['b', 'd'], 'amount': 7}]", "output": "[{'id': 1, 'tags': ['a', 'b', 'd'], 'total': 17}, {'id': 2, 'tags': ['c'], 'total': 5}]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00gkjmp2zacjhucf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030914", "code": "import heapq\nimport bisect\n\ndef k_smallest_and_rank(values, k, target):\n    smallest = heapq.nsmallest(k, values)\n    sorted_vals = sorted(values)\n    rank = bisect.bisect_left(sorted_vals, target)\n    return smallest, rank", "entry_point": "k_smallest_and_rank", "input": "[9, 3, 7, 1, 5, 2], 3, 5", "output": "([1, 2, 3], 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssidxll00gljmp2dp2unqxg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030915", "code": "from enum import Enum\n\nclass Direction(Enum):\n    NORTH = (0, 1)\n    EAST = (1, 0)\n    SOUTH = (0, -1)\n    WEST = (-1, 0)\n\n    def opposite(self):\n        mapping = {\n            Direction.NORTH: Direction.SOUTH,\n            Direction.SOUTH: Direction.NORTH,\n            Direction.EAST: Direction.WEST,\n            Direction.WEST: Direction.EAST,\n        }\n        return mapping[self]\n\ndef describe(d):\n    return (d.name, d.value, d.opposite().name)", "entry_point": "describe", "input": "Direction.EAST", "output": "('EAST', (1, 0), 'WEST')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gnjmp2ti0g2pr6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030916", "code": "import contextvars\n\nctx_var = contextvars.ContextVar(\"ctx_var\", default=\"default\")\n\ndef show():\n    return ctx_var.get()\n\ndef run():\n    results = []\n    results.append(show())\n    token = ctx_var.set(\"outer\")\n    results.append(show())\n    ctx = contextvars.copy_context()\n    def inner():\n        ctx_var.set(\"inner\")\n        return show()\n    results.append(ctx.run(inner))\n    results.append(show())\n    ctx_var.reset(token)\n    results.append(show())\n    return results", "entry_point": "run", "input": "", "output": "['default', 'outer', 'inner', 'outer', 'default']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gojmp2copqdqq9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030917", "code": "import weakref\n\nclass Widget:\n    def __init__(self, name):\n        self.name = name\n\ndef track():\n    w = Widget(\"gadget\")\n    ref = weakref.ref(w)\n    alive_before = ref() is not None\n    name_before = ref().name\n    del w\n    alive_after = ref() is not None\n    return (alive_before, name_before, alive_after)", "entry_point": "track", "input": "", "output": "(True, 'gadget', False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gpjmp2xddgd3py", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030918", "code": "from collections import deque\n\ndef process(items, maxlen):\n    d = deque(items, maxlen=maxlen)\n    d.rotate(2)\n    d.append(99)\n    d.rotate(-1)\n    return list(d)", "entry_point": "process", "input": "[1, 2, 3, 4, 5], 4", "output": "[2, 3, 99, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000grjmp2a8sjpjdk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030919", "code": "class A:\n    def greet(self):\n        return \"A\"\n\nclass B(A):\n    def greet(self):\n        return \"B->\" + super().greet()\n\nclass C(A):\n    def greet(self):\n        return \"C->\" + super().greet()\n\nclass D(B, C):\n    def greet(self):\n        return \"D->\" + super().greet()\n\ndef run():\n    d = D()\n    return (d.greet(), [c.__name__ for c in D.__mro__])", "entry_point": "run", "input": "", "output": "('D->B->C->A', ['D', 'B', 'C', 'A', 'object'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gtjmp2gzmmqdoo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030920", "code": "import itertools\n\ndef combine(a, b):\n    chained = list(itertools.chain(a, b))\n    it1, it2 = itertools.tee(chained, 2)\n    first_two = [next(it1), next(it1)]\n    all_from_it2 = list(it2)\n    return (first_two, all_from_it2)", "entry_point": "combine", "input": "[1, 2], [3, 4, 5]", "output": "([1, 2], [1, 2, 3, 4, 5])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gvjmp2mf4qt93p", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030921", "code": "class Countdown:\n    def __init__(self, start):\n        self.start = start\n        self.current = start\n\n    def __iter__(self):\n        return self\n\n    def __next__(self):\n        if self.current <= 0:\n            raise StopIteration\n        self.current -= 1\n        return self.current + 1\n\ndef run(n):\n    cd = Countdown(n)\n    return list(cd) + list(cd)", "entry_point": "run", "input": "3", "output": "[3, 2, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gyjmp21r1ijdf9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030922", "code": "def risky():\n    try:\n        raise ValueError(\"original\")\n    finally:\n        raise RuntimeError(\"from finally\")\n\ndef run():\n    try:\n        risky()\n    except Exception as e:\n        return (type(e).__name__, str(e))", "entry_point": "run", "input": "", "output": "('RuntimeError', 'from finally')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000gzjmp2ajjjg2ad", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030923", "code": "def build_counts(words):\n    counts_get = {}\n    counts_setdefault = {}\n    calls = []\n    for w in words:\n        counts_setdefault.setdefault(w, []).append(1)\n        val = counts_get.get(w, [])\n        val.append(1)\n        counts_get[w] = val\n    return (counts_setdefault, counts_get)", "entry_point": "build_counts", "input": "['a', 'b', 'a', 'a']", "output": "({'a': [1, 1, 1], 'b': [1]}, {'a': [1, 1, 1], 'b': [1]})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000h0jmp2lajbx4c7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030924", "code": "def stable_sort(records):\n    return sorted(records, key=lambda r: r[0])", "entry_point": "stable_sort", "input": "[(1, 'a'), (2, 'b'), (1, 'c'), (2, 'd'), (1, 'e')]", "output": "[(1, 'a'), (1, 'c'), (1, 'e'), (2, 'b'), (2, 'd')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000h1jmp2ug8w4gr7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030925", "code": "def roundtrip(s):\n    encoded = s.encode('utf-8')\n    b = bytearray(encoded)\n    b[0] = ord('X') if b else 0\n    try:\n        decoded = bytes(b).decode('utf-8')\n    except UnicodeDecodeError as e:\n        decoded = f\"error: {e}\"\n    return (encoded, decoded)", "entry_point": "roundtrip", "input": "'caf\u00e9'", "output": "(b'caf\\xc3\\xa9', 'Xaf\u00e9')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000h2jmp2l6zyvovj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030926", "code": "def flatten(items, _seen=None):\n    if _seen is None:\n        _seen = set()\n    result = []\n    for item in items:\n        if isinstance(item, list):\n            result.extend(flatten(item, _seen))\n        else:\n            if id(item) not in _seen:\n                _seen.add(id(item))\n            result.append(item)\n    return result\n\ndef run():\n    first = flatten([1, [2, 3], [4, [5, 6]]])\n    second = flatten([7, 8])\n    return (first, second)", "entry_point": "run", "input": "", "output": "([1, 2, 3, 4, 5, 6], [7, 8])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000h3jmp21yxf8xha", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030927", "code": "from functools import total_ordering\n\n@total_ordering\nclass Version:\n    def __init__(self, major, minor):\n        self.major = major\n        self.minor = minor\n\n    def __eq__(self, other):\n        return (self.major, self.minor) == (other.major, other.minor)\n\n    def __lt__(self, other):\n        return (self.major, self.minor) < (other.major, other.minor)\n\n    def __repr__(self):\n        return f\"Version({self.major},{self.minor})\"\n\ndef compare(a, b):\n    v1 = Version(*a)\n    v2 = Version(*b)\n    return (v1 < v2, v1 <= v2, v1 > v2, v1 >= v2, v1 == v2)", "entry_point": "compare", "input": "(1, 5), (1, 10)", "output": "(True, True, False, False, False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000h4jmp24fm31o51", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030928", "code": "from itertools import zip_longest\n\ndef combine(a, b, c):\n    short = list(zip(a, b, c))\n    long_ = list(zip_longest(a, b, c, fillvalue=-1))\n    return (short, long_)", "entry_point": "combine", "input": "[1, 2, 3], [4, 5], [6, 7, 8, 9]", "output": "([(1, 4, 6), (2, 5, 7)], [(1, 4, 6), (2, 5, 7), (3, -1, 8), (-1, -1, 9)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssijdp000h5jmp2vcyy6170", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030929", "code": "def safe_double(x):\n    try:\n        return x * 2\n    except TypeError:\n        return None", "entry_point": "safe_double", "input": "21", "output": "42", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssipppu00mgjmp2njviof6s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030930", "code": "def fib_memo(n, memo=None):\n    if memo is None:\n        memo = {}\n    if n in memo:\n        return memo[n]\n    if n <= 1:\n        return n\n    memo[n] = fib_memo(n - 1, memo) + fib_memo(n - 2, memo)\n    return memo[n]", "entry_point": "fib_memo", "input": "10", "output": "55", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiq5hj00mmjmp234vuk15d", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030931", "code": "def apply_counter_sequence(steps):\n    count = 0\n    def increment(step):\n        nonlocal count\n        count += step\n        return count\n    return [increment(s) for s in steps]", "entry_point": "apply_counter_sequence", "input": "[1, 2, 3]", "output": "[1, 3, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiqlto00mxjmp2mqoxfeli", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030932", "code": "def flatten_unique(nested):\n    seen = set()\n    result = []\n    for group in nested:\n        for item in group:\n            if item not in seen:\n                seen.add(item)\n                result.append(item)\n    return result", "entry_point": "flatten_unique", "input": "[[1, 2, 2], [3, 1], [4]]", "output": "[1, 2, 3, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiqlto00myjmp2etkghbbm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030933", "code": "def process(vals):\n    results = []\n    for v in vals:\n        try:\n            if v < 0:\n                raise ValueError('negative')\n            results.append(10 // v)\n        except ZeroDivisionError:\n            results.append(None)\n        except ValueError:\n            results.append(-1)\n        finally:\n            results.append('done')\n    return results", "entry_point": "process", "input": "[2, 0, -1, 5]", "output": "[5, 'done', None, 'done', -1, 'done', 2, 'done']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiqlto00mzjmp24r153bpu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030934", "code": "def word_frequency_rank(text):\n    freq = {}\n    for word in text.split():\n        freq[word] = freq.get(word, 0) + 1\n    return sorted(freq.items(), key=lambda kv: (-kv[1], kv[0]))", "entry_point": "word_frequency_rank", "input": "'the cat sat on the mat the cat ran'", "output": "[('the', 3), ('cat', 2), ('mat', 1), ('on', 1), ('ran', 1), ('sat', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiqlto00n0jmp2l99k26ys", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030935", "code": "def rank_scores(entries):\n    ordered = sorted(entries, key=lambda kv: (-kv[1], kv[0]))\n    ranks = {}\n    previous = None\n    position = 0\n    for index, (name, score) in enumerate(ordered, start=1):\n        if score != previous:\n            position = index\n            previous = score\n        ranks[name] = position\n    return ranks", "entry_point": "rank_scores", "input": "[('ivy', 70), ('abe', 90), ('hal', 70), ('gus', 90)]", "output": "{'abe': 1, 'gus': 1, 'hal': 3, 'ivy': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiquuo00n1jmp244ptx9mm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030936", "code": "def resolve(values, key):\n    log = []\n    try:\n        log.append(\"lookup\")\n        return values[key]\n    except KeyError:\n        log.append(\"missing\")\n        return None\n    finally:\n        log.append(\"cleanup\")\n        if len(log) == 3:\n            return tuple(log)", "entry_point": "resolve", "input": "{'a': 1}, 'a'", "output": "1", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiquuo00n2jmp2533fu995", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030937", "code": "import copy\n\ndef apply_patch(rows):\n    shallow = rows.copy()\n    deep = copy.deepcopy(rows)\n    shallow[0].append(\"s\")\n    deep[0].append(\"d\")\n    shallow.append([\"new\"])\n    return (rows, deep, len(shallow), len(rows))", "entry_point": "apply_patch", "input": "[['x'], ['y']]", "output": "([['x', 's'], ['y']], [['x', 'd'], ['y']], 3, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiquuo00n3jmp2oj6v04st", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030938", "code": "def summarize(readings):\n    total = sum(readings)\n    rounded = [round(value, 1) for value in readings]\n    return {\n        \"total\": total,\n        \"rounded\": rounded,\n        \"halves\": [round(value) for value in (0.5, 1.5, 2.5, 3.5)],\n        \"exact\": total == 0.6,\n    }", "entry_point": "summarize", "input": "[0.1, 0.2, 0.15, 0.25]", "output": "{'total': 0.7, 'rounded': [0.1, 0.2, 0.1, 0.2], 'halves': [0, 2, 2, 4], 'exact': False}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiquuo00n4jmp2y884dqan", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030939", "code": "def collect(item, bucket=[]):\n    bucket.append(item)\n    return list(bucket)\n\ndef collect_safe(item, bucket=None):\n    if bucket is None:\n        bucket = []\n    bucket.append(item)\n    return bucket", "entry_point": "collect_safe", "input": "'a'", "output": "['a']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssiquuo00n5jmp2negnwm5u", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030940", "code": "def count_chars(s):\n    freq = {}\n    for c in s:\n        freq[c] = freq.get(c, 0) + 1\n    return freq\n", "entry_point": "count_chars", "input": "'mississippi'", "output": "{'m': 1, 'i': 4, 's': 4, 'p': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssis20b00nqjmp2wzy04ot3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030941", "code": "def pascal_row(n):\n    row = [1]\n    for i in range(1, n + 1):\n        row.append(row[-1] * (n - i + 1) // i)\n    return row\n", "entry_point": "pascal_row", "input": "5", "output": "[1, 5, 10, 10, 5, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssis20b00nsjmp2pia73jk4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030942", "code": "def chunk(lst, size):\n    return [lst[i:i+size] for i in range(0, len(lst), size)]\n", "entry_point": "chunk", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssis20b00ntjmp25n4rakt7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030943", "code": "def safe_div(a, b):\n    try:\n        return a / b\n    except ZeroDivisionError:\n        return None\n", "entry_point": "safe_div", "input": "10, 4", "output": "2.5", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssis20b00nujmp2ieotj4ib", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030944", "code": "def running_sum(nums):\n    total = 0\n    result = []\n    for n in nums:\n        total += n\n        result.append(total)\n    return result\n", "entry_point": "running_sum", "input": "[1, 2, 3, 4, 5]", "output": "[1, 3, 6, 10, 15]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssizqrl00pmjmp2vwp04cuz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030945", "code": "def rolling_windows(values, size):\n    return [tuple(values[i:i+size]) for i in range(len(values)-size+1)]", "entry_point": "rolling_windows", "input": "[3, 1, 4, 1, 5], 3", "output": "[(3, 1, 4), (1, 4, 1), (4, 1, 5)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zb00qmjmp2629eulzl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030946", "code": "def partition_stable(values, pivot):\n    lower = [x for x in values if x < pivot]\n    equal = [x for x in values if x == pivot]\n    higher = [x for x in values if x > pivot]\n    return lower + equal + higher", "entry_point": "partition_stable", "input": "[5, 2, 7, 2, 4, 2, 9], 2", "output": "[2, 2, 2, 5, 7, 4, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zb00qnjmp2hpkwrpc7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030947", "code": "def sparse_running_total(events):\n    total = 0\n    out = {}\n    for key, delta in events:\n        total += delta\n        if total:\n            out[key] = total\n    return out", "entry_point": "sparse_running_total", "input": "[('a', 3), ('b', -3), ('c', 5), ('d', -2)]", "output": "{'a': 3, 'c': 5, 'd': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zb00qojmp2i54esuyd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030948", "code": "def rotate_layers(matrix):\n    return [list(row) for row in zip(*matrix[::-1])]", "entry_point": "rotate_layers", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[7, 4, 1], [8, 5, 2], [9, 6, 3]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zb00qpjmp2qcltvgor", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030949", "code": "def merge_intervals(intervals):\n    merged = []\n    for start, end in sorted(intervals):\n        if merged and start <= merged[-1][1] + 1:\n            merged[-1] = (merged[-1][0], max(end, merged[-1][1]))\n        else:\n            merged.append((start, end))\n    return merged", "entry_point": "merge_intervals", "input": "[(8, 10), (1, 3), (2, 6), (12, 12), (11, 11)]", "output": "[(1, 6), (8, 12)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zb00qqjmp2rw6y6c1p", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030950", "code": "def diagonal_zigzag(grid):\n    out = []\n    rows, cols = len(grid), len(grid[0])\n    for s in range(rows + cols - 1):\n        part = [grid[r][s-r] for r in range(rows) if 0 <= s-r < cols]\n        out.extend(part[::-1] if s % 2 == 0 else part)\n    return out", "entry_point": "diagonal_zigzag", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[1, 2, 4, 5, 3, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qrjmp2xa5trepm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030951", "code": "def bounded_accumulate(values, low, high):\n    total = 0\n    out = []\n    for value in values:\n        total = min(high, max(low, total + value))\n        out.append(total)\n    return out", "entry_point": "bounded_accumulate", "input": "[4, 9, -3, -20, 8], -5, 10", "output": "[4, 10, 7, -5, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qsjmp2iha7p2ya", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030952", "code": "def transpose_ragged(rows, fill=None):\n    width = max(map(len, rows))\n    return [[row[i] if i < len(row) else fill for row in rows] for i in range(width)]", "entry_point": "transpose_ragged", "input": "[[1, 2, 3], [4], [5, 6]], 0", "output": "[[1, 4, 5], [2, 0, 6], [3, 0, 0]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qujmp22efm17q7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030953", "code": "def local_peaks(values):\n    return [(i, values[i]) for i in range(1, len(values)-1) if values[i] > values[i-1] and values[i] >= values[i+1]]", "entry_point": "local_peaks", "input": "[1, 4, 4, 2, 5, 3, 3]", "output": "[(1, 4), (4, 5)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qvjmp2bob2cny3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030954", "code": "from collections import Counter\ndef multiset_delta(left, right):\n    a, b = Counter(left), Counter(right)\n    return sorted((a-b).elements()), sorted((b-a).elements())", "entry_point": "multiset_delta", "input": "'mississippi', 'impossible'", "output": "(['i', 'i', 'p', 's', 's'], ['b', 'e', 'l', 'o'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qwjmp2bqjh66ge", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030955", "code": "from collections import defaultdict\ndef invert_groups(mapping):\n    out = defaultdict(list)\n    for key, values in mapping.items():\n        for value in values:\n            out[value].append(key)\n    return {k: sorted(v) for k, v in sorted(out.items())}", "entry_point": "invert_groups", "input": "{'red': ['a', 'c'], 'blue': ['b', 'c'], 'green': ['a']}", "output": "{'a': ['green', 'red'], 'b': ['blue'], 'c': ['blue', 'red']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qxjmp24nqrrwxt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030956", "code": "from collections import deque\ndef consume_round_robin(queues):\n    active = deque(deque(q) for q in queues if q)\n    out = []\n    while active:\n        q = active.popleft()\n        out.append(q.popleft())\n        if q:\n            active.append(q)\n    return out", "entry_point": "consume_round_robin", "input": "[[1, 2, 3], ['a'], [True, False]]", "output": "[1, 'a', True, 2, False, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qyjmp24znkwkna", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030957", "code": "import heapq\ndef scheduled_order(tasks):\n    heap = [(time, priority, name) for name, time, priority in tasks]\n    heapq.heapify(heap)\n    return [heapq.heappop(heap)[2] for _ in range(len(heap))]", "entry_point": "scheduled_order", "input": "[('backup', 5, 2), ('alert', 2, 1), ('sync', 5, 1), ('index', 2, 3)]", "output": "['alert', 'index', 'sync', 'backup']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00qzjmp2nd57zo37", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030958", "code": "import bisect\ndef insert_and_rank(sorted_values, additions):\n    values = list(sorted_values)\n    ranks = []\n    for x in additions:\n        i = bisect.bisect_right(values, x)\n        values.insert(i, x)\n        ranks.append(i)\n    return values, ranks", "entry_point": "insert_and_rank", "input": "[1, 3, 3, 8], [3, 0, 10]", "output": "([0, 1, 3, 3, 3, 8, 10], [3, 0, 6])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r0jmp2f2gjfekf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030959", "code": "from itertools import groupby\ndef summarize_signs(values):\n    key = lambda x: 'pos' if x > 0 else ('neg' if x < 0 else 'zero')\n    return [(k, sum(1 for _ in g)) for k, g in groupby(values, key)]", "entry_point": "summarize_signs", "input": "[2, 1, 0, 0, -1, -3, 4, -2]", "output": "[('pos', 2), ('zero', 2), ('neg', 2), ('pos', 1), ('neg', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r1jmp2fe8qcdsq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030960", "code": "from itertools import accumulate\ndef prefix_extrema(values):\n    return list(accumulate(values, max)), list(accumulate(values, min))", "entry_point": "prefix_extrema", "input": "[5, 2, 8, 1, 7]", "output": "([5, 5, 8, 8, 8], [5, 2, 2, 1, 1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r2jmp2pngnujz5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030961", "code": "from functools import reduce\ndef compose_steps(value, steps):\n    return reduce(lambda current, step: step(current), steps, value)", "entry_point": "compose_steps", "input": "3, [lambda x: x + 4, lambda x: x * x, lambda x: x - 5]", "output": "44", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r3jmp2uqyvuenq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030962", "code": "def dictionary_diff(before, after):\n    keys = before.keys() | after.keys()\n    return {k:(before.get(k), after.get(k)) for k in sorted(keys) if before.get(k) != after.get(k)}", "entry_point": "dictionary_diff", "input": "{'a': 1, 'b': 2, 'd': None}, {'b': 3, 'c': 4, 'd': None}", "output": "{'a': (1, None), 'b': (2, 3), 'c': (None, 4)}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r4jmp283mywie9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030963", "code": "def nested_get(data, path, default=None):\n    cur = data\n    for part in path:\n        try:\n            cur = cur[part]\n        except (KeyError, IndexError, TypeError):\n            return default\n    return cur", "entry_point": "nested_get", "input": "{'a': [{'b': 7}]}, ['a', 0, 'b']", "output": "7", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r5jmp2x6ne579h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030964", "code": "def parse_pairs(parts):\n    out = {}\n    errors = []\n    for part in parts:\n        try:\n            key, raw = part.split('=', 1)\n            out[key] = int(raw)\n        except ValueError:\n            errors.append(part)\n    return out, errors", "entry_point": "parse_pairs", "input": "['x=4', 'bad', 'y=-2', 'z=3.5', 'note=a=b']", "output": "({'x': 4, 'y': -2}, ['bad', 'z=3.5', 'note=a=b'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r6jmp2zvxxweah", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030965", "code": "def guarded_index(values, indexes):\n    out = []\n    for index in indexes:\n        try:\n            out.append(values[index])\n        except IndexError:\n            out.append('out')\n        else:\n            out[-1] = (index, out[-1])\n    return out", "entry_point": "guarded_index", "input": "['a', 'b', 'c'], [0, -1, 3, -4]", "output": "[(0, 'a'), (-1, 'c'), 'out', 'out']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r7jmp2vkaolese", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030966", "code": "def exception_chain(flag):\n    try:\n        if flag:\n            raise KeyError('root')\n        return 'ok'\n    except KeyError as exc:\n        try:\n            raise RuntimeError('wrapped') from exc\n        except RuntimeError as wrapped:\n            return type(wrapped.__cause__).__name__, str(wrapped)\n    finally:\n        flag = None", "entry_point": "exception_chain", "input": "False", "output": "'ok'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r8jmp2hiz10895", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030967", "code": "def transactional_update(state, operations):\n    original = state.copy()\n    try:\n        for key, delta in operations:\n            state[key] += delta\n            if state[key] < 0:\n                raise ValueError(key)\n    except (KeyError, ValueError) as exc:\n        state.clear(); state.update(original)\n        return False, str(exc), state\n    return True, None, state", "entry_point": "transactional_update", "input": "{'cash': 5, 'stock': 2}, [('cash', -3), ('stock', -4)]", "output": "(False, 'stock', {'cash': 5, 'stock': 2})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00r9jmp22a2fys68", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030968", "code": "def finally_override(value):\n    try:\n        return 10 // value\n    except ZeroDivisionError:\n        return 'zero'\n    finally:\n        if value < 0:\n            return 'negative' ", "entry_point": "finally_override", "input": "2", "output": "5", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rajmp217t8kk8d", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030969", "code": "class CounterBox:\n    def __init__(self, start): self.value = start\n    def __enter__(self): self.value += 1; return self\n    def __exit__(self, kind, exc, tb): self.value *= 2\ndef use_box(start):\n    with CounterBox(start) as box:\n        box.value += 3\n    return box.value", "entry_point": "use_box", "input": "4", "output": "16", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rdjmp2r3unp2u7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030970", "code": "class Node:\n    def __init__(self, value, children=()): self.value, self.children = value, children\n    def __iter__(self):\n        yield self.value\n        for child in self.children:\n            yield from child\ndef tree_values():\n    return list(Node('a',(Node('b'),Node('c',(Node('d'),)))))", "entry_point": "tree_values", "input": "", "output": "['a', 'b', 'c', 'd']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rejmp22rqhmoxn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030971", "code": "from enum import IntFlag\nclass Access(IntFlag):\n    READ=1; WRITE=2; EXECUTE=4\ndef permissions(value):\n    mask = Access(value)\n    return bool(mask & Access.WRITE), (mask | Access.EXECUTE).value, (mask & ~Access.READ).value", "entry_point": "permissions", "input": "3", "output": "(True, 7, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rijmp2y9tpbk4c", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030972", "code": "def coroutine_trace(values):\n    def running():\n        total = 0\n        while True:\n            value = yield total\n            total += value\n    g = running(); out = [next(g)]\n    out.extend(g.send(v) for v in values)\n    return out", "entry_point": "coroutine_trace", "input": "[3, -1, 5]", "output": "[0, 3, 2, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rjjmp2wf58k1f4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030973", "code": "def generator_cleanup(limit):\n    log = []\n    def gen():\n        try:\n            for i in range(limit): yield i\n        finally: log.append('closed')\n    g = gen(); first = next(g); g.close()\n    return first, log", "entry_point": "generator_cleanup", "input": "4", "output": "(0, ['closed'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rkjmp22fotbkti", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030974", "code": "from contextlib import contextmanager\n@contextmanager\ndef tagged(log, name):\n    log.append('enter:'+name)\n    try: yield name.upper()\n    finally: log.append('exit:'+name)\ndef nested_tags():\n    log=[]\n    with tagged(log,'a') as a, tagged(log,'b') as b: log.append(a+b)\n    return log", "entry_point": "nested_tags", "input": "", "output": "['enter:a', 'enter:b', 'AB', 'exit:b', 'exit:a']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rljmp2y0g45t1q", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030975", "code": "from datetime import datetime, timedelta, timezone\ndef timeline(start, offsets):\n    base = datetime.fromisoformat(start).astimezone(timezone.utc)\n    return [(base + timedelta(minutes=m)).isoformat() for m in offsets]", "entry_point": "timeline", "input": "'2026-08-01T23:50:00+05:30', [0, 20, 75]", "output": "['2026-08-01T18:20:00+00:00', '2026-08-01T18:40:00+00:00', '2026-08-01T19:35:00+00:00']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rojmp2oxip35pt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030976", "code": "from pathlib import PurePosixPath\ndef path_summary(paths):\n    ps = [PurePosixPath(p) for p in paths]\n    return [(p.name, p.suffix, len(p.parts)) for p in ps]", "entry_point": "path_summary", "input": "['/srv/app/main.py', 'docs/archive.tar.gz', 'README']", "output": "[('main.py', '.py', 4), ('archive.tar.gz', '.gz', 2), ('README', '', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rpjmp23hazpxud", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030977", "code": "import re\ndef capture_report(text):\n    pattern = re.compile(r'(?P<key>[A-Z]+)=(?P<value>\\d+)')\n    return [(m.group('key'), int(m.group('value')), m.span()) for m in pattern.finditer(text)]", "entry_point": "capture_report", "input": "'CPU=81 MEM=64 note CPU=90'", "output": "[('CPU', 81, (0, 6)), ('MEM', 64, (7, 13)), ('CPU', 90, (19, 25))]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rqjmp2g7uruy98", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030978", "code": "import statistics\ndef robust_summary(values):\n    q = statistics.quantiles(values, n=4, method='inclusive')\n    return statistics.median(values), q[0], q[2], round(statistics.pstdev(values), 3)", "entry_point": "robust_summary", "input": "[2, 4, 4, 4, 5, 5, 7, 9]", "output": "(4.5, 4.0, 5.5, 2.0)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rsjmp2e5k2ffej", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030979", "code": "import string\ndef translation_map(text):\n    table = str.maketrans({'-':' ', '_':' ', '!':None})\n    cleaned = text.translate(table)\n    return cleaned, string.capwords(cleaned)", "entry_point": "translation_map", "input": "'hello-world_test!'", "output": "('hello world test', 'Hello World Test')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rujmp22pl5i7xj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030980", "code": "from operator import itemgetter\ndef ranked_rows(rows):\n    ordered = sorted(rows, key=itemgetter(1,0), reverse=True)\n    return [(i+1, row) for i,row in enumerate(ordered)]", "entry_point": "ranked_rows", "input": "[('amy', 3), ('bob', 5), ('cid', 5), ('dee', 2)]", "output": "[(1, ('cid', 5)), (2, ('bob', 5)), (3, ('amy', 3)), (4, ('dee', 2))]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rvjmp2plwb2vf7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030981", "code": "def memoized_paths(n):\n    cache = {0:1, 1:1}\n    def count(k):\n        if k not in cache: cache[k] = count(k-1) + count(k-2)\n        return cache[k]\n    value = count(n)\n    return value, sorted(cache.items())", "entry_point": "memoized_paths", "input": "6", "output": "(13, [(0, 1), (1, 1), (2, 2), (3, 3), (4, 5), (5, 8), (6, 13)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rwjmp2mt3osc79", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030982", "code": "def match_records(records):\n    out=[]\n    for record in records:\n        match record:\n            case {'kind':'point','x':x,'y':y}: out.append(x+y)\n            case [head,*tail]: out.append((head,len(tail)))\n            case _: out.append(None)\n    return out", "entry_point": "match_records", "input": "[{'kind': 'point', 'x': 2, 'y': 5}, [9, 8, 7], {'kind': 'other'}]", "output": "[7, (9, 2), None]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00ryjmp2zwnw9e23", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030983", "code": "def walrus_chunks(values, size):\n    it = iter(values)\n    out=[]\n    while chunk := tuple(next(it, None) for _ in range(size)):\n        clean = tuple(x for x in chunk if x is not None)\n        if not clean: break\n        out.append(clean)\n        if len(clean) < size: break\n    return out", "entry_point": "walrus_chunks", "input": "[1, 2, 3, 4, 5], 2", "output": "[(1, 2), (3, 4), (5,)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjh8zc00rzjmp2rt4ghjcv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030984", "code": "def make_multipliers():\n    fns = []\n    for factor in range(1, 4):\n        fns.append(lambda x: x * factor)\n    return fns\n\ndef apply_all(x):\n    return [f(x) for f in make_multipliers()]", "entry_point": "apply_all", "input": "5", "output": "[15, 15, 15]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklaf00s6jmp2x4gbp1up", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030985", "code": "def pair_up(n):\n    it = iter(range(n))\n    return list(zip(it, it))", "entry_point": "pair_up", "input": "7", "output": "[(0, 1), (2, 3), (4, 5)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00s8jmp2cgsc5tds", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030986", "code": "def merge_order():\n    d = {\"a\": 1, \"b\": 2, \"c\": 3}\n    d[\"a\"] = 99\n    del d[\"b\"]\n    d[\"b\"] = 5\n    return list(d.items())", "entry_point": "merge_order", "input": "", "output": "[('a', 99), ('c', 3), ('b', 5)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00s9jmp2bxzmd1gd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030987", "code": "def by_length(words):\n    return sorted(words, key=len)", "entry_point": "by_length", "input": "['pear', 'fig', 'plum', 'kiwi', 'date']", "output": "['fig', 'pear', 'plum', 'kiwi', 'date']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sajmp26uoyx0vk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030988", "code": "def which_wins():\n    try:\n        return \"try\"\n    finally:\n        return \"finally\"\n\ndef probe():\n    return [which_wins()]", "entry_point": "probe", "input": "", "output": "['finally']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sdjmp2lx9uo4pw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030989", "code": "def stripe(n):\n    xs = list(range(n))\n    xs[::2] = [0] * len(xs[::2])\n    return xs", "entry_point": "stripe", "input": "7", "output": "[0, 1, 0, 3, 0, 5, 0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sejmp2me6l7wmq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030990", "code": "def divmods(pairs):\n    return [(a // b, a % b) for a, b in pairs]", "entry_point": "divmods", "input": "[(7, 3), (-7, 3), (7, -3), (-7, -3)]", "output": "[(2, 1), (-3, 2), (-3, -2), (2, -1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sfjmp2zkiotfvy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030991", "code": "def tokens(text):\n    return [text.split(), text.split(\" \")]", "entry_point": "tokens", "input": "'  a  b '", "output": "[['a', 'b'], ['', '', 'a', '', 'b', '']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sgjmp2mni5c6j1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030992", "code": "def squares_over(nums, floor):\n    return [sq for n in nums if (sq := n * n) > floor]", "entry_point": "squares_over", "input": "[1, 3, 5, 2, 7], 8", "output": "[9, 25, 49]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00shjmp2hsjy0ff9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030993", "code": "def key_collisions():\n    d = {}\n    d[1] = \"int\"\n    d[True] = \"bool\"\n    d[1.0] = \"float\"\n    return [len(d), list(d.keys()), d[1]]", "entry_point": "key_collisions", "input": "", "output": "[1, [1], 'float']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sjjmp23lkmqo42", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030994", "code": "import copy\n\ndef shallow_vs_deep():\n    original = [[1, 2], [3, 4]]\n    shallow = copy.copy(original)\n    deep = copy.deepcopy(original)\n    original[0].append(99)\n    return [shallow, deep]", "entry_point": "shallow_vs_deep", "input": "", "output": "[[[1, 2, 99], [3, 4]], [[1, 2], [3, 4]]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00skjmp2njd5uyy7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030995", "code": "def risky(items):\n    for it in items:\n        if it == 0:\n            raise ValueError(\"zero\")\n        yield 10 // it\n\ndef collect_until_error(items):\n    out = []\n    try:\n        for v in risky(items):\n            out.append(v)\n    except ValueError as e:\n        out.append(str(e))\n    return out", "entry_point": "collect_until_error", "input": "[5, 2, 0, 1]", "output": "[2, 5, 'zero']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sljmp2pjh64lsy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030996", "code": "from functools import reduce\n\ndef fold(nums):\n    with_init = reduce(lambda a, b: a * 10 + b, nums, 0)\n    without = reduce(lambda a, b: a * 10 + b, nums)\n    return [with_init, without]", "entry_point": "fold", "input": "[1, 2, 3]", "output": "[123, 123]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00smjmp23qegpoe5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030997", "code": "def fib(n, memo={}):\n    if n < 2:\n        return n\n    if n not in memo:\n        memo[n] = fib(n - 1, memo) + fib(n - 2, memo)\n    return memo[n]\n\ndef two_rounds():\n    first = fib(10)\n    size_after = len(fib.__defaults__[0])\n    return [first, size_after]", "entry_point": "two_rounds", "input": "", "output": "[55, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00snjmp2d492nz8f", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030998", "code": "from itertools import groupby\n\ndef group_parity(nums):\n    key = lambda n: n % 2\n    unsorted = [(k, list(g)) for k, g in groupby(nums, key)]\n    presorted = [(k, list(g)) for k, g in groupby(sorted(nums, key=key), key)]\n    return [len(unsorted), unsorted, presorted]", "entry_point": "group_parity", "input": "[1, 3, 2, 4, 5]", "output": "[3, [(1, [1, 3]), (0, [2, 4]), (1, [5])], [(0, [2, 4]), (1, [1, 3, 5])]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssjklag00sojmp2h6tklasp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0030999", "code": "def safe_divide_chain(pairs):\n    results = []\n    for a, b in pairs:\n        try:\n            r = a / b\n        except ZeroDivisionError:\n            results.append(None)\n        else:\n            results.append(round(r, 2))\n        finally:\n            results.append('checked')\n    return results", "entry_point": "safe_divide_chain", "input": "[(10, 2), (5, 0), (7, 3)]", "output": "[5.0, 'checked', None, 'checked', 2.33, 'checked']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskjlzc0127jmp25kgok4vn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031000", "code": "import itertools\n\ndef group_consecutive(items):\n    return [(k, list(v)) for k, v in itertools.groupby(items)]", "entry_point": "group_consecutive", "input": "[1, 1, 2, 1, 1, 3, 3]", "output": "[(1, [1, 1]), (2, [2]), (1, [1, 1]), (3, [3, 3])]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskjlzc0128jmp2zndg4hge", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031001", "code": "def transform(nums):\n    reversed_evens = [n for n in nums[::-1] if n % 2 == 0]\n    return reversed_evens[1:-1]", "entry_point": "transform", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[8, 6, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013qjmp20zfisbjv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031002", "code": "def classify_matrix(matrix):\n    return [\n        [\"pos\" if val > 0 else \"neg\" if val < 0 else \"zero\" for val in row]\n        for row in matrix\n    ]", "entry_point": "classify_matrix", "input": "[[1, -2, 0], [-5, 5, 0]]", "output": "[['pos', 'neg', 'zero'], ['neg', 'pos', 'zero']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013rjmp252fcmg1i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031003", "code": "def index_map(names, scores):\n    return {\n        i: (name, score)\n        for i, (name, score) in enumerate(zip(names, scores))\n        if score >= 50\n    }", "entry_point": "index_map", "input": "['Ann', 'Bob', 'Cy'], [40, 60, 75]", "output": "{1: ('Bob', 60), 2: ('Cy', 75)}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013sjmp2bzsfewa9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031004", "code": "from itertools import islice\n\ndef counter_gen(start, step):\n    n = start\n    while True:\n        yield n\n        n += step\n\ndef take_n(start, step, n):\n    return list(islice(counter_gen(start, step), n))", "entry_point": "take_n", "input": "3, 5, 4", "output": "[3, 8, 13, 18]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013ujmp2kn6h803o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031005", "code": "def rank_students(students):\n    return sorted(students, key=lambda s: (-s[1], s[2]))", "entry_point": "rank_students", "input": "[('Ann', 85, 20), ('Bob', 90, 19), ('Cy', 85, 18), ('Dee', 90, 21)]", "output": "[('Bob', 90, 19), ('Dee', 90, 21), ('Cy', 85, 18), ('Ann', 85, 20)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013vjmp2qnmte7yb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031006", "code": "def format_prices(prices):\n    return [f\"{p:.2f}\" for p in prices]", "entry_point": "format_prices", "input": "[1.005, 2.675, 0.1 + 0.2, 10]", "output": "['1.00', '2.67', '0.30', '10.00']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013wjmp2dzj2iifh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031007", "code": "def compare_groups(a, b):\n    set_a = set(a)\n    set_b = set(b)\n    return {\n        \"only_a\": sorted(set_a - set_b),\n        \"only_b\": sorted(set_b - set_a),\n        \"common\": sorted(set_a & set_b),\n        \"symmetric\": sorted(set_a ^ set_b),\n    }", "entry_point": "compare_groups", "input": "[1, 2, 3, 4, 2], [3, 4, 5, 6]", "output": "{'only_a': [1, 2], 'only_b': [5, 6], 'common': [3, 4], 'symmetric': [1, 2, 5, 6]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013xjmp2n9vevf6e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031008", "code": "from functools import lru_cache\n\n@lru_cache(maxsize=None)\ndef collatz_steps(n):\n    if n == 1:\n        return 0\n    if n % 2 == 0:\n        return 1 + collatz_steps(n // 2)\n    return 1 + collatz_steps(3 * n + 1)\n\ndef total_steps(nums):\n    return sum(collatz_steps(n) for n in nums)", "entry_point": "total_steps", "input": "[6, 7, 27]", "output": "135", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013yjmp2e4praimr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031009", "code": "from collections import Counter\n\ndef top_words(text, n):\n    words = text.lower().split()\n    counts = Counter(words)\n    return counts.most_common(n)", "entry_point": "top_words", "input": "'dog cat bird cat bird dog cat bird bird fish', 3", "output": "[('bird', 4), ('cat', 3), ('dog', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsskw28m013zjmp26ggvjuza", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031010", "code": "def append_item(item, bucket=[]):\n    bucket.append(item)\n    return bucket\n", "entry_point": "append_item", "input": "1", "output": "[1, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssl291o014zjmp2spo9f1b8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031011", "code": "def counter(n):\n    for i in range(n):\n        yield i * i\n\ndef drain_twice(n):\n    g = counter(n)\n    first = list(g)\n    second = list(g)\n    return (first, second)\n", "entry_point": "drain_twice", "input": "4", "output": "([0, 1, 4, 9], [])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssl291o0150jmp2lctu60c9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031012", "code": "def bucketize(nums):\n    return {n: 'even' if n % 2 == 0 else 'odd' for n in nums}\n", "entry_point": "bucketize", "input": "[5, 2, 8, 1]", "output": "{5: 'odd', 2: 'even', 8: 'even', 1: 'odd'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssl291o0151jmp2bmqd4r4v", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031013", "code": "def risky(x):\n    try:\n        return 10 / x\n    except ZeroDivisionError:\n        return -1\n    finally:\n        pass\n", "entry_point": "risky", "input": "2", "output": "5.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssl291o0152jmp2907d53rx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031014", "code": "from collections import Counter\n\ndef rank_tags(tags, limit):\n    counts = Counter(tags)\n    top = counts.most_common(limit)\n    return [name for name, _ in top], counts.total()", "entry_point": "rank_tags", "input": "['api', 'db', 'api', 'ui', 'db', 'api', 'ui'], 2", "output": "(['api', 'db'], 7)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslaz2g015fjmp2owavw52v", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031015", "code": "from itertools import groupby\n\ndef summarize(records):\n    out = {}\n    for key, group in groupby(records, key=lambda r: r[0]):\n        out.setdefault(key, []).extend(r[1] for r in group)\n    return out", "entry_point": "summarize", "input": "[('a', 1), ('b', 2), ('a', 3), ('a', 4)]", "output": "{'a': [1, 3, 4], 'b': [2]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslaz2g015hjmp2jqth2rgv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031016", "code": "def parse_port(raw):\n    try:\n        value = int(raw)\n        if not 0 < value < 65536:\n            raise ValueError('out of range')\n        return value\n    except ValueError:\n        return -1\n    finally:\n        if raw == '':\n            return 0", "entry_point": "parse_port", "input": "'8080'", "output": "8080", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslaz2g015ijmp2cb4ih9wd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031017", "code": "def normalize(readings):\n    buckets = {}\n    for name, value in readings:\n        buckets[name] = round(value, 1)\n    ordered = sorted(buckets.items(), key=lambda kv: (-kv[1], kv[0]))\n    return ordered", "entry_point": "normalize", "input": "[('east', 2.25), ('west', 2.35), ('north', 0.15), ('east', 1.05)]", "output": "[('west', 2.4), ('east', 1.1), ('north', 0.1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslaz2g015jjmp2cake44iy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031018", "code": "def add_numbers(a, b):\n    return a + b", "entry_point": "add_numbers", "input": "2, 3", "output": "5", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslub3l0172jmp2x9fqet0l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031019", "code": "from functools import lru_cache\n\n@lru_cache(maxsize=None)\ndef fib(n):\n    if n < 2:\n        return n\n    return fib(n-1) + fib(n-2)", "entry_point": "fib", "input": "9", "output": "34", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslujti0173jmp28ssil2wj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031020", "code": "def make_accumulator():\n    total = 0\n    history = []\n\n    def add(x):\n        nonlocal total\n        total += x\n        history.append(total)\n        return total\n\n    return add, history\n\ndef run_accumulator(values):\n    add, history = make_accumulator()\n    results = [add(v) for v in values]\n    return results, history", "entry_point": "run_accumulator", "input": "[5, -2, 10]", "output": "([5, 3, 13], [5, 3, 13])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslv0760174jmp2qe91eag7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031021", "code": "class InsufficientFundsError(Exception):\n    pass\n\ndef withdraw(balance, amount):\n    log = []\n    try:\n        if amount > balance:\n            raise InsufficientFundsError(f\"cannot withdraw {amount} from {balance}\")\n        balance -= amount\n        return balance, log\n    except InsufficientFundsError as e:\n        return str(e), log\n    finally:\n        log.append(\"attempt complete\")", "entry_point": "withdraw", "input": "100, 30", "output": "(70, ['attempt complete'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017pjmp24bulv49c", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031022", "code": "def flatten_evens(matrix):\n    return [value for row in matrix for value in row if value % 2 == 0]", "entry_point": "flatten_evens", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[2, 4, 6, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017qjmp28sk341tn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031023", "code": "from collections import Counter\n\ndef top_letters(text, n):\n    counts = Counter(c for c in text.lower() if c.isalpha())\n    return counts.most_common(n)", "entry_point": "top_letters", "input": "'Mississippi River', 3", "output": "[('i', 5), ('s', 4), ('p', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017rjmp2y9bv2uqf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031024", "code": "from collections import defaultdict\n\ndef group_by_mod(numbers, mod):\n    groups = defaultdict(list)\n    for num in numbers:\n        groups[num % mod].append(num)\n    return dict(groups)", "entry_point": "group_by_mod", "input": "[10, 21, 32, 43, 54, 65], 3", "output": "{1: [10, 43], 0: [21, 54], 2: [32, 65]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017sjmp2pcib3nwm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031025", "code": "def rank_students(students):\n    return sorted(students, key=lambda s: (-s[1], s[0]))", "entry_point": "rank_students", "input": "[('Ann', 88), ('Bo', 92), ('Cid', 88), ('Dee', 92)]", "output": "[('Bo', 92), ('Dee', 92), ('Ann', 88), ('Cid', 88)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017tjmp2oem0wof7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031026", "code": "def factorial(n, _cache={0: 1, 1: 1}):\n    if n in _cache:\n        return _cache[n]\n    result = n * factorial(n - 1, _cache)\n    _cache[n] = result\n    return result", "entry_point": "factorial", "input": "5", "output": "120", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017vjmp2feh2nqb1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031027", "code": "def analyze_sets(a, b):\n    return {\n        'union': sorted(a | b),\n        'intersection': sorted(a & b),\n        'difference': sorted(a - b),\n        'symmetric_difference': sorted(a ^ b),\n    }", "entry_point": "analyze_sets", "input": "{1, 2, 3, 4}, {3, 4, 5, 6}", "output": "{'union': [1, 2, 3, 4, 5, 6], 'intersection': [3, 4], 'difference': [1, 2], 'symmetric_difference': [1, 2, 5, 6]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017wjmp22uvvet3w", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031028", "code": "import itertools\n\ndef group_lengths(words):\n    data = sorted(words, key=len)\n    return {length: list(group) for length, group in itertools.groupby(data, key=len)}", "entry_point": "group_lengths", "input": "['fig', 'kiwi', 'pear', 'plum', 'date', 'apple']", "output": "{3: ['fig'], 4: ['kiwi', 'pear', 'plum', 'date'], 5: ['apple']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m017zjmp27pg49bbz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031029", "code": "def round_all(values, ndigits):\n    return [round(v, ndigits) for v in values]", "entry_point": "round_all", "input": "[2.675, 0.125, 1.005, 2.5, 3.5], 2", "output": "[2.67, 0.12, 1.0, 2.5, 3.5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m0180jmp2r9tab0yo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031030", "code": "def slice_variants(s):\n    return (s[::-1], s[2:-2], s[-1:-6:-2], s[::3])", "entry_point": "slice_variants", "input": "'abcdefghij'", "output": "('jihgfedcba', 'cdefgh', 'jhf', 'adgj')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m0181jmp2t69rj7nv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031031", "code": "def process_lists(original):\n    alias = original\n    snapshot = original[:]\n    alias.append(99)\n    original.sort()\n    return original, alias, snapshot", "entry_point": "process_lists", "input": "[5, 3, 8, 1]", "output": "([1, 3, 5, 8, 99], [1, 3, 5, 8, 99], [5, 3, 8, 1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m0182jmp2j8g4h86a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031032", "code": "class ParseError(Exception):\n    pass\n\ndef parse_number(text):\n    trace = []\n    try:\n        value = int(text)\n    except ValueError as e:\n        trace.append('conversion failed')\n        raise ParseError(f\"bad input: {text}\") from e\n    else:\n        trace.append('conversion ok')\n        return value, trace\n    finally:\n        trace.append('done')", "entry_point": "parse_number", "input": "'42'", "output": "(42, ['conversion ok', 'done'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m0183jmp28s3jafwu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031033", "code": "def pair_data(names, scores):\n    return [f\"{i}:{name}={score}\" for i, (name, score) in enumerate(zip(names, scores), start=1)]", "entry_point": "pair_data", "input": "['Al', 'Bo', 'Cy', 'Do'], [10, 20, 30]", "output": "['1:Al=10', '2:Bo=20', '3:Cy=30']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m0184jmp2y4xnd359", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031034", "code": "def bit_report(a, b):\n    return {\n        'and': a & b,\n        'or': a | b,\n        'xor': a ^ b,\n        'left_shift': a << 2,\n        'right_shift': b >> 1,\n        'invert_a': ~a,\n    }", "entry_point": "bit_report", "input": "12, 10", "output": "{'and': 8, 'or': 14, 'xor': 6, 'left_shift': 48, 'right_shift': 5, 'invert_a': -13}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsslvr6m0185jmp2kedryiyl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031035", "code": "def add_item(item, bucket=[]):\n    bucket.append(item)\n    return bucket\n", "entry_point": "add_item", "input": "1", "output": "[1, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssm488101bnjmp2lprsk0vh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031036", "code": "def describe(person):\n    return f\"{person['name']} is {person['age']} years old\"\n", "entry_point": "describe", "input": "{'name': 'Ada', 'age': 30}", "output": "'Ada is 30 years old'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssm488101bojmp2cy5eyvma", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031037", "code": "def sort_by_abs(nums):\n    return sorted(nums, key=abs)\n", "entry_point": "sort_by_abs", "input": "[3, -1, -2, 0, -3]", "output": "[0, -1, -2, 3, -3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssm488101bqjmp2f9om7tir", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031038", "code": "def divmod_info(a, b):\n    return divmod(a, b)\n", "entry_point": "divmod_info", "input": "-7, 3", "output": "(-3, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssm488101brjmp27ic6hdkn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031039", "code": "def run_counter_trace(start, step, calls):\n    count = [start]\n    def counter():\n        count[0] += step\n        return count[0]\n    def reset():\n        count[0] = start\n        return count[0]\n    results = []\n    for c in calls:\n        if c == 'reset':\n            results.append(reset())\n        else:\n            results.append(counter())\n    return results", "entry_point": "run_counter_trace", "input": "10, 5, ['call', 'call', 'reset', 'call']", "output": "[15, 20, 10, 15]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssng1ei0000g4p249od4kif", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031040", "code": "def weird_sum(values):\n    total = 0\n    details = []\n    for v in values:\n        total += v\n        details.append(type(v).__name__)\n    return total, details", "entry_point": "weird_sum", "input": "[True, False, 3, 1.5, True]", "output": "(6.5, ['bool', 'bool', 'int', 'float', 'bool'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280001g4p2y7tduvzj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031041", "code": "def slice_variants(seq):\n    return [\n        seq[::-1],\n        seq[1:-1],\n        seq[-100:100],\n        seq[5:2],\n        seq[::2],\n    ]", "entry_point": "slice_variants", "input": "[0, 1, 2, 3, 4, 5]", "output": "[[5, 4, 3, 2, 1, 0], [1, 2, 3, 4], [0, 1, 2, 3, 4, 5], [], [0, 2, 4]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280002g4p206qcw0hz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031042", "code": "def tree_sum(node):\n    if node is None:\n        return 0\n    left = tree_sum(node.get(\"left\"))\n    right = tree_sum(node.get(\"right\"))\n    return node.get(\"value\", 0) + left + right\n\ndef build_and_sum():\n    tree = {\n        \"value\": 5,\n        \"left\": {\"value\": 3, \"left\": None, \"right\": {\"value\": 2}},\n        \"right\": {\"value\": 8, \"left\": {\"value\": -1}, \"right\": None}\n    }\n    return tree_sum(tree)", "entry_point": "build_and_sum", "input": "", "output": "17", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280003g4p2tt8t5cna", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031043", "code": "def build_lookup(pairs):\n    return {k: v for k, v in pairs}\n\ndef merge_and_count(pairs):\n    lookup = build_lookup(pairs)\n    return lookup, len(pairs) - len(lookup)", "entry_point": "merge_and_count", "input": "[('a', 1), ('b', 2), ('a', 3), ('c', 4), ('b', 5)]", "output": "({'a': 3, 'b': 5, 'c': 4}, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280004g4p2vb8qdeh9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031044", "code": "def chunk(iterable, size):\n    it = iter(iterable)\n    while True:\n        batch = []\n        for _ in range(size):\n            try:\n                batch.append(next(it))\n            except StopIteration:\n                if batch:\n                    yield batch\n                return\n        yield batch\n\ndef chunk_list(lst, size):\n    return list(chunk(lst, size))", "entry_point": "chunk_list", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280005g4p2fgx3y9cq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031045", "code": "class Shape:\n    def __init__(self, name):\n        self.name = name\n    def describe(self):\n        return f\"{self.name}: area={self.area()}\"\n    def area(self):\n        return 0\n\nclass Rectangle(Shape):\n    def __init__(self, w, h):\n        super().__init__(\"Rectangle\")\n        self.w = w\n        self.h = h\n    def area(self):\n        return self.w * self.h\n\nclass Square(Rectangle):\n    def __init__(self, s):\n        super().__init__(s, s)\n        self.name = \"Square\"\n\ndef describe_shapes():\n    shapes = [Rectangle(3,4), Square(5), Shape(\"Blob\")]\n    return [s.describe() for s in shapes]", "entry_point": "describe_shapes", "input": "", "output": "['Rectangle: area=12', 'Square: area=25', 'Blob: area=0']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280006g4p2xqi6dcdm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031046", "code": "def analyze_sets(a, b):\n    sa, sb = set(a), set(b)\n    return {\n        \"union\": sorted(sa | sb),\n        \"intersection\": sorted(sa & sb),\n        \"sym_diff\": sorted(sa ^ sb),\n        \"only_a\": sorted(sa - sb),\n    }", "entry_point": "analyze_sets", "input": "[1, 2, 3, 2, 4], [3, 4, 5, 5, 6]", "output": "{'union': [1, 2, 3, 4, 5, 6], 'intersection': [3, 4], 'sym_diff': [1, 2, 5, 6], 'only_a': [1, 2]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280008g4p2bxam0f4q", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031047", "code": "def format_report(values):\n    lines = []\n    for label, val in values:\n        if isinstance(val, float):\n            lines.append(f\"{label:>10}: {val:8.2f}\")\n        else:\n            lines.append(f\"{label:>10}: {val:>8,}\")\n    return lines", "entry_point": "format_report", "input": "[('total', 1234567), ('avg', 42.5), ('neg', -3)]", "output": "['     total: 1,234,567', '       avg:    42.50', '       neg:       -3']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh1280009g4p2jqpxhw06", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031048", "code": "def make_transaction_processor(initial_balance):\n    balance = initial_balance\n    history = []\n    def process(amount):\n        nonlocal balance\n        if balance + amount < 0:\n            history.append((\"rejected\", amount))\n            return False\n        balance += amount\n        history.append((\"applied\", amount))\n        return True\n    def summary():\n        return balance, history[:]\n    process.summary = summary\n    return process\n\ndef run_transactions(initial, amounts):\n    proc = make_transaction_processor(initial)\n    for amt in amounts:\n        proc(amt)\n    return proc.summary()", "entry_point": "run_transactions", "input": "100, [-50, 30, -200, -80, 25]", "output": "(25, [('applied', -50), ('applied', 30), ('rejected', -200), ('applied', -80), ('applied', 25)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnh128000ag4p2cy6e8t6q", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031049", "code": "class ValidationError(Exception):\n    pass\n\ndef parse_age(s):\n    try:\n        age = int(s)\n    except ValueError as e:\n        raise ValidationError(f\"invalid age: {s!r}\") from e\n    if age < 0 or age > 150:\n        raise ValidationError(f\"age out of range: {age}\")\n    return age\n\ndef safe_parse_ages(values):\n    results = []\n    for v in values:\n        try:\n            results.append(parse_age(v))\n        except ValidationError as e:\n            results.append(str(e))\n    return results", "entry_point": "safe_parse_ages", "input": "['30', 'abc', '-5', '200', '45']", "output": "[30, \"invalid age: 'abc'\", 'age out of range: -5', 'age out of range: 200', 45]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnhet2000bg4p2tkmsogh1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031050", "code": "def tokenize(expr):\n    tokens = []\n    current = \"\"\n    for ch in expr:\n        if ch in \"+-*/()\":\n            if current:\n                tokens.append(current)\n                current = \"\"\n            tokens.append(ch)\n        elif ch == \" \":\n            if current:\n                tokens.append(current)\n                current = \"\"\n        else:\n            current += ch\n    if current:\n        tokens.append(current)\n    return tokens", "entry_point": "tokenize", "input": "'12 + (3*4)-  5'", "output": "['12', '+', '(', '3', '*', '4', ')', '-', '5']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnhet2000cg4p26mwu9z6f", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031051", "code": "def rank_students(records):\n    return sorted(records, key=lambda r: (-r[1], r[2], r[0]))", "entry_point": "rank_students", "input": "[('Amy', 90, 20), ('Bob', 85, 22), ('Cid', 90, 19), ('Dan', 85, 21)]", "output": "[('Cid', 90, 19), ('Amy', 90, 20), ('Dan', 85, 21), ('Bob', 85, 22)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnhet2000dg4p24zliqztm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031052", "code": "def append_item(item, bucket=[]):\n    bucket.append(item)\n    return bucket\n\ndef run_mutation_demo():\n    a = append_item(1)\n    b = append_item(2)\n    c = append_item(3, [])\n    return a, b, c, a is b", "entry_point": "run_mutation_demo", "input": "", "output": "([1, 2, 1, 2], [1, 2, 1, 2], [3], True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnhet2000eg4p2y578elhy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031053", "code": "def group_by_length(words):\n    groups = {}\n    for w in words:\n        groups.setdefault(len(w), []).append(w)\n    return {k: groups[k] for k in sorted(groups)}", "entry_point": "group_by_length", "input": "['a', 'bb', 'cc', 'ddd', 'e', 'ffff']", "output": "{1: ['a', 'e'], 2: ['bb', 'cc'], 3: ['ddd'], 4: ['ffff']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssni7gx000gg4p2xmdg8ovu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031054", "code": "def running_average():\n    total = 0\n    count = 0\n    avg = None\n    while True:\n        value = yield avg\n        total += value\n        count += 1\n        avg = total / count\n\ndef average_trace(values):\n    gen = running_average()\n    next(gen)\n    return [gen.send(v) for v in values]", "entry_point": "average_trace", "input": "[10, 20, 30, 40]", "output": "[10.0, 15.0, 20.0, 25.0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssniip4000ig4p29uf6axbk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031055", "code": "def fib_with_cache(n, cache={}):\n    if n in cache:\n        return cache[n]\n    if n <= 1:\n        result = n\n    else:\n        result = fib_with_cache(n-1, cache) + fib_with_cache(n-2, cache)\n    cache[n] = result\n    return result", "entry_point": "fib_with_cache", "input": "10", "output": "55", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssnktje000jg4p279v0c36l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031056", "code": "def merge_windows(windows):\n    ordered = sorted(windows)\n    merged = []\n    for start, end in ordered:\n        if merged and start <= merged[-1][1]:\n            merged[-1] = (merged[-1][0], max(merged[-1][1], end))\n        else:\n            merged.append((start, end))\n    return merged", "entry_point": "merge_windows", "input": "[(5, 7), (1, 3), (2, 6), (9, 9)]", "output": "[(1, 7), (9, 9)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspw5i9002sg4p2whb4qvou", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031057", "code": "def tally_votes(ballots):\n    counts = {}\n    for ballot in ballots:\n        for rank, name in enumerate(ballot):\n            counts[name] = counts.get(name, 0) + (len(ballot) - rank)\n    return sorted(counts.items(), key=lambda kv: (-kv[1], kv[0]))", "entry_point": "tally_votes", "input": "[['ana', 'bo'], ['bo', 'cy', 'ana'], ['cy']]", "output": "[('bo', 4), ('ana', 3), ('cy', 3)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspw5ia002tg4p25wo72nzt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031058", "code": "class Ledger:\n    def __init__(self):\n        self.entries = []\n    def post(self, amount):\n        if amount == 0:\n            raise ValueError('zero entry')\n        self.entries.append(amount)\n        return len(self.entries)\n\ndef run(amounts):\n    ledger = Ledger()\n    errors = 0\n    for amount in amounts:\n        try:\n            ledger.post(amount)\n        except ValueError:\n            errors += 1\n    return sum(ledger.entries), errors, len(ledger.entries)", "entry_point": "run", "input": "[10, 0, -4, 0, 7]", "output": "(13, 2, 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspw5ia002ug4p2fdrhzyju", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031059", "code": "def first_overdraft(transactions, limit):\n    balance = 0\n    for index, amount in enumerate(transactions):\n        balance += amount\n        if balance < limit:\n            return index, balance\n    return None, balance", "entry_point": "first_overdraft", "input": "[100, -60, -30, -50, 200], -20", "output": "(3, -40)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf002vg4p2hpfmctli", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031060", "code": "def prune_stale(inventory, threshold):\n    removed = []\n    for sku in list(inventory):\n        if inventory[sku] < threshold:\n            removed.append(sku)\n            del inventory[sku]\n    return inventory, removed", "entry_point": "prune_stale", "input": "{'ab': 5, 'cd': 0, 'ef': 12, 'gh': 2}, 3", "output": "({'ab': 5, 'ef': 12}, ['cd', 'gh'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf002wg4p208xr961i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031061", "code": "def normalize_code(raw, width=4):\n    cleaned = ''.join(ch for ch in raw if ch.isalnum()).upper()\n    chunks = [cleaned[i:i + width] for i in range(0, len(cleaned), width)]\n    return '-'.join(chunks), cleaned[::-1][:width]", "entry_point": "normalize_code", "input": "'ab-12 cd/3e', 3", "output": "('AB1-2CD-3E', 'E3D')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf002xg4p2g7k2hibx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031062", "code": "def split_shifts(total_minutes, per_shift):\n    full = total_minutes // per_shift\n    remainder = total_minutes % per_shift\n    ratio = total_minutes / per_shift\n    return full, remainder, round(ratio, 2)", "entry_point": "split_shifts", "input": "-95, 30", "output": "(-4, 25, -3.17)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf002zg4p2furpyfd8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031063", "code": "def rank_entries(entries):\n    by_score = sorted(entries, key=lambda e: e[1], reverse=True)\n    return [name for name, _ in by_score]", "entry_point": "rank_entries", "input": "[('ivy', 7), ('jon', 9), ('kai', 7), ('lee', 9), ('moe', 3)]", "output": "['jon', 'lee', 'ivy', 'kai', 'moe']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0030g4p2nw3dbklz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031064", "code": "def guarded(steps):\n    log = []\n    for step in steps:\n        try:\n            if step == 'boom':\n                raise RuntimeError(step)\n            log.append('ok:' + step)\n        except RuntimeError as exc:\n            log.append('err:' + str(exc))\n            continue\n        finally:\n            log.append('fin')\n    return log", "entry_point": "guarded", "input": "['a', 'boom', 'b']", "output": "['ok:a', 'fin', 'err:boom', 'fin', 'ok:b', 'fin']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0031g4p2djp90mjw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031065", "code": "def make_adders(offsets):\n    funcs = []\n    for off in offsets:\n        funcs.append(lambda x, off=off: x + off)\n    late = []\n    for off in offsets:\n        late.append(lambda x: x + off)\n    return [f(10) for f in funcs], [f(10) for f in late]", "entry_point": "make_adders", "input": "[1, 2, 3]", "output": "([11, 12, 13], [13, 13, 13])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0032g4p23huiam7j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031066", "code": "def parse_record(line):\n    key, _, rest = line.partition('=')\n    parts = rest.split(',', 2)\n    return key.strip(), len(parts), parts", "entry_point": "parse_record", "input": "' mode = fast,,deep,extra '", "output": "('mode', 3, [' fast', '', 'deep,extra '])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0033g4p2ou02yufi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031067", "code": "def pair_up(names, scores):\n    paired = [(n, s) for n, s in zip(names, scores) if s >= 50]\n    total = sum(s for _, s in paired)\n    return paired, total, len(names) - len(scores)", "entry_point": "pair_up", "input": "['p', 'q', 'r', 's'], [80, 20, 55]", "output": "([('p', 80), ('r', 55)], 135, 1)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0034g4p2pqmcqbfs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031068", "code": "def paths(rows, cols, memo=None):\n    if memo is None:\n        memo = {}\n    if rows == 1 or cols == 1:\n        return 1\n    key = (rows, cols)\n    if key not in memo:\n        memo[key] = paths(rows - 1, cols, memo) + paths(rows, cols - 1, memo)\n    return memo[key]", "entry_point": "paths", "input": "3, 3", "output": "6", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0035g4p2gd97u6zt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031069", "code": "def audit_flags(readings, ceiling):\n    breaches = [r > ceiling for r in readings]\n    return sum(breaches), breaches.count(True), all(breaches), any(breaches)", "entry_point": "audit_flags", "input": "[3, 11, 7, 20], 10", "output": "(2, 2, False, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsspyuqf0036g4p2w5nrawi0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031070", "code": "def alternating_totals(values):\n    total=0\n    out=[]\n    for i,v in enumerate(values):\n        total += v if i%2==0 else -v\n        out.append(total)\n    return out", "entry_point": "alternating_totals", "input": "[5, 2, 4, 1]", "output": "[5, 3, 7, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwf007dg4p26ho7spcu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031071", "code": "def chunk_sums(values,size):\n    return [sum(values[i:i+size]) for i in range(0,len(values),size)]", "entry_point": "chunk_sums", "input": "[1, 2, 3, 4, 5], 2", "output": "[3, 7, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwf007eg4p2d6z2tpao", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031072", "code": "def normalize_counts(words):\n    from collections import Counter\n    c=Counter(w.lower() for w in words)\n    return sorted(c.items())", "entry_point": "normalize_counts", "input": "['A', 'b', 'a', 'B', 'c']", "output": "[('a', 2), ('b', 2), ('c', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwf007fg4p2oxtjjlpv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031073", "code": "def rotate_pairs(items):\n    return [(b,a) for a,b in items[::-1]]", "entry_point": "rotate_pairs", "input": "[(1, 'a'), (2, 'b'), (3, 'c')]", "output": "[('c', 3), ('b', 2), ('a', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007hg4p2ob3lwuy6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031074", "code": "def safe_get(mapping,path,default=None):\n    cur=mapping\n    for key in path:\n        if not isinstance(cur,dict) or key not in cur:\n            return default\n        cur=cur[key]\n    return cur", "entry_point": "safe_get", "input": "{'a': {'b': {'c': 7}}}, ['a', 'b', 'c'], 'x'", "output": "7", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007ig4p2ly0j2u56", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031075", "code": "def window_diffs(values):\n    return [values[i+1]-values[i] for i in range(len(values)-1)]", "entry_point": "window_diffs", "input": "[10, 7, 9, 3]", "output": "[-3, 2, -6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007jg4p2re87nx4e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031076", "code": "def classify(nums):\n    return {'neg':sum(x<0 for x in nums),'zero':sum(x==0 for x in nums),'pos':sum(x>0 for x in nums)}", "entry_point": "classify", "input": "[-2, 0, 4, 5, -1, 0]", "output": "{'neg': 2, 'zero': 2, 'pos': 2}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007kg4p2yxejllg5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031077", "code": "def unique_preserve(seq):\n    seen=set(); out=[]\n    for x in seq:\n        if x not in seen:\n            seen.add(x); out.append(x)\n    return out", "entry_point": "unique_preserve", "input": "[3, 1, 3, 2, 1, 4]", "output": "[3, 1, 2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007lg4p2vxs4age0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031078", "code": "def score_rows(rows):\n    return [name+':' + str(sum(vals)) for name,*vals in rows]", "entry_point": "score_rows", "input": "[('a', 2, 3), ('b', 5, -1, 2)]", "output": "['a:5', 'b:6']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007mg4p2g9rvuyur", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031079", "code": "def invert_groups(groups):\n    out={}\n    for k,vals in groups.items():\n        for v in vals:\n            out.setdefault(v,[]).append(k)\n    return out", "entry_point": "invert_groups", "input": "{'x': [1, 2], 'y': [2, 3]}", "output": "{1: ['x'], 2: ['x', 'y'], 3: ['y']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007ng4p2mn7khp0w", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031080", "code": "def clamp_and_sum(values,lo,hi):\n    return sum(min(hi,max(lo,v)) for v in values)", "entry_point": "clamp_and_sum", "input": "[-5, 3, 20, 7], 0, 10", "output": "20", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007og4p2b0i89ep1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031081", "code": "def parse_flags(tokens):\n    result={}\n    for token in tokens:\n        if token.startswith('--') and '=' in token:\n            k,v=token[2:].split('=',1); result[k]=v\n    return result", "entry_point": "parse_flags", "input": "['--mode=fast', 'x', '--retry=3', '--mode=safe']", "output": "{'mode': 'safe', 'retry': '3'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007pg4p2p8n6weih", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031082", "code": "def cumulative_lengths(words):\n    total=0; out=[]\n    for w in words:\n        total+=len(w); out.append(total)\n    return out", "entry_point": "cumulative_lengths", "input": "['ab', 'cde', '', 'x']", "output": "[2, 5, 5, 6]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007qg4p22ei52l12", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031083", "code": "def split_even_odd(nums):\n    return ([x for x in nums if x%2==0],[x for x in nums if x%2])", "entry_point": "split_even_odd", "input": "[5, 2, 8, 3, 0, -1]", "output": "([2, 8, 0], [5, 3, -1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007rg4p2j2aruwnn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031084", "code": "def summarize_matrix(m):\n    return [sum(row) for row in m], [sum(col) for col in zip(*m)]", "entry_point": "summarize_matrix", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "([6, 15], [5, 7, 9])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007sg4p2jk4a922h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031085", "code": "def take_until(values,predicate):\n    out=[]\n    for x in values:\n        if predicate(x): break\n        out.append(x)\n    return out", "entry_point": "take_until", "input": "[2, 4, 7, 8], lambda x: x % 2 == 1", "output": "[2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007tg4p2odxhirea", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031086", "code": "def index_by_initial(words):\n    out={}\n    for w in words:\n        out.setdefault(w[0].lower(),[]).append(w)\n    return out", "entry_point": "index_by_initial", "input": "['Apple', 'ant', 'Boat', 'berry']", "output": "{'a': ['Apple', 'ant'], 'b': ['Boat', 'berry']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007vg4p2obmkwd8s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031087", "code": "def pairwise_min(a,b):\n    return [min(x,y) for x,y in zip(a,b)]", "entry_point": "pairwise_min", "input": "[3, 8, -1, 5], [4, 2, -3, 9]", "output": "[3, 2, -3, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007xg4p2qz8dtsc0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031088", "code": "def guarded_divisions(pairs):\n    out=[]\n    for a,b in pairs:\n        try: out.append(round(a/b,2))\n        except ZeroDivisionError: out.append(None)\n    return out", "entry_point": "guarded_divisions", "input": "[(5, 2), (7, 0), (-3, 2)]", "output": "[2.5, None, -1.5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg007yg4p2dkwbv3p8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031089", "code": "def map_lengths(mapping):\n    return {k:len(v) for k,v in sorted(mapping.items())}", "entry_point": "map_lengths", "input": "{'b': [1, 2, 3], 'a': [], 'c': [9]}", "output": "{'a': 0, 'b': 3, 'c': 1}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg0080g4p2wgpfwgfh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031090", "code": "def weighted_sum(values):\n    return sum((i+1)*v for i,v in enumerate(values))", "entry_point": "weighted_sum", "input": "[4, -2, 3]", "output": "9", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg0082g4p20gxcz7xf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031091", "code": "def trim_empty(rows):\n    return [[x for x in row if x is not None] for row in rows if any(x is not None for x in row)]", "entry_point": "trim_empty", "input": "[[1, None, 2], [None, None], [3, 4, None]]", "output": "[[1, 2], [3, 4]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg0083g4p2fenbb2a1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031092", "code": "def histogram_lengths(words):\n    from collections import Counter\n    return dict(sorted(Counter(map(len,words)).items()))", "entry_point": "histogram_lengths", "input": "['a', 'to', 'be', 'cat', '']", "output": "{0: 1, 1: 1, 2: 2, 3: 1}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg0084g4p29zad55l5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031093", "code": "def diagonal_sum(matrix):\n    return sum(row[i] for i,row in enumerate(matrix) if i < len(row))", "entry_point": "diagonal_sum", "input": "[[2, 9, 1], [4, 3], [7, 8, 5, 6]]", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg0085g4p2lzdwiqn6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031094", "code": "def partition_threshold(values,t):\n    low=[x for x in values if x<t]; high=[x for x in values if x>=t]\n    return low,high", "entry_point": "partition_threshold", "input": "[5, 1, 7, 3, 5], 5", "output": "([1, 3], [5, 7, 5])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmssudjwg0086g4p2c02cdew6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031095", "code": "def collect(x, acc=[]):\n    acc.append(x)\n    return acc", "entry_point": "collect", "input": "1", "output": "[1, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzu00aqg4p2e3ir9cwg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031096", "code": "def build():\n    d = {}\n    d['a'] = 1\n    d['b'] = 2\n    d['a'] = 3\n    return list(d.items())", "entry_point": "build", "input": "", "output": "[('a', 3), ('b', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzu00arg4p2rzcuuwl6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031097", "code": "def dm(a, b):\n    return (a // b, a % b)", "entry_point": "dm", "input": "-7, 3", "output": "(-3, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzu00asg4p2ktuvotwh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031098", "code": "def cmp(n):\n    a = n\n    b = int(str(n))\n    return (a == b, a is b)", "entry_point": "cmp", "input": "256", "output": "(True, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzu00atg4p2upy8vf9i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031099", "code": "def chained(seq):\n    log = []\n    def val(x):\n        log.append(x)\n        return x\n    result = val(seq[0]) < val(seq[1]) < val(seq[2])\n    return (result, log)", "entry_point": "chained", "input": "[1, 0, 5]", "output": "(False, [1, 0])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00aug4p2fz677u9a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031100", "code": "def splice(xs):\n    xs[1:3] = [9, 9, 9]\n    return xs", "entry_point": "splice", "input": "[0, 1, 2, 3]", "output": "[0, 9, 9, 9, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00avg4p2xn85v05h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031101", "code": "def make():\n    fns = []\n    for i in range(3):\n        fns.append(lambda: i)\n    return [f() for f in fns]", "entry_point": "make", "input": "", "output": "[2, 2, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00awg4p2jo2mbawk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031102", "code": "def order(pairs):\n    return sorted(pairs, key=lambda p: p[0])", "entry_point": "order", "input": "[(1, 'a'), (0, 'b'), (1, 'c'), (0, 'd')]", "output": "[(0, 'b'), (0, 'd'), (1, 'a'), (1, 'c')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00axg4p2azmwoq3t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031103", "code": "def dedup(xs):\n    seen = set()\n    out = []\n    for x in xs:\n        if x not in seen:\n            seen.add(x)\n            out.append(x)\n    return out", "entry_point": "dedup", "input": "[3, 1, 3, 2, 1, 4]", "output": "[3, 1, 2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00ayg4p2bl2xhrtc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031104", "code": "def rep(s, n):\n    return (s * n, bool(s * n))", "entry_point": "rep", "input": "'ab', 3", "output": "('ababab', True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00azg4p2qi2i2n6d", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031105", "code": "def gen():\n    log = []\n    def g():\n        for i in range(3):\n            log.append(('yield', i))\n            yield i * i\n    squares = list(g())\n    return (squares, log)", "entry_point": "gen", "input": "", "output": "([0, 1, 4], [('yield', 0), ('yield', 1), ('yield', 2)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b0g4p22eqs4joi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031106", "code": "def parse(items):\n    out = []\n    for it in items:\n        try:\n            out.append(int(it))\n        except ValueError:\n            out.append(None)\n    return out", "entry_point": "parse", "input": "['1', 'x', '3', '']", "output": "[1, None, 3, None]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b1g4p2gar9tz3g", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031107", "code": "def counts(text):\n    c = {}\n    for ch in text:\n        c[ch] = c.get(ch, 0) + 1\n    return sorted(c.items())", "entry_point": "counts", "input": "'banana'", "output": "[('a', 3), ('b', 1), ('n', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b2g4p28ls4u583", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031108", "code": "def split(xs):\n    first, *middle, last = xs\n    return (first, middle, last)", "entry_point": "split", "input": "[10, 20, 30, 40, 50]", "output": "(10, [20, 30, 40], 50)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b3g4p2ujqji6zo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031109", "code": "def half(n):\n    return (n / 2, n // 2)", "entry_point": "half", "input": "5", "output": "(2.5, 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b4g4p29yoco2m9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031110", "code": "def pick(a, b):\n    return (a or b, a and b)", "entry_point": "pick", "input": "0, 5", "output": "(5, 0)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b5g4p21dbimg2s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031111", "code": "def grow(xs, s):\n    xs.append(s)\n    xs.extend(s)\n    return xs", "entry_point": "grow", "input": "[], 'hi'", "output": "['hi', 'h', 'i']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b6g4p2efbcvcwr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031112", "code": "def pairup(a, b):\n    return [(i, x, y) for i, (x, y) in enumerate(zip(a, b), start=1)]", "entry_point": "pairup", "input": "[1, 2, 3, 4], ['a', 'b', 'c']", "output": "[(1, 1, 'a'), (2, 2, 'b'), (3, 3, 'c')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b7g4p29phax3pj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031113", "code": "def rnd(xs):\n    return [round(x) for x in xs]", "entry_point": "rnd", "input": "[0.5, 1.5, 2.5, 3.5]", "output": "[0, 2, 2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b8g4p2juewpe8o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031114", "code": "def alias():\n    a = [1, 2, 3]\n    b = a\n    c = a[:]\n    a.append(4)\n    return (b, c)", "entry_point": "alias", "input": "", "output": "([1, 2, 3, 4], [1, 2, 3])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst1udzv00b9g4p2fphu3npc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031115", "code": "class Point:\n    __slots__ = ('x', 'y')\n\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\n\nclass Tagged(Point):\n    pass\n\n\ndef slots_probe():\n    report = []\n    p = Point(1, 2)\n    try:\n        p.z = 3\n        report.append('assigned')\n    except AttributeError as exc:\n        report.append(type(exc).__name__)\n    report.append(hasattr(p, '__dict__'))\n    t = Tagged(3, 4)\n    t.z = 5\n    report.append(hasattr(t, '__dict__'))\n    report.append(t.z + t.x)\n    report.append(Point.__slots__)\n    return tuple(report)", "entry_point": "slots_probe", "input": "", "output": "('AttributeError', False, True, 8, ('x', 'y'))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00ceg4p2ckihxdpc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031116", "code": "class Thermostat:\n    def __init__(self, celsius):\n        self._history = []\n        self.celsius = celsius\n\n    @property\n    def celsius(self):\n        return self._celsius\n\n    @celsius.setter\n    def celsius(self, value):\n        self._celsius = max(0, min(40, value))\n        self._history.append(self._celsius)\n\n    @property\n    def fahrenheit(self):\n        return self._celsius * 9 / 5 + 32\n\n\ndef thermostat_run():\n    t = Thermostat(55)\n    t.celsius = -10\n    t.celsius = 21\n    locked = None\n    try:\n        t.fahrenheit = 100\n    except AttributeError:\n        locked = 'read-only'\n    return (t.celsius, t.fahrenheit, t._history, locked)", "entry_point": "thermostat_run", "input": "", "output": "(21, 69.8, [40, 0, 21], 'read-only')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cfg4p2od2o36h3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031117", "code": "class Quiet:\n    def __init__(self, *exc_types):\n        self.exc_types = exc_types\n        self.caught = None\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc, tb):\n        if exc_type is not None and issubclass(exc_type, self.exc_types):\n            self.caught = exc_type.__name__\n            return True\n        return False\n\n\ndef suppress_run():\n    log = []\n    q = Quiet(ValueError)\n    with q:\n        log.append('start')\n        raise ValueError('bad')\n        log.append('unreachable')\n    log.append('after')\n    log.append(q.caught)\n    try:\n        with Quiet(ValueError):\n            raise KeyError('k')\n    except KeyError as exc:\n        log.append(exc.args[0])\n    return log", "entry_point": "suppress_run", "input": "", "output": "['start', 'after', 'ValueError', 'k']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cgg4p2naan9btd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031118", "code": "from dataclasses import dataclass, field\n\n\n@dataclass(order=True)\nclass Task:\n    priority: int\n    name: str = field(compare=False)\n    tags: list = field(default_factory=list, compare=False)\n\n\ndef task_run():\n    a = Task(2, 'alpha')\n    b = Task(2, 'beta', ['x'])\n    c = Task(1, 'gamma')\n    ordered = [t.name for t in sorted([a, b, c])]\n    return (a == b, a < c, ordered, repr(c))", "entry_point": "task_run", "input": "", "output": "(True, False, ['gamma', 'alpha', 'beta'], \"Task(priority=1, name='gamma', tags=[])\")", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00chg4p2ibju1cgi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031119", "code": "def make_counter():\n    count = 0\n    history = []\n\n    def bump(step=1):\n        nonlocal count\n        count += step\n        history.append(count)\n        return count\n\n    def reset():\n        count = 0\n        return count\n\n    return bump, reset, (lambda: count), history\n\n\ndef counter_run():\n    bump, reset, peek, history = make_counter()\n    bump()\n    bump(3)\n    before = peek()\n    returned = reset()\n    return (before, returned, peek(), bump(0), history)", "entry_point": "counter_run", "input": "", "output": "(4, 0, 4, 4, [1, 4, 4])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cig4p2jd6dfjp3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031120", "code": "from collections import defaultdict\n\n\ndef build_groups(keys):\n    calls = []\n\n    def expensive(k):\n        calls.append(k)\n        return [k]\n\n    plain = {}\n    for k in keys:\n        plain.setdefault(k, expensive(k)).append('p')\n\n    dd = defaultdict(list)\n    for k in keys:\n        dd[k].append('d')\n\n    return (plain, len(calls), calls, dict(dd), dd['zz'], len(dd))", "entry_point": "build_groups", "input": "['a', 'b', 'a']", "output": "({'a': ['a', 'p', 'p'], 'b': ['b', 'p']}, 3, ['a', 'b', 'a'], {'a': ['d', 'd'], 'b': ['d']}, [], 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cjg4p2ohaiqbh4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031121", "code": "def grid_report(rows, cols):\n    shallow = [[0] * cols] * rows\n    proper = [[0] * cols for _ in range(rows)]\n    shallow[0][0] = 9\n    proper[0][0] = 9\n    row = [1, 2]\n    row *= 2\n    nested = [row]\n    nested *= 2\n    nested[0].append(7)\n    return (shallow, proper, nested, nested[0] is nested[1], row is nested[1])", "entry_point": "grid_report", "input": "2, 3", "output": "([[9, 0, 0], [9, 0, 0]], [[9, 0, 0], [0, 0, 0]], [[1, 2, 1, 2, 7], [1, 2, 1, 2, 7]], True, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00ckg4p2hfyy988o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031122", "code": "def chain_probe(values):\n    calls = []\n\n    def mid(v):\n        calls.append(v)\n        return v\n\n    results = []\n    for v in values:\n        results.append(1 < mid(v) < 10)\n    short = 0 < mid(-5) < mid(99)\n    return (results, calls, short)", "entry_point": "chain_probe", "input": "[5, 20]", "output": "([True, False], [5, 20, -5], False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00clg4p2n7uwnsn8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031123", "code": "def identity_probe():\n    small_a, small_b = 256, int('256')\n    big_a, big_b = 257, int('257')\n    neg_a, neg_b = -5, int('-5')\n    far_a, far_b = -6, int('-6')\n    return (\n        (small_a == small_b, small_a is small_b),\n        (big_a == big_b, big_a is big_b),\n        (neg_a == neg_b, neg_a is neg_b),\n        (far_a == far_b, far_a is far_b),\n    )", "entry_point": "identity_probe", "input": "", "output": "((True, True), (True, False), (True, True), (True, False))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cmg4p2d7adiujo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031124", "code": "def rank(records):\n    by_tuple = [r['name'] for r in sorted(records, key=lambda r: (r['score'], r['name']))]\n    reversed_all = [r['name'] for r in sorted(records, key=lambda r: (r['score'], r['name']), reverse=True)]\n    negated = [r['name'] for r in sorted(records, key=lambda r: (-r['score'], r['name']))]\n    ties_kept = [r['name'] for r in sorted(records, key=lambda r: r['score'], reverse=True)]\n    return (by_tuple, reversed_all, negated, ties_kept)", "entry_point": "rank", "input": "[{'name': 'ana', 'score': 3}, {'name': 'bo', 'score': 1}, {'name': 'cy', 'score': 3}, {'name': 'al', 'score': 3}]", "output": "(['bo', 'al', 'ana', 'cy'], ['cy', 'ana', 'al', 'bo'], ['al', 'ana', 'cy', 'bo'], ['ana', 'cy', 'al', 'bo'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cng4p2gcpv0qew", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031125", "code": "def normalize(text):\n    table = str.maketrans({'a': '4', 'e': None, 'l': 'LL', ' ': '_'})\n    strict = text.translate(table)\n    fallback = text.translate(str.maketrans('abc', 'xyz', 'd'))\n    return (strict, fallback, len(strict), text.translate({}) == text)", "entry_point": "normalize", "input": "'ale bead'", "output": "('4LL_b4d', 'xle yex', 7, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cog4p27c04pk9j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031126", "code": "def accumulator(start=0):\n    total = start\n    received = []\n    while True:\n        value = yield total\n        if value is None:\n            received.append('none')\n            continue\n        total += value\n        received.append(value)\n        if total > 100:\n            return received\n\n\ndef drive(steps):\n    gen = accumulator(10)\n    seen = [next(gen)]\n    ended = None\n    for s in steps:\n        try:\n            seen.append(gen.send(s))\n        except StopIteration as stop:\n            ended = stop.value\n            break\n    return (seen, ended)", "entry_point": "drive", "input": "[5, 20, None, 70]", "output": "([10, 15, 35, 35], [5, 20, 'none', 70])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cpg4p2wr5hjruj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031127", "code": "from itertools import islice, tee\n\n\ndef split_probe(source):\n    it = iter(source)\n    first = next(it)\n    a, b = tee(it, 2)\n    head_a = list(islice(a, 2))\n    stolen = next(it)\n    head_b = list(islice(b, 2))\n    rest_a = list(a)\n    rest_b = list(b)\n    return (first, head_a, head_b, stolen, rest_a, rest_b, stolen in rest_b)", "entry_point": "split_probe", "input": "[1, 2, 3, 4, 5, 6, 7]", "output": "(1, [2, 3], [2, 3], 4, [5, 6, 7], [5, 6, 7], False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cqg4p2su3ut2cn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031128", "code": "from itertools import zip_longest\n\n\ndef merge(names, scores):\n    padded = ['{}:{}'.format(n, s) for n, s in zip_longest(names, scores, fillvalue='?')]\n    truncated = list(zip(names, scores))\n    numeric = dict(zip_longest(names, scores, fillvalue=0))\n    default_fill = list(zip_longest(names, scores))\n    return (padded, len(truncated), numeric, default_fill[-1])", "entry_point": "merge", "input": "['a', 'b', 'c'], [1, 2]", "output": "(['a:1', 'b:2', 'c:?'], 2, {'a': 1, 'b': 2, 'c': 0}, ('c', None))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00crg4p2x4jnu947", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031129", "code": "from functools import partial\n\n\ndef report(label, *values, sep='-', upper=False):\n    body = sep.join(str(v) for v in values)\n    text = '{}{}{}'.format(label, sep, body)\n    return text.upper() if upper else text\n\n\ndef partial_run():\n    p1 = partial(report, 'head')\n    p2 = partial(report, sep='|')\n    p3 = partial(p1, 1, 2, upper=True)\n    a = p1(1, 2)\n    b = p2('x', 9, sep='+')\n    c = p3(3)\n    d = partial(report, 'A', 'B')('C')\n    return (a, b, c, d, p3.args, p1.func is report)", "entry_point": "partial_run", "input": "", "output": "('head-1-2', 'x+9', 'HEAD-1-2-3', 'A-B-C', ('head', 1, 2), True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00csg4p2tihi23ya", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031130", "code": "class Tracker:\n    def __init__(self):\n        self.data = {'x': 1}\n        self.hits = []\n\n    def __getattr__(self, name):\n        self.hits.append(('missing', name))\n        if name in self.data:\n            return self.data[name]\n        raise AttributeError(name)\n\n\nclass Loud:\n    def __init__(self):\n        object.__setattr__(self, 'log', [])\n        object.__setattr__(self, 'real', 7)\n\n    def __getattribute__(self, name):\n        object.__getattribute__(self, 'log').append(name)\n        if name == 'real':\n            return 'intercepted'\n        return object.__getattribute__(self, name)\n\n    def __getattr__(self, name):\n        return 'fallback:' + name\n\n\ndef attr_run():\n    t = Tracker()\n    got = (t.x, t.data['x'])\n    err = None\n    try:\n        t.nope\n    except AttributeError as exc:\n        err = exc.args[0]\n    hits = list(t.hits)\n    lo = Loud()\n    values = (lo.real, lo.missing)\n    raw = object.__getattribute__(lo, 'real')\n    return (got, hits, err, values, raw, lo.log)", "entry_point": "attr_run", "input": "", "output": "((1, 1), [('missing', 'x'), ('missing', 'nope')], 'nope', ('intercepted', 'fallback:missing'), 7, ['real', 'missing', 'log'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00ctg4p2gt67dvhy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031131", "code": "def build_config():\n    scale = 10\n\n    class Config:\n        base = [1, 2, 3]\n        doubled = [v * 2 for v in base]\n        scaled = [v * scale for v in base]\n        try:\n            widths = [v * len(base) for v in base]\n        except NameError as exc:\n            widths = type(exc).__name__\n\n    return (Config.doubled, Config.scaled, Config.widths, [v * len(Config.base) for v in Config.base])", "entry_point": "build_config", "input": "", "output": "([2, 4, 6], [10, 20, 30], 'NameError', [3, 6, 9])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cug4p2kjybo9y3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031132", "code": "def explicit(raw):\n    try:\n        return int(raw)\n    except ValueError as exc:\n        raise TypeError('bad literal') from exc\n\n\ndef implicit(raw):\n    try:\n        return int(raw)\n    except ValueError:\n        raise TypeError('implicit')\n\n\ndef cleaned(raw):\n    try:\n        return int(raw)\n    except ValueError:\n        raise TypeError('clean') from None\n\n\ndef inspect(fn, raw):\n    try:\n        fn(raw)\n    except TypeError as exc:\n        cause = type(exc.__cause__).__name__ if exc.__cause__ is not None else None\n        context = type(exc.__context__).__name__ if exc.__context__ is not None else None\n        return (exc.args[0], cause, context, exc.__suppress_context__)\n    return 'no error'\n\n\ndef chain_report():\n    return (inspect(explicit, 'x'), inspect(implicit, 'x'), inspect(cleaned, 'x'), inspect(explicit, '7'))", "entry_point": "chain_report", "input": "", "output": "(('bad literal', 'ValueError', 'ValueError', True), ('implicit', None, 'ValueError', False), ('clean', None, 'ValueError', True), 'no error')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cvg4p2utz2o1cm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031133", "code": "def combine(base, extra):\n    left = base | extra\n    right = extra | base\n    inplace = dict(base)\n    inplace |= extra\n    from_pairs = dict(base)\n    from_pairs |= [('z', 9), ('a', 0)]\n    err = None\n    try:\n        base | [('q', 1)]\n    except TypeError:\n        err = 'TypeError'\n    return (left, right, inplace, from_pairs, base, left is base, err)", "entry_point": "combine", "input": "{'a': 1, 'b': 2}, {'b': 20, 'c': 3}", "output": "({'a': 1, 'b': 20, 'c': 3}, {'b': 2, 'c': 3, 'a': 1}, {'a': 1, 'b': 20, 'c': 3}, {'a': 0, 'b': 2, 'z': 9}, {'a': 1, 'b': 2}, False, 'TypeError')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmst58o6y00cxg4p23x6wiu7d", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031134", "code": "def dedupe_runs(values):\n    out = []\n    for value in values:\n        if not out or out[-1] != value:\n            out.append(value)\n    return out, len(values) - len(out)", "entry_point": "dedupe_runs", "input": "[1, 1, 2, 2, 2, 1, 3, 3]", "output": "([1, 2, 1, 3], 4)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsu44b3l00f8g4p2s7gzhuxm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031135", "code": "def rotate(matrix):\n    return [list(row) for row in zip(*matrix[::-1])]", "entry_point": "rotate", "input": "[[1, 2], [3, 4], [5, 6]]", "output": "[[5, 3, 1], [6, 4, 2]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsu44b3l00f9g4p23xc4r2s1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031136", "code": "def chunk_budget(costs, budget):\n    batches = []\n    current = []\n    running = 0\n    for cost in costs:\n        if running + cost > budget and current:\n            batches.append(current)\n            current = []\n            running = 0\n        current.append(cost)\n        running += cost\n    if current:\n        batches.append(current)\n    return batches", "entry_point": "chunk_budget", "input": "[4, 3, 5, 1, 9, 2], 8", "output": "[[4, 3], [5, 1], [9], [2]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsu44b3l00fag4p2bor4o7ht", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031137", "code": "def walk(tree, depth=0):\n    if not isinstance(tree, dict):\n        return [(depth, tree)]\n    found = []\n    for key in sorted(tree):\n        found.append((depth, key))\n        found.extend(walk(tree[key], depth + 1))\n    return found", "entry_point": "walk", "input": "{'b': {'d': 1}, 'a': 2}", "output": "[(0, 'a'), (1, 2), (0, 'b'), (1, 'd'), (2, 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsu44b3l00fcg4p2f8jsdzos", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031138", "code": "def reorder_report(stock, thresholds):\n    report = []\n    for sku in sorted(stock):\n        on_hand = stock[sku]\n        floor = thresholds.get(sku, 10)\n        if on_hand < floor:\n            report.append((sku, floor - on_hand))\n    return report", "entry_point": "reorder_report", "input": "{'axe': 3, 'bolt': 40, 'cog': 10}, {'axe': 12, 'cog': 10}", "output": "[('axe', 9)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fsg4p20136xcoq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031139", "code": "def backoff_schedule(attempts, base, ceiling):\n    delays = []\n    delay = base\n    for _ in range(attempts):\n        delays.append(min(delay, ceiling))\n        delay *= 2\n    return delays", "entry_point": "backoff_schedule", "input": "6, 3, 20", "output": "[3, 6, 12, 20, 20, 20]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800ftg4p2p3szc8us", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031140", "code": "def rank_versions(tags):\n    def key(tag):\n        return tuple(int(part) for part in tag.lstrip(\"v\").split(\".\"))\n    ordered = sorted(tags, key=key, reverse=True)\n    return ordered[0], ordered[-1]", "entry_point": "rank_versions", "input": "['v1.9.0', 'v1.10.2', 'v1.2.30', 'v1.10.10']", "output": "('v1.10.10', 'v1.2.30')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fug4p2t4jrfh01", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031141", "code": "from collections import deque\n\ndef peak_window(readings, width):\n    window = deque(maxlen=width)\n    peaks = []\n    for value in readings:\n        window.append(value)\n        if len(window) == width:\n            peaks.append(max(window))\n    return peaks", "entry_point": "peak_window", "input": "[4, 1, 7, 3, 3, 9], 3", "output": "[7, 7, 7, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fvg4p2jhkwqits", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031142", "code": "def merge_spans(spans):\n    merged = []\n    for start, end in sorted(spans):\n        if merged and start <= merged[-1][1]:\n            previous_start, previous_end = merged[-1]\n            merged[-1] = (previous_start, max(previous_end, end))\n        else:\n            merged.append((start, end))\n    return merged", "entry_point": "merge_spans", "input": "[(5, 8), (1, 3), (2, 6), (11, 12)]", "output": "[(1, 8), (11, 12)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fwg4p2ydm82nni", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031143", "code": "class QuotaError(Exception):\n    pass\n\ndef consume(units, budget):\n    trail = []\n    try:\n        if units > budget:\n            raise QuotaError(\"over budget\")\n        trail.append(\"charged\")\n        return trail\n    except QuotaError as exc:\n        trail.append(\"denied:\" + str(exc))\n        return trail\n    finally:\n        trail.append(\"audited\")", "entry_point": "consume", "input": "3, 10", "output": "['charged', 'audited']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fxg4p2i9agi3rr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031144", "code": "import itertools\n\ndef first_stable(readings, tolerance):\n    pairs = zip(readings, readings[1:])\n    steady = (a for a, b in pairs if abs(a - b) <= tolerance)\n    return list(itertools.islice(steady, 2))", "entry_point": "first_stable", "input": "[10, 11, 30, 31, 31, 80], 1", "output": "[10, 30]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fyg4p2hq4mv57s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031145", "code": "from collections import Counter\n\ndef top_endpoints(paths, limit):\n    counts = Counter(paths)\n    return counts.most_common(limit)", "entry_point": "top_endpoints", "input": "['/a', '/b', '/a', '/c', '/b', '/a'], 2", "output": "[('/a', 3), ('/b', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800fzg4p2ogxn6tr8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031146", "code": "def split_object_key(key):\n    prefix, separator, name = key.rpartition(\"/\")\n    stem, dot, extension = name.partition(\".\")\n    return prefix, stem, extension or \"none\"", "entry_point": "split_object_key", "input": "'templates/2026/report.final.docx'", "output": "('templates/2026', 'report', 'final.docx')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g0g4p2oeq8zi6i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031147", "code": "def make_collector():\n    def collect(entry, sink=[]):\n        sink.append(entry)\n        return list(sink)\n    return collect\n\ndef audit_trail():\n    collect = make_collector()\n    first = collect(\"open\")\n    second = collect(\"close\")\n    return first, second", "entry_point": "audit_trail", "input": "", "output": "(['open'], ['open', 'close'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g1g4p21z2j6rz1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031148", "code": "from functools import lru_cache\n\ndef probe():\n    @lru_cache(maxsize=None)\n    def steps(n):\n        if n < 2:\n            return n\n        return steps(n - 1) + steps(n - 2)\n\n    value = steps(10)\n    info = steps.cache_info()\n    return value, info.hits, info.misses", "entry_point": "probe", "input": "", "output": "(55, 8, 11)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g2g4p22kplf9sg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031149", "code": "def round_half_even(values):\n    return [round(value) for value in values]", "entry_point": "round_half_even", "input": "[0.5, 1.5, 2.5, -0.5, -1.5]", "output": "[0, 2, 2, 0, -2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g3g4p2f58pro0n", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031150", "code": "def clock_offsets(offsets, period):\n    return [(offset // period, offset % period) for offset in offsets]", "entry_point": "clock_offsets", "input": "[7, -7, 0, -1], 3", "output": "[(2, 1), (-3, 2), (0, 0), (-1, 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g4g4p2na06pi29", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031151", "code": "def splice(rows, start, stop, replacement):\n    copy = list(rows)\n    copy[start:stop] = replacement\n    return copy, len(copy)", "entry_point": "splice", "input": "[1, 2, 3, 4, 5], 1, 4, ['x']", "output": "([1, 'x', 5], 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g5g4p24eveh8ou", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031152", "code": "def index_by_initial(names):\n    index = {}\n    for name in names:\n        index.setdefault(name[0], []).append(name)\n    return index", "entry_point": "index_by_initial", "input": "['ana', 'arun', 'bo', 'ada']", "output": "{'a': ['ana', 'arun', 'ada'], 'b': ['bo']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g6g4p2zthh04b4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031153", "code": "def format_ids(raw_ids, width):\n    return [str(raw).zfill(width) for raw in raw_ids]", "entry_point": "format_ids", "input": "[7, 42, 12345], 4", "output": "['0007', '0042', '12345']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g7g4p20aovw49a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031154", "code": "def sort_tickets(tickets):\n    return sorted(tickets, key=lambda ticket: ticket[1])", "entry_point": "sort_tickets", "input": "[('a', 2), ('b', 1), ('c', 2), ('d', 1)]", "output": "[('b', 1), ('d', 1), ('a', 2), ('c', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g8g4p22iz4bwny", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031155", "code": "import itertools\n\ndef align(expected, actual):\n    return list(itertools.zip_longest(expected, actual, fillvalue=\"-\"))", "entry_point": "align", "input": "['a', 'b', 'c'], ['a', 'b']", "output": "[('a', 'a'), ('b', 'b'), ('c', '-')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800g9g4p2jhyyq71r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031156", "code": "def commit(value):\n    log = []\n    try:\n        log.append(\"try\")\n        return log + [\"from-try\"]\n    finally:\n        log.append(\"finally\")\n\ndef observe():\n    return commit(1)", "entry_point": "observe", "input": "", "output": "['try', 'from-try']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800gag4p2hx7o7a38", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031157", "code": "import bisect\n\ndef insert_sorted(scores, incoming):\n    ordered = list(scores)\n    positions = []\n    for score in incoming:\n        position = bisect.bisect_left(ordered, score)\n        ordered.insert(position, score)\n        positions.append(position)\n    return ordered, positions", "entry_point": "insert_sorted", "input": "[10, 20, 30], [25, 10, 40]", "output": "([10, 10, 20, 25, 30, 40], [2, 0, 5])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsudv4e800gbg4p27e5ydfek", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031158", "code": "from collections import defaultdict\n\ndef group_by_parity(nums):\n    groups = defaultdict(list)\n    for n in nums:\n        groups['even' if n % 2 == 0 else 'odd'].append(n)\n    return dict(groups)", "entry_point": "group_by_parity", "input": "[1, 2, 3, 4, 5, 6]", "output": "{'odd': [1, 3, 5], 'even': [2, 4, 6]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsugy1v400h6g4p2etkow937", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031159", "code": "def append_to(value, target=[]):\n    target.append(value)\n    return target", "entry_point": "append_to", "input": "1", "output": "[1, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsugy75f00h7g4p24asmp0ij", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031160", "code": "def process(value):\n    log = []\n    try:\n        if value < 0:\n            raise ValueError('negative')\n        log.append(f'ok:{value}')\n    except ValueError as e:\n        log.append(f'error:{e}')\n    finally:\n        log.append('cleanup')\n    return log", "entry_point": "process", "input": "-5", "output": "['error:negative', 'cleanup']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsugyc7500h8g4p2pos2w3r5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031161", "code": "def format_report(name, score):\n    grade = 'A' if score >= 90 else ('B' if score >= 80 else 'C')\n    return f\"{name}: {score} ({grade})\"", "entry_point": "format_report", "input": "'Alice', 92", "output": "'Alice: 92 (A)'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuhgank00jhg4p2xcieo4ea", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031162", "code": "def factorial_acc(n, acc=1):\n    if n <= 1:\n        return acc\n    return factorial_acc(n - 1, acc * n)", "entry_point": "factorial_acc", "input": "6", "output": "720", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuhgank00jig4p24gujpqsm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031163", "code": "def set_ops(a, b):\n    return (sorted(a & b), sorted(a | b), sorted(a - b))", "entry_point": "set_ops", "input": "{1, 2, 3}, {2, 3, 4}", "output": "([2, 3], [1, 2, 3, 4], [1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuhgank00jjg4p2xeci78be", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031164", "code": "def reverse_words(s):\n    return ' '.join(s.split()[::-1])", "entry_point": "reverse_words", "input": "'the quick brown fox'", "output": "'fox brown quick the'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuhgank00jkg4p2xl514f3s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031165", "code": "def dedupe_preserve_order(items):\n    seen = set()\n    result = []\n    for x in items:\n        if x not in seen:\n            seen.add(x)\n            result.append(x)\n    return result", "entry_point": "dedupe_preserve_order", "input": "[3, 1, 3, 2, 1, 4]", "output": "[3, 1, 2, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuj9zm400lrg4p2hq6v1apu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031166", "code": "def chunk_list(lst, size):\n    return [lst[i:i+size] for i in range(0, len(lst), size)]", "entry_point": "chunk_list", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuj9zm400lsg4p2y5ck4p68", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031167", "code": "def try_parse_int(values):\n    results = []\n    for v in values:\n        try:\n            results.append(int(v))\n        except ValueError:\n            results.append(None)\n    return results", "entry_point": "try_parse_int", "input": "['42', 'abc', '-7', '3.5']", "output": "[42, None, -7, None]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuj9zm400ltg4p2bdlpv7oe", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031168", "code": "class Counter2:\n    def __init__(self):\n        self.counts = {}\n    def add(self, key):\n        self.counts[key] = self.counts.get(key, 0) + 1\n        return self.counts[key]\n\ndef run_trace():\n    c = Counter2()\n    results = [c.add('a'), c.add('b'), c.add('a'), c.add('a')]\n    return results", "entry_point": "run_trace", "input": "", "output": "[1, 1, 2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuj9zm400lug4p2c6xtv3u7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031169", "code": "def flatten_one_level(nested):\n    result = []\n    for item in nested:\n        if isinstance(item, list):\n            result.extend(item)\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten_one_level", "input": "[1, [2, 3], [4, [5, 6]], 7]", "output": "[1, 2, 3, 4, [5, 6], 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsuj9zm400lvg4p2ssgoys0m", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031170", "code": "from collections import defaultdict\n\ndef bucket_by_grade(entries, curve=0):\n    buckets = defaultdict(list)\n    for name, score in entries:\n        try:\n            adjusted = score + curve\n            if adjusted >= 90:\n                grade = \"A\"\n            elif adjusted >= 80:\n                grade = \"B\"\n            elif adjusted >= 70:\n                grade = \"C\"\n            else:\n                grade = \"F\"\n        except TypeError:\n            grade = \"invalid\"\n        buckets[grade].append(name)\n    return dict(buckets)", "entry_point": "bucket_by_grade", "input": "[('Alice', 85), ('Bob', 72), ('Carol', 66), ('Dave', 'absent'), ('Eve', 95)], curve=5", "output": "{'A': ['Alice', 'Eve'], 'C': ['Bob', 'Carol'], 'invalid': ['Dave']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsupb4pg011rg4p2jd6gu5m5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031171", "code": "def parse_config_lines(lines):\n    parsed = {}\n    errors = []\n    for line_no, raw_line in enumerate(lines, start=1):\n        line = raw_line.strip()\n        if not line or line.startswith(\"#\"):\n            continue\n        try:\n            key, value = line.split(\"=\", 1)\n        except ValueError:\n            errors.append(f\"line {line_no}: missing '='\")\n            continue\n        key = key.strip()\n        value = value.strip()\n        if not key:\n            errors.append(f\"line {line_no}: empty key\")\n            continue\n        if value.lstrip(\"-\").isdigit():\n            value = int(value)\n        parsed[key] = value\n    return parsed, errors", "entry_point": "parse_config_lines", "input": "['# config file', '', 'timeout=30', 'retries=-5', 'path=/usr/local/bin=extra', 'bad_line_no_equals', '  = orphan_value', 'timeout=60']", "output": "({'timeout': 60, 'retries': -5, 'path': '/usr/local/bin=extra'}, [\"line 6: missing '='\", 'line 7: empty key'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsupb4pg011sg4p2xwqfwhdh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031172", "code": "def make_counter(start=0):\n    count = start\n    def increment(step=1):\n        nonlocal count\n        count += step\n        return count\n    return increment\n\ndef run_sequence():\n    c = make_counter()\n    return [c(), c(2), c()]", "entry_point": "run_sequence", "input": "", "output": "[1, 3, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv70ftv018sg4p2ydw8qxyh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031173", "code": "def echo_transform():\n    total = 0\n    while True:\n        received = yield total\n        if received is None:\n            break\n        total += received\n\ndef run_generator():\n    g = echo_transform()\n    first = next(g)\n    second = g.send(3)\n    third = g.send(4)\n    return [first, second, third]", "entry_point": "run_generator", "input": "", "output": "[0, 3, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv70uct018yg4p2nrepmjek", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031174", "code": "def counter_decorator(func):\n    func.calls = 0\n    def wrapper(*args, **kwargs):\n        func.calls += 1\n        wrapper.calls = func.calls\n        return func(*args, **kwargs)\n    return wrapper\n\ndef upper_decorator(func):\n    def wrapper(*args, **kwargs):\n        result = func(*args, **kwargs)\n        return result.upper() if isinstance(result, str) else result\n    return wrapper\n\n@counter_decorator\n@upper_decorator\ndef greet(name):\n    return f\"hello {name}\"\n", "entry_point": "greet", "input": "'ann'", "output": "'HELLO ANN'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv72054019hg4p2ibr1t678", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031175", "code": "def compute(x):\n    try:\n        if x == 0:\n            raise ValueError(\"zero\")\n        return x * 2\n    except ValueError:\n        return -1\n    finally:\n        if x == 0:\n            return 99", "entry_point": "compute", "input": "5", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv72ekl019qg4p2g385f8z6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031176", "code": "def make_funcs():\n    return [lambda: i for i in range(4)]\n\ndef call_all(funcs):\n    return [f() for f in funcs]", "entry_point": "call_all", "input": "make_funcs()", "output": "[3, 3, 3, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv740si01a6g4p2i1o0j120", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031177", "code": "def build_map(pairs):\n    return {k % 3: v for k, v in pairs}", "entry_point": "build_map", "input": "[(1, 'a'), (4, 'b'), (7, 'c'), (2, 'd')]", "output": "{1: 'c', 2: 'd'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv74ghl01agg4p2p4hav0es", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031178", "code": "def format_report(value, width):\n    return f\"{value:>{width}.2f}|{value:+.1e}|{value!r}\"\n", "entry_point": "format_report", "input": "-3.14159, 10", "output": "'     -3.14|-3.1e+00|-3.14159'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv752v501aqg4p24htm4s5x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031179", "code": "import functools\n\ncalls = []\n\n@functools.lru_cache(maxsize=None)\ndef fib(n):\n    calls.append(n)\n    if n < 2:\n        return n\n    return fib(n - 1) + fib(n - 2)\n", "entry_point": "fib", "input": "7", "output": "13", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv75fnt01b1g4p2fgtsy27t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031180", "code": "import itertools\n\ndef group_consecutive(items):\n    return [(k, list(g)) for k, g in itertools.groupby(items)]", "entry_point": "group_consecutive", "input": "[1, 1, 2, 1, 1, 3, 3]", "output": "[(1, [1, 1]), (2, [2]), (1, [1, 1]), (3, [3, 3])]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv75x1v01bbg4p2drp84f21", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031181", "code": "def make_funcs_fixed():\n    return [lambda i=i: i for i in range(4)]\n\ndef call_all(funcs):\n    return [f() for f in funcs]", "entry_point": "call_all", "input": "make_funcs_fixed()", "output": "[0, 1, 2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv76bxg01bmg4p2ktz0uxh4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031182", "code": "def scoping_demo():\n    x = 10\n    gen = (x + i for i in range(3))\n    x = 100\n    return list(gen)", "entry_point": "scoping_demo", "input": "", "output": "[100, 101, 102]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv76pvm01bwg4p2dpnvi346", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031183", "code": "def parse_int(value):\n    try:\n        return int(value)\n    except ValueError as e:\n        raise RuntimeError(\"parse failed\") from e\n\ndef safe_parse(value):\n    try:\n        return parse_int(value)\n    except RuntimeError as e:\n        return (str(e), type(e.__cause__).__name__, str(e.__cause__))", "entry_point": "safe_parse", "input": "'abc'", "output": "('parse failed', 'ValueError', \"invalid literal for int() with base 10: 'abc'\")", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv774ls01c7g4p2agkocpck", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031184", "code": "def wrap_with(tag):\n    def decorator(func):\n        def wrapper(*args, **kwargs):\n            return f\"{tag}({func(*args, **kwargs)})\"\n        return wrapper\n    return decorator\n\n@wrap_with(\"A\")\n@wrap_with(\"B\")\n@wrap_with(\"C\")\ndef base(x):\n    return str(x)", "entry_point": "base", "input": "5", "output": "'A(B(C(5)))'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv77jdw01chg4p2ycxbv00v", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031185", "code": "def divide_track(a, b):\n    log = []\n    try:\n        result = a / b\n    except ZeroDivisionError:\n        log.append(\"zero-div\")\n        result = None\n    except TypeError:\n        log.append(\"type-err\")\n        result = None\n    else:\n        log.append(\"ok\")\n    finally:\n        log.append(\"done\")\n    return (result, log)", "entry_point": "divide_track", "input": "10, 2", "output": "(5.0, ['ok', 'done'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv77xdl01crg4p2jo8bqnsr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031186", "code": "import functools\n\ndef running_max_with_index(values):\n    return functools.reduce(\n        lambda acc, x: acc + [(x[0], max(x[1], acc[-1][1]))] if acc else [x],\n        enumerate(values),\n        []\n    )", "entry_point": "running_max_with_index", "input": "[3, 1, 4, 1, 5, 9, 2]", "output": "[(0, 3), (1, 3), (2, 4), (3, 4), (4, 5), (5, 9), (6, 9)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv78cao01d1g4p29baw9vgz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031187", "code": "def legacy_format(name, score, ratio):\n    return \"%-8s|%05d|%6.3f%%\" % (name, score, ratio * 100)", "entry_point": "legacy_format", "input": "'ax', 42, 0.12345", "output": "'ax      |00042|12.345%'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv7969101dlg4p2dgeyp5jd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031188", "code": "import itertools\n\ndef merge_rows(a, b, c):\n    return list(itertools.zip_longest(a, b, c, fillvalue=0))", "entry_point": "merge_rows", "input": "[1, 2, 3], [10, 20], [100]", "output": "[(1, 10, 100), (2, 20, 0), (3, 0, 0)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv79mo401dxg4p2x2hqpolm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031189", "code": "class ValidationError(Exception):\n    pass\n\nclass RangeError(ValidationError):\n    pass\n\ndef validate(n):\n    trace = []\n    try:\n        if n < 0:\n            raise RangeError(f\"negative:{n}\")\n        if n > 100:\n            raise ValidationError(f\"too-big:{n}\")\n        trace.append(\"passed\")\n    except RangeError as e:\n        trace.append(f\"range:{e}\")\n    except ValidationError as e:\n        trace.append(f\"generic:{e}\")\n    return trace\n\ndef run_validations():\n    return [validate(-5), validate(150), validate(50)]", "entry_point": "run_validations", "input": "", "output": "[['range:negative:-5'], ['generic:too-big:150'], ['passed']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv7a1ub01e7g4p2zjsuzc0a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031190", "code": "def echo_transform():\n    total = 0\n    while True:\n        received = yield total\n        if received is None:\n            continue\n        total += received\n\ndef run_generator_send():\n    gen = echo_transform()\n    outputs = [next(gen)]\n    outputs.append(gen.send(5))\n    outputs.append(gen.send(10))\n    outputs.append(gen.send(-3))\n    return outputs", "entry_point": "run_generator_send", "input": "", "output": "[0, 5, 15, 12]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv84zxr01g4g4p2o5yk1wsb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031191", "code": "def resilient_counter():\n    count = 0\n    while True:\n        try:\n            yield count\n            count += 1\n        except ValueError:\n            count = -1\n            yield count\n\ndef run_generator_throw():\n    gen = resilient_counter()\n    out = [next(gen), next(gen)]\n    out.append(gen.throw(ValueError(\"reset\")))\n    out.append(next(gen))\n    return out", "entry_point": "run_generator_throw", "input": "", "output": "[0, 1, -1, -1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv85g3m01g5g4p2n642gsxu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031192", "code": "class SuppressType:\n    def __init__(self, *types):\n        self.types = types\n    def __enter__(self):\n        return self\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        return exc_type is not None and issubclass(exc_type, self.types)\n\ndef run_suppress_cm():\n    log = []\n    with SuppressType(KeyError):\n        log.append(\"start\")\n        raise KeyError(\"missing\")\n        log.append(\"unreachable\")\n    log.append(\"after\")\n    try:\n        with SuppressType(KeyError):\n            raise TypeError(\"not suppressed\")\n    except TypeError as e:\n        log.append(f\"caught:{e}\")\n    return log", "entry_point": "run_suppress_cm", "input": "", "output": "['start', 'after', 'caught:not suppressed']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv85wqy01g6g4p2ms1ifp3a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031193", "code": "import contextlib\n\ndef run_contextlib_suppress():\n    log = []\n    with contextlib.suppress(ZeroDivisionError, KeyError):\n        result = 1 / 0\n        log.append(result)\n    log.append(\"continued\")\n    d = {\"a\": 1}\n    with contextlib.suppress(KeyError):\n        value = d[\"missing\"]\n        log.append(value)\n    log.append(\"done\")\n    try:\n        with contextlib.suppress(ZeroDivisionError):\n            raise TypeError(\"not suppressed here\")\n    except TypeError as e:\n        log.append(f\"caught:{e}\")\n    return log", "entry_point": "run_contextlib_suppress", "input": "", "output": "['continued', 'done', 'caught:not suppressed here']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv86dza01g7g4p21qeurz8j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031194", "code": "class UpperAttrMeta(type):\n    def __new__(mcs, name, bases, namespace):\n        upper_namespace = {}\n        for key, value in namespace.items():\n            if not key.startswith(\"__\"):\n                upper_namespace[key.upper()] = value\n            else:\n                upper_namespace[key] = value\n        return super().__new__(mcs, name, bases, upper_namespace)\n\nclass Config(metaclass=UpperAttrMeta):\n    debug = False\n    version = \"1.0\"\n\ndef run_metaclass():\n    c = Config()\n    return sorted(k for k in vars(Config) if not k.startswith(\"__\"))", "entry_point": "run_metaclass", "input": "", "output": "['DEBUG', 'VERSION']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv86t2p01g9g4p2lo85fhgh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031195", "code": "class PositiveNumber:\n    def __set_name__(self, owner, name):\n        self.name = \"_\" + name\n    def __get__(self, obj, objtype=None):\n        if obj is None:\n            return self\n        return getattr(obj, self.name, None)\n    def __set__(self, obj, value):\n        if value <= 0:\n            raise ValueError(f\"{self.name} must be positive, got {value}\")\n        setattr(obj, self.name, value)\n\nclass Account:\n    balance = PositiveNumber()\n    def __init__(self, balance):\n        self.balance = balance\n\ndef run_descriptor():\n    a = Account(100)\n    results = [a.balance]\n    try:\n        a.balance = -5\n    except ValueError as e:\n        results.append(str(e))\n    a.balance = 50\n    results.append(a.balance)\n    return results", "entry_point": "run_descriptor", "input": "", "output": "[100, '_balance must be positive, got -5', 50]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv879kc01gbg4p2hpxv1vg9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031196", "code": "class Vector:\n    def __init__(self, x, y):\n        self.x, self.y = x, y\n    def __add__(self, other):\n        if isinstance(other, Vector):\n            return Vector(self.x + other.x, self.y + other.y)\n        return Vector(self.x + other, self.y + other)\n    def __radd__(self, other):\n        return self.__add__(other)\n    def __iadd__(self, other):\n        self.x += other.x\n        self.y += other.y\n        return self\n    def __repr__(self):\n        return f\"Vector({self.x}, {self.y})\"\n\ndef run_vector_ops():\n    v1 = Vector(1, 2)\n    v2 = Vector(3, 4)\n    v3 = v1 + v2\n    v4 = 10 + v1\n    v1 += v2\n    return [repr(v3), repr(v4), repr(v1)]", "entry_point": "run_vector_ops", "input": "", "output": "['Vector(4, 6)', 'Vector(11, 12)', 'Vector(4, 6)']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv87q3501gdg4p2r6q7x0i8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031197", "code": "from functools import total_ordering\n\n@total_ordering\nclass Card:\n    RANKS = [\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"J\",\"Q\",\"K\",\"A\"]\n    def __init__(self, rank):\n        self.rank = rank\n    def __eq__(self, other):\n        return self.RANKS.index(self.rank) == self.RANKS.index(other.rank)\n    def __lt__(self, other):\n        return self.RANKS.index(self.rank) < self.RANKS.index(other.rank)\n    def __repr__(self):\n        return self.rank\n\ndef run_card_sort():\n    cards = [Card(\"K\"), Card(\"2\"), Card(\"A\"), Card(\"10\")]\n    return [repr(c) for c in sorted(cards)] + [Card(\"K\") > Card(\"2\"), Card(\"A\") <= Card(\"A\")]", "entry_point": "run_card_sort", "input": "", "output": "['2', '10', 'K', 'A', True, True]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv886ak01gfg4p21ndu8jw8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031198", "code": "def slice_demo(seq):\n    return {\n        \"reverse\": seq[::-1],\n        \"every_second\": seq[::2],\n        \"last_three\": seq[-3:],\n        \"middle_step_neg\": seq[-2:-8:-2],\n        \"empty\": seq[5:2],\n    }", "entry_point": "slice_demo", "input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "{'reverse': [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 'every_second': [0, 2, 4, 6, 8], 'last_three': [7, 8, 9], 'middle_step_neg': [8, 6, 4], 'empty': []}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv88pxz01gig4p2eyyyntp5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031199", "code": "def encoding_demo(s):\n    utf8_bytes = s.encode(\"utf-8\")\n    ascii_replaced = s.encode(\"ascii\", errors=\"replace\")\n    ascii_ignored = s.encode(\"ascii\", errors=\"ignore\")\n    back = utf8_bytes.decode(\"utf-8\")\n    return (utf8_bytes, ascii_replaced, ascii_ignored, back == s)", "entry_point": "encoding_demo", "input": "'caf\u00e9 na\u00efve'", "output": "(b'caf\\xc3\\xa9 na\\xc3\\xafve', b'caf? na?ve', b'caf nave', True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv897s901glg4p2x0twxv2j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031200", "code": "def stability_demo():\n    data = [(\"a\", 2), (\"b\", 1), (\"c\", 2), (\"d\", 1), (\"e\", 2)]\n    return sorted(data, key=lambda pair: pair[1])", "entry_point": "stability_demo", "input": "", "output": "[('b', 1), ('d', 1), ('a', 2), ('c', 2), ('e', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv89qwp01gog4p2qqsdqoy8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031201", "code": "def read_chunks(data, size):\n    pos = 0\n    chunks = []\n    while (chunk := data[pos:pos+size]):\n        chunks.append(chunk)\n        pos += size\n    return chunks", "entry_point": "read_chunks", "input": "'abcdefghij', 3", "output": "['abc', 'def', 'ghi', 'j']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8a4u001grg4p2guqb2xil", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031202", "code": "def walrus_filter(nums):\n    return [y for x in nums if (y := x * x) > 10]", "entry_point": "walrus_filter", "input": "[1, 2, 3, 4, 5, 6]", "output": "[16, 25, 36]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8al6j01gtg4p2d0xgo649", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031203", "code": "def classify(point):\n    match point:\n        case (0, 0):\n            return \"origin\"\n        case (x, y) if x == y:\n            return \"diagonal\"\n        case (x, 0):\n            return f\"on x-axis at {x}\"\n        case (0, y):\n            return f\"on y-axis at {y}\"\n        case (x, y) if x > 0 and y > 0:\n            return \"quadrant 1\"\n        case _:\n            return \"other\"\n\ndef run_classify():\n    return [classify(p) for p in [(0,0),(3,3),(5,0),(0,-2),(2,4),(-1,-1)]]", "entry_point": "run_classify", "input": "", "output": "['origin', 'diagonal', 'on x-axis at 5', 'on y-axis at -2', 'quadrant 1', 'diagonal']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8b4ex01gwg4p2x11r4qpx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031204", "code": "from dataclasses import dataclass\n\n@dataclass\nclass Point:\n    x: int\n    y: int\n\ndef describe(shape):\n    match shape:\n        case Point(x=0, y=0):\n            return \"origin point\"\n        case Point(x=x, y=y) if x == y:\n            return f\"diagonal point at {x}\"\n        case Point(x=x, y=y):\n            return f\"point at ({x}, {y})\"\n        case [Point(0, 0), Point(0, 0)]:\n            return \"two origins\"\n        case _:\n            return \"unknown\"\n\ndef run_describe():\n    return [describe(Point(0,0)), describe(Point(5,5)), describe(Point(1,2)), describe(\"nope\")]", "entry_point": "run_describe", "input": "", "output": "['origin point', 'diagonal point at 5', 'point at (1, 2)', 'unknown']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8bpkj01h0g4p2wvdtqvpf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031205", "code": "def coercion_demo():\n    a = 0.1 + 0.2\n    b = True + True + True\n    c = 3 / 2\n    d = 3 // 2\n    e = -3 // 2\n    f = -3 % 2\n    g = int(2.9999999999999996)\n    h = bool(0.0) or bool(-0.0)\n    return (a, a == 0.3, b, type(b).__name__, c, d, e, f, g, h)", "entry_point": "coercion_demo", "input": "", "output": "(0.30000000000000004, False, 3, 'int', 1.5, 1, -2, 1, 2, False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8cew301h4g4p2ao3kya2u", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031206", "code": "def set_demo():\n    a = {1, 2, 3, 4}\n    b = {3, 4, 5, 6}\n    sym = a ^ b\n    fs = frozenset(a)\n    cache = {fs: \"cached_result\"}\n    lookup = cache.get(frozenset({4,3,2,1}))\n    try:\n        fs.add(10)\n        mutation_error = None\n    except AttributeError as e:\n        mutation_error = \"AttributeError\"\n    return (sorted(sym), lookup, mutation_error, a.issubset(a | b))", "entry_point": "set_demo", "input": "", "output": "([1, 2, 5, 6], 'cached_result', 'AttributeError', True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8dsej01h8g4p2drb8n7pn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031207", "code": "import weakref\n\nclass Node:\n    def __init__(self, name):\n        self.name = name\n\ndef run_weakref():\n    n = Node(\"alpha\")\n    ref = weakref.ref(n)\n    before = ref() is not None\n    log = [before, ref().name]\n    del n\n    after = ref() is None\n    log.append(after)\n    return log", "entry_point": "run_weakref", "input": "", "output": "[True, 'alpha', True]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8euwv01hbg4p2mjljkyjv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031208", "code": "class Temperature:\n    def __init__(self, celsius):\n        self._celsius = celsius\n    @property\n    def celsius(self):\n        return self._celsius\n    @celsius.setter\n    def celsius(self, value):\n        if value < -273.15:\n            raise ValueError(\"below absolute zero\")\n        self._celsius = value\n    @property\n    def fahrenheit(self):\n        return self._celsius * 9/5 + 32\n\ndef run_temperature():\n    t = Temperature(25)\n    results = [t.fahrenheit]\n    t.celsius = 100\n    results.append(t.fahrenheit)\n    try:\n        t.celsius = -300\n    except ValueError as e:\n        results.append(str(e))\n    return results", "entry_point": "run_temperature", "input": "", "output": "[77.0, 212.0, 'below absolute zero']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8fx9i01hgg4p230jy4ct2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031209", "code": "class Point2D:\n    __slots__ = (\"x\", \"y\")\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\nclass Point3D(Point2D):\n    __slots__ = (\"z\",)\n    def __init__(self, x, y, z):\n        super().__init__(x, y)\n        self.z = z\n\ndef run_slots():\n    p = Point2D(1, 2)\n    results = []\n    try:\n        p.z = 5\n        results.append(\"no error\")\n    except AttributeError as e:\n        results.append(\"AttributeError\")\n    p3 = Point3D(1, 2, 3)\n    p3.z = 10\n    results.append((p3.x, p3.y, p3.z))\n    try:\n        p3.w = 1\n        results.append(\"no error 2\")\n    except AttributeError:\n        results.append(\"AttributeError2\")\n    return results", "entry_point": "run_slots", "input": "", "output": "['AttributeError', (1, 2, 10), 'AttributeError2']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv8h8yd01hlg4p2nl1wv5rp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031210", "code": "import bisect\n\n\ndef insert_both(words, word):\n    left = sorted(words, key=len)\n    right = list(left)\n    bisect.insort_left(left, word, key=len)\n    bisect.insort_right(right, word, key=len)\n    pos_left = bisect.bisect_left(sorted(words, key=len), len(word), key=len)\n    pos_right = bisect.bisect_right(sorted(words, key=len), len(word), key=len)\n    return (left, right, pos_left, pos_right)", "entry_point": "insert_both", "input": "['aa', 'bb', 'cc', 'dddd'], 'xx'", "output": "(['xx', 'aa', 'bb', 'cc', 'dddd'], ['aa', 'bb', 'cc', 'xx', 'dddd'], 0, 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jmg4p2ezphf5e1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031211", "code": "import heapq\n\n\ndef schedule(tasks):\n    heap = []\n    for name, pri in tasks:\n        heapq.heappush(heap, (pri, name))\n    snapshot = list(heap)\n    first = heapq.heappop(heap)\n    pushed = heapq.heappushpop(heap, (5, \"late\"))\n    replaced = heapq.heapreplace(heap, (0, \"now\"))\n    return (snapshot, first, pushed, replaced, heap[0], sorted(heap))", "entry_point": "schedule", "input": "[('b', 2), ('a', 2), ('c', 1), ('d', 3)]", "output": "([(1, 'c'), (2, 'b'), (2, 'a'), (3, 'd')], (1, 'c'), (2, 'a'), (2, 'b'), (0, 'now'), [(0, 'now'), (3, 'd'), (5, 'late')])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jng4p2zsoo9wh4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031212", "code": "from collections import deque\n\n\ndef window(values, size):\n    dq = deque(maxlen=size)\n    trail = []\n    for v in values:\n        dq.append(v)\n        trail.append(list(dq))\n    dq.appendleft(\"L\")\n    after_left = list(dq)\n    dq.rotate(2)\n    after_rot = list(dq)\n    dq.extendleft([7, 8, 9])\n    return (trail, after_left, after_rot, list(dq), dq.maxlen)", "entry_point": "window", "input": "[1, 2, 3, 4], 3", "output": "([[1], [1, 2], [1, 2, 3], [2, 3, 4]], ['L', 2, 3], [2, 3, 'L'], [9, 8, 7], 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jog4p2c4u1rhyp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031213", "code": "from collections import OrderedDict\n\n\ndef reorder(pairs):\n    od = OrderedDict(pairs)\n    plain = dict(pairs)\n    od.move_to_end(\"a\")\n    od.move_to_end(\"c\", last=False)\n    mirror = OrderedDict(reversed(list(od.items())))\n    same_order = od == mirror\n    as_plain = dict(od) == dict(mirror)\n    vs_dict = plain == dict(od)\n    popped = od.popitem(last=False)\n    return (list(od), list(mirror), same_order, as_plain, vs_dict, popped, list(plain))", "entry_point": "reorder", "input": "[('a', 1), ('b', 2), ('c', 3)]", "output": "(['b', 'a'], ['a', 'b', 'c'], False, True, True, ('c', 3), ['a', 'b', 'c'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jpg4p2g2qfcpo2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031214", "code": "def carve(text, sep):\n    return (\n        text.partition(sep),\n        text.rpartition(sep),\n        text.split(sep, 1),\n        text.rsplit(sep, 1),\n        \"nope\".partition(sep),\n        \"nope\".rpartition(sep),\n        len(text.partition(sep)),\n        len(\"nope\".split(sep)),\n    )", "entry_point": "carve", "input": "'a=b=c', '='", "output": "(('a', '=', 'b=c'), ('a=b', '=', 'c'), ['a', 'b=c'], ['a=b', 'c'], ('nope', '', ''), ('', '', 'nope'), 3, 1)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jqg4p2wk8m5xh5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031215", "code": "def mutate(raw):\n    ba = bytearray(raw)\n    ba[0] = ba[0] + 1\n    ba[1:3] = b\"XYZ\"\n    return (\n        raw[0],\n        raw[:1],\n        list(raw),\n        bytes(ba),\n        len(ba),\n        raw,\n        raw + b\"!\",\n        bytes(bytearray(3)),\n    )", "entry_point": "mutate", "input": "b'abc'", "output": "(97, b'a', [97, 98, 99], b'bXYZ', 4, b'abc', b'abc!', b'\\x00\\x00\\x00')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jrg4p209o5iu2r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031216", "code": "def floaty():\n    a = 0.1 + 0.2\n    return (\n        a,\n        a == 0.3,\n        repr(a) == \"0.30000000000000004\",\n        float(repr(a)) == a,\n        round(a, 2),\n        round(2.675, 2),\n        (round(0.5), round(1.5), round(2.5), round(-0.5)),\n        1e16 + 1 == 1e16,\n        0.1 + 0.2 + 0.3 == 0.1 + (0.2 + 0.3),\n    )", "entry_point": "floaty", "input": "", "output": "(0.30000000000000004, False, True, True, 0.3, 2.67, (0, 2, 2, 0), True, False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jsg4p2896ucicd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031217", "code": "def bits(n):\n    return (\n        n >> 1,\n        n >> 100,\n        ~n,\n        n.bit_length(),\n        (-1) >> 10,\n        n & 0xFF,\n        format(n & 0xFF, \"08b\"),\n        n.to_bytes(2, \"big\", signed=True),\n        int.from_bytes(b\"\\xff\\xfe\", \"big\", signed=True),\n        int.from_bytes(b\"\\xff\\xfe\", \"big\"),\n    )", "entry_point": "bits", "input": "-5", "output": "(-3, -1, 4, 3, -1, 251, '11111011', b'\\xff\\xfb', -2, 65534)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94m01jug4p2s1k1wnp0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031218", "code": "class Point:\n    def __init__(self, x):\n        self.x = x\n\n    def __eq__(self, other):\n        if not isinstance(other, Point):\n            return NotImplemented\n        return self.x == other.x\n\n\nclass Tagged(Point):\n    __hash__ = object.__hash__\n\n\ndef check():\n    out = []\n    p = Point(1)\n    t = Tagged(1)\n    out.append(Point.__hash__)\n    try:\n        hash(p)\n    except TypeError as exc:\n        out.append(type(exc).__name__)\n    out.append(Tagged.__hash__ is object.__hash__)\n    out.append(hash(t) == hash(Tagged(1)))\n    out.append(p == Point(1))\n    out.append(p != Point(2))\n    out.append(p == 1)\n    try:\n        {p: 1}\n    except TypeError as exc:\n        out.append(str(exc))\n    return tuple(out)", "entry_point": "check", "input": "", "output": "(None, 'TypeError', True, False, True, True, False, \"unhashable type: 'Point'\")", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01jwg4p2afmlfur4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031219", "code": "import enum\n\n\nclass Status(enum.Enum):\n    OK = 1\n    FINE = 1\n    BAD = 2\n\n    @classmethod\n    def _missing_(cls, value):\n        if value == \"ok\":\n            return cls.OK\n        return None\n\n\ndef probe():\n    out = [m.name for m in Status]\n    out.append(Status.FINE is Status.OK)\n    out.append(Status.FINE.name)\n    out.append(Status(\"ok\").name)\n    out.append(sorted(Status.__members__))\n    out.append(Status(2).name)\n    out.append(len(Status))\n    try:\n        Status(\"nope\")\n    except ValueError as exc:\n        out.append(type(exc).__name__)\n    return tuple(out)", "entry_point": "probe", "input": "", "output": "('OK', 'BAD', True, 'OK', 'OK', ['BAD', 'FINE', 'OK'], 'BAD', 2, 'ValueError')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01jyg4p2ax0z6e3q", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031220", "code": "def describe(a, b, /, c, *, d=4, **rest):\n    return (a, b, c, d, rest)\n\n\ndef probe():\n    out = []\n    out.append(describe(1, 2, 3))\n    out.append(describe(1, 2, c=3, d=9, a=99, b=100))\n    try:\n        describe(1, 2, 3, 4)\n    except TypeError as exc:\n        out.append(type(exc).__name__)\n    try:\n        describe(a=1, b=2, c=3)\n    except TypeError as exc:\n        out.append(type(exc).__name__)\n    out.append(describe(*[1, 2], **{\"c\": 3, \"d\": 0}))\n    return tuple(out)", "entry_point": "probe", "input": "", "output": "((1, 2, 3, 4, {}), (1, 2, 3, 9, {'a': 99, 'b': 100}), 'TypeError', 'TypeError', (1, 2, 3, 0, {}))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01k0g4p22tupv5jw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031221", "code": "from dataclasses import dataclass, field, asdict, replace\n\n\n@dataclass\nclass Cart:\n    owner: str\n    items: list = field(default_factory=list)\n    tag: str = field(default=\"x\", repr=False)\n\n    def add(self, thing):\n        self.items.append(thing)\n        return self\n\n\ndef probe():\n    a = Cart(\"ann\")\n    b = Cart(\"bob\")\n    a.add(\"apple\")\n    c = replace(a, owner=\"cat\")\n    c.items.append(\"pear\")\n    snap = asdict(a)\n    a.add(\"plum\")\n    return (a.items, b.items, c.items, a.items is c.items, a.items is b.items, repr(b), snap)", "entry_point": "probe", "input": "", "output": "(['apple', 'pear', 'plum'], [], ['apple', 'pear', 'plum'], True, False, \"Cart(owner='bob', items=[])\", {'owner': 'ann', 'items': ['apple', 'pear'], 'tag': 'x'})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01k1g4p2g1l7ctg6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031222", "code": "def trace(mode):\n    log = []\n\n    def run():\n        try:\n            log.append(\"try\")\n            if mode == \"raise\":\n                raise ValueError(\"x\")\n            if mode == \"return\":\n                return \"from-try\"\n        except ValueError:\n            log.append(\"except\")\n            return \"from-except\"\n        else:\n            log.append(\"else\")\n            return \"from-else\"\n        finally:\n            log.append(\"finally\")\n\n    return (run(), log)\n\n\ndef all_modes():\n    return [trace(m) for m in (\"raise\", \"return\", \"plain\")]", "entry_point": "all_modes", "input": "", "output": "[('from-except', ['try', 'except', 'finally']), ('from-try', ['try', 'finally']), ('from-else', ['try', 'else', 'finally'])]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01k2g4p2wpxhj7t2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031223", "code": "def find_first(items, target):\n    log = []\n    for i, x in enumerate(items):\n        log.append(x)\n        if x == target:\n            break\n    else:\n        log.append(\"no-break\")\n        return (-1, log)\n    return (i, log)\n\n\ndef probe():\n    return (\n        find_first([3, 5, 7], 5),\n        find_first([3, 5, 7], 9),\n        find_first([], 9),\n        find_first([3, 5, 7], 3),\n    )", "entry_point": "probe", "input": "", "output": "((1, [3, 5]), (-1, [3, 5, 7, 'no-break']), (-1, ['no-break']), (0, [3]))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01k3g4p24r66tu8f", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031224", "code": "import contextlib\n\n\ndef probe():\n    log = []\n    with contextlib.suppress(KeyError, IndexError):\n        log.append(\"start\")\n        data = {}\n        log.append(data[\"missing\"])\n        log.append(\"unreachable\")\n    log.append(\"after\")\n    try:\n        with contextlib.suppress(KeyError):\n            raise ValueError(\"boom\")\n    except ValueError as exc:\n        log.append((\"escaped\", str(exc)))\n    with contextlib.suppress(Exception):\n        log.append([1][5])\n    with contextlib.suppress(KeyError):\n        log.append(\"clean\")\n    return tuple(log)", "entry_point": "probe", "input": "", "output": "('start', 'after', ('escaped', 'boom'), 'clean')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01k4g4p24ol79632", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031225", "code": "def make_source(values):\n    it = iter(values)\n\n    def pull():\n        return next(it, None)\n\n    return pull\n\n\ndef probe():\n    src = make_source([1, 2, 0, 3, 4])\n    got = list(iter(src, 0))\n    rest = [src(), src(), src()]\n    counter = {\"n\": 0}\n\n    def tick():\n        counter[\"n\"] += 1\n        return counter[\"n\"]\n\n    stopped = list(iter(tick, 4))\n    never = iter(tick, \"never\")\n    return (got, rest, stopped, counter[\"n\"], next(never), callable(src))", "entry_point": "probe", "input": "", "output": "([1, 2], [3, 4, None], [1, 2, 3], 4, 5, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsv9c94n01k5g4p213kufy4d", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031226", "code": "def counter():\n    log = []\n    def gen():\n        for i in range(5):\n            log.append(i)\n            yield i * i\n    squares = gen()\n    first_two = [next(squares), next(squares)]\n    return first_two, log", "entry_point": "counter", "input": "", "output": "([0, 1], [0, 1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvchb1101nsg4p2zvklbmo3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031227", "code": "def probe(store):\n    a = store.get('x', 0)\n    b = store.setdefault('y', 0)\n    c = store.setdefault('y', 99)\n    return a, b, c, sorted(store)", "entry_point": "probe", "input": "{'z': 1}", "output": "(0, 0, 0, ['y', 'z'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvchb1101ntg4p272q2apwm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031228", "code": "def reshape(values):\n    out = list(values)\n    out[1:3] = ['a']\n    out[0:0] = ['start']\n    return out, len(out)", "entry_point": "reshape", "input": "[10, 20, 30, 40]", "output": "(['start', 10, 'a', 40], 4)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvchb1101nug4p285cv2zf1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031229", "code": "def classify(value):\n    try:\n        return 10 / value\n    except ZeroDivisionError:\n        return 'zero'\n    except TypeError:\n        return 'type'\n\ndef run():\n    return [classify(v) for v in (5, 0, 'x')]", "entry_point": "run", "input": "", "output": "[2.0, 'zero', 'type']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvchb1101nvg4p2u5ltajpz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031230", "code": "def leaderboard(rows):\n    return sorted(rows, key=lambda r: (r['pts'], -len(r['name'])), reverse=True)", "entry_point": "leaderboard", "input": "[{'name': 'ann', 'pts': 3}, {'name': 'bo', 'pts': 3}, {'name': 'cyd', 'pts': 5}]", "output": "[{'name': 'cyd', 'pts': 5}, {'name': 'bo', 'pts': 3}, {'name': 'ann', 'pts': 3}]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvchb1101nwg4p22s57bx7k", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031231", "code": "def bucket_scores(scores):\n    buckets = {\"low\": [], \"mid\": [], \"high\": []}\n    for s in scores:\n        if not isinstance(s, (int, float)):\n            continue\n        if s < 50:\n            buckets[\"low\"].append(s)\n        elif s < 80:\n            buckets[\"mid\"].append(s)\n        else:\n            buckets[\"high\"].append(s)\n    return {k: sorted(v) for k, v in buckets.items() if v}", "entry_point": "bucket_scores", "input": "[45, 91, 'skip', 62, 79, 100, 12]", "output": "{'low': [12, 45], 'mid': [62, 79], 'high': [91, 100]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvg8rg101ocg4p2k6vrje5s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031232", "code": "class Inventory:\n    def __init__(self):\n        self.stock = {}\n    def add(self, name, qty):\n        self.stock[name] = self.stock.get(name, 0) + qty\n    def remove(self, name, qty):\n        if name not in self.stock or self.stock[name] < qty:\n            raise ValueError(f\"insufficient stock for {name}\")\n        self.stock[name] -= qty\n        if self.stock[name] == 0:\n            del self.stock[name]\n    def snapshot(self):\n        return dict(sorted(self.stock.items()))\n\ndef run_ops():\n    inv = Inventory()\n    inv.add(\"widget\", 10)\n    inv.add(\"gadget\", 5)\n    inv.remove(\"widget\", 4)\n    try:\n        inv.remove(\"gizmo\", 1)\n    except ValueError as e:\n        errmsg = str(e)\n    return (inv.snapshot(), errmsg)", "entry_point": "run_ops", "input": "", "output": "({'gadget': 5, 'widget': 6}, 'insufficient stock for gizmo')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvg8rg101odg4p2tggwl9ih", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031233", "code": "def running_median(nums):\n    import bisect\n    sorted_so_far = []\n    medians = []\n    for n in nums:\n        bisect.insort(sorted_so_far, n)\n        length = len(sorted_so_far)\n        mid = length // 2\n        if length % 2 == 1:\n            medians.append(sorted_so_far[mid])\n        else:\n            medians.append((sorted_so_far[mid - 1] + sorted_so_far[mid]) / 2)\n    return medians", "entry_point": "running_median", "input": "[5, 2, 8, 1, 9, 3]", "output": "[5, 3.5, 5, 3.5, 5, 4.0]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvg8rg101oeg4p2wxkp0g6b", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031234", "code": "def parse_key_values(pairs):\n    result = {}\n    for pair in pairs:\n        try:\n            key, value = pair.split(\"=\", 1)\n        except ValueError:\n            continue\n        key = key.strip()\n        value = value.strip()\n        if value.isdigit():\n            result[key] = int(value)\n        else:\n            try:\n                result[key] = float(value)\n            except ValueError:\n                result[key] = value\n    return result", "entry_point": "parse_key_values", "input": "['a=10', 'b=3.5', 'c=hello', 'broken', 'd= 7 ']", "output": "{'a': 10, 'b': 3.5, 'c': 'hello', 'd': 7}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvg8rg101ofg4p2czsiq8tl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031235", "code": "def dedupe_preserve_order(items):\n    seen = set()\n    result = []\n    for item in items:\n        key = item.lower() if isinstance(item, str) else item\n        if key in seen:\n            continue\n        seen.add(key)\n        result.append(item)\n    return result\n\ndef zip_with_index(items, start=1):\n    return [(start + i, v) for i, v in enumerate(dedupe_preserve_order(items))]", "entry_point": "zip_with_index", "input": "['Apple', 'banana', 'apple', 'Cherry', 'BANANA'], start=100", "output": "[(100, 'Apple'), (101, 'banana'), (102, 'Cherry')]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvg8rg101ogg4p2ywgce6y2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031236", "code": "def flatten(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten(item))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten", "input": "[1, [2, 3, [4, 5]], 6, [7, [8, [9]]]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgvd6401r9g4p2ha3kk07q", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031237", "code": "def gcd_steps(a, b):\n    steps = 0\n    while b:\n        a, b = b, a % b\n        steps += 1\n    return (a, steps)", "entry_point": "gcd_steps", "input": "252, 105", "output": "(21, 3)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgvd6401rag4p26o3rhyqv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031238", "code": "import itertools\n\ndef take_n_squares(n):\n    def gen():\n        i = 1\n        while True:\n            yield i * i\n            i += 1\n    return list(itertools.islice(gen(), n))", "entry_point": "take_n_squares", "input": "6", "output": "[1, 4, 9, 16, 25, 36]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgwu2901rbg4p25vf687de", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031239", "code": "import re\n\ndef tokenize(text):\n    return [t for t in re.split(r\"[,;\\s]+\", text.strip()) if t]", "entry_point": "tokenize", "input": "'apple, banana,  cherry ,date'", "output": "['apple', 'banana', 'cherry', 'date']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgxdx301rcg4p2bbdyquxq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031240", "code": "from collections import Counter\n\ndef top_words(text, k):\n    words = text.lower().split()\n    return Counter(words).most_common(k)", "entry_point": "top_words", "input": "'the cat sat on the mat the cat ran', 2", "output": "[('the', 3), ('cat', 2)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgyl4f01rdg4p2rw9fgj3y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031241", "code": "def flatten_dict(d, parent_key=\"\"):\n    items = {}\n    for k, v in d.items():\n        new_key = f\"{parent_key}.{k}\" if parent_key else k\n        if isinstance(v, dict):\n            items.update(flatten_dict(v, new_key))\n        else:\n            items[new_key] = v\n    return items", "entry_point": "flatten_dict", "input": "{'a': 1, 'b': {'c': 2, 'd': {'e': 3}}}", "output": "{'a': 1, 'b.c': 2, 'b.d.e': 3}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgyl4f01reg4p2a49hwugz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031242", "code": "class ValidationError(Exception):\n    pass\n\ndef validate_all(records):\n    errors = []\n    for i, r in enumerate(records):\n        if \"age\" not in r:\n            errors.append(f\"record {i}: missing age\")\n        elif r[\"age\"] < 0:\n            errors.append(f\"record {i}: negative age\")\n    if errors:\n        raise ValidationError(\"; \".join(errors))\n    return \"all valid\"\n\ndef run_validation(records):\n    try:\n        return validate_all(records)\n    except ValidationError as e:\n        return str(e)", "entry_point": "run_validation", "input": "[{'age': 5}, {'name': 'x'}, {'age': -3}]", "output": "'record 1: missing age; record 2: negative age'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvgz4ah01rfg4p2ylkbpjg2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031243", "code": "def merge_sorted(a, b):\n    result = []\n    i = j = 0\n    while i < len(a) and j < len(b):\n        if a[i] <= b[j]:\n            result.append(a[i])\n            i += 1\n        else:\n            result.append(b[j])\n            j += 1\n    result.extend(a[i:])\n    result.extend(b[j:])\n    return result", "entry_point": "merge_sorted", "input": "[1, 4, 6], [2, 3, 9, 10]", "output": "[1, 2, 3, 4, 6, 9, 10]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh09gc01rgg4p2crm31q55", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031244", "code": "def is_balanced(s):\n    pairs = {\")\": \"(\", \"]\": \"[\", \"}\": \"{\"}\n    stack = []\n    for ch in s:\n        if ch in \"([{\":\n            stack.append(ch)\n        elif ch in \")]}\":\n            if not stack or stack.pop() != pairs[ch]:\n                return False\n    return not stack", "entry_point": "is_balanced", "input": "'([a{b}c](d))'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh09gc01rhg4p2hdmhquum", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031245", "code": "def caesar(text, shift):\n    result = []\n    for ch in text:\n        if ch.isalpha():\n            base = ord(\"A\") if ch.isupper() else ord(\"a\")\n            result.append(chr((ord(ch) - base + shift) % 26 + base))\n        else:\n            result.append(ch)\n    return \"\".join(result)", "entry_point": "caesar", "input": "'Hello, World!', 5", "output": "'Mjqqt, Btwqi!'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh09gc01rig4p21uvm3dup", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031246", "code": "def compute_facts(ns):\n    cache = {}\n    def fact(n):\n        if n in cache:\n            return cache[n]\n        if n <= 1:\n            result = 1\n        else:\n            result = n * fact(n - 1)\n        cache[n] = result\n        return result\n    return [fact(x) for x in ns]", "entry_point": "compute_facts", "input": "[0, 1, 2, 3, 4, 5]", "output": "[1, 1, 2, 6, 24, 120]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1ew801rjg4p25twjdmy0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031247", "code": "def caesar_encrypt(text, shift):\n    result = []\n    for ch in text:\n        if ch.isalpha():\n            base = ord('A') if ch.isupper() else ord('a')\n            result.append(chr((ord(ch) - base + shift) % 26 + base))\n        else:\n            result.append(ch)\n    return \"\".join(result)", "entry_point": "caesar_encrypt", "input": "'Hello, World!', 3", "output": "'Khoor, Zruog!'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1ew801rkg4p2ah41bavi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031248", "code": "def rotate_left(lst, k):\n    if not lst:\n        return lst\n    k %= len(lst)\n    return lst[k:] + lst[:k]", "entry_point": "rotate_left", "input": "[1, 2, 3, 4, 5], 8", "output": "[4, 5, 1, 2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1ew801rlg4p2b5ielaub", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031249", "code": "from collections import OrderedDict\n\nclass LRUCache:\n    def __init__(self, capacity):\n        self.capacity = capacity\n        self.data = OrderedDict()\n    def get(self, key):\n        if key not in self.data:\n            return -1\n        self.data.move_to_end(key)\n        return self.data[key]\n    def put(self, key, value):\n        if key in self.data:\n            self.data.move_to_end(key)\n        self.data[key] = value\n        if len(self.data) > self.capacity:\n            self.data.popitem(last=False)\n\ndef run_cache():\n    c = LRUCache(2)\n    c.put(\"a\", 1)\n    c.put(\"b\", 2)\n    c.get(\"a\")\n    c.put(\"c\", 3)\n    return list(c.data.items())", "entry_point": "run_cache", "input": "", "output": "[('a', 1), ('c', 3)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1rgp01rmg4p2tws8r7v8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031250", "code": "def int_to_roman(num):\n    vals = [(1000, \"M\"), (900, \"CM\"), (500, \"D\"), (400, \"CD\"), (100, \"C\"),\n            (90, \"XC\"), (50, \"L\"), (40, \"XL\"), (10, \"X\"), (9, \"IX\"),\n            (5, \"V\"), (4, \"IV\"), (1, \"I\")]\n    result = \"\"\n    for v, sym in vals:\n        while num >= v:\n            result += sym\n            num -= v\n    return result", "entry_point": "int_to_roman", "input": "1994", "output": "'MCMXCIV'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1rgp01rng4p2korsuouz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031251", "code": "def chunk(lst, n):\n    return [lst[i:i + n] for i in range(0, len(lst), n)]", "entry_point": "chunk", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[[1, 2, 3], [4, 5, 6], [7]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1rgp01rog4p2u6zuzhn5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031252", "code": "def modes(values):\n    from collections import Counter\n    counts = Counter(values)\n    max_count = max(counts.values())\n    return sorted(v for v, c in counts.items() if c == max_count)", "entry_point": "modes", "input": "[1, 2, 2, 3, 3, 4]", "output": "[2, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1rgp01rpg4p2zs5swh2h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031253", "code": "def two_sum(nums, target):\n    seen = {}\n    for i, n in enumerate(nums):\n        complement = target - n\n        if complement in seen:\n            return [seen[complement], i]\n        seen[n] = i\n    return None", "entry_point": "two_sum", "input": "[2, 7, 11, 15, 3], 13", "output": "[0, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1rgp01rqg4p26r0i5nwy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031254", "code": "def pipeline_sum(nums):\n    evens = filter(lambda x: x % 2 == 0, nums)\n    doubled = map(lambda x: x * 2, evens)\n    return sum(doubled)", "entry_point": "pipeline_sum", "input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "40", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh1rgp01rsg4p28dd4alq4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031255", "code": "def fib_sequence(n):\n    a, b = 0, 1\n    seq = []\n    for _ in range(n):\n        seq.append(a)\n        a, b = b, a + b\n    return seq", "entry_point": "fib_sequence", "input": "10", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01rtg4p2dud9lsao", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031256", "code": "def primes_up_to(n):\n    sieve = [True] * (n + 1)\n    sieve[0:2] = [False, False]\n    for i in range(2, int(n ** 0.5) + 1):\n        if sieve[i]:\n            for j in range(i * i, n + 1, i):\n                sieve[j] = False\n    return [i for i, is_p in enumerate(sieve) if is_p]", "entry_point": "primes_up_to", "input": "30", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01rug4p2rchwkc82", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031257", "code": "def gcd(a, b):\n    while b:\n        a, b = b, a % b\n    return a\n\ndef gcd_lcm_pair(a, b):\n    g = gcd(a, b)\n    return (g, a * b // g)", "entry_point": "gcd_lcm_pair", "input": "48, 18", "output": "(6, 144)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01rvg4p2h1hf5l6y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031258", "code": "def word_freq(text):\n    words = text.lower().split()\n    freq = {}\n    for w in words:\n        freq[w] = freq.get(w, 0) + 1\n    return sorted(freq.items(), key=lambda kv: (-kv[1], kv[0]))", "entry_point": "word_freq", "input": "'the cat sat on the mat the cat ran'", "output": "[('the', 3), ('cat', 2), ('mat', 1), ('on', 1), ('ran', 1), ('sat', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01rwg4p2r776mh9b", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031259", "code": "def run_length_encode(s):\n    if not s:\n        return \"\"\n    result = []\n    prev = s[0]\n    count = 1\n    for ch in s[1:]:\n        if ch == prev:\n            count += 1\n        else:\n            result.append(prev + str(count))\n            prev = ch\n            count = 1\n    result.append(prev + str(count))\n    return \"\".join(result)", "entry_point": "run_length_encode", "input": "'aaabbbccd'", "output": "'a3b3c2d1'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01rxg4p26kbl19jw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031260", "code": "def matmul(a, b):\n    rows_a, cols_a = len(a), len(a[0])\n    cols_b = len(b[0])\n    result = [[0] * cols_b for _ in range(rows_a)]\n    for i in range(rows_a):\n        for j in range(cols_b):\n            total = 0\n            for k in range(cols_a):\n                total += a[i][k] * b[k][j]\n            result[i][j] = total\n    return result", "entry_point": "matmul", "input": "[[1, 2], [3, 4]], [[5, 6], [7, 8]]", "output": "[[19, 22], [43, 50]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01ryg4p2hx4bq6mh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031261", "code": "def longest_common_prefix(words):\n    if not words:\n        return \"\"\n    prefix = words[0]\n    for w in words[1:]:\n        while not w.startswith(prefix):\n            prefix = prefix[:-1]\n            if not prefix:\n                return \"\"\n    return prefix", "entry_point": "longest_common_prefix", "input": "['flower', 'flow', 'flight']", "output": "'fl'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01rzg4p2u26zgec3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031262", "code": "def quicksort(arr):\n    if len(arr) <= 1:\n        return arr\n    pivot = arr[len(arr) // 2]\n    left = [x for x in arr if x < pivot]\n    mid = [x for x in arr if x == pivot]\n    right = [x for x in arr if x > pivot]\n    return quicksort(left) + mid + quicksort(right)", "entry_point": "quicksort", "input": "[5, 2, 9, 1, 5, 6]", "output": "[1, 2, 5, 5, 6, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01s0g4p2rz19dqbh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031263", "code": "def max_subarray_sum(nums):\n    best = nums[0]\n    current = nums[0]\n    for n in nums[1:]:\n        current = max(n, current + n)\n        best = max(best, current)\n    return best", "entry_point": "max_subarray_sum", "input": "[-2, 1, -3, 4, -1, 2, 1, -5, 4]", "output": "6", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01s1g4p2wsoodnw4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031264", "code": "def roman_to_int(s):\n    values = {\"I\": 1, \"V\": 5, \"X\": 10, \"L\": 50, \"C\": 100, \"D\": 500, \"M\": 1000}\n    total = 0\n    prev = 0\n    for ch in reversed(s):\n        v = values[ch]\n        if v < prev:\n            total -= v\n        else:\n            total += v\n            prev = v\n    return total", "entry_point": "roman_to_int", "input": "'MCMXCIV'", "output": "1994", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh3vna01s2g4p21vgxpiy2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031265", "code": "def eval_rpn(tokens):\n    stack = []\n    for tok in tokens:\n        if tok in (\"+\", \"-\", \"*\", \"/\"):\n            b = stack.pop()\n            a = stack.pop()\n            if tok == \"+\":\n                stack.append(a + b)\n            elif tok == \"-\":\n                stack.append(a - b)\n            elif tok == \"*\":\n                stack.append(a * b)\n            else:\n                stack.append(int(a / b))\n        else:\n            stack.append(int(tok))\n    return stack[0]", "entry_point": "eval_rpn", "input": "['2', '1', '1', '+', '*']", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s3g4p2aarbja9w", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031266", "code": "class Node:\n    def __init__(self, val, nxt=None):\n        self.val = val\n        self.next = nxt\n\ndef reverse_list(head):\n    prev = None\n    while head:\n        nxt = head.next\n        head.next = prev\n        prev = head\n        head = nxt\n    return prev\n\ndef to_list(head):\n    out = []\n    while head:\n        out.append(head.val)\n        head = head.next\n    return out\n\ndef build(vals):\n    head = None\n    for v in reversed(vals):\n        head = Node(v, head)\n    return head\n\ndef run_reverse(vals):\n    return to_list(reverse_list(build(vals)))", "entry_point": "run_reverse", "input": "[1, 2, 3, 4, 5]", "output": "[5, 4, 3, 2, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s4g4p2cds6wpky", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031267", "code": "class TreeNode:\n    def __init__(self, val, left=None, right=None):\n        self.val = val\n        self.left = left\n        self.right = right\n\ndef inorder(node):\n    if node is None:\n        return []\n    return inorder(node.left) + [node.val] + inorder(node.right)\n\ndef build_tree():\n    return TreeNode(4, TreeNode(2, TreeNode(1), TreeNode(3)), TreeNode(6, TreeNode(5), TreeNode(7)))\n\ndef run_inorder():\n    return inorder(build_tree())", "entry_point": "run_inorder", "input": "", "output": "[1, 2, 3, 4, 5, 6, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s5g4p2go3kauzs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031268", "code": "def permutations(lst):\n    if len(lst) <= 1:\n        return [lst]\n    result = []\n    for i in range(len(lst)):\n        rest = lst[:i] + lst[i + 1:]\n        for p in permutations(rest):\n            result.append([lst[i]] + p)\n    return result", "entry_point": "permutations", "input": "[1, 2, 3]", "output": "[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s6g4p2f6j83e69", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031269", "code": "def combination_sum(candidates, target):\n    result = []\n    def backtrack(start, path, remaining):\n        if remaining == 0:\n            result.append(list(path))\n            return\n        if remaining < 0:\n            return\n        for i in range(start, len(candidates)):\n            path.append(candidates[i])\n            backtrack(i, path, remaining - candidates[i])\n            path.pop()\n    backtrack(0, [], target)\n    return result", "entry_point": "combination_sum", "input": "[2, 3, 6, 7], 7", "output": "[[2, 2, 3], [7]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s7g4p22mhu04dn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031270", "code": "def knapsack(weights, values, capacity):\n    n = len(weights)\n    dp = [[0] * (capacity + 1) for _ in range(n + 1)]\n    for i in range(1, n + 1):\n        for w in range(capacity + 1):\n            if weights[i - 1] <= w:\n                dp[i][w] = max(dp[i - 1][w], dp[i - 1][w - weights[i - 1]] + values[i - 1])\n            else:\n                dp[i][w] = dp[i - 1][w]\n    return dp[n][capacity]", "entry_point": "knapsack", "input": "[1, 3, 4, 5], [1, 4, 5, 7], 7", "output": "9", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s8g4p24grgeyz1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031271", "code": "def compress_if_shorter(s):\n    if not s:\n        return s\n    parts = []\n    prev = s[0]\n    count = 1\n    for ch in s[1:]:\n        if ch == prev:\n            count += 1\n        else:\n            parts.append(prev + str(count))\n            prev = ch\n            count = 1\n    parts.append(prev + str(count))\n    compressed = \"\".join(parts)\n    return compressed if len(compressed) < len(s) else s", "entry_point": "compress_if_shorter", "input": "'aabcccccaaa'", "output": "'a2b1c5a3'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01s9g4p28p9vc6dn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031272", "code": "def rotate_matrix(matrix):\n    return [list(row) for row in zip(*matrix[::-1])]", "entry_point": "rotate_matrix", "input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[[7, 4, 1], [8, 5, 2], [9, 6, 3]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01sag4p2vhnssnjd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031273", "code": "def unique_paths(m, n):\n    dp = [[1] * n for _ in range(m)]\n    for i in range(1, m):\n        for j in range(1, n):\n            dp[i][j] = dp[i - 1][j] + dp[i][j - 1]\n    return dp[m - 1][n - 1]", "entry_point": "unique_paths", "input": "3, 7", "output": "28", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01sbg4p2ykvr0uv4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031274", "code": "def edit_distance(a, b):\n    m, n = len(a), len(b)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        dp[i][0] = i\n    for j in range(n + 1):\n        dp[0][j] = j\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if a[i - 1] == b[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1]\n            else:\n                dp[i][j] = 1 + min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1])\n    return dp[m][n]", "entry_point": "edit_distance", "input": "'horse', 'ros'", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvh4bxd01scg4p2knd4r09s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031275", "code": "def is_prime(n):\n    if n < 2:\n        return False\n    for i in range(2, int(n ** 0.5) + 1):\n        if n % i == 0:\n            return False\n    return True", "entry_point": "is_prime", "input": "97", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vmg4p2zoakvz25", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031276", "code": "def fibonacci(n):\n    seq = [0, 1]\n    for i in range(2, n):\n        seq.append(seq[-1] + seq[-2])\n    return seq[:n]", "entry_point": "fibonacci", "input": "10", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vng4p25skrn71b", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031277", "code": "def mat_mult(a, b):\n    result = [[0, 0], [0, 0]]\n    for i in range(2):\n        for j in range(2):\n            for k in range(2):\n                result[i][j] += a[i][k] * b[k][j]\n    return result", "entry_point": "mat_mult", "input": "[[1, 2], [3, 4]], [[5, 6], [7, 8]]", "output": "[[19, 22], [43, 50]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vog4p29ui9ckr5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031278", "code": "def group_anagrams(words):\n    groups = {}\n    for w in words:\n        key = \"\".join(sorted(w))\n        groups.setdefault(key, []).append(w)\n    return groups", "entry_point": "group_anagrams", "input": "['eat', 'tea', 'tan', 'ate', 'nat', 'bat']", "output": "{'aet': ['eat', 'tea', 'ate'], 'ant': ['tan', 'nat'], 'abt': ['bat']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vpg4p28lbtyg12", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031279", "code": "def binary_to_decimal(s):\n    return int(s, 2)", "entry_point": "binary_to_decimal", "input": "'110101'", "output": "53", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vqg4p2grjwr7te", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031280", "code": "def decimal_to_binary(n):\n    if n == 0:\n        return '0'\n    digits = []\n    while n > 0:\n        digits.append(str(n % 2))\n        n //= 2\n    return ''.join(reversed(digits))", "entry_point": "decimal_to_binary", "input": "53", "output": "'110101'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vrg4p2j06uf87l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031281", "code": "def gcd_lcm(a, b):\n    x, y = a, b\n    while y:\n        x, y = y, x % y\n    gcd = x\n    lcm = a * b // gcd\n    return (gcd, lcm)", "entry_point": "gcd_lcm", "input": "12, 18", "output": "(6, 36)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflok01vsg4p2sxnc0u48", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031282", "code": "def compute_zigzag_checksum(values, mod=97):\n    total = 0\n    direction = 1\n    for idx, v in enumerate(values):\n        total += direction * (v ** 2 + idx)\n        if (idx + 1) % 3 == 0:\n            direction *= -1\n    return total % mod", "entry_point": "compute_zigzag_checksum", "input": "[4, 9, 2, 7, 5, 1, 8, 3]", "output": "6", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflol01vtg4p2wtglqurr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031283", "code": "def merge_two_sorted(a, b):\n    i = j = 0\n    result = []\n    while i < len(a) and j < len(b):\n        if a[i] <= b[j]:\n            result.append(a[i])\n            i += 1\n        else:\n            result.append(b[j])\n            j += 1\n    result.extend(a[i:])\n    result.extend(b[j:])\n    return result", "entry_point": "merge_two_sorted", "input": "[1, 4, 7], [2, 3, 8, 9]", "output": "[1, 2, 3, 4, 7, 8, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflol01vug4p2qcpu73lp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031284", "code": "def run_length_decode(s):\n    result = []\n    i = 0\n    while i < len(s):\n        ch = s[i]\n        i += 1\n        num_start = i\n        while i < len(s) and s[i].isdigit():\n            i += 1\n        count = int(s[num_start:i])\n        result.append(ch * count)\n    return ''.join(result)", "entry_point": "run_length_decode", "input": "'a3b1c5'", "output": "'aaabccccc'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmflol01vvg4p29cttz8ab", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031285", "code": "def roman_to_int(s):\n    vals = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n    total = 0\n    for i in range(len(s)):\n        v = vals[s[i]]\n        if i + 1 < len(s) and v < vals[s[i + 1]]:\n            total -= v\n        else:\n            total += v\n    return total", "entry_point": "roman_to_int", "input": "'MCMXCIV'", "output": "1994", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x0g4p2bpkvv869", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031286", "code": "def valid_brackets(s):\n    pairs = {')': '(', ']': '[', '}': '{'}\n    stack = []\n    for ch in s:\n        if ch in '([{':\n            stack.append(ch)\n        elif ch in pairs:\n            if not stack or stack.pop() != pairs[ch]:\n                return False\n    return not stack", "entry_point": "valid_brackets", "input": "'a(b[c]{d}e)f'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x1g4p2xvm4it39", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031287", "code": "def caesar_decode(text, shift):\n    result = []\n    for ch in text:\n        if ch.isalpha():\n            base = ord('A') if ch.isupper() else ord('a')\n            result.append(chr((ord(ch) - base - shift) % 26 + base))\n        else:\n            result.append(ch)\n    return ''.join(result)", "entry_point": "caesar_decode", "input": "'Mjqqt, Btwqi!', 5", "output": "'Hello, World!'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x2g4p2ot7poq9u", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031288", "code": "class VisitCounter:\n    def __init__(self):\n        self.counts = {}\n    def visit(self, page):\n        self.counts[page] = self.counts.get(page, 0) + 1\n        return self.counts[page]\n\ndef run_visits(pages):\n    vc = VisitCounter()\n    return [vc.visit(p) for p in pages]", "entry_point": "run_visits", "input": "['home', 'about', 'home', 'home', 'about']", "output": "[1, 1, 2, 3, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x3g4p2ntoh7pto", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031289", "code": "def rle(s):\n    if not s:\n        return \"\"\n    out = []\n    prev = s[0]\n    count = 1\n    for ch in s[1:]:\n        if ch == prev:\n            count += 1\n        else:\n            out.append(prev + str(count))\n            prev = ch\n            count = 1\n    out.append(prev + str(count))\n    return \"\".join(out)", "entry_point": "rle", "input": "'aaabbbccd'", "output": "'a3b3c2d1'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x4g4p2k4q8bewz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031290", "code": "def upper_bound(nums, target):\n    lo, hi = 0, len(nums)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if nums[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo", "entry_point": "upper_bound", "input": "[1, 2, 2, 2, 3, 5], 2", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x5g4p23d3qdkp1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031291", "code": "def flatten_list(lst):\n    result = []\n    for item in lst:\n        if isinstance(item, list):\n            result.extend(flatten_list(item))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten_list", "input": "[1, [2, [3, 4], 5], [[6]], 7]", "output": "[1, 2, 3, 4, 5, 6, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x6g4p2scptpsih", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031292", "code": "def dedupe_preserve_order(items):\n    seen = set()\n    result = []\n    for item in items:\n        if item not in seen:\n            seen.add(item)\n            result.append(item)\n    return result", "entry_point": "dedupe_preserve_order", "input": "[3, 1, 2, 3, 1, 4, 2, 5]", "output": "[3, 1, 2, 4, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x7g4p2u8i9c0m6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031293", "code": "def digit_sum(n):\n    n = abs(n)\n    if n < 10:\n        return n\n    return n % 10 + digit_sum(n // 10)", "entry_point": "digit_sum", "input": "987654321", "output": "45", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x8g4p25296zhi7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031294", "code": "def power_set(items):\n    result = [[]]\n    for item in items:\n        result += [subset + [item] for subset in result]\n    return sorted(result, key=lambda s: (len(s), s))", "entry_point": "power_set", "input": "[1, 2, 3]", "output": "[[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvmjjpi01x9g4p2mee2vj01", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031295", "code": "def redact_digits_runs(text, min_run):\n    result = []\n    i = 0\n    n = len(text)\n    while i < n:\n        if text[i].isdigit():\n            j = i\n            while j < n and text[j].isdigit():\n                j += 1\n            run_len = j - i\n            if run_len >= min_run:\n                result.append(\"*\" * run_len)\n            else:\n                result.append(text[i:j])\n            i = j\n        else:\n            result.append(text[i])\n            i += 1\n    return \"\".join(result)", "entry_point": "redact_digits_runs", "input": "'Card 4242424242424242 exp 12/28 cvv 123', 6", "output": "'Card **************** exp 12/28 cvv 123'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yfg4p2jzcnjd3l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031296", "code": "def has_adjacent_vip_conflict(seating_row, vip_set):\n    for i in range(len(seating_row) - 1):\n        if seating_row[i] in vip_set and seating_row[i+1] in vip_set:\n            return True\n    return False", "entry_point": "has_adjacent_vip_conflict", "input": "['Ana', 'Ben', 'Cid', 'Dax', 'Eve'], {'Cid', 'Dax', 'Eve'}", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ygg4p28eks1oag", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031297", "code": "def process_tasks_with_aging(tasks, boost_after):\n    processed = []\n    remaining = [dict(t) for t in tasks]\n    tick = 0\n    while remaining:\n        for t in remaining:\n            if tick - t[\"submitted\"] >= boost_after and t[\"priority\"] > 1:\n                t[\"priority\"] -= 1\n        remaining.sort(key=lambda t: (t[\"priority\"], t[\"submitted\"]))\n        current = remaining.pop(0)\n        processed.append(current[\"name\"])\n        tick += 1\n    return processed", "entry_point": "process_tasks_with_aging", "input": "[{'name': 'A', 'priority': 3, 'submitted': 0}, {'name': 'B', 'priority': 1, 'submitted': 1}, {'name': 'C', 'priority': 3, 'submitted': 0}], 2", "output": "['B', 'A', 'C']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yhg4p2akco3ijq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031298", "code": "def evaluate_polynomial(coefficients, x):\n    result = 0\n    for coef in coefficients:\n        result = result * x + coef\n    return result", "entry_point": "evaluate_polynomial", "input": "[2, -3, 0, 5], 3", "output": "32", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yig4p2pdndfg8c", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031299", "code": "def compute_backoff_schedule(base_delay, max_delay, attempts):\n    schedule = []\n    delay = base_delay\n    for _ in range(attempts):\n        schedule.append(min(delay, max_delay))\n        delay *= 2\n    return schedule", "entry_point": "compute_backoff_schedule", "input": "1, 20, 6", "output": "[1, 2, 4, 8, 16, 20]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yjg4p2wlgqxgjz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031300", "code": "def nearest_warehouse(warehouses, point):\n    best = None\n    best_dist = None\n    for name, (x, y) in sorted(warehouses.items()):\n        dist = abs(x - point[0]) + abs(y - point[1])\n        if best_dist is None or dist < best_dist:\n            best_dist = dist\n            best = name\n    return best, best_dist", "entry_point": "nearest_warehouse", "input": "{'W1': (0, 0), 'W2': (5, 5), 'W3': (2, 3)}, (3, 3)", "output": "('W3', 1)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ykg4p2dhktnu7o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031301", "code": "def dedupe_events(events, window_seconds):\n    result = []\n    last_seen = {}\n    for event_type, ts in events:\n        if event_type in last_seen and ts - last_seen[event_type] < window_seconds:\n            continue\n        last_seen[event_type] = ts\n        result.append((event_type, ts))\n    return result", "entry_point": "dedupe_events", "input": "[('click', 0), ('click', 2), ('hover', 3), ('click', 6), ('click', 7), ('hover', 10)], 5", "output": "[('click', 0), ('hover', 3), ('click', 6), ('hover', 10)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ylg4p2k2h8o7v3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031302", "code": "def scale_recipe(ingredients, factor):\n    scaled = {}\n    for name, amount in ingredients.items():\n        new_amount = round(amount * factor, 2)\n        scaled[name] = new_amount\n    return scaled", "entry_point": "scale_recipe", "input": "{'flour': 2.5, 'sugar': 1.0, 'eggs': 3, 'butter': 0.75}, 1.5", "output": "{'flour': 3.75, 'sugar': 1.5, 'eggs': 4.5, 'butter': 1.12}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ymg4p2scqmrajj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031303", "code": "def match_route(routes, path):\n    path_parts = path.strip(\"/\").split(\"/\")\n    for pattern, handler in routes:\n        pattern_parts = pattern.strip(\"/\").split(\"/\")\n        if len(pattern_parts) != len(path_parts):\n            continue\n        params = {}\n        matched = True\n        for pp, ap in zip(pattern_parts, path_parts):\n            if pp.startswith(\":\"):\n                params[pp[1:]] = ap\n            elif pp != ap:\n                matched = False\n                break\n        if matched:\n            return handler, params\n    return None, {}", "entry_point": "match_route", "input": "[('/users/:id', 'get_user'), ('/users/:id/posts/:postId', 'get_post')], '/users/42/posts/7'", "output": "('get_post', {'id': '42', 'postId': '7'})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yng4p2er6xiu56", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031304", "code": "def compare_versions(v1, v2):\n    parts1 = [int(x) for x in v1.split(\".\")]\n    parts2 = [int(x) for x in v2.split(\".\")]\n    length = max(len(parts1), len(parts2))\n    parts1 += [0] * (length - len(parts1))\n    parts2 += [0] * (length - len(parts2))\n    for a, b in zip(parts1, parts2):\n        if a != b:\n            return 1 if a > b else -1\n    return 0", "entry_point": "compare_versions", "input": "'1.2.3', '1.2'", "output": "1", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yog4p28zvuk598", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031305", "code": "def group_duplicate_files(files):\n    def simple_hash(content):\n        h = 0\n        for ch in content:\n            h = (h * 31 + ord(ch)) % 1000000007\n        return h\n    groups = {}\n    for name, content in files:\n        h = simple_hash(content)\n        groups.setdefault(h, []).append(name)\n    return sorted([sorted(g) for g in groups.values() if len(g) > 1])", "entry_point": "group_duplicate_files", "input": "[('a.txt', 'hello'), ('b.txt', 'world'), ('c.txt', 'hello'), ('d.txt', 'hello'), ('e.txt', 'unique')]", "output": "[['a.txt', 'c.txt', 'd.txt']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ypg4p2ztecr1vs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031306", "code": "def weighted_round_robin(servers, num_requests):\n    current_weights = {name: 0 for name, _ in servers}\n    total_weight = sum(w for _, w in servers)\n    assignments = []\n    for _ in range(num_requests):\n        for name, weight in servers:\n            current_weights[name] += weight\n        chosen = max(current_weights, key=lambda k: current_weights[k])\n        current_weights[chosen] -= total_weight\n        assignments.append(chosen)\n    return assignments", "entry_point": "weighted_round_robin", "input": "[('A', 5), ('B', 1), ('C', 1)], 7", "output": "['A', 'A', 'B', 'A', 'C', 'A', 'A']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yqg4p2yuzplvdv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031307", "code": "def count_palindromic_substrings_min_length(s, min_length):\n    count = 0\n    n = len(s)\n    for i in range(n):\n        for j in range(i + min_length, n + 1):\n            sub = s[i:j]\n            if sub == sub[::-1]:\n                count += 1\n    return count", "entry_point": "count_palindromic_substrings_min_length", "input": "'abaaba', 3", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yrg4p2nrlkyind", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031308", "code": "def detect_spikes(readings, window, threshold):\n    spikes = []\n    for i in range(len(readings)):\n        start = max(0, i - window)\n        history = readings[start:i]\n        if not history:\n            continue\n        avg = sum(history) / len(history)\n        if abs(readings[i] - avg) > threshold:\n            spikes.append(i)\n    return spikes", "entry_point": "detect_spikes", "input": "[20, 21, 19, 22, 55, 20, 21, 60, 19], 3, 10", "output": "[4, 5, 6, 7, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ysg4p2ftjgc0vu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031309", "code": "def compute_standings(matches):\n    table = {}\n    for home, away, home_score, away_score in matches:\n        for team in (home, away):\n            table.setdefault(team, {\"points\": 0, \"gd\": 0})\n        if home_score > away_score:\n            table[home][\"points\"] += 3\n        elif away_score > home_score:\n            table[away][\"points\"] += 3\n        else:\n            table[home][\"points\"] += 1\n            table[away][\"points\"] += 1\n        table[home][\"gd\"] += home_score - away_score\n        table[away][\"gd\"] += away_score - home_score\n    ranked = sorted(table.items(), key=lambda kv: (-kv[1][\"points\"], -kv[1][\"gd\"]))\n    return [name for name, _ in ranked]", "entry_point": "compute_standings", "input": "[('A', 'B', 2, 1), ('C', 'D', 0, 0), ('B', 'C', 3, 1), ('A', 'D', 1, 1)]", "output": "['A', 'B', 'D', 'C']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ytg4p2f9zj3gm0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031310", "code": "def wrap_text(words, width):\n    lines = []\n    current = []\n    current_len = 0\n    for word in words:\n        extra = len(word) + (1 if current else 0)\n        if current_len + extra > width:\n            lines.append(\" \".join(current))\n            current = [word]\n            current_len = len(word)\n        else:\n            current.append(word)\n            current_len += extra\n    if current:\n        lines.append(\" \".join(current))\n    return lines", "entry_point": "wrap_text", "input": "['The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog'], 12", "output": "['The quick', 'brown fox', 'jumps over', 'the lazy dog']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yug4p2z7tiq3lq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031311", "code": "def order_pick_path(items_by_aisle):\n    aisles = sorted(items_by_aisle.keys())\n    path = []\n    for idx, aisle in enumerate(aisles):\n        bins = sorted(items_by_aisle[aisle])\n        if idx % 2 == 1:\n            bins = bins[::-1]\n        for b in bins:\n            path.append((aisle, b))\n    return path", "entry_point": "order_pick_path", "input": "{1: [3, 1, 2], 2: [5, 4], 3: [7, 6, 8]}", "output": "[(1, 1), (1, 2), (1, 3), (2, 5), (2, 4), (3, 6), (3, 7), (3, 8)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yvg4p2gvqpajb4", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031312", "code": "def rank_word_frequency(text, top_n):\n    words = text.lower().split()\n    freq = {}\n    order = {}\n    for i, w in enumerate(words):\n        w = w.strip(\".,!?\")\n        if w not in freq:\n            order[w] = i\n        freq[w] = freq.get(w, 0) + 1\n    ranked = sorted(freq.items(), key=lambda kv: (-kv[1], order[kv[0]]))\n    return ranked[:top_n]", "entry_point": "rank_word_frequency", "input": "'the quick fox jumps the lazy fox the fox runs', 2", "output": "[('the', 3), ('fox', 3)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301ywg4p23r5hik5j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031313", "code": "def find_overlapping_shifts(shifts):\n    conflicts = []\n    sorted_shifts = sorted(shifts, key=lambda s: s[1])\n    for i in range(len(sorted_shifts)):\n        for j in range(i + 1, len(sorted_shifts)):\n            name_i, start_i, end_i = sorted_shifts[i]\n            name_j, start_j, end_j = sorted_shifts[j]\n            if name_i == name_j and start_j < end_i:\n                conflicts.append((name_i, (start_i, end_i), (start_j, end_j)))\n    return conflicts", "entry_point": "find_overlapping_shifts", "input": "[('Sam', 9, 17), ('Sam', 16, 20), ('Lee', 8, 12), ('Lee', 13, 18)]", "output": "[('Sam', (9, 17), (16, 20))]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yxg4p2pmfuckys", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031314", "code": "def validate_order_transitions(transitions):\n    allowed = {\n        \"created\": {\"paid\", \"cancelled\"},\n        \"paid\": {\"shipped\", \"refunded\"},\n        \"shipped\": {\"delivered\", \"returned\"},\n        \"delivered\": set(),\n        \"cancelled\": set(),\n        \"refunded\": set(),\n        \"returned\": {\"refunded\"},\n    }\n    state = \"created\"\n    for next_state in transitions:\n        if next_state not in allowed.get(state, set()):\n            return f\"invalid transition: {state} -> {next_state}\"\n        state = next_state\n    return state", "entry_point": "validate_order_transitions", "input": "['paid', 'shipped', 'delivered']", "output": "'delivered'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvnghm301yyg4p2uno6sesp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031315", "code": "def safe_transpose(matrix):\n    if not matrix:\n        return []\n    row_len = len(matrix[0])\n    for row in matrix:\n        if len(row) != row_len:\n            raise ValueError(\"Jagged matrix cannot be transposed\")\n    return [[matrix[r][c] for r in range(len(matrix))] for c in range(row_len)]", "entry_point": "safe_transpose", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[1, 4], [2, 5], [3, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa30218g4p2bperzaeg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031316", "code": "def count_allowed_requests(timestamps, window_size, max_requests):\n    allowed = []\n    window = []\n    for t in timestamps:\n        window = [w for w in window if t - w < window_size]\n        if len(window) < max_requests:\n            window.append(t)\n            allowed.append(t)\n    return allowed", "entry_point": "count_allowed_requests", "input": "[1, 2, 3, 4, 10, 11, 12, 20], 5, 3", "output": "[1, 2, 3, 10, 11, 12, 20]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa30219g4p29upct5uf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031317", "code": "def flatten_dict(d, prefix=\"\"):\n    result = {}\n    for key, value in d.items():\n        full_key = f\"{prefix}.{key}\" if prefix else key\n        if isinstance(value, dict):\n            result.update(flatten_dict(value, full_key))\n        else:\n            result[full_key] = value\n    return result", "entry_point": "flatten_dict", "input": "{'user': {'name': 'Ana', 'address': {'city': 'Reno', 'zip': '89501'}}, 'active': True}", "output": "{'user.name': 'Ana', 'user.address.city': 'Reno', 'user.address.zip': '89501', 'active': True}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021ag4p2yduxxjms", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031318", "code": "def merge_playlists(playlist_a, playlist_b):\n    i = j = 0\n    merged = []\n    while i < len(playlist_a) and j < len(playlist_b):\n        if playlist_a[i][1] <= playlist_b[j][1]:\n            merged.append(playlist_a[i])\n            i += 1\n        else:\n            merged.append(playlist_b[j])\n            j += 1\n    merged.extend(playlist_a[i:])\n    merged.extend(playlist_b[j:])\n    return merged", "entry_point": "merge_playlists", "input": "[('SongA', 10), ('SongC', 30)], [('SongB', 20), ('SongD', 25), ('SongE', 40)]", "output": "[('SongA', 10), ('SongB', 20), ('SongD', 25), ('SongC', 30), ('SongE', 40)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021bg4p2m0o078jt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031319", "code": "def compute_company_checksum(digits):\n    weights = [7, 3, 1, 9, 7, 3, 1]\n    total = sum(d * w for d, w in zip(digits, weights[:len(digits)]))\n    return total % 11", "entry_point": "compute_company_checksum", "input": "[4, 2, 7, 1, 9, 0, 3]", "output": "6", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021cg4p276rfekcs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031320", "code": "def round_robin_schedule(tasks, quantum):\n    from collections import deque\n    queue = deque((name, burst) for name, burst in tasks)\n    time = 0\n    order = []\n    while queue:\n        name, burst = queue.popleft()\n        run_time = min(quantum, burst)\n        time += run_time\n        remaining = burst - run_time\n        order.append((name, time))\n        if remaining > 0:\n            queue.append((name, remaining))\n    return order", "entry_point": "round_robin_schedule", "input": "[('P1', 5), ('P2', 3), ('P3', 8)], 4", "output": "[('P1', 4), ('P2', 7), ('P3', 11), ('P1', 12), ('P3', 16)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021dg4p2dihdig5x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031321", "code": "def split_csv_row(row):\n    fields = []\n    current = \"\"\n    in_quotes = False\n    i = 0\n    while i < len(row):\n        ch = row[i]\n        if ch == '\"':\n            in_quotes = not in_quotes\n        elif ch == ',' and not in_quotes:\n            fields.append(current)\n            current = \"\"\n        else:\n            current += ch\n        i += 1\n    fields.append(current)\n    return fields", "entry_point": "split_csv_row", "input": "'John,\"Doe, Jr.\",42,\"New York, NY\"'", "output": "['John', 'Doe, Jr.', '42', 'New York, NY']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021eg4p2h5xkneng", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031322", "code": "def longest_login_streak(dates):\n    from datetime import datetime\n    parsed = sorted(datetime.strptime(d, \"%Y-%m-%d\") for d in set(dates))\n    longest = 1 if parsed else 0\n    current = 1\n    for i in range(1, len(parsed)):\n        if (parsed[i] - parsed[i-1]).days == 1:\n            current += 1\n            longest = max(longest, current)\n        else:\n            current = 1\n    return longest", "entry_point": "longest_login_streak", "input": "['2026-01-01', '2026-01-02', '2026-01-03', '2026-01-05', '2026-01-06', '2026-01-07', '2026-01-08']", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021fg4p2j3b7pdvo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031323", "code": "def evaluate_expression(expr):\n    tokens = []\n    num = \"\"\n    for ch in expr.replace(\" \", \"\"):\n        if ch.isdigit() or ch == \".\":\n            num += ch\n        else:\n            if num:\n                tokens.append(float(num))\n                num = \"\"\n            tokens.append(ch)\n    if num:\n        tokens.append(float(num))\n\n    def apply_ops(values, ops):\n        b = values.pop()\n        a = values.pop()\n        op = ops.pop()\n        if op == \"+\": values.append(a + b)\n        elif op == \"-\": values.append(a - b)\n        elif op == \"*\": values.append(a * b)\n        elif op == \"/\": values.append(a / b)\n\n    values, ops = [], []\n    precedence = {\"+\": 1, \"-\": 1, \"*\": 2, \"/\": 2}\n    for tok in tokens:\n        if isinstance(tok, float):\n            values.append(tok)\n        else:\n            while ops and precedence.get(ops[-1], 0) >= precedence.get(tok, 0):\n                apply_ops(values, ops)\n            ops.append(tok)\n    while ops:\n        apply_ops(values, ops)\n    result = values[0]\n    return int(result) if result == int(result) else result", "entry_point": "evaluate_expression", "input": "'3 + 4 * 2 - 6 / 3'", "output": "9", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021gg4p21zlzifwu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031324", "code": "def dispatch_elevator(elevator_positions, call_floor, direction):\n    best_idx = None\n    best_dist = None\n    for i, (pos, moving_dir) in enumerate(elevator_positions):\n        if moving_dir == \"idle\" or moving_dir == direction:\n            dist = abs(pos - call_floor)\n            if best_dist is None or dist < best_dist:\n                best_dist = dist\n                best_idx = i\n    return best_idx", "entry_point": "dispatch_elevator", "input": "[(1, 'idle'), (5, 'up'), (10, 'down')], 6, 'up'", "output": "1", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021hg4p2ovxnx3j8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031325", "code": "def compute_reorder_points(items):\n    result = {}\n    for name, daily_sales, lead_time_days, safety_stock in items:\n        reorder_point = daily_sales * lead_time_days + safety_stock\n        result[name] = reorder_point\n    return result", "entry_point": "compute_reorder_points", "input": "[('widget', 12, 5, 20), ('gadget', 3, 10, 5), ('gizmo', 25, 2, 0)]", "output": "{'widget': 80, 'gadget': 35, 'gizmo': 50}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021ig4p229ukkrsm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031326", "code": "def bucket_students_by_grade(students):\n    buckets = {\"A\": [], \"B\": [], \"C\": [], \"D/F\": []}\n    for name, score in students:\n        if score >= 90:\n            buckets[\"A\"].append(name)\n        elif score >= 80:\n            buckets[\"B\"].append(name)\n        elif score >= 70:\n            buckets[\"C\"].append(name)\n        else:\n            buckets[\"D/F\"].append(name)\n    averages = {}\n    for grade, names in buckets.items():\n        scores = [s for n, s in students if n in names]\n        averages[grade] = round(sum(scores) / len(scores), 1) if scores else None\n    return averages", "entry_point": "bucket_students_by_grade", "input": "[('Ana', 95), ('Ben', 82), ('Cid', 71), ('Dan', 60), ('Eve', 88), ('Fay', 91)]", "output": "{'A': 93.0, 'B': 85.0, 'C': 71.0, 'D/F': 60.0}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021jg4p2ctwcbsyz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031327", "code": "def normalize_and_dedupe_contacts(raw_numbers):\n    seen = set()\n    result = []\n    for raw in raw_numbers:\n        digits = \"\".join(ch for ch in raw if ch.isdigit())\n        if len(digits) == 11 and digits.startswith(\"1\"):\n            digits = digits[1:]\n        if len(digits) != 10:\n            continue\n        formatted = f\"({digits[0:3]}) {digits[3:6]}-{digits[6:10]}\"\n        if formatted not in seen:\n            seen.add(formatted)\n            result.append(formatted)\n    return result", "entry_point": "normalize_and_dedupe_contacts", "input": "['415-555-0132', '(415) 555-0132', '1-415-555-0199', '555-0199', '4155550199']", "output": "['(415) 555-0132', '(415) 555-0199']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021kg4p2gclhk2ed", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031328", "code": "def shipping_cost(weight_kg, distance_km):\n    if weight_kg <= 1:\n        base = 5.0\n    elif weight_kg <= 5:\n        base = 5.0 + (weight_kg - 1) * 1.5\n    else:\n        base = 11.0 + (weight_kg - 5) * 2.0\n    if distance_km > 500:\n        base *= 1.4\n    elif distance_km > 100:\n        base *= 1.15\n    return round(base, 2)", "entry_point": "shipping_cost", "input": "0.5, 50", "output": "5.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021lg4p2664q7xjl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031329", "code": "def find_cyclic_targets(dependencies):\n    graph = {}\n    for src, dst in dependencies:\n        graph.setdefault(src, []).append(dst)\n        graph.setdefault(dst, [])\n    state = {}\n    cyclic = set()\n\n    def dfs(node, path):\n        state[node] = \"visiting\"\n        path.append(node)\n        for nxt in graph.get(node, []):\n            if state.get(nxt) == \"visiting\":\n                cycle_start = path.index(nxt)\n                cyclic.update(path[cycle_start:])\n            elif state.get(nxt) != \"done\":\n                dfs(nxt, path)\n        path.pop()\n        state[node] = \"done\"\n\n    for node in list(graph):\n        if state.get(node) is None:\n            dfs(node, [])\n    return sorted(cyclic)", "entry_point": "find_cyclic_targets", "input": "[('build', 'compile'), ('compile', 'link'), ('link', 'build'), ('test', 'compile'), ('deploy', 'test')]", "output": "['build', 'compile', 'link']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021mg4p22s63nj0g", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031330", "code": "def process_ledger(transactions, overdraft_limit):\n    balance = 0\n    declined = []\n    for desc, amount in transactions:\n        if balance + amount < -overdraft_limit:\n            declined.append(desc)\n            continue\n        balance += amount\n    return balance, declined", "entry_point": "process_ledger", "input": "[('deposit', 100), ('rent', -300), ('paycheck', 150), ('groceries', -60), ('car payment', -250)], 200", "output": "(-110, ['car payment'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021ng4p2p6otthut", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031331", "code": "def merge_meetings_with_buffer(meetings, buffer_minutes):\n    if not meetings:\n        return []\n    sorted_meetings = sorted(meetings)\n    merged = [list(sorted_meetings[0])]\n    for start, end in sorted_meetings[1:]:\n        last_start, last_end = merged[-1]\n        if start <= last_end + buffer_minutes:\n            merged[-1][1] = max(last_end, end)\n        else:\n            merged.append([start, end])\n    return [tuple(m) for m in merged]", "entry_point": "merge_meetings_with_buffer", "input": "[(9, 10), (10, 11), (13, 14), (14, 16), (20, 21)], 15", "output": "[(9, 21)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021og4p2j1wueozd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031332", "code": "class FrequencyCache:\n    def __init__(self, capacity):\n        self.capacity = capacity\n        self.store = {}\n        self.freq = {}\n\n    def put(self, key, value):\n        if key in self.store:\n            self.store[key] = value\n            self.freq[key] += 1\n            return\n        if len(self.store) >= self.capacity:\n            least_key = min(self.freq, key=lambda k: self.freq[k])\n            del self.store[least_key]\n            del self.freq[least_key]\n        self.store[key] = value\n        self.freq[key] = 1\n\n    def get(self, key):\n        if key not in self.store:\n            return None\n        self.freq[key] += 1\n        return self.store[key]\n\ndef run_cache_ops(ops):\n    cache = FrequencyCache(2)\n    results = []\n    for op in ops:\n        if op[0] == \"put\":\n            cache.put(op[1], op[2])\n            results.append(None)\n        else:\n            results.append(cache.get(op[1]))\n    return results", "entry_point": "run_cache_ops", "input": "[('put', 'a', 1), ('put', 'b', 2), ('get', 'a'), ('put', 'c', 3), ('get', 'b'), ('get', 'c')]", "output": "[None, None, 1, None, None, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021pg4p2cjgd394y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031333", "code": "def weighted_moving_average(values, weights):\n    n = len(weights)\n    result = []\n    for i in range(len(values)):\n        window = []\n        window_weights = []\n        for j in range(n):\n            idx = i - (n // 2) + j\n            if 0 <= idx < len(values):\n                window.append(values[idx])\n                window_weights.append(weights[j])\n        total_weight = sum(window_weights)\n        weighted_sum = sum(v * w for v, w in zip(window, window_weights))\n        result.append(round(weighted_sum / total_weight, 2))\n    return result", "entry_point": "weighted_moving_average", "input": "[10, 12, 9, 14, 20, 18], [1, 2, 1]", "output": "[10.67, 10.75, 11.0, 14.25, 18.0, 18.67]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021qg4p2o5t39asc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031334", "code": "def count_log_levels_by_service(log_lines):\n    counts = {}\n    for line in log_lines:\n        parts = line.split(\" \", 2)\n        if len(parts) < 3:\n            continue\n        service, level = parts[0], parts[1]\n        counts.setdefault(service, {})\n        counts[service][level] = counts[service].get(level, 0) + 1\n    return counts", "entry_point": "count_log_levels_by_service", "input": "['auth WARN token expiring', 'auth ERROR login failed', 'billing INFO charge ok', 'auth ERROR login failed', 'billing ERROR timeout']", "output": "{'auth': {'WARN': 1, 'ERROR': 2}, 'billing': {'INFO': 1, 'ERROR': 1}}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvntqa3021rg4p24yz9djnt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031335", "code": "def reverse_evens(nums):\n    return nums[::-2]\n", "entry_point": "reverse_evens", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[10, 8, 6, 4, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0272g4p2ffjxwumd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031336", "code": "def repeat_join(words, n):\n    return '-'.join(words) * n\n", "entry_point": "repeat_join", "input": "['a', 'b'], 2", "output": "'a-ba-b'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0273g4p2ffo7uy5n", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031337", "code": "def transform(d):\n    return {k: (v * 2 if v % 2 == 0 else v) for k, v in d.items()}\n", "entry_point": "transform", "input": "{'a': 1, 'b': 2, 'c': 3, 'd': 4}", "output": "{'a': 1, 'b': 4, 'c': 3, 'd': 8}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0274g4p270o28upm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031338", "code": "def classify(n):\n    try:\n        result = 10 / n\n    except ZeroDivisionError:\n        return 'undefined'\n    else:\n        return f'ok:{result}'\n", "entry_point": "classify", "input": "5", "output": "'ok:2.0'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0275g4p2olwpi9ya", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031339", "code": "def pairs(n):\n    return [(i, j) for i in range(n) for j in range(i) if (i + j) % 2 == 0]\n", "entry_point": "pairs", "input": "4", "output": "[(2, 0), (3, 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0276g4p2icrwj8hr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031340", "code": "def center_text(s, width):\n    return s.center(width, '*')\n", "entry_point": "center_text", "input": "'hi', 6", "output": "'**hi**'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0277g4p2waw08gmi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031341", "code": "def fib(n, memo={}):\n    if n in memo:\n        return memo[n]\n    if n <= 1:\n        return n\n    memo[n] = fib(n - 1, memo) + fib(n - 2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "10", "output": "55", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0278g4p2xgk64tgq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031342", "code": "def split_first_last(items):\n    first, *middle, last = items\n    return (first, middle, last)\n", "entry_point": "split_first_last", "input": "[1, 2, 3, 4, 5]", "output": "(1, [2, 3, 4], 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z0279g4p2lotasn3z", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031343", "code": "def analyze(a, b):\n    return (sorted(a | b), sorted(a & b), sorted(a - b))\n", "entry_point": "analyze", "input": "{1, 2, 3}, {2, 3, 4}", "output": "([1, 2, 3, 4], [2, 3], [1])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z027ag4p2t4yj2p41", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031344", "code": "def parse_key_value(s):\n    key, value = s.split('=', 1)\n    return (key.strip(), value.strip())\n", "entry_point": "parse_key_value", "input": "'  name = John Smith = extra '", "output": "('name', 'John Smith = extra')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvobe4z027bg4p27d3p075i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031345", "code": "\ndef fib(n, memo=None):\n    if memo is None:\n        memo = {}\n    if n in memo:\n        return memo[n]\n    if n <= 1:\n        return n\n    memo[n] = fib(n - 1, memo) + fib(n - 2, memo)\n    return memo[n]\n", "entry_point": "fib", "input": "20", "output": "6765", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl027wg4p2g4tzhb6o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031346", "code": "\ndef gcd(a, b):\n    while b:\n        a, b = b, a % b\n    return a\n", "entry_point": "gcd", "input": "252, 105", "output": "21", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl027xg4p28tyxe2j9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031347", "code": "\ndef gcd(a, b):\n    while b:\n        a, b = b, a % b\n    return a\n\ndef lcm(a, b):\n    return a * b // gcd(a, b)\n", "entry_point": "lcm", "input": "4, 6", "output": "12", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl027yg4p2ara94qv0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031348", "code": "\ndef is_palindrome(s):\n    cleaned = ''.join(ch.lower() for ch in s if ch.isalnum())\n    return cleaned == cleaned[::-1]\n", "entry_point": "is_palindrome", "input": "'A man a plan a canal Panama'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl027zg4p2wd2bpk14", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031349", "code": "\ndef run_length_encode(s):\n    if not s:\n        return ''\n    result = []\n    prev = s[0]\n    count = 1\n    for ch in s[1:]:\n        if ch == prev:\n            count += 1\n        else:\n            result.append(prev + str(count))\n            prev = ch\n            count = 1\n    result.append(prev + str(count))\n    return ''.join(result)\n", "entry_point": "run_length_encode", "input": "'aaabbbccd'", "output": "'a3b3c2d1'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0280g4p2w4c5fq1l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031350", "code": "\ndef digit_sum(n):\n    return sum(int(d) for d in str(n))\n", "entry_point": "digit_sum", "input": "987654", "output": "39", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0281g4p22e1tvplf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031351", "code": "\ndef reverse_int(n):\n    sign = -1 if n < 0 else 1\n    rev = int(str(abs(n))[::-1])\n    return sign * rev\n", "entry_point": "reverse_int", "input": "-12345", "output": "-54321", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0282g4p29wy6lb27", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031352", "code": "\ndef is_perfect(n):\n    divisors_sum = sum(i for i in range(1, n) if n % i == 0)\n    return divisors_sum == n\n", "entry_point": "is_perfect", "input": "28", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0283g4p2a8kjnfin", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031353", "code": "\ndef is_armstrong(n):\n    digits = str(n)\n    power = len(digits)\n    return n == sum(int(d) ** power for d in digits)\n", "entry_point": "is_armstrong", "input": "153", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0284g4p2qjnz01m9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031354", "code": "\ndef binary_to_decimal(s):\n    return int(s, 2)\n", "entry_point": "binary_to_decimal", "input": "'110110'", "output": "54", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0285g4p2tqjo6ayr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031355", "code": "\ndef decimal_to_binary(n):\n    if n == 0:\n        return '0'\n    bits = []\n    while n > 0:\n        bits.append(str(n % 2))\n        n //= 2\n    return ''.join(reversed(bits))\n", "entry_point": "decimal_to_binary", "input": "233", "output": "'11101001'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0286g4p29jv5wyy2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031356", "code": "\ndef count_set_bits(n):\n    count = 0\n    while n:\n        count += n & 1\n        n >>= 1\n    return count\n", "entry_point": "count_set_bits", "input": "255", "output": "8", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0287g4p2y2ykqh0r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031357", "code": "\ndef permutations_of(items):\n    if len(items) <= 1:\n        return [items]\n    result = []\n    for i in range(len(items)):\n        rest = items[:i] + items[i + 1:]\n        for p in permutations_of(rest):\n            result.append([items[i]] + p)\n    return result\n", "entry_point": "permutations_of", "input": "[1, 2, 3]", "output": "[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0288g4p26p7q62on", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031358", "code": "\nimport math\n\ndef n_choose_r(n, r):\n    return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n", "entry_point": "n_choose_r", "input": "10, 3", "output": "120", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl0289g4p2ce8jc32r", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031359", "code": "\ndef rotate_matrix_clockwise(matrix):\n    n = len(matrix)\n    m = len(matrix[0])\n    result = [[None] * n for _ in range(m)]\n    for i in range(n):\n        for j in range(m):\n            result[j][n - 1 - i] = matrix[i][j]\n    return result\n", "entry_point": "rotate_matrix_clockwise", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[4, 1], [5, 2], [6, 3]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028ag4p29ab51vur", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031360", "code": "\ndef matmul(a, b):\n    rows_a = len(a)\n    cols_a = len(a[0])\n    cols_b = len(b[0])\n    result = [[0] * cols_b for _ in range(rows_a)]\n    for i in range(rows_a):\n        for j in range(cols_b):\n            for k in range(cols_a):\n                result[i][j] += a[i][k] * b[k][j]\n    return result\n", "entry_point": "matmul", "input": "[[1, 2], [3, 4]], [[5, 6], [7, 8]]", "output": "[[19, 22], [43, 50]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028bg4p2tc49c7un", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031361", "code": "\ndef bubble_sort(arr):\n    arr = list(arr)\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n - i - 1):\n            if arr[j] > arr[j + 1]:\n                arr[j], arr[j + 1] = arr[j + 1], arr[j]\n    return arr\n", "entry_point": "bubble_sort", "input": "[5, 2, 8, 1, 9, 3]", "output": "[1, 2, 3, 5, 8, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028cg4p2ak6r9gqw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031362", "code": "\ndef selection_sort(arr):\n    arr = list(arr)\n    n = len(arr)\n    for i in range(n):\n        min_idx = i\n        for j in range(i + 1, n):\n            if arr[j] < arr[min_idx]:\n                min_idx = j\n        arr[i], arr[min_idx] = arr[min_idx], arr[i]\n    return arr\n", "entry_point": "selection_sort", "input": "[64, 25, 12, 22, 11]", "output": "[11, 12, 22, 25, 64]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028dg4p2npa3un1l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031363", "code": "\ndef insertion_sort(arr):\n    arr = list(arr)\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j >= 0 and arr[j] > key:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n", "entry_point": "insertion_sort", "input": "[12, 11, 13, 5, 6]", "output": "[5, 6, 11, 12, 13]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028eg4p2j997xe73", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031364", "code": "\ndef quick_sort(arr):\n    if len(arr) <= 1:\n        return list(arr)\n    pivot = arr[len(arr) // 2]\n    left = [x for x in arr if x < pivot]\n    mid = [x for x in arr if x == pivot]\n    right = [x for x in arr if x > pivot]\n    return quick_sort(left) + mid + quick_sort(right)\n", "entry_point": "quick_sort", "input": "[10, 7, 8, 9, 1, 5]", "output": "[1, 5, 7, 8, 9, 10]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028fg4p2yonk8bfx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031365", "code": "\ndef merge_sort(arr):\n    if len(arr) <= 1:\n        return list(arr)\n    mid = len(arr) // 2\n    left = merge_sort(arr[:mid])\n    right = merge_sort(arr[mid:])\n    result = []\n    i = j = 0\n    while i < len(left) and j < len(right):\n        if left[i] <= right[j]:\n            result.append(left[i])\n            i += 1\n        else:\n            result.append(right[j])\n            j += 1\n    result.extend(left[i:])\n    result.extend(right[j:])\n    return result\n", "entry_point": "merge_sort", "input": "[38, 27, 43, 3, 9, 82, 10]", "output": "[3, 9, 10, 27, 38, 43, 82]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028gg4p2h1ogpovk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031366", "code": "\ndef search_rotated(nums, target):\n    lo, hi = 0, len(nums) - 1\n    while lo <= hi:\n        mid = (lo + hi) // 2\n        if nums[mid] == target:\n            return mid\n        if nums[lo] <= nums[mid]:\n            if nums[lo] <= target < nums[mid]:\n                hi = mid - 1\n            else:\n                lo = mid + 1\n        else:\n            if nums[mid] < target <= nums[hi]:\n                lo = mid + 1\n            else:\n                hi = mid - 1\n    return -1\n", "entry_point": "search_rotated", "input": "[4, 5, 6, 7, 0, 1, 2], 0", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028hg4p2n98ack4e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031367", "code": "\ndef find_median(a, b):\n    merged = sorted(a + b)\n    n = len(merged)\n    mid = n // 2\n    if n % 2 == 0:\n        return (merged[mid - 1] + merged[mid]) / 2\n    return float(merged[mid])\n", "entry_point": "find_median", "input": "[1, 3], [2, 7, 8]", "output": "3.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028ig4p2fsys7y2i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031368", "code": "\ndef run_length_encode(s):\n    if not s:\n        return []\n    result = []\n    prev = s[0]\n    count = 1\n    for ch in s[1:]:\n        if ch == prev:\n            count += 1\n        else:\n            result.append((prev, count))\n            prev = ch\n            count = 1\n    result.append((prev, count))\n    return result\n", "entry_point": "run_length_encode", "input": "'aaabbbccd'", "output": "[('a', 3), ('b', 3), ('c', 2), ('d', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028kg4p2h7x11ehi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031369", "code": "\ndef is_valid_parens(s):\n    pairs = {')': '(', ']': '[', '}': '{'}\n    stack = []\n    for ch in s:\n        if ch in '([{':\n            stack.append(ch)\n        elif ch in pairs:\n            if not stack or stack.pop() != pairs[ch]:\n                return False\n    return not stack\n", "entry_point": "is_valid_parens", "input": "'{[()()]}'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028lg4p2bf7mr0rs", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031370", "code": "\ndef min_path_sum(grid):\n    rows = len(grid)\n    cols = len(grid[0])\n    dp = [[0] * cols for _ in range(rows)]\n    dp[0][0] = grid[0][0]\n    for j in range(1, cols):\n        dp[0][j] = dp[0][j - 1] + grid[0][j]\n    for i in range(1, rows):\n        dp[i][0] = dp[i - 1][0] + grid[i][0]\n    for i in range(1, rows):\n        for j in range(1, cols):\n            dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]) + grid[i][j]\n    return dp[rows - 1][cols - 1]\n", "entry_point": "min_path_sum", "input": "[[1, 3, 1], [1, 5, 1], [4, 2, 1]]", "output": "7", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028mg4p2ssmoqg4f", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031371", "code": "\ndef max_subarray_sum_circular(nums):\n    total = sum(nums)\n    cur_max = best_max = nums[0]\n    cur_min = best_min = nums[0]\n    for x in nums[1:]:\n        cur_max = max(x, cur_max + x)\n        best_max = max(best_max, cur_max)\n        cur_min = min(x, cur_min + x)\n        best_min = min(best_min, cur_min)\n    if best_max < 0:\n        return best_max\n    return max(best_max, total - best_min)\n", "entry_point": "max_subarray_sum_circular", "input": "[5, -3, 5]", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028ng4p2au7gsl8z", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031372", "code": "\ndef flatten(nested):\n    result = []\n    for item in nested:\n        if isinstance(item, list):\n            result.extend(flatten(item))\n        else:\n            result.append(item)\n    return result\n", "entry_point": "flatten", "input": "[1, [2, 3, [4, 5], 6], [7, [8]]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028og4p2yotr85al", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031373", "code": "\ndef group_anagrams(words):\n    groups = {}\n    for w in words:\n        key = ''.join(sorted(w))\n        groups.setdefault(key, []).append(w)\n    return sorted(groups.values(), key=lambda g: sorted(g))\n", "entry_point": "group_anagrams", "input": "['eat', 'tea', 'tan', 'ate', 'nat', 'bat']", "output": "[['eat', 'tea', 'ate'], ['bat'], ['tan', 'nat']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvonedl028pg4p20yzfhdci", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031374", "code": "\ndef reorder_point(avg_daily_usage, lead_time_days, safety_stock):\n    return avg_daily_usage * lead_time_days + safety_stock\n", "entry_point": "reorder_point", "input": "42, 6, 75", "output": "327", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogv02c2g4p21pxxjsiv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031375", "code": "\ndef monthly_payment(principal, annual_rate, months):\n    r = annual_rate / 12\n    if r == 0:\n        return principal / months\n    return principal * r * (1 + r) ** months / ((1 + r) ** months - 1)\n", "entry_point": "monthly_payment", "input": "18500, 0.065, 48", "output": "438.7266291846104", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogv02c3g4p2kkcqfo64", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031376", "code": "\ndef wind_chill(temp_f, wind_mph):\n    if wind_mph <= 3 or temp_f > 50:\n        return temp_f\n    wc = 35.74 + 0.6215*temp_f - 35.75*(wind_mph**0.16) + 0.4275*temp_f*(wind_mph**0.16)\n    return round(wc, 2)\n", "entry_point": "wind_chill", "input": "20, 15", "output": "6.22", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogv02c4g4p2zgx4ltxr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031377", "code": "\nimport re\ndef password_strength(pw):\n    score = 0\n    if len(pw) >= 8: score += 1\n    if re.search(r'[A-Z]', pw): score += 1\n    if re.search(r'[a-z]', pw): score += 1\n    if re.search(r'[0-9]', pw): score += 1\n    if re.search(r'[^A-Za-z0-9]', pw): score += 1\n    labels = {0:'very weak',1:'weak',2:'weak',3:'medium',4:'strong',5:'very strong'}\n    return labels[score]\n", "entry_point": "password_strength", "input": "'Tr0ub4dor&3'", "output": "'very strong'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogv02c5g4p2aywrh3sy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031378", "code": "\ndef transpose(m):\n    return [list(row) for row in zip(*m)]\n", "entry_point": "transpose", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[1, 4], [2, 5], [3, 6]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02c6g4p2tzczx8ly", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031379", "code": "\ndef total_with_tax(subtotal):\n    if subtotal <= 100:\n        rate = 0.05\n    elif subtotal <= 500:\n        rate = 0.07\n    else:\n        rate = 0.0825\n    return round(subtotal * (1 + rate), 2)\n", "entry_point": "total_with_tax", "input": "632.4", "output": "684.57", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02c7g4p2skrkqlbb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031380", "code": "\ndef apply_discounts(price, discounts):\n    for d in discounts:\n        price -= price * d\n    return round(price, 2)\n", "entry_point": "apply_discounts", "input": "250.0, [0.1, 0.15, 0.05]", "output": "181.69", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02c8g4p22a4rtkhy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031381", "code": "\nfrom datetime import datetime, timedelta\ndef business_days_between(start_date, end_date):\n    d1 = datetime.strptime(start_date, '%Y-%m-%d')\n    d2 = datetime.strptime(end_date, '%Y-%m-%d')\n    days = 0\n    current = d1\n    while current < d2:\n        if current.weekday() < 5:\n            days += 1\n        current += timedelta(days=1)\n    return days\n", "entry_point": "business_days_between", "input": "'2026-08-01', '2026-08-15'", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02c9g4p2w91z7420", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031382", "code": "\ndef max_window_sum(nums, k):\n    window = sum(nums[:k])\n    best = window\n    for i in range(k, len(nums)):\n        window += nums[i] - nums[i-k]\n        best = max(best, window)\n    return best\n", "entry_point": "max_window_sum", "input": "[4, -1, 3, 7, -2, 5, 9, -8, 2], 3", "output": "12", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cag4p2vjzn6jya", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031383", "code": "\ndef roman_to_int(s):\n    vals = {'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}\n    total = 0\n    for i, ch in enumerate(s):\n        v = vals[ch]\n        if i+1 < len(s) and vals[s[i+1]] > v:\n            total -= v\n        else:\n            total += v\n    return total\n", "entry_point": "roman_to_int", "input": "'MCMXCIV'", "output": "1994", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cbg4p2esf34a77", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031384", "code": "\ndef is_valid(s):\n    pairs = {')':'(', ']':'[', '}':'{'}\n    stack = []\n    for ch in s:\n        if ch in '([{':\n            stack.append(ch)\n        elif ch in pairs:\n            if not stack or stack.pop() != pairs[ch]:\n                return False\n    return not stack\n", "entry_point": "is_valid", "input": "'{[()()]}[]'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02ccg4p23pbeo5qm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031385", "code": "\ndef sum_numeric_column(csv_text, col_index):\n    rows = [r.split(',') for r in csv_text.strip().split('\\n')]\n    return sum(float(r[col_index]) for r in rows)\n", "entry_point": "sum_numeric_column", "input": "'a,10,x\\nb,20,y\\nc,30,z', 1", "output": "60.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cdg4p2k2x8o3gi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031386", "code": "\ndef most_common_word(text):\n    words = text.lower().split()\n    freq = {}\n    for w in words:\n        w = w.strip('.,!?')\n        freq[w] = freq.get(w, 0) + 1\n    return max(freq.items(), key=lambda x: x[1])[0]\n", "entry_point": "most_common_word", "input": "'the quick fox jumps over the lazy dog the fox runs'", "output": "'the'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02ceg4p2lkkhyk13", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031387", "code": "\ndef levenshtein(a, b):\n    m, n = len(a), len(b)\n    dp = [[0]*(n+1) for _ in range(m+1)]\n    for i in range(m+1): dp[i][0] = i\n    for j in range(n+1): dp[0][j] = j\n    for i in range(1, m+1):\n        for j in range(1, n+1):\n            cost = 0 if a[i-1]==b[j-1] else 1\n            dp[i][j] = min(dp[i-1][j]+1, dp[i][j-1]+1, dp[i-1][j-1]+cost)\n    return dp[m][n]\n", "entry_point": "levenshtein", "input": "'kitten', 'sitting'", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cfg4p2iztbuf45", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031388", "code": "\ndef shipping_cost(weight_kg, distance_km):\n    base = 5.0\n    weight_cost = weight_kg * 0.8\n    distance_cost = distance_km * 0.05\n    if weight_kg > 20:\n        distance_cost *= 1.15\n    return round(base + weight_cost + distance_cost, 2)\n", "entry_point": "shipping_cost", "input": "25, 340", "output": "44.55", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cgg4p23z8i6bd6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031389", "code": "\ndef caesar_encode(text, shift):\n    result = []\n    for ch in text:\n        if ch.isupper():\n            result.append(chr((ord(ch)-65+shift)%26+65))\n        elif ch.islower():\n            result.append(chr((ord(ch)-97+shift)%26+97))\n        else:\n            result.append(ch)\n    return ''.join(result)\n", "entry_point": "caesar_encode", "input": "'Attack at Dawn!', 7", "output": "'Haahjr ha Khdu!'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02chg4p2annz4uks", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031390", "code": "\ndef flatten(d, parent_key=''):\n    items = {}\n    for k, v in d.items():\n        new_key = f'{parent_key}.{k}' if parent_key else k\n        if isinstance(v, dict):\n            items.update(flatten(v, new_key))\n        else:\n            items[new_key] = v\n    return items\n", "entry_point": "flatten", "input": "{'user': {'name': 'Alice', 'address': {'city': 'Reno', 'zip': '89501'}}, 'active': True}", "output": "{'user.name': 'Alice', 'user.address.city': 'Reno', 'user.address.zip': '89501', 'active': True}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cig4p2t4qzqdc7", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031391", "code": "\ndef convert_hour(hour, from_offset, to_offset):\n    diff = to_offset - from_offset\n    return (hour + diff) % 24\n", "entry_point": "convert_hour", "input": "14, -5, 9", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cjg4p2q2povkda", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031392", "code": "\ndef bmi_category(weight_kg, height_m):\n    bmi = weight_kg / (height_m ** 2)\n    if bmi < 18.5:\n        cat = 'underweight'\n    elif bmi < 25:\n        cat = 'normal'\n    elif bmi < 30:\n        cat = 'overweight'\n    else:\n        cat = 'obese'\n    return f'{round(bmi,1)}:{cat}'\n", "entry_point": "bmi_category", "input": "82, 1.78", "output": "'25.9:overweight'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02ckg4p2k5a4r8wd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031393", "code": "\ndef compound_interest(principal, rate, times_per_year, years):\n    amount = principal * (1 + rate/times_per_year) ** (times_per_year*years)\n    return round(amount, 2)\n", "entry_point": "compound_interest", "input": "5000, 0.045, 12, 10", "output": "7834.96", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02clg4p232dj6h72", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031394", "code": "\ndef reverse_in_groups(lst, k):\n    result = []\n    for i in range(0, len(lst), k):\n        chunk = lst[i:i+k]\n        result.extend(chunk[::-1])\n    return result\n", "entry_point": "reverse_in_groups", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3", "output": "[3, 2, 1, 6, 5, 4, 9, 8, 7, 10]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cmg4p2t1fqlzys", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031395", "code": "\ndef eval_postfix(expr):\n    stack = []\n    for tok in expr.split():\n        if tok in '+-*/':\n            b = stack.pop()\n            a = stack.pop()\n            if tok == '+': stack.append(a+b)\n            elif tok == '-': stack.append(a-b)\n            elif tok == '*': stack.append(a*b)\n            elif tok == '/': stack.append(a/b)\n        else:\n            stack.append(float(tok))\n    return stack[0]\n", "entry_point": "eval_postfix", "input": "'4 6 2 * + 3 -'", "output": "13.0", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cng4p2ndltosnq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031396", "code": "\ndef compute_gpa(grades_credits):\n    total_points = sum(g*c for g, c in grades_credits)\n    total_credits = sum(c for _, c in grades_credits)\n    return round(total_points / total_credits, 2)\n", "entry_point": "compute_gpa", "input": "[(4.0, 3), (3.7, 4), (3.3, 3), (4.0, 2)]", "output": "3.73", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cog4p2oco061i2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031397", "code": "\nimport re\ndef is_palindrome(s):\n    cleaned = re.sub(r'[^a-z0-9]', '', s.lower())\n    return cleaned == cleaned[::-1]\n", "entry_point": "is_palindrome", "input": "'A man, a plan, a canal: Panama'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cpg4p28r5wyvke", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031398", "code": "\ndef merge_sorted(a, b):\n    result = []\n    i = j = 0\n    while i < len(a) and j < len(b):\n        if a[i] <= b[j]:\n            result.append(a[i]); i += 1\n        else:\n            result.append(b[j]); j += 1\n    result.extend(a[i:])\n    result.extend(b[j:])\n    return result\n", "entry_point": "merge_sorted", "input": "[1, 4, 7, 10, 15], [2, 3, 8, 9, 20]", "output": "[1, 2, 3, 4, 7, 8, 9, 10, 15, 20]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cqg4p29vd9dxeo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031399", "code": "\ndef digital_root(n):\n    while n >= 10:\n        n = sum(int(d) for d in str(n))\n    return n\n", "entry_point": "digital_root", "input": "9875", "output": "2", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02crg4p2gk56wuq2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031400", "code": "\ndef lcs_length(a, b):\n    m, n = len(a), len(b)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(1, m + 1):\n        for j in range(1, n + 1):\n            if a[i - 1] == b[j - 1]:\n                dp[i][j] = dp[i - 1][j - 1] + 1\n            else:\n                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n    return dp[m][n]\n", "entry_point": "lcs_length", "input": "'ABCBDAB', 'BDCABA'", "output": "4", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02csg4p246t1dhbd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031401", "code": "\ndef rotate_ccw(matrix):\n    n = len(matrix)\n    m = len(matrix[0])\n    return [[matrix[r][c] for r in range(n)] for c in range(m - 1, -1, -1)]\n", "entry_point": "rotate_ccw", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "[[3, 6], [2, 5], [1, 4]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02ctg4p213fs8p2i", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031402", "code": "\ndef sort_colors(nums):\n    low, mid, high = 0, 0, len(nums) - 1\n    nums = list(nums)\n    while mid <= high:\n        if nums[mid] == 0:\n            nums[low], nums[mid] = nums[mid], nums[low]\n            low += 1\n            mid += 1\n        elif nums[mid] == 1:\n            mid += 1\n        else:\n            nums[mid], nums[high] = nums[high], nums[mid]\n            high -= 1\n    return nums\n", "entry_point": "sort_colors", "input": "[2, 0, 2, 1, 1, 0]", "output": "[0, 0, 1, 1, 2, 2]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cug4p2j4xqi1lk", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031403", "code": "\nimport cmath\ndef solve_quadratic(a, b, c):\n    disc = b**2 - 4*a*c\n    root1 = (-b + cmath.sqrt(disc)) / (2*a)\n    root2 = (-b - cmath.sqrt(disc)) / (2*a)\n    return (round(root1.real,3), round(root2.real,3)) if disc >= 0 else (str(root1), str(root2))\n", "entry_point": "solve_quadratic", "input": "2, -7, 3", "output": "(3.0, 0.5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvowogw02cvg4p2c0rt43ua", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031404", "code": "\ndef zellers_congruence(year, month, day):\n    if month < 3:\n        month += 12\n        year -= 1\n    k = year % 100\n    j = year // 100\n    h = (day + (13 * (month + 1)) // 5 + k + k // 4 + j // 4 + 5 * j) % 7\n    days = [\"Saturday\", \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"]\n    return days[h]\n", "entry_point": "zellers_congruence", "input": "2026, 8, 16", "output": "'Sunday'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02oug4p2yn7n6i78", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031405", "code": "\ndef gregorian_to_jdn(year, month, day):\n    a = (14 - month) // 12\n    y = year + 4800 - a\n    m = month + 12 * a - 3\n    jdn = day + (153 * m + 2) // 5 + 365 * y + y // 4 - y // 100 + y // 400 - 32045\n    return jdn\n", "entry_point": "gregorian_to_jdn", "input": "2000, 1, 1", "output": "2451545", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02ovg4p2euuwncy8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031406", "code": "\ndef crc8(data: bytes, poly=0x07):\n    crc = 0\n    for byte in data:\n        crc ^= byte\n        for _ in range(8):\n            if crc & 0x80:\n                crc = ((crc << 1) ^ poly) & 0xFF\n            else:\n                crc = (crc << 1) & 0xFF\n    return crc\n", "entry_point": "crc8", "input": "b'123456789'", "output": "244", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02owg4p2pvmky86e", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031407", "code": "\ndef luhn_checksum(card_number: str):\n    digits = [int(d) for d in card_number]\n    odd_digits = digits[-1::-2]\n    even_digits = digits[-2::-2]\n    total = sum(odd_digits)\n    for d in even_digits:\n        total += sum(divmod(d * 2, 10))\n    return total % 10 == 0\n", "entry_point": "luhn_checksum", "input": "'4532015112830366'", "output": "True", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02oxg4p2vlfv49vm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031408", "code": "\ndef collatz_length(n):\n    steps = 0\n    while n != 1:\n        n = n // 2 if n % 2 == 0 else 3 * n + 1\n        steps += 1\n    return steps\n", "entry_point": "collatz_length", "input": "27", "output": "111", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02oyg4p2p567fdee", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031409", "code": "\ndef base62_encode(num):\n    alphabet = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"\n    if num == 0:\n        return alphabet[0]\n    arr = []\n    base = len(alphabet)\n    while num:\n        num, rem = divmod(num, base)\n        arr.append(alphabet[rem])\n    return \"\".join(reversed(arr))\n", "entry_point": "base62_encode", "input": "123456789", "output": "'8M0kX'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02ozg4p2qjjdp1ej", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031410", "code": "\ndef caesar_encrypt(text, shift):\n    result = []\n    for ch in text:\n        if ch.isupper():\n            result.append(chr((ord(ch) - 65 + shift) % 26 + 65))\n        elif ch.islower():\n            result.append(chr((ord(ch) - 97 + shift) % 26 + 97))\n        else:\n            result.append(ch)\n    return \"\".join(result)\n", "entry_point": "caesar_encrypt", "input": "'Attack at Dawn!', 3", "output": "'Dwwdfn dw Gdzq!'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p0g4p2bahv4hwd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031411", "code": "\ndef vigenere_encrypt(text, key):\n    result = []\n    key = key.upper()\n    ki = 0\n    for ch in text:\n        if ch.isalpha():\n            shift = ord(key[ki % len(key)]) - 65\n            base = 65 if ch.isupper() else 97\n            result.append(chr((ord(ch) - base + shift) % 26 + base))\n            ki += 1\n        else:\n            result.append(ch)\n    return \"\".join(result)\n", "entry_point": "vigenere_encrypt", "input": "'ATTACKATDAWN', 'LEMON'", "output": "'LXFOPVEFRNHR'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p1g4p2hegfgbt6", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031412", "code": "\ndef weighted_average_drop_lowest(scores, weights):\n    pairs = list(zip(scores, weights))\n    pairs.sort(key=lambda p: p[0])\n    dropped = pairs[1:]\n    total_weight = sum(w for _, w in dropped)\n    return round(sum(s*w for s, w in dropped) / total_weight, 2)\n", "entry_point": "weighted_average_drop_lowest", "input": "[88, 45, 92, 79], [0.3, 0.2, 0.25, 0.25]", "output": "86.44", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p2g4p23sfxgm50", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031413", "code": "\ndef infix_to_postfix(expr):\n    prec = {\"+\": 1, \"-\": 1, \"*\": 2, \"/\": 2}\n    output = []\n    ops = []\n    tokens = expr.split()\n    for tok in tokens:\n        if tok.isdigit():\n            output.append(tok)\n        elif tok == \"(\":\n            ops.append(tok)\n        elif tok == \")\":\n            while ops and ops[-1] != \"(\":\n                output.append(ops.pop())\n            ops.pop()\n        else:\n            while ops and ops[-1] != \"(\" and prec.get(ops[-1], 0) >= prec.get(tok, 0):\n                output.append(ops.pop())\n            ops.append(tok)\n    while ops:\n        output.append(ops.pop())\n    return \" \".join(output)\n", "entry_point": "infix_to_postfix", "input": "'3 + 4 * ( 2 - 1 )'", "output": "'3 4 2 1 - * +'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p3g4p2l49o2zdq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031414", "code": "\ndef union_find_components(n, edges):\n    parent = list(range(n))\n    def find(x):\n        while parent[x] != x:\n            parent[x] = parent[parent[x]]\n            x = parent[x]\n        return x\n    def union(a, b):\n        ra, rb = find(a), find(b)\n        if ra != rb:\n            parent[ra] = rb\n    for a, b in edges:\n        union(a, b)\n    return len(set(find(i) for i in range(n)))\n", "entry_point": "union_find_components", "input": "5, [(0, 1), (1, 2), (3, 4)]", "output": "2", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p4g4p23xvti296", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031415", "code": "\nclass TrieNode:\n    def __init__(self):\n        self.children = {}\n        self.is_end = False\n\ndef trie_search_prefix(words, prefix):\n    root = TrieNode()\n    for w in words:\n        node = root\n        for ch in w:\n            if ch not in node.children:\n                node.children[ch] = TrieNode()\n            node = node.children[ch]\n        node.is_end = True\n    node = root\n    for ch in prefix:\n        if ch not in node.children:\n            return []\n        node = node.children[ch]\n    results = []\n    def dfs(n, path):\n        if n.is_end:\n            results.append(prefix + path)\n        for c, child in n.children.items():\n            dfs(child, path + c)\n    dfs(node, \"\")\n    return sorted(results)\n", "entry_point": "trie_search_prefix", "input": "['cat', 'car', 'cart', 'dog'], 'ca'", "output": "['car', 'cart', 'cat']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p5g4p25ibq3xpz", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031416", "code": "\ndef topological_sort(n, edges):\n    from collections import deque\n    indeg = [0] * n\n    graph = [[] for _ in range(n)]\n    for u, v in edges:\n        graph[u].append(v)\n        indeg[v] += 1\n    q = deque([i for i in range(n) if indeg[i] == 0])\n    order = []\n    while q:\n        u = q.popleft()\n        order.append(u)\n        for v in graph[u]:\n            indeg[v] -= 1\n            if indeg[v] == 0:\n                q.append(v)\n    return order\n", "entry_point": "topological_sort", "input": "6, [(5, 2), (5, 0), (4, 0), (4, 1), (2, 3), (3, 1)]", "output": "[4, 5, 2, 0, 3, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p6g4p2z6fxe4sb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031417", "code": "\ndef dijkstra(n, edges, src):\n    import heapq\n    graph = [[] for _ in range(n)]\n    for u, v, w in edges:\n        graph[u].append((v, w))\n        graph[v].append((u, w))\n    dist = [float('inf')] * n\n    dist[src] = 0\n    pq = [(0, src)]\n    while pq:\n        d, u = heapq.heappop(pq)\n        if d > dist[u]:\n            continue\n        for v, w in graph[u]:\n            nd = d + w\n            if nd < dist[v]:\n                dist[v] = nd\n                heapq.heappush(pq, (nd, v))\n    return dist\n", "entry_point": "dijkstra", "input": "5, [(0, 1, 4), (0, 2, 1), (2, 1, 2), (1, 3, 1), (2, 3, 5), (3, 4, 3)], 0", "output": "[0, 3, 1, 4, 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p7g4p2s3op3ytr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031418", "code": "\ndef reservoir_sample_deterministic(stream, k, rand_sequence):\n    reservoir = stream[:k]\n    for i in range(k, len(stream)):\n        j = rand_sequence[i - k] % (i + 1)\n        if j < k:\n            reservoir[j] = stream[i]\n    return reservoir\n", "entry_point": "reservoir_sample_deterministic", "input": "[10, 20, 30, 40, 50, 60], 3, [0, 1, 2]", "output": "[40, 50, 60]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95rh02p8g4p2bocpvrmq", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031419", "code": "\ndef majority_element(nums):\n    count = 0\n    candidate = None\n    for n in nums:\n        if count == 0:\n            candidate = n\n        count += 1 if n == candidate else -1\n    return candidate\n", "entry_point": "majority_element", "input": "[2, 2, 1, 1, 1, 2, 2]", "output": "2", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02p9g4p253t1w1nv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031420", "code": "\ndef max_subarray_with_indices(nums):\n    best_sum = nums[0]\n    cur_sum = nums[0]\n    best_start = best_end = cur_start = 0\n    for i in range(1, len(nums)):\n        if cur_sum < 0:\n            cur_sum = nums[i]\n            cur_start = i\n        else:\n            cur_sum += nums[i]\n        if cur_sum > best_sum:\n            best_sum = cur_sum\n            best_start = cur_start\n            best_end = i\n    return (best_sum, best_start, best_end)\n", "entry_point": "max_subarray_with_indices", "input": "[-2, 1, -3, 4, -1, 2, 1, -5, 4]", "output": "(6, 3, 6)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pag4p2mbvq3fro", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031421", "code": "\ndef sieve_of_sundaram(limit):\n    if limit < 2:\n        return []\n    n = (limit - 1) // 2\n    marked = [False] * (n + 1)\n    for i in range(1, n + 1):\n        j = i\n        while i + j + 2 * i * j <= n:\n            marked[i + j + 2 * i * j] = True\n            j += 1\n    primes = [2] if limit >= 2 else []\n    for i in range(1, n + 1):\n        if not marked[i]:\n            primes.append(2 * i + 1)\n    return primes\n", "entry_point": "sieve_of_sundaram", "input": "30", "output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pbg4p2uffku3ir", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031422", "code": "\ndef extended_gcd(a, b):\n    if b == 0:\n        return (a, 1, 0)\n    g, x1, y1 = extended_gcd(b, a % b)\n    x = y1\n    y = x1 - (a // b) * y1\n    return (g, x, y)\n", "entry_point": "extended_gcd", "input": "240, 46", "output": "(2, -9, 47)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pcg4p2hq4d1qkx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031423", "code": "\ndef mod_pow(base, exp, mod):\n    result = 1\n    base = base % mod\n    while exp > 0:\n        if exp % 2 == 1:\n            result = (result * base) % mod\n        exp //= 2\n        base = (base * base) % mod\n    return result\n", "entry_point": "mod_pow", "input": "4, 13, 497", "output": "445", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pdg4p2y3lg3s2l", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031424", "code": "\ndef miller_rabin(n):\n    if n < 2:\n        return False\n    for p in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]:\n        if n % p == 0:\n            return n == p\n    d = n - 1\n    r = 0\n    while d % 2 == 0:\n        d //= 2\n        r += 1\n    for a in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]:\n        x = pow(a, d, n)\n        if x == 1 or x == n - 1:\n            continue\n        for _ in range(r - 1):\n            x = x * x % n\n            if x == n - 1:\n                break\n        else:\n            return False\n    return True\n", "entry_point": "miller_rabin", "input": "561", "output": "False", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02peg4p2ehj5dmd5", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031425", "code": "\ndef morse_encode(text):\n    MORSE = {\n        \"A\": \".-\", \"B\": \"-...\", \"C\": \"-.-.\", \"D\": \"-..\", \"E\": \".\",\n        \"F\": \"..-.\", \"G\": \"--.\", \"H\": \"....\", \"I\": \"..\", \"J\": \".---\",\n        \"K\": \"-.-\", \"L\": \".-..\", \"M\": \"--\", \"N\": \"-.\", \"O\": \"---\",\n        \"P\": \".--.\", \"Q\": \"--.-\", \"R\": \".-.\", \"S\": \"...\", \"T\": \"-\",\n        \"U\": \"..-\", \"V\": \"...-\", \"W\": \".--\", \"X\": \"-..-\", \"Y\": \"-.--\", \"Z\": \"--..\",\n        \" \": \"/\"\n    }\n    return \" \".join(MORSE[ch] for ch in text.upper())\n", "entry_point": "morse_encode", "input": "'SOS'", "output": "'... --- ...'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pfg4p2topd80c2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031426", "code": "\ndef bresenham_line(x0, y0, x1, y1):\n    points = []\n    dx = abs(x1 - x0)\n    dy = abs(y1 - y0)\n    sx = 1 if x0 < x1 else -1\n    sy = 1 if y0 < y1 else -1\n    err = dx - dy\n    while True:\n        points.append((x0, y0))\n        if x0 == x1 and y0 == y1:\n            break\n        e2 = 2 * err\n        if e2 > -dy:\n            err -= dy\n            x0 += sx\n        if e2 < dx:\n            err += dx\n            y0 += sy\n    return points\n", "entry_point": "bresenham_line", "input": "0, 0, 5, 3", "output": "[(0, 0), (1, 1), (2, 1), (3, 2), (4, 2), (5, 3)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pgg4p2mttzsxd9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031427", "code": "\nimport heapq\n\ndef huffman_code_lengths(freqs):\n    heap = [[f, i, [ch]] for i, (ch, f) in enumerate(freqs.items())]\n    heapq.heapify(heap)\n    lengths = {ch: 0 for ch in freqs}\n    counter = len(heap)\n    while len(heap) > 1:\n        f1, _, chars1 = heapq.heappop(heap)\n        f2, _, chars2 = heapq.heappop(heap)\n        for ch in chars1 + chars2:\n            lengths[ch] += 1\n        heapq.heappush(heap, [f1 + f2, counter, chars1 + chars2])\n        counter += 1\n    return dict(sorted(lengths.items()))\n", "entry_point": "huffman_code_lengths", "input": "{'a': 5, 'b': 9, 'c': 12, 'd': 13, 'e': 16, 'f': 45}", "output": "{'a': 4, 'b': 4, 'c': 3, 'd': 3, 'e': 3, 'f': 1}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02phg4p2m21hhxsp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031428", "code": "\ndef rabin_karp_search(text, pattern):\n    n, m = len(text), len(pattern)\n    if m > n:\n        return -1\n    base, mod = 256, 1000000007\n    h = pow(base, m - 1, mod)\n    p_hash = t_hash = 0\n    for i in range(m):\n        p_hash = (p_hash * base + ord(pattern[i])) % mod\n        t_hash = (t_hash * base + ord(text[i])) % mod\n    for i in range(n - m + 1):\n        if p_hash == t_hash and text[i:i+m] == pattern:\n            return i\n        if i < n - m:\n            t_hash = ((t_hash - ord(text[i]) * h) * base + ord(text[i + m])) % mod\n    return -1\n", "entry_point": "rabin_karp_search", "input": "'ABABDABACDABABCABAB', 'ABABCABAB'", "output": "10", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pig4p2bc7os007", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031429", "code": "\nimport datetime\n\ndef iso_week_date(year, month, day):\n    d = datetime.date(year, month, day)\n    iso_year, iso_week, iso_weekday = d.isocalendar()\n    return (iso_year, iso_week, iso_weekday)\n", "entry_point": "iso_week_date", "input": "2027, 1, 1", "output": "(2026, 53, 5)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvq95ri02pjg4p28mlbt92o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031430", "code": "\ndef kaprekar_steps(n):\n    steps = 0\n    seen = n\n    while seen != 6174 and steps < 100:\n        digits = f\"{seen:04d}\"\n        asc = int(\"\".join(sorted(digits)))\n        desc = int(\"\".join(sorted(digits, reverse=True)))\n        seen = desc - asc\n        steps += 1\n    return steps\n", "entry_point": "kaprekar_steps", "input": "3524", "output": "3", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvqtegb02scg4p2ga6e0cpi", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031431", "code": "def running_median(values):\n    import bisect\n    sorted_vals = []\n    medians = []\n    for v in values:\n        bisect.insort(sorted_vals, v)\n        n = len(sorted_vals)\n        if n % 2 == 1:\n            medians.append(sorted_vals[n // 2])\n        else:\n            medians.append((sorted_vals[n // 2 - 1] + sorted_vals[n // 2]) / 2)\n    return medians", "entry_point": "running_median", "input": "[5, 2, 8, 1, 9]", "output": "[5, 3.5, 5, 3.5, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0000uvp2ph62id6s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031432", "code": "def flatten_nested(items, depth=0):\n    result = []\n    for item in items:\n        if isinstance(item, list) and depth < 2:\n            result.extend(flatten_nested(item, depth + 1))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten_nested", "input": "[1, [2, 3, [4, [5, 6]]], 7]", "output": "[1, 2, 3, 4, [5, 6], 7]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0001uvp2iibbmckr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031433", "code": "class CircularBuffer:\n    def __init__(self, size):\n        self.size = size\n        self.buf = []\n    def push(self, val):\n        self.buf.append(val)\n        if len(self.buf) > self.size:\n            self.buf.pop(0)\n    def snapshot(self):\n        return list(self.buf)\n\ndef drive(vals, size):\n    cb = CircularBuffer(size)\n    snaps = []\n    for v in vals:\n        cb.push(v)\n        snaps.append(cb.snapshot())\n    return snaps", "entry_point": "drive", "input": "[1, 2, 3, 4, 5], 3", "output": "[[1], [1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5]]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0002uvp26r4dy0fl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031434", "code": "def safe_divide_chain(nums):\n    results = []\n    acc = nums[0]\n    for n in nums[1:]:\n        try:\n            acc = acc / n\n        except ZeroDivisionError:\n            results.append('div0')\n            acc = 0\n            continue\n        results.append(round(acc, 3))\n    return results", "entry_point": "safe_divide_chain", "input": "[100, 2, 0, 5, 0]", "output": "[50.0, 'div0', 0.0, 'div0']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0003uvp2ra8h9zw3", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031435", "code": "def word_frequency_rank(text):\n    from collections import Counter\n    words = text.lower().split()\n    counts = Counter(words)\n    ranked = sorted(counts.items(), key=lambda kv: (-kv[1], kv[0]))\n    return ranked[:3]", "entry_point": "word_frequency_rank", "input": "'the cat sat on the mat the cat ran'", "output": "[('the', 3), ('cat', 2), ('mat', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0004uvp2iice54pt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031436", "code": "def matrix_transpose_sum(matrix):\n    rows = len(matrix)\n    cols = len(matrix[0])\n    transposed = [[matrix[r][c] for r in range(rows)] for c in range(cols)]\n    row_sums = [sum(row) for row in transposed]\n    return transposed, row_sums", "entry_point": "matrix_transpose_sum", "input": "[[1, 2, 3], [4, 5, 6]]", "output": "([[1, 4], [2, 5], [3, 6]], [5, 7, 9])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0005uvp2bsdt7tiu", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031437", "code": "def retry_with_backoff(attempts, fail_until):\n    log = []\n    for i in range(1, attempts + 1):\n        if i < fail_until:\n            log.append(f'attempt {i}: failed')\n        else:\n            log.append(f'attempt {i}: success')\n            break\n    else:\n        log.append('exhausted')\n    return log", "entry_point": "retry_with_backoff", "input": "5, 3", "output": "['attempt 1: failed', 'attempt 2: failed', 'attempt 3: success']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0006uvp259dhxku9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031438", "code": "def dedupe_preserve_order(items):\n    seen = set()\n    out = []\n    for item in items:\n        key = item if isinstance(item, (int, str)) else tuple(item)\n        if key not in seen:\n            seen.add(key)\n            out.append(item)\n    return out", "entry_point": "dedupe_preserve_order", "input": "[1, 2, 2, 3, 1, 4, 3]", "output": "[1, 2, 3, 4]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0007uvp2zj525tkh", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031439", "code": "class Graph:\n    def __init__(self):\n        self.adj = {}\n    def add_edge(self, a, b):\n        self.adj.setdefault(a, []).append(b)\n        self.adj.setdefault(b, []).append(a)\n    def bfs(self, start):\n        visited = [start]\n        queue = [start]\n        while queue:\n            node = queue.pop(0)\n            for neighbor in sorted(self.adj.get(node, [])):\n                if neighbor not in visited:\n                    visited.append(neighbor)\n                    queue.append(neighbor)\n        return visited\n\ndef build_and_bfs(edges, start):\n    g = Graph()\n    for a, b in edges:\n        g.add_edge(a, b)\n    return g.bfs(start)", "entry_point": "build_and_bfs", "input": "[(1, 2), (1, 3), (2, 4), (3, 4), (4, 5)], 1", "output": "[1, 2, 3, 4, 5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0008uvp2t64v3orx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031440", "code": "def parse_csv_row_types(row):\n    result = []\n    for cell in row.split(','):\n        cell = cell.strip()\n        try:\n            result.append(int(cell))\n        except ValueError:\n            try:\n                result.append(float(cell))\n            except ValueError:\n                if cell.lower() in ('true', 'false'):\n                    result.append(cell.lower() == 'true')\n                else:\n                    result.append(cell)\n    return result", "entry_point": "parse_csv_row_types", "input": "'42, 3.14, true, hello, false'", "output": "[42, 3.14, True, 'hello', False]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z0009uvp2o0qoxh1y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031441", "code": "def merge_intervals(intervals):\n    intervals = sorted(intervals, key=lambda x: x[0])\n    merged = [intervals[0]]\n    for start, end in intervals[1:]:\n        last = merged[-1]\n        if start <= last[1]:\n            merged[-1] = (last[0], max(last[1], end))\n        else:\n            merged.append((start, end))\n    return merged", "entry_point": "merge_intervals", "input": "[(1, 3), (2, 6), (8, 10), (15, 18), (9, 12)]", "output": "[(1, 6), (8, 12), (15, 18)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000buvp2dxwtcafd", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031442", "code": "def exception_chain(vals):\n    out = []\n    for v in vals:\n        try:\n            if v < 0:\n                raise ValueError('negative')\n            if v == 0:\n                raise ZeroDivisionError('zero')\n            out.append(100 / v)\n        except (ValueError, ZeroDivisionError) as e:\n            out.append(str(e))\n        finally:\n            out.append('checked')\n    return out", "entry_point": "exception_chain", "input": "[5, -1, 0, 4]", "output": "[20.0, 'checked', 'negative', 'checked', 'zero', 'checked', 25.0, 'checked']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000cuvp2vwvnlsez", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031443", "code": "def state_machine(events):\n    state = 'idle'\n    transitions = {\n        ('idle', 'start'): 'running',\n        ('running', 'pause'): 'paused',\n        ('paused', 'resume'): 'running',\n        ('running', 'stop'): 'idle',\n        ('paused', 'stop'): 'idle',\n    }\n    history = [state]\n    for e in events:\n        state = transitions.get((state, e), state)\n        history.append(state)\n    return history", "entry_point": "state_machine", "input": "['start', 'pause', 'resume', 'stop', 'start']", "output": "['idle', 'running', 'paused', 'running', 'idle', 'running']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000duvp27buqyehf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031444", "code": "def lru_cache_sim(capacity, ops):\n    from collections import OrderedDict\n    cache = OrderedDict()\n    results = []\n    for op in ops:\n        if op[0] == 'put':\n            k, v = op[1], op[2]\n            if k in cache:\n                cache.move_to_end(k)\n            cache[k] = v\n            if len(cache) > capacity:\n                cache.popitem(last=False)\n            results.append(None)\n        else:\n            k = op[1]\n            if k in cache:\n                cache.move_to_end(k)\n                results.append(cache[k])\n            else:\n                results.append(-1)\n    return results", "entry_point": "lru_cache_sim", "input": "2, [('put', 1, 1), ('put', 2, 2), ('get', 1), ('put', 3, 3), ('get', 2), ('get', 3)]", "output": "[None, None, 1, None, -1, 3]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000fuvp2gd1yzt3n", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031445", "code": "def bit_manipulation_stats(n):\n    binary = bin(n)[2:]\n    ones = binary.count('1')\n    zeros = binary.count('0')\n    reversed_val = int(binary[::-1], 2)\n    return {'binary': binary, 'ones': ones, 'zeros': zeros, 'reversed': reversed_val}", "entry_point": "bit_manipulation_stats", "input": "43", "output": "{'binary': '101011', 'ones': 4, 'zeros': 2, 'reversed': 53}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000guvp224esun4x", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031446", "code": "def recursive_fib_memo(n, memo=None):\n    if memo is None:\n        memo = {}\n    if n in memo:\n        return memo[n]\n    if n <= 1:\n        return n\n    memo[n] = recursive_fib_memo(n-1, memo) + recursive_fib_memo(n-2, memo)\n    return memo[n]\n\ndef fib_sequence(n):\n    return [recursive_fib_memo(i) for i in range(n)]", "entry_point": "fib_sequence", "input": "12", "output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000huvp289ttatv2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031447", "code": "def validate_and_normalize_paths(paths):\n    import posixpath\n    normalized = []\n    for p in paths:\n        try:\n            norm = posixpath.normpath(p)\n            if norm.startswith('..'):\n                raise ValueError('escapes root')\n            normalized.append(norm)\n        except ValueError as e:\n            normalized.append(f'invalid: {e}')\n    return normalized", "entry_point": "validate_and_normalize_paths", "input": "['/a/b/../c', '../etc/passwd', './x/./y/', 'a//b///c']", "output": "['/a/c', 'invalid: escapes root', 'x/y', 'a/b/c']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000iuvp2w0l3s15j", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031448", "code": "def custom_sort_with_key_errors(records):\n    def key_fn(r):\n        try:\n            return (-r['priority'], r['name'])\n        except KeyError:\n            return (0, '')\n    valid = [r for r in records if 'priority' in r and 'name' in r]\n    return sorted(valid, key=key_fn)", "entry_point": "custom_sort_with_key_errors", "input": "[{'name': 'b', 'priority': 2}, {'name': 'a', 'priority': 2}, {'name': 'c'}, {'name': 'd', 'priority': 5}]", "output": "[{'name': 'd', 'priority': 5}, {'name': 'a', 'priority': 2}, {'name': 'b', 'priority': 2}]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsvte58z000juvp2dcqkmrgw", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031449", "code": "class LazyTag:\n    def __init__(self, label):\n        self.label = label\n\n    def __get__(self, obj, owner=None):\n        if obj is None:\n            return \"class-access\"\n        return (\"nondata\", self.label)\n\n\nclass Doubling:\n    def __set_name__(self, owner, name):\n        self.slot = name\n\n    def __get__(self, obj, owner=None):\n        if obj is None:\n            return \"class-access\"\n        return (\"data\", obj.__dict__.get(self.slot, \"unset\"))\n\n    def __set__(self, obj, value):\n        obj.__dict__[self.slot] = value * 2\n\n\nclass Node:\n    lazy = LazyTag(\"lazy\")\n    weight = Doubling()\n\n\ndef descriptor_probe():\n    n = Node()\n    first = n.lazy\n    n.__dict__[\"lazy\"] = \"shadow\"\n    second = n.lazy\n    third = n.weight\n    n.weight = 5\n    fourth = n.weight\n    fifth = n.__dict__[\"weight\"]\n    n.__dict__[\"weight\"] = 99\n    sixth = n.weight\n    return (first, second, third, fourth, fifth, sixth, sorted(n.__dict__))", "entry_point": "descriptor_probe", "input": "", "output": "(('nondata', 'lazy'), 'shadow', ('data', 'unset'), ('data', 10), 10, ('data', 99), ['lazy', 'weight'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003huvp2g020j92y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031450", "code": "EVENTS = []\n\n\nclass Marker:\n    def __set_name__(self, owner, name):\n        EVENTS.append((\"set_name\", owner.__name__, name))\n\n\nclass Base:\n    def __init_subclass__(cls, tag=\"none\", **kwargs):\n        super().__init_subclass__(**kwargs)\n        EVENTS.append((\"init_subclass\", cls.__name__, tag))\n        cls.tag = tag\n\n\nclass Child(Base, tag=\"alpha\"):\n    a = Marker()\n    b = Marker()\n\n\nclass Grand(Child):\n    c = Marker()\n\n\ndef class_creation_events():\n    return (\n        list(EVENTS),\n        Child.tag,\n        Grand.tag,\n        \"tag\" in Grand.__dict__,\n        \"tag\" in Base.__dict__,\n    )", "entry_point": "class_creation_events", "input": "", "output": "([('set_name', 'Child', 'a'), ('set_name', 'Child', 'b'), ('init_subclass', 'Child', 'alpha'), ('set_name', 'Grand', 'c'), ('init_subclass', 'Grand', 'none')], 'alpha', 'none', True, False)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003iuvp2xlo3s736", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031451", "code": "def inner():\n    try:\n        received = yield \"a\"\n        yield (\"echo\", received)\n    except ValueError as exc:\n        yield (\"caught\", exc.args[0])\n    return \"fin\"\n\n\ndef outer(log):\n    delivered = yield from inner()\n    log.append(delivered)\n    yield \"tail\"\n\n\ndef delegate_run():\n    log = []\n    gen = outer(log)\n    s1 = next(gen)\n    s2 = gen.send(7)\n    s3 = gen.throw(ValueError(\"bad\"))\n    s4 = next(gen)\n\n    other = []\n    gen2 = outer(other)\n    next(gen2)\n    gen2.close()\n    try:\n        next(gen2)\n        after = \"ran\"\n    except StopIteration:\n        after = \"stopped\"\n    return (s1, s2, s3, s4, log, other, after)", "entry_point": "delegate_run", "input": "", "output": "('a', ('echo', 7), ('caught', 'bad'), 'tail', ['fin'], [], 'stopped')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003juvp2rmjt85pf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031452", "code": "class Fallback(dict):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.misses = []\n\n    def __missing__(self, key):\n        self.misses.append(key)\n        value = \"gen-\" + key\n        self[key] = value\n        return value\n\n\ndef missing_run():\n    d = Fallback(a=\"A\")\n    r1 = d[\"a\"]\n    r2 = d[\"b\"]\n    r3 = d.get(\"c\", \"default\")\n    r4 = \"c\" in d\n    r5 = d.setdefault(\"d\", \"D\")\n    r6 = d.pop(\"zz\", \"nope\")\n    return (r1, r2, r3, r4, r5, r6, d.misses, sorted(d.items()))", "entry_point": "missing_run", "input": "", "output": "('A', 'gen-b', 'default', False, 'D', 'nope', ['b'], [('a', 'A'), ('b', 'gen-b'), ('d', 'D')])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003kuvp2ncb5d6qj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031453", "code": "class Temp:\n    def __init__(self, celsius):\n        self.celsius = celsius\n\n    def __format__(self, spec):\n        if spec.endswith(\"F\"):\n            return format(self.celsius * 9 / 5 + 32, spec[:-1]) + \"F\"\n        if not spec:\n            return \"T(\" + str(self.celsius) + \")\"\n        return format(self.celsius, spec)\n\n    def __repr__(self):\n        return \"Temp(%r)\" % (self.celsius,)\n\n    def __str__(self):\n        return \"temp:\" + str(self.celsius)\n\n\ndef format_run():\n    t = Temp(21.5)\n    return (\n        format(t),\n        format(t, \".1fF\"),\n        \"{:>10.2f}|\".format(t),\n        \"{0!r} {0!s} {0}\".format(t),\n        \"{:*^12.3f}\".format(t),\n        \"{:{w}.{p}f}\".format(t, w=9, p=3),\n        f\"{t:.0fF}\",\n        \"%s|%r\" % (t, t),\n    )", "entry_point": "format_run", "input": "", "output": "('T(21.5)', '70.7F', '     21.50|', 'Temp(21.5) temp:21.5 T(21.5)', '***21.500***', '   21.500', '71F', 'temp:21.5|Temp(21.5)')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003luvp2esnnw0rg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031454", "code": "from collections import ChainMap\n\n\ndef layered_config():\n    defaults = {\"color\": \"red\", \"size\": \"M\", \"qty\": 1}\n    session = {\"size\": \"L\"}\n    cm = ChainMap(session, defaults)\n    a = (cm[\"size\"], cm[\"color\"], len(cm))\n    cm[\"color\"] = \"blue\"\n    b = (defaults[\"color\"], sorted(session.items()))\n    del cm[\"color\"]\n    c = (cm[\"color\"], \"color\" in session)\n    child = cm.new_child({\"qty\": 9})\n    d = (child[\"qty\"], len(child.maps), len(cm.maps))\n    e = list(child.parents.maps) == list(cm.maps)\n    session[\"qty\"] = 5\n    f = (cm[\"qty\"], child[\"qty\"], sorted(cm.keys()))\n    g = dict(ChainMap({\"a\": 1}, {\"a\": 2, \"b\": 3}))\n    return (a, b, c, d, e, f, g)", "entry_point": "layered_config", "input": "", "output": "(('L', 'red', 3), ('red', [('color', 'blue'), ('size', 'L')]), ('red', False), (9, 3, 2), True, (5, 9, ['color', 'qty', 'size']), {'a': 1, 'b': 3})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003muvp2bkj6f8gf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031455", "code": "from collections import deque\n\n\ndef ring_buffer_run():\n    d = deque([1, 2, 3], maxlen=4)\n    d.append(4)\n    d.append(5)\n    a = list(d)\n    d.appendleft(0)\n    b = list(d)\n    d.rotate(-1)\n    c = list(d)\n\n    e = deque(maxlen=3)\n    e.extendleft([1, 2, 3, 4])\n    f = list(e)\n\n    g = deque(\"abc\")\n    g.rotate(2)\n    h = \"\".join(g)\n\n    return (\n        a,\n        b,\n        c,\n        f,\n        h,\n        deque([1, 2, 3]).maxlen,\n        list(deque([1, 2, 3, 4, 5], maxlen=2)),\n        deque([1, 2, 3]) == deque([1, 2, 3]),\n        list(deque([1, 2, 3]) + deque([4])),\n        d.count(3),\n        list(reversed(d)),\n    )", "entry_point": "ring_buffer_run", "input": "", "output": "([2, 3, 4, 5], [0, 2, 3, 4], [2, 3, 4, 0], [4, 3, 2], 'bca', None, [4, 5], True, [1, 2, 3, 4], 1, [0, 4, 3, 2])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003nuvp2c8tfi5xl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031456", "code": "def buffer_share():\n    buf = bytearray(b\"abcdef\")\n    mv = memoryview(buf)\n    a = (mv[0], bytes(mv[1:3]), mv.nbytes, mv.readonly)\n    mv[2:4] = b\"ZZ\"\n    b = bytes(buf)\n\n    rows = memoryview(bytes(range(6))).cast(\"B\", shape=(2, 3))\n    c = (rows.shape, rows.ndim, rows.tolist(), rows.tolist()[1][2])\n\n    ro = memoryview(b\"xyz\")\n    try:\n        ro[0] = 65\n        d = \"mutated\"\n    except TypeError:\n        d = \"TypeError\"\n\n    e = memoryview(b\"abc\") == b\"abc\"\n\n    stride = mv[::2]\n    f = (stride.tolist(), stride.contiguous)\n\n    try:\n        buf.append(7)\n        g = \"resized\"\n    except BufferError:\n        g = \"BufferError\"\n\n    stride.release()\n    mv.release()\n    buf.append(7)\n    return (a, b, c, d, e, f, g, bytes(buf))", "entry_point": "buffer_share", "input": "", "output": "((97, b'bc', 6, False), b'abZZef', ((2, 3), 2, [[0, 1, 2], [3, 4, 5]], 5), 'TypeError', True, ([97, 90, 101], False), 'BufferError', b'abZZef\\x07')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003ouvp2jib841qb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031457", "code": "class Point:\n    __match_args__ = (\"x\", \"y\")\n\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\n\ndef classify(value):\n    match value:\n        case Point(0, 0):\n            return \"origin\"\n        case Point(x, 0) | Point(0, x):\n            return (\"axis\", x)\n        case Point(x=a, y=b) if a == b:\n            return (\"diagonal\", a)\n        case str() as s:\n            return (\"string\", len(s))\n        case [1, *rest]:\n            return (\"starts-one\", rest)\n        case {\"k\": v, **extra}:\n            return (\"mapping\", v, sorted(extra))\n        case (int() | float()) as n if n < 0:\n            return (\"negative\", n)\n        case _:\n            return \"other\"\n\n\ndef classify_all():\n    samples = [\n        Point(0, 0),\n        Point(3, 0),\n        Point(0, 4),\n        Point(2, 2),\n        \"abc\",\n        [1, 2, 3],\n        (1, 9),\n        {\"k\": 5, \"z\": 6},\n        -2.5,\n        7,\n        b\"\\x01\\x02\",\n    ]\n    return tuple(classify(v) for v in samples)", "entry_point": "classify_all", "input": "", "output": "('origin', ('axis', 3), ('axis', 4), ('diagonal', 2), ('string', 3), ('starts-one', [2, 3]), ('starts-one', [9]), ('mapping', 5, ['z']), ('negative', -2.5), 'other', 'other')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003puvp2tbwd45mb", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031458", "code": "def make_lambdas(values):\n    plain = [lambda: v for v in values]\n    bound = [lambda v=v: v for v in values]\n    return plain, bound\n\n\ndef binding_run():\n    plain, bound = make_lambdas([1, 2, 3])\n    a = [f() for f in plain]\n    b = [f() for f in bound]\n\n    data = [1, 2, 3]\n    gen = (x * 10 for x in data)\n    data = [4, 5]\n    c = list(gen)\n\n    src = [1, 2, 3]\n    gen2 = (x * 10 for x in src)\n    src.append(4)\n    d = list(gen2)\n\n    factor = 2\n    gen3 = (x * factor for x in [1, 2])\n    factor = 100\n    e = list(gen3)\n\n    n = 0\n    lst = [n for n in range(3)]\n    f = (lst, n)\n\n    total = 0\n    for total in range(3):\n        pass\n    return (a, b, c, d, e, f, total)", "entry_point": "binding_run", "input": "", "output": "([3, 3, 3], [1, 2, 3], [10, 20, 30], [10, 20, 30, 40], [100, 200], ([0, 1, 2], 0), 2)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003quvp2bh55cis9", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031459", "code": "def case_map_run():\n    s = \"stra\u00dfe\"\n    a = (s.upper(), len(s), len(s.upper()))\n    b = (\"\u00df\".casefold(), \"\u00df\".upper().casefold(),\n         \"\u00df\".casefold() == \"SS\".casefold())\n    c = (\"\u0130\".lower(), len(\"\u0130\".lower()))\n    d = (\"\u01c5\".title(), \"\u01c5\".upper(), \"\u01c5\".lower(), \"\u01c5\".capitalize())\n    e = \"o'neill mcdonald\".title()\n    f = (\"\ufb01\".upper(), len(\"\ufb01\".upper()), \"\ufb01\".capitalize())\n    g = (\"\u01c4\".istitle(), \"\u01c5\".istitle(), \"\u01c6\".istitle())\n    h = \"\u00df\".capitalize()\n    return (a, b, c, d, e, f, g, h)", "entry_point": "case_map_run", "input": "", "output": "(('STRASSE', 6, 7), ('ss', 'ss', True), ('i\u0307', 2), ('\u01c5', '\u01c4', '\u01c6', '\u01c5'), \"O'Neill Mcdonald\", ('FI', 2, 'Fi'), (True, True, False), 'Ss')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003ruvp2gigql761", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031460", "code": "import unicodedata\n\n\ndef normalize_run():\n    nfc = chr(0x00E9)\n    nfd = \"e\" + chr(0x0301)\n    a = (len(nfc), len(nfd), nfc == nfd,\n         unicodedata.normalize(\"NFC\", nfd) == nfc)\n    b = (unicodedata.name(nfd[1]), unicodedata.combining(nfd[1]))\n    c = ([hex(ord(ch)) for ch in unicodedata.normalize(\"NFKC\", chr(0xFB01))],\n         [hex(ord(ch)) for ch in unicodedata.normalize(\"NFC\", chr(0xFB01))])\n    d = ([hex(ord(ch)) for ch in unicodedata.normalize(\"NFKC\", chr(0x00BD))],\n         len(unicodedata.normalize(\"NFC\", chr(0x00BD))))\n    e = (chr(0x2460).isdigit(), chr(0x2460).isnumeric(),\n         unicodedata.decimal(chr(0x0663)), unicodedata.numeric(chr(0x00BD)))\n    ordered = sorted({nfc, nfd, unicodedata.normalize(\"NFC\", nfd)})\n    f = [[hex(ord(ch)) for ch in item] for item in ordered]\n    g = (chr(0x00C5) == chr(0x212B),\n         unicodedata.normalize(\"NFC\", chr(0x212B)) == chr(0x00C5),\n         unicodedata.normalize(\"NFD\", chr(0x00C5)) == \"A\" + chr(0x030A))\n    return (a, b, c, d, e, f, g)", "entry_point": "normalize_run", "input": "", "output": "((1, 2, False, True), ('COMBINING ACUTE ACCENT', 230), (['0x66', '0x69'], ['0xfb01']), (['0x31', '0x2044', '0x32'], 1), (True, True, 3, 0.5), [['0x65', '0x301'], ['0xe9']], (False, True, True))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003suvp2cfhsp54b", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031461", "code": "def view_algebra():\n    d = {\"a\": 1, \"b\": 2, \"c\": 3}\n    keys = d.keys()\n    items = d.items()\n    values = d.values()\n\n    a = (sorted(keys & {\"b\", \"c\", \"z\"}), sorted(keys - {\"a\"}),\n         sorted(keys ^ {\"a\", \"z\"}))\n    d[\"e\"] = 5\n    b = (sorted(keys), len(items))\n    c = sorted(items & {(\"a\", 1), (\"b\", 99)})\n    e = ({\"a\": 1}.keys() == {\"a\"}, {\"a\": 1}.values() == {\"a\": 1}.values())\n    f = list(reversed(list(d)))\n    g = (\"a\", 1) in items\n\n    other = {\"x\": [1]}\n    try:\n        other.items() & {(\"x\", [1])}\n        h = \"ok\"\n    except TypeError:\n        h = \"TypeError\"\n\n    i = list(zip(d.keys(), d.values())) == list(d.items())\n    j = sorted(values)\n    try:\n        values & {1}\n        k = \"ok\"\n    except TypeError:\n        k = \"TypeError\"\n    return (a, b, c, e, f, g, h, i, j, k)", "entry_point": "view_algebra", "input": "", "output": "((['b', 'c'], ['b', 'c'], ['b', 'c', 'z']), (['a', 'b', 'c', 'e'], 4), [('a', 1)], (True, False), ['e', 'c', 'b', 'a'], True, 'TypeError', True, [1, 2, 3, 5], 'TypeError')", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003tuvp2rcaieoy1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031462", "code": "import itertools\n\n\ndef stream_consume():\n    src = iter(range(10))\n    a = list(itertools.islice(src, 3))\n    b = next(src)\n    c = list(itertools.islice(src, 0, 4, 2))\n    d = next(src)\n\n    x, y = itertools.tee(iter(\"abcd\"))\n    e = (next(x), next(x), \"\".join(y), \"\".join(x))\n\n    counter = itertools.count(5, -2)\n    f = list(itertools.takewhile(lambda n: n > 0, counter))\n    g = next(counter)\n\n    fresh = [(k, list(v)) for k, v in itertools.groupby(\"aabbba\")]\n    stale = [(k, v) for k, v in itertools.groupby(\"aabbba\")]\n    h = [(k, list(v)) for k, v in stale]\n    return (a, b, c, d, e, f, g, fresh, h)", "entry_point": "stream_consume", "input": "", "output": "([0, 1, 2], 3, [4, 6], 8, ('a', 'b', 'abcd', 'cd'), [5, 3, 1], -3, [('a', ['a', 'a']), ('b', ['b', 'b', 'b']), ('a', ['a'])], [('a', []), ('b', []), ('a', [])])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003vuvp27kijhswy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031463", "code": "import functools\nfrom collections import OrderedDict\n\n\n@functools.singledispatch\ndef describe(value):\n    return (\"generic\", type(value).__name__)\n\n\n@describe.register\ndef _(value: int):\n    return (\"int\", value)\n\n\n@describe.register(bool)\ndef _(value):\n    return (\"bool\", value)\n\n\n@describe.register(list)\ndef _(value):\n    return (\"list\", len(value))\n\n\n@describe.register(dict)\ndef _(value):\n    return (\"dict\", sorted(value))\n\n\n@functools.singledispatch\ndef kind(value):\n    return \"generic\"\n\n\n@kind.register(int)\ndef _(value):\n    return \"int\"\n\n\nclass MyList(list):\n    pass\n\n\ndef dispatch_run():\n    return (\n        describe(3),\n        describe(True),\n        describe(MyList([1, 2])),\n        describe(OrderedDict(a=1)),\n        describe(3.5),\n        sorted(t.__name__ for t in describe.registry),\n        (kind(True), kind(2), kind(2.0)),\n    )", "entry_point": "dispatch_run", "input": "", "output": "(('int', 3), ('bool', True), ('list', 2), ('dict', ['a']), ('generic', 'float'), ['bool', 'dict', 'int', 'list', 'object'], ('int', 'int', 'generic'))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003xuvp20mkxm78q", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031464", "code": "def sentinel_iter():\n    seq = [3, 1, 4, 1, 5, 9]\n    it = iter(seq)\n    a = list(iter(lambda: next(it, None), None))\n\n    counter = {\"n\": 0}\n\n    def tick():\n        counter[\"n\"] += 1\n        return counter[\"n\"] * counter[\"n\"]\n\n    b = list(iter(tick, 16))\n    c = counter[\"n\"]\n    d = next(iter([]), \"empty\")\n\n    chunks = iter([b\"ab\", b\"cd\", b\"\"])\n    e = list(iter(lambda: next(chunks), b\"\"))\n\n    words = iter([\"x\", \"y\", \"stop\", \"z\"])\n    f = list(iter(lambda: next(words), \"stop\"))\n    g = next(words)\n\n    it2 = iter(\"ab\")\n    h = (next(it2), next(it2), next(it2, \"done\"), iter(it2) is it2)\n    return (a, b, c, d, e, f, g, h)", "entry_point": "sentinel_iter", "input": "", "output": "([3, 1, 4, 1, 5, 9], [1, 4, 9], 4, 'empty', [b'ab', b'cd'], ['x', 'y'], 'z', ('a', 'b', 'done', True))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003yuvp2v8et66so", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031465", "code": "def zip_drain():\n    it = iter(range(7))\n    a = list(zip(it, it, it))\n    b = list(it)\n\n    it2 = iter(\"abcdef\")\n    pairs = list(zip(it2, it2))\n    c = (pairs, list(it2))\n\n    short = iter([1, 2, 3])\n    other = iter([\"a\", \"b\"])\n    d = list(zip(short, other))\n    e = list(short)\n\n    try:\n        list(zip([1, 2, 3], [\"a\"], strict=True))\n        f = \"ok\"\n    except ValueError:\n        f = \"ValueError\"\n\n    return (a, b, c, d, e, f, list(zip(*[])), list(zip()),\n            list(zip([1, 2], [3, 4], [5])))", "entry_point": "zip_drain", "input": "", "output": "([(0, 1, 2), (3, 4, 5)], [], ([('a', 'b'), ('c', 'd'), ('e', 'f')], []), [(1, 'a'), (2, 'b')], [], 'ValueError', [], [], [(1, 3, 5)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs96003zuvp2a3f9tpfv", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031466", "code": "import copy\n\n\ndef cyclic_repr():\n    a = [1, 2]\n    a.append(a)\n    r1 = repr(a)\n\n    d = {\"k\": 1}\n    d[\"self\"] = d\n    r2 = repr(d)\n\n    r3 = (a[2] is a, len(a))\n\n    c = copy.deepcopy(a)\n    r4 = (c is not a, c[2] is c, repr(c))\n\n    t = ([1],)\n    t[0].append(t)\n    r5 = repr(t)\n\n    s = [1]\n    s.append([s])\n    r6 = repr(s)\n\n    nested = []\n    nested.append([nested])\n    r7 = repr(nested)\n\n    shallow = copy.copy(a)\n    r8 = (shallow[2] is a, repr(shallow))\n    return (r1, r2, r3, r4, r5, r6, r7, r8)", "entry_point": "cyclic_repr", "input": "", "output": "('[1, 2, [...]]', \"{'k': 1, 'self': {...}}\", (True, 3), (True, True, '[1, 2, [...]]'), '([1, (...)],)', '[1, [[...]]]', '[[[...]]]', (True, '[1, 2, [1, 2, [...]]]'))", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsw2qs960040uvp25ryyx656", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031467", "code": "from itertools import groupby\ndef group_lengths(words):\n    words = sorted(words, key=len)\n    return {length: list(group) for length, group in groupby(words, key=len)}", "entry_point": "group_lengths", "input": "['a', 'bb', 'cc', 'ddd', 'e', 'ff']", "output": "{1: ['a', 'e'], 2: ['bb', 'cc', 'ff'], 3: ['ddd']}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrsvaa007kuvp2tkyqv3nl", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031468", "code": "from itertools import permutations\ndef unique_arrangements(s):\n    return sorted(set(''.join(p) for p in permutations(s)))", "entry_point": "unique_arrangements", "input": "'aab'", "output": "['aab', 'aba', 'baa']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrta8f007luvp2eco0fl0y", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031469", "code": "import operator\ndef apply_ops(a, b, ops):\n    table = {'+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv}\n    return [table[op](a, b) for op in ops]", "entry_point": "apply_ops", "input": "10, 4, ['+', '-', '*', '/']", "output": "[14, 6, 40, 2.5]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrta8f007nuvp2c4j3sdeg", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031470", "code": "import textwrap\ndef wrap_and_count(text, width):\n    lines = textwrap.wrap(text, width=width)\n    return (len(lines), lines)", "entry_point": "wrap_and_count", "input": "'the quick brown fox jumps over the lazy dog', 12", "output": "(4, ['the quick', 'brown fox', 'jumps over', 'the lazy dog'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtj5p007ruvp21yxefhfo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031471", "code": "from decimal import Decimal, ROUND_HALF_UP\ndef price_with_tax(price_str, rate_str):\n    price = Decimal(price_str)\n    rate = Decimal(rate_str)\n    total = price * (1 + rate)\n    return str(total.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP))", "entry_point": "price_with_tax", "input": "'19.99', '0.0825'", "output": "'21.64'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtj5p007suvp2jk990d3h", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031472", "code": "class Resource:\n    def __init__(self, name):\n        self.name = name\n        self.log = []\n\n    def __enter__(self):\n        self.log.append(f\"open {self.name}\")\n        return self\n\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        self.log.append(f\"close {self.name}\")\n        return True\n\ndef use_resource():\n    r = Resource(\"db\")\n    with r:\n        r.log.append(\"working\")\n        raise ValueError(\"boom\")\n    return r.log", "entry_point": "use_resource", "input": "", "output": "['open db', 'working', 'close db']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtj5p007uuvp2dwtmyclc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031473", "code": "class Circle:\n    def __init__(self, radius):\n        self._radius = radius\n\n    @property\n    def radius(self):\n        return self._radius\n\n    @radius.setter\n    def radius(self, value):\n        if value < 0:\n            raise ValueError(\"radius must be non-negative\")\n        self._radius = value\n\n    @property\n    def area(self):\n        return round(3.14159 * self._radius ** 2, 2)\n\ndef resize_and_area(r, new_radius):\n    c = Circle(r)\n    c.radius = new_radius\n    return c.area", "entry_point": "resize_and_area", "input": "5, 3", "output": "28.27", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtqid007vuvp2rj1h11os", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031474", "code": "class A:\n    def greet(self):\n        return \"A\"\n\nclass B(A):\n    def greet(self):\n        return \"B->\" + super().greet()\n\nclass C(A):\n    def greet(self):\n        return \"C->\" + super().greet()\n\nclass D(B, C):\n    def greet(self):\n        return \"D->\" + super().greet()\n\ndef mro_greeting():\n    return D().greet()", "entry_point": "mro_greeting", "input": "", "output": "'D->B->C->A'", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtqie007wuvp2lr0dkgcx", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031475", "code": "from itertools import filterfalse\n\ndef partition_by_predicate(nums, pred):\n    matches = list(filter(pred, nums))\n    non_matches = list(filterfalse(pred, nums))\n    return (matches, non_matches)", "entry_point": "partition_by_predicate", "input": "[1, 2, 3, 4, 5, 6, 7, 8], lambda n: n % 3 == 0", "output": "([3, 6], [1, 2, 4, 5, 7, 8])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtqie007xuvp2eyji5guc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031476", "code": "def first_and_rest(items):\n    first, *rest = items\n    *init, last = rest\n    return (first, init, last)", "entry_point": "first_and_rest", "input": "[10, 20, 30, 40, 50]", "output": "(10, [20, 30, 40], 50)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtqie007yuvp24oj7ep6a", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031477", "code": "def make_multipliers():\n    return [lambda x, i=i: x * i for i in range(4)]\n\ndef apply_all(x):\n    fns = make_multipliers()\n    return [f(x) for f in fns]", "entry_point": "apply_all", "input": "3", "output": "[0, 3, 6, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtqie007zuvp2390lz77p", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031478", "code": "from functools import lru_cache\n\n@lru_cache(maxsize=None)\ndef digit_sum(n):\n    if n < 10:\n        return n\n    return n % 10 + digit_sum(n // 10)\n\n@lru_cache(maxsize=None)\ndef repeated_digit_sum(n):\n    while n >= 10:\n        n = digit_sum(n)\n    return n", "entry_point": "repeated_digit_sum", "input": "9875", "output": "2", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswrtvsk0081uvp27q6b7rnj", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031479", "code": "def all_ascending(nums):\n    return all(a < b for a, b in zip(nums, nums[1:]))\n\ndef any_negative(nums):\n    return any(n < 0 for n in nums)\n\ndef check_list(nums):\n    return (all_ascending(nums), any_negative(nums))", "entry_point": "check_list", "input": "[1, 3, 5, 4, -2]", "output": "(False, True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswru6ev0084uvp2f34u6age", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031480", "code": "import random\ndef deterministic_shuffle(items, seed):\n    rng = random.Random(seed)\n    items = list(items)\n    rng.shuffle(items)\n    return items", "entry_point": "deterministic_shuffle", "input": "[1, 2, 3, 4, 5], 42", "output": "[4, 2, 3, 5, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswruw3r0086uvp2xxkurg56", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031481", "code": "def accumulate(pairs, store={}):\n    for key, value in pairs:\n        store.setdefault(key, []).append(value)\n    return dict(store)", "entry_point": "accumulate", "input": "[('a', 1), ('b', 2)]", "output": "{'a': [1, 1], 'b': [2, 2]}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswzw85l00ctuvp2jwiq4hvp", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031482", "code": "def normalize_ports(tokens):\n    ports = []\n    for token in tokens:\n        try:\n            ports.append(int(token))\n        except ValueError:\n            ports.append(-1)\n        else:\n            if ports[-1] > 1024:\n                ports[-1] = 1024\n        finally:\n            if ports[-1] == 0:\n                ports.pop()\n    return ports", "entry_point": "normalize_ports", "input": "['80', 'http', '65535', '0', '1024']", "output": "[80, -1, 1024, 1024]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswzw85l00cuuvp2deb6mh6t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031483", "code": "from itertools import groupby\n\ndef collapse_runs(records):\n    summary = []\n    for level, group in groupby(records, key=lambda record: record['level']):\n        summary.append((level, sum(1 for _ in group)))\n    return summary", "entry_point": "collapse_runs", "input": "[{'level': 'INFO'}, {'level': 'INFO'}, {'level': 'WARN'}, {'level': 'INFO'}]", "output": "[('INFO', 2), ('WARN', 1), ('INFO', 1)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswzw85l00cvuvp2t7q436b8", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031484", "code": "from datetime import datetime, timedelta\n\ndef window_labels(start, count, minutes):\n    base = datetime.strptime(start, '%Y-%m-%d %H:%M')\n    return [(base + timedelta(minutes=minutes * step)).strftime('%d/%H:%M') for step in range(count)]", "entry_point": "window_labels", "input": "'2026-02-28 23:20', 4, 25", "output": "['28/23:20', '28/23:45', '01/00:10', '01/00:35']", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswzw85l00cwuvp2o78uxhev", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031485", "code": "def competition_ranks(scores):\n    ordered = sorted(scores.items(), key=lambda pair: (-pair[1], pair[0]))\n    ranks = {}\n    previous_score = None\n    current_rank = 0\n    for position, (name, score) in enumerate(ordered, start=1):\n        if score != previous_score:\n            current_rank = position\n            previous_score = score\n        ranks[name] = current_rank\n    return ranks", "entry_point": "competition_ranks", "input": "{'ana': 90, 'bo': 95, 'cy': 90, 'di': 80}", "output": "{'bo': 1, 'ana': 2, 'cy': 2, 'di': 4}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmswzw85l00cxuvp2gfqke4xn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031486", "code": "class SkipMultiples:\n    def __init__(self, limit, n):\n        self.limit = limit\n        self.n = n\n        self.current = 0\n    def __iter__(self):\n        return self\n    def __next__(self):\n        while self.current < self.limit:\n            self.current += 1\n            if self.current % self.n != 0:\n                return self.current\n        raise StopIteration\n\ndef collect(limit, n):\n    return list(SkipMultiples(limit, n))", "entry_point": "collect", "input": "15, 3", "output": "[1, 2, 4, 5, 7, 8, 10, 11, 13, 14]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx35cwm0000x3p25q4cap3o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031487", "code": "class Shape:\n    def area(self):\n        raise NotImplementedError\n\nclass Rectangle(Shape):\n    def __init__(self, w, h):\n        self.w = w\n        self.h = h\n    def area(self):\n        return self.w * self.h\n\nclass Circle(Shape):\n    def __init__(self, r):\n        self.r = r\n    def area(self):\n        return round(3.14159 * self.r * self.r, 2)\n\ndef total_area(shapes):\n    return sum(s.area() for s in shapes)", "entry_point": "total_area", "input": "[Rectangle(3, 4), Circle(2), Rectangle(5, 5)]", "output": "49.57", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx35cwm0002x3p2xv9ydh3o", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031488", "code": "from functools import reduce\n\ndef running_max_index(nums):\n    def combine(acc, pair):\n        idx, val = pair\n        best_idx, best_val, results = acc\n        if val > best_val:\n            best_idx, best_val = idx, val\n        results = results + [(best_idx, best_val)]\n        return best_idx, best_val, results\n    _, _, results = reduce(combine, enumerate(nums), (-1, float('-inf'), []))\n    return results", "entry_point": "running_max_index", "input": "[3, 1, 4, 1, 5, 9, 2, 6]", "output": "[(0, 3), (0, 3), (2, 4), (2, 4), (4, 5), (5, 9), (5, 9), (5, 9)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx35cwm0004x3p2se7oe3wm", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031489", "code": "def safe_divider(pairs):\n    for a, b in pairs:\n        try:\n            yield a / b\n        except ZeroDivisionError:\n            yield None\n\ndef run_divisions(pairs):\n    return list(safe_divider(pairs))", "entry_point": "run_divisions", "input": "[(10, 2), (5, 0), (9, 3), (1, 0)]", "output": "[5.0, None, 3.0, None]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx35cwn0007x3p2jusawql0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031490", "code": "def slice_report(s):\n    return {\n        'reverse': s[::-1],\n        'every_other': s[::2],\n        'middle': s[2:-2],\n        'oob_high': s[100:200],\n        'neg_step_range': s[8:2:-1],\n    }", "entry_point": "slice_report", "input": "'abcdefghij'", "output": "{'reverse': 'jihgfedcba', 'every_other': 'acegi', 'middle': 'cdefgh', 'oob_high': '', 'neg_step_range': 'ihgfed'}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx35cwn0008x3p2gbkl82fo", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031491", "code": "class Node:\n    def __init__(self, value, nxt=None):\n        self.value = value\n        self.nxt = nxt\n\ndef build_list(values):\n    head = None\n    for v in reversed(values):\n        head = Node(v, head)\n    return head\n\ndef reverse_recursive(node, prev=None):\n    if node is None:\n        return prev\n    nxt = node.nxt\n    node.nxt = prev\n    return reverse_recursive(nxt, node)\n\ndef to_list(head):\n    out = []\n    while head is not None:\n        out.append(head.value)\n        head = head.nxt\n    return out\n\ndef run_reverse(values):\n    head = build_list(values)\n    reversed_head = reverse_recursive(head)\n    return to_list(reversed_head)", "entry_point": "run_reverse", "input": "[1, 2, 3, 4, 5]", "output": "[5, 4, 3, 2, 1]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx35cwn0009x3p2i1qo2kew", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031492", "code": "def flatten(items):\n    result = []\n    for item in items:\n        if isinstance(item, list):\n            result.extend(flatten(item))\n        else:\n            result.append(item)\n    return result", "entry_point": "flatten", "input": "[1, [2, 3, [4, [5, 6], 7]], 8, [], [9]]", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx373zl000cx3p2drgjnea1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031493", "code": "def add_item(item, bucket=[]):\n    bucket.append(item)\n    return bucket\n\ndef run_trap():\n    first = add_item(1)\n    second = add_item(2)\n    third = add_item(3, [])\n    return first, second, third, first is second", "entry_point": "run_trap", "input": "", "output": "([1, 2, 1, 2], [1, 2, 1, 2], [3], True)", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx374iy000dx3p2rdut569v", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031494", "code": "class InsufficientFundsError(Exception):\n    pass\n\ndef process_payment(balance, amount):\n    log = []\n    try:\n        if amount <= 0:\n            raise ValueError(\"amount must be positive\")\n        if amount > balance:\n            raise InsufficientFundsError(f\"need {amount - balance} more\")\n        balance -= amount\n    except ValueError as e:\n        log.append(f\"value_error:{e}\")\n    except InsufficientFundsError as e:\n        log.append(f\"insufficient:{e}\")\n    else:\n        log.append(f\"success:{balance}\")\n    finally:\n        log.append(\"done\")\n    return log\n\ndef run_payments():\n    return [process_payment(100, 50), process_payment(100, -5), process_payment(100, 500)]", "entry_point": "run_payments", "input": "", "output": "[['success:50', 'done'], ['value_error:amount must be positive', 'done'], ['insufficient:need 400 more', 'done']]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx38p48000hx3p2z4sklufy", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031495", "code": "class Suppress:\n    def __init__(self, exc_type):\n        self.exc_type = exc_type\n        self.suppressed = False\n    def __enter__(self):\n        return self\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        if exc_type is not None and issubclass(exc_type, self.exc_type):\n            self.suppressed = True\n            return True\n        return False\n\ndef run_block(will_raise, exc_kind):\n    s = Suppress(ValueError)\n    with s:\n        if will_raise:\n            if exc_kind == 'value':\n                raise ValueError('bad value')\n            else:\n                raise TypeError('bad type')\n    return s.suppressed\n\ndef run_suppress_demo():\n    return [run_block(True, 'value'), run_block(False, 'value')]", "entry_point": "run_suppress_demo", "input": "", "output": "[True, False]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsx38p48000jx3p2spzz8jpr", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031496", "code": "def reconcile(events):\n    stock = {}\n    rejected = []\n    for sku, delta in events:\n        current = stock.get(sku, 0)\n        if current + delta < 0:\n            rejected.append((sku, delta, current))\n        else:\n            stock[sku] = current + delta\n    return dict(sorted(stock.items())), rejected", "entry_point": "reconcile", "input": "[('A', 5), ('B', 2), ('A', -7), ('A', -2), ('C', -1)]", "output": "({'A': 3, 'B': 2}, [('A', -7, 5), ('C', -1, 0)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jg00f7kup2eddnae88", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031497", "code": "from collections import deque\n\ndef rolling_windows(values, width):\n    window = deque()\n    total = 0\n    result = []\n    for value in values:\n        window.append(value)\n        total += value\n        if len(window) > width:\n            total -= window.popleft()\n        if len(window) == width:\n            result.append((window[0], window[-1], total))\n    return result", "entry_point": "rolling_windows", "input": "[4, -1, 3, 7, -2], 3", "output": "[(4, 3, 6), (-1, 7, 9), (3, -2, 8)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jg00f8kup2qnzeb2j0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031498", "code": "def coerce_rows(rows, schema):\n    result = []\n    errors = []\n    for index, row in enumerate(rows):\n        clean = {}\n        for field, kind in schema.items():\n            value = row.get(field)\n            try:\n                if kind == 'int':\n                    clean[field] = int(value)\n                elif kind == 'float':\n                    clean[field] = round(float(value), 2)\n                elif kind == 'bool':\n                    lowered = str(value).lower()\n                    if lowered not in ('yes', 'no'):\n                        raise ValueError\n                    clean[field] = lowered == 'yes'\n            except (TypeError, ValueError):\n                clean[field] = None\n                errors.append((index, field, value))\n        result.append(clean)\n    return result, errors", "entry_point": "coerce_rows", "input": "[{'age': '30', 'score': '8.256', 'active': 'yes'}, {'age': 'x', 'score': 4, 'active': 'maybe'}, {'age': 0, 'score': None, 'active': 'no'}], {'age': 'int', 'score': 'float', 'active': 'bool'}", "output": "([{'age': 30, 'score': 8.26, 'active': True}, {'age': None, 'score': 4.0, 'active': None}, {'age': 0, 'score': None, 'active': False}], [(1, 'age', 'x'), (1, 'active', 'maybe'), (2, 'score', None)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00f9kup2fdgtsmmt", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031499", "code": "def allocate(requests, capacities):\n    remaining = capacities.copy()\n    allocations = []\n    for team, resource, amount in requests:\n        available = remaining.get(resource, 0)\n        granted = min(max(amount, 0), available)\n        if granted:\n            allocations.append((team, resource, granted))\n            remaining[resource] = available - granted\n    return allocations, dict(sorted(remaining.items()))", "entry_point": "allocate", "input": "[('red', 'cpu', 3), ('blue', 'cpu', 4), ('red', 'gpu', 2), ('green', 'ram', 1), ('blue', 'gpu', -1)], {'cpu': 5, 'gpu': 1}", "output": "([('red', 'cpu', 3), ('blue', 'cpu', 2), ('red', 'gpu', 1)], {'cpu': 0, 'gpu': 0})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00fakup2rs29u4sc", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031500", "code": "def retry_summary(jobs, limit):\n    summary = {}\n    exhausted = []\n    for name in sorted(jobs):\n        attempts = 0\n        succeeded = False\n        for outcome in jobs[name][:limit]:\n            attempts += 1\n            if outcome:\n                succeeded = True\n                break\n        summary[name] = (attempts, succeeded)\n        if not succeeded:\n            exhausted.append(name)\n    return summary, exhausted", "entry_point": "retry_summary", "input": "{'sync': [False, True, True], 'backup': [False, False, True], 'email': [True]}, 2", "output": "({'backup': (2, False), 'email': (1, True), 'sync': (2, True)}, ['backup'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00fbkup2cqdur2dn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031501", "code": "def trace_aliases(mapping, names):\n    result = {}\n    for start in names:\n        path = []\n        node = start\n        while node in mapping and node not in path:\n            path.append(node)\n            node = mapping[node]\n        if node in path:\n            cycle = path[path.index(node):]\n            result[start] = ('cycle', tuple(cycle))\n        else:\n            result[start] = ('target', node)\n    return result", "entry_point": "trace_aliases", "input": "{'api': 'service', 'service': 'v2', 'old': 'legacy', 'legacy': 'old'}, ['api', 'old', 'missing']", "output": "{'api': ('target', 'v2'), 'old': ('cycle', ('old', 'legacy')), 'missing': ('target', 'missing')}", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00fckup23bczfrda", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031502", "code": "def settle(entries, overdraft_fee=5):\n    balances = {}\n    alerts = []\n    for account, amount in entries:\n        before = balances.get(account, 0)\n        after = before + amount\n        if amount < 0 and after < 0:\n            after -= overdraft_fee\n            alerts.append((account, before, amount, after))\n        balances[account] = after\n    return dict(sorted(balances.items())), alerts", "entry_point": "settle", "input": "[('A', 20), ('B', -3), ('A', -25), ('B', 10), ('A', 15)]", "output": "({'A': 5, 'B': 2}, [('B', 0, -3, -8), ('A', 20, -25, -10)])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00fdkup2g9iug9xn", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031503", "code": "def compact_bookings(bookings):\n    merged = []\n    for room, start, end in sorted(bookings):\n        if merged and merged[-1][0] == room and start <= merged[-1][2]:\n            old_room, old_start, old_end = merged[-1]\n            merged[-1] = (old_room, old_start, max(old_end, end))\n        else:\n            merged.append((room, start, end))\n    return merged", "entry_point": "compact_bookings", "input": "[('B', 5, 8), ('A', 1, 3), ('A', 3, 6), ('B', 1, 2), ('A', 8, 9), ('B', 7, 10)]", "output": "[('A', 1, 6), ('A', 8, 9), ('B', 1, 2), ('B', 5, 10)]", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00fekup228aurw2t", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031504", "code": "def session_durations(events):\n    active = {}\n    durations = {}\n    anomalies = []\n    for user, minute, action in events:\n        if action == 'login':\n            if user in active:\n                anomalies.append((user, 'duplicate_login', minute))\n            else:\n                active[user] = minute\n        elif action == 'logout':\n            if user not in active:\n                anomalies.append((user, 'orphan_logout', minute))\n            else:\n                durations.setdefault(user, []).append(minute - active.pop(user))\n    return dict(sorted(durations.items())), anomalies, dict(sorted(active.items()))", "entry_point": "session_durations", "input": "[('ana', 2, 'login'), ('bo', 4, 'logout'), ('ana', 7, 'login'), ('ana', 12, 'logout'), ('bo', 15, 'login')]", "output": "({'ana': [10]}, [('bo', 'orphan_logout', 4), ('ana', 'duplicate_login', 7)], {'bo': 15})", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00ffkup2y8txjicf", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "execution_trace/0031505", "code": "import copy\n\ndef apply_patches(document, patches):\n    result = copy.deepcopy(document)\n    applied = []\n    rejected = []\n    for path, value in patches:\n        keys = path.split('.')\n        current = result\n        valid = True\n        for key in keys[:-1]:\n            if key not in current:\n                current[key] = {}\n            if not isinstance(current[key], dict):\n                valid = False\n                break\n            current = current[key]\n        if valid:\n            current[keys[-1]] = value\n            applied.append(path)\n        else:\n            rejected.append(path)\n    return result, applied, rejected", "entry_point": "apply_patches", "input": "{'user': {'name': 'Mira'}, 'version': 2}, [('user.active', True), ('settings.theme', 'dark'), ('version.major', 3), ('user.name', 'M')]", "output": "({'user': {'name': 'M', 'active': True}, 'version': 2, 'settings': {'theme': 'dark'}}, ['user.active', 'settings.theme', 'user.name'], ['version.major'])", "source": "execution_trace", "source_repo": "databounty-io/python-execution-trace-output-prediction-cmskdimp", "source_revision": "88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9", "source_file": "/home/builder/.cache/huggingface/hub/datasets--databounty-io--python-execution-trace-output-prediction-cmskdimp/snapshots/88c74bd6525825f46bec4d68b2a9ed7f11fa0cf9/data/items.jsonl", "source_id": "cmsxkh6jh00fgkup2qxick56s", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031506", "code": "class Pair(object): \r\n\tdef __init__(self, a, b): \r\n\t\tself.a = a \r\n\t\tself.b = b \r\ndef max_chain_length(arr, n): \r\n\tmax = 0\r\n\tmcl = [1 for i in range(n)] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(0, i): \r\n\t\t\tif (arr[i].a > arr[j].b and\r\n\t\t\t\tmcl[i] < mcl[j] + 1): \r\n\t\t\t\tmcl[i] = mcl[j] + 1\r\n\tfor i in range(n): \r\n\t\tif (max < mcl[i]): \r\n\t\t\tmax = mcl[i] \r\n\treturn max", "entry_point": "max_chain_length", "input": "[Pair(5, 24), Pair(15, 25), Pair(27, 40), Pair(50, 60)], 4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "601_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031507", "code": "class Pair(object): \r\n\tdef __init__(self, a, b): \r\n\t\tself.a = a \r\n\t\tself.b = b \r\ndef max_chain_length(arr, n): \r\n\tmax = 0\r\n\tmcl = [1 for i in range(n)] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(0, i): \r\n\t\t\tif (arr[i].a > arr[j].b and\r\n\t\t\t\tmcl[i] < mcl[j] + 1): \r\n\t\t\t\tmcl[i] = mcl[j] + 1\r\n\tfor i in range(n): \r\n\t\tif (max < mcl[i]): \r\n\t\t\tmax = mcl[i] \r\n\treturn max", "entry_point": "max_chain_length", "input": "[Pair(1, 2), Pair(3, 4), Pair(5, 6), Pair(7, 8)], 4", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "601_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031508", "code": "class Pair(object): \r\n\tdef __init__(self, a, b): \r\n\t\tself.a = a \r\n\t\tself.b = b \r\ndef max_chain_length(arr, n): \r\n\tmax = 0\r\n\tmcl = [1 for i in range(n)] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(0, i): \r\n\t\t\tif (arr[i].a > arr[j].b and\r\n\t\t\t\tmcl[i] < mcl[j] + 1): \r\n\t\t\t\tmcl[i] = mcl[j] + 1\r\n\tfor i in range(n): \r\n\t\tif (max < mcl[i]): \r\n\t\t\tmax = mcl[i] \r\n\treturn max", "entry_point": "max_chain_length", "input": "[Pair(19, 10), Pair(11, 12), Pair(13, 14), Pair(15, 16), Pair(31, 54)], 5", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "601_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031509", "code": "def first_repeated_char(str1):\r\n  for index,c in enumerate(str1):\r\n    if str1[:index+1].count(c) > 1:\r\n      return c \r\n  return \"None\"", "entry_point": "first_repeated_char", "input": "'abcabc'", "output": "'a'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "602_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031510", "code": "def first_repeated_char(str1):\r\n  for index,c in enumerate(str1):\r\n    if str1[:index+1].count(c) > 1:\r\n      return c \r\n  return \"None\"", "entry_point": "first_repeated_char", "input": "'abc'", "output": "'None'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "602_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031511", "code": "def first_repeated_char(str1):\r\n  for index,c in enumerate(str1):\r\n    if str1[:index+1].count(c) > 1:\r\n      return c \r\n  return \"None\"", "entry_point": "first_repeated_char", "input": "'123123'", "output": "'1'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "602_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031512", "code": "def get_ludic(n):\r\n\tludics = []\r\n\tfor i in range(1, n + 1):\r\n\t\tludics.append(i)\r\n\tindex = 1\r\n\twhile(index != len(ludics)):\r\n\t\tfirst_ludic = ludics[index]\r\n\t\tremove_index = index + first_ludic\r\n\t\twhile(remove_index < len(ludics)):\r\n\t\t\tludics.remove(ludics[remove_index])\r\n\t\t\tremove_index = remove_index + first_ludic - 1\r\n\t\tindex += 1\r\n\treturn ludics", "entry_point": "get_ludic", "input": "10", "output": "[1, 2, 3, 5, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "603_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031513", "code": "def get_ludic(n):\r\n\tludics = []\r\n\tfor i in range(1, n + 1):\r\n\t\tludics.append(i)\r\n\tindex = 1\r\n\twhile(index != len(ludics)):\r\n\t\tfirst_ludic = ludics[index]\r\n\t\tremove_index = index + first_ludic\r\n\t\twhile(remove_index < len(ludics)):\r\n\t\t\tludics.remove(ludics[remove_index])\r\n\t\t\tremove_index = remove_index + first_ludic - 1\r\n\t\tindex += 1\r\n\treturn ludics", "entry_point": "get_ludic", "input": "25", "output": "[1, 2, 3, 5, 7, 11, 13, 17, 23, 25]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "603_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031514", "code": "def get_ludic(n):\r\n\tludics = []\r\n\tfor i in range(1, n + 1):\r\n\t\tludics.append(i)\r\n\tindex = 1\r\n\twhile(index != len(ludics)):\r\n\t\tfirst_ludic = ludics[index]\r\n\t\tremove_index = index + first_ludic\r\n\t\twhile(remove_index < len(ludics)):\r\n\t\t\tludics.remove(ludics[remove_index])\r\n\t\t\tremove_index = remove_index + first_ludic - 1\r\n\t\tindex += 1\r\n\treturn ludics", "entry_point": "get_ludic", "input": "45", "output": "[1, 2, 3, 5, 7, 11, 13, 17, 23, 25, 29, 37, 41, 43]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "603_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031515", "code": "def reverse_words(s):\r\n        return ' '.join(reversed(s.split()))", "entry_point": "reverse_words", "input": "'python program'", "output": "'program python'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "604_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031516", "code": "def reverse_words(s):\r\n        return ' '.join(reversed(s.split()))", "entry_point": "reverse_words", "input": "'java language'", "output": "'language java'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "604_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031517", "code": "def reverse_words(s):\r\n        return ' '.join(reversed(s.split()))", "entry_point": "reverse_words", "input": "'indian man'", "output": "'man indian'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "604_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031518", "code": "def prime_num(num):\r\n  if num >=1:\r\n   for i in range(2, num//2):\r\n     if (num % i) == 0:\r\n                return False\r\n     else:\r\n                return True\r\n  else:\r\n          return False", "entry_point": "prime_num", "input": "13", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "605_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031519", "code": "def prime_num(num):\r\n  if num >=1:\r\n   for i in range(2, num//2):\r\n     if (num % i) == 0:\r\n                return False\r\n     else:\r\n                return True\r\n  else:\r\n          return False", "entry_point": "prime_num", "input": "7", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "605_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031520", "code": "def prime_num(num):\r\n  if num >=1:\r\n   for i in range(2, num//2):\r\n     if (num % i) == 0:\r\n                return False\r\n     else:\r\n                return True\r\n  else:\r\n          return False", "entry_point": "prime_num", "input": "-1010", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "605_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031521", "code": "import math\r\ndef radian_degree(degree):\r\n radian = degree*(math.pi/180)\r\n return radian", "entry_point": "radian_degree", "input": "90", "output": "1.5707963267948966", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "606_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031522", "code": "import math\r\ndef radian_degree(degree):\r\n radian = degree*(math.pi/180)\r\n return radian", "entry_point": "radian_degree", "input": "60", "output": "1.0471975511965976", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "606_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031523", "code": "import math\r\ndef radian_degree(degree):\r\n radian = degree*(math.pi/180)\r\n return radian", "entry_point": "radian_degree", "input": "120", "output": "2.0943951023931953", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "606_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031524", "code": "import re\r\npattern = 'fox'\r\ntext = 'The quick brown fox jumps over the lazy dog.'\r\ndef find_literals(text, pattern):\r\n  match = re.search(pattern, text)\r\n  s = match.start()\r\n  e = match.end()\r\n  return (match.re.pattern, s, e)", "entry_point": "find_literals", "input": "'The quick brown fox jumps over the lazy dog.', 'fox'", "output": "('fox', 16, 19)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "607_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031525", "code": "import re\r\npattern = 'fox'\r\ntext = 'The quick brown fox jumps over the lazy dog.'\r\ndef find_literals(text, pattern):\r\n  match = re.search(pattern, text)\r\n  s = match.start()\r\n  e = match.end()\r\n  return (match.re.pattern, s, e)", "entry_point": "find_literals", "input": "'Its been a very crazy procedure right', 'crazy'", "output": "('crazy', 16, 21)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "607_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031526", "code": "import re\r\npattern = 'fox'\r\ntext = 'The quick brown fox jumps over the lazy dog.'\r\ndef find_literals(text, pattern):\r\n  match = re.search(pattern, text)\r\n  s = match.start()\r\n  e = match.end()\r\n  return (match.re.pattern, s, e)", "entry_point": "find_literals", "input": "'Hardest choices required strongest will', 'will'", "output": "('will', 35, 39)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "607_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031527", "code": "def bell_Number(n): \r\n    bell = [[0 for i in range(n+1)] for j in range(n+1)] \r\n    bell[0][0] = 1\r\n    for i in range(1, n+1):\r\n        bell[i][0] = bell[i-1][i-1]\r\n        for j in range(1, i+1): \r\n            bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \r\n    return bell[n][0] ", "entry_point": "bell_Number", "input": "2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "608_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031528", "code": "def bell_Number(n): \r\n    bell = [[0 for i in range(n+1)] for j in range(n+1)] \r\n    bell[0][0] = 1\r\n    for i in range(1, n+1):\r\n        bell[i][0] = bell[i-1][i-1]\r\n        for j in range(1, i+1): \r\n            bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \r\n    return bell[n][0] ", "entry_point": "bell_Number", "input": "3", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "608_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031529", "code": "def bell_Number(n): \r\n    bell = [[0 for i in range(n+1)] for j in range(n+1)] \r\n    bell[0][0] = 1\r\n    for i in range(1, n+1):\r\n        bell[i][0] = bell[i-1][i-1]\r\n        for j in range(1, i+1): \r\n            bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \r\n    return bell[n][0] ", "entry_point": "bell_Number", "input": "4", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "608_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031530", "code": "def floor_Min(A,B,N):\r\n    x = max(B - 1,N)\r\n    return (A*x) // B", "entry_point": "floor_Min", "input": "10, 20, 30", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "609_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031531", "code": "def floor_Min(A,B,N):\r\n    x = max(B - 1,N)\r\n    return (A*x) // B", "entry_point": "floor_Min", "input": "1, 2, 1", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "609_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031532", "code": "def floor_Min(A,B,N):\r\n    x = max(B - 1,N)\r\n    return (A*x) // B", "entry_point": "floor_Min", "input": "11, 10, 9", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "609_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031533", "code": "def remove_kth_element(list1, L):\r\n    return  list1[:L-1] + list1[L:]", "entry_point": "remove_kth_element", "input": "[1, 1, 2, 3, 4, 4, 5, 1], 3", "output": "[1, 1, 3, 4, 4, 5, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "610_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031534", "code": "def remove_kth_element(list1, L):\r\n    return  list1[:L-1] + list1[L:]", "entry_point": "remove_kth_element", "input": "[0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4], 4", "output": "[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "610_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031535", "code": "def remove_kth_element(list1, L):\r\n    return  list1[:L-1] + list1[L:]", "entry_point": "remove_kth_element", "input": "[10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10], 5", "output": "[10, 10, 15, 19, 18, 17, 26, 26, 17, 18, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "610_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031536", "code": "def max_of_nth(test_list, N):\r\n  res = max([sub[N] for sub in test_list])\r\n  return (res) ", "entry_point": "max_of_nth", "input": "[(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2", "output": "19", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "611_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031537", "code": "def max_of_nth(test_list, N):\r\n  res = max([sub[N] for sub in test_list])\r\n  return (res) ", "entry_point": "max_of_nth", "input": "[(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "611_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031538", "code": "def max_of_nth(test_list, N):\r\n  res = max([sub[N] for sub in test_list])\r\n  return (res) ", "entry_point": "max_of_nth", "input": "[(7, 8, 9), (3, 5, 7), (10, 11, 21)], 1", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "611_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031539", "code": "def merge(lst):  \r\n    return [list(ele) for ele in list(zip(*lst))] ", "entry_point": "merge", "input": "[['x', 'y'], ['a', 'b'], ['m', 'n']]", "output": "[['x', 'a', 'm'], ['y', 'b', 'n']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "612_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031540", "code": "def merge(lst):  \r\n    return [list(ele) for ele in list(zip(*lst))] ", "entry_point": "merge", "input": "[[1, 2], [3, 4], [5, 6], [7, 8]]", "output": "[[1, 3, 5, 7], [2, 4, 6, 8]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "612_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031541", "code": "def merge(lst):  \r\n    return [list(ele) for ele in list(zip(*lst))] ", "entry_point": "merge", "input": "[['x', 'y', 'z'], ['a', 'b', 'c'], ['m', 'n', 'o']]", "output": "[['x', 'a', 'm'], ['y', 'b', 'n'], ['z', 'c', 'o']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "612_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031542", "code": "def maximum_value(test_list):\r\n  res = [(key, max(lst)) for key, lst in test_list]\r\n  return (res) ", "entry_point": "maximum_value", "input": "[('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]", "output": "[('key1', 5), ('key2', 4), ('key3', 9)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "613_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031543", "code": "def maximum_value(test_list):\r\n  res = [(key, max(lst)) for key, lst in test_list]\r\n  return (res) ", "entry_point": "maximum_value", "input": "[('key1', [4, 5, 6]), ('key2', [2, 5, 3]), ('key3', [10, 4])]", "output": "[('key1', 6), ('key2', 5), ('key3', 10)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "613_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031544", "code": "def maximum_value(test_list):\r\n  res = [(key, max(lst)) for key, lst in test_list]\r\n  return (res) ", "entry_point": "maximum_value", "input": "[('key1', [5, 6, 7]), ('key2', [3, 6, 4]), ('key3', [11, 5])]", "output": "[('key1', 7), ('key2', 6), ('key3', 11)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "613_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031545", "code": "def cummulative_sum(test_list):\r\n  res = sum(map(sum, test_list))\r\n  return (res)", "entry_point": "cummulative_sum", "input": "[(1, 3), (5, 6, 7), (2, 6)]", "output": "30", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "614_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031546", "code": "def cummulative_sum(test_list):\r\n  res = sum(map(sum, test_list))\r\n  return (res)", "entry_point": "cummulative_sum", "input": "[(2, 4), (6, 7, 8), (3, 7)]", "output": "37", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "614_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031547", "code": "def cummulative_sum(test_list):\r\n  res = sum(map(sum, test_list))\r\n  return (res)", "entry_point": "cummulative_sum", "input": "[(3, 5), (7, 8, 9), (4, 8)]", "output": "44", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "614_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031548", "code": "def average_tuple(nums):\r\n    result = [sum(x) / len(x) for x in zip(*nums)]\r\n    return result", "entry_point": "average_tuple", "input": "((10, 10, 10, 12), (30, 45, 56, 45), (81, 80, 39, 32), (1, 2, 3, 4))", "output": "[30.5, 34.25, 27.0, 23.25]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "615_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031549", "code": "def average_tuple(nums):\r\n    result = [sum(x) / len(x) for x in zip(*nums)]\r\n    return result", "entry_point": "average_tuple", "input": "((1, 1, -5), (30, -15, 56), (81, -60, -39), (-10, 2, 3))", "output": "[25.5, -18.0, 3.75]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "615_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031550", "code": "def average_tuple(nums):\r\n    result = [sum(x) / len(x) for x in zip(*nums)]\r\n    return result", "entry_point": "average_tuple", "input": "((100, 100, 100, 120), (300, 450, 560, 450), (810, 800, 390, 320), (10, 20, 30, 40))", "output": "[305.0, 342.5, 270.0, 232.5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "615_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031551", "code": "def tuple_modulo(test_tup1, test_tup2):\r\n  res = tuple(ele1 % ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) \r\n  return (res) ", "entry_point": "tuple_modulo", "input": "(10, 4, 5, 6), (5, 6, 7, 5)", "output": "(0, 4, 5, 1)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "616_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031552", "code": "def tuple_modulo(test_tup1, test_tup2):\r\n  res = tuple(ele1 % ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) \r\n  return (res) ", "entry_point": "tuple_modulo", "input": "(11, 5, 6, 7), (6, 7, 8, 6)", "output": "(5, 5, 6, 1)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "616_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031553", "code": "def tuple_modulo(test_tup1, test_tup2):\r\n  res = tuple(ele1 % ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) \r\n  return (res) ", "entry_point": "tuple_modulo", "input": "(12, 6, 7, 8), (7, 8, 9, 7)", "output": "(5, 6, 7, 1)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "616_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031554", "code": "def min_Jumps(a, b, d): \r\n    temp = a \r\n    a = min(a, b) \r\n    b = max(temp, b) \r\n    if (d >= b): \r\n        return (d + b - 1) / b \r\n    if (d == 0): \r\n        return 0\r\n    if (d == a): \r\n        return 1\r\n    else:\r\n        return 2", "entry_point": "min_Jumps", "input": "3, 4, 11", "output": "3.5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "617_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031555", "code": "def min_Jumps(a, b, d): \r\n    temp = a \r\n    a = min(a, b) \r\n    b = max(temp, b) \r\n    if (d >= b): \r\n        return (d + b - 1) / b \r\n    if (d == 0): \r\n        return 0\r\n    if (d == a): \r\n        return 1\r\n    else:\r\n        return 2", "entry_point": "min_Jumps", "input": "3, 4, 0", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "617_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031556", "code": "def min_Jumps(a, b, d): \r\n    temp = a \r\n    a = min(a, b) \r\n    b = max(temp, b) \r\n    if (d >= b): \r\n        return (d + b - 1) / b \r\n    if (d == 0): \r\n        return 0\r\n    if (d == a): \r\n        return 1\r\n    else:\r\n        return 2", "entry_point": "min_Jumps", "input": "11, 14, 11", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "617_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031557", "code": "def div_list(nums1,nums2):\r\n  result = map(lambda x, y: x / y, nums1, nums2)\r\n  return list(result)", "entry_point": "div_list", "input": "[4, 5, 6], [1, 2, 3]", "output": "[4.0, 2.5, 2.0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "618_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031558", "code": "def div_list(nums1,nums2):\r\n  result = map(lambda x, y: x / y, nums1, nums2)\r\n  return list(result)", "entry_point": "div_list", "input": "[3, 2], [1, 4]", "output": "[3.0, 0.5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "618_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031559", "code": "def div_list(nums1,nums2):\r\n  result = map(lambda x, y: x / y, nums1, nums2)\r\n  return list(result)", "entry_point": "div_list", "input": "[90, 120], [50, 70]", "output": "[1.8, 1.7142857142857142]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "618_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031560", "code": "def move_num(test_str):\r\n  res = ''\r\n  dig = ''\r\n  for ele in test_str:\r\n    if ele.isdigit():\r\n      dig += ele\r\n    else:\r\n      res += ele\r\n  res += dig\r\n  return (res) ", "entry_point": "move_num", "input": "'I1love143you55three3000thousand'", "output": "'Iloveyouthreethousand1143553000'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "619_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031561", "code": "def move_num(test_str):\r\n  res = ''\r\n  dig = ''\r\n  for ele in test_str:\r\n    if ele.isdigit():\r\n      dig += ele\r\n    else:\r\n      res += ele\r\n  res += dig\r\n  return (res) ", "entry_point": "move_num", "input": "'Avengers124Assemble'", "output": "'AvengersAssemble124'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "619_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031562", "code": "def move_num(test_str):\r\n  res = ''\r\n  dig = ''\r\n  for ele in test_str:\r\n    if ele.isdigit():\r\n      dig += ele\r\n    else:\r\n      res += ele\r\n  res += dig\r\n  return (res) ", "entry_point": "move_num", "input": "'Its11our12path13to14see15things16do17things'", "output": "'Itsourpathtoseethingsdothings11121314151617'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "619_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031563", "code": "def largest_subset(a, n):\r\n\tdp = [0 for i in range(n)]\r\n\tdp[n - 1] = 1; \r\n\tfor i in range(n - 2, -1, -1):\r\n\t\tmxm = 0;\r\n\t\tfor j in range(i + 1, n):\r\n\t\t\tif a[j] % a[i] == 0 or a[i] % a[j] == 0:\r\n\t\t\t\tmxm = max(mxm, dp[j])\r\n\t\tdp[i] = 1 + mxm\r\n\treturn max(dp)", "entry_point": "largest_subset", "input": "[1, 3, 6, 13, 17, 18], 6", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "620_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031564", "code": "def largest_subset(a, n):\r\n\tdp = [0 for i in range(n)]\r\n\tdp[n - 1] = 1; \r\n\tfor i in range(n - 2, -1, -1):\r\n\t\tmxm = 0;\r\n\t\tfor j in range(i + 1, n):\r\n\t\t\tif a[j] % a[i] == 0 or a[i] % a[j] == 0:\r\n\t\t\t\tmxm = max(mxm, dp[j])\r\n\t\tdp[i] = 1 + mxm\r\n\treturn max(dp)", "entry_point": "largest_subset", "input": "[10, 5, 3, 15, 20], 5", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "620_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031565", "code": "def largest_subset(a, n):\r\n\tdp = [0 for i in range(n)]\r\n\tdp[n - 1] = 1; \r\n\tfor i in range(n - 2, -1, -1):\r\n\t\tmxm = 0;\r\n\t\tfor j in range(i + 1, n):\r\n\t\t\tif a[j] % a[i] == 0 or a[i] % a[j] == 0:\r\n\t\t\t\tmxm = max(mxm, dp[j])\r\n\t\tdp[i] = 1 + mxm\r\n\treturn max(dp)", "entry_point": "largest_subset", "input": "[18, 1, 3, 6, 13, 17], 6", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "620_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031566", "code": "def increment_numerics(test_list, K):\r\n  res = [str(int(ele) + K) if ele.isdigit() else ele for ele in test_list]\r\n  return res ", "entry_point": "increment_numerics", "input": "['MSM', '234', 'is', '98', '123', 'best', '4'], 6", "output": "['MSM', '240', 'is', '104', '129', 'best', '10']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "621_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031567", "code": "def increment_numerics(test_list, K):\r\n  res = [str(int(ele) + K) if ele.isdigit() else ele for ele in test_list]\r\n  return res ", "entry_point": "increment_numerics", "input": "['Dart', '356', 'is', '88', '169', 'Super', '6'], 12", "output": "['Dart', '368', 'is', '100', '181', 'Super', '18']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "621_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031568", "code": "def increment_numerics(test_list, K):\r\n  res = [str(int(ele) + K) if ele.isdigit() else ele for ele in test_list]\r\n  return res ", "entry_point": "increment_numerics", "input": "['Flutter', '451', 'is', '44', '96', 'Magnificent', '12'], 33", "output": "['Flutter', '484', 'is', '77', '129', 'Magnificent', '45']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "621_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031569", "code": "def get_median(arr1, arr2, n):\r\n  i = 0\r\n  j = 0\r\n  m1 = -1\r\n  m2 = -1\r\n  count = 0\r\n  while count < n + 1:\r\n    count += 1\r\n    if i == n:\r\n      m1 = m2\r\n      m2 = arr2[0]\r\n      break\r\n    elif j == n:\r\n      m1 = m2\r\n      m2 = arr1[0]\r\n      break\r\n    if arr1[i] <= arr2[j]:\r\n      m1 = m2\r\n      m2 = arr1[i]\r\n      i += 1\r\n    else:\r\n      m1 = m2\r\n      m2 = arr2[j]\r\n      j += 1\r\n  return (m1 + m2)/2", "entry_point": "get_median", "input": "[1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5", "output": "16.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "622_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031570", "code": "def get_median(arr1, arr2, n):\r\n  i = 0\r\n  j = 0\r\n  m1 = -1\r\n  m2 = -1\r\n  count = 0\r\n  while count < n + 1:\r\n    count += 1\r\n    if i == n:\r\n      m1 = m2\r\n      m2 = arr2[0]\r\n      break\r\n    elif j == n:\r\n      m1 = m2\r\n      m2 = arr1[0]\r\n      break\r\n    if arr1[i] <= arr2[j]:\r\n      m1 = m2\r\n      m2 = arr1[i]\r\n      i += 1\r\n    else:\r\n      m1 = m2\r\n      m2 = arr2[j]\r\n      j += 1\r\n  return (m1 + m2)/2", "entry_point": "get_median", "input": "[2, 4, 8, 9], [7, 13, 19, 28], 4", "output": "8.5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "622_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031571", "code": "def get_median(arr1, arr2, n):\r\n  i = 0\r\n  j = 0\r\n  m1 = -1\r\n  m2 = -1\r\n  count = 0\r\n  while count < n + 1:\r\n    count += 1\r\n    if i == n:\r\n      m1 = m2\r\n      m2 = arr2[0]\r\n      break\r\n    elif j == n:\r\n      m1 = m2\r\n      m2 = arr1[0]\r\n      break\r\n    if arr1[i] <= arr2[j]:\r\n      m1 = m2\r\n      m2 = arr1[i]\r\n      i += 1\r\n    else:\r\n      m1 = m2\r\n      m2 = arr2[j]\r\n      j += 1\r\n  return (m1 + m2)/2", "entry_point": "get_median", "input": "[3, 6, 14, 23, 36, 42], [2, 18, 27, 39, 49, 55], 6", "output": "25.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "622_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031572", "code": "def nth_nums(nums,n):\r\n nth_nums = list(map(lambda x: x ** n, nums))\r\n return nth_nums", "entry_point": "nth_nums", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2", "output": "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "623_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031573", "code": "def nth_nums(nums,n):\r\n nth_nums = list(map(lambda x: x ** n, nums))\r\n return nth_nums", "entry_point": "nth_nums", "input": "[10, 20, 30], 3", "output": "[1000, 8000, 27000]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "623_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031574", "code": "def nth_nums(nums,n):\r\n nth_nums = list(map(lambda x: x ** n, nums))\r\n return nth_nums", "entry_point": "nth_nums", "input": "[12, 15], 5", "output": "[248832, 759375]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "623_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031575", "code": "def is_upper(string):\r\n  return (string.upper())", "entry_point": "is_upper", "input": "'person'", "output": "'PERSON'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "624_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031576", "code": "def is_upper(string):\r\n  return (string.upper())", "entry_point": "is_upper", "input": "'final'", "output": "'FINAL'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "624_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031577", "code": "def is_upper(string):\r\n  return (string.upper())", "entry_point": "is_upper", "input": "'Valid'", "output": "'VALID'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "624_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031578", "code": "def swap_List(newList): \r\n    size = len(newList) \r\n    temp = newList[0] \r\n    newList[0] = newList[size - 1] \r\n    newList[size - 1] = temp   \r\n    return newList ", "entry_point": "swap_List", "input": "[1, 2, 3]", "output": "[3, 2, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "625_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031579", "code": "def swap_List(newList): \r\n    size = len(newList) \r\n    temp = newList[0] \r\n    newList[0] = newList[size - 1] \r\n    newList[size - 1] = temp   \r\n    return newList ", "entry_point": "swap_List", "input": "[1, 2, 3, 4, 4]", "output": "[4, 2, 3, 4, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "625_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031580", "code": "def swap_List(newList): \r\n    size = len(newList) \r\n    temp = newList[0] \r\n    newList[0] = newList[size - 1] \r\n    newList[size - 1] = temp   \r\n    return newList ", "entry_point": "swap_List", "input": "[4, 5, 6]", "output": "[6, 5, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "625_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031581", "code": "def triangle_area(r) :  \r\n    if r < 0 : \r\n        return -1\r\n    return r * r ", "entry_point": "triangle_area", "input": "0", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "626_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031582", "code": "def triangle_area(r) :  \r\n    if r < 0 : \r\n        return -1\r\n    return r * r ", "entry_point": "triangle_area", "input": "-1", "output": "-1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "626_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031583", "code": "def triangle_area(r) :  \r\n    if r < 0 : \r\n        return -1\r\n    return r * r ", "entry_point": "triangle_area", "input": "2", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "626_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031584", "code": "def find_First_Missing(array,start,end): \r\n    if (start > end): \r\n        return end + 1\r\n    if (start != array[start]): \r\n        return start; \r\n    mid = int((start + end) / 2) \r\n    if (array[mid] == mid): \r\n        return find_First_Missing(array,mid+1,end) \r\n    return find_First_Missing(array,start,mid) ", "entry_point": "find_First_Missing", "input": "[0, 1, 2, 3], 0, 3", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "627_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031585", "code": "def find_First_Missing(array,start,end): \r\n    if (start > end): \r\n        return end + 1\r\n    if (start != array[start]): \r\n        return start; \r\n    mid = int((start + end) / 2) \r\n    if (array[mid] == mid): \r\n        return find_First_Missing(array,mid+1,end) \r\n    return find_First_Missing(array,start,mid) ", "entry_point": "find_First_Missing", "input": "[0, 1, 2, 6, 9], 0, 4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "627_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031586", "code": "def find_First_Missing(array,start,end): \r\n    if (start > end): \r\n        return end + 1\r\n    if (start != array[start]): \r\n        return start; \r\n    mid = int((start + end) / 2) \r\n    if (array[mid] == mid): \r\n        return find_First_Missing(array,mid+1,end) \r\n    return find_First_Missing(array,start,mid) ", "entry_point": "find_First_Missing", "input": "[2, 3, 5, 8, 9], 0, 4", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "627_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031587", "code": "MAX=1000;\r\ndef replace_spaces(string):\r\n  string=string.strip()\r\n  i=len(string)\r\n  space_count=string.count(' ')\r\n  new_length = i + space_count*2\r\n  if new_length > MAX:\r\n    return -1\r\n  index = new_length-1\r\n  string=list(string)\r\n  for f in range(i-2, new_length-2):\r\n    string.append('0')\r\n  for j in range(i-1, 0, -1):\r\n    if string[j] == ' ':\r\n      string[index] = '0'\r\n      string[index-1] = '2'\r\n      string[index-2] = '%'\r\n      index=index-3\r\n    else:\r\n      string[index] = string[j]\r\n      index -= 1\r\n  return ''.join(string)", "entry_point": "replace_spaces", "input": "'My Name is Dawood'", "output": "'My%20Name%20is%20Dawood'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "628_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031588", "code": "MAX=1000;\r\ndef replace_spaces(string):\r\n  string=string.strip()\r\n  i=len(string)\r\n  space_count=string.count(' ')\r\n  new_length = i + space_count*2\r\n  if new_length > MAX:\r\n    return -1\r\n  index = new_length-1\r\n  string=list(string)\r\n  for f in range(i-2, new_length-2):\r\n    string.append('0')\r\n  for j in range(i-1, 0, -1):\r\n    if string[j] == ' ':\r\n      string[index] = '0'\r\n      string[index-1] = '2'\r\n      string[index-2] = '%'\r\n      index=index-3\r\n    else:\r\n      string[index] = string[j]\r\n      index -= 1\r\n  return ''.join(string)", "entry_point": "replace_spaces", "input": "'I am a Programmer'", "output": "'I%20am%20a%20Programmer'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "628_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031589", "code": "MAX=1000;\r\ndef replace_spaces(string):\r\n  string=string.strip()\r\n  i=len(string)\r\n  space_count=string.count(' ')\r\n  new_length = i + space_count*2\r\n  if new_length > MAX:\r\n    return -1\r\n  index = new_length-1\r\n  string=list(string)\r\n  for f in range(i-2, new_length-2):\r\n    string.append('0')\r\n  for j in range(i-1, 0, -1):\r\n    if string[j] == ' ':\r\n      string[index] = '0'\r\n      string[index-1] = '2'\r\n      string[index-2] = '%'\r\n      index=index-3\r\n    else:\r\n      string[index] = string[j]\r\n      index -= 1\r\n  return ''.join(string)", "entry_point": "replace_spaces", "input": "'I love Coding'", "output": "'I%20love%20Coding'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "628_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031590", "code": "def Split(list): \r\n    ev_li = [] \r\n    for i in list: \r\n        if (i % 2 == 0): \r\n            ev_li.append(i)  \r\n    return ev_li", "entry_point": "Split", "input": "[1, 2, 3, 4, 5]", "output": "[2, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "629_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031591", "code": "def Split(list): \r\n    ev_li = [] \r\n    for i in list: \r\n        if (i % 2 == 0): \r\n            ev_li.append(i)  \r\n    return ev_li", "entry_point": "Split", "input": "[4, 5, 6, 7, 8, 0, 1]", "output": "[4, 6, 8, 0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "629_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031592", "code": "def Split(list): \r\n    ev_li = [] \r\n    for i in list: \r\n        if (i % 2 == 0): \r\n            ev_li.append(i)  \r\n    return ev_li", "entry_point": "Split", "input": "[8, 12, 15, 19]", "output": "[8, 12]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "629_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031593", "code": "def adjac(ele, sub = []): \r\n  if not ele: \r\n     yield sub \r\n  else: \r\n     yield from [idx for j in range(ele[0] - 1, ele[0] + 2) \r\n                for idx in adjac(ele[1:], sub + [j])] \r\ndef get_coordinates(test_tup):\r\n  res = list(adjac(test_tup))\r\n  return (res) ", "entry_point": "get_coordinates", "input": "(3, 4)", "output": "[[2, 3], [2, 4], [2, 5], [3, 3], [3, 4], [3, 5], [4, 3], [4, 4], [4, 5]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "630_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031594", "code": "def adjac(ele, sub = []): \r\n  if not ele: \r\n     yield sub \r\n  else: \r\n     yield from [idx for j in range(ele[0] - 1, ele[0] + 2) \r\n                for idx in adjac(ele[1:], sub + [j])] \r\ndef get_coordinates(test_tup):\r\n  res = list(adjac(test_tup))\r\n  return (res) ", "entry_point": "get_coordinates", "input": "(4, 5)", "output": "[[3, 4], [3, 5], [3, 6], [4, 4], [4, 5], [4, 6], [5, 4], [5, 5], [5, 6]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "630_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031595", "code": "def adjac(ele, sub = []): \r\n  if not ele: \r\n     yield sub \r\n  else: \r\n     yield from [idx for j in range(ele[0] - 1, ele[0] + 2) \r\n                for idx in adjac(ele[1:], sub + [j])] \r\ndef get_coordinates(test_tup):\r\n  res = list(adjac(test_tup))\r\n  return (res) ", "entry_point": "get_coordinates", "input": "(5, 6)", "output": "[[4, 5], [4, 6], [4, 7], [5, 5], [5, 6], [5, 7], [6, 5], [6, 6], [6, 7]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "630_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031596", "code": "import re\r\ntext = 'Python Exercises'\r\ndef replace_spaces(text):\r\n  text =text.replace (\" \", \"_\")\r\n  return (text)\r\n  text =text.replace (\"_\", \" \")\r\n  return (text)", "entry_point": "replace_spaces", "input": "'Jumanji The Jungle'", "output": "'Jumanji_The_Jungle'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "631_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031597", "code": "import re\r\ntext = 'Python Exercises'\r\ndef replace_spaces(text):\r\n  text =text.replace (\" \", \"_\")\r\n  return (text)\r\n  text =text.replace (\"_\", \" \")\r\n  return (text)", "entry_point": "replace_spaces", "input": "'The Avengers'", "output": "'The_Avengers'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "631_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031598", "code": "import re\r\ntext = 'Python Exercises'\r\ndef replace_spaces(text):\r\n  text =text.replace (\" \", \"_\")\r\n  return (text)\r\n  text =text.replace (\"_\", \" \")\r\n  return (text)", "entry_point": "replace_spaces", "input": "'Fast and Furious'", "output": "'Fast_and_Furious'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "631_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031599", "code": "def move_zero(num_list):\r\n    a = [0 for i in range(num_list.count(0))]\r\n    x = [ i for i in num_list if i != 0]\r\n    x.extend(a)\r\n    return (x)", "entry_point": "move_zero", "input": "[1, 0, 2, 0, 3, 4]", "output": "[1, 2, 3, 4, 0, 0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "632_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031600", "code": "def move_zero(num_list):\r\n    a = [0 for i in range(num_list.count(0))]\r\n    x = [ i for i in num_list if i != 0]\r\n    x.extend(a)\r\n    return (x)", "entry_point": "move_zero", "input": "[2, 3, 2, 0, 0, 4, 0, 5, 0]", "output": "[2, 3, 2, 4, 5, 0, 0, 0, 0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "632_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031601", "code": "def move_zero(num_list):\r\n    a = [0 for i in range(num_list.count(0))]\r\n    x = [ i for i in num_list if i != 0]\r\n    x.extend(a)\r\n    return (x)", "entry_point": "move_zero", "input": "[0, 1, 0, 1, 1]", "output": "[1, 1, 1, 0, 0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "632_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031602", "code": "def pair_OR_Sum(arr,n) : \r\n    ans = 0 \r\n    for i in range(0,n) :    \r\n        for j in range(i + 1,n) :   \r\n            ans = ans + (arr[i] ^ arr[j])          \r\n    return ans ", "entry_point": "pair_OR_Sum", "input": "[5, 9, 7, 6], 4", "output": "47", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "633_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031603", "code": "def pair_OR_Sum(arr,n) : \r\n    ans = 0 \r\n    for i in range(0,n) :    \r\n        for j in range(i + 1,n) :   \r\n            ans = ans + (arr[i] ^ arr[j])          \r\n    return ans ", "entry_point": "pair_OR_Sum", "input": "[7, 3, 5], 3", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "633_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031604", "code": "def pair_OR_Sum(arr,n) : \r\n    ans = 0 \r\n    for i in range(0,n) :    \r\n        for j in range(i + 1,n) :   \r\n            ans = ans + (arr[i] ^ arr[j])          \r\n    return ans ", "entry_point": "pair_OR_Sum", "input": "[7, 3], 2", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "633_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031605", "code": "def even_Power_Sum(n): \r\n    sum = 0; \r\n    for i in range(1,n + 1): \r\n        j = 2*i; \r\n        sum = sum + (j*j*j*j); \r\n    return sum; ", "entry_point": "even_Power_Sum", "input": "2", "output": "272", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "634_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031606", "code": "def even_Power_Sum(n): \r\n    sum = 0; \r\n    for i in range(1,n + 1): \r\n        j = 2*i; \r\n        sum = sum + (j*j*j*j); \r\n    return sum; ", "entry_point": "even_Power_Sum", "input": "3", "output": "1568", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "634_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031607", "code": "def even_Power_Sum(n): \r\n    sum = 0; \r\n    for i in range(1,n + 1): \r\n        j = 2*i; \r\n        sum = sum + (j*j*j*j); \r\n    return sum; ", "entry_point": "even_Power_Sum", "input": "4", "output": "5664", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "634_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031608", "code": "import heapq as hq\r\ndef heap_sort(iterable):\r\n    h = []\r\n    for value in iterable:\r\n        hq.heappush(h, value)\r\n    return [hq.heappop(h) for i in range(len(h))]", "entry_point": "heap_sort", "input": "[1, 3, 5, 7, 9, 2, 4, 6, 8, 0]", "output": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "635_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031609", "code": "import heapq as hq\r\ndef heap_sort(iterable):\r\n    h = []\r\n    for value in iterable:\r\n        hq.heappush(h, value)\r\n    return [hq.heappop(h) for i in range(len(h))]", "entry_point": "heap_sort", "input": "[25, 35, 22, 85, 14, 65, 75, 25, 58]", "output": "[14, 22, 25, 25, 35, 58, 65, 75, 85]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "635_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031610", "code": "import heapq as hq\r\ndef heap_sort(iterable):\r\n    h = []\r\n    for value in iterable:\r\n        hq.heappush(h, value)\r\n    return [hq.heappop(h) for i in range(len(h))]", "entry_point": "heap_sort", "input": "[7, 1, 9, 5]", "output": "[1, 5, 7, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "635_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031611", "code": "def Check_Solution(a,b,c): \r\n    if (a == c): \r\n        return (\"Yes\"); \r\n    else: \r\n        return (\"No\"); ", "entry_point": "Check_Solution", "input": "2, 0, 2", "output": "'Yes'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "636_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031612", "code": "def Check_Solution(a,b,c): \r\n    if (a == c): \r\n        return (\"Yes\"); \r\n    else: \r\n        return (\"No\"); ", "entry_point": "Check_Solution", "input": "2, -5, 2", "output": "'Yes'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "636_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031613", "code": "def Check_Solution(a,b,c): \r\n    if (a == c): \r\n        return (\"Yes\"); \r\n    else: \r\n        return (\"No\"); ", "entry_point": "Check_Solution", "input": "1, 2, 3", "output": "'No'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "636_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031614", "code": "def noprofit_noloss(actual_cost,sale_amount): \r\n  if(sale_amount == actual_cost):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "noprofit_noloss", "input": "1500, 1200", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "637_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031615", "code": "def noprofit_noloss(actual_cost,sale_amount): \r\n  if(sale_amount == actual_cost):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "noprofit_noloss", "input": "100, 100", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "637_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031616", "code": "def noprofit_noloss(actual_cost,sale_amount): \r\n  if(sale_amount == actual_cost):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "noprofit_noloss", "input": "2000, 5000", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "637_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031617", "code": "import math\r\ndef wind_chill(v,t):\r\n windchill = 13.12 + 0.6215*t -  11.37*math.pow(v, 0.16) + 0.3965*t*math.pow(v, 0.16)\r\n return int(round(windchill, 0))", "entry_point": "wind_chill", "input": "120, 35", "output": "40", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "638_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031618", "code": "import math\r\ndef wind_chill(v,t):\r\n windchill = 13.12 + 0.6215*t -  11.37*math.pow(v, 0.16) + 0.3965*t*math.pow(v, 0.16)\r\n return int(round(windchill, 0))", "entry_point": "wind_chill", "input": "40, 70", "output": "86", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "638_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031619", "code": "import math\r\ndef wind_chill(v,t):\r\n windchill = 13.12 + 0.6215*t -  11.37*math.pow(v, 0.16) + 0.3965*t*math.pow(v, 0.16)\r\n return int(round(windchill, 0))", "entry_point": "wind_chill", "input": "10, 100", "output": "116", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "638_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031620", "code": "def sample_nam(sample_names):\r\n  sample_names=list(filter(lambda el:el[0].isupper() and el[1:].islower(),sample_names))\r\n  return len(''.join(sample_names))", "entry_point": "sample_nam", "input": "['sally', 'Dylan', 'rebecca', 'Diana', 'Joanne', 'keith']", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "639_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031621", "code": "def sample_nam(sample_names):\r\n  sample_names=list(filter(lambda el:el[0].isupper() and el[1:].islower(),sample_names))\r\n  return len(''.join(sample_names))", "entry_point": "sample_nam", "input": "['php', 'res', 'Python', 'abcd', 'Java', 'aaa']", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "639_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031622", "code": "def sample_nam(sample_names):\r\n  sample_names=list(filter(lambda el:el[0].isupper() and el[1:].islower(),sample_names))\r\n  return len(''.join(sample_names))", "entry_point": "sample_nam", "input": "['abcd', 'Python', 'abba', 'aba']", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "639_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031623", "code": "import re\r\ndef remove_parenthesis(items):\r\n for item in items:\r\n    return (re.sub(r\" ?\\([^)]+\\)\", \"\", item))", "entry_point": "remove_parenthesis", "input": "['python (chrome)']", "output": "'python'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "640_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031624", "code": "import re\r\ndef remove_parenthesis(items):\r\n for item in items:\r\n    return (re.sub(r\" ?\\([^)]+\\)\", \"\", item))", "entry_point": "remove_parenthesis", "input": "['string(.abc)']", "output": "'string'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "640_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031625", "code": "import re\r\ndef remove_parenthesis(items):\r\n for item in items:\r\n    return (re.sub(r\" ?\\([^)]+\\)\", \"\", item))", "entry_point": "remove_parenthesis", "input": "['alpha(num)']", "output": "'alpha'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "640_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031626", "code": "def is_nonagonal(n): \r\n\treturn int(n * (7 * n - 5) / 2) ", "entry_point": "is_nonagonal", "input": "10", "output": "325", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "641_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031627", "code": "def is_nonagonal(n): \r\n\treturn int(n * (7 * n - 5) / 2) ", "entry_point": "is_nonagonal", "input": "15", "output": "750", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "641_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031628", "code": "def is_nonagonal(n): \r\n\treturn int(n * (7 * n - 5) / 2) ", "entry_point": "is_nonagonal", "input": "18", "output": "1089", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "641_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031629", "code": "def remove_similar_row(test_list):\r\n  res = set(sorted([tuple(sorted(set(sub))) for sub in test_list]))\r\n  return (res) ", "entry_point": "remove_similar_row", "input": "[[(4, 5), (3, 2)], [(2, 2), (4, 6)], [(3, 2), (4, 5)]]", "output": "{((2, 2), (4, 6)), ((3, 2), (4, 5))}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "642_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031630", "code": "def remove_similar_row(test_list):\r\n  res = set(sorted([tuple(sorted(set(sub))) for sub in test_list]))\r\n  return (res) ", "entry_point": "remove_similar_row", "input": "[[(5, 6), (4, 3)], [(3, 3), (5, 7)], [(4, 3), (5, 6)]]", "output": "{((4, 3), (5, 6)), ((3, 3), (5, 7))}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "642_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031631", "code": "def remove_similar_row(test_list):\r\n  res = set(sorted([tuple(sorted(set(sub))) for sub in test_list]))\r\n  return (res) ", "entry_point": "remove_similar_row", "input": "[[(6, 7), (5, 4)], [(4, 4), (6, 8)], [(5, 4), (6, 7)]]", "output": "{((4, 4), (6, 8)), ((5, 4), (6, 7))}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "642_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031632", "code": "import re\r\ndef text_match_wordz_middle(text):\r\n        patterns = '\\Bz\\B'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_wordz_middle", "input": "'pythonzabc.'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "643_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031633", "code": "import re\r\ndef text_match_wordz_middle(text):\r\n        patterns = '\\Bz\\B'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_wordz_middle", "input": "'xyzabc.'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "643_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031634", "code": "import re\r\ndef text_match_wordz_middle(text):\r\n        patterns = '\\Bz\\B'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_wordz_middle", "input": "'  lang  .'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "643_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031635", "code": "def reverse_Array_Upto_K(input, k): \r\n  return (input[k-1::-1] + input[k:]) ", "entry_point": "reverse_Array_Upto_K", "input": "[1, 2, 3, 4, 5, 6], 4", "output": "[4, 3, 2, 1, 5, 6]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "644_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031636", "code": "def reverse_Array_Upto_K(input, k): \r\n  return (input[k-1::-1] + input[k:]) ", "entry_point": "reverse_Array_Upto_K", "input": "[4, 5, 6, 7], 2", "output": "[5, 4, 6, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "644_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031637", "code": "def reverse_Array_Upto_K(input, k): \r\n  return (input[k-1::-1] + input[k:]) ", "entry_point": "reverse_Array_Upto_K", "input": "[9, 8, 7, 6, 5], 3", "output": "[7, 8, 9, 6, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "644_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031638", "code": "def get_product(val) : \r\n\tres = 1\r\n\tfor ele in val: \r\n\t\tres *= ele \r\n\treturn res \r\ndef find_k_product(test_list, K):\r\n  res = get_product([sub[K] for sub in test_list])\r\n  return (res) ", "entry_point": "find_k_product", "input": "[(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2", "output": "665", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "645_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031639", "code": "def get_product(val) : \r\n\tres = 1\r\n\tfor ele in val: \r\n\t\tres *= ele \r\n\treturn res \r\ndef find_k_product(test_list, K):\r\n  res = get_product([sub[K] for sub in test_list])\r\n  return (res) ", "entry_point": "find_k_product", "input": "[(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1", "output": "280", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "645_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031640", "code": "def get_product(val) : \r\n\tres = 1\r\n\tfor ele in val: \r\n\t\tres *= ele \r\n\treturn res \r\ndef find_k_product(test_list, K):\r\n  res = get_product([sub[K] for sub in test_list])\r\n  return (res) ", "entry_point": "find_k_product", "input": "[(7, 8, 9), (3, 5, 7), (10, 11, 21)], 0", "output": "210", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "645_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031641", "code": "def No_of_cubes(N,K):\r\n    No = 0\r\n    No = (N - K + 1)\r\n    No = pow(No, 3)\r\n    return No", "entry_point": "No_of_cubes", "input": "2, 1", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "646_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031642", "code": "def No_of_cubes(N,K):\r\n    No = 0\r\n    No = (N - K + 1)\r\n    No = pow(No, 3)\r\n    return No", "entry_point": "No_of_cubes", "input": "5, 2", "output": "64", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "646_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031643", "code": "def No_of_cubes(N,K):\r\n    No = 0\r\n    No = (N - K + 1)\r\n    No = pow(No, 3)\r\n    return No", "entry_point": "No_of_cubes", "input": "1, 1", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "646_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031644", "code": "import re\r\ndef split_upperstring(text):\r\n return (re.findall('[A-Z][^A-Z]*', text))", "entry_point": "split_upperstring", "input": "'PythonProgramLanguage'", "output": "['Python', 'Program', 'Language']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "647_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031645", "code": "import re\r\ndef split_upperstring(text):\r\n return (re.findall('[A-Z][^A-Z]*', text))", "entry_point": "split_upperstring", "input": "'PythonProgram'", "output": "['Python', 'Program']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "647_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031646", "code": "import re\r\ndef split_upperstring(text):\r\n return (re.findall('[A-Z][^A-Z]*', text))", "entry_point": "split_upperstring", "input": "'ProgrammingLanguage'", "output": "['Programming', 'Language']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "647_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031647", "code": "from itertools import zip_longest, chain, tee\r\ndef exchange_elements(lst):\r\n    lst1, lst2 = tee(iter(lst), 2)\r\n    return list(chain.from_iterable(zip_longest(lst[1::2], lst[::2])))", "entry_point": "exchange_elements", "input": "[0, 1, 2, 3, 4, 5]", "output": "[1, 0, 3, 2, 5, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "648_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031648", "code": "from itertools import zip_longest, chain, tee\r\ndef exchange_elements(lst):\r\n    lst1, lst2 = tee(iter(lst), 2)\r\n    return list(chain.from_iterable(zip_longest(lst[1::2], lst[::2])))", "entry_point": "exchange_elements", "input": "[5, 6, 7, 8, 9, 10]", "output": "[6, 5, 8, 7, 10, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "648_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031649", "code": "from itertools import zip_longest, chain, tee\r\ndef exchange_elements(lst):\r\n    lst1, lst2 = tee(iter(lst), 2)\r\n    return list(chain.from_iterable(zip_longest(lst[1::2], lst[::2])))", "entry_point": "exchange_elements", "input": "[25, 35, 45, 55, 75, 95]", "output": "[35, 25, 55, 45, 95, 75]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "648_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031650", "code": "def sum_Range_list(nums, m, n):                                                                                                                                                                                                \r\n    sum_range = 0                                                                                                                                                                                                         \r\n    for i in range(m, n+1, 1):                                                                                                                                                                                        \r\n        sum_range += nums[i]                                                                                                                                                                                                  \r\n    return sum_range   ", "entry_point": "sum_Range_list", "input": "[2, 1, 5, 6, 8, 3, 4, 9, 10, 11, 8, 12], 8, 10", "output": "29", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "649_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031651", "code": "def sum_Range_list(nums, m, n):                                                                                                                                                                                                \r\n    sum_range = 0                                                                                                                                                                                                         \r\n    for i in range(m, n+1, 1):                                                                                                                                                                                        \r\n        sum_range += nums[i]                                                                                                                                                                                                  \r\n    return sum_range   ", "entry_point": "sum_Range_list", "input": "[1, 2, 3, 4, 5], 1, 2", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "649_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031652", "code": "def sum_Range_list(nums, m, n):                                                                                                                                                                                                \r\n    sum_range = 0                                                                                                                                                                                                         \r\n    for i in range(m, n+1, 1):                                                                                                                                                                                        \r\n        sum_range += nums[i]                                                                                                                                                                                                  \r\n    return sum_range   ", "entry_point": "sum_Range_list", "input": "[1, 0, 1, 2, 5, 6], 4, 5", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "649_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031653", "code": "def are_Equal(arr1,arr2,n,m):\r\n    if (n != m):\r\n        return False\r\n    arr1.sort()\r\n    arr2.sort()\r\n    for i in range(0,n - 1):\r\n        if (arr1[i] != arr2[i]):\r\n            return False\r\n    return True", "entry_point": "are_Equal", "input": "[1, 2, 3], [3, 2, 1], 3, 3", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "650_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031654", "code": "def are_Equal(arr1,arr2,n,m):\r\n    if (n != m):\r\n        return False\r\n    arr1.sort()\r\n    arr2.sort()\r\n    for i in range(0,n - 1):\r\n        if (arr1[i] != arr2[i]):\r\n            return False\r\n    return True", "entry_point": "are_Equal", "input": "[1, 1, 1], [2, 2, 2], 3, 3", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "650_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031655", "code": "def are_Equal(arr1,arr2,n,m):\r\n    if (n != m):\r\n        return False\r\n    arr1.sort()\r\n    arr2.sort()\r\n    for i in range(0,n - 1):\r\n        if (arr1[i] != arr2[i]):\r\n            return False\r\n    return True", "entry_point": "are_Equal", "input": "[8, 9], [4, 5, 6], 2, 3", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "650_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031656", "code": "def check_subset(test_tup1, test_tup2):\r\n  res = set(test_tup2).issubset(test_tup1)\r\n  return (res) ", "entry_point": "check_subset", "input": "(10, 4, 5, 6), (5, 10)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "651_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031657", "code": "def check_subset(test_tup1, test_tup2):\r\n  res = set(test_tup2).issubset(test_tup1)\r\n  return (res) ", "entry_point": "check_subset", "input": "(1, 2, 3, 4), (5, 6)", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "651_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031658", "code": "def check_subset(test_tup1, test_tup2):\r\n  res = set(test_tup2).issubset(test_tup1)\r\n  return (res) ", "entry_point": "check_subset", "input": "(7, 8, 9, 10), (10, 8)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "651_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031659", "code": "def matrix_to_list(test_list):\r\n  temp = [ele for sub in test_list for ele in sub]\r\n  res = list(zip(*temp))\r\n  return (str(res))", "entry_point": "matrix_to_list", "input": "[[(4, 5), (7, 8)], [(10, 13), (18, 17)], [(0, 4), (10, 1)]]", "output": "'[(4, 7, 10, 18, 0, 10), (5, 8, 13, 17, 4, 1)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "652_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031660", "code": "def matrix_to_list(test_list):\r\n  temp = [ele for sub in test_list for ele in sub]\r\n  res = list(zip(*temp))\r\n  return (str(res))", "entry_point": "matrix_to_list", "input": "[[(5, 6), (8, 9)], [(11, 14), (19, 18)], [(1, 5), (11, 2)]]", "output": "'[(5, 8, 11, 19, 1, 11), (6, 9, 14, 18, 5, 2)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "652_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031661", "code": "def matrix_to_list(test_list):\r\n  temp = [ele for sub in test_list for ele in sub]\r\n  res = list(zip(*temp))\r\n  return (str(res))", "entry_point": "matrix_to_list", "input": "[[(6, 7), (9, 10)], [(12, 15), (20, 21)], [(23, 7), (15, 8)]]", "output": "'[(6, 9, 12, 20, 23, 15), (7, 10, 15, 21, 7, 8)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "652_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031662", "code": "def rectangle_perimeter(l,b):\r\n  perimeter=2*(l+b)\r\n  return perimeter", "entry_point": "rectangle_perimeter", "input": "10, 20", "output": "60", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "654_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031663", "code": "def rectangle_perimeter(l,b):\r\n  perimeter=2*(l+b)\r\n  return perimeter", "entry_point": "rectangle_perimeter", "input": "10, 5", "output": "30", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "654_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031664", "code": "def rectangle_perimeter(l,b):\r\n  perimeter=2*(l+b)\r\n  return perimeter", "entry_point": "rectangle_perimeter", "input": "4, 2", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "654_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031665", "code": "def fifth_Power_Sum(n) : \r\n    sm = 0 \r\n    for i in range(1,n+1) : \r\n        sm = sm + (i*i*i*i*i) \r\n    return sm ", "entry_point": "fifth_Power_Sum", "input": "2", "output": "33", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "655_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031666", "code": "def fifth_Power_Sum(n) : \r\n    sm = 0 \r\n    for i in range(1,n+1) : \r\n        sm = sm + (i*i*i*i*i) \r\n    return sm ", "entry_point": "fifth_Power_Sum", "input": "4", "output": "1300", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "655_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031667", "code": "def fifth_Power_Sum(n) : \r\n    sm = 0 \r\n    for i in range(1,n+1) : \r\n        sm = sm + (i*i*i*i*i) \r\n    return sm ", "entry_point": "fifth_Power_Sum", "input": "3", "output": "276", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "655_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031668", "code": "def find_Min_Sum(a,b,n): \r\n    a.sort() \r\n    b.sort() \r\n    sum = 0  \r\n    for i in range(n): \r\n        sum = sum + abs(a[i] - b[i]) \r\n    return sum", "entry_point": "find_Min_Sum", "input": "[3, 2, 1], [2, 1, 3], 3", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "656_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031669", "code": "def find_Min_Sum(a,b,n): \r\n    a.sort() \r\n    b.sort() \r\n    sum = 0  \r\n    for i in range(n): \r\n        sum = sum + abs(a[i] - b[i]) \r\n    return sum", "entry_point": "find_Min_Sum", "input": "[1, 2, 3], [4, 5, 6], 3", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "656_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031670", "code": "def find_Min_Sum(a,b,n): \r\n    a.sort() \r\n    b.sort() \r\n    sum = 0  \r\n    for i in range(n): \r\n        sum = sum + abs(a[i] - b[i]) \r\n    return sum", "entry_point": "find_Min_Sum", "input": "[4, 1, 8, 7], [2, 3, 6, 5], 4", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "656_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031671", "code": "import math \r\ndef first_Digit(n) : \r\n    fact = 1\r\n    for i in range(2,n + 1) : \r\n        fact = fact * i \r\n        while (fact % 10 == 0) :  \r\n            fact = int(fact / 10) \r\n    while (fact >= 10) : \r\n        fact = int(fact / 10) \r\n    return math.floor(fact) ", "entry_point": "first_Digit", "input": "5", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "657_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031672", "code": "import math \r\ndef first_Digit(n) : \r\n    fact = 1\r\n    for i in range(2,n + 1) : \r\n        fact = fact * i \r\n        while (fact % 10 == 0) :  \r\n            fact = int(fact / 10) \r\n    while (fact >= 10) : \r\n        fact = int(fact / 10) \r\n    return math.floor(fact) ", "entry_point": "first_Digit", "input": "10", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "657_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031673", "code": "import math \r\ndef first_Digit(n) : \r\n    fact = 1\r\n    for i in range(2,n + 1) : \r\n        fact = fact * i \r\n        while (fact % 10 == 0) :  \r\n            fact = int(fact / 10) \r\n    while (fact >= 10) : \r\n        fact = int(fact / 10) \r\n    return math.floor(fact) ", "entry_point": "first_Digit", "input": "7", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "657_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031674", "code": "def max_occurrences(list1):\r\n    max_val = 0\r\n    result = list1[0] \r\n    for i in list1:\r\n        occu = list1.count(i)\r\n        if occu > max_val:\r\n            max_val = occu\r\n            result = i \r\n    return result", "entry_point": "max_occurrences", "input": "[2, 3, 8, 4, 7, 9, 8, 2, 6, 5, 1, 6, 1, 2, 3, 4, 6, 9, 1, 2]", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "658_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031675", "code": "def max_occurrences(list1):\r\n    max_val = 0\r\n    result = list1[0] \r\n    for i in list1:\r\n        occu = list1.count(i)\r\n        if occu > max_val:\r\n            max_val = occu\r\n            result = i \r\n    return result", "entry_point": "max_occurrences", "input": "[1, 3, 5, 7, 1, 3, 13, 15, 17, 5, 7, 9, 1, 11]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "658_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031676", "code": "def max_occurrences(list1):\r\n    max_val = 0\r\n    result = list1[0] \r\n    for i in list1:\r\n        occu = list1.count(i)\r\n        if occu > max_val:\r\n            max_val = occu\r\n            result = i \r\n    return result", "entry_point": "max_occurrences", "input": "[1, 2, 3, 2, 4, 5, 1, 1, 1]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "658_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031677", "code": "def Repeat(x): \r\n    _size = len(x) \r\n    repeated = [] \r\n    for i in range(_size): \r\n        k = i + 1\r\n        for j in range(k, _size): \r\n            if x[i] == x[j] and x[i] not in repeated: \r\n                repeated.append(x[i]) \r\n    return repeated ", "entry_point": "Repeat", "input": "[10, 20, 30, 20, 20, 30, 40, 50, -20, 60, 60, -20, -20]", "output": "[20, 30, -20, 60]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "659_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031678", "code": "def Repeat(x): \r\n    _size = len(x) \r\n    repeated = [] \r\n    for i in range(_size): \r\n        k = i + 1\r\n        for j in range(k, _size): \r\n            if x[i] == x[j] and x[i] not in repeated: \r\n                repeated.append(x[i]) \r\n    return repeated ", "entry_point": "Repeat", "input": "[-1, 1, -1, 8]", "output": "[-1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "659_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031679", "code": "def Repeat(x): \r\n    _size = len(x) \r\n    repeated = [] \r\n    for i in range(_size): \r\n        k = i + 1\r\n        for j in range(k, _size): \r\n            if x[i] == x[j] and x[i] not in repeated: \r\n                repeated.append(x[i]) \r\n    return repeated ", "entry_point": "Repeat", "input": "[1, 2, 3, 1, 2]", "output": "[1, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "659_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031680", "code": "def find_Points(l1,r1,l2,r2): \r\n    x = min(l1,l2) if (l1 != l2) else -1\r\n    y = max(r1,r2) if (r1 != r2) else -1\r\n    return (x,y)", "entry_point": "find_Points", "input": "5, 10, 1, 5", "output": "(1, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "660_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031681", "code": "def find_Points(l1,r1,l2,r2): \r\n    x = min(l1,l2) if (l1 != l2) else -1\r\n    y = max(r1,r2) if (r1 != r2) else -1\r\n    return (x,y)", "entry_point": "find_Points", "input": "3, 5, 7, 9", "output": "(3, 9)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "660_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031682", "code": "def find_Points(l1,r1,l2,r2): \r\n    x = min(l1,l2) if (l1 != l2) else -1\r\n    y = max(r1,r2) if (r1 != r2) else -1\r\n    return (x,y)", "entry_point": "find_Points", "input": "1, 5, 2, 8", "output": "(1, 8)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "660_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031683", "code": "def max_sum_of_three_consecutive(arr, n): \r\n\tsum = [0 for k in range(n)] \r\n\tif n >= 1: \r\n\t\tsum[0] = arr[0] \r\n\tif n >= 2: \r\n\t\tsum[1] = arr[0] + arr[1] \r\n\tif n > 2: \r\n\t\tsum[2] = max(sum[1], max(arr[1] + arr[2], arr[0] + arr[2])) \r\n\tfor i in range(3, n): \r\n\t\tsum[i] = max(max(sum[i-1], sum[i-2] + arr[i]), arr[i] + arr[i-1] + sum[i-3]) \r\n\treturn sum[n-1]", "entry_point": "max_sum_of_three_consecutive", "input": "[100, 1000, 100, 1000, 1], 5", "output": "2101", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "661_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031684", "code": "def max_sum_of_three_consecutive(arr, n): \r\n\tsum = [0 for k in range(n)] \r\n\tif n >= 1: \r\n\t\tsum[0] = arr[0] \r\n\tif n >= 2: \r\n\t\tsum[1] = arr[0] + arr[1] \r\n\tif n > 2: \r\n\t\tsum[2] = max(sum[1], max(arr[1] + arr[2], arr[0] + arr[2])) \r\n\tfor i in range(3, n): \r\n\t\tsum[i] = max(max(sum[i-1], sum[i-2] + arr[i]), arr[i] + arr[i-1] + sum[i-3]) \r\n\treturn sum[n-1]", "entry_point": "max_sum_of_three_consecutive", "input": "[3000, 2000, 1000, 3, 10], 5", "output": "5013", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "661_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031685", "code": "def max_sum_of_three_consecutive(arr, n): \r\n\tsum = [0 for k in range(n)] \r\n\tif n >= 1: \r\n\t\tsum[0] = arr[0] \r\n\tif n >= 2: \r\n\t\tsum[1] = arr[0] + arr[1] \r\n\tif n > 2: \r\n\t\tsum[2] = max(sum[1], max(arr[1] + arr[2], arr[0] + arr[2])) \r\n\tfor i in range(3, n): \r\n\t\tsum[i] = max(max(sum[i-1], sum[i-2] + arr[i]), arr[i] + arr[i-1] + sum[i-3]) \r\n\treturn sum[n-1]", "entry_point": "max_sum_of_three_consecutive", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 8", "output": "27", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "661_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031686", "code": "def sorted_dict(dict1):\r\n  sorted_dict = {x: sorted(y) for x, y in dict1.items()}\r\n  return sorted_dict", "entry_point": "sorted_dict", "input": "{'n1': [2, 3, 1], 'n2': [5, 1, 2], 'n3': [3, 2, 4]}", "output": "{'n1': [1, 2, 3], 'n2': [1, 2, 5], 'n3': [2, 3, 4]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "662_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031687", "code": "def sorted_dict(dict1):\r\n  sorted_dict = {x: sorted(y) for x, y in dict1.items()}\r\n  return sorted_dict", "entry_point": "sorted_dict", "input": "{'n1': [25, 37, 41], 'n2': [41, 54, 63], 'n3': [29, 38, 93]}", "output": "{'n1': [25, 37, 41], 'n2': [41, 54, 63], 'n3': [29, 38, 93]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "662_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031688", "code": "def sorted_dict(dict1):\r\n  sorted_dict = {x: sorted(y) for x, y in dict1.items()}\r\n  return sorted_dict", "entry_point": "sorted_dict", "input": "{'n1': [58, 44, 56], 'n2': [91, 34, 58], 'n3': [100, 200, 300]}", "output": "{'n1': [44, 56, 58], 'n2': [34, 58, 91], 'n3': [100, 200, 300]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "662_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031689", "code": "import sys \r\ndef find_max_val(n, x, y): \r\n\tans = -sys.maxsize \r\n\tfor k in range(n + 1): \r\n\t\tif (k % x == y): \r\n\t\t\tans = max(ans, k) \r\n\treturn (ans if (ans >= 0 and\r\n\t\t\t\t\tans <= n) else -1) ", "entry_point": "find_max_val", "input": "15, 10, 5", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "663_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031690", "code": "import sys \r\ndef find_max_val(n, x, y): \r\n\tans = -sys.maxsize \r\n\tfor k in range(n + 1): \r\n\t\tif (k % x == y): \r\n\t\t\tans = max(ans, k) \r\n\treturn (ans if (ans >= 0 and\r\n\t\t\t\t\tans <= n) else -1) ", "entry_point": "find_max_val", "input": "187, 10, 5", "output": "185", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "663_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031691", "code": "import sys \r\ndef find_max_val(n, x, y): \r\n\tans = -sys.maxsize \r\n\tfor k in range(n + 1): \r\n\t\tif (k % x == y): \r\n\t\t\tans = max(ans, k) \r\n\treturn (ans if (ans >= 0 and\r\n\t\t\t\t\tans <= n) else -1) ", "entry_point": "find_max_val", "input": "16, 11, 1", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "663_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031692", "code": "def average_Even(n) : \r\n    if (n% 2!= 0) : \r\n        return (\"Invalid Input\") \r\n        return -1  \r\n    sm = 0\r\n    count = 0\r\n    while (n>= 2) : \r\n        count = count+1\r\n        sm = sm+n \r\n        n = n-2\r\n    return sm // count ", "entry_point": "average_Even", "input": "2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "664_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031693", "code": "def average_Even(n) : \r\n    if (n% 2!= 0) : \r\n        return (\"Invalid Input\") \r\n        return -1  \r\n    sm = 0\r\n    count = 0\r\n    while (n>= 2) : \r\n        count = count+1\r\n        sm = sm+n \r\n        n = n-2\r\n    return sm // count ", "entry_point": "average_Even", "input": "4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "664_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031694", "code": "def average_Even(n) : \r\n    if (n% 2!= 0) : \r\n        return (\"Invalid Input\") \r\n        return -1  \r\n    sm = 0\r\n    count = 0\r\n    while (n>= 2) : \r\n        count = count+1\r\n        sm = sm+n \r\n        n = n-2\r\n    return sm // count ", "entry_point": "average_Even", "input": "100", "output": "51", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "664_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031695", "code": "def move_last(num_list):\r\n    a = [num_list[0] for i in range(num_list.count(num_list[0]))]\r\n    x = [ i for i in num_list if i != num_list[0]]\r\n    x.extend(a)\r\n    return (x)", "entry_point": "move_last", "input": "[1, 2, 3, 4]", "output": "[2, 3, 4, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "665_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031696", "code": "def move_last(num_list):\r\n    a = [num_list[0] for i in range(num_list.count(num_list[0]))]\r\n    x = [ i for i in num_list if i != num_list[0]]\r\n    x.extend(a)\r\n    return (x)", "entry_point": "move_last", "input": "[2, 3, 4, 1, 5, 0]", "output": "[3, 4, 1, 5, 0, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "665_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031697", "code": "def move_last(num_list):\r\n    a = [num_list[0] for i in range(num_list.count(num_list[0]))]\r\n    x = [ i for i in num_list if i != num_list[0]]\r\n    x.extend(a)\r\n    return (x)", "entry_point": "move_last", "input": "[5, 4, 3, 2, 1]", "output": "[4, 3, 2, 1, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "665_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031698", "code": "def count_char(string,char):\r\n count = 0\r\n for i in range(len(string)):\r\n    if(string[i] == char):\r\n        count = count + 1\r\n return count", "entry_point": "count_char", "input": "'Python', 'o'", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "666_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031699", "code": "def count_char(string,char):\r\n count = 0\r\n for i in range(len(string)):\r\n    if(string[i] == char):\r\n        count = count + 1\r\n return count", "entry_point": "count_char", "input": "'little', 't'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "666_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031700", "code": "def count_char(string,char):\r\n count = 0\r\n for i in range(len(string)):\r\n    if(string[i] == char):\r\n        count = count + 1\r\n return count", "entry_point": "count_char", "input": "'assert', 's'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "666_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031701", "code": "def Check_Vow(string, vowels): \r\n    final = [each for each in string if each in vowels] \r\n    return(len(final)) \r\n", "entry_point": "Check_Vow", "input": "'corner', 'AaEeIiOoUu'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "667_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031702", "code": "def Check_Vow(string, vowels): \r\n    final = [each for each in string if each in vowels] \r\n    return(len(final)) \r\n", "entry_point": "Check_Vow", "input": "'valid', 'AaEeIiOoUu'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "667_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031703", "code": "def Check_Vow(string, vowels): \r\n    final = [each for each in string if each in vowels] \r\n    return(len(final)) \r\n", "entry_point": "Check_Vow", "input": "'true', 'AaEeIiOoUu'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "667_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031704", "code": "import re \r\ndef replace(string, char): \r\n    pattern = char + '{2,}'\r\n    string = re.sub(pattern, char, string) \r\n    return string ", "entry_point": "replace", "input": "'peep', 'e'", "output": "'pep'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "668_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031705", "code": "import re \r\ndef replace(string, char): \r\n    pattern = char + '{2,}'\r\n    string = re.sub(pattern, char, string) \r\n    return string ", "entry_point": "replace", "input": "'Greek', 'e'", "output": "'Grek'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "668_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031706", "code": "import re \r\ndef replace(string, char): \r\n    pattern = char + '{2,}'\r\n    string = re.sub(pattern, char, string) \r\n    return string ", "entry_point": "replace", "input": "'Moon', 'o'", "output": "'Mon'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "668_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031707", "code": "import re \r\nregex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$'''\r\ndef check_IP(Ip): \r\n\tif(re.search(regex, Ip)): \r\n\t\treturn (\"Valid IP address\") \r\n\telse: \r\n\t\treturn (\"Invalid IP address\") ", "entry_point": "check_IP", "input": "'192.168.0.1'", "output": "'Valid IP address'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "669_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031708", "code": "import re \r\nregex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$'''\r\ndef check_IP(Ip): \r\n\tif(re.search(regex, Ip)): \r\n\t\treturn (\"Valid IP address\") \r\n\telse: \r\n\t\treturn (\"Invalid IP address\") ", "entry_point": "check_IP", "input": "'110.234.52.124'", "output": "'Valid IP address'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "669_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031709", "code": "import re \r\nregex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\.( \r\n\t\t\t25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$'''\r\ndef check_IP(Ip): \r\n\tif(re.search(regex, Ip)): \r\n\t\treturn (\"Valid IP address\") \r\n\telse: \r\n\t\treturn (\"Invalid IP address\") ", "entry_point": "check_IP", "input": "'366.1.2.2'", "output": "'Invalid IP address'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "669_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031710", "code": "def decreasing_trend(nums):\r\n    if (sorted(nums)== nums):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "decreasing_trend", "input": "[-4, -3, -2, -1]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "670_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031711", "code": "def decreasing_trend(nums):\r\n    if (sorted(nums)== nums):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "decreasing_trend", "input": "[1, 2, 3]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "670_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031712", "code": "def decreasing_trend(nums):\r\n    if (sorted(nums)== nums):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "decreasing_trend", "input": "[3, 2, 1]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "670_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031713", "code": "import math \r\ndef get_Pos_Of_Right_most_Set_Bit(n): \r\n    return int(math.log2(n&-n)+1)   \r\ndef set_Right_most_Unset_Bit(n): \r\n    if (n == 0): \r\n        return 1\r\n    if ((n & (n + 1)) == 0):     \r\n        return n \r\n    pos = get_Pos_Of_Right_most_Set_Bit(~n)      \r\n    return ((1 << (pos - 1)) | n) ", "entry_point": "set_Right_most_Unset_Bit", "input": "21", "output": "23", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "671_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031714", "code": "import math \r\ndef get_Pos_Of_Right_most_Set_Bit(n): \r\n    return int(math.log2(n&-n)+1)   \r\ndef set_Right_most_Unset_Bit(n): \r\n    if (n == 0): \r\n        return 1\r\n    if ((n & (n + 1)) == 0):     \r\n        return n \r\n    pos = get_Pos_Of_Right_most_Set_Bit(~n)      \r\n    return ((1 << (pos - 1)) | n) ", "entry_point": "set_Right_most_Unset_Bit", "input": "11", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "671_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031715", "code": "import math \r\ndef get_Pos_Of_Right_most_Set_Bit(n): \r\n    return int(math.log2(n&-n)+1)   \r\ndef set_Right_most_Unset_Bit(n): \r\n    if (n == 0): \r\n        return 1\r\n    if ((n & (n + 1)) == 0):     \r\n        return n \r\n    pos = get_Pos_Of_Right_most_Set_Bit(~n)      \r\n    return ((1 << (pos - 1)) | n) ", "entry_point": "set_Right_most_Unset_Bit", "input": "15", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "671_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031716", "code": "def max_of_three(num1,num2,num3): \r\n    if (num1 >= num2) and (num1 >= num3):\r\n       lnum = num1\r\n    elif (num2 >= num1) and (num2 >= num3):\r\n       lnum = num2\r\n    else:\r\n       lnum = num3\r\n    return lnum", "entry_point": "max_of_three", "input": "10, 20, 30", "output": "30", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "672_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031717", "code": "def max_of_three(num1,num2,num3): \r\n    if (num1 >= num2) and (num1 >= num3):\r\n       lnum = num1\r\n    elif (num2 >= num1) and (num2 >= num3):\r\n       lnum = num2\r\n    else:\r\n       lnum = num3\r\n    return lnum", "entry_point": "max_of_three", "input": "55, 47, 39", "output": "55", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "672_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031718", "code": "def max_of_three(num1,num2,num3): \r\n    if (num1 >= num2) and (num1 >= num3):\r\n       lnum = num1\r\n    elif (num2 >= num1) and (num2 >= num3):\r\n       lnum = num2\r\n    else:\r\n       lnum = num3\r\n    return lnum", "entry_point": "max_of_three", "input": "10, 49, 30", "output": "49", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "672_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031719", "code": "def convert(list): \r\n    s = [str(i) for i in list] \r\n    res = int(\"\".join(s))  \r\n    return (res) ", "entry_point": "convert", "input": "[1, 2, 3]", "output": "123", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "673_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031720", "code": "def convert(list): \r\n    s = [str(i) for i in list] \r\n    res = int(\"\".join(s))  \r\n    return (res) ", "entry_point": "convert", "input": "[4, 5, 6]", "output": "456", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "673_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031721", "code": "def convert(list): \r\n    s = [str(i) for i in list] \r\n    res = int(\"\".join(s))  \r\n    return (res) ", "entry_point": "convert", "input": "[7, 8, 9]", "output": "789", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "673_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031722", "code": "from collections import OrderedDict\r\ndef remove_duplicate(string):\r\n  result = ' '.join(OrderedDict((w,w) for w in string.split()).keys())\r\n  return result", "entry_point": "remove_duplicate", "input": "'Python Exercises Practice Solution Exercises'", "output": "'Python Exercises Practice Solution'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "674_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031723", "code": "from collections import OrderedDict\r\ndef remove_duplicate(string):\r\n  result = ' '.join(OrderedDict((w,w) for w in string.split()).keys())\r\n  return result", "entry_point": "remove_duplicate", "input": "'Python Exercises Practice Solution Python'", "output": "'Python Exercises Practice Solution'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "674_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031724", "code": "from collections import OrderedDict\r\ndef remove_duplicate(string):\r\n  result = ' '.join(OrderedDict((w,w) for w in string.split()).keys())\r\n  return result", "entry_point": "remove_duplicate", "input": "'Python Exercises Practice Solution Practice'", "output": "'Python Exercises Practice Solution'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "674_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031725", "code": "def sum_nums(x, y,m,n):\r\n    sum_nums= x + y\r\n    if sum_nums in range(m, n):\r\n        return 20\r\n    else:\r\n        return sum_nums", "entry_point": "sum_nums", "input": "2, 10, 11, 20", "output": "20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "675_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031726", "code": "def sum_nums(x, y,m,n):\r\n    sum_nums= x + y\r\n    if sum_nums in range(m, n):\r\n        return 20\r\n    else:\r\n        return sum_nums", "entry_point": "sum_nums", "input": "15, 17, 1, 10", "output": "32", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "675_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031727", "code": "def sum_nums(x, y,m,n):\r\n    sum_nums= x + y\r\n    if sum_nums in range(m, n):\r\n        return 20\r\n    else:\r\n        return sum_nums", "entry_point": "sum_nums", "input": "10, 15, 5, 30", "output": "20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "675_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031728", "code": "import re\r\ndef remove_extra_char(text1):\r\n  pattern = re.compile('[\\W_]+')\r\n  return (pattern.sub('', text1))", "entry_point": "remove_extra_char", "input": "'**//Google Android// - 12. '", "output": "'GoogleAndroid12'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "676_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031729", "code": "import re\r\ndef remove_extra_char(text1):\r\n  pattern = re.compile('[\\W_]+')\r\n  return (pattern.sub('', text1))", "entry_point": "remove_extra_char", "input": "'****//Google Flutter//*** - 36. '", "output": "'GoogleFlutter36'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "676_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031730", "code": "import re\r\ndef remove_extra_char(text1):\r\n  pattern = re.compile('[\\W_]+')\r\n  return (pattern.sub('', text1))", "entry_point": "remove_extra_char", "input": "'**//Google Firebase// - 478. '", "output": "'GoogleFirebase478'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "676_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031731", "code": "def validity_triangle(a,b,c):\r\n total = a + b + c\r\n if total == 180:\r\n    return True\r\n else:\r\n    return False", "entry_point": "validity_triangle", "input": "60, 50, 90", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "677_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031732", "code": "def validity_triangle(a,b,c):\r\n total = a + b + c\r\n if total == 180:\r\n    return True\r\n else:\r\n    return False", "entry_point": "validity_triangle", "input": "45, 75, 60", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "677_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031733", "code": "def validity_triangle(a,b,c):\r\n total = a + b + c\r\n if total == 180:\r\n    return True\r\n else:\r\n    return False", "entry_point": "validity_triangle", "input": "30, 50, 100", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "677_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031734", "code": "def remove_spaces(str1):\r\n  str1 = str1.replace(' ','')\r\n  return str1", "entry_point": "remove_spaces", "input": "'a b c'", "output": "'abc'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "678_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031735", "code": "def remove_spaces(str1):\r\n  str1 = str1.replace(' ','')\r\n  return str1", "entry_point": "remove_spaces", "input": "'1 2 3'", "output": "'123'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "678_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031736", "code": "def remove_spaces(str1):\r\n  str1 = str1.replace(' ','')\r\n  return str1", "entry_point": "remove_spaces", "input": "' b c'", "output": "'bc'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "678_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031737", "code": "def access_key(ditionary,key):\r\n  return list(ditionary)[key]", "entry_point": "access_key", "input": "{'physics': 80, 'math': 90, 'chemistry': 86}, 0", "output": "'physics'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "679_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031738", "code": "def access_key(ditionary,key):\r\n  return list(ditionary)[key]", "entry_point": "access_key", "input": "{'python': 10, 'java': 20, 'C++': 30}, 2", "output": "'C++'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "679_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031739", "code": "def access_key(ditionary,key):\r\n  return list(ditionary)[key]", "entry_point": "access_key", "input": "{'program': 15, 'computer': 45}, 1", "output": "'computer'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "679_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031740", "code": "def increasing_trend(nums):\r\n    if (sorted(nums)== nums):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "increasing_trend", "input": "[1, 2, 3, 4]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "680_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031741", "code": "def increasing_trend(nums):\r\n    if (sorted(nums)== nums):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "increasing_trend", "input": "[4, 3, 2, 1]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "680_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031742", "code": "def increasing_trend(nums):\r\n    if (sorted(nums)== nums):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "increasing_trend", "input": "[0, 1, 4, 9]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "680_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031743", "code": "def smallest_Divisor(n): \r\n    if (n % 2 == 0): \r\n        return 2; \r\n    i = 3;  \r\n    while (i*i <= n): \r\n        if (n % i == 0): \r\n            return i; \r\n        i += 2; \r\n    return n; ", "entry_point": "smallest_Divisor", "input": "10", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "681_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031744", "code": "def smallest_Divisor(n): \r\n    if (n % 2 == 0): \r\n        return 2; \r\n    i = 3;  \r\n    while (i*i <= n): \r\n        if (n % i == 0): \r\n            return i; \r\n        i += 2; \r\n    return n; ", "entry_point": "smallest_Divisor", "input": "25", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "681_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031745", "code": "def smallest_Divisor(n): \r\n    if (n % 2 == 0): \r\n        return 2; \r\n    i = 3;  \r\n    while (i*i <= n): \r\n        if (n % i == 0): \r\n            return i; \r\n        i += 2; \r\n    return n; ", "entry_point": "smallest_Divisor", "input": "31", "output": "31", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "681_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031746", "code": "def mul_list(nums1,nums2):\r\n  result = map(lambda x, y: x * y, nums1, nums2)\r\n  return list(result)", "entry_point": "mul_list", "input": "[1, 2, 3], [4, 5, 6]", "output": "[4, 10, 18]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "682_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031747", "code": "def mul_list(nums1,nums2):\r\n  result = map(lambda x, y: x * y, nums1, nums2)\r\n  return list(result)", "entry_point": "mul_list", "input": "[1, 2], [3, 4]", "output": "[3, 8]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "682_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031748", "code": "def mul_list(nums1,nums2):\r\n  result = map(lambda x, y: x * y, nums1, nums2)\r\n  return list(result)", "entry_point": "mul_list", "input": "[90, 120], [50, 70]", "output": "[4500, 8400]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "682_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031749", "code": "def sum_Square(n) : \r\n    i = 1 \r\n    while i*i <= n : \r\n        j = 1\r\n        while (j*j <= n) : \r\n            if (i*i+j*j == n) : \r\n                return True\r\n            j = j+1\r\n        i = i+1     \r\n    return False", "entry_point": "sum_Square", "input": "25", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "683_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031750", "code": "def sum_Square(n) : \r\n    i = 1 \r\n    while i*i <= n : \r\n        j = 1\r\n        while (j*j <= n) : \r\n            if (i*i+j*j == n) : \r\n                return True\r\n            j = j+1\r\n        i = i+1     \r\n    return False", "entry_point": "sum_Square", "input": "24", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "683_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031751", "code": "def sum_Square(n) : \r\n    i = 1 \r\n    while i*i <= n : \r\n        j = 1\r\n        while (j*j <= n) : \r\n            if (i*i+j*j == n) : \r\n                return True\r\n            j = j+1\r\n        i = i+1     \r\n    return False", "entry_point": "sum_Square", "input": "17", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "683_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031752", "code": "def count_Char(str,x): \r\n    count = 0\r\n    for i in range(len(str)):  \r\n        if (str[i] == x) : \r\n            count += 1\r\n    n = 10\r\n    repititions = n // len(str)  \r\n    count = count * repititions  \r\n    l = n % len(str)  \r\n    for i in range(l): \r\n        if (str[i] == x):  \r\n            count += 1\r\n    return count  ", "entry_point": "count_Char", "input": "'abcac', 'a'", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "684_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031753", "code": "def count_Char(str,x): \r\n    count = 0\r\n    for i in range(len(str)):  \r\n        if (str[i] == x) : \r\n            count += 1\r\n    n = 10\r\n    repititions = n // len(str)  \r\n    count = count * repititions  \r\n    l = n % len(str)  \r\n    for i in range(l): \r\n        if (str[i] == x):  \r\n            count += 1\r\n    return count  ", "entry_point": "count_Char", "input": "'abca', 'c'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "684_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031754", "code": "def count_Char(str,x): \r\n    count = 0\r\n    for i in range(len(str)):  \r\n        if (str[i] == x) : \r\n            count += 1\r\n    n = 10\r\n    repititions = n // len(str)  \r\n    count = count * repititions  \r\n    l = n % len(str)  \r\n    for i in range(l): \r\n        if (str[i] == x):  \r\n            count += 1\r\n    return count  ", "entry_point": "count_Char", "input": "'aba', 'a'", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "684_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031755", "code": "def sum_Of_Primes(n): \r\n    prime = [True] * (n + 1)  \r\n    p = 2\r\n    while p * p <= n: \r\n        if prime[p] == True:  \r\n            i = p * 2\r\n            while i <= n: \r\n                prime[i] = False\r\n                i += p \r\n        p += 1    \r\n    sum = 0\r\n    for i in range (2,n + 1): \r\n        if(prime[i]): \r\n            sum += i \r\n    return sum", "entry_point": "sum_Of_Primes", "input": "10", "output": "17", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "685_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031756", "code": "def sum_Of_Primes(n): \r\n    prime = [True] * (n + 1)  \r\n    p = 2\r\n    while p * p <= n: \r\n        if prime[p] == True:  \r\n            i = p * 2\r\n            while i <= n: \r\n                prime[i] = False\r\n                i += p \r\n        p += 1    \r\n    sum = 0\r\n    for i in range (2,n + 1): \r\n        if(prime[i]): \r\n            sum += i \r\n    return sum", "entry_point": "sum_Of_Primes", "input": "20", "output": "77", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "685_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031757", "code": "def sum_Of_Primes(n): \r\n    prime = [True] * (n + 1)  \r\n    p = 2\r\n    while p * p <= n: \r\n        if prime[p] == True:  \r\n            i = p * 2\r\n            while i <= n: \r\n                prime[i] = False\r\n                i += p \r\n        p += 1    \r\n    sum = 0\r\n    for i in range (2,n + 1): \r\n        if(prime[i]): \r\n            sum += i \r\n    return sum", "entry_point": "sum_Of_Primes", "input": "5", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "685_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031758", "code": "from collections import defaultdict \r\ndef freq_element(test_tup):\r\n  res = defaultdict(int)\r\n  for ele in test_tup:\r\n    res[ele] += 1\r\n  return (str(dict(res))) ", "entry_point": "freq_element", "input": "(4, 5, 4, 5, 6, 6, 5, 5, 4)", "output": "'{4: 3, 5: 4, 6: 2}'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "686_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031759", "code": "from collections import defaultdict \r\ndef freq_element(test_tup):\r\n  res = defaultdict(int)\r\n  for ele in test_tup:\r\n    res[ele] += 1\r\n  return (str(dict(res))) ", "entry_point": "freq_element", "input": "(7, 8, 8, 9, 4, 7, 6, 5, 4)", "output": "'{7: 2, 8: 2, 9: 1, 4: 2, 6: 1, 5: 1}'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "686_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031760", "code": "from collections import defaultdict \r\ndef freq_element(test_tup):\r\n  res = defaultdict(int)\r\n  for ele in test_tup:\r\n    res[ele] += 1\r\n  return (str(dict(res))) ", "entry_point": "freq_element", "input": "(1, 4, 3, 1, 4, 5, 2, 6, 2, 7)", "output": "'{1: 2, 4: 2, 3: 1, 5: 1, 2: 2, 6: 1, 7: 1}'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "686_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031761", "code": "def recur_gcd(a, b):\r\n\tlow = min(a, b)\r\n\thigh = max(a, b)\r\n\tif low == 0:\r\n\t\treturn high\r\n\telif low == 1:\r\n\t\treturn 1\r\n\telse:\r\n\t\treturn recur_gcd(low, high%low)", "entry_point": "recur_gcd", "input": "12, 14", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "687_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031762", "code": "def recur_gcd(a, b):\r\n\tlow = min(a, b)\r\n\thigh = max(a, b)\r\n\tif low == 0:\r\n\t\treturn high\r\n\telif low == 1:\r\n\t\treturn 1\r\n\telse:\r\n\t\treturn recur_gcd(low, high%low)", "entry_point": "recur_gcd", "input": "13, 17", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "687_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031763", "code": "def recur_gcd(a, b):\r\n\tlow = min(a, b)\r\n\thigh = max(a, b)\r\n\tif low == 0:\r\n\t\treturn high\r\n\telif low == 1:\r\n\t\treturn 1\r\n\telse:\r\n\t\treturn recur_gcd(low, high%low)", "entry_point": "recur_gcd", "input": "9, 3", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "687_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031764", "code": "import cmath\r\ndef len_complex(a,b):\r\n  cn=complex(a,b)\r\n  length=abs(cn)\r\n  return length", "entry_point": "len_complex", "input": "3, 4", "output": "5.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "688_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031765", "code": "import cmath\r\ndef len_complex(a,b):\r\n  cn=complex(a,b)\r\n  length=abs(cn)\r\n  return length", "entry_point": "len_complex", "input": "9, 10", "output": "13.45362404707371", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "688_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031766", "code": "import cmath\r\ndef len_complex(a,b):\r\n  cn=complex(a,b)\r\n  length=abs(cn)\r\n  return length", "entry_point": "len_complex", "input": "7, 9", "output": "11.40175425099138", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "688_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031767", "code": "def min_jumps(arr, n):\r\n\tjumps = [0 for i in range(n)]\r\n\tif (n == 0) or (arr[0] == 0):\r\n\t\treturn float('inf')\r\n\tjumps[0] = 0\r\n\tfor i in range(1, n):\r\n\t\tjumps[i] = float('inf')\r\n\t\tfor j in range(i):\r\n\t\t\tif (i <= j + arr[j]) and (jumps[j] != float('inf')):\r\n\t\t\t\tjumps[i] = min(jumps[i], jumps[j] + 1)\r\n\t\t\t\tbreak\r\n\treturn jumps[n-1]", "entry_point": "min_jumps", "input": "[1, 3, 6, 1, 0, 9], 6", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "689_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031768", "code": "def min_jumps(arr, n):\r\n\tjumps = [0 for i in range(n)]\r\n\tif (n == 0) or (arr[0] == 0):\r\n\t\treturn float('inf')\r\n\tjumps[0] = 0\r\n\tfor i in range(1, n):\r\n\t\tjumps[i] = float('inf')\r\n\t\tfor j in range(i):\r\n\t\t\tif (i <= j + arr[j]) and (jumps[j] != float('inf')):\r\n\t\t\t\tjumps[i] = min(jumps[i], jumps[j] + 1)\r\n\t\t\t\tbreak\r\n\treturn jumps[n-1]", "entry_point": "min_jumps", "input": "[1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9], 11", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "689_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031769", "code": "def min_jumps(arr, n):\r\n\tjumps = [0 for i in range(n)]\r\n\tif (n == 0) or (arr[0] == 0):\r\n\t\treturn float('inf')\r\n\tjumps[0] = 0\r\n\tfor i in range(1, n):\r\n\t\tjumps[i] = float('inf')\r\n\t\tfor j in range(i):\r\n\t\t\tif (i <= j + arr[j]) and (jumps[j] != float('inf')):\r\n\t\t\t\tjumps[i] = min(jumps[i], jumps[j] + 1)\r\n\t\t\t\tbreak\r\n\treturn jumps[n-1]", "entry_point": "min_jumps", "input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 11", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "689_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031770", "code": "def mul_consecutive_nums(nums):\r\n    result = [b*a for a, b in zip(nums[:-1], nums[1:])]\r\n    return result", "entry_point": "mul_consecutive_nums", "input": "[1, 1, 3, 4, 4, 5, 6, 7]", "output": "[1, 3, 12, 16, 20, 30, 42]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "690_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031771", "code": "def mul_consecutive_nums(nums):\r\n    result = [b*a for a, b in zip(nums[:-1], nums[1:])]\r\n    return result", "entry_point": "mul_consecutive_nums", "input": "[4, 5, 8, 9, 6, 10]", "output": "[20, 40, 72, 54, 60]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "690_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031772", "code": "def mul_consecutive_nums(nums):\r\n    result = [b*a for a, b in zip(nums[:-1], nums[1:])]\r\n    return result", "entry_point": "mul_consecutive_nums", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[2, 6, 12, 20, 30, 42, 56, 72, 90]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "690_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031773", "code": "from itertools import groupby \r\ndef group_element(test_list):\r\n  res = dict()\r\n  for key, val in groupby(sorted(test_list, key = lambda ele: ele[1]), key = lambda ele: ele[1]):\r\n    res[key] = [ele[0] for ele in val] \r\n  return (res)\r\n", "entry_point": "group_element", "input": "[(6, 5), (2, 7), (2, 5), (8, 7), (9, 8), (3, 7)]", "output": "{5: [6, 2], 7: [2, 8, 3], 8: [9]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "691_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031774", "code": "from itertools import groupby \r\ndef group_element(test_list):\r\n  res = dict()\r\n  for key, val in groupby(sorted(test_list, key = lambda ele: ele[1]), key = lambda ele: ele[1]):\r\n    res[key] = [ele[0] for ele in val] \r\n  return (res)\r\n", "entry_point": "group_element", "input": "[(7, 6), (3, 8), (3, 6), (9, 8), (10, 9), (4, 8)]", "output": "{6: [7, 3], 8: [3, 9, 4], 9: [10]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "691_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031775", "code": "from itertools import groupby \r\ndef group_element(test_list):\r\n  res = dict()\r\n  for key, val in groupby(sorted(test_list, key = lambda ele: ele[1]), key = lambda ele: ele[1]):\r\n    res[key] = [ele[0] for ele in val] \r\n  return (res)\r\n", "entry_point": "group_element", "input": "[(8, 7), (4, 9), (4, 7), (10, 9), (11, 10), (5, 9)]", "output": "{7: [8, 4], 9: [4, 10, 5], 10: [11]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "691_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031776", "code": "def last_Two_Digits(N): \r\n    if (N >= 10): \r\n        return\r\n    fac = 1\r\n    for i in range(1,N + 1): \r\n        fac = (fac * i) % 100\r\n    return (fac) ", "entry_point": "last_Two_Digits", "input": "7", "output": "40", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "692_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031777", "code": "def last_Two_Digits(N): \r\n    if (N >= 10): \r\n        return\r\n    fac = 1\r\n    for i in range(1,N + 1): \r\n        fac = (fac * i) % 100\r\n    return (fac) ", "entry_point": "last_Two_Digits", "input": "5", "output": "20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "692_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031778", "code": "def last_Two_Digits(N): \r\n    if (N >= 10): \r\n        return\r\n    fac = 1\r\n    for i in range(1,N + 1): \r\n        fac = (fac * i) % 100\r\n    return (fac) ", "entry_point": "last_Two_Digits", "input": "2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "692_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031779", "code": "import re\r\ndef remove_multiple_spaces(text1):\r\n  return (re.sub(' +',' ',text1))", "entry_point": "remove_multiple_spaces", "input": "'Google      Assistant'", "output": "'Google Assistant'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "693_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031780", "code": "import re\r\ndef remove_multiple_spaces(text1):\r\n  return (re.sub(' +',' ',text1))", "entry_point": "remove_multiple_spaces", "input": "'Quad      Core'", "output": "'Quad Core'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "693_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031781", "code": "import re\r\ndef remove_multiple_spaces(text1):\r\n  return (re.sub(' +',' ',text1))", "entry_point": "remove_multiple_spaces", "input": "'ChromeCast      Built-in'", "output": "'ChromeCast Built-in'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "693_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031782", "code": "def extract_unique(test_dict):\r\n  res = list(sorted({ele for val in test_dict.values() for ele in val}))\r\n  return res", "entry_point": "extract_unique", "input": "{'msm': [5, 6, 7, 8], 'is': [10, 11, 7, 5], 'best': [6, 12, 10, 8], 'for': [1, 2, 5]}", "output": "[1, 2, 5, 6, 7, 8, 10, 11, 12]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "694_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031783", "code": "def extract_unique(test_dict):\r\n  res = list(sorted({ele for val in test_dict.values() for ele in val}))\r\n  return res", "entry_point": "extract_unique", "input": "{'Built': [7, 1, 9, 4], 'for': [11, 21, 36, 14, 9], 'ISP': [4, 1, 21, 39, 47], 'TV': [1, 32, 38]}", "output": "[1, 4, 7, 9, 11, 14, 21, 32, 36, 38, 39, 47]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "694_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031784", "code": "def extract_unique(test_dict):\r\n  res = list(sorted({ele for val in test_dict.values() for ele in val}))\r\n  return res", "entry_point": "extract_unique", "input": "{'F': [11, 13, 14, 17], 'A': [12, 11, 15, 18], 'N': [19, 21, 15, 36], 'G': [37, 36, 35]}", "output": "[11, 12, 13, 14, 15, 17, 18, 19, 21, 35, 36, 37]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "694_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031785", "code": "def check_greater(test_tup1, test_tup2):\r\n  res = all(x < y for x, y in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "check_greater", "input": "(10, 4, 5), (13, 5, 18)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "695_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031786", "code": "def check_greater(test_tup1, test_tup2):\r\n  res = all(x < y for x, y in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "check_greater", "input": "(1, 2, 3), (2, 1, 4)", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "695_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031787", "code": "def check_greater(test_tup1, test_tup2):\r\n  res = all(x < y for x, y in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "check_greater", "input": "(4, 5, 6), (5, 6, 7)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "695_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031788", "code": "def zip_list(list1,list2):  \r\n result = list(map(list.__add__, list1, list2)) \r\n return result", "entry_point": "zip_list", "input": "[[1, 3], [5, 7], [9, 11]], [[2, 4], [6, 8], [10, 12, 14]]", "output": "[[1, 3, 2, 4], [5, 7, 6, 8], [9, 11, 10, 12, 14]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "696_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031789", "code": "def zip_list(list1,list2):  \r\n result = list(map(list.__add__, list1, list2)) \r\n return result", "entry_point": "zip_list", "input": "[[1, 2], [3, 4], [5, 6]], [[7, 8], [9, 10], [11, 12]]", "output": "[[1, 2, 7, 8], [3, 4, 9, 10], [5, 6, 11, 12]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "696_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031790", "code": "def zip_list(list1,list2):  \r\n result = list(map(list.__add__, list1, list2)) \r\n return result", "entry_point": "zip_list", "input": "[['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']]", "output": "[['a', 'b', 'e', 'f'], ['c', 'd', 'g', 'h']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "696_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031791", "code": "def count_even(array_nums):\r\n   count_even = len(list(filter(lambda x: (x%2 == 0) , array_nums)))\r\n   return count_even", "entry_point": "count_even", "input": "[1, 2, 3, 5, 7, 8, 9, 10]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "697_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031792", "code": "def count_even(array_nums):\r\n   count_even = len(list(filter(lambda x: (x%2 == 0) , array_nums)))\r\n   return count_even", "entry_point": "count_even", "input": "[10, 15, 14, 13, -18, 12, -20]", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "697_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031793", "code": "def count_even(array_nums):\r\n   count_even = len(list(filter(lambda x: (x%2 == 0) , array_nums)))\r\n   return count_even", "entry_point": "count_even", "input": "[1, 2, 4, 8, 9]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "697_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031794", "code": "def sort_dict_item(test_dict):\r\n  res = {key: test_dict[key] for key in sorted(test_dict.keys(), key = lambda ele: ele[1] * ele[0])}\r\n  return  (res) \r\n", "entry_point": "sort_dict_item", "input": "{(5, 6): 3, (2, 3): 9, (8, 4): 10, (6, 4): 12}", "output": "{(2, 3): 9, (6, 4): 12, (5, 6): 3, (8, 4): 10}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "698_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031795", "code": "def sort_dict_item(test_dict):\r\n  res = {key: test_dict[key] for key in sorted(test_dict.keys(), key = lambda ele: ele[1] * ele[0])}\r\n  return  (res) \r\n", "entry_point": "sort_dict_item", "input": "{(6, 7): 4, (3, 4): 10, (9, 5): 11, (7, 5): 13}", "output": "{(3, 4): 10, (7, 5): 13, (6, 7): 4, (9, 5): 11}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "698_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031796", "code": "def sort_dict_item(test_dict):\r\n  res = {key: test_dict[key] for key in sorted(test_dict.keys(), key = lambda ele: ele[1] * ele[0])}\r\n  return  (res) \r\n", "entry_point": "sort_dict_item", "input": "{(7, 8): 5, (4, 5): 11, (10, 6): 12, (8, 6): 14}", "output": "{(4, 5): 11, (8, 6): 14, (7, 8): 5, (10, 6): 12}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "698_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031797", "code": "def min_Swaps(str1,str2) : \r\n    count = 0\r\n    for i in range(len(str1)) : \r\n        if str1[i] != str2[i] : \r\n            count += 1\r\n    if count % 2 == 0 : \r\n        return (count // 2) \r\n    else : \r\n        return (\"Not Possible\") ", "entry_point": "min_Swaps", "input": "'1101', '1110'", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "699_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031798", "code": "def min_Swaps(str1,str2) : \r\n    count = 0\r\n    for i in range(len(str1)) : \r\n        if str1[i] != str2[i] : \r\n            count += 1\r\n    if count % 2 == 0 : \r\n        return (count // 2) \r\n    else : \r\n        return (\"Not Possible\") ", "entry_point": "min_Swaps", "input": "'1111', '0100'", "output": "'Not Possible'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "699_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031799", "code": "def min_Swaps(str1,str2) : \r\n    count = 0\r\n    for i in range(len(str1)) : \r\n        if str1[i] != str2[i] : \r\n            count += 1\r\n    if count % 2 == 0 : \r\n        return (count // 2) \r\n    else : \r\n        return (\"Not Possible\") ", "entry_point": "min_Swaps", "input": "'1110000', '0001101'", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "699_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031800", "code": "def count_range_in_list(li, min, max):\r\n\tctr = 0\r\n\tfor x in li:\r\n\t\tif min <= x <= max:\r\n\t\t\tctr += 1\r\n\treturn ctr", "entry_point": "count_range_in_list", "input": "[10, 20, 30, 40, 40, 40, 70, 80, 99], 40, 100", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "700_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031801", "code": "def count_range_in_list(li, min, max):\r\n\tctr = 0\r\n\tfor x in li:\r\n\t\tif min <= x <= max:\r\n\t\t\tctr += 1\r\n\treturn ctr", "entry_point": "count_range_in_list", "input": "['a', 'b', 'c', 'd', 'e', 'f'], 'a', 'e'", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "700_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031802", "code": "def count_range_in_list(li, min, max):\r\n\tctr = 0\r\n\tfor x in li:\r\n\t\tif min <= x <= max:\r\n\t\t\tctr += 1\r\n\treturn ctr", "entry_point": "count_range_in_list", "input": "[7, 8, 9, 15, 17, 19, 45], 15, 20", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "700_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031803", "code": "def equilibrium_index(arr):\r\n  total_sum = sum(arr)\r\n  left_sum=0\r\n  for i, num in enumerate(arr):\r\n    total_sum -= num\r\n    if left_sum == total_sum:\r\n      return i\r\n    left_sum += num\r\n  return -1", "entry_point": "equilibrium_index", "input": "[1, 2, 3, 4, 1, 2, 3]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "701_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031804", "code": "def equilibrium_index(arr):\r\n  total_sum = sum(arr)\r\n  left_sum=0\r\n  for i, num in enumerate(arr):\r\n    total_sum -= num\r\n    if left_sum == total_sum:\r\n      return i\r\n    left_sum += num\r\n  return -1", "entry_point": "equilibrium_index", "input": "[-7, 1, 5, 2, -4, 3, 0]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "701_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031805", "code": "def equilibrium_index(arr):\r\n  total_sum = sum(arr)\r\n  left_sum=0\r\n  for i, num in enumerate(arr):\r\n    total_sum -= num\r\n    if left_sum == total_sum:\r\n      return i\r\n    left_sum += num\r\n  return -1", "entry_point": "equilibrium_index", "input": "[1, 2, 3]", "output": "-1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "701_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031806", "code": "def find_ind(key, i, n, \r\n\t\t\tk, arr):\r\n\tind = -1\r\n\tstart = i + 1\r\n\tend = n - 1;\r\n\twhile (start < end):\r\n\t\tmid = int(start +\r\n\t\t\t\t(end - start) / 2)\r\n\t\tif (arr[mid] - key <= k):\r\n\t\t\tind = mid\r\n\t\t\tstart = mid + 1\r\n\t\telse:\r\n\t\t\tend = mid\r\n\treturn ind\r\ndef removals(arr, n, k):\r\n\tans = n - 1\r\n\tarr.sort()\r\n\tfor i in range(0, n):\r\n\t\tj = find_ind(arr[i], i, \r\n\t\t\t\t\tn, k, arr)\r\n\t\tif (j != -1):\r\n\t\t\tans = min(ans, n -\r\n\t\t\t\t\t\t(j - i + 1))\r\n\treturn ans", "entry_point": "removals", "input": "[1, 3, 4, 9, 10, 11, 12, 17, 20], 9, 4", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "702_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031807", "code": "def find_ind(key, i, n, \r\n\t\t\tk, arr):\r\n\tind = -1\r\n\tstart = i + 1\r\n\tend = n - 1;\r\n\twhile (start < end):\r\n\t\tmid = int(start +\r\n\t\t\t\t(end - start) / 2)\r\n\t\tif (arr[mid] - key <= k):\r\n\t\t\tind = mid\r\n\t\t\tstart = mid + 1\r\n\t\telse:\r\n\t\t\tend = mid\r\n\treturn ind\r\ndef removals(arr, n, k):\r\n\tans = n - 1\r\n\tarr.sort()\r\n\tfor i in range(0, n):\r\n\t\tj = find_ind(arr[i], i, \r\n\t\t\t\t\tn, k, arr)\r\n\t\tif (j != -1):\r\n\t\t\tans = min(ans, n -\r\n\t\t\t\t\t\t(j - i + 1))\r\n\treturn ans", "entry_point": "removals", "input": "[1, 5, 6, 2, 8], 5, 2", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "702_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031808", "code": "def find_ind(key, i, n, \r\n\t\t\tk, arr):\r\n\tind = -1\r\n\tstart = i + 1\r\n\tend = n - 1;\r\n\twhile (start < end):\r\n\t\tmid = int(start +\r\n\t\t\t\t(end - start) / 2)\r\n\t\tif (arr[mid] - key <= k):\r\n\t\t\tind = mid\r\n\t\t\tstart = mid + 1\r\n\t\telse:\r\n\t\t\tend = mid\r\n\treturn ind\r\ndef removals(arr, n, k):\r\n\tans = n - 1\r\n\tarr.sort()\r\n\tfor i in range(0, n):\r\n\t\tj = find_ind(arr[i], i, \r\n\t\t\t\t\tn, k, arr)\r\n\t\tif (j != -1):\r\n\t\t\tans = min(ans, n -\r\n\t\t\t\t\t\t(j - i + 1))\r\n\treturn ans", "entry_point": "removals", "input": "[1, 2, 3, 4, 5, 6], 6, 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "702_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031809", "code": "def is_key_present(d,x):\r\n  if x in d:\r\n    return True\r\n  else:\r\n     return False", "entry_point": "is_key_present", "input": "{1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}, 5", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "703_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031810", "code": "def is_key_present(d,x):\r\n  if x in d:\r\n    return True\r\n  else:\r\n     return False", "entry_point": "is_key_present", "input": "{1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}, 6", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "703_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031811", "code": "def is_key_present(d,x):\r\n  if x in d:\r\n    return True\r\n  else:\r\n     return False", "entry_point": "is_key_present", "input": "{1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}, 10", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "703_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031812", "code": "def harmonic_sum(n):\r\n  if n < 2:\r\n    return 1\r\n  else:\r\n    return 1 / n + (harmonic_sum(n - 1))", "entry_point": "harmonic_sum", "input": "10", "output": "2.9289682539682538", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "704_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031813", "code": "def harmonic_sum(n):\r\n  if n < 2:\r\n    return 1\r\n  else:\r\n    return 1 / n + (harmonic_sum(n - 1))", "entry_point": "harmonic_sum", "input": "4", "output": "2.083333333333333", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "704_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031814", "code": "def harmonic_sum(n):\r\n  if n < 2:\r\n    return 1\r\n  else:\r\n    return 1 / n + (harmonic_sum(n - 1))", "entry_point": "harmonic_sum", "input": "7", "output": "2.5928571428571425", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "704_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031815", "code": "def sort_sublists(list1):\r\n      list1.sort()  \r\n      list1.sort(key=len)\r\n      return  list1", "entry_point": "sort_sublists", "input": "[[2], [0], [1, 3], [0, 7], [9, 11], [13, 15, 17]]", "output": "[[0], [2], [0, 7], [1, 3], [9, 11], [13, 15, 17]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "705_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031816", "code": "def sort_sublists(list1):\r\n      list1.sort()  \r\n      list1.sort(key=len)\r\n      return  list1", "entry_point": "sort_sublists", "input": "[[1], [2, 3], [4, 5, 6], [7], [10, 11]]", "output": "[[1], [7], [2, 3], [10, 11], [4, 5, 6]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "705_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031817", "code": "def sort_sublists(list1):\r\n      list1.sort()  \r\n      list1.sort(key=len)\r\n      return  list1", "entry_point": "sort_sublists", "input": "[['python'], ['java', 'C', 'C++'], ['DBMS'], ['SQL', 'HTML']]", "output": "[['DBMS'], ['python'], ['SQL', 'HTML'], ['java', 'C', 'C++']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "705_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031818", "code": "def is_subset(arr1, m, arr2, n): \r\n\thashset = set() \r\n\tfor i in range(0, m): \r\n\t\thashset.add(arr1[i]) \r\n\tfor i in range(0, n): \r\n\t\tif arr2[i] in hashset: \r\n\t\t\tcontinue\r\n\t\telse: \r\n\t\t\treturn False\r\n\treturn True\t\t", "entry_point": "is_subset", "input": "[11, 1, 13, 21, 3, 7], 6, [11, 3, 7, 1], 4", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "706_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031819", "code": "def is_subset(arr1, m, arr2, n): \r\n\thashset = set() \r\n\tfor i in range(0, m): \r\n\t\thashset.add(arr1[i]) \r\n\tfor i in range(0, n): \r\n\t\tif arr2[i] in hashset: \r\n\t\t\tcontinue\r\n\t\telse: \r\n\t\t\treturn False\r\n\treturn True\t\t", "entry_point": "is_subset", "input": "[1, 2, 3, 4, 5, 6], 6, [1, 2, 4], 3", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "706_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031820", "code": "def is_subset(arr1, m, arr2, n): \r\n\thashset = set() \r\n\tfor i in range(0, m): \r\n\t\thashset.add(arr1[i]) \r\n\tfor i in range(0, n): \r\n\t\tif arr2[i] in hashset: \r\n\t\t\tcontinue\r\n\t\telse: \r\n\t\t\treturn False\r\n\treturn True\t\t", "entry_point": "is_subset", "input": "[10, 5, 2, 23, 19], 5, [19, 5, 3], 3", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "706_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031821", "code": "def count_Set_Bits(n) :  \r\n    n += 1; \r\n    powerOf2 = 2;   \r\n    cnt = n // 2;  \r\n    while (powerOf2 <= n) : \r\n        totalPairs = n // powerOf2;  \r\n        cnt += (totalPairs // 2) * powerOf2;  \r\n        if (totalPairs & 1) : \r\n            cnt += (n % powerOf2) \r\n        else : \r\n            cnt += 0\r\n        powerOf2 <<= 1;    \r\n    return cnt;  ", "entry_point": "count_Set_Bits", "input": "16", "output": "33", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "707_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031822", "code": "def count_Set_Bits(n) :  \r\n    n += 1; \r\n    powerOf2 = 2;   \r\n    cnt = n // 2;  \r\n    while (powerOf2 <= n) : \r\n        totalPairs = n // powerOf2;  \r\n        cnt += (totalPairs // 2) * powerOf2;  \r\n        if (totalPairs & 1) : \r\n            cnt += (n % powerOf2) \r\n        else : \r\n            cnt += 0\r\n        powerOf2 <<= 1;    \r\n    return cnt;  ", "entry_point": "count_Set_Bits", "input": "2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "707_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031823", "code": "def count_Set_Bits(n) :  \r\n    n += 1; \r\n    powerOf2 = 2;   \r\n    cnt = n // 2;  \r\n    while (powerOf2 <= n) : \r\n        totalPairs = n // powerOf2;  \r\n        cnt += (totalPairs // 2) * powerOf2;  \r\n        if (totalPairs & 1) : \r\n            cnt += (n % powerOf2) \r\n        else : \r\n            cnt += 0\r\n        powerOf2 <<= 1;    \r\n    return cnt;  ", "entry_point": "count_Set_Bits", "input": "14", "output": "28", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "707_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031824", "code": "def Convert(string): \r\n    li = list(string.split(\" \")) \r\n    return li ", "entry_point": "Convert", "input": "'python program'", "output": "['python', 'program']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "708_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031825", "code": "def Convert(string): \r\n    li = list(string.split(\" \")) \r\n    return li ", "entry_point": "Convert", "input": "'Data Analysis'", "output": "['Data', 'Analysis']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "708_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031826", "code": "def Convert(string): \r\n    li = list(string.split(\" \")) \r\n    return li ", "entry_point": "Convert", "input": "'Hadoop Training'", "output": "['Hadoop', 'Training']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "708_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031827", "code": "from collections import defaultdict \r\ndef get_unique(test_list):\r\n  res = defaultdict(list)\r\n  for sub in test_list:\r\n    res[sub[1]].append(sub[0])\r\n  res = dict(res)\r\n  res_dict = dict()\r\n  for key in res:\r\n    res_dict[key] = len(list(set(res[key])))\r\n  return (str(res_dict)) ", "entry_point": "get_unique", "input": "[(3, 4), (1, 2), (2, 4), (8, 2), (7, 2), (8, 1), (9, 1), (8, 4), (10, 4)]", "output": "'{4: 4, 2: 3, 1: 2}'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "709_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031828", "code": "from collections import defaultdict \r\ndef get_unique(test_list):\r\n  res = defaultdict(list)\r\n  for sub in test_list:\r\n    res[sub[1]].append(sub[0])\r\n  res = dict(res)\r\n  res_dict = dict()\r\n  for key in res:\r\n    res_dict[key] = len(list(set(res[key])))\r\n  return (str(res_dict)) ", "entry_point": "get_unique", "input": "[(4, 5), (2, 3), (3, 5), (9, 3), (8, 3), (9, 2), (10, 2), (9, 5), (11, 5)]", "output": "'{5: 4, 3: 3, 2: 2}'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "709_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031829", "code": "from collections import defaultdict \r\ndef get_unique(test_list):\r\n  res = defaultdict(list)\r\n  for sub in test_list:\r\n    res[sub[1]].append(sub[0])\r\n  res = dict(res)\r\n  res_dict = dict()\r\n  for key in res:\r\n    res_dict[key] = len(list(set(res[key])))\r\n  return (str(res_dict)) ", "entry_point": "get_unique", "input": "[(6, 5), (3, 4), (2, 6), (11, 1), (8, 22), (8, 11), (4, 3), (14, 3), (11, 6)]", "output": "'{5: 1, 4: 1, 6: 2, 1: 1, 22: 1, 11: 1, 3: 2}'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "709_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031830", "code": "def front_and_rear(test_tup):\r\n  res = (test_tup[0], test_tup[-1])\r\n  return (res) ", "entry_point": "front_and_rear", "input": "(10, 4, 5, 6, 7)", "output": "(10, 7)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "710_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031831", "code": "def front_and_rear(test_tup):\r\n  res = (test_tup[0], test_tup[-1])\r\n  return (res) ", "entry_point": "front_and_rear", "input": "(1, 2, 3, 4, 5)", "output": "(1, 5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "710_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031832", "code": "def front_and_rear(test_tup):\r\n  res = (test_tup[0], test_tup[-1])\r\n  return (res) ", "entry_point": "front_and_rear", "input": "(6, 7, 8, 9, 10)", "output": "(6, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "710_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031833", "code": "def product_Equal(n): \r\n    if n < 10: \r\n        return False\r\n    prodOdd = 1; prodEven = 1\r\n    while n > 0: \r\n        digit = n % 10\r\n        prodOdd *= digit \r\n        n = n//10\r\n        if n == 0: \r\n            break; \r\n        digit = n % 10\r\n        prodEven *= digit \r\n        n = n//10\r\n    if prodOdd == prodEven: \r\n        return True\r\n    return False", "entry_point": "product_Equal", "input": "2841", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "711_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031834", "code": "def product_Equal(n): \r\n    if n < 10: \r\n        return False\r\n    prodOdd = 1; prodEven = 1\r\n    while n > 0: \r\n        digit = n % 10\r\n        prodOdd *= digit \r\n        n = n//10\r\n        if n == 0: \r\n            break; \r\n        digit = n % 10\r\n        prodEven *= digit \r\n        n = n//10\r\n    if prodOdd == prodEven: \r\n        return True\r\n    return False", "entry_point": "product_Equal", "input": "1234", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "711_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031835", "code": "def product_Equal(n): \r\n    if n < 10: \r\n        return False\r\n    prodOdd = 1; prodEven = 1\r\n    while n > 0: \r\n        digit = n % 10\r\n        prodOdd *= digit \r\n        n = n//10\r\n        if n == 0: \r\n            break; \r\n        digit = n % 10\r\n        prodEven *= digit \r\n        n = n//10\r\n    if prodOdd == prodEven: \r\n        return True\r\n    return False", "entry_point": "product_Equal", "input": "1212", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "711_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031836", "code": "import itertools\r\ndef remove_duplicate(list1):\r\n list.sort(list1)\r\n remove_duplicate = list(list1 for list1,_ in itertools.groupby(list1))\r\n return remove_duplicate", "entry_point": "remove_duplicate", "input": "[[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]]", "output": "[[10, 20], [30, 56, 25], [33], [40]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "712_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031837", "code": "import itertools\r\ndef remove_duplicate(list1):\r\n list.sort(list1)\r\n remove_duplicate = list(list1 for list1,_ in itertools.groupby(list1))\r\n return remove_duplicate", "entry_point": "remove_duplicate", "input": "['a', 'b', 'a', 'c', 'c']", "output": "['a', 'b', 'c']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "712_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031838", "code": "import itertools\r\ndef remove_duplicate(list1):\r\n list.sort(list1)\r\n remove_duplicate = list(list1 for list1,_ in itertools.groupby(list1))\r\n return remove_duplicate", "entry_point": "remove_duplicate", "input": "[1, 3, 5, 6, 3, 5, 6, 1]", "output": "[1, 3, 5, 6]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "712_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031839", "code": "def check_valid(test_tup):\r\n  res = not any(map(lambda ele: not ele, test_tup))\r\n  return (res) ", "entry_point": "check_valid", "input": "(True, True, True, True)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "713_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031840", "code": "def check_valid(test_tup):\r\n  res = not any(map(lambda ele: not ele, test_tup))\r\n  return (res) ", "entry_point": "check_valid", "input": "(True, False, True, True)", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "713_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031841", "code": "def count_Fac(n):  \r\n    m = n \r\n    count = 0\r\n    i = 2\r\n    while((i * i) <= m): \r\n        total = 0\r\n        while (n % i == 0): \r\n            n /= i \r\n            total += 1 \r\n        temp = 0\r\n        j = 1\r\n        while((temp + j) <= total): \r\n            temp += j \r\n            count += 1\r\n            j += 1 \r\n        i += 1\r\n    if (n != 1): \r\n        count += 1 \r\n    return count ", "entry_point": "count_Fac", "input": "24", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "714_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031842", "code": "def count_Fac(n):  \r\n    m = n \r\n    count = 0\r\n    i = 2\r\n    while((i * i) <= m): \r\n        total = 0\r\n        while (n % i == 0): \r\n            n /= i \r\n            total += 1 \r\n        temp = 0\r\n        j = 1\r\n        while((temp + j) <= total): \r\n            temp += j \r\n            count += 1\r\n            j += 1 \r\n        i += 1\r\n    if (n != 1): \r\n        count += 1 \r\n    return count ", "entry_point": "count_Fac", "input": "12", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "714_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031843", "code": "def count_Fac(n):  \r\n    m = n \r\n    count = 0\r\n    i = 2\r\n    while((i * i) <= m): \r\n        total = 0\r\n        while (n % i == 0): \r\n            n /= i \r\n            total += 1 \r\n        temp = 0\r\n        j = 1\r\n        while((temp + j) <= total): \r\n            temp += j \r\n            count += 1\r\n            j += 1 \r\n        i += 1\r\n    if (n != 1): \r\n        count += 1 \r\n    return count ", "entry_point": "count_Fac", "input": "4", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "714_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031844", "code": "def str_to_tuple(test_str):\r\n  res = tuple(map(int, test_str.split(', ')))\r\n  return (res) ", "entry_point": "str_to_tuple", "input": "'1, -5, 4, 6, 7'", "output": "(1, -5, 4, 6, 7)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "715_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031845", "code": "def str_to_tuple(test_str):\r\n  res = tuple(map(int, test_str.split(', ')))\r\n  return (res) ", "entry_point": "str_to_tuple", "input": "'1, 2, 3, 4, 5'", "output": "(1, 2, 3, 4, 5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "715_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031846", "code": "def str_to_tuple(test_str):\r\n  res = tuple(map(int, test_str.split(', ')))\r\n  return (res) ", "entry_point": "str_to_tuple", "input": "'4, 6, 9, 11, 13, 14'", "output": "(4, 6, 9, 11, 13, 14)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "715_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031847", "code": "def rombus_perimeter(a):\r\n  perimeter=4*a\r\n  return perimeter", "entry_point": "rombus_perimeter", "input": "10", "output": "40", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "716_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031848", "code": "def rombus_perimeter(a):\r\n  perimeter=4*a\r\n  return perimeter", "entry_point": "rombus_perimeter", "input": "5", "output": "20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "716_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031849", "code": "def rombus_perimeter(a):\r\n  perimeter=4*a\r\n  return perimeter", "entry_point": "rombus_perimeter", "input": "4", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "716_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031850", "code": "def alternate_elements(list1):\r\n    result=[]\r\n    for item in list1[::2]:\r\n        result.append(item)\r\n    return result ", "entry_point": "alternate_elements", "input": "['red', 'black', 'white', 'green', 'orange']", "output": "['red', 'white', 'orange']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "718_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031851", "code": "def alternate_elements(list1):\r\n    result=[]\r\n    for item in list1[::2]:\r\n        result.append(item)\r\n    return result ", "entry_point": "alternate_elements", "input": "[2, 0, 3, 4, 0, 2, 8, 3, 4, 2]", "output": "[2, 3, 0, 8, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "718_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031852", "code": "def alternate_elements(list1):\r\n    result=[]\r\n    for item in list1[::2]:\r\n        result.append(item)\r\n    return result ", "entry_point": "alternate_elements", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[1, 3, 5, 7, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "718_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031853", "code": "import re\r\ndef text_match(text):\r\n        patterns = 'ab*?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match", "input": "'ac'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "719_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031854", "code": "import re\r\ndef text_match(text):\r\n        patterns = 'ab*?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match", "input": "'dc'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "719_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031855", "code": "import re\r\ndef text_match(text):\r\n        patterns = 'ab*?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match", "input": "'abba'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "719_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031856", "code": "def add_dict_to_tuple(test_tup, test_dict):\r\n  test_tup = list(test_tup)\r\n  test_tup.append(test_dict)\r\n  test_tup = tuple(test_tup)\r\n  return (test_tup) ", "entry_point": "add_dict_to_tuple", "input": "(4, 5, 6), {'MSAM': 1, 'is': 2, 'best': 3}", "output": "(4, 5, 6, {'MSAM': 1, 'is': 2, 'best': 3})", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "720_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031857", "code": "def add_dict_to_tuple(test_tup, test_dict):\r\n  test_tup = list(test_tup)\r\n  test_tup.append(test_dict)\r\n  test_tup = tuple(test_tup)\r\n  return (test_tup) ", "entry_point": "add_dict_to_tuple", "input": "(1, 2, 3), {'UTS': 2, 'is': 3, 'Worst': 4}", "output": "(1, 2, 3, {'UTS': 2, 'is': 3, 'Worst': 4})", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "720_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031858", "code": "def add_dict_to_tuple(test_tup, test_dict):\r\n  test_tup = list(test_tup)\r\n  test_tup.append(test_dict)\r\n  test_tup = tuple(test_tup)\r\n  return (test_tup) ", "entry_point": "add_dict_to_tuple", "input": "(8, 9, 10), {'POS': 3, 'is': 4, 'Okay': 5}", "output": "(8, 9, 10, {'POS': 3, 'is': 4, 'Okay': 5})", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "720_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031859", "code": "M = 100\r\ndef maxAverageOfPath(cost, N): \r\n\tdp = [[0 for i in range(N + 1)] for j in range(N + 1)] \r\n\tdp[0][0] = cost[0][0] \r\n\tfor i in range(1, N): \r\n\t\tdp[i][0] = dp[i - 1][0] + cost[i][0] \r\n\tfor j in range(1, N): \r\n\t\tdp[0][j] = dp[0][j - 1] + cost[0][j] \r\n\tfor i in range(1, N): \r\n\t\tfor j in range(1, N): \r\n\t\t\tdp[i][j] = max(dp[i - 1][j], \r\n\t\t\t\t\t\tdp[i][j - 1]) + cost[i][j] \r\n\treturn dp[N - 1][N - 1] / (2 * N - 1)", "entry_point": "maxAverageOfPath", "input": "[[1, 2, 3], [6, 5, 4], [7, 3, 9]], 3", "output": "5.2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "721_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031860", "code": "M = 100\r\ndef maxAverageOfPath(cost, N): \r\n\tdp = [[0 for i in range(N + 1)] for j in range(N + 1)] \r\n\tdp[0][0] = cost[0][0] \r\n\tfor i in range(1, N): \r\n\t\tdp[i][0] = dp[i - 1][0] + cost[i][0] \r\n\tfor j in range(1, N): \r\n\t\tdp[0][j] = dp[0][j - 1] + cost[0][j] \r\n\tfor i in range(1, N): \r\n\t\tfor j in range(1, N): \r\n\t\t\tdp[i][j] = max(dp[i - 1][j], \r\n\t\t\t\t\t\tdp[i][j - 1]) + cost[i][j] \r\n\treturn dp[N - 1][N - 1] / (2 * N - 1)", "entry_point": "maxAverageOfPath", "input": "[[2, 3, 4], [7, 6, 5], [8, 4, 10]], 3", "output": "6.2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "721_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031861", "code": "M = 100\r\ndef maxAverageOfPath(cost, N): \r\n\tdp = [[0 for i in range(N + 1)] for j in range(N + 1)] \r\n\tdp[0][0] = cost[0][0] \r\n\tfor i in range(1, N): \r\n\t\tdp[i][0] = dp[i - 1][0] + cost[i][0] \r\n\tfor j in range(1, N): \r\n\t\tdp[0][j] = dp[0][j - 1] + cost[0][j] \r\n\tfor i in range(1, N): \r\n\t\tfor j in range(1, N): \r\n\t\t\tdp[i][j] = max(dp[i - 1][j], \r\n\t\t\t\t\t\tdp[i][j - 1]) + cost[i][j] \r\n\treturn dp[N - 1][N - 1] / (2 * N - 1)", "entry_point": "maxAverageOfPath", "input": "[[3, 4, 5], [8, 7, 6], [9, 5, 11]], 3", "output": "7.2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "721_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031862", "code": "def filter_data(students,h,w):\r\n    result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w}\r\n    return result    ", "entry_point": "filter_data", "input": "{'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)}, 6.0, 70", "output": "{'Cierra Vega': (6.2, 70)}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "722_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031863", "code": "def filter_data(students,h,w):\r\n    result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w}\r\n    return result    ", "entry_point": "filter_data", "input": "{'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)}, 5.9, 67", "output": "{'Cierra Vega': (6.2, 70), 'Kierra Gentry': (6.0, 68)}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "722_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031864", "code": "def filter_data(students,h,w):\r\n    result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w}\r\n    return result    ", "entry_point": "filter_data", "input": "{'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)}, 5.7, 64", "output": "{'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "722_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031865", "code": "from operator import eq\r\ndef count_same_pair(nums1, nums2):\r\n    result = sum(map(eq, nums1, nums2))\r\n    return result", "entry_point": "count_same_pair", "input": "[1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 3, 1, 2, 6, 7, 9]", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "723_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031866", "code": "from operator import eq\r\ndef count_same_pair(nums1, nums2):\r\n    result = sum(map(eq, nums1, nums2))\r\n    return result", "entry_point": "count_same_pair", "input": "[0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8], [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "723_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031867", "code": "from operator import eq\r\ndef count_same_pair(nums1, nums2):\r\n    result = sum(map(eq, nums1, nums2))\r\n    return result", "entry_point": "count_same_pair", "input": "[2, 4, -6, -9, 11, -12, 14, -5, 17], [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "723_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031868", "code": "def power_base_sum(base, power):\r\n    return sum([int(i) for i in str(pow(base, power))])", "entry_point": "power_base_sum", "input": "2, 100", "output": "115", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "724_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031869", "code": "def power_base_sum(base, power):\r\n    return sum([int(i) for i in str(pow(base, power))])", "entry_point": "power_base_sum", "input": "8, 10", "output": "37", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "724_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031870", "code": "def power_base_sum(base, power):\r\n    return sum([int(i) for i in str(pow(base, power))])", "entry_point": "power_base_sum", "input": "8, 15", "output": "62", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "724_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031871", "code": "import re\r\ndef extract_quotation(text1):\r\n  return (re.findall(r'\"(.*?)\"', text1))", "entry_point": "extract_quotation", "input": "'Cortex \"A53\" Based \"multi\" tasking \"Processor\"'", "output": "['A53', 'multi', 'Processor']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "725_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031872", "code": "import re\r\ndef extract_quotation(text1):\r\n  return (re.findall(r'\"(.*?)\"', text1))", "entry_point": "extract_quotation", "input": "'Cast your \"favorite\" entertainment \"apps\"'", "output": "['favorite', 'apps']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "725_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031873", "code": "import re\r\ndef extract_quotation(text1):\r\n  return (re.findall(r'\"(.*?)\"', text1))", "entry_point": "extract_quotation", "input": "'Watch content \"4k Ultra HD\" resolution with \"HDR 10\" Support'", "output": "['4k Ultra HD', 'HDR 10']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "725_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031874", "code": "def multiply_elements(test_tup):\r\n  res = tuple(i * j for i, j in zip(test_tup, test_tup[1:]))\r\n  return (res) ", "entry_point": "multiply_elements", "input": "(1, 5, 7, 8, 10)", "output": "(5, 35, 56, 80)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "726_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031875", "code": "def multiply_elements(test_tup):\r\n  res = tuple(i * j for i, j in zip(test_tup, test_tup[1:]))\r\n  return (res) ", "entry_point": "multiply_elements", "input": "(2, 4, 5, 6, 7)", "output": "(8, 20, 30, 42)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "726_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031876", "code": "def multiply_elements(test_tup):\r\n  res = tuple(i * j for i, j in zip(test_tup, test_tup[1:]))\r\n  return (res) ", "entry_point": "multiply_elements", "input": "(12, 13, 14, 9, 15)", "output": "(156, 182, 126, 135)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "726_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031877", "code": "import re \r\ndef remove_char(S):\r\n  result = re.sub('[\\W_]+', '', S) \r\n  return result", "entry_point": "remove_char", "input": "'123abcjw:, .@! eiw'", "output": "'123abcjweiw'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "727_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031878", "code": "import re \r\ndef remove_char(S):\r\n  result = re.sub('[\\W_]+', '', S) \r\n  return result", "entry_point": "remove_char", "input": "'Hello1234:, ! Howare33u'", "output": "'Hello1234Howare33u'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "727_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031879", "code": "import re \r\ndef remove_char(S):\r\n  result = re.sub('[\\W_]+', '', S) \r\n  return result", "entry_point": "remove_char", "input": "'Cool543Triks@:, Make@987Trips'", "output": "'Cool543TriksMake987Trips'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "727_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031880", "code": "def sum_list(lst1,lst2):\r\n  res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] \r\n  return res_list", "entry_point": "sum_list", "input": "[10, 20, 30], [15, 25, 35]", "output": "[25, 45, 65]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "728_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031881", "code": "def sum_list(lst1,lst2):\r\n  res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] \r\n  return res_list", "entry_point": "sum_list", "input": "[1, 2, 3], [5, 6, 7]", "output": "[6, 8, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "728_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031882", "code": "def sum_list(lst1,lst2):\r\n  res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] \r\n  return res_list", "entry_point": "sum_list", "input": "[15, 20, 30], [15, 45, 75]", "output": "[30, 65, 105]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "728_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031883", "code": "def add_list(nums1,nums2):\r\n  result = map(lambda x, y: x + y, nums1, nums2)\r\n  return list(result)", "entry_point": "add_list", "input": "[1, 2, 3], [4, 5, 6]", "output": "[5, 7, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "729_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031884", "code": "def add_list(nums1,nums2):\r\n  result = map(lambda x, y: x + y, nums1, nums2)\r\n  return list(result)", "entry_point": "add_list", "input": "[1, 2], [3, 4]", "output": "[4, 6]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "729_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031885", "code": "def add_list(nums1,nums2):\r\n  result = map(lambda x, y: x + y, nums1, nums2)\r\n  return list(result)", "entry_point": "add_list", "input": "[10, 20], [50, 70]", "output": "[60, 90]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "729_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031886", "code": "from itertools import groupby\r\ndef consecutive_duplicates(nums):\r\n    return [key for key, group in groupby(nums)] ", "entry_point": "consecutive_duplicates", "input": "[0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]", "output": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "730_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031887", "code": "from itertools import groupby\r\ndef consecutive_duplicates(nums):\r\n    return [key for key, group in groupby(nums)] ", "entry_point": "consecutive_duplicates", "input": "[10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10]", "output": "[10, 15, 19, 18, 17, 26, 17, 18, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "730_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031888", "code": "from itertools import groupby\r\ndef consecutive_duplicates(nums):\r\n    return [key for key, group in groupby(nums)] ", "entry_point": "consecutive_duplicates", "input": "['a', 'a', 'b', 'c', 'd', 'd']", "output": "['a', 'b', 'c', 'd']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "730_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031889", "code": "import math\r\ndef lateralsurface_cone(r,h):\r\n  l = math.sqrt(r * r + h * h)\r\n  LSA = math.pi * r  * l\r\n  return LSA", "entry_point": "lateralsurface_cone", "input": "5, 12", "output": "204.20352248333654", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "731_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031890", "code": "import math\r\ndef lateralsurface_cone(r,h):\r\n  l = math.sqrt(r * r + h * h)\r\n  LSA = math.pi * r  * l\r\n  return LSA", "entry_point": "lateralsurface_cone", "input": "10, 15", "output": "566.3586699569488", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "731_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031891", "code": "import math\r\ndef lateralsurface_cone(r,h):\r\n  l = math.sqrt(r * r + h * h)\r\n  LSA = math.pi * r  * l\r\n  return LSA", "entry_point": "lateralsurface_cone", "input": "19, 17", "output": "1521.8090132193388", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "731_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031892", "code": "import re\r\ndef replace_specialchar(text):\r\n return (re.sub(\"[ ,.]\", \":\", text))\r", "entry_point": "replace_specialchar", "input": "'Python language, Programming language.'", "output": "'Python:language::Programming:language:'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "732_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031893", "code": "import re\r\ndef replace_specialchar(text):\r\n return (re.sub(\"[ ,.]\", \":\", text))\r", "entry_point": "replace_specialchar", "input": "'a b c,d e f'", "output": "'a:b:c:d:e:f'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "732_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031894", "code": "import re\r\ndef replace_specialchar(text):\r\n return (re.sub(\"[ ,.]\", \":\", text))\r", "entry_point": "replace_specialchar", "input": "'ram reshma,ram rahim'", "output": "'ram:reshma:ram:rahim'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "732_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031895", "code": "def find_first_occurrence(A, x):\r\n    (left, right) = (0, len(A) - 1)\r\n    result = -1\r\n    while left <= right:\r\n        mid = (left + right) // 2\r\n        if x == A[mid]:\r\n            result = mid\r\n            right = mid - 1\r\n        elif x < A[mid]:\r\n            right = mid - 1\r\n        else:\r\n            left = mid + 1\r\n    return result", "entry_point": "find_first_occurrence", "input": "[2, 5, 5, 5, 6, 6, 8, 9, 9, 9], 5", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "733_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031896", "code": "def find_first_occurrence(A, x):\r\n    (left, right) = (0, len(A) - 1)\r\n    result = -1\r\n    while left <= right:\r\n        mid = (left + right) // 2\r\n        if x == A[mid]:\r\n            result = mid\r\n            right = mid - 1\r\n        elif x < A[mid]:\r\n            right = mid - 1\r\n        else:\r\n            left = mid + 1\r\n    return result", "entry_point": "find_first_occurrence", "input": "[2, 3, 5, 5, 6, 6, 8, 9, 9, 9], 5", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "733_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031897", "code": "def find_first_occurrence(A, x):\r\n    (left, right) = (0, len(A) - 1)\r\n    result = -1\r\n    while left <= right:\r\n        mid = (left + right) // 2\r\n        if x == A[mid]:\r\n            result = mid\r\n            right = mid - 1\r\n        elif x < A[mid]:\r\n            right = mid - 1\r\n        else:\r\n            left = mid + 1\r\n    return result", "entry_point": "find_first_occurrence", "input": "[2, 4, 1, 5, 6, 6, 8, 9, 9, 9], 6", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "733_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031898", "code": "def sum_Of_Subarray_Prod(arr,n):\r\n    ans = 0\r\n    res = 0\r\n    i = n - 1\r\n    while (i >= 0):\r\n        incr = arr[i]*(1 + res)\r\n        ans += incr\r\n        res = incr\r\n        i -= 1\r\n    return (ans)", "entry_point": "sum_Of_Subarray_Prod", "input": "[1, 2, 3], 3", "output": "20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "734_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031899", "code": "def sum_Of_Subarray_Prod(arr,n):\r\n    ans = 0\r\n    res = 0\r\n    i = n - 1\r\n    while (i >= 0):\r\n        incr = arr[i]*(1 + res)\r\n        ans += incr\r\n        res = incr\r\n        i -= 1\r\n    return (ans)", "entry_point": "sum_Of_Subarray_Prod", "input": "[1, 2], 2", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "734_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031900", "code": "def sum_Of_Subarray_Prod(arr,n):\r\n    ans = 0\r\n    res = 0\r\n    i = n - 1\r\n    while (i >= 0):\r\n        incr = arr[i]*(1 + res)\r\n        ans += incr\r\n        res = incr\r\n        i -= 1\r\n    return (ans)", "entry_point": "sum_Of_Subarray_Prod", "input": "[1, 2, 3, 4], 4", "output": "84", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "734_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031901", "code": "def set_middle_bits(n):  \r\n    n |= n >> 1; \r\n    n |= n >> 2; \r\n    n |= n >> 4; \r\n    n |= n >> 8; \r\n    n |= n >> 16;  \r\n    return (n >> 1) ^ 1\r\ndef toggle_middle_bits(n): \r\n    if (n == 1): \r\n        return 1\r\n    return n ^ set_middle_bits(n) ", "entry_point": "toggle_middle_bits", "input": "9", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "735_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031902", "code": "def set_middle_bits(n):  \r\n    n |= n >> 1; \r\n    n |= n >> 2; \r\n    n |= n >> 4; \r\n    n |= n >> 8; \r\n    n |= n >> 16;  \r\n    return (n >> 1) ^ 1\r\ndef toggle_middle_bits(n): \r\n    if (n == 1): \r\n        return 1\r\n    return n ^ set_middle_bits(n) ", "entry_point": "toggle_middle_bits", "input": "10", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "735_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031903", "code": "def set_middle_bits(n):  \r\n    n |= n >> 1; \r\n    n |= n >> 2; \r\n    n |= n >> 4; \r\n    n |= n >> 8; \r\n    n |= n >> 16;  \r\n    return (n >> 1) ^ 1\r\ndef toggle_middle_bits(n): \r\n    if (n == 1): \r\n        return 1\r\n    return n ^ set_middle_bits(n) ", "entry_point": "toggle_middle_bits", "input": "11", "output": "13", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "735_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031904", "code": "import bisect\r\ndef left_insertion(a, x):\r\n    i = bisect.bisect_left(a, x)\r\n    return i", "entry_point": "left_insertion", "input": "[1, 2, 4, 5], 6", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "736_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031905", "code": "import bisect\r\ndef left_insertion(a, x):\r\n    i = bisect.bisect_left(a, x)\r\n    return i", "entry_point": "left_insertion", "input": "[1, 2, 4, 5], 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "736_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031906", "code": "import bisect\r\ndef left_insertion(a, x):\r\n    i = bisect.bisect_left(a, x)\r\n    return i", "entry_point": "left_insertion", "input": "[1, 2, 4, 5], 7", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "736_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031907", "code": "import re \r\nregex = '^[aeiouAEIOU][A-Za-z0-9_]*'\r\ndef check_str(string): \r\n\tif(re.search(regex, string)): \r\n\t\treturn (\"Valid\") \r\n\telse: \r\n\t\treturn (\"Invalid\") ", "entry_point": "check_str", "input": "'annie'", "output": "'Valid'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "737_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031908", "code": "import re \r\nregex = '^[aeiouAEIOU][A-Za-z0-9_]*'\r\ndef check_str(string): \r\n\tif(re.search(regex, string)): \r\n\t\treturn (\"Valid\") \r\n\telse: \r\n\t\treturn (\"Invalid\") ", "entry_point": "check_str", "input": "'dawood'", "output": "'Invalid'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "737_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031909", "code": "import re \r\nregex = '^[aeiouAEIOU][A-Za-z0-9_]*'\r\ndef check_str(string): \r\n\tif(re.search(regex, string)): \r\n\t\treturn (\"Valid\") \r\n\telse: \r\n\t\treturn (\"Invalid\") ", "entry_point": "check_str", "input": "'Else'", "output": "'Valid'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "737_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031910", "code": "def geometric_sum(n):\r\n  if n < 0:\r\n    return 0\r\n  else:\r\n    return 1 / (pow(2, n)) + geometric_sum(n - 1)", "entry_point": "geometric_sum", "input": "7", "output": "1.9921875", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "738_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031911", "code": "def geometric_sum(n):\r\n  if n < 0:\r\n    return 0\r\n  else:\r\n    return 1 / (pow(2, n)) + geometric_sum(n - 1)", "entry_point": "geometric_sum", "input": "4", "output": "1.9375", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "738_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031912", "code": "def geometric_sum(n):\r\n  if n < 0:\r\n    return 0\r\n  else:\r\n    return 1 / (pow(2, n)) + geometric_sum(n - 1)", "entry_point": "geometric_sum", "input": "8", "output": "1.99609375", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "738_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031913", "code": "import math \r\ndef find_Index(n): \r\n    x = math.sqrt(2 * math.pow(10,(n - 1))); \r\n    return round(x); ", "entry_point": "find_Index", "input": "2", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "739_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031914", "code": "import math \r\ndef find_Index(n): \r\n    x = math.sqrt(2 * math.pow(10,(n - 1))); \r\n    return round(x); ", "entry_point": "find_Index", "input": "3", "output": "14", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "739_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031915", "code": "import math \r\ndef find_Index(n): \r\n    x = math.sqrt(2 * math.pow(10,(n - 1))); \r\n    return round(x); ", "entry_point": "find_Index", "input": "4", "output": "45", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "739_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031916", "code": "def tuple_to_dict(test_tup):\r\n  res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))\r\n  return (res) ", "entry_point": "tuple_to_dict", "input": "(1, 5, 7, 10, 13, 5)", "output": "{1: 5, 7: 10, 13: 5}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "740_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031917", "code": "def tuple_to_dict(test_tup):\r\n  res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))\r\n  return (res) ", "entry_point": "tuple_to_dict", "input": "(1, 2, 3, 4, 5, 6)", "output": "{1: 2, 3: 4, 5: 6}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "740_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031918", "code": "def tuple_to_dict(test_tup):\r\n  res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))\r\n  return (res) ", "entry_point": "tuple_to_dict", "input": "(7, 8, 9, 10, 11, 12)", "output": "{7: 8, 9: 10, 11: 12}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "740_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031919", "code": "def all_Characters_Same(s) :\r\n    n = len(s)\r\n    for i in range(1,n) :\r\n        if s[i] != s[0] :\r\n            return False\r\n    return True", "entry_point": "all_Characters_Same", "input": "'python'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "741_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031920", "code": "def all_Characters_Same(s) :\r\n    n = len(s)\r\n    for i in range(1,n) :\r\n        if s[i] != s[0] :\r\n            return False\r\n    return True", "entry_point": "all_Characters_Same", "input": "'aaa'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "741_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031921", "code": "def all_Characters_Same(s) :\r\n    n = len(s)\r\n    for i in range(1,n) :\r\n        if s[i] != s[0] :\r\n            return False\r\n    return True", "entry_point": "all_Characters_Same", "input": "'data'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "741_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031922", "code": "import math\r\ndef area_tetrahedron(side):\r\n  area = math.sqrt(3)*(side*side)\r\n  return area", "entry_point": "area_tetrahedron", "input": "3", "output": "15.588457268119894", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "742_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031923", "code": "import math\r\ndef area_tetrahedron(side):\r\n  area = math.sqrt(3)*(side*side)\r\n  return area", "entry_point": "area_tetrahedron", "input": "20", "output": "692.8203230275509", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "742_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031924", "code": "import math\r\ndef area_tetrahedron(side):\r\n  area = math.sqrt(3)*(side*side)\r\n  return area", "entry_point": "area_tetrahedron", "input": "10", "output": "173.20508075688772", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "742_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031925", "code": "def rotate_right(list1,m,n):\r\n  result =  list1[-(m):]+list1[:-(n)]\r\n  return result", "entry_point": "rotate_right", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, 4", "output": "[8, 9, 10, 1, 2, 3, 4, 5, 6]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "743_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031926", "code": "def rotate_right(list1,m,n):\r\n  result =  list1[-(m):]+list1[:-(n)]\r\n  return result", "entry_point": "rotate_right", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2, 2", "output": "[9, 10, 1, 2, 3, 4, 5, 6, 7, 8]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "743_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031927", "code": "def rotate_right(list1,m,n):\r\n  result =  list1[-(m):]+list1[:-(n)]\r\n  return result", "entry_point": "rotate_right", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, 2", "output": "[6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "743_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031928", "code": "def check_none(test_tup):\r\n  res = any(map(lambda ele: ele is None, test_tup))\r\n  return (res) ", "entry_point": "check_none", "input": "(10, 4, 5, 6, None)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "744_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031929", "code": "def check_none(test_tup):\r\n  res = any(map(lambda ele: ele is None, test_tup))\r\n  return (res) ", "entry_point": "check_none", "input": "(7, 8, 9, 11, 14)", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "744_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031930", "code": "def check_none(test_tup):\r\n  res = any(map(lambda ele: ele is None, test_tup))\r\n  return (res) ", "entry_point": "check_none", "input": "(1, 2, 3, 4, None)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "744_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031931", "code": "def divisible_by_digits(startnum, endnum):\r\n    return [n for n in range(startnum, endnum+1) \\\r\n                if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]", "entry_point": "divisible_by_digits", "input": "1, 22", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "745_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031932", "code": "def divisible_by_digits(startnum, endnum):\r\n    return [n for n in range(startnum, endnum+1) \\\r\n                if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]", "entry_point": "divisible_by_digits", "input": "1, 15", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "745_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031933", "code": "def divisible_by_digits(startnum, endnum):\r\n    return [n for n in range(startnum, endnum+1) \\\r\n                if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]", "entry_point": "divisible_by_digits", "input": "20, 25", "output": "[22, 24]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "745_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031934", "code": "def sector_area(r,a):\r\n    pi=22/7\r\n    if a >= 360:\r\n        return None\r\n    sectorarea = (pi*r**2) * (a/360)\r\n    return sectorarea", "entry_point": "sector_area", "input": "4, 45", "output": "6.285714285714286", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "746_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031935", "code": "def sector_area(r,a):\r\n    pi=22/7\r\n    if a >= 360:\r\n        return None\r\n    sectorarea = (pi*r**2) * (a/360)\r\n    return sectorarea", "entry_point": "sector_area", "input": "9, 45", "output": "31.82142857142857", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "746_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031936", "code": "def lcs_of_three(X, Y, Z, m, n, o): \r\n\tL = [[[0 for i in range(o+1)] for j in range(n+1)] \r\n\t\tfor k in range(m+1)] \r\n\tfor i in range(m+1): \r\n\t\tfor j in range(n+1): \r\n\t\t\tfor k in range(o+1): \r\n\t\t\t\tif (i == 0 or j == 0 or k == 0): \r\n\t\t\t\t\tL[i][j][k] = 0\r\n\t\t\t\telif (X[i-1] == Y[j-1] and\r\n\t\t\t\t\tX[i-1] == Z[k-1]): \r\n\t\t\t\t\tL[i][j][k] = L[i-1][j-1][k-1] + 1\r\n\t\t\t\telse: \r\n\t\t\t\t\tL[i][j][k] = max(max(L[i-1][j][k], \r\n\t\t\t\t\tL[i][j-1][k]), \r\n\t\t\t\t\t\t\t\t\tL[i][j][k-1]) \r\n\treturn L[m][n][o]", "entry_point": "lcs_of_three", "input": "'AGGT12', '12TXAYB', '12XBA', 6, 7, 5", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "747_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031937", "code": "def lcs_of_three(X, Y, Z, m, n, o): \r\n\tL = [[[0 for i in range(o+1)] for j in range(n+1)] \r\n\t\tfor k in range(m+1)] \r\n\tfor i in range(m+1): \r\n\t\tfor j in range(n+1): \r\n\t\t\tfor k in range(o+1): \r\n\t\t\t\tif (i == 0 or j == 0 or k == 0): \r\n\t\t\t\t\tL[i][j][k] = 0\r\n\t\t\t\telif (X[i-1] == Y[j-1] and\r\n\t\t\t\t\tX[i-1] == Z[k-1]): \r\n\t\t\t\t\tL[i][j][k] = L[i-1][j-1][k-1] + 1\r\n\t\t\t\telse: \r\n\t\t\t\t\tL[i][j][k] = max(max(L[i-1][j][k], \r\n\t\t\t\t\tL[i][j-1][k]), \r\n\t\t\t\t\t\t\t\t\tL[i][j][k-1]) \r\n\treturn L[m][n][o]", "entry_point": "lcs_of_three", "input": "'Reels', 'Reelsfor', 'ReelsforReels', 5, 8, 13", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "747_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031938", "code": "def lcs_of_three(X, Y, Z, m, n, o): \r\n\tL = [[[0 for i in range(o+1)] for j in range(n+1)] \r\n\t\tfor k in range(m+1)] \r\n\tfor i in range(m+1): \r\n\t\tfor j in range(n+1): \r\n\t\t\tfor k in range(o+1): \r\n\t\t\t\tif (i == 0 or j == 0 or k == 0): \r\n\t\t\t\t\tL[i][j][k] = 0\r\n\t\t\t\telif (X[i-1] == Y[j-1] and\r\n\t\t\t\t\tX[i-1] == Z[k-1]): \r\n\t\t\t\t\tL[i][j][k] = L[i-1][j-1][k-1] + 1\r\n\t\t\t\telse: \r\n\t\t\t\t\tL[i][j][k] = max(max(L[i-1][j][k], \r\n\t\t\t\t\tL[i][j-1][k]), \r\n\t\t\t\t\t\t\t\t\tL[i][j][k-1]) \r\n\treturn L[m][n][o]", "entry_point": "lcs_of_three", "input": "'abcd1e2', 'bc12ea', 'bd1ea', 7, 6, 5", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "747_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031939", "code": "import re\r\ndef capital_words_spaces(str1):\r\n  return re.sub(r\"(\\w)([A-Z])\", r\"\\1 \\2\", str1)", "entry_point": "capital_words_spaces", "input": "'Python'", "output": "'Python'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "748_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031940", "code": "import re\r\ndef capital_words_spaces(str1):\r\n  return re.sub(r\"(\\w)([A-Z])\", r\"\\1 \\2\", str1)", "entry_point": "capital_words_spaces", "input": "'PythonProgrammingExamples'", "output": "'Python Programming Examples'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "748_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031941", "code": "import re\r\ndef capital_words_spaces(str1):\r\n  return re.sub(r\"(\\w)([A-Z])\", r\"\\1 \\2\", str1)", "entry_point": "capital_words_spaces", "input": "'GetReadyToBeCodingFreak'", "output": "'Get Ready To Be Coding Freak'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "748_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031942", "code": "def sort_numeric_strings(nums_str):\r\n    result = [int(x) for x in nums_str]\r\n    result.sort()\r\n    return result", "entry_point": "sort_numeric_strings", "input": "['4', '12', '45', '7', '0', '100', '200', '-12', '-500']", "output": "[-500, -12, 0, 4, 7, 12, 45, 100, 200]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "749_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031943", "code": "def sort_numeric_strings(nums_str):\r\n    result = [int(x) for x in nums_str]\r\n    result.sort()\r\n    return result", "entry_point": "sort_numeric_strings", "input": "['2', '3', '8', '4', '7', '9', '8', '2', '6', '5', '1', '6', '1', '2', '3', '4', '6', '9', '1', '2']", "output": "[1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8, 9, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "749_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031944", "code": "def sort_numeric_strings(nums_str):\r\n    result = [int(x) for x in nums_str]\r\n    result.sort()\r\n    return result", "entry_point": "sort_numeric_strings", "input": "['1', '3', '5', '7', '1', '3', '13', '15', '17', '5', '7 ', '9', '1', '11']", "output": "[1, 1, 1, 3, 3, 5, 5, 7, 7, 9, 11, 13, 15, 17]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "749_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031945", "code": "def add_tuple(test_list, test_tup):\r\n  test_list += test_tup\r\n  return (test_list) ", "entry_point": "add_tuple", "input": "[5, 6, 7], (9, 10)", "output": "[5, 6, 7, 9, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "750_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031946", "code": "def add_tuple(test_list, test_tup):\r\n  test_list += test_tup\r\n  return (test_list) ", "entry_point": "add_tuple", "input": "[6, 7, 8], (10, 11)", "output": "[6, 7, 8, 10, 11]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "750_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031947", "code": "def add_tuple(test_list, test_tup):\r\n  test_list += test_tup\r\n  return (test_list) ", "entry_point": "add_tuple", "input": "[7, 8, 9], (11, 12)", "output": "[7, 8, 9, 11, 12]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "750_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031948", "code": "def check_min_heap(arr, i):\r\n    if 2 * i + 2 > len(arr):\r\n        return True\r\n    left_child = (arr[i] <= arr[2 * i + 1]) and check_min_heap(arr, 2 * i + 1)\r\n    right_child = (2 * i + 2 == len(arr)) or (arr[i] <= arr[2 * i + 2] \r\n                                      and check_min_heap(arr, 2 * i + 2))\r\n    return left_child and right_child", "entry_point": "check_min_heap", "input": "[1, 2, 3, 4, 5, 6], 0", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "751_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031949", "code": "def check_min_heap(arr, i):\r\n    if 2 * i + 2 > len(arr):\r\n        return True\r\n    left_child = (arr[i] <= arr[2 * i + 1]) and check_min_heap(arr, 2 * i + 1)\r\n    right_child = (2 * i + 2 == len(arr)) or (arr[i] <= arr[2 * i + 2] \r\n                                      and check_min_heap(arr, 2 * i + 2))\r\n    return left_child and right_child", "entry_point": "check_min_heap", "input": "[2, 3, 4, 5, 10, 15], 0", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "751_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031950", "code": "def check_min_heap(arr, i):\r\n    if 2 * i + 2 > len(arr):\r\n        return True\r\n    left_child = (arr[i] <= arr[2 * i + 1]) and check_min_heap(arr, 2 * i + 1)\r\n    right_child = (2 * i + 2 == len(arr)) or (arr[i] <= arr[2 * i + 2] \r\n                                      and check_min_heap(arr, 2 * i + 2))\r\n    return left_child and right_child", "entry_point": "check_min_heap", "input": "[2, 10, 4, 5, 3, 15], 0", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "751_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031951", "code": "def jacobsthal_num(n): \r\n\tdp = [0] * (n + 1) \r\n\tdp[0] = 0\r\n\tdp[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tdp[i] = dp[i - 1] + 2 * dp[i - 2] \r\n\treturn dp[n]", "entry_point": "jacobsthal_num", "input": "5", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "752_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031952", "code": "def jacobsthal_num(n): \r\n\tdp = [0] * (n + 1) \r\n\tdp[0] = 0\r\n\tdp[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tdp[i] = dp[i - 1] + 2 * dp[i - 2] \r\n\treturn dp[n]", "entry_point": "jacobsthal_num", "input": "2", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "752_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031953", "code": "def jacobsthal_num(n): \r\n\tdp = [0] * (n + 1) \r\n\tdp[0] = 0\r\n\tdp[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tdp[i] = dp[i - 1] + 2 * dp[i - 2] \r\n\treturn dp[n]", "entry_point": "jacobsthal_num", "input": "4", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "752_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031954", "code": "def min_k(test_list, K):\r\n  res = sorted(test_list, key = lambda x: x[1])[:K]\r\n  return (res) ", "entry_point": "min_k", "input": "[('Manjeet', 10), ('Akshat', 4), ('Akash', 2), ('Nikhil', 8)], 2", "output": "[('Akash', 2), ('Akshat', 4)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "753_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031955", "code": "def min_k(test_list, K):\r\n  res = sorted(test_list, key = lambda x: x[1])[:K]\r\n  return (res) ", "entry_point": "min_k", "input": "[('Sanjeev', 11), ('Angat', 5), ('Akash', 3), ('Nepin', 9)], 3", "output": "[('Akash', 3), ('Angat', 5), ('Nepin', 9)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "753_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031956", "code": "def min_k(test_list, K):\r\n  res = sorted(test_list, key = lambda x: x[1])[:K]\r\n  return (res) ", "entry_point": "min_k", "input": "[('tanmay', 14), ('Amer', 11), ('Ayesha', 9), ('SKD', 16)], 1", "output": "[('Ayesha', 9)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "753_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031957", "code": "def extract_index_list(l1, l2, l3):\r\n    result = []\r\n    for m, n, o in zip(l1, l2, l3):\r\n        if (m == n == o):\r\n            result.append(m)\r\n    return result", "entry_point": "extract_index_list", "input": "[1, 1, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 7], [0, 1, 2, 3, 4, 5, 7]", "output": "[1, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "754_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031958", "code": "def extract_index_list(l1, l2, l3):\r\n    result = []\r\n    for m, n, o in zip(l1, l2, l3):\r\n        if (m == n == o):\r\n            result.append(m)\r\n    return result", "entry_point": "extract_index_list", "input": "[1, 1, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 6, 5], [0, 1, 2, 3, 4, 6, 7]", "output": "[1, 6]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "754_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031959", "code": "def extract_index_list(l1, l2, l3):\r\n    result = []\r\n    for m, n, o in zip(l1, l2, l3):\r\n        if (m == n == o):\r\n            result.append(m)\r\n    return result", "entry_point": "extract_index_list", "input": "[1, 1, 3, 4, 6, 5, 6], [0, 1, 2, 3, 4, 5, 7], [0, 1, 2, 3, 4, 5, 7]", "output": "[1, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "754_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031960", "code": "def second_smallest(numbers):\r\n  if (len(numbers)<2):\r\n    return\r\n  if ((len(numbers)==2)  and (numbers[0] == numbers[1]) ):\r\n    return\r\n  dup_items = set()\r\n  uniq_items = []\r\n  for x in numbers:\r\n    if x not in dup_items:\r\n      uniq_items.append(x)\r\n      dup_items.add(x)\r\n  uniq_items.sort()    \r\n  return  uniq_items[1] ", "entry_point": "second_smallest", "input": "[1, 2, -8, -2, 0, -2]", "output": "-2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "755_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031961", "code": "def second_smallest(numbers):\r\n  if (len(numbers)<2):\r\n    return\r\n  if ((len(numbers)==2)  and (numbers[0] == numbers[1]) ):\r\n    return\r\n  dup_items = set()\r\n  uniq_items = []\r\n  for x in numbers:\r\n    if x not in dup_items:\r\n      uniq_items.append(x)\r\n      dup_items.add(x)\r\n  uniq_items.sort()    \r\n  return  uniq_items[1] ", "entry_point": "second_smallest", "input": "[1, 1, -0.5, 0, 2, -2, -2]", "output": "-0.5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "755_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031962", "code": "import re\r\ndef text_match_zero_one(text):\r\n        patterns = 'ab?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_zero_one", "input": "'ac'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "756_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031963", "code": "import re\r\ndef text_match_zero_one(text):\r\n        patterns = 'ab?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_zero_one", "input": "'dc'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "756_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031964", "code": "import re\r\ndef text_match_zero_one(text):\r\n        patterns = 'ab?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_zero_one", "input": "'abbbba'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "756_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031965", "code": "def count_reverse_pairs(test_list):\r\n  res = sum([1 for idx in range(0, len(test_list)) for idxn in range(idx, len( \r\n\ttest_list)) if test_list[idxn] == str(''.join(list(reversed(test_list[idx]))))]) \r\n  return str(res)", "entry_point": "count_reverse_pairs", "input": "['julia', 'best', 'tseb', 'for', 'ailuj']", "output": "'2'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "757_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031966", "code": "def count_reverse_pairs(test_list):\r\n  res = sum([1 for idx in range(0, len(test_list)) for idxn in range(idx, len( \r\n\ttest_list)) if test_list[idxn] == str(''.join(list(reversed(test_list[idx]))))]) \r\n  return str(res)", "entry_point": "count_reverse_pairs", "input": "['geeks', 'best', 'for', 'skeeg']", "output": "'1'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "757_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031967", "code": "def count_reverse_pairs(test_list):\r\n  res = sum([1 for idx in range(0, len(test_list)) for idxn in range(idx, len( \r\n\ttest_list)) if test_list[idxn] == str(''.join(list(reversed(test_list[idx]))))]) \r\n  return str(res)", "entry_point": "count_reverse_pairs", "input": "['makes', 'best', 'sekam', 'for', 'rof']", "output": "'2'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "757_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031968", "code": "def unique_sublists(list1):\r\n    result ={}\r\n    for l in  list1: \r\n        result.setdefault(tuple(l), list()).append(1) \r\n    for a, b in result.items(): \r\n        result[a] = sum(b)\r\n    return result", "entry_point": "unique_sublists", "input": "[[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]]", "output": "{(1, 3): 2, (5, 7): 2, (13, 15, 17): 1, (9, 11): 1}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "758_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031969", "code": "def unique_sublists(list1):\r\n    result ={}\r\n    for l in  list1: \r\n        result.setdefault(tuple(l), list()).append(1) \r\n    for a, b in result.items(): \r\n        result[a] = sum(b)\r\n    return result", "entry_point": "unique_sublists", "input": "[['green', 'orange'], ['black'], ['green', 'orange'], ['white']]", "output": "{('green', 'orange'): 2, ('black',): 1, ('white',): 1}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "758_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031970", "code": "def unique_sublists(list1):\r\n    result ={}\r\n    for l in  list1: \r\n        result.setdefault(tuple(l), list()).append(1) \r\n    for a, b in result.items(): \r\n        result[a] = sum(b)\r\n    return result", "entry_point": "unique_sublists", "input": "[[10, 20, 30, 40], [60, 70, 50, 50], [90, 100, 200]]", "output": "{(10, 20, 30, 40): 1, (60, 70, 50, 50): 1, (90, 100, 200): 1}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "758_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031971", "code": "def is_decimal(num):\r\n    import re\r\n    dnumre = re.compile(r\"\"\"^[0-9]+(\\.[0-9]{1,2})?$\"\"\")\r\n    result = dnumre.search(num)\r\n    return bool(result)", "entry_point": "is_decimal", "input": "'123.11'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "759_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031972", "code": "def is_decimal(num):\r\n    import re\r\n    dnumre = re.compile(r\"\"\"^[0-9]+(\\.[0-9]{1,2})?$\"\"\")\r\n    result = dnumre.search(num)\r\n    return bool(result)", "entry_point": "is_decimal", "input": "'e666.86'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "759_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031973", "code": "def is_decimal(num):\r\n    import re\r\n    dnumre = re.compile(r\"\"\"^[0-9]+(\\.[0-9]{1,2})?$\"\"\")\r\n    result = dnumre.search(num)\r\n    return bool(result)", "entry_point": "is_decimal", "input": "'3.124587'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "759_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031974", "code": "def unique_Element(arr,n):\r\n    s = set(arr)\r\n    if (len(s) == 1):\r\n        return ('YES')\r\n    else:\r\n        return ('NO')", "entry_point": "unique_Element", "input": "[1, 1, 1], 3", "output": "'YES'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "760_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031975", "code": "def unique_Element(arr,n):\r\n    s = set(arr)\r\n    if (len(s) == 1):\r\n        return ('YES')\r\n    else:\r\n        return ('NO')", "entry_point": "unique_Element", "input": "[1, 2, 1, 2], 4", "output": "'NO'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "760_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031976", "code": "def unique_Element(arr,n):\r\n    s = set(arr)\r\n    if (len(s) == 1):\r\n        return ('YES')\r\n    else:\r\n        return ('NO')", "entry_point": "unique_Element", "input": "[1, 2, 3, 4, 5], 5", "output": "'NO'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "760_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031977", "code": "def arc_length(d,a):\r\n    pi=22/7\r\n    if a >= 360:\r\n        return None\r\n    arclength = (pi*d) * (a/360)\r\n    return arclength", "entry_point": "arc_length", "input": "9, 45", "output": "3.5357142857142856", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "761_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031978", "code": "def arc_length(d,a):\r\n    pi=22/7\r\n    if a >= 360:\r\n        return None\r\n    arclength = (pi*d) * (a/360)\r\n    return arclength", "entry_point": "arc_length", "input": "5, 270", "output": "11.785714285714285", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "761_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031979", "code": "def check_monthnumber_number(monthnum3):\r\n  if(monthnum3==4 or monthnum3==6 or monthnum3==9 or monthnum3==11):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnumber_number", "input": "6", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "762_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031980", "code": "def check_monthnumber_number(monthnum3):\r\n  if(monthnum3==4 or monthnum3==6 or monthnum3==9 or monthnum3==11):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnumber_number", "input": "2", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "762_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031981", "code": "def check_monthnumber_number(monthnum3):\r\n  if(monthnum3==4 or monthnum3==6 or monthnum3==9 or monthnum3==11):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnumber_number", "input": "12", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "762_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031982", "code": "def find_Min_Diff(arr,n): \r\n    arr = sorted(arr) \r\n    diff = 10**20 \r\n    for i in range(n-1): \r\n        if arr[i+1] - arr[i] < diff: \r\n            diff = arr[i+1] - arr[i]  \r\n    return diff ", "entry_point": "find_Min_Diff", "input": "(1, 5, 3, 19, 18, 25), 6", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "763_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031983", "code": "def find_Min_Diff(arr,n): \r\n    arr = sorted(arr) \r\n    diff = 10**20 \r\n    for i in range(n-1): \r\n        if arr[i+1] - arr[i] < diff: \r\n            diff = arr[i+1] - arr[i]  \r\n    return diff ", "entry_point": "find_Min_Diff", "input": "(4, 3, 2, 6), 4", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "763_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031984", "code": "def find_Min_Diff(arr,n): \r\n    arr = sorted(arr) \r\n    diff = 10**20 \r\n    for i in range(n-1): \r\n        if arr[i+1] - arr[i] < diff: \r\n            diff = arr[i+1] - arr[i]  \r\n    return diff ", "entry_point": "find_Min_Diff", "input": "(30, 5, 20, 9), 4", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "763_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031985", "code": "def number_ctr(str):\r\n      number_ctr= 0\r\n      for i in range(len(str)):\r\n          if str[i] >= '0' and str[i] <= '9': number_ctr += 1     \r\n      return  number_ctr", "entry_point": "number_ctr", "input": "'program2bedone'", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "764_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031986", "code": "def number_ctr(str):\r\n      number_ctr= 0\r\n      for i in range(len(str)):\r\n          if str[i] >= '0' and str[i] <= '9': number_ctr += 1     \r\n      return  number_ctr", "entry_point": "number_ctr", "input": "'3wonders'", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "764_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031987", "code": "def number_ctr(str):\r\n      number_ctr= 0\r\n      for i in range(len(str)):\r\n          if str[i] >= '0' and str[i] <= '9': number_ctr += 1     \r\n      return  number_ctr", "entry_point": "number_ctr", "input": "'123'", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "764_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031988", "code": "import math \r\ndef is_polite(n): \r\n\tn = n + 1\r\n\treturn (int)(n+(math.log((n + math.log(n, 2)), 2))) ", "entry_point": "is_polite", "input": "7", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "765_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031989", "code": "import math \r\ndef is_polite(n): \r\n\tn = n + 1\r\n\treturn (int)(n+(math.log((n + math.log(n, 2)), 2))) ", "entry_point": "is_polite", "input": "4", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "765_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031990", "code": "import math \r\ndef is_polite(n): \r\n\tn = n + 1\r\n\treturn (int)(n+(math.log((n + math.log(n, 2)), 2))) ", "entry_point": "is_polite", "input": "9", "output": "13", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "765_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031991", "code": "def pair_wise(l1):\r\n    temp = []\r\n    for i in range(len(l1) - 1):\r\n        current_element, next_element = l1[i], l1[i + 1]\r\n        x = (current_element, next_element)\r\n        temp.append(x)\r\n    return temp", "entry_point": "pair_wise", "input": "[1, 1, 2, 3, 3, 4, 4, 5]", "output": "[(1, 1), (1, 2), (2, 3), (3, 3), (3, 4), (4, 4), (4, 5)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "766_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031992", "code": "def pair_wise(l1):\r\n    temp = []\r\n    for i in range(len(l1) - 1):\r\n        current_element, next_element = l1[i], l1[i + 1]\r\n        x = (current_element, next_element)\r\n        temp.append(x)\r\n    return temp", "entry_point": "pair_wise", "input": "[1, 5, 7, 9, 10]", "output": "[(1, 5), (5, 7), (7, 9), (9, 10)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "766_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031993", "code": "def pair_wise(l1):\r\n    temp = []\r\n    for i in range(len(l1) - 1):\r\n        current_element, next_element = l1[i], l1[i + 1]\r\n        x = (current_element, next_element)\r\n        temp.append(x)\r\n    return temp", "entry_point": "pair_wise", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9), (9, 10)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "766_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031994", "code": "def get_Pairs_Count(arr,n,sum):\r\n    count = 0  \r\n    for i in range(0,n):\r\n        for j in range(i + 1,n):\r\n            if arr[i] + arr[j] == sum:\r\n                count += 1\r\n    return count", "entry_point": "get_Pairs_Count", "input": "[1, 1, 1, 1], 4, 2", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "767_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031995", "code": "def get_Pairs_Count(arr,n,sum):\r\n    count = 0  \r\n    for i in range(0,n):\r\n        for j in range(i + 1,n):\r\n            if arr[i] + arr[j] == sum:\r\n                count += 1\r\n    return count", "entry_point": "get_Pairs_Count", "input": "[1, 5, 7, -1, 5], 5, 6", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "767_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031996", "code": "def get_Pairs_Count(arr,n,sum):\r\n    count = 0  \r\n    for i in range(0,n):\r\n        for j in range(i + 1,n):\r\n            if arr[i] + arr[j] == sum:\r\n                count += 1\r\n    return count", "entry_point": "get_Pairs_Count", "input": "[1, -2, 3], 3, 1", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "767_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031997", "code": "def check_Odd_Parity(x): \r\n    parity = 0\r\n    while (x != 0): \r\n        x = x & (x - 1) \r\n        parity += 1\r\n    if (parity % 2 == 1): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "check_Odd_Parity", "input": "13", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "768_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031998", "code": "def check_Odd_Parity(x): \r\n    parity = 0\r\n    while (x != 0): \r\n        x = x & (x - 1) \r\n        parity += 1\r\n    if (parity % 2 == 1): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "check_Odd_Parity", "input": "21", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "768_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0031999", "code": "def check_Odd_Parity(x): \r\n    parity = 0\r\n    while (x != 0): \r\n        x = x & (x - 1) \r\n        parity += 1\r\n    if (parity % 2 == 1): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "check_Odd_Parity", "input": "18", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "768_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032000", "code": "def Diff(li1,li2):\r\n    return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))\r\n ", "entry_point": "Diff", "input": "[10, 15, 20, 25, 30, 35, 40], [25, 40, 35]", "output": "[10, 20, 30, 15]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "769_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032001", "code": "def Diff(li1,li2):\r\n    return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))\r\n ", "entry_point": "Diff", "input": "[1, 2, 3, 4, 5], [6, 7, 1]", "output": "[2, 3, 4, 5, 6, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "769_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032002", "code": "def Diff(li1,li2):\r\n    return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))\r\n ", "entry_point": "Diff", "input": "[1, 2, 3], [6, 7, 1]", "output": "[2, 3, 6, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "769_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032003", "code": "def odd_Num_Sum(n) : \r\n    j = 0\r\n    sm = 0\r\n    for i in range(1,n + 1) : \r\n        j = (2*i-1) \r\n        sm = sm + (j*j*j*j)   \r\n    return sm ", "entry_point": "odd_Num_Sum", "input": "2", "output": "82", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "770_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032004", "code": "def odd_Num_Sum(n) : \r\n    j = 0\r\n    sm = 0\r\n    for i in range(1,n + 1) : \r\n        j = (2*i-1) \r\n        sm = sm + (j*j*j*j)   \r\n    return sm ", "entry_point": "odd_Num_Sum", "input": "3", "output": "707", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "770_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032005", "code": "def odd_Num_Sum(n) : \r\n    j = 0\r\n    sm = 0\r\n    for i in range(1,n + 1) : \r\n        j = (2*i-1) \r\n        sm = sm + (j*j*j*j)   \r\n    return sm ", "entry_point": "odd_Num_Sum", "input": "4", "output": "3108", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "770_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032006", "code": "from collections import deque\r\ndef check_expression(exp):\r\n    if len(exp) & 1:\r\n        return False\r\n    stack = deque()\r\n    for ch in exp:\r\n        if ch == '(' or ch == '{' or ch == '[':\r\n            stack.append(ch)\r\n        if ch == ')' or ch == '}' or ch == ']':\r\n            if not stack:\r\n                return False\r\n            top = stack.pop()\r\n            if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):\r\n                return False\r\n    return not stack", "entry_point": "check_expression", "input": "'{()}[{}]'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "771_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032007", "code": "from collections import deque\r\ndef check_expression(exp):\r\n    if len(exp) & 1:\r\n        return False\r\n    stack = deque()\r\n    for ch in exp:\r\n        if ch == '(' or ch == '{' or ch == '[':\r\n            stack.append(ch)\r\n        if ch == ')' or ch == '}' or ch == ']':\r\n            if not stack:\r\n                return False\r\n            top = stack.pop()\r\n            if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):\r\n                return False\r\n    return not stack", "entry_point": "check_expression", "input": "'{()}[{]'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "771_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032008", "code": "from collections import deque\r\ndef check_expression(exp):\r\n    if len(exp) & 1:\r\n        return False\r\n    stack = deque()\r\n    for ch in exp:\r\n        if ch == '(' or ch == '{' or ch == '[':\r\n            stack.append(ch)\r\n        if ch == ')' or ch == '}' or ch == ']':\r\n            if not stack:\r\n                return False\r\n            top = stack.pop()\r\n            if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):\r\n                return False\r\n    return not stack", "entry_point": "check_expression", "input": "'{()}[{}][]({})'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "771_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032009", "code": "def remove_length(test_str, K):\r\n  temp = test_str.split()\r\n  res = [ele for ele in temp if len(ele) != K]\r\n  res = ' '.join(res)\r\n  return (res) ", "entry_point": "remove_length", "input": "'The person is most value tet', 3", "output": "'person is most value'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "772_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032010", "code": "def remove_length(test_str, K):\r\n  temp = test_str.split()\r\n  res = [ele for ele in temp if len(ele) != K]\r\n  res = ' '.join(res)\r\n  return (res) ", "entry_point": "remove_length", "input": "'If you told me about this ok', 4", "output": "'If you me about ok'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "772_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032011", "code": "def remove_length(test_str, K):\r\n  temp = test_str.split()\r\n  res = [ele for ele in temp if len(ele) != K]\r\n  res = ' '.join(res)\r\n  return (res) ", "entry_point": "remove_length", "input": "'Forces of darkeness is come into the play', 4", "output": "'Forces of darkeness is the'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "772_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032012", "code": "import re\r\ndef occurance_substring(text,pattern):\r\n for match in re.finditer(pattern, text):\r\n    s = match.start()\r\n    e = match.end()\r\n    return (text[s:e], s, e)", "entry_point": "occurance_substring", "input": "'python programming, python language', 'python'", "output": "('python', 0, 6)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "773_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032013", "code": "import re\r\ndef occurance_substring(text,pattern):\r\n for match in re.finditer(pattern, text):\r\n    s = match.start()\r\n    e = match.end()\r\n    return (text[s:e], s, e)", "entry_point": "occurance_substring", "input": "'python programming,programming language', 'programming'", "output": "('programming', 7, 18)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "773_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032014", "code": "import re\r\ndef occurance_substring(text,pattern):\r\n for match in re.finditer(pattern, text):\r\n    s = match.start()\r\n    e = match.end()\r\n    return (text[s:e], s, e)", "entry_point": "occurance_substring", "input": "'python programming,programming language', 'language'", "output": "('language', 31, 39)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "773_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032015", "code": "import re \r\nregex = '^[a-z0-9]+[\\._]?[a-z0-9]+[@]\\w+[.]\\w{2,3}$'\r\ndef check_email(email): \r\n\tif(re.search(regex,email)): \r\n\t\treturn (\"Valid Email\") \r\n\telse: \r\n\t\treturn (\"Invalid Email\") ", "entry_point": "check_email", "input": "'ankitrai326@gmail.com'", "output": "'Valid Email'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "774_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032016", "code": "import re \r\nregex = '^[a-z0-9]+[\\._]?[a-z0-9]+[@]\\w+[.]\\w{2,3}$'\r\ndef check_email(email): \r\n\tif(re.search(regex,email)): \r\n\t\treturn (\"Valid Email\") \r\n\telse: \r\n\t\treturn (\"Invalid Email\") ", "entry_point": "check_email", "input": "'my.ownsite@ourearth.org'", "output": "'Valid Email'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "774_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032017", "code": "import re \r\nregex = '^[a-z0-9]+[\\._]?[a-z0-9]+[@]\\w+[.]\\w{2,3}$'\r\ndef check_email(email): \r\n\tif(re.search(regex,email)): \r\n\t\treturn (\"Valid Email\") \r\n\telse: \r\n\t\treturn (\"Invalid Email\") ", "entry_point": "check_email", "input": "'ankitaoie326.com'", "output": "'Invalid Email'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "774_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032018", "code": "def odd_position(nums):\r\n\treturn all(nums[i]%2==i%2 for i in range(len(nums)))", "entry_point": "odd_position", "input": "[2, 1, 4, 3, 6, 7, 6, 3]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "775_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032019", "code": "def odd_position(nums):\r\n\treturn all(nums[i]%2==i%2 for i in range(len(nums)))", "entry_point": "odd_position", "input": "[4, 1, 2]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "775_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032020", "code": "def odd_position(nums):\r\n\treturn all(nums[i]%2==i%2 for i in range(len(nums)))", "entry_point": "odd_position", "input": "[1, 2, 3]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "775_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032021", "code": "def count_vowels(test_str):\r\n  res = 0\r\n  vow_list = ['a', 'e', 'i', 'o', 'u']\r\n  for idx in range(1, len(test_str) - 1):\r\n    if test_str[idx] not in vow_list and (test_str[idx - 1] in vow_list or test_str[idx + 1] in vow_list):\r\n      res += 1\r\n  if test_str[0] not in vow_list and test_str[1] in vow_list:\r\n    res += 1\r\n  if test_str[-1] not in vow_list and test_str[-2] in vow_list:\r\n    res += 1\r\n  return (res) ", "entry_point": "count_vowels", "input": "'bestinstareels'", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "776_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032022", "code": "def count_vowels(test_str):\r\n  res = 0\r\n  vow_list = ['a', 'e', 'i', 'o', 'u']\r\n  for idx in range(1, len(test_str) - 1):\r\n    if test_str[idx] not in vow_list and (test_str[idx - 1] in vow_list or test_str[idx + 1] in vow_list):\r\n      res += 1\r\n  if test_str[0] not in vow_list and test_str[1] in vow_list:\r\n    res += 1\r\n  if test_str[-1] not in vow_list and test_str[-2] in vow_list:\r\n    res += 1\r\n  return (res) ", "entry_point": "count_vowels", "input": "'partofthejourneyistheend'", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "776_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032023", "code": "def count_vowels(test_str):\r\n  res = 0\r\n  vow_list = ['a', 'e', 'i', 'o', 'u']\r\n  for idx in range(1, len(test_str) - 1):\r\n    if test_str[idx] not in vow_list and (test_str[idx - 1] in vow_list or test_str[idx + 1] in vow_list):\r\n      res += 1\r\n  if test_str[0] not in vow_list and test_str[1] in vow_list:\r\n    res += 1\r\n  if test_str[-1] not in vow_list and test_str[-2] in vow_list:\r\n    res += 1\r\n  return (res) ", "entry_point": "count_vowels", "input": "'amazonprime'", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "776_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032024", "code": "def find_Sum(arr,n): \r\n    arr.sort() \r\n    sum = arr[0] \r\n    for i in range(0,n-1): \r\n        if (arr[i] != arr[i+1]): \r\n            sum = sum + arr[i+1]   \r\n    return sum", "entry_point": "find_Sum", "input": "[1, 2, 3, 1, 1, 4, 5, 6], 8", "output": "21", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "777_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032025", "code": "def find_Sum(arr,n): \r\n    arr.sort() \r\n    sum = arr[0] \r\n    for i in range(0,n-1): \r\n        if (arr[i] != arr[i+1]): \r\n            sum = sum + arr[i+1]   \r\n    return sum", "entry_point": "find_Sum", "input": "[1, 10, 9, 4, 2, 10, 10, 45, 4], 9", "output": "71", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "777_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032026", "code": "def find_Sum(arr,n): \r\n    arr.sort() \r\n    sum = arr[0] \r\n    for i in range(0,n-1): \r\n        if (arr[i] != arr[i+1]): \r\n            sum = sum + arr[i+1]   \r\n    return sum", "entry_point": "find_Sum", "input": "[12, 10, 9, 45, 2, 10, 10, 45, 10], 9", "output": "78", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "777_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032027", "code": "from itertools import groupby\r\ndef pack_consecutive_duplicates(list1):\r\n    return [list(group) for key, group in groupby(list1)]", "entry_point": "pack_consecutive_duplicates", "input": "[0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]", "output": "[[0, 0], [1], [2], [3], [4, 4], [5], [6, 6, 6], [7], [8], [9], [4, 4]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "778_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032028", "code": "from itertools import groupby\r\ndef pack_consecutive_duplicates(list1):\r\n    return [list(group) for key, group in groupby(list1)]", "entry_point": "pack_consecutive_duplicates", "input": "[10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10]", "output": "[[10, 10], [15], [19], [18, 18], [17], [26, 26], [17], [18], [10]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "778_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032029", "code": "from itertools import groupby\r\ndef pack_consecutive_duplicates(list1):\r\n    return [list(group) for key, group in groupby(list1)]", "entry_point": "pack_consecutive_duplicates", "input": "['a', 'a', 'b', 'c', 'd', 'd']", "output": "[['a', 'a'], ['b'], ['c'], ['d', 'd']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "778_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032030", "code": "def unique_sublists(list1):\r\n    result ={}\r\n    for l in list1: \r\n        result.setdefault(tuple(l), list()).append(1) \r\n    for a, b in result.items(): \r\n        result[a] = sum(b)\r\n    return result", "entry_point": "unique_sublists", "input": "[[1, 2], [3, 4], [4, 5], [6, 7]]", "output": "{(1, 2): 1, (3, 4): 1, (4, 5): 1, (6, 7): 1}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "779_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032031", "code": "from itertools import combinations \r\ndef find_combinations(test_list):\r\n  res = [(b1 + a1, b2 + a2) for (a1, a2), (b1, b2) in combinations(test_list, 2)]\r\n  return (res) ", "entry_point": "find_combinations", "input": "[(2, 4), (6, 7), (5, 1), (6, 10)]", "output": "[(8, 11), (7, 5), (8, 14), (11, 8), (12, 17), (11, 11)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "780_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032032", "code": "from itertools import combinations \r\ndef find_combinations(test_list):\r\n  res = [(b1 + a1, b2 + a2) for (a1, a2), (b1, b2) in combinations(test_list, 2)]\r\n  return (res) ", "entry_point": "find_combinations", "input": "[(3, 5), (7, 8), (6, 2), (7, 11)]", "output": "[(10, 13), (9, 7), (10, 16), (13, 10), (14, 19), (13, 13)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "780_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032033", "code": "from itertools import combinations \r\ndef find_combinations(test_list):\r\n  res = [(b1 + a1, b2 + a2) for (a1, a2), (b1, b2) in combinations(test_list, 2)]\r\n  return (res) ", "entry_point": "find_combinations", "input": "[(4, 6), (8, 9), (7, 3), (8, 12)]", "output": "[(12, 15), (11, 9), (12, 18), (15, 12), (16, 21), (15, 15)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "780_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032034", "code": "import math \r\ndef count_Divisors(n) : \r\n    count = 0\r\n    for i in range(1, (int)(math.sqrt(n)) + 2) : \r\n        if (n % i == 0) : \r\n            if( n // i == i) : \r\n                count = count + 1\r\n            else : \r\n                count = count + 2\r\n    if (count % 2 == 0) : \r\n        return (\"Even\") \r\n    else : \r\n        return (\"Odd\") ", "entry_point": "count_Divisors", "input": "10", "output": "'Even'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "781_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032035", "code": "import math \r\ndef count_Divisors(n) : \r\n    count = 0\r\n    for i in range(1, (int)(math.sqrt(n)) + 2) : \r\n        if (n % i == 0) : \r\n            if( n // i == i) : \r\n                count = count + 1\r\n            else : \r\n                count = count + 2\r\n    if (count % 2 == 0) : \r\n        return (\"Even\") \r\n    else : \r\n        return (\"Odd\") ", "entry_point": "count_Divisors", "input": "100", "output": "'Odd'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "781_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032036", "code": "import math \r\ndef count_Divisors(n) : \r\n    count = 0\r\n    for i in range(1, (int)(math.sqrt(n)) + 2) : \r\n        if (n % i == 0) : \r\n            if( n // i == i) : \r\n                count = count + 1\r\n            else : \r\n                count = count + 2\r\n    if (count % 2 == 0) : \r\n        return (\"Even\") \r\n    else : \r\n        return (\"Odd\") ", "entry_point": "count_Divisors", "input": "125", "output": "'Even'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "781_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032037", "code": "def Odd_Length_Sum(arr):\r\n    Sum = 0\r\n    l = len(arr)\r\n    for i in range(l):\r\n        Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])\r\n    return Sum", "entry_point": "Odd_Length_Sum", "input": "[1, 2, 4]", "output": "14", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "782_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032038", "code": "def Odd_Length_Sum(arr):\r\n    Sum = 0\r\n    l = len(arr)\r\n    for i in range(l):\r\n        Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])\r\n    return Sum", "entry_point": "Odd_Length_Sum", "input": "[1, 2, 1, 2]", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "782_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032039", "code": "def Odd_Length_Sum(arr):\r\n    Sum = 0\r\n    l = len(arr)\r\n    for i in range(l):\r\n        Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])\r\n    return Sum", "entry_point": "Odd_Length_Sum", "input": "[1, 7]", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "782_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032040", "code": "def rgb_to_hsv(r, g, b):\r\n    r, g, b = r/255.0, g/255.0, b/255.0\r\n    mx = max(r, g, b)\r\n    mn = min(r, g, b)\r\n    df = mx-mn\r\n    if mx == mn:\r\n        h = 0\r\n    elif mx == r:\r\n        h = (60 * ((g-b)/df) + 360) % 360\r\n    elif mx == g:\r\n        h = (60 * ((b-r)/df) + 120) % 360\r\n    elif mx == b:\r\n        h = (60 * ((r-g)/df) + 240) % 360\r\n    if mx == 0:\r\n        s = 0\r\n    else:\r\n        s = (df/mx)*100\r\n    v = mx*100\r\n    return h, s, v", "entry_point": "rgb_to_hsv", "input": "255, 255, 255", "output": "(0, 0.0, 100.0)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "783_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032041", "code": "def rgb_to_hsv(r, g, b):\r\n    r, g, b = r/255.0, g/255.0, b/255.0\r\n    mx = max(r, g, b)\r\n    mn = min(r, g, b)\r\n    df = mx-mn\r\n    if mx == mn:\r\n        h = 0\r\n    elif mx == r:\r\n        h = (60 * ((g-b)/df) + 360) % 360\r\n    elif mx == g:\r\n        h = (60 * ((b-r)/df) + 120) % 360\r\n    elif mx == b:\r\n        h = (60 * ((r-g)/df) + 240) % 360\r\n    if mx == 0:\r\n        s = 0\r\n    else:\r\n        s = (df/mx)*100\r\n    v = mx*100\r\n    return h, s, v", "entry_point": "rgb_to_hsv", "input": "0, 215, 0", "output": "(120.0, 100.0, 84.31372549019608)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "783_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032042", "code": "def rgb_to_hsv(r, g, b):\r\n    r, g, b = r/255.0, g/255.0, b/255.0\r\n    mx = max(r, g, b)\r\n    mn = min(r, g, b)\r\n    df = mx-mn\r\n    if mx == mn:\r\n        h = 0\r\n    elif mx == r:\r\n        h = (60 * ((g-b)/df) + 360) % 360\r\n    elif mx == g:\r\n        h = (60 * ((b-r)/df) + 120) % 360\r\n    elif mx == b:\r\n        h = (60 * ((r-g)/df) + 240) % 360\r\n    if mx == 0:\r\n        s = 0\r\n    else:\r\n        s = (df/mx)*100\r\n    v = mx*100\r\n    return h, s, v", "entry_point": "rgb_to_hsv", "input": "10, 215, 110", "output": "(149.26829268292684, 95.34883720930233, 84.31372549019608)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "783_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032043", "code": "def mul_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even*first_odd)", "entry_point": "mul_even_odd", "input": "[1, 3, 5, 7, 4, 1, 6, 8]", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "784_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032044", "code": "def mul_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even*first_odd)", "entry_point": "mul_even_odd", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "784_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032045", "code": "def mul_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even*first_odd)", "entry_point": "mul_even_odd", "input": "[1, 5, 7, 9, 10]", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "784_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032046", "code": "def tuple_str_int(test_str):\r\n  res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))\r\n  return (res) ", "entry_point": "tuple_str_int", "input": "'(7, 8, 9)'", "output": "(7, 8, 9)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "785_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032047", "code": "def tuple_str_int(test_str):\r\n  res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))\r\n  return (res) ", "entry_point": "tuple_str_int", "input": "'(1, 2, 3)'", "output": "(1, 2, 3)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "785_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032048", "code": "def tuple_str_int(test_str):\r\n  res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))\r\n  return (res) ", "entry_point": "tuple_str_int", "input": "'(4, 5, 6)'", "output": "(4, 5, 6)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "785_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032049", "code": "import bisect\r\ndef right_insertion(a, x):\r\n    i = bisect.bisect_right(a, x)\r\n    return i", "entry_point": "right_insertion", "input": "[1, 2, 4, 5], 6", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "786_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032050", "code": "import bisect\r\ndef right_insertion(a, x):\r\n    i = bisect.bisect_right(a, x)\r\n    return i", "entry_point": "right_insertion", "input": "[1, 2, 4, 5], 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "786_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032051", "code": "import bisect\r\ndef right_insertion(a, x):\r\n    i = bisect.bisect_right(a, x)\r\n    return i", "entry_point": "right_insertion", "input": "[1, 2, 4, 5], 7", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "786_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032052", "code": "import re\r\ndef text_match_three(text):\r\n        patterns = 'ab{3}?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_three", "input": "'ac'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "787_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032053", "code": "import re\r\ndef text_match_three(text):\r\n        patterns = 'ab{3}?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_three", "input": "'dc'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "787_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032054", "code": "import re\r\ndef text_match_three(text):\r\n        patterns = 'ab{3}?'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_match_three", "input": "'abbbba'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "787_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032055", "code": "def new_tuple(test_list, test_str):\r\n  res = tuple(test_list + [test_str])\r\n  return (res) ", "entry_point": "new_tuple", "input": "['WEB', 'is'], 'best'", "output": "('WEB', 'is', 'best')", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "788_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032056", "code": "def new_tuple(test_list, test_str):\r\n  res = tuple(test_list + [test_str])\r\n  return (res) ", "entry_point": "new_tuple", "input": "['We', 'are'], 'Developers'", "output": "('We', 'are', 'Developers')", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "788_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032057", "code": "def new_tuple(test_list, test_str):\r\n  res = tuple(test_list + [test_str])\r\n  return (res) ", "entry_point": "new_tuple", "input": "['Part', 'is'], 'Wrong'", "output": "('Part', 'is', 'Wrong')", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "788_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032058", "code": "from math import tan, pi\r\ndef perimeter_polygon(s,l):\r\n  perimeter = s*l\r\n  return perimeter", "entry_point": "perimeter_polygon", "input": "4, 20", "output": "80", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "789_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032059", "code": "from math import tan, pi\r\ndef perimeter_polygon(s,l):\r\n  perimeter = s*l\r\n  return perimeter", "entry_point": "perimeter_polygon", "input": "10, 15", "output": "150", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "789_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032060", "code": "from math import tan, pi\r\ndef perimeter_polygon(s,l):\r\n  perimeter = s*l\r\n  return perimeter", "entry_point": "perimeter_polygon", "input": "9, 7", "output": "63", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "789_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032061", "code": "def even_position(nums):\r\n\treturn all(nums[i]%2==i%2 for i in range(len(nums)))", "entry_point": "even_position", "input": "[3, 2, 1]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "790_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032062", "code": "def even_position(nums):\r\n\treturn all(nums[i]%2==i%2 for i in range(len(nums)))", "entry_point": "even_position", "input": "[1, 2, 3]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "790_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032063", "code": "def even_position(nums):\r\n\treturn all(nums[i]%2==i%2 for i in range(len(nums)))", "entry_point": "even_position", "input": "[2, 1, 4]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "790_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032064", "code": "def remove_nested(test_tup):\r\n  res = tuple()\r\n  for count, ele in enumerate(test_tup):\r\n    if not isinstance(ele, tuple):\r\n      res = res + (ele, )\r\n  return (res) ", "entry_point": "remove_nested", "input": "(1, 5, 7, (4, 6), 10)", "output": "(1, 5, 7, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "791_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032065", "code": "def remove_nested(test_tup):\r\n  res = tuple()\r\n  for count, ele in enumerate(test_tup):\r\n    if not isinstance(ele, tuple):\r\n      res = res + (ele, )\r\n  return (res) ", "entry_point": "remove_nested", "input": "(2, 6, 8, (5, 7), 11)", "output": "(2, 6, 8, 11)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "791_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032066", "code": "def remove_nested(test_tup):\r\n  res = tuple()\r\n  for count, ele in enumerate(test_tup):\r\n    if not isinstance(ele, tuple):\r\n      res = res + (ele, )\r\n  return (res) ", "entry_point": "remove_nested", "input": "(3, 7, 9, (6, 8), 12)", "output": "(3, 7, 9, 12)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "791_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032067", "code": "def count_list(input_list): \r\n    return len(input_list)", "entry_point": "count_list", "input": "[[1, 3], [5, 7], [9, 11], [13, 15, 17]]", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "792_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032068", "code": "def count_list(input_list): \r\n    return len(input_list)", "entry_point": "count_list", "input": "[[1, 2], [2, 3], [4, 5]]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "792_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032069", "code": "def count_list(input_list): \r\n    return len(input_list)", "entry_point": "count_list", "input": "[[1, 0], [2, 0]]", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "792_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032070", "code": "def last(arr,x,n):\r\n    low = 0\r\n    high = n - 1\r\n    res = -1  \r\n    while (low <= high):\r\n        mid = (low + high) // 2 \r\n        if arr[mid] > x:\r\n            high = mid - 1\r\n        elif arr[mid] < x:\r\n            low = mid + 1\r\n        else:\r\n            res = mid\r\n            low = mid + 1\r\n    return res", "entry_point": "last", "input": "[1, 2, 3], 1, 3", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "793_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032071", "code": "def last(arr,x,n):\r\n    low = 0\r\n    high = n - 1\r\n    res = -1  \r\n    while (low <= high):\r\n        mid = (low + high) // 2 \r\n        if arr[mid] > x:\r\n            high = mid - 1\r\n        elif arr[mid] < x:\r\n            low = mid + 1\r\n        else:\r\n            res = mid\r\n            low = mid + 1\r\n    return res", "entry_point": "last", "input": "[1, 1, 1, 2, 3, 4], 1, 6", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "793_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032072", "code": "def last(arr,x,n):\r\n    low = 0\r\n    high = n - 1\r\n    res = -1  \r\n    while (low <= high):\r\n        mid = (low + high) // 2 \r\n        if arr[mid] > x:\r\n            high = mid - 1\r\n        elif arr[mid] < x:\r\n            low = mid + 1\r\n        else:\r\n            res = mid\r\n            low = mid + 1\r\n    return res", "entry_point": "last", "input": "[2, 3, 2, 3, 6, 8, 9], 3, 8", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "793_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032073", "code": "import re\r\ndef text_starta_endb(text):\r\n        patterns = 'a.*?b$'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_starta_endb", "input": "'aabbbb'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "794_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032074", "code": "import re\r\ndef text_starta_endb(text):\r\n        patterns = 'a.*?b$'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_starta_endb", "input": "'aabAbbbc'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "794_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032075", "code": "import re\r\ndef text_starta_endb(text):\r\n        patterns = 'a.*?b$'\r\n        if re.search(patterns,  text):\r\n                return 'Found a match!'\r\n        else:\r\n                return('Not matched!')", "entry_point": "text_starta_endb", "input": "'accddbbjjj'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "794_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032076", "code": "import heapq\r\ndef cheap_items(items,n):\r\n  cheap_items = heapq.nsmallest(n, items, key=lambda s: s['price'])\r\n  return cheap_items", "entry_point": "cheap_items", "input": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}], 1", "output": "[{'name': 'Item-1', 'price': 101.1}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "795_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032077", "code": "import heapq\r\ndef cheap_items(items,n):\r\n  cheap_items = heapq.nsmallest(n, items, key=lambda s: s['price'])\r\n  return cheap_items", "entry_point": "cheap_items", "input": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}], 2", "output": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "795_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032078", "code": "import heapq\r\ndef cheap_items(items,n):\r\n  cheap_items = heapq.nsmallest(n, items, key=lambda s: s['price'])\r\n  return cheap_items", "entry_point": "cheap_items", "input": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}, {'name': 'Item-3', 'price': 45.09}, {'name': 'Item-4', 'price': 22.75}], 1", "output": "[{'name': 'Item-4', 'price': 22.75}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "795_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032079", "code": "def return_sum(dict):\r\n  sum = 0\r\n  for i in dict.values():\r\n    sum = sum + i\r\n  return sum", "entry_point": "return_sum", "input": "{'a': 100, 'b': 200, 'c': 300}", "output": "600", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "796_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032080", "code": "def return_sum(dict):\r\n  sum = 0\r\n  for i in dict.values():\r\n    sum = sum + i\r\n  return sum", "entry_point": "return_sum", "input": "{'a': 25, 'b': 18, 'c': 45}", "output": "88", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "796_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032081", "code": "def return_sum(dict):\r\n  sum = 0\r\n  for i in dict.values():\r\n    sum = sum + i\r\n  return sum", "entry_point": "return_sum", "input": "{'a': 36, 'b': 39, 'c': 49}", "output": "124", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "796_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032082", "code": "def sum_Odd(n): \r\n    terms = (n + 1)//2\r\n    sum1 = terms * terms \r\n    return sum1  \r\ndef sum_in_Range(l,r): \r\n    return sum_Odd(r) - sum_Odd(l - 1)", "entry_point": "sum_in_Range", "input": "2, 5", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "797_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032083", "code": "def sum_Odd(n): \r\n    terms = (n + 1)//2\r\n    sum1 = terms * terms \r\n    return sum1  \r\ndef sum_in_Range(l,r): \r\n    return sum_Odd(r) - sum_Odd(l - 1)", "entry_point": "sum_in_Range", "input": "5, 7", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "797_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032084", "code": "def sum_Odd(n): \r\n    terms = (n + 1)//2\r\n    sum1 = terms * terms \r\n    return sum1  \r\ndef sum_in_Range(l,r): \r\n    return sum_Odd(r) - sum_Odd(l - 1)", "entry_point": "sum_in_Range", "input": "7, 13", "output": "40", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "797_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032085", "code": "def _sum(arr):  \r\n    sum=0\r\n    for i in arr: \r\n        sum = sum + i      \r\n    return(sum)  ", "entry_point": "_sum", "input": "[1, 2, 3]", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "798_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032086", "code": "def _sum(arr):  \r\n    sum=0\r\n    for i in arr: \r\n        sum = sum + i      \r\n    return(sum)  ", "entry_point": "_sum", "input": "[15, 12, 13, 10]", "output": "50", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "798_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032087", "code": "def _sum(arr):  \r\n    sum=0\r\n    for i in arr: \r\n        sum = sum + i      \r\n    return(sum)  ", "entry_point": "_sum", "input": "[0, 1, 2]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "798_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032088", "code": "INT_BITS = 32\r\ndef left_Rotate(n,d):   \r\n    return (n << d)|(n >> (INT_BITS - d))  ", "entry_point": "left_Rotate", "input": "16, 2", "output": "64", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "799_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032089", "code": "INT_BITS = 32\r\ndef left_Rotate(n,d):   \r\n    return (n << d)|(n >> (INT_BITS - d))  ", "entry_point": "left_Rotate", "input": "10, 2", "output": "40", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "799_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032090", "code": "INT_BITS = 32\r\ndef left_Rotate(n,d):   \r\n    return (n << d)|(n >> (INT_BITS - d))  ", "entry_point": "left_Rotate", "input": "99, 3", "output": "792", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "799_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032091", "code": "import re\r\ndef remove_all_spaces(text):\r\n return (re.sub(r'\\s+', '',text))", "entry_point": "remove_all_spaces", "input": "'python  program'", "output": "'pythonprogram'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "800_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032092", "code": "import re\r\ndef remove_all_spaces(text):\r\n return (re.sub(r'\\s+', '',text))", "entry_point": "remove_all_spaces", "input": "'python   programming    language'", "output": "'pythonprogramminglanguage'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "800_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032093", "code": "import re\r\ndef remove_all_spaces(text):\r\n return (re.sub(r'\\s+', '',text))", "entry_point": "remove_all_spaces", "input": "'python                     program'", "output": "'pythonprogram'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "800_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032094", "code": "def test_three_equal(x,y,z):\r\n  result= set([x,y,z])\r\n  if len(result)==3:\r\n    return 0\r\n  else:\r\n    return (4-len(result))", "entry_point": "test_three_equal", "input": "1, 1, 1", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "801_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032095", "code": "def test_three_equal(x,y,z):\r\n  result= set([x,y,z])\r\n  if len(result)==3:\r\n    return 0\r\n  else:\r\n    return (4-len(result))", "entry_point": "test_three_equal", "input": "-1, -2, -3", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "801_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032096", "code": "def test_three_equal(x,y,z):\r\n  result= set([x,y,z])\r\n  if len(result)==3:\r\n    return 0\r\n  else:\r\n    return (4-len(result))", "entry_point": "test_three_equal", "input": "1, 2, 2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "801_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032097", "code": "def count_Rotation(arr,n):   \r\n    for i in range (1,n): \r\n        if (arr[i] < arr[i - 1]): \r\n            return i  \r\n    return 0", "entry_point": "count_Rotation", "input": "[3, 2, 1], 3", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "802_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032098", "code": "def count_Rotation(arr,n):   \r\n    for i in range (1,n): \r\n        if (arr[i] < arr[i - 1]): \r\n            return i  \r\n    return 0", "entry_point": "count_Rotation", "input": "[4, 5, 1, 2, 3], 5", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "802_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032099", "code": "def count_Rotation(arr,n):   \r\n    for i in range (1,n): \r\n        if (arr[i] < arr[i - 1]): \r\n            return i  \r\n    return 0", "entry_point": "count_Rotation", "input": "[7, 8, 9, 1, 2, 3], 6", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "802_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032100", "code": "def is_Perfect_Square(n) :\r\n    i = 1\r\n    while (i * i<= n):\r\n        if ((n % i == 0) and (n / i == i)):\r\n            return True     \r\n        i = i + 1\r\n    return False", "entry_point": "is_Perfect_Square", "input": "10", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "803_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032101", "code": "def is_Perfect_Square(n) :\r\n    i = 1\r\n    while (i * i<= n):\r\n        if ((n % i == 0) and (n / i == i)):\r\n            return True     \r\n        i = i + 1\r\n    return False", "entry_point": "is_Perfect_Square", "input": "36", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "803_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032102", "code": "def is_Perfect_Square(n) :\r\n    i = 1\r\n    while (i * i<= n):\r\n        if ((n % i == 0) and (n / i == i)):\r\n            return True     \r\n        i = i + 1\r\n    return False", "entry_point": "is_Perfect_Square", "input": "14", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "803_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032103", "code": "def is_Product_Even(arr,n): \r\n    for i in range(0,n): \r\n        if ((arr[i] & 1) == 0): \r\n            return True\r\n    return False", "entry_point": "is_Product_Even", "input": "[1, 2, 3], 3", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "804_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032104", "code": "def is_Product_Even(arr,n): \r\n    for i in range(0,n): \r\n        if ((arr[i] & 1) == 0): \r\n            return True\r\n    return False", "entry_point": "is_Product_Even", "input": "[1, 2, 1, 4], 4", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "804_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032105", "code": "def is_Product_Even(arr,n): \r\n    for i in range(0,n): \r\n        if ((arr[i] & 1) == 0): \r\n            return True\r\n    return False", "entry_point": "is_Product_Even", "input": "[1, 1], 2", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "804_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032106", "code": "def max_sum_list(lists):\r\n return max(lists, key=sum)", "entry_point": "max_sum_list", "input": "[[1, 2, 3], [4, 5, 6], [10, 11, 12], [7, 8, 9]]", "output": "[10, 11, 12]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "805_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032107", "code": "def max_sum_list(lists):\r\n return max(lists, key=sum)", "entry_point": "max_sum_list", "input": "[[3, 2, 1], [6, 5, 4], [12, 11, 10]]", "output": "[12, 11, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "805_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032108", "code": "def max_sum_list(lists):\r\n return max(lists, key=sum)", "entry_point": "max_sum_list", "input": "[[2, 3, 1]]", "output": "[2, 3, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "805_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032109", "code": "def max_run_uppercase(test_str):\r\n  cnt = 0\r\n  res = 0\r\n  for idx in range(0, len(test_str)):\r\n    if test_str[idx].isupper():\r\n      cnt += 1\r\n    else:\r\n      res = cnt\r\n      cnt = 0\r\n  if test_str[len(test_str) - 1].isupper():\r\n    res = cnt\r\n  return (res)", "entry_point": "max_run_uppercase", "input": "'GeMKSForGERksISBESt'", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "806_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032110", "code": "def max_run_uppercase(test_str):\r\n  cnt = 0\r\n  res = 0\r\n  for idx in range(0, len(test_str)):\r\n    if test_str[idx].isupper():\r\n      cnt += 1\r\n    else:\r\n      res = cnt\r\n      cnt = 0\r\n  if test_str[len(test_str) - 1].isupper():\r\n    res = cnt\r\n  return (res)", "entry_point": "max_run_uppercase", "input": "'PrECIOusMOVemENTSYT'", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "806_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032111", "code": "def max_run_uppercase(test_str):\r\n  cnt = 0\r\n  res = 0\r\n  for idx in range(0, len(test_str)):\r\n    if test_str[idx].isupper():\r\n      cnt += 1\r\n    else:\r\n      res = cnt\r\n      cnt = 0\r\n  if test_str[len(test_str) - 1].isupper():\r\n    res = cnt\r\n  return (res)", "entry_point": "max_run_uppercase", "input": "'GooGLEFluTTER'", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "806_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032112", "code": "def first_odd(nums):\r\n  first_odd = next((el for el in nums if el%2!=0),-1)\r\n  return first_odd", "entry_point": "first_odd", "input": "[1, 3, 5]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "807_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032113", "code": "def first_odd(nums):\r\n  first_odd = next((el for el in nums if el%2!=0),-1)\r\n  return first_odd", "entry_point": "first_odd", "input": "[2, 4, 1, 3]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "807_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032114", "code": "def first_odd(nums):\r\n  first_odd = next((el for el in nums if el%2!=0),-1)\r\n  return first_odd", "entry_point": "first_odd", "input": "[8, 9, 1]", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "807_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032115", "code": "def check_K(test_tup, K):\r\n  res = False\r\n  for ele in test_tup:\r\n    if ele == K:\r\n      res = True\r\n      break\r\n  return (res) ", "entry_point": "check_K", "input": "(10, 4, 5, 6, 8), 6", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "808_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032116", "code": "def check_K(test_tup, K):\r\n  res = False\r\n  for ele in test_tup:\r\n    if ele == K:\r\n      res = True\r\n      break\r\n  return (res) ", "entry_point": "check_K", "input": "(1, 2, 3, 4, 5, 6), 7", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "808_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032117", "code": "def check_K(test_tup, K):\r\n  res = False\r\n  for ele in test_tup:\r\n    if ele == K:\r\n      res = True\r\n      break\r\n  return (res) ", "entry_point": "check_K", "input": "(7, 8, 9, 44, 11, 12), 11", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "808_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032118", "code": "def check_smaller(test_tup1, test_tup2):\r\n  res = all(x > y for x, y in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "check_smaller", "input": "(1, 2, 3), (2, 3, 4)", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "809_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032119", "code": "def check_smaller(test_tup1, test_tup2):\r\n  res = all(x > y for x, y in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "check_smaller", "input": "(4, 5, 6), (3, 4, 5)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "809_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032120", "code": "def check_smaller(test_tup1, test_tup2):\r\n  res = all(x > y for x, y in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "check_smaller", "input": "(11, 12, 13), (10, 11, 12)", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "809_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032121", "code": "from collections import Counter\r\ndef count_variable(a,b,c,d):\r\n  c = Counter(p=a, q=b, r=c, s=d)\r\n  return list(c.elements())", "entry_point": "count_variable", "input": "4, 2, 0, -2", "output": "['p', 'p', 'p', 'p', 'q', 'q']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "810_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032122", "code": "from collections import Counter\r\ndef count_variable(a,b,c,d):\r\n  c = Counter(p=a, q=b, r=c, s=d)\r\n  return list(c.elements())", "entry_point": "count_variable", "input": "0, 1, 2, 3", "output": "['q', 'r', 'r', 's', 's', 's']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "810_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032123", "code": "def check_identical(test_list1, test_list2):\r\n  res = test_list1 == test_list2\r\n  return (res) ", "entry_point": "check_identical", "input": "[(10, 4), (2, 5)], [(10, 4), (2, 5)]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "811_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032124", "code": "def check_identical(test_list1, test_list2):\r\n  res = test_list1 == test_list2\r\n  return (res) ", "entry_point": "check_identical", "input": "[(1, 2), (3, 7)], [(12, 14), (12, 45)]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "811_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032125", "code": "def check_identical(test_list1, test_list2):\r\n  res = test_list1 == test_list2\r\n  return (res) ", "entry_point": "check_identical", "input": "[(2, 14), (12, 25)], [(2, 14), (12, 25)]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "811_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032126", "code": "import re\r\ndef road_rd(street):\r\n  return (re.sub('Road$', 'Rd.', street))", "entry_point": "road_rd", "input": "'ravipadu Road'", "output": "'ravipadu Rd.'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "812_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032127", "code": "import re\r\ndef road_rd(street):\r\n  return (re.sub('Road$', 'Rd.', street))", "entry_point": "road_rd", "input": "'palnadu Road'", "output": "'palnadu Rd.'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "812_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032128", "code": "import re\r\ndef road_rd(street):\r\n  return (re.sub('Road$', 'Rd.', street))", "entry_point": "road_rd", "input": "'eshwar enclave Road'", "output": "'eshwar enclave Rd.'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "812_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032129", "code": "def string_length(str1):\r\n    count = 0\r\n    for char in str1:\r\n        count += 1\r\n    return count", "entry_point": "string_length", "input": "'python'", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "813_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032130", "code": "def string_length(str1):\r\n    count = 0\r\n    for char in str1:\r\n        count += 1\r\n    return count", "entry_point": "string_length", "input": "'program'", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "813_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032131", "code": "def string_length(str1):\r\n    count = 0\r\n    for char in str1:\r\n        count += 1\r\n    return count", "entry_point": "string_length", "input": "'language'", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "813_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032132", "code": "def rombus_area(p,q):\r\n  area=(p*q)/2\r\n  return area", "entry_point": "rombus_area", "input": "10, 20", "output": "100.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "814_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032133", "code": "def rombus_area(p,q):\r\n  area=(p*q)/2\r\n  return area", "entry_point": "rombus_area", "input": "10, 5", "output": "25.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "814_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032134", "code": "def rombus_area(p,q):\r\n  area=(p*q)/2\r\n  return area", "entry_point": "rombus_area", "input": "4, 2", "output": "4.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "814_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032135", "code": "def sort_by_dnf(arr, n):\r\n  low=0\r\n  mid=0\r\n  high=n-1\r\n  while mid <= high:\r\n    if arr[mid] == 0:\r\n      arr[low], arr[mid] = arr[mid], arr[low]\r\n      low = low + 1\r\n      mid = mid + 1\r\n    elif arr[mid] == 1:\r\n      mid = mid + 1\r\n    else:\r\n      arr[mid], arr[high] = arr[high], arr[mid]\r\n      high = high - 1\r\n  return arr", "entry_point": "sort_by_dnf", "input": "[1, 2, 0, 1, 0, 1, 2, 1, 1], 9", "output": "[0, 0, 1, 1, 1, 1, 1, 2, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "815_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032136", "code": "def sort_by_dnf(arr, n):\r\n  low=0\r\n  mid=0\r\n  high=n-1\r\n  while mid <= high:\r\n    if arr[mid] == 0:\r\n      arr[low], arr[mid] = arr[mid], arr[low]\r\n      low = low + 1\r\n      mid = mid + 1\r\n    elif arr[mid] == 1:\r\n      mid = mid + 1\r\n    else:\r\n      arr[mid], arr[high] = arr[high], arr[mid]\r\n      high = high - 1\r\n  return arr", "entry_point": "sort_by_dnf", "input": "[1, 0, 0, 1, 2, 1, 2, 2, 1, 0], 10", "output": "[0, 0, 0, 1, 1, 1, 1, 2, 2, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "815_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032137", "code": "def sort_by_dnf(arr, n):\r\n  low=0\r\n  mid=0\r\n  high=n-1\r\n  while mid <= high:\r\n    if arr[mid] == 0:\r\n      arr[low], arr[mid] = arr[mid], arr[low]\r\n      low = low + 1\r\n      mid = mid + 1\r\n    elif arr[mid] == 1:\r\n      mid = mid + 1\r\n    else:\r\n      arr[mid], arr[high] = arr[high], arr[mid]\r\n      high = high - 1\r\n  return arr", "entry_point": "sort_by_dnf", "input": "[2, 2, 1, 0, 0, 0, 1, 1, 2, 1], 10", "output": "[0, 0, 0, 1, 1, 1, 1, 2, 2, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "815_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032138", "code": "def clear_tuple(test_tup):\r\n  temp = list(test_tup)\r\n  temp.clear()\r\n  test_tup = tuple(temp)\r\n  return (test_tup) ", "entry_point": "clear_tuple", "input": "(1, 5, 3, 6, 8)", "output": "()", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "816_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032139", "code": "def clear_tuple(test_tup):\r\n  temp = list(test_tup)\r\n  temp.clear()\r\n  test_tup = tuple(temp)\r\n  return (test_tup) ", "entry_point": "clear_tuple", "input": "(2, 1, 4, 5, 6)", "output": "()", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "816_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032140", "code": "def clear_tuple(test_tup):\r\n  temp = list(test_tup)\r\n  temp.clear()\r\n  test_tup = tuple(temp)\r\n  return (test_tup) ", "entry_point": "clear_tuple", "input": "(3, 2, 5, 6, 8)", "output": "()", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "816_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032141", "code": "def div_of_nums(nums,m,n):\r\n result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) \r\n return result", "entry_point": "div_of_nums", "input": "[19, 65, 57, 39, 152, 639, 121, 44, 90, 190], 19, 13", "output": "[19, 65, 57, 39, 152, 190]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "817_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032142", "code": "def div_of_nums(nums,m,n):\r\n result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) \r\n return result", "entry_point": "div_of_nums", "input": "[1, 2, 3, 5, 7, 8, 10], 2, 5", "output": "[2, 5, 8, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "817_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032143", "code": "def div_of_nums(nums,m,n):\r\n result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) \r\n return result", "entry_point": "div_of_nums", "input": "[10, 15, 14, 13, 18, 12, 20], 10, 5", "output": "[10, 15, 20]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "817_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032144", "code": "def lower_ctr(str):\r\n      lower_ctr= 0\r\n      for i in range(len(str)):\r\n          if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1     \r\n      return  lower_ctr", "entry_point": "lower_ctr", "input": "'abc'", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "818_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032145", "code": "def lower_ctr(str):\r\n      lower_ctr= 0\r\n      for i in range(len(str)):\r\n          if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1     \r\n      return  lower_ctr", "entry_point": "lower_ctr", "input": "'string'", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "818_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032146", "code": "def lower_ctr(str):\r\n      lower_ctr= 0\r\n      for i in range(len(str)):\r\n          if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1     \r\n      return  lower_ctr", "entry_point": "lower_ctr", "input": "'Python'", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "818_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032147", "code": "def count_duplic(lists):\r\n    element = []\r\n    frequency = []\r\n    if not lists:\r\n        return element\r\n    running_count = 1\r\n    for i in range(len(lists)-1):\r\n        if lists[i] == lists[i+1]:\r\n            running_count += 1\r\n        else:\r\n            frequency.append(running_count)\r\n            element.append(lists[i])\r\n            running_count = 1\r\n    frequency.append(running_count)\r\n    element.append(lists[i+1])\r\n    return element,frequency\r\n", "entry_point": "count_duplic", "input": "[1, 2, 2, 2, 4, 4, 4, 5, 5, 5, 5]", "output": "([1, 2, 4, 5], [1, 3, 3, 4])", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "819_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032148", "code": "def count_duplic(lists):\r\n    element = []\r\n    frequency = []\r\n    if not lists:\r\n        return element\r\n    running_count = 1\r\n    for i in range(len(lists)-1):\r\n        if lists[i] == lists[i+1]:\r\n            running_count += 1\r\n        else:\r\n            frequency.append(running_count)\r\n            element.append(lists[i])\r\n            running_count = 1\r\n    frequency.append(running_count)\r\n    element.append(lists[i+1])\r\n    return element,frequency\r\n", "entry_point": "count_duplic", "input": "[2, 2, 3, 1, 2, 6, 7, 9]", "output": "([2, 3, 1, 2, 6, 7, 9], [2, 1, 1, 1, 1, 1, 1])", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "819_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032149", "code": "def count_duplic(lists):\r\n    element = []\r\n    frequency = []\r\n    if not lists:\r\n        return element\r\n    running_count = 1\r\n    for i in range(len(lists)-1):\r\n        if lists[i] == lists[i+1]:\r\n            running_count += 1\r\n        else:\r\n            frequency.append(running_count)\r\n            element.append(lists[i])\r\n            running_count = 1\r\n    frequency.append(running_count)\r\n    element.append(lists[i+1])\r\n    return element,frequency\r\n", "entry_point": "count_duplic", "input": "[2, 1, 5, 6, 8, 3, 4, 9, 10, 11, 8, 12]", "output": "([2, 1, 5, 6, 8, 3, 4, 9, 10, 11, 8, 12], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "819_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032150", "code": "def check_monthnum_number(monthnum1):\r\n  if monthnum1 == 2:\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnum_number", "input": "2", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "820_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032151", "code": "def check_monthnum_number(monthnum1):\r\n  if monthnum1 == 2:\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnum_number", "input": "1", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "820_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032152", "code": "def check_monthnum_number(monthnum1):\r\n  if monthnum1 == 2:\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnum_number", "input": "3", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "820_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032153", "code": "import collections as ct\r\ndef merge_dictionaries(dict1,dict2):\r\n    merged_dict = dict(ct.ChainMap({}, dict1, dict2))\r\n    return merged_dict", "entry_point": "merge_dictionaries", "input": "{'R': 'Red', 'B': 'Black', 'P': 'Pink'}, {'G': 'Green', 'W': 'White'}", "output": "{'G': 'Green', 'W': 'White', 'R': 'Red', 'B': 'Black', 'P': 'Pink'}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "821_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032154", "code": "import collections as ct\r\ndef merge_dictionaries(dict1,dict2):\r\n    merged_dict = dict(ct.ChainMap({}, dict1, dict2))\r\n    return merged_dict", "entry_point": "merge_dictionaries", "input": "{'R': 'Red', 'B': 'Black', 'P': 'Pink'}, {'O': 'Orange', 'W': 'White', 'B': 'Black'}", "output": "{'O': 'Orange', 'W': 'White', 'B': 'Black', 'R': 'Red', 'P': 'Pink'}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "821_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032155", "code": "import collections as ct\r\ndef merge_dictionaries(dict1,dict2):\r\n    merged_dict = dict(ct.ChainMap({}, dict1, dict2))\r\n    return merged_dict", "entry_point": "merge_dictionaries", "input": "{'G': 'Green', 'W': 'White'}, {'O': 'Orange', 'W': 'White', 'B': 'Black'}", "output": "{'O': 'Orange', 'W': 'White', 'B': 'Black', 'G': 'Green'}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "821_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032156", "code": "import re\r\ndef pass_validity(p):\r\n x = True\r\n while x:  \r\n    if (len(p)<6 or len(p)>12):\r\n        break\r\n    elif not re.search(\"[a-z]\",p):\r\n        break\r\n    elif not re.search(\"[0-9]\",p):\r\n        break\r\n    elif not re.search(\"[A-Z]\",p):\r\n        break\r\n    elif not re.search(\"[$#@]\",p):\r\n        break\r\n    elif re.search(\"\\s\",p):\r\n        break\r\n    else:\r\n        return True\r\n        x=False\r\n        break\r\n\r\n if x:\r\n    return False", "entry_point": "pass_validity", "input": "'password'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "822_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032157", "code": "import re\r\ndef pass_validity(p):\r\n x = True\r\n while x:  \r\n    if (len(p)<6 or len(p)>12):\r\n        break\r\n    elif not re.search(\"[a-z]\",p):\r\n        break\r\n    elif not re.search(\"[0-9]\",p):\r\n        break\r\n    elif not re.search(\"[A-Z]\",p):\r\n        break\r\n    elif not re.search(\"[$#@]\",p):\r\n        break\r\n    elif re.search(\"\\s\",p):\r\n        break\r\n    else:\r\n        return True\r\n        x=False\r\n        break\r\n\r\n if x:\r\n    return False", "entry_point": "pass_validity", "input": "'Password@10'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "822_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032158", "code": "import re\r\ndef pass_validity(p):\r\n x = True\r\n while x:  \r\n    if (len(p)<6 or len(p)>12):\r\n        break\r\n    elif not re.search(\"[a-z]\",p):\r\n        break\r\n    elif not re.search(\"[0-9]\",p):\r\n        break\r\n    elif not re.search(\"[A-Z]\",p):\r\n        break\r\n    elif not re.search(\"[$#@]\",p):\r\n        break\r\n    elif re.search(\"\\s\",p):\r\n        break\r\n    else:\r\n        return True\r\n        x=False\r\n        break\r\n\r\n if x:\r\n    return False", "entry_point": "pass_validity", "input": "'password@10'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "822_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032159", "code": "import re \r\ndef check_substring(string, sample) : \r\n  if (sample in string): \r\n      y = \"\\A\" + sample \r\n      x = re.search(y, string) \r\n      if x : \r\n          return (\"string starts with the given substring\") \r\n      else : \r\n          return (\"string doesnt start with the given substring\") \r\n  else : \r\n      return (\"entered string isnt a substring\")", "entry_point": "check_substring", "input": "'dreams for dreams makes life fun', 'makes'", "output": "'string doesnt start with the given substring'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "823_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032160", "code": "import re \r\ndef check_substring(string, sample) : \r\n  if (sample in string): \r\n      y = \"\\A\" + sample \r\n      x = re.search(y, string) \r\n      if x : \r\n          return (\"string starts with the given substring\") \r\n      else : \r\n          return (\"string doesnt start with the given substring\") \r\n  else : \r\n      return (\"entered string isnt a substring\")", "entry_point": "check_substring", "input": "'Hi there how are you Hi alex', 'Hi'", "output": "'string starts with the given substring'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "823_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032161", "code": "import re \r\ndef check_substring(string, sample) : \r\n  if (sample in string): \r\n      y = \"\\A\" + sample \r\n      x = re.search(y, string) \r\n      if x : \r\n          return (\"string starts with the given substring\") \r\n      else : \r\n          return (\"string doesnt start with the given substring\") \r\n  else : \r\n      return (\"entered string isnt a substring\")", "entry_point": "check_substring", "input": "'Its been a long day', 'been'", "output": "'string doesnt start with the given substring'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "823_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032162", "code": "def remove_even(l):\r\n    for i in l:\r\n        if i % 2 == 0:\r\n            l.remove(i)\r\n    return l", "entry_point": "remove_even", "input": "[1, 3, 5, 2]", "output": "[1, 3, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "824_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032163", "code": "def remove_even(l):\r\n    for i in l:\r\n        if i % 2 == 0:\r\n            l.remove(i)\r\n    return l", "entry_point": "remove_even", "input": "[5, 6, 7]", "output": "[5, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "824_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032164", "code": "def remove_even(l):\r\n    for i in l:\r\n        if i % 2 == 0:\r\n            l.remove(i)\r\n    return l", "entry_point": "remove_even", "input": "[1, 2, 3, 4]", "output": "[1, 3]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "824_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032165", "code": "def access_elements(nums, list_index):\r\n    result = [nums[i] for i in list_index]\r\n    return result", "entry_point": "access_elements", "input": "[2, 3, 8, 4, 7, 9], [0, 3, 5]", "output": "[2, 4, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "825_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032166", "code": "def access_elements(nums, list_index):\r\n    result = [nums[i] for i in list_index]\r\n    return result", "entry_point": "access_elements", "input": "[1, 2, 3, 4, 5], [1, 2]", "output": "[2, 3]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "825_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032167", "code": "def access_elements(nums, list_index):\r\n    result = [nums[i] for i in list_index]\r\n    return result", "entry_point": "access_elements", "input": "[1, 0, 2, 3], [0, 1]", "output": "[1, 0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "825_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032168", "code": "def check_Type_Of_Triangle(a,b,c): \r\n    sqa = pow(a,2) \r\n    sqb = pow(b,2) \r\n    sqc = pow(c,2) \r\n    if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb): \r\n        return (\"Right-angled Triangle\") \r\n    elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb): \r\n        return (\"Obtuse-angled Triangle\") \r\n    else: \r\n        return (\"Acute-angled Triangle\") ", "entry_point": "check_Type_Of_Triangle", "input": "1, 2, 3", "output": "'Obtuse-angled Triangle'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "826_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032169", "code": "def check_Type_Of_Triangle(a,b,c): \r\n    sqa = pow(a,2) \r\n    sqb = pow(b,2) \r\n    sqc = pow(c,2) \r\n    if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb): \r\n        return (\"Right-angled Triangle\") \r\n    elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb): \r\n        return (\"Obtuse-angled Triangle\") \r\n    else: \r\n        return (\"Acute-angled Triangle\") ", "entry_point": "check_Type_Of_Triangle", "input": "2, 2, 2", "output": "'Acute-angled Triangle'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "826_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032170", "code": "def check_Type_Of_Triangle(a,b,c): \r\n    sqa = pow(a,2) \r\n    sqb = pow(b,2) \r\n    sqc = pow(c,2) \r\n    if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb): \r\n        return (\"Right-angled Triangle\") \r\n    elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb): \r\n        return (\"Obtuse-angled Triangle\") \r\n    else: \r\n        return (\"Acute-angled Triangle\") ", "entry_point": "check_Type_Of_Triangle", "input": "1, 0, 1", "output": "'Right-angled Triangle'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "826_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032171", "code": "def sum_column(list1, C):\r\n    result = sum(row[C] for row in list1)\r\n    return result", "entry_point": "sum_column", "input": "[[1, 2, 3, 2], [4, 5, 6, 2], [7, 8, 9, 5]], 0", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "827_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032172", "code": "def sum_column(list1, C):\r\n    result = sum(row[C] for row in list1)\r\n    return result", "entry_point": "sum_column", "input": "[[1, 2, 3, 2], [4, 5, 6, 2], [7, 8, 9, 5]], 1", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "827_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032173", "code": "def sum_column(list1, C):\r\n    result = sum(row[C] for row in list1)\r\n    return result", "entry_point": "sum_column", "input": "[[1, 2, 3, 2], [4, 5, 6, 2], [7, 8, 9, 5]], 3", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "827_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032174", "code": "def count_alpha_dig_spl(string):\r\n  alphabets=digits = special = 0\r\n  for i in range(len(string)):\r\n    if(string[i].isalpha()):\r\n        alphabets = alphabets + 1\r\n    elif(string[i].isdigit()):\r\n        digits = digits + 1\r\n    else:\r\n        special = special + 1\r\n  return (alphabets,digits,special)   ", "entry_point": "count_alpha_dig_spl", "input": "'abc!@#123'", "output": "(3, 3, 3)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "828_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032175", "code": "def count_alpha_dig_spl(string):\r\n  alphabets=digits = special = 0\r\n  for i in range(len(string)):\r\n    if(string[i].isalpha()):\r\n        alphabets = alphabets + 1\r\n    elif(string[i].isdigit()):\r\n        digits = digits + 1\r\n    else:\r\n        special = special + 1\r\n  return (alphabets,digits,special)   ", "entry_point": "count_alpha_dig_spl", "input": "'dgsuy@#$%&1255'", "output": "(5, 4, 5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "828_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032176", "code": "def count_alpha_dig_spl(string):\r\n  alphabets=digits = special = 0\r\n  for i in range(len(string)):\r\n    if(string[i].isalpha()):\r\n        alphabets = alphabets + 1\r\n    elif(string[i].isdigit()):\r\n        digits = digits + 1\r\n    else:\r\n        special = special + 1\r\n  return (alphabets,digits,special)   ", "entry_point": "count_alpha_dig_spl", "input": "'fjdsif627348#%$^&'", "output": "(6, 6, 5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "828_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032177", "code": "from collections import Counter \r\n\t\r\ndef second_frequent(input): \r\n\tdict = Counter(input) \r\n\tvalue = sorted(dict.values(), reverse=True)  \r\n\tsecond_large = value[1] \r\n\tfor (key, val) in dict.items(): \r\n\t\tif val == second_large: \r\n\t\t\treturn (key) ", "entry_point": "second_frequent", "input": "['aaa', 'bbb', 'ccc', 'bbb', 'aaa', 'aaa']", "output": "'bbb'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "829_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032178", "code": "from collections import Counter \r\n\t\r\ndef second_frequent(input): \r\n\tdict = Counter(input) \r\n\tvalue = sorted(dict.values(), reverse=True)  \r\n\tsecond_large = value[1] \r\n\tfor (key, val) in dict.items(): \r\n\t\tif val == second_large: \r\n\t\t\treturn (key) ", "entry_point": "second_frequent", "input": "['abc', 'bcd', 'abc', 'bcd', 'bcd', 'bcd']", "output": "'abc'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "829_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032179", "code": "from collections import Counter \r\n\t\r\ndef second_frequent(input): \r\n\tdict = Counter(input) \r\n\tvalue = sorted(dict.values(), reverse=True)  \r\n\tsecond_large = value[1] \r\n\tfor (key, val) in dict.items(): \r\n\t\tif val == second_large: \r\n\t\t\treturn (key) ", "entry_point": "second_frequent", "input": "['cdma', 'gsm', 'hspa', 'gsm', 'cdma', 'cdma']", "output": "'gsm'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "829_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032180", "code": "import math\r\ndef round_up(a, digits):\r\n    n = 10**-digits\r\n    return round(math.ceil(a / n) * n, digits)", "entry_point": "round_up", "input": "123.01247, 0", "output": "124", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "830_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032181", "code": "import math\r\ndef round_up(a, digits):\r\n    n = 10**-digits\r\n    return round(math.ceil(a / n) * n, digits)", "entry_point": "round_up", "input": "123.01247, 1", "output": "123.1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "830_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032182", "code": "import math\r\ndef round_up(a, digits):\r\n    n = 10**-digits\r\n    return round(math.ceil(a / n) * n, digits)", "entry_point": "round_up", "input": "123.01247, 2", "output": "123.02", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "830_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032183", "code": "def count_Pairs(arr,n): \r\n    cnt = 0; \r\n    for i in range(n): \r\n        for j in range(i + 1,n): \r\n            if (arr[i] == arr[j]): \r\n                cnt += 1; \r\n    return cnt; ", "entry_point": "count_Pairs", "input": "[1, 1, 1, 1], 4", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "831_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032184", "code": "def count_Pairs(arr,n): \r\n    cnt = 0; \r\n    for i in range(n): \r\n        for j in range(i + 1,n): \r\n            if (arr[i] == arr[j]): \r\n                cnt += 1; \r\n    return cnt; ", "entry_point": "count_Pairs", "input": "[1, 5, 1], 3", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "831_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032185", "code": "def count_Pairs(arr,n): \r\n    cnt = 0; \r\n    for i in range(n): \r\n        for j in range(i + 1,n): \r\n            if (arr[i] == arr[j]): \r\n                cnt += 1; \r\n    return cnt; ", "entry_point": "count_Pairs", "input": "[3, 2, 1, 7, 8, 9], 6", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "831_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032186", "code": "import re \r\ndef extract_max(input): \r\n\tnumbers = re.findall('\\d+',input) \r\n\tnumbers = map(int,numbers) \r\n\treturn max(numbers)", "entry_point": "extract_max", "input": "'100klh564abc365bg'", "output": "564", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "832_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032187", "code": "import re \r\ndef extract_max(input): \r\n\tnumbers = re.findall('\\d+',input) \r\n\tnumbers = map(int,numbers) \r\n\treturn max(numbers)", "entry_point": "extract_max", "input": "'hello300how546mer231'", "output": "546", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "832_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032188", "code": "import re \r\ndef extract_max(input): \r\n\tnumbers = re.findall('\\d+',input) \r\n\tnumbers = map(int,numbers) \r\n\treturn max(numbers)", "entry_point": "extract_max", "input": "'its233beenalong343journey234'", "output": "343", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "832_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032189", "code": "def get_key(dict): \r\n    list = [] \r\n    for key in dict.keys(): \r\n        list.append(key)           \r\n    return list", "entry_point": "get_key", "input": "{1: 'python', 2: 'java'}", "output": "[1, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "833_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032190", "code": "def get_key(dict): \r\n    list = [] \r\n    for key in dict.keys(): \r\n        list.append(key)           \r\n    return list", "entry_point": "get_key", "input": "{10: 'red', 20: 'blue', 30: 'black'}", "output": "[10, 20, 30]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "833_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032191", "code": "def get_key(dict): \r\n    list = [] \r\n    for key in dict.keys(): \r\n        list.append(key)           \r\n    return list", "entry_point": "get_key", "input": "{27: 'language', 39: 'java', 44: 'little'}", "output": "[27, 39, 44]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "833_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032192", "code": "def generate_matrix(n):\r\n        if n<=0:\r\n            return [] \r\n        matrix=[row[:] for row in [[0]*n]*n]        \r\n        row_st=0\r\n        row_ed=n-1        \r\n        col_st=0\r\n        col_ed=n-1\r\n        current=1        \r\n        while (True):\r\n            if current>n*n:\r\n                break\r\n            for c in range (col_st, col_ed+1):\r\n                matrix[row_st][c]=current\r\n                current+=1\r\n            row_st+=1\r\n            for r in range (row_st, row_ed+1):\r\n                matrix[r][col_ed]=current\r\n                current+=1\r\n            col_ed-=1\r\n            for c in range (col_ed, col_st-1, -1):\r\n                matrix[row_ed][c]=current\r\n                current+=1\r\n            row_ed-=1\r\n            for r in range (row_ed, row_st-1, -1):\r\n                matrix[r][col_st]=current\r\n                current+=1\r\n            col_st+=1\r\n        return matrix", "entry_point": "generate_matrix", "input": "3", "output": "[[1, 2, 3], [8, 9, 4], [7, 6, 5]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "834_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032193", "code": "def generate_matrix(n):\r\n        if n<=0:\r\n            return [] \r\n        matrix=[row[:] for row in [[0]*n]*n]        \r\n        row_st=0\r\n        row_ed=n-1        \r\n        col_st=0\r\n        col_ed=n-1\r\n        current=1        \r\n        while (True):\r\n            if current>n*n:\r\n                break\r\n            for c in range (col_st, col_ed+1):\r\n                matrix[row_st][c]=current\r\n                current+=1\r\n            row_st+=1\r\n            for r in range (row_st, row_ed+1):\r\n                matrix[r][col_ed]=current\r\n                current+=1\r\n            col_ed-=1\r\n            for c in range (col_ed, col_st-1, -1):\r\n                matrix[row_ed][c]=current\r\n                current+=1\r\n            row_ed-=1\r\n            for r in range (row_ed, row_st-1, -1):\r\n                matrix[r][col_st]=current\r\n                current+=1\r\n            col_st+=1\r\n        return matrix", "entry_point": "generate_matrix", "input": "2", "output": "[[1, 2], [4, 3]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "834_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032194", "code": "def slope(x1,y1,x2,y2): \r\n    return (float)(y2-y1)/(x2-x1)  ", "entry_point": "slope", "input": "4, 2, 2, 5", "output": "-1.5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "835_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032195", "code": "def slope(x1,y1,x2,y2): \r\n    return (float)(y2-y1)/(x2-x1)  ", "entry_point": "slope", "input": "2, 4, 4, 6", "output": "1.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "835_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032196", "code": "def slope(x1,y1,x2,y2): \r\n    return (float)(y2-y1)/(x2-x1)  ", "entry_point": "slope", "input": "1, 2, 4, 2", "output": "0.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "835_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032197", "code": "from sys import maxsize \r\ndef max_sub_array_sum(a,size): \r\n\tmax_so_far = -maxsize - 1\r\n\tmax_ending_here = 0\r\n\tstart = 0\r\n\tend = 0\r\n\ts = 0\r\n\tfor i in range(0,size): \r\n\t\tmax_ending_here += a[i] \r\n\t\tif max_so_far < max_ending_here: \r\n\t\t\tmax_so_far = max_ending_here \r\n\t\t\tstart = s \r\n\t\t\tend = i \r\n\t\tif max_ending_here < 0: \r\n\t\t\tmax_ending_here = 0\r\n\t\t\ts = i+1\r\n\treturn (end - start + 1)", "entry_point": "max_sub_array_sum", "input": "[-2, -3, 4, -1, -2, 1, 5, -3], 8", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "836_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032198", "code": "from sys import maxsize \r\ndef max_sub_array_sum(a,size): \r\n\tmax_so_far = -maxsize - 1\r\n\tmax_ending_here = 0\r\n\tstart = 0\r\n\tend = 0\r\n\ts = 0\r\n\tfor i in range(0,size): \r\n\t\tmax_ending_here += a[i] \r\n\t\tif max_so_far < max_ending_here: \r\n\t\t\tmax_so_far = max_ending_here \r\n\t\t\tstart = s \r\n\t\t\tend = i \r\n\t\tif max_ending_here < 0: \r\n\t\t\tmax_ending_here = 0\r\n\t\t\ts = i+1\r\n\treturn (end - start + 1)", "entry_point": "max_sub_array_sum", "input": "[1, -2, 1, 1, -2, 1], 6", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "836_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032199", "code": "from sys import maxsize \r\ndef max_sub_array_sum(a,size): \r\n\tmax_so_far = -maxsize - 1\r\n\tmax_ending_here = 0\r\n\tstart = 0\r\n\tend = 0\r\n\ts = 0\r\n\tfor i in range(0,size): \r\n\t\tmax_ending_here += a[i] \r\n\t\tif max_so_far < max_ending_here: \r\n\t\t\tmax_so_far = max_ending_here \r\n\t\t\tstart = s \r\n\t\t\tend = i \r\n\t\tif max_ending_here < 0: \r\n\t\t\tmax_ending_here = 0\r\n\t\t\ts = i+1\r\n\treturn (end - start + 1)", "entry_point": "max_sub_array_sum", "input": "[-1, -2, 3, 4, 5], 5", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "836_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032200", "code": "def cube_Sum(n): \r\n    sum = 0   \r\n    for i in range(0,n) : \r\n        sum += (2*i+1)*(2*i+1)*(2*i+1) \r\n    return sum", "entry_point": "cube_Sum", "input": "2", "output": "28", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "837_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032201", "code": "def cube_Sum(n): \r\n    sum = 0   \r\n    for i in range(0,n) : \r\n        sum += (2*i+1)*(2*i+1)*(2*i+1) \r\n    return sum", "entry_point": "cube_Sum", "input": "3", "output": "153", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "837_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032202", "code": "def cube_Sum(n): \r\n    sum = 0   \r\n    for i in range(0,n) : \r\n        sum += (2*i+1)*(2*i+1)*(2*i+1) \r\n    return sum", "entry_point": "cube_Sum", "input": "4", "output": "496", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "837_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032203", "code": "def min_Swaps(s1,s2) :  \r\n    c0 = 0; c1 = 0;  \r\n    for i in range(len(s1)) :  \r\n        if (s1[i] == '0' and s2[i] == '1') : \r\n            c0 += 1;    \r\n        elif (s1[i] == '1' and s2[i] == '0') : \r\n            c1 += 1;  \r\n    result = c0 // 2 + c1 // 2;  \r\n    if (c0 % 2 == 0 and c1 % 2 == 0) : \r\n        return result;  \r\n    elif ((c0 + c1) % 2 == 0) : \r\n        return result + 2;  \r\n    else : \r\n        return -1;  ", "entry_point": "min_Swaps", "input": "'0011', '1111'", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "838_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032204", "code": "def min_Swaps(s1,s2) :  \r\n    c0 = 0; c1 = 0;  \r\n    for i in range(len(s1)) :  \r\n        if (s1[i] == '0' and s2[i] == '1') : \r\n            c0 += 1;    \r\n        elif (s1[i] == '1' and s2[i] == '0') : \r\n            c1 += 1;  \r\n    result = c0 // 2 + c1 // 2;  \r\n    if (c0 % 2 == 0 and c1 % 2 == 0) : \r\n        return result;  \r\n    elif ((c0 + c1) % 2 == 0) : \r\n        return result + 2;  \r\n    else : \r\n        return -1;  ", "entry_point": "min_Swaps", "input": "'00011', '01001'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "838_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032205", "code": "def min_Swaps(s1,s2) :  \r\n    c0 = 0; c1 = 0;  \r\n    for i in range(len(s1)) :  \r\n        if (s1[i] == '0' and s2[i] == '1') : \r\n            c0 += 1;    \r\n        elif (s1[i] == '1' and s2[i] == '0') : \r\n            c1 += 1;  \r\n    result = c0 // 2 + c1 // 2;  \r\n    if (c0 % 2 == 0 and c1 % 2 == 0) : \r\n        return result;  \r\n    elif ((c0 + c1) % 2 == 0) : \r\n        return result + 2;  \r\n    else : \r\n        return -1;  ", "entry_point": "min_Swaps", "input": "'111', '111'", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "838_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032206", "code": "def sort_tuple(tup): \r\n\tn = len(tup) \r\n\tfor i in range(n): \r\n\t\tfor j in range(n-i-1): \r\n\t\t\tif tup[j][0] > tup[j + 1][0]: \r\n\t\t\t\ttup[j], tup[j + 1] = tup[j + 1], tup[j] \r\n\treturn tup", "entry_point": "sort_tuple", "input": "[('Amana', 28), ('Zenat', 30), ('Abhishek', 29), ('Nikhil', 21), ('B', 'C')]", "output": "[('Abhishek', 29), ('Amana', 28), ('B', 'C'), ('Nikhil', 21), ('Zenat', 30)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "839_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032207", "code": "def sort_tuple(tup): \r\n\tn = len(tup) \r\n\tfor i in range(n): \r\n\t\tfor j in range(n-i-1): \r\n\t\t\tif tup[j][0] > tup[j + 1][0]: \r\n\t\t\t\ttup[j], tup[j + 1] = tup[j + 1], tup[j] \r\n\treturn tup", "entry_point": "sort_tuple", "input": "[('aaaa', 28), ('aa', 30), ('bab', 29), ('bb', 21), ('csa', 'C')]", "output": "[('aa', 30), ('aaaa', 28), ('bab', 29), ('bb', 21), ('csa', 'C')]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "839_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032208", "code": "def sort_tuple(tup): \r\n\tn = len(tup) \r\n\tfor i in range(n): \r\n\t\tfor j in range(n-i-1): \r\n\t\t\tif tup[j][0] > tup[j + 1][0]: \r\n\t\t\t\ttup[j], tup[j + 1] = tup[j + 1], tup[j] \r\n\treturn tup", "entry_point": "sort_tuple", "input": "[('Sarala', 28), ('Ayesha', 30), ('Suman', 29), ('Sai', 21), ('G', 'H')]", "output": "[('Ayesha', 30), ('G', 'H'), ('Sai', 21), ('Sarala', 28), ('Suman', 29)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "839_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032209", "code": "def Check_Solution(a,b,c):  \r\n    if b == 0:  \r\n        return (\"Yes\")  \r\n    else: \r\n        return (\"No\")  ", "entry_point": "Check_Solution", "input": "2, 0, -1", "output": "'Yes'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "840_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032210", "code": "def Check_Solution(a,b,c):  \r\n    if b == 0:  \r\n        return (\"Yes\")  \r\n    else: \r\n        return (\"No\")  ", "entry_point": "Check_Solution", "input": "1, -5, 6", "output": "'No'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "840_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032211", "code": "def Check_Solution(a,b,c):  \r\n    if b == 0:  \r\n        return (\"Yes\")  \r\n    else: \r\n        return (\"No\")  ", "entry_point": "Check_Solution", "input": "2, 0, 2", "output": "'Yes'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "840_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032212", "code": "def get_inv_count(arr, n): \r\n\tinv_count = 0\r\n\tfor i in range(n): \r\n\t\tfor j in range(i + 1, n): \r\n\t\t\tif (arr[i] > arr[j]): \r\n\t\t\t\tinv_count += 1\r\n\treturn inv_count ", "entry_point": "get_inv_count", "input": "[1, 20, 6, 4, 5], 5", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "841_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032213", "code": "def get_inv_count(arr, n): \r\n\tinv_count = 0\r\n\tfor i in range(n): \r\n\t\tfor j in range(i + 1, n): \r\n\t\t\tif (arr[i] > arr[j]): \r\n\t\t\t\tinv_count += 1\r\n\treturn inv_count ", "entry_point": "get_inv_count", "input": "[8, 4, 2, 1], 4", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "841_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032214", "code": "def get_inv_count(arr, n): \r\n\tinv_count = 0\r\n\tfor i in range(n): \r\n\t\tfor j in range(i + 1, n): \r\n\t\t\tif (arr[i] > arr[j]): \r\n\t\t\t\tinv_count += 1\r\n\treturn inv_count ", "entry_point": "get_inv_count", "input": "[3, 1, 2], 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "841_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032215", "code": "def get_odd_occurence(arr, arr_size):\r\n  for i in range(0, arr_size):\r\n    count = 0\r\n    for j in range(0, arr_size):\r\n      if arr[i] == arr[j]:\r\n        count += 1\r\n    if (count % 2 != 0):\r\n      return arr[i]\r\n  return -1", "entry_point": "get_odd_occurence", "input": "[2, 3, 5, 4, 5, 2, 4, 3, 5, 2, 4, 4, 2], 13", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "842_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032216", "code": "def get_odd_occurence(arr, arr_size):\r\n  for i in range(0, arr_size):\r\n    count = 0\r\n    for j in range(0, arr_size):\r\n      if arr[i] == arr[j]:\r\n        count += 1\r\n    if (count % 2 != 0):\r\n      return arr[i]\r\n  return -1", "entry_point": "get_odd_occurence", "input": "[1, 2, 3, 2, 3, 1, 3], 7", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "842_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032217", "code": "def get_odd_occurence(arr, arr_size):\r\n  for i in range(0, arr_size):\r\n    count = 0\r\n    for j in range(0, arr_size):\r\n      if arr[i] == arr[j]:\r\n        count += 1\r\n    if (count % 2 != 0):\r\n      return arr[i]\r\n  return -1", "entry_point": "get_odd_occurence", "input": "[5, 7, 2, 7, 5, 2, 5], 7", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "842_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032218", "code": "import heapq\r\ndef nth_super_ugly_number(n, primes):\r\n    uglies = [1]\r\n    def gen(prime):\r\n        for ugly in uglies:\r\n            yield ugly * prime\r\n    merged = heapq.merge(*map(gen, primes))\r\n    while len(uglies) < n:\r\n        ugly = next(merged)\r\n        if ugly != uglies[-1]:\r\n            uglies.append(ugly)\r\n    return uglies[-1]", "entry_point": "nth_super_ugly_number", "input": "12, [2, 7, 13, 19]", "output": "32", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "843_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032219", "code": "import heapq\r\ndef nth_super_ugly_number(n, primes):\r\n    uglies = [1]\r\n    def gen(prime):\r\n        for ugly in uglies:\r\n            yield ugly * prime\r\n    merged = heapq.merge(*map(gen, primes))\r\n    while len(uglies) < n:\r\n        ugly = next(merged)\r\n        if ugly != uglies[-1]:\r\n            uglies.append(ugly)\r\n    return uglies[-1]", "entry_point": "nth_super_ugly_number", "input": "10, [2, 7, 13, 19]", "output": "26", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "843_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032220", "code": "import heapq\r\ndef nth_super_ugly_number(n, primes):\r\n    uglies = [1]\r\n    def gen(prime):\r\n        for ugly in uglies:\r\n            yield ugly * prime\r\n    merged = heapq.merge(*map(gen, primes))\r\n    while len(uglies) < n:\r\n        ugly = next(merged)\r\n        if ugly != uglies[-1]:\r\n            uglies.append(ugly)\r\n    return uglies[-1]", "entry_point": "nth_super_ugly_number", "input": "100, [2, 7, 13, 19]", "output": "5408", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "843_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032221", "code": "def get_Number(n, k): \r\n    arr = [0] * n; \r\n    i = 0; \r\n    odd = 1; \r\n    while (odd <= n):   \r\n        arr[i] = odd; \r\n        i += 1; \r\n        odd += 2;\r\n    even = 2; \r\n    while (even <= n): \r\n        arr[i] = even; \r\n        i += 1;\r\n        even += 2; \r\n    return arr[k - 1]; ", "entry_point": "get_Number", "input": "8, 5", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "844_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032222", "code": "def get_Number(n, k): \r\n    arr = [0] * n; \r\n    i = 0; \r\n    odd = 1; \r\n    while (odd <= n):   \r\n        arr[i] = odd; \r\n        i += 1; \r\n        odd += 2;\r\n    even = 2; \r\n    while (even <= n): \r\n        arr[i] = even; \r\n        i += 1;\r\n        even += 2; \r\n    return arr[k - 1]; ", "entry_point": "get_Number", "input": "7, 2", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "844_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032223", "code": "def get_Number(n, k): \r\n    arr = [0] * n; \r\n    i = 0; \r\n    odd = 1; \r\n    while (odd <= n):   \r\n        arr[i] = odd; \r\n        i += 1; \r\n        odd += 2;\r\n    even = 2; \r\n    while (even <= n): \r\n        arr[i] = even; \r\n        i += 1;\r\n        even += 2; \r\n    return arr[k - 1]; ", "entry_point": "get_Number", "input": "5, 2", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "844_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032224", "code": "import math \r\ndef find_Digits(n): \r\n    if (n < 0): \r\n        return 0;\r\n    if (n <= 1): \r\n        return 1; \r\n    x = ((n * math.log10(n / math.e) + math.log10(2 * math.pi * n) /2.0)); \r\n    return math.floor(x) + 1; ", "entry_point": "find_Digits", "input": "7", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "845_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032225", "code": "import math \r\ndef find_Digits(n): \r\n    if (n < 0): \r\n        return 0;\r\n    if (n <= 1): \r\n        return 1; \r\n    x = ((n * math.log10(n / math.e) + math.log10(2 * math.pi * n) /2.0)); \r\n    return math.floor(x) + 1; ", "entry_point": "find_Digits", "input": "5", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "845_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032226", "code": "import math \r\ndef find_Digits(n): \r\n    if (n < 0): \r\n        return 0;\r\n    if (n <= 1): \r\n        return 1; \r\n    x = ((n * math.log10(n / math.e) + math.log10(2 * math.pi * n) /2.0)); \r\n    return math.floor(x) + 1; ", "entry_point": "find_Digits", "input": "4", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "845_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032227", "code": "def find_platform(arr, dep, n): \r\n    arr.sort() \r\n    dep.sort() \r\n    plat_needed = 1\r\n    result = 1\r\n    i = 1\r\n    j = 0\r\n    while (i < n and j < n): \r\n        if (arr[i] <= dep[j]):           \r\n            plat_needed+= 1\r\n            i+= 1\r\n        elif (arr[i] > dep[j]):           \r\n            plat_needed-= 1\r\n            j+= 1\r\n        if (plat_needed > result):  \r\n            result = plat_needed           \r\n    return result", "entry_point": "find_platform", "input": "[900, 940, 950, 1100, 1500, 1800], [910, 1200, 1120, 1130, 1900, 2000], 6", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "846_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032228", "code": "def find_platform(arr, dep, n): \r\n    arr.sort() \r\n    dep.sort() \r\n    plat_needed = 1\r\n    result = 1\r\n    i = 1\r\n    j = 0\r\n    while (i < n and j < n): \r\n        if (arr[i] <= dep[j]):           \r\n            plat_needed+= 1\r\n            i+= 1\r\n        elif (arr[i] > dep[j]):           \r\n            plat_needed-= 1\r\n            j+= 1\r\n        if (plat_needed > result):  \r\n            result = plat_needed           \r\n    return result", "entry_point": "find_platform", "input": "[100, 200, 300, 400], [700, 800, 900, 1000], 4", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "846_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032229", "code": "def find_platform(arr, dep, n): \r\n    arr.sort() \r\n    dep.sort() \r\n    plat_needed = 1\r\n    result = 1\r\n    i = 1\r\n    j = 0\r\n    while (i < n and j < n): \r\n        if (arr[i] <= dep[j]):           \r\n            plat_needed+= 1\r\n            i+= 1\r\n        elif (arr[i] > dep[j]):           \r\n            plat_needed-= 1\r\n            j+= 1\r\n        if (plat_needed > result):  \r\n            result = plat_needed           \r\n    return result", "entry_point": "find_platform", "input": "[5, 6, 7, 8], [4, 3, 2, 1], 4", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "846_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032230", "code": "def lcopy(xs):\n  return xs[:]\n", "entry_point": "lcopy", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "847_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032231", "code": "def lcopy(xs):\n  return xs[:]\n", "entry_point": "lcopy", "input": "[4, 8, 2, 10, 15, 18]", "output": "[4, 8, 2, 10, 15, 18]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "847_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032232", "code": "def lcopy(xs):\n  return xs[:]\n", "entry_point": "lcopy", "input": "[4, 5, 6]", "output": "[4, 5, 6]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "847_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032233", "code": "def area_trapezium(base1,base2,height):\r\n area = 0.5 * (base1 + base2) * height\r\n return area", "entry_point": "area_trapezium", "input": "6, 9, 4", "output": "30.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "848_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032234", "code": "def area_trapezium(base1,base2,height):\r\n area = 0.5 * (base1 + base2) * height\r\n return area", "entry_point": "area_trapezium", "input": "10, 20, 30", "output": "450.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "848_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032235", "code": "def area_trapezium(base1,base2,height):\r\n area = 0.5 * (base1 + base2) * height\r\n return area", "entry_point": "area_trapezium", "input": "15, 25, 35", "output": "700.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "848_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032236", "code": "def Sum(N): \r\n    SumOfPrimeDivisors = [0]*(N + 1)   \r\n    for i in range(2,N + 1) : \r\n        if (SumOfPrimeDivisors[i] == 0) : \r\n            for j in range(i,N + 1,i) : \r\n                SumOfPrimeDivisors[j] += i           \r\n    return SumOfPrimeDivisors[N] ", "entry_point": "Sum", "input": "60", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "849_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032237", "code": "def Sum(N): \r\n    SumOfPrimeDivisors = [0]*(N + 1)   \r\n    for i in range(2,N + 1) : \r\n        if (SumOfPrimeDivisors[i] == 0) : \r\n            for j in range(i,N + 1,i) : \r\n                SumOfPrimeDivisors[j] += i           \r\n    return SumOfPrimeDivisors[N] ", "entry_point": "Sum", "input": "39", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "849_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032238", "code": "def Sum(N): \r\n    SumOfPrimeDivisors = [0]*(N + 1)   \r\n    for i in range(2,N + 1) : \r\n        if (SumOfPrimeDivisors[i] == 0) : \r\n            for j in range(i,N + 1,i) : \r\n                SumOfPrimeDivisors[j] += i           \r\n    return SumOfPrimeDivisors[N] ", "entry_point": "Sum", "input": "40", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "849_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032239", "code": "def is_triangleexists(a,b,c): \r\n    if(a != 0 and b != 0 and c != 0 and (a + b + c)== 180): \r\n        if((a + b)>= c or (b + c)>= a or (a + c)>= b): \r\n            return True \r\n        else:\r\n            return False\r\n    else:\r\n        return False", "entry_point": "is_triangleexists", "input": "50, 60, 70", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "850_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032240", "code": "def is_triangleexists(a,b,c): \r\n    if(a != 0 and b != 0 and c != 0 and (a + b + c)== 180): \r\n        if((a + b)>= c or (b + c)>= a or (a + c)>= b): \r\n            return True \r\n        else:\r\n            return False\r\n    else:\r\n        return False", "entry_point": "is_triangleexists", "input": "90, 45, 45", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "850_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032241", "code": "def is_triangleexists(a,b,c): \r\n    if(a != 0 and b != 0 and c != 0 and (a + b + c)== 180): \r\n        if((a + b)>= c or (b + c)>= a or (a + c)>= b): \r\n            return True \r\n        else:\r\n            return False\r\n    else:\r\n        return False", "entry_point": "is_triangleexists", "input": "150, 30, 70", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "850_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032242", "code": "def Sum_of_Inverse_Divisors(N,Sum): \r\n    ans = float(Sum)*1.0 /float(N);  \r\n    return round(ans,2); ", "entry_point": "Sum_of_Inverse_Divisors", "input": "6, 12", "output": "2.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "851_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032243", "code": "def Sum_of_Inverse_Divisors(N,Sum): \r\n    ans = float(Sum)*1.0 /float(N);  \r\n    return round(ans,2); ", "entry_point": "Sum_of_Inverse_Divisors", "input": "9, 13", "output": "1.44", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "851_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032244", "code": "def Sum_of_Inverse_Divisors(N,Sum): \r\n    ans = float(Sum)*1.0 /float(N);  \r\n    return round(ans,2); ", "entry_point": "Sum_of_Inverse_Divisors", "input": "1, 4", "output": "4.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "851_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032245", "code": "def remove_negs(num_list): \r\n    for item in num_list: \r\n        if item < 0: \r\n           num_list.remove(item) \r\n    return num_list", "entry_point": "remove_negs", "input": "[1, -2, 3, -4]", "output": "[1, 3]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "852_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032246", "code": "def remove_negs(num_list): \r\n    for item in num_list: \r\n        if item < 0: \r\n           num_list.remove(item) \r\n    return num_list", "entry_point": "remove_negs", "input": "[1, 2, 3, -4]", "output": "[1, 2, 3]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "852_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032247", "code": "def remove_negs(num_list): \r\n    for item in num_list: \r\n        if item < 0: \r\n           num_list.remove(item) \r\n    return num_list", "entry_point": "remove_negs", "input": "[4, 5, -6, 7, -8]", "output": "[4, 5, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "852_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032248", "code": "import math\r\ndef sum_of_odd_Factors(n): \r\n    res = 1\r\n    while n % 2 == 0: \r\n        n = n // 2 \r\n    for i in range(3,int(math.sqrt(n) + 1)): \r\n        count = 0\r\n        curr_sum = 1\r\n        curr_term = 1\r\n        while n % i == 0: \r\n            count+=1 \r\n            n = n // i \r\n            curr_term *= i \r\n            curr_sum += curr_term    \r\n        res *= curr_sum  \r\n    if n >= 2: \r\n        res *= (1 + n) \r\n    return res ", "entry_point": "sum_of_odd_Factors", "input": "30", "output": "24", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "853_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032249", "code": "import math\r\ndef sum_of_odd_Factors(n): \r\n    res = 1\r\n    while n % 2 == 0: \r\n        n = n // 2 \r\n    for i in range(3,int(math.sqrt(n) + 1)): \r\n        count = 0\r\n        curr_sum = 1\r\n        curr_term = 1\r\n        while n % i == 0: \r\n            count+=1 \r\n            n = n // i \r\n            curr_term *= i \r\n            curr_sum += curr_term    \r\n        res *= curr_sum  \r\n    if n >= 2: \r\n        res *= (1 + n) \r\n    return res ", "entry_point": "sum_of_odd_Factors", "input": "18", "output": "13", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "853_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032250", "code": "import math\r\ndef sum_of_odd_Factors(n): \r\n    res = 1\r\n    while n % 2 == 0: \r\n        n = n // 2 \r\n    for i in range(3,int(math.sqrt(n) + 1)): \r\n        count = 0\r\n        curr_sum = 1\r\n        curr_term = 1\r\n        while n % i == 0: \r\n            count+=1 \r\n            n = n // i \r\n            curr_term *= i \r\n            curr_sum += curr_term    \r\n        res *= curr_sum  \r\n    if n >= 2: \r\n        res *= (1 + n) \r\n    return res ", "entry_point": "sum_of_odd_Factors", "input": "2", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "853_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032251", "code": "import heapq as hq\r\ndef raw_heap(rawheap):\r\n  hq.heapify(rawheap)\r\n  return rawheap", "entry_point": "raw_heap", "input": "[25, 44, 68, 21, 39, 23, 89]", "output": "[21, 25, 23, 44, 39, 68, 89]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "854_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032252", "code": "import heapq as hq\r\ndef raw_heap(rawheap):\r\n  hq.heapify(rawheap)\r\n  return rawheap", "entry_point": "raw_heap", "input": "[25, 35, 22, 85, 14, 65, 75, 25, 58]", "output": "[14, 25, 22, 25, 35, 65, 75, 85, 58]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "854_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032253", "code": "import heapq as hq\r\ndef raw_heap(rawheap):\r\n  hq.heapify(rawheap)\r\n  return rawheap", "entry_point": "raw_heap", "input": "[4, 5, 6, 2]", "output": "[2, 4, 6, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "854_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032254", "code": "def check_Even_Parity(x): \r\n    parity = 0\r\n    while (x != 0): \r\n        x = x & (x - 1) \r\n        parity += 1\r\n    if (parity % 2 == 0): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "check_Even_Parity", "input": "10", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "855_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032255", "code": "def check_Even_Parity(x): \r\n    parity = 0\r\n    while (x != 0): \r\n        x = x & (x - 1) \r\n        parity += 1\r\n    if (parity % 2 == 0): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "check_Even_Parity", "input": "11", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "855_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032256", "code": "def check_Even_Parity(x): \r\n    parity = 0\r\n    while (x != 0): \r\n        x = x & (x - 1) \r\n        parity += 1\r\n    if (parity % 2 == 0): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "check_Even_Parity", "input": "18", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "855_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032257", "code": "def find_Min_Swaps(arr,n) : \r\n    noOfZeroes = [0] * n \r\n    count = 0 \r\n    noOfZeroes[n - 1] = 1 - arr[n - 1] \r\n    for i in range(n-2,-1,-1) : \r\n        noOfZeroes[i] = noOfZeroes[i + 1] \r\n        if (arr[i] == 0) : \r\n            noOfZeroes[i] = noOfZeroes[i] + 1\r\n    for i in range(0,n) : \r\n        if (arr[i] == 1) : \r\n            count = count + noOfZeroes[i] \r\n    return count ", "entry_point": "find_Min_Swaps", "input": "[1, 0, 1, 0], 4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "856_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032258", "code": "def find_Min_Swaps(arr,n) : \r\n    noOfZeroes = [0] * n \r\n    count = 0 \r\n    noOfZeroes[n - 1] = 1 - arr[n - 1] \r\n    for i in range(n-2,-1,-1) : \r\n        noOfZeroes[i] = noOfZeroes[i + 1] \r\n        if (arr[i] == 0) : \r\n            noOfZeroes[i] = noOfZeroes[i] + 1\r\n    for i in range(0,n) : \r\n        if (arr[i] == 1) : \r\n            count = count + noOfZeroes[i] \r\n    return count ", "entry_point": "find_Min_Swaps", "input": "[0, 1, 0], 3", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "856_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032259", "code": "def find_Min_Swaps(arr,n) : \r\n    noOfZeroes = [0] * n \r\n    count = 0 \r\n    noOfZeroes[n - 1] = 1 - arr[n - 1] \r\n    for i in range(n-2,-1,-1) : \r\n        noOfZeroes[i] = noOfZeroes[i + 1] \r\n        if (arr[i] == 0) : \r\n            noOfZeroes[i] = noOfZeroes[i] + 1\r\n    for i in range(0,n) : \r\n        if (arr[i] == 1) : \r\n            count = count + noOfZeroes[i] \r\n    return count ", "entry_point": "find_Min_Swaps", "input": "[0, 0, 1, 1, 0], 5", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "856_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032260", "code": "def listify_list(list1):\r\n  result = list(map(list,list1)) \r\n  return result ", "entry_point": "listify_list", "input": "['Red', 'Blue', 'Black', 'White', 'Pink']", "output": "[['R', 'e', 'd'], ['B', 'l', 'u', 'e'], ['B', 'l', 'a', 'c', 'k'], ['W', 'h', 'i', 't', 'e'], ['P', 'i', 'n', 'k']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "857_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032261", "code": "def listify_list(list1):\r\n  result = list(map(list,list1)) \r\n  return result ", "entry_point": "listify_list", "input": "['python']", "output": "[['p', 'y', 't', 'h', 'o', 'n']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "857_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032262", "code": "def listify_list(list1):\r\n  result = list(map(list,list1)) \r\n  return result ", "entry_point": "listify_list", "input": "[' red ', 'green', ' black', 'blue ', ' orange', 'brown']", "output": "[[' ', 'r', 'e', 'd', ' '], ['g', 'r', 'e', 'e', 'n'], [' ', 'b', 'l', 'a', 'c', 'k'], ['b', 'l', 'u', 'e', ' '], [' ', 'o', 'r', 'a', 'n', 'g', 'e'], ['b', 'r', 'o', 'w', 'n']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "857_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032263", "code": "def count_list(input_list): \r\n    return (len(input_list))**2", "entry_point": "count_list", "input": "[[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]]", "output": "25", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "858_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032264", "code": "def count_list(input_list): \r\n    return (len(input_list))**2", "entry_point": "count_list", "input": "[[1, 3], [5, 7], [9, 11], [13, 15, 17]]", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "858_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032265", "code": "def count_list(input_list): \r\n    return (len(input_list))**2", "entry_point": "count_list", "input": "[[2, 4], [[6, 8], [4, 5, 8]], [10, 12, 14]]", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "858_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032266", "code": "from itertools import combinations\r\ndef sub_lists(my_list):\r\n\tsubs = []\r\n\tfor i in range(0, len(my_list)+1):\r\n\t  temp = [list(x) for x in combinations(my_list, i)]\r\n\t  if len(temp)>0:\r\n\t    subs.extend(temp)\r\n\treturn subs", "entry_point": "sub_lists", "input": "[10, 20, 30, 40]", "output": "[[], [10], [20], [30], [40], [10, 20], [10, 30], [10, 40], [20, 30], [20, 40], [30, 40], [10, 20, 30], [10, 20, 40], [10, 30, 40], [20, 30, 40], [10, 20, 30, 40]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "859_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032267", "code": "from itertools import combinations\r\ndef sub_lists(my_list):\r\n\tsubs = []\r\n\tfor i in range(0, len(my_list)+1):\r\n\t  temp = [list(x) for x in combinations(my_list, i)]\r\n\t  if len(temp)>0:\r\n\t    subs.extend(temp)\r\n\treturn subs", "entry_point": "sub_lists", "input": "['X', 'Y', 'Z']", "output": "[[], ['X'], ['Y'], ['Z'], ['X', 'Y'], ['X', 'Z'], ['Y', 'Z'], ['X', 'Y', 'Z']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "859_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032268", "code": "from itertools import combinations\r\ndef sub_lists(my_list):\r\n\tsubs = []\r\n\tfor i in range(0, len(my_list)+1):\r\n\t  temp = [list(x) for x in combinations(my_list, i)]\r\n\t  if len(temp)>0:\r\n\t    subs.extend(temp)\r\n\treturn subs", "entry_point": "sub_lists", "input": "[1, 2, 3]", "output": "[[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "859_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032269", "code": "import re \r\nregex = '[a-zA-z0-9]$'\r\ndef check_alphanumeric(string): \r\n\tif(re.search(regex, string)): \r\n\t\treturn (\"Accept\") \r\n\telse: \r\n\t\treturn (\"Discard\") ", "entry_point": "check_alphanumeric", "input": "'dawood@'", "output": "'Discard'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "860_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032270", "code": "import re \r\nregex = '[a-zA-z0-9]$'\r\ndef check_alphanumeric(string): \r\n\tif(re.search(regex, string)): \r\n\t\treturn (\"Accept\") \r\n\telse: \r\n\t\treturn (\"Discard\") ", "entry_point": "check_alphanumeric", "input": "'skdmsam326'", "output": "'Accept'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "860_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032271", "code": "import re \r\nregex = '[a-zA-z0-9]$'\r\ndef check_alphanumeric(string): \r\n\tif(re.search(regex, string)): \r\n\t\treturn (\"Accept\") \r\n\telse: \r\n\t\treturn (\"Discard\") ", "entry_point": "check_alphanumeric", "input": "'cooltricks@'", "output": "'Discard'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "860_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032272", "code": "from collections import Counter \r\ndef anagram_lambda(texts,str):\r\n  result = list(filter(lambda x: (Counter(str) == Counter(x)), texts)) \r\n  return result", "entry_point": "anagram_lambda", "input": "['bcda', 'abce', 'cbda', 'cbea', 'adcb'], 'abcd'", "output": "['bcda', 'cbda', 'adcb']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "861_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032273", "code": "from collections import Counter \r\ndef anagram_lambda(texts,str):\r\n  result = list(filter(lambda x: (Counter(str) == Counter(x)), texts)) \r\n  return result", "entry_point": "anagram_lambda", "input": "['recitals', ' python'], 'articles'", "output": "['recitals']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "861_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032274", "code": "from collections import Counter \r\ndef anagram_lambda(texts,str):\r\n  result = list(filter(lambda x: (Counter(str) == Counter(x)), texts)) \r\n  return result", "entry_point": "anagram_lambda", "input": "[' keep', ' abcdef', ' xyz'], ' peek'", "output": "[' keep']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "861_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032275", "code": "from collections import Counter\r\nimport re\r\ndef n_common_words(text,n):\r\n  words = re.findall('\\w+',text)\r\n  n_common_words= Counter(words).most_common(n)\r\n  return list(n_common_words)", "entry_point": "n_common_words", "input": "'python is a programming language', 1", "output": "[('python', 1)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "862_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032276", "code": "from collections import Counter\r\nimport re\r\ndef n_common_words(text,n):\r\n  words = re.findall('\\w+',text)\r\n  n_common_words= Counter(words).most_common(n)\r\n  return list(n_common_words)", "entry_point": "n_common_words", "input": "'python is a programming language', 5", "output": "[('python', 1), ('is', 1), ('a', 1), ('programming', 1), ('language', 1)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "862_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032277", "code": "def find_longest_conseq_subseq(arr, n): \r\n\tans = 0\r\n\tcount = 0\r\n\tarr.sort() \r\n\tv = [] \r\n\tv.append(arr[0]) \r\n\tfor i in range(1, n): \r\n\t\tif (arr[i] != arr[i - 1]): \r\n\t\t\tv.append(arr[i]) \r\n\tfor i in range(len(v)): \r\n\t\tif (i > 0 and v[i] == v[i - 1] + 1): \r\n\t\t\tcount += 1\r\n\t\telse: \r\n\t\t\tcount = 1\r\n\t\tans = max(ans, count) \r\n\treturn ans ", "entry_point": "find_longest_conseq_subseq", "input": "[1, 2, 2, 3], 4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "863_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032278", "code": "def find_longest_conseq_subseq(arr, n): \r\n\tans = 0\r\n\tcount = 0\r\n\tarr.sort() \r\n\tv = [] \r\n\tv.append(arr[0]) \r\n\tfor i in range(1, n): \r\n\t\tif (arr[i] != arr[i - 1]): \r\n\t\t\tv.append(arr[i]) \r\n\tfor i in range(len(v)): \r\n\t\tif (i > 0 and v[i] == v[i - 1] + 1): \r\n\t\t\tcount += 1\r\n\t\telse: \r\n\t\t\tcount = 1\r\n\t\tans = max(ans, count) \r\n\treturn ans ", "entry_point": "find_longest_conseq_subseq", "input": "[1, 9, 3, 10, 4, 20, 2], 7", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "863_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032279", "code": "def find_longest_conseq_subseq(arr, n): \r\n\tans = 0\r\n\tcount = 0\r\n\tarr.sort() \r\n\tv = [] \r\n\tv.append(arr[0]) \r\n\tfor i in range(1, n): \r\n\t\tif (arr[i] != arr[i - 1]): \r\n\t\t\tv.append(arr[i]) \r\n\tfor i in range(len(v)): \r\n\t\tif (i > 0 and v[i] == v[i - 1] + 1): \r\n\t\t\tcount += 1\r\n\t\telse: \r\n\t\t\tcount = 1\r\n\t\tans = max(ans, count) \r\n\treturn ans ", "entry_point": "find_longest_conseq_subseq", "input": "[36, 41, 56, 35, 44, 33, 34, 92, 43, 32, 42], 11", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "863_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032280", "code": "def palindrome_lambda(texts):\r\n  result = list(filter(lambda x: (x == \"\".join(reversed(x))), texts))\r\n  return result", "entry_point": "palindrome_lambda", "input": "['php', 'res', 'Python', 'abcd', 'Java', 'aaa']", "output": "['php', 'aaa']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "864_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032281", "code": "def palindrome_lambda(texts):\r\n  result = list(filter(lambda x: (x == \"\".join(reversed(x))), texts))\r\n  return result", "entry_point": "palindrome_lambda", "input": "['abcd', 'Python', 'abba', 'aba']", "output": "['abba', 'aba']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "864_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032282", "code": "def palindrome_lambda(texts):\r\n  result = list(filter(lambda x: (x == \"\".join(reversed(x))), texts))\r\n  return result", "entry_point": "palindrome_lambda", "input": "['abcd', 'abbccbba', 'abba', 'aba']", "output": "['abbccbba', 'abba', 'aba']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "864_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032283", "code": "def ntimes_list(nums,n):\r\n    result = map(lambda x:n*x, nums) \r\n    return list(result)", "entry_point": "ntimes_list", "input": "[1, 2, 3, 4, 5, 6, 7], 3", "output": "[3, 6, 9, 12, 15, 18, 21]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "865_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032284", "code": "def ntimes_list(nums,n):\r\n    result = map(lambda x:n*x, nums) \r\n    return list(result)", "entry_point": "ntimes_list", "input": "[1, 2, 3, 4, 5, 6, 7], 4", "output": "[4, 8, 12, 16, 20, 24, 28]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "865_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032285", "code": "def ntimes_list(nums,n):\r\n    result = map(lambda x:n*x, nums) \r\n    return list(result)", "entry_point": "ntimes_list", "input": "[1, 2, 3, 4, 5, 6, 7], 10", "output": "[10, 20, 30, 40, 50, 60, 70]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "865_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032286", "code": "def check_monthnumb(monthname2):\r\n  if(monthname2==\"January\" or monthname2==\"March\"or monthname2==\"May\" or monthname2==\"July\" or monthname2==\"Augest\" or monthname2==\"October\" or monthname2==\"December\"):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnumb", "input": "'February'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "866_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032287", "code": "def check_monthnumb(monthname2):\r\n  if(monthname2==\"January\" or monthname2==\"March\"or monthname2==\"May\" or monthname2==\"July\" or monthname2==\"Augest\" or monthname2==\"October\" or monthname2==\"December\"):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnumb", "input": "'January'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "866_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032288", "code": "def check_monthnumb(monthname2):\r\n  if(monthname2==\"January\" or monthname2==\"March\"or monthname2==\"May\" or monthname2==\"July\" or monthname2==\"Augest\" or monthname2==\"October\" or monthname2==\"December\"):\r\n    return True\r\n  else:\r\n    return False", "entry_point": "check_monthnumb", "input": "'March'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "866_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032289", "code": "def min_Num(arr,n):  \r\n    odd = 0\r\n    for i in range(n): \r\n        if (arr[i] % 2): \r\n            odd += 1 \r\n    if (odd % 2): \r\n        return 1\r\n    return 2", "entry_point": "min_Num", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 9", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "867_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032290", "code": "def min_Num(arr,n):  \r\n    odd = 0\r\n    for i in range(n): \r\n        if (arr[i] % 2): \r\n            odd += 1 \r\n    if (odd % 2): \r\n        return 1\r\n    return 2", "entry_point": "min_Num", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 8", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "867_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032291", "code": "def min_Num(arr,n):  \r\n    odd = 0\r\n    for i in range(n): \r\n        if (arr[i] % 2): \r\n            odd += 1 \r\n    if (odd % 2): \r\n        return 1\r\n    return 2", "entry_point": "min_Num", "input": "[1, 2, 3], 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "867_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032292", "code": "def length_Of_Last_Word(a): \r\n    l = 0\r\n    x = a.strip() \r\n    for i in range(len(x)): \r\n        if x[i] == \" \": \r\n            l = 0\r\n        else: \r\n            l += 1\r\n    return l ", "entry_point": "length_Of_Last_Word", "input": "'python language'", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "868_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032293", "code": "def length_Of_Last_Word(a): \r\n    l = 0\r\n    x = a.strip() \r\n    for i in range(len(x)): \r\n        if x[i] == \" \": \r\n            l = 0\r\n        else: \r\n            l += 1\r\n    return l ", "entry_point": "length_Of_Last_Word", "input": "'PHP'", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "868_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032294", "code": "def length_Of_Last_Word(a): \r\n    l = 0\r\n    x = a.strip() \r\n    for i in range(len(x)): \r\n        if x[i] == \" \": \r\n            l = 0\r\n        else: \r\n            l += 1\r\n    return l ", "entry_point": "length_Of_Last_Word", "input": "''", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "868_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032295", "code": "def remove_list_range(list1, leftrange, rigthrange):\r\n   result = [i for i in list1 if (min(i)>=leftrange and max(i)<=rigthrange)]\r\n   return result", "entry_point": "remove_list_range", "input": "[[2], [0], [1, 2, 3], [0, 1, 2, 3, 6, 7], [9, 11], [13, 14, 15, 17]], 13, 17", "output": "[[13, 14, 15, 17]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "869_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032296", "code": "def remove_list_range(list1, leftrange, rigthrange):\r\n   result = [i for i in list1 if (min(i)>=leftrange and max(i)<=rigthrange)]\r\n   return result", "entry_point": "remove_list_range", "input": "[[2], [0], [1, 2, 3], [0, 1, 2, 3, 6, 7], [9, 11], [13, 14, 15, 17]], 1, 3", "output": "[[2], [1, 2, 3]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "869_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032297", "code": "def remove_list_range(list1, leftrange, rigthrange):\r\n   result = [i for i in list1 if (min(i)>=leftrange and max(i)<=rigthrange)]\r\n   return result", "entry_point": "remove_list_range", "input": "[[2], [0], [1, 2, 3], [0, 1, 2, 3, 6, 7], [9, 11], [13, 14, 15, 17]], 0, 7", "output": "[[2], [0], [1, 2, 3], [0, 1, 2, 3, 6, 7]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "869_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032298", "code": "def sum_positivenum(nums):\r\n  sum_positivenum = list(filter(lambda nums:nums>0,nums))\r\n  return sum(sum_positivenum)", "entry_point": "sum_positivenum", "input": "[2, 4, -6, -9, 11, -12, 14, -5, 17]", "output": "48", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "870_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032299", "code": "def sum_positivenum(nums):\r\n  sum_positivenum = list(filter(lambda nums:nums>0,nums))\r\n  return sum(sum_positivenum)", "entry_point": "sum_positivenum", "input": "[10, 15, -14, 13, -18, 12, -20]", "output": "50", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "870_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032300", "code": "def sum_positivenum(nums):\r\n  sum_positivenum = list(filter(lambda nums:nums>0,nums))\r\n  return sum(sum_positivenum)", "entry_point": "sum_positivenum", "input": "[19, -65, 57, 39, 152, -639, 121, 44, 90, -190]", "output": "522", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "870_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032301", "code": "def are_Rotations(string1,string2): \r\n    size1 = len(string1) \r\n    size2 = len(string2) \r\n    temp = '' \r\n    if size1 != size2: \r\n        return False\r\n    temp = string1 + string1 \r\n    if (temp.count(string2)> 0): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "are_Rotations", "input": "'abc', 'cba'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "871_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032302", "code": "def are_Rotations(string1,string2): \r\n    size1 = len(string1) \r\n    size2 = len(string2) \r\n    temp = '' \r\n    if size1 != size2: \r\n        return False\r\n    temp = string1 + string1 \r\n    if (temp.count(string2)> 0): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "are_Rotations", "input": "'abcd', 'cdba'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "871_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032303", "code": "def are_Rotations(string1,string2): \r\n    size1 = len(string1) \r\n    size2 = len(string2) \r\n    temp = '' \r\n    if size1 != size2: \r\n        return False\r\n    temp = string1 + string1 \r\n    if (temp.count(string2)> 0): \r\n        return True\r\n    else: \r\n        return False", "entry_point": "are_Rotations", "input": "'abacd', 'cdaba'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "871_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032304", "code": "def check_subset(list1,list2): \r\n    return all(map(list1.__contains__,list2)) ", "entry_point": "check_subset", "input": "[[1, 3], [5, 7], [9, 11], [13, 15, 17]], [[1, 3], [13, 15, 17]]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "872_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032305", "code": "def check_subset(list1,list2): \r\n    return all(map(list1.__contains__,list2)) ", "entry_point": "check_subset", "input": "[[1, 2], [2, 3], [3, 4], [5, 6]], [[3, 4], [5, 6]]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "872_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032306", "code": "def check_subset(list1,list2): \r\n    return all(map(list1.__contains__,list2)) ", "entry_point": "check_subset", "input": "[[[1, 2], [2, 3]], [[3, 4], [5, 7]]], [[[3, 4], [5, 6]]]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "872_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032307", "code": "def fibonacci(n):\r\n  if n == 1 or n == 2:\r\n    return 1\r\n  else:\r\n    return (fibonacci(n - 1) + (fibonacci(n - 2)))", "entry_point": "fibonacci", "input": "7", "output": "13", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "873_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032308", "code": "def fibonacci(n):\r\n  if n == 1 or n == 2:\r\n    return 1\r\n  else:\r\n    return (fibonacci(n - 1) + (fibonacci(n - 2)))", "entry_point": "fibonacci", "input": "8", "output": "21", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "873_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032309", "code": "def fibonacci(n):\r\n  if n == 1 or n == 2:\r\n    return 1\r\n  else:\r\n    return (fibonacci(n - 1) + (fibonacci(n - 2)))", "entry_point": "fibonacci", "input": "9", "output": "34", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "873_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032310", "code": "def check_Concat(str1,str2):\r\n    N = len(str1)\r\n    M = len(str2)\r\n    if (N % M != 0):\r\n        return False\r\n    for i in range(N):\r\n        if (str1[i] != str2[i % M]):\r\n            return False         \r\n    return True", "entry_point": "check_Concat", "input": "'abcabcabc', 'abc'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "874_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032311", "code": "def check_Concat(str1,str2):\r\n    N = len(str1)\r\n    M = len(str2)\r\n    if (N % M != 0):\r\n        return False\r\n    for i in range(N):\r\n        if (str1[i] != str2[i % M]):\r\n            return False         \r\n    return True", "entry_point": "check_Concat", "input": "'abcab', 'abc'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "874_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032312", "code": "def check_Concat(str1,str2):\r\n    N = len(str1)\r\n    M = len(str2)\r\n    if (N % M != 0):\r\n        return False\r\n    for i in range(N):\r\n        if (str1[i] != str2[i % M]):\r\n            return False         \r\n    return True", "entry_point": "check_Concat", "input": "'aba', 'ab'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "874_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032313", "code": "def min_difference(test_list):\r\n  temp = [abs(b - a) for a, b in test_list]\r\n  res = min(temp)\r\n  return (res) ", "entry_point": "min_difference", "input": "[(3, 5), (1, 7), (10, 3), (1, 2)]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "875_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032314", "code": "def min_difference(test_list):\r\n  temp = [abs(b - a) for a, b in test_list]\r\n  res = min(temp)\r\n  return (res) ", "entry_point": "min_difference", "input": "[(4, 6), (12, 8), (11, 4), (2, 13)]", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "875_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032315", "code": "def min_difference(test_list):\r\n  temp = [abs(b - a) for a, b in test_list]\r\n  res = min(temp)\r\n  return (res) ", "entry_point": "min_difference", "input": "[(5, 17), (3, 9), (12, 5), (3, 24)]", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "875_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032316", "code": "def lcm(x, y):\r\n   if x > y:\r\n       z = x\r\n   else:\r\n       z = y\r\n   while(True):\r\n       if((z % x == 0) and (z % y == 0)):\r\n           lcm = z\r\n           break\r\n       z += 1\r\n   return lcm", "entry_point": "lcm", "input": "4, 6", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "876_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032317", "code": "def lcm(x, y):\r\n   if x > y:\r\n       z = x\r\n   else:\r\n       z = y\r\n   while(True):\r\n       if((z % x == 0) and (z % y == 0)):\r\n           lcm = z\r\n           break\r\n       z += 1\r\n   return lcm", "entry_point": "lcm", "input": "15, 17", "output": "255", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "876_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032318", "code": "def lcm(x, y):\r\n   if x > y:\r\n       z = x\r\n   else:\r\n       z = y\r\n   while(True):\r\n       if((z % x == 0) and (z % y == 0)):\r\n           lcm = z\r\n           break\r\n       z += 1\r\n   return lcm", "entry_point": "lcm", "input": "2, 6", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "876_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032319", "code": "def sort_String(str) : \r\n    str = ''.join(sorted(str)) \r\n    return (str) ", "entry_point": "sort_String", "input": "'cba'", "output": "'abc'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "877_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032320", "code": "def sort_String(str) : \r\n    str = ''.join(sorted(str)) \r\n    return (str) ", "entry_point": "sort_String", "input": "'data'", "output": "'aadt'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "877_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032321", "code": "def sort_String(str) : \r\n    str = ''.join(sorted(str)) \r\n    return (str) ", "entry_point": "sort_String", "input": "'zxy'", "output": "'xyz'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "877_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032322", "code": "def check_tuples(test_tuple, K):\r\n  res = all(ele in K for ele in test_tuple)\r\n  return (res) ", "entry_point": "check_tuples", "input": "(3, 5, 6, 5, 3, 6), [3, 6, 5]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "878_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032323", "code": "def check_tuples(test_tuple, K):\r\n  res = all(ele in K for ele in test_tuple)\r\n  return (res) ", "entry_point": "check_tuples", "input": "(4, 5, 6, 4, 6, 5), [4, 5, 6]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "878_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032324", "code": "def check_tuples(test_tuple, K):\r\n  res = all(ele in K for ele in test_tuple)\r\n  return (res) ", "entry_point": "check_tuples", "input": "(9, 8, 7, 6, 8, 9), [9, 8, 1]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "878_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032325", "code": "import re\r\ndef text_match(text):\r\n  patterns = 'a.*?b$'\r\n  if re.search(patterns,  text):\r\n    return ('Found a match!')\r\n  else:\r\n    return ('Not matched!')", "entry_point": "text_match", "input": "'aabbbbd'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "879_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032326", "code": "import re\r\ndef text_match(text):\r\n  patterns = 'a.*?b$'\r\n  if re.search(patterns,  text):\r\n    return ('Found a match!')\r\n  else:\r\n    return ('Not matched!')", "entry_point": "text_match", "input": "'aabAbbbc'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "879_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032327", "code": "import re\r\ndef text_match(text):\r\n  patterns = 'a.*?b$'\r\n  if re.search(patterns,  text):\r\n    return ('Found a match!')\r\n  else:\r\n    return ('Not matched!')", "entry_point": "text_match", "input": "'accddbbjjjb'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "879_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032328", "code": "def Check_Solution(a,b,c) : \r\n    if ((b*b) - (4*a*c)) > 0 : \r\n        return (\"2 solutions\") \r\n    elif ((b*b) - (4*a*c)) == 0 : \r\n        return (\"1 solution\") \r\n    else : \r\n        return (\"No solutions\") ", "entry_point": "Check_Solution", "input": "2, 5, 2", "output": "'2 solutions'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "880_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032329", "code": "def Check_Solution(a,b,c) : \r\n    if ((b*b) - (4*a*c)) > 0 : \r\n        return (\"2 solutions\") \r\n    elif ((b*b) - (4*a*c)) == 0 : \r\n        return (\"1 solution\") \r\n    else : \r\n        return (\"No solutions\") ", "entry_point": "Check_Solution", "input": "1, 1, 1", "output": "'No solutions'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "880_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032330", "code": "def Check_Solution(a,b,c) : \r\n    if ((b*b) - (4*a*c)) > 0 : \r\n        return (\"2 solutions\") \r\n    elif ((b*b) - (4*a*c)) == 0 : \r\n        return (\"1 solution\") \r\n    else : \r\n        return (\"No solutions\") ", "entry_point": "Check_Solution", "input": "1, 2, 1", "output": "'1 solution'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "880_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032331", "code": "def sum_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even+first_odd)", "entry_point": "sum_even_odd", "input": "[1, 3, 5, 7, 4, 1, 6, 8]", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "881_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032332", "code": "def sum_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even+first_odd)", "entry_point": "sum_even_odd", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "881_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032333", "code": "def sum_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even+first_odd)", "entry_point": "sum_even_odd", "input": "[1, 5, 7, 9, 10]", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "881_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032334", "code": "def parallelogram_perimeter(b,h):\r\n  perimeter=2*(b*h)\r\n  return perimeter", "entry_point": "parallelogram_perimeter", "input": "10, 20", "output": "400", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "882_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032335", "code": "def parallelogram_perimeter(b,h):\r\n  perimeter=2*(b*h)\r\n  return perimeter", "entry_point": "parallelogram_perimeter", "input": "15, 20", "output": "600", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "882_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032336", "code": "def parallelogram_perimeter(b,h):\r\n  perimeter=2*(b*h)\r\n  return perimeter", "entry_point": "parallelogram_perimeter", "input": "8, 9", "output": "144", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "882_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032337", "code": "def div_of_nums(nums,m,n):\r\n result = list(filter(lambda x: (x % m == 0 and x % n == 0), nums)) \r\n return result", "entry_point": "div_of_nums", "input": "[19, 65, 57, 39, 152, 639, 121, 44, 90, 190], 2, 4", "output": "[152, 44]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "883_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032338", "code": "def div_of_nums(nums,m,n):\r\n result = list(filter(lambda x: (x % m == 0 and x % n == 0), nums)) \r\n return result", "entry_point": "div_of_nums", "input": "[1, 2, 3, 5, 7, 8, 10], 2, 5", "output": "[10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "883_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032339", "code": "def div_of_nums(nums,m,n):\r\n result = list(filter(lambda x: (x % m == 0 and x % n == 0), nums)) \r\n return result", "entry_point": "div_of_nums", "input": "[10, 15, 14, 13, 18, 12, 20], 10, 5", "output": "[10, 20]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "883_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032340", "code": "def all_Bits_Set_In_The_Given_Range(n,l,r): \r\n    num = ((1 << r) - 1) ^ ((1 << (l - 1)) - 1) \r\n    new_num = n & num \r\n    if (num == new_num): \r\n        return True\r\n    return False", "entry_point": "all_Bits_Set_In_The_Given_Range", "input": "10, 2, 1", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "884_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032341", "code": "def all_Bits_Set_In_The_Given_Range(n,l,r): \r\n    num = ((1 << r) - 1) ^ ((1 << (l - 1)) - 1) \r\n    new_num = n & num \r\n    if (num == new_num): \r\n        return True\r\n    return False", "entry_point": "all_Bits_Set_In_The_Given_Range", "input": "5, 2, 4", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "884_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032342", "code": "def all_Bits_Set_In_The_Given_Range(n,l,r): \r\n    num = ((1 << r) - 1) ^ ((1 << (l - 1)) - 1) \r\n    new_num = n & num \r\n    if (num == new_num): \r\n        return True\r\n    return False", "entry_point": "all_Bits_Set_In_The_Given_Range", "input": "22, 2, 3", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "884_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032343", "code": "def is_Isomorphic(str1,str2):          \r\n    dict_str1 = {}\r\n    dict_str2 = {}\r\n    for i, value in enumerate(str1):\r\n        dict_str1[value] = dict_str1.get(value,[]) + [i]        \r\n    for j, value in enumerate(str2):\r\n        dict_str2[value] = dict_str2.get(value,[]) + [j]\r\n    if sorted(dict_str1.values()) == sorted(dict_str2.values()):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "is_Isomorphic", "input": "'paper', 'title'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "885_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032344", "code": "def is_Isomorphic(str1,str2):          \r\n    dict_str1 = {}\r\n    dict_str2 = {}\r\n    for i, value in enumerate(str1):\r\n        dict_str1[value] = dict_str1.get(value,[]) + [i]        \r\n    for j, value in enumerate(str2):\r\n        dict_str2[value] = dict_str2.get(value,[]) + [j]\r\n    if sorted(dict_str1.values()) == sorted(dict_str2.values()):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "is_Isomorphic", "input": "'ab', 'ba'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "885_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032345", "code": "def is_Isomorphic(str1,str2):          \r\n    dict_str1 = {}\r\n    dict_str2 = {}\r\n    for i, value in enumerate(str1):\r\n        dict_str1[value] = dict_str1.get(value,[]) + [i]        \r\n    for j, value in enumerate(str2):\r\n        dict_str2[value] = dict_str2.get(value,[]) + [j]\r\n    if sorted(dict_str1.values()) == sorted(dict_str2.values()):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "is_Isomorphic", "input": "'ab', 'aa'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "885_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032346", "code": "def sum_num(numbers):\r\n    total = 0\r\n    for x in numbers:\r\n        total += x\r\n    return total/len(numbers) ", "entry_point": "sum_num", "input": "(8, 2, 3, 0, 7)", "output": "4.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "886_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032347", "code": "def sum_num(numbers):\r\n    total = 0\r\n    for x in numbers:\r\n        total += x\r\n    return total/len(numbers) ", "entry_point": "sum_num", "input": "(-10, -20, -30)", "output": "-20.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "886_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032348", "code": "def sum_num(numbers):\r\n    total = 0\r\n    for x in numbers:\r\n        total += x\r\n    return total/len(numbers) ", "entry_point": "sum_num", "input": "(19, 15, 18)", "output": "17.333333333333332", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "886_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032349", "code": "def is_odd(n) : \r\n    if (n^1 == n-1) :\r\n        return True; \r\n    else :\r\n        return False; ", "entry_point": "is_odd", "input": "5", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "887_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032350", "code": "def is_odd(n) : \r\n    if (n^1 == n-1) :\r\n        return True; \r\n    else :\r\n        return False; ", "entry_point": "is_odd", "input": "6", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "887_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032351", "code": "def is_odd(n) : \r\n    if (n^1 == n-1) :\r\n        return True; \r\n    else :\r\n        return False; ", "entry_point": "is_odd", "input": "7", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "887_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032352", "code": "def substract_elements(test_tup1, test_tup2):\r\n  res = tuple(tuple(a - b for a, b in zip(tup1, tup2))\r\n   for tup1, tup2 in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "substract_elements", "input": "((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))", "output": "((-5, -4), (1, -4), (1, 8), (-6, 7))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "888_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032353", "code": "def substract_elements(test_tup1, test_tup2):\r\n  res = tuple(tuple(a - b for a, b in zip(tup1, tup2))\r\n   for tup1, tup2 in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "substract_elements", "input": "((13, 4), (14, 6), (13, 10), (12, 11)), ((19, 8), (14, 10), (12, 2), (18, 4))", "output": "((-6, -4), (0, -4), (1, 8), (-6, 7))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "888_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032354", "code": "def substract_elements(test_tup1, test_tup2):\r\n  res = tuple(tuple(a - b for a, b in zip(tup1, tup2))\r\n   for tup1, tup2 in zip(test_tup1, test_tup2))\r\n  return (res) ", "entry_point": "substract_elements", "input": "((19, 5), (18, 7), (19, 11), (17, 12)), ((12, 9), (17, 11), (13, 3), (19, 5))", "output": "((7, -4), (1, -4), (6, 8), (-2, 7))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "888_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032355", "code": "def reverse_list_lists(lists):\r\n    for l in lists:\r\n        l.sort(reverse = True)\r\n    return lists ", "entry_point": "reverse_list_lists", "input": "[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]", "output": "[[4, 3, 2, 1], [8, 7, 6, 5], [12, 11, 10, 9], [16, 15, 14, 13]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "889_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032356", "code": "def reverse_list_lists(lists):\r\n    for l in lists:\r\n        l.sort(reverse = True)\r\n    return lists ", "entry_point": "reverse_list_lists", "input": "[[1, 2], [2, 3], [3, 4]]", "output": "[[2, 1], [3, 2], [4, 3]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "889_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032357", "code": "def reverse_list_lists(lists):\r\n    for l in lists:\r\n        l.sort(reverse = True)\r\n    return lists ", "entry_point": "reverse_list_lists", "input": "[[10, 20], [30, 40]]", "output": "[[20, 10], [40, 30]]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "889_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032358", "code": "def find_Extra(arr1,arr2,n) : \r\n    for i in range(0, n) : \r\n        if (arr1[i] != arr2[i]) : \r\n            return i \r\n    return n ", "entry_point": "find_Extra", "input": "[1, 2, 3, 4], [1, 2, 3], 3", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "890_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032359", "code": "def find_Extra(arr1,arr2,n) : \r\n    for i in range(0, n) : \r\n        if (arr1[i] != arr2[i]) : \r\n            return i \r\n    return n ", "entry_point": "find_Extra", "input": "[2, 4, 6, 8, 10], [2, 4, 6, 8], 4", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "890_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032360", "code": "def find_Extra(arr1,arr2,n) : \r\n    for i in range(0, n) : \r\n        if (arr1[i] != arr2[i]) : \r\n            return i \r\n    return n ", "entry_point": "find_Extra", "input": "[1, 3, 5, 7, 9, 11], [1, 3, 5, 7, 9], 5", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "890_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032361", "code": "def same_Length(A,B): \r\n    while (A > 0 and B > 0): \r\n        A = A / 10; \r\n        B = B / 10; \r\n    if (A == 0 and B == 0): \r\n        return True; \r\n    return False; ", "entry_point": "same_Length", "input": "12, 1", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "891_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032362", "code": "def same_Length(A,B): \r\n    while (A > 0 and B > 0): \r\n        A = A / 10; \r\n        B = B / 10; \r\n    if (A == 0 and B == 0): \r\n        return True; \r\n    return False; ", "entry_point": "same_Length", "input": "2, 2", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "891_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032363", "code": "def same_Length(A,B): \r\n    while (A > 0 and B > 0): \r\n        A = A / 10; \r\n        B = B / 10; \r\n    if (A == 0 and B == 0): \r\n        return True; \r\n    return False; ", "entry_point": "same_Length", "input": "10, 20", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "891_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032364", "code": "import re\r\ndef remove_spaces(text):\r\n return (re.sub(' +',' ',text))", "entry_point": "remove_spaces", "input": "'python  program'", "output": "'python program'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "892_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032365", "code": "import re\r\ndef remove_spaces(text):\r\n return (re.sub(' +',' ',text))", "entry_point": "remove_spaces", "input": "'python   programming    language'", "output": "'python programming language'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "892_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032366", "code": "import re\r\ndef remove_spaces(text):\r\n return (re.sub(' +',' ',text))", "entry_point": "remove_spaces", "input": "'python                     program'", "output": "'python program'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "892_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032367", "code": "def Extract(lst): \r\n    return [item[-1] for item in lst] ", "entry_point": "Extract", "input": "[[1, 2, 3], [4, 5], [6, 7, 8, 9]]", "output": "[3, 5, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "893_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032368", "code": "def Extract(lst): \r\n    return [item[-1] for item in lst] ", "entry_point": "Extract", "input": "[['x', 'y', 'z'], ['m'], ['a', 'b'], ['u', 'v']]", "output": "['z', 'm', 'b', 'v']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "893_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032369", "code": "def Extract(lst): \r\n    return [item[-1] for item in lst] ", "entry_point": "Extract", "input": "[[1, 2, 3], [4, 5]]", "output": "[3, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "893_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032370", "code": "def float_to_tuple(test_str):\r\n  res = tuple(map(float, test_str.split(', ')))\r\n  return (res) ", "entry_point": "float_to_tuple", "input": "'1.2, 1.3, 2.3, 2.4, 6.5'", "output": "(1.2, 1.3, 2.3, 2.4, 6.5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "894_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032371", "code": "def float_to_tuple(test_str):\r\n  res = tuple(map(float, test_str.split(', ')))\r\n  return (res) ", "entry_point": "float_to_tuple", "input": "'2.3, 2.4, 5.6, 5.4, 8.9'", "output": "(2.3, 2.4, 5.6, 5.4, 8.9)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "894_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032372", "code": "def float_to_tuple(test_str):\r\n  res = tuple(map(float, test_str.split(', ')))\r\n  return (res) ", "entry_point": "float_to_tuple", "input": "'0.3, 0.5, 7.8, 9.4'", "output": "(0.3, 0.5, 7.8, 9.4)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "894_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032373", "code": "def max_sum_subseq(A):\r\n    n = len(A)\r\n    if n == 1:\r\n        return A[0]\r\n    look_up = [None] * n\r\n    look_up[0] = A[0]\r\n    look_up[1] = max(A[0], A[1])\r\n    for i in range(2, n):\r\n        look_up[i] = max(look_up[i - 1], look_up[i - 2] + A[i])\r\n        look_up[i] = max(look_up[i], A[i])\r\n    return look_up[n - 1]", "entry_point": "max_sum_subseq", "input": "[1, 2, 9, 4, 5, 0, 4, 11, 6]", "output": "26", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "895_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032374", "code": "def max_sum_subseq(A):\r\n    n = len(A)\r\n    if n == 1:\r\n        return A[0]\r\n    look_up = [None] * n\r\n    look_up[0] = A[0]\r\n    look_up[1] = max(A[0], A[1])\r\n    for i in range(2, n):\r\n        look_up[i] = max(look_up[i - 1], look_up[i - 2] + A[i])\r\n        look_up[i] = max(look_up[i], A[i])\r\n    return look_up[n - 1]", "entry_point": "max_sum_subseq", "input": "[1, 2, 9, 5, 6, 0, 5, 12, 7]", "output": "28", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "895_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032375", "code": "def max_sum_subseq(A):\r\n    n = len(A)\r\n    if n == 1:\r\n        return A[0]\r\n    look_up = [None] * n\r\n    look_up[0] = A[0]\r\n    look_up[1] = max(A[0], A[1])\r\n    for i in range(2, n):\r\n        look_up[i] = max(look_up[i - 1], look_up[i - 2] + A[i])\r\n        look_up[i] = max(look_up[i], A[i])\r\n    return look_up[n - 1]", "entry_point": "max_sum_subseq", "input": "[1, 3, 10, 5, 6, 0, 6, 14, 21]", "output": "44", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "895_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032376", "code": "def last(n):\r\n   return n[-1]\r\ndef sort_list_last(tuples):\r\n  return sorted(tuples, key=last)", "entry_point": "sort_list_last", "input": "[(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)]", "output": "[(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "896_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032377", "code": "def last(n):\r\n   return n[-1]\r\ndef sort_list_last(tuples):\r\n  return sorted(tuples, key=last)", "entry_point": "sort_list_last", "input": "[(9, 8), (4, 7), (3, 5), (7, 9), (1, 2)]", "output": "[(1, 2), (3, 5), (4, 7), (9, 8), (7, 9)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "896_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032378", "code": "def last(n):\r\n   return n[-1]\r\ndef sort_list_last(tuples):\r\n  return sorted(tuples, key=last)", "entry_point": "sort_list_last", "input": "[(20, 50), (10, 20), (40, 40)]", "output": "[(10, 20), (40, 40), (20, 50)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "896_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032379", "code": "def is_Word_Present(sentence,word): \r\n    s = sentence.split(\" \") \r\n    for i in s:  \r\n        if (i == word): \r\n            return True\r\n    return False", "entry_point": "is_Word_Present", "input": "'machine learning', 'machine'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "897_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032380", "code": "def is_Word_Present(sentence,word): \r\n    s = sentence.split(\" \") \r\n    for i in s:  \r\n        if (i == word): \r\n            return True\r\n    return False", "entry_point": "is_Word_Present", "input": "'easy', 'fun'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "897_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032381", "code": "def is_Word_Present(sentence,word): \r\n    s = sentence.split(\" \") \r\n    for i in s:  \r\n        if (i == word): \r\n            return True\r\n    return False", "entry_point": "is_Word_Present", "input": "'python language', 'code'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "897_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032382", "code": "from itertools import groupby \r\ndef extract_elements(numbers, n):\r\n    result = [i for i, j in groupby(numbers) if len(list(j)) == n] \r\n    return result", "entry_point": "extract_elements", "input": "[1, 1, 3, 4, 4, 5, 6, 7], 2", "output": "[1, 4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "898_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032383", "code": "from itertools import groupby \r\ndef extract_elements(numbers, n):\r\n    result = [i for i, j in groupby(numbers) if len(list(j)) == n] \r\n    return result", "entry_point": "extract_elements", "input": "[0, 1, 2, 3, 4, 4, 4, 4, 5, 7], 4", "output": "[4]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "898_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032384", "code": "from itertools import groupby \r\ndef extract_elements(numbers, n):\r\n    result = [i for i, j in groupby(numbers) if len(list(j)) == n] \r\n    return result", "entry_point": "extract_elements", "input": "[0, 0, 0, 0, 0], 5", "output": "[0]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "898_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032385", "code": "def check(arr,n): \r\n    g = 0 \r\n    for i in range(1,n): \r\n        if (arr[i] - arr[i - 1] > 0 and g == 1): \r\n            return False\r\n        if (arr[i] - arr[i] < 0): \r\n            g = 1\r\n    return True", "entry_point": "check", "input": "[3, 2, 1, 2, 3, 4], 6", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "899_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032386", "code": "def check(arr,n): \r\n    g = 0 \r\n    for i in range(1,n): \r\n        if (arr[i] - arr[i - 1] > 0 and g == 1): \r\n            return False\r\n        if (arr[i] - arr[i] < 0): \r\n            g = 1\r\n    return True", "entry_point": "check", "input": "[2, 1, 4, 5, 1], 5", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "899_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032387", "code": "def check(arr,n): \r\n    g = 0 \r\n    for i in range(1,n): \r\n        if (arr[i] - arr[i - 1] > 0 and g == 1): \r\n            return False\r\n        if (arr[i] - arr[i] < 0): \r\n            g = 1\r\n    return True", "entry_point": "check", "input": "[1, 2, 2, 1, 2, 3], 6", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "899_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032388", "code": "import re\r\ndef match_num(string):\r\n    text = re.compile(r\"^5\")\r\n    if text.match(string):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "match_num", "input": "'5-2345861'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "900_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032389", "code": "import re\r\ndef match_num(string):\r\n    text = re.compile(r\"^5\")\r\n    if text.match(string):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "match_num", "input": "'6-2345861'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "900_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032390", "code": "import re\r\ndef match_num(string):\r\n    text = re.compile(r\"^5\")\r\n    if text.match(string):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "match_num", "input": "'78910'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "900_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032391", "code": "def smallest_multiple(n):\r\n    if (n<=2):\r\n      return n\r\n    i = n * 2\r\n    factors = [number  for number in range(n, 1, -1) if number * 2 > n]\r\n    while True:\r\n        for a in factors:\r\n            if i % a != 0:\r\n                i += n\r\n                break\r\n            if (a == factors[-1] and i % a == 0):\r\n                return i", "entry_point": "smallest_multiple", "input": "13", "output": "360360", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "901_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032392", "code": "def smallest_multiple(n):\r\n    if (n<=2):\r\n      return n\r\n    i = n * 2\r\n    factors = [number  for number in range(n, 1, -1) if number * 2 > n]\r\n    while True:\r\n        for a in factors:\r\n            if i % a != 0:\r\n                i += n\r\n                break\r\n            if (a == factors[-1] and i % a == 0):\r\n                return i", "entry_point": "smallest_multiple", "input": "2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "901_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032393", "code": "def smallest_multiple(n):\r\n    if (n<=2):\r\n      return n\r\n    i = n * 2\r\n    factors = [number  for number in range(n, 1, -1) if number * 2 > n]\r\n    while True:\r\n        for a in factors:\r\n            if i % a != 0:\r\n                i += n\r\n                break\r\n            if (a == factors[-1] and i % a == 0):\r\n                return i", "entry_point": "smallest_multiple", "input": "1", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "901_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032394", "code": "def count_Unset_Bits(n) :  \r\n    cnt = 0;  \r\n    for i in range(1,n + 1) : \r\n        temp = i;  \r\n        while (temp) :  \r\n            if (temp % 2 == 0) : \r\n                cnt += 1;  \r\n            temp = temp // 2;  \r\n    return cnt;  ", "entry_point": "count_Unset_Bits", "input": "2", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "903_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032395", "code": "def count_Unset_Bits(n) :  \r\n    cnt = 0;  \r\n    for i in range(1,n + 1) : \r\n        temp = i;  \r\n        while (temp) :  \r\n            if (temp % 2 == 0) : \r\n                cnt += 1;  \r\n            temp = temp // 2;  \r\n    return cnt;  ", "entry_point": "count_Unset_Bits", "input": "5", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "903_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032396", "code": "def count_Unset_Bits(n) :  \r\n    cnt = 0;  \r\n    for i in range(1,n + 1) : \r\n        temp = i;  \r\n        while (temp) :  \r\n            if (temp % 2 == 0) : \r\n                cnt += 1;  \r\n            temp = temp // 2;  \r\n    return cnt;  ", "entry_point": "count_Unset_Bits", "input": "14", "output": "17", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "903_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032397", "code": "def even_num(x):\r\n  if x%2==0:\r\n     return True\r\n  else:\r\n    return False", "entry_point": "even_num", "input": "13.5", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "904_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032398", "code": "def even_num(x):\r\n  if x%2==0:\r\n     return True\r\n  else:\r\n    return False", "entry_point": "even_num", "input": "0", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "904_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032399", "code": "def even_num(x):\r\n  if x%2==0:\r\n     return True\r\n  else:\r\n    return False", "entry_point": "even_num", "input": "-9", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "904_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032400", "code": "def factorial(start,end): \r\n    res = 1 \r\n    for i in range(start,end + 1): \r\n        res *= i      \r\n    return res \r\ndef sum_of_square(n): \r\n   return int(factorial(n + 1, 2 * n)  /factorial(1, n)) ", "entry_point": "sum_of_square", "input": "4", "output": "70", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "905_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032401", "code": "def factorial(start,end): \r\n    res = 1 \r\n    for i in range(start,end + 1): \r\n        res *= i      \r\n    return res \r\ndef sum_of_square(n): \r\n   return int(factorial(n + 1, 2 * n)  /factorial(1, n)) ", "entry_point": "sum_of_square", "input": "5", "output": "252", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "905_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032402", "code": "def factorial(start,end): \r\n    res = 1 \r\n    for i in range(start,end + 1): \r\n        res *= i      \r\n    return res \r\ndef sum_of_square(n): \r\n   return int(factorial(n + 1, 2 * n)  /factorial(1, n)) ", "entry_point": "sum_of_square", "input": "2", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "905_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032403", "code": "import re\r\ndef extract_date(url):\r\n        return re.findall(r'/(\\d{4})/(\\d{1,2})/(\\d{1,2})/', url)", "entry_point": "extract_date", "input": "'https://www.washingtonpost.com/news/football-insider/wp/2016/09/02/odell-beckhams-fame-rests-on-one-stupid-little-ball-josh-norman-tells-author/'", "output": "[('2016', '09', '02')]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "906_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032404", "code": "import re\r\ndef extract_date(url):\r\n        return re.findall(r'/(\\d{4})/(\\d{1,2})/(\\d{1,2})/', url)", "entry_point": "extract_date", "input": "'https://www.indiatoday.in/movies/celebrities/story/wp/2020/11/03/odeof-sushant-singh-rajput-s-death-his-brother-in-law-shares-advice-for-fans-1749646/'", "output": "[('2020', '11', '03')]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "906_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032405", "code": "import re\r\ndef extract_date(url):\r\n        return re.findall(r'/(\\d{4})/(\\d{1,2})/(\\d{1,2})/', url)", "entry_point": "extract_date", "input": "'https://economictimes.indiatimes.com/news/economy/2020/12/29/finance/pension-assets-under-pfrda-touch-rs-5-32-lakh-crore/articleshow/79736619.cms'", "output": "[('2020', '12', '29')]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "906_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032406", "code": "def lucky_num(n):\r\n List=range(-1,n*n+9,2)\r\n i=2\r\n while List[i:]:List=sorted(set(List)-set(List[List[i]::List[i]]));i+=1\r\n return List[1:n+1]", "entry_point": "lucky_num", "input": "10", "output": "[1, 3, 7, 9, 13, 15, 21, 25, 31, 33]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "907_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032407", "code": "def lucky_num(n):\r\n List=range(-1,n*n+9,2)\r\n i=2\r\n while List[i:]:List=sorted(set(List)-set(List[List[i]::List[i]]));i+=1\r\n return List[1:n+1]", "entry_point": "lucky_num", "input": "5", "output": "[1, 3, 7, 9, 13]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "907_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032408", "code": "def lucky_num(n):\r\n List=range(-1,n*n+9,2)\r\n i=2\r\n while List[i:]:List=sorted(set(List)-set(List[List[i]::List[i]]));i+=1\r\n return List[1:n+1]", "entry_point": "lucky_num", "input": "8", "output": "[1, 3, 7, 9, 13, 15, 21, 25]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "907_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032409", "code": "def find_fixed_point(arr, n): \r\n\tfor i in range(n): \r\n\t\tif arr[i] is i: \r\n\t\t\treturn i \r\n\treturn -1", "entry_point": "find_fixed_point", "input": "[-10, -1, 0, 3, 10, 11, 30, 50, 100], 9", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "908_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032410", "code": "def find_fixed_point(arr, n): \r\n\tfor i in range(n): \r\n\t\tif arr[i] is i: \r\n\t\t\treturn i \r\n\treturn -1", "entry_point": "find_fixed_point", "input": "[1, 2, 3, 4, 5, 6, 7, 8], 8", "output": "-1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "908_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032411", "code": "def find_fixed_point(arr, n): \r\n\tfor i in range(n): \r\n\t\tif arr[i] is i: \r\n\t\t\treturn i \r\n\treturn -1", "entry_point": "find_fixed_point", "input": "[0, 2, 5, 8, 17], 5", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "908_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032412", "code": "def previous_palindrome(num):\r\n    for x in range(num-1,0,-1):\r\n        if str(x) == str(x)[::-1]:\r\n            return x", "entry_point": "previous_palindrome", "input": "99", "output": "88", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "909_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032413", "code": "def previous_palindrome(num):\r\n    for x in range(num-1,0,-1):\r\n        if str(x) == str(x)[::-1]:\r\n            return x", "entry_point": "previous_palindrome", "input": "1221", "output": "1111", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "909_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032414", "code": "def previous_palindrome(num):\r\n    for x in range(num-1,0,-1):\r\n        if str(x) == str(x)[::-1]:\r\n            return x", "entry_point": "previous_palindrome", "input": "120", "output": "111", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "909_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032415", "code": "import datetime\r\ndef check_date(m, d, y):\r\n    try:\r\n        m, d, y = map(int, (m, d, y))\r\n        datetime.date(y, m, d)\r\n        return True\r\n    except ValueError:\r\n        return False", "entry_point": "check_date", "input": "11, 11, 2002", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "910_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032416", "code": "import datetime\r\ndef check_date(m, d, y):\r\n    try:\r\n        m, d, y = map(int, (m, d, y))\r\n        datetime.date(y, m, d)\r\n        return True\r\n    except ValueError:\r\n        return False", "entry_point": "check_date", "input": "13, 11, 2002", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "910_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032417", "code": "import datetime\r\ndef check_date(m, d, y):\r\n    try:\r\n        m, d, y = map(int, (m, d, y))\r\n        datetime.date(y, m, d)\r\n        return True\r\n    except ValueError:\r\n        return False", "entry_point": "check_date", "input": "'11', '11', '2002'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "910_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032418", "code": "def maximum_product(nums):\r\n    import heapq\r\n    a, b = heapq.nlargest(3, nums), heapq.nsmallest(2, nums)\r\n    return max(a[0] * a[1] * a[2], a[0] * b[0] * b[1])", "entry_point": "maximum_product", "input": "[12, 74, 9, 50, 61, 41]", "output": "225700", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "911_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032419", "code": "def maximum_product(nums):\r\n    import heapq\r\n    a, b = heapq.nlargest(3, nums), heapq.nsmallest(2, nums)\r\n    return max(a[0] * a[1] * a[2], a[0] * b[0] * b[1])", "entry_point": "maximum_product", "input": "[25, 35, 22, 85, 14, 65, 75, 25, 58]", "output": "414375", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "911_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032420", "code": "def maximum_product(nums):\r\n    import heapq\r\n    a, b = heapq.nlargest(3, nums), heapq.nsmallest(2, nums)\r\n    return max(a[0] * a[1] * a[2], a[0] * b[0] * b[1])", "entry_point": "maximum_product", "input": "[18, 14, 10, 9, 8, 7, 9, 3, 2, 4, 1]", "output": "2520", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "911_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032421", "code": "def binomial_coeff(n, k): \r\n\tC = [[0 for j in range(k + 1)] \r\n\t\t\tfor i in range(n + 1)] \r\n\tfor i in range(0, n + 1): \r\n\t\tfor j in range(0, min(i, k) + 1): \r\n\t\t\tif (j == 0 or j == i): \r\n\t\t\t\tC[i][j] = 1\r\n\t\t\telse: \r\n\t\t\t\tC[i][j] = (C[i - 1][j - 1] \r\n\t\t\t\t\t\t\t+ C[i - 1][j]) \r\n\treturn C[n][k] \r\ndef lobb_num(n, m): \r\n\treturn (((2 * m + 1) *\r\n\t\tbinomial_coeff(2 * n, m + n)) \r\n\t\t\t\t\t/ (m + n + 1))", "entry_point": "lobb_num", "input": "5, 3", "output": "35.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "912_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032422", "code": "def binomial_coeff(n, k): \r\n\tC = [[0 for j in range(k + 1)] \r\n\t\t\tfor i in range(n + 1)] \r\n\tfor i in range(0, n + 1): \r\n\t\tfor j in range(0, min(i, k) + 1): \r\n\t\t\tif (j == 0 or j == i): \r\n\t\t\t\tC[i][j] = 1\r\n\t\t\telse: \r\n\t\t\t\tC[i][j] = (C[i - 1][j - 1] \r\n\t\t\t\t\t\t\t+ C[i - 1][j]) \r\n\treturn C[n][k] \r\ndef lobb_num(n, m): \r\n\treturn (((2 * m + 1) *\r\n\t\tbinomial_coeff(2 * n, m + n)) \r\n\t\t\t\t\t/ (m + n + 1))", "entry_point": "lobb_num", "input": "3, 2", "output": "5.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "912_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032423", "code": "def binomial_coeff(n, k): \r\n\tC = [[0 for j in range(k + 1)] \r\n\t\t\tfor i in range(n + 1)] \r\n\tfor i in range(0, n + 1): \r\n\t\tfor j in range(0, min(i, k) + 1): \r\n\t\t\tif (j == 0 or j == i): \r\n\t\t\t\tC[i][j] = 1\r\n\t\t\telse: \r\n\t\t\t\tC[i][j] = (C[i - 1][j - 1] \r\n\t\t\t\t\t\t\t+ C[i - 1][j]) \r\n\treturn C[n][k] \r\ndef lobb_num(n, m): \r\n\treturn (((2 * m + 1) *\r\n\t\tbinomial_coeff(2 * n, m + n)) \r\n\t\t\t\t\t/ (m + n + 1))", "entry_point": "lobb_num", "input": "4, 2", "output": "20.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "912_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032424", "code": "import re\r\ndef end_num(string):\r\n    text = re.compile(r\".*[0-9]$\")\r\n    if text.match(string):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "end_num", "input": "'abcdef'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "913_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032425", "code": "import re\r\ndef end_num(string):\r\n    text = re.compile(r\".*[0-9]$\")\r\n    if text.match(string):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "end_num", "input": "'abcdef7'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "913_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032426", "code": "import re\r\ndef end_num(string):\r\n    text = re.compile(r\".*[0-9]$\")\r\n    if text.match(string):\r\n        return True\r\n    else:\r\n        return False", "entry_point": "end_num", "input": "'abc'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "913_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032427", "code": "def is_Two_Alter(s):  \r\n    for i in range (len( s) - 2) : \r\n        if (s[i] != s[i + 2]) : \r\n            return False\r\n    if (s[0] == s[1]): \r\n        return False\r\n    return True", "entry_point": "is_Two_Alter", "input": "'abab'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "914_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032428", "code": "def is_Two_Alter(s):  \r\n    for i in range (len( s) - 2) : \r\n        if (s[i] != s[i + 2]) : \r\n            return False\r\n    if (s[0] == s[1]): \r\n        return False\r\n    return True", "entry_point": "is_Two_Alter", "input": "'aaaa'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "914_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032429", "code": "def is_Two_Alter(s):  \r\n    for i in range (len( s) - 2) : \r\n        if (s[i] != s[i + 2]) : \r\n            return False\r\n    if (s[0] == s[1]): \r\n        return False\r\n    return True", "entry_point": "is_Two_Alter", "input": "'xyz'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "914_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032430", "code": "def rearrange_numbs(array_nums):\r\n  result = sorted(array_nums, key = lambda i: 0 if i == 0 else -1 / i)\r\n  return result ", "entry_point": "rearrange_numbs", "input": "[-1, 2, -3, 5, 7, 8, 9, -10]", "output": "[2, 5, 7, 8, 9, -10, -3, -1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "915_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032431", "code": "def rearrange_numbs(array_nums):\r\n  result = sorted(array_nums, key = lambda i: 0 if i == 0 else -1 / i)\r\n  return result ", "entry_point": "rearrange_numbs", "input": "[10, 15, 14, 13, -18, 12, -20]", "output": "[10, 12, 13, 14, 15, -20, -18]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "915_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032432", "code": "def rearrange_numbs(array_nums):\r\n  result = sorted(array_nums, key = lambda i: 0 if i == 0 else -1 / i)\r\n  return result ", "entry_point": "rearrange_numbs", "input": "[-20, 20, -10, 10, -30, 30]", "output": "[10, 20, 30, -30, -20, -10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "915_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032433", "code": "def find_triplet_array(A, arr_size, sum): \r\n\tfor i in range( 0, arr_size-2): \r\n\t\tfor j in range(i + 1, arr_size-1): \r\n\t\t\tfor k in range(j + 1, arr_size): \r\n\t\t\t\tif A[i] + A[j] + A[k] == sum: \r\n\t\t\t\t\treturn  A[i],A[j],A[k] \r\n\t\t\t\t\treturn True\r\n\treturn False", "entry_point": "find_triplet_array", "input": "[1, 4, 45, 6, 10, 8], 6, 22", "output": "(4, 10, 8)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "916_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032434", "code": "def find_triplet_array(A, arr_size, sum): \r\n\tfor i in range( 0, arr_size-2): \r\n\t\tfor j in range(i + 1, arr_size-1): \r\n\t\t\tfor k in range(j + 1, arr_size): \r\n\t\t\t\tif A[i] + A[j] + A[k] == sum: \r\n\t\t\t\t\treturn  A[i],A[j],A[k] \r\n\t\t\t\t\treturn True\r\n\treturn False", "entry_point": "find_triplet_array", "input": "[12, 3, 5, 2, 6, 9], 6, 24", "output": "(12, 3, 9)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "916_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032435", "code": "def find_triplet_array(A, arr_size, sum): \r\n\tfor i in range( 0, arr_size-2): \r\n\t\tfor j in range(i + 1, arr_size-1): \r\n\t\t\tfor k in range(j + 1, arr_size): \r\n\t\t\t\tif A[i] + A[j] + A[k] == sum: \r\n\t\t\t\t\treturn  A[i],A[j],A[k] \r\n\t\t\t\t\treturn True\r\n\treturn False", "entry_point": "find_triplet_array", "input": "[1, 2, 3, 4, 5], 5, 9", "output": "(1, 3, 5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "916_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032436", "code": "import re\r\ndef text_uppercase_lowercase(text):\r\n        patterns = '[A-Z]+[a-z]+$'\r\n        if re.search(patterns, text):\r\n                return 'Found a match!'\r\n        else:\r\n                return ('Not matched!')", "entry_point": "text_uppercase_lowercase", "input": "'AaBbGg'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "917_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032437", "code": "import re\r\ndef text_uppercase_lowercase(text):\r\n        patterns = '[A-Z]+[a-z]+$'\r\n        if re.search(patterns, text):\r\n                return 'Found a match!'\r\n        else:\r\n                return ('Not matched!')", "entry_point": "text_uppercase_lowercase", "input": "'aA'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "917_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032438", "code": "import re\r\ndef text_uppercase_lowercase(text):\r\n        patterns = '[A-Z]+[a-z]+$'\r\n        if re.search(patterns, text):\r\n                return 'Found a match!'\r\n        else:\r\n                return ('Not matched!')", "entry_point": "text_uppercase_lowercase", "input": "'PYTHON'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "917_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032439", "code": "def coin_change(S, m, n): \r\n    table = [[0 for x in range(m)] for x in range(n+1)] \r\n    for i in range(m): \r\n        table[0][i] = 1\r\n    for i in range(1, n+1): \r\n        for j in range(m): \r\n            x = table[i - S[j]][j] if i-S[j] >= 0 else 0\r\n            y = table[i][j-1] if j >= 1 else 0 \r\n            table[i][j] = x + y   \r\n    return table[n][m-1] ", "entry_point": "coin_change", "input": "[1, 2, 3], 3, 4", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "918_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032440", "code": "def coin_change(S, m, n): \r\n    table = [[0 for x in range(m)] for x in range(n+1)] \r\n    for i in range(m): \r\n        table[0][i] = 1\r\n    for i in range(1, n+1): \r\n        for j in range(m): \r\n            x = table[i - S[j]][j] if i-S[j] >= 0 else 0\r\n            y = table[i][j-1] if j >= 1 else 0 \r\n            table[i][j] = x + y   \r\n    return table[n][m-1] ", "entry_point": "coin_change", "input": "[4, 5, 6, 7, 8, 9], 6, 9", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "918_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032441", "code": "def coin_change(S, m, n): \r\n    table = [[0 for x in range(m)] for x in range(n+1)] \r\n    for i in range(m): \r\n        table[0][i] = 1\r\n    for i in range(1, n+1): \r\n        for j in range(m): \r\n            x = table[i - S[j]][j] if i-S[j] >= 0 else 0\r\n            y = table[i][j-1] if j >= 1 else 0 \r\n            table[i][j] = x + y   \r\n    return table[n][m-1] ", "entry_point": "coin_change", "input": "[4, 5, 6, 7, 8, 9], 6, 4", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "918_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032442", "code": "def multiply_list(items):\r\n    tot = 1\r\n    for x in items:\r\n        tot *= x\r\n    return tot", "entry_point": "multiply_list", "input": "[1, -2, 3]", "output": "-6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "919_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032443", "code": "def multiply_list(items):\r\n    tot = 1\r\n    for x in items:\r\n        tot *= x\r\n    return tot", "entry_point": "multiply_list", "input": "[1, 2, 3, 4]", "output": "24", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "919_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032444", "code": "def multiply_list(items):\r\n    tot = 1\r\n    for x in items:\r\n        tot *= x\r\n    return tot", "entry_point": "multiply_list", "input": "[3, 1, 2, 3]", "output": "18", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "919_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032445", "code": "def remove_tuple(test_list):\r\n  res = [sub for sub in test_list if not all(ele == None for ele in sub)]\r\n  return (str(res)) ", "entry_point": "remove_tuple", "input": "[(None, 2), (None, None), (3, 4), (12, 3), (None,)]", "output": "'[(None, 2), (3, 4), (12, 3)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "920_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032446", "code": "def remove_tuple(test_list):\r\n  res = [sub for sub in test_list if not all(ele == None for ele in sub)]\r\n  return (str(res)) ", "entry_point": "remove_tuple", "input": "[(None, None), (None, None), (3, 6), (17, 3), (None, 1)]", "output": "'[(3, 6), (17, 3), (None, 1)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "920_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032447", "code": "def remove_tuple(test_list):\r\n  res = [sub for sub in test_list if not all(ele == None for ele in sub)]\r\n  return (str(res)) ", "entry_point": "remove_tuple", "input": "[(1, 2), (2, None), (3, None), (24, 3), (None, None)]", "output": "'[(1, 2), (2, None), (3, None), (24, 3)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "920_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032448", "code": "def chunk_tuples(test_tup, N):\r\n  res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]\r\n  return (res) ", "entry_point": "chunk_tuples", "input": "(10, 4, 5, 6, 7, 6, 8, 3, 4), 3", "output": "[(10, 4, 5), (6, 7, 6), (8, 3, 4)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "921_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032449", "code": "def chunk_tuples(test_tup, N):\r\n  res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]\r\n  return (res) ", "entry_point": "chunk_tuples", "input": "(1, 2, 3, 4, 5, 6, 7, 8, 9), 2", "output": "[(1, 2), (3, 4), (5, 6), (7, 8), (9,)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "921_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032450", "code": "def chunk_tuples(test_tup, N):\r\n  res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]\r\n  return (res) ", "entry_point": "chunk_tuples", "input": "(11, 14, 16, 17, 19, 21, 22, 25), 4", "output": "[(11, 14, 16, 17), (19, 21, 22, 25)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "921_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032451", "code": "def max_product(arr): \r\n    arr_len = len(arr) \r\n    if (arr_len < 2): \r\n        return None     \r\n    x = arr[0]; y = arr[1]    \r\n    for i in range(0, arr_len): \r\n        for j in range(i + 1, arr_len): \r\n            if (arr[i] * arr[j] > x * y): \r\n                x = arr[i]; y = arr[j] \r\n    return x,y   ", "entry_point": "max_product", "input": "[1, 2, 3, 4, 7, 0, 8, 4]", "output": "(7, 8)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "922_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032452", "code": "def max_product(arr): \r\n    arr_len = len(arr) \r\n    if (arr_len < 2): \r\n        return None     \r\n    x = arr[0]; y = arr[1]    \r\n    for i in range(0, arr_len): \r\n        for j in range(i + 1, arr_len): \r\n            if (arr[i] * arr[j] > x * y): \r\n                x = arr[i]; y = arr[j] \r\n    return x,y   ", "entry_point": "max_product", "input": "[0, -1, -2, -4, 5, 0, -6]", "output": "(-4, -6)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "922_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032453", "code": "def max_product(arr): \r\n    arr_len = len(arr) \r\n    if (arr_len < 2): \r\n        return None     \r\n    x = arr[0]; y = arr[1]    \r\n    for i in range(0, arr_len): \r\n        for j in range(i + 1, arr_len): \r\n            if (arr[i] * arr[j] > x * y): \r\n                x = arr[i]; y = arr[j] \r\n    return x,y   ", "entry_point": "max_product", "input": "[1, 3, 5, 6, 8, 9]", "output": "(8, 9)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "922_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032454", "code": "def super_seq(X, Y, m, n):\r\n\tif (not m):\r\n\t\treturn n\r\n\tif (not n):\r\n\t\treturn m\r\n\tif (X[m - 1] == Y[n - 1]):\r\n\t\treturn 1 + super_seq(X, Y, m - 1, n - 1)\r\n\treturn 1 + min(super_seq(X, Y, m - 1, n),\tsuper_seq(X, Y, m, n - 1))", "entry_point": "super_seq", "input": "'AGGTAB', 'GXTXAYB', 6, 7", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "923_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032455", "code": "def super_seq(X, Y, m, n):\r\n\tif (not m):\r\n\t\treturn n\r\n\tif (not n):\r\n\t\treturn m\r\n\tif (X[m - 1] == Y[n - 1]):\r\n\t\treturn 1 + super_seq(X, Y, m - 1, n - 1)\r\n\treturn 1 + min(super_seq(X, Y, m - 1, n),\tsuper_seq(X, Y, m, n - 1))", "entry_point": "super_seq", "input": "'feek', 'eke', 4, 3", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "923_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032456", "code": "def super_seq(X, Y, m, n):\r\n\tif (not m):\r\n\t\treturn n\r\n\tif (not n):\r\n\t\treturn m\r\n\tif (X[m - 1] == Y[n - 1]):\r\n\t\treturn 1 + super_seq(X, Y, m - 1, n - 1)\r\n\treturn 1 + min(super_seq(X, Y, m - 1, n),\tsuper_seq(X, Y, m, n - 1))", "entry_point": "super_seq", "input": "'PARRT', 'RTA', 5, 3", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "923_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032457", "code": "def max_of_two( x, y ):\r\n    if x > y:\r\n        return x\r\n    return y", "entry_point": "max_of_two", "input": "10, 20", "output": "20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "924_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032458", "code": "def max_of_two( x, y ):\r\n    if x > y:\r\n        return x\r\n    return y", "entry_point": "max_of_two", "input": "19, 15", "output": "19", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "924_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032459", "code": "def max_of_two( x, y ):\r\n    if x > y:\r\n        return x\r\n    return y", "entry_point": "max_of_two", "input": "-10, -20", "output": "-10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "924_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032460", "code": "def mutiple_tuple(nums):\r\n    temp = list(nums)\r\n    product = 1 \r\n    for x in temp:\r\n        product *= x\r\n    return product", "entry_point": "mutiple_tuple", "input": "(4, 3, 2, 2, -1, 18)", "output": "-864", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "925_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032461", "code": "def mutiple_tuple(nums):\r\n    temp = list(nums)\r\n    product = 1 \r\n    for x in temp:\r\n        product *= x\r\n    return product", "entry_point": "mutiple_tuple", "input": "(1, 2, 3)", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "925_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032462", "code": "def mutiple_tuple(nums):\r\n    temp = list(nums)\r\n    product = 1 \r\n    for x in temp:\r\n        product *= x\r\n    return product", "entry_point": "mutiple_tuple", "input": "(-2, -4, -6)", "output": "-48", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "925_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032463", "code": "def binomial_coeffi(n, k): \r\n\tif (k == 0 or k == n): \r\n\t\treturn 1\r\n\treturn (binomial_coeffi(n - 1, k - 1) \r\n\t\t+ binomial_coeffi(n - 1, k)) \r\ndef rencontres_number(n, m): \r\n\tif (n == 0 and m == 0): \r\n\t\treturn 1\r\n\tif (n == 1 and m == 0): \r\n\t\treturn 0\r\n\tif (m == 0): \r\n\t\treturn ((n - 1) * (rencontres_number(n - 1, 0)+ rencontres_number(n - 2, 0))) \r\n\treturn (binomial_coeffi(n, m) * rencontres_number(n - m, 0))", "entry_point": "rencontres_number", "input": "7, 2", "output": "924", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "926_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032464", "code": "def binomial_coeffi(n, k): \r\n\tif (k == 0 or k == n): \r\n\t\treturn 1\r\n\treturn (binomial_coeffi(n - 1, k - 1) \r\n\t\t+ binomial_coeffi(n - 1, k)) \r\ndef rencontres_number(n, m): \r\n\tif (n == 0 and m == 0): \r\n\t\treturn 1\r\n\tif (n == 1 and m == 0): \r\n\t\treturn 0\r\n\tif (m == 0): \r\n\t\treturn ((n - 1) * (rencontres_number(n - 1, 0)+ rencontres_number(n - 2, 0))) \r\n\treturn (binomial_coeffi(n, m) * rencontres_number(n - m, 0))", "entry_point": "rencontres_number", "input": "3, 0", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "926_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032465", "code": "def binomial_coeffi(n, k): \r\n\tif (k == 0 or k == n): \r\n\t\treturn 1\r\n\treturn (binomial_coeffi(n - 1, k - 1) \r\n\t\t+ binomial_coeffi(n - 1, k)) \r\ndef rencontres_number(n, m): \r\n\tif (n == 0 and m == 0): \r\n\t\treturn 1\r\n\tif (n == 1 and m == 0): \r\n\t\treturn 0\r\n\tif (m == 0): \r\n\t\treturn ((n - 1) * (rencontres_number(n - 1, 0)+ rencontres_number(n - 2, 0))) \r\n\treturn (binomial_coeffi(n, m) * rencontres_number(n - m, 0))", "entry_point": "rencontres_number", "input": "3, 1", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "926_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032466", "code": "import re\r\ndef change_date_format(dt):\r\n        return re.sub(r'(\\d{4})-(\\d{1,2})-(\\d{1,2})', '\\\\3-\\\\2-\\\\1', dt)\r\n        return change_date_format(dt)", "entry_point": "change_date_format", "input": "'2026-01-02'", "output": "'02-01-2026'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "928_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032467", "code": "import re\r\ndef change_date_format(dt):\r\n        return re.sub(r'(\\d{4})-(\\d{1,2})-(\\d{1,2})', '\\\\3-\\\\2-\\\\1', dt)\r\n        return change_date_format(dt)", "entry_point": "change_date_format", "input": "'2021-01-04'", "output": "'04-01-2021'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "928_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032468", "code": "import re\r\ndef change_date_format(dt):\r\n        return re.sub(r'(\\d{4})-(\\d{1,2})-(\\d{1,2})', '\\\\3-\\\\2-\\\\1', dt)\r\n        return change_date_format(dt)", "entry_point": "change_date_format", "input": "'2030-06-06'", "output": "'06-06-2030'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "928_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032469", "code": "def count_tuplex(tuplex,value):  \r\n  count = tuplex.count(value)\r\n  return count", "entry_point": "count_tuplex", "input": "(2, 4, 5, 6, 2, 3, 4, 4, 7), 4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "929_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032470", "code": "def count_tuplex(tuplex,value):  \r\n  count = tuplex.count(value)\r\n  return count", "entry_point": "count_tuplex", "input": "(2, 4, 5, 6, 2, 3, 4, 4, 7), 2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "929_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032471", "code": "def count_tuplex(tuplex,value):  \r\n  count = tuplex.count(value)\r\n  return count", "entry_point": "count_tuplex", "input": "(2, 4, 7, 7, 7, 3, 4, 4, 7), 7", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "929_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032472", "code": "import re\r\ndef text_match(text):\r\n        patterns = 'ab*?'\r\n        if re.search(patterns,  text):\r\n                return ('Found a match!')\r\n        else:\r\n                return ('Not matched!')", "entry_point": "text_match", "input": "'msb'", "output": "'Not matched!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "930_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032473", "code": "import re\r\ndef text_match(text):\r\n        patterns = 'ab*?'\r\n        if re.search(patterns,  text):\r\n                return ('Found a match!')\r\n        else:\r\n                return ('Not matched!')", "entry_point": "text_match", "input": "'a0c'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "930_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032474", "code": "import re\r\ndef text_match(text):\r\n        patterns = 'ab*?'\r\n        if re.search(patterns,  text):\r\n                return ('Found a match!')\r\n        else:\r\n                return ('Not matched!')", "entry_point": "text_match", "input": "'abbc'", "output": "'Found a match!'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "930_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032475", "code": "import math \r\ndef sum_series(number):\r\n total = 0\r\n total = math.pow((number * (number + 1)) /2, 2)\r\n return total", "entry_point": "sum_series", "input": "7", "output": "784.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "931_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032476", "code": "import math \r\ndef sum_series(number):\r\n total = 0\r\n total = math.pow((number * (number + 1)) /2, 2)\r\n return total", "entry_point": "sum_series", "input": "5", "output": "225.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "931_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032477", "code": "import math \r\ndef sum_series(number):\r\n total = 0\r\n total = math.pow((number * (number + 1)) /2, 2)\r\n return total", "entry_point": "sum_series", "input": "15", "output": "14400.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "931_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032478", "code": "def remove_duplic_list(l):\r\n    temp = []\r\n    for x in l:\r\n        if x not in temp:\r\n            temp.append(x)\r\n    return temp", "entry_point": "remove_duplic_list", "input": "['Python', 'Exercises', 'Practice', 'Solution', 'Exercises']", "output": "['Python', 'Exercises', 'Practice', 'Solution']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "932_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032479", "code": "def remove_duplic_list(l):\r\n    temp = []\r\n    for x in l:\r\n        if x not in temp:\r\n            temp.append(x)\r\n    return temp", "entry_point": "remove_duplic_list", "input": "['Python', 'Exercises', 'Practice', 'Solution', 'Exercises', 'Java']", "output": "['Python', 'Exercises', 'Practice', 'Solution', 'Java']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "932_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032480", "code": "def remove_duplic_list(l):\r\n    temp = []\r\n    for x in l:\r\n        if x not in temp:\r\n            temp.append(x)\r\n    return temp", "entry_point": "remove_duplic_list", "input": "['Python', 'Exercises', 'Practice', 'Solution', 'Exercises', 'C++', 'C', 'C++']", "output": "['Python', 'Exercises', 'Practice', 'Solution', 'C++', 'C']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "932_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032481", "code": "import re\r\ndef camel_to_snake(text):\r\n  str1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\r\n  return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', str1).lower()", "entry_point": "camel_to_snake", "input": "'GoogleAssistant'", "output": "'google_assistant'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "933_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032482", "code": "import re\r\ndef camel_to_snake(text):\r\n  str1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\r\n  return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', str1).lower()", "entry_point": "camel_to_snake", "input": "'ChromeCast'", "output": "'chrome_cast'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "933_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032483", "code": "import re\r\ndef camel_to_snake(text):\r\n  str1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\r\n  return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', str1).lower()", "entry_point": "camel_to_snake", "input": "'QuadCore'", "output": "'quad_core'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "933_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032484", "code": "def dealnnoy_num(n, m): \r\n\tif (m == 0 or n == 0) : \r\n\t\treturn 1\r\n\treturn dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)", "entry_point": "dealnnoy_num", "input": "3, 4", "output": "129", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "934_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032485", "code": "def dealnnoy_num(n, m): \r\n\tif (m == 0 or n == 0) : \r\n\t\treturn 1\r\n\treturn dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)", "entry_point": "dealnnoy_num", "input": "3, 3", "output": "63", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "934_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032486", "code": "def dealnnoy_num(n, m): \r\n\tif (m == 0 or n == 0) : \r\n\t\treturn 1\r\n\treturn dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)", "entry_point": "dealnnoy_num", "input": "4, 5", "output": "681", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "934_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032487", "code": "def series_sum(number):\r\n total = 0\r\n total = (number * (number + 1) * (2 * number + 1)) / 6\r\n return total", "entry_point": "series_sum", "input": "6", "output": "91.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "935_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032488", "code": "def series_sum(number):\r\n total = 0\r\n total = (number * (number + 1) * (2 * number + 1)) / 6\r\n return total", "entry_point": "series_sum", "input": "7", "output": "140.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "935_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032489", "code": "def series_sum(number):\r\n total = 0\r\n total = (number * (number + 1) * (2 * number + 1)) / 6\r\n return total", "entry_point": "series_sum", "input": "12", "output": "650.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "935_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032490", "code": "def re_arrange_tuples(test_list, ord_list):\r\n  temp = dict(test_list)\r\n  res = [(key, temp[key]) for key in ord_list]\r\n  return (res) ", "entry_point": "re_arrange_tuples", "input": "[(4, 3), (1, 9), (2, 10), (3, 2)], [1, 4, 2, 3]", "output": "[(1, 9), (4, 3), (2, 10), (3, 2)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "936_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032491", "code": "def re_arrange_tuples(test_list, ord_list):\r\n  temp = dict(test_list)\r\n  res = [(key, temp[key]) for key in ord_list]\r\n  return (res) ", "entry_point": "re_arrange_tuples", "input": "[(5, 4), (2, 10), (3, 11), (4, 3)], [3, 4, 2, 3]", "output": "[(3, 11), (4, 3), (2, 10), (3, 11)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "936_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032492", "code": "def re_arrange_tuples(test_list, ord_list):\r\n  temp = dict(test_list)\r\n  res = [(key, temp[key]) for key in ord_list]\r\n  return (res) ", "entry_point": "re_arrange_tuples", "input": "[(6, 3), (3, 8), (5, 7), (2, 4)], [2, 5, 3, 6]", "output": "[(2, 4), (5, 7), (3, 8), (6, 3)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "936_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032493", "code": "from collections import Counter \r\ndef max_char(str1):\r\n    temp = Counter(str1) \r\n    max_char = max(temp, key = temp.get)\r\n    return max_char", "entry_point": "max_char", "input": "'hello world'", "output": "'l'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "937_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032494", "code": "from collections import Counter \r\ndef max_char(str1):\r\n    temp = Counter(str1) \r\n    max_char = max(temp, key = temp.get)\r\n    return max_char", "entry_point": "max_char", "input": "'hello '", "output": "'l'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "937_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032495", "code": "from collections import Counter \r\ndef max_char(str1):\r\n    temp = Counter(str1) \r\n    max_char = max(temp, key = temp.get)\r\n    return max_char", "entry_point": "max_char", "input": "'python pr'", "output": "'p'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "937_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032496", "code": "import sys \r\n\r\ndef find_closet(A, B, C, p, q, r): \r\n\tdiff = sys.maxsize \r\n\tres_i = 0\r\n\tres_j = 0\r\n\tres_k = 0\r\n\ti = 0\r\n\tj = 0\r\n\tk = 0\r\n\twhile(i < p and j < q and k < r): \r\n\t\tminimum = min(A[i], min(B[j], C[k])) \r\n\t\tmaximum = max(A[i], max(B[j], C[k])); \r\n\t\tif maximum-minimum < diff: \r\n\t\t\tres_i = i \r\n\t\t\tres_j = j \r\n\t\t\tres_k = k \r\n\t\t\tdiff = maximum - minimum; \r\n\t\tif diff == 0: \r\n\t\t\tbreak\r\n\t\tif A[i] == minimum: \r\n\t\t\ti = i+1\r\n\t\telif B[j] == minimum: \r\n\t\t\tj = j+1\r\n\t\telse: \r\n\t\t\tk = k+1\r\n\treturn A[res_i],B[res_j],C[res_k]", "entry_point": "find_closet", "input": "[1, 4, 10], [2, 15, 20], [10, 12], 3, 3, 2", "output": "(10, 15, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "938_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032497", "code": "import sys \r\n\r\ndef find_closet(A, B, C, p, q, r): \r\n\tdiff = sys.maxsize \r\n\tres_i = 0\r\n\tres_j = 0\r\n\tres_k = 0\r\n\ti = 0\r\n\tj = 0\r\n\tk = 0\r\n\twhile(i < p and j < q and k < r): \r\n\t\tminimum = min(A[i], min(B[j], C[k])) \r\n\t\tmaximum = max(A[i], max(B[j], C[k])); \r\n\t\tif maximum-minimum < diff: \r\n\t\t\tres_i = i \r\n\t\t\tres_j = j \r\n\t\t\tres_k = k \r\n\t\t\tdiff = maximum - minimum; \r\n\t\tif diff == 0: \r\n\t\t\tbreak\r\n\t\tif A[i] == minimum: \r\n\t\t\ti = i+1\r\n\t\telif B[j] == minimum: \r\n\t\t\tj = j+1\r\n\t\telse: \r\n\t\t\tk = k+1\r\n\treturn A[res_i],B[res_j],C[res_k]", "entry_point": "find_closet", "input": "[20, 24, 100], [2, 19, 22, 79, 800], [10, 12, 23, 24, 119], 3, 5, 5", "output": "(24, 22, 23)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "938_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032498", "code": "import sys \r\n\r\ndef find_closet(A, B, C, p, q, r): \r\n\tdiff = sys.maxsize \r\n\tres_i = 0\r\n\tres_j = 0\r\n\tres_k = 0\r\n\ti = 0\r\n\tj = 0\r\n\tk = 0\r\n\twhile(i < p and j < q and k < r): \r\n\t\tminimum = min(A[i], min(B[j], C[k])) \r\n\t\tmaximum = max(A[i], max(B[j], C[k])); \r\n\t\tif maximum-minimum < diff: \r\n\t\t\tres_i = i \r\n\t\t\tres_j = j \r\n\t\t\tres_k = k \r\n\t\t\tdiff = maximum - minimum; \r\n\t\tif diff == 0: \r\n\t\t\tbreak\r\n\t\tif A[i] == minimum: \r\n\t\t\ti = i+1\r\n\t\telif B[j] == minimum: \r\n\t\t\tj = j+1\r\n\t\telse: \r\n\t\t\tk = k+1\r\n\treturn A[res_i],B[res_j],C[res_k]", "entry_point": "find_closet", "input": "[2, 5, 11], [3, 16, 21], [11, 13], 3, 3, 2", "output": "(11, 16, 11)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "938_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032499", "code": "def sorted_models(models):\r\n sorted_models = sorted(models, key = lambda x: x['color'])\r\n return sorted_models", "entry_point": "sorted_models", "input": "[{'make': 'Nokia', 'model': 216, 'color': 'Black'}, {'make': 'Mi Max', 'model': 2, 'color': 'Gold'}, {'make': 'Samsung', 'model': 7, 'color': 'Blue'}]", "output": "[{'make': 'Nokia', 'model': 216, 'color': 'Black'}, {'make': 'Samsung', 'model': 7, 'color': 'Blue'}, {'make': 'Mi Max', 'model': 2, 'color': 'Gold'}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "939_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032500", "code": "def sorted_models(models):\r\n sorted_models = sorted(models, key = lambda x: x['color'])\r\n return sorted_models", "entry_point": "sorted_models", "input": "[{'make': 'Vivo', 'model': 20, 'color': 'Blue'}, {'make': 'oppo', 'model': 17, 'color': 'Gold'}, {'make': 'Apple', 'model': 11, 'color': 'red'}]", "output": "[{'make': 'Vivo', 'model': 20, 'color': 'Blue'}, {'make': 'oppo', 'model': 17, 'color': 'Gold'}, {'make': 'Apple', 'model': 11, 'color': 'red'}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "939_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032501", "code": "def sorted_models(models):\r\n sorted_models = sorted(models, key = lambda x: x['color'])\r\n return sorted_models", "entry_point": "sorted_models", "input": "[{'make': 'micromax', 'model': 40, 'color': 'grey'}, {'make': 'poco', 'model': 60, 'color': 'blue'}]", "output": "[{'make': 'poco', 'model': 60, 'color': 'blue'}, {'make': 'micromax', 'model': 40, 'color': 'grey'}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "939_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032502", "code": "def count_elim(num):\r\n  count_elim = 0\r\n  for n in num:\r\n    if isinstance(n, tuple):\r\n        break\r\n    count_elim += 1\r\n  return count_elim", "entry_point": "count_elim", "input": "[10, 20, 30, (10, 20), 40]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "941_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032503", "code": "def count_elim(num):\r\n  count_elim = 0\r\n  for n in num:\r\n    if isinstance(n, tuple):\r\n        break\r\n    count_elim += 1\r\n  return count_elim", "entry_point": "count_elim", "input": "[10, (20, 30), (10, 20), 40]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "941_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032504", "code": "def count_elim(num):\r\n  count_elim = 0\r\n  for n in num:\r\n    if isinstance(n, tuple):\r\n        break\r\n    count_elim += 1\r\n  return count_elim", "entry_point": "count_elim", "input": "[(10, (20, 30, (10, 20), 40))]", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "941_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032505", "code": "def check_element(test_tup, check_list):\r\n  res = False\r\n  for ele in check_list:\r\n    if ele in test_tup:\r\n      res = True\r\n      break\r\n  return (res) ", "entry_point": "check_element", "input": "(4, 5, 7, 9, 3), [6, 7, 10, 11]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "942_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032506", "code": "def check_element(test_tup, check_list):\r\n  res = False\r\n  for ele in check_list:\r\n    if ele in test_tup:\r\n      res = True\r\n      break\r\n  return (res) ", "entry_point": "check_element", "input": "(1, 2, 3, 4), [4, 6, 7, 8, 9]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "942_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032507", "code": "def check_element(test_tup, check_list):\r\n  res = False\r\n  for ele in check_list:\r\n    if ele in test_tup:\r\n      res = True\r\n      break\r\n  return (res) ", "entry_point": "check_element", "input": "(3, 2, 1, 4, 5), [9, 8, 7, 6]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "942_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032508", "code": "from heapq import merge\r\ndef combine_lists(num1,num2):\r\n  combine_lists=list(merge(num1, num2))\r\n  return combine_lists", "entry_point": "combine_lists", "input": "[1, 3, 5, 7, 9, 11], [0, 2, 4, 6, 8, 10]", "output": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "943_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032509", "code": "from heapq import merge\r\ndef combine_lists(num1,num2):\r\n  combine_lists=list(merge(num1, num2))\r\n  return combine_lists", "entry_point": "combine_lists", "input": "[1, 3, 5, 6, 8, 9], [2, 5, 7, 11]", "output": "[1, 2, 3, 5, 5, 6, 7, 8, 9, 11]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "943_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032510", "code": "from heapq import merge\r\ndef combine_lists(num1,num2):\r\n  combine_lists=list(merge(num1, num2))\r\n  return combine_lists", "entry_point": "combine_lists", "input": "[1, 3, 7], [2, 4, 6]", "output": "[1, 2, 3, 4, 6, 7]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "943_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032511", "code": "import re\r\ndef num_position(text):\r\n for m in re.finditer(\"\\d+\", text):\r\n    return m.start()", "entry_point": "num_position", "input": "'there are 70 flats in this apartment'", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "944_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032512", "code": "import re\r\ndef num_position(text):\r\n for m in re.finditer(\"\\d+\", text):\r\n    return m.start()", "entry_point": "num_position", "input": "'every adult have 32 teeth'", "output": "17", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "944_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032513", "code": "import re\r\ndef num_position(text):\r\n for m in re.finditer(\"\\d+\", text):\r\n    return m.start()", "entry_point": "num_position", "input": "'isha has 79 chocolates in her bag'", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "944_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032514", "code": "def tuple_to_set(t):\r\n  s = set(t)\r\n  return (s) ", "entry_point": "tuple_to_set", "input": "('x', 'y', 'z')", "output": "{'y', 'x', 'z'}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "945_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032515", "code": "def tuple_to_set(t):\r\n  s = set(t)\r\n  return (s) ", "entry_point": "tuple_to_set", "input": "('a', 'b', 'c')", "output": "{'c', 'a', 'b'}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "945_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032516", "code": "def tuple_to_set(t):\r\n  s = set(t)\r\n  return (s) ", "entry_point": "tuple_to_set", "input": "('z', 'd', 'e')", "output": "{'d', 'e', 'z'}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "945_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032517", "code": "from collections import Counter \r\ndef most_common_elem(s,a):\r\n  most_common_elem=Counter(s).most_common(a)\r\n  return most_common_elem", "entry_point": "most_common_elem", "input": "'lkseropewdssafsdfafkpwe', 3", "output": "[('s', 4), ('e', 3), ('f', 3)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "946_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032518", "code": "from collections import Counter \r\ndef most_common_elem(s,a):\r\n  most_common_elem=Counter(s).most_common(a)\r\n  return most_common_elem", "entry_point": "most_common_elem", "input": "'lkseropewdssafsdfafkpwe', 2", "output": "[('s', 4), ('e', 3)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "946_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032519", "code": "from collections import Counter \r\ndef most_common_elem(s,a):\r\n  most_common_elem=Counter(s).most_common(a)\r\n  return most_common_elem", "entry_point": "most_common_elem", "input": "'lkseropewdssafsdfafkpwe', 7", "output": "[('s', 4), ('e', 3), ('f', 3), ('k', 2), ('p', 2), ('w', 2), ('d', 2)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "946_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032520", "code": "def len_log(list1):\r\n    min=len(list1[0])\r\n    for i in list1:\r\n        if len(i)<min:\r\n            min=len(i)\r\n    return min", "entry_point": "len_log", "input": "['win', 'lose', 'great']", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "947_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032521", "code": "def len_log(list1):\r\n    min=len(list1[0])\r\n    for i in list1:\r\n        if len(i)<min:\r\n            min=len(i)\r\n    return min", "entry_point": "len_log", "input": "['a', 'ab', 'abc']", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "947_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032522", "code": "def len_log(list1):\r\n    min=len(list1[0])\r\n    for i in list1:\r\n        if len(i)<min:\r\n            min=len(i)\r\n    return min", "entry_point": "len_log", "input": "['12', '12', '1234']", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "947_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032523", "code": "def get_item(tup1,index):\r\n  item = tup1[index]\r\n  return item", "entry_point": "get_item", "input": "('w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e'), 3", "output": "'e'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "948_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032524", "code": "def get_item(tup1,index):\r\n  item = tup1[index]\r\n  return item", "entry_point": "get_item", "input": "('w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e'), -4", "output": "'u'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "948_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032525", "code": "def get_item(tup1,index):\r\n  item = tup1[index]\r\n  return item", "entry_point": "get_item", "input": "('w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e'), -3", "output": "'r'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "948_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032526", "code": "def count_digs(tup):\r\n  return sum([len(str(ele)) for ele in tup ]) \r\ndef sort_list(test_list):\r\n  test_list.sort(key = count_digs)\r\n  return (str(test_list))", "entry_point": "sort_list", "input": "[(3, 4, 6, 723), (1, 2), (12345,), (134, 234, 34)]", "output": "'[(1, 2), (12345,), (3, 4, 6, 723), (134, 234, 34)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "949_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032527", "code": "def count_digs(tup):\r\n  return sum([len(str(ele)) for ele in tup ]) \r\ndef sort_list(test_list):\r\n  test_list.sort(key = count_digs)\r\n  return (str(test_list))", "entry_point": "sort_list", "input": "[(3, 4, 8), (1, 2), (1234335,), (1345, 234, 334)]", "output": "'[(1, 2), (3, 4, 8), (1234335,), (1345, 234, 334)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "949_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032528", "code": "def count_digs(tup):\r\n  return sum([len(str(ele)) for ele in tup ]) \r\ndef sort_list(test_list):\r\n  test_list.sort(key = count_digs)\r\n  return (str(test_list))", "entry_point": "sort_list", "input": "[(34, 4, 61, 723), (1, 2), (145,), (134, 23)]", "output": "'[(1, 2), (145,), (134, 23), (34, 4, 61, 723)]'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "949_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032529", "code": "def chinese_zodiac(year):\r\n if (year - 2000) % 12 == 0:\r\n     sign = 'Dragon'\r\n elif (year - 2000) % 12 == 1:\r\n     sign = 'Snake'\r\n elif (year - 2000) % 12 == 2:\r\n     sign = 'Horse'\r\n elif (year - 2000) % 12 == 3:\r\n     sign = 'sheep'\r\n elif (year - 2000) % 12 == 4:\r\n     sign = 'Monkey'\r\n elif (year - 2000) % 12 == 5:\r\n     sign = 'Rooster'\r\n elif (year - 2000) % 12 == 6:\r\n     sign = 'Dog'\r\n elif (year - 2000) % 12 == 7:\r\n     sign = 'Pig'\r\n elif (year - 2000) % 12 == 8:\r\n     sign = 'Rat'\r\n elif (year - 2000) % 12 == 9:\r\n     sign = 'Ox'\r\n elif (year - 2000) % 12 == 10:\r\n     sign = 'Tiger'\r\n else:\r\n     sign = 'Hare'\r\n return sign", "entry_point": "chinese_zodiac", "input": "1997", "output": "'Ox'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "950_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032530", "code": "def chinese_zodiac(year):\r\n if (year - 2000) % 12 == 0:\r\n     sign = 'Dragon'\r\n elif (year - 2000) % 12 == 1:\r\n     sign = 'Snake'\r\n elif (year - 2000) % 12 == 2:\r\n     sign = 'Horse'\r\n elif (year - 2000) % 12 == 3:\r\n     sign = 'sheep'\r\n elif (year - 2000) % 12 == 4:\r\n     sign = 'Monkey'\r\n elif (year - 2000) % 12 == 5:\r\n     sign = 'Rooster'\r\n elif (year - 2000) % 12 == 6:\r\n     sign = 'Dog'\r\n elif (year - 2000) % 12 == 7:\r\n     sign = 'Pig'\r\n elif (year - 2000) % 12 == 8:\r\n     sign = 'Rat'\r\n elif (year - 2000) % 12 == 9:\r\n     sign = 'Ox'\r\n elif (year - 2000) % 12 == 10:\r\n     sign = 'Tiger'\r\n else:\r\n     sign = 'Hare'\r\n return sign", "entry_point": "chinese_zodiac", "input": "1998", "output": "'Tiger'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "950_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032531", "code": "def chinese_zodiac(year):\r\n if (year - 2000) % 12 == 0:\r\n     sign = 'Dragon'\r\n elif (year - 2000) % 12 == 1:\r\n     sign = 'Snake'\r\n elif (year - 2000) % 12 == 2:\r\n     sign = 'Horse'\r\n elif (year - 2000) % 12 == 3:\r\n     sign = 'sheep'\r\n elif (year - 2000) % 12 == 4:\r\n     sign = 'Monkey'\r\n elif (year - 2000) % 12 == 5:\r\n     sign = 'Rooster'\r\n elif (year - 2000) % 12 == 6:\r\n     sign = 'Dog'\r\n elif (year - 2000) % 12 == 7:\r\n     sign = 'Pig'\r\n elif (year - 2000) % 12 == 8:\r\n     sign = 'Rat'\r\n elif (year - 2000) % 12 == 9:\r\n     sign = 'Ox'\r\n elif (year - 2000) % 12 == 10:\r\n     sign = 'Tiger'\r\n else:\r\n     sign = 'Hare'\r\n return sign", "entry_point": "chinese_zodiac", "input": "1994", "output": "'Dog'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "950_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032532", "code": "def max_similar_indices(test_list1, test_list2):\r\n  res = [(max(x[0], y[0]), max(x[1], y[1]))\r\n   for x, y in zip(test_list1, test_list2)]\r\n  return (res) ", "entry_point": "max_similar_indices", "input": "[(2, 4), (6, 7), (5, 1)], [(5, 4), (8, 10), (8, 14)]", "output": "[(5, 4), (8, 10), (8, 14)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "951_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032533", "code": "def max_similar_indices(test_list1, test_list2):\r\n  res = [(max(x[0], y[0]), max(x[1], y[1]))\r\n   for x, y in zip(test_list1, test_list2)]\r\n  return (res) ", "entry_point": "max_similar_indices", "input": "[(3, 5), (7, 8), (6, 2)], [(6, 5), (9, 11), (9, 15)]", "output": "[(6, 5), (9, 11), (9, 15)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "951_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032534", "code": "def max_similar_indices(test_list1, test_list2):\r\n  res = [(max(x[0], y[0]), max(x[1], y[1]))\r\n   for x, y in zip(test_list1, test_list2)]\r\n  return (res) ", "entry_point": "max_similar_indices", "input": "[(4, 6), (8, 9), (7, 3)], [(7, 6), (10, 12), (10, 16)]", "output": "[(7, 6), (10, 12), (10, 16)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "951_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032535", "code": "def nCr_mod_p(n, r, p): \r\n\tif (r > n- r): \r\n\t\tr = n - r \r\n\tC = [0 for i in range(r + 1)] \r\n\tC[0] = 1 \r\n\tfor i in range(1, n + 1): \r\n\t\tfor j in range(min(i, r), 0, -1): \r\n\t\t\tC[j] = (C[j] + C[j-1]) % p \r\n\treturn C[r] ", "entry_point": "nCr_mod_p", "input": "10, 2, 13", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "952_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032536", "code": "def nCr_mod_p(n, r, p): \r\n\tif (r > n- r): \r\n\t\tr = n - r \r\n\tC = [0 for i in range(r + 1)] \r\n\tC[0] = 1 \r\n\tfor i in range(1, n + 1): \r\n\t\tfor j in range(min(i, r), 0, -1): \r\n\t\t\tC[j] = (C[j] + C[j-1]) % p \r\n\treturn C[r] ", "entry_point": "nCr_mod_p", "input": "11, 3, 14", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "952_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032537", "code": "def nCr_mod_p(n, r, p): \r\n\tif (r > n- r): \r\n\t\tr = n - r \r\n\tC = [0 for i in range(r + 1)] \r\n\tC[0] = 1 \r\n\tfor i in range(1, n + 1): \r\n\t\tfor j in range(min(i, r), 0, -1): \r\n\t\t\tC[j] = (C[j] + C[j-1]) % p \r\n\treturn C[r] ", "entry_point": "nCr_mod_p", "input": "18, 14, 19", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "952_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032538", "code": "def subset(ar, n): \r\n    res = 0\r\n    ar.sort() \r\n    for i in range(0, n) : \r\n        count = 1\r\n        for i in range(n - 1): \r\n            if ar[i] == ar[i + 1]: \r\n                count+=1\r\n            else: \r\n                break \r\n        res = max(res, count)  \r\n    return res ", "entry_point": "subset", "input": "[1, 2, 3, 4], 4", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "953_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032539", "code": "def subset(ar, n): \r\n    res = 0\r\n    ar.sort() \r\n    for i in range(0, n) : \r\n        count = 1\r\n        for i in range(n - 1): \r\n            if ar[i] == ar[i + 1]: \r\n                count+=1\r\n            else: \r\n                break \r\n        res = max(res, count)  \r\n    return res ", "entry_point": "subset", "input": "[5, 6, 9, 3, 4, 3, 4], 7", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "953_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032540", "code": "def subset(ar, n): \r\n    res = 0\r\n    ar.sort() \r\n    for i in range(0, n) : \r\n        count = 1\r\n        for i in range(n - 1): \r\n            if ar[i] == ar[i + 1]: \r\n                count+=1\r\n            else: \r\n                break \r\n        res = max(res, count)  \r\n    return res ", "entry_point": "subset", "input": "[1, 2, 3], 3", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "953_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032541", "code": "def profit_amount(actual_cost,sale_amount): \r\n if(actual_cost > sale_amount):\r\n    amount = actual_cost - sale_amount\r\n    return amount\r\n else:\r\n    return None", "entry_point": "profit_amount", "input": "1500, 1200", "output": "300", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "954_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032542", "code": "def is_abundant(n):\r\n    fctrsum = sum([fctr for fctr in range(1, n) if n % fctr == 0])\r\n    return fctrsum > n", "entry_point": "is_abundant", "input": "12", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "955_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032543", "code": "def is_abundant(n):\r\n    fctrsum = sum([fctr for fctr in range(1, n) if n % fctr == 0])\r\n    return fctrsum > n", "entry_point": "is_abundant", "input": "13", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "955_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032544", "code": "def is_abundant(n):\r\n    fctrsum = sum([fctr for fctr in range(1, n) if n % fctr == 0])\r\n    return fctrsum > n", "entry_point": "is_abundant", "input": "9", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "955_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032545", "code": "import re\r\ndef split_list(text):\r\n  return (re.findall('[A-Z][^A-Z]*', text))", "entry_point": "split_list", "input": "'LearnToBuildAnythingWithGoogle'", "output": "['Learn', 'To', 'Build', 'Anything', 'With', 'Google']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "956_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032546", "code": "import re\r\ndef split_list(text):\r\n  return (re.findall('[A-Z][^A-Z]*', text))", "entry_point": "split_list", "input": "'ApmlifyingTheBlack+DeveloperCommunity'", "output": "['Apmlifying', 'The', 'Black+', 'Developer', 'Community']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "956_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032547", "code": "import re\r\ndef split_list(text):\r\n  return (re.findall('[A-Z][^A-Z]*', text))", "entry_point": "split_list", "input": "'UpdateInTheGoEcoSystem'", "output": "['Update', 'In', 'The', 'Go', 'Eco', 'System']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "956_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032548", "code": "import math\r\ndef get_First_Set_Bit_Pos(n):\r\n     return math.log2(n&-n)+1", "entry_point": "get_First_Set_Bit_Pos", "input": "12", "output": "3.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "957_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032549", "code": "import math\r\ndef get_First_Set_Bit_Pos(n):\r\n     return math.log2(n&-n)+1", "entry_point": "get_First_Set_Bit_Pos", "input": "18", "output": "2.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "957_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032550", "code": "import math\r\ndef get_First_Set_Bit_Pos(n):\r\n     return math.log2(n&-n)+1", "entry_point": "get_First_Set_Bit_Pos", "input": "16", "output": "5.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "957_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032551", "code": "def int_to_roman( num):\r\n        val = [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1]\r\n        syb = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\r\n        roman_num = ''\r\n        i = 0\r\n        while  num > 0:\r\n            for _ in range(num // val[i]):\r\n                roman_num += syb[i]\r\n                num -= val[i]\r\n            i += 1\r\n        return roman_num", "entry_point": "int_to_roman", "input": "1", "output": "'I'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "958_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032552", "code": "def int_to_roman( num):\r\n        val = [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1]\r\n        syb = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\r\n        roman_num = ''\r\n        i = 0\r\n        while  num > 0:\r\n            for _ in range(num // val[i]):\r\n                roman_num += syb[i]\r\n                num -= val[i]\r\n            i += 1\r\n        return roman_num", "entry_point": "int_to_roman", "input": "50", "output": "'L'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "958_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032553", "code": "def int_to_roman( num):\r\n        val = [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1]\r\n        syb = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\r\n        roman_num = ''\r\n        i = 0\r\n        while  num > 0:\r\n            for _ in range(num // val[i]):\r\n                roman_num += syb[i]\r\n                num -= val[i]\r\n            i += 1\r\n        return roman_num", "entry_point": "int_to_roman", "input": "4", "output": "'IV'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "958_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032554", "code": "def Average(lst): \r\n    return sum(lst) / len(lst) ", "entry_point": "Average", "input": "[15, 9, 55, 41, 35, 20, 62, 49]", "output": "35.75", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "959_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032555", "code": "def Average(lst): \r\n    return sum(lst) / len(lst) ", "entry_point": "Average", "input": "[4, 5, 1, 2, 9, 7, 10, 8]", "output": "5.75", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "959_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032556", "code": "def Average(lst): \r\n    return sum(lst) / len(lst) ", "entry_point": "Average", "input": "[1, 2, 3]", "output": "2.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "959_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032557", "code": "def get_noOfways(n):\r\n    if (n == 0):\r\n        return 0;\r\n    if (n == 1):\r\n        return 1; \r\n    return get_noOfways(n - 1) + get_noOfways(n - 2);", "entry_point": "get_noOfways", "input": "4", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "960_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032558", "code": "def get_noOfways(n):\r\n    if (n == 0):\r\n        return 0;\r\n    if (n == 1):\r\n        return 1; \r\n    return get_noOfways(n - 1) + get_noOfways(n - 2);", "entry_point": "get_noOfways", "input": "3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "960_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032559", "code": "def get_noOfways(n):\r\n    if (n == 0):\r\n        return 0;\r\n    if (n == 1):\r\n        return 1; \r\n    return get_noOfways(n - 1) + get_noOfways(n - 2);", "entry_point": "get_noOfways", "input": "5", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "960_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032560", "code": "def roman_to_int(s):\r\n        rom_val = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\r\n        int_val = 0\r\n        for i in range(len(s)):\r\n            if i > 0 and rom_val[s[i]] > rom_val[s[i - 1]]:\r\n                int_val += rom_val[s[i]] - 2 * rom_val[s[i - 1]]\r\n            else:\r\n                int_val += rom_val[s[i]]\r\n        return int_val", "entry_point": "roman_to_int", "input": "'MMMCMLXXXVI'", "output": "3986", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "961_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032561", "code": "def roman_to_int(s):\r\n        rom_val = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\r\n        int_val = 0\r\n        for i in range(len(s)):\r\n            if i > 0 and rom_val[s[i]] > rom_val[s[i - 1]]:\r\n                int_val += rom_val[s[i]] - 2 * rom_val[s[i - 1]]\r\n            else:\r\n                int_val += rom_val[s[i]]\r\n        return int_val", "entry_point": "roman_to_int", "input": "'MMMM'", "output": "4000", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "961_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032562", "code": "def roman_to_int(s):\r\n        rom_val = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\r\n        int_val = 0\r\n        for i in range(len(s)):\r\n            if i > 0 and rom_val[s[i]] > rom_val[s[i - 1]]:\r\n                int_val += rom_val[s[i]] - 2 * rom_val[s[i - 1]]\r\n            else:\r\n                int_val += rom_val[s[i]]\r\n        return int_val", "entry_point": "roman_to_int", "input": "'C'", "output": "100", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "961_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032563", "code": "def sum_Natural(n): \r\n    sum = (n * (n + 1)) \r\n    return int(sum) \r\ndef sum_Even(l,r): \r\n    return (sum_Natural(int(r / 2)) - sum_Natural(int((l - 1) / 2))) ", "entry_point": "sum_Even", "input": "2, 5", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "962_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032564", "code": "def sum_Natural(n): \r\n    sum = (n * (n + 1)) \r\n    return int(sum) \r\ndef sum_Even(l,r): \r\n    return (sum_Natural(int(r / 2)) - sum_Natural(int((l - 1) / 2))) ", "entry_point": "sum_Even", "input": "3, 8", "output": "18", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "962_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032565", "code": "def sum_Natural(n): \r\n    sum = (n * (n + 1)) \r\n    return int(sum) \r\ndef sum_Even(l,r): \r\n    return (sum_Natural(int(r / 2)) - sum_Natural(int((l - 1) / 2))) ", "entry_point": "sum_Even", "input": "4, 6", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "962_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032566", "code": "def discriminant_value(x,y,z):\r\n    discriminant = (y**2) - (4*x*z)\r\n    if discriminant > 0:\r\n        return (\"Two solutions\",discriminant)\r\n    elif discriminant == 0:\r\n        return (\"one solution\",discriminant)\r\n    elif discriminant < 0:\r\n        return (\"no real solution\",discriminant)", "entry_point": "discriminant_value", "input": "4, 8, 2", "output": "('Two solutions', 32)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "963_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032567", "code": "def discriminant_value(x,y,z):\r\n    discriminant = (y**2) - (4*x*z)\r\n    if discriminant > 0:\r\n        return (\"Two solutions\",discriminant)\r\n    elif discriminant == 0:\r\n        return (\"one solution\",discriminant)\r\n    elif discriminant < 0:\r\n        return (\"no real solution\",discriminant)", "entry_point": "discriminant_value", "input": "5, 7, 9", "output": "('no real solution', -131)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "963_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032568", "code": "def discriminant_value(x,y,z):\r\n    discriminant = (y**2) - (4*x*z)\r\n    if discriminant > 0:\r\n        return (\"Two solutions\",discriminant)\r\n    elif discriminant == 0:\r\n        return (\"one solution\",discriminant)\r\n    elif discriminant < 0:\r\n        return (\"no real solution\",discriminant)", "entry_point": "discriminant_value", "input": "0, 0, 9", "output": "('one solution', 0)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "963_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032569", "code": "def word_len(s): \r\n    s = s.split(' ')   \r\n    for word in s:    \r\n        if len(word)%2==0: \r\n            return True  \r\n        else:\r\n          return False", "entry_point": "word_len", "input": "'program'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "964_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032570", "code": "def word_len(s): \r\n    s = s.split(' ')   \r\n    for word in s:    \r\n        if len(word)%2==0: \r\n            return True  \r\n        else:\r\n          return False", "entry_point": "word_len", "input": "'solution'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "964_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032571", "code": "def word_len(s): \r\n    s = s.split(' ')   \r\n    for word in s:    \r\n        if len(word)%2==0: \r\n            return True  \r\n        else:\r\n          return False", "entry_point": "word_len", "input": "'data'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "964_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032572", "code": "def camel_to_snake(text):\r\n        import re\r\n        str1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\r\n        return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', str1).lower()", "entry_point": "camel_to_snake", "input": "'PythonProgram'", "output": "'python_program'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "965_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032573", "code": "def camel_to_snake(text):\r\n        import re\r\n        str1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\r\n        return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', str1).lower()", "entry_point": "camel_to_snake", "input": "'pythonLanguage'", "output": "'python_language'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "965_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032574", "code": "def camel_to_snake(text):\r\n        import re\r\n        str1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\r\n        return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', str1).lower()", "entry_point": "camel_to_snake", "input": "'ProgrammingLanguage'", "output": "'programming_language'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "965_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032575", "code": "def remove_empty(tuple1): #L = [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]\r\n   tuple1 = [t for t in tuple1 if t]\r\n   return tuple1", "entry_point": "remove_empty", "input": "[(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), 'd']", "output": "[('',), ('a', 'b'), ('a', 'b', 'c'), 'd']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "966_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032576", "code": "def remove_empty(tuple1): #L = [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]\r\n   tuple1 = [t for t in tuple1 if t]\r\n   return tuple1", "entry_point": "remove_empty", "input": "[(), (), ('',), 'python', 'program']", "output": "[('',), 'python', 'program']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "966_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032577", "code": "def remove_empty(tuple1): #L = [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]\r\n   tuple1 = [t for t in tuple1 if t]\r\n   return tuple1", "entry_point": "remove_empty", "input": "[(), (), ('',), 'java']", "output": "[('',), 'java']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "966_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032578", "code": "def check(string): \r\n  if len(set(string).intersection(\"AEIOUaeiou\"))>=5: \r\n    return ('accepted') \r\n  else: \r\n    return (\"not accepted\") ", "entry_point": "check", "input": "'SEEquoiaL'", "output": "'accepted'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "967_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032579", "code": "def check(string): \r\n  if len(set(string).intersection(\"AEIOUaeiou\"))>=5: \r\n    return ('accepted') \r\n  else: \r\n    return (\"not accepted\") ", "entry_point": "check", "input": "'program'", "output": "'not accepted'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "967_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032580", "code": "def check(string): \r\n  if len(set(string).intersection(\"AEIOUaeiou\"))>=5: \r\n    return ('accepted') \r\n  else: \r\n    return (\"not accepted\") ", "entry_point": "check", "input": "'fine'", "output": "'not accepted'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "967_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032581", "code": "def floor_Max(A,B,N):\r\n    x = min(B - 1,N)\r\n    return (A*x) // B", "entry_point": "floor_Max", "input": "11, 10, 9", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "968_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032582", "code": "def floor_Max(A,B,N):\r\n    x = min(B - 1,N)\r\n    return (A*x) // B", "entry_point": "floor_Max", "input": "5, 7, 4", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "968_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032583", "code": "def floor_Max(A,B,N):\r\n    x = min(B - 1,N)\r\n    return (A*x) // B", "entry_point": "floor_Max", "input": "2, 2, 1", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "968_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032584", "code": "def join_tuples(test_list):\r\n  res = []\r\n  for sub in test_list:\r\n    if res and res[-1][0] == sub[0]:\r\n      res[-1].extend(sub[1:])\r\n    else:\r\n      res.append([ele for ele in sub])\r\n  res = list(map(tuple, res))\r\n  return (res) ", "entry_point": "join_tuples", "input": "[(5, 6), (5, 7), (6, 8), (6, 10), (7, 13)]", "output": "[(5, 6, 7), (6, 8, 10), (7, 13)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "969_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032585", "code": "def join_tuples(test_list):\r\n  res = []\r\n  for sub in test_list:\r\n    if res and res[-1][0] == sub[0]:\r\n      res[-1].extend(sub[1:])\r\n    else:\r\n      res.append([ele for ele in sub])\r\n  res = list(map(tuple, res))\r\n  return (res) ", "entry_point": "join_tuples", "input": "[(6, 7), (6, 8), (7, 9), (7, 11), (8, 14)]", "output": "[(6, 7, 8), (7, 9, 11), (8, 14)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "969_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032586", "code": "def join_tuples(test_list):\r\n  res = []\r\n  for sub in test_list:\r\n    if res and res[-1][0] == sub[0]:\r\n      res[-1].extend(sub[1:])\r\n    else:\r\n      res.append([ele for ele in sub])\r\n  res = list(map(tuple, res))\r\n  return (res) ", "entry_point": "join_tuples", "input": "[(7, 8), (7, 9), (8, 10), (8, 12), (9, 15)]", "output": "[(7, 8, 9), (8, 10, 12), (9, 15)]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "969_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032587", "code": "def min_of_two( x, y ):\r\n    if x < y:\r\n        return x\r\n    return y", "entry_point": "min_of_two", "input": "10, 20", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "970_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032588", "code": "def min_of_two( x, y ):\r\n    if x < y:\r\n        return x\r\n    return y", "entry_point": "min_of_two", "input": "19, 15", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "970_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032589", "code": "def min_of_two( x, y ):\r\n    if x < y:\r\n        return x\r\n    return y", "entry_point": "min_of_two", "input": "-10, -20", "output": "-20", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "970_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032590", "code": "def maximum_segments(n, a, b, c) : \r\n\tdp = [-1] * (n + 10) \r\n\tdp[0] = 0\r\n\tfor i in range(0, n) : \r\n\t\tif (dp[i] != -1) : \r\n\t\t\tif(i + a <= n ): \r\n\t\t\t\tdp[i + a] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + a]) \r\n\t\t\tif(i + b <= n ): \r\n\t\t\t\tdp[i + b] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + b]) \r\n\t\t\tif(i + c <= n ): \r\n\t\t\t\tdp[i + c] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + c]) \r\n\treturn dp[n]", "entry_point": "maximum_segments", "input": "7, 5, 2, 5", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "971_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032591", "code": "def maximum_segments(n, a, b, c) : \r\n\tdp = [-1] * (n + 10) \r\n\tdp[0] = 0\r\n\tfor i in range(0, n) : \r\n\t\tif (dp[i] != -1) : \r\n\t\t\tif(i + a <= n ): \r\n\t\t\t\tdp[i + a] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + a]) \r\n\t\t\tif(i + b <= n ): \r\n\t\t\t\tdp[i + b] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + b]) \r\n\t\t\tif(i + c <= n ): \r\n\t\t\t\tdp[i + c] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + c]) \r\n\treturn dp[n]", "entry_point": "maximum_segments", "input": "17, 2, 1, 3", "output": "17", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "971_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032592", "code": "def maximum_segments(n, a, b, c) : \r\n\tdp = [-1] * (n + 10) \r\n\tdp[0] = 0\r\n\tfor i in range(0, n) : \r\n\t\tif (dp[i] != -1) : \r\n\t\t\tif(i + a <= n ): \r\n\t\t\t\tdp[i + a] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + a]) \r\n\t\t\tif(i + b <= n ): \r\n\t\t\t\tdp[i + b] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + b]) \r\n\t\t\tif(i + c <= n ): \r\n\t\t\t\tdp[i + c] = max(dp[i] + 1, \r\n\t\t\t\t\t\t\tdp[i + c]) \r\n\treturn dp[n]", "entry_point": "maximum_segments", "input": "18, 16, 3, 6", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "971_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032593", "code": "def concatenate_nested(test_tup1, test_tup2):\r\n  res = test_tup1 + test_tup2\r\n  return (res) ", "entry_point": "concatenate_nested", "input": "(3, 4), (5, 6)", "output": "(3, 4, 5, 6)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "972_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032594", "code": "def concatenate_nested(test_tup1, test_tup2):\r\n  res = test_tup1 + test_tup2\r\n  return (res) ", "entry_point": "concatenate_nested", "input": "(1, 2), (3, 4)", "output": "(1, 2, 3, 4)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "972_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032595", "code": "def concatenate_nested(test_tup1, test_tup2):\r\n  res = test_tup1 + test_tup2\r\n  return (res) ", "entry_point": "concatenate_nested", "input": "(4, 5), (6, 8)", "output": "(4, 5, 6, 8)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "972_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032596", "code": "def left_rotate(s,d):\r\n    tmp = s[d : ] + s[0 : d]\r\n    return tmp  ", "entry_point": "left_rotate", "input": "'python', 2", "output": "'thonpy'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "973_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032597", "code": "def left_rotate(s,d):\r\n    tmp = s[d : ] + s[0 : d]\r\n    return tmp  ", "entry_point": "left_rotate", "input": "'bigdata', 3", "output": "'databig'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "973_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032598", "code": "def left_rotate(s,d):\r\n    tmp = s[d : ] + s[0 : d]\r\n    return tmp  ", "entry_point": "left_rotate", "input": "'hadoop', 1", "output": "'adooph'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "973_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032599", "code": "def min_sum_path(A): \r\n\tmemo = [None] * len(A) \r\n\tn = len(A) - 1\r\n\tfor i in range(len(A[n])): \r\n\t\tmemo[i] = A[n][i] \r\n\tfor i in range(len(A) - 2, -1,-1): \r\n\t\tfor j in range( len(A[i])): \r\n\t\t\tmemo[j] = A[i][j] + min(memo[j], \r\n\t\t\t\t\t\t\t\t\tmemo[j + 1]) \r\n\treturn memo[0]", "entry_point": "min_sum_path", "input": "[[2], [3, 9], [1, 6, 7]]", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "974_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032600", "code": "def min_sum_path(A): \r\n\tmemo = [None] * len(A) \r\n\tn = len(A) - 1\r\n\tfor i in range(len(A[n])): \r\n\t\tmemo[i] = A[n][i] \r\n\tfor i in range(len(A) - 2, -1,-1): \r\n\t\tfor j in range( len(A[i])): \r\n\t\t\tmemo[j] = A[i][j] + min(memo[j], \r\n\t\t\t\t\t\t\t\t\tmemo[j + 1]) \r\n\treturn memo[0]", "entry_point": "min_sum_path", "input": "[[2], [3, 7], [8, 5, 6]]", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "974_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032601", "code": "def min_sum_path(A): \r\n\tmemo = [None] * len(A) \r\n\tn = len(A) - 1\r\n\tfor i in range(len(A[n])): \r\n\t\tmemo[i] = A[n][i] \r\n\tfor i in range(len(A) - 2, -1,-1): \r\n\t\tfor j in range( len(A[i])): \r\n\t\t\tmemo[j] = A[i][j] + min(memo[j], \r\n\t\t\t\t\t\t\t\t\tmemo[j + 1]) \r\n\treturn memo[0]", "entry_point": "min_sum_path", "input": "[[3], [6, 4], [5, 2, 7]]", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/train-00000-of-00001.parquet", "source_id": "974_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032602", "code": "def find_Min_Sum(num): \r\n    sum = 0\r\n    i = 2\r\n    while(i * i <= num): \r\n        while(num % i == 0): \r\n            sum += i \r\n            num /= i \r\n        i += 1\r\n    sum += num \r\n    return sum", "entry_point": "find_Min_Sum", "input": "12", "output": "7.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "511_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032603", "code": "def find_Min_Sum(num): \r\n    sum = 0\r\n    i = 2\r\n    while(i * i <= num): \r\n        while(num % i == 0): \r\n            sum += i \r\n            num /= i \r\n        i += 1\r\n    sum += num \r\n    return sum", "entry_point": "find_Min_Sum", "input": "105", "output": "15.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "511_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032604", "code": "def find_Min_Sum(num): \r\n    sum = 0\r\n    i = 2\r\n    while(i * i <= num): \r\n        while(num % i == 0): \r\n            sum += i \r\n            num /= i \r\n        i += 1\r\n    sum += num \r\n    return sum", "entry_point": "find_Min_Sum", "input": "2", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "511_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032605", "code": "def flatten(test_tuple): \r\n\tfor tup in test_tuple: \r\n\t\tif isinstance(tup, tuple): \r\n\t\t\tyield from flatten(tup) \r\n\t\telse: \r\n\t\t\tyield tup \r\ndef count_element_freq(test_tuple):\r\n  res = {}\r\n  for ele in flatten(test_tuple):\r\n    if ele not in res:\r\n      res[ele] = 0\r\n    res[ele] += 1\r\n  return (res) ", "entry_point": "count_element_freq", "input": "(5, 6, (5, 6), 7, (8, 9), 9)", "output": "{5: 2, 6: 2, 7: 1, 8: 1, 9: 2}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "512_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032606", "code": "def flatten(test_tuple): \r\n\tfor tup in test_tuple: \r\n\t\tif isinstance(tup, tuple): \r\n\t\t\tyield from flatten(tup) \r\n\t\telse: \r\n\t\t\tyield tup \r\ndef count_element_freq(test_tuple):\r\n  res = {}\r\n  for ele in flatten(test_tuple):\r\n    if ele not in res:\r\n      res[ele] = 0\r\n    res[ele] += 1\r\n  return (res) ", "entry_point": "count_element_freq", "input": "(6, 7, (6, 7), 8, (9, 10), 10)", "output": "{6: 2, 7: 2, 8: 1, 9: 1, 10: 2}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "512_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032607", "code": "def flatten(test_tuple): \r\n\tfor tup in test_tuple: \r\n\t\tif isinstance(tup, tuple): \r\n\t\t\tyield from flatten(tup) \r\n\t\telse: \r\n\t\t\tyield tup \r\ndef count_element_freq(test_tuple):\r\n  res = {}\r\n  for ele in flatten(test_tuple):\r\n    if ele not in res:\r\n      res[ele] = 0\r\n    res[ele] += 1\r\n  return (res) ", "entry_point": "count_element_freq", "input": "(7, 8, (7, 8), 9, (10, 11), 11)", "output": "{7: 2, 8: 2, 9: 1, 10: 1, 11: 2}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "512_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032608", "code": "def add_str(test_tup, K):\r\n  res = [ele for sub in test_tup for ele in (sub, K)]\r\n  return (res) ", "entry_point": "add_str", "input": "(5, 6, 7, 4, 9), 'FDF'", "output": "[5, 'FDF', 6, 'FDF', 7, 'FDF', 4, 'FDF', 9, 'FDF']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "513_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032609", "code": "def add_str(test_tup, K):\r\n  res = [ele for sub in test_tup for ele in (sub, K)]\r\n  return (res) ", "entry_point": "add_str", "input": "(7, 8, 9, 10), 'PF'", "output": "[7, 'PF', 8, 'PF', 9, 'PF', 10, 'PF']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "513_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032610", "code": "def add_str(test_tup, K):\r\n  res = [ele for sub in test_tup for ele in (sub, K)]\r\n  return (res) ", "entry_point": "add_str", "input": "(11, 14, 12, 1, 4), 'JH'", "output": "[11, 'JH', 14, 'JH', 12, 'JH', 1, 'JH', 4, 'JH']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "513_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032611", "code": "def sum_elements(test_tup):\r\n  res = sum(list(test_tup))\r\n  return (res) ", "entry_point": "sum_elements", "input": "(7, 8, 9, 1, 10, 7)", "output": "42", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "514_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032612", "code": "def sum_elements(test_tup):\r\n  res = sum(list(test_tup))\r\n  return (res) ", "entry_point": "sum_elements", "input": "(1, 2, 3, 4, 5, 6)", "output": "21", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "514_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032613", "code": "def sum_elements(test_tup):\r\n  res = sum(list(test_tup))\r\n  return (res) ", "entry_point": "sum_elements", "input": "(11, 12, 13, 45, 14)", "output": "95", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "514_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032614", "code": "def modular_sum(arr, n, m): \r\n\tif (n > m): \r\n\t\treturn True\r\n\tDP = [False for i in range(m)] \r\n\tfor i in range(n): \r\n\t\tif (DP[0]): \r\n\t\t\treturn True\r\n\t\ttemp = [False for i in range(m)] \r\n\t\tfor j in range(m): \r\n\t\t\tif (DP[j] == True): \r\n\t\t\t\tif (DP[(j + arr[i]) % m] == False): \r\n\t\t\t\t\ttemp[(j + arr[i]) % m] = True\r\n\t\tfor j in range(m): \r\n\t\t\tif (temp[j]): \r\n\t\t\t\tDP[j] = True\r\n\t\tDP[arr[i] % m] = True\r\n\treturn DP[0]", "entry_point": "modular_sum", "input": "[3, 1, 7, 5], 4, 6", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "515_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032615", "code": "def modular_sum(arr, n, m): \r\n\tif (n > m): \r\n\t\treturn True\r\n\tDP = [False for i in range(m)] \r\n\tfor i in range(n): \r\n\t\tif (DP[0]): \r\n\t\t\treturn True\r\n\t\ttemp = [False for i in range(m)] \r\n\t\tfor j in range(m): \r\n\t\t\tif (DP[j] == True): \r\n\t\t\t\tif (DP[(j + arr[i]) % m] == False): \r\n\t\t\t\t\ttemp[(j + arr[i]) % m] = True\r\n\t\tfor j in range(m): \r\n\t\t\tif (temp[j]): \r\n\t\t\t\tDP[j] = True\r\n\t\tDP[arr[i] % m] = True\r\n\treturn DP[0]", "entry_point": "modular_sum", "input": "[1, 7], 2, 5", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "515_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032616", "code": "def modular_sum(arr, n, m): \r\n\tif (n > m): \r\n\t\treturn True\r\n\tDP = [False for i in range(m)] \r\n\tfor i in range(n): \r\n\t\tif (DP[0]): \r\n\t\t\treturn True\r\n\t\ttemp = [False for i in range(m)] \r\n\t\tfor j in range(m): \r\n\t\t\tif (DP[j] == True): \r\n\t\t\t\tif (DP[(j + arr[i]) % m] == False): \r\n\t\t\t\t\ttemp[(j + arr[i]) % m] = True\r\n\t\tfor j in range(m): \r\n\t\t\tif (temp[j]): \r\n\t\t\t\tDP[j] = True\r\n\t\tDP[arr[i] % m] = True\r\n\treturn DP[0]", "entry_point": "modular_sum", "input": "[1, 6], 2, 5", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "515_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032617", "code": "def radix_sort(nums):\r\n    RADIX = 10\r\n    placement = 1\r\n    max_digit = max(nums)\r\n\r\n    while placement < max_digit:\r\n      buckets = [list() for _ in range( RADIX )]\r\n      for i in nums:\r\n        tmp = int((i / placement) % RADIX)\r\n        buckets[tmp].append(i)\r\n      a = 0\r\n      for b in range( RADIX ):\r\n        buck = buckets[b]\r\n        for i in buck:\r\n          nums[a] = i\r\n          a += 1\r\n      placement *= RADIX\r\n    return nums", "entry_point": "radix_sort", "input": "[15, 79, 25, 68, 37]", "output": "[15, 25, 37, 68, 79]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "516_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032618", "code": "def radix_sort(nums):\r\n    RADIX = 10\r\n    placement = 1\r\n    max_digit = max(nums)\r\n\r\n    while placement < max_digit:\r\n      buckets = [list() for _ in range( RADIX )]\r\n      for i in nums:\r\n        tmp = int((i / placement) % RADIX)\r\n        buckets[tmp].append(i)\r\n      a = 0\r\n      for b in range( RADIX ):\r\n        buck = buckets[b]\r\n        for i in buck:\r\n          nums[a] = i\r\n          a += 1\r\n      placement *= RADIX\r\n    return nums", "entry_point": "radix_sort", "input": "[9, 11, 8, 7, 3, 2]", "output": "[2, 3, 7, 8, 9, 11]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "516_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032619", "code": "def radix_sort(nums):\r\n    RADIX = 10\r\n    placement = 1\r\n    max_digit = max(nums)\r\n\r\n    while placement < max_digit:\r\n      buckets = [list() for _ in range( RADIX )]\r\n      for i in nums:\r\n        tmp = int((i / placement) % RADIX)\r\n        buckets[tmp].append(i)\r\n      a = 0\r\n      for b in range( RADIX ):\r\n        buck = buckets[b]\r\n        for i in buck:\r\n          nums[a] = i\r\n          a += 1\r\n      placement *= RADIX\r\n    return nums", "entry_point": "radix_sort", "input": "[36, 12, 24, 26, 29]", "output": "[12, 24, 26, 29, 36]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "516_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032620", "code": "def largest_pos(list1): \r\n    max = list1[0] \r\n    for x in list1: \r\n        if x > max : \r\n             max = x  \r\n    return max", "entry_point": "largest_pos", "input": "[1, 2, 3, 4, -1]", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "517_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032621", "code": "def largest_pos(list1): \r\n    max = list1[0] \r\n    for x in list1: \r\n        if x > max : \r\n             max = x  \r\n    return max", "entry_point": "largest_pos", "input": "[0, 1, 2, -5, -1, 6]", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "517_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032622", "code": "def largest_pos(list1): \r\n    max = list1[0] \r\n    for x in list1: \r\n        if x > max : \r\n             max = x  \r\n    return max", "entry_point": "largest_pos", "input": "[0, 0, 1, 0]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "517_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032623", "code": "import math\r\ndef sqrt_root(num):\r\n sqrt_root = math.pow(num, 0.5)\r\n return sqrt_root ", "entry_point": "sqrt_root", "input": "4", "output": "2.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "518_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032624", "code": "import math\r\ndef sqrt_root(num):\r\n sqrt_root = math.pow(num, 0.5)\r\n return sqrt_root ", "entry_point": "sqrt_root", "input": "16", "output": "4.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "518_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032625", "code": "import math\r\ndef sqrt_root(num):\r\n sqrt_root = math.pow(num, 0.5)\r\n return sqrt_root ", "entry_point": "sqrt_root", "input": "400", "output": "20.0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "518_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032626", "code": "import math\r\ndef volume_tetrahedron(num):\r\n\tvolume = (num ** 3 / (6 * math.sqrt(2)))\t\r\n\treturn round(volume, 2)", "entry_point": "volume_tetrahedron", "input": "10", "output": "117.85", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "519_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032627", "code": "import math\r\ndef volume_tetrahedron(num):\r\n\tvolume = (num ** 3 / (6 * math.sqrt(2)))\t\r\n\treturn round(volume, 2)", "entry_point": "volume_tetrahedron", "input": "15", "output": "397.75", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "519_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032628", "code": "import math\r\ndef volume_tetrahedron(num):\r\n\tvolume = (num ** 3 / (6 * math.sqrt(2)))\t\r\n\treturn round(volume, 2)", "entry_point": "volume_tetrahedron", "input": "20", "output": "942.81", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "519_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032629", "code": "def find_lcm(num1, num2): \r\n\tif(num1>num2): \r\n\t\tnum = num1 \r\n\t\tden = num2 \r\n\telse: \r\n\t\tnum = num2 \r\n\t\tden = num1 \r\n\trem = num % den \r\n\twhile (rem != 0): \r\n\t\tnum = den \r\n\t\tden = rem \r\n\t\trem = num % den \r\n\tgcd = den \r\n\tlcm = int(int(num1 * num2)/int(gcd)) \r\n\treturn lcm \r\ndef get_lcm(l):\r\n  num1 = l[0]\r\n  num2 = l[1]\r\n  lcm = find_lcm(num1, num2)\r\n  for i in range(2, len(l)):\r\n    lcm = find_lcm(lcm, l[i])\r\n  return lcm ", "entry_point": "get_lcm", "input": "[2, 7, 3, 9, 4]", "output": "252", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "520_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032630", "code": "def find_lcm(num1, num2): \r\n\tif(num1>num2): \r\n\t\tnum = num1 \r\n\t\tden = num2 \r\n\telse: \r\n\t\tnum = num2 \r\n\t\tden = num1 \r\n\trem = num % den \r\n\twhile (rem != 0): \r\n\t\tnum = den \r\n\t\tden = rem \r\n\t\trem = num % den \r\n\tgcd = den \r\n\tlcm = int(int(num1 * num2)/int(gcd)) \r\n\treturn lcm \r\ndef get_lcm(l):\r\n  num1 = l[0]\r\n  num2 = l[1]\r\n  lcm = find_lcm(num1, num2)\r\n  for i in range(2, len(l)):\r\n    lcm = find_lcm(lcm, l[i])\r\n  return lcm ", "entry_point": "get_lcm", "input": "[1, 2, 8, 3]", "output": "24", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "520_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032631", "code": "def find_lcm(num1, num2): \r\n\tif(num1>num2): \r\n\t\tnum = num1 \r\n\t\tden = num2 \r\n\telse: \r\n\t\tnum = num2 \r\n\t\tden = num1 \r\n\trem = num % den \r\n\twhile (rem != 0): \r\n\t\tnum = den \r\n\t\tden = rem \r\n\t\trem = num % den \r\n\tgcd = den \r\n\tlcm = int(int(num1 * num2)/int(gcd)) \r\n\treturn lcm \r\ndef get_lcm(l):\r\n  num1 = l[0]\r\n  num2 = l[1]\r\n  lcm = find_lcm(num1, num2)\r\n  for i in range(2, len(l)):\r\n    lcm = find_lcm(lcm, l[i])\r\n  return lcm ", "entry_point": "get_lcm", "input": "[3, 8, 4, 10, 5]", "output": "120", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "520_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032632", "code": "def check_isosceles(x,y,z):\r\n  if x!=y & y!=z & z!=x:\r\n\t   return True\r\n  else:\r\n     return False", "entry_point": "check_isosceles", "input": "6, 8, 12", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "521_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032633", "code": "def check_isosceles(x,y,z):\r\n  if x!=y & y!=z & z!=x:\r\n\t   return True\r\n  else:\r\n     return False", "entry_point": "check_isosceles", "input": "6, 6, 12", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "521_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032634", "code": "def check_isosceles(x,y,z):\r\n  if x!=y & y!=z & z!=x:\r\n\t   return True\r\n  else:\r\n     return False", "entry_point": "check_isosceles", "input": "6, 15, 20", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "521_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032635", "code": "def lbs(arr): \r\n\tn = len(arr) \r\n\tlis = [1 for i in range(n+1)] \r\n\tfor i in range(1 , n): \r\n\t\tfor j in range(0 , i): \r\n\t\t\tif ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): \r\n\t\t\t\tlis[i] = lis[j] + 1\r\n\tlds = [1 for i in range(n+1)] \r\n\tfor i in reversed(range(n-1)): \r\n\t\tfor j in reversed(range(i-1 ,n)): \r\n\t\t\tif(arr[i] > arr[j] and lds[i] < lds[j] + 1): \r\n\t\t\t\tlds[i] = lds[j] + 1\r\n\tmaximum = lis[0] + lds[0] - 1\r\n\tfor i in range(1 , n): \r\n\t\tmaximum = max((lis[i] + lds[i]-1), maximum) \r\n\treturn maximum", "entry_point": "lbs", "input": "[0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "522_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032636", "code": "def lbs(arr): \r\n\tn = len(arr) \r\n\tlis = [1 for i in range(n+1)] \r\n\tfor i in range(1 , n): \r\n\t\tfor j in range(0 , i): \r\n\t\t\tif ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): \r\n\t\t\t\tlis[i] = lis[j] + 1\r\n\tlds = [1 for i in range(n+1)] \r\n\tfor i in reversed(range(n-1)): \r\n\t\tfor j in reversed(range(i-1 ,n)): \r\n\t\t\tif(arr[i] > arr[j] and lds[i] < lds[j] + 1): \r\n\t\t\t\tlds[i] = lds[j] + 1\r\n\tmaximum = lis[0] + lds[0] - 1\r\n\tfor i in range(1 , n): \r\n\t\tmaximum = max((lis[i] + lds[i]-1), maximum) \r\n\treturn maximum", "entry_point": "lbs", "input": "[1, 11, 2, 10, 4, 5, 2, 1]", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "522_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032637", "code": "def lbs(arr): \r\n\tn = len(arr) \r\n\tlis = [1 for i in range(n+1)] \r\n\tfor i in range(1 , n): \r\n\t\tfor j in range(0 , i): \r\n\t\t\tif ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): \r\n\t\t\t\tlis[i] = lis[j] + 1\r\n\tlds = [1 for i in range(n+1)] \r\n\tfor i in reversed(range(n-1)): \r\n\t\tfor j in reversed(range(i-1 ,n)): \r\n\t\t\tif(arr[i] > arr[j] and lds[i] < lds[j] + 1): \r\n\t\t\t\tlds[i] = lds[j] + 1\r\n\tmaximum = lis[0] + lds[0] - 1\r\n\tfor i in range(1 , n): \r\n\t\tmaximum = max((lis[i] + lds[i]-1), maximum) \r\n\treturn maximum", "entry_point": "lbs", "input": "[80, 60, 30, 40, 20, 10]", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "522_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032638", "code": "def check_string(str1):\r\n    messg = [\r\n    lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.',\r\n    lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.',\r\n    lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.',\r\n    lambda str1: len(str1) >= 7                 or 'String length should be atleast 8.',]\r\n    result = [x for x in [i(str1) for i in messg] if x != True]\r\n    if not result:\r\n        result.append('Valid string.')\r\n    return result  ", "entry_point": "check_string", "input": "'python'", "output": "['String must have 1 upper case character.', 'String must have 1 number.', 'String length should be atleast 8.']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "523_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032639", "code": "def check_string(str1):\r\n    messg = [\r\n    lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.',\r\n    lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.',\r\n    lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.',\r\n    lambda str1: len(str1) >= 7                 or 'String length should be atleast 8.',]\r\n    result = [x for x in [i(str1) for i in messg] if x != True]\r\n    if not result:\r\n        result.append('Valid string.')\r\n    return result  ", "entry_point": "check_string", "input": "'123python'", "output": "['String must have 1 upper case character.']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "523_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032640", "code": "def check_string(str1):\r\n    messg = [\r\n    lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.',\r\n    lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.',\r\n    lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.',\r\n    lambda str1: len(str1) >= 7                 or 'String length should be atleast 8.',]\r\n    result = [x for x in [i(str1) for i in messg] if x != True]\r\n    if not result:\r\n        result.append('Valid string.')\r\n    return result  ", "entry_point": "check_string", "input": "'123Python'", "output": "['Valid string.']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "523_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032641", "code": "def max_sum_increasing_subsequence(arr, n): \r\n\tmax = 0\r\n\tmsis = [0 for x in range(n)] \r\n\tfor i in range(n): \r\n\t\tmsis[i] = arr[i] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(i): \r\n\t\t\tif (arr[i] > arr[j] and\r\n\t\t\t\tmsis[i] < msis[j] + arr[i]): \r\n\t\t\t\tmsis[i] = msis[j] + arr[i] \r\n\tfor i in range(n): \r\n\t\tif max < msis[i]: \r\n\t\t\tmax = msis[i] \r\n\treturn max", "entry_point": "max_sum_increasing_subsequence", "input": "[1, 101, 2, 3, 100, 4, 5], 7", "output": "106", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "524_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032642", "code": "def max_sum_increasing_subsequence(arr, n): \r\n\tmax = 0\r\n\tmsis = [0 for x in range(n)] \r\n\tfor i in range(n): \r\n\t\tmsis[i] = arr[i] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(i): \r\n\t\t\tif (arr[i] > arr[j] and\r\n\t\t\t\tmsis[i] < msis[j] + arr[i]): \r\n\t\t\t\tmsis[i] = msis[j] + arr[i] \r\n\tfor i in range(n): \r\n\t\tif max < msis[i]: \r\n\t\t\tmax = msis[i] \r\n\treturn max", "entry_point": "max_sum_increasing_subsequence", "input": "[3, 4, 5, 10], 4", "output": "22", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "524_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032643", "code": "def max_sum_increasing_subsequence(arr, n): \r\n\tmax = 0\r\n\tmsis = [0 for x in range(n)] \r\n\tfor i in range(n): \r\n\t\tmsis[i] = arr[i] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(i): \r\n\t\t\tif (arr[i] > arr[j] and\r\n\t\t\t\tmsis[i] < msis[j] + arr[i]): \r\n\t\t\t\tmsis[i] = msis[j] + arr[i] \r\n\tfor i in range(n): \r\n\t\tif max < msis[i]: \r\n\t\t\tmax = msis[i] \r\n\treturn max", "entry_point": "max_sum_increasing_subsequence", "input": "[10, 5, 4, 3], 4", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "524_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032644", "code": "def parallel_lines(line1, line2):\r\n  return line1[0]/line1[1] == line2[0]/line2[1]", "entry_point": "parallel_lines", "input": "[2, 3, 4], [2, 3, 8]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "525_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032645", "code": "def parallel_lines(line1, line2):\r\n  return line1[0]/line1[1] == line2[0]/line2[1]", "entry_point": "parallel_lines", "input": "[2, 3, 4], [4, -3, 8]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "525_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032646", "code": "def parallel_lines(line1, line2):\r\n  return line1[0]/line1[1] == line2[0]/line2[1]", "entry_point": "parallel_lines", "input": "[3, 3], [5, 5]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "525_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032647", "code": "def capitalize_first_last_letters(str1):\r\n     str1 = result = str1.title()\r\n     result =  \"\"\r\n     for word in str1.split():\r\n        result += word[:-1] + word[-1].upper() + \" \"\r\n     return result[:-1]  ", "entry_point": "capitalize_first_last_letters", "input": "'python'", "output": "'PythoN'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "526_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032648", "code": "def capitalize_first_last_letters(str1):\r\n     str1 = result = str1.title()\r\n     result =  \"\"\r\n     for word in str1.split():\r\n        result += word[:-1] + word[-1].upper() + \" \"\r\n     return result[:-1]  ", "entry_point": "capitalize_first_last_letters", "input": "'bigdata'", "output": "'BigdatA'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "526_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032649", "code": "def capitalize_first_last_letters(str1):\r\n     str1 = result = str1.title()\r\n     result =  \"\"\r\n     for word in str1.split():\r\n        result += word[:-1] + word[-1].upper() + \" \"\r\n     return result[:-1]  ", "entry_point": "capitalize_first_last_letters", "input": "'Hadoop'", "output": "'HadooP'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "526_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032650", "code": "def get_pairs_count(arr, n, sum):\r\n    count = 0 \r\n    for i in range(0, n):\r\n        for j in range(i + 1, n):\r\n            if arr[i] + arr[j] == sum:\r\n                count += 1\r\n    return count", "entry_point": "get_pairs_count", "input": "[1, 5, 7, -1, 5], 5, 6", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "527_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032651", "code": "def get_pairs_count(arr, n, sum):\r\n    count = 0 \r\n    for i in range(0, n):\r\n        for j in range(i + 1, n):\r\n            if arr[i] + arr[j] == sum:\r\n                count += 1\r\n    return count", "entry_point": "get_pairs_count", "input": "[1, 5, 7, -1], 4, 6", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "527_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032652", "code": "def get_pairs_count(arr, n, sum):\r\n    count = 0 \r\n    for i in range(0, n):\r\n        for j in range(i + 1, n):\r\n            if arr[i] + arr[j] == sum:\r\n                count += 1\r\n    return count", "entry_point": "get_pairs_count", "input": "[1, 1, 1, 1], 4, 2", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "527_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032653", "code": "def min_length(list1):\r\n   min_length = min(len(x) for x in  list1 )  \r\n   min_list = min((x) for x in   list1)\r\n   return(min_length, min_list)     ", "entry_point": "min_length", "input": "[[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]]", "output": "(1, [0])", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "528_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032654", "code": "def min_length(list1):\r\n   min_length = min(len(x) for x in  list1 )  \r\n   min_list = min((x) for x in   list1)\r\n   return(min_length, min_list)     ", "entry_point": "min_length", "input": "[[1], [5, 7], [10, 12, 14, 15]]", "output": "(1, [1])", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "528_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032655", "code": "def min_length(list1):\r\n   min_length = min(len(x) for x in  list1 )  \r\n   min_list = min((x) for x in   list1)\r\n   return(min_length, min_list)     ", "entry_point": "min_length", "input": "[[5], [15, 20, 25]]", "output": "(1, [5])", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "528_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032656", "code": "def jacobsthal_lucas(n): \r\n\tdp=[0] * (n + 1) \r\n\tdp[0] = 2\r\n\tdp[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tdp[i] = dp[i - 1] + 2 * dp[i - 2]; \r\n\treturn dp[n]", "entry_point": "jacobsthal_lucas", "input": "5", "output": "31", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "529_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032657", "code": "def jacobsthal_lucas(n): \r\n\tdp=[0] * (n + 1) \r\n\tdp[0] = 2\r\n\tdp[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tdp[i] = dp[i - 1] + 2 * dp[i - 2]; \r\n\treturn dp[n]", "entry_point": "jacobsthal_lucas", "input": "2", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "529_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032658", "code": "def jacobsthal_lucas(n): \r\n\tdp=[0] * (n + 1) \r\n\tdp[0] = 2\r\n\tdp[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tdp[i] = dp[i - 1] + 2 * dp[i - 2]; \r\n\treturn dp[n]", "entry_point": "jacobsthal_lucas", "input": "4", "output": "17", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "529_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032659", "code": "from array import array\r\ndef negative_count(nums):\r\n    n = len(nums)\r\n    n1 = 0\r\n    for x in nums:\r\n        if x < 0:\r\n            n1 += 1\r\n        else:\r\n          None\r\n    return round(n1/n,2)", "entry_point": "negative_count", "input": "[0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]", "output": "0.31", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "530_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032660", "code": "from array import array\r\ndef negative_count(nums):\r\n    n = len(nums)\r\n    n1 = 0\r\n    for x in nums:\r\n        if x < 0:\r\n            n1 += 1\r\n        else:\r\n          None\r\n    return round(n1/n,2)", "entry_point": "negative_count", "input": "[2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]", "output": "0.31", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "530_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032661", "code": "from array import array\r\ndef negative_count(nums):\r\n    n = len(nums)\r\n    n1 = 0\r\n    for x in nums:\r\n        if x < 0:\r\n            n1 += 1\r\n        else:\r\n          None\r\n    return round(n1/n,2)", "entry_point": "negative_count", "input": "[2, 4, -6, -9, 11, -12, 14, -5, 17]", "output": "0.44", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "530_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032662", "code": "import sys \r\ndef min_coins(coins, m, V): \r\n    if (V == 0): \r\n        return 0\r\n    res = sys.maxsize \r\n    for i in range(0, m): \r\n        if (coins[i] <= V): \r\n            sub_res = min_coins(coins, m, V-coins[i]) \r\n            if (sub_res != sys.maxsize and sub_res + 1 < res): \r\n                res = sub_res + 1  \r\n    return res ", "entry_point": "min_coins", "input": "[9, 6, 5, 1], 4, 11", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "531_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032663", "code": "import sys \r\ndef min_coins(coins, m, V): \r\n    if (V == 0): \r\n        return 0\r\n    res = sys.maxsize \r\n    for i in range(0, m): \r\n        if (coins[i] <= V): \r\n            sub_res = min_coins(coins, m, V-coins[i]) \r\n            if (sub_res != sys.maxsize and sub_res + 1 < res): \r\n                res = sub_res + 1  \r\n    return res ", "entry_point": "min_coins", "input": "[4, 5, 6, 7, 8, 9], 6, 9", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "531_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032664", "code": "import sys \r\ndef min_coins(coins, m, V): \r\n    if (V == 0): \r\n        return 0\r\n    res = sys.maxsize \r\n    for i in range(0, m): \r\n        if (coins[i] <= V): \r\n            sub_res = min_coins(coins, m, V-coins[i]) \r\n            if (sub_res != sys.maxsize and sub_res + 1 < res): \r\n                res = sub_res + 1  \r\n    return res ", "entry_point": "min_coins", "input": "[1, 2, 3], 3, 4", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "531_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032665", "code": "def check_permutation(str1, str2):\r\n  n1=len(str1)\r\n  n2=len(str2)\r\n  if(n1!=n2):\r\n    return False\r\n  a=sorted(str1)\r\n  str1=\" \".join(a)\r\n  b=sorted(str2)\r\n  str2=\" \".join(b)\r\n  for i in range(0, n1, 1):\r\n    if(str1[i] != str2[i]):\r\n      return False\r\n  return True", "entry_point": "check_permutation", "input": "'abc', 'cba'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "532_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032666", "code": "def check_permutation(str1, str2):\r\n  n1=len(str1)\r\n  n2=len(str2)\r\n  if(n1!=n2):\r\n    return False\r\n  a=sorted(str1)\r\n  str1=\" \".join(a)\r\n  b=sorted(str2)\r\n  str2=\" \".join(b)\r\n  for i in range(0, n1, 1):\r\n    if(str1[i] != str2[i]):\r\n      return False\r\n  return True", "entry_point": "check_permutation", "input": "'test', 'ttew'", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "532_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032667", "code": "def check_permutation(str1, str2):\r\n  n1=len(str1)\r\n  n2=len(str2)\r\n  if(n1!=n2):\r\n    return False\r\n  a=sorted(str1)\r\n  str1=\" \".join(a)\r\n  b=sorted(str2)\r\n  str2=\" \".join(b)\r\n  for i in range(0, n1, 1):\r\n    if(str1[i] != str2[i]):\r\n      return False\r\n  return True", "entry_point": "check_permutation", "input": "'xxyz', 'yxzx'", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "532_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032668", "code": "def remove_datatype(test_tuple, data_type):\r\n  res = []\r\n  for ele in test_tuple:\r\n    if not isinstance(ele, data_type):\r\n      res.append(ele)\r\n  return (res) ", "entry_point": "remove_datatype", "input": "(4, 5, 4, 7.7, 1.2), int", "output": "[7.7, 1.2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "533_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032669", "code": "def remove_datatype(test_tuple, data_type):\r\n  res = []\r\n  for ele in test_tuple:\r\n    if not isinstance(ele, data_type):\r\n      res.append(ele)\r\n  return (res) ", "entry_point": "remove_datatype", "input": "(7, 8, 9, 'SR'), str", "output": "[7, 8, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "533_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032670", "code": "def remove_datatype(test_tuple, data_type):\r\n  res = []\r\n  for ele in test_tuple:\r\n    if not isinstance(ele, data_type):\r\n      res.append(ele)\r\n  return (res) ", "entry_point": "remove_datatype", "input": "(7, 1.1, 2, 2.2), float", "output": "[7, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "533_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032671", "code": "import re\r\ndef search_literal(pattern,text):\r\n match = re.search(pattern, text)\r\n s = match.start()\r\n e = match.end()\r\n return (s, e)", "entry_point": "search_literal", "input": "'python', 'python programming language'", "output": "(0, 6)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "534_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032672", "code": "import re\r\ndef search_literal(pattern,text):\r\n match = re.search(pattern, text)\r\n s = match.start()\r\n e = match.end()\r\n return (s, e)", "entry_point": "search_literal", "input": "'programming', 'python programming language'", "output": "(7, 18)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "534_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032673", "code": "import re\r\ndef search_literal(pattern,text):\r\n match = re.search(pattern, text)\r\n s = match.start()\r\n e = match.end()\r\n return (s, e)", "entry_point": "search_literal", "input": "'language', 'python programming language'", "output": "(19, 27)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "534_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032674", "code": "def topbottom_surfacearea(r):\r\n  toporbottomarea=3.1415*r*r\r\n  return toporbottomarea", "entry_point": "topbottom_surfacearea", "input": "10", "output": "314.15000000000003", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "535_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032675", "code": "def topbottom_surfacearea(r):\r\n  toporbottomarea=3.1415*r*r\r\n  return toporbottomarea", "entry_point": "topbottom_surfacearea", "input": "5", "output": "78.53750000000001", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "535_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032676", "code": "def topbottom_surfacearea(r):\r\n  toporbottomarea=3.1415*r*r\r\n  return toporbottomarea", "entry_point": "topbottom_surfacearea", "input": "4", "output": "50.264", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "535_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032677", "code": "def nth_items(list,n):\r\n return list[::n]", "entry_point": "nth_items", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9], 2", "output": "[1, 3, 5, 7, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "536_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032678", "code": "def nth_items(list,n):\r\n return list[::n]", "entry_point": "nth_items", "input": "[10, 15, 19, 17, 16, 18], 3", "output": "[10, 17]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "536_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032679", "code": "def nth_items(list,n):\r\n return list[::n]", "entry_point": "nth_items", "input": "[14, 16, 19, 15, 17], 4", "output": "[14, 17]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "536_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032680", "code": "def first_repeated_word(str1):\r\n  temp = set()\r\n  for word in str1.split():\r\n    if word in temp:\r\n      return word;\r\n    else:\r\n      temp.add(word)\r\n  return 'None'", "entry_point": "first_repeated_word", "input": "'ab ca bc ab'", "output": "'ab'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "537_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032681", "code": "def first_repeated_word(str1):\r\n  temp = set()\r\n  for word in str1.split():\r\n    if word in temp:\r\n      return word;\r\n    else:\r\n      temp.add(word)\r\n  return 'None'", "entry_point": "first_repeated_word", "input": "'ab ca bc'", "output": "'None'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "537_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032682", "code": "def first_repeated_word(str1):\r\n  temp = set()\r\n  for word in str1.split():\r\n    if word in temp:\r\n      return word;\r\n    else:\r\n      temp.add(word)\r\n  return 'None'", "entry_point": "first_repeated_word", "input": "'ab ca bc ca ab bc'", "output": "'ca'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "537_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032683", "code": "def string_list_to_tuple(str1):\r\n    result = tuple(x for x in str1 if not x.isspace()) \r\n    return result", "entry_point": "string_list_to_tuple", "input": "'python 3.0'", "output": "('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "538_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032684", "code": "def string_list_to_tuple(str1):\r\n    result = tuple(x for x in str1 if not x.isspace()) \r\n    return result", "entry_point": "string_list_to_tuple", "input": "'bigdata'", "output": "('b', 'i', 'g', 'd', 'a', 't', 'a')", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "538_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032685", "code": "def string_list_to_tuple(str1):\r\n    result = tuple(x for x in str1 if not x.isspace()) \r\n    return result", "entry_point": "string_list_to_tuple", "input": "'language'", "output": "('l', 'a', 'n', 'g', 'u', 'a', 'g', 'e')", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "538_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032686", "code": "def basesnum_coresspondingnum(bases_num,index):\r\n  result = list(map(pow, bases_num, index))\r\n  return result", "entry_point": "basesnum_coresspondingnum", "input": "[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "539_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032687", "code": "def basesnum_coresspondingnum(bases_num,index):\r\n  result = list(map(pow, bases_num, index))\r\n  return result", "entry_point": "basesnum_coresspondingnum", "input": "[4, 8, 12, 16, 20, 24, 28], [3, 6, 9, 12, 15, 18, 21]", "output": "[64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "539_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032688", "code": "def find_Diff(arr,n): \r\n    arr.sort()  \r\n    count = 0; max_count = 0; min_count = n \r\n    for i in range(0,(n-1)): \r\n        if arr[i] == arr[i + 1]: \r\n            count += 1\r\n            continue\r\n        else: \r\n            max_count = max(max_count,count) \r\n            min_count = min(min_count,count) \r\n            count = 0\r\n    return max_count - min_count ", "entry_point": "find_Diff", "input": "[1, 1, 2, 2, 7, 8, 4, 5, 1, 4], 10", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "540_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032689", "code": "def find_Diff(arr,n): \r\n    arr.sort()  \r\n    count = 0; max_count = 0; min_count = n \r\n    for i in range(0,(n-1)): \r\n        if arr[i] == arr[i + 1]: \r\n            count += 1\r\n            continue\r\n        else: \r\n            max_count = max(max_count,count) \r\n            min_count = min(min_count,count) \r\n            count = 0\r\n    return max_count - min_count ", "entry_point": "find_Diff", "input": "[1, 7, 9, 2, 3, 3, 1, 3, 3], 9", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "540_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032690", "code": "def find_Diff(arr,n): \r\n    arr.sort()  \r\n    count = 0; max_count = 0; min_count = n \r\n    for i in range(0,(n-1)): \r\n        if arr[i] == arr[i + 1]: \r\n            count += 1\r\n            continue\r\n        else: \r\n            max_count = max(max_count,count) \r\n            min_count = min(min_count,count) \r\n            count = 0\r\n    return max_count - min_count ", "entry_point": "find_Diff", "input": "[1, 2, 1, 2], 4", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "540_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032691", "code": "import math \r\ndef get_sum(n): \r\n\tsum = 0\r\n\ti = 1\r\n\twhile i <= (math.sqrt(n)): \r\n\t\tif n%i == 0: \r\n\t\t\tif n/i == i : \r\n\t\t\t\tsum = sum + i \r\n\t\t\telse: \r\n\t\t\t\tsum = sum + i \r\n\t\t\t\tsum = sum + (n / i ) \r\n\t\ti = i + 1\r\n\tsum = sum - n \r\n\treturn sum\r\ndef check_abundant(n): \r\n\tif (get_sum(n) > n): \r\n\t\treturn True\r\n\telse: \r\n\t\treturn False", "entry_point": "check_abundant", "input": "12", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "541_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032692", "code": "import math \r\ndef get_sum(n): \r\n\tsum = 0\r\n\ti = 1\r\n\twhile i <= (math.sqrt(n)): \r\n\t\tif n%i == 0: \r\n\t\t\tif n/i == i : \r\n\t\t\t\tsum = sum + i \r\n\t\t\telse: \r\n\t\t\t\tsum = sum + i \r\n\t\t\t\tsum = sum + (n / i ) \r\n\t\ti = i + 1\r\n\tsum = sum - n \r\n\treturn sum\r\ndef check_abundant(n): \r\n\tif (get_sum(n) > n): \r\n\t\treturn True\r\n\telse: \r\n\t\treturn False", "entry_point": "check_abundant", "input": "15", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "541_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032693", "code": "import math \r\ndef get_sum(n): \r\n\tsum = 0\r\n\ti = 1\r\n\twhile i <= (math.sqrt(n)): \r\n\t\tif n%i == 0: \r\n\t\t\tif n/i == i : \r\n\t\t\t\tsum = sum + i \r\n\t\t\telse: \r\n\t\t\t\tsum = sum + i \r\n\t\t\t\tsum = sum + (n / i ) \r\n\t\ti = i + 1\r\n\tsum = sum - n \r\n\treturn sum\r\ndef check_abundant(n): \r\n\tif (get_sum(n) > n): \r\n\t\treturn True\r\n\telse: \r\n\t\treturn False", "entry_point": "check_abundant", "input": "18", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "541_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032694", "code": "import re\r\ndef fill_spaces(text):\r\n  return (re.sub(\"[ ,.]\", \":\", text))", "entry_point": "fill_spaces", "input": "'Boult Curve Wireless Neckband'", "output": "'Boult:Curve:Wireless:Neckband'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "542_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032695", "code": "import re\r\ndef fill_spaces(text):\r\n  return (re.sub(\"[ ,.]\", \":\", text))", "entry_point": "fill_spaces", "input": "'Stereo Sound Sweatproof'", "output": "'Stereo:Sound:Sweatproof'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "542_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032696", "code": "import re\r\ndef fill_spaces(text):\r\n  return (re.sub(\"[ ,.]\", \":\", text))", "entry_point": "fill_spaces", "input": "'Probass Curve Audio'", "output": "'Probass:Curve:Audio'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "542_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032697", "code": "def count_digits(num1,num2):\r\n    number=num1+num2\r\n    count = 0\r\n    while(number > 0):\r\n        number = number // 10\r\n        count = count + 1\r\n    return count", "entry_point": "count_digits", "input": "9875, 10", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "543_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032698", "code": "def count_digits(num1,num2):\r\n    number=num1+num2\r\n    count = 0\r\n    while(number > 0):\r\n        number = number // 10\r\n        count = count + 1\r\n    return count", "entry_point": "count_digits", "input": "98759853034, 100", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "543_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032699", "code": "def count_digits(num1,num2):\r\n    number=num1+num2\r\n    count = 0\r\n    while(number > 0):\r\n        number = number // 10\r\n        count = count + 1\r\n    return count", "entry_point": "count_digits", "input": "1234567, 500", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "543_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032700", "code": "def flatten_tuple(test_list):\r\n  res = ' '.join([idx for tup in test_list for idx in tup])\r\n  return (res) ", "entry_point": "flatten_tuple", "input": "[('1', '4', '6'), ('5', '8'), ('2', '9'), ('1', '10')]", "output": "'1 4 6 5 8 2 9 1 10'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "544_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032701", "code": "def flatten_tuple(test_list):\r\n  res = ' '.join([idx for tup in test_list for idx in tup])\r\n  return (res) ", "entry_point": "flatten_tuple", "input": "[('2', '3', '4'), ('6', '9'), ('3', '2'), ('2', '11')]", "output": "'2 3 4 6 9 3 2 2 11'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "544_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032702", "code": "def flatten_tuple(test_list):\r\n  res = ' '.join([idx for tup in test_list for idx in tup])\r\n  return (res) ", "entry_point": "flatten_tuple", "input": "[('14', '21', '9'), ('24', '19'), ('12', '29'), ('23', '17')]", "output": "'14 21 9 24 19 12 29 23 17'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "544_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032703", "code": "def take_L_and_F_set_bits(n) : \r\n    n = n | n >> 1\r\n    n = n | n >> 2\r\n    n = n | n >> 4\r\n    n = n | n >> 8\r\n    n = n | n >> 16 \r\n    return ((n + 1) >> 1) + 1      \r\ndef toggle_F_and_L_bits(n) :  \r\n    if (n == 1) : \r\n        return 0 \r\n    return n ^ take_L_and_F_set_bits(n) ", "entry_point": "toggle_F_and_L_bits", "input": "10", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "545_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032704", "code": "def take_L_and_F_set_bits(n) : \r\n    n = n | n >> 1\r\n    n = n | n >> 2\r\n    n = n | n >> 4\r\n    n = n | n >> 8\r\n    n = n | n >> 16 \r\n    return ((n + 1) >> 1) + 1      \r\ndef toggle_F_and_L_bits(n) :  \r\n    if (n == 1) : \r\n        return 0 \r\n    return n ^ take_L_and_F_set_bits(n) ", "entry_point": "toggle_F_and_L_bits", "input": "15", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "545_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032705", "code": "def take_L_and_F_set_bits(n) : \r\n    n = n | n >> 1\r\n    n = n | n >> 2\r\n    n = n | n >> 4\r\n    n = n | n >> 8\r\n    n = n | n >> 16 \r\n    return ((n + 1) >> 1) + 1      \r\ndef toggle_F_and_L_bits(n) :  \r\n    if (n == 1) : \r\n        return 0 \r\n    return n ^ take_L_and_F_set_bits(n) ", "entry_point": "toggle_F_and_L_bits", "input": "20", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "545_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032706", "code": "def last_occurence_char(string,char):\r\n flag = -1\r\n for i in range(len(string)):\r\n     if(string[i] == char):\r\n         flag = i\r\n if(flag == -1):\r\n    return None\r\n else:\r\n    return flag + 1", "entry_point": "last_occurence_char", "input": "'hello world', 'l'", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "546_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032707", "code": "def last_occurence_char(string,char):\r\n flag = -1\r\n for i in range(len(string)):\r\n     if(string[i] == char):\r\n         flag = i\r\n if(flag == -1):\r\n    return None\r\n else:\r\n    return flag + 1", "entry_point": "last_occurence_char", "input": "'language', 'g'", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "546_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032708", "code": "def Total_Hamming_Distance(n):   \r\n    i = 1\r\n    sum = 0\r\n    while (n // i > 0):  \r\n        sum = sum + n // i  \r\n        i = i * 2     \r\n    return sum", "entry_point": "Total_Hamming_Distance", "input": "4", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "547_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032709", "code": "def Total_Hamming_Distance(n):   \r\n    i = 1\r\n    sum = 0\r\n    while (n // i > 0):  \r\n        sum = sum + n // i  \r\n        i = i * 2     \r\n    return sum", "entry_point": "Total_Hamming_Distance", "input": "2", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "547_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032710", "code": "def Total_Hamming_Distance(n):   \r\n    i = 1\r\n    sum = 0\r\n    while (n // i > 0):  \r\n        sum = sum + n // i  \r\n        i = i * 2     \r\n    return sum", "entry_point": "Total_Hamming_Distance", "input": "5", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "547_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032711", "code": "def longest_increasing_subsequence(arr): \r\n\tn = len(arr) \r\n\tlongest_increasing_subsequence = [1]*n \r\n\tfor i in range (1 , n): \r\n\t\tfor j in range(0 , i): \r\n\t\t\tif arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : \r\n\t\t\t\tlongest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1\r\n\tmaximum = 0\r\n\tfor i in range(n): \r\n\t\tmaximum = max(maximum , longest_increasing_subsequence[i]) \r\n\treturn maximum", "entry_point": "longest_increasing_subsequence", "input": "[10, 22, 9, 33, 21, 50, 41, 60]", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "548_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032712", "code": "def longest_increasing_subsequence(arr): \r\n\tn = len(arr) \r\n\tlongest_increasing_subsequence = [1]*n \r\n\tfor i in range (1 , n): \r\n\t\tfor j in range(0 , i): \r\n\t\t\tif arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : \r\n\t\t\t\tlongest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1\r\n\tmaximum = 0\r\n\tfor i in range(n): \r\n\t\tmaximum = max(maximum , longest_increasing_subsequence[i]) \r\n\treturn maximum", "entry_point": "longest_increasing_subsequence", "input": "[3, 10, 2, 1, 20]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "548_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032713", "code": "def longest_increasing_subsequence(arr): \r\n\tn = len(arr) \r\n\tlongest_increasing_subsequence = [1]*n \r\n\tfor i in range (1 , n): \r\n\t\tfor j in range(0 , i): \r\n\t\t\tif arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : \r\n\t\t\t\tlongest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1\r\n\tmaximum = 0\r\n\tfor i in range(n): \r\n\t\tmaximum = max(maximum , longest_increasing_subsequence[i]) \r\n\treturn maximum", "entry_point": "longest_increasing_subsequence", "input": "[50, 3, 10, 7, 40, 80]", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "548_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032714", "code": "def odd_Num_Sum(n) : \r\n    j = 0\r\n    sm = 0\r\n    for i in range(1,n+1) : \r\n        j = (2*i-1) \r\n        sm = sm + (j*j*j*j*j)     \r\n    return sm ", "entry_point": "odd_Num_Sum", "input": "1", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "549_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032715", "code": "def odd_Num_Sum(n) : \r\n    j = 0\r\n    sm = 0\r\n    for i in range(1,n+1) : \r\n        j = (2*i-1) \r\n        sm = sm + (j*j*j*j*j)     \r\n    return sm ", "entry_point": "odd_Num_Sum", "input": "2", "output": "244", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "549_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032716", "code": "def odd_Num_Sum(n) : \r\n    j = 0\r\n    sm = 0\r\n    for i in range(1,n+1) : \r\n        j = (2*i-1) \r\n        sm = sm + (j*j*j*j*j)     \r\n    return sm ", "entry_point": "odd_Num_Sum", "input": "3", "output": "3369", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "549_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032717", "code": "def find_Max(arr,low,high): \r\n    if (high < low): \r\n        return arr[0] \r\n    if (high == low): \r\n        return arr[low] \r\n    mid = low + (high - low) // 2 \r\n    if (mid < high and arr[mid + 1] < arr[mid]): \r\n        return arr[mid] \r\n    if (mid > low and arr[mid] < arr[mid - 1]): \r\n        return arr[mid - 1]  \r\n    if (arr[low] > arr[mid]): \r\n        return find_Max(arr,low,mid - 1) \r\n    else: \r\n        return find_Max(arr,mid + 1,high) ", "entry_point": "find_Max", "input": "[2, 3, 5, 6, 9], 0, 4", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "550_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032718", "code": "def find_Max(arr,low,high): \r\n    if (high < low): \r\n        return arr[0] \r\n    if (high == low): \r\n        return arr[low] \r\n    mid = low + (high - low) // 2 \r\n    if (mid < high and arr[mid + 1] < arr[mid]): \r\n        return arr[mid] \r\n    if (mid > low and arr[mid] < arr[mid - 1]): \r\n        return arr[mid - 1]  \r\n    if (arr[low] > arr[mid]): \r\n        return find_Max(arr,low,mid - 1) \r\n    else: \r\n        return find_Max(arr,mid + 1,high) ", "entry_point": "find_Max", "input": "[3, 4, 5, 2, 1], 0, 4", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "550_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032719", "code": "def find_Max(arr,low,high): \r\n    if (high < low): \r\n        return arr[0] \r\n    if (high == low): \r\n        return arr[low] \r\n    mid = low + (high - low) // 2 \r\n    if (mid < high and arr[mid + 1] < arr[mid]): \r\n        return arr[mid] \r\n    if (mid > low and arr[mid] < arr[mid - 1]): \r\n        return arr[mid - 1]  \r\n    if (arr[low] > arr[mid]): \r\n        return find_Max(arr,low,mid - 1) \r\n    else: \r\n        return find_Max(arr,mid + 1,high) ", "entry_point": "find_Max", "input": "[1, 2, 3], 0, 2", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "550_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032720", "code": "def extract_column(list1, n):\r\n   result = [i.pop(n) for i in list1]\r\n   return result ", "entry_point": "extract_column", "input": "[[1, 2, 3], [2, 4, 5], [1, 1, 1]], 0", "output": "[1, 2, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "551_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032721", "code": "def extract_column(list1, n):\r\n   result = [i.pop(n) for i in list1]\r\n   return result ", "entry_point": "extract_column", "input": "[[1, 2, 3], [-2, 4, -5], [1, -1, 1]], 2", "output": "[3, -5, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "551_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032722", "code": "def extract_column(list1, n):\r\n   result = [i.pop(n) for i in list1]\r\n   return result ", "entry_point": "extract_column", "input": "[[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], 0", "output": "[1, 5, 1, 13, 5, 9]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "551_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032723", "code": "def Seq_Linear(seq_nums):\r\n  seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))]\r\n  if len(set(seq_nums)) == 1: \r\n    return \"Linear Sequence\"\r\n  else:\r\n    return \"Non Linear Sequence\"", "entry_point": "Seq_Linear", "input": "[0, 2, 4, 6, 8, 10]", "output": "'Linear Sequence'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "552_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032724", "code": "def Seq_Linear(seq_nums):\r\n  seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))]\r\n  if len(set(seq_nums)) == 1: \r\n    return \"Linear Sequence\"\r\n  else:\r\n    return \"Non Linear Sequence\"", "entry_point": "Seq_Linear", "input": "[1, 2, 3]", "output": "'Linear Sequence'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "552_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032725", "code": "def Seq_Linear(seq_nums):\r\n  seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))]\r\n  if len(set(seq_nums)) == 1: \r\n    return \"Linear Sequence\"\r\n  else:\r\n    return \"Non Linear Sequence\"", "entry_point": "Seq_Linear", "input": "[1, 5, 2]", "output": "'Non Linear Sequence'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "552_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032726", "code": "def tuple_to_float(test_tup):\r\n  res = float('.'.join(str(ele) for ele in test_tup))\r\n  return (res) ", "entry_point": "tuple_to_float", "input": "(4, 56)", "output": "4.56", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "553_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032727", "code": "def tuple_to_float(test_tup):\r\n  res = float('.'.join(str(ele) for ele in test_tup))\r\n  return (res) ", "entry_point": "tuple_to_float", "input": "(7, 256)", "output": "7.256", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "553_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032728", "code": "def tuple_to_float(test_tup):\r\n  res = float('.'.join(str(ele) for ele in test_tup))\r\n  return (res) ", "entry_point": "tuple_to_float", "input": "(8, 123)", "output": "8.123", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "553_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032729", "code": "def Split(list): \r\n    od_li = [] \r\n    for i in list: \r\n        if (i % 2 != 0): \r\n            od_li.append(i)  \r\n    return od_li", "entry_point": "Split", "input": "[1, 2, 3, 4, 5, 6]", "output": "[1, 3, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "554_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032730", "code": "def Split(list): \r\n    od_li = [] \r\n    for i in list: \r\n        if (i % 2 != 0): \r\n            od_li.append(i)  \r\n    return od_li", "entry_point": "Split", "input": "[10, 11, 12, 13]", "output": "[11, 13]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "554_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032731", "code": "def Split(list): \r\n    od_li = [] \r\n    for i in list: \r\n        if (i % 2 != 0): \r\n            od_li.append(i)  \r\n    return od_li", "entry_point": "Split", "input": "[7, 8, 9, 1]", "output": "[7, 9, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "554_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032732", "code": "def difference(n) :  \r\n    S = (n*(n + 1))//2;  \r\n    res = S*(S-1);  \r\n    return res;  ", "entry_point": "difference", "input": "3", "output": "30", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "555_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032733", "code": "def difference(n) :  \r\n    S = (n*(n + 1))//2;  \r\n    res = S*(S-1);  \r\n    return res;  ", "entry_point": "difference", "input": "5", "output": "210", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "555_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032734", "code": "def difference(n) :  \r\n    S = (n*(n + 1))//2;  \r\n    res = S*(S-1);  \r\n    return res;  ", "entry_point": "difference", "input": "2", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "555_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032735", "code": "def find_Odd_Pair(A,N) : \r\n    oddPair = 0\r\n    for i in range(0,N) :  \r\n        for j in range(i+1,N) :  \r\n            if ((A[i] ^ A[j]) % 2 != 0):  \r\n                oddPair+=1  \r\n    return oddPair  ", "entry_point": "find_Odd_Pair", "input": "[5, 4, 7, 2, 1], 5", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "556_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032736", "code": "def find_Odd_Pair(A,N) : \r\n    oddPair = 0\r\n    for i in range(0,N) :  \r\n        for j in range(i+1,N) :  \r\n            if ((A[i] ^ A[j]) % 2 != 0):  \r\n                oddPair+=1  \r\n    return oddPair  ", "entry_point": "find_Odd_Pair", "input": "[7, 2, 8, 1, 0, 5, 11], 7", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "556_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032737", "code": "def find_Odd_Pair(A,N) : \r\n    oddPair = 0\r\n    for i in range(0,N) :  \r\n        for j in range(i+1,N) :  \r\n            if ((A[i] ^ A[j]) % 2 != 0):  \r\n                oddPair+=1  \r\n    return oddPair  ", "entry_point": "find_Odd_Pair", "input": "[1, 2, 3], 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "556_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032738", "code": "def toggle_string(string):\r\n string1 = string.swapcase()\r\n return string1", "entry_point": "toggle_string", "input": "'Python'", "output": "'pYTHON'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "557_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032739", "code": "def toggle_string(string):\r\n string1 = string.swapcase()\r\n return string1", "entry_point": "toggle_string", "input": "'Pangram'", "output": "'pANGRAM'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "557_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032740", "code": "def toggle_string(string):\r\n string1 = string.swapcase()\r\n return string1", "entry_point": "toggle_string", "input": "'LIttLE'", "output": "'liTTle'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "557_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032741", "code": "def digit_distance_nums(n1, n2):\r\n         return sum(map(int,str(abs(n1-n2))))", "entry_point": "digit_distance_nums", "input": "1, 2", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "558_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032742", "code": "def digit_distance_nums(n1, n2):\r\n         return sum(map(int,str(abs(n1-n2))))", "entry_point": "digit_distance_nums", "input": "23, 56", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "558_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032743", "code": "def digit_distance_nums(n1, n2):\r\n         return sum(map(int,str(abs(n1-n2))))", "entry_point": "digit_distance_nums", "input": "123, 256", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "558_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032744", "code": "def max_sub_array_sum(a, size):\r\n  max_so_far = 0\r\n  max_ending_here = 0\r\n  for i in range(0, size):\r\n    max_ending_here = max_ending_here + a[i]\r\n    if max_ending_here < 0:\r\n      max_ending_here = 0\r\n    elif (max_so_far < max_ending_here):\r\n      max_so_far = max_ending_here\r\n  return max_so_far", "entry_point": "max_sub_array_sum", "input": "[-2, -3, 4, -1, -2, 1, 5, -3], 8", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "559_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032745", "code": "def max_sub_array_sum(a, size):\r\n  max_so_far = 0\r\n  max_ending_here = 0\r\n  for i in range(0, size):\r\n    max_ending_here = max_ending_here + a[i]\r\n    if max_ending_here < 0:\r\n      max_ending_here = 0\r\n    elif (max_so_far < max_ending_here):\r\n      max_so_far = max_ending_here\r\n  return max_so_far", "entry_point": "max_sub_array_sum", "input": "[-3, -4, 5, -2, -3, 2, 6, -4], 8", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "559_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032746", "code": "def max_sub_array_sum(a, size):\r\n  max_so_far = 0\r\n  max_ending_here = 0\r\n  for i in range(0, size):\r\n    max_ending_here = max_ending_here + a[i]\r\n    if max_ending_here < 0:\r\n      max_ending_here = 0\r\n    elif (max_so_far < max_ending_here):\r\n      max_so_far = max_ending_here\r\n  return max_so_far", "entry_point": "max_sub_array_sum", "input": "[-4, -5, 6, -3, -4, 3, 7, -5], 8", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "559_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032747", "code": "def union_elements(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1 + test_tup2))\r\n  return (res) ", "entry_point": "union_elements", "input": "(3, 4, 5, 6), (5, 7, 4, 10)", "output": "(3, 4, 5, 6, 7, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "560_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032748", "code": "def union_elements(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1 + test_tup2))\r\n  return (res) ", "entry_point": "union_elements", "input": "(1, 2, 3, 4), (3, 4, 5, 6)", "output": "(1, 2, 3, 4, 5, 6)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "560_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032749", "code": "def union_elements(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1 + test_tup2))\r\n  return (res) ", "entry_point": "union_elements", "input": "(11, 12, 13, 14), (13, 15, 16, 17)", "output": "(11, 12, 13, 14, 15, 16, 17)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "560_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032750", "code": "def assign_elements(test_list):\r\n  res = dict()\r\n  for key, val in test_list:\r\n    res.setdefault(val, [])\r\n    res.setdefault(key, []).append(val)\r\n  return (res) ", "entry_point": "assign_elements", "input": "[(5, 3), (7, 5), (2, 7), (3, 8), (8, 4)]", "output": "{3: [8], 5: [3], 7: [5], 2: [7], 8: [4], 4: []}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "561_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032751", "code": "def assign_elements(test_list):\r\n  res = dict()\r\n  for key, val in test_list:\r\n    res.setdefault(val, [])\r\n    res.setdefault(key, []).append(val)\r\n  return (res) ", "entry_point": "assign_elements", "input": "[(6, 4), (9, 4), (3, 8), (4, 9), (9, 5)]", "output": "{4: [9], 6: [4], 9: [4, 5], 8: [], 3: [8], 5: []}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "561_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032752", "code": "def assign_elements(test_list):\r\n  res = dict()\r\n  for key, val in test_list:\r\n    res.setdefault(val, [])\r\n    res.setdefault(key, []).append(val)\r\n  return (res) ", "entry_point": "assign_elements", "input": "[(6, 2), (6, 8), (4, 9), (4, 9), (3, 7)]", "output": "{2: [], 6: [2, 8], 8: [], 9: [], 4: [9, 9], 7: [], 3: [7]}", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "561_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032753", "code": "def Find_Max_Length(lst):  \r\n    maxLength = max(len(x) for x in lst )\r\n    return maxLength ", "entry_point": "Find_Max_Length", "input": "[[1], [1, 4], [5, 6, 7, 8]]", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "562_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032754", "code": "def Find_Max_Length(lst):  \r\n    maxLength = max(len(x) for x in lst )\r\n    return maxLength ", "entry_point": "Find_Max_Length", "input": "[[0, 1], [2, 2], [3, 2, 1]]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "562_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032755", "code": "def Find_Max_Length(lst):  \r\n    maxLength = max(len(x) for x in lst )\r\n    return maxLength ", "entry_point": "Find_Max_Length", "input": "[[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "562_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032756", "code": "import re\r\ndef extract_values(text):\r\n return (re.findall(r'\"(.*?)\"', text))", "entry_point": "extract_values", "input": "'\"Python\", \"PHP\", \"Java\"'", "output": "['Python', 'PHP', 'Java']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "563_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032757", "code": "import re\r\ndef extract_values(text):\r\n return (re.findall(r'\"(.*?)\"', text))", "entry_point": "extract_values", "input": "'\"python\",\"program\",\"language\"'", "output": "['python', 'program', 'language']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "563_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032758", "code": "import re\r\ndef extract_values(text):\r\n return (re.findall(r'\"(.*?)\"', text))", "entry_point": "extract_values", "input": "'\"red\",\"blue\",\"green\",\"yellow\"'", "output": "['red', 'blue', 'green', 'yellow']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "563_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032759", "code": "def count_Pairs(arr,n): \r\n    cnt = 0; \r\n    for i in range(n): \r\n        for j in range(i + 1,n): \r\n            if (arr[i] != arr[j]): \r\n                cnt += 1; \r\n    return cnt; ", "entry_point": "count_Pairs", "input": "[1, 2, 1], 3", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "564_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032760", "code": "def count_Pairs(arr,n): \r\n    cnt = 0; \r\n    for i in range(n): \r\n        for j in range(i + 1,n): \r\n            if (arr[i] != arr[j]): \r\n                cnt += 1; \r\n    return cnt; ", "entry_point": "count_Pairs", "input": "[1, 1, 1, 1], 4", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "564_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032761", "code": "def count_Pairs(arr,n): \r\n    cnt = 0; \r\n    for i in range(n): \r\n        for j in range(i + 1,n): \r\n            if (arr[i] != arr[j]): \r\n                cnt += 1; \r\n    return cnt; ", "entry_point": "count_Pairs", "input": "[1, 2, 3, 4, 5], 5", "output": "10", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "564_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032762", "code": "def split(word): \r\n    return [char for char in word] ", "entry_point": "split", "input": "'python'", "output": "['p', 'y', 't', 'h', 'o', 'n']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "565_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032763", "code": "def split(word): \r\n    return [char for char in word] ", "entry_point": "split", "input": "'Name'", "output": "['N', 'a', 'm', 'e']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "565_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032764", "code": "def split(word): \r\n    return [char for char in word] ", "entry_point": "split", "input": "'program'", "output": "['p', 'r', 'o', 'g', 'r', 'a', 'm']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "565_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032765", "code": "def sum_digits(n):\r\n  if n == 0:\r\n    return 0\r\n  else:\r\n    return n % 10 + sum_digits(int(n / 10))", "entry_point": "sum_digits", "input": "345", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "566_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032766", "code": "def sum_digits(n):\r\n  if n == 0:\r\n    return 0\r\n  else:\r\n    return n % 10 + sum_digits(int(n / 10))", "entry_point": "sum_digits", "input": "12", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "566_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032767", "code": "def sum_digits(n):\r\n  if n == 0:\r\n    return 0\r\n  else:\r\n    return n % 10 + sum_digits(int(n / 10))", "entry_point": "sum_digits", "input": "97", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "566_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032768", "code": "def issort_list(list1):\r\n    result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1))\r\n    return result", "entry_point": "issort_list", "input": "[1, 2, 4, 6, 8, 10, 12, 14, 16, 17]", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "567_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032769", "code": "def issort_list(list1):\r\n    result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1))\r\n    return result", "entry_point": "issort_list", "input": "[1, 2, 4, 6, 8, 10, 12, 14, 20, 17]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "567_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032770", "code": "def issort_list(list1):\r\n    result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1))\r\n    return result", "entry_point": "issort_list", "input": "[1, 2, 4, 6, 8, 10, 15, 14, 20]", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "567_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032771", "code": "def empty_list(length):\r\n empty_list = [{} for _ in range(length)]\r\n return empty_list", "entry_point": "empty_list", "input": "5", "output": "[{}, {}, {}, {}, {}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "568_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032772", "code": "def empty_list(length):\r\n empty_list = [{} for _ in range(length)]\r\n return empty_list", "entry_point": "empty_list", "input": "6", "output": "[{}, {}, {}, {}, {}, {}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "568_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032773", "code": "def empty_list(length):\r\n empty_list = [{} for _ in range(length)]\r\n return empty_list", "entry_point": "empty_list", "input": "7", "output": "[{}, {}, {}, {}, {}, {}, {}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "568_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032774", "code": "def sort_sublists(list1):\r\n    result = list(map(sorted,list1)) \r\n    return result", "entry_point": "sort_sublists", "input": "[['green', 'orange'], ['black', 'white'], ['white', 'black', 'orange']]", "output": "[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "569_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032775", "code": "def sort_sublists(list1):\r\n    result = list(map(sorted,list1)) \r\n    return result", "entry_point": "sort_sublists", "input": "[['green', 'orange'], ['black'], ['green', 'orange'], ['white']]", "output": "[['green', 'orange'], ['black'], ['green', 'orange'], ['white']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "569_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032776", "code": "def sort_sublists(list1):\r\n    result = list(map(sorted,list1)) \r\n    return result", "entry_point": "sort_sublists", "input": "[['a', 'b'], ['d', 'c'], ['g', 'h'], ['f', 'e']]", "output": "[['a', 'b'], ['c', 'd'], ['g', 'h'], ['e', 'f']]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "569_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032777", "code": "def remove_words(list1, charlist):\r\n    new_list = []\r\n    for line in list1:\r\n        new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])])\r\n        new_list.append(new_words)\r\n    return new_list", "entry_point": "remove_words", "input": "['Red color', 'Orange#', 'Green', 'Orange @', 'White'], ['#', 'color', '@']", "output": "['Red', '', 'Green', 'Orange', 'White']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "570_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032778", "code": "def remove_words(list1, charlist):\r\n    new_list = []\r\n    for line in list1:\r\n        new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])])\r\n        new_list.append(new_words)\r\n    return new_list", "entry_point": "remove_words", "input": "['Red &', 'Orange+', 'Green', 'Orange @', 'White'], ['&', '+', '@']", "output": "['Red', '', 'Green', 'Orange', 'White']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "570_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032779", "code": "def remove_words(list1, charlist):\r\n    new_list = []\r\n    for line in list1:\r\n        new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])])\r\n        new_list.append(new_words)\r\n    return new_list", "entry_point": "remove_words", "input": "['Red &', 'Orange+', 'Green', 'Orange @', 'White'], ['@']", "output": "['Red &', 'Orange+', 'Green', 'Orange', 'White']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "570_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032780", "code": "def max_sum_pair_diff_lessthan_K(arr, N, K): \r\n\tarr.sort() \r\n\tdp = [0] * N \r\n\tdp[0] = 0\r\n\tfor i in range(1, N): \r\n\t\tdp[i] = dp[i-1] \r\n\t\tif (arr[i] - arr[i-1] < K): \r\n\t\t\tif (i >= 2): \r\n\t\t\t\tdp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); \r\n\t\t\telse: \r\n\t\t\t\tdp[i] = max(dp[i], arr[i] + arr[i-1]); \r\n\treturn dp[N - 1]", "entry_point": "max_sum_pair_diff_lessthan_K", "input": "[3, 5, 10, 15, 17, 12, 9], 7, 4", "output": "62", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "571_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032781", "code": "def max_sum_pair_diff_lessthan_K(arr, N, K): \r\n\tarr.sort() \r\n\tdp = [0] * N \r\n\tdp[0] = 0\r\n\tfor i in range(1, N): \r\n\t\tdp[i] = dp[i-1] \r\n\t\tif (arr[i] - arr[i-1] < K): \r\n\t\t\tif (i >= 2): \r\n\t\t\t\tdp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); \r\n\t\t\telse: \r\n\t\t\t\tdp[i] = max(dp[i], arr[i] + arr[i-1]); \r\n\treturn dp[N - 1]", "entry_point": "max_sum_pair_diff_lessthan_K", "input": "[5, 15, 10, 300], 4, 12", "output": "25", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "571_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032782", "code": "def max_sum_pair_diff_lessthan_K(arr, N, K): \r\n\tarr.sort() \r\n\tdp = [0] * N \r\n\tdp[0] = 0\r\n\tfor i in range(1, N): \r\n\t\tdp[i] = dp[i-1] \r\n\t\tif (arr[i] - arr[i-1] < K): \r\n\t\t\tif (i >= 2): \r\n\t\t\t\tdp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); \r\n\t\t\telse: \r\n\t\t\t\tdp[i] = max(dp[i], arr[i] + arr[i-1]); \r\n\treturn dp[N - 1]", "entry_point": "max_sum_pair_diff_lessthan_K", "input": "[1, 2, 3, 4, 5, 6], 6, 6", "output": "21", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "571_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032783", "code": "def two_unique_nums(nums):\r\n  return [i for i in nums if nums.count(i)==1]", "entry_point": "two_unique_nums", "input": "[1, 2, 3, 2, 3, 4, 5]", "output": "[1, 4, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "572_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032784", "code": "def two_unique_nums(nums):\r\n  return [i for i in nums if nums.count(i)==1]", "entry_point": "two_unique_nums", "input": "[1, 2, 3, 2, 4, 5]", "output": "[1, 3, 4, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "572_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032785", "code": "def two_unique_nums(nums):\r\n  return [i for i in nums if nums.count(i)==1]", "entry_point": "two_unique_nums", "input": "[1, 2, 3, 4, 5]", "output": "[1, 2, 3, 4, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "572_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032786", "code": "def unique_product(list_data):\r\n    temp = list(set(list_data))\r\n    p = 1\r\n    for i in temp:\r\n        p *= i\r\n    return p", "entry_point": "unique_product", "input": "[10, 20, 30, 40, 20, 50, 60, 40]", "output": "720000000", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "573_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032787", "code": "def unique_product(list_data):\r\n    temp = list(set(list_data))\r\n    p = 1\r\n    for i in temp:\r\n        p *= i\r\n    return p", "entry_point": "unique_product", "input": "[1, 2, 3, 1]", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "573_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032788", "code": "def unique_product(list_data):\r\n    temp = list(set(list_data))\r\n    p = 1\r\n    for i in temp:\r\n        p *= i\r\n    return p", "entry_point": "unique_product", "input": "[7, 8, 9, 0, 1, 1]", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "573_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032789", "code": "def surfacearea_cylinder(r,h):\r\n  surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h))\r\n  return surfacearea", "entry_point": "surfacearea_cylinder", "input": "10, 5", "output": "942.45", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "574_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032790", "code": "def surfacearea_cylinder(r,h):\r\n  surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h))\r\n  return surfacearea", "entry_point": "surfacearea_cylinder", "input": "4, 5", "output": "226.18800000000002", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "574_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032791", "code": "def surfacearea_cylinder(r,h):\r\n  surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h))\r\n  return surfacearea", "entry_point": "surfacearea_cylinder", "input": "4, 10", "output": "351.848", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "574_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032792", "code": "def count_no (A,N,L,R): \r\n    count = 0\r\n    for i in range (L,R + 1): \r\n        if (i % A != 0): \r\n            count += 1\r\n        if (count == N): \r\n            break\r\n    return (i) ", "entry_point": "count_no", "input": "2, 3, 1, 10", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "575_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032793", "code": "def count_no (A,N,L,R): \r\n    count = 0\r\n    for i in range (L,R + 1): \r\n        if (i % A != 0): \r\n            count += 1\r\n        if (count == N): \r\n            break\r\n    return (i) ", "entry_point": "count_no", "input": "3, 6, 4, 20", "output": "11", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "575_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032794", "code": "def count_no (A,N,L,R): \r\n    count = 0\r\n    for i in range (L,R + 1): \r\n        if (i % A != 0): \r\n            count += 1\r\n        if (count == N): \r\n            break\r\n    return (i) ", "entry_point": "count_no", "input": "5, 10, 4, 20", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "575_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032795", "code": "def is_Sub_Array(A,B,n,m): \r\n    i = 0; j = 0; \r\n    while (i < n and j < m):  \r\n        if (A[i] == B[j]): \r\n            i += 1; \r\n            j += 1; \r\n            if (j == m): \r\n                return True;  \r\n        else: \r\n            i = i - j + 1; \r\n            j = 0;       \r\n    return False; ", "entry_point": "is_Sub_Array", "input": "[1, 4, 3, 5], [1, 2], 4, 2", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "576_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032796", "code": "def is_Sub_Array(A,B,n,m): \r\n    i = 0; j = 0; \r\n    while (i < n and j < m):  \r\n        if (A[i] == B[j]): \r\n            i += 1; \r\n            j += 1; \r\n            if (j == m): \r\n                return True;  \r\n        else: \r\n            i = i - j + 1; \r\n            j = 0;       \r\n    return False; ", "entry_point": "is_Sub_Array", "input": "[1, 2, 1], [1, 2, 1], 3, 3", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "576_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032797", "code": "def is_Sub_Array(A,B,n,m): \r\n    i = 0; j = 0; \r\n    while (i < n and j < m):  \r\n        if (A[i] == B[j]): \r\n            i += 1; \r\n            j += 1; \r\n            if (j == m): \r\n                return True;  \r\n        else: \r\n            i = i - j + 1; \r\n            j = 0;       \r\n    return False; ", "entry_point": "is_Sub_Array", "input": "[1, 0, 2, 2], [2, 2, 0], 4, 3", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "576_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032798", "code": "def last_Digit_Factorial(n): \r\n    if (n == 0): return 1\r\n    elif (n <= 2): return n  \r\n    elif (n == 3): return 6\r\n    elif (n == 4): return 4 \r\n    else: \r\n      return 0", "entry_point": "last_Digit_Factorial", "input": "4", "output": "4", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "577_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032799", "code": "def last_Digit_Factorial(n): \r\n    if (n == 0): return 1\r\n    elif (n <= 2): return n  \r\n    elif (n == 3): return 6\r\n    elif (n == 4): return 4 \r\n    else: \r\n      return 0", "entry_point": "last_Digit_Factorial", "input": "21", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "577_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032800", "code": "def last_Digit_Factorial(n): \r\n    if (n == 0): return 1\r\n    elif (n <= 2): return n  \r\n    elif (n == 3): return 6\r\n    elif (n == 4): return 4 \r\n    else: \r\n      return 0", "entry_point": "last_Digit_Factorial", "input": "30", "output": "0", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "577_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032801", "code": "def interleave_lists(list1,list2,list3):\r\n    result = [el for pair in zip(list1, list2, list3) for el in pair]\r\n    return result", "entry_point": "interleave_lists", "input": "[1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [100, 200, 300, 400, 500, 600, 700]", "output": "[1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "578_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032802", "code": "def interleave_lists(list1,list2,list3):\r\n    result = [el for pair in zip(list1, list2, list3) for el in pair]\r\n    return result", "entry_point": "interleave_lists", "input": "[10, 20], [15, 2], [5, 10]", "output": "[10, 15, 5, 20, 2, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "578_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032803", "code": "def interleave_lists(list1,list2,list3):\r\n    result = [el for pair in zip(list1, list2, list3) for el in pair]\r\n    return result", "entry_point": "interleave_lists", "input": "[11, 44], [10, 15], [20, 5]", "output": "[11, 10, 20, 44, 15, 5]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "578_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032804", "code": "def find_dissimilar(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1) ^ set(test_tup2))\r\n  return (res) ", "entry_point": "find_dissimilar", "input": "(3, 4, 5, 6), (5, 7, 4, 10)", "output": "(3, 6, 7, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "579_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032805", "code": "def find_dissimilar(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1) ^ set(test_tup2))\r\n  return (res) ", "entry_point": "find_dissimilar", "input": "(1, 2, 3, 4), (7, 2, 3, 9)", "output": "(1, 4, 7, 9)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "579_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032806", "code": "def find_dissimilar(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1) ^ set(test_tup2))\r\n  return (res) ", "entry_point": "find_dissimilar", "input": "(21, 11, 25, 26), (26, 34, 21, 36)", "output": "(34, 36, 11, 25)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "579_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032807", "code": "def even_ele(test_tuple, even_fnc): \r\n\tres = tuple() \r\n\tfor ele in test_tuple: \r\n\t\tif isinstance(ele, tuple): \r\n\t\t\tres += (even_ele(ele, even_fnc), ) \r\n\t\telif even_fnc(ele): \r\n\t\t\tres += (ele, ) \r\n\treturn res \r\ndef extract_even(test_tuple):\r\n  res = even_ele(test_tuple, lambda x: x % 2 == 0)\r\n  return (res) ", "entry_point": "extract_even", "input": "(4, 5, (7, 6, (2, 4)), 6, 8)", "output": "(4, (6, (2, 4)), 6, 8)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "580_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032808", "code": "def even_ele(test_tuple, even_fnc): \r\n\tres = tuple() \r\n\tfor ele in test_tuple: \r\n\t\tif isinstance(ele, tuple): \r\n\t\t\tres += (even_ele(ele, even_fnc), ) \r\n\t\telif even_fnc(ele): \r\n\t\t\tres += (ele, ) \r\n\treturn res \r\ndef extract_even(test_tuple):\r\n  res = even_ele(test_tuple, lambda x: x % 2 == 0)\r\n  return (res) ", "entry_point": "extract_even", "input": "(5, 6, (8, 7, (4, 8)), 7, 9)", "output": "(6, (8, (4, 8)))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "580_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032809", "code": "def even_ele(test_tuple, even_fnc): \r\n\tres = tuple() \r\n\tfor ele in test_tuple: \r\n\t\tif isinstance(ele, tuple): \r\n\t\t\tres += (even_ele(ele, even_fnc), ) \r\n\t\telif even_fnc(ele): \r\n\t\t\tres += (ele, ) \r\n\treturn res \r\ndef extract_even(test_tuple):\r\n  res = even_ele(test_tuple, lambda x: x % 2 == 0)\r\n  return (res) ", "entry_point": "extract_even", "input": "(5, 6, (9, 8, (4, 6)), 8, 10)", "output": "(6, (8, (4, 6)), 8, 10)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "580_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032810", "code": "def surface_Area(b,s): \r\n    return 2 * b * s + pow(b,2) ", "entry_point": "surface_Area", "input": "3, 4", "output": "33", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "581_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032811", "code": "def surface_Area(b,s): \r\n    return 2 * b * s + pow(b,2) ", "entry_point": "surface_Area", "input": "4, 5", "output": "56", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "581_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032812", "code": "def surface_Area(b,s): \r\n    return 2 * b * s + pow(b,2) ", "entry_point": "surface_Area", "input": "1, 2", "output": "5", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "581_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032813", "code": "def my_dict(dict1):\r\n  if bool(dict1):\r\n     return False\r\n  else:\r\n     return True", "entry_point": "my_dict", "input": "{10}", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "582_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032814", "code": "def my_dict(dict1):\r\n  if bool(dict1):\r\n     return False\r\n  else:\r\n     return True", "entry_point": "my_dict", "input": "{11}", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "582_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032815", "code": "def my_dict(dict1):\r\n  if bool(dict1):\r\n     return False\r\n  else:\r\n     return True", "entry_point": "my_dict", "input": "{}", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "582_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032816", "code": "def catalan_number(num):\r\n    if num <=1:\r\n         return 1   \r\n    res_num = 0\r\n    for i in range(num):\r\n        res_num += catalan_number(i) * catalan_number(num-i-1)\r\n    return res_num", "entry_point": "catalan_number", "input": "10", "output": "16796", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "583_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032817", "code": "def catalan_number(num):\r\n    if num <=1:\r\n         return 1   \r\n    res_num = 0\r\n    for i in range(num):\r\n        res_num += catalan_number(i) * catalan_number(num-i-1)\r\n    return res_num", "entry_point": "catalan_number", "input": "9", "output": "4862", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "583_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032818", "code": "def catalan_number(num):\r\n    if num <=1:\r\n         return 1   \r\n    res_num = 0\r\n    for i in range(num):\r\n        res_num += catalan_number(i) * catalan_number(num-i-1)\r\n    return res_num", "entry_point": "catalan_number", "input": "7", "output": "429", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "583_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032819", "code": "import re\r\ndef find_adverbs(text):\r\n  for m in re.finditer(r\"\\w+ly\", text):\r\n    return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))", "entry_point": "find_adverbs", "input": "'Clearly, he has no excuse for such behavior.'", "output": "'0-7: Clearly'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "584_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032820", "code": "import re\r\ndef find_adverbs(text):\r\n  for m in re.finditer(r\"\\w+ly\", text):\r\n    return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))", "entry_point": "find_adverbs", "input": "'Please handle the situation carefuly'", "output": "'28-36: carefuly'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "584_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032821", "code": "import re\r\ndef find_adverbs(text):\r\n  for m in re.finditer(r\"\\w+ly\", text):\r\n    return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))", "entry_point": "find_adverbs", "input": "'Complete the task quickly'", "output": "'18-25: quickly'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "584_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032822", "code": "import heapq\r\ndef expensive_items(items,n):\r\n  expensive_items = heapq.nlargest(n, items, key=lambda s: s['price'])\r\n  return expensive_items", "entry_point": "expensive_items", "input": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}], 1", "output": "[{'name': 'Item-2', 'price': 555.22}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "585_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032823", "code": "import heapq\r\ndef expensive_items(items,n):\r\n  expensive_items = heapq.nlargest(n, items, key=lambda s: s['price'])\r\n  return expensive_items", "entry_point": "expensive_items", "input": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}, {'name': 'Item-3', 'price': 45.09}], 2", "output": "[{'name': 'Item-2', 'price': 555.22}, {'name': 'Item-1', 'price': 101.1}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "585_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032824", "code": "import heapq\r\ndef expensive_items(items,n):\r\n  expensive_items = heapq.nlargest(n, items, key=lambda s: s['price'])\r\n  return expensive_items", "entry_point": "expensive_items", "input": "[{'name': 'Item-1', 'price': 101.1}, {'name': 'Item-2', 'price': 555.22}, {'name': 'Item-3', 'price': 45.09}, {'name': 'Item-4', 'price': 22.75}], 1", "output": "[{'name': 'Item-2', 'price': 555.22}]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "585_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032825", "code": "def split_Arr(a,n,k):  \r\n   b = a[:k] \r\n   return (a[k::]+b[::]) ", "entry_point": "split_Arr", "input": "[12, 10, 5, 6, 52, 36], 6, 2", "output": "[5, 6, 52, 36, 12, 10]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "586_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032826", "code": "def split_Arr(a,n,k):  \r\n   b = a[:k] \r\n   return (a[k::]+b[::]) ", "entry_point": "split_Arr", "input": "[1, 2, 3, 4], 4, 1", "output": "[2, 3, 4, 1]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "586_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032827", "code": "def split_Arr(a,n,k):  \r\n   b = a[:k] \r\n   return (a[k::]+b[::]) ", "entry_point": "split_Arr", "input": "[0, 1, 2, 3, 4, 5, 6, 7], 8, 3", "output": "[3, 4, 5, 6, 7, 0, 1, 2]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "586_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032828", "code": "def list_tuple(listx):\r\n  tuplex = tuple(listx)\r\n  return tuplex", "entry_point": "list_tuple", "input": "[5, 10, 7, 4, 15, 3]", "output": "(5, 10, 7, 4, 15, 3)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "587_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032829", "code": "def list_tuple(listx):\r\n  tuplex = tuple(listx)\r\n  return tuplex", "entry_point": "list_tuple", "input": "[2, 4, 5, 6, 2, 3, 4, 4, 7]", "output": "(2, 4, 5, 6, 2, 3, 4, 4, 7)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "587_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032830", "code": "def list_tuple(listx):\r\n  tuplex = tuple(listx)\r\n  return tuplex", "entry_point": "list_tuple", "input": "[58, 44, 56]", "output": "(58, 44, 56)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "587_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032831", "code": "def big_diff(nums):\r\n     diff= max(nums)-min(nums)\r\n     return diff", "entry_point": "big_diff", "input": "[1, 2, 3, 4]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "588_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032832", "code": "def big_diff(nums):\r\n     diff= max(nums)-min(nums)\r\n     return diff", "entry_point": "big_diff", "input": "[4, 5, 12]", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "588_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032833", "code": "def big_diff(nums):\r\n     diff= max(nums)-min(nums)\r\n     return diff", "entry_point": "big_diff", "input": "[9, 2, 3]", "output": "7", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "588_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032834", "code": "def perfect_squares(a, b):\r\n    lists=[]\r\n    for i in range (a,b+1):\r\n        j = 1;\r\n        while j*j <= i:\r\n            if j*j == i:\r\n                 lists.append(i)  \r\n            j = j+1\r\n        i = i+1\r\n    return lists", "entry_point": "perfect_squares", "input": "1, 30", "output": "[1, 4, 9, 16, 25]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "589_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032835", "code": "def perfect_squares(a, b):\r\n    lists=[]\r\n    for i in range (a,b+1):\r\n        j = 1;\r\n        while j*j <= i:\r\n            if j*j == i:\r\n                 lists.append(i)  \r\n            j = j+1\r\n        i = i+1\r\n    return lists", "entry_point": "perfect_squares", "input": "50, 100", "output": "[64, 81, 100]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "589_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032836", "code": "def perfect_squares(a, b):\r\n    lists=[]\r\n    for i in range (a,b+1):\r\n        j = 1;\r\n        while j*j <= i:\r\n            if j*j == i:\r\n                 lists.append(i)  \r\n            j = j+1\r\n        i = i+1\r\n    return lists", "entry_point": "perfect_squares", "input": "100, 200", "output": "[100, 121, 144, 169, 196]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "589_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032837", "code": "import cmath\r\ndef polar_rect(x,y):\r\n cn = complex(x,y)\r\n cn=cmath.polar(cn)\r\n cn1 = cmath.rect(2, cmath.pi)\r\n return (cn,cn1)", "entry_point": "polar_rect", "input": "3, 4", "output": "((5.0, 0.9272952180016122), (-2+2.4492935982947064e-16j))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "590_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032838", "code": "import cmath\r\ndef polar_rect(x,y):\r\n cn = complex(x,y)\r\n cn=cmath.polar(cn)\r\n cn1 = cmath.rect(2, cmath.pi)\r\n return (cn,cn1)", "entry_point": "polar_rect", "input": "4, 7", "output": "((8.06225774829855, 1.0516502125483738), (-2+2.4492935982947064e-16j))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "590_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032839", "code": "import cmath\r\ndef polar_rect(x,y):\r\n cn = complex(x,y)\r\n cn=cmath.polar(cn)\r\n cn1 = cmath.rect(2, cmath.pi)\r\n return (cn,cn1)", "entry_point": "polar_rect", "input": "15, 17", "output": "((22.67156809750927, 0.8478169733934057), (-2+2.4492935982947064e-16j))", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "590_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032840", "code": "def swap_List(newList): \r\n    size = len(newList) \r\n    temp = newList[0] \r\n    newList[0] = newList[size - 1] \r\n    newList[size - 1] = temp  \r\n    return newList ", "entry_point": "swap_List", "input": "[12, 35, 9, 56, 24]", "output": "[24, 35, 9, 56, 12]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "591_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032841", "code": "def binomial_Coeff(n,k): \r\n    C = [0] * (k + 1); \r\n    C[0] = 1; # nC0 is 1 \r\n    for i in range(1,n + 1):  \r\n        for j in range(min(i, k),0,-1): \r\n            C[j] = C[j] + C[j - 1]; \r\n    return C[k]; \r\ndef sum_Of_product(n): \r\n    return binomial_Coeff(2 * n,n - 1); ", "entry_point": "sum_Of_product", "input": "3", "output": "15", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "592_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032842", "code": "def binomial_Coeff(n,k): \r\n    C = [0] * (k + 1); \r\n    C[0] = 1; # nC0 is 1 \r\n    for i in range(1,n + 1):  \r\n        for j in range(min(i, k),0,-1): \r\n            C[j] = C[j] + C[j - 1]; \r\n    return C[k]; \r\ndef sum_Of_product(n): \r\n    return binomial_Coeff(2 * n,n - 1); ", "entry_point": "sum_Of_product", "input": "4", "output": "56", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "592_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032843", "code": "def binomial_Coeff(n,k): \r\n    C = [0] * (k + 1); \r\n    C[0] = 1; # nC0 is 1 \r\n    for i in range(1,n + 1):  \r\n        for j in range(min(i, k),0,-1): \r\n            C[j] = C[j] + C[j - 1]; \r\n    return C[k]; \r\ndef sum_Of_product(n): \r\n    return binomial_Coeff(2 * n,n - 1); ", "entry_point": "sum_Of_product", "input": "1", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "592_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032844", "code": "import re\r\ndef removezero_ip(ip):\r\n string = re.sub('\\.[0]*', '.', ip)\r\n return string\r", "entry_point": "removezero_ip", "input": "'216.08.094.196'", "output": "'216.8.94.196'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "593_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032845", "code": "import re\r\ndef removezero_ip(ip):\r\n string = re.sub('\\.[0]*', '.', ip)\r\n return string\r", "entry_point": "removezero_ip", "input": "'12.01.024'", "output": "'12.1.24'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "593_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032846", "code": "import re\r\ndef removezero_ip(ip):\r\n string = re.sub('\\.[0]*', '.', ip)\r\n return string\r", "entry_point": "removezero_ip", "input": "'216.08.094.0196'", "output": "'216.8.94.196'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "593_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032847", "code": "def diff_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even-first_odd)", "entry_point": "diff_even_odd", "input": "[1, 3, 5, 7, 4, 1, 6, 8]", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "594_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032848", "code": "def diff_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even-first_odd)", "entry_point": "diff_even_odd", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "594_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032849", "code": "def diff_even_odd(list1):\r\n    first_even = next((el for el in list1 if el%2==0),-1)\r\n    first_odd = next((el for el in list1 if el%2!=0),-1)\r\n    return (first_even-first_odd)", "entry_point": "diff_even_odd", "input": "[1, 5, 7, 9, 10]", "output": "9", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "594_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032850", "code": "def min_Swaps(str1,str2) : \r\n    count = 0\r\n    for i in range(len(str1)) :  \r\n        if str1[i] != str2[i] : \r\n            count += 1\r\n    if count % 2 == 0 : \r\n        return (count // 2) \r\n    else : \r\n        return (\"Not Possible\") ", "entry_point": "min_Swaps", "input": "'111', '000'", "output": "'Not Possible'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "595_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032851", "code": "def min_Swaps(str1,str2) : \r\n    count = 0\r\n    for i in range(len(str1)) :  \r\n        if str1[i] != str2[i] : \r\n            count += 1\r\n    if count % 2 == 0 : \r\n        return (count // 2) \r\n    else : \r\n        return (\"Not Possible\") ", "entry_point": "min_Swaps", "input": "'111', '110'", "output": "'Not Possible'", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "595_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032852", "code": "import sys \r\ndef tuple_size(tuple_list):\r\n  return (sys.getsizeof(tuple_list)) ", "entry_point": "tuple_size", "input": "('A', 1, 'B', 2, 'C', 3)", "output": "88", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "596_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032853", "code": "import sys \r\ndef tuple_size(tuple_list):\r\n  return (sys.getsizeof(tuple_list)) ", "entry_point": "tuple_size", "input": "(1, 'Raju', 2, 'Nikhil', 3, 'Deepanshu')", "output": "88", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "596_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032854", "code": "import sys \r\ndef tuple_size(tuple_list):\r\n  return (sys.getsizeof(tuple_list)) ", "entry_point": "tuple_size", "input": "((1, 'Lion'), (2, 'Tiger'), (3, 'Fox'), (4, 'Wolf'))", "output": "72", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "596_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032855", "code": "def find_kth(arr1, arr2, m, n, k):\r\n\tsorted1 = [0] * (m + n)\r\n\ti = 0\r\n\tj = 0\r\n\td = 0\r\n\twhile (i < m and j < n):\r\n\t\tif (arr1[i] < arr2[j]):\r\n\t\t\tsorted1[d] = arr1[i]\r\n\t\t\ti += 1\r\n\t\telse:\r\n\t\t\tsorted1[d] = arr2[j]\r\n\t\t\tj += 1\r\n\t\td += 1\r\n\twhile (i < m):\r\n\t\tsorted1[d] = arr1[i]\r\n\t\td += 1\r\n\t\ti += 1\r\n\twhile (j < n):\r\n\t\tsorted1[d] = arr2[j]\r\n\t\td += 1\r\n\t\tj += 1\r\n\treturn sorted1[k - 1]", "entry_point": "find_kth", "input": "[2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5", "output": "6", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "597_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032856", "code": "def find_kth(arr1, arr2, m, n, k):\r\n\tsorted1 = [0] * (m + n)\r\n\ti = 0\r\n\tj = 0\r\n\td = 0\r\n\twhile (i < m and j < n):\r\n\t\tif (arr1[i] < arr2[j]):\r\n\t\t\tsorted1[d] = arr1[i]\r\n\t\t\ti += 1\r\n\t\telse:\r\n\t\t\tsorted1[d] = arr2[j]\r\n\t\t\tj += 1\r\n\t\td += 1\r\n\twhile (i < m):\r\n\t\tsorted1[d] = arr1[i]\r\n\t\td += 1\r\n\t\ti += 1\r\n\twhile (j < n):\r\n\t\tsorted1[d] = arr2[j]\r\n\t\td += 1\r\n\t\tj += 1\r\n\treturn sorted1[k - 1]", "entry_point": "find_kth", "input": "[100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 5, 7, 7", "output": "256", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "597_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032857", "code": "def find_kth(arr1, arr2, m, n, k):\r\n\tsorted1 = [0] * (m + n)\r\n\ti = 0\r\n\tj = 0\r\n\td = 0\r\n\twhile (i < m and j < n):\r\n\t\tif (arr1[i] < arr2[j]):\r\n\t\t\tsorted1[d] = arr1[i]\r\n\t\t\ti += 1\r\n\t\telse:\r\n\t\t\tsorted1[d] = arr2[j]\r\n\t\t\tj += 1\r\n\t\td += 1\r\n\twhile (i < m):\r\n\t\tsorted1[d] = arr1[i]\r\n\t\td += 1\r\n\t\ti += 1\r\n\twhile (j < n):\r\n\t\tsorted1[d] = arr2[j]\r\n\t\td += 1\r\n\t\tj += 1\r\n\treturn sorted1[k - 1]", "entry_point": "find_kth", "input": "[3, 4, 7, 8, 10], [2, 5, 9, 11], 5, 4, 6", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "597_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032858", "code": "def armstrong_number(number):\r\n sum = 0\r\n times = 0\r\n temp = number\r\n while temp > 0:\r\n           times = times + 1\r\n           temp = temp // 10\r\n temp = number\r\n while temp > 0:\r\n           reminder = temp % 10\r\n           sum = sum + (reminder ** times)\r\n           temp //= 10\r\n if number == sum:\r\n           return True\r\n else:\r\n           return False", "entry_point": "armstrong_number", "input": "153", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "598_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032859", "code": "def armstrong_number(number):\r\n sum = 0\r\n times = 0\r\n temp = number\r\n while temp > 0:\r\n           times = times + 1\r\n           temp = temp // 10\r\n temp = number\r\n while temp > 0:\r\n           reminder = temp % 10\r\n           sum = sum + (reminder ** times)\r\n           temp //= 10\r\n if number == sum:\r\n           return True\r\n else:\r\n           return False", "entry_point": "armstrong_number", "input": "259", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "598_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032860", "code": "def armstrong_number(number):\r\n sum = 0\r\n times = 0\r\n temp = number\r\n while temp > 0:\r\n           times = times + 1\r\n           temp = temp // 10\r\n temp = number\r\n while temp > 0:\r\n           reminder = temp % 10\r\n           sum = sum + (reminder ** times)\r\n           temp //= 10\r\n if number == sum:\r\n           return True\r\n else:\r\n           return False", "entry_point": "armstrong_number", "input": "4458", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "598_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032861", "code": "def sum_average(number):\r\n total = 0\r\n for value in range(1, number + 1):\r\n    total = total + value\r\n average = total / number\r\n return (total,average)", "entry_point": "sum_average", "input": "10", "output": "(55, 5.5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "599_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032862", "code": "def sum_average(number):\r\n total = 0\r\n for value in range(1, number + 1):\r\n    total = total + value\r\n average = total / number\r\n return (total,average)", "entry_point": "sum_average", "input": "15", "output": "(120, 8.0)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "599_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032863", "code": "def sum_average(number):\r\n total = 0\r\n for value in range(1, number + 1):\r\n    total = total + value\r\n average = total / number\r\n return (total,average)", "entry_point": "sum_average", "input": "20", "output": "(210, 10.5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "599_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032864", "code": "def is_Even(n) : \r\n    if (n^1 == n+1) :\r\n        return True; \r\n    else :\r\n        return False; ", "entry_point": "is_Even", "input": "1", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "600_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032865", "code": "def is_Even(n) : \r\n    if (n^1 == n+1) :\r\n        return True; \r\n    else :\r\n        return False; ", "entry_point": "is_Even", "input": "2", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "600_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032866", "code": "def is_Even(n) : \r\n    if (n^1 == n+1) :\r\n        return True; \r\n    else :\r\n        return False; ", "entry_point": "is_Even", "input": "3", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/validation-00000-of-00001.parquet", "source_id": "600_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032867", "code": "R = 3\r\nC = 3\r\ndef min_cost(cost, m, n): \r\n\ttc = [[0 for x in range(C)] for x in range(R)] \r\n\ttc[0][0] = cost[0][0] \r\n\tfor i in range(1, m+1): \r\n\t\ttc[i][0] = tc[i-1][0] + cost[i][0] \r\n\tfor j in range(1, n+1): \r\n\t\ttc[0][j] = tc[0][j-1] + cost[0][j] \r\n\tfor i in range(1, m+1): \r\n\t\tfor j in range(1, n+1): \r\n\t\t\ttc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] \r\n\treturn tc[m][n]", "entry_point": "min_cost", "input": "[[1, 2, 3], [4, 8, 2], [1, 5, 3]], 2, 2", "output": "8", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "1_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032868", "code": "R = 3\r\nC = 3\r\ndef min_cost(cost, m, n): \r\n\ttc = [[0 for x in range(C)] for x in range(R)] \r\n\ttc[0][0] = cost[0][0] \r\n\tfor i in range(1, m+1): \r\n\t\ttc[i][0] = tc[i-1][0] + cost[i][0] \r\n\tfor j in range(1, n+1): \r\n\t\ttc[0][j] = tc[0][j-1] + cost[0][j] \r\n\tfor i in range(1, m+1): \r\n\t\tfor j in range(1, n+1): \r\n\t\t\ttc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] \r\n\treturn tc[m][n]", "entry_point": "min_cost", "input": "[[2, 3, 4], [5, 9, 3], [2, 6, 4]], 2, 2", "output": "12", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "1_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032869", "code": "R = 3\r\nC = 3\r\ndef min_cost(cost, m, n): \r\n\ttc = [[0 for x in range(C)] for x in range(R)] \r\n\ttc[0][0] = cost[0][0] \r\n\tfor i in range(1, m+1): \r\n\t\ttc[i][0] = tc[i-1][0] + cost[i][0] \r\n\tfor j in range(1, n+1): \r\n\t\ttc[0][j] = tc[0][j-1] + cost[0][j] \r\n\tfor i in range(1, m+1): \r\n\t\tfor j in range(1, n+1): \r\n\t\t\ttc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] \r\n\treturn tc[m][n]", "entry_point": "min_cost", "input": "[[3, 4, 5], [6, 10, 4], [3, 7, 5]], 2, 2", "output": "16", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "1_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032870", "code": "def similar_elements(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1) & set(test_tup2))\r\n  return (res) ", "entry_point": "similar_elements", "input": "(3, 4, 5, 6), (5, 7, 4, 10)", "output": "(4, 5)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "2_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032871", "code": "def similar_elements(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1) & set(test_tup2))\r\n  return (res) ", "entry_point": "similar_elements", "input": "(1, 2, 3, 4), (5, 4, 3, 7)", "output": "(3, 4)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "2_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032872", "code": "def similar_elements(test_tup1, test_tup2):\r\n  res = tuple(set(test_tup1) & set(test_tup2))\r\n  return (res) ", "entry_point": "similar_elements", "input": "(11, 12, 14, 13), (17, 15, 14, 13)", "output": "(13, 14)", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "2_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032873", "code": "import math\r\ndef is_not_prime(n):\r\n    result = False\r\n    for i in range(2,int(math.sqrt(n)) + 1):\r\n        if n % i == 0:\r\n            result = True\r\n    return result", "entry_point": "is_not_prime", "input": "2", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "3_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032874", "code": "import math\r\ndef is_not_prime(n):\r\n    result = False\r\n    for i in range(2,int(math.sqrt(n)) + 1):\r\n        if n % i == 0:\r\n            result = True\r\n    return result", "entry_point": "is_not_prime", "input": "10", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "3_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032875", "code": "import math\r\ndef is_not_prime(n):\r\n    result = False\r\n    for i in range(2,int(math.sqrt(n)) + 1):\r\n        if n % i == 0:\r\n            result = True\r\n    return result", "entry_point": "is_not_prime", "input": "35", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "3_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032876", "code": "import heapq as hq\r\ndef heap_queue_largest(nums,n):\r\n  largest_nums = hq.nlargest(n, nums)\r\n  return largest_nums", "entry_point": "heap_queue_largest", "input": "[25, 35, 22, 85, 14, 65, 75, 22, 58], 3", "output": "[85, 75, 65]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "4_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032877", "code": "import heapq as hq\r\ndef heap_queue_largest(nums,n):\r\n  largest_nums = hq.nlargest(n, nums)\r\n  return largest_nums", "entry_point": "heap_queue_largest", "input": "[25, 35, 22, 85, 14, 65, 75, 22, 58], 2", "output": "[85, 75]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "4_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032878", "code": "import heapq as hq\r\ndef heap_queue_largest(nums,n):\r\n  largest_nums = hq.nlargest(n, nums)\r\n  return largest_nums", "entry_point": "heap_queue_largest", "input": "[25, 35, 22, 85, 14, 65, 75, 22, 58], 5", "output": "[85, 75, 65, 58, 35]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "4_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032879", "code": "def count_ways(n): \r\n\tA = [0] * (n + 1) \r\n\tB = [0] * (n + 1) \r\n\tA[0] = 1\r\n\tA[1] = 0\r\n\tB[0] = 0\r\n\tB[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tA[i] = A[i - 2] + 2 * B[i - 1] \r\n\t\tB[i] = A[i - 1] + B[i - 2] \r\n\treturn A[n] ", "entry_point": "count_ways", "input": "2", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "5_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032880", "code": "def count_ways(n): \r\n\tA = [0] * (n + 1) \r\n\tB = [0] * (n + 1) \r\n\tA[0] = 1\r\n\tA[1] = 0\r\n\tB[0] = 0\r\n\tB[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tA[i] = A[i - 2] + 2 * B[i - 1] \r\n\t\tB[i] = A[i - 1] + B[i - 2] \r\n\treturn A[n] ", "entry_point": "count_ways", "input": "8", "output": "153", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "5_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032881", "code": "def count_ways(n): \r\n\tA = [0] * (n + 1) \r\n\tB = [0] * (n + 1) \r\n\tA[0] = 1\r\n\tA[1] = 0\r\n\tB[0] = 0\r\n\tB[1] = 1\r\n\tfor i in range(2, n+1): \r\n\t\tA[i] = A[i - 2] + 2 * B[i - 1] \r\n\t\tB[i] = A[i - 1] + B[i - 2] \r\n\treturn A[n] ", "entry_point": "count_ways", "input": "12", "output": "2131", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "5_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032882", "code": "def is_Power_Of_Two (x): \r\n    return x and (not(x & (x - 1))) \r\ndef differ_At_One_Bit_Pos(a,b): \r\n    return is_Power_Of_Two(a ^ b)", "entry_point": "differ_At_One_Bit_Pos", "input": "13, 9", "output": "True", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "6_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032883", "code": "def is_Power_Of_Two (x): \r\n    return x and (not(x & (x - 1))) \r\ndef differ_At_One_Bit_Pos(a,b): \r\n    return is_Power_Of_Two(a ^ b)", "entry_point": "differ_At_One_Bit_Pos", "input": "15, 8", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "6_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032884", "code": "def is_Power_Of_Two (x): \r\n    return x and (not(x & (x - 1))) \r\ndef differ_At_One_Bit_Pos(a,b): \r\n    return is_Power_Of_Two(a ^ b)", "entry_point": "differ_At_One_Bit_Pos", "input": "2, 4", "output": "False", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "6_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032885", "code": "import re\r\ndef find_char_long(text):\r\n  return (re.findall(r\"\\b\\w{4,}\\b\", text))", "entry_point": "find_char_long", "input": "'Please move back to stream'", "output": "['Please', 'move', 'back', 'stream']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "7_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032886", "code": "import re\r\ndef find_char_long(text):\r\n  return (re.findall(r\"\\b\\w{4,}\\b\", text))", "entry_point": "find_char_long", "input": "'Jing Eco and Tech'", "output": "['Jing', 'Tech']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "7_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032887", "code": "import re\r\ndef find_char_long(text):\r\n  return (re.findall(r\"\\b\\w{4,}\\b\", text))", "entry_point": "find_char_long", "input": "'Jhingai wulu road Zone 3'", "output": "['Jhingai', 'wulu', 'road', 'Zone']", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "7_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032888", "code": "def square_nums(nums):\r\n square_nums = list(map(lambda x: x ** 2, nums))\r\n return square_nums", "entry_point": "square_nums", "input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "8_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032889", "code": "def square_nums(nums):\r\n square_nums = list(map(lambda x: x ** 2, nums))\r\n return square_nums", "entry_point": "square_nums", "input": "[10, 20, 30]", "output": "[100, 400, 900]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "8_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032890", "code": "def square_nums(nums):\r\n square_nums = list(map(lambda x: x ** 2, nums))\r\n return square_nums", "entry_point": "square_nums", "input": "[12, 15]", "output": "[144, 225]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "8_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032891", "code": "def find_Rotations(str): \r\n    tmp = str + str\r\n    n = len(str) \r\n    for i in range(1,n + 1): \r\n        substring = tmp[i: i+n] \r\n        if (str == substring): \r\n            return i \r\n    return n ", "entry_point": "find_Rotations", "input": "'aaaa'", "output": "1", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "9_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032892", "code": "def find_Rotations(str): \r\n    tmp = str + str\r\n    n = len(str) \r\n    for i in range(1,n + 1): \r\n        substring = tmp[i: i+n] \r\n        if (str == substring): \r\n            return i \r\n    return n ", "entry_point": "find_Rotations", "input": "'ab'", "output": "2", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "9_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032893", "code": "def find_Rotations(str): \r\n    tmp = str + str\r\n    n = len(str) \r\n    for i in range(1,n + 1): \r\n        substring = tmp[i: i+n] \r\n        if (str == substring): \r\n            return i \r\n    return n ", "entry_point": "find_Rotations", "input": "'abc'", "output": "3", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "9_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032894", "code": "import heapq\r\ndef small_nnum(list1,n):\r\n  smallest=heapq.nsmallest(n,list1)\r\n  return smallest", "entry_point": "small_nnum", "input": "[10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100], 2", "output": "[10, 20]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "10_0", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032895", "code": "import heapq\r\ndef small_nnum(list1,n):\r\n  smallest=heapq.nsmallest(n,list1)\r\n  return smallest", "entry_point": "small_nnum", "input": "[10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100], 5", "output": "[10, 20, 20, 40, 50]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "10_1", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "mbpp/0032896", "code": "import heapq\r\ndef small_nnum(list1,n):\r\n  smallest=heapq.nsmallest(n,list1)\r\n  return smallest", "entry_point": "small_nnum", "input": "[10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100], 3", "output": "[10, 20, 20]", "source": "mbpp", "source_repo": "google-research-datasets/mbpp", "source_revision": "4bb6404fdc6cacfda99d4ac4205087b89d32030c", "source_file": "full/prompt-00000-of-00001.parquet", "source_id": "10_2", "provenance_class": "human", "licence": "cc-by-4.0"}
{"id": "code_search_net/0032897", "code": "def _analyse_mat_sections(sections):\n        \"\"\"\n        Cases:\n        - ICRU flag present, LOADDEDX flag missing -> data loaded from some data hardcoded in SH12A binary,\n        no need to load external files\n        - ICRU flag present, LOADDEDX flag present -> data loaded from external files. ICRU number read from ICRU flag,\n        any number following LOADDEDX flag is ignored.\n        - ICRU flag missing, LOADDEDX flag present -> data loaded from external files. ICRU number read from LOADDEDX\n        - ICRU flag missing, LOADDEDX flag missing -> nothing happens\n        \"\"\"\n        icru_numbers = []\n        for section in sections:\n            load_present = False\n            load_value = False\n            icru_value = False\n            for e in section:\n                split_line = e.split()\n                if \"LOADDEDX\" in e:\n                    load_present = True\n                    if len(split_line) > 1:\n                        load_value = split_line[1] if \"!\" not in split_line[1] else False  # ignore ! comments\n                elif \"ICRU\" in e and len(split_line) > 1:\n                    icru_value = split_line[1] if \"!\" not in split_line[1] else False  # ignore ! comments\n            if load_present:  # LOADDEDX is present, so external file is required\n                if icru_value:  # if ICRU value was given\n                    icru_numbers.append(icru_value)\n                elif load_value:  # if only LOADDEDX with values was present in section\n                    icru_numbers.append(load_value)\n        return icru_numbers", "entry_point": "_analyse_mat_sections", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataMedSci/mcpartools/blob/84f869094d05bf70f09e8aaeca671ddaa1c56ec4/mcpartools/mcengine/shieldhit.py#L182-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032898", "code": "def glitter_head(context):\n    \"\"\"\n    Template tag which renders the glitter CSS and JavaScript. Any resources\n    which need to be loaded should be added here. This is only shown to users\n    with permission to edit the page.\n    \"\"\"\n    user = context.get('user')\n    rendered = ''\n    template_path = 'glitter/include/head.html'\n\n    if user is not None and user.is_staff:\n        template = context.template.engine.get_template(template_path)\n        rendered = template.render(context)\n\n    return rendered", "entry_point": "glitter_head", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/developersociety/django-glitter/blob/2c0280ec83afee80deee94ee3934fc54239c2e87/glitter/templatetags/glitter.py#L7-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032899", "code": "def glitter_startbody(context):\n    \"\"\"\n    Template tag which renders the glitter overlay and sidebar. This is only\n    shown to users with permission to edit the page.\n    \"\"\"\n    user = context.get('user')\n    path_body = 'glitter/include/startbody.html'\n    path_plus = 'glitter/include/startbody_%s_%s.html'\n    rendered = ''\n\n    if user is not None and user.is_staff:\n        templates = [path_body]\n        # We've got a page with a glitter object:\n        # - May need a different startbody template\n        # - Check if user has permission to add\n        glitter = context.get('glitter')\n        if glitter is not None:\n            opts = glitter.obj._meta.app_label, glitter.obj._meta.model_name\n            template_path = path_plus % opts\n            templates.insert(0, template_path)\n\n        template = context.template.engine.select_template(templates)\n        rendered = template.render(context)\n\n    return rendered", "entry_point": "glitter_startbody", "input": "{'a': 1, 'b': 2}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/developersociety/django-glitter/blob/2c0280ec83afee80deee94ee3934fc54239c2e87/glitter/templatetags/glitter.py#L25-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032900", "code": "def contains_list(longer, shorter):\n    \"\"\"Check if longer list starts with shorter list\"\"\"\n    if len(longer) <= len(shorter):\n        return False\n    for a, b in zip(shorter, longer):\n        if a != b:\n            return False\n    return True", "entry_point": "contains_list", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/frostming/atoml/blob/85414ef77777366887a819a05b496d5279296cd2/atoml/decoder.py#L28-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032901", "code": "def is_ecma_regex(regex):\n    \"\"\"Check if given regex is of type ECMA 262 or not.\n\n    :rtype: bool\n\n    \"\"\"\n    parts = regex.split('/')\n\n    if len(parts) == 1:\n        return False\n\n    if len(parts) < 3:\n        raise ValueError('Given regex isn\\'t ECMA regex nor Python regex.')\n    parts.pop()\n    parts.append('')\n\n    raw_regex = '/'.join(parts)\n    if raw_regex.startswith('/') and raw_regex.endswith('/'):\n        return True\n    return False", "entry_point": "is_ecma_regex", "input": "''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/beregond/jsonmodels/blob/97a1a6b90a49490fc5a6078f49027055d2e13541/jsonmodels/utilities.py#L93-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032902", "code": "def strip_punctuation_space(value):\n    \"Strip excess whitespace prior to punctuation.\"\n    def strip_punctuation(string):\n        replacement_list = (\n            (' .',  '.'),\n            (' :',  ':'),\n            ('( ',  '('),\n            (' )',  ')'),\n        )\n        for match, replacement in replacement_list:\n            string = string.replace(match, replacement)\n        return string\n    if value == None:\n        return None\n    if type(value) == list:\n        return [strip_punctuation(v) for v in value]\n    return strip_punctuation(value)", "entry_point": "strip_punctuation_space", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L47-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032903", "code": "def join_sentences(string1, string2, glue='.'):\n    \"concatenate two sentences together with punctuation glue\"\n    if not string1 or string1 == '':\n        return string2\n    if not string2 or string2 == '':\n        return string1\n    # both are strings, continue joining them together with the glue and whitespace\n    new_string = string1.rstrip()\n    if not new_string.endswith(glue):\n        new_string += glue\n    new_string += ' ' + string2.lstrip()\n    return new_string", "entry_point": "join_sentences", "input": "'AbC dEf', '', ['a', 'b', 'c']", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L65-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032904", "code": "def coerce_to_int(val, default=0xDEADBEEF):\n    \"\"\"Attempts to cast given value to an integer, return the original value if failed or the default if one provided.\"\"\"\n    try:\n        return int(val)\n    except (TypeError, ValueError):\n        if default != 0xDEADBEEF:\n            return default\n        return val", "entry_point": "coerce_to_int", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L78-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032905", "code": "def doi_uri_to_doi(value):\n    \"Strip the uri schema from the start of DOI URL strings\"\n    if value is None:\n        return value\n    replace_values = ['http://dx.doi.org/', 'https://dx.doi.org/',\n                      'http://doi.org/', 'https://doi.org/']\n    for replace_value in replace_values:\n        value = value.replace(replace_value, '')\n    return value", "entry_point": "doi_uri_to_doi", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L195-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032906", "code": "def text_to_title(value):\n    \"\"\"when a title is required, generate one from the value\"\"\"\n    title = None\n    if not value:\n        return title\n    words = value.split(\" \")\n    keep_words = []\n    for word in words:\n        if word.endswith(\".\") or word.endswith(\":\"):\n            keep_words.append(word)\n            if len(word) > 1 and \"<italic>\" not in word and \"<i>\" not in word:\n                break\n        else:\n            keep_words.append(word)\n    if len(keep_words) > 0:\n        title = \" \".join(keep_words)\n        if title.split(\" \")[-1] != \"spp.\":\n            title = title.rstrip(\" .:\")\n    return title", "entry_point": "text_to_title", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L460-L478", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032907", "code": "def rewrite_elife_funding_awards(json_content, doi):\n    \"\"\" rewrite elife funding awards \"\"\"\n\n    # remove a funding award\n    if doi == \"10.7554/eLife.00801\":\n        for i, award in enumerate(json_content):\n            if \"id\" in award and award[\"id\"] == \"par-2\":\n                del json_content[i]\n\n    # add funding award recipient\n    if doi == \"10.7554/eLife.04250\":\n        recipients_for_04250 = [{\"type\": \"person\", \"name\": {\"preferred\": \"Eric Jonas\", \"index\": \"Jonas, Eric\"}}]\n        for i, award in enumerate(json_content):\n            if \"id\" in award and award[\"id\"] in [\"par-2\", \"par-3\", \"par-4\"]:\n                if \"recipients\" not in award:\n                    json_content[i][\"recipients\"] = recipients_for_04250\n\n    # add funding award recipient\n    if doi == \"10.7554/eLife.06412\":\n        recipients_for_06412 = [{\"type\": \"person\", \"name\": {\"preferred\": \"Adam J Granger\", \"index\": \"Granger, Adam J\"}}]\n        for i, award in enumerate(json_content):\n            if \"id\" in award and award[\"id\"] == \"par-1\":\n                if \"recipients\" not in award:\n                    json_content[i][\"recipients\"] = recipients_for_06412\n\n    return json_content", "entry_point": "rewrite_elife_funding_awards", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L480-L505", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032908", "code": "def person_same_name_map(json_content, role_from):\n    \"to merge multiple editors into one record, filter by role values and group by name\"\n    matched_editors = [(i, person) for i, person in enumerate(json_content)\n                       if person.get('role') in role_from]\n    same_name_map = {}\n    for i, editor in matched_editors:\n        if not editor.get(\"name\"):\n            continue\n        # compare name of each\n        name = editor.get(\"name\").get(\"index\")\n        if name not in same_name_map:\n            same_name_map[name] = []\n        same_name_map[name].append(i)\n    return same_name_map", "entry_point": "person_same_name_map", "input": "[], [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L1172-L1185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032909", "code": "def contrib_inline_aff(contrib_tag):\n    \"\"\"\n    Given a contrib tag, look for an aff tag directly inside it\n    \"\"\"\n    aff_tags = []\n    for child_tag in contrib_tag:\n        if child_tag and child_tag.name and child_tag.name == \"aff\":\n            aff_tags.append(child_tag)\n    return aff_tags", "entry_point": "contrib_inline_aff", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L999-L1007", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032910", "code": "def contrib_xref(contrib_tag, ref_type):\n    \"\"\"\n    Given a contrib tag, look for an xref tag of type ref_type directly inside the contrib tag\n    \"\"\"\n    aff_tags = []\n    for child_tag in contrib_tag:\n        if (child_tag and child_tag.name and child_tag.name == \"xref\"\n            and child_tag.get('ref-type') and child_tag.get('ref-type') == ref_type):\n            aff_tags.append(child_tag)\n    return aff_tags", "entry_point": "contrib_xref", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1009-L1018", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032911", "code": "def collab_to_group_author_key_map(authors):\n    \"\"\"compile a map of author collab to group-author-key\"\"\"\n    collab_map = {}\n    for author in authors:\n        if author.get(\"collab\"):\n            collab_map[author.get(\"collab\")] = author.get(\"group-author-key\")\n    return collab_map", "entry_point": "collab_to_group_author_key_map", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3049-L3055", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032912", "code": "def map_equal_contributions(contributors):\n    \"\"\"assign numeric values to each unique equal-contrib id\"\"\"\n    equal_contribution_map = {}\n    equal_contribution_keys = []\n    for contributor in contributors:\n        if contributor.get(\"references\") and \"equal-contrib\" in contributor.get(\"references\"):\n            for key in contributor[\"references\"][\"equal-contrib\"]:\n                if key not in equal_contribution_keys:\n                    equal_contribution_keys.append(key)\n    # Do a basic sort\n    equal_contribution_keys = sorted(equal_contribution_keys)\n    # Assign keys based on sorted values\n    for i, equal_contribution_key in enumerate(equal_contribution_keys):\n        equal_contribution_map[equal_contribution_key] = i+1\n    return equal_contribution_map", "entry_point": "map_equal_contributions", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3057-L3071", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032913", "code": "def format_author_line(author_names):\n    \"\"\"authorLine format depends on if there is 1, 2 or more than 2 authors\"\"\"\n    author_line = None\n    if not author_names:\n        return author_line\n    if len(author_names) <= 2:\n        author_line = \", \".join(author_names)\n    elif len(author_names) > 2:\n        author_line = author_names[0] + \" et al.\"\n    return author_line", "entry_point": "format_author_line", "input": "'walnut thistle harbour'", "output": "'w et al.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3165-L3174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032914", "code": "def value_type(value):\n    \"\"\"Classify `value` of bold, color, and underline keys.\n\n    Parameters\n    ----------\n    value : style value\n\n    Returns\n    -------\n    str, {\"simple\", \"lookup\", \"re_lookup\", \"interval\"}\n    \"\"\"\n    try:\n        keys = list(value.keys())\n    except AttributeError:\n        return \"simple\"\n    if keys in [[\"lookup\"], [\"re_lookup\"], [\"interval\"]]:\n        return keys[0]\n    raise ValueError(\"Type of `value` could not be determined\")", "entry_point": "value_type", "input": "['apple', 'banana', 'cherry']", "output": "'simple'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyout/pyout/blob/d9ff954bdedb6fc70f21f4fe77ad4bf926b201b0/pyout/elements.py#L268-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032915", "code": "def _safe_get(mapping, key, default=None):\n    \"\"\"Helper for accessing style values.\n\n    It exists to avoid checking whether `mapping` is indeed a mapping before\n    trying to get a key.  In the context of style dicts, this eliminates \"is\n    this a mapping\" checks in two common situations: 1) a style argument is\n    None, and 2) a style key's value (e.g., width) can be either a mapping or a\n    plain value.\n    \"\"\"\n    try:\n        return mapping.get(key, default)\n    except AttributeError:\n        return default", "entry_point": "_safe_get", "input": "True, {'a': 1, 'b': 2}, False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyout/pyout/blob/d9ff954bdedb6fc70f21f4fe77ad4bf926b201b0/pyout/common.py#L214-L226", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032916", "code": "def get_sudoers_entry(username=None, sudoers_entries=None):\n    \"\"\" Find the sudoers entry in the sudoers file for the specified user.\n\n    args:\n        username (str): username.\n        sudoers_entries (list): list of lines from the sudoers file.\n\n    returns:`r\n        str: sudoers entry for the specified user.\n    \"\"\"\n    for entry in sudoers_entries:\n        if entry.startswith(username):\n            return entry.replace(username, '').strip()", "entry_point": "get_sudoers_entry", "input": "'', ['a', 'b', 'c']", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jonhadfield/creds/blob/b2053b43516cf742c6e4c2b79713bc625592f47c/lib/creds/utils.py#L191-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032917", "code": "def _from_hex_digest(digest):\n    \"\"\"Convert hex digest to sequence of bytes.\"\"\"\n    return \"\".join(\n        [chr(int(digest[x : x + 2], 16)) for x in range(0, len(digest), 2)]\n    )", "entry_point": "_from_hex_digest", "input": "'abc'", "output": "'\u00ab\\x0c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alefnula/tea/blob/f5a0a724a425ec4f9dd2c7fe966ef06faf3a15a3/tea/utils/crypto.py#L112-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032918", "code": "def format_page(text):\r\n    \"\"\"Format the text for output adding ASCII frame around the text.\r\n\r\n    Args:\r\n        text (str): Text that needs to be formatted.\r\n\r\n    Returns:\r\n        str: Formatted string.\r\n    \"\"\"\r\n    width = max(map(len, text.splitlines()))\r\n    page = \"+-\" + \"-\" * width + \"-+\\n\"\r\n    for line in text.splitlines():\r\n        page += \"| \" + line.ljust(width) + \" |\\n\"\r\n    page += \"+-\" + \"-\" * width + \"-+\\n\"\r\n    return page", "entry_point": "format_page", "input": "'  padded  '", "output": "'+------------+\\n|   padded   |\\n+------------+\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alefnula/tea/blob/f5a0a724a425ec4f9dd2c7fe966ef06faf3a15a3/tea/console/format.py#L16-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032919", "code": "def center_text(text, width=80):\r\n    \"\"\"Center all lines of the text.\r\n\r\n    It is assumed that all lines width is smaller then B{width}, because the\r\n    line width will not be checked.\r\n\r\n    Args:\r\n        text (str): Text to wrap.\r\n        width (int): Maximum number of characters per line.\r\n\r\n    Returns:\r\n        str: Centered text.\r\n    \"\"\"\r\n    centered = []\r\n    for line in text.splitlines():\r\n        centered.append(line.center(width))\r\n    return \"\\n\".join(centered)", "entry_point": "center_text", "input": "'AbC dEf', 2", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alefnula/tea/blob/f5a0a724a425ec4f9dd2c7fe966ef06faf3a15a3/tea/console/format.py#L171-L187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032920", "code": "def _conv_which_data(which_data):\n        \"\"\"Convert which data to string or tuple\n\n        This function improves user convenience,\n        as `which_data` may be of several types\n        (str, ,str with spaces and commas, list, tuple) which\n        is internally handled by this method.\n        \"\"\"\n        if isinstance(which_data, str):\n            which_data = which_data.lower().strip()\n            if which_data.count(\",\"):\n                # convert comma string to list\n                which_data = [w.strip() for w in which_data.split(\",\")]\n                # remove empty strings\n                which_data = [w for w in which_data if w]\n                if len(which_data) == 1:\n                    return which_data[0]\n                else:\n                    # convert to tuple\n                    return tuple(which_data)\n            else:\n                return which_data\n        elif isinstance(which_data, (list, tuple)):\n            which_data = [w.lower().strip() for w in which_data]\n            return tuple(which_data)\n        elif which_data is None:\n            return None\n        else:\n            msg = \"unknown type for `which_data`: {}\".format(which_data)\n            raise ValueError(msg)", "entry_point": "_conv_which_data", "input": "['a', 'b', 'c']", "output": "('a', 'b', 'c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RI-imaging/qpimage/blob/863c0fce5735b4c0ae369f75c0df9a33411b2bb2/qpimage/core.py#L208-L237", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032921", "code": "def remove_prefix(text, prefix):\n\t\"\"\"\n\tRemove the prefix from the text if it exists.\n\n\t>>> remove_prefix('underwhelming performance', 'underwhelming ')\n\t'performance'\n\n\t>>> remove_prefix('something special', 'sample')\n\t'something special'\n\t\"\"\"\n\tnull, prefix, rest = text.rpartition(prefix)\n\treturn rest", "entry_point": "remove_prefix", "input": "'abc', 'walnut thistle harbour'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.text/blob/0fe070e9241cb1fdb737516a3f57da94a2618376/jaraco/text.py#L378-L389", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032922", "code": "def remove_suffix(text, suffix):\n\t\"\"\"\n\tRemove the suffix from the text if it exists.\n\n\t>>> remove_suffix('name.git', '.git')\n\t'name'\n\n\t>>> remove_suffix('something special', 'sample')\n\t'something special'\n\t\"\"\"\n\trest, suffix, null = text.partition(suffix)\n\treturn rest", "entry_point": "remove_suffix", "input": "'Hello World', 'a,b,c'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.text/blob/0fe070e9241cb1fdb737516a3f57da94a2618376/jaraco/text.py#L392-L403", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032923", "code": "def common_prefix(s1, s2):\n\t\t\"\"\"\n\t\tReturn the common prefix of two lines.\n\t\t\"\"\"\n\t\tindex = min(len(s1), len(s2))\n\t\twhile s1[:index] != s2[:index]:\n\t\t\tindex -= 1\n\t\treturn s1[:index]", "entry_point": "common_prefix", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.text/blob/0fe070e9241cb1fdb737516a3f57da94a2618376/jaraco/text.py#L368-L375", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032924", "code": "def seqfy(strs):\r\n    ''' \u5e8f\u5217\u5316 \u5b57\u7b26\u4e32--->\u5b9e\u9645\u6548\u679c\u662f\uff0c\u4e3a\u5b57\u7b26\u4e32\uff0c\u6dfb\u52a0\u884c\u53f7\uff0c\u8fd4\u56de\u5b57\u7b26\u4e32\r\n    Sampe usage:\r\n        strs = [\"\", None, u\"First-line\\nSecond-line\\nThird-line\", u\"\u6ca1\u6709\u6362\u884c\u7b26\"]\r\n        for s in strs:\r\n            print \"---\"\r\n            result = seqfy(s)\r\n            print result\r\n            print unseqfy(result)\r\n    '''\r\n    \r\n    if not strs:\r\n        return\r\n    \r\n    result = \"\"\r\n    seq = 1\r\n    ss = strs.split(\"\\n\")\r\n    for i in ss:\r\n        if i:\r\n            result = \"\".join([result, str(seq), \".\", i, \"\\n\"])\r\n            seq = seq + 1            \r\n    return result", "entry_point": "seqfy", "input": "'AbC dEf'", "output": "'1.AbC dEf\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RockFeng0/rtsf/blob/fbc0d57edaeca86418af3942472fcc6d3e9ce591/rtsf/p_common.py#L786-L807", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032925", "code": "def extract_list_from_list_of_dict(list_of_dict, key):\n    # type: (List[DictUpperBound], Any) -> List\n    \"\"\"Extract a list by looking up key in each member of a list of dictionaries\n\n    Args:\n        list_of_dict (List[DictUpperBound]): List of dictionaries\n        key (Any): Key to find in each dictionary\n\n    Returns:\n        List: List containing values returned from each dictionary\n\n    \"\"\"\n    result = list()\n    for dictionary in list_of_dict:\n        result.append(dictionary[key])\n    return result", "entry_point": "extract_list_from_list_of_dict", "input": "{}, ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCHA-DAP/hdx-python-utilities/blob/9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3/src/hdx/utilities/dictandlist.py#L214-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032926", "code": "def avg_dicts(dictin1, dictin2, dropmissing=True):\n    # type: (DictUpperBound, DictUpperBound, bool) -> Dict\n    \"\"\"Create a new dictionary from two dictionaries by averaging values\n\n    Args:\n        dictin1 (DictUpperBound): First input dictionary\n        dictin2 (DictUpperBound): Second input dictionary\n        dropmissing (bool): Whether to drop keys missing in one dictionary. Defaults to True.\n\n    Returns:\n        Dict: Dictionary with values being average of 2 input dictionaries\n\n    \"\"\"\n    dictout = dict()\n    for key in dictin1:\n        if key in dictin2:\n            dictout[key] = (dictin1[key] + dictin2[key]) / 2\n        elif not dropmissing:\n            dictout[key] = dictin1[key]\n    if not dropmissing:\n        for key in dictin2:\n            if key not in dictin1:\n                dictout[key] = dictin2[key]\n    return dictout", "entry_point": "avg_dicts", "input": "{}, {'a': 1, 'b': 2}, [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCHA-DAP/hdx-python-utilities/blob/9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3/src/hdx/utilities/dictandlist.py#L313-L336", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032927", "code": "def combine_xml_points(l, units, handle_units):\n    \"\"\"Combine multiple Point tags into an array.\"\"\"\n    ret = {}\n    for item in l:\n        for key, value in item.items():\n            ret.setdefault(key, []).append(value)\n\n    for key, value in ret.items():\n        if key != 'date':\n            ret[key] = handle_units(value, units.get(key, None))\n\n    return ret", "entry_point": "combine_xml_points", "input": "[], [5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/siphon/blob/53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac/siphon/ncss.py#L334-L345", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032928", "code": "def parse_csv_header(line):\n    \"\"\"Parse the CSV header returned by TDS.\"\"\"\n    units = {}\n    names = []\n    for var in line.split(','):\n        start = var.find('[')\n        if start < 0:\n            names.append(str(var))\n            continue\n        else:\n            names.append(str(var[:start]))\n        end = var.find(']', start)\n        unitstr = var[start + 1:end]\n        eq = unitstr.find('=')\n        if eq >= 0:\n            # go past = and \", skip final \"\n            units[names[-1]] = unitstr[eq + 2:-1]\n    return names, units", "entry_point": "parse_csv_header", "input": "'  padded  '", "output": "(['  padded  '], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/siphon/blob/53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac/siphon/ncss.py#L408-L425", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032929", "code": "def bin_range_strings(bins, fmt=':g'):\n    \"\"\"Given a list of bins, make a list of strings of those bin ranges\n\n    Parameters\n    ----------\n    bins : list_like\n        List of anything, usually values of bin edges\n\n    Returns\n    -------\n    bin_ranges : list\n        List of bin ranges\n\n    >>> bin_range_strings((0, 0.5, 1))\n    ['0-0.5', '0.5-1']\n    \"\"\"\n    return [('{' + fmt + '}-{' + fmt + '}').format(i, j)\n            for i, j in zip(bins, bins[1:])]", "entry_point": "bin_range_strings", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/YeoLab/anchor/blob/1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a/anchor/infotheory.py#L12-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032930", "code": "def parse_cwl_type(cwl_type_string):\n    \"\"\"\n    Parses cwl type information from a cwl type string.\n\n    Examples:\n\n    - \"File[]\" -> {'type': 'File', 'isArray': True, 'isOptional': False}\n    - \"int?\" -> {'type': 'int', 'isArray': False, 'isOptional': True}\n\n    :param cwl_type_string: The cwl type string to extract information from\n    :return: A dictionary containing information about the parsed cwl type string\n    \"\"\"\n\n    is_optional = cwl_type_string.endswith('?')\n    if is_optional:\n        cwl_type_string = cwl_type_string[:-1]\n\n    is_array = cwl_type_string.endswith('[]')\n    if is_array:\n        cwl_type_string = cwl_type_string[:-2]\n\n    return {'type': cwl_type_string, 'isArray': is_array, 'isOptional': is_optional}", "entry_point": "parse_cwl_type", "input": "'walnut thistle harbour'", "output": "{'type': 'walnut thistle harbour', 'isArray': False, 'isOptional': False}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/curious-containers/cc-core/blob/eaeb03a4366016aff54fcc6953d052ae12ed599b/cc_core/commons/cwl.py#L223-L244", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032931", "code": "def _getStrippedValue(value, strip):\n    \"\"\"Like the strip() string method, except the strip argument describes\n    different behavior:\n\n    If strip is None, whitespace is stripped.\n\n    If strip is a string, the characters in the string are stripped.\n\n    If strip is False, nothing is stripped.\"\"\"\n    if strip is None:\n        value = value.strip() # Call strip() with no arguments to strip whitespace.\n    elif isinstance(strip, str):\n        value = value.strip(strip) # Call strip(), passing the strip argument.\n    elif strip is False:\n        pass # Don't strip anything.\n    return value", "entry_point": "_getStrippedValue", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/asweigart/pysimplevalidate/blob/3ca27228abb7355d14bbf8abc225c63366379e44/src/pysimplevalidate/__init__.py#L87-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032932", "code": "def get_commit_url(repo_url):\n    \"\"\"Determine URL to view commits for repo.\"\"\"\n    if \"github.com\" in repo_url:\n        return repo_url[:-4] if repo_url.endswith(\".git\") else repo_url\n    if \"git.openstack.org\" in repo_url:\n        uri = '/'.join(repo_url.split('/')[-2:])\n        return \"https://github.com/{0}\".format(uri)\n\n    # If it didn't match these conditions, just return it.\n    return repo_url", "entry_point": "get_commit_url", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcbops/osa_differ/blob/b3452436655ba3db8cc6602390fd7fdf4ef30f01/osa_differ/osa_differ.py#L191-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032933", "code": "def normalize_yaml(yaml):\n    \"\"\"Normalize the YAML from project and role lookups.\n\n    These are returned as a list of tuples.\n    \"\"\"\n    if isinstance(yaml, list):\n        # Normalize the roles YAML data\n        normalized_yaml = [(x['name'], x['src'], x.get('version', 'HEAD'))\n                           for x in yaml]\n    else:\n        # Extract the project names from the roles YAML and create a list of\n        # tuples.\n        projects = [x[:-9] for x in yaml.keys() if x.endswith('git_repo')]\n        normalized_yaml = []\n        for project in projects:\n            repo_url = yaml['{0}_git_repo'.format(project)]\n            commit_sha = yaml['{0}_git_install_branch'.format(project)]\n            normalized_yaml.append((project, repo_url, commit_sha))\n\n    return normalized_yaml", "entry_point": "normalize_yaml", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcbops/osa_differ/blob/b3452436655ba3db8cc6602390fd7fdf4ef30f01/osa_differ/osa_differ.py#L332-L351", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032934", "code": "def _homogenize_data_filter(dfilter):\n    \"\"\"\n    Make data filter definition consistent.\n\n    Create a tuple where first element is the row filter and the second element\n    is the column filter\n    \"\"\"\n    if isinstance(dfilter, tuple) and (len(dfilter) == 1):\n        dfilter = (dfilter[0], None)\n    if (dfilter is None) or (dfilter == (None, None)) or (dfilter == (None,)):\n        dfilter = (None, None)\n    elif isinstance(dfilter, dict):\n        dfilter = (dfilter, None)\n    elif isinstance(dfilter, (list, str)) or (\n        isinstance(dfilter, int) and (not isinstance(dfilter, bool))\n    ):\n        dfilter = (None, dfilter if isinstance(dfilter, list) else [dfilter])\n    elif isinstance(dfilter[0], dict) or (\n        (dfilter[0] is None) and (not isinstance(dfilter[1], dict))\n    ):\n        pass\n    else:\n        dfilter = (dfilter[1], dfilter[0])\n    return dfilter", "entry_point": "_homogenize_data_filter", "input": "['apple', 'banana', 'cherry']", "output": "(None, ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/pcsv/blob/cd1588c19b0cd58c38bc672e396db940f88ffbd7/pcsv/csv_file.py#L38-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032935", "code": "def escape( x, lb=False ):\n    \"\"\"\n    Ensure a string does not contain HTML-reserved characters (including\n    double quotes)\n    Optionally also insert a linebreak if the string is too long\n    \"\"\"\n    # Insert a linebreak? Roughly around the middle of the string,\n    if lb:\n        l = len(x)\n        if l >= 10:\n            l >>= 1                     # middle of the string\n            s1 = x.find( ' ', l )       # first ws to the right\n            s2 = x.rfind( ' ', 0, l )   # first ws to the left\n            if s2 > 0:\n                s = s2 if s1<0 or l-s1 > s2-l else s1\n                x = x[:s] + '\\\\n' + x[s+1:]\n            elif s1 > 0:\n                x = x[:s1] + '\\\\n' + x[s1+1:]\n    # Escape HTML reserved characters\n    return x.replace(\"&\", \"&amp;\").replace(\"<\", \"&lt;\").replace(\">\", \"&gt;\").replace('\"', \"&quot;\")", "entry_point": "escape", "input": "'abc', {1, 2, 3}", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/paulovn/sparql-kernel/blob/1d2d155ff5da72070cb2a98fae33ea8113fac782/sparqlkernel/utils.py#L28-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032936", "code": "def lang_match_json(row, hdr, accepted_languages):\n    '''Find if the JSON row contains acceptable language data'''\n    if not accepted_languages:\n        return True\n    languages = set([row[c].get('xml:lang') for c in hdr\n                     if c in row and row[c]['type'] == 'literal'])\n    return (not languages) or (languages & accepted_languages)", "entry_point": "lang_match_json", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/paulovn/sparql-kernel/blob/1d2d155ff5da72070cb2a98fae33ea8113fac782/sparqlkernel/connection.py#L162-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032937", "code": "def dsr_thurai_2007(D_eq):\n    \"\"\"\n    Drop shape relationship function from Thurai2007\n    (http://dx.doi.org/10.1175/JTECH2051.1) paper.\n    Arguments:\n        D_eq: Drop volume-equivalent diameter (mm)\n\n    Returns:\n        r: The vertical-to-horizontal drop axis ratio. Note: the Scatterer class\n        expects horizontal to vertical, so you should pass 1/dsr_thurai_2007\n    \"\"\"\n\n    if D_eq < 0.7:\n        return 1.0\n    elif D_eq < 1.5:\n        return 1.173 - 0.5165*D_eq + 0.4698*D_eq**2 - 0.1317*D_eq**3 - \\\n            8.5e-3*D_eq**4\n    else:\n        return 1.065 - 6.25e-2*D_eq - 3.99e-3*D_eq**2 + 7.66e-4*D_eq**3 - \\\n            4.095e-5*D_eq**4", "entry_point": "dsr_thurai_2007", "input": "10", "output": "0.39749999999999996", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jleinonen/pytmatrix/blob/8803507fe5332786feab105fa74acf63e7121718/pytmatrix/tmatrix_aux.py#L47-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032938", "code": "def quote(myitem, elt=True):\n    '''URL encode string'''\n    if elt and '<' in myitem and len(myitem) > 24 and myitem.find(']]>') == -1:\n        return '<![CDATA[%s]]>' % (myitem)\n    else:\n        myitem = myitem.replace('&', '&amp;').\\\n            replace('<', '&lt;').replace(']]>', ']]&gt;')\n    if not elt:\n        myitem = myitem.replace('\"', '&quot;')\n    return myitem", "entry_point": "quote", "input": "'a,b,c', {}", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alanjcastonguay/pyforce/blob/d69a73c62725f411aa7c7588f3b231249935c068/src/pyforce/xmltramp.py#L37-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032939", "code": "def camel_case_to_under_score(camel_case_name):\n    \"\"\"Return the underscore name of a camel case name.\n\n    :param str camel_case_name: a name in camel case such as\n      ``\"ACamelCaseName\"``\n    :return: the name using underscores, e.g. ``\"a_camel_case_name\"``\n    :rtype: str\n    \"\"\"\n    result = []\n    for letter in camel_case_name:\n        if letter.lower() != letter:\n            result.append(\"_\" + letter.lower())\n        else:\n            result.append(letter.lower())\n    if result[0].startswith(\"_\"):\n        result[0] = result[0][1:]\n    return \"\".join(result)", "entry_point": "camel_case_to_under_score", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fossasia/AYABInterface/blob/e2065eed8daf17b2936f6ca5e488c9bfb850914e/AYABInterface/utils.py#L52-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032940", "code": "def _apply_rewrites(date_classes, rules):\n    \"\"\"\n    Return a list of date elements by applying rewrites to the initial date element list\n    \"\"\"\n    for rule in rules:\n        date_classes = rule.execute(date_classes)\n\n    return date_classes", "entry_point": "_apply_rewrites", "input": "{'x': [1, 2], 'y': []}, ()", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeffreystarr/dateinfer/blob/5db408cf93fd91e09cba952874c9728b04ca518d/dateinfer/infer.py#L84-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032941", "code": "def match(elem, seq_expr):\n        \"\"\"\n        Return True if elem (an element of elem_list) matches seq_expr, an element in self.sequence\n        \"\"\"\n        if type(seq_expr) is str:  # wild-card\n            if seq_expr == '.':  # match any element\n                return True\n            elif seq_expr == '\\d':\n                return elem.is_numerical()\n            elif seq_expr == '\\D':\n                return not elem.is_numerical()\n            else:  # invalid wild-card specified\n                raise LookupError('{0} is not a valid wild-card'.format(seq_expr))\n        else:  # date element\n            return elem == seq_expr", "entry_point": "match", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeffreystarr/dateinfer/blob/5db408cf93fd91e09cba952874c9728b04ca518d/dateinfer/ruleproc.py#L150-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032942", "code": "def get_point(grade_str):\n    \"\"\"\n    \u6839\u636e\u6210\u7ee9\u5224\u65ad\u7ee9\u70b9\n\n    :param grade_str: \u4e00\u4e2a\u5b57\u7b26\u4e32,\u56e0\u4e3a\u53ef\u80fd\u662f\u767e\u5206\u5236\u6210\u7ee9\u6216\u7b49\u7ea7\u5236\u6210\u7ee9\n    :return: \u6210\u7ee9\u7ee9\u70b9\n    :rtype: float\n    \"\"\"\n    try:\n        grade = float(grade_str)\n        assert 0 <= grade <= 100\n        if 95 <= grade <= 100:\n            return 4.3\n        elif 90 <= grade < 95:\n            return 4.0\n        elif 85 <= grade < 90:\n            return 3.7\n        elif 82 <= grade < 85:\n            return 3.3\n        elif 78 <= grade < 82:\n            return 3.0\n        elif 75 <= grade < 78:\n            return 2.7\n        elif 72 <= grade < 75:\n            return 2.3\n        elif 68 <= grade < 72:\n            return 2.0\n        elif 66 <= grade < 68:\n            return 1.7\n        elif 64 <= grade < 66:\n            return 1.3\n        elif 60 <= grade < 64:\n            return 1.0\n        else:\n            return 0.0\n    except ValueError:\n        if grade_str == '\u4f18':\n            return 3.9\n        elif grade_str == '\u826f':\n            return 3.0\n        elif grade_str == '\u4e2d':\n            return 2.0\n        elif grade_str == '\u53ca\u683c':\n            return 1.2\n        elif grade_str in ('\u4e0d\u53ca\u683c', '\u514d\u4fee', '\u672a\u8003'):\n            return 0.0\n        else:\n            raise ValueError('{:s} \u4e0d\u662f\u6709\u6548\u7684\u6210\u7ee9'.format(grade_str))", "entry_point": "get_point", "input": "2.0", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/earlzo/hfut/blob/09270a9647fba79f26fd1a8a3c53c0678b5257a1/hfut/util.py#L21-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032943", "code": "def dict_list_2_matrix(dict_list, columns):\n    \"\"\"\n        >>> dict_list_2_matrix([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}], ('a', 'b'))\n        [[1, 2], [3, 4]]\n\n    :param dict_list: \u5b57\u5178\u5217\u8868\n    :param columns: \u5b57\u5178\u7684\u952e\n    \"\"\"\n    k = len(columns)\n    n = len(dict_list)\n\n    result = [[None] * k for i in range(n)]\n    for i in range(n):\n        row = dict_list[i]\n        for j in range(k):\n            col = columns[j]\n            if col in row:\n                result[i][j] = row[col]\n            else:\n                result[i][j] = None\n    return result", "entry_point": "dict_list_2_matrix", "input": "{}, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/earlzo/hfut/blob/09270a9647fba79f26fd1a8a3c53c0678b5257a1/hfut/parser.py#L106-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032944", "code": "def unicode_to_hex(unicode_string):\n    \"\"\"\n    Return a string containing the Unicode hexadecimal codepoint\n    of each Unicode character in the given Unicode string.\n\n    Return ``None`` if ``unicode_string`` is ``None``.\n\n    Example::\n        a  => U+0061\n        ab => U+0061 U+0062\n\n    :param str unicode_string: the Unicode string to convert\n    :rtype: (Unicode) str\n    \"\"\"\n    if unicode_string is None:\n        return None\n    acc = []\n    for c in unicode_string:\n        s = hex(ord(c)).replace(\"0x\", \"\").upper()\n        acc.append(\"U+\" + (\"0\" * (4 - len(s))) + s)\n    return u\" \".join(acc)", "entry_point": "unicode_to_hex", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pettarin/ipapy/blob/ede4b3c40636f6eb90068369d31a2e75c7115324/ipapy/compatibility.py#L116-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032945", "code": "def is_valid_int_param(param):\n    \"\"\"Verifica se o par\u00e2metro \u00e9 um valor inteiro v\u00e1lido.\n\n    :param param: Valor para ser validado.\n\n    :return: True se o par\u00e2metro tem um valor inteiro v\u00e1lido, ou False, caso contr\u00e1rio.\n    \"\"\"\n    if param is None:\n        return False\n    try:\n        param = int(param)\n        if param < 0:\n            return False\n    except (TypeError, ValueError):\n        return False\n    return True", "entry_point": "is_valid_int_param", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/globocom/GloboNetworkAPI-client-python/blob/cf34f913da48d9abbf750114f5d2ac4b2dde137d/networkapiclient/utils.py#L21-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032946", "code": "def calc_mass(nu_max, delta_nu, teff):\n    \"\"\" asteroseismic scaling relations \"\"\"\n    NU_MAX = 3140.0 # microHz\n    DELTA_NU = 135.03 # microHz\n    TEFF = 5777.0\n    return (nu_max/NU_MAX)**3 * (delta_nu/DELTA_NU)**(-4) * (teff/TEFF)**1.5", "entry_point": "calc_mass", "input": "-1.5, True, 2.0", "output": "-2.3345186392053823e-07", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/annayqho/TheCannon/blob/8010a0a5dc9a3f9bb91efa79d7756f79b3c7ba9a/code/lamost/mass_age/cn/calc_astroseismic_mass.py#L3-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032947", "code": "def _try_pydatetime(x):\n    \"\"\"Try to convert to pandas objects to datetimes.\n\n    Plotly doesn't know how to handle them.\n    \"\"\"\n    try:\n        # for datetimeindex\n        x = [y.isoformat() for y in x.to_pydatetime()]\n    except AttributeError:\n        pass\n    try:\n        # for generic series\n        x = [y.isoformat() for y in x.dt.to_pydatetime()]\n    except AttributeError:\n        pass\n    return x", "entry_point": "_try_pydatetime", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jwkvam/plotlywrapper/blob/762b42912e824fecb1212c186900f2ebdd0ab12b/plotlywrapper.py#L68-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032948", "code": "def fill_padding(padded_string):\n    # type: (bytes) -> bytes\n    \"\"\"\n    Fill up missing padding in a string.\n\n    This function makes sure that the string has length which is multiplication of 4,\n    and if not, fills the missing places with dots.\n\n    :param str padded_string: string to be decoded that might miss padding dots.\n    :return: properly padded string\n    :rtype: str\n    \"\"\"\n    length = len(padded_string)\n    reminder = len(padded_string) % 4\n    if reminder:\n        return padded_string.ljust(length + 4 - reminder, b'.')\n    return padded_string", "entry_point": "fill_padding", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ClearcodeHQ/querystringsafe_base64/blob/5353c4a8e275435d9d38356a0db64e5c43198ccd/src/querystringsafe_base64/__init__.py#L27-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032949", "code": "def padd(text, padding=\"top\", size=1):\n    \"\"\" Adds extra new lines to the top, bottom or both of a String\n\n        @text: #str text to pad\n        @padding: #str 'top', 'bottom' or 'all'\n        @size: #int number of new lines\n\n        -> #str padded @text\n        ..\n            from vital.debug import *\n\n            padd(\"Hello world\")\n            # -> '\\\\nHello world'\n\n            padd(\"Hello world\", size=5, padding=\"all\")\n            # -> '\\\\n\\\\n\\\\n\\\\n\\\\nHello world\\\\n\\\\n\\\\n\\\\n\\\\n'\n        ..\n    \"\"\"\n    if padding:\n        padding = padding.lower()\n        pad_all = padding == 'all'\n        padding_top = \"\"\n        if padding and (padding == 'top' or pad_all):\n            padding_top = \"\".join(\"\\n\" for x in range(size))\n        padding_bottom = \"\"\n        if padding and (padding == 'bottom' or pad_all):\n            padding_bottom = \"\".join(\"\\n\" for x in range(size))\n        return \"{}{}{}\".format(padding_top, text, padding_bottom)\n    return text", "entry_point": "padd", "input": "'AbC dEf', [], 3", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/debug/__init__.py#L125-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032950", "code": "def choices_label(choices: tuple, value) -> str:\n    \"\"\"\n    Iterates (value,label) list and returns label matching the choice\n    :param choices: [(choice1, label1), (choice2, label2), ...]\n    :param value: Value to find\n    :return: label or None\n    \"\"\"\n    for key, label in choices:\n        if key == value:\n            return label\n    return ''", "entry_point": "choices_label", "input": "[], [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kajala/django-jutil/blob/2abd93ebad51042744eaeb1ee1074ed0eb55ad0c/jutil/dict.py#L13-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032951", "code": "def remove_blank_lines(string):\n    \"\"\" Removes all blank lines in @string\n\n        -> #str without blank lines\n    \"\"\"\n    return \"\\n\".join(line\n                     for line in string.split(\"\\n\")\n                     if len(line.strip()))", "entry_point": "remove_blank_lines", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/tools/strings.py#L214-L221", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032952", "code": "def add_modality(output_path, modality):\n    \"\"\"Modality can be appended to the file name (such as 'bold') or use in the\n    folder (such as \"func\"). You should always use the specific modality ('bold').\n    This function converts it to the folder name.\n    \"\"\"\n    if modality is None:\n        return output_path\n    else:\n        if modality in ('T1w', 'T2star', 'FLAIR', 'PD'):\n            modality = 'anat'\n\n        elif modality == 'bold':\n            modality = 'func'\n\n        elif modality == 'epi':  # topup\n            modality = 'fmap'\n\n        elif modality in ('electrodes', 'coordsystem', 'channels'):\n            modality = 'ieeg'\n\n        elif modality == 'events':\n            raise ValueError('modality \"events\" is ambiguous (can be in folder \"ieeg\" or \"func\"). Assuming \"ieeg\"')\n\n        return output_path / modality", "entry_point": "add_modality", "input": "2, -1.5", "output": "-1.3333333333333333", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gpiantoni/bidso/blob/af163b921ec4e3d70802de07f174de184491cfce/bidso/utils.py#L92-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032953", "code": "def _xml_tag_filter(s: str, strip_namespaces: bool) -> str:\n    \"\"\"\n    Returns tag name and optionally strips namespaces.\n    :param el: Element\n    :param strip_namespaces: Strip namespace prefix\n    :return: str\n    \"\"\"\n    if strip_namespaces:\n        ns_end = s.find('}')\n        if ns_end != -1:\n            s = s[ns_end+1:]\n        else:\n            ns_end = s.find(':')\n            if ns_end != -1:\n                s = s[ns_end+1:]\n    return s", "entry_point": "_xml_tag_filter", "input": "'', 3.25", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kajala/django-jutil/blob/2abd93ebad51042744eaeb1ee1074ed0eb55ad0c/jutil/xml.py#L27-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032954", "code": "def unique_list(seq):\n    \"\"\" Removes duplicate elements from given @seq\n\n        @seq: a #list or sequence-like object\n\n        -> #list\n    \"\"\"\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if not (x in seen or seen_add(x))]", "entry_point": "unique_list", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/tools/lists.py#L17-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032955", "code": "def encode_character(char):\n    \"\"\"Returns URL encoding for a single character\n\n    :param char (str) Single character to encode\n    :returns (str) URL-encoded character\n    \"\"\"\n    if char == '!': return '%21'\n    elif char == '\"': return '%22'\n    elif char == '#': return '%23'\n    elif char == '$': return '%24'\n    elif char == '%': return '%25'\n    elif char == '&': return '%26'\n    elif char == '\\'': return '%27'\n    elif char == '(': return '%28'\n    elif char == ')': return '%29'\n    elif char == '*': return '%2A'\n    elif char == '+': return '%2B'\n    elif char == ',': return '%2C'\n    elif char == '-': return '%2D'\n    elif char == '.': return '%2E'\n    elif char == '/': return '%2F'\n    elif char == ':': return '%3A'\n    elif char == ';': return '%3B'\n    elif char == '<': return '%3C'\n    elif char == '=': return '%3D'\n    elif char == '>': return '%3E'\n    elif char == '?': return '%3F'\n    elif char == '@': return '%40'\n    elif char == '[': return '%5B'\n    elif char == '\\\\': return '%5C'\n    elif char == ']': return '%5D'\n    elif char == '^': return '%5E'\n    elif char == '_': return '%5F'\n    elif char == '`': return '%60'\n    elif char == '{': return '%7B'\n    elif char == '|': return '%7C'\n    elif char == '}': return '%7D'\n    elif char == '~': return '%7E'\n    elif char == ' ': return '%7F'\n    else: return char", "entry_point": "encode_character", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cons3rt/pycons3rt/blob/f004ab3a35c5bff2f698131fef3b2a8ed5a7596d/pycons3rt/pygit.py#L152-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032956", "code": "def _sc_encode(gain, peak):\n    \"\"\"Encode ReplayGain gain/peak values as a Sound Check string.\n    \"\"\"\n    # SoundCheck stores the peak value as the actual value of the\n    # sample, rather than the percentage of full scale that RG uses, so\n    # we do a simple conversion assuming 16 bit samples.\n    peak *= 32768.0\n\n    # SoundCheck stores absolute RMS values in some unknown units rather\n    # than the dB values RG uses. We can calculate these absolute values\n    # from the gain ratio using a reference value of 1000 units. We also\n    # enforce the maximum value here, which is equivalent to about\n    # -18.2dB.\n    g1 = int(min(round((10 ** (gain / -10)) * 1000), 65534))\n    # Same as above, except our reference level is 2500 units.\n    g2 = int(min(round((10 ** (gain / -10)) * 2500), 65534))\n\n    # The purpose of these values are unknown, but they also seem to be\n    # unused so we just use zero.\n    uk = 0\n    values = (g1, g1, g2, g2, uk, uk, int(peak), int(peak), uk, uk)\n    return (u' %08X' * 10) % values", "entry_point": "_sc_encode", "input": "True, 5", "output": "' 0000031A 0000031A 000007C2 000007C2 00000000 00000000 00028000 00028000 00000000 00000000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Josef-Friedrich/phrydy/blob/aa13755155977b4776e49f79984f9968ac1d74dc/phrydy/mediafile.py#L283-L304", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032957", "code": "def aes_pad(s, block_size=32, padding='{'):\n    \"\"\" Adds padding to get the correct block sizes for AES encryption\n\n        @s: #str being AES encrypted or decrypted\n        @block_size: the AES block size\n        @padding: character to pad with\n\n        -> padded #str\n\n        ..\n            from vital.security import aes_pad\n            aes_pad(\"swing\")\n            # -> 'swing{{{{{{{{{{{{{{{{{{{{{{{{{{{'\n        ..\n    \"\"\"\n    return s + (block_size - len(s) % block_size) * padding", "entry_point": "aes_pad", "input": "['a', 'b', 'c'], 5, [-1, 0, 1, 2]", "output": "['a', 'b', 'c', -1, 0, 1, 2, -1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/security/__init__.py#L123-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032958", "code": "def lscmp(a, b):\n    \"\"\" Compares two strings in a cryptographically safe way:\n        Runtime is not affected by length of common prefix, so this\n        is helpful against timing attacks.\n\n        ..\n            from vital.security import lscmp\n            lscmp(\"ringo\", \"starr\")\n            # -> False\n            lscmp(\"ringo\", \"ringo\")\n            # -> True\n        ..\n    \"\"\"\n    l = len\n    return not sum(0 if x == y else 1 for x, y in zip(a, b)) and l(a) == l(b)", "entry_point": "lscmp", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/security/__init__.py#L159-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032959", "code": "def expandValues(inputs, count, name):\n    \"\"\"Returns the input list with the length of `count`. If the\n    list is [1] and the count is 3. [1,1,1] is returned. The list\n    must be the count length or 1. Normally called from `expandParameters()`\n    where `name` is the symbolic name of the input.\n    \"\"\"\n    if len(inputs) == count:\n        expanded = inputs\n    elif len(inputs) == 1:\n        expanded = inputs * count\n    else:\n        raise ValueError('Incompatible number of values for ' + name)\n    return expanded", "entry_point": "expandValues", "input": "[], 0, ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/InformaticsMatters/pipelines-utils/blob/058aa6eceeff28c4ae402f6f58c58720bff0298e/src/python/pipelines_utils/parameter_utils.py#L76-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032960", "code": "def _clean_text(text):\n    \"\"\"\n    Clean up a multiple-line, potentially multiple-paragraph text\n    string.  This is used to extract the first paragraph of a string\n    and eliminate line breaks and indentation.  Lines will be joined\n    together by a single space.\n\n    :param text: The text string to clean up.  It is safe to pass\n                 ``None``.\n\n    :returns: The first paragraph, cleaned up as described above.\n    \"\"\"\n\n    desc = []\n    for line in (text or '').strip().split('\\n'):\n        # Clean up the line...\n        line = line.strip()\n\n        # We only want the first paragraph\n        if not line:\n            break\n\n        desc.append(line)\n\n    return ' '.join(desc)", "entry_point": "_clean_text", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klmitch/cli_tools/blob/3f9b5fd8d7458a402b3999618644ffa419d8a946/cli_tools.py#L28-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032961", "code": "def mean(data):\n    \"\"\"Return the sample arithmetic mean of data.\"\"\"\n    #: http://stackoverflow.com/a/27758326\n    n = len(data)\n    if n < 1:\n        raise ValueError('mean requires at least one data point')\n    return sum(data)/n", "entry_point": "mean", "input": "[5, 3, 1, 4]", "output": "3.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/debug/stats.py#L19-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032962", "code": "def median(lst):\n    \"\"\" Calcuates the median value in a @lst \"\"\"\n    #: http://stackoverflow.com/a/24101534\n    sortedLst = sorted(lst)\n    lstLen = len(lst)\n    index = (lstLen - 1) // 2\n    if (lstLen % 2):\n        return sortedLst[index]\n    else:\n        return (sortedLst[index] + sortedLst[index + 1])/2.0", "entry_point": "median", "input": "[-1, 0, 1, 2]", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/debug/stats.py#L47-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032963", "code": "def recode_unicode(s, encoding='utf-8'):\n    \"\"\" Inputs are encoded to utf-8 and then decoded to the desired\n        output encoding\n\n        @encoding: the desired encoding\n\n        -> #str with the desired @encoding\n    \"\"\"\n    if isinstance(s, str):\n        return s.encode().decode(encoding)\n    return s", "entry_point": "recode_unicode", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaredLunde/vital-tools/blob/ea924c9bbb6ec22aa66f8095f018b1ee0099ac04/vital/tools/encoding.py#L78-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032964", "code": "def __replace_an(sentence):\n    \"\"\"Lets find and replace all instances of #AN\n    This is a little different, as this depends on whether the next\n    word starts with a vowel or a consonant.\n\n    :param _sentence:\n    \"\"\"\n\n    if sentence is not None:\n        while sentence.find('#AN') != -1:\n            an_index = sentence.find('#AN')\n\n            if an_index > -1:\n                an_index += 4\n\n                if sentence[an_index] in 'aeiouAEIOU':\n                    sentence = sentence.replace('#AN', str('an'), 1)\n                else:\n                    sentence = sentence.replace('#AN', str('a'), 1)\n\n            if sentence.find('#AN') == -1:\n                return sentence\n        return sentence\n    else:\n        return sentence", "entry_point": "__replace_an", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Morrolan/surrealism/blob/7fdd2eae534410df16ee1f9d7e9bb77aa10decab/surrealism.py#L659-L683", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032965", "code": "def __replace_capall(sentence):\n    \"\"\"here we replace all instances of #CAPALL and cap the entire sentence.\n    Don't believe that CAPALL is buggy anymore as it forces all uppercase OK?\n\n    :param _sentence:\n        \"\"\"\n\n    # print \"\\nReplacing CAPITALISE:  \"\n\n    if sentence is not None:\n        while sentence.find('#CAPALL') != -1:\n            # _cap_index = _sentence.find('#CAPALL')\n            sentence = sentence.upper()\n            sentence = sentence.replace('#CAPALL ', '', 1)\n\n        if sentence.find('#CAPALL') == -1:\n            return sentence\n    else:\n        return sentence", "entry_point": "__replace_capall", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Morrolan/surrealism/blob/7fdd2eae534410df16ee1f9d7e9bb77aa10decab/surrealism.py#L793-L811", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032966", "code": "def _match_tags(repex_tags, path_tags):\n    \"\"\"Check for matching tags between what the user provided\n    and the tags set in the config.\n\n    If `any` is chosen, match.\n    If no tags are chosen and none are configured, match.\n    If the user provided tags match any of the configured tags, match.\n    \"\"\"\n    if 'any' in repex_tags or (not repex_tags and not path_tags):\n        return True\n    elif set(repex_tags) & set(path_tags):\n        return True\n    return False", "entry_point": "_match_tags", "input": "[1, 2, 3], ''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudify-cosmo/repex/blob/589e442857fa4a99fa88670d7df1a72f983bbd28/repex.py#L328-L340", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032967", "code": "def filter_locals(locals_dict, drop=None, include=None):\n    \"\"\"Filters a dictionary produced by locals().\n\n    :param dict locals_dict:\n\n    :param list drop: Keys to drop from dict.\n\n    :param list include: Keys to include into dict.\n\n    :rtype: dict\n    \"\"\"\n    drop = drop or []\n    drop.extend([\n        'self',\n        '__class__',  # py3\n    ])\n\n    include = include or locals_dict.keys()\n\n    relevant_keys = [key for key in include if key not in drop]\n\n    locals_dict = {k: v for k, v in locals_dict.items() if k in relevant_keys}\n\n    return locals_dict", "entry_point": "filter_locals", "input": "{'a': 1, 'b': 2}, [[1, 2], [3], []], [-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L160-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032968", "code": "def truncate_ellipsis(line, length=30):\n    \"\"\"Truncate a line to the specified length followed by ``...`` unless its shorter than length already.\"\"\"\n\n    l = len(line)\n    return line if l < length else line[:length - 3] + \"...\"", "entry_point": "truncate_ellipsis", "input": "'  padded  ', -3", "output": "'  pa...'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aljungberg/pyle/blob/e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499/pyle.py#L43-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032969", "code": "def copy_and_update(dictionary, update):\n    \"\"\"Returns an updated copy of the dictionary without modifying the original\"\"\"\n    newdict = dictionary.copy()\n    newdict.update(update)\n    return newdict", "entry_point": "copy_and_update", "input": "{'x': [1, 2], 'y': []}, []", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriver/browsercapabilities.py#L4-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032970", "code": "def list2dict(list_of_options):\n    \"\"\"Transforms a list of 2 element tuples to a dictionary\"\"\"\n    d = {}\n    for key, value in list_of_options:\n        d[key] = value\n    return d", "entry_point": "list2dict", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/honeynet/beeswarm/blob/db51ea0bc29f631c3e3b5312b479ac9d5e31079a/beeswarm/drones/honeypot/helpers/common.py#L10-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032971", "code": "def _extract_version(version_string, pattern):\n    \"\"\" Extract the version from `version_string` using `pattern`.\n\n    Return the version as a string, with leading/trailing whitespace\n    stripped.\n\n    \"\"\"\n    if version_string:\n        match = pattern.match(version_string.strip())\n        if match:\n            return match.group(1)\n    return \"\"", "entry_point": "_extract_version", "input": "'', ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sonyxperiadev/pygerrit/blob/756300120b0f4f4af19e0f985566d82bc80b4359/pygerrit/ssh.py#L36-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032972", "code": "def convert_data_array(array, filter_func=None, converter_func=None):  # TODO: add copy parameter, otherwise in-place\r\n    '''Filter and convert raw data numpy array (numpy.ndarray).\r\n\r\n    Parameters\r\n    ----------\r\n    array : numpy.array\r\n        Raw data array.\r\n    filter_func : function\r\n        Function that takes array and returns true or false for each item in array.\r\n    converter_func : function\r\n        Function that takes array and returns an array or tuple of arrays.\r\n\r\n    Returns\r\n    -------\r\n    data_array : numpy.array\r\n        Data numpy array of specified dimension (converter_func) and content (filter_func)\r\n    '''\r\n#     if filter_func != None:\r\n#         if not hasattr(filter_func, '__call__'):\r\n#             raise ValueError('Filter is not callable')\r\n    if filter_func:\r\n        array = array[filter_func(array)]\r\n#     if converter_func != None:\r\n#         if not hasattr(converter_func, '__call__'):\r\n#             raise ValueError('Converter is not callable')\r\n    if converter_func:\r\n        array = converter_func(array)\r\n    return array", "entry_point": "convert_data_array", "input": "[1, 2, 3], [], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SiLab-Bonn/pyBAR/blob/5ad95bbcd41cd358825823fb78f396cfce23593e/pybar/daq/readout_utils.py#L52-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032973", "code": "def mkpad(items):\n    '''\n    Find the length of the longest element of a list. Return that value + two.\n    '''\n    pad = 0\n    stritems = [str(e) for e in items]  # cast list to strings\n    for e in stritems:\n        index = stritems.index(e)\n        if len(stritems[index]) > pad:\n            pad = len(stritems[index])\n    pad += 2\n    return pad", "entry_point": "mkpad", "input": "[1, 2, 3]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tslight/columns/blob/609ec92c00c9a6d452d4c6cc20551882997d4871/columns/columns.py#L5-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032974", "code": "def mkcols(l, rows):\n    '''\n    Compute the size of our columns by first making them a divisible of our row\n    height and then splitting our list into smaller lists the size of the row\n    height.\n    '''\n    cols = []\n    base = 0\n    while len(l) > rows and len(l) % rows != 0:\n        l.append(\"\")\n    for i in range(rows, len(l) + rows, rows):\n        cols.append(l[base:i])\n        base = i\n    return cols", "entry_point": "mkcols", "input": "['apple', 'banana', 'cherry'], 3", "output": "[['apple', 'banana', 'cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tslight/columns/blob/609ec92c00c9a6d452d4c6cc20551882997d4871/columns/columns.py#L19-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032975", "code": "def find_nuc_indel(gapped_seq, indel_seq):\n    \"\"\"\n    This function finds the entire indel missing in from a gapped sequence \n    compared to the indel_seqeunce. It is assumes that the sequences start\n    with the first position of the gap.\n    \"\"\"\n    ref_indel = indel_seq[0]\n    for j in range(1,len(gapped_seq)):\n        if gapped_seq[j] == \"-\":\n            ref_indel += indel_seq[j]\n        else:\n            break\n    return ref_indel", "entry_point": "find_nuc_indel", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/pointfinder/PointFinder.py#L552-L564", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032976", "code": "def get_inframe_gap(seq, nucs_needed = 3):\n    \"\"\"\n    This funtion takes a sequnece starting with a gap or the complementary \n    seqeuence to the gap, and the number of nucleotides that the seqeunce\n    should contain in order to maintain the correct reading frame. The \n    sequence is gone through and the number of non-gap characters are \n    counted. When the number has reach the number of needed nucleotides \n    the indel is returned. If the indel is a 'clean' insert or deletion \n    that starts in the start of a codon and can be divided by 3, then only \n    the gap is returned.\n    \"\"\"\n    nuc_count = 0\n    gap_indel  = \"\"\n    nucs = \"\"\n    for i in range(len(seq)):\n\n        # Check if the character is not a gap\n        if seq[i] != \"-\":\n\n            # Check if the indel is a 'clean' \n            # i.e. if the insert or deletion starts at the first nucleotide in the codon and can be divided by 3\n            if gap_indel.count(\"-\") == len(gap_indel) and gap_indel.count(\"-\") >= 3 and len(gap_indel) != 0:\n                return gap_indel\n            nuc_count += 1\n        gap_indel += seq[i]\n\n        # If the number of nucleotides in the indel equals the amount needed for the indel, the indel is returned.\n        if nuc_count == nucs_needed:\n            return gap_indel\n\n    # This will only happen if the gap is in the very end of a sequence\n    return gap_indel", "entry_point": "get_inframe_gap", "input": "[], [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/pointfinder/PointFinder.py#L699-L730", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032977", "code": "def _padded_hex(i, pad_width=4, uppercase=True):\n    \"\"\"\n    Helper function for taking an integer and returning a hex string.  The string will be padded on the left with zeroes\n    until the string is of the specified width.  For example:\n\n    _padded_hex(31, pad_width=4, uppercase=True) -> \"001F\"\n\n    :param i: integer to convert to a hex string\n    :param pad_width: (int specifying the minimum width of the output string.  String will be padded on the left with '0'\n                      as needed.\n    :param uppercase: Boolean indicating if we should use uppercase characters in the output string (default=True).\n    :return: Hex string representation of the input integer.\n    \"\"\"\n    result = hex(i)[2:]  # Remove the leading \"0x\"\n    if uppercase:\n        result = result.upper()\n    return result.zfill(pad_width)", "entry_point": "_padded_hex", "input": "2, 10, 2", "output": "'0000000002'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/leonidessaguisagjr/unicodeutil/blob/c25c882cf9cb38c123df49fad365be67e5818928/unicodeutil/unicodeutil.py#L75-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032978", "code": "def cigar2query(template, cigar):\n   ''' Generate query sequence from the template and extended cigar annotation\n   \n   USAGE:\n      >>> template = 'CGATCGATAAATAGAGTAGGAATAGCA'\n      >>> cigar = ':6-ata:10+gtc:4*at:3'\n      >>> cigar2query(template, cigar) == 'CGATCGAATAGAGTAGGTCGAATtGCA'.upper()\n      True\n   '''\n   query = []\n   entries = ['+','-','*',':']\n   number = list(map(str,range(10)))\n   cigar_length = len(cigar)\n   num = []\n   entry = None\n   pos = 0\n   i = 0\n   while i < cigar_length:\n      if cigar[i] in entries:\n         # New entry\n         if entry == ':':\n            old_pos = pos\n            pos += int(''.join(num))\n            query.append(template[old_pos:pos])\n            num = []\n         entry = cigar[i]\n         if entry == '*':\n            i += 2\n            query.append(cigar[i])\n            pos += 1\n      elif cigar[i] in number:\n         num.append(cigar[i])\n      elif entry == '-':\n         pos += 1\n      elif entry == '+':\n         query.append(cigar[i])\n      i += 1\n   \n   if entry == ':':\n      old_pos = pos\n      pos += int(''.join(num))\n      query.append(template[old_pos:pos])\n   \n   return ''.join(query).upper()", "entry_point": "cigar2query", "input": "[1, 2, 3], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/cgecore/alignment.py#L85-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032979", "code": "def unpack_bits( byte ):\n    \"\"\"Expand a bitfield into a 64-bit int (8 bool bytes).\"\"\"\n    longbits = byte & (0x00000000000000ff)\n    longbits = (longbits | (longbits<<28)) & (0x0000000f0000000f)\n    longbits = (longbits | (longbits<<14)) & (0x0003000300030003)\n    longbits = (longbits | (longbits<<7)) & (0x0101010101010101)\n    return longbits", "entry_point": "unpack_bits", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moralrecordings/mrcrowbar/blob/b1ed882c4555552e7656b2d84aca543184577fa3/mrcrowbar/utils.py#L376-L382", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032980", "code": "def pack_bits( longbits ):\n    \"\"\"Crunch a 64-bit int (8 bool bytes) into a bitfield.\"\"\"\n    byte = longbits & (0x0101010101010101)\n    byte = (byte | (byte>>7)) & (0x0003000300030003)\n    byte = (byte | (byte>>14)) & (0x0000000f0000000f)\n    byte = (byte | (byte>>28)) & (0x00000000000000ff)\n    return byte", "entry_point": "pack_bits", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moralrecordings/mrcrowbar/blob/b1ed882c4555552e7656b2d84aca543184577fa3/mrcrowbar/utils.py#L385-L391", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032981", "code": "def dateheure(objet):\n        \"\"\" abstractRender d'une date-heure datetime.datetime au format JJ/MM/AAAA\u00e0HH:mm \"\"\"\n        if objet:\n            return \"{}/{}/{} \u00e0 {:02}:{:02}\".format(objet.day, objet.month, objet.year, objet.hour, objet.minute)\n        return \"\"", "entry_point": "dateheure", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/formats.py#L257-L261", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032982", "code": "def replace_umlauts(word, put_back=False):  # use translate()\n    '''If put_back is True, put in umlauts; else, take them out!'''\n    if put_back:\n        word = word.replace('A', '\u00e4')\n        word = word.replace('O', '\u00f6')\n\n    else:\n        word = word.replace('\u00e4', 'A').replace('\\xc3\\xa4', 'A')\n        word = word.replace('\u00f6', 'O').replace('\\xc3\\xb6', 'O')\n\n    return word", "entry_point": "replace_umlauts", "input": "'AbC dEf', [1, 2, 3]", "output": "'\u00e4bC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/phonology.py#L203-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032983", "code": "def remove_lines(lines, remove=('[[back to top]', '<a class=\"mk-toclify\"')):\n    \"\"\"Removes existing [back to top] links and <a id> tags.\"\"\"\n\n    if not remove:\n        return lines[:]\n\n    out = []\n    for l in lines:\n        if l.startswith(remove):\n            continue\n        out.append(l)\n    return out", "entry_point": "remove_lines", "input": "'', [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rasbt/markdown-toclify/blob/517cde672bebda5371130b87c1fcb7184d141a02/markdown_toclify/markdown_toclify.py#L41-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032984", "code": "def positioning_headlines(headlines):\n    \"\"\"\n    Strips unnecessary whitespaces/tabs if first header is not left-aligned\n    \"\"\"\n    left_just = False\n    for row in headlines:\n        if row[-1] == 1:\n            left_just = True\n            break\n    if not left_just:\n        for row in headlines:\n            row[-1] -= 1\n    return headlines", "entry_point": "positioning_headlines", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rasbt/markdown-toclify/blob/517cde672bebda5371130b87c1fcb7184d141a02/markdown_toclify/markdown_toclify.py#L160-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032985", "code": "def validate_many(d, schema):\n    \"\"\"Validate a dictionary of data against the provided schema.\n\n    Returns a list of values positioned in the same order as given in ``schema``, each\n    value is validated with the corresponding validator. Raises formencode.Invalid if\n    validation failed.\n\n    Similar to get_many but using formencode validation.\n\n    :param d: A dictionary of data to read values from.\n    :param schema: A list of (key, validator) tuples. The key will be used to fetch\n        a value from ``d`` and the validator will be applied to it.\n\n    Example::\n\n        from formencode import validators\n\n        email, password, password_confirm = validate_many(request.params, [\n            ('email', validators.Email(not_empty=True)),\n            ('password', validators.String(min=4)),\n            ('password_confirm', validators.String(min=4)),\n        ])\n    \"\"\"\n    return [validator.to_python(d.get(key), state=key) for key,validator in schema]", "entry_point": "validate_many", "input": "['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shazow/unstdlib.py/blob/e0632fe165cfbfdb5a7e4bc7b412c9d6f2ebad83/unstdlib/formencode.py#L12-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032986", "code": "def number_to_string(n, alphabet):\n    \"\"\"\n    Given an non-negative integer ``n``, convert it to a string composed of\n    the given ``alphabet`` mapping, where the position of each element in\n    ``alphabet`` is its radix value.\n\n    Examples::\n\n        >>> number_to_string(12345678, '01')\n        '101111000110000101001110'\n\n        >>> number_to_string(12345678, 'ab')\n        'babbbbaaabbaaaababaabbba'\n\n        >>> number_to_string(12345678, string.ascii_letters + string.digits)\n        'ZXP0'\n\n        >>> number_to_string(12345, ['zero ', 'one ', 'two ', 'three ', 'four ', 'five ', 'six ', 'seven ', 'eight ', 'nine '])\n        'one two three four five '\n\n    \"\"\"\n    result = ''\n    base = len(alphabet)\n    current = int(n)\n    if current < 0:\n        raise ValueError(\"invalid n (must be non-negative): %s\", n)\n    while current:\n        result = alphabet[current % base] + result\n        current = current // base\n\n    return result", "entry_point": "number_to_string", "input": "False, set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shazow/unstdlib.py/blob/e0632fe165cfbfdb5a7e4bc7b412c9d6f2ebad83/unstdlib/standard/string_.py#L53-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032987", "code": "def create_helping_material_info(helping):\n    \"\"\"Create helping_material_info field.\"\"\"\n    helping_info = None\n    file_path = None\n    if helping.get('info'):\n        helping_info = helping['info']\n    else:\n        helping_info = helping\n    if helping_info.get('file_path'):\n        file_path = helping_info.get('file_path')\n        del helping_info['file_path']\n    return helping_info, file_path", "entry_point": "create_helping_material_info", "input": "{'x': [1, 2], 'y': []}", "output": "({'x': [1, 2], 'y': []}, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Scifabric/pbs/blob/3e5d5f3f0f5d20f740eaacc4d6e872a0c9fb8b38/helpers.py#L410-L421", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032988", "code": "def load_metadata_csv_single_user(csv_in, header, tags_idx):\n    \"\"\"\n    Return the metadata as requested for a single user.\n\n    :param csv_in: This field is the csv file to return metadata from.\n    :param header: This field contains the headers in the csv file\n    :param tags_idx: This field contains the index of the tags in the csv\n        file.\n    \"\"\"\n    metadata = {}\n    n_headers = len(header)\n    for index, row in enumerate(csv_in, 2):\n        if row[0] == \"\":\n            raise ValueError('Error: In row number ' + str(index) + ':' +\n                             ' \"filename\" must not be empty.')\n        if row[0] == 'None' and [x == 'NA' for x in row[1:]]:\n            break\n        if len(row) != n_headers:\n            raise ValueError('Error: In row number ' + str(index) + ':' +\n                             ' Number of columns (' + str(len(row)) +\n                             ') doesnt match Number of headings (' +\n                             str(n_headers) + ')')\n        metadata[row[0]] = {\n            header[i]: row[i] for i in range(1, len(header)) if\n            i != tags_idx\n        }\n        metadata[row[0]]['tags'] = [t.strip() for t in\n                                    row[tags_idx].split(',') if\n                                    t.strip()]\n    return metadata", "entry_point": "load_metadata_csv_single_user", "input": "[], [-1, 0, 1, 2], 1", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenHumans/open-humans-api/blob/ca2a28cf5d55cfdae13dd222ba58c25565bdb86e/ohapi/utils_fs.py#L107-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032989", "code": "def _roundSlist(slist):\n    \"\"\" Rounds a signed list over the last element and removes it. \"\"\"\n    slist[-1] = 60 if slist[-1] >= 30 else 0\n    for i in range(len(slist)-1, 1, -1):\n        if slist[i] == 60:\n            slist[i] = 0\n            slist[i-1] += 1\n    return slist[:-1]", "entry_point": "_roundSlist", "input": "[1, 2, 3]", "output": "[1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L58-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032990", "code": "def slistFloat(slist):\n    \"\"\" Converts signed list to float. \"\"\"\n    values = [v / 60**(i) for (i,v) in enumerate(slist[1:])]\n    value = sum(values)\n    return -value if slist[0] == '-' else value", "entry_point": "slistFloat", "input": "[1, 2, 3]", "output": "2.05", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L82-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032991", "code": "def jdnDate(jdn):\n    \"\"\" Converts Julian Day Number to Gregorian date. \"\"\"\n    a = jdn + 32044\n    b = (4*a + 3) // 146097\n    c = a - (146097*b) // 4\n    d = (4*c + 3) // 1461\n    e = c - (1461*d) // 4\n    m = (5*e + 2) // 153\n    day = e + 1 - (153*m + 2) // 5\n    month = m + 3 - 12*(m//10)\n    year = 100*b + d - 4800 + m//10\n    return [year, month, day]", "entry_point": "jdnDate", "input": "3", "output": "[-4713, 11, 27]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/datetime.py#L36-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032992", "code": "def _merge(listA, listB):\n    \"\"\" Merges two list of objects removing\n    repetitions. \n    \n    \"\"\"\n    listA = [x.id for x in listA]\n    listB = [x.id for x in listB]\n    listA.extend(listB)\n    set_ = set(listA)\n    return list(set_)", "entry_point": "_merge", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/protocols/behavior.py#L16-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032993", "code": "def lag_observations(observations, lag, stride=1):\n    r\"\"\" Create new trajectories that are subsampled at lag but shifted\n\n    Given a trajectory (s0, s1, s2, s3, s4, ...) and lag 3, this function will generate 3 trajectories\n    (s0, s3, s6, ...), (s1, s4, s7, ...) and (s2, s5, s8, ...). Use this function in order to parametrize a MLE\n    at lag times larger than 1 without discarding data. Do not use this function for Bayesian estimators, where\n    data must be given such that subsequent transitions are uncorrelated.\n\n    Parameters\n    ----------\n    observations : list of int arrays\n        observation trajectories\n    lag : int\n        lag time\n    stride : int, default=1\n        will return only one trajectory for every stride. Use this for Bayesian analysis.\n\n    \"\"\"\n    obsnew = []\n    for obs in observations:\n        for shift in range(0, lag, stride):\n            obs_lagged = (obs[shift:][::lag])\n            if len(obs_lagged) > 1:\n                obsnew.append(obs_lagged)\n    return obsnew", "entry_point": "lag_observations", "input": "[], [], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bhmm/bhmm/blob/9804d18c2ddb684fb4d90b544cc209617a89ca9a/bhmm/api.py#L70-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032994", "code": "def predicative(adjective):\n    \"\"\" Returns the predicative adjective (lowercase).\n        In German, the attributive form preceding a noun is always used:\n        \"ein kleiner Junge\" => strong, masculine, nominative,\n        \"eine sch\u00f6ne Frau\" => mixed, feminine, nominative,\n        \"der kleine Prinz\" => weak, masculine, nominative, etc.\n        The predicative is useful for lemmatization.\n    \"\"\"\n    w = adjective.lower()\n    if len(w) > 3:\n        for suffix in (\"em\", \"en\", \"er\", \"es\", \"e\"):\n            if w.endswith(suffix):\n                b = w[:max(-len(suffix), -(len(w)-3))]\n                if b.endswith(\"bl\"): # plausibles => plausibel\n                    b = b[:-1] + \"el\"\n                if b.endswith(\"pr\"): # propres => proper\n                    b = b[:-1] + \"er\"\n                return b\n    return w", "entry_point": "predicative", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markuskiller/textblob-de/blob/1b427b2cdd7e5e9fd3697677a98358fae4aa6ad1/textblob_de/ext/_pattern/text/de/inflect.py#L543-L561", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032995", "code": "def unique(iterable):\n    \"\"\" Returns a list copy in which each item occurs only once (in-order).\n    \"\"\"\n    seen = set()\n    return [x for x in iterable if x not in seen and not seen.add(x)]", "entry_point": "unique", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markuskiller/textblob-de/blob/1b427b2cdd7e5e9fd3697677a98358fae4aa6ad1/textblob_de/ext/_pattern/text/search.py#L127-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032996", "code": "def _suffix_rules(token, tag=\"NN\"):\n    \"\"\" Default morphological tagging rules for English, based on word suffixes.\n    \"\"\"\n    if isinstance(token, (list, tuple)):\n        token, tag = token\n    if token.endswith(\"ing\"):\n        tag = \"VBG\"\n    if token.endswith(\"ly\"):\n        tag = \"RB\"\n    if token.endswith(\"s\") and not token.endswith((\"is\", \"ous\", \"ss\")):\n        tag = \"NNS\"\n    if token.endswith((\"able\", \"al\", \"ful\", \"ible\", \"ient\", \"ish\", \"ive\", \"less\", \"tic\", \"ous\")) or \"-\" in token:\n        tag = \"JJ\"\n    if token.endswith(\"ed\"):\n        tag = \"VBN\"\n    if token.endswith((\"ate\", \"ify\", \"ise\", \"ize\")):\n        tag = \"VBP\"\n    return [token, tag]", "entry_point": "_suffix_rules", "input": "'', True", "output": "['', True]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markuskiller/textblob-de/blob/1b427b2cdd7e5e9fd3697677a98358fae4aa6ad1/textblob_de/ext/_pattern/text/__init__.py#L1053-L1070", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032997", "code": "def find_prepositions(chunked):\n    \"\"\" The input is a list of [token, tag, chunk]-items.\n        The output is a list of [token, tag, chunk, preposition]-items.\n        PP-chunks followed by NP-chunks make up a PNP-chunk.\n    \"\"\"\n    # Tokens that are not part of a preposition just get the O-tag.\n    for ch in chunked:\n        ch.append(\"O\")\n    for i, chunk in enumerate(chunked):\n        if chunk[2].endswith(\"PP\") and chunk[-1] == \"O\":\n            # Find PP followed by other PP, NP with nouns and pronouns, VP with a gerund.\n            if i < len(chunked)-1 and \\\n             (chunked[i+1][2].endswith((\"NP\", \"PP\")) or \\\n              chunked[i+1][1] in (\"VBG\", \"VBN\")):\n                chunk[-1] = \"B-PNP\"\n                pp = True\n                for ch in chunked[i+1:]:\n                    if not (ch[2].endswith((\"NP\", \"PP\")) or ch[1] in (\"VBG\", \"VBN\")):\n                        break\n                    if ch[2].endswith(\"PP\") and pp:\n                        ch[-1] = \"I-PNP\"\n                    if not ch[2].endswith(\"PP\"):\n                        ch[-1] = \"I-PNP\"\n                        pp = False\n    return chunked", "entry_point": "find_prepositions", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markuskiller/textblob-de/blob/1b427b2cdd7e5e9fd3697677a98358fae4aa6ad1/textblob_de/ext/_pattern/text/__init__.py#L1218-L1242", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032998", "code": "def get_fn_from_coords(coords, name=None):\n    \"\"\" Given a set of coordinates, returns the standard filename.\n\n    Parameters\n    -----------\n    coords : list\n        [LLC.lat, LLC.lon, URC.lat, URC.lon]\n    name : str (optional)\n        An optional suffix to the filename.\n\n    Returns\n    -------\n    fn : str\n        The standard <filename>_<name>.tif with suffix (if supplied)\n    \"\"\"\n    NS1 = [\"S\", \"N\"][coords[0] > 0]\n    EW1 = [\"W\", \"E\"][coords[1] > 0]\n    NS2 = [\"S\", \"N\"][coords[2] > 0]\n    EW2 = [\"W\", \"E\"][coords[3] > 0]\n    new_name = \"%s%0.3g%s%0.3g_%s%0.3g%s%0.3g\" % \\\n        (NS1, coords[0], EW1, coords[1], NS2, coords[2], EW2, coords[3])\n    if name is not None:\n        new_name += '_' + name\n    return new_name.replace('.', 'o') + '.tif'", "entry_point": "get_fn_from_coords", "input": "[5, 3, 1, 4], ''", "output": "'N5E3_N1E4_.tif'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/creare-com/pydem/blob/c2fc8d84cfb411df84f71a6dec9edc4b544f710a/pydem/utils.py#L119-L142", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0032999", "code": "def count_children(obj, type=None):\n    \"\"\"Return the number of children of obj, optionally restricting by class\"\"\"\n    if type is None:\n        return len(obj)\n    else:\n        # there doesn't appear to be any hdf5 function for getting this\n        # information without inspecting each child, which makes this somewhat\n        # slow\n        return sum(1 for x in obj if obj.get(x, getclass=True) is type)", "entry_point": "count_children", "input": "[], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/melizalab/arf/blob/71746d9edbe7993a783d4acaf84b9631f3230283/arf.py#L360-L368", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033000", "code": "def compare_lists(list1,list2):\n    '''compare lists is the lowest level that drives compare_containers and\n    compare_packages. It returns a comparison object (dict) with the unique,\n    total, and intersecting things between two lists\n    :param list1: the list for container1\n    :param list2: the list for container2\n    '''\n    intersect = list(set(list1).intersection(list2))\n    unique1 = list(set(list1).difference(list2))\n    unique2 = list(set(list2).difference(list1))\n\n    # Return data structure\n    comparison = {\"intersect\":intersect,\n                  \"unique1\": unique1,\n                  \"unique2\": unique2,\n                  \"total1\": len(list1),\n                  \"total2\": len(list2)}\n    return comparison", "entry_point": "compare_lists", "input": "['apple', 'banana', 'cherry'], []", "output": "{'intersect': [], 'unique1': ['banana', 'apple', 'cherry'], 'unique2': [], 'total1': 3, 'total2': 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/singularity-python/blob/498c3433724b332f7493fec632d8daf479f47b82/singularity/analysis/compare.py#L143-L160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033001", "code": "def update_dict(input_dict,key,value):\n    '''update_dict will update lists in a dictionary. If the key is not included,\n    if will add as new list. If it is, it will append.\n    :param input_dict: the dict to update\n    :param value: the value to update with\n    '''\n    if key in input_dict:\n        input_dict[key].append(value)\n    else:\n        input_dict[key] = [value]\n    return input_dict", "entry_point": "update_dict", "input": "{'a': 1, 'b': 2}, 2.0, [[1, 2], [3], []]", "output": "{'a': 1, 'b': 2, 2.0: [[[1, 2], [3], []]]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/singularity-python/blob/498c3433724b332f7493fec632d8daf479f47b82/singularity/analysis/utils.py#L50-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033002", "code": "def _parse_numbered_syllable(unparsed_syllable):\n    \"\"\"Return the syllable and tone of a numbered Pinyin syllable.\"\"\"\n    tone_number = unparsed_syllable[-1]\n    if not tone_number.isdigit():\n        syllable, tone = unparsed_syllable, '5'\n    elif tone_number == '0':\n        syllable, tone = unparsed_syllable[:-1], '5'\n    elif tone_number in '12345':\n        syllable, tone = unparsed_syllable[:-1], tone_number\n    else:\n        raise ValueError(\"Invalid syllable: %s\" % unparsed_syllable)\n    return syllable, tone", "entry_point": "_parse_numbered_syllable", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], '5')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tsroten/dragonmapper/blob/68eaf43c32725f4b4923c01284cfc0112079e8ab/dragonmapper/transcriptions.py#L83-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033003", "code": "def _restore_case(s, memory):\n    \"\"\"Restore a lowercase string's characters to their original case.\"\"\"\n    cased_s = []\n    for i, c in enumerate(s):\n        if i + 1 > len(memory):\n            break\n        cased_s.append(c if memory[i] else c.upper())\n    return ''.join(cased_s)", "entry_point": "_restore_case", "input": "[5, 3, 1, 4], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tsroten/dragonmapper/blob/68eaf43c32725f4b4923c01284cfc0112079e8ab/dragonmapper/transcriptions.py#L167-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033004", "code": "def is_component(w, ids):\n    \"\"\"Check if the set of ids form a single connected component\n\n    Parameters\n    ----------\n\n    w   : spatial weights boject\n\n    ids : list\n          identifiers of units that are tested to be a single connected\n          component\n\n\n    Returns\n    -------\n\n    True    : if the list of ids represents a single connected component\n\n    False   : if the list of ids forms more than a single connected component\n\n    \"\"\"\n\n    components = 0\n    marks = dict([(node, 0) for node in ids])\n    q = []\n    for node in ids:\n        if marks[node] == 0:\n            components += 1\n            q.append(node)\n            if components > 1:\n                return False\n        while q:\n            node = q.pop()\n            marks[node] = components\n            others = [neighbor for neighbor in w.neighbors[node]\n                      if neighbor in ids]\n            for other in others:\n                if marks[other] == 0 and other not in q:\n                    q.append(other)\n    return True", "entry_point": "is_component", "input": "['a', 'b', 'c'], {}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pysal/giddy/blob/13fae6c18933614be78e91a6b5060693bea33a04/giddy/components.py#L11-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033005", "code": "def normalize_response_value(rv):\n    \"\"\" Normalize the response value into a 3-tuple (rv, status, headers)\n        :type rv: tuple|*\n        :returns: tuple(rv, status, headers)\n        :rtype: tuple(Response|JsonResponse|*, int|None, dict|None)\n    \"\"\"\n    status = headers = None\n    if isinstance(rv, tuple):\n        rv, status, headers = rv + (None,) * (3 - len(rv))\n    return rv, status, headers", "entry_point": "normalize_response_value", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kolypto/py-flask-jsontools/blob/1abee2d40e6db262e43f0c534e90faaa9b26246a/flask_jsontools/response.py#L51-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033006", "code": "def _insertDateIndex(date, l):\r\n    '''\r\n    returns the index to insert the given date in a list\r\n    where each items first value is a date\r\n    '''\r\n    return next((i for i, n in enumerate(l) if n[0] < date), len(l))", "entry_point": "_insertDateIndex", "input": "[-1, 0, 1, 2], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/radjkarl/imgProcessor/blob/7c5a28718f81c01a430152c60a686ac50afbfd7c/imgProcessor/camera/CameraCalibration.py#L29-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033007", "code": "def convert_weka_to_py_date_pattern(p):\n    \"\"\"\n    Converts the date format pattern used by Weka to the date format pattern used by Python's datetime.strftime().\n    \"\"\"\n    # https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior\n    # https://www.cs.waikato.ac.nz/ml/weka/arff.html\n    p = p.replace('yyyy', r'%Y')\n    p = p.replace('MM', r'%m')\n    p = p.replace('dd', r'%d')\n    p = p.replace('HH', r'%H')\n    p = p.replace('mm', r'%M')\n    p = p.replace('ss', r'%S')\n    return p", "entry_point": "convert_weka_to_py_date_pattern", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chrisspen/weka/blob/c86fc4b8eef1afd56f89ec28283bdf9e2fdc453b/weka/arff.py#L87-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033008", "code": "def rgb_to_hsv(r, g=None, b=None):\n  \"\"\"Convert the color from RGB coordinates to HSV.\n\n  Parameters:\n    :r:\n      The Red component value [0...1]\n    :g:\n      The Green component value [0...1]\n    :b:\n      The Blue component value [0...1]\n\n  Returns:\n    The color as an (h, s, v) tuple in the range:\n    h[0...360],\n    s[0...1],\n    v[0...1]\n\n  >>> rgb_to_hsv(1, 0.5, 0)\n  (30.0, 1.0, 1.0)\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n\n  v = float(max(r, g, b))\n  d = v - min(r, g, b)\n  if d==0: return (0.0, 0.0, v)\n  s = d / v\n\n  dr, dg, db = [(v - val) / d for val in (r, g, b)]\n\n  if r==v:\n    h = db - dg             # between yellow & magenta\n  elif g==v:\n    h = 2.0 + dr - db       # between cyan & yellow\n  else: # b==v\n    h = 4.0 + dg - dr       # between magenta & cyan\n\n  h = (h*60.0) % 360.0\n  return (h, s, v)", "entry_point": "rgb_to_hsv", "input": "[1, 2, 3], [[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "(210.0, 0.6666666666666666, 3.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L346-L385", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033009", "code": "def rgb_to_yiq(r, g=None, b=None):\n  \"\"\"Convert the color from RGB to YIQ.\n\n  Parameters:\n    :r:\n      The Red component value [0...1]\n    :g:\n      The Green component value [0...1]\n    :b:\n      The Blue component value [0...1]\n\n  Returns:\n    The color as an (y, i, q) tuple in the range:\n    y[0...1],\n    i[0...1],\n    q[0...1]\n\n  >>> '(%g, %g, %g)' % rgb_to_yiq(1, 0.5, 0)\n  '(0.592263, 0.458874, -0.0499818)'\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n\n  y = (r * 0.29895808) + (g * 0.58660979) + (b *0.11443213)\n  i = (r * 0.59590296) - (g * 0.27405705) - (b *0.32184591)\n  q = (r * 0.21133576) - (g * 0.52263517) + (b *0.31129940)\n  return (y, i, q)", "entry_point": "rgb_to_yiq", "input": "[1, 2, 3], [-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "(1.8154740500000002, -0.9177488700000002, 0.09996361999999992)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L430-L457", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033010", "code": "def yiq_to_rgb(y, i=None, q=None):\n  \"\"\"Convert the color from YIQ coordinates to RGB.\n\n  Parameters:\n    :y:\n      Tte Y component value [0...1]\n    :i:\n      The I component value [0...1]\n    :q:\n      The Q component value [0...1]\n\n  Returns:\n    The color as an (r, g, b) tuple in the range:\n    r[0...1],\n    g[0...1],\n    b[0...1]\n\n  >>> '({}, {}, {})'.format(*[round(v, 6) for v in yiq_to_rgb(0.592263, 0.458874, -0.0499818)])\n  '(1.0, 0.5, 1e-06)'\n\n  \"\"\"\n  if type(y) in [list,tuple]:\n    y, i, q = y\n  r = y + (i * 0.9562) + (q * 0.6210)\n  g = y - (i * 0.2717) - (q * 0.6485)\n  b = y - (i * 1.1053) + (q * 1.7020)\n  return (r, g, b)", "entry_point": "yiq_to_rgb", "input": "[1, 2, 3], [1, 2, 3], [1, 2, 3]", "output": "(4.775399999999999, -1.4889000000000001, 3.8954)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L459-L485", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033011", "code": "def rgb_to_cmy(r, g=None, b=None):\n  \"\"\"Convert the color from RGB coordinates to CMY.\n\n  Parameters:\n    :r:\n      The Red component value [0...1]\n    :g:\n      The Green component value [0...1]\n    :b:\n      The Blue component value [0...1]\n\n  Returns:\n    The color as an (c, m, y) tuple in the range:\n    c[0...1],\n    m[0...1],\n    y[0...1]\n\n  >>> rgb_to_cmy(1, 0.5, 0)\n  (0, 0.5, 1)\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n  return (1-r, 1-g, 1-b)", "entry_point": "rgb_to_cmy", "input": "[1, 2, 3], ['a', 'b', 'c'], []", "output": "(0, -1, -2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L747-L770", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033012", "code": "def cmy_to_rgb(c, m=None, y=None):\n  \"\"\"Convert the color from CMY coordinates to RGB.\n\n  Parameters:\n    :c:\n      The Cyan component value [0...1]\n    :m:\n      The Magenta component value [0...1]\n    :y:\n      The Yellow component value [0...1]\n\n  Returns:\n    The color as an (r, g, b) tuple in the range:\n    r[0...1],\n    g[0...1],\n    b[0...1]\n\n  >>> cmy_to_rgb(0, 0.5, 1)\n  (1, 0.5, 0)\n\n  \"\"\"\n  if type(c) in [list,tuple]:\n    c, m, y = c\n  return (1-c, 1-m, 1-y)", "entry_point": "cmy_to_rgb", "input": "[1, 2, 3], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "(0, -1, -2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L772-L795", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033013", "code": "def rgb_to_ints(r, g=None, b=None):\n  \"\"\"Convert the color in the standard [0...1] range to ints in the [0..255] range.\n\n  Parameters:\n    :r:\n      The Red component value [0...1]\n    :g:\n      The Green component value [0...1]\n    :b:\n      The Blue component value [0...1]\n\n  Returns:\n    The color as an (r, g, b) tuple in the range:\n    r[0...255],\n    g[0...2551],\n    b[0...2551]\n\n  >>> rgb_to_ints(1, 0.5, 0)\n  (255, 128, 0)\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n  return tuple(int(round(v*255)) for v in (r, g, b))", "entry_point": "rgb_to_ints", "input": "[1, 2, 3], ['a', 'b', 'c'], []", "output": "(255, 510, 765)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L797-L820", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033014", "code": "def ints_to_rgb(r, g=None, b=None):\n  \"\"\"Convert ints in the [0...255] range to the standard [0...1] range.\n\n  Parameters:\n    :r:\n      The Red component value [0...255]\n    :g:\n      The Green component value [0...255]\n    :b:\n      The Blue component value [0...255]\n\n  Returns:\n    The color as an (r, g, b) tuple in the range:\n    r[0...1],\n    g[0...1],\n    b[0...1]\n\n  >>> '(%g, %g, %g)' % ints_to_rgb((255, 128, 0))\n  '(1, 0.501961, 0)'\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n  return tuple(float(v) / 255.0 for v in [r, g, b])", "entry_point": "ints_to_rgb", "input": "[1, 2, 3], [], []", "output": "(0.00392156862745098, 0.00784313725490196, 0.011764705882352941)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L822-L845", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033015", "code": "def rgb_to_html(r, g=None, b=None):\n  \"\"\"Convert the color from (r, g, b) to #RRGGBB.\n\n  Parameters:\n    :r:\n      The Red component value [0...1]\n    :g:\n      The Green component value [0...1]\n    :b:\n      The Blue component value [0...1]\n\n  Returns:\n    A CSS string representation of this color (#RRGGBB).\n\n  >>> rgb_to_html(1, 0.5, 0)\n  '#ff8000'\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n  return '#%02x%02x%02x' % tuple((min(round(v*255), 255) for v in (r, g, b)))", "entry_point": "rgb_to_html", "input": "[1, 2, 3], ['a', 'b', 'c'], [5, 3, 1, 4]", "output": "'#ffffff'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L847-L867", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033016", "code": "def pil_to_rgb(pil):\n  \"\"\"Convert the color from a PIL-compatible integer to RGB.\n\n  Parameters:\n    pil: a PIL compatible color representation (0xBBGGRR)\n  Returns:\n    The color as an (r, g, b) tuple in the range:\n    the range:\n    r: [0...1]\n    g: [0...1]\n    b: [0...1]\n\n  >>> '(%g, %g, %g)' % pil_to_rgb(0x0080ff)\n  '(1, 0.501961, 0)'\n\n  \"\"\"\n  r = 0xff & pil\n  g = 0xff & (pil >> 8)\n  b = 0xff & (pil >> 16)\n  return tuple((v / 255.0 for v in (r, g, b)))", "entry_point": "pil_to_rgb", "input": "False", "output": "(0.0, 0.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L937-L956", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033017", "code": "def _websafe_component(c, alt=False):\n  \"\"\"Convert a color component to its web safe equivalent.\n\n  Parameters:\n    :c:\n      The component value [0...1]\n    :alt:\n      If True, return the alternative value instead of the nearest one.\n\n  Returns:\n    The web safe equivalent of the component value.\n\n  \"\"\"\n  # This sucks, but floating point between 0 and 1 is quite fuzzy...\n  # So we just change the scale a while to make the equality tests\n  # work, otherwise it gets wrong at some decimal far to the right.\n  sc = c * 100.0\n\n  # If the color is already safe, return it straight away\n  d = sc % 20\n  if d==0: return c\n\n  # Get the lower and upper safe values\n  l = sc - d\n  u = l + 20\n\n  # Return the 'closest' value according to the alt flag\n  if alt:\n    if (sc-l) >= (u-sc): return l/100.0\n    else: return u/100.0\n  else:\n    if (sc-l) >= (u-sc): return u/100.0\n    else: return l/100.0", "entry_point": "_websafe_component", "input": "-1.5, 10", "output": "-1.6", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L958-L990", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033018", "code": "def rgb_to_greyscale(r, g=None, b=None):\n  \"\"\"Convert the color from RGB to its greyscale equivalent\n\n  Parameters:\n    :r:\n      The Red component value [0...1]\n    :g:\n      The Green component value [0...1]\n    :b:\n      The Blue component value [0...1]\n\n  Returns:\n    The color as an (r, g, b) tuple in the range:\n    the range:\n    r[0...1],\n    g[0...1],\n    b[0...1]\n\n  >>> '(%g, %g, %g)' % rgb_to_greyscale(1, 0.8, 0)\n  '(0.6, 0.6, 0.6)'\n\n  \"\"\"\n  if type(r) in [list,tuple]:\n    r, g, b = r\n  v = (r + g + b) / 3.0\n  return (v, v, v)", "entry_point": "rgb_to_greyscale", "input": "[1, 2, 3], [1, 2, 3], [5, 3, 1, 4]", "output": "(2.0, 2.0, 2.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xav/Grapefruit/blob/b3d88375be727a3a1ec5839fbc462e0e8e0836e4/grapefruit.py#L1022-L1047", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033019", "code": "def remove_whitespace(text):\n    \"\"\"Remove unnecessary whitespace while keeping logical structure.\n\n    Keyword arguments:\n    text -- text to remove whitespace from (list)\n\n    Retain paragraph structure but remove other whitespace,\n    such as between words on a line and at the start and end of the text.\n    \"\"\"\n    clean_text = []\n    curr_line = ''\n    # Remove any newlines that follow two lines of whitespace consecutively\n    # Also remove whitespace at start and end of text\n    while text:\n        if not curr_line:\n            # Find the first line that is not whitespace and add it\n            curr_line = text.pop(0)\n            while not curr_line.strip() and text:\n                curr_line = text.pop(0)\n            if curr_line.strip():\n                clean_text.append(curr_line)\n        else:\n            # Filter the rest of the lines\n            curr_line = text.pop(0)\n            if not text:\n                # Add the final line if it is not whitespace\n                if curr_line.strip():\n                    clean_text.append(curr_line)\n                continue\n\n            if curr_line.strip():\n                clean_text.append(curr_line)\n            else:\n                # If the current line is whitespace then make sure there is\n                # no more than one consecutive line of whitespace following\n                if not text[0].strip():\n                    if len(text) > 1 and text[1].strip():\n                        clean_text.append(curr_line)\n                else:\n                    clean_text.append(curr_line)\n\n    # Now filter each individual line for extraneous whitespace\n    cleaner_text = []\n    for line in clean_text:\n        clean_line = ' '.join(line.split())\n        if not clean_line.strip():\n            clean_line += '\\n'\n        cleaner_text.append(clean_line)\n    return cleaner_text", "entry_point": "remove_whitespace", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/huntrar/scrape/blob/bf877f6da5df3ed0f2bea60a95acf7df63c88002/scrape/utils.py#L163-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033020", "code": "def _t(unistr, charset_from, charset_to):\n    \"\"\"\n        This is a unexposed function, is responsibility for translation internal.\n    \"\"\"\n    # if type(unistr) is str:\n    #     try:\n    #         unistr = unistr.decode('utf-8')\n    #     # Python 3 returns AttributeError when .decode() is called on a str\n    #     # This means it is already unicode.\n    #     except AttributeError:\n    #         pass\n    # try:\n    #     if type(unistr) is not unicode:\n    #         return unistr\n    # # Python 3 returns NameError because unicode is not a type.\n    # except NameError:\n    #     pass\n\n    chars = []\n    for c in unistr:\n        idx = charset_from.find(c)\n        chars.append(charset_to[idx] if idx!=-1 else c)\n    return u''.join(chars)", "entry_point": "_t", "input": "(), (1, 2), False", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hermanschaaf/mafan/blob/373ddf299aeb2bd8413bf921c71768af7a8170ea/mafan/third_party/jianfan/__init__.py#L23-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033021", "code": "def makeSequenceAbsolute(relVSequence, minV, maxV):\n    '''\n    Makes every value in a sequence absolute\n    '''\n\n    return [(value * (maxV - minV)) + minV for value in relVSequence]", "entry_point": "makeSequenceAbsolute", "input": "[], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timmahrt/ProMo/blob/99d9f5cc01ff328a62973c5a5da910cc905ae4d5/promo/morph_utils/morph_sequence.py#L50-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033022", "code": "def format_num(num, unit='bytes'):\n    \"\"\"\n    Returns a human readable string of a byte-value.\n    If 'num' is bits, set unit='bits'.\n    \"\"\"\n    if unit == 'bytes':\n        extension = 'B'\n    else:\n        # if it's not bytes, it's bits\n        extension = 'Bit'\n    for dimension in (unit, 'K', 'M', 'G', 'T'):\n        if num < 1024:\n            if dimension == unit:\n                return '%3.1f %s' % (num, dimension)\n            return '%3.1f %s%s' % (num, dimension, extension)\n        num /= 1024\n    return '%3.1f P%s' % (num, extension)", "entry_point": "format_num", "input": "10, [-1, 0, 1, 2]", "output": "'10.0 [-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kbr/fritzconnection/blob/b183f759ef19dd1652371e912d36cfe34f6639ac/fritzconnection/fritztools.py#L9-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033023", "code": "def get_rightmost_index(byte_index=0, file_starts=[0]):\n\n    '''\n    Retrieve the highest-indexed file that starts at or before byte_index.\n    '''\n    i = 1\n    while i <= len(file_starts):\n        start = file_starts[-i]\n        if start <= byte_index:\n            return len(file_starts) - i\n        else:\n            i += 1\n    else:\n        raise Exception('byte_index lower than all file_starts')", "entry_point": "get_rightmost_index", "input": "5, [5, 3, 1, 4]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jefflovejapan/drench/blob/e99a8bf844a61d909d2d57629937ac672810469c/drench/switchboard.py#L85-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033024", "code": "def find_indices(lst, element):\n    \"\"\" Returns the indices for all occurrences of 'element' in 'lst'.\n\n    Args:\n        lst (list): List to search.\n        element:  Element to find.\n\n    Returns:\n        list: List of indices or values\n    \"\"\"\n    result = []\n    offset = -1\n    while True:\n        try:\n            offset = lst.index(element, offset+1)\n        except ValueError:\n            return result\n        result.append(offset)", "entry_point": "find_indices", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AustralianSynchrotron/lightflow/blob/dc53dbc1d961e20fb144273baca258060705c03e/lightflow/models/utils.py#L2-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033025", "code": "def latlong_to_locator (latitude, longitude):\n    \"\"\"converts WGS84 coordinates into the corresponding Maidenhead Locator\n\n        Args:\n            latitude (float): Latitude\n            longitude (float): Longitude\n\n        Returns:\n            string: Maidenhead locator\n\n        Raises:\n            ValueError: When called with wrong or invalid input args\n            TypeError: When args are non float values\n\n        Example:\n           The following example converts latitude and longitude into the Maidenhead locator\n\n           >>> from pyhamtools.locator import latlong_to_locator\n           >>> latitude = 48.5208333\n           >>> longitude = 9.375\n           >>> latlong_to_locator(latitude, longitude)\n           'JN48QM'\n\n        Note:\n             Latitude (negative = West, positive = East)\n             Longitude (negative = South, positive = North)\n\n    \"\"\"\n\n    if longitude >= 180 or longitude <= -180:\n        raise ValueError\n\n    if latitude >= 90 or latitude <= -90:\n        raise ValueError\n\n    longitude += 180;\n    latitude +=90;\n\n    locator = chr(ord('A') + int(longitude / 20))\n    locator += chr(ord('A') + int(latitude / 10))\n    locator += chr(ord('0') + int((longitude % 20) / 2))\n    locator += chr(ord('0') + int(latitude % 10))\n    locator += chr(ord('A') + int((longitude - int(longitude / 2) * 2) / (2 / 24)))\n    locator += chr(ord('A') + int((latitude - int(latitude / 1) * 1 ) / (1 / 24)))\n\n    return locator", "entry_point": "latlong_to_locator", "input": "-1.5, 5", "output": "'JI28MM'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dh1tw/pyhamtools/blob/ee7e4b8732e23c298da10e07163748156c16d0fa/pyhamtools/locator.py#L10-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033026", "code": "def derive_single_object_url_pattern(slug_url_kwarg, path, action):\n    \"\"\"\n    Utility function called by class methods for single object views\n    \"\"\"\n    if slug_url_kwarg:\n        return r'^%s/%s/(?P<%s>[^/]+)/$' % (path, action, slug_url_kwarg)\n    else:\n        return r'^%s/%s/(?P<pk>\\d+)/$' % (path, action)", "entry_point": "derive_single_object_url_pattern", "input": "['a', 'b', 'c'], 'a,b,c', [[1, 2], [3], []]", "output": "\"^a,b,c/[[1, 2], [3], []]/(?P<['a', 'b', 'c']>[^/]+)/$\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nyaruka/smartmin/blob/488a676a4960555e4d216a7b95d6e01a4ad4efd8/smartmin/views.py#L390-L397", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033027", "code": "def get_unique_groups(input_list):\n    \"\"\"Function to get a unique list of groups.\"\"\"\n    out_list = []\n    for item in input_list:\n        if item not in out_list:\n            out_list.append(item)\n    return out_list", "entry_point": "get_unique_groups", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcsb/mmtf-python/blob/899bb877ca1b32a9396803d38c5bf38a2520754e/mmtf/api/mmtf_writer.py#L59-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033028", "code": "def run_length_encode(in_array):\n    \"\"\"A function to run length decode an int array.\n\n    :param in_array: the inptut array of integers\n    :return the encoded integer array\"\"\"\n    if(len(in_array)==0):\n        return []\n    curr_ans = in_array[0]\n    out_array = [curr_ans]\n    counter = 1\n    for in_int in in_array[1:]:\n        if in_int == curr_ans:\n            counter+=1\n        else:\n            out_array.append(counter)\n            out_array.append(in_int)\n            curr_ans = in_int\n            counter = 1\n    # Add the final counter\n    out_array.append(counter)\n    return out_array", "entry_point": "run_length_encode", "input": "[1, 2, 3]", "output": "[1, 1, 2, 1, 3, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcsb/mmtf-python/blob/899bb877ca1b32a9396803d38c5bf38a2520754e/mmtf/codecs/encoders/encoders.py#L1-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033029", "code": "def delta_encode(in_array):\n    \"\"\"A function to delta decode an int array.\n\n    :param in_array: the inut array to be delta encoded\n    :return the encoded integer array\"\"\"\n    if(len(in_array)==0):\n        return []\n    curr_ans = in_array[0]\n    out_array = [curr_ans]\n    for in_int in in_array[1:]:\n        out_array.append(in_int-curr_ans)\n        curr_ans = in_int\n    return out_array", "entry_point": "delta_encode", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcsb/mmtf-python/blob/899bb877ca1b32a9396803d38c5bf38a2520754e/mmtf/codecs/encoders/encoders.py#L23-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033030", "code": "def run_length_decode(in_array):\n    \"\"\"A function to run length decode an int array.\n    :param in_array: the input array of integers\n    :return the decoded array\"\"\"\n    switch=False\n    out_array=[]\n    for item in in_array:\n        if switch==False:\n            this_item = item\n            switch=True\n        else:\n            switch=False\n            out_array.extend([this_item]*int(item))\n    return out_array", "entry_point": "run_length_decode", "input": "[-1, 0, 1, 2]", "output": "[1, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcsb/mmtf-python/blob/899bb877ca1b32a9396803d38c5bf38a2520754e/mmtf/codecs/decoders/decoders.py#L1-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033031", "code": "def delta_decode(in_array):\n    \"\"\"A function to delta decode an int array.\n\n    :param in_array: the input array of integers\n    :return the decoded array\"\"\"\n    if len(in_array) == 0:\n        return []\n    this_ans = in_array[0]\n    out_array = [this_ans]\n    for i in range(1, len(in_array)):\n        this_ans += in_array[i]\n        out_array.append(this_ans)\n    return out_array", "entry_point": "delta_decode", "input": "[-1, 0, 1, 2]", "output": "[-1, -1, 0, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcsb/mmtf-python/blob/899bb877ca1b32a9396803d38c5bf38a2520754e/mmtf/codecs/decoders/decoders.py#L16-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033032", "code": "def recursive_index_decode(int_array, max=32767, min=-32768):\n    \"\"\"Unpack an array of integers using recursive indexing.\n    :param int_array: the input array of integers\n    :param max: the maximum integer size\n    :param min: the minimum integer size\n    :return the array of integers after recursive index decoding\"\"\"\n    out_arr = []\n    encoded_ind = 0\n    while encoded_ind < len(int_array):\n        decoded_val = 0\n        while int_array[encoded_ind]==max or int_array[encoded_ind]==min:\n            decoded_val += int_array[encoded_ind]\n            encoded_ind+=1\n            if int_array[encoded_ind]==0:\n                break\n        decoded_val += int_array[encoded_ind]\n        encoded_ind+=1\n        out_arr.append(decoded_val)\n    return out_arr", "entry_point": "recursive_index_decode", "input": "[], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcsb/mmtf-python/blob/899bb877ca1b32a9396803d38c5bf38a2520754e/mmtf/converters/converters.py#L110-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033033", "code": "def unique(seq):\n    \"\"\"Helper function to include only unique monomials in a basis.\"\"\"\n    seen = {}\n    result = []\n    for item in seq:\n        marker = item\n        if marker in seen:\n            continue\n        seen[marker] = 1\n        result.append(item)\n    return result", "entry_point": "unique", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterwittek/ncpol2sdpa/blob/bce75d524d0b9d0093f32e3a0a5611f8589351a7/ncpol2sdpa/nc_utils.py#L580-L590", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033034", "code": "def pauli_constraints(X, Y, Z):\n    \"\"\"Return  a set of constraints that define Pauli spin operators.\n\n    :param X: List of Pauli X operator on sites.\n    :type X: list of :class:`sympy.physics.quantum.operator.HermitianOperator`.\n    :param Y: List of Pauli Y operator on sites.\n    :type Y: list of :class:`sympy.physics.quantum.operator.HermitianOperator`.\n    :param Z: List of Pauli Z operator on sites.\n    :type Z: list of :class:`sympy.physics.quantum.operator.HermitianOperator`.\n\n    :returns: tuple of substitutions and equalities.\n    \"\"\"\n    substitutions = {}\n    n_vars = len(X)\n    for i in range(n_vars):\n        # They square to the identity\n        substitutions[X[i] * X[i]] = 1\n        substitutions[Y[i] * Y[i]] = 1\n        substitutions[Z[i] * Z[i]] = 1\n\n        # Anticommutation relations\n        substitutions[Y[i] * X[i]] = - X[i] * Y[i]\n        substitutions[Z[i] * X[i]] = - X[i] * Z[i]\n        substitutions[Z[i] * Y[i]] = - Y[i] * Z[i]\n        # Commutation relations.\n        # equalities.append(X[i]*Y[i] - 1j*Z[i])\n        # equalities.append(X[i]*Z[i] + 1j*Y[i])\n        # equalities.append(Y[i]*Z[i] - 1j*X[i])\n        # They commute between the sites\n        for j in range(i + 1, n_vars):\n            substitutions[X[j] * X[i]] = X[i] * X[j]\n            substitutions[Y[j] * Y[i]] = Y[i] * Y[j]\n            substitutions[Y[j] * X[i]] = X[i] * Y[j]\n            substitutions[Y[i] * X[j]] = X[j] * Y[i]\n            substitutions[Z[j] * Z[i]] = Z[i] * Z[j]\n            substitutions[Z[j] * X[i]] = X[i] * Z[j]\n            substitutions[Z[i] * X[j]] = X[j] * Z[i]\n            substitutions[Z[j] * Y[i]] = Y[i] * Z[j]\n            substitutions[Z[i] * Y[j]] = Y[j] * Z[i]\n    return substitutions", "entry_point": "pauli_constraints", "input": "[], [[1, 2], [3], []], ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterwittek/ncpol2sdpa/blob/bce75d524d0b9d0093f32e3a0a5611f8589351a7/ncpol2sdpa/physics_utils.py#L124-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033035", "code": "def correlator(A, B):\n    \"\"\"Correlators between the probabilities of two parties.\n\n    :param A: Measurements of Alice.\n    :type A: list of list of\n             :class:`sympy.physics.quantum.operator.HermitianOperator`.\n    :param B: Measurements of Bob.\n    :type B: list of list of\n             :class:`sympy.physics.quantum.operator.HermitianOperator`.\n\n    :returns: list of correlators.\n    \"\"\"\n    correlators = []\n    for i in range(len(A)):\n        correlator_row = []\n        for j in range(len(B)):\n            corr = 0\n            for k in range(len(A[i])):\n                for l in range(len(B[j])):\n                    if k == l:\n                        corr += A[i][k] * B[j][l]\n                    else:\n                        corr -= A[i][k] * B[j][l]\n            correlator_row.append(corr)\n        correlators.append(correlator_row)\n    return correlators", "entry_point": "correlator", "input": "[5, 3, 1, 4], []", "output": "[[], [], [], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterwittek/ncpol2sdpa/blob/bce75d524d0b9d0093f32e3a0a5611f8589351a7/ncpol2sdpa/physics_utils.py#L263-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033036", "code": "def replacement_fields_from_context(context):\n    \"\"\"Convert context replacement fields\n\n    Example:\n        BE_KEY=value -> {\"key\": \"value}\n\n    Arguments:\n        context (dict): The current context\n\n    \"\"\"\n\n    return dict((k[3:].lower(), context[k])\n                for k in context if k.startswith(\"BE_\"))", "entry_point": "replacement_fields_from_context", "input": "'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mottosso/be/blob/0f3d4f3597c71223f616d78c6d9b2c8dffcd8a71/be/lib.py#L442-L454", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033037", "code": "def mask_dict_password(dictionary, secret='***'):\n    \"\"\"Replace passwords with a secret in a dictionary.\"\"\"\n    d = dictionary.copy()\n    for k in d:\n        if 'password' in k:\n            d[k] = secret\n    return d", "entry_point": "mask_dict_password", "input": "{}, ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/umago/virtualbmc/blob/47551d1427e8976da0449c5405e87a763180ad1a/virtualbmc/utils.py#L90-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033038", "code": "def match_file(patterns, file):\n\t\"\"\"\n\tMatches the file to the patterns.\n\n\t*patterns* (:class:`~collections.abc.Iterable` of :class:`~pathspec.pattern.Pattern`)\n\tcontains the patterns to use.\n\n\t*file* (:class:`str`) is the normalized file path to be matched\n\tagainst *patterns*.\n\n\tReturns :data:`True` if *file* matched; otherwise, :data:`False`.\n\t\"\"\"\n\tmatched = False\n\tfor pattern in patterns:\n\t\tif pattern.include is not None:\n\t\t\tif file in pattern.match((file,)):\n\t\t\t\tmatched = pattern.include\n\treturn matched", "entry_point": "match_file", "input": "set(), set()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cpburnz/python-path-specification/blob/6fc7567a58cb68ec7d72cc287e7fb97dbe22c017/pathspec/util.py#L139-L156", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033039", "code": "def isnumber(obj):\n    \"\"\"\n    Test if the argument is a number (complex, float or integer).\n\n    :param obj: Object\n    :type  obj: any\n\n    :rtype: boolean\n    \"\"\"\n    return (\n        (obj is not None)\n        and (not isinstance(obj, bool))\n        and isinstance(obj, (int, float, complex))\n    )", "entry_point": "isnumber", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/pmisc/blob/dd2bb32e59eee872f1ef2db2d9921a396ab9f50b/pmisc/member.py#L68-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033040", "code": "def isreal(obj):\n    \"\"\"\n    Test if the argument is a real number (float or integer).\n\n    :param obj: Object\n    :type  obj: any\n\n    :rtype: boolean\n    \"\"\"\n    return (\n        (obj is not None)\n        and (not isinstance(obj, bool))\n        and isinstance(obj, (int, float))\n    )", "entry_point": "isreal", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/pmisc/blob/dd2bb32e59eee872f1ef2db2d9921a396ab9f50b/pmisc/member.py#L84-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033041", "code": "def drop_prefix_and_return_type(function):\n    \"\"\"Takes the function value from a frame and drops prefix and return type\n\n    For example::\n\n        static void * Allocator<MozJemallocBase>::malloc(unsigned __int64)\n        ^      ^^^^^^ return type\n        prefix\n\n    This gets changes to this::\n\n        Allocator<MozJemallocBase>::malloc(unsigned __int64)\n\n    This tokenizes on space, but takes into account types, generics, traits,\n    function arguments, and other parts of the function signature delimited by\n    things like `', <>, {}, [], and () for both C/C++ and Rust.\n\n    After tokenizing, this returns the last token since that's comprised of the\n    function name and its arguments.\n\n    :arg function: the function value in a frame to drop bits from\n\n    :returns: adjusted function value\n\n    \"\"\"\n    DELIMITERS = {\n        '(': ')',\n        '{': '}',\n        '[': ']',\n        '<': '>',\n        '`': \"'\"\n    }\n    OPEN = DELIMITERS.keys()\n    CLOSE = DELIMITERS.values()\n\n    # The list of tokens accumulated so far\n    tokens = []\n\n    # Keeps track of open delimiters so we can match and close them\n    levels = []\n\n    # The current token we're building\n    current = []\n\n    for i, char in enumerate(function):\n        if char in OPEN:\n            levels.append(char)\n            current.append(char)\n        elif char in CLOSE:\n            if levels and DELIMITERS[levels[-1]] == char:\n                levels.pop()\n                current.append(char)\n            else:\n                # This is an unmatched close.\n                current.append(char)\n        elif levels:\n            current.append(char)\n        elif char == ' ':\n            tokens.append(''.join(current))\n            current = []\n        else:\n            current.append(char)\n\n    if current:\n        tokens.append(''.join(current))\n\n    while len(tokens) > 1 and tokens[-1].startswith(('(', '[clone')):\n        # It's possible for the function signature to have a space between\n        # the function name and the parenthesized arguments or [clone ...]\n        # thing. If that's the case, we join the last two tokens. We keep doing\n        # that until the last token is nice.\n        #\n        # Example:\n        #\n        #     somefunc (int arg1, int arg2)\n        #             ^\n        #     somefunc(int arg1, int arg2) [clone .cold.111]\n        #                                 ^\n        #     somefunc(int arg1, int arg2) [clone .cold.111] [clone .cold.222]\n        #                                 ^                 ^\n        tokens = tokens[:-2] + [' '.join(tokens[-2:])]\n\n    return tokens[-1]", "entry_point": "drop_prefix_and_return_type", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/willkg/socorro-siggen/blob/db7e3233e665a458a961c48da22e93a69b1d08d6/siggen/utils.py#L242-L324", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033042", "code": "def makename(package, module):\n    \"\"\"Join package and module with a dot.\n\n    Package or Module can be empty.\n\n    :param package: the package name\n    :type package: :class:`str`\n    :param module: the module name\n    :type module: :class:`str`\n    :returns: the joined name\n    :rtype: :class:`str`\n    :raises: :class:`AssertionError`, if both package and module are empty\n    \"\"\"\n    # Both package and module can be None/empty.\n    assert package or module, \"Specify either package or module\"\n    if package:\n        name = package\n        if module:\n            name += '.' + module\n    else:\n        name = module\n    return name", "entry_point": "makename", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/storax/jinjaapidoc/blob/f1eeb6ab5bd1a96c4130306718c6423f37c76856/src/jinjaapidoc/gendoc.py#L87-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033043", "code": "def _isreal(obj):\n    \"\"\"\n    Determine if an object is a real number.\n\n    Both Python standard data types and Numpy data types are supported.\n\n    :param obj: Object\n    :type  obj: any\n\n    :rtype: boolean\n    \"\"\"\n    # pylint: disable=W0702\n    if (obj is None) or isinstance(obj, bool):\n        return False\n    try:\n        cond = (int(obj) == obj) or (float(obj) == obj)\n    except:\n        return False\n    return cond", "entry_point": "_isreal", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/pmisc/blob/dd2bb32e59eee872f1ef2db2d9921a396ab9f50b/pmisc/number.py#L24-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033044", "code": "def _unblast(name2vals, name_map):\n    \"\"\"Helper function to lift str -> bool maps used by aiger\n    to the word level. Dual of the `_blast` function.\"\"\"\n    def _collect(names):\n        return tuple(name2vals[n] for n in names)\n\n    return {bvname: _collect(names) for bvname, names in name_map}", "entry_point": "_unblast", "input": "'Hello World', {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mvcisback/py-aiger-bv/blob/855819844c429c35cdd8dc0b134bcd11f7b2fda3/aigerbv/aigbv.py#L22-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033045", "code": "def first_paragraph(multiline_str, without_trailing_dot=True, maxlength=None):\n    '''Return first paragraph of multiline_str as a oneliner.\n\n    When without_trailing_dot is True, the last char of the first paragraph\n    will be removed, if it is a dot ('.').\n\n    Examples:\n        >>> multiline_str = 'first line\\\\nsecond line\\\\n\\\\nnext paragraph'\n        >>> print(first_paragraph(multiline_str))\n        first line second line\n\n        >>> multiline_str = 'first \\\\n second \\\\n  \\\\n next paragraph '\n        >>> print(first_paragraph(multiline_str))\n        first second\n\n        >>> multiline_str = 'first line\\\\nsecond line\\\\n\\\\nnext paragraph'\n        >>> print(first_paragraph(multiline_str, maxlength=3))\n        fir\n\n        >>> multiline_str = 'first line\\\\nsecond line\\\\n\\\\nnext paragraph'\n        >>> print(first_paragraph(multiline_str, maxlength=78))\n        first line second line\n\n        >>> multiline_str = 'first line.'\n        >>> print(first_paragraph(multiline_str))\n        first line\n\n        >>> multiline_str = 'first line.'\n        >>> print(first_paragraph(multiline_str, without_trailing_dot=False))\n        first line.\n\n        >>> multiline_str = ''\n        >>> print(first_paragraph(multiline_str))\n        <BLANKLINE>\n    '''\n    stripped = '\\n'.join([line.strip() for line in multiline_str.splitlines()])\n    paragraph = stripped.split('\\n\\n')[0]\n    res = paragraph.replace('\\n', ' ')\n    if without_trailing_dot:\n        res = res.rsplit('.', 1)[0]\n    if maxlength:\n        res = res[0:maxlength]\n    return res", "entry_point": "first_paragraph", "input": "'a,b,c', ['apple', 'banana', 'cherry'], 5", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theno/utlz/blob/bf7d2b53f3e0d35c6f8ded81f3f774a74fcd3389/utlz/__init__.py#L67-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033046", "code": "def split_pieces(piece_list, segments, num):\n    \"\"\"\n    Prepare a list of all pieces grouped together\n    \"\"\"\n    piece_groups = []\n    pieces = list(piece_list)\n    while pieces:\n        for i in range(segments):\n            p = pieces[i::segments][:num]\n            if not p:\n                break\n            piece_groups.append(p)\n        pieces = pieces[num * segments:]\n\n    return piece_groups", "entry_point": "split_pieces", "input": "[], ['a', 'b', 'c'], 5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JohnDoee/thomas/blob/51916dd110098b189a1c2fbcb71794fd9ec94832/thomas/piece.py#L30-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033047", "code": "def quote_str(obj):\n    r\"\"\"\n    Add extra quotes to a string.\n\n    If the argument is not a string it is returned unmodified.\n\n    :param obj: Object\n    :type  obj: any\n\n    :rtype: Same as argument\n\n    For example:\n\n        >>> import pmisc\n        >>> pmisc.quote_str(5)\n        5\n        >>> pmisc.quote_str('Hello!')\n        '\"Hello!\"'\n        >>> pmisc.quote_str('He said \"hello!\"')\n        '\\'He said \"hello!\"\\''\n    \"\"\"\n    if not isinstance(obj, str):\n        return obj\n    return \"'{obj}'\".format(obj=obj) if '\"' in obj else '\"{obj}\"'.format(obj=obj)", "entry_point": "quote_str", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/pmisc/blob/dd2bb32e59eee872f1ef2db2d9921a396ab9f50b/pmisc/strings.py#L215-L238", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033048", "code": "def summarize_mutation_io(name, type, required=False):\n    \"\"\"\n        This function returns the standard summary for mutations inputs\n        and outputs\n    \"\"\"\n    return dict(\n        name=name,\n        type=type,\n        required=required\n    )", "entry_point": "summarize_mutation_io", "input": "'', [-1, 0, 1, 2], [1, 2, 3]", "output": "{'name': '', 'type': [-1, 0, 1, 2], 'required': [1, 2, 3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AlecAivazis/graphql-over-kafka/blob/70e2acef27a2f87355590be1a6ca60ce3ab4d09c/nautilus/api/util/summarize_mutation_io.py#L1-L10", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033049", "code": "def filter_data_columns(data):\n    \"\"\"\n    Given a dict of data such as those in :py:class:`~.ProjectStats` attributes,\n    made up of :py:class:`datetime.datetime` keys and values of dicts of column\n    keys to counts, return a list of the distinct column keys in sorted order.\n\n    :param data: data dict as returned by ProjectStats attributes\n    :type data: dict\n    :return: sorted list of distinct keys\n    :rtype: ``list``\n    \"\"\"\n    keys = set()\n    for dt, d in data.items():\n        for k in d:\n            keys.add(k)\n    return sorted([x for x in keys])", "entry_point": "filter_data_columns", "input": "{'x': [1, 2], 'y': []}", "output": "[1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jantman/pypi-download-stats/blob/44a7a6bbcd61a9e7f02bd02c52584a98183f80c5/pypi_download_stats/outputgenerator.py#L352-L367", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033050", "code": "def dict_fun(data, function):\n    \"\"\"\n    Apply a function to all values in a dictionary, return a dictionary with\n    results.\n\n    Parameters\n    ----------\n    data : dict\n        a dictionary whose values are adequate input to the second argument\n        of this function. \n    function : function\n        a function that takes one argument\n\n    Returns\n    -------\n    a dictionary with the same keys as data, such that\n    result[key] = function(data[key])\n    \"\"\"\n    return dict((k, function(v)) for k, v in list(data.items()))", "entry_point": "dict_fun", "input": "{}, 'a,b,c'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nwilming/ocupy/blob/a0bd64f822576feaa502939d6bafd1183b237d16/ocupy/utils.py#L130-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033051", "code": "def _word_badness(word):\n    \"\"\"\n    Assign a heuristic to possible outputs from Morphy. Minimizing this\n    heuristic avoids incorrect stems.\n    \"\"\"\n    if word.endswith('e'):\n        return len(word) - 2\n    elif word.endswith('ess'):\n        return len(word) - 10\n    elif word.endswith('ss'):\n        return len(word) - 4\n    else:\n        return len(word)", "entry_point": "_word_badness", "input": "'AbC dEf'", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/commonsense/metanl/blob/4b9ae8353489cc409bebd7e1fe10ab5b527b078e/metanl/nltk_morphy.py#L88-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033052", "code": "def makedoetree(ddict, bdict):\n    \"\"\"makedoetree\"\"\"\n    dlist = list(ddict.keys())\n    blist = list(bdict.keys())\n    dlist.sort()\n    blist.sort()\n    #make space dict\n    doesnot = 'DOES NOT'\n    lst = []\n    for num in range(0, len(blist)):\n        if bdict[blist[num]] == doesnot:#belong\n            lst = lst + [blist[num]]\n\n    doedict = {}\n    for num in range(0, len(lst)):\n        #print lst[num]\n        doedict[lst[num]] = {}\n    lv1list = list(doedict.keys())\n    lv1list.sort()\n\n    #make wall dict\n    #for each space\n    for i in range(0, len(lv1list)):\n        walllist = []\n        adict = doedict[lv1list[i]]\n        #loop thru the entire blist dictonary and list the ones that belong into walllist\n        for num in range(0, len(blist)):\n            if bdict[blist[num]] == lv1list[i]:\n                walllist = walllist + [blist[num]]\n        #put walllist into dict\n        for j in range(0, len(walllist)):\n            adict[walllist[j]] = {}\n\n    #make window dict\n    #for each space\n    for i in range(0, len(lv1list)):\n        adict1 = doedict[lv1list[i]]\n        #for each wall\n        walllist = list(adict1.keys())\n        walllist.sort()\n        for j in range(0, len(walllist)):\n            windlist = []\n            adict2 = adict1[walllist[j]]\n           #loop thru the entire blist dictonary and list the ones that belong into windlist\n            for num in range(0, len(blist)):\n                if bdict[blist[num]] == walllist[j]:\n                    windlist = windlist + [blist[num]]\n            #put walllist into dict\n            for k in range(0, len(windlist)):\n                adict2[windlist[k]] = {}\n    return doedict", "entry_point": "makedoetree", "input": "{'x': [1, 2], 'y': []}, {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L123-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033053", "code": "def fsliceafter(astr, sub):\n    \"\"\"Return the slice after at sub in string astr\"\"\"\n    findex = astr.find(sub)\n    return astr[findex + len(sub):]", "entry_point": "fsliceafter", "input": "'AbC dEf', 'walnut thistle harbour'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/mylib2.py#L307-L310", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033054", "code": "def _has_name(soup_obj):\n    \"\"\"checks if soup_obj is really a soup object or just a string\n    If it has a name it is a soup object\"\"\"\n    try:\n        name = soup_obj.name\n        if name == None:\n            return False\n        return True\n    except AttributeError:\n        return False", "entry_point": "_has_name", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/results/readhtml.py#L111-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033055", "code": "def intinlist(lst):\n    \"\"\"test if int in list\"\"\"\n    for item in lst:\n        try:\n            item = int(item)\n            return True\n        except ValueError:\n            pass\n    return False", "entry_point": "intinlist", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L45-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033056", "code": "def replaceint(fname, replacewith='%s'):\n    \"\"\"replace int in lst\"\"\"\n    words = fname.split()\n    for i, word in enumerate(words):\n        try:\n            word = int(word)\n            words[i] = replacewith\n        except ValueError:\n            pass\n    return ' '.join(words)", "entry_point": "replaceint", "input": "'', [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L55-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033057", "code": "def cleaniddfield(acomm):\n    \"\"\"make all the keys lower case\"\"\"\n    for key in list(acomm.keys()):\n        val = acomm[key]\n        acomm[key.lower()] = val\n    for key in list(acomm.keys()):\n        val = acomm[key]\n        if key != key.lower():\n            acomm.pop(key)\n    return acomm", "entry_point": "cleaniddfield", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/bunchhelpers.py#L66-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033058", "code": "def makename2refdct(commdct):\n    \"\"\"make the name2refs dict in the idd_index\"\"\"\n    refdct = {}\n    for comm in commdct: # commdct is a list of dict\n        try:\n            idfobj = comm[0]['idfobj'].upper()\n            field1 = comm[1]\n            if 'Name' in field1['field']:\n                references = field1['reference']\n                refdct[idfobj] = references\n        except (KeyError, IndexError) as e:\n            continue # not the expected pattern for reference\n    return refdct", "entry_point": "makename2refdct", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddindex.py#L51-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033059", "code": "def ref2names2commdct(ref2names, commdct):\n    \"\"\"embed ref2names into commdct\"\"\"\n    for comm in commdct:\n        for cdct in comm:\n            try:\n                refs = cdct['object-list'][0]\n                validobjects = ref2names[refs]\n                cdct.update({'validobjects':validobjects})\n            except KeyError as e:\n                continue\n    return commdct", "entry_point": "ref2names2commdct", "input": "False, set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddindex.py#L73-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033060", "code": "def prevnode(edges, component):\n    \"\"\"get the pervious component in the loop\"\"\"\n    e = edges\n    c = component\n    n2c = [(a, b) for a, b in e if type(a) == tuple]\n    c2n = [(a, b) for a, b in e if type(b) == tuple]\n    node2cs = [(a, b) for a, b in e if b == c]\n    c2nodes = []\n    for node2c in node2cs:\n        c2node = [(a, b) for a, b in c2n if b == node2c[0]]\n        if len(c2node) == 0:\n            # return []\n            c2nodes = []\n            break\n        c2nodes.append(c2node[0])\n    cs = [a for a, b in c2nodes]\n    # test for connections that have no nodes\n    # filter for no nodes\n    nonodes = [(a, b) for a, b in e if type(a) != tuple and type(b) != tuple]\n    for a, b in nonodes:\n        if b == component:\n            cs.append(a)\n    return cs", "entry_point": "prevnode", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/walk_hvac.py#L39-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033061", "code": "def cleanupversion(ver):\n    \"\"\"massage the version number so it matches the format of install folder\"\"\"\n    lst = ver.split(\".\")\n    if len(lst) == 1:\n        lst.extend(['0', '0'])\n    elif len(lst) == 2:\n        lst.extend(['0'])\n    elif len(lst) > 2:\n        lst = lst[:3]\n    lst[2] = '0' # ensure the 3rd number is 0    \n    cleanver = '.'.join(lst)\n    return cleanver", "entry_point": "cleanupversion", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour.0.0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/easyopen.py#L32-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033062", "code": "def removeblanklines(astr):\n    \"\"\"remove the blank lines in astr\"\"\"\n    lines = astr.splitlines()\n    lines = [line for line in lines if line.strip() != \"\"]\n    return \"\\n\".join(lines)", "entry_point": "removeblanklines", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/parse_idd.py#L74-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033063", "code": "def getobjectref(blocklst, commdct):\n    \"\"\"\n    makes a dictionary of object-lists\n    each item in the dictionary points to a list of tuples\n    the tuple is (objectname,  fieldindex)\n    \"\"\"\n    objlst_dct = {}\n    for eli in commdct:\n        for elj in eli:\n            if 'object-list' in elj:\n                objlist = elj['object-list'][0]\n                objlst_dct[objlist] = []\n\n    for objlist in list(objlst_dct.keys()):\n        for i in range(len(commdct)):\n            for j in range(len(commdct[i])):\n                if 'reference' in commdct[i][j]:\n                    for ref in commdct[i][j]['reference']:\n                        if ref == objlist:\n                            objlst_dct[objlist].append((blocklst[i][0], j))\n    return objlst_dct", "entry_point": "getobjectref", "input": "['a', 'b', 'c'], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/parse_idd.py#L388-L408", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033064", "code": "def folder2ver(folder):\n    \"\"\"get the version number from the E+ install folder\"\"\"\n    ver = folder.split('EnergyPlus')[-1]\n    ver = ver[1:]\n    splitapp = ver.split('-')\n    ver = '.'.join(splitapp)\n    return ver", "entry_point": "folder2ver", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/idd_helpers.py#L29-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033065", "code": "def getobjectswithnode(idf, nodekeys, nodename):\n    \"\"\"return all objects that mention this node name\"\"\"\n    keys = nodekeys\n    # TODO getidfkeyswithnodes needs to be done only once. take out of here\n    listofidfobjects = (idf.idfobjects[key.upper()] \n                for key in keys if idf.idfobjects[key.upper()])\n    idfobjects = [idfobj \n                    for idfobjs in listofidfobjects \n                        for idfobj in idfobjs]\n    objwithnodes = []\n    for obj in idfobjects:\n        values = obj.fieldvalues\n        fdnames = obj.fieldnames\n        for value, fdname in zip(values, fdnames):\n            if fdname.endswith('Node_Name'):\n                if value == nodename:\n                    objwithnodes.append(obj)\n                    break\n    return objwithnodes", "entry_point": "getobjectswithnode", "input": "[5, 3, 1, 4], [], 'AbC dEf'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/idf_helpers.py#L74-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033066", "code": "def group2commlst(commlst, glist):\n    \"\"\"add group info to commlst\"\"\"\n    for (gname, objname), commitem in zip(glist, commlst):\n        newitem1 = \"group %s\" % (gname, )\n        newitem2 = \"idfobj %s\" % (objname, )\n        commitem[0].insert(0, newitem1)\n        commitem[0].insert(1, newitem2)\n    return commlst", "entry_point": "group2commlst", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddgroups.py#L131-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033067", "code": "def group2commdct(commdct, glist):\n    \"\"\"add group info tocomdct\"\"\"\n    for (gname, objname), commitem in zip(glist, commdct):\n        commitem[0]['group'] = gname\n        commitem[0]['idfobj'] = objname\n    return commdct", "entry_point": "group2commdct", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddgroups.py#L140-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033068", "code": "def commdct2grouplist(gcommdct):\n    \"\"\"extract embedded group data from commdct.\n    return gdict -> {g1:[obj1, obj2, obj3], g2:[obj4, ..]}\"\"\"\n    gdict = {}\n    for objidd in gcommdct:\n        group = objidd[0]['group']\n        objname = objidd[0]['idfobj']\n        if group in gdict:\n            gdict[group].append(objname)\n        else:\n            gdict[group] = [objname, ]\n    return gdict", "entry_point": "commdct2grouplist", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/EPlusInterfaceFunctions/iddgroups.py#L147-L158", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033069", "code": "def _clean_listofcomponents(listofcomponents):\n    \"\"\"force it to be a list of tuples\"\"\"\n    def totuple(item):\n        \"\"\"return a tuple\"\"\"\n        if isinstance(item, (tuple, list)):\n            return item\n        else:\n            return (item, None)\n    return [totuple(item) for item in listofcomponents]", "entry_point": "_clean_listofcomponents", "input": "[-1, 0, 1, 2]", "output": "[(-1, None), (0, None), (1, None), (2, None)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/hvacbuilder.py#L962-L970", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033070", "code": "def _clean_listofcomponents_tuples(listofcomponents_tuples):\n    \"\"\"force 3 items in the tuple\"\"\"\n    def to3tuple(item):\n        \"\"\"return a 3 item tuple\"\"\"\n        if len(item) == 3:\n            return item\n        else:\n            return (item[0], item[1], None)\n    return [to3tuple(item) for item in listofcomponents_tuples]", "entry_point": "_clean_listofcomponents_tuples", "input": "['apple', 'banana', 'cherry']", "output": "[('a', 'p', None), ('b', 'a', None), ('c', 'h', None)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/hvacbuilder.py#L972-L980", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033071", "code": "def getfields(comm):\n    \"\"\"get all the fields that have the key 'field' \"\"\"\n    fields = []\n    for field in comm:\n        if 'field' in field:\n            fields.append(field)\n    return fields", "entry_point": "getfields", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santoshphilip/eppy/blob/55410ff7c11722f35bc4331ff5e00a0b86f787e1/eppy/iddgaps.py#L63-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033072", "code": "def format_tasks(tasks):\n  \"\"\"Converts a list of tasks to a list of string representations.\n\n  Args:\n    tasks: A list of the tasks to convert.\n  Returns:\n    A list of string formatted tasks.\n  \"\"\"\n  return ['%d : %s (%s)' % (task.key.id(),\n                            task.description,\n                            ('done' if task.done\n                             else 'created %s' % task.created))\n          for task in tasks]", "entry_point": "format_tasks", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/GoogleCloudPlatform/datastore-ndb-python/blob/cf4cab3f1f69cd04e1a9229871be466b53729f3f/demo/task_list.py#L102-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033073", "code": "def argvquote(arg, force=False):\n    \"\"\" Returns an argument quoted in such a way that that CommandLineToArgvW\n    on Windows will return the argument string unchanged.\n    This is the same thing Popen does when supplied with an list of arguments.\n    Arguments in a command line should be separated by spaces; this\n    function does not add these spaces. This implementation follows the\n    suggestions outlined here:\n    https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/\n    \"\"\"\n    if not force and len(arg) != 0 and not any([c in arg for c in ' \\t\\n\\v\"']):\n        return arg\n    else:\n        n_backslashes = 0\n        cmdline = '\"'\n        for c in arg:\n            if c == \"\\\\\":\n                # first count the number of current backslashes\n                n_backslashes += 1\n                continue\n            if c == '\"':\n                # Escape all backslashes and the following double quotation mark\n                cmdline += (n_backslashes * 2 + 1) * '\\\\'\n            else:\n                # backslashes are not special here\n                cmdline += n_backslashes * '\\\\'\n            n_backslashes = 0\n            cmdline += c\n        # Escape all backslashes, but let the terminating\n        # double quotation mark we add below be interpreted\n        # as a metacharacter\n        cmdline += + n_backslashes * 2 * '\\\\' + '\"'\n        return cmdline", "entry_point": "argvquote", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Cadair/jupyter_environment_kernels/blob/3da304550b511bda7d5d39280379b5ca39bb31bc/environment_kernels/activate_helper.py#L124-L155", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033074", "code": "def limitsSql(startIndex=0, maxResults=0):\n    \"\"\"\n    Construct a SQL LIMIT clause\n    \"\"\"\n    if startIndex and maxResults:\n        return \" LIMIT {}, {}\".format(startIndex, maxResults)\n    elif startIndex:\n        raise Exception(\"startIndex was provided, but maxResults was not\")\n    elif maxResults:\n        return \" LIMIT {}\".format(maxResults)\n    else:\n        return \"\"", "entry_point": "limitsSql", "input": "10, [-1, 0, 1, 2]", "output": "' LIMIT 10, [-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/sqlite_backend.py#L35-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033075", "code": "def parseMalformedBamHeader(headerDict):\n    \"\"\"\n    Parses the (probably) intended values out of the specified\n    BAM header dictionary, which is incompletely parsed by pysam.\n    This is caused by some tools incorrectly using spaces instead\n    of tabs as a seperator.\n    \"\"\"\n    headerString = \" \".join(\n        \"{}:{}\".format(k, v) for k, v in headerDict.items() if k != 'CL')\n    ret = {}\n    for item in headerString.split():\n        key, value = item.split(\":\", 1)\n        # build up dict, casting everything back to original type\n        ret[key] = type(headerDict.get(key, \"\"))(value)\n    if 'CL' in headerDict:\n        ret['CL'] = headerDict['CL']\n    return ret", "entry_point": "parseMalformedBamHeader", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/reads.py#L24-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033076", "code": "def convert(to, who, default=u''):\n    \"\"\"\n    Converts data to a specific datatype.\n    In case of error, will return a default value.\n\n    :param to:      datatype to be casted to.\n    :param who:     value to cast.\n    :param default: value to return in case of error.\n    :return: a str value.\n    \"\"\"\n    if who is None:\n        return default\n    try:\n        return to(who)\n    except:  # noqa\n        return default", "entry_point": "convert", "input": "[-1, 0, 1, 2], [[1, 2], [3], []], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/napalm-automation/napalm-base/blob/f8a154e642a6da01ac1024dd52eaf7a7116e6191/napalm_base/helpers.py#L165-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033077", "code": "def colon_separated_string_to_dict(string, separator=':'):\n    '''\n    Converts a string in the format:\n\n        Name: Et3\n        Switchport: Enabled\n        Administrative Mode: trunk\n        Operational Mode: trunk\n        MAC Address Learning: enabled\n        Access Mode VLAN: 3 (VLAN0003)\n        Trunking Native Mode VLAN: 1 (default)\n        Administrative Native VLAN tagging: disabled\n        Administrative private VLAN mapping: ALL\n        Trunking VLANs Enabled: 2-3,5-7,20-21,23,100-200\n        Trunk Groups:\n\n    into a dictionary\n\n    '''\n    dictionary = dict()\n    for line in string.splitlines():\n        line_data = line.split(separator)\n        if len(line_data) > 1:\n            dictionary[line_data[0].strip()] = ''.join(line_data[1:]).strip()\n        elif len(line_data) == 1:\n            dictionary[line_data[0].strip()] = None\n        else:\n            raise Exception('Something went wrong parsing the colo separated string {}'\n                            .format(line))\n    return dictionary", "entry_point": "colon_separated_string_to_dict", "input": "'Hello World', 'a,b,c'", "output": "{'Hello World': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/napalm-automation/napalm-base/blob/f8a154e642a6da01ac1024dd52eaf7a7116e6191/napalm_base/utils/string_parsers.py#L23-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033078", "code": "def _revert_caffe2_pad(attr):\n    \"\"\"Removing extra padding from Caffe2.\"\"\"\n    if len(attr) == 4:\n        attr = attr[:2]\n    elif len(attr) == 2:\n        pass\n    else:\n        raise ValueError(\"Invalid caffe2 type padding: {}\".format(attr))\n    return attr", "entry_point": "_revert_caffe2_pad", "input": "[5, 3, 1, 4]", "output": "[5, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onnx/onnx-mxnet/blob/b602d75c5a01f5ed8f68b11150a06374f058a86b/onnx_mxnet/import_helper.py#L19-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033079", "code": "def _pad_sequence_fix(attr, kernelDim=None):\n    \"\"\"Changing onnx's pads sequence to match with mxnet's pad_width\n    mxnet: (x1_begin, x1_end, ... , xn_begin, xn_end)\n    onnx: (x1_begin, x2_begin, ... , xn_end, xn_end)\"\"\"\n    new_attr = ()\n    if len(attr) % 2 == 0:\n        for index in range(int(len(attr) / 2)):\n            new_attr = new_attr + attr[index::int(len(attr) / 2)]\n        # Making sure pad values  are in the attr for all axes.\n        if kernelDim is not None:\n            while len(new_attr) < kernelDim*2:\n                new_attr = new_attr + (0, 0)\n\n    return new_attr", "entry_point": "_pad_sequence_fix", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onnx/onnx-mxnet/blob/b602d75c5a01f5ed8f68b11150a06374f058a86b/onnx_mxnet/import_helper.py#L111-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033080", "code": "def format_baseline_list(baseline_list):\n    \"\"\"Format the list of baseline information from the loaded files into a\n    cohesive, informative string\n\n    Parameters\n    ------------\n    baseline_list : (list)\n        List of strings specifying the baseline information for each\n        SuperMAG file\n\n    Returns\n    ---------\n    base_string : (str)\n        Single string containing the relevent data\n        \n    \"\"\"\n\n    uniq_base = dict()\n    uniq_delta = dict()\n\n    for bline in baseline_list:\n        bsplit = bline.split()\n        bdate = \" \".join(bsplit[2:])\n        if bsplit[0] not in uniq_base.keys():\n            uniq_base[bsplit[0]] = \"\"\n        if bsplit[1] not in uniq_delta.keys():\n            uniq_delta[bsplit[1]] = \"\"\n\n        uniq_base[bsplit[0]] += \"{:s}, \".format(bdate)\n        uniq_delta[bsplit[1]] += \"{:s}, \".format(bdate)\n\n    if len(uniq_base.items()) == 1:\n        base_string = \"Baseline {:s}\".format(list(uniq_base.keys())[0])\n    else:\n        base_string = \"Baseline \"\n\n        for i,kk in enumerate(uniq_base.keys()):\n            if i == 1:\n                base_string += \"{:s}: {:s}\".format(kk, uniq_base[kk][:-2])\n            else:\n                base_string += \"         {:s}: {:s}\".format(kk,\n                                                            uniq_base[kk][:-2])\n        else:\n            base_string += \"unknown\"\n\n    if len(uniq_delta.items()) == 1:\n        base_string += \"\\nDelta    {:s}\".format(list(uniq_delta.keys())[0])\n    else:\n        base_string += \"\\nDelta    \"\n\n        for i,kk in enumerate(uniq_delta.keys()):\n            if i == 1:\n                base_string += \"{:s}: {:s}\".format(kk, uniq_delta[kk][:-2])\n            else:\n                base_string += \"         {:s}: {:s}\".format(kk,\n                                                            uniq_delta[kk][:-2])\n        else:\n            base_string += \"unknown\"\n\n    return base_string", "entry_point": "format_baseline_list", "input": "[]", "output": "'Baseline unknown\\nDelta    unknown'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/supermag_magnetometer.py#L485-L544", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033081", "code": "def ipv4_prefix_to_mask(prefix):\n    \"\"\"\n    ipv4 cidr prefix to net mask\n\n    :param prefix: cidr prefix , rang in (0, 32)\n    :type prefix: int\n    :return: dot separated ipv4 net mask code, eg: 255.255.255.0\n    :rtype: str\n    \"\"\"\n    if prefix > 32 or prefix < 0:\n        raise ValueError(\"invalid cidr prefix for ipv4\")\n    else:\n        mask = ((1 << 32) - 1) ^ ((1 << (32 - prefix)) - 1)\n        eight_ones = 255  # 0b11111111\n        mask_str = ''\n        for i in range(0, 4):\n            mask_str = str(mask & eight_ones) + mask_str\n            mask = mask >> 8\n            if i != 3:\n                mask_str = '.' + mask_str\n        return mask_str", "entry_point": "ipv4_prefix_to_mask", "input": "5", "output": "'248.0.0.0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L289-L309", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033082", "code": "def ipv6_prefix_to_mask(prefix):\n    \"\"\"\n    ipv6 cidr prefix to net mask\n\n    :param prefix: cidr prefix, rang in (0, 128)\n    :type prefix: int\n    :return: comma separated ipv6 net mask code,\n             eg: ffff:ffff:ffff:ffff:0000:0000:0000:0000\n    :rtype: str\n    \"\"\"\n    if prefix > 128 or prefix < 0:\n        raise ValueError(\"invalid cidr prefix for ipv6\")\n    else:\n        mask = ((1 << 128) - 1) ^ ((1 << (128 - prefix)) - 1)\n        f = 15  # 0xf or 0b1111\n        hex_mask_str = ''\n        for i in range(0, 32):\n            hex_mask_str = format((mask & f), 'x') + hex_mask_str\n            mask = mask >> 4\n            if i != 31 and i & 3 == 3:\n                hex_mask_str = ':' + hex_mask_str\n        return hex_mask_str", "entry_point": "ipv6_prefix_to_mask", "input": "True", "output": "'8000:0000:0000:0000:0000:0000:0000:0000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L312-L333", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033083", "code": "def parse_series_args(topics, fields):\n    '''Return which topics and which field keys need to be examined\n    for plotting'''\n    keys = {}\n    for field in fields:\n        for topic in topics:\n            if field.startswith(topic):\n                keys[field] = (topic, field[len(topic) + 1:])\n\n    return keys", "entry_point": "parse_series_args", "input": "[], [-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aktaylor08/RosbagPandas/blob/c2af9f22537102696dffdf2e61790362726a8403/scripts/bag_graph.py#L27-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033084", "code": "def _dict_to_html_attributes(d):\n        \"\"\"\n        Converts a dictionary to a string of ``key=\\\"value\\\"`` pairs.\n        If ``None`` is provided as the dictionary an empty string is returned,\n        i.e. no html attributes are generated.\n\n        Parameters\n        ----------\n        d : dict\n            Dictionary to convert to html attributes.\n\n        Returns\n        -------\n        str\n            String of HTML attributes in the form ``key_i=\\\"value_i\\\" ... key_N=\\\"value_N\\\"``,\n            where ``N`` is the total number of ``(key, value)`` pairs.  \n        \"\"\"\n        if d is None:\n            return \"\"\n\n        return \"\".join(\" {}=\\\"{}\\\"\".format(key, value) for key, value in iter(d.items()))", "entry_point": "_dict_to_html_attributes", "input": "{'a': 1, 'b': 2}", "output": "' a=\"1\" b=\"2\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/latture/json2table/blob/8bd1363f54ee4fd608ffb7677761526184a9da83/json2table/json2table.py#L144-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033085", "code": "def camel_case(snake_str):\n    \"\"\"\n    Returns a camel-cased version of a string.\n\n    :param a_string: any :class:`str` object.\n\n    Usage:\n        >>> camel_case('foo_bar')\n        \"fooBar\"\n    \"\"\"\n\n    components = snake_str.split('_')\n    # We capitalize the first letter of each component except the first one\n    # with the 'title' method and join them together.\n    return components[0] + \"\".join(x.title() for x in components[1:])", "entry_point": "camel_case", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/contentful/contentful-management.py/blob/707dd30883b98a10c7ff0f7f5bdb8edbdc1d8df0/contentful_management/utils.py#L73-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033086", "code": "def convertToPositiveInt(val=None, invalidDefault=0):\n    '''\n        convertToPositiveInt - Convert to a positive integer, and if invalid use a given value\n    '''\n    if val is None:\n        return invalidDefault\n\n    try:\n        val = int(val)\n    except:\n        return invalidDefault\n\n    if val < 0:\n        return invalidDefault\n\n    return val", "entry_point": "convertToPositiveInt", "input": "[-1, 0, 1, 2], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kata198/AdvancedHTMLParser/blob/06aeea5d8e2ea86e155aae0fc237623d3e9b7f9d/AdvancedHTMLParser/conversions.py#L77-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033087", "code": "def dashNameToCamelCase(dashName):\n        '''\n            dashNameToCamelCase - Converts a \"dash name\" (like padding-top) to its camel-case name ( like \"paddingTop\" )\n\n            @param dashName <str> - A name containing dashes\n\n                NOTE: This method is currently unused, but may be used in the future. kept for completeness.\n\n            @return <str> - The camel-case form\n        '''\n        nameParts = dashName.split('-')\n        for i in range(1, len(nameParts), 1):\n            nameParts[i][0] = nameParts[i][0].upper()\n\n        return ''.join(nameParts)", "entry_point": "dashNameToCamelCase", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kata198/AdvancedHTMLParser/blob/06aeea5d8e2ea86e155aae0fc237623d3e9b7f9d/AdvancedHTMLParser/SpecialAttributes.py#L598-L612", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033088", "code": "def camelCaseToDashName(camelCase):\n        '''\n            camelCaseToDashName - Convert a camel case name to a dash-name (like paddingTop to padding-top)\n\n            @param camelCase <str> - A camel-case string\n\n            @return <str> - A dash-name\n        '''\n\n        camelCaseList = list(camelCase)\n\n        ret = []\n\n        for ch in camelCaseList:\n            if ch.isupper():\n                ret.append('-')\n                ret.append(ch.lower())\n            else:\n                ret.append(ch)\n\n        return ''.join(ret)", "entry_point": "camelCaseToDashName", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kata198/AdvancedHTMLParser/blob/06aeea5d8e2ea86e155aae0fc237623d3e9b7f9d/AdvancedHTMLParser/SpecialAttributes.py#L615-L635", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033089", "code": "def is_valid_release_version(version):\n    '''Checks that the given version code is valid.'''\n    return version is not None and len(version) == 6 and version[0] == 'R' \\\n            and int(version[1:5]) in range(1990, 2050) \\\n            and version[5] in ('h', 'g', 'f', 'e', 'd', 'c', 'b', 'a')", "entry_point": "is_valid_release_version", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewiger/mlab/blob/72a98adf6499f548848ad44c604f74d68f07fe4f/src/mlab/matlabpipe.py#L72-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033090", "code": "def bipart(func, seq):\n    r\"\"\"Like a partitioning version of `filter`. Returns\n    ``[itemsForWhichFuncReturnedFalse, itemsForWhichFuncReturnedTrue]``.\n\n    Example:\n\n    >>> bipart(bool, [1,None,2,3,0,[],[0]])\n    [[None, 0, []], [1, 2, 3, [0]]]\n    \"\"\"\n\n    if func is None: func = bool\n    res = [[],[]]\n    for i in seq: res[not not func(i)].append(i)\n    return res", "entry_point": "bipart", "input": "['a', 'b', 'c'], []", "output": "[[], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewiger/mlab/blob/72a98adf6499f548848ad44c604f74d68f07fe4f/src/mlab/awmstools.py#L478-L491", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033091", "code": "def iprotate(l, steps=1):\n    r\"\"\"Like rotate, but modifies `l` in-place.\n\n    >>> l = [1,2,3]\n    >>> iprotate(l) is l\n    True\n    >>> l\n    [2, 3, 1]\n    >>> iprotate(iprotate(l, 2), -3)\n    [1, 2, 3]\n\n    \"\"\"\n    if len(l):\n        steps %= len(l)\n        if steps:\n            firstPart = l[:steps]\n            del l[:steps]\n            l.extend(firstPart)\n    return l", "entry_point": "iprotate", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewiger/mlab/blob/72a98adf6499f548848ad44c604f74d68f07fe4f/src/mlab/awmstools.py#L568-L586", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033092", "code": "def unweave(iterable, n=2):\n    r\"\"\"Divide `iterable` in `n` lists, so that every `n`th element belongs to\n    list `n`.\n\n    Example:\n\n    >>> unweave((1,2,3,4,5), 3)\n    [[1, 4], [2, 5], [3]]\n    \"\"\"\n    res = [[] for i in range(n)]\n    i = 0\n    for x in iterable:\n        res[i % n].append(x)\n        i += 1\n    return res", "entry_point": "unweave", "input": "set(), 5", "output": "[[], [], [], [], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewiger/mlab/blob/72a98adf6499f548848ad44c604f74d68f07fe4f/src/mlab/awmstools.py#L655-L669", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033093", "code": "def positionIf(pred, seq):\n    \"\"\"\n    >>> positionIf(lambda x: x > 3, range(10))\n    4\n    \"\"\"\n    for i,e in enumerate(seq):\n        if pred(e):\n            return i\n    return -1", "entry_point": "positionIf", "input": "set(), []", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewiger/mlab/blob/72a98adf6499f548848ad44c604f74d68f07fe4f/src/mlab/awmstools.py#L969-L977", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033094", "code": "def lineAndColumnAt(s, pos):\n    r\"\"\"Return line and column of `pos` (0-based!) in `s`. Lines start with\n    1, columns with 0.\n\n    Examples:\n\n    >>> lineAndColumnAt(\"0123\\n56\", 5)\n    (2, 0)\n    >>> lineAndColumnAt(\"0123\\n56\", 6)\n    (2, 1)\n    >>> lineAndColumnAt(\"0123\\n56\", 0)\n    (1, 0)\n    \"\"\"\n    if pos >= len(s):\n        raise IndexError(\"`pos` %d not in string\" % pos)\n    # *don't* count last '\\n', if it is at pos!\n    line = s.count('\\n',0,pos)\n    if line:\n        return line + 1, pos - s.rfind('\\n',0,pos) - 1\n    else:\n        return 1, pos", "entry_point": "lineAndColumnAt", "input": "'Hello World', 0", "output": "(1, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewiger/mlab/blob/72a98adf6499f548848ad44c604f74d68f07fe4f/src/mlab/awmstools.py#L1198-L1218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033095", "code": "def is_local_subsection(command_dict):\n    \"\"\"Returns True if command dict is \"local subsection\", meaning\n    that it is \"if\", \"else\" or \"for\" (not a real call, but calls\n    run_section recursively.\"\"\"\n    for local_com in ['if ', 'for ', 'else ']:\n        if list(command_dict.keys())[0].startswith(local_com):\n            return True\n    return False", "entry_point": "is_local_subsection", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/devassistant/devassistant/blob/2dbfeaa666a64127263664d18969c55d19ecc83e/devassistant/excepthook.py#L24-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033096", "code": "def get_word_list_eng(text):\n    \"\"\"A naive function that extracts English words from raw texts.\n\n    :param text: The raw text.\n    :return words: A list of strings.\n    \"\"\"\n    words, index = [''], 0\n    while index < len(text):\n        while index < len(text) and ('a' <= text[index] <= 'z' or 'A' <= text[index] <= 'Z'):\n            words[-1] += text[index]\n            index += 1\n        if words[-1]:\n            words.append('')\n        while index < len(text) and not ('a' <= text[index] <= 'z' or 'A' <= text[index] <= 'Z'):\n            if text[index] != ' ':\n                words[-1] += text[index]\n            index += 1\n        if words[-1]:\n            words.append('')\n    if not words[-1]:\n        words.pop()\n    return words", "entry_point": "get_word_list_eng", "input": "'Hello World'", "output": "['Hello', 'World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CyberZHG/keras-word-char-embd/blob/cca6ddff01b6264dd0d12613bb9ed308e1367b8c/keras_wc_embd/word_char_embd.py#L254-L275", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033097", "code": "def _setdef(argdict, name, defaultvalue):\n    \"\"\"Like dict.setdefault but sets the default value also if None is present.\n\n    \"\"\"\n    if not name in argdict or argdict[name] is None:\n        argdict[name] = defaultvalue\n    return argdict[name]", "entry_point": "_setdef", "input": "{}, 'abc', [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mnmelo/lazy_import/blob/29c74c83e90adff62d363220fee8cf7d6f0dd3c9/lazy_import/__init__.py#L584-L590", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033098", "code": "def list_to_csv(value):\n    \"\"\"\n    Converts list to string with comma separated values. For string is no-op.\n    \"\"\"\n    if isinstance(value, (list, tuple, set)):\n        value = \",\".join(value)\n    return value", "entry_point": "list_to_csv", "input": "['apple', 'banana', 'cherry']", "output": "'apple,banana,cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Stranger6667/postmarker/blob/013224ab1761e95c488c7d2701e6fa83f3108d94/postmarker/models/emails.py#L24-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033099", "code": "def rangify(number_list):\n    \"\"\"Assumes the list is sorted.\"\"\"\n    if not number_list:\n        return number_list\n\n    ranges = []\n\n    range_start = prev_num = number_list[0]\n    for num in number_list[1:]:\n        if num != (prev_num + 1):\n            ranges.append((range_start, prev_num))\n            range_start = num\n        prev_num = num\n\n    ranges.append((range_start, prev_num))\n    return ranges", "entry_point": "rangify", "input": "[-1, 0, 1, 2]", "output": "[(-1, 2)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aconrad/pycobertura/blob/26e472f1424f5cd499c42232dc5ee12e4042806f/pycobertura/utils.py#L61-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033100", "code": "def extrapolate_coverage(lines_w_status):\n    \"\"\"\n    Given the following input:\n\n    >>> lines_w_status = [\n        (1, True),\n        (4, True),\n        (7, False),\n        (9, False),\n    ]\n\n    Return expanded lines with their extrapolated line status.\n\n    >>> extrapolate_coverage(lines_w_status) == [\n        (1, True),\n        (2, True),\n        (3, True),\n        (4, True),\n        (5, None),\n        (6, None),\n        (7, False),\n        (8, False),\n        (9, False),\n    ]\n\n    \"\"\"\n    lines = []\n\n    prev_lineno = 0\n    prev_status = True\n    for lineno, status in lines_w_status:\n        while (lineno - prev_lineno) > 1:\n            prev_lineno += 1\n            if prev_status is status:\n                lines.append((prev_lineno, status))\n            else:\n                lines.append((prev_lineno, None))\n        lines.append((lineno, status))\n        prev_lineno = lineno\n        prev_status = status\n\n    return lines", "entry_point": "extrapolate_coverage", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aconrad/pycobertura/blob/26e472f1424f5cd499c42232dc5ee12e4042806f/pycobertura/utils.py#L79-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033101", "code": "def hunkify_lines(lines, context=3):\n    \"\"\"\n    Return a list of line hunks given a list of lines `lines`. The number of\n    context lines can be control with `context` which will return line hunks\n    surrounded with `context` lines before and after the code change.\n    \"\"\"\n    # Find contiguous line changes\n    ranges = []\n    range_start = None\n    for i, line in enumerate(lines):\n        if line.status is not None:\n            if range_start is None:\n                range_start = i\n                continue\n        elif range_start is not None:\n            range_stop = i\n            ranges.append((range_start, range_stop))\n            range_start = None\n    else:\n        # Append the last range\n        if range_start is not None:\n            range_stop = i\n            ranges.append((range_start, range_stop))\n\n    # add context\n    ranges_w_context = []\n    for range_start, range_stop in ranges:\n        range_start = range_start - context\n        range_start = range_start if range_start >= 0 else 0\n        range_stop = range_stop + context\n        ranges_w_context.append((range_start, range_stop))\n\n    # merge overlapping hunks\n    merged_ranges = ranges_w_context[:1]\n    for range_start, range_stop in ranges_w_context[1:]:\n        prev_start, prev_stop = merged_ranges[-1]\n        if range_start <= prev_stop:\n            range_start = prev_start\n            merged_ranges[-1] = (range_start, range_stop)\n        else:\n            merged_ranges.append((range_start, range_stop))\n\n    # build final hunks\n    hunks = []\n    for range_start, range_stop in merged_ranges:\n        hunk = lines[range_start:range_stop]\n        hunks.append(hunk)\n\n    return hunks", "entry_point": "hunkify_lines", "input": "{}, ()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aconrad/pycobertura/blob/26e472f1424f5cd499c42232dc5ee12e4042806f/pycobertura/utils.py#L162-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033102", "code": "def equate_initial(name1, name2):\n    \"\"\"\n    Evaluates whether names match, or one name is the initial of the other\n    \"\"\"\n    if len(name1) == 0 or len(name2) == 0:\n        return False\n\n    if len(name1) == 1 or len(name2) == 1:\n        return name1[0] == name2[0]\n\n    return name1 == name2", "entry_point": "equate_initial", "input": "'walnut thistle harbour', 'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rliebz/whoswho/blob/0c411e418c240fcec6ea0a23d15bd003056c65d0/whoswho/utils.py#L61-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033103", "code": "def equate_prefix(name1, name2):\n    \"\"\"\n    Evaluates whether names match, or one name prefixes another\n    \"\"\"\n\n    if len(name1) == 0 or len(name2) == 0:\n        return False\n\n    return name1.startswith(name2) or name2.startswith(name1)", "entry_point": "equate_prefix", "input": "'AbC dEf', ''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rliebz/whoswho/blob/0c411e418c240fcec6ea0a23d15bd003056c65d0/whoswho/utils.py#L74-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033104", "code": "def _get_average_time_stamp(action_set):\n        \"\"\"Return the average time stamp for the rules in this action\n        set.\"\"\"\n        # This is the average value of the iteration counter upon the most\n        # recent update of each rule in this action set.\n        total_time_stamps = sum(rule.time_stamp * rule.numerosity\n                                for rule in action_set)\n        total_numerosity = sum(rule.numerosity for rule in action_set)\n        return total_time_stamps / (total_numerosity or 1)", "entry_point": "_get_average_time_stamp", "input": "[]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hosford42/xcs/blob/183bdd0dd339e19ded3be202f86e1b38bdb9f1e5/xcs/algorithms/xcs.py#L816-L824", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033105", "code": "def mean_absolute_error(seq, correct):\n    \"\"\"\n    Batch mean absolute error calculation.\n    \"\"\"\n    assert len(seq) == len(correct)\n    diffs = [abs(a-b) for a, b in zip(seq, correct)]\n    return sum(diffs)/float(len(diffs))", "entry_point": "mean_absolute_error", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "2.75", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chrisspen/dtree/blob/9e9c9992b22ad9a7e296af7e6837666b05db43ef/dtree.py#L101-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033106", "code": "def normalize(seq):\n    \"\"\"\n    Scales each number in the sequence so that the sum of all numbers equals 1.\n    \"\"\"\n    s = float(sum(seq))\n    return [v/s for v in seq]", "entry_point": "normalize", "input": "[5, 3, 1, 4]", "output": "[0.38461538461538464, 0.23076923076923078, 0.07692307692307693, 0.3076923076923077]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chrisspen/dtree/blob/9e9c9992b22ad9a7e296af7e6837666b05db43ef/dtree.py#L109-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033107", "code": "def unique(lst):\n    \"\"\"\n    Returns a list made up of the unique values found in lst.  i.e., it\n    removes the redundant values in lst.\n    \"\"\"\n    lst = lst[:]\n    unique_lst = []\n\n    # Cycle through the list and add each value to the unique list only once.\n    for item in lst:\n        if unique_lst.count(item) <= 0:\n            unique_lst.append(item)\n            \n    # Return the list with all redundant values removed.\n    return unique_lst", "entry_point": "unique", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chrisspen/dtree/blob/9e9c9992b22ad9a7e296af7e6837666b05db43ef/dtree.py#L507-L521", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033108", "code": "def _decode_byte(byte):\n    \"\"\"Helper for decode_qp, turns a single byte into a list of bits.\n\n    Args:\n        byte: byte to be decoded\n\n    Returns:\n        list of bits corresponding to byte\n    \"\"\"\n    bits = []\n    for _ in range(8):\n        bits.append(byte & 1)\n        byte >>= 1\n    return bits", "entry_point": "_decode_byte", "input": "True", "output": "[1, 0, 0, 0, 0, 0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwavesystems/dwave-cloud-client/blob/df3221a8385dc0c04d7b4d84f740bf3ad6706230/dwave/cloud/coders.py#L128-L141", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033109", "code": "def nr_of_baselines(na, auto_correlations=False):\n    \"\"\"\n    Compute the number of baselines for the\n    given number of antenna. Can specify whether\n    auto-correlations should be taken into\n    account\n    \"\"\"\n    m = (na-1) if auto_correlations is False else (na+1)\n    return (na*m)//2", "entry_point": "nr_of_baselines", "input": "0.5, False", "output": "-1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/montblanc/blob/8a2e742e7500bcc6196489b735f87b233075dd2d/montblanc/util/__init__.py#L43-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033110", "code": "def _clrgen(n, h0, hr):\n        \"\"\"Default colour generating function\n\n        Parameters\n        ----------\n\n        n : int\n          Number of colours to generate\n        h0 : float\n          Initial H value in HSV colour specification\n        hr : float\n          Size of H value range to use for colour generation\n          (final H value is h0 + hr)\n\n        Returns\n        -------\n        clst : list of strings\n          List of HSV format colour specification strings\n        \"\"\"\n\n        n0 = n if n == 1 else n-1\n        clst = ['%f,%f,%f' % (h0 + hr*hi/n0, 0.35, 0.85) for\n                hi in range(n)]\n        return clst", "entry_point": "_clrgen", "input": "False, 2.0, True", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwohlberg/jonga/blob/1947d40d78d814fbdc3a973ceffec4b69b4623f2/jonga.py#L331-L354", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033111", "code": "def check_table(table):\n    \"\"\"\n    Ensure the table is valid for converting to grid table.\n\n    * The table must a list of lists\n    * Each row must contain the same number of columns\n    * The table must not be empty\n\n    Parameters\n    ----------\n    table : list of lists of str\n        The list of rows of strings to convert to a grid table\n\n    Returns\n    -------\n    message : str\n        If no problems are found, this message is empty, otherwise it\n        tries to describe the problem that was found.\n    \"\"\"\n    if not type(table) is list:\n        return \"Table must be a list of lists\"\n\n    if len(table) == 0:\n        return \"Table must contain at least one row and one column\"\n\n    for i in range(len(table)):\n        if not type(table[i]) is list:\n            return \"Table must be a list of lists\"\n        if not len(table[i]) == len(table[0]):\n            \"Each row must have the same number of columns\"\n\n    return \"\"", "entry_point": "check_table", "input": "{}", "output": "'Table must be a list of lists'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/dashutils/check_table.py#L1-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033112", "code": "def truncate_empty_lines(lines):\n    \"\"\"\n    Removes all empty lines from above and below the text.\n\n    We can't just use text.strip() because that would remove the leading\n    space for the table.\n\n    Parameters\n    ----------\n    lines : list of str\n\n    Returns\n    -------\n    lines : list of str\n        The text lines without empty lines above or below\n    \"\"\"\n    while lines[0].rstrip() == '':\n        lines.pop(0)\n    while lines[len(lines) - 1].rstrip() == '':\n        lines.pop(-1)\n    return lines", "entry_point": "truncate_empty_lines", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/simple2data/truncate_empty_lines.py#L1-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033113", "code": "def get_span_row_count(span):\n    \"\"\"\n    Gets the number of rows included in a span\n\n    Parameters\n    ----------\n    span : list of lists of int\n        The [row, column] pairs that make up the span\n\n    Returns\n    -------\n    rows : int\n        The number of rows included in the span\n\n    Example\n    -------\n    Consider this table::\n\n        +--------+-----+\n        | foo    | bar |\n        +--------+     |\n        | spam   |     |\n        +--------+     |\n        | goblet |     |\n        +--------+-----+\n\n    ::\n\n        >>> span = [[0, 1], [1, 1], [2, 1]]\n        >>> print(get_span_row_count(span))\n        3\n    \"\"\"\n    rows = 1\n    first_row = span[0][0]\n\n    for i in range(len(span)):\n        if span[i][0] > first_row:\n            rows += 1\n            first_row = span[i][0]\n\n    return rows", "entry_point": "get_span_row_count", "input": "['apple', 'banana', 'cherry']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/dashutils/get_span_row_count.py#L1-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033114", "code": "def multis_2_mono(table):\n    \"\"\"\n    Converts each multiline string in a table to single line.\n\n    Parameters\n    ----------\n    table : list of list of str\n        A list of rows containing strings\n\n    Returns\n    -------\n    table : list of lists of str\n    \"\"\"\n    for row in range(len(table)):\n        for column in range(len(table[row])):\n            table[row][column] = table[row][column].replace('\\n', ' ')\n\n    return table", "entry_point": "multis_2_mono", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/dashutils/multis_2_mono.py#L1-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033115", "code": "def get_longest_line_length(text):\n    \"\"\"Get the length longest line in a paragraph\"\"\"\n    lines = text.split(\"\\n\")\n    length = 0\n\n    for i in range(len(lines)):\n        if len(lines[i]) > length:\n            length = len(lines[i])\n\n    return length", "entry_point": "get_longest_line_length", "input": "''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/data2rst/cell/get_longest_line_length.py#L1-L10", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033116", "code": "def add_cushions(table):\n    \"\"\"\n    Add space to start and end of each string in a list of lists\n\n    Parameters\n    ----------\n    table : list of lists of str\n        A table of rows of strings. For example::\n\n            [\n                ['dog', 'cat', 'bicycle'],\n                ['mouse', trumpet', '']\n            ]\n\n    Returns\n    -------\n    table : list of lists of str\n\n    Note\n    ----\n    Each cell in an rst grid table should to have a cushion of at least\n    one space on each side of the string it contains. For example::\n\n        +-----+-------+\n        | foo | bar   |\n        +-----+-------+\n        | cat | steve |\n        +-----+-------+\n\n    is better than::\n\n        +-----+---+\n        |foo| bar |\n        +-----+---+\n        |cat|steve|\n        +-----+---+\n    \"\"\"\n    for row in range(len(table)):\n        for column in range(len(table[row])):\n            lines = table[row][column].split(\"\\n\")\n\n            for i in range(len(lines)):\n                if not lines[i] == \"\":\n                    lines[i] = \" \" + lines[i].rstrip() + \" \"\n\n            table[row][column] = \"\\n\".join(lines)\n\n    return table", "entry_point": "add_cushions", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/dashutils/add_cushions.py#L1-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033117", "code": "def get_column_width(column, table):\n    \"\"\"\n    Get the character width of a column in a table\n\n    Parameters\n    ----------\n    column : int\n        The column index analyze\n    table : list of lists of str\n        The table of rows of strings. For this to be accurate, each\n        string must only be 1 line long.\n\n    Returns\n    -------\n        width : int\n    \"\"\"\n    width = 3\n\n    for row in range(len(table)):\n        cell_width = len(table[row][column])\n        if cell_width > width:\n            width = cell_width\n\n    return width", "entry_point": "get_column_width", "input": "[5, 3, 1, 4], {}", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/data2md/get_column_width.py#L1-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033118", "code": "def ensure_table_strings(table):\n    \"\"\"\n    Force each cell in the table to be a string\n\n    Parameters\n    ----------\n    table : list of lists\n\n    Returns\n    -------\n    table : list of lists of str\n    \"\"\"\n    for row in range(len(table)):\n        for column in range(len(table[row])):\n            table[row][column] = str(table[row][column])\n    return table", "entry_point": "ensure_table_strings", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/dashutils/ensure_table_strings.py#L1-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033119", "code": "def convert_p(element, text):\n    \"\"\"\n    Adds 2 newlines to the end of text\n    \"\"\"\n    depth = -1\n    while element:\n        if (not element.name == '[document]' and\n                not element.parent.get('id') == '__RESTRUCTIFY_WRAPPER__'):\n            depth += 1\n\n        element = element.parent\n\n    if text:\n        text = '    ' * depth + text\n    return text", "entry_point": "convert_p", "input": "[], 'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/html2data/restructify/converters/convert_p.py#L1-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033120", "code": "def make_empty_table(row_count, column_count):\n    \"\"\"\n    Make an empty table\n\n    Parameters\n    ----------\n    row_count : int\n        The number of rows in the new table\n    column_count : int\n        The number of columns in the new table\n\n    Returns\n    -------\n    table : list of lists of str\n        Each cell will be an empty str ('')\n    \"\"\"\n    table = []\n    while row_count > 0:\n        row = []\n        for column in range(column_count):\n            row.append('')\n        table.append(row)\n        row_count -= 1\n    return table", "entry_point": "make_empty_table", "input": "1, 10", "output": "[['', '', '', '', '', '', '', '', '', '']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doakey3/DashTable/blob/744cfb6a717fa75a8092c83ebcd49b2668023681/dashtable/dashutils/make_empty_table.py#L1-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033121", "code": "def read_line(line):\n        \"\"\"Reads lines of XML and delimits, strips, and returns.\"\"\"\n        name, value = '', ''\n\n        if '=' in line:\n            name, value = line.split('=', 1)\n\n        return [name.strip(), value.strip()]", "entry_point": "read_line", "input": "'Hello World'", "output": "['', '']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/refindlyllc/rets/blob/c615dfc272cff0825fd3b50863c46afc3e33916f/rets/parsers/login.py#L48-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033122", "code": "def dmql(query):\n        \"\"\"Client supplied raw DMQL, ensure quote wrap.\"\"\"\n        if isinstance(query, dict):\n            raise ValueError(\"You supplied a dictionary to the dmql_query parameter, but a string is required.\"\n                                \" Did you mean to pass this to the search_filter parameter? \")\n\n        # automatically surround the given query with parentheses if it doesn't have them already\n        if len(query) > 0 and query != \"*\" and query[0] != '(' and query[-1] != ')':\n            query = '({})'.format(query)\n        return query", "entry_point": "dmql", "input": "['a', 'b', 'c']", "output": "\"(['a', 'b', 'c'])\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/refindlyllc/rets/blob/c615dfc272cff0825fd3b50863c46afc3e33916f/rets/utils/search.py#L14-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033123", "code": "def get_attributes(input_dict):\n        \"\"\"\n        Get attributes of xml tags in input_dict and creates a dictionary with the attribute name as the key and the\n        attribute value as the value\n        :param input_dict: The xml tag with the attributes and values\n        :return: dict\n        \"\"\"\n        return {k.lstrip(\"@\"): v for k, v in input_dict.items() if k[0] == \"@\"}", "entry_point": "get_attributes", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/refindlyllc/rets/blob/c615dfc272cff0825fd3b50863c46afc3e33916f/rets/parsers/base.py#L12-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033124", "code": "def get_short_annotations(annotations):\n    \"\"\"\n    Converts full GATK annotation name to the shortened version\n    :param annotations:\n    :return:\n    \"\"\"\n    # Annotations need to match VCF header\n    short_name = {'QualByDepth': 'QD',\n                  'FisherStrand': 'FS',\n                  'StrandOddsRatio': 'SOR',\n                  'ReadPosRankSumTest': 'ReadPosRankSum',\n                  'MappingQualityRankSumTest': 'MQRankSum',\n                  'RMSMappingQuality': 'MQ',\n                  'InbreedingCoeff': 'ID'}\n\n    short_annotations = []\n    for annotation in annotations:\n        if annotation in short_name:\n            annotation = short_name[annotation]\n        short_annotations.append(annotation)\n    return short_annotations", "entry_point": "get_short_annotations", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BD2KGenomics/toil-scripts/blob/f878d863defcdccaabb7fe06f991451b7a198fb7/src/toil_scripts/gatk_germline/vqsr.py#L165-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033125", "code": "def censor_non_alphanum(s):\n    \"\"\"\n    Returns s with all non-alphanumeric characters replaced with *\n    \"\"\"\n\n    def censor(ch):\n        if (ch >= 'A' and ch <= 'z') or (ch >= '0' and ch <= '9'):\n            return ch\n        return '*'\n\n    return ''.join([censor(ch) for ch in s])", "entry_point": "censor_non_alphanum", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/utils/string_utils.py#L221-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033126", "code": "def is_period_alias(period):\n    \"\"\"\n    Check if a given period is possibly an alias.\n\n    Parameters\n    ----------\n    period : float\n        A period to test if it is a possible alias or not.\n\n    Returns\n    -------\n    is_alias : boolean\n        True if the given period is in a range of period alias.\n    \"\"\"\n\n    # Based on the period vs periodSN plot of EROS-2 dataset (Kim+ 2014).\n    # Period alias occurs mostly at ~1 and ~30.\n    # Check each 1, 2, 3, 4, 5 factors.\n    for i in range(1, 6):\n        # One-day and one-month alias\n        if (.99 / float(i)) < period < (1.004 / float(i)):\n            return True\n        if (1.03 / float(i)) < period < (1.04 / float(i)):\n            return True\n        if (29.2 / float(i)) < period < (29.9 / float(i)):\n            return True\n\n        # From candidates from the two fields 01, 08.\n        # All of them are close to one day (or sidereal) alias.\n        if (0.96465 / float(i)) < period < (0.96485 / float(i)):\n            return True\n        if (0.96725 / float(i)) < period < (0.96745 / float(i)):\n            return True\n        if (0.98190 / float(i)) < period < (0.98230 / float(i)):\n            return True\n        if (1.01034 / float(i)) < period < (1.01076 / float(i)):\n            return True\n        if (1.01568 / float(i)) < period < (1.01604 / float(i)):\n            return True\n        if (1.01718 / float(i)) < period < (1.01742 / float(i)):\n            return True\n\n        # From the all candidates from the entire LMC fields.\n        # Some of these could be overlapped with the above cuts.\n        if (0.50776 / float(i)) < period < (0.50861 / float(i)):\n            return True\n        if (0.96434 / float(i)) < period < (0.9652 / float(i)):\n            return True\n        if (0.96688 / float(i)) < period < (0.96731 / float(i)):\n            return True\n        if (1.0722 / float(i)) < period < (1.0729 / float(i)):\n            return True\n        if (27.1 / float(i)) < period < (27.5 / float(i)):\n            return True\n\n    # Not in the range of any alias.\n    return False", "entry_point": "is_period_alias", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwkim78/upsilon/blob/5f381453f26582ef56e62fb8fed7317ce67861af/upsilon/extract_features/is_period_alias.py#L1-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033127", "code": "def flatten(list_of_lists):\n  \"\"\"flatten([[A]]) -> [A]\n\n  Flatten a list of lists.\n  \"\"\"\n  ret = []\n  for lst in list_of_lists:\n    if not isinstance(lst, list):\n      raise ValueError('%r is not a list' % lst)\n    ret.extend(lst)\n  return ret", "entry_point": "flatten", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/functions.py#L101-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033128", "code": "def get_lt(hdr):\n    \"\"\"Obtain the LTV and LTM keyword values.\n\n    Note that this returns the values just as read from the header,\n    which means in particular that the LTV values are for one-indexed\n    pixel coordinates.\n\n    LTM keywords are the diagonal elements of MWCS linear\n    transformation matrix, while LTV's are MWCS linear transformation\n    vector (1-indexed).\n\n    .. note:: Translated from ``calacs/lib/getlt.c``.\n\n    Parameters\n    ----------\n    hdr : obj\n        Extension header.\n\n    Returns\n    -------\n    ltm, ltv : tuple of float\n        ``(LTM1_1, LTM2_2)`` and ``(LTV1, LTV2)``.\n        Values are ``(1, 1)`` and ``(0, 0)`` if not found,\n        to accomodate reference files with missing info.\n\n    Raises\n    ------\n    ValueError\n        Invalid LTM* values.\n\n    \"\"\"\n    ltm = (hdr.get('LTM1_1', 1.0), hdr.get('LTM2_2', 1.0))\n\n    if ltm[0] <= 0 or ltm[1] <= 0:\n        raise ValueError('(LTM1_1, LTM2_2) = {0} is invalid'.format(ltm))\n\n    ltv = (hdr.get('LTV1', 0.0), hdr.get('LTV2', 0.0))\n    return ltm, ltv", "entry_point": "get_lt", "input": "{'x': [1, 2], 'y': []}", "output": "((1.0, 1.0), (0.0, 0.0))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L391-L428", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033129", "code": "def split_sig(params):\n    \"\"\"\n    Split a list of parameters/types by commas,\n    whilst respecting brackets.\n\n    For example:\n      String arg0, int arg2 = 1, List<int> arg3 = [1, 2, 3]\n      => ['String arg0', 'int arg2 = 1', 'List<int> arg3 = [1, 2, 3]']\n    \"\"\"\n    result = []\n    current = ''\n    level = 0\n    for char in params:\n        if char in ('<', '{', '['):\n            level += 1\n        elif char in ('>', '}', ']'):\n            level -= 1\n        if char != ',' or level > 0:\n            current += char\n        elif char == ',' and level == 0:\n            result.append(current)\n            current = ''\n    if current.strip() != '':\n        result.append(current)\n    return result", "entry_point": "split_sig", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/djungelorm/sphinx-csharp/blob/aaa0c5fbe514d7f0b1a89625185fc608e5d30702/sphinx_csharp/csharp.py#L39-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033130", "code": "def get_pint_to_fortran_safe_units_mapping(inverse=False):\n    \"\"\"Get the mappings from Pint to Fortran safe units.\n\n    Fortran can't handle special characters like \"^\" or \"/\" in names, but we need\n    these in Pint. Conversely, Pint stores variables with spaces by default e.g. \"Mt\n    CO2 / yr\" but we don't want these in the input files as Fortran is likely to think\n    the whitespace is a delimiter.\n\n    Parameters\n    ----------\n    inverse : bool\n        If True, return the inverse mappings i.e. Fortran safe to Pint mappings\n\n    Returns\n    -------\n    dict\n        Dictionary of mappings\n    \"\"\"\n    replacements = {\"^\": \"super\", \"/\": \"per\", \" \": \"\"}\n    if inverse:\n        replacements = {v: k for k, v in replacements.items()}\n        # mapping nothing to something is obviously not going to work in the inverse\n        # hence remove\n        replacements.pop(\"\")\n\n    return replacements", "entry_point": "get_pint_to_fortran_safe_units_mapping", "input": "['apple', 'banana', 'cherry']", "output": "{'super': '^', 'per': '/'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openclimatedata/pymagicc/blob/d896014832cf458d1e95e5878fd6d5961f3e2e05/pymagicc/definitions/__init__.py#L639-L664", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033131", "code": "def remove_linebreaks_within_equations(code):\n        r\"\"\"Remove line breaks within equations.\n\n        This is not a exhaustive test, but shows how the method works:\n\n        >>> code = 'asdf = \\\\\\n(a\\n+b)'\n        >>> from hydpy.cythons.modelutils import FuncConverter\n        >>> FuncConverter.remove_linebreaks_within_equations(code)\n        'asdf = (a+b)'\n        \"\"\"\n        code = code.replace('\\\\\\n', '')\n        chars = []\n        counter = 0\n        for char in code:\n            if char in ('(', '[', '{'):\n                counter += 1\n            elif char in (')', ']', '}'):\n                counter -= 1\n            if not (counter and (char == '\\n')):\n                chars.append(char)\n        return ''.join(chars)", "entry_point": "remove_linebreaks_within_equations", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L1171-L1191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033132", "code": "def enumeration(values, converter=str, default=''):\n    \"\"\"Return an enumeration string based on the given values.\n\n    The following four examples show the standard output of function\n    |enumeration|:\n\n    >>> from hydpy.core.objecttools import enumeration\n    >>> enumeration(('text', 3, []))\n    'text, 3, and []'\n    >>> enumeration(('text', 3))\n    'text and 3'\n    >>> enumeration(('text',))\n    'text'\n    >>> enumeration(())\n    ''\n\n    All given objects are converted to strings by function |str|, as shown\n    by the first two examples.  This behaviour can be changed by another\n    function expecting a single argument and returning a string:\n\n    >>> from hydpy.core.objecttools import classname\n    >>> enumeration(('text', 3, []), converter=classname)\n    'str, int, and list'\n\n    Furthermore, you can define a default string that is returned\n    in case an empty iterable is given:\n\n    >>> enumeration((), default='nothing')\n    'nothing'\n    \"\"\"\n    values = tuple(converter(value) for value in values)\n    if not values:\n        return default\n    if len(values) == 1:\n        return values[0]\n    if len(values) == 2:\n        return ' and '.join(values)\n    return ', and '.join((', '.join(values[:-1]), values[-1]))", "entry_point": "enumeration", "input": "[], 'a,b,c', {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/objecttools.py#L1431-L1468", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033133", "code": "def _is_significant(stats, metrics=None):\n    \"\"\"Filter significant motifs based on several statistics.\n    \n    Parameters\n    ----------\n    stats : dict\n        Statistics disctionary object.\n\n    metrics : sequence\n        Metric with associated minimum values. The default is\n        ((\"max_enrichment\", 3), (\"roc_auc\", 0.55), (\"enr_at_fpr\", 0.55))\n    \n    Returns\n    -------\n    significant : bool\n    \"\"\"\n    if metrics is None:\n        metrics = ((\"max_enrichment\", 3), (\"roc_auc\", 0.55), (\"enr_at_fpr\", 0.55))\n    \n    for stat_name, min_value in metrics:\n        if stats.get(stat_name, 0) < min_value:\n            return False\n\n    return True", "entry_point": "_is_significant", "input": "['a', 'b', 'c'], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/denovo.py#L332-L355", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033134", "code": "def rename_motifs(motifs, stats=None):\n    \"\"\"Rename motifs to GimmeMotifs_1..GimmeMotifs_N.\n    \n    If stats object is passed, stats will be copied.\"\"\"\n    final_motifs = []\n    for i, motif in enumerate(motifs):\n        old = str(motif)\n        motif.id = \"GimmeMotifs_{}\".format(i + 1)\n        final_motifs.append(motif)\n        if stats:\n            stats[str(motif)] = stats[old].copy()\n    \n    if stats:\n        return final_motifs, stats\n    else:\n        return final_motifs", "entry_point": "rename_motifs", "input": "[], [5, 3, 1, 4]", "output": "([], [5, 3, 1, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/denovo.py#L468-L483", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033135", "code": "def fill_missing(x):\n    \"\"\"\n    Fills in missing lists (assumes end lists are missing)\n    \"\"\"\n\n    # find subject with max number of lists\n    maxlen = max([len(xi) for xi in x])\n\n    subs = []\n\n    for sub in x:\n        if len(sub)<maxlen:\n            for i in range(maxlen-len(sub)):\n                sub.append([])\n            new_sub = sub\n        else:\n            new_sub = sub\n        subs.append(new_sub)\n    return subs", "entry_point": "fill_missing", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/helpers.py#L235-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033136", "code": "def merge_pres_feats(pres, features):\n    \"\"\"\n    Helper function to merge pres and features to support legacy features argument\n    \"\"\"\n\n    sub = []\n    for psub, fsub in zip(pres, features):\n        exp = []\n        for pexp, fexp in zip(psub, fsub):\n            lst = []\n            for p, f in zip(pexp, fexp):\n                p.update(f)\n                lst.append(p)\n            exp.append(lst)\n        sub.append(exp)\n    return sub", "entry_point": "merge_pres_feats", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/helpers.py#L263-L278", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033137", "code": "def extract_classifier_and_extension(pkg_name, filename):\n    \"\"\"\n    Returns a PEP425-compliant classifier (or 'py2.py3-none-any' if it cannot be extracted),\n    and the file extension\n    TODO: return a classifier 3-members namedtuple instead of a single string\n    \"\"\"\n    basename, _, extension = filename.rpartition('.')\n    if extension == 'gz' and filename.endswith('.tar.gz'):\n        extension = 'tar.gz'\n        basename = filename[:-7]\n    if basename == pkg_name or basename[len(pkg_name)] != '-':\n        return 'py2.py3-none-any', extension\n    basename = basename[len(pkg_name)+1:]\n    classifier_parts = basename.split('-')\n    if len(classifier_parts) < 3:\n        return 'py2.py3-none-any', extension\n    if len(classifier_parts) == 3:\n        _, _, classifier_parts[0] = classifier_parts[0].rpartition('.')\n    return '-'.join(classifier_parts[-3:]), extension", "entry_point": "extract_classifier_and_extension", "input": "'', 'a,b,c'", "output": "('py2.py3-none-any', 'a,b,c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/voyages-sncf-technologies/nexus_uploader/blob/dca654f9080264b1dcaabfc2fd19f26b1c4f59fe/nexus_uploader/pypi.py#L62-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033138", "code": "def crc8(data):\n        \"\"\"\n        Perform the 1-Wire CRC check on the provided data.\n\n        :param bytearray data: 8 byte array representing 64 bit ROM code\n        \"\"\"\n        crc = 0\n\n        for byte in data:\n            crc ^= byte\n            for _ in range(8):\n                if crc & 0x01:\n                    crc = (crc >> 1) ^ 0x8C\n                else:\n                    crc >>= 1\n                crc &= 0xFF\n        return crc", "entry_point": "crc8", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adafruit/Adafruit_CircuitPython_OneWire/blob/113ca99b9087f7031f0b46a963472ad106520f9b/adafruit_onewire/bus.py#L202-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033139", "code": "def pairs_to_dict(response, encoding):\r\n    \"Create a dict given a list of key/value pairs\"\r\n    it = iter(response)\r\n    return dict(((k.decode(encoding), v) for k, v in zip(it, it)))", "entry_point": "pairs_to_dict", "input": "set(), True", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lsbardel/python-stdnet/blob/78db5320bdedc3f28c5e4f38cda13a4469e35db7/stdnet/backends/redisb/__init__.py#L36-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033140", "code": "def Channels(module):\n    '''\n    Returns the channels contained in the given K2 module.\n\n    '''\n\n    nums = {2: 1, 3: 5, 4: 9, 6: 13, 7: 17, 8: 21, 9: 25,\n            10: 29, 11: 33, 12: 37, 13: 41, 14: 45, 15: 49,\n            16: 53, 17: 57, 18: 61, 19: 65, 20: 69, 22: 73,\n            23: 77, 24: 81}\n\n    if module in nums:\n        return [nums[module], nums[module] + 1,\n                nums[module] + 2, nums[module] + 3]\n    else:\n        return None", "entry_point": "Channels", "input": "10", "output": "[29, 30, 31, 32]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rodluger/everest/blob/6779591f9f8b3556847e2fbf761bdfac7520eaea/everest/missions/k2/utils.py#L334-L349", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033141", "code": "def preprocess_data(Xs_raw):\n    '''Translate the center of mass (COM) of the data to the origin.\n    Return the prossed data and the shift of the COM'''\n    n = len(Xs_raw)\n    Xs_raw_mean = sum(X for X in Xs_raw) / n\n\n    return [X - Xs_raw_mean for X in Xs_raw], Xs_raw_mean", "entry_point": "preprocess_data", "input": "[1, 2, 3]", "output": "([-1.0, 0.0, 1.0], 2.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xingjiepan/cylinder_fitting/blob/f96d79732bc49cbc0cb4b39f008af7ce42aeb213/cylinder_fitting/fitting.py#L30-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033142", "code": "def clean_ns(tag):\n    \"\"\"Return a tag and its namespace separately.\"\"\"\n    if '}' in tag:\n        split = tag.split('}')\n        return split[0].strip('{'), split[-1]\n    return '', tag", "entry_point": "clean_ns", "input": "[]", "output": "('', [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jmoiron/speedparser/blob/e7e8d79daf73b35c9259695ad1e379476e1dfc77/speedparser/speedparser.py#L174-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033143", "code": "def unpack_frame(message):\n    \"\"\"Called to unpack a STOMP message into a dictionary.\n\n    returned = {\n        # STOMP Command:\n        'cmd' : '...',\n\n        # Headers e.g.\n        'headers' : {\n            'destination' : 'xyz',\n            'message-id' : 'some event',\n            :\n            etc,\n        }\n\n        # Body:\n        'body' : '...1234...\\x00',\n    }\n\n    \"\"\"\n    body = []\n    returned = dict(cmd='', headers={}, body='')\n\n    breakdown = message.split('\\n')\n\n    # Get the message command:\n    returned['cmd'] = breakdown[0]\n    breakdown = breakdown[1:]\n\n    def headD(field):\n        # find the first ':' everything to the left of this is a\n        # header, everything to the right is data:\n        index = field.find(':')\n        if index:\n            header = field[:index].strip()\n            data = field[index+1:].strip()\n#            print \"header '%s' data '%s'\" % (header, data)\n            returned['headers'][header.strip()] = data.strip()\n\n    def bodyD(field):\n        field = field.strip()\n        if field:\n            body.append(field)\n\n    # Recover the header fields and body data\n    handler = headD\n    for field in breakdown:\n#        print \"field:\", field\n        if field.strip() == '':\n            # End of headers, it body data next.\n            handler = bodyD\n            continue\n\n        handler(field)\n\n    # Stich the body data together:\n#    print \"1. body: \", body\n    body = \"\".join(body)\n    returned['body'] = body.replace('\\x00', '')\n\n#    print \"2. body: <%s>\" % returned['body']\n\n    return returned", "entry_point": "unpack_frame", "input": "'  padded  '", "output": "{'cmd': '  padded  ', 'headers': {}, 'body': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oisinmulvihill/stomper/blob/842ed2353a4ddd638d35929ae5b7b70eb298305c/lib/stomper/stomp_10.py#L174-L236", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033144", "code": "def ack(messageid, transactionid=None):\n    \"\"\"STOMP acknowledge command.\n\n    Acknowledge receipt of a specific message from the server.\n\n    messageid:\n        This is the id of the message we are acknowledging,\n        what else could it be? ;)\n\n    transactionid:\n        This is the id that all actions in this transaction\n        will have. If this is not given then a random UUID\n        will be generated for this.\n\n    \"\"\"\n    header = 'message-id: %s' % messageid\n\n    if transactionid:\n        header = 'message-id: %s\\ntransaction: %s' % (messageid, transactionid)\n\n    return \"ACK\\n%s\\n\\n\\x00\\n\" % header", "entry_point": "ack", "input": "[], [[1, 2], [3], []]", "output": "'ACK\\nmessage-id: []\\ntransaction: [[1, 2], [3], []]\\n\\n\\x00\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oisinmulvihill/stomper/blob/842ed2353a4ddd638d35929ae5b7b70eb298305c/lib/stomper/stomp_10.py#L251-L271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033145", "code": "def send(dest, msg, transactionid=None):\n    \"\"\"STOMP send command.\n\n    dest:\n        This is the channel we wish to subscribe to\n\n    msg:\n        This is the message body to be sent.\n\n    transactionid:\n        This is an optional field and is not needed\n        by default.\n\n    \"\"\"\n    transheader = ''\n\n    if transactionid:\n        transheader = 'transaction: %s\\n' % transactionid\n\n    return \"SEND\\ndestination: %s\\n%s\\n%s\\x00\\n\" % (dest, transheader, msg)", "entry_point": "send", "input": "[[1, 2], [3], []], 'walnut thistle harbour', [5, 3, 1, 4]", "output": "'SEND\\ndestination: [[1, 2], [3], []]\\ntransaction: [5, 3, 1, 4]\\n\\nwalnut thistle harbour\\x00\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oisinmulvihill/stomper/blob/842ed2353a4ddd638d35929ae5b7b70eb298305c/lib/stomper/stomp_10.py#L329-L348", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033146", "code": "def nack(messageid, subscriptionid, transactionid=None):\n    \"\"\"STOMP negative acknowledge command.\n\n    NACK is the opposite of ACK. It is used to tell the server that the client\n    did not consume the message. The server can then either send the message to\n    a different client, discard it, or put it in a dead letter queue. The exact\n    behavior is server specific.\n\n    messageid:\n        This is the id of the message we are acknowledging,\n        what else could it be? ;)\n\n    subscriptionid:\n        This is the id of the subscription that applies to the message.\n\n    transactionid:\n        This is the id that all actions in this transaction\n        will have. If this is not given then a random UUID\n        will be generated for this.\n\n    \"\"\"\n    header = 'subscription:%s\\nmessage-id:%s' % (subscriptionid, messageid)\n\n    if transactionid:\n        header += '\\ntransaction:%s' % transactionid\n\n    return \"NACK\\n%s\\n\\n\\x00\\n\" % header", "entry_point": "nack", "input": "[[1, 2], [3], []], [1, 2, 3], ['a', 'b', 'c']", "output": "\"NACK\\nsubscription:[1, 2, 3]\\nmessage-id:[[1, 2], [3], []]\\ntransaction:['a', 'b', 'c']\\n\\n\\x00\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oisinmulvihill/stomper/blob/842ed2353a4ddd638d35929ae5b7b70eb298305c/lib/stomper/stomp_11.py#L275-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033147", "code": "def match(line, keyword):\n    \"\"\" If the first part of line (modulo blanks) matches keyword,\n    returns the end of that line. Otherwise checks if keyword is\n    anywhere in the line and returns that section, else returns None\"\"\"\n\n    line = line.lstrip()\n    length = len(keyword)\n    if line[:length] == keyword:\n        return line[length:]\n    else:\n        if keyword in line:\n            return line[line.index(keyword):]\n        else:\n            return None", "entry_point": "match", "input": "'Hello World', 'Hello World'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cuzzo/iw_parse/blob/84c287dc6cfceb04ccbc0a8995f8a87323356ee5/iw_parse.py#L212-L225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033148", "code": "def parse_cell(cell, rules):\n    \"\"\" Applies the rules to the bunch of text describing a cell.\n    @param string cell\n        A network / cell from iwlist scan.\n    @param dictionary rules\n        A dictionary of parse rules.\n\n    @return dictionary\n        parsed networks. \"\"\"\n\n    parsed_cell = {}\n    for key in rules:\n        rule = rules[key]\n        parsed_cell.update({key: rule(cell)})\n    return parsed_cell", "entry_point": "parse_cell", "input": "[5, 3, 1, 4], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cuzzo/iw_parse/blob/84c287dc6cfceb04ccbc0a8995f8a87323356ee5/iw_parse.py#L227-L241", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033149", "code": "def graph_format(new_mem, old_mem, is_firstiteration=True):\n    \"\"\"Show changes graphically in memory consumption\"\"\"\n    if is_firstiteration:\n        output = \"  n/a   \"\n    elif new_mem - old_mem > 50000000:\n        output = \"   +++++\"\n    elif new_mem - old_mem > 20000000:\n        output = \"   ++++ \"\n    elif new_mem - old_mem > 5000000:\n        output = \"   +++  \"\n    elif new_mem - old_mem > 1000000:\n        output = \"   ++   \"\n    elif new_mem - old_mem > 50000:\n        output = \"   +    \"\n    elif old_mem - new_mem > 10000000:\n        output = \"---     \"\n    elif old_mem - new_mem > 2000000:\n        output = \" --     \"\n    elif old_mem - new_mem > 100000:\n        output = \"  -     \"\n    else:\n        output = \"        \"\n    return output", "entry_point": "graph_format", "input": "['a', 'b', 'c'], [], -1.5", "output": "'  n/a   '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/memtop/blob/504d251f1951922db84883c2e660ba7e754d1546/memtop/__init__.py#L93-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033150", "code": "def _levenshtein_compute(source, target, rd_flag):\n    \"\"\"Computes the Levenshtein\n    (https://en.wikipedia.org/wiki/Levenshtein_distance)\n    and restricted Damerau-Levenshtein\n    (https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance)\n    distances between two Unicode strings with given lengths using the\n    Wagner-Fischer algorithm\n    (https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm).\n    These distances are defined recursively, since the distance between two\n    strings is just the cost of adjusting the last one or two characters plus\n    the distance between the prefixes that exclude these characters (e.g. the\n    distance between \"tester\" and \"tested\" is 1 + the distance between \"teste\"\n    and \"teste\"). The Wagner-Fischer algorithm retains this idea but eliminates\n    redundant computations by storing the distances between various prefixes in\n    a matrix that is filled in iteratively.\n    \"\"\"\n\n    # Create matrix of correct size (this is s_len + 1 * t_len + 1 so that the\n    # empty prefixes \"\" can also be included). The leftmost column represents\n    # transforming various source prefixes into an empty string, which can\n    # always be done by deleting all characters in the respective prefix, and\n    # the top row represents transforming the empty string into various target\n    # prefixes, which can always be done by inserting every character in the\n    # respective prefix. The ternary used to build the list should ensure that\n    # this row and column are now filled correctly\n    s_range = range(len(source) + 1)\n    t_range = range(len(target) + 1)\n    matrix = [[(i if j == 0 else j) for j in t_range] for i in s_range]\n\n    # Iterate through rest of matrix, filling it in with Levenshtein\n    # distances for the remaining prefix combinations\n    for i in s_range[1:]:\n        for j in t_range[1:]:\n            # Applies the recursive logic outlined above using the values\n            # stored in the matrix so far. The options for the last pair of\n            # characters are deletion, insertion, and substitution, which\n            # amount to dropping the source character, the target character,\n            # or both and then calculating the distance for the resulting\n            # prefix combo. If the characters at this point are the same, the\n            # situation can be thought of as a free substitution\n            del_dist = matrix[i - 1][j] + 1\n            ins_dist = matrix[i][j - 1] + 1\n            sub_trans_cost = 0 if source[i - 1] == target[j - 1] else 1\n            sub_dist = matrix[i - 1][j - 1] + sub_trans_cost\n\n            # Choose option that produces smallest distance\n            matrix[i][j] = min(del_dist, ins_dist, sub_dist)\n\n            # If restricted Damerau-Levenshtein was requested via the flag,\n            # then there may be a fourth option: transposing the current and\n            # previous characters in the source string. This can be thought of\n            # as a double substitution and has a similar free case, where the\n            # current and preceeding character in both strings is the same\n            if rd_flag and i > 1 and j > 1 and source[i - 1] == target[j - 2] \\\n                    and source[i - 2] == target[j - 1]:\n                trans_dist = matrix[i - 2][j - 2] + sub_trans_cost\n                matrix[i][j] = min(matrix[i][j], trans_dist)\n\n    # At this point, the matrix is full, and the biggest prefixes are just the\n    # strings themselves, so this is the desired distance\n    return matrix[len(source)][len(target)]", "entry_point": "_levenshtein_compute", "input": "[5, 3, 1, 4], [1, 2, 3], False", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/obulkin/string-dist/blob/38d04352d617a5d43b06832cc1bf0aee8978559f/stringdist/pystringdist/levenshtein_shared.py#L5-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033151", "code": "def nt2aa(ntseq):\n    \"\"\"Translate a nucleotide sequence into an amino acid sequence.\n\n    Parameters\n    ----------\n    ntseq : str\n        Nucleotide sequence composed of A, C, G, or T (uppercase or lowercase)\n\n    Returns\n    -------\n    aaseq : str\n        Amino acid sequence\n    \n    Example\n    --------\n    >>> nt2aa('TGTGCCTGGAGTGTAGCTCCGGACAGGGGTGGCTACACCTTC')\n    'CAWSVAPDRGGYTF'\n        \n    \"\"\"\n    nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'a': 0, 'c': 1, 'g': 2, 't': 3}\n    aa_dict ='KQE*TPASRRG*ILVLNHDYTPASSRGCILVFKQE*TPASRRGWMLVLNHDYTPASSRGCILVF'\n    \n    return ''.join([aa_dict[nt2num[ntseq[i]] + 4*nt2num[ntseq[i+1]] + 16*nt2num[ntseq[i+2]]] for i in range(0, len(ntseq), 3) if i+2 < len(ntseq)])", "entry_point": "nt2aa", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/utils.py#L31-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033152", "code": "def nt2codon_rep(ntseq):\n    \"\"\"Represent nucleotide sequence by sequence of codon symbols.\n\n    'Translates' the nucleotide sequence into a symbolic representation of\n    'amino acids' where each codon gets its own unique character symbol. These \n    characters should be reserved only for representing the 64 individual \n    codons --- note that this means it is important that this function matches \n    the corresponding function in the preprocess script and that any custom \n    alphabet does not use these symbols. Defining symbols for each individual\n    codon allows for Pgen computation of inframe nucleotide sequences. \n\n    Parameters\n    ----------\n\n    ntseq : str\n        A Nucleotide sequence (normally a CDR3 nucleotide sequence) to be \n        'translated' into the codon - symbol representation. Can be either\n        uppercase or lowercase, but only composed of A, C, G, or T.\n\n    Returns\n    -------\n    codon_rep : str\n        The codon - symbolic representation of ntseq. Note that if \n        len(ntseq) == 3L --> len(codon_rep) == L\n    \n    Example\n    --------\n    >>> nt2codon_rep('TGTGCCTGGAGTGTAGCTCCGGACAGGGGTGGCTACACCTTC')\n    '\\xbb\\x96\\xab\\xb8\\x8e\\xb6\\xa5\\x92\\xa8\\xba\\x9a\\x93\\x94\\x9f'\n        \n    \"\"\"\n    \n    #\n    nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'a': 0, 'c': 1, 'g': 2, 't': 3}\n    #Use single characters not in use to represent each individual codon --- this function is called in constructing the codon dictionary\n    codon_rep ='\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf'\n    \n    return ''.join([codon_rep[nt2num[ntseq[i]] + 4*nt2num[ntseq[i+1]] + 16*nt2num[ntseq[i+2]]] for i in range(0, len(ntseq), 3) if i+2 < len(ntseq)])", "entry_point": "nt2codon_rep", "input": "{'a': 1, 'b': 2}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/utils.py#L55-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033153", "code": "def cutR_seq(seq, cutR, max_palindrome):\n    \"\"\"Cut genomic sequence from the right.\n\n    Parameters\n    ----------\n    seq : str\n        Nucleotide sequence to be cut from the right\n    cutR : int\n        cutR - max_palindrome = how many nucleotides to cut from the right.\n        Negative cutR implies complementary palindromic insertions.\n    max_palindrome : int\n        Length of the maximum palindromic insertion.\n\n    Returns\n    -------\n    seq : str\n        Nucleotide sequence after being cut from the right\n    \n    Examples\n    --------\n    >>> cutR_seq('TGCGCCAGCAGTGAGTC', 0, 4)\n    'TGCGCCAGCAGTGAGTCGACT'\n    >>> cutR_seq('TGCGCCAGCAGTGAGTC', 8, 4)\n    'TGCGCCAGCAGTG'\n    \n    \"\"\"\n    complement_dict = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'} #can include lower case if wanted\n    if cutR < max_palindrome:\n        seq = seq + ''.join([complement_dict[nt] for nt in seq[cutR - max_palindrome:]][::-1]) #reverse complement palindrome insertions\n    else:\n        seq = seq[:len(seq) - cutR + max_palindrome] #deletions\n    \n    return seq", "entry_point": "cutR_seq", "input": "(), 5, True", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/utils.py#L95-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033154", "code": "def generate_sub_codons_left(codons_dict):\n    \"\"\"Generate the sub_codons_left dictionary of codon prefixes.\n\n    Parameters\n    ----------\n    codons_dict : dict\n        Dictionary, keyed by the allowed 'amino acid' symbols with the values \n        being lists of codons corresponding to the symbol.\n\n    Returns\n    -------\n    sub_codons_left : dict\n        Dictionary of the 1 and 2 nucleotide prefixes (read from 5') for \n        each codon in an 'amino acid' grouping\n        \n    \"\"\"\n    sub_codons_left = {}\n    for aa in codons_dict.keys():\n        sub_codons_left[aa] = list(set([x[0] for x in codons_dict[aa]] + [x[:2] for x in codons_dict[aa]]))\n        \n    return sub_codons_left", "entry_point": "generate_sub_codons_left", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/utils.py#L261-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033155", "code": "def generate_sub_codons_right(codons_dict):\n    \"\"\"Generate the sub_codons_right dictionary of codon suffixes.\n\n    Parameters\n    ----------\n    codons_dict : dict\n        Dictionary, keyed by the allowed 'amino acid' symbols with the values \n        being lists of codons corresponding to the symbol.\n\n    Returns\n    -------\n    sub_codons_right : dict\n        Dictionary of the 1 and 2 nucleotide suffixes (read from 5') for \n        each codon in an 'amino acid' grouping.\n        \n    \"\"\"\n    sub_codons_right = {}\n    for aa in codons_dict.keys():\n        sub_codons_right[aa] = list(set([x[-1] for x in codons_dict[aa]] + [x[-2:] for x in codons_dict[aa]]))\n        \n    return sub_codons_right", "entry_point": "generate_sub_codons_right", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/utils.py#L283-L303", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033156", "code": "def determine_seq_type(seq, aa_alphabet):\n    \"\"\"Determine the type of a sequence.\n    \n    Parameters\n    ----------\n\n    seq : str\n        Sequence to be typed.\n    aa_alphabet : str\n        String of all characters recoginized as 'amino acids'. (i.e. the keys\n        of codons_dict: aa_alphabet = ''.join(codons_dict.keys())  )\n\n    Returns\n    -------\n    seq_type : str\n        The type of sequence (ntseq, aaseq, regex, None) seq is.\n    \n    Example\n    --------\n    >>> determine_seq_type('TGTGCCAGCAGTTCCGAAGGGGCGGGAGGGCCCTCCCTGAGAGGTCATGAGCAGTTCTTC', aa_alphabet)\n    'ntseq'\n    >>> determine_seq_type('CSARDX[TV]GNX{0,}', aa_alphabet)\n    'regex\n    \n    \"\"\"\n    \n    if all([x in 'ACGTacgt' for x in seq]):\n        return 'ntseq'\n    elif all([x in aa_alphabet for x in seq]):\n        return 'aaseq'\n    elif all([x in aa_alphabet + '[]{}0123456789,']):\n        return 'regex'", "entry_point": "determine_seq_type", "input": "[], 0.5", "output": "'ntseq'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/utils.py#L305-L336", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033157", "code": "def allZero(buffer):\n    \"\"\"\n    Tries to determine if a buffer is empty.\n    \n    @type buffer: str\n    @param buffer: Buffer to test if it is empty.\n        \n    @rtype: bool\n    @return: C{True} if the given buffer is empty, i.e. full of zeros,\n        C{False} if it doesn't.\n    \"\"\"\n    allZero = True\n    for byte in buffer:\n        if byte != \"\\x00\":\n            allZero = False\n            break\n    return allZero", "entry_point": "allZero", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L65-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033158", "code": "def vector_str(p, decimal_places=2, print_zero=True):\n    '''Pretty-print the vector values.'''\n    style = '{0:.' + str(decimal_places) + 'f}'\n    return '[{0}]'.format(\", \".join([' ' if not print_zero and a == 0 else style.format(a) for a in p]))", "entry_point": "vector_str", "input": "[], ['a', 'b', 'c'], [1, 2, 3]", "output": "'[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L160-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033159", "code": "def get_delta(D, k):\n    '''Calculate the k-th order trend filtering matrix given the oriented edge\n    incidence matrix and the value of k.'''\n    if k < 0:\n        raise Exception('k must be at least 0th order.')\n    result = D\n    for i in range(k):\n        result = D.T.dot(result) if i % 2 == 0 else D.dot(result)\n    return result", "entry_point": "get_delta", "input": "set(), False", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L390-L398", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033160", "code": "def jdFromDate(dd, mm, yy):\n    '''def jdFromDate(dd, mm, yy): Compute the (integral) Julian day number of\n    day dd/mm/yyyy, i.e., the number of days between 1/1/4713 BC\n    (Julian calendar) and dd/mm/yyyy.'''\n    a = int((14 - mm) / 12.)\n    y = yy + 4800 - a\n    m = mm + 12 * a - 3\n    jd = dd + int((153 * m + 2) / 5.) \\\n        + 365 * y + int(y / 4.) - int(y / 100.) \\\n        + int(y / 400.) - 32045\n    if (jd < 2299161):\n        jd = dd + int((153 * m + 2) / 5.) \\\n            + 365 * y + int(y / 4.) - 32083\n    return jd", "entry_point": "jdFromDate", "input": "3.25, -1.5, 3", "output": "1722079.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L10-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033161", "code": "def jdToDate(jd):\n    '''def jdToDate(jd): Convert a Julian day number to day/month/year.\n                       jd is an integer.'''\n    if (jd > 2299160):\n        # After 5/10/1582, Gregorian calendar\n        a = jd + 32044\n        b = int((4 * a + 3) / 146097.)\n        c = a - int((b * 146097) / 4.)\n    else:\n        b = 0\n        c = jd + 32082\n    d = int((4 * c + 3) / 1461.)\n    e = c - int((1461 * d) / 4.)\n    m = int((5 * e + 2) / 153.)\n    day = e - int((153 * m + 2) / 5.) + 1\n    month = m + 3 - 12 * int(m / 10.)\n    year = b * 100 + d - 4800 + int(m / 10.)\n    return [day, month, year]", "entry_point": "jdToDate", "input": "1", "output": "[2, 1, -4712]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L26-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033162", "code": "def bbox2wktpolygon(bbox):\n    \"\"\"\n    Return OGC WKT Polygon of a simple bbox list of strings\n    \"\"\"\n\n    minx = float(bbox[0])\n    miny = float(bbox[1])\n    maxx = float(bbox[2])\n    maxy = float(bbox[3])\n    return 'POLYGON((%.2f %.2f, %.2f %.2f, %.2f %.2f, %.2f %.2f, %.2f %.2f))' \\\n        % (minx, miny, minx, maxy, maxx, maxy, maxx, miny, minx, miny)", "entry_point": "bbox2wktpolygon", "input": "[-1, 0, 1, 2]", "output": "'POLYGON((-1.00 0.00, -1.00 2.00, 1.00 2.00, 1.00 0.00, -1.00 0.00))'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cga-harvard/Hypermap-Registry/blob/899a5385b15af7fba190ab4fae1d41e47d155a1b/hypermap/aggregator/utils.py#L503-L513", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033163", "code": "def to_meshlevel(meshcode):\n    \"\"\"\u30e1\u30c3\u30b7\u30e5\u30b3\u30fc\u30c9\u304b\u3089\u6b21\u6570\u3092\u7b97\u51fa\u3059\u308b\u3002\n\n    Args:\n        meshcode: \u30e1\u30c3\u30b7\u30e5\u30b3\u30fc\u30c9\n    Return:\n        \u5730\u57df\u30e1\u30c3\u30b7\u30e5\u30b3\u30fc\u30c9\u306e\u6b21\u6570\n                1\u6b21(80km\u56db\u65b9):1\n                40\u500d(40km\u56db\u65b9):40000\n                20\u500d(20km\u56db\u65b9):20000\n                16\u500d(16km\u56db\u65b9):16000\n                2\u6b21(10km\u56db\u65b9):2\n                8\u500d(8km\u56db\u65b9):8000\n                5\u500d(5km\u56db\u65b9):5000\n                4\u500d(4km\u56db\u65b9):4000\n                2.5\u500d(2.5km\u56db\u65b9):2500\n                2\u500d(2km\u56db\u65b9):2000\n                3\u6b21(1km\u56db\u65b9):3\n                4\u6b21(500m\u56db\u65b9):4\n                5\u6b21(250m\u56db\u65b9):5\n                6\u6b21(125m\u56db\u65b9):6\n    \"\"\"\n\n    length = len(str(meshcode))\n    if length == 4:\n        return 1\n\n    if length == 5:\n        return 40000\n\n    if length == 6:\n        return 2\n\n    if length == 7:\n        if meshcode[6:7] in ['1','2','3','4']:\n            return 5000\n\n        if meshcode[6:7] == '6':\n            return 8000\n\n        if meshcode[6:7] == '5':\n            return 20000\n\n        if meshcode[6:7] == '7':\n            return 16000\n\n    if length == 8:\n        return 3\n\n    if length == 9:\n        if meshcode[8:9] in ['1','2','3','4']:\n            return 4\n\n        if meshcode[8:9] == '5':\n            return 2000\n\n        if meshcode[8:9] == '6':\n            return 2500\n\n        if meshcode[8:9] == '7':\n            return 4000\n\n    if length == 10:\n        if meshcode[9:10] in ['1','2','3','4']:\n            return 5\n\n    if length == 11:\n        if meshcode[10:11] in ['1','2','3','4']:\n            return 6\n\n    raise ValueError('the meshcode is unsupported.')", "entry_point": "to_meshlevel", "input": "3.25", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hni14/jismesh/blob/bda486ac7828d0adaea2a128154d0a554be7ef37/jismesh/utils.py#L240-L310", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033164", "code": "def social_media(username, platform='twitter', size='medium'):\n        \"\"\"Return avatar URL at social media.\n        Visit https://avatars.io for more information.\n\n        :param username: The username of the social media.\n        :param platform: One of facebook, instagram, twitter, gravatar.\n        :param size: The size of avatar, one of small, medium and large.\n        \"\"\"\n        return 'https://avatars.io/{platform}/{username}/{size}'.format(\n            platform=platform, username=username, size=size)", "entry_point": "social_media", "input": "'AbC dEf', [5, 3, 1, 4], 3", "output": "'https://avatars.io/[5, 3, 1, 4]/AbC dEf/3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/greyli/flask-avatars/blob/13eca90342349c58962fef0ec541edcb1b009c70/flask_avatars/__init__.py#L63-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033165", "code": "def __get_type_args(for_type=None, for_types=None):\n        \"\"\"Parse the arguments and return a tuple of types to implement for.\n\n        Raises:\n            ValueError or TypeError as appropriate.\n        \"\"\"\n        if for_type:\n            if for_types:\n                raise ValueError(\"Cannot pass both for_type and for_types.\")\n            for_types = (for_type,)\n        elif for_types:\n            if not isinstance(for_types, tuple):\n                raise TypeError(\"for_types must be passed as a tuple of \"\n                                \"types (classes).\")\n        else:\n            raise ValueError(\"Must pass either for_type or for_types.\")\n\n        return for_types", "entry_point": "__get_type_args", "input": "[[1, 2], [3], []], []", "output": "([[1, 2], [3], []],)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/dotty/blob/b145131499be0c4b755fc2e2ac19be11a50bce6a/efilter/protocol.py#L147-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033166", "code": "def __get_types(for_type=None, for_types=None):\n        \"\"\"Parse the arguments and return a tuple of types to implement for.\n\n        Raises:\n            ValueError or TypeError as appropriate.\n        \"\"\"\n        if for_type:\n            if for_types:\n                raise ValueError(\"Cannot pass both for_type and for_types.\")\n            for_types = (for_type,)\n        elif for_types:\n            if not isinstance(for_types, tuple):\n                raise TypeError(\"for_types must be passed as a tuple of \"\n                                \"types (classes).\")\n        else:\n            raise ValueError(\"Must pass either for_type or for_types.\")\n\n        return for_types", "entry_point": "__get_types", "input": "[[1, 2], [3], []], []", "output": "([[1, 2], [3], []],)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/dotty/blob/b145131499be0c4b755fc2e2ac19be11a50bce6a/efilter/dispatch.py#L338-L355", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033167", "code": "def to_int_list(values):\n    \"\"\"Converts the given list of vlues into a list of integers. If the\n    integer conversion fails (e.g. non-numeric strings or None-values), this\n    filter will include a 0 instead.\"\"\"\n    results = []\n    for v in values:\n        try:\n            results.append(int(v))\n        except (TypeError, ValueError):\n            results.append(0)\n    return results", "entry_point": "to_int_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bradmontgomery/django-redis-metrics/blob/2c92332920113d28c39234b949aa496b39a091d1/redis_metrics/templatetags/redis_metrics_filters.py#L15-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033168", "code": "def _extract_buffers(commands):\n    \"\"\"Extract all data buffers from the list of GLIR commands, and replace\n    them by buffer pointers {buffer: <buffer_index>}. Return the modified list\n    # of GILR commands and the list of buffers as well.\"\"\"\n    # First, filter all DATA commands.\n    data_commands = [command for command in commands if command[0] == 'DATA']\n    # Extract the arrays.\n    buffers = [data_command[3] for data_command in data_commands]\n    # Modify the commands by replacing the array buffers with pointers.\n    commands_modified = list(commands)\n    buffer_index = 0\n    for i, command in enumerate(commands_modified):\n        if command[0] == 'DATA':\n            commands_modified[i] = command[:3] + \\\n                ({'buffer_index': buffer_index},)\n            buffer_index += 1\n    return commands_modified, buffers", "entry_point": "_extract_buffers", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glue-viz/glue-vispy-viewers/blob/54a4351d98c1f90dfb1a557d1b447c1f57470eea/glue_vispy_viewers/extern/vispy/app/backends/_ipynb_util.py#L19-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033169", "code": "def obj(x):\r\n    \"\"\"Six-hump camelback function\"\"\"\r\n    \r\n    x1 = x[0]\r\n    x2 = x[1]\r\n    \r\n    f = (4 - 2.1*(x1*x1) + (x1*x1*x1*x1)/3.0)*(x1*x1) + x1*x2 + (-4 + 4*(x2*x2))*(x2*x2)\r\n    return f", "entry_point": "obj", "input": "[-1, 0, 1, 2]", "output": "2.2333333333333334", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/andim/scipydirect/blob/ad36ab19e6ad64054a1d2abd22f1c993fc4b87be/doc/tutorialfig.py#L9-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033170", "code": "def _many_to_one(input_dict):\n    \"\"\"Convert a many-to-one mapping to a one-to-one mapping\"\"\"\n    return dict((key, val)\n                for keys, val in input_dict.items()\n                for key in keys)", "entry_point": "_many_to_one", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glue-viz/glue-vispy-viewers/blob/54a4351d98c1f90dfb1a557d1b447c1f57470eea/glue_vispy_viewers/extern/vispy/ext/_bundled/mplutils.py#L30-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033171", "code": "def get_number_unit(number):\n    \"\"\"get the unit of number\"\"\"\n    n = str(float(number))\n    mult, submult = n.split('.')\n    if float(submult) != 0:\n        unit = '0.' + (len(submult)-1)*'0' + '1'\n        return float(unit)\n    else:\n        return float(1)", "entry_point": "get_number_unit", "input": "7", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/federico123579/Trading212-API/blob/0fab20b71a2348e72bbe76071b81f3692128851f/tradingAPI/utils.py#L48-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033172", "code": "def next_power_of_2(n):\n    \"\"\" Return next power of 2 greater than or equal to n \"\"\"\n    n -= 1  # greater than OR EQUAL TO n\n    shift = 1\n    while (n + 1) & n:  # n+1 is not a power of 2 yet\n        n |= n >> shift\n        shift *= 2\n    return max(4, n + 1)", "entry_point": "next_power_of_2", "input": "1", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glue-viz/glue-vispy-viewers/blob/54a4351d98c1f90dfb1a557d1b447c1f57470eea/glue_vispy_viewers/extern/vispy/visuals/collections/base_collection.py#L22-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033173", "code": "def _process_glsl_template(template, colors):\n    \"\"\"Replace $color_i by color #i in the GLSL template.\"\"\"\n    for i in range(len(colors) - 1, -1, -1):\n        color = colors[i]\n        assert len(color) == 4\n        vec4_color = 'vec4(%.3f, %.3f, %.3f, %.3f)' % tuple(color)\n        template = template.replace('$color_%d' % i, vec4_color)\n    return template", "entry_point": "_process_glsl_template", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glue-viz/glue-vispy-viewers/blob/54a4351d98c1f90dfb1a557d1b447c1f57470eea/glue_vispy_viewers/extern/vispy/color/colormap.py#L160-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033174", "code": "def strip_html(text):\n    \"\"\" Get rid of ugly twitter html \"\"\"\n    def reply_to(text):\n        replying_to = []\n        split_text = text.split()\n        for index, token in enumerate(split_text):\n            if token.startswith('@'): replying_to.append(token[1:])\n            else:\n                message = split_text[index:]\n                break\n        rply_msg = \"\"\n        if len(replying_to) > 0:\n            rply_msg = \"Replying to \"\n            for token in replying_to[:-1]: rply_msg += token+\",\"                \n            if len(replying_to)>1: rply_msg += 'and '\n            rply_msg += replying_to[-1]+\". \"\n        return rply_msg + \" \".join(message)\n        \n    text = reply_to(text)      \n    text = text.replace('@', ' ')\n    return \" \".join([token for token in text.split() \n                     if  ('http:' not in token) and ('https:' not in token)])", "entry_point": "strip_html", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/anjishnu/ask-alexa-pykit/blob/a47c278ca7a60532bbe1a9b789f6c37e609fea8b/examples/twitter/twitter.py#L169-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033175", "code": "def read_out_tweets(processed_tweets, speech_convertor=None):\n    \"\"\"\n    Input - list of processed 'Tweets'\n    output - list of spoken responses\n    \"\"\"\n    return [\"tweet number {num} by {user}. {text}.\".format(num=index+1, user=user, text=text)\n               for index, (user, text) in enumerate(processed_tweets)]", "entry_point": "read_out_tweets", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/anjishnu/ask-alexa-pykit/blob/a47c278ca7a60532bbe1a9b789f6c37e609fea8b/examples/twitter/twitter.py#L374-L380", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033176", "code": "def login_user_block(username, ssh_keys, create_password=True):\n    \"\"\"\n    Helper function for creating Server.login_user blocks.\n\n    (see: https://www.upcloud.com/api/8-servers/#create-server)\n    \"\"\"\n    block = {\n        'create_password': 'yes' if create_password is True else 'no',\n        'ssh_keys': {\n            'ssh_key': ssh_keys\n        }\n    }\n\n    if username:\n        block['username'] = username\n\n    return block", "entry_point": "login_user_block", "input": "'walnut thistle harbour', [], 'AbC dEf'", "output": "{'create_password': 'no', 'ssh_keys': {'ssh_key': []}, 'username': 'walnut thistle harbour'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/UpCloudLtd/upcloud-python-api/blob/954b0ad7c4b932b2be31a95d88975f6b0eeac8ed/upcloud_api/server.py#L10-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033177", "code": "def find_overlapping_slots(all_slots):\n    \"\"\"Find any slots that overlap\"\"\"\n    overlaps = set([])\n    for slot in all_slots:\n        # Because slots are ordered, we can be more efficient than this\n        # N^2 loop, but this is simple and, since the number of slots\n        # should be low, this should be \"fast enough\"\n        start = slot.get_start_time()\n        end = slot.end_time\n        for other_slot in all_slots:\n            if other_slot.pk == slot.pk:\n                continue\n            if other_slot.get_day() != slot.get_day():\n                # different days, can't overlap\n                continue\n            # Overlap if the start_time or end_time is bounded by our times\n            # start_time <= other.start_time < end_time\n            # or\n            # start_time < other.end_time <= end_time\n            other_start = other_slot.get_start_time()\n            other_end = other_slot.end_time\n            if start <= other_start and other_start < end:\n                overlaps.add(slot)\n                overlaps.add(other_slot)\n            elif start < other_end and other_end <= end:\n                overlaps.add(slot)\n                overlaps.add(other_slot)\n    return overlaps", "entry_point": "find_overlapping_slots", "input": "set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/schedule/admin.py#L24-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033178", "code": "def find_non_contiguous(all_items):\n    \"\"\"Find any items that have slots that aren't contiguous\"\"\"\n    non_contiguous = []\n    for item in all_items:\n        if item.slots.count() < 2:\n            # No point in checking\n            continue\n        last_slot = None\n        for slot in item.slots.all().order_by('end_time'):\n            if last_slot:\n                if last_slot.end_time != slot.get_start_time():\n                    non_contiguous.append(item)\n                    break\n            last_slot = slot\n    return non_contiguous", "entry_point": "find_non_contiguous", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/schedule/admin.py#L55-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033179", "code": "def find_duplicate_schedule_items(all_items):\n    \"\"\"Find talks / pages assigned to mulitple schedule items\"\"\"\n    duplicates = []\n    seen_talks = {}\n    for item in all_items:\n        if item.talk and item.talk in seen_talks:\n            duplicates.append(item)\n            if seen_talks[item.talk] not in duplicates:\n                duplicates.append(seen_talks[item.talk])\n        else:\n            seen_talks[item.talk] = item\n        # We currently allow duplicate pages for cases were we need disjoint\n        # schedule items, like multiple open space sessions on different\n        # days and similar cases. This may be revisited later\n    return duplicates", "entry_point": "find_duplicate_schedule_items", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/schedule/admin.py#L89-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033180", "code": "def remove_getdisplay(field_name):\n    '''\n    for string 'get_FIELD_NAME_display' return 'FIELD_NAME'\n    '''\n    str_ini = 'get_'\n    str_end = '_display'\n    if str_ini == field_name[0:len(str_ini)] and str_end == field_name[(-1) * len(str_end):]:\n        field_name = field_name[len(str_ini):(-1) * len(str_end)]\n    return field_name", "entry_point": "remove_getdisplay", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L545-L553", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033181", "code": "def date_to_solr(d):\n    \"\"\" converts DD-MM-YYYY to YYYY-MM-DDT00:00:00Z\"\"\"\n    return \"{y}-{m}-{day}T00:00:00Z\".format(day=d[:2], m=d[3:5], y=d[6:]) if d else d", "entry_point": "date_to_solr", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zetaops/zengine/blob/b5bc32d3b37bca799f8985be916f04528ac79e4a/zengine/lib/utils.py#L19-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033182", "code": "def solr_to_date(d):\n    \"\"\" converts YYYY-MM-DDT00:00:00Z to DD-MM-YYYY \"\"\"\n    return \"{day}:{m}:{y}\".format(y=d[:4], m=d[5:7], day=d[8:10]) if d else d", "entry_point": "solr_to_date", "input": "[[1, 2], [3], []]", "output": "'[]:[]:[[1, 2], [3], []]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zetaops/zengine/blob/b5bc32d3b37bca799f8985be916f04528ac79e4a/zengine/lib/utils.py#L24-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033183", "code": "def return_selected_form_items(form_info):\n        \"\"\"\n        It returns chosen keys list from a given form.\n\n        Args:\n            form_info: serialized list of dict form data\n        Returns:\n            selected_keys(list): Chosen keys list\n            selected_names(list): Chosen channels' or subscribers' names.\n        \"\"\"\n        selected_keys = []\n        selected_names = []\n        for chosen in form_info:\n            if chosen['choice']:\n                selected_keys.append(chosen['key'])\n                selected_names.append(chosen['name'])\n\n        return selected_keys, selected_names", "entry_point": "return_selected_form_items", "input": "()", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zetaops/zengine/blob/b5bc32d3b37bca799f8985be916f04528ac79e4a/zengine/views/channel_management.py#L270-L287", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033184", "code": "def bytes_to_string(raw):\n    \"\"\"Convert bytes to string.\"\"\"\n    ret = bytes()\n    for byte in raw:\n        if byte == 0x00:\n            return ret.decode(\"utf-8\")\n        ret += bytes([byte])\n    return ret.decode(\"utf-8\")", "entry_point": "bytes_to_string", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Julius2342/pyvlx/blob/ee78e1324bcb1be5b8d1a9d05ab5496b72eae848/pyvlx/string_helper.py#L13-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033185", "code": "def calc_crc(raw):\n    \"\"\"Calculate cyclic redundancy check (CRC).\"\"\"\n    crc = 0\n    for sym in raw:\n        crc = crc ^ int(sym)\n    return crc", "entry_point": "calc_crc", "input": "[5, 3, 1, 4]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Julius2342/pyvlx/blob/ee78e1324bcb1be5b8d1a9d05ab5496b72eae848/pyvlx/frames/frame_helper.py#L6-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033186", "code": "def create_body(action, params):\n        \"\"\"Create http body for rest request.\"\"\"\n        body = {}\n        body['action'] = action\n        if params is not None:\n            body['params'] = params\n        return body", "entry_point": "create_body", "input": "[], []", "output": "{'action': [], 'params': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Julius2342/pyvlx/blob/ee78e1324bcb1be5b8d1a9d05ab5496b72eae848/old_api/pyvlx/interface.py#L89-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033187", "code": "def hms(segundos):  # TODO: mover para util.py\n    \"\"\"\n    Retorna o n\u00famero de horas, minutos e segundos a partir do total de\n    segundos informado.\n\n    .. sourcecode:: python\n\n        >>> hms(1)\n        (0, 0, 1)\n\n        >>> hms(60)\n        (0, 1, 0)\n\n        >>> hms(3600)\n        (1, 0, 0)\n\n        >>> hms(3601)\n        (1, 0, 1)\n\n        >>> hms(3661)\n        (1, 1, 1)\n\n    :param int segundos: O n\u00famero total de segundos.\n\n    :returns: Uma tupla contendo tr\u1ebds elementos representando, respectivamente,\n        o n\u00famero de horas, minutos e segundos calculados a partir do total de\n        segundos.\n\n    :rtype: tuple\n    \"\"\"\n    h = (segundos / 3600)\n    m = (segundos - (3600 * h)) / 60\n    s = (segundos - (3600 * h) - (m * 60));\n    return (h, m, s)", "entry_point": "hms", "input": "2.0", "output": "(0.0005555555555555556, 0.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/util.py#L166-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033188", "code": "def buildFITSName(geisname):\n    \"\"\"Build a new FITS filename for a GEIS input image.\"\"\"\n\n    # User wants to make a FITS copy and update it...\n    _indx = geisname.rfind('.')\n    _fitsname = geisname[:_indx] + '_' + geisname[_indx + 1:-1] + 'h.fits'\n\n    return _fitsname", "entry_point": "buildFITSName", "input": "'Hello World'", "output": "'Hello Worl_Hello Worlh.fits'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/fileutil.py#L667-L674", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033189", "code": "def parseFilename(filename):\n    \"\"\"\n    Parse out filename from any specified extensions.\n\n    Returns rootname and string version of extension name.\n    \"\"\"\n\n    # Parse out any extension specified in filename\n    _indx = filename.find('[')\n    if _indx > 0:\n        # Read extension name provided\n        _fname = filename[:_indx]\n        _extn = filename[_indx + 1:-1]\n    else:\n        _fname = filename\n        _extn = None\n\n    return _fname, _extn", "entry_point": "parseFilename", "input": "''", "output": "('', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/fileutil.py#L826-L843", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033190", "code": "def parseExtn(extn=None):\n    \"\"\"\n    Parse a string representing a qualified fits extension name as in the\n    output of `parseFilename` and return a tuple ``(str(extname),\n    int(extver))``, which can be passed to `astropy.io.fits` functions using\n    the 'ext' kw.\n\n    Default return is the first extension in a fits file.\n\n    Examples\n    --------\n\n    ::\n\n        >>> parseExtn('sci, 2')\n        ('sci', 2)\n        >>> parseExtn('2')\n        ('', 2)\n        >>> parseExtn('sci')\n        ('sci', 1)\n\n    \"\"\"\n\n    if not extn:\n        return ('', 0)\n\n    try:\n        lext = extn.split(',')\n    except:\n        return ('', 1)\n\n    if len(lext) == 1 and lext[0].isdigit():\n        return (\"\", int(lext[0]))\n    elif len(lext) == 2:\n        return (lext[0], int(lext[1]))\n    else:\n        return (lext[0], 1)", "entry_point": "parseExtn", "input": "['a', 'b', 'c']", "output": "('', 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/fileutil.py#L846-L882", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033191", "code": "def findKeywordExtn(ft, keyword, value=None):\n    \"\"\"\n    This function will return the index of the extension in a multi-extension\n    FITS file which contains the desired keyword with the given value.\n    \"\"\"\n\n    i = 0\n    extnum = -1\n    # Search through all the extensions in the FITS object\n    for chip in ft:\n        hdr = chip.header\n        # Check to make sure the extension has the given keyword\n        if keyword in hdr:\n            if value is not None:\n                # If it does, then does the value match the desired value\n                # MUST use 'str.strip' to match against any input string!\n                if hdr[keyword].strip() == value:\n                    extnum = i\n                    break\n            else:\n                extnum = i\n                break\n        i += 1\n    # Return the index of the extension which contained the\n    # desired EXTNAME value.\n    return extnum", "entry_point": "findKeywordExtn", "input": "[], '', [5, 3, 1, 4]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/fileutil.py#L1141-L1166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033192", "code": "def untranslateName(s):\n    \"\"\"Undo Python conversion of CL parameter or variable name.\"\"\"\n\n    s = s.replace('DOT', '.')\n    s = s.replace('DOLLAR', '$')\n    # delete 'PY' at start of name components\n    if s[:2] == 'PY': s = s[2:]\n    s = s.replace('.PY', '.')\n    return s", "entry_point": "untranslateName", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/fileutil.py#L1291-L1299", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033193", "code": "def addKwdArgsToSig(sigStr, kwArgsDict):\n    \"\"\" Alter the passed function signature string to add the given kewords \"\"\"\n    retval = sigStr\n    if len(kwArgsDict) > 0:\n        retval = retval.strip(' ,)') # open up the r.h.s. for more args\n        for k in kwArgsDict:\n            if retval[-1] != '(': retval += \", \"\n            retval += str(k)+\"=\"+str(kwArgsDict[k])\n        retval += ')'\n    retval = retval\n    return retval", "entry_point": "addKwdArgsToSig", "input": "[-1, 0, 1, 2], {}", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/vtor_checks.py#L57-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033194", "code": "def isHiddenName(astr):\n    \"\"\" Return True if this string name denotes a hidden par or section \"\"\"\n    if astr is not None and len(astr) > 2 and astr.startswith('_') and \\\n       astr.endswith('_'):\n        return True\n    else:\n        return False", "entry_point": "isHiddenName", "input": "set()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/cfgpars.py#L1284-L1290", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033195", "code": "def cfgGetBool(theObj, name, dflt):\n    \"\"\" Get a stringified val from a ConfigObj obj and return it as bool \"\"\"\n    strval = theObj.get(name, None)\n    if strval is None:\n        return dflt\n    return strval.lower().strip() == 'true'", "entry_point": "cfgGetBool", "input": "{'a': 1, 'b': 2}, 'abc', False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/teal.py#L454-L459", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033196", "code": "def parseFilename(filename):\n    \"\"\"\n        Parse out filename from any specified extensions.\n        Returns rootname and string version of extension name.\n\n        Modified from 'pydrizzle.fileutil' to allow this\n        module to be independent of PyDrizzle/MultiDrizzle.\n\n    \"\"\"\n    # Parse out any extension specified in filename\n    _indx = filename.find('[')\n    if _indx > 0:\n        # Read extension name provided\n        _fname = filename[:_indx]\n        extn = filename[_indx+1:-1]\n\n        # An extension was provided, so parse it out...\n        if repr(extn).find(',') > 1:\n            _extns = extn.split(',')\n            # Two values given for extension:\n            #    for example, 'sci,1' or 'dq,1'\n            _extn = [_extns[0],int(_extns[1])]\n        elif repr(extn).find('/') > 1:\n            # We are working with GEIS group syntax\n            _indx = str(extn[:extn.find('/')])\n            _extn = [int(_indx)]\n        elif isinstance(extn, str):\n            # Only one extension value specified...\n            if extn.isdigit():\n                # We only have an extension number specified as a string...\n                _nextn = int(extn)\n            else:\n                # We only have EXTNAME specified...\n                _nextn = extn\n            _extn = [_nextn]\n        else:\n            # Only integer extension number given, or default of 0 is used.\n            _extn = [int(extn)]\n\n    else:\n        _fname = filename\n        _extn = None\n    return _fname,_extn", "entry_point": "parseFilename", "input": "''", "output": "('', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/iterfile.py#L111-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033197", "code": "def interpret_bits_value(val):\n    \"\"\"\n    Converts input bits value from string to a single integer value or None.\n    If a comma- or '+'-separated set of values are provided, they are summed.\n\n    .. note::\n        In order to flip the bits of the final result (after summation),\n        for input of `str` type, prepend '~' to the input string. '~' must\n        be prepended to the *entire string* and not to each bit flag!\n\n    Parameters\n    ----------\n    val : int, str, None\n        An integer bit mask or flag, `None`, or a comma- or '+'-separated\n        string list of integer bit values. If `val` is a `str` and if\n        it is prepended with '~', then the output bit mask will have its\n        bits flipped (compared to simple sum of input val).\n\n    Returns\n    -------\n    bitmask : int or None\n        Returns and integer bit mask formed from the input bit value\n        or `None` if input `val` parameter is `None` or an empty string.\n        If input string value was prepended with '~', then returned\n        value will have its bits flipped (inverse mask).\n\n    \"\"\"\n    if isinstance(val, int) or val is None:\n        return val\n\n    else:\n        val = str(val).strip()\n\n        if val.startswith('~'):\n            flip_bits = True\n            val = val[1:].lstrip()\n        else:\n            flip_bits = False\n\n        if val.startswith('('):\n            if val.endswith(')'):\n                val = val[1:-1].strip()\n            else:\n                raise ValueError('Unbalanced parantheses or incorrect syntax.')\n\n        if ',' in val:\n            valspl = val.split(',')\n            bitmask = 0\n            for v in valspl:\n                bitmask += int(v)\n\n        elif '+' in val:\n            valspl = val.split('+')\n            bitmask = 0\n            for v in valspl:\n                bitmask += int(v)\n\n        elif val.upper() in ['', 'NONE', 'INDEF']:\n            return None\n\n        else:\n            bitmask = int(val)\n\n        if flip_bits:\n            bitmask = ~bitmask\n\n    return bitmask", "entry_point": "interpret_bits_value", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/bitmask.py#L443-L509", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033198", "code": "def amod(a, b):\n    '''Modulus function which returns numerator if modulus is zero'''\n    modded = int(a % b)\n    return b if modded is 0 else modded", "entry_point": "amod", "input": "2, -3", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fitnr/convertdate/blob/e920f168a87f99183b0aa7290d6c3af222582d43/convertdate/utils.py#L24-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033199", "code": "def removeEscapes(value, quoted=0):\n\n    \"\"\"Remove escapes from in front of quotes (which IRAF seems to\n    just stick in for fun sometimes.)  Remove \\-newline too.\n    If quoted is true, removes all blanks following \\-newline\n    (which is a nasty thing IRAF does for continuations inside\n    quoted strings.)\n    XXX Should we remove \\\\ too?\n    \"\"\"\n\n    i = value.find(r'\\\"')\n    while i>=0:\n        value = value[:i] + value[i+1:]\n        i = value.find(r'\\\"',i+1)\n    i = value.find(r\"\\'\")\n    while i>=0:\n        value = value[:i] + value[i+1:]\n        i = value.find(r\"\\'\",i+1)\n    # delete backslash-newlines\n    i = value.find(\"\\\\\\n\")\n    while i>=0:\n        j = i+2\n        if quoted:\n            # ignore blanks and tabs following \\-newline in quoted strings\n            for c in value[i+2:]:\n                if c not in ' \\t':\n                    break\n                j = j+1\n        value = value[:i] + value[j:]\n        i = value.find(\"\\\\\\n\",i+1)\n    return value", "entry_point": "removeEscapes", "input": "'walnut thistle harbour', True", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/stsci.tools/blob/9a022503ad24ca54ce83331482dfa3ff6de9f403/lib/stsci/tools/irafutils.py#L293-L323", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033200", "code": "def HTMLcolor(canvas, color):\n\t\"returns Tk color in form '#rrggbb' or '#rgb'\"\n\tif color:\n\t\t# r, g, b \\in [0..2**16]\n\n\t\tr, g, b = [\"%02x\" % (c // 256) for c in canvas.winfo_rgb(color)]\n\n\t\tif (r[0] == r[1]) and (g[0] == g[1]) and (b[0] == b[1]):\n\t\t\t# shorter form #rgb\n\t\t\treturn \"#\" + r[0] + g[0] + b[0]\n\t\telse:\n\t\t\treturn \"#\" + r + g + b\n\telse:\n\t\treturn color", "entry_point": "HTMLcolor", "input": "['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/WojciechMula/canvas2svg/blob/c05d73d88499e5c565386a1765f79d9417a14dac/canvasvg.py#L599-L612", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033201", "code": "def parse_dash(string, width):\n\t\"parse dash pattern specified with string\"\n\t\n\t# DashConvert from {tk-sources}/generic/tkCanvUtil.c\n\tw = max(1, int(width + 0.5))\n\n\tn = len(string)\n\tresult = []\n\tfor i, c in enumerate(string):\n\t\tif c == \" \" and len(result):\n\t\t\tresult[-1] += w + 1\n\t\telif c == \"_\":\n\t\t\tresult.append(8*w)\n\t\t\tresult.append(4*w)\n\t\telif c == \"-\":\n\t\t\tresult.append(6*w)\n\t\t\tresult.append(4*w)\n\t\telif c == \",\":\n\t\t\tresult.append(4*w)\n\t\t\tresult.append(4*w)\n\t\telif c == \".\":\n\t\t\tresult.append(2*w)\n\t\t\tresult.append(4*w)\n\treturn result", "entry_point": "parse_dash", "input": "'  padded  ', 2", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/WojciechMula/canvas2svg/blob/c05d73d88499e5c565386a1765f79d9417a14dac/canvasvg.py#L668-L691", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033202", "code": "def DefaultExtension(schema_obj, form_obj, schemata=None):\n    \"\"\"Create a default field\"\"\"\n\n    if schemata is None:\n        schemata = ['systemconfig', 'profile', 'client']\n\n    DefaultExtends = {\n        'schema': {\n            \"properties/modules\": [\n                schema_obj\n            ]\n        },\n        'form': {\n            'modules': {\n                'items/': form_obj\n            }\n        }\n    }\n\n    output = {}\n\n    for schema in schemata:\n        output[schema] = DefaultExtends\n\n    return output", "entry_point": "DefaultExtension", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Hackerfleet/hfos/blob/b6df14eacaffb6be5c844108873ff8763ec7f0c9/hfos/schemata/extends.py#L25-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033203", "code": "def fieldset(title, items, options=None):\n    \"\"\"A field set with a title and sub items\"\"\"\n    result = {\n        'title': title,\n        'type': 'fieldset',\n        'items': items\n    }\n    if options is not None:\n        result.update(options)\n\n    return result", "entry_point": "fieldset", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry'], {'a': 1, 'b': 2}", "output": "{'title': [5, 3, 1, 4], 'type': 'fieldset', 'items': ['apple', 'banana', 'cherry'], 'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Hackerfleet/hfos/blob/b6df14eacaffb6be5c844108873ff8763ec7f0c9/hfos/schemata/defaultform.py#L117-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033204", "code": "def emptyArray(key, add_label=None):\n    \"\"\"An array that starts empty\"\"\"\n\n    result = {\n        'key': key,\n        'startEmpty': True\n    }\n    if add_label is not None:\n        result['add'] = add_label\n        result['style'] = {'add': 'btn-success'}\n    return result", "entry_point": "emptyArray", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "{'key': [5, 3, 1, 4], 'startEmpty': True, 'add': [5, 3, 1, 4], 'style': {'add': 'btn-success'}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Hackerfleet/hfos/blob/b6df14eacaffb6be5c844108873ff8763ec7f0c9/hfos/schemata/defaultform.py#L165-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033205", "code": "def tabset(titles, contents):\n    \"\"\"A tabbed container widget\"\"\"\n\n    tabs = []\n    for no, title in enumerate(titles):\n        tab = {\n            'title': title,\n        }\n        content = contents[no]\n        if isinstance(content, list):\n            tab['items'] = content\n        else:\n            tab['items'] = [content]\n        tabs.append(tab)\n\n    result = {\n        'type': 'tabs',\n        'tabs': tabs\n    }\n\n    return result", "entry_point": "tabset", "input": "[], ['a', 'b', 'c']", "output": "{'type': 'tabs', 'tabs': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Hackerfleet/hfos/blob/b6df14eacaffb6be5c844108873ff8763ec7f0c9/hfos/schemata/defaultform.py#L178-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033206", "code": "def tomindec(origin):\n    \"\"\"\n    Convert [+/-]DDD.DDDDD to a tuple (degrees, minutes)\n    \"\"\"\n\n    origin = float(origin)\n    degrees = int(origin)\n    minutes = (origin % 1) * 60\n\n    return degrees, minutes", "entry_point": "tomindec", "input": "0", "output": "(0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yychen/twd97/blob/2fe05dbca335be425a1f451e0ef8f210ec864de1/twd97/converter.py#L69-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033207", "code": "def _scalePoints(points, scale=1, convertToInteger=True):\n    \"\"\"\n    Scale points and optionally convert them to integers.\n    \"\"\"\n    if convertToInteger:\n        points = [\n            (int(round(x * scale)), int(round(y * scale)))\n            for (x, y) in points\n        ]\n    else:\n        points = [(x * scale, y * scale) for (x, y) in points]\n    return points", "entry_point": "_scalePoints", "input": "set(), {1, 2, 3}, ('a', 'b', 'c')", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/typemytype/booleanOperations/blob/b7d9fc95c155824662f4a0020e653c77b7723d24/Lib/booleanOperations/flatten.py#L1007-L1018", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033208", "code": "def permission_to_04_acls(permissions):\n    \"\"\"\n    Legacy acl format kept for bw. compatibility\n    :param permissions:\n    :return:\n    \"\"\"\n    acls = []\n    for perm in permissions:\n        if perm.type == \"user\":\n            acls.append((perm.user.id, perm.perm_name))\n        elif perm.type == \"group\":\n            acls.append((\"group:%s\" % perm.group.id, perm.perm_name))\n    return acls", "entry_point": "permission_to_04_acls", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ergo/ziggurat_foundations/blob/9eeec894d08e8d7defa60ddc04b63f69cd4cbeba/ziggurat_foundations/permissions.py#L189-L201", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033209", "code": "def egcd(b, n):\n    '''\n    Given two integers (b, n), returns (gcd(b, n), a, m) such that\n    a*b + n*m = gcd(b, n).\n    \n    Adapted from several sources:\n      https://brilliant.org/wiki/extended-euclidean-algorithm/\n      https://rosettacode.org/wiki/Modular_inverse\n      https://en.wikibooks.org/wiki/Algorithm_Implementation/Mathematics/Extended_Euclidean_algorithm\n      https://en.wikipedia.org/wiki/Euclidean_algorithm\n      \n    >>> egcd(1, 1)\n    (1, 0, 1)\n    >>> egcd(12, 8)\n    (4, 1, -1)\n    >>> egcd(23894798501898, 23948178468116)\n    (2, 2437250447493, -2431817869532)\n    >>> egcd(pow(2, 50), pow(3, 50))\n    (1, -260414429242905345185687, 408415383037561)\n\n    '''\n    (x0, x1, y0, y1) = (1, 0, 0, 1)\n    while n != 0:\n        (q, b, n) = (b // n, n, b % n)\n        (x0, x1) = (x1, x0 - q * x1)\n        (y0, y1) = (y1, y0 - q * y1)\n    return (b, x0, y0)", "entry_point": "egcd", "input": "3.25, 10", "output": "(0.25, -3.0, 1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lapets/egcd/blob/44fbab4a8eb04ad198526b4f14ddce6dff2bae77/egcd/egcd.py#L16-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033210", "code": "def ellipsis(source, max_length):\n    \"\"\"Truncates a string to be at most max_length long.\"\"\"\n    if max_length == 0 or len(source) <= max_length:\n        return source\n    return source[: max(0, max_length - 3)] + \"...\"", "entry_point": "ellipsis", "input": "[1, 2, 3], 7", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quora/qcore/blob/fa5cd438eea554db35fd29cbc8dfbde69f09961c/qcore/helpers.py#L232-L236", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033211", "code": "def add_missing_optional_args_with_value_none(args, optional_args):\n    '''\n    Adds key-value pairs to the passed dictionary, so that\n        afterwards, the dictionary can be used without needing\n        to check for KeyErrors.\n\n    If the keys passed as a second argument are not present,\n        they are added with None as a value.\n\n    :args: The dictionary to be completed.\n    :optional_args: The keys that need to be added, if\n        they are not present.\n    :return: The modified dictionary.\n    '''\n\n    for name in optional_args:\n        if not name in args.keys():\n            args[name] = None\n    return args", "entry_point": "add_missing_optional_args_with_value_none", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EUDAT-B2SAFE/B2HANDLE/blob/a6d216d459644e01fbdfd5b318a535950bc5cdbb/b2handle/util/argsutils.py#L3-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033212", "code": "def check_presence_of_mandatory_args(args, mandatory_args):\n    '''\n    Checks whether all mandatory arguments are passed.\n\n    This function aims at methods with many arguments\n        which are passed as kwargs so that the order\n        in which the are passed does not matter.\n\n    :args: The dictionary passed as args.\n    :mandatory_args: A list of keys that have to be\n        present in the dictionary.\n    :raise: :exc:`~ValueError`\n    :returns: True, if all mandatory args are passed. If not,\n        an exception is raised.\n\n    '''\n    missing_args = []\n    for name in mandatory_args:\n        if name not in args.keys():\n            missing_args.append(name)\n    if len(missing_args) > 0:\n        raise ValueError('Missing mandatory arguments: '+', '.join(missing_args))\n    else:\n        return True", "entry_point": "check_presence_of_mandatory_args", "input": "(1, 2), {}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EUDAT-B2SAFE/B2HANDLE/blob/a6d216d459644e01fbdfd5b318a535950bc5cdbb/b2handle/util/argsutils.py#L24-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033213", "code": "def _format_level_1(rows, root_table_name):\n    \"\"\"\n    Transform sqlalchemy source:\n    [{'a_id' : 'id1',\n      'a_name' : 'name1,\n      'b_id' : 'id2',\n      'b_name' : 'name2},\n     {'a_id' : 'id3',\n      'a_name' : 'name3,\n      'b_id' : 'id4',\n      'b_name' : 'name4}\n    ]\n    to\n    [{'id' : 'id1',\n      'name': 'name2',\n      'b' : {'id': 'id2', 'name': 'name2'},\n     {'id' : 'id3',\n      'name': 'name3',\n      'b' : {'id': 'id4', 'name': 'name4'}\n    ]\n    \"\"\"\n    result_rows = []\n    for row in rows:\n        row = dict(row)\n        result_row = {}\n        prefixes_to_remove = []\n        for field in row:\n            if field.startswith('next_topic'):\n                prefix = 'next_topic'\n                suffix = field[11:]\n                if suffix == 'id_1':\n                    suffix = 'id'\n            else:\n                prefix, suffix = field.split('_', 1)\n            if suffix == 'id' and row[field] is None:\n                prefixes_to_remove.append(prefix)\n            if prefix not in result_row:\n                result_row[prefix] = {suffix: row[field]}\n            else:\n                result_row[prefix].update({suffix: row[field]})\n        # remove field with id == null\n        for prefix_to_remove in prefixes_to_remove:\n            result_row.pop(prefix_to_remove)\n        root_table_fields = result_row.pop(root_table_name)\n        result_row.update(root_table_fields)\n        result_rows.append(result_row)\n    return result_rows", "entry_point": "_format_level_1", "input": "[], {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/redhat-cip/dci-control-server/blob/b416cf935ec93e4fdd5741f61a21cabecf8454d2/dci/api/v1/utils.py#L417-L463", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033214", "code": "def pop_kwargs(kwargs,\n               names_with_defaults,  # type: List[Tuple[str, Any]]\n               allow_others=False\n               ):\n    \"\"\"\n    Internal utility method to extract optional arguments from kwargs.\n\n    :param kwargs:\n    :param names_with_defaults:\n    :param allow_others: if False (default) then an error will be raised if kwargs still contains something at the end.\n    :return:\n    \"\"\"\n    all_arguments = []\n    for name, default_ in names_with_defaults:\n        try:\n            val = kwargs.pop(name)\n        except KeyError:\n            val = default_\n        all_arguments.append(val)\n\n    if not allow_others and len(kwargs) > 0:\n        raise ValueError(\"Unsupported arguments: %s\" % kwargs)\n\n    if len(names_with_defaults) == 1:\n        return all_arguments[0]\n    else:\n        return all_arguments", "entry_point": "pop_kwargs", "input": "{'x': [1, 2], 'y': []}, '', [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/smarie/python-valid8/blob/5e15d1de11602933c5114eb9f73277ad91d97800/valid8/composition.py#L539-L565", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033215", "code": "def convert_seeded_answers(answers):\n    \"\"\"\n    Convert seeded answers into the format that can be merged into student answers.\n\n    Args:\n        answers (list): seeded answers\n\n    Returns:\n        dict: seeded answers with student answers format:\n            {\n                0: {\n                    'seeded0': 'rationaleA'\n                }\n                1: {\n                    'seeded1': 'rationaleB'\n                }\n            }\n    \"\"\"\n    converted = {}\n    for index, answer in enumerate(answers):\n        converted.setdefault(answer['answer'], {})\n        converted[answer['answer']]['seeded' + str(index)] = answer['rationale']\n\n    return converted", "entry_point": "convert_seeded_answers", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ubc/ubcpi/blob/7b6de03f93f3a4a8af4b92dfde7c69eeaf21f46e/ubcpi/answer_pool.py#L326-L349", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033216", "code": "def _diffSchema(diskSchema, memorySchema):\n    \"\"\"\n    Format a schema mismatch for human consumption.\n\n    @param diskSchema: The on-disk schema.\n\n    @param memorySchema: The in-memory schema.\n\n    @rtype: L{bytes}\n    @return: A description of the schema differences.\n    \"\"\"\n    diskSchema = set(diskSchema)\n    memorySchema = set(memorySchema)\n    diskOnly = diskSchema - memorySchema\n    memoryOnly = memorySchema - diskSchema\n    diff = []\n    if diskOnly:\n        diff.append('Only on disk:')\n        diff.extend(map(repr, diskOnly))\n    if memoryOnly:\n        diff.append('Only in memory:')\n        diff.extend(map(repr, memoryOnly))\n    return '\\n'.join(diff)", "entry_point": "_diffSchema", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "\"Only on disk:\\n'c'\\n'a'\\n'b'\\nOnly in memory:\\n1\\n2\\n3\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/twisted/axiom/blob/7de70bc8fe1bb81f9c2339fba8daec9eb2e92b68/axiom/store.py#L1010-L1032", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033217", "code": "def get_all_resources(datasets):\n        # type: (List['Dataset']) -> List[hdx.data.resource.Resource]\n        \"\"\"Get all resources from a list of datasets (such as returned by search)\n\n        Args:\n            datasets (List[Dataset]): list of datasets\n\n        Returns:\n            List[hdx.data.resource.Resource]: list of resources within those datasets\n        \"\"\"\n        resources = []\n        for dataset in datasets:\n            for resource in dataset.get_resources():\n                resources.append(resource)\n        return resources", "entry_point": "get_all_resources", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCHA-DAP/hdx-python-api/blob/212440f54f73805826a16db77dbcb6033b18a313/src/hdx/data/dataset.py#L753-L767", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033218", "code": "def find_duplicates(l: list) -> set:\n    \"\"\"\n    Return the duplicates in a list.\n\n    The function relies on\n    https://stackoverflow.com/questions/9835762/find-and-list-duplicates-in-a-list .\n    Parameters\n    ----------\n    l : list\n        Name\n\n    Returns\n    -------\n    set\n        Duplicated values\n\n    >>> find_duplicates([1,2,3])\n    set()\n    >>> find_duplicates([1,2,1])\n    {1}\n    \"\"\"\n    return set([x for x in l if l.count(x) > 1])", "entry_point": "find_duplicates", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hz-inova/run_jnb/blob/55e63de33b0643161948864d2c1ec998f02815bf/run_jnb/util.py#L164-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033219", "code": "def group_dict_by_value(d: dict) -> dict:\n    \"\"\"\n    Group a dictionary by values.\n\n\n    Parameters\n    ----------\n    d : dict\n        Input dictionary\n\n    Returns\n    -------\n    dict\n        Output dictionary. The keys are the values of the initial dictionary\n        and the values ae given by a list of keys corresponding to the value.\n\n    >>> group_dict_by_value({2: 3, 1: 2, 3: 1})\n    {3: [2], 2: [1], 1: [3]}\n    >>> group_dict_by_value({2: 3, 1: 2, 3: 1, 10:1, 12: 3})\n    {3: [2, 12], 2: [1], 1: [3, 10]}\n    \"\"\"\n    d_out = {}\n    for k, v in d.items():\n        if v in d_out:\n            d_out[v].append(k)\n        else:\n            d_out[v] = [k]\n    return d_out", "entry_point": "group_dict_by_value", "input": "{'a': 1, 'b': 2}", "output": "{1: ['a'], 2: ['b']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hz-inova/run_jnb/blob/55e63de33b0643161948864d2c1ec998f02815bf/run_jnb/util.py#L239-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033220", "code": "def chain_tasks(tasks):\n    \"\"\"\n    Chain given tasks. Set each task to run after its previous task.\n\n    :param tasks: Tasks list.\n\n    :return: Given tasks list.\n    \"\"\"\n    # If given tasks list is not empty\n    if tasks:\n        # Previous task\n        previous_task = None\n\n        # For given tasks list's each task\n        for task in tasks:\n            # If the task is not None.\n            # Task can be None to allow code like ``task if _PY2 else None``.\n            if task is not None:\n                # If previous task is not None\n                if previous_task is not None:\n                    # Set the task to run after the previous task\n                    task.set_run_after(previous_task)\n\n                # Set the task as previous task for the next task\n                previous_task = task\n\n    # Return given tasks list.\n    return tasks", "entry_point": "chain_tasks", "input": "set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AoiKuiyuyou/AoikLiveReload/blob/0d5adb12118a33749e6690a8165fdb769cff7d5c/tools/waf/aoikwafutil.py#L1030-L1057", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033221", "code": "def _make_cmd_list(cmd_list):\n    \"\"\"\n    Helper function to easily create the proper json formated string from a list of strs\n    :param cmd_list: list of strings\n    :return: str json formatted\n    \"\"\"\n    cmd = ''\n    for i in cmd_list:\n        cmd = cmd + '\"' + i + '\",'\n    cmd = cmd[:-1]\n    return cmd", "entry_point": "_make_cmd_list", "input": "['a', 'b', 'c']", "output": "'\"a\",\"b\",\"c\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/device.py#L884-L894", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033222", "code": "def get_readable_time_string(seconds):\n    \"\"\"Returns human readable string from number of seconds\"\"\"\n    seconds = int(seconds)\n    minutes = seconds // 60\n    seconds = seconds % 60\n    hours = minutes // 60\n    minutes = minutes % 60\n    days = hours // 24\n    hours = hours % 24\n\n    result = \"\"\n    if days > 0:\n        result += \"%d %s \" % (days, \"Day\" if (days == 1) else \"Days\")\n    if hours > 0:\n        result += \"%d %s \" % (hours, \"Hour\" if (hours == 1) else \"Hours\")\n    if minutes > 0:\n        result += \"%d %s \" % (minutes, \"Minute\" if (minutes == 1) else \"Minutes\")\n    if seconds > 0:\n        result += \"%d %s \" % (seconds, \"Second\" if (seconds == 1) else \"Seconds\")\n\n    return result.strip()", "entry_point": "get_readable_time_string", "input": "True", "output": "'1 Second'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/utilities.py#L6-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033223", "code": "def flatten_top_level_keys(data, top_level_keys):\n    \"\"\" Helper method to flatten a nested dict of dicts (one level)\n\n        Example:\n            {'a': {'b': 'bbb'}} becomes {'a_-_b': 'bbb'}\n\n            The separator '_-_' gets formatted later for the column headers\n\n        Args:\n            data: the dict to flatten\n            top_level_keys: a list of the top level keys to flatten ('a' in the example above)\n    \"\"\"\n    flattened_data = {}\n\n    for top_level_key in top_level_keys:\n        if data[top_level_key] is None:\n            flattened_data[top_level_key] = None\n        else:\n            for key in data[top_level_key]:\n                flattened_data['{}_-_{}'.format(top_level_key, key)] = data[top_level_key][key]\n\n    return flattened_data", "entry_point": "flatten_top_level_keys", "input": "['a', 'b', 'c'], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/excel/analytics_data_excel.py#L311-L332", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033224", "code": "def get_serial_numbers(assetList):\n    \"\"\"\n    Helper function: Uses return of get_dev_asset_details function to evaluate to evaluate for multipe serial objects.\n    :param assetList: output of get_dev_asset_details function\n    :return: the serial_list object of list type which contains one or more dictionaries of the asset details\n    \"\"\"\n    serial_list = []\n    if type(assetList) == list:\n        for i in assetList:\n            if len(i['serialNum']) > 0:\n                serial_list.append(i)\n    return serial_list", "entry_point": "get_serial_numbers", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L178-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033225", "code": "def get_callback_pattern(expected_params, actual_params):\n        \"\"\"\n        Assembles a dictionary whith the parameters schema defined for this route\n        :param expected_params dict parameters schema defined for this route\n        :param actual_params dict actual url parameters\n        :rtype: dict\n        \"\"\"\n        pattern = dict()\n        key = 0\n        for exp_param in expected_params:\n            if exp_param[0] == '{' and exp_param[-1:] == '}':\n                pattern[exp_param[1:-1]] = actual_params[key]\n            key = key + 1\n        return pattern", "entry_point": "get_callback_pattern", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/feliphebueno/Rinzler/blob/7f6d5445b5662cba2e8938bb82c7f3ef94e5ded8/rinzler/__init__.py#L243-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033226", "code": "def get_url_params(end_point: str) -> list:\n        \"\"\"\n        Gets route parameters as dictionary\n        :param end_point str target route\n        :rtype: list\n        \"\"\"\n        var_params = end_point.split('/')\n\n        if len(var_params) == 1 and var_params[0] == '':\n            return []\n\n        elif len(var_params) == 1 and var_params[0] != '':\n            return [var_params[0]]\n        else:\n            params = list()\n            for param in var_params:\n                if len(param) > 0:\n                    params.append(param)\n            return params", "entry_point": "get_url_params", "input": "'abc'", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/feliphebueno/Rinzler/blob/7f6d5445b5662cba2e8938bb82c7f3ef94e5ded8/rinzler/__init__.py#L259-L277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033227", "code": "def map_with_obj(f, dct):\n    \"\"\"\n        Implementation of Ramda's mapObjIndexed without the final argument.\n        This returns the original key with the mapped value. Use map_key_values to modify the keys too\n    :param f: Called with a key and value\n    :param dct:\n    :return {dict}: Keyed by the original key, valued by the mapped value\n    \"\"\"\n    f_dict = {}\n    for k, v in dct.items():\n        f_dict[k] = f(k, v)\n    return f_dict", "entry_point": "map_with_obj", "input": "{}, {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/calocan/rescape-python-helpers/blob/91a1724f062ee40a25aa60fc96b2d7acadd99618/rescape_python_helpers/functional/ramda.py#L462-L473", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033228", "code": "def to_camel_case(snake_case_string):\n    \"\"\"\n    Convert a string from snake case to camel case. For example, \"some_var\" would become \"someVar\".\n\n    :param snake_case_string: Snake-cased string to convert to camel case.\n    :returns: Camel-cased version of snake_case_string.\n    \"\"\"\n    parts = snake_case_string.lstrip('_').split('_')\n    return parts[0] + ''.join([i.title() for i in parts[1:]])", "entry_point": "to_camel_case", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CitrineInformatics/pypif/blob/938348a8ff7b10b330770cccaaeb2109922f681b/pypif/util/case.py#L8-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033229", "code": "def to_capitalized_camel_case(snake_case_string):\n    \"\"\"\n    Convert a string from snake case to camel case with the first letter capitalized. For example, \"some_var\"\n    would become \"SomeVar\".\n\n    :param snake_case_string: Snake-cased string to convert to camel case.\n    :returns: Camel-cased version of snake_case_string.\n    \"\"\"\n    parts = snake_case_string.split('_')\n    return ''.join([i.title() for i in parts])", "entry_point": "to_capitalized_camel_case", "input": "'a,b,c'", "output": "'A,B,C'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CitrineInformatics/pypif/blob/938348a8ff7b10b330770cccaaeb2109922f681b/pypif/util/case.py#L19-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033230", "code": "def _str(val):\n    \"\"\"\n    Ensures that the val is the default str() type for python2 or 3\n    \"\"\"\n    if str == bytes:\n        if isinstance(val, str):\n            return val\n        else:\n            return str(val)\n    else:\n        if isinstance(val, str):\n            return val\n        else:\n            return str(val, 'ascii')", "entry_point": "_str", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/valhallasw/flask-mwoauth/blob/216aa9c1ead07d99a9e11deb7642e33a70aa59d7/flask_mwoauth/__init__.py#L174-L187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033231", "code": "def get_response(_code):\n    \"\"\"\n    Return xx1x response for xx0x codes (e.g. 0810 for 0800)\n    \"\"\"\n    if _code:\n        code = str(_code)\n        return code[:-2] + str(int(code[-2:-1]) + 1) + code[-1]\n    else:\n        return None", "entry_point": "get_response", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timgabets/bpc8583/blob/1b8e95d73ad273ad9d11bff40d1af3f06f0f3503/bpc8583/tools.py#L68-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033232", "code": "def _guess_name(desc, taken=None):\n    \"\"\"Attempts to guess the menu entry name from the function name.\"\"\"\n    taken = taken or []\n    name = \"\"\n    # Try to find the shortest name based on the given description.\n    for word in desc.split():\n        c = word[0].lower()\n        if not c.isalnum():\n            continue\n        name += c\n        if name not in taken:\n            break\n    # If name is still taken, add a number postfix.\n    count = 2\n    while name in taken:\n        name = name + str(count)\n        count += 1\n    return name", "entry_point": "_guess_name", "input": "'a,b,c', (1, 2)", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeffrimko/Qprompt/blob/1887c53656dfecac49e0650e0f912328801cbb83/lib/qprompt.py#L674-L691", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033233", "code": "def check_order(current, hit, overlap = 200):\n    \"\"\"\n    determine if hits are sequential on model and on the\n    same strand\n        * if not, they should be split into different groups\n    \"\"\"\n    prev_model = current[-1][2:4]\n    prev_strand = current[-1][-2]\n    hit_model = hit[2:4]\n    hit_strand = hit[-2]\n    # make sure they are on the same strand\n    if prev_strand != hit_strand:\n        return False\n    # check for sequential hits on + strand\n    if prev_strand == '+' and (prev_model[1] - hit_model[0] >= overlap):\n        return False\n    # check for sequential hits on - strand\n    if prev_strand == '-' and (hit_model[1] - prev_model[0] >= overlap):\n        return False\n    else:\n        return True", "entry_point": "check_order", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/16SfromHMM.py#L63-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033234", "code": "def escape_filename_sh_ansic(name):\n    \"\"\"Return an ansi-c shell-escaped version of a filename.\"\"\"\n\n    out =[]\n    # gather the escaped characters into a list\n    for ch in name:\n        if ord(ch) < 32:\n            out.append(\"\\\\x%02x\"% ord(ch))\n        elif ch == '\\\\':\n            out.append('\\\\\\\\')\n        else:\n            out.append(ch)\n\n    # slap them back together in an ansi-c quote  $'...'\n    return \"$'\" + \"\".join(out) + \"'\"", "entry_point": "escape_filename_sh_ansic", "input": "'Hello World'", "output": "\"$'Hello World'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CCareaga/scum/blob/15c21ab32f590271d2d12c3573573d35630f51b0/scum/modules/browse.py#L293-L307", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033235", "code": "def valid_vlan_id(vlan_id, extended=True):\n    \"\"\"Validates a VLAN ID.\n\n    Args:\n        vlan_id (integer): VLAN ID to validate.  If passed as ``str``, it will\n            be cast to ``int``.\n        extended (bool): If the VLAN ID range should be considered extended\n            for Virtual Fabrics.\n\n    Returns:\n        bool: ``True`` if it is a valid VLAN ID.  ``False`` if not.\n\n    Raises:\n        None\n\n    Examples:\n        >>> import pynos.utilities\n        >>> vlan = '565'\n        >>> pynos.utilities.valid_vlan_id(vlan)\n        True\n        >>> extended = False\n        >>> vlan = '6789'\n        >>> pynos.utilities.valid_vlan_id(vlan, extended=extended)\n        False\n        >>> pynos.utilities.valid_vlan_id(vlan)\n        True\n    \"\"\"\n    minimum_vlan_id = 1\n    maximum_vlan_id = 4095\n    if extended:\n        maximum_vlan_id = 8191\n    return minimum_vlan_id <= int(vlan_id) <= maximum_vlan_id", "entry_point": "valid_vlan_id", "input": "False, 7", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/utilities.py#L88-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033236", "code": "def remove_text_inside_brackets(s, brackets=\"()[]\"):\n    \"\"\"\n    From http://stackoverflow.com/a/14603508/610569\n    \"\"\"\n    count = [0] * (len(brackets) // 2) # count open/close brackets\n    saved_chars = []\n    for character in s:\n        for i, b in enumerate(brackets):\n            if character == b: # found bracket\n                kind, is_close = divmod(i, 2)\n                count[kind] += (-1)**is_close # `+1`: open, `-1`: close\n                if count[kind] < 0: # unbalanced bracket\n                    count[kind] = 0\n                break\n        else: # character is not a bracket\n            if not any(count): # outside brackets\n                saved_chars.append(character)\n    return ''.join(saved_chars)", "entry_point": "remove_text_inside_brackets", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alvations/lazyme/blob/961a8282198588ff72e15643f725ce895e51d06d/lazyme/string.py#L70-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033237", "code": "def robust_int(v):\n    \"\"\"Parse an int robustly, ignoring commas and other cruft. \"\"\"\n\n    if isinstance(v, int):\n        return v\n\n    if isinstance(v, float):\n        return int(v)\n\n    v = str(v).replace(',', '')\n\n    if not v:\n        return None\n\n    return int(v)", "entry_point": "robust_int", "input": "3.25", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/valuetype/core.py#L508-L522", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033238", "code": "def elfhash(s):\n    \"\"\"\n    :param string: bytes\n\n    >>> import base64\n    >>> s = base64.b64encode(b'hello world')\n    >>> elfhash(s)\n    224648685\n    \"\"\"\n    hash = 0\n    x = 0\n    for c in s:\n        hash = (hash << 4) + c\n        x = hash & 0xF0000000\n        if x:\n            hash ^= (x >> 24)\n            hash &= ~x\n    return (hash & 0x7FFFFFFF)", "entry_point": "elfhash", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cosven/feeluown-core/blob/62dc64638f62971b16be0a75c0b8c7ae2999869e/fuocore/utils.py#L23-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033239", "code": "def stop_if_mostly_diverging(errdata):\n    \"\"\"This is an example stop condition that asks Relay to quit if\n    the error difference between consecutive samples is increasing more than\n    half of the time.\n\n    It's quite sensitive and designed for the demo, so you probably shouldn't\n    use this is a production setting\n    \"\"\"\n    n_increases = sum([\n        abs(y) - abs(x) > 0 for x, y in zip(errdata, errdata[1:])])\n    if len(errdata) * 0.5 < n_increases:\n        # most of the time, the next sample is worse than the previous sample\n        # relay is not healthy\n        return 0\n    else:\n        # most of the time, the next sample is better than the previous sample\n        # realy is in a healthy state\n        return -1", "entry_point": "stop_if_mostly_diverging", "input": "[-1, 0, 1, 2]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sailthru/relay/blob/995209346c6663675d96d0cbff3bb67b9758c8e2/relay/plugins/__init__.py#L155-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033240", "code": "def clean_int(v):\n    \"\"\"Remove commas from a float\"\"\"\n\n    if v is None or not str(v).strip():\n        return None\n\n    return int(str(v).replace(',', ''))", "entry_point": "clean_int", "input": "2", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/valuetype/types.py#L66-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033241", "code": "def timezone(utcoffset):\n    '''\n    Return a string representing the timezone offset.\n    Remaining seconds are rounded to the nearest minute.\n\n    >>> timezone(3600)\n    '+01:00'\n    >>> timezone(5400)\n    '+01:30'\n    >>> timezone(-28800)\n    '-08:00'\n\n    '''\n\n    hours, seconds = divmod(abs(utcoffset), 3600)\n    minutes = round(float(seconds) / 60)\n\n    if utcoffset >= 0:\n        sign = '+'\n    else:\n        sign = '-'\n    return '{0}{1:02d}:{2:02d}'.format(sign, int(hours), int(minutes))", "entry_point": "timezone", "input": "True", "output": "'+00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kurtraschke/pyRFC3339/blob/e30cc1555adce0ecc7bd65509a2249d47e5a41b4/pyrfc3339/utils.py#L122-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033242", "code": "def NCBISequenceLinkURL(title, default=None):\n    \"\"\"\n    Given a sequence title, like \"gi|42768646|gb|AY516849.1| Homo sapiens\",\n    return the URL of a link to the info page at NCBI.\n\n    title: the sequence title to produce a link URL for.\n    default: the value to return if the title cannot be parsed.\n    \"\"\"\n    try:\n        ref = title.split('|')[3].split('.')[0]\n    except IndexError:\n        return default\n    else:\n        return 'http://www.ncbi.nlm.nih.gov/nuccore/%s' % (ref,)", "entry_point": "NCBISequenceLinkURL", "input": "'  padded  ', set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acorg/dark-matter/blob/c78a1bf262667fa5db3548fa7066c4ec14d0551d/dark/html.py#L8-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033243", "code": "def getReadLengths(reads, gapChars):\n    \"\"\"\n    Get all read lengths, excluding gap characters.\n\n    @param reads: A C{Reads} instance.\n    @param gapChars: A C{str} of sequence characters considered to be gaps.\n    @return: A C{dict} keyed by read id, with C{int} length values.\n    \"\"\"\n    gapChars = set(gapChars)\n    result = {}\n    for read in reads:\n        result[read.id] = len(read) - sum(\n            character in gapChars for character in read.sequence)\n    return result", "entry_point": "getReadLengths", "input": "{}, {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acorg/dark-matter/blob/c78a1bf262667fa5db3548fa7066c4ec14d0551d/bin/fasta-identity-table.py#L95-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033244", "code": "def truncatechars(value, arg):\n    \"\"\"\n    Truncates a string after a certain number of chars.\n\n    Argument: Number of chars to truncate after.\n    \"\"\"\n    try:\n        length = int(arg)\n    except ValueError: # Invalid literal for int().\n        return value # Fail silently.\n    if len(value) > length:\n        return value[:length] + '...'\n    return value", "entry_point": "truncatechars", "input": "set(), False", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/disqus/overseer/blob/b37573aba33b20aa86f89eb0c7e6f4d9905bedef/overseer/templatetags/overseer_helpers.py#L32-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033245", "code": "def elide_sequence(s, flank=5, elision=\"...\"):\n    \"\"\"trim a sequence to include the left and right flanking sequences of\n    size `flank`, with the intervening sequence elided by `elision`.\n\n    >>> elide_sequence(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    'ABCDE...VWXYZ'\n\n    >>> elide_sequence(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", flank=3)\n    'ABC...XYZ'\n\n    >>> elide_sequence(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", elision=\"..\")\n    'ABCDE..VWXYZ'\n\n    >>> elide_sequence(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", flank=12)\n    'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n\n    >>> elide_sequence(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", flank=12, elision=\".\")\n    'ABCDEFGHIJKL.OPQRSTUVWXYZ'\n\n    \"\"\"\n\n    elided_sequence_len = flank + flank + len(elision)\n    if len(s) <= elided_sequence_len:\n        return s\n    return s[:flank] + elision + s[-flank:]", "entry_point": "elide_sequence", "input": "'a,b,c', False, 'walnut thistle harbour'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocommons/bioutils/blob/88bcbdfa707268fed1110800e91b6d4f8e9475a0/src/bioutils/sequences.py#L188-L212", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033246", "code": "def _transform_chrom(chrom):\n    \"\"\"Helper function to obtain specific sort order.\"\"\"\n    try:\n        c = int(chrom)\n    except:\n        if chrom in ['X', 'Y']:\n            return chrom\n        elif chrom == 'MT':\n            return '_MT'  # sort to the end\n        else:\n            return '__' + chrom # sort to the very end\n    else:\n        # make sure numbered chromosomes are sorted numerically\n        return '%02d' % c", "entry_point": "_transform_chrom", "input": "True", "output": "'01'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flo-compbio/genometools/blob/dd962bb26d60a0f14ca14d8c9a4dd75768962c7d/genometools/ensembl/dna.py#L35-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033247", "code": "def chr22XY(c):\n    \"\"\"force to name from 1..22, 23, 24, X, Y, M \n    to in chr1..chr22, chrX, chrY, chrM\n    str or ints accepted\n\n    >>> chr22XY('1')\n    'chr1'\n    >>> chr22XY(1)\n    'chr1'\n    >>> chr22XY('chr1')\n    'chr1'\n    >>> chr22XY(23)\n    'chrX'\n    >>> chr22XY(24)\n    'chrY'\n    >>> chr22XY(\"X\")\n    'chrX'\n    >>> chr22XY(\"23\")\n    'chrX'\n    >>> chr22XY(\"M\")\n    'chrM'\n\n    \"\"\"\n    c = str(c)\n    if c[0:3] == 'chr':\n        c = c[3:]\n    if c == '23':\n        c = 'X'\n    if c == '24':\n        c = 'Y'\n    return 'chr' + c", "entry_point": "chr22XY", "input": "['a', 'b', 'c']", "output": "\"chr['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocommons/bioutils/blob/88bcbdfa707268fed1110800e91b6d4f8e9475a0/src/bioutils/accessions.py#L81-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033248", "code": "def concat_expr(operator, conditions):\n    \"\"\"\n    Concatenate `conditions` with `operator` and wrap it by ().\n\n    It returns a string in a list or empty list, if `conditions` is empty.\n\n    \"\"\"\n    expr = \" {0} \".format(operator).join(conditions)\n    return [\"({0})\".format(expr)] if expr else []", "entry_point": "concat_expr", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "['(a [[1, 2], [3], []] b [[1, 2], [3], []] c)']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/utils/sqlconstructor.py#L21-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033249", "code": "def _get_chemical_equation_piece(species_list, coefficients):\n    \"\"\"\n    Produce a string from chemical species and their coefficients.\n\n    Parameters\n    ----------\n    species_list : iterable of `str`\n        Iterable of chemical species.\n    coefficients : iterable of `float`\n        Nonzero stoichiometric coefficients. The length of `species_list` and\n        `coefficients` must be the same. Negative values are made positive and\n        zeros are ignored along with their respective species.\n\n    Examples\n    --------\n    >>> from pyrrole.core import _get_chemical_equation_piece\n    >>> _get_chemical_equation_piece([\"AcOH\"], [2])\n    '2 AcOH'\n    >>> _get_chemical_equation_piece([\"AcO-\", \"H+\"], [-1, -1])\n    'AcO- + H+'\n    >>> _get_chemical_equation_piece(\"ABCD\", [-2, -1, 0, -1])\n    '2 A + B + D'\n\n    \"\"\"\n    def _get_token(species, coefficient):\n        if coefficient == 1:\n            return '{}'.format(species)\n        else:\n            return '{:g} {}'.format(coefficient, species)\n\n    bag = []\n    for species, coefficient in zip(species_list, coefficients):\n        if coefficient < 0:\n            coefficient = -coefficient\n        if coefficient > 0:\n            bag.append(_get_token(species, coefficient))\n    return '{}'.format(' + '.join(bag))", "entry_point": "_get_chemical_equation_piece", "input": "[-1, 0, 1, 2], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/schneiderfelipe/pyrrole/blob/13e26accc9a059f0ab69773648b24292fe1fbfd6/pyrrole/core.py#L75-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033250", "code": "def digit(decimal, digit, input_base=10):\r\n    \"\"\"\r\n    Find the value of an integer at a specific digit when represented in a\r\n    particular base.\r\n\r\n    Args:\r\n        decimal(int): A number represented in base 10 (positive integer).\r\n        digit(int): The digit to find where zero is the first, lowest, digit.\r\n        base(int): The base to use (default 10).\r\n\r\n    Returns:\r\n        The value at specified digit in the input decimal.\r\n        This output value is represented as a base 10 integer.\r\n\r\n    Examples:\r\n        >>> digit(201, 0)\r\n        1\r\n        >>> digit(201, 1)\r\n        0\r\n        >>> digit(201, 2)\r\n        2\r\n        >>> tuple(digit(253, i, 2) for i in range(8))\r\n        (1, 0, 1, 1, 1, 1, 1, 1)\r\n\r\n        # Find the lowest digit of a large hexidecimal number\r\n        >>> digit(123456789123456789, 0, 16)\r\n        5\r\n    \"\"\"\r\n    if decimal == 0:\r\n        return 0\r\n    if digit != 0:\r\n        return (decimal // (input_base ** digit)) % input_base\r\n    else:\r\n        return decimal % input_base", "entry_point": "digit", "input": "False, 'abc', {}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/squdle/baseconvert/blob/26c9a2c07c2ffcde7d078fb812419ca6d388900b/baseconvert/baseconvert.py#L216-L249", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033251", "code": "def digits(number, base=10):\r\n    \"\"\"\r\n    Determines the number of digits of a number in a specific base.\r\n\r\n    Args:\r\n        number(int): An integer number represented in base 10.\r\n        base(int): The base to find the number of digits.\r\n\r\n    Returns:\r\n        Number of digits when represented in a particular base (integer).\r\n\r\n    Examples:\r\n        >>> digits(255)\r\n        3\r\n        >>> digits(255, 16)\r\n        2\r\n        >>> digits(256, 16)\r\n        3\r\n        >>> digits(256, 2)\r\n        9\r\n        >>> digits(0, 678363)\r\n        0\r\n        >>> digits(-1, 678363)\r\n        0\r\n        >>> digits(12345, 10)\r\n        5\r\n    \"\"\"\r\n    if number < 1:\r\n        return 0\r\n    digits = 0\r\n    n = 1\r\n    while(number >= 1):\r\n        number //= base\r\n        digits += 1\r\n    return digits", "entry_point": "digits", "input": "-3, ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/squdle/baseconvert/blob/26c9a2c07c2ffcde7d078fb812419ca6d388900b/baseconvert/baseconvert.py#L252-L286", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033252", "code": "def truncate(n):\r\n    \"\"\"\r\n    Removes trailing zeros.\r\n\r\n    Args:\r\n        n:  The number to truncate.\r\n            This number should be in the following form:\r\n            (..., '.', int, int, int, ..., 0)\r\n    Returns:\r\n        n with all trailing zeros removed\r\n\r\n    >>> truncate((9, 9, 9, '.', 9, 9, 9, 9, 0, 0, 0, 0))\r\n    (9, 9, 9, '.', 9, 9, 9, 9)\r\n    >>> truncate(('.',))\r\n    ('.',)\r\n    \"\"\"\r\n    count = 0\r\n    for digit in n[-1::-1]:\r\n        if digit != 0:\r\n            break\r\n        count += 1\r\n    return n[:-count] if count > 0 else n", "entry_point": "truncate", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/squdle/baseconvert/blob/26c9a2c07c2ffcde7d078fb812419ca6d388900b/baseconvert/baseconvert.py#L428-L449", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033253", "code": "def int_to_str_digit(n):\r\n    \"\"\"\r\n    Converts a positive integer, to a single string character.\r\n    Where: 9 -> \"9\", 10 -> \"A\", 11 -> \"B\", 12 -> \"C\", ...etc\r\n\r\n    Args:\r\n        n(int): A positve integer number.\r\n\r\n    Returns:\r\n        The character representation of the input digit of value n (str).\r\n    \"\"\"\r\n    # 0 - 9\r\n    if n < 10:\r\n        return str(n)\r\n    # A - Z\r\n    elif n < 36:\r\n        return chr(n + 55)\r\n    # a - z or higher\r\n    else:\r\n        return chr(n + 61)", "entry_point": "int_to_str_digit", "input": "True", "output": "'True'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/squdle/baseconvert/blob/26c9a2c07c2ffcde7d078fb812419ca6d388900b/baseconvert/baseconvert.py#L477-L496", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033254", "code": "def expand_recurring(number, repeat=5):\r\n    \"\"\"\r\n    Expands a recurring pattern within a number.\r\n\r\n    Args:\r\n        number(tuple): the number to process in the form:\r\n            (int, int, int, ... \".\", ... , int int int)\r\n        repeat: the number of times to expand the pattern.\r\n\r\n    Returns:\r\n        The original number with recurring pattern expanded.\r\n\r\n    Example:\r\n        >>> expand_recurring((1, \".\", 0, \"[\", 9, \"]\"), repeat=3)\r\n        (1, '.', 0, 9, 9, 9, 9)\r\n    \"\"\"\r\n    if \"[\" in number:\r\n        pattern_index = number.index(\"[\")\r\n        pattern = number[pattern_index + 1:-1]\r\n        number = number[:pattern_index]\r\n        number = number + pattern * (repeat + 1)\r\n    return number", "entry_point": "expand_recurring", "input": "{'a': 1, 'b': 2}, {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/squdle/baseconvert/blob/26c9a2c07c2ffcde7d078fb812419ca6d388900b/baseconvert/baseconvert.py#L571-L592", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033255", "code": "def check_valid(number, input_base=10):\r\n    \"\"\"\r\n    Checks if there is an invalid digit in the input number.\r\n\r\n    Args:\r\n        number: An number in the following form:\r\n            (int, int, int, ... , '.' , int, int, int)\r\n            (iterable container) containing positive integers of the input base\r\n        input_base(int): The base of the input number.\r\n\r\n    Returns:\r\n        bool, True if all digits valid, else False.\r\n\r\n    Examples:\r\n        >>> check_valid((1,9,6,'.',5,1,6), 12)\r\n        True\r\n        >>> check_valid((8,1,15,9), 15)\r\n        False\r\n    \"\"\"\r\n    for n in number:\r\n        if n in (\".\", \"[\", \"]\"):\r\n            continue\r\n        elif n >= input_base:\r\n            if n == 1 and input_base == 1:\r\n                continue\r\n            else:\r\n                return False\r\n    return True", "entry_point": "check_valid", "input": "{1, 2, 3}, 1", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/squdle/baseconvert/blob/26c9a2c07c2ffcde7d078fb812419ca6d388900b/baseconvert/baseconvert.py#L595-L622", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033256", "code": "def _find_best_chat_server(servers, stats):\n        \"\"\"Find the best from servers by comparing with the stats\n\n        :param servers: a list if server adresses, e.g. ['0.0.0.0:80']\n        :type servers: :class:`list` of :class:`str`\n        :param stats: list of server statuses\n        :type stats: :class:`list` of :class:`chat.ChatServerStatus`\n        :returns: the best server adress\n        :rtype: :class:`str`\n        :raises: None\n        \"\"\"\n        best = servers[0]  # In case we sind no match with any status\n        stats.sort()  # gets sorted for performance\n        for stat in stats:\n            for server in servers:\n                if server == stat:\n                    # found a chatserver that has the same address\n                    # than one of the chatserverstats.\n                    # since the stats are sorted for performance\n                    # the first hit is the best, thus break\n                    best = server\n                    break\n            if best:\n                # already found one, so no need to check the other\n                # statuses, which are worse\n                break\n        return best", "entry_point": "_find_best_chat_server", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/session.py#L589-L615", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033257", "code": "def search_greater(values, target):\n    \"\"\"\n    Return the first index for which target is greater or equal to the first\n    item of the tuple found in values\n    \"\"\"\n    first = 0\n    last = len(values)\n\n    while first < last:\n        middle = (first + last) // 2\n        if values[middle][0] < target:\n            first = middle + 1\n        else:\n            last = middle\n\n    return first", "entry_point": "search_greater", "input": "[], [1, 2, 3]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/histogram.py#L33-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033258", "code": "def _sanitize_numbers(uncleaned_numbers):\n    \"\"\"\n        Convert strings to integers if possible\n    \"\"\"\n    cleaned_numbers = []\n    for x in uncleaned_numbers:\n        try:\n            cleaned_numbers.append(int(x))\n        except ValueError:\n            cleaned_numbers.append(x)\n    return cleaned_numbers", "entry_point": "_sanitize_numbers", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/darxtrix/lehar/blob/8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343/lehar/main.py#L38-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033259", "code": "def get_html_clear_filename(filename):\n    \"\"\"Clears the file extension from the filename and makes it nice looking\"\"\"\n    newFilename = filename.replace(\".html\", \"\")\n    newFilename = newFilename.replace(\".md\", \"\")\n    newFilename = newFilename.replace(\".txt\", \"\")\n    newFilename = newFilename.replace(\".tile\", \"\")\n    newFilename = newFilename.replace(\".jade\", \"\")\n    newFilename = newFilename.replace(\".rst\", \"\")\n    newFilename = newFilename.replace(\".docx\", \"\")\n    newFilename = newFilename.replace(\"index\", \"home\")\n    newFilename = newFilename.replace(\"-\", \" \")\n    newFilename = newFilename.replace(\"_\", \" \")\n    newFilename = newFilename.title()\n\n    return newFilename", "entry_point": "get_html_clear_filename", "input": "'  padded  '", "output": "'  Padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/functions.py#L55-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033260", "code": "def sql_program_name_func(command):\n    \"\"\"\n    Extract program name from `command`.\n\n    >>> sql_program_name_func('ls')\n    'ls'\n    >>> sql_program_name_func('git status')\n    'git'\n    >>> sql_program_name_func('EMACS=emacs make')\n    'make'\n\n    :type command: str\n\n    \"\"\"\n    args = command.split(' ')\n    for prog in args:\n        if '=' not in prog:\n            return prog\n    return args[0]", "entry_point": "sql_program_name_func", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/database.py#L68-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033261", "code": "def _get_bin_width(stdev, count):\n    \"\"\"Return the histogram's optimal bin width based on Sturges\n\n    http://www.jstor.org/pss/2965501\n    \"\"\"\n\n    w = int(round((3.5 * stdev) / (count ** (1.0 / 3))))\n    if w:\n        return w\n    else:\n        return 1", "entry_point": "_get_bin_width", "input": "0.5, True", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/statistics.py#L504-L514", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033262", "code": "def __process_line(line, strip_eol, strip):\n    \"\"\"\n    process a single line value.\n    \"\"\"\n    if strip:\n        line = line.strip()\n    elif strip_eol and line.endswith('\\n'):\n        line = line[:-1]\n    return line", "entry_point": "__process_line", "input": "'', ['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RonenNess/grepfunc/blob/a5323d082c0a581e4b053ef85838c9a0101b43ff/grepfunc/grepfunc.py#L238-L246", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033263", "code": "def check_result(data, key=''):\n    \"\"\"Check the result of an API response.\n\n    Ideally, this should be done by checking that the value of the ``resultCode``\n    attribute is 0, but there are endpoints that simply do not follow this rule.\n\n    Args:\n        data (dict): Response obtained from the API endpoint.\n        key (string): Key to check for existence in the dict.\n\n    Returns:\n        bool: True if result was correct, False otherwise.\n    \"\"\"\n    if not isinstance(data, dict):\n        return False\n\n    if key:\n        if key in data:\n            return True\n\n        return False\n\n    if 'resultCode' in data.keys():\n        # OpenBus\n        return True if data.get('resultCode', -1) == 0 else False\n\n    elif 'code' in data.keys():\n        # Parking\n        return True if data.get('code', -1) == 0 else False\n\n    return False", "entry_point": "check_result", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rmed/pyemtmad/blob/c21c42d0c7b50035dfed29540d7e64ab67833728/pyemtmad/util.py#L39-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033264", "code": "def is_url(text):\n    \"\"\" Check if the given text looks like a URL. \"\"\"\n    if text is None:\n        return False\n    text = text.lower()\n    return text.startswith('http://') or text.startswith('https://') or \\\n        text.startswith('urn:') or text.startswith('file://')", "entry_point": "is_url", "input": "'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pudo/jsongraph/blob/35e4f397dbe69cd5553cf9cb9ab98859c3620f03/jsongraph/util.py#L5-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033265", "code": "def IS(instance, other):  # noqa\n    \"\"\"\n    Support the `future is other` use-case.\n    Can't override the language so we built a function.\n    Will work on non-future objects too.\n\n    :param instance: future or any python object\n    :param other: object to compare.\n    :return:\n    \"\"\"\n    try:\n        instance = instance._redpipe_future_result  # noqa\n    except AttributeError:\n        pass\n\n    try:\n        other = other._redpipe_future_result\n    except AttributeError:\n        pass\n\n    return instance is other", "entry_point": "IS", "input": "[1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/72squared/redpipe/blob/e6ee518bc9f3e2fee323c8c53d08997799bd9b1b/redpipe/futures.py#L106-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033266", "code": "def _parse_values(values, extra=None):\n    \"\"\"\n    Utility function to flatten out args.\n\n    For internal use only.\n\n    :param values: list, tuple, or str\n    :param extra: list or None\n    :return: list\n    \"\"\"\n    coerced = list(values)\n\n    if coerced == values:\n        values = coerced\n    else:\n        coerced = tuple(values)\n        if coerced == values:\n            values = list(values)\n        else:\n            values = [values]\n\n    if extra:\n        values.extend(extra)\n    return values", "entry_point": "_parse_values", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "[[1, 2], [3], [], [1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/72squared/redpipe/blob/e6ee518bc9f3e2fee323c8c53d08997799bd9b1b/redpipe/keyspaces.py#L70-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033267", "code": "def _construct_register(reg, default_reg):\n    \"\"\"Constructs a register dict.\"\"\"\n    if reg:\n        x = dict((k, reg.get(k, d)) for k, d in default_reg.items())\n    else:\n        x = dict(default_reg)\n    return x", "entry_point": "_construct_register", "input": "{}, ()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/p3trus/slave/blob/bdc74e73bd0f47b74a090c43aa2283c469cde3be/slave/iec60488.py#L198-L204", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033268", "code": "def delistify(x):\n    \"\"\" A basic slug version of a given parameter list. \"\"\"\n    if isinstance(x, list):\n        x = [e.replace(\"'\", \"\") for e in x]\n        return '-'.join(sorted(x))\n    return x", "entry_point": "delistify", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/miku/gluish/blob/56d3ac4f41a944e31ecac0aa3b6d1dc2ce705e29/gluish/task.py#L53-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033269", "code": "def index(index, length):\n    \"\"\"Generates an index.\n\n    :param index: The index, can be positive or negative.\n    :param length: The length of the sequence to index.\n\n    :raises: IndexError\n\n    Negative indices are typically used to index a sequence in reverse order.\n    But to use them, the indexed object must convert them to the correct,\n    positive index. This function can be used to do this.\n\n    \"\"\"\n    if index < 0:\n        index += length\n    if 0 <= index < length:\n        return index\n    raise IndexError()", "entry_point": "index", "input": "1, 7", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/p3trus/slave/blob/bdc74e73bd0f47b74a090c43aa2283c469cde3be/slave/misc.py#L78-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033270", "code": "def guess_input_handler(seqs, add_seq_names=False):\n    \"\"\"Returns the name of the input handler for seqs.\"\"\"\n    if isinstance(seqs, str):\n        if '\\n' in seqs:  # can't be a filename...\n            return '_input_as_multiline_string'\n        else:  # assume it was a filename\n            return '_input_as_string'\n\n    if isinstance(seqs, list) and len(seqs) and isinstance(seqs[0], tuple):\n        return '_input_as_seq_id_seq_pairs'\n\n    if add_seq_names:\n        return '_input_as_seqs'\n\n    return '_input_as_lines'", "entry_point": "guess_input_handler", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "'_input_as_seqs'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore/burrito/blob/3b1dcc560431cc2b7a4856b99aafe36d32082356/burrito/util.py#L778-L792", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033271", "code": "def safestr(str_):\n    ''' get back an alphanumeric only version of source '''\n    str_ = str_ or \"\"\n    return \"\".join(x for x in str_ if x.isalnum())", "entry_point": "safestr", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kejbaly2/metrique/blob/a10b076097441b7dde687949139f702f5c1e1b35/metrique/utils.py#L1107-L1110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033272", "code": "def clusters_from_blast_uc_file(uc_lines, otu_id_field=1):\n    \"\"\" Parses out hit/miss sequences from usearch blast uc file\n\n    All lines should be 'H'it or 'N'o hit.  Returns a dict of OTU ids: sequence\n    labels of the hits, and a list of all sequence labels that miss.\n\n    uc_lines = open file object of uc file\n\n    otu_id_field: uc field to use as the otu id. 1 is usearch's ClusterNr field,\n     and 9 is usearch's TargetLabel field\n\n    \"\"\"\n\n    hit_miss_index = 0\n    cluster_id_index = otu_id_field\n    seq_label_index = 8\n\n    otus = {}\n    unassigned_seqs = []\n\n    for line in uc_lines:\n        # skip empty, comment lines\n        if line.startswith('#') or len(line.strip()) == 0:\n            continue\n\n        curr_line = line.split('\\t')\n\n        if curr_line[hit_miss_index] == 'N':\n            # only retaining actual sequence label\n            unassigned_seqs.append(curr_line[seq_label_index].split()[0])\n\n        if curr_line[hit_miss_index] == 'H':\n\n            curr_seq_label = curr_line[seq_label_index].split()[0]\n            curr_otu_id = curr_line[cluster_id_index].split()[0]\n            # Append sequence label to dictionary, or create key\n            try:\n                otus[curr_otu_id].append(curr_seq_label)\n            except KeyError:\n                otus[curr_otu_id] = [curr_seq_label]\n\n    return otus, unassigned_seqs", "entry_point": "clusters_from_blast_uc_file", "input": "'  padded  ', [-1, 0, 1, 2]", "output": "({}, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore/burrito-fillings/blob/02ab71a46119b40793bd56a4ae00ca15f6dc3329/bfillings/usearch.py#L253-L294", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033273", "code": "def parse_dereplicated_uc(dereplicated_uc_lines):\n    \"\"\" Return dict of seq ID:dereplicated seq IDs from dereplicated .uc lines\n\n    dereplicated_uc_lines: list of lines of .uc file from dereplicated seqs from\n     usearch61 (i.e. open file of abundance sorted .uc data)\n    \"\"\"\n\n    dereplicated_clusters = {}\n\n    seed_hit_ix = 0\n    seq_id_ix = 8\n    seed_id_ix = 9\n\n    for line in dereplicated_uc_lines:\n        if line.startswith(\"#\") or len(line.strip()) == 0:\n            continue\n        curr_line = line.strip().split('\\t')\n        if curr_line[seed_hit_ix] == \"S\":\n            dereplicated_clusters[curr_line[seq_id_ix]] = []\n        if curr_line[seed_hit_ix] == \"H\":\n            curr_seq_id = curr_line[seq_id_ix]\n            dereplicated_clusters[curr_line[seed_id_ix]].append(curr_seq_id)\n\n    return dereplicated_clusters", "entry_point": "parse_dereplicated_uc", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore/burrito-fillings/blob/02ab71a46119b40793bd56a4ae00ca15f6dc3329/bfillings/usearch.py#L2420-L2443", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033274", "code": "def parse_usearch61_clusters(clustered_uc_lines,\n                             otu_prefix='denovo',\n                             ref_clustered=False):\n    \"\"\" Returns dict of cluster ID:seq IDs\n\n    clustered_uc_lines: lines from .uc file resulting from de novo clustering\n    otu_prefix: string added to beginning of OTU ID.\n    ref_clustered: If True, will attempt to create dict keys for clusters as\n     they are read from the .uc file, rather than from seed lines.\n    \"\"\"\n\n    clusters = {}\n    failures = []\n\n    seed_hit_ix = 0\n    otu_id_ix = 1\n    seq_id_ix = 8\n    ref_id_ix = 9\n\n    for line in clustered_uc_lines:\n        if line.startswith(\"#\") or len(line.strip()) == 0:\n            continue\n        curr_line = line.strip().split('\\t')\n        if curr_line[seed_hit_ix] == \"S\":\n            # Need to split on semicolons for sequence IDs to handle case of\n            # abundance sorted data\n            clusters[otu_prefix + curr_line[otu_id_ix]] =\\\n                [curr_line[seq_id_ix].split(';')[0].split()[0]]\n        if curr_line[seed_hit_ix] == \"H\":\n            curr_id = curr_line[seq_id_ix].split(';')[0].split()[0]\n            if ref_clustered:\n                try:\n                    clusters[otu_prefix + curr_line[ref_id_ix]].append(curr_id)\n                except KeyError:\n                    clusters[otu_prefix + curr_line[ref_id_ix]] = [curr_id]\n            else:\n                clusters[otu_prefix +\n                         curr_line[otu_id_ix]].append(curr_id)\n        if curr_line[seed_hit_ix] == \"N\":\n            failures.append(curr_line[seq_id_ix].split(';')[0])\n\n    return clusters, failures", "entry_point": "parse_usearch61_clusters", "input": "'', 'a,b,c', ['apple', 'banana', 'cherry']", "output": "({}, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore/burrito-fillings/blob/02ab71a46119b40793bd56a4ae00ca15f6dc3329/bfillings/usearch.py#L2446-L2487", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033275", "code": "def merge_failures_dereplicated_seqs(failures,\n                                     dereplicated_clusters):\n    \"\"\" Appends failures from dereplicated seqs to failures list\n\n    failures: list of failures\n    dereplicated_clusters:  dict of seq IDs: dereplicated seq IDs\n    \"\"\"\n\n    curr_failures = set(failures)\n    dereplicated_ids = set(dereplicated_clusters)\n\n    for curr_failure in curr_failures:\n        if curr_failure in dereplicated_ids:\n            failures += dereplicated_clusters[curr_failure]\n\n    return failures", "entry_point": "merge_failures_dereplicated_seqs", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore/burrito-fillings/blob/02ab71a46119b40793bd56a4ae00ca15f6dc3329/bfillings/usearch.py#L2510-L2525", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033276", "code": "def get_telex_definition(w_shorthand=True, brackets_shorthand=True):\n    \"\"\"Create a definition dictionary for the TELEX input method\n\n    Args:\n        w_shorthand (optional): allow a stand-alone w to be\n            interpreted as an \u01b0. Default to True.\n        brackets_shorthand (optional, True): allow typing ][ as\n            shorthand for \u01b0\u01a1. Default to True.\n\n    Returns a dictionary to be passed into process_key().\n    \"\"\"\n    telex = {\n        \"a\": \"a^\",\n        \"o\": \"o^\",\n        \"e\": \"e^\",\n        \"w\": [\"u*\", \"o*\", \"a+\"],\n        \"d\": \"d-\",\n        \"f\": \"\\\\\",\n        \"s\": \"/\",\n        \"r\": \"?\",\n        \"x\": \"~\",\n        \"j\": \".\",\n    }\n\n    if w_shorthand:\n        telex[\"w\"].append('<\u01b0')\n\n    if brackets_shorthand:\n        telex.update({\n            \"]\": \"<\u01b0\",\n            \"[\": \"<\u01a1\",\n            \"}\": \"<\u01af\",\n            \"{\": \"<\u01a0\"\n        })\n\n    return telex", "entry_point": "get_telex_definition", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "{'a': 'a^', 'o': 'o^', 'e': 'e^', 'w': ['u*', 'o*', 'a+', '<\u01b0'], 'd': 'd-', 'f': '\\\\', 's': '/', 'r': '?', 'x': '~', 'j': '.', ']': '<\u01b0', '[': '<\u01a1', '}': '<\u01af', '{': '<\u01a0'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BoGoEngine/bogo-python/blob/9b85329a408ded4cead3539cecba12984d5d7650/bogo/core.py#L46-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033277", "code": "def _unbytes(bytestr):\n    \"\"\"\n    Returns a bytestring from the human-friendly string returned by `_bytes`.\n\n    >>> _unbytes('123456')\n    '\\x12\\x34\\x56'\n    \"\"\"\n    return ''.join(chr(int(bytestr[k:k + 2], 16))\n                   for k in range(0, len(bytestr), 2))", "entry_point": "_unbytes", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mpapi/lazylights/blob/536dbd3ce75c28b3545cf66f25fc72589488063f/lazylights.py#L118-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033278", "code": "def smart_round( val, decimal_places = 2 ):\n    \"\"\"\n    For floats >= 10.**-(decimal_places - 1), rounds off to the valber of decimal places specified.\n    For floats < 10.**-(decimal_places - 1), puts in exponential form then rounds off to the decimal\n    places specified.\n    @val: value to round; if val is not a float, just returns val\n    @decimal_places: number of decimal places to round to\n    \"\"\"\n    if isinstance(val, float) and val != 0.0:\n        if val >= 10.**-(decimal_places - 1):\n            conv_str = ''.join([ '%.', str(decimal_places), 'f' ])\n        else:\n            conv_str = ''.join([ '%.', str(decimal_places), 'e' ])\n        val = float( conv_str % val )\n\n    return val", "entry_point": "smart_round", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc-glue/blob/a3e906bae59fbfd707c3ff82e5d008d939ec5e24/pycbc_glue/ligolw/utils/print_tables.py#L91-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033279", "code": "def ifos_from_instrument_set(instruments):\n\t\"\"\"\n\tConvert an iterable of instrument names into a value suitable for\n\tstorage in the \"ifos\" column found in many tables.  This function\n\tis mostly for internal use by the .instruments properties of the\n\tcorresponding row classes.  The input can be None or an iterable of\n\tzero or more instrument names, none of which may be zero-length,\n\tconsist exclusively of spaces, or contain \",\" or \"+\" characters.\n\tThe output is a single string containing the unique instrument\n\tnames concatenated using \",\" as a delimiter.  instruments will only\n\tbe iterated over once and so can be a generator expression.\n\tWhitespace is allowed in instrument names but might not be\n\tpreserved.  Repeated names will not be preserved.\n\n\tNOTE:  in the special case that there is 1 instrument name in the\n\titerable and it has an even number of characters > 2 in it, the\n\toutput will have a \",\" appended in order to force\n\tinstrument_set_from_ifos() to parse the string back into a single\n\tinstrument name.  This is a special case included temporarily to\n\tdisambiguate the encoding until all codes have been ported to the\n\tcomma-delimited encoding.  This behaviour will be discontinued at\n\tthat time.  DO NOT WRITE CODE THAT RELIES ON THIS!  You have been\n\twarned.\n\n\tExample:\n\n\t>>> print ifos_from_instrument_set(None)\n\tNone\n\t>>> ifos_from_instrument_set(())\n\tu''\n\t>>> ifos_from_instrument_set((u\"H1\",))\n\tu'H1'\n\t>>> ifos_from_instrument_set((u\"H1\",u\"H1\",u\"H1\"))\n\tu'H1'\n\t>>> ifos_from_instrument_set((u\"H1\",u\"L1\"))\n\tu'H1,L1'\n\t>>> ifos_from_instrument_set((u\"SWIFT\",))\n\tu'SWIFT'\n\t>>> ifos_from_instrument_set((u\"H1L1\",))\n\tu'H1L1,'\n\t\"\"\"\n\tif instruments is None:\n\t\treturn None\n\t_instruments = sorted(set(instrument.strip() for instrument in instruments))\n\t# safety check:  refuse to accept blank names, or names with commas\n\t# or pluses in them as they cannot survive the encode/decode\n\t# process\n\tif not all(_instruments) or any(u\",\" in instrument or u\"+\" in instrument for instrument in _instruments):\n\t\traise ValueError(instruments)\n\tif len(_instruments) == 1 and len(_instruments[0]) > 2 and not len(_instruments[0]) % 2:\n\t\t# special case disambiguation.  FIXME:  remove when\n\t\t# everything uses the comma-delimited encoding\n\t\treturn u\"%s,\" % _instruments[0]\n\treturn u\",\".join(_instruments)", "entry_point": "ifos_from_instrument_set", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc-glue/blob/a3e906bae59fbfd707c3ff82e5d008d939ec5e24/pycbc_glue/ligolw/lsctables.py#L230-L283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033280", "code": "def delete_duplicates(seq):\n    \"\"\"\n    Remove duplicates from an iterable, preserving the order.\n\n    Args:\n        seq: Iterable of various type.\n\n    Returns:\n        list: List of unique objects.\n\n    \"\"\"\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if not (x in seen or seen_add(x))]", "entry_point": "delete_duplicates", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/radzak/rtv-downloader/blob/b9114b7f4c35fabe6ec9ad1764a65858667a866e/rtv/utils.py#L193-L206", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033281", "code": "def _addTags(tags, objects):\n    \"\"\" Adds tags to objects \"\"\"\n    for t in tags:\n        for o in objects:\n            o.tags.add(t)\n\n    return True", "entry_point": "_addTags", "input": "['a', 'b', 'c'], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theiviaxx/Frog/blob/a9475463a8eed1323fe3ef5d51f9751fb1dc9edd/frog/views/tag.py#L334-L340", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033282", "code": "def IntGreaterThanZero(n):\n    \"\"\"If *n* is an integer > 0, returns it, otherwise an error.\"\"\"\n    try:\n        n = int(n)\n    except:\n        raise ValueError(\"%s is not an integer\" % n)\n    if n <= 0:\n        raise ValueError(\"%d is not > 0\" % n)\n    else:\n        return n", "entry_point": "IntGreaterThanZero", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jbloomlab/phydms/blob/9cdebc10bafbe543c552d79486c7f950780ed3c0/phydmslib/parsearguments.py#L65-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033283", "code": "def FloatGreaterThanEqualToZero(x):\n    \"\"\"If *x* is a float >= 0, returns it, otherwise raises and error.\n\n    >>> print('%.1f' % FloatGreaterThanEqualToZero('1.5'))\n    1.5\n\n    >>> print('%.1f' % FloatGreaterThanEqualToZero('-1.1'))\n    Traceback (most recent call last):\n       ...\n    ValueError: -1.1 not float greater than or equal to zero\n    \"\"\"\n    try:\n        x = float(x)\n    except:\n        raise ValueError(\"%r not float greater than or equal to zero\" % x)\n    if x >= 0:\n        return x\n    else:\n        raise ValueError(\"%r not float greater than or equal to zero\" % x)", "entry_point": "FloatGreaterThanEqualToZero", "input": "0.5", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jbloomlab/phydms/blob/9cdebc10bafbe543c552d79486c7f950780ed3c0/phydmslib/parsearguments.py#L87-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033284", "code": "def FloatBetweenZeroAndOne(x):\n    \"\"\"Returns *x* only if *0 <= x <= 1*, otherwise raises error.\"\"\"\n    x = float(x)\n    if 0 <= x <= 1:\n        return x\n    else:\n        raise ValueError(\"{0} not a float between 0 and 1.\".format(x))", "entry_point": "FloatBetweenZeroAndOne", "input": "False", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jbloomlab/phydms/blob/9cdebc10bafbe543c552d79486c7f950780ed3c0/phydmslib/parsearguments.py#L137-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033285", "code": "def number_of_modified_bytes(buf, fuzzed_buf):\n    \"\"\"Determine the number of differing bytes.\n\n    :param buf: original buffer.\n    :param fuzzed_buf: fuzzed buffer.\n    :return: number of different bytes.\n    :rtype: int\n    \"\"\"\n    count = 0\n    for idx, b in enumerate(buf):\n        if b != fuzzed_buf[idx]:\n            count += 1\n    return count", "entry_point": "number_of_modified_bytes", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stbraun/fuzzing/blob/974a64472732d4e40db919d242149bf0856fe199/features/steps/ft_fuzzer.py#L193-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033286", "code": "def __parse_app_list(app_list):\n        \"\"\"Parse list of apps for arguments.\n\n        :param app_list: list of apps with optional arguments.\n        :return: list of apps and assigned argument dict.\n        :rtype: [String], {String: [String]}\n        \"\"\"\n        args = {}\n        apps = []\n        for app_str in app_list:\n            parts = app_str.split(\"&\")\n            app_path = parts[0].strip()\n            apps.append(app_path)\n            if len(parts) > 1:\n                args[app_path] = [arg.strip() for arg in parts[1].split()]\n            else:\n                args[app_path] = []\n        return apps, args", "entry_point": "__parse_app_list", "input": "['a', 'b', 'c']", "output": "(['a', 'b', 'c'], {'a': [], 'b': [], 'c': []})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stbraun/fuzzing/blob/974a64472732d4e40db919d242149bf0856fe199/fuzzing/fuzzer.py#L295-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033287", "code": "def normalize_mapping_line(mapping_line, previous_source_column=0):\n    \"\"\"\n    Often times the position will remain stable, such that the naive\n    process will end up with many redundant values; this function will\n    iterate through the line and remove all extra values.\n    \"\"\"\n\n    if not mapping_line:\n        return [], previous_source_column\n\n    # Note that while the local record here is also done as a 4-tuple,\n    # element 1 and 2 are never used since they are always provided by\n    # the segments in the mapping line; they are defined for consistency\n    # reasons.\n\n    def regenerate(segment):\n        if len(segment) == 5:\n            result = (record[0], segment[1], segment[2], record[3], segment[4])\n        else:\n            result = (record[0], segment[1], segment[2], record[3])\n        # Ideally the exact location should still be kept, but given\n        # that the sourcemap format is accumulative and permits a lot\n        # of inferred positions, resetting all values to 0 is intended.\n        record[:] = [0, 0, 0, 0]\n        return result\n\n    # first element of the line; sink column (0th element) is always\n    # the absolute value, so always use the provided value sourced from\n    # the original mapping_line; the source column (3rd element) is\n    # never reset, so if a previous counter exists (which is specified\n    # by the optional argument), make use of it to generate the initial\n    # normalized segment.\n    record = [0, 0, 0, previous_source_column]\n    result = []\n    regen_next = True\n\n    for segment in mapping_line:\n        if not segment:\n            # ignore empty records\n            continue\n        # if the line has not changed, and that the increases of both\n        # columns are the same, accumulate the column counter and drop\n        # the segment.\n\n        # accumulate the current record first\n        record[0] += segment[0]\n        if len(segment) == 1:\n            # Mark the termination, as 1-tuple determines the end of the\n            # previous symbol and denote that whatever follows are not\n            # in any previous source files.  So if it isn't recorded,\n            # make note of this if it wasn't done already.\n            if result and len(result[-1]) != 1:\n                result.append((record[0],))\n                record[0] = 0\n                # the next complete segment will require regeneration\n                regen_next = True\n            # skip the remaining processing.\n            continue\n\n        record[3] += segment[3]\n\n        # 5-tuples are always special case with the remapped identifier\n        # name element, and to mark the termination the next token must\n        # also be explicitly written (in our case, regenerated).  If the\n        # filename or source line relative position changed (idx 1 and\n        # 2), regenerate it too.  Finally, if the column offsets differ\n        # between source and sink, regenerate.\n        if len(segment) == 5 or regen_next or segment[1] or segment[2] or (\n                record[0] != record[3]):\n            result.append(regenerate(segment))\n            regen_next = len(segment) == 5\n\n    # must return the consumed/omitted values.\n    return result, record[3]", "entry_point": "normalize_mapping_line", "input": "{}, ['apple', 'banana', 'cherry']", "output": "([], ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/calmjs/calmjs.parse/blob/369f0ee346c5a84c4d5c35a7733a0e63b02eac59/src/calmjs/parse/sourcemap.py#L132-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033288", "code": "def is_parans_exp(istr):\n    \"\"\"\n    Determines if an expression is a valid function \"call\"\n    \"\"\"\n    fxn = istr.split('(')[0]\n    if (not fxn.isalnum() and fxn != '(') or istr[-1] != ')':\n        return False\n    plevel = 1\n    for c in '('.join(istr[:-1].split('(')[1:]):\n        if c == '(':\n            plevel += 1\n        elif c == ')':\n            plevel -= 1\n        if plevel == 0:\n            return False\n    return True", "entry_point": "is_parans_exp", "input": "''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bovee/Aston/blob/007630fdf074690373d03398fe818260d3d3cf5a/aston/trace/parser.py#L115-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033289", "code": "def _parse_property_list(prop, value):\n        \"\"\"Parse a list property and return a list of the results.\"\"\"\n        attributes = []\n        for v in value:\n            try:\n                attributes.append(\n                    prop.prop.instance_class.from_api(**v),\n                )\n            except AttributeError:\n                attributes.append(v)\n        return attributes", "entry_point": "_parse_property_list", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LasLabs/python-helpscout/blob/84bf669417d72ca19641a02c9a660e1ae4271de4/helpscout/base_model.py#L157-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033290", "code": "def _to_camel_case(string):\n        \"\"\"Return a camel cased version of the input string.\n\n        Args:\n            string (str): A snake cased string.\n\n        Returns:\n            str: A camel cased string.\n        \"\"\"\n        components = string.split('_')\n        return '%s%s' % (\n            components[0],\n            ''.join(c.title() for c in components[1:]),\n        )", "entry_point": "_to_camel_case", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LasLabs/python-helpscout/blob/84bf669417d72ca19641a02c9a660e1ae4271de4/helpscout/base_model.py#L184-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033291", "code": "def is_equal_strings_ignore_case(first, second):\r\n    \"\"\"The function compares strings ignoring case\"\"\"\r\n    if first and second:\r\n        return first.upper() == second.upper()\r\n    else:\r\n        return not (first or second)", "entry_point": "is_equal_strings_ignore_case", "input": "[], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Knoema/knoema-python-driver/blob/e98b13db3e4df51c208c272e2977bfbe4c6e5532/knoema/api_definitions.py#L6-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033292", "code": "def pad(data, length):\n        \"\"\"This function returns a padded version of the input data to the\n        given length.  this function will shorten the given data to the length\n        specified if necessary.  post-condition: len(data) = length\n\n        :param data: the data byte array to pad\n        :param length: the length to pad the array to\n        \"\"\"\n        if (len(data) > length):\n            return data[0:length]\n        else:\n            return data + b\"\\0\" * (length - len(data))", "entry_point": "pad", "input": "[5, 3, 1, 4], 2", "output": "[5, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StorjOld/heartbeat/blob/4d54f2011f1e9f688073d4347bc51bb7bd682718/heartbeat/util.py#L53-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033293", "code": "def _get_windows(peak_list):\n    \"\"\"\n    Given a list of peaks, bin them into windows.\n    \"\"\"\n    win_list = []\n    for t0, t1, hints in peak_list:\n        p_w = (t0, t1)\n        for w in win_list:\n            if p_w[0] <= w[0][1] and p_w[1] >= w[0][0]:\n                w[0] = (min(p_w[0], w[0][0]), max(p_w[1], w[0][1]))\n                w[1].append((t0, t1, hints))\n                break\n        else:\n            win_list.append([p_w, [(t0, t1, hints)]])\n    return win_list", "entry_point": "_get_windows", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bovee/Aston/blob/007630fdf074690373d03398fe818260d3d3cf5a/aston/trace/new_integrator.py#L6-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033294", "code": "def _split_one_end(path):\n        \"\"\"\n        Utility function for splitting off the very end part of a path.\n        \"\"\"\n        s = path.rsplit('/', 1)\n        if len(s) == 1:\n            return s[0], ''\n        else:\n            return tuple(s)", "entry_point": "_split_one_end", "input": "''", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataKitchen/DKCloudCommand/blob/1cf9cb08ab02f063eef6b5c4b327af142991daa3/DKCloudCommand/modules/DKCloudCommandRunner.py#L1820-L1828", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033295", "code": "def nvlist_to_dict(nvlist):\r\n    '''Convert a CORBA namevalue list into a dictionary.'''\r\n    result = {}\r\n    for item in nvlist :\r\n        result[item.name] = item.value.value()\r\n    return result", "entry_point": "nvlist_to_dict", "input": "()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gbiggs/rtctree/blob/bd725a47ac87c259c8bce06156ccc9ab71111c26/rtctree/utils.py#L171-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033296", "code": "def filtered(path, filter):\r\n    '''Check if a path is removed by a filter.\r\n\r\n    Check if a path is in the provided set of paths, @ref filter. If\r\n    none of the paths in filter begin with @ref path, then True is\r\n    returned to indicate that the path is filtered out. If @ref path is\r\n    longer than the filter, and starts with the filter, it is\r\n    considered unfiltered (all paths below a filter are unfiltered).\r\n\r\n    An empty filter ([]) is treated as not filtering any.\r\n\r\n    '''\r\n    if not filter:\r\n        return False\r\n    for p in filter:\r\n        if len(path) > len(p):\r\n            if path[:len(p)] == p:\r\n                return False\r\n        else:\r\n            if p[:len(path)] == path:\r\n                return False\r\n    return True", "entry_point": "filtered", "input": "'', [[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gbiggs/rtctree/blob/bd725a47ac87c259c8bce06156ccc9ab71111c26/rtctree/utils.py#L179-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033297", "code": "def generate_key(url, page_number):\n    \"\"\"\n    >>> url_a = 'http://localhost:5009/search?keywords=a'\n    >>> generate_key(url_a, 10)\n    'http://localhost:5009/search?keywords=a&page=10'\n    >>> url_b = 'http://localhost:5009/search?keywords=b&page=1'\n    >>> generate_key(url_b, 10)\n    'http://localhost:5009/search?keywords=b&page=10'\n    \"\"\"\n    index = url.rfind('page')\n    if index != -1:\n        result = url[0:index]\n        result += 'page=%s' % page_number\n    else:\n        result = url\n        result += '&page=%s' % page_number\n    return result", "entry_point": "generate_key", "input": "'abc', ''", "output": "'abc&page='", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SylvanasSun/FishFishJump/blob/696212d242d8d572f3f1b43925f3d8ab8acc6a2d/fish_searcher/views/search.py#L131-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033298", "code": "def sift4(s1, s2, max_offset=5):\n    \"\"\"\n    This is an implementation of general Sift4.\n    \"\"\"\n    t1, t2 = list(s1), list(s2)\n    l1, l2 = len(t1), len(t2)\n\n    if not s1:\n        return l2\n\n    if not s2:\n        return l1\n\n    # Cursors for each string\n    c1, c2 = 0, 0\n\n    # Largest common subsequence\n    lcss = 0\n\n    # Local common substring\n    local_cs = 0\n\n    # Number of transpositions ('ab' vs 'ba')\n    trans = 0\n\n    # Offset pair array, for computing the transpositions\n    offsets = []\n\n    while c1 < l1 and c2 < l2:\n        if t1[c1] == t2[c2]:\n            local_cs += 1\n\n            # Check if current match is a transposition\n            is_trans = False\n            i = 0\n            while i < len(offsets):\n                ofs = offsets[i]\n                if c1 <= ofs['c1'] or c2 <= ofs['c2']:\n                    is_trans = abs(c2-c1) >= abs(ofs['c2'] - ofs['c1'])\n                    if is_trans:\n                        trans += 1\n                    elif not ofs['trans']:\n                        ofs['trans'] = True\n                        trans += 1\n                    break\n                elif c1 > ofs['c2'] and c2 > ofs['c1']:\n                    del offsets[i]\n                else:\n                    i += 1\n            offsets.append({\n                'c1': c1,\n                'c2': c2,\n                'trans': is_trans\n            })\n\n        else:\n            lcss += local_cs\n            local_cs = 0\n            if c1 != c2:\n                c1 = c2 = min(c1, c2)\n\n            for i in range(max_offset):\n                if c1 + i >= l1 and c2 + i >= l2:\n                    break\n                elif c1 + i < l1 and s1[c1+i] == s2[c2]:\n                    c1 += i - 1\n                    c2 -= 1\n                    break\n\n                elif c2 + i < l2 and s1[c1] == s2[c2 + i]:\n                    c2 += i - 1\n                    c1 -= 1\n                    break\n\n        c1 += 1\n        c2 += 1\n\n        if c1 >= l1 or c2 >= l2:\n            lcss += local_cs\n            local_cs = 0\n            c1 = c2 = min(c1, c2)\n\n    lcss += local_cs\n    return round(max(l1, l2) - lcss + trans)", "entry_point": "sift4", "input": "set(), 'Hello World', 0.5", "output": "11", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/frnsys/broca/blob/7236dcf54edc0a4a54a55eb93be30800910667e7/broca/distance/sift4.py#L14-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033299", "code": "def _default_hashfunc(content, hashbits):\n    \"\"\"\n    Default hash function is variable-length version of Python's builtin hash.\n\n    :param content: data that needs to hash.\n    :return: return a decimal number.\n    \"\"\"\n    if content == \"\":\n        return 0\n\n    x = ord(content[0]) << 7\n    m = 1000003\n    mask = 2 ** hashbits - 1\n    for c in content:\n        x = ((x * m) ^ ord(c)) & mask\n    x ^= len(content)\n    if x == -1:\n        x = -2\n    return x", "entry_point": "_default_hashfunc", "input": "'  padded  ', 3", "output": "12", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SylvanasSun/FishFishJump/blob/696212d242d8d572f3f1b43925f3d8ab8acc6a2d/fish_core/simhash.py#L11-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033300", "code": "def format_dict_to_str(dict, format):\n    \"\"\"\n    Format a dictionary to the string, param format is a specified format rule\n    such as dict = '{'name':'Sylvanas', 'gender':'Boy'}' format = '-'\n    so result is 'name-Sylvanas, gender-Boy'.\n\n    >>> dict = {'name': 'Sylvanas', 'gender': 'Boy'}\n    >>> format_dict_to_str(dict, format='-')\n    'name-Sylvanas, gender-Boy'\n    \"\"\"\n    result = ''\n    for k, v in dict.items():\n        result = result + str(k) + format + str(v) + ', '\n    return result[:-2]", "entry_point": "format_dict_to_str", "input": "{'a': 1, 'b': 2}, 'walnut thistle harbour'", "output": "'awalnut thistle harbour1, bwalnut thistle harbour2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SylvanasSun/FishFishJump/blob/696212d242d8d572f3f1b43925f3d8ab8acc6a2d/fish_core/utils/common_utils.py#L6-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033301", "code": "def list_to_str(list, separator=','):\n    \"\"\"\n    >>> list = [0, 0, 7]\n    >>> list_to_str(list)\n    '0,0,7'\n    \"\"\"\n    list = [str(x) for x in list]\n    return separator.join(list)", "entry_point": "list_to_str", "input": "[], 'abc'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SylvanasSun/FishFishJump/blob/696212d242d8d572f3f1b43925f3d8ab8acc6a2d/fish_core/utils/common_utils.py#L26-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033302", "code": "def check_validity_for_dict(keys, dict):\n    \"\"\"\n    >>> dict = {'a': 0, 'b': 1, 'c': 2}\n    >>> keys = ['a', 'd', 'e']\n    >>> check_validity_for_dict(keys, dict) == False\n    True\n    >>> keys = ['a', 'b', 'c']\n    >>> check_validity_for_dict(keys, dict) == False\n    False\n    \"\"\"\n    for key in keys:\n        if key not in dict or dict[key] is '' or dict[key] is None:\n            return False\n    return True", "entry_point": "check_validity_for_dict", "input": "[-1, 0, 1, 2], {'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SylvanasSun/FishFishJump/blob/696212d242d8d572f3f1b43925f3d8ab8acc6a2d/fish_core/utils/common_utils.py#L58-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033303", "code": "def _normalize_tags(chunk):\n    \"\"\"\n    (From textblob)\n\n    Normalize the corpus tags.\n    (\"NN\", \"NN-PL\", \"NNS\") -> \"NN\"\n    \"\"\"\n    ret = []\n    for word, tag in chunk:\n        if tag == 'NP-TL' or tag == 'NP':\n            ret.append((word, 'NNP'))\n            continue\n        if tag.endswith('-TL'):\n            ret.append((word, tag[:-3]))\n            continue\n        if tag.endswith('S'):\n            ret.append((word, tag[:-1]))\n            continue\n        ret.append((word, tag))\n    return ret", "entry_point": "_normalize_tags", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/frnsys/broca/blob/7236dcf54edc0a4a54a55eb93be30800910667e7/broca/tokenize/keyword/pos.py#L63-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033304", "code": "def _keys_via_value_nonrecur(d,v):\n    '''\n        #non-recursive\n        d = {1:'a',2:'b',3:'a'}\n        _keys_via_value_nonrecur(d,'a')\n    '''\n    rslt = []\n    for key in d:\n        if(d[key] == v):\n            rslt.append(key)\n    return(rslt)", "entry_point": "_keys_via_value_nonrecur", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ihgazni2/edict/blob/44a08ccc10b196aa3854619b4c51ddb246778a34/edict/edict.py#L477-L487", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033305", "code": "def d2kvlist(d):\n    '''\n        d = {'GPSImgDirectionRef': 'M', 'GPSVersionID': b'\\x02\\x03\\x00\\x00', 'GPSImgDirection': (21900, 100)}\n        pobj(d)\n        kl,vl = d2kvlist(d)\n        pobj(kl)\n        pobj(vl)\n    '''\n    kl = list(d.keys())\n    vl = list(d.values())\n    return((kl,vl))", "entry_point": "d2kvlist", "input": "{'a': 1, 'b': 2}", "output": "(['a', 'b'], [1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ihgazni2/edict/blob/44a08ccc10b196aa3854619b4c51ddb246778a34/edict/edict.py#L603-L613", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033306", "code": "def _diff_internal(d1,d2):\n    '''\n        d1 = {'a':'x','b':'y','c':'z'}\n        d2 = {'a':'x','b':'u','d':'v'}\n        _diff_internal(d1,d2)\n        _diff_internald2,d1)\n    '''\n    same =[]\n    kdiff =[]\n    vdiff = []\n    for key in d1:\n        value = d1[key]\n        if(key in d2):\n            if(value == d2[key]):\n                same.append(key)\n            else:\n                vdiff.append(key)\n        else:\n            kdiff.append(key)\n    return({'same':same,'kdiff':kdiff,'vdiff':vdiff})", "entry_point": "_diff_internal", "input": "[], [5, 3, 1, 4]", "output": "{'same': [], 'kdiff': [], 'vdiff': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ihgazni2/edict/blob/44a08ccc10b196aa3854619b4c51ddb246778a34/edict/edict.py#L921-L940", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033307", "code": "def format_path(path):\r\n    '''Formats a path as a string, placing / between each component.\r\n\r\n    @param path A path in rtctree format, as a tuple with the port name as the\r\n                second component.\r\n\r\n    Examples:\r\n\r\n    >>> format_path((['localhost:30000', 'manager', 'comp0.rtc'], None))\r\n    'localhost:30000/manager/comp0.rtc'\r\n\r\n    >>> format_path((['localhost', 'manager', 'comp0.rtc'], 'in'))\r\n    'localhost/manager/comp0.rtc:in'\r\n    \r\n    >>> format_path((['/', 'localhost', 'manager', 'comp0.rtc'], None))\r\n    '/localhost/manager/comp0.rtc'\r\n    \r\n    >>> format_path((['/', 'localhost', 'manager', 'comp0.rtc'], 'in'))\r\n    '/localhost/manager/comp0.rtc:in'\r\n\r\n    >>> format_path((['manager', 'comp0.rtc'], None))\r\n    'manager/comp0.rtc'\r\n    \r\n    >>> format_path((['comp0.rtc'], None))\r\n    'comp0.rtc'\r\n\r\n    '''\r\n    if path[1]:\r\n        port = ':' + path[1]\r\n    else:\r\n        port = ''\r\n    if type(path[0]) is str:\r\n        # Don't add slashes if the path is singular\r\n        return path[0] + port\r\n    if path[0][0] == '/':\r\n        starter = '/'\r\n        path = path[0][1:]\r\n    else:\r\n        starter = ''\r\n        path = path[0]\r\n    return starter + '/'.join(path) + port", "entry_point": "format_path", "input": "'a,b,c'", "output": "'a:,'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gbiggs/rtctree/blob/bd725a47ac87c259c8bce06156ccc9ab71111c26/rtctree/path.py#L100-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033308", "code": "def read_config(config):\n    \"\"\"Read config file and return uncomment line\n    \"\"\"\n    for line in config.splitlines():\n        line = line.lstrip()\n        if line and not line.startswith(\"#\"):\n            return line\n    return \"\"", "entry_point": "read_config", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dslackw/sun/blob/ff3501757ce1cc2f0db195f7a6b1d23f601dce32/sun/utils.py#L83-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033309", "code": "def getPrimeFactors(n):\n    \"\"\"\n    Get all the prime factor of given integer\n    @param n integer\n    @return list [1, ..., n]\n    \"\"\"\n    lo = [1]\n    n2 = n // 2\n    k = 2\n    for k in range(2, n2 + 1):\n        if (n // k)*k == n:\n            lo.append(k)\n    return lo + [n, ]", "entry_point": "getPrimeFactors", "input": "2", "output": "[1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pletzer/pnumpy/blob/9e6d308be94a42637466b91ab1a7b4d64b4c29ae/src/pnCubeDecomp.py#L13-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033310", "code": "def calculate_intervals(chunk_sizes):\n        \"\"\"Calculate intervals for a given chunk sizes.\n\n        :param list chunk_sizes: List of chunk sizes.\n        :return: Tuple of intervals.\n        :rtype: :py:class:`tuple`\n        \"\"\"\n        start_indexes = [sum(chunk_sizes[:i]) for i in range(0, len(chunk_sizes))]\n        end_indexes = [sum(chunk_sizes[:i+1]) for i in range(0, len(chunk_sizes))]\n        return tuple(zip(start_indexes, end_indexes))", "entry_point": "calculate_intervals", "input": "set()", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MoseleyBioinformaticsLab/nmrstarlib/blob/f2adabbca04d5a134ce6ba3211099d1457787ff2/nmrstarlib/translator.py#L167-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033311", "code": "def formdata_encode(fields):\n    \"\"\"Encode fields (a dict) as a multipart/form-data HTTP request\n    payload. Returns a (content type, request body) pair.\n    \"\"\"\n    BOUNDARY = '----form-data-boundary-ZmRkNzJkMjUtMjkyMC00'\n    out = []\n    for (key, value) in fields.items():\n        out.append('--' + BOUNDARY)\n        out.append('Content-Disposition: form-data; name=\"%s\"' % key)\n        out.append('')\n        out.append(value)\n    out.append('--' + BOUNDARY + '--')\n    out.append('')\n    body = '\\r\\n'.join(out)\n    content_type = 'multipart/form-data; boundary=%s' % BOUNDARY\n    return content_type, body", "entry_point": "formdata_encode", "input": "{}", "output": "('multipart/form-data; boundary=----form-data-boundary-ZmRkNzJkMjUtMjkyMC00', '------form-data-boundary-ZmRkNzJkMjUtMjkyMC00--\\r\\n')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/beetbox/pylastfp/blob/55edfad638bb1c849cbbd7406355385e8b1ea3d8/lastfp/__init__.py#L61-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033312", "code": "def _is_nmrstar(string):\n        \"\"\"Test if input string is in NMR-STAR format.\n\n        :param string: Input string.\n        :type string: :py:class:`str` or :py:class:`bytes`\n        :return: Input string if in NMR-STAR format or False otherwise.\n        :rtype: :py:class:`str` or :py:obj:`False`\n        \"\"\"\n        if (string[0:5] == u\"data_\" and u\"save_\" in string) or (string[0:5] == b\"data_\" and b\"save_\" in string):\n            return string\n        return False", "entry_point": "_is_nmrstar", "input": "'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MoseleyBioinformaticsLab/nmrstarlib/blob/f2adabbca04d5a134ce6ba3211099d1457787ff2/nmrstarlib/nmrstarlib.py#L243-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033313", "code": "def _is_cif(string):\n        \"\"\"Test if input string is in CIF format.\n        \n        :param string: Input string.\n        :type string: :py:class:`str` or :py:class:`bytes`\n        :return: Input string if in CIF format or False otherwise.\n        :rtype: :py:class:`str` or :py:obj:`False` \n        \"\"\"\n        if (string[0:5] == u\"data_\" and u\"_entry.id\" in string) or (string[0:5] == b\"data_\" and b\"_entry.id\" in string):\n            return string\n        return False", "entry_point": "_is_cif", "input": "'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MoseleyBioinformaticsLab/nmrstarlib/blob/f2adabbca04d5a134ce6ba3211099d1457787ff2/nmrstarlib/nmrstarlib.py#L256-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033314", "code": "def underline(text):\n    '''Takes a string, and returns it underscored.'''\n\n    text += \"\\n\"\n    for i in range(len(text)-1):\n        text += \"=\"\n    text += \"\\n\"\n    return text", "entry_point": "underline", "input": "'AbC dEf'", "output": "'AbC dEf\\n=======\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/morngrar/ui/blob/93e160b55ff7d486a53dba7a8c0f2d46e6f95ed9/ui/ui.py#L79-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033315", "code": "def tab(tab_name, element_list=None, section_list=None):\n    \"\"\"\n    Returns a dictionary representing a new tab to display elements.\n    This can be thought of as a simple container for displaying multiple\n    types of information.\n\n    Args:\n        tab_name: The title to display\n        element_list: The list of elements to display. If a single element is\n                      given it will be wrapped in a list.\n        section_list: A list of sections to display.\n\n    Returns:\n        A dictionary with metadata specifying that it is to be rendered\n        as a page containing multiple elements and/or tab.\n    \"\"\"\n    _tab = {\n            'Type': 'Tab',\n            'Title': tab_name,\n            }\n\n    if element_list is not None:\n        if isinstance(element_list, list):\n            _tab['Elements'] = element_list\n        else:\n            _tab['Elements'] = [element_list]\n    if section_list is not None:\n        if isinstance(section_list, list):\n            _tab['Sections'] = section_list\n        else:\n            if 'Elements' not in section_list:\n                _tab['Elements'] = element_list\n            else:\n                _tab['Elements'].append(element_list)\n    return _tab", "entry_point": "tab", "input": "'Hello World', [1, 2, 3], [[1, 2], [3], []]", "output": "{'Type': 'Tab', 'Title': 'Hello World', 'Elements': [1, 2, 3], 'Sections': [[1, 2], [3], []]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LIVVkit/LIVVkit/blob/680120cd437e408673e62e535fc0a246c7fc17db/livvkit/util/elements.py#L92-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033316", "code": "def section(title, element_list):\n    \"\"\"\n    Returns a dictionary representing a new section.  Sections\n    contain a list of elements that are displayed separately from\n    the global elements on the page.\n\n    Args:\n        title: The title of the section to be displayed\n        element_list: The list of elements to display within the section\n\n    Returns:\n        A dictionary with metadata specifying that it is to be rendered as\n        a section containing multiple elements\n    \"\"\"\n    sect = {\n            'Type': 'Section',\n            'Title': title,\n            }\n\n    if isinstance(element_list, list):\n        sect['Elements'] = element_list\n    else:\n        sect['Elements'] = [element_list]\n    return sect", "entry_point": "section", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "{'Type': 'Section', 'Title': ['apple', 'banana', 'cherry'], 'Elements': ['apple', 'banana', 'cherry']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LIVVkit/LIVVkit/blob/680120cd437e408673e62e535fc0a246c7fc17db/livvkit/util/elements.py#L129-L152", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033317", "code": "def get_suggestions(idx, unresolved):\n    \"\"\"\n    Returns suggestions\n    \"\"\"\n    result = {}\n    for u, lines in unresolved.items():\n        paths = idx.get(u)\n        if paths:\n            result[u] = {'paths': paths, 'lineno': lines}\n    return result", "entry_point": "get_suggestions", "input": "(1, 2), {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markbaas/python-iresolve/blob/ba91e37221e91265e4ac5dbc6e8f5cffa955a04f/iresolve.py#L124-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033318", "code": "def merge_dicts(dict1, dict2):\n    \"\"\" Merge two dictionaries and return the result \"\"\"\n    tmp = dict1.copy()\n    tmp.update(dict2)\n    return tmp", "entry_point": "merge_dicts", "input": "{'x': [1, 2], 'y': []}, {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LIVVkit/LIVVkit/blob/680120cd437e408673e62e535fc0a246c7fc17db/livvkit/util/functions.py#L70-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033319", "code": "def dict_get_path(data, path, default=None):\n    \"\"\"\n    Returns the value inside nested structure of data located\n    at period delimited path\n\n    When traversing a list, as long as that list is containing objects of\n    type dict, items in that list will have their \"name\" and \"type\" values\n    tested against the current key in the path.\n\n    Args:\n        data (dict or list): data to traverse\n        path (str): '.' delimited string\n\n    Kwargs:\n        default: value to return if path does not exist\n    \"\"\"\n\n    keys = path.split(\".\")\n    for k in keys:\n        if type(data) == list:\n            found = False\n            for item in data:\n                name = item.get(\"name\", item.get(\"type\"))\n                if name == k:\n                    found = True\n                    data = item\n                    break\n            if not found:\n                return default\n        elif type(data) == dict:\n            if k in data:\n                data = data[k]\n            else:\n                return default\n        else:\n            return default\n    return data", "entry_point": "dict_get_path", "input": "'abc', 'AbC dEf', [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/20c/vodka/blob/9615148ac6560298453704bb5246b35b66b3339c/vodka/util.py#L2-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033320", "code": "def join_cols(cols):\n    \"\"\"Join list of columns into a string for a SQL query\"\"\"\n    return \", \".join([i for i in cols]) if isinstance(cols, (list, tuple, set)) else cols", "entry_point": "join_cols", "input": "['a', 'b', 'c']", "output": "'a, b, c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mrstephenneal/mysql-toolkit/blob/6964f718f4b72eb30f2259adfcfaf3090526c53d/mysql/toolkit/utils.py#L35-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033321", "code": "def resolve_labels(model_label):\n    \"\"\"\n    Seperate model_label into parts.\n    Returns dictionary with app, model and app_model strings.\n    \"\"\"\n    labels = {}\n\n    # Resolve app label.\n    labels['app'] = model_label.split('.')[0]\n\n    # Resolve model label\n    labels['model'] = model_label.split('.')[-1]\n\n    # Resolve module_app_model label.\n    labels['app_model'] = '%s.%s' % (labels['app'], labels['model'])\n\n    return labels", "entry_point": "resolve_labels", "input": "'abc'", "output": "{'app': 'abc', 'model': 'abc', 'app_model': 'abc.abc'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/praekelt/django-order/blob/dcffeb5b28d460872f7d47675c4bfc8a32c807a3/order/utils.py#L152-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033322", "code": "def align_options(options):\n    \"\"\"\n    Indents flags and aligns help texts.\n    \"\"\"\n    l = 0\n    for opt in options:\n        if len(opt[0]) > l:\n            l = len(opt[0])\n    s = []\n    for opt in options:\n        s.append('  {0}{1}  {2}'.format(opt[0], ' ' * (l - len(opt[0])), opt[1]))\n    return '\\n'.join(s)", "entry_point": "align_options", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bast/flanders/blob/792f9eed8511cb553e67a25b6c5ce60fd6ae97bc/cmake/autocmake/generate.py#L172-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033323", "code": "def host(value):\n    \"\"\" Validates that the value is a valid network location \"\"\"\n    if not value:\n        return (True, \"\")\n    try:\n        host,port = value.split(\":\")\n    except ValueError as _:\n        return (False, \"value needs to be <host>:<port>\")\n\n    try:\n        int(port)\n    except ValueError as _:\n        return (False, \"port component of the host address needs to be a number\")\n\n    return (True, \"\")", "entry_point": "host", "input": "[]", "output": "(True, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/20c/vodka/blob/9615148ac6560298453704bb5246b35b66b3339c/vodka/config/validators.py#L19-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033324", "code": "def to_d(l):\n    \"\"\"\n    Converts list of dicts to dict.\n    \"\"\"\n    _d = {}\n    for x in l:\n        for k, v in x.items():\n            _d[k] = v\n    return _d", "entry_point": "to_d", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bast/flanders/blob/792f9eed8511cb553e67a25b6c5ce60fd6ae97bc/cmake/autocmake/extract.py#L17-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033325", "code": "def chop_sequence(sequence, limit_length):\n        \"\"\"Input sequence is divided on smaller non-overlapping sequences with set length.  \"\"\"\n        return [sequence[i:i + limit_length] for i in range(0, len(sequence), limit_length)]", "entry_point": "chop_sequence", "input": "[1, 2, 3], 5", "output": "[[1, 2, 3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michal-stuglik/django-blastplus/blob/4f5e15fb9f8069c3bed5f8fd941c4b9891daad4b/blastplus/features/record.py#L35-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033326", "code": "def unique_list(lst):\n    \"\"\"Make a list unique, retaining order of initial appearance.\"\"\"\n    uniq = []\n    for item in lst:\n        if item not in uniq:\n            uniq.append(item)\n    return uniq", "entry_point": "unique_list", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pudo/banal/blob/528c339be5138458e387a058581cf7d261285447/banal/lists.py#L19-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033327", "code": "def keys_with_value(dictionary, value):\n        \"Returns a subset of keys from the dict with the value supplied.\"\n\n        subset = [key for key in dictionary if dictionary[key] == value]\n\n        return subset", "entry_point": "keys_with_value", "input": "{'a': 1, 'b': 2}, [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/raamana/pyradigm/blob/8ffb7958329c88b09417087b86887a3c92f438c2/pyradigm/pyradigm.py#L527-L532", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033328", "code": "def _join_strings(x):\n    \"\"\"Joins adjacent Str elements found in the element list 'x'.\"\"\"\n    for i in range(len(x)-1):  # Process successive pairs of elements\n        if x[i]['t'] == 'Str' and x[i+1]['t'] == 'Str':\n            x[i]['c'] += x[i+1]['c']\n            del x[i+1]  # In-place deletion of element from list\n            return None  # Forces processing to repeat\n    return True", "entry_point": "_join_strings", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tomduck/pandoc-xnos/blob/df8e162d257a548cea7eebf597efb2c21a1a4ba3/pandocxnos/core.py#L436-L443", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033329", "code": "def compare_values(values0, values1):\n    \"\"\"Compares all the values of a single registry key.\"\"\"\n    values0 = {v[0]: v[1:] for v in values0}\n    values1 = {v[0]: v[1:] for v in values1}\n\n    created = [(k, v[0], v[1]) for k, v in values1.items() if k not in values0]\n    deleted = [(k, v[0], v[1]) for k, v in values0.items() if k not in values1]\n    modified = [(k, v[0], v[1]) for k, v in values0.items()\n                if v != values1.get(k, None)]\n\n    return created, deleted, modified", "entry_point": "compare_values", "input": "[], ['apple', 'banana', 'cherry']", "output": "([('a', 'p', 'p'), ('b', 'a', 'n'), ('c', 'h', 'e')], [], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/noxdafox/vminspect/blob/e685282564877e2d1950f1e09b292f4f4db1dbcd/vminspect/comparator.py#L332-L342", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033330", "code": "def build_channel(namespace, name, user_ids):\n    \"\"\" Creates complete channel information as described here https://fzambia.gitbooks.io/centrifugal/content/server/channels.html. \"\"\"\n    ids = ','.join(map(str, user_ids))\n    return \"{0}:{1}#{2}\".format(namespace, name, ids)", "entry_point": "build_channel", "input": "'abc', 'a,b,c', [[1, 2], [3], []]", "output": "'abc:a,b,c#[1, 2],[3],[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/raphaelgyory/django-rest-messaging-centrifugo/blob/f44022cd9fc83e84ab573fe8a8385c85f6e77380/rest_messaging_centrifugo/utils.py#L8-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033331", "code": "def binboolflip(item):\n    \"\"\"\n    Convert 0 or 1 to False or True (or vice versa).\n    The converter works as follows:\n\n    - 0 > False\n    - False > 0\n    - 1 > True\n    - True > 1\n\n    :type item: integer or boolean\n    :param item: The item to convert.\n\n    >>> binboolflip(0)\n    False\n\n    >>> binboolflip(False)\n    0\n\n    >>> binboolflip(1)\n    True\n\n    >>> binboolflip(True)\n    1\n\n    >>> binboolflip(\"foo\")\n    Traceback (most recent call last):\n      ...\n    ValueError: Invalid item specified.\n    \"\"\"\n\n    if item in [0, False, 1, True]:\n        return int(item) if isinstance(item, bool) else bool(item)\n\n    # Raise a warning\n    raise ValueError(\"Invalid item specified.\")", "entry_point": "binboolflip", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L200-L235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033332", "code": "def amountdiv(number, minnum, maxnum):\n    \"\"\"\n    Get the amount of numbers divisable by a number.\n\n    :type number: number\n    :param number: The number to use.\n\n    :type minnum: integer\n    :param minnum: The minimum number to check.\n\n    :type maxnum: integer\n    :param maxnum: The maximum number to check.\n\n    >>> amountdiv(20, 1, 15)\n    5\n    \"\"\"\n\n    # Set the amount to 0\n    amount = 0\n\n    # For each item in range of minimum and maximum\n    for i in range(minnum, maxnum + 1):\n        # If the remainder of the divided number is 0\n        if number % i == 0:\n            # Add 1 to the total amount\n            amount += 1\n\n    # Return the result\n    return amount", "entry_point": "amountdiv", "input": "-3, 5, 5", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1200-L1228", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033333", "code": "def posnegtoggle(number):\n    \"\"\"\n    Toggle a number between positive and negative.\n    The converter works as follows:\n\n    - 1 > -1\n    - -1 > 1\n    - 0 > 0\n\n    :type number: number\n    :param number: The number to toggle.\n    \"\"\"\n    if bool(number > 0):\n        return number - number * 2\n    elif bool(number < 0):\n        return number + abs(number) * 2\n    elif bool(number == 0):\n        return number", "entry_point": "posnegtoggle", "input": "10", "output": "-10", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1354-L1371", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033334", "code": "def factors(number):\n    \"\"\"\n    Find all of the factors of a number and return it as a list.\n\n    :type number: integer\n    :param number: The number to find the factors for.\n    \"\"\"\n\n    if not (isinstance(number, int)):\n        raise TypeError(\n            \"Incorrect number type provided. Only integers are accepted.\")\n\n    factors = []\n    for i in range(1, number + 1):\n        if number % i == 0:\n            factors.append(i)\n    return factors", "entry_point": "factors", "input": "0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1435-L1451", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033335", "code": "def isfib(number):\n    \"\"\"\n    Check if a number is in the Fibonacci sequence.\n\n    :type number: integer\n    :param number: Number to check\n    \"\"\"\n\n    num1 = 1\n    num2 = 1\n    while True:\n        if num2 < number:\n            tempnum = num2\n            num2 += num1\n            num1 = tempnum\n        elif num2 == number:\n            return True\n        else:\n            return False", "entry_point": "isfib", "input": "2", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1538-L1556", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033336", "code": "def isprime(number):\n    \"\"\"\n    Check if a number is a prime number\n\n    :type number: integer\n    :param number: The number to check\n    \"\"\"\n\n    if number == 1:\n        return False\n    for i in range(2, int(number**0.5) + 1):\n        if number % i == 0:\n            return False\n    return True", "entry_point": "isprime", "input": "1", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1559-L1572", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033337", "code": "def lcm(num1, num2):\n    \"\"\"\n    Find the lowest common multiple of 2 numbers\n\n    :type num1: number\n    :param num1: The first number to find the lcm for\n\n    :type num2: number\n    :param num2: The second number to find the lcm for\n    \"\"\"\n\n    if num1 > num2:\n        bigger = num1\n    else:\n        bigger = num2\n    while True:\n        if bigger % num1 == 0 and bigger % num2 == 0:\n            return bigger\n        bigger += 1", "entry_point": "lcm", "input": "1, 7", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1673-L1691", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033338", "code": "def hcf(num1, num2):\n    \"\"\"\n    Find the highest common factor of 2 numbers\n\n    :type num1: number\n    :param num1: The first number to find the hcf for\n\n    :type num2: number\n    :param num2: The second number to find the hcf for\n    \"\"\"\n\n    if num1 > num2:\n        smaller = num2\n    else:\n        smaller = num1\n    for i in range(1, smaller + 1):\n        if ((num1 % i == 0) and (num2 % i == 0)):\n            return i", "entry_point": "hcf", "input": "2, 7", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Richienb/quilt/blob/4a659cac66f5286ad046d54a12fd850be5606643/src/quilt_lang/__init__.py#L1694-L1711", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033339", "code": "def unique(transactions):\n    \"\"\" Remove any duplicate entries. \"\"\"\n    seen = set()\n    # TODO: Handle comments\n    return [x for x in transactions if not (x in seen or seen.add(x))]", "entry_point": "unique", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pulseenergy/vacation/blob/23c6122590852a5e55d84d366143469af6602839/vacation/transactions.py#L78-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033340", "code": "def collect_manifest_dependencies(manifest_data, lockfile_data):\n    \"\"\"Convert the manifest format to the dependencies schema\"\"\"\n    output = {}\n\n    for dependencyName, dependencyConstraint in manifest_data.items():\n        output[dependencyName] = {\n            # identifies where this dependency is installed from\n            'source': 'example-package-manager',\n            # the constraint that the user is using (i.e. \"> 1.0.0\")\n            'constraint': dependencyConstraint,\n            # all available versions above and outside of their constraint\n            # - usually you would need to use the package manager lib or API\n            #   to get this information (we just fake it here)\n            'available': [\n                {'name': '2.0.0'},\n            ],\n        }\n\n    return output", "entry_point": "collect_manifest_dependencies", "input": "{'x': [1, 2], 'y': []}, 'Hello World'", "output": "{'x': {'source': 'example-package-manager', 'constraint': [1, 2], 'available': [{'name': '2.0.0'}]}, 'y': {'source': 'example-package-manager', 'constraint': [], 'available': [{'name': '2.0.0'}]}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dependencies-io/cli/blob/d8ae97343c48a61d6614d3e8af6a981b4cfb1bcb/dependencies_cli/project_template/{{cookiecutter.name}}/src/collect.py#L97-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033341", "code": "def collect_lockfile_dependencies(lockfile_data):\n    \"\"\"Convert the lockfile format to the dependencies schema\"\"\"\n    output = {}\n\n    for dependencyName, installedVersion in lockfile_data.items():\n        output[dependencyName] = {\n            'source': 'example-package-manager',\n            'installed': {'name': installedVersion},\n        }\n\n    return output", "entry_point": "collect_lockfile_dependencies", "input": "{'a': 1, 'b': 2}", "output": "{'a': {'source': 'example-package-manager', 'installed': {'name': 1}}, 'b': {'source': 'example-package-manager', 'installed': {'name': 2}}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dependencies-io/cli/blob/d8ae97343c48a61d6614d3e8af6a981b4cfb1bcb/dependencies_cli/project_template/{{cookiecutter.name}}/src/collect.py#L118-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033342", "code": "def _process_cell(i, state, finite=False):\n    \"\"\"Process 3 cells and return a value from 0 to 7. \"\"\"\n    op_1 = state[i - 1]\n    op_2 = state[i]\n    if i == len(state) - 1:\n        if finite:\n            op_3 = state[0]\n        else:\n            op_3 = 0\n    else:\n        op_3 = state[i + 1]\n    result = 0\n    for i, val in enumerate([op_3, op_2, op_1]):\n        if val:\n            result += 2**i\n    return result", "entry_point": "_process_cell", "input": "3, [5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/randomdude999/rule_n/blob/4d8d72e71a9f1eaacb193d5b4383fba9f8cf67a6/rule_n.py#L73-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033343", "code": "def _remove_lead_trail_false(bool_list):\n    \"\"\"Remove leading and trailing false's from a list\"\"\"\n    # The internet can be a wonderful place...\n    for i in (0, -1):\n        while bool_list and not bool_list[i]:\n            bool_list.pop(i)\n    return bool_list", "entry_point": "_remove_lead_trail_false", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/randomdude999/rule_n/blob/4d8d72e71a9f1eaacb193d5b4383fba9f8cf67a6/rule_n.py#L91-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033344", "code": "def _crop_list_to_size(l, size):\n    \"\"\"Make a list a certain size\"\"\"\n    for x in range(size - len(l)):\n        l.append(False)\n    for x in range(len(l) - size):\n        l.pop()\n    return l", "entry_point": "_crop_list_to_size", "input": "[5, 3, 1, 4], 0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/randomdude999/rule_n/blob/4d8d72e71a9f1eaacb193d5b4383fba9f8cf67a6/rule_n.py#L100-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033345", "code": "def hexdump(src, length=16, sep='.'):\n    \"\"\"\n    Returns src in hex dump.\n    From https://gist.github.com/ImmortalPC/c340564823f283fe530b\n\n    :param length: Nb Bytes by row.\n    :param sep: For the text part, sep will be used for non ASCII char.\n    :return: The hexdump\n    \"\"\"\n    result = []\n\n    for i in range(0, len(src), length):\n        sub_src = src[i:i + length]\n        hexa = ''\n        for h in range(0, len(sub_src)):\n            if h == length / 2:\n                hexa += ' '\n            h = sub_src[h]\n            if not isinstance(h, int):\n                h = ord(h)\n            h = hex(h).replace('0x', '')\n            if len(h) == 1:\n                h = '0' + h\n            hexa += h + ' '\n\n        hexa = hexa.strip(' ')\n        text = ''\n        for c in sub_src:\n            if not isinstance(c, int):\n                c = ord(c)\n            if 0x20 <= c < 0x7F:\n                text += chr(c)\n            else:\n                text += sep\n        result.append(('%08X:  %-' + str(length * (2 + 1) + 1) + 's  |%s|')\n                      % (i, hexa, text))\n\n    return '\\n'.join(result)", "entry_point": "hexdump", "input": "[1, 2, 3], 2, 'Hello World'", "output": "'00000000:  01  02   |Hello WorldHello World|\\n00000002:  03       |Hello World|'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cohorte/cohorte-herald/blob/bb3445d0031c8b3abad71e6219cc559b49faa3ee/python/herald/utilities/mcast_spy.py#L49-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033346", "code": "def head_tail_middle(src):\n    \"\"\"Returns a tuple consisting of the head of a enumerable, the middle\n    as a list and the tail of the enumerable. If the enumerable is 1 item, the\n    middle will be empty and the tail will be None. \n\n    >>> head_tail_middle([1, 2, 3, 4])\n    1, [2, 3], 4\n    \"\"\"\n\n    if len(src) == 0:\n        return None, [], None\n\n    if len(src) == 1:\n        return src[0], [], None\n\n    if len(src) == 2:\n        return src[0], [], src[1]\n\n    return src[0], src[1:-1], src[-1]", "entry_point": "head_tail_middle", "input": "[1, 2, 3]", "output": "(1, [2], 3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltrudeau/screwdriver/blob/6b70b545c5df1e6ac5a78367e47d63e3be1b57ba/screwdriver.py#L101-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033347", "code": "def _value_properties_are_referenced(val):\n    \"\"\"\n    val is a dictionary\n    :param val:\n    :return: True/False\n    \"\"\"\n    if ((u'properties' in val.keys()) and\n            (u'$ref' in val['properties'].keys())):\n        return True\n    return False", "entry_point": "_value_properties_are_referenced", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/salesking/salesking_python_sdk/blob/0d5a95c5ee4e16a85562ceaf67bb11b55e47ee4c/salesking/utils/schema.py#L6-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033348", "code": "def _has_desired_permit(permits, acategory, astatus):\n    \"\"\"\n    return True if permits has one whose\n    category_code and status_code match with the given ones\n    \"\"\"\n    if permits is None:\n        return False\n    for permit in permits:\n        if permit.category_code == acategory and\\\n           permit.status_code == astatus:\n            return True\n    return False", "entry_point": "_has_desired_permit", "input": "[], ['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uw-it-aca/uw-restclients-uwnetid/blob/58c78b564f9c920a8f8fd408eec959ddd5605b0b/uw_uwnetid/subscription_60.py#L35-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033349", "code": "def _format_response(rows, fields, unique_col_names):\n    \"\"\"This function will look at the data column of rows and extract the specified fields. It\n    will also dedup changes where the specified fields have not changed. The list of rows should\n    be ordered by the compound primary key which versioning pivots around and be in ascending\n    version order.\n\n    This function will return a list of dictionaries where each dictionary has the following\n    schema:\n        {\n            'updated_at': timestamp of the change,\n            'version': version number for the change,\n            'data': a nested dictionary containing all keys specified in fields and values\n                corresponding to values in the user table.\n        }\n\n    Note that some versions may be omitted in the output for the same key if the specified fields\n    were not changed between versions.\n\n    :param rows: a list of dictionaries representing rows from the ArchiveTable.\n    :param fields: a list of strings of fields to be extracted from the archived row.\n    \"\"\"\n    output = []\n    old_id = None\n    for row in rows:\n        id_ = {k: row[k] for k in unique_col_names}\n        formatted = {k: row[k] for k in row if k != 'data'}\n        if id_ != old_id:  # new unique versioned row\n            data = row['data']\n            formatted['data'] = {k: data.get(k) for k in fields}\n            output.append(formatted)\n        else:\n            data = row['data']\n            pruned_data = {k: data.get(k) for k in fields}\n            if (\n                pruned_data != output[-1]['data'] or\n                row['deleted'] != output[-1]['deleted']\n            ):\n                formatted['data'] = pruned_data\n                output.append(formatted)\n        old_id = id_\n    return output", "entry_point": "_format_response", "input": "[], ['a', 'b', 'c'], 'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NerdWalletOSS/savage/blob/54f64ac1c912528710365107952967d31d56e60d/src/savage/api/data.py#L104-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033350", "code": "def _get_limit_and_offset(page, page_size):\n    \"\"\"Returns a 0-indexed offset and limit based on page and page_size for a MySQL query.\n    \"\"\"\n    if page < 1:\n        raise ValueError('page must be >= 1')\n    limit = page_size\n    offset = (page - 1) * page_size\n    return limit, offset", "entry_point": "_get_limit_and_offset", "input": "5, 'walnut thistle harbour'", "output": "('walnut thistle harbour', 'walnut thistle harbourwalnut thistle harbourwalnut thistle harbourwalnut thistle harbour')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NerdWalletOSS/savage/blob/54f64ac1c912528710365107952967d31d56e60d/src/savage/api/data.py#L269-L276", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033351", "code": "def cluster_files(file_dict):\n    '''takes output from :meth:`scan_dir` and organizes into lists of files with the same tags\n\n    returns a dictionary where values are a tuple of the unique tag combination and values contain\n    another dictionary with the keys ``info`` containing the original tag dict and ``files`` containing\n    a list of files that match'''\n    return_dict = {}\n    for filename in file_dict:\n        info_dict = dict(file_dict[filename])\n        if 'md5' in info_dict:\n            del(info_dict['md5'])\n        dict_key = tuple(sorted([file_dict[filename][x] for x in info_dict]))\n        if dict_key not in return_dict:\n            return_dict[dict_key] = {'info':info_dict,'files':[]}\n        return_dict[dict_key]['files'].append(filename)\n    return return_dict", "entry_point": "cluster_files", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/azraq27/neural/blob/fe91bfeecbf73ad99708cf5dca66cb61fcd529f5/neural/dicom.py#L168-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033352", "code": "def _generate_mark_code(rule_name):\n    \"\"\"Generates a two digit string based on a provided string\n\n    Args:\n        rule_name (str): A configured rule name 'pytest_mark3'.\n\n    Returns:\n        str: A two digit code based on the provided string '03'\n    \"\"\"\n    code = ''.join([i for i in str(rule_name) if i.isdigit()])\n    code = code.zfill(2)\n    return code", "entry_point": "_generate_mark_code", "input": "'  padded  '", "output": "'00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcbops/flake8-filename/blob/5718d4af394c318d376de7434193543e0da45651/flake8_filename/rules.py#L7-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033353", "code": "def _resolve_name(name, package, level):\n    \"\"\"Resolve a relative module name to an absolute one.\"\"\"\n    bits = package.rsplit('.', level - 1)\n    if len(bits) < level:\n        raise ValueError('attempted relative import beyond top-level package')\n    base = bits[0]\n    return '{}.{}'.format(base, name) if name else base", "entry_point": "_resolve_name", "input": "(1, 2), 'AbC dEf', True", "output": "'AbC dEf.(1, 2)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/asmodehn/filefinder2/blob/3f0b211ce11a34562e2a2160e039ae5290b68d6b/filefinder2/util.py#L23-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033354", "code": "def to_dict_formatter(row, cursor):\n    \"\"\" Take a row and use the column names from cursor to turn the row into a\n    dictionary.\n\n    Note: converts column names to lower-case!\n\n    :param row: one database row, sequence of column values\n    :type row: (value, ...)\n    :param cursor: the cursor which was used to make the query\n    :type cursor: DB-API cursor object\n    \"\"\"\n    # Empty row? Return.\n    if not row:\n        return row\n    # No cursor? Raise runtime error.\n    if cursor is None or cursor.description is None:\n        raise RuntimeError(\"No DB-API cursor or description available.\")\n\n    # Give each value the appropriate column name within in the resulting\n    # dictionary.\n    column_names = (d[0] for d in cursor.description)  # 0 is the name\n    return {name: value for value, name in zip(row, column_names)}", "entry_point": "to_dict_formatter", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/merry-bits/DBQuery/blob/5f46dc94e2721129f8a799b5f613373e6cd9cb73/src/dbquery/query.py#L14-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033355", "code": "def _clamp_value(value, minimum, maximum):\n    \"\"\"\n    Clamp a value to fit between a minimum and a maximum.\n\n    * If ``value`` is between ``minimum`` and ``maximum``, return ``value``\n    * If ``value`` is below ``minimum``, return ``minimum``\n    * If ``value is above ``maximum``, return ``maximum``\n\n    Args:\n        value (float or int): The number to clamp\n        minimum (float or int): The lowest allowed return value\n        maximum (float or int): The highest allowed return value\n\n    Returns:\n        float or int: the clamped value\n\n    Raises:\n        ValueError: if maximum < minimum\n\n    Example:\n        >>> _clamp_value(3, 5, 10)\n        5\n        >>> _clamp_value(11, 5, 10)\n        10\n        >>> _clamp_value(8, 5, 10)\n        8\n    \"\"\"\n    if maximum < minimum:\n        raise ValueError\n    if value < minimum:\n        return minimum\n    elif value > maximum:\n        return maximum\n    else:\n        return value", "entry_point": "_clamp_value", "input": "[], [5, 3, 1, 4], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ajyoon/blur/blob/25fcf083af112bb003956a7a7e1c6ff7d8fef279/blur/rand.py#L106-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033356", "code": "def _is_valid_options_weights_list(value):\n    '''Check whether ``values`` is a valid argument for ``weighted_choice``.'''\n    return ((isinstance(value, list)) and\n            len(value) > 1 and\n            (all(isinstance(opt, tuple) and\n                 len(opt) == 2 and\n                 isinstance(opt[1], (int, float))\n                 for opt in value)))", "entry_point": "_is_valid_options_weights_list", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ajyoon/blur/blob/25fcf083af112bb003956a7a7e1c6ff7d8fef279/blur/rand.py#L164-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033357", "code": "def get_wordlist(stanzas):\n    \"\"\"\n    Get an iterable of all final words in all stanzas\n    \"\"\"\n    return sorted(list(set().union(*[stanza.words for stanza in stanzas])))", "entry_point": "get_wordlist", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jvamvas/rhymediscovery/blob/b76509c98554b12efa06fe9ab557cca5fa5e4a79/rhymediscovery/find_schemes.py#L86-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033358", "code": "def basic_word_sim(word1, word2):\n    \"\"\"\n    Simple measure of similarity: Number of letters in common / max length\n    \"\"\"\n    return sum([1 for c in word1 if c in word2]) / max(len(word1), len(word2))", "entry_point": "basic_word_sim", "input": "'a,b,c', '  padded  '", "output": "0.1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jvamvas/rhymediscovery/blob/b76509c98554b12efa06fe9ab557cca5fa5e4a79/rhymediscovery/find_schemes.py#L134-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033359", "code": "def parsePermission3Char(permission):\n    \"\"\"\n    'rwx' \u5f62\u5f0f\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u6587\u5b57\u5217 permission \u30928\u9032\u6570\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\n\n    :return:\n    :rtype: int\n    \"\"\"\n\n    if len(permission) != 3:\n        raise ValueError(permission)\n\n    permission_int = 0\n    if permission[0] == \"r\":\n        permission_int += 4\n    if permission[1] == \"w\":\n        permission_int += 2\n    if permission[2] == \"x\":\n        permission_int += 1\n\n    return permission_int", "entry_point": "parsePermission3Char", "input": "[[1, 2], [3], []]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thombashi/thutils/blob/9eba767cfc26b38cd66b83b99aee0c31b8b90dec/thutils/gfile.py#L390-L409", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033360", "code": "def parse_sysctl(text):\n    ''' Parse sysctl output. '''\n    lines = text.splitlines()\n    results = {}\n    for line in lines:\n        key, _, value = line.decode('ascii').partition(': ')\n\n        if key == 'hw.memsize':\n            value = int(value)\n\n        elif key == 'vm.swapusage':\n            values = value.split()[2::3]            # every third token\n            su_unit = values[0][-1].lower()         # get unit, 'M'\n            PAGESIZE = 1024\n            if su_unit == 'm':\n                PAGESIZE = 1024 * 1024\n\n            value = [ (float(val[:-1]) * PAGESIZE) for val in values ]\n\n        results[key] = value\n    return results", "entry_point": "parse_sysctl", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mixmastamyk/fr/blob/f96df8ed7210a033b9e711bbed768d4116213bfb/fr/darwin.py#L155-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033361", "code": "def find_contig_distribution(contig_lengths_dict):\n    \"\"\"\n    Determine the frequency of different contig size ranges for each strain\n    :param contig_lengths_dict:\n    :return: contig_len_dist_dict: dictionary of strain name: tuple of contig size range frequencies\n    \"\"\"\n    # Initialise the dictionary\n    contig_len_dist_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        # Initialise integers to store the number of contigs that fall into the different bin sizes\n        over_1000000 = 0\n        over_500000 = 0\n        over_100000 = 0\n        over_50000 = 0\n        over_10000 = 0\n        over_5000 = 0\n        other = 0\n        for contig_length in contig_lengths:\n            # Depending on the size of the contig, increment the appropriate integer\n            if contig_length > 1000000:\n                over_1000000 += 1\n            elif contig_length > 500000:\n                over_500000 += 1\n            elif contig_length > 100000:\n                over_100000 += 1\n            elif contig_length > 50000:\n                over_50000 += 1\n            elif contig_length > 10000:\n                over_10000 += 1\n            elif contig_length > 5000:\n                over_5000 += 1\n            else:\n                other += 1\n        # Populate the dictionary with a tuple of each of the size range frequencies\n        contig_len_dist_dict[file_name] = (over_1000000,\n                                           over_500000,\n                                           over_100000,\n                                           over_50000,\n                                           over_10000,\n                                           over_5000,\n                                           other)\n    return contig_len_dist_dict", "entry_point": "find_contig_distribution", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': (0, 0, 0, 0, 0, 0, 2), 'y': (0, 0, 0, 0, 0, 0, 0)}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L159-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033362", "code": "def find_largest_contig(contig_lengths_dict):\n    \"\"\"\n    Determine the largest contig for each strain\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :return: longest_contig_dict: dictionary of strain name: longest contig\n    \"\"\"\n    # Initialise the dictionary\n    longest_contig_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        # As the list is sorted in descending order, the largest contig is the first entry in the list\n        longest_contig_dict[file_name] = contig_lengths[0]\n    return longest_contig_dict", "entry_point": "find_largest_contig", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L203-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033363", "code": "def find_genome_length(contig_lengths_dict):\n    \"\"\"\n    Determine the total length of all the contigs for each strain\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :return: genome_length_dict: dictionary of strain name: total genome length\n    \"\"\"\n    # Initialise the dictionary\n    genome_length_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        # Use the sum() method to add all the contig lengths in the list\n        genome_length_dict[file_name] = sum(contig_lengths)\n    return genome_length_dict", "entry_point": "find_genome_length", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L217-L228", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033364", "code": "def find_num_contigs(contig_lengths_dict):\n    \"\"\"\n    Count the total number of contigs for each strain\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :return: num_contigs_dict: dictionary of strain name: total number of contigs\n    \"\"\"\n    # Initialise the dictionary\n    num_contigs_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        # Use the len() method to count the number of entries in the list\n        num_contigs_dict[file_name] = len(contig_lengths)\n    return num_contigs_dict", "entry_point": "find_num_contigs", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': 2, 'y': 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L231-L242", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033365", "code": "def find_n50(contig_lengths_dict, genome_length_dict):\n    \"\"\"\n    Calculate the N50 for each strain. N50 is defined as the largest contig such that at least half of the total\n    genome size is contained in contigs equal to or larger than this contig\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :param genome_length_dict: dictionary of strain name: total genome length\n    :return: n50_dict: dictionary of strain name: N50\n    \"\"\"\n    # Initialise the dictionary\n    n50_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        # Initialise a variable to store a running total of contig lengths\n        currentlength = 0\n        for contig_length in contig_lengths:\n            # Increment the current length with the length of the current contig\n            currentlength += contig_length\n            # If the current length is now greater than the total genome / 2, the current contig length is the N50\n            if currentlength >= genome_length_dict[file_name] * 0.5:\n                # Populate the dictionary, and break the loop\n                n50_dict[file_name] = contig_length\n                break\n    return n50_dict", "entry_point": "find_n50", "input": "{}, {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L245-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033366", "code": "def find_n75(contig_lengths_dict, genome_length_dict):\n    \"\"\"\n    Calculate the N75 for each strain. N75 is defined as the largest contig such that at least 3/4 of the total\n    genome size is contained in contigs equal to or larger than this contig\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :param genome_length_dict: dictionary of strain name: total genome length\n    :return: n75_dict: dictionary of strain name: N75\n    \"\"\"\n    # Initialise the dictionary\n    n75_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        currentlength = 0\n        for contig_length in contig_lengths:\n            currentlength += contig_length\n            # If the current length is now greater than the 3/4 of the total genome length, the current contig length\n            # is the N75\n            if currentlength >= genome_length_dict[file_name] * 0.75:\n                n75_dict[file_name] = contig_length\n                break\n    return n75_dict", "entry_point": "find_n75", "input": "{}, {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L269-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033367", "code": "def find_n90(contig_lengths_dict, genome_length_dict):\n    \"\"\"\n    Calculate the N90 for each strain. N90 is defined as the largest contig such that at least 9/10 of the total\n    genome size is contained in contigs equal to or larger than this contig\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :param genome_length_dict: dictionary of strain name: total genome length\n    :return: n75_dict: dictionary of strain name: N90\n    \"\"\"\n    # Initialise the dictionary\n    n90_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        currentlength = 0\n        for contig_length in contig_lengths:\n            currentlength += contig_length\n            # If the current length is now greater than the 3/4 of the total genome length, the current contig length\n            # is the N75\n            if currentlength >= genome_length_dict[file_name] * 0.95:\n                n90_dict[file_name] = contig_length\n                break\n    return n90_dict", "entry_point": "find_n90", "input": "{}, {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L291-L310", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033368", "code": "def find_l50(contig_lengths_dict, genome_length_dict):\n    \"\"\"\n    Calculate the L50 for each strain. L50 is defined as the number of contigs required to achieve the N50\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :param genome_length_dict: dictionary of strain name: total genome length\n    :return: l50_dict: dictionary of strain name: L50\n    \"\"\"\n    # Initialise the dictionary\n    l50_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        currentlength = 0\n        # Initialise a variable to count how many contigs have been added to the currentlength variable\n        currentcontig = 0\n        for contig_length in contig_lengths:\n            currentlength += contig_length\n            # Increment :currentcontig each time a contig is added to the current length\n            currentcontig += 1\n            # Same logic as with the N50, but the contig number is added instead of the length of the contig\n            if currentlength >= genome_length_dict[file_name] * 0.5:\n                l50_dict[file_name] = currentcontig\n                break\n    return l50_dict", "entry_point": "find_l50", "input": "{}, {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L313-L334", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033369", "code": "def find_l75(contig_lengths_dict, genome_length_dict):\n    \"\"\"\n    Calculate the L50 for each strain. L75 is defined as the number of contigs required to achieve the N75\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :param genome_length_dict: dictionary of strain name: total genome length\n    :return: l50_dict: dictionary of strain name: L75\n    \"\"\"\n    # Initialise the dictionary\n    l75_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        currentlength = 0\n        currentcontig = 0\n        for contig_length in contig_lengths:\n            currentlength += contig_length\n            currentcontig += 1\n            # Same logic as with the L75, but the contig number is added instead of the length of the contig\n            if currentlength >= genome_length_dict[file_name] * 0.75:\n                l75_dict[file_name] = currentcontig\n                break\n    return l75_dict", "entry_point": "find_l75", "input": "{}, {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L337-L356", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033370", "code": "def find_l90(contig_lengths_dict, genome_length_dict):\n    \"\"\"\n    Calculate the L90 for each strain. L90 is defined as the number of contigs required to achieve the N90\n    :param contig_lengths_dict: dictionary of strain name: reverse-sorted list of all contig lengths\n    :param genome_length_dict: dictionary of strain name: total genome length\n    :return: l90_dict: dictionary of strain name: L90\n    \"\"\"\n    # Initialise the dictionary\n    l90_dict = dict()\n    for file_name, contig_lengths in contig_lengths_dict.items():\n        currentlength = 0\n        # Initialise a variable to count how many contigs have been added to the currentlength variable\n        currentcontig = 0\n        for contig_length in contig_lengths:\n            currentlength += contig_length\n            # Increment :currentcontig each time a contig is added to the current length\n            currentcontig += 1\n            # Same logic as with the N50, but the contig number is added instead of the length of the contig\n            if currentlength >= genome_length_dict[file_name] * 0.9:\n                l90_dict[file_name] = currentcontig\n                break\n    return l90_dict", "entry_point": "find_l90", "input": "{}, {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-LOC-Bioinformatics/GenomeQAML/blob/2953e574c185afab23075641da4ce5392bc003e9/genomeqaml/extract_features.py#L359-L380", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033371", "code": "def search_mergedcell_value(xl_sheet, merged_range):\n    \"\"\"\n    Search for a value in merged_range cells.\n    \"\"\"\n    for search_row_idx in range(merged_range[0], merged_range[1]):\n        for search_col_idx in range(merged_range[2], merged_range[3]):\n            if xl_sheet.cell(search_row_idx, search_col_idx).value:\n                return xl_sheet.cell(search_row_idx, search_col_idx)\n    return False", "entry_point": "search_mergedcell_value", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Datary/scrapbag/blob/3a4f9824ab6fe21121214ba9963690618da2c9de/scrapbag/csvs.py#L196-L204", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033372", "code": "def human_to_boolean(human):\n    '''Convert a boolean string ('Yes' or 'No') to True or False.\n\n    PARAMETERS\n    ----------\n    human   : list\n              a list containing the \"human\" boolean string to be converted to\n              a Python boolean object. If a non-list is passed, or if the list\n              is empty, None will be returned. Only the first element of the\n              list will be used. Anything other than 'Yes' will be considered\n              False.\n    '''\n    if not isinstance(human, list) or len(human) == 0:\n        return None\n    if human[0].lower() == 'yes':\n        return True\n    return False", "entry_point": "human_to_boolean", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thejunglejane/datums/blob/2250b365e37ba952c2426edc615c1487afabae6e/datums/pipeline/codec.py#L6-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033373", "code": "def post_process(table, post_processors):\n    \"\"\"Applies the list of post processing methods if any\"\"\"\n    table_result = table\n    for processor in post_processors:\n        table_result = processor(table_result)\n    return table_result", "entry_point": "post_process", "input": "{'x': [1, 2], 'y': []}, []", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ohenrik/tabs/blob/039ced6c5612ecdd551aeaac63789862aba05711/tabs/tables.py#L8-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033374", "code": "def _remove_trailing_spaces(text: str) -> str:\n        \"\"\"\n        Remove trailing spaces and tabs\n\n        :param text: Text to clean up\n        :return:\n        \"\"\"\n        clean_text = str()\n\n        for line in text.splitlines(True):\n            # remove trailing spaces (0x20) and tabs (0x09)\n            clean_text += line.rstrip(\"\\x09\\x20\")\n\n        return clean_text", "entry_point": "_remove_trailing_spaces", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/duniter/duniter-python-api/blob/3a1e5d61a2f72f5afaf29d010c6cf4dff3648165/duniterpy/key/ascii_armor.py#L133-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033375", "code": "def fbpe_key(code):\n    \"\"\"\n    input:\n        'S0102-67202009000300001'\n    output:\n        'S0102-6720(09)000300001'\n    \"\"\"\n\n    begin = code[0:10]\n    year = code[12:14]\n    end = code[14:]\n\n    return '%s(%s)%s' % (begin, year, end)", "entry_point": "fbpe_key", "input": "[5, 3, 1, 4]", "output": "'[5, 3, 1, 4]([])[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scieloorg/processing/blob/629b50b45ba7a176651cd3bfcdb441dab6fddfcc/accesses/dumpdata.py#L72-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033376", "code": "def format_duration(secs):\n    \"\"\"\n    Format a duration in seconds as minutes and seconds.\n    \"\"\"\n    secs = int(secs)\n\n    if abs(secs) > 60:\n        mins = abs(secs) / 60\n        secs = abs(secs) - (mins * 60)\n\n        return '%s%im %02is' % ('-' if secs < 0 else '', mins, secs)\n\n    return '%is' % secs", "entry_point": "format_duration", "input": "3.25", "output": "'3s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onyxfish/clan/blob/415ddd027ea81013f2d62d75aec6da70703df49c/clan/utils.py#L53-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033377", "code": "def select_regexp_char(char):\n    \"\"\"\n    Select correct regex depending the char\n    \"\"\"\n    regexp = '{}'.format(char)\n\n    if not isinstance(char, str) and not isinstance(char, int):\n        regexp = ''\n\n    if isinstance(char, str) and not char.isalpha() and not char.isdigit():\n        regexp = r\"\\{}\".format(char)\n\n    return regexp", "entry_point": "select_regexp_char", "input": "['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Datary/scrapbag/blob/3a4f9824ab6fe21121214ba9963690618da2c9de/scrapbag/strings.py#L51-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033378", "code": "def pluralize(data_type):\n    \"\"\"\n    adds s to the data type or the correct english plural form\n    \"\"\"\n    known = {\n             u\"address\": u\"addresses\", \n             u\"company\": u\"companies\"\n    }\n    if data_type in known.keys():\n        return known[data_type]\n    else:\n        return u\"%ss\" % data_type", "entry_point": "pluralize", "input": "2.0", "output": "'2.0s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/salesking/salesking_python_sdk/blob/0d5a95c5ee4e16a85562ceaf67bb11b55e47ee4c/salesking/utils/helpers.py#L13-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033379", "code": "def remove_properties_containing_None(properties_dict):\n    \"\"\"\n    removes keys from a dict those values == None\n    json schema validation might fail if they are set and\n    the type or format of the property does not match\n    \"\"\"\n    # remove empty properties - as validations may fail\n    new_dict  = dict()\n    for key in properties_dict.keys():\n        value = properties_dict[key]\n        if value is not None:\n            new_dict[key] = value\n    return new_dict", "entry_point": "remove_properties_containing_None", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/salesking/salesking_python_sdk/blob/0d5a95c5ee4e16a85562ceaf67bb11b55e47ee4c/salesking/utils/helpers.py#L26-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033380", "code": "def get_dimension_array(array):\n    \"\"\"\n    Get dimension of an array getting the number of rows and the max num of\n    columns.\n    \"\"\"\n    if all(isinstance(el, list) for el in array):\n        result = [len(array), len(max([x for x in array], key=len,))]\n\n    # elif array and isinstance(array, list):\n    else:\n        result = [len(array), 1]\n\n    return result", "entry_point": "get_dimension_array", "input": "[1, 2, 3]", "output": "[3, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Datary/scrapbag/blob/3a4f9824ab6fe21121214ba9963690618da2c9de/scrapbag/collections.py#L462-L474", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033381", "code": "def reduce_base(amount: int, base: int) -> tuple:\n    \"\"\"\n    Compute the reduced base of the given parameters\n\n    :param amount: the amount value\n    :param base: current base value\n\n    :return: tuple containing computed (amount, base)\n    \"\"\"\n    if amount == 0:\n        return 0, 0\n\n    next_amount = amount\n    next_base = base\n    next_amount_is_integer = True\n    while next_amount_is_integer:\n        amount = next_amount\n        base = next_base\n        if next_amount % 10 == 0:\n            next_amount = int(next_amount / 10)\n            next_base += 1\n        else:\n            next_amount_is_integer = False\n\n    return int(amount), int(base)", "entry_point": "reduce_base", "input": "False, {'x': [1, 2], 'y': []}", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/duniter/duniter-python-api/blob/3a1e5d61a2f72f5afaf29d010c6cf4dff3648165/duniterpy/documents/transaction.py#L13-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033382", "code": "def function_invocation_proxy(fn, proxy_args, proxy_kwargs):\n        \"\"\"execute the fuction if it is one, else evaluate the fn as a boolean\n        and return that value.\n\n        Sometimes rather than providing a predicate, we just give the value of\n        True.  This is shorthand for writing a predicate that always returns\n        true.\"\"\"\n        try:\n            return fn(*proxy_args, **proxy_kwargs)\n        except TypeError:\n            return bool(fn)", "entry_point": "function_invocation_proxy", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], {'a': 1, 'b': 2}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mozilla/socorrolib/blob/4ec08c6a4ee2c8a69150268afdd324f5f22b90c8/socorrolib/lib/transform_rules.py#L241-L251", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033383", "code": "def _mod(value, mod=1):\n    \"\"\"\n    RETURN NON-NEGATIVE MODULO\n    RETURN None WHEN GIVEN INVALID ARGUMENTS\n    \"\"\"\n    if value == None:\n        return None\n    elif mod <= 0:\n        return None\n    elif value < 0:\n        return (value % mod + mod) % mod\n    else:\n        return value % mod", "entry_point": "_mod", "input": "1, 2.0", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/mo-times/blob/e64a720b9796e076adeb0d5773ec6915ca045b9d/mo_times/dates.py#L523-L535", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033384", "code": "def handle_extensions(extensions=None, ignored=None):\n    \"\"\"\n    Organizes multiple extensions that are separated with commas or passed by\n    using --extension/-e multiple times. Note that the .py extension is ignored\n    here because of the way non-*.py files are handled in ``extract`` messages\n    (they are copied to file.ext.py files to trick xgettext to parse them as\n     Python files).\n\n    For example: running::\n\n        $ verboselib-manage extract -e js,txt -e xhtml -a\n\n    would result in an extension list ``['.js', '.txt', '.xhtml']``\n\n    .. code-block:: python\n\n        >>> handle_extensions(['.html', 'html,js,py,py,py,.py', 'py,.py'])\n        set(['.html', '.js'])\n        >>> handle_extensions(['.html, txt,.tpl'])\n        set(['.html', '.tpl', '.txt'])\n\n    Taken `from Django <http://bit.ly/1r7Eokw>`_ and changed a bit.\n    \"\"\"\n    extensions = extensions or ()\n    ignored = ignored or ('py', )\n\n    ext_list = []\n    for ext in extensions:\n        ext_list.extend(ext.replace(' ', '').split(','))\n    for i, ext in enumerate(ext_list):\n        if not ext.startswith('.'):\n            ext_list[i] = '.%s' % ext_list[i]\n    return set([x for x in ext_list if x.strip('.') not in ignored])", "entry_point": "handle_extensions", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "{'.cherry', '.banana', '.apple'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oblalex/verboselib/blob/3c108bef060b091e1f7c08861ab07672c87ddcff/verboselib/management/utils.py#L50-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033385", "code": "def to_language(locale):\n    \"\"\"\n    Turns a locale name (en_US) into a language name (en-us).\n\n    Taken `from Django <http://bit.ly/1vWACbE>`_.\n    \"\"\"\n    p = locale.find('_')\n    if p >= 0:\n        return locale[:p].lower() + '-' + locale[p + 1:].lower()\n    else:\n        return locale.lower()", "entry_point": "to_language", "input": "'Hello World'", "output": "'hello world'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oblalex/verboselib/blob/3c108bef060b091e1f7c08861ab07672c87ddcff/verboselib/helpers.py#L27-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033386", "code": "def str_(name):\n  \"\"\"Return the string representation of the given 'name'.\n  If it is a bytes object, it will be converted into str.\n  If it is a str object, it will simply be resurned.\"\"\"\n  if isinstance(name, bytes) and not isinstance(name, str):\n    return name.decode('utf8')\n  else:\n    return name", "entry_point": "str_", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bioidiap/gridtk/blob/9e3291b8b50388682908927231b2730db1da147d/gridtk/tools.py#L87-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033387", "code": "def tail_field(field):\n    \"\"\"\n    RETURN THE FIRST STEP IN PATH, ALONG WITH THE REMAINING TAIL\n    \"\"\"\n    if field == \".\" or field==None:\n        return \".\", \".\"\n    elif \".\" in field:\n        if \"\\\\.\" in field:\n            return tuple(k.replace(\"\\a\", \".\") for k in field.replace(\"\\\\.\", \"\\a\").split(\".\", 1))\n        else:\n            return field.split(\".\", 1)\n    else:\n        return field, \".\"", "entry_point": "tail_field", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3], []], '.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_dots/__init__.py#L88-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033388", "code": "def join_field(path):\n    \"\"\"\n    RETURN field SEQUENCE AS STRING\n    \"\"\"\n    output = \".\".join([f.replace(\".\", \"\\\\.\") for f in path if f != None])\n    return output if output else \".\"", "entry_point": "join_field", "input": "'Hello World'", "output": "'H.e.l.l.o. .W.o.r.l.d'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_dots/__init__.py#L121-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033389", "code": "def get_slanted_adjacent_coords(x, y):\n    '''\n    returns the six adjacent coordinates on a standard keyboard, where each row is slanted to the right from the last.\n    adjacencies are clockwise, starting with key to the left, then two keys above, then right key, then two keys below.\n    (that is, only near-diagonal keys are adjacent, so g's coordinate is adjacent to those of t,y,b,v, but not those of r,u,n,c.)\n    '''\n    return [(x-1, y), (x, y-1), (x+1, y-1), (x+1, y), (x, y+1), (x-1, y+1)]", "entry_point": "get_slanted_adjacent_coords", "input": "False, -1.5", "output": "[(-1, -1.5), (False, -2.5), (1, -2.5), (1, -1.5), (False, -0.5), (-1, -0.5)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cathalgarvey/deadlock/blob/30099b476ff767611ce617150a0c574fc03fdf79/deadlock/passwords/zxcvbn/scripts/build_keyboard_adjacency_graph.py#L38-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033390", "code": "def fw_romaji_lt(full, regular):\n    '''\n    Generates a lookup table with the fullwidth r\u014dmaji characters\n    on the left side, and the regular r\u014dmaji characters as the values.\n    '''\n    lt = {}\n    for n in range(len(full)):\n        fw = full[n]\n        reg = regular[n]\n        lt[fw] = reg\n\n    return lt", "entry_point": "fw_romaji_lt", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "{'a': 5, 'b': 3, 'c': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/msikma/kanaconv/blob/194f142e616ab5dd6d13a687b96b9f8abd1b4ea8/kanaconv/utils.py#L135-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033391", "code": "def _scrub_key(key):\n    \"\"\"\n    RETURN JUST THE :. CHARACTERS\n    \"\"\"\n    if key == None:\n        return None\n\n    output = []\n    for c in key:\n        if c in [\":\", \".\"]:\n            output.append(c)\n    return \"\".join(output)", "entry_point": "_scrub_key", "input": "['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/pyLibrary/aws/s3.py#L477-L488", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033392", "code": "def geometricmean(inlist):\n    \"\"\"\nCalculates the geometric mean of the values in the passed list.\nThat is:  n-th root of (x1 * x2 * ... * xn).  Assumes a '1D' list.\n\nUsage:   lgeometricmean(inlist)\n\"\"\"\n    mult = 1.0\n    one_over_n = 1.0 / len(inlist)\n    for item in inlist:\n        mult = mult * pow(item, one_over_n)\n    return mult", "entry_point": "geometricmean", "input": "[-1, 0, 1, 2]", "output": "0j", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_math/vendor/strangman/stats.py#L244-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033393", "code": "def harmonicmean(inlist):\n    \"\"\"\nCalculates the harmonic mean of the values in the passed list.\nThat is:  n / (1/x1 + 1/x2 + ... + 1/xn).  Assumes a '1D' list.\n\nUsage:   lharmonicmean(inlist)\n\"\"\"\n    sum = 0\n    for item in inlist:\n        sum = sum + 1.0 / item\n    return len(inlist) / sum", "entry_point": "harmonicmean", "input": "{1, 2, 3}", "output": "1.6363636363636365", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_math/vendor/strangman/stats.py#L258-L268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033394", "code": "def mean(inlist):\n    \"\"\"\nReturns the arithematic mean of the values in the passed list.\nAssumes a '1D' list, but will function on the 1st dim of an array(!).\n\nUsage:   lmean(inlist)\n\"\"\"\n    sum = 0\n    for item in inlist:\n        sum = sum + item\n    return sum / float(len(inlist))", "entry_point": "mean", "input": "[5, 3, 1, 4]", "output": "3.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_math/vendor/strangman/stats.py#L271-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033395", "code": "def incr(l, cap):        # to increment a list up to a max-list of 'cap'\n    \"\"\"\nSimulate a counting system from an n-dimensional list.\n\nUsage:   lincr(l,cap)   l=list to increment, cap=max values for each list pos'n\nReturns: next set of values for list l, OR -1 (if overflow)\n\"\"\"\n    l[0] = l[0] + 1     # e.g., [0,0,0] --> [2,4,3] (=cap)\n    for i in range(len(l)):\n        if l[i] > cap[i] and i < len(l) - 1: # if carryover AND not done\n            l[i] = 0\n            l[i + 1] = l[i + 1] + 1\n        elif l[i] > cap[i] and i == len(l) - 1: # overflow past last column, must be finished\n            l = -1\n    return l", "entry_point": "incr", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[0, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_math/vendor/strangman/stats.py#L1559-L1573", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033396", "code": "def ss(inlist):\n    \"\"\"\nSquares each value in the passed list, adds up these squares and\nreturns the result.\n\nUsage:   lss(inlist)\n\"\"\"\n    ss = 0\n    for item in inlist:\n        ss = ss + item * item\n    return ss", "entry_point": "ss", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_math/vendor/strangman/stats.py#L1589-L1599", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033397", "code": "def sumdiffsquared(x, y):\n    \"\"\"\nTakes pairwise differences of the values in lists x and y, squares\nthese differences, and returns the sum of these squares.\n\nUsage:   lsumdiffsquared(x,y)\nReturns: sum[(x[i]-y[i])**2]\n\"\"\"\n    sds = 0\n    for i in range(len(x)):\n        sds = sds + (x[i] - y[i]) ** 2\n    return sds", "entry_point": "sumdiffsquared", "input": "[], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/mo_math/vendor/strangman/stats.py#L1618-L1629", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033398", "code": "def normalize_dictionary(data_dict):\n    \"\"\"\n    Converts all the keys in \"data_dict\" to strings. The keys must be\n    convertible using str().\n    \"\"\"\n    for key, value in data_dict.items():\n        if not isinstance(key, str):\n            del data_dict[key]\n            data_dict[str(key)] = value\n    return data_dict", "entry_point": "normalize_dictionary", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ff0000/scarlet/blob/6c37befd810916a2d7ffff2cdb2dab57bcb6d12e/scarlet/cms/helpers.py#L340-L349", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033399", "code": "def is_op(call, op):\n    \"\"\"\n    :param call: The specific operator instance (a method call)\n    :param op: The the operator we are testing against\n    :return: isinstance(call, op), but faster\n    \"\"\"\n    try:\n        return call.id == op.id\n    except Exception as e:\n        return False", "entry_point": "is_op", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/pyLibrary/blob/fa2dcbc48fda8d26999baef400e9a98149e0b982/jx_base/language.py#L125-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033400", "code": "def validate(document, spec):\n    \"\"\"Validate that a document meets a specification.  Returns True if\n    validation was successful, but otherwise raises a ValueError.\"\"\"\n    if not spec:\n        return True\n    missing = []\n    for key, field in spec.iteritems():\n        if field.required and key not in document:\n            missing.append(key)\n\n    failed = []\n    for key, field in spec.iteritems():\n        if key in document:\n            try: document[key] = field.validate(document[key])\n            except ValueError: failed.append(key)\n\n    if missing or failed:\n        if missing and not failed:\n            raise ValueError(\"Required fields missing: %s\" % (missing))\n        if failed and not missing:\n            raise ValueError(\"Keys did not match spec: %s\" % (failed))\n        raise ValueError(\"Missing fields: %s, Invalid fields: %s\" % (missing, failed))\n    # just a token of my kindness, a return for you\n    return True", "entry_point": "validate", "input": "(1, 2), set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jmoiron/micromongo/blob/0d7dd1396e2f25ece6648619ccff32345bc306a1/micromongo/spec.py#L100-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033401", "code": "def tuple_in_list_always(main, sub):\n    \"\"\"\n    >>> main = [('a', 'b', 'c'), ('c', 'd')]\n    >>> tuple_in_list_always(main, ('a' ,'b', 'c'))\n    False\n    >>> tuple_in_list_always(main, ('c', 'd'))\n    False\n    >>> tuple_in_list_always(main, ('a', 'c'))\n    False\n    >>> tuple_in_list_always(main, ('a'))\n    False\n    >>> tuple_in_list_always(main, ((),))\n    False\n    >>> main = [('a', 'b', 'c'), ('a', 'b', 'c')]\n    >>> tuple_in_list_always(main, ('a' ,'b', 'c'))\n    True\n    >>> main = [('a', 'b', 'c')]\n    >>> tuple_in_list_always(main, ('a' ,'b', 'c'))\n    True\n    \"\"\"\n    return True if sub in set(main) and len(set(main)) == 1 else False", "entry_point": "tuple_in_list_always", "input": "[-1, 0, 1, 2], 2.0", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/note35/sinon/blob/f1d551b679b393d64d926a8a279320904c38d0f5/sinon/lib/util/CollectionHandler.py#L44-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033402", "code": "def obj_in_list_always(target_list, obj):\n    \"\"\"\n    >>> l = [1,1,1]\n    >>> obj_in_list_always(l, 1)\n    True\n    >>> l.append(2)\n    >>> obj_in_list_always(l, 1)\n    False\n    \"\"\"\n    for item in set(target_list):\n        if item is not obj:\n            return False\n    return True", "entry_point": "obj_in_list_always", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/note35/sinon/blob/f1d551b679b393d64d926a8a279320904c38d0f5/sinon/lib/util/CollectionHandler.py#L101-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033403", "code": "def filter_short(terms):\n    '''\n    only keep if brute-force possibilities are greater than this word's rank in the dictionary\n    '''\n    return [term for i, term in enumerate(terms) if 26**(len(term)) > i]", "entry_point": "filter_short", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cathalgarvey/deadlock/blob/30099b476ff767611ce617150a0c574fc03fdf79/deadlock/passwords/zxcvbn/scripts/build_frequency_lists.py#L127-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033404", "code": "def filter_ascii(lst):\n    '''\n    removes words with accent chars etc.\n    (most accented words in the english lookup exist in the same table unaccented.)\n    '''\n    return [word for word in lst if all(ord(c) < 128 for c in word)]", "entry_point": "filter_ascii", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cathalgarvey/deadlock/blob/30099b476ff767611ce617150a0c574fc03fdf79/deadlock/passwords/zxcvbn/scripts/build_frequency_lists.py#L142-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033405", "code": "def binom(n, k):\n    \"\"\"\n    Returns binomial coefficient (n choose k).\n    \"\"\"\n    # http://blog.plover.com/math/choose.html\n    if k > n:\n        return 0\n    if k == 0:\n        return 1\n    result = 1\n    for denom in range(1, k + 1):\n        result *= n\n        result /= denom\n        n -= 1\n    return result", "entry_point": "binom", "input": "[], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cathalgarvey/deadlock/blob/30099b476ff767611ce617150a0c574fc03fdf79/deadlock/passwords/zxcvbn/scoring.py#L7-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033406", "code": "def build_dot_value(key, value):\n    \"\"\"Build new dictionaries based off of the dot notation key.\n\n    For example, if a key were 'x.y.z' and the value was 'foo',\n    we would expect a return value of: ('x', {'y': {'z': 'foo'}})\n\n    Args:\n        key (str): The key to build a dictionary off of.\n        value: The value associated with the dot notation key.\n\n    Returns:\n        tuple: A 2-tuple where the first element is the key of\n            the outermost scope (e.g. left-most in the dot\n            notation key) and the value is the constructed value\n            for that key (e.g. a dictionary)\n    \"\"\"\n    # if there is no nesting in the key (as specified by the\n    # presence of dot notation), then the key/value pair here\n    # are the final key value pair.\n    if key.count('.') == 0:\n        return key, value\n\n    # otherwise, we will need to construct as many dictionaries\n    # as there are dot components to hold the value.\n    final_value = value\n    reverse_split = key.split('.')[::-1]\n    end = len(reverse_split) - 1\n    for idx, k in enumerate(reverse_split):\n        if idx == end:\n            return k, final_value\n        final_value = {k: final_value}", "entry_point": "build_dot_value", "input": "['a', 'b', 'c'], [[1, 2], [3], []]", "output": "(['a', 'b', 'c'], [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edaniszewski/bison/blob/0b889196bb314a0803c4089fe102eacacabb118b/bison/utils.py#L12-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033407", "code": "def split_qs(string, delimiter='&'):\n    \"\"\"Split a string by the specified unquoted, not enclosed delimiter\"\"\"\n\n    open_list = '[<{('\n    close_list = ']>})'\n    quote_chars = '\"\\''\n\n    level = index = last_index = 0\n    quoted = False\n    result = []\n\n    for index, letter in enumerate(string):\n        if letter in quote_chars:\n            if not quoted:\n                quoted = True\n                level += 1\n            else:\n                quoted = False\n                level -= 1\n        elif letter in open_list:\n            level += 1\n        elif letter in close_list:\n                level -= 1\n        elif letter == delimiter and level == 0:\n            # Split here\n            element = string[last_index: index]\n            if element:\n                result.append(element)\n            last_index = index + 1\n\n    if index:\n        element = string[last_index: index + 1]\n        if element:\n            result.append(element)\n\n    return result", "entry_point": "split_qs", "input": "'walnut thistle harbour', 7", "output": "['walnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/commonwealth-of-puerto-rico/libre/blob/5b32f4ab068b515d2ea652b182e161271ba874e8/libre/apps/data_drivers/utils.py#L174-L209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033408", "code": "def get_analyzer_for(language_code, default='snowball'):\n    \"\"\"\n    Get the available language analyzer for the given language code or else the default.\n    :param language_code: Django language code\n    :param default: The analyzer to return if no language analyzer has been found.\n                    Defaults to 'snowball'.\n    :return: The Haystack language name. E.g. 'german' or the default analyzer\n    \"\"\"\n    languages = {\n        'ar': 'arabic',\n        # '': 'armenian',\n        'eu': 'basque',\n        'pt-br': 'brazilian',\n        'bg': 'bulgarian',\n        'ca': 'catalan',\n        'zh-hans': 'chinese',\n        'zh-hant': 'chinese',\n        # 'cjk',\n        'cs': 'czech',\n        'da': 'danish',\n        'nl': 'dutch',\n        'en': 'english',\n        'fi': 'finnish',\n        'fr': 'french',\n        'gl': 'galician',\n        'de': 'german',\n        'el': 'greek',\n        'hi': 'hindi',\n        'hu': 'hungarian',\n        'id': 'indonesian',\n        'ga': 'irish',\n        'it': 'italian',\n        'lv': 'latvian',\n        'no': 'norwegian',\n        'fa': 'persian',\n        'pt': 'portuguese',\n        'ro': 'romanian',\n        'ru': 'russian',\n        # 'sorani',\n        'es': 'spanish',\n        'sv': 'swedish',\n        'tr': 'turkish',\n        'th': 'thai'\n    }\n    if language_code in languages:\n        return languages[language_code]\n    elif language_code[:2] in languages:\n        return languages[language_code[:2]]\n    return default", "entry_point": "get_analyzer_for", "input": "'', {1, 2, 3}", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sbaechler/django-multilingual-search/blob/485c690d865da3267b19e073e28d3e2290f36611/multilingual/utils.py#L5-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033409", "code": "def _split_regex(regex):\n    \"\"\"\n    Return an array of the URL split at each regex match like (?P<id>[\\d]+)\n    Call with a regex of '^/foo/(?P<id>[\\d]+)/bar/$' and you will receive ['/foo/', '/bar/']\n    \"\"\"\n    if regex[0] == '^':\n        regex = regex[1:]\n    if regex[-1] == '$':\n        regex = regex[0:-1]\n    results = []\n    line = ''\n    for c in regex:\n        if c == '(':\n            results.append(line)\n            line = ''\n        elif c == ')':\n            line = ''\n        else:\n            line = line + c\n    if len(line) > 0:\n        results.append(line)\n    return results", "entry_point": "_split_regex", "input": "['a', 'b', 'c']", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Captricity/captools/blob/e7dc069ff5ede95d4956c7a0a4614d0e53e5a955/captools/api/client.py#L393-L414", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033410", "code": "def get_namespace_and_tag(name):\n        \"\"\"\n        Separates the namespace and tag from an element.\n\n        :param str name: Tag.\n        :returns: Namespace URI and Tag namespace.\n        :rtype: tuple\n        \"\"\"\n\n        if isinstance(name, str):\n            if name[0] == \"{\":\n                uri, ignore, tag = name[1:].partition(\"}\")\n            else:\n                uri = None\n                tag = name\n        else:\n            uri = None\n            tag = None\n        return uri, tag", "entry_point": "get_namespace_and_tag", "input": "'  padded  '", "output": "(None, '  padded  ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rodynnz/xccdf/blob/1b9dc2f06b5cce8db2a54c5f95a8f6bcf5cb6981/src/xccdf/models/element.py#L119-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033411", "code": "def pad_with_object(sequence, new_length, obj=None):\n    \"\"\"\n    Returns :samp:`sequence` :obj:`list` end-padded with :samp:`{obj}`\n    elements so that the length of the returned list equals :samp:`{new_length}`.\n\n    :type sequence: iterable\n    :param sequence: Return *listified* sequence which has been end-padded.\n    :type new_length: :obj:`int`\n    :param new_length: The length of the returned list.\n    :type obj: :obj:`object`\n    :param obj: Object used as padding elements.\n    :rtype: :obj:`list`\n    :return: A :obj:`list` of length :samp:`{new_length}`.\n    :raises ValueError: if :samp:`len({sequence}) > {new_length})`.\n\n    Example::\n\n       >>> pad_with_object([1, 2, 3], 5, obj=0)\n       [1, 2, 3, 0, 0]\n       >>> pad_with_object([1, 2, 3], 5, obj=None)\n       [1, 2, 3, None, None]\n\n    \"\"\"\n    if len(sequence) < new_length:\n        sequence = \\\n            list(sequence) + [obj, ] * (new_length - len(sequence))\n    elif len(sequence) > new_length:\n        raise ValueError(\n            \"Got len(sequence)=%s which exceeds new_length=%s\"\n            %\n            (len(sequence), new_length)\n        )\n\n    return sequence", "entry_point": "pad_with_object", "input": "[[1, 2], [3], []], 3, [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/array-split/array_split/blob/e07abe3001209394dde809f7e6f505f9f49a1c26/array_split/split.py#L126-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033412", "code": "def find_ss_regions(dssp_residues, loop_assignments=(' ', 'B', 'S', 'T')):\n    \"\"\"Separates parsed DSSP data into groups of secondary structure.\n\n    Notes\n    -----\n    Example: all residues in a single helix/loop/strand will be gathered\n    into a list, then the next secondary structure element will be\n    gathered into a separate list, and so on.\n\n    Parameters\n    ----------\n    dssp_residues : [tuple]\n        Each internal list contains:\n            [0] int Residue number\n            [1] str Secondary structure type\n            [2] str Chain identifier\n            [3] str Residue type\n            [4] float Phi torsion angle\n            [5] float Psi torsion angle\n            [6] int dssp solvent accessibility\n\n    Returns\n    -------\n    fragments : [[list]]\n        Lists grouped in continuous regions of secondary structure.\n        Innermost list has the same format as above.\n    \"\"\"\n\n    loops = loop_assignments\n    previous_ele = None\n    fragment = []\n    fragments = []\n    for ele in dssp_residues:\n        if previous_ele is None:\n            fragment.append(ele)\n        elif ele[2] != previous_ele[2]:\n            fragments.append(fragment)\n            fragment = [ele]\n        elif previous_ele[1] in loops:\n            if ele[1] in loops:\n                fragment.append(ele)\n            else:\n                fragments.append(fragment)\n                fragment = [ele]\n        else:\n            if ele[1] == previous_ele[1]:\n                fragment.append(ele)\n            else:\n                fragments.append(fragment)\n                fragment = [ele]\n        previous_ele = ele\n    fragments.append(fragment)\n    return fragments", "entry_point": "find_ss_regions", "input": "[], [-1, 0, 1, 2]", "output": "[[]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/isambard-uob/ampal/blob/906e2afacb435ffb129b381f262ff8e7bfb324c5/src/ampal/dssp.py#L111-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033413", "code": "def extract(query_dict, prefix=\"\"):\n    \"\"\"\n    Extract the *order_by*, *per_page*, and *page* parameters from\n    `query_dict` (a Django QueryDict), and return a dict suitable for\n    instantiating a preconfigured Table object.\n    \"\"\"\n\n    strs = ['order_by']\n    ints = ['per_page', 'page']\n\n    extracted = { }\n\n    for key in (strs + ints):\n        if (prefix + key) in query_dict:\n            val = query_dict.get(prefix + key)\n\n            extracted[key] = (val\n                if not key in ints\n                else int(val))\n\n    return extracted", "entry_point": "extract", "input": "{}, 'a,b,c'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adammck/djtables/blob/8fa279e7088123f00cca9c838fe028ebf327325e/lib/djtables/urls.py#L8-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033414", "code": "def invert_dictset(d):\n    \"\"\"Invert a dictionary with keys matching a set of values, turned into lists.\"\"\"\n    # Based on recipe from ASPN\n    result = {}\n    for k, c in d.items():\n        for v in c:\n            keys = result.setdefault(v, [])\n            keys.append(k)\n    return result", "entry_point": "invert_dictset", "input": "{'x': [1, 2], 'y': []}", "output": "{1: ['x'], 2: ['x']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jelmer/python-fastimport/blob/5cef9e037b7d7b37f58f522ac9ea4e343e6a1dff/fastimport/helpers.py#L218-L226", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033415", "code": "def defines_to_dict(defines):\n    \"\"\"Convert a list of definition strings to a dictionary.\"\"\"\n    if defines is None:\n        return None\n    result = {}\n    for define in defines:\n        kv = define.split('=', 1)\n        if len(kv) == 1:\n            result[define.strip()] = 1\n        else:\n            result[kv[0].strip()] = kv[1].strip()\n    return result", "entry_point": "defines_to_dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jelmer/python-fastimport/blob/5cef9e037b7d7b37f58f522ac9ea4e343e6a1dff/fastimport/helpers.py#L239-L250", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033416", "code": "def _iterable_as_config_list(s):\n    \"\"\"Format an iterable as a sequence of comma-separated strings.\n    \n    To match what ConfigObj expects, a single item list has a trailing comma.\n    \"\"\"\n    items = sorted(s)\n    if len(items) == 1:\n        return \"%s,\" % (items[0],)\n    else:\n        return \", \".join(items)", "entry_point": "_iterable_as_config_list", "input": "['a', 'b', 'c']", "output": "'a, b, c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jelmer/python-fastimport/blob/5cef9e037b7d7b37f58f522ac9ea4e343e6a1dff/fastimport/processors/info_processor.py#L277-L286", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033417", "code": "def process_tags(inst_tags):\n    \"\"\"Create dict of instance tags as only name:value pairs.\"\"\"\n    tag_dict = {}\n    for k in range(len(inst_tags)):\n        tag_dict[inst_tags[k]['Key']] = inst_tags[k]['Value']\n    return tag_dict", "entry_point": "process_tags", "input": "()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/robertpeteuil/aws-shortcuts/blob/cf453ca996978a4d88015d1cf6125bce8ca4873b/awss/core.py#L319-L324", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033418", "code": "def blend(c1, c2):\n    \"\"\"Alpha blends two colors, using the alpha given by c2\"\"\"\n    return [c1[i] * (0xFF - c2[3]) + c2[i] * c2[3] >> 8 for i in range(3)]", "entry_point": "blend", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "[4, 2, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcarmo/pngcanvas/blob/e2eaa0d5ba353005b3b658f6ee453c1956340670/pngcanvas.py#L36-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033419", "code": "def rgb2rgba(rgb):\n    \"\"\"Take a row of RGB bytes, and convert to a row of RGBA bytes.\"\"\"\n    rgba = []\n    for i in range(0, len(rgb), 3):\n        rgba += rgb[i:i+3]\n        rgba.append(255)\n\n    return rgba", "entry_point": "rgb2rgba", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c', 255]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcarmo/pngcanvas/blob/e2eaa0d5ba353005b3b658f6ee453c1956340670/pngcanvas.py#L58-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033420", "code": "def _dedent(text):\n        \"\"\"Remove common indentation from each line in a text block.\n\n        When text block is a single line, return text block. Otherwise\n        determine common indentation from last line, strip common\n        indentation from each line, and return text block consisting of\n        inner lines (don't include first and last lines since they either\n        empty or contain whitespace and are present in baselined\n        string to make them pretty and delineate the common indentation).\n\n        :param str text: text block\n        :returns: text block with common indentation removed\n        :rtype: str\n        :raises ValueError: when text block violates whitespace rules\n\n        \"\"\"\n        lines = text.split('\\n')\n\n        if len(lines) == 1:\n            indent = 0\n\n        elif lines[0].strip():\n            raise ValueError('when multiple lines, first line must be blank')\n\n        elif lines[-1].strip():\n            raise ValueError('last line must only contain indent whitespace')\n\n        else:\n            indent = len(lines[-1])\n\n            if any(line[:indent].strip() for line in lines):\n                raise ValueError(\n                    'indents must equal or exceed indent in last line')\n\n            lines = [line[indent:] for line in lines][1:-1]\n\n        return indent, '\\n'.join(lines)", "entry_point": "_dedent", "input": "'abc'", "output": "(0, 'abc')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmgass/baseline/blob/1f7988e8c9fafa83eb3a1ce73b1601d2afdbb2cd/baseline/_baseline.py#L102-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033421", "code": "def cutoff(s, length=120):\n    \"\"\"Cuts a given string if it is longer than a given length.\"\"\"\n    if length < 5:\n        raise ValueError('length must be >= 5')\n    if len(s) <= length:\n        return s\n    else:\n        i = (length - 2) / 2\n        j = (length - 3) / 2\n        return s[:i] + '...' + s[-j:]", "entry_point": "cutoff", "input": "['a', 'b', 'c'], 5", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/clee704/mutagenwrapper/blob/f66ea03f0ee60c3718cc45236a46fdfb67f1c6ae/mutagenwrapper/__init__.py#L117-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033422", "code": "def humanize_speed(c_per_sec):\n    \"\"\"convert a speed in counts per second to counts per [s, min, h, d], choosing the smallest value greater zero.\n    \"\"\"\n    scales = [60, 60, 24]\n    units = ['c/s', 'c/min', 'c/h', 'c/d']\n    speed = c_per_sec\n    i = 0\n    if speed > 0:\n        while (speed < 1) and (i < len(scales)):\n            speed *= scales[i]\n            i += 1\n        \n    return \"{:.1f}{}\".format(speed, units[i])", "entry_point": "humanize_speed", "input": "False", "output": "'0.0c/s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cimatosa/progression/blob/82cf74a25a47f9bda96157cc2c88e5975c20b41d/progression/progress.py#L1394-L1406", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033423", "code": "def humanize_time(secs):\n    \"\"\"convert second in to hh:mm:ss format\n    \"\"\"\n    if secs is None:\n        return '--'\n\n    if secs < 1:\n        return \"{:.2f}ms\".format(secs*1000)\n    elif secs < 10:\n        return \"{:.2f}s\".format(secs)\n    else:\n        mins, secs = divmod(secs, 60)\n        hours, mins = divmod(mins, 60)\n        return '{:02d}:{:02d}:{:02d}'.format(int(hours), int(mins), int(secs))", "entry_point": "humanize_time", "input": "1", "output": "'1.00s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cimatosa/progression/blob/82cf74a25a47f9bda96157cc2c88e5975c20b41d/progression/progress.py#L1409-L1422", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033424", "code": "def filter_slaves(selfie, slaves):\n        \"\"\"\n        Remove slaves that are in an ODOWN or SDOWN state\n        also remove slaves that do not have 'ok' master-link-status\n        \"\"\"\n        return [(s['ip'], s['port']) for s in slaves\n                if not s['is_odown'] and\n                not s['is_sdown'] and\n                s['master-link-status'] == 'ok']", "entry_point": "filter_slaves", "input": "'AbC dEf', {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tr3buchet/twiceredis/blob/c7baa4d66087092b40f7ebd9139e3b9bb7087707/twiceredis/client.py#L50-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033425", "code": "def parsemsg(s): # stolen from twisted.words\r\n    \"\"\"Breaks a message from an IRC server into its prefix, command, and arguments.\r\n    \"\"\"\r\n    prefix = ''\r\n    trailing = []\r\n    if not s:\r\n        raise Exception(\"Empty line.\")\r\n    if s[0] == ':':\r\n        prefix, s = s[1:].split(' ', 1)\r\n    if s.find(' :') != -1:\r\n        s, trailing = s.split(' :', 1)\r\n        args = s.split()\r\n        args.append(trailing)\r\n    else:\r\n        args = s.split()\r\n    command = args.pop(0)\r\n    return prefix, command, args", "entry_point": "parsemsg", "input": "'abc'", "output": "('', 'abc', [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ionelmc/python-cogen/blob/83b0edb88425eba6e5bfda9f1dcd34642517e2a8/examples/cogen-irc/CogenIrcApp/cogenircapp/controllers/irc.py#L25-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033426", "code": "def get_info_dict(info_line):\n    \"\"\"Parse a info field of a variant\n        \n        Make a dictionary from the info field of a vcf variant.\n        Keys are the info keys and values are the raw strings from the vcf\n        If the field only have a key (no value), value of infodict is True.\n        \n        Args:\n            info_line (str): The info field of a vcf variant\n        Returns:\n            info_dict (dict): A INFO dictionary\n    \"\"\"\n    \n    variant_info = {}\n    for raw_info in info_line.split(';'):\n        splitted_info = raw_info.split('=')\n        if len(splitted_info) == 2:\n            variant_info[splitted_info[0]] = splitted_info[1]\n        else:\n            variant_info[splitted_info[0]] = True\n    \n    return variant_info", "entry_point": "get_info_dict", "input": "'AbC dEf'", "output": "{'AbC dEf': True}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/vcftoolbox/blob/438fb1d85a83812c389774b94802eb5921c89e3a/vcftoolbox/parse_variant.py#L34-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033427", "code": "def get_vep_info(vep_string, vep_header):\n    \"\"\"Make the vep annotations into a dictionaries\n    \n        A vep dictionary will have the vep column names as keys and \n        the vep annotations as values.\n        The dictionaries are stored in a list\n\n        Args:\n            vep_string (string): A string with the CSQ annotation\n            vep_header (list): A list with the vep header\n        \n        Return:\n            vep_annotations (list): A list of vep dicts\n    \n    \"\"\"\n    \n    vep_annotations = [\n        dict(zip(vep_header, vep_annotation.split('|'))) \n        for vep_annotation in vep_string.split(',')\n    ]\n    \n    return vep_annotations", "entry_point": "get_vep_info", "input": "'a,b,c', ['apple', 'banana', 'cherry']", "output": "[{'apple': 'a'}, {'apple': 'b'}, {'apple': 'c'}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/vcftoolbox/blob/438fb1d85a83812c389774b94802eb5921c89e3a/vcftoolbox/parse_variant.py#L90-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033428", "code": "def get_snpeff_info(snpeff_string, snpeff_header):\n    \"\"\"Make the vep annotations into a dictionaries\n    \n        A snpeff dictionary will have the snpeff column names as keys and \n        the vep annotations as values.\n        The dictionaries are stored in a list. \n        One dictionary for each transcript.\n\n        Args:\n            snpeff_string (string): A string with the ANN annotation\n            snpeff_header (list): A list with the vep header\n        \n        Return:\n            snpeff_annotations (list): A list of vep dicts\n    \n    \"\"\"\n    \n    snpeff_annotations = [\n        dict(zip(snpeff_header, snpeff_annotation.split('|'))) \n        for snpeff_annotation in snpeff_string.split(',')\n    ]\n    \n    return snpeff_annotations", "entry_point": "get_snpeff_info", "input": "'AbC dEf', []", "output": "[{}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/vcftoolbox/blob/438fb1d85a83812c389774b94802eb5921c89e3a/vcftoolbox/parse_variant.py#L113-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033429", "code": "def generate_output(listing, title, date):\n    \"\"\"\n    Returns a string containing a full tracklisting.\n\n    listing: list of (artist(s), track, record label) tuples\n    title: programme title\n    date: programme date\n    \"\"\"\n    listing_string = '{0}\\n{1}\\n\\n'.format(title, date)\n    for entry in listing:\n        listing_string += '\\n'.join(entry) + '\\n***\\n'\n    return listing_string", "entry_point": "generate_output", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c'], [5, 3, 1, 4]", "output": "\"['a', 'b', 'c']\\n[5, 3, 1, 4]\\n\\na\\np\\np\\nl\\ne\\n***\\nb\\na\\nn\\na\\nn\\na\\n***\\nc\\nh\\ne\\nr\\nr\\ny\\n***\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StevenMaude/bbc-radio-tracklisting-downloader/blob/9fe9096b4d889888f65756444e4fd71352b92458/bbc_tracklist.py#L118-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033430", "code": "def __clip(val, minimum, maximum):\n        \"\"\"\n        \n        :param val: input value \n        :param minimum: min value\n        :param maximum: max value\n        :return: val clipped to range [minimum, maximum]\n        \"\"\"\n        if val is None or minimum is None or maximum is None:\n            return None\n        if val < minimum:\n            return minimum\n        if val > maximum:\n            return maximum\n        return val", "entry_point": "__clip", "input": "[], [-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shimpe/pyvectortween/blob/aff071180474739060ec2d3102c39c8e73510988/vectortween/ColorAnimation.py#L45-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033431", "code": "def get_chromosome_priority(chrom, chrom_dict={}):\n    \"\"\"\n    Return the chromosome priority\n    \n    Arguments:\n        chrom (str): The cromosome name from the vcf\n        chrom_dict (dict): A map of chromosome names and theis priority\n    \n    Return:\n        priority (str): The priority for this chromosom\n    \"\"\"\n    priority = 0\n    \n    chrom = str(chrom).lstrip('chr')\n    \n    if chrom_dict:\n        priority = chrom_dict.get(chrom, 0)\n    \n    else:\n        try:\n            if int(chrom) < 23:\n                priority = int(chrom)\n        except ValueError:\n            if chrom == 'X':\n                priority = 23\n            elif chrom == 'Y':\n                priority = 24\n            elif chrom == 'MT':\n                priority = 25\n            else:\n                priority = 26\n    \n    return str(priority)", "entry_point": "get_chromosome_priority", "input": "[], {'x': [1, 2], 'y': []}", "output": "'0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/vcftoolbox/blob/438fb1d85a83812c389774b94802eb5921c89e3a/vcftoolbox/sort.py#L11-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033432", "code": "def _backward_delete_char(text, pos):\n    \"\"\"Delete the character behind pos.\"\"\"\n    if pos == 0:\n        return text, pos\n    return text[:pos - 1] + text[pos:], pos - 1", "entry_point": "_backward_delete_char", "input": "True, False", "output": "(True, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jangler/readlike/blob/2901260c50bd1aecfb981c3990e0c6333de8aac8/readlike.py#L51-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033433", "code": "def _transpose_chars(text, pos):\n    \"\"\"\n    Drag the character before pos forward over the character at pos,\n    moving pos forward as well. If pos is at the end of text, then this\n    transposes the two characters before pos.\n    \"\"\"\n    if len(text) < 2 or pos == 0:\n        return text, pos\n    if pos == len(text):\n        return text[:pos - 2] + text[pos - 1] + text[pos - 2], pos\n    return text[:pos - 1] + text[pos] + text[pos - 1] + text[pos + 1:], pos + 1", "entry_point": "_transpose_chars", "input": "[], False", "output": "([], False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jangler/readlike/blob/2901260c50bd1aecfb981c3990e0c6333de8aac8/readlike.py#L153-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033434", "code": "def text_coords(string, position):\n    r\"\"\"\n    Transform a simple index into a human-readable position in a string.\n\n    This function accepts a string and an index, and will return a triple of\n    `(lineno, columnno, line)` representing the position through the text. It's\n    useful for displaying a string index in a human-readable way::\n\n        >>> s = \"abcdef\\nghijkl\\nmnopqr\\nstuvwx\\nyz\"\n        >>> text_coords(s, 0)\n        (0, 0, 'abcdef')\n        >>> text_coords(s, 4)\n        (0, 4, 'abcdef')\n        >>> text_coords(s, 6)\n        (0, 6, 'abcdef')\n        >>> text_coords(s, 7)\n        (1, 0, 'ghijkl')\n        >>> text_coords(s, 11)\n        (1, 4, 'ghijkl')\n        >>> text_coords(s, 15)\n        (2, 1, 'mnopqr')\n    \"\"\"\n    line_start = string.rfind('\\n', 0, position) + 1\n    line_end = string.find('\\n', position)\n    lineno = string.count('\\n', 0, position)\n    columnno = position - line_start\n    line = string[line_start:line_end]\n    return (lineno, columnno, line)", "entry_point": "text_coords", "input": "'', True", "output": "(0, 1, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/refnode/liquid/blob/8b2b5efc635b0dbfe610db9036fdb4ae3e3d5439/src/liquid/strscan.py#L486-L513", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033435", "code": "def get_three_frame_orfs(sequence, starts=None, stops=None):\n    \"\"\"Find ORF's in frames 1, 2 and 3 for the given sequence.\n\n    Positions returned are 1-based (not 0)\n\n    Return format [{'start': start_position, 'stop': stop_position, 'sequence': sequence}, ]\n\n    Keyword arguments:\n    sequence -- sequence for the transcript\n    starts -- List of codons to be considered as start (Default: ['ATG'])\n    stops -- List of codons to be considered as stop (Default: ['TAG', 'TGA', 'TAA'])\n\n    \"\"\"\n    if not starts:\n        starts = ['ATG']\n\n    if not stops:\n        stops = ['TAG', 'TGA', 'TAA']\n\n    # Find ORFs in 3 frames\n    orfs = []\n    for frame in range(3):\n        start_codon = None\n        orf = ''\n        for position in range(frame, len(sequence), 3):\n            codon = sequence[position:position + 3]\n            if codon in starts:\n                # We have found a start already, so add codon to orf and\n                # continue. This is an internal MET\n                if start_codon is not None:\n                    orf += codon\n                    continue\n\n                # New orf start\n                start_codon = position\n                orf = codon\n            else:\n                # if sequence starts with ATG, start_codon will be 0\n                if start_codon is None:\n                    # We haven't found a start codon yet\n                    continue\n                orf += codon\n                if codon in stops:\n                    # orfs[start_codon + 1] = orf\n                    orfs.append({'start': start_codon + 1, 'stop': position + 3, 'sequence': orf})\n\n                    # Reset\n                    start_codon = None\n                    orf = ''\n    return orfs", "entry_point": "get_three_frame_orfs", "input": "[[1, 2], [3], []], [5, 3, 1, 4], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vimalkvn/riboplot/blob/914515df54eccc2e726ba71e751c3260f2066d97/riboplot/ribocore.py#L169-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033436", "code": "def is_ignored(mod_or_pkg, ignored_package):\n    \"\"\"Test, if this :class:`docfly.pkg.picage.Module`\n    or :class:`docfly.pkg.picage.Package` should be included to generate\n    API reference document.\n\n    :param mod_or_pkg: module or package\n    :param ignored_package: ignored package\n\n    **\u4e2d\u6587\u6587\u6863**\n\n    \u6839\u636e\u5168\u540d\u5224\u65ad\u4e00\u4e2a\u5305\u6216\u8005\u6a21\u5757\u662f\u5426\u8981\u88ab\u5305\u542b\u5230\u81ea\u52a8\u751f\u6210\u7684API\u6587\u6863\u4e2d\u3002\n    \"\"\"\n    ignored_pattern = list()\n    for pkg_fullname in ignored_package:\n        if pkg_fullname.endswith(\".py\"):\n            pkg_fullname = pkg_fullname[:-3]\n            ignored_pattern.append(pkg_fullname)\n        else:\n            ignored_pattern.append(pkg_fullname)\n\n    for pattern in ignored_pattern:\n        if mod_or_pkg.fullname.startswith(pattern):\n            return True\n    return False", "entry_point": "is_ignored", "input": "[1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/docfly-project/blob/46da8a9793211301c3ebc12d195228dbf79fdfec/docfly/api_reference_doc.py#L30-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033437", "code": "def empty(val):\n    \"\"\"\n    Checks if value is empty.\n    All unknown data types considered as empty values.\n    @return: bool\n    \"\"\"\n    if val == None:\n        return True\n\n    if isinstance(val,str) and len(val) > 0:\n        return False\n\n    return True", "entry_point": "empty", "input": "[5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ilgarm/pyzimbra/blob/c397bc7497554d260ec6fd1a80405aed872a70cc/pyzimbra/util.py#L30-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033438", "code": "def project2module(project):\n    \"\"\"Convert project name into a module name.\"\"\"\n    # Name unification in accordance with PEP 426.\n    project = project.lower().replace(\"-\", \"_\")\n    if project.startswith(\"python_\"):\n        # Remove conventional \"python-\" prefix.\n        project = project[7:]\n    return project", "entry_point": "project2module", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L47-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033439", "code": "def process_args(mod_id, args, type_args):\n    \"\"\"\n    Takes as input a list of arguments defined on a module and the information\n    about the required arguments defined on the corresponding module type.\n    Validates that the number of supplied arguments is valid and fills any\n    missing arguments with their default values from the module type\n    \"\"\"\n    res = list(args)\n    if len(args) > len(type_args):\n        raise ValueError(\n            'Too many arguments specified for module \"{}\" (Got {}, expected '\n            '{})'.format(mod_id, len(args), len(type_args))\n        )\n    for i in range(len(args), len(type_args)):\n        arg_info = type_args[i]\n        if \"default\" in arg_info:\n            args.append(arg_info[\"default\"])\n        else:\n            raise ValueError(\n                'Not enough module arguments supplied for module \"{}\" (Got '\n                '{}, expecting {})'.format(\n                    mod_id, len(args), len(type_args)\n                )\n            )\n    return args", "entry_point": "process_args", "input": "[[1, 2], [3], []], [1, 2, 3], [[1, 2], [3], []]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/utils.py#L107-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033440", "code": "def booleanise(b):\n    \"\"\"Normalise a 'stringified' Boolean to a proper Python Boolean.\n\n    ElasticSearch has a habit of returning \"true\" and \"false\" in its \n    JSON responses when it should be returning `true` and `false`.  If \n    `b` looks like a stringified Boolean true, return True.  If `b` \n    looks like a stringified Boolean false, return False.\n\n    If we don't know what `b` is supposed to represent, return it back \n    to the caller.\n\n    \"\"\"\n    s = str(b)\n    if s.lower() == \"true\":\n        return True\n    if s.lower() == \"false\":\n        return False\n\n    return b", "entry_point": "booleanise", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/anchor/elasticsearchadmin/blob/80b5adf79ead341ce0ded34119b087a343425983/esadmin/elasticsearchadmin.py#L272-L290", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033441", "code": "def filter_arc(w, h, aspect):\n    \"\"\"Aspect ratio convertor. you must specify output size and source aspect ratio (as float)\"\"\"\n    taspect = float(w)/h\n    if abs(taspect - aspect) < 0.01:\n        return \"scale=%s:%s\"%(w,h)\n    if taspect > aspect: # pillarbox\n        pt = 0\n        ph = h\n        pw = int (h*aspect)\n        pl = int((w - pw)/2.0)\n    else: # letterbox\n        pl = 0\n        pw = w\n        ph = int(w * (1/aspect))\n        pt = int((h - ph)/2.0)\n    return \"scale=%s:%s[out];[out]pad=%s:%s:%s:%s:black\" % (pw,ph,w,h,pl,pt)", "entry_point": "filter_arc", "input": "3, 1, 5", "output": "'scale=3:0[out];[out]pad=3:1:0:0:black'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/media/fffilters.py#L34-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033442", "code": "def s2time(secs, show_secs=True, show_fracs=True):\n    \"\"\"Converts seconds to time\"\"\"\n    try:\n        secs = float(secs)\n    except:\n        return \"--:--:--.--\"\n    wholesecs = int(secs)\n    centisecs = int((secs - wholesecs) * 100)\n    hh = int(wholesecs / 3600)\n    hd = int(hh % 24)\n    mm = int((wholesecs / 60) - (hh*60))\n    ss = int(wholesecs - (hh*3600) - (mm*60))\n    r = \"{:02d}:{:02d}\".format(hd, mm)\n    if show_secs:\n        r += \":{:02d}\".format(ss)\n    if show_fracs:\n        r += \".{:02d}\".format(centisecs)\n    return r", "entry_point": "s2time", "input": "[[1, 2], [3], []], [], ['a', 'b', 'c']", "output": "'--:--:--.--'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L47-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033443", "code": "def f2tc(f,base=25):\n    \"\"\"Converts frames to timecode\"\"\"\n    try:\n        f = int(f)\n    except:\n        return \"--:--:--:--\"\n    hh = int((f / base) / 3600)\n    mm = int(((f / base) / 60) - (hh*60))\n    ss = int((f/base) - (hh*3600) - (mm*60))\n    ff = int(f - (hh*3600*base) - (mm*60*base) - (ss*base))\n    return \"{:02d}:{:02d}:{:02d}:{:02d}\".format(hh, mm, ss, ff)", "entry_point": "f2tc", "input": "[], []", "output": "'--:--:--:--'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L67-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033444", "code": "def s2tc(s,base=25):\n    \"\"\"Converts seconds to timecode\"\"\"\n    try:\n        f = int(s*base)\n    except:\n        return \"--:--:--:--\"\n    hh  = int((f / base) / 3600)\n    hhd = int((hh % 24))\n    mm  = int(((f / base) / 60) - (hh*60))\n    ss  = int((f/base) - (hh*3600) - (mm*60))\n    ff  = int(f - (hh*3600*base) - (mm*60*base) - (ss*base))\n    return \"{:02d}:{:02d}:{:02d}:{:02d}\".format(hhd, mm, ss, ff)", "entry_point": "s2tc", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "'--:--:--:--'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/immstudios/nxtools/blob/8c30213c61aec460c648d5e9ae7ce79dfb7b4b9a/nxtools/timeutils.py#L80-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033445", "code": "def to_bool(answer, default):\n    \"\"\"\n    Converts user answer to boolean\n    \"\"\"\n    answer = str(answer).lower()\n    default = str(default).lower()\n\n    if answer and answer in \"yes\":\n        return True\n\n    return False", "entry_point": "to_bool", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/avladev/pypro/blob/7eb98c5ebd9830104689d105c36424b24c72b475/pypro/console.py#L37-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033446", "code": "def _parse_unit(unit, placement_str):\n    \"\"\"Parse a unit as part of the unit placement.\n\n    Return the unit as an integer or None.\n    Raise a ValueError if the unit is specified but it is not a digit.\n    \"\"\"\n    if not unit:\n        return None\n    try:\n        return int(unit)\n    except (TypeError, ValueError):\n        msg = 'unit in placement {} must be digit'.format(placement_str)\n        raise ValueError(msg.encode('utf-8'))", "entry_point": "_parse_unit", "input": "3, 10", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/juju-bundlelib/blob/c2efa614f53675ed9526027776448bfbb0454ca6/jujubundlelib/models.py#L101-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033447", "code": "def escape_string(text):\n    \"\"\"Remove problematic characters.\n\n    Parameters\n    ----------\n    text\n        A string with potentially problematic characters.\n\n    Returns\n    -------\n    string\n        The text with characters removed.\n\n\n    Examples\n    -------\n    >>> s = r'hello_world$here'\n    >>> escape_string(s) == r'helloworldhere'\n    True\n    \"\"\"\n    if text is None:\n        return text\n\n\n    TO_REMOVE = [r'&', r'%', r'$', r'#', r'_', r'{', r'}',\n                 r'~', r'^', r'\\\\']\n\n    for char in TO_REMOVE:\n        text = text.replace(char, '')\n    return text", "entry_point": "escape_string", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/utils.py#L35-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033448", "code": "def all_equal(iterable):\n    \"\"\"Checks whether all items in an iterable are equal.\n\n    Parameters\n    ----------\n    iterable\n        An iterable, e.g. a string og a list.\n\n    Returns\n    -------\n    boolean\n        True or False.\n    \n    Examples\n    -------\n    >>> all_equal([2, 2, 2])\n    True\n    >>> all_equal([1, 2, 3])\n    False\n    \"\"\"\n    if len(iterable) in [0, 1]:\n        return False\n\n    first = iterable[0]\n    return all([first == i for i in iterable[1:]])", "entry_point": "all_equal", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/utils.py#L170-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033449", "code": "def spread(iterable):\n    \"\"\"Returns the maximal spread of a sorted list of numbers.\n\n    Parameters\n    ----------\n    iterable\n        A list of numbers.\n\n    Returns\n    -------\n    max_diff\n        The maximal difference when the iterable is sorted.\n\n\n    Examples\n    -------\n    >>> spread([1, 11, 13, 15])\n    10\n    \n    >>> spread([1, 15, 11, 13])\n    10\n    \"\"\"\n    if len(iterable) == 1:\n        return 0\n\n    iterable = iterable.copy()\n    iterable.sort()\n\n    max_diff = max(abs(i - j) for (i, j) in zip(iterable[1:], iterable[:-1]))\n\n    return max_diff", "entry_point": "spread", "input": "[5, 3, 1, 4]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/utils.py#L276-L306", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033450", "code": "def split_hostmask(hostmask):\n    \"\"\"Splits a nick@host string into nick and host.\"\"\"\n    nick, _, host = hostmask.partition('@')\n    nick, _, user = nick.partition('!')\n    return nick, user or None, host or None", "entry_point": "split_hostmask", "input": "'AbC dEf'", "output": "('AbC dEf', None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ayust/kitnirc/blob/cf19fe39219da75f053e1a3976bf21331b6fefea/kitnirc/user.py#L1-L5", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033451", "code": "def _validate_num_units(num_units, service_name, add_error):\n    \"\"\"Check that the given num_units is valid.\n\n    Use the given service name to describe possible errors.\n    Use the given add_error callable to register validation error.\n\n    If no errors are encountered, return the number of units as an integer.\n    Return None otherwise.\n    \"\"\"\n    if num_units is None:\n        # This should be a subordinate charm.\n        return 0\n    try:\n        num_units = int(num_units)\n    except (TypeError, ValueError):\n        add_error(\n            'num_units for service {} must be a digit'.format(service_name))\n        return\n    if num_units < 0:\n        add_error(\n            'num_units {} for service {} must be a positive digit'\n            ''.format(num_units, service_name))\n        return\n    return num_units", "entry_point": "_validate_num_units", "input": "1, 'walnut thistle harbour', ['apple', 'banana', 'cherry']", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/juju-bundlelib/blob/c2efa614f53675ed9526027776448bfbb0454ca6/jujubundlelib/validation.py#L209-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033452", "code": "def dict_update(base_dict, update_dict):\n    \"\"\"Return an updated dictionary.\n\n    If ``update_dict`` is a dictionary it will be used to update the `\n    `base_dict`` which is then returned.\n\n    :param request_kwargs: ``dict``\n    :param kwargs: ``dict``\n    :return: ``dict``\n    \"\"\"\n    if isinstance(update_dict, dict):\n        base_dict.update(update_dict)\n\n    return base_dict", "entry_point": "dict_update", "input": "{'a': 1, 'b': 2}, {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudnull/cloudlib/blob/5038111ce02521caa2558117e3bae9e1e806d315/cloudlib/utils.py#L65-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033453", "code": "def _next_unit_in_service(service, placed_in_services):\n    \"\"\"Return the unit number where to place a unit placed on a service.\n\n    Receive the service name and a dict mapping service names to the current\n    number of placed units in that service.\n    \"\"\"\n    current = placed_in_services.get(service)\n    number = 0 if current is None else current + 1\n    placed_in_services[service] = number\n    return number", "entry_point": "_next_unit_in_service", "input": "2.0, {'a': 1, 'b': 2}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/juju-bundlelib/blob/c2efa614f53675ed9526027776448bfbb0454ca6/jujubundlelib/changeset.py#L260-L269", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033454", "code": "def _join(segments):\n    \"\"\"simply list by joining adjacent segments.\"\"\"\n    new = []\n    start = segments[0][0]\n    end = segments[0][1]\n    for i in range(len(segments)-1):\n        if segments[i+1][0] != segments[i][1]:\n            new.append((start, end))\n            start = segments[i+1][0]\n        end = segments[i+1][1]\n    new.append((start, end))\n    return new", "entry_point": "_join", "input": "['apple', 'banana', 'cherry']", "output": "[('a', 'p'), ('b', 'a'), ('c', 'h')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/gfs.py#L38-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033455", "code": "def _saferound(value, decimal_places):\n    \"\"\"\n    Rounds a float value off to the desired precision\n    \"\"\"\n    try:\n        f = float(value)\n    except ValueError:\n        return ''\n    format = '%%.%df' % decimal_places\n    return format % f", "entry_point": "_saferound", "input": "'a,b,c', True", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eyeseast/python-tablefu/blob/d8761c1f87e3f89d9b89b0b6b9283fc4738b6676/table_fu/formatting.py#L10-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033456", "code": "def capfirst(value, failure_string='N/A'):\n    \"\"\"\n    Capitalizes the first character of the value.\n    \n    If the submitted value isn't a string, returns the `failure_string` keyword\n    argument.\n    \n    Cribbs from django's default filter set\n    \"\"\"\n    try:\n        value = value.lower()\n        return value[0].upper() + value[1:]\n    except:\n        return failure_string", "entry_point": "capfirst", "input": "[5, 3, 1, 4], 'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eyeseast/python-tablefu/blob/d8761c1f87e3f89d9b89b0b6b9283fc4738b6676/table_fu/formatting.py#L41-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033457", "code": "def dollar_signs(value, failure_string='N/A'):\n    \"\"\"\n    Converts an integer into the corresponding number of dollar sign symbols.\n    \n    If the submitted value isn't a string, returns the `failure_string` keyword\n    argument.\n    \n    Meant to emulate the illustration of price range on Yelp.\n    \"\"\"\n    try:\n        count = int(value)\n    except ValueError:\n        return failure_string\n    string = ''\n    for i in range(0, count):\n        string += '$'\n    return string", "entry_point": "dollar_signs", "input": "'AbC dEf', {1, 2, 3}", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eyeseast/python-tablefu/blob/d8761c1f87e3f89d9b89b0b6b9283fc4738b6676/table_fu/formatting.py#L61-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033458", "code": "def image(value, width='', height=''):\n    \"\"\"\n    Accepts a URL and returns an HTML image tag ready to be displayed.\n    \n    Optionally, you can set the height and width with keyword arguments.\n    \"\"\"\n    style = \"\"\n    if width:\n        style += \"width:%s\" % width\n    if height:\n        style += \"height:%s\" % height\n    data_dict = dict(src=value, style=style)\n    return '<img src=\"%(src)s\" style=\"%(style)s\">' % data_dict", "entry_point": "image", "input": "[], 0, 7", "output": "'<img src=\"[]\" style=\"height:7\">'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eyeseast/python-tablefu/blob/d8761c1f87e3f89d9b89b0b6b9283fc4738b6676/table_fu/formatting.py#L80-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033459", "code": "def _take(d, key, default=None):\n    \"\"\"\n    If the key is present in dictionary, remove it and return it's\n    value. If it is not present, return None.\n    \"\"\"\n    if key in d:\n        cmd = d[key]\n        del d[key]\n        return cmd\n    else:\n        return default", "entry_point": "_take", "input": "[[1, 2], [3], []], [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jtmoulia/switchboard-python/blob/c9b0cb74cb12a64385465091be633e78d39f08b1/switchboard/__init__.py#L141-L151", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033460", "code": "def Morsi_Alexander(Re):\n    r'''Calculates drag coefficient of a smooth sphere using the method in\n    [1]_ as described in [2]_.\n\n    .. math::\n        C_D = \\left\\{ \\begin{array}{ll}\n        \\frac{24}{Re} & \\mbox{if $Re < 0.1$}\\\\\n        \\frac{22.73}{Re}+\\frac{0.0903}{Re^2} + 3.69 & \\mbox{if $0.1 < Re < 1$}\\\\\n        \\frac{29.1667}{Re}-\\frac{3.8889}{Re^2} + 1.2220 & \\mbox{if $1 < Re < 10$}\\\\\n        \\frac{46.5}{Re}-\\frac{116.67}{Re^2} + 0.6167 & \\mbox{if $10 < Re < 100$}\\\\\n        \\frac{98.33}{Re}-\\frac{2778}{Re^2} + 0.3644 & \\mbox{if $100 < Re < 1000$}\\\\\n        \\frac{148.62}{Re}-\\frac{4.75\\times10^4}{Re^2} + 0.3570 & \\mbox{if $1000 < Re < 5000$}\\\\\n        \\frac{-490.5460}{Re}+\\frac{57.87\\times10^4}{Re^2} + 0.46 & \\mbox{if $5000 < Re < 10000$}\\\\\n        \\frac{-1662.5}{Re}+\\frac{5.4167\\times10^6}{Re^2} + 0.5191 & \\mbox{if $10000 < Re < 50000$}\\end{array} \\right.\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number of the sphere, [-]\n\n    Returns\n    -------\n    Cd : float\n        Drag coefficient [-]\n\n    Notes\n    -----\n    Range is Re <= 2E5.\n    Original was reviewed, and confirmed to contain the cited equations.\n\n    Examples\n    --------\n    >>> Morsi_Alexander(200)\n    0.7866\n\n    References\n    ----------\n    .. [1] Morsi, S. A., and A. J. Alexander. \"An Investigation of Particle\n       Trajectories in Two-Phase Flow Systems.\" Journal of Fluid Mechanics\n       55, no. 02 (September 1972): 193-208. doi:10.1017/S0022112072001806.\n    .. [2] Barati, Reza, Seyed Ali Akbar Salehi Neyshabouri, and Goodarz\n       Ahmadi. \"Development of Empirical Models with High Accuracy for\n       Estimation of Drag Coefficient of Flow around a Smooth Sphere: An\n       Evolutionary Approach.\" Powder Technology 257 (May 2014): 11-19.\n       doi:10.1016/j.powtec.2014.02.045.\n    '''\n    if Re < 0.1:\n        Cd = 24./Re\n    elif Re < 1:\n        Cd = 22.73/Re + 0.0903/Re**2 + 3.69\n    elif Re < 10:\n        Cd = 29.1667/Re - 3.8889/Re**2 + 1.222\n    elif Re < 100:\n        Cd = 46.5/Re - 116.67/Re**2 + 0.6167\n    elif Re < 1000:\n        Cd = 98.33/Re - 2778./Re**2 + 0.3644\n    elif Re < 5000:\n        Cd = 148.62/Re - 4.75E4/Re**2 + 0.357\n    elif Re < 10000:\n        Cd = -490.546/Re + 57.87E4/Re**2 + 0.46\n    else:\n        Cd = -1662.5/Re + 5.4167E6/Re**2 + 0.5191\n    return Cd", "entry_point": "Morsi_Alexander", "input": "3", "output": "10.512133333333333", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fpi/blob/6e6da3b9d0c17e10cc0886c97bc1bb8aeba2cca5/fpi/drag.py#L278-L340", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033461", "code": "def Almedeij(Re):\n    r'''Calculates drag coefficient of a smooth sphere using the method in\n    [1]_ as described in [2]_.\n\n    .. math::\n        C_D = \\left[\\frac{1}{(\\phi_1 + \\phi_2)^{-1} + (\\phi_3)^{-1}} + \\phi_4\\right]^{0.1}\n\n        \\phi_1 = (24Re^{-1})^{10} + (21Re^{-0.67})^{10} + (4Re^{-0.33})^{10} + 0.4^{10}\n\n        \\phi_2 = \\left[(0.148Re^{0.11})^{-10} + (0.5)^{-10}\\right]^{-1}\n\n        \\phi_3 = (1.57\\times10^8Re^{-1.625})^{10}\n\n        \\phi_4 = \\left[(6\\times10^{-17}Re^{2.63})^{-10} + (0.2)^{-10}\\right]^{-1}\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number of the sphere, [-]\n\n    Returns\n    -------\n    Cd : float\n        Drag coefficient [-]\n\n    Notes\n    -----\n    Range is Re <= 1E6.\n    Original work has been reviewed.\n\n    Examples\n    --------\n    >>> Almedeij(200.)\n    0.7114768646813396\n\n    References\n    ----------\n    .. [1] Almedeij, Jaber. \"Drag Coefficient of Flow around a Sphere: Matching\n       Asymptotically the Wide Trend.\" Powder Technology 186, no. 3\n       (September 10, 2008): 218-23. doi:10.1016/j.powtec.2007.12.006.\n    .. [2] Barati, Reza, Seyed Ali Akbar Salehi Neyshabouri, and Goodarz\n       Ahmadi. \"Development of Empirical Models with High Accuracy for\n       Estimation of Drag Coefficient of Flow around a Smooth Sphere: An\n       Evolutionary Approach.\" Powder Technology 257 (May 2014): 11-19.\n       doi:10.1016/j.powtec.2014.02.045.\n    '''\n    phi4 = ((6E-17*Re**2.63)**-10 + 0.2**-10)**-1\n    phi3 = (1.57E8*Re**-1.625)**10\n    phi2 = ((0.148*Re**0.11)**-10 + 0.5**-10)**-1\n    phi1 = (24*Re**-1)**10 + (21*Re**-0.67)**10 + (4*Re**-0.33)**10 + 0.4**10\n    Cd = (1/((phi1 + phi2)**-1 + phi3**-1) + phi4)**0.1\n    return Cd", "entry_point": "Almedeij", "input": "True", "output": "24.567115974199623", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fpi/blob/6e6da3b9d0c17e10cc0886c97bc1bb8aeba2cca5/fpi/drag.py#L834-L885", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033462", "code": "def _incident_transform(incident):\n    \"\"\"Get output dict from incident.\"\"\"\n    return {\n        'id': incident.get('cdid'),\n        'type': incident.get('type'),\n        'timestamp': incident.get('date'),\n        'lat': incident.get('lat'),\n        'lon': incident.get('lon'),\n        'location': incident.get('address'),\n        'link': incident.get('link')\n    }", "entry_point": "_incident_transform", "input": "{'a': 1, 'b': 2}", "output": "{'id': None, 'type': None, 'timestamp': None, 'lat': None, 'lon': None, 'location': None, 'link': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jcconnell/python-spotcrime/blob/3e0bde254a63e33c099ea509a0662be581ebe1bf/spotcrime/__init__.py#L31-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033463", "code": "def sort_prefixes(orig, prefixes='@+'):\n    \"\"\"Returns a sorted list of prefixes.\n\n    Args:\n        orig (str): Unsorted list of prefixes.\n        prefixes (str): List of prefixes, from highest-priv to lowest.\n    \"\"\"\n    new = ''\n    for prefix in prefixes:\n        if prefix in orig:\n            new += prefix\n    return new", "entry_point": "sort_prefixes", "input": "[5, 3, 1, 4], '  padded  '", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/goshuirc/irc/blob/d6a5e3e04d337566c009b087f108cd76f9e122cc/girc/utils.py#L8-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033464", "code": "def bootstrap_alert(visitor, items):\n    \"\"\"\n    Format:\n        \n        [[alert(class=error)]]:\n            message\n    \"\"\"\n    txt = []\n    for x in items:\n        cls = x['kwargs'].get('class', '')\n        if cls:\n            cls = 'alert-%s' % cls\n        txt.append('<div class=\"alert %s\">' % cls)\n        if 'close' in x['kwargs']:\n            txt.append('<button class=\"close\" data-dismiss=\"alert\">&times;</button>')\n        text = visitor.parse_text(x['body'], 'article')\n        txt.append(text)\n        txt.append('</div>')\n    return '\\n'.join(txt)", "entry_point": "bootstrap_alert", "input": "[5, 3, 1, 4], set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/par/blob/0863c339c8d0d46f8516eb4577b459b9cf2dec8d/par/bootstrap_ext.py#L36-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033465", "code": "def binary_search(a, k):\r\n    \"\"\"\r\n    Do a binary search in an array of objects ordered by '.key'\r\n\r\n    returns the largest index for which:  a[i].key <= k\r\n\r\n    like c++: a.upperbound(k)--\r\n    \"\"\"\r\n    first, last = 0, len(a)\r\n    while first < last:\r\n        mid = (first + last) >> 1\r\n        if k < a[mid].key:\r\n            last = mid\r\n        else:\r\n            first = mid + 1\r\n    return first - 1", "entry_point": "binary_search", "input": "[], ['apple', 'banana', 'cherry']", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Carbonara-Project/Guanciale/blob/c239ffac6fb481d09c4071d1de1a09f60dc584ab/guanciale/idblib.py#L351-L366", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033466", "code": "def deltafmt(delta, decimals = None):\n    \"\"\"\nReturns a human readable representation of a time with the format:\n\n    [[[Ih]Jm]K[.L]s\n\nFor example: 6h5m23s\n\nIf \"decimals\" is specified, the seconds will be output with that many decimal places.\nIf not, there will be two places for times less than 1 minute, one place for times\nless than 10 minutes, and zero places otherwise\n\"\"\"\n    try:\n        delta = float(delta)\n    except:\n        return '(bad delta: %s)' % (str(delta),)\n    if delta < 60:\n        if decimals is None:\n            decimals = 2\n        return (\"{0:.\"+str(decimals)+\"f}s\").format(delta)\n    mins = int(delta/60)\n    secs = delta - mins*60\n    if delta < 600:\n        if decimals is None:\n            decimals = 1\n        return (\"{0:d}m{1:.\"+str(decimals)+\"f}s\").format(mins, secs)\n    if decimals is None:\n        decimals = 0\n    hours = int(mins/60)\n    mins -= hours*60\n    if delta < 3600:\n        return \"{0:d}m{1:.0f}s\".format(mins, secs)\n    else:\n        return (\"{0:d}h{1:d}m{2:.\"+str(decimals)+\"f}s\").format(hours, mins, secs)", "entry_point": "deltafmt", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "\"(bad delta: ['a', 'b', 'c'])\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/utils.py#L186-L219", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033467", "code": "def param_upload(field, path):\n    \"\"\" Pack upload metadata. \"\"\"\n    if not path:\n        return None\n    param = {}\n    param['field'] = field\n    param['path'] = path\n    return param", "entry_point": "param_upload", "input": "[1, 2, 3], 'walnut thistle harbour'", "output": "{'field': [1, 2, 3], 'path': 'walnut thistle harbour'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tchx84/grestful/blob/5f7ee7eb358cf260c97d41f8680e8f168ef5d843/grestful/helpers.py#L19-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033468", "code": "def filter_core_keywords(keywords):\n    \"\"\"Only return keywords that are CORE.\"\"\"\n    matches = {}\n    for kw, info in keywords.items():\n        if kw.core:\n            matches[kw] = info\n    return matches", "entry_point": "filter_core_keywords", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/engine.py#L485-L491", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033469", "code": "def _parse_marc_code(field):\n    \"\"\"Parse marc field and return default indicators if not filled in.\"\"\"\n    field = str(field)\n    if len(field) < 4:\n        raise Exception('Wrong field code: %s' % field)\n    else:\n        field += '__'\n    tag = field[0:3]\n    ind1 = field[3].replace('_', '')\n    ind2 = field[4].replace('_', '')\n    return tag, ind1, ind2", "entry_point": "_parse_marc_code", "input": "['a', 'b', 'c']", "output": "(\"['a\", \"'\", ',')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/engine.py#L580-L590", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033470", "code": "def origin_canada(origin):\n    \"\"\"\\\n    Returns if the origin is Canada.\n\n    `origin`\n        The origin to check.\n    \"\"\"\n    return origin in (\n    u'CALGARY', u'HALIFAX', u'MONTREAL', u'QUEBEC', u'OTTAWA', u'TORONTO',\n    u'VANCOUVER')", "entry_point": "origin_canada", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/cablemap/blob/42066c8fc2972d237a2c35578e14525aaf705f38/cablemap.core/cablemap/core/predicates.py#L583-L592", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033471", "code": "def origin_germany(origin):\n    \"\"\"\\\n    Returns if the origin is Germany.\n\n    `origin`\n        The origin to check.\n    \"\"\"\n    return origin in (u'BONN', u'BERLIN', u'DUSSELDORF', u'FRANKFURT',\n                      u'HAMBURG', u'LEIPZIG', u'MUNICH')", "entry_point": "origin_germany", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/cablemap/blob/42066c8fc2972d237a2c35578e14525aaf705f38/cablemap.core/cablemap/core/predicates.py#L916-L924", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033472", "code": "def origin_iraq(origin):\n    \"\"\"\\\n    Returns if the origin is Iraq.\n\n    `origin`\n        The origin to check.\n    \"\"\"\n    return origin == u'BAGHDAD' \\\n           or u'BASRAH' in origin \\\n           or u'HILLAH' in origin \\\n           or u'KIRKUK' in origin \\\n           or u'MOSUL' in origin", "entry_point": "origin_iraq", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/cablemap/blob/42066c8fc2972d237a2c35578e14525aaf705f38/cablemap.core/cablemap/core/predicates.py#L1057-L1068", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033473", "code": "def origin_mexico(origin):\n    \"\"\"\\\n    Returns if the origin is Mexico.\n\n    `origin`\n        The origin to check.\n    \"\"\"\n    return origin in (u'CIUDADJUAREZ', u'GUADALAJARA', u'HERMOSILLO',\n                      u'MATAMOROS', u'MERIDA', u'MEXICO', u'MONTERREY',\n                      u'NOGALES',\n                      u'NUEVOLAREDO', u'TIJUANA')", "entry_point": "origin_mexico", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/cablemap/blob/42066c8fc2972d237a2c35578e14525aaf705f38/cablemap.core/cablemap/core/predicates.py#L1352-L1362", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033474", "code": "def queryize(terms, exclude_screen_name=None):\n    '''\n    Create query from list of terms, using OR\n    but intelligently excluding terms beginning with '-' (Twitter's NOT operator).\n    Optionally add -from:exclude_screen_name.\n\n    >>> helpers.queryize(['apple', 'orange', '-peach'])\n    u'apple OR orange -peach'\n\n    Args:\n        terms (list): Search terms.\n        exclude_screen_name (str): A single screen name to exclude from the search.\n\n    Returns:\n        A string ready to be passed to tweepy.API.search\n    '''\n    ors = ' OR '.join('\"{}\"'.format(x) for x in terms if not x.startswith('-'))\n    nots = ' '.join('-\"{}\"'.format(x[1:]) for x in terms if x.startswith('-'))\n    sn = \"-from:{}\".format(exclude_screen_name) if exclude_screen_name else ''\n    return ' '.join((ors, nots, sn))", "entry_point": "queryize", "input": "['apple', 'banana', 'cherry'], 'Hello World'", "output": "'\"apple\" OR \"banana\" OR \"cherry\"  -from:Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fitnr/twitter_bot_utils/blob/21f35afa5048cd3efa54db8cb87d405f69a78a62/twitter_bot_utils/helpers.py#L162-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033475", "code": "def _normalize_encoding(encoding):\n    \"\"\"returns normalized name for <encoding>\n\n    see dist/src/Parser/tokenizer.c 'get_normal_name()'\n    for implementation details / reference\n\n    NOTE: for now, parser.suite() raises a MemoryError when\n          a bad encoding is used. (SF bug #979739)\n    \"\"\"\n    if encoding is None:\n        return None\n    # lower() + '_' / '-' conversion\n    encoding = encoding.replace('_', '-').lower()\n    if encoding == 'utf-8' or encoding.startswith('utf-8-'):\n        return 'utf-8'\n    for variant in ['latin-1', 'iso-latin-1', 'iso-8859-1']:\n        if (encoding == variant or\n            encoding.startswith(variant + '-')):\n            return 'iso-8859-1'\n    return encoding", "entry_point": "_normalize_encoding", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/pyparser/pyparse.py#L14-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033476", "code": "def uniq(items):\n    \"\"\"Remove duplicates in given list with its order kept.\n\n    >>> uniq([])\n    []\n    >>> uniq([1, 4, 5, 1, 2, 3, 5, 10])\n    [1, 4, 5, 2, 3, 10]\n    \"\"\"\n    acc = items[:1]\n    for item in items[1:]:\n        if item not in acc:\n            acc += [item]\n\n    return acc", "entry_point": "uniq", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ssato/python-anytemplate/blob/3e56baa914bd47f044083b20e33100f836443596/anytemplate/utils.py#L44-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033477", "code": "def _unicode(p):\n    \"\"\"\n    Used when force_unicode is True (default), the tags and values in the dict\n    will be coerced as 'str' (or 'unicode' with Python2).   In Python3 they can\n    otherwise end up as a mixtures of 'str' and 'bytes'.\n\"\"\"\n    q = {}\n    for tag in p:\n        vals = []\n        for v in p[tag]:\n            if type(v) is not str:                                                              # pragma: no cover\n                v = v.decode('utf-8')\n            vals.append(v)\n        if type(tag) is not str:                                                                # pragma: no cover\n            tag = tag.decode('utf-8')\n        q[tag] = vals\n    return q", "entry_point": "_unicode", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/httpd.py#L468-L484", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033478", "code": "def parse_brome_config_from_browser_config(browser_config):\n    \"\"\"Parse the browser config and look for brome specific config\n\n    Args:\n        browser_config (dict)\n    \"\"\"\n\n    config = {}\n\n    brome_keys = [key for key in browser_config if key.find(':') != -1]\n\n    for brome_key in brome_keys:\n        section, option = brome_key.split(':')\n        value = browser_config[brome_key]\n\n        if section not in config:\n            config[section] = {}\n\n        config[section][option] = value\n\n    return config", "entry_point": "parse_brome_config_from_browser_config", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/core/configurator.py#L36-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033479", "code": "def _create_regex_pattern_add_optional_spaces_to_word_characters(word):\n    r\"\"\"Add the regex special characters (\\s*) to allow optional spaces.\n\n    :param word: (string) the word to be inserted into a regex pattern.\n    :return: (string) the regex pattern for that word with optional spaces\n                      between all of its characters.\n    \"\"\"\n    new_word = u\"\"\n    for ch in word:\n        if ch.isspace():\n            new_word += ch\n        else:\n            new_word += ch + r'\\s*'\n    return new_word", "entry_point": "_create_regex_pattern_add_optional_spaces_to_word_characters", "input": "'AbC dEf'", "output": "'A\\\\s*b\\\\s*C\\\\s* d\\\\s*E\\\\s*f\\\\s*'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/regexs.py#L674-L687", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033480", "code": "def get_suffixes(arr):\n    \"\"\" Returns all possible suffixes of an array (lazy evaluated)\n    Args:\n        arr: input array\n    Returns:\n        Array of all possible suffixes (as tuples)\n    \"\"\"\n    arr = tuple(arr)\n    return [arr]\n    return (arr[i:] for i in range(len(arr)))", "entry_point": "get_suffixes", "input": "[-1, 0, 1, 2]", "output": "[(-1, 0, 1, 2)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wilzbach/smarkov/blob/c98c08cc432e18c5c87fb9a6e013b1b8eaa54d37/smarkov/utils.py#L26-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033481", "code": "def ordered_uniqify(sequence):\n    \"\"\"\n    Uniqifies the given hashable sequence while preserving its order.\n\n    :param sequence: Sequence.\n    :type sequence: object\n    :return: Uniqified sequence.\n    :rtype: list\n    \"\"\"\n\n    items = set()\n    return [key for key in sequence if key not in items and not items.add(key)]", "entry_point": "ordered_uniqify", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KelSolaar/Foundations/blob/5c141330faf09dad70a12bc321f4c564917d0a91/foundations/common.py#L86-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033482", "code": "def dependency_resolver(dependencies):\n    \"\"\"\n    Resolves given dependencies.\n\n    :param dependencies: Dependencies to resolve.\n    :type dependencies: dict\n    :return: Resolved dependencies.\n    :rtype: list\n    \"\"\"\n\n    items = dict((key, set(dependencies[key])) for key in dependencies)\n    resolved_dependencies = []\n    while items:\n        batch = set(item for value in items.values() for item in value) - set(items.keys())\n        batch.update(key for key, value in items.items() if not value)\n        resolved_dependencies.append(batch)\n        items = dict(((key, value - batch) for key, value in items.items() if value))\n    return resolved_dependencies", "entry_point": "dependency_resolver", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KelSolaar/Foundations/blob/5c141330faf09dad70a12bc321f4c564917d0a91/foundations/common.py#L198-L215", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033483", "code": "def _capitalize_first_letter(word):\n    \"\"\"Return a regex pattern with the first letter.\n\n    Accepts both lowercase and uppercase.\n    \"\"\"\n    if word[0].isalpha():\n        # These two cases are necessary in order to get a regex pattern\n        # starting with '[xX]' and not '[Xx]'. This allows to check for\n        # colliding regex afterwards.\n        if word[0].isupper():\n            return \"[\" + word[0].swapcase() + word[0] + \"]\" + word[1:]\n        else:\n            return \"[\" + word[0] + word[0].swapcase() + \"]\" + word[1:]\n    return word", "entry_point": "_capitalize_first_letter", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/reader.py#L693-L706", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033484", "code": "def parse_set(string):\n    \"\"\"Parse set from comma separated string.\"\"\"\n    string = string.strip()\n    if string:\n        return set(string.split(\",\"))\n    else:\n        return set()", "entry_point": "parse_set", "input": "'AbC dEf'", "output": "{'AbC dEf'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/requirements.py#L40-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033485", "code": "def merge_adjacent(numbers, indicator='..', base=0):\n    \"\"\" Merge adjacent numbers in an iterable of numbers.\n\n        Parameters:\n            numbers (list): List of integers or numeric strings.\n            indicator (str): Delimiter to indicate generated ranges.\n            base (int): Passed to the `int()` conversion when comparing numbers.\n\n        Return:\n            list of str: Condensed sequence with either ranges or isolated numbers.\n    \"\"\"\n    integers = list(sorted([(int(\"%s\" % i, base), i) for i in numbers]))\n    idx = 0\n    result = []\n    while idx < len(numbers):\n        end = idx + 1\n        while end < len(numbers) and integers[end-1][0] == integers[end][0] - 1:\n            end += 1\n\n        result.append(\"%s%s%s\" % (integers[idx][1], indicator, integers[end-1][1])\n                      if end > idx + 1\n                      else \"%s\" % integers[idx][1])\n        idx = end\n    return result", "entry_point": "merge_adjacent", "input": "set(), set(), 'AbC dEf'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jhermann/rudiments/blob/028ec7237946115c7b18e50557cbc5f6b824653e/src/rudiments/humanize.py#L102-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033486", "code": "def align_up(offset, align):\n    \"\"\"Align ``offset`` up to ``align`` boundary.\n\n    Args:\n        offset (int): value to be aligned.\n        align (int): alignment boundary.\n\n    Returns:\n        int: aligned offset.\n\n    >>> align_up(3, 2)\n    4\n\n    >>> align_up(3, 1)\n    3\n    \"\"\"\n    remain = offset % align\n    if remain == 0:\n        return offset\n    else:\n        return offset + (align - remain)", "entry_point": "align_up", "input": "3.25, 7", "output": "7.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jhshi/wltrace/blob/4c8441162f7cddd47375da2effc52c95b97dc81d/wltrace/utils.py#L46-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033487", "code": "def sameState (s1, s2):\n    \"\"\"sameState(s1, s2)\n    Note:\n    state := [ nfaclosure : Long, [ arc ], accept : Boolean ]\n    arc := [ label, arrow : Int, nfaClosure : Long ]\n    \"\"\"\n    if (len(s1[1]) != len(s2[1])) or (s1[2] != s2[2]):\n        return False\n    for arcIndex in range(0, len(s1[1])):\n        arc1 = s1[1][arcIndex]\n        arc2 = s2[1][arcIndex]\n        if arc1[:-1] != arc2[:-1]:\n            return False\n    return True", "entry_point": "sameState", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/pyparser/pylexer.py#L168-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033488", "code": "def finalizeTempDfa (tempStates):\n    \"\"\"finalizeTempDfa (tempStates)\n\n    Input domain:\n    tempState := [ nfaClosure : Long, [ tempArc ], accept : Boolean ]\n    tempArc := [ label, arrow, nfaClosure ]\n\n    Output domain:\n    state := [ arcMap, accept : Boolean ]\n    \"\"\"\n    states = []\n    accepts = []\n    stateMap = {}\n    tempIndex = 0\n    for tempIndex in range(0, len(tempStates)):\n        tempState = tempStates[tempIndex]\n        if None != tempState:\n            stateMap[tempIndex] = len(states)\n            states.append({})\n            accepts.append(tempState[2])\n    for tempIndex in stateMap.keys():\n        stateBitset, tempArcs, accepting = tempStates[tempIndex]\n        newIndex = stateMap[tempIndex]\n        arcMap = states[newIndex]\n        for tempArc in tempArcs:\n            arcMap[tempArc[0]] = stateMap[tempArc[1]]\n    return states, accepts", "entry_point": "finalizeTempDfa", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/pyparser/pylexer.py#L213-L239", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033489", "code": "def cvt_iter(a):\n    '''\n    Convert an iterator/generator to a tuple so that it can be iterated again.\n\n    E.g., convert zip in PY3.\n    '''\n    if a is None:\n        return a\n\n    if not isinstance(a, (tuple, list)):\n        # convert iterator/generator to tuple\n        a = tuple(a)\n    return a", "entry_point": "cvt_iter", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ShenggaoZhu/midict/blob/2fad2edcfb753035b443a70fe15852affae1b5bb/midict/__init__.py#L37-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033490", "code": "def _int_to_key(keys, index):\n    'Convert int ``index`` to the corresponding key in ``keys``'\n    if isinstance(index, int):\n        try:\n            return keys[index]\n        except IndexError:\n            # use KeyError rather than IndexError for compatibility\n            raise KeyError('Index out of range of keys: %s' % (index,))\n    return index", "entry_point": "_int_to_key", "input": "['a', 'b', 'c'], 0", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ShenggaoZhu/midict/blob/2fad2edcfb753035b443a70fe15852affae1b5bb/midict/__init__.py#L203-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033491", "code": "def get_unique_name(name='', collection=()):\n    '''\n    Generate a unique name (str type) by appending a sequence number to\n    the original name so that it is not contained in the collection.\n    ``collection`` has a __contains__ method (tuple, list, dict, etc.)\n    '''\n    if name not in collection:\n        return name\n    i = 1\n    while True:\n        i += 1\n        name2 = '%s_%s' % (name, i)\n        if name2 not in collection:\n            return name2", "entry_point": "get_unique_name", "input": "'AbC dEf', []", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ShenggaoZhu/midict/blob/2fad2edcfb753035b443a70fe15852affae1b5bb/midict/__init__.py#L425-L438", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033492", "code": "def get_value_len(value):\n    '''\n    Get length of ``value``. If ``value`` (eg, iterator) has no len(), convert it to list first.\n\n    return both length and converted value.\n    '''\n    try:\n        Nvalue = len(value)\n    except TypeError:\n        # convert iterator/generator to list\n        value = list(value)\n        Nvalue = len(value)\n    return Nvalue, value", "entry_point": "get_value_len", "input": "[[1, 2], [3], []]", "output": "(3, [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ShenggaoZhu/midict/blob/2fad2edcfb753035b443a70fe15852affae1b5bb/midict/__init__.py#L441-L453", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033493", "code": "def _contains_span(span0, span1):\n    \"\"\"Return true if span0 contains span1, False otherwise.\"\"\"\n    if (span0 == span1 or span0[0] > span1[0] or span0[1] < span1[1]):\n        return False\n    return True", "entry_point": "_contains_span", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/keyworder.py#L340-L344", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033494", "code": "def unique_preserved_list(original_list):\n    \"\"\"\n    Return the unique items of a list in their original order.\n\n    :param original_list:\n        A list of items that may have duplicate entries.\n\n    :type original_list:\n        list\n\n    :returns:\n        A list with unique entries with the original order preserved.\n\n    :rtype:\n        list\n    \"\"\"\n    \n    seen = set()\n    seen_add = seen.add\n    return [x for x in original_list if x not in seen and not seen_add(x)]", "entry_point": "unique_preserved_list", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/andycasey/sick/blob/6c37686182794c4cafea45abf7062b30b789b1a2/sick/models/utils.py#L52-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033495", "code": "def _calc_checksum(values):\n        \"\"\"Calculate the symbol check character.\"\"\"\n        checksum = values[0]\n        for index, value in enumerate(values):\n            checksum += index * value\n        return checksum % 103", "entry_point": "_calc_checksum", "input": "[5, 3, 1, 4]", "output": "22", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Venti-/pubcode/blob/92af28ffbc524538ce33f17fcd08fb825641ad56/pubcode/code128.py#L267-L272", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033496", "code": "def force_list(data):\n    \"\"\"Force ``data`` to become a list.\n\n    You should use this method whenever you don't want to deal with the\n    fact that ``NoneType`` can't be iterated over. For example, instead\n    of writing::\n\n        bar = foo.get('bar')\n        if bar is not None:\n            for el in bar:\n                ...\n\n    you can write::\n\n        for el in force_list(foo.get('bar')):\n            ...\n\n    Args:\n        data: any Python object.\n\n    Returns:\n        list: a list representation of ``data``.\n\n    Examples:\n        >>> force_list(None)\n        []\n        >>> force_list('foo')\n        ['foo']\n        >>> force_list(('foo', 'bar'))\n        ['foo', 'bar']\n        >>> force_list(['foo', 'bar', 'baz'])\n        ['foo', 'bar', 'baz']\n\n    \"\"\"\n    if data is None:\n        return []\n    elif not isinstance(data, (list, tuple, set)):\n        return [data]\n    elif isinstance(data, (tuple, set)):\n        return list(data)\n    return data", "entry_point": "force_list", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/inspire-utils/blob/b0b5983c58700735dfde75e4c8bd32834f2473d4/inspire_utils/helpers.py#L30-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033497", "code": "def bar(msg='', width=40, position=None):\n    r\"\"\"\n    Returns a string with text centered in a bar caption.\n\n    Examples:\n    >>> bar('test', width=10)\n    '== test =='\n    >>> bar(width=10)\n    '=========='\n    >>> bar('Richard Dean Anderson is...', position='top', width=50)\n    '//========= Richard Dean Anderson is... ========\\\\\\\\'\n    >>> bar('...MacGyver', position='bottom', width=50)\n    '\\\\\\\\================= ...MacGyver ================//'\n    \"\"\"\n    if position == 'top':\n        start_bar = '//'\n        end_bar = r'\\\\'\n    elif position == 'bottom':\n        start_bar = r'\\\\'\n        end_bar = '//'\n    else:\n        start_bar = end_bar = '=='\n\n    if msg:\n        msg = ' ' + msg + ' '\n\n    width -= 4\n\n    return start_bar + msg.center(width, '=') + end_bar", "entry_point": "bar", "input": "'Hello World', 0, []", "output": "'== Hello World =='", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fusionbox/django-backupdb/blob/db4aa73049303245ef0182cda5c76b1dd194cd00/backupdb/utils/log.py#L7-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033498", "code": "def normalize_map_between(dictionary, norm_min, norm_max):\n    \"\"\"\n    Performs linear normalization of all values in Map between normMin and normMax\n\n    :param: map     Map to normalize values for\n    :param: normMin Smallest normalized value\n    :param: normMax Largest normalized value\n    :return: A new map with double values within [normMin, normMax]\n    \"\"\"\n    if len(dictionary) < 2:\n        return {}\n\n    values = list(dictionary.values())\n\n    norm_range = norm_max - norm_min\n    map_min = min(values)\n    map_range = max(values) - map_min\n    range_factor = norm_range / float(map_range)\n\n    normalized_map = {}\n    for key, value in dictionary.items():\n        normalized_map[key] = norm_min + (value - map_min) * range_factor\n\n    return normalized_map", "entry_point": "normalize_map_between", "input": "{}, [-1, 0, 1, 2], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/draperunner/fjlc/blob/d2cc8cf1244984e7caf0bf95b11ed1677a94c994/fjlc/utils/map_utils.py#L11-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033499", "code": "def __chunk(segment, abbr=False):\n    \"\"\"Generate a ``tuple`` of compass direction names.\n\n    Args:\n        segment (list): Compass segment to generate names for\n        abbr (bool): Names should use single letter abbreviations\n\n    Returns:\n        bool: Direction names for compass segment\n    \"\"\"\n    names = ('north', 'east', 'south', 'west', 'north')\n    if not abbr:\n        sjoin = '-'\n    else:\n        names = [s[0].upper() for s in names]\n        sjoin = ''\n    if segment % 2 == 0:\n        return (names[segment].capitalize(),\n                sjoin.join((names[segment].capitalize(), names[segment],\n                            names[segment + 1])),\n                sjoin.join((names[segment].capitalize(), names[segment + 1])),\n                sjoin.join((names[segment + 1].capitalize(), names[segment],\n                            names[segment + 1])))\n    else:\n        return (names[segment].capitalize(),\n                sjoin.join((names[segment].capitalize(), names[segment + 1],\n                            names[segment])),\n                sjoin.join((names[segment + 1].capitalize(), names[segment])),\n                sjoin.join((names[segment + 1].capitalize(),\n                            names[segment + 1], names[segment])))", "entry_point": "__chunk", "input": "True, 'a,b,c'", "output": "('E', 'ESE', 'SE', 'SSE')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JNRowe/upoints/blob/1e4b7a53ed2a06cd854523d54c36aabdccea3830/upoints/utils.py#L310-L339", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033500", "code": "def calc_check_digit(digits):\n        \"\"\"Calculate and return the GS1 check digit.\"\"\"\n        ints = [int(d) for d in digits]\n        l = len(ints)\n        odds = slice((l - 1) % 2, l, 2)\n        even = slice(l % 2, l, 2)\n        checksum = 3 * sum(ints[odds]) + sum(ints[even])\n        return str(-checksum % 10)", "entry_point": "calc_check_digit", "input": "[1, 2, 3]", "output": "'6'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mamrhein/identifiers/blob/93ab2609e461faff245d1f582411bf831b428eef/identifiers/gs1.py#L47-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033501", "code": "def channel_parameters(parameter_prefix, channel_names, configuration_entry):\n    \"\"\"\n    Return parameters specific to a channel for a model.\n    \"\"\"\n\n    if configuration_entry in (True, False):\n        return ([], [parameter_prefix])[configuration_entry]\n\n    parameters = []\n    if isinstance(configuration_entry, dict):\n        for name in set(channel_names).intersection(configuration_entry):\n            if configuration_entry[name] is True:\n                parameters.append(parameter_prefix + \"_\" + name)\n    else:\n        raise TypeError(\"incorrect type\")\n\n    return parameters", "entry_point": "channel_parameters", "input": "'walnut thistle harbour', 'AbC dEf', {'x': [1, 2], 'y': []}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/andycasey/sick/blob/6c37686182794c4cafea45abf7062b30b789b1a2/sick/models/base.py#L644-L660", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033502", "code": "def humanize_bytes(bytes, raw=False, precision=1):\n    \"\"\"Return a humanized string representation of a number of bytes.\n\n    >>> humanize_bytes(1)\n    '1 byte'\n    >>> humanize_bytes(2)\n    '2.0 bytes'\n    >>> humanize_bytes(1024)\n    '1.0 kB'\n    >>> humanize_bytes(1024*123)\n    '123.0 kB'\n    >>> humanize_bytes(1024*12342)\n    '12.1 MB'\n    >>> humanize_bytes(1024*12342, precision=2)\n    '12.05 MB'\n    >>> humanize_bytes(1024*1234, precision=2)\n    '1.21 MB'\n    >>> humanize_bytes(1024*1234*1111, precision=2)\n    '1.31 GB'\n    >>> humanize_bytes(1024*1234*1111)\n    '1.3 GB'\n    >>> humanize_bytes(1024, True)\n    1024\n    \"\"\"\n    if raw:\n        return bytes\n    abbrevs = (\n        (1 << 50, \"PB\"),\n        (1 << 40, \"TB\"),\n        (1 << 30, \"GB\"),\n        (1 << 20, \"MB\"),\n        (1 << 10, \"kB\"),\n        (1, \"bytes\")\n    )\n    if bytes == 1:\n        return \"1 byte\"\n    for factor, suffix in abbrevs:  # pragma: no cover\n        if bytes >= factor:\n            break\n    return \"%.*f %s\" % (precision, bytes / factor, suffix)", "entry_point": "humanize_bytes", "input": "[1, 2, 3], ['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saxix/django-sysinfo/blob/c743e0f18a95dc9a92e7309abe871d72b97fcdb4/src/django_sysinfo/utils.py#L61-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033503", "code": "def compute_jaccard_index(x_set, y_set):\n    \"\"\"Return the Jaccard similarity coefficient of 2 given sets.\n\n    Args:\n        x_set (set): first set.\n        y_set (set): second set.\n\n    Returns:\n        float: Jaccard similarity coefficient.\n\n    \"\"\"\n    if not x_set or not y_set:\n        return 0.0\n\n    intersection_cardinal = len(x_set & y_set)\n    union_cardinal = len(x_set | y_set)\n\n    return intersection_cardinal / float(union_cardinal)", "entry_point": "compute_jaccard_index", "input": "[], [5, 3, 1, 4]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/inspire-matcher/blob/1814e26c4d5faf205da2d5aa1638947c63db2d57/inspire_matcher/utils.py#L62-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033504", "code": "def _generate_lastnames_variations(lastnames):\n    \"\"\"Generate variations for lastnames.\n\n    Note:\n        This method follows the assumption that the first last name is the main one.\n        E.g. For 'Caro Estevez', this method generates: ['Caro', 'Caro Estevez'].\n        In the case the lastnames are dashed, it splits them in two.\n    \"\"\"\n    if not lastnames:\n        return []\n\n    split_lastnames = [split_lastname for lastname in lastnames for split_lastname in lastname.split('-')]\n\n    lastnames_variations = split_lastnames\n    if len(split_lastnames) > 1:\n        # Generate lastnames concatenation if there are more than one lastname after split.\n        lastnames_variations.append(u' '.join([lastname for lastname in split_lastnames]))\n\n    return lastnames_variations", "entry_point": "_generate_lastnames_variations", "input": "'walnut thistle harbour'", "output": "['w', 'a', 'l', 'n', 'u', 't', ' ', 't', 'h', 'i', 's', 't', 'l', 'e', ' ', 'h', 'a', 'r', 'b', 'o', 'u', 'r', 'w a l n u t   t h i s t l e   h a r b o u r']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/inspire-utils/blob/b0b5983c58700735dfde75e4c8bd32834f2473d4/inspire_utils/name.py#L283-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033505", "code": "def consecutiveness(password, consecutive_length=3):\n        \"\"\"\n        Consecutiveness is the enemy of entropy, but makes it easier to remember.\n        :param str password:\n        :param int consecutive_length: length of the segment to be uniform to consider loss of entropy\n        :param int base_length: usual length of the password\n        :return int: in range 0-1\n        >>> Complexity.consecutiveness('password')\n        1.0\n        >>> Complexity.consecutiveness('PaSsWoRd')\n        0.0\n        >>> Complexity.consecutiveness('yio')\n        0\n        \"\"\"\n        consec = 0\n        for i in range(len(password) - consecutive_length):\n            if all([char.islower() for char in password[i:i+consecutive_length]]):\n                consec += 1\n            elif all([char.islower() for char in password[i:i+consecutive_length]]):\n                consec += 1\n\n        try:\n            return consec / (len(password) - consecutive_length)\n        except ZeroDivisionError:\n            return 0", "entry_point": "consecutiveness", "input": "'a,b,c', 1", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/patarapolw/pronounceable/blob/c59fd0f6b392f40df68089628740f2edc418bad2/pronounceable/complexity.py#L222-L246", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033506", "code": "def val_to_mrc(code, val):\n    \"\"\"\n    Convert one single `val` to MRC.\n\n    This function may be used for control fields in MARC records.\n\n    Args:,\n        code (str): Code of the field.\n        val (str): Value of the field.\n\n    Returns:\n        str: Correctly padded MRC line with field.\n    \"\"\"\n    code = str(code)\n    if len(code) < 3:\n        code += (3 - len(code)) * \" \"\n\n    return \"%s   L %s\" % (code, val)", "entry_point": "val_to_mrc", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "'[[1, 2], [3], []]   L [[1, 2], [3], []]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/WebarchivCZ/WA-KAT/blob/16d064a3a775dc1d2713debda7847ded52dd2a06/src/wa_kat/convertors/mrc.py#L116-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033507", "code": "def _compute_bounding_box(points):\n    \"\"\"Given the list of coordinates (x,y), this procedure computes\n    the smallest rectangle that covers all the points.\"\"\"\n    (xmin, ymin, xmax, ymax) = (999999, 999999, -999999, -999999)\n    for p in points:\n        xmin = min(xmin, p[0])\n        xmax = max(xmax, p[0])\n        ymin = min(ymin, p[1])\n        ymax = max(ymax, p[1])\n    return (xmin, ymin, xmax, ymax)", "entry_point": "_compute_bounding_box", "input": "[]", "output": "(999999, 999999, -999999, -999999)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/purr/blob/4c848768d0485d0f88b30850d0d5372221b21b66/Purr/Plugins/local_pychart/basecanvas.py#L25-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033508", "code": "def strip_hidden(key_tuples, visibilities):\n    \"\"\"Filter each tuple according to visibility.\n\n    Args:\n        key_tuples: A sequence of tuples of equal length (i.e. rectangular)\n        visibilities: A sequence of booleans equal in length to the tuples contained in key_tuples.\n\n    Returns:\n        A sequence equal in length to key_tuples where the items are tuples with a length corresponding\n        to the number of items in visibility which are True.\n    \"\"\"\n    result = []\n    for key_tuple in key_tuples:\n        if len(key_tuple) != len(visibilities):\n            raise ValueError(\n                \"length of key tuple {} is not equal to length of visibilities {}\".format(\n                    key_tuple, visibilities\n                )\n            )\n        filtered_tuple = tuple(item for item, visible in zip(key_tuple, visibilities) if visible)\n        result.append(filtered_tuple)\n    return result", "entry_point": "strip_hidden", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sixty-north/added-value/blob/7ae75b56712822b074fc874612d6058bb7d16a1e/source/added_value/tabulator.py#L402-L423", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033509", "code": "def day_postfix(day):\n    \"\"\"Returns day's correct postfix (2nd, 3rd, 61st, etc).\"\"\"\n\n    if day != 11 and day % 10 == 1:\n        postfix = \"st\"\n    elif day != 12 and day % 10 == 2:\n        postfix = \"nd\"\n    elif day != 13 and day % 10 == 3:\n        postfix = \"rd\"\n    else:\n        postfix = \"th\"\n\n    return postfix", "entry_point": "day_postfix", "input": "True", "output": "'st'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/a-tal/ddate/blob/3cb4f510e0b7c33e1a3732c4c7b4817629ab733c/ddate/base.py#L181-L193", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033510", "code": "def filter(func, data):\n    \"\"\"Parameter <func> must be a single-argument\n    function that takes a sequence (i.e.,\na sample point) and returns a boolean. This procedure calls <func> on\neach element in <data> and returns a list comprising elements for\nwhich <func> returns True.\n\n>>> data = [[1,5], [2,10], [3,13], [4,16]]\n... chart_data.filter(lambda x: x[1] % 2 == 0, data)\n[[2,10], [4,16]].\n\"\"\"\n\n    out = []\n    for r in data:\n        if func(r):\n            out.append(r)\n    return out", "entry_point": "filter", "input": "2, ()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/purr/blob/4c848768d0485d0f88b30850d0d5372221b21b66/Purr/Plugins/local_pychart/chart_data.py#L159-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033511", "code": "def transform(func, data):\n    \"\"\"Apply <func> on each element in <data> and return the list\nconsisting of the return values from <func>.\n\n>>> data = [[10,20], [30,40], [50,60]]\n... chart_data.transform(lambda x: [x[0], x[1]+1], data)\n[[10, 21], [30, 41], [50, 61]]\n\n\"\"\"\n    out = []\n    for r in data:\n        out.append(func(r))\n    return out", "entry_point": "transform", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/purr/blob/4c848768d0485d0f88b30850d0d5372221b21b66/Purr/Plugins/local_pychart/chart_data.py#L178-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033512", "code": "def ellipsize(o):\n    \"\"\"\n    Ellipsize the representation of the given object.\n    \"\"\"\n    r = repr(o)\n    if len(r) < 800:\n        return r\n\n    r = r[:60] + ' ... ' + r[-15:]\n    return r", "entry_point": "ellipsize", "input": "[5, 3, 1, 4]", "output": "'[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/f3at/feat/blob/15da93fc9d6ec8154f52a9172824e25821195ef8/src/feat/extern/log/log.py#L267-L276", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033513", "code": "def get_Name(name, short=False):\n    \"\"\"\n        Return the distinguished name of an X509 Certificate\n\n        :param name: Name object to return the DN from\n        :param short: Use short form (Default: False)\n\n        :type name: :class:`cryptography.x509.Name`\n        :type short: Boolean\n\n        :rtype: str\n    \"\"\"\n\n    # For the shortform, we have a lookup table\n    # See RFC4514 for more details\n    sf = {\n          \"countryName\": \"C\",\n          \"stateOrProvinceName\": \"ST\",\n          \"localityName\": \"L\",\n          \"organizationalUnitName\": \"OU\",\n          \"organizationName\": \"O\",\n          \"commonName\": \"CN\",\n          \"emailAddress\": \"E\",\n         }\n    return \", \".join([\"{}={}\".format(attr.oid._name if not short or attr.oid._name not in sf else sf[attr.oid._name], attr.value) for attr in name])", "entry_point": "get_Name", "input": "'', [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeaphoo/reston/blob/96502487b2259572df55237c9526f92627465088/reston/core/apk.py#L882-L906", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033514", "code": "def _gt(field, value, document):\n    \"\"\"\n    Returns True if the value of a document field is greater than a given value\n    \"\"\"\n    try:\n        return document.get(field, None) > value\n    except TypeError:  # pragma: no cover Python < 3.0\n        return False", "entry_point": "_gt", "input": "set(), 0, {}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaunduncan/nosqlite/blob/3033c029b7c8290c66a8b36dc512e560505d4c85/nosqlite.py#L440-L447", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033515", "code": "def _lt(field, value, document):\n    \"\"\"\n    Returns True if the value of a document field is less than a given value\n    \"\"\"\n    try:\n        return document.get(field, None) < value\n    except TypeError:  # pragma: no cover Python < 3.0\n        return False", "entry_point": "_lt", "input": "'abc', 'a,b,c', {'a': 1, 'b': 2}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaunduncan/nosqlite/blob/3033c029b7c8290c66a8b36dc512e560505d4c85/nosqlite.py#L450-L457", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033516", "code": "def make_pattern_list(patterns):\n    \"\"\"Makes a string of filename patterns from a list of (description,[patterns]) tuples.\"\"\"\n    pattstrs = []\n    for desc, patts in patterns:\n        # \";,\" not allowed in descriptions or patterns\n        patts = [p.replace(\";\", \"\").replace(\",\", \"\") for p in patts]\n        desc = desc.replace(\";\", \"\").replace(\",\", \"\")\n        pattstrs.append(\"%s=%s\" % (desc, ','.join(patts)))\n    return \";\".join(pattstrs)", "entry_point": "make_pattern_list", "input": "()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/purr/blob/4c848768d0485d0f88b30850d0d5372221b21b66/Purr/Purrer.py#L50-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033517", "code": "def number(digit):\n\t\"\"\"\n\tGets a spoken-word representation for a number.\n\n\tArguments:\n\t\tdigit (int): An integer to convert into spoken-word.\n\n\tReturns:\n\t\tA spoken-word representation for a digit,\n\t\tincluding an article ('a' or 'an') and a suffix,\n\t\te.g. 1 -> 'a 1st', 11 -> \"an 11th\". Adittionally\n\t\tdelimits characters in pairs of three for values > 999.\n\t\"\"\"\n\n\tspoken = str(digit)\n\n\tif spoken.startswith(\"8\") or spoken[:len(spoken) % 3] == \"11\":\n\t\tarticle = \"an \"\n\telse:\n\t\tarticle = \"a \"\n\n\tif spoken.endswith(\"1\") and spoken != \"11\":\n\t\tsuffix = \"st\"\n\telif spoken.endswith(\"2\") and spoken != \"12\":\n\t\tsuffix = \"nd\"\n\telif spoken.endswith(\"3\") and spoken != \"13\":\n\t\tsuffix = \"rd\"\n\telse:\n\t\tsuffix = \"th\"\n\n\tif digit > 999:\n\t\tprefix = len(spoken) % 3\n\t\tseparated = spoken[:prefix]\n\t\tfor n in range(prefix, len(spoken), 3):\n\t\t\tseparated += \",\" + spoken[n : n + 3]\n\t\tspoken = separated\n\n\treturn article + spoken + suffix", "entry_point": "number", "input": "True", "output": "'a Trueth'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/goldsborough/ecstasy/blob/7faa54708d506696c2607ddb68866e66768072ad/ecstasy/errors.py#L140-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033518", "code": "def build(sub_parser, cmds):\n    \"\"\"todo: Docstring for build\n\n    :param sub_parser: arg description\n    :type sub_parser: type description\n    :return:\n    :rtype:\n    \"\"\"\n\n    res = {}\n    for cmd in cmds:\n        res[cmd.name] = cmd(sub_parser)\n    # end for cmd in cmds\n\n    return res", "entry_point": "build", "input": "['a', 'b', 'c'], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeffbuttars/upkg/blob/7d65a0b2eb4469aac5856b963ef2d429f2920dae/upkg/cmds/build.py#L1-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033519", "code": "def expand_indent(line):\n    \"\"\"\n    Return the amount of indentation.\n    Tabs are expanded to the next multiple of 8.\n\n    >>> expand_indent('    ')\n    4\n    >>> expand_indent('\\\\t')\n    8\n    >>> expand_indent('    \\\\t')\n    8\n    >>> expand_indent('       \\\\t')\n    8\n    >>> expand_indent('        \\\\t')\n    16\n    \"\"\"\n    result = 0\n    for char in line:\n        if char == '\\t':\n            result = result / 8 * 8 + 8\n        elif char == ' ':\n            result += 1\n        else:\n            break\n    return result", "entry_point": "expand_indent", "input": "'AbC dEf'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/f3at/feat/blob/15da93fc9d6ec8154f52a9172824e25821195ef8/tools/pep8.py#L408-L432", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033520", "code": "def mute_string(text):\n    \"\"\"\n    Replace contents with 'xxx' to prevent syntax matching.\n\n    >>> mute_string('\"abc\"')\n    '\"xxx\"'\n    >>> mute_string(\"'''abc'''\")\n    \"'''xxx'''\"\n    >>> mute_string(\"r'abc'\")\n    \"r'xxx'\"\n    \"\"\"\n    start = 1\n    end = len(text) - 1\n    # String modifiers (e.g. u or r)\n    if text.endswith('\"'):\n        start += text.index('\"')\n    elif text.endswith(\"'\"):\n        start += text.index(\"'\")\n    # Triple quotes\n    if text.endswith('\"\"\"') or text.endswith(\"'''\"):\n        start += 2\n        end -= 2\n    return text[:start] + 'x' * (end - start) + text[end:]", "entry_point": "mute_string", "input": "'abc'", "output": "'axc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/f3at/feat/blob/15da93fc9d6ec8154f52a9172824e25821195ef8/tools/pep8.py#L463-L485", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033521", "code": "def url_to_fn(url):\n    \"\"\"\n    Convert `url` to filename used to download the datasets.\n\n    ``http://kitakitsune.org/xe`` -> ``kitakitsune.org_xe``.\n\n    Args:\n        url (str): URL of the resource.\n\n    Returns:\n        str: Normalized URL.\n    \"\"\"\n    url = url.replace(\"http://\", \"\").replace(\"https://\", \"\")\n    url = url.split(\"?\")[0]\n\n    return url.replace(\"%\", \"_\").replace(\"/\", \"_\")", "entry_point": "url_to_fn", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/WebarchivCZ/WA-KAT/blob/16d064a3a775dc1d2713debda7847ded52dd2a06/src/wa_kat/rest_api/to_output.py#L97-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033522", "code": "def is_job_config(config):\n    \"\"\"\n    Check whether given dict of config is job config\n    \"\"\"\n    try:\n        # Every job has name\n        if config['config']['job']['name'] is not None:\n            return True\n    except KeyError:\n        return False\n    except TypeError:\n        return False\n    except IndexError:\n        return False\n\n    return False", "entry_point": "is_job_config", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OSLL/jabba/blob/71c1d008ab497020fba6ffa12a600721eb3f5ef7/jabba/util.py#L15-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033523", "code": "def change_same_starting_points(flaglist):\n    \"\"\"Gets points at which changes begin\"\"\"\n\n    change_points = []\n    same_points = []\n    in_change = False\n\n    if flaglist and not flaglist[0]:\n        same_points.append(0)\n\n    for x, flag in enumerate(flaglist):\n        if flag and not in_change:\n            change_points.append(x)\n            in_change = True\n        elif not flag and in_change:\n            same_points.append(x)\n            in_change = False\n\n    return (change_points, same_points)", "entry_point": "change_same_starting_points", "input": "[5, 3, 1, 4]", "output": "([0], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ucsb-cs/submit/blob/92810c81255a4fc6bbebac1ac8aae856fd576ffe/submit/diff_render.py#L81-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033524", "code": "def is_image(name, exts=None):\n    \"\"\"return True if the name or path is endswith {jpg|png|gif|jpeg}\"\"\"\n\n    default = ['jpg', 'png', 'gif', 'jpeg']\n    if exts:\n        default += exts\n\n    flag = False\n    for ext in default:\n        if name.lower().endswith(ext):\n            flag = True\n            break\n    return flag", "entry_point": "is_image", "input": "'', ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/weaming/filetree/blob/0e717aaa839b9750d54e2453fb68c357693827f3/filetree/funcs.py#L6-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033525", "code": "def human_size(s, factor):\n    \"\"\"\n    :s: size\n    :factor: 1000 or 1024\n    \"\"\"\n    unit = 'B'\n    if s > factor:\n        s /= factor\n        unit = 'KB'\n    if s > factor:\n        s /= factor\n        unit = 'MB'\n    if s > factor:\n        s /= factor\n        unit = 'GB'\n    if s > factor:\n        s /= factor\n        unit = 'TB'\n    return '%.2f %s' % (s, unit)", "entry_point": "human_size", "input": "0, 7", "output": "'0.00 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/weaming/filetree/blob/0e717aaa839b9750d54e2453fb68c357693827f3/filetree/funcs.py#L62-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033526", "code": "def _parse_style_str(s):\n    \"\"\"\n    Take an SVG 'style' attribute string like 'stroke:none;fill:black'\n    and parse it into a dictionary like {'stroke' : 'none', 'fill' : 'black'}.\n    \"\"\"\n    styledict = {}\n    if s:\n        # parses L -> R so later keys overwrite earlier ones\n        for keyval in s.split(';'):\n            l = keyval.strip().split(':')\n            if l and len(l) == 2: styledict[l[0].strip()] = l[1].strip()\n    return styledict", "entry_point": "_parse_style_str", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/purr/blob/4c848768d0485d0f88b30850d0d5372221b21b66/Purr/Plugins/local_pychart/svgcanvas.py#L37-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033527", "code": "def _make_style_str(styledict):\n    \"\"\"\n    Make an SVG style string from the dictionary. See also _parse_style_str also.\n    \"\"\"\n    s = ''\n    for key in list(styledict.keys()):\n        s += \"%s:%s;\" % (key, styledict[key])\n    return s", "entry_point": "_make_style_str", "input": "{'x': [1, 2], 'y': []}", "output": "'x:[1, 2];y:[];'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/purr/blob/4c848768d0485d0f88b30850d0d5372221b21b66/Purr/Plugins/local_pychart/svgcanvas.py#L51-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033528", "code": "def _vax_to_ieee_single_float(data):\n    \"\"\"Converts a float in Vax format to IEEE format.\n\n    data should be a single string of chars that have been read in from\n    a binary file. These will be processed 4 at a time into float values.\n    Thus the total number of byte/chars in the string should be divisible\n    by 4.\n\n    Based on VAX data organization in a byte file, we need to do a bunch of\n    bitwise operations to separate out the numbers that correspond to the\n    sign, the exponent and the fraction portions of this floating point\n    number\n\n    role :      S        EEEEEEEE      FFFFFFF      FFFFFFFF      FFFFFFFF\n    bits :      1        2      9      10                               32\n    bytes :     byte2           byte1               byte4         byte3\n\n    \"\"\"\n    f = []\n    nfloat = int(len(data) / 4)\n    for i in range(nfloat):\n\n        byte2 = data[0 + i*4]\n        byte1 = data[1 + i*4]\n        byte4 = data[2 + i*4]\n        byte3 = data[3 + i*4]\n\n        # hex 0x80 = binary mask 10000000\n        # hex 0x7f = binary mask 01111111\n\n        sign = (byte1 & 0x80) >> 7\n        expon = ((byte1 & 0x7f) << 1) + ((byte2 & 0x80) >> 7)\n        fract = ((byte2 & 0x7f) << 16) + (byte3 << 8) + byte4\n\n        if sign == 0:\n            sign_mult = 1.0\n        else:\n            sign_mult = -1.0\n\n        if 0 < expon:\n            # note 16777216.0 == 2^24\n            val = sign_mult * (0.5 + (fract/16777216.0)) * pow(2.0, expon - 128.0)\n            f.append(val)\n        elif expon == 0 and sign == 0:\n            f.append(0)\n        else:\n            f.append(0)\n            # may want to raise an exception here ...\n\n    return f", "entry_point": "_vax_to_ieee_single_float", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bennyrowland/suspect/blob/c09ab0a5013c5a199218214cdd791659243d7e41/suspect/io/philips.py#L69-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033529", "code": "def params_to_mongo(query_params):\n    \"\"\"Convert HTTP query params to mongodb query syntax.\n\n    Converts the parse query params into a mongodb spec.\n\n    :param dict query_params: return of func:`rest.process_params`\n    \"\"\"\n    if not query_params:\n        return {}\n    for key, value in query_params.items():\n        if isinstance(value, list):\n            query_params[key] = {'$in': value}\n    return query_params", "entry_point": "params_to_mongo", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rackerlabs/simpl/blob/60ed3336a931cd6a7a7246e60f26165d9dc7c99c/simpl/db/mongodb.py#L651-L663", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033530", "code": "def has_data(d, fullname):\n    \"\"\"Test if any of the `keys` of the `d` dictionary starts with `fullname`.\n    \"\"\"\n    fullname = r'%s-' % (fullname, )\n    for k in d:\n        if not k.startswith(fullname):\n            continue\n        return True\n    return False", "entry_point": "has_data", "input": "['apple', 'banana', 'cherry'], 'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jpscaletti/solution/blob/eabafd8e695bbb0209242e002dbcc05ffb327f43/solution/formset.py#L199-L207", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033531", "code": "def intersection(fake_title, unit):\n    \"\"\"\u5bf9\u4e24\u4e2alist\u6c42\u4ea4\u96c6\uff0c\u5e76\u8fd4\u56de\u76f8\u540c\u5143\u7d20\u7684\u4e2a\u6570\n\n    Keyword arguments:\n    fake_title, unit            -- \u5217\u8868\u7c7b\u578b\n    Return:\n        \u76f8\u540c\u5143\u7d20\u7684\u4e2a\u6570\n    \"\"\"\n    same = 0\n    for i in fake_title:\n        if i in unit:\n            same += 1\n    return same", "entry_point": "intersection", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pzs741/TEDT/blob/6b6663227b755005fe1a1e3e807a05bdb521e066/TEDT/candidate_corpus.py#L61-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033532", "code": "def parse_passthru_args(argv):\n        \"\"\"Handle arguments to be passed thru to a subprocess using '--'.\n\n        :returns: tuple of two lists; args and pass-thru-args\n        \"\"\"\n        if '--' in argv:\n            dashdash = argv.index(\"--\")\n            return argv[:dashdash], argv[dashdash + 1:]\n        return argv, []", "entry_point": "parse_passthru_args", "input": "[1, 2, 3]", "output": "([1, 2, 3], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rackerlabs/simpl/blob/60ed3336a931cd6a7a7246e60f26165d9dc7c99c/simpl/config.py#L723-L731", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033533", "code": "def format(name, dataItem, eltsToParse=None):\n        \"\"\"Formats a list to display it.                \n        Input Parameters\n        ----------------\n        name : name of the object that contains a list of afftributes\n        dataItem : list of attributes\n        eltsToParse : elts to display\n        \n        Return\n        ------\n        Returns a string to display\n        \n        Note : When eltsToParse is no defined then all the list is displayed.\"\"\"\n        display = []\n        if eltsToParse == None:\n            display = dataItem\n        else:\n            display = eltsToParse\n        \n        str = \"%s object display:\\n\"%(name)       \n        for key, value in enumerate(display):\n            str += \"\\t%s : %s = %s\\n\"%(key, value, dataItem[value])\n        return str", "entry_point": "format", "input": "{'a': 1, 'b': 2}, 3, ''", "output": "\"{'a': 1, 'b': 2} object display:\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SITools2/pySitools2_1.0/blob/acd13198162456ba401a0b923af989bb29feb3b6/sitools2/core/utility.py#L50-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033534", "code": "def ce(actual, predicted):\n    \"\"\"\n    Computes the classification error.\n\n    This function computes the classification error between two lists\n\n    Parameters\n    ----------\n    actual : list\n             A list of the true classes\n    predicted : list\n                A list of the predicted classes\n\n    Returns\n    -------\n    score : double\n            The classification error between actual and predicted\n\n    \"\"\"\n    return (sum([1.0 for x,y in zip(actual,predicted) if x != y]) /\n            len(actual))", "entry_point": "ce", "input": "[5, 3, 1, 4], {'a': 1, 'b': 2}", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jorahn/icy/blob/d0bd765c933b2d9bff4d7d646c0938348b9c5c25/icy/ml/metrics.py#L27-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033535", "code": "def mean(array):\n    \"\"\"\n    Return the mean value of a list of divisible numbers.\n    \"\"\"\n    n = len(array)\n\n    if n < 1:\n        return 0\n    elif n == 1:\n        return array[0]\n    return sum(array) / n", "entry_point": "mean", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ChrisCummins/labm8/blob/dd10d67a757aefb180cb508f86696f99440c94f5/labmath.py#L99-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033536", "code": "def median(array):\n    \"\"\"\n    Return the median value of a list of numbers.\n    \"\"\"\n    n = len(array)\n\n    if n < 1:\n        return 0\n    elif n == 1:\n        return array[0]\n\n    sorted_vals = sorted(array)\n    midpoint = int(n / 2)\n    if n % 2 == 1:\n        return sorted_vals[midpoint]\n    else:\n        return (sorted_vals[midpoint - 1] + sorted_vals[midpoint]) / 2.0", "entry_point": "median", "input": "[1, 2, 3]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ChrisCummins/labm8/blob/dd10d67a757aefb180cb508f86696f99440c94f5/labmath.py#L125-L141", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033537", "code": "def filter_query(filter_dict, required_keys):\n    \"\"\"Ensure that the dict has all of the information available. If not, return what does\"\"\"\n    if not isinstance(filter_dict, dict):\n        raise TypeError(\"dict_list is not a list. Please try again\")\n\n    if not isinstance(required_keys, list):\n        raise TypeError(\"dict_list is not a list. Please try again\")\n\n    available = []\n    for k,v in filter_dict.items():\n        # print(k, v)\n        if k in required_keys:\n            available.append(k)\n    return available", "entry_point": "filter_query", "input": "{}, [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kivo360/funtime/blob/a1487bbe817987fd7026fb4be6fe94db86aad3eb/funtime/util/ticker_handler.py#L26-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033538", "code": "def parse_modeString(s):\n        \"\"\" Parses a modeString like '1024 x 768 @ 60' \"\"\"\n        refresh, width, height = None, None, None\n        if '@' in s:\n                s, refresh = s.split('@', 1)\n                refresh = int(refresh)\n        if 'x' in s:\n                width, height = [int(x) if x.strip() else None\n                                        for x in s.split('x', 1)]\n        elif s.strip():\n                width = int(s)\n        else:\n                width = None\n        return (width, height, refresh)", "entry_point": "parse_modeString", "input": "''", "output": "(None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwesterb/displays/blob/37764a3ce1be5e7b3c3bee8e4853554ed0417a82/src/main.py#L56-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033539", "code": "def addJunctionPos(shape, fromPos, toPos):\n    \"\"\"Extends shape with the given positions in case they differ from the\n    existing endpoints. assumes that shape and positions have the same dimensionality\"\"\"\n    result = list(shape)\n    if fromPos != shape[0]:\n        result = [fromPos] + result\n    if toPos != shape[-1]:\n        result.append(toPos)\n    return result", "entry_point": "addJunctionPos", "input": "[-1, 0, 1, 2], [], [1, 2, 3]", "output": "[[], -1, 0, 1, 2, [1, 2, 3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TrafficSenseMSD/SumoTools/blob/8607b4f885f1d1798e43240be643efe6dccccdaa/sumolib/net/lane.py#L70-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033540", "code": "def tag(version, params):\n        \"\"\"Build and return full command to use with subprocess.Popen for 'git tag' command\n\n        :param version:\n        :param params:\n        :return: list\n        \"\"\"\n        cmd = ['git', 'tag', '-a', '-m', 'v%s' % version, str(version)]\n        if params:\n            cmd.extend(params)\n\n        return cmd", "entry_point": "tag", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "['git', 'tag', '-a', '-m', 'v[[1, 2], [3], []]', '[[1, 2], [3], []]', 'apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/msztolcman/versionner/blob/78fca02859e3e3eb71c9eb7ea230758944177c54/versionner/vcs/git.py#L13-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033541", "code": "def _safe_str_cmp(a, b):\n    \"\"\"\n    Internal function to efficiently iterate over the hashes\n    \n    Regular string compare will bail at the earliest opportunity\n    which allows timing attacks\n    \"\"\"\n    if len(a) != len(b):\n        return False\n    rv = 0\n    for x, y in zip(a, b):\n        rv |= ord(x) ^ ord(y)\n    return rv == 0", "entry_point": "_safe_str_cmp", "input": "['a', 'b', 'c'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kudos/passwords/blob/3f404cea6b841f405d720ebeda9ef8b9c58dfef5/passwords/__init__.py#L48-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033542", "code": "def unique(seq, preserve_order=True):\n    \"\"\"\n        Take a sequence and make it unique.  Not preserving order is faster, but\n        that won't matter so much for most uses.\n\n        copied from: http://www.peterbe.com/plog/uniqifiers-benchmark/uniqifiers_benchmark.py\n    \"\"\"\n    if preserve_order:\n        # f8 by Dave Kirby\n        # Order preserving\n        seen = set()\n        seen_add = seen.add  # lookup method only once\n        return [x for x in seq if x not in seen and not seen_add(x)]\n    # f9\n    # Not order preserving\n    return list({}.fromkeys(seq).keys())", "entry_point": "unique", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blazelibs/blazeutils/blob/c94476325146007553cbddeeb9ef83394756babf/blazeutils/helpers.py#L147-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033543", "code": "def prettifysql(sql):\n    \"\"\"Returns a prettified version of the SQL as a list of lines to help\n    in creating a useful diff between two SQL statements.\"\"\"\n    pretty = []\n    for line in sql.split('\\n'):\n        pretty.extend([\"%s,\\n\" % x for x in line.split(',')])\n    return pretty", "entry_point": "prettifysql", "input": "'walnut thistle harbour'", "output": "['walnut thistle harbour,\\n']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blazelibs/blazeutils/blob/c94476325146007553cbddeeb9ef83394756babf/blazeutils/helpers.py#L165-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033544", "code": "def path_exists(source, path, separator='/'):\n    \"\"\"Check a dict for the existence of a value given a path to it.\n\n    :param source: a dict to read data from\n    :param path: a key or path to a key (path is delimited by `separator`)\n    :keyword separator: the separator used in the path (ex. Could be \".\" for a\n        json/mongodb type of value)\n    \"\"\"\n    if path == separator and isinstance(source, dict):\n        return True\n    parts = path.strip(separator).split(separator)\n    if not parts:\n        return False\n    current = source\n    for part in parts:\n        if not isinstance(current, dict):\n            return False\n        if part not in current:\n            return False\n        current = current[part]\n    return True", "entry_point": "path_exists", "input": "[[1, 2], [3], []], '', 'abc'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rackerlabs/simpl/blob/60ed3336a931cd6a7a7246e60f26165d9dc7c99c/simpl/incubator/dicts.py#L56-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033545", "code": "def normalized(beta, beta_list):\n    \"\"\"\u5f52\u4e00\u5316\u51fd\u6570\n\n    Keyword arguments:\n    beta                     -- \u5f53\u524d\u6587\u672c\u884c\u7684beta\u503c\uff0cfloat\u7c7b\u578b\n    beta_list                -- \u6807\u9898\u5019\u9009\u961f\u5217\u7684beta\u961f\u5217\uff0clist\u7c7b\u578b\n    Return:\n        result               -- \u5f52\u4e00\u5316\u7ed3\u679c\uff0c\u533a\u95f4\u30100\uff0c1\u3011\n    \"\"\"\n    if len(beta_list) <= 2:\n        # beta_list\u5143\u7d20\u5c0f\u4e8e\u7b49\u4e8e2\u65f6\uff0c\u6839\u636ejiaccard\u76f8\u4f3c\u5ea6\u516c\u5f0f\u8fdb\u884c\u5224\u5b9a\n        return 1\n    try:\n        result = (beta - min(beta_list)) / (max(beta_list) - min(beta_list))\n    except ZeroDivisionError:\n        result = 1\n    return result", "entry_point": "normalized", "input": "{}, {'x': [1, 2], 'y': []}", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pzs741/TEDT/blob/6b6663227b755005fe1a1e3e807a05bdb521e066/TEDT/candidate_title.py#L49-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033546", "code": "def hexify(number):\n    \"\"\"\n    Convert integer to hex string representation, e.g. 12 to '0C'\n    \"\"\"\n    if( isinstance(number, int) == False ):\n        raise TypeError('hexify(): expected integer, not {}'.format(type(number)))\n\n    if number < 0:\n        raise ValueError('Invalid number to hexify - must be positive')\n\n    result = hex(int(number)).replace('0x', '').upper()\n    if divmod(len(result), 2)[1] == 1:\n        # Padding\n        result = '0{}'.format(result)\n    return result", "entry_point": "hexify", "input": "10", "output": "'0A'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timgabets/pynblock/blob/dbdb6d06bd7741e1138bed09d874b47b23d8d200/pynblock/tools.py#L44-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033547", "code": "def get_digits_from_string(cyphertext, length=4):\n    \"\"\"\n    Extract PVV/CVV digits from the cyphertext (HEX-encoded string, e.g. 'EEFADCFFFBD7ADECAB9FBB')\n    \"\"\"\n    digits = ''\n   \n    \"\"\"\n    The algorigthm is used for PVV and CVV calculation.\n\n    1. The cyphertext is scanned from left to right. Decimal digits are\n    selected during the scan until the needed number of decimal digits is found. \n    Each selected digit is placed from left to right according to the order\n    of selection. If needed number of decimal digits is found (four in case of PVV, \n    three in case of CVV), those digits are the PVV or CVV.\n    \"\"\"\n    for c in cyphertext:\n        if len(digits) >= length:\n            break\n        try:\n            int(c)\n            digits += c\n        except ValueError:\n            continue\n    \n    \"\"\"\n    2. If, at the end of the first scan, less than four decimal digits\n    have been selected, a second scan is performed from left to right.\n    During the second scan, all decimal digits are skipped and only nondecimal\n    digits can be processed. Nondecimal digits are converted to decimal\n    digits by subtracting 10. The process proceeds until four digits of\n    PVV are found.\n    \"\"\"\n    if len(digits) < length:\n        for c in cyphertext:\n            if len(digits) >= length:\n                break\n    \n            if (int(c, 16) - 10) >= 0:\n                digits += str(int(c, 16) - 10)\n    \n    return digits", "entry_point": "get_digits_from_string", "input": "'AbC dEf', 1", "output": "'0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timgabets/pynblock/blob/dbdb6d06bd7741e1138bed09d874b47b23d8d200/pynblock/tools.py#L71-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033548", "code": "def parityOf(int_type):\n    \"\"\"\n    Calculates the parity of an integer, returning 0 if there are an even number of set bits, and -1 if there are an odd number. \n    \"\"\"\n    parity = 0\n    while (int_type):\n        parity = ~parity\n        int_type = int_type & (int_type - 1)\n    return(parity)", "entry_point": "parityOf", "input": "10", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timgabets/pynblock/blob/dbdb6d06bd7741e1138bed09d874b47b23d8d200/pynblock/tools.py#L194-L202", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033549", "code": "def _set_id(infos):\n    '''\n    ID compatibility hack\n\n    return: dict\n    '''\n    if infos:\n        cid = None\n        if infos.get(\"Id\"): cid = infos[\"Id\"]\n        elif infos.get(\"ID\"): cid = infos[\"ID\"]\n        elif infos.get(\"id\"): cid = infos[\"id\"]\n        if \"Id\" not in infos:\n            infos[\"Id\"] = cid\n        infos.pop(\"id\",None)\n        infos.pop(\"ID\",None)\n    return infos", "entry_point": "_set_id", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/VisualOps/cli/blob/e9ee9a804df0de3cce54be4c623528fd658838dc/visualops/utils/dockervisops.py#L90-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033550", "code": "def _pull_assemble_error_status(logs):\n    '''\n    Given input in this form::\n\n        u'{\"status\":\"Pulling repository foo/ubuntubox\"}:\n        \"image (latest) from foo/  ...\n         rogress\":\"complete\",\"id\":\"2c80228370c9\"}'\n\n    construct something like that (load JSON data is possible)::\n\n        [u'{\"status\":\"Pulling repository foo/ubuntubox\"',\n         {\"status\":\"Download\",\"progress\":\"complete\",\"id\":\"2c80228370c9\"}]\n    '''\n    comment = 'An error occurred pulling your image'\n    try:\n        for err_log in logs:\n            if isinstance(err_log, dict):\n                if 'errorDetail' in err_log:\n                    if 'code' in err_log['errorDetail']:\n                        msg = '\\n{0}\\n{1}: {2}'.format(\n                            err_log['error'],\n                            err_log['errorDetail']['code'],\n                            err_log['errorDetail']['message']\n                        )\n                    else:\n                        msg = '\\n{0}\\n{1}'.format(\n                            err_log['error'],\n                            err_log['errorDetail']['message'],\n                        )\n                    comment += msg\n    except Exception as e:\n        comment += \"%s\"%e\n    return comment", "entry_point": "_pull_assemble_error_status", "input": "['a', 'b', 'c']", "output": "'An error occurred pulling your image'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/VisualOps/cli/blob/e9ee9a804df0de3cce54be4c623528fd658838dc/visualops/utils/dockervisops.py#L203-L235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033551", "code": "def mem(data):\n    \"\"\"Total memory used by data\n    \n    Parameters\n    ----------\n    data : dict of pandas.DataFrames or pandas.DataFrame\n    \n    Returns\n    -------\n    str : str\n        Human readable amount of memory used with unit (like KB, MB, GB etc.).\n    \"\"\"\n    \n    if type(data) == dict:\n        num = sum([data[k].memory_usage(index=True).sum() for k in data])\n    else:\n        num = data.memory_usage(index=True).sum()\n    for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:\n        if num < 1024.0:\n            return \"%3.1f %s\" % (num, x)\n        num /= 1024.0\n    return \"%3.1f %s\" % (num, 'PB')", "entry_point": "mem", "input": "{}", "output": "'0.0 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jorahn/icy/blob/d0bd765c933b2d9bff4d7d646c0938348b9c5c25/icy/icy.py#L439-L460", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033552", "code": "def _find_key_cols(df):\n    \"\"\"Identify columns in a DataFrame that could be a unique key\"\"\"\n    \n    keys = []\n    for col in df:\n        if len(df[col].unique()) == len(df[col]):\n            keys.append(col)\n    return keys", "entry_point": "_find_key_cols", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jorahn/icy/blob/d0bd765c933b2d9bff4d7d646c0938348b9c5c25/icy/icy.py#L543-L550", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033553", "code": "def convertShape(shapeString):\n    \"\"\" Convert xml shape string into float tuples.\n\n    This method converts the 2d or 3d shape string from SUMO's xml file\n    into a list containing 3d float-tuples. Non existant z coordinates default\n    to zero. If shapeString is empty, an empty list will be returned.\n    \"\"\"\n\n    cshape = []\n    for pointString in shapeString.split():\n        p = [float(e) for e in pointString.split(\",\")]\n        if len(p) == 2:\n            cshape.append((p[0], p[1], 0.))\n        elif len(p) == 3:\n            cshape.append(tuple(p))\n        else:\n            raise ValueError(\n                'Invalid shape point \"%s\", should be either 2d or 3d' % pointString)\n    return cshape", "entry_point": "convertShape", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TrafficSenseMSD/SumoTools/blob/8607b4f885f1d1798e43240be643efe6dccccdaa/sumolib/net/__init__.py#L564-L582", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033554", "code": "def toHex(val):\n    \"\"\"Converts the given value (0-255) into its hexadecimal representation\"\"\"\n    hex = \"0123456789abcdef\"\n    return hex[int(val / 16)] + hex[int(val - int(val / 16) * 16)]", "entry_point": "toHex", "input": "True", "output": "'01'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TrafficSenseMSD/SumoTools/blob/8607b4f885f1d1798e43240be643efe6dccccdaa/sumolib/visualization/helpers.py#L286-L289", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033555", "code": "def toFloat(val):\n    \"\"\"Converts the given value (0-255) into its hexadecimal representation\"\"\"\n    hex = \"0123456789abcdef\"\n    return float(hex.find(val[0]) * 16 + hex.find(val[1]))", "entry_point": "toFloat", "input": "['apple', 'banana', 'cherry']", "output": "-17.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TrafficSenseMSD/SumoTools/blob/8607b4f885f1d1798e43240be643efe6dccccdaa/sumolib/visualization/helpers.py#L292-L295", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033556", "code": "def htmlquote(text):\n    r\"\"\"\n    Encodes `text` for raw use in HTML.\n    \n        >>> htmlquote(u\"<'&\\\">\")\n        u'&lt;&#39;&amp;&quot;&gt;'\n    \"\"\"\n    text = text.replace(u\"&\", u\"&amp;\") # Must be done first!\n    text = text.replace(u\"<\", u\"&lt;\")\n    text = text.replace(u\">\", u\"&gt;\")\n    text = text.replace(u\"'\", u\"&#39;\")\n    text = text.replace(u'\"', u\"&quot;\")\n    return text", "entry_point": "htmlquote", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/talkincode/toughlib/blob/1c2f7dde3a7f101248f1b5f5d428cc85466995cf/toughlib/btforms/net.py#L139-L151", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033557", "code": "def fmt_pairs(obj, indent=4, sort_key=None):\n    \"\"\"Format and sort a list of pairs, usually for printing.\n\n    If sort_key is provided, the value will be passed as the\n    'key' keyword argument of the sorted() function when\n    sorting the items. This allows for the input such as\n    [('A', 3), ('B', 5), ('Z', 1)] to be sorted by the ints\n    but formatted like so:\n\n        l = [('A', 3), ('B', 5), ('Z', 1)]\n        print(fmt_pairs(l, sort_key=lambda x: x[1]))\n\n            Z 1\n            A 3\n            B 5\n        where the default behavior would be:\n\n        print(fmt_pairs(l))\n\n            A 3\n            B 5\n            Z 1\n    \"\"\"\n    lengths = [len(x[0]) for x in obj]\n    if not lengths:\n        return ''\n    longest = max(lengths)\n    obj = sorted(obj, key=sort_key)\n    formatter = '%s{: <%d} {}' % (' ' * indent, longest)\n    string = '\\n'.join([formatter.format(k, v) for k, v in obj])\n    return string", "entry_point": "fmt_pairs", "input": "set(), 'AbC dEf', [5, 3, 1, 4]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rackerlabs/simpl/blob/60ed3336a931cd6a7a7246e60f26165d9dc7c99c/simpl/server.py#L278-L308", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033558", "code": "def add_suffix(string, suffix):\n    \"\"\"\n    Adds a suffix to a string, if the string does not already have that suffix.\n\n    :param string: the string that should have a suffix added to it\n    :param suffix: the suffix to be added to the string\n    :return: the string with the suffix added, if it does not already end in\n        the suffix. Otherwise, it returns the original string.\n    \"\"\"\n    if string[-len(suffix):] != suffix:\n        return string + suffix\n    else:\n        return string", "entry_point": "add_suffix", "input": "'AbC dEf', 'a,b,c'", "output": "'AbC dEfa,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/samjabrahams/anchorhub/blob/5ade359b08297d4003a5f477389c01de9e634b54/anchorhub/util/addsuffix.py#L6-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033559", "code": "def rev_c(read):\n    \"\"\"\n    return reverse completment of read\n    \"\"\"\n    rc = []\n    rc_nucs = {'A':'T', 'T':'A', 'G':'C', 'C':'G', 'N':'N'}\n    for base in read:\n        rc.extend(rc_nucs[base.upper()])\n    return rc[::-1]", "entry_point": "rev_c", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/shuffle_genome.py#L27-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033560", "code": "def mask_sequence(seq, gaps):\n    \"\"\"\n    mask (make lower case) regions of sequence found in gaps between model alignments\n    \"\"\"\n    seq = [i.upper() for i in seq]\n    for gap in gaps:\n        for i in range(gap[0] - 1, gap[1]):\n            seq[i] = seq[i].lower()\n    return ''.join(seq)", "entry_point": "mask_sequence", "input": "set(), ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/23SfromHMM.py#L176-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033561", "code": "def parse_masked(seq, min_len):\n    \"\"\"\n    parse masked sequence into non-masked and masked regions\n    \"\"\"\n    nm, masked = [], [[]]\n    prev = None\n    for base in seq[1]:\n        if base.isupper():\n            nm.append(base)\n            if masked != [[]] and len(masked[-1]) < min_len:\n                nm.extend(masked[-1])\n                del masked[-1]\n            prev = False\n        elif base.islower():\n            if prev is False:\n                masked.append([])\n            masked[-1].append(base)\n            prev = True\n    return nm, masked", "entry_point": "parse_masked", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "([], [['b']])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/strip_masked.py#L13-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033562", "code": "def calc_pident_ignore_gaps(a, b):\n    \"\"\"\n    calculate percent identity\n    \"\"\"\n    m = 0 # matches\n    mm = 0 # mismatches\n    for A, B in zip(list(a), list(b)):\n        if A == '-' or A == '.' or B == '-' or B == '.':\n            continue\n        if A == B:\n            m += 1\n        else:\n            mm += 1\n    try:\n        return float(float(m)/float((m + mm))) * 100\n    except:\n        return 0", "entry_point": "calc_pident_ignore_gaps", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "100.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/compare_aligned.py#L34-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033563", "code": "def remove_gaps(A, B):\n    \"\"\"\n    skip column if either is a gap\n    \"\"\"\n    a_seq, b_seq = [], []\n    for a, b in zip(list(A), list(B)):\n        if a == '-' or a == '.' or b == '-' or b == '.':\n            continue\n        a_seq.append(a)\n        b_seq.append(b)\n    return ''.join(a_seq), ''.join(b_seq)", "entry_point": "remove_gaps", "input": "['a', 'b', 'c'], []", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/compare_aligned.py#L52-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033564", "code": "def matrix2dictionary(matrix):\n    \"\"\"\n    convert matrix to dictionary of comparisons\n    \"\"\"\n    pw = {}\n    for line in matrix:\n        line = line.strip().split('\\t')\n        if line[0].startswith('#'):\n            names = line[1:]\n            continue\n        a = line[0]\n        for i, pident in enumerate(line[1:]):\n            b = names[i]\n            if a not in pw:\n                pw[a] = {}\n            if b not in pw:\n                pw[b] = {}\n            if pident != '-':\n                pident = float(pident)\n            pw[a][b] = pident\n            pw[b][a] = pident\n    return pw", "entry_point": "matrix2dictionary", "input": "['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/compare_aligned.py#L218-L239", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033565", "code": "def parse_s2bins(s2bins):\n    \"\"\"\n    parse ggKbase scaffold-to-bin mapping\n        - scaffolds-to-bins and bins-to-scaffolds\n    \"\"\"\n    s2b = {}\n    b2s = {}\n    for line in s2bins:\n        line = line.strip().split()\n        s, b = line[0], line[1]\n        if 'UNK' in b:\n            continue\n        if len(line) > 2:\n            g = ' '.join(line[2:])\n        else:\n            g = 'n/a'\n        b = '%s\\t%s' % (b, g)\n        s2b[s] = b \n        if b not in b2s:\n           b2s[b] = []\n        b2s[b].append(s)\n    return s2b, b2s", "entry_point": "parse_s2bins", "input": "[]", "output": "({}, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/rRNA_copies.py#L31-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033566", "code": "def calc_bin_cov(scaffolds, cov):\n    \"\"\"\n    calculate bin coverage\n    \"\"\"\n    bases = sum([cov[i][0] for i in scaffolds if i in cov])\n    length = sum([cov[i][1] for i in scaffolds if i in cov])\n    if length == 0:\n        return 0\n    return float(float(bases)/float(length))", "entry_point": "calc_bin_cov", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/rRNA_copies.py#L92-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033567", "code": "def check(line, queries):\n    \"\"\"\n    check that at least one of\n    queries is in list, l\n    \"\"\"\n    line = line.strip()\n    spLine = line.replace('.', ' ').split()\n    matches = set(spLine).intersection(queries)\n    if len(matches) > 0:\n        return matches, line.split('\\t')\n    return matches, False", "entry_point": "check", "input": "'abc', ['apple', 'banana', 'cherry']", "output": "(set(), False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/ncbi_download.py#L99-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033568", "code": "def remove_bad(string):\n    \"\"\"\n    remove problem characters from string\n    \"\"\"\n    remove = [':', ',', '(', ')', ' ', '|', ';', '\\'']\n    for c in remove:\n        string = string.replace(c, '_')\n    return string", "entry_point": "remove_bad", "input": "'  padded  '", "output": "'__padded__'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/rax.py#L43-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033569", "code": "def sam_list(sam):\n\t\"\"\"\n\tget a list of mapped reads\n\t\"\"\"\n\tlist = []\n\tfor file in sam:\n\t\tfor line in file:\n\t\t\tif line.startswith('@') is False:\n\t\t\t\tline = line.strip().split()\n\t\t\t\tid, map = line[0], int(line[1])\n\t\t\t\tif map != 4 and map != 8:\n\t\t\t\t\tlist.append(id)\n\treturn set(list)", "entry_point": "sam_list", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/filter_fastq_sam.py#L7-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033570", "code": "def sam_list_paired(sam):\n\t\"\"\"\n\tget a list of mapped reads\n\trequire that both pairs are mapped in the sam file in order to remove the reads\n\t\"\"\"\n\tlist = []\n\tpair = ['1', '2']\n\tprev = ''\n\tfor file in sam:\n\t\tfor line in file:\n\t\t\tif line.startswith('@') is False:\n\t\t\t\tline = line.strip().split()\n\t\t\t\tid, map = line[0], int(line[1])\n\t\t\t\tif map != 4 and map != 8:\n\t\t\t\t\tread = id.rsplit('/')[0]\n\t\t\t\t\tif read == prev:\n\t\t\t\t\t\tlist.append(read)\n\t\t\t\t\tprev = read\n\treturn set(list)", "entry_point": "sam_list_paired", "input": "''", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/filter_fastq_sam.py#L21-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033571", "code": "def filter_paired(list):\n\t\"\"\"\n\trequire that both pairs are mapped in the sam file in order to remove the reads\n\t\"\"\"\n\tpairs = {}\n\tfiltered = []\n\tfor id in list:\n\t\tread = id.rsplit('/')[0]\n\t\tif read not in pairs:\n\t\t\tpairs[read] = []\n\t\tpairs[read].append(id)\n\tfor read in pairs:\n\t\tids = pairs[read]\n\t\tif len(ids) == 2:\n\t\t\tfiltered.extend(ids)\n\treturn set(filtered)", "entry_point": "filter_paired", "input": "['apple', 'banana', 'cherry']", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/filter_fastq_sam.py#L41-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033572", "code": "def sam2fastq(line):\n    \"\"\"\n    print fastq from sam\n    \"\"\"\n    fastq = []\n    fastq.append('@%s' % line[0])\n    fastq.append(line[9])\n    fastq.append('+%s' % line[0])\n    fastq.append(line[10])\n    return fastq", "entry_point": "sam2fastq", "input": "'Hello World'", "output": "['@H', 'l', '+H', 'd']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/mapped.py#L13-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033573", "code": "def count_mismatches(read):\n    \"\"\"\n    look for NM:i:<N> flag to determine number of mismatches\n    \"\"\"\n    if read is False:\n        return False\n    mm = [int(i.split(':')[2]) for i in read[11:] if i.startswith('NM:i:')]\n    if len(mm) > 0:\n        return sum(mm)\n    else:\n        return False", "entry_point": "count_mismatches", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/mapped.py#L24-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033574", "code": "def zero_to_one(table, option):\n    \"\"\"\n    normalize from zero to one for row or table\n    \"\"\"\n    if option == 'table':\n        m = min(min(table))\n        ma = max(max(table))\n    t = []\n    for row in table:\n        t_row = []\n        if option != 'table':\n            m, ma = min(row), max(row)\n        for i in row:\n            if ma == m:\n                t_row.append(0)\n            else:\n                t_row.append((i - m)/(ma - m))\n        t.append(t_row)\n    return t", "entry_point": "zero_to_one", "input": "{'x': [1, 2], 'y': []}, [-1, 0, 1, 2]", "output": "[[0], [0]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/transform.py#L18-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033575", "code": "def pertotal(table, option):\n    \"\"\"\n    calculate percent of total\n    \"\"\"\n    if option == 'table':\n        total = sum([i for line in table for i in line])\n    t = []\n    for row in table:\n        t_row = []\n        if option != 'table':\n            total = sum(row)\n        for i in row:\n            if total == 0:\n                t_row.append(0)\n            else:\n                t_row.append(i/total*100)\n        t.append(t_row)\n    return t", "entry_point": "pertotal", "input": "{}, ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/transform.py#L38-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033576", "code": "def transpose(table):\n    \"\"\"\n    transpose matrix\n    \"\"\"\n    t = []\n    for i in range(0, len(table[0])):\n        t.append([row[i] for row in table])\n    return t", "entry_point": "transpose", "input": "'a,b,c'", "output": "[['a', ',', 'b', ',', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/transform.py#L155-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033577", "code": "def rc_stats(stats):\n    \"\"\"\n    reverse completement stats\n    \"\"\"\n    rc_nucs = {'A':'T', 'T':'A', 'G':'C', 'C':'G', 'N':'N'}\n    rcs = []\n    for pos in reversed(stats):\n        rc = {}\n        rc['reference frequencey'] = pos['reference frequency']\n        rc['consensus frequencey'] = pos['consensus frequency']\n        rc['In'] = pos['In']\n        rc['Del'] = pos['Del']\n        rc['ref'] = rc_nucs[pos['ref']]\n        rc['consensus'] = (rc_nucs[pos['consensus'][0]], pos['consensus'][1])\n        for base, stat in list(pos.items()):\n            if base in rc_nucs:\n                rc[rc_nucs[base]] = stat\n        rcs.append(rc)\n    return rcs", "entry_point": "rc_stats", "input": "()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/genome_variation.py#L138-L156", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033578", "code": "def relative_abundance(coverage):\n\t\"\"\"\n\tcov = number of bases / length of genome\n\trelative abundance = [(cov) / sum(cov for all genomes)] * 100\n\t\"\"\"\n\trelative = {}\n\tsums = []\n\tfor genome in coverage:\n\t\tfor cov in coverage[genome]:\n\t\t\tsums.append(0)\n\t\tbreak\n\tfor genome in coverage:\n\t\tindex = 0\n\t\tfor cov in coverage[genome]:\n\t\t\tsums[index] += cov\n\t\t\tindex += 1\n\tfor genome in coverage:\n\t\tindex = 0\n\t\trelative[genome] = []\n\t\tfor cov in coverage[genome]:\n\t\t\tif sums[index] == 0:\n\t\t\t\trelative[genome].append(0)\n\t\t\telse:\n\t\t\t\trelative[genome].append((cov / sums[index]) * float(100))\n\t\t\tindex += 1\n\treturn relative", "entry_point": "relative_abundance", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [100.0, 100.0], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/genome_abundance.py#L67-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033579", "code": "def filter_ambiguity(records, percent=0.5):  # , repeats=6)\n    \"\"\"\n    Filters out sequences with too much ambiguity as defined by the method\n    parameters.\n\n    :type records: list\n    :param records: A list of sequences\n    :type repeats: int\n    :param repeats: Defines the number of repeated N that trigger truncating a\n                    sequence.\n    :type percent: float\n    :param percent: Defines the overall percentage of N in a sequence that\n                     will cause the sequence to be filtered out.\n    \"\"\"\n    seqs = []\n    # Ns = ''.join(['N' for _ in range(repeats)])\n    count = 0\n    for record in records:\n        if record.seq.count('N')/float(len(record)) < percent:\n#            pos = record.seq.find(Ns)\n#            if pos >= 0:\n#                record.seq = Seq(str(record.seq)[:pos])\n            seqs.append(record)\n        count += 1\n\n    return seqs, count", "entry_point": "filter_ambiguity", "input": "[], ['apple', 'banana', 'cherry']", "output": "([], 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/smdabdoub/phylotoast/blob/0b74ef171e6a84761710548501dfac71285a58a3/bin/filter_ambiguity.py#L16-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033580", "code": "def append_index_id(id, ids):\n    \"\"\"\n    add index to id to make it unique wrt ids\n    \"\"\"\n    index = 1\n    mod = '%s_%s' % (id, index)\n    while mod in ids:\n        index += 1\n        mod = '%s_%s' % (id, index)\n    ids.append(mod)\n    return mod, ids", "entry_point": "append_index_id", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "('[5, 3, 1, 4]_1', [1, 2, 3, '[5, 3, 1, 4]_1'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/nr_fasta.py#L11-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033581", "code": "def insertions_from_masked(seq):\n    \"\"\"\n    get coordinates of insertions from insertion-masked sequence\n    \"\"\"\n    insertions = []\n    prev = True\n    for i, base in enumerate(seq):\n        if base.isupper() and prev is True:\n            insertions.append([])\n            prev = False\n        elif base.islower():\n            insertions[-1].append(i)\n            prev = True\n    return [[min(i), max(i)] for i in insertions if i != []]", "entry_point": "insertions_from_masked", "input": "'AbC dEf'", "output": "[[1, 1], [4, 4], [6, 6]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/rRNA_insertions.py#L15-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033582", "code": "def seqs2bool(seqs):\n    \"\"\"\n    convert orf and intron information to boolean\n    # seqs[id] = [gene, model, [[i-gene_pos, i-model_pos, i-length, iseq, [orfs], [introns]], ...]]\n    # seqs[id] = [gene, model, [[i-gene_pos, i-model_pos, i-length, iseq, [orfs], [introns], orfs?, introns?], ...]]\n    \"\"\"\n    for seq in seqs:\n        for i, ins in enumerate(seqs[seq][2]):\n            if len(ins[4]) > 0:\n                ins.append(True)\n            else:\n                ins.append(False)\n            if len(ins[5]) > 0:\n                ins.append(True)\n            else:\n                ins.append(False)\n            seqs[seq][2][i] = ins\n    return seqs", "entry_point": "seqs2bool", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophertbrown/bioscripts/blob/83b2566b3a5745437ec651cd6cafddd056846240/ctbBio/rRNA_insertions.py#L212-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033583", "code": "def get_xpath_root(xpath):\n    \"\"\" :return: the base of an XPATH: the part preceding any format keys or attribute references \"\"\"\n\n    if xpath:\n        if xpath.startswith('@'):\n            xpath = ''\n        else:\n            index = xpath.find('/@' if '@' in xpath else '/{')\n            xpath = xpath[:index] if index >= 0 else xpath\n\n    return xpath", "entry_point": "get_xpath_root", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/consbio/gis-metadata-parser/blob/59eefb2e51cd4d8cc3e94623a2167499ca9ef70f/gis_metadata/utils.py#L188-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033584", "code": "def parsetypes(dtype):\n    \"\"\"\n    Parse the types from a structured numpy dtype object.\n\n    Return list of string representations of types from a structured numpy \n    dtype object, e.g. ['int', 'float', 'str'].\n\n    Used by :func:`tabular.io.saveSV` to write out type information in the \n    header.\n\n    **Parameters**\n\n        **dtype** :  numpy dtype object\n\n            Structured numpy dtype object to parse.\n\n    **Returns**\n\n        **out** :  list of strings\n\n            List of strings corresponding to numpy types::\n\n                [dtype[i].name.strip('1234567890').rstrip('ing') \\ \n                 for i in range(len(dtype))]\n\n    \"\"\"\n    return [dtype[i].name.strip('1234567890').rstrip('ing') \n            for i in range(len(dtype))]", "entry_point": "parsetypes", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yamins81/tabular/blob/1caf091c8c395960a9ad7078f95158b533cc52dd/tabular/io.py#L1808-L1835", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033585", "code": "def arg_tup_to_dict(argument_tuples):\n    \"\"\"Given a set of argument tuples, set their value in a data dictionary if not blank\"\"\"\n    data = dict()\n    for arg_name, arg_val in argument_tuples:\n        if arg_val is not None:\n            if arg_val is True:\n                arg_val = 'true'\n            elif arg_val is False:\n                arg_val = 'false'\n            data[arg_name] = arg_val\n\n    return data", "entry_point": "arg_tup_to_dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cydrobolt/pifx/blob/c9de9c2695c3e6e72de4aa0de47b78fc13c457c3/pifx/util.py#L32-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033586", "code": "def listunion(ListOfLists):\n    \"\"\"\n    Take the union of a list of lists.\n\n    Take a Python list of Python lists::\n\n            [[l11,l12, ...], [l21,l22, ...], ... , [ln1, ln2, ...]]\n\n    and return the aggregated list::\n\n            [l11,l12, ..., l21, l22 , ...]\n\n    For a list of two lists, e.g. `[a, b]`, this is like::\n\n            a.extend(b)\n\n    **Parameters**\n\n            **ListOfLists** :  Python list\n\n                    Python list of Python lists.\n\n    **Returns**\n\n            **u** :  Python list\n\n                    Python list created by taking the union of the\n                    lists in `ListOfLists`.\n\n    \"\"\"\n    u = []\n    for s in ListOfLists:\n        if s != None:\n            u.extend(s)\n    return u", "entry_point": "listunion", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yamins81/tabular/blob/1caf091c8c395960a9ad7078f95158b533cc52dd/tabular/utils.py#L49-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033587", "code": "def listarraytranspose(L):\n    '''\n    Tranposes the simple array presentation of a list of lists (of equal length).\n    Argument:\n        L = [row1, row2, ...., rowN]\n        where the rowi are python lists of equal length.\n    Returns:\n        LT, a list of python lists such that LT[j][i] = L[i][j].\n    '''\n    return [[row[i] for row in L] for i in range(len(L[0]))]", "entry_point": "listarraytranspose", "input": "['a', 'b', 'c']", "output": "[['a', 'b', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yamins81/tabular/blob/1caf091c8c395960a9ad7078f95158b533cc52dd/tabular/utils.py#L141-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033588", "code": "def DEFAULT_NULLVALUE(test):\n    \"\"\"\n    Returns a null value for each of various kinds of test values.\n\n    **Parameters**\n\n            **test** :  bool, int, float or string\n\n                    Value to test.\n\n\n    **Returns**\n            **null** :  element in `[False, 0, 0.0, '']`\n\n                    Null value corresponding to the given test value:\n\n                    *   if `test` is a `bool`, return `False`\n                    *   else if `test` is an `int`, return `0`\n                    *   else if `test` is a `float`, return `0.0`\n                    *   else `test` is a `str`, return `''`\n\n    \"\"\"\n    return False if isinstance(test,bool) \\\n           else 0 if isinstance(test,int) \\\n           else 0.0 if isinstance(test,float) \\\n           else ''", "entry_point": "DEFAULT_NULLVALUE", "input": "['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yamins81/tabular/blob/1caf091c8c395960a9ad7078f95158b533cc52dd/tabular/utils.py#L369-L394", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033589", "code": "def increment_slug(s):\n    \"\"\"Generate next slug for a series.\n\n       Some docstore types will use slugs (see above) as document ids. To\n       support unique ids, we'll serialize them as follows:\n         TestUserA/my-test\n         TestUserA/my-test-2\n         TestUserA/my-test-3\n         ...\n    \"\"\"\n    slug_parts = s.split('-')\n    # advance (or add) the serial counter on the end of this slug\n    # noinspection PyBroadException\n    try:\n        # if it's an integer, increment it\n        slug_parts[-1] = str(1 + int(slug_parts[-1]))\n    except:\n        # there's no counter! add one now\n        slug_parts.append('2')\n    return '-'.join(slug_parts)", "entry_point": "increment_slug", "input": "'AbC dEf'", "output": "'AbC dEf-2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenTreeOfLife/peyotl/blob/5e4e52a0fdbd17f490aa644ad79fda6ea2eda7c0/peyotl/utility/str_util.py#L82-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033590", "code": "def underscored2camel_case(v):\n    \"\"\"converts ott_id to ottId.\"\"\"\n    vlist = v.split('_')\n    c = []\n    for n, el in enumerate(vlist):\n        if el:\n            if n == 0:\n                c.append(el)\n            else:\n                c.extend([el[0].upper(), el[1:]])\n    return ''.join(c)", "entry_point": "underscored2camel_case", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenTreeOfLife/peyotl/blob/5e4e52a0fdbd17f490aa644ad79fda6ea2eda7c0/peyotl/utility/str_util.py#L104-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033591", "code": "def rev_reg_id2cred_def_id__tag(rr_id: str) -> (str, str):\n    \"\"\"\n    Given a revocation registry identifier, return its corresponding credential definition identifier and\n    (stringified int) tag.\n\n    :param rr_id: revocation registry identifier\n    :return: credential definition identifier and tag\n    \"\"\"\n\n    return (\n        ':'.join(rr_id.split(':')[2:-2]),  # rev reg id comprises (prefixes):<cred_def_id>:(suffixes)\n        str(rr_id.split(':')[-1])  # tag is last token\n    )", "entry_point": "rev_reg_id2cred_def_id__tag", "input": "'Hello World'", "output": "('', 'Hello World')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSPC-SPAC-buyandsell/von_agent/blob/0b1c17cca3bd178b6e6974af84dbac1dfce5cf45/von_agent/util.py#L137-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033592", "code": "def box_ids(creds: dict, cred_ids: list = None) -> dict:\n    \"\"\"\n    Given a credentials structure and an optional list of credential identifiers\n    (aka wallet cred-ids, referents; specify None to include all), return dict mapping each\n    credential identifier to a box ids structure (i.e., a dict specifying its corresponding\n    schema identifier, credential definition identifier, and revocation registry identifier,\n    the latter being None if cred def does not support revocation).\n\n    :param creds: creds structure returned by (HolderProver agent) get_creds()\n    :param cred_ids: list of credential identifiers for which to find corresponding schema identifiers, None for all\n    :return: dict mapping each credential identifier to its corresponding box ids (empty dict if\n        no matching credential identifiers present)\n    \"\"\"\n\n    rv = {}\n    for inner_creds in {**creds.get('attrs', {}), **creds.get('predicates', {})}.values():\n        for cred in inner_creds:  # cred is a dict in a list of dicts\n            cred_info = cred['cred_info']\n            cred_id = cred_info['referent']\n            if (cred_id not in rv) and (not cred_ids or cred_id in cred_ids):\n                rv[cred_id] = {\n                    'schema_id': cred_info['schema_id'],\n                    'cred_def_id': cred_info['cred_def_id'],\n                    'rev_reg_id': cred_info['rev_reg_id']\n                }\n\n    return rv", "entry_point": "box_ids", "input": "{}, ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSPC-SPAC-buyandsell/von_agent/blob/0b1c17cca3bd178b6e6974af84dbac1dfce5cf45/von_agent/util.py#L152-L178", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033593", "code": "def revoc_info(creds: dict, filt: dict = None) -> dict:\n    \"\"\"\n    Given a creds structure, return a dict mapping pairs\n    (revocation registry identifier, credential revocation identifier)\n    to (decoded) attribute name:value dicts.\n\n    If the caller includes a filter of attribute:value pairs, retain only matching attributes.\n\n    :param creds: creds structure returned by HolderProver.get_creds() as above\n    :param filt: dict mapping attributes to values of interest; e.g.,\n\n    ::\n\n        {\n            'legalName': 'Flan Nebula',\n            'effectiveDate': '2018-01-01',\n            'endDate': None\n        }\n\n    :return: dict mapping (rev_reg_id, cred_rev_id) pairs to decoded attributes\n    \"\"\"\n\n    rv = {}\n    for uuid2creds in (creds.get('attrs', {}), creds.get('predicates', {})):\n        for inner_creds in uuid2creds.values():\n            for cred in inner_creds:\n                cred_info = cred['cred_info']\n                (rr_id, cr_id) = (cred_info['rev_reg_id'], cred_info['cred_rev_id'])\n                if (rr_id, cr_id) in rv or rr_id is None or cr_id is None:\n                    continue\n                if not filt:\n                    rv[(rr_id, cr_id)] = cred_info['attrs']\n                    continue\n                if ({attr: str(filt[attr]) for attr in filt}.items() <= cred_info['attrs'].items()):\n                    rv[(rr_id, cr_id)] = cred_info['attrs']\n    return rv", "entry_point": "revoc_info", "input": "{'x': [1, 2], 'y': []}, {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSPC-SPAC-buyandsell/von_agent/blob/0b1c17cca3bd178b6e6974af84dbac1dfce5cf45/von_agent/util.py#L322-L357", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033594", "code": "def histogram(data):\n    \"\"\"Returns a histogram of your data.\n\n    :param data: The data to histogram\n    :type data: list[object]\n    :return: The histogram\n    :rtype: dict[object, int]\n    \"\"\"\n    ret = {}\n    for datum in data:\n        if datum in ret:\n            ret[datum] += 1\n        else:\n            ret[datum] = 1\n    return ret", "entry_point": "histogram", "input": "['a', 'b', 'c']", "output": "{'a': 1, 'b': 1, 'c': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/palantir/typedjsonrpc/blob/274218fcd236ff9643506caa629029c9ba25a0fb/contrib/multi-module-example/typedjsonrpc_example/valid.py#L22-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033595", "code": "def factorial(n):\n    \"\"\" Returns the factorial of n.\n    \"\"\"\n    f = 1\n    while (n > 0):\n        f = f * n\n        n = n - 1\n    return f", "entry_point": "factorial", "input": "3", "output": "6", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rwl/pylon/blob/916514255db1ae1661406f0283df756baf960d14/pylon/util.py#L262-L269", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033596", "code": "def make_unique_name(base, existing=[], format=\"%s_%s\"):\n    \"\"\" Return a name, unique within a context, based on the specified name.\n\n    @param base: the desired base name of the generated unique name.\n    @param existing: a sequence of the existing names to avoid returning.\n    @param format: a formatting specification for how the name is made unique.\n    \"\"\"\n    count = 2\n    name = base\n    while name in existing:\n        name = format % (base, count)\n        count += 1\n\n    return name", "entry_point": "make_unique_name", "input": "[[1, 2], [3], []], [5, 3, 1, 4], [5, 3, 1, 4]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rwl/pylon/blob/916514255db1ae1661406f0283df756baf960d14/pylon/io/parsing_util.py#L167-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033597", "code": "def fetch_extra_data(resource):\n    \"\"\"Return a dict with extra data retrieved from cern oauth.\"\"\"\n    person_id = resource.get('PersonID', [None])[0]\n    identity_class = resource.get('IdentityClass', [None])[0]\n    department = resource.get('Department', [None])[0]\n\n    return dict(\n        person_id=person_id,\n        identity_class=identity_class,\n        department=department\n    )", "entry_point": "fetch_extra_data", "input": "{'x': [1, 2], 'y': []}", "output": "{'person_id': None, 'identity_class': None, 'department': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware/invenio-oauthclient/blob/2500dc6935738107617aeade79e050d7608004bb/invenio_oauthclient/contrib/cern.py#L219-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033598", "code": "def lowcase_str_boolean(obj):\n    \"\u0414\u0435\u043b\u0430\u0435\u0442 \u0438\u0437 obj \u0441\u0442\u0440\u043e\u043a\u0443 `true` \u0438\u043b\u0438 `false`\"\n    if isinstance(obj, str):\n        if obj not in [\"true\", \"false\"]:\n            raise RuntimeError(\n                'Expecting \"true\" or \"false\", got {}'.format(obj))\n        return obj\n    return str(bool(obj)).lower()", "entry_point": "lowcase_str_boolean", "input": "['a', 'b', 'c']", "output": "'true'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ASMfreaK/yandex_weather_api/blob/d58ad80f7389dc3b58c721bb42c2441e9ff3e351/yandex_weather_api/__init__.py#L48-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033599", "code": "def spasser(inbox, s=None):\n    \"\"\"\n    Passes inputs with indecies in s. By default passes the whole inbox.\n\n    Arguments:\n\n      - s(sequence) [default: ``None``] The default translates to a range for\n        all inputs of the \"inbox\" i.e. ``range(len(inbox))``\n    \n    \"\"\"\n    seq = (s or range(len(inbox)))\n    return [input_ for i, input_ in enumerate(inbox) if i in seq]", "entry_point": "spasser", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "[[3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L67-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033600", "code": "def convert_from_bytes_if_necessary(prefix, suffix):\n    \"\"\"\n    Depending on how we extract data from pysam we may end up with either\n    a string or a byte array of nucleotides. For consistency and simplicity,\n    we want to only use strings in the rest of our code.\n    \"\"\"\n    if isinstance(prefix, bytes):\n        prefix = prefix.decode('ascii')\n\n    if isinstance(suffix, bytes):\n        suffix = suffix.decode('ascii')\n\n    return prefix, suffix", "entry_point": "convert_from_bytes_if_necessary", "input": "'abc', '  padded  '", "output": "('abc', '  padded  ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/isovar/blob/b39b684920e3f6b344851d6598a1a1c67bce913b/isovar/string_helpers.py#L46-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033601", "code": "def ellipsize(s, max_length=60):\n    \"\"\"\n    >>> print(ellipsize(u'lorem ipsum dolor sit amet', 40))\n    lorem ipsum dolor sit amet\n    >>> print(ellipsize(u'lorem ipsum dolor sit amet', 20))\n    lorem ipsum dolor...\n    \"\"\"\n    if len(s) > max_length:\n        ellipsis = '...'\n        return s[:(max_length - len(ellipsis))] + ellipsis\n    else:\n        return s", "entry_point": "ellipsize", "input": "['apple', 'banana', 'cherry'], 7", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vfaronov/turq/blob/3ef1261442b90d6d947b8fe2362e19e7f47a64c3/turq/util/text.py#L43-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033602", "code": "def make_timestamp(el_time):\n    \"\"\" Generate an hour-minutes-seconds timestamp from an interval in seconds.\n\n    Assumes numeric input of a time interval in seconds.  Converts this\n    interval to a string of the format \"#h #m #s\", indicating the number of\n    hours, minutes, and seconds in the interval.  Intervals greater than 24h\n    are unproblematic.\n\n    Parameters\n    ----------\n    el_time\n        |int| or |float| --\n        Time interval in seconds to be converted to h/m/s format\n\n    Returns\n    -------\n    stamp\n        |str| -- String timestamp in #h #m #s format\n\n    \"\"\"\n\n    # Calc hours\n    hrs = el_time // 3600.0\n\n    # Calc minutes\n    mins = (el_time % 3600.0) // 60.0\n\n    # Calc seconds\n    secs = el_time % 60.0\n\n    # Construct timestamp string\n    stamp = \"{0}h {1}m {2}s\".format(int(hrs), int(mins), int(secs))\n\n    # Return\n    return stamp", "entry_point": "make_timestamp", "input": "5", "output": "'0h 0m 5s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bskinn/opan/blob/0b1b21662df6abc971407a9386db21a8796fbfe5/opan/utils/base.py#L210-L244", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033603", "code": "def ff(items, targets):\n    \"\"\"First-Fit\n\n    This is perhaps the simplest packing heuristic;\n    it simply packs items in the next available bin.\n\n    Complexity O(n^2)\n    \"\"\"\n    bins = [(target, []) for target in targets]\n    skip = []\n\n    for item in items:\n        for target, content in bins:\n            if item <= (target - sum(content)):\n                content.append(item)\n                break\n        else:\n            skip.append(item)\n    return bins, skip", "entry_point": "ff", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "([(1, [-1, 0, 1]), (2, [2]), (3, [])], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daskos/mentor/blob/b5fd64e3a3192f5664fa5c03e8517cacb4e0590f/mentor/binpack.py#L22-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033604", "code": "def count_mismatches_before_variant(reference_prefix, cdna_prefix):\n    \"\"\"\n    Computes the number of mismatching nucleotides between two cDNA sequences before a variant\n    locus.\n\n    Parameters\n    ----------\n    reference_prefix : str\n        cDNA sequence of a reference transcript before a variant locus\n\n    cdna_prefix : str\n        cDNA sequence detected from RNAseq before a variant locus\n    \"\"\"\n    if len(reference_prefix) != len(cdna_prefix):\n        raise ValueError(\n            \"Expected reference prefix '%s' to be same length as %s\" % (\n                reference_prefix, cdna_prefix))\n    return sum(xi != yi for (xi, yi) in zip(reference_prefix, cdna_prefix))", "entry_point": "count_mismatches_before_variant", "input": "['a', 'b', 'c'], {1, 2, 3}", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/isovar/blob/b39b684920e3f6b344851d6598a1a1c67bce913b/isovar/variant_sequence_in_reading_frame.py#L216-L233", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033605", "code": "def count_mismatches_after_variant(reference_suffix, cdna_suffix):\n    \"\"\"\n    Computes the number of mismatching nucleotides between two cDNA sequences after a variant locus.\n\n    Parameters\n    ----------\n    reference_suffix : str\n        cDNA sequence of a reference transcript after a variant locus\n\n    cdna_suffix : str\n        cDNA sequence detected from RNAseq after a variant locus\n    \"\"\"\n\n    len_diff = len(cdna_suffix) - len(reference_suffix)\n\n    # if the reference is shorter than the read, the read runs into the intron - these count as\n    # mismatches\n    return sum(xi != yi for (xi, yi) in zip(reference_suffix, cdna_suffix)) + max(0, len_diff)", "entry_point": "count_mismatches_after_variant", "input": "'AbC dEf', 'walnut thistle harbour'", "output": "22", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/isovar/blob/b39b684920e3f6b344851d6598a1a1c67bce913b/isovar/variant_sequence_in_reading_frame.py#L236-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033606", "code": "def compute_offset_to_first_complete_codon(\n        offset_to_first_complete_reference_codon,\n        n_trimmed_from_reference_sequence):\n    \"\"\"\n    Once we've aligned the variant sequence to the ReferenceContext, we need\n    to transfer reading frame from the reference transcripts to the variant\n    sequences.\n\n    Parameters\n    ----------\n    offset_to_first_complete_reference_codon : int\n\n    n_trimmed_from_reference_sequence : int\n\n    Returns an offset into the variant sequence that starts from a complete\n    codon.\n    \"\"\"\n    if n_trimmed_from_reference_sequence <= offset_to_first_complete_reference_codon:\n        return (\n            offset_to_first_complete_reference_codon -\n            n_trimmed_from_reference_sequence)\n    else:\n        n_nucleotides_trimmed_after_first_codon = (\n            n_trimmed_from_reference_sequence -\n            offset_to_first_complete_reference_codon)\n        frame = n_nucleotides_trimmed_after_first_codon % 3\n        return (3 - frame) % 3", "entry_point": "compute_offset_to_first_complete_codon", "input": "0.5, -1.5", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/isovar/blob/b39b684920e3f6b344851d6598a1a1c67bce913b/isovar/variant_sequence_in_reading_frame.py#L256-L282", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033607", "code": "def compile_create_table(qualified_name: str, column_statement: str,\n                         primary_key_statement: str) -> str:\n    \"\"\"Postgresql Create Table statement formatter.\"\"\"\n\n    statement = \"\"\"\n                CREATE TABLE {table} ({columns} {primary_keys});\n                \"\"\".format(table=qualified_name,\n                           columns=column_statement,\n                           primary_keys=primary_key_statement)\n    return statement", "entry_point": "compile_create_table", "input": "'', ['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "\"\\n                CREATE TABLE  (['apple', 'banana', 'cherry'] ['a', 'b', 'c']);\\n                \"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfoliome/postpy/blob/fe26199131b15295fc5f669a0ad2a7f47bf490ee/postpy/ddl.py#L14-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033608", "code": "def compile_create_temporary_table(table_name: str,\n                                   column_statement: str,\n                                   primary_key_statement: str) -> str:\n    \"\"\"Postgresql Create Temporary Table statement formatter.\"\"\"\n\n    statement = \"\"\"\n                CREATE TEMPORARY TABLE {table} ({columns} {primary_keys});\n                \"\"\".format(table=table_name,\n                           columns=column_statement,\n                           primary_keys=primary_key_statement)\n    return statement", "entry_point": "compile_create_temporary_table", "input": "{'a': 1, 'b': 2}, [1, 2, 3], []", "output": "\"\\n                CREATE TEMPORARY TABLE {'a': 1, 'b': 2} ([1, 2, 3] []);\\n                \"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfoliome/postpy/blob/fe26199131b15295fc5f669a0ad2a7f47bf490ee/postpy/ddl.py#L26-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033609", "code": "def compile_column(name: str, data_type: str, nullable: bool) -> str:\n    \"\"\"Create column definition statement.\"\"\"\n\n    null_str = 'NULL' if nullable else 'NOT NULL'\n\n    return '{name} {data_type} {null},'.format(name=name,\n                                               data_type=data_type,\n                                               null=null_str)", "entry_point": "compile_column", "input": "'a,b,c', ['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "\"a,b,c ['a', 'b', 'c'] NULL,\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfoliome/postpy/blob/fe26199131b15295fc5f669a0ad2a7f47bf490ee/postpy/ddl.py#L39-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033610", "code": "def base0_interval_for_variant_fields(base1_location, ref, alt):\n    \"\"\"\n    Inteval of interbase offsets of the affected reference positions for a\n    particular variant's primary fields (pos, ref, alt).\n\n    Parameters\n    ----------\n    base1_location : int\n        First reference nucleotide of variant or, for insertions, the base\n        before the insertion.\n\n    ref : str\n        Reference nucleotides\n\n    alt : str\n        Alternative nucleotides\n    \"\"\"\n    if len(ref) == 0:\n        # in interbase coordinates, the insertion happens\n        # at the same start/end offsets, since those are already between\n        # reference bases. Furthermore, since the convention for base-1\n        # coordinates is to locate the insertion *after* the position,\n        # in this case the interbase and base-1 positions coincide.\n        base0_start = base1_location\n        base0_end = base1_location\n    else:\n        # substitution or deletion\n        base0_start = base1_location - 1\n        base0_end = base0_start + len(ref)\n    return base0_start, base0_end", "entry_point": "base0_interval_for_variant_fields", "input": "0.5, {1, 2, 3}, {'x': [1, 2], 'y': []}", "output": "(-0.5, 2.5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/isovar/blob/b39b684920e3f6b344851d6598a1a1c67bce913b/isovar/variant_helpers.py#L78-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033611", "code": "def delete_joined_table_sql(qualified_name, removing_qualified_name, primary_key):\n    \"\"\"SQL statement for a joined delete from.\n    Generate SQL statement for deleting the intersection of rows between\n    both tables from table referenced by tablename.\n    \"\"\"\n\n    condition_template = 't.{}=d.{}'\n    where_clause = ' AND '.join(condition_template.format(pkey, pkey)\n                                for pkey in primary_key)\n    delete_statement = (\n        'DELETE FROM {table} t'\n        ' USING {delete_table} d'\n        ' WHERE {where_clause}').format(table=qualified_name,\n                                        delete_table=removing_qualified_name,\n                                        where_clause=where_clause)\n    return delete_statement", "entry_point": "delete_joined_table_sql", "input": "'AbC dEf', 'walnut thistle harbour', [-1, 0, 1, 2]", "output": "'DELETE FROM AbC dEf t USING walnut thistle harbour d WHERE t.-1=d.-1 AND t.0=d.0 AND t.1=d.1 AND t.2=d.2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfoliome/postpy/blob/fe26199131b15295fc5f669a0ad2a7f47bf490ee/postpy/dml.py#L165-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033612", "code": "def _c3_merge(sequences):  # noqa\n    \"\"\"Merges MROs in *sequences* to a single MRO using the C3 algorithm.\n\n    Adapted from http://www.python.org/download/releases/2.3/mro/.\n\n    \"\"\"\n    result = []\n    while True:\n        sequences = [s for s in sequences if s]  # purge empty sequences\n        if not sequences:\n            return result\n        for s1 in sequences:  # find merge candidates among seq heads\n            candidate = s1[0]\n            for s2 in sequences:\n                if candidate in s2[1:]:\n                    candidate = None\n                    break  # reject the current head, it appears later\n            else:\n                break\n        if not candidate:\n            raise RuntimeError(\"Inconsistent hierarchy\")\n        result.append(candidate)\n        # remove the chosen candidate\n        for seq in sequences:\n            if seq[0] == candidate:\n                del seq[0]", "entry_point": "_c3_merge", "input": "[[1, 2], [3], []]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bionikspoon/pureyaml/blob/784830b907ca14525c4cecdb6ae35306f6f8a877/pureyaml/_compat/singledispatch.py#L21-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033613", "code": "def validate_price(price):\n\t\"\"\" validation checks for price argument \"\"\"\n\tif isinstance(price, str):\n\t\ttry:\n\t\t\tprice = int(price)\n\t\texcept ValueError: # fallback if convert to int failed\n\t\t\tprice = float(price)\n\tif not isinstance(price, (int, float)):\n\t\traise TypeError('Price should be a number: ' + repr(price))\n\treturn price", "entry_point": "validate_price", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NearHuscarl/py-currency/blob/4e30426399872fd6bfaa4c752a91d67c2d7bf52c/currency/currency.py#L49-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033614", "code": "def append_s(value):\n    \"\"\"\n    Adds the possessive s after a string.\n\n    value = 'Hans' becomes Hans'\n    and value = 'Susi' becomes Susi's\n\n    \"\"\"\n    if value.endswith('s'):\n        return u\"{0}'\".format(value)\n    else:\n        return u\"{0}'s\".format(value)", "entry_point": "append_s", "input": "'a,b,c'", "output": "\"a,b,c's\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bitlabstudio/django-libs/blob/2c5376cda084bf16edea540e0f6999f1d844afd0/django_libs/templatetags/libs_tags.py#L566-L577", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033615", "code": "def parse_args(args):\n    \"\"\"\n    This parses the arguments and returns a tuple containing:\n\n    (args, command, command_args)\n\n    For example, \"--config=bar start --with=baz\" would return:\n\n    (['--config=bar'], 'start', ['--with=baz'])\n    \"\"\"\n    index = None\n    for arg_i, arg in enumerate(args):\n        if not arg.startswith('-'):\n            index = arg_i\n            break\n\n    # Unable to parse any arguments\n    if index is None:\n        return (args, None, [])\n\n    return (args[:index], args[index], args[(index + 1):])", "entry_point": "parse_args", "input": "[]", "output": "([], None, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dcramer/logan/blob/8b18456802d631a822e2823bf9a4e9810a15a20e/logan/runner.py#L35-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033616", "code": "def _validate_states(states, topology):\n    '''Validate states to avoid ignoring states during initialization'''\n    states = states or []\n    if isinstance(states, dict):\n        for x in states:\n            assert x in topology.node\n    else:\n        assert len(states) <= len(topology)\n    return states", "entry_point": "_validate_states", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gsi-upm/soil/blob/a3ea434f237f039c3cadbc2e0a83ae626d77b818/soil/agents/__init__.py#L423-L431", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033617", "code": "def load_uvarint_b(buffer):\n    \"\"\"\n    Variable int deserialization, synchronous from buffer.\n    :param buffer:\n    :return:\n    \"\"\"\n    result = 0\n    idx = 0\n    byte = 0x80\n    while byte & 0x80:\n        byte = buffer[idx]\n        result += (byte & 0x7F) << (7 * idx)\n        idx += 1\n    return result", "entry_point": "load_uvarint_b", "input": "[1, 2, 3]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ph4r05/monero-serialize/blob/cebb3ba2aaf2e9211b1dcc6db2bab02946d06e42/monero_serialize/core/int_serialize.py#L49-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033618", "code": "def dump_uvarint_b_into(n, buffer, offset=0):\n    \"\"\"\n    Serializes n as variable size integer to the provided buffer.\n    Buffer has to ha\n    :param n:\n    :param buffer:\n    :param offset:\n    :return:\n    \"\"\"\n    shifted = True\n    while shifted:\n        shifted = n >> 7\n        buffer[offset] = (n & 0x7F) | (0x80 if shifted else 0x00)\n        offset += 1\n        n = shifted\n    return buffer", "entry_point": "dump_uvarint_b_into", "input": "7, {'a': 1, 'b': 2}, 2.0", "output": "{'a': 1, 'b': 2, 2.0: 7}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ph4r05/monero-serialize/blob/cebb3ba2aaf2e9211b1dcc6db2bab02946d06e42/monero_serialize/core/int_serialize.py#L75-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033619", "code": "def load_uint_b(buffer, width):\n    \"\"\"\n    Loads fixed size integer from the buffer\n    :param buffer:\n    :return:\n    \"\"\"\n    result = 0\n    for idx in range(width):\n        result += buffer[idx] << (8 * idx)\n    return result", "entry_point": "load_uint_b", "input": "[-1, 0, 1, 2], -3", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ph4r05/monero-serialize/blob/cebb3ba2aaf2e9211b1dcc6db2bab02946d06e42/monero_serialize/core/int_serialize.py#L93-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033620", "code": "def get_prepared_include_exclude(attributes):\n        \"\"\"Return tuple with prepared __include__ and __exclude__ attributes.\n\n        :type attributes: dict\n        :rtype: tuple\n        \"\"\"\n        attrs = dict()\n        for attr in ('__include__', '__exclude__'):\n            attrs[attr] = tuple([item.name for item in\n                                 attributes.get(attr, tuple())])\n        return attrs['__include__'], attrs['__exclude__']", "entry_point": "get_prepared_include_exclude", "input": "{}", "output": "((), ())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ets-labs/python-domain-models/blob/7de1816ba0338f20fdb3e0f57fad0ffd5bea13f9/domain_models/views.py#L41-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033621", "code": "def replace_all(text, replace_dict):\n    \"\"\"\n    Replace multiple strings in a text.\n\n\n    .. note::\n\n        Replacements are made successively, without any warranty on the order \\\n        in which they are made.\n\n    :param text: Text to replace in.\n    :param replace_dict: Dictionary mapping strings to replace with their \\\n            substitution.\n    :returns: Text after replacements.\n\n    >>> replace_all(\"foo bar foo thing\", {\"foo\": \"oof\", \"bar\": \"rab\"})\n    'oof rab oof thing'\n    \"\"\"\n    for i, j in replace_dict.items():\n        text = text.replace(i, j)\n    return text", "entry_point": "replace_all", "input": "'  padded  ', {}", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Phyks/libbmc/blob/9ef1a29d2514157d1edd6c13ecbd61b07ae9315e/libbmc/tools.py#L16-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033622", "code": "def parse_caveat(cav):\n    ''' Parses a caveat into an identifier, identifying the checker that should\n    be used, and the argument to the checker (the rest of the string).\n\n    The identifier is taken from all the characters before the first\n    space character.\n    :return two string, identifier and arg\n    '''\n    if cav == '':\n        raise ValueError('empty caveat')\n    try:\n        i = cav.index(' ')\n    except ValueError:\n        return cav, ''\n    if i == 0:\n        raise ValueError('caveat starts with space character')\n    return cav[0:i], cav[i + 1:]", "entry_point": "parse_caveat", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/go-macaroon-bakery/py-macaroon-bakery/blob/63ce1ef1dabe816eb8aaec48fbb46761c34ddf77/macaroonbakery/checkers/_caveat.py#L103-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033623", "code": "def container_elem_type(container_type, params):\n    \"\"\"\n    Returns container element type\n\n    :param container_type:\n    :param params:\n    :return:\n    \"\"\"\n    elem_type = params[0] if params else None\n    if elem_type is None:\n        elem_type = container_type.ELEM_TYPE\n    return elem_type", "entry_point": "container_elem_type", "input": "[], ['a', 'b', 'c']", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ph4r05/monero-serialize/blob/cebb3ba2aaf2e9211b1dcc6db2bab02946d06e42/monero_serialize/core/message_types.py#L153-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033624", "code": "def list2html(lst):\n    \"\"\" \n    convert a list to html using table formatting \n    \"\"\"\n    txt = '<TABLE width=100% border=0>'\n    for l in lst:\n        txt += '<TR>\\n'\n        if type(l) is str:\n            txt+= '<TD>' + l + '</TD>\\n'\n        elif type(l) is list:\n            txt+= '<TD>'\n            for i in l:\n                txt += i + ', '\n            txt+= '</TD>'\n        else:\n            txt+= '<TD>' + str(l) + '</TD>\\n'\n        txt += '</TR>\\n'\n    txt += '</TABLE><BR>\\n'\n    return txt", "entry_point": "list2html", "input": "[5, 3, 1, 4]", "output": "'<TABLE width=100% border=0><TR>\\n<TD>5</TD>\\n</TR>\\n<TR>\\n<TD>3</TD>\\n</TR>\\n<TR>\\n<TD>1</TD>\\n</TR>\\n<TR>\\n<TD>4</TD>\\n</TR>\\n</TABLE><BR>\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/web_utils.py#L10-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033625", "code": "def calculate_columns(sequence):\n    \"\"\"\n    Find all row names and the maximum column widths.\n\n    Args:\n        columns (dict): the keys are the column name and the value the max length.\n\n    Returns:\n        dict: column names (key) and widths (value).\n    \"\"\"\n    columns = {}\n\n    for row in sequence:\n        for key in row.keys():\n            if key not in columns:\n                columns[key] = len(key)\n\n            value_length = len(str(row[key]))\n            if value_length > columns[key]:\n                columns[key] = value_length\n\n    return columns", "entry_point": "calculate_columns", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/tools/table.py#L5-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033626", "code": "def calculate_row_format(columns, keys=None):\n    \"\"\"\n    Calculate row format.\n\n    Args:\n        columns (dict): the keys are the column name and the value the max length.\n        keys (list): optional list of keys to order columns as well as to filter for them.\n\n    Returns:\n        str: format for table row\n    \"\"\"\n    row_format = ''\n    if keys is None:\n        keys = columns.keys()\n    else:\n        keys = [key for key in keys if key in columns]\n\n    for key in keys:\n        if len(row_format) > 0:\n            row_format += \"|\"\n        row_format += \"%%(%s)-%ds\" % (key, columns[key])\n\n    return '|' + row_format + '|'", "entry_point": "calculate_row_format", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "'||'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/tools/table.py#L29-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033627", "code": "def can_process_matrix(entry, matrix_tags):\n        \"\"\"\n        Check given matrix tags to be in the given list of matric tags.\n\n        Args:\n            entry (dict): matrix item (in yaml).\n            matrix_tags (list): represents --matrix-tags defined by user in command line.\n        Returns:\n            bool: True when matrix entry can be processed.\n        \"\"\"\n        if len(matrix_tags) == 0:\n            return True\n\n        count = 0\n        if 'tags' in entry:\n            for tag in matrix_tags:\n                if tag in entry['tags']:\n                    count += 1\n\n        return count > 0", "entry_point": "can_process_matrix", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/matrix.py#L115-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033628", "code": "def ignore_path(path):\n        \"\"\"\n        Verify whether to ignore a path.\n\n        Args:\n            path (str): path to check.\n\n        Returns:\n            bool: True when to ignore given path.\n        \"\"\"\n        ignore = False\n        for name in ['.tox', 'dist', 'build', 'node_modules', 'htmlcov']:\n            if path.find(name) >= 0:\n                ignore = True\n                break\n        return ignore", "entry_point": "ignore_path", "input": "'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/tools/loc/application.py#L63-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033629", "code": "def hamming_distance(s1, s2):\n    \"\"\" \n    Return the Hamming distance between equal-length sequences\n    (http://en.wikipedia.org/wiki/Hamming_distance )\n    \"\"\"\n    if len(s1) != len(s2):\n        raise ValueError(\"Undefined for sequences of unequal length\")\n    return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2))", "entry_point": "hamming_distance", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/toolbox/image_tools.py#L364-L371", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033630", "code": "def docker_environment(env):\n    \"\"\"\n    Transform dictionary of environment variables into Docker -e parameters.\n\n    >>> result = docker_environment({'param1': 'val1', 'param2': 'val2'})\n    >>> result in ['-e \"param1=val1\" -e \"param2=val2\"', '-e \"param2=val2\" -e \"param1=val1\"']\n    True\n    \"\"\"\n    return ' '.join(\n        [\"-e \\\"%s=%s\\\"\" % (key, value.replace(\"$\", \"\\\\$\").replace(\"\\\"\", \"\\\\\\\"\").replace(\"`\", \"\\\\`\"))\n         for key, value in env.items()])", "entry_point": "docker_environment", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/tools/filters.py#L60-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033631", "code": "def find_stages(document):\n    \"\"\"\n    Find  **stages** in document.\n\n    Args:\n        document (dict): validated spline document loaded from a yaml file.\n\n    Returns:\n        list: stages as a part of the spline document or an empty list if not given.\n\n    >>> find_stages({'pipeline': [{'stage(Prepare)':1}, {'stage(Build)':1}, {'stage(Deploy)':2}]})\n    ['Prepare', 'Build', 'Deploy']\n    \"\"\"\n    names = []\n    if 'pipeline' in document:\n        for entry in document['pipeline']:\n            # each entry is dictionary with one key only\n            key, _ = list(entry.items())[0]\n            if key.startswith(\"stage(\"):\n                names.append(key.replace('stage(', '').replace(')', ''))\n    return names", "entry_point": "find_stages", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/tools/filters.py#L103-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033632", "code": "def parse_miss_cann(node, m, c):\n    \"\"\"\n    extracts names from the node to get \n    counts of miss + cann on both sides\n    \"\"\"\n    if node[2]:\n        m1 = node[0]\n        m2 = m-node[0]\n        c1 = node[1]\n        c2 = c-node[1]\n    else:\n        m1=m-node[0]\n        m2=node[0]\n        c1=c-node[1]\n        c2=node[1]\n    \n    return m1, c1, m2, c2", "entry_point": "parse_miss_cann", "input": "[1, 2, 3], 0.5, 3", "output": "(1, 2, -0.5, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/scripts/examples/puzzle_missions_canninballs.py#L167-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033633", "code": "def parse_n3(row, src='csv'):\n    \"\"\" \n    takes a row from an n3 file and returns the triple\n    NOTE - currently parses a CSV line already split via\n    cyc_extract.py\n    \"\"\"\n    if row.strip() == '':\n        return '',''\n    l_root = 'opencyc'\n    key = ''\n    val = ''\n    if src == 'csv': \n        cols = row.split(',')\n        if len(cols) < 3:\n            #print('PARSE ISSUE : ', row)\n            return '',''\n        key = ''\n        val = ''\n        key = l_root + ':' + cols[1].strip('\"').strip() + ':' + cols[2].strip('\"').strip()\n        try:\n            val = cols[3].strip('\"').strip()\n        except Exception:\n            val = \"Error parsing \" + row\n    elif src == 'n3':\n        pass\n    return key, val", "entry_point": "parse_n3", "input": "'AbC dEf', ('a', 'b', 'c')", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/ontology/read_opencyc.py#L42-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033634", "code": "def _get_dict_char_count(txt):\r\n\t\"\"\"\r\n\treads the characters in txt and returns a dictionary\r\n\tof all letters\r\n\t\"\"\"\r\n\tdct = {}\r\n\tfor letter in txt:\r\n\t\tif letter in dct:\r\n\t\t\tdct[letter] += 1\r\n\t\telse:\r\n\t\t\tdct[letter] = 1\r\n\treturn dct", "entry_point": "_get_dict_char_count", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/toolbox/text_tools.py#L100-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033635", "code": "def multi_split(txt, delims):\n    \"\"\" \n    split by multiple delimiters \n    \"\"\"\n    res = [txt]\n    for delimChar in delims:\n        txt, res = res, []\n        for word in txt:\n            if len(word) > 1:\n                res += word.split(delimChar)\n    return res", "entry_point": "multi_split", "input": "['apple', 'banana', 'cherry'], []", "output": "[['apple', 'banana', 'cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/index.py#L181-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033636", "code": "def get_string_from_rdf(src):\n    \"\"\" extracts the real content from an RDF info object \"\"\"\n    res = src.split(\"/\") #[:-1]\n    return \"\".join([l.replace('\"', '\"\"') for l in res[len(res) - 1]])", "entry_point": "get_string_from_rdf", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/ontology/cyc_extract.py#L69-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033637", "code": "def strip_text_after_string(txt, junk):\n    \"\"\" used to strip any poorly documented comments at the end of function defs \"\"\"\n    if junk in txt:\n        return txt[:txt.find(junk)]\n    else:\n        return txt", "entry_point": "strip_text_after_string", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/page_programs.py#L106-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033638", "code": "def find_path_BFS(Graph,n,m):\n    \"\"\"\n    Breadth first search\n    \"\"\"\n    if m not in Graph:\n        return None\n    if n == m:\n        return [m]\n    path = [[n]]\n    searched = []\n    while True:\n        j = len(path)\n        #k = len(Graph[n])\n        for i in range(j):\n            node = path[i][-1]\n            for neighbor in Graph[node]:\n                if neighbor not in searched:                    \n                    path.append(path[i]+[neighbor])  \n                    searched.append(neighbor)\n                    if neighbor==m:\n                        return path[-1]\n        for i in range(j):\n            path.pop(0)\n    return path", "entry_point": "find_path_BFS", "input": "[[1, 2], [3], []], [], []", "output": "[[]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_plan_search.py#L146-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033639", "code": "def get_action_cache_key(name, argument):\n    \"\"\"Get an action cache key string.\"\"\"\n    tokens = [str(name)]\n    if argument:\n        tokens.append(str(argument))\n    return '::'.join(tokens)", "entry_point": "get_action_cache_key", "input": "'walnut thistle harbour', ['a', 'b', 'c']", "output": "\"walnut thistle harbour::['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/models.py#L200-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033640", "code": "def __to_float(val, digits):\n    \"\"\"Convert val into float with digits decimal.\"\"\"\n    try:\n        return round(float(val), digits)\n    except (ValueError, TypeError):\n        return float(0)", "entry_point": "__to_float", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mjj4791/python-buienradar/blob/a70436f54e007ce921d5210cb296cf3e4adf9d09/buienradar/buienradar_json.py#L97-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033641", "code": "def __get_float(section, name):\n    \"\"\"Get the forecasted float from json section.\"\"\"\n    try:\n        return float(section[name])\n    except (ValueError, TypeError, KeyError):\n        return float(0)", "entry_point": "__get_float", "input": "['apple', 'banana', 'cherry'], 'AbC dEf'", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mjj4791/python-buienradar/blob/a70436f54e007ce921d5210cb296cf3e4adf9d09/buienradar/buienradar_json.py#L419-L424", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033642", "code": "def __getStationName(name, id):\n    \"\"\"Construct a staiion name.\"\"\"\n    name = name.replace(\"Meetstation\", \"\")\n    name = name.strip()\n    name += \" (%s)\" % id\n    return name", "entry_point": "__getStationName", "input": "'walnut thistle harbour', [5, 3, 1, 4]", "output": "'walnut thistle harbour ([5, 3, 1, 4])'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mjj4791/python-buienradar/blob/a70436f54e007ce921d5210cb296cf3e4adf9d09/buienradar/buienradar_json.py#L575-L580", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033643", "code": "def parse_phlat_file(phlatfile, mhc_alleles):\n    \"\"\"\n    Parse the input phlat file to pull out the alleles it contains\n    :param phlatfile: Open file descriptor for a phlat output sum file\n    :param mhc_alleles: dictionary of alleles.\n    \"\"\"\n    for line in phlatfile:\n        if line.startswith('Locus'):\n            continue\n        line = line.strip().split()\n        if line[0].startswith('HLA_D'):\n            line[0] = line[0][:-1]  # strip the last character\n        # Sometimes we get an error saying there was insufficient read\n        # converage. We need to drop that line.\n        # E.g. HLA_DQB1 no call due to insufficient reads at this locus\n        if line[1] == 'no':\n            continue\n        if line[4] != 'NA':\n            split_field = line[1].split(':')\n            if len(split_field) >= 2 and not split_field[1] == 'xx':\n                mhc_alleles[line[0]].append((line[1], line[4]))\n        if line[5] != 'NA':\n            split_field = line[2].split(':')\n            if len(split_field) >= 2 and not split_field[1] == 'xx':\n                mhc_alleles[line[0]].append((line[2], line[5]))\n    return mhc_alleles", "entry_point": "parse_phlat_file", "input": "[], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L2464-L2489", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033644", "code": "def pept_diff(p1, p2):\n    \"\"\"\n    Return the number of differences betweeen 2 peptides\n\n    :param str p1: Peptide 1\n    :param str p2: Peptide 2\n    :return: The number of differences between the pepetides\n    :rtype: int\n\n    >>> pept_diff('ABCDE', 'ABCDF')\n    1\n    >>> pept_diff('ABCDE', 'ABDFE')\n    2\n    >>> pept_diff('ABCDE', 'EDCBA')\n    4\n    >>> pept_diff('ABCDE', 'ABCDE')\n    0\n    \"\"\"\n    if len(p1) != len(p2):\n        return -1\n    else:\n        return sum([p1[i] != p2[i] for i in range(len(p1))])", "entry_point": "pept_diff", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/binding_prediction/common.py#L308-L329", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033645", "code": "def levenshtein_distance(str_a, str_b):\n    \"\"\"Calculate the Levenshtein distance between string a and b.\n\n    :param str_a: String - input string a\n    :param str_b: String - input string b\n    :return: Number - Levenshtein Distance between string a and b\n    \"\"\"\n    len_a, len_b = len(str_a), len(str_b)\n    if len_a > len_b:\n        str_a, str_b = str_b, str_a\n        len_a, len_b = len_b, len_a\n    current = range(len_a + 1)\n    for i in range(1, len_b + 1):\n        previous, current = current, [i] + [0] * len_a\n        for j in range(1, len_a + 1):\n            add, delete = previous[j] + 1, current[j - 1] + 1\n            change = previous[j - 1]\n            if str_a[j - 1] != str_b[i - 1]:\n                change += + 1\n            current[j] = min(add, delete, change)\n    return current[len_a]", "entry_point": "levenshtein_distance", "input": "['a', 'b', 'c'], [[1, 2], [3], []]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kstaniek/condoor/blob/77c054b29d4e286c1d7aca2c74dff86b805e1fae/condoor/utils.py#L99-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033646", "code": "def normalize_urls(urls):\n    \"\"\"Overload urls and make list of lists of urls.\"\"\"\n    _urls = []\n    if isinstance(urls, list):\n        if urls:\n            if isinstance(urls[0], list):\n                # multiple connections (list of the lists)\n                _urls = urls\n            elif isinstance(urls[0], str):\n                # single connections (make it list of the lists)\n                _urls = [urls]\n        else:\n            raise RuntimeError(\"No target host url provided.\")\n    elif isinstance(urls, str):\n        _urls = [[urls]]\n    return _urls", "entry_point": "normalize_urls", "input": "[5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kstaniek/condoor/blob/77c054b29d4e286c1d7aca2c74dff86b805e1fae/condoor/utils.py#L233-L248", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033647", "code": "def prepare_message(message):\n        \"\"\"\n        Returns the given message encoded in ascii with a format suitable for\n        SMTP transmission:\n\n        - Makes sure the message is ASCII encoded ;\n        - Normalizes line endings to '\\r\\n' ;\n        - Adds a (second) period at the beginning of lines that start\n          with a period ;\n        - Makes sure the message ends with '\\r\\n.\\r\\n'.\n\n        For further details, please check out RFC 5321 `\u00a7 4.1.1.4`_\n        and `\u00a7 4.5.2`_.\n\n        .. _`\u00a7 4.1.1.1`: https://tools.ietf.org/html/rfc5321#section-4.1.1.4\n        .. _`\u00a7 4.5.2`: https://tools.ietf.org/html/rfc5321#section-4.5.2\n        \"\"\"\n        if isinstance(message, bytes):\n            bytes_message = message\n        else:\n            bytes_message = message.encode(\"ascii\")\n\n        # The original algorithm uses regexes to do this stuff.\n        # This one is -IMHO- more pythonic and it is slightly faster.\n        #\n        # Another version is even faster, but I chose to keep something\n        # more pythonic and readable.\n        # FYI, the fastest way to do all this stuff seems to be\n        # (according to my benchmarks):\n        #\n        # bytes_message.replace(b\"\\r\\n\", b\"\\n\") \\\n        #              .replace(b\"\\r\", b\"\\n\") \\\n        #              .replace(b\"\\n\", b\"\\r\\n\")\n        #\n        # DOT_LINE_REGEX = re.compile(rb\"^\\.\", re.MULTILINE)\n        # bytes_message = DOT_LINE_REGEX.sub(b\"..\", bytes_message)\n        #\n        # if not bytes_message.endswith(b\"\\r\\n\"):\n        #     bytes_message += b\"\\r\\n\"\n        #\n        # bytes_message += b\"\\r\\n.\\r\\n\"\n\n        lines = []\n\n        for line in bytes_message.splitlines():\n            if line.startswith(b\".\"):\n                line = line.replace(b\".\", b\"..\", 1)\n\n            lines.append(line)\n\n        # Recompose the message with <CRLF> only:\n        bytes_message = b\"\\r\\n\".join(lines)\n\n        # Make sure message ends with <CRLF>.<CRLF>:\n        bytes_message += b\"\\r\\n.\\r\\n\"\n\n        return bytes_message", "entry_point": "prepare_message", "input": "'abc'", "output": "b'abc\\r\\n.\\r\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hwmrocker/smtplibaio/blob/84ce8e45b7e706476739d0efcb416c18ecabbbb6/smtplibaio/smtp.py#L1052-L1108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033648", "code": "def convert_to_timestamp(time):\n    \"\"\"Convert int to timestamp string.\"\"\"\n    if time == -1:\n        return None\n    time = int(time*1000)\n    hour = time//1000//3600\n    minute = (time//1000//60) % 60\n    second = (time//1000) % 60\n    return str(hour).zfill(2)+\":\"+str(minute).zfill(2)+\":\"+str(second).zfill(2)", "entry_point": "convert_to_timestamp", "input": "True", "output": "'00:00:01'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/happyleavesaoc/aoc-mgz/blob/13fc379cc062d7640bfa028eed9c0d45d37a7b2b/mgz/util.py#L43-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033649", "code": "def get_body(message):\n    \"\"\"\n    Extracts body text from an mbox message.\n    :param message: Mbox message\n    :return: String\n    \"\"\"\n    try:\n        sm = str(message)\n        body_start = sm.find('iamunique', sm.find('iamunique')+1)\n        body_start = sm.find('Content-Transfer-Encoding', body_start+1)\n        body_start = sm.find('\\n', body_start+1)+1\n\n        body_end = sm.find('From: ', body_start + 1)\n        if body_end == -1:\n            body_end = sm.find('iamunique', body_start + 1)\n            body_end = sm.find('\\n', body_end - 25)\n        body = sm[body_start:body_end]\n\n        body = body.replace(\"=20\\n\", \"\")\n        body = body.replace(\"=FC\", \"\u00fc\")\n        body = body.replace(\"=F6\", \"\u00f6\")\n        body = body.replace(\"=84\", \"\\\"\")\n        body = body.replace(\"=94\", \"\\\"\")\n        body = body.replace(\"=96\", \"-\")\n        body = body.replace(\"=92\", \"\\'\")\n        body = body.replace(\"=93\", \"\\\"\")\n        body = body.replace(\"=E4\", \"\u00e4\")\n        body = body.replace(\"=DF\", \"ss\")\n        body = body.replace(\"=\", \"\")\n        body = body.replace(\"\\\"\", \"\")\n        body = body.replace(\"\\'\", \"\")\n    except:\n        body = None\n\n    return body", "entry_point": "get_body", "input": "['a', 'b', 'c']", "output": "'[a, b, c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/tidyextractors/blob/658448ed533beecf32adcc188fc64d1068d15ca6/tidyextractors/tidymbox/mbox_to_pandas.py#L91-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033650", "code": "def filter_stopwords(str):\n    \"\"\"\n    Stop word filter\n    returns list\n    \"\"\"\n    STOPWORDS = ['a', 'able', 'about', 'across', 'after', 'all', 'almost',\n                 'also', 'am', 'among', 'an', 'and', 'any', 'are', 'as', 'at',\n                 'be', 'because', 'been', 'but', 'by', 'can', 'cannot',\n                 'could', 'dear', 'did', 'do', 'does', 'either', 'else',\n                 'ever', 'every', 'for', 'from', 'get', 'got', 'had', 'has',\n                 'have', 'he', 'her', 'hers', 'him', 'his', 'how', 'however',\n                 'i', 'if', 'in', 'into', 'is', 'it', 'its', 'just', 'least',\n                 'let', 'like', 'likely', 'may', 'me', 'might', 'most', 'must',\n                 'my', 'neither', 'no', 'nor', 'not', 'of', 'off', 'often',\n                 'on', 'only', 'or', 'other', 'our', 'own', 'rather', 'said',\n                 'say', 'says', 'she', 'should', 'since', 'so', 'some', 'than',\n                 'that', 'the', 'their', 'them', 'then', 'there', 'these',\n                 'they', 'this', 'tis', 'to', 'too', 'twas', 'us',\n                 'wants', 'was', 'we', 'were', 'what', 'when', 'where',\n                 'which', 'while', 'who', 'whom', 'why', 'will', 'with',\n                 'would', 'yet', 'you', 'your']\n\n    return [t for t in str.split() if t.lower() not in STOPWORDS]", "entry_point": "filter_stopwords", "input": "'Hello World'", "output": "['Hello', 'World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/pylot/blob/506a33a56ebdfc0925b94015e8cf98ccb16a143c/pylot/utils.py#L139-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033651", "code": "def convert_bytes(bytes):\n    \"\"\"\n    Convert bytes into human readable\n    \"\"\"\n    bytes = float(bytes)\n    if bytes >= 1099511627776:\n        terabytes = bytes / 1099511627776\n        size = '%.2fT' % terabytes\n    elif bytes >= 1073741824:\n        gigabytes = bytes / 1073741824\n        size = '%.2fG' % gigabytes\n    elif bytes >= 1048576:\n        megabytes = bytes / 1048576\n        size = '%.2fM' % megabytes\n    elif bytes >= 1024:\n        kilobytes = bytes / 1024\n        size = '%.2fK' % kilobytes\n    else:\n        size = '%.2fb' % bytes\n    return size", "entry_point": "convert_bytes", "input": "True", "output": "'1.00b'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/pylot/blob/506a33a56ebdfc0925b94015e8cf98ccb16a143c/pylot/utils.py#L192-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033652", "code": "def list_chunks(l, n):\n    \"\"\"\n    Return a list of chunks\n    :param l: List\n    :param n: int The number of items per chunk\n    :return: List\n    \"\"\"\n    if n < 1:\n        n = 1\n    return [l[i:i + n] for i in range(0, len(l), n)]", "entry_point": "list_chunks", "input": "[5, 3, 1, 4], -1.5", "output": "[[5], [3], [1], [4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/pylot/blob/506a33a56ebdfc0925b94015e8cf98ccb16a143c/pylot/utils.py#L214-L223", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033653", "code": "def any_in_string(l, s):\n    \"\"\"\n    Check if any items in a list is in a string\n    :params l: dict\n    :params s: string\n    :return bool:\n    \"\"\"\n    return any([i in l for i in l if i in s])", "entry_point": "any_in_string", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/pylot/blob/506a33a56ebdfc0925b94015e8cf98ccb16a143c/pylot/utils.py#L225-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033654", "code": "def get_powers_of_2(_sum):\n    \"\"\"Get powers of 2 that sum up to the given number.\n\n    This function transforms given integer to a binary string.\n    A reversed value limited to digits of binary number is extracted\n    from it, and each of its characters is enumerated.\n\n    Each digit is tested for not being 0. If the test passes, the index\n    associated with the digit is used as an exponent to get the next\n    value in the sequence to be returned.\n\n    :param _sum: a sum of all elements of the sequence to be returned\n    :returns: a list of powers of two whose sum is given\n    \"\"\"\n    return [2**y for y, x in enumerate(bin(_sum)[:1:-1]) if int(x)]", "entry_point": "get_powers_of_2", "input": "3", "output": "[1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/piotr-rusin/spam-lists/blob/fd616e8761b28f3eaa503fee5e45f7748e8f88f2/spam_lists/clients.py#L101-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033655", "code": "def mostCommonItem(lst):\n    \"\"\"Choose the most common item from the list, or the first item if all\n    items are unique.\"\"\"\n    # This elegant solution from: http://stackoverflow.com/a/1518632/1760218\n    lst = [l for l in lst if l]\n    if lst:\n        return max(set(lst), key=lst.count)\n    else:\n        return None", "entry_point": "mostCommonItem", "input": "[1, 2, 3]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nicfit/MishMash/blob/8f988936340bf0ffb83ea90ea124efb3c36a1174/mishmash/util.py#L61-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033656", "code": "def escape_query(query):\n    \"\"\"Escapes certain filter characters from an LDAP query.\"\"\"\n\n    return query.replace(\"\\\\\", r\"\\5C\").replace(\"*\", r\"\\2A\").replace(\"(\", r\"\\28\").replace(\")\", r\"\\29\")", "entry_point": "escape_query", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kavdev/ldap-groups/blob/0dd3a7d9eafa3903127364839b12a4b3dd3ca521/ldap_groups/utils.py#L23-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033657", "code": "def filter_bad_results(search_results, guessit_query):\n    \"\"\"\n    filter out search results with bad season and episode number (if\n    applicable); sometimes OpenSubtitles will report search results subtitles\n    that belong to a different episode or season from a tv show; no reason\n    why, but it seems to work well just filtering those out\n    \"\"\"\n    if 'season' in guessit_query and 'episode' in guessit_query:\n        guessit_season_episode = (guessit_query['season'], guessit_query['episode'])\n        search_results = [x for x in search_results\n                          if (int(x['SeriesSeason']), int(x['SeriesEpisode'])) == guessit_season_episode]\n    return search_results", "entry_point": "filter_bad_results", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nicoddemus/ss/blob/df77c745e511f542c456450ed94adff1b969fc92/ss.py#L66-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033658", "code": "def parse_fixed_width(types, lines):\n    \"\"\"Parse a fixed width line.\"\"\"\n    values = []\n    line = []\n    for width, parser in types:\n        if not line:\n            line = lines.pop(0).replace('\\n', '')\n\n        values.append(parser(line[:width]))\n        line = line[width:]\n\n    return values", "entry_point": "parse_fixed_width", "input": "[], 'a,b,c'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arkottke/pysra/blob/c72fd389d6c15203c0c00728ac00f101bae6369d/pysra/tools.py#L48-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033659", "code": "def is_citeable(publication_info):\n    \"\"\"Check some fields in order to define if the article is citeable.\n\n    :param publication_info: publication_info field\n    already populated\n    :type publication_info: list\n    \"\"\"\n\n    def _item_has_pub_info(item):\n        return all(\n            key in item for key in (\n                'journal_title', 'journal_volume'\n            )\n        )\n\n    def _item_has_page_or_artid(item):\n        return any(\n            key in item for key in (\n                'page_start', 'artid'\n            )\n        )\n\n    has_pub_info = any(\n        _item_has_pub_info(item) for item in publication_info\n    )\n    has_page_or_artid = any(\n        _item_has_page_or_artid(item) for item in publication_info\n    )\n\n    return has_pub_info and has_page_or_artid", "entry_point": "is_citeable", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/inspire-schemas/blob/34bc124b62fba565b6b40d1a3c15103a23a05edb/inspire_schemas/builders/literature.py#L46-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033660", "code": "def time_to_text(time):\n    \"\"\"Get a representative text of a time (in s).\"\"\"\n    \n    if time < 0.001:\n        return str(round(time * 1000000)) + \" \u00b5s\"\n    elif time < 1:\n        return str(round(time * 1000)) + \" ms\"\n    elif time < 60:\n        return str(round(time, 1)) + \" s\"\n    else:\n        return str(round(time / 60, 1)) + \" min\"", "entry_point": "time_to_text", "input": "2.0", "output": "'2.0 s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pylp/pylp/blob/7ebaa55fbaf61cb8175f211dd41ef2928c22d4d4/pylp/utils/time.py#L11-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033661", "code": "def separate_globs(globs):\n\t\"\"\"Separate include and exclude globs.\"\"\"\n\texclude = []\n\tinclude = []\n\n\tfor path in globs:\n\t\tif path.startswith(\"!\"):\n\t\t\texclude.append(path[1:])\n\t\telse:\n\t\t\tinclude.append(path)\n\n\treturn (exclude, include)", "entry_point": "separate_globs", "input": "['apple', 'banana', 'cherry']", "output": "([], ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pylp/pylp/blob/7ebaa55fbaf61cb8175f211dd41ef2928c22d4d4/pylp/utils/glob.py#L15-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033662", "code": "def reinverted(n, r):\n    \"\"\"Integer with reversed and inverted bits of n assuming bit length r.\n\n    >>> reinverted(1, 6)\n    31\n\n    >>> [reinverted(x, 6) for x in [7, 11, 13, 14, 19, 21, 22, 25, 26, 28]]\n    [7, 11, 19, 35, 13, 21, 37, 25, 41, 49]\n    \"\"\"\n    result = 0\n    r = 1 << (r - 1)\n    while n:\n        if not n & 1:\n            result |= r\n        r >>= 1\n        n >>= 1\n    if r:\n        result |= (r << 1) - 1\n    return result", "entry_point": "reinverted", "input": "(), True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xflr6/bitsets/blob/ddcfe17e7c7a11f71f1c6764b2cecf7db05d9cdf/bitsets/integers.py#L35-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033663", "code": "def auto_model_name_recognize(model_name):\n    \"\"\"\n    \u81ea\u52a8\u5c06 site-user \u8bc6\u522b\u6210 SiteUser\n    :param model_name:\n    :return:\n    \"\"\"\n    name_list = model_name.split('-')\n    return ''.join(['%s%s' % (name[0].upper(), name[1:]) for name in name_list])", "entry_point": "auto_model_name_recognize", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/restran/mountains/blob/a97fee568b112f4e10d878f815d0db3dd0a98d74/mountains/django/model.py#L48-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033664", "code": "def query_str_2_dict(query_str):\n    \"\"\"\n    \u5c06\u67e5\u8be2\u5b57\u7b26\u4e32\uff0c\u8f6c\u6362\u6210\u5b57\u5178\n    a=123&b=456\n    {'a': '123', 'b': '456'}\n    :param query_str:\n    :return:\n    \"\"\"\n    if query_str:\n        query_list = query_str.split('&')\n        query_dict = {}\n        for t in query_list:\n            x = t.split('=')\n            query_dict[x[0]] = x[1]\n    else:\n        query_dict = {}\n    return query_dict", "entry_point": "query_str_2_dict", "input": "()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/restran/mountains/blob/a97fee568b112f4e10d878f815d0db3dd0a98d74/mountains/http/__init__.py#L122-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033665", "code": "def fixed_length_split(s, width):\n    \"\"\"\n    \u56fa\u5b9a\u957f\u5ea6\u5206\u5272\u5b57\u7b26\u4e32\n    :param s:\n    :param width:\n    :return:\n    \"\"\"\n    # \u4f7f\u7528\u6b63\u5219\u7684\u65b9\u6cd5\n    # import re\n    # split = re.findall(r'.{%s}' % width, string)\n    return [s[x: x + width] for x in range(0, len(s), width)]", "entry_point": "fixed_length_split", "input": "[[1, 2], [3], []], -3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/restran/mountains/blob/a97fee568b112f4e10d878f815d0db3dd0a98d74/mountains/utils/string_utils.py#L7-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033666", "code": "def line_break(s, length=76):\n    \"\"\"\n    \u5c06\u5b57\u7b26\u4e32\u5206\u5272\u6210\u4e00\u884c\u4e00\u884c\n    :param s:\n    :param length:\n    :return:\n    \"\"\"\n    x = '\\n'.join(s[pos:pos + length] for pos in range(0, len(s), length))\n    return x", "entry_point": "line_break", "input": "['a', 'b', 'c'], -3", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/restran/mountains/blob/a97fee568b112f4e10d878f815d0db3dd0a98d74/mountains/utils/string_utils.py#L20-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033667", "code": "def hex2dec(s):\n    \"\"\"\n    hex2dec\n    \u5341\u516d\u8fdb\u5236 to \u5341\u8fdb\u5236\n    :param s:\n    :return:\n    \"\"\"\n    if not isinstance(s, str):\n        s = str(s)\n    return int(s.upper(), 16)", "entry_point": "hex2dec", "input": "-3", "output": "-3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/restran/mountains/blob/a97fee568b112f4e10d878f815d0db3dd0a98d74/mountains/encoding/converter.py#L84-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033668", "code": "def s2b(s):\n    \"\"\"\n    String to binary.\n    \"\"\"\n    ret = []\n    for c in s:\n        ret.append(bin(ord(c))[2:].zfill(8))\n    return \"\".join(ret)", "entry_point": "s2b", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/restran/mountains/blob/a97fee568b112f4e10d878f815d0db3dd0a98d74/mountains/encoding/converter.py#L264-L271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033669", "code": "def remove_ectopy(tachogram_data, tachogram_time):\n    \"\"\"\n    -----\n    Brief\n    -----\n    Function for removing ectopic beats.\n\n    -----------\n    Description\n    -----------\n    Ectopic beats are beats that are originated in cells that do not correspond to the expected pacemaker cells. These\n    beats are identifiable in ECG signals by abnormal rhythms.\n\n    This function allows to remove the ectopic beats by defining time thresholds that consecutive heartbeats should\n    comply with.\n\n    ----------\n    Parameters\n    ----------\n    tachogram_data : list\n        Y Axis of tachogram.\n\n    tachogram_time : list\n        X Axis of tachogram.\n\n    Returns\n    -------\n    out : list, list\n        List of tachogram samples. List of instants where each cardiac cycle ends.\n\n    Source\n    ------\n    \"Comparison of methods for removal of ectopy in measurement of heart rate variability\" by\n    N. Lippman, K. M. Stein and B. B. Lerman.\n    \"\"\"\n\n    # If the i RR interval differs from i-1 by more than 20 % then it will be removed from analysis.\n    remove_margin = 0.20\n    finish_ectopy_remove = False\n\n    signal = list(tachogram_data)\n    time = list(tachogram_time)\n\n    # Sample by sample analysis.\n    beat = 1\n    while finish_ectopy_remove is False:\n        max_thresh = signal[beat - 1] + remove_margin * signal[beat - 1]\n        min_thresh = signal[beat - 1] - remove_margin * signal[beat - 1]\n        if signal[beat] > max_thresh or signal[beat] < min_thresh:\n            signal.pop(beat)\n            signal.pop(beat)\n            time.pop(beat)\n            time.pop(beat)\n            # To remove the influence of the ectopic beat we need to exclude the RR\n            # intervals \"before\" and \"after\" the ectopic beat.\n            # [NB <RRi> NB <RRi+1> EB <RRi+2> NB <RRi+3> NB...] -->\n            # --> [NB <RRi> NB cut NB <RRi+3> NB...]\n\n            # Advance \"Pointer\".\n            beat += 1\n        else:\n            # Advance \"Pointer\".\n            beat += 1\n\n        # Verification if the cycle should or not end.\n        if beat >= len(signal):\n            finish_ectopy_remove = True\n\n    return signal, time", "entry_point": "remove_ectopy", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "([-1, 2], [5, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/extract.py#L197-L265", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033670", "code": "def _available_channels(devices, header):\n    \"\"\"\n    Function used for the determination of the available channels in each device.\n\n    ----------\n    Parameters\n    ----------\n    devices : list [\"mac_address_1\" <str>, \"mac_address_2\" <str>...]\n        List of devices selected by the user.\n\n    header: dict\n        Dictionary that contains auxiliary data of the acquisition.\n\n    Returns\n    -------\n    out : dict\n        Returns a dictionary where each device defines a key and the respective value will be a list\n        of the available channels for the device.\n\n    \"\"\"\n\n    # ------------------------ Definition of constants and variables ------------------------------\n    chn_dict = {}\n\n    # %%%%%%%%%%%%%%%%%%%%%% Access to the relevant data in the header %%%%%%%%%%%%%%%%%%%%%%%%%%%%\n    for dev in devices:\n        chn_dict[dev] = header[dev][\"column labels\"].keys()\n\n    return chn_dict", "entry_point": "_available_channels", "input": "[], [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L686-L714", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033671", "code": "def _check_dev_type(devices, dev_list):\n    \"\"\"\n    Function used for checking weather the \"devices\" field only contain devices used during the\n    acquisition.\n\n    ----------\n    Parameters\n    ----------\n    devices : list [\"mac_address_1\" <str>, \"mac_address_2\" <str>...]\n        List of devices selected by the user.\n\n    dev_list : list\n        List of available devices in the acquisition file.\n\n    Returns\n    -------\n    out : list\n        Returns a standardized list of devices.\n\n    \"\"\"\n\n    if devices is not None:\n        for device in devices:\n            if device in dev_list:  # List element is one of the available devices.\n                continue\n            else:\n                raise RuntimeError(\"At least one of the specified devices is not available in the \"\n                                   \"acquisition file.\")\n        out = devices\n\n    else:\n        out = dev_list\n\n    return out", "entry_point": "_check_dev_type", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L717-L750", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033672", "code": "def _inv_key(list_keys, valid_keys):\n    \"\"\"\n    -----\n    Brief\n    -----\n    A sub-function of _filter_keywords function.\n\n    -----------\n    Description\n    -----------\n    Function used for identification when a list of keywords contains invalid keywords not present\n    in the valid list.\n\n    ----------\n    Parameters\n    ----------\n    list_keys : list\n        List of keywords that must be verified, i.e., all the inputs needs to be inside valid_keys\n        in order to a True boolean be returned.\n\n    valid_keys : list\n        List of valid keywords.\n\n    Returns\n    -------\n    out : boolean, list\n        Boolean indicating if all the inserted keywords are valid. If true a list with invalid\n        keywords will be returned.\n    \"\"\"\n\n    inv_keys = []\n    bool_out = True\n    for i in list_keys:\n        if i not in valid_keys:\n            bool_out = False\n            inv_keys.append(i)\n\n    return bool_out, inv_keys", "entry_point": "_inv_key", "input": "[], [[1, 2], [3], []]", "output": "(True, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L318-L355", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033673", "code": "def _is_a_url(input_element):\n    \"\"\"\n    -----\n    Brief\n    -----\n    Auxiliary function responsible for checking if the input is a string that contains an url.\n\n    -----------\n    Description\n    -----------\n    Some biosignalsnotebooks functions support a remote access to files. In this situation it is\n    important to understand if the input is an url, which can be easily achieved by checking if some\n    key-markers are present.\n\n    The key-markers that will be searched are \"http://\", \"https://\", \"www.\", \".pt\", \".com\", \".org\",\n    \".net\".\n\n    ----------\n    Parameters\n    ----------\n    input_element : unknown\n        The data structure that will be checked.\n\n    Returns\n    -------\n    out : bool\n        If the input_element is a string and if it contains any key-marker, then True flag will be returned.\n    \"\"\"\n    if type(input_element) is str:\n        # Check if signal_handler is a url.\n        # [Statements to be executed if signal_handler is a url]\n        if any(mark in input_element for mark in [\"http://\", \"https://\", \"www.\", \".pt\", \".com\",\n                                                  \".org\", \".net\"]):\n            return True\n        else:\n            return False\n    else:\n        return False", "entry_point": "_is_a_url", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L402-L439", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033674", "code": "def chunk(keywords, lines):\n    \"\"\"\n    Divide a file into chunks between\n    key words in the list\n    \"\"\"\n    chunks = dict()\n    chunk = []\n      \n    # Create an empty dictionary using all the keywords\n    for keyword in keywords:\n        chunks[keyword] = []\n    \n    # Populate dictionary with lists of chunks associated\n    # with the keywords in the list   \n    for line in lines:\n        if line.strip():\n            token = line.split()[0]\n            if token in keywords:\n                chunk = [line]   \n                chunks[token].append(chunk)   \n            else:\n                chunk.append(line)\n\n    return chunks", "entry_point": "chunk", "input": "[1, 2, 3], ''", "output": "{1: [], 2: [], 3: []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CI-WATER/gsshapy/blob/00fd4af0fd65f1614d75a52fe950a04fb0867f4c/gsshapy/lib/parsetools.py#L46-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033675", "code": "def cardChunk(key, chunk):\n    \"\"\"\n    Parse Card Chunk Method\n    \"\"\"\n    for line in chunk:\n        values = []\n        sline = line.strip().split()\n\n        for idx in range(1, len(sline)):\n            values.append(sline[idx])\n\n    return {'card': sline[0],\n            'values': values}", "entry_point": "cardChunk", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "{'card': 'c', 'values': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CI-WATER/gsshapy/blob/00fd4af0fd65f1614d75a52fe950a04fb0867f4c/gsshapy/lib/cif_chunk.py#L14-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033676", "code": "def _preprocessContaminantOutFilePath(outPath):\n        \"\"\"\n        Preprocess the contaminant output file path to a relative path.\n        \"\"\"\n        if '/' in outPath:\n            splitPath = outPath.split('/')\n\n        elif '\\\\' in outPath:\n            splitPath = outPath.split('\\\\')\n\n        else:\n            splitPath = [outPath, ]\n\n        if splitPath[-1] == '':\n            outputFilename = splitPath[-2]\n\n        else:\n            outputFilename = splitPath[-1]\n\n        if '.' in outputFilename:\n            outputFilename = outputFilename.split('.')[0]\n\n        return outputFilename", "entry_point": "_preprocessContaminantOutFilePath", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CI-WATER/gsshapy/blob/00fd4af0fd65f1614d75a52fe950a04fb0867f4c/gsshapy/orm/cmt.py#L587-L609", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033677", "code": "def dedupe_list(l):\n    \"\"\"Remove duplicates from a list preserving the order.\n\n    We might be tempted to use the list(set(l)) idiom, but it doesn't preserve\n    the order, which hinders testability and does not work for lists with\n    unhashable elements.\n    \"\"\"\n    result = []\n\n    for el in l:\n        if el not in result:\n            result.append(el)\n\n    return result", "entry_point": "dedupe_list", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/json-merger/blob/adc6d372da018427e1db7b92424d3471e01a4118/json_merger/utils.py#L107-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033678", "code": "def keep_longest(head, update, down_path):\n        \"\"\"Keep longest field among `head` and `update`.\n        \"\"\"\n        if update is None:\n            return 'f'\n        if head is None:\n            return 's'\n\n        return 'f' if len(head) >= len(update) else 's'", "entry_point": "keep_longest", "input": "[], ['a', 'b', 'c'], 'Hello World'", "output": "'s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-contrib/json-merger/blob/adc6d372da018427e1db7b92424d3471e01a4118/json_merger/config.py#L40-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033679", "code": "def cast_str(s, encoding='utf8', errors='strict'):\n    \"\"\"cast bytes or str to str\"\"\"\n    if isinstance(s, bytes):\n        return s.decode(encoding, errors)\n    elif isinstance(s, str):\n        return s\n    else:\n        raise TypeError(\"Expected unicode or bytes, got %r\" % s)", "entry_point": "cast_str", "input": "'AbC dEf', set(), ('a', 'b', 'c')", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eleme/meepo/blob/8212f0fe9b1d44be0c5de72d221a31c1d24bfe7a/meepo/utils.py#L57-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033680", "code": "def chebyshev(point1, point2):\n    \"\"\"Computes distance between 2D points using chebyshev metric\n\n    :param point1: 1st point\n    :type point1: list\n    :param point2: 2nd point\n    :type point2: list\n    :returns: Distance between point1 and point2\n    :rtype: float\n    \"\"\"\n\n    return max(abs(point1[0] - point2[0]), abs(point1[1] - point2[1]))", "entry_point": "chebyshev", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dpmcmlxxvi/pixelscan/blob/d641207b13a8fc5bf7ac9964b982971652bb0a7e/pixelscan/pixelscan.py#L26-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033681", "code": "def median(data):\n    \"\"\"Calculate the median of a list.\"\"\"\n    data.sort()\n    num_values = len(data)\n    half = num_values // 2\n    if num_values % 2:\n        return data[half]\n    return 0.5 * (data[half-1] + data[half])", "entry_point": "median", "input": "['apple', 'banana', 'cherry']", "output": "'banana'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tinybike/weightedstats/blob/0e2638099dba7f288a1553a83e957a95522229da/weightedstats/__init__.py#L60-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033682", "code": "def find_pareto_front(population):\n    \"\"\"Finds a subset of nondominated individuals in a given list\n\n    :param population: a list of individuals\n    :return: a set of indices corresponding to nondominated individuals\n    \"\"\"\n\n    pareto_front = set(range(len(population)))\n\n    for i in range(len(population)):\n        if i not in pareto_front:\n            continue\n\n        ind1 = population[i]\n        for j in range(i + 1, len(population)):\n            ind2 = population[j]\n\n            # if individuals are equal on all objectives, mark one of them (the first encountered one) as dominated\n            # to prevent excessive growth of the Pareto front\n            if ind2.fitness.dominates(ind1.fitness) or ind1.fitness == ind2.fitness:\n                pareto_front.discard(i)\n\n            if ind1.fitness.dominates(ind2.fitness):\n                pareto_front.discard(j)\n\n    return pareto_front", "entry_point": "find_pareto_front", "input": "set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cfusting/fastgp/blob/6cf3c5d14abedaea064feef6ca434ee806a11756/fastgp/algorithms/afpo.py#L28-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033683", "code": "def _all_equal(iterable):\n    \"\"\"True if all values in `iterable` are equal, else False.\"\"\"\n    iterator = iter(iterable)\n    first = next(iterator)\n    return all(first == rest for rest in iterator)", "entry_point": "_all_equal", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwavesystems/dwave_embedding_utilities/blob/2e485e0ae89d96f3c0005f144bab4b465a3039a3/dwave_embedding_utilities.py#L549-L553", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033684", "code": "def maybe_resolve(object, resolve):\n    \"\"\"\n    Call `resolve` on the `object`'s `$ref` value if it has one.\n\n    :param object: An object.\n    :param resolve: A resolving function.\n    :return: An object, or some other object! :sparkles:\n    \"\"\"\n    if isinstance(object, dict) and object.get('$ref'):\n        return resolve(object['$ref'])\n    return object", "entry_point": "maybe_resolve", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/akx/lepo/blob/34cfb24a40f18ea40f672c1ea9a0734ee1816b7d/lepo/utils.py#L6-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033685", "code": "def add_dicts(d1, d2):\n    \"\"\" Merge two dicts of addable values \"\"\"\n    if d1 is None:\n        return d2\n    if d2 is None:\n        return d1\n    keys = set(d1)\n    keys.update(set(d2))\n    ret = {}\n    for key in keys:\n        v1 = d1.get(key)\n        v2 = d2.get(key)\n        if v1 is None:\n            ret[key] = v2\n        elif v2 is None:\n            ret[key] = v1\n        else:\n            ret[key] = v1 + v2\n    return ret", "entry_point": "add_dicts", "input": "'', ''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevearc/dynamo3/blob/f897c40ece28586272dbcab8f0d99a14a1831dda/dynamo3/result.py#L7-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033686", "code": "def list_set(seq):\n    \"\"\"Similar to `list(set(seq))`, but maintains the order of `seq` while eliminating duplicates\n\n    In general list(set(L)) will not have the same order as the original list.\n    This is a list(set(L)) function that will preserve the order of L.\n\n    Arguments:\n      seq (iterable): list, tuple, or other iterable to be used to produce an ordered `set()`\n\n    Returns:\n      iterable: A copy of `seq` but with duplicates removed, and distinct elements in the same order as in `seq`\n\n    Examples:\n      >>> list_set([2.7,3,2,2,2,1,1,2,3,4,3,2,42,1])\n      [2.7, 3, 2, 1, 4, 42]\n      >>> list_set(['Zzz','abc', ('what.', 'ever.'), 0, 0.0, 'Zzz', 0.00, 'ABC'])\n      ['Zzz', 'abc', ('what.', 'ever.'), 0, 'ABC']\n    \"\"\"\n    new_list = []\n    for i in seq:\n        if i not in new_list:\n            new_list += [i]\n    return type(seq)(new_list)", "entry_point": "list_set", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/pugnlp/blob/c43445b14afddfdeadc5f3076675c9e8fc1ee67c/src/pugnlp/util.py#L606-L628", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033687", "code": "def transposed_lists(list_of_lists, default=None):\n    \"\"\"Like `numpy.transposed`, but allows uneven row lengths\n\n    Uneven lengths will affect the order of the elements in the rows of the transposed lists\n\n    >>> transposed_lists([[1, 2], [3, 4, 5], [6]])\n    [[1, 3, 6], [2, 4], [5]]\n    >>> transposed_lists(transposed_lists([[], [1, 2, 3], [4]]))\n    [[1, 2, 3], [4]]\n    >>> x = transposed_lists([range(4),[4,5]])\n    >>> x\n    [[0, 4], [1, 5], [2], [3]]\n    >>> transposed_lists(x)\n    [[0, 1, 2, 3], [4, 5]]\n    \"\"\"\n    if default is None or default is [] or default is tuple():\n        default = []\n    elif default is 'None':\n        default = [None]\n    else:\n        default = [default]\n\n    N = len(list_of_lists)\n    Ms = [len(row) for row in list_of_lists]\n    M = max(Ms)\n    ans = []\n    for j in range(M):\n        ans += [[]]\n        for i in range(N):\n            if j < Ms[i]:\n                ans[-1] += [list_of_lists[i][j]]\n            else:\n                ans[-1] += list(default)\n    return ans", "entry_point": "transposed_lists", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "[[1, 3, ['apple', 'banana', 'cherry']], [2, ['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/pugnlp/blob/c43445b14afddfdeadc5f3076675c9e8fc1ee67c/src/pugnlp/util.py#L872-L905", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033688", "code": "def strip_HTML(s):\n    \"\"\"Simple, clumsy, slow HTML tag stripper\"\"\"\n    result = ''\n    total = 0\n    for c in s:\n        if c == '<':\n            total = 1\n        elif c == '>':\n            total = 0\n            result += ' '\n        elif total == 0:\n            result += c\n    return result", "entry_point": "strip_HTML", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/pugnlp/blob/c43445b14afddfdeadc5f3076675c9e8fc1ee67c/src/pugnlp/util.py#L2256-L2268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033689", "code": "def convert_durations(metric):\n    \"\"\"\n    Convert session duration metrics from seconds to milliseconds.\n    \"\"\"\n    if metric[0] == 'avgSessionDuration' and metric[1]:\n        new_metric = (metric[0], metric[1] * 1000)\n    else:\n        new_metric = metric\n    return new_metric", "entry_point": "convert_durations", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alphagov/performanceplatform-collector/blob/de68ab4aa500c31e436e050fa1268fa928c522a5/performanceplatform/collector/ga/core.py#L53-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033690", "code": "def _get_path(entity_id):\n    '''Get the entity_id as a string if it is a Reference.\n\n    @param entity_id The ID either a reference or a string of the entity\n          to get.\n    @return entity_id as a string\n    '''\n    try:\n        path = entity_id.path()\n    except AttributeError:\n        path = entity_id\n    if path.startswith('cs:'):\n        path = path[3:]\n    return path", "entry_point": "_get_path", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/theblues/blob/f4431f29e43d04fc32f38f4f86cea45cd4e6ae98/theblues/charmstore.py#L482-L495", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033691", "code": "def dec2hms(dec):\n    \"\"\"\n    ADW: This should really be replaced by astropy\n    \"\"\"\n    DEGREE = 360.\n    HOUR = 24.\n    MINUTE = 60.\n    SECOND = 3600.\n    \n    dec = float(dec)\n    fhour = dec*(HOUR/DEGREE)\n    hour = int(fhour)\n\n    fminute = (fhour - hour)*MINUTE\n    minute = int(fminute)\n    \n    second = (fminute - minute)*MINUTE\n    return (hour, minute, second)", "entry_point": "dec2hms", "input": "5", "output": "(0, 20, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DarkEnergySurvey/ugali/blob/21e890b4117fc810afb6fb058e8055d564f03382/ugali/utils/projector.py#L380-L397", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033692", "code": "def identity_abs(aseq, bseq):\n    \"\"\"Compute absolute identity (# matching sites) between sequence strings.\"\"\"\n    assert len(aseq) == len(bseq)\n    return sum(a == b\n               for a, b in zip(aseq, bseq)\n               if not (a in '-.' and b in '-.'))", "entry_point": "identity_abs", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etal/biofrills/blob/36684bb6c7632f96215e8b2b4ebc86640f331bcd/biofrills/pairutils.py#L119-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033693", "code": "def guidance_UV(index):\n    \"\"\"Return Met Office guidance regarding UV exposure based on UV index\"\"\"\n    if 0 < index < 3:\n        guidance = \"Low exposure. No protection required. You can safely stay outside\"\n    elif 2 < index < 6:\n        guidance = \"Moderate exposure. Seek shade during midday hours, cover up and wear sunscreen\"\n    elif 5 < index < 8:\n        guidance = \"High exposure. Seek shade during midday hours, cover up and wear sunscreen\"\n    elif 7 < index < 11:\n        guidance = \"Very high. Avoid being outside during midday hours. Shirt, sunscreen and hat are essential\"\n    elif index > 10:\n        guidance = \"Extreme. Avoid being outside during midday hours. Shirt, sunscreen and hat essential.\"\n    else:\n        guidance = None\n    return guidance", "entry_point": "guidance_UV", "input": "2", "output": "'Low exposure. No protection required. You can safely stay outside'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sludgedesk/metoffer/blob/449748d31f913d961d6f0406542bb784e931a95b/metoffer.py#L158-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033694", "code": "def format_name(net: str) -> str:\n        '''take care of specifics of cryptoid naming system'''\n\n        if net.startswith('t') or 'testnet' in net:\n            net = net[1:] + '-test'\n        else:\n            net = net\n\n        return net", "entry_point": "format_name", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PeerAssets/pypeerassets/blob/8927b4a686887f44fe2cd9de777e2c827c948987/pypeerassets/provider/cryptoid.py#L33-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033695", "code": "def isnumerical(x):\n        # type: (...) -> bool\n        \"\"\"Check the input x is numerical or not.\n\n        Examples:\n            >>> MathClass.isnumerical('78')\n            True\n            >>> MathClass.isnumerical('1.e-5')\n            True\n            >>> MathClass.isnumerical(None)\n            False\n            >>> MathClass.isnumerical('a1.2')\n            False\n            >>> MathClass.isnumerical(['1.2'])\n            False\n            >>> MathClass.isnumerical(numpy.float64(1.2))\n            True\n\n        \"\"\"\n        try:\n            xx = float(x)\n        except TypeError:\n            return False\n        except ValueError:\n            return False\n        except Exception:\n            return False\n        else:\n            return True", "entry_point": "isnumerical", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lreis2415/PyGeoC/blob/9a92d1a229bb74298e3c57f27c97079980b5f729/pygeoc/utils.py#L111-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033696", "code": "def print_msg(contentlist):\n        # type: (Union[AnyStr, List[AnyStr], Tuple[AnyStr]]) -> AnyStr\n        \"\"\"concatenate message list as single string with line feed.\"\"\"\n        if isinstance(contentlist, list) or isinstance(contentlist, tuple):\n            return '\\n'.join(contentlist)\n        else:  # strings\n            if len(contentlist) > 1 and contentlist[-1] != '\\n':\n                contentlist += '\\n'\n            return contentlist", "entry_point": "print_msg", "input": "['a', 'b', 'c']", "output": "'a\\nb\\nc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lreis2415/PyGeoC/blob/9a92d1a229bb74298e3c57f27c97079980b5f729/pygeoc/utils.py#L952-L960", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033697", "code": "def uncamel(name):\n    \"\"\"converts camelcase to underscore\n    >>> uncamel('fooBar')\n    'foo_bar'\n    >>> uncamel('FooBar')\n    'foo_bar'\n    >>> uncamel('_fooBar')\n    '_foo_bar'\n    >>> uncamel('_FooBar')\n    '__foo_bar'\n    \"\"\"\n    response, name = name[0].lower(), name[1:]\n    for n in name:\n        if n.isupper():\n            response += '_' + n.lower()\n        else:\n            response += n\n    return response", "entry_point": "uncamel", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/johnnoone/json-spec/blob/f91981724cea0c366bd42a6670eb07bbe31c0e0c/src/jsonspec/validators/util.py#L60-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033698", "code": "def checkseq(sequence: str=None,  code=\"ATGC\") -> bool:\n    \"\"\"\n    :param sequence: The input sequence.\n    :type sequence: Seq\n    :rtype: bool\n    \"\"\"\n    for base in sequence:\n        if base not in code:\n            return False\n    return True", "entry_point": "checkseq", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nmdp-bioinformatics/SeqAnn/blob/5ce91559b0a4fbe4fb7758e034eb258202632463/seqann/util.py#L36-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033699", "code": "def extract_number(text):\n    \"\"\"Extract digit character from text.\n    \"\"\"\n    result = list()\n    chunk = list()\n    valid_char = set(\".1234567890\")\n    for char in text:\n        if char in valid_char:\n            chunk.append(char)\n        else:\n            result.append(\"\".join(chunk))\n            chunk = list()\n    result.append(\"\".join(chunk))\n\n    result_new = list()\n    for number in result:\n        if \".\" in number:\n            try:\n                result_new.append(float(number))\n            except:\n                pass\n        else:\n            try:\n                result_new.append(int(number))\n            except:\n                pass\n\n    return result_new", "entry_point": "extract_number", "input": "'Hello World'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/single_file_module-project/blob/01f7a6b250853bebfd73de275895bf274325cfc1/sfm/rerecipe.py#L51-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033700", "code": "def shift_and_trim(array, dist):\n    \"\"\"Shift and trim unneeded item.\n\n    :params array: list like iterable object\n    :params dist: int\n\n    Example::\n\n        >>> array = [0, 1, 2]\n\n        >>> shift_and_trim(array, 0)\n        [0, 1, 2]\n        >>> shift_and_trim(array, 1)\n        [0, 1]\n\n        >>> shift_and_trim(array, -1)\n        [1, 2]\n\n        >>> shift_and_trim(array, 3)\n        []\n\n        >>> shift_and_trim(array, -3)\n        []\n    \"\"\"\n    length = len(array)\n    if length == 0:\n        return []\n\n    if (dist >= length) or (dist <= -length):\n        return []\n    elif dist < 0:\n        return array[-dist:]\n    elif dist > 0:\n        return array[:-dist]\n    else:\n        return list(array)", "entry_point": "shift_and_trim", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/single_file_module-project/blob/01f7a6b250853bebfd73de275895bf274325cfc1/sfm/iterable.py#L351-L386", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033701", "code": "def shift_and_pad(array, dist, pad=\"__null__\"):\n    \"\"\"Shift and pad with item.\n\n    :params array: list like iterable object\n    :params dist: int\n    :params pad: any value\n\n    Example::\n\n        >>> array = [0, 1, 2]\n        >>> shift_and_pad(array, 0)\n        [0, 1, 2]\n\n        >>> shift_and_pad(array, 1)\n        [0, 0, 1]\n\n        >>> shift_and_pad(array, -1)\n        [1, 2, 2]\n\n        >>> shift_and_pad(array, 3)\n        [0, 0, 0]\n\n        >>> shift_and_pad(array, -3)\n        [2, 2, 2]\n\n        >>> shift_and_pad(array, -1, None)\n        [None, 0, 1]\n    \"\"\"\n    length = len(array)\n    if length == 0:\n        return []\n\n    if pad == \"__null__\":\n        if dist > 0:\n            padding_item = array[0]\n        elif dist < 0:\n            padding_item = array[-1]\n        else:\n            padding_item = None\n    else:\n        padding_item = pad\n\n    if abs(dist) >= length:\n        return length * [padding_item, ]\n    elif dist == 0:\n        return list(array)\n    elif dist > 0:\n        return [padding_item, ] * dist + array[:-dist]\n    elif dist < 0:\n        return array[-dist:] + [padding_item, ] * -dist\n    else:  # Never get in this logic\n        raise Exception", "entry_point": "shift_and_pad", "input": "[], [5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/single_file_module-project/blob/01f7a6b250853bebfd73de275895bf274325cfc1/sfm/iterable.py#L389-L440", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033702", "code": "def size_of_generator(generator, memory_efficient=True):\n    \"\"\"Get number of items in a generator function.\n\n    - memory_efficient = True, 3 times slower, but memory_efficient.\n    - memory_efficient = False, faster, but cost more memory.\n\n    **\u4e2d\u6587\u6587\u6863**\n\n    \u8ba1\u7b97\u4e00\u4e2a\u751f\u6210\u5668\u51fd\u6570\u4e2d\u7684\u5143\u7d20\u7684\u4e2a\u6570\u3002\u4f7f\u7528memory_efficient=True\u7684\u65b9\u6cd5\u53ef\u4ee5\u907f\u514d\u5c06\u751f\u6210\u5668\u4e2d\u7684\n    \u6240\u6709\u5143\u7d20\u653e\u5165\u5185\u5b58, \u4f46\u662f\u901f\u5ea6\u7a0d\u6162\u4e8ememory_efficient=False\u7684\u65b9\u6cd5\u3002\n    \"\"\"\n    if memory_efficient:\n        counter = 0\n        for _ in generator:\n            counter += 1\n        return counter\n    else:\n        return len(list(generator))", "entry_point": "size_of_generator", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/single_file_module-project/blob/01f7a6b250853bebfd73de275895bf274325cfc1/sfm/iterable.py#L443-L460", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033703", "code": "def SplitString(value):\n    \"\"\"simple method that puts in spaces every 10 characters\"\"\"\n    string_length = len(value)\n    chunks = int(string_length / 10)\n    string_list = list(value)\n    lstring = \"\"\n\n    if chunks > 1:\n        lstring = \"\\\\markup { \\n\\r \\column { \"\n        for i in range(int(chunks)):\n            lstring += \"\\n\\r\\r \\\\line { \\\"\"\n            index = i * 10\n            for i in range(index):\n                lstring += string_list[i]\n            lstring += \"\\\" \\r\\r}\"\n        lstring += \"\\n\\r } \\n }\"\n    if lstring == \"\":\n        indexes = [\n            i for i in range(\n                len(string_list)) if string_list[i] == \"\\r\" or string_list[i] == \"\\n\"]\n        lstring = \"\\\\markup { \\n\\r \\column { \"\n        if len(indexes) == 0:\n            lstring += \"\\n\\r\\r \\\\line { \\\"\" + \\\n                \"\".join(string_list) + \"\\\" \\n\\r\\r } \\n\\r } \\n }\"\n        else:\n            rows = []\n            row_1 = string_list[:indexes[0]]\n            rows.append(row_1)\n            for i in range(len(indexes)):\n                start = indexes[i]\n                if i != len(indexes) - 1:\n                    end = indexes[i + 1]\n                else:\n                    end = len(string_list)\n                row = string_list[start:end]\n                rows.append(row)\n\n            for row in rows:\n                lstring += \"\\n\\r\\r \\\\line { \\\"\"\n                lstring += \"\".join(row)\n                lstring += \"\\\" \\r\\r}\"\n            lstring += \"\\n\\r } \\n }\"\n    return lstring", "entry_point": "SplitString", "input": "['apple', 'banana', 'cherry']", "output": "'\\\\markup { \\n\\r \\\\column { \\n\\r\\r \\\\line { \"applebananacherry\" \\n\\r\\r } \\n\\r } \\n }'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Godley/MuseParse/blob/23cecafa1fdc0f2d6a87760553572b459f3c9904/MuseParse/helpers.py#L4-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033704", "code": "def NumbersToWords(number):\n    \"\"\"\n    little function that converts numbers to words. This could be more efficient,\n    and won't work if the number is bigger than 999 but it's for stave names,\n    and I doubt any part would have more than 10 staves let alone 999.\n    \"\"\"\n\n    units = [\n        'one',\n        'two',\n        'three',\n        'four',\n        'five',\n        'six',\n        'seven',\n        'eight',\n        'nine']\n    tens = [\n        'ten',\n        'twenty',\n        'thirty',\n        'forty',\n        'fifty',\n        'sixty',\n        'seventy',\n        'eighty',\n        'ninety']\n    output = \"\"\n    if number != 0:\n        str_val = str(number)\n        if 4 > len(str_val) > 2:\n            output += units[int(str_val[0]) - 1]\n            output += \"hundred\"\n            if str_val[1] != 0:\n                output += \"and\" + tens[int(str_val[1]) - 1]\n                if str_val[2] != 0:\n                    output += units[int(str_val[2]) - 1]\n        if 3 > len(str_val) > 1:\n            output += tens[int(str_val[0]) - 1]\n            if str_val[1] != 0:\n                output += units[int(str_val[1]) - 1]\n        if 2 > len(str_val) == 1:\n            output += units[int(str_val[0]) - 1]\n    else:\n        output = \"zero\"\n    return output", "entry_point": "NumbersToWords", "input": "7", "output": "'seven'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Godley/MuseParse/blob/23cecafa1fdc0f2d6a87760553572b459f3c9904/MuseParse/helpers.py#L63-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033705", "code": "def format_single_space_only(text):\n    \"\"\"Revise consecutive empty space to single space.\n\n    Example::\n\n        \" I   feel    so  GOOD!\" => \"This is so GOOD!\"\n\n    **\u4e2d\u6587\u6587\u6863**\n\n    \u786e\u4fdd\u6587\u672c\u4e2d\u4e0d\u4f1a\u51fa\u73b0\u591a\u4f59\u8fde\u7eed1\u6b21\u7684\u7a7a\u683c\u3002\n    \"\"\"\n    return \" \".join([word for word in text.strip().split(\" \") if len(word) >= 1])", "entry_point": "format_single_space_only", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/single_file_module-project/blob/01f7a6b250853bebfd73de275895bf274325cfc1/sfm/textformatter.py#L26-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033706", "code": "def format_person_name(text):\n    \"\"\"Capitalize first letter for each part of the name.\n\n    Example::\n\n        person_name = \"James Bond\"\n\n    **\u4e2d\u6587\u6587\u6863**\n\n    \u5c06\u6587\u672c\u4fee\u6539\u4e3a\u4eba\u540d\u683c\u5f0f\u3002\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u5927\u5199\u3002\n    \"\"\"\n    text = text.strip()\n    if len(text) == 0:  # if empty string, return it\n        return text\n    else:\n        text = text.lower()  # lower all char\n        # delete redundant empty space\n        words = [word for word in text.strip().split(\" \") if len(word) >= 1]\n        words = [word[0].upper() + word[1:] for word in words]\n        return \" \".join(words)", "entry_point": "format_person_name", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/single_file_module-project/blob/01f7a6b250853bebfd73de275895bf274325cfc1/sfm/textformatter.py#L74-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033707", "code": "def build_signature_template(key_id, algorithm, headers):\n    \"\"\"\n    Build the Signature template for use with the Authorization header.\n\n    key_id is the mandatory label indicating to the server which secret to use\n    algorithm is one of the supported algorithms\n    headers is a list of http headers to be included in the signing string.\n\n    The signature must be interpolated into the template to get the final\n    Authorization header value.\n    \"\"\"\n    param_map = {'keyId': key_id,\n                 'algorithm': algorithm,\n                 'signature': '%s'}\n    if headers:\n        headers = [h.lower() for h in headers]\n        param_map['headers'] = ' '.join(headers)\n    kv = map('{0[0]}=\"{0[1]}\"'.format, param_map.items())\n    kv_string = ','.join(kv)\n    sig_string = 'Signature {0}'.format(kv_string)\n    return sig_string", "entry_point": "build_signature_template", "input": "['apple', 'banana', 'cherry'], [], []", "output": "'Signature keyId=\"[\\'apple\\', \\'banana\\', \\'cherry\\']\",algorithm=\"[]\",signature=\"%s\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSPC-SPAC-buyandsell/didauth/blob/e242fff8eddebf6ed52a65b161a229cdfbf5226e/didauth/utils.py#L115-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033708", "code": "def _parse_dbpath(dbpath):\n        \"\"\"Converts the dbpath to a regexp pattern.\n\n        Transforms dbpath from a string or an array of strings to a\n        regexp pattern which will be used to match database names.\n\n        Args:\n            dbpath: a string or an array containing the databases to be matched\n                from a cluster.\n\n        Returns:\n            A regexp pattern that will match any of the desired databases on\n            on a cluster.\n        \"\"\"\n        if isinstance(dbpath, list):\n            # Support dbpath param as an array.\n            dbpath = '|'.join(dbpath)\n\n        # Append $ (end of string) so that twit will not match twitter!\n        if not dbpath.endswith('$'):\n            dbpath = '(%s)$' % dbpath\n\n        return dbpath", "entry_point": "_parse_dbpath", "input": "'AbC dEf'", "output": "'(AbC dEf)$'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uberVU/mongo-pool/blob/286d1d8e0b3c17d5d7d4860487fe69358941067d/mongo_pool/mongo_pool.py#L142-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033709", "code": "def _is_mwtab(string):\n        \"\"\"Test if input string is in `mwtab` format.\n\n        :param string: Input string.\n        :type string: :py:class:`str` or :py:class:`bytes`\n        :return: Input string if in mwTab format or False otherwise.\n        :rtype: :py:class:`str` or :py:obj:`False`\n        \"\"\"\n        if isinstance(string, str):\n            lines = string.split(\"\\n\")\n        elif isinstance(string, bytes):\n            lines = string.decode(\"utf-8\").split(\"\\n\")\n        else:\n            raise TypeError(\"Expecting <class 'str'> or <class 'bytes'>, but {} was passed\".format(type(string)))\n\n        lines = [line for line in lines if line]\n        header = lines[0]\n\n        if header.startswith(\"#METABOLOMICS WORKBENCH\"):\n            return \"\\n\".join(lines)\n        return False", "entry_point": "_is_mwtab", "input": "'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MoseleyBioinformaticsLab/mwtab/blob/8c0ae8ab2aa621662f99589ed41e481cf8b7152b/mwtab/mwtab.py#L314-L334", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033710", "code": "def is_compressed(path):\n        \"\"\"Test if path represents compressed file(s).\n\n        :param str path: Path to file(s).\n        :return: String specifying compression type if compressed, \"\" otherwise.\n        :rtype: :py:class:`str`\n        \"\"\"\n        if path.endswith(\".zip\"):\n            return \"zip\"\n        elif path.endswith(\".tar.gz\"):\n            return \"tar.gz\"\n        elif path.endswith(\".tar.bz2\"):\n            return \"tar.bz2\"\n        elif path.endswith(\".gz\"):\n            return \"gz\"\n        elif path.endswith(\".bz2\"):\n            return \"bz2\"\n        elif path.endswith(\".tar\"):\n            return \"tar\"\n        return \"\"", "entry_point": "is_compressed", "input": "'Hello World'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MoseleyBioinformaticsLab/mwtab/blob/8c0ae8ab2aa621662f99589ed41e481cf8b7152b/mwtab/fileio.py#L186-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033711", "code": "def json_get(json_object, property_path, default=None):\n    \"\"\"\n        get value of property_path from a json object, e.g. person.father.name\n        * invalid path return None\n        * valid path (the -1 on path is an object), use default\n    \"\"\"\n    temp = json_object\n    for field in property_path[:-1]:\n        if not isinstance(temp, dict):\n            return None\n        temp = temp.get(field, {})\n    if not isinstance(temp, dict):\n        return None\n    return temp.get(property_path[-1], default)", "entry_point": "json_get", "input": "{'x': [1, 2], 'y': []}, ('a', 'b', 'c'), set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cnschema/cdata/blob/893e2e1e27b61c8551c8b5f5f9bf05ec61490e23/cdata/core.py#L102-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033712", "code": "def json_dict_copy(json_object, property_list, defaultValue=None):\n    \"\"\"\n        property_list = [\n            { \"name\":\"name\", \"alternateName\": [\"name\",\"title\"]},\n            { \"name\":\"birthDate\", \"alternateName\": [\"dob\",\"dateOfBirth\"] },\n            { \"name\":\"description\" }\n        ]\n    \"\"\"\n    ret = {}\n    for prop in property_list:\n        p_name = prop[\"name\"]\n        for alias in prop.get(\"alternateName\", []):\n            if json_object.get(alias) is not None:\n                ret[p_name] = json_object.get(alias)\n                break\n        if not p_name in ret:\n            if p_name in json_object:\n                ret[p_name] = json_object[p_name]\n            elif defaultValue is not None:\n                ret[p_name] = defaultValue\n\n    return ret", "entry_point": "json_dict_copy", "input": "['apple', 'banana', 'cherry'], [], {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cnschema/cdata/blob/893e2e1e27b61c8551c8b5f5f9bf05ec61490e23/cdata/core.py#L138-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033713", "code": "def split_name(name):\n    \"\"\"Splits a (possibly versioned) name into unversioned name and version.\n\n       Returns a tuple ``(unversioned_name, version)``, where ``version`` may\n       be ``None``.\n    \"\"\"\n    s = name.rsplit('@', 1)\n    if len(s) == 1:\n        return s[0], None\n    else:\n        try:\n            return s[0], int(s[1])\n        except ValueError:\n            raise ValueError(\"Invalid Filetracker filename: version must \"\n                             \"be int, not %r\" % (s[1],))", "entry_point": "split_name", "input": "'a,b,c'", "output": "('a,b,c', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sio2project/filetracker/blob/359b474850622e3d0c25ee2596d7242c02f84efb/filetracker/utils.py#L12-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033714", "code": "def selectSort(list1, list2):\n    \"\"\"\n    Razeni 2 poli najednou (list) pomoci metody select sort\n        input:\n            list1 - prvni pole (hlavni pole pro razeni)\n            list2 - druhe pole (vedlejsi pole) (kopirujici pozice pro razeni\n                podle hlavniho pole list1)\n\n        returns:\n            dve serazena pole - hodnoty se ridi podle prvniho pole, druhe\n                \"kopiruje\" razeni\n    \"\"\"\n\n    length = len(list1)\n    for index in range(0, length):\n        min = index\n        for index2 in range(index + 1, length):\n            if list1[index2] > list1[min]:\n                min = index2\n        # Prohozeni hodnot hlavniho pole\n        list1[index], list1[min] = list1[min], list1[index]\n        # Prohozeni hodnot vedlejsiho pole\n        list2[index], list2[min] = list2[min], list2[index]\n\n    return list1, list2", "entry_point": "selectSort", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "(['cherry', 'banana', 'apple'], [1, 3, 5, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mjirik/imtools/blob/eb29fa59df0e0684d8334eb3bc5ef36ea46d1d3a/imtools/thresholding_functions.py#L524-L548", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033715", "code": "def make_str_content(content):\n    \"\"\"\n    In python3+ requests.Response.content returns bytes instead of ol'good str.\n    :param content: requests.Response.content\n    :return: str representation of the requests.Response.content data\n    \"\"\"\n    if not isinstance(content, str):\n        content = str(content.decode())\n    return content", "entry_point": "make_str_content", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thilux/tvdb_client/blob/2d5106f260367c0abe1284683697874df6343f78/tvdb_client/utils/utils.py#L23-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033716", "code": "def string_literal(content):\n    \"\"\"\n    Choose a string literal that can wrap our string.\n\n    If your string contains a ``\\'`` the result will be wrapped in ``\\\"``.\n    If your string contains a ``\\\"`` the result will be wrapped in ``\\'``.\n\n    Cannot currently handle strings which contain both ``\\\"`` and ``\\'``.\n    \"\"\"\n\n    if '\"' in content and \"'\" in content:\n        # there is no way to escape string literal characters in XPath\n        raise ValueError(\"Cannot represent this string in XPath\")\n\n    if '\"' in content:  # if it contains \" wrap it in '\n        content = \"'%s'\" % content\n    else:  # wrap it in \"\n        content = '\"%s\"' % content\n\n    return content", "entry_point": "string_literal", "input": "[-1, 0, 1, 2]", "output": "'\"[-1, 0, 1, 2]\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aloetesting/aloe_webdriver/blob/65d847da4bdc63f9c015cb19d4efdee87df8ffad/aloe_webdriver/util.py#L32-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033717", "code": "def field_xpath(field, attribute):\n    \"\"\"\n    Field helper functions to locate select, textarea, and the other\n    types of input fields (text, checkbox, radio)\n\n    :param field: One of the values 'select', 'textarea', 'option', or\n    'button-element' to match a corresponding HTML element (and to\n    match a <button> in the case of 'button-element'). Otherwise a\n    type to match an <input> element with a type=<field> attribute.\n\n    :param attribute: An attribute to be matched against, or 'value'\n    to match against the content within element being matched.\n    \"\"\"\n    if field in ['select', 'textarea']:\n        xpath = './/{field}[@{attr}=%s]'\n\n    elif field == 'button-role':\n        if attribute == 'value':\n            xpath = './/*[@role=\"button\"][contains(., %s)]'\n        else:\n            xpath = './/*[@role=\"button\"][@{attr}=%s]'\n\n    elif field == 'button-element':\n        field = 'button'\n        if attribute == 'value':\n            xpath = './/{field}[contains(., %s)]'\n        else:\n            xpath = './/{field}[@{attr}=%s]'\n\n    elif field == 'option':\n        xpath = './/{field}[@{attr}=%s]'\n\n    else:\n        xpath = './/input[@{attr}=%s][@type=\"{field}\"]'\n\n    return xpath.format(field=field, attr=attribute)", "entry_point": "field_xpath", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "'.//input[@[-1, 0, 1, 2]=%s][@type=\"[[1, 2], [3], []]\"]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aloetesting/aloe_webdriver/blob/65d847da4bdc63f9c015cb19d4efdee87df8ffad/aloe_webdriver/util.py#L242-L277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033718", "code": "def human_filesize(i):\n    \"\"\"\n    'human-readable' file size (i.e. 13 KB, 4.1 MB, 102 bytes, etc).\n    \"\"\"\n    bytes = float(i)\n    if bytes < 1024:\n        return u\"%d Byte%s\" % (bytes, bytes != 1 and u\"s\" or u\"\")\n    if bytes < 1024 * 1024:\n        return u\"%.1f KB\" % (bytes / 1024)\n    if bytes < 1024 * 1024 * 1024:\n        return u\"%.1f MB\" % (bytes / (1024 * 1024))\n    return u\"%.1f GB\" % (bytes / (1024 * 1024 * 1024))", "entry_point": "human_filesize", "input": "5", "output": "'5 Bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jedie/PyHardLinkBackup/blob/be28666834d2d9e3d8aac1b661cb2d5bd4056c29/PyHardLinkBackup/phlb/human.py#L23-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033719", "code": "def split_parameter_types(parameters):\n    \"\"\"Split a parameter types declaration into individual types.\n\n    The input is the left hand side of a signature (the part before the arrow),\n    excluding the parentheses.\n\n    :sig: (str) -> List[str]\n    :param parameters: Comma separated parameter types.\n    :return: Parameter types.\n    \"\"\"\n    if parameters == \"\":\n        return []\n\n    # only consider the top level commas, ignore the ones in []\n    commas = []\n    bracket_depth = 0\n    for i, char in enumerate(parameters):\n        if (char == \",\") and (bracket_depth == 0):\n            commas.append(i)\n        elif char == \"[\":\n            bracket_depth += 1\n        elif char == \"]\":\n            bracket_depth -= 1\n\n    types = []\n    last_i = 0\n    for i in commas:\n        types.append(parameters[last_i:i].strip())\n        last_i = i + 1\n    else:\n        types.append(parameters[last_i:].strip())\n    return types", "entry_point": "split_parameter_types", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uyar/pygenstub/blob/a6b18a823382d3c6be29c411fb33c58b6090d22c/pygenstub.py#L127-L158", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033720", "code": "def create_metric(metric_type, metric_id, data):\n    \"\"\"\n    Create Hawkular-Metrics' submittable structure.\n\n    :param metric_type: MetricType to be matched (required)\n    :param metric_id: Exact string matching metric id\n    :param data: A datapoint or a list of datapoints created with create_datapoint(value, timestamp, tags)\n    \"\"\"\n    if not isinstance(data, list):\n        data = [data]\n\n    return { 'type': metric_type,'id': metric_id, 'data': data }", "entry_point": "create_metric", "input": "[], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "{'type': [], 'id': ['a', 'b', 'c'], 'data': ['a', 'b', 'c']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hawkular/hawkular-client-python/blob/52371f9ebabbe310efee2a8ff8eb735ccc0654bb/hawkular/metrics.py#L384-L395", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033721", "code": "def get_default_options(num_machines=1, max_wallclock_seconds=1800, withmpi=False):\n    \"\"\"\n    Return an instance of the options dictionary with the minimally required parameters\n    for a JobCalculation and set to default values unless overriden\n\n    :param num_machines: set the number of nodes, default=1\n    :param max_wallclock_seconds: set the maximum number of wallclock seconds, default=1800\n    :param withmpi: if True the calculation will be run in MPI mode\n    \"\"\"\n    return {\n        'resources': {\n            'num_machines': int(num_machines)\n        },\n        'max_wallclock_seconds': int(max_wallclock_seconds),\n        'withmpi': withmpi,\n    }", "entry_point": "get_default_options", "input": "3.25, False, 'walnut thistle harbour'", "output": "{'resources': {'num_machines': 3}, 'max_wallclock_seconds': 0, 'withmpi': 'walnut thistle harbour'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aiidateam/aiida-codtools/blob/da5e4259b7a2e86cf0cc3f997e11dd36d445fa94/aiida_codtools/common/resources.py#L5-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033722", "code": "def expand_namespace(nsmap, string):\n    \"\"\" If the string starts with a known prefix in nsmap, replace it by full URI\n\n    :param nsmap: Dictionary of prefix -> uri of namespace\n    :param string: String in which to replace the namespace\n    :return: Expanded string with no namespace\n    \"\"\"\n    for ns in nsmap:\n        if isinstance(string, str) and isinstance(ns, str) and string.startswith(ns+\":\"):\n            return string.replace(ns+\":\", nsmap[ns])\n    return string", "entry_point": "expand_namespace", "input": "{'x': [1, 2], 'y': []}, 'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Capitains/MyCapytain/blob/b11bbf6b6ae141fc02be70471e3fbf6907be6593/MyCapytain/common/utils/_graph.py#L72-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033723", "code": "def uniqued(iterable):\n    \"\"\"Return unique list of items preserving order.\n\n    >>> uniqued([3, 2, 1, 3, 2, 1, 0])\n    [3, 2, 1, 0]\n    \"\"\"\n    seen = set()\n    add = seen.add\n    return [i for i in iterable if i not in seen and not add(i)]", "entry_point": "uniqued", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xflr6/features/blob/f985304dd642da6ecdc66d85167d00daa4efe5f4/features/tools.py#L10-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033724", "code": "def normalizeXpath(xpath):\n    \"\"\" Normalize XPATH split around slashes\n\n    :param xpath: List of xpath elements\n    :type xpath: [str]\n    :return: List of refined xpath\n    :rtype: [str]\n    \"\"\"\n    new_xpath = []\n    for x in range(0, len(xpath)):\n        if x > 0 and len(xpath[x-1]) == 0:\n            new_xpath.append(\"/\"+xpath[x])\n        elif len(xpath[x]) > 0:\n            new_xpath.append(xpath[x])\n    return new_xpath", "entry_point": "normalizeXpath", "input": "'Hello World'", "output": "['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Capitains/MyCapytain/blob/b11bbf6b6ae141fc02be70471e3fbf6907be6593/MyCapytain/common/utils/xml.py#L185-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033725", "code": "def list_formatter(handler, item, value):\n    \"\"\"Format list.\"\"\"\n    return u', '.join(str(v) for v in value)", "entry_point": "list_formatter", "input": "[1, 2, 3], [-1, 0, 1, 2], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klen/muffin-admin/blob/404dc8e5107e943b7c42fa21c679c34ddb4de1d5/muffin_admin/formatters.py#L21-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033726", "code": "def make_regex(string):\n    \"\"\"Regex string for optionally signed binary or privative feature.\n\n    >>> [make_regex(s) for s in '+spam -spam spam'.split()]\n    ['([+]?spam)', '(-spam)', '(spam)']\n\n    >>> make_regex('+eggs-spam')\n    Traceback (most recent call last):\n        ...\n    ValueError: inappropriate feature name: '+eggs-spam'\n\n    >>> make_regex('')\n    Traceback (most recent call last):\n        ...\n    ValueError: inappropriate feature name: ''\n    \"\"\"\n    if string and string[0] in '+-':\n        sign, name = string[0], string[1:]\n        if not name or '+' in name or '-' in name:\n            raise ValueError('inappropriate feature name: %r' % string)\n\n        tmpl = r'([+]?%s)' if sign == '+' else r'(-%s)'\n        return tmpl % name\n\n    if not string or '+' in string or '-' in string:\n        raise ValueError('inappropriate feature name: %r' % string)\n\n    return r'(%s)' % string", "entry_point": "make_regex", "input": "'abc'", "output": "'(abc)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xflr6/features/blob/f985304dd642da6ecdc66d85167d00daa4efe5f4/features/parsers.py#L18-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033727", "code": "def filter_query_string(query):\n    \"\"\"\n        Return a version of the query string with the _e, _k and _s values\n        removed.\n    \"\"\"\n    return '&'.join([q for q in query.split('&')\n        if not (q.startswith('_k=') or q.startswith('_e=') or q.startswith('_s'))])", "entry_point": "filter_query_string", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Felspar/django-fost-authn/blob/31623fa9f77570fe9b99962595da12f67f24c409/fost_authn/signature.py#L14-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033728", "code": "def all_valid(formsets):\n    \"\"\"Returns true if every formset in formsets is valid.\"\"\"\n    valid = True\n    for formset in formsets:\n        if not formset.is_valid():\n            valid = False\n    return valid", "entry_point": "all_valid", "input": "set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/weijia/djangoautoconf/blob/b7dbda2287ed8cb9de6d02cb3abaaa1c36b1ced0/djangoautoconf/class_based_views/detail_with_inline_view.py#L7-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033729", "code": "def combine(a1, a2):\n    ''' Combine to argument into a single flat list\n\n    It is used when you are not sure whether arguments are lists but want to combine them into one flat list\n\n    Args:\n        a1: list or other thing\n        a2: list or other thing\n\n    Returns:\n        list: a flat list contain a1 and a2\n    '''\n    if not isinstance(a1, list):\n        a1 = [a1]\n    if not isinstance(a2, list):\n        a2 = [a2]\n    return a1 + a2", "entry_point": "combine", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2, -1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/casouri/launchdman/blob/c83840e640cb075fab2534049f1e25fac6933c64/launchdman/__init__.py#L85-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033730", "code": "def conv(arg,default=None,func=None):\n    '''\n    essentially, the generalization of\n    \n    arg if arg else default\n\n    or\n\n    func(arg) if arg else default\n    '''\n    if func:\n        return func(arg) if arg else default;\n    else:\n        return arg if arg else default;", "entry_point": "conv", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/noobermin/pys/blob/e01b74210c65eb96d019bb42e0a3c9e6676da943/pys/__init__.py#L10-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033731", "code": "def takef(d,l,val=None):\n    '''take(f) a list of keys and fill in others with val'''\n    return {i:(d[i] if i in d else val)\n            for i in l};", "entry_point": "takef", "input": "[1, 2, 3], [-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "{-1: [-1, 0, 1, 2], 0: [-1, 0, 1, 2], 1: 2, 2: 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/noobermin/pys/blob/e01b74210c65eb96d019bb42e0a3c9e6676da943/pys/__init__.py#L245-L248", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033732", "code": "def list_of_dicts_to_dict_of_lists(list_of_dictionaries):\n    \"\"\"\n        Takes a list of dictionaries and creates a dictionary with the combined values for \n        each key in each dicitonary.\n        Missing values are set to `None` for each dicitonary that does not contain a key \n        that is present in at least one other dicitonary.\n\n            >>> litus.list_of_dicts_to_dict_of_lists([{'a':1,'b':2,'c':3},{'a':3,'b':4,'c':5},{'a':1,'b':2,'c':3}])\n\n            {'a': [1, 3, 1], 'b': [2, 4, 2], 'c': [3, 5, 3]}\n\n        Shorthand: `litus.ld2dl(..)`\n    \"\"\"\n    result = {}\n    all_keys = set([k for d in  list_of_dictionaries for k in d.keys()])\n    for d in list_of_dictionaries:\n        for k in all_keys:\n            result.setdefault(k,[]).append(d.get(k,None))\n    return result", "entry_point": "list_of_dicts_to_dict_of_lists", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jahuth/litus/blob/712b016ea2dbb1cf0a30bfdbb0a136945a7b7c5e/__init__.py#L564-L582", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033733", "code": "def dict_of_lists_to_list_of_dicts(dictionary_of_lists):\n    \"\"\"\n        Takes a dictionary of lists and creates a list of dictionaries.\n        If the lists are of unequal length, the remaining entries are set to `None`.\n\n        Shorthand: `litus.dl2ld(..)`:\n\n            >>> litus.dl2ld({'a': [1, 3, 1], 'b': [2, 4, 2], 'c': [3, 5, 3]})\n\n            [{'a': 1, 'b': 2, 'c': 3}, {'a': 3, 'b': 4, 'c': 5}, {'a': 1, 'b': 2, 'c': 3}]\n\n    \"\"\"\n    return [{key: dictionary_of_lists[key][index] if len(dictionary_of_lists[key]) > index else None for key in dictionary_of_lists.keys()}\n         for index in range(max(map(len,dictionary_of_lists.values())))]", "entry_point": "dict_of_lists_to_list_of_dicts", "input": "{'x': [1, 2], 'y': []}", "output": "[{'x': 1, 'y': None}, {'x': 2, 'y': None}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jahuth/litus/blob/712b016ea2dbb1cf0a30bfdbb0a136945a7b7c5e/__init__.py#L586-L599", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033734", "code": "def _get_num_contracts(contracts_list, param_name):\n    \"\"\"\n    Return the number of simple/default contracts.\n\n    Simple contracts are the ones which raise a RuntimeError with message\n    'Argument `*[argument_name]*` is not valid'\n    \"\"\"\n    msg = \"Argument `*[argument_name]*` is not valid\"\n    return sum(\n        [\n            1 if item[\"msg\"] == msg.replace(\"*[argument_name]*\", param_name) else 0\n            for item in contracts_list\n        ]\n    )", "entry_point": "_get_num_contracts", "input": "[], 'a,b,c'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/pexdoc/blob/201ac243e5781347feb75896a4231429fe6da4b1/pexdoc/pcontracts.py#L288-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033735", "code": "def order_preserving_single_index_shift(arr, index, new_index):\n    \"\"\"Moves a list element to a new index while preserving order.\n\n    Parameters\n    ---------\n    arr : list\n        The list in which to shift an element.\n    index : int\n        The index of the element to shift.\n    new_index : int\n        The index to which to shift the element.\n\n    Returns\n    -------\n    list\n        The list with the element shifted.\n\n    Example\n    -------\n    >>> arr = ['a', 'b', 'c', 'd']\n    >>> order_preserving_single_index_shift(arr, 2, 0)\n    ['c', 'a', 'b', 'd']\n    >>> order_preserving_single_index_shift(arr, 2, 3)\n    ['a', 'b', 'd', 'c']\n    \"\"\"\n    if new_index == 0:\n        return [arr[index]] + arr[0:index] + arr[index+1:]\n    if new_index == len(arr) - 1:\n        return arr[0:index] + arr[index+1:] + [arr[index]]\n    if index < new_index:\n        return arr[0:index] + arr[index+1:new_index+1] + [arr[index]] + arr[\n            new_index+1:]\n    if new_index <= index:\n        return arr[0:new_index] + [arr[index]] + arr[new_index:index] + arr[\n            index+1:]", "entry_point": "order_preserving_single_index_shift", "input": "[5, 3, 1, 4], 1, 2", "output": "[5, 1, 3, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaypal5/strct/blob/f3a301692d052ddb79331230b3c00625db1d83fc/strct/lists/_list.py#L32-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033736", "code": "def options_string_builder(option_mapping, args):\n    \"\"\"Return arguments for CLI invocation of kal.\"\"\"\n    options_string = \"\"\n    for option, flag in option_mapping.items():\n        if option in args:\n            options_string += str(\" %s %s\" % (flag, str(args[option])))\n    return options_string", "entry_point": "options_string_builder", "input": "{'a': 1, 'b': 2}, [5, 3, 1, 4]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ashmastaflash/kal-wrapper/blob/80ee03ab7bd3172ac26b769d6b442960f3424b0e/kalibrate/fn.py#L6-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033737", "code": "def determine_final_freq(base, direction, modifier):\n    \"\"\"Return integer for frequency.\"\"\"\n    result = 0\n    if direction == \"+\":\n        result = base + modifier\n    elif direction == \"-\":\n        result = base - modifier\n    return(result)", "entry_point": "determine_final_freq", "input": "[-1, 0, 1, 2], [], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ashmastaflash/kal-wrapper/blob/80ee03ab7bd3172ac26b769d6b442960f3424b0e/kalibrate/fn.py#L55-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033738", "code": "def determine_band_channel(kal_out):\n    \"\"\"Return band, channel, target frequency from kal output.\"\"\"\n    band = \"\"\n    channel = \"\"\n    tgt_freq = \"\"\n    while band == \"\":\n        for line in kal_out.splitlines():\n            if \"Using \" in line and \" channel \" in line:\n                band = str(line.split()[1])\n                channel = str(line.split()[3])\n                tgt_freq = str(line.split()[4]).replace(\n                    \"(\", \"\").replace(\")\", \"\")\n        if band == \"\":\n            band = None\n    return(band, channel, tgt_freq)", "entry_point": "determine_band_channel", "input": "'  padded  '", "output": "(None, '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ashmastaflash/kal-wrapper/blob/80ee03ab7bd3172ac26b769d6b442960f3424b0e/kalibrate/fn.py#L140-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033739", "code": "def get_measurements_from_kal_scan(kal_out):\n    \"\"\"Return a list of all measurements from kalibrate channel scan.\"\"\"\n    result = []\n    for line in kal_out.splitlines():\n        if \"offset \" in line:\n            p_line = line.split(' ')\n            result.append(p_line[-1])\n    return result", "entry_point": "get_measurements_from_kal_scan", "input": "'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ashmastaflash/kal-wrapper/blob/80ee03ab7bd3172ac26b769d6b442960f3424b0e/kalibrate/fn.py#L206-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033740", "code": "def norm_int_dict(int_dict):\n    \"\"\"Normalizes values in the given dict with int values.\n\n    Parameters\n    ----------\n    int_dict : list\n        A dict object mapping each key to an int value.\n\n    Returns\n    -------\n    dict\n        A dict where each key is mapped to its relative part in the sum of\n        all dict values.\n\n    Example\n    -------\n    >>> dict_obj = {'a': 3, 'b': 5, 'c': 2}\n    >>> result = norm_int_dict(dict_obj)\n    >>> print(sorted(result.items()))\n    [('a', 0.3), ('b', 0.5), ('c', 0.2)]\n    \"\"\"\n    norm_dict = int_dict.copy()\n    val_sum = sum(norm_dict.values())\n    for key in norm_dict:\n        norm_dict[key] = norm_dict[key] / val_sum\n    return norm_dict", "entry_point": "norm_int_dict", "input": "{'a': 1, 'b': 2}", "output": "{'a': 0.3333333333333333, 'b': 0.6666666666666666}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaypal5/strct/blob/f3a301692d052ddb79331230b3c00625db1d83fc/strct/dicts/_dict.py#L581-L606", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033741", "code": "def reverse_dict_partial(dict_obj):\n    \"\"\"Reverse a dict, so each value in it maps to one of its keys.\n\n    Parameters\n    ----------\n    dict_obj : dict\n        A key-value dict.\n\n    Returns\n    -------\n    dict\n        A dict where each value maps to the key that mapped to it.\n\n    Example\n    -------\n    >>> dicti = {'a': 1, 'b': 3}\n    >>> reverse_dict_partial(dicti)\n    {1: 'a', 3: 'b'}\n    \"\"\"\n    new_dict = {}\n    for key in dict_obj:\n        new_dict[dict_obj[key]] = key\n    return new_dict", "entry_point": "reverse_dict_partial", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaypal5/strct/blob/f3a301692d052ddb79331230b3c00625db1d83fc/strct/dicts/_dict.py#L705-L727", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033742", "code": "def reverse_list_valued_dict(dict_obj):\n    \"\"\"Reverse a list-valued dict, so each element in a list maps to its key.\n\n    Parameters\n    ----------\n    dict_obj : dict\n        A dict where each key maps to a list of unique values. Values are\n        assumed to be unique across the entire dict, on not just per-list.\n\n    Returns\n    -------\n    dict\n        A dict where each element in a value list of the input dict maps to\n        the key that mapped to the list it belongs to.\n\n    Example\n    -------\n    >>> dicti = {'a': [1, 2], 'b': [3, 4]}\n    >>> reverse_list_valued_dict(dicti)\n    {1: 'a', 2: 'a', 3: 'b', 4: 'b'}\n    \"\"\"\n    new_dict = {}\n    for key in dict_obj:\n        for element in dict_obj[key]:\n            new_dict[element] = key\n    return new_dict", "entry_point": "reverse_list_valued_dict", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaypal5/strct/blob/f3a301692d052ddb79331230b3c00625db1d83fc/strct/dicts/_dict.py#L730-L755", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033743", "code": "def base62_decode(string):\n    \"\"\"Decode a Base X encoded string into the number\n\n    Arguments:\n    - `string`: The encoded string\n    - `alphabet`: The alphabet to use for encoding\n    Stolen from: http://stackoverflow.com/a/1119769/1144479\n    \"\"\"\n\n    alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'\n\n    base = len(alphabet)\n    strlen = len(string)\n    num = 0\n\n    idx = 0\n    for char in string:\n        power = (strlen - (idx + 1))\n        num += alphabet.index(char) * (base ** power)\n        idx += 1\n\n    return int(num)", "entry_point": "base62_decode", "input": "'abc'", "output": "39134", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Metatab/geoid/blob/4b7769406b00e59376fb6046b42a2f8ed706b33b/geoid/core.py#L384-L405", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033744", "code": "def split_name(name):\n    \"\"\"Extracts pieces of name from full name string.\n\n    Full name can have one of these formats:\n        <NAME_TEXT> |\n        /<NAME_TEXT>/ |\n        <NAME_TEXT> /<NAME_TEXT>/ |\n        /<NAME_TEXT>/ <NAME_TEXT> |\n        <NAME_TEXT> /<NAME_TEXT>/ <NAME_TEXT>\n\n    <NAME_TEXT> can include almost anything excluding commas, numbers,\n    special characters (though some test files use numbers for the names).\n    Text between slashes is considered a surname, outside slashes - given\n    name.\n\n    This method splits full name into pieces at slashes, e.g.:\n\n        \"First /Last/\" -> (\"First\", \"Last\", \"\")\n        \"/Last/ First\" -> (\"\", \"Last\", \"First\")\n        \"First /Last/ Jr.\" -> (\"First\", \"Last\", \"Jr.\")\n        \"First Jr.\" -> (\"First Jr.\", \"\", \"\")\n\n    :param str name: Full name string.\n    :return: 2-tuple `(given1, surname, given2)`, `surname` or `given` will\n        be empty strings if they are not present in full string.\n    \"\"\"\n    given1, _, rem = name.partition(\"/\")\n    surname, _, given2 = rem.partition(\"/\")\n    return given1.strip(), surname.strip(), given2.strip()", "entry_point": "split_name", "input": "'abc'", "output": "('abc', '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/andy-z/ged4py/blob/d0e0cceaadf0a84cbf052705e3c27303b12e1757/ged4py/detail/name.py#L7-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033745", "code": "def toint(number):\n    \"\"\"\n    Helper to return rounded int for a float or just the int it self.\n    \"\"\"\n    if isinstance(number, float):\n        number = round(number, 0)\n    return int(number)", "entry_point": "toint", "input": "3", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gtaylor/django-athumb/blob/69261ace0dff81e33156a54440874456a7b38dfb/athumb/pial/helpers.py#L6-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033746", "code": "def get_command_str(args):\n    \"\"\"\n    Get terminal command string from list of command and arguments\n\n    Parameters\n    ----------\n    args : list\n        A command and arguments list (unicode list)\n\n    Returns\n    -------\n    str\n        A string indicate terminal command\n    \"\"\"\n    single_quote = \"'\"\n    double_quote = '\"'\n    for i, value in enumerate(args):\n        if \" \" in value and double_quote not in value:\n            args[i] = '\"%s\"' % value\n        elif \" \" in value and single_quote not in value:\n            args[i] = \"'%s'\" % value\n    return \" \".join(args)", "entry_point": "get_command_str", "input": "['apple', 'banana', 'cherry']", "output": "'apple banana cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdalisue/notify/blob/1b6d7d1faa2cea13bfaa1f35130f279a0115e686/src/notify/executor.py#L53-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033747", "code": "def split_arguments(args):\n    \"\"\"\n    Split specified arguments to two list.\n\n    This is used to distinguish the options of the program and\n    execution command/arguments.\n\n    Parameters\n    ----------\n    args : list\n        Command line arguments\n\n    Returns\n    -------\n    list : options, arguments\n        options indicate the optional arguments for the program and\n        arguments indicate the execution command/arguments\n    \"\"\"\n    prev = False\n    for i, value in enumerate(args[1:]):\n        if value.startswith('-'):\n            prev = True\n        elif prev:\n            prev = False\n        else:\n            return args[:i+1], args[i+1:]\n    return args, []", "entry_point": "split_arguments", "input": "['a', 'b', 'c']", "output": "(['a'], ['b', 'c'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdalisue/notify/blob/1b6d7d1faa2cea13bfaa1f35130f279a0115e686/src/notify/arguments.py#L8-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033748", "code": "def parse_result(line):\n    \"\"\"\n    Parse the result line of a phenomizer request.\n    \n    Arguments:\n        line (str): A raw output line from phenomizer\n    \n    Returns:\n         result (dict): A dictionary with the phenomizer info:\n             {\n                'p_value': float,\n                'gene_symbols': list(str),\n                'disease_nr': int,\n                'disease_source': str,\n                'description': str,\n                'raw_line': str\n             }\n             \n    \"\"\"\n    \n    if line.startswith(\"Problem\"):\n        raise RuntimeError(\"Login credentials seems to be wrong\")\n\n    result = {\n        'p_value': None,\n        'gene_symbols': [],\n        'disease_nr': None,\n        'disease_source': None,\n        'description': None,\n        'raw_line': line\n    }\n    \n    result['raw_line'] = line.rstrip()\n    result_line = line.rstrip().split('\\t')\n    \n    try:\n        result['p_value'] = float(result_line[0])\n    except ValueError:\n        pass\n\n    try:\n        medical_litterature = result_line[2].split(':')\n        result['disease_source'] = medical_litterature[0]\n        result['disease_nr'] = int(medical_litterature[1])\n    except IndexError:\n        pass\n\n    try:\n        description = result_line[3]\n        result['description'] = description\n    except IndexError:\n        pass\n\n    if len(result_line) > 4:\n        for gene_symbol in result_line[4].split(','):\n            result['gene_symbols'].append(gene_symbol.strip())\n\n    return result", "entry_point": "parse_result", "input": "''", "output": "{'p_value': None, 'gene_symbols': [], 'disease_nr': None, 'disease_source': None, 'description': None, 'raw_line': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/query_phenomizer/blob/19883ed125e224fc17cbb71240428fd60082e017/query_phenomizer/utils.py#L21-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033749", "code": "def chunks(items, size):\n    \"\"\" Split list into chunks of the given size.\n    Original order is preserved.\n\n    Example:\n        > chunks([1,2,3,4,5,6,7,8], 3)\n        [[1, 2, 3], [4, 5, 6], [7, 8]]\n    \"\"\"\n    return [items[i:i+size] for i in range(0, len(items), size)]", "entry_point": "chunks", "input": "[], 7", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/common.py#L22-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033750", "code": "def _clip(value, lower, upper):\n    \"\"\"\n    Helper function to clip a given value based on a lower/upper bound.\n    \"\"\"\n    return lower if value < lower else upper if value > upper else value", "entry_point": "_clip", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gitenberg-dev/gitberg/blob/3f6db8b5a22ccdd2110d3199223c30db4e558b5c/gitenberg/util/tenprintcover.py#L284-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033751", "code": "def colorRGB(r, g, b):\n        \"\"\"\n        Given the R,G,B int values for the RGB color mode in the range [0..255],\n        return a RGB color tuple with float values in the range [0..1].\n        \"\"\"\n        return (float(r / 255), float(g / 255), float(b / 255))", "entry_point": "colorRGB", "input": "True, -1.5, True", "output": "(0.00392156862745098, -0.0058823529411764705, 0.00392156862745098)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gitenberg-dev/gitberg/blob/3f6db8b5a22ccdd2110d3199223c30db4e558b5c/gitenberg/util/tenprintcover.py#L263-L268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033752", "code": "def named_field(key, regex, vim=False):\n    \"\"\"\n    Creates a named regex group that can be referend via a backref.\n    If key is None the backref is referenced by number.\n\n    References:\n        https://docs.python.org/2/library/re.html#regular-expression-syntax\n    \"\"\"\n    if key is None:\n        #return regex\n        return r'(%s)' % (regex,)\n    if vim:\n        return r'\\(%s\\)' % (regex)\n    else:\n        return r'(?P<%s>%s)' % (key, regex)", "entry_point": "named_field", "input": "[[1, 2], [3], []], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "\"\\\\(['a', 'b', 'c']\\\\)\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_regex.py#L124-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033753", "code": "def __get_from_imports(import_tuples):\n    \"\"\" Returns import names and fromlist\n    import_tuples are specified as\n    (name, fromlist, ispackage)\n    \"\"\"\n    from_imports = [(tup[0], tup[1]) for tup in import_tuples\n                    if tup[1] is not None and len(tup[1]) > 0]\n    return from_imports", "entry_point": "__get_from_imports", "input": "['apple', 'banana', 'cherry']", "output": "[('a', 'p'), ('b', 'a'), ('c', 'h')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/_internal/util_importer.py#L139-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033754", "code": "def alias_tags(tags_list, alias_map):\n    \"\"\"\n    update tags to new values\n\n    Args:\n        tags_list (list):\n        alias_map (list): list of 2-tuples with regex, value\n\n    Returns:\n        list: updated tags\n\n    CommandLine:\n        python -m utool.util_tags alias_tags --show\n\n    Example:\n        >>> # DISABLE_DOCTEST\n        >>> from utool.util_tags import *  # NOQA\n        >>> import utool as ut\n        >>> tags_list = [['t1', 't2'], [], ['t3'], ['t4', 't5']]\n        >>> ut.build_alias_map()\n        >>> result = alias_tags(tags_list, alias_map)\n        >>> print(result)\n    \"\"\"\n    def _alias_dict(tags):\n        tags_ = [alias_map.get(t, t) for t in tags]\n        return list(set([t for t in tags_ if t is not None]))\n    tags_list_ = [_alias_dict(tags) for tags in tags_list]\n    return tags_list_", "entry_point": "alias_tags", "input": "[[1, 2], [3], []], {}", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_tags.py#L92-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033755", "code": "def ensure_crossplat_path(path, winroot='C:'):\n    r\"\"\"\n    ensure_crossplat_path\n\n    Args:\n        path (str):\n\n    Returns:\n        str: crossplat_path\n\n    Example(DOCTEST):\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_path import *  # NOQA\n        >>> path = r'C:\\somedir'\n        >>> cplat_path = ensure_crossplat_path(path)\n        >>> result = cplat_path\n        >>> print(result)\n        C:/somedir\n    \"\"\"\n    cplat_path = path.replace('\\\\', '/')\n    if cplat_path == winroot:\n        cplat_path += '/'\n    return cplat_path", "entry_point": "ensure_crossplat_path", "input": "'AbC dEf', [5, 3, 1, 4]", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_path.py#L1319-L1341", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033756", "code": "def get_quantmap(features, acc_col, quantfields):\n    \"\"\"Runs through proteins that are in a quanted protein table, extracts\n    and maps their information based on the quantfields list input.\n    Map is a dict with protein_accessions as keys.\"\"\"\n    qmap = {}\n    for feature in features:\n        feat_acc = feature.pop(acc_col)\n        qmap[feat_acc] = {qf: feature[qf] for qf in quantfields}\n    return qmap", "entry_point": "get_quantmap", "input": "set(), [1, 2, 3], 0.5", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/shared/pepprot_isoquant.py#L19-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033757", "code": "def constrain_cfgdict_list(cfgdict_list_, constraint_func):\n    \"\"\" constrains configurations and removes duplicates \"\"\"\n    cfgdict_list = []\n    for cfg_ in cfgdict_list_:\n        cfg = cfg_.copy()\n        if constraint_func(cfg) is not False and len(cfg) > 0:\n            if cfg not in cfgdict_list:\n                cfgdict_list.append(cfg)\n    return cfgdict_list", "entry_point": "constrain_cfgdict_list", "input": "set(), {'x': [1, 2], 'y': []}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_gridsearch.py#L1991-L1999", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033758", "code": "def get_peptide_quant(quantdata, quanttype):\n    \"\"\"Parses lists of quantdata and returns maxvalue from them. Strips NA\"\"\"\n    parsefnx = {'precur': max}\n    quantfloats = []\n    for q in quantdata:\n        try:\n            quantfloats.append(float(q))\n        except(TypeError, ValueError):\n            pass\n    if not quantfloats:\n        return 'NA'\n    return str(parsefnx[quanttype](quantfloats))", "entry_point": "get_peptide_quant", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "'NA'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/peptable/psmtopeptable.py#L50-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033759", "code": "def _cuda_get_gpu_spec_string(gpu_ids=None):\n    \"\"\"\n    Build a GPU id string to be used for CUDA_VISIBLE_DEVICES.\n    \"\"\"\n\n    if gpu_ids is None:\n        return ''\n\n    if isinstance(gpu_ids, list):\n        return ','.join(str(gpu_id) for gpu_id in gpu_ids)\n\n    if isinstance(gpu_ids, int):\n        return str(gpu_ids)\n\n    return gpu_ids", "entry_point": "_cuda_get_gpu_spec_string", "input": "[5, 3, 1, 4]", "output": "'5,3,1,4'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/YuriyGuts/pygoose/blob/4d9b8827c6d6c4b79949d1cd653393498c0bb3c2/pygoose/kg/gpu.py#L4-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033760", "code": "def count_protein_group_hits(lineproteins, groups):\n    \"\"\"Takes a list of protein accessions and a list of protein groups\n    content from DB. Counts for each group in list how many proteins\n    are found in lineproteins. Returns list of str amounts.\n    \"\"\"\n    hits = []\n    for group in groups:\n        hits.append(0)\n        for protein in lineproteins:\n            if protein in group:\n                hits[-1] += 1\n    return [str(x) for x in hits]", "entry_point": "count_protein_group_hits", "input": "'abc', ['apple', 'banana', 'cherry']", "output": "['1', '2', '1']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/mzidtsv/proteingrouping.py#L57-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033761", "code": "def safe_listget(list_, index, default='?'):\n    \"\"\" depricate \"\"\"\n    if index >= len(list_):\n        return default\n    ret = list_[index]\n    if ret is None:\n        return default\n    return ret", "entry_point": "safe_listget", "input": "['a', 'b', 'c'], 0, []", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L246-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033762", "code": "def listclip(list_, num, fromback=False):\n    r\"\"\"\n    DEPRICATE: use slices instead\n\n    Args:\n        list_ (list):\n        num (int):\n\n    Returns:\n        sublist:\n\n    CommandLine:\n        python -m utool.util_list --test-listclip\n\n    Example1:\n        >>> # ENABLE_DOCTEST\n        >>> import utool as ut\n        >>> # build test data\n        >>> list_ = [1, 2, 3, 4, 5]\n        >>> result_list = []\n        >>> # execute function\n        >>> num = 3\n        >>> result_list += [ut.listclip(list_, num)]\n        >>> num = 9\n        >>> result_list += [ut.listclip(list_, num)]\n        >>> # verify results\n        >>> result = ut.repr4(result_list)\n        >>> print(result)\n        [\n            [1, 2, 3],\n            [1, 2, 3, 4, 5],\n        ]\n\n    Example2:\n        >>> # ENABLE_DOCTEST\n        >>> import utool as ut\n        >>> # build test data\n        >>> list_ = [1, 2, 3, 4, 5]\n        >>> result_list = []\n        >>> # execute function\n        >>> num = 3\n        >>> result = ut.listclip(list_, num, fromback=True)\n        >>> print(result)\n        [3, 4, 5]\n    \"\"\"\n    if num is None:\n        num_ = len(list_)\n    else:\n        num_ = min(len(list_), num)\n    if fromback:\n        sublist = list_[-num_:]\n    else:\n        sublist = list_[:num_]\n    return sublist", "entry_point": "listclip", "input": "[1, 2, 3], 3, [[1, 2], [3], []]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L256-L309", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033763", "code": "def multi_replace(instr, search_list=[], repl_list=None):\n    \"\"\"\n    Does a string replace with a list of search and replacements\n\n    TODO: rename\n    \"\"\"\n    repl_list = [''] * len(search_list) if repl_list is None else repl_list\n    for ser, repl in zip(search_list, repl_list):\n        instr = instr.replace(ser, repl)\n    return instr", "entry_point": "multi_replace", "input": "['a', 'b', 'c'], [], [[1, 2], [3], []]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L387-L396", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033764", "code": "def isect(list1, list2):\n    r\"\"\"\n    returns list1 elements that are also in list2. preserves order of list1\n\n    intersect_ordered\n\n    Args:\n        list1 (list):\n        list2 (list):\n\n    Returns:\n        list: new_list\n\n    Example:\n        >>> # DISABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> list1 = ['featweight_rowid', 'feature_rowid', 'config_rowid', 'featweight_forground_weight']\n        >>> list2 = [u'featweight_rowid']\n        >>> result = intersect_ordered(list1, list2)\n        >>> print(result)\n        ['featweight_rowid']\n\n    Timeit:\n        def timeit_func(func, *args):\n            niter = 10\n            times = []\n            for count in range(niter):\n                with ut.Timer(verbose=False) as t:\n                    _ = func(*args)\n                times.append(t.ellapsed)\n            return sum(times) / niter\n\n        grid = {\n            'size1': [1000, 5000, 10000, 50000],\n            'size2': [1000, 5000, 10000, 50000],\n            #'overlap': [0, 1],\n        }\n        data = []\n        for kw in ut.all_dict_combinations(grid):\n            pool = np.arange(kw['size1'] * 2)\n            size2 = size1 = kw['size1']\n            size2 = kw['size2']\n            list1 = (np.random.rand(size1) * size1).astype(np.int32).tolist()\n            list1 = ut.random_sample(pool, size1).tolist()\n            list2 = ut.random_sample(pool, size2).tolist()\n            list1 = set(list1)\n            list2 = set(list2)\n            kw['ut'] = timeit_func(ut.isect, list1, list2)\n            #kw['np1'] = timeit_func(np.intersect1d, list1, list2)\n            #kw['py1'] = timeit_func(lambda a, b: set.intersection(set(a), set(b)), list1, list2)\n            kw['py2'] = timeit_func(lambda a, b: sorted(set.intersection(set(a), set(b))), list1, list2)\n            data.append(kw)\n\n        import pandas as pd\n        pd.options.display.max_rows = 1000\n        pd.options.display.width = 1000\n        df = pd.DataFrame.from_dict(data)\n        data_keys = list(grid.keys())\n        other_keys = ut.setdiff(df.columns, data_keys)\n        df = df.reindex_axis(data_keys + other_keys, axis=1)\n        df['abs_change'] = df['ut'] - df['py2']\n        df['pct_change'] = df['abs_change'] / df['ut'] * 100\n        #print(df.sort('abs_change', ascending=False))\n\n        print(str(df).split('\\n')[0])\n        for row in df.values:\n            argmin = row[len(data_keys):len(data_keys) + len(other_keys)].argmin() + len(data_keys)\n            print('    ' + ', '.join([\n            '%6d' % (r) if x < len(data_keys) else (\n                ut.color_text('%8.6f' % (r,), 'blue')\n                    if x == argmin else '%8.6f' % (r,))\n            for x, r in enumerate(row)\n            ]))\n\n        %timeit ut.isect(list1, list2)\n        %timeit np.intersect1d(list1, list2, assume_unique=True)\n        %timeit set.intersection(set(list1), set(list2))\n\n        #def highlight_max(s):\n        #    '''\n        #    highlight the maximum in a Series yellow.\n        #    '''\n        #    is_max = s == s.max()\n        #    return ['background-color: yellow' if v else '' for v in is_max]\n        #df.style.apply(highlight_max)\n    \"\"\"\n    set2 = set(list2)\n    return [item for item in list1 if item in set2]", "entry_point": "isect", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1001-L1088", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033765", "code": "def is_subset_of_any(set_, other_sets):\n    \"\"\"\n    returns True if set_ is a subset of any set in other_sets\n\n    Args:\n        set_ (set):\n        other_sets (list of sets):\n\n    Returns:\n        bool: flag\n\n    CommandLine:\n        python -m utool.util_list --test-is_subset_of_any\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> # build test data\n        >>> set_ = {1, 2}\n        >>> other_sets = [{1, 4}, {3, 2, 1}]\n        >>> # execute function\n        >>> result = is_subset_of_any(set_, other_sets)\n        >>> # verify results\n        >>> print(result)\n        True\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> # build test data\n        >>> set_ = {1, 2}\n        >>> other_sets = [{1, 4}, {3, 2}]\n        >>> # execute function\n        >>> result = is_subset_of_any(set_, other_sets)\n        >>> # verify results\n        >>> print(result)\n        False\n    \"\"\"\n    set_ = set(set_)\n    other_sets = map(set, other_sets)\n    return any([set_.issubset(other_set) for other_set in other_sets])", "entry_point": "is_subset_of_any", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1157-L1197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033766", "code": "def setdiff(list1, list2):\n    \"\"\"\n    returns list1 elements that are not in list2. preserves order of list1\n\n    Args:\n        list1 (list):\n        list2 (list):\n\n    Returns:\n        list: new_list\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> import utool as ut\n        >>> list1 = ['featweight_rowid', 'feature_rowid', 'config_rowid', 'featweight_forground_weight']\n        >>> list2 = [u'featweight_rowid']\n        >>> new_list = setdiff_ordered(list1, list2)\n        >>> result = ut.repr4(new_list, nl=False)\n        >>> print(result)\n        ['feature_rowid', 'config_rowid', 'featweight_forground_weight']\n    \"\"\"\n    set2 = set(list2)\n    return [item for item in list1 if item not in set2]", "entry_point": "setdiff", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1407-L1430", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033767", "code": "def sortedby(item_list, key_list, reverse=False):\n    \"\"\" sorts ``item_list`` using key_list\n\n    Args:\n        list_ (list): list to sort\n        key_list (list): list to sort by\n        reverse (bool): sort order is descending (largest first)\n                        if reverse is True else acscending (smallest first)\n\n    Returns:\n        list : ``list_`` sorted by the values of another ``list``. defaults to\n        ascending order\n\n    SeeAlso:\n        sortedby2\n\n    Examples:\n        >>> # ENABLE_DOCTEST\n        >>> import utool\n        >>> list_    = [1, 2, 3, 4, 5]\n        >>> key_list = [2, 5, 3, 1, 5]\n        >>> result = utool.sortedby(list_, key_list, reverse=True)\n        >>> print(result)\n        [5, 2, 3, 1, 4]\n\n    \"\"\"\n    assert len(item_list) == len(key_list), (\n        'Expected same len. Got: %r != %r' % (len(item_list), len(key_list)))\n    sorted_list = [item for (key, item) in\n                   sorted(list(zip(key_list, item_list)), reverse=reverse)]\n    return sorted_list", "entry_point": "sortedby", "input": "[1, 2, 3], ['a', 'b', 'c'], False", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1477-L1507", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033768", "code": "def take(list_, index_list):\n    \"\"\"\n    Selects a subset of a list based on a list of indices.\n    This is similar to np.take, but pure python.\n\n    Args:\n        list_ (list): some indexable object\n        index_list (list, slice, int): some indexing object\n\n    Returns:\n        list or scalar: subset of the list\n\n    CommandLine:\n        python -m utool.util_list --test-take\n\n    SeeAlso:\n        ut.dict_take\n        ut.dict_subset\n        ut.none_take\n        ut.compress\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> list_ = [0, 1, 2, 3]\n        >>> index_list = [2, 0]\n        >>> result = take(list_, index_list)\n        >>> print(result)\n        [2, 0]\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> list_ = [0, 1, 2, 3]\n        >>> index = 2\n        >>> result = take(list_, index)\n        >>> print(result)\n        2\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> list_ = [0, 1, 2, 3]\n        >>> index = slice(1, None, 2)\n        >>> result = take(list_, index)\n        >>> print(result)\n        [1, 3]\n    \"\"\"\n    try:\n        return [list_[index] for index in index_list]\n    except TypeError:\n        return list_[index_list]", "entry_point": "take", "input": "[[1, 2], [3], []], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1772-L1823", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033769", "code": "def take_percentile(arr, percent):\n    \"\"\" take the top `percent` items in a list rounding up \"\"\"\n    size = len(arr)\n    stop = min(int(size * percent), len(arr))\n    return arr[0:stop]", "entry_point": "take_percentile", "input": "'abc', 0.5", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1834-L1838", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033770", "code": "def list_inverse_take(list_, index_list):\n    r\"\"\"\n    Args:\n        list_ (list): list in sorted domain\n        index_list (list): index list of the unsorted domain\n\n    Note:\n        Seems to be logically equivalent to\n        ut.take(list_, ut.argsort(index_list)), but faster\n\n    Returns:\n        list: output_list_ - the input list in the unsorted domain\n\n    CommandLine:\n        python -m utool.util_list --test-list_inverse_take\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> import utool as ut\n        >>> # build test data\n        >>> rank_list = [3, 2, 4, 1, 9, 2]\n        >>> prop_list = [0, 1, 2, 3, 4, 5]\n        >>> index_list = ut.argsort(rank_list)\n        >>> sorted_prop_list = ut.take(prop_list, index_list)\n        >>> # execute function\n        >>> list_ = sorted_prop_list\n        >>> output_list_  = list_inverse_take(list_, index_list)\n        >>> output_list2_ = ut.take(list_, ut.argsort(index_list))\n        >>> assert output_list_ == prop_list\n        >>> assert output_list2_ == prop_list\n        >>> # verify results\n        >>> result = str(output_list_)\n        >>> print(result)\n\n    Timeit::\n        %timeit list_inverse_take(list_, index_list)\n        %timeit ut.take(list_, ut.argsort(index_list))\n    \"\"\"\n    output_list_ = [None] * len(index_list)\n    for item, index in zip(list_, index_list):\n        output_list_[index] = item\n    return output_list_", "entry_point": "list_inverse_take", "input": "[], ['apple', 'banana', 'cherry']", "output": "[None, None, None]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L1934-L1976", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033771", "code": "def group_consecutives(data, stepsize=1):\n    \"\"\"\n    Return list of consecutive lists of numbers from data (number list).\n\n    References:\n        http://stackoverflow.com/questions/7352684/how-to-find-the-groups-of-consecutive-elements-from-an-array-in-numpy\n    \"\"\"\n    run = []\n    result = [run]\n    expect = None\n    for item in data:\n        if (item == expect) or (expect is None):\n            run.append(item)\n        else:\n            run = [item]\n            result.append(run)\n        expect = item + stepsize\n    return result", "entry_point": "group_consecutives", "input": "[5, 3, 1, 4], 5", "output": "[[5], [3], [1], [4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L2266-L2283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033772", "code": "def list_cover(list1, list2):\n    r\"\"\"\n    returns boolean for each position in list1 if it is in list2\n\n    Args:\n        list1 (list):\n        list2 (list):\n\n    Returns:\n        list: incover_list - true where list1 intersects list2\n\n    CommandLine:\n        python -m utool.util_list --test-list_cover\n\n    Example:\n        >>> # DISABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> # build test data\n        >>> list1 = [1, 2, 3, 4, 5, 6]\n        >>> list2 = [2, 3, 6]\n        >>> # execute function\n        >>> incover_list = list_cover(list1, list2)\n        >>> # verify results\n        >>> result = str(incover_list)\n        >>> print(result)\n        [False, True, True, False, False, True]\n    \"\"\"\n    set2 = set(list2)\n    incover_list = [item1 in set2 for item1 in list1]\n    return incover_list", "entry_point": "list_cover", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "[False, False, False]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L2846-L2875", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033773", "code": "def delete_items_by_index(list_, index_list, copy=False):\n    \"\"\"\n    Remove items from ``list_`` at positions specified in ``index_list``\n    The original ``list_`` is preserved if ``copy`` is True\n\n    Args:\n        list_ (list):\n        index_list (list):\n        copy (bool): preserves original list if True\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_list import *  # NOQA\n        >>> list_ = [8, 1, 8, 1, 6, 6, 3, 4, 4, 5, 6]\n        >>> index_list = [2, -1]\n        >>> result = delete_items_by_index(list_, index_list)\n        >>> print(result)\n        [8, 1, 1, 6, 6, 3, 4, 4, 5]\n    \"\"\"\n    if copy:\n        list_ = list_[:]\n    # Rectify negative indicies\n    index_list_ = [(len(list_) + x if x < 0 else x) for x in index_list]\n    # Remove largest indicies first\n    index_list_ = sorted(index_list_, reverse=True)\n    for index in index_list_:\n        del list_[index]\n    return list_", "entry_point": "delete_items_by_index", "input": "[-1, 0, 1, 2], [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "[-1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_list.py#L3128-L3155", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033774", "code": "def trypsinize(proseq, proline_cut=False):\n    # TODO add cysteine to non cut options, use enums\n    \"\"\"Trypsinize a protein sequence. Returns a list of peptides.\n    Peptides include both cut and non-cut when P is behind a tryptic\n    residue. Multiple consequent tryptic residues are treated as follows:\n    PEPKKKTIDE - [PEPK, PEPKK, PEPKKK, KKTIDE, KTIDE, TIDE, K, K, KK ]\n    \"\"\"\n    outpeps = []\n    currentpeps = ['']\n    trypres = set(['K', 'R'])\n    noncutters = set()\n    if not proline_cut:\n        noncutters.add('P')\n    for i, aa in enumerate(proseq):\n        currentpeps = ['{0}{1}'.format(x, aa) for x in currentpeps]\n        if i == len(proseq) - 1:\n            continue\n        if aa in trypres and proseq[i + 1] not in noncutters:\n            outpeps.extend(currentpeps)  # do actual cut by storing peptides\n            if proseq[i + 1] in trypres.union('P'):\n                # add new peptide to list if we are also to run on\n                currentpeps.append('')\n            elif trypres.issuperset(currentpeps[-1]):\n                currentpeps = [x for x in currentpeps if trypres.issuperset(x)]\n                currentpeps.append('')\n            else:\n                currentpeps = ['']\n\n    if currentpeps != ['']:\n        outpeps.extend(currentpeps)\n    return outpeps", "entry_point": "trypsinize", "input": "['apple', 'banana', 'cherry'], 'AbC dEf'", "output": "['applebananacherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/mslookup/searchspace.py#L46-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033775", "code": "def sort_amounts(proteins, sort_index):\n    \"\"\"Generic function for sorting peptides and psms. Assumes a higher\n    number is better for what is passed at sort_index position in protein.\"\"\"\n    amounts = {}\n    for protein in proteins:\n        amount_x_for_protein = protein[sort_index]\n        try:\n            amounts[amount_x_for_protein].append(protein)\n        except KeyError:\n            amounts[amount_x_for_protein] = [protein]\n    return [v for k, v in sorted(amounts.items(), reverse=True)]", "entry_point": "sort_amounts", "input": "[], 0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/mzidtsv/proteingroup_sorters.py#L51-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033776", "code": "def find_group_consistencies(groups1, groups2):\n    r\"\"\"\n    Returns a measure of group consistency\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_alg import *  # NOQA\n        >>> groups1 = [[1, 2, 3], [4], [5, 6]]\n        >>> groups2 = [[1, 2], [4], [5, 6]]\n        >>> common_groups = find_group_consistencies(groups1, groups2)\n        >>> result = ('common_groups = %r' % (common_groups,))\n        >>> print(result)\n        common_groups = [(5, 6), (4,)]\n    \"\"\"\n    group1_list = {tuple(sorted(_group)) for _group in groups1}\n    group2_list = {tuple(sorted(_group)) for _group in groups2}\n    common_groups = list(group1_list.intersection(group2_list))\n    return common_groups", "entry_point": "find_group_consistencies", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "[('a', 'e', 'l', 'p', 'p'), ('a', 'a', 'a', 'b', 'n', 'n'), ('c', 'e', 'h', 'r', 'r', 'y')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_alg.py#L123-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033777", "code": "def upper_diag_self_prodx(list_):\n    \"\"\"\n    upper diagnoal of cartesian product of self and self.\n    Weird name. fixme\n\n    Args:\n        list_ (list):\n\n    Returns:\n        list:\n\n    CommandLine:\n        python -m utool.util_alg --exec-upper_diag_self_prodx\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_alg import *  # NOQA\n        >>> list_ = [1, 2, 3]\n        >>> result = upper_diag_self_prodx(list_)\n        >>> print(result)\n        [(1, 2), (1, 3), (2, 3)]\n    \"\"\"\n    return [(item1, item2)\n            for n1, item1 in enumerate(list_)\n            for n2, item2 in enumerate(list_) if n1 < n2]", "entry_point": "upper_diag_self_prodx", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_alg.py#L487-L511", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033778", "code": "def item_hist(list_):\n    \"\"\" counts the number of times each item appears in the dictionary \"\"\"\n    dict_hist = {}\n    # Insert each item into the correct group\n    for item in list_:\n        if item not in dict_hist:\n            dict_hist[item] = 0\n        dict_hist[item] += 1\n    return dict_hist", "entry_point": "item_hist", "input": "[-1, 0, 1, 2]", "output": "{-1: 1, 0: 1, 1: 1, 2: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_alg.py#L901-L909", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033779", "code": "def fibonacci_iterative(n):\n    \"\"\"\n    Args:\n        n (int):\n\n    Returns:\n        int: the n-th fibonacci number\n\n    References:\n        http://stackoverflow.com/questions/15047116/iterative-alg-fib\n\n    CommandLine:\n        python -m utool.util_alg fibonacci_iterative\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_alg import *  # NOQA\n        >>> import utool as ut\n        >>> with ut.Timer('fib iter'):\n        >>>     series = [fibonacci_iterative(n) for n in range(20)]\n        >>> result = ('series = %s' % (str(series[0:10]),))\n        >>> print(result)\n        series = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n    \"\"\"\n    a, b = 0, 1\n    for _ in range(0, n):\n        a, b = b, a + b\n    return a", "entry_point": "fibonacci_iterative", "input": "2", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_alg.py#L985-L1012", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033780", "code": "def knapsack_greedy(items, maxweight):\n    r\"\"\"\n    non-optimal greedy version of knapsack algorithm\n    does not sort input. Sort the input by largest value\n    first if desired.\n\n    Args:\n        `items` (tuple): is a sequence of tuples `(value, weight, id_)`, where `value`\n            is a scalar and `weight` is a non-negative integer, and `id_` is an\n            item identifier.\n\n        `maxweight` (scalar):  is a non-negative integer.\n\n    CommandLine:\n        python -m utool.util_alg --exec-knapsack_greedy\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_alg import *  # NOQA\n        >>> items = [(4, 12, 0), (2, 1, 1), (6, 4, 2), (1, 1, 3), (2, 2, 4)]\n        >>> maxweight = 15\n        >>> total_value, items_subset = knapsack_greedy(items, maxweight)\n        >>> result =  'total_value = %r\\n' % (total_value,)\n        >>> result += 'items_subset = %r' % (items_subset,)\n        >>> print(result)\n        total_value = 7\n        items_subset = [(4, 12, 0), (2, 1, 1), (1, 1, 3)]\n    \"\"\"\n    items_subset = []\n    total_weight = 0\n    total_value = 0\n    for item in items:\n        value, weight = item[0:2]\n        if total_weight + weight > maxweight:\n            continue\n        else:\n            items_subset.append(item)\n            total_weight += weight\n            total_value += value\n    return total_value, items_subset", "entry_point": "knapsack_greedy", "input": "[], ['a', 'b', 'c']", "output": "(0, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_alg.py#L1548-L1587", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033781", "code": "def longest_common_substring(s1, s2):\n    \"\"\"\n    References:\n        # https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring#Python2\n    \"\"\"\n    m = [[0] * (1 + len(s2)) for i in range(1 + len(s1))]\n    longest, x_longest = 0, 0\n    for x in range(1, 1 + len(s1)):\n        for y in range(1, 1 + len(s2)):\n            if s1[x - 1] == s2[y - 1]:\n                m[x][y] = m[x - 1][y - 1] + 1\n                if m[x][y] > longest:\n                    longest = m[x][y]\n                    x_longest = x\n            else:\n                m[x][y] = 0\n    return s1[x_longest - longest: x_longest]", "entry_point": "longest_common_substring", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_alg.py#L2731-L2747", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033782", "code": "def dzip(list1, list2):\n    r\"\"\"\n    Zips elementwise pairs between list1 and list2 into a dictionary. Values\n    from list2 can be broadcast onto list1.\n\n    Args:\n        list1 (sequence): full sequence\n        list2 (sequence): can either be a sequence of one item or a sequence of\n            equal length to `list1`\n\n    SeeAlso:\n        util_list.broadcast_zip\n\n    Returns:\n        dict: similar to dict(zip(list1, list2))\n\n    CommandLine:\n        python -m utool.util_dict dzip\n\n    Example:\n        >>> # DISABLE_DOCTEST\n        >>> from utool.util_dict import *  # NOQA\n        >>> import utool as ut\n        >>> assert dzip([1, 2, 3], [4]) == {1: 4, 2: 4, 3: 4}\n        >>> assert dzip([1, 2, 3], [4, 4, 4]) == {1: 4, 2: 4, 3: 4}\n        >>> ut.assert_raises(ValueError, dzip, [1, 2, 3], [])\n        >>> ut.assert_raises(ValueError, dzip, [], [4, 5, 6])\n        >>> ut.assert_raises(ValueError, dzip, [], [4])\n        >>> ut.assert_raises(ValueError, dzip, [1, 2], [4, 5, 6])\n        >>> ut.assert_raises(ValueError, dzip, [1, 2, 3], [4, 5])\n    \"\"\"\n    try:\n        len(list1)\n    except TypeError:\n        list1 = list(list1)\n    try:\n        len(list2)\n    except TypeError:\n        list2 = list(list2)\n    if len(list1) == 0 and len(list2) == 1:\n        # Corner case:\n        # allow the first list to be empty and the second list to broadcast a\n        # value. This means that the equality check wont work for the case\n        # where list1 and list2 are supposed to correspond, but the length of\n        # list2 is 1.\n        list2 = []\n    if len(list2) == 1 and len(list1) > 1:\n        list2 = list2 * len(list1)\n    if len(list1) != len(list2):\n        raise ValueError('out of alignment len(list1)=%r, len(list2)=%r' % (\n            len(list1), len(list2)))\n    return dict(zip(list1, list2))", "entry_point": "dzip", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "{5: -1, 3: 0, 1: 1, 4: 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_dict.py#L25-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033783", "code": "def delete_dict_keys(dict_, key_list):\n    r\"\"\"\n    Removes items from a dictionary inplace. Keys that do not exist are\n    ignored.\n\n    Args:\n        dict_ (dict): dict like object with a __del__ attribute\n        key_list (list): list of keys that specify the items to remove\n\n    CommandLine:\n        python -m utool.util_dict --test-delete_dict_keys\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_dict import *  # NOQA\n        >>> import utool as ut\n        >>> dict_ = {'bread': 1, 'churches': 1, 'cider': 2, 'very small rocks': 2}\n        >>> key_list = ['duck', 'bread', 'cider']\n        >>> delete_dict_keys(dict_, key_list)\n        >>> result = ut.repr4(dict_, nl=False)\n        >>> print(result)\n        {'churches': 1, 'very small rocks': 2}\n\n    \"\"\"\n    invalid_keys = set(key_list) - set(dict_.keys())\n    valid_keys = set(key_list) - invalid_keys\n    for key in valid_keys:\n        del dict_[key]\n    return dict_", "entry_point": "delete_dict_keys", "input": "{'x': [1, 2], 'y': []}, [1, 2, 3]", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_dict.py#L891-L919", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033784", "code": "def remove_chars(str_, char_list):\n    \"\"\"\n    removes all chars in char_list from str_\n\n    Args:\n        str_ (str):\n        char_list (list):\n\n    Returns:\n        str: outstr\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_str import *  # NOQA\n        >>> str_ = '1, 2, 3, 4'\n        >>> char_list = [',']\n        >>> result = remove_chars(str_, char_list)\n        >>> print(result)\n        1 2 3 4\n    \"\"\"\n    outstr = str_[:]\n    for char in char_list:\n        outstr = outstr.replace(char, '')\n    return outstr", "entry_point": "remove_chars", "input": "'a,b,c', 'Hello World'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_str.py#L195-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033785", "code": "def list_str_summarized(list_, list_name, maxlen=5):\n    \"\"\"\n    prints the list members when the list is small and the length when it is\n    large\n    \"\"\"\n    if len(list_) > maxlen:\n        return 'len(%s)=%d' % (list_name, len(list_))\n    else:\n        return '%s=%r' % (list_name, list_)", "entry_point": "list_str_summarized", "input": "set(), {}, -3", "output": "'len({})=0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_str.py#L1251-L1259", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033786", "code": "def pluralize(wordtext, num=2, plural_suffix='s'):\n    r\"\"\"\n    Heuristically changes a word to its plural form if `num` is not 1\n\n    Args:\n        wordtext (str): word in singular form\n        num (int): a length of an associated list if applicable (default = 2)\n        plural_suffix (str): heurstic plural form (default = 's')\n\n    Returns:\n        str: pluralized form. Can handle some genitive cases\n\n    CommandLine:\n        python -m utool.util_str pluralize\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_str import *  # NOQA\n        >>> wordtext = 'foo'\n        >>> result = pluralize(wordtext)\n        >>> print(result)\n        foos\n    \"\"\"\n    if num == 1:\n        return wordtext\n    else:\n        if wordtext.endswith('\\'s'):\n            return wordtext[:-2] + 's\\''\n        else:\n            return wordtext + plural_suffix\n    return (wordtext + plural_suffix) if num != 1 else wordtext", "entry_point": "pluralize", "input": "'', 7, 'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_str.py#L2251-L2281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033787", "code": "def number_text_lines(text):\n    r\"\"\"\n    Args:\n        text (str):\n\n    Returns:\n        str: text_with_lineno - string with numbered lines\n    \"\"\"\n    numbered_linelist = [\n        ''.join((('%2d' % (count + 1)), ' >>> ', line))\n        for count, line in enumerate(text.splitlines())\n    ]\n    text_with_lineno = '\\n'.join(numbered_linelist)\n    return text_with_lineno", "entry_point": "number_text_lines", "input": "'Hello World'", "output": "' 1 >>> Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_str.py#L2327-L2340", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033788", "code": "def conj_phrase(list_, cond='or'):\n    \"\"\"\n    Joins a list of words using English conjunction rules\n\n    Args:\n        list_ (list):  of strings\n        cond (str): a conjunction (or, and, but)\n\n    Returns:\n        str: the joined cconjunction phrase\n\n    References:\n        http://en.wikipedia.org/wiki/Conjunction_(grammar)\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_str import *  # NOQA\n        >>> list_ = ['a', 'b', 'c']\n        >>> result = conj_phrase(list_, 'or')\n        >>> print(result)\n        a, b, or c\n\n    Example1:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_str import *  # NOQA\n        >>> list_ = ['a', 'b']\n        >>> result = conj_phrase(list_, 'and')\n        >>> print(result)\n        a and b\n    \"\"\"\n    if len(list_) == 0:\n        return ''\n    elif len(list_) == 1:\n        return list_[0]\n    elif len(list_) == 2:\n        return ' '.join((list_[0], cond, list_[1]))\n    else:\n        condstr = ''.join((', ' + cond, ' '))\n        return ', '.join((', '.join(list_[:-2]), condstr.join(list_[-2:])))", "entry_point": "conj_phrase", "input": "[], ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_str.py#L2439-L2477", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033789", "code": "def to_title_caps(underscore_case):\n    r\"\"\"\n    Args:\n        underscore_case (?):\n\n    Returns:\n        str: title_str\n\n    CommandLine:\n        python -m utool.util_str --exec-to_title_caps\n\n    Example:\n        >>> # DISABLE_DOCTEST\n        >>> from utool.util_str import *  # NOQA\n        >>> underscore_case = 'the_foo_bar_func'\n        >>> title_str = to_title_caps(underscore_case)\n        >>> result = ('title_str = %s' % (str(title_str),))\n        >>> print(result)\n        title_str = The Foo Bar Func\n    \"\"\"\n    words = underscore_case.split('_')\n    words2 = [\n        word[0].upper() + word[1:]\n        for count, word in enumerate(words)\n    ]\n    title_str = ' '.join(words2)\n    return title_str", "entry_point": "to_title_caps", "input": "'walnut thistle harbour'", "output": "'Walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_str.py#L2603-L2629", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033790", "code": "def get_quant_NAs(quantdata, quantheader):\n    \"\"\"Takes quantdata in a dict and header with quantkeys\n    (eg iTRAQ isotopes). Returns dict of quant intensities\n    with missing keys set to NA.\"\"\"\n    out = {}\n    for qkey in quantheader:\n        out[qkey] = quantdata.get(qkey, 'NA')\n    return out", "entry_point": "get_quant_NAs", "input": "5, ''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/mzidtsv/quant.py#L63-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033791", "code": "def get_protein_group_content(pgmap, master):\n    \"\"\"For each master protein, we generate the protein group proteins\n    complete with sequences, psm_ids and scores. Master proteins are included\n    in this group.\n\n    Returns a list of [protein, master, pep_hits, psm_hits, protein_score],\n    which is ready to enter the DB table.\n    \"\"\"\n    # first item (0) is only a placeholder so the lookup.INDEX things get the\n    # correct number. Would be nice with a solution, but the INDEXes were\n    # originally made for mzidtsv protein group adding.\n    pg_content = [[0, master, protein, len(peptides), len([psm for pgpsms in\n                                                           peptides.values()\n                                                           for psm in pgpsms]),\n                   sum([psm[1] for pgpsms in peptides.values()\n                        for psm in pgpsms]),  # score\n                   next(iter(next(iter(peptides.values()))))[3],  # coverage\n                   next(iter(next(iter(peptides.values()))))[2],  # evid level\n                   ]\n                  for protein, peptides in pgmap.items()]\n    return pg_content", "entry_point": "get_protein_group_content", "input": "{}, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/actions/mslookup/proteingrouping.py#L180-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033792", "code": "def possible_import_patterns(modname):\n    \"\"\"\n    does not support from x import *\n    does not support from x import z, y\n\n    Example:\n        >>> # DISABLE_DOCTEST\n        >>> import utool as ut\n        >>> modname = 'package.submod.submod2.module'\n        >>> result = ut.repr3(ut.possible_import_patterns(modname))\n        >>> print(result)\n        [\n            'import\\\\spackage.submod.submod2.module',\n            'from\\\\spackage\\\\.submod\\\\.submod2\\\\simportmodule',\n        ]\n    \"\"\"\n    # common regexes\n    WS = r'\\s'\n    import_ = 'import'\n    from_ = 'from'\n    dot_ = r'\\.'\n    patterns = [import_ + WS + modname]\n    if '.' in modname:\n        parts = modname.split('.')\n        modpart = dot_.join(parts[0:-1])\n        imppart = parts[-1]\n        patterns += [from_ + WS + modpart + WS + import_ + imppart]\n    NONSTANDARD = False\n    if NONSTANDARD:\n        if '.' in modname:\n            for i in range(1, len(parts) - 1):\n                modpart = '.'.join(parts[i:-1])\n                imppart = parts[-1]\n                patterns += [from_ + WS + modpart + WS + import_ + imppart]\n            imppart = parts[-1]\n            patterns += [import_ + WS + imppart]\n    return patterns", "entry_point": "possible_import_patterns", "input": "'  padded  '", "output": "['import\\\\s  padded  ']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_import.py#L154-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033793", "code": "def clean_dropbox_link(dropbox_url):\n    \"\"\"\n    Dropbox links should be en-mass downloaed from dl.dropbox\n\n    DEPRICATE?\n\n    Example:\n        >>> # ENABLE_DOCTEST\n        >>> from utool.util_grabdata import *  # NOQA\n        >>> dropbox_url = 'www.dropbox.com/s/123456789abcdef/foobar.zip?dl=0'\n        >>> cleaned_url = clean_dropbox_link(dropbox_url)\n        >>> result = str(cleaned_url)\n        >>> print(result)\n        dl.dropbox.com/s/123456789abcdef/foobar.zip\n    \"\"\"\n    cleaned_url = dropbox_url.replace('www.dropbox', 'dl.dropbox')\n    postfix_list = [\n        '?dl=0'\n    ]\n    for postfix in postfix_list:\n        if cleaned_url.endswith(postfix):\n            cleaned_url = cleaned_url[:-1 * len(postfix)]\n    # cleaned_url = cleaned_url.rstrip('?dl=0')\n    return cleaned_url", "entry_point": "clean_dropbox_link", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/utool/blob/3b27e1f4e6e6fb23cd8744af7b7195b57d99e03a/utool/util_grabdata.py#L503-L526", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033794", "code": "def get_uniprot_evidence_level(header):\n    \"\"\"Returns uniprot protein existence evidence level for a fasta header.\n    Evidence levels are 1-5, but we return 5 - x since sorting still demands\n    that higher is better.\"\"\"\n    header = header.split()\n    for item in header:\n        item = item.split('=')\n        try:\n            if item[0] == 'PE':\n                return 5 - int(item[1])\n        except IndexError:\n            continue\n    return -1", "entry_point": "get_uniprot_evidence_level", "input": "'AbC dEf'", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/glormph/msstitch/blob/ded7e5cbd813d7797dc9d42805778266e59ff042/src/app/readers/fasta.py#L119-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033795", "code": "def format_gmeta(data, acl=None, identifier=None):\n    \"\"\"Format input into GMeta format, suitable for ingesting into Globus Search.\n    Formats a dictionary into a GMetaEntry.\n    Formats a list of GMetaEntry into a GMetaList inside a GMetaIngest.\n\n    **Example usage**::\n\n        glist = []\n        for document in all_my_documents:\n            gmeta_entry = format_gmeta(document, [\"public\"], document[\"id\"])\n            glist.append(gmeta_entry)\n        ingest_ready_document = format_gmeta(glist)\n\n    Arguments:\n        data (dict or list): The data to be formatted.\n                If data is a dict, arguments ``acl`` and ``identifier`` are required.\n                If data is a list, it must consist of GMetaEntry documents.\n        acl (list of str): The list of Globus UUIDs allowed to view the document,\n                or the special value ``[\"public\"]`` to allow anyone access.\n                Required if data is a dict. Ignored if data is a list.\n                Will be formatted into URNs if required.\n        identifier (str): A unique identifier for this document. If this value is not unique,\n                ingests into Globus Search may merge entries.\n                Required is data is a dict. Ignored if data is a list.\n\n    Returns:\n        dict (if ``data`` is ``dict``): The data as a GMetaEntry.\n        dict (if ``data`` is ``list``): The data as a GMetaIngest.\n    \"\"\"\n    if isinstance(data, dict):\n        if acl is None or identifier is None:\n            raise ValueError(\"acl and identifier are required when formatting a GMetaEntry.\")\n        if isinstance(acl, str):\n            acl = [acl]\n        # \"Correctly\" format ACL entries into URNs\n        prefixed_acl = []\n        for uuid in acl:\n            # If entry is not special value \"public\" and is not a URN, make URN\n            # It is not known what the type of UUID is, so use both\n            # This solution is known to be hacky\n            if uuid != \"public\" and not uuid.lower().startswith(\"urn:\"):\n                prefixed_acl.append(\"urn:globus:auth:identity:\"+uuid.lower())\n                prefixed_acl.append(\"urn:globus:groups:id:\"+uuid.lower())\n            # Otherwise, no modification\n            else:\n                prefixed_acl.append(uuid)\n\n        return {\n            \"@datatype\": \"GMetaEntry\",\n            \"@version\": \"2016-11-09\",\n            \"subject\": identifier,\n            \"visible_to\": prefixed_acl,\n            \"content\": data\n            }\n\n    elif isinstance(data, list):\n        return {\n            \"@datatype\": \"GIngest\",\n            \"@version\": \"2016-11-09\",\n            \"ingest_type\": \"GMetaList\",\n            \"ingest_data\": {\n                \"@datatype\": \"GMetaList\",\n                \"@version\": \"2016-11-09\",\n                \"gmeta\": data\n                }\n            }\n\n    else:\n        raise TypeError(\"Cannot format '\" + str(type(data)) + \"' into GMeta.\")", "entry_point": "format_gmeta", "input": "[], [5, 3, 1, 4], []", "output": "{'@datatype': 'GIngest', '@version': '2016-11-09', 'ingest_type': 'GMetaList', 'ingest_data': {'@datatype': 'GMetaList', '@version': '2016-11-09', 'gmeta': []}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materials-data-facility/toolbox/blob/2a4ac2b6a892238263008efa6a5f3923d9a83505/mdf_toolbox/toolbox.py#L471-L539", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033796", "code": "def _clean_query_string(q):\n    \"\"\"Clean up a query string for searching.\n\n    Removes unmatched parentheses and joining operators.\n\n    Arguments:\n        q (str): Query string to be cleaned\n\n    Returns:\n        str: The clean query string.\n    \"\"\"\n    q = q.replace(\"()\", \"\").strip()\n    if q.endswith(\"(\"):\n        q = q[:-1].strip()\n    # Remove misplaced AND/OR/NOT at end\n    if q[-3:] == \"AND\" or q[-3:] == \"NOT\":\n        q = q[:-3]\n    elif q[-2:] == \"OR\":\n        q = q[:-2]\n\n    # Balance parentheses\n    while q.count(\"(\") > q.count(\")\"):\n        q += \")\"\n    while q.count(\")\") > q.count(\"(\"):\n        q = \"(\" + q\n\n    return q.strip()", "entry_point": "_clean_query_string", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materials-data-facility/toolbox/blob/2a4ac2b6a892238263008efa6a5f3923d9a83505/mdf_toolbox/search_helper.py#L40-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033797", "code": "def circ_permutation(items):\n    \"\"\"Calculate the circular permutation for a given list of items.\"\"\"\n    permutations = []\n    for i in range(len(items)):\n        permutations.append(items[i:] + items[:i])\n    return permutations", "entry_point": "circ_permutation", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tamasgal/km3pipe/blob/7a9b59ac899a28775b5bdc5d391d9a5340d08040/km3pipe/math.py#L224-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033798", "code": "def get_index_nested(x, i):\r\n    \"\"\"\r\n    Description:\r\n        Returns the first index of the array (vector) x containing the value i.\r\n    Parameters:\r\n        x: one-dimensional array\r\n        i: search value\r\n    \"\"\"\r\n    for ind in range(len(x)):\r\n        if i == x[ind]:\r\n            return ind\r\n    return -1", "entry_point": "get_index_nested", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PrefPy/prefpy/blob/f395ba3782f05684fa5de0cece387a6da9391d02/prefpy/util.py#L6-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033799", "code": "def humanize_timedelta(seconds):\n    \"\"\"Creates a string representation of timedelta.\"\"\"\n    hours, remainder = divmod(seconds, 3600)\n    days, hours = divmod(hours, 24)\n    minutes, seconds = divmod(remainder, 60)\n\n    if days:\n        result = '{}d'.format(days)\n        if hours:\n            result += ' {}h'.format(hours)\n        if minutes:\n            result += ' {}m'.format(minutes)\n        return result\n\n    if hours:\n        result = '{}h'.format(hours)\n        if minutes:\n            result += ' {}m'.format(minutes)\n        return result\n\n    if minutes:\n        result = '{}m'.format(minutes)\n        if seconds:\n            result += ' {}s'.format(seconds)\n        return result\n\n    return '{}s'.format(seconds)", "entry_point": "humanize_timedelta", "input": "-1.5", "output": "'-1.0d 23.0h 59.0m'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/polyaxon/hestia/blob/382ed139cff8bf35c987cfc30a31b72c0d6b808e/hestia/humanize.py#L46-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033800", "code": "def get_next_token(string):\n    '''\n    \"eats\" up the string until it hits an ending character to get valid leaf expressions.\n    For example, given \\\\Phi_{z}(L) = \\\\sum_{i=1}^{N} \\\\frac{1}{C_{i} \\\\times V_{\\\\rm max, i}},\n    this function would pull out \\\\Phi, stopping at _\n    @ string: str\n    returns a tuple of (expression [ex: \\\\Phi], remaining_chars [ex: _{z}(L) = \\\\sum_{i=1}^{N}...])\n    '''\n    STOP_CHARS = \"_ {}^ \\n ,()=\"\n    UNARY_CHARS = \"^_\"\n    # ^ and _ are valid leaf expressions--just ones that should be handled on their own\n    if string[0] in STOP_CHARS:\n        return string[0], string[1:]\n    \n    expression = []\n    for i, c in enumerate(string):\n        if c in STOP_CHARS:\n            break\n        else:\n            expression.append(c)\n    \n    return \"\".join(expression), string[i:]", "entry_point": "get_next_token", "input": "'AbC dEf'", "output": "('AbC', ' dEf')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/samghelms/mathviz/blob/30fe89537379faea4de8c8b568ac6e52e4d15353/examples/utils.py#L14-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033801", "code": "def _permutation_correctness(pathway_feature_tuples, original):\n    \"\"\"Determine whether the generated permutation is a valid permutation.\n    Used in `permute_pathways_across_features`.\n    (Cannot be identical to the original significant pathways list,\n    and a feature should map to a distinct set of pathways.)\n    \"\"\"\n    if pathway_feature_tuples:\n        if set(pathway_feature_tuples) == set(original):\n            return False\n        pathways_in_feature = {}\n        for (pathway, feature) in pathway_feature_tuples:\n            if feature not in pathways_in_feature:\n                pathways_in_feature[feature] = set()\n            if pathway in pathways_in_feature[feature]:\n                return False\n            else:\n                pathways_in_feature[feature].add(pathway)\n    return True", "entry_point": "_permutation_correctness", "input": "'', ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/greenelab/PathCORE-T/blob/9d079d5ebffea2fe9fb9ab557588d51ad67d2c9c/pathcore/network.py#L655-L672", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033802", "code": "def _determine_case(was_upper, words, string):\n    \"\"\"\n    Determine case type of string.\n\n    Arguments:\n        was_upper {[type]} -- [description]\n        words {[type]} -- [description]\n        string {[type]} -- [description]\n\n    Returns:\n        - upper: All words are upper-case.\n        - lower: All words are lower-case.\n        - pascal: All words are title-case or upper-case. Note that the\n                  stringiable may still have separators.\n        - camel: First word is lower-case, the rest are title-case or\n                 upper-case. stringiable may still have separators.\n        - mixed: Any other mixing of word casing. Never occurs if there are\n                 no separators.\n        - unknown: stringiable contains no words.\n\n    \"\"\"\n    case_type = 'unknown'\n    if was_upper:\n        case_type = 'upper'\n    elif string.islower():\n        case_type = 'lower'\n    elif len(words) > 0:\n        camel_case = words[0].islower()\n        pascal_case = words[0].istitle() or words[0].isupper()\n\n        if camel_case or pascal_case:\n            for word in words[1:]:\n                c = word.istitle() or word.isupper()\n                camel_case &= c\n                pascal_case &= c\n                if not c:\n                    break\n\n        if camel_case:\n            case_type = 'camel'\n        elif pascal_case:\n            case_type = 'pascal'\n        else:\n            case_type = 'mixed'\n\n    return case_type", "entry_point": "_determine_case", "input": "[], [], 'abc'", "output": "'lower'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AlejandroFrias/case-conversion/blob/79ebce1403fbdac949b2da21b8f6fbe3234ddb31/case_conversion/case_parse.py#L15-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033803", "code": "def _normalize_words(words, acronyms):\n    \"\"\"Normalize case of each word to PascalCase.\"\"\"\n    for i, _ in enumerate(words):\n        # if detect_acronyms:\n        if words[i].upper() in acronyms:\n            # Convert known acronyms to upper-case.\n            words[i] = words[i].upper()\n        else:\n            # Fallback behavior: Preserve case on upper-case words.\n            if not words[i].isupper():\n                words[i] = words[i].capitalize()\n    return words", "entry_point": "_normalize_words", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "['A', 'B', 'C']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AlejandroFrias/case-conversion/blob/79ebce1403fbdac949b2da21b8f6fbe3234ddb31/case_conversion/case_parse.py#L167-L178", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033804", "code": "def is_paired(text, open='(', close=')'):\n    \"\"\"Check if the text only contains:\n    1. blackslash escaped parentheses, or\n    2. parentheses paired.\n    \"\"\"\n    count = 0\n    escape = False\n    for c in text:\n        if escape:\n            escape = False\n        elif c == '\\\\':\n            escape = True\n        elif c == open:\n            count += 1\n        elif c == close:\n            if count == 0:\n                return False\n            count -= 1\n    return count == 0", "entry_point": "is_paired", "input": "'AbC dEf', [-1, 0, 1, 2], ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/frostming/marko/blob/1cd030b665fa37bad1f8b3a25a89ce1a7c491dde/marko/helpers.py#L16-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033805", "code": "def join(path1, path2):\n    '''\n    nicely join two path elements together\n    '''\n    if path1.endswith('/') and path2.startswith('/'):\n        return ''.join([path1, path2[1:]])\n    elif path1.endswith('/') or path2.startswith('/'):\n        return ''.join([path1, path2])\n    else:\n        return ''.join([path1, '/', path2])", "entry_point": "join", "input": "'  padded  ', 'walnut thistle harbour'", "output": "'  padded  /walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jasonrbriggs/proton/blob/e734734750797ef0caaa1680379e07b86d7a53e3/python/proton/utils.py#L24-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033806", "code": "def to_unit_memory(number):\n    \"\"\"Creates a string representation of memory size given `number`.\"\"\"\n    kb = 1024\n\n    number /= kb\n\n    if number < 100:\n        return '{} Kb'.format(round(number, 2))\n\n    number /= kb\n    if number < 300:\n        return '{} Mb'.format(round(number, 2))\n\n    number /= kb\n\n    return '{} Gb'.format(round(number, 2))", "entry_point": "to_unit_memory", "input": "5", "output": "'0.0 Kb'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/polyaxon/hestia/blob/382ed139cff8bf35c987cfc30a31b72c0d6b808e/hestia/units.py#L5-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033807", "code": "def strip_consecutive_repeated_char(s, ch):\n    \"\"\"Strip characters in a string which are consecutively repeated.\n\n    Useful when in notes or some other free text fields on Mambu, users\n    capture anything and a lot of capture errors not always detected by\n    Mambu get through. You want some cleaning? this may be useful.\n\n    This is a string processing function.\n    \"\"\"\n    sdest = \"\"\n    for i,c in enumerate(s):\n        if i != 0 and s[i] == ch and s[i] == s[i-1]:\n            continue\n        sdest += s[i]\n    return sdest", "entry_point": "strip_consecutive_repeated_char", "input": "[], [5, 3, 1, 4]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jstitch/MambuPy/blob/2af98cc12e7ed5ec183b3e97644e880e70b79ee8/MambuPy/mambuutil.py#L747-L761", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033808", "code": "def human(value):\n    \"If val>=1000 return val/1024+KiB, etc.\"\n    if value >= 1073741824000:\n        return '{:.1f} T'.format(value / 1099511627776.0)\n    if value >= 1048576000:\n        return '{:.1f} G'.format(value / 1073741824.0)\n    if value >= 1024000:\n        return '{:.1f} M'.format(value / 1048576.0)\n    if value >= 1000:\n        return '{:.1f} K'.format(value / 1024.0)\n    return '{}   B'.format(value)", "entry_point": "human", "input": "-1.5", "output": "'-1.5   B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ossobv/dutree/blob/adceeeb17f9fd70a7ed9c674850d7015d820eb2a/dutree/dutree.py#L456-L466", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033809", "code": "def replace_content(content, project_vars):\n    \"\"\"\n    Replaces variables inside the content.\n    \"\"\"\n\n    for k, v in project_vars.items():\n        content = content.replace(f'__{k}__', v)\n\n    return content", "entry_point": "replace_content", "input": "'abc', {}", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BernardFW/bernard/blob/9c55703e5ffe5717c9fa39793df59dbfa5b4c5ab/src/bernard/misc/start_project/_base.py#L131-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033810", "code": "def pluralize_dj(value, arg='s'):\n    \"\"\"\n    Adapted from django.template.defaultfilters:\n    https://github.com/django/django/blob/master/django/template/defaultfilters.py\n\n    Returns a plural suffix if the value is not 1. By default, 's' is used as\n    the suffix:\n\n    * If value is 0, vote{{ value|pluralize }} displays \"0 votes\".\n    * If value is 1, vote{{ value|pluralize }} displays \"1 vote\".\n    * If value is 2, vote{{ value|pluralize }} displays \"2 votes\".\n\n    If an argument is provided, that string is used instead:\n\n    * If value is 0, class{{ value|pluralize:\"es\" }} displays \"0 classes\".\n    * If value is 1, class{{ value|pluralize:\"es\" }} displays \"1 class\".\n    * If value is 2, class{{ value|pluralize:\"es\" }} displays \"2 classes\".\n\n    If the provided argument contains a comma, the text before the comma is\n    used for the singular case and the text after the comma is used for the\n    plural case:\n\n    * If value is 0, cand{{ value|pluralize:\"y,ies\" }} displays \"0 candies\".\n    * If value is 1, cand{{ value|pluralize:\"y,ies\" }} displays \"1 candy\".\n    * If value is 2, cand{{ value|pluralize:\"y,ies\" }} displays \"2 candies\".\n    \"\"\"\n    if ',' not in arg:\n        arg = ',' + arg\n    bits = arg.split(',')\n    if len(bits) > 2:\n        return ''\n    singular_suffix, plural_suffix = bits[:2]\n\n    try:\n        if int(value) != 1:\n            return plural_suffix\n    except ValueError:  # Invalid string that's not a number.\n        pass\n    except TypeError:  # Value isn't a string or a number; maybe it's a list?\n        try:\n            if len(value) != 1:\n                return plural_suffix\n        except TypeError:  # len() of unsized object.\n            pass\n    return singular_suffix", "entry_point": "pluralize_dj", "input": "('a', 'b', 'c'), 'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/audreyr/jinja2_pluralize/blob/e94770417ff65c71461980ec26c5a1b4e4212ca5/jinja2_pluralize/__init__.py#L18-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033811", "code": "def strip_spaces(s):\n    \"\"\" Strip excess spaces from a string \"\"\"\n    return u\" \".join([c for c in s.split(u' ') if c])", "entry_point": "strip_spaces", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/romankoblov/leaf/blob/e042d91ec462c834318d03f199fcc4a9f565cb84/leaf/__init__.py#L162-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033812", "code": "def strip_linebreaks(s):\n    \"\"\" Strip excess line breaks from a string \"\"\"\n    return u\"\\n\".join([c for c in s.split(u'\\n') if c])", "entry_point": "strip_linebreaks", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/romankoblov/leaf/blob/e042d91ec462c834318d03f199fcc4a9f565cb84/leaf/__init__.py#L167-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033813", "code": "def is_chinese(name):\n    \"\"\"\n    Check if a symbol is a Chinese character.\n\n    Note\n    ----\n\n    Taken from http://stackoverflow.com/questions/16441633/python-2-7-test-if-characters-in-a-string-are-all-chinese-characters\n    \"\"\"\n    if not name:\n        return False\n    for ch in name:\n        ordch = ord(ch)\n        if not (0x3400 <= ordch <= 0x9fff) and not (0x20000 <= ordch <= 0x2ceaf) \\\n                and not (0xf900 <= ordch <= ordch) and not (0x2f800 <= ordch <= 0x2fa1f): \n                return False\n    return True", "entry_point": "is_chinese", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lingpy/sinopy/blob/59a47fcdfae3e0000ac6d2b3d7919bf875ec2056/src/sinopy/sinopy.py#L10-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033814", "code": "def parse_baxter(reading):\n    \"\"\"\n    Parse a Baxter string and render it with all its contents, namely\n    initial, medial, final, and tone.\n    \"\"\"\n\n    initial = ''\n    medial = ''\n    final = ''\n    tone = ''\n    \n    # determine environments\n    inienv = True\n    medienv = False\n    finenv = False\n    tonenv = False\n\n    inichars = \"pbmrtdnkgnsyhzl'x\"\n    \n\n    chars = list(reading)\n    for char in chars:\n        \n        # switch environments\n        if char in 'jw' and not finenv:\n            inienv,medienv,finenv,tonenv = False,True,False,False\n        elif char not in inichars or finenv:\n            if char in 'XH':\n                inienv,medienv,finenv,tonenv = False,False,False,True\n            else:\n                inienv,medienv,finenv,tonenv = False,False,True,False\n        \n        # fill in slots\n        if inienv:\n            initial += char\n            \n        if medienv:\n            medial += char\n\n        if finenv:\n            final += char\n\n        if tonenv:\n            tone += char\n\n    # post-parse tone\n    if not tone and final[-1] in 'ptk':\n        tone = 'R'\n    elif not tone:\n        tone = 'P'\n\n    # post-parse medial\n    if 'j' not in medial and 'y' in initial:\n        medial += 'j'\n\n    # post-parse labial\n    if final[0] in 'u' and 'w' not in medial:\n        medial = 'w' + medial\n\n    return initial,medial,final,tone", "entry_point": "parse_baxter", "input": "['apple', 'banana', 'cherry']", "output": "('', '', 'applebananacherry', 'P')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lingpy/sinopy/blob/59a47fcdfae3e0000ac6d2b3d7919bf875ec2056/src/sinopy/sinopy.py#L69-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033815", "code": "def _tabulate(rows, headers, spacing=5):\n    \"\"\"Prepare simple table with spacing based on content\"\"\"\n    if len(rows) == 0:\n        return \"None\\n\"\n    assert len(rows[0]) == len(headers)\n    count = len(rows[0])\n    widths = [0 for _ in range(count)]\n    rows = [headers] + rows\n\n    for row in rows:\n        for index, field in enumerate(row):\n            if len(str(field)) > widths[index]:\n                widths[index] = len(str(field))\n\n    output = \"\"\n    for row in rows:\n        for index, field in enumerate(row):\n            field = str(field)\n            output += field + (widths[index] - len(field) + spacing) * \" \"\n        output += \"\\n\"\n    return output", "entry_point": "_tabulate", "input": "[], [5, 3, 1, 4], ['a', 'b', 'c']", "output": "'None\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/plugin.py#L786-L806", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033816", "code": "def prepare_node(data):\n    \"\"\"Prepare node for catalog endpoint\n\n    Parameters:\n        data (Union[str, dict]): Node ID or node definition\n    Returns:\n        Tuple[str, dict]: where first is ID and second is node definition\n\n    Extract from /v1/health/service/<service>::\n\n        {\n            \"Node\": {\n                \"Node\": \"foobar\",\n                \"Address\": \"10.1.10.12\",\n                \"TaggedAddresses\": {\n                    \"lan\": \"10.1.10.12\",\n                    \"wan\": \"10.1.10.12\"\n                }\n            },\n            \"Service\": {...},\n            \"Checks\": [...]\n        }\n    \"\"\"\n    if not data:\n        return None, {}\n\n    if isinstance(data, str):\n        return data, {}\n\n    # from /v1/health/service/<service>\n    if all(field in data for field in (\"Node\", \"Service\", \"Checks\")):\n        return data[\"Node\"][\"Node\"], data[\"Node\"]\n\n    result = {}\n    if \"ID\" in data:\n        result[\"Node\"] = data[\"ID\"]\n    for k in (\"Datacenter\", \"Node\", \"Address\",\n              \"TaggedAddresses\", \"Service\",\n              \"Check\", \"Checks\"):\n        if k in data:\n            result[k] = data[k]\n    if list(result) == [\"Node\"]:\n        return result[\"Node\"], {}\n    return result.get(\"Node\"), result", "entry_point": "prepare_node", "input": "[1, 2, 3]", "output": "(None, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/util.py#L3-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033817", "code": "def prepare_service(data):\n    \"\"\"Prepare service for catalog endpoint\n\n    Parameters:\n        data (Union[str, dict]): Service ID or service definition\n    Returns:\n        Tuple[str, dict]: str is ID and dict is service\n\n    Transform ``/v1/health/state/<state>``::\n\n        {\n            \"Node\": \"foobar\",\n            \"CheckID\": \"service:redis\",\n            \"Name\": \"Service 'redis' check\",\n            \"Status\": \"passing\",\n            \"Notes\": \"\",\n            \"Output\": \"\",\n            \"ServiceID\": \"redis1\",\n            \"ServiceName\": \"redis\"\n        }\n\n    to::\n\n        {\n            \"ID\": \"redis1\",\n            \"Service\": \"redis\"\n        }\n\n    Extract from /v1/health/service/<service>::\n\n        {\n            \"Node\": {...},\n            \"Service\": {\n                \"ID\": \"redis1\",\n                \"Service\": \"redis\",\n                \"Tags\": None,\n                \"Address\": \"10.1.10.12\",\n                \"Port\": 8000\n            },\n            \"Checks\": [...]\n        }\n\n    \"\"\"\n    if not data:\n        return None, {}\n\n    if isinstance(data, str):\n        return data, {}\n\n    # from /v1/health/service/<service>\n    if all(field in data for field in (\"Node\", \"Service\", \"Checks\")):\n        return data[\"Service\"][\"ID\"], data[\"Service\"]\n\n    # from /v1/health/checks/<service>\n    # from /v1/health/node/<node>\n    # from /v1/health/state/<state>\n    # from /v1/catalog/service/<service>\n    if all(field in data for field in (\"ServiceName\", \"ServiceID\")):\n        return data[\"ServiceID\"], {\n            \"ID\": data[\"ServiceID\"],\n            \"Service\": data[\"ServiceName\"],\n            \"Tags\": data.get(\"ServiceTags\"),\n            \"Address\": data.get(\"ServiceAddress\"),\n            \"Port\": data.get(\"ServicePort\"),\n        }\n\n    if list(data) == [\"ID\"]:\n        return data[\"ID\"], {}\n\n    result = {}\n    if \"Name\" in data:\n        result[\"Service\"] = data[\"Name\"]\n\n    for k in (\"Service\", \"ID\", \"Tags\", \"Address\", \"Port\"):\n        if k in data:\n            result[k] = data[k]\n    return result.get(\"ID\"), result", "entry_point": "prepare_service", "input": "[5, 3, 1, 4]", "output": "(None, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/util.py#L49-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033818", "code": "def prepare_check(data):\n    \"\"\"Prepare check for catalog endpoint\n\n    Parameters:\n        data (Object or ObjectID): Check ID or check definition\n    Returns:\n        Tuple[str, dict]: where first is ID and second is check definition\n    \"\"\"\n    if not data:\n        return None, {}\n\n    if isinstance(data, str):\n        return data, {}\n\n    result = {}\n    if \"ID\" in data:\n        result[\"CheckID\"] = data[\"ID\"]\n    for k in (\"Node\", \"CheckID\", \"Name\", \"Notes\", \"Status\", \"ServiceID\"):\n        if k in data:\n            result[k] = data[k]\n    if list(result) == [\"CheckID\"]:\n        return result[\"CheckID\"], {}\n    return result.get(\"CheckID\"), result", "entry_point": "prepare_check", "input": "[5, 3, 1, 4]", "output": "(None, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/util.py#L128-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033819", "code": "def _escape(value):\n        \"\"\"Escape a string (key or value) for InfluxDB's line protocol.\n\n        :param str|int|float|bool value: The value to be escaped\n        :rtype: str\n\n        \"\"\"\n        value = str(value)\n        for char, escaped in {' ': '\\ ', ',': '\\,', '\"': '\\\"'}.items():\n            value = value.replace(char, escaped)\n        return value", "entry_point": "_escape", "input": "[-1, 0, 1, 2]", "output": "'[-1\\\\,\\\\ 0\\\\,\\\\ 1\\\\,\\\\ 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sprockets/sprockets-influxdb/blob/cce73481b8f26b02e65e3f9914a9a22eceff3063/sprockets_influxdb.py#L917-L927", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033820", "code": "def match_strings(str1, str2):\n    \"\"\"\n    Returns the largest index i such that str1[:i] == str2[:i]\n    \n    \"\"\"\n    i = 0\n    min_len = len(str1) if len(str1) < len(str2) else len(str2)\n    while i < min_len and str1[i] == str2[i]: i += 1\n    return i", "entry_point": "match_strings", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/asts/utils.py#L14-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033821", "code": "def extract_docstring_summary(docstring):\n    \"\"\"Get the first summary sentence from a docstring.\n\n    Parameters\n    ----------\n    docstring : `list` of `str`\n        Output from `get_docstring`.\n\n    Returns\n    -------\n    summary : `str`\n        The plain-text summary sentence from the docstring.\n    \"\"\"\n    summary_lines = []\n    for line in docstring:\n        if line == '':\n            break\n        else:\n            summary_lines.append(line)\n    return ' '.join(summary_lines)", "entry_point": "extract_docstring_summary", "input": "'walnut thistle harbour'", "output": "'w a l n u t   t h i s t l e   h a r b o u r'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/taskutils.py#L196-L215", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033822", "code": "def to_bool(s, fallback=None):\n    \"\"\"\n    :param str s: str to be converted to bool, e.g. \"1\", \"0\", \"true\", \"false\"\n    :param T fallback: if s is not recognized as a bool\n    :return: boolean value, or fallback\n    :rtype: bool|T\n    \"\"\"\n    if not s:\n        return fallback\n    s = s.lower()\n    if s in [\"1\", \"true\", \"yes\", \"y\"]:\n        return True\n    if s in [\"0\", \"false\", \"no\", \"n\"]:\n        return False\n    return fallback", "entry_point": "to_bool", "input": "'AbC dEf', -1.5", "output": "-1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/albertz/py_better_exchook/blob/3d524a027d7fc4e83e47e39a1978849561da69b3/better_exchook.py#L513-L527", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033823", "code": "def properties(lines):\n    \"\"\"Parse properties block\n\n    Returns:\n        dict: {property_type: (atom_index, value)}\n    \"\"\"\n    results = {}\n    for i, line in enumerate(lines):\n        type_ = line[3:6]\n        if type_ not in [\"CHG\", \"RAD\", \"ISO\"]:\n            continue  # Other properties are not supported yet\n        count = int(line[6:9])\n        results[type_] = []\n        for j in range(count):\n            idx = int(line[10 + j * 8: 13 + j * 8])\n            val = int(line[14 + j * 8: 17 + j * 8])\n            results[type_].append((idx, val))\n    return results", "entry_point": "properties", "input": "'a,b,c'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/v2000reader.py#L127-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033824", "code": "def _replace_and_pad(fmt, marker, replacement):\n    \"\"\"\n    Args:\n        fmt (str | unicode): Format to tweak\n        marker (str | unicode): Marker to replace\n        replacement (str | unicode): What to replace marker with\n\n    Returns:\n        (str): Resulting format, with marker replaced\n    \"\"\"\n    if marker not in fmt:\n        return fmt\n    if replacement:\n        return fmt.replace(marker, replacement)\n    # Remove mention of 'marker' in 'fmt', including leading space (if present)\n    fmt = fmt.replace(\"%s \" % marker, marker)\n    return fmt.replace(marker, \"\")", "entry_point": "_replace_and_pad", "input": "[1, 2, 3], [5, 3, 1, 4], ['a', 'b', 'c']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/logsetup.py#L494-L510", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033825", "code": "def header(text, border=\"--\"):\n    \"\"\"\n    Args:\n        text (str | unicode): Text to turn into a header\n        border (str | unicode): Characters to use to decorate header\n\n    Returns:\n        (str): Decorated\n    \"\"\"\n    if not text or not border:\n        return text\n\n    if border.endswith(\" \"):\n        decorated = \"%s%s\" % (border, text)\n        fmt = \"{decorated}\\n{hr}\"\n\n    else:\n        decorated = \"%s %s %s\" % (border, text, border)\n        fmt = \"{hr}\\n{decorated}\\n{hr}\"\n\n    return fmt.format(decorated=decorated, hr=border[0] * len(decorated))", "entry_point": "header", "input": "'', [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/represent.py#L1-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033826", "code": "def date_censor_sql(date_column, today, column=None):\n    \"\"\"\n    if today is None, then no censoring\n    otherwise replace each column with:\n        CASE WHEN {date_column} < '{today}' THEN {column} ELSE null END\n    \"\"\"\n    if column is None:\n        column = date_column\n\n    if today is None:\n        return column\n    else:\n        return \"(CASE WHEN {date_column} < '{today}' THEN {column} ELSE null END)\".format(\n                date_column=date_column, today=today, column=column)", "entry_point": "date_censor_sql", "input": "[-1, 0, 1, 2], [1, 2, 3], []", "output": "\"(CASE WHEN [-1, 0, 1, 2] < '[1, 2, 3]' THEN [] ELSE null END)\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/potash/drain/blob/ddd62081cb9317beb5d21f86c8b4bb196ca3d222/drain/data.py#L457-L470", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033827", "code": "def date_censor(df, date_columns, date):\n    \"\"\"\n    a dictionary of date_column: [dependent_column1, ...] pairs\n    censor the dependent columns when the date column is before the given end_date\n    then censor the date column itself\n    \"\"\"\n    for date_column, censor_columns in date_columns.items():\n        for censor_column in censor_columns:\n            df[censor_column] = df[censor_column].where(df[date_column] < date)\n\n        df[date_column] = df[date_column].where(df[date_column] < date)\n\n    return df", "entry_point": "date_censor", "input": "True, {}, [5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/potash/drain/blob/ddd62081cb9317beb5d21f86c8b4bb196ca3d222/drain/data.py#L600-L612", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033828", "code": "def mult_inv(a, b):\n    \"\"\"\n    Calculate the multiplicative inverse a**-1 % b.\n\n    This function works for n >= 5 where n is prime.\n    \"\"\"\n    # in addition to the normal setup, we also remember b\n    last_b, x, last_x, y, last_y = b, 0, 1, 1, 0\n    while b != 0:\n        q = a // b\n        a, b = b, a % b\n        x, last_x = last_x - q * x, x\n        y, last_y = last_y - q * y, y\n    # and add b to x if x is negative\n    if last_x < 0:\n        return last_x + last_b\n    return last_x", "entry_point": "mult_inv", "input": "[1, 2, 3], False", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sfstpala/pcr/blob/313ec17585565a0b9740f7b3f47d7a93bf37a7fc/pcr/maths.py#L100-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033829", "code": "def quoted(text):\n    \"\"\"\n    Args:\n        text (str | unicode | None): Text to optionally quote\n\n    Returns:\n        (str): Quoted if 'text' contains spaces\n    \"\"\"\n    if text and \" \" in text:\n        sep = \"'\" if '\"' in text else '\"'\n        return \"%s%s%s\" % (sep, text, sep)\n    return text", "entry_point": "quoted", "input": "'walnut thistle harbour'", "output": "'\"walnut thistle harbour\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/convert.py#L82-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033830", "code": "def shortened(text, size=120):\n    \"\"\"\n    Args:\n        text (str | unicode): Text to shorten\n        size (int): Max chars\n\n    Returns:\n        (str): Leading part of 'text' with at most 'size' chars\n    \"\"\"\n    if text:\n        text = text.strip()\n        if len(text) > size:\n            return \"%s...\" % text[:size - 3].strip()\n    return text", "entry_point": "shortened", "input": "'Hello World', 3", "output": "'...'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/convert.py#L135-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033831", "code": "def indent(s, n_spaces=2, initial=True):\n    \"\"\"\n    Indent all new lines\n    Args:\n        n_spaces: number of spaces to use for indentation\n        initial: whether or not to start with an indent\n    \"\"\"\n    i = ' '*n_spaces\n    t = s.replace('\\n', '\\n%s' % i)\n    if initial:\n        t = i + t\n    return t", "entry_point": "indent", "input": "'', 1, {'x': [1, 2], 'y': []}", "output": "' '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/potash/drain/blob/ddd62081cb9317beb5d21f86c8b4bb196ca3d222/drain/util.py#L502-L513", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033832", "code": "def add_uppercase(table):\n    \"\"\"\n    Extend the table with uppercase options\n\n    >>> print(\"\u0430\" in add_uppercase({\"\u0430\": \"a\"}))\n    True\n    >>> print(add_uppercase({\"\u0430\": \"a\"})[\"\u0430\"] == \"a\")\n    True\n    >>> print(\"\u0410\" in add_uppercase({\"\u0430\": \"a\"}))\n    True\n    >>> print(add_uppercase({\"\u0430\": \"a\"})[\"\u0410\"] == \"A\")\n    True\n    >>> print(len(add_uppercase({\"\u0430\": \"a\"}).keys()))\n    2\n    >>> print(\"\u0410\u0430\" in add_uppercase({\"\u0430\u0430\": \"aa\"}))\n    True\n    >>> print(add_uppercase({\"\u0430\u0430\": \"aa\"})[\"\u0410\u0430\"] == \"Aa\")\n    True\n    \"\"\"\n    orig = table.copy()\n    orig.update(\n        dict((k.capitalize(), v.capitalize()) for k, v in table.items()))\n\n    return orig", "entry_point": "add_uppercase", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dchaplinsky/translit-ua/blob/14e634492c7ce937d77436772fa32d2de5707a9b/translitua/translit.py#L12-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033833", "code": "def convert_table(table):\n    \"\"\"\n    >>> print(1072 in convert_table({\"\u0430\": \"a\"}))\n    True\n    >>> print(1073 in convert_table({\"\u0430\": \"a\"}))\n    False\n    >>> print(convert_table({\"\u0430\": \"a\"})[1072] == \"a\")\n    True\n    >>> print(len(convert_table({\"\u0430\": \"a\"}).keys()) == 1)\n    True\n    \"\"\"\n\n    return dict((ord(k), v) for k, v in table.items())", "entry_point": "convert_table", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dchaplinsky/translit-ua/blob/14e634492c7ce937d77436772fa32d2de5707a9b/translitua/translit.py#L38-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033834", "code": "def capped(value, minimum=None, maximum=None):\n    \"\"\"\n    Args:\n        value: Value to cap\n        minimum: If specified, value should not be lower than this minimum\n        maximum: If specified, value should not be higher than this maximum\n\n    Returns:\n        `value` capped to `minimum` and `maximum` (if it is outside of those bounds)\n    \"\"\"\n    if minimum is not None and value < minimum:\n        return minimum\n\n    if maximum is not None and value > maximum:\n        return maximum\n\n    return value", "entry_point": "capped", "input": "[], ['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/config.py#L319-L335", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033835", "code": "def build_paragraph(content, hard_breaks=False):\n  \"\"\"\n  Returns *content* wrapped in `<p>` tags.\n\n  If *hard_breaks* is `True`, all line breaks are converted to `<br />` tags.\n\n  \"\"\"\n  lines = list(filter(None, [line.strip() for line in content.split('\\n')]))\n  if hard_breaks:\n    for line_number in range(len(lines) - 1):\n      lines[line_number] = \"{}<br />\".format(lines[line_number])\n  return \"<p>{}</p>\".format('\\n'.join(lines))", "entry_point": "build_paragraph", "input": "'', -1.5", "output": "'<p></p>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutus/wdiffhtml/blob/e97b524a7945f7a626e33ec141343120c524d9fa/wdiffhtml/utils.py#L82-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033836", "code": "def formatted_dc_dict(dc_dict):\n    \"\"\"Change the formatting of the DC data dictionary.\n\n    Change the passed in DC data dictionary into a dictionary\n    with a list of values for each element.\n    i.e. {'publisher': ['someone', 'someone else'], 'title': ['a title'],}\n    \"\"\"\n    for key, element_list in dc_dict.items():\n        new_element_list = []\n        # Add the content for each element to the new element list.\n        for element in element_list:\n            new_element_list.append(element['content'])\n        dc_dict[key] = new_element_list\n    return dc_dict", "entry_point": "formatted_dc_dict", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/unt-libraries/pyuntl/blob/f92413302897dab948aac18ee9e482ace0187bd4/pyuntl/untldoc.py#L457-L470", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033837", "code": "def highwirepy2dict(highwire_elements):\n    \"\"\"Convert a list of highwire elements into a dictionary.\n\n    The dictionary returned contains the elements in the\n    UNTL dict format.\n    \"\"\"\n    highwire_dict = {}\n    # Make a list of content dictionaries for each element name.\n    for element in highwire_elements:\n        if element.name not in highwire_dict:\n            highwire_dict[element.name] = []\n        highwire_dict[element.name].append({'content': element.content})\n    return highwire_dict", "entry_point": "highwirepy2dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/unt-libraries/pyuntl/blob/f92413302897dab948aac18ee9e482ace0187bd4/pyuntl/untldoc.py#L510-L522", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033838", "code": "def _bit_mismatch(int1: int, int2: int) -> int:\n    \"\"\"Returns the index of the first different bit or -1 if the values are the same.\"\"\"\n    for i in range(max(int1.bit_length(), int2.bit_length())):\n        if (int1 >> i) & 1 != (int2 >> i) & 1:\n            return i\n    return -1", "entry_point": "_bit_mismatch", "input": "0, 10", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeldamods/evfl/blob/208b39ab817de5bbef419cdae4606255695e83ac/evfl/dic.py#L5-L10", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033839", "code": "def is_tomodir(subdirectories):\n    \"\"\"provided with the subdirectories of a given directory, check if this is\n    a tomodir\n    \"\"\"\n    required = (\n        'exe',\n        'config',\n        'rho',\n        'mod',\n        'inv'\n    )\n    is_tomodir = True\n    for subdir in required:\n        if subdir not in subdirectories:\n            is_tomodir = False\n    return is_tomodir", "entry_point": "is_tomodir", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/geophysics-ubonn/crtomo_tools/blob/27c3e21a557f8df1c12455b96c4c2e00e08a5b4a/src/td_run_all_local.py#L54-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033840", "code": "def get_ranks(values):\n    '''\n    Converts raw values into ranks for rank correlation coefficients\n    :param values: list of values (int/float)\n    :return: a dict mapping value -> rank\n    '''\n    ranks = {}\n    sorted_values = sorted(values)\n    for i in range(len(sorted_values)):\n        value = sorted_values[i]\n        if value not in ranks:\n            ranks[value] = i + 1\n    return ranks", "entry_point": "get_ranks", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': 1, 'banana': 2, 'cherry': 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/unmerged/rpache/functions_lib.py#L237-L249", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033841", "code": "def gamma(ranks_list1,ranks_list2):\n    '''\n    Goodman and Kruskal's gamma correlation coefficient\n    :param ranks_list1: a list of ranks (integers)\n    :param ranks_list2: a second list of ranks (integers) of equal length with corresponding entries\n    :return: Gamma correlation coefficient (rank correlation ignoring ties)\n    '''\n    num_concordant_pairs = 0\n    num_discordant_pairs = 0\n    num_tied_x = 0\n    num_tied_y = 0\n    num_tied_xy = 0\n    num_items = len(ranks_list1)\n    for i in range(num_items):\n        rank_1 = ranks_list1[i]\n        rank_2 = ranks_list2[i]\n        for j in range(i + 1, num_items):\n            diff1 = ranks_list1[j] - rank_1\n            diff2 = ranks_list2[j] - rank_2\n            if (diff1 > 0 and diff2 > 0) or (diff1 < 0 and diff2 < 0):\n                num_concordant_pairs += 1\n            elif (diff1 > 0 and diff2 < 0) or (diff1 < 0 and diff2 > 0):\n                num_discordant_pairs += 1\n            elif diff1 == 0 and diff2 == 0:\n                num_tied_xy += 1\n            elif diff1 == 0:\n                num_tied_x += 1\n            elif diff2 == 0:\n                num_tied_y += 1\n    try:\n        gamma_corr_coeff = float(num_concordant_pairs - num_discordant_pairs)/float(num_concordant_pairs + num_discordant_pairs)\n    except:\n        gamma_corr_coeff = 'n/a'\n    return [num_tied_x, num_tied_y, num_tied_xy, gamma_corr_coeff]", "entry_point": "gamma", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[0, 0, 0, 1.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/unmerged/rpache/functions_lib.py#L252-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033842", "code": "def empty(key, dict):\n    \"\"\"\n    Function determines if the dict key exists or it is empty\n\n    Args\n    ----\n    key (string): the dict key\n    dict (dict): the dict to be searched\n    \"\"\"\n    if key in dict.keys():\n        if dict[key]:\n            return False\n    return True", "entry_point": "empty", "input": "(), {'x': [1, 2], 'y': []}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aacanakin/glim/blob/71a20ac149a1292c0d6c1dc7414985ea51854f7a/glim/utils.py#L109-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033843", "code": "def add_qtl_to_marker(marker, qtls):\n    \"\"\"Add the number of QTLs found for a given marker.\n\n    :arg marker, the marker we are looking for the QTL's.\n    :arg qtls, the list of all QTLs found.\n\n    \"\"\"\n    cnt = 0\n    for qtl in qtls:\n        if qtl[-1] == marker[0]:\n            cnt = cnt + 1\n\n    marker.append(str(cnt))\n    return marker", "entry_point": "add_qtl_to_marker", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "[5, 3, 1, 4, '0']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PBR/MQ2/blob/6d84dea47e6751333004743f588f03158e35c28d/MQ2/add_qtl_to_map.py#L38-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033844", "code": "def _order_linkage_group(group):\n    \"\"\" For a given group (ie: a list containing [marker, position])\n    order the list according to their position.\n    \"\"\"\n    tmp = {}\n    for row in group:\n        if float(row[1]) in tmp:  # pragma: no cover\n            tmp[float(row[1])].append(row[0])\n        else:\n            tmp[float(row[1])] = [row[0]]\n\n    keys = list(tmp.keys())\n    keys.sort()\n    output = []\n    for key in keys:\n        for entry in tmp[key]:\n            if not entry:\n                continue\n            output.append([entry, str(key)])\n    return output", "entry_point": "_order_linkage_group", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PBR/MQ2/blob/6d84dea47e6751333004743f588f03158e35c28d/MQ2/mapchart.py#L102-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033845", "code": "def get_qtls_from_rqtl_data(matrix, lod_threshold):\n    \"\"\" Retrieve the list of significants QTLs for the given input\n    matrix and using the specified LOD threshold.\n    This assumes one QTL per linkage group.\n\n    :arg matrix, the MapQTL file read in memory\n    :arg threshold, threshold used to determine if a given LOD value is\n        reflective the presence of a QTL.\n\n    \"\"\"\n    t_matrix = list(zip(*matrix))\n    qtls = [['Trait', 'Linkage Group', 'Position', 'Exact marker', 'LOD']]\n    # row 0: markers\n    # row 1: chr\n    # row 2: pos\n    for row in t_matrix[3:]:\n        lgroup = None\n        max_lod = None\n        peak = None\n        cnt = 1\n        while cnt < len(row):\n            if lgroup is None:\n                lgroup = t_matrix[1][cnt]\n\n            if lgroup == t_matrix[1][cnt]:\n                if max_lod is None:\n                    max_lod = float(row[cnt])\n                if float(row[cnt]) > float(max_lod):\n                    max_lod = float(row[cnt])\n                    peak = cnt\n            else:\n                if max_lod \\\n                        and float(max_lod) > float(lod_threshold) \\\n                        and peak:\n                    qtl = [row[0],             # trait\n                           t_matrix[1][peak],  # LG\n                           t_matrix[2][peak],  # pos\n                           t_matrix[0][peak],  # marker\n                           max_lod,            # LOD value\n                           ]\n                    qtls.append(qtl)\n                lgroup = None\n                max_lod = None\n                peak = cnt\n            cnt = cnt + 1\n    return qtls", "entry_point": "get_qtls_from_rqtl_data", "input": "['a', 'b', 'c'], 0.5", "output": "[['Trait', 'Linkage Group', 'Position', 'Exact marker', 'LOD']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PBR/MQ2/blob/6d84dea47e6751333004743f588f03158e35c28d/MQ2/plugins/csv_plugin.py#L55-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033846", "code": "def chunk_list(items, size):\n    \"\"\"\n    Return a list of chunks\n    :param items: List\n    :param size: int The number of items per chunk\n    :return: List\n    \"\"\"\n    size = max(1, size)\n    return [items[i:i + size] for i in range(0, len(items), size)]", "entry_point": "chunk_list", "input": "[], 2", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/Mocha/blob/bce481cb31a0972061dd99bc548701411dcb9de3/mocha/utils.py#L122-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033847", "code": "def list_replace(subject_list, replacement, string):\n    \"\"\"\n    To replace a list of items by a single replacement\n    :param subject_list: list\n    :param replacement: string\n    :param string: string\n    :return: string\n    \"\"\"\n    for s in subject_list:\n        string = string.replace(s, replacement)\n    return string", "entry_point": "list_replace", "input": "set(), 7, {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/Mocha/blob/bce481cb31a0972061dd99bc548701411dcb9de3/mocha/utils.py#L193-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033848", "code": "def dict_replace(subject_dict, string):\n    \"\"\"\n    Replace a dict map, key to its value in the stirng\n    :param subject_dict: dict\n    :param string: string\n    :return: string\n    \"\"\"\n    for i, j in subject_dict.items():\n        string = string.replace(i, j)\n    return string", "entry_point": "dict_replace", "input": "{}, 'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mardix/Mocha/blob/bce481cb31a0972061dd99bc548701411dcb9de3/mocha/utils.py#L206-L215", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033849", "code": "def add_marker_to_qtl(qtl, map_list):\n    \"\"\"Add the closest marker to the given QTL.\n\n    :arg qtl: a row of the QTL list.\n    :arg map_list: the genetic map containing the list of markers.\n\n    \"\"\"\n    closest = ''\n    diff = None\n    for marker in map_list:\n        if qtl[1] == marker[1]:\n            tmp_diff = float(qtl[2]) - float(marker[2])\n            if diff is None or abs(diff) > abs(tmp_diff):\n                diff = tmp_diff\n                closest = marker\n    if closest != '':\n        closest = closest[0]\n    return closest", "entry_point": "add_marker_to_qtl", "input": "[], {}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PBR/MQ2/blob/6d84dea47e6751333004743f588f03158e35c28d/MQ2/add_marker_to_qtls.py#L38-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033850", "code": "def get_unique_ajps( benchmark_runs ):\n        \"\"\"\n        Determines which join parameters are unique\n        \"\"\"\n        br_ajps = {}\n        for br in benchmark_runs:\n            for ajp in br.additional_join_parameters:\n                if ajp not in br_ajps:\n                    br_ajps[ajp] = set()\n                br_ajps[ajp].add( br.additional_join_parameters[ajp]['short_name'] )\n        unique_ajps = []\n        for ajp in br_ajps:\n            if len( br_ajps[ajp] ) > 1:\n                unique_ajps.append( ajp )\n        return unique_ajps", "entry_point": "get_unique_ajps", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/benchmarking/analysis/ddg_monomeric_stability_analysis.py#L822-L836", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033851", "code": "def dict_map(function, dictionary):\n\t\"\"\"\n\tdict_map is much like the built-in function map.  It takes a dictionary\n\tand applys a function to the values of that dictionary, returning a\n\tnew dictionary with the mapped values in the original keys.\n\n\t>>> d = dict_map(lambda x:x+1, dict(a=1, b=2))\n\t>>> d == dict(a=2,b=3)\n\tTrue\n\t\"\"\"\n\treturn dict((key, function(value)) for key, value in dictionary.items())", "entry_point": "dict_map", "input": "['apple', 'banana', 'cherry'], {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.collections/blob/25db1dab06d7108dc0c2b7e83dc7530fb10718d2/jaraco/collections.py#L139-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033852", "code": "def invert_map(map):\n\t\"\"\"\n\tGiven a dictionary, return another dictionary with keys and values\n\tswitched. If any of the values resolve to the same key, raises\n\ta ValueError.\n\n\t>>> numbers = dict(a=1, b=2, c=3)\n\t>>> letters = invert_map(numbers)\n\t>>> letters[1]\n\t'a'\n\t>>> numbers['d'] = 3\n\t>>> invert_map(numbers)\n\tTraceback (most recent call last):\n\t...\n\tValueError: Key conflict in inverted mapping\n\t\"\"\"\n\tres = dict((v, k) for k, v in map.items())\n\tif not len(res) == len(map):\n\t\traise ValueError('Key conflict in inverted mapping')\n\treturn res", "entry_point": "invert_map", "input": "{'a': 1, 'b': 2}", "output": "{1: 'a', 2: 'b'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.collections/blob/25db1dab06d7108dc0c2b7e83dc7530fb10718d2/jaraco/collections.py#L506-L525", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033853", "code": "def merge_range_pairs(prs):\n    '''Takes in a list of pairs specifying ranges and returns a sorted list of merged, sorted ranges.'''\n    new_prs = []\n    sprs = [sorted(p) for p in prs]\n    sprs = sorted(sprs)\n    merged = False\n    x = 0\n    while x < len(sprs):\n        newx = x + 1\n        new_pair = list(sprs[x])\n        for y in range(x + 1, len(sprs)):\n            if new_pair[0] <= sprs[y][0] - 1 <= new_pair[1]:\n                new_pair[0] = min(new_pair[0], sprs[y][0])\n                new_pair[1] = max(new_pair[1], sprs[y][1])\n                newx = y + 1\n        if new_pair not in new_prs:\n            new_prs.append(new_pair)\n        x = newx\n    return new_prs", "entry_point": "merge_range_pairs", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/general/strutil.py#L36-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033854", "code": "def get_value_unit(value, unit, prefix):\n    \"\"\"\n    Return a human-readable value with unit specification. Try to\n    transform the unit prefix to the one passed as parameter. When\n    transform to higher prefix apply nearest integer round. \n    \"\"\"\n    prefixes = ('', 'K', 'M', 'G', 'T')\n\n    if len(unit):\n        if unit[:1] in prefixes:\n            valprefix = unit[0] \n            unit = unit[1:]\n        else:\n            valprefix = ''\n    else:\n        valprefix = ''\n    \n    while valprefix != prefix:\n        uidx = prefixes.index(valprefix)\n\n        if uidx > prefixes.index(prefix):\n            value *= 1024\n            valprefix = prefixes[uidx-1]\n        else:\n            if value < 10240:\n                return value, '{0}{1}'.format(valprefix, unit)\n            value = int(round(value/1024.0))\n            valprefix = prefixes[uidx+1]\n    return value, '{0}{1}'.format(valprefix, unit)", "entry_point": "get_value_unit", "input": "[5, 3, 1, 4], [[1, 2], [3], []], ''", "output": "([5, 3, 1, 4], '[[1, 2], [3], []]')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brunato/lograptor/blob/b1f09fe1b429ed15110610092704ef12d253f3c9/lograptor/utils.py#L96-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033855", "code": "def htmlsafe(unsafe):\n    \"\"\"\n    Escapes all x(ht)ml control characters.\n    \"\"\"\n    unsafe = unsafe.replace('&', '&amp;')\n    unsafe = unsafe.replace('<', '&lt;')\n    unsafe = unsafe.replace('>', '&gt;')\n    return unsafe", "entry_point": "htmlsafe", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brunato/lograptor/blob/b1f09fe1b429ed15110610092704ef12d253f3c9/lograptor/utils.py#L127-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033856", "code": "def seconds_to_hms(seconds):\n    \"\"\"\n    Converts seconds float to 'hh:mm:ss.ssssss' format.\n    \"\"\"\n    hours = int(seconds / 3600.0)\n    minutes = int((seconds / 60.0) % 60.0)\n    secs = float(seconds % 60.0)\n    return \"{0:02d}:{1:02d}:{2:02.6f}\".format(hours, minutes, secs)", "entry_point": "seconds_to_hms", "input": "True", "output": "'00:00:1.000000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ronhanson/python-tbx/blob/87f72ae0cadecafbcd144f1e930181fba77f6b83/tbx/text.py#L172-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033857", "code": "def _convertToElementList(elements_list):\n    \"\"\"\n    Take a list of element node indexes deliminated by -1 and convert\n    it into a list element node indexes list.\n    \"\"\"\n    elements = []\n    current_element = []\n    for node_index in elements_list:\n        if node_index == -1:\n            elements.append(current_element)\n            current_element = []\n        else:\n            current_element.append(node_index)\n\n    return elements", "entry_point": "_convertToElementList", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ABI-Software/MeshParser/blob/08dc0ce7c44d0149b443261ff6d3708e28a928e7/src/meshparser/vrmlparser/parser.py#L561-L575", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033858", "code": "def has_void_args(argv):\n    \"\"\"\n    Check if the command line has no arguments or only the --conf optional argument.\n    \"\"\"\n    n_args = len(argv)\n    return n_args == 1 or n_args == 2 and argv[1].startswith('--conf=') or n_args == 3 and argv[1] == '--conf'", "entry_point": "has_void_args", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brunato/lograptor/blob/b1f09fe1b429ed15110610092704ef12d253f3c9/lograptor/api.py#L333-L338", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033859", "code": "def resolve_response_data(head_key, data_key, data):\n        \"\"\"\n        Resolves the responses you get from billomat\n        If you have done a get_one_element request then you will get a dictionary\n        If you have done a get_all_elements request then you will get a list with all elements in it\n\n        :param head_key: the head key e.g: CLIENTS\n        :param data_key: the data key e.g: CLIENT\n        :param data: the responses you got\n        :return: dict or list\n        \"\"\"\n        new_data = []\n        if isinstance(data, list):\n            for data_row in data:\n                if head_key in data_row and data_key in data_row[head_key]:\n                    if isinstance(data_row[head_key][data_key], list):\n                        new_data += data_row[head_key][data_key]\n                    else:\n                        new_data.append(data_row[head_key][data_key])\n                elif data_key in data_row:\n                    return data_row[data_key]\n\n        else:\n            if head_key in data and data_key in data[head_key]:\n                new_data += data[head_key][data_key]\n            elif data_key in data:\n                    return data[data_key]\n        return new_data", "entry_point": "resolve_response_data", "input": "[1, 2, 3], [-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L193-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033860", "code": "def problem_with_codon(codon_index, codon_list, bad_seqs):\n    \"\"\"\n    Return true if the given codon overlaps with a bad sequence.\n    \"\"\"\n\n    base_1 = 3 * codon_index\n    base_3 = 3 * codon_index + 2\n\n    gene_seq = ''.join(codon_list)\n\n    for bad_seq in bad_seqs:\n        problem = bad_seq.search(gene_seq)\n        if problem and problem.start() < base_3 and problem.end() > base_1:\n            return True\n\n    return False", "entry_point": "problem_with_codon", "input": "7, ['a', 'b', 'c'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L175-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033861", "code": "def get_item_metric_pair(item_lst, metric_lst, id_lst):\r\n    \"\"\"\r\n    align bleu and specific score in item_lst, reconstruct the data as (rank_score, bleu) pairs, query_dic.\r\n    Detail:\r\n        query dict is input parameter used by metrics: top-x-bleu, kendall-tau\r\n        query dict is reconstructed dict type data container,\r\n        query dict's key is qid and value is list type, whose elements are tuple eg: count of words, bleu score pairs\r\n    :param item_lst: the score value lst that used to rank candidates\r\n    :param metric_lst: the metric value aligned with item_lst\r\n    :return: query_dic\r\n    \"\"\"\r\n    query_dic = {}  # key is qid, value is list, whose elements are tuple eg: count of words, bleu score pairs\r\n    for index in range(len(metric_lst)):\r\n        current_id = id_lst[index]\r\n        current_bleu = metric_lst[index]\r\n        current_rank_score = item_lst[index]\r\n        if current_id in query_dic:\r\n            query_dic[current_id].append((current_rank_score, current_bleu))\r\n        else:\r\n            query_dic[current_id] = []\r\n            query_dic[current_id].append((current_rank_score, current_bleu))\r\n    return query_dic", "entry_point": "get_item_metric_pair", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "{1: [('apple', 'apple')], 2: [('banana', 'banana')], 3: [('cherry', 'cherry')]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AtmaHou/atma/blob/41cd8ea9443a9c3b2dd71432f46f44a0f83093c7/Metrics.py#L78-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033862", "code": "def group_keys_by_values(d):\n    \"\"\"\n    Take a dict (A -> B( and return another one (B -> [A]). It groups keys\n    from the original dict by their values.\n\n    .. testsetup::\n\n        from proso.dict import group_keys_by_values\n        from pprint import pprint\n\n    .. doctest::\n\n        >>> pprint(group_keys_by_values({1: True, 2: False, 3: True, 4: True}))\n        {False: [2], True: [1, 3, 4]}\n\n    Args:\n        d (dict): original dictionary which will be transformed.\n    Returns:\n        dict: new keys are taken from original values, each new key points to a\n            list where all values are original keys pointing to the same value\n    \"\"\"\n    result = {}\n    for k, v in d.items():\n        saved = result.get(v, [])\n        saved.append(k)\n        result[v] = saved\n    return result", "entry_point": "group_keys_by_values", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso/dict.py#L6-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033863", "code": "def group_keys_by_value_lists(d):\n    \"\"\"\n    Take a dict (A -> [B]( and return another one (B -> [A]). It groups keys\n    from the original dict by their values in lists.\n\n    .. testsetup::\n\n        from proso.dict import group_keys_by_value_lists\n        from pprint import pprint\n\n    .. doctest::\n\n        >>> pprint(group_keys_by_value_lists({1: [True], 2: [False], 3: [True], 4: [True, False]}))\n        {False: [2, 4], True: [1, 3, 4]}\n\n    Args:\n        d (dict): original dictionary which will be transformed.\n    Returns:\n        dict: new keys are taken from original values, each new key points to a\n            list where all values are original keys pointing to the same value\n    \"\"\"\n    result = {}\n    for k, values in d.items():\n        for v in values:\n            saved = result.get(v, [])\n            saved.append(k)\n            result[v] = saved\n    return result", "entry_point": "group_keys_by_value_lists", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso/dict.py#L35-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033864", "code": "def group_lines(lines):\n    \"\"\"Split a list of lines using empty lines as separators.\"\"\"\n    groups = []\n    group = []\n\n    for line in lines:\n        if line.strip() == \"\":\n            groups.append(group[:])\n            group = []\n            continue\n        group.append(line)\n\n    if group:\n        groups.append(group[:])\n\n    return groups", "entry_point": "group_lines", "input": "'  padded  '", "output": "[[], [], ['p', 'a', 'd', 'd', 'e', 'd'], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/truveris/py-mdstat/blob/881af99d1168694d2f38e606af377ef6cabe2297/mdstat/utils.py#L6-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033865", "code": "def resolve_import(import_path, from_module):\n    '''Resolves relative imports from a module.\n    '''\n    if not import_path or not import_path.startswith('.'):\n        return import_path\n\n    from_module = from_module.split('.')\n    dots = 0\n    for c in import_path:\n        if c == '.':\n            dots += 1\n        else:\n            break\n\n    if dots:\n        from_module = from_module[:-dots]\n        import_path = import_path[dots:]\n\n    if import_path:\n        from_module.append(import_path)\n\n    return '.'.join(from_module)", "entry_point": "resolve_import", "input": "'Hello World', [[1, 2], [3], []]", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tweekmonster/moult/blob/38d3a3b9002336219897ebe263ca1d8dcadbecf5/moult/utils.py#L110-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033866", "code": "def get_device_type(device_type=0):\n    \"\"\"Return the device type from a device_type list.\"\"\"\n    device_types = {\n        0: \"Unknown\",\n        1: \"Classic - BR/EDR devices\",\n        2: \"Low Energy - LE-only\",\n        3: \"Dual Mode - BR/EDR/LE\"\n    }\n    if device_type in [0, 1, 2, 3]:\n        return_value = device_types[device_type]\n    else:\n        return_value = device_types[0]\n    return return_value", "entry_point": "get_device_type", "input": "['a', 'b', 'c']", "output": "'Unknown'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ludeeus/GHLocalApi/blob/93abdee299c4a4b65aa9dd03c77ec34e174e3c56/ghlocalapi/utils/convert.py#L9-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033867", "code": "def add_0x(string):\n    \"\"\"Add 0x to string at start.\n    \"\"\"\n    if isinstance(string, bytes):\n        string = string.decode('utf-8')\n    return '0x' + str(string)", "entry_point": "add_0x", "input": "'  padded  '", "output": "'0x  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DeV1doR/aioethereum/blob/85eb46550d862b3ccc309914ea871ca1c7b42157/aioethereum/utils.py#L4-L9", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033868", "code": "def guess_depth(packages):\n    \"\"\"\n    Guess the optimal depth to use for the given list of arguments.\n\n    Args:\n        packages (list of str): list of packages.\n\n    Returns:\n        int: guessed depth to use.\n    \"\"\"\n    if len(packages) == 1:\n        return packages[0].count('.') + 2\n    return min(p.count('.') for p in packages) + 1", "entry_point": "guess_depth", "input": "[[1, 2], [3], []]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Genida/dependenpy/blob/df099c17cbe735c990eca9197e39cfc5eb8a4c8e/src/dependenpy/helpers.py#L45-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033869", "code": "def get_path(num):\n        \"\"\"Gets a path from the workitem number.\n\n        For example: 31942 will return 30000-39999/31000-31999/31900-31999\n        \"\"\"\n        num = int(num)\n        dig_len = len(str(num))\n        paths = []\n        for i in range(dig_len - 2):\n            divisor = 10 ** (dig_len - i - 1)\n            paths.append(\n                \"{}-{}\".format((num // divisor) * divisor, (((num // divisor) + 1) * divisor) - 1)\n            )\n        return \"/\".join(paths)", "entry_point": "get_path", "input": "1", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/svn_polarion.py#L31-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033870", "code": "def no_cache(asset_url):\n    \"\"\"\n    Removes query parameters\n    \"\"\"\n    pos = asset_url.rfind('?')\n    if pos > 0:\n        asset_url = asset_url[:pos]\n    return asset_url", "entry_point": "no_cache", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/djaodjin/djaodjin-deployutils/blob/a0fe3cf3030dbbf09025c69ce75a69b326565dd8/deployutils/apps/django/templatetags/deployutils_extratags.py#L61-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033871", "code": "def __ngrams(s, n=3):\n    \"\"\" Raw n-grams from a sequence\n\n        If the sequence is a string, it will return char-level n-grams.\n        If the sequence is a list of words, it will return word-level n-grams.\n\n        Note: it treats space (' ') and punctuation like any other character.\n\n            >>> ngrams('This is not a test!')\n            [('T', 'h', 'i'), ('h', 'i', 's'), ('i', 's', ' '), ('s', ' ', 'i'),\n            (' ', 'i', 's'), ('i', 's', ' '), ('s', ' ', 'n'), (' ', 'n', 'o'),\n            ('n', 'o', 't'), ('o', 't', ' '), ('t', ' ', 'a'), (' ', 'a', ' '),\n            ('a', ' ', 't'), (' ', 't', 'e'), ('t', 'e', 's'), ('e', 's', 't'),\n            ('s', 't', '!')]\n            >>> ngrams([\"This\", \"is\", \"not\", \"a\", \"test!\"])\n            [('This', 'is', 'not'), ('is', 'not', 'a'), ('not', 'a', 'test!')]\n\n        Args:\n            s: a string or a list of strings\n            n: an int for the n in n-gram\n\n        Returns:\n            list: tuples of char-level or word-level n-grams\n    \"\"\"\n    return list(zip(*[s[i:] for i in range(n)]))", "entry_point": "__ngrams", "input": "{}, False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SignalN/language/blob/5c50c78f65bcc2c999b44d530e7412185248352d/language/ngrams.py#L3-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033872", "code": "def combine(specs):\n        \"\"\"\n        Combine package specifications' limitations.\n\n        Args:\n            specs (list of PackageSpec): the package specifications.\n\n        Returns:\n            list of PackageSpec: the new, merged list of PackageSpec.\n        \"\"\"\n        new_specs = {}\n        for spec in specs:\n            if new_specs.get(spec, None) is None:\n                new_specs[spec] = spec\n            else:\n                new_specs[spec].add(spec)\n        return list(new_specs.values())", "entry_point": "combine", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Genida/dependenpy/blob/df099c17cbe735c990eca9197e39cfc5eb8a4c8e/src/dependenpy/finder.py#L45-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033873", "code": "def full_name_natural_split(full_name):\n    \"\"\"\n    This function splits a full name into a natural first name, last name\n    and middle initials.\n    \"\"\"\n    parts = full_name.strip().split(' ')\n    first_name = \"\"\n    if parts:\n        first_name = parts.pop(0)\n    if first_name.lower() == \"el\" and parts:\n        first_name += \" \" + parts.pop(0)\n    last_name = \"\"\n    if parts:\n        last_name = parts.pop()\n    if (last_name.lower() == 'i' or last_name.lower() == 'ii'\n        or last_name.lower() == 'iii' and parts):\n        last_name = parts.pop() + \" \" + last_name\n    middle_initials = \"\"\n    for middle_name in parts:\n        if middle_name:\n            middle_initials += middle_name[0]\n    return first_name, middle_initials, last_name", "entry_point": "full_name_natural_split", "input": "'  padded  '", "output": "('padded', '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/djaodjin/djaodjin-deployutils/blob/a0fe3cf3030dbbf09025c69ce75a69b326565dd8/deployutils/helpers.py#L45-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033874", "code": "def _sql_params(sql):\n    \"\"\"\n    Identify `sql` as either SQL string or 2-tuple of SQL and params.\n    Same format as supported by Django's RunSQL operation for sql/reverse_sql.\n    \"\"\"\n    params = None\n    if isinstance(sql, (list, tuple)):\n        elements = len(sql)\n        if elements == 2:\n            sql, params = sql\n        else:\n            raise ValueError(\"Expected a 2-tuple but got %d\" % elements)\n    return sql, params", "entry_point": "_sql_params", "input": "False", "output": "(False, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klichukb/django-migrate-sql/blob/be48ff2c9283404e3d951128c459c3496d1ba25d/migrate_sql/autodetector.py#L18-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033875", "code": "def create_ports(port, mpi, rank):\n        \"\"\"create a list of ports for the current rank\"\"\"\n        if port == \"random\" or port is None:\n            # ports will be filled in using random binding\n            ports = {}\n        else:\n            port = int(port)\n            ports = {\n                \"REQ\": port + 0,\n                \"PUSH\": port + 1,\n                \"SUB\": port + 2\n            }\n        # if we want to communicate with separate domains\n        # we have to setup a socket for each of them\n        if mpi == 'all':\n            # use a socket for each rank rank\n            for port in ports:\n                ports[port] += (rank * 3)\n        return ports", "entry_point": "create_ports", "input": "False, {1, 2, 3}, []", "output": "{'REQ': 0, 'PUSH': 1, 'SUB': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/runner.py#L92-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033876", "code": "def is_numeric(obj):\n    \"\"\"\n    This detects whether an input object is numeric or not.\n\n    :param obj: object to be tested.\n    \"\"\"\n    try:\n        obj+obj, obj-obj, obj*obj, obj**obj, obj/obj\n    except ZeroDivisionError:\n        return True\n    except Exception:\n        return False\n    else:\n        return True", "entry_point": "is_numeric", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rraadd88/rohan/blob/b0643a3582a2fffc0165ace69fb80880d92bfb10/rohan/dandage/io_nums.py#L14-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033877", "code": "def wrap_list(item):\n    \"\"\"\n    Returns an object as a list.\n\n    If the object is a list, it is returned directly. If it is a tuple or set, it\n    is returned as a list. If it is another object, it is wrapped in a list and\n    returned.\n    \"\"\"\n    if item is None:\n        return []\n    elif isinstance(item, list):\n        return item\n    elif isinstance(item, (tuple, set)):\n        return list(item)\n    else:\n        return [item]", "entry_point": "wrap_list", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tylerbutler/engineer/blob/8884f587297f37646c40e5553174852b444a4024/engineer/util.py#L228-L243", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033878", "code": "def GetModuleText(heading, name, showprivate=False):\n        \"\"\"Returns the needed text to automatically document a module in RSF/sphinx\"\"\"\n        und = '='*len(heading)\n        if showprivate:\n            opts = ':private-members:'\n        else:\n            opts = ''\n        return r'''\n\n%s\n%s\n\n.. automodule:: %s\n    %s\n\n''' % (heading, und, name, opts)", "entry_point": "GetModuleText", "input": "[[1, 2], [3], []], '', ['a', 'b', 'c']", "output": "'\\n\\n[[1, 2], [3], []]\\n===\\n\\n.. automodule:: \\n    :private-members:\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/banesullivan/gendocs/blob/4ff6277370143ba698701beccc05d5eace43b632/gendocs/generator.py#L128-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033879", "code": "def GetFunctionText(heading, name):\n        \"\"\"Returns the needed text to automatically document a function in RSF/sphinx\"\"\"\n        und = '-'*len(heading)\n        return r'''\n\n%s\n%s\n\n.. autofunction:: %s\n\n''' % (heading, und, name)", "entry_point": "GetFunctionText", "input": "[-1, 0, 1, 2], '  padded  '", "output": "'\\n\\n[-1, 0, 1, 2]\\n----\\n\\n.. autofunction::   padded  \\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/banesullivan/gendocs/blob/4ff6277370143ba698701beccc05d5eace43b632/gendocs/generator.py#L175-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033880", "code": "def append_existing_values(schema, config):\n    \"\"\"\n    Adds the values of the existing config to the config dictionary.\n    \"\"\"\n\n    for section_name in config:\n        for option_name in config[section_name]:\n            option_value = config[section_name][option_name]\n\n            # Note that we must preserve existing values, wether or not they\n            # exist in the schema file!\n            schema.setdefault(section_name, {}).setdefault(option_name, {})['value'] = option_value\n\n    return schema", "entry_point": "append_existing_values", "input": "[1, 2, 3], {}", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/louib/confirm/blob/0acd1eccda6cd71c69d2ae33166a16a257685811/confirm/generator.py#L126-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033881", "code": "def RANGE(start, end, step=None):\n    \"\"\"\n    Generates the sequence from the specified starting number by successively\n    incrementing the starting number by the specified step value up to but not including the end point.\n    See https://docs.mongodb.com/manual/reference/operator/aggregation/range/\n    for more details\n    :param start: An integer (or valid expression) that specifies the start of the sequence.\n    :param end: An integer (or valid expression) that specifies the exclusive upper limit of the sequence.\n    :param step: An integer (or valid expression) that specifies the increment value.\n    :return: Aggregation operator\n    \"\"\"\n    return {'$range': [start, end, step]} if step is not None else {'$range': [start, end]}", "entry_point": "RANGE", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "{'$range': [[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MosesSymeonidis/aggregation_builder/blob/a1f4b580401d400c53206e9c020e413166254274/aggregation_builder/operators/array.py#L97-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033882", "code": "def SLICE(array, n, position=None):\n    \"\"\"\n    Returns a subset of an array.\n    See https://docs.mongodb.com/manual/reference/operator/aggregation/slice/\n    for more details\n    :param array: Any valid expression as long as it resolves to an array.\n    :param n: Any valid expression as long as it resolves to an integer.\n    :param position: Optional. Any valid expression as long as it resolves to an integer.\n    :return: Aggregation operator\n    \"\"\"\n    return {'$slice': [array, position, n]} if position is not None else {'$slice': [array, n]}", "entry_point": "SLICE", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []], []", "output": "{'$slice': [['apple', 'banana', 'cherry'], [], [[1, 2], [3], []]]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MosesSymeonidis/aggregation_builder/blob/a1f4b580401d400c53206e9c020e413166254274/aggregation_builder/operators/array.py#L146-L156", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033883", "code": "def ZIP(inputs, use_longest_length=None, defaults=None):\n    \"\"\"\n    Transposes an array of input arrays so that the first element of the output array would be an array containing,\n    the first element of the first input array,\n    the first element of the second input array, etc.\n    See https://docs.mongodb.com/manual/reference/operator/aggregation/zip/\n    for more details\n    :param inputs: An array of expressions that resolve to arrays.\n    :param use_longest_length: A boolean which specifies whether the length of the longest array determines the number of arrays in the output array.\n    :param defaults: An array of default element values to use if the input arrays have different lengths.\n    :return: Aggregation operator\n    \"\"\"\n    res = {'inputs': inputs}\n    if use_longest_length in [True, False]:\n        res['useLongestLength'] = use_longest_length\n    if defaults is not None:\n        res['defaults'] = defaults\n    return {'$zip': res}", "entry_point": "ZIP", "input": "[1, 2, 3], 5, [1, 2, 3]", "output": "{'$zip': {'inputs': [1, 2, 3], 'defaults': [1, 2, 3]}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MosesSymeonidis/aggregation_builder/blob/a1f4b580401d400c53206e9c020e413166254274/aggregation_builder/operators/array.py#L159-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033884", "code": "def linebreaker(l,break_pt=16):\n    \"\"\"\n    used for adding labels in plots.\n\n    :param l: list of strings\n    :param break_pt: number, insert new line after this many letters \n    \"\"\"\n\n    l_out=[]\n    for i in l:\n        if len(i)>break_pt:\n            i_words=i.split(' ')\n            i_out=''\n            line_len=0\n            for w in i_words:\n                line_len+=len(w)+1\n                if i_words.index(w)==0:\n                    i_out=w\n                elif line_len>break_pt:\n                    line_len=0\n                    i_out=\"%s\\n%s\" % (i_out,w)\n                else:\n                    i_out=\"%s %s\" % (i_out,w)\n            l_out.append(i_out)    \n#             l_out.append(\"%s\\n%s\" % (i[:break_pt],i[break_pt:]))\n        else:\n            l_out.append(i)\n    return l_out", "entry_point": "linebreaker", "input": "set(), 0.5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rraadd88/rohan/blob/b0643a3582a2fffc0165ace69fb80880d92bfb10/rohan/dandage/io_strs.py#L130-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033885", "code": "def _view_area(stream=bytes(), index=0, count=0):\n        \"\"\" Returns the (start, stop) index for the viewing area of the\n        byte stream.\n\n        :param int index: start index of the viewing area.\n            Default is the begin of the stream.\n        :param int count: number of bytes to view.\n            Default is to the end of the stream.\n        \"\"\"\n        # Byte stream size\n        size = len(stream)\n\n        # Start index of the viewing area\n        start = max(min(index, size), -size)\n        if start < 0:\n            start += size\n\n        # Stop index of the viewing area\n        if not count:\n            count = size\n        if count > 0:\n            stop = min(start + count, size)\n        else:\n            stop = size\n\n        return start, stop", "entry_point": "_view_area", "input": "[[1, 2], [3], []], 3, 10", "output": "(3, 3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JoeVirtual/KonFoo/blob/0c62ef5c2bed4deaf908b34082e4de2544532fdc/konfoo/utils.py#L49-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033886", "code": "def replace_u_end_month(month):\n    \"\"\"Find the latest legitimate month.\"\"\"\n    month = month.lstrip('-')\n    if month == 'uu' or month == '1u':\n        return '12'\n    if month == 'u0':\n        return '10'\n    if month == '0u':\n        return '09'\n    if month[1] in ['1', '2']:\n        # 'u1' or 'u2'\n        return month.replace('u', '1')\n    # Otherwise it should match r'u[3-9]'.\n    return month.replace('u', '0')", "entry_point": "replace_u_end_month", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/unt-libraries/edtf-validate/blob/d6d63141919a66aea4ff1c31fa0cb8ff744ef9d9/edtf_validate/valid_edtf.py#L264-L277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033887", "code": "def ellipsis(text, length, symbol=\"...\"):\n    \"\"\"Present a block of text of given length.\n    \n    If the length of available text exceeds the requested length, truncate and\n    intelligently append an ellipsis.\n    \"\"\"\n    if len(text) > length:\n        pos = text.rfind(\" \", 0, length)\n        if pos < 0:\n            return text[:length].rstrip(\".\") + symbol\n        else:\n            return text[:pos].rstrip(\".\") + symbol\n    \n    else:\n        return text", "entry_point": "ellipsis", "input": "'', 1, []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marrow/util/blob/abb8163dbd1fa0692d42a44d129b12ae2b39cdf2/marrow/util/text.py#L26-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033888", "code": "def boolean(input):\n    \"\"\"Convert the given input to a boolean value.\n    \n    Intelligently handles boolean and non-string values, returning\n    as-is and passing to the bool builtin respectively.\n    \n    This process is case-insensitive.\n    \n    Acceptable values:\n    \n    True\n        * yes\n        * y\n        * on\n        * true\n        * t\n        * 1\n    \n    False\n        * no\n        * n\n        * off\n        * false\n        * f\n        * 0\n    \n    :param input: the value to convert to a boolean\n    :type input: any\n    \n    :returns: converted boolean value\n    :rtype: bool\n    \"\"\"\n    \n    try:\n        input = input.strip().lower()\n    except AttributeError:\n        return bool(input)\n    \n    if input in ('yes', 'y', 'on', 'true', 't', '1'):\n        return True\n    \n    if input in ('no', 'n', 'off', 'false', 'f', '0'):\n        return False\n    \n    raise ValueError(\"Unable to convert {0!r} to a boolean value.\".format(input))", "entry_point": "boolean", "input": "[5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marrow/util/blob/abb8163dbd1fa0692d42a44d129b12ae2b39cdf2/marrow/util/convert.py#L16-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033889", "code": "def number(input):\n    \"\"\"Convert the given input to a floating point or integer value.\n    \n    In cases of ambiguity, integers will be prefered to floating point.\n    \n    :param input: the value to convert to a number\n    :type input: any\n    \n    :returns: converted integer value\n    :rtype: float or int\n    \"\"\"\n    \n    try:\n        return int(input)\n    except (TypeError, ValueError):\n        pass\n    \n    try:\n        return float(input)\n    except (TypeError, ValueError):\n        raise ValueError(\"Unable to convert {0!r} to a number.\".format(input))", "entry_point": "number", "input": "5", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marrow/util/blob/abb8163dbd1fa0692d42a44d129b12ae2b39cdf2/marrow/util/convert.py#L137-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033890", "code": "def resistance(genename, resistance_dict):\n        \"\"\"\n        Determine the resistance class of the gene by searching the sets of genes included in every resistance FASTA\n        file\n        :param genename: Header string returned from analyses\n        :param resistance_dict: Dictionary of resistance class: header\n        :return: resistance class of the gene\n        \"\"\"\n        # Initialise a list to store the resistance class(es) for the gene\n        resistance_list = list()\n        # Iterate through the dictionary of the resistance class: set of gene names\n        for resistance_class, gene_set in resistance_dict.items():\n            # If the gene is presence in the set\n            if genename in gene_set:\n                # Set the resistance class appropriately\n                resistance_list.append(resistance_class)\n        # Create a comma-separated string of the sorted genes\n        resistance = ','.join(sorted(resistance_list))\n        # Return the calculated resistance class\n        return resistance", "entry_point": "resistance", "input": "'', {'x': [1, 2], 'y': []}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lowandrew/OLCTools/blob/88aa90ac85f84d0bbeb03e43c29b0a9d36e4ce2a/accessoryFunctions/resistance.py#L163-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033891", "code": "def make_c_header(name, front, body):\n    \"\"\"\n    Build a C header from the front and body.\n    \"\"\"\n    return \"\"\"\n{0}\n\n\n# ifndef _GU_ZHENGXIONG_{1}_H\n# define _GU_ZHENGXIONG_{1}_H\n\n\n{2}\n\n\n# endif /* {3}.h */\n    \"\"\".strip().format(front, name.upper(), body, name) + '\\n'", "entry_point": "make_c_header", "input": "'abc', ['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "\"['a', 'b', 'c']\\n\\n\\n# ifndef _GU_ZHENGXIONG_ABC_H\\n# define _GU_ZHENGXIONG_ABC_H\\n\\n\\n['apple', 'banana', 'cherry']\\n\\n\\n# endif /* abc.h */\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NoviceLive/intellicoder/blob/6cac5ebfce65c370dbebe47756a1789b120ef982/intellicoder/sources.py#L77-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033892", "code": "def list_to_json(source_list):\n    \"\"\"\n    Serialise all the items in source_list to json\n    \"\"\"\n    result = []\n    for item in source_list:\n        result.append(item.to_json())\n    return result", "entry_point": "list_to_json", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aquatix/ns-api/blob/9b3379f8df6217132f457c4363457c16321c2448/ns_api.py#L81-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033893", "code": "def list_diff(list_a, list_b):\n    \"\"\"\n    Return the items from list_b that differ from list_a\n    \"\"\"\n    result = []\n    for item in list_b:\n        if not item in list_a:\n            result.append(item)\n    return result", "entry_point": "list_diff", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aquatix/ns-api/blob/9b3379f8df6217132f457c4363457c16321c2448/ns_api.py#L126-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033894", "code": "def list_same(list_a, list_b):\n    \"\"\"\n    Return the items from list_b that are also on list_a\n    \"\"\"\n    result = []\n    for item in list_b:\n        if item in list_a:\n            result.append(item)\n    return result", "entry_point": "list_same", "input": "[1, 2, 3], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aquatix/ns-api/blob/9b3379f8df6217132f457c4363457c16321c2448/ns_api.py#L137-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033895", "code": "def list_merge(list_a, list_b):\n    \"\"\"\n    Merge two lists without duplicating items\n\n    Args:\n      list_a: list\n      list_b: list\n    Returns:\n      New list with deduplicated items from list_a and list_b\n    \"\"\"\n    #return list(collections.OrderedDict.fromkeys(list_a + list_b))\n    #result = list(list_b)\n    result = []\n    for item in list_a:\n        if not item in result:\n            result.append(item)\n    for item in list_b:\n        if not item in result:\n            result.append(item)\n    return result", "entry_point": "list_merge", "input": "[], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aquatix/ns-api/blob/9b3379f8df6217132f457c4363457c16321c2448/ns_api.py#L148-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033896", "code": "def _is_output(part):\n    \"\"\" Returns whether the given part represents an output variable. \"\"\"\n    if part[0].lower() == 'o':\n        return True\n    elif part[0][:2].lower() == 'o:':\n        return True\n    elif part[0][:2].lower() == 'o.':\n        return True\n    else:\n        return False", "entry_point": "_is_output", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TorkamaniLab/metapipe/blob/15592e5b0c217afb00ac03503f8d0d7453d4baf4/metapipe/models/command_template_factory.py#L182-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033897", "code": "def parse_image_name(name):\r\n    \"\"\"\r\n    parse the image name into three element tuple, like below:\r\n    (repository, name, version)\r\n    :param name: `class`:`str`, name\r\n    :return: (repository, name, version)\r\n    \"\"\"\r\n    name = name or \"\"\r\n    if '/' in name:\r\n        repository, other = name.split('/')\r\n    else:\r\n        repository, other = None, name\r\n\r\n    if ':' in other:\r\n        name, version = other.split(':')\r\n    else:\r\n        name, version = other, 'latest'\r\n\r\n    return repository, name, version", "entry_point": "parse_image_name", "input": "''", "output": "(None, '', 'latest')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/by46/simplekit/blob/33f3ce6de33accc185e1057f096af41859db5976/simplekit/docker/utils.py#L48-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033898", "code": "def strip(value):\n    \"\"\"\n    REMOVE WHITESPACE (INCLUDING CONTROL CHARACTERS)\n    \"\"\"\n    if not value or (ord(value[0]) > 32 and ord(value[-1]) > 32):\n        return value\n\n    s = 0\n    e = len(value)\n    while s < e:\n        if ord(value[s]) > 32:\n            break\n        s += 1\n    else:\n        return \"\"\n\n    for i in reversed(range(s, e)):\n        if ord(value[i]) > 32:\n            return value[s:i + 1]\n\n    return \"\"", "entry_point": "strip", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/mo-logs/blob/0971277ac9caf28a755b766b70621916957d4fea/mo_logs/strings.py#L319-L339", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033899", "code": "def refractory(times, refract=0.002):\n\t\"\"\"Removes spikes in times list that do not satisfy refractor period\n\n\t:param times: list(float) of spike times in seconds\n\t:type times: list(float)\n\t:param refract: Refractory period in seconds\n\t:type refract: float\n\t:returns: list(float) of spike times in seconds\n\n\tFor every interspike interval < refract, \n\tremoves the second spike time in list and returns the result\"\"\"\n\ttimes_refract = []\n\ttimes_refract.append(times[0])\n\tfor i in range(1,len(times)):\n\t\tif times_refract[-1]+refract <= times[i]:\n\t\t\ttimes_refract.append(times[i])        \n\treturn times_refract", "entry_point": "refractory", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "[[1, 2], [3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfors-lab/sparkle/blob/5fad1cf2bec58ec6b15d91da20f6236a74826110/sparkle/tools/spikestats.py#L4-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033900", "code": "def firing_rate(spike_times, window_size=None):\n    \"\"\"Calculate the firing rate of spikes\n\n    :param spike_times: times of spike instances\n    :type spike_times: list\n    :param window_size: length of time to use to determine rate.\n    If none, uses time from first to last spike in spike_times\n    :type window_size: float\n    \"\"\"\n    if len(spike_times) == 0:\n        return 0\n\n    if window_size is None:\n        if len(spike_times) > 1:\n            window_size = spike_times[-1] - spike_times[0]\n        elif len(spike_times) > 0:\n            # Only one spike, and no window - what to do?\n            window_size = 1\n        else:\n            window_size = 0\n\n    rate = window_size/len(spike_times)\n    return rate", "entry_point": "firing_rate", "input": "[[1, 2], [3], []], 5", "output": "1.6666666666666667", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfors-lab/sparkle/blob/5fad1cf2bec58ec6b15d91da20f6236a74826110/sparkle/tools/spikestats.py#L123-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033901", "code": "def interleaveblastresults(query, subject):\n        \"\"\"\n        Creates an interleaved string that resembles BLAST sequence comparisons\n        :param query: Query sequence\n        :param subject: Subject sequence\n        :return: Properly formatted BLAST-like sequence comparison\n        \"\"\"\n        # Initialise strings to hold the matches, and the final BLAST-formatted string\n        matchstring = ''\n        blaststring = ''\n        # Iterate through the query\n        for i, bp in enumerate(query):\n            # If the current base in the query is identical to the corresponding base in the reference, append a '|'\n            # to the match string, otherwise, append a ' '\n            if bp == subject[i]:\n                matchstring += '|'\n            else:\n                matchstring += ' '\n        # Set a variable to store the progress through the sequence\n        prev = 0\n        # Iterate through the query, from start to finish in steps of 60 bp\n        for j in range(0, len(query), 60):\n            # BLAST results string. The components are: current position (padded to four characters), 'OLC', query\n            # sequence, \\n, matches, \\n, 'ref', subject sequence. Repeated until all the sequence data are present.\n            \"\"\"\n            0000 OLC ATGAAGAAGATATTTGTAGCGGCTTTATTTGCTTTTGTTTCTGTTAATGCAATGGCAGCT\n                     ||||||||||| ||| | |||| ||||||||| || ||||||||||||||||||||||||\n                 ref ATGAAGAAGATGTTTATGGCGGTTTTATTTGCATTAGTTTCTGTTAATGCAATGGCAGCT\n            0060 OLC GATTGTGCAAAAGGTAAAATTGAGTTCTCTAAGTATAATGAGAATGATACATTCACAGTA\n                     ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n                 ref GATTGTGCAAAAGGTAAAATTGAGTTCTCTAAGTATAATGAGAATGATACATTCACAGTA\n            \"\"\"\n            blaststring += '{} OLC {}\\n         {}\\n     ref {}\\n' \\\n                .format('{:04d}'.format(j), query[prev:j + 60], matchstring[prev:j + 60], subject[prev:j + 60])\n            # Update the progress variable\n            prev = j + 60\n        # Return the properly formatted string\n        return blaststring", "entry_point": "interleaveblastresults", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "\"0000 OLC ['a', 'b', 'c']\\n            \\n     ref ['apple', 'banana', 'cherry']\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lowandrew/OLCTools/blob/88aa90ac85f84d0bbeb03e43c29b0a9d36e4ce2a/spadespipeline/GeneSeekr_tblastx.py#L636-L673", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033902", "code": "def transmogrify(l):\n  \"\"\"Fit a flat list into a treeable object.\"\"\"\n  d = {l[0]: {}}\n  tmp = d\n  for c in l:\n    tmp[c] = {}\n    tmp = tmp[c]\n  return d", "entry_point": "transmogrify", "input": "['a', 'b', 'c']", "output": "{'a': {'b': {'c': {}}}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sholsapp/py509/blob/83bd6786a8ec1543b66c42ea5523e611c3e8dc5a/py509/utils.py#L8-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033903", "code": "def under_attack(col, queens):\n        \"\"\"Checks if queen is under attack\n\n        :param col: Column number\n        :param queens: list of queens\n        :return: True iff queen is under attack\n        \"\"\"\n        left = right = col\n        for _, column in reversed(queens):\n            left, right = left - 1, right + 1\n            if column in (left, col, right):\n                return True\n        return False", "entry_point": "under_attack", "input": "['apple', 'banana', 'cherry'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/maths/problems.py#L13-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033904", "code": "def get_inner_keys(dictionary):\n    \"\"\"Gets 2nd-level dictionary keys\n\n    :param dictionary: dict\n    :return: inner keys\n    \"\"\"\n\n    keys = []\n\n    for key in dictionary.keys():\n        inner_keys = dictionary[key].keys()\n        keys += [\n            key + \" \" + inner_key  # concatenate\n            for inner_key in inner_keys\n        ]\n\n    return keys", "entry_point": "get_inner_keys", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/data/dicts.py#L26-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033905", "code": "def valid(number):\n    \"\"\"\n    Returns true if the number string is luhn valid, and false otherwise.  The\n    number string passed to the function must contain only numeric characters\n    otherwise behavior is undefined.\n    \"\"\"\n    checksum = 0\n\n    number_len = len(number)\n    offset = ord('0')\n\n    i = number_len - 1\n    while i >= 0:\n      n = ord(number[i]) - offset\n      checksum += n\n      i -= 2\n\n    i = number_len - 2\n    while i >= 0:\n      n = ord(number[i]) - offset\n      n *= 2\n      if n > 9:\n          n -= 9\n      checksum += n\n      i -= 2\n\n    return checksum%10 == 0", "entry_point": "valid", "input": "()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/luhnmod10/python/blob/7cd1e9e4029dd364a10435bd80ed48a2cc180491/luhnmod10/__init__.py#L1-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033906", "code": "def hash_func(name):\n    \"\"\"Hash the string using a hash algorithm found in\n    tombkeeper/Shellcode_Template_in_C.\n    \"\"\"\n    ret = 0\n    for char in name:\n        ret = ((ret << 5) + ret + ord(char)) & 0xffffffff\n    return hex(ret)", "entry_point": "hash_func", "input": "'walnut thistle harbour'", "output": "'0x6d9f062b'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NoviceLive/intellicoder/blob/6cac5ebfce65c370dbebe47756a1789b120ef982/intellicoder/utils.py#L238-L245", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033907", "code": "def format_names(raw):\n    \"\"\"Format a string representing the names contained in the files.\n    \"\"\"\n    if raw:\n        raw = [\n            '{}:\\n{}'.format(\n                header.lower(), ' '.join(func[0] for func in funcs)\n            )\n            for header, funcs in raw\n        ]\n        return '\\n'.join(raw)\n    return ''", "entry_point": "format_names", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NoviceLive/intellicoder/blob/6cac5ebfce65c370dbebe47756a1789b120ef982/intellicoder/intellisense/formatters.py#L75-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033908", "code": "def format_kinds(raw):\n    \"\"\"Format a string representing the kinds.\"\"\"\n    output = ' '.join('{} {}'.format(*kind) for kind in raw if kind)\n    return output", "entry_point": "format_kinds", "input": "['apple', 'banana', 'cherry']", "output": "'a p b a c h'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NoviceLive/intellicoder/blob/6cac5ebfce65c370dbebe47756a1789b120ef982/intellicoder/intellisense/formatters.py#L89-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033909", "code": "def remove_path_segments(segments, removes):\n    \"\"\"Removes the removes from the tail of segments.\n\n    Examples::\n        >>> # '/a/b/c' - 'b/c' == '/a/'\n        >>> assert remove_path_segments(['', 'a', 'b', 'c'], ['b', 'c']) == ['', 'a', '']\n        >>> # '/a/b/c' - '/b/c' == '/a\n        >>> assert remove_path_segments(['', 'a', 'b', 'c'], ['', 'b', 'c']) == ['', 'a']\n\n    :param segments:  :class:`list`, a list of the path segment\n    :param removes:  :class:`list`, a list of the path segment\n    :return:  :class:`list`, The list of all remaining path segments after all segments\n        in ``removes`` have been removed from the end of ``segments``. If no segment\n        from ``removes`` were removed from the ``segments``, the ``segments`` is\n        return unmodified.\n\n    \"\"\"\n\n    if segments == ['']:\n        segments.append('')\n    if removes == ['']:\n        removes.append('')\n\n    if segments == removes:\n        ret = []\n    elif len(removes) > len(segments):\n        ret = segments\n    else:\n        # TODO(benjamin): incomplete\n        removes2 = list(removes)\n        if len(removes) > 1 and removes[0] == '':\n            removes2.pop(0)\n\n        if removes2 and removes2 == segments[-1 * len(removes2):]:\n            ret = segments[:len(segments) - len(removes2)]\n            if removes[0] != '' and ret:\n                ret.append('')\n        else:\n            ret = segments\n    return ret", "entry_point": "remove_path_segments", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/by46/simplekit/blob/33f3ce6de33accc185e1057f096af41859db5976/simplekit/url/path.py#L9-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033910", "code": "def get_top_namespace(node):\n    \"\"\"Return the top namespace of the given node\n\n    If the node has not namespace (only root), \":\" is returned.\n    Else the top namespace (after root) is returned\n\n    :param node: the node to query\n    :type node: str\n    :returns: The top level namespace.\n    :rtype: str\n    :raises: None\n    \"\"\"\n    name = node.rsplit(\"|\", 1)[-1]  # get the node name, in case we get a dagpath\n    name = name.lstrip(\":\")  # strip the root namespace\n    if \":\" not in name:  # if there is no namespace return root\n        return \":\"\n    else:\n        # get the top namespace\n        return name.partition(\":\")[0]", "entry_point": "get_top_namespace", "input": "'abc'", "output": "':'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JukeboxPipeline/jukeboxmaya/blob/c8d6318d53cdb5493453c4a6b65ef75bdb2d5f2c/src/jukeboxmaya/common.py#L68-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033911", "code": "def parse_url(url):\n        \"\"\"Parses correctly url\n\n        :param url: url to parse\n        \"\"\"\n        parsed = url\n\n        if not url.startswith(\"http://\") and not url.startswith(\n                \"https://\"):  # if url is like www.yahoo.com\n            parsed = \"http://\" + parsed\n        elif url.startswith(\"https://\"):\n            parsed = parsed[8:]\n            parsed = \"http://\" + parsed\n\n        index_hash = parsed.rfind(\"#\")  # remove trailing #\n        index_slash = parsed.rfind(\"/\")\n        if index_hash > index_slash:\n            parsed = parsed[0: index_hash]\n\n        return parsed", "entry_point": "parse_url", "input": "'walnut thistle harbour'", "output": "'http://walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/internet/web.py#L128-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033912", "code": "def get_average_length_of_string(strings):\n    \"\"\"Computes average length of words\n\n    :param strings: list of words\n    :return: Average length of word on list\n    \"\"\"\n    if not strings:\n        return 0\n\n    return sum(len(word) for word in strings) / len(strings)", "entry_point": "get_average_length_of_string", "input": "'AbC dEf'", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/strings/utils.py#L33-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033913", "code": "def _trim_css_to_bounds(css, image_shape):\n    \"\"\"\n    Make sure a tuple in (top, right, bottom, left) order is within the bounds of the image.\n\n    :param css:  plain tuple representation of the rect in (top, right, bottom, left) order\n    :param image_shape: numpy shape of the image array\n    :return: a trimmed plain tuple representation of the rect in (top, right, bottom, left) order\n    \"\"\"\n    return max(css[0], 0), min(css[1], image_shape[1]), min(css[2], image_shape[0]), max(css[3], 0)", "entry_point": "_trim_css_to_bounds", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "(5, 3, 1, 4)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L52-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033914", "code": "def to_str(value):\n    \"\"\"\n    A wrapper over str(), but converts bool values to lower case strings.\n    If None is given, just returns None, instead of converting it to string \"None\".\n    \"\"\"\n    if isinstance(value, bool):\n        return str(value).lower()\n    elif value is None:\n        return value\n    else:\n        return str(value)", "entry_point": "to_str", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/spark/blob/618d6bff71073c8c93501ab7392c3cc579730f0b/python/pyspark/sql/readwriter.py#L34-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033915", "code": "def _check_is_max_context(doc_spans, cur_span_index, position):\n    \"\"\"Check if this is the 'max context' doc span for the token.\"\"\"\n\n    # Because of the sliding window approach taken to scoring documents, a single\n    # token can appear in multiple documents. E.g.\n    #  Doc: the man went to the store and bought a gallon of milk\n    #  Span A: the man went to the\n    #  Span B: to the store and bought\n    #  Span C: and bought a gallon of\n    #  ...\n    #\n    # Now the word 'bought' will have two scores from spans B and C. We only\n    # want to consider the score with \"maximum context\", which we define as\n    # the *minimum* of its left and right context (the *sum* of left and\n    # right context will always be the same, of course).\n    #\n    # In the example the maximum context for 'bought' would be span C since\n    # it has 1 left context and 3 right context, while span B has 4 left context\n    # and 0 right context.\n    best_score = None\n    best_span_index = None\n    for (span_index, doc_span) in enumerate(doc_spans):\n        end = doc_span.start + doc_span.length - 1\n        if position < doc_span.start:\n            continue\n        if position > end:\n            continue\n        num_left_context = position - doc_span.start\n        num_right_context = end - position\n        score = min(num_left_context, num_right_context) + 0.01 * doc_span.length\n        if best_score is None or score > best_score:\n            best_score = score\n            best_span_index = span_index\n\n    return cur_span_index == best_span_index", "entry_point": "_check_is_max_context", "input": "[], 5, []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/huggingface/pytorch-pretrained-BERT/blob/b832d5bb8a6dfc5965015b828e577677eace601e/examples/run_squad.py#L400-L434", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033916", "code": "def whitespace_tokenize(text):\n    \"\"\"Runs basic whitespace cleaning and splitting on a piece of text.\"\"\"\n    text = text.strip()\n    if not text:\n        return []\n    tokens = text.split()\n    return tokens", "entry_point": "whitespace_tokenize", "input": "'abc'", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/huggingface/pytorch-pretrained-BERT/blob/b832d5bb8a6dfc5965015b828e577677eace601e/pytorch_pretrained_bert/tokenization.py#L65-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033917", "code": "def _trim_front(strings):\n    \"\"\"\n    Trims zeros and decimal points.\n    \"\"\"\n    trimmed = strings\n    while len(strings) > 0 and all(x[0] == ' ' for x in trimmed):\n        trimmed = [x[1:] for x in trimmed]\n    return trimmed", "entry_point": "_trim_front", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/base.py#L5393-L5400", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033918", "code": "def is_sequence(obj):\n    \"\"\"\n    Check if the object is a sequence of objects.\n    String types are not included as sequences here.\n\n    Parameters\n    ----------\n    obj : The object to check\n\n    Returns\n    -------\n    is_sequence : bool\n        Whether `obj` is a sequence of objects.\n\n    Examples\n    --------\n    >>> l = [1, 2, 3]\n    >>>\n    >>> is_sequence(l)\n    True\n    >>> is_sequence(iter(l))\n    False\n    \"\"\"\n\n    try:\n        iter(obj)  # Can iterate over it.\n        len(obj)   # Has a length associated with it.\n        return not isinstance(obj, (str, bytes))\n    except (TypeError, AttributeError):\n        return False", "entry_point": "is_sequence", "input": "['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/inference.py#L462-L491", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033919", "code": "def justify(texts, max_len, mode='right'):\n    \"\"\"\n    Perform ljust, center, rjust against string or list-like\n    \"\"\"\n    if mode == 'left':\n        return [x.ljust(max_len) for x in texts]\n    elif mode == 'center':\n        return [x.center(max_len) for x in texts]\n    else:\n        return [x.rjust(max_len) for x in texts]", "entry_point": "justify", "input": "'', ['a', 'b', 'c'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L47-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033920", "code": "def format_timedelta_ticks(x, pos, n_decimals):\n    \"\"\"\n    Convert seconds to 'D days HH:MM:SS.F'\n    \"\"\"\n    s, ns = divmod(x, 1e9)\n    m, s = divmod(s, 60)\n    h, m = divmod(m, 60)\n    d, h = divmod(h, 24)\n    decimals = int(ns * 10**(n_decimals - 9))\n    s = r'{:02d}:{:02d}:{:02d}'.format(int(h), int(m), int(s))\n    if n_decimals > 0:\n        s += '.{{:0{:0d}d}}'.format(n_decimals).format(decimals)\n    if d != 0:\n        s = '{:d} days '.format(int(d)) + s\n    return s", "entry_point": "format_timedelta_ticks", "input": "False, {'a': 1, 'b': 2}, 0", "output": "'00:00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_timeseries.py#L289-L303", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033921", "code": "def convert_missing_indexer(indexer):\n    \"\"\"\n    reverse convert a missing indexer, which is a dict\n    return the scalar indexer and a boolean indicating if we converted\n    \"\"\"\n\n    if isinstance(indexer, dict):\n\n        # a missing key (but not a tuple indexer)\n        indexer = indexer['key']\n\n        if isinstance(indexer, bool):\n            raise KeyError(\"cannot use a single bool to index into setitem\")\n        return indexer, True\n\n    return indexer, False", "entry_point": "convert_missing_indexer", "input": "5", "output": "(5, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexing.py#L2555-L2570", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033922", "code": "def convert_from_missing_indexer_tuple(indexer, axes):\n    \"\"\"\n    create a filtered indexer that doesn't have any missing indexers\n    \"\"\"\n\n    def get_indexer(_i, _idx):\n        return (axes[_i].get_loc(_idx['key']) if isinstance(_idx, dict) else\n                _idx)\n\n    return tuple(get_indexer(_i, _idx) for _i, _idx in enumerate(indexer))", "entry_point": "convert_from_missing_indexer_tuple", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "(5, 3, 1, 4)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexing.py#L2573-L2582", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033923", "code": "def _get_distinct_objs(objs):\n    \"\"\"\n    Return a list with distinct elements of \"objs\" (different ids).\n    Preserves order.\n    \"\"\"\n    ids = set()\n    res = []\n    for obj in objs:\n        if not id(obj) in ids:\n            ids.add(id(obj))\n            res.append(obj)\n    return res", "entry_point": "_get_distinct_objs", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L73-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033924", "code": "def _validate_usecols_names(usecols, names):\n    \"\"\"\n    Validates that all usecols are present in a given\n    list of names. If not, raise a ValueError that\n    shows what usecols are missing.\n\n    Parameters\n    ----------\n    usecols : iterable of usecols\n        The columns to validate are present in names.\n    names : iterable of names\n        The column names to check against.\n\n    Returns\n    -------\n    usecols : iterable of usecols\n        The `usecols` parameter if the validation succeeds.\n\n    Raises\n    ------\n    ValueError : Columns were missing. Error message will list them.\n    \"\"\"\n    missing = [c for c in usecols if c not in names]\n    if len(missing) > 0:\n        raise ValueError(\n            \"Usecols do not match columns, \"\n            \"columns expected but not found: {missing}\".format(missing=missing)\n        )\n\n    return usecols", "entry_point": "_validate_usecols_names", "input": "[], ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/parsers.py#L1221-L1250", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033925", "code": "def _stringify_na_values(na_values):\n    \"\"\" return a stringified and numeric for these values \"\"\"\n    result = []\n    for x in na_values:\n        result.append(str(x))\n        result.append(x)\n        try:\n            v = float(x)\n\n            # we are like 999 here\n            if v == int(v):\n                v = int(v)\n                result.append(\"{value}.0\".format(value=v))\n                result.append(str(v))\n\n            result.append(v)\n        except (TypeError, ValueError, OverflowError):\n            pass\n        try:\n            result.append(int(x))\n        except (TypeError, ValueError, OverflowError):\n            pass\n    return set(result)", "entry_point": "_stringify_na_values", "input": "[-1, 0, 1, 2]", "output": "{0, 1, '1.0', 2, '2.0', '0.0', '2', '0', '-1.0', '1', -1, '-1'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/parsers.py#L3425-L3447", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033926", "code": "def is_uniform_join_units(join_units):\n    \"\"\"\n    Check if the join units consist of blocks of uniform type that can\n    be concatenated using Block.concat_same_type instead of the generic\n    concatenate_join_units (which uses `_concat._concat_compat`).\n\n    \"\"\"\n    return (\n        # all blocks need to have the same type\n        all(type(ju.block) is type(join_units[0].block) for ju in join_units) and  # noqa\n        # no blocks that would get missing values (can lead to type upcasts)\n        # unless we're an extension dtype.\n        all(not ju.is_na or ju.block.is_extension for ju in join_units) and\n        # no blocks with indexers (as then the dimensions do not fit)\n        all(not ju.indexers for ju in join_units) and\n        # disregard Panels\n        all(ju.block.ndim <= 2 for ju in join_units) and\n        # only use this path when there is something to concatenate\n        len(join_units) > 1)", "entry_point": "is_uniform_join_units", "input": "()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/internals/concat.py#L366-L384", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033927", "code": "def _pad_bytes_new(name, length):\n    \"\"\"\n    Takes a bytes instance and pads it with null bytes until it's length chars.\n    \"\"\"\n    if isinstance(name, str):\n        name = bytes(name, 'utf-8')\n    return name + b'\\x00' * (length - len(name))", "entry_point": "_pad_bytes_new", "input": "'AbC dEf', 10", "output": "b'AbC dEf\\x00\\x00\\x00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/stata.py#L2477-L2483", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033928", "code": "def _get_default_annual_spacing(nyears):\n    \"\"\"\n    Returns a default spacing between consecutive ticks for annual data.\n    \"\"\"\n    if nyears < 11:\n        (min_spacing, maj_spacing) = (1, 1)\n    elif nyears < 20:\n        (min_spacing, maj_spacing) = (1, 2)\n    elif nyears < 50:\n        (min_spacing, maj_spacing) = (1, 5)\n    elif nyears < 100:\n        (min_spacing, maj_spacing) = (5, 10)\n    elif nyears < 200:\n        (min_spacing, maj_spacing) = (5, 25)\n    elif nyears < 600:\n        (min_spacing, maj_spacing) = (10, 50)\n    else:\n        factor = nyears // 1000 + 1\n        (min_spacing, maj_spacing) = (factor * 20, factor * 100)\n    return (min_spacing, maj_spacing)", "entry_point": "_get_default_annual_spacing", "input": "-1.5", "output": "(1, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_converter.py#L537-L556", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033929", "code": "def _gen_eval_kwargs(name):\n    \"\"\"\n    Find the keyword arguments to pass to numexpr for the given operation.\n\n    Parameters\n    ----------\n    name : str\n\n    Returns\n    -------\n    eval_kwargs : dict\n\n    Examples\n    --------\n    >>> _gen_eval_kwargs(\"__add__\")\n    {}\n\n    >>> _gen_eval_kwargs(\"rtruediv\")\n    {'reversed': True, 'truediv': True}\n    \"\"\"\n    kwargs = {}\n\n    # Series and Panel appear to only pass __add__, __radd__, ...\n    # but DataFrame gets both these dunder names _and_ non-dunder names\n    # add, radd, ...\n    name = name.replace('__', '')\n\n    if name.startswith('r'):\n        if name not in ['radd', 'rand', 'ror', 'rxor']:\n            # Exclude commutative operations\n            kwargs['reversed'] = True\n\n    if name in ['truediv', 'rtruediv']:\n        kwargs['truediv'] = True\n\n    if name in ['ne']:\n        kwargs['masker'] = True\n\n    return kwargs", "entry_point": "_gen_eval_kwargs", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/ops.py#L215-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033930", "code": "def is_null_slice(obj):\n    \"\"\"\n    We have a null slice.\n    \"\"\"\n    return (isinstance(obj, slice) and obj.start is None and\n            obj.stop is None and obj.step is None)", "entry_point": "is_null_slice", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/common.py#L292-L297", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033931", "code": "def is_full_slice(obj, l):\n    \"\"\"\n    We have a full length slice.\n    \"\"\"\n    return (isinstance(obj, slice) and obj.start == 0 and obj.stop == l and\n            obj.step is None)", "entry_point": "is_full_slice", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/common.py#L308-L313", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033932", "code": "def _build_xpath_expr(attrs):\n    \"\"\"Build an xpath expression to simulate bs4's ability to pass in kwargs to\n    search for attributes when using the lxml parser.\n\n    Parameters\n    ----------\n    attrs : dict\n        A dict of HTML attributes. These are NOT checked for validity.\n\n    Returns\n    -------\n    expr : unicode\n        An XPath expression that checks for the given HTML attributes.\n    \"\"\"\n    # give class attribute as class_ because class is a python keyword\n    if 'class_' in attrs:\n        attrs['class'] = attrs.pop('class_')\n\n    s = [\"@{key}={val!r}\".format(key=k, val=v) for k, v in attrs.items()]\n    return '[{expr}]'.format(expr=' and '.join(s))", "entry_point": "_build_xpath_expr", "input": "{}", "output": "'[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/html.py#L601-L620", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033933", "code": "def _fill_mi_header(row, control_row):\n    \"\"\"Forward fill blank entries in row but only inside the same parent index.\n\n    Used for creating headers in Multiindex.\n    Parameters\n    ----------\n    row : list\n        List of items in a single row.\n    control_row : list of bool\n        Helps to determine if particular column is in same parent index as the\n        previous value. Used to stop propagation of empty cells between\n        different indexes.\n\n    Returns\n    ----------\n    Returns changed row and control_row\n    \"\"\"\n    last = row[0]\n    for i in range(1, len(row)):\n        if not control_row[i]:\n            last = row[i]\n\n        if row[i] == '' or row[i] is None:\n            row[i] = last\n        else:\n            control_row[i] = False\n            last = row[i]\n\n    return row, control_row", "entry_point": "_fill_mi_header", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "([1, 2, 3], ['a', False, False])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/excel/_util.py#L176-L204", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033934", "code": "def get_level_lengths(levels, sentinel=''):\n    \"\"\"For each index in each level the function returns lengths of indexes.\n\n    Parameters\n    ----------\n    levels : list of lists\n        List of values on for level.\n    sentinel : string, optional\n        Value which states that no new index starts on there.\n\n    Returns\n    ----------\n    Returns list of maps. For each level returns map of indexes (key is index\n    in row and value is length of index).\n    \"\"\"\n    if len(levels) == 0:\n        return []\n\n    control = [True] * len(levels[0])\n\n    result = []\n    for level in levels:\n        last_index = 0\n\n        lengths = {}\n        for i, key in enumerate(level):\n            if control[i] and key == sentinel:\n                pass\n            else:\n                control[i] = False\n                lengths[last_index] = i - last_index\n                last_index = i\n\n        lengths[last_index] = len(level) - last_index\n\n        result.append(lengths)\n\n    return result", "entry_point": "get_level_lengths", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "[{0: 1, 1: 1}, {0: 1}, {0: 0}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/format.py#L1603-L1640", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033935", "code": "def to_str(s):\n    \"\"\"\n    Convert bytes and non-string into Python 3 str\n    \"\"\"\n    if isinstance(s, bytes):\n        s = s.decode('utf-8')\n    elif not isinstance(s, str):\n        s = str(s)\n    return s", "entry_point": "to_str", "input": "['apple', 'banana', 'cherry']", "output": "\"['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/compat/__init__.py#L44-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033936", "code": "def _make_suffix(cov):\n    \"\"\"Create a suffix for nbval data file depending on pytest-cov config.\"\"\"\n    # Check if coverage object has data_suffix:\n    if cov and cov.data_suffix is not None:\n        # If True, the suffix will be autogenerated by coverage.py.\n        # The suffixed data files will be automatically combined later.\n        if cov.data_suffix is True:\n            return True\n        # Has a suffix, but we add our own extension\n        return cov.data_suffix + '.nbval'\n    return 'nbval'", "entry_point": "_make_suffix", "input": "[]", "output": "'nbval'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fastai/fastai/blob/9fb84a5cdefe5a766cdb792b8f5d8971737b7e67/docs_src/nbval/cover.py#L109-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033937", "code": "def get_insert_idx(pos_dict, name):\n    \"Return the position to insert a given function doc in a notebook.\"\n    keys,i = list(pos_dict.keys()),0\n    while i < len(keys) and str.lower(keys[i]) < str.lower(name): i+=1\n    if i == len(keys): return -1\n    else:              return pos_dict[keys[i]]", "entry_point": "get_insert_idx", "input": "{}, 'walnut thistle harbour'", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fastai/fastai/blob/9fb84a5cdefe5a766cdb792b8f5d8971737b7e67/fastai/gen_doc/gen_notebooks.py#L162-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033938", "code": "def update_pos(pos_dict, start_key, nbr=2):\n    \"Update the `pos_dict` by moving all positions after `start_key` by `nbr`.\"\n    for key,idx in pos_dict.items():\n        if str.lower(key) >= str.lower(start_key): pos_dict[key] += nbr\n    return pos_dict", "entry_point": "update_pos", "input": "{}, [5, 3, 1, 4], [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fastai/fastai/blob/9fb84a5cdefe5a766cdb792b8f5d8971737b7e67/fastai/gen_doc/gen_notebooks.py#L169-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033939", "code": "def compose(im, y, fns):\n    \"\"\" Apply a collection of transformation functions :fns: to images \"\"\"\n    for fn in fns:\n        #pdb.set_trace()\n        im, y =fn(im, y)\n    return im if y is None else (im, y)", "entry_point": "compose", "input": "{'x': [1, 2], 'y': []}, 'AbC dEf', ()", "output": "({'x': [1, 2], 'y': []}, 'AbC dEf')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fastai/fastai/blob/9fb84a5cdefe5a766cdb792b8f5d8971737b7e67/old/fastai/transforms.py#L619-L624", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033940", "code": "def transform_streams_for_comparison(outputs):\n    \"\"\"Makes failure output for streams better by having key be the stream name\"\"\"\n    new_outputs = []\n    for output in outputs:\n        if (output.output_type == 'stream'):\n            # Transform output\n            new_outputs.append({\n                'output_type': 'stream',\n                output.name: output.text,\n            })\n        else:\n            new_outputs.append(output)\n    return new_outputs", "entry_point": "transform_streams_for_comparison", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fastai/fastai/blob/9fb84a5cdefe5a766cdb792b8f5d8971737b7e67/docs_src/nbval/plugin.py#L834-L846", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033941", "code": "def join_host_port(host, port):\n    \"\"\"Joins a hostname and port together.\n\n    This is a minimal implementation intended to cope with IPv6 literals. For\n    example, _join_host_port('::1', 80) == '[::1]:80'.\n\n    :Args:\n        - host - A hostname.\n        - port - An integer port.\n\n    \"\"\"\n    if ':' in host and not host.startswith('['):\n        return '[%s]:%d' % (host, port)\n    return '%s:%d' % (host, port)", "entry_point": "join_host_port", "input": "(1, 2), 2.0", "output": "'(1, 2):2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SeleniumHQ/selenium/blob/df40c28b41d4b3953f90eaff84838a9ac052b84a/py/selenium/webdriver/common/utils.py#L84-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033942", "code": "def golds_to_gold_tuples(docs, golds):\n    \"\"\"Get out the annoying 'tuples' format used by begin_training, given the\n    GoldParse objects.\"\"\"\n    tuples = []\n    for doc, gold in zip(docs, golds):\n        text = doc.text\n        ids, words, tags, heads, labels, iob = zip(*gold.orig_annot)\n        sents = [((ids, words, tags, heads, labels, iob), [])]\n        tuples.append((text, sents))\n    return tuples", "entry_point": "golds_to_gold_tuples", "input": "['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/explosion/spaCy/blob/8ee4100f8ffb336886208a1ea827bf4c745e2709/bin/ud/ud_train.py#L173-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033943", "code": "def is_writable_attr(ext):\n    \"\"\"Check if an extension attribute is writable.\n    ext (tuple): The (default, getter, setter, method) tuple available  via\n        {Doc,Span,Token}.get_extension.\n    RETURNS (bool): Whether the attribute is writable.\n    \"\"\"\n    default, method, getter, setter = ext\n    # Extension is writable if it has a setter (getter + setter), if it has a\n    # default value (or, if its default value is none, none of the other values\n    # should be set).\n    if setter is not None or default is not None or all(e is None for e in ext):\n        return True\n    return False", "entry_point": "is_writable_attr", "input": "[5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/explosion/spaCy/blob/8ee4100f8ffb336886208a1ea827bf4c745e2709/spacy/tokens/underscore.py#L90-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033944", "code": "def remove_duplicates_from_list(array):\n    \"Preserves the order of elements in the list\"\n    output = []\n    unique = set()\n    for a in array:\n        if a not in unique:\n            unique.add(a)\n            output.append(a)\n    return output", "entry_point": "remove_duplicates_from_list", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unity-Technologies/ml-agents/blob/37d139af636e4a2351751fbf0f2fca5a9ed7457f/ml-agents/mlagents/trainers/tensorflow_to_barracuda.py#L511-L519", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033945", "code": "def pool_to_HW(shape, data_frmt):\n    \"\"\" Convert from NHWC|NCHW => HW\n    \"\"\"\n    if len(shape) != 4:\n        return shape # Not NHWC|NCHW, return as is\n    if data_frmt == 'NCHW':\n        return [shape[2], shape[3]]\n    return [shape[1], shape[2]]", "entry_point": "pool_to_HW", "input": "[[1, 2], [3], []], []", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unity-Technologies/ml-agents/blob/37d139af636e4a2351751fbf0f2fca5a9ed7457f/ml-agents/mlagents/trainers/tensorflow_to_barracuda.py#L523-L530", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033946", "code": "def dedup(l, suffix='__', case_sensitive=True):\n    \"\"\"De-duplicates a list of string by suffixing a counter\n\n    Always returns the same number of entries as provided, and always returns\n    unique values. Case sensitive comparison by default.\n\n    >>> print(','.join(dedup(['foo', 'bar', 'bar', 'bar', 'Bar'])))\n    foo,bar,bar__1,bar__2,Bar\n    >>> print(','.join(dedup(['foo', 'bar', 'bar', 'bar', 'Bar'], case_sensitive=False)))\n    foo,bar,bar__1,bar__2,Bar__3\n    \"\"\"\n    new_l = []\n    seen = {}\n    for s in l:\n        s_fixed_case = s if case_sensitive else s.lower()\n        if s_fixed_case in seen:\n            seen[s_fixed_case] += 1\n            s += suffix + str(seen[s_fixed_case])\n        else:\n            seen[s_fixed_case] = 0\n        new_l.append(s)\n    return new_l", "entry_point": "dedup", "input": "[1, 2, 3], 'abc', ['apple', 'banana', 'cherry']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-superset/blob/ca2996c78f679260eb79c6008e276733df5fb653/superset/dataframe.py#L39-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033947", "code": "def filter_not_empty_values(value):\n    \"\"\"Returns a list of non empty values or None\"\"\"\n    if not value:\n        return None\n    data = [x for x in value if x]\n    if not data:\n        return None\n    return data", "entry_point": "filter_not_empty_values", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-superset/blob/ca2996c78f679260eb79c6008e276733df5fb653/superset/forms.py#L50-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033948", "code": "def _dimensions_to_values(dimensions):\n        \"\"\"\n        Replace dimensions specs with their `dimension`\n        values, and ignore those without\n        \"\"\"\n        values = []\n        for dimension in dimensions:\n            if isinstance(dimension, dict):\n                if 'extractionFn' in dimension:\n                    values.append(dimension)\n                elif 'dimension' in dimension:\n                    values.append(dimension['dimension'])\n            else:\n                values.append(dimension)\n\n        return values", "entry_point": "_dimensions_to_values", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-superset/blob/ca2996c78f679260eb79c6008e276733df5fb653/superset/connectors/druid/models.py#L1010-L1025", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033949", "code": "def get_timestamp_column(expression, column_name):\n        \"\"\"Postgres is unable to identify mixed case column names unless they\n        are quoted.\"\"\"\n        if expression:\n            return expression\n        elif column_name.lower() != column_name:\n            return f'\"{column_name}\"'\n        return column_name", "entry_point": "get_timestamp_column", "input": "['a', 'b', 'c'], 'a,b,c'", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-superset/blob/ca2996c78f679260eb79c6008e276733df5fb653/superset/db_engine_specs.py#L529-L536", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033950", "code": "def string_to_num(s: str):\n    \"\"\"Converts a string to an int/float\n\n    Returns ``None`` if it can't be converted\n\n    >>> string_to_num('5')\n    5\n    >>> string_to_num('5.2')\n    5.2\n    >>> string_to_num(10)\n    10\n    >>> string_to_num(10.1)\n    10.1\n    >>> string_to_num('this is not a string') is None\n    True\n    \"\"\"\n    if isinstance(s, (int, float)):\n        return s\n    if s.isdigit():\n        return int(s)\n    try:\n        return float(s)\n    except ValueError:\n        return None", "entry_point": "string_to_num", "input": "-1.5", "output": "-1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-superset/blob/ca2996c78f679260eb79c6008e276733df5fb653/superset/utils/core.py#L148-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033951", "code": "def three_sum(array):\n    \"\"\"\n    :param array: List[int]\n    :return: Set[ Tuple[int, int, int] ]\n    \"\"\"\n    res = set()\n    array.sort()\n    for i in range(len(array) - 2):\n        if i > 0 and array[i] == array[i - 1]:\n            continue\n        l, r = i + 1, len(array) - 1\n        while l < r:\n            s = array[i] + array[l] + array[r]\n            if s > 0:\n                r -= 1\n            elif s < 0:\n                l += 1\n            else:\n                # found three sum\n                res.add((array[i], array[l], array[r]))\n\n                # remove duplicates\n                while l < r and array[l] == array[l + 1]:\n                    l += 1\n\n                while l < r and array[r] == array[r - 1]:\n                    r -= 1\n\n                l += 1\n                r -= 1\n    return res", "entry_point": "three_sum", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/three_sum.py#L18-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033952", "code": "def text_justification(words, max_width):\n    '''\n    :type words: list\n    :type max_width: int\n    :rtype: list\n    '''\n    ret = []  # return value\n    row_len = 0  # current length of strs in a row\n    row_words = []  # current words in a row\n    index = 0  # the index of current word in words\n    is_first_word = True  # is current word the first in a row\n    while index < len(words):\n        while row_len <= max_width and index < len(words):\n            if len(words[index]) > max_width:\n                raise ValueError(\"there exists word whose length is larger than max_width\")\n            tmp = row_len\n            row_words.append(words[index])\n            tmp += len(words[index])\n            if not is_first_word:\n                tmp += 1  # except for the first word, each word should have at least a ' ' before it.\n            if tmp > max_width:\n                row_words.pop()\n                break\n            row_len = tmp\n            index += 1\n            is_first_word = False\n        # here we have already got a row of str , then we should supplement enough ' ' to make sure the length is max_width.\n        row = \"\"\n        # if the row is the last\n        if index == len(words):\n            for word in row_words:\n                row += (word + ' ')\n            row = row[:-1]\n            row += ' ' * (max_width - len(row))\n        # not the last row and more than one word\n        elif len(row_words) != 1:\n            space_num = max_width - row_len\n            space_num_of_each_interval = space_num // (len(row_words) - 1)\n            space_num_rest = space_num - space_num_of_each_interval * (len(row_words) - 1)\n            for j in range(len(row_words)):\n                row += row_words[j]\n                if j != len(row_words) - 1:\n                    row += ' ' * (1 + space_num_of_each_interval)\n                if space_num_rest > 0:\n                    row += ' '\n                    space_num_rest -= 1\n        # row with only one word\n        else:\n            row += row_words[0]\n            row += ' ' * (max_width - len(row))\n        ret.append(row)\n        # after a row , reset those value\n        row_len = 0\n        row_words = []\n        is_first_word = True\n    return ret", "entry_point": "text_justification", "input": "['a', 'b', 'c'], 7", "output": "['a b c  ']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/text_justification.py#L34-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033953", "code": "def cycle_sort(arr):\n    \"\"\"\n    cycle_sort\n    This is based on the idea that the permutations to be sorted\n    can be decomposed into cycles,\n    and the results can be individually sorted by cycling.\n    \n    reference: https://en.wikipedia.org/wiki/Cycle_sort\n    \n    Average time complexity : O(N^2)\n    Worst case time complexity : O(N^2)\n    \"\"\"\n    len_arr = len(arr)\n    # Finding cycle to rotate.\n    for cur in range(len_arr - 1):\n        item = arr[cur]\n\n        # Finding an indx to put items in.\n        index = cur\n        for i in range(cur + 1, len_arr):\n            if arr[i] < item:\n                index += 1\n\n        # Case of there is not a cycle\n        if index == cur:\n            continue\n\n        # Putting the item immediately right after the duplicate item or on the right.\n        while item == arr[index]:\n            index += 1\n        arr[index], item = item, arr[index]\n\n        # Rotating the remaining cycle.\n        while index != cur:\n\n            # Finding where to put the item.\n            index = cur\n            for i in range(cur + 1, len_arr):\n                if arr[i] < item:\n                    index += 1\n\n            # After item is duplicated, put it in place or put it there.\n            while item == arr[index]:\n                index += 1\n            arr[index], item = item, arr[index]\n    return arr", "entry_point": "cycle_sort", "input": "[5, 3, 1, 4]", "output": "[1, 3, 4, 5]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/sort/cycle_sort.py#L1-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033954", "code": "def shell_sort(arr):\n    ''' Shell Sort\n        Complexity: O(n^2)\n    '''\n    n = len(arr)\n    # Initialize size of the gap\n    gap = n//2\n    \n    while gap > 0:\n        y_index = gap\n        while y_index < len(arr):\n            y = arr[y_index]\n            x_index = y_index - gap\n            while x_index >= 0 and y < arr[x_index]:\n                arr[x_index + gap] = arr[x_index]\n                x_index = x_index - gap\n            arr[x_index + gap] = y\n            y_index = y_index + 1\n        gap = gap//2\n        \n    return arr", "entry_point": "shell_sort", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/sort/shell_sort.py#L1-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033955", "code": "def common_prefix(s1, s2):\n    \"Return prefix common of 2 strings\"\n    if not s1 or not s2:\n        return \"\"\n    k = 0\n    while s1[k] == s2[k]:\n        k = k + 1\n        if k >= len(s1) or k >= len(s2):\n            return s1[0:k]\n    return s1[0:k]", "entry_point": "common_prefix", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/longest_common_prefix.py#L21-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033956", "code": "def euler_totient(n):\n    \"\"\"Euler's totient function or Phi function.\n    Time Complexity: O(sqrt(n)).\"\"\"\n    result = n;\n    for i in range(2, int(n ** 0.5) + 1):\n        if n % i == 0:\n            while n % i == 0:\n                n //= i\n            result -= result // i\n    if n > 1:\n        result -= result // n;\n    return result;", "entry_point": "euler_totient", "input": "2.0", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/euler_totient.py#L7-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033957", "code": "def is_palindrome_dict(head):\n    \"\"\"\n    This function builds up a dictionary where the keys are the values of the list,\n    and the values are the positions at which these values occur in the list.\n    We then iterate over the dict and if there is more than one key with an odd\n    number of occurrences, bail out and return False.\n    Otherwise, we want to ensure that the positions of occurrence sum to the\n    value of the length of the list - 1, working from the outside of the list inward.\n    For example:\n    Input: 1 -> 1 -> 2 -> 3 -> 2 -> 1 -> 1\n    d = {1: [0,1,5,6], 2: [2,4], 3: [3]}\n    '3' is the middle outlier, 2+4=6, 0+6=6 and 5+1=6 so we have a palindrome.\n    \"\"\"\n    if not head or not head.next:\n        return True\n    d = {}\n    pos = 0\n    while head:\n        if head.val in d.keys():\n            d[head.val].append(pos)\n        else:\n            d[head.val] = [pos]\n        head = head.next\n        pos += 1\n    checksum = pos - 1\n    middle = 0\n    for v in d.values():\n        if len(v) % 2 != 0:\n            middle += 1\n        else:\n            step = 0\n            for i in range(0, len(v)):\n                if v[i] + v[len(v) - 1 - step] != checksum:\n                    return False\n                step += 1\n        if middle > 1:\n            return False\n    return True", "entry_point": "is_palindrome_dict", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/linkedlist/is_palindrome.py#L52-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033958", "code": "def fib_list(n):\n    \"\"\"[summary]\n    This algorithm computes the n-th fibbonacci number\n    very quick. approximate O(n)\n    The algorithm use dynamic programming.\n    \n    Arguments:\n        n {[int]} -- [description]\n    \n    Returns:\n        [int] -- [description]\n    \"\"\"\n\n    # precondition\n    assert n >= 0, 'n must be a positive integer'\n\n    list_results = [0, 1]\n    for i in range(2, n+1):\n        list_results.append(list_results[i-1] + list_results[i-2])\n    return list_results[n]", "entry_point": "fib_list", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/fib.py#L24-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033959", "code": "def fib_iter(n):\n    \"\"\"[summary]\n    Works iterative approximate O(n)\n\n    Arguments:\n        n {[int]} -- [description]\n    \n    Returns:\n        [int] -- [description]\n    \"\"\"\n\n    # precondition\n    assert n >= 0, 'n must be positive integer'\n\n    fib_1 = 0\n    fib_2 = 1\n    sum = 0\n    if n <= 1:\n        return n\n    for _ in range(n-1):\n        sum = fib_1 + fib_2\n        fib_1 = fib_2\n        fib_2 = sum\n    return sum", "entry_point": "fib_iter", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/fib.py#L47-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033960", "code": "def subsets(nums):\n    \"\"\"\n    :param nums: List[int]\n    :return: Set[tuple]\n    \"\"\"\n    n = len(nums)\n    total = 1 << n\n    res = set()\n\n    for i in range(total):\n        subset = tuple(num for j, num in enumerate(nums) if i & 1 << j)\n        res.add(subset)\n\n    return res", "entry_point": "subsets", "input": "[]", "output": "{()}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/bit/subsets.py#L21-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033961", "code": "def climb_stairs(n):\n    \"\"\"\n    :type n: int\n    :rtype: int\n    \"\"\"\n    arr = [1, 1]\n    for _ in range(1, n):\n        arr.append(arr[-1] + arr[-2])\n    return arr[-1]", "entry_point": "climb_stairs", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/climbing_stairs.py#L14-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033962", "code": "def find_nth_digit(n):\n    \"\"\"find the nth digit of given number.\n    1. find the length of the number where the nth digit is from.\n    2. find the actual number where the nth digit is from\n    3. find the nth digit and return\n    \"\"\"\n    length = 1\n    count = 9\n    start = 1\n    while n > length * count:\n        n -= length * count\n        length += 1\n        count *= 10\n        start *= 10\n    start += (n-1) / length\n    s = str(start)\n    return int(s[(n-1) % length])", "entry_point": "find_nth_digit", "input": "3", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/nth_digit.py#L1-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033963", "code": "def hailstone(n):\n  \"\"\"Return the 'hailstone sequence' from n to 1\n     n: The starting point of the hailstone sequence\n  \"\"\"\n\n  sequence = [n]\n  while n > 1:\n    if n%2 != 0:\n      n = 3*n + 1\n    else: \n      n = int(n/2)\n    sequence.append(n)\n  return sequence", "entry_point": "hailstone", "input": "-3", "output": "[-3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/hailstone.py#L1-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033964", "code": "def word_break(s, word_dict):\n    \"\"\"\n    :type s: str\n    :type word_dict: Set[str]\n    :rtype: bool\n    \"\"\"\n    dp = [False] * (len(s)+1)\n    dp[0] = True\n    for i in range(1, len(s)+1):\n        for j in range(0, i):\n            if dp[j] and s[j:i] in word_dict:\n                dp[i] = True\n                break\n    return dp[-1]", "entry_point": "word_break", "input": "[], {'x': [1, 2], 'y': []}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/word_break.py#L24-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033965", "code": "def prime_check(n):\n    \"\"\"Return True if n is a prime number\n    Else return False.\n    \"\"\"\n\n    if n <= 1:\n        return False\n    if n == 2 or n == 3:\n        return True\n    if n % 2 == 0 or n % 3 == 0:\n        return False\n    j = 5\n    while j * j <= n:\n        if n % j == 0 or n % (j + 2) == 0:\n            return False\n        j += 6\n    return True", "entry_point": "prime_check", "input": "3", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/prime_check.py#L1-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033966", "code": "def longest_non_repeat_v1(string):\n    \"\"\"\n    Find the length of the longest substring\n    without repeating characters.\n    \"\"\"\n    if string is None:\n        return 0\n    dict = {}\n    max_length = 0\n    j = 0\n    for i in range(len(string)):\n        if string[i] in dict:\n            j = max(dict[string[i]], j)\n        dict[string[i]] = i + 1\n        max_length = max(max_length, i - j + 1)\n    return max_length", "entry_point": "longest_non_repeat_v1", "input": "''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/longest_non_repeat.py#L14-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033967", "code": "def longest_non_repeat_v2(string):\n    \"\"\"\n    Find the length of the longest substring\n    without repeating characters.\n    Uses alternative algorithm.\n    \"\"\"\n    if string is None:\n        return 0\n    start, max_len = 0, 0\n    used_char = {}\n    for index, char in enumerate(string):\n        if char in used_char and start <= used_char[char]:\n            start = used_char[char] + 1\n        else:\n            max_len = max(max_len, index - start + 1)\n        used_char[char] = index\n    return max_len", "entry_point": "longest_non_repeat_v2", "input": "''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/longest_non_repeat.py#L31-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033968", "code": "def get_longest_non_repeat_v1(string):\n    \"\"\"\n    Find the length of the longest substring\n    without repeating characters.\n    Return max_len and the substring as a tuple\n    \"\"\"\n    if string is None:\n        return 0, ''\n    sub_string = ''\n    dict = {}\n    max_length = 0\n    j = 0\n    for i in range(len(string)):\n        if string[i] in dict:\n            j = max(dict[string[i]], j)\n        dict[string[i]] = i + 1\n        if i - j + 1 > max_length:\n            max_length = i - j + 1\n            sub_string = string[j: i + 1]\n    return max_length, sub_string", "entry_point": "get_longest_non_repeat_v1", "input": "'walnut thistle harbour'", "output": "(12, 'istle harbou')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/longest_non_repeat.py#L50-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033969", "code": "def get_longest_non_repeat_v2(string):\n    \"\"\"\n    Find the length of the longest substring\n    without repeating characters.\n    Uses alternative algorithm.\n    Return max_len and the substring as a tuple\n    \"\"\"\n    if string is None:\n        return 0, ''\n    sub_string = ''\n    start, max_len = 0, 0\n    used_char = {}\n    for index, char in enumerate(string):\n        if char in used_char and start <= used_char[char]:\n            start = used_char[char] + 1\n        else:\n            if index - start + 1 > max_len:\n                max_len = index - start + 1\n                sub_string = string[start: index + 1]\n        used_char[char] = index\n    return max_len, sub_string", "entry_point": "get_longest_non_repeat_v2", "input": "''", "output": "(0, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/longest_non_repeat.py#L71-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033970", "code": "def simplify_path(path):\n    \"\"\"\n    :type path: str\n    :rtype: str\n    \"\"\"\n    skip = {'..', '.', ''}\n    stack = []\n    paths = path.split('/')\n    for tok in paths:\n        if tok == '..':\n            if stack:\n                stack.pop()\n        elif tok not in skip:\n            stack.append(tok)\n    return '/' + '/'.join(stack)", "entry_point": "simplify_path", "input": "''", "output": "'/'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/stack/simplify_path.py#L13-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033971", "code": "def is_palindrome(s):\n    \"\"\"\n    :type s: str\n    :rtype: bool\n    \"\"\"\n    i = 0\n    j = len(s)-1\n    while i < j:\n        while i < j and not s[i].isalnum():\n            i += 1\n        while i < j and not s[j].isalnum():\n            j -= 1\n        if s[i].lower() != s[j].lower():\n            return False\n        i, j = i+1, j-1\n    return True", "entry_point": "is_palindrome", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/is_palindrome.py#L16-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033972", "code": "def plus_one_v1(digits):\n    \"\"\"\n    :type digits: List[int]\n    :rtype: List[int]\n    \"\"\"\n    digits[-1] = digits[-1] + 1\n    res = []\n    ten = 0\n    i = len(digits)-1\n    while i >= 0 or ten == 1:\n        summ = 0\n        if i >= 0:\n            summ += digits[i]\n        if ten:\n            summ += 1\n        res.append(summ % 10)\n        ten = summ // 10\n        i -= 1\n    return res[::-1]", "entry_point": "plus_one_v1", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 5]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/plus_one.py#L10-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033973", "code": "def rotate_right(head, k):\n    \"\"\"\n    :type head: ListNode\n    :type k: int\n    :rtype: ListNode\n    \"\"\"\n    if not head or not head.next:\n        return head\n    current = head\n    length = 1\n    # count length of the list\n    while current.next:\n        current = current.next\n        length += 1\n    # make it circular\n    current.next = head\n    k = k % length\n    # rotate until length-k\n    for i in range(length-k):\n        current = current.next\n    head = current.next\n    current.next = None\n    return head", "entry_point": "rotate_right", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/linkedlist/rotate_list.py#L17-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033974", "code": "def num_decodings(s):\n    \"\"\"\n    :type s: str\n    :rtype: int\n    \"\"\"\n    if not s or s[0] == \"0\":\n        return 0\n    wo_last, wo_last_two = 1, 1\n    for i in range(1, len(s)):\n        x = wo_last if s[i] != \"0\" else 0\n        y = wo_last_two if int(s[i-1:i+1]) < 27 and s[i-1] != \"0\" else 0\n        wo_last_two = wo_last\n        wo_last = x+y\n    return wo_last", "entry_point": "num_decodings", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/num_decodings.py#L20-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033975", "code": "def counting_sort(arr):\n    \"\"\"\n    Counting_sort\n    Sorting a array which has no element greater than k\n    Creating a new temp_arr,where temp_arr[i] contain the number of\n    element less than or equal to i in the arr\n    Then placing the number i into a correct position in the result_arr\n    return the result_arr\n    Complexity: 0(n)\n    \"\"\"\n\n    m = min(arr)\n    # in case there are negative elements, change the array to all positive element\n    different = 0\n    if m < 0:\n        # save the change, so that we can convert the array back to all positive number\n        different = -m\n        for i in range(len(arr)):\n            arr[i] += -m\n    k = max(arr)\n    temp_arr = [0] * (k + 1)\n    for i in range(0, len(arr)):\n        temp_arr[arr[i]] = temp_arr[arr[i]] + 1\n    # temp_array[i] contain the times the number i appear in arr\n\n    for i in range(1, k + 1):\n        temp_arr[i] = temp_arr[i] + temp_arr[i - 1]\n    # temp_array[i] contain the number of element less than or equal i in arr\n\n    result_arr = arr.copy()\n    # creating a result_arr an put the element in a correct positon\n    for i in range(len(arr) - 1, -1, -1):\n        result_arr[temp_arr[arr[i]] - 1] = arr[i] - different\n        temp_arr[arr[i]] = temp_arr[arr[i]] - 1\n\n    return result_arr", "entry_point": "counting_sort", "input": "[5, 3, 1, 4]", "output": "[1, 3, 4, 5]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/sort/counting_sort.py#L1-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033976", "code": "def find_keyboard_row(words):\n    \"\"\"\n    :type words: List[str]\n    :rtype: List[str]\n    \"\"\"\n    keyboard = [\n        set('qwertyuiop'),\n        set('asdfghjkl'),\n        set('zxcvbnm'),\n    ]\n    result = []\n    for word in words:\n        for key in keyboard:\n            if set(word.lower()).issubset(key):\n                result.append(word)\n    return result", "entry_point": "find_keyboard_row", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/set/find_keyboard_row.py#L11-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033977", "code": "def kth_to_last_dict(head, k):\n    \"\"\"\n    This is a brute force method where we keep a dict the size of the list\n    Then we check it for the value we need. If the key is not in the dict,\n    our and statement will short circuit and return False\n    \"\"\"\n    if not (head and k > -1):\n        return False\n    d = dict()\n    count = 0\n    while head:\n        d[count] = head\n        head = head.next\n        count += 1\n    return len(d)-k in d and d[len(d)-k]", "entry_point": "kth_to_last_dict", "input": "{'x': [1, 2], 'y': []}, -1.5", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/linkedlist/kth_to_last.py#L27-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033978", "code": "def kth_to_last(head, k):\n    \"\"\"\n    This is an optimal method using iteration.\n    We move p1 k steps ahead into the list.\n    Then we move p1 and p2 together until p1 hits the end.\n    \"\"\"\n    if not (head or k > -1):\n        return False\n    p1 = head\n    p2 = head\n    for i in range(1, k+1):\n        if p1 is None:\n            # Went too far, k is not valid\n            raise IndexError\n        p1 = p1.next\n    while p1:\n        p1 = p1.next\n        p2 = p2.next\n    return p2", "entry_point": "kth_to_last", "input": "{}, False", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/linkedlist/kth_to_last.py#L44-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033979", "code": "def summarize_ranges(array):\n    \"\"\"\n    :type array: List[int]\n    :rtype: List[]\n    \"\"\"\n    res = []\n    if len(array) == 1:\n        return [str(array[0])]\n    i = 0\n    while i < len(array):\n        num = array[i]\n        while i + 1 < len(array) and array[i + 1] - array[i] == 1:\n            i += 1\n        if array[i] != num:\n            res.append((num, array[i]))\n        else:\n            res.append((num, num))\n        i += 1\n    return res", "entry_point": "summarize_ranges", "input": "[-1, 0, 1, 2]", "output": "[(-1, 2)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/arrays/summarize_ranges.py#L9-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033980", "code": "def encode(strs):\n    \"\"\"Encodes a list of strings to a single string.\n    :type strs: List[str]\n    :rtype: str\n    \"\"\"\n    res = ''\n    for string in strs.split():\n        res += str(len(string)) + \":\" + string\n    return res", "entry_point": "encode", "input": "'Hello World'", "output": "'5:Hello5:World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/encode_decode.py#L8-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033981", "code": "def decode(s):\n    \"\"\"Decodes a single string to a list of strings.\n    :type s: str\n    :rtype: List[str]\n    \"\"\"\n    strs = []\n    i = 0\n    while i < len(s):\n        index = s.find(\":\", i)\n        size = int(s[i:index])\n        strs.append(s[index+1: index+1+size])\n        i = index+1+size\n    return strs", "entry_point": "decode", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/encode_decode.py#L18-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033982", "code": "def combination_memo(n, r):\n    \"\"\"This function calculates nCr using memoization method.\"\"\"\n    memo = {}\n    def recur(n, r):\n        if n == r or r == 0:\n            return 1\n        if (n, r) not in memo:\n            memo[(n, r)] = recur(n - 1, r - 1) + recur(n - 1, r)\n        return memo[(n, r)]\n    return recur(n, r)", "entry_point": "combination_memo", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/combination.py#L8-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033983", "code": "def is_anagram(s, t):\n    \"\"\"\n    :type s: str\n    :type t: str\n    :rtype: bool\n    \"\"\"\n    maps = {}\n    mapt = {}\n    for i in s:\n        maps[i] = maps.get(i, 0) + 1\n    for i in t:\n        mapt[i] = mapt.get(i, 0) + 1\n    return maps == mapt", "entry_point": "is_anagram", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/map/is_anagram.py#L17-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033984", "code": "def pancake_sort(arr):\n    \"\"\"\n    Pancake_sort\n    Sorting a given array\n    mutation of selection sort\n\n    reference: https://www.geeksforgeeks.org/pancake-sorting/\n    \n    Overall time complexity : O(N^2)\n    \"\"\"\n\n    len_arr = len(arr)\n    if len_arr <= 1:\n        return arr\n    for cur in range(len(arr), 1, -1):\n        #Finding index of maximum number in arr\n        index_max = arr.index(max(arr[0:cur]))\n        if index_max+1 != cur:\n            #Needs moving\n            if index_max != 0:\n                #reverse from 0 to index_max\n                arr[:index_max+1] = reversed(arr[:index_max+1])\n            # Reverse list\n            arr[:cur] = reversed(arr[:cur])\n    return arr", "entry_point": "pancake_sort", "input": "[[1, 2], [3], []]", "output": "[[], [1, 2], [3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/sort/pancake_sort.py#L1-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033985", "code": "def max_profit_naive(prices):\n    \"\"\"\n    :type prices: List[int]\n    :rtype: int\n    \"\"\"\n    max_so_far = 0\n    for i in range(0, len(prices) - 1):\n        for j in range(i + 1, len(prices)):\n            max_so_far = max(max_so_far, prices[j] - prices[i])\n    return max_so_far", "entry_point": "max_profit_naive", "input": "[-1, 0, 1, 2]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/buy_sell_stock.py#L24-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033986", "code": "def max_profit_optimized(prices):\n    \"\"\"\n    input: [7, 1, 5, 3, 6, 4]\n    diff : [X, -6, 4, -2, 3, -2]\n    :type prices: List[int]\n    :rtype: int\n    \"\"\"\n    cur_max, max_so_far = 0, 0\n    for i in range(1, len(prices)):\n        cur_max = max(0, cur_max + prices[i] - prices[i-1])\n        max_so_far = max(max_so_far, cur_max)\n    return max_so_far", "entry_point": "max_profit_optimized", "input": "[1, 2, 3]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dp/buy_sell_stock.py#L37-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033987", "code": "def first_unique_char(s):\n    \"\"\"\n    :type s: str\n    :rtype: int\n    \"\"\"\n    if (len(s) == 1):\n        return 0\n    ban = []\n    for i in range(len(s)):\n        if all(s[i] != s[k] for k in range(i + 1, len(s))) == True and s[i] not in ban:\n            return i\n        else:\n            ban.append(s[i])\n    return -1", "entry_point": "first_unique_char", "input": "[5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/first_unique_char.py#L14-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033988", "code": "def int_to_roman(num):\n    \"\"\"\n    :type num: int\n    :rtype: str\n    \"\"\"\n    m = [\"\", \"M\", \"MM\", \"MMM\"];\n    c = [\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\"];\n    x = [\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\"];\n    i = [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"];\n    return m[num//1000] + c[(num%1000)//100] + x[(num%100)//10] + i[num%10];", "entry_point": "int_to_roman", "input": "2", "output": "'II'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/int_to_roman.py#L6-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033989", "code": "def is_bst(root):\n    \"\"\"\n    :type root: TreeNode\n    :rtype: bool\n    \"\"\"\n\n    stack = []\n    pre = None\n    \n    while root or stack:\n        while root:\n            stack.append(root)\n            root = root.left\n        root = stack.pop()\n        if pre and root.val <= pre.val:\n            return False\n        pre = root\n        root = root.right\n\n    return True", "entry_point": "is_bst", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/tree/bst/is_bst.py#L23-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033990", "code": "def get_factors_iterative1(n):\n    \"\"\"[summary]\n    Computes all factors of n.\n    Translated the function get_factors(...) in\n    a call-stack modell.\n\n    Arguments:\n        n {[int]} -- [to analysed number]\n    \n    Returns:\n        [list of lists] -- [all factors]\n    \"\"\"\n\n    todo, res = [(n, 2, [])], []\n    while todo:\n        n, i, combi = todo.pop()\n        while i * i <= n:\n            if n % i == 0:\n                res += combi + [i, n//i],\n                todo.append((n//i, i, combi+[i])),\n            i += 1\n    return res", "entry_point": "get_factors_iterative1", "input": "7", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dfs/all_factors.py#L63-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033991", "code": "def get_factors_iterative2(n):\n    \"\"\"[summary]\n    analog as above\n\n    Arguments:\n        n {[int]} -- [description]\n    \n    Returns:\n        [list of lists] -- [all factors of n]\n    \"\"\"\n\n    ans, stack, x = [], [], 2\n    while True:\n        if x > n // x:\n            if not stack:\n                return ans\n            ans.append(stack + [n])\n            x = stack.pop()\n            n *= x\n            x += 1\n        elif n % x == 0:\n            stack.append(x)\n            n //= x\n        else:\n            x += 1", "entry_point": "get_factors_iterative2", "input": "7", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/dfs/all_factors.py#L87-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033992", "code": "def single_number3(nums):\n    \"\"\"\n    :type nums: List[int]\n    :rtype: List[int]\n    \"\"\"\n    # isolate a^b from pairs using XOR\n    ab = 0\n    for n in nums:\n        ab ^= n\n\n    # isolate right most bit from a^b\n    right_most = ab & (-ab)\n\n    # isolate a and b from a^b\n    a, b = 0, 0\n    for n in nums:\n        if n & right_most:\n            a ^= n\n        else:\n            b ^= n\n    return [a, b]", "entry_point": "single_number3", "input": "[5, 3, 1, 4]", "output": "[7, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/bit/single_number3.py#L29-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033993", "code": "def is_strobogrammatic(num):\n    \"\"\"\n    :type num: str\n    :rtype: bool\n    \"\"\"\n    comb = \"00 11 88 69 96\"\n    i = 0\n    j = len(num) - 1\n    while i <= j:\n        x = comb.find(num[i]+num[j])\n        if x == -1:\n            return False\n        i += 1\n        j -= 1\n    return True", "entry_point": "is_strobogrammatic", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/is_strobogrammatic.py#L12-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033994", "code": "def reverse_list(head):\n    \"\"\"\n    :type head: ListNode\n    :rtype: ListNode\n    \"\"\"\n    if not head or not head.next:\n        return head\n    prev = None\n    while head:\n        current = head\n        head = head.next\n        current.next = prev\n        prev = current\n    return prev", "entry_point": "reverse_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/linkedlist/reverse.py#L12-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033995", "code": "def is_cyclic(head):\n    \"\"\"\n    :type head: Node\n    :rtype: bool\n    \"\"\"\n    if not head:\n        return False\n    runner = head\n    walker = head\n    while runner.next and runner.next.next:\n        runner = runner.next.next\n        walker = walker.next\n        if runner == walker:\n            return True\n    return False", "entry_point": "is_cyclic", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/linkedlist/is_cyclic.py#L13-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033996", "code": "def decode_string(s):\n    \"\"\"\n    :type s: str\n    :rtype: str\n    \"\"\"\n    stack = []; cur_num = 0; cur_string = ''\n    for c in s:\n        if c == '[':\n            stack.append((cur_string, cur_num))\n            cur_string = ''\n            cur_num = 0\n        elif c == ']':\n            prev_string, num = stack.pop()\n            cur_string = prev_string + num * cur_string\n        elif c.isdigit():\n            cur_num = cur_num*10 + int(c)\n        else:\n            cur_string += c\n    return cur_string", "entry_point": "decode_string", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/strings/decode_string.py#L20-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033997", "code": "def calc(n2, n1, operator):\r\n    \"\"\"\r\n    Calculate operation result\r\n\r\n    n2 Number: Number 2\r\n    n1 Number: Number 1\r\n    operator Char: Operation to calculate\r\n    \"\"\"\r\n    if operator == '-': return n1 - n2\r\n    elif operator == '+': return n1 + n2\r\n    elif operator == '*': return n1 * n2\r\n    elif operator == '/': return n1 / n2\r\n    elif operator == '^': return n1 ** n2\r\n    return 0", "entry_point": "calc", "input": "[1, 2, 3], ['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/calculator/math_parser.py#L53-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033998", "code": "def extended_gcd(a, b):\n    \"\"\"Extended GCD algorithm.\n    Return s, t, g\n    such that a * s + b * t = GCD(a, b)\n    and s and t are co-prime.\n    \"\"\"\n\n    old_s, s = 1, 0\n    old_t, t = 0, 1\n    old_r, r = a, b\n    \n    while r != 0:\n        quotient = old_r / r\n        \n        old_r, r = r, old_r - quotient * r\n        old_s, s = s, old_s - quotient * s\n        old_t, t = t, old_t - quotient * t\n    \n    return old_s, old_t, old_r", "entry_point": "extended_gcd", "input": "set(), 0", "output": "(1, 0, set())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/keon/algorithms/blob/4d6569464a62a75c1357acc97e2dd32ee2f9f4a3/algorithms/maths/extended_gcd.py#L1-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0033999", "code": "def _fmt_metric(value, show_stdv=True):\n    \"\"\"format metric string\"\"\"\n    if len(value) == 2:\n        return '%s:%g' % (value[0], value[1])\n    if len(value) == 3:\n        if show_stdv:\n            return '%s:%g+%g' % (value[0], value[1], value[2])\n        return '%s:%g' % (value[0], value[1])\n    raise ValueError(\"wrong metric value\")", "entry_point": "_fmt_metric", "input": "[1, 2, 3], []", "output": "'1:2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmlc/xgboost/blob/253fdd8a42d5ec6b819788199584d27bf9ea6253/python-package/xgboost/callback.py#L19-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034000", "code": "def _shorten_file_path(line):\n  \"\"\"Shorten file path in error lines for more readable tracebacks.\"\"\"\n  start = line.lower().find('file')\n  if start < 0:\n    return line\n  first_quote = line.find('\"', start)\n  if first_quote < 0:\n    return line\n  second_quote = line.find('\"', first_quote + 1)\n  if second_quote < 0:\n    return line\n  path = line[first_quote + 1:second_quote]\n  new_path = '/'.join(path.split('/')[-3:])\n  return line[:first_quote] + '[...]/' + new_path + line[second_quote + 1:]", "entry_point": "_shorten_file_path", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/layers/base.py#L200-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034001", "code": "def _bucket_boundaries(max_length, min_length=8, length_bucket_step=1.1):\n  \"\"\"A default set of length-bucket boundaries.\"\"\"\n  assert length_bucket_step > 1.0\n  x = min_length\n  boundaries = []\n  while x < max_length:\n    boundaries.append(x)\n    x = max(x + 1, int(x * length_bucket_step))\n  return boundaries", "entry_point": "_bucket_boundaries", "input": "7, 0, 3", "output": "[0, 1, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/data_reader.py#L69-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034002", "code": "def shard(items, num_shards):\n  \"\"\"Split items into num_shards groups.\"\"\"\n  sharded = []\n  num_per_shard = len(items) // num_shards\n  start = 0\n  for _ in range(num_shards):\n    sharded.append(items[start:start + num_per_shard])\n    start += num_per_shard\n\n  remainder = len(items) % num_shards\n  start = len(items) - remainder\n  for i in range(remainder):\n    sharded[i].append(items[start + i])\n\n  assert sum([len(fs) for fs in sharded]) == len(items)\n  return sharded", "entry_point": "shard", "input": "[[1, 2], [3], []], 1", "output": "[[[1, 2], [3], []]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/wikisum/get_references_web_single_group.py#L87-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034003", "code": "def _parse_hparams(hparams):\n  \"\"\"Split hparams, based on key prefixes.\n\n  Args:\n    hparams: hyperparameters\n\n  Returns:\n    Tuple of hparams for respectably: agent, optimizer, runner, replay_buffer.\n  \"\"\"\n  prefixes = [\"agent_\", \"optimizer_\", \"runner_\", \"replay_buffer_\"]\n  ret = []\n\n  for prefix in prefixes:\n    ret_dict = {}\n    for key in hparams.values():\n      if prefix in key:\n        par_name = key[len(prefix):]\n        ret_dict[par_name] = hparams.get(key)\n    ret.append(ret_dict)\n\n  return ret", "entry_point": "_parse_hparams", "input": "{}", "output": "[{}, {}, {}, {}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/rl/dopamine_connector.py#L471-L491", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034004", "code": "def _replace_oov(original_vocab, line):\n  \"\"\"Replace out-of-vocab words with \"UNK\".\n\n  This maintains compatibility with published results.\n\n  Args:\n    original_vocab: a set of strings (The standard vocabulary for the dataset)\n    line: a unicode string - a space-delimited sequence of words.\n\n  Returns:\n    a unicode string - a space-delimited sequence of words.\n  \"\"\"\n  return u\" \".join(\n      [word if word in original_vocab else u\"UNK\" for word in line.split()])", "entry_point": "_replace_oov", "input": "[[1, 2], [3], []], ''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/lm1b.py#L58-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034005", "code": "def _preprocess_sgm(line, is_sgm):\n  \"\"\"Preprocessing to strip tags in SGM files.\"\"\"\n  if not is_sgm:\n    return line\n  # In SGM files, remove <srcset ...>, <p>, <doc ...> lines.\n  if line.startswith(\"<srcset\") or line.startswith(\"</srcset\"):\n    return \"\"\n  if line.startswith(\"<doc\") or line.startswith(\"</doc\"):\n    return \"\"\n  if line.startswith(\"<p>\") or line.startswith(\"</p>\"):\n    return \"\"\n  # Strip <seg> tags.\n  line = line.strip()\n  if line.startswith(\"<seg\") and line.endswith(\"</seg>\"):\n    i = line.index(\">\")\n    return line[i + 1:-6]", "entry_point": "_preprocess_sgm", "input": "True, ()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/translate.py#L121-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034006", "code": "def words_and_tags_from_wsj_tree(tree_string):\n  \"\"\"Generates linearized trees and tokens from the wsj tree format.\n\n  It uses the linearized algorithm described in https://arxiv.org/abs/1412.7449.\n\n  Args:\n    tree_string: tree in wsj format\n\n  Returns:\n    tuple: (words, linearized tree)\n  \"\"\"\n  stack, tags, words = [], [], []\n  for tok in tree_string.strip().split():\n    if tok[0] == \"(\":\n      symbol = tok[1:]\n      tags.append(symbol)\n      stack.append(symbol)\n    else:\n      assert tok[-1] == \")\"\n      stack.pop()  # Pop the POS-tag.\n      while tok[-2] == \")\":\n        tags.append(\"/\" + stack.pop())\n        tok = tok[:-1]\n      words.append(tok[:-1])\n  return str.join(\" \", words), str.join(\" \", tags[1:-1])", "entry_point": "words_and_tags_from_wsj_tree", "input": "''", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/wsj_parsing.py#L79-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034007", "code": "def _flatten_dict(original_dict):\n  \"\"\"Flatten dict of dicts into a single dict with appropriate prefixes.\n\n  Handles only 2 levels of nesting in the original dict.\n\n  Args:\n    original_dict: Dict which may contain one or more dicts.\n  Returns:\n    flat_dict: Dict without any nesting. Any dicts in the original dict have\n      their keys as prefixes in the new dict.\n  Raises:\n    ValueError if the original dict has more than two levels of nesting.\n  \"\"\"\n  flat_dict = {}\n  for key, value in original_dict.items():\n    if isinstance(value, dict):\n      for name, tensor in value.items():\n        if isinstance(tensor, dict):\n          raise ValueError(\"flatten_dict only handles 2 levels of nesting.\")\n        flat_key = \"__\" + key + \"_\" + name\n        flat_dict[flat_key] = tensor\n    else:\n      flat_dict[key] = value\n\n  return flat_dict", "entry_point": "_flatten_dict", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/t2t_model.py#L63-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034008", "code": "def _unflatten_dict(flat_dict, prefixes):\n  \"\"\"Returns a dict of dicts if any prefixes match keys in the flat dict.\n\n    The function handles the case where the prefix may not be a dict.\n\n  Args:\n    flat_dict: A dict without any nesting.\n    prefixes: A list of strings which may have been dicts in the\n      original structure.\n\n  \"\"\"\n  original_dict = {}\n  for key, value in flat_dict.items():\n    prefix_found = False\n    for prefix in prefixes:\n      full_prefix = \"__\" + prefix + \"_\"\n      if key.startswith(full_prefix):\n        # Add a dict to the original dict with key=prefix\n        if prefix not in original_dict:\n          original_dict[prefix] = {}\n        original_dict[prefix][key[len(full_prefix):]] = value\n        prefix_found = True\n        break\n    if not prefix_found:\n      # No key matched a prefix in the for loop.\n      original_dict[key] = value\n\n  return original_dict", "entry_point": "_unflatten_dict", "input": "{'a': 1, 'b': 2}, 'a,b,c'", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/t2t_model.py#L90-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034009", "code": "def create_combination(list_of_sentences):\n  \"\"\"Generates all possible pair combinations for the input list of sentences.\n\n  For example:\n\n  input = [\"paraphrase1\", \"paraphrase2\", \"paraphrase3\"]\n\n  output = [(\"paraphrase1\", \"paraphrase2\"),\n            (\"paraphrase1\", \"paraphrase3\"),\n            (\"paraphrase2\", \"paraphrase3\")]\n\n  Args:\n    list_of_sentences: the list of input sentences.\n  Returns:\n    the list of all possible sentence pairs.\n  \"\"\"\n  num_sentences = len(list_of_sentences) - 1\n  combinations = []\n  for i, _ in enumerate(list_of_sentences):\n    if i == num_sentences:\n      break\n    num_pairs = num_sentences - i\n    populated = num_pairs * [list_of_sentences[i]]\n    zipped = list(zip(populated, list_of_sentences[i + 1:]))\n    combinations += zipped\n  return combinations", "entry_point": "create_combination", "input": "[5, 3, 1, 4]", "output": "[(5, 3), (5, 1), (5, 4), (3, 1), (3, 4), (1, 4)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/paraphrase_ms_coco.py#L42-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034010", "code": "def strip_ids(ids, ids_to_strip):\n  \"\"\"Strip ids_to_strip from the end ids.\"\"\"\n  ids = list(ids)\n  while ids and ids[-1] in ids_to_strip:\n    ids.pop()\n  return ids", "entry_point": "strip_ids", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/text_encoder.py#L99-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034011", "code": "def markdownify_operative_config_str(string):\n  \"\"\"Convert an operative config string to markdown format.\"\"\"\n\n  # TODO(b/37527917): Total hack below. Implement more principled formatting.\n  def process(line):\n    \"\"\"Convert a single line to markdown format.\"\"\"\n    if not line.startswith('#'):\n      return '    ' + line\n\n    line = line[2:]\n    if line.startswith('===='):\n      return ''\n    if line.startswith('None'):\n      return '    # None.'\n    if line.endswith(':'):\n      return '#### ' + line\n    return line\n\n  output_lines = []\n  for line in string.splitlines():\n    procd_line = process(line)\n    if procd_line is not None:\n      output_lines.append(procd_line)\n\n  return '\\n'.join(output_lines)", "entry_point": "markdownify_operative_config_str", "input": "'abc'", "output": "'    abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/jaxboard.py#L326-L350", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034012", "code": "def get_default_master_type(num_gpus=1):\n  \"\"\"Returns master_type for trainingInput.\"\"\"\n  gpus_to_master_map = {\n      0: \"standard\",\n      1: \"standard_p100\",\n      4: \"complex_model_m_p100\",\n      8: \"complex_model_l_gpu\",\n  }\n  if num_gpus not in gpus_to_master_map:\n    raise ValueError(\"Num gpus must be in %s\" %\n                     str(sorted(list(gpus_to_master_map.keys()))))\n  return gpus_to_master_map[num_gpus]", "entry_point": "get_default_master_type", "input": "1", "output": "'standard_p100'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/cloud_mlengine.py#L116-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034013", "code": "def _select_features(example, feature_list=None):\n  \"\"\"Select a subset of features from the example dict.\"\"\"\n  feature_list = feature_list or [\"inputs\", \"targets\"]\n  return {f: example[f] for f in feature_list}", "entry_point": "_select_features", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "{-1: 3, 0: 1, 1: 2, 2: 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L101-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034014", "code": "def _lcs(x, y):\n  \"\"\"Computes the length of the LCS between two seqs.\n\n  The implementation below uses a DP programming algorithm and runs\n  in O(nm) time where n = len(x) and m = len(y).\n  Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence\n\n  Args:\n    x: collection of words\n    y: collection of words\n\n  Returns:\n    Table of dictionary of coord and len lcs\n  \"\"\"\n  n, m = len(x), len(y)\n  table = {}\n  for i in range(n + 1):\n    for j in range(m + 1):\n      if i == 0 or j == 0:\n        table[i, j] = 0\n      elif x[i - 1] == y[j - 1]:\n        table[i, j] = table[i - 1, j - 1] + 1\n      else:\n        table[i, j] = max(table[i - 1, j], table[i, j - 1])\n  return table", "entry_point": "_lcs", "input": "[], [1, 2, 3]", "output": "{(0, 0): 0, (0, 1): 0, (0, 2): 0, (0, 3): 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L50-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034015", "code": "def encode_schedule(schedule):\n  \"\"\"Encodes a schedule tuple into a string.\n\n  Args:\n    schedule: A tuple containing (interpolation, steps, pmfs), where\n      interpolation is a string specifying the interpolation strategy, steps\n      is an int array_like of shape [N] specifying the global steps, and pmfs is\n      an array_like of shape [N, M] where pmf[i] is the sampling distribution\n      at global step steps[i]. N is the number of schedule requirements to\n      interpolate and M is the size of the probability space.\n\n  Returns:\n    The string encoding of the schedule tuple.\n  \"\"\"\n  interpolation, steps, pmfs = schedule\n  return interpolation + ' ' + ' '.join(\n      '@' + str(s) + ' ' + ' '.join(map(str, p)) for s, p in zip(steps, pmfs))", "entry_point": "encode_schedule", "input": "['a', 'b', 'c']", "output": "'a @b c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem_v2.py#L378-L394", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034016", "code": "def lower_endian_to_number(l, base):\n  \"\"\"Helper function: convert a list of digits in the given base to a number.\"\"\"\n  return sum([d * (base**i) for i, d in enumerate(l)])", "entry_point": "lower_endian_to_number", "input": "[], [1, 2, 3]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/algorithmic.py#L311-L313", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034017", "code": "def get_problem_name(base_name, was_reversed=False, was_copy=False):\n  \"\"\"Construct a problem name from base and reversed/copy options.\n\n  Inverse of `parse_problem_name`.\n\n  Args:\n    base_name: base problem name. Should not end in \"_rev\" or \"_copy\"\n    was_reversed: if the problem is to be reversed\n    was_copy: if the problem is to be copied\n\n  Returns:\n    string name consistent with use with `parse_problem_name`.\n\n  Raises:\n    ValueError if `base_name` ends with \"_rev\" or \"_copy\"\n  \"\"\"\n  if any(base_name.endswith(suffix) for suffix in (\"_rev\", \"_copy\")):\n    raise ValueError(\"`base_name` cannot end in '_rev' or '_copy'\")\n  name = base_name\n  if was_copy:\n    name = \"%s_copy\" % name\n  if was_reversed:\n    name = \"%s_rev\" % name\n  return name", "entry_point": "get_problem_name", "input": "'abc', True, [[1, 2], [3], []]", "output": "'abc_copy_rev'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/registry.py#L337-L360", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034018", "code": "def get_names(infos):\n    \"\"\"Get names of all parameters.\n\n    Parameters\n    ----------\n    infos : list\n        Content of the config header file.\n\n    Returns\n    -------\n    names : list\n        Names of all parameters.\n    \"\"\"\n    names = []\n    for x in infos:\n        for y in x:\n            names.append(y[\"name\"][0])\n    return names", "entry_point": "get_names", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/LightGBM/blob/8d2ec69f4f685b0ab1c4624d59ee2d3287bb3147/helpers/parameter_generator.py#L80-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034019", "code": "def get_alias(infos):\n    \"\"\"Get aliases of all parameters.\n\n    Parameters\n    ----------\n    infos : list\n        Content of the config header file.\n\n    Returns\n    -------\n    pairs : list\n        List of tuples (param alias, param name).\n    \"\"\"\n    pairs = []\n    for x in infos:\n        for y in x:\n            if \"alias\" in y:\n                name = y[\"name\"][0]\n                alias = y[\"alias\"][0].split(',')\n                for name2 in alias:\n                    pairs.append((name2.strip(), name))\n    return pairs", "entry_point": "get_alias", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/LightGBM/blob/8d2ec69f4f685b0ab1c4624d59ee2d3287bb3147/helpers/parameter_generator.py#L100-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034020", "code": "def _format_eval_result(value, show_stdv=True):\n    \"\"\"Format metric string.\"\"\"\n    if len(value) == 4:\n        return '%s\\'s %s: %g' % (value[0], value[1], value[2])\n    elif len(value) == 5:\n        if show_stdv:\n            return '%s\\'s %s: %g + %g' % (value[0], value[1], value[2], value[4])\n        else:\n            return '%s\\'s %s: %g' % (value[0], value[1], value[2])\n    else:\n        raise ValueError(\"Wrong metric value\")", "entry_point": "_format_eval_result", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "\"5's 3: 1\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/LightGBM/blob/8d2ec69f4f685b0ab1c4624d59ee2d3287bb3147/python-package/lightgbm/callback.py#L42-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034021", "code": "def namespace_match(pattern: str, namespace: str):\n    \"\"\"\n    Matches a namespace pattern against a namespace string.  For example, ``*tags`` matches\n    ``passage_tags`` and ``question_tags`` and ``tokens`` matches ``tokens`` but not\n    ``stemmed_tokens``.\n    \"\"\"\n    if pattern[0] == '*' and namespace.endswith(pattern[1:]):\n        return True\n    elif pattern == namespace:\n        return True\n    return False", "entry_point": "namespace_match", "input": "[1, 2, 3], 'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/common/util.py#L164-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034022", "code": "def muc(clusters, mention_to_gold):\n        \"\"\"\n        Counts the mentions in each predicted cluster which need to be re-allocated in\n        order for each predicted cluster to be contained by the respective gold cluster.\n        <http://aclweb.org/anthology/M/M95/M95-1005.pdf>\n        \"\"\"\n        true_p, all_p = 0, 0\n        for cluster in clusters:\n            all_p += len(cluster) - 1\n            true_p += len(cluster)\n            linked = set()\n            for mention in cluster:\n                if mention in mention_to_gold:\n                    linked.add(mention_to_gold[mention])\n                else:\n                    true_p -= 1\n            true_p -= len(linked)\n        return true_p, all_p", "entry_point": "muc", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/training/metrics/conll_coref_scores.py#L188-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034023", "code": "def phi4(gold_clustering, predicted_clustering):\n        \"\"\"\n        Subroutine for ceafe. Computes the mention F measure between gold and\n        predicted mentions in a cluster.\n        \"\"\"\n        return 2 * len([mention for mention in gold_clustering if mention in predicted_clustering]) \\\n               / float(len(gold_clustering) + len(predicted_clustering))", "entry_point": "phi4", "input": "[5, 3, 1, 4], {'a': 1, 'b': 2}", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/training/metrics/conll_coref_scores.py#L208-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034024", "code": "def get_coherent_next_tag(prev_label: str, cur_label: str) -> str:\n    \"\"\"\n    Generate a coherent tag, given previous tag and current label.\n    \"\"\"\n    if cur_label == \"O\":\n        # Don't need to add prefix to an \"O\" label\n        return \"O\"\n\n    if prev_label == cur_label:\n        return f\"I-{cur_label}\"\n    else:\n        return f\"B-{cur_label}\"", "entry_point": "get_coherent_next_tag", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "\"B-['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/predictors/open_information_extraction.py#L88-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034025", "code": "def sanitize_label(label: str) -> str:\n    \"\"\"\n    Sanitize a BIO label - this deals with OIE\n    labels sometimes having some noise, as parentheses.\n    \"\"\"\n    if \"-\" in label:\n        prefix, suffix = label.split(\"-\")\n        suffix = suffix.split(\"(\")[-1]\n        return f\"{prefix}-{suffix}\"\n    else:\n        return label", "entry_point": "sanitize_label", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/predictors/open_information_extraction.py#L161-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034026", "code": "def check_denotation(target_values, predicted_values):\n    \"\"\"Return True if the predicted denotation is correct.\n\n    Args:\n        target_values (list[Value])\n        predicted_values (list[Value])\n    Returns:\n        bool\n    \"\"\"\n    # Check size\n    if len(target_values) != len(predicted_values):\n        return False\n    # Check items\n    for target in target_values:\n        if not any(target.match(pred) for pred in predicted_values):\n            return False\n    return True", "entry_point": "check_denotation", "input": "[], {}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/tools/wikitables_evaluator.py#L301-L317", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034027", "code": "def replace_cr_with_newline(message: str):\n    \"\"\"\n    TQDM and requests use carriage returns to get the training line to update for each batch\n    without adding more lines to the terminal output.  Displaying those in a file won't work\n    correctly, so we'll just make sure that each batch shows up on its one line.\n    :param message: the message to permute\n    :return: the message with carriage returns replaced with newlines\n    \"\"\"\n    if '\\r' in message:\n        message = message.replace('\\r', '')\n        if not message or message[-1] != '\\n':\n            message += '\\n'\n    return message", "entry_point": "replace_cr_with_newline", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/allenai/allennlp/blob/648a36f77db7e45784c047176074f98534c76636/allennlp/common/tee_logger.py#L8-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034028", "code": "def is_valid(data):\n        \"\"\"\n        Checks if the input data is a Swagger document\n\n        :param dict data: Data to be validated\n        :return: True, if data is a Swagger\n        \"\"\"\n        return bool(data) and \\\n            isinstance(data, dict) and \\\n            bool(data.get(\"swagger\")) and \\\n            isinstance(data.get('paths'), dict)", "entry_point": "is_valid", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/swagger/swagger.py#L546-L556", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034029", "code": "def build_response_card(title, subtitle, options):\n    \"\"\"\n    Build a responseCard with a title, subtitle, and an optional set of options which should be displayed as buttons.\n    \"\"\"\n    buttons = None\n    if options is not None:\n        buttons = []\n        for i in range(min(5, len(options))):\n            buttons.append(options[i])\n\n    return {\n        'contentType': 'application/vnd.amazonaws.card.generic',\n        'version': 1,\n        'genericAttachments': [{\n            'title': title,\n            'subTitle': subtitle,\n            'buttons': buttons\n        }]\n    }", "entry_point": "build_response_card", "input": "'abc', 7, ('a', 'b', 'c')", "output": "{'contentType': 'application/vnd.amazonaws.card.generic', 'version': 1, 'genericAttachments': [{'title': 'abc', 'subTitle': 7, 'buttons': ['a', 'b', 'c']}]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L75-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034030", "code": "def is_instrinsic(input):\n    \"\"\"\n    Checks if the given input is an intrinsic function dictionary. Intrinsic function is a dictionary with single\n    key that is the name of the intrinsics.\n\n    :param input: Input value to check if it is an intrinsic\n    :return: True, if yes\n    \"\"\"\n\n    if input is not None \\\n            and isinstance(input, dict) \\\n            and len(input) == 1:\n\n        key = list(input.keys())[0]\n        return key == \"Ref\" or key == \"Condition\" or key.startswith(\"Fn::\")\n\n    return False", "entry_point": "is_instrinsic", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/intrinsics.py#L124-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034031", "code": "def _set_collapse_interval(data, interval):\r\n        \"\"\"\r\n        \u95f4\u9694\u6298\u53e0\u8282\u70b9\uff0c\u5f53\u8282\u70b9\u8fc7\u591a\u65f6\u53ef\u4ee5\u89e3\u51b3\u8282\u70b9\u663e\u793a\u8fc7\u6742\u95f4\u9694\u3002\r\n\r\n        :param data: \u8282\u70b9\u6570\u636e\r\n        :param interval: \u6307\u5b9a\u95f4\u9694\r\n        \"\"\"\r\n        if interval <= 0:\r\n            return data\r\n        if data and isinstance(data, list):\r\n            for d in data:\r\n                children = d.get(\"children\", None)\r\n                if children and interval > 0:\r\n                    for index, value in enumerate(children):\r\n                        if index % interval == 0:\r\n                            value.update(collapsed=\"false\")\r\n            return data", "entry_point": "_set_collapse_interval", "input": "2.0, False", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyecharts/pyecharts/blob/02050acb0e94bb9453b88a25028de7a0ce23f125/pyecharts/charts/basic_charts/tree.py#L19-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034032", "code": "def gen_table(contents):\n    \"\"\" creates a table given any set of columns \"\"\"\n    xlengths = []\n    ylengths = []\n    for column in contents:\n        col_len = 0\n        for entry in column:\n            lines = entry.split('\\n')\n            for line in lines:\n                col_len = max(len(line) + 2, col_len)\n        xlengths.append(col_len)\n    for i in range(len(contents[0])):\n        ymax = 0\n        for j in range(len(contents)):\n            ymax = max(ymax, len(contents[j][i].split('\\n')))\n        ylengths.append(ymax)\n\n    table_divider = '+' + ''.join(['-' * i + '+' for i in xlengths]) + '\\n'\n    table = table_divider\n    for i in range(len(ylengths)):\n        row = [column[i] for column in contents]\n        row = [entry + '\\n' * (ylengths[i]-len(entry.split('\\n'))) for entry in row]\n        row = [entry.split('\\n') for entry in row]\n        for j in range(ylengths[i]):\n            k = 0\n            for entry in row:\n                width = xlengths[k]\n                table += ''.join(['| {:{}}'.format(entry[j], width - 1)])\n                k += 1\n            table += '|\\n'\n        table += table_divider\n    return table + '\\n'", "entry_point": "gen_table", "input": "['apple', 'banana', 'cherry']", "output": "'+---+---+---+\\n| a | b | c |\\n+---+---+---+\\n| p | a | h |\\n+---+---+---+\\n| p | n | e |\\n+---+---+---+\\n| l | a | r |\\n+---+---+---+\\n| e | n | r |\\n+---+---+---+\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L123-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034033", "code": "def _to_bytes_or_false(val):  # type: (Union[Text, bytes]) -> Union[bytes, bool]\n    \"\"\"An internal graph to convert the input to a bytes or to False.\n\n    The criteria for conversion is as follows and should be python 2 and 3\n    compatible:\n    - If val is py2 str or py3 bytes: return bytes\n    - If val is py2 unicode or py3 str: return val.decode('utf-8')\n    - Otherwise, return False\n    \"\"\"\n    if isinstance(val, bytes):\n        return val\n    else:\n        try:\n            return val.encode('utf-8')\n        except AttributeError:\n            return False", "entry_point": "_to_bytes_or_false", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L179-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034034", "code": "def _remove_attributes(attrs, remove_list):\n    \"\"\"\n    Removes attributes in the remove list from the input attribute dict\n    :param attrs : Dict of operator attributes\n    :param remove_list : list of attributes to be removed\n\n    :return new_attr : Dict of operator attributes without the listed attributes.\n    \"\"\"\n    new_attrs = {}\n    for attr in attrs.keys():\n        if attr not in remove_list:\n            new_attrs[attr] = attrs[attr]\n    return new_attrs", "entry_point": "_remove_attributes", "input": "{'a': 1, 'b': 2}, 'walnut thistle harbour'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py#L49-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034035", "code": "def _add_extra_attributes(attrs, extra_attr_map):\n    \"\"\"\n    :param attrs:  Current Attribute list\n    :param extraAttrMap:  Additional attributes to be added\n    :return: new_attr\n    \"\"\"\n    for attr in extra_attr_map:\n        if attr not in attrs:\n            attrs[attr] = extra_attr_map[attr]\n    return attrs", "entry_point": "_add_extra_attributes", "input": "'a,b,c', set()", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py#L63-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034036", "code": "def _pad_sequence_fix(attr, kernel_dim=None):\n    \"\"\"Changing onnx's pads sequence to match with mxnet's pad_width\n    mxnet: (x1_begin, x1_end, ... , xn_begin, xn_end)\n    onnx: (x1_begin, x2_begin, ... , xn_end, xn_end)\"\"\"\n    new_attr = ()\n    if len(attr) % 2 == 0:\n        for index in range(int(len(attr) / 2)):\n            new_attr = new_attr + attr[index::int(len(attr) / 2)]\n        # Making sure pad values  are in the attr for all axes.\n        if kernel_dim is not None:\n            while len(new_attr) < kernel_dim*2:\n                new_attr = new_attr + (0, 0)\n\n    return new_attr", "entry_point": "_pad_sequence_fix", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py#L75-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034037", "code": "def _whctrs(anchor):\n        \"\"\"\n        Return width, height, x center, and y center for an anchor (window).\n        \"\"\"\n        w = anchor[2] - anchor[0] + 1\n        h = anchor[3] - anchor[1] + 1\n        x_ctr = anchor[0] + 0.5 * (w - 1)\n        y_ctr = anchor[1] + 0.5 * (h - 1)\n        return w, h, x_ctr, y_ctr", "entry_point": "_whctrs", "input": "[-1, 0, 1, 2]", "output": "(3, 3, 0.0, 1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rcnn/symdata/anchor.py#L56-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034038", "code": "def pad_sentences(sentences, padding_word=\"</s>\"):\n    \"\"\"Pads all sentences to the same length. The length is defined by the longest sentence.\n    Returns padded sentences.\n    \"\"\"\n    sequence_length = max(len(x) for x in sentences)\n    padded_sentences = []\n    for i, sentence in enumerate(sentences):\n        num_padding = sequence_length - len(sentence)\n        new_sentence = sentence + [padding_word] * num_padding\n        padded_sentences.append(new_sentence)\n    return padded_sentences", "entry_point": "pad_sentences", "input": "[[1, 2], [3], []], 'walnut thistle harbour'", "output": "[[1, 2], [3, 'walnut thistle harbour'], ['walnut thistle harbour', 'walnut thistle harbour']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/cnn_text_classification/data_helpers.py#L79-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034039", "code": "def zip_namedtuple(nt_list):\n    \"\"\" accept list of namedtuple, return a dict of zipped fields \"\"\"\n    if not nt_list:\n        return dict()\n    if not isinstance(nt_list, list):\n        nt_list = [nt_list]\n    for nt in nt_list:\n        assert type(nt) == type(nt_list[0])\n    ret = {k : [v] for k, v in nt_list[0]._asdict().items()}\n    for nt in nt_list[1:]:\n        for k, v in nt._asdict().items():\n            ret[k].append(v)\n    return ret", "entry_point": "zip_namedtuple", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/ssd/config/utils.py#L78-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034040", "code": "def _common_prefix(names):\n    \"\"\"Get the common prefix for all names\"\"\"\n    if not names:\n        return ''\n    prefix = names[0]\n    for name in names:\n        i = 0\n        while i < len(prefix) and i < len(name) and prefix[i] == name[i]:\n            i += 1\n        prefix = prefix[:i]\n    return prefix", "entry_point": "_common_prefix", "input": "'a,b,c'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/gluon/block.py#L939-L949", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034041", "code": "def transform_padding(pad_width):\n    \"\"\"Helper function to convert padding format for pad operator.\n    \"\"\"\n    num_pad_values = len(pad_width)\n    onnx_pad_width = [0]*num_pad_values\n\n    start_index = 0\n    # num_pad_values will always be multiple of 2\n    end_index = int(num_pad_values/2)\n    for idx in range(0, num_pad_values):\n        if idx % 2 == 0:\n            onnx_pad_width[start_index] = pad_width[idx]\n            start_index += 1\n        else:\n            onnx_pad_width[end_index] = pad_width[idx]\n            end_index += 1\n\n    return onnx_pad_width", "entry_point": "transform_padding", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L86-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034042", "code": "def get_palette(num_colors=256):\n    \"\"\"generates the colormap for visualizing the segmentation mask\n            Args:\n                num_colors (int): the number of colors to generate in the output palette\n\n            Returns:\n                string: the supplied extension, if assertion is successful.\n\n    \"\"\"\n    pallete = [0]*(num_colors*3)\n    for j in range(0, num_colors):\n        lab = j\n        pallete[j*3+0] = 0\n        pallete[j*3+1] = 0\n        pallete[j*3+2] = 0\n        i = 0\n        while (lab > 0):\n            pallete[j*3+0] |= (((lab >> 0) & 1) << (7-i))\n            pallete[j*3+1] |= (((lab >> 1) & 1) << (7-i))\n            pallete[j*3+2] |= (((lab >> 2) & 1) << (7-i))\n            i = i + 1\n            lab >>= 3\n    return pallete", "entry_point": "get_palette", "input": "1", "output": "[0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/fcn-xs/image_segmentaion.py#L47-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034043", "code": "def get_docker_tag(platform: str, registry: str) -> str:\n    \"\"\":return: docker tag to be used for the container\"\"\"\n    platform = platform if any(x in platform for x in ['build.', 'publish.']) else 'build.{}'.format(platform)\n    if not registry:\n        registry = \"mxnet_local\"\n    return \"{0}/{1}\".format(registry, platform)", "entry_point": "get_docker_tag", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "\"[-1, 0, 1, 2]/build.['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/ci/build.py#L102-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034044", "code": "def _has_instance(data, dtype):\n    \"\"\"Return True if ``data`` has instance of ``dtype``.\n    This function is called after _init_data.\n    ``data`` is a list of (str, NDArray)\"\"\"\n    for item in data:\n        _, arr = item\n        if isinstance(arr, dtype):\n            return True\n    return False", "entry_point": "_has_instance", "input": "[], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/io/utils.py#L63-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034045", "code": "def bbox_flip(bbox, width, flip_x=False):\n    \"\"\"\n    invalid value in bbox_transform if this wrong (no overlap), note index 0 and 2\n    also note need to save before assignment\n    :param bbox: [n][x1, y1, x2, y2]\n    :param width: cv2 (height, width, channel)\n    :param flip_x: will flip x1 and x2\n    :return: flipped box\n    \"\"\"\n    if flip_x:\n        xmax = width - bbox[:, 0]\n        xmin = width - bbox[:, 2]\n        bbox[:, 0] = xmin\n        bbox[:, 2] = xmax\n    return bbox", "entry_point": "bbox_flip", "input": "[-1, 0, 1, 2], 0, []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rcnn/symdata/bbox.py#L21-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034046", "code": "def init_states(batch_size, num_lstm_layer, num_hidden):\n    \"\"\"\n    Returns name and shape of init states of LSTM network\n\n    Parameters\n    ----------\n    batch_size: list of tuple of str and tuple of int and int\n    num_lstm_layer: int\n    num_hidden: int\n\n    Returns\n    -------\n    list of tuple of str and tuple of int and int\n    \"\"\"\n    init_c = [('l%d_init_c' % l, (batch_size, num_hidden)) for l in range(num_lstm_layer)]\n    init_h = [('l%d_init_h' % l, (batch_size, num_hidden)) for l in range(num_lstm_layer)]\n    return init_c + init_h", "entry_point": "init_states", "input": "-3, 1, 2", "output": "[('l0_init_c', (-3, 2)), ('l0_init_h', (-3, 2))]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/ctc/lstm.py#L158-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034047", "code": "def _indent(s_, numSpaces):\n    \"\"\"Indent string\n    \"\"\"\n    s = s_.split('\\n')\n    if len(s) == 1:\n        return s_\n    first = s.pop(0)\n    s = [first] + [(numSpaces * ' ') + line for line in s]\n    s = '\\n'.join(s)\n    return s", "entry_point": "_indent", "input": "'walnut thistle harbour', True", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/gluon/utils.py#L164-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034048", "code": "def ctc_label(p):\n        \"\"\"Iterates through p, identifying non-zero and non-repeating values, and returns them in a list Parameters\n        ----------\n        p: list of int\n\n        Returns\n        -------\n        list of int\n        \"\"\"\n        ret = []\n        p1 = [0] + p\n        for i, _ in enumerate(p):\n            c1 = p1[i]\n            c2 = p1[i+1]\n            if c2 in (0, c1):\n                continue\n            ret.append(c2)\n        return ret", "entry_point": "ctc_label", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/ctc/ctc_metrics.py#L34-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034049", "code": "def _remove_blank(l):\n        \"\"\" Removes trailing zeros in the list of integers and returns a new list of integers\"\"\"\n        ret = []\n        for i, _ in enumerate(l):\n            if l[i] == 0:\n                break\n            ret.append(l[i])\n        return ret", "entry_point": "_remove_blank", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/ctc/ctc_metrics.py#L54-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034050", "code": "def _get_subword_units(token, gram):\n    \"\"\"Return subword-units presentation, given a word/token.\n    \"\"\"\n    if token == '</s>':  # special token for padding purpose.\n        return [token]\n    t = '#' + token + '#'\n    return [t[i:i + gram] for i in range(0, len(t) - gram + 1)]", "entry_point": "_get_subword_units", "input": "'a,b,c', 1", "output": "['#', 'a', ',', 'b', ',', 'c', '#']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/nce-loss/text8_data.py#L68-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034051", "code": "def _get_oshape_of_gather_nd_op(dshape, ishape):\n    \"\"\"Given data and index shapes, get the output `NDArray` shape.\n    This basically implements the infer shape logic of op gather_nd.\"\"\"\n    assert len(dshape) > 0 and len(ishape) > 0\n    oshape = list(ishape[1:])\n    if ishape[0] < len(dshape):\n        oshape.extend(dshape[ishape[0]:])\n    return tuple(oshape)", "entry_point": "_get_oshape_of_gather_nd_op", "input": "[1, 2, 3], [1, 2, 3]", "output": "(2, 3, 2, 3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2347-L2354", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034052", "code": "def _get_broadcast_shape(shape1, shape2):\n    \"\"\"Given two shapes that are not identical, find the shape\n    that both input shapes can broadcast to.\"\"\"\n    if shape1 == shape2:\n        return shape1\n\n    length1 = len(shape1)\n    length2 = len(shape2)\n    if length1 > length2:\n        shape = list(shape1)\n    else:\n        shape = list(shape2)\n    i = max(length1, length2) - 1\n    for a, b in zip(shape1[::-1], shape2[::-1]):\n        if a != 1 and b != 1 and a != b:\n            raise ValueError('shape1=%s is not broadcastable to shape2=%s' % (shape1, shape2))\n        shape[i] = max(a, b)\n        i -= 1\n    return tuple(shape)", "entry_point": "_get_broadcast_shape", "input": "[], [-1, 0, 1, 2]", "output": "(-1, 0, 1, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2370-L2388", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034053", "code": "def _get_dict(names, ndarrays):\n        \"\"\"Get the dictionary given name and ndarray pairs.\"\"\"\n        nset = set()\n        for nm in names:\n            if nm in nset:\n                raise ValueError('Duplicate names detected, %s' % str(names))\n            nset.add(nm)\n        return dict(zip(names, ndarrays))", "entry_point": "_get_dict", "input": "'', [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/executor.py#L90-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034054", "code": "def convert_weights_to_numpy(weights_dict):\n        \"\"\"Convert weights to numpy\"\"\"\n        return dict([(k.replace(\"arg:\", \"\").replace(\"aux:\", \"\"), v.asnumpy())\n                     for k, v in weights_dict.items()])", "entry_point": "convert_weights_to_numpy", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py#L159-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034055", "code": "def tensors_blocked_by_false(ops):\n    \"\"\" Follows a set of ops assuming their value is False and find blocked Switch paths.\n\n    This is used to prune away parts of the model graph that are only used during the training\n    phase (like dropout, batch norm, etc.).\n    \"\"\"\n    blocked = []\n    def recurse(op):\n        if op.type == \"Switch\":\n            blocked.append(op.outputs[1]) # the true path is blocked since we assume the ops we trace are False\n        else:\n            for out in op.outputs:\n                for c in out.consumers():\n                    recurse(c)\n    for op in ops:\n        recurse(op)\n\n    return blocked", "entry_point": "tensors_blocked_by_false", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/slundberg/shap/blob/b280cb81d498b9d98565cad8dd16fc88ae52649f/shap/explainers/deep/deep_tf.py#L290-L307", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034056", "code": "def build_all_reduce_device_prefixes(job_name, num_tasks):\n    \"\"\"Build list of device prefix names for all_reduce.\n\n  Args:\n    job_name: \"worker\", \"ps\" or \"localhost\".\n    num_tasks: number of jobs across which device names should be generated.\n\n  Returns:\n     A list of device name prefix strings. Each element spells out the full\n     host name without adding the device.\n     e.g. \"/job:worker/task:0\"\n  \"\"\"\n    if job_name != \"localhost\":\n        return [\"/job:%s/task:%d\" % (job_name, d) for d in range(0, num_tasks)]\n    else:\n        assert num_tasks == 1\n        return [\"/job:%s\" % job_name]", "entry_point": "build_all_reduce_device_prefixes", "input": "'abc', 10", "output": "['/job:abc/task:0', '/job:abc/task:1', '/job:abc/task:2', '/job:abc/task:3', '/job:abc/task:4', '/job:abc/task:5', '/job:abc/task:6', '/job:abc/task:7', '/job:abc/task:8', '/job:abc/task:9']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ray-project/ray/blob/4eade036a0505e244c976f36aaa2d64386b5129b/python/ray/experimental/sgd/modified_allreduce.py#L151-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034057", "code": "def group_device_names(devices, group_size):\n    \"\"\"Group device names into groups of group_size.\n\n  Args:\n    devices: list of strings naming devices.\n    group_size: int >= 1\n\n  Returns:\n    list of lists of devices, where each inner list is group_size long,\n      and each device appears at least once in an inner list.  If\n      len(devices) % group_size = 0 then each device will appear\n      exactly once.\n\n  Raises:\n    ValueError: group_size > len(devices)\n  \"\"\"\n    num_devices = len(devices)\n    if group_size > num_devices:\n        raise ValueError(\n            \"only %d devices, but group_size=%d\" % (num_devices, group_size))\n    num_groups = (\n        num_devices // group_size + (1 if\n                                     (num_devices % group_size != 0) else 0))\n    groups = [[] for i in range(num_groups)]\n    for i in range(0, num_groups * group_size):\n        groups[i % num_groups].append(devices[i % num_devices])\n    return groups", "entry_point": "group_device_names", "input": "[[1, 2], [3], []], 1", "output": "[[[1, 2]], [[3]], [[]]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ray-project/ray/blob/4eade036a0505e244c976f36aaa2d64386b5129b/python/ray/experimental/sgd/modified_allreduce.py#L170-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034058", "code": "def split_grads_by_size(threshold_size, device_grads):\n    \"\"\"Break gradients into two sets according to tensor size.\n\n  Args:\n    threshold_size: int size cutoff for small vs large tensor.\n    device_grads: List of lists of (gradient, variable) tuples.  The outer\n        list is over devices. The inner list is over individual gradients.\n\n  Returns:\n    small_grads: Subset of device_grads where shape is <= theshold_size\n       elements.\n    large_grads: Subset of device_grads where shape is > threshold_size\n       elements.\n  \"\"\"\n    small_grads = []\n    large_grads = []\n    for dl in device_grads:\n        small_dl = []\n        large_dl = []\n        for (g, v) in dl:\n            tensor_size = g.get_shape().num_elements()\n            if tensor_size <= threshold_size:\n                small_dl.append([g, v])\n            else:\n                large_dl.append([g, v])\n        if small_dl:\n            small_grads.append(small_dl)\n        if large_dl:\n            large_grads.append(large_dl)\n    return small_grads, large_grads", "entry_point": "split_grads_by_size", "input": "1, []", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ray-project/ray/blob/4eade036a0505e244c976f36aaa2d64386b5129b/python/ray/experimental/sgd/modified_allreduce.py#L199-L228", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034059", "code": "def extract_ranges(index_list, range_size_limit=32):\n    \"\"\"Extract consecutive ranges and singles from index_list.\n\n  Args:\n    index_list: List of monotone increasing non-negative integers.\n    range_size_limit: Largest size range to return.  If a larger\n      consecutive range exists it will be returned as multiple\n      ranges.\n\n  Returns:\n   ranges, singles where ranges is a list of [first, last] pairs of\n     consecutive elements in index_list, and singles is all of the\n     other elements, in original order.\n  \"\"\"\n    if not index_list:\n        return [], []\n    first = index_list[0]\n    last = first\n    ranges = []\n    singles = []\n    for i in index_list[1:]:\n        if i == last + 1 and (last - first) <= range_size_limit:\n            last = i\n        else:\n            if last > first:\n                ranges.append([first, last])\n            else:\n                singles.append(first)\n            first = i\n            last = i\n    if last > first:\n        ranges.append([first, last])\n    else:\n        singles.append(first)\n    return ranges, singles", "entry_point": "extract_ranges", "input": "[5, 3, 1, 4], 1", "output": "([], [5, 3, 1, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ray-project/ray/blob/4eade036a0505e244c976f36aaa2d64386b5129b/python/ray/experimental/sgd/modified_allreduce.py#L448-L482", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034060", "code": "def libname_from_dir(dirname):\n    \"\"\"Reconstruct the library name without it's version\"\"\"\n    parts = []\n    for part in dirname.split('-'):\n        if part[0].isdigit():\n            break\n        parts.append(part)\n    return '-'.join(parts)", "entry_point": "libname_from_dir", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/tasks/vendoring/__init__.py#L603-L610", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034061", "code": "def _convert_hashes(values):\n    \"\"\"Convert Pipfile.lock hash lines into InstallRequirement option format.\n\n    The option format uses a str-list mapping. Keys are hash algorithms, and\n    the list contains all values of that algorithm.\n    \"\"\"\n    hashes = {}\n    if not values:\n        return hashes\n    for value in values:\n        try:\n            name, value = value.split(\":\", 1)\n        except ValueError:\n            name = \"sha256\"\n        if name not in hashes:\n            hashes[name] = []\n        hashes[name].append(value)\n    return hashes", "entry_point": "_convert_hashes", "input": "['apple', 'banana', 'cherry']", "output": "{'sha256': ['apple', 'banana', 'cherry']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/internals/_pip.py#L113-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034062", "code": "def split_command_line(command_line):\n\n    '''This splits a command line into a list of arguments. It splits arguments\n    on spaces, but handles embedded quotes, doublequotes, and escaped\n    characters. It's impossible to do this with a regular expression, so I\n    wrote a little state machine to parse the command line. '''\n\n    arg_list = []\n    arg = ''\n\n    # Constants to name the states we can be in.\n    state_basic = 0\n    state_esc = 1\n    state_singlequote = 2\n    state_doublequote = 3\n    # The state when consuming whitespace between commands.\n    state_whitespace = 4\n    state = state_basic\n\n    for c in command_line:\n        if state == state_basic or state == state_whitespace:\n            if c == '\\\\':\n                # Escape the next character\n                state = state_esc\n            elif c == r\"'\":\n                # Handle single quote\n                state = state_singlequote\n            elif c == r'\"':\n                # Handle double quote\n                state = state_doublequote\n            elif c.isspace():\n                # Add arg to arg_list if we aren't in the middle of whitespace.\n                if state == state_whitespace:\n                    # Do nothing.\n                    None\n                else:\n                    arg_list.append(arg)\n                    arg = ''\n                    state = state_whitespace\n            else:\n                arg = arg + c\n                state = state_basic\n        elif state == state_esc:\n            arg = arg + c\n            state = state_basic\n        elif state == state_singlequote:\n            if c == r\"'\":\n                state = state_basic\n            else:\n                arg = arg + c\n        elif state == state_doublequote:\n            if c == r'\"':\n                state = state_basic\n            else:\n                arg = arg + c\n\n    if arg != '':\n        arg_list.append(arg)\n    return arg_list", "entry_point": "split_command_line", "input": "'Hello World'", "output": "['Hello', 'World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/utils.py#L69-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034063", "code": "def is_required_version(version, specified_version):\n    \"\"\"Check to see if there's a hard requirement for version\n    number provided in the Pipfile.\n    \"\"\"\n    # Certain packages may be defined with multiple values.\n    if isinstance(specified_version, dict):\n        specified_version = specified_version.get(\"version\", \"\")\n    if specified_version.startswith(\"==\"):\n        return version.strip() == specified_version.split(\"==\")[1].strip()\n\n    return True", "entry_point": "is_required_version", "input": "{'a': 1, 'b': 2}, {'a': 1, 'b': 2}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/utils.py#L1185-L1195", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034064", "code": "def multi_split(s, split):\n    # type: (S, Iterable[S]) -> List[S]\n    \"\"\"Splits on multiple given separators.\"\"\"\n    for r in split:\n        s = s.replace(r, \"|\")\n    return [i for i in s.split(\"|\") if len(i) > 0]", "entry_point": "multi_split", "input": "'Hello World', ['a', 'b', 'c']", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requirementslib/utils.py#L172-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034065", "code": "def first(iterable, default=None, key=None):\n    \"\"\"\n    Return first element of `iterable` that evaluates true, else return None\n    (or an optional default value).\n\n    >>> first([0, False, None, [], (), 42])\n    42\n\n    >>> first([0, False, None, [], ()]) is None\n    True\n\n    >>> first([0, False, None, [], ()], default='ohai')\n    'ohai'\n\n    >>> import re\n    >>> m = first(re.match(regex, 'abc') for regex in ['b.*', 'a(.*)'])\n    >>> m.group(1)\n    'bc'\n\n    The optional `key` argument specifies a one-argument predicate function\n    like that used for `filter()`.  The `key` argument, if supplied, must be\n    in keyword form.  For example:\n\n    >>> first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0)\n    4\n\n    \"\"\"\n    if key is None:\n        for el in iterable:\n            if el:\n                return el\n    else:\n        for el in iterable:\n            if key(el):\n                return el\n\n    return default", "entry_point": "first", "input": "[], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/first.py#L42-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034066", "code": "def break_args_options(line):\n    # type: (Text) -> Tuple[str, Text]\n    \"\"\"Break up the line into an args and options string.  We only want to shlex\n    (and then optparse) the options, not the args.  args can contain markers\n    which are corrupted by shlex.\n    \"\"\"\n    tokens = line.split(' ')\n    args = []\n    options = tokens[:]\n    for token in tokens:\n        if token.startswith('-') or token.startswith('--'):\n            break\n        else:\n            args.append(token)\n            options.pop(0)\n    return ' '.join(args), ' '.join(options)", "entry_point": "break_args_options", "input": "'Hello World'", "output": "('Hello World', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/req/req_file.py#L258-L273", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034067", "code": "def _parse_lsb_release_content(lines):\n        \"\"\"\n        Parse the output of the lsb_release command.\n\n        Parameters:\n\n        * lines: Iterable through the lines of the lsb_release output.\n                 Each line must be a unicode string or a UTF-8 encoded byte\n                 string.\n\n        Returns:\n            A dictionary containing all information items.\n        \"\"\"\n        props = {}\n        for line in lines:\n            kv = line.strip('\\n').split(':', 1)\n            if len(kv) != 2:\n                # Ignore lines without colon.\n                continue\n            k, v = kv\n            props.update({k.replace(' ', '_').lower(): v.strip()})\n        return props", "entry_point": "_parse_lsb_release_content", "input": "'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_vendor/distro.py#L1005-L1026", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034068", "code": "def _normalize_purge_unknown(mapping, schema):\n        \"\"\" {'type': 'boolean'} \"\"\"\n        for field in tuple(mapping):\n            if field not in schema:\n                del mapping[field]\n        return mapping", "entry_point": "_normalize_purge_unknown", "input": "{}, ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/cerberus/validator.py#L751-L756", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034069", "code": "def do_last(environment, seq):\n    \"\"\"Return the last item of a sequence.\"\"\"\n    try:\n        return next(iter(reversed(seq)))\n    except StopIteration:\n        return environment.undefined('No last item, sequence was empty.')", "entry_point": "do_last", "input": "[-1, 0, 1, 2], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L442-L447", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034070", "code": "def do_filesizeformat(value, binary=False):\n    \"\"\"Format the value like a 'human-readable' file size (i.e. 13 kB,\n    4.1 MB, 102 Bytes, etc).  Per default decimal prefixes are used (Mega,\n    Giga, etc.), if the second parameter is set to `True` the binary\n    prefixes are used (Mebi, Gibi).\n    \"\"\"\n    bytes = float(value)\n    base = binary and 1024 or 1000\n    prefixes = [\n        (binary and 'KiB' or 'kB'),\n        (binary and 'MiB' or 'MB'),\n        (binary and 'GiB' or 'GB'),\n        (binary and 'TiB' or 'TB'),\n        (binary and 'PiB' or 'PB'),\n        (binary and 'EiB' or 'EB'),\n        (binary and 'ZiB' or 'ZB'),\n        (binary and 'YiB' or 'YB')\n    ]\n    if bytes == 1:\n        return '1 Byte'\n    elif bytes < base:\n        return '%d Bytes' % bytes\n    else:\n        for i, prefix in enumerate(prefixes):\n            unit = base ** (i + 2)\n            if bytes < unit:\n                return '%.1f %s' % ((base * bytes / unit), prefix)\n        return '%.1f %s' % ((base * bytes / unit), prefix)", "entry_point": "do_filesizeformat", "input": "False, {}", "output": "'0 Bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/jinja2/filters.py#L459-L486", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034071", "code": "def _get_activate_script(cmd, venv):\n    \"\"\"Returns the string to activate a virtualenv.\n\n    This is POSIX-only at the moment since the compat (pexpect-based) shell\n    does not work elsewhere anyway.\n    \"\"\"\n    # Suffix and source command for other shells.\n    # Support for fish shell.\n    if \"fish\" in cmd:\n        suffix = \".fish\"\n        command = \"source\"\n    # Support for csh shell.\n    elif \"csh\" in cmd:\n        suffix = \".csh\"\n        command = \"source\"\n    else:\n        suffix = \"\"\n        command = \".\"\n    # Escape any spaces located within the virtualenv path to allow\n    # for proper activation.\n    venv_location = str(venv).replace(\" \", r\"\\ \")\n    # The leading space can make history cleaner in some shells.\n    return \" {2} {0}/bin/activate{1}\".format(venv_location, suffix, command)", "entry_point": "_get_activate_script", "input": "['a', 'b', 'c'], []", "output": "' . []/bin/activate'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/shells.py#L32-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034072", "code": "def _normalize_name(name):\n    # type: (str) -> str\n    \"\"\"Make a name consistent regardless of source (environment or file)\n    \"\"\"\n    name = name.lower().replace('_', '-')\n    if name.startswith('--'):\n        name = name[2:]  # only prefer long opts\n    return name", "entry_point": "_normalize_name", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/configuration.py#L43-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034073", "code": "def _collect_derived_entries(state, traces, identifiers):\n    \"\"\"Produce a mapping containing all candidates derived from `identifiers`.\n\n    `identifiers` should provide a collection of requirement identifications\n    from a section (i.e. `packages` or `dev-packages`). This function uses\n    `trace` to filter out candidates in the state that are present because of\n    an entry in that collection.\n    \"\"\"\n    identifiers = set(identifiers)\n    if not identifiers:\n        return {}\n\n    entries = {}\n    extras = {}\n    for identifier, requirement in state.mapping.items():\n        routes = {trace[1] for trace in traces[identifier] if len(trace) > 1}\n        if identifier not in identifiers and not (identifiers & routes):\n            continue\n        name = requirement.normalized_name\n        if requirement.extras:\n            # Aggregate extras from multiple routes so we can produce their\n            # union in the lock file. (sarugaku/passa#24)\n            try:\n                extras[name].extend(requirement.extras)\n            except KeyError:\n                extras[name] = list(requirement.extras)\n        entries[name] = next(iter(requirement.as_pipfile().values()))\n    for name, ext in extras.items():\n        entries[name][\"extras\"] = ext\n\n    return entries", "entry_point": "_collect_derived_entries", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/passa/models/lockers.py#L48-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034074", "code": "def _cast_boolean(value):\n    \"\"\"\n    Helper to convert config values to boolean as ConfigParser do.\n    \"\"\"\n    _BOOLEANS = {'1': True, 'yes': True, 'true': True, 'on': True,\n                 '0': False, 'no': False, 'false': False, 'off': False, '': False}\n    value = str(value)\n    if value.lower() not in _BOOLEANS:\n        raise ValueError('Not a boolean: %s' % value)\n\n    return _BOOLEANS[value.lower()]", "entry_point": "_cast_boolean", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/dotenv/environ.py#L17-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034075", "code": "def invalid_config_error_message(action, key, val):\n    \"\"\"Returns a better error message when invalid configuration option\n    is provided.\"\"\"\n    if action in ('store_true', 'store_false'):\n        return (\"{0} is not a valid value for {1} option, \"\n                \"please specify a boolean value like yes/no, \"\n                \"true/false or 1/0 instead.\").format(val, key)\n\n    return (\"{0} is not a valid value for {1} option, \"\n            \"please specify a numerical value like 1/0 \"\n            \"instead.\").format(val, key)", "entry_point": "invalid_config_error_message", "input": "['apple', 'banana', 'cherry'], [1, 2, 3], [-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2] is not a valid value for [1, 2, 3] option, please specify a numerical value like 1/0 instead.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/patched/notpip/_internal/cli/parser.py#L251-L261", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034076", "code": "def constrain (n, min, max):\n\n    '''This returns a number, n constrained to the min and max bounds. '''\n\n    if n < min:\n        return min\n    if n > max:\n        return max\n    return n", "entry_point": "constrain", "input": "[], [1, 2, 3], [-1, 0, 1, 2]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/pexpect/screen.py#L60-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034077", "code": "def split_first(s, delims):\n    \"\"\"\n    Given a string and an iterable of delimiters, split on the first found\n    delimiter. Return two split parts and the matched delimiter.\n\n    If not found, then the first part is the full input string.\n\n    Example::\n\n        >>> split_first('foo/bar?baz', '?/=')\n        ('foo', 'bar?baz', '/')\n        >>> split_first('foo/bar?baz', '123')\n        ('foo/bar?baz', '', None)\n\n    Scales linearly with number of delims. Not ideal for large number of delims.\n    \"\"\"\n    min_idx = None\n    min_delim = None\n    for d in delims:\n        idx = s.find(d)\n        if idx < 0:\n            continue\n\n        if min_idx is None or idx < min_idx:\n            min_idx = idx\n            min_delim = d\n\n    if min_idx is None or min_idx < 0:\n        return s, '', None\n\n    return s[:min_idx], s[min_idx + 1:], min_delim", "entry_point": "split_first", "input": "['apple', 'banana', 'cherry'], []", "output": "(['apple', 'banana', 'cherry'], '', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/urllib3/util/url.py#L99-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034078", "code": "def dict_from_cookiejar(cj):\n    \"\"\"Returns a key/value dictionary from a CookieJar.\n\n    :param cj: CookieJar object to extract cookies from.\n    :rtype: dict\n    \"\"\"\n\n    cookie_dict = {}\n\n    for cookie in cj:\n        cookie_dict[cookie.name] = cookie.value\n\n    return cookie_dict", "entry_point": "dict_from_cookiejar", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/pipenv/blob/cae8d76c210b9777e90aab76e9c4b0e53bb19cde/pipenv/vendor/requests/utils.py#L404-L416", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034079", "code": "def _merge_simple(adjustment_lists, front_idx, back_idx):\n    \"\"\"\n    Merge lists of new and existing adjustments for a given index by appending\n    or prepending new adjustments to existing adjustments.\n\n    Notes\n    -----\n    This method is meant to be used with ``toolz.merge_with`` to merge\n    adjustment mappings. In case of a collision ``adjustment_lists`` contains\n    two lists, existing adjustments at index 0 and new adjustments at index 1.\n    When there are no collisions, ``adjustment_lists`` contains a single list.\n\n    Parameters\n    ----------\n    adjustment_lists : list[list[Adjustment]]\n        List(s) of new and/or existing adjustments for a given index.\n    front_idx : int\n        Index of list in ``adjustment_lists`` that should be used as baseline\n        in case of a collision.\n    back_idx : int\n        Index of list in ``adjustment_lists`` that should extend baseline list\n        in case of a collision.\n\n    Returns\n    -------\n    adjustments : list[Adjustment]\n        List of merged adjustments for a given index.\n    \"\"\"\n    if len(adjustment_lists) == 1:\n        return list(adjustment_lists[0])\n    else:\n        return adjustment_lists[front_idx] + adjustment_lists[back_idx]", "entry_point": "_merge_simple", "input": "[[1, 2], [3], []], 2, 1", "output": "[3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/lib/adjusted_array.py#L139-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034080", "code": "def bulleted_list(items, max_count=None, indent=2):\n    \"\"\"Format a bulleted list of values.\n    \"\"\"\n    if max_count is not None and len(items) > max_count:\n        item_list = list(items)\n        items = item_list[:max_count - 1]\n        items.append('...')\n        items.append(item_list[-1])\n\n    line_template = (\" \" * indent) + \"- {}\"\n    return \"\\n\".join(map(line_template.format, items))", "entry_point": "bulleted_list", "input": "{1, 2, 3}, 1, 0", "output": "'- ...\\n- 3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/string_formatting.py#L1-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034081", "code": "def _filter_kwargs(names, dict_):\n    \"\"\"Filter out kwargs from a dictionary.\n\n    Parameters\n    ----------\n    names : set[str]\n        The names to select from ``dict_``.\n    dict_ : dict[str, any]\n        The dictionary to select from.\n\n    Returns\n    -------\n    kwargs : dict[str, any]\n        ``dict_`` where the keys intersect with ``names`` and the values are\n        not None.\n    \"\"\"\n    return {k: v for k, v in dict_.items() if k in names and v is not None}", "entry_point": "_filter_kwargs", "input": "'  padded  ', {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/assets/assets.py#L193-L209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034082", "code": "def _replace_str_html(s):\n    \"\"\"\u66ff\u6362html\u2018&quot;\u2019\u7b49\u8f6c\u4e49\u5185\u5bb9\u4e3a\u6b63\u5e38\u5185\u5bb9\n\n    Args:\n        s: \u6587\u5b57\u5185\u5bb9\n\n    Returns:\n        s: \u5904\u7406\u53cd\u8f6c\u4e49\u540e\u7684\u6587\u5b57\n    \"\"\"\n    html_str_list = [\n        ('&#39;', '\\''),\n        ('&quot;', '\"'),\n        ('&amp;', '&'),\n        ('&yen;', '\u00a5'),\n        ('amp;', ''),\n        ('&lt;', '<'),\n        ('&gt;', '>'),\n        ('&nbsp;', ' '),\n        ('\\\\', '')\n    ]\n    for i in html_str_list:\n        s = s.replace(i[0], i[1])\n    return s", "entry_point": "_replace_str_html", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Chyroc/WechatSogou/blob/2e0e9886f555fd8bcfc7ae9718ced6ce955cd24a/wechatsogou/tools.py#L73-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034083", "code": "def pad_decr(ids):\n  \"\"\"Strip ID 0 and decrement ids by 1.\"\"\"\n  if len(ids) < 1:\n    return list(ids)\n  if not any(ids):\n    return []  # all padding.\n  idx = -1\n  while not ids[idx]:\n    idx -= 1\n  if idx == -1:\n    ids = ids\n  else:\n    ids = ids[:idx + 1]\n  return [i - 1 for i in ids]", "entry_point": "pad_decr", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/datasets/blob/46ceb0cf7b4690f38ecbbc689e4d659a903d08dc/tensorflow_datasets/core/features/text/text_encoder.py#L426-L439", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034084", "code": "def get_shard_id2num_examples(num_shards, total_num_examples):\n  \"\"\"Return the mapping shard_id=>num_examples, assuming round-robin.\"\"\"\n  # TODO(b/130353071): This has the strong assumption that the shards have\n  # been written in a round-robin fashion. This assumption does not hold, for\n  # instance, with Beam generation. The mapping shard_id=>num_examples\n  # should be computed during generation.\n\n  # Minimum number of example per shards\n  num_example_in_shard = total_num_examples // num_shards\n  shard_id2num_examples = [num_example_in_shard for _ in range(num_shards)]\n  # If there are remaining examples, we add them to the first shards\n  for shard_id in range(total_num_examples % num_shards):\n    shard_id2num_examples[shard_id] += 1\n  return shard_id2num_examples", "entry_point": "get_shard_id2num_examples", "input": "10, 0", "output": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/datasets/blob/46ceb0cf7b4690f38ecbbc689e4d659a903d08dc/tensorflow_datasets/core/splits.py#L489-L502", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034085", "code": "def compute_mask_offsets(shard_id2num_examples):\n  \"\"\"Return the list of offsets associated with each shards.\n\n  Args:\n    shard_id2num_examples: `list[int]`, mapping shard_id=>num_examples\n\n  Returns:\n    mask_offsets: `list[int]`, offset to skip for each of the shard\n  \"\"\"\n  total_num_examples = sum(shard_id2num_examples)\n\n  mask_offsets = []\n  total_num_examples = 0\n  for num_examples_in_shard in shard_id2num_examples:\n    # The offset (nb of examples to skip in the next shard) correspond to the\n    # number of examples remaining in the current shard\n    mask_offsets.append(total_num_examples % 100)\n    total_num_examples += num_examples_in_shard\n\n  return mask_offsets", "entry_point": "compute_mask_offsets", "input": "()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/datasets/blob/46ceb0cf7b4690f38ecbbc689e4d659a903d08dc/tensorflow_datasets/core/splits.py#L505-L524", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034086", "code": "def sharded_filenames(filename_prefix, num_shards):\n  \"\"\"Sharded filenames given prefix and number of shards.\"\"\"\n  shard_suffix = \"%05d-of-%05d\"\n  return [\n      \"%s-%s\" % (filename_prefix, shard_suffix % (i, num_shards))\n      for i in range(num_shards)\n  ]", "entry_point": "sharded_filenames", "input": "'  padded  ', 2", "output": "['  padded  -00000-of-00002', '  padded  -00001-of-00002']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/datasets/blob/46ceb0cf7b4690f38ecbbc689e4d659a903d08dc/tensorflow_datasets/core/naming.py#L52-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034087", "code": "def timer(diff, processed):\n    \"\"\"Return the passed time.\"\"\"\n    # Changes seconds into minutes and seconds\n    minutes, seconds = divmod(diff, 60)\n    try:\n        # Finds average time taken by requests\n        time_per_request = diff / float(len(processed))\n    except ZeroDivisionError:\n        time_per_request = 0\n    return minutes, seconds, time_per_request", "entry_point": "timer", "input": "True, set()", "output": "(0, 1, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/s0md3v/Photon/blob/6a29f2c9782ea9b3dc090db1774a259033600e39/core/utils.py#L87-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034088", "code": "def QA_util_dict_remove_key(dicts, key):\n    \"\"\"\n    \u8f93\u5165\u4e00\u4e2adict \u8fd4\u56de\u5220\u9664\u540e\u7684\n    \"\"\"\n\n    if isinstance(key, list):\n        for item in key:\n            try:\n                dicts.pop(item)\n            except:\n                pass\n    else:\n        try:\n            dicts.pop(key)\n        except:\n            pass\n    return dicts", "entry_point": "QA_util_dict_remove_key", "input": "{'a': 1, 'b': 2}, []", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAUtil/QADict.py#L26-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034089", "code": "def QA_util_date_str2int(date):\n    \"\"\"\n    \u65e5\u671f\u5b57\u7b26\u4e32 '2011-09-11' \u53d8\u6362\u6210 \u6574\u6570 20110911\n    \u65e5\u671f\u5b57\u7b26\u4e32 '2018-12-01' \u53d8\u6362\u6210 \u6574\u6570 20181201\n    :param date: str\u65e5\u671f\u5b57\u7b26\u4e32\n    :return: \u7c7b\u578bint\n    \"\"\"\n    # return int(str(date)[0:4] + str(date)[5:7] + str(date)[8:10])\n    if isinstance(date, str):\n        return int(str().join(date.split('-')))\n    elif isinstance(date, int):\n        return date", "entry_point": "QA_util_date_str2int", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAUtil/QADate.py#L60-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034090", "code": "def for_sz(code):\n    \"\"\"\u6df1\u5e02\u4ee3\u7801\u5206\u7c7b\n\n    Arguments:\n        code {[type]} -- [description]\n\n    Returns:\n        [type] -- [description]\n    \"\"\"\n\n    if str(code)[0:2] in ['00', '30', '02']:\n        return 'stock_cn'\n    elif str(code)[0:2] in ['39']:\n        return 'index_cn'\n    elif str(code)[0:2] in ['15']:\n        return 'etf_cn'\n    elif str(code)[0:2] in ['10', '11', '12', '13']:\n        # 10xxxx \u56fd\u503a\u73b0\u8d27\n        # 11xxxx \u503a\u5238\n        # 12xxxx \u53ef\u8f6c\u6362\u503a\u5238\n        # 12xxxx \u56fd\u503a\u56de\u8d2d\n        return 'bond_cn'\n\n    elif str(code)[0:2] in ['20']:\n        return 'stockB_cn'\n    else:\n        return 'undefined'", "entry_point": "for_sz", "input": "[]", "output": "'undefined'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L591-L617", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034091", "code": "def check_dynamic_route_exists(pattern, routes_to_check, parameters):\n        \"\"\"\n        Check if a URL pattern exists in a list of routes provided based on\n        the comparison of URL pattern and the parameters.\n\n        :param pattern: URL parameter pattern\n        :param routes_to_check: list of dynamic routes either hashable or\n            unhashable routes.\n        :param parameters: List of :class:`Parameter` items\n        :return: Tuple of index and route if matching route exists else\n            -1 for index and None for route\n        \"\"\"\n        for ndx, route in enumerate(routes_to_check):\n            if route.pattern == pattern and route.parameters == parameters:\n                return ndx, route\n        else:\n            return -1, None", "entry_point": "check_dynamic_route_exists", "input": "{1, 2, 3}, {}, 0.5", "output": "(-1, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/huge-success/sanic/blob/6a4a3f617fdbe1d3ee8bdc9d1b12ad2d0b34acdd/sanic/router.py#L333-L349", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034092", "code": "def bbox_vflip(bbox, rows, cols):\n    \"\"\"Flip a bounding box vertically around the x-axis.\"\"\"\n    x_min, y_min, x_max, y_max = bbox\n    return [x_min, 1 - y_max, x_max, 1 - y_min]", "entry_point": "bbox_vflip", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], []", "output": "[-1, -1, 1, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/albu/albumentations/blob/b31393cd6126516d37a84e44c879bd92c68ffc93/albumentations/augmentations/functional.py#L918-L921", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034093", "code": "def bbox_hflip(bbox, rows, cols):\n    \"\"\"Flip a bounding box horizontally around the y-axis.\"\"\"\n    x_min, y_min, x_max, y_max = bbox\n    return [1 - x_max, y_min, 1 - x_min, y_max]", "entry_point": "bbox_hflip", "input": "[5, 3, 1, 4], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "[0, 3, -4, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/albu/albumentations/blob/b31393cd6126516d37a84e44c879bd92c68ffc93/albumentations/augmentations/functional.py#L924-L927", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034094", "code": "def py3round(number):\n    \"\"\"Unified rounding in all python versions.\"\"\"\n    if abs(round(number) - number) == 0.5:\n        return int(2.0 * round(number / 2.0))\n\n    return int(round(number))", "entry_point": "py3round", "input": "10", "output": "10", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/albu/albumentations/blob/b31393cd6126516d37a84e44c879bd92c68ffc93/albumentations/augmentations/functional.py#L1133-L1138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034095", "code": "def denormalize_bbox(bbox, rows, cols):\n    \"\"\"Denormalize coordinates of a bounding box. Multiply x-coordinates by image width and y-coordinates\n    by image height. This is an inverse operation for :func:`~albumentations.augmentations.bbox.normalize_bbox`.\n    \"\"\"\n    if rows == 0:\n        raise ValueError('Argument rows cannot be zero')\n    if cols == 0:\n        raise ValueError('Argument cols cannot be zero')\n\n    x_min, y_min, x_max, y_max = bbox[:4]\n    denormalized_bbox = [x_min * cols, y_min * rows, x_max * cols, y_max * rows]\n    return denormalized_bbox + list(bbox[4:])", "entry_point": "denormalize_bbox", "input": "[-1, 0, 1, 2], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "[[], [], [[1, 2], [3], []], [5, 3, 1, 4, 5, 3, 1, 4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/albu/albumentations/blob/b31393cd6126516d37a84e44c879bd92c68ffc93/albumentations/augmentations/bbox_utils.py#L23-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034096", "code": "def _is_path_match(req_path: str, cookie_path: str) -> bool:\n        \"\"\"Implements path matching adhering to RFC 6265.\"\"\"\n        if not req_path.startswith(\"/\"):\n            req_path = \"/\"\n\n        if req_path == cookie_path:\n            return True\n\n        if not req_path.startswith(cookie_path):\n            return False\n\n        if cookie_path.endswith(\"/\"):\n            return True\n\n        non_matching = req_path[len(cookie_path):]\n\n        return non_matching.startswith(\"/\")", "entry_point": "_is_path_match", "input": "'AbC dEf', 'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aio-libs/aiohttp/blob/9504fe2affaaff673fa4f3754c1c44221f8ba47d/aiohttp/cookiejar.py#L245-L261", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034097", "code": "def _split_index(params):\n    \"\"\"Delete index information from params\n\n    Parameters\n    ----------\n    params : dict\n\n    Returns\n    -------\n    result : dict\n    \"\"\"\n    result = {}\n    for key in params:\n        if isinstance(params[key], dict):\n            value = params[key]['_value']\n        else:\n            value = params[key]\n        result[key] = value\n    return result", "entry_point": "_split_index", "input": "[-1, 0, 1, 2]", "output": "{-1: 2, 0: -1, 1: 0, 2: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/evolution_tuner/evolution_tuner.py#L131-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034098", "code": "def skip_connection_distance(a, b):\n    \"\"\"The distance between two skip-connections.\"\"\"\n    if a[2] != b[2]:\n        return 1.0\n    len_a = abs(a[1] - a[0])\n    len_b = abs(b[1] - b[0])\n    return (abs(a[0] - b[0]) + abs(len_a - len_b)) / (max(a[0], b[0]) + max(len_a, len_b))", "entry_point": "skip_connection_distance", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/bayesian.py#L92-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034099", "code": "def collect_vocab(qp_pairs):\n    '''\n    Build the vocab from corpus.\n    '''\n    vocab = set()\n    for qp_pair in qp_pairs:\n        for word in qp_pair['question_tokens']:\n            vocab.add(word['word'])\n        for word in qp_pair['passage_tokens']:\n            vocab.add(word['word'])\n    return vocab", "entry_point": "collect_vocab", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/data.py#L124-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034100", "code": "def get_word_index(tokens, char_index):\n    '''\n    Given word return word index.\n    '''\n    for (i, token) in enumerate(tokens):\n        if token['char_end'] == 0:\n            continue\n        if token['char_begin'] <= char_index and char_index <= token['char_end']:\n            return i\n    return 0", "entry_point": "get_word_index", "input": "[], 10", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/data.py#L211-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034101", "code": "def get_buckets(min_length, max_length, bucket_count):\n    '''\n    Get bucket by length.\n    '''\n    if bucket_count <= 0:\n        return [max_length]\n    unit_length = int((max_length - min_length) // (bucket_count))\n    buckets = [min_length + unit_length *\n               (i + 1) for i in range(0, bucket_count)]\n    buckets[-1] = max_length\n    return buckets", "entry_point": "get_buckets", "input": "-3, 0, 5", "output": "[-3, -3, -3, -3, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/data.py#L249-L259", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034102", "code": "def extract_scalar_reward(value, scalar_key='default'):\n    \"\"\"\n    Extract scalar reward from trial result.\n\n    Raises\n    ------\n    RuntimeError\n        Incorrect final result: the final result should be float/int,\n        or a dict which has a key named \"default\" whose value is float/int.\n    \"\"\"\n    if isinstance(value, float) or isinstance(value, int):\n        reward = value\n    elif isinstance(value, dict) and scalar_key in value and isinstance(value[scalar_key], (float, int)):\n        reward = value[scalar_key]\n    else:\n        raise RuntimeError('Incorrect final result: the final result should be float/int, or a dict which has a key named \"default\" whose value is float/int.')\n    return reward", "entry_point": "extract_scalar_reward", "input": "False, 0.5", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/utils.py#L25-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034103", "code": "def get_stock_type(stock_code):\n    \"\"\"\u5224\u65ad\u80a1\u7968ID\u5bf9\u5e94\u7684\u8bc1\u5238\u5e02\u573a\n    \u5339\u914d\u89c4\u5219\n    ['50', '51', '60', '90', '110'] \u4e3a sh\n    ['00', '13', '18', '15', '16', '18', '20', '30', '39', '115'] \u4e3a sz\n    ['5', '6', '9'] \u5f00\u5934\u7684\u4e3a sh\uff0c \u5176\u4f59\u4e3a sz\n    :param stock_code:\u80a1\u7968ID, \u82e5\u4ee5 'sz', 'sh' \u5f00\u5934\u76f4\u63a5\u8fd4\u56de\u5bf9\u5e94\u7c7b\u578b\uff0c\u5426\u5219\u4f7f\u7528\u5185\u7f6e\u89c4\u5219\u5224\u65ad\n    :return 'sh' or 'sz'\"\"\"\n    stock_code = str(stock_code)\n    if stock_code.startswith((\"sh\", \"sz\")):\n        return stock_code[:2]\n    if stock_code.startswith(\n        (\"50\", \"51\", \"60\", \"73\", \"90\", \"110\", \"113\", \"132\", \"204\", \"78\")\n    ):\n        return \"sh\"\n    if stock_code.startswith(\n        (\"00\", \"13\", \"18\", \"15\", \"16\", \"18\", \"20\", \"30\", \"39\", \"115\", \"1318\")\n    ):\n        return \"sz\"\n    if stock_code.startswith((\"5\", \"6\", \"9\")):\n        return \"sh\"\n    return \"sz\"", "entry_point": "get_stock_type", "input": "['apple', 'banana', 'cherry']", "output": "'sz'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shidenggui/easytrader/blob/e5ae4daeda4ea125763a95b280dd694c7f68257d/easytrader/helpers.py#L32-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034104", "code": "def shape2d(a):\n    \"\"\"\n    Ensure a 2D shape.\n\n    Args:\n        a: a int or tuple/list of length 2\n\n    Returns:\n        list: of length 2. if ``a`` is a int, return ``[a, a]``.\n    \"\"\"\n    if type(a) == int:\n        return [a, a]\n    if isinstance(a, (list, tuple)):\n        assert len(a) == 2\n        return list(a)\n    raise RuntimeError(\"Illegal shape: {}\".format(a))", "entry_point": "shape2d", "input": "-3", "output": "[-3, -3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorpack/tensorpack/blob/d7a13cb74c9066bc791d7aafc3b744b60ee79a9f/tensorpack/utils/argtools.py#L89-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034105", "code": "def get_savename_from_varname(\n        varname, varname_prefix=None,\n        savename_prefix=None):\n    \"\"\"\n    Args:\n        varname(str): a variable name in the graph\n        varname_prefix(str): an optional prefix that may need to be removed in varname\n        savename_prefix(str): an optional prefix to append to all savename\n    Returns:\n        str: the name used to save the variable\n    \"\"\"\n    name = varname\n    if varname_prefix is not None \\\n            and name.startswith(varname_prefix):\n        name = name[len(varname_prefix) + 1:]\n    if savename_prefix is not None:\n        name = savename_prefix + '/' + name\n    return name", "entry_point": "get_savename_from_varname", "input": "'abc', 'abc', 'AbC dEf'", "output": "'AbC dEf/'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorpack/tensorpack/blob/d7a13cb74c9066bc791d7aafc3b744b60ee79a9f/tensorpack/tfutils/varmanip.py#L18-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034106", "code": "def split_grad_list(grad_list):\n    \"\"\"\n    Args:\n        grad_list: K x N x 2\n\n    Returns:\n        K x N: gradients\n        K x N: variables\n    \"\"\"\n    g = []\n    v = []\n    for tower in grad_list:\n        g.append([x[0] for x in tower])\n        v.append([x[1] for x in tower])\n    return g, v", "entry_point": "split_grad_list", "input": "{}", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorpack/tensorpack/blob/d7a13cb74c9066bc791d7aafc3b744b60ee79a9f/tensorpack/graph_builder/utils.py#L109-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034107", "code": "def merge_grad_list(all_grads, all_vars):\n    \"\"\"\n    Args:\n        all_grads (K x N): gradients\n        all_vars(K x N): variables\n\n    Return:\n        K x N x 2: list of list of (grad, var) pairs\n    \"\"\"\n    return [list(zip(gs, vs)) for gs, vs in zip(all_grads, all_vars)]", "entry_point": "merge_grad_list", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorpack/tensorpack/blob/d7a13cb74c9066bc791d7aafc3b744b60ee79a9f/tensorpack/graph_builder/utils.py#L126-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034108", "code": "def _indent(text, amount):\n    \"\"\"Indent a multiline string by some number of spaces.\n\n    Parameters\n    ----------\n    text: str\n        The text to be indented\n    amount: int\n        The number of spaces to indent the text\n\n    Returns\n    -------\n    indented_text\n\n    \"\"\"\n    indentation = amount * ' '\n    return indentation + ('\\n' + indentation).join(text.split('\\n'))", "entry_point": "_indent", "input": "'', True", "output": "' '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L347-L363", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034109", "code": "def _validate_name(name):\n    \"\"\"Pre-flight ``Bucket`` name validation.\n\n    :type name: str or :data:`NoneType`\n    :param name: Proposed bucket name.\n\n    :rtype: str or :data:`NoneType`\n    :returns: ``name`` if valid.\n    \"\"\"\n    if name is None:\n        return\n\n    # The first and las characters must be alphanumeric.\n    if not all([name[0].isalnum(), name[-1].isalnum()]):\n        raise ValueError(\"Bucket names must start and end with a number or letter.\")\n    return name", "entry_point": "_validate_name", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L24-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034110", "code": "def _ensure_tuple_or_list(arg_name, tuple_or_list):\n    \"\"\"Ensures an input is a tuple or list.\n\n    This effectively reduces the iterable types allowed to a very short\n    whitelist: list and tuple.\n\n    :type arg_name: str\n    :param arg_name: Name of argument to use in error message.\n\n    :type tuple_or_list: sequence of str\n    :param tuple_or_list: Sequence to be verified.\n\n    :rtype: list of str\n    :returns: The ``tuple_or_list`` passed in cast to a ``list``.\n    :raises TypeError: if the ``tuple_or_list`` is not a tuple or list.\n    \"\"\"\n    if not isinstance(tuple_or_list, (tuple, list)):\n        raise TypeError(\n            \"Expected %s to be a tuple or list. \"\n            \"Received %r\" % (arg_name, tuple_or_list)\n        )\n    return list(tuple_or_list)", "entry_point": "_ensure_tuple_or_list", "input": "'', ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/_helpers.py#L149-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034111", "code": "def _reference_info(references):\n    \"\"\"Get information about document references.\n\n    Helper for :meth:`~.firestore_v1beta1.client.Client.get_all`.\n\n    Args:\n        references (List[.DocumentReference, ...]): Iterable of document\n            references.\n\n    Returns:\n        Tuple[List[str, ...], Dict[str, .DocumentReference]]: A two-tuple of\n\n        * fully-qualified documents paths for each reference in ``references``\n        * a mapping from the paths to the original reference. (If multiple\n          ``references`` contains multiple references to the same document,\n          that key will be overwritten in the result.)\n    \"\"\"\n    document_paths = []\n    reference_map = {}\n    for reference in references:\n        doc_path = reference._document_path\n        document_paths.append(doc_path)\n        reference_map[doc_path] = reference\n\n    return document_paths, reference_map", "entry_point": "_reference_info", "input": "set()", "output": "([], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/client.py#L385-L409", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034112", "code": "def _get_sub_prop(container, keys, default=None):\n    \"\"\"Get a nested value from a dictionary.\n\n    This method works like ``dict.get(key)``, but for nested values.\n\n    Arguments:\n        container (dict):\n            A dictionary which may contain other dictionaries as values.\n        keys (iterable):\n            A sequence of keys to attempt to get the value for. Each item in\n            the sequence represents a deeper nesting. The first key is for\n            the top level. If there is a dictionary there, the second key\n            attempts to get the value within that, and so on.\n        default (object):\n            (Optional) Value to returned if any of the keys are not found.\n            Defaults to ``None``.\n\n    Examples:\n        Get a top-level value (equivalent to ``container.get('key')``).\n\n        >>> _get_sub_prop({'key': 'value'}, ['key'])\n        'value'\n\n        Get a top-level value, providing a default (equivalent to\n        ``container.get('key', default='default')``).\n\n        >>> _get_sub_prop({'nothere': 123}, ['key'], default='not found')\n        'not found'\n\n        Get a nested value.\n\n        >>> _get_sub_prop({'key': {'subkey': 'value'}}, ['key', 'subkey'])\n        'value'\n\n    Returns:\n        object: The value if present or the default.\n    \"\"\"\n    sub_val = container\n    for key in keys:\n        if key not in sub_val:\n            return default\n        sub_val = sub_val[key]\n    return sub_val", "entry_point": "_get_sub_prop", "input": "[[1, 2], [3], []], [5, 3, 1, 4], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/_helpers.py#L448-L490", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034113", "code": "def _build_resource_from_properties(obj, filter_fields):\n    \"\"\"Build a resource based on a ``_properties`` dictionary, filtered by\n    ``filter_fields``, which follow the name of the Python object.\n    \"\"\"\n    partial = {}\n    for filter_field in filter_fields:\n        api_field = obj._PROPERTY_TO_API_FIELD.get(filter_field)\n        if api_field is None and filter_field not in obj._properties:\n            raise ValueError(\"No property %s\" % filter_field)\n        elif api_field is not None:\n            partial[api_field] = obj._properties.get(api_field)\n        else:\n            # allows properties that are not defined in the library\n            # and properties that have the same name as API resource key\n            partial[filter_field] = obj._properties[filter_field]\n\n    return partial", "entry_point": "_build_resource_from_properties", "input": "[], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/_helpers.py#L616-L632", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034114", "code": "def _indent(lines, prefix=\"  \"):\n    \"\"\"Indent some text.\n\n    Note that this is present as ``textwrap.indent``, but not in Python 2.\n\n    Args:\n        lines (str): The newline delimited string to be indented.\n        prefix (Optional[str]): The prefix to indent each line with. Default\n            to two spaces.\n\n    Returns:\n        str: The newly indented content.\n    \"\"\"\n    indented = []\n    for line in lines.split(\"\\n\"):\n        indented.append(prefix + line)\n    return \"\\n\".join(indented)", "entry_point": "_indent", "input": "'walnut thistle harbour', 'Hello World'", "output": "'Hello Worldwalnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L33-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034115", "code": "def ordered_union(l1, l2):\n  \"\"\"\n  Return the union of l1 and l2, with a deterministic ordering.\n  (Union of python sets does not necessarily have a consisten iteration\n  order)\n  :param l1: list of items\n  :param l2: list of items\n  :returns: list containing one copy of each item that is in l1 or in l2\n  \"\"\"\n  out = []\n  for e in l1 + l2:\n    if e not in out:\n      out.append(e)\n  return out", "entry_point": "ordered_union", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "[-1, 0, 1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/cleverhans/blob/97488e215760547b81afc53f5e5de8ba7da5bd98/cleverhans/utils.py#L275-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034116", "code": "def deep_copy(numpy_dict):\n  \"\"\"\n  Returns a copy of a dictionary whose values are numpy arrays.\n  Copies their values rather than copying references to them.\n  \"\"\"\n  out = {}\n  for key in numpy_dict:\n    out[key] = numpy_dict[key].copy()\n  return out", "entry_point": "deep_copy", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/cleverhans/blob/97488e215760547b81afc53f5e5de8ba7da5bd98/cleverhans/utils.py#L341-L349", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034117", "code": "def random_feed_dict(rng, placeholders):\n  \"\"\"\n  Returns random data to be used with `feed_dict`.\n  :param rng: A numpy.random.RandomState instance\n  :param placeholders: List of tensorflow placeholders\n  :return: A dict mapping placeholders to random numpy values\n  \"\"\"\n\n  output = {}\n\n  for placeholder in placeholders:\n    if placeholder.dtype != 'float32':\n      raise NotImplementedError()\n    value = rng.randn(*placeholder.shape).astype('float32')\n    output[placeholder] = value\n\n  return output", "entry_point": "random_feed_dict", "input": "('a', 'b', 'c'), {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/cleverhans/blob/97488e215760547b81afc53f5e5de8ba7da5bd98/cleverhans/devtools/mocks.py#L16-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034118", "code": "def _string_hash(s):\n    \"\"\"String hash (djb2) with consistency between py2/py3 and persistency between runs (unlike `hash`).\"\"\"\n    h = 5381\n    for c in s:\n        h = h * 33 + ord(c)\n    return h", "entry_point": "_string_hash", "input": "'AbC dEf'", "output": "229417703063706", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/object_detector/util/_visualization.py#L14-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034119", "code": "def difference (b, a):\n    \"\"\" Returns the elements of B that are not in A.\n    \"\"\"\n    a = set(a)\n    result = []\n    for item in b:\n        if item not in a:\n            result.append(item)\n    return result", "entry_point": "difference", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[5, 3, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/set.py#L10-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034120", "code": "def _RoundTowardZero(value, divider):\n  \"\"\"Truncates the remainder part after division.\"\"\"\n  # For some languanges, the sign of the remainder is implementation\n  # dependent if any of the operands is negative. Here we enforce\n  # \"rounded toward zero\" semantics. For example, for (-5) / 2 an\n  # implementation may give -3 as the result with the remainder being\n  # 1. This function ensures we always return -2 (closer to zero).\n  result = value // divider\n  remainder = value % divider\n  if result < 0 and remainder > 0:\n    return result + 1\n  else:\n    return result", "entry_point": "_RoundTowardZero", "input": "5, True", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/well_known_types.py#L378-L390", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034121", "code": "def _decompose_bytes_to_bit_arr(arr):\n    \"\"\"\n    Unpack bytes to bits\n\n    :param arr: list\n        Byte Stream, as a list of uint8 values\n\n    Returns\n    -------\n    bit_arr: list\n        Decomposed bit stream as a list of 0/1s of length (len(arr) * 8)\n    \"\"\"\n    bit_arr = []\n    for idx in range(len(arr)):\n        for i in reversed(range(8)):\n            bit_arr.append((arr[idx] >> i) & (1 << 0))\n    return bit_arr", "entry_point": "_decompose_bytes_to_bit_arr", "input": "[1, 2, 3]", "output": "[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/quantization_utils.py#L77-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034122", "code": "def _seconds_as_string(seconds):\n    \"\"\"\n    Returns seconds as a human-friendly string, e.g. '1d 4h 47m 41s'\n    \"\"\"\n    TIME_UNITS = [('s', 60), ('m', 60), ('h', 24), ('d', None)]\n    unit_strings = []\n    cur = max(int(seconds), 1)\n    for suffix, size in TIME_UNITS:\n        if size is not None:\n            cur, rest = divmod(cur, size)\n        else:\n            rest = cur\n        if rest > 0:\n            unit_strings.insert(0, '%d%s' % (rest, suffix))\n    return ' '.join(unit_strings)", "entry_point": "_seconds_as_string", "input": "False", "output": "'1s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/_utils.py#L10-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034123", "code": "def _VarintSize(value):\n  \"\"\"Compute the size of a varint value.\"\"\"\n  if value <= 0x7f: return 1\n  if value <= 0x3fff: return 2\n  if value <= 0x1fffff: return 3\n  if value <= 0xfffffff: return 4\n  if value <= 0x7ffffffff: return 5\n  if value <= 0x3ffffffffff: return 6\n  if value <= 0x1ffffffffffff: return 7\n  if value <= 0xffffffffffffff: return 8\n  if value <= 0x7fffffffffffffff: return 9\n  return 10", "entry_point": "_VarintSize", "input": "2.0", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/encoder.py#L82-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034124", "code": "def _SignedVarintSize(value):\n  \"\"\"Compute the size of a signed varint value.\"\"\"\n  if value < 0: return 10\n  if value <= 0x7f: return 1\n  if value <= 0x3fff: return 2\n  if value <= 0x1fffff: return 3\n  if value <= 0xfffffff: return 4\n  if value <= 0x7ffffffff: return 5\n  if value <= 0x3ffffffffff: return 6\n  if value <= 0x1ffffffffffff: return 7\n  if value <= 0xffffffffffffff: return 8\n  if value <= 0x7fffffffffffffff: return 9\n  return 10", "entry_point": "_SignedVarintSize", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/encoder.py#L96-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034125", "code": "def _robust_column_name(base_name, column_names):\n    \"\"\"\n    Generate a new column name that is guaranteed not to conflict with an\n    existing set of column names.\n\n    Parameters\n    ----------\n    base_name : str\n        The base of the new column name. Usually this does not conflict with\n        the existing column names, in which case this function simply returns\n        `base_name`.\n\n    column_names : list[str]\n        List of existing column names.\n\n    Returns\n    -------\n    robust_name : str\n        The new column name. If `base_name` isn't in `column_names`, then\n        `robust_name` is the same as `base_name`. If there are conflicts, a\n        numeric suffix is added to `base_name` until it no longer conflicts\n        with the column names.\n    \"\"\"\n    robust_name = base_name\n    i = 1\n\n    while robust_name in column_names:\n        robust_name = base_name + '.{}'.format(i)\n        i += 1\n\n    return robust_name", "entry_point": "_robust_column_name", "input": "'Hello World', '  padded  '", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_private_utils.py#L36-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034126", "code": "def _check_elements_equal(lst):\n    \"\"\"\n    Returns true if all of the elements in the list are equal.\n    \"\"\"\n    assert isinstance(lst, list), \"Input value must be a list.\"\n    return not lst or lst.count(lst[0]) == len(lst)", "entry_point": "_check_elements_equal", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_private_utils.py#L145-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034127", "code": "def format_time(seconds):\n    \"\"\"Format a duration\"\"\"\n    minute = 60\n    hour = minute * 60\n    day = hour * 24\n    week = day * 7\n\n    result = []\n    for name, dur in [\n            ('week', week), ('day', day), ('hour', hour),\n            ('minute', minute), ('second', 1)\n    ]:\n        if seconds > dur:\n            value = seconds // dur\n            result.append(\n                '{0} {1}{2}'.format(int(value), name, 's' if value > 1 else '')\n            )\n            seconds = seconds % dur\n    return ' '.join(result)", "entry_point": "format_time", "input": "-1.5", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/benchmark/benchmark.py#L111-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034128", "code": "def _scrub_composite_distance_features(distance, feature_blacklist):\n    \"\"\"\n    Remove feature names from the feature lists in a composite distance\n    function.\n    \"\"\"\n    dist_out = []\n\n    for i, d in enumerate(distance):\n        ftrs, dist, weight = d\n        new_ftrs = [x for x in ftrs if x not in feature_blacklist]\n        if len(new_ftrs) > 0:\n            dist_out.append([new_ftrs, dist, weight])\n\n    return dist_out", "entry_point": "_scrub_composite_distance_features", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/distances/_util.py#L190-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034129", "code": "def _ToCamelCase(name):\n  \"\"\"Converts name to camel-case and returns it.\"\"\"\n  capitalize_next = False\n  result = []\n\n  for c in name:\n    if c == '_':\n      if result:\n        capitalize_next = True\n    elif capitalize_next:\n      result.append(c.upper())\n      capitalize_next = False\n    else:\n      result += c\n\n  # Lower-case the first letter.\n  if result and result[0].isupper():\n    result[0] = result[0].lower()\n  return ''.join(result)", "entry_point": "_ToCamelCase", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor.py#L873-L891", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034130", "code": "def _ToJsonName(name):\n  \"\"\"Converts name to Json name and returns it.\"\"\"\n  capitalize_next = False\n  result = []\n\n  for c in name:\n    if c == '_':\n      capitalize_next = True\n    elif capitalize_next:\n      result.append(c.upper())\n      capitalize_next = False\n    else:\n      result += c\n\n  return ''.join(result)", "entry_point": "_ToJsonName", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor.py#L902-L916", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034131", "code": "def is_valid_bucket_name(name):\n    \"\"\"\n    Checks if an S3 bucket name is valid according to https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules\n    \"\"\"\n    # Bucket names must be at least 3 and no more than 63 characters long.\n    if (len(name) < 3 or len(name) > 63):\n        return False\n    # Bucket names must not contain uppercase characters or underscores.\n    if (any(x.isupper() for x in name)):\n        return False\n    if \"_\" in name:\n        return False\n    # Bucket names must start with a lowercase letter or number.\n    if not (name[0].islower() or name[0].isdigit()):\n        return False\n    # Bucket names must be a series of one or more labels. Adjacent labels are separated by a single period (.).\n    for label in name.split(\".\"):\n        # Each label must start and end with a lowercase letter or a number.\n        if len(label) < 1:\n            return False\n        if not (label[0].islower() or label[0].isdigit()):\n            return False\n        if not (label[-1].islower() or label[-1].isdigit()):\n            return False\n    # Bucket names must not be formatted as an IP address (for example, 192.168.5.4).\n    looks_like_IP = True\n    for label in name.split(\".\"):\n        if not label.isdigit():\n            looks_like_IP = False\n            break\n    if looks_like_IP:\n        return False\n\n    return True", "entry_point": "is_valid_bucket_name", "input": "'a,b,c'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/utilities.py#L528-L561", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034132", "code": "def merge_headers(event):\n    \"\"\"\n    Merge the values of headers and multiValueHeaders into a single dict.\n    Opens up support for multivalue headers via API Gateway and ALB.\n    See: https://github.com/Miserlou/Zappa/pull/1756\n    \"\"\"\n    headers = event.get('headers') or {}\n    multi_headers = (event.get('multiValueHeaders') or {}).copy()\n    for h in set(headers.keys()):\n        if h not in multi_headers:\n            multi_headers[h] = [headers[h]]\n    for h in multi_headers.keys():\n        multi_headers[h] = ', '.join(multi_headers[h])\n    return multi_headers", "entry_point": "merge_headers", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/utilities.py#L564-L577", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034133", "code": "def get_event_name(lambda_name, name):\n        \"\"\"\n        Returns an AWS-valid Lambda event name.\n\n        \"\"\"\n        return '{prefix:.{width}}-{postfix}'.format(prefix=lambda_name, width=max(0, 63 - len(name)), postfix=name)[:64]", "entry_point": "get_event_name", "input": "'Hello World', '  padded  '", "output": "'Hello World-  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2790-L2795", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034134", "code": "def _set_commands(package_names):\n        \"\"\"\n        Extract the command name from package name. Last part of the module path is the command\n        ie. if path is foo.bar.baz, then \"baz\" is the command name.\n\n        :param package_names: List of package names\n        :return: Dictionary with command name as key and the package name as value.\n        \"\"\"\n\n        commands = {}\n\n        for pkg_name in package_names:\n            cmd_name = pkg_name.split('.')[-1]\n            commands[cmd_name] = pkg_name\n\n        return commands", "entry_point": "_set_commands", "input": "'walnut thistle harbour'", "output": "{'w': 'w', 'a': 'a', 'l': 'l', 'n': 'n', 'u': 'u', 't': 't', ' ': ' ', 'h': 'h', 'i': 'i', 's': 's', 'e': 'e', 'r': 'r', 'b': 'b', 'o': 'o'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/command.py#L62-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034135", "code": "def _segment_with_tokens(text, tokens):\n        \"\"\"Segment a string around the tokens created by a passed-in tokenizer\"\"\"\n        list_form = []\n        text_ptr = 0\n        for token in tokens:\n            inter_token_string = []\n            while not text[text_ptr:].startswith(token):\n                inter_token_string.append(text[text_ptr])\n                text_ptr += 1\n                if text_ptr >= len(text):\n                    raise ValueError(\"Tokenization produced tokens that do not belong in string!\")\n            text_ptr += len(token)\n            if inter_token_string:\n                list_form.append(''.join(inter_token_string))\n            list_form.append(token)\n        if text_ptr < len(text):\n            list_form.append(text[text_ptr:])\n        return list_form", "entry_point": "_segment_with_tokens", "input": "'abc', []", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marcotcr/lime/blob/08133d47df00ed918e22005e0c98f6eefd5a1d71/lime/lime_text.py#L182-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034136", "code": "def supported_cache_type(types):\n    \"\"\"Checks if link type config option has a valid value.\n\n    Args:\n        types (list/string): type(s) of links that dvc should try out.\n    \"\"\"\n    if isinstance(types, str):\n        types = [typ.strip() for typ in types.split(\",\")]\n    for typ in types:\n        if typ not in [\"reflink\", \"hardlink\", \"symlink\", \"copy\"]:\n            return False\n    return True", "entry_point": "supported_cache_type", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iterative/dvc/blob/8bb21261e34c9632453e09090de7ebe50e38d341/dvc/config.py#L32-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034137", "code": "def create_style_from_font(font):\n    \"\"\"\n    Convert from font string/tyuple into a Qt style sheet string\n    :param font: \"Arial 10 Bold\" or ('Arial', 10, 'Bold)\n    :return: style string that can be combined with other style strings\n    \"\"\"\n\n    if font is None:\n        return ''\n\n    if type(font) is str:\n        _font = font.split(' ')\n    else:\n        _font = font\n\n    style = ''\n    style += 'font-family: %s;\\n' % _font[0]\n    style += 'font-size: %spt;\\n' % _font[1]\n    font_items = ''\n    for item in _font[2:]:\n        if item == 'underline':\n            style += 'text-decoration: underline;\\n'\n        else:\n            font_items += item + ' '\n    if font_items != '':\n        style += 'font: %s;\\n' % (font_items)\n    return style", "entry_point": "create_style_from_font", "input": "['a', 'b', 'c']", "output": "'font-family: a;\\nfont-size: bpt;\\nfont: c ;\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L3756-L3782", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034138", "code": "def font_parse_string(font):\n    \"\"\"\n    Convert from font string/tyuple into a Qt style sheet string\n    :param font: \"Arial 10 Bold\" or ('Arial', 10, 'Bold)\n    :return: style string that can be combined with other style strings\n    \"\"\"\n\n    if font is None:\n        return ''\n\n    if type(font) is str:\n        _font = font.split(' ')\n    else:\n        _font = font\n    family = _font[0]\n    point_size = int(_font[1])\n\n    style = _font[2:] if len(_font) > 1 else None\n\n    # underline =  'underline' in _font[2:]\n    # bold =  'bold' in _font\n\n    return family, point_size, style", "entry_point": "font_parse_string", "input": "[1, 2, 3]", "output": "(1, 2, [3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L3449-L3471", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034139", "code": "def parse_line(line):\n  \"\"\"Parses a line of a text embedding file.\n\n  Args:\n    line: (str) One line of the text embedding file.\n\n  Returns:\n    A token string and its embedding vector in floats.\n  \"\"\"\n  columns = line.split()\n  token = columns.pop(0)\n  values = [float(column) for column in columns]\n  return token, values", "entry_point": "parse_line", "input": "'  padded  '", "output": "('padded', [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/text_embeddings/export.py#L47-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034140", "code": "def bytes_to_readable_str(num_bytes, include_b=False):\n  \"\"\"Generate a human-readable string representing number of bytes.\n\n  The units B, kB, MB and GB are used.\n\n  Args:\n    num_bytes: (`int` or None) Number of bytes.\n    include_b: (`bool`) Include the letter B at the end of the unit.\n\n  Returns:\n    (`str`) A string representing the number of bytes in a human-readable way,\n      including a unit at the end.\n  \"\"\"\n\n  if num_bytes is None:\n    return str(num_bytes)\n  if num_bytes < 1024:\n    result = \"%d\" % num_bytes\n  elif num_bytes < 1048576:\n    result = \"%.2fk\" % (num_bytes / float(1 << 10))\n  elif num_bytes < 1073741824:\n    result = \"%.2fM\" % (num_bytes / float(1 << 20))\n  else:\n    result = \"%.2fG\" % (num_bytes / float(1 << 30))\n\n  if include_b:\n    result += \"B\"\n  return result", "entry_point": "bytes_to_readable_str", "input": "0, [-1, 0, 1, 2]", "output": "'0B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tf_utils.py#L165-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034141", "code": "def expr(expression, transform=None):\n    ''' Convenience function to explicitly return an \"expr\" specification for\n    a Bokeh :class:`~bokeh.core.properties.DataSpec` property.\n\n    Args:\n        expression (Expression) : a computed expression for a\n            ``DataSpec`` property.\n\n        transform (Transform, optional) : a transform to apply (default: None)\n\n    Returns:\n        dict : ``{ \"expr\": expression }``\n\n    .. note::\n        This function is included for completeness. String values for\n        property specifications are by default interpreted as field names.\n\n    '''\n    if transform:\n        return dict(expr=expression, transform=transform)\n    return dict(expr=expression)", "entry_point": "expr", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "{'expr': ['apple', 'banana', 'cherry'], 'transform': [1, 2, 3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/dataspec.py#L610-L630", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034142", "code": "def field(name, transform=None):\n    ''' Convenience function to explicitly return a \"field\" specification for\n    a Bokeh :class:`~bokeh.core.properties.DataSpec` property.\n\n    Args:\n        name (str) : name of a data source field to reference for a\n            ``DataSpec`` property.\n\n        transform (Transform, optional) : a transform to apply (default: None)\n\n    Returns:\n        dict : ``{ \"field\": name }``\n\n    .. note::\n        This function is included for completeness. String values for\n        property specifications are by default interpreted as field names.\n\n    '''\n    if transform:\n        return dict(field=name, transform=transform)\n    return dict(field=name)", "entry_point": "field", "input": "'AbC dEf', []", "output": "{'field': 'AbC dEf'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/dataspec.py#L633-L653", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034143", "code": "def value(val, transform=None):\n    ''' Convenience function to explicitly return a \"value\" specification for\n    a Bokeh :class:`~bokeh.core.properties.DataSpec` property.\n\n    Args:\n        val (any) : a fixed value to specify for a ``DataSpec`` property.\n\n        transform (Transform, optional) : a transform to apply (default: None)\n\n    Returns:\n        dict : ``{ \"value\": name }``\n\n    .. note::\n        String values for property specifications are by default interpreted\n        as field names. This function is especially useful when you want to\n        specify a fixed value with text properties.\n\n    Example:\n\n        .. code-block:: python\n\n            # The following will take text values to render from a data source\n            # column \"text_column\", but use a fixed value \"12pt\" for font size\n            p.text(\"x\", \"y\", text=\"text_column\",\n                   text_font_size=value(\"12pt\"), source=source)\n\n    '''\n    if transform:\n        return dict(value=val, transform=transform)\n    return dict(value=val)", "entry_point": "value", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "{'value': ['apple', 'banana', 'cherry'], 'transform': [-1, 0, 1, 2]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/dataspec.py#L655-L684", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034144", "code": "def issue_tags(issue):\n    \"\"\"Returns list of tags for this issue.\"\"\"\n    labels = issue.get('labels', [])\n    return [label['name'].replace('tag: ', '') for label in labels if label['name'].startswith('tag: ')]", "entry_point": "issue_tags", "input": "{'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/scripts/issues.py#L109-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034145", "code": "def clamp(value, maximum=None):\n        ''' Clamp numeric values to be non-negative, an optionally, less than a\n        given maximum.\n\n        Args:\n            value (float) :\n                A number to clamp.\n\n            maximum (float, optional) :\n                A max bound to to clamp to. If None, there is no upper bound,\n                and values are only clamped to be non-negative. (default: None)\n\n        Returns:\n            float\n\n        '''\n        value = max(value, 0)\n\n        if maximum is not None:\n            return min(value, maximum)\n        else:\n            return value", "entry_point": "clamp", "input": "2.0, 2.0", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/color.py#L50-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034146", "code": "def nice_join(seq, sep=\", \", conjuction=\"or\"):\n    ''' Join together sequences of strings into English-friendly phrases using\n    the conjunction ``or`` when appropriate.\n\n    Args:\n        seq (seq[str]) : a sequence of strings to nicely join\n        sep (str, optional) : a sequence delimiter to use (default: \", \")\n        conjunction (str or None, optional) : a conjuction to use for the last\n            two items, or None to reproduce basic join behaviour (default: \"or\")\n\n    Returns:\n        a joined string\n\n    Examples:\n        >>> nice_join([\"a\", \"b\", \"c\"])\n        'a, b or c'\n\n    '''\n    seq = [str(x) for x in seq]\n\n    if len(seq) <= 1 or conjuction is None:\n        return sep.join(seq)\n    else:\n        return \"%s %s %s\" % (sep.join(seq[:-1]), conjuction, seq[-1])", "entry_point": "nice_join", "input": "['apple', 'banana', 'cherry'], 'walnut thistle harbour', [[1, 2], [3], []]", "output": "'applewalnut thistle harbourbanana [[1, 2], [3], []] cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/string.py#L122-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034147", "code": "def references_json(references):\n    ''' Given a list of all models in a graph, return JSON representing\n    them and their properties.\n\n    Args:\n        references (seq[Model]) :\n            A list of models to convert to JSON\n\n    Returns:\n        list\n\n    '''\n\n    references_json = []\n    for r in references:\n        ref = r.ref\n        ref['attributes'] = r._to_json_like(include_defaults=False)\n        references_json.append(ref)\n\n    return references_json", "entry_point": "references_json", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/util.py#L119-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034148", "code": "def unmatched_quotes_in_line(text):\n    \"\"\"Return whether a string has open quotes.\n\n    This simply counts whether the number of quote characters of either\n    type in the string is odd.\n\n    Take from the IPython project (in IPython/core/completer.py in v0.13)\n    Spyder team: Add some changes to deal with escaped quotes\n\n    - Copyright (C) 2008-2011 IPython Development Team\n    - Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu>\n    - Copyright (C) 2001 Python Software Foundation, www.python.org\n\n    Distributed under the terms of the BSD License.\n    \"\"\"\n    # We check \" first, then ', so complex cases with nested quotes will\n    # get the \" to take precedence.\n    text = text.replace(\"\\\\'\", \"\")\n    text = text.replace('\\\\\"', '')\n    if text.count('\"') % 2:\n        return '\"'\n    elif text.count(\"'\") % 2:\n        return \"'\"\n    else:\n        return ''", "entry_point": "unmatched_quotes_in_line", "input": "'  padded  '", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/closequotes.py#L14-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034149", "code": "def _get_parents(folds, linenum):\n    \"\"\"\n    Get the parents at a given linenum.\n\n    If parents is empty, then the linenum belongs to the module.\n\n    Parameters\n    ----------\n    folds : list of :class:`FoldScopeHelper`\n    linenum : int\n        The line number to get parents for. Typically this would be the\n        cursor position.\n\n    Returns\n    -------\n    parents : list of :class:`FoldScopeHelper`\n        A list of :class:`FoldScopeHelper` objects that describe the defintion\n        heirarcy for the given ``linenum``. The 1st index will be the\n        top-level parent defined at the module level while the last index\n        will be the class or funtion that contains ``linenum``.\n    \"\"\"\n    # Note: this might be able to be sped up by finding some kind of\n    # abort-early condition.\n    parents = []\n    for fold in folds:\n        start, end = fold.range\n        if linenum >= start and linenum <= end:\n            parents.append(fold)\n        else:\n            continue\n\n    return parents", "entry_point": "_get_parents", "input": "[], ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/classfunctiondropdown.py#L179-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034150", "code": "def find_top_level_bracket_locations(string_toparse):\r\n        \"\"\"Get the locations of top-level brackets in a string.\"\"\"\r\n        bracket_stack = []\r\n        replace_args_list = []\r\n        bracket_type = None\r\n        literal_type = ''\r\n        brackets = {'(': ')', '[': ']', '{': '}'}\r\n        for idx, character in enumerate(string_toparse):\r\n            if (not bracket_stack and character in brackets.keys()\r\n                    or character == bracket_type):\r\n                bracket_stack.append(idx)\r\n                bracket_type = character\r\n            elif bracket_type and character == brackets[bracket_type]:\r\n                begin_idx = bracket_stack.pop()\r\n                if not bracket_stack:\r\n                    if not literal_type:\r\n                        if bracket_type == '(':\r\n                            literal_type = '(None)'\r\n                        elif bracket_type == '[':\r\n                            literal_type = '[list]'\r\n                        elif bracket_type == '{':\r\n                            if idx - begin_idx <= 1:\r\n                                literal_type = '{dict}'\r\n                            else:\r\n                                literal_type = '{set}'\r\n                    replace_args_list.append(\r\n                        (string_toparse[begin_idx:idx + 1],\r\n                         literal_type, 1))\r\n                    bracket_type = None\r\n                    literal_type = ''\r\n            elif len(bracket_stack) == 1:\r\n                if bracket_type == '(' and character == ',':\r\n                    literal_type = '(tuple)'\r\n                elif bracket_type == '{' and character == ':':\r\n                    literal_type = '{dict}'\r\n                elif bracket_type == '(' and character == ':':\r\n                    literal_type = '[slice]'\r\n\r\n        if bracket_stack:\r\n            raise IndexError('Bracket mismatch')\r\n        for replace_args in replace_args_list:\r\n            string_toparse = string_toparse.replace(*replace_args)\r\n        return string_toparse", "entry_point": "find_top_level_bracket_locations", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L434-L476", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034151", "code": "def _find_quote_position(text):\r\n        \"\"\"Return the start and end position of pairs of quotes.\"\"\"\r\n        pos = {}\r\n        is_found_left_quote = False\r\n\r\n        for idx, character in enumerate(text):\r\n            if is_found_left_quote is False:\r\n                if character == \"'\" or character == '\"':\r\n                    is_found_left_quote = True\r\n                    quote = character\r\n                    left_pos = idx\r\n            else:\r\n                if character == quote and text[idx - 1] != '\\\\':\r\n                    pos[left_pos] = idx\r\n                    is_found_left_quote = False\r\n\r\n        if is_found_left_quote:\r\n            raise IndexError(\"No matching close quote at: \" + str(left_pos))\r\n\r\n        return pos", "entry_point": "_find_quote_position", "input": "'abc'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/extensions/docstring.py#L619-L638", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034152", "code": "def primes(n):\r\n    \"\"\"\r\n    Simple test function\r\n    Taken from http://www.huyng.com/posts/python-performance-analysis/\r\n    \"\"\"\r\n    if n==2:\r\n        return [2]\r\n    elif n<2:\r\n        return []\r\n    s=list(range(3,n+1,2))\r\n    mroot = n ** 0.5\r\n    half=(n+1)//2-1\r\n    i=0\r\n    m=3\r\n    while m <= mroot:\r\n        if s[i]:\r\n            j=(m*m-3)//2\r\n            s[j]=0\r\n            while j<half:\r\n                s[j]=0\r\n                j+=m\r\n        i=i+1\r\n        m=2*i+3\r\n    return [2]+[x for x in s if x]", "entry_point": "primes", "input": "10", "output": "[2, 3, 5, 7]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/profiler/widgets/profilergui.py#L758-L781", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034153", "code": "def get_code_cell_name(text):\r\n    \"\"\"Returns a code cell name from a code cell comment.\"\"\"\r\n    name = text.strip().lstrip(\"#% \")\r\n    if name.startswith(\"<codecell>\"):\r\n        name = name[10:].lstrip()\r\n    elif name.startswith(\"In[\"):\r\n        name = name[2:]\r\n        if name.endswith(\"]:\"):\r\n            name = name[:-1]\r\n        name = name.strip()\r\n    return name", "entry_point": "get_code_cell_name", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L392-L402", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034154", "code": "def _group_tasks_by_name_and_status(task_dict):\n    \"\"\"\n    Takes a dictionary with sets of tasks grouped by their status and\n    returns a dictionary with dictionaries with an array of tasks grouped by\n    their status and task name\n    \"\"\"\n    group_status = {}\n    for task in task_dict:\n        if task.task_family not in group_status:\n            group_status[task.task_family] = []\n        group_status[task.task_family].append(task)\n    return group_status", "entry_point": "_group_tasks_by_name_and_status", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/execution_summary.py#L376-L387", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034155", "code": "def _editdistance(a, b):\n        \"\"\" Simple unweighted Levenshtein distance \"\"\"\n        r0 = range(0, len(b) + 1)\n        r1 = [0] * (len(b) + 1)\n\n        for i in range(0, len(a)):\n            r1[0] = i + 1\n\n            for j in range(0, len(b)):\n                c = 0 if a[i] is b[j] else 1\n                r1[j + 1] = min(r1[j] + 1, r0[j + 1] + 1, r0[j] + c)\n\n            r0 = r1[:]\n\n        return r1[len(b)]", "entry_point": "_editdistance", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task_register.py#L199-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034156", "code": "def make_table_row(contents, tag='td'):\n  \"\"\"Given an iterable of string contents, make a table row.\n\n  Args:\n    contents: An iterable yielding strings.\n    tag: The tag to place contents in. Defaults to 'td', you might want 'th'.\n\n  Returns:\n    A string containing the content strings, organized into a table row.\n\n  Example: make_table_row(['one', 'two', 'three']) == '''\n  <tr>\n  <td>one</td>\n  <td>two</td>\n  <td>three</td>\n  </tr>'''\n  \"\"\"\n  columns = ('<%s>%s</%s>\\n' % (tag, s, tag) for s in contents)\n  return '<tr>\\n' + ''.join(columns) + '</tr>\\n'", "entry_point": "make_table_row", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "\"<tr>\\n<['a', 'b', 'c']>apple</['a', 'b', 'c']>\\n<['a', 'b', 'c']>banana</['a', 'b', 'c']>\\n<['a', 'b', 'c']>cherry</['a', 'b', 'c']>\\n</tr>\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/text/text_plugin.py#L54-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034157", "code": "def get_out_of_order(list_of_numbers):\n  \"\"\"Returns elements that break the monotonically non-decreasing trend.\n\n  This is used to find instances of global step values that are \"out-of-order\",\n  which may trigger TensorBoard event discarding logic.\n\n  Args:\n    list_of_numbers: A list of numbers.\n\n  Returns:\n    A list of tuples in which each tuple are two elements are adjacent, but the\n    second element is lower than the first.\n  \"\"\"\n  # TODO: Consider changing this to only check for out-of-order\n  # steps within a particular tag.\n  result = []\n  # pylint: disable=consider-using-enumerate\n  for i in range(len(list_of_numbers)):\n    if i == 0:\n      continue\n    if list_of_numbers[i] < list_of_numbers[i - 1]:\n      result.append((list_of_numbers[i - 1], list_of_numbers[i]))\n  return result", "entry_point": "get_out_of_order", "input": "[1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/event_file_inspector.py#L286-L308", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034158", "code": "def _format_line(headers, fields):\n  \"\"\"Format a line of a table.\n\n  Arguments:\n    headers: A list of strings that are used as the table headers.\n    fields: A list of the same length as `headers` where `fields[i]` is\n      the entry for `headers[i]` in this row. Elements can be of\n      arbitrary types. Pass `headers` to print the header row.\n\n  Returns:\n    A pretty string.\n  \"\"\"\n  assert len(fields) == len(headers), (fields, headers)\n  fields = [\"%2.4f\" % field if isinstance(field, float) else str(field)\n            for field in fields]\n  return '  '.join(' ' * max(0, len(header) - len(field)) + field\n                   for (header, field) in zip(headers, fields))", "entry_point": "_format_line", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "'[1, 2]     [3]      []'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/encode_png_benchmark.py#L90-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034159", "code": "def stereo2mono(x):\n    '''\n    This function converts the input signal\n    (stored in a numpy array) to MONO (if it is STEREO)\n    '''\n    if isinstance(x, int):\n        return -1\n    if x.ndim==1:\n        return x\n    elif x.ndim==2:\n        if x.shape[1]==1:\n            return x.flatten()\n        else:\n            if x.shape[1]==2:\n                return ( (x[:,1] / 2) + (x[:,0] / 2) )\n            else:\n                return -1", "entry_point": "stereo2mono", "input": "5", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioBasicIO.py#L114-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034160", "code": "def levenshtein(str1, s2):\n    '''\n    Distance between two strings\n    '''\n    N1 = len(str1)\n    N2 = len(s2)\n\n    stringRange = [range(N1 + 1)] * (N2 + 1)\n    for i in range(N2 + 1):\n        stringRange[i] = range(i,i + N1 + 1)\n    for i in range(0,N2):\n        for j in range(0,N1):\n            if str1[j] == s2[i]:\n                stringRange[i+1][j+1] = min(stringRange[i+1][j] + 1,\n                                            stringRange[i][j+1] + 1,\n                                            stringRange[i][j])\n            else:\n                stringRange[i+1][j+1] = min(stringRange[i+1][j] + 1,\n                                            stringRange[i][j+1] + 1,\n                                            stringRange[i][j] + 1)\n    return stringRange[N2][N1]", "entry_point": "levenshtein", "input": "[[1, 2], [3], []], []", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioVisualization.py#L32-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034161", "code": "def expand_abbreviations(template, abbreviations):\n    \"\"\"Expand abbreviations in a template name.\n\n    :param template: The project template name.\n    :param abbreviations: Abbreviation definitions.\n    \"\"\"\n    if template in abbreviations:\n        return abbreviations[template]\n\n    # Split on colon. If there is no colon, rest will be empty\n    # and prefix will be the whole template\n    prefix, sep, rest = template.partition(':')\n    if prefix in abbreviations:\n        return abbreviations[prefix].format(rest)\n\n    return template", "entry_point": "expand_abbreviations", "input": "'abc', 'a,b,c'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/audreyr/cookiecutter/blob/3bc7b987e4ae9dcee996ae0b00375c1325b8d866/cookiecutter/repository.py#L32-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034162", "code": "def _bpe_to_words(sentence, delimiter='@@'):\n    \"\"\"Convert a sequence of bpe words into sentence.\"\"\"\n    words = []\n    word = ''\n    delimiter_len = len(delimiter)\n    for subwords in sentence:\n        if len(subwords) >= delimiter_len and subwords[-delimiter_len:] == delimiter:\n            word += subwords[:-delimiter_len]\n        else:\n            word += subwords\n            words.append(word)\n            word = ''\n    return words", "entry_point": "_bpe_to_words", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmlc/gluon-nlp/blob/4b83eb6bcc8881e5f1081a3675adaa19fac5c0ba/scripts/machine_translation/bleu.py#L61-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034163", "code": "def _smoothing(precision_fractions, c=1):\n    \"\"\"Compute the smoothed precision for all the orders.\n\n    Parameters\n    ----------\n    precision_fractions: list(tuple)\n        Contain a list of (precision_numerator, precision_denominator) pairs\n    c: int, default 1\n        Smoothing constant to use\n\n    Returns\n    -------\n    ratios: list of floats\n        Contain the smoothed precision_fractions.\n    \"\"\"\n    ratios = [0] * len(precision_fractions)\n    for i, precision_fraction in enumerate(precision_fractions):\n        if precision_fraction[1] > 0:\n            ratios[i] = float(precision_fraction[0] + c) / (precision_fraction[1] + c)\n        else:\n            ratios[i] = 0.0\n\n    return ratios", "entry_point": "_smoothing", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmlc/gluon-nlp/blob/4b83eb6bcc8881e5f1081a3675adaa19fac5c0ba/scripts/machine_translation/bleu.py#L332-L354", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034164", "code": "def _get_answer_spans(answer_list, answer_start_list):\n        \"\"\"Find all answer spans from the context, returning start_index and end_index\n\n        :param list[str] answer_list: List of all answers\n        :param list[int] answer_start_list: List of all answers' start indices\n\n        Returns\n        -------\n        List[Tuple]\n            list of Tuple(answer_start_index answer_end_index) per question\n        \"\"\"\n        return [(answer_start_list[i], answer_start_list[i] + len(answer))\n                for i, answer in enumerate(answer_list)]", "entry_point": "_get_answer_spans", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "[(1, 2), (2, 3), (3, 4)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmlc/gluon-nlp/blob/4b83eb6bcc8881e5f1081a3675adaa19fac5c0ba/scripts/question_answering/data_processing.py#L98-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034165", "code": "def add_ngram(sequences, token_indice, ngram_range=2):\n    \"\"\"\n    Augment the input list of list (sequences) by appending n-grams values.\n    Example: adding bi-gram\n    >>> sequences = [[1, 3, 4, 5], [1, 3, 7, 9, 2]]\n    >>> token_indice = {(1, 3): 1337, (9, 2): 42, (4, 5): 2017}\n    >>> add_ngram(sequences, token_indice, ngram_range=2)\n    [[1, 3, 4, 5, 1337, 2017], [1, 3, 7, 9, 2, 1337, 42]]\n    Example: adding tri-gram\n    >>> sequences = [[1, 3, 4, 5], [1, 3, 7, 9, 2]]\n    >>> token_indice = {(1, 3): 1337, (9, 2): 42, (4, 5): 2017, (7, 9, 2): 2018}\n    >>> add_ngram(sequences, token_indice, ngram_range=3)\n    [[1, 3, 4, 5, 1337], [1, 3, 7, 9, 2, 1337, 2018]]\n    \"\"\"\n    new_sequences = []\n    for input_list in sequences:\n        new_list = input_list[:]\n        for i in range(len(new_list) - ngram_range + 1):\n            for ngram_value in range(2, ngram_range + 1):\n                ngram = tuple(new_list[i:i + ngram_value])\n                if ngram in token_indice:\n                    new_list.append(token_indice[ngram])\n        new_sequences.append(new_list)\n\n    return new_sequences", "entry_point": "add_ngram", "input": "[], ['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmlc/gluon-nlp/blob/4b83eb6bcc8881e5f1081a3675adaa19fac5c0ba/scripts/text_classification/fasttext_word_ngram.py#L107-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034166", "code": "def _sed_esc(string, escape_all=False):\n    '''\n    Escape single quotes and forward slashes\n    '''\n    special_chars = \"^.[$()|*+?{\"\n    string = string.replace(\"'\", \"'\\\"'\\\"'\").replace(\"/\", \"\\\\/\")\n    if escape_all is True:\n        for char in special_chars:\n            string = string.replace(char, \"\\\\\" + char)\n    return string", "entry_point": "_sed_esc", "input": "'  padded  ', ['a', 'b', 'c']", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/file.py#L1037-L1046", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034167", "code": "def _set_line_indent(src, line, indent):\n    '''\n    Indent the line with the source line.\n    '''\n    if not indent:\n        return line\n\n    idt = []\n    for c in src:\n        if c not in ['\\t', ' ']:\n            break\n        idt.append(c)\n\n    return ''.join(idt) + line.lstrip()", "entry_point": "_set_line_indent", "input": "[1, 2, 3], 'AbC dEf', [[1, 2], [3], []]", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/file.py#L1760-L1773", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034168", "code": "def _count_righthand_zero_bits(number, bits):\n    \"\"\"Count the number of zero bits on the right hand side.\n\n    Args:\n        number: an integer.\n        bits: maximum number of bits to count.\n\n    Returns:\n        The number of zero bits on the right hand side of the number.\n\n    \"\"\"\n    if number == 0:\n        return bits\n    for i in range(bits):\n        if (number >> i) & 1:\n            return i\n    # All bits of interest were zero, even if there are more in the number\n    return bits", "entry_point": "_count_righthand_zero_bits", "input": "0, [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/ext/ipaddress.py#L251-L268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034169", "code": "def _collapse_addresses_recursive(addresses):\n    \"\"\"Loops through the addresses, collapsing concurrent netblocks.\n\n    Example:\n\n        ip1 = IPv4Network('192.0.2.0/26')\n        ip2 = IPv4Network('192.0.2.64/26')\n        ip3 = IPv4Network('192.0.2.128/26')\n        ip4 = IPv4Network('192.0.2.192/26')\n\n        _collapse_addresses_recursive([ip1, ip2, ip3, ip4]) ->\n          [IPv4Network('192.0.2.0/24')]\n\n        This shouldn't be called directly; it is called via\n          collapse_addresses([]).\n\n    Args:\n        addresses: A list of IPv4Network's or IPv6Network's\n\n    Returns:\n        A list of IPv4Network's or IPv6Network's depending on what we were\n        passed.\n\n    \"\"\"\n    while True:\n        last_addr = None\n        ret_array = []\n        optimized = False\n\n        for cur_addr in addresses:\n            if not ret_array:\n                last_addr = cur_addr\n                ret_array.append(cur_addr)\n            elif (cur_addr.network_address >= last_addr.network_address and\n                cur_addr.broadcast_address <= last_addr.broadcast_address):\n                optimized = True\n            elif cur_addr == list(last_addr.supernet().subnets())[1]:\n                ret_array[-1] = last_addr = last_addr.supernet()\n                optimized = True\n            else:\n                last_addr = cur_addr\n                ret_array.append(cur_addr)\n\n        addresses = ret_array\n        if not optimized:\n            return addresses", "entry_point": "_collapse_addresses_recursive", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/ext/ipaddress.py#L327-L372", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034170", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n\n    VALID_ITEMS = [\n        'type', 'bytes_sent', 'bytes_recv', 'packets_sent',\n        'packets_recv', 'errin', 'errout', 'dropin',\n        'dropout'\n    ]\n\n    # Configuration for load beacon should be a list of dicts\n    if not isinstance(config, list):\n        return False, ('Configuration for network_info beacon must be a list.')\n    else:\n\n        _config = {}\n        list(map(_config.update, config))\n\n        for item in _config.get('interfaces', {}):\n            if not isinstance(_config['interfaces'][item], dict):\n                return False, ('Configuration for network_info beacon must '\n                               'be a list of dictionaries.')\n            else:\n                if not any(j in VALID_ITEMS for j in _config['interfaces'][item]):\n                    return False, ('Invalid configuration item in '\n                                   'Beacon configuration.')\n    return True, 'Valid beacon configuration'", "entry_point": "validate", "input": "{}", "output": "(False, 'Configuration for network_info beacon must be a list.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_info.py#L51-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034171", "code": "def _strip_scope(msg):\n    '''\n    Strip unnecessary message about running the command with --scope from\n    stderr so that we can raise an exception with the remaining stderr text.\n    '''\n    ret = []\n    for line in msg.splitlines():\n        if not line.endswith('.scope'):\n            ret.append(line)\n    return '\\n'.join(ret).strip()", "entry_point": "_strip_scope", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L311-L320", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034172", "code": "def _analyse_overview_field(content):\n    '''\n    Split the field in drbd-overview\n    '''\n    if \"(\" in content:\n        # Output like \"Connected(2*)\" or \"UpToDate(2*)\"\n        return content.split(\"(\")[0], content.split(\"(\")[0]\n    elif \"/\" in content:\n        # Output like \"Primar/Second\" or \"UpToDa/UpToDa\"\n        return content.split(\"/\")[0], content.split(\"/\")[1]\n\n    return content, \"\"", "entry_point": "_analyse_overview_field", "input": "[-1, 0, 1, 2]", "output": "([-1, 0, 1, 2], '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drbd.py#L13-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034173", "code": "def _count_spaces_startswith(line):\n    '''\n    Count the number of spaces before the first character\n    '''\n    if line.split('#')[0].strip() == \"\":\n        return None\n\n    spaces = 0\n    for i in line:\n        if i.isspace():\n            spaces += 1\n        else:\n            return spaces", "entry_point": "_count_spaces_startswith", "input": "'Hello World'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drbd.py#L27-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034174", "code": "def _get_cron_cmdstr(path, user=None):\n    '''\n    Returns a format string, to be used to build a crontab command.\n    '''\n    if user:\n        cmd = 'crontab -u {0}'.format(user)\n    else:\n        cmd = 'crontab'\n    return '{0} {1}'.format(cmd, path)", "entry_point": "_get_cron_cmdstr", "input": "'  padded  ', [-1, 0, 1, 2]", "output": "'crontab -u [-1, 0, 1, 2]   padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L180-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034175", "code": "def _escalation_rules_to_string(escalation_rules):\n    'convert escalation_rules dict to a string for comparison'\n    result = ''\n    for rule in escalation_rules:\n        result += 'escalation_delay_in_minutes: {0} '.format(rule['escalation_delay_in_minutes'])\n        for target in rule['targets']:\n            result += '{0}:{1} '.format(target['type'], target['id'])\n    return result", "entry_point": "_escalation_rules_to_string", "input": "set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_escalation_policy.py#L154-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034176", "code": "def _parse_pkg_string(pkg):\n    '''\n    Parse pkg string and return a tuple of package name, separator, and\n    package version.\n\n    Cabal support install package with following format:\n\n    * foo-1.0\n    * foo < 1.2\n    * foo > 1.3\n\n    For the sake of simplicity only the first form is supported,\n    support for other forms can be added later.\n    '''\n    pkg_name, separator, pkg_ver = pkg.partition('-')\n    return (pkg_name.strip(), separator, pkg_ver.strip())", "entry_point": "_parse_pkg_string", "input": "'Hello World'", "output": "('Hello World', '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cabal.py#L40-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034177", "code": "def exactly_n(l, n=1):\n    '''\n    Tests that exactly N items in an iterable are \"truthy\" (neither None,\n    False, nor 0).\n    '''\n    i = iter(l)\n    return all(any(i) for j in range(n)) and not any(i)", "entry_point": "exactly_n", "input": "set(), False", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/botomod.py#L243-L249", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034178", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n\n    VALID_MASK = [\n        'access',\n        'attrib',\n        'close_nowrite',\n        'close_write',\n        'create',\n        'delete',\n        'delete_self',\n        'excl_unlink',\n        'ignored',\n        'modify',\n        'moved_from',\n        'moved_to',\n        'move_self',\n        'oneshot',\n        'onlydir',\n        'open',\n        'unmount'\n    ]\n\n    # Configuration for inotify beacon should be a dict of dicts\n    if not isinstance(config, list):\n        return False, 'Configuration for inotify beacon must be a list.'\n    else:\n        _config = {}\n        list(map(_config.update, config))\n\n        if 'files' not in _config:\n            return False, 'Configuration for inotify beacon must include files.'\n        else:\n            for path in _config.get('files'):\n\n                if not isinstance(_config['files'][path], dict):\n                    return False, ('Configuration for inotify beacon must '\n                                   'be a list of dictionaries.')\n                else:\n                    if not any(j in ['mask',\n                                     'recurse',\n                                     'auto_add'] for j in _config['files'][path]):\n                        return False, ('Configuration for inotify beacon must '\n                                       'contain mask, recurse or auto_add items.')\n\n                    if 'auto_add' in _config['files'][path]:\n                        if not isinstance(_config['files'][path]['auto_add'], bool):\n                            return False, ('Configuration for inotify beacon '\n                                           'auto_add must be boolean.')\n\n                    if 'recurse' in _config['files'][path]:\n                        if not isinstance(_config['files'][path]['recurse'], bool):\n                            return False, ('Configuration for inotify beacon '\n                                           'recurse must be boolean.')\n\n                    if 'mask' in _config['files'][path]:\n                        if not isinstance(_config['files'][path]['mask'], list):\n                            return False, ('Configuration for inotify beacon '\n                                           'mask must be list.')\n                        for mask in _config['files'][path]['mask']:\n                            if mask not in VALID_MASK:\n                                return False, ('Configuration for inotify beacon '\n                                               'invalid mask option {0}.'.format(mask))\n    return True, 'Valid beacon configuration'", "entry_point": "validate", "input": "{'x': [1, 2], 'y': []}", "output": "(False, 'Configuration for inotify beacon must be a list.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L85-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034179", "code": "def _filter_list(input_list, search_key, search_value):\n\n    '''\n    Filters a list of dictionary by a set of key-value pair.\n\n    :param input_list:   is a list of dictionaries\n    :param search_key:   is the key we are looking for\n    :param search_value: is the value we are looking for the key specified in search_key\n    :return:             filered list of dictionaries\n    '''\n\n    output_list = list()\n\n    for dictionary in input_list:\n        if dictionary.get(search_key) == search_value:\n            output_list.append(dictionary)\n\n    return output_list", "entry_point": "_filter_list", "input": "[], [-1, 0, 1, 2], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L70-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034180", "code": "def _error_msg_iface(iface, option, expected):\n    '''\n    Build an appropriate error message from a given option and\n    a list of expected values.\n    '''\n    msg = 'Invalid option -- Interface: {0}, Option: {1}, Expected: [{2}]'\n    return msg.format(iface, option, '|'.join(str(e) for e in expected))", "entry_point": "_error_msg_iface", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4], [1, 2, 3]", "output": "\"Invalid option -- Interface: ['apple', 'banana', 'cherry'], Option: [5, 3, 1, 4], Expected: [1|2|3]\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_ip.py#L155-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034181", "code": "def _error_msg_routes(iface, option, expected):\n    '''\n    Build an appropriate error message from a given option and\n    a list of expected values.\n    '''\n    msg = 'Invalid option -- Route interface: {0}, Option: {1}, Expected: [{2}]'\n    return msg.format(iface, option, expected)", "entry_point": "_error_msg_routes", "input": "[1, 2, 3], [-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "'Invalid option -- Route interface: [1, 2, 3], Option: [-1, 0, 1, 2], Expected: [[-1, 0, 1, 2]]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_ip.py#L164-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034182", "code": "def _error_msg_network(option, expected):\n    '''\n    Build an appropriate error message from a given option and\n    a list of expected values.\n    '''\n    msg = 'Invalid network setting -- Setting: {0}, Expected: [{1}]'\n    return msg.format(option, '|'.join(str(e) for e in expected))", "entry_point": "_error_msg_network", "input": "[], []", "output": "'Invalid network setting -- Setting: [], Expected: []'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_ip.py#L180-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034183", "code": "def __int(value):\n    '''validate an integer'''\n    valid, _value = False, value\n    try:\n        _value = int(value)\n        valid = True\n    except ValueError:\n        pass\n    return (valid, _value, 'integer')", "entry_point": "__int", "input": "10", "output": "(True, 10, 'integer')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_ip.py#L315-L323", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034184", "code": "def __float(value):\n    '''validate a float'''\n    valid, _value = False, value\n    try:\n        _value = float(value)\n        valid = True\n    except ValueError:\n        pass\n    return (valid, _value, 'float')", "entry_point": "__float", "input": "'  padded  '", "output": "(False, '  padded  ', 'float')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_ip.py#L326-L334", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034185", "code": "def _revs_equal(rev1, rev2, rev_type):\n    '''\n    Shorthand helper function for comparing SHA1s. If rev_type == 'sha1' then\n    the comparison will be done using str.startwith() to allow short SHA1s to\n    compare successfully.\n\n    NOTE: This means that rev2 must be the short rev.\n    '''\n    if (rev1 is None and rev2 is not None) \\\n            or (rev2 is None and rev1 is not None):\n        return False\n    elif rev1 is rev2 is None:\n        return True\n    elif rev_type == 'sha1':\n        return rev1.startswith(rev2)\n    else:\n        return rev1 == rev2", "entry_point": "_revs_equal", "input": "[[1, 2], [3], []], [5, 3, 1, 4], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/git.py#L47-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034186", "code": "def cidr_to_ipv4_netmask(cidr_bits):\n    '''\n    Returns an IPv4 netmask\n    '''\n    try:\n        cidr_bits = int(cidr_bits)\n        if not 1 <= cidr_bits <= 32:\n            return ''\n    except ValueError:\n        return ''\n\n    netmask = ''\n    for idx in range(4):\n        if idx:\n            netmask += '.'\n        if cidr_bits >= 8:\n            netmask += '255'\n            cidr_bits -= 8\n        else:\n            netmask += '{0:d}'.format(256 - (2 ** (8 - cidr_bits)))\n            cidr_bits = 0\n    return netmask", "entry_point": "cidr_to_ipv4_netmask", "input": "'a,b,c'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/network.py#L606-L627", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034187", "code": "def _number_of_set_bits(x):\n    '''\n    Returns the number of bits that are set in a 32bit int\n    '''\n    # Taken from http://stackoverflow.com/a/4912729. Many thanks!\n    x -= (x >> 1) & 0x55555555\n    x = ((x >> 2) & 0x33333333) + (x & 0x33333333)\n    x = ((x >> 4) + x) & 0x0f0f0f0f\n    x += x >> 8\n    x += x >> 16\n    return x & 0x0000003f", "entry_point": "_number_of_set_bits", "input": "7", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/network.py#L640-L650", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034188", "code": "def _get_ips(networks):\n    '''\n    Helper function for list_nodes. Returns public and private ip lists based on a\n    given network dictionary.\n    '''\n    v4s = networks.get('v4')\n    v6s = networks.get('v6')\n    public_ips = []\n    private_ips = []\n\n    if v4s:\n        for item in v4s:\n            ip_type = item.get('type')\n            ip_address = item.get('ip_address')\n            if ip_type == 'public':\n                public_ips.append(ip_address)\n            if ip_type == 'private':\n                private_ips.append(ip_address)\n\n    if v6s:\n        for item in v6s:\n            ip_type = item.get('type')\n            ip_address = item.get('ip_address')\n            if ip_type == 'public':\n                public_ips.append(ip_address)\n            if ip_type == 'private':\n                private_ips.append(ip_address)\n\n    return public_ips, private_ips", "entry_point": "_get_ips", "input": "{'x': [1, 2], 'y': []}", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1356-L1384", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034189", "code": "def _ip_sort(ip):\n    '''Ip sorting'''\n    idx = '001'\n    if ip == '127.0.0.1':\n        idx = '200'\n    if ip == '::1':\n        idx = '201'\n    elif '::' in ip:\n        idx = '100'\n    return '{0}___{1}'.format(idx, ip)", "entry_point": "_ip_sort", "input": "['apple', 'banana', 'cherry']", "output": "\"001___['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L144-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034190", "code": "def _name_matches(name, matches):\n    '''\n    Helper function to see if given name has any of the patterns in given matches\n    '''\n    for m in matches:\n        if name.endswith(m):\n            return True\n        if name.lower().endswith('_' + m.lower()):\n            return True\n        if name.lower() == m.lower():\n            return True\n    return False", "entry_point": "_name_matches", "input": "'AbC dEf', ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L472-L483", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034191", "code": "def _route_flags(rflags):\n    '''\n    https://github.com/torvalds/linux/blob/master/include/uapi/linux/route.h\n    https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipv6_route.h\n    '''\n    flags = ''\n    fmap = {\n        0x0001: 'U',  # RTF_UP, route is up\n        0x0002: 'G',  # RTF_GATEWAY, use gateway\n        0x0004: 'H',  # RTF_HOST, target is a host\n        0x0008: 'R',  # RET_REINSTATE, reinstate route for dynamic routing\n        0x0010: 'D',  # RTF_DYNAMIC, dynamically installed by daemon or redirect\n        0x0020: 'M',  # RTF_MODIFIED, modified from routing daemon or redirect\n        0x00040000: 'A',  # RTF_ADDRCONF, installed by addrconf\n        0x01000000: 'C',  # RTF_CACHE, cache entry\n        0x0200: '!',  # RTF_REJECT, reject route\n    }\n    for item in fmap:\n        if rflags & item:\n            flags += fmap[item]\n    return flags", "entry_point": "_route_flags", "input": "False", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L183-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034192", "code": "def _dictionary_to_stringlist(input_dict):\n    '''\n    Convert a dictionary to a stringlist (comma separated settings)\n\n    The result of the dictionary {'setting1':'value1','setting2':'value2'} will be:\n\n    setting1=value1,setting2=value2\n    '''\n    string_value = \"\"\n    for s in input_dict:\n        string_value += \"{0}={1},\".format(s, input_dict[s])\n    string_value = string_value[:-1]\n    return string_value", "entry_point": "_dictionary_to_stringlist", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L541-L553", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034193", "code": "def _build_members(members, anycheck=False):\n    '''\n    Builds a member formatted string for XML operation.\n\n    '''\n    if isinstance(members, list):\n\n        # This check will strip down members to a single any statement\n        if anycheck and 'any' in members:\n            return \"<member>any</member>\"\n        response = \"\"\n        for m in members:\n            response += \"<member>{0}</member>\".format(m)\n        return response\n    else:\n        return \"<member>{0}</member>\".format(members)", "entry_point": "_build_members", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "'<member>5</member><member>3</member><member>1</member><member>4</member>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L101-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034194", "code": "def _validate_response(response):\n    '''\n    Validates a response from a Palo Alto device. Used to verify success of commands.\n\n    '''\n    if not response:\n        return False, 'Unable to validate response from device.'\n    elif 'msg' in response:\n        if 'line' in response['msg']:\n            if response['msg']['line'] == 'already at the top':\n                return True, response\n            elif response['msg']['line'] == 'already at the bottom':\n                return True, response\n            else:\n                return False, response\n        elif response['msg'] == 'command succeeded':\n            return True, response\n        else:\n            return False, response\n    elif 'status' in response:\n        if response['status'] == \"success\":\n            return True, response\n        else:\n            return False, response\n    else:\n        return False, response", "entry_point": "_validate_response", "input": "['a', 'b', 'c']", "output": "(False, ['a', 'b', 'c'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L240-L265", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034195", "code": "def _getText(nodelist):\n    '''\n    Simple function to return value from XML\n    '''\n    rc = []\n    for node in nodelist:\n        if node.nodeType == node.TEXT_NODE:\n            rc.append(node.data)\n    return ''.join(rc)", "entry_point": "_getText", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L141-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034196", "code": "def _get_binding_info(hostheader='', ipaddress='*', port=80):\n    '''\n    Combine the host header, IP address, and TCP port into bindingInformation format.\n    '''\n    ret = r'{0}:{1}:{2}'.format(ipaddress, port, hostheader.replace(' ', ''))\n\n    return ret", "entry_point": "_get_binding_info", "input": "'AbC dEf', 'walnut thistle harbour', ('a', 'b', 'c')", "output": "\"walnut thistle harbour:('a', 'b', 'c'):AbCdEf\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L31-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034197", "code": "def _kname(obj):\n    '''Get name or names out of json result from API server'''\n    if isinstance(obj, dict):\n        return [obj.get(\"metadata\", {}).get(\"name\", \"\")]\n    elif isinstance(obj, (list, tuple)):\n        names = []\n        for i in obj:\n            names.append(i.get(\"metadata\", {}).get(\"name\", \"\"))\n        return names\n    else:\n        return \"Unknown type\"", "entry_point": "_kname", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L121-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034198", "code": "def _new_mods(pre_mods, post_mods):\n    '''\n    Return a list of the new modules, pass an lsmod dict before running\n    modprobe and one after modprobe has run\n    '''\n    pre = set()\n    post = set()\n    for mod in pre_mods:\n        pre.add(mod['module'])\n    for mod in post_mods:\n        post.add(mod['module'])\n    return post - pre", "entry_point": "_new_mods", "input": "set(), set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kmod.py#L26-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034199", "code": "def get_port_def(port_num, proto='tcp'):\n    '''\n    Given a port number and protocol, returns the port definition expected by\n    docker-py. For TCP ports this is simply an integer, for UDP ports this is\n    (port_num, 'udp').\n\n    port_num can also be a string in the format 'port_num/udp'. If so, the\n    \"proto\" argument will be ignored. The reason we need to be able to pass in\n    the protocol separately is because this function is sometimes invoked on\n    data derived from a port range (e.g. '2222-2223/udp'). In these cases the\n    protocol has already been stripped off and the port range resolved into the\n    start and end of the range, and get_port_def() is invoked once for each\n    port number in that range. So, rather than munge udp ports back into\n    strings before passing them to this function, the function will see if it\n    has a string and use the protocol from it if present.\n\n    This function does not catch the TypeError or ValueError which would be\n    raised if the port number is non-numeric. This function either needs to be\n    run on known good input, or should be run within a try/except that catches\n    these two exceptions.\n    '''\n    try:\n        port_num, _, port_num_proto = port_num.partition('/')\n    except AttributeError:\n        pass\n    else:\n        if port_num_proto:\n            proto = port_num_proto\n    try:\n        if proto.lower() == 'udp':\n            return int(port_num), 'udp'\n    except AttributeError:\n        pass\n    return int(port_num)", "entry_point": "get_port_def", "input": "3, ['apple', 'banana', 'cherry']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/helpers.py#L26-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034200", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n\n    # Configuration for load beacon should be a list of dicts\n    if not isinstance(config, list):\n        return False, ('Configuration for load beacon must be a list.')\n    else:\n        _config = {}\n        list(map(_config.update, config))\n\n        if 'emitatstartup' in _config:\n            if not isinstance(_config['emitatstartup'], bool):\n                return False, ('Configuration for load beacon option '\n                               'emitatstartup must be a boolean.')\n\n        if 'onchangeonly' in _config:\n            if not isinstance(_config['onchangeonly'], bool):\n                return False, ('Configuration for load beacon option '\n                               'onchangeonly must be a boolean.')\n\n        if 'averages' not in _config:\n            return False, ('Averages configuration is required'\n                           ' for load beacon.')\n        else:\n\n            if not any(j in ['1m', '5m', '15m'] for j\n                       in _config.get('averages', {})):\n                return False, ('Averages configuration for load beacon '\n                               'must contain 1m, 5m or 15m items.')\n\n            for item in ['1m', '5m', '15m']:\n                if not isinstance(_config['averages'][item], list):\n                    return False, ('Averages configuration for load beacon: '\n                                   '1m, 5m and 15m items must be '\n                                   'a list of two items.')\n                else:\n                    if len(_config['averages'][item]) != 2:\n                        return False, ('Configuration for load beacon: '\n                                       '1m, 5m and 15m items must be '\n                                       'a list of two items.')\n\n    return True, 'Valid beacon configuration'", "entry_point": "validate", "input": "{'a': 1, 'b': 2}", "output": "(False, 'Configuration for load beacon must be a list.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/load.py#L32-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034201", "code": "def ensure_sequence_filter(data):\n    '''\n    Ensure sequenced data.\n\n    **sequence**\n\n        ensure that parsed data is a sequence\n\n    .. code-block:: jinja\n\n        {% set my_string = \"foo\" %}\n        {% set my_list = [\"bar\", ] %}\n        {% set my_dict = {\"baz\": \"qux\"} %}\n\n        {{ my_string|sequence|first }}\n        {{ my_list|sequence|first }}\n        {{ my_dict|sequence|first }}\n\n\n    will be rendered as:\n\n    .. code-block:: yaml\n\n        foo\n        bar\n        baz\n    '''\n    if not isinstance(data, (list, tuple, set, dict)):\n        return [data]\n    return data", "entry_point": "ensure_sequence_filter", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L252-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034202", "code": "def _pkg(jail=None, chroot=None, root=None):\n    '''\n    Returns the prefix for a pkg command, using -j if a jail is specified, or\n    -c if chroot is specified.\n    '''\n    ret = ['pkg']\n    if jail:\n        ret.extend(['-j', jail])\n    elif chroot:\n        ret.extend(['-c', chroot])\n    elif root:\n        ret.extend(['-r', root])\n    return ret", "entry_point": "_pkg", "input": "[[1, 2], [3], []], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "['pkg', '-j', [[1, 2], [3], []]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L89-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034203", "code": "def _dict_to_stanza(key, stanza):\n    '''\n    Convert a dict to a multi-line stanza\n    '''\n    ret = ''\n    for skey in stanza:\n        if stanza[skey] is True:\n            stanza[skey] = ''\n        ret += '    {0} {1}\\n'.format(skey, stanza[skey])\n    return '{0} {{\\n{1}}}'.format(key, ret)", "entry_point": "_dict_to_stanza", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "'[5, 3, 1, 4] {\\n    -1 2\\n    0 -1\\n    1 0\\n    2 1\\n}'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/logrotate.py#L276-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034204", "code": "def _property_detect_type(name, values):\n    '''\n    Detect the datatype of a property\n    '''\n    value_type = 'str'\n    if values.startswith('on | off'):\n        value_type = 'bool'\n    elif values.startswith('yes | no'):\n        value_type = 'bool_alt'\n    elif values in ['<size>', '<size> | none']:\n        value_type = 'size'\n    elif values in ['<count>', '<count> | none', '<guid>']:\n        value_type = 'numeric'\n    elif name in ['sharenfs', 'sharesmb', 'canmount']:\n        value_type = 'bool'\n    elif name in ['version', 'copies']:\n        value_type = 'numeric'\n    return value_type", "entry_point": "_property_detect_type", "input": "False, 'a,b,c'", "output": "'str'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L77-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034205", "code": "def from_bool(value):\n    '''\n    Convert zfs bool to python bool\n    '''\n    if value in ['on', 'yes']:\n        value = True\n    elif value in ['off', 'no']:\n        value = False\n    elif value == 'none':\n        value = None\n\n    return value", "entry_point": "from_bool", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L430-L441", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034206", "code": "def from_str(value):\n    '''\n    Decode zfs safe string (used for name, path, ...)\n    '''\n    if value == 'none':\n        value = None\n    if value:\n        value = str(value)\n        if value.startswith('\"') and value.endswith('\"'):\n            value = value[1:-1]\n        value = value.replace('\\\\\"', '\"')\n\n    return value", "entry_point": "from_str", "input": "[[1, 2], [3], []]", "output": "'[[1, 2], [3], []]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L530-L542", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034207", "code": "def _legacy_grains(grains):\n    '''\n    Grains for backwards compatibility\n    Remove this function in Neon\n    '''\n    # parse legacy sdc grains\n    if 'mdata' in grains and 'sdc' in grains['mdata']:\n        if 'server_uuid' not in grains['mdata']['sdc'] or 'FAILURE' in grains['mdata']['sdc']['server_uuid']:\n            grains['hypervisor_uuid'] = 'unknown'\n        else:\n            grains['hypervisor_uuid'] = grains['mdata']['sdc']['server_uuid']\n\n        if 'datacenter_name' not in grains['mdata']['sdc'] or 'FAILURE' in grains['mdata']['sdc']['datacenter_name']:\n            grains['datacenter'] = 'unknown'\n        else:\n            grains['datacenter'] = grains['mdata']['sdc']['datacenter_name']\n\n    # parse rules grains\n    if 'mdata' in grains and 'rules' in grains['mdata']:\n        grains['roles'] = grains['mdata']['roles'].split(',')\n\n    return grains", "entry_point": "_legacy_grains", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/mdata.py#L128-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034208", "code": "def __ssh_gateway_config_dict(gateway):\n    '''\n    Return a dictionary with gateway options. The result is used\n    to provide arguments to __ssh_gateway_arguments method.\n    '''\n    extended_kwargs = {}\n    if gateway:\n        extended_kwargs['ssh_gateway'] = gateway['ssh_gateway']\n        extended_kwargs['ssh_gateway_key'] = gateway['ssh_gateway_key']\n        extended_kwargs['ssh_gateway_user'] = gateway['ssh_gateway_user']\n        extended_kwargs['ssh_gateway_command'] = gateway['ssh_gateway_command']\n    return extended_kwargs", "entry_point": "__ssh_gateway_config_dict", "input": "False", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L143-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034209", "code": "def _conv_name(x):\n    '''\n    If this XML tree has an xmlns attribute, then etree will add it\n    to the beginning of the tag, like: \"{http://path}tag\".\n    '''\n    if '}' in x:\n        comps = x.split('}')\n        name = comps[1]\n        return name\n    return x", "entry_point": "_conv_name", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/xmlutil.py#L10-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034210", "code": "def _scrub_links(links, name):\n    '''\n    Remove container name from HostConfig:Links values to enable comparing\n    container configurations correctly.\n    '''\n    if isinstance(links, list):\n        ret = []\n        for l in links:\n            ret.append(l.replace('/{0}/'.format(name), '/', 1))\n    else:\n        ret = links\n\n    return ret", "entry_point": "_scrub_links", "input": "[], 'a,b,c'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L584-L596", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034211", "code": "def _get_val(record, keys):\n    '''\n    Internal, get value from record\n    '''\n    data = record\n    for key in keys:\n        if key in data:\n            data = data[key]\n        else:\n            return None\n    return data", "entry_point": "_get_val", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L166-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034212", "code": "def _parse_op(op):\n    '''\n    >>> _parse_op('>')\n    'gt'\n    >>> _parse_op('>=')\n    'ge'\n    >>> _parse_op('=>')\n    'ge'\n    >>> _parse_op('=> ')\n    'ge'\n    >>> _parse_op('<')\n    'lt'\n    >>> _parse_op('<=')\n    'le'\n    >>> _parse_op('==')\n    'eq'\n    >>> _parse_op(' <= ')\n    'le'\n    '''\n    op = op.strip()\n    if '>' in op:\n        if '=' in op:\n            return 'ge'\n        else:\n            return 'gt'\n    elif '<' in op:\n        if '=' in op:\n            return 'le'\n        else:\n            return 'lt'\n    elif '!' in op:\n        return 'ne'\n    else:\n        return 'eq'", "entry_point": "_parse_op", "input": "'Hello World'", "output": "'eq'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L142-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034213", "code": "def _get_url(method,\n             api_url,\n             api_version):\n    '''\n    Build the API URL.\n    '''\n    return '{url}/{version}/{method}.json'.format(url=api_url,\n                                                  version=float(api_version),\n                                                  method=method)", "entry_point": "_get_url", "input": "-3, [], True", "output": "'[]/1.0/-3.json'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L80-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034214", "code": "def _verify_subnet_association(route_table_desc, subnet_id):\n    '''\n    Helper function verify a subnet's route table association\n\n    route_table_desc\n        the description of a route table, as returned from boto_vpc.describe_route_table\n\n    subnet_id\n        the subnet id to verify\n\n    .. versionadded:: 2016.11.0\n    '''\n    if route_table_desc:\n        if 'associations' in route_table_desc:\n            for association in route_table_desc['associations']:\n                if association['subnet_id'] == subnet_id:\n                    return True\n    return False", "entry_point": "_verify_subnet_association", "input": "{}, [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L674-L691", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034215", "code": "def safe_py_code(code):\n    '''\n    Check a string to see if it has any potentially unsafe routines which\n    could be executed via python, this routine is used to improve the\n    safety of modules suct as virtualenv\n    '''\n    bads = (\n            'import',\n            ';',\n            'subprocess',\n            'eval',\n            'open',\n            'file',\n            'exec',\n            'input')\n    for bad in bads:\n        if code.count(bad):\n            return False\n    return True", "entry_point": "safe_py_code", "input": "[[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L507-L525", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034216", "code": "def camel_to_snake_case(camel_input):\n    '''\n    Converts camelCase (or CamelCase) to snake_case.\n    From https://codereview.stackexchange.com/questions/185966/functions-to-convert-camelcase-strings-to-snake-case\n\n    :param str camel_input: The camelcase or CamelCase string to convert to snake_case\n\n    :return str\n    '''\n    res = camel_input[0].lower()\n    for i, letter in enumerate(camel_input[1:], 1):\n        if letter.isupper():\n            if camel_input[i-1].islower() or (i != len(camel_input)-1 and camel_input[i+1].islower()):\n                res += '_'\n        res += letter.lower()\n    return res", "entry_point": "camel_to_snake_case", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/stringutils.py#L594-L609", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034217", "code": "def snake_to_camel_case(snake_input, uppercamel=False):\n    '''\n    Converts snake_case to camelCase (or CamelCase if uppercamel is ``True``).\n    Inspired by https://codereview.stackexchange.com/questions/85311/transform-snake-case-to-camelcase\n\n    :param str snake_input: The input snake_case string to convert to camelCase\n    :param bool uppercamel: Whether or not to convert to CamelCase instead\n\n    :return str\n    '''\n    words = snake_input.split('_')\n    if uppercamel:\n        words[0] = words[0].capitalize()\n    return words[0] + ''.join(word.capitalize() for word in words[1:])", "entry_point": "snake_to_camel_case", "input": "'abc', 7", "output": "'Abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/stringutils.py#L613-L626", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034218", "code": "def _partition_index_names(provisioned_index_names, index_names):\n    '''Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.'''\n    existing_index_names = set()\n    new_index_names = set()\n    for name in index_names:\n        if name in provisioned_index_names:\n            existing_index_names.add(name)\n        else:\n            new_index_names.add(name)\n    index_names_to_be_deleted = provisioned_index_names - existing_index_names\n    return existing_index_names, new_index_names, index_names_to_be_deleted", "entry_point": "_partition_index_names", "input": "set(), {'a': 1, 'b': 2}", "output": "(set(), {'a', 'b'}, set())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L498-L508", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034219", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n    # Configuration for pkg beacon should be a list\n    if not isinstance(config, list):\n        return False, ('Configuration for pkg beacon must be a list.')\n\n    # Configuration for pkg beacon should contain pkgs\n    pkgs_found = False\n    pkgs_not_list = False\n    for config_item in config:\n        if 'pkgs' in config_item:\n            pkgs_found = True\n            if isinstance(config_item['pkgs'], list):\n                pkgs_not_list = True\n\n    if not pkgs_found or not pkgs_not_list:\n        return False, 'Configuration for pkg beacon requires list of pkgs.'\n    return True, 'Valid beacon configuration'", "entry_point": "validate", "input": "{'a': 1, 'b': 2}", "output": "(False, 'Configuration for pkg beacon must be a list.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/pkg.py#L25-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034220", "code": "def _safe_output(line):\n    '''\n    Looks for rabbitmqctl warning, or general formatting, strings that aren't\n    intended to be parsed as output.\n    Returns a boolean whether the line can be parsed as rabbitmqctl output.\n    '''\n    return not any([\n        line.startswith('Listing') and line.endswith('...'),\n        line.startswith('Listing') and '\\t' not in line,\n        '...done' in line,\n        line.startswith('WARNING:')\n    ])", "entry_point": "_safe_output", "input": "'abc'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L132-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034221", "code": "def _lookup_element(lst, key):\n    '''\n    Find an dictionary in a list of dictionaries, given its main key.\n    '''\n    if not lst:\n        return {}\n    for ele in lst:\n        if not ele or not isinstance(ele, dict):\n            continue\n        if ele.keys()[0] == key:\n            return ele.values()[0]\n    return {}", "entry_point": "_lookup_element", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/capirca_acl.py#L393-L404", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034222", "code": "def _cleanup(lst):\n    '''\n    Return a list of non-empty dictionaries.\n    '''\n    clean = []\n    for ele in lst:\n        if ele and isinstance(ele, dict):\n            clean.append(ele)\n    return clean", "entry_point": "_cleanup", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/capirca_acl.py#L419-L427", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034223", "code": "def _trim_files(files, trim_output):\n    '''\n    Trim the file list for output.\n    '''\n    count = 100\n    if not isinstance(trim_output, bool):\n        count = trim_output\n\n    if not(isinstance(trim_output, bool) and trim_output is False) and len(files) > count:\n        files = files[:count]\n        files.append(\"List trimmed after {0} files.\".format(count))\n\n    return files", "entry_point": "_trim_files", "input": "{1, 2, 3}, 3.25", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/archive.py#L1351-L1363", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034224", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n    if not isinstance(config, list):\n        return False, ('Configuration for telegram_bot_msg '\n                       'beacon must be a list.')\n\n    _config = {}\n    list(map(_config.update, config))\n\n    if not all(_config.get(required_config)\n               for required_config in ['token', 'accept_from']):\n        return False, ('Not all required configuration for '\n                       'telegram_bot_msg are set.')\n\n    if not isinstance(_config.get('accept_from'), list):\n        return False, ('Configuration for telegram_bot_msg, '\n                       'accept_from must be a list of usernames.')\n\n    return True, 'Valid beacon configuration.'", "entry_point": "validate", "input": "{'a': 1, 'b': 2}", "output": "(False, 'Configuration for telegram_bot_msg beacon must be a list.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/telegram_bot_msg.py#L35-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034225", "code": "def _diff_replication_group(current, desired):\n    '''\n    If you need to enhance what modify_replication_group() considers when deciding what is to be\n    (or can be) updated, add it to 'modifiable' below.  It's a dict mapping the param as used\n    in modify_replication_group() to that in describe_replication_groups().  Any data fiddlery\n    that needs to be done to make the mappings meaningful should be done in the munging section\n    below as well.\n\n    This function will ONLY touch settings that are explicitly called out in 'desired' - any\n    settings which might have previously been changed from their 'default' values will not be\n    changed back simply by leaving them out of 'desired'.  This is both intentional, and\n    much, much easier to code :)\n    '''\n    if current.get('AutomaticFailover') is not None:\n        current['AutomaticFailoverEnabled'] = True if current['AutomaticFailover'] in ('enabled',\n                'enabling') else False\n\n    modifiable = {\n        # Amazingly, the AWS API provides NO WAY to query the current state of most repl group\n        # settings!  All we can do is send a modify op with the desired value, just in case it's\n        # different.  And THEN, we can't determine if it's been changed!  Stupid?  YOU BET!\n        'AutomaticFailoverEnabled': 'AutomaticFailoverEnabled',\n        'AutoMinorVersionUpgrade': None,\n        'CacheNodeType': None,\n        'CacheParameterGroupName': None,\n        'CacheSecurityGroupNames': None,\n        'EngineVersion': None,\n        'NotificationTopicArn': None,\n        'NotificationTopicStatus': None,\n        'PreferredMaintenanceWindow': None,\n        'PrimaryClusterId': None,\n        'ReplicationGroupDescription': 'Description',\n        'SecurityGroupIds': None,\n        'SnapshotRetentionLimit': 'SnapshotRetentionLimit',\n        'SnapshottingClusterId': 'SnapshottingClusterId',\n        'SnapshotWindow': 'SnapshotWindow'\n    }\n\n    need_update = {}\n    for m, o in modifiable.items():\n        if m in desired:\n            if not o:\n                # Always pass these through - let AWS do the math...\n                need_update[m] = desired[m]\n            else:\n                if m in current:\n                    # Equivalence testing works fine for current simple type comparisons\n                    # This might need enhancement if more complex structures enter the picture\n                    if current[m] != desired[m]:\n                        need_update[m] = desired[m]\n    return need_update", "entry_point": "_diff_replication_group", "input": "{'a': 1, 'b': 2}, [5, 3, 1, 4]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L548-L598", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034226", "code": "def _diff_cache_subnet_group(current, desired):\n    '''\n    If you need to enhance what modify_cache_subnet_group() considers when deciding what is to be\n    (or can be) updated, add it to 'modifiable' below.  It's a dict mapping the param as used\n    in modify_cache_subnet_group() to that in describe_cache_subnet_group().  Any data fiddlery that\n    needs to be done to make the mappings meaningful should be done in the munging section\n    below as well.\n\n    This function will ONLY touch settings that are explicitly called out in 'desired' - any\n    settings which might have previously been changed from their 'default' values will not be\n    changed back simply by leaving them out of 'desired'.  This is both intentional, and\n    much, much easier to code :)\n    '''\n    modifiable = {\n        'CacheSubnetGroupDescription': 'CacheSubnetGroupDescription',\n        'SubnetIds': 'SubnetIds'\n    }\n\n    need_update = {}\n    for m, o in modifiable.items():\n        if m in desired:\n            if not o:\n                # Always pass these through - let AWS do the math...\n                need_update[m] = desired[m]\n            else:\n                if m in current:\n                    # Equivalence testing works fine for current simple type comparisons\n                    # This might need enhancement if more complex structures enter the picture\n                    if current[m] != desired[m]:\n                        need_update[m] = desired[m]\n    return need_update", "entry_point": "_diff_cache_subnet_group", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L981-L1011", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034227", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n    vcfg_ret = True\n    vcfg_msg = 'Valid beacon configuration'\n\n    if not isinstance(config, list):\n        vcfg_ret = False\n        vcfg_msg = 'Configuration for vmadm beacon must be a list!'\n\n    return vcfg_ret, vcfg_msg", "entry_point": "validate", "input": "{}", "output": "(False, 'Configuration for vmadm beacon must be a list!')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/smartos_vmadm.py#L55-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034228", "code": "def _check_diff(changes):\n    '''\n    Check the diff for signs of incorrect argument handling in previous\n    releases, as discovered here:\n\n    https://github.com/saltstack/salt/pull/39996#issuecomment-288025200\n    '''\n    for conf_dict in changes:\n        if conf_dict == 'Networks':\n            continue\n        for item in changes[conf_dict]:\n            if changes[conf_dict][item]['new'] is None:\n                old = changes[conf_dict][item]['old']\n                if old == '':\n                    return True\n                else:\n                    try:\n                        if all(x == '' for x in old):\n                            return True\n                    except TypeError:\n                        # Old value is not an iterable type\n                        pass\n    return False", "entry_point": "_check_diff", "input": "set()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L93-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034229", "code": "def _filter_plans(attr, name, plans):\n    '''\n    Helper to return list of usage plan items matching the given attribute value.\n    '''\n    return [plan for plan in plans if plan[attr] == name]", "entry_point": "_filter_plans", "input": "[], 'AbC dEf', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1388-L1392", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034230", "code": "def _check_accept_keywords(approved, flag):\n    '''check compatibility of accept_keywords'''\n    if flag in approved:\n        return False\n    elif (flag.startswith('~') and flag[1:] in approved) \\\n            or ('~'+flag in approved):\n        return False\n    else:\n        return True", "entry_point": "_check_accept_keywords", "input": "[-1, 0, 1, 2], True", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L283-L291", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034231", "code": "def _id_or_key(list_item):\n    '''\n    Return the value at key 'id' or 'key'.\n    '''\n    if isinstance(list_item, dict):\n        if 'id' in list_item:\n            return list_item['id']\n        if 'key' in list_item:\n            return list_item['key']\n    return list_item", "entry_point": "_id_or_key", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L383-L392", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034232", "code": "def _reverse_lookup(dictionary, value):\n    '''\n    Lookup the key in a dictionary by it's value. Will return the first match.\n\n    :param dict dictionary: The dictionary to search\n\n    :param str value: The value to search for.\n\n    :return: Returns the first key to match the value\n    :rtype: str\n    '''\n    value_index = -1\n    for idx, dict_value in enumerate(dictionary.values()):\n        if type(dict_value) == list:\n            if value in dict_value:\n                value_index = idx\n                break\n        elif value == dict_value:\n            value_index = idx\n            break\n\n    return list(dictionary)[value_index]", "entry_point": "_reverse_lookup", "input": "{'x': [1, 2], 'y': []}, [[1, 2], [3], []]", "output": "'y'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_task.py#L241-L262", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034233", "code": "def key_list(items=None):\n    '''\n    convert list to dictionary using the key as the identifier\n    :param items: array to iterate over\n    :return: dictionary\n    '''\n    if items is None:\n        items = []\n\n    ret = {}\n    if items and isinstance(items, list):\n        for item in items:\n            if 'name' in item:\n                # added for consistency with old code\n                if 'id' not in item:\n                    item['id'] = item['name']\n                ret[item['name']] = item\n    return ret", "entry_point": "key_list", "input": "['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L601-L618", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034234", "code": "def _validate_time_range(trange, status, msg):\n    '''\n    Check time range\n    '''\n    # If trange is empty, just return the current status & msg\n    if not trange:\n        return status, msg\n\n    if not isinstance(trange, dict):\n        status = False\n        msg = ('The time_range parameter for '\n               'wtmp beacon must '\n               'be a dictionary.')\n\n    if not all(k in trange for k in ('start', 'end')):\n        status = False\n        msg = ('The time_range parameter for '\n               'wtmp beacon must contain '\n               'start & end options.')\n\n    return status, msg", "entry_point": "_validate_time_range", "input": "[-1, 0, 1, 2], ['a', 'b', 'c'], ''", "output": "(False, 'The time_range parameter for wtmp beacon must contain start & end options.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/wtmp.py#L174-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034235", "code": "def _build_gecos(gecos_dict):\n    '''\n    Accepts a dictionary entry containing GECOS field names and their values,\n    and returns a full GECOS comment string, to be used with usermod.\n    '''\n    return '{0},{1},{2},{3}'.format(gecos_dict.get('fullname', ''),\n                                    gecos_dict.get('roomnumber', ''),\n                                    gecos_dict.get('workphone', ''),\n                                    gecos_dict.get('homephone', ''))", "entry_point": "_build_gecos", "input": "{'a': 1, 'b': 2}", "output": "',,,'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L63-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034236", "code": "def compare_lists(old=None, new=None):\n    '''\n    Compare before and after results from various salt functions, returning a\n    dict describing the changes that were made\n    '''\n    ret = dict()\n    for item in new:\n        if item not in old:\n            ret['new'] = item\n    for item in old:\n        if item not in new:\n            ret['old'] = item\n    return ret", "entry_point": "compare_lists", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "{'new': 2, 'old': 4}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/data.py#L147-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034237", "code": "def is_dictlist(data):\n    '''\n    Returns True if data is a list of one-element dicts (as found in many SLS\n    schemas), otherwise returns False\n    '''\n    if isinstance(data, list):\n        for element in data:\n            if isinstance(element, dict):\n                if len(element) != 1:\n                    return False\n            else:\n                return False\n        return True\n    return False", "entry_point": "is_dictlist", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/data.py#L745-L758", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034238", "code": "def _is_not_considered_falsey(value, ignore_types=()):\n    '''\n    Helper function for filter_falsey to determine if something is not to be\n    considered falsey.\n\n    :param any value: The value to consider\n    :param list ignore_types: The types to ignore when considering the value.\n\n    :return bool\n    '''\n    return isinstance(value, bool) or type(value) in ignore_types or value", "entry_point": "_is_not_considered_falsey", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/data.py#L999-L1009", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034239", "code": "def _format_return_data(retcode, stdout=None, stderr=None):\n    '''\n    Creates a dictionary from the parameters, which can be used to return data\n    to Salt.\n    '''\n    ret = {'retcode': retcode}\n    if stdout is not None:\n        ret['stdout'] = stdout\n    if stderr is not None:\n        ret['stderr'] = stderr\n    return ret", "entry_point": "_format_return_data", "input": "[-1, 0, 1, 2], [[1, 2], [3], []], ['a', 'b', 'c']", "output": "{'retcode': [-1, 0, 1, 2], 'stdout': [[1, 2], [3], []], 'stderr': ['a', 'b', 'c']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/syslog_ng.py#L810-L820", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034240", "code": "def _clean_salt_variables(params, variable_prefix=\"__\"):\n    '''\n    Pops out variables from params which starts with `variable_prefix`.\n    '''\n    list(list(map(params.pop, [k for k in params if k.startswith(variable_prefix)])))\n    return params", "entry_point": "_clean_salt_variables", "input": "[], 'Hello World'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/serverdensity_device.py#L68-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034241", "code": "def _normalize_info(dev):\n    '''\n    Replace list with only one element to the value of the element.\n\n    :param dev:\n    :return:\n    '''\n    for sect, val in dev.items():\n        if len(val) == 1:\n            dev[sect] = val[0]\n\n    return dev", "entry_point": "_normalize_info", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/udev.py#L73-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034242", "code": "def _clean_data(data):\n    '''\n    Removes SaltStack params from **kwargs\n    '''\n    for key in list(data):\n        if key.startswith('__pub'):\n            del data[key]\n    return data", "entry_point": "_clean_data", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glassfish.py#L78-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034243", "code": "def _split_docker_uuid(uuid):\n    '''\n    Split a smartos docker uuid into repo and tag\n    '''\n    if uuid:\n        uuid = uuid.split(':')\n        if len(uuid) == 2:\n            tag = uuid[1]\n            repo = uuid[0]\n            return repo, tag\n    return None, None", "entry_point": "_split_docker_uuid", "input": "'AbC dEf'", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_imgadm.py#L104-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034244", "code": "def _is_uuid(uuid):\n    '''\n    Check if uuid is a valid smartos uuid\n\n    Example: e69a0918-055d-11e5-8912-e3ceb6df4cf8\n    '''\n    if uuid and list((len(x) for x in uuid.split('-'))) == [8, 4, 4, 4, 12]:\n        return True\n    return False", "entry_point": "_is_uuid", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_imgadm.py#L117-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034245", "code": "def _group_changes(cur, wanted, remove=False):\n    '''\n    Determine if the groups need to be changed\n    '''\n    old = set(cur)\n    new = set(wanted)\n    if (remove and old != new) or (not remove and not new.issubset(old)):\n        return True\n    return False", "entry_point": "_group_changes", "input": "[1, 2, 3], [], ['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L44-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034246", "code": "def findArgs(args, prefixes):\n\t\t\"\"\"\n\t\tExtracts the list of arguments that start with any of the specified prefix values\n\t\t\"\"\"\n\t\treturn list([\n\t\t\targ for arg in args\n\t\t\tif len([p for p in prefixes if arg.lower().startswith(p.lower())]) > 0\n\t\t])", "entry_point": "findArgs", "input": "['a', 'b', 'c'], ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/Utility.py#L86-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034247", "code": "def stripArgs(args, blacklist):\n\t\t\"\"\"\n\t\tRemoves any arguments in the supplied list that are contained in the specified blacklist\n\t\t\"\"\"\n\t\tblacklist = [b.lower() for b in blacklist]\n\t\treturn list([arg for arg in args if arg.lower() not in blacklist])", "entry_point": "stripArgs", "input": "set(), {'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/Utility.py#L103-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034248", "code": "def process_credentials_elements(cred_tree):\n        \"\"\" Receive an XML object with the credentials to run\n        a scan against a given target.\n\n        @param:\n        <credentials>\n          <credential type=\"up\" service=\"ssh\" port=\"22\">\n            <username>scanuser</username>\n            <password>mypass</password>\n          </credential>\n          <credential type=\"up\" service=\"smb\">\n            <username>smbuser</username>\n            <password>mypass</password>\n          </credential>\n        </credentials>\n\n        @return: Dictionary containing the credentials for a given target.\n                 Example form:\n                 {'ssh': {'type': type,\n                          'port': port,\n                          'username': username,\n                          'password': pass,\n                        },\n                  'smb': {'type': type,\n                          'username': username,\n                          'password': pass,\n                         },\n                   }\n        \"\"\"\n        credentials = {}\n        for credential in cred_tree:\n            service = credential.attrib.get('service')\n            credentials[service] = {}\n            credentials[service]['type'] = credential.attrib.get('type')\n            if service == 'ssh':\n                credentials[service]['port'] = credential.attrib.get('port')\n            for param in credential:\n                credentials[service][param.tag] = param.text\n\n        return credentials", "entry_point": "process_credentials_elements", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L448-L487", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034249", "code": "def port_str_arrange(ports):\n    \"\"\" Gives a str in the format (always tcp listed first).\n    T:<tcp ports/portrange comma separated>U:<udp ports comma separated>\n    \"\"\"\n    b_tcp = ports.find(\"T\")\n    b_udp = ports.find(\"U\")\n    if (b_udp != -1 and b_tcp != -1) and b_udp < b_tcp:\n        return ports[b_tcp:] + ports[b_udp:b_tcp]\n\n    return ports", "entry_point": "port_str_arrange", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/misc.py#L641-L650", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034250", "code": "def get_errors(audit_results):\n        \"\"\"\n        Args:\n\n            audit_results: results of `AxsAudit.do_audit()`.\n\n        Returns: a list of errors.\n        \"\"\"\n        errors = []\n        if audit_results:\n            if audit_results.errors:\n                errors.extend(audit_results.errors)\n        return errors", "entry_point": "get_errors", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edx/bok-choy/blob/cdd0d423419fc0c49d56a9226533aa1490b60afc/bok_choy/a11y/axs_ruleset.py#L196-L208", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034251", "code": "def try_value_to_bool(value, strict_mode=True):\n    \"\"\"Tries to convert value into boolean.\n\n    strict_mode is True:\n    - Only string representation of str(True) and str(False)\n      are converted into booleans;\n    - Otherwise unchanged incoming value is returned;\n\n    strict_mode is False:\n    - Anything that looks like True or False is converted into booleans.\n    Values accepted as True:\n    - 'true', 'on', 'yes' (case independent)\n    Values accepted as False:\n    - 'false', 'off', 'no' (case independent)\n    - all other values are returned unchanged\n    \"\"\"\n    if strict_mode:\n        true_list = ('True',)\n        false_list = ('False',)\n        val = value\n    else:\n        true_list = ('true', 'on', 'yes')\n        false_list = ('false', 'off', 'no')\n        val = str(value).lower()\n\n    if val in true_list:\n        return True\n    elif val in false_list:\n        return False\n    return value", "entry_point": "try_value_to_bool", "input": "[5, 3, 1, 4], False", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/infobloxopen/infoblox-client/blob/edeec62db1935784c728731b2ae7cf0fcc9bf84d/infoblox_client/utils.py#L85-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034252", "code": "def _process_value(func, value):\n        \"\"\"Applies processing method for value or each element in it.\n\n        :param func: method to be called with value\n        :param value: value to process\n        :return: if 'value' is list/tupe, returns iterable with func results,\n                 else func result is returned\n        \"\"\"\n        if isinstance(value, (list, tuple)):\n            return [func(item) for item in value]\n        return func(value)", "entry_point": "_process_value", "input": "('a', 'b', 'c'), ()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/infobloxopen/infoblox-client/blob/edeec62db1935784c728731b2ae7cf0fcc9bf84d/infoblox_client/objects.py#L156-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034253", "code": "def get_ordered_idx(id_type, id_list, meta_df):\n    \"\"\"\n    Gets index values corresponding to ids to subset and orders them.\n    Input:\n        - id_type (str): either \"id\", \"idx\" or None\n        - id_list (list): either a list of indexes or id names\n    Output:\n        - a sorted list of indexes to subset a dimension by\n    \"\"\"\n    if meta_df is not None:\n        if id_type is None:\n            id_list = range(0, len(list(meta_df.index)))\n        elif id_type == \"id\":\n            lookup = {x: i for (i,x) in enumerate(meta_df.index)}\n            id_list = [lookup[str(i)] for i in id_list]\n        return sorted(id_list)\n    else:\n        return None", "entry_point": "get_ordered_idx", "input": "[5, 3, 1, 4], [[1, 2], [3], []], ['a', 'b', 'c']", "output": "[[], [1, 2], [3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cmap/cmapPy/blob/59d833b64fd2c3a494cdf67fe1eb11fc8008bf76/cmapPy/pandasGEXpress/parse_gctx.py#L219-L236", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034254", "code": "def sizeof_fmt(num, suffix='B'):\n    \"\"\"\n    Adapted from https://stackoverflow.com/a/1094933\n    Re: precision - display enough decimals to show progress on a slow (<5 MB/s) Internet connection\n    \"\"\"\n    precision = {'': 0, 'Ki': 0, 'Mi': 0, 'Gi': 3, 'Ti': 6, 'Pi': 9, 'Ei': 12, 'Zi': 15}\n\n    for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:\n        if abs(num) < 1024.0:\n            format_string = \"{number:.%df} {unit}{suffix}\" % precision[unit]\n            return format_string.format(number=num, unit=unit, suffix=suffix)\n        num /= 1024.0\n    return \"%.18f %s%s\" % (num, 'Yi', suffix)", "entry_point": "sizeof_fmt", "input": "5, 'Hello World'", "output": "'5 Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HumanCellAtlas/dcp-cli/blob/cc70817bc4e50944c709eaae160de0bf7a19f0f3/hca/upload/lib/s3_agent.py#L16-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034255", "code": "def format_uptime(uptime_in_seconds):\n    \"\"\"Format number of seconds into human-readable string.\n    :param uptime_in_seconds: The server uptime in seconds.\n    :returns: A human-readable string representing the uptime.\n    >>> uptime = format_uptime('56892')\n    >>> print(uptime)\n    15 hours 48 min 12 sec\n    \"\"\"\n\n    m, s = divmod(int(uptime_in_seconds), 60)\n    h, m = divmod(m, 60)\n    d, h = divmod(h, 24)\n\n    uptime_values = []\n\n    for value, unit in ((d, 'days'), (h, 'hours'), (m, 'min'), (s, 'sec')):\n        if value == 0 and not uptime_values:\n            # Don't include a value/unit if the unit isn't applicable to\n            # the uptime. E.g. don't do 0 days 0 hours 1 min 30 sec.\n            continue\n        elif value == 1 and unit.endswith('s'):\n            # Remove the \"s\" if the unit is singular.\n            unit = unit[:-1]\n        uptime_values.append('{0} {1}'.format(value, unit))\n\n    uptime = ' '.join(uptime_values)\n    return uptime", "entry_point": "format_uptime", "input": "2", "output": "'2 sec'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dbcli/athenacli/blob/bcab59e4953145866430083e902ed4d042d4ebba/athenacli/packages/special/utils.py#L20-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034256", "code": "def is_mutating(status):\n    \"\"\"Determines if the statement is mutating based on the status.\"\"\"\n    if not status:\n        return False\n\n    mutating = set(['insert', 'update', 'delete', 'alter', 'create', 'drop',\n                    'replace', 'truncate', 'load'])\n    return status.split(None, 1)[0].lower() in mutating", "entry_point": "is_mutating", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dbcli/athenacli/blob/bcab59e4953145866430083e902ed4d042d4ebba/athenacli/main.py#L625-L632", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034257", "code": "def check_event_coverage(patterns, event_list):\n    \"\"\"Calculate the ratio of patterns that were extracted.\"\"\"\n    proportions = []\n    for pattern_list in patterns:\n        proportion = 0\n        for pattern in pattern_list:\n            for node in pattern.nodes():\n                if node in event_list:\n                    proportion += 1.0 / len(pattern_list)\n                    break\n        proportions.append(proportion)\n    return proportions", "entry_point": "check_event_coverage", "input": "set(), 1", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/sources/trips/analyze_ekbs.py#L137-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034258", "code": "def all_agents(stmts):\n    \"\"\"Return a list of all of the agents from a list of statements.\n\n    Only agents that are not None and have a TEXT entry are returned.\n\n    Parameters\n    ----------\n    stmts : list of :py:class:`indra.statements.Statement`\n\n    Returns\n    -------\n    agents : list of :py:class:`indra.statements.Agent`\n        List of agents that appear in the input list of indra statements.\n    \"\"\"\n    agents = []\n    for stmt in stmts:\n        for agent in stmt.agent_list():\n            # Agents don't always have a TEXT db_refs entry (for instance\n            # in the case of Statements from databases) so we check for this.\n            if agent is not None and agent.db_refs.get('TEXT') is not None:\n                agents.append(agent)\n    return agents", "entry_point": "all_agents", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/preassembler/grounding_mapper.py#L426-L447", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034259", "code": "def get_sentences_for_agent(text, stmts, max_sentences=None):\n    \"\"\"Returns evidence sentences with a given agent text from a list of statements\n\n    Parameters\n    ----------\n    text : str\n        An agent text\n\n    stmts : list of :py:class:`indra.statements.Statement`\n        INDRA Statements to search in for evidence statements.\n\n    max_sentences : Optional[int/None]\n        Cap on the number of evidence sentences to return. Default: None\n\n    Returns\n    -------\n    sentences : list of str\n        Evidence sentences from the list of statements containing\n        the given agent text.\n    \"\"\"\n    sentences = []\n    for stmt in stmts:\n        for agent in stmt.agent_list():\n            if agent is not None and agent.db_refs.get('TEXT') == text:\n                sentences.append((stmt.evidence[0].pmid,\n                                  stmt.evidence[0].text))\n                if max_sentences is not None and \\\n                   len(sentences) >= max_sentences:\n                    return sentences\n    return sentences", "entry_point": "get_sentences_for_agent", "input": "{1, 2, 3}, {}, False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/preassembler/grounding_mapper.py#L467-L496", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034260", "code": "def get_agents_with_name(name, stmts):\n    \"\"\"Return all agents within a list of statements with a particular name.\"\"\"\n    return [ag for stmt in stmts for ag in stmt.agent_list()\n            if ag is not None and ag.name == name]", "entry_point": "get_agents_with_name", "input": "'  padded  ', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/preassembler/grounding_mapper.py#L586-L589", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034261", "code": "def shorter_name(key):\n    \"\"\"Return a shorter name for an id.\n\n    Does this by only taking the last part of the URI,\n    after the last / and the last #. Also replaces - and . with _.\n\n    Parameters\n    ----------\n    key: str\n        Some URI\n\n    Returns\n    -------\n    key_short: str\n        A shortened, but more ambiguous, identifier\n    \"\"\"\n    key_short = key\n    for sep in ['#', '/']:\n        ind = key_short.rfind(sep)\n        if ind is not None:\n            key_short = key_short[ind+1:]\n        else:\n            key_short = key_short\n    return key_short.replace('-', '_').replace('.', '_')", "entry_point": "shorter_name", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/sources/hume/visualize_causal.py#L28-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034262", "code": "def get_attributes(aspect, id):\n    \"\"\"Return the attributes pointing to a given ID in a given aspect.\"\"\"\n    attributes = {}\n    for entry in aspect:\n        if entry['po'] == id:\n            attributes[entry['n']] = entry['v']\n    return attributes", "entry_point": "get_attributes", "input": "[], 'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/assemblers/cx/hub_layout.py#L70-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034263", "code": "def get_negation(event):\n        \"\"\"Return negation attached to an event.\n\n        Example: \"states\": [{\"@type\": \"State\", \"type\": \"NEGATION\",\n                             \"text\": \"n't\"}]\n        \"\"\"\n        states = event.get('states', [])\n        if not states:\n            return []\n        negs = [state for state in states\n                if state.get('type') == 'NEGATION']\n        neg_texts = [neg['text'] for neg in negs]\n        return neg_texts", "entry_point": "get_negation", "input": "{'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/sources/eidos/processor.py#L184-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034264", "code": "def get_hedging(event):\n        \"\"\"Return hedging markers attached to an event.\n\n        Example: \"states\": [{\"@type\": \"State\", \"type\": \"HEDGE\",\n                             \"text\": \"could\"}\n        \"\"\"\n        states = event.get('states', [])\n        if not states:\n            return []\n        hedgings = [state for state in states\n                    if state.get('type') == 'HEDGE']\n        hedging_texts = [hedging['text'] for hedging in hedgings]\n        return hedging_texts", "entry_point": "get_hedging", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/sources/eidos/processor.py#L199-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034265", "code": "def align_statements(stmts1, stmts2, keyfun=None):\n    \"\"\"Return alignment of two lists of statements by key.\n\n    Parameters\n    ----------\n    stmts1 : list[indra.statements.Statement]\n        A list of INDRA Statements to align\n    stmts2 : list[indra.statements.Statement]\n        A list of INDRA Statements to align\n    keyfun : Optional[function]\n        A function that takes a Statement as an argument\n        and returns a key to align by. If not given,\n        the default key function is a tuble of the names\n        of the Agents in the Statement.\n\n    Return\n    ------\n    matches : list(tuple)\n        A list of tuples where each tuple has two elements,\n        the first corresponding to an element of the stmts1\n        list and the second corresponding to an element\n        of the stmts2 list. If a given element is not matched,\n        its corresponding pair in the tuple is None.\n    \"\"\"\n    def name_keyfun(stmt):\n        return tuple(a.name if a is not None else None for\n                     a in stmt.agent_list())\n    if not keyfun:\n        keyfun = name_keyfun\n    matches = []\n    keys1 = [keyfun(s) for s in stmts1]\n    keys2 = [keyfun(s) for s in stmts2]\n    for stmt, key in zip(stmts1, keys1):\n        try:\n            match_idx = keys2.index(key)\n            match_stmt = stmts2[match_idx]\n            matches.append((stmt, match_stmt))\n        except ValueError:\n            matches.append((stmt, None))\n    for stmt, key in zip(stmts2, keys2):\n        try:\n            match_idx = keys1.index(key)\n        except ValueError:\n            matches.append((None, stmt))\n    return matches", "entry_point": "align_statements", "input": "[], [], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/tools/assemble_corpus.py#L1816-L1860", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034266", "code": "def _join_list(lst, oxford=False):\n    \"\"\"Join a list of words in a gramatically correct way.\"\"\"\n    if len(lst) > 2:\n        s = ', '.join(lst[:-1])\n        if oxford:\n            s += ','\n        s += ' and ' + lst[-1]\n    elif len(lst) == 2:\n        s = lst[0] + ' and ' + lst[1]\n    elif len(lst) == 1:\n        s = lst[0]\n    else:\n        s = ''\n    return s", "entry_point": "_join_list", "input": "[], ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/assemblers/english/assembler.py#L184-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034267", "code": "def _make_sentence(txt):\n    \"\"\"Make a sentence from a piece of text.\"\"\"\n    #Make sure first letter is capitalized\n    txt = txt.strip(' ')\n    txt = txt[0].upper() + txt[1:] + '.'\n    return txt", "entry_point": "_make_sentence", "input": "'Hello World'", "output": "'Hello World.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/assemblers/english/assembler.py#L367-L372", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034268", "code": "def normalize_medscan_name(name):\n    \"\"\"Removes the \"complex\" and \"complex complex\" suffixes from a medscan\n    agent name so that it better corresponds with the grounding map.\n\n    Parameters\n    ----------\n    name: str\n        The Medscan agent name\n\n    Returns\n    -------\n    norm_name: str\n        The Medscan agent name with the \"complex\" and \"complex complex\"\n        suffixes removed.\n    \"\"\"\n    suffix = ' complex'\n\n    for i in range(2):\n        if name.endswith(suffix):\n            name = name[:-len(suffix)]\n    return name", "entry_point": "normalize_medscan_name", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/sources/medscan/processor.py#L893-L913", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034269", "code": "def _is_autonomous(indep, exprs):\n    \"\"\" Whether the expressions for the dependent variables are autonomous.\n\n    Note that the system may still behave as an autonomous system on the interface\n    of :meth:`integrate` due to use of pre-/post-processors.\n    \"\"\"\n    if indep is None:\n        return True\n    for expr in exprs:\n        try:\n            in_there = indep in expr.free_symbols\n        except:\n            in_there = expr.has(indep)\n        if in_there:\n            return False\n    return True", "entry_point": "_is_autonomous", "input": "['apple', 'banana', 'cherry'], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bjodah/pyodesys/blob/0034a6165b550d8d9808baef58678dca5a493ab7/pyodesys/symbolic.py#L81-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034270", "code": "def _escape_regexp(s):\n    \"\"\"escape characters with specific regexp use\"\"\"\n    return (\n        str(s)\n        .replace('|', '\\\\|')\n        .replace('.', '\\.')  # `.` has to be replaced before `*`\n        .replace('*', '.*')\n        .replace('+', '\\+')\n        .replace('(', '\\(')\n        .replace(')', '\\)')\n        .replace('$', '\\\\$')\n    )", "entry_point": "_escape_regexp", "input": "[5, 3, 1, 4]", "output": "'[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IAMconsortium/pyam/blob/4077929ca6e7be63a0e3ecf882c5f1da97b287bf/pyam/utils.py#L332-L343", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034271", "code": "def edgelist_to_adjacency(edgelist):\n    \"\"\"Converts an iterator of edges to an adjacency dict.\n\n    Args:\n        edgelist (iterable):\n            An iterator over 2-tuples where each 2-tuple is an edge.\n\n    Returns:\n        dict: The adjacency dict. A dict of the form {v: Nv, ...} where v is a node in a graph and\n        Nv is the neighbors of v as an set.\n\n    \"\"\"\n    adjacency = dict()\n    for u, v in edgelist:\n        if u in adjacency:\n            adjacency[u].add(v)\n        else:\n            adjacency[u] = {v}\n        if v in adjacency:\n            adjacency[v].add(u)\n        else:\n            adjacency[v] = {u}\n    return adjacency", "entry_point": "edgelist_to_adjacency", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwavesystems/dwave-system/blob/86a1698f15ccd8b0ece0ed868ee49292d3f67f5b/dwave/embedding/utils.py#L219-L241", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034272", "code": "def _adjacency_to_edges(adjacency):\n    \"\"\"determine from an adjacency the list of edges\n    if (u, v) in edges, then (v, u) should not be\"\"\"\n    edges = set()\n    for u in adjacency:\n        for v in adjacency[u]:\n            try:\n                edge = (u, v) if u <= v else (v, u)\n            except TypeError:\n                # Py3 does not allow sorting of unlike types\n                if (v, u) in edges:\n                    continue\n                edge = (u, v)\n\n            edges.add(edge)\n    return edges", "entry_point": "_adjacency_to_edges", "input": "''", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwavesystems/dwave-system/blob/86a1698f15ccd8b0ece0ed868ee49292d3f67f5b/dwave/system/composites/embedding.py#L414-L429", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034273", "code": "def build_info_string(info):\n    \"\"\"\n    Build a new vcf INFO string based on the information in the info_dict.\n    \n    The info is a dictionary with vcf info keys as keys and lists of vcf values\n    as values. If there is no value False is value in info\n    \n    Args:\n        info (dict): A dictionary with information from the vcf file\n    \n    Returns:\n        String: A string that is on the proper vcf format for the INFO column\n    \n    \"\"\"\n    info_list = []\n    \n    for annotation in info:\n        \n        if info[annotation]:\n            info_list.append('='.join([annotation, ','.join(info[annotation])]))\n        else:\n            info_list.append(annotation)\n    \n    return ';'.join(info_list)", "entry_point": "build_info_string", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/vcf_parser/blob/8e2b6724e31995e0d43af501f25974310c6b843b/vcf_parser/utils/build_info.py#L10-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034274", "code": "def addevensubodd(operator, operand):\n    \"\"\"Add even numbers, subtract odd ones. See http://1w6.org/w6 \"\"\"\n    try:\n        for i, x in enumerate(operand):\n            if x % 2:\n                operand[i] = -x\n        return operand\n    except TypeError:\n        if operand % 2:\n            return -operand\n        return operand", "entry_point": "addevensubodd", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "[1, 0, -1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/utilities.py#L60-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034275", "code": "def AD(val):\n    \"\"\"Affiliation\n    Undoing what the parser does then splitting at the semicolons and dropping newlines extra fitlering is required beacuse some AD's end with a semicolon\"\"\"\n    retDict = {}\n    for v in val:\n        split = v.split(' : ')\n        retDict[split[0]] = [s for s in' : '.join(split[1:]).replace('\\n', '').split(';') if s != '']\n    return retDict", "entry_point": "AD", "input": "['a', 'b', 'c']", "output": "{'a': [], 'b': [], 'c': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/medline/tagProcessing/tagFunctions.py#L218-L225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034276", "code": "def AUID(val):\n    \"\"\"AuthorIdentifier\n    one line only just need to undo the parser's effects\"\"\"\n    retDict = {}\n    for v in val:\n        split = v.split(' : ')\n        retDict[split[0]] = ' : '.join(split[1:])\n    return retDict", "entry_point": "AUID", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/medline/tagProcessing/tagFunctions.py#L322-L329", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034277", "code": "def makeBiDirectional(d):\n    \"\"\"\n    Helper for generating tagNameConverter\n    Makes dict that maps from key to value and back\n    \"\"\"\n    dTmp = d.copy()\n    for k in d:\n        dTmp[d[k]] = k\n    return dTmp", "entry_point": "makeBiDirectional", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/tagProcessing/helpFuncs.py#L27-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034278", "code": "def reverseDict(d):\n    \"\"\"\n    Helper for generating fullToTag\n    Makes dict of value to key\n    \"\"\"\n    retD = {}\n    for k in d:\n        retD[d[k]] = k\n    return retD", "entry_point": "reverseDict", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/tagProcessing/helpFuncs.py#L37-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034279", "code": "def filterNonJournals(citesLst, invert = False):\n    \"\"\"Removes the `Citations` from _citesLst_ that are not journals\n\n    # Parameters\n\n    _citesLst_ : `list [Citation]`\n\n    > A list of citations to be filtered\n\n    _invert_ : `optional [bool]`\n\n    > Default `False`, if `True` non-journals will be kept instead of journals\n\n    # Returns\n\n    `list [Citation]`\n\n    > A filtered list of Citations from _citesLst_\n    \"\"\"\n\n    retCites = []\n    for c in citesLst:\n        if c.isJournal():\n            if not invert:\n                retCites.append(c)\n        elif invert:\n            retCites.append(c)\n    return retCites", "entry_point": "filterNonJournals", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L364-L391", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034280", "code": "def _bibFormatter(s, maxLength):\n    \"\"\"Formats a string, list or number to make it good for a bib file by:\n        * if too long splits up the string correctly\n        * tries to use the best quoting characters\n        * expands lists into ' and ' seperated values, as per spec for authors field\n    Note, this does not escape characters. LaTeX may have issues with the output\n    Max length splitting derived from https://www.cs.arizona.edu/~collberg/Teaching/07.231/BibTeX/bibtex.html\n    \"\"\"\n    if isinstance(s, list):\n        s = ' and '.join((str(v) for v in s))\n    elif not isinstance(s, str):\n        s = str(s)\n    if len(s) > maxLength:\n        s = s.replace('\"', '')\n        s = [s[i * maxLength: (i + 1) * maxLength] for i in range(len(s) // maxLength )]\n        s = '\"{}\"'.format('\" # \"'.join(s))\n    elif '\"' not in s:\n        s = '\"{}\"'.format(s)\n    else:\n        s = s.replace('{', '\\\\{').replace('}', '\\\\}')\n        s = '{{{}}}'.format(s)\n    return s", "entry_point": "_bibFormatter", "input": "['apple', 'banana', 'cherry'], 5", "output": "'\"apple\" # \" and \" # \"banan\" # \"a and\" # \" cher\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkRecord.py#L769-L790", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034281", "code": "def authAddress(val):\n    \"\"\"\n    # The C1 Tag\n\n    extracts the address of the authors as given by WOS. **Warning** the mapping of author to address is not very good and is given in multiple ways.\n\n    # Parameters\n\n    _val_: `list[str]`\n\n    > The raw data from a WOS file\n\n    # Returns\n\n    `list[str]`\n\n    > A list of addresses\n\n    \"\"\"\n    ret = []\n    for a in val:\n        if a[0] == '[':\n            ret.append('] '.join(a.split('] ')[1:]))\n        else:\n            ret.append(a)\n    return ret", "entry_point": "authAddress", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/tagProcessing/tagFunctions.py#L394-L419", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034282", "code": "def guess_type(s):\n    \"\"\" attempt to convert string value into numeric type \"\"\"\n    sc = s.replace(',', '') # remove comma from potential numbers\n\n    try:\n        return int(sc)\n    except ValueError:\n        pass\n\n    try:\n        return float(sc)\n    except ValueError:\n        pass\n\n    return s", "entry_point": "guess_type", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcicen/wikitables/blob/055cbabaa60762edbab78bf6a76ba19875f328f7/wikitables/util.py#L15-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034283", "code": "def add_colons(s):\n    \"\"\"Add colons after every second digit.\n\n    This function is used in functions to prettify serials.\n\n    >>> add_colons('teststring')\n    'te:st:st:ri:ng'\n    \"\"\"\n    return ':'.join([s[i:i + 2] for i in range(0, len(s), 2)])", "entry_point": "add_colons", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mathiasertl/django-ca/blob/976d7ea05276320f20daed2a6d59c8f5660fe976/ca/django_ca/utils.py#L200-L208", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034284", "code": "def is_requirement(line):\n    \"\"\"\n    Return True if the requirement line is a package requirement;\n    that is, it is not blank, a comment, a URL, or an included file.\n    \"\"\"\n    return not (\n        line == '' or\n        line.startswith('-r') or\n        line.startswith('#') or\n        line.startswith('-e') or\n        line.startswith('git+')\n    )", "entry_point": "is_requirement", "input": "'abc'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edx/xblock-utils/blob/2960666907d3eea1ed312fa87d811e78cd043702/setup.py#L54-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034285", "code": "def extract_submittable_jobs(waiting):\n    \"\"\"Obtain a list of jobs that are able to be submitted from the passed\n    list of pending jobs\n\n    - waiting           List of Job objects\n    \"\"\"\n    submittable = set()            # Holds jobs that are able to be submitted\n    # Loop over each job, and check all the subjobs in that job's dependency\n    # list.  If there are any, and all of these have been submitted, then\n    # append the job to the list of submittable jobs.\n    for job in waiting:\n        unsatisfied = sum([(subjob.submitted is False) for subjob in\n                           job.dependencies])\n        if unsatisfied == 0:\n            submittable.add(job)\n    return list(submittable)", "entry_point": "extract_submittable_jobs", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/widdowquinn/pyani/blob/2b24ec971401e04024bba896e4011984fe3f53f0/pyani/run_sge.py#L163-L178", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034286", "code": "def flat(l):\n    \"\"\"\nReturns the flattened version of a '2D' list.  List-correlate to the a.flat()\nmethod of NumPy arrays.\n\nUsage:    flat(l)\n\"\"\"\n    newl = []\n    for i in range(len(l)):\n        for j in range(len(l[i])):\n            newl.append(l[i][j])\n    return newl", "entry_point": "flat", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/pstat.py#L326-L337", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034287", "code": "def unique (inlist):\n    \"\"\"\nReturns all unique items in the passed list.  If the a list-of-lists\nis passed, unique LISTS are found (i.e., items in the first dimension are\ncompared).\n\nUsage:   unique (inlist)\nReturns: the unique elements (or rows) in inlist\n\"\"\"\n    uniques = []\n    for item in inlist:\n        if item not in uniques:\n            uniques.append(item)\n    return uniques", "entry_point": "unique", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/pstat.py#L661-L674", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034288", "code": "def duplicates(inlist):\n    \"\"\"\nReturns duplicate items in the FIRST dimension of the passed list.\n\nUsage:   duplicates (inlist)\n\"\"\"\n    dups = []\n    for i in range(len(inlist)):\n        if inlist[i] in inlist[i+1:]:\n            dups.append(inlist[i])\n    return dups", "entry_point": "duplicates", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/pstat.py#L676-L686", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034289", "code": "def nonrepeats(inlist):\n    \"\"\"\nReturns items that are NOT duplicated in the first dim of the passed list.\n\nUsage:   nonrepeats (inlist)\n\"\"\"\n    nonrepeats = []\n    for i in range(len(inlist)):\n        if inlist.count(inlist[i]) == 1:\n            nonrepeats.append(inlist[i])\n    return nonrepeats", "entry_point": "nonrepeats", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/pstat.py#L689-L699", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034290", "code": "def lgeometricmean (inlist):\n    \"\"\"\nCalculates the geometric mean of the values in the passed list.\nThat is:  n-th root of (x1 * x2 * ... * xn).  Assumes a '1D' list.\n\nUsage:   lgeometricmean(inlist)\n\"\"\"\n    mult = 1.0\n    one_over_n = 1.0/len(inlist)\n    for item in inlist:\n        mult = mult * pow(item,one_over_n)\n    return mult", "entry_point": "lgeometricmean", "input": "[-1, 0, 1, 2]", "output": "0j", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/stats.py#L271-L282", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034291", "code": "def lharmonicmean (inlist):\n    \"\"\"\nCalculates the harmonic mean of the values in the passed list.\nThat is:  n / (1/x1 + 1/x2 + ... + 1/xn).  Assumes a '1D' list.\n\nUsage:   lharmonicmean(inlist)\n\"\"\"\n    sum = 0\n    for item in inlist:\n        sum = sum + 1.0/item\n    return len(inlist) / sum", "entry_point": "lharmonicmean", "input": "[5, 3, 1, 4]", "output": "2.2429906542056077", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/stats.py#L285-L295", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034292", "code": "def lmean (inlist):\n    \"\"\"\nReturns the arithematic mean of the values in the passed list.\nAssumes a '1D' list, but will function on the 1st dim of an array(!).\n\nUsage:   lmean(inlist)\n\"\"\"\n    sum = 0\n    for item in inlist:\n        sum = sum + item\n    return sum/float(len(inlist))", "entry_point": "lmean", "input": "[1, 2, 3]", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/stats.py#L298-L308", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034293", "code": "def lincr(l,cap):        # to increment a list up to a max-list of 'cap'\n    \"\"\"\nSimulate a counting system from an n-dimensional list.\n\nUsage:   lincr(l,cap)   l=list to increment, cap=max values for each list pos'n\nReturns: next set of values for list l, OR -1 (if overflow)\n\"\"\"\n    l[0] = l[0] + 1     # e.g., [0,0,0] --> [2,4,3] (=cap)\n    for i in range(len(l)):\n        if l[i] > cap[i] and i < len(l)-1: # if carryover AND not done\n            l[i] = 0\n            l[i+1] = l[i+1] + 1\n        elif l[i] > cap[i] and i == len(l)-1: # overflow past last column, must be finished\n            l = -1\n    return l", "entry_point": "lincr", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[0, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/stats.py#L1614-L1628", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034294", "code": "def lss(inlist):\n    \"\"\"\nSquares each value in the passed list, adds up these squares and\nreturns the result.\n\nUsage:   lss(inlist)\n\"\"\"\n    ss = 0\n    for item in inlist:\n        ss = ss + item*item\n    return ss", "entry_point": "lss", "input": "[-1, 0, 1, 2]", "output": "6", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/stats.py#L1656-L1666", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034295", "code": "def lsumdiffsquared(x,y):\n    \"\"\"\nTakes pairwise differences of the values in lists x and y, squares\nthese differences, and returns the sum of these squares.\n\nUsage:   lsumdiffsquared(x,y)\nReturns: sum[(x[i]-y[i])**2]\n\"\"\"\n    sds = 0\n    for i in range(len(x)):\n        sds = sds + (x[i]-y[i])**2\n    return sds", "entry_point": "lsumdiffsquared", "input": "[], ['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx_extras/stats.py#L1685-L1696", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034296", "code": "def parse_attributes( fields ):\n    \"\"\"Parse list of key=value strings into a dict\"\"\"\n    attributes = {}\n    for field in fields:\n        pair = field.split( '=' )\n        attributes[ pair[0] ] = pair[1]\n    return attributes", "entry_point": "parse_attributes", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/lib/bx/align/maf.py#L212-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034297", "code": "def guess_fill_char( left_comp, right_comp ):\n    \"\"\"\n    For the case where there is no annotated synteny we will try to guess it\n    \"\"\"\n    # No left component, obiously new\n    return \"*\"\n    # First check that the blocks have the same src (not just species) and \n    # orientation\n    if ( left_comp.src == right_comp.src and left_comp.strand != right_comp.strand ): \n        # Are they completely contiguous? Easy to call that a gap\n        if left_comp.end == right_comp.start: \n            return \"-\"\n        # TODO: should be able to make some guesses about short insertions\n        # here\n    # All other cases we have no clue about\n    return \"*\"", "entry_point": "guess_fill_char", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "'*'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/scripts/maf_tile_2bit.py#L92-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034298", "code": "def remove_all_gap_columns( texts ):\n    \"\"\"\n    Remove any columns containing only gaps from alignment texts\n    \"\"\"\n    seqs = [ list( t ) for t in texts ]\n    i = 0\n    text_size = len( texts[0] )\n    while i < text_size:\n        all_gap = True\n        for seq in seqs:\n            if seq[i] not in ( '-', '#', '*', '=', 'X', '@' ): \n                all_gap = False\n        if all_gap:\n            for seq in seqs: \n                del seq[i]\n            text_size -= 1\n        else:\n            i += 1\n    return [ ''.join( s ) for s in seqs ]", "entry_point": "remove_all_gap_columns", "input": "'abc'", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/scripts/maf_tile_2bit.py#L109-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034299", "code": "def read_len( f ):\n    \"\"\"Read a 'LEN' file and return a mapping from chromosome to length\"\"\"\n    mapping = dict()\n    for line in f:\n        fields = line.split()\n        mapping[ fields[0] ] = int( fields[1] )\n    return mapping", "entry_point": "read_len", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bxlab/bx-python/blob/09cb725284803df90a468d910f2274628d8647de/scripts/bed_complement.py#L20-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034300", "code": "def make_vol_opt(hostdir, contdir, options=None):\n    '''Generate a docker volume option'''\n    vol = '--volume={}:{}'.format(hostdir, contdir)\n    if options != None:\n        if isinstance(options, str):\n            options = (options,)\n        vol += ':' + ','.join(options)\n    return vol", "entry_point": "make_vol_opt", "input": "[[1, 2], [3], []], [[1, 2], [3], []], {}", "output": "'--volume=[[1, 2], [3], []]:[[1, 2], [3], []]:'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JonathonReinhart/scuba/blob/0244c81ec482d3c60202028bc075621447bc3ad1/scuba/dockerutil.py#L88-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034301", "code": "def _nice_fieldnames(all_columns, index_columns):\n    \"Indexes on the left, other fields in alphabetical order on the right.\"\n    non_index_columns = set(all_columns).difference(index_columns)\n    return index_columns + sorted(non_index_columns)", "entry_point": "_nice_fieldnames", "input": "[-1, 0, 1, 2], ['a', 'b', 'c']", "output": "['a', 'b', 'c', -1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/larsyencken/csvdiff/blob/163dd9da676a8e5f926a935803726340261f03ae/csvdiff/__init__.py#L81-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034302", "code": "def get_required_kwonly_args(argspecs):\n    \"\"\"Determines whether given argspecs implies required keywords-only args\n    and returns them as a list. Returns empty list if no such args exist.\n    \"\"\"\n    try:\n        kwonly = argspecs.kwonlyargs\n        if argspecs.kwonlydefaults is None:\n            return kwonly\n        res = []\n        for name in kwonly:\n            if not name in argspecs.kwonlydefaults:\n                res.append(name)\n        return res\n    except AttributeError:\n        return []", "entry_point": "get_required_kwonly_args", "input": "[[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Stewori/pytypes/blob/b814d38709e84c0e0825caf8b721c20eb5a8ab3b/pytypes/util.py#L111-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034303", "code": "def is_int(value):\n    \"\"\"Return `True` if ``value`` is an integer.\"\"\"\n    if isinstance(value, bool):\n        return False\n    try:\n        int(value)\n        return True\n    except (ValueError, TypeError):\n        return False", "entry_point": "is_int", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCA/odoorpc/blob/d90aa0b2bc4fafbab8bd8f50d50e3fb0b9ba91f0/odoorpc/fields.py#L32-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034304", "code": "def odoo_tuple_in(iterable):\n    \"\"\"Return `True` if `iterable` contains an expected tuple like\n    ``(6, 0, IDS)`` (and so on).\n\n        >>> odoo_tuple_in([0, 1, 2])        # Simple list\n        False\n        >>> odoo_tuple_in([(6, 0, [42])])   # List of tuples\n        True\n        >>> odoo_tuple_in([[1, 42]])        # List of lists\n        True\n    \"\"\"\n    if not iterable:\n        return False\n    def is_odoo_tuple(elt):\n        \"\"\"Return `True` if `elt` is a Odoo special tuple.\"\"\"\n        try:\n            return elt[:1][0] in [1, 2, 3, 4, 5] \\\n                    or elt[:2] in [(6, 0), [6, 0], (0, 0), [0, 0]]\n        except (TypeError, IndexError):\n            return False\n    return any(is_odoo_tuple(elt) for elt in iterable)", "entry_point": "odoo_tuple_in", "input": "[[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCA/odoorpc/blob/d90aa0b2bc4fafbab8bd8f50d50e3fb0b9ba91f0/odoorpc/fields.py#L55-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034305", "code": "def reverse_taskname(name: str) -> str:\n  \"\"\"\n  Reverses components in the name of task. Reversed convention is used for filenames since\n  it groups log/scratch files of related tasks together\n\n  0.somejob.somerun -> somerun.somejob.0\n  0.somejob -> somejob.0\n  somename -> somename\n\n  Args:\n    name: name of task\n\n  \"\"\"\n  components = name.split('.')\n  assert len(components) <= 3\n  return '.'.join(components[::-1])", "entry_point": "reverse_taskname", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/diux-dev/ncluster/blob/2fd359621896717197b479c7174d06d80df1529b/ncluster/util.py#L112-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034306", "code": "def split_semicolon(line, maxsplit=None):\n    r\"\"\"Split a line on semicolons characters but not on the escaped semicolons\n\n    :param line: line to split\n    :type line: str\n    :param maxsplit: maximal number of split (if None, no limit)\n    :type maxsplit: None | int\n    :return: split line\n    :rtype: list\n\n    >>> split_semicolon('a,b;c;;g')\n    ['a,b', 'c', '', 'g']\n\n    >>> split_semicolon('a,b;c;;g', 2)\n    ['a,b', 'c', ';g']\n\n    >>> split_semicolon(r'a,b;c\\;;g', 2)\n    ['a,b', 'c;', 'g']\n    \"\"\"\n    # Split on ';' character\n    split_line = line.split(';')\n\n    split_line_size = len(split_line)\n\n    # if maxsplit is not specified, we set it to the number of part\n    if maxsplit is None or maxsplit < 0:\n        maxsplit = split_line_size\n\n    # Join parts  to the next one, if ends with a '\\'\n    # because we mustn't split if the semicolon is escaped\n    i = 0\n    while i < split_line_size - 1:\n\n        # for each part, check if its ends with a '\\'\n        ends = split_line[i].endswith('\\\\')\n\n        if ends:\n            # remove the last character '\\'\n            split_line[i] = split_line[i][:-1]\n\n        # append the next part to the current if it is not the last and the current\n        # ends with '\\' or if there is more than maxsplit parts\n        if (ends or i >= maxsplit) and i < split_line_size - 1:\n\n            split_line[i] = \";\".join([split_line[i], split_line[i + 1]])\n\n            # delete the next part\n            del split_line[i + 1]\n            split_line_size -= 1\n\n        # increase i only if we don't have append because after append the new\n        # string can end with '\\'\n        else:\n            i += 1\n\n    return split_line", "entry_point": "split_semicolon", "input": "'abc', 3.25", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L110-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034307", "code": "def format_t_into_dhms_format(timestamp):\n    \"\"\" Convert an amount of second into day, hour, min and sec\n\n    :param timestamp: seconds\n    :type timestamp: int\n    :return: 'Ad Bh Cm Ds'\n    :rtype: str\n\n    >>> format_t_into_dhms_format(456189)\n    '5d 6h 43m 9s'\n\n    >>> format_t_into_dhms_format(3600)\n    '0d 1h 0m 0s'\n\n    \"\"\"\n    mins, timestamp = divmod(timestamp, 60)\n    hour, mins = divmod(mins, 60)\n    day, hour = divmod(hour, 24)\n    return '%sd %sh %sm %ss' % (day, hour, mins, timestamp)", "entry_point": "format_t_into_dhms_format", "input": "False", "output": "'0d 0h 0m 0s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L230-L248", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034308", "code": "def to_split(val, split_on_comma=True):\n    \"\"\"Try to split a string with comma separator.\n    If val is already a list return it\n    If we don't have to split just return [val]\n    If split gives only [''] empty it\n\n    :param val: value to split\n    :type val:\n    :param split_on_comma:\n    :type split_on_comma: bool\n    :return: split value on comma\n    :rtype: list\n\n    >>> to_split('a,b,c')\n    ['a', 'b', 'c']\n\n    >>> to_split('a,b,c', False)\n    ['a,b,c']\n\n    >>> to_split(['a,b,c'])\n    ['a,b,c']\n\n    >>> to_split('')\n    []\n    \"\"\"\n    if isinstance(val, list):\n        return val\n    if not split_on_comma:\n        return [val]\n    val = val.split(',')\n    if val == ['']:\n        val = []\n    return val", "entry_point": "to_split", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L329-L361", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034309", "code": "def list_split(val, split_on_comma=True):\n    \"\"\"Try to split each member of a list with comma separator.\n    If we don't have to split just return val\n\n    :param val: value to split\n    :type val:\n    :param split_on_comma:\n    :type split_on_comma: bool\n    :return: list with members split on comma\n    :rtype: list\n\n    >>> list_split(['a,b,c'], False)\n    ['a,b,c']\n\n    >>> list_split(['a,b,c'])\n    ['a', 'b', 'c']\n\n    >>> list_split('')\n    []\n\n    \"\"\"\n    if not split_on_comma:\n        return val\n    new_val = []\n    for subval in val:\n        # This may happen when re-serializing\n        if isinstance(subval, list):\n            continue\n        new_val.extend(subval.split(','))\n    return new_val", "entry_point": "list_split", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L364-L393", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034310", "code": "def to_best_int_float(val):\n    \"\"\"Get best type for value between int and float\n\n    :param val: value\n    :type val:\n    :return: int(float(val)) if int(float(val)) == float(val), else float(val)\n    :rtype: int | float\n\n    >>> to_best_int_float(\"20.1\")\n    20.1\n\n    >>> to_best_int_float(\"20.0\")\n    20\n\n    >>> to_best_int_float(\"20\")\n    20\n    \"\"\"\n    integer = int(float(val))\n    flt = float(val)\n    # If the f is a .0 value,\n    # best match is int\n    if integer == flt:\n        return integer\n    return flt", "entry_point": "to_best_int_float", "input": "0.5", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L396-L419", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034311", "code": "def master_then_spare(data):\n    \"\"\"Return the provided satellites list sorted as:\n        - alive first,\n        - then spare\n        - then dead\n        satellites.\n\n    :param data: the SatelliteLink list\n    :type data: list\n    :return: sorted list\n    :rtype: list\n    \"\"\"\n    master = []\n    spare = []\n    for sdata in data:\n        if sdata.spare:\n            spare.append(sdata)\n        else:\n            master.append(sdata)\n    rdata = []\n    rdata.extend(master)\n    rdata.extend(spare)\n    return rdata", "entry_point": "master_then_spare", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L713-L735", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034312", "code": "def sort_by_number_values(x00, y00):  # pragma: no cover, looks like not used!\n    \"\"\"Compare x00, y00 base on number of values\n\n    :param x00: first elem to compare\n    :type x00: list\n    :param y00: second elem to compare\n    :type y00: list\n    :return: x00 > y00 (-1) if len(x00) > len(y00), x00 == y00 (0) if id equals, x00 < y00 (1) else\n    :rtype: int\n    \"\"\"\n    if len(x00) < len(y00):\n        return 1\n    if len(x00) > len(y00):\n        return -1\n    # So is equal\n    return 0", "entry_point": "sort_by_number_values", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L738-L753", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034313", "code": "def strip_and_uniq(tab):\n    \"\"\"Strip every element of a list and keep a list of ordered unique values\n\n    :param tab: list to strip\n    :type tab: list\n    :return: stripped list with unique values\n    :rtype: list\n    \"\"\"\n    _list = []\n    for elt in tab:\n        val = elt.strip()\n        if val and val not in _list:\n            _list.append(val)\n    return _list", "entry_point": "strip_and_uniq", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L777-L790", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034314", "code": "def _n_onset_midi(patterns):\n    \"\"\"Computes the number of onset_midi objects in a pattern\n\n    Parameters\n    ----------\n    patterns :\n        A list of patterns using the format returned by\n        :func:`mir_eval.io.load_patterns()`\n\n    Returns\n    -------\n    n_onsets : int\n        Number of onsets within the pattern.\n\n    \"\"\"\n    return len([o_m for pat in patterns for occ in pat for o_m in occ])", "entry_point": "_n_onset_midi", "input": "['a', 'b', 'c']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/craffel/mir_eval/blob/f41c8dafaea04b411252a516d1965af43c7d531b/mir_eval/pattern.py#L64-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034315", "code": "def _occurrence_intersection(occ_P, occ_Q):\n    \"\"\"Computes the intersection between two occurrences.\n\n    Parameters\n    ----------\n    occ_P : list of tuples\n        (onset, midi) pairs representing the reference occurrence.\n    occ_Q : list\n        second list of (onset, midi) tuples\n\n    Returns\n    -------\n    S : set\n        Set of the intersection between occ_P and occ_Q.\n\n    \"\"\"\n    set_P = set([tuple(onset_midi) for onset_midi in occ_P])\n    set_Q = set([tuple(onset_midi) for onset_midi in occ_Q])\n    return set_P & set_Q", "entry_point": "_occurrence_intersection", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "{(1, 2), (3,), ()}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/craffel/mir_eval/blob/f41c8dafaea04b411252a516d1965af43c7d531b/mir_eval/pattern.py#L115-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034316", "code": "def index_labels(labels, case_sensitive=False):\n    \"\"\"Convert a list of string identifiers into numerical indices.\n\n    Parameters\n    ----------\n    labels : list of strings, shape=(n,)\n        A list of annotations, e.g., segment or chord labels from an\n        annotation file.\n\n    case_sensitive : bool\n        Set to True to enable case-sensitive label indexing\n        (Default value = False)\n\n    Returns\n    -------\n    indices : list, shape=(n,)\n        Numerical representation of ``labels``\n    index_to_label : dict\n        Mapping to convert numerical indices back to labels.\n        ``labels[i] == index_to_label[indices[i]]``\n\n    \"\"\"\n\n    label_to_index = {}\n    index_to_label = {}\n\n    # If we're not case-sensitive,\n    if not case_sensitive:\n        labels = [str(s).lower() for s in labels]\n\n    # First, build the unique label mapping\n    for index, s in enumerate(sorted(set(labels))):\n        label_to_index[s] = index\n        index_to_label[index] = s\n\n    # Remap the labels to indices\n    indices = [label_to_index[s] for s in labels]\n\n    # Return the converted labels, and the inverse mapping\n    return indices, index_to_label", "entry_point": "index_labels", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "([0, 1, 2], {0: 'apple', 1: 'banana', 2: 'cherry'})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/craffel/mir_eval/blob/f41c8dafaea04b411252a516d1965af43c7d531b/mir_eval/util.py#L13-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034317", "code": "def generate_labels(items, prefix='__'):\n    \"\"\"Given an array of items (e.g. events, intervals), create a synthetic label\n    for each event of the form '(label prefix)(item number)'\n\n    Parameters\n    ----------\n    items : list-like\n        A list or array of events or intervals\n    prefix : str\n        This prefix will be prepended to all synthetically generated labels\n        (Default value = '__')\n\n    Returns\n    -------\n    labels : list of str\n        Synthetically generated labels\n\n    \"\"\"\n    return ['{}{}'.format(prefix, n) for n in range(len(items))]", "entry_point": "generate_labels", "input": "[], 'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/craffel/mir_eval/blob/f41c8dafaea04b411252a516d1965af43c7d531b/mir_eval/util.py#L55-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034318", "code": "def _bipartite_match(graph):\n    \"\"\"Find maximum cardinality matching of a bipartite graph (U,V,E).\n    The input format is a dictionary mapping members of U to a list\n    of their neighbors in V.\n\n    The output is a dict M mapping members of V to their matches in U.\n\n    Parameters\n    ----------\n    graph : dictionary : left-vertex -> list of right vertices\n        The input bipartite graph.  Each edge need only be specified once.\n\n    Returns\n    -------\n    matching : dictionary : right-vertex -> left vertex\n        A maximal bipartite matching.\n\n    \"\"\"\n    # Adapted from:\n    #\n    # Hopcroft-Karp bipartite max-cardinality matching and max independent set\n    # David Eppstein, UC Irvine, 27 Apr 2002\n\n    # initialize greedy matching (redundant, but faster than full search)\n    matching = {}\n    for u in graph:\n        for v in graph[u]:\n            if v not in matching:\n                matching[v] = u\n                break\n\n    while True:\n        # structure residual graph into layers\n        # pred[u] gives the neighbor in the previous layer for u in U\n        # preds[v] gives a list of neighbors in the previous layer for v in V\n        # unmatched gives a list of unmatched vertices in final layer of V,\n        # and is also used as a flag value for pred[u] when u is in the first\n        # layer\n        preds = {}\n        unmatched = []\n        pred = dict([(u, unmatched) for u in graph])\n        for v in matching:\n            del pred[matching[v]]\n        layer = list(pred)\n\n        # repeatedly extend layering structure by another pair of layers\n        while layer and not unmatched:\n            new_layer = {}\n            for u in layer:\n                for v in graph[u]:\n                    if v not in preds:\n                        new_layer.setdefault(v, []).append(u)\n            layer = []\n            for v in new_layer:\n                preds[v] = new_layer[v]\n                if v in matching:\n                    layer.append(matching[v])\n                    pred[matching[v]] = v\n                else:\n                    unmatched.append(v)\n\n        # did we finish layering without finding any alternating paths?\n        if not unmatched:\n            unlayered = {}\n            for u in graph:\n                for v in graph[u]:\n                    if v not in preds:\n                        unlayered[v] = None\n            return matching\n\n        def recurse(v):\n            \"\"\"Recursively search backward through layers to find alternating\n            paths.  recursion returns true if found path, false otherwise\n            \"\"\"\n            if v in preds:\n                L = preds[v]\n                del preds[v]\n                for u in L:\n                    if u in pred:\n                        pu = pred[u]\n                        del pred[u]\n                        if pu is unmatched or recurse(pu):\n                            matching[v] = u\n                            return True\n            return False\n\n        for v in unmatched:\n            recurse(v)", "entry_point": "_bipartite_match", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/craffel/mir_eval/blob/f41c8dafaea04b411252a516d1965af43c7d531b/mir_eval/util.py#L547-L634", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034319", "code": "def length(ext_id, ext_des, ext_src):\n        # type: (bytes, bytes, bytes) -> int\n        '''\n        Static method to return the length of the Rock Ridge Extensions Reference\n        record.\n\n        Parameters:\n         ext_id - The extension identifier to use.\n         ext_des - The extension descriptor to use.\n         ext_src - The extension specification source to use.\n        Returns:\n         The length of this record in bytes.\n        '''\n        return 8 + len(ext_id) + len(ext_des) + len(ext_src)", "entry_point": "length", "input": "['a', 'b', 'c'], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "18", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L640-L653", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034320", "code": "def length(time_flags):\n        # type: (int) -> int\n        '''\n        Static method to return the length of the Rock Ridge Time Stamp\n        record.\n\n        Parameters:\n         time_flags - Integer representing the flags to use.\n        Returns:\n         The length of this record in bytes.\n        '''\n        tf_each_size = 7\n        if time_flags & (1 << 7):\n            tf_each_size = 17\n        time_flags &= 0x7f\n        tf_num = 0\n        while time_flags:\n            time_flags &= time_flags - 1\n            tf_num += 1\n\n        return 5 + tf_each_size * tf_num", "entry_point": "length", "input": "True", "output": "12", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1645-L1665", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034321", "code": "def parse_services(config, services):\n    \"\"\"Parse configuration to return number of enabled service checks.\n\n    Arguments:\n        config (obj): A configparser object with the configuration of\n        anycast-healthchecker.\n        services (list): A list of section names which holds configuration\n        for each service check\n\n    Returns:\n        A number (int) of enabled service checks.\n\n    \"\"\"\n    enabled = 0\n    for service in services:\n        check_disabled = config.getboolean(service, 'check_disabled')\n        if not check_disabled:\n            enabled += 1\n\n    return enabled", "entry_point": "parse_services", "input": "{'x': [1, 2], 'y': []}, []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/unixsurfer/anycast_healthchecker/blob/3ab9c1d65d550eb30621ced2434252f61d1fdd33/contrib/nagios/check_anycast_healthchecker.py#L90-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034322", "code": "def key_exists_in_list_or_dict(key, lst_or_dct):\n    \"\"\"True if `lst_or_dct[key]` does not raise an Exception\"\"\"\n    if isinstance(lst_or_dct, dict) and key in lst_or_dct:\n        return True\n    elif isinstance(lst_or_dct, list):\n        min_i, max_i = 0, len(lst_or_dct)\n        if min_i <= key < max_i:\n            return True\n    return False", "entry_point": "key_exists_in_list_or_dict", "input": "7, ()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rndusr/torf/blob/df0363232daacd3f8c91aafddaa0623b8c28cbd2/torf/_utils.py#L139-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034323", "code": "def copy_params(get_or_post_params, ignore=None):\n    \"\"\"\n        copy a :class:`django.http.QueryDict` in a :obj:`dict` ignoring keys in the set ``ignore``\n\n        :param django.http.QueryDict get_or_post_params: A GET or POST\n            :class:`QueryDict<django.http.QueryDict>`\n        :param set ignore: An optinal set of keys to ignore during the copy\n        :return: A copy of get_or_post_params\n        :rtype: dict\n    \"\"\"\n    if ignore is None:\n        ignore = set()\n    params = {}\n    for key in get_or_post_params:\n        if key not in ignore and get_or_post_params[key]:\n            params[key] = get_or_post_params[key]\n    return params", "entry_point": "copy_params", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nitmir/django-cas-server/blob/d106181b94c444f1946269da5c20f6c904840ad3/cas_server/utils.py#L178-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034324", "code": "def get_tuple(nuplet, index, default=None):\n    \"\"\"\n        :param tuple nuplet: A tuple\n        :param int index: An index\n        :param default: An optional default value\n        :return: ``nuplet[index]`` if defined, else ``default`` (possibly ``None``)\n    \"\"\"\n    if nuplet is None:\n        return default\n    try:\n        return nuplet[index]\n    except IndexError:\n        return default", "entry_point": "get_tuple", "input": "[], 5, ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nitmir/django-cas-server/blob/d106181b94c444f1946269da5c20f6c904840ad3/cas_server/utils.py#L378-L390", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034325", "code": "def form_option(str_opt):\n    '''generate option name based suffix for URL\n\n    :param str_opt: opt name\n    :type str_opt: str\n    :return: URL suffix for the specified option\n    :rtype: str\n    '''\n\n    str_base = '#cmdoption-arg-'\n    str_opt_x = str_base+str_opt.lower()\\\n        .replace('_', '-')\\\n        .replace('(', '-')\\\n        .replace(')', '')\n    return str_opt_x", "entry_point": "form_option", "input": "'Hello World'", "output": "'#cmdoption-arg-hello world'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sunt05/SuPy/blob/47178bd5aee50a059414e3e504940662fbfae0dc/docs/source/proc_var_info/nml_rst_proc.py#L83-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034326", "code": "def gen_rst_url_split_opts(opts_str):\n    \"\"\"generate option list for RST docs\n\n    Parameters\n    ----------\n    opts_str : str\n        a string including all SUEWS related options/variables.\n        e.g. 'SUEWS_a, SUEWS_b'\n\n\n    Returns\n    -------\n    list\n        a list of parsed RST `:ref:` roles.\n        e.g. [':option:`SUEWS_a <suews:SUEWS_a>`']\n    \"\"\"\n    if opts_str is not 'None':\n        list_opts = opts_str.split(',')\n        # list_rst = [gen_rst_url_opt(opt.strip()) for opt in list_opts]\n        list_rst = [opt.strip() for opt in list_opts]\n        # list_rst = [f'`{opt}`' for opt in list_rst]\n        # more properly handle SUEWS options by explicitly adding prefix `suews`:\n        list_rst = [f':option:`{opt} <suews:{opt}>`' for opt in list_rst]\n        list_url_rst = ', '.join(list_rst)\n    else:\n        list_url_rst = 'None'\n    return list_url_rst", "entry_point": "gen_rst_url_split_opts", "input": "'  padded  '", "output": "':option:`padded <suews:padded>`'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sunt05/SuPy/blob/47178bd5aee50a059414e3e504940662fbfae0dc/docs/source/proc_var_info/gen_df_state_csv.py#L344-L370", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034327", "code": "def int32(x):\n    \"\"\" Return a signed or unsigned int \"\"\"\n    if x>0xFFFFFFFF:\n        raise OverflowError\n    if x>0x7FFFFFFF:\n        x=int(0x100000000-x)\n        if x<2147483648:\n            return -x\n        else:\n            return -2147483648\n    return x", "entry_point": "int32", "input": "0.5", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timknip/pyswf/blob/3740cc80d7650156831e728ea0d408819e5671eb/swf/stream.py#L490-L500", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034328", "code": "def pprint_arg(vnames, value):\n    \"\"\"\n    pretty print argument\n    :param vnames:\n    :param value:\n    :return:\n    \"\"\"\n    ret = ''\n    for name, v in zip(vnames, value):\n        ret += '%s=%s;' % (name, str(v))\n    return ret;", "entry_point": "pprint_arg", "input": "'  padded  ', ['apple', 'banana', 'cherry']", "output": "' =apple; =banana;p=cherry;'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scikit-hep/probfit/blob/de3593798ea3877dd2785062bed6877dd9058a02/probfit/oneshot.py#L105-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034329", "code": "def get_chunks(sequence, chunk_size):\n    \"\"\"Split sequence into chunks.\n\n    :param list sequence:\n    :param int chunk_size:\n    \"\"\"\n    return [\n        sequence[idx:idx + chunk_size]\n        for idx in range(0, len(sequence), chunk_size)\n    ]", "entry_point": "get_chunks", "input": "[[1, 2], [3], []], 7", "output": "[[[1, 2], [3], []]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jmcarp/betfair.py/blob/116df2fdc512575d1b4c4f1749d4a5bf98e519ff/betfair/utils.py#L19-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034330", "code": "def _process_scopes(scopes):\n  \"\"\"Parse a scopes list into a set of all scopes and a set of sufficient scope sets.\n\n     scopes: A list of strings, each of which is a space-separated list of scopes.\n       Examples: ['scope1']\n                 ['scope1', 'scope2']\n                 ['scope1', 'scope2 scope3']\n\n     Returns:\n       all_scopes: a set of strings, each of which is one scope to check for\n       sufficient_scopes: a set of sets of strings; each inner set is\n         a set of scopes which are sufficient for access.\n         Example: {{'scope1'}, {'scope2', 'scope3'}}\n  \"\"\"\n  all_scopes = set()\n  sufficient_scopes = set()\n  for scope_set in scopes:\n    scope_set_scopes = frozenset(scope_set.split())\n    all_scopes.update(scope_set_scopes)\n    sufficient_scopes.add(scope_set_scopes)\n  return all_scopes, sufficient_scopes", "entry_point": "_process_scopes", "input": "[]", "output": "(set(), set())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudendpoints/endpoints-python/blob/00dd7c7a52a9ee39d5923191c2604b8eafdb3f24/endpoints/users_id_token.py#L342-L362", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034331", "code": "def _are_scopes_sufficient(authorized_scopes, sufficient_scopes):\n  \"\"\"Check if a list of authorized scopes satisfies any set of sufficient scopes.\n\n     Args:\n       authorized_scopes: a list of strings, return value from oauth.get_authorized_scopes\n       sufficient_scopes: a set of sets of strings, return value from _process_scopes\n  \"\"\"\n  for sufficient_scope_set in sufficient_scopes:\n    if sufficient_scope_set.issubset(authorized_scopes):\n      return True\n  return False", "entry_point": "_are_scopes_sufficient", "input": "0.5, ''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudendpoints/endpoints-python/blob/00dd7c7a52a9ee39d5923191c2604b8eafdb3f24/endpoints/users_id_token.py#L365-L375", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034332", "code": "def snake_case_to_headless_camel_case(snake_string):\n  \"\"\"Convert snake_case to headlessCamelCase.\n\n  Args:\n    snake_string: The string to be converted.\n  Returns:\n    The input string converted to headlessCamelCase.\n  \"\"\"\n  return ''.join([snake_string.split('_')[0]] +\n                 list(sub_string.capitalize()\n                      for sub_string in snake_string.split('_')[1:]))", "entry_point": "snake_case_to_headless_camel_case", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudendpoints/endpoints-python/blob/00dd7c7a52a9ee39d5923191c2604b8eafdb3f24/endpoints/util.py#L290-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034333", "code": "def is_parent_of(page1, page2):\n    \"\"\"\n    Determines whether a given page is the parent of another page\n\n    Example::\n\n        {% if page|is_parent_of:feincms_page %} ... {% endif %}\n    \"\"\"\n\n    try:\n        return page1.tree_id == page2.tree_id and page1.lft < page2.lft and page1.rght > page2.rght\n    except AttributeError:\n        return False", "entry_point": "is_parent_of", "input": "[], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/django-leonardo/django-leonardo/blob/4b933e1792221a13b4028753d5f1d3499b0816d4/leonardo/module/nav/templatetags/webcms_nav_tags.py#L271-L283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034334", "code": "def detect_inside_virtualenv(prefix, real_prefix, base_prefix):\n    \"\"\"Tell if fades is running inside a virtualenv.\n\n    The params 'real_prefix' and 'base_prefix' may be None.\n\n    This is copied from pip code (slightly modified), see\n\n        https://github.com/pypa/pip/blob/281eb61b09d87765d7c2b92f6982b3fe76ccb0af/\n            pip/locations.py#L39\n    \"\"\"\n    if real_prefix is not None:\n        return True\n\n    if base_prefix is None:\n        return False\n\n    # if prefix is different than base_prefix, it's a venv\n    return prefix != base_prefix", "entry_point": "detect_inside_virtualenv", "input": "'walnut thistle harbour', '', 'abc'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PyAr/fades/blob/e5ea457b09b105f321d4f81772f25e8695159604/fades/main.py#L137-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034335", "code": "def format_file_url_params(file_urls):\n        '''\n            Utility method for formatting file URL parameters for transmission\n        '''\n        file_urls_payload = {}\n        if file_urls:\n            for idx, fileurl in enumerate(file_urls):\n                file_urls_payload[\"file_url[\" + str(idx) + \"]\"] = fileurl\n        return file_urls_payload", "entry_point": "format_file_url_params", "input": "['apple', 'banana', 'cherry']", "output": "{'file_url[0]': 'apple', 'file_url[1]': 'banana', 'file_url[2]': 'cherry'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L52-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034336", "code": "def format_param_list(listed_params, output_name):\n        '''\n            Utility method for formatting lists of parameters for api consumption\n            Useful for email address lists, etc\n            Args:\n                listed_params (list of values) - the list to format\n                output_name (str) - the parameter name to prepend to each key\n        '''\n        output_payload = {}\n        if listed_params:\n            for index, item in enumerate(listed_params):\n                output_payload[str(output_name) + \"[\" + str(index) + \"]\" ] = item\n        return output_payload", "entry_point": "format_param_list", "input": "['a', 'b', 'c'], 'walnut thistle harbour'", "output": "{'walnut thistle harbour[0]': 'a', 'walnut thistle harbour[1]': 'b', 'walnut thistle harbour[2]': 'c'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L63-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034337", "code": "def format_dict_list(list_of_dicts, output_name, key=None):\n        '''\n            Utility method for formatting lists of dictionaries for api consumption.\n            Takes something like [{name: val1, email: val2},{name: val1, email: val2}] for signers\n            and outputs:\n            signers[0][name]  : val1\n            signers[0][email] : val2\n            ... \n\n            Args:\n                list_of_dicts (list of dicts) - the list to format\n                \n                output_name (str) - the parameter name to prepend to each key\n                \n                key (str, optional) - Used for substituting a key present in the dictionaries for the index. The above might become signers['Lawyer']['name'] instead of using a numerical index if the key \"role_name\" was specified.\n\n        '''\n        output_payload = {}\n        if list_of_dicts:\n            for index, dictionary in enumerate(list_of_dicts):\n                index_or_key = dictionary[key] if key else str(index)\n                base_name = output_name + '[' + index_or_key + ']'\n                for (param, value) in dictionary.items():\n                    if param != key: #key params are stripped\n                        output_payload[base_name + '[' + param + ']'] = value\n        return output_payload", "entry_point": "format_dict_list", "input": "{}, '', [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L78-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034338", "code": "def format_single_dict(dictionary, output_name):\n        '''\n            Currently used for metadata fields\n        '''\n        output_payload = {}\n        if dictionary:\n            for (k, v) in dictionary.items():\n                output_payload[output_name + '[' + k + ']'] = v\n        return output_payload", "entry_point": "format_single_dict", "input": "{}, 'walnut thistle harbour'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L106-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034339", "code": "def format_custom_fields(list_of_custom_fields):\n        '''\n            Custom fields formatting for submission\n        '''\n        output_payload = {}\n        if list_of_custom_fields:\n            # custom_field: {\"name\": value}\n            for custom_field in list_of_custom_fields:\n                for key, value in custom_field.items():\n                    output_payload[\"custom_fields[\" + key + \"]\"] = value\n        return output_payload", "entry_point": "format_custom_fields", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L117-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034340", "code": "def median(values):\n    \"\"\"Return median value for the list of values.\n    @param  values:     list of values for processing.\n    @return:            median value.\n    \"\"\"\n    values.sort()\n    n = int(len(values) / 2)\n    return values[n]", "entry_point": "median", "input": "[1, 2, 3]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/intelhex/bench.py#L45-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034341", "code": "def build_defines(defines):\n    \"\"\"Build a list of `-D` directives to pass to the compiler.\n\n    This will drop any definitions whose value is None so that\n    you can get rid of a define from another architecture by\n    setting its value to null in the `module_settings.json`.\n    \"\"\"\n\n    return ['-D\"%s=%s\"' % (x, str(y)) for x, y in defines.items() if y is not None]", "entry_point": "build_defines", "input": "{'a': 1, 'b': 2}", "output": "['-D\"a=1\"', '-D\"b=2\"']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/site_scons/utilities.py#L58-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034342", "code": "def _delete_duplicates(l, keep_last):\n    \"\"\"Delete duplicates from a sequence, keeping the first or last.\"\"\"\n    seen=set()\n    result=[]\n    if keep_last:           # reverse in & out, then keep first\n        l.reverse()\n    for i in l:\n        try:\n            if i not in seen:\n                result.append(i)\n                seen.add(i)\n        except TypeError:\n            # probably unhashable.  Just keep it.\n            result.append(i)\n    if keep_last:\n        result.reverse()\n    return result", "entry_point": "_delete_duplicates", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L168-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034343", "code": "def unique(s):\n    \"\"\"Return a list of the elements in s, but without duplicates.\n\n    For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],\n    unique(\"abcabc\") some permutation of [\"a\", \"b\", \"c\"], and\n    unique(([1, 2], [2, 3], [1, 2])) some permutation of\n    [[2, 3], [1, 2]].\n\n    For best speed, all sequence elements should be hashable.  Then\n    unique() will usually work in linear time.\n\n    If not possible, the sequence elements should enjoy a total\n    ordering, and if list(s).sort() doesn't raise TypeError it's\n    assumed that they do enjoy a total ordering.  Then unique() will\n    usually work in O(N*log2(N)) time.\n\n    If that's not possible either, the sequence elements must support\n    equality-testing.  Then unique() will usually work in quadratic\n    time.\n    \"\"\"\n\n    n = len(s)\n    if n == 0:\n        return []\n\n    # Try using a dict first, as that's the fastest and will usually\n    # work.  If it doesn't work, it will usually fail quickly, so it\n    # usually doesn't cost much to *try* it.  It requires that all the\n    # sequence elements be hashable, and support equality comparison.\n    u = {}\n    try:\n        for x in s:\n            u[x] = 1\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        return list(u.keys())\n    del u\n\n    # We can't hash all the elements.  Second fastest is to sort,\n    # which brings the equal elements together; then duplicates are\n    # easy to weed out in a single pass.\n    # NOTE:  Python's list.sort() was designed to be efficient in the\n    # presence of many duplicate elements.  This isn't true of all\n    # sort functions in all languages or libraries, so this approach\n    # is more effective in Python than it may be elsewhere.\n    try:\n        t = sorted(s)\n    except TypeError:\n        pass    # move on to the next method\n    else:\n        assert n > 0\n        last = t[0]\n        lasti = i = 1\n        while i < n:\n            if t[i] != last:\n                t[lasti] = last = t[i]\n                lasti = lasti + 1\n            i = i + 1\n        return t[:lasti]\n    del t\n\n    # Brute force is all that's left.\n    u = []\n    for x in s:\n        if x not in u:\n            u.append(x)\n    return u", "entry_point": "unique", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Util.py#L1155-L1222", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034344", "code": "def indent_list(inlist, level):\n    \"\"\"Join a list of strings, one per line with 'level' spaces before each one\"\"\"\n\n    indent = ' '*level\n    joinstr = '\\n' + indent\n\n    retval = joinstr.join(inlist)\n    return indent + retval", "entry_point": "indent_list", "input": "'a,b,c', 10", "output": "'          a\\n          ,\\n          b\\n          ,\\n          c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/formatting.py#L20-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034345", "code": "def _unpack_version(tag_data):\n    \"\"\"Parse a packed version info struct into tag and major.minor version.\n\n    The tag and version are parsed out according to 20 bits for tag and\n    6 bits each for major and minor.  The more interesting part is the\n    blacklisting performed for tags that are known to be untrustworthy.\n\n    In particular, the following applies to tags.\n\n    - tags < 1024 are reserved for development and have only locally defined\n      meaning.  They are not for use in production.\n    - tags in [1024, 2048) are production tags but were used inconsistently\n      in the early days of Arch and hence cannot be trusted to correspond with\n      an actual device model.\n    - tags >= 2048 are reserved for supported production device variants.\n    - the tag and version 0 (0.0) is reserved for an unknown wildcard that\n      does not convey any information except that the tag and version are\n      not known.\n    \"\"\"\n\n    tag = tag_data & ((1 << 20) - 1)\n\n    version_data = tag_data >> 20\n    major = (version_data >> 6) & ((1 << 6) - 1)\n    minor = (version_data >> 0) & ((1 << 6) - 1)\n\n    return (tag, \"{}.{}\".format(major, minor))", "entry_point": "_unpack_version", "input": "False", "output": "(0, '0.0')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/reference/reference_controller.py#L322-L348", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034346", "code": "def __ensure_suffix(t, suffix):\n    \"\"\" Ensure that the target t has the given suffix. \"\"\"\n    tpath = str(t)\n    if not tpath.endswith(suffix):\n        return tpath+suffix\n    \n    return t", "entry_point": "__ensure_suffix", "input": "[-1, 0, 1, 2], 'Hello World'", "output": "'[-1, 0, 1, 2]Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/docbook/__init__.py#L113-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034347", "code": "def _string_from_cmd_list(cmd_list):\n    \"\"\"Takes a list of command line arguments and returns a pretty\n    representation for printing.\"\"\"\n    cl = []\n    for arg in map(str, cmd_list):\n        if ' ' in arg or '\\t' in arg:\n            arg = '\"' + arg + '\"'\n        cl.append(arg)\n    return ' '.join(cl)", "entry_point": "_string_from_cmd_list", "input": "['a', 'b', 'c']", "output": "'a b c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Action.py#L727-L735", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034348", "code": "def copyto_emitter(target, source, env):\n    \"\"\" changes the path of the source to be under the target (which\n    are assumed to be directories.\n    \"\"\"\n    n_target = []\n\n    for t in target:\n        n_target = n_target + [t.File( str( s ) ) for s in source]\n\n    return (n_target, source)", "entry_point": "copyto_emitter", "input": "[], [-1, 0, 1, 2], []", "output": "([], [-1, 0, 1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/filesystem.py#L40-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034349", "code": "def linOriginRegression(points):\n    \"\"\"\n    computes a linear regression starting at zero\n    \"\"\"\n    j = sum([ i[0] for i in points ])\n    k = sum([ i[1] for i in points ])\n    if j != 0:\n        return k/j, j, k\n    return 1, j, k", "entry_point": "linOriginRegression", "input": "set()", "output": "(1, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benedictpaten/sonLib/blob/1decb75bb439b70721ec776f685ce98e25217d26/misc.py#L28-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034350", "code": "def normaliseWV(wV, normFac=1.0):\n    \"\"\"\n    make char probs divisible by one\n    \"\"\"\n    f = sum(wV) / normFac\n    return [ i/f for i in wV ]", "entry_point": "normaliseWV", "input": "(1, 2), 1", "output": "[0.3333333333333333, 0.6666666666666666]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benedictpaten/sonLib/blob/1decb75bb439b70721ec776f685ce98e25217d26/tree.py#L180-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034351", "code": "def maketabdesc(descs=[]):\n    \"\"\"Create a table description.\n\n    Creates a table description from a set of column descriptions. The\n    resulting table description can be used in the :class:`table` constructor.\n\n    For example::\n\n      scd1 = makescacoldesc(\"col2\", \"aa\")\n      scd2 = makescacoldesc(\"col1\", 1, \"IncrementalStMan\")\n      scd3 = makescacoldesc(\"colrec1\", {})\n      acd1 = makearrcoldesc(\"arr1\", 1, 0, [2,3,4])\n      acd2 = makearrcoldesc(\"arr2\", 0.+0j)\n      td = maketabdesc([scd1, scd2, scd3, acd1, acd2])\n      t = table(\"mytable\", td, nrow=100)\n\n    | This creates a table description `td` from five column descriptions\n      and then creates a 100-row table called `mytable` from the table\n      description.\n    | The columns contain respectivily strings, integer scalars, records,\n      3D integer arrays with fixed shape [2,3,4], and complex arrays with\n      variable shape.\n\n    \"\"\"\n    rec = {}\n    # If a single dict is given, make a list of it.\n    if isinstance(descs, dict):\n        descs = [descs]\n    for desc in descs:\n        colname = desc['name']\n        if colname in rec:\n            raise ValueError('Column name ' + colname + ' multiply used in table description')\n        rec[colname] = desc['desc']\n    return rec", "entry_point": "maketabdesc", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/casacore/python-casacore/blob/975510861ea005f7919dd9e438b5f98a1682eebe/casacore/tables/tableutil.py#L450-L483", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034352", "code": "def _do_remove_prefix(name):\n    \"\"\"Strip the possible prefix 'Table: ' from a table name.\"\"\"\n    res = name\n    if isinstance(res, str):\n        if (res.find('Table: ') == 0):\n            res = res.replace('Table: ', '', 1)\n    return res", "entry_point": "_do_remove_prefix", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/casacore/python-casacore/blob/975510861ea005f7919dd9e438b5f98a1682eebe/casacore/tables/tablehelper.py#L41-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034353", "code": "def extend_unique(seq, more):\n    \"\"\"Return a new sequence containing the items in `seq` plus any items in\n    `more` that aren't already in `seq`, preserving the order of both.\n    \"\"\"\n    seen = set(seq)\n    new = []\n    for item in more:\n        if item not in seen:\n            seen.add(item)\n            new.append(item)\n\n    return seq + type(seq)(new)", "entry_point": "extend_unique", "input": "[], ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kronuz/pyScss/blob/fb32b317f6e2b4b4aad2b86a74844658ac4aa11e/scss/rule.py#L17-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034354", "code": "def _constrain(value, lb=0, ub=1):\n    \"\"\"Helper for Color constructors.  Constrains a value to a range.\"\"\"\n    if value < lb:\n        return lb\n    elif value > ub:\n        return ub\n    else:\n        return value", "entry_point": "_constrain", "input": "[], [], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kronuz/pyScss/blob/fb32b317f6e2b4b4aad2b86a74844658ac4aa11e/scss/types.py#L808-L815", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034355", "code": "def _is_combinator_subset_of(specific, general, is_first=True):\n    \"\"\"Return whether `specific` matches a non-strict subset of what `general`\n    matches.\n    \"\"\"\n    if is_first and general == ' ':\n        # First selector always has a space to mean \"descendent of root\", which\n        # still holds if any other selector appears above it\n        return True\n\n    if specific == general:\n        return True\n\n    if specific == '>' and general == ' ':\n        return True\n\n    if specific == '+' and general == '~':\n        return True\n\n    return False", "entry_point": "_is_combinator_subset_of", "input": "[], [[1, 2], [3], []], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kronuz/pyScss/blob/fb32b317f6e2b4b4aad2b86a74844658ac4aa11e/scss/selector.py#L62-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034356", "code": "def longest_common_subsequence(a, b, mergefunc=None):\n    \"\"\"Find the longest common subsequence between two iterables.\n\n    The longest common subsequence is the core of any diff algorithm: it's the\n    longest sequence of elements that appears in both parent sequences in the\n    same order, but NOT necessarily consecutively.\n\n    Original algorithm borrowed from Wikipedia:\n    http://en.wikipedia.org/wiki/Longest_common_subsequence_problem#Code_for_the_dynamic_programming_solution\n\n    This function is used only to implement @extend, largely because that's\n    what the Ruby implementation does.  Thus it's been extended slightly from\n    the simple diff-friendly algorithm given above.\n\n    What @extend wants to know is whether two simple selectors are compatible,\n    not just equal.  To that end, you must pass in a \"merge\" function to\n    compare a pair of elements manually.  It should return `None` if they are\n    incompatible, and a MERGED element if they are compatible -- in the case of\n    selectors, this is whichever one is more specific.\n\n    Because of this fuzzier notion of equality, the return value is a list of\n    ``(a_index, b_index, value)`` tuples rather than items alone.\n    \"\"\"\n    if mergefunc is None:\n        # Stupid default, just in case\n        def mergefunc(a, b):\n            if a == b:\n                return a\n            return None\n\n    # Precalculate equality, since it can be a tad expensive and every pair is\n    # compared at least once\n    eq = {}\n    for ai, aval in enumerate(a):\n        for bi, bval in enumerate(b):\n            eq[ai, bi] = mergefunc(aval, bval)\n\n    # Build the \"length\" matrix, which provides the length of the LCS for\n    # arbitrary-length prefixes.  -1 exists only to support the base case\n    prefix_lcs_length = {}\n    for ai in range(-1, len(a)):\n        for bi in range(-1, len(b)):\n            if ai == -1 or bi == -1:\n                l = 0\n            elif eq[ai, bi]:\n                l = prefix_lcs_length[ai - 1, bi - 1] + 1\n            else:\n                l = max(\n                    prefix_lcs_length[ai, bi - 1],\n                    prefix_lcs_length[ai - 1, bi])\n\n            prefix_lcs_length[ai, bi] = l\n\n    # The interesting part.  The key insight is that the bottom-right value in\n    # the length matrix must be the length of the LCS because of how the matrix\n    # is defined, so all that's left to do is backtrack from the ends of both\n    # sequences in whatever way keeps the LCS as long as possible, and keep\n    # track of the equal pairs of elements we see along the way.\n    # Wikipedia does this with recursion, but the algorithm is trivial to\n    # rewrite as a loop, as below.\n    ai = len(a) - 1\n    bi = len(b) - 1\n\n    ret = []\n    while ai >= 0 and bi >= 0:\n        merged = eq[ai, bi]\n        if merged is not None:\n            ret.append((ai, bi, merged))\n            ai -= 1\n            bi -= 1\n        elif prefix_lcs_length[ai, bi - 1] > prefix_lcs_length[ai - 1, bi]:\n            bi -= 1\n        else:\n            ai -= 1\n\n    # ret has the latest items first, which is backwards\n    ret.reverse()\n    return ret", "entry_point": "longest_common_subsequence", "input": "['apple', 'banana', 'cherry'], [], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kronuz/pyScss/blob/fb32b317f6e2b4b4aad2b86a74844658ac4aa11e/scss/selector.py#L587-L664", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034357", "code": "def remove_dupes(list_with_dupes):\n    '''Remove duplicate entries from a list while preserving order\n\n    This function uses Python's standard equivalence testing methods in\n    order to determine if two elements of a list are identical. So if in the list [a,b,c]\n    the condition a == b is True, then regardless of whether a and b are strings, ints,\n    or other, then b will be removed from the list: [a, c]\n\n    Parameters\n    ----------\n\n    list_with_dupes : list\n        A list containing duplicate elements\n\n    Returns\n    -------\n    out : list\n        The list with the duplicate entries removed by the order preserved\n\n\n    Examples\n    --------\n    >>> a = [1,3,2,4,2]\n    >>> print(remove_dupes(a))\n    [1,3,2,4]\n\n    '''\n    visited = set()\n    visited_add = visited.add\n    out = [ entry for entry in list_with_dupes if not (entry in visited or visited_add(entry))]\n    return out", "entry_point": "remove_dupes", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/williamgilpin/pypdb/blob/bfb9e1b15b4ad097c5add50c4c176ac6cb28ee15/pypdb/pypdb.py#L1268-L1298", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034358", "code": "def median(data):\n    \"\"\"\n    Return the median of numeric data, unsing the \"mean of middle two\" method.\n    If ``data`` is empty, ``0`` is returned.\n\n    Examples\n    --------\n\n    >>> median([1, 3, 5])\n    3.0\n\n    When the number of data points is even, the median is interpolated:\n    >>> median([1, 3, 5, 7])\n    4.0\n    \"\"\"\n\n    if len(data) == 0:\n        return None\n\n    data = sorted(data)\n    return float((data[len(data) // 2] + data[(len(data) - 1) // 2]) / 2.)", "entry_point": "median", "input": "[1, 2, 3]", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yvesalexandre/bandicoot/blob/73a658f6f17331541cf0b1547028db9b70e8d58a/bandicoot/helper/maths.py#L88-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034359", "code": "def percent_initiated_interactions(records, user):\n    \"\"\"\n    The percentage of calls initiated by the user.\n    \"\"\"\n    if len(records) == 0:\n        return 0\n\n    initiated = sum(1 for r in records if r.direction == 'out')\n    return initiated / len(records)", "entry_point": "percent_initiated_interactions", "input": "(), ()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yvesalexandre/bandicoot/blob/73a658f6f17331541cf0b1547028db9b70e8d58a/bandicoot/individual.py#L107-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034360", "code": "def active_days(records):\n    \"\"\"\n    The number of days during which the user was active. A user is considered\n    active if he sends a text, receives a text, initiates a call, receives a\n    call, or has a mobility point.\n    \"\"\"\n    days = set(r.datetime.date() for r in records)\n    return len(days)", "entry_point": "active_days", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yvesalexandre/bandicoot/blob/73a658f6f17331541cf0b1547028db9b70e8d58a/bandicoot/individual.py#L320-L327", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034361", "code": "def number_of_interactions(records, direction=None):\n    \"\"\"\n    The number of interactions.\n\n    Parameters\n    ----------\n    direction : str, optional\n        Filters the records by their direction: ``None`` for all records,\n        ``'in'`` for incoming, and ``'out'`` for outgoing.\n    \"\"\"\n    if direction is None:\n        return len(records)\n    else:\n        return len([r for r in records if r.direction == direction])", "entry_point": "number_of_interactions", "input": "set(), 'abc'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yvesalexandre/bandicoot/blob/73a658f6f17331541cf0b1547028db9b70e8d58a/bandicoot/individual.py#L409-L422", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034362", "code": "def _extract_list_from_generator(generator):\n    \"\"\"\n    Iterates over a generator to extract all the objects and add them to a list.\n    Useful when the objects have to be used multiple times.\n    \"\"\"\n\n    extracted = []\n    for i in generator:\n        extracted.append(list(i))\n    return extracted", "entry_point": "_extract_list_from_generator", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yvesalexandre/bandicoot/blob/73a658f6f17331541cf0b1547028db9b70e8d58a/bandicoot/weekmatrix.py#L310-L319", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034363", "code": "def _longer_than(segments, min_dur):\n    \"\"\"Remove segments longer than min_dur.\"\"\"\n    if min_dur <= 0.:\n        return segments\n\n    long_enough = []\n    for seg in segments:\n\n        if sum([t[1] - t[0] for t in seg['times']]) >= min_dur:\n            long_enough.append(seg)\n\n    return long_enough", "entry_point": "_longer_than", "input": "2.0, False", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wonambi-python/wonambi/blob/1d8e3d7e53df8017c199f703bcab582914676e76/wonambi/trans/select.py#L515-L526", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034364", "code": "def _divide_bundles(bundles):\n    \"\"\"Take each subsegment inside a bundle and put it in its own bundle,\n    copying the bundle metadata.\"\"\"\n    divided = []\n\n    for bund in bundles:\n        for t in bund['times']:\n            new_bund = bund.copy()\n            new_bund['times'] = [t]\n            divided.append(new_bund)\n\n    return divided", "entry_point": "_divide_bundles", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wonambi-python/wonambi/blob/1d8e3d7e53df8017c199f703bcab582914676e76/wonambi/trans/select.py#L610-L621", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034365", "code": "def make_arousals(events, time, s_freq):\n    \"\"\"Create dict for each arousal, based on events of time points.\n\n    Parameters\n    ----------\n    events : ndarray (dtype='int')\n        N x 5 matrix with start, end samples\n    data : ndarray (dtype='float')\n        vector with the data\n    time : ndarray (dtype='float')\n        vector with time points\n    s_freq : float\n        sampling frequency\n\n    Returns\n    -------\n    list of dict\n        list of all the arousals, with information about start, end, \n        duration (s),\n    \"\"\"\n    arousals = []\n    for ev in events:\n        one_ar = {'start': time[ev[0]],\n                  'end': time[ev[1] - 1],\n                  'dur': (ev[1] - ev[0]) / s_freq,\n                  }\n        arousals.append(one_ar)\n\n    return arousals", "entry_point": "make_arousals", "input": "[], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wonambi-python/wonambi/blob/1d8e3d7e53df8017c199f703bcab582914676e76/wonambi/detect/arousal.py#L233-L261", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034366", "code": "def loc_info(text, index):\n        '''Location of `index` in source code `text`.'''\n        if index > len(text):\n            raise ValueError('Invalid index.')\n        line, last_ln = text.count('\\n', 0, index), text.rfind('\\n', 0, index)\n        col = index - (last_ln + 1)\n        return (line, col)", "entry_point": "loc_info", "input": "'a,b,c', -3", "output": "(0, -3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sighingnow/parsec.py/blob/ed50e1e259142757470b925f8d20dfe5ad223af0/src/parsec/__init__.py#L29-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034367", "code": "def _clean_netloc(netloc):\n    \"\"\"Remove trailing '.' and ':' and tolower.\n\n    >>> _clean_netloc('eXample.coM:')\n    'example.com'\n    \"\"\"\n    try:\n        return netloc.rstrip('.:').lower()\n    except:\n        return netloc.rstrip('.:').decode('utf-8').lower().encode('utf-8')", "entry_point": "_clean_netloc", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rbaier/python-urltools/blob/76bf599aeb4cb463df8e38367aa40a7d8ec7d9a1/urltools/urltools.py#L373-L382", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034368", "code": "def human_readable_size(num, suffix='B'):\n    \"\"\" FROM http://stackoverflow.com/a/1094933/1958900\n    \"\"\"\n    for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:\n        if abs(num) < 1024.0:\n            return \"%3.1f%s%s\" % (num, unit, suffix)\n        num /= 1024.0\n    return \"%.1f%s%s\" % (num, 'Yi', suffix)", "entry_point": "human_readable_size", "input": "0, 'a,b,c'", "output": "'0.0a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/avirshup/DockerMake/blob/2173199904f086353ef539ea578788b99f6fea0a/dockermake/utils.py#L205-L212", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034369", "code": "def lookup(source, keys, fallback = None):\n  \"\"\"Traverses the source, looking up each key.  Returns None if can't find anything instead of raising an exception.\"\"\"\n  try:\n    for key in keys:\n      source = source[key]\n    return source\n  except (KeyError, AttributeError, TypeError):\n    return fallback", "entry_point": "lookup", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Cue/scales/blob/0aced26eb050ceb98ee9d5d6cdca8db448666986/src/greplin/scales/util.py#L30-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034370", "code": "def get_config(context):\n    \"\"\"\n    Return the formatted javascript for any disqus config variables.\n    \"\"\"\n\n    conf_vars = ['disqus_developer',\n                 'disqus_identifier',\n                 'disqus_url',\n                 'disqus_title',\n                 'disqus_category_id'\n                 ]\n\n    js = '\\tvar {} = \"{}\";'\n\n    output = [js.format(item, context[item]) for item in conf_vars \\\n              if item in context]\n\n    return '\\n'.join(output)", "entry_point": "get_config", "input": "'Hello World'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arthurk/django-disqus/blob/0db52c240906c6663189c0a7aca9979a0db004d1/disqus/templatetags/disqus_tags.py#L45-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034371", "code": "def max_len(iterable, minimum=0):\n    \"\"\"Return the len() of the longest item in ``iterable`` or ``minimum``.\n\n    >>> max_len(['spam', 'ham'])\n    4\n\n    >>> max_len([])\n    0\n\n    >>> max_len(['ham'], 4)\n    4\n    \"\"\"\n    try:\n        result = max(map(len, iterable))\n    except ValueError:\n        result = minimum\n    return minimum if result < minimum else result", "entry_point": "max_len", "input": "[], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xflr6/concepts/blob/2801b27b05fa02cccee7d549451810ffcbf5c942/concepts/tools.py#L123-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034372", "code": "def stringify(syllables) :\n\t'''This function takes a syllabification returned by syllabify and\n\t   turns it into a string, with phonemes spearated by spaces and\n\t   syllables spearated by periods.'''\n\tret = []\n\tfor syl in syllables :\n\t\tstress, onset, nucleus, coda = syl\n\t\tif stress != None and len(nucleus) != 0 :\n\t\t\tnucleus[0] += str(stress)\n\t\tret.append(\" \".join(onset + nucleus + coda))\n\treturn \" . \".join(ret)", "entry_point": "stringify", "input": "()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quadrismegistus/prosodic/blob/8af66ed9be40c922d03a0b09bc11c87d2061b618/prosodic/dicts/en/syllabify.py#L158-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034373", "code": "def add_elisions(_ipa):\n\t\"\"\"\n\tAdd alternative pronunciations: those that have elided syllables\n\t\"\"\"\n\treplace={}\n\n\t# -OWER\n\t# e.g. tower, hour, bower, etc\n\treplace[u'a\u028a.\u025b\u02d0']=u'a\u028ar'\n\n\n\t# -INOUS\n\t# e.g. ominous, etc\n\treplace[u'\u0259.n\u0259s']=u'n\u0259s'\n\n\t# -EROUS\n\t# e.g. ponderous, adventurous\n\treplace[u'\u025b\u02d0.\u0259s']=u'r\u0259s'\n\n\t# -IA-\n\t# e.g. plutonian, indian, assyrian, idea, etc\n\treplace[u'i\u02d0.\u0259']=u'j\u0259'\n\t# -IOUS\n\t# e.g. studious, tedious, etc\n\t#replace[u'i\u02d0.\u0259s']=u'i\u02d0\u0259s'\n\n\n\t# -IER\n\t# e.g. happier\n\treplace[u'i\u02d0.\u025b\u02d0']=u'\u026ar'\n\n\t# -ERING\n\t# e.g. scattering, wondering, watering\n\treplace[u'\u025b\u02d0.\u026a\u014b']=u'r\u026a\u014b'\n\n\t# -ERY\n\t# e.g. memory\n\t# QUESTIONABLE\n\t#replace[u'\u025b\u02d0.i\u02d0']=u'ri\u02d0'\n\n\t# -ENING\n\t# e.g. opening\n\treplace[u'\u0259.n\u026a\u014b']=u'n\u026a\u014b'\n\n\t# -ENER\n\t# e.g. gardener\n\treplace[u'\u0259.n\u025b\u02d0']=u'n\u025b\u02d0'\n\n\t# -EL- (-ELLER, -ELLING, -ELLY)\n\t# e.g. traveller, dangling, gravelly\n\t# QUESTIONABLE\n\t#replace[u'\u0259.l']=u'l'\n\n\t# -IRE-\n\t# e.g. fire, fiery, attire, hired\n\treplace[u'\u026a.\u025b\u02d0']=u'\u026ar'\n\n\t# -EL, -UAL\n\t# e.g. jewel\n\treplace[u'u\u02d0.\u0259l']=u'u\u02d0l'\n\n\t# -EVN\n\t# e.g. heaven, seven\n\treplace[u'\u025b.v\u0259n']=u'\u025bvn'\n\n\t# -IOUS, -EER\n\t# e.g. sincerest, dear, incommodiously\n\t# QUESTIONABLE\n\t#replace[u'.\u028c.']=u'\u028c.'\n\treplace[u'e\u026a.\u028c']=u'e\u026a\u028c'\n\n\tnew=[_ipa]\n\tfor k,v in replace.items():\n\t\tif k in _ipa:\n\t\t\tnew+=[_ipa.replace(k,v)]\n\treturn new", "entry_point": "add_elisions", "input": "[-1, 0, 1, 2]", "output": "[[-1, 0, 1, 2]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quadrismegistus/prosodic/blob/8af66ed9be40c922d03a0b09bc11c87d2061b618/prosodic/dicts/en/english.py#L128-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034374", "code": "def _join_host_port(host, port):\n    \"\"\"Adapted golang's net.JoinHostPort\"\"\"\n    template = \"%s:%s\"\n    host_requires_bracketing = ':' in host or '%' in host\n    if host_requires_bracketing:\n        template = \"[%s]:%s\"\n    return template % (host, port)", "entry_point": "_join_host_port", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "'[1, 2, 3]:[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tomplus/kubernetes_asyncio/blob/f9ab15317ec921409714c7afef11aeb0f579985d/kubernetes_asyncio/config/incluster_config.py#L27-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034375", "code": "def data_key(data) :\n    \"returns a unique value that allows data to be used as a dict/set key.\"\n    if isinstance(data, (bytes, float, frozenset, int, str, tuple)) :\n        result = data\n    else :\n        # data itself is non-hashable\n        result = id(data)\n    #end if\n    return \\\n        result", "entry_point": "data_key", "input": "['apple', 'banana', 'cherry']", "output": "140099982015296", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ldo/dbussy/blob/59e4fbe8b8111ceead884e50d1973901a0a2d240/dbussy.py#L874-L883", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034376", "code": "def _check_targ(targ, keys):\n    r\"\"\"Check format of htarg/ftarg and return dict.\"\"\"\n    if not targ:  # If None\n        targ = {}\n    elif not isinstance(targ, (list, tuple, dict)):  # If only one value\n        targ = [targ, ]\n    if isinstance(targ, (list, tuple)):  # Put list into dict\n        targ = {keys[i]: targ[i] for i in range(min(len(targ), len(keys)))}\n    return targ", "entry_point": "_check_targ", "input": "[], [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/empymod/empymod/blob/4a78ca4191ed4b4d42d019ce715a9a3889dba1bc/empymod/utils.py#L1924-L1932", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034377", "code": "def _verbs_with_subjects(doc):\n    \"\"\"Given a spacy document return the verbs that have subjects\"\"\"\n    # TODO: UNUSED\n    verb_subj = []\n    for possible_subject in doc:\n        if (possible_subject.dep_ == 'nsubj' and possible_subject.head.pos_ ==\n                'VERB'):\n            verb_subj.append([possible_subject.head, possible_subject])\n    return verb_subj", "entry_point": "_verbs_with_subjects", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/empirical-org/Quill-NLP-Tools-and-Datasets/blob/f2ff579ddf3a556d9cdc47c5f702422fa06863d9/utils/qmangle/qmangle/__init__.py#L19-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034378", "code": "def trim_prefix(text, nchr):\n    \"\"\"Trim characters off of the beginnings of text lines.\n\n    Parameters\n    ----------\n    text : str\n        The text to be trimmed, with newlines (\\n) separating lines\n\n    nchr: int\n        The number of spaces to trim off the beginning of a line if\n        it starts with that many spaces\n\n    Returns\n    -------\n    text : str\n        The trimmed text\n    \"\"\"\n    res = []\n    for line in text.split('\\n'):\n        if line.startswith(' ' * nchr):\n            line = line[nchr:]\n        res.append(line)\n\n    return '\\n'.join(res)", "entry_point": "trim_prefix", "input": "'a,b,c', True", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ejeschke/ginga/blob/a78c893ec6f37a837de851947e9bb4625c597915/ginga/util/toolbox.py#L107-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034379", "code": "def extract_notification_payload(process_output):\n        \"\"\"\n        Processes the raw output from Gatttool stripping the first line and the\n            'Notification handle = 0x000e value: ' from each line\n        @param: process_output - the raw output from a listen commad of GattTool\n        which may look like this:\n            Characteristic value was written successfully\n            Notification handle = 0x000e value: 54 3d 32 37 2e 33 20 48 3d 32 37 2e 30 00\n            Notification handle = 0x000e value: 54 3d 32 37 2e 32 20 48 3d 32 37 2e 32 00\n            Notification handle = 0x000e value: 54 3d 32 37 2e 33 20 48 3d 32 37 2e 31 00\n            Notification handle = 0x000e value: 54 3d 32 37 2e 32 20 48 3d 32 37 2e 33 00\n            Notification handle = 0x000e value: 54 3d 32 37 2e 33 20 48 3d 32 37 2e 31 00\n            Notification handle = 0x000e value: 54 3d 32 37 2e 31 20 48 3d 32 37 2e 34 00\n\n\n            This method strips the fist line and strips the 'Notification handle = 0x000e value: ' from each line\n        @returns a processed string only containing the values.\n        \"\"\"\n        data = []\n        for element in process_output.splitlines()[1:]:\n            parts = element.split(\": \")\n            if len(parts) == 2:\n                data.append(parts[1])\n        return data", "entry_point": "extract_notification_payload", "input": "'AbC dEf'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ChristianKuehnel/btlewrap/blob/1b7aec934529dcf03f5ecdccd0b09c25c389974f/btlewrap/gatttool.py#L179-L202", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034380", "code": "def bytes_to_string(raw_data: bytes, prefix: bool = False) -> str:\n        \"\"\"Convert a byte array to a hex string.\"\"\"\n        prefix_string = ''\n        if prefix:\n            prefix_string = '0x'\n        suffix = ''.join([format(c, \"02x\") for c in raw_data])\n        return prefix_string + suffix.upper()", "entry_point": "bytes_to_string", "input": "[5, 3, 1, 4], 'abc'", "output": "'0x05030104'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ChristianKuehnel/btlewrap/blob/1b7aec934529dcf03f5ecdccd0b09c25c389974f/btlewrap/gatttool.py#L276-L282", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034381", "code": "def decode_ast(registry, ast_json):\n    \"\"\"JSON decoder for BaseNodes\"\"\"\n    if ast_json.get(\"@type\"):\n        subclass = registry.get_cls(ast_json[\"@type\"], tuple(ast_json[\"@fields\"]))\n        return subclass(\n            ast_json[\"children\"],\n            ast_json[\"field_references\"],\n            ast_json[\"label_references\"],\n            position=ast_json[\"@position\"],\n        )\n    else:\n        return ast_json", "entry_point": "decode_ast", "input": "2.0, {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datacamp/antlr-ast/blob/d08d5eb2e663bd40501d0eeddc8a731ac7e96b11/antlr_ast/marshalling.py#L27-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034382", "code": "def materialize(reference_dict, source):\n    \"\"\"\n    Replace indices by actual elements in a reference mapping\n    :param reference_dict: mapping str -> int | int[]\n    :param source: list of elements\n    :return: mapping str -> element | element[]\n    \"\"\"\n    materialized_dict = {}\n    for field in reference_dict:\n        reference = reference_dict[field]\n        if isinstance(reference, list):\n            materialized_dict[field] = [source[index] for index in reference]\n        elif reference is not None:\n            materialized_dict[field] = source[reference]\n        else:\n            materialized_dict[field] = None\n    return materialized_dict", "entry_point": "materialize", "input": "{'x': [1, 2], 'y': []}, [1, 2, 3]", "output": "{'x': [2, 3], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datacamp/antlr-ast/blob/d08d5eb2e663bd40501d0eeddc8a731ac7e96b11/antlr_ast/ast.py#L688-L704", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034383", "code": "def get_info(node_cfg):\n        \"\"\"Return a tuple with the verbal name of a node, and a dict of field names.\"\"\"\n\n        node_cfg = node_cfg if isinstance(node_cfg, dict) else {\"name\": node_cfg}\n\n        return node_cfg.get(\"name\"), node_cfg.get(\"fields\", {})", "entry_point": "get_info", "input": "[5, 3, 1, 4]", "output": "([5, 3, 1, 4], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datacamp/antlr-ast/blob/d08d5eb2e663bd40501d0eeddc8a731ac7e96b11/antlr_ast/ast.py#L143-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034384", "code": "def extend_node_list(acc, new):\n        \"\"\"Extend accumulator with Node(s) from new\"\"\"\n        if new is None:\n            new = []\n        elif not isinstance(new, list):\n            new = [new]\n        return acc + new", "entry_point": "extend_node_list", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "[1, 2, 3, 'apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datacamp/antlr-ast/blob/d08d5eb2e663bd40501d0eeddc8a731ac7e96b11/antlr_ast/ast.py#L294-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034385", "code": "def _match(filtered, matcher):\n    \"\"\"Old method to find matches in a set of filtered identities.\"\"\"\n\n    def match_filtered_identities(x, ids, matcher):\n        \"\"\"Check if an identity matches a set of identities\"\"\"\n\n        for y in ids:\n            if x.uuid == y.uuid:\n                return True\n            if matcher.match_filtered_identities(x, y):\n                return True\n        return False\n\n    # Find subsets of matches\n    matched = []\n\n    while filtered:\n        candidates = []\n        no_match = []\n\n        x = filtered.pop(0)\n\n        while matched:\n            ids = matched.pop(0)\n\n            if match_filtered_identities(x, ids, matcher):\n                candidates += ids\n            else:\n                no_match.append(ids)\n\n        candidates.append(x)\n\n        # Generate the new list of matched subsets\n        matched = [candidates] + no_match\n\n    return matched", "entry_point": "_match", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sortinghat/blob/391cd37a75fea26311dc6908bc1c953c540a8e04/sortinghat/matcher.py#L199-L234", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034386", "code": "def _filter_unique_identities(uidentities, matcher):\n    \"\"\"Filter a set of unique identities.\n\n    This function will use the `matcher` to generate a list\n    of `FilteredIdentity` objects. It will return a tuple\n    with the list of filtered objects, the unique identities\n    not filtered and a table mapping uuids with unique\n    identities.\n    \"\"\"\n    filtered = []\n    no_filtered = []\n    uuids = {}\n\n    for uidentity in uidentities:\n        n = len(filtered)\n        filtered += matcher.filter(uidentity)\n\n        if len(filtered) > n:\n            uuids[uidentity.uuid] = uidentity\n        else:\n            no_filtered.append([uidentity])\n\n    return filtered, no_filtered, uuids", "entry_point": "_filter_unique_identities", "input": "[], []", "output": "([], [], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sortinghat/blob/391cd37a75fea26311dc6908bc1c953c540a8e04/sortinghat/matcher.py#L270-L292", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034387", "code": "def __marshal_matches(matched):\n        \"\"\"Convert matches to JSON format.\n\n        :param matched: a list of matched identities\n\n        :returns json_matches: a list of matches in JSON format\n        \"\"\"\n        json_matches = []\n        for m in matched:\n            identities = [i.uuid for i in m]\n\n            if len(identities) == 1:\n                continue\n\n            json_match = {\n                'identities': identities,\n                'processed': False\n            }\n            json_matches.append(json_match)\n\n        return json_matches", "entry_point": "__marshal_matches", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sortinghat/blob/391cd37a75fea26311dc6908bc1c953c540a8e04/sortinghat/cmd/unify.py#L248-L268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034388", "code": "def check_int(integer):\n    \"\"\"\n    Check if number is integer or not.\n\n    :param integer: Number as str\n    :return: Boolean\n    \"\"\"\n    if not isinstance(integer, str):\n        return False\n    if integer[0] in ('-', '+'):\n        return integer[1:].isdigit()\n    return integer.isdigit()", "entry_point": "check_int", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/tools/tools.py#L92-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034389", "code": "def combine_urls(path1, path2):\n    \"\"\"\n    Returns the combination of two urls and checks that there are no double slashes at the seam.\n    TODO: Extend to check for other anomalies as well.\n\n    :param path1: First part of the url\n    :param path2: Second part of the url\n    :return: Combination of the paths with double slashes removed\n    \"\"\"\n    if path1.endswith(\"/\") and path2.startswith(\"/\"):\n        path2 = path2.replace(\"/\", \"\", 1)\n    elif path1.endswith(\"/\") is False and path2.startswith(\"/\") is False:\n        path2 = \"/\" + path2\n    return path1 + path2", "entry_point": "combine_urls", "input": "'walnut thistle harbour', 'AbC dEf'", "output": "'walnut thistle harbour/AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/tools/tools.py#L334-L347", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034390", "code": "def _create_combined_set(words, startindex):\n    \"\"\"\n    Combines a single string wrapped in parenthesis from a list of words.\n    Example: ['feature1', 'or', '(feature2', 'and', 'feature3)'] -> '(feature2 and feature3)'\n    :param words: List of words\n    :param startindex: Index of starting parenthesis.\n    :return: string\n    \"\"\"\n    counter = 0\n    for i, word in enumerate(words[startindex:]):\n        if \")\" in word and counter == 0:\n            return \" \".join(words[startindex:startindex + i + 1]), i\n        elif \")\" in word and counter != 0:\n            amount = word.count(\")\")\n            counter -= amount\n        if \"(\" in word:\n            counter += word.count(\"(\")\n        if counter == 0:\n            return \" \".join(words[startindex:startindex + i + 1]), i\n    return None, 0", "entry_point": "_create_combined_set", "input": "[], 2", "output": "(None, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/tools/tools.py#L516-L535", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034391", "code": "def _create_combined_words(words, startindex):\n    \"\"\"\n    Helper for create_match_bool, used to combine words inside single quotes from a list into a\n    single string.\n    :param words: List of words.\n    :param startindex: Index where search is started.\n    :return: (str, int) or (None, 0) if no closing quote is found.\n    \"\"\"\n    for i, word in enumerate(words[startindex+1:]):\n        if \"'\" in word:\n            return \" \".join(words[startindex:startindex+i+2]), i+1\n    return None, 0", "entry_point": "_create_combined_words", "input": "[5, 3, 1, 4], 5", "output": "(None, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/tools/tools.py#L538-L549", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034392", "code": "def find_duplicate_keys(data):\n    \"\"\"\n    Find duplicate keys in a layer of ordered pairs. Intended as the object_pairs_hook callable\n    for json.load or loads.\n\n    :param data: ordered pairs\n    :return: Dictionary with no duplicate keys\n    :raises ValueError if duplicate keys are found\n    \"\"\"\n    out_dict = {}\n    for key, value in data:\n        if key in out_dict:\n            raise ValueError(\"Duplicate key: {}\".format(key))\n        out_dict[key] = value\n    return out_dict", "entry_point": "find_duplicate_keys", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/tools/tools.py#L613-L627", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034393", "code": "def __replace_base_variables(text, req_len, idx):\n        \"\"\"\n        Replace i and n in text with index+1 and req_len.\n\n        :param text: base text to modify\n        :param req_len: amount of required resources\n        :param idx: index of resource we are working on\n        :return: modified string\n        \"\"\"\n        return text \\\n            .replace(\"{i}\", str(idx + 1)) \\\n            .replace(\"{n}\", str(req_len))", "entry_point": "__replace_base_variables", "input": "'a,b,c', [1, 2, 3], -3", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/ResourceProvider/ResourceConfig.py#L193-L204", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034394", "code": "def contains_empty(features):\n    \"\"\"Check features data are not empty\n\n    :param features: The features data to check.\n    :type features: list of numpy arrays.\n\n    :return: True if one of the array is empty, False else.\n\n    \"\"\"\n    if not features:\n        return True\n    for feature in features:\n        if feature.shape[0] == 0:\n            return True\n    return False", "entry_point": "contains_empty", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bootphon/h5features/blob/d5f95db0f1cee58ac1ba4575d1212e796c39e1f9/h5features/features.py#L27-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034395", "code": "def clog2(num: int) -> int:\n    r\"\"\"Return the ceiling log base two of an integer :math:`\\ge 1`.\n\n    This function tells you the minimum dimension of a Boolean space with at\n    least N points.\n\n    For example, here are the values of ``clog2(N)`` for :math:`1 \\le N < 18`:\n\n    >>> [clog2(n) for n in range(1, 18)]\n    [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5]\n\n    This function is undefined for non-positive integers:\n\n    >>> clog2(0)\n    Traceback (most recent call last):\n        ...\n    ValueError: expected num >= 1\n    \"\"\"\n    if num < 1:\n        raise ValueError(\"expected num >= 1\")\n    accum, shifter = 0, 1\n    while num > shifter:\n        shifter <<= 1\n        accum += 1\n    return accum", "entry_point": "clog2", "input": "3", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/util.py#L29-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034396", "code": "def parity(num: int) -> int:\n    \"\"\"Return the parity of a non-negative integer.\n\n    For example, here are the parities of the first ten integers:\n\n    >>> [parity(n) for n in range(10)]\n    [0, 1, 1, 0, 1, 0, 0, 1, 1, 0]\n\n    This function is undefined for negative integers:\n\n    >>> parity(-1)\n    Traceback (most recent call last):\n        ...\n    ValueError: expected num >= 0\n    \"\"\"\n    if num < 0:\n        raise ValueError(\"expected num >= 0\")\n    par = 0\n    while num:\n        par ^= (num & 1)\n        num >>= 1\n    return par", "entry_point": "parity", "input": "3", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/util.py#L56-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034397", "code": "def point2term(point, conj=False):\n    \"\"\"Convert *point* into a min/max term.\n\n    If *conj* is ``False``, return a minterm.\n    Otherwise, return a maxterm.\n    \"\"\"\n    if conj:\n        return tuple(~v if val else v for v, val in point.items())\n    else:\n        return tuple(v if val else ~v for v, val in point.items())", "entry_point": "point2term", "input": "{}, set()", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/boolalg/boolfunc.py#L238-L247", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034398", "code": "def _bin_zfill(num, width=None):\n    \"\"\"Convert a base-10 number to a binary string.\n\n    Parameters\n    num: int\n    width: int, optional\n        Zero-extend the string to this width.\n    Examples\n    --------\n\n    >>> _bin_zfill(42)\n    '101010'\n    >>> _bin_zfill(42, 8)\n    '00101010'\n    \"\"\"\n    s = bin(num)[2:]\n    return s if width is None else s.zfill(width)", "entry_point": "_bin_zfill", "input": "0, 2", "output": "'00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/boolalg/table.py#L481-L497", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034399", "code": "def soln2point(soln, litmap):\n        \"\"\"Convert a solution vector to a point.\"\"\"\n        return {litmap[i]: int(val > 0)\n                for i, val in enumerate(soln, start=1)}", "entry_point": "soln2point", "input": "[], {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/boolalg/expr.py#L1398-L1401", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034400", "code": "def _volume(shape):\n    \"\"\"Return the volume of a shape.\"\"\"\n    prod = 1\n    for start, stop in shape:\n        prod *= stop - start\n    return prod", "entry_point": "_volume", "input": "[]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/boolalg/bfarray.py#L948-L953", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034401", "code": "def get_all_rotated_notes(notes):\n    \"\"\" Get all rotated notes\n\n    get_all_rotated_notes([1,3,5]) -> [[1,3,5],[3,5,1],[5,1,3]]\n\n    :type notes: list[str]\n    :rtype: list[list[str]]\n    \"\"\"\n    notes_list = []\n    for x in range(len(notes)):\n        notes_list.append(notes[x:] + notes[:x])\n    return notes_list", "entry_point": "get_all_rotated_notes", "input": "[1, 2, 3]", "output": "[[1, 2, 3], [2, 3, 1], [3, 1, 2]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yuma-m/pychord/blob/4aa39189082daae76e36a2701890f91776d86b47/pychord/analyzer.py#L57-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034402", "code": "def merge_data(path_data, request_data):\n    \"\"\"\n    Merge data from the URI path and the request.\n\n    Path data wins.\n\n    \"\"\"\n    merged = request_data.copy() if request_data else {}\n    merged.update(path_data or {})\n    return merged", "entry_point": "merge_data", "input": "0, {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/globality-corp/microcosm-flask/blob/c2eaf57f03e7d041eea343751a4a90fcc80df418/microcosm_flask/conventions/encoding.py#L157-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034403", "code": "def parse_response(response):\n    \"\"\"\n    Parse a Flask response into a body, a status code, and headers\n\n    The returned value from a Flask view could be:\n        * a tuple of (response, status) or (response, status, headers)\n        * a Response object\n        * a string\n    \"\"\"\n    if isinstance(response, tuple):\n        if len(response) > 2:\n            return response[0], response[1], response[2]\n        elif len(response) > 1:\n            return response[0], response[1], {}\n    try:\n        return response.data, response.status_code, response.headers\n    except AttributeError:\n        return response, 200, {}", "entry_point": "parse_response", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3], []], 200, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/globality-corp/microcosm-flask/blob/c2eaf57f03e7d041eea343751a4a90fcc80df418/microcosm_flask/audit.py#L335-L352", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034404", "code": "def extract_status_code(error):\n    \"\"\"\n    Extract an error code from a message.\n\n    \"\"\"\n    try:\n        return int(error.code)\n    except (AttributeError, TypeError, ValueError):\n        try:\n            return int(error.status_code)\n        except (AttributeError, TypeError, ValueError):\n            try:\n                return int(error.errno)\n            except (AttributeError, TypeError, ValueError):\n                return 500", "entry_point": "extract_status_code", "input": "[1, 2, 3]", "output": "500", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/globality-corp/microcosm-flask/blob/c2eaf57f03e7d041eea343751a4a90fcc80df418/microcosm_flask/errors.py#L42-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034405", "code": "def strip_wrapping(html):\n    \"\"\"\n    Removes the wrapping that might have resulted when using get_html_tree().\n    \"\"\"\n    if html.startswith('<div>') and html.endswith('</div>'):\n        html = html[5:-6]\n    return html.strip()", "entry_point": "strip_wrapping", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/closeio/quotequail/blob/8a3960c033d595b25a8bbc2c340be898e3065b5f/quotequail/_html.py#L212-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034406", "code": "def merge_dictionaries(base_dict, extra_dict):\n    \"\"\"\n    merge two dictionaries.\n\n    if both have a same key, the one from extra_dict is taken\n\n    :param base_dict: first dictionary\n    :type base_dict: dict\n    :param extra_dict: second dictionary\n    :type extra_dict: dict\n    :return: a merge of the two dictionaries\n    :rtype: dicts\n    \"\"\"\n    new_dict = base_dict.copy()\n    new_dict.update(extra_dict)\n    return new_dict", "entry_point": "merge_dictionaries", "input": "{'a': 1, 'b': 2}, {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/metadata35/utils.py#L112-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034407", "code": "def create_module_rst_file(module_name):\n    \"\"\"Function for creating content in each .rst file for a module.\n\n    :param module_name: name of the module.\n    :type module_name: str\n\n    :returns: A content for auto module.\n    :rtype: str\n    \"\"\"\n\n    return_text = 'Module:  ' + module_name\n    dash = '=' * len(return_text)\n    return_text += '\\n' + dash + '\\n\\n'\n    return_text += '.. automodule:: ' + module_name + '\\n'\n    return_text += '   :members:\\n\\n'\n\n    return return_text", "entry_point": "create_module_rst_file", "input": "'Hello World'", "output": "'Module:  Hello World\\n====================\\n\\n.. automodule:: Hello World\\n   :members:\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/scripts/create_api_docs.py#L88-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034408", "code": "def get_python_files_from_list(files, excluded_files=None):\n    \"\"\"Return list of python file from files, without excluded files.\n\n    :param files: List of files.\n    :type files: list\n\n    :param excluded_files: List of excluded file names.\n    :type excluded_files: list, None\n\n    :returns: List of python file without the excluded file, not started with\n        test.\n    :rtype: list\n    \"\"\"\n    if excluded_files is None:\n        excluded_files = ['__init__.py']\n    python_files = []\n    for fl in files:\n        if (fl.endswith('.py')\n                and fl not in excluded_files\n                and not fl.startswith('test')):\n            python_files.append(fl)\n\n    return python_files", "entry_point": "get_python_files_from_list", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/scripts/create_api_docs.py#L136-L158", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034409", "code": "def headerize(provenances):\n    \"\"\"Create a header for each keyword.\n\n    :param provenances: The keywords.\n    :type provenances: dict\n\n    :return: New keywords with header for every keyword.\n    :rtype: dict\n    \"\"\"\n\n    special_case = {\n        'Inasafe': 'InaSAFE',\n        'Qgis': 'QGIS',\n        'Pyqt': 'PyQt',\n        'Os': 'OS',\n        'Gdal': 'GDAL',\n        'Maps': 'Map'\n    }\n    for key, value in list(provenances.items()):\n        if '_' in key:\n            header = key.replace('_', ' ').title()\n        else:\n            header = key.title()\n\n        header_list = header.split(' ')\n        proper_word = None\n        proper_word_index = None\n        for index, word in enumerate(header_list):\n            if word in list(special_case.keys()):\n                proper_word = special_case[word]\n                proper_word_index = index\n\n        if proper_word:\n            header_list[proper_word_index] = proper_word\n\n        header = ' '.join(header_list)\n\n        provenances.update(\n            {\n                key: {\n                    'header': '{header} '.format(header=header),\n                    'content': value\n                }\n            })\n\n    return provenances", "entry_point": "headerize", "input": "{'a': 1, 'b': 2}", "output": "{'a': {'header': 'A ', 'content': 1}, 'b': {'header': 'B ', 'content': 2}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/report/extractors/analysis_provenance_details.py#L419-L464", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034410", "code": "def __if_not_basestring(text_object):\n    \"\"\"Convert to str\"\"\"\n    converted_str = text_object\n    if not isinstance(text_object, str):\n        converted_str = str(text_object)\n    return converted_str", "entry_point": "__if_not_basestring", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/utilities/unicode.py#L25-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034411", "code": "def get_unicode(input_text, encoding='utf-8'):\n    \"\"\"Get the unicode (str) representation of an object.\n\n    :param input_text: The input text.\n    :type input_text: unicode, str, float, int\n\n    :param encoding: The encoding used to do the conversion, default to utf-8.\n    :type encoding: str\n\n    :returns: Unicode representation of the input.\n    :rtype: str\n    \"\"\"\n    if isinstance(input_text, str):\n        return input_text\n    return str(input_text, encoding, errors='ignore')", "entry_point": "get_unicode", "input": "'  padded  ', [[1, 2], [3], []]", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/utilities/unicode.py#L33-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034412", "code": "def get_string(input_text, encoding='utf-8'):\n    \"\"\"Get byte string representation of an object.\n\n    :param input_text:  The input text.\n    :type input_text: unicode, str, float, int\n\n    :param encoding: The encoding used to do the conversion, default to utf-8.\n    :type encoding: str\n\n    :returns: Byte string representation of the input.\n    :rtype: bytes\n    \"\"\"\n    if isinstance(input_text, str):\n        return input_text.encode(encoding)\n    return input_text", "entry_point": "get_string", "input": "3, True", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/utilities/unicode.py#L50-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034413", "code": "def create_label(label_tuple, extra_label=None):\n    \"\"\"Return a label based on my_tuple (a,b) and extra label.\n\n    a and b are string.\n\n    The output will be something like:\n                [a - b] extra_label\n    \"\"\"\n    if extra_label is not None:\n        return '[' + ' - '.join(label_tuple) + '] ' + str(extra_label)\n    else:\n        return '[' + ' - '.join(label_tuple) + ']'", "entry_point": "create_label", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "\"[apple - banana - cherry] ['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/common/utilities.py#L466-L477", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034414", "code": "def romanise(number):\n    \"\"\"Return the roman numeral for a number.\n\n    Note that this only works for number in interval range [0, 12] since at\n    the moment we only use it on realtime earthquake to conver MMI value.\n\n    :param number: The number that will be romanised\n    :type number: float\n\n    :return Roman numeral equivalent of the value\n    :rtype: str\n    \"\"\"\n    if number is None:\n        return ''\n\n    roman_list = ['0', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII',\n                  'IX', 'X', 'XI', 'XII']\n    try:\n        roman = roman_list[int(number)]\n    except ValueError:\n        return None\n    return roman", "entry_point": "romanise", "input": "10", "output": "'X'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/common/utilities.py#L625-L646", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034415", "code": "def decode_full_layer_uri(full_layer_uri_string):\n    \"\"\"Decode the full layer URI.\n\n    :param full_layer_uri_string: The full URI provided by our helper.\n    :type full_layer_uri_string: basestring\n\n    :return: A tuple with the QGIS URI and the provider key.\n    :rtype: tuple\n    \"\"\"\n    if not full_layer_uri_string:\n        return None, None\n\n    split = full_layer_uri_string.split('|qgis_provider=')\n    if len(split) == 1:\n        return split[0], None\n    else:\n        return split", "entry_point": "decode_full_layer_uri", "input": "'a,b,c'", "output": "('a,b,c', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/gis/tools.py#L147-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034416", "code": "def skip_inasafe_field(layer, inasafe_fields):\n    \"\"\"Check if it possible to skip inasafe field step.\n\n    The function will check if the layer has a specified field type.\n\n    :param layer: A Qgis Vector Layer.\n    :type layer: QgsVectorLayer\n\n    :param inasafe_fields: List of non compulsory InaSAFE fields default.\n    :type inasafe_fields: list\n\n    :returns: True if there are no specified field type.\n    :rtype: bool\n    \"\"\"\n    # Iterate through all inasafe fields\n    for inasafe_field in inasafe_fields:\n        for field in layer.fields():\n            # Check the field type\n            if isinstance(inasafe_field['type'], list):\n                if field.type() in inasafe_field['type']:\n                    return False\n            else:\n                if field.type() == inasafe_field['type']:\n                    return False\n    return True", "entry_point": "skip_inasafe_field", "input": "'  padded  ', []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/gui/tools/wizard/utilities.py#L224-L248", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034417", "code": "def validate_geo_array(extent):\n    \"\"\"Validate a geographic extent.\n\n    .. versionadded:: 3.2\n\n    :param extent: A list in the form [xmin, ymin, xmax, ymax] where all\n        coordinates provided are in Geographic / EPSG:4326.\n    :type extent: list\n\n    :return: True if the extent is valid, otherwise False\n    :rtype: bool\n    \"\"\"\n    min_longitude = extent[0]\n    min_latitude = extent[1]\n    max_longitude = extent[2]\n    max_latitude = extent[3]\n\n    # min_latitude < max_latitude\n    if min_latitude >= max_latitude:\n        return False\n\n    # min_longitude < max_longitude\n    if min_longitude >= max_longitude:\n        return False\n\n    # -90 <= latitude <= 90\n    if min_latitude < -90 or min_latitude > 90:\n        return False\n    if max_latitude < -90 or max_latitude > 90:\n        return False\n\n    # -180 <= longitude <= 180\n    if min_longitude < -180 or min_longitude > 180:\n        return False\n    if max_longitude < -180 or max_longitude > 180:\n        return False\n\n    return True", "entry_point": "validate_geo_array", "input": "[-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/utilities/gis.py#L138-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034418", "code": "def clean_line(str, delimiter):\n    \"\"\"Split string on given delimiter, remove whitespace from each field.\"\"\"\n\n    return [x.strip() for x in str.strip().split(delimiter) if x != '']", "entry_point": "clean_line", "input": "'AbC dEf', 'a,b,c'", "output": "['AbC dEf']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/extras/system_tools.py#L112-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034419", "code": "def resolve_from_dictionary(dictionary, key_list, default_value=None):\n    \"\"\"Take value from a given key list from dictionary.\n\n    Example: given dictionary d, key_list = ['foo', 'bar'],\n    it will try to resolve d['foo']['bar']. If not possible,\n    return default_value.\n\n    :param dictionary: A dictionary to resolve.\n    :type dictionary: dict\n\n    :param key_list: A list of key to resolve.\n    :type key_list: list[str], str\n\n    :param default_value: Any arbitrary default value to return.\n\n    :return: intended value, if fails, return default_value.\n\n    .. versionadded:: 4.0\n    \"\"\"\n    try:\n        current_value = dictionary\n        key_list = key_list if isinstance(key_list, list) else [key_list]\n        for key in key_list:\n            current_value = current_value[key]\n\n        return current_value\n    except KeyError:\n        return default_value", "entry_point": "resolve_from_dictionary", "input": "{'a': 1, 'b': 2}, [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/report/extractors/util.py#L134-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034420", "code": "def data_in_db(db_data, user_data):\n        \"\"\"Validate db data in user data.\n\n        Args:\n            db_data (str): The data store in Redis.\n            user_data (list): The user provided data.\n\n        Returns:\n            bool: True if the data passed validation.\n        \"\"\"\n        if isinstance(user_data, list):\n            if db_data in user_data:\n                return True\n        return False", "entry_point": "data_in_db", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_bin_run.py#L356-L369", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034421", "code": "def data_kva_compare(db_data, user_data):\n        \"\"\"Validate key/value data in KeyValueArray.\n\n        Args:\n            db_data (list): The data store in Redis.\n            user_data (dict): The user provided data.\n\n        Returns:\n            bool: True if the data passed validation.\n        \"\"\"\n        for kv_data in db_data:\n            if kv_data.get('key') == user_data.get('key'):\n                if kv_data.get('value') == user_data.get('value'):\n                    return True\n        return False", "entry_point": "data_kva_compare", "input": "[], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_bin_run.py#L428-L442", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034422", "code": "def data_not_in(db_data, user_data):\n        \"\"\"Validate data not in user data.\n\n        Args:\n            db_data (str): The data store in Redis.\n            user_data (list): The user provided data.\n\n        Returns:\n            bool: True if the data passed validation.\n        \"\"\"\n        if isinstance(user_data, list):\n            if db_data not in user_data:\n                return True\n        return False", "entry_point": "data_not_in", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_bin_run.py#L445-L458", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034423", "code": "def profile_args(_args):\n        \"\"\"Return args for v1, v2, or v3 structure.\n\n        Args:\n            _args (dict): The args section from the profile.\n\n        Returns:\n            dict: A collapsed version of the args dict.\n        \"\"\"\n        # TODO: clean this up in a way that works for both py2/3\n        if (\n            _args.get('app', {}).get('optional') is not None\n            or _args.get('app', {}).get('required') is not None\n        ):\n            # detect v3 schema\n            app_args_optional = _args.get('app', {}).get('optional', {})\n            app_args_required = _args.get('app', {}).get('required', {})\n            default_args = _args.get('default', {})\n            _args = {}\n            _args.update(app_args_optional)\n            _args.update(app_args_required)\n            _args.update(default_args)\n        elif _args.get('app') is not None and _args.get('default') is not None:\n            # detect v2 schema\n            app_args = _args.get('app', {})\n            default_args = _args.get('default', {})\n            _args = {}\n            _args.update(app_args)\n            _args.update(default_args)\n\n        return _args", "entry_point": "profile_args", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_bin_run.py#L685-L715", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034424", "code": "def entity_to_bulk(entities, resource_type_parent):\n        \"\"\"Convert Single TC Entity to Bulk format.\n\n        .. Attention:: This method is subject to frequent changes\n\n        Args:\n            entities (dictionary): TC Entity to be converted to Bulk.\n            resource_type_parent (string): The resource parent type of the tc_data provided.\n\n        Returns:\n            (dictionary): A dictionary representing TC Bulk format.\n        \"\"\"\n        if not isinstance(entities, list):\n            entities = [entities]\n\n        bulk_array = []\n        for e in entities:\n            bulk = {'type': e.get('type'), 'ownerName': e.get('ownerName')}\n            if resource_type_parent in ['Group', 'Task', 'Victim']:\n                bulk['name'] = e.get('value')\n            elif resource_type_parent in ['Indicator']:\n                bulk['confidence'] = e.get('confidence')\n                bulk['rating'] = e.get('rating')\n                bulk['summary'] = e.get('value')\n\n            bulk_array.append(bulk)\n\n        if len(bulk_array) == 1:\n            return bulk_array[0]\n        return bulk_array", "entry_point": "entity_to_bulk", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_playbook.py#L1057-L1086", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034425", "code": "def indicator_arrays(tc_entity_array):\n        \"\"\"Convert TCEntityArray to Indicator Type dictionary.\n\n        Args:\n            tc_entity_array (dictionary): The TCEntityArray to convert.\n\n        Returns:\n            (dictionary): Dictionary containing arrays of indicators for each indicator type.\n        \"\"\"\n        type_dict = {}\n        for ea in tc_entity_array:\n            type_dict.setdefault(ea['type'], []).append(ea['value'])\n        return type_dict", "entry_point": "indicator_arrays", "input": "()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_playbook.py#L1089-L1101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034426", "code": "def to_bool(value):\n        \"\"\"Convert string value to bool.\"\"\"\n        bool_value = False\n        if str(value).lower() in ['1', 'true']:\n            bool_value = True\n        return bool_value", "entry_point": "to_bool", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_utils.py#L285-L290", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034427", "code": "def safe_group_name(group_name, group_max_length=100, ellipsis=True):\n        \"\"\"Truncate group name to match limit breaking on space and optionally add an ellipsis.\n\n        .. note:: Currently the ThreatConnect group name limit is 100 characters.\n\n        Args:\n           group_name (string): The raw group name to be truncated.\n           group_max_length (int): The max length of the group name.\n           ellipsis (boolean): If true the truncated name will have '...' appended.\n\n        Returns:\n            (string): The truncated group name with optional ellipsis.\n        \"\"\"\n        ellipsis_value = ''\n        if ellipsis:\n            ellipsis_value = ' ...'\n\n        if group_name is not None and len(group_name) > group_max_length:\n            # split name by spaces and reset group_name\n            group_name_array = group_name.split(' ')\n            group_name = ''\n            for word in group_name_array:\n                word = u'{}'.format(word)\n                if (len(group_name) + len(word) + len(ellipsis_value)) >= group_max_length:\n                    group_name = '{}{}'.format(group_name, ellipsis_value)\n                    group_name = group_name.lstrip(' ')\n                    break\n                group_name += ' {}'.format(word)\n        return group_name", "entry_point": "safe_group_name", "input": "'AbC dEf', 5, [5, 3, 1, 4]", "output": "'...'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex.py#L930-L958", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034428", "code": "def _to_bool(value):\n        \"\"\"Convert string value to bool.\"\"\"\n        bool_value = False\n        if str(value).lower() in ['1', 'true']:\n            bool_value = True\n        return bool_value", "entry_point": "_to_bool", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_bin_profile.py#L55-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034429", "code": "def _in(field, filter_value):\n        \"\"\"Validate field **IN** string or list.\n\n        Args:\n            filter_value (string | list): A string or list of values.\n\n        Returns:\n            (boolean): Results of check\n        \"\"\"\n        valid = False\n        if field in filter_value:\n            valid = True\n        return valid", "entry_point": "_in", "input": "[], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_data_filter.py#L60-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034430", "code": "def _ni(field, filter_value):\n        \"\"\"Validate field **NOT IN** string or list.\n\n        Args:\n            filter_value (string | list): A string or list of values.\n\n        Returns:\n            (boolean): Results of validation\n        \"\"\"\n        valid = False\n        if field not in filter_value:\n            valid = True\n        return valid", "entry_point": "_ni", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_data_filter.py#L140-L152", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034431", "code": "def results(data):\n        \"\"\"Results\"\"\"\n        cdata = []\n        for r in data:\n            cdata.append(r.data)\n        return cdata", "entry_point": "results", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ThreatConnect-Inc/tcex/blob/dd4d7a1ef723af1561687120191886b9a2fd4b47/tcex/tcex_data_filter.py#L241-L246", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034432", "code": "def _parse_integrator(int_method):\n    \"\"\"parse the integrator method to pass to C\"\"\"\n    #Pick integrator\n    if int_method.lower() == 'rk4_c':\n        int_method_c= 1\n    elif int_method.lower() == 'rk6_c':\n        int_method_c= 2\n    elif int_method.lower() == 'symplec4_c':\n        int_method_c= 3\n    elif int_method.lower() == 'symplec6_c':\n        int_method_c= 4\n    elif int_method.lower() == 'dopr54_c':\n        int_method_c= 5\n    elif int_method.lower() == 'dop853_c':\n        int_method_c= 6\n    else:\n        int_method_c= 0\n    return int_method_c", "entry_point": "_parse_integrator", "input": "'abc'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jobovy/galpy/blob/9c5b9fe65d58835624dffe432be282060918ee08/galpy/orbit/integratePlanarOrbit.py#L310-L327", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034433", "code": "def get_loggable_url(url):\n    \"\"\"Strip out secrets from taskcluster urls.\n\n    Args:\n        url (str): the url to strip\n\n    Returns:\n        str: the loggable url\n\n    \"\"\"\n    loggable_url = url or \"\"\n    for secret_string in (\"bewit=\", \"AWSAccessKeyId=\", \"access_token=\"):\n        parts = loggable_url.split(secret_string)\n        loggable_url = parts[0]\n    if loggable_url != url:\n        loggable_url = \"{}<snip>\".format(loggable_url)\n    return loggable_url", "entry_point": "get_loggable_url", "input": "[]", "output": "'<snip>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mozilla-releng/scriptworker/blob/8e97bbd83b9b578565ec57904c966dd6ae4ef0ae/scriptworker/utils.py#L573-L589", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034434", "code": "def cdn_cache_control(val):\n  \"\"\"Translate cdn_cache into a Cache-Control HTTP header.\"\"\"\n  if val is None:\n    return 'max-age=3600, s-max-age=3600'\n  elif type(val) is str:\n    return val\n  elif type(val) is bool:\n    if val:\n      return 'max-age=3600, s-max-age=3600'\n    else:\n      return 'no-cache'\n  elif type(val) is int:\n    if val < 0:\n      raise ValueError('cdn_cache must be a positive integer, boolean, or string. Got: ' + str(val))\n\n    if val == 0:\n      return 'no-cache'\n    else:\n      return 'max-age={}, s-max-age={}'.format(val, val)\n  else:\n    raise NotImplementedError(type(val) + ' is not a supported cache_control setting.')", "entry_point": "cdn_cache_control", "input": "1", "output": "'max-age=1, s-max-age=1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seung-lab/cloud-volume/blob/d2fd4500333f1bc3cd3e3919a8b649cec5d8e214/cloudvolume/txrx.py#L241-L261", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034435", "code": "def _hash_item(item):\n    \"\"\"\n    Hash an item (CIM value, CIM object), by delegating to its hash function.\n\n    The item may be `None`.\n    \"\"\"\n    if isinstance(item, list):\n        item = tuple(item)\n    return hash(item)", "entry_point": "_hash_item", "input": "[5, 3, 1, 4]", "output": "4948089822847775986", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_utils.py#L111-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034436", "code": "def kids(tup_tree):\n    \"\"\"\n    Return a list with the child elements of tup_tree.\n\n    The child elements are represented as tupletree nodes.\n\n    Child nodes that are not XML elements (e.g. text nodes) in tup_tree are\n    filtered out.\n    \"\"\"\n    k = tup_tree[2]\n    if k is None:\n        return []\n    # pylint: disable=unidiomatic-typecheck\n    return [x for x in k if type(x) == tuple]", "entry_point": "kids", "input": "[[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L117-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034437", "code": "def _make_pull_imethod_resp(objs, eos, context_id):\n        \"\"\"\n        Create the correct imethod response for the open and pull methods\n        \"\"\"\n        eos_tup = (u'EndOfSequence', None, eos)\n        enum_ctxt_tup = (u'EnumerationContext', None, context_id)\n\n        return [(\"IRETURNVALUE\", {}, objs), enum_ctxt_tup, eos_tup]", "entry_point": "_make_pull_imethod_resp", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2], 'Hello World'", "output": "[('IRETURNVALUE', {}, [-1, 0, 1, 2]), ('EnumerationContext', None, 'Hello World'), ('EndOfSequence', None, [-1, 0, 1, 2])]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem_mock/_wbemconnection_mock.py#L3025-L3032", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034438", "code": "def cmpname(name1, name2):\n    \"\"\"\n    Compare two CIM names for equality and ordering.\n\n    The comparison is performed case-insensitively.\n\n    One or both of the items may be `None`, and `None` is considered the lowest\n    possible value.\n\n    The implementation delegates to the '==' and '<' operators of the\n    name datatypes.\n\n    If name1 == name2, 0 is returned.\n    If name1 < name2, -1 is returned.\n    Otherwise, +1 is returned.\n    \"\"\"\n    if name1 is None and name2 is None:\n        return 0\n    if name1 is None:\n        return -1\n    if name2 is None:\n        return 1\n    lower_name1 = name1.lower()\n    lower_name2 = name2.lower()\n    if lower_name1 == lower_name2:\n        return 0\n    return -1 if lower_name1 < lower_name2 else 1", "entry_point": "cmpname", "input": "'abc', 'a,b,c'", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_obj.py#L341-L367", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034439", "code": "def _partition(str_arg, sep):\n    \"\"\"\n    _partition(str_arg, sep) -> (head, sep, tail)\n\n    Searches for the first occurrence of the separator sep in str_arg, and\n    returns the, part before it, the separator itself, and the part after it.\n\n    If the separator is not found, returns str_arg and two empty strings.\n    \"\"\"\n    try:\n        return str_arg.partition(sep)\n    except AttributeError:\n        try:\n            idx = str_arg.index(sep)\n        except ValueError:\n            return (str_arg, '', '')\n        return (str_arg[:idx], sep, str_arg[idx + len(sep):])", "entry_point": "_partition", "input": "[], ''", "output": "([], '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_obj.py#L8134-L8150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034440", "code": "def derive_resource_name(name):\n    \"\"\"A stable, human-readable name and identifier for a resource.\"\"\"\n    if name.startswith(\"Anon\"):\n        name = name[4:]\n    if name.endswith(\"Handler\"):\n        name = name[:-7]\n    if name == \"Maas\":\n        name = \"MAAS\"\n    return name", "entry_point": "derive_resource_name", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maas/python-libmaas/blob/4092c68ef7fb1753efc843569848e2bcc3415002/maas/client/bones/helpers.py#L74-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034441", "code": "def remove_None(params: dict):\n    \"\"\"Remove all keys in `params` that have the value of `None`.\"\"\"\n    return {\n        key: value\n        for key, value in params.items()\n        if value is not None\n    }", "entry_point": "remove_None", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maas/python-libmaas/blob/4092c68ef7fb1753efc843569848e2bcc3415002/maas/client/utils/__init__.py#L325-L331", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034442", "code": "def build_url_base(host, port, is_https):\n    \"\"\"\n    Make base of url based on config\n    \"\"\"\n    base = \"http\"\n    if is_https:\n        base += 's'\n\n    base += \"://\"\n    base += host\n\n    if port:\n        base += \":\"\n        base += str(port)\n\n    return base", "entry_point": "build_url_base", "input": "'abc', (), 'abc'", "output": "'https://abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fbradyirl/hikvision/blob/3bc3b20b8f7d793cf9dd94777e4b8e82bfd4abc6/hikvision/api.py#L27-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034443", "code": "def _clean_dict(row):\n    \"\"\"\n    Transform empty strings values of dict `row` to None.\n    \"\"\"\n    row_cleaned = {}\n    for key, val in row.items():\n        if val is None or val == '':\n            row_cleaned[key] = None\n        else:\n            row_cleaned[key] = val\n    return row_cleaned", "entry_point": "_clean_dict", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/learningequality/ricecooker/blob/2f0385282500cb77ef2894646c6f9ce11bd7a853/ricecooker/utils/metadata_provider.py#L886-L896", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034444", "code": "def clean_single_dict(indict, prepend_to_keys=None, remove_keys_containing=None):\n    \"\"\"Clean a dict with values that contain single item iterators to single items\n\n    Args:\n        indict (dict): Dictionary to be cleaned\n        prepend_to_keys (str): String to prepend to all keys\n        remove_keys_containing (str): Text to check for in keys to ignore\n\n    Returns:\n         dict: Cleaned dictionary\n\n    Examples:\n        >>> clean_single_dict(indict={'test1': [1], 'test2': ['H']})\n        {'test1': 1, 'test2': 'H'}\n\n        >>> clean_single_dict(indict={'test1': [1], 'test2': ['H']}, prepend_to_keys='struct_')\n        {'struct_test1': 1, 'struct_test2': 'H'}\n\n        >>> clean_single_dict(indict={'test1': [1], 'ignore': ['H']}, prepend_to_keys='struct_', remove_keys_containing='ignore')\n        {'struct_test1': 1}\n\n    \"\"\"\n    if not prepend_to_keys:\n        prepend_to_keys = ''\n\n    outdict = {}\n    for k, v in indict.items():\n        if remove_keys_containing:\n            if remove_keys_containing in k:\n                continue\n        outdict[prepend_to_keys + k] = v[0]\n\n    return outdict", "entry_point": "clean_single_dict", "input": "{}, ['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/utils.py#L153-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034445", "code": "def filter_list_by_indices(lst, indices):\n    \"\"\"Return a modified list containing only the indices indicated.\n\n    Args:\n        lst: Original list of values\n        indices: List of indices to keep from the original list\n\n    Returns:\n        list: Filtered list of values\n\n    \"\"\"\n    return [x for i, x in enumerate(lst) if i in indices]", "entry_point": "filter_list_by_indices", "input": "['a', 'b', 'c'], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/utils.py#L646-L657", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034446", "code": "def force_string(val=None):\n    \"\"\"Force a string representation of an object\n\n    Args:\n        val: object to parse into a string\n\n    Returns:\n        str: String representation\n\n    \"\"\"\n    if val is None:\n        return ''\n    if isinstance(val, list):\n        newval = [str(x) for x in val]\n        return ';'.join(newval)\n    if isinstance(val, str):\n        return val\n    else:\n        return str(val)", "entry_point": "force_string", "input": "[1, 2, 3]", "output": "'1;2;3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/utils.py#L660-L678", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034447", "code": "def split_list_by_n(l, n):\n    \"\"\"Split a list into lists of size n.\n\n    Args:\n        l: List of stuff.\n        n: Size of new lists.\n\n    Returns:\n        list: List of lists each of size n derived from l.\n\n    \"\"\"\n    n = max(1, n)\n    return list(l[i:i+n] for i in range(0, len(l), n))", "entry_point": "split_list_by_n", "input": "[1, 2, 3], True", "output": "[[1], [2], [3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/utils.py#L723-L735", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034448", "code": "def flatlist_dropdup(list_of_lists):\n    \"\"\"Make a single list out of a list of lists, and drop all duplicates.\n\n    Args:\n        list_of_lists: List of lists.\n\n    Returns:\n        list: List of single objects.\n\n    \"\"\"\n    return list(set([str(item) for sublist in list_of_lists for item in sublist]))", "entry_point": "flatlist_dropdup", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/utils.py#L788-L798", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034449", "code": "def get_percent_identity(a_aln_seq, b_aln_seq):\n    \"\"\"Get the percent identity between two alignment strings\"\"\"\n\n    if len(a_aln_seq) != len(b_aln_seq):\n        raise ValueError('Sequence lengths not equal - was an alignment run?')\n\n    count = 0\n    gaps = 0\n    for n in range(0, len(a_aln_seq)):\n        if a_aln_seq[n] == b_aln_seq[n]:\n            if a_aln_seq[n] != \"-\":\n                count += 1\n            else:\n                gaps += 1\n\n    return count / float((len(a_aln_seq) - gaps))", "entry_point": "get_percent_identity", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/protein/sequence/utils/alignment.py#L232-L247", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034450", "code": "def label_TM_tmhmm_residue_numbers_and_leaflets(tmhmm_seq):\n    \"\"\"Determine the residue numbers of the TM-helix residues that cross the membrane and label them by leaflet.\n\n    Args:\n        tmhmm_seq: g.protein.representative_sequence.seq_record.letter_annotations['TM-tmhmm']\n\n    Returns:\n        leaflet_dict: a dictionary with leaflet_variable : [residue list] where the variable is inside or outside\n        TM_boundary dict: outputs a dictionar with : TM helix number : [TM helix residue start , TM helix residue end]\n\n    TODO:\n        untested method!\n    \"\"\"\n\n    TM_number_dict = {}\n    T_index = []\n    T_residue = []\n\n    residue_count = 1\n    for residue_label in tmhmm_seq:\n        if residue_label == 'T':\n            T_residue.append(residue_count)\n\n        residue_count = residue_count + 1\n    TM_number_dict.update({'T_residue': T_residue})\n\n    # finding the TM boundaries\n    T_residue_list = TM_number_dict['T_residue']\n\n    count = 0\n    max_count = len(T_residue_list) - 1\n    TM_helix_count = 0\n    TM_boundary_dict = {}\n\n    while count <= max_count:\n        # first residue = TM start\n        if count == 0:\n            TM_start = T_residue_list[count]\n            count = count + 1\n            continue\n        # Last residue = TM end\n        elif count == max_count:\n            TM_end = T_residue_list[count]\n            TM_helix_count = TM_helix_count + 1\n            TM_boundary_dict.update({'TM_helix_' + str(TM_helix_count): [TM_start, TM_end]})\n            break\n        # middle residues need to be start or end\n        elif T_residue_list[count] != T_residue_list[count + 1] - 1:\n            TM_end = T_residue_list[count]\n            TM_helix_count = TM_helix_count + 1\n            TM_boundary_dict.update({'TM_helix_' + str(TM_helix_count): [TM_start, TM_end]})\n            # new TM_start\n            TM_start = T_residue_list[count + 1]\n        count = count + 1\n    # assign leaflet to proper TM residues O or I\n    leaflet_dict = {}\n    for leaflet in ['O', 'I']:\n        leaflet_list = []\n        for TM_helix, TM_residues in TM_boundary_dict.items():\n            for residue_num in TM_residues:\n                tmhmm_seq_index = residue_num - 1\n                previous_residue = tmhmm_seq_index - 1\n                next_residue = tmhmm_seq_index + 1\n                # identify if the previous or next residue closest to the TM helix start/end is the proper leaflet\n                if tmhmm_seq[previous_residue] == leaflet or tmhmm_seq[next_residue] == leaflet:\n                    leaflet_list.append(residue_num)\n        leaflet_dict.update({'tmhmm_leaflet_' + leaflet: leaflet_list})\n\n    return TM_boundary_dict, leaflet_dict", "entry_point": "label_TM_tmhmm_residue_numbers_and_leaflets", "input": "['apple', 'banana', 'cherry']", "output": "({}, {'tmhmm_leaflet_O': [], 'tmhmm_leaflet_I': []})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SBRG/ssbio/blob/e9449e64ffc1a1f5ad07e5849aa12a650095f8a2/ssbio/protein/sequence/properties/tmhmm.py#L101-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034451", "code": "def get_factory_object_name(namespace):\n    \"Returns the correct factory object for a given namespace\"\n    \n    factory_map = {\n        'http://www.opengis.net/kml/2.2': 'KML',\n        'http://www.w3.org/2005/Atom': 'ATOM',\n        'http://www.google.com/kml/ext/2.2': 'GX'\n    }\n    if namespace:\n        if factory_map.has_key(namespace):\n            factory_object_name = factory_map[namespace]\n        else:\n            factory_object_name = None\n    else:\n        # use the KML factory object as the default, if no namespace is given\n        factory_object_name = 'KML'\n    return factory_object_name", "entry_point": "get_factory_object_name", "input": "''", "output": "'KML'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/grst/geos/blob/ea15abcc5d8f86c9051df55e489b7d941b51a638/pykml_geos/factory.py#L39-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034452", "code": "def docstring_to_markdown(docstring):\n    \"\"\"Convert a Python object's docstring to markdown\n\n    Parameters\n    ----------\n    docstring : str\n        The docstring body.\n\n    Returns\n    ----------\n    clean_lst : list\n        The markdown formatted docstring as lines (str) in a Python list.\n\n    \"\"\"\n    new_docstring_lst = []\n\n    for idx, line in enumerate(docstring.split('\\n')):\n        line = line.strip()\n        if set(line) in ({'-'}, {'='}):\n            new_docstring_lst[idx-1] = '**%s**' % new_docstring_lst[idx-1]\n        elif line.startswith('>>>'):\n            line = '    %s' % line\n        new_docstring_lst.append(line)\n\n    for idx, line in enumerate(new_docstring_lst[1:]):\n        if line:\n            if line.startswith('Description : '):\n                new_docstring_lst[idx+1] = (new_docstring_lst[idx+1]\n                                            .replace('Description : ', ''))\n            elif ' : ' in line:\n                line = line.replace(' : ', '` : ')\n                new_docstring_lst[idx+1] = '\\n- `%s\\n' % line\n            elif '**' in new_docstring_lst[idx-1] and '**' not in line:\n                new_docstring_lst[idx+1] = '\\n%s' % line.lstrip()\n            elif '**' not in line:\n                new_docstring_lst[idx+1] = '    %s' % line.lstrip()\n\n    clean_lst = []\n    for line in new_docstring_lst:\n        if set(line.strip()) not in ({'-'}, {'='}):\n            clean_lst.append(line)\n    return clean_lst", "entry_point": "docstring_to_markdown", "input": "'Hello World'", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rasbt/biopandas/blob/615a7cf272692c12bbcfd9d1f217eab440120235/docs/make_api.py#L24-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034453", "code": "def upper_lower_none(arg):\n    \"\"\"Validate arg value as \"upper\", \"lower\", or None.\"\"\"\n    if not arg:\n        return arg\n\n    arg = arg.strip().lower()\n    if arg in ['upper', 'lower']:\n        return arg\n\n    raise ValueError('argument must be \"upper\", \"lower\" or None')", "entry_point": "upper_lower_none", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/willkg/everett/blob/5653134af59f439d2b33f3939fab2b8544428f11/everett/sphinxext.py#L167-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034454", "code": "def add(a, b):\n    \"\"\" Add two values, ignoring None \"\"\"\n    if a is None:\n        if b is None:\n            return None\n        else:\n            return b\n    elif b is None:\n        return a\n    return a + b", "entry_point": "add", "input": "[], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevearc/dql/blob/e9d3aa22873076dae5ebd02e35318aa996b1e56a/dql/expressions/selection.py#L16-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034455", "code": "def sub(a, b):\n    \"\"\" Subtract two values, ignoring None \"\"\"\n    if a is None:\n        if b is None:\n            return None\n        else:\n            return -1 * b\n    elif b is None:\n        return a\n    return a - b", "entry_point": "sub", "input": "1, 3.25", "output": "-2.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevearc/dql/blob/e9d3aa22873076dae5ebd02e35318aa996b1e56a/dql/expressions/selection.py#L28-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034456", "code": "def mul(a, b):\n    \"\"\" Multiply two values, ignoring None \"\"\"\n    if a is None:\n        if b is None:\n            return None\n        else:\n            return b\n    elif b is None:\n        return a\n    return a * b", "entry_point": "mul", "input": "0.5, 2.0", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevearc/dql/blob/e9d3aa22873076dae5ebd02e35318aa996b1e56a/dql/expressions/selection.py#L40-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034457", "code": "def div(a, b):\n    \"\"\" Divide two values, ignoring None \"\"\"\n    if a is None:\n        if b is None:\n            return None\n        else:\n            return 1 / b\n    elif b is None:\n        return a\n    return a / b", "entry_point": "div", "input": "False, 10", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevearc/dql/blob/e9d3aa22873076dae5ebd02e35318aa996b1e56a/dql/expressions/selection.py#L52-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034458", "code": "def truncate(string, length, ellipsis=\"\u2026\"):\n    \"\"\" Truncate a string to a length, ending with '...' if it overflows \"\"\"\n    if len(string) > length:\n        return string[: length - len(ellipsis)] + ellipsis\n    return string", "entry_point": "truncate", "input": "'', 1, []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevearc/dql/blob/e9d3aa22873076dae5ebd02e35318aa996b1e56a/dql/output.py#L26-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034459", "code": "def html5_serialize_simple_color(simple_color):\n    \"\"\"\n    Apply the serialization algorithm for a simple color from section\n    2.4.6 of HTML5.\n\n    \"\"\"\n    red, green, blue = simple_color\n\n    # 1. Let result be a string consisting of a single \"#\" (U+0023)\n    #    character.\n    result = u'#'\n\n    # 2. Convert the red, green, and blue components in turn to\n    #    two-digit hexadecimal numbers using lowercase ASCII hex\n    #    digits, zero-padding if necessary, and append these numbers\n    #    to result, in the order red, green, blue.\n    format_string = '{:02x}'\n    result += format_string.format(red)\n    result += format_string.format(green)\n    result += format_string.format(blue)\n\n    # 3. Return result, which will be a valid lowercase simple color.\n    return result", "entry_point": "html5_serialize_simple_color", "input": "[1, 2, 3]", "output": "'#010203'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ubernostrum/webcolors/blob/558bd81a917647ea2b392f5f4e9cd7ae5ff162a5/webcolors.py#L701-L723", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034460", "code": "def collect_by_type(obj_sequence, cache=None):\n    \"\"\"\n    collects objects from obj_sequence and stores them into buckets by\n    type. cache is an optional dict into which we collect the results.\n    \"\"\"\n\n    if cache is None:\n        cache = {}\n\n    for val in obj_sequence:\n        key = type(val)\n\n        bucket = cache.get(key, None)\n        if bucket is not None:\n            bucket.append(val)\n        else:\n            cache[key] = [val]\n\n    return cache", "entry_point": "collect_by_type", "input": "[], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/obriencj/python-javatools/blob/9e2332b452ddc508bed0615937dddcb2cf051557/javatools/change.py#L59-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034461", "code": "def clean_error(err):\n    \"\"\"\n    Take stderr bytes returned from MicroPython and attempt to create a\n    non-verbose error message.\n    \"\"\"\n    if err:\n        decoded = err.decode('utf-8')\n        try:\n            return decoded.split('\\r\\n')[-2]\n        except Exception:\n            return decoded\n    return 'There was an error.'", "entry_point": "clean_error", "input": "[]", "output": "'There was an error.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ntoll/microfs/blob/11387109cfc36aaddceb018596ea75d55417ca0c/microfs.py#L161-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034462", "code": "def parse_range_list(ranges):\n    \"\"\"Split a string like 2,3-5,8,9-11 into a list of integers. This is\n    intended to ease adding command-line options for dealing with affinity.\n    \"\"\"\n    if not ranges:\n        return []\n    parts = ranges.split(',')\n    out = []\n    for part in parts:\n        fields = part.split('-', 1)\n        if len(fields) == 2:\n            start = int(fields[0])\n            end = int(fields[1])\n            out.extend(range(start, end + 1))\n        else:\n            out.append(int(fields[0]))\n    return out", "entry_point": "parse_range_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/spead2/blob/cac95fd01d8debaa302d2691bd26da64b7828bc6/spead2/__init__.py#L81-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034463", "code": "def valid_str(x: str) -> bool:\n    \"\"\"\n    Return ``True`` if ``x`` is a non-blank string;\n    otherwise return ``False``.\n    \"\"\"\n    if isinstance(x, str) and x.strip():\n        return True\n    else:\n        return False", "entry_point": "valid_str", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mrcagney/gtfstk/blob/c91494e6fefc02523889655a0dc92d1c0eee8d03/gtfstk/validators.py#L45-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034464", "code": "def _format_param_value(key, value):\n    \"\"\"Wraps string values in quotes, and returns as 'key=value'.\n    \"\"\"\n    if isinstance(value, str):\n        value = \"'{}'\".format(value)\n    return \"{}={}\".format(key, value)", "entry_point": "_format_param_value", "input": "[], ['apple', 'banana', 'cherry']", "output": "\"[]=['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/roamanalytics/mittens/blob/dbf0c3f8d18651475cf7e21ab1ceb824c5f89150/mittens/mittens_base.py#L188-L193", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034465", "code": "def is_key(sarg):\n    \"\"\"Check if `sarg` is a key (eg. -foo, --foo) or a negative number (eg. -33).\n    \"\"\"\n    if not sarg.startswith(\"-\"):\n        return False\n    if sarg.startswith(\"--\"):\n        return True\n    return not sarg.lstrip(\"-\").isnumeric()", "entry_point": "is_key", "input": "'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jpscaletti/pyceo/blob/7f37eaf8e557d25f8e54634176139e0aad84b8df/pyceo/parser.py#L62-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034466", "code": "def snip_line(line, max_width, split_at):\n    \"\"\"Shorten a line to a maximum length.\"\"\"\n    if len(line) < max_width:\n        return line\n    return line[:split_at] + \" \u2026 \" \\\n        + line[-(max_width - split_at - 3):]", "entry_point": "snip_line", "input": "set(), True, ()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NLeSC/noodles/blob/3759e24e6e54a3a1a364431309dbb1061f617c04/noodles/tutorial.py#L132-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034467", "code": "def satellites_used(feed):\n    \"\"\"Counts number of satellites used in calculation from total visible satellites\n    Arguments:\n        feed feed=data_stream.TPV['satellites']\n    Returns:\n        total_satellites(int):\n        used_satellites (int):\n    \"\"\"\n    total_satellites = 0\n    used_satellites = 0\n\n    if not isinstance(feed, list):\n        return 0, 0\n\n    for satellites in feed:\n        total_satellites += 1\n        if satellites['used'] is True:\n            used_satellites += 1\n    return total_satellites, used_satellites", "entry_point": "satellites_used", "input": "[]", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wadda/gps3/blob/91adcd7073b891b135b2a46d039ce2125cf09a09/examples/human.py#L60-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034468", "code": "def normalize_url(url):\n    \"\"\"Return a normalized url with trailing and without leading slash.\n\n     >>> normalize_url(None)\n     '/'\n     >>> normalize_url('/')\n     '/'\n     >>> normalize_url('/foo/bar')\n     '/foo/bar'\n     >>> normalize_url('foo/bar')\n     '/foo/bar'\n     >>> normalize_url('/foo/bar/')\n     '/foo/bar'\n    \"\"\"\n    if not url or len(url) == 0:\n        return '/'\n    if not url.startswith('/'):\n        url = '/' + url\n    if len(url) > 1 and url.endswith('/'):\n        url = url[0:len(url) - 1]\n    return url", "entry_point": "normalize_url", "input": "set()", "output": "'/'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/batiste/django-page-cms/blob/3c72111eb7c3997a63c462c1776ffd8ce8c50a5d/pages/utils.py#L116-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034469", "code": "def ensure_dict(param, default_value, default_key=None):\n    \"\"\"\n    Retrieves a dict and a default value from given parameter.\n\n    if parameter is not a dict, it will be promoted as the default value.\n\n    :param param:\n    :type param:\n    :param default_value:\n    :type default_value:\n    :param default_key:\n    :type default_key:\n    :return:\n    :rtype:\n    \"\"\"\n    if not param:\n        param = default_value\n    if not isinstance(param, dict):\n        if param:\n            default_value = param\n        return {default_key: param}, default_value\n    return param, default_value", "entry_point": "ensure_dict", "input": "{}, False, ''", "output": "({'': False}, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Toilal/rebulk/blob/7511a4671f2fd9493e3df1e5177b7656789069e8/rebulk/loose.py#L167-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034470", "code": "def filter_match_kwargs(kwargs, children=False):\n    \"\"\"\n    Filters out kwargs for Match construction\n\n    :param kwargs:\n    :type kwargs: dict\n    :param children:\n    :type children: Flag to filter children matches\n    :return: A filtered dict\n    :rtype: dict\n    \"\"\"\n    kwargs = kwargs.copy()\n    for key in ('pattern', 'start', 'end', 'parent', 'formatter', 'value'):\n        if key in kwargs:\n            del kwargs[key]\n    if children:\n        for key in ('name',):\n            if key in kwargs:\n                del kwargs[key]\n    return kwargs", "entry_point": "filter_match_kwargs", "input": "{'a': 1, 'b': 2}, [[1, 2], [3], []]", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Toilal/rebulk/blob/7511a4671f2fd9493e3df1e5177b7656789069e8/rebulk/pattern.py#L470-L489", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034471", "code": "def get_first_defined(data, keys, default_value=None):\n    \"\"\"\n    Get the first defined key in data.\n    :param data:\n    :type data:\n    :param keys:\n    :type keys:\n    :param default_value:\n    :type default_value:\n    :return:\n    :rtype:\n    \"\"\"\n    for key in keys:\n        if key in data:\n            return data[key]\n    return default_value", "entry_point": "get_first_defined", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Toilal/rebulk/blob/7511a4671f2fd9493e3df1e5177b7656789069e8/rebulk/utils.py#L59-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034472", "code": "def _vertically_size_cells(rendered_rows):\n        \"\"\"Grow row heights to cater for vertically spanned cells that do not\n        fit in the available space.\"\"\"\n        for r, rendered_row in enumerate(rendered_rows):\n            for rendered_cell in rendered_row:\n                if rendered_cell.rowspan > 1:\n                    row_height = sum(row.height for row in\n                                     rendered_rows[r:r + rendered_cell.rowspan])\n                    extra_height_needed = rendered_cell.height - row_height\n                    if extra_height_needed > 0:\n                        padding = extra_height_needed / rendered_cell.rowspan\n                        for i in range(r, r + rendered_cell.rowspan):\n                            rendered_rows[i].height += padding\n        return rendered_rows", "entry_point": "_vertically_size_cells", "input": "set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brechtm/rinohtype/blob/40a63c4e5ad7550f62b6860f1812cb67cafb9dc7/src/rinoh/table.py#L287-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034473", "code": "def check_sizes(size, width, height):\n    \"\"\"\n    Check that these arguments, in supplied, are consistent.\n\n    Return a (width, height) pair.\n    \"\"\"\n    if not size:\n        return width, height\n\n    if len(size) != 2:\n        raise ValueError(\n          \"size argument should be a pair (width, height)\")\n    if width is not None and width != size[0]:\n        raise ValueError(\n          \"size[0] (%r) and width (%r) should match when both are used.\"\n          % (size[0], width))\n    if height is not None and height != size[1]:\n        raise ValueError(\n          \"size[1] (%r) and height (%r) should match when both are used.\"\n          % (size[1], height))\n    return size", "entry_point": "check_sizes", "input": "0, 2, 10", "output": "(2, 10)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brechtm/rinohtype/blob/40a63c4e5ad7550f62b6860f1812cb67cafb9dc7/src/rinoh/backend/pdf/xobject/purepng.py#L364-L384", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034474", "code": "def popdict(src, keys):\n    \"\"\"\n    Extract all keys (with values) from `src` dictionary as new dictionary\n\n    values are removed from source dictionary.\n    \"\"\"\n    new = {}\n    for key in keys:\n        if key in src:\n            new[key] = src.pop(key)\n    return new", "entry_point": "popdict", "input": "[-1, 0, 1, 2], [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brechtm/rinohtype/blob/40a63c4e5ad7550f62b6860f1812cb67cafb9dc7/src/rinoh/backend/pdf/xobject/purepng.py#L443-L453", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034475", "code": "def _format_help_dicts(help_dicts, display_defaults=False):\n    \"\"\"\n    Format the output of _generate_help_dicts into a str\n    \"\"\"\n    help_strs = []\n    for help_dict in help_dicts:\n        help_str = \"%s (%s\" % (\n            help_dict[\"var_name\"],\n            \"Required\" if help_dict[\"required\"] else \"Optional\",\n        )\n        if help_dict.get(\"default\") and display_defaults:\n            help_str += \", Default=%s)\" % help_dict[\"default\"]\n        else:\n            help_str += \")\"\n        if help_dict.get(\"help_str\"):\n            help_str += \": %s\" % help_dict[\"help_str\"]\n        help_strs.append(help_str)\n\n    return \"\\n\".join(help_strs)", "entry_point": "_format_help_dicts", "input": "{}, []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hynek/environ_config/blob/d61c0822bf0b6516932534e0496bd3f360a3e5e2/src/environ/_environ_config.py#L135-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034476", "code": "def get_safe(dict_instance, keypath, default=None):\n    \"\"\"\n    Returns a value with in a nested dict structure from a dot separated\n    path expression such as \"system.server.host\" or a list of key entries\n    @retval Value if found or None\n    \"\"\"\n    try:\n        obj = dict_instance\n        keylist = keypath if type(keypath) is list else keypath.split('.')\n        for key in keylist:\n            obj = obj[key]\n        return obj\n    except Exception:\n        return default", "entry_point": "get_safe", "input": "{'a': 1, 'b': 2}, 'Hello World', [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ioos/compliance-checker/blob/ee89c27b0daade58812489a2da3aa3b6859eafd9/compliance_checker/cf/util.py#L161-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034477", "code": "def _init_net_specs(conf):\n        \"\"\"\n        Given a configuration specification, initializes all the net\n        definitions in it so they can be used comfortably\n\n        Args:\n            conf (dict): Configuration specification\n\n        Returns:\n            dict: the adapted new conf\n        \"\"\"\n        for net_name, net_spec in conf.get('nets', {}).items():\n            net_spec['name'] = net_name\n            net_spec['mapping'] = {}\n            net_spec.setdefault('type', 'nat')\n\n        return conf", "entry_point": "_init_net_specs", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lago-project/lago/blob/5b8970f7687e063e4619066d5b8093ca997678c9/lago/prefix.py#L242-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034478", "code": "def reverse(d):\n    \"\"\"Return a reverse lookup dictionary for the input dictionary\"\"\"\n    r={}\n    for k in d:\n        r[d[k]]=k\n    return r", "entry_point": "reverse", "input": "[-1, 0, 1, 2]", "output": "{2: -1, -1: 0, 0: 1, 1: 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/pysynphot/blob/a125ff956f4d94beb157bd51899747a13234bb97/commissioning/doscalars.py#L85-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034479", "code": "def ismatch(a,b):\n    \"\"\"Method to allow smart comparisons between classes, instances,\n    and string representations of units and give the right answer.\n    For internal use only.\"\"\"\n    #Try the easy case\n    if a == b:\n        return True\n    else:\n        #Try isinstance in both orders\n        try:\n            if isinstance(a,b):\n                return True\n        except TypeError:\n            try:\n                if isinstance(b,a):\n                    return True\n            except TypeError:\n                #Try isinstance(a, type(b)) in both orders\n                try:\n                    if isinstance(a,type(b)):\n                        return True\n                except TypeError:\n                    try:\n                        if isinstance(b,type(a)):\n                            return True\n                    except TypeError:\n                        #Try the string representation\n                        if str(a).lower() == str(b).lower():\n                            return True\n                        else:\n                            return False", "entry_point": "ismatch", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/pysynphot/blob/a125ff956f4d94beb157bd51899747a13234bb97/pysynphot/units.py#L63-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034480", "code": "def score_n1(matrix, matrix_size):\n    \"\"\"\\\n    Implements the penalty score feature 1.\n\n    ISO/IEC 18004:2015(E) -- 7.8.3 Evaluation of data masking results - Table 11 (page 54)\n\n    ============================================   ========================    ======\n    Feature                                        Evaluation condition        Points\n    ============================================   ========================    ======\n    Adjacent modules in row/column in same color   No. of modules = (5 + i)    N1 + i\n    ============================================   ========================    ======\n\n    N1 = 3\n\n    :param matrix: The matrix to evaluate\n    :param matrix_size: The width (or height) of the matrix.\n    :return int: The penalty score (feature 1) of the matrix.\n    \"\"\"\n    score = 0\n    for i in range(matrix_size):\n        prev_bit_row, prev_bit_col = -1, -1\n        row_counter, col_counter = 0, 0\n        for j in range(matrix_size):\n            # Row-wise\n            bit = matrix[i][j]\n            if bit == prev_bit_row:\n                row_counter += 1\n            else:\n                if row_counter >= 5:\n                    score += row_counter - 2  # N1 == 3\n                row_counter = 1\n                prev_bit_row = bit\n            # Col-wise\n            bit = matrix[j][i]\n            if bit == prev_bit_col:\n                col_counter += 1\n            else:\n                if col_counter >= 5:\n                    score += col_counter - 2  # N1 == 3\n                col_counter = 1\n                prev_bit_col = bit\n        if row_counter >= 5:\n            score += row_counter - 2  # N1 == 3\n        if col_counter >= 5:\n            score += col_counter - 2  # N1 == 3\n    return score", "entry_point": "score_n1", "input": "['apple', 'banana', 'cherry'], 1", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/segno/blob/64d912a2bd17d0b5ff3e8b5d37098edfc663c2b3/segno/encoder.py#L750-L795", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034481", "code": "def score_n2(matrix, matrix_size):\n    \"\"\"\\\n    Implements the penalty score feature 2.\n\n    ISO/IEC 18004:2015(E) -- 7.8.3 Evaluation of data masking results - Table 11 (page 54)\n\n    ==============================   ====================   ===============\n    Feature                          Evaluation condition   Points\n    ==============================   ====================   ===============\n    Block of modules in same color   Block size = m \u00d7 n     N2 \u00d7(m-1)\u00d7(n-1)\n    ==============================   ====================   ===============\n\n    N2 = 3\n\n    :param matrix: The matrix to evaluate\n    :param matrix_size: The width (or height) of the matrix.\n    :return int: The penalty score (feature 2) of the matrix.\n    \"\"\"\n    score = 0\n    for i in range(matrix_size - 1):\n        for j in range(matrix_size - 1):\n            bit = matrix[i][j]\n            if bit == matrix[i][j + 1] and bit == matrix[i + 1][j] \\\n                and bit == matrix[i + 1][j + 1]:\n                score += 1\n    return score * 3", "entry_point": "score_n2", "input": "{'x': [1, 2], 'y': []}, False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/segno/blob/64d912a2bd17d0b5ff3e8b5d37098edfc663c2b3/segno/encoder.py#L798-L823", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034482", "code": "def score_n4(matrix, matrix_size):\n    \"\"\"\\\n    Implements the penalty score feature 4.\n\n    ISO/IEC 18004:2015(E) -- 7.8.3 Evaluation of data masking results - Table 11 (page 54)\n\n    ===========================================   ====================================   ======\n    Feature                                       Evaluation condition                   Points\n    ===========================================   ====================================   ======\n    Proportion of dark modules in entire symbol   50 \u00d7 (5 \u00d7 k)% to 50 \u00d7 (5 \u00d7 (k + 1))%   N4 \u00d7 k\n    ===========================================   ====================================   ======\n\n    N4 = 10\n\n    :param matrix: The matrix to evaluate\n    :param matrix_size: The width (or height) of the matrix.\n    :return int: The penalty score (feature 4) of the matrix.\n    \"\"\"\n    dark_modules = sum(map(sum, matrix))\n    total_modules = matrix_size ** 2\n    k = int(abs(dark_modules * 2 - total_modules) * 10 // total_modules)\n    return 10 * k", "entry_point": "score_n4", "input": "[[1, 2], [3], []], 10", "output": "80", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/segno/blob/64d912a2bd17d0b5ff3e8b5d37098edfc663c2b3/segno/encoder.py#L880-L901", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034483", "code": "def evaluate_micro_mask(matrix, matrix_size):\n    \"\"\"\\\n    Evaluates the provided `matrix` of a Micro QR code.\n\n    ISO/IEC 18004:2015(E) -- 7.8.3.2 Evaluation of Micro QR Code symbols (page 54)\n\n    :param matrix: The matrix to evaluate\n    :param matrix_size: The width (or height) of the matrix.\n    :return int: The penalty score of the matrix.\n    \"\"\"\n    sum1 = sum(matrix[i][-1] == 0x1 for i in range(1, matrix_size))\n    sum2 = sum(matrix[-1][i] == 0x1 for i in range(1, matrix_size))\n    return sum1 * 16 + sum2 if sum1 <= sum2 else sum2 * 16 + sum1", "entry_point": "evaluate_micro_mask", "input": "[5, 3, 1, 4], 1", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heuer/segno/blob/64d912a2bd17d0b5ff3e8b5d37098edfc663c2b3/segno/encoder.py#L904-L916", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034484", "code": "def sortLocations(locations):\n    \"\"\" Sort the locations by ranking:\n            1.  all on-axis points\n            2.  all off-axis points which project onto on-axis points\n                these would be involved in master to master interpolations\n                necessary for patching. Projecting off-axis masters have\n                at least one coordinate in common with an on-axis master.\n            3.  non-projecting off-axis points, 'wild' off axis points\n                These would be involved in projecting limits and need to be patched.\n    \"\"\"\n    onAxis = []\n    onAxisValues = {}\n    offAxis = []\n    offAxis_projecting = []\n    offAxis_wild = []\n    # first get the on-axis points\n    for l in locations:\n        if l.isOrigin():\n            continue\n        if l.isOnAxis():\n            onAxis.append(l)\n            for axis in l.keys():\n                if axis not in onAxisValues:\n                    onAxisValues[axis] = []\n                onAxisValues[axis].append(l[axis])\n        else:\n            offAxis.append(l)\n    for l in offAxis:\n        ok = False\n        for axis in l.keys():\n            if axis not in onAxisValues:\n                continue\n            if l[axis] in onAxisValues[axis]:\n                ok = True\n        if ok:\n            offAxis_projecting.append(l)\n        else:\n            offAxis_wild.append(l)\n    return onAxis, offAxis_projecting, offAxis_wild", "entry_point": "sortLocations", "input": "[]", "output": "([], [], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LettError/MutatorMath/blob/10318fc4e7c9cee9df6130826829baea3054a42b/Lib/mutatorMath/objects/location.py#L606-L644", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034485", "code": "def rel_path(name, available_tools):\n        \"\"\"\n        Extracts relative path to a tool (from the main cloned directory) out\n        of available_tools based on the name it is given\n        \"\"\"\n        if name == '@' or name == '.' or name == '/':\n            name = ''\n        multi_tool = '@' in name\n        for tool in available_tools:\n            t_name = tool[0].lower()\n            if multi_tool:\n                if name.split('@')[-1] == t_name.split('@')[-1]:\n                    return t_name, t_name\n            else:\n                if name == t_name.split('/')[-1]:\n                    return t_name, tool[0]\n                elif name == '' and t_name.split('@')[-1] == 'unspecified':\n                    return '', ''\n        return None, None", "entry_point": "rel_path", "input": "'a,b,c', ['a', 'b', 'c']", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CyberReboot/vent/blob/9956a09146b11a89a0eabab3bc7ce8906d124885/vent/helpers/paths.py#L69-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034486", "code": "def ToolMatches(tools=None, version='HEAD'):\n    \"\"\" Get the tools paths and versions that were specified \"\"\"\n    matches = []\n    if tools:\n        for tool in tools:\n            match_version = version\n            if tool[1] != '':\n                match_version = tool[1]\n            match = ''\n            if tool[0].endswith('/'):\n                match = tool[0][:-1]\n            elif tool[0] != '.':\n                match = tool[0]\n            if not match.startswith('/') and match != '':\n                match = '/'+match\n            matches.append((match, match_version))\n    return matches", "entry_point": "ToolMatches", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CyberReboot/vent/blob/9956a09146b11a89a0eabab3bc7ce8906d124885/vent/helpers/meta.py#L519-L535", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034487", "code": "def sdk_normalize(filename):\n    \"\"\"\n    Normalize a path to strip out the SDK portion, normally so that it\n    can be decided whether it is in a system path or not.\n    \"\"\"\n    if filename.startswith('/Developer/SDKs/'):\n        pathcomp = filename.split('/')\n        del pathcomp[1:4]\n        filename = '/'.join(pathcomp)\n    return filename", "entry_point": "sdk_normalize", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/util.py#L146-L155", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034488", "code": "def list2cmdline(seq):\n    \"\"\"\n    Translate a sequence of arguments into a command line\n    string, using the same rules as the MS C runtime:\n\n    1) Arguments are delimited by white space, which is either a\n       space or a tab.\n\n    2) A string surrounded by double quotation marks is\n       interpreted as a single argument, regardless of white space\n       or pipe characters contained within.  A quoted string can be\n       embedded in an argument.\n\n    3) A double quotation mark preceded by a backslash is\n       interpreted as a literal double quotation mark.\n\n    4) Backslashes are interpreted literally, unless they\n       immediately precede a double quotation mark.\n\n    5) If backslashes immediately precede a double quotation mark,\n       every pair of backslashes is interpreted as a literal\n       backslash.  If the number of backslashes is odd, the last\n       backslash escapes the next double quotation mark as\n       described in rule 3.\n    \"\"\"\n\n    # See\n    # http://msdn.microsoft.com/en-us/library/17w5ykft.aspx\n    # or search http://msdn.microsoft.com for\n    # \"Parsing C++ Command-Line Arguments\"\n    result = []\n    needquote = False\n    for arg in seq:\n        bs_buf = []\n\n        # Add a space to separate this argument from the others\n        if result:\n            result.append(' ')\n\n        needquote = (\" \" in arg) or (\"\\t\" in arg) or (\"|\" in arg) or not arg\n        if needquote:\n            result.append('\"')\n\n        for c in arg:\n            if c == '\\\\':\n                # Don't know if we need to double yet.\n                bs_buf.append(c)\n            elif c == '\"':\n                # Double backslashes.\n                result.append('\\\\' * len(bs_buf)*2)\n                bs_buf = []\n                result.append('\\\\\"')\n            else:\n                # Normal char\n                if bs_buf:\n                    result.extend(bs_buf)\n                    bs_buf = []\n                result.append(c)\n\n        # Add remaining backslashes, if any.\n        if bs_buf:\n            result.extend(bs_buf)\n\n        if needquote:\n            result.extend(bs_buf)\n            result.append('\"')\n\n    return ''.join(result)", "entry_point": "list2cmdline", "input": "['a', 'b', 'c']", "output": "'a b c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/thirdparty/pyinstaller/PyInstaller/lib/__subprocess.py#L512-L579", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034489", "code": "def _listeq_to_dict(jobconfs):\n    \"\"\"Convert iterators of 'key=val' into a dictionary with later values taking priority.\"\"\"\n    if not isinstance(jobconfs, dict):\n        jobconfs = dict(x.split('=', 1) for x in jobconfs)\n    return dict((str(k), str(v)) for k, v in jobconfs.items())", "entry_point": "_listeq_to_dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwhite/hadoopy/blob/ff39b4e6d4e6efaf1f571cf0f2c0e0d7ab28c2d6/hadoopy/_runner.py#L66-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034490", "code": "def get_tag_value(x, key):\n    \"\"\"Get a value from tag\"\"\"\n    if x is None:\n        return ''\n    result = [y['Value'] for y in x if y['Key'] == key]\n    if result:\n        return result[0]\n    return ''", "entry_point": "get_tag_value", "input": "[], 5", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/achiku/jungle/blob/fb63f845cfa9e9c0dfbabd8cfa3ebca8177a11ca/jungle/ec2.py#L43-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034491", "code": "def override(original, results):\n    \"\"\"\n    If a receiver to a signal returns a value, we override the original value\n    with the last returned value.\n\n    :param original: The original value\n    :param results: The results from the signal\n    \"\"\"\n    overrides = [v for fn, v in results if v is not None]\n    if len(overrides) == 0:\n        return original\n    return overrides[-1]", "entry_point": "override", "input": "[5, 3, 1, 4], []", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ColtonProvias/sqlalchemy-jsonapi/blob/40f8b5970d44935b27091c2bf3224482d23311bb/sqlalchemy_jsonapi/flaskext.py#L49-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034492", "code": "def starts_with_prefix_in_list(text, prefixes):\n    \"\"\"\n    Return True if the given string starts with one of the prefixes in the given list, otherwise\n    return False.\n\n    Arguments:\n        text (str): Text to check for prefixes.\n        prefixes (list): List of prefixes to check for.\n\n    Returns:\n        bool: True if the given text starts with any of the given prefixes, otherwise False.\n    \"\"\"\n    for prefix in prefixes:\n        if text.startswith(prefix):\n            return True\n    return False", "entry_point": "starts_with_prefix_in_list", "input": "'', '  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ynop/audiomate/blob/61727920b23a708293c3d526fa3000d4de9c6c21/audiomate/utils/text.py#L32-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034493", "code": "def within_history(rev, windowdict):\n    \"\"\"Return whether the windowdict has history at the revision.\"\"\"\n    if not windowdict:\n        return False\n    begin = windowdict._past[0][0] if windowdict._past else \\\n            windowdict._future[-1][0]\n    end = windowdict._future[0][0] if windowdict._future else \\\n          windowdict._past[-1][0]\n    return begin <= rev <= end", "entry_point": "within_history", "input": "[5, 3, 1, 4], {}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LogicalDash/LiSE/blob/fe6fd4f0a7c1780e065f4c9babb9bc443af6bb84/allegedb/allegedb/window.py#L83-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034494", "code": "def render_flags(flags, bit_list):\n    \"\"\"Show bit names.\n    \"\"\"\n    res = []\n    known = 0\n    for bit in bit_list:\n        known = known | bit[0]\n        if flags & bit[0]:\n            res.append(bit[1])\n    unknown = flags & ~known\n    n = 0\n    while unknown:\n        if unknown & 1:\n            res.append(\"UNK_%04x\" % (1 << n))\n        unknown = unknown >> 1\n        n += 1\n\n    if not res:\n        return '-'\n\n    return \",\".join(res)", "entry_point": "render_flags", "input": "False, []", "output": "'-'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markokr/rarfile/blob/2704344e8d7a1658c96c8ed8f449d7ba01bedea3/dumprar.py#L169-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034495", "code": "def parse_dos_time(stamp):\n    \"\"\"Parse standard 32-bit DOS timestamp.\n    \"\"\"\n    sec, stamp = stamp & 0x1F, stamp >> 5\n    mn,  stamp = stamp & 0x3F, stamp >> 6\n    hr,  stamp = stamp & 0x1F, stamp >> 5\n    day, stamp = stamp & 0x1F, stamp >> 5\n    mon, stamp = stamp & 0x0F, stamp >> 4\n    yr = (stamp & 0x7F) + 1980\n    return (yr, mon, day, hr, mn, sec * 2)", "entry_point": "parse_dos_time", "input": "1", "output": "(1980, 0, 0, 0, 0, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markokr/rarfile/blob/2704344e8d7a1658c96c8ed8f449d7ba01bedea3/rarfile.py#L2848-L2857", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034496", "code": "def nba_season(x):\n    \"\"\"Takes in 4-digit year for first half of season and returns API appropriate formatted code\n\n    Input Values: YYYY \n\n    Used in: _Draft.Anthro(), _Draft.Agility(), _Draft.NonStationaryShooting(), \n    _Draft.SpotUpShooting(), _Draft.Combine()\n\n    \"\"\"\n    if len(str(x)) == 4:\n        try:\n            return '{0}-{1}'.format(x, str(int(x) % 100 + 1)[-2:].zfill(2))\n        except ValueError:\n            raise ValueError(\"Enter the four digit year for the first half of the desired season\")\n    else:\n        raise ValueError(\"Enter the four digit year for the first half of the desired season\")", "entry_point": "nba_season", "input": "3.25", "output": "'3.25-04'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bradleyfay/py-Goldsberry/blob/828179f8e4aad910d7a8c58faa12d3ae2c354503/goldsberry/apiconvertor.py#L20-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034497", "code": "def season_id(x):\n    \"\"\"takes in 4-digit years and returns API formatted seasonID\n\n    Input Values: YYYY \n\n    Used in:\n\n    \"\"\"\n    if len(str(x)) == 4:\n        try:\n            return \"\".join([\"2\", str(x)])\n        except ValueError:\n            raise ValueError(\"Enter the four digit year for the first half of the desired season\")\n    else:\n        raise ValueError(\"Enter the four digit year for the first half of the desired season\")", "entry_point": "season_id", "input": "3.25", "output": "'23.25'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bradleyfay/py-Goldsberry/blob/828179f8e4aad910d7a8c58faa12d3ae2c354503/goldsberry/apiconvertor.py#L38-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034498", "code": "def _remove_app_models(all_apps, models_to_remove):\n    \"\"\"\n    Remove the model specs in models_to_remove from the models specs in the\n    apps in all_apps. If an app has no models left, don't include it in the\n    output.\n\n    This has the side-effect that the app view e.g. /admin/app/ may not be\n    accessible from the dashboard, only the breadcrumbs.\n    \"\"\"\n\n    filtered_apps = []\n\n    for app in all_apps:\n        models = [x for x in app['models'] if x not in models_to_remove]\n        if models:\n            app['models'] = models\n            filtered_apps.append(app)\n\n    return filtered_apps", "entry_point": "_remove_app_models", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ic-labs/django-icekit/blob/c507ea5b1864303732c53ad7c5800571fca5fa94/icekit/admin_tools/templatetags/dashboard_tags.py#L112-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034499", "code": "def dedupe_and_sort(sequence, first=None, last=None):\n    \"\"\"\n    De-dupe and partially sort a sequence.\n\n    The `first` argument should contain all the items that might appear in\n    `sequence` and for which the order (relative to each other) is important.\n\n    The `last` argument is the same, but matching items will be placed at the\n    end of the sequence.\n\n    For example, `INSTALLED_APPS` and `MIDDLEWARE_CLASSES` settings.\n\n    Items from `first` will only be included if they also appear in `sequence`.\n\n    Items from `sequence` that don't appear in `first` will come\n    after any that do, and retain their existing order.\n\n    Returns a sequence of the same type as given.\n    \"\"\"\n    first = first or []\n    last = last or []\n    # Add items that should be sorted first.\n    new_sequence = [i for i in first if i in sequence]\n    # Add remaining items in their current order, ignoring duplicates and items\n    # that should be sorted last.\n    for item in sequence:\n        if item not in new_sequence and item not in last:\n            new_sequence.append(item)\n    # Add items that should be sorted last.\n    new_sequence.extend([i for i in last if i in sequence])\n    # Return a sequence of the same type as given.\n    return type(sequence)(new_sequence)", "entry_point": "dedupe_and_sort", "input": "[5, 3, 1, 4], [[1, 2], [3], []], ['a', 'b', 'c']", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ic-labs/django-icekit/blob/c507ea5b1864303732c53ad7c5800571fca5fa94/icekit/utils/sequences.py#L1-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034500", "code": "def int2ap(num):\n    \"\"\"Convert integer to A-P string representation.\"\"\"\n    val = ''\n    ap = 'ABCDEFGHIJKLMNOP'\n    num = int(abs(num))\n    while num:\n        num, mod = divmod(num, 16)\n        val += ap[mod:mod + 1]\n    return val", "entry_point": "int2ap", "input": "1", "output": "'B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bamthomas/aioimaplib/blob/9670d43950cafc4d41aab7a36824b8051fa89899/aioimaplib/aioimaplib.py#L864-L872", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034501", "code": "def scale(x, length):\n    \"\"\"\n    Scale points in 'x', such that distance between\n    max(x) and min(x) equals to 'length'. min(x)\n    will be moved to 0.\n    \"\"\"\n    s = float(length - 1) / \\\n        (max(x) - min(x)) if x and max(x) - min(x) != 0 else length\n    return [int((i - min(x)) * s) for i in x]", "entry_point": "scale", "input": "[], 7", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kressi/terminalplot/blob/af05f3fe0793c957cc0b0ebf4afbe54c72d18b66/terminalplot/terminalplot.py#L40-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034502", "code": "def compute_checksum(line):\n    \"\"\"Compute the TLE checksum for the given line.\"\"\"\n    return sum((int(c) if c.isdigit() else c == '-') for c in line[0:68]) % 10", "entry_point": "compute_checksum", "input": "'a,b,c'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brandon-rhodes/python-sgp4/blob/a1e19e32831d6814b3ab34f55b39b8520d291c4e/sgp4/io.py#L261-L263", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034503", "code": "def split_str(string):\n    \"\"\"Split string in half to return two strings\"\"\"\n    split = string.split(' ')\n    return ' '.join(split[:len(split) // 2]), ' '.join(split[len(split) // 2:])", "entry_point": "split_str", "input": "'abc'", "output": "('', 'abc')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mrstephenneal/pdfconduit/blob/993421cc087eefefe01ff09afabd893bcc2718ec/pdf/modify/draw/pdf.py#L25-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034504", "code": "def flatten_list(items, seqtypes=(list, tuple), in_place=True):\n    \"\"\"Flatten an irregular sequence.\n\n    Works generally but may be slower than it could\n    be if you can make assumptions about your list.\n\n    `Source`__\n\n    __ https://stackoverflow.com/a/10824086\n\n    Parameters\n    ----------\n    items : iterable\n        The irregular sequence to flatten.\n    seqtypes : iterable of types (optional)\n        Types to flatten. Default is (list, tuple).\n    in_place : boolean (optional)\n        Toggle in_place flattening. Default is True.\n\n    Returns\n    -------\n    list\n        Flattened list.\n\n    Examples\n    --------\n    >>> l = [[[1, 2, 3], [4, 5]], 6]\n    >>> wt.kit.flatten_list(l)\n    [1, 2, 3, 4, 5, 6]\n    \"\"\"\n    if not in_place:\n        items = items[:]\n    for i, _ in enumerate(items):\n        while i < len(items) and isinstance(items[i], seqtypes):\n            items[i : i + 1] = items[i]\n    return items", "entry_point": "flatten_list", "input": "[], [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wright-group/WrightTools/blob/80d3ddd5074d8d5c1bc03fd5a0e0f10d4b424aeb/WrightTools/kit/_list.py#L17-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034505", "code": "def intersperse(lis, value):\n    \"\"\"Put value between each existing item in list.\n\n    Parameters\n    ----------\n    lis : list\n        List to intersperse.\n    value : object\n        Value to insert.\n\n    Returns\n    -------\n    list\n        interspersed list\n    \"\"\"\n    out = [value] * (len(lis) * 2 - 1)\n    out[0::2] = lis\n    return out", "entry_point": "intersperse", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "['a', [5, 3, 1, 4], 'b', [5, 3, 1, 4], 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wright-group/WrightTools/blob/80d3ddd5074d8d5c1bc03fd5a0e0f10d4b424aeb/WrightTools/kit/_list.py#L55-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034506", "code": "def get_index(lis, argument):\n    \"\"\"Find the index of an item, given either the item or index as an argument.\n\n    Particularly useful as a wrapper for arguments like channel or axis.\n\n    Parameters\n    ----------\n    lis : list\n        List to parse.\n    argument : int or object\n        Argument.\n\n    Returns\n    -------\n    int\n        Index of chosen object.\n    \"\"\"\n    # get channel\n    if isinstance(argument, int):\n        if -len(lis) <= argument < len(lis):\n            return argument\n        else:\n            raise IndexError(\"index {0} incompatible with length {1}\".format(argument, len(lis)))\n    else:\n        return lis.index(argument)", "entry_point": "get_index", "input": "[[1, 2], [3], []], []", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wright-group/WrightTools/blob/80d3ddd5074d8d5c1bc03fd5a0e0f10d4b424aeb/WrightTools/kit/_list.py#L75-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034507", "code": "def nm_to_rgb(nm):\n    \"\"\"Convert a wavelength to corresponding RGB values [0.0-1.0].\n\n    Parameters\n    ----------\n    nm : int or float\n        The wavelength of light.\n\n    Returns\n    -------\n    List of [R,G,B] values between 0 and 1\n\n\n    `original code`__\n\n    __ http://www.physics.sfasu.edu/astro/color/spectra.html\n    \"\"\"\n    w = int(nm)\n    # color ---------------------------------------------------------------------------------------\n    if w >= 380 and w < 440:\n        R = -(w - 440.) / (440. - 350.)\n        G = 0.0\n        B = 1.0\n    elif w >= 440 and w < 490:\n        R = 0.0\n        G = (w - 440.) / (490. - 440.)\n        B = 1.0\n    elif w >= 490 and w < 510:\n        R = 0.0\n        G = 1.0\n        B = -(w - 510.) / (510. - 490.)\n    elif w >= 510 and w < 580:\n        R = (w - 510.) / (580. - 510.)\n        G = 1.0\n        B = 0.0\n    elif w >= 580 and w < 645:\n        R = 1.0\n        G = -(w - 645.) / (645. - 580.)\n        B = 0.0\n    elif w >= 645 and w <= 780:\n        R = 1.0\n        G = 0.0\n        B = 0.0\n    else:\n        R = 0.0\n        G = 0.0\n        B = 0.0\n    # intensity correction ------------------------------------------------------------------------\n    if w >= 380 and w < 420:\n        SSS = 0.3 + 0.7 * (w - 350) / (420 - 350)\n    elif w >= 420 and w <= 700:\n        SSS = 1.0\n    elif w > 700 and w <= 780:\n        SSS = 0.3 + 0.7 * (780 - w) / (780 - 700)\n    else:\n        SSS = 0.0\n    SSS *= 255\n    return [float(int(SSS * R) / 256.), float(int(SSS * G) / 256.), float(int(SSS * B) / 256.)]", "entry_point": "nm_to_rgb", "input": "False", "output": "[0.0, 0.0, 0.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wright-group/WrightTools/blob/80d3ddd5074d8d5c1bc03fd5a0e0f10d4b424aeb/WrightTools/artists/_colors.py#L134-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034508", "code": "def valid_index(index, shape) -> tuple:\n    \"\"\"Get a valid index for a broadcastable shape.\n\n    Parameters\n    ----------\n    index : tuple\n        Given index.\n    shape : tuple of int\n        Shape.\n\n    Returns\n    -------\n    tuple\n        Valid index.\n    \"\"\"\n    # append slices to index\n    index = list(index)\n    while len(index) < len(shape):\n        index.append(slice(None))\n    # fill out, in reverse\n    out = []\n    for i, s in zip(index[::-1], shape[::-1]):\n        if s == 1:\n            if isinstance(i, slice):\n                out.append(slice(None))\n            else:\n                out.append(0)\n        else:\n            out.append(i)\n    return tuple(out[::-1])", "entry_point": "valid_index", "input": "(1, 2), ()", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wright-group/WrightTools/blob/80d3ddd5074d8d5c1bc03fd5a0e0f10d4b424aeb/WrightTools/kit/_array.py#L347-L376", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034509", "code": "def is_valid_combination(row):\n    \"\"\"\n    This is a filtering function. Filtering functions should return True\n    if combination is valid and False otherwise.\n\n    Test row that is passed here can be incomplete.\n    To prevent search for unnecessary items filtering function\n    is executed with found subset of data to validate it.\n    \"\"\"\n\n    n = len(row)\n\n    if n > 1:\n        # Brand Y does not support Windows 98\n        if \"98\" == row[1] and \"Brand Y\" == row[0]:\n            return False\n\n        # Brand X does not work with XP\n        if \"XP\" == row[1] and \"Brand X\" == row[0]:\n            return False\n\n    if n > 4:\n        # Contractors are billed in 30 min increments\n        if \"Contr.\" == row[3] and row[4] < 30:\n            return False\n\n    return True", "entry_point": "is_valid_combination", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thombashi/allpairspy/blob/9dd256d7ccdc1348c5807d4a814294d9c5192293/examples/example2.1.py#L13-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034510", "code": "def _unfloat(flt, precision=5):\n    \"\"\"Function to convert float to 'decimal point assumed' format\n\n    >>> _unfloat(0)\n    '00000-0'\n    >>> _unfloat(3.4473e-4)\n    '34473-3'\n    >>> _unfloat(-6.0129e-05)\n    '-60129-4'\n    >>> _unfloat(4.5871e-05)\n    '45871-4'\n    \"\"\"\n\n    if flt == 0.:\n        return \"{}-0\".format(\"0\" * precision)\n\n    num, _, exp = \"{:.{}e}\".format(flt, precision - 1).partition('e')\n    exp = int(exp)\n    num = num.replace('.', '')\n\n    return \"%s%d\" % (num, exp + 1)", "entry_point": "_unfloat", "input": "-3, True", "output": "'-31'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/galactics/beyond/blob/7a7590ff0fd4c0bac3e8e383ecca03caa98e5742/beyond/orbits/tle.py#L82-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034511", "code": "def get_step_f(step_f, lR2, lS2):\n    \"\"\"Update the stepsize of given the primal and dual errors.\n\n    See Boyd (2011), section 3.4.1\n    \"\"\"\n    mu, tau = 10, 2\n    if lR2 > mu*lS2:\n        return step_f * tau\n    elif lS2 > mu*lR2:\n        return step_f / tau\n    return step_f", "entry_point": "get_step_f", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c'], []", "output": "['apple', 'banana', 'cherry', 'apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmelchior/proxmin/blob/60e49d90c67c46329cc1d3b5c484951dc8bd2c3f/proxmin/utils.py#L300-L310", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034512", "code": "def custom_decode(encoding):\n    \"\"\"Overrides encoding when charset declaration\n       or charset determination is a subset of a larger\n       charset.  Created because of issues with Chinese websites\"\"\"\n    encoding = encoding.lower()\n    alternates = {\n        'big5': 'big5hkscs',\n        'gb2312': 'gb18030',\n        'ascii': 'utf-8',\n        'MacCyrillic': 'cp1251',\n    }\n    if encoding in alternates:\n        return alternates[encoding]\n    else:\n        return encoding", "entry_point": "custom_decode", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/usc-isi-i2/etk/blob/aab077c984ea20f5e8ae33af622fe11d3c4df866/etk/extractors/readability/encoding.py#L34-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034513", "code": "def date_clean(date, dashboard_style=False):\n  \"\"\"\n  Clean the numerical date value in order to present it.\n\n  Args:\n    boo: numerical date (20160205)\n  Returns:\n    Stringified version of the input date (\"2016-02-05\")\n  \"\"\"\n  if dashboard_style:\n    dt = str(date)\n    out = dt[4:6] + '/' + dt[6:] + '/' + dt[:4]\n  else:\n    dt = str(date)\n    out = dt[:4] + '-' + dt[4:6] + '-' + dt[6:]\n  return out", "entry_point": "date_clean", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "\", /'b', 'c']/['a'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/usc-isi-i2/etk/blob/aab077c984ea20f5e8ae33af622fe11d3c4df866/etk/data_extractors/htiExtractors/utils.py#L118-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034514", "code": "def _combine_ngrams(ngrams, joiner) -> str:\n        \"\"\"Construct keys for checking in trie\"\"\"\n        if isinstance(ngrams, str):\n            return ngrams\n        else:\n            combined = joiner.join(ngrams)\n            return combined", "entry_point": "_combine_ngrams", "input": "'AbC dEf', 0.5", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/usc-isi-i2/etk/blob/aab077c984ea20f5e8ae33af622fe11d3c4df866/etk/extractors/glossary_extractor.py#L142-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034515", "code": "def gen_html(row_list):\n        \"\"\" Return html table string from a list of data rows \"\"\"\n        table = \"<table>\"\n        for row in row_list:\n            table += \"<tr>\"\n            cells = row[\"cells\"]\n            for c in cells:\n                t = c['cell'] if c else ''\n                table += t\n            table += \"</tr>\"\n        table += \"</table>\"\n        return table", "entry_point": "gen_html", "input": "[]", "output": "'<table></table>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/usc-isi-i2/etk/blob/aab077c984ea20f5e8ae33af622fe11d3c4df866/etk/extractors/table_extractor.py#L463-L474", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034516", "code": "def get_addresses(message: list) -> list:\n    \"\"\"\n    parses a raw list from zmq to get back the components that are the address\n    messages are broken by the addresses in the beginning and then the\n    message, like this: ```addresses | '' | message ```\n    \"\"\"\n    # Need the address so that we know who to send the message back to\n    addresses = []\n    for address in message:\n        # if we hit a blank string, then we've got all the addresses\n        if address == b'':\n            break\n        addresses.append(address)\n\n    return addresses", "entry_point": "get_addresses", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benhoff/vexbot/blob/9b844eb20e84eea92a0e7db7d86a90094956c38f/vexbot/util/messaging.py#L3-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034517", "code": "def _name_helper(name: str):\n    \"\"\"\n    default to returning a name with `.service`\n    \"\"\"\n    name = name.rstrip()\n    if name.endswith(('.service', '.socket', '.target')):\n        return name\n    return name + '.service'", "entry_point": "_name_helper", "input": "'  padded  '", "output": "'  padded.service'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benhoff/vexbot/blob/9b844eb20e84eea92a0e7db7d86a90094956c38f/vexbot/subprocess_manager.py#L12-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034518", "code": "def parametrize(params):\n    \"\"\"Return list of params as params.\n\n    >>> parametrize(['a'])\n    'a'\n    >>> parametrize(['a', 'b'])\n    'a[b]'\n    >>> parametrize(['a', 'b', 'c'])\n    'a[b][c]'\n\n    \"\"\"\n    returned = str(params[0])\n    returned += \"\".join(\"[\" + str(p) + \"]\" for p in params[1:])\n    return returned", "entry_point": "parametrize", "input": "[1, 2, 3]", "output": "'1[2][3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uber/multidimensional_urlencode/blob/f626528bc3535503fa1557a53bbfacaa29920251/multidimensional_urlencode/urlencoder.py#L41-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034519", "code": "def lower_dict(d):\n    \"\"\"Lower cases string keys in given dict.\"\"\"\n\n    _d = {}\n\n    for k, v in d.items():\n        try:\n            _d[k.lower()] = v\n        except AttributeError:\n            _d[k] = v\n\n    return _d", "entry_point": "lower_dict", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kennethreitz/env/blob/de639fe021c6a42a99f8458ebb90a01c0c4085d7/env.py#L10-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034520", "code": "def format_comment(comment_data):\n    \"\"\"Formats the data returned by the linters.\n\n    Given a dictionary with the fields: line, column, severity, message_id,\n    message, will generate a message like:\n\n    'line {line}, col {column}: {severity}: [{message_id}]: {message}'\n\n    Any of the fields may nbe absent.\n\n    Args:\n      comment_data: dictionary with the linter data.\n\n    Returns:\n      a string with the formatted message.\n    \"\"\"\n    format_pieces = []\n    # Line and column information\n    if 'line' in comment_data:\n        format_pieces.append('line {line}')\n    if 'column' in comment_data:\n        if format_pieces:\n            format_pieces.append(', ')\n        format_pieces.append('col {column}')\n    if format_pieces:\n        format_pieces.append(': ')\n\n    # Severity and Id information\n    if 'severity' in comment_data:\n        format_pieces.append('{severity}: ')\n\n    if 'message_id' in comment_data:\n        format_pieces.append('[{message_id}]: ')\n\n    # The message\n    if 'message' in comment_data:\n        format_pieces.append('{message}')\n\n    return ''.join(format_pieces).format(**comment_data)", "entry_point": "format_comment", "input": "{'x': [1, 2], 'y': []}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sk-/git-lint/blob/4f19ec88bfa1b6670ff37ccbfc53c6b67251b027/gitlint/__init__.py#L112-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034521", "code": "def _reorder_lines(lines):\n    \"\"\"\n    Reorder lines so that the distance from the end of one to the beginning of\n    the next is minimised.\n    \"\"\"\n\n    x = 0\n    y = 0\n    new_lines = []\n\n    # treat the list of lines as a stack, off which we keep popping the best\n    # one to add next.\n    while lines:\n        # looping over all the lines like this isn't terribly efficient, but\n        # in local tests seems to handle a few thousand lines without a\n        # problem.\n        min_dist = None\n        min_i = None\n        for i, line in enumerate(lines):\n            moveto, _, _ = line\n\n            dist = abs(moveto.x - x) + abs(moveto.y - y)\n            if min_dist is None or dist < min_dist:\n                min_dist = dist\n                min_i = i\n\n        assert min_i is not None\n        line = lines.pop(min_i)\n        _, endsat, _ = line\n        x = endsat.x\n        y = endsat.y\n        new_lines.append(line)\n\n    return new_lines", "entry_point": "_reorder_lines", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tilezen/mapbox-vector-tile/blob/7327b8cff0aa2de1d5233e556bf00429ba2126a0/mapbox_vector_tile/optimise.py#L149-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034522", "code": "def stripped_args(args):\n    \"\"\"\n    Return the stripped version of the arguments.\n    \"\"\"\n    stripped_args = []\n    for arg in args:\n        stripped_args.append(arg.strip())\n\n    return stripped_args", "entry_point": "stripped_args", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickjj/ansigenome/blob/70cd98d7a23d36c56f4e713ea820cfb4c485c81c/ansigenome/utils.py#L361-L369", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034523", "code": "def split_levels(fields):\n    \"\"\"\n        Convert dot-notation such as ['a', 'a.b', 'a.d', 'c'] into\n        current-level fields ['a', 'c'] and next-level fields\n        {'a': ['b', 'd']}.\n    \"\"\"\n    first_level_fields = []\n    next_level_fields = {}\n\n    if not fields:\n        return first_level_fields, next_level_fields\n\n    if not isinstance(fields, list):\n        fields = [a.strip() for a in fields.split(\",\") if a.strip()]\n    for e in fields:\n        if \".\" in e:\n            first_level, next_level = e.split(\".\", 1)\n            first_level_fields.append(first_level)\n            next_level_fields.setdefault(first_level, []).append(next_level)\n        else:\n            first_level_fields.append(e)\n\n    first_level_fields = list(set(first_level_fields))\n    return first_level_fields, next_level_fields", "entry_point": "split_levels", "input": "['apple', 'banana', 'cherry']", "output": "(['banana', 'apple', 'cherry'], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rsinger86/drf-flex-fields/blob/56495f15977d76697972acac571792e8fd67003d/rest_flex_fields/utils.py#L14-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034524", "code": "def _parse_modes(mode_string, unary_modes=\"\"):\n    \"\"\"\n    Parse the mode_string and return a list of triples.\n\n    If no string is supplied return an empty list.\n\n    >>> _parse_modes('')\n    []\n\n    If no sign is supplied, return an empty list.\n\n    >>> _parse_modes('ab')\n    []\n\n    Discard unused args.\n\n    >>> _parse_modes('+a foo bar baz')\n    [['+', 'a', None]]\n\n    Return none for unary args when not provided\n\n    >>> _parse_modes('+abc foo', unary_modes='abc')\n    [['+', 'a', 'foo'], ['+', 'b', None], ['+', 'c', None]]\n\n    This function never throws an error:\n\n    >>> import random\n    >>> def random_text(min_len = 3, max_len = 80):\n    ...     len = random.randint(min_len, max_len)\n    ...     chars_to_choose = [chr(x) for x in range(0,1024)]\n    ...     chars = (random.choice(chars_to_choose) for x in range(len))\n    ...     return ''.join(chars)\n    >>> def random_texts(min_len = 3, max_len = 80):\n    ...     while True:\n    ...         yield random_text(min_len, max_len)\n    >>> import itertools\n    >>> texts = itertools.islice(random_texts(), 1000)\n    >>> set(type(_parse_modes(text)) for text in texts) == {list}\n    True\n    \"\"\"\n\n    # mode_string must be non-empty and begin with a sign\n    if not mode_string or not mode_string[0] in '+-':\n        return []\n\n    modes = []\n\n    parts = mode_string.split()\n\n    mode_part, args = parts[0], parts[1:]\n\n    for ch in mode_part:\n        if ch in \"+-\":\n            sign = ch\n            continue\n        arg = args.pop(0) if ch in unary_modes and args else None\n        modes.append([sign, ch, arg])\n    return modes", "entry_point": "_parse_modes", "input": "'a,b,c', [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/irc/blob/571c1f448d5d5bb92bbe2605c33148bf6e698413/irc/modes.py#L32-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034525", "code": "def parse(item):\n        r\"\"\"\n        >>> Tag.parse('x') == {'key': 'x', 'value': None}\n        True\n\n        >>> Tag.parse('x=yes') == {'key': 'x', 'value': 'yes'}\n        True\n\n        >>> Tag.parse('x=3')['value']\n        '3'\n\n        >>> Tag.parse('x=red fox\\\\:green eggs')['value']\n        'red fox;green eggs'\n\n        >>> Tag.parse('x=red fox:green eggs')['value']\n        'red fox:green eggs'\n\n        >>> Tag.parse('x=a\\\\nb\\\\nc')['value']\n        'a\\nb\\nc'\n        \"\"\"\n        key, sep, value = item.partition('=')\n        value = value.replace('\\\\:', ';')\n        value = value.replace('\\\\s', ' ')\n        value = value.replace('\\\\n', '\\n')\n        value = value.replace('\\\\r', '\\r')\n        value = value.replace('\\\\\\\\', '\\\\')\n        value = value or None\n        return {\n            'key': key,\n            'value': value,\n        }", "entry_point": "parse", "input": "'  padded  '", "output": "{'key': '  padded  ', 'value': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/irc/blob/571c1f448d5d5bb92bbe2605c33148bf6e698413/irc/message.py#L6-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034526", "code": "def from_group(group):\n        \"\"\"\n        Construct arguments from the regex group\n\n        >>> Arguments.from_group('foo')\n        ['foo']\n\n        >>> Arguments.from_group(None)\n        []\n\n        >>> Arguments.from_group('')\n        []\n\n        >>> Arguments.from_group('foo bar')\n        ['foo', 'bar']\n\n        >>> Arguments.from_group('foo bar :baz')\n        ['foo', 'bar', 'baz']\n\n        >>> Arguments.from_group('foo bar :baz bing')\n        ['foo', 'bar', 'baz bing']\n        \"\"\"\n        if not group:\n            return []\n\n        main, sep, ext = group.partition(\" :\")\n        arguments = main.split()\n        if sep:\n            arguments.append(ext)\n\n        return arguments", "entry_point": "from_group", "input": "()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/irc/blob/571c1f448d5d5bb92bbe2605c33148bf6e698413/irc/message.py#L51-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034527", "code": "def last_line(text):\n    \"\"\"\n    Get the last meaningful line of the text, that is the last non-empty line.\n\n    :param text: Text to search the last line\n    :type text: str\n    :return:\n    :rtype: str\n    \"\"\"\n    last_line_of_text = \"\"\n    while last_line_of_text == \"\" and len(text) > 0:\n        last_line_start = text.rfind(\"\\n\")\n        # Handle one-line strings (without \\n)\n        last_line_start = max(0, last_line_start)\n        last_line_of_text = text[last_line_start:].strip(\"\\r\\n \")\n        text = text[:last_line_start]\n    return last_line_of_text", "entry_point": "last_line", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chovanecm/sacredboard/blob/47e1c99e3be3c1b099d3772bc077f5666020eb0b/sacredboard/app/config/jinja_filters.py#L34-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034528", "code": "def product(seq):\n    \"\"\"Return the product of a sequence of numerical values.\n    >>> product([1,2,6])\n    12\n    \"\"\"\n    if len(seq) == 0:\n        return 0\n    else:\n        product = 1\n        for x in seq:\n            product *= x\n        return product", "entry_point": "product", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/proycon/pynlpl/blob/7707f69a91caaa6cde037f0d0379f1d42500a68b/pynlpl/statistics.py#L520-L531", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034529", "code": "def join_ops(ops1, ops2):\n        \"\"\"For internal use.\"\"\"\n        i = len(ops1) - 1\n        j = 0\n        while i >= 0 and j < len(ops2):\n            if ops1[i] == ops2[j]:\n                i -= 1\n                j += 1\n            else:\n                break\n        return ops1[:i + 1] + ops2[j:]", "entry_point": "join_ops", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Blueqat/Blueqat/blob/2ac8592c79e7acf4f385d982af82fbd68dafa5cc/blueqat/pauli.py#L314-L324", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034530", "code": "def parse_parametrs(p):\n    \"\"\"\n    Parses the parameters given from POST or websocket reqs\n    expecting the parameters as:  \"11|par1='asd'|6|par2=1\"\n    returns a dict like {par1:'asd',par2:1}\n    \"\"\"\n    ret = {}\n    while len(p) > 1 and p.count('|') > 0:\n        s = p.split('|')\n        l = int(s[0])  # length of param field\n        if l > 0:\n            p = p[len(s[0]) + 1:]\n            field_name = p.split('|')[0].split('=')[0]\n            field_value = p[len(field_name) + 1:l]\n            p = p[l + 1:]\n            ret[field_name] = field_value\n    return ret", "entry_point": "parse_parametrs", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dddomodossola/remi/blob/85206f62220662bb7ecd471042268def71ccad28/remi/server.py#L268-L284", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034531", "code": "def transform_position(data, trans_x=None, trans_y=None):\n        \"\"\"\n        Transform all the variables that map onto the x and y scales.\n\n        Parameters\n        ----------\n        data    : dataframe\n        trans_x : function\n            Transforms x scale mappings\n            Takes one argument, either a scalar or an array-type\n        trans_y : function\n            Transforms y scale mappings\n            Takes one argument, either a scalar or an array-type\n        \"\"\"\n        # Aesthetics that map onto the x and y scales\n        X = {'x', 'xmin', 'xmax', 'xend', 'xintercept'}\n        Y = {'y', 'ymin', 'ymax', 'yend', 'yintercept'}\n\n        if trans_x:\n            xs = [name for name in data.columns if name in X]\n            data[xs] = data[xs].apply(trans_x)\n\n        if trans_y:\n            ys = [name for name in data.columns if name in Y]\n            data[ys] = data[ys].apply(trans_y)\n\n        return data", "entry_point": "transform_position", "input": "[-1, 0, 1, 2], [], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/has2k1/plotnine/blob/566e579af705367e584fb27a74e6c5199624ca89/plotnine/positions/position.py#L77-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034532", "code": "def rename_aesthetics(obj):\n    \"\"\"\n    Rename aesthetics in obj\n\n    Parameters\n    ----------\n    obj : dict or list\n        Object that contains aesthetics names\n\n    Returns\n    -------\n    obj : dict or list\n        Object that contains aesthetics names\n    \"\"\"\n    if isinstance(obj, dict):\n        for name in obj:\n            new_name = name.replace('colour', 'color')\n            if name != new_name:\n                obj[new_name] = obj.pop(name)\n    else:\n        obj = [name.replace('colour', 'color') for name in obj]\n\n    return obj", "entry_point": "rename_aesthetics", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/has2k1/plotnine/blob/566e579af705367e584fb27a74e6c5199624ca89/plotnine/aes.py#L144-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034533", "code": "def copy_keys(source, destination, keys=None):\n    \"\"\"\n    Add keys in source to destination\n\n    Parameters\n    ----------\n    source : dict\n\n    destination: dict\n\n    keys : None | iterable\n        The keys in source to be copied into destination. If\n        None, then `keys = destination.keys()`\n    \"\"\"\n    if keys is None:\n        keys = destination.keys()\n    for k in set(source) & set(keys):\n        destination[k] = source[k]\n    return destination", "entry_point": "copy_keys", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/has2k1/plotnine/blob/566e579af705367e584fb27a74e6c5199624ca89/plotnine/utils.py#L766-L784", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034534", "code": "def _build_projection_expression(clean_table_keys):\n    \"\"\"Given cleaned up keys, this will return a projection expression for\n    the dynamodb lookup.\n\n    Args:\n        clean_table_keys (dict): keys without the data types attached\n\n    Returns:\n        str: A projection expression for the dynamodb lookup.\n    \"\"\"\n    projection_expression = ''\n    for key in clean_table_keys[:-1]:\n        projection_expression += ('{},').format(key)\n    projection_expression += clean_table_keys[-1]\n    return projection_expression", "entry_point": "_build_projection_expression", "input": "('a', 'b', 'c')", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudtools/stacker/blob/ad6013a03a560c46ba3c63c4d153336273e6da5d/stacker/lookups/handlers/dynamodb.py#L129-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034535", "code": "def _convert_ddb_list_to_list(conversion_list):\n    \"\"\"Given a dynamodb list, it will return a python list without the dynamodb\n        datatypes\n\n    Args:\n        conversion_list (dict): a dynamodb list which includes the\n            datatypes\n\n    Returns:\n        list: Returns a sanitized list without the dynamodb datatypes\n    \"\"\"\n    ret_list = []\n    for v in conversion_list:\n        for v1 in v:\n            ret_list.append(v[v1])\n    return ret_list", "entry_point": "_convert_ddb_list_to_list", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudtools/stacker/blob/ad6013a03a560c46ba3c63c4d153336273e6da5d/stacker/lookups/handlers/dynamodb.py#L180-L195", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034536", "code": "def format_params_diff(parameter_diff):\n    \"\"\"Handles the formatting of differences in parameters.\n\n    Args:\n        parameter_diff (list): A list of DictValues detailing the\n            differences between two dicts returned by\n            :func:`stacker.actions.diff.diff_dictionaries`\n    Returns:\n        string: A formatted string that represents a parameter diff\n    \"\"\"\n\n    params_output = '\\n'.join([line for v in parameter_diff\n                               for line in v.changes()])\n    return \"\"\"--- Old Parameters\n+++ New Parameters\n******************\n%s\\n\"\"\" % params_output", "entry_point": "format_params_diff", "input": "[]", "output": "'--- Old Parameters\\n+++ New Parameters\\n******************\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudtools/stacker/blob/ad6013a03a560c46ba3c63c4d153336273e6da5d/stacker/actions/diff.py#L114-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034537", "code": "def add_params(param_list_left, param_list_right):\n    \"\"\"Add two lists of parameters one by one\n\n    :param param_list_left: list of numpy arrays\n    :param param_list_right: list of numpy arrays\n    :return: list of numpy arrays\n    \"\"\"\n    res = []\n    for x, y in zip(param_list_left, param_list_right):\n        res.append(x + y)\n    return res", "entry_point": "add_params", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxpumperla/elephas/blob/84605acdc9564673c487637dcb27f5def128bcc7/elephas/utils/functional_utils.py#L7-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034538", "code": "def subtract_params(param_list_left, param_list_right):\n    \"\"\"Subtract two lists of parameters\n\n    :param param_list_left: list of numpy arrays\n    :param param_list_right: list of numpy arrays\n    :return: list of numpy arrays\n    \"\"\"\n    res = []\n    for x, y in zip(param_list_left, param_list_right):\n        res.append(x - y)\n    return res", "entry_point": "subtract_params", "input": "(1, 2), set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxpumperla/elephas/blob/84605acdc9564673c487637dcb27f5def128bcc7/elephas/utils/functional_utils.py#L20-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034539", "code": "def divide_by(array_list, num_workers):\n    \"\"\"Divide a list of parameters by an integer num_workers.\n\n    :param array_list:\n    :param num_workers:\n    :return:\n    \"\"\"\n    for i, x in enumerate(array_list):\n        array_list[i] /= num_workers\n    return array_list", "entry_point": "divide_by", "input": "[-1, 0, 1, 2], 10", "output": "[-0.1, 0.0, 0.1, 0.2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxpumperla/elephas/blob/84605acdc9564673c487637dcb27f5def128bcc7/elephas/utils/functional_utils.py#L46-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034540", "code": "def latLongGridPredicate(field, digits=1):\n    \"\"\"\n    Given a lat / long pair, return the grid coordinates at the\n    nearest base value.  e.g., (42.3, -5.4) returns a grid at 0.1\n    degree resolution of 0.1 degrees of latitude ~ 7km, so this is\n    effectively a 14km lat grid.  This is imprecise for longitude,\n    since 1 degree of longitude is 0km at the poles, and up to 111km\n    at the equator. But it should be reasonably precise given some\n    prior logical block (e.g., country).\n    \"\"\"\n    if any(field):\n        return (str([round(dim, digits) for dim in field]),)\n    else:\n        return ()", "entry_point": "latLongGridPredicate", "input": "'', 2.0", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dedupeio/dedupe/blob/9f7c9f84473a4bcacf0f2b11152d8ed3eb35d48b/dedupe/predicates.py#L474-L487", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034541", "code": "def unique(seq):\n    \"\"\"Return the unique elements of a collection even if those elements are\n       unhashable and unsortable, like dicts and sets\"\"\"\n    cleaned = []\n    for each in seq:\n        if each not in cleaned:\n            cleaned.append(each)\n    return cleaned", "entry_point": "unique", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dedupeio/dedupe/blob/9f7c9f84473a4bcacf0f2b11152d8ed3eb35d48b/dedupe/labeler.py#L383-L390", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034542", "code": "def u32le_list_to_byte_list(data):\n    \"\"\"! @brief Convert a word array into a byte array\"\"\"\n    res = []\n    for x in data:\n        res.append((x >> 0) & 0xff)\n        res.append((x >> 8) & 0xff)\n        res.append((x >> 16) & 0xff)\n        res.append((x >> 24) & 0xff)\n    return res", "entry_point": "u32le_list_to_byte_list", "input": "[-1, 0, 1, 2]", "output": "[255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbedmicro/pyOCD/blob/41a174718a9739f3cbe785c2ba21cb7fd1310c6f/pyocd/utility/conversion.py#L39-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034543", "code": "def u16le_list_to_byte_list(data):\n    \"\"\"! @brief Convert a halfword array into a byte array\"\"\"\n    byteData = []\n    for h in data:\n        byteData.extend([h & 0xff, (h >> 8) & 0xff])\n    return byteData", "entry_point": "u16le_list_to_byte_list", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbedmicro/pyOCD/blob/41a174718a9739f3cbe785c2ba21cb7fd1310c6f/pyocd/utility/conversion.py#L49-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034544", "code": "def byte_list_to_u16le_list(byteData):\n    \"\"\"! @brief Convert a byte array into a halfword array\"\"\"\n    data = []\n    for i in range(0, len(byteData), 2):\n        data.append(byteData[i] | (byteData[i + 1] << 8))\n    return data", "entry_point": "byte_list_to_u16le_list", "input": "[5, 3, 1, 4]", "output": "[773, 1025]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbedmicro/pyOCD/blob/41a174718a9739f3cbe785c2ba21cb7fd1310c6f/pyocd/utility/conversion.py#L56-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034545", "code": "def _get_text(node, tag, default=None):\n    \"\"\"Get the text for the provided tag from the provided node\"\"\"\n    try:\n        return node.find(tag).text\n    except AttributeError:\n        return default", "entry_point": "_get_text", "input": "[], ['a', 'b', 'c'], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbedmicro/pyOCD/blob/41a174718a9739f3cbe785c2ba21cb7fd1310c6f/pyocd/debug/svd/parser.py#L33-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034546", "code": "def same(d1, d2):\n    \"\"\"! @brief Test whether two sequences contain the same values.\n    \n    Unlike a simple equality comparison, this function works as expected when the two sequences\n    are of different types, such as a list and bytearray. The sequences must return\n    compatible types from indexing.\n    \"\"\"\n    if len(d1) != len(d2):\n        return False\n    for i in range(len(d1)):\n        if d1[i] != d2[i]:\n            return False\n    return True", "entry_point": "same", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbedmicro/pyOCD/blob/41a174718a9739f3cbe785c2ba21cb7fd1310c6f/pyocd/utility/mask.py#L79-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034547", "code": "def point_from_cols_vals(cols, vals):\n        \"\"\"Create a dict from columns and values lists.\n\n        :param cols: List of columns\n        :param vals: List of values\n        :return: Dict where keys are columns.\n        \"\"\"\n        point = {}\n        for col_index, col_name in enumerate(cols):\n            point[col_name] = vals[col_index]\n\n        return point", "entry_point": "point_from_cols_vals", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "{1: 5, 2: 3, 3: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/influxdata/influxdb-python/blob/d5d12499f3755199d5eedd8b363450f1cf4073bd/influxdb/resultset.py#L195-L206", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034548", "code": "def chunked(data, chunksize):\n    \"\"\"\n    Returns a list of chunks containing at most ``chunksize`` elements of data.\n    \"\"\"\n    if chunksize < 1:\n        raise ValueError(\"Chunksize must be at least 1!\")\n    if int(chunksize) != chunksize:\n        raise ValueError(\"Chunksize needs to be an integer\")\n    res = []\n    cur = []\n    for e in data:\n        cur.append(e)\n        if len(cur) >= chunksize:\n            res.append(cur)\n            cur = []\n    if cur:\n        res.append(cur)\n    return res", "entry_point": "chunked", "input": "[[1, 2], [3], []], 5", "output": "[[[1, 2], [3], []]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CodeReclaimers/neat-python/blob/e3dbe77c0d776eae41d598e6439e6ac02ab90b18/neat/distributed.py#L152-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034549", "code": "def compute_output(t0, t1):\n    '''Compute the network's output based on the \"time to first spike\" of the two output neurons.'''\n    if t0 is None or t1 is None:\n        # If neither of the output neurons fired within the allotted time,\n        # give a response which produces a large error.\n        return -1.0\n    else:\n        # If the output neurons fire within 1.0 milliseconds of each other,\n        # the output is 1, and if they fire more than 11 milliseconds apart,\n        # the output is 0, with linear interpolation between 1 and 11 milliseconds.\n        response = 1.1 - 0.1 * abs(t0 - t1)\n        return max(0.0, min(1.0, response))", "entry_point": "compute_output", "input": "True, -3", "output": "0.7000000000000001", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CodeReclaimers/neat-python/blob/e3dbe77c0d776eae41d598e6439e6ac02ab90b18/examples/xor/evolve-spiking.py#L19-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034550", "code": "def get_host(environ):\n    # type: (Dict[str, str]) -> str\n    \"\"\"Return the host for the given WSGI environment. Yanked from Werkzeug.\"\"\"\n    if environ.get(\"HTTP_HOST\"):\n        rv = environ[\"HTTP_HOST\"]\n        if environ[\"wsgi.url_scheme\"] == \"http\" and rv.endswith(\":80\"):\n            rv = rv[:-3]\n        elif environ[\"wsgi.url_scheme\"] == \"https\" and rv.endswith(\":443\"):\n            rv = rv[:-4]\n    elif environ.get(\"SERVER_NAME\"):\n        rv = environ[\"SERVER_NAME\"]\n        if (environ[\"wsgi.url_scheme\"], environ[\"SERVER_PORT\"]) not in (\n            (\"https\", \"443\"),\n            (\"http\", \"80\"),\n        ):\n            rv += \":\" + environ[\"SERVER_PORT\"]\n    else:\n        # In spite of the WSGI spec, SERVER_NAME might not be present.\n        rv = \"unknown\"\n\n    return rv", "entry_point": "get_host", "input": "{'x': [1, 2], 'y': []}", "output": "'unknown'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/getsentry/sentry-python/blob/a1d77722bdce0b94660ebf50b5c4a4645916d084/sentry_sdk/integrations/wsgi.py#L35-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034551", "code": "def absl_to_cpp(level):\n  \"\"\"Converts an absl log level to a cpp log level.\n\n  Args:\n    level: int, an absl.logging level.\n\n  Raises:\n    TypeError: Raised when level is not an integer.\n\n  Returns:\n    The corresponding integer level for use in Abseil C++.\n  \"\"\"\n  if not isinstance(level, int):\n    raise TypeError('Expect an int level, found {}'.format(type(level)))\n  if level >= 0:\n    # C++ log levels must be >= 0\n    return 0\n  else:\n    return -level", "entry_point": "absl_to_cpp", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abseil/abseil-py/blob/9d73fdaa23a6b6726aa5731390f388c0c6250ee5/absl/logging/converter.py#L117-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034552", "code": "def _is_undefok(arg, undefok_names):\n  \"\"\"Returns whether we can ignore arg based on a set of undefok flag names.\"\"\"\n  if not arg.startswith('-'):\n    return False\n  if arg.startswith('--'):\n    arg_without_dash = arg[2:]\n  else:\n    arg_without_dash = arg[1:]\n  if '=' in arg_without_dash:\n    name, _ = arg_without_dash.split('=', 1)\n  else:\n    name = arg_without_dash\n  if name in undefok_names:\n    return True\n  return False", "entry_point": "_is_undefok", "input": "'AbC dEf', {1, 2, 3}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abseil/abseil-py/blob/9d73fdaa23a6b6726aa5731390f388c0c6250ee5/absl/flags/argparse_flags.py#L358-L372", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034553", "code": "def trim_docstring(docstring):\n  \"\"\"Removes indentation from triple-quoted strings.\n\n  This is the function specified in PEP 257 to handle docstrings:\n  https://www.python.org/dev/peps/pep-0257/.\n\n  Args:\n    docstring: str, a python docstring.\n\n  Returns:\n    str, docstring with indentation removed.\n  \"\"\"\n  if not docstring:\n    return ''\n\n  # If you've got a line longer than this you have other problems...\n  max_indent = 1 << 29\n\n  # Convert tabs to spaces (following the normal Python rules)\n  # and split into a list of lines:\n  lines = docstring.expandtabs().splitlines()\n\n  # Determine minimum indentation (first line doesn't count):\n  indent = max_indent\n  for line in lines[1:]:\n    stripped = line.lstrip()\n    if stripped:\n      indent = min(indent, len(line) - len(stripped))\n  # Remove indentation (first line is special):\n  trimmed = [lines[0].strip()]\n  if indent < max_indent:\n    for line in lines[1:]:\n      trimmed.append(line[indent:].rstrip())\n  # Strip off trailing and leading blank lines:\n  while trimmed and not trimmed[-1]:\n    trimmed.pop()\n  while trimmed and not trimmed[0]:\n    trimmed.pop(0)\n  # Return a single string:\n  return '\\n'.join(trimmed)", "entry_point": "trim_docstring", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abseil/abseil-py/blob/9d73fdaa23a6b6726aa5731390f388c0c6250ee5/absl/flags/_helpers.py#L359-L398", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034554", "code": "def get_thresholds(points=100, power=3) -> list:\n    \"\"\"Run a function with a series of thresholds between 0 and 1\"\"\"\n    return [(i / (points + 1)) ** power for i in range(1, points + 1)]", "entry_point": "get_thresholds", "input": "False, {'x': [1, 2], 'y': []}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MycroftAI/mycroft-precise/blob/e17cebdd171906dbd8a16e282d8a7966fba2eeba/precise/scripts/graph.py#L57-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034555", "code": "def bech32_polymod(values):\n    \"\"\"Internal function that computes the Bech32 checksum.\"\"\"\n    generator = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]\n    chk = 1\n    for value in values:\n        top = chk >> 25\n        chk = (chk & 0x1ffffff) << 5 ^ value\n        for i in range(5):\n            chk ^= generator[i] if ((top >> i) & 1) else 0\n    return chk", "entry_point": "bech32_polymod", "input": "[5, 3, 1, 4]", "output": "1215524", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ofek/bit/blob/20fc0e7047946c1f28f868008d99d659905c1af6/bit/base32.py#L26-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034556", "code": "def bech32_hrp_expand(hrp):\n    \"\"\"Expand the HRP into values for checksum computation.\"\"\"\n    return [ord(x) >> 5 for x in hrp] + [0] + [ord(x) & 31 for x in hrp]", "entry_point": "bech32_hrp_expand", "input": "['a', 'b', 'c']", "output": "[3, 3, 3, 0, 1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ofek/bit/blob/20fc0e7047946c1f28f868008d99d659905c1af6/bit/base32.py#L38-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034557", "code": "def _get_filename(class_name, language):\n        \"\"\"\n        Generate the specific filename.\n\n        Parameters\n        ----------\n        :param class_name : str\n            The used class name.\n\n        :param language : {'c', 'go', 'java', 'js', 'php', 'ruby'}\n            The target programming language.\n\n        Returns\n        -------\n            filename : str\n            The generated filename.\n        \"\"\"\n        name = str(class_name).strip()\n        lang = str(language)\n\n        # Name:\n        if language in ['java', 'php']:\n            name = \"\".join([name[0].upper() + name[1:]])\n\n        # Suffix:\n        suffix = {\n            'c': 'c', 'java': 'java', 'js': 'js',\n            'go': 'go', 'php': 'php', 'ruby': 'rb'\n        }\n        suffix = suffix.get(lang, lang)\n\n        # Filename:\n        return '{}.{}'.format(name, suffix)", "entry_point": "_get_filename", "input": "'abc', ['apple', 'banana', 'cherry']", "output": "\"abc.['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nok/sklearn-porter/blob/04673f768310bde31f9747a68a5e070592441ef2/sklearn_porter/Porter.py#L456-L488", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034558", "code": "def rpr(s):\n    \"\"\"Create a representation of a Unicode string that can be used in both\n    Python 2 and Python 3k, allowing for use of the u() function\"\"\"\n    if s is None:\n        return 'None'\n    seen_unicode = False\n    results = []\n    for cc in s:\n        ccn = ord(cc)\n        if ccn >= 32 and ccn < 127:\n            if cc == \"'\":  # escape single quote\n                results.append('\\\\')\n                results.append(cc)\n            elif cc == \"\\\\\":  # escape backslash\n                results.append('\\\\')\n                results.append(cc)\n            else:\n                results.append(cc)\n        else:\n            seen_unicode = True\n            if ccn <= 0xFFFF:\n                results.append('\\\\u')\n                results.append(\"%04x\" % ccn)\n            else:  # pragma no cover\n                results.append('\\\\U')\n                results.append(\"%08x\" % ccn)\n    result = \"'\" + \"\".join(results) + \"'\"\n    if seen_unicode:\n        return \"u(\" + result + \")\"\n    else:\n        return result", "entry_point": "rpr", "input": "[]", "output": "\"''\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daviddrysdale/python-phonenumbers/blob/9cc5bb4ab5e661e70789b4c64bf7a9383c7bdc20/python/phonenumbers/util.py#L111-L141", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034559", "code": "def parse_connection_string_libpq(connection_string):\n    \"\"\"parse a postgresql connection string as defined in\n    http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING\"\"\"\n    fields = {}\n    while True:\n        connection_string = connection_string.strip()\n        if not connection_string:\n            break\n        if \"=\" not in connection_string:\n            raise ValueError(\"expecting key=value format in connection_string fragment {!r}\".format(connection_string))\n        key, rem = connection_string.split(\"=\", 1)\n        if rem.startswith(\"'\"):\n            asis, value = False, \"\"\n            for i in range(1, len(rem)):\n                if asis:\n                    value += rem[i]\n                    asis = False\n                elif rem[i] == \"'\":\n                    break  # end of entry\n                elif rem[i] == \"\\\\\":\n                    asis = True\n                else:\n                    value += rem[i]\n            else:\n                raise ValueError(\"invalid connection_string fragment {!r}\".format(rem))\n            connection_string = rem[i + 1:]  # pylint: disable=undefined-loop-variable\n        else:\n            res = rem.split(None, 1)\n            if len(res) > 1:\n                value, connection_string = res\n            else:\n                value, connection_string = rem, \"\"\n        fields[key] = value\n    return fields", "entry_point": "parse_connection_string_libpq", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aiven/pghoard/blob/2994165d4ef3ff7a5669a2527346bcbfb5b3bd8a/pghoard/pgutil.py#L67-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034560", "code": "def get_display_label(choices, status):\n    \"\"\"Get a display label for resource status.\n\n    This method is used in places where a resource's status or\n    admin state labels need to assigned before they are sent to the\n    view template.\n    \"\"\"\n\n    for (value, label) in choices:\n        if value == (status or '').lower():\n            display_label = label\n            break\n    else:\n        display_label = status\n\n    return display_label", "entry_point": "get_display_label", "input": "[], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/horizon/blob/5601ea9477323e599d9b766fcac1f8be742935b2/openstack_dashboard/utils/filters.py#L32-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034561", "code": "def _np_dtype(bit_res, discrete):\n    \"\"\"\n    Given the bit resolution of a signal, return the minimum numpy dtype\n    used to store it.\n\n    Parameters\n    ----------\n    bit_res : int\n        The bit resolution.\n    discrete : bool\n        Whether the dtype is to be int or float.\n\n    Returns\n    -------\n    dtype : str\n        String numpy dtype used to store the signal of the given\n        resolution\n\n    \"\"\"\n    bit_res = min(bit_res, 64)\n\n    for np_res in [8, 16, 32, 64]:\n        if bit_res <= np_res:\n            break\n\n    if discrete is True:\n        return 'int' + str(np_res)\n    else:\n        # No float8 dtype\n        return 'float' + str(max(np_res, 16))", "entry_point": "_np_dtype", "input": "3.25, set()", "output": "'float16'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MIT-LCP/wfdb-python/blob/cc8c9e9e44f10af961b7a9d8ae03708b31ac8a8c/wfdb/io/_signal.py#L1599-L1628", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034562", "code": "def describe_list_indices(full_list):\n    \"\"\"\n    Parameters\n    ----------\n    full_list : list\n        The list of items to order and\n\n    Returns\n    -------\n    unique_elements : list\n        A list of the unique elements of the list, in the order in which\n        they first appear.\n    element_indices : dict\n        A dictionary of lists for each unique element, giving all the\n        indices in which they appear in the original list.\n\n    \"\"\"\n    unique_elements = []\n    element_indices = {}\n\n    for i in range(len(full_list)):\n        item = full_list[i]\n        # new item\n        if item not in unique_elements:\n            unique_elements.append(item)\n            element_indices[item] = [i]\n        # previously seen item\n        else:\n            element_indices[item].append(i)\n    return unique_elements, element_indices", "entry_point": "describe_list_indices", "input": "[]", "output": "([], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MIT-LCP/wfdb-python/blob/cc8c9e9e44f10af961b7a9d8ae03708b31ac8a8c/wfdb/io/_signal.py#L1766-L1795", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034563", "code": "def _get_wanted_channels(wanted_sig_names, record_sig_names, pad=False):\n    \"\"\"\n    Given some wanted signal names, and the signal names contained in a\n    record, return the indices of the record channels that intersect.\n\n    Parameters\n    ----------\n    wanted_sig_names : list\n        List of desired signal name strings\n    record_sig_names : list\n        List of signal names for a single record\n    pad : bool, optional\n        Whether the output channels is to always have the same number\n        of elements and the wanted channels. If True, pads missing\n        signals with None.\n\n    Returns\n    -------\n    wanted_channel_inds\n\n    \"\"\"\n    if pad:\n        return [record_sig_names.index(s) if s in record_sig_names else None for s in wanted_sig_names]\n    else:\n        return [record_sig_names.index(s) for s in wanted_sig_names if s in record_sig_names]", "entry_point": "_get_wanted_channels", "input": "'', '', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MIT-LCP/wfdb-python/blob/cc8c9e9e44f10af961b7a9d8ae03708b31ac8a8c/wfdb/io/record.py#L1405-L1429", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034564", "code": "def is_monotonic(full_list):\n    \"\"\"\n    Determine whether elements in a list are monotonic. ie. unique\n    elements are clustered together.\n\n    ie. [5,5,3,4] is, [5,3,5] is not.\n    \"\"\"\n    prev_elements = set({full_list[0]})\n    prev_item = full_list[0]\n\n    for item in full_list:\n        if item != prev_item:\n            if item in prev_elements:\n                return False\n            prev_item = item\n            prev_elements.add(item)\n\n    return True", "entry_point": "is_monotonic", "input": "['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MIT-LCP/wfdb-python/blob/cc8c9e9e44f10af961b7a9d8ae03708b31ac8a8c/wfdb/io/record.py#L1542-L1559", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034565", "code": "def solidity_library_symbol(library_name):\n    \"\"\" Return the symbol used in the bytecode to represent the `library_name`. \"\"\"\n    # the symbol is always 40 characters in length with the minimum of two\n    # leading and trailing underscores\n    length = min(len(library_name), 36)\n\n    library_piece = library_name[:length]\n    hold_piece = '_' * (36 - length)\n\n    return '__{library}{hold}__'.format(\n        library=library_piece,\n        hold=hold_piece,\n    )", "entry_point": "solidity_library_symbol", "input": "'  padded  '", "output": "'__  padded  ____________________________'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/raiden-network/raiden/blob/407ba15c72074e9de88771d6b9661ff4dc36bef5/raiden/utils/solc.py#L48-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034566", "code": "def dependencies_order_of_build(target_contract, dependencies_map):\n    \"\"\" Return an ordered list of contracts that is sufficient to successfully\n    deploy the target contract.\n\n    Note:\n        This function assumes that the `dependencies_map` is an acyclic graph.\n    \"\"\"\n    if not dependencies_map:\n        return [target_contract]\n\n    if target_contract not in dependencies_map:\n        raise ValueError('no dependencies defined for {}'.format(target_contract))\n\n    order = [target_contract]\n    todo = list(dependencies_map[target_contract])\n\n    while todo:\n        target_contract = todo.pop(0)\n        target_pos = len(order)\n\n        for dependency in dependencies_map[target_contract]:\n            # we need to add the current contract before all its depedencies\n            if dependency in order:\n                target_pos = order.index(dependency)\n            else:\n                todo.append(dependency)\n\n        order.insert(target_pos, target_contract)\n\n    order.reverse()\n    return order", "entry_point": "dependencies_order_of_build", "input": "[5, 3, 1, 4], {}", "output": "[[5, 3, 1, 4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/raiden-network/raiden/blob/407ba15c72074e9de88771d6b9661ff4dc36bef5/raiden/network/rpc/client.py#L232-L262", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034567", "code": "def is_https(request_data):\n        \"\"\"\n        Checks if https or http.\n\n        :param request_data: The request as a dict\n        :type: dict\n\n        :return: False if https is not active\n        :rtype: boolean\n        \"\"\"\n        is_https = 'https' in request_data and request_data['https'] != 'off'\n        is_https = is_https or ('server_port' in request_data and str(request_data['server_port']) == '443')\n        return is_https", "entry_point": "is_https", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onelogin/python3-saml/blob/064b7275fba1e5f39a9116ba1cdcc5d01fc34daa/src/onelogin/saml2/utils.py#L300-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034568", "code": "def _lscmp(a, b):\n    ''' Compares two strings in a cryptographically save way:\n        Runtime is not affected by length of common prefix. '''\n    return not sum(0 if x==y else 1 for x, y in zip(a, b)) and len(a) == len(b)", "entry_point": "_lscmp", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/splunk/splunk-sdk-python/blob/a245a4eeb93b3621730418008e31715912bcdcd8/examples/analytics/bottle.py#L1527-L1530", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034569", "code": "def get_python_files(files):\n        \"\"\"Utility function to get .py files from a list\"\"\"\n        python_files = []\n        for file_name in files:\n            if file_name.endswith(\".py\"):\n                python_files.append(file_name)\n\n        return python_files", "entry_point": "get_python_files", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/splunk/splunk-sdk-python/blob/a245a4eeb93b3621730418008e31715912bcdcd8/setup.py#L146-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034570", "code": "def encode_mv(vals):\n    \"\"\"For multivalues, values are wrapped in '$' and separated using ';'\n    Literal '$' values are represented with '$$'\"\"\"\n    s = \"\"\n    for val in vals:\n        val = val.replace('$', '$$')\n        if len(s) > 0:\n            s += ';'\n        s += '$' + val + '$'\n\n    return s", "entry_point": "encode_mv", "input": "['a', 'b', 'c']", "output": "'$a$;$b$;$c$'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/splunk/splunk-sdk-python/blob/a245a4eeb93b3621730418008e31715912bcdcd8/examples/custom_search/bin/usercount.py#L146-L156", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034571", "code": "def get_param_map(word, required_keys=None):\n    \"\"\"\n    get the optional arguments on a line\n\n    Example\n    -------\n    >>> iline = 0\n    >>> word = 'elset,instance=dummy2,generate'\n    >>> params = get_param_map(iline, word, required_keys=['instance'])\n    params = {\n        'elset' : None,\n        'instance' : 'dummy2,\n        'generate' : None,\n    }\n    \"\"\"\n    if required_keys is None:\n        required_keys = []\n    words = word.split(\",\")\n    param_map = {}\n    for wordi in words:\n        if \"=\" not in wordi:\n            key = wordi.strip()\n            value = None\n        else:\n            sword = wordi.split(\"=\")\n            assert len(sword) == 2, sword\n            key = sword[0].strip()\n            value = sword[1].strip()\n        param_map[key] = value\n\n    msg = \"\"\n    for key in required_keys:\n        if key not in param_map:\n            msg += \"%r not found in %r\\n\" % (key, word)\n    if msg:\n        raise RuntimeError(msg)\n    return param_map", "entry_point": "get_param_map", "input": "'Hello World', []", "output": "{'Hello World': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nschloe/meshio/blob/cb78285962b573fb46a4f3f54276206d922bdbcb/meshio/abaqus_io.py#L193-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034572", "code": "def _match_filters(parameter, filters=None):\n        \"\"\"Return True if the given parameter matches all the filters\"\"\"\n        for filter_obj in (filters or []):\n            key = filter_obj['Key']\n            option = filter_obj.get('Option', 'Equals')\n            values = filter_obj.get('Values', [])\n\n            what = None\n            if key == 'Type':\n                what = parameter.type\n            elif key == 'KeyId':\n                what = parameter.keyid\n\n            if option == 'Equals'\\\n                    and not any(what == value for value in values):\n                return False\n            elif option == 'BeginsWith'\\\n                    and not any(what.startswith(value) for value in values):\n                return False\n        # True if no false match (or no filters at all)\n        return True", "entry_point": "_match_filters", "input": "[], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spulec/moto/blob/4a286c4bc288933bb023396e2784a6fdbb966bc9/moto/ssm/models.py#L273-L293", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034573", "code": "def camelcase_to_underscores(argument):\n    ''' Converts a camelcase param like theNewAttribute to the equivalent\n    python underscore variable like the_new_attribute'''\n    result = ''\n    prev_char_title = True\n    if not argument:\n        return argument\n    for index, char in enumerate(argument):\n        try:\n            next_char_title = argument[index + 1].istitle()\n        except IndexError:\n            next_char_title = True\n\n        upper_to_lower = char.istitle() and not next_char_title\n        lower_to_upper = char.istitle() and not prev_char_title\n\n        if index and (upper_to_lower or lower_to_upper):\n            # Only add underscore if char is capital, not first letter, and next\n            # char is not capital\n            result += \"_\"\n        prev_char_title = char.istitle()\n        if not char.isspace():  # Only add non-whitespace\n            result += char.lower()\n    return result", "entry_point": "camelcase_to_underscores", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spulec/moto/blob/4a286c4bc288933bb023396e2784a6fdbb966bc9/moto/core/utils.py#L17-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034574", "code": "def underscores_to_camelcase(argument):\n    ''' Converts a camelcase param like the_new_attribute to the equivalent\n    camelcase version like theNewAttribute. Note that the first letter is\n    NOT capitalized by this function '''\n    result = ''\n    previous_was_underscore = False\n    for char in argument:\n        if char != '_':\n            if previous_was_underscore:\n                result += char.upper()\n            else:\n                result += char\n        previous_was_underscore = char == '_'\n    return result", "entry_point": "underscores_to_camelcase", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spulec/moto/blob/4a286c4bc288933bb023396e2784a6fdbb966bc9/moto/core/utils.py#L43-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034575", "code": "def _list_element_starts_with(items, needle):\n        \"\"\"True of any of the list elements starts with needle\"\"\"\n        for item in items:\n            if item.startswith(needle):\n                return True\n        return False", "entry_point": "_list_element_starts_with", "input": "[], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spulec/moto/blob/4a286c4bc288933bb023396e2784a6fdbb966bc9/moto/cloudwatch/models.py#L193-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034576", "code": "def convert_kwargs_to_cmd_line_args(kwargs):\n    \"\"\"Helper function to build command line arguments out of dict.\"\"\"\n    args = []\n    for k in sorted(kwargs.keys()):\n        v = kwargs[k]\n        args.append('-{}'.format(k))\n        if v is not None:\n            args.append('{}'.format(v))\n    return args", "entry_point": "convert_kwargs_to_cmd_line_args", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kkroening/ffmpeg-python/blob/ac111dc3a976ddbb872bc7d6d4fe24a267c1a956/ffmpeg/_utils.py#L83-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034577", "code": "def tune_scale(acceptance, scale):\n        \"\"\" Tunes scale for M-H algorithm\n\n        Parameters\n        ----------\n        acceptance : float\n            The most recent acceptance rate\n\n        scale : float\n            The current scale parameter\n\n        Returns\n        ----------\n        scale : float\n            An adjusted scale parameter\n\n        Notes\n        ----------\n        Ross : Initially did this by trial and error, then refined by looking at other\n        implementations, so some credit here to PyMC3 which became a guideline for this.\n        \"\"\"     \n\n        if acceptance > 0.8:\n            scale *= 2.0\n        elif acceptance <= 0.8 and acceptance > 0.4:\n            scale *= 1.3            \n        elif acceptance < 0.234 and acceptance > 0.1:\n            scale *= (1/1.3)\n        elif acceptance <= 0.1 and acceptance > 0.05:\n            scale *= 0.4\n        elif acceptance <= 0.05 and acceptance > 0.01:\n            scale *= 0.2\n        elif acceptance <= 0.01:\n            scale *= 0.1\n        return scale", "entry_point": "tune_scale", "input": "False, -3", "output": "-0.30000000000000004", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RJT1990/pyflux/blob/297f2afc2095acd97c12e827dd500e8ea5da0c0f/pyflux/inference/metropolis_hastings.py#L66-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034578", "code": "def hex_to_rgb(h):\n    \"\"\" Returns 0 to 1 rgb from a hex list or tuple \"\"\"\n    h = h.lstrip('#')\n    return tuple(int(h[i:i+2], 16)/255. for i in (0, 2 ,4))", "entry_point": "hex_to_rgb", "input": "'AbC dEf'", "output": "(0.6705882352941176, 0.047058823529411764, 0.8705882352941177)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/colors.py#L321-L324", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034579", "code": "def get_join_parameters(join_kwargs):\n    \"\"\"\n    Convenience function to determine the columns to join the right and\n    left DataFrames on, as well as any suffixes for the columns.\n    \"\"\"\n\n    by = join_kwargs.get('by', None)\n    suffixes = join_kwargs.get('suffixes', ('_x', '_y'))\n    if isinstance(by, tuple):\n        left_on, right_on = by\n    elif isinstance(by, list):\n        by = [x if isinstance(x, tuple) else (x, x) for x in by]\n        left_on, right_on = (list(x) for x in zip(*by))\n    else:\n        left_on, right_on = by, by\n    return left_on, right_on, suffixes", "entry_point": "get_join_parameters", "input": "{}", "output": "(None, None, ('_x', '_y'))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kieferk/dfply/blob/6a858f066602735a90f8b6b85106bc39ceadc282/dfply/join.py#L8-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034580", "code": "def fsplit(pred, objs):\n    \"\"\"Split a list into two classes according to the predicate.\"\"\"\n    t = []\n    f = []\n    for obj in objs:\n        if pred(obj):\n            t.append(obj)\n        else:\n            f.append(obj)\n    return (t, f)", "entry_point": "fsplit", "input": "[[1, 2], [3], []], []", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/euske/pdfminer/blob/8150458718e9024c80b00e74965510b20206e588/pdfminer/utils.py#L114-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034581", "code": "def rldecode(data):\n    \"\"\"\n    RunLength decoder (Adobe version) implementation based on PDF Reference\n    version 1.4 section 3.3.4:\n        The RunLengthDecode filter decodes data that has been encoded in a\n        simple byte-oriented format based on run length. The encoded data\n        is a sequence of runs, where each run consists of a length byte\n        followed by 1 to 128 bytes of data. If the length byte is in the\n        range 0 to 127, the following length + 1 (1 to 128) bytes are\n        copied literally during decompression. If length is in the range\n        129 to 255, the following single byte is to be copied 257 - length\n        (2 to 128) times during decompression. A length value of 128\n        denotes EOD.\n    >>> s = b'\\x05123456\\xfa7\\x04abcde\\x80junk'\n    >>> rldecode(s)\n    '1234567777777abcde'\n    \"\"\"\n    decoded = []\n    i = 0\n    while i < len(data):\n        #print 'data[%d]=:%d:' % (i,ord(data[i]))\n        length = ord(data[i])\n        if length == 128:\n            break\n        if length >= 0 and length < 128:\n            run = data[i+1:(i+1)+(length+1)]\n            #print 'length=%d, run=%s' % (length+1,run)\n            decoded.append(run)\n            i = (i+1) + (length+1)\n        if length > 128:\n            run = data[i+1]*(257-length)\n            #print 'length=%d, run=%s' % (257-length,run)\n            decoded.append(run)\n            i = (i+1) + 1\n    return b''.join(decoded)", "entry_point": "rldecode", "input": "[]", "output": "b''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/euske/pdfminer/blob/8150458718e9024c80b00e74965510b20206e588/pdfminer/runlength.py#L9-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034582", "code": "def rstrip_extra(fname):\n    \"\"\"Strip extraneous, non-discriminative filename info from the end of a file.\n    \"\"\"\n    to_strip = (\"_R\", \".R\", \"-R\", \"_\", \"fastq\", \".\", \"-\")\n    while fname.endswith(to_strip):\n        for x in to_strip:\n            if fname.endswith(x):\n                fname = fname[:len(fname) - len(x)]\n                break\n    return fname", "entry_point": "rstrip_extra", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/bam/fastq.py#L101-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034583", "code": "def _get_start_end(parts, index=7):\n    \"\"\"Retrieve start and end for a VCF record, skips BNDs without END coords\n    \"\"\"\n    start = parts[1]\n    end = [x.split(\"=\")[-1] for x in parts[index].split(\";\") if x.startswith(\"END=\")]\n    if end:\n        end = end[0]\n        return start, end\n    return None, None", "entry_point": "_get_start_end", "input": "['a', 'b', 'c'], 0", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/structural/validate.py#L135-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034584", "code": "def _get_extra_args(extra_args, arg_keys):\n    \"\"\"Retrieve extra arguments to pass along to combine function.\n\n    Special cases like reference files and configuration information\n    are passed as single items, the rest as lists mapping to each data\n    item combined.\n    \"\"\"\n    # XXX back compatible hack -- should have a way to specify these.\n    single_keys = set([\"sam_ref\", \"config\"])\n    out = []\n    for i, arg_key in enumerate(arg_keys):\n        vals = [xs[i] for xs in extra_args]\n        if arg_key in single_keys:\n            out.append(vals[-1])\n        else:\n            out.append(vals)\n    return out", "entry_point": "_get_extra_args", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/distributed/split.py#L71-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034585", "code": "def _handle_special_yaml_cases(v):\n    \"\"\"Handle values that pass integer, boolean, list or dictionary values.\n    \"\"\"\n    if \"::\" in v:\n        out = {}\n        for part in v.split(\"::\"):\n            k_part, v_part = part.split(\":\")\n            out[k_part] = v_part.split(\";\")\n        v = out\n    elif \";\" in v:\n        # split lists and remove accidental empty values\n        v = [x for x in v.split(\";\") if x != \"\"]\n    elif isinstance(v, list):\n        v = v\n    else:\n        try:\n            v = int(v)\n        except ValueError:\n            if v.lower() == \"true\":\n                v = True\n            elif v.lower() == \"false\":\n                    v = False\n    return v", "entry_point": "_handle_special_yaml_cases", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/workflow/template.py#L341-L363", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034586", "code": "def convert_to_bytes(mem_str):\n    \"\"\"Convert a memory specification, potentially with M or G, into bytes.\n    \"\"\"\n    if str(mem_str)[-1].upper().endswith(\"G\"):\n        return int(round(float(mem_str[:-1]) * 1024 * 1024))\n    elif str(mem_str)[-1].upper().endswith(\"M\"):\n        return int(round(float(mem_str[:-1]) * 1024))\n    else:\n        return int(round(float(mem_str)))", "entry_point": "convert_to_bytes", "input": "5", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/pipeline/config_utils.py#L338-L346", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034587", "code": "def use_bcbio_variation_recall(algs):\n    \"\"\"Processing uses bcbio-variation-recall. Avoids core requirement if not used.\n    \"\"\"\n    for alg in algs:\n        jointcaller = alg.get(\"jointcaller\", [])\n        if not isinstance(jointcaller, (tuple, list)):\n            jointcaller = [jointcaller]\n        for caller in jointcaller:\n            if caller not in set([\"gatk-haplotype-joint\", None, False]):\n                return True\n    return False", "entry_point": "use_bcbio_variation_recall", "input": "{}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/pipeline/config_utils.py#L457-L467", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034588", "code": "def handle_combined_input(args):\n    \"\"\"Check for cases where we have a combined input nested list.\n\n    In these cases the CWL will be double nested:\n\n    [[[rec_a], [rec_b]]]\n\n    and we remove the outer nesting.\n    \"\"\"\n    cur_args = args[:]\n    while len(cur_args) == 1 and isinstance(cur_args[0], (list, tuple)):\n        cur_args = cur_args[0]\n    return cur_args", "entry_point": "handle_combined_input", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/cwl/cwlutils.py#L39-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034589", "code": "def _get_all_cwlkeys(items, default_keys=None):\n    \"\"\"Retrieve cwlkeys from inputs, handling defaults which can be null.\n\n    When inputs are null in some and present in others, this creates unequal\n    keys in each sample, confusing decision making about which are primary and extras.\n    \"\"\"\n    if default_keys:\n        default_keys = set(default_keys)\n    else:\n        default_keys = set([\"metadata__batch\", \"config__algorithm__validate\",\n                            \"config__algorithm__validate_regions\",\n                            \"config__algorithm__validate_regions_merged\",\n                            \"config__algorithm__variant_regions\",\n                            \"validate__summary\",\n                            \"validate__tp\", \"validate__fp\", \"validate__fn\",\n                            \"config__algorithm__coverage\", \"config__algorithm__coverage_merged\",\n                            \"genome_resources__variation__cosmic\", \"genome_resources__variation__dbsnp\",\n                            \"genome_resources__variation__clinvar\"\n        ])\n    all_keys = set([])\n    for data in items:\n        all_keys.update(set(data[\"cwl_keys\"]))\n    all_keys.update(default_keys)\n    return all_keys", "entry_point": "_get_all_cwlkeys", "input": "[], [1, 2, 3]", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/cwl/cwlutils.py#L110-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034590", "code": "def _normalize_vc_input(data):\n    \"\"\"Normalize different types of variant calling inputs.\n\n    Handles standard and ensemble inputs.\n    \"\"\"\n    if data.get(\"ensemble\"):\n        for k in [\"batch_samples\", \"validate\", \"vrn_file\"]:\n            data[k] = data[\"ensemble\"][k]\n        data[\"config\"][\"algorithm\"][\"variantcaller\"] = \"ensemble\"\n        data[\"metadata\"] = {\"batch\": data[\"ensemble\"][\"batch_id\"]}\n    return data", "entry_point": "_normalize_vc_input", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/pipeline/variation.py#L65-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034591", "code": "def _get_record_attrs(out_keys):\n    \"\"\"Check for records, a single key plus output attributes.\n    \"\"\"\n    if len(out_keys) == 1:\n        attr = list(out_keys.keys())[0]\n        if out_keys[attr]:\n            return attr, out_keys[attr]\n    return None, None", "entry_point": "_get_record_attrs", "input": "[]", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/distributed/runfn.py#L115-L122", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034592", "code": "def _parse_output_keys(val):\n    \"\"\"Parse expected output keys from string, handling records.\n    \"\"\"\n    out = {}\n    for k in val.split(\",\"):\n        # record output\n        if \":\" in k:\n            name, attrs = k.split(\":\")\n            out[name] = attrs.split(\";\")\n        else:\n            out[k] = None\n    return out", "entry_point": "_parse_output_keys", "input": "''", "output": "{'': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/distributed/runfn.py#L196-L207", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034593", "code": "def _remove_duplicate_files(xs):\n    \"\"\"Remove files specified multiple times in a list.\n    \"\"\"\n    seen = set([])\n    out = []\n    for x in xs:\n        if x[\"path\"] not in seen:\n            out.append(x)\n            seen.add(x[\"path\"])\n    return out", "entry_point": "_remove_duplicate_files", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/distributed/runfn.py#L605-L614", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034594", "code": "def get_default_jvm_opts(tmp_dir=None, parallel_gc=False):\n    \"\"\"Retrieve default JVM tuning options\n\n    Avoids issues with multiple spun up Java processes running into out of memory errors.\n    Parallel GC can use a lot of cores on big machines and primarily helps reduce task latency\n    and responsiveness which are not needed for batch jobs.\n    https://github.com/bcbio/bcbio-nextgen/issues/532#issuecomment-50989027\n    https://wiki.csiro.au/pages/viewpage.action?pageId=545034311\n    http://stackoverflow.com/questions/9738911/javas-serial-garbage-collector-performing-far-better-than-other-garbage-collect\n    However, serial GC causes issues with Spark local runs so we use parallel for those cases:\n    https://github.com/broadinstitute/gatk/issues/3605#issuecomment-332370070\n    \"\"\"\n    opts = [\"-XX:+UseSerialGC\"] if not parallel_gc else []\n    if tmp_dir:\n        opts.append(\"-Djava.io.tmpdir=%s\" % tmp_dir)\n    return opts", "entry_point": "get_default_jvm_opts", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "[\"-Djava.io.tmpdir=['a', 'b', 'c']\"]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/broad/__init__.py#L23-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034595", "code": "def unpack_worlds(items):\n    \"\"\"Handle all the ways we can pass multiple samples for back-compatibility.\n    \"\"\"\n    # Unpack nested lists of samples grouped together (old IPython style)\n    if isinstance(items[0], (list, tuple)) and len(items[0]) == 1:\n        out = []\n        for d in items:\n            assert len(d) == 1 and isinstance(d[0], dict), len(d)\n            out.append(d[0])\n    # Unpack a single argument with multiple samples (CWL style)\n    elif isinstance(items, (list, tuple)) and len(items) == 1 and isinstance(items[0], (list, tuple)):\n        out = items[0]\n    else:\n        out = items\n    return out", "entry_point": "unpack_worlds", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/utils.py#L160-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034596", "code": "def _merge_batches(all_groups):\n    \"\"\"Merge batches with overlapping groups. Uses merge approach from:\n\n    http://stackoverflow.com/a/4842897/252589\n    \"\"\"\n    merged = []\n    while len(all_groups) > 0:\n        first, rest = all_groups[0], all_groups[1:]\n        first = set(first)\n        lf = -1\n        while len(first) > lf:\n            lf = len(first)\n\n            rest2 = []\n            for r in rest:\n                if len(first.intersection(set(r))) > 0:\n                    first |= set(r)\n                else:\n                    rest2.append(r)\n            rest = rest2\n        merged.append(first)\n        all_groups = rest\n    return merged", "entry_point": "_merge_batches", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/variation/multi.py#L66-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034597", "code": "def _get_representative_batch(merged):\n    \"\"\"Prepare dictionary matching batch items to a representative within a group.\n    \"\"\"\n    out = {}\n    for mgroup in merged:\n        mgroup = sorted(list(mgroup))\n        for x in mgroup:\n            out[x] = mgroup[0]\n    return out", "entry_point": "_get_representative_batch", "input": "[[1, 2], [3], []]", "output": "{1: 1, 2: 1, 3: 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/variation/multi.py#L90-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034598", "code": "def _get_training_data(vrn_files):\n    \"\"\"Retrieve training data, returning an empty set of information if not available.\n    \"\"\"\n    out = {\"SNP\": [], \"INDEL\": []}\n    # SNPs\n    for name, train_info in [(\"train_hapmap\", \"known=false,training=true,truth=true,prior=15.0\"),\n                             (\"train_omni\", \"known=false,training=true,truth=true,prior=12.0\"),\n                             (\"train_1000g\", \"known=false,training=true,truth=false,prior=10.0\"),\n                             (\"dbsnp\", \"known=true,training=false,truth=false,prior=2.0\")]:\n        if name not in vrn_files:\n            return {}\n        else:\n            out[\"SNP\"].append((name.replace(\"train_\", \"\"), train_info, vrn_files[name]))\n    # Indels\n    if \"train_indels\" in vrn_files:\n        out[\"INDEL\"].append((\"mills\", \"known=true,training=true,truth=true,prior=12.0\",\n                             vrn_files[\"train_indels\"]))\n    else:\n        return {}\n    return out", "entry_point": "_get_training_data", "input": "[-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/variation/gatkfilter.py#L129-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034599", "code": "def per_machine_target_cores(cores, num_jobs):\n    \"\"\"Select target cores on larger machines to leave room for batch script and controller.\n\n    On resource constrained environments, we want to pack all bcbio submissions onto a specific\n    number of machines. This gives up some cores to enable sharing cores with the controller\n    and batch script on larger machines.\n    \"\"\"\n    if cores >= 32 and num_jobs == 1:\n        cores = cores - 2\n    elif cores >= 16 and num_jobs in [1, 2]:\n        cores = cores - 1\n    return cores", "entry_point": "per_machine_target_cores", "input": "True, {'a': 1, 'b': 2}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/distributed/ipython.py#L67-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034600", "code": "def _get_cores_and_type(numcores, paralleltype, scheduler):\n    \"\"\"Return core and parallelization approach from command line providing sane defaults.\n    \"\"\"\n    if scheduler is not None:\n        paralleltype = \"ipython\"\n    if paralleltype is None:\n        paralleltype = \"local\"\n    if not numcores or int(numcores) < 1:\n        numcores = 1\n    return paralleltype, int(numcores)", "entry_point": "_get_cores_and_type", "input": "2, ['a', 'b', 'c'], []", "output": "('ipython', 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/distributed/clargs.py#L20-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034601", "code": "def _known_populations(row, pops):\n    \"\"\"Find variants present in substantial frequency in population databases.\n    \"\"\"\n    cutoff = 0.01\n    out = set([])\n    for pop, base in [(\"esp\", \"af_esp_all\"), (\"1000g\", \"af_1kg_all\"),\n                      (\"exac\", \"af_exac_all\"), (\"anypop\", \"max_aaf_all\")]:\n        for key in [x for x in pops if x.startswith(base)]:\n            val = row[key]\n            if val and val > cutoff:\n                out.add(pop)\n    return sorted(list(out))", "entry_point": "_known_populations", "input": "['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/variation/prioritize.py#L163-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034602", "code": "def delayed_bamprep_merge(samples, run_parallel):\n    \"\"\"Perform a delayed merge on regional prepared BAM files.\n    \"\"\"\n    if any(\"combine\" in data[0] for data in samples):\n        return run_parallel(\"delayed_bam_merge\", samples)\n    else:\n        return samples", "entry_point": "delayed_bamprep_merge", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/pipeline/region.py#L166-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034603", "code": "def is_autosomal(chrom):\n    \"\"\"Keep chromosomes that are a digit 1-22, or chr prefixed digit chr1-chr22\n    \"\"\"\n    try:\n        int(chrom)\n        return True\n    except ValueError:\n        try:\n            int(str(chrom.lower().replace(\"chr\", \"\").replace(\"_\", \"\").replace(\"-\", \"\")))\n            return True\n        except ValueError:\n            return False", "entry_point": "is_autosomal", "input": "7", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/heterogeneity/chromhacks.py#L11-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034604", "code": "def _avoid_duplicate_arrays(types):\n    \"\"\"Collapse arrays when we have multiple types.\n    \"\"\"\n    arrays = [t for t in types if isinstance(t, dict) and t[\"type\"] == \"array\"]\n    others = [t for t in types if not (isinstance(t, dict) and t[\"type\"] == \"array\")]\n    if arrays:\n        items = set([])\n        for t in arrays:\n            if isinstance(t[\"items\"], (list, tuple)):\n                items |= set(t[\"items\"])\n            else:\n                items.add(t[\"items\"])\n        if len(items) == 1:\n            items = items.pop()\n        else:\n            items = sorted(list(items))\n        arrays = [{\"type\": \"array\", \"items\": items}]\n    return others + arrays", "entry_point": "_avoid_duplicate_arrays", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/cwl/create.py#L636-L653", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034605", "code": "def _guess_header(info):\n    \"\"\"Add the first group to get report with some factor\"\"\"\n    value = \"group\"\n    if \"metadata\" in info:\n        if info[\"metadata\"]:\n            return \",\".join(map(str, info[\"metadata\"].keys()))\n    return value", "entry_point": "_guess_header", "input": "['apple', 'banana', 'cherry']", "output": "'group'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/srna/group.py#L167-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034606", "code": "def _guess_group(info):\n    \"\"\"Add the first group to get report with some factor\"\"\"\n    value = \"fake\"\n    if \"metadata\" in info:\n        if info[\"metadata\"]:\n            return \",\".join(map(str, info[\"metadata\"].values()))\n    return value", "entry_point": "_guess_group", "input": "[5, 3, 1, 4]", "output": "'fake'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/srna/group.py#L175-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034607", "code": "def _finalize_memory(jvm_opts):\n    \"\"\"GRIDSS does not recommend setting memory between 32 and 48Gb.\n\n    https://github.com/PapenfussLab/gridss#memory-usage\n    \"\"\"\n    avoid_min = 32\n    avoid_max = 48\n    out_opts = []\n    for opt in jvm_opts:\n        if opt.startswith(\"-Xmx\"):\n            spec = opt[4:]\n            val = int(spec[:-1])\n            mod = spec[-1]\n            if mod.upper() == \"M\":\n                adjust = 1024\n                min_val = avoid_min * 1024\n                max_val = avoid_max * 1024\n            else:\n                adjust = 1\n                min_val, max_val = avoid_min, avoid_max\n            if val >= min_val and val < max_val:\n                val = min_val - adjust\n            opt = \"%s%s%s\" % (opt[:4], val, mod)\n        out_opts.append(opt)\n    return out_opts", "entry_point": "_finalize_memory", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/structural/gridss.py#L70-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034608", "code": "def get_input_sequence_files(data, default=None):\n    \"\"\"\n    returns the input sequencing files, these can be single or paired FASTQ\n    files or BAM files\n    \"\"\"\n    if \"files\" not in data or data.get(\"files\") is None:\n        file1, file2 = None, None\n    elif len(data[\"files\"]) == 2:\n        file1, file2 = data[\"files\"]\n    else:\n        assert len(data[\"files\"]) == 1, data[\"files\"]\n        file1, file2 = data[\"files\"][0], None\n    return file1, file2", "entry_point": "get_input_sequence_files", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/pipeline/datadict.py#L223-L235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034609", "code": "def _generate_barcode_ids(info_iter):\n    \"\"\"Create unique barcode IDs assigned to sequences\n    \"\"\"\n    bc_type = \"SampleSheet\"\n    barcodes = list(set([x[-1] for x in info_iter]))\n    barcodes.sort()\n    barcode_ids = {}\n    for i, bc in enumerate(barcodes):\n        barcode_ids[bc] = (bc_type, i+1)\n    return barcode_ids", "entry_point": "_generate_barcode_ids", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/illumina/samplesheet.py#L70-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034610", "code": "def to_multiregion(region):\n    \"\"\"Convert a single region or multiple region specification into multiregion list.\n\n    If a single region (chrom, start, end), returns [(chrom, start, end)]\n    otherwise returns multiregion.\n    \"\"\"\n    assert isinstance(region, (list, tuple)), region\n    if isinstance(region[0], (list, tuple)):\n        return region\n    else:\n        assert len(region) == 3\n        return [tuple(region)]", "entry_point": "to_multiregion", "input": "[1, 2, 3]", "output": "[(1, 2, 3)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/pipeline/shared.py#L261-L272", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034611", "code": "def find_best_match(path, prefixes):\n    \"\"\"Find the Ingredient that shares the longest prefix with path.\"\"\"\n    path_parts = path.split('.')\n    for p in prefixes:\n        if len(p) <= len(path_parts) and p == path_parts[:len(p)]:\n            return '.'.join(p), '.'.join(path_parts[len(p):])\n    return '', path", "entry_point": "find_best_match", "input": "'  padded  ', 'Hello World'", "output": "('', '  padded  ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IDSIA/sacred/blob/72633776bed9b5bddf93ae7d215188e61970973a/sacred/initialize.py#L316-L322", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034612", "code": "def get_by_dotted_path(d, path, default=None):\n    \"\"\"\n    Get an entry from nested dictionaries using a dotted path.\n\n    Example:\n    >>> get_by_dotted_path({'foo': {'a': 12}}, 'foo.a')\n    12\n    \"\"\"\n    if not path:\n        return d\n    split_path = path.split('.')\n    current_option = d\n    for p in split_path:\n        if p not in current_option:\n            return default\n        current_option = current_option[p]\n    return current_option", "entry_point": "get_by_dotted_path", "input": "[5, 3, 1, 4], 'walnut thistle harbour', ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IDSIA/sacred/blob/72633776bed9b5bddf93ae7d215188e61970973a/sacred/utils.py#L398-L414", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034613", "code": "def is_prefix(pre_path, path):\n    \"\"\"Return True if pre_path is a path-prefix of path.\"\"\"\n    pre_path = pre_path.strip('.')\n    path = path.strip('.')\n    return not pre_path or path.startswith(pre_path + '.')", "entry_point": "is_prefix", "input": "'Hello World', 'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IDSIA/sacred/blob/72633776bed9b5bddf93ae7d215188e61970973a/sacred/utils.py#L454-L458", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034614", "code": "def apply_backspaces_and_linefeeds(text):\n    \"\"\"\n    Interpret backspaces and linefeeds in text like a terminal would.\n\n    Interpret text like a terminal by removing backspace and linefeed\n    characters and applying them line by line.\n\n    If final line ends with a carriage it keeps it to be concatenable with next\n    output chunk.\n    \"\"\"\n    orig_lines = text.split('\\n')\n    orig_lines_len = len(orig_lines)\n    new_lines = []\n    for orig_line_idx, orig_line in enumerate(orig_lines):\n        chars, cursor = [], 0\n        orig_line_len = len(orig_line)\n        for orig_char_idx, orig_char in enumerate(orig_line):\n            if orig_char == '\\r' and (orig_char_idx != orig_line_len - 1 or\n                                      orig_line_idx != orig_lines_len - 1):\n                cursor = 0\n            elif orig_char == '\\b':\n                cursor = max(0, cursor - 1)\n            else:\n                if (orig_char == '\\r' and\n                        orig_char_idx == orig_line_len - 1 and\n                        orig_line_idx == orig_lines_len - 1):\n                    cursor = len(chars)\n                if cursor == len(chars):\n                    chars.append(orig_char)\n                else:\n                    chars[cursor] = orig_char\n                cursor += 1\n        new_lines.append(''.join(chars))\n    return '\\n'.join(new_lines)", "entry_point": "apply_backspaces_and_linefeeds", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IDSIA/sacred/blob/72633776bed9b5bddf93ae7d215188e61970973a/sacred/utils.py#L614-L647", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034615", "code": "def linearize_metrics(logged_metrics):\n    \"\"\"\n    Group metrics by name.\n\n    Takes a list of individual measurements, possibly belonging\n    to different metrics and groups them by name.\n\n    :param logged_metrics: A list of ScalarMetricLogEntries\n    :return: Measured values grouped by the metric name:\n    {\"metric_name1\": {\"steps\": [0,1,2], \"values\": [4, 5, 6],\n    \"timestamps\": [datetime, datetime, datetime]},\n    \"metric_name2\": {...}}\n    \"\"\"\n    metrics_by_name = {}\n    for metric_entry in logged_metrics:\n        if metric_entry.name not in metrics_by_name:\n            metrics_by_name[metric_entry.name] = {\n                \"steps\": [],\n                \"values\": [],\n                \"timestamps\": [],\n                \"name\": metric_entry.name\n            }\n        metrics_by_name[metric_entry.name][\"steps\"] \\\n            .append(metric_entry.step)\n        metrics_by_name[metric_entry.name][\"values\"] \\\n            .append(metric_entry.value)\n        metrics_by_name[metric_entry.name][\"timestamps\"] \\\n            .append(metric_entry.timestamp)\n    return metrics_by_name", "entry_point": "linearize_metrics", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IDSIA/sacred/blob/72633776bed9b5bddf93ae7d215188e61970973a/sacred/metrics_logger.py#L85-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034616", "code": "def _adjust_returns(returns, adjustment_factor):\n    \"\"\"\n    Returns the returns series adjusted by adjustment_factor. Optimizes for the\n    case of adjustment_factor being 0 by returning returns itself, not a copy!\n\n    Parameters\n    ----------\n    returns : pd.Series or np.ndarray\n    adjustment_factor : pd.Series or np.ndarray or float or int\n\n    Returns\n    -------\n    adjusted_returns : array-like\n    \"\"\"\n    if isinstance(adjustment_factor, (float, int)) and adjustment_factor == 0:\n        return returns\n    return returns - adjustment_factor", "entry_point": "_adjust_returns", "input": "{'x': [1, 2], 'y': []}, False", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantopian/empyrical/blob/badbdca75f5b293f28b5e947974894de041d6868/empyrical/stats.py#L127-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034617", "code": "def ConvertCH1903(x, y):\n  \"Converts coordinates from the 1903 Swiss national grid system to WGS-84.\"\n  yb = (x - 600000.0) / 1e6;\n  xb = (y - 200000.0) / 1e6;\n  lam = 2.6779094 \\\n     + 4.728982 * yb \\\n     + 0.791484 * yb * xb \\\n     + 0.1306 * yb * xb * xb \\\n     - 0.0436 * yb * yb * yb\n  phi = 16.9023892 \\\n     + 3.238372 * xb \\\n     - 0.270978 * yb * yb \\\n     - 0.002582 * xb * xb \\\n     - 0.0447 * yb * yb * xb \\\n     - 0.0140 * xb * xb * xb\n  return (phi * 100.0 / 36.0, lam * 100.0 / 36.0)", "entry_point": "ConvertCH1903", "input": "5, 7", "output": "(44.89003878792559, -0.16166383526334466)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/transitfeed/blob/eb2991a3747ba541b2cb66502b305b6304a1f85f/misc/import_ch_zurich.py#L96-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034618", "code": "def TransposeTable(table):\n  \"\"\"Transpose a list of lists, using None to extend all input lists to the\n  same length.\n\n  For example:\n  >>> TransposeTable(\n  [ [11,   12,   13],\n    [21,   22],\n    [31,   32,   33,   34]])\n\n  [ [11,   21,   31],\n    [12,   22,   32],\n    [13,   None, 33],\n    [None, None, 34]]\n  \"\"\"\n  transposed = []\n  rows = len(table)\n  cols = max(len(row) for row in table)\n  for x in range(cols):\n    transposed.append([])\n    for y in range(rows):\n      if x < len(table[y]):\n        transposed[x].append(table[y][x])\n      else:\n        transposed[x].append(None)\n  return transposed", "entry_point": "TransposeTable", "input": "['a', 'b', 'c']", "output": "[['a', 'b', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/transitfeed/blob/eb2991a3747ba541b2cb66502b305b6304a1f85f/examples/table.py#L65-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034619", "code": "def _cut_time(gammas):\n    \"\"\"Support function for iat().\n    Find cutting time, when gammas become negative.\"\"\"\n\n    for i in range(len(gammas) - 1):\n\n        if not ((gammas[i + 1] > 0.0) & (gammas[i + 1] < gammas[i])):\n            return i\n\n    return i", "entry_point": "_cut_time", "input": "[-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pymc-devs/pymc/blob/c6e530210bff4c0d7189b35b2c971bc53f93f7cd/pymc/diagnostics.py#L671-L680", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034620", "code": "def list_difference(left, right):\n    \"\"\"\n    Take the not-in-place difference of two lists (left - right), similar to sets but preserving order.\n    \"\"\"\n    blocked = set(right)\n    difference = []\n    for item in left:\n        if item not in blocked:\n            blocked.add(item)\n            difference.append(item)\n    return difference", "entry_point": "list_difference", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/django-crispy-forms/django-crispy-forms/blob/cd476927a756133c667c199bb12120f877bf6b7e/crispy_forms/utils.py#L193-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034621", "code": "def set_defaults(lvm_data):\n    \"\"\"dict: Sets all existing null string values to None.\"\"\"\n    for l in lvm_data:\n        for k, v in lvm_data[l].items():\n            if v == '':\n                lvm_data[l][k] = None\n\n    return lvm_data", "entry_point": "set_defaults", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/combiners/lvm.py#L160-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034622", "code": "def _parse_line(sep, line):\n    \"\"\"\n    Parse a grub commands/config with format: cmd{sep}opts\n    Returns: (name, value): value can be None\n    \"\"\"\n    strs = line.split(sep, 1)\n    return (strs[0].strip(), None) if len(strs) == 1 else (strs[0].strip(), strs[1].strip())", "entry_point": "_parse_line", "input": "'abc', 'Hello World'", "output": "('Hello World', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/parsers/grub_conf.py#L371-L377", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034623", "code": "def map_keys(pvs, keys):\n    \"\"\"\n    Add human readable key names to dictionary while leaving any existing key names.\n    \"\"\"\n    rs = []\n    for pv in pvs:\n        r = dict((v, None) for k, v in keys.items())\n        for k, v in pv.items():\n            if k in keys:\n                r[keys[k]] = v\n            r[k] = v\n        rs.append(r)\n    return rs", "entry_point": "map_keys", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/parsers/lvm.py#L43-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034624", "code": "def __or(funcs, args):\n    \"\"\" Support list sugar for \"or\" of two predicates. Used inside `select`. \"\"\"\n    results = []\n    for f in funcs:\n        result = f(args)\n        if result:\n            results.extend(result)\n    return results", "entry_point": "__or", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/configtree/__init__.py#L582-L589", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034625", "code": "def _handle_key_value(t_dict, key, value):\n    \"\"\"\n    Function to handle key has multi value, and return the values as list.\n    \"\"\"\n    if key in t_dict:\n        val = t_dict[key]\n        if isinstance(val, str):\n            val = [val]\n        val.append(value)\n        return val\n    return value", "entry_point": "_handle_key_value", "input": "set(), 2.0, {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/parsers/krb5.py#L63-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034626", "code": "def parse_keypair_lines(content, delim='|', kv_sep='='):\n    \"\"\"\n    Parses a set of entities, where each entity is a set of key-value pairs\n    contained all on one line.  Each entity is parsed into a dictionary and\n    added to the list returned from this function.\n    \"\"\"\n    r = []\n    if content:\n        for row in [line for line in content if line]:\n            item_dict = {}\n            for item in row.split(delim):\n                key, value = [i.strip(\"'\\\"\").strip() for i in item.strip().split(kv_sep)]\n                item_dict[key] = value\n            r.append(item_dict)\n    return r", "entry_point": "parse_keypair_lines", "input": "(), {'a': 1, 'b': 2}, False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/util/__init__.py#L182-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034627", "code": "def rsplit(_str, seps):\n    \"\"\"\n    Splits _str by the first sep in seps that is found from the right side.\n    Returns a tuple without the separator.\n    \"\"\"\n    for idx, ch in enumerate(reversed(_str)):\n        if ch in seps:\n            return _str[0:-idx - 1], _str[-idx:]", "entry_point": "rsplit", "input": "'AbC dEf', 'Hello World'", "output": "('AbC ', 'Ef')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/util/__init__.py#L199-L206", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034628", "code": "def get_active_lines(lines, comment_char=\"#\"):\n    \"\"\"\n    Returns lines, or parts of lines, from content that are not commented out\n    or completely empty.  The resulting lines are all individually stripped.\n\n    This is useful for parsing many config files such as ifcfg.\n\n    Parameters:\n        lines (list): List of strings to parse.\n        comment_char (str): String indicating that all chars following\n            are part of a comment and will be removed from the output.\n\n    Returns:\n        list: List of valid lines remaining in the input.\n\n    Examples:\n        >>> lines = [\n        ... 'First line',\n        ... '   ',\n        ... '# Comment line',\n        ... 'Inline comment # comment',\n        ... '          Whitespace          ',\n        ... 'Last line']\n        >>> get_active_lines(lines)\n        ['First line', 'Inline comment', 'Whitespace', 'Last line']\n    \"\"\"\n    return list(filter(None, (line.split(comment_char, 1)[0].strip() for line in lines)))", "entry_point": "get_active_lines", "input": "'', ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/parsers/__init__.py#L30-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034629", "code": "def calc_offset(lines, target, invert_search=False):\n    \"\"\"\n    Function to search for a line in a list starting with a target string.\n    If `target` is `None` or an empty string then `0` is returned.  This\n    allows checking `target` here instead of having to check for an empty\n    target in the calling function. Each line is stripped of leading spaces\n    prior to comparison with each target however target is not stripped.\n    See `parse_fixed_table` in this module for sample usage.\n\n    Arguments:\n        lines (list): List of strings.\n        target (list): List of strings to search for at the beginning of any\n            line in lines.\n        invert_search (boolean): If `True` this flag causes the search to continue\n            until the first line is found not matching anything in target.\n            An empty line is implicitly included in target.  Default is `False`.\n            This would typically be used if trimming trailing lines off of a\n            file by passing `reversed(lines)` as the `lines` argument.\n\n    Returns:\n        int: index into the `lines` indicating the location of `target`. If\n        `target` is `None` or an empty string `0` is returned as the offset.\n        If `invert_search` is `True` the index returned will point to the line\n        after the last target was found.\n\n    Raises:\n        ValueError: Exception is raised if `target` string is specified and it\n            was not found in the input lines.\n\n    Examples:\n        >>> lines = [\n        ... '#   ',\n        ... 'Warning line',\n        ... 'Error line',\n        ... '    data 1 line',\n        ... '    data 2 line']\n        >>> target = ['data']\n        >>> calc_offset(lines, target)\n        3\n        >>> target = ['#', 'Warning', 'Error']\n        >>> calc_offset(lines, target, invert_search=True)\n        3\n    \"\"\"\n    if target and target[0] is not None:\n        for offset, line in enumerate(l.strip() for l in lines):\n            found_any = any([line.startswith(t) for t in target])\n            if not invert_search and found_any:\n                return offset\n            elif invert_search and not(line == '' or found_any):\n                return offset\n\n        # If we get here then we didn't find any of the targets\n        raise ValueError(\"Line containing '{}' was not found in table\".format(','.join(target)))\n    else:\n        # If no target then return index 0\n        return 0", "entry_point": "calc_offset", "input": "{'x': [1, 2], 'y': []}, set(), 2.0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/parsers/__init__.py#L223-L278", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034630", "code": "def _replace_tabs(s, ts=8):\n    \"\"\"\n    Replace the tabs in 's' and keep its original alignment with the tab-stop\n    equals to 'ts'\n    \"\"\"\n    result = ''\n    for c in s:\n        if c == '\\t':\n            while True:\n                result += ' '\n                if len(result) % ts == 0:\n                    break\n        else:\n            result += c\n    return result", "entry_point": "_replace_tabs", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/parsers/rhn_schema_stats.py#L6-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034631", "code": "def validate_lines(results, bad_lines):\n        \"\"\"\n        If `results` contains a single line and that line is included\n        in the `bad_lines` list, this function returns `False`. If no bad\n        line is found the function returns `True`\n\n        Parameters:\n            results(str): The results string of the output from the command\n                defined by the command spec.\n\n        Returns:\n            (Boolean): True for no bad lines or False for bad line found.\n        \"\"\"\n\n        if results and len(results) == 1:\n            first = results[0]\n            if any(l in first.lower() for l in bad_lines):\n                return False\n        return True", "entry_point": "validate_lines", "input": "[-1, 0, 1, 2], 'abc'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/core/__init__.py#L528-L546", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034632", "code": "def _decompose(compound_name):\n    \"\"\" '[reg/]repo[:tag]' -> (reg, repo, tag) \"\"\"\n    reg, repo, tag = '', compound_name, ''\n    if '/' in repo:\n        reg, repo = repo.split('/', 1)\n    if ':' in repo:\n        repo, tag = repo.rsplit(':', 1)\n    return reg, repo, tag", "entry_point": "_decompose", "input": "'walnut thistle harbour'", "output": "('', 'walnut thistle harbour', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedHatInsights/insights-core/blob/b57cbf8ed7c089672426ede0441e0a4f789ef4a1/insights/client/util.py#L21-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034633", "code": "def _set_default_configs(user_settings, default):\n    \"\"\"Set the default value to user settings if user not specified\n    the value.\n    \"\"\"\n    for key in default:\n        if key not in user_settings:\n            user_settings[key] = default[key]\n\n    return user_settings", "entry_point": "_set_default_configs", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/census-instrumentation/opencensus-python/blob/992b223f7e34c5dcb65922b7d5c827e7a1351e7d/contrib/opencensus-ext-pyramid/opencensus/ext/pyramid/config.py#L45-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034634", "code": "def _convert_2_0_0(topo, topo_path):\n    \"\"\"\n    Convert topologies from GNS3 2.0.0 to 2.1\n\n    Changes:\n     * Remove startup_script_path from VPCS and base config file for IOU and Dynamips\n    \"\"\"\n    topo[\"revision\"] = 8\n\n    for node in topo.get(\"topology\", {}).get(\"nodes\", []):\n        if \"properties\" in node:\n            if node[\"node_type\"] == \"vpcs\":\n                if \"startup_script_path\" in node[\"properties\"]:\n                    del node[\"properties\"][\"startup_script_path\"]\n                if \"startup_script\" in node[\"properties\"]:\n                    del node[\"properties\"][\"startup_script\"]\n            elif node[\"node_type\"] == \"dynamips\" or node[\"node_type\"] == \"iou\":\n                if \"startup_config\" in node[\"properties\"]:\n                    del node[\"properties\"][\"startup_config\"]\n                if \"private_config\" in node[\"properties\"]:\n                    del node[\"properties\"][\"private_config\"]\n                if \"startup_config_content\" in node[\"properties\"]:\n                    del node[\"properties\"][\"startup_config_content\"]\n                if \"private_config_content\" in node[\"properties\"]:\n                    del node[\"properties\"][\"private_config_content\"]\n    return topo", "entry_point": "_convert_2_0_0", "input": "{}, ['a', 'b', 'c']", "output": "{'revision': 8}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/GNS3/gns3-server/blob/a221678448fb5d24e977ef562f81d56aacc89ab1/gns3server/controller/topology.py#L169-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034635", "code": "def counter(items):\n    \"\"\"\n    Simplest required implementation of collections.Counter. Required as 2.6\n    does not have Counter in collections.\n    \"\"\"\n    results = {}\n    for item in items:\n        results[item] = results.get(item, 0) + 1\n    return results", "entry_point": "counter", "input": "[1, 2, 3]", "output": "{1: 1, 2: 1, 3: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pyflakes/blob/232cb1d27ee134bf96adc8f37e53589dc259b159/pyflakes/checker.py#L103-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034636", "code": "def unskew_S1(S1, M, N):\r\n    \"\"\"\r\n    Unskew the sensivity indice\r\n    (Jean-Yves Tissot, Cl\u00e9mentine Prieur (2012) \"Bias correction for the\r\n    estimation of sensitivity indices based on random balance designs.\",\r\n    Reliability Engineering and System Safety, Elsevier, 107, 205-213.\r\n    doi:10.1016/j.ress.2012.06.010)\r\n    \"\"\"\r\n    lamb = (2 * M) / N\r\n    return S1 - lamb / (1 - lamb) * (1 - S1)", "entry_point": "unskew_S1", "input": "2, 2.0, 3.25", "output": "-3.333333333333332", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SALib/SALib/blob/9744d73bb17cfcffc8282c7dc4a727efdc4bea3f/src/SALib/analyze/rbd_fast.py#L109-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034637", "code": "def dq_name(queue_name):\n    \"\"\"Returns the delayed queue name for a given queue.  If the given\n    queue name already belongs to a delayed queue, then it is returned\n    unchanged.\n    \"\"\"\n    if queue_name.endswith(\".DQ\"):\n        return queue_name\n\n    if queue_name.endswith(\".XQ\"):\n        queue_name = queue_name[:-3]\n    return queue_name + \".DQ\"", "entry_point": "dq_name", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour.DQ'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bogdanp/dramatiq/blob/a8cc2728478e794952a5a50c3fb19ec455fe91b6/dramatiq/common.py#L109-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034638", "code": "def xq_name(queue_name):\n    \"\"\"Returns the dead letter queue name for a given queue.  If the\n    given queue name belongs to a delayed queue, the dead letter queue\n    name for the original queue is generated.\n    \"\"\"\n    if queue_name.endswith(\".XQ\"):\n        return queue_name\n\n    if queue_name.endswith(\".DQ\"):\n        queue_name = queue_name[:-3]\n    return queue_name + \".XQ\"", "entry_point": "xq_name", "input": "'  padded  '", "output": "'  padded  .XQ'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bogdanp/dramatiq/blob/a8cc2728478e794952a5a50c3fb19ec455fe91b6/dramatiq/common.py#L122-L132", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034639", "code": "def is_valid_address (s):\n    \"\"\"\n    returns True if address is a valid Bluetooth address\n\n    valid address are always strings of the form XX:XX:XX:XX:XX:XX\n    where X is a hexadecimal character.  For example,\n        01:23:45:67:89:AB is a valid address, but\n        IN:VA:LI:DA:DD:RE is not\n    \"\"\"\n    try:\n        pairs = s.split (\":\")\n        if len (pairs) != 6: return False\n        if not all(0 <= int(b, 16) <= 255 for b in pairs): return False\n    except:\n        return False\n    return True", "entry_point": "is_valid_address", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pybluez/pybluez/blob/e0dc4093dcbaa3ecb3fa24f8ccf22bbfe6b57fc9/bluetooth/btcommon.py#L182-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034640", "code": "def is_valid_uuid (uuid):\n    \"\"\"\n    is_valid_uuid (uuid) -> bool\n\n    returns True if uuid is a valid 128-bit UUID.\n\n    valid UUIDs are always strings taking one of the following forms:\n        XXXX\n        XXXXXXXX\n        XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n    where each X is a hexadecimal digit (case insensitive)\n    \"\"\"\n    try:\n        if len (uuid) == 4:\n            if int (uuid, 16) < 0: return False\n        elif len (uuid) == 8:\n            if int (uuid, 16) < 0: return False\n        elif len (uuid) == 36:\n            pieces = uuid.split (\"-\")\n            if len (pieces) != 5 or \\\n                    len (pieces[0]) != 8 or \\\n                    len (pieces[1]) != 4 or \\\n                    len (pieces[2]) != 4 or \\\n                    len (pieces[3]) != 4 or \\\n                    len (pieces[4]) != 12:\n                return False\n            [ int (p, 16) for p in pieces ]\n        else:\n            return False\n    except ValueError: \n        return False\n    except TypeError:\n        return False\n    return True", "entry_point": "is_valid_uuid", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pybluez/pybluez/blob/e0dc4093dcbaa3ecb3fa24f8ccf22bbfe6b57fc9/bluetooth/btcommon.py#L199-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034641", "code": "def splitclass(classofdevice):\n    \"\"\"\n    Splits the given class of device to return a 3-item tuple with the\n    major service class, major device class and minor device class values.\n\n    These values indicate the device's major services and the type of the\n    device (e.g. mobile phone, laptop, etc.). If you google for\n    \"assigned numbers bluetooth baseband\" you might find some documents\n    that discuss how to extract this information from the class of device.\n\n    Example:\n        >>> splitclass(1057036)\n        (129, 1, 3)\n        >>>\n    \"\"\"\n    if not isinstance(classofdevice, int):\n        try:\n            classofdevice = int(classofdevice)\n        except (TypeError, ValueError):\n            raise TypeError(\"Given device class '%s' cannot be split\" % \\\n                str(classofdevice))\n\n    data = classofdevice >> 2   # skip over the 2 \"format\" bits\n    service = data >> 11\n    major = (data >> 6) & 0x1F\n    minor = data & 0x3F\n    return (service, major, minor)", "entry_point": "splitclass", "input": "True", "output": "(0, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pybluez/pybluez/blob/e0dc4093dcbaa3ecb3fa24f8ccf22bbfe6b57fc9/macos/_lightbluecommon.py#L43-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034642", "code": "def fmt_text(text):\n    \"\"\" convert characters that aren't printable to hex format\n    \"\"\"\n    PRINTABLE_CHAR = set(\n        list(range(ord(' '), ord('~') + 1)) + [ord('\\r'), ord('\\n')])\n    newtext = (\"\\\\x{:02X}\".format(\n        c) if c not in PRINTABLE_CHAR else chr(c) for c in text)\n    textlines = \"\\r\\n\".join(l.strip('\\r')\n                            for l in \"\".join(newtext).split('\\n'))\n    return textlines", "entry_point": "fmt_text", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyusb/pyusb/blob/ffe6faf42c6ad273880b0b464b9bbf44c1d4b2e9/tools/vcp_terminal.py#L540-L549", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034643", "code": "def ftdi_to_clkbits(baudrate):  # from libftdi\n    \"\"\"\n    10,27 => divisor = 10000, rate = 300\n    88,13 => divisor = 5000, rate = 600\n    C4,09 => divisor = 2500, rate = 1200\n    E2,04 => divisor = 1250, rate = 2,400\n    71,02 => divisor = 625, rate = 4,800\n    38,41 => divisor = 312.5, rate = 9,600\n    D0,80 => divisor = 208.25, rate = 14406\n    9C,80 => divisor = 156, rate = 19,230\n    4E,C0 => divisor = 78, rate = 38,461\n    34,00 => divisor = 52, rate = 57,692\n    1A,00 => divisor = 26, rate = 115,384\n    0D,00 => divisor = 13, rate = 230,769\n    \"\"\"\n    clk = 48000000\n    clk_div = 16\n    frac_code = [0, 3, 2, 4, 1, 5, 6, 7]\n    actual_baud = 0\n    if baudrate >= clk / clk_div:\n        encoded_divisor = 0\n        actual_baud = (clk // clk_div)\n    elif baudrate >= clk / (clk_div + clk_div / 2):\n        encoded_divisor = 1\n        actual_baud = clk // (clk_div + clk_div // 2)\n    elif baudrate >= clk / (2 * clk_div):\n        encoded_divisor = 2\n        actual_baud = clk // (2 * clk_div)\n    else:\n        # We divide by 16 to have 3 fractional bits and one bit for rounding\n        divisor = clk * 16 // clk_div // baudrate\n        best_divisor = (divisor + 1) // 2\n        if best_divisor > 0x20000:\n            best_divisor = 0x1ffff\n        actual_baud = clk * 16 // clk_div // best_divisor\n        actual_baud = (actual_baud + 1) // 2\n        encoded_divisor = ((best_divisor >> 3) +\n                           (frac_code[best_divisor & 0x7] << 14))\n\n    value = encoded_divisor & 0xFFFF\n    index = encoded_divisor >> 16\n    return actual_baud, value, index", "entry_point": "ftdi_to_clkbits", "input": "3.25", "output": "(183, 65535, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyusb/pyusb/blob/ffe6faf42c6ad273880b0b464b9bbf44c1d4b2e9/tools/vcp_terminal.py#L576-L617", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034644", "code": "def get_reduced_symbols(symbols):\n    \"\"\"Reduces expanded list of symbols.\n\n    Args:\n        symbols: list containing any chemical symbols as often as\n        the atom appears in the structure\n\n    Returns:\n        reduced_symbols: any symbols appears only once\n    \"\"\"\n\n    reduced_symbols = []\n\n    for ss in symbols:\n        if not (ss in reduced_symbols):\n            reduced_symbols.append(ss)\n\n    return reduced_symbols", "entry_point": "get_reduced_symbols", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/atztogo/phonopy/blob/869cc2ba9e7d495d5f4cf6942415ab3fc9e2a10f/phonopy/interface/dftbp.py#L140-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034645", "code": "def _normalize_purge_unknown(mapping, schema):\n        \"\"\" {'type': 'boolean'} \"\"\"\n        for field in [x for x in mapping if x not in schema]:\n            mapping.pop(field)\n        return mapping", "entry_point": "_normalize_purge_unknown", "input": "{'x': [1, 2], 'y': []}, ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyeve/cerberus/blob/688a67a4069e88042ed424bda7be0f4fa5fc3910/cerberus/validator.py#L855-L859", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034646", "code": "def list_to_raw_list(poselist):\n    \"\"\"\n    Flatten a normal pose list into a raw list\n    :param poselist: a formatted list [[x,y,z], [x,y,z,w]]\n    :return: a raw list [x, y, z, x, y, z, w]\n    \"\"\"\n    if not (isinstance(poselist, list) or isinstance(poselist, tuple)):\n        raise TypeError(\n            \"flatten_pose({}) does not accept this type of argument\".format(\n                str(type(poselist))))\n    return [field for pose in poselist for field in pose]", "entry_point": "list_to_raw_list", "input": "['apple', 'banana', 'cherry']", "output": "['a', 'p', 'p', 'l', 'e', 'b', 'a', 'n', 'a', 'n', 'a', 'c', 'h', 'e', 'r', 'r', 'y']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Phylliade/ikpy/blob/60e36d6163136942bf520d952db17123c658d0b6/contrib/transformations.py#L222-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034647", "code": "def _local_var_name(splittable_dimensions, assignment):\n  \"\"\"Name for a local variable.\n\n  Args:\n    splittable_dimensions: frozenset of names of splittable dimensions.\n    assignment: dict from names of splittable dimensions to names of mesh\n      dimensions.\n\n  Returns:\n    A string, the variable name.\n  \"\"\"\n  assignment_string = []\n  for splittable in sorted(splittable_dimensions):\n    if splittable in assignment:\n      assignment_string.append(\"{}:{}\".format(splittable,\n                                              assignment[splittable]))\n    else:\n      assignment_string.append(\"{}\".format(splittable))\n  return \"y_(\" + \",\".join(assignment_string) + \")\"", "entry_point": "_local_var_name", "input": "{}, []", "output": "'y_()'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/mesh/blob/3921196e5e43302e820da0a87329f25d7e2a3016/mesh_tensorflow/auto_mtf/layout_optimizer.py#L383-L401", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034648", "code": "def is_subsequence(short_seq, long_seq):\n  \"\"\"Is short_seq a subsequence of long_seq.\"\"\"\n  if not short_seq:\n    return True\n  pos = 0\n  for x in long_seq:\n    if pos == len(short_seq):\n      return True\n    if short_seq[pos] == x:\n      pos += 1\n  if pos == len(short_seq):\n    return True\n  return False", "entry_point": "is_subsequence", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/mesh/blob/3921196e5e43302e820da0a87329f25d7e2a3016/mesh_tensorflow/ops.py#L4244-L4256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034649", "code": "def _cumprod(l):\n  \"\"\"Cumulative product of a list.\n\n  Args:\n    l: a list of integers\n  Returns:\n    a list with one more element (starting with 1)\n  \"\"\"\n  ret = [1]\n  for item in l:\n    ret.append(ret[-1] * item)\n  return ret", "entry_point": "_cumprod", "input": "[1, 2, 3]", "output": "[1, 1, 2, 6]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/mesh/blob/3921196e5e43302e820da0a87329f25d7e2a3016/mesh_tensorflow/ops.py#L4650-L4661", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034650", "code": "def clean_decodes(ids, vocab_size, eos_id=1):\n  \"\"\"Stop at EOS or padding or OOV.\n\n  Args:\n    ids: a list of integers\n    vocab_size: an integer\n    eos_id: EOS id\n\n  Returns:\n    a list of integers\n  \"\"\"\n  ret = []\n  for i in ids:\n    if i == eos_id:\n      break\n    if i >= vocab_size:\n      break\n    ret.append(int(i))\n  return ret", "entry_point": "clean_decodes", "input": "[1, 2, 3], 10, ['a', 'b', 'c']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/mesh/blob/3921196e5e43302e820da0a87329f25d7e2a3016/mesh_tensorflow/transformer/utils.py#L477-L495", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034651", "code": "def luhn_checksum(num: str) -> str:\n    \"\"\"Calculate a checksum for num using the Luhn algorithm.\n\n    :param num: The number to calculate a checksum for as a string.\n    :return: Checksum for number.\n    \"\"\"\n    check = 0\n    for i, s in enumerate(reversed(num)):\n        sx = int(s)\n        sx = sx * 2 if i % 2 == 0 else sx\n        sx = sx - 9 if sx > 9 else sx\n        check += sx\n    return str(check * 9 % 10)", "entry_point": "luhn_checksum", "input": "[-1, 0, 1, 2]", "output": "'6'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lk-geimfari/mimesis/blob/4b16ee7a8dba6281a904654a88dbb4b052869fc5/mimesis/shortcuts.py#L14-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034652", "code": "def _dd_to_dms(num: float, _type: str) -> str:\n        \"\"\"Convert decimal number to DMS format.\n\n        :param num: Decimal number.\n        :param _type: Type of number.\n        :return: Number in DMS format.\n        \"\"\"\n        degrees = int(num)\n        minutes = int((num - degrees) * 60)\n        seconds = (num - degrees - minutes / 60) * 3600.00\n        seconds = round(seconds, 3)\n        result = [abs(i) for i in (degrees, minutes, seconds)]\n\n        direction = ''\n        if _type == 'lg':\n            direction = 'W' if degrees < 0 else 'E'\n        elif _type == 'lt':\n            direction = 'S' if degrees < 0 else 'N'\n\n        return ('{}\u00ba{}\\'{:.3f}\"' + direction).format(*result)", "entry_point": "_dd_to_dms", "input": "0, ['apple', 'banana', 'cherry']", "output": "'0\u00ba0\\'0.000\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lk-geimfari/mimesis/blob/4b16ee7a8dba6281a904654a88dbb4b052869fc5/mimesis/providers/address.py#L45-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034653", "code": "def _remove_invalid_char(s):\n    \"\"\"Remove invalid and dangerous characters from a string.\"\"\"\n\n    s = ''.join([i if ord(i) >= 32 and ord(i) < 127 else '' for i in s])\n    s = s.translate(dict.fromkeys(map(ord, \"_%~#\\\\{}\\\":\")))\n    return s", "entry_point": "_remove_invalid_char", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JelteF/PyLaTeX/blob/62d9d9912ce8445e6629cdbcb80ad86143a1ed23/pylatex/labelref.py#L9-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034654", "code": "def bounds_to_space(bounds):\n    \"\"\"\n    Takes as input a list of tuples with bounds, and create a dictionary to be processed by the class Design_space. This function\n    us used to keep the compatibility with previous versions of GPyOpt in which only bounded continuous optimization was possible\n    (and the optimization domain passed as a list of tuples).\n    \"\"\"\n    space = []\n    for k in range(len(bounds)):\n        space += [{'name': 'var_'+str(k+1), 'type': 'continuous', 'domain':bounds[k], 'dimensionality':1}]\n    return space", "entry_point": "bounds_to_space", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SheffieldML/GPyOpt/blob/255539dc5927819ca701e44fe3d76cd4864222fa/GPyOpt/core/task/space.py#L439-L448", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034655", "code": "def _fmt_fields(fld_vals, fld2fmt):\n    \"\"\"Optional user-formatting of specific fields, eg, pval: '{:8.2e}'.\"\"\"\n    vals = []\n    for fld, val in fld_vals:\n        if fld in fld2fmt:\n            val = fld2fmt[fld].format(val)\n        vals.append(val)\n    return vals", "entry_point": "_fmt_fields", "input": "'', {'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/wr_tbl.py#L190-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034656", "code": "def _get_go2nt(goids, go2nt_all):\n    \"\"\"Get user go2nt using main GO IDs, not alt IDs.\"\"\"\n    go_nt_list = []\n    goids_seen = set()\n    for goid_usr in goids:\n        ntgo = go2nt_all[goid_usr]\n        goid_main = ntgo.id\n        if goid_main not in goids_seen:\n            goids_seen.add(goid_main)\n            go_nt_list.append((goid_main, ntgo))\n    return go_nt_list", "entry_point": "_get_go2nt", "input": "set(), False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/gosubdag/go_most_specific.py#L25-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034657", "code": "def get_relationship_targets(item_ids, relationships, id2rec):\n    \"\"\"Get item ID set of item IDs in a relationship target set.\"\"\"\n    # Requirements to use this function:\n    #     1) item Terms must have been loaded with 'relationships'\n    #     2) item IDs in 'item_ids' arguement must be present in id2rec\n    #     3) Arg, 'relationships' must be True or an iterable\n    reltgt_objs_all = set()\n    for goid in item_ids:\n        obj = id2rec[goid]\n        for reltype, reltgt_objs_cur in obj.relationship.items():\n            if relationships is True or reltype in relationships:\n                reltgt_objs_all.update(reltgt_objs_cur)\n    return reltgt_objs_all", "entry_point": "get_relationship_targets", "input": "[], ['apple', 'banana', 'cherry'], []", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/godag/go_tasks.py#L35-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034658", "code": "def get_genes(genes_str):\n        \"\"\"Given a string containng genes, return a list.\"\"\"\n        gene_set = genes_str.split(', ')\n        if gene_set and gene_set[0].isdigit():\n            gene_set = set(int(g) for g in gene_set)\n        return gene_set", "entry_point": "get_genes", "input": "'  padded  '", "output": "['  padded  ']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/parsers/david_chart.py#L170-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034659", "code": "def _chk_docunknown(args, exp):\n        \"\"\"Return any unknown args.\"\"\"\n        unknown = []\n        for arg in args:\n            if arg[:2] == '--':\n                val = arg[2:]\n                if val not in exp:\n                    unknown.append(arg)\n            elif arg[:1] == '-':\n                val = arg[1:]\n                if val not in exp:\n                    unknown.append(arg)\n        if '-h' in unknown or '--help' in unknown:\n            return []\n        return unknown", "entry_point": "_chk_docunknown", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/cli/docopt_parse.py#L82-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034660", "code": "def get_b2aset(a2bset):\n    \"\"\"Given gene2gos, return go2genes. Given go2genes, return gene2gos.\"\"\"\n    b2aset = {}\n    for a_item, bset in a2bset.items():\n        for b_item in bset:\n            if b_item in b2aset:\n                b2aset[b_item].add(a_item)\n            else:\n                b2aset[b_item] = set([a_item])\n    return b2aset", "entry_point": "get_b2aset", "input": "{'x': [1, 2], 'y': []}", "output": "{1: {'x'}, 2: {'x'}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/associations.py#L125-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034661", "code": "def get_all_parents(go_objs):\n    \"\"\"Return a set containing all GO Term parents of multiple GOTerm objects.\"\"\"\n    go_parents = set()\n    for go_obj in go_objs:\n        go_parents |= go_obj.get_all_parents()\n    return go_parents", "entry_point": "get_all_parents", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/obo_tasks.py#L3-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034662", "code": "def replace_nulls(hdrs):\n        \"\"\"Replace '' in hdrs.\"\"\"\n        ret = []\n        idx = 0\n        for hdr in hdrs:\n            if hdr == '':\n                ret.append(\"no_hdr{}\".format(idx))\n            else:\n                ret.append(hdr)\n        return ret", "entry_point": "replace_nulls", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/parsers/ncbi_gene_file_reader.py#L187-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034663", "code": "def _init_edges_relationships(rel2src2dsts, rel2dst2srcs):\n        \"\"\"Get the directed edges from GO term to GO term using relationships.\"\"\"\n        edge_rel2fromto = {}\n        relationships = set(rel2src2dsts).union(rel2dst2srcs)\n        for reltype in relationships:\n            edge_from_to = []\n            if reltype in rel2src2dsts:\n                for parent, children in rel2src2dsts[reltype].items():\n                    for child in children:\n                        edge_from_to.append((child, parent))\n            if reltype in rel2dst2srcs:\n                for parent, children in rel2dst2srcs[reltype].items():\n                    for child in children:\n                        edge_from_to.append((child, parent))\n            edge_rel2fromto[reltype] = edge_from_to\n        return edge_rel2fromto", "entry_point": "_init_edges_relationships", "input": "[], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/gosubdag/go_edges.py#L169-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034664", "code": "def _get_qualifier(val):\n        \"\"\"Get qualifiers. Correct for inconsistent capitalization in GAF files\"\"\"\n        quals = set()\n        if val == '':\n            return quals\n        for val in val.split('|'):\n            val = val.lower()\n            quals.add(val if val != 'not' else 'NOT')\n        return quals", "entry_point": "_get_qualifier", "input": "'Hello World'", "output": "{'hello world'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/anno/init/reader_gaf.py#L195-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034665", "code": "def extract_kwargs(args, exp_keys, exp_elems):\n    \"\"\"Return user-specified keyword args in a dictionary and a set (for True/False items).\"\"\"\n    arg_dict = {}    # For arguments that have values\n    arg_set = set()  # For arguments that are True or False (present in set if True)\n    for key, val in args.items():\n        if exp_keys is not None and key in exp_keys and val:\n            arg_dict[key] = val\n        elif exp_elems is not None and key in exp_elems and val:\n            arg_set.add(key)\n    return {'dict':arg_dict, 'set':arg_set}", "entry_point": "extract_kwargs", "input": "{}, False, {'a': 1, 'b': 2}", "output": "{'dict': {}, 'set': set()}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/gosubdag/utils.py#L7-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034666", "code": "def _init_item_marks(item_marks):\n        \"\"\"Initialize the makred item dict.\"\"\"\n        if isinstance(item_marks, dict):\n            return item_marks\n        if item_marks:\n            return {item_id:'>' for item_id in item_marks}", "entry_point": "_init_item_marks", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': '>', 'banana': '>', 'cherry': '>'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/rpt/write_hierarchy_base.py#L97-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034667", "code": "def get_unique_fields(fld_lists):\n    \"\"\"Get unique namedtuple fields, despite potential duplicates in lists of fields.\"\"\"\n    flds = []\n    fld_set = set([f for flst in fld_lists for f in flst])\n    fld_seen = set()\n    # Add unique fields to list of fields in order that they appear\n    for fld_list in fld_lists:\n        for fld in fld_list:\n            # Add fields if the field has not yet been seen\n            if fld not in fld_seen:\n                flds.append(fld)\n                fld_seen.add(fld)\n    assert len(flds) == len(fld_set)\n    return flds", "entry_point": "get_unique_fields", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/nt_utils.py#L81-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034668", "code": "def get_goids_sections(sections):\n        \"\"\"Return all the GO IDs in a 2-D sections list.\"\"\"\n        goids_all = set()\n        for _, goids_sec in sections:\n            goids_all |= set(goids_sec)\n        return goids_all", "entry_point": "get_goids_sections", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/gosubdag/rpt/wr_xlsx.py#L58-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034669", "code": "def _get_rpt_fmt(fld, val, itemid2name=None):\n        \"\"\"Return values in a format amenable to printing in a table.\"\"\"\n        if fld.startswith(\"ratio_\"):\n            return \"{N}/{TOT}\".format(N=val[0], TOT=val[1])\n        elif fld in set(['study_items', 'pop_items', 'alt_ids']):\n            if itemid2name is not None:\n                val = [itemid2name.get(v, v) for v in val]\n            return \", \".join([str(v) for v in sorted(val)])\n        return val", "entry_point": "_get_rpt_fmt", "input": "'  padded  ', {1, 2, 3}, 0.5", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/go_enrichment.py#L217-L225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034670", "code": "def get_adj_records(results, min_ratio=None, pval=0.05):\n        \"\"\"Return GOEA results with some additional statistics calculated.\"\"\"\n        records = []\n        for rec in results:\n            # calculate some additional statistics\n            # (over_under, is_ratio_different)\n            rec.update_remaining_fldsdefprt(min_ratio=min_ratio)\n\n            if pval is not None and rec.p_uncorrected >= pval:\n                continue\n\n            if rec.is_ratio_different:\n                records.append(rec)\n        return records", "entry_point": "get_adj_records", "input": "(), True, (1, 2)", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/goatools/blob/407682e573a108864a79031f8ca19ee3bf377626/goatools/go_enrichment.py#L538-L551", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034671", "code": "def parse_boolean_envvar(val):\n    \"\"\"Parse a boolean environment variable.\"\"\"\n    if not val or val.lower() in {'false', '0'}:\n        return False\n    elif val.lower() in {'true', '1'}:\n        return True\n    else:\n        raise ValueError('Invalid boolean environment variable: %s' % val)", "entry_point": "parse_boolean_envvar", "input": "()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wal-e/wal-e/blob/027263860e72a403bc0e1497bb3e67523138e7a2/wal_e/cmd.py#L161-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034672", "code": "def _config_hint_generate(optname, both_env_and_param):\n    \"\"\"Generate HINT language for missing configuration\"\"\"\n    env = optname.replace('-', '_').upper()\n\n    if both_env_and_param:\n        option = '--' + optname.lower()\n        return ('Pass \"{0}\" or set the environment variable \"{1}\".'\n                .format(option, env))\n    else:\n        return 'Set the environment variable {0}.'.format(env)", "entry_point": "_config_hint_generate", "input": "'Hello World', [-1, 0, 1, 2]", "output": "'Pass \"--hello world\" or set the environment variable \"HELLO WORLD\".'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wal-e/wal-e/blob/027263860e72a403bc0e1497bb3e67523138e7a2/wal_e/cmd.py#L386-L395", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034673", "code": "def rearrange_pads(pads):\n    \"\"\" Interleave pad values to match NNabla format\n    (S0,S1,E0,E1) => (S0,E0,S1,E1)\"\"\"\n    half = len(pads)//2\n    starts = pads[:half]\n    ends = pads[half:]\n    return [j for i in zip(starts, ends) for j in i]", "entry_point": "rearrange_pads", "input": "['a', 'b', 'c']", "output": "['a', 'b']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sony/nnabla/blob/aaf3d33b7cbb38f2a03aa754178ba8f7c8481320/python/src/nnabla/utils/converter/onnx/importer.py#L353-L359", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034674", "code": "def _get_unique_function_name(function_type, functions):\n    '''Get a unique function name.\n\n    Args:\n        function_type(str): Name of Function. Ex) Convolution, Affine\n        functions(OrderedDict of (str, Function)\n\n    Returns: str\n        A unique function name\n    '''\n    function_name = function_name_base = function_type\n    count = 2\n    while function_name in functions:\n        function_name = '{}_{}'.format(function_name_base, count)\n        count += 1\n    return function_name", "entry_point": "_get_unique_function_name", "input": "[5, 3, 1, 4], []", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sony/nnabla/blob/aaf3d33b7cbb38f2a03aa754178ba8f7c8481320/python/src/nnabla/utils/save.py#L41-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034675", "code": "def _get_unique_variable_name(vname, variables):\n    '''Get a unique variable name.\n\n    Args:\n        vname(str): A candidate name.\n        variable(OrderedDict of str and Variable)\n\n    Returns: str\n        A unique variable name\n    '''\n    count = 2\n    vname_base = vname\n    while vname in variables:\n        vname = '{}_{}'.format(vname_base, count)\n        count += 1\n    return vname", "entry_point": "_get_unique_variable_name", "input": "'AbC dEf', []", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sony/nnabla/blob/aaf3d33b7cbb38f2a03aa754178ba8f7c8481320/python/src/nnabla/utils/save.py#L59-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034676", "code": "def sortkey(x):\n    \"\"\"Return '001002003' for (colorname, 1, 2, 3)\"\"\"\n    k = str(x[1]).zfill(3) + str(x[2]).zfill(3) + str(x[3]).zfill(3)\n    return k", "entry_point": "sortkey", "input": "[5, 3, 1, 4]", "output": "'003001004'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pymupdf/PyMuPDF/blob/917f2d83482510e26ba0ff01fd2392c26f3a8e90/examples/colordbRGB.py#L24-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034677", "code": "def pixlen(text, widthlist, fontsize):\n    \"\"\"Calculate the length of text in pixels, given a list of (font-specific)\n    glyph widths and the fontsize. Parameter 'widthlist' should have been\n    created by 'doc._getCharWidths()'.\"\"\"\n    pl = 0.0\n    for t in text:\n        pl += widthlist[ord(t)]\n    return pl * fontsize", "entry_point": "pixlen", "input": "'', [5, 3, 1, 4], 10", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pymupdf/PyMuPDF/blob/917f2d83482510e26ba0ff01fd2392c26f3a8e90/demo/text2pdf.py#L16-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034678", "code": "def char_repl(x):\n    \"\"\"A little embarrassing: couldn't figure out how to avoid crashes when\n    hardcore unicode occurs in description fields ...\"\"\"\n    r = \"\"\n    for c in x:\n        if ord(c) > 255:\n            r += \"?\"\n        else:\n            r += c\n    return r", "entry_point": "char_repl", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pymupdf/PyMuPDF/blob/917f2d83482510e26ba0ff01fd2392c26f3a8e90/examples/embedded-list.py#L25-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034679", "code": "def sortkey(x):\n    \"\"\"Return Hue, Saturation, Value string for (colorname, r, g, b).\"\"\"\n    r = x[1] / 255.\n    g = x[2] / 255.\n    b = x[3] / 255.\n    cmax = max(r, g, b)\n    V = str(int(round(cmax * 100))).zfill(3)\n    cmin = min(r, g, b)\n    delta = cmax - cmin\n    if delta == 0:\n        hue = 0\n    elif cmax == r:\n        hue = 60. * (((g - b)/delta) % 6)\n    elif cmax == g:\n        hue = 60. * (((b - r)/delta) + 2)\n    else:\n        hue = 60. * (((r - g)/delta) + 4)\n        \n    H = str(int(round(hue))).zfill(3)\n    \n    if cmax == 0:\n        sat = 0\n    else:\n        sat = delta / cmax\n    S = str(int(round(sat  * 100))).zfill(3)\n\n    return H + S + V", "entry_point": "sortkey", "input": "[5, 3, 1, 4]", "output": "'280075002'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pymupdf/PyMuPDF/blob/917f2d83482510e26ba0ff01fd2392c26f3a8e90/examples/colordbHSV.py#L22-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034680", "code": "def format_row(row, bounds, columns):\n        \"\"\"Formats a single row of the dataframe\"\"\"\n        for c in columns:\n            if c not in row:\n                continue\n\n            if \"format\" in columns[c]:\n                row[c] = columns[c][\"format\"] % row[c]\n\n            if c in bounds:\n                b = bounds[c]\n                row[c] = [b[\"min\"],row[b[\"lower\"]], row[b[\"upper\"]], b[\"max\"]]\n\n        return row", "entry_point": "format_row", "input": "[5, 3, 1, 4], [-1, 0, 1, 2], [[1, 2], [3], []]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stitchfix/pyxley/blob/2dab00022d977d986169cd8a629b3a2f91be893f/pyxley/charts/datatables/datatable.py#L70-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034681", "code": "def topic_matches_sub(sub, topic):\n    \"\"\"Check whether a topic matches a subscription.\n\n    For example:\n\n    foo/bar would match the subscription foo/# or +/bar\n    non/matching would not match the subscription non/+/+\n    \"\"\"\n    result = True\n    multilevel_wildcard = False\n\n    slen = len(sub)\n    tlen = len(topic)\n\n    if slen > 0 and tlen > 0:\n        if (sub[0] == '$' and topic[0] != '$') or (topic[0] == '$' and sub[0] != '$'):\n            return False\n\n    spos = 0\n    tpos = 0\n\n    while spos < slen and tpos < tlen:\n        if sub[spos] == topic[tpos]:\n            if tpos == tlen-1:\n                # Check for e.g. foo matching foo/#\n                if spos == slen-3 and sub[spos+1] == '/' and sub[spos+2] == '#':\n                    result = True\n                    multilevel_wildcard = True\n                    break\n\n            spos += 1\n            tpos += 1\n\n            if tpos == tlen and spos == slen-1 and sub[spos] == '+':\n                spos += 1\n                result = True\n                break\n        else:\n            if sub[spos] == '+':\n                spos += 1\n                while tpos < tlen and topic[tpos] != '/':\n                    tpos += 1\n                if tpos == tlen and spos == slen:\n                    result = True\n                    break\n\n            elif sub[spos] == '#':\n                multilevel_wildcard = True\n                if spos+1 != slen:\n                    result = False\n                    break\n                else:\n                    result = True\n                    break\n\n            else:\n                result = False\n                break\n\n    if not multilevel_wildcard and (tpos < tlen or spos < slen):\n        result = False\n\n    return result", "entry_point": "topic_matches_sub", "input": "['a', 'b', 'c'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aws/aws-iot-device-sdk-python/blob/f0aa2ce34b21dd2e44f4fb7e1d058656aaf2fc62/AWSIoTPythonSDK/core/protocol/paho/client.py#L199-L261", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034682", "code": "def _filter_repeating_items(download_list):\n        \"\"\" Because of data_filter some requests in download list might be the same. In order not to download them again\n        this method will reduce the list of requests. It will also return a mapping list which can be used to\n        reconstruct the previous list of download requests.\n\n        :param download_list: List of download requests\n        :type download_list: list(sentinelhub.DownloadRequest)\n        :return: reduced download list with unique requests and mapping list\n        :rtype: (list(sentinelhub.DownloadRequest), list(int))\n        \"\"\"\n        unique_requests_map = {}\n        mapping_list = []\n        unique_download_list = []\n        for download_request in download_list:\n            if download_request not in unique_requests_map:\n                unique_requests_map[download_request] = len(unique_download_list)\n                unique_download_list.append(download_request)\n            mapping_list.append(unique_requests_map[download_request])\n        return unique_download_list, mapping_list", "entry_point": "_filter_repeating_items", "input": "[1, 2, 3]", "output": "([1, 2, 3], [0, 1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/sentinelhub-py/blob/08a83b7f1e289187159a643336995d8369860fea/sentinelhub/data_request.py#L181-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034683", "code": "def _parse_layer(layer, return_wms_name=False):\n        \"\"\" Helper function for parsing Geopedia layer name. If WMS name is required and wrong form is given it will\n        return a string with 'ttl' at the beginning. (WMS name can also start with something else, e.g. only 't'\n        instead 'ttl', therefore anything else is also allowed.) Otherwise it will parse it into a number.\n        \"\"\"\n        if not isinstance(layer, (int, str)):\n            raise ValueError(\"Parameter 'layer' should be an integer or a string, but {} found\".format(type(layer)))\n\n        if return_wms_name:\n            if isinstance(layer, int) or layer.isdigit():\n                return 'ttl{}'.format(layer)\n            return layer\n\n        if isinstance(layer, str):\n            stripped_layer = layer.lstrip('tl')\n            if not stripped_layer.isdigit():\n                raise ValueError(\"Parameter 'layer' has unsupported value {}, expected an integer\".format(layer))\n            layer = stripped_layer\n\n        return int(layer)", "entry_point": "_parse_layer", "input": "'walnut thistle harbour', {'a': 1, 'b': 2}", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/sentinelhub-py/blob/08a83b7f1e289187159a643336995d8369860fea/sentinelhub/geopedia.py#L30-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034684", "code": "def _parse_resolution(res):\n        \"\"\" Helper method for parsing given resolution. It will also try to parse a string into float\n\n        :return: A float value of resolution\n        :rtype: float\n        \"\"\"\n        if isinstance(res, str):\n            return float(res.strip('m'))\n        if isinstance(res, (int, float)):\n            return float(res)\n\n        raise TypeError('Resolution should be a float, got resolution of type {}'.format(type(res)))", "entry_point": "_parse_resolution", "input": "0.5", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/sentinelhub-py/blob/08a83b7f1e289187159a643336995d8369860fea/sentinelhub/geometry.py#L312-L323", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034685", "code": "def _parse_split_shape(split_shape):\n        \"\"\"Parses the parameter `split_shape`\n\n        :param split_shape: The parameter `split_shape` from class initialization\n        :type split_shape: int or (int, int)\n        :return: A tuple of n\n        :rtype: (int, int)\n        :raises: ValueError\n        \"\"\"\n        if isinstance(split_shape, int):\n            return split_shape, split_shape\n        if isinstance(split_shape, (tuple, list)):\n            if len(split_shape) == 2 and isinstance(split_shape[0], int) and isinstance(split_shape[1], int):\n                return split_shape[0], split_shape[1]\n            raise ValueError(\"Content of split_shape {} must be 2 integers.\".format(split_shape))\n        raise ValueError(\"Split shape must be an int or a tuple of 2 integers.\")", "entry_point": "_parse_split_shape", "input": "(1, 2)", "output": "(1, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/sentinelhub-py/blob/08a83b7f1e289187159a643336995d8369860fea/sentinelhub/areas.py#L212-L227", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034686", "code": "def parse_tile_name(name):\n        \"\"\"\n        Parses and verifies tile name.\n\n        :param name: class input parameter `tile_name`\n        :type name: str\n        :return: parsed tile name\n        :rtype: str\n        \"\"\"\n        tile_name = name.lstrip('T0')\n        if len(tile_name) == 4:\n            tile_name = '0' + tile_name\n        if len(tile_name) != 5:\n            raise ValueError('Invalid tile name {}'.format(name))\n        return tile_name", "entry_point": "parse_tile_name", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/sentinelhub-py/blob/08a83b7f1e289187159a643336995d8369860fea/sentinelhub/aws.py#L485-L499", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034687", "code": "def split32(data):\n    \"\"\" Split data into pieces of 32 bytes. \"\"\"\n    all_pieces = []\n\n    for position in range(0, len(data), 32):\n        piece = data[position:position + 32]\n        all_pieces.append(piece)\n\n    return all_pieces", "entry_point": "split32", "input": "['a', 'b', 'c']", "output": "[['a', 'b', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/pyethereum/blob/b704a5c6577863edc539a1ec3d2620a443b950fb/ethereum/abi.py#L38-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034688", "code": "def _canonical_type(name):  # pylint: disable=too-many-return-statements\n    \"\"\" Replace aliases to the corresponding type to compute the ids. \"\"\"\n\n    if name == 'int':\n        return 'int256'\n\n    if name == 'uint':\n        return 'uint256'\n\n    if name == 'fixed':\n        return 'fixed128x128'\n\n    if name == 'ufixed':\n        return 'ufixed128x128'\n\n    if name.startswith('int['):\n        return 'int256' + name[3:]\n\n    if name.startswith('uint['):\n        return 'uint256' + name[4:]\n\n    if name.startswith('fixed['):\n        return 'fixed128x128' + name[5:]\n\n    if name.startswith('ufixed['):\n        return 'ufixed128x128' + name[6:]\n\n    return name", "entry_point": "_canonical_type", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/pyethereum/blob/b704a5c6577863edc539a1ec3d2620a443b950fb/ethereum/abi.py#L49-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034689", "code": "def starts_with(full, part):\n    \"\"\" test whether the items in the part is\n    the leading items of the full\n    \"\"\"\n    if len(full) < len(part):\n        return False\n    return full[:len(part)] == part", "entry_point": "starts_with", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/pyethereum/blob/b704a5c6577863edc539a1ec3d2620a443b950fb/ethereum/experimental/pruning_trie.py#L171-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034690", "code": "def check_keystore_json(jsondata):\n    \"\"\"Check if ``jsondata`` has the structure of a keystore file version 3.\n\n    Note that this test is not complete, e.g. it doesn't check key derivation or cipher parameters.\n\n    :param jsondata: dictionary containing the data from the json file\n    :returns: `True` if the data appears to be valid, otherwise `False`\n    \"\"\"\n    if 'crypto' not in jsondata and 'Crypto' not in jsondata:\n        return False\n    if 'version' not in jsondata:\n        return False\n    if jsondata['version'] != 3:\n        return False\n    crypto = jsondata.get('crypto', jsondata.get('Crypto'))\n    if 'cipher' not in crypto:\n        return False\n    if 'ciphertext' not in crypto:\n        return False\n    if 'kdf' not in crypto:\n        return False\n    if 'mac' not in crypto:\n        return False\n    return True", "entry_point": "check_keystore_json", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/pyethereum/blob/b704a5c6577863edc539a1ec3d2620a443b950fb/ethereum/tools/keys.py#L161-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034691", "code": "def sequence(arcs):\n    \"\"\"sequence: make a list of cities to visit, from set of arcs\"\"\"\n    succ = {}\n    for (i,j) in arcs:\n        succ[i] = j\n    curr = 1    # first node being visited\n    sol = [curr]\n    for i in range(len(arcs)-2):\n        curr = succ[curr]\n        sol.append(curr)\n    return sol", "entry_point": "sequence", "input": "set()", "output": "[1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SCIP-Interfaces/PySCIPOpt/blob/9c960b40d94a48b0304d73dbe28b467b9c065abe/examples/finished/atsp.py#L172-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034692", "code": "def mkCuttingStock(s):\n    \"\"\"mkCuttingStock: convert a bin packing instance into cutting stock format\"\"\"\n    w,q = [],[]   # list of different widths (sizes) of items, their quantities\n    for item in sorted(s):\n        if w == [] or item != w[-1]:\n            w.append(item)\n            q.append(1)\n        else:\n            q[-1] += 1\n    return w,q", "entry_point": "mkCuttingStock", "input": "[[1, 2], [3], []]", "output": "([[], [1, 2], [3]], [1, 1, 1])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SCIP-Interfaces/PySCIPOpt/blob/9c960b40d94a48b0304d73dbe28b467b9c065abe/examples/unfinished/cutstock.py#L158-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034693", "code": "def mkBinPacking(w,q):\n    \"\"\"mkBinPacking: convert a cutting stock instance into bin packing format\"\"\"\n    s = []\n    for j in range(len(w)):\n        for i in range(q[j]):\n            s.append(w[j])\n    return s", "entry_point": "mkBinPacking", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "['cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SCIP-Interfaces/PySCIPOpt/blob/9c960b40d94a48b0304d73dbe28b467b9c065abe/examples/unfinished/cutstock.py#L170-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034694", "code": "def FFD(s,B):\n    \"\"\"First Fit Decreasing heuristics for the Bin Packing Problem.\n    Parameters:\n        - s: list with item widths\n        - B: bin capacity\n    Returns a list of lists with bin compositions.\n    \"\"\"\n    remain = [B]        # keep list of empty space per bin\n    sol = [[]]          # a list ot items (i.e., sizes) on each used bin\n    for item in sorted(s,reverse=True):\n        for (j,free) in enumerate(remain):\n            if free >= item:\n                remain[j] -= item\n                sol[j].append(item)\n                break\n        else: #does not fit in any bin\n            sol.append([item])\n            remain.append(B-item)\n    return sol", "entry_point": "FFD", "input": "[], ['apple', 'banana', 'cherry']", "output": "[[]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SCIP-Interfaces/PySCIPOpt/blob/9c960b40d94a48b0304d73dbe28b467b9c065abe/examples/finished/bpp.py#L16-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034695", "code": "def nice_join(seq, sep=\", \", conjunction=\"or\"):\n    ''' Join together sequences of strings into English-friendly phrases using\n    a conjunction when appropriate.\n\n    Args:\n        seq (seq[str]) : a sequence of strings to nicely join\n\n        sep (str, optional) : a sequence delimiter to use (default: \", \")\n\n        conjunction (str or None, optional) : a conjunction to use for the last\n            two items, or None to reproduce basic join behavior (default: \"or\")\n\n    Returns:\n        a joined string\n\n    Examples:\n        >>> nice_join([\"a\", \"b\", \"c\"])\n        'a, b or c'\n\n    '''\n    seq = [str(x) for x in seq]\n\n    if len(seq) <= 1 or conjunction is None:\n        return sep.join(seq)\n    else:\n        return \"%s %s %s\" % (sep.join(seq[:-1]), conjunction, seq[-1])", "entry_point": "nice_join", "input": "['a', 'b', 'c'], 'walnut thistle harbour', [1, 2, 3]", "output": "'awalnut thistle harbourb [1, 2, 3] c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/intake/intake/blob/277b96bfdee39d8a3048ea5408c6d6716d568336/intake/cli/util.py#L46-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034696", "code": "def path_to_pattern(path, metadata=None):\n    \"\"\"\n    Remove source information from path when using chaching\n\n    Returns None if path is not str\n\n    Parameters\n    ----------\n    path : str\n        Path to data optionally containing format_strings\n    metadata : dict, optional\n        Extra arguments to the class, contains any cache information\n\n    Returns\n    -------\n    pattern : str\n        Pattern style path stripped of everything to the left of cache regex.\n    \"\"\"\n    if not isinstance(path, str):\n        return\n\n    pattern = path\n    if metadata:\n        cache = metadata.get('cache')\n        if cache:\n            regex = next(c.get('regex') for c in cache if c.get('argkey') == 'urlpath')\n            pattern = pattern.split(regex)[-1]\n    return pattern", "entry_point": "path_to_pattern", "input": "'Hello World', []", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/intake/intake/blob/277b96bfdee39d8a3048ea5408c6d6716d568336/intake/source/utils.py#L258-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034697", "code": "def coerce_to_list(items, preprocess=None):\n    \"\"\"Given an instance or list, coerce to list.\n\n    With optional preprocessing.\n    \"\"\"\n    if not isinstance(items, list):\n        items = [items]\n    if preprocess:\n        items = list(map(preprocess, items))\n    return items", "entry_point": "coerce_to_list", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/intake/intake/blob/277b96bfdee39d8a3048ea5408c6d6716d568336/intake/gui/base.py#L25-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034698", "code": "def _convert(lines):\n    \"\"\"Convert compiled .ui file from PySide2 to Qt.py\n\n    Arguments:\n        lines (list): Each line of of .ui file\n\n    Usage:\n        >> with open(\"myui.py\") as f:\n        ..   lines = _convert(f.readlines())\n\n    \"\"\"\n\n    def parse(line):\n        line = line.replace(\"from PySide2 import\", \"from Qt import QtCompat,\")\n        line = line.replace(\"QtWidgets.QApplication.translate\",\n                            \"QtCompat.translate\")\n        if \"QtCore.SIGNAL\" in line:\n            raise NotImplementedError(\"QtCore.SIGNAL is missing from PyQt5 \"\n                                      \"and so Qt.py does not support it: you \"\n                                      \"should avoid defining signals inside \"\n                                      \"your ui files.\")\n        return line\n\n    parsed = list()\n    for line in lines:\n        line = parse(line)\n        parsed.append(line)\n\n    return parsed", "entry_point": "_convert", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mottosso/Qt.py/blob/d88a0c1762ad90d1965008cc14c53504bbcc0061/Qt.py#L1595-L1623", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034699", "code": "def TrimBeginningAndEndingSlashes(path):\n    \"\"\"Trims beginning and ending slashes\n\n    :param str path:\n\n    :return:\n        Path with beginning and ending slashes trimmed.\n    :rtype: str\n    \"\"\"\n    if path.startswith('/'):\n        # Returns substring starting from index 1 to end of the string\n        path = path[1:]\n\n    if path.endswith('/'):\n        # Returns substring starting from beginning to last but one char in the string\n        path = path[:-1]\n\n    return path", "entry_point": "TrimBeginningAndEndingSlashes", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Azure/azure-cosmos-python/blob/dd01b3c5d308c6da83cfcaa0ab7083351a476353/azure/cosmos/base.py#L546-L563", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034700", "code": "def scale_between(minval, maxval, numStops):\n    \"\"\" Scale a min and max value to equal interval domain with\n        numStops discrete values\n    \"\"\"\n\n    scale = []\n\n    if numStops < 2:\n        return [minval, maxval]\n    elif maxval < minval:\n        raise ValueError()\n    else:\n        domain = maxval - minval\n        interval = float(domain) / float(numStops)\n        for i in range(numStops):\n            scale.append(round(minval + interval * i, 2))\n        return scale", "entry_point": "scale_between", "input": "10, [], 0.5", "output": "[10, []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapbox/mapboxgl-jupyter/blob/f6e403c13eaa910e70659c7d179e8e32ce95ae34/mapboxgl/utils.py#L138-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034701", "code": "def numeric_map(lookup, numeric_stops, default=0.0):\n    \"\"\"Return a number value interpolated from given numeric_stops\n    \"\"\"\n    # if no numeric_stops, use default\n    if len(numeric_stops) == 0:\n        return default\n    \n    # dictionary to lookup value from match-type numeric_stops\n    match_map = dict((x, y) for (x, y) in numeric_stops)\n\n    # if lookup matches stop exactly, return corresponding stop (first priority)\n    # (includes non-numeric numeric_stop \"keys\" for finding value by match)\n    if lookup in match_map.keys():\n        return match_map.get(lookup)\n\n    # if lookup value numeric, map value by interpolating from scale\n    if isinstance(lookup, (int, float, complex)):\n\n        # try ordering stops \n        try:\n            stops, values = zip(*sorted(numeric_stops))\n        \n        # if not all stops are numeric, attempt looking up as if categorical stops\n        except TypeError:\n            return match_map.get(lookup, default)\n\n        # for interpolation, all stops must be numeric\n        if not all(isinstance(x, (int, float, complex)) for x in stops):\n            return default\n\n        # check if lookup value in stops bounds\n        if float(lookup) <= stops[0]:\n            return values[0]\n        \n        elif float(lookup) >= stops[-1]:\n            return values[-1]\n        \n        # check if lookup value matches any stop value\n        elif float(lookup) in stops:\n            return values[stops.index(lookup)]\n        \n        # interpolation required\n        else:\n\n            # identify bounding stop values\n            lower = max([stops[0]] + [x for x in stops if x < lookup])\n            upper = min([stops[-1]] + [x for x in stops if x > lookup])\n            \n            # values from bounding stops\n            lower_value = values[stops.index(lower)]\n            upper_value = values[stops.index(upper)]\n            \n            # compute linear \"relative distance\" from lower bound to upper bound\n            distance = (lookup - lower) / (upper - lower)\n\n            # return interpolated value\n            return lower_value + distance * (upper_value - lower_value)\n\n    # default value catch-all\n    return default", "entry_point": "numeric_map", "input": "{1, 2, 3}, set(), 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapbox/mapboxgl-jupyter/blob/f6e403c13eaa910e70659c7d179e8e32ce95ae34/mapboxgl/utils.py#L321-L380", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034702", "code": "def height_map(lookup, height_stops, default_height=0.0):\n    \"\"\"Return a height value (in meters) interpolated from given height_stops;\n    for use with vector-based visualizations using fill-extrusion layers\n    \"\"\"\n    # if no height_stops, use default height\n    if len(height_stops) == 0:\n        return default_height\n    \n    # dictionary to lookup height from match-type height_stops\n    match_map = dict((x, y) for (x, y) in height_stops)\n\n    # if lookup matches stop exactly, return corresponding height (first priority)\n    # (includes non-numeric height_stop \"keys\" for finding height by match)\n    if lookup in match_map.keys():\n        return match_map.get(lookup)\n\n    # if lookup value numeric, map height by interpolating from height scale\n    if isinstance(lookup, (int, float, complex)):\n\n        # try ordering stops \n        try:\n            stops, heights = zip(*sorted(height_stops))\n        \n        # if not all stops are numeric, attempt looking up as if categorical stops\n        except TypeError:\n            return match_map.get(lookup, default_height)\n\n        # for interpolation, all stops must be numeric\n        if not all(isinstance(x, (int, float, complex)) for x in stops):\n            return default_height\n\n        # check if lookup value in stops bounds\n        if float(lookup) <= stops[0]:\n            return heights[0]\n        \n        elif float(lookup) >= stops[-1]:\n            return heights[-1]\n        \n        # check if lookup value matches any stop value\n        elif float(lookup) in stops:\n            return heights[stops.index(lookup)]\n        \n        # interpolation required\n        else:\n\n            # identify bounding height stop values\n            lower = max([stops[0]] + [x for x in stops if x < lookup])\n            upper = min([stops[-1]] + [x for x in stops if x > lookup])\n            \n            # heights from bounding stops\n            lower_height = heights[stops.index(lower)]\n            upper_height = heights[stops.index(upper)]\n            \n            # compute linear \"relative distance\" from lower bound height to upper bound height\n            distance = (lookup - lower) / (upper - lower)\n\n            # return string representing rgb height value\n            return lower_height + distance * (upper_height - lower_height)\n\n    # default height value catch-all\n    return default_height", "entry_point": "height_map", "input": "(1, 2), {}, {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapbox/mapboxgl-jupyter/blob/f6e403c13eaa910e70659c7d179e8e32ce95ae34/mapboxgl/utils.py#L400-L460", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034703", "code": "def trim_docstring(docstring):\n    \"\"\"Uniformly trims leading/trailing whitespace from docstrings.\n\n    Based on http://www.python.org/peps/pep-0257.html#handling-docstring-indentation\n    \"\"\"\n    if not docstring or not docstring.strip():\n        return \"\"\n    # Convert tabs to spaces and split into lines\n    lines = docstring.expandtabs().splitlines()\n    indent = min(len(line) - len(line.lstrip()) for line in lines if line.lstrip())\n    trimmed = [lines[0].lstrip()] + [line[indent:].rstrip() for line in lines[1:]]\n    return \"\\n\".join(trimmed).strip()", "entry_point": "trim_docstring", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marshmallow-code/apispec/blob/e92ceffd12b2e392b8d199ed314bd2a7e6512dff/src/apispec/utils.py#L124-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034704", "code": "def deduplicate(list_object):\n    \"\"\"Rebuild `list_object` removing duplicated and keeping order\"\"\"\n    new = []\n    for item in list_object:\n        if item not in new:\n            new.append(item)\n    return new", "entry_point": "deduplicate", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rochacbruno/dynaconf/blob/5a7cc8f8252251cbdf4f4112965801f9dfe2831d/dynaconf/utils/__init__.py#L148-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034705", "code": "def trimmed_split(s, seps=(\";\", \",\")):\n    \"\"\"Given a string s, split is by one of one of the seps.\"\"\"\n    for sep in seps:\n        if sep not in s:\n            continue\n        data = [item.strip() for item in s.strip().split(sep)]\n        return data\n    return [s]", "entry_point": "trimmed_split", "input": "[1, 2, 3], 'a,b,c'", "output": "[[1, 2, 3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rochacbruno/dynaconf/blob/5a7cc8f8252251cbdf4f4112965801f9dfe2831d/dynaconf/utils/__init__.py#L175-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034706", "code": "def decode_params_utf8(params):\n    \"\"\"Ensures that all parameters in a list of 2-element tuples are decoded to\n    unicode using UTF-8.\n    \"\"\"\n    decoded = []\n    for k, v in params:\n        decoded.append((\n            k.decode('utf-8') if isinstance(k, bytes) else k,\n            v.decode('utf-8') if isinstance(v, bytes) else v))\n    return decoded", "entry_point": "decode_params_utf8", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oauthlib/oauthlib/blob/30321dd3c0ca784d3508a1970cf90d9f76835c79/oauthlib/common.py#L104-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034707", "code": "def calendar_date(jd_integer):\n    \"\"\"Convert Julian Day `jd_integer` into a Gregorian (year, month, day).\"\"\"\n\n    k = jd_integer + 68569\n    n = 4 * k // 146097\n\n    k = k - (146097 * n + 3) // 4\n    m = 4000 * (k + 1) // 1461001\n    k = k - 1461 * m // 4 + 31\n    month = 80 * k // 2447\n    day = k - 2447 * month // 80\n    k = month // 11\n\n    month = month + 2 - 12 * k\n    year = 100 * (n - 49) + m + k\n\n    return year, month, day", "entry_point": "calendar_date", "input": "2", "output": "(-4713, 11, 26)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/skyfielders/python-skyfield/blob/51d9e042e06457f6b1f2415296d50a38cb3a300f/skyfield/timelib.py#L714-L730", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034708", "code": "def clamp(inclusive_lower_bound: int,\n          inclusive_upper_bound: int,\n          value: int) -> int:\n    \"\"\"\n    Bound the given ``value`` between ``inclusive_lower_bound`` and\n    ``inclusive_upper_bound``.\n    \"\"\"\n    if value <= inclusive_lower_bound:\n        return inclusive_lower_bound\n    elif value >= inclusive_upper_bound:\n        return inclusive_upper_bound\n    else:\n        return value", "entry_point": "clamp", "input": "['a', 'b', 'c'], [[1, 2], [3], []], ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/py-evm/blob/58346848f076116381d3274bbcea96b9e2cfcbdf/eth/_utils/numeric.py#L90-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034709", "code": "def compute_knot_vector(degree, num_points, params):\n    \"\"\" Computes a knot vector from the parameter list using averaging method.\n\n    Please refer to the Equation 9.8 on The NURBS Book (2nd Edition), pp.365 for details.\n\n    :param degree: degree\n    :type degree: int\n    :param num_points: number of data points\n    :type num_points: int\n    :param params: list of parameters, :math:`\\\\overline{u}_{k}`\n    :type params: list, tuple\n    :return: knot vector\n    :rtype: list\n    \"\"\"\n    # Start knot vector\n    kv = [0.0 for _ in range(degree + 1)]\n\n    # Use averaging method (Eqn 9.8) to compute internal knots in the knot vector\n    for i in range(num_points - degree - 1):\n        temp_kv = (1.0 / degree) * sum([params[j] for j in range(i + 1, i + degree + 1)])\n        kv.append(temp_kv)\n\n    # End knot vector\n    kv += [1.0 for _ in range(degree + 1)]\n\n    return kv", "entry_point": "compute_knot_vector", "input": "0, False, -1.5", "output": "[0.0, 1.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/fitting.py#L358-L383", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034710", "code": "def flip_ctrlpts_u(ctrlpts, size_u, size_v):\n    \"\"\" Flips a list of 1-dimensional control points from u-row order to v-row order.\n\n    **u-row order**: each row corresponds to a list of u values\n\n    **v-row order**: each row corresponds to a list of v values\n\n    :param ctrlpts: control points in u-row order\n    :type ctrlpts: list, tuple\n    :param size_u: size in u-direction\n    :type size_u: int\n    :param size_v: size in v-direction\n    :type size_v: int\n    :return: control points in v-row order\n    :rtype: list\n    \"\"\"\n    new_ctrlpts = []\n    for i in range(0, size_u):\n        for j in range(0, size_v):\n            temp = [float(c) for c in ctrlpts[i + (j * size_u)]]\n            new_ctrlpts.append(temp)\n\n    return new_ctrlpts", "entry_point": "flip_ctrlpts_u", "input": "['a', 'b', 'c'], -3, 2", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/compatibility.py#L11-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034711", "code": "def generate_ctrlptsw(ctrlpts):\n    \"\"\" Generates weighted control points from unweighted ones in 1-D.\n\n    This function\n\n    #. Takes in a 1-D control points list whose coordinates are organized in (x, y, z, w) format\n    #. converts into (x*w, y*w, z*w, w) format\n    #. Returns the result\n\n    :param ctrlpts: 1-D control points (P)\n    :type ctrlpts: list\n    :return: 1-D weighted control points (Pw)\n    :rtype: list\n    \"\"\"\n    # Multiply control points by weight\n    new_ctrlpts = []\n    for cpt in ctrlpts:\n        temp = [float(pt * cpt[-1]) for pt in cpt]\n        temp[-1] = float(cpt[-1])\n        new_ctrlpts.append(temp)\n\n    return new_ctrlpts", "entry_point": "generate_ctrlptsw", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/compatibility.py#L86-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034712", "code": "def generate_ctrlpts_weights(ctrlpts):\n    \"\"\" Generates unweighted control points from weighted ones in 1-D.\n\n    This function\n\n    #. Takes in 1-D control points list whose coordinates are organized in (x*w, y*w, z*w, w) format\n    #. Converts the input control points list into (x, y, z, w) format\n    #. Returns the result\n\n    :param ctrlpts: 1-D control points (P)\n    :type ctrlpts: list\n    :return: 1-D weighted control points (Pw)\n    :rtype: list\n    \"\"\"\n    # Divide control points by weight\n    new_ctrlpts = []\n    for cpt in ctrlpts:\n        temp = [float(pt / cpt[-1]) for pt in cpt]\n        temp[-1] = float(cpt[-1])\n        new_ctrlpts.append(temp)\n\n    return new_ctrlpts", "entry_point": "generate_ctrlpts_weights", "input": "()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/compatibility.py#L139-L160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034713", "code": "def generate_ctrlpts2d_weights(ctrlpts2d):\n    \"\"\" Generates unweighted control points from weighted ones in 2-D.\n\n    This function\n\n    #. Takes in 2-D control points list whose coordinates are organized like (x*w, y*w, z*w, w)\n    #. Converts the input control points list into (x, y, z, w) format\n    #. Returns the result\n\n    :param ctrlpts2d: 2-D control points (P)\n    :type ctrlpts2d: list\n    :return: 2-D weighted control points (Pw)\n    :rtype: list\n    \"\"\"\n    # Divide control points by weight\n    new_ctrlpts2d = []\n    for row in ctrlpts2d:\n        ctrlptsw_v = []\n        for col in row:\n            temp = [float(c / col[-1]) for c in col]\n            temp[-1] = float(col[-1])\n            ctrlptsw_v.append(temp)\n        new_ctrlpts2d.append(ctrlptsw_v)\n\n    return new_ctrlpts2d", "entry_point": "generate_ctrlpts2d_weights", "input": "()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/compatibility.py#L163-L187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034714", "code": "def combine_ctrlpts_weights(ctrlpts, weights=None):\n    \"\"\" Multiplies control points by the weights to generate weighted control points.\n\n    This function is dimension agnostic, i.e. control points can be in any dimension but weights should be 1D.\n\n    The ``weights`` function parameter can be set to None to let the function generate a weights vector composed of\n    1.0 values. This feature can be used to convert B-Spline basis to NURBS basis.\n\n    :param ctrlpts: unweighted control points\n    :type ctrlpts: list, tuple\n    :param weights: weights vector; if set to None, a weights vector of 1.0s will be automatically generated\n    :type weights: list, tuple or None\n    :return: weighted control points\n    :rtype: list\n    \"\"\"\n    if weights is None:\n        weights = [1.0 for _ in range(len(ctrlpts))]\n\n    ctrlptsw = []\n    for pt, w in zip(ctrlpts, weights):\n        temp = [float(c * w) for c in pt]\n        temp.append(float(w))\n        ctrlptsw.append(temp)\n\n    return ctrlptsw", "entry_point": "combine_ctrlpts_weights", "input": "['a', 'b', 'c'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/compatibility.py#L190-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034715", "code": "def separate_ctrlpts_weights(ctrlptsw):\n    \"\"\" Divides weighted control points by weights to generate unweighted control points and weights vector.\n\n    This function is dimension agnostic, i.e. control points can be in any dimension but the last element of the array\n    should indicate the weight.\n\n    :param ctrlptsw: weighted control points\n    :type ctrlptsw: list, tuple\n    :return: unweighted control points and weights vector\n    :rtype: list\n    \"\"\"\n    ctrlpts = []\n    weights = []\n    for ptw in ctrlptsw:\n        temp = [float(pw / ptw[-1]) for pw in ptw[:-1]]\n        ctrlpts.append(temp)\n        weights.append(ptw[-1])\n\n    return [ctrlpts, weights]", "entry_point": "separate_ctrlpts_weights", "input": "{}", "output": "[[], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/compatibility.py#L217-L235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034716", "code": "def convert_bb_to_faces(voxel_grid):\n    \"\"\" Converts a voxel grid defined by min and max coordinates to a voxel grid defined by faces.\n\n    :param voxel_grid: voxel grid defined by the bounding box of all voxels\n    :return: voxel grid with face data\n    \"\"\"\n    new_vg = []\n    for v in voxel_grid:\n        # Vertices\n        p1 = v[0]\n        p2 = [v[1][0], v[0][1], v[0][2]]\n        p3 = [v[1][0], v[1][1], v[0][2]]\n        p4 = [v[0][0], v[1][1], v[0][2]]\n        p5 = [v[0][0], v[0][1], v[1][2]]\n        p6 = [v[1][0], v[0][1], v[1][2]]\n        p7 = v[1]\n        p8 = [v[0][0], v[1][1], v[1][2]]\n        # Faces\n        fb = [p1, p2, p3, p4]  # bottom face\n        ft = [p5, p6, p7, p8]  # top face\n        fs1 = [p1, p2, p6, p5]  # side face 1\n        fs2 = [p2, p3, p7, p6]  # side face 2\n        fs3 = [p3, p4, p8, p7]  # side face 3\n        fs4 = [p1, p4, p8, p5]  # side face 4\n        # Append to return list\n        new_vg.append([fb, fs1, fs2, fs3, fs4, ft])\n    return new_vg", "entry_point": "convert_bb_to_faces", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/voxelize.py#L59-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034717", "code": "def vector_sum(vector1, vector2, coeff=1.0):\n    \"\"\" Sums the vectors.\n\n    This function computes the result of the vector operation :math:`\\\\overline{v}_{1} + c * \\\\overline{v}_{2}`, where\n    :math:`\\\\overline{v}_{1}` is ``vector1``, :math:`\\\\overline{v}_{2}`  is ``vector2`` and :math:`c` is ``coeff``.\n\n    :param vector1: vector 1\n    :type vector1: list, tuple\n    :param vector2: vector 2\n    :type vector2: list, tuple\n    :param coeff: multiplier for vector 2\n    :type coeff: float\n    :return: updated vector\n    :rtype: list\n    \"\"\"\n    summed_vector = [v1 + (coeff * v2) for v1, v2 in zip(vector1, vector2)]\n    return summed_vector", "entry_point": "vector_sum", "input": "[], ['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/linalg.py#L106-L122", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034718", "code": "def matrix_transpose(m):\n    \"\"\" Transposes the input matrix.\n\n    The input matrix :math:`m` is a 2-dimensional array.\n\n    :param m: input matrix with dimensions :math:`(n \\\\times m)`\n    :type m: list, tuple\n    :return: transpose matrix with dimensions :math:`(m \\\\times n)`\n    :rtype: list\n    \"\"\"\n    num_cols = len(m)\n    num_rows = len(m[0])\n    m_t = []\n    for i in range(num_rows):\n        temp = []\n        for j in range(num_cols):\n            temp.append(m[j][i])\n        m_t.append(temp)\n    return m_t", "entry_point": "matrix_transpose", "input": "['apple', 'banana', 'cherry']", "output": "[['a', 'b', 'c'], ['p', 'a', 'h'], ['p', 'n', 'e'], ['l', 'a', 'r'], ['e', 'n', 'r']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/linalg.py#L342-L360", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034719", "code": "def triangle_center(tri, uv=False):\n    \"\"\" Computes the center of mass of the input triangle.\n\n    :param tri: triangle object\n    :type tri: elements.Triangle\n    :param uv: if True, then finds parametric position of the center of mass\n    :type uv: bool\n    :return: center of mass of the triangle\n    :rtype: tuple\n    \"\"\"\n    if uv:\n        data = [t.uv for t in tri]\n        mid = [0.0, 0.0]\n    else:\n        data = tri.vertices\n        mid = [0.0, 0.0, 0.0]\n    for vert in data:\n        mid = [m + v for m, v in zip(mid, vert)]\n    mid = [float(m) / 3.0 for m in mid]\n    return tuple(mid)", "entry_point": "triangle_center", "input": "[], ['apple', 'banana', 'cherry']", "output": "(0.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/linalg.py#L396-L415", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034720", "code": "def get_par_box(domain, last=False):\n    \"\"\" Returns the bounding box of the surface parametric domain in ccw direction.\n\n    :param domain: parametric domain\n    :type domain: list, tuple\n    :param last: if True, adds the first vertex to the end of the return list\n    :type last: bool\n    :return: edges of the parametric domain\n    :rtype: tuple\n    \"\"\"\n    u_range = domain[0]\n    v_range = domain[1]\n    verts = [(u_range[0], v_range[0]), (u_range[1], v_range[0]), (u_range[1], v_range[1]), (u_range[0], v_range[1])]\n    if last:\n        verts.append(verts[0])\n    return tuple(verts)", "entry_point": "get_par_box", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "(('a', 'b'), ('p', 'b'), ('p', 'a'), ('a', 'a'), ('a', 'b'))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/trimming.py#L281-L296", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034721", "code": "def make_zigzag(points, num_cols):\n    \"\"\" Converts linear sequence of points into a zig-zag shape.\n\n    This function is designed to create input for the visualization software. It orders the points to draw a zig-zag\n    shape which enables generating properly connected lines without any scanlines. Please see the below sketch on the\n    functionality of the ``num_cols`` parameter::\n\n             num cols\n        <-=============->\n        ------->>-------|\n        |------<<-------|\n        |------>>-------|\n        -------<<-------|\n\n    Please note that this function does not detect the ordering of the input points to detect the input points have\n    already been processed to generate a zig-zag shape.\n\n    :param points: list of points to be ordered\n    :type points: list\n    :param num_cols: number of elements in a row which the zig-zag is generated\n    :type num_cols: int\n    :return: re-ordered points\n    :rtype: list\n    \"\"\"\n    new_points = []\n    points_size = len(points)\n    forward = True\n    idx = 0\n    rev_idx = -1\n    while idx < points_size:\n        if forward:\n            new_points.append(points[idx])\n        else:\n            new_points.append(points[rev_idx])\n            rev_idx -= 1\n        idx += 1\n        if idx % num_cols == 0:\n            forward = False if forward else True\n            rev_idx = idx + num_cols - 1\n\n    return new_points", "entry_point": "make_zigzag", "input": "['a', 'b', 'c'], -3", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbingol/NURBS-Python/blob/b1c6a8b51cf143ff58761438e93ba6baef470627/geomdl/utilities.py#L40-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034722", "code": "def anyword_substring_search_inner(query_word, target_words):\n    \"\"\" return True if ANY target_word matches a query_word\n    \"\"\"\n\n    for target_word in target_words:\n\n        if(target_word.startswith(query_word)):\n            return query_word\n\n    return False", "entry_point": "anyword_substring_search_inner", "input": "'', ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/api/search/substring_search.py#L41-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034723", "code": "def order_search_results(query, search_results):\n    \"\"\" order of results should be a) query in first name, b) query in last name\n    \"\"\"\n\n    results = search_results\n\n    results_names = []\n    old_query = query\n    query = query.split(' ')\n\n    first_word = ''\n    second_word = ''\n    third_word = ''\n\n    if(len(query) < 2):\n        first_word = old_query\n    else:\n        first_word = query[0]\n        second_word = query[1]\n\n        if(len(query) > 2):\n            third_word = query[2]\n\n    # save results for multiple passes\n    results_second = []\n    results_third = []\n\n    for result in results:\n\n        result_list = result.split(' ')\n\n        try:\n            if(result_list[0].startswith(first_word)):\n                results_names.append(result)\n            else:\n                results_second.append(result)\n        except:\n            results_second.append(result)\n\n    for result in results_second:\n\n        result_list = result.split(' ')\n\n        try:\n            if(result_list[1].startswith(first_word)):\n                results_names.append(result)\n            else:\n                results_third.append(result)\n        except:\n            results_third.append(result)\n\n    # results are either in results_names (filtered)\n    # or unprocessed in results_third (last pass)\n    return results_names + results_third", "entry_point": "order_search_results", "input": "'a,b,c', ('a', 'b', 'c')", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/api/search/substring_search.py#L242-L295", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034724", "code": "def dedup_search_results(search_results):\n    \"\"\" dedup results\n    \"\"\"\n\n    known = set()\n    deduped_results = []\n\n    for i in search_results:\n\n        username = i['username']\n\n        if username in known:\n            continue\n\n        deduped_results.append(i)\n\n        known.add(username)\n\n    return deduped_results", "entry_point": "dedup_search_results", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/api/search/substring_search.py#L298-L316", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034725", "code": "def atlas_inventory_to_string( inv ):\n    \"\"\"\n    Inventory to string (bitwise big-endian)\n    \"\"\"\n    ret = \"\"\n    for i in range(0, len(inv)):\n        for j in range(0, 8):\n            bit_index = 1 << (7 - j)\n            val = (ord(inv[i]) & bit_index)\n            if val != 0:\n                ret += \"1\"\n            else:\n                ret += \"0\"\n\n    return ret", "entry_point": "atlas_inventory_to_string", "input": "['a', 'b', 'c']", "output": "'011000010110001001100011'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/blockstack/lib/util.py#L255-L269", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034726", "code": "def charset_to_int(s, charset):\n    \"\"\" Turn a string into a non-negative integer.\n\n    >>> charset_to_int('0', B40_CHARS)\n    0\n    >>> charset_to_int('10', B40_CHARS)\n    40\n    >>> charset_to_int('abcd', B40_CHARS)\n    658093\n    >>> charset_to_int('', B40_CHARS)\n    0\n    >>> charset_to_int('muneeb.id', B40_CHARS)\n    149190078205533\n    >>> charset_to_int('A', B40_CHARS)\n    Traceback (most recent call last):\n        ...\n    ValueError: substring not found\n    \"\"\"\n    output = 0\n    for char in s:\n        output = output * len(charset) + charset.index(char)\n\n    return output", "entry_point": "charset_to_int", "input": "[], [[1, 2], [3], []]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/blockstack/lib/b40.py#L68-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034727", "code": "def namedb_update_must_equal( rec, change_fields ):\n    \"\"\"\n    Generate the set of fields that must stay the same across an update.\n    \"\"\"\n    \n    must_equal = []\n    if len(change_fields) != 0:\n        given = rec.keys()\n        for k in given:\n            if k not in change_fields:\n                must_equal.append(k)\n\n    return must_equal", "entry_point": "namedb_update_must_equal", "input": "True, ()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/blockstack/lib/nameset/db.py#L659-L671", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034728", "code": "def namedb_offset_count_predicate( offset=None, count=None ):\n    \"\"\"\n    Make an offset/count predicate\n    even if offset=None or count=None.\n\n    Return (query, args)\n    \"\"\"\n    offset_count_query = \"\"\n    offset_count_args = ()\n\n    if count is not None:\n        offset_count_query += \"LIMIT ? \"\n        offset_count_args += (count,)\n\n    if count is not None and offset is not None:\n        offset_count_query += \"OFFSET ? \"\n        offset_count_args += (offset,)\n\n    return (offset_count_query, offset_count_args)", "entry_point": "namedb_offset_count_predicate", "input": "[5, 3, 1, 4], 5", "output": "('LIMIT ? OFFSET ? ', (5, [5, 3, 1, 4]))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/blockstack/lib/nameset/db.py#L2316-L2334", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034729", "code": "def detect_state_variable_shadowing(contracts):\n    \"\"\"\n    Detects all overshadowing and overshadowed state variables in the provided contracts.\n    :param contracts: The contracts to detect shadowing within.\n    :return: Returns a set of tuples (overshadowing_contract, overshadowing_state_var, overshadowed_contract,\n    overshadowed_state_var).\n    The contract-variable pair's variable does not need to be defined in its paired contract, it may have been\n    inherited. The contracts are simply included to denote the immediate inheritance path from which the shadowed\n    variable originates.\n    \"\"\"\n    results = set()\n    for contract in contracts:\n        variables_declared = {variable.name: variable for variable in contract.variables\n                              if variable.contract == contract}\n        for immediate_base_contract in contract.immediate_inheritance:\n            for variable in immediate_base_contract.variables:\n                if variable.name in variables_declared:\n                    results.add((contract, variables_declared[variable.name], immediate_base_contract, variable))\n    return results", "entry_point": "detect_state_variable_shadowing", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crytic/slither/blob/04c147f7e50223c6af458ca430befae747ccd259/slither/utils/inheritance_analysis.py#L119-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034730", "code": "def _get_prefix_length(number1, number2, bits):\n    \"\"\"Get the number of leading bits that are same for two numbers.\n\n    Args:\n        number1: an integer.\n        number2: another integer.\n        bits: the maximum number of bits to compare.\n\n    Returns:\n        The number of leading bits that are the same for two numbers.\n\n    \"\"\"\n    for i in range(bits):\n        if number1 >> i == number2 >> i:\n            return bits - i\n    return 0", "entry_point": "_get_prefix_length", "input": "3.25, {1, 2, 3}, 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TheHive-Project/Cortex-Analyzers/blob/8dae6a8c4cf9af5554ae8c844985c4b44d4bd4bf/analyzers/MaxMind/ipaddr.py#L170-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034731", "code": "def chk_enum_arg(s):\n    \"\"\"Checks if the string `s` is a valid enum string.\n\n    Return True or False.\"\"\"\n\n    if len(s) == 0 or s[0].isspace() or s[-1].isspace():\n        return False\n    else:\n        return True", "entry_point": "chk_enum_arg", "input": "['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbj4668/pyang/blob/f2a5cc3142162e5b9ee4e18d154568d939ff63dd/pyang/syntax.py#L186-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034732", "code": "def chk_fraction_digits_arg(s):\n    \"\"\"Checks if the string `s` is a valid fraction-digits argument.\n\n    Return True or False.\"\"\"\n    try:\n        v = int(s)\n        if v >= 1 and v <= 18:\n            return True\n        else:\n            return False\n    except ValueError:\n        return False", "entry_point": "chk_fraction_digits_arg", "input": "0", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbj4668/pyang/blob/f2a5cc3142162e5b9ee4e18d154568d939ff63dd/pyang/syntax.py#L196-L207", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034733", "code": "def count_bytes(array):\n    '''Count the number of bits in a byte ``array``.\n\n    It uses the Hamming weight popcount algorithm\n    '''\n    # this algorithm can be rewritten as\n    # for i in array:\n    #     count += sum(b=='1' for b in bin(i)[2:])\n    # but this version is almost 2 times faster\n    count = 0\n    for i in array:\n        i = i - ((i >> 1) & 0x55555555)\n        i = (i & 0x33333333) + ((i >> 2) & 0x33333333)\n        count += (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24\n    return count", "entry_point": "count_bytes", "input": "[5, 3, 1, 4]", "output": "6", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantmind/pulsar/blob/fee44e871954aa6ca36d00bb5a3739abfdb89b26/pulsar/apps/ds/utils.py#L172-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034734", "code": "def to_string(s, encoding=None, errors='strict'):\n    \"\"\"Inverse of to_bytes\"\"\"\n    if isinstance(s, bytes):\n        return s.decode(encoding or 'utf-8', errors)\n    elif not isinstance(s, str):\n        return str(s)\n    else:\n        return s", "entry_point": "to_string", "input": "[[1, 2], [3], []], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "'[[1, 2], [3], []]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantmind/pulsar/blob/fee44e871954aa6ca36d00bb5a3739abfdb89b26/pulsar/utils/string.py#L21-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034735", "code": "def fib(n):\n    \"\"\"Fibonacci example function\n\n    Args:\n      n (int): integer\n\n    Returns:\n      int: n-th Fibonacci number\n    \"\"\"\n    assert n > 0\n    a, b = 1, 1\n    for i in range(n - 1):\n        a, b = b, a + b\n    return a", "entry_point": "fib", "input": "5", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/skeleton.py#L37-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034736", "code": "def file_to_list(in_file):\n    ''' Reads file into list '''\n    lines = []\n    for line in in_file:\n        # Strip new line\n        line = line.strip('\\n')\n\n        # Ignore empty lines\n        if line != '':\n            # Ignore comments\n            if line[0] != '#':\n                lines.append(line)\n\n    return lines", "entry_point": "file_to_list", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/scripts/hunspell_to_json.py#L39-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034737", "code": "def clean_data(data):\n    \"\"\" Shift to lower case, replace unknowns with UNK, and listify \"\"\"\n    new_data = []\n    VALID = 'abcdefghijklmnopqrstuvwxyz123456789\"\\'?!.,:; '\n    for sample in data:\n        new_sample = []\n        for char in sample[1].lower():  # Just grab the string, not the label\n            if char in VALID:\n                new_sample.append(char)\n            else:\n                new_sample.append('UNK')\n\n        new_data.append(new_sample)\n    return new_data", "entry_point": "clean_data", "input": "['apple', 'banana', 'cherry']", "output": "[['p'], ['a'], ['h']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/book/examples/ch09.py#L436-L449", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034738", "code": "def char_pad_trunc(data, maxlen):\n    \"\"\" We truncate to maxlen or add in PAD tokens \"\"\"\n    new_dataset = []\n    for sample in data:\n        if len(sample) > maxlen:\n            new_data = sample[:maxlen]\n        elif len(sample) < maxlen:\n            pads = maxlen - len(sample)\n            new_data = sample + ['PAD'] * pads\n        else:\n            new_data = sample\n        new_dataset.append(new_data)\n    return new_dataset", "entry_point": "char_pad_trunc", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/book/examples/ch09.py#L458-L470", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034739", "code": "def create_dicts(data):\n    \"\"\" Modified from Keras LSTM example\"\"\"\n    chars = set()\n    for sample in data:\n        chars.update(set(sample))\n    char_indices = dict((c, i) for i, c in enumerate(chars))\n    indices_char = dict((i, c) for i, c in enumerate(chars))\n    return char_indices, indices_char", "entry_point": "create_dicts", "input": "[[1, 2], [3], []]", "output": "({1: 0, 2: 1, 3: 2}, {0: 1, 1: 2, 2: 3})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/book/examples/ch09.py#L479-L486", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034740", "code": "def format_hex(i, num_bytes=4, prefix='0x'):\n    \"\"\" Format hexidecimal string from decimal integer value\n\n    >>> format_hex(42, num_bytes=8, prefix=None)\n    '0000002a'\n    >>> format_hex(23)\n    '0x0017'\n    \"\"\"\n    prefix = str(prefix or '')\n    i = int(i or 0)\n    return prefix + '{0:0{1}x}'.format(i, num_bytes)", "entry_point": "format_hex", "input": "[], 2, 'Hello World'", "output": "'Hello World00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/data_utils.py#L38-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034741", "code": "def ensure_str(s):\n    r\"\"\" Ensure that s is a str and not a bytes (.decode() if necessary)\n\n    >>> ensure_str(b\"I'm 2. When I grow up I want to be a str!\")\n    \"I'm 2. When I grow up I want to be a str!\"\n    >>> ensure_str(42)\n    '42'\n    \"\"\"\n    try:\n        return s.decode()\n    except AttributeError:\n        if isinstance(s, str):\n            return s\n    return repr(s)", "entry_point": "ensure_str", "input": "[1, 2, 3]", "output": "'[1, 2, 3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/totalgood/nlpia/blob/efa01126275e9cd3c3a5151a644f1c798a9ec53f/src/nlpia/futil.py#L57-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034742", "code": "def seconds_to_text(secs):\n    \"\"\" Converts seconds to a string of hours:minutes:seconds \"\"\"\n    hours = (secs)//3600\n    minutes = (secs - hours*3600)//60\n    seconds = secs - hours*3600 - minutes*60\n    return \"%02d:%02d:%02d\" % (hours, minutes, seconds)", "entry_point": "seconds_to_text", "input": "5", "output": "'00:00:05'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L173-L178", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034743", "code": "def remap_name(name_generator, names, table=None):\n    \"\"\"\n    Produces a series of variable assignments in the form of::\n\n        <obfuscated name> = <some identifier>\n\n    for each item in *names* using *name_generator* to come up with the\n    replacement names.\n\n    If *table* is provided, replacements will be looked up there before\n    generating a new unique name.\n    \"\"\"\n    out = \"\"\n    for name in names:\n        if table and name in table[0].keys():\n            replacement = table[0][name]\n        else:\n            replacement = next(name_generator)\n        out += \"%s=%s\\n\" % (replacement, name)\n    return out", "entry_point": "remap_name", "input": "'a,b,c', '', {'x': [1, 2], 'y': []}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/liftoff/pyminifier/blob/087ea7b0c8c964f1f907c3f350f5ce281798db86/pyminifier/obfuscate.py#L498-L517", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034744", "code": "def untokenize(tokens):\n    \"\"\"\n    Converts the output of tokenize.generate_tokens back into a human-readable\n    string (that doesn't contain oddly-placed whitespace everywhere).\n\n    .. note::\n\n        Unlike :meth:`tokenize.untokenize`, this function requires the 3rd and\n        4th items in each token tuple (though we can use lists *or* tuples).\n    \"\"\"\n    out = \"\"\n    last_lineno = -1\n    last_col = 0\n    for tok in tokens:\n        token_string = tok[1]\n        start_line, start_col = tok[2]\n        end_line, end_col = tok[3]\n        # The following two conditionals preserve indentation:\n        if start_line > last_lineno:\n            last_col = 0\n        if start_col > last_col and token_string != '\\n':\n            out += (\" \" * (start_col - last_col))\n        out += token_string\n        last_col = end_col\n        last_lineno = end_line\n    return out", "entry_point": "untokenize", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/liftoff/pyminifier/blob/087ea7b0c8c964f1f907c3f350f5ce281798db86/pyminifier/token_utils.py#L14-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034745", "code": "def check_dht_value_type(value):\n    \"\"\"\n    Checks to see if the type of the value is a valid type for\n    placing in the dht.\n    \"\"\"\n    typeset = [\n        int,\n        float,\n        bool,\n        str,\n        bytes\n    ]\n    return type(value) in typeset", "entry_point": "check_dht_value_type", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bmuller/kademlia/blob/4a8d445c9ee8f3ca10f56107e4445daed4933c8a/kademlia/network.py#L245-L257", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034746", "code": "def format_labels(labels):\n    \"\"\" Convert a dictionary of labels into a comma separated string \"\"\"\n    if labels:\n        return ','.join(['{}={}'.format(k, v) for k, v in labels.items()])\n    else:\n        return ''", "entry_point": "format_labels", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dask/dask-kubernetes/blob/8a4883ecd902460b446bb1f43ed97efe398a135e/dask_kubernetes/core.py#L514-L519", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034747", "code": "def full_pixels(space, data, gap_pixels=1):\n    \"\"\"returns the given data distributed in the space ensuring it's full pixels\n    and with the given gap.\n    this will result in minor sub-pixel inaccuracies.\n    XXX - figure out where to place these guys as they are quite useful\n    \"\"\"\n    available = space - (len(data) - 1) * gap_pixels # 8 recs 7 gaps\n\n    res = []\n    for i, val in enumerate(data):\n        # convert data to 0..1 scale so we deal with fractions\n        data_sum = sum(data[i:])\n        norm = val * 1.0 / data_sum\n\n\n        w = max(int(round(available * norm)), 1)\n        res.append(w)\n        available -= w\n    return res", "entry_point": "full_pixels", "input": "True, [-1, 0, 1, 2], False", "output": "[1, 1, 1, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/projecthamster/hamster/blob/ca5254eff53172796ddafc72226c394ed1858245/src/hamster/lib/graphics.py#L187-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034748", "code": "def safe_float(string, default=None):\n    \"\"\"\n    Safely parse a string into a float.\n\n    On error return the ``default`` value.\n\n    :param string string: string value to be converted\n    :param float default: default value to be used in case of failure\n    :rtype: float\n    \"\"\"\n    value = default\n    try:\n        value = float(string)\n    except TypeError:\n        pass\n    except ValueError:\n        pass\n    return value", "entry_point": "safe_float", "input": "'a,b,c', ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/readbeyond/aeneas/blob/9d95535ad63eef4a98530cfdff033b8c35315ee1/aeneas/globalfunctions.py#L272-L289", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034749", "code": "def human_readable_number(number, suffix=\"\"):\n    \"\"\"\n    Format the given number into a human-readable string.\n\n    Code adapted from http://stackoverflow.com/a/1094933\n\n    :param variant number: the number (int or float)\n    :param string suffix: the unit of the number\n    :rtype: string\n    \"\"\"\n    for unit in [\"\", \"K\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\"]:\n        if abs(number) < 1024.0:\n            return \"%3.1f%s%s\" % (number, unit, suffix)\n        number /= 1024.0\n    return \"%.1f%s%s\" % (number, \"Y\", suffix)", "entry_point": "human_readable_number", "input": "0, 'walnut thistle harbour'", "output": "'0.0walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/readbeyond/aeneas/blob/9d95535ad63eef4a98530cfdff033b8c35315ee1/aeneas/globalfunctions.py#L1119-L1133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034750", "code": "def cut_value(graph, flow, cut):\n    \"\"\"\n    Calculate the value of a cut.\n\n    @type graph: digraph\n    @param graph: Graph\n\n    @type flow: dictionary\n    @param flow: Dictionary containing a flow for each edge.\n\n    @type cut: dictionary\n    @param cut: Dictionary mapping each node to a subset index. The function only considers the flow between\n    nodes with 0 and 1.\n    \n    @rtype: float\n    @return: The value of the flow between the subsets 0 and 1\n    \"\"\"\n    #max flow/min cut value calculation\n    S = []\n    T = []\n    for node in cut.keys():\n        if cut[node] == 0:\n            S.append(node)\n        elif cut[node] == 1:\n            T.append(node)\n    value = 0\n    for node in S:\n        for neigh in graph.neighbors(node):\n            if neigh in T:\n                value = value + flow[(node,neigh)]\n        for inc in graph.incidents(node):\n            if inc in T:\n                value = value - flow[(inc,node)]    \n    return value", "entry_point": "cut_value", "input": "(1, 2), (1, 2), {'a': 1, 'b': 2}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/minmax.py#L412-L445", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034751", "code": "def get_errno(exc):\n    \"\"\":exc:`socket.error` and :exc:`IOError` first got\n    the ``.errno`` attribute in Py2.7\"\"\"\n    try:\n        return exc.errno\n    except AttributeError:\n        try:\n            # e.args = (errno, reason)\n            if isinstance(exc.args, tuple) and len(exc.args) == 2:\n                return exc.args[0]\n        except AttributeError:\n            pass\n    return 0", "entry_point": "get_errno", "input": "['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/utils.py#L90-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034752", "code": "def _intersection(A,B):\n    \"\"\"\n    A simple function to find an intersection between two arrays. \n    \n    @type A: List \n    @param A: First List\n    \n    @type B: List\n    @param B: Second List\n    \n    @rtype: List\n    @return: List of Intersections\n    \"\"\"\n    intersection = []\n    for i in A:\n        if i in B:\n            intersection.append(i)\n    return intersection", "entry_point": "_intersection", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/critical.py#L38-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034753", "code": "def columnise(rows, padding=2):\n    \"\"\"Print rows of entries in aligned columns.\"\"\"\n    strs = []\n    maxwidths = {}\n\n    for row in rows:\n        for i, e in enumerate(row):\n            se = str(e)\n            nse = len(se)\n            w = maxwidths.get(i, -1)\n            if nse > w:\n                maxwidths[i] = nse\n\n    for row in rows:\n        s = ''\n        for i, e in enumerate(row):\n            se = str(e)\n            if i < len(row) - 1:\n                n = maxwidths[i] + padding - len(se)\n                se += ' ' * n\n            s += se\n        strs.append(s)\n    return strs", "entry_point": "columnise", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L282-L304", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034754", "code": "def _check_str_value(x):\n    \"\"\"If string has a space, wrap it in double quotes and remove/escape illegal characters\"\"\"\n    if isinstance(x, str):\n        # remove commas, and single quotation marks since loadarff cannot deal with it\n        x = x.replace(\",\", \".\").replace(chr(0x2018), \"'\").replace(chr(0x2019), \"'\")\n\n        # put string in double quotes\n        if \" \" in x:\n            if x[0] in ('\"', \"'\"):\n                x = x[1:]\n            if x[-1] in ('\"', \"'\"):\n                x = x[:len(x) - 1]\n            x = '\"' + x.replace('\"', \"\\\\\\\"\") + '\"'\n    return str(x)", "entry_point": "_check_str_value", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sebp/scikit-survival/blob/cfc99fd20454cdd6f4f20fe331b39f2191ccaabc/sksurv/io/arffwrite.py#L96-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034755", "code": "def _list_superclasses(class_def):\n    \"\"\"Return a list of the superclasses of the given class\"\"\"\n    superclasses = class_def.get('superClasses', [])\n    if superclasses:\n        # Make sure to duplicate the list\n        return list(superclasses)\n\n    sup = class_def.get('superClass', None)\n    if sup:\n        return [sup]\n    else:\n        return []", "entry_point": "_list_superclasses", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kensho-technologies/graphql-compiler/blob/f6079c6d10f64932f6b3af309b79bcea2123ca8f/graphql_compiler/schema_generation/utils.py#L66-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034756", "code": "def get_superclasses_from_class_definition(class_definition):\n    \"\"\"Extract a list of all superclass names from a class definition dict.\"\"\"\n    # New-style superclasses definition, supporting multiple-inheritance.\n    superclasses = class_definition.get('superClasses', None)\n\n    if superclasses:\n        return list(superclasses)\n\n    # Old-style superclass definition, single inheritance only.\n    superclass = class_definition.get('superClass', None)\n    if superclass:\n        return [superclass]\n\n    # No superclasses are present.\n    return []", "entry_point": "get_superclasses_from_class_definition", "input": "{'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kensho-technologies/graphql-compiler/blob/f6079c6d10f64932f6b3af309b79bcea2123ca8f/graphql_compiler/schema_generation/schema_graph.py#L74-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034757", "code": "def emit_code_from_ir(ir_blocks, compiler_metadata):\n    \"\"\"Return a MATCH query string from a list of IR blocks.\"\"\"\n    gremlin_steps = (\n        block.to_gremlin()\n        for block in ir_blocks\n    )\n\n    # OutputSource blocks translate to empty steps.\n    # Discard such empty steps so we don't end up with an incorrect concatenation.\n    non_empty_steps = (\n        step\n        for step in gremlin_steps\n        if step\n    )\n\n    return u'.'.join(non_empty_steps)", "entry_point": "emit_code_from_ir", "input": "[], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kensho-technologies/graphql-compiler/blob/f6079c6d10f64932f6b3af309b79bcea2123ca8f/graphql_compiler/compiler/emit_gremlin.py#L9-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034758", "code": "def _make_scales(notes):\n    \"\"\" Utility function used by Sound class for building the note frequencies table \"\"\"\n    res = dict()\n    for note, freq in notes:\n        freq = round(freq)\n        for n in note.split('/'):\n            res[n] = freq\n    return res", "entry_point": "_make_scales", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ev3dev/ev3dev-lang-python/blob/afc98d35004b533dc161a01f7c966e78607d7c1e/ev3dev2/sound.py#L37-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034759", "code": "def should_use_custom_repo(args, cd_conf, repo_url):\n    \"\"\"\n    A boolean to determine the logic needed to proceed with a custom repo\n    installation instead of cramming everything nect to the logic operator.\n    \"\"\"\n    if repo_url:\n        # repo_url signals a CLI override, return False immediately\n        return False\n    if cd_conf:\n        if cd_conf.has_repos:\n            has_valid_release = args.release in cd_conf.get_repos()\n            has_default_repo = cd_conf.get_default_repo()\n            if has_valid_release or has_default_repo:\n                return True\n    return False", "entry_point": "should_use_custom_repo", "input": "[1, 2, 3], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ceph/ceph-deploy/blob/86943fcc454cd4c99a86e3493e9e93a59c661fef/ceph_deploy/install.py#L215-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034760", "code": "def map_components(notsplit_packages, components):\n    \"\"\"\n    Returns a list of packages to install based on component names\n\n    This is done by checking if a component is in notsplit_packages,\n    if it is, we know we need to install 'ceph' instead of the\n    raw component name.  Essentially, this component hasn't been\n    'split' from the master 'ceph' package yet.\n    \"\"\"\n    packages = set()\n\n    for c in components:\n        if c in notsplit_packages:\n            packages.add('ceph')\n        else:\n            packages.add(c)\n\n    return list(packages)", "entry_point": "map_components", "input": "['a', 'b', 'c'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ceph/ceph-deploy/blob/86943fcc454cd4c99a86e3493e9e93a59c661fef/ceph_deploy/hosts/common.py#L165-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034761", "code": "def colorbrewer(values, alpha=255):\n    \"\"\"\n    Return a dict of colors for the unique values.\n    Colors are adapted from Harrower, Mark, and Cynthia A. Brewer.\n    \"ColorBrewer. org: an online tool for selecting colour schemes for maps.\"\n    The Cartographic Journal 40.1 (2003): 27-37.\n\n    :param values: values\n    :param alpha: color alphs\n    :return: dict of colors for the unique values.\n    \"\"\"\n    basecolors = [\n        [31, 120, 180],\n        [178, 223, 138],\n        [51, 160, 44],\n        [251, 154, 153],\n        [227, 26, 28],\n        [253, 191, 111],\n        [255, 127, 0],\n        [202, 178, 214],\n        [106, 61, 154],\n        [255, 255, 153],\n        [177, 89, 40]\n    ]\n    unique_values = list(set(values))\n    return {k: basecolors[i % len(basecolors)] + [alpha]  for i, k in enumerate(unique_values)}", "entry_point": "colorbrewer", "input": "[1, 2, 3], -1.5", "output": "{1: [31, 120, 180, -1.5], 2: [178, 223, 138, -1.5], 3: [51, 160, 44, -1.5]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/andrea-cuttone/geoplotlib/blob/a1c355bccec91cabd157569fad6daf53cf7687a1/geoplotlib/colors.py#L111-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034762", "code": "def pos_to_linecol(text, pos):\n    \"\"\"Return a tuple of line and column for offset pos in text.\n\n    Lines are one-based, columns zero-based.\n\n    This is how Jedi wants it. Don't ask me why.\n\n    \"\"\"\n    line_start = text.rfind(\"\\n\", 0, pos) + 1\n    line = text.count(\"\\n\", 0, line_start) + 1\n    col = pos - line_start\n    return line, col", "entry_point": "pos_to_linecol", "input": "'a,b,c', False", "output": "(1, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jorgenschaefer/elpy/blob/ffd982f829b11e53f2be187c7b770423341f29bc/elpy/jedibackend.py#L272-L283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034763", "code": "def combine(path1, path2):\n    # type: (Text, Text) -> Text\n    \"\"\"Join two paths together.\n\n    This is faster than :func:`~fs.path.join`, but only works when the\n    second path is relative, and there are no back references in either\n    path.\n\n    Arguments:\n        path1 (str): A PyFilesytem path.\n        path2 (str): A PyFilesytem path.\n\n    Returns:\n        str: The joint path.\n\n    Example:\n        >>> combine(\"foo/bar\", \"baz\")\n        'foo/bar/baz'\n\n    \"\"\"\n    if not path1:\n        return path2.lstrip()\n    return \"{}/{}\".format(path1.rstrip(\"/\"), path2.lstrip(\"/\"))", "entry_point": "combine", "input": "'walnut thistle harbour', '  padded  '", "output": "'walnut thistle harbour/  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PyFilesystem/pyfilesystem2/blob/047f3593f297d1442194cda3da7a7335bcc9c14a/fs/path.py#L242-L264", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034764", "code": "def isparent(path1, path2):\n    # type: (Text, Text) -> bool\n    \"\"\"Check if ``path1`` is a parent directory of ``path2``.\n\n    Arguments:\n        path1 (str): A PyFilesytem path.\n        path2 (str): A PyFilesytem path.\n\n    Returns:\n        bool: `True` if ``path1`` is a parent directory of ``path2``\n\n    Example:\n        >>> isparent(\"foo/bar\", \"foo/bar/spam.txt\")\n        True\n        >>> isparent(\"foo/bar/\", \"foo/bar\")\n        True\n        >>> isparent(\"foo/barry\", \"foo/baz/bar\")\n        False\n        >>> isparent(\"foo/bar/baz/\", \"foo/baz/bar\")\n        False\n\n    \"\"\"\n    bits1 = path1.split(\"/\")\n    bits2 = path2.split(\"/\")\n    while bits1 and bits1[-1] == \"\":\n        bits1.pop()\n    if len(bits1) > len(bits2):\n        return False\n    for (bit1, bit2) in zip(bits1, bits2):\n        if bit1 != bit2:\n            return False\n    return True", "entry_point": "isparent", "input": "'Hello World', 'Hello World'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PyFilesystem/pyfilesystem2/blob/047f3593f297d1442194cda3da7a7335bcc9c14a/fs/path.py#L462-L493", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034765", "code": "def shift(txt, indent = '    ', prepend = ''):\n    \"\"\"Return a list corresponding to the lines of text in the `txt` list\n    indented by `indent`. Prepend instead the string given in `prepend` to the\n    beginning of the first line. Note that if len(prepend) > len(indent), then\n    `prepend` will be truncated (doing better is tricky!). This preserves a \n    special '' entry at the end of `txt` (see `do_para` for the meaning).\n    \"\"\"\n    if type(indent) is int:\n        indent = indent * ' '\n    special_end = txt[-1:] == ['']\n    lines = ''.join(txt).splitlines(True)\n    for i in range(1,len(lines)):\n        if lines[i].strip() or indent.strip():\n            lines[i] = indent + lines[i]\n    if not lines:\n        return prepend\n    prepend = prepend[:len(indent)]\n    indent = indent[len(prepend):]\n    lines[0] = prepend + indent + lines[0]\n    ret = [''.join(lines)]\n    if special_end:\n        ret.append('')\n    return ret", "entry_point": "shift", "input": "(), False, 3.25", "output": "3.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/basler/pypylon/blob/d3510fa419b1c2b17f3f0b80a5fbb720c7b84008/scripts/builddoxy2swig/doxy2swig/doxy2swig.py#L75-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034766", "code": "def make_inv_cts(cts):\n    \"\"\"\n    cts is e.g. {\"Germany\" : \"DEU\"}. inv_cts is the inverse: {\"DEU\" : \"Germany\"}\n    \"\"\"\n    inv_ct = {}\n    for old_k, old_v in cts.items():\n        if old_v not in inv_ct.keys():\n            inv_ct.update({old_v : old_k})\n    return inv_ct", "entry_point": "make_inv_cts", "input": "{'a': 1, 'b': 2}", "output": "{1: 'a', 2: 'b'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openeventdata/mordecai/blob/bd82b8bcc27621345c57cbe9ec7f8c8552620ffc/mordecai/utilities.py#L184-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034767", "code": "def structure_results(res):\n    \"\"\"Format Elasticsearch result as Python dictionary\"\"\"\n    out = {'hits': {'hits': []}}\n    keys = [u'admin1_code', u'admin2_code', u'admin3_code', u'admin4_code',\n            u'alternativenames', u'asciiname', u'cc2', u'coordinates',\n            u'country_code2', u'country_code3', u'dem', u'elevation',\n            u'feature_class', u'feature_code', u'geonameid',\n            u'modification_date', u'name', u'population', u'timezone']\n    for i in res:\n        i_out = {}\n        for k in keys:\n            i_out[k] = i[k]\n        out['hits']['hits'].append(i_out)\n    return out", "entry_point": "structure_results", "input": "set()", "output": "{'hits': {'hits': []}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openeventdata/mordecai/blob/bd82b8bcc27621345c57cbe9ec7f8c8552620ffc/mordecai/utilities.py#L218-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034768", "code": "def escape(str):\n    \"\"\"Precede all special characters with a backslash.\"\"\"\n    out = ''\n    for char in str:\n        if char in '\\\\ ':\n            out += '\\\\'\n        out += char\n    return out", "entry_point": "escape", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L354-L361", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034769", "code": "def unescape(str):\n    \"\"\"Undoes the effects of the escape() function.\"\"\"\n    out = ''\n    prev_backslash = False\n    for char in str:\n        if not prev_backslash and char == '\\\\':\n            prev_backslash = True\n            continue\n        out += char\n        prev_backslash = False\n    return out", "entry_point": "unescape", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L364-L374", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034770", "code": "def align_cell(fmt, elem, width):\n    \"\"\"Returns an aligned element.\"\"\"\n    if fmt == \"<\":\n        return elem + ' ' * (width - len(elem))\n    if fmt == \">\":\n        return ' ' * (width - len(elem)) + elem\n    return elem", "entry_point": "align_cell", "input": "['apple', 'banana', 'cherry'], [], 1", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L377-L383", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034771", "code": "def generateName(nodeName: str, instId: int):\n        \"\"\"\n        Create and return the name for a replica using its nodeName and\n        instanceId.\n         Ex: Alpha:1\n        \"\"\"\n\n        if isinstance(nodeName, str):\n            # Because sometimes it is bytes (why?)\n            if \":\" in nodeName:\n                # Because in some cases (for requested messages) it\n                # already has ':'. This should be fixed.\n                return nodeName\n        return \"{}:{}\".format(nodeName, instId)", "entry_point": "generateName", "input": "'abc', [-1, 0, 1, 2]", "output": "'abc:[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hyperledger/indy-plenum/blob/dcd144e238af7f17a869ffc9412f13dc488b7020/plenum/server/replica.py#L555-L568", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034772", "code": "def hex2bin(hexstr):\n    \"\"\"Convert a hexdecimal string to binary string, with zero fillings. \"\"\"\n    num_of_bits = len(hexstr) * 4\n    binstr = bin(int(hexstr, 16))[2:].zfill(int(num_of_bits))\n    return binstr", "entry_point": "hex2bin", "input": "'abc'", "output": "'101010111100'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/junzis/pyModeS/blob/8cd5655a04b08171a9ad5f1ffd232b7e0178ea53/pyModeS/decoder/common.py#L4-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034773", "code": "def invert_map(mapping: dict, one_to_one: bool = True) -> dict:\n    \"\"\"Invert a dictionary. If not one_to_one then the inverted\n    map will contain lists of former keys as values.\n    \"\"\"\n    if one_to_one:\n        inv_map = {value: key for key, value in mapping.items()}\n    else:\n        inv_map = {}\n        for key, value in mapping.items():\n            inv_map.setdefault(value, set()).add(key)\n\n    return inv_map", "entry_point": "invert_map", "input": "{'a': 1, 'b': 2}, [[1, 2], [3], []]", "output": "{1: 'a', 2: 'b'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/quantumflow/blob/13a66cabbe8aabf6e023cc675f4a4ebe6ccda8fb/quantumflow/utils.py#L38-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034774", "code": "def total_msgs(xml):\n    '''count total number of msgs'''\n    count = 0\n    for x in xml:\n        count += len(x.message)\n    return count", "entry_point": "total_msgs", "input": "set()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py#L473-L478", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034775", "code": "def camel_case_from_underscores(string):\n    \"\"\"generate a CamelCase string from an underscore_string.\"\"\"\n    components = string.split('_')\n    string = ''\n    for component in components:\n        string += component[0].upper() + component[1:]\n    return string", "entry_point": "camel_case_from_underscores", "input": "'walnut thistle harbour'", "output": "'Walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavgen_objc.py#L311-L317", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034776", "code": "def lower_camel_case_from_underscores(string):\n    \"\"\"generate a lower-cased camelCase string from an underscore_string.\n    For example: my_variable_name -> myVariableName\"\"\"\n    components = string.split('_')\n    string = components[0]\n    for component in components[1:]:\n        string += component[0].upper() + component[1:]\n    return string", "entry_point": "lower_camel_case_from_underscores", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavgen_objc.py#L319-L326", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034777", "code": "def degrees_to_dms(degrees):\n    '''return a degrees:minutes:seconds string'''\n    deg = int(degrees)\n    min = int((degrees - deg)*60)\n    sec = ((degrees - deg) - (min/60.0))*60*60\n    return u'%d\\u00b0%02u\\'%05.2f\"' % (deg, abs(min), abs(sec))", "entry_point": "degrees_to_dms", "input": "-1.5", "output": "'-1\u00b030\\'00.00\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_util.py#L163-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034778", "code": "def timestr(msec):\n    \"\"\"\n    Convert a millisecond value to a string of the following\n    format:\n\n        HH:MM:SS,SS\n\n    with 10 millisecond precision. Note the , seperator in\n    the seconds.\n    \"\"\"\n    sec = float(msec) / 1000\n\n    hours = int(sec / 3600)\n    sec -= hours * 3600\n\n    minutes = int(sec / 60)\n    sec -= minutes * 60\n\n    output = \"%02d:%02d:%06.3f\" % (hours, minutes, sec)\n    return output.replace(\".\", \",\")", "entry_point": "timestr", "input": "0", "output": "'00:00:00,000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spaam/svtplay-dl/blob/d33186e54e436ebb1537e5baf67758e3bd3bf076/lib/svtplay_dl/subtitle/__init__.py#L322-L341", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034779", "code": "def get_bits_from_int(val_int, val_size=16):\n    \"\"\"Get the list of bits of val_int integer (default size is 16 bits)\n\n        Return bits list, least significant bit first. Use list.reverse() if\n        need.\n\n        :param val_int: integer value\n        :type val_int: int\n        :param val_size: bit size of integer (word = 16, long = 32) (optional)\n        :type val_size: int\n        :returns: list of boolean \"bits\" (least significant first)\n        :rtype: list\n    \"\"\"\n    # allocate a bit_nb size list\n    bits = [None] * val_size\n    # fill bits list with bit items\n    for i, item in enumerate(bits):\n        bits[i] = bool((val_int >> i) & 0x01)\n    # return bits list\n    return bits", "entry_point": "get_bits_from_int", "input": "[-1, 0, 1, 2], 0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sourceperl/pyModbusTCP/blob/993f6e2f5ab52eba164be049e42cea560c3751a5/pyModbusTCP/utils.py#L11-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034780", "code": "def word_list_to_long(val_list, big_endian=True):\n    \"\"\"Word list (16 bits int) to long list (32 bits int)\n\n        By default word_list_to_long() use big endian order. For use little endian, set\n        big_endian param to False.\n\n        :param val_list: list of 16 bits int value\n        :type val_list: list\n        :param big_endian: True for big endian/False for little (optional)\n        :type big_endian: bool\n        :returns: list of 32 bits int value\n        :rtype: list\n    \"\"\"\n    # allocate list for long int\n    long_list = [None] * int(len(val_list) / 2)\n    # fill registers list with register items\n    for i, item in enumerate(long_list):\n        if big_endian:\n            long_list[i] = (val_list[i * 2] << 16) + val_list[(i * 2) + 1]\n        else:\n            long_list[i] = (val_list[(i * 2) + 1] << 16) + val_list[i * 2]\n    # return long list\n    return long_list", "entry_point": "word_list_to_long", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "[65538]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sourceperl/pyModbusTCP/blob/993f6e2f5ab52eba164be049e42cea560c3751a5/pyModbusTCP/utils.py#L65-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034781", "code": "def long_list_to_word(val_list, big_endian=True):\n    \"\"\"Long list (32 bits int) to word list (16 bits int)\n\n        By default long_list_to_word() use big endian order. For use little endian, set\n        big_endian param to False.\n\n        :param val_list: list of 32 bits int value\n        :type val_list: list\n        :param big_endian: True for big endian/False for little (optional)\n        :type big_endian: bool\n        :returns: list of 16 bits int value\n        :rtype: list\n    \"\"\"\n    # allocate list for long int\n    word_list = list()\n    # fill registers list with register items\n    for i, item in enumerate(val_list):\n        if big_endian:\n            word_list.append(val_list[i] >> 16)\n            word_list.append(val_list[i] & 0xffff)\n        else:\n            word_list.append(val_list[i] & 0xffff)\n            word_list.append(val_list[i] >> 16)\n    # return long list\n    return word_list", "entry_point": "long_list_to_word", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sourceperl/pyModbusTCP/blob/993f6e2f5ab52eba164be049e42cea560c3751a5/pyModbusTCP/utils.py#L90-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034782", "code": "def _get_error_message(response):\n    \"\"\"Attempt to extract an error message from response body\"\"\"\n    try:\n        data = response.json()\n        if \"error_description\" in data:\n            return data['error_description']\n        if \"error\" in data:\n            return data['error']\n    except Exception:\n        pass\n\n    return \"Unknown error\"", "entry_point": "_get_error_message", "input": "[1, 2, 3]", "output": "'Unknown error'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ihabunek/toot/blob/d13fa8685b300f96621fa325774913ec0f413a7f/toot/http.py#L19-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034783", "code": "def RACC_calc(TOP, P, POP):\n    \"\"\"\n    Calculate random accuracy.\n\n    :param TOP: test outcome positive\n    :type TOP : int\n    :param P:  condition positive\n    :type P : int\n    :param POP: population\n    :type POP:int\n    :return: RACC as float\n    \"\"\"\n    try:\n        result = (TOP * P) / ((POP) ** 2)\n        return result\n    except Exception:\n        return \"None\"", "entry_point": "RACC_calc", "input": "[1, 2, 3], [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_class_func.py#L173-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034784", "code": "def RACCU_calc(TOP, P, POP):\n    \"\"\"\n    Calculate RACCU (Random accuracy unbiased).\n\n    :param TOP: test outcome positive\n    :type TOP : int\n    :param P: condition positive\n    :type P : int\n    :param POP: population\n    :type POP : int\n    :return: RACCU as float\n    \"\"\"\n    try:\n        result = ((TOP + P) / (2 * POP))**2\n        return result\n    except Exception:\n        return \"None\"", "entry_point": "RACCU_calc", "input": "[5, 3, 1, 4], [1, 2, 3], [-1, 0, 1, 2]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_class_func.py#L192-L208", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034785", "code": "def OP_calc(ACC, TPR, TNR):\n    \"\"\"\n    Calculate OP (Optimized precision).\n\n    :param ACC: accuracy\n    :type ACC : float\n    :param TNR: specificity or true negative rate\n    :type TNR : float\n    :param TPR: sensitivity, recall, hit rate, or true positive rate\n    :type TPR : float\n    :return: OP as float\n    \"\"\"\n    try:\n        RI = abs(TNR - TPR) / (TPR + TNR)\n        return ACC - RI\n    except Exception:\n        return \"None\"", "entry_point": "OP_calc", "input": "[5, 3, 1, 4], [], ['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_class_func.py#L451-L467", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034786", "code": "def IBA_calc(TPR, TNR, alpha=1):\n    \"\"\"\n    Calculate IBA (Index of balanced accuracy).\n\n    :param TNR: specificity or true negative rate\n    :type TNR : float\n    :param TPR: sensitivity, recall, hit rate, or true positive rate\n    :type TPR : float\n    :param alpha : alpha coefficient\n    :type alpha : float\n    :return: IBA as float\n    \"\"\"\n    try:\n        IBA = (1 + alpha * (TPR - TNR)) * TPR * TNR\n        return IBA\n    except Exception:\n        return \"None\"", "entry_point": "IBA_calc", "input": "[-1, 0, 1, 2], [1, 2, 3], 3.25", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_class_func.py#L470-L486", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034787", "code": "def BCD_calc(TOP, P, AM):\n    \"\"\"\n    Calculate BCD (Bray-Curtis dissimilarity).\n\n    :param TOP: test outcome positive\n    :type TOP : dict\n    :param P: condition positive\n    :type P : dict\n    :param AM: Automatic/Manual\n    :type AM : int\n    :return: BCD as float\n    \"\"\"\n    try:\n        TOP_sum = sum(TOP.values())\n        P_sum = sum(P.values())\n        return abs(AM) / (P_sum + TOP_sum)\n    except Exception:\n        return \"None\"", "entry_point": "BCD_calc", "input": "[5, 3, 1, 4], ['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_class_func.py#L489-L506", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034788", "code": "def html_init(name):\n    \"\"\"\n    Return HTML report file first lines.\n\n    :param name: name of file\n    :type name : str\n    :return: html_init as str\n    \"\"\"\n    result = \"\"\n    result += \"<html>\\n\"\n    result += \"<head>\\n\"\n    result += \"<title>\" + str(name) + \"</title>\\n\"\n    result += \"</head>\\n\"\n    result += \"<body>\\n\"\n    result += '<h1 style=\"border-bottom:1px solid ' \\\n              'black;text-align:center;\">PyCM Report</h1>'\n    return result", "entry_point": "html_init", "input": "'  padded  '", "output": "'<html>\\n<head>\\n<title>  padded  </title>\\n</head>\\n<body>\\n<h1 style=\"border-bottom:1px solid black;text-align:center;\">PyCM Report</h1>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_output.py#L10-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034789", "code": "def csv_matrix_print(classes, table):\n    \"\"\"\n    Return matrix as csv data.\n\n    :param classes: classes list\n    :type classes:list\n    :param table: table\n    :type table:dict\n    :return:\n    \"\"\"\n    result = \"\"\n    classes.sort()\n    for i in classes:\n        for j in classes:\n            result += str(table[i][j]) + \",\"\n        result = result[:-1] + \"\\n\"\n    return result[:-1]", "entry_point": "csv_matrix_print", "input": "[], {}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_output.py#L316-L332", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034790", "code": "def class_filter(classes, class_name):\n    \"\"\"\n    Filter classes by comparing two lists.\n\n    :param classes: matrix classes\n    :type classes: list\n    :param class_name: sub set of classes\n    :type class_name : list\n    :return: filtered classes as list\n    \"\"\"\n    result_classes = classes\n    if isinstance(class_name, list):\n        if set(class_name) <= set(classes):\n            result_classes = class_name\n    return result_classes", "entry_point": "class_filter", "input": "[5, 3, 1, 4], ''", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_util.py#L59-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034791", "code": "def vector_check(vector):\n    \"\"\"\n    Check input vector items type.\n\n    :param vector: input vector\n    :type vector : list\n    :return: bool\n    \"\"\"\n    for i in vector:\n        if isinstance(i, int) is False:\n            return False\n        if i < 0:\n            return False\n    return True", "entry_point": "vector_check", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_util.py#L76-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034792", "code": "def vector_filter(actual_vector, predict_vector):\n    \"\"\"\n    Convert different type of items in vectors to str.\n\n    :param actual_vector: actual values\n    :type actual_vector : list\n    :param predict_vector: predict value\n    :type predict_vector : list\n    :return: new actual and predict vector\n    \"\"\"\n    temp = []\n    temp.extend(actual_vector)\n    temp.extend(predict_vector)\n    types = set(map(type, temp))\n    if len(types) > 1:\n        return [list(map(str, actual_vector)), list(map(str, predict_vector))]\n    return [actual_vector, predict_vector]", "entry_point": "vector_filter", "input": "['apple', 'banana', 'cherry'], {}", "output": "[['apple', 'banana', 'cherry'], {}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_util.py#L112-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034793", "code": "def class_check(vector):\n    \"\"\"\n    Check different items in matrix classes.\n\n    :param vector: input vector\n    :type vector : list\n    :return: bool\n    \"\"\"\n    for i in vector:\n        if not isinstance(i, type(vector[0])):\n            return False\n    return True", "entry_point": "class_check", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_util.py#L131-L142", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034794", "code": "def transpose_func(classes, table):\n    \"\"\"\n    Transpose table.\n\n    :param classes: classes\n    :type classes : list\n    :param table: input matrix\n    :type table : dict\n    :return: transposed table as dict\n    \"\"\"\n    transposed_table = table\n    for i, item1 in enumerate(classes):\n        for j, item2 in enumerate(classes):\n            if i > j:\n                temp = transposed_table[item1][item2]\n                transposed_table[item1][item2] = transposed_table[item2][item1]\n                transposed_table[item2][item1] = temp\n    return transposed_table", "entry_point": "transpose_func", "input": "{}, False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_util.py#L210-L227", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034795", "code": "def binary_check(classes):\n    \"\"\"\n    Check if the problem is a binary classification.\n\n    :param classes:  all classes name\n    :type classes : list\n    :return: is_binary as bool\n    \"\"\"\n    num_classes = len(classes)\n    is_binary = False\n    if num_classes == 2:\n        is_binary = True\n    return is_binary", "entry_point": "binary_check", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_util.py#L314-L326", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034796", "code": "def RR_calc(classes, TOP):\n    \"\"\"\n    Calculate RR (Global performance index).\n\n    :param classes: classes\n    :type classes : list\n    :param TOP: test outcome positive\n    :type TOP : dict\n    :return: RR as float\n    \"\"\"\n    try:\n        class_number = len(classes)\n        result = sum(list(TOP.values()))\n        return result / class_number\n    except Exception:\n        return \"None\"", "entry_point": "RR_calc", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L90-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034797", "code": "def NIR_calc(P, POP):\n    \"\"\"\n    Calculate NIR (No information rate).\n\n    :param P: condition positive\n    :type P : dict\n    :param POP: population\n    :type POP : int\n    :return: NIR as float\n    \"\"\"\n    try:\n        max_P = max(list(P.values()))\n        length = POP\n        return max_P / length\n    except Exception:\n        return \"None\"", "entry_point": "NIR_calc", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L239-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034798", "code": "def hamming_calc(TP, POP):\n    \"\"\"\n    Calculate hamming loss.\n\n    :param TP: true positive\n    :type TP : dict\n    :param POP: population\n    :type POP : int\n    :return: hamming loss as float\n    \"\"\"\n    try:\n        length = POP\n        return (1 / length) * (length - sum(TP.values()))\n    except Exception:\n        return \"None\"", "entry_point": "hamming_calc", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L257-L271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034799", "code": "def zero_one_loss_calc(TP, POP):\n    \"\"\"\n    Calculate zero-one loss.\n\n    :param TP: true Positive\n    :type TP : dict\n    :param POP: population\n    :type POP : int\n    :return: zero_one loss as integer\n    \"\"\"\n    try:\n        length = POP\n        return (length - sum(TP.values()))\n    except Exception:\n        return \"None\"", "entry_point": "zero_one_loss_calc", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L274-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034800", "code": "def CI_calc(mean, SE, CV=1.96):\n    \"\"\"\n    Calculate confidence interval.\n\n    :param mean: mean of data\n    :type mean : float\n    :param SE: standard error of data\n    :type SE : float\n    :param CV: critical value\n    :type CV:float\n    :return: confidence interval as tuple\n    \"\"\"\n    try:\n        CI_down = mean - CV * SE\n        CI_up = mean + CV * SE\n        return (CI_down, CI_up)\n    except Exception:\n        return (\"None\", \"None\")", "entry_point": "CI_calc", "input": "['a', 'b', 'c'], [-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "('None', 'None')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L610-L627", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034801", "code": "def micro_calc(TP, item):\n    \"\"\"\n    Calculate PPV_Micro and TPR_Micro.\n\n    :param TP: true positive\n    :type TP:dict\n    :param item: FN or FP\n    :type item : dict\n    :return: PPV_Micro or TPR_Micro as float\n    \"\"\"\n    try:\n        TP_sum = sum(TP.values())\n        item_sum = sum(item.values())\n        return TP_sum / (TP_sum + item_sum)\n    except Exception:\n        return \"None\"", "entry_point": "micro_calc", "input": "[], [-1, 0, 1, 2]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L648-L663", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034802", "code": "def macro_calc(item):\n    \"\"\"\n    Calculate PPV_Macro and TPR_Macro.\n\n    :param item: PPV or TPR\n    :type item:dict\n    :return: PPV_Macro or TPR_Macro as float\n    \"\"\"\n    try:\n        item_sum = sum(item.values())\n        item_len = len(item.values())\n        return item_sum / item_len\n    except Exception:\n        return \"None\"", "entry_point": "macro_calc", "input": "[-1, 0, 1, 2]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L666-L679", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034803", "code": "def PC_PI_calc(P, TOP, POP):\n    \"\"\"\n    Calculate percent chance agreement for Scott's Pi.\n\n    :param P: condition positive\n    :type P : dict\n    :param TOP: test outcome positive\n    :type TOP : dict\n    :param POP: population\n    :type POP:dict\n    :return: percent chance agreement as float\n    \"\"\"\n    try:\n        result = 0\n        for i in P.keys():\n            result += ((P[i] + TOP[i]) / (2 * POP[i]))**2\n        return result\n    except Exception:\n        return \"None\"", "entry_point": "PC_PI_calc", "input": "[], [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L682-L700", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034804", "code": "def PC_AC1_calc(P, TOP, POP):\n    \"\"\"\n    Calculate percent chance agreement for Gwet's AC1.\n\n    :param P: condition positive\n    :type P : dict\n    :param TOP: test outcome positive\n    :type TOP : dict\n    :param POP: population\n    :type POP:dict\n    :return: percent chance agreement as float\n    \"\"\"\n    try:\n        result = 0\n        classes = list(P.keys())\n        for i in classes:\n            pi = ((P[i] + TOP[i]) / (2 * POP[i]))\n            result += pi * (1 - pi)\n        result = result / (len(classes) - 1)\n        return result\n    except Exception:\n        return \"None\"", "entry_point": "PC_AC1_calc", "input": "[], [-1, 0, 1, 2], []", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L703-L724", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034805", "code": "def overall_jaccard_index_calc(jaccard_list):\n    \"\"\"\n    Calculate overall jaccard index.\n\n    :param jaccard_list : list of jaccard index for each class\n    :type jaccard_list : list\n    :return: (jaccard_sum , jaccard_mean) as tuple\n    \"\"\"\n    try:\n        jaccard_sum = sum(jaccard_list)\n        jaccard_mean = jaccard_sum / len(jaccard_list)\n        return (jaccard_sum, jaccard_mean)\n    except Exception:\n        return \"None\"", "entry_point": "overall_jaccard_index_calc", "input": "[-1, 0, 1, 2]", "output": "(2, 0.5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L741-L754", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034806", "code": "def overall_accuracy_calc(TP, POP):\n    \"\"\"\n    Calculate overall accuracy.\n\n    :param TP: true positive\n    :type TP : dict\n    :param POP: population\n    :type POP:int\n    :return: overall_accuracy as float\n    \"\"\"\n    try:\n        overall_accuracy = sum(TP.values()) / POP\n        return overall_accuracy\n    except Exception:\n        return \"None\"", "entry_point": "overall_accuracy_calc", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L757-L771", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034807", "code": "def AUC_analysis(AUC):\n    \"\"\"\n    Analysis AUC with interpretation table.\n\n    :param AUC: area under the ROC curve\n    :type AUC : float\n    :return: interpretation result as str\n    \"\"\"\n    try:\n        if AUC == \"None\":\n            return \"None\"\n        if AUC < 0.6:\n            return \"Poor\"\n        if AUC >= 0.6 and AUC < 0.7:\n            return \"Fair\"\n        if AUC >= 0.7 and AUC < 0.8:\n            return \"Good\"\n        if AUC >= 0.8 and AUC < 0.9:\n            return \"Very Good\"\n        return \"Excellent\"\n    except Exception:  # pragma: no cover\n        return \"None\"", "entry_point": "AUC_analysis", "input": "[1, 2, 3]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L50-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034808", "code": "def kappa_analysis_cicchetti(kappa):\n    \"\"\"\n    Analysis kappa number with Cicchetti benchmark.\n\n    :param kappa: kappa number\n    :type kappa : float\n    :return: strength of agreement as str\n    \"\"\"\n    try:\n        if kappa < 0.4:\n            return \"Poor\"\n        if kappa >= 0.4 and kappa < 0.59:\n            return \"Fair\"\n        if kappa >= 0.59 and kappa < 0.74:\n            return \"Good\"\n        if kappa >= 0.74 and kappa <= 1:\n            return \"Excellent\"\n        return \"None\"\n    except Exception:  # pragma: no cover\n        return \"None\"", "entry_point": "kappa_analysis_cicchetti", "input": "['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L74-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034809", "code": "def kappa_analysis_koch(kappa):\n    \"\"\"\n    Analysis kappa number with Landis-Koch benchmark.\n\n    :param kappa: kappa number\n    :type kappa : float\n    :return: strength of agreement as str\n    \"\"\"\n    try:\n        if kappa < 0:\n            return \"Poor\"\n        if kappa >= 0 and kappa < 0.2:\n            return \"Slight\"\n        if kappa >= 0.20 and kappa < 0.4:\n            return \"Fair\"\n        if kappa >= 0.40 and kappa < 0.6:\n            return \"Moderate\"\n        if kappa >= 0.60 and kappa < 0.8:\n            return \"Substantial\"\n        if kappa >= 0.80 and kappa <= 1:\n            return \"Almost Perfect\"\n        return \"None\"\n    except Exception:  # pragma: no cover\n        return \"None\"", "entry_point": "kappa_analysis_koch", "input": "[-1, 0, 1, 2]", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L96-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034810", "code": "def kappa_analysis_altman(kappa):\n    \"\"\"\n    Analysis kappa number with Altman benchmark.\n\n    :param kappa: kappa number\n    :type kappa : float\n    :return: strength of agreement as str\n    \"\"\"\n    try:\n        if kappa < 0.2:\n            return \"Poor\"\n        if kappa >= 0.20 and kappa < 0.4:\n            return \"Fair\"\n        if kappa >= 0.40 and kappa < 0.6:\n            return \"Moderate\"\n        if kappa >= 0.60 and kappa < 0.8:\n            return \"Good\"\n        if kappa >= 0.80 and kappa <= 1:\n            return \"Very Good\"\n        return \"None\"\n    except Exception:  # pragma: no cover\n        return \"None\"", "entry_point": "kappa_analysis_altman", "input": "['apple', 'banana', 'cherry']", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L141-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034811", "code": "def quote(code):\n    \"\"\"Returns quoted code if not already quoted and if possible\n\n    Parameters\n    ----------\n\n    code: String\n    \\tCode thta is quoted\n\n    \"\"\"\n\n    try:\n        code = code.rstrip()\n\n    except AttributeError:\n        # code is not a string, may be None --> There is no code to quote\n        return code\n\n    if code and code[0] + code[-1] not in ('\"\"', \"''\", \"u'\", '\"') \\\n       and '\"' not in code:\n        return 'u\"' + code + '\"'\n    else:\n        return code", "entry_point": "quote", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/_string_helpers.py#L35-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034812", "code": "def color_pack2rgb(packed):\n    \"\"\"Returns r, g, b tuple from packed wx.ColourGetRGB value\"\"\"\n\n    r = packed & 255\n    g = (packed & (255 << 8)) >> 8\n    b = (packed & (255 << 16)) >> 16\n\n    return r, g, b", "entry_point": "color_pack2rgb", "input": "True", "output": "(1, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/parsers.py#L98-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034813", "code": "def greenhall_table2(alpha, d):\n    \"\"\" Table 2 from Greenhall 2004 \"\"\"\n    row_idx = int(-alpha+2) # map 2-> row0 and -4-> row6\n    assert(row_idx in [0, 1, 2, 3, 4, 5])\n    col_idx = int(d-1)\n    table2 = [[(3.0/2.0, 1.0/2.0), (35.0/18.0, 1.0), (231.0/100.0, 3.0/2.0)], # alpha=+2\n              [(78.6, 25.2), (790.0, 410.0), (9950.0, 6520.0)],\n              [(2.0/3.0, 1.0/6.0), (2.0/3.0, 1.0/3.0), (7.0/9.0, 1.0/2.0)], # alpha=0\n              [(-1, -1), (0.852, 0.375), (0.997, 0.617)], # -1\n              [(-1, -1), (1.079, 0.368), (1.033, 0.607)], #-2\n              [(-1, -1), (-1, -1), (1.053, 0.553)], #-3\n              [(-1, -1), (-1, -1), (1.302, 0.535)], # alpha=-4\n             ]\n    #print(\"table2 = \", table2[row_idx][col_idx])\n    return table2[row_idx][col_idx]", "entry_point": "greenhall_table2", "input": "2.0, False", "output": "(2.31, 1.5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aewallin/allantools/blob/b5c695a5af4379fcea4d4ce93a066cb902e7ee0a/allantools/ci.py#L662-L676", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034814", "code": "def hash_to_bytesuri(s):\n    \"\"\"\n    Convert in and from bytes uri format used in Registry contract\n    \"\"\"\n    # TODO: we should pad string with zeros till closest 32 bytes word because of a bug in processReceipt (in snet_cli.contract.process_receipt)\n    s = \"ipfs://\" + s\n    return s.encode(\"ascii\").ljust(32 * (len(s)//32 + 1), b\"\\0\")", "entry_point": "hash_to_bytesuri", "input": "'walnut thistle harbour'", "output": "b'ipfs://walnut thistle harbour\\x00\\x00\\x00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singnet/snet-cli/blob/1b5ac98cb9a64211c861ead9fcfe6208f2749032/snet_cli/utils_ipfs.py#L65-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034815", "code": "def convert_color(color):\n    \"\"\"\n    Converts a color from \"color\", (255, 255, 255) or \"#ffffff\" into a color tk \n    should understand.\n    \"\"\"\n    if color is not None:\n\n        # is the color a string\n        if isinstance(color, str):\n            # strip the color of white space\n            color = color.strip()\n\n            # if it starts with a # check it is a valid color\n            if color[0] == \"#\":\n\n                # check its format\n                if len(color) != 7:\n                    raise ValueError(\"{} is not a valid # color, it must be in the format #ffffff.\".format(color))\n                else:\n                    # split the color into its hex values\n                    hex_colors = (color[1:3], color[3:5], color[5:7])\n\n                    # check hex values are between 00 and ff\n                    for hex_color in hex_colors:\n                        try:\n                            int_color = int(hex_color, 16)\n                        except:\n                            raise ValueError(\"{} is not a valid value, it must be hex 00 - ff\".format(hex_color))\n\n                        if not (0 <= int_color <= 255):\n                            raise ValueError(\"{} is not a valid color value, it must be 00 - ff\".format(hex_color))\n\n        # if the color is not a string, try and convert it\n        else:\n            # get the number of colors and check it is iterable\n            try:\n                no_of_colors = len(color)\n            except:\n                raise ValueError(\"A color must be a list or tuple of 3 values (red, green, blue)\")\n\n            if no_of_colors != 3:\n                raise ValueError(\"A color must contain 3 values (red, green, blue)\")\n\n            # check the color values are between 0 and 255\n            for c in color:\n                if not (0 <= c <= 255):\n                    raise ValueError(\"{} is not a valid color value, it must be 0 - 255\")\n\n            # convert to #ffffff format\n            color = \"#{:02x}{:02x}{:02x}\".format(color[0], color[1], color[2])\n\n    return color", "entry_point": "convert_color", "input": "[1, 2, 3]", "output": "'#010203'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lawsie/guizero/blob/84c7f0b314fa86f9fc88eb11c9a0f6c4b57155e2/guizero/utilities.py#L331-L382", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034816", "code": "def _parse_wsgi_headers(wsgi_environ):\n        \"\"\"\n        HTTP headers are presented in WSGI environment with 'HTTP_' prefix.\n        This method finds those headers, removes the prefix, converts\n        underscores to dashes, and converts to lower case.\n\n        :param wsgi_environ:\n        :return: returns a dictionary of headers\n        \"\"\"\n        prefix = 'HTTP_'\n        p_len = len(prefix)\n        # use .items() despite suspected memory pressure bc GC occasionally\n        # collects wsgi_environ.iteritems() during iteration.\n        headers = {\n            key[p_len:].replace('_', '-').lower():\n                val for (key, val) in wsgi_environ.items()\n            if key.startswith(prefix)}\n        return headers", "entry_point": "_parse_wsgi_headers", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uber-common/opentracing-python-instrumentation/blob/57b29fb9f647e073cde8c75155f4708cb5661d20/opentracing_instrumentation/http_server.py#L174-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034817", "code": "def image_type_cast(image_list, pixeltype=None):\n    \"\"\"\n    Cast a list of images to the highest pixeltype present in the list\n    or all to a specified type\n    \n    ANTsR function: `antsImageTypeCast`\n\n    Arguments\n    ---------\n    image_list : list/tuple\n        images to cast\n\n    pixeltype : string (optional)\n        pixeltype to cast to. If None, images will be cast to the highest\n        precision pixeltype found in image_list\n\n    Returns\n    -------\n    list of ANTsImages\n        given images casted to new type\n    \"\"\"\n    if not isinstance(image_list, (list,tuple)):\n        raise ValueError('image_list must be list of ANTsImage types')\n\n    pixtypes = []\n    for img in image_list:\n        pixtypes.append(img.pixeltype)\n\n    if pixeltype is None:\n        pixeltype = 'unsigned char'\n        for p in pixtypes:\n            if p == 'double':\n                pixeltype = 'double'\n            elif (p=='float') and (pixeltype!='double'):\n                pixeltype = 'float'\n            elif (p=='unsigned int') and (pixeltype!='float') and (pixeltype!='double'):\n                pixeltype = 'unsigned int'\n\n    out_images = []\n    for img in image_list:\n        if img.pixeltype == pixeltype:\n            out_images.append(img)\n        else:\n            out_images.append(img.clone(pixeltype))\n\n    return out_images", "entry_point": "image_type_cast", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ANTsX/ANTsPy/blob/638020af2cdfc5ff4bdb9809ffe67aa505727a3b/ants/core/ants_image.py#L940-L985", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034818", "code": "def _format_monitor_parameter(param):\n        \"\"\"This is a workaround for a known issue ID645289, which affects\n\n        all versions of TMOS at this time.\n        \"\"\"\n        if '{' in param and '}':\n            tmp = param.strip('}').split('{')\n            monitor = ''.join(tmp).rstrip()\n            return monitor\n        else:\n            return param", "entry_point": "_format_monitor_parameter", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L57-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034819", "code": "def divide_ceiling(numerator, denominator):\n    \"\"\" Determine the smallest number k such, that denominator * k >= numerator \"\"\"\n    split_val = numerator // denominator\n    rest = numerator % denominator\n\n    if rest > 0:\n        return split_val + 1\n    else:\n        return split_val", "entry_point": "divide_ceiling", "input": "False, True", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MillionIntegrals/vel/blob/e0726e1f63742b728966ccae0c8b825ea0ba491a/vel/util/math.py#L3-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034820", "code": "def pi(nsteps):\r\n  sum, step = 0., 1. / nsteps\r\n  \"omp parallel for reduction(+:sum) private(x)\"\r\n  for i in range(nsteps):\r\n      x = (i - 0.5) * step\r\n      sum += 4. / (1. + x**2)\r\n  return step * sum", "entry_point": "pi", "input": "True", "output": "3.2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/serge-sans-paille/pythran/blob/7e1b5af2dddfabc50bd2a977f0178be269b349b5/docs/papers/sc2013/pi.py#L2-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034821", "code": "def _to_io_meta(shape_meta, valid_keys, key_mappings):\n    \"\"\"\n    This is used to make meta data compatible with a specific io\n    by filtering and mapping to it's valid keys\n\n    Parameters\n    ----------\n    shape_meta: dict\n        meta attribute of a `regions.Region` object\n    valid_keys : python list\n        Contains all the valid keys of a particular file format.\n    key_mappings : python dict\n        Maps to the actual name of the key in the format.\n\n    Returns\n    -------\n    meta : dict\n        io compatible meta dictionary according to valid_keys and key_mappings\n    \"\"\"\n\n    meta = dict()\n\n    for key in shape_meta:\n        if key in valid_keys:\n            meta[key_mappings.get(key, key)] = shape_meta[key]\n\n    return meta", "entry_point": "_to_io_meta", "input": "[[1, 2], [3], []], [-1, 0, 1, 2], {'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/astropy/regions/blob/452d962c417e4ff20d1268f99535c6ff89c83437/regions/io/core.py#L809-L835", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034822", "code": "def _to_graphql_name(name):\n        '''Converts a Python name, ``a_name`` to GraphQL: ``aName``.\n        '''\n        parts = name.split('_')\n        return ''.join(parts[:1] + [p.title() for p in parts[1:]])", "entry_point": "_to_graphql_name", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/profusion/sgqlc/blob/684afb059c93f142150043cafac09b7fd52bfa27/sgqlc/types/__init__.py#L1871-L1875", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034823", "code": "def get_parens(line,retlevel=0,retblevel=0):\n    \"\"\"\n    By default akes a string starting with an open parenthesis and returns the portion\n    of the string going to the corresponding close parenthesis. If retlevel != 0 then\n    will return when that level (for parentheses) is reached. Same for retblevel.\n    \"\"\"\n    if len(line) == 0: return line\n    parenstr = ''\n    level = 0\n    blevel = 0\n    for char in line:\n        if char == '(':\n            level += 1\n        elif char == ')':\n            level -= 1\n        elif char == '[':\n            blevel += 1\n        elif char == ']':\n            blevel -= 1\n        elif (char.isalpha() or char == '_' or char == ':' or char == ',' \n          or char == ' ') and level == retlevel and blevel == retblevel:\n            return parenstr\n        parenstr = parenstr + char\n    \n    if level == retlevel and blevel == retblevel: return parenstr    \n    raise Exception(\"Couldn't parse parentheses: {}\".format(line))", "entry_point": "get_parens", "input": "'', [], ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Fortran-FOSS-Programmers/ford/blob/d46a44eae20d99205292c31785f936fbed47070f/ford/utils.py#L59-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034824", "code": "def truncate(string, width):\n    \"\"\"\n    Truncates/pads the string to be the the specified length,\n    including ellipsis dots if truncation occurs.\n    \"\"\"\n    if len(string) > width:\n        return string[:width-3] + '...'\n    else:\n        return string.ljust(width)", "entry_point": "truncate", "input": "'', 7", "output": "'       '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Fortran-FOSS-Programmers/ford/blob/d46a44eae20d99205292c31785f936fbed47070f/ford/output.py#L554-L562", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034825", "code": "def extended_euclidean_algorithm(a, b):\n    \"\"\"Extended Euclidean algorithm\n\n    Returns r, s, t such that r = s*a + t*b and r is gcd(a, b)\n\n    See <https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm>\n    \"\"\"\n    r0, r1 = a, b\n    s0, s1 = 1, 0\n    t0, t1 = 0, 1\n    while r1 != 0:\n        q = r0 // r1\n        r0, r1 = r1, r0 - q*r1\n        s0, s1 = s1, s0 - q*s1\n        t0, t1 = t1, t0 - q*t1\n    return r0, s0, t0", "entry_point": "extended_euclidean_algorithm", "input": "False, -1.5", "output": "(-1.5, 0, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/n1analytics/python-paillier/blob/955f8c0bfa9623be15b75462b121d28acf70f04b/phe/util.py#L53-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034826", "code": "def improved_i_sqrt(n):\n    \"\"\" taken from\n    http://stackoverflow.com/questions/15390807/integer-square-root-in-python\n    Thanks, mathmandan \"\"\"\n    assert n >= 0\n    if n == 0:\n        return 0\n    i = n.bit_length() >> 1    # i = floor( (1 + floor(log_2(n))) / 2 )\n    m = 1 << i    # m = 2^i\n    #\n    # Fact: (2^(i + 1))^2 > n, so m has at least as many bits\n    # as the floor of the square root of n.\n    #\n    # Proof: (2^(i+1))^2 = 2^(2i + 2) >= 2^(floor(log_2(n)) + 2)\n    # >= 2^(ceil(log_2(n) + 1) >= 2^(log_2(n) + 1) > 2^(log_2(n)) = n. QED.\n    #\n    while (m << i) > n: # (m<<i) = m*(2^i) = m*m\n        m >>= 1\n        i -= 1\n    d = n - (m << i) # d = n-m^2\n    for k in range(i-1, -1, -1):\n        j = 1 << k\n        new_diff = d - (((m<<1) | j) << k) # n-(m+2^k)^2 = n-m^2-2*m*2^k-2^(2k)\n        if new_diff >= 0:\n            d = new_diff\n            m |= j\n    return m", "entry_point": "improved_i_sqrt", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/n1analytics/python-paillier/blob/955f8c0bfa9623be15b75462b121d28acf70f04b/phe/util.py#L121-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034827", "code": "def is_meta_url (attr, attrs):\n    \"\"\"Check if the meta attributes contain a URL.\"\"\"\n    res = False\n    if attr == \"content\":\n        equiv = attrs.get_true('http-equiv', u'').lower()\n        scheme = attrs.get_true('scheme', u'').lower()\n        res = equiv in (u'refresh',) or scheme in (u'dcterms.uri',)\n    if attr == \"href\":\n        rel = attrs.get_true('rel', u'').lower()\n        res = rel in (u'shortcut icon', u'icon')\n    return res", "entry_point": "is_meta_url", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/htmlutil/linkparse.py#L164-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034828", "code": "def is_form_get(attr, attrs):\n    \"\"\"Check if this is a GET form action URL.\"\"\"\n    res = False\n    if attr == \"action\":\n        method = attrs.get_true('method', u'').lower()\n        res = method != 'post'\n    return res", "entry_point": "is_form_get", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/htmlutil/linkparse.py#L177-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034829", "code": "def from_flags(flags, ednsflags):\n    \"\"\"Return the rcode value encoded by flags and ednsflags.\n\n    @param flags: the DNS flags\n    @type flags: int\n    @param ednsflags: the EDNS flags\n    @type ednsflags: int\n    @raises ValueError: rcode is < 0 or > 4095\n    @rtype: int\n    \"\"\"\n\n    value = (flags & 0x000f) | ((ednsflags >> 20) & 0xff0)\n    if value < 0 or value > 4095:\n        raise ValueError('rcode must be >= 0 and <= 4095')\n    return value", "entry_point": "from_flags", "input": "True, True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/third_party/dnspython/dns/rcode.py#L77-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034830", "code": "def unquote (s, matching=False):\n    \"\"\"Remove leading and ending single and double quotes.\n    The quotes need to match if matching is True. Only one quote from each\n    end will be stripped.\n\n    @return: if s evaluates to False, return s as is, else return\n        string with stripped quotes\n    @rtype: unquoted string, or s unchanged if it is evaluting to False\n    \"\"\"\n    if not s:\n        return s\n    if len(s) < 2:\n        return s\n    if matching:\n        if s[0] in (\"\\\"'\") and s[0] == s[-1]:\n            s = s[1:-1]\n    else:\n        if s[0] in (\"\\\"'\"):\n            s = s[1:]\n        if s[-1] in (\"\\\"'\"):\n            s = s[:-1]\n    return s", "entry_point": "unquote", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/strformat.py#L99-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034831", "code": "def get_line_number (s, index):\n    r\"\"\"Return the line number of s[index] or zero on errors.\n    Lines are assumed to be separated by the ASCII character '\\n'.\"\"\"\n    i = 0\n    if index < 0:\n        return 0\n    line = 1\n    while i < index:\n        if s[i] == '\\n':\n            line += 1\n        i += 1\n    return line", "entry_point": "get_line_number", "input": "['apple', 'banana', 'cherry'], 3", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/strformat.py#L157-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034832", "code": "def limit (s, length=72):\n    \"\"\"If the length of the string exceeds the given limit, it will be cut\n    off and three dots will be appended.\n\n    @param s: the string to limit\n    @type s: string\n    @param length: maximum length\n    @type length: non-negative integer\n    @return: limited string, at most length+3 characters long\n    \"\"\"\n    assert length >= 0, \"length limit must be a non-negative integer\"\n    if not s or len(s) <= length:\n        return s\n    if length == 0:\n        return \"\"\n    return \"%s...\" % s[:length]", "entry_point": "limit", "input": "[[1, 2], [3], []], 0", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/strformat.py#L297-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034833", "code": "def splitparams (path):\n    \"\"\"Split off parameter part from path.\n    Returns tuple (path-without-param, param)\n    \"\"\"\n    if '/' in path:\n        i = path.find(';', path.rfind('/'))\n    else:\n        i = path.find(';')\n    if i < 0:\n        return path, ''\n    return path[:i], path[i+1:]", "entry_point": "splitparams", "input": "'Hello World'", "output": "('Hello World', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/url.py#L93-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034834", "code": "def is_numeric_port (portstr):\n    \"\"\"return: integer port (== True) iff portstr is a valid port number,\n           False otherwise\n    \"\"\"\n    if portstr.isdigit():\n        port = int(portstr)\n        # 65536 == 2**16\n        if 0 < port < 65536:\n            return port\n    return False", "entry_point": "is_numeric_port", "input": "'AbC dEf'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/url.py#L106-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034835", "code": "def match_host (host, domainlist):\n    \"\"\"Return True if host matches an entry in given domain list.\"\"\"\n    if not host:\n        return False\n    for domain in domainlist:\n        if domain.startswith('.'):\n            if host.endswith(domain):\n                return True\n        elif host == domain:\n            return True\n    return False", "entry_point": "match_host", "input": "[1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/url.py#L431-L441", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034836", "code": "def shorten_duplicate_content_url(url):\n    \"\"\"Remove anchor part and trailing index.html from URL.\"\"\"\n    if '#' in url:\n        url = url.split('#', 1)[0]\n    if url.endswith('index.html'):\n        return url[:-10]\n    if url.endswith('index.htm'):\n        return url[:-9]\n    return url", "entry_point": "shorten_duplicate_content_url", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/url.py#L547-L555", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034837", "code": "def guess_url(url):\n    \"\"\"Guess if URL is a http or ftp URL.\n    @param url: the URL to check\n    @ptype url: unicode\n    @return: url with http:// or ftp:// prepended if it's detected as\n      a http respective ftp URL.\n    @rtype: unicode\n    \"\"\"\n    if url.lower().startswith(\"www.\"):\n        # syntactic sugar\n        return \"http://%s\" % url\n    elif url.lower().startswith(\"ftp.\"):\n        # syntactic sugar\n        return \"ftp://%s\" % url\n    return url", "entry_point": "guess_url", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/checker/__init__.py#L29-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034838", "code": "def quote_attrval (s):\n    \"\"\"\n    Quote a HTML attribute to be able to wrap it in double quotes.\n\n    @param s: the attribute string to quote\n    @type s: string\n    @return: the quoted HTML attribute\n    @rtype: string\n    \"\"\"\n    res = []\n    for c in s:\n        if ord(c) <= 127:\n            # ASCII\n            if c == u'&':\n                res.append(u\"&amp;\")\n            elif c == u'\"':\n                res.append(u\"&quot;\")\n            else:\n                res.append(c)\n        else:\n            res.append(u\"&#%d;\" % ord(c))\n    return u\"\".join(res)", "entry_point": "quote_attrval", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/HtmlParser/htmllib.py#L193-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034839", "code": "def params_for(prefix, kwargs):\n    \"\"\"Extract parameters that belong to a given sklearn module prefix from\n    ``kwargs``. This is useful to obtain parameters that belong to a\n    submodule.\n\n    Examples\n    --------\n    >>> kwargs = {'encoder__a': 3, 'encoder__b': 4, 'decoder__a': 5}\n    >>> params_for('encoder', kwargs)\n    {'a': 3, 'b': 4}\n\n    \"\"\"\n    if not prefix.endswith('__'):\n        prefix += '__'\n    return {key[len(prefix):]: val for key, val in kwargs.items()\n            if key.startswith(prefix)}", "entry_point": "params_for", "input": "'walnut thistle harbour', {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/skorch-dev/skorch/blob/5b9b8b7b7712cb6e5aaa759d9608ea6269d5bcd3/skorch/utils.py#L315-L330", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034840", "code": "def sum_stats(stats_data):\n    \"\"\"\n    Summarize the bounces, complaints, delivery attempts and rejects from a\n    list of datapoints.\n    \"\"\"\n    t_bounces = 0\n    t_complaints = 0\n    t_delivery_attempts = 0\n    t_rejects = 0\n    for dp in stats_data:\n        t_bounces += int(dp['Bounces'])\n        t_complaints += int(dp['Complaints'])\n        t_delivery_attempts += int(dp['DeliveryAttempts'])\n        t_rejects += int(dp['Rejects'])\n\n    return {\n        'Bounces': t_bounces,\n        'Complaints': t_complaints,\n        'DeliveryAttempts': t_delivery_attempts,\n        'Rejects': t_rejects,\n    }", "entry_point": "sum_stats", "input": "[]", "output": "{'Bounces': 0, 'Complaints': 0, 'DeliveryAttempts': 0, 'Rejects': 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/django-ses/django-ses/blob/2f0fd8e3fdc76d3512982c0bb8e2f6e93e09fa3c/django_ses/views.py#L85-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034841", "code": "def count_end(teststr, testchar):\n    \"\"\"Count instances of testchar at end of teststr.\"\"\"\n    count = 0\n    x = len(teststr) - 1\n    while x >= 0 and teststr[x] == testchar:\n        count += 1\n        x -= 1\n    return count", "entry_point": "count_end", "input": "[], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evhub/coconut/blob/ff97177344e7604e89a0a98a977a87ed2a56fc6d/coconut/compiler/util.py#L334-L341", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034842", "code": "def split_leading_comment(inputstring):\n    \"\"\"Split into leading comment and rest.\"\"\"\n    if inputstring.startswith(\"#\"):\n        comment, rest = inputstring.split(\"\\n\", 1)\n        return comment + \"\\n\", rest\n    else:\n        return \"\", inputstring", "entry_point": "split_leading_comment", "input": "'abc'", "output": "('', 'abc')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evhub/coconut/blob/ff97177344e7604e89a0a98a977a87ed2a56fc6d/coconut/compiler/util.py#L424-L430", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034843", "code": "def rem_encoding(code):\n    \"\"\"Remove encoding declarations from compiled code so it can be passed to exec.\"\"\"\n    old_lines = code.splitlines()\n    new_lines = []\n    for i in range(min(2, len(old_lines))):\n        line = old_lines[i]\n        if not (line.lstrip().startswith(\"#\") and \"coding\" in line):\n            new_lines.append(line)\n    new_lines += old_lines[2:]\n    return \"\\n\".join(new_lines)", "entry_point": "rem_encoding", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evhub/coconut/blob/ff97177344e7604e89a0a98a977a87ed2a56fc6d/coconut/command/util.py#L152-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034844", "code": "def newer(new_ver, old_ver, strict=False):\n    \"\"\"Determines if the first version tuple is newer than the second.\n    True if newer, False if older, None if difference is after specified version parts.\"\"\"\n    if old_ver == new_ver or old_ver + (0,) == new_ver:\n        return False\n    for n, o in zip(new_ver, old_ver):\n        if not isinstance(n, int):\n            o = str(o)\n        if o < n:\n            return True\n        elif o > n:\n            return False\n    return not strict", "entry_point": "newer", "input": "['a', 'b', 'c'], ['a', 'b', 'c'], True", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evhub/coconut/blob/ff97177344e7604e89a0a98a977a87ed2a56fc6d/coconut/requirements.py#L142-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034845", "code": "def skip_common_stack_elements(stacktrace, base_case):\n  \"\"\"Skips items that the target stacktrace shares with the base stacktrace.\"\"\"\n  for i, (trace, base) in enumerate(zip(stacktrace, base_case)):\n    if trace != base:\n      return stacktrace[i:]\n  return stacktrace[-1:]", "entry_point": "skip_common_stack_elements", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/prettytensor/blob/75daa0b11252590f548da5647addc0ea610c4c45/prettytensor/scopes.py#L100-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034846", "code": "def mac_hex_to_ascii(mac_hex, inc_dots):\n        '''\n        Format a hex MAC string to ASCII\n\n        Args:\n            mac_hex:    Value from SNMP\n            inc_dots:   1 to format as aabb.ccdd.eeff, 0 to format aabbccddeeff\n\n        Returns:\n            String representation of the mac_hex\n        '''\n        v = mac_hex[2:]\n        ret = ''\n        for i in range(0, len(v), 4):\n            ret += v[i:i+4]\n            if ((inc_dots) & ((i+4) < len(v))):\n                ret += '.'\n\n        return ret", "entry_point": "mac_hex_to_ascii", "input": "[], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MJL85/natlas/blob/5e7ae3cc7b5dd7ad884fa2b8b93bbdd9275474c4/natlas/mac.py#L179-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034847", "code": "def multi_char_literal(chars):\n    \"\"\"Emulates character integer literals in C. Given a string \"abc\",\n    returns the value of the C single-quoted literal 'abc'.\n    \"\"\"\n    num = 0\n    for index, char in enumerate(chars):\n        shift = (len(chars) - index - 1) * 8\n        num |= ord(char) << shift\n    return num", "entry_point": "multi_char_literal", "input": "['a', 'b', 'c']", "output": "6382179", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/beetbox/audioread/blob/c8bedf7880f13a7b7488b108aaf245d648674818/audioread/macca.py#L79-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034848", "code": "def get_index(binstr, end_index=160):\n    \"\"\"\n    Return the position of the first 1 bit\n    from the left in the word until end_index\n\n    :param binstr:\n    :param end_index:\n    :return:\n    \"\"\"\n    res = -1\n    try:\n        res = binstr.index('1') + 1\n    except ValueError:\n        res = end_index\n    return res", "entry_point": "get_index", "input": "['a', 'b', 'c'], 3", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aliyun/aliyun-odps-python-sdk/blob/4b0de18f5864386df6068f26f026e62f932c41e4/odps/df/tools/lib/hll.py#L43-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034849", "code": "def _justify(texts, max_len, mode='right'):\n    \"\"\"\n    Perform ljust, center, rjust against string or list-like\n    \"\"\"\n    if mode == 'left':\n        return [x.ljust(max_len) for x in texts]\n    elif mode == 'center':\n        return [x.center(max_len) for x in texts]\n    else:\n        return [x.rjust(max_len) for x in texts]", "entry_point": "_justify", "input": "'', [5, 3, 1, 4], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aliyun/aliyun-odps-python-sdk/blob/4b0de18f5864386df6068f26f026e62f932c41e4/odps/df/backends/formatter.py#L180-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034850", "code": "def human_time(seconds):\n    \"\"\"\n    Returns a human-friendly time string that is always exactly 6\n    characters long.\n\n    Depending on the number of seconds given, can be one of::\n\n        1w 3d\n        2d 4h\n        1h 5m\n        1m 4s\n          15s\n\n    Will be in color if console coloring is turned on.\n\n    Parameters\n    ----------\n    seconds : int\n        The number of seconds to represent\n\n    Returns\n    -------\n    time : str\n        A human-friendly representation of the given number of seconds\n        that is always exactly 6 characters.\n    \"\"\"\n    units = [\n        ('y', 60 * 60 * 24 * 7 * 52),\n        ('w', 60 * 60 * 24 * 7),\n        ('d', 60 * 60 * 24),\n        ('h', 60 * 60),\n        ('m', 60),\n        ('s', 1),\n    ]\n\n    seconds = int(seconds)\n\n    if seconds < 60:\n        return '   {0:2d}s'.format(seconds)\n    for i in range(len(units) - 1):\n        unit1, limit1 = units[i]\n        unit2, limit2 = units[i + 1]\n        if seconds >= limit1:\n            return '{0:2d}{1}{2:2d}{3}'.format(\n                seconds // limit1, unit1,\n                (seconds % limit1) // limit2, unit2)\n    return '  ~inf'", "entry_point": "human_time", "input": "0", "output": "'    0s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aliyun/aliyun-odps-python-sdk/blob/4b0de18f5864386df6068f26f026e62f932c41e4/odps/console.py#L610-L656", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034851", "code": "def strip_non_ascii(string):\n    ''' Returns the string without non ASCII characters'''\n    stripped = (c for c in string if 0 < ord(c) < 127)\n    return ''.join(stripped)", "entry_point": "strip_non_ascii", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ClimbsRocks/auto_ml/blob/4b7e0e759023cdbc96b471c64bfd67203e2b5734/auto_ml/DataFrameVectorizer.py#L18-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034852", "code": "def get_bool(_bytearray, byte_index, bool_index):\n    \"\"\"\n    Get the boolean value from location in bytearray\n    \"\"\"\n    index_value = 1 << bool_index\n    byte_value = _bytearray[byte_index]\n    current_value = byte_value & index_value\n    return current_value == index_value", "entry_point": "get_bool", "input": "[1, 2, 3], 1, 7", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gijzelaerr/python-snap7/blob/a6db134c7a3a2ef187b9eca04669221d6fc634c3/snap7/util.py#L101-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034853", "code": "def version_variants(version):\n    \"\"\"Given an igraph version number, returns a list of possible version\n    number variants to try when looking for a suitable nightly build of the\n    C core to download from igraph.org.\"\"\"\n\n    result = [version]\n\n    # Add trailing \".0\" as needed to ensure that we have at least\n    # major.minor.patch\n    parts = version.split(\".\")\n    while len(parts) < 3:\n        parts.append(\"0\")\n        result.append(\".\".join(parts))\n\n    return result", "entry_point": "version_variants", "input": "'a,b,c'", "output": "['a,b,c', 'a,b,c.0', 'a,b,c.0.0']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vtraag/leidenalg/blob/a9e15116973a81048edf02ef7cf800d54debe1cc/setup.py#L174-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034854", "code": "def _merge_args_with_kwargs(args_dict, kwargs_dict):\n    \"\"\"Merge args with kwargs.\"\"\"\n    ret = args_dict.copy()\n    ret.update(kwargs_dict)\n    return ret", "entry_point": "_merge_args_with_kwargs", "input": "{'a': 1, 'b': 2}, {'x': [1, 2], 'y': []}", "output": "{'a': 1, 'b': 2, 'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alecthomas/voluptuous/blob/36c8c11e2b7eb402c24866fa558473661ede9403/voluptuous/schema_builder.py#L1249-L1253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034855", "code": "def _version_less(version_a, version_b):\n    \"\"\" Takes two version as (major, minor, patch) tuples and returns a <= b.\n    \"\"\"\n    if version_a[0] > version_b[0]:\n        return False\n    elif version_a[0] < version_b[0]:\n        return True\n    else:\n        if version_a[1] > version_b[1]:\n            return False\n        elif version_a[1] < version_b[1]:\n            return True\n        else:\n            return version_a[2] < version_b[2]", "entry_point": "_version_less", "input": "[1, 2, 3], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Opentrons/opentrons/blob/a7c15cc2636ecb64ab56c7edc1d8a57163aaeadf/update-server/otupdate/balena/install.py#L20-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034856", "code": "def jinja_filter_param_value_str(value, str_quote_style=\"\", bool_is_str=False):\n    \"\"\" Convert a parameter value to string suitable to be passed to an EDA tool\n\n    Rules:\n    - Booleans are represented as 0/1 or \"true\"/\"false\" depending on the\n      bool_is_str argument\n    - Strings are either passed through or enclosed in the characters specified\n      in str_quote_style (e.g. '\"' or '\\\\\"')\n    - Everything else (including int, float, etc.) are converted using the str()\n      function.\n    \"\"\"\n    if (type(value) == bool) and not bool_is_str:\n        if (value) == True:\n            return '1'\n        else:\n            return '0'\n    elif type(value) == str or ((type(value) == bool) and bool_is_str):\n        return str_quote_style + str(value) + str_quote_style\n    else:\n        return str(value)", "entry_point": "jinja_filter_param_value_str", "input": "['a', 'b', 'c'], [-1, 0, 1, 2], [[1, 2], [3], []]", "output": "\"['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/olofk/edalize/blob/3f087d27323765ba656790d8d0cef8c433c70f2f/edalize/edatool.py#L12-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034857", "code": "def bb_get_instr_max_width(basic_block):\n    \"\"\"Get maximum instruction mnemonic width\n    \"\"\"\n    asm_mnemonic_max_width = 0\n\n    for instr in basic_block:\n        if len(instr.mnemonic) > asm_mnemonic_max_width:\n            asm_mnemonic_max_width = len(instr.mnemonic)\n\n    return asm_mnemonic_max_width", "entry_point": "bb_get_instr_max_width", "input": "set()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/programa-stic/barf-project/blob/18ed9e5eace55f7bf6015ec57f037c364099021c/barf/analysis/graphs/basicblock.py#L30-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034858", "code": "def encode_matrix_parameters(parameters):\n    \"\"\"\n    Performs encoding of url matrix parameters from dictionary to\n    a string.\n    See http://www.w3.org/DesignIssues/MatrixURIs.html for specs.\n    \"\"\"\n    result = []\n\n    for param in iter(sorted(parameters)):\n        if isinstance(parameters[param], (list, tuple)):\n            value = (';%s=' % (param)).join(parameters[param])\n        else:\n            value = parameters[param]\n\n        result.append(\"%s=%s\" % (param, value))\n\n    return ';'.join(result)", "entry_point": "encode_matrix_parameters", "input": "[-1, 0, 1, 2]", "output": "'-1=2;0=-1;1=0;2=1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/devopshq/artifactory/blob/b9ec08cd72527d7d43159fe45c3a98a0b0838534/artifactory.py#L260-L276", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034859", "code": "def nCk(n, k):\n    \"\"\"http://blog.plover.com/math/choose.html\"\"\"\n    if k > n:\n        return 0\n    if k == 0:\n        return 1\n\n    r = 1\n    for d in range(1, k + 1):\n        r *= n\n        r /= d\n        n -= 1\n\n    return r", "entry_point": "nCk", "input": "set(), {1, 2, 3}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwolfhub/zxcvbn-python/blob/38ad57a2bde40d3d4896f148c481d0c40120c6d8/zxcvbn/scoring.py#L29-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034860", "code": "def _locateConvergencePoint(stats, minOverlap, maxOverlap):\n    \"\"\"\n    Walk backwards through stats until you locate the first point that diverges\n    from target overlap values.  We need this to handle cases where it might get\n    to target values, diverge, and then get back again.  We want the last\n    convergence point.\n    \"\"\"\n    for i, v in enumerate(stats[::-1]):\n      if not (v >= minOverlap and v <= maxOverlap):\n        return len(stats) - i + 1\n\n    # Never differs - converged in one iteration\n    return 1", "entry_point": "_locateConvergencePoint", "input": "[], [1, 2, 3], [5, 3, 1, 4]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/htmresearch/frameworks/layers/l2_l4_inference.py#L950-L962", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034861", "code": "def convertSequenceMachineSequence(generatedSequences):\n  \"\"\"\n  Convert a sequence from the SequenceMachine into a list of sequences, such\n  that each sequence is a list of set of SDRs.\n  \"\"\"\n  sequenceList = []\n  currentSequence = []\n  for s in generatedSequences:\n    if s is None:\n      sequenceList.append(currentSequence)\n      currentSequence = []\n    else:\n      currentSequence.append(s)\n\n  return sequenceList", "entry_point": "convertSequenceMachineSequence", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/projects/feedback/feedback_sequences.py#L41-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034862", "code": "def letterSequence(letters, w=40):\n  \"\"\"\n  Return a list of input vectors corresponding to sequence of letters.\n  The vector for each letter has w contiguous bits ON and represented as a\n  sequence of non-zero indices.\n  \"\"\"\n  sequence = []\n  for letter in letters:\n    i = ord(letter) - ord('A')\n    sequence.append(set(range(i*w,(i+1)*w)))\n  return sequence", "entry_point": "letterSequence", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/projects/sequence_learning/sequence_simulations.py#L41-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034863", "code": "def computePredictionAccuracy(pac, pic):\n  \"\"\"\n  Given a temporal memory instance return the prediction accuracy. The accuracy\n  is computed as 1 - (#correctly predicted cols / # predicted cols). The\n  accuracy is 0 if there were no predicted columns.\n  \"\"\"\n  pcols = float(pac + pic)\n  if pcols == 0:\n    return 0.0\n  else:\n    return (pac / pcols)", "entry_point": "computePredictionAccuracy", "input": "2.0, 2", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/projects/sequence_learning/sequence_simulations.py#L122-L132", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034864", "code": "def locateConvergencePoint(stats):\n  \"\"\"\n  Walk backwards through stats until you locate the first point that diverges\n  from target overlap values.  We need this to handle cases where it might get\n  to target values, diverge, and then get back again.  We want the last\n  convergence point.\n  \"\"\"\n  n = len(stats)\n  for i in range(n):\n    if stats[n-i-1] < 1:\n      return n-i\n\n  # Never differs - converged in one iteration\n  return 1", "entry_point": "locateConvergencePoint", "input": "[5, 3, 1, 4]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/projects/l2_pooling/ideal_classifier_experiment.py#L114-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034865", "code": "def getTotalExpectedOccurrencesTicks_2_5(ticks):\n  \"\"\"\n  Extract a set of tick locations and labels. The input ticks are assumed to\n  mean \"How many *other* occurrences are there of the sensed feature?\" but we\n  want to show how many *total* occurrences there are. So we add 1.\n\n  We label tick 2, and then 5, 10, 15, 20, ...\n\n  @param ticks\n  A list of ticks, typically calculated by one of the above generate*List functions.\n  \"\"\"\n  locs = [loc\n          for label, loc in ticks]\n  labels = [(str(label + 1) if\n             (label + 1 == 2\n             or (label+1) % 5 == 0)\n             else \"\")\n            for label, loc in ticks]\n  return locs, labels", "entry_point": "getTotalExpectedOccurrencesTicks_2_5", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/htmresearch/frameworks/location/ambiguity_index.py#L280-L298", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034866", "code": "def _countWhereGreaterEqualInRows(sparseMatrix, rows, threshold):\n  \"\"\"\n  Like countWhereGreaterOrEqual, but for an arbitrary selection of rows, and\n  without any column filtering.\n  \"\"\"\n  return sum(sparseMatrix.countWhereGreaterOrEqual(row, row+1,\n                                                   0, sparseMatrix.nCols(),\n                                                   threshold)\n             for row in rows)", "entry_point": "_countWhereGreaterEqualInRows", "input": "[], {}, {'a': 1, 'b': 2}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/numenta/htmresearch/blob/70c096b09a577ea0432c3f3bfff4442d4871b7aa/htmresearch/algorithms/column_pooler.py#L672-L680", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034867", "code": "def group(data, num):\n    \"\"\" Split data into chunks of num chars each \"\"\"\n    return [data[i:i+num] for i in range(0, len(data), num)]", "entry_point": "group", "input": "['apple', 'banana', 'cherry'], 1", "output": "[['apple'], ['banana'], ['cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yubico/python-yubico/blob/a72e8eddb90da6ee96e29f60912ca1f2872c9aea/yubico/yubico_util.py#L124-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034868", "code": "def norm_package_version(version):\n    \"\"\"Normalize a version by removing extra spaces and parentheses.\"\"\"\n    if version:\n        version = ','.join(v.strip() for v in version.split(',')).strip()\n\n        if version.startswith('(') and version.endswith(')'):\n            version = version[1:-1]\n\n        version = ''.join(v for v in version if v.strip())\n    else:\n        version = ''\n\n    return version", "entry_point": "norm_package_version", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Anaconda-Platform/anaconda-client/blob/b276f0572744c73c184a8b43a897cfa7fc1dc523/binstar_client/inspect_package/pypi.py#L41-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034869", "code": "def resolve_import_alias(name, import_names):\n    \"\"\"Resolve a name from an aliased import to its original name.\n\n    :param name: The potentially aliased name to resolve.\n    :type name: str\n    :param import_names: The pairs of original names and aliases\n        from the import.\n    :type import_names: iterable(tuple(str, str or None))\n\n    :returns: The original name.\n    :rtype: str\n    \"\"\"\n    resolved_name = name\n\n    for import_name, imported_as in import_names:\n        if import_name == name:\n            break\n        if imported_as == name:\n            resolved_name = import_name\n            break\n\n    return resolved_name", "entry_point": "resolve_import_alias", "input": "'', ''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rtfd/sphinx-autoapi/blob/9735f43a8d9ff4620c7bcbd177fd1bb7608052e9/autoapi/mappers/python/astroid_utils.py#L21-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034870", "code": "def _memoize_cache_key(args, kwargs):\n    \"\"\"Turn args tuple and kwargs dictionary into a hashable key.\n\n    Expects that all arguments to a memoized function are either hashable\n    or can be uniquely identified from type(arg) and repr(arg).\n    \"\"\"\n    cache_key_list = []\n\n    # hack to get around the unhashability of lists,\n    # add a special case to convert them to tuples\n    for arg in args:\n        if type(arg) is list:\n            cache_key_list.append(tuple(arg))\n        else:\n            cache_key_list.append(arg)\n    for (k, v) in sorted(kwargs.items()):\n        if type(v) is list:\n            cache_key_list.append((k, tuple(v)))\n        else:\n            cache_key_list.append((k, v))\n    return tuple(cache_key_list)", "entry_point": "_memoize_cache_key", "input": "[[1, 2], [3], []], {}", "output": "((1, 2), (3,), ())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/pyensembl/blob/4b995fb72e848206d6fbf11950cf30964cd9b3aa/pyensembl/common.py#L31-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034871", "code": "def parse_arg(arg):\n    \"\"\"\n    Parses arguments for convenience. Argument can be a\n    csv list ('a,b,c'), a string, a list, a tuple.\n\n    Returns a list.\n    \"\"\"\n    # handle string input\n    if type(arg) == str:\n        arg = arg.strip()\n        # parse csv as tickers and create children\n        if ',' in arg:\n            arg = arg.split(',')\n            arg = [x.strip() for x in arg]\n        # assume single string - create single item list\n        else:\n            arg = [arg]\n\n    return arg", "entry_point": "parse_arg", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pmorissette/ffn/blob/ef09f28b858b7ffcd2627ce6a4dc618183a6bc8a/ffn/utils.py#L46-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034872", "code": "def normalize_constraints(constraints, flds):\n    \"\"\"\n    This method renders local constraints such that return value is:\n      * a list, not None\n      * a list of dicts\n      * a list of non-optional constraints or optional with defined field\n\n    .. note:: We use a new variable 'local_constraints' because the constraints\n              parameter may be a mutable collection, and we do not wish to\n              cause side-effects by modifying it locally\n    \"\"\"\n    local_constraints = constraints or []\n    local_constraints = [dict(**c) for c in local_constraints]\n    local_constraints = [\n        c for c in local_constraints\n        if c.get('field') in flds or\n        not c.get('optional')\n    ]\n    return local_constraints", "entry_point": "normalize_constraints", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/petl-developers/petl/blob/1d33ca055f7e04e0d28a772041c9fd30c8d415d6/petl/transform/validation.py#L88-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034873", "code": "def escape(s, quote=True):\n    \"\"\"\n    Replace special characters \"&\", \"<\" and \">\" to HTML-safe sequences.\n    If the optional flag quote is true (the default), the quotation mark\n    characters, both double quote (\") and single quote (') characters are also\n    translated.\n    \"\"\"\n    s = s.replace(\"&\", \"&amp;\") # Must be done first!\n    s = s.replace(\"<\", \"&lt;\")\n    s = s.replace(\">\", \"&gt;\")\n    if quote:\n        s = s.replace('\"', \"&quot;\")\n        s = s.replace('\\'', \"&#x27;\")\n    return s", "entry_point": "escape", "input": "'', ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/miyuchina/mistletoe/blob/846a419bcb83afab02f3f19d151ab0166fab68f6/mistletoe/_html.py#L14-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034874", "code": "def make_tokens(parse_buffer):\n    \"\"\"\n    Takes a list of pairs (token_type, read_result) and\n    applies token_type(read_result).\n\n    Footnotes are already parsed before this point,\n    and span-level parsing is started here.\n    \"\"\"\n    tokens = []\n    for token_type, result in parse_buffer:\n        token = token_type(result)\n        if token is not None:\n            tokens.append(token)\n    return tokens", "entry_point": "make_tokens", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/miyuchina/mistletoe/blob/846a419bcb83afab02f3f19d151ab0166fab68f6/mistletoe/block_tokenizer.py#L78-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034875", "code": "def eeg_to_all_evokeds(all_epochs, conditions=None):\n    \"\"\"\n    Convert all_epochs to all_evokeds.\n\n    DOCS INCOMPLETE :(\n    \"\"\"\n    if conditions is None:\n        # Get event_id\n        conditions = {}\n        for participant, epochs in all_epochs.items():\n            conditions.update(epochs.event_id)\n\n    all_evokeds = {}\n    for participant, epochs in all_epochs.items():\n        evokeds = {}\n        for cond in conditions:\n            try:\n                evokeds[cond] = epochs[cond].average()\n            except KeyError:\n                pass\n        all_evokeds[participant] = evokeds\n\n    return(all_evokeds)", "entry_point": "eeg_to_all_evokeds", "input": "{}, True", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/neuropsychology/NeuroKit.py/blob/c9589348fbbde0fa7e986048c48f38e6b488adfe/neurokit/eeg/eeg_data.py#L406-L428", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034876", "code": "def eeg_name_frequencies(freqs):\n    \"\"\"\n    Name frequencies according to standart classifications.\n\n    Parameters\n    ----------\n    freqs : list or numpy.array\n        list of floats containing frequencies to classify.\n\n    Returns\n    ----------\n    freqs_names : list\n        Named frequencies\n\n    Example\n    ----------\n    >>> import neurokit as nk\n    >>>\n    >>> nk.eeg_name_frequencies([0.5, 1.5, 3, 5, 7, 15])\n\n    Notes\n    ----------\n    *Details*\n\n    - Delta: 1-3Hz\n    - Theta: 4-7Hz\n    - Alpha1: 8-9Hz\n    - Alpha2: 10-12Hz\n    - Beta1: 13-17Hz\n    - Beta2: 18-30Hz\n    - Gamma1: 31-40Hz\n    - Gamma2: 41-50Hz\n    - Mu: 8-13Hz\n\n    *Authors*\n\n    - Dominique Makowski (https://github.com/DominiqueMakowski)\n\n    References\n    ------------\n    - None\n    \"\"\"\n    freqs = list(freqs)\n    freqs_names = []\n    for freq in freqs:\n        if freq < 1:\n            freqs_names.append(\"UltraLow\")\n        elif freq <= 3:\n            freqs_names.append(\"Delta\")\n        elif freq <= 7:\n            freqs_names.append(\"Theta\")\n        elif freq <= 9:\n            freqs_names.append(\"Alpha1/Mu\")\n        elif freq <= 12:\n            freqs_names.append(\"Alpha2/Mu\")\n        elif freq <= 13:\n            freqs_names.append(\"Beta1/Mu\")\n        elif freq <= 17:\n            freqs_names.append(\"Beta1\")\n        elif freq <= 30:\n            freqs_names.append(\"Beta2\")\n        elif freq <= 40:\n            freqs_names.append(\"Gamma1\")\n        elif freq <= 50:\n            freqs_names.append(\"Gamma2\")\n        else:\n            freqs_names.append(\"UltraHigh\")\n    return(freqs_names)", "entry_point": "eeg_name_frequencies", "input": "[1, 2, 3]", "output": "['Delta', 'Delta', 'Delta']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/neuropsychology/NeuroKit.py/blob/c9589348fbbde0fa7e986048c48f38e6b488adfe/examples/UnderDev/eeg/eeg_time_frequency.py#L20-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034877", "code": "def find_following_duplicates(array):\n    \"\"\"\n    Find the duplicates that are following themselves.\n\n    Parameters\n    ----------\n    array :  list or ndarray\n        A list containing duplicates.\n\n    Returns\n    ----------\n    uniques : list\n        A list containing True for each unique and False for following duplicates.\n\n    Example\n    ----------\n    >>> import neurokit as nk\n    >>> mylist = [\"a\",\"a\",\"b\",\"a\",\"a\",\"a\",\"c\",\"c\",\"b\",\"b\"]\n    >>> uniques = nk.find_following_duplicates(mylist)\n    >>> indices = np.where(uniques)  # Find indices of uniques\n\n    Notes\n    ----------\n    *Authors*\n\n    - `Dominique Makowski <https://dominiquemakowski.github.io/>`_\n\n    *Dependencies*\n\n    - numpy\n    \"\"\"\n    array = array[:]\n\n\n    uniques = []\n    for i in range(len(array)):\n        if i == 0:\n            uniques.append(True)\n        else:\n            if array[i] == array[i-1]:\n                uniques.append(False)\n            else:\n                uniques.append(True)\n\n    return(uniques)", "entry_point": "find_following_duplicates", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/neuropsychology/NeuroKit.py/blob/c9589348fbbde0fa7e986048c48f38e6b488adfe/neurokit/statistics/statistics.py#L219-L263", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034878", "code": "def simple_atmo_opstring(haze, contrast, bias):\n    \"\"\"Make a simple atmospheric correction formula.\"\"\"\n    gamma_b = 1 - haze\n    gamma_g = 1 - (haze / 3.0)\n    ops = (\n        \"gamma g {gamma_g}, \" \"gamma b {gamma_b}, \" \"sigmoidal rgb {contrast} {bias}\"\n    ).format(gamma_g=gamma_g, gamma_b=gamma_b, contrast=contrast, bias=bias)\n    return ops", "entry_point": "simple_atmo_opstring", "input": "2, 2.0, set()", "output": "'gamma g 0.33333333333333337, gamma b -1, sigmoidal rgb 2.0 set()'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapbox/rio-color/blob/4e9d7a9348608e66f9381fcdba98c13050e91c83/rio_color/operations.py#L144-L151", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034879", "code": "def time_string(seconds):\n    \"\"\"Returns time in seconds as a string formatted HHHH:MM:SS.\"\"\"\n    s = int(round(seconds))  # round to nearest second\n    h, s = divmod(s, 3600)  # get hours and remainder\n    m, s = divmod(s, 60)  # split remainder into minutes and seconds\n    return \"%2i:%02i:%02i\" % (h, m, s)", "entry_point": "time_string", "input": "False", "output": "' 0:00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapbox/rio-color/blob/4e9d7a9348608e66f9381fcdba98c13050e91c83/scripts/optimize_color.py#L20-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034880", "code": "def calc_downsample(w, h, target=400):\n    \"\"\"Calculate downsampling value.\"\"\"\n    if w > h:\n        return h / target\n    elif h >= w:\n        return w / target", "entry_point": "calc_downsample", "input": "-1.5, 3.25, -1.5", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapbox/rio-color/blob/4e9d7a9348608e66f9381fcdba98c13050e91c83/scripts/optimize_color.py#L194-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034881", "code": "def temp(h):\n    \"\"\" temp (altitude): Temperature only version of ISA atmos\n\n        Input:\n              h =  altitude in meters 0.0 < h < 84852.\n        (will be clipped when outside range, integer input allowed)\n        Output:\n              T    (in SI-unit: K \"\"\"\n\n    # Base values and gradient in table from hand-out\n    # (but corrected to avoid small discontinuities at borders of layers)\n    h0 = [0.0, 11000., 20000., 32000., 47000., 51000., 71000., 86852.]\n\n    T0 = [288.15,  # Sea level\n          216.65,  # 11 km\n          216.65,  # 20 km\n          228.65,  # 32 km\n          270.65,  # 47 km\n          270.65,  # 51 km\n          214.65]  # 71 km\n\n    # a = lapse rate (temp gradient)\n    # integer 0 indicates isothermic layer!\n    a  = [-0.0065, # 0-11 km\n            0 ,    # 11-20 km\n          0.001,   # 20-32 km\n          0.0028,  # 32-47 km\n            0 ,    # 47-51 km\n          -0.0028, # 51-71 km\n          -0.002]  # 71-   km\n\n    # Clip altitude to maximum!\n    h = max(0.0,min(float(h),h0[-1]))\n\n\n    # Find correct layer\n    i = 0\n    while h>h0[i+1] and i<len(h0)-2:\n        i = i+1\n\n    # Calculate if sothermic layer\n    if a[i]==0:\n        T   = T0[i]\n\n    # Calculate for temperature gradient\n    else:\n        T   = T0[i] + a[i]*(h-h0[i])\n\n    return T", "entry_point": "temp", "input": "2.0", "output": "288.137", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xoolive/traffic/blob/d1a8878098f16759f6b6e0e8d8b8f32e34a680a8/traffic/core/aero.py#L229-L277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034882", "code": "def _gcd(a, b):\n    \"\"\"Calculate the Greatest Common Divisor of a and b.\n\n    Unless b==0, the result will have the same sign as b (so that when\n    b is divided by it, the result comes out positive).\n    \"\"\"\n    while b:\n        a, b = b, (a % b)\n    return a", "entry_point": "_gcd", "input": "[[1, 2], [3], []], []", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mpdavis/python-jose/blob/deea7600eeea47aeb1bf5053a96de51cf2b9c639/jose/backends/rsa_backend.py#L37-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034883", "code": "def kinks(path, tol=1e-8):\n    \"\"\"returns indices of segments that start on a non-differentiable joint.\"\"\"\n    kink_list = []\n    for idx in range(len(path)):\n        if idx == 0 and not path.isclosed():\n            continue\n        try:\n            u = path[(idx - 1) % len(path)].unit_tangent(1)\n            v = path[idx].unit_tangent(0)\n            u_dot_v = u.real*v.real + u.imag*v.imag\n            flag = False\n        except ValueError:\n            flag = True\n\n        if flag or abs(u_dot_v - 1) > tol:\n            kink_list.append(idx)\n    return kink_list", "entry_point": "kinks", "input": "'', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mathandy/svgpathtools/blob/fd7348a1dfd88b65ea61da02325c6605aedf8c4f/svgpathtools/smoothing.py#L23-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034884", "code": "def normalize(l):\n    \"\"\"\n    Normalizes input list.\n\n    Parameters\n    ----------\n    l: list\n        The list to be normalized\n\n    Returns\n    -------\n    The normalized list or numpy array\n\n    Raises\n    ------\n    ValueError, if the list sums to zero\n    \"\"\"\n\n    s = float(sum(l))\n    if s == 0:\n        raise ValueError(\"Cannot normalize list with sum 0\")\n    return [x / s for x in l]", "entry_point": "normalize", "input": "[5, 3, 1, 4]", "output": "[0.38461538461538464, 0.23076923076923078, 0.07692307692307693, 0.3076923076923077]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marcharper/python-ternary/blob/a4bef393ec9df130d4b55707293c750498a01843/ternary/helpers.py#L21-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034885", "code": "def permute_point(p, permutation=None):\n    \"\"\"\n    Permutes the point according to the permutation keyword argument. The\n    default permutation is \"012\" which does not change the order of the\n    coordinate. To rotate counterclockwise, use \"120\" and to rotate clockwise\n    use \"201\".\"\"\"\n    if not permutation:\n        return p\n    return [p[int(permutation[i])] for i in range(len(p))]", "entry_point": "permute_point", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marcharper/python-ternary/blob/a4bef393ec9df130d4b55707293c750498a01843/ternary/helpers.py#L76-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034886", "code": "def _find_error(vals):\n    \"\"\"Find the errors in the energy values.\n\n    This function finds the errors in the enthalpys.\n\n    Parameters\n    ----------\n    vals : list of lists of floats\n\n    Returns\n    -------\n    err_vals : list of lists containing the errors.\n    \"\"\"\n\n    err_vals = []\n    for en in vals:\n        c = en[2]\n        conc = [float(i)/sum(c) for i in c]\n\n        err = abs(en[0]-en[1])\n\n        err_vals.append([conc,err])\n\n    return err_vals", "entry_point": "_find_error", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marcharper/python-ternary/blob/a4bef393ec9df130d4b55707293c750498a01843/examples/scatter_colorbar.py#L69-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034887", "code": "def svg_polygon(coordinates, color):\n    \"\"\"\n    Create an svg triangle for the stationary heatmap.\n\n    Parameters\n    ----------\n    coordinates: list\n        The coordinates defining the polygon\n    color: string\n        RGB color value e.g. #26ffd1\n\n    Returns\n    -------\n    string, the svg string for the polygon\n    \"\"\"\n\n    coord_str = []\n    for c in coordinates:\n        coord_str.append(\",\".join(map(str, c)))\n    coord_str = \" \".join(coord_str)\n    polygon = '<polygon points=\"%s\" style=\"fill:%s;stroke:%s;stroke-width:0\"/>\\n' % (coord_str, color, color)\n    return polygon", "entry_point": "svg_polygon", "input": "[], [-1, 0, 1, 2]", "output": "'<polygon points=\"\" style=\"fill:[-1, 0, 1, 2];stroke:[-1, 0, 1, 2];stroke-width:0\"/>\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marcharper/python-ternary/blob/a4bef393ec9df130d4b55707293c750498a01843/ternary/heatmapping.py#L323-L344", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034888", "code": "def strip_ip_port(ip_address):\n    \"\"\"\n    Strips the port from an IPv4 or IPv6 address, returns a unicode object.\n    \"\"\"\n\n    # IPv4 with or without port\n    if '.' in ip_address:\n        cleaned_ip = ip_address.split(':')[0]\n\n    # IPv6 with port\n    elif ']:' in ip_address:\n        # Remove the port following last ':', and then strip first and last chars for [].\n        cleaned_ip = ip_address.rpartition(':')[0][1:-1]\n\n    # IPv6 without port\n    else:\n        cleaned_ip = ip_address\n\n    return cleaned_ip", "entry_point": "strip_ip_port", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spookylukey/django-paypal/blob/b07d0a3ad91b5c5fe7bb27be3e5d70aabcdef76f/paypal/pro/helpers.py#L78-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034889", "code": "def split_data(iterable, pred):\n    \"\"\"\n    Split data from ``iterable`` into two lists.\n    Each element is passed to function ``pred``; elements\n    for which ``pred`` returns True are put into ``yes`` list,\n    other elements are put into ``no`` list.\n\n    >>> split_data([\"foo\", \"Bar\", \"Spam\", \"egg\"], lambda t: t.istitle())\n    (['Bar', 'Spam'], ['foo', 'egg'])\n    \"\"\"\n    yes, no = [], []\n    for d in iterable:\n        if pred(d):\n            yes.append(d)\n        else:\n            no.append(d)\n    return yes, no", "entry_point": "split_data", "input": "{}, set()", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scrapinghub/adblockparser/blob/4089612d65018d38dbb88dd7f697bcb07814014d/adblockparser/utils.py#L5-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034890", "code": "def _parse_env_var_file(data):\n    \"\"\"\n    Parses a basic VAR=\"value data\" file contents into a dict\n\n    :param data:\n        A unicode string of the file data\n\n    :return:\n        A dict of parsed name/value data\n    \"\"\"\n\n    output = {}\n    for line in data.splitlines():\n        line = line.strip()\n        if not line or '=' not in line:\n            continue\n        parts = line.split('=')\n        if len(parts) != 2:\n            continue\n        name = parts[0]\n        value = parts[1]\n        if len(value) > 1:\n            if value[0] == '\"' and value[-1] == '\"':\n                value = value[1:-1]\n        output[name] = value\n    return output", "entry_point": "_parse_env_var_file", "input": "'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wbond/asn1crypto/blob/ecda20176f55d37021cbca1f6da9083a8e491197/dev/coverage.py#L281-L306", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034891", "code": "def fill_width(bytes_, width):\n    \"\"\"\n    Ensure a byte string representing a positive integer is a specific width\n    (in bytes)\n\n    :param bytes_:\n        The integer byte string\n\n    :param width:\n        The desired width as an integer\n\n    :return:\n        A byte string of the width specified\n    \"\"\"\n\n    while len(bytes_) < width:\n        bytes_ = b'\\x00' + bytes_\n    return bytes_", "entry_point": "fill_width", "input": "['apple', 'banana', 'cherry'], -3", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wbond/asn1crypto/blob/ecda20176f55d37021cbca1f6da9083a8e491197/asn1crypto/_int.py#L142-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034892", "code": "def find_max_label_length(labels):\n    \"\"\"Return the maximum length for the labels.\"\"\"\n    length = 0\n    for i in range(len(labels)):\n        if len(labels[i]) > length:\n            length = len(labels[i])\n\n    return length", "entry_point": "find_max_label_length", "input": "[[1, 2], [3], []]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mkaz/termgraph/blob/c40b86454d380d685785b98834364b111734c163/termgraph/termgraph.py#L166-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034893", "code": "def bitwise_dot_product(bs0: str, bs1: str) -> str:\n    \"\"\"\n    A helper to calculate the bitwise dot-product between two string representing bit-vectors\n\n    :param bs0: String of 0's and 1's representing a number in binary representations\n    :param bs1: String of 0's and 1's representing a number in binary representations\n    :return: 0 or 1 as a string corresponding to the dot-product value\n    \"\"\"\n    if len(bs0) != len(bs1):\n        raise ValueError(\"Bit strings are not of equal length\")\n    return str(sum([int(bs0[i]) * int(bs1[i]) for i in range(len(bs0))]) % 2)", "entry_point": "bitwise_dot_product", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "'0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/grove/blob/dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3/grove/bernstein_vazirani/utils.py#L6-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034894", "code": "def bitlist_to_int(bitlist):\n    \"\"\"Convert a binary bitstring into the corresponding unsigned integer.\n\n    :param list bitlist: A list of ones of zeros.\n    :return: The corresponding integer.\n    :rtype: int\n    \"\"\"\n\n    ret = 0\n    for b in bitlist:\n        ret = (ret << 1) | (int(b) & 1)\n    return ret", "entry_point": "bitlist_to_int", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/grove/blob/dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3/grove/tomography/utils.py#L335-L346", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034895", "code": "def parity_even_p(state, marked_qubits):\n    \"\"\"\n    Calculates the parity of elements at indexes in marked_qubits\n\n    Parity is relative to the binary representation of the integer state.\n\n    :param state: The wavefunction index that corresponds to this state.\n    :param marked_qubits: The indexes to be considered in the parity sum.\n    :returns: A boolean corresponding to the parity.\n    \"\"\"\n    assert isinstance(state, int), \\\n        f\"{state} is not an integer. Must call parity_even_p with an integer state.\"\n    mask = 0\n    for q in marked_qubits:\n        mask |= 1 << q\n    return bin(mask & state).count(\"1\") % 2 == 0", "entry_point": "parity_even_p", "input": "True, (1, 2)", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/grove/blob/dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3/grove/pyvqe/vqe.py#L277-L292", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034896", "code": "def filter_samples(names, seqs, sep='.'):\n    \"\"\"\n    When there are uncollapsed contigs within the same sample, only retain the\n    first seq, or the seq that is most abundant (with cluster_size).\n    \"\"\"\n    seen = set()\n    filtered_names, filtered_seqs = [], []\n    for name, seq in zip(names, seqs):\n        samp = name.split(sep, 1)[0]\n        if samp in seen:\n            continue\n        seen.add(samp)\n        filtered_names.append(name)\n        filtered_seqs.append(seq)\n\n    nfiltered, nnames = len(filtered_names), len(names)\n    assert nfiltered == len(seen)\n\n    return filtered_names, filtered_seqs, seen", "entry_point": "filter_samples", "input": "'abc', [1, 2, 3], '  padded  '", "output": "(['a', 'b', 'c'], [1, 2, 3], {'c', 'a', 'b'})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/apps/uclust.py#L816-L834", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034897", "code": "def expand_alleles(p, tolerance=0):\n    \"\"\"\n    Returns expanded allele set given the tolerance.\n    \"\"\"\n    _p = set()\n    for x in p:\n        _p |= set(range(x - tolerance, x + tolerance + 1))\n    return _p", "entry_point": "expand_alleles", "input": "[], [-1, 0, 1, 2]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/projects/str.py#L127-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034898", "code": "def clone_name(s, ca=False):\n    \"\"\"\n    >>> clone_name(\"120038881639\")\n    \"0038881639\"\n    >>> clone_name(\"GW11W6RK01DAJDWa\")\n    \"GW11W6RK01DAJDW\"\n    \"\"\"\n    if not ca:\n        return s[:-1]\n\n    if s[0] == '1':\n        return s[2:]\n    return s.rstrip('ab')", "entry_point": "clone_name", "input": "['a', 'b', 'c'], []", "output": "['a', 'b']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/assembly/coverage.py#L81-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034899", "code": "def parse_prefix(identifier):\n    \"\"\"\n    Parse identifier such as a|c|le|d|li|re|or|AT4G00480.1 and return\n    tuple of prefix string (separated at '|') and suffix (AGI identifier)\n    \"\"\"\n    pf, id = (), identifier\n    if \"|\" in identifier:\n        pf, id = tuple(identifier.split('|')[:-1]), identifier.split('|')[-1]\n\n    return pf, id", "entry_point": "parse_prefix", "input": "[]", "output": "((), [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/annotation/reformat.py#L922-L931", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034900", "code": "def get_errors(error_string):\n    '''\n    returns all lines in the error_string that start with the string \"error\"\n\n    '''\n\n    lines = error_string.splitlines()\n    error_lines = tuple(line for line in lines if line.find('Error') >= 0)\n    if len(error_lines) > 0:\n        return '\\n'.join(error_lines)\n    else:\n        return error_string.strip()", "entry_point": "get_errors", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/apps/tesseract.py#L98-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034901", "code": "def range_overlap(a, b, ratio=False):\n    \"\"\"\n    Returns whether two ranges overlap. Set percentage=True returns overlap\n    ratio over the shorter range of the two.\n\n    >>> range_overlap((\"1\", 30, 45), (\"1\", 41, 55))\n    5\n    >>> range_overlap((\"1\", 21, 45), (\"1\", 41, 75), ratio=True)\n    0.2\n    >>> range_overlap((\"1\", 30, 45), (\"1\", 15, 55))\n    16\n    >>> range_overlap((\"1\", 30, 45), (\"1\", 15, 55), ratio=True)\n    1.0\n    >>> range_overlap((\"1\", 30, 45), (\"1\", 57, 68))\n    0\n    >>> range_overlap((\"1\", 30, 45), (\"2\", 42, 55))\n    0\n    >>> range_overlap((\"1\", 30, 45), (\"2\", 42, 55), ratio=True)\n    0.0\n    \"\"\"\n    a_chr, a_min, a_max = a\n    b_chr, b_min, b_max = b\n    a_min, a_max = sorted((a_min, a_max))\n    b_min, b_max = sorted((b_min, b_max))\n    shorter = min((a_max - a_min), (b_max - b_min)) + 1\n    # must be on the same chromosome\n    if a_chr != b_chr:\n        ov = 0\n    else:\n        ov = min(shorter, (a_max - b_min + 1), (b_max - a_min + 1))\n        ov = max(ov, 0)\n    if ratio:\n        ov /= float(shorter)\n    return ov", "entry_point": "range_overlap", "input": "[1, 2, 3], [1, 2, 3], -1.5", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/utils/range.py#L80-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034902", "code": "def range_merge(ranges, dist=0):\n    \"\"\"\n    Returns merged range. Similar to range_union, except this returns\n    new ranges.\n\n    >>> ranges = [(\"1\", 30, 45), (\"1\", 40, 50), (\"1\", 10, 50)]\n    >>> range_merge(ranges)\n    [('1', 10, 50)]\n    >>> ranges = [(\"1\", 30, 40), (\"1\", 45, 50)]\n    >>> range_merge(ranges)\n    [('1', 30, 40), ('1', 45, 50)]\n    >>> ranges = [(\"1\", 30, 40), (\"1\", 45, 50)]\n    >>> range_merge(ranges, dist=5)\n    [('1', 30, 50)]\n    \"\"\"\n    if not ranges:\n        return []\n\n    ranges.sort()\n\n    cur_range = list(ranges[0])\n    merged_ranges = []\n    for r in ranges[1:]:\n        # open new range if start > cur_end or seqid != cur_seqid\n        if r[1] - cur_range[2] > dist or r[0] != cur_range[0]:\n            merged_ranges.append(tuple(cur_range))\n            cur_range = list(r)\n        else:\n            cur_range[2] = max(cur_range[2], r[2])\n    merged_ranges.append(tuple(cur_range))\n\n    return merged_ranges", "entry_point": "range_merge", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/utils/range.py#L249-L280", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034903", "code": "def range_union(ranges):\n    \"\"\"\n    Returns total size of ranges, expect range as (chr, left, right)\n\n    >>> ranges = [(\"1\", 30, 45), (\"1\", 40, 50), (\"1\", 10, 50)]\n    >>> range_union(ranges)\n    41\n    >>> ranges = [(\"1\", 30, 45), (\"2\", 40, 50)]\n    >>> range_union(ranges)\n    27\n    >>> ranges = [(\"1\", 30, 45), (\"1\", 45, 50)]\n    >>> range_union(ranges)\n    21\n    >>> range_union([])\n    0\n    \"\"\"\n    if not ranges:\n        return 0\n\n    ranges.sort()\n\n    total_len = 0\n    cur_chr, cur_left, cur_right = ranges[0]  # left-most range\n    for r in ranges:\n        # open new range if left > cur_right or chr != cur_chr\n        if r[1] > cur_right or r[0] != cur_chr:\n            total_len += cur_right - cur_left + 1\n            cur_chr, cur_left, cur_right = r\n        else:\n            # update cur_right\n            cur_right = max(r[2], cur_right)\n\n    # the last one\n    total_len += cur_right - cur_left + 1\n\n    return total_len", "entry_point": "range_union", "input": "()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/utils/range.py#L283-L318", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034904", "code": "def decode_name(name, barcodemap):\n    \"\"\"\n    rename seq/taxon name, typically for a tree display,\n    according to a barcode map given in a dictionary\n\n    By definition barcodes should be distinctive.\n    \"\"\"\n    for barcode in barcodemap:\n        if barcode in name:\n            return barcodemap[barcode]\n\n    return name", "entry_point": "decode_name", "input": "'AbC dEf', {'a': 1, 'b': 2}", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/graphics/tree.py#L59-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034905", "code": "def get_shred_id(id):\n    \"\"\"\n    >>> get_shred_id(\"ca-bacs.5638.frag11.22000-23608\")\n    (\"ca-bacs.5638\", 11)\n    \"\"\"\n    try:\n        parts = id.split(\".\")\n        aid = \".\".join(parts[:2])\n        fid = int(parts[2].replace(\"frag\", \"\"))\n    except:\n        aid, fid = None, None\n    return aid, fid", "entry_point": "get_shred_id", "input": "[-1, 0, 1, 2]", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/assembly/goldenpath.py#L553-L564", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034906", "code": "def counter_format(counter):\n    \"\"\" Pretty print a counter so that it appears as: \"2:200,3:100,4:20\"\n    \"\"\"\n    if not counter:\n        return \"na\"\n\n    return \",\".join(\"{}:{}\".format(*z) for z in sorted(counter.items()))", "entry_point": "counter_format", "input": "0", "output": "'na'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/variation/cnv.py#L541-L547", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034907", "code": "def gene_name(st, exclude=(\"ev\",), sep=\".\"):\n    \"\"\"\n    Helper functions in the BLAST filtering to get rid alternative splicings.\n    This is ugly, but different annotation groups are inconsistent with respect\n    to how the alternative splicings are named. Mostly it can be done by removing\n    the suffix, except for ones in the exclude list.\n    \"\"\"\n    if any(st.startswith(x) for x in exclude):\n        sep = None\n    st = st.split('|')[0]\n\n    if sep and sep in st:\n        name, suffix = st.rsplit(sep, 1)\n    else:\n        name, suffix = st, \"\"\n\n    # We only want to remove suffix that are isoforms, longer suffix would\n    # suggest that it is part of the right gene name\n    if len(suffix) != 1:\n        name = st\n\n    return name", "entry_point": "gene_name", "input": "'', {'a': 1, 'b': 2}, set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/utils/cbook.py#L329-L350", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034908", "code": "def uniqify(L):\n    \"\"\"\n    Uniqify a list, maintains order (the first occurrence will be kept).\n    \"\"\"\n    seen = set()\n    nL = []\n    for a in L:\n        if a in seen:\n            continue\n        nL.append(a)\n        seen.add(a)\n\n    return nL", "entry_point": "uniqify", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/utils/cbook.py#L487-L499", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034909", "code": "def make_sequence(seq, name=\"S\"):\n    \"\"\"\n    Make unique nodes for sequence graph.\n    \"\"\"\n    return [\"{}_{}_{}\".format(name, i, x) for i, x in enumerate(seq)]", "entry_point": "make_sequence", "input": "[[1, 2], [3], []], 'AbC dEf'", "output": "['AbC dEf_0_[1, 2]', 'AbC dEf_1_[3]', 'AbC dEf_2_[]']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tanghaibao/jcvi/blob/d2e31a77b6ade7f41f3b321febc2b4744d1cdeca/jcvi/graphics/graph.py#L18-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034910", "code": "def by_leb(blocks):\n    \"\"\"Sort blocks by Logical Erase Block number.\n    \n    Arguments:\n    List:blocks -- List of block objects to sort.\n    \n    Returns:\n    List              -- Indexes of blocks sorted by LEB.\n    \"\"\" \n    slist_len = len(blocks)\n    slist = ['x'] * slist_len\n\n    for block in blocks:\n        if blocks[block].leb_num >= slist_len:\n            add_elements = blocks[block].leb_num - slist_len + 1\n            slist += (['x'] * add_elements)\n            slist_len = len(slist)\n\n        slist[blocks[block].leb_num] = block\n\n    return slist", "entry_point": "by_leb", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jrspruitt/ubi_reader/blob/7079dd380c1c9896bced30d6d34e8780b9181597/ubireader/ubi/block/sort.py#L32-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034911", "code": "def by_vol_id(blocks, slist=None):\n    \"\"\"Sort blocks by volume id\n\n    Arguments:\n    Obj:blocks -- List of block objects.\n    List:slist     -- (optional) List of block indexes.\n\n    Return:\n    Dict -- blocks grouped in lists with dict key as volume id.\n    \"\"\"\n\n    vol_blocks = {}\n\n    # sort block by volume\n    # not reliable with multiple partitions (fifo)\n\n    for i in blocks:\n        if slist and i not in slist:\n            continue\n        elif not blocks[i].is_valid:\n            continue\n\n        if blocks[i].vid_hdr.vol_id not in vol_blocks:\n            vol_blocks[blocks[i].vid_hdr.vol_id] = []\n\n        vol_blocks[blocks[i].vid_hdr.vol_id].append(blocks[i].peb_num)\n\n    return vol_blocks", "entry_point": "by_vol_id", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jrspruitt/ubi_reader/blob/7079dd380c1c9896bced30d6d34e8780b9181597/ubireader/ubi/block/sort.py#L55-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034912", "code": "def by_type(blocks, slist=None):\n    \"\"\"Sort blocks into layout, internal volume, data or unknown\n\n    Arguments:\n    Obj:blocks   -- List of block objects.\n    List:slist   -- (optional) List of block indexes.\n\n    Returns:\n    List:layout  -- List of block indexes of blocks containing the\n                    volume table records.\n    List:data    -- List of block indexes containing filesystem data.\n    List:int_vol -- List of block indexes  containing volume ids \n                    greater than UBI_INTERNAL_VOL_START that are not\n                    layout volumes.\n    List:unknown -- List of block indexes of blocks that failed validation\n                    of crc in ed_hdr or vid_hdr.\n    \"\"\"\n\n    layout = []\n    data = []\n    int_vol = []\n    unknown = []\n    \n    for i in blocks:\n        if slist and i not in slist:\n            continue\n\n        if blocks[i].is_vtbl and blocks[i].is_valid:\n            layout.append(i)\n\n        elif blocks[i].is_internal_vol and blocks[i].is_valid:\n            int_vol.append(i)\n\n        elif blocks[i].is_valid:\n            data.append(i)\n\n        else:\n            unknown.append(i)\n\n    return layout, data, int_vol, unknown", "entry_point": "by_type", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "([], [], [], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jrspruitt/ubi_reader/blob/7079dd380c1c9896bced30d6d34e8780b9181597/ubireader/ubi/block/sort.py#L84-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034913", "code": "def get_newest(blocks, layout_blocks):\n    \"\"\"Filter out old layout blocks from list\n\n    Arguments:\n    List:blocks        -- List of block objects\n    List:layout_blocks -- List of layout block indexes\n\n    Returns:\n    List -- Newest layout blocks in list\n    \"\"\"\n    layout_temp = list(layout_blocks)\n\n    for i in range(0, len(layout_temp)):\n        for k in range(0, len(layout_blocks)):\n            if blocks[layout_temp[i]].ec_hdr.image_seq != blocks[layout_blocks[k]].ec_hdr.image_seq:\n                continue\n\n            if blocks[layout_temp[i]].leb_num != blocks[layout_blocks[k]].leb_num:\n                continue\n\n            if blocks[layout_temp[i]].vid_hdr.sqnum > blocks[layout_blocks[k]].vid_hdr.sqnum:\n                del layout_blocks[k]\n                break\n\n    return layout_blocks", "entry_point": "get_newest", "input": "False, set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jrspruitt/ubi_reader/blob/7079dd380c1c9896bced30d6d34e8780b9181597/ubireader/ubi/block/layout.py#L23-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034914", "code": "def convert_to_int(value):\n    \"\"\"Attempts to convert a specified value to an integer\n\n    :param value: Content to be converted into an integer\n    :type value: string or int\n\n    \"\"\"\n    if not value:\n        return None\n\n    # Apart from numbers also accept values that end with px\n    if isinstance(value, str):\n        value = value.strip(' px')\n\n    try:\n        return int(value)\n    except (TypeError, ValueError):\n        return None", "entry_point": "convert_to_int", "input": "-3", "output": "-3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michaelhelmick/lassie/blob/b929f78d7e545cff5fb42eb5edfcaf396456f1ee/lassie/utils.py#L31-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034915", "code": "def merge_headers(header_map_list):\n    \"\"\"\n    Helper function for combining multiple header maps into one.\n\n    :param list(dict) header_map_list: list of maps\n\n    :rtype: dict\n    \"\"\"\n    headers = {}\n    for header_map in header_map_list:\n        if header_map:\n            headers.update(header_map)\n    return headers", "entry_point": "merge_headers", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jasonrbriggs/stomp.py/blob/643843c5fbf25fd24339dd0e69a9411c3d8b94c7/stomp/utils.py#L167-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034916", "code": "def schemes_similar(scheme1, scheme2):\n    '''Return whether URL schemes are similar.\n\n    This function considers the following schemes to be similar:\n\n    * HTTP and HTTPS\n\n    '''\n    if scheme1 == scheme2:\n        return True\n\n    if scheme1 in ('http', 'https') and scheme2 in ('http', 'https'):\n        return True\n\n    return False", "entry_point": "schemes_similar", "input": "[], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/url.py#L586-L600", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034917", "code": "def split_query(qs, keep_blank_values=False):\n    '''Split the query string.\n\n    Note for empty values: If an equal sign (``=``) is present, the value\n    will be an empty string (``''``). Otherwise, the value will be ``None``::\n\n        >>> list(split_query('a=&b', keep_blank_values=True))\n        [('a', ''), ('b', None)]\n\n    No processing is done on the actual values.\n    '''\n    items = []\n    for pair in qs.split('&'):\n        name, delim, value = pair.partition('=')\n\n        if not delim and keep_blank_values:\n            value = None\n\n        if keep_blank_values or value:\n            items.append((name, value))\n\n    return items", "entry_point": "split_query", "input": "'walnut thistle harbour', set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/url.py#L641-L662", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034918", "code": "def y2k(year: int) -> int:\n    '''Convert two digit year to four digit year.'''\n    assert 0 <= year <= 99, 'Not a two digit year {}'.format(year)\n    return year + 1000 if year >= 69 else year + 2000", "entry_point": "y2k", "input": "False", "output": "2000", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/protocol/ftp/ls/date.py#L329-L332", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034919", "code": "def normalize_name(name, overrides=None):\n    '''Normalize the key name to title case.\n\n    For example, ``normalize_name('content-id')`` will become ``Content-Id``\n\n    Args:\n        name (str): The name to normalize.\n        overrides (set, sequence): A set or sequence containing keys that\n            should be cased to themselves. For example, passing\n            ``set('WARC-Type')`` will normalize any key named \"warc-type\" to\n            ``WARC-Type`` instead of the default ``Warc-Type``.\n\n    Returns:\n        str\n    '''\n\n    normalized_name = name.title()\n\n    if overrides:\n        override_map = dict([(name.title(), name) for name in overrides])\n\n        return override_map.get(normalized_name, normalized_name)\n    else:\n        return normalized_name", "entry_point": "normalize_name", "input": "'', []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/namevalue.py#L131-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034920", "code": "def guess_line_ending(string):\n    '''Return the most likely line delimiter from the string.'''\n    assert isinstance(string, str), 'Expect str. Got {}'.format(type(string))\n    crlf_count = string.count('\\r\\n')\n    lf_count = string.count('\\n')\n\n    if crlf_count >= lf_count:\n        return '\\r\\n'\n    else:\n        return '\\n'", "entry_point": "guess_line_ending", "input": "'a,b,c'", "output": "'\\r\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/namevalue.py#L157-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034921", "code": "def parse_unix_perm(text):\n    '''Parse a Unix permission string and return integer value.'''\n    # Based on ftp-ls.c symperms\n    if len(text) != 9:\n        return 0\n\n    perms = 0\n\n    for triad_index in range(3):\n        string_index = triad_index * 3\n        perms <<= 3\n\n        if text[string_index] == 'r':\n            perms |= 1 << 2\n\n        if text[string_index + 1] == 'w':\n            perms |= 1 << 1\n\n        if text[string_index + 2] in 'xs':\n            perms |= 1\n\n    return perms", "entry_point": "parse_unix_perm", "input": "'Hello World'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/protocol/ftp/ls/listing.py#L211-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034922", "code": "def should_close(http_version, connection_field):\n    '''Return whether the connection should be closed.\n\n    Args:\n        http_version (str): The HTTP version string like ``HTTP/1.0``.\n        connection_field (str): The value for the ``Connection`` header.\n    '''\n    connection_field = (connection_field or '').lower()\n\n    if http_version == 'HTTP/1.0':\n        return connection_field.replace('-', '') != 'keepalive'\n    else:\n        return connection_field == 'close'", "entry_point": "should_close", "input": "[[1, 2], [3], []], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/protocol/http/util.py#L22-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034923", "code": "def rewrap_bytes(data):\n    '''Rewrap characters to 70 character width.\n\n    Intended to rewrap base64 content.\n    '''\n    return b'\\n'.join(\n        data[index:index+70] for index in range(0, len(data), 70)\n    )", "entry_point": "rewrap_bytes", "input": "[]", "output": "b''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ArchiveTeam/wpull/blob/ddf051aa3322479325ba20aa778cb2cb97606bf5/wpull/util.py#L134-L141", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034924", "code": "def diff_bearing(b1, b2):\n    '''\n    Compute difference between two bearings\n    '''\n    d = abs(b2 - b1)\n    d = 360 - d if d > 180 else d\n    return d", "entry_point": "diff_bearing", "input": "10, 0.5", "output": "9.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapillary/mapillary_tools/blob/816785e90c589cae6e8e34a5530ce8417d29591c/mapillary_tools/geo.py#L174-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034925", "code": "def normalize_bearing(bearing, check_hex=False):\n    '''\n    Normalize bearing and convert from hex if\n    '''\n    if bearing > 360 and check_hex:\n        # fix negative value wrongly parsed in exifread\n        # -360 degree -> 4294966935 when converting from hex\n        bearing = bin(int(bearing))[2:]\n        bearing = ''.join([str(int(int(a) == 0)) for a in bearing])\n        bearing = -float(int(bearing, 2))\n    bearing %= 360\n    return bearing", "entry_point": "normalize_bearing", "input": "True, ('a', 'b', 'c')", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapillary/mapillary_tools/blob/816785e90c589cae6e8e34a5530ce8417d29591c/mapillary_tools/geo.py#L191-L202", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034926", "code": "def name2taxid(taxids, ncbi):\n    \"\"\"Converting taxon names to taxids\n    \"\"\"\n    new_taxids = []\n    for taxid in taxids:\n        try:\n            new_taxids.append(ncbi.get_name_translator([taxid])[taxid][0])\n        except KeyError:\n            try:\n                new_taxids.append(int(taxid))\n            except ValueError:\n                msg = 'Error: cannot convert to taxid: {}'\n                raise ValueError(msg.format(taxid))\n\n    return new_taxids", "entry_point": "name2taxid", "input": "'', set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kblin/ncbi-genome-download/blob/dc55382d351c29e1027be8fa3876701762c1d752/contrib/gimme_taxa.py#L122-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034927", "code": "def has_space_element(source):\n    \"\"\"\n    \u5224\u65ad\u5bf9\u8c61\u4e2d\u7684\u5143\u7d20\uff0c\u5982\u679c\u5b58\u5728 None \u6216\u7a7a\u5b57\u7b26\u4e32\uff0c\u5219\u8fd4\u56de True, \u5426\u5219\u8fd4\u56de False, \u652f\u6301\u5b57\u5178\u3001\u5217\u8868\u548c\u5143\u7ec4\n\n    :param:\n        * source: (list, set, dict) \u9700\u8981\u68c0\u67e5\u7684\u5bf9\u8c61\n\n    :return:\n        * result: (bool) \u5b58\u5728 None \u6216\u7a7a\u5b57\u7b26\u4e32\u6216\u7a7a\u683c\u5b57\u7b26\u4e32\u8fd4\u56de True\uff0c \u5426\u5219\u8fd4\u56de False\n\n    \u4e3e\u4f8b\u5982\u4e0b::\n\n        print('--- has_space_element demo---')\n        print(has_space_element([1, 2, 'test_str']))\n        print(has_space_element([0, 2]))\n        print(has_space_element([1, 2, None]))\n        print(has_space_element((1, [1, 2], 3, '')))\n        print(has_space_element({'a': 1, 'b': 0}))\n        print(has_space_element({'a': 1, 'b': []}))\n        print('---')\n\n    \u6267\u884c\u7ed3\u679c::\n\n        --- has_space_element demo---\n        False\n        False\n        True\n        True\n        False\n        True\n        ---\n\n    \"\"\"\n    if isinstance(source, dict):\n        check_list = list(source.values())\n    elif isinstance(source, list) or isinstance(source, tuple):\n        check_list = list(source)\n    else:\n        raise TypeError('source except list, tuple or dict, but got {}'.format(type(source)))\n    for i in check_list:\n        if i is 0:\n            continue\n        if not (i and str(i).strip()):\n            return True\n    return False", "entry_point": "has_space_element", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chinapnr/fishbase/blob/23c5147a6bc0d8ed36409e55352ffb2c5b0edc82/fishbase/fish_common.py#L376-L420", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034928", "code": "def paging(data_list, group_number=1, group_size=10):\n    \"\"\"\n    \u83b7\u53d6\u5206\u7ec4\u5217\u8868\u6570\u636e\n\n    :param:\n        * data_list: (list) \u9700\u8981\u83b7\u53d6\u5206\u7ec4\u7684\u6570\u636e\u5217\u8868\n        * group_number: (int) \u5206\u7ec4\u4fe1\u606f\uff0c\u9ed8\u8ba4\u4e3a 1\n        * group_size: (int) \u5206\u7ec4\u5927\u5c0f\uff0c\u9ed8\u8ba4\u4e3a 10\n\n    :return:\n        * group_data: (list) \u5206\u7ec4\u6570\u636e\n\n    \u4e3e\u4f8b\u5982\u4e0b::\n\n        print('--- paging demo---')\n        all_records = [1, 2, 3, 4, 5]\n        print(get_group_list_data(all_records))\n\n        all_records1 = list(range(100))\n        print(get_group_list_data(all_records1, group_number=5, group_size=15))\n        print(get_group_list_data(all_records1, group_number=7, group_size=15))\n        print('---')\n\n    \u6267\u884c\u7ed3\u679c::\n\n        --- paging demo---\n        [1, 2, 3, 4, 5]\n        [60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74]\n        [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]\n        ---\n\n    \"\"\"\n    if not isinstance(data_list, list):\n        raise TypeError('data_list should be a list, but we got {}'.format(type(data_list)))\n    \n    if not isinstance(group_number, int) or not isinstance(group_size, int):\n        raise TypeError('group_number and group_size should be int, but we got group_number: {0}, '\n                        'group_size: {1}'.format(type(group_number), type(group_size)))\n    if group_number < 0 or group_size < 0:\n        raise ValueError('group_number and group_size should be positive int, but we got '\n                         'group_number: {0}, group_size: {1}'.format(group_number, group_size))\n    \n    start = (group_number - 1) * group_size\n    end = group_number * group_size\n    \n    return data_list[start:end]", "entry_point": "paging", "input": "['apple', 'banana', 'cherry'], 3, 2", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chinapnr/fishbase/blob/23c5147a6bc0d8ed36409e55352ffb2c5b0edc82/fishbase/fish_common.py#L924-L969", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034929", "code": "def get_sub_dict(data_dict, key_list, default_value='default_value'):\n    \"\"\"\n    \u4ece\u5b57\u5178\u4e2d\u63d0\u53d6\u5b50\u96c6\n\n    :param:\n        * data_dict: (dict) \u9700\u8981\u63d0\u53d6\u5b50\u96c6\u7684\u5b57\u5178\n        * key_list: (list) \u9700\u8981\u83b7\u53d6\u5b50\u96c6\u7684\u952e\u5217\u8868\n        * default_value: (string) \u5f53\u952e\u4e0d\u5b58\u5728\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u9ed8\u8ba4\u4e3a default_value\n\n    :return:\n        * sub_dict: (dict) \u5b50\u96c6\u5b57\u5178\n\n    \u4e3e\u4f8b\u5982\u4e0b::\n\n        print('--- get_sub_dict demo---')\n        dict1 = {'a': 1, 'b': 2, 'list1': [1,2,3]}\n        list1 = ['a', 'list1', 'no_key']\n        print(get_sub_dict(dict1, list1))\n        print(get_sub_dict(dict1, list1, default_value='new default'))\n        print('---')\n\n    \u6267\u884c\u7ed3\u679c::\n\n        --- get_sub_dict demo---\n        {'a': 1, 'list1': [1, 2, 3], 'no_key': 'default_value'}\n        {'a': 1, 'list1': [1, 2, 3], 'no_key': 'new default'}\n        ---\n\n    \"\"\"\n    if not isinstance(data_dict, dict):\n        raise TypeError('data_dict should be dict, but we got {}'.format(type(data_dict)))\n    \n    if not isinstance(key_list, list):\n        raise TypeError('key_list should be list, but we got {}'.format(type(key_list)))\n    \n    sub_dict = dict()\n    for item in key_list:\n        sub_dict.update({item: data_dict.get(item, default_value)})\n    return sub_dict", "entry_point": "get_sub_dict", "input": "{'a': 1, 'b': 2}, [1, 2, 3], [5, 3, 1, 4]", "output": "{1: [5, 3, 1, 4], 2: [5, 3, 1, 4], 3: [5, 3, 1, 4]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chinapnr/fishbase/blob/23c5147a6bc0d8ed36409e55352ffb2c5b0edc82/fishbase/fish_common.py#L973-L1011", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034930", "code": "def get_color_between(color1, color2, i):\n    \"\"\" i is a number between 0 and 1, if 0 then color1, if 1 color2, ... \"\"\"\n    if i <= 0:\n        return color1\n    if i >= 1:\n        return color2\n    return (int(color1[0] + (color2[0] - color1[0]) * i),\n            int(color1[1] + (color2[1] - color1[1]) * i),\n            int(color1[2] + (color2[2] - color1[2]) * i))", "entry_point": "get_color_between", "input": "'AbC dEf', -1.5, 1", "output": "-1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tkrajina/srtm.py/blob/37fb8a6f52c8ca25565772e59e867ac26181f829/srtm/utils.py#L39-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034931", "code": "def splitPrefix(name):\n    \"\"\"\n    Split the name into a tuple (I{prefix}, I{name}).  The first element in\n    the tuple is I{None} when the name does't have a prefix.\n    @param name: A node name containing an optional prefix.\n    @type name: basestring\n    @return: A tuple containing the (2) parts of I{name}\n    @rtype: (I{prefix}, I{name})\n    \"\"\"\n    if isinstance(name, str) and ':' in name:\n        return tuple(name.split(':', 1))\n    else:\n        return (None, name)", "entry_point": "splitPrefix", "input": "'a,b,c'", "output": "(None, 'a,b,c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cackharot/suds-py3/blob/7387ec7806e9be29aad0a711bea5cb3c9396469c/suds/sax/__init__.py#L40-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034932", "code": "def filter_by_ids(original_list, ids_to_filter):\n    \"\"\"Filter a list of dicts by IDs using an id key on each dict.\"\"\"\n    if not ids_to_filter:\n        return original_list\n\n    return [i for i in original_list if i['id'] in ids_to_filter]", "entry_point": "filter_by_ids", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Grunny/zap-cli/blob/d58d4850ecfc5467badfac5e5bcc841d064bd419/zapcli/helpers.py#L98-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034933", "code": "def binarize(W, copy=True):\n    '''\n    Binarizes an input weighted connection matrix.  If copy is not set, this\n    function will *modify W in place.*\n\n    Parameters\n    ----------\n    W : NxN np.ndarray\n        weighted connectivity matrix\n    copy : bool\n        if True, returns a copy of the matrix. Otherwise, modifies the matrix\n        in place. Default value=True.\n\n    Returns\n    -------\n    W : NxN np.ndarray\n        binary connectivity matrix\n    '''\n    if copy:\n        W = W.copy()\n    W[W != 0] = 1\n    return W", "entry_point": "binarize", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "[-1, 1, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aestrivex/bctpy/blob/4cb0e759eb4a038750b07e23bd29958c400684b8/bct/utils/other.py#L169-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034934", "code": "def accuracy_score(y_true, y_pred):\n    \"\"\"Accuracy classification score.\n\n    In multilabel classification, this function computes subset accuracy:\n    the set of labels predicted for a sample must *exactly* match the\n    corresponding set of labels in y_true.\n\n    Args:\n        y_true : 2d array. Ground truth (correct) target values.\n        y_pred : 2d array. Estimated targets as returned by a tagger.\n\n    Returns:\n        score : float.\n\n    Example:\n        >>> from seqeval.metrics import accuracy_score\n        >>> y_true = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]\n        >>> y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]\n        >>> accuracy_score(y_true, y_pred)\n        0.80\n    \"\"\"\n    if any(isinstance(s, list) for s in y_true):\n        y_true = [item for sublist in y_true for item in sublist]\n        y_pred = [item for sublist in y_pred for item in sublist]\n\n    nb_correct = sum(y_t==y_p for y_t, y_p in zip(y_true, y_pred))\n    nb_true = len(y_true)\n\n    score = nb_correct / nb_true\n\n    return score", "entry_point": "accuracy_score", "input": "[-1, 0, 1, 2], []", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chakki-works/seqeval/blob/f1e5ff1a94da11500c47fd11d4d72617f7f55911/seqeval/metrics/sequence_labeling.py#L154-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034935", "code": "def performance_measure(y_true, y_pred):\n    \"\"\"\n    Compute the performance metrics: TP, FP, FN, TN\n\n    Args:\n        y_true : 2d array. Ground truth (correct) target values.\n        y_pred : 2d array. Estimated targets as returned by a tagger.\n\n    Returns:\n        performance_dict : dict\n\n    Example:\n        >>> from seqeval.metrics import performance_measure\n        >>> y_true = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'O', 'B-ORG'], ['B-PER', 'I-PER', 'O']]\n        >>> y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O', 'O'], ['B-PER', 'I-PER', 'O']]\n        >>> performance_measure(y_true, y_pred)\n        (3, 3, 1, 4)\n    \"\"\"\n    performace_dict = dict()\n    if any(isinstance(s, list) for s in y_true):\n        y_true = [item for sublist in y_true for item in sublist]\n        y_pred = [item for sublist in y_pred for item in sublist]\n    performace_dict['TP'] = sum(y_t == y_p for y_t, y_p in zip(y_true, y_pred)\n                                if ((y_t != 'O') or (y_p != 'O')))\n    performace_dict['FP'] = sum(y_t != y_p for y_t, y_p in zip(y_true, y_pred))\n    performace_dict['FN'] = sum(((y_t != 'O') and (y_p == 'O'))\n                                for y_t, y_p in zip(y_true, y_pred))\n    performace_dict['TN'] = sum((y_t == y_p == 'O')\n                                for y_t, y_p in zip(y_true, y_pred))\n\n    return performace_dict", "entry_point": "performance_measure", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "{'TP': 0, 'FP': 3, 'FN': 0, 'TN': 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chakki-works/seqeval/blob/f1e5ff1a94da11500c47fd11d4d72617f7f55911/seqeval/metrics/sequence_labeling.py#L255-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034936", "code": "def get_extra_element_count(curr_count, opt_count, extra_allowed_cnt):\n    \"\"\"Evaluate and return extra same element count based on given values.\n\n    :key-term:\n    group:  In here group can be any base where elements are place\n            i.e. replication-group while placing replicas (elements)\n            or  brokers while placing partitions (elements).\n    element:  Generic term for units which are optimally placed over group.\n\n    :params:\n    curr_count: Given count\n    opt_count:  Optimal count for each group.\n    extra_allowed_cnt:  Count of groups which can have 1 extra element\n                   _    on each group.\n    \"\"\"\n    if curr_count > opt_count:\n        # We still can allow 1 extra count\n        if extra_allowed_cnt > 0:\n            extra_allowed_cnt -= 1\n            extra_cnt = curr_count - opt_count - 1\n        else:\n            extra_cnt = curr_count - opt_count\n    else:\n        extra_cnt = 0\n    return extra_cnt, extra_allowed_cnt", "entry_point": "get_extra_element_count", "input": "2, 5, [1, 2, 3]", "output": "(0, [1, 2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/kafka-utils/blob/cdb4d64308f3079ee0873250bf7b34d0d94eca50/kafka_utils/kafka_cluster_manager/cluster_info/stats.py#L87-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034937", "code": "def to_h(num, suffix='B'):\n    \"\"\"Converts a byte value in human readable form.\"\"\"\n    if num is None:  # Show None when data is missing\n        return \"None\"\n    for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:\n        if abs(num) < 1024.0:\n            return \"%3.1f%s%s\" % (num, unit, suffix)\n        num /= 1024.0\n    return \"%.1f%s%s\" % (num, 'Yi', suffix)", "entry_point": "to_h", "input": "10, 'a,b,c'", "output": "'10.0a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/kafka-utils/blob/cdb4d64308f3079ee0873250bf7b34d0d94eca50/kafka_utils/util/__init__.py#L110-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034938", "code": "def _prepare_output(topics_with_wrong_rf, verbose):\n    \"\"\"Returns dict with 'raw' and 'message' keys filled.\"\"\"\n    out = {}\n    topics_count = len(topics_with_wrong_rf)\n    out['raw'] = {\n        'topics_with_wrong_replication_factor_count': topics_count,\n    }\n\n    if topics_count == 0:\n        out['message'] = 'All topics have proper replication factor.'\n    else:\n        out['message'] = (\n            \"{0} topic(s) have replication factor lower than specified min ISR + 1.\"\n        ).format(topics_count)\n\n        if verbose:\n            lines = (\n                \"replication_factor={replication_factor} is lower than min_isr={min_isr} + 1 for {topic}\"\n                .format(\n                    min_isr=topic['min_isr'],\n                    topic=topic['topic'],\n                    replication_factor=topic['replication_factor'],\n                )\n                for topic in topics_with_wrong_rf\n            )\n            out['verbose'] = \"Topics:\\n\" + \"\\n\".join(lines)\n    if verbose:\n        out['raw']['topics'] = topics_with_wrong_rf\n\n    return out", "entry_point": "_prepare_output", "input": "['apple', 'banana', 'cherry'], False", "output": "{'raw': {'topics_with_wrong_replication_factor_count': 3}, 'message': '3 topic(s) have replication factor lower than specified min ISR + 1.'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/kafka-utils/blob/cdb4d64308f3079ee0873250bf7b34d0d94eca50/kafka_utils/kafka_check/commands/replication_factor.py#L78-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034939", "code": "def _prepare_output(partitions, unavailable_brokers, verbose):\n    \"\"\"Returns dict with 'raw' and 'message' keys filled.\"\"\"\n    partitions_count = len(partitions)\n    out = {}\n    out['raw'] = {\n        'replica_unavailability_count': partitions_count,\n    }\n\n    if partitions_count == 0:\n        out['message'] = 'All replicas available for communication.'\n    else:\n        out['message'] = \"{replica_unavailability} replicas unavailable for communication. \" \\\n            \"Unavailable Brokers: {unavailable_brokers}\".format(\n            replica_unavailability=partitions_count,\n            unavailable_brokers=', '.join([str(e) for e in unavailable_brokers]),\n        )\n        if verbose:\n            lines = (\n                '{}:{}'.format(topic, partition)\n                for (topic, partition) in partitions\n            )\n            out['verbose'] = \"Partitions:\\n\" + \"\\n\".join(lines)\n\n    if verbose:\n        out['raw']['partitions'] = [\n            {'topic': topic, 'partition': partition}\n            for (topic, partition) in partitions\n        ]\n\n    return out", "entry_point": "_prepare_output", "input": "[[1, 2], [3], []], [], False", "output": "{'raw': {'replica_unavailability_count': 3}, 'message': '3 replicas unavailable for communication. Unavailable Brokers: '}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/kafka-utils/blob/cdb4d64308f3079ee0873250bf7b34d0d94eca50/kafka_utils/kafka_check/commands/replica_unavailability.py#L53-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034940", "code": "def _prepare_output(partitions, verbose):\n    \"\"\"Returns dict with 'raw' and 'message' keys filled.\"\"\"\n    out = {}\n    partitions_count = len(partitions)\n    out['raw'] = {\n        'not_enough_replicas_count': partitions_count,\n    }\n\n    if partitions_count == 0:\n        out['message'] = 'All replicas in sync.'\n    else:\n        out['message'] = (\n            \"{0} partition(s) have the number of replicas in \"\n            \"sync that is lower than the specified min ISR.\"\n        ).format(partitions_count)\n\n        if verbose:\n            lines = (\n                \"isr={isr} is lower than min_isr={min_isr} for {topic}:{partition}\"\n                .format(\n                    isr=p['isr'],\n                    min_isr=p['min_isr'],\n                    topic=p['topic'],\n                    partition=p['partition'],\n                )\n                for p in partitions\n            )\n            out['verbose'] = \"Partitions:\\n\" + \"\\n\".join(lines)\n    if verbose:\n        out['raw']['partitions'] = partitions\n\n    return out", "entry_point": "_prepare_output", "input": "[1, 2, 3], False", "output": "{'raw': {'not_enough_replicas_count': 3}, 'message': '3 partition(s) have the number of replicas in sync that is lower than the specified min ISR.'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/kafka-utils/blob/cdb4d64308f3079ee0873250bf7b34d0d94eca50/kafka_utils/kafka_check/commands/min_isr.py#L92-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034941", "code": "def _hue2rgb(v1, v2, vH):\n    \"\"\"Private helper function (Do not call directly)\n\n    :param vH: rotation around the chromatic circle (between 0..1)\n\n    \"\"\"\n\n    while vH < 0: vH += 1\n    while vH > 1: vH -= 1\n\n    if 6 * vH < 1: return v1 + (v2 - v1) * 6 * vH\n    if 2 * vH < 1: return v2\n    if 3 * vH < 2: return v1 + (v2 - v1) * ((2.0 / 3) - vH) * 6\n\n    return v1", "entry_point": "_hue2rgb", "input": "False, {}, 3.25", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vaab/colour/blob/11f138eb7841d2045160b378a2eec0c2321144c0/colour.py#L478-L492", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034942", "code": "def flag_time_err(phase_err, time_thresh=0.02):\n    \"\"\"\n    Find large time errors in list.\n\n    Scan through a list of tuples of time stamps and phase errors\n    and return a list of time stamps with timing errors above a threshold.\n\n    .. note::\n        This becomes important for networks cross-correlations, where\n        if timing information is uncertain at one site, the relative arrival\n        time (lag) will be incorrect, which will degrade the cross-correlation\n        sum.\n\n    :type phase_err: list\n    :param phase_err: List of Tuple of float, datetime.datetime\n    :type time_thresh: float\n    :param time_thresh: Threshold to declare a timing error for\n\n    :returns: List of :class:`datetime.datetime` when timing is questionable.\n    \"\"\"\n    time_err = []\n    for stamp in phase_err:\n        if abs(stamp[1]) > time_thresh:\n            time_err.append(stamp[0])\n    return time_err", "entry_point": "flag_time_err", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eqcorrscan/EQcorrscan/blob/3121b4aca801ee5d38f56ca297ce1c0f9515d9ff/eqcorrscan/utils/seismo_logs.py#L139-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034943", "code": "def _cc_round(num, dp):\n    \"\"\"\n    Convenience function to take a float and round it to dp padding with zeros\n    to return a string\n\n    :type num: float\n    :param num: Number to round\n    :type dp: int\n    :param dp: Number of decimal places to round to.\n\n    :returns: str\n\n    >>> print(_cc_round(0.25364, 2))\n    0.25\n    \"\"\"\n    num = round(num, dp)\n    num = '{0:.{1}f}'.format(num, dp)\n    return num", "entry_point": "_cc_round", "input": "2.0, 10", "output": "'2.0000000000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eqcorrscan/EQcorrscan/blob/3121b4aca801ee5d38f56ca297ce1c0f9515d9ff/eqcorrscan/utils/catalog_to_dd.py#L57-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034944", "code": "def detect_id_type(sid):\n    \"\"\"Method that tries to infer the type of abstract ID.\n\n    Parameters\n    ----------\n    sid : str\n        The ID of an abstract on Scopus.\n\n    Raises\n    ------\n    ValueError\n        If the ID type cannot be inferred.\n\n    Notes\n    -----\n    PII usually has 17 chars, but in Scopus there are valid cases with only\n    16 for old converted articles.\n\n    Scopus ID contains only digits, but it can have leading zeros.  If ID\n    with leading zeros is treated as a number, SyntaxError can occur, or the\n    ID will be rendered invalid and the type will be misinterpreted.\n    \"\"\"\n    sid = str(sid)\n    if not sid.isnumeric():\n        if sid.startswith('2-s2.0-'):\n            id_type = 'eid'\n        elif '/' in sid:\n            id_type = 'doi'\n        elif 16 <= len(sid) <= 17:\n            id_type = 'pii'\n    elif sid.isnumeric():\n        if len(sid) < 10:\n            id_type = 'pubmed_id'\n        else:\n            id_type = 'scopus_id'\n    else:\n        raise ValueError('ID type detection failed for \\'{}\\'.'.format(sid))\n    return id_type", "entry_point": "detect_id_type", "input": "{'a': 1, 'b': 2}", "output": "'pii'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scopus-api/scopus/blob/27ce02dd3095bfdab9d3e8475543d7c17767d1ab/scopus/utils/get_content.py#L12-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034945", "code": "def chained_get(container, path, default=None):\n    \"\"\"Helper function to perform a series of .get() methods on a dictionary\n    and return a default object type in the end.\n\n    Parameters\n    ----------\n    container : dict\n        The dictionary on which the .get() methods should be performed.\n\n    path : list or tuple\n        The list of keys that should be searched for.\n\n    default : any (optional, default=None)\n        The object type that should be returned if the search yields\n        no result.\n    \"\"\"\n    for key in path:\n        try:\n            container = container[key]\n        except (AttributeError, KeyError, TypeError):\n            return default\n    return container", "entry_point": "chained_get", "input": "[], 'a,b,c', ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scopus-api/scopus/blob/27ce02dd3095bfdab9d3e8475543d7c17767d1ab/scopus/utils/parse_content.py#L1-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034946", "code": "def _deduplicate(lst):\n    \"\"\"Auxiliary function to deduplicate lst.\"\"\"\n    out = []\n    for i in lst:\n        if i not in out:\n            out.append(i)\n    return out", "entry_point": "_deduplicate", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scopus-api/scopus/blob/27ce02dd3095bfdab9d3e8475543d7c17767d1ab/scopus/scopus_search.py#L187-L193", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034947", "code": "def _join(lst, key, sep=\";\"):\n    \"\"\"Auxiliary function to join same elements of a list of dictionaries if\n    the elements are not None.\n    \"\"\"\n    return sep.join([d[key] for d in lst if d[key]])", "entry_point": "_join", "input": "['a', 'b', 'c'], False, 'walnut thistle harbour'", "output": "'awalnut thistle harbourbwalnut thistle harbourc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scopus-api/scopus/blob/27ce02dd3095bfdab9d3e8475543d7c17767d1ab/scopus/scopus_search.py#L196-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034948", "code": "def _validate_python_version(s):\n    \"Return True if a string is of the form <int>.<int>, False otherwise.\"\n    if not s:\n        return True\n    toks = s.split('.')\n    if len(toks) != 2:\n        return False\n    try:\n        int(toks[0])\n        int(toks[1])\n    except ValueError:\n        return False\n    return True", "entry_point": "_validate_python_version", "input": "False", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sixty-north/cosmic-ray/blob/c654e074afbb7b7fcbc23359083c1287c0d3e991/src/cosmic_ray/commands/new_config.py#L46-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034949", "code": "def _hyphenate(input, add_prefix=False):\n    \"\"\"Change underscores to hyphens so that object attributes can be easily\n    tranlated to GPG option names.\n\n    :param str input: The attribute to hyphenate.\n    :param bool add_prefix: If True, add leading hyphens to the input.\n    :rtype: str\n    :return: The ``input`` with underscores changed to hyphens.\n    \"\"\"\n    ret  = '--' if add_prefix else ''\n    ret += input.replace('_', '-')\n    return ret", "entry_point": "_hyphenate", "input": "'a,b,c', 5", "output": "'--a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/isislovecruft/python-gnupg/blob/784571449032e811587249743e183fc5e908a673/pretty_bad_protocol/_parsers.py#L143-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034950", "code": "def _separate_keyword(line):\n    \"\"\"Split the line, and return (first_word, the_rest).\"\"\"\n    try:\n        first, rest = line.split(None, 1)\n    except ValueError:\n        first = line.strip()\n        rest = ''\n    return first, rest", "entry_point": "_separate_keyword", "input": "'a,b,c'", "output": "('a,b,c', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/isislovecruft/python-gnupg/blob/784571449032e811587249743e183fc5e908a673/pretty_bad_protocol/_util.py#L649-L656", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034951", "code": "def lchop(string, prefix):\n    \"\"\"Removes a prefix from string\n\n    :param string: String, possibly prefixed with prefix\n    :param prefix: Prefix to remove from string\n    :returns: string without the prefix\n    \"\"\"\n    if string.startswith(prefix):\n        return string[len(prefix):]\n    return string", "entry_point": "lchop", "input": "'AbC dEf', 'a,b,c'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/enkore/i3pystatus/blob/14cfde967cecf79b40e223e35a04600f4c875af7/i3pystatus/core/util.py#L12-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034952", "code": "def flatten(l):\n    \"\"\"\n    Flattens a hierarchy of nested lists into a single list containing all elements in order\n\n    :param l: list of arbitrary types and lists\n    :returns: list of arbitrary types\n    \"\"\"\n    l = list(l)\n    i = 0\n    while i < len(l):\n        while isinstance(l[i], list):\n            if not l[i]:\n                l.pop(i)\n                i -= 1\n                break\n            else:\n                l[i:i + 1] = l[i]\n        i += 1\n    return l", "entry_point": "flatten", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/enkore/i3pystatus/blob/14cfde967cecf79b40e223e35a04600f4c875af7/i3pystatus/core/util.py#L153-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034953", "code": "def make_bar(percentage):\n    \"\"\"\n    Draws a bar made of unicode box characters.\n\n    :param percentage: A value between 0 and 100\n    :returns: Bar as a string\n    \"\"\"\n\n    bars = [' ', '\u258f', '\u258e', '\u258d', '\u258c', '\u258b', '\u258b', '\u258a', '\u258a', '\u2588']\n    tens = int(percentage / 10)\n    ones = int(percentage) - tens * 10\n    result = tens * '\u2588'\n    if(ones >= 1):\n        result = result + bars[ones]\n    result = result + (10 - len(result)) * ' '\n    return result", "entry_point": "make_bar", "input": "False", "output": "'          '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/enkore/i3pystatus/blob/14cfde967cecf79b40e223e35a04600f4c875af7/i3pystatus/core/util.py#L523-L538", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034954", "code": "def _shtools_status_message(status):\n    '''\n    Determine error message to print when a SHTOOLS Fortran 95 routine exits\n    improperly.\n    '''\n    if (status == 1):\n        errmsg = 'Improper dimensions of input array.'\n    elif (status == 2):\n        errmsg = 'Improper bounds for input variable.'\n    elif (status == 3):\n        errmsg = 'Error allocating memory.'\n    elif (status == 4):\n        errmsg = 'File IO error.'\n    else:\n        errmsg = 'Unhandled Fortran 95 error.'\n    return errmsg", "entry_point": "_shtools_status_message", "input": "[]", "output": "'Unhandled Fortran 95 error.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SHTOOLS/SHTOOLS/blob/9a115cf83002df2ddec6b7f41aeb6be688e285de/pyshtools/shtools/__init__.py#L177-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034955", "code": "def _iscomment(line):\n    \"\"\"\n    Determine if a line is a comment line. A valid line contains at least three\n    words, with the first two being integers. Note that Python 2 and 3 deal\n    with strings differently.\n    \"\"\"\n    if line.isspace():\n        return True\n    elif len(line.split()) >= 3:\n        try:  # python 3 str\n            if line.split()[0].isdecimal() and line.split()[1].isdecimal():\n                return False\n        except:  # python 2 str\n            if (line.decode().split()[0].isdecimal() and\n                    line.split()[1].decode().isdecimal()):\n                return False\n        return True\n    else:\n        return True", "entry_point": "_iscomment", "input": "'abc'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SHTOOLS/SHTOOLS/blob/9a115cf83002df2ddec6b7f41aeb6be688e285de/pyshtools/shio/shread.py#L240-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034956", "code": "def render_app_label(context, app, fallback=\"\"):\n    \"\"\" Render the application label.\n    \"\"\"\n    try:\n        text = app['app_label']\n    except KeyError:\n        text = fallback\n    except TypeError:\n        text = app\n    return text", "entry_point": "render_app_label", "input": "'Hello World', [1, 2, 3], [5, 3, 1, 4]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/django-admin-bootstrapped/django-admin-bootstrapped/blob/30380f20cc82e898754e94b5d12cacafabca01bd/django_admin_bootstrapped/templatetags/bootstrapped_goodies_tags.py#L90-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034957", "code": "def _maxlength(X):\n    \"\"\" Returns the maximum length of signal trajectories X \"\"\"\n    N = 0\n    for x in X:\n        if len(x) > N:\n            N = len(x)\n    return N", "entry_point": "_maxlength", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markovmodel/PyEMMA/blob/5c3124398217de05ba5ce9c8fb01519222481ab8/pyemma/util/statistics.py#L176-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034958", "code": "def to_one_line_string(tiles):\n        \"\"\"\n        Convert 136 tiles array to the one line string\n        Example of output 123s123p123m33z\n        \"\"\"\n        tiles = sorted(tiles)\n\n        man = [t for t in tiles if t < 36]\n\n        pin = [t for t in tiles if 36 <= t < 72]\n        pin = [t - 36 for t in pin]\n\n        sou = [t for t in tiles if 72 <= t < 108]\n        sou = [t - 72 for t in sou]\n\n        honors = [t for t in tiles if t >= 108]\n        honors = [t - 108 for t in honors]\n\n        sou = sou and ''.join([str((i // 4) + 1) for i in sou]) + 's' or ''\n        pin = pin and ''.join([str((i // 4) + 1) for i in pin]) + 'p' or ''\n        man = man and ''.join([str((i // 4) + 1) for i in man]) + 'm' or ''\n        honors = honors and ''.join([str((i // 4) + 1) for i in honors]) + 'z' or ''\n\n        return man + pin + sou + honors", "entry_point": "to_one_line_string", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MahjongRepository/mahjong/blob/a269cc4649b545f965a2bb0c2a6e704492567f13/mahjong/tile.py#L17-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034959", "code": "def rename_dupe_cols(cols):\n    \"\"\"\n    Takes a list of strings and appends 2,3,4 etc to duplicates. Never\n    appends a 0 or 1. Appended #s are not always in order...but if you wrap\n    this in a dataframe.to_sql function you're guaranteed to not have dupe\n    column name errors importing data to SQL...you'll just have to check\n    yourself to see which fields were renamed.\n    \"\"\"\n    counts = {}\n    positions = {pos: fld for pos, fld in enumerate(cols)}\n\n    for c in cols:\n        if c in counts.keys():\n            counts[c] += 1\n        else:\n            counts[c] = 1\n\n    fixed_cols = {}\n\n    for pos, col in positions.items():\n        if counts[col] > 1:\n            fix_cols = {pos: fld for pos, fld in positions.items() if fld == col}\n            keys = [p for p in fix_cols.keys()]\n            min_pos = min(keys)\n            cnt = 1\n            for p, c in fix_cols.items():\n                if not p == min_pos:\n                    cnt += 1\n                    c = c + str(cnt)\n                    fixed_cols.update({p: c})\n\n    positions.update(fixed_cols)\n\n    cols = [x for x in positions.values()]\n\n    return cols", "entry_point": "rename_dupe_cols", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/draperjames/qtpandas/blob/64294fb69f1839e53dee5ea453337266bfaf24f4/qtpandas/utils.py#L221-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034960", "code": "def uniquify_list_of_strings(input_list):\n    \"\"\"\n    Ensure that every string within input_list is unique.\n    :param list input_list: List of strings\n    :return: New list with unique names as needed.\n    \"\"\"\n    output_list = list()\n    for i, item in enumerate(input_list):\n        tempList = input_list[:i] + input_list[i + 1:]\n        if item not in tempList:\n            output_list.append(item)\n        else:\n            output_list.append('{0}_{1}'.format(item, i))\n    return output_list", "entry_point": "uniquify_list_of_strings", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/draperjames/qtpandas/blob/64294fb69f1839e53dee5ea453337266bfaf24f4/qtpandas/ui/fallback/easygui/boxes/utils.py#L88-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034961", "code": "def getFileDialogTitle(msg, title):\n    \"\"\"\n    Create nicely-formatted string based on arguments msg and title\n    :param msg: the msg to be displayed\n    :param title: the window title\n    :return: None\n    \"\"\"\n    if msg and title:\n        return \"%s - %s\" % (title, msg)\n    if msg and not title:\n        return str(msg)\n    if title and not msg:\n        return str(title)\n    return None", "entry_point": "getFileDialogTitle", "input": "'a,b,c', [-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2] - a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/draperjames/qtpandas/blob/64294fb69f1839e53dee5ea453337266bfaf24f4/qtpandas/ui/fallback/easygui/boxes/base_boxes.py#L744-L757", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034962", "code": "def _crc16_checksum(bytes):\n    \"\"\"Returns the CRC-16 checksum of bytearray bytes\n\n    Ported from Java implementation at: http://introcs.cs.princeton.edu/java/61data/CRC16CCITT.java.html\n\n    Initial value changed to 0x0000 to match Stellar configuration.\n    \"\"\"\n    crc = 0x0000\n    polynomial = 0x1021\n\n    for byte in bytes:\n        for i in range(8):\n            bit = (byte >> (7 - i) & 1) == 1\n            c15 = (crc >> 15 & 1) == 1\n            crc <<= 1\n            if c15 ^ bit:\n                crc ^= polynomial\n\n    return crc & 0xFFFF", "entry_point": "_crc16_checksum", "input": "[5, 3, 1, 4]", "output": "38560", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trezor/python-trezor/blob/2813522b05cef4e0e545a101f8b3559a3183b45b/trezorlib/stellar.py#L321-L339", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034963", "code": "def _insert_idxs(feature_centre, feature_size, dimensions):\n    \"\"\"Returns the indices of where to put the signal into the signal volume\n\n    Parameters\n    ----------\n\n    feature_centre : list, int\n        List of coordinates for the centre location of the signal\n\n    feature_size : list, int\n        How big is the signal's diameter.\n\n    dimensions : 3 length array, int\n        What are the dimensions of the volume you wish to create\n\n\n    Returns\n    ----------\n    x_idxs : tuple\n        The x coordinates of where the signal is to be inserted\n\n    y_idxs : tuple\n        The y coordinates of where the signal is to be inserted\n\n    z_idxs : tuple\n        The z coordinates of where the signal is to be inserted\n\n    \"\"\"\n\n    # Set up the indexes within which to insert the signal\n    x_idx = [int(feature_centre[0] - (feature_size / 2)) + 1,\n             int(feature_centre[0] - (feature_size / 2) +\n                 feature_size) + 1]\n    y_idx = [int(feature_centre[1] - (feature_size / 2)) + 1,\n             int(feature_centre[1] - (feature_size / 2) +\n                 feature_size) + 1]\n    z_idx = [int(feature_centre[2] - (feature_size / 2)) + 1,\n             int(feature_centre[2] - (feature_size / 2) +\n                 feature_size) + 1]\n\n    # Check for out of bounds\n    # Min Boundary\n    if 0 > x_idx[0]:\n        x_idx[0] = 0\n    if 0 > y_idx[0]:\n        y_idx[0] = 0\n    if 0 > z_idx[0]:\n        z_idx[0] = 0\n\n    # Max Boundary\n    if dimensions[0] < x_idx[1]:\n        x_idx[1] = dimensions[0]\n    if dimensions[1] < y_idx[1]:\n        y_idx[1] = dimensions[1]\n    if dimensions[2] < z_idx[1]:\n        z_idx[1] = dimensions[2]\n\n    # Return the idxs for data\n    return x_idx, y_idx, z_idx", "entry_point": "_insert_idxs", "input": "[1, 2, 3], 3, [1, 2, 3]", "output": "([1, 1], [1, 2], [2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brainiak/brainiak/blob/408f12dec2ff56559a26873a848a09e4c8facfeb/brainiak/utils/fmrisim.py#L245-L303", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034964", "code": "def rows(array):\n    \"\"\"\n    Function to find the number of rows in an array.\n    Excel reference: https://support.office.com/en-ie/article/rows-function-b592593e-3fc2-47f2-bec1-bda493811597\n\n    :param array: the array of which the rows should be counted.\n    :return: the number of rows.\n    \"\"\"\n\n    if isinstance(array, (float, int)):\n        rows = 1  # special case for A1:A1 type ranges which for some reason only return an int/float\n    elif array is None:\n        rows = 1  # some A1:A1 ranges return None (issue with ref cell)\n    else:\n        rows = len(array.values)\n\n    return rows", "entry_point": "rows", "input": "-1.5", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/anthill/koala/blob/393089fe081380506e73235db18a32b4e078d222/koala/excellib.py#L410-L426", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034965", "code": "def find_first_tag(tags, entity_type, after_index=-1):\n    \"\"\"Searches tags for entity type after given index\n\n    Args:\n        tags(list): a list of tags with entity types to be compaired too entity_type\n        entity_type(str): This is he entity type to be looking for in tags\n        after_index(int): the start token must be greaterthan this.\n\n    Returns:\n        ( tag, v, confidence ):\n            tag(str): is the tag that matched\n            v(str): ? the word that matched?\n            confidence(float): is a mesure of accuacy.  1 is full confidence and 0 is none.\n    \"\"\"\n    for tag in tags:\n        for entity in tag.get('entities'):\n            for v, t in entity.get('data'):\n                if t.lower() == entity_type.lower() and tag.get('start_token', 0) > after_index:\n                    return tag, v, entity.get('confidence')\n\n    return None, None, None", "entry_point": "find_first_tag", "input": "[], [1, 2, 3], 10", "output": "(None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MycroftAI/adapt/blob/334f23248b8e09fb9d84a88398424ec5bd3bae4c/adapt/intent.py#L29-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034966", "code": "def map_field(fn, m) :\n    \"\"\"\n    Maps a field name, given a mapping file.\n    Returns input if fieldname is unmapped.\n    \"\"\"\n    if m is None:\n        return fn\n    if fn in m:\n        return m[fn]\n    else:\n        return fn", "entry_point": "map_field", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biolink/ontobio/blob/4e512a7831cfe6bc1b32f2c3be2ba41bc5cf7345/ontobio/golr/golr_query.py#L271-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034967", "code": "def strip_suffix(string, suffix):\n    \"\"\"Remove a suffix from a string if it exists.\"\"\"\n    if string.endswith(suffix):\n        return string[:-(len(suffix))]\n    return string", "entry_point": "strip_suffix", "input": "'  padded  ', 'AbC dEf'", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/importlab/blob/92090a0b4421137d1369c2ed952eda6bb4c7a155/importlab/utils.py#L155-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034968", "code": "def convert_text_to_rouge_format(text, title=\"dummy title\"):\n        \"\"\"\n        Convert a text to a format ROUGE understands. The text is\n        assumed to contain one sentence per line.\n\n            text:   The text to convert, containg one sentence per line.\n            title:  Optional title for the text. The title will appear\n                    in the converted file, but doesn't seem to have\n                    any other relevance.\n\n        Returns: The converted text as string.\n\n        \"\"\"\n        sentences = text.split(\"\\n\")\n        sent_elems = [\n            \"<a name=\\\"{i}\\\">[{i}]</a> <a href=\\\"#{i}\\\" id={i}>\"\n            \"{text}</a>\".format(i=i, text=sent)\n            for i, sent in enumerate(sentences, start=1)]\n        html = \"\"\"<html>\n<head>\n<title>{title}</title>\n</head>\n<body bgcolor=\"white\">\n{elems}\n</body>\n</html>\"\"\".format(title=title, elems=\"\\n\".join(sent_elems))\n\n        return html", "entry_point": "convert_text_to_rouge_format", "input": "'a,b,c', [[1, 2], [3], []]", "output": "'<html>\\n<head>\\n<title>[[1, 2], [3], []]</title>\\n</head>\\n<body bgcolor=\"white\">\\n<a name=\"1\">[1]</a> <a href=\"#1\" id=1>a,b,c</a>\\n</body>\\n</html>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bheinzerling/pyrouge/blob/afeb37dd2608f1399e2fb24a4ee2fe10a2a18603/pyrouge/Rouge155.py#L208-L235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034969", "code": "def is_maximal_matching(G, matching):\n    \"\"\"Determines whether the given set of edges is a maximal matching.\n\n    A matching is a subset of edges in which no node occurs more than\n    once. The cardinality of a matching is the number of matched edges.\n    A maximal matching is one where one cannot add any more edges\n    without violating the matching rule.\n\n    Parameters\n    ----------\n    G : NetworkX graph\n        The graph on which to check the maximal matching.\n\n    edges : iterable\n        A iterable of edges.\n\n    Returns\n    -------\n    is_matching : bool\n        True if the given edges are a maximal matching.\n\n    Example\n    -------\n    This example checks two sets of edges, both derived from a\n    single Chimera unit cell, for a matching. The first set (a matching) is\n    a subset of the second, which was found using the `min_maximal_matching()`\n    function.\n\n    >>> import dwave_networkx as dnx\n    >>> G = dnx.chimera_graph(1, 1, 4)\n    >>> dnx.is_matching({(0, 4), (2, 7)})\n    True\n    >>> dnx.is_maximal_matching(G,{(0, 4), (2, 7)})\n    False\n    >>> dnx.is_maximal_matching(G,{(0, 4), (1, 5), (2, 7), (3, 6)})\n    True\n\n    \"\"\"\n    touched_nodes = set().union(*matching)\n\n    # first check if a matching\n    if len(touched_nodes) != len(matching) * 2:\n        return False\n\n    # now for each edge, check that at least one of its variables is\n    # already in the matching\n    for (u, v) in G.edges:\n        if u not in touched_nodes and v not in touched_nodes:\n            return False\n\n    return True", "entry_point": "is_maximal_matching", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwavesystems/dwave_networkx/blob/9ea1223ddbc7e86db2f90b8b23e250e6642c3d68/dwave_networkx/algorithms/matching.py#L259-L309", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034970", "code": "def maximum_weighted_independent_set_qubo(G, weight=None, lagrange=2.0):\n    \"\"\"Return the QUBO with ground states corresponding to a maximum weighted independent set.\n\n    Parameters\n    ----------\n    G : NetworkX graph\n\n    weight : string, optional (default None)\n        If None, every node has equal weight. If a string, use this node\n        attribute as the node weight. A node without this attribute is\n        assumed to have max weight.\n        \n    lagrange : optional (default 2)\n        Lagrange parameter to weight constraints (no edges within set) \n        versus objective (largest set possible).\n\n    Returns\n    -------\n    QUBO : dict\n       The QUBO with ground states corresponding to a maximum weighted independent set.\n\n    Examples\n    --------\n\n    >>> from dwave_networkx.algorithms.independent_set import maximum_weighted_independent_set_qubo\n    ...\n    >>> G = nx.path_graph(3)\n    >>> Q = maximum_weighted_independent_set_qubo(G, weight='weight', lagrange=2.0)\n    >>> Q[(0, 0)]\n    -1.0\n    >>> Q[(1, 1)]\n    -1.0\n    >>> Q[(0, 1)]\n    2.0\n\n    \"\"\"\n\n    # empty QUBO for an empty graph\n    if not G:\n        return {}\n\n    # We assume that the sampler can handle an unstructured QUBO problem, so let's set one up.\n    # Let us define the largest independent set to be S.\n    # For each node n in the graph, we assign a boolean variable v_n, where v_n = 1 when n\n    # is in S and v_n = 0 otherwise.\n    # We call the matrix defining our QUBO problem Q.\n    # On the diagnonal, we assign the linear bias for each node to be the negative of its weight.\n    # This means that each node is biased towards being in S. Weights are scaled to a maximum of 1.\n    # Negative weights are considered 0.\n    # On the off diagnonal, we assign the off-diagonal terms of Q to be 2. Thus, if both\n    # nodes are in S, the overall energy is increased by 2.\n    cost = dict(G.nodes(data=weight, default=1))\n    scale = max(cost.values())\n    Q = {(node, node): min(-cost[node] / scale, 0.0) for node in G}\n    Q.update({edge: lagrange for edge in G.edges})\n\n    return Q", "entry_point": "maximum_weighted_independent_set_qubo", "input": "[], [5, 3, 1, 4], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dwavesystems/dwave_networkx/blob/9ea1223ddbc7e86db2f90b8b23e250e6642c3d68/dwave_networkx/algorithms/independent_set.py#L208-L264", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034971", "code": "def convert_args_to_list(args):\n    \"\"\"Convert all iterable pairs of inputs into a list of list\"\"\"\n    list_of_pairs = []\n    if len(args) == 0:\n        return []\n\n    if any(isinstance(arg, (list, tuple)) for arg in args):\n        # Domain([[1, 4]])\n        # Domain([(1, 4)])\n        # Domain([(1, 4), (5, 8)])\n        # Domain([[1, 4], [5, 8]])\n        if len(args) == 1 and \\\n                any(isinstance(arg, (list, tuple)) for arg in args[0]):\n            for item in args[0]:\n                list_of_pairs.append(list(item))\n        else:\n            # Domain([1, 4])\n            # Domain((1, 4))\n            # Domain((1, 4), (5, 8))\n            # Domain([1, 4], [5, 8])\n            for item in args:\n                list_of_pairs.append(list(item))\n    else:\n        # Domain(1, 2)\n        if len(args) == 2:\n            list_of_pairs.append(list(args))\n        else:\n            msg = \"The argument type is invalid. \".format(args)\n            raise TypeError(msg)\n\n    return list_of_pairs", "entry_point": "convert_args_to_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datascopeanalytics/traces/blob/420611151a05fea88a07bc5200fefffdc37cc95b/traces/utils.py#L30-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034972", "code": "def _assemble_linux_cmdline(kv):\n    \"\"\"\n    Given a dictionary, assemble a Linux boot command line.\n    \"\"\"\n    # try to be compatible with Py2.4\n    parts = []\n    for k, v in kv.items():\n        if v is None:\n            parts.append(str(k))\n        else:\n            parts.append('%s=%s' % (k, v))\n    return ' '.join(parts)", "entry_point": "_assemble_linux_cmdline", "input": "{'a': 1, 'b': 2}", "output": "'a=1 b=2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gc3-uzh-ch/elasticluster/blob/e6345633308c76de13b889417df572815aabe744/elasticluster/share/playbooks/library/bootparam.py#L181-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034973", "code": "def clean_regex(regex):\n    \"\"\"\n    Escape any regex special characters other than alternation.\n\n    :param regex: regex from datatables interface\n    :type regex: str\n    :rtype: str with regex to use with database\n    \"\"\"\n    # copy for return\n    ret_regex = regex\n\n    # these characters are escaped (all except alternation | and escape \\)\n    # see http://www.regular-expressions.info/refquick.html\n    escape_chars = '[^$.?*+(){}'\n\n    # remove any escape chars\n    ret_regex = ret_regex.replace('\\\\', '')\n\n    # escape any characters which are used by regex\n    # could probably concoct something incomprehensible using re.sub() but\n    # prefer to write clear code with this loop\n    # note expectation that no characters have already been escaped\n    for c in escape_chars:\n        ret_regex = ret_regex.replace(c, '\\\\' + c)\n\n    # remove any double alternations until these don't exist any more\n    while True:\n        old_regex = ret_regex\n        ret_regex = ret_regex.replace('||', '|')\n        if old_regex == ret_regex:\n            break\n\n    # if last char is alternation | remove it because this\n    # will cause operational error\n    # this can happen as user is typing in global search box\n    while len(ret_regex) >= 1 and ret_regex[-1] == '|':\n        ret_regex = ret_regex[:-1]\n\n    # and back to the caller\n    return ret_regex", "entry_point": "clean_regex", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Pegase745/sqlalchemy-datatables/blob/049ab5f98f20ad37926fe86d5528da0c91cd462d/datatables/clean_regex.py#L1-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034974", "code": "def filter_devices(ads, func):\n    \"\"\"Finds the AndroidDevice instances from a list that match certain\n    conditions.\n\n    Args:\n        ads: A list of AndroidDevice instances.\n        func: A function that takes an AndroidDevice object and returns True\n            if the device satisfies the filter condition.\n\n    Returns:\n        A list of AndroidDevice instances that satisfy the filter condition.\n    \"\"\"\n    results = []\n    for ad in ads:\n        if func(ad):\n            results.append(ad)\n    return results", "entry_point": "filter_devices", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/mobly/blob/38ba2cf7d29a20e6a2fca1718eecb337df38db26/mobly/controllers/android_device.py#L290-L306", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034975", "code": "def linear_weights(i, n):\n    \"\"\"A window function that falls off arithmetically.\n\n    This is used to calculate a weighted moving average (WMA) that gives higher\n    weight to changes near the point being analyzed, and smooth out changes at\n    the opposite edge of the moving window.  See bug 879903 for details.\n    \"\"\"\n    if i >= n:\n        return 0.0\n    return float(n - i) / float(n)", "entry_point": "linear_weights", "input": "[1, 2, 3], [1, 2, 3]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mozilla/treeherder/blob/cc47bdec872e5c668d0f01df89517390a164cda3/treeherder/perfalert/perfalert/__init__.py#L44-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034976", "code": "def is_helpful_search_term(search_term):\n    \"\"\"\n    Decide if the given search_term string is helpful or not.\n\n    We define \"helpful\" here as search terms that won't match an excessive\n    number of bug summaries.  Very short terms and those matching generic\n    strings (listed in the blacklist) are deemed unhelpful since they wouldn't\n    result in useful suggestions.\n    \"\"\"\n    # Search terms that will match too many bug summaries\n    # and so not result in useful suggestions.\n    search_term = search_term.strip()\n\n    blacklist = [\n        'automation.py',\n        'remoteautomation.py',\n        'Shutdown',\n        'undefined',\n        'Main app process exited normally',\n        'Traceback (most recent call last):',\n        'Return code: 0',\n        'Return code: 1',\n        'Return code: 2',\n        'Return code: 9',\n        'Return code: 10',\n        'mozalloc_abort(char const*)',\n        'mozalloc_abort',\n        'Exiting 1',\n        'Exiting 9',\n        'CrashingThread(void *)',\n        'libSystem.B.dylib + 0xd7a',\n        'linux-gate.so + 0x424',\n        'TypeError: content is null',\n        'leakcheck',\n        'ImportError: No module named pygtk',\n        '# TBPL FAILURE #'\n    ]\n\n    return len(search_term) > 4 and search_term not in blacklist", "entry_point": "is_helpful_search_term", "input": "'Hello World'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mozilla/treeherder/blob/cc47bdec872e5c668d0f01df89517390a164cda3/treeherder/model/error_summary.py#L172-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034977", "code": "def line_and_column(text, position):\n    \"\"\"Return the line number and column of a position in a string.\"\"\"\n    position_counter = 0\n    for idx_line, line in enumerate(text.splitlines(True)):\n        if (position_counter + len(line.rstrip())) >= position:\n            return (idx_line, position - position_counter)\n        else:\n            position_counter += len(line)", "entry_point": "line_and_column", "input": "'Hello World', 2.0", "output": "(0, 2.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/amperser/proselint/blob/cb619ee4023cc7856f5fb96aec2a33a2c9f1a2e2/proselint/tools.py#L231-L238", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034978", "code": "def detector_50_Cent(text):\n    \"\"\"Determine whether 50 Cent is a topic.\"\"\"\n    keywords = [\n        \"50 Cent\",\n        \"rap\",\n        \"hip hop\",\n        \"Curtis James Jackson III\",\n        \"Curtis Jackson\",\n        \"Eminem\",\n        \"Dre\",\n        \"Get Rich or Die Tryin'\",\n        \"G-Unit\",\n        \"Street King Immortal\",\n        \"In da Club\",\n        \"Interscope\",\n    ]\n    num_keywords = sum(word in text for word in keywords)\n    return (\"50 Cent\", float(num_keywords > 2))", "entry_point": "detector_50_Cent", "input": "'a,b,c'", "output": "('50 Cent', 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/amperser/proselint/blob/cb619ee4023cc7856f5fb96aec2a33a2c9f1a2e2/proselint/tools.py#L446-L463", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034979", "code": "def _compat_compare_digest(a, b):\n    \"\"\"Implementation of hmac.compare_digest for python < 2.7.7.\n\n    This function uses an approach designed to prevent timing analysis by\n    avoiding content-based short circuiting behaviour, making it appropriate\n    for cryptography.\n    \"\"\"\n    if len(a) != len(b):\n        return False\n    # Computes the bitwise difference of all characters in the two strings\n    # before returning whether or not they are equal.\n    difference = 0\n    for (a_char, b_char) in zip(a, b):\n        difference |= ord(a_char) ^ ord(b_char)\n    return difference == 0", "entry_point": "_compat_compare_digest", "input": "[-1, 0, 1, 2], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-rope/rope/blob/1c9f9cd5964b099a99a9111e998f0dc728860688/rope/base/oi/doa.py#L17-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034980", "code": "def _inject_args(sig, types):\n    \"\"\"\n    A function to inject arguments manually into a method signature before\n    it's been parsed. If using keyword arguments use 'kw=type' instead in\n    the types array.\n\n      sig     the string signature\n      types   a list of types to be inserted\n\n    Returns the altered signature.\n    \"\"\"\n    if '(' in sig:\n        parts = sig.split('(')\n        sig = '%s(%s%s%s' % (\n            parts[0], ', '.join(types),\n            (', ' if parts[1].index(')') > 0 else ''), parts[1])\n    else:\n        sig = '%s(%s)' % (sig, ', '.join(types))\n    return sig", "entry_point": "_inject_args", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "'[5, 3, 1, 4](a, b, c)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/samuraisam/django-json-rpc/blob/a88d744d960e828f3eb21265da0f10a694b8ebcf/jsonrpc/__init__.py#L120-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034981", "code": "def split_sequence(seq, n):\n    \"\"\"Generates tokens of length n from a sequence.\n    The last token may be of smaller length.\"\"\"\n    tokens = []\n    while seq:\n        tokens.append(seq[:n])\n        seq = seq[n:]\n    return tokens", "entry_point": "split_sequence", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daboth/pagan/blob/1e6d31f78e312d242751e70566ca9a6278784915/pagan/hashgrinder.py#L124-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034982", "code": "def choose_weapon(decision, weapons):\n    \"\"\"Chooses a weapon from a given list\n    based on the decision.\"\"\"\n    choice = []\n    for i in range(len(weapons)):\n        if (i < decision):\n            choice = weapons[i]\n    return choice", "entry_point": "choose_weapon", "input": "[1, 2, 3], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daboth/pagan/blob/1e6d31f78e312d242751e70566ca9a6278784915/pagan/hashgrinder.py#L163-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034983", "code": "def split_csp_str(val):\n    \"\"\" Split comma separated string into unique values, keeping their order.\n\n    :returns: list of splitted values\n    \"\"\"\n    seen = set()\n    values = val if isinstance(val, (list, tuple)) else val.strip().split(',')\n    return [x for x in values if x and not (x in seen or seen.add(x))]", "entry_point": "split_csp_str", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klen/pylama/blob/f436ccc6b55b33381a295ded753e467953cf4379/pylama/config.py#L47-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034984", "code": "def merge_params(params, lparams):\n    \"\"\"Merge global ignore/select with linter local params.\"\"\"\n    ignore = params.get('ignore', set())\n    if 'ignore' in lparams:\n        ignore = ignore | set(lparams['ignore'])\n\n    select = params.get('select', set())\n    if 'select' in lparams:\n        select = select | set(lparams['select'])\n\n    return ignore, select", "entry_point": "merge_params", "input": "{'x': [1, 2], 'y': []}, (1, 2)", "output": "(set(), set())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klen/pylama/blob/f436ccc6b55b33381a295ded753e467953cf4379/pylama/core.py#L186-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034985", "code": "def prepare_value(value):\n        \"\"\"Prepare value to pylint.\"\"\"\n        if isinstance(value, (list, tuple, set)):\n            return \",\".join(value)\n\n        if isinstance(value, bool):\n            return \"y\" if value else \"n\"\n\n        return str(value)", "entry_point": "prepare_value", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klen/pylama/blob/f436ccc6b55b33381a295ded753e467953cf4379/pylama/lint/pylama_pylint.py#L89-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034986", "code": "def comma_separated_positions(text):\n    \"\"\"\n    Start and end positions of comma separated text items.\n\n    Commas and trailing spaces should not be included.\n\n    >>> comma_separated_positions(\"ABC, 2,3\")\n    [(0, 3), (5, 6), (7, 8)]\n    \"\"\"\n    chunks = []\n    start = 0\n    end = 0\n    for item in text.split(\",\"):\n        space_increment = 1 if item[0] == \" \" else 0\n        start += space_increment  # Is there a space after the comma to ignore? \", \"\n        end += len(item.lstrip()) + space_increment\n        chunks.append((start, end))\n        start += len(item.lstrip()) + 1  # Plus comma\n        end = start\n    return chunks", "entry_point": "comma_separated_positions", "input": "'abc'", "output": "[(0, 3)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crdoconnor/strictyaml/blob/efdac7f89e81679fc95686288cd32b9563fde609/strictyaml/utils.py#L83-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034987", "code": "def drop_empty(arr):\n    \"\"\"\n    Drop empty array element\n    :param arr:\n    :return:\n    \"\"\"\n    return [x for x in arr if not isinstance(x, list) or len(x) > 0]", "entry_point": "drop_empty", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crocs-muni/roca/blob/74ad6ce63c428d83dcffce9c5e26ef7b9e30faa5/roca/detect.py#L161-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034988", "code": "def add_res(acc, elem):\n    \"\"\"\n    Adds results to the accumulator\n    :param acc:\n    :param elem:\n    :return:\n    \"\"\"\n    if not isinstance(elem, list):\n        elem = [elem]\n    if acc is None:\n        acc = []\n    for x in elem:\n        acc.append(x)\n    return acc", "entry_point": "add_res", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry', 'apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crocs-muni/roca/blob/74ad6ce63c428d83dcffce9c5e26ef7b9e30faa5/roca/detect.py#L170-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034989", "code": "def mul_inv(a, b):\n        \"\"\"\n        Modular inversion a mod b\n        :param a:\n        :param b:\n        :return:\n        \"\"\"\n        b0 = b\n        x0, x1 = 0, 1\n        if b == 1:\n            return 1\n        while a > 1:\n            q = a // b\n            a, b = b, a % b\n            x0, x1 = x1 - q * x0, x0\n        if x1 < 0:\n            x1 += b0\n        return x1", "entry_point": "mul_inv", "input": "False, ()", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crocs-muni/roca/blob/74ad6ce63c428d83dcffce9c5e26ef7b9e30faa5/roca/detect.py#L675-L692", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034990", "code": "def listify(x, none_value=[]):\n    \"\"\"Make a list of the argument if it is not a list.\"\"\"\n\n    if isinstance(x, list):\n        return x\n    elif isinstance(x, tuple):\n        return list(x)\n    elif x is None:\n        return none_value\n    else:\n        return [x]", "entry_point": "listify", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/J535D165/recordlinkage/blob/87a5f4af904e0834047cd07ff1c70146b1e6d693/recordlinkage/utils.py#L101-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034991", "code": "def create_primes(threshold):\n    \"\"\"\n    Generate prime values using sieve of Eratosthenes method.\n\n    Args:\n        threshold (int):\n            The upper bound for the size of the prime values.\n\n    Returns (List[int]):\n        All primes from 2 and up to ``threshold``.\n    \"\"\"\n    if threshold == 2:\n        return [2]\n\n    elif threshold < 2:\n        return []\n\n    numbers = list(range(3, threshold+1, 2))\n    root_of_threshold = threshold ** 0.5\n    half = int((threshold+1)/2-1)\n    idx = 0\n    counter = 3\n    while counter <= root_of_threshold:\n        if numbers[idx]:\n            idy = int((counter*counter-3)/2)\n            numbers[idy] = 0\n            while idy < half:\n                numbers[idy] = 0\n                idy += counter\n        idx += 1\n        counter = 2*idx+3\n    return [2] + [number for number in numbers if number]", "entry_point": "create_primes", "input": "0.5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jonathf/chaospy/blob/25ecfa7bf5608dc10c0b31d142ded0e3755f5d74/chaospy/distributions/sampler/sequences/primes.py#L17-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034992", "code": "def _bisearch(ucs, table):\n    \"\"\"\n    Auxiliary function for binary search in interval table.\n\n    :arg int ucs: Ordinal value of unicode character.\n    :arg list table: List of starting and ending ranges of ordinal values,\n        in form of ``[(start, end), ...]``.\n    :rtype: int\n    :returns: 1 if ordinal value ucs is found within lookup table, else 0.\n    \"\"\"\n    lbound = 0\n    ubound = len(table) - 1\n\n    if ucs < table[0][0] or ucs > table[ubound][1]:\n        return 0\n    while ubound >= lbound:\n        mid = (lbound + ubound) // 2\n        if ucs > table[mid][1]:\n            lbound = mid + 1\n        elif ucs < table[mid][0]:\n            ubound = mid - 1\n        else:\n            return 1\n\n    return 0", "entry_point": "_bisearch", "input": "'Hello World', ('a', 'b', 'c')", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wandb/client/blob/7d08954ed5674fee223cd85ed0d8518fe47266b2/wandb/vendor/wcwidth/wcwidth.py#L77-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034993", "code": "def split_token_in_parts(token):\n    \"\"\"\n    Take a Token, and turn it in a list of tokens, by splitting\n    it on ':' (taking that as a separator.)\n    \"\"\"\n    result = []\n    current = []\n    for part in token + (':', ):\n        if part == ':':\n            if current:\n                result.append(tuple(current))\n                current = []\n        else:\n            current.append(part)\n\n    return result", "entry_point": "split_token_in_parts", "input": "(1, 2)", "output": "[(1, 2)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wandb/client/blob/7d08954ed5674fee223cd85ed0d8518fe47266b2/wandb/vendor/prompt_toolkit/styles/utils.py#L10-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034994", "code": "def downsample(values, target_length):\n    \"\"\"Downsamples 1d values to target_length, including start and end.\n\n    Algorithm just rounds index down.\n\n    Values can be any sequence, including a generator.\n    \"\"\"\n    assert target_length > 1\n    values = list(values)\n    if len(values) < target_length:\n        return values\n    ratio = float(len(values) - 1) / (target_length - 1)\n    result = []\n    for i in range(target_length):\n        result.append(values[int(i * ratio)])\n    return result", "entry_point": "downsample", "input": "['apple', 'banana', 'cherry'], 7", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wandb/client/blob/7d08954ed5674fee223cd85ed0d8518fe47266b2/wandb/util.py#L637-L652", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034995", "code": "def _construct_key(previous_key, separator, new_key):\n    \"\"\"\n    Returns the new_key if no previous key exists, otherwise concatenates\n    previous key, separator, and new_key\n    :param previous_key:\n    :param separator:\n    :param new_key:\n    :return: a string if previous_key exists and simply passes through the\n    new_key otherwise\n    \"\"\"\n    if previous_key:\n        return u\"{}{}{}\".format(previous_key, separator, new_key)\n    else:\n        return new_key", "entry_point": "_construct_key", "input": "['apple', 'banana', 'cherry'], 'AbC dEf', ['a', 'b', 'c']", "output": "\"['apple', 'banana', 'cherry']AbC dEf['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/amirziai/flatten/blob/e8e2cbbdd6fe21177bfc0ce034562463ae555799/flatten_json.py#L16-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034996", "code": "def check_if_numbers_are_consecutive(list_):\n    \"\"\"\n    Returns True if numbers in the list are consecutive\n\n    :param list_: list of integers\n    :return: Boolean\n    \"\"\"\n    return all((True if second - first == 1 else False\n                for first, second in zip(list_[:-1], list_[1:])))", "entry_point": "check_if_numbers_are_consecutive", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/amirziai/flatten/blob/e8e2cbbdd6fe21177bfc0ce034562463ae555799/util.py#L1-L9", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034997", "code": "def list_i2str(ilist):\n    \"\"\"\n    Convert an integer list into a string list.\n    \"\"\"\n    slist = []\n    for el in ilist:\n        slist.append(str(el))\n    return slist", "entry_point": "list_i2str", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/FNNDSC/med2image/blob/638d5d230de47608af20f9764acf8e382c2bf2ff/med2image/systemMisc.py#L814-L821", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034998", "code": "def split_message(message, max_length):\n    \"\"\"Split large message into smaller messages each smaller than the max_length.\"\"\"\n    ms = []\n    while len(message) > max_length:\n        ms.append(message[:max_length])\n        message = message[max_length:]\n    ms.append(message)\n    return ms", "entry_point": "split_message", "input": "[], 0", "output": "[[]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rahiel/telegram-send/blob/019162232bdc4fc9e986ffcf6e4c5572306c0b82/telegram_send.py#L431-L438", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0034999", "code": "def combine_hex(data):\n    ''' Combine list of integer values to one big integer '''\n    output = 0x00\n    for i, value in enumerate(reversed(data)):\n        output |= (value << i * 8)\n    return output", "entry_point": "combine_hex", "input": "[5, 3, 1, 4]", "output": "84082948", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kipe/enocean/blob/99fa03f47004eef74c7987545c33ecd01af0de07/enocean/utils.py#L10-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035000", "code": "def to_hex_string(data):\n    ''' Convert list of integers to a hex string, separated by \":\" '''\n    if isinstance(data, int):\n        return '%02X' % data\n    return ':'.join([('%02X' % o) for o in data])", "entry_point": "to_hex_string", "input": "[-1, 0, 1, 2]", "output": "'-1:00:01:02'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kipe/enocean/blob/99fa03f47004eef74c7987545c33ecd01af0de07/enocean/utils.py#L30-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035001", "code": "def string_sanitize(string, tab_width=8):\n    r\"\"\"\n    strips, and replaces non-printable characters\n\n    :param tab_width: number of spaces to replace tabs with. Read from\n                      `globals.tabwidth` setting if `None`\n    :type tab_width: int or `None`\n\n    >>> string_sanitize(' foo\\rbar ', 8)\n    ' foobar '\n    >>> string_sanitize('foo\\tbar', 8)\n    'foo     bar'\n    >>> string_sanitize('foo\\t\\tbar', 8)\n    'foo             bar'\n    \"\"\"\n\n    string = string.replace('\\r', '')\n\n    lines = list()\n    for line in string.split('\\n'):\n        tab_count = line.count('\\t')\n\n        if tab_count > 0:\n            line_length = 0\n            new_line = list()\n            for i, chunk in enumerate(line.split('\\t')):\n                line_length += len(chunk)\n                new_line.append(chunk)\n\n                if i < tab_count:\n                    next_tab_stop_in = tab_width - (line_length % tab_width)\n                    new_line.append(' ' * next_tab_stop_in)\n                    line_length += next_tab_stop_in\n            lines.append(''.join(new_line))\n        else:\n            lines.append(line)\n\n    return '\\n'.join(lines)", "entry_point": "string_sanitize", "input": "'Hello World', -3", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pazz/alot/blob/d0297605c0ec1c6b65f541d0fd5b69ac5a0f4ded/alot/helper.py#L55-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035002", "code": "def string_decode(string, enc='ascii'):\n    \"\"\"\n    safely decodes string to unicode bytestring, respecting `enc` as a hint.\n\n    :param string: the string to decode\n    :type string: str or unicode\n    :param enc: a hint what encoding is used in string ('ascii', 'utf-8', ...)\n    :type enc: str\n    :returns: the unicode decoded input string\n    :rtype: unicode\n\n    \"\"\"\n\n    if enc is None:\n        enc = 'ascii'\n    try:\n        string = str(string, enc, errors='replace')\n    except LookupError:  # malformed enc string\n        string = string.decode('ascii', errors='replace')\n    except TypeError:  # already str\n        pass\n    return string", "entry_point": "string_decode", "input": "'Hello World', [5, 3, 1, 4]", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pazz/alot/blob/d0297605c0ec1c6b65f541d0fd5b69ac5a0f4ded/alot/helper.py#L95-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035003", "code": "def shorten(string, maxlen):\n    \"\"\"shortens string if longer than maxlen, appending ellipsis\"\"\"\n    if 1 < maxlen < len(string):\n        string = string[:maxlen - 1] + u'\u2026'\n    return string[:maxlen]", "entry_point": "shorten", "input": "'  padded  ', 0", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pazz/alot/blob/d0297605c0ec1c6b65f541d0fd5b69ac5a0f4ded/alot/helper.py#L119-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035004", "code": "def humanize_size(size):\n    \"\"\"Create a nice human readable representation of the given number\n    (understood as bytes) using the \"KiB\" and \"MiB\" suffixes to indicate\n    kibibytes and mebibytes. A kibibyte is defined as 1024 bytes (as opposed to\n    a kilobyte which is 1000 bytes) and a mibibyte is 1024**2 bytes (as opposed\n    to a megabyte which is 1000**2 bytes).\n\n    :param size: the number to convert\n    :type size: int\n    :returns: the human readable representation of size\n    :rtype: str\n    \"\"\"\n    for factor, format_string in ((1, '%i'),\n                                  (1024, '%iKiB'),\n                                  (1024 * 1024, '%.1fMiB')):\n        if size / factor < 1024:\n            return format_string % (size / factor)\n    return format_string % (size / factor)", "entry_point": "humanize_size", "input": "10", "output": "'10'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pazz/alot/blob/d0297605c0ec1c6b65f541d0fd5b69ac5a0f4ded/alot/helper.py#L504-L521", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035005", "code": "def parse_mailcap_nametemplate(tmplate='%s'):\n    \"\"\"this returns a prefix and suffix to be used\n    in the tempfile module for a given mailcap nametemplate string\"\"\"\n    nt_list = tmplate.split('%s')\n    template_prefix = ''\n    template_suffix = ''\n    if len(nt_list) == 2:\n        template_suffix = nt_list[1]\n        template_prefix = nt_list[0]\n    else:\n        template_suffix = tmplate\n    return (template_prefix, template_suffix)", "entry_point": "parse_mailcap_nametemplate", "input": "'  padded  '", "output": "('', '  padded  ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pazz/alot/blob/d0297605c0ec1c6b65f541d0fd5b69ac5a0f4ded/alot/helper.py#L524-L535", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035006", "code": "def _account_table(accounts):\n        \"\"\"\n        creates a lookup table (emailaddress -> account) for a given list of\n        accounts\n\n        :param accounts: list of accounts\n        :type accounts: list of `alot.account.Account`\n        :returns: hashtable\n        :rvalue: dict (str -> `alot.account.Account`)\n        \"\"\"\n        accountmap = {}\n        for acc in accounts:\n            accountmap[acc.address] = acc\n            for alias in acc.aliases:\n                accountmap[alias] = acc\n        return accountmap", "entry_point": "_account_table", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pazz/alot/blob/d0297605c0ec1c6b65f541d0fd5b69ac5a0f4ded/alot/settings/manager.py#L222-L237", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035007", "code": "def size(default_chunk_size, response_time_max, response_time_actual):\n    \"\"\"Determines the chunk size based on response times.\"\"\"\n    if response_time_actual == 0:\n        response_time_actual = 1\n    scale = 1 / (response_time_actual / response_time_max)\n    size = int(default_chunk_size * scale)\n    return min(max(size, 1), default_chunk_size)", "entry_point": "size", "input": "-1.5, -1.5, -1.5", "output": "-1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/twitterdev/twitter-python-ads-sdk/blob/b4488333ac2a794b85b7f16ded71e98b60e51c74/twitter_ads/utils.py#L61-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035008", "code": "def get_base_url(use_ssl, instance=None, host=None):\n        \"\"\"Formats the base URL either `host` or `instance`\n\n        :return: Base URL string\n        \"\"\"\n\n        if instance is not None:\n            host = (\"%s.service-now.com\" % instance).rstrip('/')\n\n        if use_ssl is True:\n            return \"https://%s\" % host\n\n        return \"http://%s\" % host", "entry_point": "get_base_url", "input": "[[1, 2], [3], []], [1, 2, 3], ['a', 'b', 'c']", "output": "'http://[1, 2, 3].service-now.com'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rbw/pysnow/blob/87c8ce0d3a089c2f59247f30efbd545fcdb8e985/pysnow/url_builder.py#L39-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035009", "code": "def calculate_max_cols_length(table, size):\n    \"\"\"\n    :param table: list of lists:\n\n    [[\"row 1 column 1\", \"row 1 column 2\"],\n     [\"row 2 column 1\", \"row 2 column 2\"]]\n\n    each item consists of instance of urwid.Text\n\n    :returns dict, {index: width}\n    \"\"\"\n    max_cols_lengths = {}\n\n    for row in table:\n        col_index = 0\n        for idx, widget in enumerate(row.widgets):\n            l = widget.pack((size[0], ))[0]\n            max_cols_lengths[idx] = max(max_cols_lengths.get(idx, 0), l)\n            col_index += 1\n\n    max_cols_lengths.setdefault(0, 1)  # in case table is empty\n    return max_cols_lengths", "entry_point": "calculate_max_cols_length", "input": "{}, 7", "output": "{0: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TomasTomecek/sen/blob/239b4868125814e8bf5527708119fc08b35f6cc0/sen/tui/widgets/table.py#L11-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035010", "code": "def humanize_bytes(bytesize, precision=2):\n    \"\"\"\n    Humanize byte size figures\n\n    https://gist.github.com/moird/3684595\n    \"\"\"\n    abbrevs = (\n        (1 << 50, 'PB'),\n        (1 << 40, 'TB'),\n        (1 << 30, 'GB'),\n        (1 << 20, 'MB'),\n        (1 << 10, 'kB'),\n        (1, 'bytes')\n    )\n    if bytesize == 1:\n        return '1 byte'\n    for factor, suffix in abbrevs:\n        if bytesize >= factor:\n            break\n    if factor == 1:\n        precision = 0\n    return '%.*f %s' % (precision, bytesize / float(factor), suffix)", "entry_point": "humanize_bytes", "input": "10, [1, 2, 3]", "output": "'10 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TomasTomecek/sen/blob/239b4868125814e8bf5527708119fc08b35f6cc0/sen/util.py#L60-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035011", "code": "def _datatype_size(datatype, numElms):    # @NoSelf\n        '''\n        Gets datatype size\n\n        Parameters:\n            datatype : int\n                CDF variable data type\n            numElms : int\n                number of elements\n\n        Returns:\n            numBytes : int\n                The number of bytes for the data\n        '''\n        sizes = {1: 1,\n                 2: 2,\n                 4: 4,\n                 8: 8,\n                 11: 1,\n                 12: 2,\n                 14: 4,\n                 21: 4,\n                 22: 8,\n                 31: 8,\n                 32: 16,\n                 33: 8,\n                 41: 1,\n                 44: 4,\n                 45: 8,\n                 51: 1,\n                 52: 1}\n        try:\n            if (isinstance(datatype, int)):\n                if (datatype == 51 or datatype == 52):\n                    return numElms\n                else:\n                    return sizes[datatype]\n            else:\n                datatype = datatype.upper()\n                if (datatype == 'CDF_INT1' or datatype == 'CDF_UINT1' or\n                        datatype == 'CDF_BYTE'):\n                    return 1\n                elif (datatype == 'CDF_INT2' or datatype == 'CDF_UINT2'):\n                    return 2\n                elif (datatype == 'CDF_INT4' or datatype == 'CDF_UINT4'):\n                    return 4\n                elif (datatype == 'CDF_INT8' or datatype == 'CDF_TIME_TT2000'):\n                    return 8\n                elif (datatype == 'CDF_REAL4' or datatype == 'CDF_FLOAT'):\n                    return 4\n                elif (datatype == 'CDF_REAL8' or datatype == 'CDF_DOUBLE' or\n                      datatype == 'CDF_EPOCH'):\n                    return 8\n                elif (datatype == 'CDF_EPOCH16'):\n                    return 16\n                elif (datatype == 'CDF_CHAR' or datatype == 'CDF_UCHAR'):\n                    return numElms\n                else:\n                    return -1\n        except Exception:\n            return -1", "entry_point": "_datatype_size", "input": "[-1, 0, 1, 2], 10", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MAVENSDC/cdflib/blob/d237c60e5db67db0f92d96054209c25c4042465c/cdflib/cdfwrite.py#L1392-L1452", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035012", "code": "def _convert_type(data_type):  # @NoSelf\n        '''\n        Converts CDF data types into python types\n        '''\n        if data_type in (1, 41):\n            dt_string = 'b'\n        elif data_type == 2:\n            dt_string = 'h'\n        elif data_type == 4:\n            dt_string = 'i'\n        elif data_type in (8, 33):\n            dt_string = 'q'\n        elif data_type == 11:\n            dt_string = 'B'\n        elif data_type == 12:\n            dt_string = 'H'\n        elif data_type == 14:\n            dt_string = 'I'\n        elif data_type in (21, 44):\n            dt_string = 'f'\n        elif data_type in (22, 45, 31):\n            dt_string = 'd'\n        elif data_type == 32:\n            dt_string = 'd'\n        elif data_type in (51, 52):\n            dt_string = 's'\n        else:\n            dt_string = ''\n\n        return dt_string", "entry_point": "_convert_type", "input": "[[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MAVENSDC/cdflib/blob/d237c60e5db67db0f92d96054209c25c4042465c/cdflib/cdfwrite.py#L2070-L2099", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035013", "code": "def _make_blocks(records):  # @NoSelf\n        '''\n        Organizes the physical records into blocks in a list by\n        placing consecutive physical records into a single block, so\n        lesser VXRs will be created.\n          [[start_rec1,end_rec1,data_1], [start_rec2,enc_rec2,data_2], ...]\n\n        Parameters:\n            records: list\n                A list of records that there is data for\n\n        Returns:\n            sparse_blocks: list of list\n                A list of ranges we have physical values for.\n\n        Example:\n            Input: [1,2,3,4,10,11,12,13,50,51,52,53]\n            Output: [[1,4],[10,13],[50,53]]\n        '''\n\n        sparse_blocks = []\n        total = len(records)\n        if (total == 0):\n            return []\n\n        x = 0\n        while (x < total):\n            recstart = records[x]\n            y = x\n            recnum = recstart\n\n            # Find the location in the records before the next gap\n            # Call this value \"y\"\n            while ((y+1) < total):\n                y = y + 1\n                nextnum = records[y]\n                diff = nextnum - recnum\n                if (diff == 1):\n                    recnum = nextnum\n                else:\n                    y = y - 1\n                    break\n\n            # Put the values of the records into \"ablock\", append to sparse_blocks\n            ablock = []\n            ablock.append(recstart)\n            if ((y+1) == total):\n                recend = records[total-1]\n            else:\n                recend = records[y]\n            x = y + 1\n            ablock.append(recend)\n            sparse_blocks.append(ablock)\n\n        return sparse_blocks", "entry_point": "_make_blocks", "input": "[1, 2, 3]", "output": "[[1, 3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MAVENSDC/cdflib/blob/d237c60e5db67db0f92d96054209c25c4042465c/cdflib/cdfwrite.py#L2445-L2499", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035014", "code": "def three_partition(x):\n    \"\"\"partition a set of integers in 3 parts of same total value\n\n    :param x: table of non negative values\n    :returns: triplet of the integers encoding the sets, or None otherwise\n    :complexity: :math:`O(2^{2n})`\n    \"\"\"\n    f = [0] * (1 << len(x))\n    for i in range(len(x)):\n        for S in range(1 << i):\n            f[S | (1 << i)] = f[S] + x[i]\n    for A in range(1 << len(x)):\n        for B in range(1 << len(x)):\n            if A & B == 0 and f[A] == f[B] and 3 * f[A] == f[-1]:\n                return (A, B, ((1 << len(x)) - 1) ^ A ^ B)\n    return None", "entry_point": "three_partition", "input": "[]", "output": "(0, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/three_partition.py#L8-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035015", "code": "def min_scalar_prod(x, y):\n    \"\"\"Permute vector to minimize scalar product\n\n    :param x:\n    :param y: x, y are vectors of same size\n    :returns: min sum x[i] * y[sigma[i]] over all permutations sigma\n    :complexity: O(n log n)\n    \"\"\"\n    x = sorted(x)  # make copies\n    y = sorted(y)  # to save arguments\n    return sum(x[i] * y[-i - 1] for i in range(len(x)))", "entry_point": "min_scalar_prod", "input": "[], ['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/scalar.py#L8-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035016", "code": "def closest_values(L):\n    \"\"\"Closest values\n\n    :param L: list of values\n    :returns: two values from L with minimal distance\n    :modifies: the order of L\n    :complexity: O(n log n), for n=len(L)\n    \"\"\"\n    assert len(L) >= 2\n    L.sort()\n    valmin, argmin = min((L[i] - L[i - 1], i) for i in range(1, len(L)))\n    return L[argmin - 1], L[argmin]", "entry_point": "closest_values", "input": "[5, 3, 1, 4]", "output": "(3, 4)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/closest_values.py#L8-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035017", "code": "def majority(L):\n    # snip}\n    \"\"\"Majority\n\n    :param L: list of elements\n    :returns: element that appears most in L,\n             tie breaking with smallest element\n    :complexity: :math:`O(nk)` in average,\n                 where n = len(L) and k = max(w for w in L)\n                 :math:`O(n^2k)` in worst case due to the use of a dictionary\n    \"\"\"\n    assert L    # majorit\u00e9 n'est pas d\u00e9finie sur ensemble vide\n    # snip{\n    count = {}\n    for word in L:\n        if word in count:\n            count[word] += 1\n        else:\n            count[word] = 1\n    valmin, argmin = min((-count[word], word) for word in count)\n    return argmin", "entry_point": "majority", "input": "['apple', 'banana', 'cherry']", "output": "'apple'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/majority.py#L8-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035018", "code": "def floyd_warshall(weight):\n    \"\"\"All pairs shortest paths by Floyd-Warshall\n\n    :param weight: edge weight matrix\n    :modifies: weight matrix to contain distances in graph\n    :returns: True if there are negative cycles\n    :complexity: :math:`O(|V|^3)`\n    \"\"\"\n    V = range(len(weight))\n    for k in V:\n        for u in V:\n            for v in V:\n                weight[u][v] = min(weight[u][v],\n                                   weight[u][k] + weight[k][v])\n    for v in V:\n        if weight[v][v] < 0:      # negative cycle found\n            return True\n    return False", "entry_point": "floyd_warshall", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/floyd_warshall.py#L8-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035019", "code": "def manacher(s):\n    \"\"\"Longest palindrome in a string by Manacher\n\n    :param s: string\n    :requires: s is not empty\n    :returns: i,j such that s[i:j] is the longest palindrome in s\n    :complexity: O(len(s))\n    \"\"\"\n    assert set.isdisjoint({'$', '^', '#'}, s)  # Forbidden letters\n    if s == \"\":\n        return (0, 1)\n    t = \"^#\" + \"#\".join(s) + \"#$\"\n    c = 1\n    d = 1\n    p = [0] * len(t)\n    for i in range(2, len(t) - 1):\n        #                        -- reflect index i with respect to c\n        mirror = 2 * c - i         # = c - (i-c)\n        p[i] = max(0, min(d - i, p[mirror]))\n        #                        -- grow palindrome centered in i\n        while t[i + 1 + p[i]] == t[i - 1 - p[i]]:\n            p[i] += 1\n        #                        -- adjust center if necessary\n        if i + p[i] > d:\n            c = i\n            d = i + p[i]\n    (k, i) = max((p[i], i) for i in range(1, len(t) - 1))\n    return ((i - k) // 2, (i + k) // 2)", "entry_point": "manacher", "input": "['apple', 'banana', 'cherry']", "output": "(4, 6)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/manacher.py#L24-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035020", "code": "def matrix_to_listlist(weight):\n    \"\"\"transforms a squared weight matrix in a adjacency table of type listlist\n    encoding the directed graph corresponding to the entries of the matrix\n    different from None\n\n    :param weight: squared weight matrix, weight[u][v] != None iff arc (u,v) exists\n    :complexity: linear\n    :returns: the unweighted directed graph in the listlist representation,\n                       listlist[u] contains all v for which arc (u,v) exists.\n    \"\"\"\n    graph = [[] for _ in range(len(weight))]\n    for u in range(len(graph)):\n        for v in range(len(graph)):\n            if weight[u][v] != None:\n                graph[u].append(v)\n    return graph", "entry_point": "matrix_to_listlist", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/graph.py#L223-L238", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035021", "code": "def listlist_and_matrix_to_listdict(graph, weight=None):\n    \"\"\"Transforms the weighted adjacency list representation of a graph\n    of type listlist + optional weight matrix\n    into the listdict representation\n\n    :param graph: in listlist representation\n    :param weight: optional weight matrix\n    :returns: graph in listdict representation\n    :complexity: linear\n    \"\"\"\n    if weight:\n        return [{v:weight[u][v] for v in graph[u]} for u in range(len(graph))]\n    else:\n        return [{v:None for v in graph[u]} for u in range(len(graph))]", "entry_point": "listlist_and_matrix_to_listdict", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/graph.py#L241-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035022", "code": "def listdict_to_listlist_and_matrix(sparse):\n    \"\"\"Transforms the adjacency list representation of a graph\n    of type listdict into the listlist + weight matrix representation\n\n    :param sparse: graph in listdict representation\n    :returns: couple with listlist representation, and weight matrix\n    :complexity: linear\n    \"\"\"\n    V = range(len(sparse))\n    graph = [[] for _ in V]\n    weight = [[None for v in V] for u in V]\n    for u in V:\n        for v in sparse[u]:\n            graph[u].append(v)\n            weight[u][v] = sparse[u][v]\n    return graph, weight", "entry_point": "listdict_to_listlist_and_matrix", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/graph.py#L257-L272", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035023", "code": "def dictdict_to_listdict(dictgraph):\n    \"\"\"Transforms a dict-dict graph representation into a\n    adjacency dictionary representation (list-dict)\n\n    :param dictgraph: dictionary mapping vertices to dictionary\n           such that dictgraph[u][v] is weight of arc (u,v)\n    :complexity: linear\n    :returns: tuple with graph (listdict), name_to_node (dict), node_to_name (list)\n    \"\"\"\n    n = len(dictgraph)                            # vertices\n    node_to_name = [name for name in dictgraph]   # bijection indices <-> names\n    node_to_name.sort()                           # to make it more readable\n    name_to_node = {}\n    for i in range(n):\n        name_to_node[node_to_name[i]] = i\n    sparse = [{} for _ in range(n)]               # build sparse graph\n    for u in dictgraph:\n        for v in dictgraph[u]:\n            sparse[name_to_node[u]][name_to_node[v]] = dictgraph[u][v]\n    return sparse, name_to_node, node_to_name", "entry_point": "dictdict_to_listdict", "input": "{}", "output": "([], {}, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/graph.py#L275-L294", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035024", "code": "def make_flow_labels(graph, flow, capac):\n    \"\"\"Generate arc labels for a flow in a graph with capacities.\n\n    :param graph: adjacency list or adjacency dictionary\n    :param flow:  flow matrix or adjacency dictionary\n    :param capac: capacity matrix or adjacency dictionary\n    :returns: listdic graph representation, with the arc label strings\n    \"\"\"\n    V = range(len(graph))\n    arc_label = [{v:\"\" for v in graph[u]} for u in V]\n    for u in V:\n        for v in graph[u]:\n            if flow[u][v] >= 0:\n                arc_label[u][v] = \"%s/%s\" % (flow[u][v], capac[u][v])\n            else:\n                arc_label[u][v] = None   # do not show negative flow arcs\n    return arc_label", "entry_point": "make_flow_labels", "input": "[], [-1, 0, 1, 2], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/graph.py#L320-L336", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035025", "code": "def next_permutation(tab):\n    \"\"\"find the next permutation of tab in the lexicographical order\n\n    :param tab: table with n elements from an ordered set\n    :modifies: table to next permutation\n    :returns: False if permutation is already lexicographical maximal\n    :complexity: O(n)\n    \"\"\"\n    n = len(tab)\n    pivot = None                         # find pivot\n    for i in range(n - 1):\n        if tab[i] < tab[i + 1]:\n            pivot = i\n    if pivot is None:                    # tab is already the last perm.\n        return False\n    for i in range(pivot + 1, n):        # find the element to swap\n        if tab[i] > tab[pivot]:\n            swap = i\n    tab[swap], tab[pivot] = tab[pivot], tab[swap]\n    i = pivot + 1\n    j = n - 1                            # invert suffix\n    while i < j:\n        tab[i], tab[j] = tab[j], tab[i]\n        i += 1\n        j -= 1\n    return True", "entry_point": "next_permutation", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/next_permutation.py#L11-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035026", "code": "def intervals_union(S):\n    \"\"\"Union of intervals\n\n    :param S: list of pairs (low, high) defining intervals [low, high)\n    :returns: ordered list of disjoint intervals with the same union as S\n    :complexity: O(n log n)\n    \"\"\"\n    E = [(low, -1) for (low, high) in S]\n    E += [(high, +1) for (low, high) in S]\n    nb_open = 0\n    last = None\n    retval = []\n    for x, _dir in sorted(E):\n        if _dir == -1:\n            if nb_open == 0:\n                last = x\n            nb_open += 1\n        else:\n            nb_open -= 1\n            if nb_open == 0:\n                retval.append((last, x))\n    return retval", "entry_point": "intervals_union", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/intervals_union.py#L8-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035027", "code": "def binom(n, k):\n    \"\"\"Binomial coefficients for :math:`n \\choose k`\n\n    :param n,k: non-negative integers\n    :complexity: O(k)\n    \"\"\"\n    prod = 1\n    for i in range(k):\n        prod = (prod * (n - i)) // (i + 1)\n    return prod", "entry_point": "binom", "input": "{1, 2, 3}, False", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/arithm.py#L43-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035028", "code": "def rectangles_from_points(S):\n    \"\"\"How many rectangles can be formed from a set of points\n\n    :param S: list of points, as coordinate pairs\n    :returns: the number of rectangles\n    :complexity: :math:`O(n^2)`\n    \"\"\"\n    answ = 0\n    pairs = {}\n    for j in range(len(S)):\n        for i in range(j):\n            px, py = S[i]\n            qx, qy = S[j]\n            center = (px + qx, py + qy)\n            dist = (px - qx) ** 2 + (py - qy) ** 2\n            sign = (center, dist)\n            if sign in pairs:\n                answ += len(pairs[sign])\n                pairs[sign].append((i, j))\n            else:\n                pairs[sign] = [(i, j)]\n    return answ", "entry_point": "rectangles_from_points", "input": "set()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/rectangles_from_points.py#L8-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035029", "code": "def cut_nodes_edges(graph):\n    \"\"\"Bi-connected components\n\n    :param graph: undirected graph. in listlist format. Cannot be in listdict format.\n    :returns: a tuple with the list of cut-nodes and the list of cut-edges\n    :complexity: `O(|V|+|E|)`\n    \"\"\"\n    n = len(graph)\n    time = 0\n    num = [None] * n\n    low = [n] * n\n    father = [None] * n        # father[v] = None if root else father of v\n    critical_childs = [0] * n  # c_c[u] = #childs v s.t. low[v] >= num[u]\n    times_seen = [-1] * n\n    for start in range(n):\n        if times_seen[start] == -1:               # init DFS path\n            times_seen[start] = 0\n            to_visit = [start]\n            while to_visit:\n                node = to_visit[-1]\n                if times_seen[node] == 0:         # start processing\n                    num[node] = time\n                    time += 1\n                    low[node] = float('inf')\n                children = graph[node]\n                if times_seen[node] == len(children):  # end processing\n                    to_visit.pop()\n                    up = father[node]            # propagate low to father\n                    if up is not None:\n                        low[up] = min(low[up], low[node])\n                        if low[node] >= num[up]:\n                            critical_childs[up] += 1\n                else:\n                    child = children[times_seen[node]]   # next arrow\n                    times_seen[node] += 1\n                    if times_seen[child] == -1:   # not visited yet\n                        father[child] = node      # link arrow\n                        times_seen[child] = 0\n                        to_visit.append(child)    # (below) back arrow\n                    elif num[child] < num[node] and father[node] != child:\n                        low[node] = min(low[node], num[child])\n    cut_edges = []\n    cut_nodes = []                                # extract solution\n    for node in range(n):\n        if father[node] is None:                  # characteristics\n            if critical_childs[node] >= 2:\n                cut_nodes.append(node)\n        else:                                     # internal nodes\n            if critical_childs[node] >= 1:\n                cut_nodes.append(node)\n            if low[node] >= num[node]:\n                cut_edges.append((father[node], node))\n    return cut_nodes, cut_edges", "entry_point": "cut_nodes_edges", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/biconnected_components.py#L10-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035030", "code": "def eratosthene(n):\n    \"\"\"Prime numbers by sieve of Eratosthene\n\n    :param n: positive integer\n    :assumes: n > 2\n    :returns: list of prime numbers <n\n    :complexity: O(n loglog n)\n    \"\"\"\n    P = [True] * n\n    answ = [2]\n    for i in range(3, n, 2):\n        if P[i]:\n            answ.append(i)\n            for j in range(2 * i, n, i):\n                P[j] = False\n    return answ", "entry_point": "eratosthene", "input": "False", "output": "[2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/primes.py#L9-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035031", "code": "def rectangles_from_histogram(H):\n    \"\"\"Largest Rectangular Area in a Histogram\n\n    :param H: histogram table\n    :returns: area, left, height, right, rect. is [0, height] * [left, right)\n    :complexity: linear\n    \"\"\"\n    best = (float('-inf'), 0, 0, 0)\n    S = []\n    H2 = H + [float('-inf')]  # extra element to empty the queue\n    for right in range(len(H2)):\n        x = H2[right]\n        left = right\n        while len(S) > 0 and S[-1][1] >= x:\n            left, height = S.pop()\n            # first element is area of candidate\n            rect = (height * (right - left), left, height, right)\n            if rect > best:\n                best = rect\n        S.append((left, x))\n    return best", "entry_point": "rectangles_from_histogram", "input": "[-1, 0, 1, 2]", "output": "(2, 3, 2, 4)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/rectangles_from_histogram.py#L8-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035032", "code": "def topological_order_dfs(graph):\n    \"\"\"Topological sorting by depth first search\n\n    :param graph: directed graph in listlist format, cannot be listdict\n    :returns: list of vertices in order\n    :complexity: `O(|V|+|E|)`\n    \"\"\"\n    n = len(graph)\n    order = []\n    times_seen = [-1] * n\n    for start in range(n):\n        if times_seen[start] == -1:\n            times_seen[start] = 0\n            to_visit = [start]\n            while to_visit:\n                node = to_visit[-1]\n                children = graph[node]\n                if times_seen[node] == len(children):\n                    to_visit.pop()\n                    order.append(node)\n                else:\n                    child = children[times_seen[node]]\n                    times_seen[node] += 1\n                    if times_seen[child] == -1:\n                        times_seen[child] = 0\n                        to_visit.append(child)\n    return order[::-1]", "entry_point": "topological_order_dfs", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/topological_order.py#L8-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035033", "code": "def topological_order(graph):\n    \"\"\"Topological sorting by maintaining indegree\n\n    :param graph: directed graph in listlist format, cannot be listdict\n    :returns: list of vertices in order\n    :complexity: `O(|V|+|E|)`\n    \"\"\"\n    V = range(len(graph))\n    indeg = [0 for _ in V]\n    for node in V:            # compute indegree\n        for neighbor in graph[node]:\n            indeg[neighbor] += 1\n    Q = [node for node in V if indeg[node] == 0]\n    order = []\n    while Q:\n        node = Q.pop()        # node without incoming arrows\n        order.append(node)\n        for neighbor in graph[node]:\n            indeg[neighbor] -= 1\n            if indeg[neighbor] == 0:\n                Q.append(neighbor)\n    return order", "entry_point": "topological_order", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/topological_order.py#L39-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035034", "code": "def permutation_rank(p):\n    \"\"\"Given a permutation of {0,..,n-1} find its rank according to lexicographical order\n\n       :param p: list of length n containing all integers from 0 to n-1\n       :returns: rank between 0 and n! -1\n       :beware: computation with big numbers\n       :complexity: `O(n^2)`\n    \"\"\"\n    n = len(p)\n    fact = 1                                 # compute (n-1) factorial\n    for i in range(2, n):\n        fact *= i\n    r = 0                                    # compute rank of p\n    digits = list(range(n))                  # all yet unused digits\n    for i in range(n-1):                     # for all digits except last one\n        q = digits.index(p[i])\n        r += fact * q\n        del digits[q]                        # remove this digit p[i]\n        fact //= (n - 1 - i)                 # weight of next digit\n    return r", "entry_point": "permutation_rank", "input": "[1, 2, 3]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/permutation_rank.py#L7-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035035", "code": "def merge(x, y):\n    \"\"\"Merge two ordered lists\n\n    :param x:\n    :param y: x,y are non decreasing ordered lists\n    :returns: union of x and y in order\n    :complexity: linear\n    \"\"\"\n    z = []\n    i = 0\n    j = 0\n    while i < len(x) or j < len(y):\n        if j == len(y) or i < len(x) and x[i] <= y[j]:  # priority on x\n            z.append(x[i])\n            i += 1\n        else:\n            z.append(y[j])\n            j += 1\n    return z", "entry_point": "merge", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2, 5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/merge_ordered_lists.py#L8-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035036", "code": "def maximum_border_length(w):\n    \"\"\"Maximum string borders by Knuth-Morris-Pratt\n\n    :param w: string\n    :returns: table f such that f[i] is the longest border length of w[:i + 1]\n    :complexity: linear\n    \"\"\"\n    n = len(w)\n    f = [0] * n                # init f[0] = 0\n    k = 0                      # current longest border length\n    for i in range(1, n):      # compute f[i]\n        while w[k] != w[i] and k > 0:\n            k = f[k - 1]       # try shorter lengths\n        if w[k] == w[i]:       # last caracters match\n            k += 1             # we can increment the border length\n        f[i] = k               # we found the maximal border of w[:i + 1]\n    return f", "entry_point": "maximum_border_length", "input": "['apple', 'banana', 'cherry']", "output": "[0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/knuth_morris_pratt.py#L10-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035037", "code": "def matrix_mult_opt_order(M):\n    \"\"\"Matrix chain multiplication optimal order\n\n    :param M: list of matrices\n    :returns: matrices opt, arg, such that opt[i][j] is the optimal number of\n              operations to compute M[i] * ... * M[j] when done in the order\n              (M[i] * ... * M[k]) * (M[k + 1] * ... * M[j]) for k = arg[i][j]\n    :complexity: :math:`O(n^2)`\n    \"\"\"\n    n = len(M)\n    r = [len(Mi) for Mi in M]\n    c = [len(Mi[0]) for Mi in M]\n    opt = [[0 for j in range(n)] for i in range(n)]\n    arg = [[None for j in range(n)] for i in range(n)]\n    for j_i in range(1, n):   # loop on i, j of increasing j - i = j_i\n        for i in range(n - j_i):\n            j = i + j_i\n            opt[i][j] = float('inf')\n            for k in range(i, j):\n                alt = opt[i][k] + opt[k + 1][j] + r[i] * c[k] * c[j]\n                if opt[i][j] > alt:\n                    opt[i][j] = alt\n                    arg[i][j] = k\n    return opt, arg", "entry_point": "matrix_mult_opt_order", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/matrix_chain_mult.py#L9-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035038", "code": "def levenshtein(x, y):\n    \"\"\"Levenshtein edit distance\n\n    :param x:\n    :param y: strings\n    :returns: distance\n    :complexity: `O(|x|*|y|)`\n    \"\"\"\n    n = len(x)\n    m = len(y)\n    #                         initializing row 0 and column 0\n    A = [[i + j for j in range(m + 1)] for i in range(n + 1)]\n    for i in range(n):\n        for j in range(m):\n            A[i + 1][j + 1] = min(A[i][j + 1] + 1,              # insert\n                                  A[i + 1][j] + 1,              # delete\n                                  A[i][j] + int(x[i] != y[j]))  # subst.\n    return A[n][m]", "entry_point": "levenshtein", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/levenshtein.py#L8-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035039", "code": "def is_eulerian_tour(graph, tour):\n    \"\"\"Eulerian tour on an undirected graph\n\n       :param graph: directed graph in listlist format, cannot be listdict\n       :param tour: vertex list\n       :returns: test if tour is eulerian\n       :complexity: `O(|V|*|E|)` under the assumption that set membership is in constant time\n    \"\"\"\n    m = len(tour)-1\n    arcs = set((tour[i], tour[i+1]) for i in range(m))\n    if len(arcs) != m:\n        return False\n    for (u,v) in arcs:\n        if v not in graph[u]:\n            return False\n    return True", "entry_point": "is_eulerian_tour", "input": "10, []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/eulerian_tour.py#L104-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035040", "code": "def longest_common_subsequence(x, y):\n    \"\"\"Longest common subsequence\n\n    Dynamic programming\n\n    :param x:\n    :param y: x, y are lists or strings\n    :returns: longest common subsequence in form of a string\n    :complexity: `O(|x|*|y|)`\n    \"\"\"\n    n = len(x)\n    m = len(y)\n    #                      -- compute optimal length\n    A = [[0 for j in range(m + 1)] for i in range(n + 1)]\n    for i in range(n):\n        for j in range(m):\n            if x[i] == y[j]:\n                A[i + 1][j + 1] = A[i][j] + 1\n            else:\n                A[i + 1][j + 1] = max(A[i][j + 1],  A[i + 1][j])\n    #                      -- extract solution\n    sol = []\n    i, j = n, m\n    while A[i][j] > 0:\n        if A[i][j] == A[i - 1][j]:\n            i -= 1\n        elif A[i][j] == A[i][j - 1]:\n            j -= 1\n        else:\n            i -= 1\n            j -= 1\n            sol.append(x[i])\n    return ''.join(sol[::-1])", "entry_point": "longest_common_subsequence", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/longest_common_subsequence.py#L8-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035041", "code": "def arithm_expr_target(x, target):\n    \"\"\" Create arithmetic expression approaching target value\n    :param x: allowed constants\n    :param target: target value\n    :returns: string in form 'expression=value'\n    :complexity: huge\n    \"\"\"\n    n = len(x)\n    expr = [{} for _ in range(1 << n)]\n    # expr[S][val]\n    # = string solely composed of values in set S that evaluates to val\n    for i in range(n):\n        expr[1 << i] = {x[i]: str(x[i])}   # store singletons\n    all_ = (1 << n) - 1\n    for S in range(3, all_ + 1):  # 3: first num that isn't a power of 2\n        if expr[S] != {}:\n            continue            # in that case S is a power of 2\n        for L in range(1, S):   # decompose set S into non-empty sets L, R\n            if L & S == L:\n                R = S ^ L\n                for vL in expr[L]:         # combine expressions from L\n                    for vR in expr[R]:     # with expressions from R\n                        eL = expr[L][vL]\n                        eR = expr[R][vR]\n                        expr[S][vL] = eL\n                        if vL > vR:    # difference cannot become negative\n                            expr[S][vL - vR] = \"(%s-%s)\" % (eL, eR)\n                        if L < R:      # break symmetry\n                            expr[S][vL + vR] = \"(%s+%s)\" % (eL, eR)\n                            expr[S][vL * vR] = \"(%s*%s)\" % (eL, eR)\n                        if vR != 0 and vL % vR == 0:  # only integer div\n                            expr[S][vL // vR] = \"(%s/%s)\" % (eL, eR)\n    # look for the closest expression from the target\n    for dist in range(target + 1):\n        for sign in [-1, +1]:\n            val = target + sign * dist\n            if val in expr[all_]:\n                return \"%s=%i\" % (expr[all_][val], val)\n    # never reaches here if x contains integers between 0 and target\n    pass", "entry_point": "arithm_expr_target", "input": "[1, 2, 3], 3", "output": "'(3/1)=3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/arithm_expr_target.py#L8-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035042", "code": "def subset_sum(x, R):\n    \"\"\"Subsetsum\n\n    :param x: table of non negative values\n    :param R: target value\n    :returns bool: True if a subset of x sums to R\n    :complexity: O(n*R)\n    \"\"\"\n    b = [False] * (R + 1)\n    b[0] = True\n    for xi in x:\n        for s in range(R, xi - 1, -1):\n            b[s] |= b[s - xi]\n    return b[R]", "entry_point": "subset_sum", "input": "set(), 0", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/subsetsum.py#L8-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035043", "code": "def max_interval_intersec(S):\n    \"\"\"determine a value that is contained in a largest number of given intervals\n\n    :param S: list of half open intervals\n    :complexity: O(n log n), where n = len(S)\n    \"\"\"\n    B = ([(left,  +1) for left, right in S] +\n         [(right, -1) for left, right in S])\n    B.sort()\n    c = 0\n    best = (c, None)\n    for x, d in B:\n        c += d\n        if best[0] < c:\n            best = (c, x)\n    return best", "entry_point": "max_interval_intersec", "input": "[]", "output": "(0, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/max_interval_intersec.py#L8-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035044", "code": "def discrete_binary_search(tab, lo, hi):\n    \"\"\"Binary search in a table\n\n    :param tab: boolean monotone table with tab[hi] = True\n    :param int lo:\n    :param int hi: with hi >= lo\n    :returns: first index i in [lo,hi] such that tab[i]\n    :complexity: `O(log(hi-lo))`\n    \"\"\"\n    while lo < hi:\n        mid = lo + (hi - lo) // 2\n        if tab[mid]:\n            hi = mid\n        else:\n            lo = mid + 1\n    return lo", "entry_point": "discrete_binary_search", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/binary_search.py#L26-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035045", "code": "def optimized_binary_search_lower(tab, logsize):\n    \"\"\"Binary search in a table using bit operations\n\n    :param tab: boolean monotone table\n       of size :math:`2^\\\\textrm{logsize}`\n       with tab[0] = False\n    :param int logsize:\n    :returns: last i such that not tab[i]\n    :complexity: O(logsize)\n    \"\"\"\n    lo = 0\n    intervalsize = (1 << logsize) >> 1\n    while intervalsize > 0:\n        if not tab[lo | intervalsize]:\n            lo |= intervalsize\n        intervalsize >>= 1\n    return lo", "entry_point": "optimized_binary_search_lower", "input": "['a', 'b', 'c'], 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/binary_search.py#L68-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035046", "code": "def optimized_binary_search(tab, logsize):\n    \"\"\"Binary search in a table using bit operations\n\n    :param tab: boolean monotone table\n       of size :math:`2^\\\\textrm{logsize}`\n       with tab[hi] = True\n    :param int logsize:\n    :returns: first i such that tab[i]\n    :complexity: O(logsize)\n    \"\"\"\n    hi = (1 << logsize) - 1\n    intervalsize = (1 << logsize) >> 1\n    while intervalsize > 0:\n        if tab[hi ^ intervalsize]:\n            hi ^= intervalsize\n        intervalsize >>= 1\n    return hi", "entry_point": "optimized_binary_search", "input": "[-1, 0, 1, 2], 1", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/binary_search.py#L88-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035047", "code": "def anagrams(w):\n    \"\"\"group a list of words into anagrams\n\n    :param w: list of strings\n    :returns: list of lists\n\n    :complexity:\n        :math:`O(n k \\log k)` in average, for n words of length at most k.\n        :math:`O(n^2 k \\log k)` in worst case due to the usage of a dictionary.\n    \"\"\"\n    w = list(set(w))             # remove duplicates\n    d = {}                       # group words according to some signature\n    for i in range(len(w)):\n        s = ''.join(sorted(w[i]))  # signature\n        if s in d:\n            d[s].append(i)\n        else:\n            d[s] = [i]\n    # -- extract anagrams\n    answer = []\n    for s in d:\n        if len(d[s]) > 1:          # ignore words without anagram\n            answer.append([w[i] for i in d[s]])\n    return answer", "entry_point": "anagrams", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/anagrams.py#L9-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035048", "code": "def tarjan(graph):\n    \"\"\"Strongly connected components by Tarjan, iterative implementation\n\n    :param graph: directed graph in listlist format, cannot be listdict\n    :returns: list of lists for each component\n    :complexity: linear\n    \"\"\"\n    n = len(graph)\n    dfs_num = [None] * n\n    dfs_min = [n] * n\n    waiting = []\n    waits = [False] * n  # invariant: waits[v] iff v in waiting\n    sccp = []          # list of detected components\n    dfs_time = 0\n    times_seen = [-1] * n\n    for start in range(n):\n        if times_seen[start] == -1:                    # initiate path\n            times_seen[start] = 0\n            to_visit = [start]\n            while to_visit:\n                node = to_visit[-1]                    # top of stack\n                if times_seen[node] == 0:              # start process\n                    dfs_num[node] = dfs_time\n                    dfs_min[node] = dfs_time\n                    dfs_time += 1\n                    waiting.append(node)\n                    waits[node] = True\n                children = graph[node]\n                if times_seen[node] == len(children):  # end of process\n                    to_visit.pop()                     # remove from stack\n                    dfs_min[node] = dfs_num[node]      # compute dfs_min\n                    for child in children:\n                        if waits[child] and dfs_min[child] < dfs_min[node]:\n                            dfs_min[node] = dfs_min[child]\n                    if dfs_min[node] == dfs_num[node]:  # representative\n                        component = []                 # make component\n                        while True:                    # add nodes\n                            u = waiting.pop()\n                            waits[u] = False\n                            component.append(u)\n                            if u == node:              # until repr.\n                                break\n                        sccp.append(component)\n                else:\n                    child = children[times_seen[node]]\n                    times_seen[node] += 1\n                    if times_seen[child] == -1:        # not visited yet\n                        times_seen[child] = 0\n                        to_visit.append(child)\n    return sccp", "entry_point": "tarjan", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/strongly_connected_components.py#L55-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035049", "code": "def reverse(graph):\n    \"\"\"replace all arcs (u, v) by arcs (v, u) in a graph\"\"\"\n    rev_graph = [[] for node in graph]\n    for node in range(len(graph)):\n        for neighbor in graph[node]:\n            rev_graph[neighbor].append(node)\n    return rev_graph", "entry_point": "reverse", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jilljenn/tryalgo/blob/89a4dd9655e7b6b0a176f72b4c60d0196420dfe1/tryalgo/strongly_connected_components.py#L131-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035050", "code": "def safe_trim(qty_as_string):\n    '''\n    Safe trimming means the following:\n        1.0010000 -> 1.001\n        1.0 -> 1.0 (no change)\n        1.0000001 -> 1.0000001 (no change)\n    '''\n    qty_formatted = qty_as_string\n    if '.' in qty_as_string:\n        # only affect numbers with decimals\n        while True:\n            if qty_formatted[-1] == '0' and qty_formatted[-2] != '.':\n                qty_formatted = qty_formatted[:-1]\n            else:\n                break\n\n    return qty_formatted", "entry_point": "safe_trim", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockcypher/blockcypher-python/blob/7601ea21916957ff279384fd699527ff9c28a56e/blockcypher/utils.py#L69-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035051", "code": "def compress_txn_outputs(txn_outputs):\n    '''\n    Take a list of txn ouputs (from get_txn_outputs output of pybitcointools)\n    and compress it to the sum of satoshis sent to each address in a dictionary.\n\n    Returns a dict of the following form:\n        {'1abc...': 12345, '1def': 54321, ...}\n    '''\n    result_dict = {}\n    outputs = (output for output in txn_outputs if output.get('address'))\n    for txn_output in outputs:\n        if txn_output['address'] in result_dict:\n            result_dict[txn_output['address']] += txn_output['value']\n        else:\n            result_dict[txn_output['address']] = txn_output['value']\n    return result_dict", "entry_point": "compress_txn_outputs", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockcypher/blockcypher-python/blob/7601ea21916957ff279384fd699527ff9c28a56e/blockcypher/utils.py#L204-L219", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035052", "code": "def distance_calc(s1, s2):\n    \"\"\"\n    Calculate Levenshtein distance between two words.\n\n    :param s1: first word\n    :type s1 : str\n    :param s2: second word\n    :type s2 : str\n    :return: distance between two word\n\n    References :\n    1- https://stackoverflow.com/questions/2460177/edit-distance-in-python\n    2- https://en.wikipedia.org/wiki/Levenshtein_distance\n    \"\"\"\n    if len(s1) > len(s2):\n        s1, s2 = s2, s1\n\n    distances = range(len(s1) + 1)\n    for i2, c2 in enumerate(s2):\n        distances_ = [i2 + 1]\n        for i1, c1 in enumerate(s1):\n            if c1 == c2:\n                distances_.append(distances[i1])\n            else:\n                distances_.append(\n                    1 + min((distances[i1], distances[i1 + 1], distances_[-1])))\n        distances = distances_\n    return distances[-1]", "entry_point": "distance_calc", "input": "[1, 2, 3], []", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sepandhaghighi/art/blob/c5b0409de76464b0714c377f8fca17716f3a9482/art/art.py#L249-L276", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035053", "code": "def three_digit(number):\n    \"\"\" Add 0s to inputs that their length is less than 3.\n\n    :param number:\n        The number to convert\n    :type number:\n        int\n\n    :returns:\n        String\n\n    :example:\n        >>> three_digit(1)\n        '001'\n    \"\"\"\n    number = str(number)\n    if len(number) == 1:\n        return u'00%s' % number\n    elif len(number) == 2:\n        return u'0%s' % number\n    else:\n        return number", "entry_point": "three_digit", "input": "7", "output": "'007'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/developmentseed/landsat-util/blob/92dc81771ddaa64a8a9124a89a6516b52485374b/landsat/utils.py#L167-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035054", "code": "def google_text_emphasis(style):\n    \"\"\"return a list of all emphasis modifiers of the element\"\"\"\n    emphasis = []\n    if 'text-decoration' in style:\n        emphasis.append(style['text-decoration'])\n    if 'font-style' in style:\n        emphasis.append(style['font-style'])\n    if 'font-weight' in style:\n        emphasis.append(style['font-weight'])\n    return emphasis", "entry_point": "google_text_emphasis", "input": "[[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iamaziz/PyDataset/blob/789c0ca7587b86343f636b132dcf1f475ee6b90b/pydataset/utils/html2text.py#L154-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035055", "code": "def google_fixed_width_font(style):\n    \"\"\"check if the css of the current element defines a fixed width font\"\"\"\n    font_family = ''\n    if 'font-family' in style:\n        font_family = style['font-family']\n    if 'Courier New' == font_family or 'Consolas' == font_family:\n        return True\n    return False", "entry_point": "google_fixed_width_font", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iamaziz/PyDataset/blob/789c0ca7587b86343f636b132dcf1f475ee6b90b/pydataset/utils/html2text.py#L165-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035056", "code": "def flags_from_dict(kw):\n    \"\"\"\n    This turns a dict with keys that are flags (e.g. for CLOSECIRCUIT,\n    CLOSESTREAM) only if the values are true.\n    \"\"\"\n\n    if len(kw) == 0:\n        return ''\n\n    flags = ''\n    for (k, v) in kw.items():\n        if v:\n            flags += ' ' + str(k)\n    # note that we want the leading space if there's at least one\n    # flag.\n    return flags", "entry_point": "flags_from_dict", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/meejah/txtorcon/blob/14053b95adf0b4bd9dd9c317bece912a26578a93/txtorcon/torstate.py#L152-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035057", "code": "def _apply_color(code, content):\n        \"\"\"\n        Apply a color code to text\n        \"\"\"\n\n        normal = u'\\x1B[0m'\n        seq = u'\\x1B[%sm' % code\n\n        # Replace any normal sequences with this sequence to support nested colors\n        return seq + (normal + seq).join(content.split(normal)) + normal", "entry_point": "_apply_color", "input": "[], 'AbC dEf'", "output": "'\\x1b[[]mAbC dEf\\x1b[0m'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Rockhopper-Technologies/enlighten/blob/857855f940e6c1bb84d0be849b999a18fff5bf5a/enlighten/_win_terminal.py#L152-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035058", "code": "def _format_time(seconds):\n    \"\"\"\n    Args:\n        seconds (float): amount of time\n\n    Format time string for eta and elapsed\n    \"\"\"\n\n    # Always do minutes and seconds in mm:ss format\n    minutes = seconds // 60\n    hours = minutes // 60\n    rtn = u'{0:02.0f}:{1:02.0f}'.format(minutes % 60, seconds % 60)\n\n    #  Add hours if there are any\n    if hours:\n\n        rtn = u'{0:d}h {1}'.format(int(hours % 24), rtn)\n\n        #  Add days if there are any\n        days = int(hours // 24)\n        if days:\n            rtn = u'{0:d}d {1}'.format(days, rtn)\n\n    return rtn", "entry_point": "_format_time", "input": "False", "output": "'00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Rockhopper-Technologies/enlighten/blob/857855f940e6c1bb84d0be849b999a18fff5bf5a/enlighten/_counter.py#L44-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035059", "code": "def levelize_smooth_or_improve_candidates(to_levelize, max_levels):\n    \"\"\"Turn parameter in to a list per level.\n\n    Helper function to preprocess the smooth and improve_candidates\n    parameters passed to smoothed_aggregation_solver and rootnode_solver.\n\n    Parameters\n    ----------\n    to_levelize : {string, tuple, list}\n        Parameter to preprocess, i.e., levelize and convert to a level-by-level\n        list such that entry i specifies the parameter at level i\n    max_levels : int\n        Defines the maximum number of levels considered\n\n    Returns\n    -------\n    to_levelize : list\n        The parameter list such that entry i specifies the parameter choice\n        at level i.\n\n    Notes\n    --------\n    This routine is needed because the user will pass in a parameter option\n    such as smooth='jacobi', or smooth=['jacobi', None], and this option must\n    be \"levelized\", or converted to a list of length max_levels such that entry\n    [i] in that list is the parameter choice for level i.\n\n    The parameter choice in to_levelize can be a string, tuple or list.  If\n    it is a string or tuple, then that option is assumed to be the\n    parameter setting at every level.  If to_levelize is inititally a list,\n    if the length of the list is less than max_levels, the last entry in the\n    list defines that parameter for all subsequent levels.\n\n    Examples\n    --------\n    >>> from pyamg.util.utils import levelize_smooth_or_improve_candidates\n    >>> improve_candidates = ['gauss_seidel', None]\n    >>> levelize_smooth_or_improve_candidates(improve_candidates, 4)\n    ['gauss_seidel', None, None, None]\n\n    \"\"\"\n    if isinstance(to_levelize, tuple) or isinstance(to_levelize, str):\n        to_levelize = [to_levelize for i in range(max_levels)]\n    elif isinstance(to_levelize, list):\n        if len(to_levelize) < max_levels:\n            mlz = max_levels - len(to_levelize)\n            toext = [to_levelize[-1] for i in range(mlz)]\n            to_levelize.extend(toext)\n    elif to_levelize is None:\n        to_levelize = [(None, {}) for i in range(max_levels)]\n\n    return to_levelize", "entry_point": "levelize_smooth_or_improve_candidates", "input": "-3, []", "output": "-3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyamg/pyamg/blob/89dc54aa27e278f65d2f54bdaf16ab97d7768fa6/pyamg/util/utils.py#L1937-L1988", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035060", "code": "def format_arg(arg):\n    '''formats an argument to be shown\n    '''\n\n    s = str(arg)\n    dot = s.rfind('.')\n    if dot >= 0:\n        s = s[dot + 1:]\n\n    s = s.replace(';', '')\n    s = s.replace('[]', 'Array')\n    if len(s) > 0:\n        c = s[0].lower()\n        s = c + s[1:]\n\n    return s", "entry_point": "format_arg", "input": "['a', 'b', 'c']", "output": "\"['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/_pydev_bundle/_pydev_jy_imports_tipper.py#L376-L391", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035061", "code": "def _strip_comments(line, comments=None):\n        \"\"\"Removes comments from import line.\"\"\"\n        if comments is None:\n            comments = []\n\n        new_comments = False\n        comment_start = line.find(\"#\")\n        if comment_start != -1:\n            comments.append(line[comment_start + 1:].strip())\n            new_comments = True\n            line = line[:comment_start]\n\n        return line, comments, new_comments", "entry_point": "_strip_comments", "input": "'abc', ['a', 'b', 'c']", "output": "('abc', ['a', 'b', 'c'], False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/isort_container/isort/isort.py#L697-L709", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035062", "code": "def printable(data):\n        \"\"\"\n        Replace unprintable characters with dots.\n\n        @type  data: str\n        @param data: Binary data.\n\n        @rtype:  str\n        @return: Printable text.\n        \"\"\"\n        result = ''\n        for c in data:\n            if 32 < ord(c) < 128:\n                result += c\n            else:\n                result += '.'\n        return result", "entry_point": "printable", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/pydevd_attach_to_process/winappdbg/textio.py#L516-L532", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035063", "code": "def dump_flags(efl):\n        \"\"\"\n        Dump the x86 processor flags.\n        The output mimics that of the WinDBG debugger.\n        Used by L{dump_registers}.\n\n        @type  efl: int\n        @param efl: Value of the eFlags register.\n\n        @rtype:  str\n        @return: Text suitable for logging.\n        \"\"\"\n        if efl is None:\n            return ''\n        efl_dump = 'iopl=%1d' % ((efl & 0x3000) >> 12)\n        if efl & 0x100000:\n            efl_dump += ' vip'\n        else:\n            efl_dump += '    '\n        if efl & 0x80000:\n            efl_dump += ' vif'\n        else:\n            efl_dump += '    '\n        # 0x20000 ???\n        if efl & 0x800:\n            efl_dump += ' ov'       # Overflow\n        else:\n            efl_dump += ' no'       # No overflow\n        if efl & 0x400:\n            efl_dump += ' dn'       # Downwards\n        else:\n            efl_dump += ' up'       # Upwards\n        if efl & 0x200:\n            efl_dump += ' ei'       # Enable interrupts\n        else:\n            efl_dump += ' di'       # Disable interrupts\n        # 0x100 trap flag\n        if efl & 0x80:\n            efl_dump += ' ng'       # Negative\n        else:\n            efl_dump += ' pl'       # Positive\n        if efl & 0x40:\n            efl_dump += ' zr'       # Zero\n        else:\n            efl_dump += ' nz'       # Nonzero\n        if efl & 0x10:\n            efl_dump += ' ac'       # Auxiliary carry\n        else:\n            efl_dump += ' na'       # No auxiliary carry\n        # 0x8 ???\n        if efl & 0x4:\n            efl_dump += ' pe'       # Parity odd\n        else:\n            efl_dump += ' po'       # Parity even\n        # 0x2 ???\n        if efl & 0x1:\n            efl_dump += ' cy'       # Carry\n        else:\n            efl_dump += ' nc'       # No carry\n        return efl_dump", "entry_point": "dump_flags", "input": "False", "output": "'iopl=0         no up di pl nz na po nc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/pydevd_attach_to_process/winappdbg/textio.py#L1234-L1293", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035064", "code": "def parse_label(module = None, function = None, offset = None):\n        \"\"\"\n        Creates a label from a module and a function name, plus an offset.\n\n        @warning: This method only creates the label, it doesn't make sure the\n            label actually points to a valid memory location.\n\n        @type  module: None or str\n        @param module: (Optional) Module name.\n\n        @type  function: None, str or int\n        @param function: (Optional) Function name or ordinal.\n\n        @type  offset: None or int\n        @param offset: (Optional) Offset value.\n\n            If C{function} is specified, offset from the function.\n\n            If C{function} is C{None}, offset from the module.\n\n        @rtype:  str\n        @return:\n            Label representing the given function in the given module.\n\n        @raise ValueError:\n            The module or function name contain invalid characters.\n        \"\"\"\n\n        # TODO\n        # Invalid characters should be escaped or filtered.\n\n        # Convert ordinals to strings.\n        try:\n            function = \"#0x%x\" % function\n        except TypeError:\n            pass\n\n        # Validate the parameters.\n        if module is not None and ('!' in module or '+' in module):\n            raise ValueError(\"Invalid module name: %s\" % module)\n        if function is not None and ('!' in function or '+' in function):\n            raise ValueError(\"Invalid function name: %s\" % function)\n\n        # Parse the label.\n        if module:\n            if function:\n                if offset:\n                    label = \"%s!%s+0x%x\" % (module, function, offset)\n                else:\n                    label = \"%s!%s\" % (module, function)\n            else:\n                if offset:\n##                    label = \"%s+0x%x!\" % (module, offset)\n                    label = \"%s!0x%x\" % (module, offset)\n                else:\n                    label = \"%s!\" % module\n        else:\n            if function:\n                if offset:\n                    label = \"!%s+0x%x\" % (function, offset)\n                else:\n                    label = \"!%s\" % function\n            else:\n                if offset:\n                    label = \"0x%x\" % offset\n                else:\n                    label = \"0x0\"\n\n        return label", "entry_point": "parse_label", "input": "[], [-1, 0, 1, 2], []", "output": "'![-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/pydevd_attach_to_process/winappdbg/module.py#L1104-L1172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035065", "code": "def get_c_option_index(args):\n    \"\"\"\n    Get index of \"-c\" argument and check if it's interpreter's option\n    :param args: list of arguments\n    :return: index of \"-c\" if it's an interpreter's option and -1 if it doesn't exist or program's option\n    \"\"\"\n    try:\n        ind_c = args.index('-c')\n    except ValueError:\n        return -1\n    else:\n        for i in range(1, ind_c):\n            if not args[i].startswith('-'):\n                # there is an arg without \"-\" before \"-c\", so it's not an interpreter's option\n                return -1\n        return ind_c", "entry_point": "get_c_option_index", "input": "[1, 2, 3]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/_pydev_bundle/pydev_monkey.py#L123-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035066", "code": "def _get_indentation(line):\n    \"\"\"Return leading whitespace.\"\"\"\n    if line.strip():\n        non_whitespace_index = len(line) - len(line.lstrip())\n        return line[:non_whitespace_index]\n    else:\n        return ''", "entry_point": "_get_indentation", "input": "'abc'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/pep8/autopep8.py#L1430-L1436", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035067", "code": "def normalize_multiline(line):\n    \"\"\"Normalize multiline-related code that will cause syntax error.\n\n    This is for purposes of checking syntax.\n\n    \"\"\"\n    if line.startswith('def ') and line.rstrip().endswith(':'):\n        return line + ' pass'\n    elif line.startswith('return '):\n        return 'def _(): ' + line\n    elif line.startswith('@'):\n        return line + 'def _(): pass'\n    elif line.startswith('class '):\n        return line + ' pass'\n    elif line.startswith(('if ', 'elif ', 'for ', 'while ')):\n        return line + ' pass'\n    else:\n        return line", "entry_point": "normalize_multiline", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/pep8/autopep8.py#L2521-L2538", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035068", "code": "def argv_to_cmdline(argv):\n        \"\"\"\n        Convert a list of arguments to a single command line string.\n\n        @type  argv: list( str )\n        @param argv: List of argument strings.\n            The first element is the program to execute.\n\n        @rtype:  str\n        @return: Command line string.\n        \"\"\"\n        cmdline = list()\n        for token in argv:\n            if not token:\n                token = '\"\"'\n            else:\n                if '\"' in token:\n                    token = token.replace('\"', '\\\\\"')\n                if  ' ' in token  or \\\n                    '\\t' in token or \\\n                    '\\n' in token or \\\n                    '\\r' in token:\n                        token = '\"%s\"' % token\n            cmdline.append(token)\n        return ' '.join(cmdline)", "entry_point": "argv_to_cmdline", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/pydevd_attach_to_process/winappdbg/process.py#L4087-L4111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035069", "code": "def _get_normal_name(orig_enc):\n    \"\"\"Imitates get_normal_name in tokenizer.c.\"\"\"\n    # Only care about the first 12 characters.\n    enc = orig_enc[:12].lower().replace(\"_\", \"-\")\n    if enc == \"utf-8\" or enc.startswith(\"utf-8-\"):\n        return \"utf-8\"\n    if enc in (\"latin-1\", \"iso-8859-1\", \"iso-latin-1\") or \\\n       enc.startswith((\"latin-1-\", \"iso-8859-1-\", \"iso-latin-1-\")):\n        return \"iso-8859-1\"\n    return orig_enc", "entry_point": "_get_normal_name", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/pep8/lib2to3/lib2to3/pgen2/tokenize.py#L241-L250", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035070", "code": "def expand_indent(line):\n    r\"\"\"Return the amount of indentation.\n\n    Tabs are expanded to the next multiple of 8.\n\n    >>> expand_indent('    ')\n    4\n    >>> expand_indent('\\t')\n    8\n    >>> expand_indent('       \\t')\n    8\n    >>> expand_indent('        \\t')\n    16\n    \"\"\"\n    if '\\t' not in line:\n        return len(line) - len(line.lstrip())\n    result = 0\n    for char in line:\n        if char == '\\t':\n            result = result // 8 * 8 + 8\n        elif char == ' ':\n            result += 1\n        else:\n            break\n    return result", "entry_point": "expand_indent", "input": "'AbC dEf'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/pep8/pycodestyle.py#L1350-L1374", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035071", "code": "def mute_string(text):\n    \"\"\"Replace contents with 'xxx' to prevent syntax matching.\n\n    >>> mute_string('\"abc\"')\n    '\"xxx\"'\n    >>> mute_string(\"'''abc'''\")\n    \"'''xxx'''\"\n    >>> mute_string(\"r'abc'\")\n    \"r'xxx'\"\n    \"\"\"\n    # String modifiers (e.g. u or r)\n    start = text.index(text[-1]) + 1\n    end = len(text) - 1\n    # Triple quotes\n    if text[-3:] in ('\"\"\"', \"'''\"):\n        start += 2\n        end -= 2\n    return text[:start] + 'x' * (end - start) + text[end:]", "entry_point": "mute_string", "input": "'  padded  '", "output": "' xxxxxxxx '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/pep8/pycodestyle.py#L1377-L1394", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035072", "code": "def _parse_multi_options(options, split_token=','):\n    r\"\"\"Split and strip and discard empties.\n\n    Turns the following:\n\n    A,\n    B,\n\n    into [\"A\", \"B\"]\n    \"\"\"\n    if options:\n        return [o.strip() for o in options.split(split_token) if o.strip()]\n    else:\n        return options", "entry_point": "_parse_multi_options", "input": "{}, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/third_party/pep8/pycodestyle.py#L2274-L2287", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035073", "code": "def mixedcase(path):\n    \"\"\"Removes underscores and capitalizes the neighbouring character\"\"\"\n    words = path.split('_')\n    return words[0] + ''.join(word.title() for word in words[1:])", "entry_point": "mixedcase", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tortilla/tortilla/blob/eccc8a268307e9bea98f12f958f48bb03ff115b7/tortilla/formatters.py#L9-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035074", "code": "def format_table(columns, rows):\n    \"\"\"Formats an ascii table for given columns and rows.\n\n    Parameters\n    ----------\n    columns : list\n        The column names\n    rows : list of tuples\n        The rows in the table. Each tuple must be the same length as\n        ``columns``.\n    \"\"\"\n    rows = [tuple(str(i) for i in r) for r in rows]\n    columns = tuple(str(i).upper() for i in columns)\n    if rows:\n        widths = tuple(max(max(map(len, x)), len(c))\n                       for x, c in zip(zip(*rows), columns))\n    else:\n        widths = tuple(map(len, columns))\n    row_template = ('    '.join('%%-%ds' for _ in columns)) % widths\n    header = (row_template % tuple(columns)).strip()\n    if rows:\n        data = '\\n'.join((row_template % r).strip() for r in rows)\n        return '\\n'.join([header, data])\n    else:\n        return header", "entry_point": "format_table", "input": "{'a': 1, 'b': 2}, set()", "output": "'A    B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jcrist/skein/blob/16f8b1d3b3d9f79f36e2f152e45893339a1793e8/skein/utils.py#L177-L201", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035075", "code": "def erb(freq, Hz=None):\n  \"\"\"\n    ``B. C. J. Moore and B. R. Glasberg, \"Suggested formulae for calculating\n    auditory filter bandwidths and excitation patterns\". J. Acoust. Soc.\n    Am., 74, 1983, pp. 750-753.``\n  \"\"\"\n  if Hz is None:\n    if freq < 7: # Perhaps user tried something up to 2 * pi\n      raise ValueError(\"Frequency out of range.\")\n    Hz = 1\n  fHz = freq / Hz\n  result = 6.23e-6 * fHz ** 2 + 93.39e-3 * fHz + 28.52\n  return result * Hz", "entry_point": "erb", "input": "3.25, 3", "output": "85.86353943479168", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danilobellini/audiolazy/blob/dba0a278937909980ed40b976d866b8e97c35dee/audiolazy/lazy_auditory.py#L76-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035076", "code": "def pair_strings_sum_formatter(a, b):\n  \"\"\"\n  Formats the sum of a and b.\n\n  Note\n  ----\n  Both inputs are numbers already converted to strings.\n\n  \"\"\"\n  if b[:1] == \"-\":\n    return \"{0} - {1}\".format(a, b[1:])\n  return \"{0} + {1}\".format(a, b)", "entry_point": "pair_strings_sum_formatter", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "'[1, 2, 3] + [-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danilobellini/audiolazy/blob/dba0a278937909980ed40b976d866b8e97c35dee/audiolazy/lazy_text.py#L60-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035077", "code": "def enbw(wnd):\n  \"\"\" Equivalent Noise Bandwidth in bins (Processing Gain reciprocal). \"\"\"\n  return sum(el ** 2 for el in wnd) / sum(wnd) ** 2 * len(wnd)", "entry_point": "enbw", "input": "[5, 3, 1, 4]", "output": "1.2071005917159763", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danilobellini/audiolazy/blob/dba0a278937909980ed40b976d866b8e97c35dee/examples/window_comparison_harris.py#L39-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035078", "code": "def html_encode(text):\n    \"\"\"\n    Encode characters with a special meaning as HTML.\n\n    :param text: The plain text (a string).\n    :returns: The text converted to HTML (a string).\n    \"\"\"\n    text = text.replace('&', '&amp;')\n    text = text.replace('<', '&lt;')\n    text = text.replace('>', '&gt;')\n    text = text.replace('\"', '&quot;')\n    return text", "entry_point": "html_encode", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xolox/python-coloredlogs/blob/1cbf0c6bbee400c6ddbc43008143809934ec3e79/coloredlogs/converter/__init__.py#L289-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035079", "code": "def _create_x_y(l, duration=1):\n    \"\"\"\n    Create 2 lists\n        x: time (as unit of dot (dit)\n        y: bits\n    from a list of bit\n\n    >>> l = [1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1]\n    >>> x, y = _create_x_y(l)\n    >>> x\n    [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28]\n    >>> y\n    [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0]\n    \"\"\"\n    l = [0] + l + [0]\n    y = []\n    x = []\n    for i, bit in enumerate(l):\n        y.append(bit)\n        y.append(bit)\n        x.append((i - 1) * duration)\n        x.append(i * duration)\n    return x, y", "entry_point": "_create_x_y", "input": "[5, 3, 1, 4], 2.0", "output": "([-2.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 6.0, 6.0, 8.0, 8.0, 10.0], [0, 0, 5, 5, 3, 3, 1, 1, 4, 4, 0, 0])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/morse-talk/morse-talk/blob/71e09ace0aa554d28cada5ee658e43758305b8fa/morse_talk/plot.py#L31-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035080", "code": "def _limit_value(value, upper=1.0, lower=0.0):\n    \"\"\"\n    Returs value (such as amplitude) to upper and lower value\n\n    >>> _limit_value(0.5)\n    0.5\n\n    >>> _limit_value(1.5)\n    1.0\n\n    >>> _limit_value(-1.5)\n    0.0\n    \"\"\"\n    if value > upper:\n        return(upper)\n    if value < lower:\n        return(lower)\n    return value", "entry_point": "_limit_value", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/morse-talk/morse-talk/blob/71e09ace0aa554d28cada5ee658e43758305b8fa/morse_talk/utils.py#L399-L416", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035081", "code": "def get_formatted_path(path):\n        \"\"\"\n        Uniform the path string\n\n        :param path: the path\n        :return: the uniform path\n        \"\"\"\n        if path[0] != '/':\n            path = '/' + path\n        if path[-1] != '/':\n            path = '{0}/'.format(path)\n        return path", "entry_point": "get_formatted_path", "input": "'AbC dEf'", "output": "'/AbC dEf/'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Tanganelli/CoAPthon3/blob/985763bfe2eb9e00f49ec100c5b8877c2ed7d531/coapthon/http_proxy/http_coap_proxy.py#L56-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035082", "code": "def byte_len(int_type):\n    \"\"\"\n    Get the number of byte needed to encode the int passed.\n\n    :param int_type: the int to be converted\n    :return: the number of bits needed to encode the int passed.\n    \"\"\"\n    length = 0\n    while int_type:\n        int_type >>= 1\n        length += 1\n    if length > 0:\n        if length % 8 != 0:\n            length = int(length / 8) + 1\n        else:\n            length = int(length / 8)\n    return length", "entry_point": "byte_len", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Tanganelli/CoAPthon3/blob/985763bfe2eb9e00f49ec100c5b8877c2ed7d531/coapthon/utils.py#L87-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035083", "code": "def color_hex_to_dec_tuple(color):\n    \"\"\"Converts a color from hexadecimal to decimal tuple, color can be in\n    the following formats: 3-digit RGB, 4-digit ARGB, 6-digit RGB and\n    8-digit ARGB.\n    \"\"\"\n    assert len(color) in [3, 4, 6, 8]\n    if len(color) in [3, 4]:\n        color = \"\".join([c*2 for c in color])\n    n = int(color, 16)\n    t = ((n >> 16) & 255, (n >> 8) & 255, n & 255)\n    if len(color) == 8:\n        t = t + ((n >> 24) & 255,)\n    return t", "entry_point": "color_hex_to_dec_tuple", "input": "['a', 'b', 'c']", "output": "(170, 187, 204)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/agschwender/pilbox/blob/8b1d154436fd1b9f9740925549793561c58d4400/pilbox/image.py#L447-L459", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035084", "code": "def _truncate(f, n):\n    \"\"\"Truncates/pads a float `f` to `n` decimal places without rounding\n\n    From https://stackoverflow.com/a/783927/1307974 (CC-BY-SA)\n    \"\"\"\n    s = \"{}\".format(f)\n    if \"e\" in s or \"E\" in s:\n        return \"{0:.{1}f}\".format(f, n)\n    i, p, d = s.partition(\".\")\n    return \".\".join([i, (d+\"0\"*n)[:n]])", "entry_point": "_truncate", "input": "{1, 2, 3}, False", "output": "'{1, 2, 3}.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwpy/gwpy/blob/7a92b917e7dd2d99b15895293a1fa1d66cdb210a/gwpy/plot/gps.py#L69-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035085", "code": "def find_flag_groups(h5group, strict=True):\n    \"\"\"Returns all HDF5 Groups under the given group that contain a flag\n\n    The check is just that the sub-group has a ``'name'`` attribute, so its\n    not fool-proof by any means.\n\n    Parameters\n    ----------\n    h5group : `h5py.Group`\n        the parent group in which to search\n\n    strict : `bool`, optional, default: `True`\n        if `True` raise an exception for any sub-group that doesn't have a\n        name, otherwise just return all of those that do\n\n    Raises\n    ------\n    KeyError\n        if a sub-group doesn't have a ``'name'`` attribtue and ``strict=True``\n    \"\"\"\n    names = []\n    for group in h5group:\n        try:\n            names.append(h5group[group].attrs['name'])\n        except KeyError:\n            if strict:\n                raise\n            continue\n    return names", "entry_point": "find_flag_groups", "input": "[], False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwpy/gwpy/blob/7a92b917e7dd2d99b15895293a1fa1d66cdb210a/gwpy/segments/io/hdf5.py#L47-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035086", "code": "def format_nd_slice(item, ndim):\n    \"\"\"Preformat a getitem argument as an N-tuple\n    \"\"\"\n    if not isinstance(item, tuple):\n        item = (item,)\n    return item[:ndim] + (None,) * (ndim - len(item))", "entry_point": "format_nd_slice", "input": "(), False", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwpy/gwpy/blob/7a92b917e7dd2d99b15895293a1fa1d66cdb210a/gwpy/types/sliceutils.py#L31-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035087", "code": "def _ordinal(n):\n    \"\"\"Returns the ordinal string for a given integer\n\n    See https://stackoverflow.com/a/20007730/1307974\n\n    Parameters\n    ----------\n    n : `int`\n        the number to convert to ordinal\n\n    Examples\n    --------\n    >>> _ordinal(11)\n    '11th'\n    >>> _ordinal(102)\n    '102nd'\n    \"\"\"\n    idx = int((n//10 % 10 != 1) * (n % 10 < 4) * n % 10)\n    return '{}{}'.format(n, \"tsnrhtdd\"[idx::4])", "entry_point": "_ordinal", "input": "False", "output": "'Falseth'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwpy/gwpy/blob/7a92b917e7dd2d99b15895293a1fa1d66cdb210a/gwpy/spectrogram/spectrogram.py#L44-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035088", "code": "def bezout(a, b):\n    '''Compute the bezout algorithm of a and b, i.e. it returns u, v, p such as:\n\n          p = GCD(a,b)\n          a * u + b * v = p\n\n       Copied from http://www.labri.fr/perso/betrema/deug/poly/euclide.html.\n    '''\n    u = 1\n    v = 0\n    s = 0\n    t = 1\n    while b > 0:\n        q = a // b\n        r = a % b\n        a = b\n        b = r\n        tmp = s\n        s = u - q * s\n        u = tmp\n        tmp = t\n        t = v - q * t\n        v = tmp\n    return u, v, a", "entry_point": "bezout", "input": "{}, -1.5", "output": "(1, 0, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rckclmbr/pyportify/blob/696a1caad8a47b191f3bec44cc8fc3c437779512/pyportify/pkcs1/primitives.py#L41-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035089", "code": "def constant_time_cmp(a, b):\n    '''Compare two strings using constant time.'''\n    result = True\n    for x, y in zip(a, b):\n        result &= (x == y)\n    return result", "entry_point": "constant_time_cmp", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rckclmbr/pyportify/blob/696a1caad8a47b191f3bec44cc8fc3c437779512/pyportify/pkcs1/primitives.py#L121-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035090", "code": "def _rectangular(n):\n    \"\"\"Checks to see if a 2D list is a valid 2D matrix\"\"\"\n    for i in n:\n        if len(i) != len(n[0]):\n            return False\n    return True", "entry_point": "_rectangular", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/mxboard/blob/36057ff0f05325c9dc2fe046521325bf9d563a88/python/mxboard/utils.py#L46-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035091", "code": "def _unique_ordered_lines(line_numbers):\n        \"\"\"\n        Given a list of line numbers, return a list in which each line\n        number is included once and the lines are ordered sequentially.\n        \"\"\"\n\n        if len(line_numbers) == 0:\n            return []\n\n        # Ensure lines are unique by putting them in a set\n        line_set = set(line_numbers)\n\n        # Retrieve the list from the set, sort it, and return\n        return sorted([line for line in line_set])", "entry_point": "_unique_ordered_lines", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bachmann1234/diff-cover/blob/901cb3fc986982961785e841658085ead453c6c9/diff_cover/diff_reporter.py#L458-L471", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035092", "code": "def combine_adjacent_lines(line_numbers):\n        \"\"\"\n        Given a sorted collection of line numbers this will\n        turn them to strings and combine adjacent values\n\n        [1, 2, 5, 6, 100] -> [\"1-2\", \"5-6\", \"100\"]\n        \"\"\"\n        combine_template = \"{0}-{1}\"\n        combined_list = []\n\n        # Add a terminating value of `None` to list\n        line_numbers.append(None)\n        start = line_numbers[0]\n        end = None\n\n        for line_number in line_numbers[1:]:\n            # If the current number is adjacent to the previous number\n            if (end if end else start) + 1 == line_number:\n                end = line_number\n            else:\n                if end:\n                    combined_list.append(combine_template.format(start, end))\n                else:\n                    combined_list.append(str(start))\n                start = line_number\n                end = None\n        return combined_list", "entry_point": "combine_adjacent_lines", "input": "[5, 3, 1, 4]", "output": "['5', '3', '1', '4']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bachmann1234/diff-cover/blob/901cb3fc986982961785e841658085ead453c6c9/diff_cover/report_generator.py#L281-L307", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035093", "code": "def query_string_to_dict(query):\n        \"\"\"Convert a string to a query dict.\n\n        Args:\n            query (str): The query string.\n\n        Returns:\n            obj: The key value object with query params.\n\n        Note:\n            This method does the same as urllib.parse.parse_qsl except\n            that it doesn't actually decode the values.\n\n        \"\"\"\n\n        query_params = {}\n\n        for key_value in query.split(\"&\"):\n            key_value_pair = key_value.split(\"=\", 1)\n\n            key = key_value_pair[0] if len(key_value_pair) >= 1 else \"\"\n            value = key_value_pair[1] if len(key_value_pair) == 2 else \"\"\n\n            query_params[key] = value\n\n        return query_params", "entry_point": "query_string_to_dict", "input": "''", "output": "{'': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tijme/not-your-average-web-crawler/blob/d77c14e1616c541bb3980f649a7e6f8ed02761fb/nyawc/helpers/URLHelper.py#L278-L303", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035094", "code": "def normalize(data):\n    \"\"\"Normalize the data to be in the [0, 1] range.\n\n    :param data:\n    :return: normalized data\n    \"\"\"\n    out_data = data.copy()\n\n    for i, sample in enumerate(out_data):\n        out_data[i] /= sum(out_data[i])\n\n    return out_data", "entry_point": "normalize", "input": "set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blackecho/Deep-Learning-TensorFlow/blob/ddeb1f2848da7b7bee166ad2152b4afc46bb2086/yadlt/utils/utilities.py#L142-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035095", "code": "def CleanComments(line, quote=False):\n    \"\"\"\n    quote means 'was in a quote starting this line' so that\n    quoted lines can be eaten/removed.\n    \"\"\"\n    if line.find('#') == -1 and line.find('\"') == -1:\n        if quote:\n            return '', quote\n        else:\n            return line, quote\n    # else have to check for comment\n    prior = []\n    prev = ''\n    for char in line:\n        try:\n            if char == '\"':\n                if prev != '\\\\':\n                    quote = not quote\n                    prior.append(char)\n                continue\n            elif char == '#' and not quote:\n                break\n            if not quote:\n                prior.append(char)\n        finally:\n            prev = char\n\n    # rstrip removes trailing space between end of command and the comment # start\n\n    return ''.join(prior).rstrip(), quote", "entry_point": "CleanComments", "input": "'  padded  ', [[1, 2], [3], []]", "output": "('', [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/richq/cmake-lint/blob/058c6c0ed2536abd3e79a51c38ee6e686568e3b3/cmakelint/main.py#L202-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035096", "code": "def is_natural(x):\n    \"\"\"A non-negative integer.\"\"\"\n    try:\n        is_integer = int(x) == x\n    except (TypeError, ValueError):\n        return False\n    return is_integer and x >= 0", "entry_point": "is_natural", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/drj11/pypng/blob/b8220ca9f58e4c5bc1d507e713744fcb8c049225/code/png.py#L2203-L2209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035097", "code": "def extract_boto_args_from_env(env_vars):\n    \"\"\"Return boto3 client args dict with environment creds.\"\"\"\n    boto_args = {}\n    for i in ['aws_access_key_id', 'aws_secret_access_key',\n              'aws_session_token']:\n        if env_vars.get(i.upper()):\n            boto_args[i] = env_vars[i.upper()]\n    return boto_args", "entry_point": "extract_boto_args_from_env", "input": "{'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onicagroup/runway/blob/3f3549ec3bf6e39b9f27d9738a1847f3a4369e7f/runway/util.py#L85-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035098", "code": "def sanitize(name):\n    \"\"\"\n    Sanitize the specified ``name`` for use with breathe directives.\n\n    **Parameters**\n\n    ``name`` (:class:`python:str`)\n        The name to be sanitized.\n\n    **Return**\n\n    :class:`python:str`\n        The input ``name`` sanitized to use with breathe directives (primarily for use\n        with ``.. doxygenfunction::``).  Replacements such as ``\"&lt;\" -> \"<\"`` are\n        performed, as well as removing spaces ``\"< \" -> \"<\"`` must be done.  Breathe is\n        particularly sensitive with respect to whitespace.\n    \"\"\"\n    return name.replace(\n        \"&lt;\", \"<\"\n    ).replace(\n        \"&gt;\", \">\"\n    ).replace(\n        \"&amp;\", \"&\"\n    ).replace(\n        \"< \", \"<\"\n    ).replace(\n        \" >\", \">\"\n    ).replace(\n        \" &\", \"&\"\n    ).replace(\n        \"& \", \"&\"\n    )", "entry_point": "sanitize", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/svenevs/exhale/blob/fe7644829057af622e467bb529db6c03a830da99/exhale/utils.py#L255-L286", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035099", "code": "def _keynat(string):\n    \"\"\"A natural sort helper function for sort() and sorted()\n    without using regular expression.\n    \"\"\"\n    r = []\n    for c in string:\n        if c.isdigit():\n            if r and isinstance(r[-1], int):\n                r[-1] = r[-1] * 10 + int(c)\n            else:\n                r.append(int(c))\n        else:\n            r.append(9 + ord(c))\n    return r", "entry_point": "_keynat", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/msmbuilder/msmbuilder/blob/556a93a170782f47be53f4a1e9d740fb1c8272b3/msmbuilder/dataset.py#L497-L510", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035100", "code": "def _dict_compose(dict1, dict2):\n    \"\"\"\n    Example\n    -------\n    >>> dict1 = {'a': 0, 'b': 1, 'c': 2}\n    >>> dict2 = {0: 'A', 1: 'B'}\n    >>> _dict_compose(dict1, dict2)\n    {'a': 'A', 'b': 'b'}\n    \"\"\"\n    return {k: dict2.get(v) for k, v in dict1.items() if v in dict2}", "entry_point": "_dict_compose", "input": "{'a': 1, 'b': 2}, {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/msmbuilder/msmbuilder/blob/556a93a170782f47be53f4a1e9d740fb1c8272b3/msmbuilder/msm/core.py#L605-L614", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035101", "code": "def covstr(strings):\n    \"\"\" convert string to int or float. \"\"\"\n    try:\n        result = int(strings)\n    except ValueError:\n        result = float(strings)\n    return result", "entry_point": "covstr", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toomore/grs/blob/a1285cb57878284a886952968be9e31fbfa595dd/grs/realtime.py#L33-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035102", "code": "def norm_shape(shape):\n    '''\n    Normalize numpy array shapes so they're always expressed as a tuple,\n    even for one-dimensional shapes.\n     \n    Parameters\n        shape - an int, or a tuple of ints\n     \n    Returns\n        a shape tuple\n    '''\n    try:\n        i = int(shape)\n        return (i,)\n    except TypeError:\n        # shape was not a number\n        pass\n \n    try:\n        t = tuple(shape)\n        return t\n    except TypeError:\n        # shape was not iterable\n        pass\n     \n    raise TypeError('shape must be an int, or a tuple of ints')", "entry_point": "norm_shape", "input": "[]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dshean/pygeotools/blob/5ac745717c0098d01eb293ff1fe32fd7358c76ab/pygeotools/lib/malib.py#L1954-L1979", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035103", "code": "def dd2dms(dd):\n    \"\"\"Convert decimal degrees to degrees, minutes, seconds\n    \"\"\"\n    n = dd < 0\n    dd = abs(dd)\n    m,s = divmod(dd*3600,60)\n    d,m = divmod(m,60)\n    if n:\n        d = -d\n    return d,m,s", "entry_point": "dd2dms", "input": "3.25", "output": "(3.0, 15.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dshean/pygeotools/blob/5ac745717c0098d01eb293ff1fe32fd7358c76ab/pygeotools/lib/geolib.py#L353-L362", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035104", "code": "def fix_opcode_names(opmap):\n    \"\"\"\n    Python stupidly named some OPCODES with a + which prevents using opcode name\n    directly as an attribute, e.g. SLICE+3. So we turn that into SLICE_3 so we\n    can then use opcode_23.SLICE_3.  Later Python's fix this.\n    \"\"\"\n    return dict([(k.replace('+', '_'), v)\n                  for (k, v) in opmap.items()])", "entry_point": "fix_opcode_names", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python-xdis/blob/46a2902ae8f5d8eee495eed67ac0690fd545453d/xdis/opcodes/base.py#L189-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035105", "code": "def offset2line(offset, linestarts):\n    \"\"\"linestarts is expected to be a *list) of (offset, line number)\n    where both offset and line number are in increasing order.\n    Return the closes line number at or below the offset.\n    If offset is less than the first line number given in linestarts,\n    return line number 0.\n    \"\"\"\n    if len(linestarts) == 0 or offset < linestarts[0][0]:\n        return 0\n    low = 0\n    high = len(linestarts) - 1\n    mid = (low + high + 1) // 2\n    while low <= high:\n        if linestarts[mid][0] > offset:\n            high = mid - 1\n        elif linestarts[mid][0] < offset:\n            low = mid + 1\n        else:\n            return linestarts[mid][1]\n        mid = (low + high + 1) // 2\n        pass\n    # Not found. Return closest position below\n    if mid >= len(linestarts):\n        return linestarts[len(linestarts)-1][1]\n    return linestarts[high][1]", "entry_point": "offset2line", "input": "['apple', 'banana', 'cherry'], ''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python-xdis/blob/46a2902ae8f5d8eee495eed67ac0690fd545453d/xdis/bytecode.py#L93-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035106", "code": "def _get_const_info(const_index, const_list):\n    \"\"\"Helper to get optional details about const references\n\n       Returns the dereferenced constant and its repr if the constant\n       list is defined.\n       Otherwise returns the constant index and its repr().\n    \"\"\"\n    argval = const_index\n    if const_list is not None:\n        argval = const_list[const_index]\n\n    # float values nan and inf are not directly representable in Python at least\n    # before 3.5 and even there it is via a library constant.\n    # So we will canonicalize their representation as float('nan') and float('inf')\n    if isinstance(argval, float) and str(argval) in frozenset(['nan', '-nan', 'inf', '-inf']):\n        return argval, \"float('%s')\" % argval\n    return argval, repr(argval)", "entry_point": "_get_const_info", "input": "2, ['a', 'b', 'c']", "output": "('c', \"'c'\")", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python-xdis/blob/46a2902ae8f5d8eee495eed67ac0690fd545453d/xdis/bytecode.py#L172-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035107", "code": "def _long_from_raw(thehash):\n    \"\"\"Fold to a long, a digest supplied as a string.\"\"\"\n    hashnum = 0\n    for h in thehash:\n        hashnum <<= 8\n        hashnum |= ord(bytes([h]))\n    return hashnum", "entry_point": "_long_from_raw", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/knipknap/exscript/blob/72718eee3e87b345d5a5255be9824e867e42927b/Exscript/util/crypt.py#L315-L321", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035108", "code": "def parse_prefix(prefix, default_length=128):\n    \"\"\"\n    Splits the given IP prefix into a network address and a prefix length.\n    If the prefix does not have a length (i.e., it is a simple IP address),\n    it is presumed to have the given default length.\n\n    :type  prefix: string\n    :param prefix: An IP mask.\n    :type  default_length: long\n    :param default_length: The default ip prefix length.\n    :rtype:  string, int\n    :return: A tuple containing the IP address and prefix length.\n    \"\"\"\n    if '/' in prefix:\n        network, pfxlen = prefix.split('/')\n    else:\n        network = prefix\n        pfxlen = default_length\n    return network, int(pfxlen)", "entry_point": "parse_prefix", "input": "'', -3", "output": "('', -3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/knipknap/exscript/blob/72718eee3e87b345d5a5255be9824e867e42927b/Exscript/util/ipv6.py#L136-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035109", "code": "def make_http_credentials(username=None, password=None):\n    \"\"\"Build auth part for api_url.\"\"\"\n    credentials = ''\n    if username is None:\n        return credentials\n    if username is not None:\n        if ':' in username:\n            return credentials\n        credentials += username\n    if credentials and password is not None:\n        credentials += \":%s\" % password\n    return \"%s@\" % credentials", "entry_point": "make_http_credentials", "input": "'walnut thistle harbour', 'a,b,c'", "output": "'walnut thistle harbour:a,b,c@'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danielperna84/pyhomematic/blob/8b91f3e84c83f05d289c740d507293a0d6759d8e/pyhomematic/_hm.py#L50-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035110", "code": "def parse(tokens):\n    '''Parse the provided string to produce *args and **kwargs'''\n    args = []\n    kwargs = {}\n    last = None\n    for token in tokens:\n        if token.startswith('--'):\n            # If this is a keyword flag, but we've already got one that we've\n            # parsed, then we're going to interpret it as a bool\n            if last:\n                kwargs[last] = True\n            # See if it is the --foo=5 style\n            last, _, value = token.strip('-').partition('=')\n            if value:\n                kwargs[last] = value\n                last = None\n        elif last != None:\n            kwargs[last] = token\n            last = None\n        else:\n            args.append(token)\n\n    # If there's a dangling last, set that bool\n    if last:\n        kwargs[last] = True\n\n    return args, kwargs", "entry_point": "parse", "input": "['a', 'b', 'c']", "output": "(['a', 'b', 'c'], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seomoz/shovel/blob/fc29232b2b8be33972f8fb498a91a67e334f057f/shovel/parser.py#L25-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035111", "code": "def to_long(base, lookup_f, s):\n    \"\"\"\n    Convert an array to a (possibly bignum) integer, along with a prefix value\n    of how many prefixed zeros there are.\n    base:\n        the source base\n    lookup_f:\n        a function to convert an element of s to a value between 0 and base-1.\n    s:\n        the value to convert\n    \"\"\"\n    prefix = 0\n    v = 0\n    for c in s:\n        v *= base\n        try:\n            v += lookup_f(c)\n        except Exception:\n            raise ValueError(\"bad character %s in string %s\" % (c, s))\n        if v == 0:\n            prefix += 1\n    return v, prefix", "entry_point": "to_long", "input": "set(), {'a': 1, 'b': 2}, set()", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/summa-tx/riemann/blob/04ae336dfd4007ceaed748daadc91cc32fa278ec/riemann/encoding/base58.py#L104-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035112", "code": "def i2le_script(number):\n    '''Convert int to signed little endian (l.e.) hex for scripts\n    Args:\n        number  (int): int value to convert to bytes in l.e. format\n    Returns:\n                (str): the hex-encoded signed LE number\n    '''\n    if number == 0:\n        return '00'\n    for i in range(80):\n        try:\n            return number.to_bytes(\n                length=i,  # minimal bytes lol\n                byteorder='little',\n                signed=True).hex()\n        except Exception:\n            continue", "entry_point": "i2le_script", "input": "5", "output": "'05'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/summa-tx/riemann/blob/04ae336dfd4007ceaed748daadc91cc32fa278ec/riemann/utils.py#L29-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035113", "code": "def guess_sequence(redeem_script):\n    '''\n    str -> int\n    If OP_CSV is used, guess an appropriate sequence\n    Otherwise, disable RBF, but leave lock_time on.\n    Fails if there's not a constant before OP_CSV\n    '''\n    try:\n        script_array = redeem_script.split()\n        loc = script_array.index('OP_CHECKSEQUENCEVERIFY')\n        return int(script_array[loc - 1], 16)\n    except ValueError:\n        return 0xFFFFFFFE", "entry_point": "guess_sequence", "input": "''", "output": "4294967294", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/summa-tx/riemann/blob/04ae336dfd4007ceaed748daadc91cc32fa278ec/riemann/simple.py#L32-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035114", "code": "def guess_locktime(redeem_script):\n    '''\n    str -> int\n    If OP_CLTV is used, guess an appropriate lock_time\n    Otherwise return 0 (no lock time)\n    Fails if there's not a constant before OP_CLTV\n    '''\n    try:\n        script_array = redeem_script.split()\n        loc = script_array.index('OP_CHECKLOCKTIMEVERIFY')\n        return int(script_array[loc - 1], 16)\n    except ValueError:\n        return 0", "entry_point": "guess_locktime", "input": "'  padded  '", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/summa-tx/riemann/blob/04ae336dfd4007ceaed748daadc91cc32fa278ec/riemann/simple.py#L47-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035115", "code": "def dedupe_list(seq):\n    \"\"\"\n    Utility function to remove duplicates from a list\n    :param seq: The sequence (list) to deduplicate\n    :return: A list with original duplicates removed\n    \"\"\"\n    seen = set()\n    return [x for x in seq if not (x in seen or seen.add(x))]", "entry_point": "dedupe_list", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jonhadfield/python-hosts/blob/9ccaa8edc63418a91f10bf732b26070f21dd2ad0/python_hosts/utils.py#L63-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035116", "code": "def pretty_bytes(num):\n    \"\"\" pretty print the given number of bytes \"\"\"\n    for unit in ['', 'KB', 'MB', 'GB']:\n        if num < 1024.0:\n            if unit == '':\n                return \"%d\" % (num)\n            else:\n                return \"%3.1f%s\" % (num, unit)\n        num /= 1024.0\n    return \"%3.1f%s\" % (num, 'TB')", "entry_point": "pretty_bytes", "input": "0", "output": "'0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rgs1/zk_shell/blob/bbf34fdfcf1f81100e2a5816fad8af6afc782a54/zk_shell/util.py#L20-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035117", "code": "def get_num_distances(gsims):\n    \"\"\"\n    :returns: the number of distances required for the given GSIMs\n    \"\"\"\n    dists = set()\n    for gsim in gsims:\n        dists.update(gsim.REQUIRES_DISTANCES)\n    return len(dists)", "entry_point": "get_num_distances", "input": "()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hazardlib/contexts.py#L70-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035118", "code": "def hermann_adjustment_factors(bval, min_mag, mag_inc):\n    '''\n    Returns the adjustment factors (fval, fival) proposed by Hermann (1978)\n\n    :param float bval:\n        Gutenberg & Richter (1944) b-value\n\n    :param np.ndarray min_mag:\n        Minimum magnitude of completeness table\n\n    :param non-negative float mag_inc:\n        Magnitude increment of the completeness table\n    '''\n\n    fval = 10. ** (bval * min_mag)\n    fival = 10. ** (bval * (mag_inc / 2.)) - 10. ** (-bval * (mag_inc / 2.))\n    return fval, fival", "entry_point": "hermann_adjustment_factors", "input": "10, 0.5, 2.0", "output": "(100000.0, 10000000000.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hmtk/seismicity/smoothing/utils.py#L56-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035119", "code": "def hazard_id(value):\n    \"\"\"\n    >>> hazard_id('')\n    ()\n    >>> hazard_id('-1')\n    (-1,)\n    >>> hazard_id('42')\n    (42,)\n    >>> hazard_id('42,3')\n    (42, 3)\n    >>> hazard_id('42,3,4')\n    (42, 3, 4)\n    >>> hazard_id('42:3')\n    Traceback (most recent call last):\n       ...\n    ValueError: Invalid hazard_id '42:3'\n    \"\"\"\n    if not value:\n        return ()\n    try:\n        return tuple(map(int, value.split(',')))\n    except Exception:\n        raise ValueError('Invalid hazard_id %r' % value)", "entry_point": "hazard_id", "input": "set()", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hazardlib/valid.py#L194-L216", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035120", "code": "def utf8(value):\n    r\"\"\"\n    Check that the string is UTF-8. Returns an encode bytestring.\n\n    >>> utf8(b'\\xe0')  # doctest: +ELLIPSIS\n    Traceback (most recent call last):\n    ...\n    ValueError: Not UTF-8: ...\n    \"\"\"\n    try:\n        if isinstance(value, bytes):\n            return value.decode('utf-8')\n        else:\n            return value\n    except Exception:\n        raise ValueError('Not UTF-8: %r' % value)", "entry_point": "utf8", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hazardlib/valid.py#L310-L325", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035121", "code": "def distinct(keys):\n    \"\"\"\n    Return the distinct keys in order.\n    \"\"\"\n    known = set()\n    outlist = []\n    for key in keys:\n        if key not in known:\n            outlist.append(key)\n        known.add(key)\n    return outlist", "entry_point": "distinct", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/baselib/general.py#L171-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035122", "code": "def make_tabs(tag_ids, tag_status, tag_contents):\n    \"\"\"\n    Return a HTML string containing all the tabs we want to display\n    \"\"\"\n    templ = '''\n<div id=\"tabs\">\n<ul>\n%s\n</ul>\n%s\n</div>'''\n    lis = []\n    contents = []\n    for i, (tag_id, status, tag_content) in enumerate(\n            zip(tag_ids, tag_status, tag_contents), 1):\n        mark = '.' if status == 'complete' else '!'\n        lis.append('<li><a href=\"#tabs-%d\">%s%s</a></li>' % (i, tag_id, mark))\n        contents.append('<div id=\"tabs-%d\">%s</div>' % (\n            i, tag_content))\n    return templ % ('\\n'.join(lis), '\\n'.join(contents))", "entry_point": "make_tabs", "input": "[1, 2, 3], (1, 2), {'a': 1, 'b': 2}", "output": "'\\n<div id=\"tabs\">\\n<ul>\\n<li><a href=\"#tabs-1\">1!</a></li>\\n<li><a href=\"#tabs-2\">2!</a></li>\\n</ul>\\n<div id=\"tabs-1\">a</div>\\n<div id=\"tabs-2\">b</div>\\n</div>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/engine/tools/make_html_report.py#L125-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035123", "code": "def decode_array(values):\n    \"\"\"\n    Decode the values which are bytestrings.\n    \"\"\"\n    out = []\n    for val in values:\n        try:\n            out.append(val.decode('utf8'))\n        except AttributeError:\n            out.append(val)\n    return out", "entry_point": "decode_array", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/baselib/hdf5.py#L585-L595", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035124", "code": "def modulo11(base):\n    \"\"\"Calcula o d\u00edgito verificador (DV) para o argumento usando \"M\u00f3dulo 11\".\n\n    :param str base: String contendo os d\u00edgitos sobre os quais o DV ser\u00e1\n        calculado, assumindo que o DV n\u00e3o est\u00e1 inclu\u00eddo no argumento.\n\n    :return: O d\u00edgito verificador calculado.\n    :rtype: int\n\n    \"\"\"\n    pesos = '23456789' * ((len(base) // 8) + 1)\n    acumulado = sum([int(a) * int(b) for a, b in zip(base[::-1], pesos)])\n    digito = 11 - (acumulado % 11)\n    return 0 if digito >= 10 else digito", "entry_point": "modulo11", "input": "[1, 2, 3]", "output": "6", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/base4sistemas/satcomum/blob/b42bec06cb0fb0ad2f6b1a2644a1e8fc8403f2c3/satcomum/util.py#L47-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035125", "code": "def versions_from_trove(trove):\n    \"\"\"Finds out python version from list of trove classifiers.\n    Args:\n        trove: list of trove classifiers\n    Returns:\n        python version string\n    \"\"\"\n    versions = set()\n    for classifier in trove:\n        if 'Programming Language :: Python ::' in classifier:\n            ver = classifier.split('::')[-1]\n            major = ver.split('.')[0].strip()\n            if major:\n                versions.add(major)\n    return sorted(\n        set([v for v in versions if v.replace('.', '', 1).isdigit()]))", "entry_point": "versions_from_trove", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fedora-python/pyp2rpm/blob/853eb3d226689a5ccdcdb9358b1a3394fafbd2b5/pyp2rpm/metadata_extractors.py#L70-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035126", "code": "def to_list(var):\n    \"\"\"Checks if given value is a list, tries to convert, if it is not.\"\"\"\n    if var is None:\n        return []\n    if isinstance(var, str):\n        var = var.split('\\n')\n    elif not isinstance(var, list):\n        try:\n            var = list(var)\n        except TypeError:\n            raise ValueError(\"{} cannot be converted to the list.\".format(var))\n    return var", "entry_point": "to_list", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fedora-python/pyp2rpm/blob/853eb3d226689a5ccdcdb9358b1a3394fafbd2b5/pyp2rpm/command/extract_dist.py#L75-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035127", "code": "def readCommaList(fileList):\n    \"\"\" Return a list of the files with the commas removed. \"\"\"\n    names=fileList.split(',')\n    fileList=[]\n    for item in names:\n        fileList.append(item)\n    return fileList", "entry_point": "readCommaList", "input": "'walnut thistle harbour'", "output": "['walnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/util.py#L890-L896", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035128", "code": "def get_expstart(header,primary_hdr):\n    \"\"\"shouldn't this just be defined in the instrument subclass of imageobject?\"\"\"\n\n    if 'expstart' in primary_hdr:\n        exphdr = primary_hdr\n    else:\n        exphdr = header\n\n    if 'EXPSTART' in exphdr:\n        expstart = float(exphdr['EXPSTART'])\n        expend = float(exphdr['EXPEND'])\n    else:\n        expstart = 0.\n        expend = 0.0\n\n    return (expstart,expend)", "entry_point": "get_expstart", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "(0.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/util.py#L967-L982", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035129", "code": "def base_taskname(taskname, packagename=None):\n    \"\"\"\n    Extract the base name of the task.\n\n    Many tasks in the `drizzlepac` have \"compound\" names such as\n    'drizzlepac.sky'. This function will search for the presence of a dot\n    in the input `taskname` and if found, it will return the string\n    to the right of the right-most dot. If a dot is not found, it will return\n    the input string.\n\n    Parameters\n    ----------\n    taskname : str, None\n        Full task name. If it is `None`, :py:func:`base_taskname` will\n        return `None`\\ .\n\n    packagename : str, None (Default = None)\n        Package name. It is assumed that a compound task name is formed by\n        concatenating `packagename` + '.' + `taskname`\\ . If `packagename`\n        is not `None`, :py:func:`base_taskname` will check that the string\n        to the left of the right-most dot matches `packagename` and will\n        raise an `AssertionError` if the package name derived from the\n        input `taskname` does not match the supplied `packagename`\\ . This\n        is intended as a check for discrepancies that may arise\n        during the development of the tasks. If `packagename` is `None`,\n        no such check will be performed.\n\n    Raises\n    ------\n    AssertionError\n        Raised when package name derived from the input `taskname` does not\n        match the supplied `packagename`\n\n    \"\"\"\n    if not isinstance(taskname, str):\n        return taskname\n\n    indx = taskname.rfind('.')\n\n    if indx >= 0:\n        base_taskname = taskname[(indx+1):]\n        pkg_name      = taskname[:indx]\n    else:\n        base_taskname = taskname\n        pkg_name      = ''\n\n    assert(True if packagename is None else (packagename == pkg_name))\n\n    return base_taskname", "entry_point": "base_taskname", "input": "'Hello World', ''", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/util.py#L1171-L1219", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035130", "code": "def extension_from_filename(filename):\n    \"\"\"\n    Parse out filename from any specified extensions.\n    Returns rootname and string version of extension name.\n    \"\"\"\n    # Parse out any extension specified in filename\n    _indx1 = filename.find('[')\n    _indx2 = filename.find(']')\n    if _indx1 > 0:\n        # check for closing square bracket:\n        if _indx2 < _indx1:\n            raise RuntimeError(\"Incorrect extension specification in file \" \\\n                                \"name \\'%s\\'.\" % filename)\n        # Read extension name provided\n        _fname = filename[:_indx1]\n        _extn = filename[_indx1+1:_indx2].strip()\n    else:\n        _fname = filename\n        _extn = None\n\n    return _fname, _extn", "entry_point": "extension_from_filename", "input": "'Hello World'", "output": "('Hello World', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/mapreg.py#L777-L797", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035131", "code": "def filter_product_filename_generator(obs_info,nn):\n    \"\"\"\n    Generate image and sourcelist filenames for filter products\n\n    Parameters\n    ----------\n    obs_info : list\n        list of items that will be used to generate the filenames: proposal_id,\n        visit_id, instrument, detector, and filter\n    nn : string\n        the single-exposure image number (NOTE: only used in\n        single_exposure_product_filename_generator())\n\n    Returns\n    --------\n    product_filename_dict : dictionary\n        A dictionary containing the generated filenames.\n    \"\"\"\n    proposal_id = obs_info[0]\n    visit_id = obs_info[1]\n    instrument = obs_info[2]\n    detector = obs_info[3]\n    filter = obs_info[4]\n\n    product_filename_dict = {}\n    product_filename_dict[\"image\"] = \"hst_{}_{}_{}_{}_{}.fits\".format(proposal_id,visit_id,instrument,detector,filter)\n    product_filename_dict[\"source catalog\"] = product_filename_dict[\"image\"].replace(\".fits\",\".cat\")\n\n    return(product_filename_dict)", "entry_point": "filter_product_filename_generator", "input": "'a,b,c', {1, 2, 3}", "output": "{'image': 'hst_a_,_b_,_c.fits', 'source catalog': 'hst_a_,_b_,_c.cat'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/generate_final_product_filenames.py#L85-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035132", "code": "def total_detection_product_filename_generator(obs_info,nn):\n    \"\"\"\n    Generate image and sourcelist filenames for total detection products\n\n    Parameters\n    ----------\n    obs_info : list\n        list of items that will be used to generate the filenames: proposal_id,\n        visit_id, instrument, and detector\n    nn : string\n        the single-exposure image number (NOTE: only used in\n        single_exposure_product_filename_generator())\n\n    Returns\n    --------\n    product_filename_dict : dictionary\n        A dictionary containing the generated filenames.\n    \"\"\"\n    proposal_id = obs_info[0]\n    visit_id = obs_info[1]\n    instrument = obs_info[2]\n    detector = obs_info[3]\n\n    product_filename_dict = {}\n    product_filename_dict[\"image\"] = \"hst_{}_{}_{}_{}.fits\".format(proposal_id, visit_id, instrument, detector)\n    product_filename_dict[\"source catalog\"] = product_filename_dict[\"image\"].replace(\".fits\",\".cat\")\n\n    return (product_filename_dict)", "entry_point": "total_detection_product_filename_generator", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "{'image': 'hst_5_3_1_4.fits', 'source catalog': 'hst_5_3_1_4.cat'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/generate_final_product_filenames.py#L118-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035133", "code": "def multivisit_mosaic_product_filename_generator(obs_info,nn):\n    \"\"\"\n    Generate image and sourcelist filenames for multi-visit mosaic products\n\n    Parameters\n    ----------\n    obs_info : list\n        list of items that will be used to generate the filenames: group_id,\n        instrument, detector, and filter\n    nn : string\n        the single-exposure image number (NOTE: only used in\n        single_exposure_product_filename_generator())\n\n    Returns\n    --------\n    product_filename_dict : dictionary\n        A dictionary containing the generated filenames.\n    \"\"\"\n    group_num = obs_info[0]\n    instrument = obs_info[1]\n    detector = obs_info[2]\n    filter = obs_info[3]\n\n    product_filename_dict = {}\n    product_filename_dict[\"image\"] = \"hst_mos_{}_{}_{}_{}.fits\".format(group_num,instrument,detector,filter)\n    product_filename_dict[\"source catalog\"] = product_filename_dict[\"image\"].replace(\".fits\",\".cat\")\n\n    return (product_filename_dict)", "entry_point": "multivisit_mosaic_product_filename_generator", "input": "[-1, 0, 1, 2], ['a', 'b', 'c']", "output": "{'image': 'hst_mos_-1_0_1_2.fits', 'source catalog': 'hst_mos_-1_0_1_2.cat'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/generate_final_product_filenames.py#L149-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035134", "code": "def setDefaults(configObj={}):\n    \"\"\" Return a dictionary of the default parameters\n        which also been updated with the user overrides.\n    \"\"\"\n    paramDict = {\n        'gain': 7,           # Detector gain, e-/ADU\n        'grow': 1,           # Radius around CR pixel to mask [default=1 for\n                             #     3x3 for non-NICMOS]\n        'ctegrow': 0,        # Length of CTE correction to be applied\n        'rn': 5,             # Read noise in electrons\n        'snr': '4.0 3.0',    # Signal-to-noise ratio\n        'scale': '0.5 0.4',  # scaling factor applied to the derivative\n        'backg': 0,          # Background value\n        'expkey': 'exptime'  # exposure time keyword\n    }\n\n    if len(configObj) > 0:\n        for key in configObj:\n            paramDict[key] = configObj[key]\n\n    return paramDict", "entry_point": "setDefaults", "input": "{'a': 1, 'b': 2}", "output": "{'gain': 7, 'grow': 1, 'ctegrow': 0, 'rn': 5, 'snr': '4.0 3.0', 'scale': '0.5 0.4', 'backg': 0, 'expkey': 'exptime', 'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L321-L341", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035135", "code": "def determine_orig_wcsname(header, wnames, wkeys):\n    \"\"\"\n    Determine the name of the original, unmodified WCS solution\n    \"\"\"\n    orig_wcsname = None\n    orig_key = None\n    if orig_wcsname is None:\n        for k,w in wnames.items():\n            if w[:4] == 'IDC_':\n                orig_wcsname = w\n                orig_key = k\n                break\n    if orig_wcsname is None:\n        # No IDC_ wcsname found... revert to second to last if available\n        if len(wnames) > 1:\n            orig_key = wkeys[-2]\n            orig_wcsname = wnames[orig_key]\n    return orig_wcsname,orig_key", "entry_point": "determine_orig_wcsname", "input": "-1.5, {}, 3.25", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakback.py#L379-L396", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035136", "code": "def parse_colname(colname):\n    \"\"\" Common function to interpret input column names provided by the user.\n\n        This function translates column specification provided by the user\n        into a column number.\n\n        Notes\n        -----\n        This function will understand the following inputs::\n\n            '1,2,3' or   'c1,c2,c3' or ['c1','c2','c3']\n            '1-3'   or   'c1-c3'\n            '1:3'   or   'c1:c3'\n            '1 2 3' or   'c1 c2 c3'\n            '1'     or   'c1'\n            1\n\n        Parameters\n        ----------\n        colname :\n            Column name or names to be interpreted\n\n        Returns\n        -------\n        cols : list\n            The return value will be a list of strings.\n\n    \"\"\"\n    if isinstance(colname, list):\n        cname = ''\n        for c in colname:\n            cname += str(c) + ','\n        cname = cname.rstrip(',')\n    elif isinstance(colname, int) or colname.isdigit():\n        cname = str(colname)\n    else:\n        cname = colname\n\n    if 'c' in cname[0]:\n        cname = cname.replace('c', '')\n\n    ctok = None\n    cols = None\n    if '-' in cname:\n        ctok = '-'\n    if ':' in cname:\n        ctok = ':'\n    if ctok is not None:\n        cnums = cname.split(ctok)\n        c = list(range(int(cnums[0]), int(cnums[1]) + 1))\n        cols = [str(i) for i in c]\n\n    if cols is None:\n        ctok = ',' if ',' in cname else ' '\n        cols = cname.split(ctok)\n\n    return cols", "entry_point": "parse_colname", "input": "'abc'", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L334-L390", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035137", "code": "def is_ens_domain(authority: str) -> bool:\n    \"\"\"\n    Return false if authority is not a valid ENS domain.\n    \"\"\"\n    # check that authority ends with the tld '.eth'\n    # check that there are either 2 or 3 subdomains in the authority\n    # i.e. zeppelinos.eth or packages.zeppelinos.eth\n    if authority[-4:] != \".eth\" or len(authority.split(\".\")) not in [2, 3]:\n        return False\n    return True", "entry_point": "is_ens_domain", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethpm/py-ethpm/blob/81ed58d7c636fe00c6770edeb0401812b1a5e8fc/ethpm/utils/registry.py#L5-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035138", "code": "def log_level(level):\n    \"\"\"This is a function that returns a python like\n    level from a HEASOFT like level.\n    \"\"\"\n\n    levels_dict = {0: 50,\n                   1: 40,\n                   2: 30,\n                   3: 20,\n                   4: 10}\n\n    if not isinstance(level, int):\n        level = int(level)\n\n    if level > 4:\n        level = 4\n\n    return levels_dict[level]", "entry_point": "log_level", "input": "2.0", "output": "30", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/logger.py#L11-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035139", "code": "def reduce_by_keys(orig_dict, keys, default=None):\n    \"\"\"Reduce a dictionary by selecting a set of keys \"\"\"\n    ret = {}\n    for key in keys:\n        ret[key] = orig_dict.get(key, default)\n    return ret", "entry_point": "reduce_by_keys", "input": "{'x': [1, 2], 'y': []}, ['a', 'b', 'c'], [1, 2, 3]", "output": "{'a': [1, 2, 3], 'b': [1, 2, 3], 'c': [1, 2, 3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/link.py#L184-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035140", "code": "def construct_docstring(options):\n        \"\"\"Construct a docstring for a set of options\"\"\"\n        s = \"\\nParameters\\n\"\n        s += \"----------\\n\\n\"\n        for key, opt in options.items():\n            s += \"%s : %s\\n      %s [%s]\\n\" % (key, str(opt[2]),\n                                               str(opt[1]), str(opt[0]))\n        return s", "entry_point": "construct_docstring", "input": "{}", "output": "'\\nParameters\\n----------\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/link.py#L292-L299", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035141", "code": "def cast_pars_dict(pars_dict):\n    \"\"\"Cast the bool and float elements of a parameters dict to\n    the appropriate python types.\n    \"\"\"\n\n    o = {}\n\n    for pname, pdict in pars_dict.items():\n\n        o[pname] = {}\n\n        for k, v in pdict.items():\n\n            if k == 'free':\n                o[pname][k] = bool(int(v))\n            elif k == 'name':\n                o[pname][k] = v\n            else:\n                o[pname][k] = float(v)\n\n    return o", "entry_point": "cast_pars_dict", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/model_utils.py#L200-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035142", "code": "def _fill_array_from_list(the_list, the_array):\n        \"\"\"Fill an `array` from a `list`\"\"\"\n        for i, val in enumerate(the_list):\n            the_array[i] = val\n        return the_array", "entry_point": "_fill_array_from_list", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/job_archive.py#L350-L354", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035143", "code": "def make_catalog_sources(catalog_roi_model, source_names):\n    \"\"\"Construct and return dictionary of sources that are a subset of sources\n    in catalog_roi_model.\n\n    Parameters\n    ----------\n\n    catalog_roi_model : dict or `fermipy.roi_model.ROIModel`\n        Input set of sources\n\n    source_names : list\n        Names of sourcs to extract\n\n    Returns dict mapping source_name to `fermipy.roi_model.Source` object\n    \"\"\"\n    sources = {}\n    for source_name in source_names:\n        sources[source_name] = catalog_roi_model[source_name]\n    return sources", "entry_point": "make_catalog_sources", "input": "{'x': [1, 2], 'y': []}, set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/source_factory.py#L65-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035144", "code": "def render_pep440(vcs):\n    \"\"\"Convert git release tag into a form that is PEP440 compliant.\"\"\"\n\n    if vcs is None:\n        return None\n\n    tags = vcs.split('-')\n\n    # Bare version number\n    if len(tags) == 1:\n        return tags[0]\n    else:\n        return tags[0] + '+' + '.'.join(tags[1:])", "entry_point": "render_pep440", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/version.py#L62-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035145", "code": "def overlap_slices(large_array_shape, small_array_shape, position):\n    \"\"\"\n    Modified version of `~astropy.nddata.utils.overlap_slices`.\n\n    Get slices for the overlapping part of a small and a large array.\n\n    Given a certain position of the center of the small array, with\n    respect to the large array, tuples of slices are returned which can be\n    used to extract, add or subtract the small array at the given\n    position. This function takes care of the correct behavior at the\n    boundaries, where the small array is cut of appropriately.\n\n    Parameters\n    ----------\n    large_array_shape : tuple\n        Shape of the large array.\n    small_array_shape : tuple\n        Shape of the small array.\n    position : tuple\n        Position of the small array's center, with respect to the large array.\n        Coordinates should be in the same order as the array shape.\n\n    Returns\n    -------\n    slices_large : tuple of slices\n        Slices in all directions for the large array, such that\n        ``large_array[slices_large]`` extracts the region of the large array\n        that overlaps with the small array.\n    slices_small : slice\n        Slices in all directions for the small array, such that\n        ``small_array[slices_small]`` extracts the region that is inside the\n        large array.\n    \"\"\"\n    # Get edge coordinates\n    edges_min = [int(pos - small_shape // 2) for (pos, small_shape) in\n                 zip(position, small_array_shape)]\n    edges_max = [int(pos + (small_shape - small_shape // 2)) for\n                 (pos, small_shape) in\n                 zip(position, small_array_shape)]\n\n    # Set up slices\n    slices_large = tuple(slice(max(0, edge_min), min(large_shape, edge_max))\n                         for (edge_min, edge_max, large_shape) in\n                         zip(edges_min, edges_max, large_array_shape))\n    slices_small = tuple(slice(max(0, -edge_min),\n                               min(large_shape - edge_min,\n                                   edge_max - edge_min))\n                         for (edge_min, edge_max, large_shape) in\n                         zip(edges_min, edges_max, large_array_shape))\n\n    return slices_large, slices_small", "entry_point": "overlap_slices", "input": "[], [5, 3, 1, 4], [1, 2, 3]", "output": "((), ())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/utils.py#L1828-L1878", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035146", "code": "def get_slac_default_args(job_time=1500):\n    \"\"\" Create a batch job interface object.\n\n    Parameters\n    ----------\n\n    job_time : int\n        Expected max length of the job, in seconds.\n        This is used to select the batch queue and set the\n        job_check_sleep parameter that sets how often\n        we check for job completion.\n\n    \"\"\"\n    slac_default_args = dict(lsf_args={'W': job_time,\n                                       'R': '\\\"select[rhel60&&!fell]\\\"'},\n                             max_jobs=500,\n                             time_per_cycle=15,\n                             jobs_per_cycle=20,\n                             max_job_age=90,\n                             no_batch=False)\n    return slac_default_args.copy()", "entry_point": "get_slac_default_args", "input": "[[1, 2], [3], []]", "output": "{'lsf_args': {'W': [[1, 2], [3], []], 'R': '\"select[rhel60&&!fell]\"'}, 'max_jobs': 500, 'time_per_cycle': 15, 'jobs_per_cycle': 20, 'max_job_age': 90, 'no_batch': False}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/slac_impl.py#L242-L262", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035147", "code": "def make_rev_dict_unique(cdict):\n    \"\"\" Make a reverse dictionary\n\n    Parameters\n    ----------\n    in_dict : dict(int:dict(int:True))    \n       A dictionary of clusters.  Each cluster is a source index and\n       the dictionary of other sources in the cluster.\n\n    Returns\n    -------\n    rev_dict : dict(int:dict(int:True))    \n       A dictionary pointing from source index to the clusters it is\n       included in.\n\n    \"\"\"\n    rev_dict = {}\n    for k, v in cdict.items():\n        if k in rev_dict:\n            rev_dict[k][k] = True\n        else:\n            rev_dict[k] = {k: True}\n        for vv in v.keys():\n            if vv in rev_dict:\n                rev_dict[vv][k] = True\n            else:\n                rev_dict[vv] = {k: True}\n    return rev_dict", "entry_point": "make_rev_dict_unique", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L157-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035148", "code": "def make_dict_from_vector(in_array):\n    \"\"\" Converts the cluster membership array stored in a fits file back to a dictionary\n\n    Parameters\n    ----------\n    in_array : `np.ndarray' \n       An array filled with the index of the seed of a cluster if a source belongs to a cluster, \n       and with -1 if it does not.\n\n    Returns\n    -------\n    returns dict(int:[int,...])  \n       Dictionary of clusters keyed by the best source in each cluster\n    \"\"\"\n    out_dict = {}\n    for i, k in enumerate(in_array):\n        if k < 0:\n            continue\n        try:\n            out_dict[k].append(i)\n        except KeyError:\n            out_dict[k] = [i]\n    return out_dict", "entry_point": "make_dict_from_vector", "input": "[5, 3, 1, 4]", "output": "{5: [0], 3: [1], 1: [2], 4: [3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L494-L516", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035149", "code": "def extract_parameters(pil, keys=None):\n    \"\"\"Extract and return parameter names and values from a pil object\n\n    Parameters\n    ----------\n\n    pil : `Pil` object\n\n    keys : list\n        List of parameter names, if None, extact all parameters\n\n    Returns\n    -------\n\n    out_dict : dict\n        Dictionary with parameter name, value pairs\n    \"\"\"\n    out_dict = {}\n    if keys is None:\n        keys = pil.keys()\n    for key in keys:\n        try:\n            out_dict[key] = pil[key]\n        except ValueError:\n            out_dict[key] = None\n    return out_dict", "entry_point": "extract_parameters", "input": "[5, 3, 1, 4], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/gtlink.py#L14-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035150", "code": "def cadhumidex(temp, humidity):\n    \"Calculate Humidity Index as per Canadian Weather Standards\"\n    if temp is None or humidity is None:\n        return None\n    # Formulas are adapted to not use e^(...) with no appreciable\n    # change in accuracy (0.0227%)\n    saturation_pressure = (6.112 * (10.0**(7.5 * temp / (237.7 + temp))) *\n                           float(humidity) / 100.0)\n    return temp + (0.555 * (saturation_pressure - 10.0))", "entry_point": "cadhumidex", "input": "True, True", "output": "-4.513533295201688", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jim-easterbrook/pywws/blob/4e4d74cee5a3ac5bf42286feaa251cd2ffcaf02c/src/pywws/conversions.py#L202-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035151", "code": "def wind_chill(temp, wind):\n    \"\"\"Compute wind chill, using formula from\n    http://en.wikipedia.org/wiki/wind_chill\n\n    \"\"\"\n    if temp is None or wind is None:\n        return None\n    wind_kph = wind * 3.6\n    if wind_kph <= 4.8 or temp > 10.0:\n        return temp\n    return min(13.12 + (temp * 0.6215) +\n               (((0.3965 * temp) - 11.37) * (wind_kph ** 0.16)),\n               temp)", "entry_point": "wind_chill", "input": "'abc', False", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jim-easterbrook/pywws/blob/4e4d74cee5a3ac5bf42286feaa251cd2ffcaf02c/src/pywws/conversions.py#L240-L252", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035152", "code": "def get_formatted_time(seconds: float) -> str:\n    \"\"\"\n    Convert seconds to the time format ``H:M:S.UU``.\n\n    :param seconds: time in seconds\n    :return: formatted human-readable time\n    \"\"\"\n    seconds = round(seconds)\n    m, s = divmod(seconds, 60)\n    h, m = divmod(m, 60)\n    return '{:d}:{:02d}:{:02d}'.format(h, m, s)", "entry_point": "get_formatted_time", "input": "False", "output": "'0:00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Cognexa/cxflow/blob/dd609e6b0bd854424a8f86781dd77801a13038f9/cxflow/hooks/show_progress.py#L47-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035153", "code": "def _make_canonical_headers(headers, headers_to_sign):\n    \"\"\"\n    Return canonicalized headers.\n\n    @param headers: The request headers.\n    @type headers: L{dict}\n\n    @param headers_to_sign: A sequence of header names that should be\n        signed.\n    @type headers_to_sign: A sequence of L{bytes}\n\n    @return: The canonicalized headers.\n    @rtype: L{bytes}\n    \"\"\"\n    pairs = []\n    for name in headers_to_sign:\n        if name not in headers:\n            continue\n        values = headers[name]\n        if not isinstance(values, (list, tuple)):\n            values = [values]\n        comma_values = b','.join(' '.join(line.strip().split())\n                                 for value in values\n                                 for line in value.splitlines())\n        pairs.append((name.lower(), comma_values))\n\n    sorted_pairs = sorted(b'%s:%s' % (name, value)\n                          for name, value in sorted(pairs))\n    return b'\\n'.join(sorted_pairs) + b'\\n'", "entry_point": "_make_canonical_headers", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "b'\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/twisted/txaws/blob/5c3317376cd47e536625027e38c3b37840175ce0/txaws/_auth_v4.py#L121-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035154", "code": "def _make_signed_headers(headers, headers_to_sign):\n    \"\"\"\n    Return a semicolon-delimited list of headers to sign.\n\n    @param headers: The request headers.\n    @type headers: L{dict}\n\n    @param headers_to_sign: A sequence of header names that should be\n        signed.\n    @type headers_to_sign: L{bytes}\n\n    @return: The semicolon-delimited list of headers.\n    @rtype: L{bytes}\n    \"\"\"\n    return b\";\".join(header.lower() for header in sorted(headers_to_sign)\n                     if header in headers)", "entry_point": "_make_signed_headers", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "b''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/twisted/txaws/blob/5c3317376cd47e536625027e38c3b37840175ce0/txaws/_auth_v4.py#L152-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035155", "code": "def plural_fmt(name, cnt):\n        \"\"\"\n        pluralize name if necessary and combine with cnt\n        :param name: str name of the item type\n        :param cnt: int number items of this type\n        :return: str name and cnt joined\n        \"\"\"\n        if cnt == 1:\n            return '{} {}'.format(cnt, name)\n        else:\n            return '{} {}s'.format(cnt, name)", "entry_point": "plural_fmt", "input": "'a,b,c', [[1, 2], [3], []]", "output": "'[[1, 2], [3], []] a,b,cs'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Duke-GCB/DukeDSClient/blob/117f68fb9bae82e4c81ea487ad5d61ac350f3726/ddsc/core/upload.py#L173-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035156", "code": "def divide_work(list_of_indexes, batch_size):\n        \"\"\"\n        Given a sequential list of indexes split them into num_parts.\n        :param list_of_indexes: [int] list of indexes to be divided up\n        :param batch_size: number of items to put in batch(not exact obviously)\n        :return: [(int,int)] list of (index, num_items) to be processed\n        \"\"\"\n        grouped_indexes = [list_of_indexes[i:i + batch_size] for i in range(0, len(list_of_indexes), batch_size)]\n        return [(batch[0], len(batch)) for batch in grouped_indexes]", "entry_point": "divide_work", "input": "[5, 3, 1, 4], 5", "output": "[(5, 4)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Duke-GCB/DukeDSClient/blob/117f68fb9bae82e4c81ea487ad5d61ac350f3726/ddsc/core/fileuploader.py#L294-L302", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035157", "code": "def non_zero_row(arr):\n    \"\"\"\n        0.  Empty row returns False.\n\n            >>> arr = array([])\n            >>> non_zero_row(arr)\n\n            False\n\n        1.  Row with a zero returns False.\n\n            >>> arr = array([1, 4, 3, 0, 5, -1, -2])\n            >>> non_zero_row(arr)\n\n            False\n        2.  Row with no zeros returns True.\n\n            >>> arr = array([-1, -0.1, 0.001, 2])\n            >>> non_zero_row(arr)\n\n            True\n\n        :param arr: array\n        :type arr: numpy array\n        :return empty: If row is completely free of zeros\n        :rtype empty: bool\n    \"\"\"\n\n    if len(arr) == 0:\n        return False\n\n    for item in arr:\n        if item == 0:\n            return False\n\n    return True", "entry_point": "non_zero_row", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pdkit/pdkit/blob/c7120263da2071bb139815fbdb56ca77b544f340/pdkit/utils.py#L944-L979", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035158", "code": "def embed_hex(runtime_hex, python_hex=None):\n    \"\"\"\n    Given a string representing the MicroPython runtime hex, will embed a\n    string representing a hex encoded Python script into it.\n\n    Returns a string representation of the resulting combination.\n\n    Will raise a ValueError if the runtime_hex is missing.\n\n    If the python_hex is missing, it will return the unmodified runtime_hex.\n    \"\"\"\n    if not runtime_hex:\n        raise ValueError('MicroPython runtime hex required.')\n    if not python_hex:\n        return runtime_hex\n    py_list = python_hex.split()\n    runtime_list = runtime_hex.split()\n    embedded_list = []\n    # The embedded list should be the original runtime with the Python based\n    # hex embedded two lines from the end.\n    embedded_list.extend(runtime_list[:-5])\n    embedded_list.extend(py_list)\n    embedded_list.extend(runtime_list[-5:])\n    return '\\n'.join(embedded_list) + '\\n'", "entry_point": "embed_hex", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ntoll/uflash/blob/867468d386da0aa20212b69a152ce8bfc0972366/uflash.py#L145-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035159", "code": "def str2bool(string_, default='raise'):\n    \"\"\"\n    Convert a string to a bool.\n\n    Parameters\n    ----------\n    string_ : str\n    default : {'raise', False}\n        Default behaviour if none of the \"true\" strings is detected.\n\n    Returns\n    -------\n    boolean : bool\n\n    Examples\n    --------\n    >>> str2bool('True')\n    True\n    >>> str2bool('1')\n    True\n    >>> str2bool('0')\n    False\n    \"\"\"\n    true = ['true', 't', '1', 'y', 'yes', 'enabled', 'enable', 'on']\n    false = ['false', 'f', '0', 'n', 'no', 'disabled', 'disable', 'off']\n    if string_.lower() in true:\n        return True\n    elif string_.lower() in false or (not default):\n        return False\n    else:\n        raise ValueError('The value \\'{}\\' cannot be mapped to boolean.'\n                         .format(string_))", "entry_point": "str2bool", "input": "'walnut thistle harbour', []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/string.py#L124-L155", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035160", "code": "def is_none(string_, default='raise'):\n    \"\"\"\n    Check if a string is equivalent to None.\n\n    Parameters\n    ----------\n    string_ : str\n    default : {'raise', False}\n        Default behaviour if none of the \"None\" strings is detected.\n\n    Returns\n    -------\n    is_none : bool\n\n    Examples\n    --------\n    >>> is_none('2', default=False)\n    False\n    >>> is_none('undefined', default=False)\n    True\n    \"\"\"\n    none = ['none', 'undefined', 'unknown', 'null', '']\n    if string_.lower() in none:\n        return True\n    elif not default:\n        return False\n    else:\n        raise ValueError('The value \\'{}\\' cannot be mapped to none.'\n                         .format(string_))", "entry_point": "is_none", "input": "'', [1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/string.py#L266-L294", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035161", "code": "def _calculate_german_iban_checksum(iban,\n                                    iban_fields='DEkkbbbbbbbbcccccccccc'):\n    \"\"\"\n    Calculate the checksam of the German IBAN format.\n\n    Examples\n    --------\n    >>> iban =        'DE41500105170123456789'\n    >>> _calculate_german_iban_checksum(iban)\n    '41'\n    \"\"\"\n    number = [value\n              for field_type, value in zip(iban_fields, iban)\n              if field_type in ['b', 'c']]\n    translate = {'0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5',\n                 '6': '6', '7': '7', '8': '8', '9': '9'}\n    for i in range(ord('A'), ord('Z') + 1):\n        translate[chr(i)] = str(i - ord('A') + 10)\n    for val in 'DE00':\n        translated = translate[val]\n        for char in translated:\n            number.append(char)\n    number = sum(int(value) * 10**i for i, value in enumerate(number[::-1]))\n    checksum = 98 - (number % 97)\n    return str(checksum)", "entry_point": "_calculate_german_iban_checksum", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "'36'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/string.py#L349-L373", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035162", "code": "def human_readable_bytes(nb_bytes, suffix='B'):\n    \"\"\"\n    Convert a byte number into a human readable format.\n\n    Parameters\n    ----------\n    nb_bytes : number\n    suffix : str, optional (default: \"B\")\n\n    Returns\n    -------\n    size_str : str\n\n    Examples\n    --------\n    >>> human_readable_bytes(123)\n    '123.0 B'\n\n    >>> human_readable_bytes(1025)\n    '1.0 KiB'\n\n    >>> human_readable_bytes(9671406556917033397649423)\n    '8.0 YiB'\n    \"\"\"\n    for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:\n        if abs(nb_bytes) < 1024.0:\n            return '%3.1f %s%s' % (nb_bytes, unit, suffix)\n        nb_bytes /= 1024.0\n    return '%.1f %s%s' % (nb_bytes, 'Yi', suffix)", "entry_point": "human_readable_bytes", "input": "-1.5, {'a': 1, 'b': 2}", "output": "\"-1.5 {'a': 1, 'b': 2}\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/string.py#L376-L404", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035163", "code": "def set_dict_value(dictionary, keys, value):\n    \"\"\"\n    Set a value in a (nested) dictionary by defining a list of keys.\n\n    .. note:: Side-effects\n              This function does not make a copy of dictionary, but directly\n              edits it.\n\n    Parameters\n    ----------\n    dictionary : dict\n    keys : List[Any]\n    value : object\n\n    Returns\n    -------\n    dictionary : dict\n\n    Examples\n    --------\n    >>> d = {'a': {'b': 'c', 'd': 'e'}}\n    >>> expected = {'a': {'b': 'foobar', 'd': 'e'}}\n    >>> set_dict_value(d, ['a', 'b'], 'foobar') == expected\n    True\n    \"\"\"\n    orig = dictionary\n    for key in keys[:-1]:\n        dictionary = dictionary.setdefault(key, {})\n    dictionary[keys[-1]] = value\n    return orig", "entry_point": "set_dict_value", "input": "{'a': 1, 'b': 2}, [-1, 0, 1, 2], ['a', 'b', 'c']", "output": "{'a': 1, 'b': 2, -1: {0: {1: {2: ['a', 'b', 'c']}}}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/datastructures.py#L192-L221", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035164", "code": "def does_keychain_exist(dict_, list_):\n    \"\"\"\n    Check if a sequence of keys exist in a nested dictionary.\n\n    Parameters\n    ----------\n    dict_ : Dict[str/int/tuple, Any]\n    list_ : List[str/int/tuple]\n\n    Returns\n    -------\n    keychain_exists : bool\n\n    Examples\n    --------\n    >>> d = {'a': {'b': {'c': 'd'}}}\n    >>> l_exists = ['a', 'b']\n    >>> does_keychain_exist(d, l_exists)\n    True\n\n    >>> l_no_existant = ['a', 'c']\n    >>> does_keychain_exist(d, l_no_existant)\n    False\n    \"\"\"\n    for key in list_:\n        if key not in dict_:\n            return False\n        dict_ = dict_[key]\n    return True", "entry_point": "does_keychain_exist", "input": "{}, [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/datastructures.py#L224-L252", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035165", "code": "def argmax(iterable):\n    \"\"\"\n    Find the first index of the biggest value in the iterable.\n\n    Parameters\n    ----------\n    iterable : iterable\n\n    Returns\n    -------\n    argmax : int\n\n    Examples\n    --------\n    >>> argmax([0, 0, 0])\n    0\n    >>> argmax([1, 0, 0])\n    0\n    >>> argmax([0, 1, 0])\n    1\n    >>> argmax([])\n    \"\"\"\n    max_value = None\n    max_index = None\n    for index, value in enumerate(iterable):\n        if (max_value is None) or max_value < value:\n            max_value = value\n            max_index = index\n    return max_index", "entry_point": "argmax", "input": "['a', 'b', 'c']", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/math.py#L152-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035166", "code": "def clip(number, lowest=None, highest=None):\n    \"\"\"\n    Clip a number to a given lowest / highest value.\n\n    Parameters\n    ----------\n    number : number\n    lowest : number, optional\n    highest : number, optional\n\n    Returns\n    -------\n    clipped_number : number\n\n    Examples\n    --------\n    >>> clip(42, lowest=0, highest=10)\n    10\n    \"\"\"\n    if lowest is not None:\n        number = max(number, lowest)\n    if highest is not None:\n        number = min(number, highest)\n    return number", "entry_point": "clip", "input": "2, -1.5, -3", "output": "-3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/__init__.py#L40-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035167", "code": "def findall(lst, key, value):\n    \"\"\"\n    Find all items in lst where key matches value.\n    For example find all ``LAYER`` s in a ``MAP`` where ``GROUP`` equals ``VALUE``\n\n    Parameters\n    ----------\n\n    list: list\n        A list of composite dictionaries e.g. ``layers``, ``classes``\n    key: string\n        The key name to search each dictionary in the list\n    key: value\n        The value to search for\n\n    Returns\n    -------\n\n    list\n        A Python list containing the matching composite dictionaries\n\n    Example\n    -------\n\n    To find all ``LAYER`` s with ``GROUP`` set to ``test``::\n\n        s = '''\n        MAP\n            LAYER\n                NAME \"Layer1\"\n                TYPE POLYGON\n                GROUP \"test\"\n            END\n            LAYER\n                NAME \"Layer2\"\n                TYPE POLYGON\n                GROUP \"test1\"\n            END\n            LAYER\n                NAME \"Layer3\"\n                TYPE POLYGON\n                GROUP \"test2\"\n            END\n            LAYER\n                NAME \"Layer4\"\n                TYPE POLYGON\n                GROUP \"test\"\n            END\n        END\n        '''\n\n        d = mappyfile.loads(s)\n        layers = mappyfile.findall(d[\"layers\"], \"group\", \"test\")\n        assert len(layers) == 2\n    \"\"\"\n    return [item for item in lst if item[key.lower()] in value]", "entry_point": "findall", "input": "[], 3, 5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/geographika/mappyfile/blob/aecbc5e66ec06896bc4c5db41313503468829d00/mappyfile/utils.py#L342-L397", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035168", "code": "def findunique(lst, key):\n    \"\"\"\n    Find all unique key values for items in lst.\n\n    Parameters\n    ----------\n\n    lst: list\n         A list of composite dictionaries e.g. ``layers``, ``classes``\n    key: string\n        The key name to search each dictionary in the list\n\n    Returns\n    -------\n\n    list\n        A sorted Python list of unique keys in the list\n\n    Example\n    -------\n\n    To find all ``GROUP`` values for ``CLASS`` in a ``LAYER``::\n\n        s = '''\n        LAYER\n            CLASS\n                GROUP \"group1\"\n                NAME \"Class1\"\n                COLOR 0 0 0\n            END\n            CLASS\n                GROUP \"group2\"\n                NAME \"Class2\"\n                COLOR 0 0 0\n            END\n            CLASS\n                GROUP \"group1\"\n                NAME \"Class3\"\n                COLOR 0 0 0\n            END\n        END\n        '''\n\n        d = mappyfile.loads(s)\n        groups = mappyfile.findunique(d[\"classes\"], \"group\")\n        assert groups == [\"group1\", \"group2\"]\n    \"\"\"\n    return sorted(set([item[key.lower()] for item in lst]))", "entry_point": "findunique", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/geographika/mappyfile/blob/aecbc5e66ec06896bc4c5db41313503468829d00/mappyfile/utils.py#L400-L447", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035169", "code": "def escape_string(string):\n    \"\"\"Escape a string for use in Gerrit commands.\n\n    :arg str string: The string to escape.\n\n    :returns: The string with necessary escapes and surrounding double quotes\n        so that it can be passed to any of the Gerrit commands that require\n        double-quoted strings.\n\n    \"\"\"\n    result = string\n    result = result.replace('\\\\', '\\\\\\\\')\n    result = result.replace('\"', '\\\\\"')\n    return '\"' + result + '\"'", "entry_point": "escape_string", "input": "'Hello World'", "output": "'\"Hello World\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dpursehouse/pygerrit2/blob/141031469603b33369d89c38c703390eb3786bd0/pygerrit2/__init__.py#L49-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035170", "code": "def zimbra_to_python(zimbra_dict, key_attribute=\"n\",\n                     content_attribute=\"_content\"):\n\n    \"\"\"\n    Converts single level Zimbra dicts to a standard python dict\n\n    :param zimbra_dict: The dictionary in Zimbra-Format\n    :return: A native python dict\n    \"\"\"\n\n    local_dict = {}\n\n    for item in zimbra_dict:\n\n        local_dict[item[key_attribute]] = item[content_attribute]\n\n    return local_dict", "entry_point": "zimbra_to_python", "input": "{}, [-1, 0, 1, 2], [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Zimbra-Community/python-zimbra/blob/8b839143c64b0507a30a9908ff39066ae4ef5d03/pythonzimbra/tools/dict.py#L15-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035171", "code": "def clean_meta(rst_content):\n    \"\"\"remove moinmoin metada from the top of the file\"\"\"\n\n    rst = rst_content.split('\\n')\n    for i, line in enumerate(rst):\n        if line.startswith('#'):\n            continue\n        break\n    return '\\n'.join(rst[i:])", "entry_point": "clean_meta", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mgaitan/waliki/blob/5baaf6f043275920a1174ff233726f7ff4bfb5cf/waliki/management/commands/moin_migration_cleanup.py#L21-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035172", "code": "def camel_to_snake(camel):\n    \"\"\"Convert camelCase to snake_case.\"\"\"\n    ret = []\n    last_lower = False\n    for char in camel:\n        current_upper = char.upper() == char\n        if current_upper and last_lower:\n            ret.append(\"_\")\n            ret.append(char.lower())\n        else:\n            ret.append(char.lower())\n        last_lower = not current_upper\n    return \"\".join(ret)", "entry_point": "camel_to_snake", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/artefactual-labs/mets-reader-writer/blob/d95939cabdfdc25cb1bf67df0c84bd0d6e6a73ff/metsrw/plugins/premisrw/utils.py#L69-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035173", "code": "def xsd_error_log_string(xsd_error_log):\n    \"\"\"Return a human-readable string representation of the error log\n    returned by lxml's XMLSchema validator.\n    \"\"\"\n    ret = []\n    for error in xsd_error_log:\n        ret.append(\n            \"ERROR ON LINE {}: {}\".format(error.line, error.message.encode(\"utf-8\"))\n        )\n    return \"\\n\".join(ret)", "entry_point": "xsd_error_log_string", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/artefactual-labs/mets-reader-writer/blob/d95939cabdfdc25cb1bf67df0c84bd0d6e6a73ff/metsrw/validate.py#L130-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035174", "code": "def format_interface_name(intf_type, port, ch_grp=0):\n    \"\"\"Method to format interface name given type, port.\n\n    Given interface type, port, and channel-group, this\n    method formats an interface name.  If channel-group is\n    non-zero, then port-channel is configured.\n\n    :param intf_type: Such as 'ethernet' or 'port-channel'\n    :param port: unique identification -- 1/32 or 1\n    :ch_grp: If non-zero, ignore other params and format\n             port-channel<ch_grp>\n    :returns: the full formatted interface name.\n              ex: ethernet:1/32, port-channel:1\n    \"\"\"\n    if ch_grp > 0:\n        return 'port-channel:%s' % str(ch_grp)\n\n    return '%s:%s' % (intf_type.lower(), port)", "entry_point": "format_interface_name", "input": "'', 7, 2.0", "output": "'port-channel:2.0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_helpers.py#L23-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035175", "code": "def split_interface_name(interface, ch_grp=0):\n    \"\"\"Method to split interface type, id from name.\n\n    Takes an interface name or just interface suffix\n    and returns interface type and number separately.\n\n    :param interface: interface name or just suffix\n    :param ch_grp: if non-zero, ignore interface\n                   name and return 'port-channel' grp\n    :returns: interface type like 'ethernet'\n    :returns: returns suffix to interface name\n    \"\"\"\n\n    interface = interface.lower()\n    if ch_grp != 0:\n        intf_type = 'port-channel'\n        port = str(ch_grp)\n    elif ':' in interface:\n        intf_type, port = interface.split(':')\n    elif interface.startswith('ethernet'):\n        interface = interface.replace(\" \", \"\")\n        _, intf_type, port = interface.partition('ethernet')\n    elif interface.startswith('port-channel'):\n        interface = interface.replace(\" \", \"\")\n        _, intf_type, port = interface.partition('port-channel')\n    else:\n        intf_type, port = 'ethernet', interface\n\n    return intf_type, port", "entry_point": "split_interface_name", "input": "'walnut thistle harbour', '  padded  '", "output": "('port-channel', '  padded  ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_helpers.py#L43-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035176", "code": "def is_valid_mac(addr):\n    \"\"\"Check the syntax of a given mac address.\n\n    The acceptable format is xx:xx:xx:xx:xx:xx\n    \"\"\"\n    addrs = addr.split(':')\n    if len(addrs) != 6:\n        return False\n    for m in addrs:\n        try:\n            if int(m, 16) > 255:\n                return False\n        except ValueError:\n            return False\n    return True", "entry_point": "is_valid_mac", "input": "'AbC dEf'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/utils.py#L144-L158", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035177", "code": "def _get_item(list_containing_dicts_entries, attribute_value,\n                  attribute_name='subnet_id'):\n        \"\"\"Searches a list of dicts and returns the first matching entry\n\n        The dict entry returned contains the attribute 'attribute_name' whose\n        value equals 'attribute_value'. If no such dict is found in the list\n        an empty dict is returned.\n        \"\"\"\n        for item in list_containing_dicts_entries:\n            if item.get(attribute_name) == attribute_value:\n                return item\n        return {}", "entry_point": "_get_item", "input": "{}, [-1, 0, 1, 2], 'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L425-L436", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035178", "code": "def bool_from(obj, default=False):\n    \"\"\"Returns True if obj is not None and its string representation is not 0 or False (case-insensitive). If obj is\n    None, 'default' is used.\n    \"\"\"\n    return str(obj).lower() not in ('0', 'false') if obj is not None else bool(default)", "entry_point": "bool_from", "input": "[], ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Iotic-Labs/py-IoticAgent/blob/893e8582ad1dacfe32dfc0ee89452bbd6f57d28d/src/IoticAgent/IOT/utils.py#L66-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035179", "code": "def is_null(value):\n    \"\"\"\n    Check if the scalar value or tuple/list value is NULL.\n\n    :param value: Value to check.\n    :type value: a scalar or tuple or list\n\n    :return: Returns ``True`` if and only if the value is NULL (scalar value is None\n        or _any_ tuple/list elements are None).\n    :rtype: bool\n    \"\"\"\n    if type(value) in (tuple, list):\n        for v in value:\n            if v is None:\n                return True\n        return False\n    else:\n        return value is None", "entry_point": "is_null", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crossbario/zlmdb/blob/577e8ce9314484f1fd5092fb4eef70221bb1d030/zlmdb/_pmap.py#L245-L262", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035180", "code": "def uniqued(iterable):\n    \"\"\"Return unique list of ``iterable`` items preserving order.\n\n    >>> uniqued('spameggs')\n    ['s', 'p', 'a', 'm', 'e', 'g']\n    \"\"\"\n    seen = set()\n    return [item for item in iterable if item not in seen and not seen.add(item)]", "entry_point": "uniqued", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xflr6/gsheets/blob/ca4f1273044704e529c1138e3f942836fc496e1b/gsheets/tools.py#L133-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035181", "code": "def convert_double_to_two_registers(doubleValue):\n    \"\"\"\n    Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers\n    doubleValue: Value to be converted\n    return: 16 Bit Register values int[]\n    \"\"\"  \n    myList = list()\n    myList.append(int(doubleValue & 0x0000FFFF))         #Append Least Significant Word      \n    myList.append(int((doubleValue & 0xFFFF0000)>>16))   #Append Most Significant Word      \n    return myList", "entry_point": "convert_double_to_two_registers", "input": "False", "output": "[0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rossmann-engineering/EasyModbusTCP.PY/blob/3ea417470288619ba63ec0474ed1da6bcf105b70/easymodbus/modbusClient.py#L951-L960", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035182", "code": "def add_snmp(data, interfaces):\n    \"\"\"\n    Format data for adding SNMP to an engine.\n    \n    :param list data: list of interfaces as provided by kw\n    :param list interfaces: interfaces to enable SNMP by id\n    \"\"\"\n    snmp_interface = []\n    if interfaces: # Not providing interfaces will enable SNMP on all NDIs\n        interfaces = map(str, interfaces)\n        for interface in data:\n            interface_id = str(interface.get('interface_id'))\n            for if_def in interface.get('interfaces', []):\n                _interface_id = None\n                if 'vlan_id' in if_def:\n                    _interface_id = '{}.{}'.format(\n                        interface_id, if_def['vlan_id'])\n                else:\n                    _interface_id = interface_id\n                if _interface_id in interfaces and 'type' not in interface:\n                    for node in if_def.get('nodes', []):\n                        snmp_interface.append(\n                            {'address': node.get('address'),\n                             'nicid': _interface_id})\n    return snmp_interface", "entry_point": "add_snmp", "input": "[1, 2, 3], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabstopper/smc-python/blob/e027b8a5dcfaf884eada32d113d41c1e56b32457/smc/core/engines.py#L824-L848", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035183", "code": "def transform_login(config):\n    \"\"\"\n    Parse login data as dict. Called from load_from_file and\n    also can be used when collecting information from other\n    sources as well.\n\n    :param dict data: data representing the valid key/value pairs\n           from smcrc\n    :return: dict dict of settings that can be sent into session.login\n    \"\"\"\n    verify = True\n    if config.pop('smc_ssl', None):\n        scheme = 'https'\n\n        verify = config.pop('ssl_cert_file', None)\n        if config.pop('verify_ssl', None):    \n            # Get cert path to verify\n            if not verify:  # Setting omitted or already False\n                verify = False\n        else:\n            verify = False\n    else:\n        scheme = 'http'\n        config.pop('verify_ssl', None)\n        config.pop('ssl_cert_file', None)\n        verify = False\n\n    transformed = {}\n    url = '{}://{}:{}'.format(\n        scheme,\n        config.pop('smc_address', None),\n        config.pop('smc_port', None))\n\n    timeout = config.pop('timeout', None)\n    if timeout:\n        try:\n            timeout = int(timeout)\n        except ValueError:\n            timeout = None\n\n    api_version = config.pop('api_version', None)\n    if api_version:\n        try:\n            float(api_version)\n        except ValueError:\n            api_version = None\n    \n    transformed.update(\n        url=url,\n        api_key=config.pop('smc_apikey', None),\n        api_version=api_version,\n        verify=verify,\n        timeout=timeout,\n        domain=config.pop('domain', None)) \n    \n    if config:\n        transformed.update(kwargs=config) # Any remaining args\n    \n    return transformed", "entry_point": "transform_login", "input": "{}", "output": "{'url': 'http://None:None', 'api_key': None, 'api_version': None, 'verify': False, 'timeout': None, 'domain': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabstopper/smc-python/blob/e027b8a5dcfaf884eada32d113d41c1e56b32457/smc/api/configloader.py#L191-L249", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035184", "code": "def unicode_to_bytes(s, encoding='utf-8', errors='replace'):\n    \"\"\"\n    Helper to convert unicode strings to bytes for data that needs to be\n    written to on output stream (i.e. terminal)\n    For Python 3 this should be called str_to_bytes\n\n    :param str s: string to encode\n    :param str encoding: utf-8 by default\n    :param str errors: what to do when encoding fails\n    :return: byte string utf-8 encoded\n    \"\"\"\n    return s if isinstance(s, str) else s.encode(encoding, errors)", "entry_point": "unicode_to_bytes", "input": "'abc', (1, 2), ('a', 'b', 'c')", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabstopper/smc-python/blob/e027b8a5dcfaf884eada32d113d41c1e56b32457/smc/base/util.py#L134-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035185", "code": "def build_sub_expression(name, ne_ref=None, operator='union'):\n        \"\"\"\n        Static method to build and return the proper json for a sub-expression.\n        A sub-expression would be the grouping of network elements used as a\n        target match. For example, (network A or network B) would be considered\n        a sub-expression. This can be used to compound sub-expressions before\n        calling create.\n\n        :param str name: name of sub-expression\n        :param list ne_ref: network elements references\n        :param str operator: exclusion (negation), union, intersection (default: union)\n        :return: JSON of subexpression. Use in :func:`~create` constructor\n        \"\"\"\n        ne_ref = [] if ne_ref is None else ne_ref\n        json = {'name': name,\n                'ne_ref': ne_ref,\n                'operator': operator}\n        return json", "entry_point": "build_sub_expression", "input": "'  padded  ', [], []", "output": "{'name': '  padded  ', 'ne_ref': [], 'operator': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabstopper/smc-python/blob/e027b8a5dcfaf884eada32d113d41c1e56b32457/smc/elements/network.py#L263-L280", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035186", "code": "def as_dotted(dotted_str):\n    \"\"\"\n    Implement RFC 5396 to support 'asdotted' notation for BGP AS numbers.\n    Provide a string in format of '1.10', '65000.65015' and this will return\n    a 4-byte decimal representation of the AS number.\n    Get the binary values for the int's and pad to 16 bits if necessary\n    (values <255). Concatenate the first 2 bytes with second 2 bytes then\n    convert back to decimal. The maximum for low and high order values is\n    65535 (i.e. 65535.65535).\n    \n    :param str dotted_str: asdotted notation for BGP ASN\n    :rtype: int\n    \"\"\"\n    #max_asn = 4294967295 (65535 * 65535)\n    if '.' not in dotted_str:\n        return dotted_str\n    max_byte = 65535\n    left, right = map(int, dotted_str.split('.'))\n    if left > max_byte or right > max_byte:\n        raise ValueError('The max low and high order value for '\n            'a 32-bit ASN is 65535')\n    binval = \"{0:016b}\".format(left)\n    binval += \"{0:016b}\".format(right)\n    return int(binval, 2)", "entry_point": "as_dotted", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabstopper/smc-python/blob/e027b8a5dcfaf884eada32d113d41c1e56b32457/smc/routing/bgp.py#L289-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035187", "code": "def _extract_ports(port_string):\n    \"\"\"\n    Return a dict for translated_value based on a string or int\n    value.\n    \n    Value could be 80, or '80' or '80-90'.\n    \n    Will be returned as {'min_port': 80, 'max_port': 80} or \n    {'min_port': 80, 'max_port': 90}\n    \n    :rtype: dict\n    \"\"\"\n    _ports = str(port_string)\n    if '-' in _ports:\n        start, end = _ports.split('-')\n        return {'min_port': start, 'max_port': end}\n    return {'min_port': _ports, 'max_port': _ports}", "entry_point": "_extract_ports", "input": "'abc'", "output": "{'min_port': 'abc', 'max_port': 'abc'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabstopper/smc-python/blob/e027b8a5dcfaf884eada32d113d41c1e56b32457/smc/policy/rule_nat.py#L455-L471", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035188", "code": "def _split_dict(dic):\n    '''Split dict into sorted keys and values\n\n    >>> _split_dict({'b': 2, 'a': 1})\n    (['a', 'b'], [1, 2])\n    '''\n    keys = sorted(dic.keys())\n    return keys, [dic[k] for k in keys]", "entry_point": "_split_dict", "input": "{'a': 1, 'b': 2}", "output": "(['a', 'b'], [1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/imbolc/aiohttp-login/blob/43b30d8630ca5c14d4b75c398eb5f6a27ddf0a52/aiohttp_login/sql.py#L110-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035189", "code": "def _parse_title(file_path):\n    \"\"\"\n    Parse a title from a file name\n    \"\"\"\n    title = file_path\n    title = title.split('/')[-1]\n    title = '.'.join(title.split('.')[:-1])\n    title = ' '.join(title.split('-'))\n    title = ' '.join([\n        word.capitalize()\n        for word in title.split(' ')\n    ])\n    return title", "entry_point": "_parse_title", "input": "'Hello World'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Stanford-Online/xblock-image-modal/blob/bd05f99a830a44f8d1a0e6e137e507b8ff8ff028/imagemodal/mixins/scenario.py#L17-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035190", "code": "def _valid_headerline(l):\n    \"\"\"return true if the given string is a valid loadfile header\"\"\"\n\n    if not l:\n        return False\n    headers = l.split('\\t')\n    first_col = headers[0]\n\n    tsplit = first_col.split(':')\n    if len(tsplit) != 2:\n        return False\n\n    if tsplit[0] in ('entity', 'update'):\n        return tsplit[1] in ('participant_id', 'participant_set_id',\n                             'sample_id', 'sample_set_id',\n                             'pair_id', 'pair_set_id')\n    elif tsplit[0] == 'membership':\n        if len(headers) < 2:\n            return False\n        # membership:sample_set_id   sample_id, e.g.\n        return tsplit[1].replace('set_', '') == headers[1]\n    else:\n        return False", "entry_point": "_valid_headerline", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/broadinstitute/fiss/blob/dddf91547479506dbbafb69ec84d44dcc4a94ab4/firecloud/fiss.py#L1729-L1751", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035191", "code": "def chunk_list(list_, size):\n    \"\"\" Split a list list_ into sublists of length size.\n        NOTE: len(chunks[-1]) <= size. \"\"\"\n    ll = len(list_)\n    if ll <= size:\n        return [list_]\n    elif size == 0:\n        return list_ # or None ??\n    elif size == 1:\n        return [[l] for l in list_]\n    else:\n        chunks = []\n        for start, stop in zip(range(0, ll, size), range(size, ll, size)):\n            chunks.append(list_[start:stop])\n        chunks.append(list_[stop:])  # snag unaligned chunks from last stop\n        return chunks", "entry_point": "chunk_list", "input": "[], 5", "output": "[[]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tgbugs/pyontutils/blob/3d913db29c177db39151592909a4f56170ef8b35/pyontutils/utils.py#L428-L443", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035192", "code": "def clean(string):\n    ''' Begining of the string can sometimes have odd noise '''\n    # manual fixes in the source\n    # 24/1.png\n    # 9/1.png\n    # 3/1.png\n    #if ')' in string:  # fix in the source data\n        #string = string.split(')')[0] + ')'  # remove trailing garbage\n    return (string\n            .replace('_', '')\n            .replace('-', '')\n            .replace('\u2014', '')\n            .replace('.', '')\n            .replace('=', '')\n            .replace('\\u2018',\"'\")  # LEFT SINGLE QUOTATION MARK\n            .replace('\\u2019', \"'\")  # RIGHT SINGLE QUOTATION MARK\n            .strip())", "entry_point": "clean", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tgbugs/pyontutils/blob/3d913db29c177db39151592909a4f56170ef8b35/nifstd/nifstd_tools/parcellation/berman.py#L35-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035193", "code": "def pretty_duration(seconds):\n    \"\"\" Returns a user-friendly representation of the provided duration in seconds.\n    For example: 62.8 => \"1m2.8s\", or 129837.8 => \"2d12h4m57.8s\"\n    \"\"\"\n    if seconds is None:\n        return ''\n    ret = ''\n    if seconds >= 86400:\n        ret += '{:.0f}d'.format(int(seconds / 86400))\n        seconds = seconds % 86400\n    if seconds >= 3600:\n        ret += '{:.0f}h'.format(int(seconds / 3600))\n        seconds = seconds % 3600\n    if seconds >= 60:\n        ret += '{:.0f}m'.format(int(seconds / 60))\n        seconds = seconds % 60\n    if seconds > 0:\n        ret += '{:.1f}s'.format(seconds)\n    return ret", "entry_point": "pretty_duration", "input": "-1.5", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dcos/shakedown/blob/e2f9e2382788dbcd29bd18aa058b76e7c3b83b3e/shakedown/dcos/spinner.py#L139-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035194", "code": "def _mergeKerningDictionaries(kerningDictionaries):\n    \"\"\"\n    Merge all of the kerning dictionaries found into\n    one flat dictionary.\n    \"\"\"\n    # work through the dictionaries backwards since\n    # this uses an update to load the kerning. this\n    # will ensure that the script order is honored.\n    kerning = {}\n    for dictionaryGroup in reversed(kerningDictionaries):\n        for dictionary in dictionaryGroup:\n            kerning.update(dictionary)\n    # done.\n    return kerning", "entry_point": "_mergeKerningDictionaries", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/robotools/extractor/blob/da3c2c92bfd3da863dd5de29bd8bc94cbbf433df/Lib/extractor/formats/opentype.py#L597-L610", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035195", "code": "def _findSingleMemberGroups(classDictionaries):\n    \"\"\"\n    Find all classes that have only one member.\n    \"\"\"\n    toRemove = {}\n    for classDictionaryGroup in classDictionaries:\n        for classDictionary in classDictionaryGroup:\n            for name, members in list(classDictionary.items()):\n                if len(members) == 1:\n                    toRemove[name] = list(members)[0]\n                    del classDictionary[name]\n    return toRemove", "entry_point": "_findSingleMemberGroups", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/robotools/extractor/blob/da3c2c92bfd3da863dd5de29bd8bc94cbbf433df/Lib/extractor/formats/opentype.py#L612-L623", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035196", "code": "def _mergeClasses(classDictionaries):\n    \"\"\"\n    Look for classes that have the exact same list\n    of members and flag them for removal.\n    This returns left classes, left rename map,\n    right classes and right rename map.\n    The classes have the standard class structure.\n    The rename maps have this structure:\n        {\n            (1, 1, 3) : (2, 3, 4),\n            old name : new name\n        }\n    Where the key is the class that should be\n    preserved and the value is a list of classes\n    that should be removed.\n    \"\"\"\n    # build a mapping of members to names\n    memberTree = {}\n    for classDictionaryGroup in classDictionaries:\n        for classDictionary in classDictionaryGroup:\n            for name, members in classDictionary.items():\n                if members not in memberTree:\n                    memberTree[members] = set()\n                memberTree[members].add(name)\n    # find members that have more than one name\n    classes = {}\n    rename = {}\n    for members, names in memberTree.items():\n        name = names.pop()\n        if len(names) > 0:\n            for otherName in names:\n                rename[otherName] = name\n        classes[name] = members\n    return classes, rename", "entry_point": "_mergeClasses", "input": "{}", "output": "({}, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/robotools/extractor/blob/da3c2c92bfd3da863dd5de29bd8bc94cbbf433df/Lib/extractor/formats/opentype.py#L637-L670", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035197", "code": "def derivative(xdata, ydata):\n    \"\"\"\n    performs d(ydata)/d(xdata) with nearest-neighbor slopes\n    must be well-ordered, returns new arrays [xdata, dydx_data]\n\n    neighbors:\n    \"\"\"\n    D_ydata = []\n    D_xdata = []\n    for n in range(1, len(xdata)-1):\n        D_xdata.append(xdata[n])\n        D_ydata.append((ydata[n+1]-ydata[n-1])/(xdata[n+1]-xdata[n-1]))\n\n    return [D_xdata, D_ydata]", "entry_point": "derivative", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[[3, 1], [-0.5, 2.0]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_functions.py#L345-L358", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035198", "code": "def find_peaks(array, baseline=0.1, return_subarrays=False):\n    \"\"\"\n    This will try to identify the indices of the peaks in array, returning a list of indices in ascending order.\n\n    Runs along the data set until it jumps above baseline. Then it considers all the subsequent data above the baseline\n    as part of the peak, and records the maximum of this data as one peak value.\n    \"\"\"\n\n    peaks = []\n\n    if return_subarrays:\n        subarray_values  = []\n        subarray_indices = []\n\n    # loop over the data\n    n = 0\n    while n < len(array):\n        # see if we're above baseline, then start the \"we're in a peak\" loop\n        if array[n] > baseline:\n\n            # start keeping track of the subarray here\n            if return_subarrays:\n                subarray_values.append([])\n                subarray_indices.append(n)\n\n            # find the max\n            ymax=baseline\n            nmax = n\n            while n < len(array) and array[n] > baseline:\n                # add this value to the subarray\n                if return_subarrays:\n                    subarray_values[-1].append(array[n])\n\n                if array[n] > ymax:\n                    ymax = array[n]\n                    nmax = n\n\n                n = n+1\n\n            # store the max\n            peaks.append(nmax)\n\n        else: n = n+1\n\n    if return_subarrays: return peaks, subarray_values, subarray_indices\n    else:                return peaks", "entry_point": "find_peaks", "input": "[], '', ['a', 'b', 'c']", "output": "([], [], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_functions.py#L591-L636", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035199", "code": "def insert_ordered(value, array):\n    \"\"\"\n    This will insert the value into the array, keeping it sorted, and returning the\n    index where it was inserted\n    \"\"\"\n\n    index = 0\n\n    # search for the last array item that value is larger than\n    for n in range(0,len(array)):\n        if value >= array[n]: index = n+1\n\n    array.insert(index, value)\n    return index", "entry_point": "insert_ordered", "input": "2.0, [-1, 0, 1, 2]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_functions.py#L931-L944", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035200", "code": "def get_frameshift_lengths(num_bins):\n    \"\"\"Simple function that returns the lengths for each frameshift category\n    if `num_bins` number of frameshift categories are requested.\n    \"\"\"\n    fs_len = []\n    i = 1\n    tmp_bins = 0\n    while(tmp_bins<num_bins):\n        if i%3:\n            fs_len.append(i)\n            tmp_bins += 1\n        i += 1\n    return fs_len", "entry_point": "get_frameshift_lengths", "input": "0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KarchinLab/probabilistic2020/blob/5d70583b0a7c07cfe32e95f3a70e05df412acb84/prob2020/python/indel.py#L289-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035201", "code": "def correct_chrom_names(chroms):\n    \"\"\"Make sure chromosome names follow UCSC chr convention.\"\"\"\n    chrom_list = []\n    for chrom in chroms:\n        # fix chrom numbering\n        chrom = str(chrom)\n        chrom = chrom.replace('23', 'X')\n        chrom = chrom.replace('24', 'Y')\n        chrom = chrom.replace('25', 'Mt')\n        if not chrom.startswith('chr'):\n            chrom = 'chr' + chrom\n        chrom_list.append(chrom)\n    return chrom_list", "entry_point": "correct_chrom_names", "input": "['a', 'b', 'c']", "output": "['chra', 'chrb', 'chrc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KarchinLab/probabilistic2020/blob/5d70583b0a7c07cfe32e95f3a70e05df412acb84/scripts/check_mutations.py#L23-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035202", "code": "def cummin(x):\n    \"\"\"A python implementation of the cummin function in R\"\"\"\n    for i in range(1, len(x)):\n        if x[i-1] < x[i]:\n            x[i] = x[i-1]\n    return x", "entry_point": "cummin", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'apple', 'apple']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KarchinLab/probabilistic2020/blob/5d70583b0a7c07cfe32e95f3a70e05df412acb84/prob2020/python/p_value.py#L27-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035203", "code": "def filter_list(mylist, bad_ixs):\n    \"\"\"Removes indices from a list.\n\n    All elements in bad_ixs will be removed from the list.\n\n    Parameters\n    ----------\n    mylist : list\n        list to filter out specific indices\n    bad_ixs : list of ints\n        indices to remove from list\n\n    Returns\n    -------\n    mylist : list\n        list with elements filtered out\n    \"\"\"\n    # indices need to be in reverse order for filtering\n    # to prevent .pop() from yielding eroneous results\n    bad_ixs = sorted(bad_ixs, reverse=True)\n    for i in bad_ixs:\n        mylist.pop(i)\n    return mylist", "entry_point": "filter_list", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KarchinLab/probabilistic2020/blob/5d70583b0a7c07cfe32e95f3a70e05df412acb84/prob2020/python/utils.py#L149-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035204", "code": "def get_all_context_names(context_num):\n    \"\"\"Based on the nucleotide base context number, return\n    a list of strings representing each context.\n\n    Parameters\n    ----------\n    context_num : int\n        number representing the amount of nucleotide base context to use.\n\n    Returns\n    -------\n        a list of strings containing the names of the base contexts\n    \"\"\"\n    if context_num == 0:\n        return ['None']\n    elif context_num == 1:\n        return ['A', 'C', 'T', 'G']\n    elif context_num == 1.5:\n        return ['C*pG', 'CpG*', 'TpC*', 'G*pA',\n                'A', 'C', 'T', 'G']\n    elif context_num == 2:\n        dinucs = list(set(\n            [d1+d2\n             for d1 in 'ACTG'\n             for d2 in 'ACTG']\n        ))\n        return dinucs\n    elif context_num == 3:\n        trinucs = list(set(\n            [t1+t2+t3\n             for t1 in 'ACTG'\n             for t2 in 'ACTG'\n             for t3 in 'ACTG']\n        ))\n        return trinucs", "entry_point": "get_all_context_names", "input": "2.0", "output": "['AC', 'TC', 'CG', 'TA', 'GA', 'AG', 'AT', 'TG', 'GG', 'GT', 'GC', 'CC', 'TT', 'CA', 'CT', 'AA']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KarchinLab/probabilistic2020/blob/5d70583b0a7c07cfe32e95f3a70e05df412acb84/prob2020/python/mutation_context.py#L18-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035205", "code": "def get_chasm_context(tri_nuc):\n    \"\"\"Returns the mutation context acording to CHASM.\n\n    For more information about CHASM's mutation context, look\n    at http://wiki.chasmsoftware.org/index.php/CHASM_Overview.\n    Essentially CHASM uses a few specified di-nucleotide contexts\n    followed by single nucleotide context.\n\n    Parameters\n    ----------\n    tri_nuc : str\n        three nucleotide string with mutated base in the middle.\n\n    Returns\n    -------\n    chasm context : str\n        a string representing the context used in CHASM\n    \"\"\"\n    # check if string is correct length\n    if len(tri_nuc) != 3:\n        raise ValueError('Chasm context requires a three nucleotide string '\n                         '(Provided: \"{0}\")'.format(tri_nuc))\n\n    # try dinuc context if found\n    if tri_nuc[1:] == 'CG':\n        return 'C*pG'\n    elif tri_nuc[:2] == 'CG':\n        return 'CpG*'\n    elif tri_nuc[:2] == 'TC':\n        return 'TpC*'\n    elif tri_nuc[1:] == 'GA':\n        return 'G*pA'\n    else:\n        # just return single nuc context\n        return tri_nuc[1]", "entry_point": "get_chasm_context", "input": "[1, 2, 3]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KarchinLab/probabilistic2020/blob/5d70583b0a7c07cfe32e95f3a70e05df412acb84/prob2020/python/mutation_context.py#L117-L151", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035206", "code": "def _process_dimension_kwargs(direction, kwargs):\n    \"\"\"\n    process kwargs for AxDimension instances by stripping off the prefix\n    for the appropriate direction\n    \"\"\"\n    acceptable_keys = ['unit', 'pad', 'lim', 'label']\n    # if direction in ['s']:\n        # acceptable_keys += ['mode']\n    processed_kwargs = {}\n    for k,v in kwargs.items():\n        if k.startswith(direction):\n            processed_key = k.lstrip(direction)\n        else:\n            processed_key = k\n\n        if processed_key in acceptable_keys:\n            processed_kwargs[processed_key] = v\n\n    return processed_kwargs", "entry_point": "_process_dimension_kwargs", "input": "['apple', 'banana', 'cherry'], {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/axes.py#L1249-L1267", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035207", "code": "def format_time(time):\n    \"\"\" Formats the given time into HH:MM:SS \"\"\"\n    h, r = divmod(time / 1000, 3600)\n    m, s = divmod(r, 60)\n\n    return \"%02d:%02d:%02d\" % (h, m, s)", "entry_point": "format_time", "input": "False", "output": "'00:00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/utils.py#L1-L6", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035208", "code": "def check_if_dict_contains_object_reference_in_values(object_to_check, dict_to_check):\n    \"\"\" Method to check if an object is inside the values of a dict.\n    A simple object_to_check in dict_to_check.values() does not work as it uses the __eq__ function of the object\n    and not the object reference.\n\n    :param object_to_check: The target object.\n    :param dict_to_check: The dict to search in.\n    :return:\n    \"\"\"\n    for key, value in dict_to_check.items():\n        if object_to_check is value:\n            return True\n    return False", "entry_point": "check_if_dict_contains_object_reference_in_values", "input": "[5, 3, 1, 4], {}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/dict_operations.py#L15-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035209", "code": "def generate_semantic_data_key(used_semantic_keys):\n    \"\"\" Create a new and unique semantic data key\n\n    :param list used_semantic_keys: Handed list of keys already in use\n    :rtype: str\n    :return: semantic_data_id\n    \"\"\"\n    semantic_data_id_counter = -1\n    while True:\n        semantic_data_id_counter += 1\n        if \"semantic data key \" + str(semantic_data_id_counter) not in used_semantic_keys:\n            break\n    return \"semantic data key \" + str(semantic_data_id_counter)", "entry_point": "generate_semantic_data_key", "input": "['a', 'b', 'c']", "output": "'semantic data key 0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/id_generator.py#L90-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035210", "code": "def contains_geometric_info(var):\n    \"\"\" Check whether the passed variable is a tuple with two floats or integers \"\"\"\n    return isinstance(var, tuple) and len(var) == 2 and all(isinstance(val, (int, float)) for val in var)", "entry_point": "contains_geometric_info", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/meta_data.py#L55-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035211", "code": "def extend_extents(extents, factor=1.1):\n    \"\"\"Extend a given bounding box\n\n    The bounding box (x1, y1, x2, y2) is centrally stretched by the given factor.\n\n    :param extents: The bound box extents\n    :param factor: The factor for stretching\n    :return: (x1, y1, x2, y2) of the extended bounding box\n    \"\"\"\n    width = extents[2] - extents[0]\n    height = extents[3] - extents[1]\n    add_width = (factor - 1) * width\n    add_height = (factor - 1) * height\n    x1 = extents[0] - add_width / 2\n    x2 = extents[2] + add_width / 2\n    y1 = extents[1] - add_height / 2\n    y2 = extents[3] + add_height / 2\n    return x1, y1, x2, y2", "entry_point": "extend_extents", "input": "[-1, 0, 1, 2], -1.5", "output": "(1.5, 2.5, -1.5, -0.5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_helper.py#L22-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035212", "code": "def assert_exactly_one_true(bool_list):\n    \"\"\"This method asserts that only one value of the provided list is True.\n\n    :param bool_list: List of booleans to check\n    :return: True if only one value is True, False otherwise\n    \"\"\"\n    assert isinstance(bool_list, list)\n    counter = 0\n    for item in bool_list:\n        if item:\n            counter += 1\n    return counter == 1", "entry_point": "assert_exactly_one_true", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_helper.py#L62-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035213", "code": "def equal(t1, t2, digit=None):\n    \"\"\" Compare two iterators and its elements on specific digit precision\n\n    The method assume that t1 and t2 are are list or tuple.\n\n    :param t1: First element to compare\n    :param t2: Second element to compare\n    :param int digit: Number of digits to compare\n    :rtype bool\n    :return: True if equal and False if different\n    \"\"\"\n\n    if not len(t1) == len(t2):\n        return False\n\n\n    for idx in range(len(t1)):\n        if digit is not None:\n            if not round(t1[idx], digit) == round(t2[idx], digit):\n                return False\n        else:\n            if not t1[idx] == t2[idx]:\n                return False\n\n    return True", "entry_point": "equal", "input": "['a', 'b', 'c'], [], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/geometry.py#L112-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035214", "code": "def get_widget_title(tab_label_text):\n    \"\"\"Transform Notebook tab label to title by replacing underscores with white spaces and capitalizing the first\n    letter of each word.\n\n    :param tab_label_text: The string of the tab label to be transformed\n    :return: The transformed title as a string\n    \"\"\"\n    title = ''\n    title_list = tab_label_text.split('_')\n    for word in title_list:\n        title += word.upper() + ' '\n    title.strip()\n    return title", "entry_point": "get_widget_title", "input": "''", "output": "' '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/label.py#L183-L195", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035215", "code": "def _listify(collection):\n        \"\"\"This is a workaround where Collections are no longer iterable\n        when using JPype.\"\"\"\n        new_list = []\n        for index in range(len(collection)):\n            new_list.append(collection[index])\n        return new_list", "entry_point": "_listify", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmcc/PyStanfordDependencies/blob/43d8f38a19e40087f273330087918c87df6d4d8f/StanfordDependencies/JPypeBackend.py#L193-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035216", "code": "def _expand_endpoint_name(endpoint_name, flags):\n    \"\"\"\n    Populate any ``{endpoint_name}`` tags in the flag names for the given\n    handler, based on the handlers module / file name.\n    \"\"\"\n    return tuple(flag.format(endpoint_name=endpoint_name) for flag in flags)", "entry_point": "_expand_endpoint_name", "input": "(1, 2), '  padded  '", "output": "(' ', ' ', 'p', 'a', 'd', 'd', 'e', 'd', ' ', ' ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju-solutions/charms.reactive/blob/e37e781432e77c12b63d2c739bd6cd70d3230c3a/charms/reactive/decorators.py#L289-L294", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035217", "code": "def dpd_to_int(dpd):\n    \"\"\"\n    Convert DPD encodined value to int (0-999)\n    dpd: DPD encoded value. 10bit unsigned int\n    \"\"\"\n    b = [None] * 10\n    b[9] = 1 if dpd & 0b1000000000 else 0\n    b[8] = 1 if dpd & 0b0100000000 else 0\n    b[7] = 1 if dpd & 0b0010000000 else 0\n    b[6] = 1 if dpd & 0b0001000000 else 0\n    b[5] = 1 if dpd & 0b0000100000 else 0\n    b[4] = 1 if dpd & 0b0000010000 else 0\n    b[3] = 1 if dpd & 0b0000001000 else 0\n    b[2] = 1 if dpd & 0b0000000100 else 0\n    b[1] = 1 if dpd & 0b0000000010 else 0\n    b[0] = 1 if dpd & 0b0000000001 else 0\n\n    d = [None] * 3\n    if b[3] == 0:\n        d[2] = b[9] * 4 + b[8] * 2 + b[7]\n        d[1] = b[6] * 4 + b[5] * 2 + b[4]\n        d[0] = b[2] * 4 + b[1] * 2 + b[0]\n    elif (b[3], b[2], b[1]) == (1, 0, 0):\n        d[2] = b[9] * 4 + b[8] * 2 + b[7]\n        d[1] = b[6] * 4 + b[5] * 2 + b[4]\n        d[0] = 8 + b[0]\n    elif (b[3], b[2], b[1]) == (1, 0, 1):\n        d[2] = b[9] * 4 + b[8] * 2 + b[7]\n        d[1] = 8 + b[4]\n        d[0] = b[6] * 4 + b[5] * 2 + b[0]\n    elif (b[3], b[2], b[1]) == (1, 1, 0):\n        d[2] = 8 + b[7]\n        d[1] = b[6] * 4 + b[5] * 2 + b[4]\n        d[0] = b[9] * 4 + b[8] * 2 + b[0]\n    elif (b[6], b[5], b[3], b[2], b[1]) == (0, 0, 1, 1, 1):\n        d[2] = 8 + b[7]\n        d[1] = 8 + b[4]\n        d[0] = b[9] * 4 + b[8] * 2 + b[0]\n    elif (b[6], b[5], b[3], b[2], b[1]) == (0, 1, 1, 1, 1):\n        d[2] = 8 + b[7]\n        d[1] = b[9] * 4 + b[8] * 2 + b[4]\n        d[0] = 8 + b[0]\n    elif (b[6], b[5], b[3], b[2], b[1]) == (1, 0, 1, 1, 1):\n        d[2] = b[9] * 4 + b[8] * 2 + b[7]\n        d[1] = 8 + b[4]\n        d[0] = 8 + b[0]\n    elif (b[6], b[5], b[3], b[2], b[1]) == (1, 1, 1, 1, 1):\n        d[2] = 8 + b[7]\n        d[1] = 8 + b[4]\n        d[0] = 8 + b[0]\n    else:\n        raise ValueError('Invalid DPD encoding')\n\n    return d[2] * 100 + d[1] * 10 + d[0]", "entry_point": "dpd_to_int", "input": "3", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nakagami/pyfirebirdsql/blob/5ce366c2fc8318510444f4a89801442f3e9e52ca/firebirdsql/decfloat.py#L47-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035218", "code": "def create_indexed_document(index_instance, model_items, action):\n    '''\n    Creates the document that will be passed into the bulk index function.\n    Either a list of serialized objects to index, or a a dictionary specifying the primary keys of items to be delete.\n    '''\n    data = []\n    if action == 'delete':\n        for pk in model_items:\n            data.append({'_id': pk, '_op_type': action})\n    else:\n        for doc in model_items:\n            if index_instance.matches_indexing_condition(doc):\n                data.append(index_instance.serialize_object(doc))\n    return data", "entry_point": "create_indexed_document", "input": "3, [], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ChristopherRabotin/bungiesearch/blob/13768342bc2698b214eb0003c2d113b6e273c30d/bungiesearch/utils.py#L90-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035219", "code": "def unique_everseen(seq):\n    \"\"\"Solution found here : http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order\"\"\"\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if not (x in seen or seen_add(x))]", "entry_point": "unique_everseen", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EliotBerriot/lifter/blob/9b4394b476cddd952b2af9540affc03f2977163d/lifter/utils.py#L87-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035220", "code": "def lonely_company(taxonomy, tax_ids):\n    \"\"\"Return a set of species tax_ids which will makes those in *tax_ids* not lonely.\n\n    The returned species will probably themselves be lonely.\n    \"\"\"\n    return [taxonomy.species_below(taxonomy.sibling_of(t)) for t in tax_ids]", "entry_point": "lonely_company", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fhcrc/taxtastic/blob/4e874b7f2cc146178828bfba386314f8c342722b/taxtastic/lonely.py#L84-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035221", "code": "def solid_company(taxonomy, tax_ids):\n    \"\"\"Return a set of non-lonely species tax_ids that will make those in *tax_ids* not lonely.\"\"\"\n    res = []\n    for t in tax_ids:\n        res.extend(taxonomy.nary_subtree(taxonomy.sibling_of(t), 2) or [])\n    return res", "entry_point": "solid_company", "input": "[1, 2, 3], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fhcrc/taxtastic/blob/4e874b7f2cc146178828bfba386314f8c342722b/taxtastic/lonely.py#L92-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035222", "code": "def avg(vals, count=None):\n    \"\"\" Returns the average value\n\n    Args:\n        vals: List of numbers to calculate average from.\n        count: Int of total count that vals was part of.\n\n    Returns:\n        Float average value throughout a count.\n    \"\"\" \n    sum = 0\n    for v in vals:\n        sum += v\n    if count is None:\n        count = len(vals)\n    return float(sum) / count", "entry_point": "avg", "input": "[1, 2, 3], -3", "output": "-2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/amicks/Speculator/blob/f7d6590aded20b1e1b5df16a4b27228ee821c4ab/speculator/utils/stats.py#L5-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035223", "code": "def humanize_bytes(b, precision=1):\n    \"\"\"Return a humanized string representation of a number of b.\n\n    Assumes `from __future__ import division`.\n\n    >>> humanize_bytes(1)\n    '1 byte'\n    >>> humanize_bytes(1024)\n    '1.0 kB'\n    >>> humanize_bytes(1024*123)\n    '123.0 kB'\n    >>> humanize_bytes(1024*12342)\n    '12.1 MB'\n    >>> humanize_bytes(1024*12342,2)\n    '12.05 MB'\n    >>> humanize_bytes(1024*1234,2)\n    '1.21 MB'\n    >>> humanize_bytes(1024*1234*1111,2)\n    '1.31 GB'\n    >>> humanize_bytes(1024*1234*1111,1)\n    '1.3 GB'\n    \"\"\"\n    # abbrevs = (\n    #     (1 << 50L, 'PB'),\n    #     (1 << 40L, 'TB'),\n    #     (1 << 30L, 'GB'),\n    #     (1 << 20L, 'MB'),\n    #     (1 << 10L, 'kB'),\n    #     (1, 'b')\n    # )\n    abbrevs = (\n        (1 << 50, 'PB'),\n        (1 << 40, 'TB'),\n        (1 << 30, 'GB'),\n        (1 << 20, 'MB'),\n        (1 << 10, 'kB'),\n        (1, 'b')\n    )\n    if b == 1:\n        return '1 byte'\n    for factor, suffix in abbrevs:\n        if b >= factor:\n            break\n    # return '%.*f %s' % (precision, old_div(b, factor), suffix)\n    return '%.*f %s' % (precision, b // factor, suffix)", "entry_point": "humanize_bytes", "input": "0.5, True", "output": "'0.0 b'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jepegit/cellpy/blob/9f4a84cdd11f72cfa02cda8c2d7b5174abbb7370/cellpy/readers/core.py#L295-L339", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035224", "code": "def add_ul(text, ul):\n    \"\"\"Adds an unordered list to the readme\"\"\"\n    text += \"\\n\"\n    for li in ul:\n        text += \"- \" + li + \"\\n\"\n    text += \"\\n\"\n\n    return text", "entry_point": "add_ul", "input": "'AbC dEf', []", "output": "'AbC dEf\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ModisWorks/modis/blob/1f1225c9841835ec1d1831fc196306527567db8b/GenerateReadme.py#L26-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035225", "code": "def suck_out_editions(reporters):\n    \"\"\"Builds a dictionary mapping edition keys to their root name.\n\n    The dictionary takes the form of:\n        {\n         \"A.\":   \"A.\",\n         \"A.2d\": \"A.\",\n         \"A.3d\": \"A.\",\n         \"A.D.\": \"A.D.\",\n         ...\n        }\n\n    In other words, this lets you go from an edition match to its parent key.\n    \"\"\"\n    editions_out = {}\n    for reporter_key, data_list in reporters.items():\n        # For each reporter key...\n        for data in data_list:\n            # For each book it maps to...\n            for edition_key, edition_value in data[\"editions\"].items():\n                try:\n                    editions_out[edition_key]\n                except KeyError:\n                    # The item wasn't there; add it.\n                    editions_out[edition_key] = reporter_key\n    return editions_out", "entry_point": "suck_out_editions", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/freelawproject/reporters-db/blob/ee17ee38a4e39de8d83beb78d84d146cd7e8afbc/reporters_db/utils.py#L37-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035226", "code": "def duration_to_string(duration):\n    \"\"\"\n    Converts a duration to a string\n\n    Args:\n        duration (int): The duration in seconds to convert\n\n    Returns s (str): The duration as a string\n    \"\"\"\n\n    m, s = divmod(duration, 60)\n    h, m = divmod(m, 60)\n    return \"%d:%02d:%02d\" % (h, m, s)", "entry_point": "duration_to_string", "input": "3.25", "output": "'0:00:03'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ModisWorks/modis/blob/1f1225c9841835ec1d1831fc196306527567db8b/modis/discord_modis/modules/music/api_music.py#L458-L470", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035227", "code": "def list_get(l, idx, default=None):\n    \"\"\"\n    Get from a list with an optional default value.\n    \"\"\"\n    try:\n        if l[idx]:\n            return l[idx]\n        else:\n            return default\n    except IndexError:\n        return default", "entry_point": "list_get", "input": "[[1, 2], [3], []], 10, ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tarbell-project/tarbell/blob/818b3d3623dcda5a08a5bf45550219719b0f0365/tarbell/utils.py#L34-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035228", "code": "def split_sentences(s, pad=0):\n    \"\"\"\n    Split sentences for formatting.\n    \"\"\"\n    sentences = []\n    for index, sentence in enumerate(s.split('. ')):\n        padding = ''\n        if index > 0:\n            padding = ' ' * (pad + 1)\n        if sentence.endswith('.'):\n            sentence = sentence[:-1]\n        sentences.append('%s %s.' % (padding, sentence.strip()))\n    return \"\\n\".join(sentences)", "entry_point": "split_sentences", "input": "'  padded  ', 0", "output": "' padded.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tarbell-project/tarbell/blob/818b3d3623dcda5a08a5bf45550219719b0f0365/tarbell/utils.py#L47-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035229", "code": "def _clean_suffix(string, suffix):\n    \"\"\"\n    If string endswith the suffix, remove it. Else leave it alone.\n    \"\"\"\n    suffix_len = len(suffix)\n\n    if len(string) < suffix_len:\n        # the string param was shorter than the suffix\n        raise ValueError(\"A suffix can not be bigger than string argument.\")\n    if string.endswith(suffix):\n        # return from the beginning up to\n        # but not including the first letter\n        # in the suffix\n        return string[0:-suffix_len]\n    else:\n        # leave unharmed\n        return string", "entry_point": "_clean_suffix", "input": "'walnut thistle harbour', 'Hello World'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tarbell-project/tarbell/blob/818b3d3623dcda5a08a5bf45550219719b0f0365/tarbell/cli.py#L671-L687", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035230", "code": "def covstr(s):\n  \"\"\" convert string to int or float. \"\"\"\n  try:\n    ret = int(s)\n  except ValueError:\n    ret = float(s)\n  return ret", "entry_point": "covstr", "input": "2.0", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toomore/goristock/blob/e61f57f11a626cfbc4afbf66337fd9d1c51e3e71/grs/mobileapi.py#L25-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035231", "code": "def reflection(n1, n2):\n    '''\n    Calculate the power reflection at the interface\n    of two refractive index materials.\n\n    Args:\n        n1 (float): Refractive index of material 1.\n        n2 (float): Refractive index of material 2.\n\n    Returns:\n        float: The percentage of reflected power.\n    '''\n    r = abs((n1-n2) / (n1+n2))**2\n    return r", "entry_point": "reflection", "input": "True, 1", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jtambasco/modesolverpy/blob/85254a13b5aed2404187c52ac93b9b3ce99ee3a3/modesolverpy/coupling_efficiency.py#L25-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035232", "code": "def apply_bios_properties_filter(settings, filter_to_be_applied):\n    \"\"\"Applies the filter to return the dict of filtered BIOS properties.\n\n    :param settings: dict of BIOS settings on which filter to be applied.\n    :param filter_to_be_applied: list of keys to be applied as filter.\n    :returns: A dictionary of filtered BIOS settings.\n    \"\"\"\n    if not settings or not filter_to_be_applied:\n        return settings\n\n    return {k: settings[k] for k in filter_to_be_applied if k in settings}", "entry_point": "apply_bios_properties_filter", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/utils.py#L159-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035233", "code": "def mimf_ferrario(mi):\n    ''' Curvature MiMf from Ferrario etal. 2005MNRAS.361.1131.'''\n    \n    mf=-0.00012336*mi**6+0.003160*mi**5-0.02960*mi**4+\\\n      0.12350*mi**3-0.21550*mi**2+0.19022*mi+0.46575\n    return mf", "entry_point": "mimf_ferrario", "input": "5", "output": "0.9143499999999997", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L169-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035234", "code": "def imf(m):\n    ''' \n    Returns\n    -------\n    N(M)dM\n        for given mass according to Kroupa IMF, vectorization\n        available via vimf() \n\n    '''\n\n    m1 = 0.08; m2 = 0.50\n    a1 = 0.30; a2 = 1.30; a3 = 2.3\n    const2 = m1**-a1 -m1**-a2 \n    const3 = m2**-a2 -m2**-a3 \n\n    if m < 0.08:\n        alpha = 0.3\n        const = -const2 -const3\n    elif m < 0.50:\n        alpha = 1.3\n        const = -const3\n    else:\n        alpha = 2.3\n        const = 0.0\n    # print m,alpha, const, m**-alpha + const \n    return m**-alpha + const", "entry_point": "imf", "input": "True", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L193-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035235", "code": "def _get_key_value(string):\n    \"\"\"Return the (key, value) as a tuple from a string.\"\"\"\n    # Normally all properties look like this:\n    #   Unique Identifier: 600508B1001CE4ACF473EE9C826230FF\n    #   Disk Name: /dev/sda\n    #   Mount Points: None\n    key = ''\n    value = ''\n    try:\n        key, value = string.split(': ')\n    except ValueError:\n        # This handles the case when the property of a logical drive\n        # returned is as follows. Here we cannot split by ':' because\n        # the disk id has colon in it. So if this is about disk,\n        # then strip it accordingly.\n        #   Mirror Group 0: physicaldrive 6I:1:5\n        string = string.lstrip(' ')\n        if string.startswith('physicaldrive'):\n            fields = string.split(' ')\n            # Include fields[1] to key to avoid duplicate pairs\n            # with the same 'physicaldrive' key\n            key = fields[0] + \" \" + fields[1]\n            value = fields[1]\n        else:\n            # TODO(rameshg87): Check if this ever occurs.\n            return string.strip(' '), None\n\n    return key.strip(' '), value.strip(' ')", "entry_point": "_get_key_value", "input": "'AbC dEf'", "output": "('AbC dEf', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/hpssa/objects.py#L35-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035236", "code": "def validate_tag(key, value):\n    \"\"\"Validate a tag.\n\n    Keys must be less than 128 chars and values must be less than 256 chars.\n    \"\"\"\n    # Note, parse_sql does not include a keys if the value is an empty string\n    # (e.g. 'key=&test=a'), and thus technically we should not get strings\n    # which have zero length.\n    klen = len(key)\n    vlen = len(value)\n\n    return klen > 0 and klen < 256 and vlen > 0 and vlen < 256", "entry_point": "validate_tag", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware/invenio-files-rest/blob/59a950da61cc8d5882a03c6fde6db2e2ed10befd/invenio_files_rest/views.py#L67-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035237", "code": "def sort_data(x, y):\n    \"\"\"Sort the data.\"\"\"\n    xy = sorted(zip(x, y))\n    x, y = zip(*xy)\n    return x, y", "entry_point": "sort_data", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "((1, 2, 3), ([1, 2], [3], []))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/partofthething/ace/blob/1593a49f3c2e845514323e9c36ee253fe77bac3c/ace/validation/validate_smoothers.py#L162-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035238", "code": "def fmttime(tin):\n    \"\"\"Return LaTeX expression with time in scientific notation.\n\n    Args:\n        tin (float): the time.\n    Returns:\n        str: the LaTeX expression.\n    \"\"\"\n    aaa, bbb = '{:.2e}'.format(tin).split('e')\n    bbb = int(bbb)\n    return r'$t={} \\times 10^{{{}}}$'.format(aaa, bbb)", "entry_point": "fmttime", "input": "3.25", "output": "'$t=3.25 \\\\times 10^{0}$'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StagPython/StagPy/blob/18c4416cc4a1011db2fd736ee8b0ec29aa6e4fd4/stagpy/misc.py#L71-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035239", "code": "def list_of_vars(arg_plot):\n    \"\"\"Construct list of variables per plot.\n\n    Args:\n        arg_plot (str): string with variable names separated with\n            ``_`` (figures), ``.`` (subplots) and ``,`` (same subplot).\n    Returns:\n        three nested lists of str\n\n        - variables on the same subplot;\n        - subplots on the same figure;\n        - figures.\n    \"\"\"\n    lovs = [[[var for var in svars.split(',') if var]\n             for svars in pvars.split('.') if svars]\n            for pvars in arg_plot.split('-') if pvars]\n    lovs = [[slov for slov in lov if slov] for lov in lovs if lov]\n    return [lov for lov in lovs if lov]", "entry_point": "list_of_vars", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StagPython/StagPy/blob/18c4416cc4a1011db2fd736ee8b0ec29aa6e4fd4/stagpy/misc.py#L84-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035240", "code": "def set_of_vars(lovs):\n    \"\"\"Build set of variables from list.\n\n    Args:\n        lovs: nested lists of variables such as the one produced by\n            :func:`list_of_vars`.\n    Returns:\n        set of str: flattened set of all the variables present in the\n        nested lists.\n    \"\"\"\n    return set(var for pvars in lovs for svars in pvars for var in svars)", "entry_point": "set_of_vars", "input": "['a', 'b', 'c']", "output": "{'c', 'a', 'b'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StagPython/StagPy/blob/18c4416cc4a1011db2fd736ee8b0ec29aa6e4fd4/stagpy/misc.py#L104-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035241", "code": "def set_of_vars(arg_plot):\n    \"\"\"Build set of needed field variables.\n\n    Each var is a tuple, first component is a scalar field, second component is\n    either:\n\n    - a scalar field, isocontours are added to the plot.\n    - a vector field (e.g. 'v' for the (v1,v2,v3) vector), arrows are added to\n      the plot.\n\n    Args:\n        arg_plot (str): string with variable names separated with\n            ``,`` (figures), and ``+`` (same plot).\n    Returns:\n        set of str: set of needed field variables.\n    \"\"\"\n    sovs = set(tuple((var + '+').split('+')[:2])\n               for var in arg_plot.split(','))\n    sovs.discard(('', ''))\n    return sovs", "entry_point": "set_of_vars", "input": "'AbC dEf'", "output": "{('AbC dEf', '')}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StagPython/StagPy/blob/18c4416cc4a1011db2fd736ee8b0ec29aa6e4fd4/stagpy/field.py#L86-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035242", "code": "def standardize_input_data(data):\n    \"\"\"\n    Ensure utf-8 encoded strings are passed to the indico API\n    \"\"\"\n    if type(data) == bytes:\n        data = data.decode('utf-8')\n    if type(data) == list:\n        data = [\n            el.decode('utf-8') if type(data) == bytes else el\n            for el in data\n        ]\n    return data", "entry_point": "standardize_input_data", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IndicoDataSolutions/IndicoIo-python/blob/6f262a23f09d76fede63d1ccb87f9f7cf2cfc8aa/indicoio/utils/api.py#L49-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035243", "code": "def _pack_data(X, Y, metadata):\n    \"\"\"\n    After modifying / preprocessing inputs,\n    reformat the data in preparation for JSON serialization\n    \"\"\"\n    if not any(metadata):\n        # legacy list of list format is acceptable\n        return list(zip(X, Y))\n\n    else:\n        # newer dictionary-based format is required in order to save metadata\n            return [\n                {\n                    'data': x,\n                    'target': y,\n                    'metadata': meta\n                }\n                for x, y, meta in zip(X, Y, metadata)\n            ]", "entry_point": "_pack_data", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []], [1, 2, 3]", "output": "[{'data': 'apple', 'target': [1, 2], 'metadata': 1}, {'data': 'banana', 'target': [3], 'metadata': 2}, {'data': 'cherry', 'target': [], 'metadata': 3}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IndicoDataSolutions/IndicoIo-python/blob/6f262a23f09d76fede63d1ccb87f9f7cf2cfc8aa/indicoio/custom/custom.py#L60-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035244", "code": "def target_gene_indices(gene_names,\n                        target_genes):\n    \"\"\"\n    :param gene_names: list of gene names.\n    :param target_genes: either int (the top n), 'all', or a collection (subset of gene_names).\n    :return: the (column) indices of the target genes in the expression_matrix.\n    \"\"\"\n\n    if isinstance(target_genes, list) and len(target_genes) == 0:\n        return []\n\n    if isinstance(target_genes, str) and target_genes.upper() == 'ALL':\n        return list(range(len(gene_names)))\n\n    elif isinstance(target_genes, int):\n        top_n = target_genes\n        assert top_n > 0\n\n        return list(range(min(top_n, len(gene_names))))\n\n    elif isinstance(target_genes, list):\n        if not target_genes:  # target_genes is empty\n            return target_genes\n        elif all(isinstance(target_gene, str) for target_gene in target_genes):\n            return [index for index, gene in enumerate(gene_names) if gene in target_genes]\n        elif all(isinstance(target_gene, int) for target_gene in target_genes):\n            return target_genes\n        else:\n            raise ValueError(\"Mixed types in target genes.\")\n\n    else:\n        raise ValueError(\"Unable to interpret target_genes.\")", "entry_point": "target_gene_indices", "input": "'AbC dEf', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tmoerman/arboreto/blob/3ff7b6f987b32e5774771751dea646fa6feaaa52/arboreto/core.py#L326-L357", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035245", "code": "def _prepare_memoization_key(args, kwargs):\n    \"\"\"\n    Make a tuple of arguments which can be used as a key\n    for a memoized function's lookup_table. If some object can't be hashed\n    then used its __repr__ instead.\n    \"\"\"\n    key_list = []\n    for arg in args:\n        try:\n            hash(arg)\n            key_list.append(arg)\n        except:\n            key_list.append(repr(arg))\n    for (k, v) in kwargs.items():\n        try:\n            hash(k)\n            hash(v)\n            key_list.append((k, v))\n        except:\n            key_list.append((repr(k), repr(v)))\n    return tuple(key_list)", "entry_point": "_prepare_memoization_key", "input": "[1, 2, 3], {'x': [1, 2], 'y': []}", "output": "(1, 2, 3, (\"'x'\", '[1, 2]'), (\"'y'\", '[]'))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/pepdata/blob/2f1bad79f8084545227f4a7f895bbf08a6fb6fdc/pepdata/iedb/memoize.py#L17-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035246", "code": "def render_build_args(options, ns):\n    \"\"\"Get docker build args dict, rendering any templated args.\n\n    Args:\n    options (dict):\n        The dictionary for a given image from chartpress.yaml.\n        Fields in `options['buildArgs']` will be rendered and returned,\n        if defined.\n    ns (dict): the namespace used when rendering templated arguments\n    \"\"\"\n    build_args = options.get('buildArgs', {})\n    for key, value in build_args.items():\n        build_args[key] = value.format(**ns)\n    return build_args", "entry_point": "render_build_args", "input": "{'a': 1, 'b': 2}, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jupyterhub/chartpress/blob/541f132f31c9f3a66750d7847fb28c7ce5a0ca6d/chartpress.py#L98-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035247", "code": "def ordered_deduplicate(sequence):\n    \"\"\"\n    Returns the sequence as a tuple with the duplicates removed,\n    preserving input order.  Any duplicates following the first\n    occurrence are removed.\n\n    >>> ordered_deduplicate([1, 2, 3, 1, 32, 1, 2])\n    (1, 2, 3, 32)\n\n    Based on recipe from this StackOverflow post:\n    http://stackoverflow.com/a/480227\n    \"\"\"\n\n    seen = set()\n    # Micro optimization: each call to seen_add saves an extra attribute\n    # lookup in most iterations of the loop.\n    seen_add = seen.add\n\n    return tuple(x for x in sequence if not (x in seen or seen_add(x)))", "entry_point": "ordered_deduplicate", "input": "[]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eddieantonio/perfection/blob/69b7a06b31a15bd9534c69d4bdcc2e48e8ddfc43/perfection/czech.py#L194-L212", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035248", "code": "def trim_nones_from_right(xs):\n    \"\"\"\n    Returns the list without all the Nones at the right end.\n\n    >>> trim_nones_from_right([1, 2, None, 4, None, 5, None, None])\n    [1, 2, None, 4, None, 5]\n\n    \"\"\"\n    # Find the first element that does not contain none.\n    for i, item in enumerate(reversed(xs)):\n        if item is not None:\n            break\n\n    return xs[:-i]", "entry_point": "trim_nones_from_right", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eddieantonio/perfection/blob/69b7a06b31a15bd9534c69d4bdcc2e48e8ddfc43/perfection/getty.py#L267-L280", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035249", "code": "def _parse_name(name):\n    \"\"\"Parse name in complex dict definition.\n\n    In complex definition required params can be marked with `*`.\n\n    :param name:\n    :return: name and required flag\n    :rtype: tuple\n    \"\"\"\n    required = False\n\n    if name[-1] == '*':\n        name = name[0:-1]\n        required = True\n\n    return name, required", "entry_point": "_parse_name", "input": "'abc'", "output": "('abc', False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AtteqCom/zsl/blob/ab51a96da1780ff642912396d4b85bdcb72560c1/src/zsl/utils/xml_to_json.py#L174-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035250", "code": "def underscore_to_camelcase(value, first_upper=True):\n    \"\"\"Transform string from underscore_string to camelCase.\n\n    :param value: string with underscores\n    :param first_upper: the result will have its first character in upper case\n    :type value: str\n    :return: string in CamelCase or camelCase according to the first_upper\n    :rtype: str\n\n    :Example:\n        >>> underscore_to_camelcase('camel_case')\n        'CamelCase'\n        >>> underscore_to_camelcase('camel_case', False)\n        'camelCase'\n    \"\"\"\n    value = str(value)\n    camelized = \"\".join(x.title() if x else '_' for x in value.split(\"_\"))\n    if not first_upper:\n        camelized = camelized[0].lower() + camelized[1:]\n    return camelized", "entry_point": "underscore_to_camelcase", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "\"['Apple', 'Banana', 'Cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AtteqCom/zsl/blob/ab51a96da1780ff642912396d4b85bdcb72560c1/src/zsl/utils/string_helper.py#L20-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035251", "code": "def addslashes(s, escaped_chars=None):\n    \"\"\"Add slashes for given characters. Default is for ``\\`` and ``'``.\n\n    :param s: string\n    :param escaped_chars: list of characters to prefix with a slash ``\\``\n    :return: string with slashed characters\n    :rtype: str\n\n    :Example:\n        >>> addslashes(\"'\")\n        \"\\\\'\"\n    \"\"\"\n    if escaped_chars is None:\n        escaped_chars = [\"\\\\\", \"'\", ]\n\n    # l = [\"\\\\\", '\"', \"'\", \"\\0\", ]\n    for i in escaped_chars:\n        if i in s:\n            s = s.replace(i, '\\\\' + i)\n    return s", "entry_point": "addslashes", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AtteqCom/zsl/blob/ab51a96da1780ff642912396d4b85bdcb72560c1/src/zsl/utils/string_helper.py#L85-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035252", "code": "def deduplicate(pairs, aa=False, ignore_primer_regions=False):\n    '''\n    Removes duplicate sequences from a list of Pair objects.\n\n    If a Pair has heavy and light chains, both chains must identically match heavy and light chains\n    from another Pair to be considered a duplicate. If a Pair has only a single chain,\n    identical matches to that chain will cause the single chain Pair to be considered a duplicate,\n    even if the comparison Pair has both chains.\n\n    Note that identical sequences are identified by simple string comparison, so sequences of\n    different length that are identical over the entirety of the shorter sequence are not\n    considered duplicates.\n\n    By default, comparison is made on the nucleotide sequence. To use the amino acid sequence instead,\n    set aa=True.\n    '''\n    nr_pairs = []\n    just_pairs = [p for p in pairs if p.is_pair]\n    single_chains = [p for p in pairs if not p.is_pair]\n    _pairs = just_pairs + single_chains\n    for p in _pairs:\n        duplicates = []\n        for nr in nr_pairs:\n            identical = True\n            vdj = 'vdj_aa' if aa else 'vdj_nt'\n            offset = 4 if aa else 12\n            if p.heavy is not None:\n                if nr.heavy is None:\n                    identical = False\n                else:\n                    heavy = p.heavy[vdj][offset:-offset] if ignore_primer_regions else p.heavy[vdj]\n                    nr_heavy = nr.heavy[vdj][offset:-offset] if ignore_primer_regions else nr.heavy[vdj]\n                    if heavy != nr_heavy:\n                        identical = False\n            if p.light is not None:\n                if nr.light is None:\n                    identical = False\n                else:\n                    light = p.light[vdj][offset:-offset] if ignore_primer_regions else p.light[vdj]\n                    nr_light = nr.light[vdj][offset:-offset] if ignore_primer_regions else nr.light[vdj]\n                    if light != nr_light:\n                        identical = False\n            duplicates.append(identical)\n        if any(duplicates):\n            continue\n        else:\n            nr_pairs.append(p)\n    return nr_pairs", "entry_point": "deduplicate", "input": "[], ['a', 'b', 'c'], 'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/briney/abutils/blob/944755fc7d28bfc7d4f1ffad94ca0bf9d74ec54b/abutils/core/pair.py#L416-L463", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035253", "code": "def back_slash_to_front_converter(string):\n    \"\"\"\n    Replacing all \\ in the str to /\n    :param string: single string to modify\n    :type string: str\n    \"\"\"\n    try:\n        if not string or not isinstance(string, str):\n            return string\n        return string.replace('\\\\', '/')\n    except Exception:\n        return string", "entry_point": "back_slash_to_front_converter", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QualiSystems/vCenterShell/blob/e2e24cd938a92a68f4a8e6a860810d3ef72aae6d/package/cloudshell/cp/vcenter/common/utilites/common_utils.py#L11-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035254", "code": "def get_path_and_name(full_name):\n    \"\"\"\n    Split Whole Patch onto 'Patch' and 'Name'\n    :param full_name: <str> Full Resource Name - likes 'Root/Folder/Folder2/Name'\n    :return: tuple (Patch, Name)\n    \"\"\"\n    if full_name:\n        parts = full_name.split(\"/\")\n        return (\"/\".join(parts[0:-1]), parts[-1]) if len(parts) > 1 else (\"/\", full_name)\n    return None, None", "entry_point": "get_path_and_name", "input": "'walnut thistle harbour'", "output": "('/', 'walnut thistle harbour')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QualiSystems/vCenterShell/blob/e2e24cd938a92a68f4a8e6a860810d3ef72aae6d/package/cloudshell/cp/vcenter/common/utilites/io.py#L25-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035255", "code": "def endianSwapU16(bytes):\n    \"\"\"Swaps pairs of bytes (16-bit words) in the given bytearray.\"\"\"\n    for b in range(0, len(bytes), 2):\n        bytes[b], bytes[b + 1] = bytes[b + 1], bytes[b]\n    return bytes", "entry_point": "endianSwapU16", "input": "[-1, 0, 1, 2]", "output": "[0, -1, 2, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NASA-AMMOS/AIT-Core/blob/9d85bd9c738e7a6a6fbdff672bea708238b02a3a/ait/core/util.py#L205-L209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035256", "code": "def toBCD (n):\n\n    \"\"\"Converts the number n into Binary Coded Decimal.\"\"\"\n    bcd  = 0\n    bits = 0\n\n    while True:\n        n, r  = divmod(n, 10)\n        bcd  |= (r << bits)\n        if n is 0:\n            break\n        bits += 4\n\n    return bcd", "entry_point": "toBCD", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NASA-AMMOS/AIT-Core/blob/9d85bd9c738e7a6a6fbdff672bea708238b02a3a/ait/core/util.py#L258-L271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035257", "code": "def toFloat (str, default=None):\n    \"\"\"toFloat(str[, default]) -> float | default\n\n    Converts the given string to a floating-point value.  If the\n    string could not be converted, default (None) is returned.\n\n    NOTE: This method is *significantly* more effecient than\n    toNumber() as it only attempts to parse floating-point numbers,\n    not integers or hexadecimal numbers.\n\n    Examples:\n\n    >>> f = toFloat(\"4.2\")\n    >>> assert type(f) is float and f == 4.2\n\n    >>> f = toFloat(\"UNDEFINED\", 999.9)\n    >>> assert type(f) is float and f == 999.9\n\n    >>> f = toFloat(\"Foo\")\n    >>> assert f is None\n    \"\"\"\n    value = default\n\n    try:\n        value = float(str)\n    except ValueError:\n        pass\n\n    return value", "entry_point": "toFloat", "input": "'', ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NASA-AMMOS/AIT-Core/blob/9d85bd9c738e7a6a6fbdff672bea708238b02a3a/ait/core/util.py#L274-L302", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035258", "code": "def toStringDuration (duration):\n    \"\"\"Returns a description of the given duration in the most appropriate\n    units (e.g. seconds, ms, us, or ns).\n    \"\"\"\n\n    table = (\n        ('%dms'      , 1e-3, 1e3),\n        (u'%d\\u03BCs', 1e-6, 1e6),\n        ('%dns'      , 1e-9, 1e9)\n    )\n\n    if duration > 1:\n        return '%fs' % duration\n\n    for format, threshold, factor in table:\n        if duration > threshold:\n            return format % int(duration * factor)\n\n    return '%fs' % duration", "entry_point": "toStringDuration", "input": "3.25", "output": "'3.250000s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NASA-AMMOS/AIT-Core/blob/9d85bd9c738e7a6a6fbdff672bea708238b02a3a/ait/core/util.py#L378-L396", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035259", "code": "def parse (name):\n        \"\"\"parse(name) -> [typename | None, nelems | None]\n\n        Parses an ArrayType name to return the element type name and\n        number of elements, e.g.:\n\n            >>> ArrayType.parse('MSB_U16[32]')\n            ['MSB_U16', 32]\n\n        If typename cannot be determined, None is returned.\n        Similarly, if nelems is not an integer or less than one (1),\n        None is returned.\n        \"\"\"\n        parts = [None, None]\n        start = name.find('[')\n\n        if start != -1:\n            stop = name.find(']', start)\n            if stop != -1:\n                try:\n                    parts[0] = name[:start]\n                    parts[1] = int(name[start + 1:stop])\n                    if parts[1] <= 0:\n                        raise ValueError\n                except ValueError:\n                    msg  = 'ArrayType specification: \"%s\" must have an '\n                    msg += 'integer greater than zero in square brackets.'\n                    raise ValueError(msg % name)\n\n        return parts", "entry_point": "parse", "input": "'AbC dEf'", "output": "[None, None]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NASA-AMMOS/AIT-Core/blob/9d85bd9c738e7a6a6fbdff672bea708238b02a3a/ait/core/dtype.py#L415-L444", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035260", "code": "def parseSyslog(msg):\n    \"\"\"Parses Syslog messages (RFC 5424)\n\n    The `Syslog Message Format (RFC 5424)\n    <https://tools.ietf.org/html/rfc5424#section-6>`_ can be parsed with\n    simple whitespace tokenization::\n\n        SYSLOG-MSG = HEADER SP STRUCTURED-DATA [SP MSG]\n        HEADER     = PRI VERSION SP TIMESTAMP SP HOSTNAME\n                     SP APP-NAME SP PROCID SP MSGID\n        ...\n        NILVALUE   = \"-\"\n\n    This method does not return STRUCTURED-DATA.  It parses NILVALUE\n    (\"-\") STRUCTURED-DATA or simple STRUCTURED-DATA which does not\n    contain (escaped) ']'.\n\n    :returns: A dictionary keyed by the constituent parts of the\n    Syslog message.\n    \"\"\"\n    tokens = msg.split(' ', 6)\n    result = { }\n\n    if len(tokens) > 0:\n        pri   = tokens[0]\n        start = pri.find('<')\n        stop  = pri.find('>')\n\n        if start != -1 and stop != -1:\n            result['pri'] = pri[start + 1:stop]\n        else:\n            result['pri'] = ''\n\n        if stop != -1 and len(pri) > stop:\n            result['version'] = pri[stop + 1:]\n        else:\n            result['version'] = ''\n\n    result[ 'timestamp' ] = tokens[1] if len(tokens) > 1 else ''\n    result[ 'hostname'  ] = tokens[2] if len(tokens) > 2 else ''\n    result[ 'appname'   ] = tokens[3] if len(tokens) > 3 else ''\n    result[ 'procid'    ] = tokens[4] if len(tokens) > 4 else ''\n    result[ 'msgid'     ] = tokens[5] if len(tokens) > 5 else ''\n    result[ 'msg'       ] = ''\n\n    if len(tokens) > 6:\n        # The following will work for NILVALUE STRUCTURED-DATA or\n        # simple STRUCTURED-DATA which does not contain ']'.\n        rest  = tokens[6]\n        start = rest.find('-')\n\n        if start == -1:\n            start = rest.find(']')\n\n        if len(rest) > start:\n            result['msg'] = rest[start + 1:].strip()\n\n    return result", "entry_point": "parseSyslog", "input": "'AbC dEf'", "output": "{'pri': '', 'version': '', 'timestamp': 'dEf', 'hostname': '', 'appname': '', 'procid': '', 'msgid': '', 'msg': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NASA-AMMOS/AIT-Core/blob/9d85bd9c738e7a6a6fbdff672bea708238b02a3a/ait/core/log.py#L233-L290", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035261", "code": "def get_skill_entry(name, skills_data) -> dict:\n    \"\"\" Find a skill entry in the skills_data and returns it. \"\"\"\n    for e in skills_data.get('skills', []):\n        if e.get('name') == name:\n            return e\n    return {}", "entry_point": "get_skill_entry", "input": "0, {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MycroftAI/mycroft-skills-manager/blob/5acef240de42e8ceae2e82bc7492ffee33288b00/msm/skills_data.py#L28-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035262", "code": "def mixer(yaw, throttle, max_power=100):\n    \"\"\"\n    Mix a pair of joystick axes, returning a pair of wheel speeds. This is where the mapping from\n    joystick positions to wheel powers is defined, so any changes to how the robot drives should\n    be made here, everything else is really just plumbing.\n    \n    :param yaw: \n        Yaw axis value, ranges from -1.0 to 1.0\n    :param throttle: \n        Throttle axis value, ranges from -1.0 to 1.0\n    :param max_power: \n        Maximum speed that should be returned from the mixer, defaults to 100\n    :return: \n        A pair of power_left, power_right integer values to send to the motor driver\n    \"\"\"\n    left = throttle + yaw\n    right = throttle - yaw\n    scale = float(max_power) / max(1, abs(left), abs(right))\n    return int(left * scale), int(right * scale)", "entry_point": "mixer", "input": "False, True, -3", "output": "(-3, -3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ApproxEng/approxeng.input/blob/0cdf8eed6bfd26ca3b20b4478f352787f60ae8ef/scripts/tiny4wd_drive.py#L72-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035263", "code": "def admin_command(sudo, command):\n    \"\"\"\n    If sudo is needed, make sure the command is prepended\n    correctly, otherwise return the command as it came.\n\n    :param sudo: A boolean representing the intention of having a sudo command\n                (or not)\n    :param command: A list of the actual command to execute with Popen.\n    \"\"\"\n    if sudo:\n        if not isinstance(command, list):\n            command = [command]\n        return ['sudo'] + [cmd for cmd in command]\n    return command", "entry_point": "admin_command", "input": "[], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alfredodeza/remoto/blob/b7625e571a4b6c83f9589a1e9ad07354e42bf0d3/remoto/util.py#L3-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035264", "code": "def proper_path(path):\n    \"\"\"\n    Clean up the path specification so it looks like something I could use.\n    \"./\" <path> \"/\"\n    \"\"\"\n    if path.startswith(\"./\"):\n        pass\n    elif path.startswith(\"/\"):\n        path = \".%s\" % path\n    elif path.startswith(\".\"):\n        while path.startswith(\".\"):\n            path = path[1:]\n        if path.startswith(\"/\"):\n            path = \".%s\" % path\n    else:\n        path = \"./%s\" % path\n\n    if not path.endswith(\"/\"):\n        path += \"/\"\n\n    return path", "entry_point": "proper_path", "input": "'abc'", "output": "'./abc/'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openid/JWTConnect-Python-OidcMsg/blob/58ade5eb67131abfb99f38b6a92d43b697c9f2fa/src/oidcmsg/__init__.py#L5-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035265", "code": "def roughsize(size, above=20, mod=10):\n    \"\"\"6 -> '6' 15 -> '15' 134 -> '130+'.\"\"\"\n    if size < above:\n        return str(size)\n\n    return \"{:d}+\".format(size - size % mod)", "entry_point": "roughsize", "input": "-3, True, [1, 2, 3]", "output": "'-3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abilian/abilian-core/blob/0a71275bf108c3d51e13ca9e093c0249235351e3/abilian/web/filters.py#L86-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035266", "code": "def get_columns_diff(changes):\n    \"\"\"Add the changed columns as a diff attribute.\n\n    - changes: a list of changes (get_model_changes query.all())\n\n    Return: the same list, to which elements we added a \"diff\"\n    attribute containing the changed columns. Diff defaults to [].\n    \"\"\"\n    for change in changes:\n        change.diff = []\n        elt_changes = change.get_changes()\n        if elt_changes:\n            change.diff = elt_changes.columns\n\n    return changes", "entry_point": "get_columns_diff", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abilian/abilian-core/blob/0a71275bf108c3d51e13ca9e093c0249235351e3/abilian/services/audit/service.py#L377-L391", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035267", "code": "def jaccard_sim(features1, features2):\n    \"\"\"Compute similarity between two sets using Jaccard similarity.\n\n    Args:\n        features1: list of PE Symbols.\n        features2: list of PE Symbols. \n\n    Returns:\n        Returns an int.\n    \"\"\"\n    set1 = set(features1)\n    set2 = set(features2)\n    try:\n        return len(set1.intersection(set2))/float(max(len(set1), len(set2)))\n    except ZeroDivisionError:\n        return 0", "entry_point": "jaccard_sim", "input": "[1, 2, 3], []", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SuperCowPowers/workbench/blob/710232756dd717f734253315e3d0b33c9628dafb/workbench/clients/pe_sim_graph.py#L58-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035268", "code": "def pad_char(text: str, width: int, char: str = '\\n') -> str:\r\n    \"\"\"Pads a text until length width.\"\"\"\r\n    dis = width - len(text)\r\n    if dis < 0:\r\n        raise ValueError\r\n    if dis > 0:\r\n        text += char * dis\r\n    return text", "entry_point": "pad_char", "input": "'abc', 3, [[1, 2], [3], []]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yfpeng/bioc/blob/47ddaa010960d9ba673aefe068e7bbaf39f0fff4/bioc/utils.py#L11-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035269", "code": "def shorten_text(text: str):\r\n    \"\"\"Return a short repr of text if it is longer than 40\"\"\"\r\n    if len(text) <= 40:\r\n        text = text\r\n    else:\r\n        text = text[:17] + ' ... ' + text[-17:]\r\n    return repr(text)", "entry_point": "shorten_text", "input": "'AbC dEf'", "output": "\"'AbC dEf'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yfpeng/bioc/blob/47ddaa010960d9ba673aefe068e7bbaf39f0fff4/bioc/utils.py#L74-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035270", "code": "def safe_get(data, key_list):\n        ''' Safely access dictionary keys when plugin may have failed '''\n        for key in key_list:\n            data = data.get(key, {})\n        return data if data else 'plugin_failed'", "entry_point": "safe_get", "input": "3, ()", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SuperCowPowers/workbench/blob/710232756dd717f734253315e3d0b33c9628dafb/workbench/workers/view_pe.py#L28-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035271", "code": "def hashable(val):\n    \"\"\"Test if `val` is hashable and if not, get it's string representation\n\n    Parameters\n    ----------\n    val: object\n        Any (possibly not hashable) python object\n\n    Returns\n    -------\n    val or string\n        The given `val` if it is hashable or it's string representation\"\"\"\n    if val is None:\n        return val\n    try:\n        hash(val)\n    except TypeError:\n        return repr(val)\n    else:\n        return val", "entry_point": "hashable", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Chilipp/psyplot/blob/75a0a15a9a1dd018e79d2df270d56c4bf5f311d5/psyplot/utils.py#L262-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035272", "code": "def indent(text, num=4):\n    \"\"\"Indet the given string\"\"\"\n    str_indent = ' ' * num\n    return str_indent + ('\\n' + str_indent).join(text.splitlines())", "entry_point": "indent", "input": "'', -3", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Chilipp/psyplot/blob/75a0a15a9a1dd018e79d2df270d56c4bf5f311d5/psyplot/docstring.py#L26-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035273", "code": "def parse_mixed_delim_str(line):\n    \"\"\"Turns .obj face index string line into [verts, texcoords, normals] numeric tuples.\"\"\"\n    arrs = [[], [], []]\n    for group in line.split(' '):\n        for col, coord in enumerate(group.split('/')):\n            if coord:\n                arrs[col].append(int(coord))\n\n    return [tuple(arr) for arr in arrs]", "entry_point": "parse_mixed_delim_str", "input": "''", "output": "[(), (), ()]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ratcave/wavefront_reader/blob/c515164a3952d6b85f8044f429406fddd862bfd0/wavefront_reader/reading.py#L7-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035274", "code": "def depends_statement(cookbook_name, metadata=None):\n        \"\"\"Return a valid Ruby 'depends' statement for the metadata.rb file.\"\"\"\n        line = \"depends '%s'\" % cookbook_name\n        if metadata:\n            if not isinstance(metadata, dict):\n                raise TypeError(\"Stencil dependency options for %s \"\n                                \"should be a dict of options, not %s.\"\n                                % (cookbook_name, metadata))\n            if metadata:\n                line = \"%s '%s'\" % (line, \"', '\".join(metadata))\n        return line", "entry_point": "depends_statement", "input": "'abc', []", "output": "\"depends 'abc'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rackerlabs/fastfood/blob/543970c4cedbb3956e84a7986469fdd7e4ee8fc8/fastfood/book.py#L97-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035275", "code": "def cookbook_statement(cookbook_name, metadata=None):\n        \"\"\"Return a valid Ruby 'cookbook' statement for the Berksfile.\"\"\"\n        line = \"cookbook '%s'\" % cookbook_name\n        if metadata:\n            if not isinstance(metadata, dict):\n                raise TypeError(\"Berksfile dependency hash for %s \"\n                                \"should be a dict of options, not %s.\"\n                                % (cookbook_name, metadata))\n            # not like the others...\n            if 'constraint' in metadata:\n                line += \", '%s'\" % metadata.pop('constraint')\n            for opt, spec in metadata.items():\n                line += \", %s: '%s'\" % (opt, spec)\n        return line", "entry_point": "cookbook_statement", "input": "True, False", "output": "\"cookbook 'True'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rackerlabs/fastfood/blob/543970c4cedbb3956e84a7986469fdd7e4ee8fc8/fastfood/book.py#L239-L252", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035276", "code": "def protein_subsequences_around_mutations(effects, padding_around_mutation):\n    \"\"\"\n    From each effect get a mutant protein sequence and pull out a subsequence\n    around the mutation (based on the given padding). Returns a dictionary\n    of subsequences and a dictionary of subsequence start offsets.\n    \"\"\"\n    protein_subsequences = {}\n    protein_subsequence_start_offsets = {}\n    for effect in effects:\n        protein_sequence = effect.mutant_protein_sequence\n        # some effects will lack a mutant protein sequence since\n        # they are either silent or unpredictable\n        if protein_sequence:\n            mutation_start = effect.aa_mutation_start_offset\n            mutation_end = effect.aa_mutation_end_offset\n            seq_start_offset = max(\n                0,\n                mutation_start - padding_around_mutation)\n            # some pseudogenes have stop codons in the reference sequence,\n            # if we try to use them for epitope prediction we should trim\n            # the sequence to not include the stop character '*'\n            first_stop_codon_index = protein_sequence.find(\"*\")\n            if first_stop_codon_index < 0:\n                first_stop_codon_index = len(protein_sequence)\n\n            seq_end_offset = min(\n                first_stop_codon_index,\n                mutation_end + padding_around_mutation)\n            subsequence = protein_sequence[seq_start_offset:seq_end_offset]\n            protein_subsequences[effect] = subsequence\n            protein_subsequence_start_offsets[effect] = seq_start_offset\n    return protein_subsequences, protein_subsequence_start_offsets", "entry_point": "protein_subsequences_around_mutations", "input": "set(), 2.0", "output": "({}, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/topiary/blob/04f0077bc4bf1ad350a0e78c26fa48c55fe7813b/topiary/sequence_helpers.py#L19-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035277", "code": "def listify(value):\n    \"\"\"\n    Wrap the given value into a list, with the below provisions:\n\n    * If the value is a list or a tuple, it's coerced into a new list.\n    * If the value is None, an empty list is returned.\n    * Otherwise, a single-element list is returned, containing the value.\n\n    :param value: A value.\n    :return: a list!\n    :rtype: list\n    \"\"\"\n    if value is None:\n        return []\n    if isinstance(value, (list, tuple)):\n        return list(value)\n    return [value]", "entry_point": "listify", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/valohai/valohai-yaml/blob/3d2e92381633d84cdba039f6905df34c9633a2e1/valohai_yaml/utils/__init__.py#L12-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035278", "code": "def vectorize(values):\n    \"\"\"\n    Takes a value or list of values and returns a single result, joined by \",\"\n    if necessary.\n    \"\"\"\n    if isinstance(values, list):\n        return ','.join(str(v) for v in values)\n    return values", "entry_point": "vectorize", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/analyzere/analyzere-python/blob/0593d5b7b69c4df6d6dbc80387cc6ff5dc5f4e8f/analyzere/utils.py#L87-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035279", "code": "def vectorize_range(values):\n    \"\"\"\n    This function is for url encoding.\n    Takes a value or a tuple or list of tuples and returns a single result,\n    tuples are joined by \",\" if necessary, elements in tuple are joined by '_'\n    \"\"\"\n    if isinstance(values, tuple):\n        return '_'.join(str(i) for i in values)\n    if isinstance(values, list):\n        if not all([isinstance(item, tuple) for item in values]):\n            raise TypeError('Items in the list must be tuples')\n        return ','.join('_'.join(str(i) for i in v) for v in values)\n    return str(values)", "entry_point": "vectorize_range", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/analyzere/analyzere-python/blob/0593d5b7b69c4df6d6dbc80387cc6ff5dc5f4e8f/analyzere/utils.py#L97-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035280", "code": "def clean_dict(dct):\n    '''Returns a dict where items with a None value are removed'''\n    return dict((key, val) for key, val in dct.items() if val is not None)", "entry_point": "clean_dict", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jbeluch/xbmcswift2/blob/0e7a3642499554edc8265fdf1ba6c5ee567daa78/xbmcswift2/common.py#L50-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035281", "code": "def grok_ttl(secret):\n    \"\"\"Parses the TTL information\"\"\"\n    ttl_obj = {}\n    lease_msg = ''\n    if 'lease' in secret:\n        ttl_obj['lease'] = secret['lease']\n        lease_msg = \"lease:%s\" % (ttl_obj['lease'])\n\n    if 'lease_max' in secret:\n        ttl_obj['lease_max'] = secret['lease_max']\n    elif 'lease' in ttl_obj:\n        ttl_obj['lease_max'] = ttl_obj['lease']\n\n    if 'lease_max' in ttl_obj:\n        lease_msg = \"%s lease_max:%s\" % (lease_msg, ttl_obj['lease_max'])\n\n    return ttl_obj, lease_msg", "entry_point": "grok_ttl", "input": "[]", "output": "({}, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/model/aws.py#L13-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035282", "code": "def is_tagged(required_tags, has_tags):\n    \"\"\"Checks if tags match\"\"\"\n    if not required_tags and not has_tags:\n        return True\n    elif not required_tags:\n        return False\n\n    found_tags = []\n    for tag in required_tags:\n        if tag in has_tags:\n            found_tags.append(tag)\n\n    return len(found_tags) == len(required_tags)", "entry_point": "is_tagged", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/helpers.py#L56-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035283", "code": "def cli_hash(list_of_kv):\n    \"\"\"Parse out a hash from a list of key=value strings\"\"\"\n    ev_obj = {}\n    for extra_var in list_of_kv:\n        ev_list = extra_var.split('=')\n        key = ev_list[0]\n        val = '='.join(ev_list[1:])  # b64 and other side effects\n        ev_obj[key] = val\n\n    return ev_obj", "entry_point": "cli_hash", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/helpers.py#L71-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035284", "code": "def path_pieces(vault_path):\n    \"\"\"Will return a two part tuple comprising of the vault path\n    and the key with in the stored object\"\"\"\n    path_bits = vault_path.split('/')\n    path = '/'.join(path_bits[0:len(path_bits) - 1])\n    key = path_bits[len(path_bits) - 1]\n    return path, key", "entry_point": "path_pieces", "input": "'abc'", "output": "('', 'abc')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/helpers.py#L131-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035285", "code": "def validate_obj(keys, obj):\n    \"\"\"Super simple \"object\" validation.\"\"\"\n    msg = ''\n    for k in keys:\n        if isinstance(k, str):\n            if k not in obj or (not isinstance(obj[k], list) and not obj[k]):\n                if msg:\n                    msg = \"%s,\" % msg\n\n                msg = \"%s%s\" % (msg, k)\n        elif isinstance(k, list):\n            found = False\n            for k_a in k:\n                if k_a in obj:\n                    found = True\n\n            if not found:\n                if msg:\n                    msg = \"%s,\" % msg\n\n                msg = \"%s(%s\" % (msg, ','.join(k))\n\n    if msg:\n        msg = \"%s missing\" % msg\n\n    return msg", "entry_point": "validate_obj", "input": "[1, 2, 3], [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/validation.py#L72-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035286", "code": "def sanitize_mount(mount):\n    \"\"\"Returns a quote-unquote sanitized mount path\"\"\"\n    sanitized_mount = mount\n    if sanitized_mount.startswith('/'):\n        sanitized_mount = sanitized_mount[1:]\n\n    if sanitized_mount.endswith('/'):\n        sanitized_mount = sanitized_mount[:-1]\n\n    sanitized_mount = sanitized_mount.replace('//', '/')\n    return sanitized_mount", "entry_point": "sanitize_mount", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/validation.py#L122-L132", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035287", "code": "def is_unicode(string):\n    \"\"\"Validates that the object itself is some kinda string\"\"\"\n    str_type = str(type(string))\n\n    if str_type.find('str') > 0 or str_type.find('unicode') > 0:\n        return True\n\n    return False", "entry_point": "is_unicode", "input": "'AbC dEf'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/aomi/blob/84da2dfb0424837adf9c4ddc1aa352e942bb7a4a/aomi/validation.py#L160-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035288", "code": "def cross_context(contextss):\n    \"\"\"\n    Cross product of all contexts\n    [[a], [b], [c]] -> [[a] x [b] x [c]]\n\n    \"\"\"\n    if not contextss:\n        return []\n\n    product = [{}]\n\n    for contexts in contextss:\n        tmp_product = []\n        for c in contexts:\n            for ce in product:\n                c_copy = c.copy()\n                c_copy.update(ce)\n                tmp_product.append(c_copy)\n        product = tmp_product\n    return product", "entry_point": "cross_context", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ayoungprogrammer/Lango/blob/0c4284c153abc2d8de4b03a86731bd84385e6afa/lango/matcher.py#L74-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035289", "code": "def parse_tags(targs):\n    \"\"\"\n    Tags can be in the forma key:value or simply value\n    \"\"\"\n    tags = {}\n    for t in targs:\n        split_tag = t.split(':')\n        if len(split_tag) > 1:\n            tags['tag:' + split_tag[0]] = split_tag[1]\n        else:\n            tags['tag:' + split_tag[0]] = ''\n    return tags", "entry_point": "parse_tags", "input": "['apple', 'banana', 'cherry']", "output": "{'tag:apple': '', 'tag:banana': '', 'tag:cherry': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Riffstation/flask-philo/blob/76c9d562edb4a77010c8da6dfdb6489fa29cbc9e/flask_philo/cloud/aws/utils.py#L1-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035290", "code": "def sorted_maybe_numeric(x):\n    \"\"\"\n    Sorts x with numeric semantics if all keys are nonnegative integers.\n    Otherwise uses standard string sorting.\n    \"\"\"\n    all_numeric = all(map(str.isdigit, x))\n    if all_numeric:\n        return sorted(x, key=int)\n    else:\n        return sorted(x)", "entry_point": "sorted_maybe_numeric", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uchicago-cs/deepdish/blob/01af93621fe082a3972fe53ba7375388c02b0085/deepdish/io/ls.py#L64-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035291", "code": "def abbreviate(s, maxlength=25):\n    \"\"\"Color-aware abbreviator\"\"\"\n    assert maxlength >= 4\n    skip = False\n    abbrv = None\n    i = 0\n    for j, c in enumerate(s):\n        if c == '\\033':\n            skip = True\n        elif skip:\n            if c == 'm':\n                skip = False\n        else:\n            i += 1\n\n        if i == maxlength - 1:\n            abbrv = s[:j] + '\\033[0m...'\n        elif i > maxlength:\n            break\n\n    if i <= maxlength:\n        return s\n    else:\n        return abbrv", "entry_point": "abbreviate", "input": "[[1, 2], [3], []], 10", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uchicago-cs/deepdish/blob/01af93621fe082a3972fe53ba7375388c02b0085/deepdish/io/ls.py#L117-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035292", "code": "def _display_interval(i):\n    \"\"\"Convert a time interval into a human-readable string.\n\n    :param i: The interval to convert, in seconds.\n    \"\"\"\n    sigils = [\"d\", \"h\", \"m\", \"s\"]\n    factors = [24 * 60 * 60, 60 * 60, 60, 1]\n    remain = int(i)\n    result = \"\"\n    for fac, sig in zip(factors, sigils):\n        if remain < fac:\n            continue\n        result += \"{}{}\".format(remain // fac, sig)\n        remain = remain % fac\n    return result", "entry_point": "_display_interval", "input": "3.25", "output": "'3s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/genialis/resolwe/blob/f7bb54932c81ec0cfc5b5e80d238fceaeaa48d86/resolwe/flow/utils/stats.py#L59-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035293", "code": "def _add_payload_files(zip_file, payload_info_list):\n    \"\"\"Add the payload files to the zip.\"\"\"\n    payload_byte_count = 0\n    payload_file_count = 0\n    for payload_info_dict in payload_info_list:\n        zip_file.write_iter(payload_info_dict['path'], payload_info_dict['iter'])\n        payload_byte_count += payload_info_dict['iter'].size\n        payload_file_count += 1\n    return payload_byte_count, payload_file_count", "entry_point": "_add_payload_files", "input": "['a', 'b', 'c'], []", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataONEorg/d1_python/blob/3ac4d4f3ca052d3e8641a6a329cab526c8ddcb0d/lib_common/src/d1_common/bagit.py#L192-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035294", "code": "def is_multipart(header_dict):\n    \"\"\"\n  Args:\n    header_dict : CaseInsensitiveDict\n\n  Returns:\n    bool: ``True`` if ``header_dict`` has a Content-Type key (case insensitive) with\n    value that begins with 'multipart'.\n  \"\"\"\n    return (\n        {k.lower(): v for k, v in header_dict.items()}\n        .get('content-type', '')\n        .startswith('multipart')\n    )", "entry_point": "is_multipart", "input": "{'a': 1, 'b': 2}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataONEorg/d1_python/blob/3ac4d4f3ca052d3e8641a6a329cab526c8ddcb0d/lib_common/src/d1_common/multipart.py#L90-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035295", "code": "def json_path_components(path):\n    \"\"\"Convert JSON path to individual path components.\n\n    :param path: JSON path, which can be either an iterable of path\n        components or a dot-separated string\n    :return: A list of path components\n    \"\"\"\n    if isinstance(path, str):\n        path = path.split('.')\n\n    return list(path)", "entry_point": "json_path_components", "input": "'AbC dEf'", "output": "['AbC dEf']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/genialis/resolwe/blob/f7bb54932c81ec0cfc5b5e80d238fceaeaa48d86/resolwe/flow/models/utils.py#L516-L526", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035296", "code": "def topological_sort(unsorted_dict):\n    \"\"\"Sort objects by dependency.\n\n    Sort a dict of obsoleting PID to obsoleted PID to a list of PIDs in order of\n    obsolescence.\n\n    Args:\n      unsorted_dict : dict\n        Dict that holds obsolescence information. Each ``key/value`` pair establishes\n        that the PID in ``key`` identifies an object that obsoletes an object identifies\n        by the PID in ``value``.\n\n\n    Returns:\n      tuple of sorted_list, unconnected_dict :\n\n      ``sorted_list``: A list of PIDs ordered so that all PIDs that obsolete an object\n      are listed after the object they obsolete.\n\n      ``unconnected_dict``: A dict of PID to obsoleted PID of any objects that could not\n      be added to a revision chain. These items will have obsoletes PIDs that directly\n      or indirectly reference a PID that could not be sorted.\n\n    Notes:\n      ``obsoletes_dict`` is modified by the sort and on return holds any items that\n      could not be sorted.\n\n      The sort works by repeatedly iterating over an unsorted list of PIDs and\n      moving PIDs to the sorted list as they become available. A PID is available to\n      be moved to the sorted list if it does not obsolete a PID or if the PID it\n      obsoletes is already in the sorted list.\n\n    \"\"\"\n    sorted_list = []\n    sorted_set = set()\n    found = True\n    unconnected_dict = unsorted_dict.copy()\n    while found:\n        found = False\n        for pid, obsoletes_pid in list(unconnected_dict.items()):\n            if obsoletes_pid is None or obsoletes_pid in sorted_set:\n                found = True\n                sorted_list.append(pid)\n                sorted_set.add(pid)\n                del unconnected_dict[pid]\n    return sorted_list, unconnected_dict", "entry_point": "topological_sort", "input": "{'a': 1, 'b': 2}", "output": "([], {'a': 1, 'b': 2})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataONEorg/d1_python/blob/3ac4d4f3ca052d3e8641a6a329cab526c8ddcb0d/lib_common/src/d1_common/revision.py#L36-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035297", "code": "def _annotate_query(query, generate_dict):\n    \"\"\"Add annotations to the query to retrieve values required by field value generate\n    functions.\"\"\"\n    annotate_key_list = []\n    for field_name, annotate_dict in generate_dict.items():\n        for annotate_name, annotate_func in annotate_dict[\"annotate_dict\"].items():\n            query = annotate_func(query)\n            annotate_key_list.append(annotate_name)\n    return query, annotate_key_list", "entry_point": "_annotate_query", "input": "[], {}", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataONEorg/d1_python/blob/3ac4d4f3ca052d3e8641a6a329cab526c8ddcb0d/gmn/src/d1_gmn/app/sysmeta_extract.py#L163-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035298", "code": "def kwargs_to_string(kwargs):\n    \"\"\"\n    Given a set of kwargs, turns them into a string which can then be passed to a command.\n    :param kwargs: kwargs from a function call.\n    :return: outstr: A string, which is '' if no kwargs were given, and the kwargs in string format otherwise.\n    \"\"\"\n    outstr = ''\n    for arg in kwargs:\n        outstr += ' -{} {}'.format(arg, kwargs[arg])\n    return outstr", "entry_point": "kwargs_to_string", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-Bioinformatics/ConFindr/blob/4c292617c3f270ebd5ff138cbc5a107f6d01200d/confindr_src/wrappers/mash.py#L37-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035299", "code": "def number_of_bases_above_threshold(high_quality_base_count, base_count_cutoff=2, base_fraction_cutoff=None):\n    \"\"\"\n    Finds if a site has at least two bases of  high quality, enough that it can be considered\n    fairly safe to say that base is actually there.\n    :param high_quality_base_count: Dictionary of count of HQ bases at a position where key is base and values is the count of that base.\n    :param base_count_cutoff: Number of bases needed to support multiple allele presence.\n    :param base_fraction_cutoff: Fraction of bases needed to support multiple allele presence.\n    :return: True if site has at least base_count_cutoff/base_fraction_cutoff bases, False otherwise (changeable by user)\n    \"\"\"\n\n    # make a dict by dictionary comprehension where values are True or False for each base depending on whether the count meets the threshold.\n    # Method differs depending on whether absolute or fraction cutoff is specified\n    if base_fraction_cutoff:\n        total_hq_base_count = sum(high_quality_base_count.values())\n        bases_above_threshold = {base: float(count)/total_hq_base_count >= base_fraction_cutoff and count >= base_count_cutoff for (base,count) in high_quality_base_count.items()}\n    else:\n        bases_above_threshold = {base: count >= base_count_cutoff for (base, count) in high_quality_base_count.items()}\n\n    # True is equal to 1 so sum of the number of Trues in the bases_above_threshold dict is the number of bases passing threhold\n    return sum(bases_above_threshold.values())", "entry_point": "number_of_bases_above_threshold", "input": "{}, ('a', 'b', 'c'), ['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OLC-Bioinformatics/ConFindr/blob/4c292617c3f270ebd5ff138cbc5a107f6d01200d/confindr_src/confindr.py#L237-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035300", "code": "def try_encode(field_encoders, entity_dict):\n        \"\"\"\n        Inner encoding and try return string from entity dictionary\n        :param field_encoders:\n        :param entity_dict:\n        :return:\n        \"\"\"\n        result = ''\n        for field_encoder in field_encoders:\n            try:\n                result += field_encoder.encode(entity_dict)\n            except KeyError as e:\n                return False\n        return result", "entry_point": "try_encode", "input": "[], {'a': 1, 'b': 2}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/weso/CWR-DataApi/blob/f3b6ba8308c901b6ab87073c155c08e30692333c/cwr/parser/encoder/standart/record.py#L108-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035301", "code": "def python_to_euc(uni_char, as_bytes=False):\n    \"\"\"\n    Return EUC character from a Python Unicode character.\n\n    Converts a one character Python unicode string (e.g. u'\\\\u4e00') to the\n    corresponding EUC hex ('d2bb').\n    \"\"\"\n    euc = repr(uni_char.encode(\"gb2312\"))[1:-1].replace(\"\\\\x\", \"\").strip(\"'\")\n\n    if as_bytes:\n        euc = euc.encode('utf-8')\n        assert isinstance(euc, bytes)\n\n    return euc", "entry_point": "python_to_euc", "input": "'', True", "output": "b''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cihai/cihai/blob/43b0c2931da18c1ef1ff1cdd71e4b1c5eca24a41/cihai/conversion.py#L216-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035302", "code": "def array_dim(arr):\n    \"\"\"Return the size of a multidimansional array.\n    \"\"\"\n    dim = []\n    while True:\n        try:\n            dim.append(len(arr))\n            arr = arr[0]\n        except TypeError:\n            return dim", "entry_point": "array_dim", "input": "2.0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hydraplatform/hydra-base/blob/9251ff7946505f7a272c87837390acd1c435bc6e/hydra_base/util/dataset_util.py#L33-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035303", "code": "def _parse_unit(measure_or_unit_abbreviation):\n    \"\"\"\n        Helper function that extracts constant factors from unit specifications.\n        This allows to specify units similar to this: 10^6 m^3.\n        Return a couple (unit, factor)\n    \"\"\"\n    try:\n        float(measure_or_unit_abbreviation[0])\n        # The measure contains the values and the unit_abbreviation\n        factor, unit_abbreviation = measure_or_unit_abbreviation.split(' ', 1)\n        return unit_abbreviation, float(factor)\n    except ValueError:\n        # The measure just contains the unit_abbreviation\n        return measure_or_unit_abbreviation, 1.0", "entry_point": "_parse_unit", "input": "['a', 'b', 'c']", "output": "(['a', 'b', 'c'], 1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hydraplatform/hydra-base/blob/9251ff7946505f7a272c87837390acd1c435bc6e/hydra_base/lib/units.py#L75-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035304", "code": "def filenames_to_uniq(names,new_delim='.'):\n    '''\n    Given a set of file names, produce a list of names consisting of the\n    uniq parts of the names. This works from the end of the name.  Chunks of\n    the name are split on '.' and '-'.\n    \n    For example:\n        A.foo.bar.txt\n        B.foo.bar.txt\n        returns: ['A','B']\n    \n        AA.BB.foo.txt\n        CC.foo.txt\n        returns: ['AA.BB','CC']\n    \n    '''\n    name_words = []\n    maxlen = 0\n    for name in names:\n        name_words.append(name.replace('.',' ').replace('-',' ').strip().split())\n        name_words[-1].reverse()\n        if len(name_words[-1]) > maxlen:\n            maxlen = len(name_words[-1])\n\n    common = [False,] * maxlen\n    for i in range(maxlen):\n        last = None\n        same = True\n        for nameword in name_words:\n            if i >= len(nameword):\n                same = False\n                break\n            if not last:\n                last = nameword[i]\n            elif nameword[i] != last:\n                same = False\n                break\n        common[i] = same\n\n    newnames = []\n    for nameword in name_words:\n        nn = []\n        for (i, val) in enumerate(common):\n            if not val and i < len(nameword):\n                nn.append(nameword[i])\n        nn.reverse()\n        newnames.append(new_delim.join(nn))\n        \n    return newnames", "entry_point": "filenames_to_uniq", "input": "'', ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vladsaveliev/TargQC/blob/e887c36b2194dbd73c6ea32989b6cb84c6c0e58d/tab_utils/support.py#L52-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035305", "code": "def get_numeric_value(string_value):\n    \"\"\" parses string_value and returns only number-like part\n    \"\"\"\n    num_chars = ['.', '+', '-']\n    number = ''\n    for c in string_value:\n        if c.isdigit() or c in num_chars:\n            number += c\n    return number", "entry_point": "get_numeric_value", "input": "'  padded  '", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vladsaveliev/TargQC/blob/e887c36b2194dbd73c6ea32989b6cb84c6c0e58d/targqc/utilz/utils.py#L83-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035306", "code": "def dictmerge(x, y):\n    \"\"\"\n    merge two dictionaries\n    \"\"\"\n    z = x.copy()\n    z.update(y)\n    return z", "entry_point": "dictmerge", "input": "set(), {'x': [1, 2], 'y': []}", "output": "{'y', 'x'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/johntruckenbrodt/spatialist/blob/007f49296a156de8d7168ad235b5a5b8e8d3633d/spatialist/ancillary.py#L85-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035307", "code": "def rescale(inlist, newrange=(0, 1)):\n    \"\"\"\n    rescale the values in a list between the values in newrange (a tuple with the new minimum and maximum)\n    \"\"\"\n    OldMax = max(inlist)\n    OldMin = min(inlist)\n    \n    if OldMin == OldMax:\n        raise RuntimeError('list contains of only one unique value')\n    \n    OldRange = OldMax - OldMin\n    NewRange = newrange[1] - newrange[0]\n    result = [(((float(x) - OldMin) * NewRange) / OldRange) + newrange[0] for x in inlist]\n    return result", "entry_point": "rescale", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[-1.0, -0.5, 0.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/johntruckenbrodt/spatialist/blob/007f49296a156de8d7168ad235b5a5b8e8d3633d/spatialist/ancillary.py#L462-L475", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035308", "code": "def _Pairs(data):\n    \"\"\"dictionary -> list of pairs\"\"\"\n    keys = sorted(data)\n    return [{'@key': k, '@value': data[k]} for k in keys]", "entry_point": "_Pairs", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vladsaveliev/TargQC/blob/e887c36b2194dbd73c6ea32989b6cb84c6c0e58d/targqc/utilz/jsontemplate/_jsontemplate.py#L741-L744", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035309", "code": "def convert_to_codec_key(value):\n    \"\"\"\n    Normalize code key value (encoding codecs must be lower case and must\n    not contain any dashes).\n\n    :param value: value to convert.\n    \"\"\"\n    if not value:\n        # fallback to utf-8\n        value = 'UTF-8'\n    # UTF-8 -> utf_8\n    converted = value.replace('-', '_').lower()\n    # fix some corner cases, see https://github.com/pyQode/pyQode/issues/11\n    all_aliases = {\n        'ascii': [\n            'us_ascii',\n            'us',\n            'ansi_x3.4_1968',\n            'cp367',\n            'csascii',\n            'ibm367',\n            'iso_ir_6',\n            'iso646_us',\n            'iso_646.irv:1991'\n        ],\n        'utf-7': [\n            'csunicode11utf7',\n            'unicode_1_1_utf_7',\n            'unicode_2_0_utf_7',\n            'x_unicode_1_1_utf_7',\n            'x_unicode_2_0_utf_7',\n        ],\n        'utf_8': [\n            'unicode_1_1_utf_8',\n            'unicode_2_0_utf_8',\n            'x_unicode_1_1_utf_8',\n            'x_unicode_2_0_utf_8',\n        ],\n        'utf_16': [\n            'utf_16le',\n            'ucs_2',\n            'unicode',\n            'iso_10646_ucs2'\n        ],\n        'latin_1': ['iso_8859_1']\n    }\n\n    for key, aliases in all_aliases.items():\n        if converted in aliases:\n            return key\n    return converted", "entry_point": "convert_to_codec_key", "input": "[]", "output": "'utf_8'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyQode/pyqode.core/blob/a99ec6cd22d519394f613309412f8329dc4e90cb/pyqode/core/api/encodings.py#L98-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035310", "code": "def _get_line_and_col(data):\n        \"\"\"\n        Gets line and column from a string like the following: \"1;5\" or \"1;\" or \";5\"\n\n        and convers the column/line numbers to 0 base.\n        \"\"\"\n        try:\n            line, column = data.split(';')\n        except AttributeError:\n            line = int(data)\n            column = 1\n        # handle empty values and convert them to 0 based indices\n        if not line:\n            line = 0\n        else:\n            line = int(line) - 1\n            if line < 0:\n                line = 0\n        if not column:\n            column = 0\n        else:\n            column = int(column) - 1\n            if column < 0:\n                column = 0\n        return column, line", "entry_point": "_get_line_and_col", "input": "2", "output": "(0, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyQode/pyqode.core/blob/a99ec6cd22d519394f613309412f8329dc4e90cb/pyqode/core/widgets/output_window.py#L1329-L1353", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035311", "code": "def gen(name, data):\n        \"\"\"Generate dataentry *name* from *data*.\"\"\"\n        return '---- dataentry %s ----\\n%s\\n----' % (name, '\\n'.join(\n            '%s:%s' % (attr, value) for attr, value in data.items()))", "entry_point": "gen", "input": "'abc', {'a': 1, 'b': 2}", "output": "'---- dataentry abc ----\\na:1\\nb:2\\n----'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fmenabe/python-dokuwiki/blob/7b5b13b764912b36f49a03a445c88f0934260eb1/dokuwiki.py#L478-L481", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035312", "code": "def compile_authors(authors):\n    \"\"\"\n    Compiles authors \"Last, First\" into a single list\n    :param list authors: Raw author data retrieved from doi.org\n    :return list: Author objects\n    \"\"\"\n    author_list = []\n    for person in authors:\n        author_list.append({'name': person['family'] + \", \" + person['given']})\n    return author_list", "entry_point": "compile_authors", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/fetch_doi.py#L86-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035313", "code": "def log_benchmark(fn, start, end):\n    \"\"\"\n    Log a given function and how long the function takes in seconds\n    :param str fn: Function name\n    :param float start: Function start time\n    :param float end: Function end time\n    :return none:\n    \"\"\"\n    elapsed = round(end - start, 2)\n    line = (\"Benchmark - Function: {} , Time: {} seconds\".format(fn, elapsed))\n    return line", "entry_point": "log_benchmark", "input": "-1.5, False, True", "output": "'Benchmark - Function: -1.5 , Time: 1 seconds'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/loggers.py#L7-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035314", "code": "def to_insert(table, d):\n    \"\"\"Generate an insert statement using the given table and dictionary.\n\n    Args:\n        table (str): table name\n        d (dict): dictionary with column names as keys and values as values.\n    Returns:\n        tuple of statement and arguments\n\n    >>> to_insert('doc.foobar', {'name': 'Marvin'})\n    ('insert into doc.foobar (\"name\") values (?)', ['Marvin'])\n    \"\"\"\n\n    columns = []\n    args = []\n    for key, val in d.items():\n        columns.append('\"{}\"'.format(key))\n        args.append(val)\n    stmt = 'insert into {table} ({columns}) values ({params})'.format(\n        table=table,\n        columns=', '.join(columns),\n        params=', '.join(['?'] * len(columns)))\n    return (stmt, args)", "entry_point": "to_insert", "input": "{'x': [1, 2], 'y': []}, {'a': 1, 'b': 2}", "output": "('insert into {\\'x\\': [1, 2], \\'y\\': []} (\"a\", \"b\") values (?, ?)', [1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mfussenegger/cr8/blob/a37d6049f1f9fee2d0556efae2b7b7f8761bffe8/cr8/insert_json.py#L15-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035315", "code": "def compare_replace(pub_dict, fetch_dict):\n        \"\"\"\n        Take in our Original Pub, and Fetched Pub. For each Fetched entry that has data, overwrite the Original entry\n        :param pub_dict: (dict) Original pub dictionary\n        :param fetch_dict: (dict) Fetched pub dictionary from doi.org\n        :return: (dict) Updated pub dictionary, with fetched data taking precedence\n        \"\"\"\n        blank = [\" \", \"\", None]\n        for k, v in fetch_dict.items():\n            try:\n                if fetch_dict[k] != blank:\n                    pub_dict[k] = fetch_dict[k]\n            except KeyError:\n                pass\n        return pub_dict", "entry_point": "compare_replace", "input": "{'a': 1, 'b': 2}, {}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/doi_resolver.py#L83-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035316", "code": "def rm_keys_from_dict(d, keys):\n    \"\"\"\n    Given a dictionary and a key list, remove any data in the dictionary with the given keys.\n\n    :param dict d: Metadata\n    :param list keys: Keys to be removed\n    :return dict d: Metadata\n    \"\"\"\n    # Loop for each key given\n    for key in keys:\n        # Is the key in the dictionary?\n        if key in d:\n            try:\n                d.pop(key, None)\n            except KeyError:\n                # Not concerned with an error. Keep going.\n                pass\n    return d", "entry_point": "rm_keys_from_dict", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/misc.py#L724-L741", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035317", "code": "def mode_ts(ec, mode=\"\", ts=None):\n    \"\"\"\n    Get string for the mode\n    :param str ec: extract or collapse\n    :param str mode: \"paleo\" or \"chron\" mode\n    :param list ts: Time series (for collapse)\n    :return str phrase: Phrase\n    \"\"\"\n    phrase = \"\"\n    if ec == \"extract\":\n        if mode==\"chron\":\n            phrase = \"extracting chronData...\"\n        else:\n            phrase = \"extracting paleoData...\"\n    elif ec == \"collapse\":\n        if ts[0][\"mode\"] == \"chronData\":\n            phrase = \"collapsing chronData\"\n        else:\n            phrase = \"collapsing paleoData...\"\n    return phrase", "entry_point": "mode_ts", "input": "['apple', 'banana', 'cherry'], [1, 2, 3], [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/timeseries.py#L767-L786", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035318", "code": "def make_entity_name(name):\n    \"\"\"Creates a valid PlantUML entity name from the given value.\"\"\"\n    invalid_chars = \"-=!#$%^&*[](){}/~'`<>:;\"\n    for char in invalid_chars:\n        name = name.replace(char, \"_\")\n    return name", "entry_point": "make_entity_name", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/useblocks/sphinxcontrib-needs/blob/f49af4859a74e9fe76de5b9133c01335ac6ae191/sphinxcontrib/needs/directives/needflow.py#L63-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035319", "code": "def __flatten_col(d):\n        \"\"\"\n        Flatten column so climateInterpretation and calibration are not nested.\n        :param d:\n        :return:\n        \"\"\"\n\n        try:\n            for entry in [\"climateInterpretation\", \"calibration\"]:\n                if entry in d:\n                    for k, v in d[entry].items():\n                        d[k] = v\n                    del d[entry]\n        except AttributeError:\n            pass\n\n        return d", "entry_point": "__flatten_col", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/lpd_noaa.py#L278-L294", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035320", "code": "def __split_path(string):\n        \"\"\"\n        Used in the path_context function. Split the full path into a list of steps\n        :param str string: Path string (\"geo-elevation-height\")\n        :return list out: Path as a list of strings. One entry per path step.([\"geo\", \"elevation\", \"height\"])\n        \"\"\"\n        out = []\n        position = string.find(':')\n        if position != -1:\n            # A position of 0+ means that \":\" was found in the string\n            key = string[:position]\n            val = string[position+1:]\n            out.append(key)\n            out.append(val)\n            if ('-' in key) and ('Funding' not in key) and ('Grant' not in key):\n                out = key.split('-')\n                out.append(val)\n        return out", "entry_point": "__split_path", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/lpd_noaa.py#L383-L400", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035321", "code": "def __put_names_on_csv_cols(names, cols):\n        \"\"\"\n        Put the variableNames with the corresponding column data.\n        :param list names: variableNames\n        :param list cols: List of Lists of column data\n        :return dict:\n        \"\"\"\n        _combined = {}\n        for idx, name in enumerate(names):\n            # Use the variableName, and the column data from the same index\n            _combined[name] = cols[idx]\n\n\n\n        return _combined", "entry_point": "__put_names_on_csv_cols", "input": "'', []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/lpd_noaa.py#L621-L635", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035322", "code": "def __rm_names_on_csv_cols(d):\n        \"\"\"\n        Remove the variableNames from the columns.\n        :param dict d: Named csv data\n        :return list list: One list for names, one list for column data\n        \"\"\"\n        _names = []\n        _data = []\n        for name, data in d.items():\n            _names.append(name)\n            _data.append(data)\n        return _names, _data", "entry_point": "__rm_names_on_csv_cols", "input": "{'x': [1, 2], 'y': []}", "output": "(['x', 'y'], [[1, 2], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/lpd_noaa.py#L706-L717", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035323", "code": "def __get_author_last_name(author):\n        \"\"\"\n        Take a string of author(s), get the first author name, then get the first authors last name only.\n\n        :param str author: Author(s)\n        :return str _author: First author's last name\n        \"\"\"\n        _author = \"\"\n        if isinstance(author, str):\n            try:\n                # example:   'Ahmed, Moinuddin and Anchukaitis, Kevin J and ...'\n                # If this is a list of authors, try to split it and just get the first author.\n                if \" and \" in author:\n                    _author = author.split(\" and \")[0]\n                # 'Ahmed, Moinuddin; Anchukaitis, Kevin J;  ...'\n                elif \";\" in author:\n                    _author = author.split(\";\")[0]\n            except Exception:\n                _author = \"\"\n            try:\n                # example :  'Ahmed Moinuddin,  Anchukaitis Kevin J,  ...'\n                _author = author.replace(\" \", \"\")\n                if \",\" in author:\n                    _author = author.split(\",\")[0]\n            except Exception:\n                _author = \"\"\n        elif isinstance(author, list):\n            try:\n                # example:  [{'name': 'Ahmed, Moinuddin'}, {'name': 'Anchukaitis, Kevin J.'}, ..]\n                # just get the last name of the first author. this could get too long.\n                _author = author[0][\"name\"].split(\",\")[0]\n            except Exception as e:\n                _author = \"\"\n\n        return _author", "entry_point": "__get_author_last_name", "input": "['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/lpd_noaa.py#L722-L756", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035324", "code": "def compile_temp(d, key, value):\n    \"\"\"\n    Compiles temporary dictionaries for metadata. Adds a new entry to an existing dictionary.\n    :param dict d:\n    :param str key:\n    :param any value:\n    :return dict:\n    \"\"\"\n    if not value:\n        d[key] = None\n    elif len(value) == 1:\n        d[key] = value[0]\n    else:\n        d[key] = value\n    return d", "entry_point": "compile_temp", "input": "['a', 'b', 'c'], True, 'AbC dEf'", "output": "['a', 'AbC dEf', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/excel.py#L1395-L1409", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035325", "code": "def instance_str(cell):\n    \"\"\"\n    Match data type and return string\n    :param any cell:\n    :return str:\n    \"\"\"\n    if isinstance(cell, str):\n        return 'str'\n    elif isinstance(cell, int):\n        return 'int'\n    elif isinstance(cell, float):\n        return 'float'\n    else:\n        return 'unknown'", "entry_point": "instance_str", "input": "[-1, 0, 1, 2]", "output": "'unknown'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/excel.py#L1533-L1546", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035326", "code": "def _remove_geo_placeholders(l):\n    \"\"\"\n    Remove placeholders from coordinate lists and sort\n    :param list l: Lat or long list\n    :return list: Modified list\n    \"\"\"\n    vals = []\n    for i in l:\n        if isinstance(i, list):\n            for k in i:\n                if isinstance(k, float) or isinstance(k, int):\n                    vals.append(k)\n        elif isinstance(i, float) or isinstance(i, int):\n            vals.append(i)\n    vals.sort()\n    return vals", "entry_point": "_remove_geo_placeholders", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/excel.py#L1841-L1856", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035327", "code": "def __camel_case(word):\n        \"\"\"\n        Convert underscore naming into camel case naming\n        :param str word:\n        :return str:\n        \"\"\"\n        word = word.lower()\n        if '_' in word:\n            split_word = word.split('_')\n        else:\n            split_word = word.split()\n        if len(split_word) > 0:\n            for i, word in enumerate(split_word):\n                if i > 0:\n                    split_word[i] = word.title()\n        strings = ''.join(split_word)\n        return strings", "entry_point": "__camel_case", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/noaa_lpd.py#L559-L575", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035328", "code": "def __str_cleanup(line):\n        \"\"\"\n        Remove the unnecessary characters in the line that we don't want\n        :param str line:\n        :return str:\n        \"\"\"\n        if '#' in line:\n            line = line.replace(\"#\", \"\")\n            line = line.strip()\n        if '-----------' in line:\n            line = ''\n        return line", "entry_point": "__str_cleanup", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/noaa_lpd.py#L647-L658", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035329", "code": "def __slice_key_val(line):\n        \"\"\"\n        Get the key and value items from a line by looking for and lines that have a \":\"\n        :param str line:\n        :return str str: Key, Value\n        \"\"\"\n        position = line.find(\":\")\n        # If value is -1, that means the item was not found in the string.\n        if position != -1:\n            key = line[:position]\n            value = line[position + 1:]\n            value = value.lstrip()\n            return key, value\n        else:\n            key = line\n            value = None\n            return key, value", "entry_point": "__slice_key_val", "input": "'abc'", "output": "('abc', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/noaa_lpd.py#L661-L677", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035330", "code": "def get_lipd_version(L):\n    \"\"\"\n    Check what version of LiPD this file is using. If none is found, assume it's using version 1.0\n    :param dict L: Metadata\n    :return float:\n    \"\"\"\n    version = 1.0\n    _keys = [\"LipdVersion\", \"LiPDVersion\", \"lipdVersion\", \"liPDVersion\"]\n    for _key in _keys:\n        if _key in L:\n            version = L[_key]\n            # Cast the version number to a float\n            try:\n                version = float(version)\n            except AttributeError:\n                # If the casting failed, then something is wrong with the key so assume version is 1.0\n                version = 1.0\n            L.pop(_key)\n    return L, version", "entry_point": "get_lipd_version", "input": "[-1, 0, 1, 2]", "output": "([-1, 0, 1, 2], 1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmckay/LiPD-utilities/blob/5dab6bbeffc5effd68e3a6beaca6b76aa928e860/Python/lipd/versions.py#L47-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035331", "code": "def _fix_list_dyn_func(list):\n    \"\"\"\n    This searches a list for dynamic function fragments, which may have been cut by generic searches for \",|;\".\n\n    Example:\n    `link_a, [[copy('links', need_id)]]` this will be splitted in list of 3 parts:\n\n    #. link_a\n    #. [[copy('links'\n    #. need_id)]]\n\n    This function fixes the above list to the following:\n\n    #. link_a\n    #. [[copy('links', need_id)]]\n\n    :param list: list which may contain splitted function calls\n    :return: list of fixed elements\n    \"\"\"\n    open_func_string = False\n    new_list = []\n    for element in list:\n        if '[[' in element:\n            open_func_string = True\n            new_link = [element]\n        elif ']]' in element:\n            new_link.append(element)\n            open_func_string = False\n            element = \",\".join(new_link)\n            new_list.append(element)\n        elif open_func_string:\n            new_link.append(element)\n        else:\n            new_list.append(element)\n    return new_list", "entry_point": "_fix_list_dyn_func", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/useblocks/sphinxcontrib-needs/blob/f49af4859a74e9fe76de5b9133c01335ac6ae191/sphinxcontrib/needs/directives/need.py#L617-L651", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035332", "code": "def vietes(coefficients):\n    r'''\n    Given the coefficients of a polynomial of a single variable,\n    compute an elementary symmetric polynomial of the roots of the\n    input polynomial by Viete's Formula:\n\n    .. math::\n        \\sum_{1\\le i_1<i_2<...<i_k \\le n} x_{i_1}x_{i_2}...x_{i_k} = (-1)^k\\frac{a_{n-k}}{a_n}\n\n    Parameters\n    ----------\n    coefficients: list of float\n        A list of coefficients of the input polynomial of arbitrary length (degree) `n`\n\n    Returns\n    -------\n    list of float:\n        A list containing the expression of the roots of the input polynomial of length `n`\n\n    See Also\n    --------\n    https://en.wikipedia.org/wiki/Vieta%27s_formulas\n\n    '''\n    elementary_symmetric_polynomial = []\n    tail = float(coefficients[-1])\n    size = len(coefficients)\n\n    for i in range(size):\n        sign = 1 if (i % 2) == 0 else -1\n        el = sign * coefficients[size - i - 1] / tail\n        elementary_symmetric_polynomial.append(el)\n    return elementary_symmetric_polynomial", "entry_point": "vietes", "input": "[1, 2, 3]", "output": "[1.0, -0.6666666666666666, 0.3333333333333333]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mobiusklein/brainpy/blob/4ccba40af33651a338c0c54bf1a251345c2db8da/brainpy/brainpy.py#L136-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035333", "code": "def MakeRanges(codes):\n  \"\"\"Turn a list like [1,2,3,7,8,9] into a range list [[1,3], [7,9]]\"\"\"\n  ranges = []\n  last = -100\n  for c in codes:\n    if c == last+1:\n      ranges[-1][1] = c\n    else:\n      ranges.append([c, c])\n    last = c\n  return ranges", "entry_point": "MakeRanges", "input": "[-1, 0, 1, 2]", "output": "[[-1, 2]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kpdyer/regex2dfa/blob/109f877e60ef0dfcb430f11516d215930b7b9936/third_party/re2/re2/make_unicode_groups.py#L30-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035334", "code": "def _Delta(a, b):\n  \"\"\"Compute the delta for b - a.  Even/odd and odd/even\n     are handled specially, as described above.\"\"\"\n  if a+1 == b:\n    if a%2 == 0:\n      return 'EvenOdd'\n    else:\n      return 'OddEven'\n  if a == b+1:\n    if a%2 == 0:\n      return 'OddEven'\n    else:\n      return 'EvenOdd'\n  return b - a", "entry_point": "_Delta", "input": "0, 7", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kpdyer/regex2dfa/blob/109f877e60ef0dfcb430f11516d215930b7b9936/third_party/re2/re2/make_unicode_casefold.py#L30-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035335", "code": "def align_lines(lines: list, column_separator: str='|') -> list:\n    \"\"\"\n    Pads lines so that all rows in single column match. Columns separated by '|' in every line.\n    :param lines: list of lines\n    :param column_separator: column separator. default is '|'\n    :return: list of lines\n    \"\"\"\n    rows = []\n    col_len = []\n    for line in lines:\n        line = str(line)\n        cols = []\n        for col_index, col in enumerate(line.split(column_separator)):\n            col = str(col).strip()\n            cols.append(col)\n            if col_index >= len(col_len):\n                col_len.append(0)\n            col_len[col_index] = max(col_len[col_index], len(col))\n        rows.append(cols)\n\n    lines_out = []\n    for row in rows:\n        cols_out = []\n        for col_index, col in enumerate(row):\n            if col_index == 0:\n                col = col.ljust(col_len[col_index])\n            else:\n                col = col.rjust(col_len[col_index])\n            cols_out.append(col)\n        lines_out.append(' '.join(cols_out))\n    return lines_out", "entry_point": "align_lines", "input": "[], 'AbC dEf'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kajala/django-jacc/blob/2c4356a46bc46430569136303488db6a9af65560/jacc/admin.py#L31-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035336", "code": "def order_manually(sub_commands):\n    \"\"\"Order sub-commands for display\"\"\"\n    order = [\n        \"start\",\n        \"projects\",\n    ]\n    ordered = []\n    commands = dict(zip([cmd for cmd in sub_commands], sub_commands))\n    for k in order:\n        ordered.append(commands.get(k, \"\"))\n        if k in commands:\n            del commands[k]\n\n    # Add commands not present in `order` above\n    for k in commands:\n        ordered.append(commands[k])\n\n    return ordered", "entry_point": "order_manually", "input": "['a', 'b', 'c']", "output": "['', '', 'a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pinax/pinax-cli/blob/7dac21907a2ac22a0efd06054ddea56f562efbaf/pinaxcli/utils.py#L4-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035337", "code": "def check_valid_hierarchies(instance):\n    \"\"\" Additional check for the hierarchies model, to ensure that levels\n    given are pointing to actual dimensions \"\"\"\n    hierarchies = instance.get('hierarchies', {}).values()\n    dimensions = set(instance.get('dimensions', {}).keys())\n    all_levels = set()\n    for hierarcy in hierarchies:\n        levels = set(hierarcy.get('levels', []))\n        if len(all_levels.intersection(levels)) > 0:\n            # Dimension appears in two different hierarchies\n            return False\n        all_levels = all_levels.union(levels)\n        if not dimensions.issuperset(levels):\n            # Level which is not in a dimension\n            return False\n    return True", "entry_point": "check_valid_hierarchies", "input": "{'x': [1, 2], 'y': []}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openspending/babbage/blob/9e03efe62e0be0cceabafd4de2a09cb8ec794b92/babbage/validation.py#L24-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035338", "code": "def split_fixed_pattern(path):\n        \"\"\"\n        Split path into fixed and masked parts\n        :param path: e.g\n        https://repo.example.com/artifactory/libs-cpp-release.snapshot/boost/1.60-pm/*.*.*/vc110/x86/win/boost.*.*.*.tar.gz\n        :return:\n            _path_fixed: https://repo.example.com/artifactory/libs-cpp-release.snapshot/boost/1.60-pm/\n            _path_pattern: *.*.*/vc110/x86/win/boost.*.*.*.tar.gz\n        \"\"\"\n        _first_pattern_pos = path.find('*')\n        _path_separator_pos = path.rfind('/', 0, _first_pattern_pos) + 1\n        _path_fixed = path[:_path_separator_pos]\n        _path_pattern = path[_path_separator_pos:]\n        return _path_fixed, _path_pattern", "entry_point": "split_fixed_pattern", "input": "'AbC dEf'", "output": "('', 'AbC dEf')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/devopshq/crosspm/blob/c831442ecfaa1d43c66cb148857096cea292c950/crosspm/helpers/parser.py#L908-L921", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035339", "code": "def split_fixed_pattern_with_file_name(path):\n        \"\"\"\n        Split path into fixed, masked parts and filename\n        :param path: e.g\nhttps://repo.example.com/artifactory/libs-cpp-release.snapshot/boost/1.60-pm/*.*.*/vc110/x86/win/boost.*.*.*.tar.gz\n        :return:\n            _path_fixed: https://repo.example.com/artifactory/libs-cpp-release.snapshot/boost/1.60-pm/\n            _path_pattern: *.*.*/vc100/x86/win\n            _file_name_pattern: boost.*.*.*.tar.gz\n        \"\"\"\n        _first_pattern_pos = path.find('*')\n        _path_separator_pos = path.rfind('/', 0, _first_pattern_pos)\n        _path_fixed = path[:_path_separator_pos]\n        _path_pattern = path[_path_separator_pos + 1:]\n        _file_name_pattern_separator_pos = _path_pattern.rfind('/', 0)\n        _file_name_pattern = _path_pattern[_file_name_pattern_separator_pos + 1:]\n\n        if _path_pattern.find('*') == -1 or _file_name_pattern_separator_pos == -1:\n            _path_pattern = \"\"\n        else:\n            _path_pattern = _path_pattern[:_file_name_pattern_separator_pos]\n\n        return _path_fixed, _path_pattern, _file_name_pattern", "entry_point": "split_fixed_pattern_with_file_name", "input": "''", "output": "('', '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/devopshq/crosspm/blob/c831442ecfaa1d43c66cb148857096cea292c950/crosspm/helpers/parser.py#L924-L946", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035340", "code": "def merge_dicts(dicts):\n        \"\"\"\n        Merge dicts in reverse to preference the order of the original list. e.g.,\n        merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.\n        \"\"\"\n        merged = {}\n        for d in reversed(dicts):\n            merged.update(d)\n        return merged", "entry_point": "merge_dicts", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/proteanhq/protean/blob/0e29873f4aa634aa93cc08ed675dd749c7ed4b0f/src/protean/utils/query.py#L39-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035341", "code": "def xcode(text, encoding='utf8', mode='ignore'):\n    '''\n    Converts unicode encoding to str\n\n    >>> xcode(b'hello')\n    b'hello'\n    >>> xcode('hello')\n    b'hello'\n    '''\n    return text.encode(encoding, mode) if isinstance(text, str) else text", "entry_point": "xcode", "input": "False, {1, 2, 3}, False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/deep-compute/deeputil/blob/9af5702bc3fd990688bf2aed16c20fa104be66df/deeputil/misc.py#L93-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035342", "code": "def format_info(variant, variant_type='snv'):\n    \"\"\"Format the info field for SNV variants\n    \n    Args:\n        variant(dict)\n        variant_type(str): snv or sv\n    \n    Returns:\n        vcf_info(str): A VCF formated info field\n    \"\"\"\n    \n    observations = variant.get('observations',0)\n\n    homozygotes = variant.get('homozygote')\n    hemizygotes = variant.get('hemizygote')\n\n    \n    vcf_info = f\"Obs={observations}\"\n    if homozygotes:\n        vcf_info += f\";Hom={homozygotes}\"\n    if hemizygotes:\n        vcf_info += f\";Hem={hemizygotes}\"\n\n    # This is SV specific\n    if variant_type == 'sv':\n        end = int((variant['end_left'] + variant['end_right'])/2)\n        \n        vcf_info += f\";SVTYPE={variant['sv_type']};END={end};SVLEN={variant['length']}\"\n\n    return vcf_info", "entry_point": "format_info", "input": "{'a': 1, 'b': 2}, 2", "output": "'Obs=0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/loqusdb/blob/792dcd0d461aff5adc703c49eebf58964913a513/loqusdb/utils/variant.py#L6-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035343", "code": "def get_individual_positions(individuals):\n    \"\"\"Return a dictionary with individual positions\n\n    Args:\n        individuals(list): A list with vcf individuals in correct order\n\n    Returns:\n        ind_pos(dict): Map from ind_id -> index position\n    \"\"\"\n    ind_pos = {}\n    if individuals:\n        for i, ind in enumerate(individuals):\n            ind_pos[ind] = i\n    return ind_pos", "entry_point": "get_individual_positions", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': 0, 'banana': 1, 'cherry': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/loqusdb/blob/792dcd0d461aff5adc703c49eebf58964913a513/loqusdb/build_models/case.py#L8-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035344", "code": "def annotate_variant(variant, var_obj=None):\n    \"\"\"Annotate a cyvcf variant with observations\n    \n    Args:\n        variant(cyvcf2.variant)\n        var_obj(dict)\n    \n    Returns:\n        variant(cyvcf2.variant): Annotated variant\n    \"\"\"\n    if var_obj:\n    \n        variant.INFO['Obs'] = var_obj['observations']\n        if var_obj.get('homozygote'):\n            variant.INFO['Hom'] = var_obj['homozygote']\n        if var_obj.get('hemizygote'):\n            variant.INFO['Hem'] = var_obj['hemizygote']\n    \n    return variant", "entry_point": "annotate_variant", "input": "[5, 3, 1, 4], []", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moonso/loqusdb/blob/792dcd0d461aff5adc703c49eebf58964913a513/loqusdb/utils/annotate.py#L12-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035345", "code": "def tf(cluster):\n        \"\"\"\n        Computes the term frequency and stores it as a dictionary\n\n        :param cluster: the cluster that contains the metadata\n        :return: tf dictionary\n        \"\"\"\n        counts = dict()\n        words = cluster.split(' ')\n        for word in words:\n            counts[word] = counts.get(word, 0) + 1\n        return counts", "entry_point": "tf", "input": "'a,b,c'", "output": "{'a,b,c': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DEIB-GECO/PyGMQL/blob/e58b2f9402a86056dcda484a32e3de0bb06ed991/gmql/ml/genometric_space.py#L222-L233", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035346", "code": "def get_policy_definitions(settings):\n    \"\"\"Find all multiauth policy definitions from the settings dict.\n\n    This function processes the paster deployment settings looking for items\n    that start with \"multiauth.policy.<policyname>.\".  It pulls them all out\n    into a dict indexed by the policy name.\n    \"\"\"\n    policy_definitions = {}\n    for name in settings:\n        if not name.startswith(\"multiauth.policy.\"):\n            continue\n        value = settings[name]\n        name = name[len(\"multiauth.policy.\"):]\n        policy_name, setting_name = name.split(\".\", 1)\n        if policy_name not in policy_definitions:\n            policy_definitions[policy_name] = {}\n        policy_definitions[policy_name][setting_name] = value\n    return policy_definitions", "entry_point": "get_policy_definitions", "input": "['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mozilla-services/pyramid_multiauth/blob/9548aa55f726920a666791d7c89ac2b9779d2bc1/pyramid_multiauth/__init__.py#L339-L356", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035347", "code": "def verification_digit(numbers):\n        \"\"\"\n        Returns the verification digit for a given numbre.\n\n        The verification digit is calculated as follows:\n\n        * A = sum of all even-positioned numbers\n        * B = A * 3\n        * C = sum of all odd-positioned numbers\n        * D = B + C\n        * The results is the smallset number N, such that (D + N) % 10 == 0\n\n        NOTE: Afip's documentation seems to have odd an even mixed up in the\n        explanation, but all examples follow the above algorithm.\n\n        :param list(int) numbers): The numbers for which the digits is to be\n            calculated.\n        :return: int\n        \"\"\"\n        a = sum(numbers[::2])\n        b = a * 3\n        c = sum(numbers[1::2])\n        d = b + c\n        e = d % 10\n        if e == 0:\n            return e\n        return 10 - e", "entry_point": "verification_digit", "input": "[5, 3, 1, 4]", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/WhyNotHugo/django-afip/blob/5fb73213f1fe86ca52b501ffd0737911ef26ddb3/django_afip/pdf.py#L38-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035348", "code": "def decode(buff):\n\t\t\"\"\"\n\t\tTransforms the raw buffer data read in into a list of bytes\n\t\t\"\"\"\n\t\tpp = list(map(ord, buff))\n\t\tif 0 == len(pp) == 1:\n\t\t\tpp = []\n\t\treturn pp", "entry_point": "decode", "input": "['a', 'b', 'c']", "output": "[97, 98, 99]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MultipedRobotics/pyxl320/blob/1a56540e208b028ee47d5fa0a7c7babcee0d9214/pyxl320/ServoSerial.py#L147-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035349", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Rond\u00f4nia state\"\"\"\n\n    divisor = 11\n\n    weight = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]\n\n    if len(st_reg_number) != 9 and len(st_reg_number) != 14:\n        return False\n\n    if len(st_reg_number) == 9:\n        sum_total = 0\n        peso = 6\n        for i in range(3, len(st_reg_number)-1):\n            sum_total = sum_total + int(st_reg_number[i]) * peso\n            peso = peso - 1\n\n        rest_division = sum_total % divisor\n        digit = divisor - rest_division\n\n        if digit == 10:\n            digit = 0\n\n        if digit == 11:\n            digit = 1\n\n        return digit == int(st_reg_number[len(st_reg_number)-1])\n\n    else:\n        sum_total = 0\n        for i in range(len(st_reg_number)-1):\n            sum_total = sum_total + int(st_reg_number[i]) * weight[i]\n\n        rest_division = sum_total % divisor\n        digit = divisor - rest_division\n\n        if digit == 10:\n            digit = 0\n\n        if digit == 11:\n            digit = 1\n\n        return digit == int(st_reg_number[len(st_reg_number)-1])", "entry_point": "start", "input": "('a', 'b', 'c')", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/ro.py#L5-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035350", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the S\u00e3o Paulo state\"\"\"\n\n    divisor = 11\n\n    verificador_one = int(st_reg_number[len(st_reg_number)-4])\n    verificador_two = int(st_reg_number[len(st_reg_number)-1])\n    weights_first = [1, 3, 4, 5, 6, 7, 8, 10]\n    weights_secund = [3, 2, 10, 9, 8, 7, 6, 5, 4, 3, 2]\n\n    if len(st_reg_number) > 13:\n        return False\n\n    if len(st_reg_number) < 12:\n        return False\n\n    if len(st_reg_number) == 12:\n        sum_total = 0\n        for i in range(len(st_reg_number)-4):\n            sum_total = sum_total + int(st_reg_number[i]) * weights_first[i]\n\n        rest_division = sum_total % divisor\n        digit_first = rest_division\n\n        if rest_division == 10:\n            digit_first = 0\n\n        num = 0\n        mult = 10000000000\n        for i in range(len(st_reg_number)-1):\n            if i == 8:\n                num = num + digit_first * mult\n            else:\n                num = num + int(st_reg_number[i]) * mult\n            mult = mult/10\n\n        if num < 10000000000:\n            new_st = str('0') + str(num)\n        else:\n            new_st = str(num)\n\n        sum_total = 0\n        for i in range(len(new_st)):\n            sum_total = sum_total + int(new_st[i]) * weights_secund[i]\n\n        rest_division = sum_total % divisor\n        digit_secund = rest_division\n\n        if rest_division == 10:\n            digit_secund = 0\n\n        if digit_secund == verificador_two and digit_first == verificador_one:\n            return True\n        else:\n            return False\n\n    else:\n        if st_reg_number[0] != \"P\":\n            return False\n\n        sum_total = 0\n        for i in range(1, 9):\n            sum_total = sum_total + int(st_reg_number[i]) * weights_first[i-1]\n\n        digit = sum_total % divisor\n\n        if digit == 10:\n            digit = 0\n\n        return digit == int(st_reg_number[len(st_reg_number)-4])", "entry_point": "start", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/sp.py#L5-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035351", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Pernanbuco state\"\"\"\n    divisor = 11\n\n    if len(st_reg_number) > 9:\n        return False\n\n    if len(st_reg_number) < 9:\n        return False\n\n    sum_total = 0\n    peso = 8\n    for i in range(len(st_reg_number)-2):\n        sum_total = sum_total + int(st_reg_number[i]) * peso\n        peso = peso - 1\n\n        rest_division = sum_total % divisor\n        digit_first = divisor - rest_division\n\n    if rest_division < 2:\n        digit_first = 0\n\n    if rest_division > 1:\n        digit_first = 11 - rest_division\n\n    num = 0\n    peso = 9\n    mult = 10000000\n    for i in range(len(st_reg_number)-2):\n        num = num + int(st_reg_number[i]) * mult\n        mult = mult/10\n\n    num = num + digit_first\n\n    new_st = str(num)\n    sum_total = 0\n    peso = 9\n    for i in range(len(new_st)-1):\n        sum_total = sum_total + int(new_st[i]) * peso\n        peso = peso - 1\n\n    rest_division = sum_total % divisor\n\n    if rest_division < 2:\n        digit_secund = 0\n\n    if rest_division > 1:\n        digit_secund = divisor - rest_division\n\n    if digit_secund == int(st_reg_number[len(st_reg_number)-1]) and digit_first == int(st_reg_number[len(st_reg_number)-2]):\n        return True\n    else:\n        return False", "entry_point": "start", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/pe.py#L5-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035352", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Bahia state\"\"\"\n\n    weights_second_digit = range(len(st_reg_number)-1, 1, -1)\n    weights_first_digit = range(len(st_reg_number), 1, -1)\n    second_digits = st_reg_number[-1:]\n    number_state_registration = st_reg_number[0:len(st_reg_number) - 2]\n    digits_state_registration = st_reg_number[-2:]\n    sum_second_digit = 0\n    sum_first_digit = 0\n\n    if len(st_reg_number) != 8 and len(st_reg_number) != 9:\n        return False\n\n    if st_reg_number[-8] in ['0', '1', '2', '3', '4', '5', '8']:\n\n        for i in weights_second_digit:\n\n            sum_second_digit = sum_second_digit + i*int(st_reg_number[-i-1])\n\n        second_digits_check = 10 - (sum_second_digit % 10)\n\n        if sum_second_digit % 10 == 0 or sum_second_digit % 11 == 1:\n\n            second_digits_check = '0'\n\n        if str(second_digits_check) != second_digits:\n\n            return False\n\n        digit_two = number_state_registration + str(second_digits_check)\n\n        for i in weights_first_digit:\n\n            sum_first_digit = sum_first_digit + i*int(digit_two[-i+1])\n\n        first_digits_check = 10 - (sum_first_digit % 10)\n\n        if sum_first_digit % 10 == 0 or sum_first_digit % 10 == 1:\n            first_digits_check = '0'\n\n        digits_calculated = str(first_digits_check) + str(second_digits_check)\n\n        return digits_calculated == digits_state_registration\n\n    elif st_reg_number[-8] in ['6', '7', '9']:\n\n        for i in weights_second_digit:\n\n            sum_second_digit = sum_second_digit + i*int(st_reg_number[-i-1])\n\n        second_digits_check = 11 - (sum_second_digit % 11)\n\n        if sum_second_digit % 11 == 0 or sum_second_digit % 11 == 1:\n            second_digits_check = '0'\n\n        if str(second_digits_check) != second_digits:\n            return False\n\n        digit_two = number_state_registration + str(second_digits_check)\n\n        for i in weights_first_digit:\n\n            sum_first_digit = sum_first_digit + i*int(digit_two[-i+1])\n\n        first_digits_check = 11 - (sum_first_digit % 11)\n\n        if sum_first_digit % 11 == 0 or sum_first_digit % 11 == 1:\n            first_digits_check = '0'\n        digits_calculated = str(first_digits_check) + str(second_digits_check)\n        return digits_calculated == digits_state_registration", "entry_point": "start", "input": "()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/ba.py#L5-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035353", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Paraiba state\"\"\"\n    #st_reg_number = str(st_reg_number)\n    weights = [9, 8, 7, 6, 5, 4, 3, 2]\n    digit_state_registration = st_reg_number[-1]\n\n    if len(st_reg_number) != 9:\n        return False\n\n    sum_total = 0\n\n    for i in range(0, 8):\n        sum_total = sum_total + weights[i] * int(st_reg_number[i])\n\n    if sum_total % 11 == 0:\n        return digit_state_registration[-1] == '0'\n\n    digit_check = 11 - sum_total % 11\n\n    return str(digit_check) == digit_state_registration", "entry_point": "start", "input": "('a', 'b', 'c')", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/pb.py#L5-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035354", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Mato Grosso state\"\"\"\n    #st_reg_number = str(st_reg_number)\n    weights = [3, 2, 9, 8, 7, 6, 5, 4, 3, 2]\n    digit_state_registration = st_reg_number[-1]\n\n    if len(st_reg_number) != 11:\n        return False\n\n    sum = 0\n\n    for i in range(0, 10):\n        sum = sum + weights[i] * int(st_reg_number[i])\n\n    if sum % 11 == 0:\n        return digit_state_registration[-1] == '0'\n\n    digit_check = 11 - sum % 11\n\n    return str(digit_check) == digit_state_registration", "entry_point": "start", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/mt.py#L5-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035355", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Sergipe state\"\"\"\n    divisor = 11\n\n    if len(st_reg_number) > 9:\n        return False\n\n    if len(st_reg_number) < 9:\n        return False\n\n    sum_total = 0\n    peso = 9\n\n    for i in range(len(st_reg_number)-1):\n        sum_total = sum_total + int(st_reg_number[i]) * peso\n        peso = peso - 1\n\n    rest_division = sum_total % divisor\n    digit = divisor - rest_division\n\n    if digit == 10 or digit == 11:\n        digit = 0\n\n    return digit == int(st_reg_number[len(st_reg_number)-1])", "entry_point": "start", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/se.py#L5-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035356", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Acre state\"\"\"\n\n    #st_reg_number = str(st_reg_number)\n    weights = [4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]\n    digits = st_reg_number[:len(st_reg_number) - 2]\n    check_digits = st_reg_number[-2:]\n    divisor = 11\n\n    if len(st_reg_number) > 13:\n        return False\n\n    sum_total = 0\n    for i in range(len(digits)):\n        sum_total = sum_total + int(digits[i]) * weights[i]\n\n    rest_division = sum_total % divisor\n    first_digit = divisor - rest_division\n\n    if first_digit == 10 or first_digit == 11:\n        first_digit = 0\n\n    if str(first_digit) != check_digits[0]:\n        return False\n\n    digits = digits + str(first_digit)\n    weights = [5] + weights\n\n    sum_total = 0\n    for i in range(len(digits)):\n        sum_total = sum_total + int(digits[i]) * weights[i]\n\n    rest_division = sum_total % divisor\n    second_digit = divisor - rest_division\n\n    if second_digit == 10 or second_digit == 11:\n        second_digit = 0\n\n    return str(first_digit) + str(second_digit) == check_digits", "entry_point": "start", "input": "(1, 2)", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/ac.py#L4-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035357", "code": "def start(st_reg_number):\n        \"\"\"Checks the number valiaty for the Amazonas state\"\"\"\n        weights = range(2, 10)\n        digits = st_reg_number[0:len(st_reg_number) - 1]\n        control_digit = 11\n        check_digit = st_reg_number[-1:]\n\n        if len(st_reg_number) != 9:\n                return False\n\n        sum_total = 0\n\n        for i in weights:\n                sum_total = sum_total + i * int(digits[i-2])\n\n        if sum_total < control_digit:\n                control_digit = 11 - sum_total\n                return str(digit_calculated) == check_digit\n\n        elif sum_total % 11 <= 1:\n                return '0' == check_digit\n\n        else:\n                digit_calculated = 11 - sum_total % 11\n                return str(digit_calculated) == check_digit", "entry_point": "start", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/am.py#L5-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035358", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Alagoas state\"\"\"\n\n    if len(st_reg_number) > 9:\n        return False\n\n    if len(st_reg_number) < 9:\n        return False\n\n    if st_reg_number[0:2] != \"24\":\n        return False\n\n    if st_reg_number[2] not in ['0', '3', '5', '7', '8']:\n        return False\n\n    aux = 9\n    sum_total = 0\n    for i in range(len(st_reg_number)-1):\n        sum_total = sum_total + int(st_reg_number[i]) * aux\n        aux -= 1\n\n    product = sum_total * 10\n\n    aux_2 = int(product/11)\n\n    digit = product - aux_2 * 11\n\n    if digit == 10:\n        digit = 0\n\n    return digit == int(st_reg_number[len(st_reg_number)-1])", "entry_point": "start", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/al.py#L5-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035359", "code": "def start(st_reg_number):\n    \"\"\"Checks the number valiaty for the Alagoas state\"\"\"\n\n    divisor = 11\n    if len(st_reg_number) > 9:\n        return False\n\n    if len(st_reg_number) < 9:\n        return False\n\n    if st_reg_number[0:2] != \"03\":\n        return False\n\n    aux = int(st_reg_number[0:len(st_reg_number) - 1])\n\n    if 3000000 < aux and aux < 3017001:\n        control1 = 5\n        control2 = 0\n\n    if 3017000 < aux and aux < 3019023:\n        control1 = 9\n        control2 = 1\n\n    if aux > 3019022:\n        control1 = 0\n        control2 = 0\n    sum_total = 0\n    peso = 9\n    for i in range(len(st_reg_number)-1):\n        sum_total = sum_total + int(st_reg_number[i]) * peso\n        peso = peso - 1\n    sum_total += control1\n\n    rest_division = sum_total % divisor\n    digit = divisor - rest_division\n\n    if digit == 10:\n        digit = 0\n\n    if digit == 11:\n        digit = control2\n\n    return digit == int(st_reg_number[len(st_reg_number)-1])", "entry_point": "start", "input": "set()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matheuscas/pyIE/blob/9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb/ie/ap.py#L5-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035360", "code": "def port_number(port):\n    \"\"\" Port number validation. \"\"\"\n    try:\n        port = int(port)\n    except ValueError:\n        raise ValueError(\"Bad port number\")\n    if not 0 <= port < 2 ** 16:\n        raise ValueError(\"Bad port number\")\n    return port", "entry_point": "port_number", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dhondta/tinyscript/blob/624a0718db698899e7bc3ba6ac694baed251e81d/tinyscript/helpers/types.py#L94-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035361", "code": "def _convert_paths_to_flask(transmute_paths):\n    \"\"\"\n    convert transmute-core's path syntax (which uses {var} as the\n    variable wildcard) into flask's <var>.\n    \"\"\"\n    paths = []\n    for p in transmute_paths:\n        paths.append(p.replace(\"{\", \"<\").replace(\"}\", \">\"))\n    return paths", "entry_point": "_convert_paths_to_flask", "input": "'  padded  '", "output": "[' ', ' ', 'p', 'a', 'd', 'd', 'e', 'd', ' ', ' ']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toumorokoshi/transmute-core/blob/a2c26625d5d8bab37e00038f9d615a26167fc7f4/example.py#L95-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035362", "code": "def _join_parameters(base, nxt):\n        \"\"\" join parameters from the lhs to the rhs, if compatible. \"\"\"\n        if nxt is None:\n            return base\n        if isinstance(base, set) and isinstance(nxt, set):\n            return base | nxt\n        else:\n            return nxt", "entry_point": "_join_parameters", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toumorokoshi/transmute-core/blob/a2c26625d5d8bab37e00038f9d615a26167fc7f4/transmute_core/attributes/__init__.py#L99-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035363", "code": "def escape_html(text):\n    \"\"\"Replace <, >, &, \" with their HTML encoded representation. Intended to\n    prevent HTML errors in rendered displaCy markup.\n\n    text (unicode): The original text.\n    RETURNS (unicode): Equivalent text to be safely used within HTML.\n    \"\"\"\n    text = text.replace('&', '&amp;')\n    text = text.replace('<', '&lt;')\n    text = text.replace('>', '&gt;')\n    text = text.replace('\"', '&quot;')\n    return text", "entry_point": "escape_html", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/howl-anderson/MicroTokenizer/blob/41bbe9c31d202b4f751ad5201d343ad1123b42b5/MicroTokenizer/util.py#L433-L444", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035364", "code": "def parse_cmu(cmufh):\n    \"\"\"Parses an incoming file handle as a CMU pronouncing dictionary file.\n\n    (Most end-users of this module won't need to call this function explicitly,\n    as it's called internally by the :func:`init_cmu` function.)\n\n    :param cmufh: a filehandle with CMUdict-formatted data\n    :returns: a list of 2-tuples pairing a word with its phones (as a string)\n    \"\"\"\n    pronunciations = list()\n    for line in cmufh:\n        line = line.strip().decode('utf-8')\n        if line.startswith(';'):\n            continue\n        word, phones = line.split(\" \", 1)\n        pronunciations.append((word.split('(', 1)[0].lower(), phones))\n    return pronunciations", "entry_point": "parse_cmu", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aparrish/pronouncingpy/blob/09467fa9407d7d87cb0998ee3cb09db4dcc9571a/pronouncing/__init__.py#L17-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035365", "code": "def rhyming_part(phones):\n    \"\"\"Get the \"rhyming part\" of a string with CMUdict phones.\n\n    \"Rhyming part\" here means everything from the vowel in the stressed\n    syllable nearest the end of the word up to the end of the word.\n\n    .. doctest::\n\n        >>> import pronouncing\n        >>> phones = pronouncing.phones_for_word(\"purple\")\n        >>> pronouncing.rhyming_part(phones[0])\n        'ER1 P AH0 L'\n\n    :param phones: a string containing space-separated CMUdict phones\n    :returns: a string with just the \"rhyming part\" of those phones\n    \"\"\"\n    phones_list = phones.split()\n    for i in range(len(phones_list) - 1, 0, -1):\n        if phones_list[i][-1] in '12':\n            return ' '.join(phones_list[i:])\n    return phones", "entry_point": "rhyming_part", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aparrish/pronouncingpy/blob/09467fa9407d7d87cb0998ee3cb09db4dcc9571a/pronouncing/__init__.py#L135-L155", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035366", "code": "def get_process_tag(program, ccd, version='p'):\n    \"\"\"\n    make a process tag have a suffix indicating which ccd its for.\n    @param program: Name of the process that a tag is built for.\n    @param ccd: the CCD number that this process ran on.\n    @param version: The version of the exposure (s, p, o) that the process ran on.\n    @return: The string that represents the processing tag.\n    \"\"\"\n    return \"%s_%s%s\" % (program, str(version), str(ccd).zfill(2))", "entry_point": "get_process_tag", "input": "[-1, 0, 1, 2], [[1, 2], [3], []], [[1, 2], [3], []]", "output": "'[-1, 0, 1, 2]_[[1, 2], [3], []][[1, 2], [3], []]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OSSOS/MOP/blob/94f91d32ad5ec081d5a1ebd67604a838003465af/src/ossos/core/ossos/storage.py#L428-L436", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035367", "code": "def mk_dict(results,description):\n    \"\"\"Given a result list and descrition sequence, return a list\n    of dictionaries\"\"\"\n    \n    rows=[]\n    for row in results:\n        row_dict={}\n        for idx in range(len(row)):\n            col=description[idx][0]\n            row_dict[col]=row[idx]\n        rows.append(row_dict)\n    return rows", "entry_point": "mk_dict", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "[{'a': 'a'}, {'a': 'b'}, {'a': 'c'}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OSSOS/MOP/blob/94f91d32ad5ec081d5a1ebd67604a838003465af/src/jjk/preproc/cfeps_object.py#L16-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035368", "code": "def _update_listing_client_kwargs(client_kwargs, max_request_entries):\n        \"\"\"\n        Updates client kwargs for listing functions.\n\n        Args:\n            client_kwargs (dict): Client arguments.\n            max_request_entries (int): If specified, maximum entries returned\n                by request.\n\n        Returns:\n            dict: Updated client_kwargs\n        \"\"\"\n        client_kwargs = client_kwargs.copy()\n        if max_request_entries:\n            client_kwargs['num_results'] = max_request_entries\n        return client_kwargs", "entry_point": "_update_listing_client_kwargs", "input": "{'a': 1, 'b': 2}, ['apple', 'banana', 'cherry']", "output": "{'a': 1, 'b': 2, 'num_results': ['apple', 'banana', 'cherry']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Accelize/pycosio/blob/1cc1f8fdf5394d92918b7bae2bfa682169ccc48c/pycosio/storage/azure.py#L181-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035369", "code": "def is_storage(url, storage=None):\n    \"\"\"\n    Check if file is a local file or a storage file.\n\n    File is considered local if:\n        - URL is a local path.\n        - URL starts by \"file://\"\n        - a \"storage\" is provided.\n\n    Args:\n        url (str): file path or URL\n        storage (str): Storage name.\n\n    Returns:\n        bool: return True if file is local.\n    \"\"\"\n    if storage:\n        return True\n    split_url = url.split('://', 1)\n    if len(split_url) == 2 and split_url[0].lower() != 'file':\n        return True\n    return False", "entry_point": "is_storage", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Accelize/pycosio/blob/1cc1f8fdf5394d92918b7bae2bfa682169ccc48c/pycosio/_core/functions_core.py#L10-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035370", "code": "def _hex_to_rgb(color):\n    \"\"\"\\\n    Helper function to convert a color provided in hexadecimal format\n    as RGB triple.\n    \"\"\"\n    if color[0] == '#':\n        color = color[1:]\n    if len(color) == 3:\n        color = color[0] * 2 + color[1] * 2 + color[2] * 2\n    if len(color) != 6:\n        raise ValueError('Input #{0} is not in #RRGGBB format'.format(color))\n    return [int(n, 16) for n in (color[:2], color[2:4], color[4:])]", "entry_point": "_hex_to_rgb", "input": "('a', 'b', 'c')", "output": "[170, 187, 204]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mnooner256/pyqrcode/blob/674a77b5eaf850d063f518bd90c243ee34ad6b5d/pyqrcode/builder.py#L1517-L1528", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035371", "code": "def format_line(line):\n    \"\"\"\n    Format a line of Matlab into either a markdown line or a code line.\n\n    Parameters\n    ----------\n    line : str\n        The line of code to be formatted. Formatting occurs according to the\n        following rules:\n\n        - If the line starts with (at least) two %% signs, a new cell will be\n          started.\n\n        - If the line doesn't start with a '%' sign, it is assumed to be legit\n          matlab code. We will continue to add to the same cell until reaching\n          the next comment line\n    \"\"\"\n    if line.startswith('%%'):\n        md = True\n        new_cell = True\n        source = line.split('%%')[1] + '\\n'  # line-breaks in md require a line\n                                             # gap!\n\n    elif line.startswith('%'):\n        md = True\n        new_cell = False\n        source = line.split('%')[1] + '\\n'\n\n    else:\n        md = False\n        new_cell = False\n        source = line\n\n\n    return new_cell, md, source", "entry_point": "format_line", "input": "'walnut thistle harbour'", "output": "(False, False, 'walnut thistle harbour')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arokem/python-matlab-bridge/blob/9822c7b55435662f4f033c5479cc03fea2255755/pymatbridge/publish.py#L11-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035372", "code": "def _sort_labels(label_data):\n        \"\"\"Returns the labels in `label_data` sorted in descending order\n        according to the 'size' (total token count) of their referent\n        corpora.\n\n        :param label_data: labels (with their token counts) to sort\n        :type: `dict`\n        :rtype: `list`\n\n        \"\"\"\n        labels = list(label_data)\n        labels.sort(key=label_data.get, reverse=True)\n        return labels", "entry_point": "_sort_labels", "input": "{'x': [1, 2], 'y': []}", "output": "['x', 'y']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ajenhl/tacl/blob/b8a343248e77f1c07a5a4ac133a9ad6e0b4781c2/tacl/data_store.py#L718-L730", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035373", "code": "def _upper(val_list):\n    \"\"\"\n    :param val_list: a list of strings\n    :return: a list of upper-cased strings\n    \"\"\"\n    res = []\n    for ele in val_list:\n        res.append(ele.upper())\n    return res", "entry_point": "_upper", "input": "['apple', 'banana', 'cherry']", "output": "['APPLE', 'BANANA', 'CHERRY']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstax/cnx-archive/blob/d31d34aa8bbc8a9fde6cd4227a0df92726e8daf4/cnxarchive/search.py#L388-L396", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035374", "code": "def _prefix_ga(value):\n    \"\"\"Prefix a string with 'ga:' if it is not already\n\n    Sort values may be prefixed with '-' to indicate negative sort.\n\n    >>> _prefix_ga('foo')\n    'ga:foo'\n    >>> _prefix_ga('ga:foo')\n    'ga:foo'\n    >>> _prefix_ga('-foo')\n    '-ga:foo'\n    >>> _prefix_ga('-ga:foo')\n    '-ga:foo'\n    \"\"\"\n    prefix = ''\n    if value[0] == '-':\n        value = value[1:]\n        prefix = '-'\n    if not value.startswith('ga:'):\n        prefix += 'ga:'\n    return prefix + value", "entry_point": "_prefix_ga", "input": "'Hello World'", "output": "'ga:Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alphagov/gapy/blob/5e8cc058c54d6034fa0f5177d5a6d3d2e71fa5ea/gapy/client.py#L246-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035375", "code": "def _is_primitive(thing):\n        \"\"\"Determine if the value is a primitive\"\"\"\n        primitive = (int, str, bool, float)\n        return isinstance(thing, primitive)", "entry_point": "_is_primitive", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/genepattern/nbtools/blob/2f74703f59926d8565f9714b1458dc87da8f8574/nbtools/widgets.py#L222-L225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035376", "code": "def count_missense_per_gene(lines):\n    \"\"\" count the number of missense variants in each gene.\n    \"\"\"\n    \n    counts = {}\n    for x in lines:\n        x = x.split(\"\\t\")\n        gene = x[0]\n        consequence = x[3]\n        \n        if gene not in counts:\n            counts[gene] = 0\n        \n        if consequence != \"missense_variant\":\n            continue\n        \n        counts[gene] += 1\n    \n    return counts", "entry_point": "count_missense_per_gene", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeremymcrae/denovonear/blob/feaab0fc77e89d70b31e8092899e4f0e68bac9fe/scripts/run_batch.py#L27-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035377", "code": "def get_transcript_lengths(ensembl, transcript_ids):\n    \"\"\" finds the protein length for ensembl transcript IDs for a gene\n    \n    Args:\n        ensembl: EnsemblRequest object to request sequences and data\n            from the ensembl REST API\n        transcript_ids: list of transcript IDs for a single gene\n    \n    Returns:\n        dictionary of lengths (in amino acids), indexed by transcript IDs\n    \"\"\"\n    \n    transcripts = {}\n    for transcript_id in transcript_ids:\n        # get the transcript's protein sequence via the ensembl REST API\n        try:\n            seq = ensembl.get_protein_seq_for_transcript(transcript_id)\n        except ValueError:\n            continue\n        \n        transcripts[transcript_id] = len(seq)\n    \n    return transcripts", "entry_point": "get_transcript_lengths", "input": "[5, 3, 1, 4], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeremymcrae/denovonear/blob/feaab0fc77e89d70b31e8092899e4f0e68bac9fe/denovonear/load_gene.py#L22-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035378", "code": "def get_de_novos_in_transcript(transcript, de_novos):\n    \"\"\" get the de novos within the coding sequence of a transcript\n    \n    Args:\n        transcript: Transcript object, which defines the transcript coordinates\n        de_novos: list of chromosome sequence positions for de novo events\n    \n    Returns:\n        list of de novo positions found within the transcript\n    \"\"\"\n    \n    in_transcript = []\n    for de_novo in de_novos:\n        # we check if the de novo is within the transcript by converting the\n        # chromosomal position to a CDS-based position. Variants outside the CDS\n        # will raise an error, which we catch and pass on. It's better to do\n        # this, rather than use the function in_coding_region(), since that\n        # function does not allow for splice site variants.\n        site = transcript.get_coding_distance(de_novo)\n        cds_length = transcript.get_coding_distance(transcript.get_cds_end())\n        within_cds = site['pos'] >= 0 and site['pos'] < cds_length['pos']\n        if within_cds and (transcript.in_coding_region(de_novo) or abs(site['offset']) < 9):\n            in_transcript.append(de_novo)\n    \n    return in_transcript", "entry_point": "get_de_novos_in_transcript", "input": "[[1, 2], [3], []], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeremymcrae/denovonear/blob/feaab0fc77e89d70b31e8092899e4f0e68bac9fe/denovonear/load_gene.py#L80-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035379", "code": "def splitarg(args):\n    '''\n    This function will split arguments separated by spaces or commas \n    to be backwards compatible with the original ArcGet command line tool\n    '''\n    if not args:\n        return args\n    split = list()\n    for arg in args:\n        if ',' in arg:\n            split.extend([x for x in arg.split(',') if x])\n        elif arg:\n            split.append(arg)\n    return split", "entry_point": "splitarg", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/harvard-nrg/yaxil/blob/af594082258e62d1904d6e6841fce0bb5c0bf309/scripts/ArcGet.py#L152-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035380", "code": "def match_sp_sep(first, second):\n    \"\"\"\n    Verify that all the values in 'first' appear in 'second'.\n    The values can either be in the form of lists or as space separated\n    items.\n\n    :param first:\n    :param second:\n    :return: True/False\n    \"\"\"\n    if isinstance(first, list):\n        one = [set(v.split(\" \")) for v in first]\n    else:\n        one = [{v} for v in first.split(\" \")]\n\n    if isinstance(second, list):\n        other = [set(v.split(\" \")) for v in second]\n    else:\n        other = [{v} for v in second.split(\" \")]\n\n    # all values in one must appear in other\n    if any(rt not in other for rt in one):\n        return False\n    return True", "entry_point": "match_sp_sep", "input": "['a', 'b', 'c'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IdentityPython/oidcendpoint/blob/6c1d729d51bfb6332816117fe476073df7a1d823/src/oidcendpoint/oidc/registration.py#L57-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035381", "code": "def pick_things(pools, key, n):\n    \"Picks a maximum of n things in a dict of indexed pool of things.\"\n    pool = pools.get(key)\n    if not pool:\n        return []\n    things = pool[:n]\n    del pool[:n]\n    return things", "entry_point": "pick_things", "input": "{'a': 1, 'b': 2}, False, 'abc'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BeyondTheClouds/enoslib/blob/fb00be58e56a7848cfe482187d659744919fe2f7/enoslib/infra/utils.py#L15-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035382", "code": "def collect_namespaces(values):\n    \"\"\"\n    Gather mappings with keys of the shape '<base_key>__<sub_key>' as new dicts under '<base_key>', indexed by '<sub_key>'.\n\n    >>> foo = dict(\n    ...     foo__foo=1,\n    ...     foo__bar=2,\n    ...     bar__foo=3,\n    ...     bar__bar=4,\n    ...     foo_baz=5,\n    ...     baz=6\n    ... )\n\n    >>> assert collect_namespaces(foo) == dict(\n    ...     foo=dict(foo=1, bar=2),\n    ...     bar=dict(foo=3, bar=4),\n    ...     foo_baz=5,\n    ...     baz=6\n    ... )\n\n    :type values: dict\n    :rtype: dict\n    \"\"\"\n    namespaces = {}\n    result = dict(values)\n    for key, value in values.items():\n        parts = key.split('__', 1)  # pragma: no mutate\n        if len(parts) == 2:\n            prefix, name = parts\n            if prefix not in namespaces:\n                initial_namespace = values.get(prefix)\n                if initial_namespace is None:\n                    initial_namespace = {}\n                elif not isinstance(initial_namespace, dict):\n                    initial_namespace = {initial_namespace: True}\n                namespaces[prefix] = initial_namespace\n            namespaces[prefix][name] = result.pop(key)\n    for prefix, namespace in namespaces.items():\n        result[prefix] = namespace\n    return result", "entry_point": "collect_namespaces", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TriOptima/tri.declarative/blob/13d90d4c2a10934e37a4139e63d51a859fb3e303/lib/tri/declarative/__init__.py#L440-L479", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035383", "code": "def make_dict(fields, fields_kwargs):\n    \"\"\"lot's of methods take a dict or kwargs, this combines those\n\n    Basically, we do a lot of def method(fields, **kwargs) and we want to merge\n    those into one super dict with kwargs taking precedence, this does that\n\n    fields -- dict -- a passed in dict\n    fields_kwargs -- dict -- usually a **kwargs dict from another function\n\n    return -- dict -- a merged fields and fields_kwargs\n    \"\"\"\n    ret = {}\n    if fields:\n        ret.update(fields)\n\n    if fields_kwargs:\n        ret.update(fields_kwargs)\n\n    return ret", "entry_point": "make_dict", "input": "{'a': 1, 'b': 2}, ''", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Jaymon/prom/blob/b7ad2c259eca198da03e1e4bc7d95014c168c361/prom/utils.py#L237-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035384", "code": "def inputs(form_args):\n    \"\"\"\n    Creates list of input elements\n    \"\"\"\n    element = []\n    for name, value in form_args.items():\n        element.append(\n            '<input type=\"hidden\" name=\"{}\" value=\"{}\"/>'.format(name, value))\n    return \"\\n\".join(element)", "entry_point": "inputs", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IdentityPython/oidcendpoint/blob/6c1d729d51bfb6332816117fe476073df7a1d823/src/oidcendpoint/oidc/authorization.py#L53-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035385", "code": "def process_wildcard(fractions):\n    \"\"\"\n    Processes element with a wildcard ``?`` weight fraction and returns\n    composition balanced to 1.0.\n    \"\"\"\n    wildcard_zs = set()\n    total_fraction = 0.0\n    for z, fraction in fractions.items():\n        if fraction == '?':\n            wildcard_zs.add(z)\n        else:\n            total_fraction += fraction\n\n    if not wildcard_zs:\n        return fractions\n\n    balance_fraction = (1.0 - total_fraction) / len(wildcard_zs)\n    for z in wildcard_zs:\n        fractions[z] = balance_fraction\n\n    return fractions", "entry_point": "process_wildcard", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openmicroanalysis/pyxray/blob/cae89677f00ebcc0952f94d1ab70e6b35e1a51e9/pyxray/composition.py#L20-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035386", "code": "def format_sec(s):\n    \"\"\"\n    Format seconds in a more human readable way. It supports units down to\n    nanoseconds.\n\n    :param s: Float of seconds to format\n    :return: String second representation, like 12.4 us\n    \"\"\"\n\n    prefixes = [\"\", \"m\", \"u\", \"n\"]\n    unit = 0\n\n    while s < 1 and unit + 1 < len(prefixes):\n        s *= 1000\n        unit += 1\n\n    return \"{:.1f} {}s\".format(s, prefixes[unit])", "entry_point": "format_sec", "input": "-1.5", "output": "'-1500000000.0 ns'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/runfalk/spans/blob/59ed73407a569c3be86cfdb4b8f438cb8c794540/benchmark.py#L6-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035387", "code": "def format_bytes_size(val):\n\t\"\"\"\n\tTake a number of bytes and convert it to a human readable number.\n\n\t:param int val: The number of bytes to format.\n\t:return: The size in a human readable format.\n\t:rtype: str\n\t\"\"\"\n\tif not val:\n\t\treturn '0 bytes'\n\tfor sz_name in ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']:\n\t\tif val < 1024.0:\n\t\t\treturn \"{0:.2f} {1}\".format(val, sz_name)\n\t\tval /= 1024.0\n\traise OverflowError()", "entry_point": "format_bytes_size", "input": "[]", "output": "'0 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/utilities.py#L485-L499", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035388", "code": "def parse_case_snake_to_camel(snake, upper_first=True):\n\t\"\"\"\n\tConvert a string from snake_case to CamelCase.\n\n\t:param str snake: The snake_case string to convert.\n\t:param bool upper_first: Whether or not to capitalize the first\n\t\tcharacter of the string.\n\t:return: The CamelCase version of string.\n\t:rtype: str\n\t\"\"\"\n\tsnake = snake.split('_')\n\tfirst_part = snake[0]\n\tif upper_first:\n\t\tfirst_part = first_part.title()\n\treturn first_part + ''.join(word.title() for word in snake[1:])", "entry_point": "parse_case_snake_to_camel", "input": "'a,b,c', ('a', 'b', 'c')", "output": "'A,B,C'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/utilities.py#L577-L591", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035389", "code": "def parse_server(server, default_port):\n\t\"\"\"\n\tConvert a server string to a tuple suitable for passing to connect, for\n\texample converting 'www.google.com:443' to ('www.google.com', 443).\n\n\t:param str server: The server string to convert.\n\t:param int default_port: The port to use in case one is not specified\n\t\tin the server string.\n\t:return: The parsed server information.\n\t:rtype: tuple\n\t\"\"\"\n\tserver = server.rsplit(':', 1)\n\thost = server[0]\n\tif host.startswith('[') and host.endswith(']'):\n\t\thost = host[1:-1]\n\tif len(server) == 1:\n\t\treturn (host, default_port)\n\tport = server[1]\n\tif not port:\n\t\tport = default_port\n\telse:\n\t\tport = int(port)\n\treturn (host, port)", "entry_point": "parse_server", "input": "'a,b,c', ()", "output": "('a,b,c', ())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/utilities.py#L593-L615", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035390", "code": "def parse_timespan(timedef):\n\t\"\"\"\n\tConvert a string timespan definition to seconds, for example converting\n\t'1m30s' to 90. If *timedef* is already an int, the value will be returned\n\tunmodified.\n\n\t:param timedef: The timespan definition to convert to seconds.\n\t:type timedef: int, str\n\t:return: The converted value in seconds.\n\t:rtype: int\n\t\"\"\"\n\tif isinstance(timedef, int):\n\t\treturn timedef\n\tconverter_order = ('w', 'd', 'h', 'm', 's')\n\tconverters = {\n\t\t'w': 604800,\n\t\t'd': 86400,\n\t\t'h': 3600,\n\t\t'm': 60,\n\t\t's': 1\n\t}\n\ttimedef = timedef.lower()\n\tif timedef.isdigit():\n\t\treturn int(timedef)\n\telif len(timedef) == 0:\n\t\treturn 0\n\tseconds = -1\n\tfor spec in converter_order:\n\t\ttimedef = timedef.split(spec)\n\t\tif len(timedef) == 1:\n\t\t\ttimedef = timedef[0]\n\t\t\tcontinue\n\t\telif len(timedef) > 2 or not timedef[0].isdigit():\n\t\t\tseconds = -1\n\t\t\tbreak\n\t\tadjustment = converters[spec]\n\t\tseconds = max(seconds, 0)\n\t\tseconds += (int(timedef[0]) * adjustment)\n\t\ttimedef = timedef[1]\n\t\tif not len(timedef):\n\t\t\tbreak\n\tif seconds < 0:\n\t\traise ValueError('invalid time format')\n\treturn seconds", "entry_point": "parse_timespan", "input": "1", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/utilities.py#L617-L660", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035391", "code": "def parse_to_slug(words, maxlen=24):\n\t\"\"\"\n\tParse a string into a slug format suitable for use in URLs and other\n\tcharacter restricted applications. Only utf-8 strings are supported at this\n\ttime.\n\n\t:param str words: The words to parse.\n\t:param int maxlen: The maximum length of the slug.\n\t:return: The parsed words as a slug.\n\t:rtype: str\n\t\"\"\"\n\tslug = ''\n\tmaxlen = min(maxlen, len(words))\n\tfor c in words:\n\t\tif len(slug) == maxlen:\n\t\t\tbreak\n\t\tc = ord(c)\n\t\tif c == 0x27:\n\t\t\tcontinue\n\t\telif c >= 0x30 and c <= 0x39:\n\t\t\tslug += chr(c)\n\t\telif c >= 0x41 and c <= 0x5a:\n\t\t\tslug += chr(c + 0x20)\n\t\telif c >= 0x61 and c <= 0x7a:\n\t\t\tslug += chr(c)\n\t\telif len(slug) and slug[-1] != '-':\n\t\t\tslug += '-'\n\tif len(slug) and slug[-1] == '-':\n\t\tslug = slug[:-1]\n\treturn slug", "entry_point": "parse_to_slug", "input": "set(), 0.5", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/utilities.py#L662-L691", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035392", "code": "def selection_collision(selections, poolsize):\n\t\"\"\"\n\tCalculate the probability that two random values selected from an arbitrary\n\tsized pool of unique values will be equal. This is commonly known as the\n\t\"Birthday Problem\".\n\n\t:param int selections: The number of random selections.\n\t:param int poolsize: The number of unique random values in the pool to choose from.\n\t:rtype: float\n\t:return: The chance that a collision will occur as a percentage.\n\t\"\"\"\n\t# requirments = sys\n\tprobability = 100.0\n\tpoolsize = float(poolsize)\n\tfor i in range(selections):\n\t\tprobability = probability * (poolsize - i) / poolsize\n\tprobability = (100.0 - probability)\n\treturn probability", "entry_point": "selection_collision", "input": "0, 2.0", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/utilities.py#L717-L734", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035393", "code": "def fmt_val(val, shorten=True):\n    \"\"\"Format a value for inclusion in an \n    informative text string.\n    \"\"\"\n    val = repr(val)\n    max = 50\n    if shorten:\n        if len(val) > max:\n            close = val[-1]\n            val = val[0:max-4] + \"...\"\n            if close in (\">\", \"'\", '\"', ']', '}', ')'):\n                val = val + close\n    return val", "entry_point": "fmt_val", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "\"['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fudge-py/fudge/blob/b283fbc1a41900f3f5845b10b8c2ef9136a67ebc/fudge/util.py#L15-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035394", "code": "def job_ids(log_stream):\n    \"\"\"Grep out all lines with scancel example.\"\"\"\n    id_rows = [line for line in log_stream if 'scancel' in line]\n    jobs = [id_row.strip()[-7:-1] for id_row in id_rows]\n    return jobs", "entry_point": "job_ids", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/mip/miplog.py#L3-L7", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035395", "code": "def replace_lines(regexer, handler, lines):\n    \"\"\"Uses replacement handler to perform replacements on lines of text\n\n    First we strip off all whitespace\n    We run the replacement on a clean 'content' string\n    Finally we replace the original content with the replaced version\n    This ensures that we retain the correct whitespace from the original line\n    \"\"\"\n    result = []\n    for line in lines:\n        content = line.strip()\n        replaced = regexer.sub(handler, content)\n        result.append(line.replace(content, replaced, 1))\n    return result", "entry_point": "replace_lines", "input": "['a', 'b', 'c'], ['a', 'b', 'c'], ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L37-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035396", "code": "def make_iterable(obj):\n    \"\"\"Make an object iterable.\n\n    >>> make_iterable(obj='hello')\n    ('hello',)\n    >>> make_iterable(obj=None)\n    ()\n    \"\"\"\n    if not obj:\n        return tuple()\n\n    if isinstance(obj, (list, tuple, set)):\n        return obj\n\n    return (obj,)", "entry_point": "make_iterable", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/InfoAgeTech/django-core/blob/9664a145473b75120bf71e1644e9c8086e7e8955/django_core/templatetags/collection_tags.py#L48-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035397", "code": "def default_ubuntu_tr(mod):\n    \"\"\"\n    Default translation function for Ubuntu based systems\n    \"\"\"\n    pkg = 'python-%s' % mod.lower()\n    py2pkg = pkg\n    py3pkg = 'python3-%s' % mod.lower()\n    return (pkg, py2pkg, py3pkg)", "entry_point": "default_ubuntu_tr", "input": "'AbC dEf'", "output": "('python-abc def', 'python-abc def', 'python3-abc def')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/pymod2pkg/blob/f9a2f02fbfa0b2cfcdb4a7494c9ddbd10859065a/pymod2pkg/__init__.py#L87-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035398", "code": "def default_suse_tr(mod):\n    \"\"\"\n    Default translation function for openSUSE, SLES, and other\n    SUSE based systems\n\n    Returns a tuple of 3 elements - the unversioned name, the python2 versioned\n    name and the python3 versioned name.\n    \"\"\"\n    pkg = 'python-%s' % mod\n    py2pkg = 'python2-%s' % mod\n    py3pkg = 'python3-%s' % mod\n    return (pkg, py2pkg, py3pkg)", "entry_point": "default_suse_tr", "input": "[[1, 2], [3], []]", "output": "('python-[[1, 2], [3], []]', 'python2-[[1, 2], [3], []]', 'python3-[[1, 2], [3], []]')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/pymod2pkg/blob/f9a2f02fbfa0b2cfcdb4a7494c9ddbd10859065a/pymod2pkg/__init__.py#L97-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035399", "code": "def normalize_route(route: str) -> str:\n    \"\"\"Strip some of the ugly regexp characters from the given pattern.\n\n    >>> normalize_route('^/user/<user_id:int>/?$')\n    u'/user/(user_id:int)/'\n    \"\"\"\n    normalized_route = str(route).lstrip('^').rstrip('$').rstrip('?')\n    normalized_route = normalized_route.replace('<', '(').replace('>', ')')\n    return normalized_route", "entry_point": "normalize_route", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/upsight/doctor/blob/2cf1d433f6f1aa1355644b449a757c0660793cdd/doctor/docs/base.py#L464-L472", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035400", "code": "def prefix_lines(lines, prefix):\n    \"\"\"Add the prefix to each of the lines.\n\n    >>> prefix_lines(['foo', 'bar'], '  ')\n    ['  foo', '  bar']\n    >>> prefix_lines('foo\\\\nbar', '  ')\n    ['  foo', '  bar']\n\n    :param list or str lines: A string or a list of strings. If a string is\n        passed, the string is split using splitlines().\n    :param str prefix: Prefix to add to the lines. Usually an indent.\n    :returns: list\n    \"\"\"\n    if isinstance(lines, bytes):\n        lines = lines.decode('utf-8')\n    if isinstance(lines, str):\n        lines = lines.splitlines()\n    return [prefix + line for line in lines]", "entry_point": "prefix_lines", "input": "'walnut thistle harbour', 'a,b,c'", "output": "['a,b,cwalnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/upsight/doctor/blob/2cf1d433f6f1aa1355644b449a757c0660793cdd/doctor/docs/base.py#L475-L492", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035401", "code": "def _tasks_to_reinsert(tasks, transactional):\n    \"\"\"Return a list containing the tasks that should be reinserted based on the\n    was_enqueued property and whether the insert is transactional or not.\n    \"\"\"\n    if transactional:\n        return tasks\n\n    return [task for task in tasks if not task.was_enqueued]", "entry_point": "_tasks_to_reinsert", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Workiva/furious/blob/c29823ec8b98549e7439d7273aa064d1e5830632/furious/context/context.py#L419-L426", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035402", "code": "def getEnvironmentFromNameAndProtocol(studyname, protocolname):\n    \"\"\"\n    Extract environment name using studyname and protocolname to guide\n    :param str studyname: Name of the study (including Env)\n    :param str protocolname: Name of the study\n    \"\"\"\n    # StudyName =    \"TEST (1) (DEV)\"\n    # ProtocolName = \"TEST (1)\"\n    # Raw Env      =           \"(DEV)\"\n\n    raw_env = studyname[len(protocolname) :].strip()\n\n    if \"(\" in raw_env:\n        l_brace_pos = raw_env.rfind(\"(\")\n        r_brace_pos = raw_env.rfind(\")\")\n        return raw_env[l_brace_pos + 1 : r_brace_pos]\n    else:\n        return raw_env", "entry_point": "getEnvironmentFromNameAndProtocol", "input": "'abc', 'a,b,c'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mdsol/rwslib/blob/1a86bc072d408c009ed1de8bf6e98a1769f54d18/rwslib/rwsobjects.py#L10-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035403", "code": "def IJ(mu, N):\n    \"\"\"Return i, j, s for any given mu.\"\"\"\n    if mu == 0: return 1, 1, 1\n\n    if mu not in range(0, N**2):\n        raise ValueError('mu has an invalid value mu='+str(mu)+'.')\n\n    if 1 <= mu <= N-1:\n        return mu+1, mu+1, 1\n    else:\n        m = N-1\n        M = N*(N-1)/2\n        for jj in range(1, N):\n            for ii in range(jj+1, N+1):\n                m += 1\n                if m == mu or m+M == mu:\n                    if mu > N*(N+1)/2 - 1:\n                        return ii, jj, -1\n                    else:\n                        return ii, jj, 1", "entry_point": "IJ", "input": "False, ()", "output": "(1, 1, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oscarlazoarjona/fast/blob/3e5400672af2a7b7cc616e7f4aa10d7672720222/fast/misc.py#L99-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035404", "code": "def detuning_combinations(lists):\n    r\"\"\"This function recieves a list of length Nl with the number of\n    transitions each laser induces. It returns the cartesian product of all\n    these posibilities as a list of all possible combinations.\n    \"\"\"\n    Nl = len(lists)\n    comb = [[i] for i in range(lists[0])]\n    for l in range(1, Nl):\n        combn = []\n        for c0 in comb:\n            for cl in range(lists[l]):\n                combn += [c0[:]+[cl]]\n        comb = combn[:]\n    return comb", "entry_point": "detuning_combinations", "input": "[1, 2, 3]", "output": "[[0, 0, 0], [0, 0, 1], [0, 0, 2], [0, 1, 0], [0, 1, 1], [0, 1, 2]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oscarlazoarjona/fast/blob/3e5400672af2a7b7cc616e7f4aa10d7672720222/fast/misc.py#L322-L335", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035405", "code": "def perm_j(j1, j2):\n    r\"\"\"Calculate the allowed total angular momenta.\n\n    >>> from sympy import Integer\n    >>> L = 1\n    >>> S = 1/Integer(2)\n    >>> perm_j(L, S)\n    [1/2, 3/2]\n\n    \"\"\"\n    jmin = abs(j1-j2)\n    jmax = j1+j2\n    return [jmin + i for i in range(jmax-jmin+1)]", "entry_point": "perm_j", "input": "False, False", "output": "[0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oscarlazoarjona/fast/blob/3e5400672af2a7b7cc616e7f4aa10d7672720222/fast/angular_momentum.py#L31-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035406", "code": "def check_positive_integer(name, value):\n    \"\"\"Check a value is a positive integer.\n\n    Returns the value if so, raises ValueError otherwise.\n\n    \"\"\"\n    try:\n        value = int(value)\n        is_positive = (value > 0)\n    except ValueError:\n        raise ValueError('%s should be an integer; got %r' % (name, value))\n\n    if is_positive:\n        return value\n    else:\n        raise ValueError('%s should be positive; got %r' % (name, value))", "entry_point": "check_positive_integer", "input": "(1, 2), 10", "output": "10", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alexwlchan/specktre/blob/dcdd0d5486e5c3f612f64221b2e0dbc6fb7adafc/src/specktre/cli.py#L40-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035407", "code": "def detunings_indices(Neu, Nl, xiu):\n    r\"\"\"Get the indices of the transitions of all fields.\n\n    They are returned in the form\n    [[(i1, j1), (i2, j2)], ...,[(i1, j1)]].\n    that is, one list of pairs of indices for each field.\n\n    >>> Ne = 6\n    >>> Nl = 2\n    >>> omega_level = [0.0, 100.0, 100.0, 200.0, 200.0, 300.0]\n    >>> xi = np.zeros((Nl, Ne, Ne))\n    >>> coup = [[(1, 0), (2, 0)], [(3, 0), (4, 0), (5, 0)]]\n    >>> for l in range(Nl):\n    ...     for pair in coup[l]:\n    ...         xi[l, pair[0], pair[1]] = 1.0\n    ...         xi[l, pair[1], pair[0]] = 1.0\n\n    >>> aux = define_simplification(omega_level, xi, Nl)\n    >>> u, invu, omega_levelu, Neu, xiu = aux\n    >>> detunings_indices(Neu, Nl, xiu)\n    [[(1, 0)], [(2, 0), (3, 0)]]\n\n    \"\"\"\n    pairs = []\n    for l in range(Nl):\n        ind = []\n        for iu in range(Neu):\n            for ju in range(iu):\n                if xiu[l, iu, ju] == 1:\n                    ind += [(iu, ju)]\n        pairs += [ind]\n    return pairs", "entry_point": "detunings_indices", "input": "{1, 2, 3}, 0, False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oscarlazoarjona/fast/blob/3e5400672af2a7b7cc616e7f4aa10d7672720222/fast/bloch.py#L417-L448", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035408", "code": "def detunings_combinations(pairs):\n    r\"\"\"Return all combinations of detunings.\n\n    >>> Ne = 6\n    >>> Nl = 2\n    >>> omega_level = [0.0, 100.0, 100.0, 200.0, 200.0, 300.0]\n    >>> xi = np.zeros((Nl, Ne, Ne))\n    >>> coup = [[(1, 0), (2, 0)], [(3, 0), (4, 0), (5, 0)]]\n    >>> for l in range(Nl):\n    ...     for pair in coup[l]:\n    ...         xi[l, pair[0], pair[1]] = 1.0\n    ...         xi[l, pair[1], pair[0]] = 1.0\n\n    >>> aux = define_simplification(omega_level, xi, Nl)\n    >>> u, invu, omega_levelu, Neu, xiu = aux\n    >>> pairs = detunings_indices(Neu, Nl, xiu)\n    >>> detunings_combinations(pairs)\n    [[(1, 0), (2, 0)], [(1, 0), (3, 0)]]\n\n    \"\"\"\n    def iter(pairs, combs, l):\n        combs_n = []\n        for i in range(len(combs)):\n            for j in range(len(pairs[l])):\n                combs_n += [combs[i] + [pairs[l][j]]]\n        return combs_n\n\n    Nl = len(pairs)\n    combs = [[pairs[0][k]] for k in range(len(pairs[0]))]\n    for l in range(1, Nl):\n        combs = iter(pairs, combs, 1)\n\n    return combs", "entry_point": "detunings_combinations", "input": "['a', 'b', 'c']", "output": "[['a', 'b', 'b']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oscarlazoarjona/fast/blob/3e5400672af2a7b7cc616e7f4aa10d7672720222/fast/bloch.py#L492-L524", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035409", "code": "def listify(arg):\n    \"\"\"\n    Simple utility method to ensure an argument provided is a list. If the\n    provider argument is not an instance of `list`, then we return [arg], else\n    arg is returned.\n\n    :type arg: list\n    :rtype: list\n    \"\"\"\n    if isinstance(arg, (set, tuple)):\n        # if it is a set or tuple make it a list\n        return list(arg)\n    if not isinstance(arg, list):\n        return [arg]\n    return arg", "entry_point": "listify", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abn/cafeteria/blob/0a2efb0529484d6da08568f4364daff77f734dfd/cafeteria/utilities.py#L7-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035410", "code": "def get_common_xs(entries):\n    \"\"\"Return a mask of where there are Xs in all routing table entries.\n\n    For example ``01XX`` and ``XX1X`` have common Xs in the LSB only, for this\n    input this method would return ``0b0001``::\n\n        >>> from rig.routing_table import RoutingTableEntry\n        >>> entries = [\n        ...     RoutingTableEntry(set(), 0b0100, 0xfffffff0 | 0b1100),  # 01XX\n        ...     RoutingTableEntry(set(), 0b0010, 0xfffffff0 | 0b0010),  # XX1X\n        ... ]\n        >>> print(\"{:#06b}\".format(get_common_xs(entries)))\n        0b0001\n    \"\"\"\n    # Determine where there are never 1s in the key and mask\n    key = 0x00000000\n    mask = 0x00000000\n\n    for entry in entries:\n        key |= entry.key\n        mask |= entry.mask\n\n    # Where there are never 1s in the key or the mask there are Xs which are\n    # common to all entries.\n    return (~(key | mask)) & 0xffffffff", "entry_point": "get_common_xs", "input": "[]", "output": "4294967295", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/project-rig/rig/blob/3a3e053d3214899b6d68758685835de0afd5542b/rig/routing_table/utils.py#L369-L393", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035411", "code": "def wrap_url(s, l):\n    \"\"\"Wrap a URL string\"\"\"\n    parts = s.split('/')\n\n    if len(parts) == 1:\n        return parts[0]\n    else:\n        i = 0\n        lines = []\n        for j in range(i, len(parts) + 1):\n            tv = '/'.join(parts[i:j])\n            nv = '/'.join(parts[i:j + 1])\n\n            if len(nv) > l or nv == tv:\n                i = j\n                lines.append(tv)\n\n        return '/\\n'.join(lines)", "entry_point": "wrap_url", "input": "'', ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Metatab/metapack/blob/8365f221fbeaa3c0be9091f2eaf3447fd8e2e8d6/metapack/cli/doc.py#L291-L308", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035412", "code": "def sample_counters(mc, system_info):\n    \"\"\"Sample every router counter in the machine.\"\"\"\n    return {\n        (x, y): mc.get_router_diagnostics(x, y) for (x, y) in system_info\n    }", "entry_point": "sample_counters", "input": "[1, 2, 3], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/project-rig/rig/blob/3a3e053d3214899b6d68758685835de0afd5542b/rig/scripts/rig_counters.py#L24-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035413", "code": "def human_duration(duration_seconds: float) -> str:\n    \"\"\"Convert a duration in seconds into a human friendly string.\"\"\"\n    if duration_seconds < 0.001:\n        return '0 ms'\n    if duration_seconds < 1:\n        return '{} ms'.format(int(duration_seconds * 1000))\n    return '{} s'.format(int(duration_seconds))", "entry_point": "human_duration", "input": "0.5", "output": "'500 ms'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NicolasLM/spinach/blob/0122f916643101eab5cdc1f3da662b9446e372aa/spinach/utils.py#L13-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035414", "code": "def get_combination_action(combination):\n    \"\"\"\n    Prepares the action for a keyboard combination, also filters another\n    \"strange\" actions declared by the user.\n    \"\"\"\n    accepted_actions = ('link', 'js')\n    for action in accepted_actions:\n        if action in combination:\n            return {action: combination[action]}\n    return {}", "entry_point": "get_combination_action", "input": "['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DNX/django-keyboard-shorcuts/blob/dd853a410614c0dfb7cce803eafda9b5fa47be17/keyboard_shortcuts/utils.py#L14-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035415", "code": "def _sane_version_list(version):\n    \"\"\"Ensure the major and minor are int.\n\n    Parameters\n    ----------\n    version: list\n        Version components\n\n    Returns\n    -------\n    version: list\n        List of components where first two components has been sanitised\n\n    \"\"\"\n    v0 = str(version[0])\n    if v0:\n        # Test if the major is a number.\n        try:\n            v0 = v0.lstrip(\"v\").lstrip(\"V\")\n            # Handle the common case where tags have v before major.\n            v0 = int(v0)\n        except ValueError:\n            v0 = None\n\n    if v0 is None:\n        version = [0, 0] + version\n    else:\n        version[0] = v0\n\n    try:\n        # Test if the minor is a number.\n        version[1] = int(version[1])\n    except ValueError:\n        # Insert Minor 0.\n        version = [version[0], 0] + version[1:]\n\n    return version", "entry_point": "_sane_version_list", "input": "[[1, 2], [3], []]", "output": "[0, 0, [1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ska-sa/katversion/blob/f507e46e6c5610aec89a08dd480c9b3721da0f8a/katversion/version.py#L324-L360", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035416", "code": "def _year_from_2digits(short_year, current_year):\n        \"\"\"\n        Converts a relative 2-digit year to an absolute 4-digit year\n        :param short_year: the relative year\n        :param current_year: the current year\n        :return: the absolute year\n        \"\"\"\n        if short_year < 100:\n            short_year += current_year - (current_year % 100)\n            if abs(short_year - current_year) >= 50:\n                if short_year < current_year:\n                    return short_year + 100\n                else:\n                    return short_year - 100\n        return short_year", "entry_point": "_year_from_2digits", "input": "10, False", "output": "10", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/python/temba_expressions/dates.py#L298-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035417", "code": "def s_to_ev(offset_us, source_to_detector_m, array):\n    \"\"\"convert time (s) to energy (eV)\n    Parameters:\n    ===========\n    numpy array of time in s\n    offset_us: float. Delay of detector in us\n    source_to_detector_m: float. Distance source to detector in m\n\n    Returns:\n    ========\n    numpy array of energy in eV\n    \"\"\"\n    lambda_a = 3956. * (array + offset_us * 1e-6) / source_to_detector_m\n    return (81.787 / pow(lambda_a, 2)) / 1000.", "entry_point": "s_to_ev", "input": "True, 2.0, True", "output": "2.0904069237406565e-08", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ornlneutronimaging/ImagingReso/blob/2da5cd1f565b3128f59d86bcedfd9adc2b02218b/ImagingReso/_utilities.py#L719-L732", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035418", "code": "def _si(number):\n    \"\"\"Format a number using base-2 SI prefixes\"\"\"\n    prefixes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']\n    while number > 1024:\n        number /= 1024.0\n        prefixes.pop(0)\n    return '%0.2f%s' % (number, prefixes.pop(0))", "entry_point": "_si", "input": "5", "output": "'5.00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MozillaSecurity/fuzzfetch/blob/166cbfc71b679db019b9ac777dce12ccfdfc2c10/src/fuzzfetch/fetch.py#L72-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035419", "code": "def __remove_leading_empty_lines(lines):\n        \"\"\"\n        Removes leading empty lines from a list of lines.\n\n        :param list[str] lines: The lines.\n        \"\"\"\n        tmp = list()\n        empty = True\n        for i in range(0, len(lines)):\n            empty = empty and lines[i] == ''\n            if not empty:\n                tmp.append(lines[i])\n\n        return tmp", "entry_point": "__remove_leading_empty_lines", "input": "'abc'", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SetBased/py-stratum/blob/7c5ffaa2fdd03f865832a5190b5897ff2c0e3155/pystratum/DocBlockReflection.py#L94-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035420", "code": "def envars_to_markdown(envars, title = \"Environment\"):\n    '''generate a markdown list of a list of environment variable tuples\n\n       Parameters\n       ==========\n       title: A title for the section (defaults to \"Environment\"\n       envars: a list of tuples for the environment, e.g.:\n\n            [('TERM', 'xterm-256color'),\n             ('SHELL', '/bin/bash'),\n             ('USER', 'vanessa'),\n             ('LD_LIBRARY_PATH', ':/usr/local/pulse')]\n\n    '''\n    markdown = ''\n    if envars not in [None, '', []]:\n        markdown += '\\n## %s\\n' % title\n        for envar in envars:\n            markdown += ' - **%s**: %s\\n' %(envar[0], envar[1])\n    return markdown", "entry_point": "envars_to_markdown", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "'\\n## [1, 2, 3]\\n - **a**: p\\n - **b**: a\\n - **c**: h\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vsoch/helpme/blob/e609172260b10cddadb2d2023ab26da8082a9feb/helpme/utils/format.py#L29-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035421", "code": "def make_headers(headers):\n    \"\"\" Make the cache control headers based on a previous request's\n    response headers\n    \"\"\"\n    out = {}\n    if 'etag' in headers:\n        out['if-none-match'] = headers['etag']\n    if 'last-modified' in headers:\n        out['if-modified-since'] = headers['last-modified']\n    return out", "entry_point": "make_headers", "input": "['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PlaidWeb/Pushl/blob/5ea92275c37a6c1989e3d5f53e26c6e0ebfb9a8c/pushl/caching.py#L69-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035422", "code": "def split_seconds(seconds):\n    \"\"\"Split seconds into [day, hour, minute, second, ms]\n\n        `divisor: 1, 24, 60, 60, 1000`\n\n        `units: day, hour, minute, second, ms`\n\n    >>> split_seconds(6666666)\n    [77, 3, 51, 6, 0]\n    \"\"\"\n    ms = seconds * 1000\n    divisors = (1, 24, 60, 60, 1000)\n    quotient, result = ms, []\n    for divisor in divisors[::-1]:\n        quotient, remainder = divmod(quotient, divisor)\n        result.append(quotient) if divisor == 1 else result.append(remainder)\n    return result[::-1]", "entry_point": "split_seconds", "input": "3.25", "output": "[0.0, 0.0, 0.0, 3.0, 250.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ClericPy/torequests/blob/1793261688d7a47e1c3a0830d83f8552f5e3e5d9/torequests/utils.py#L328-L344", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035423", "code": "def guess_interval(nums, accuracy=0):\n    \"\"\"Given a seq of number, return the median, only calculate interval >= accuracy.\n\n    ::\n\n        from torequests.utils import guess_interval\n        import random\n\n        seq = [random.randint(1, 100) for i in range(20)]\n        print(guess_interval(seq, 5))\n        # sorted_seq: [2, 10, 12, 19, 19, 29, 30, 32, 38, 40, 41, 54, 62, 69, 75, 79, 82, 88, 97, 99]\n        # diffs: [8, 7, 10, 6, 13, 8, 7, 6, 6, 9]\n        # median: 8\n    \"\"\"\n    if not nums:\n        return 0\n    nums = sorted([int(i) for i in nums])\n    if len(nums) == 1:\n        return nums[0]\n    diffs = [nums[i + 1] - nums[i] for i in range(len(nums) - 1)]\n    diffs = [item for item in diffs if item >= accuracy]\n    sorted_diff = sorted(diffs)\n    result = sorted_diff[len(diffs) // 2]\n    return result", "entry_point": "guess_interval", "input": "[], [[1, 2], [3], []]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ClericPy/torequests/blob/1793261688d7a47e1c3a0830d83f8552f5e3e5d9/torequests/utils.py#L1211-L1234", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035424", "code": "def serialize(dictionary):\n    \"\"\"\n    Turn dictionary into argument like string.\n\n    \"\"\"\n\n    data = []\n    for key, value in dictionary.items():\n        data.append('{0}=\"{1}\"'.format(key, value))\n    return ', '.join(data)", "entry_point": "serialize", "input": "{'a': 1, 'b': 2}", "output": "'a=\"1\", b=\"2\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/julot/sphinxcontrib-dd/blob/18619b356508b9a99cc329eeae53cbf299a5d1de/sphinxcontrib/dd/database_diagram.py#L12-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035425", "code": "def list_contains(list_of_strings, substring, return_true_false_array=False):\n    \"\"\" Get strings in list which contains substring.\n\n    \"\"\"\n    key_tf = [keyi.find(substring) != -1 for keyi in list_of_strings]\n    if return_true_false_array:\n        return key_tf\n    keys_to_remove = list_of_strings[key_tf]\n    return keys_to_remove", "entry_point": "list_contains", "input": "[], '  padded  ', [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mjirik/io3d/blob/ccaf3e378dcc967f2565d477fc27583fd0f61fcc/io3d/dili.py#L176-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035426", "code": "def unique(_list):\n    \"\"\"\n    Makes the list have unique items only and maintains the order\n\n    list(set()) won't provide that\n\n    :type _list list\n    :rtype: list\n    \"\"\"\n    ret = []\n\n    for item in _list:\n        if item not in ret:\n            ret.append(item)\n\n    return ret", "entry_point": "unique", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/macbre/sql-metadata/blob/4b7b4ae0a961d568075aefe78535cf5aee74583c/sql_metadata.py#L12-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035427", "code": "def intToID(idnum, prefix):\n    \"\"\"\n    Returns the ID name for the given ID number, spreadsheet-style, i.e. from a to z,\n    then from aa to az, ba to bz, etc., until zz.\n    \"\"\"\n    rid = ''\n\n    while idnum > 0:\n        idnum -= 1\n        rid = chr((idnum % 26) + ord('a')) + rid\n        idnum = int(idnum / 26)\n\n    return prefix + rid", "entry_point": "intToID", "input": "-3, '  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scour-project/scour/blob/049264eba6b1a54ae5ba1d6a5077d8e7b80e8835/scour/scour.py#L738-L750", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035428", "code": "def taint(taintedSet, taintedAttribute):\n    u\"\"\"Adds an attribute to a set of attributes.\n\n    Related attributes are also included.\"\"\"\n    taintedSet.add(taintedAttribute)\n    if taintedAttribute == 'marker':\n        taintedSet |= set(['marker-start', 'marker-mid', 'marker-end'])\n    if taintedAttribute in ['marker-start', 'marker-mid', 'marker-end']:\n        taintedSet.add('marker')\n    return taintedSet", "entry_point": "taint", "input": "{1, 2, 3}, 2", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scour-project/scour/blob/049264eba6b1a54ae5ba1d6a5077d8e7b80e8835/scour/scour.py#L1885-L1894", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035429", "code": "def controlPoints(cmd, data):\n    \"\"\"\n       Checks if there are control points in the path data\n\n       Returns the indices of all values in the path data which are control points\n    \"\"\"\n    cmd = cmd.lower()\n    if cmd in ['c', 's', 'q']:\n        indices = range(len(data))\n        if cmd == 'c':  # c: (x1 y1 x2 y2 x y)+\n            return [index for index in indices if (index % 6) < 4]\n        elif cmd in ['s', 'q']:  # s: (x2 y2 x y)+   q: (x1 y1 x y)+\n            return [index for index in indices if (index % 4) < 2]\n\n    return []", "entry_point": "controlPoints", "input": "'walnut thistle harbour', False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scour-project/scour/blob/049264eba6b1a54ae5ba1d6a5077d8e7b80e8835/scour/scour.py#L2643-L2657", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035430", "code": "def optimizeAngle(angle):\n    \"\"\"\n    Because any rotation can be expressed within 360 degrees\n    of any given number, and since negative angles sometimes\n    are one character longer than corresponding positive angle,\n    we shorten the number to one in the range to [-90, 270[.\n    \"\"\"\n    # First, we put the new angle in the range ]-360, 360[.\n    # The modulo operator yields results with the sign of the\n    # divisor, so for negative dividends, we preserve the sign\n    # of the angle.\n    if angle < 0:\n        angle %= -360\n    else:\n        angle %= 360\n    # 720 degrees is unnecessary, as 360 covers all angles.\n    # As \"-x\" is shorter than \"35x\" and \"-xxx\" one character\n    # longer than positive angles <= 260, we constrain angle\n    # range to [-90, 270[ (or, equally valid: ]-100, 260]).\n    if angle >= 270:\n        angle -= 360\n    elif angle < -90:\n        angle += 360\n    return angle", "entry_point": "optimizeAngle", "input": "0.5", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scour-project/scour/blob/049264eba6b1a54ae5ba1d6a5077d8e7b80e8835/scour/scour.py#L2853-L2876", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035431", "code": "def index_to_housecode(index):\n    \"\"\"Convert a zero-based index to a X10 housecode.\"\"\"\n    if index < 0 or index > 255:\n        raise ValueError\n    quotient, remainder = divmod(index, 16)\n    return chr(quotient+ord('A')) + '{:02d}'.format(remainder+1)", "entry_point": "index_to_housecode", "input": "0", "output": "'A01'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwww/elkm1/blob/078d0de30840c3fab46f1f8534d98df557931e91/elkm1_lib/message.py#L246-L251", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035432", "code": "def trans_attr(attr, lang):\n\t\"\"\"\n\tReturns the name of the translated attribute of the object <attribute>_<lang_iso_code>.\n\tFor example: name_es (name attribute in Spanish)\n\t@param attr Attribute whose name will form the name translated attribute.\n\t@param lang ISO Language code that will be the suffix of the translated attribute.\n\t@return: string with the name of the translated attribute.\n\t\"\"\"\n\tlang = lang.replace(\"-\",\"_\").lower()\n\treturn \"{0}_{1}\".format(attr,lang)", "entry_point": "trans_attr", "input": "False, 'walnut thistle harbour'", "output": "'False_walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/intelligenia/modeltranslation/blob/64d6adeb537747321d5020efedf5d7e0d135862d/modeltranslation/models.py#L50-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035433", "code": "def info2lists(info, in_place=False):\n\n    \"\"\"\n    Return info with:\n\n    1) `packages` dict replaced by a 'packages' list with indexes removed\n    2) `releases` dict replaced by a 'releases' list with indexes removed\n\n    info2list(info2dicts(info)) == info\n    \"\"\"\n    if 'packages' not in info and 'releases' not in info:\n        return info\n    if in_place:\n        info_lists = info\n    else:\n        info_lists = info.copy()\n    packages = info.get('packages')\n    if packages:\n        info_lists['packages'] = list(packages.values())\n    releases = info.get('releases')\n    if releases:\n        info_lists['releases'] = list(releases.values())\n    return info_lists", "entry_point": "info2lists", "input": "[1, 2, 3], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/softwarefactory-project/distroinfo/blob/86a7419232a3376157c06e70528ec627e03ff82a/distroinfo/parse.py#L211-L233", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035434", "code": "def bool_to_unicode(b):\n    \"\"\"Different possibilities for True: \u2611\ufe0f\u2714\ufe0e\u2713\u2705\ud83d\udc4d\u2714\ufe0f\n       Different possibilities for False: \u2715\u2716\ufe0e\u2717\u2718\u2716\ufe0f\u274c\u26d4\ufe0f\u274e\ud83d\udc4e\ud83d\uded1\ud83d\udd34\"\"\"\n    b = bool(b)\n    if b is True:  return u\"\u2705\"\n    if b is False: return u\"\u274e\"", "entry_point": "bool_to_unicode", "input": "[1, 2, 3]", "output": "'\u2705'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xapple/plumbing/blob/4a7706c7722f5996d0ca366f191aff9ac145880a/plumbing/common.py#L67-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035435", "code": "def count_string_diff(a,b):\n    \"\"\"Return the number of characters in two strings that don't exactly match\"\"\"\n    shortest = min(len(a), len(b))\n    return sum(a[i] != b[i] for i in range(shortest))", "entry_point": "count_string_diff", "input": "[1, 2, 3], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xapple/plumbing/blob/4a7706c7722f5996d0ca366f191aff9ac145880a/plumbing/common.py#L137-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035436", "code": "def uniquify_list(L):\n    \"\"\"Same order unique list using only a list compression.\"\"\"\n    return [e for i, e in enumerate(L) if L.index(e) == i]", "entry_point": "uniquify_list", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xapple/plumbing/blob/4a7706c7722f5996d0ca366f191aff9ac145880a/plumbing/common.py#L151-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035437", "code": "def average(iterator):\n    \"\"\"Iterative mean.\"\"\"\n    count = 0\n    total = 0\n    for num in iterator:\n        count += 1\n        total += num\n    return float(total)/count", "entry_point": "average", "input": "[5, 3, 1, 4]", "output": "3.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xapple/plumbing/blob/4a7706c7722f5996d0ca366f191aff9ac145880a/plumbing/common.py#L156-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035438", "code": "def andify(list_of_strings):\n    \"\"\"\n    Given a list of strings will join them with commas\n    and a final \"and\" word.\n\n    >>> andify(['Apples', 'Oranges', 'Mangos'])\n    'Apples, Oranges and Mangos'\n    \"\"\"\n    result = ', '.join(list_of_strings)\n    comma_index = result.rfind(',')\n    if comma_index > -1: result = result[:comma_index] + ' and' + result[comma_index+1:]\n    return result", "entry_point": "andify", "input": "['a', 'b', 'c']", "output": "'a, b and c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xapple/plumbing/blob/4a7706c7722f5996d0ca366f191aff9ac145880a/plumbing/common.py#L183-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035439", "code": "def num_to_ith(num):\n    \"\"\"1 becomes 1st, 2 becomes 2nd, etc.\"\"\"\n    value             = str(num)\n    before_last_digit = value[-2]\n    last_digit        = value[-1]\n    if len(value) > 1 and before_last_digit == '1': return value +'th'\n    if last_digit == '1': return value + 'st'\n    if last_digit == '2': return value + 'nd'\n    if last_digit == '3': return value + 'rd'\n    return value + 'th'", "entry_point": "num_to_ith", "input": "10", "output": "'10th'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xapple/plumbing/blob/4a7706c7722f5996d0ca366f191aff9ac145880a/plumbing/common.py#L197-L206", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035440", "code": "def get_line_number(line_map, offset):\n    \"\"\"Find a line number, given a line map and a character offset.\"\"\"\n    for lineno, line_offset in enumerate(line_map, start=1):\n        if line_offset > offset:\n            return lineno\n    return -1", "entry_point": "get_line_number", "input": "{}, [-1, 0, 1, 2]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nedbat/django_coverage_plugin/blob/0072737c0ea5a1ca6b9f046af4947de191f13804/django_coverage_plugin/plugin.py#L389-L394", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035441", "code": "def _process_notes(record, new_record):\n        \"\"\"\n        Populate the notes property using the provided new_record.\n\n        If the new_record field was populated, assume that we want to replace\n        the notes. If there are valid changes to be made, they will be added to\n        the new_notes list. An empty list is counted as a request to delete all\n        notes.\n\n        Returns a boolean indicating whether changes were made.\n        \"\"\"\n        if \"notes\" not in new_record or not new_record[\"notes\"]:\n            return False\n\n        # This assumes any notes passed into the edit record are intended to\n        # replace the existing set.\n        new_notes = []\n        for note in new_record[\"notes\"]:\n            # Whitelist of supported types of notes to edit\n            # A note with an empty string as content is counted as a request to\n            # delete the note, and will not be added to the list.\n            if note[\"type\"] in (\"odd\", \"accessrestrict\") and note.get(\"content\"):\n                new_notes.append(\n                    {\n                        \"jsonmodel_type\": \"note_multipart\",\n                        \"publish\": True,\n                        \"subnotes\": [\n                            {\n                                \"content\": note[\"content\"],\n                                \"jsonmodel_type\": \"note_text\",\n                                \"publish\": True,\n                            }\n                        ],\n                        \"type\": note[\"type\"],\n                    }\n                )\n\n        record[\"notes\"] = new_notes\n\n        return True", "entry_point": "_process_notes", "input": "[], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/artefactual-labs/agentarchives/blob/af19ade56a90c64069cf46b50972fe72b6f10a45/agentarchives/archivesspace/client.py#L210-L249", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035442", "code": "def parse_doc(doc):\n    \"\"\"\n    Parse docstrings to dict, it should look like:\n      key: value\n    \"\"\"\n    if not doc:\n        return {}\n    out = {}\n    for s in doc.split('\\n'):\n        s = s.strip().split(':', maxsplit=1)\n        if len(s) == 2:\n            out[s[0]] = s[1]\n    return out", "entry_point": "parse_doc", "input": "False", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tipsi/tipsi_tools/blob/1aba960c9890ceef2fb5e215b98b1646056ee58e/tipsi_tools/doc_utils/tipsi_sphinx/dyn_serializer.py#L20-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035443", "code": "def tokenize(s):\n    \"\"\" Tokenize a string by splitting it by + and -\n\n    >>> tokenize('this + that')\n    ['this', 'PLUS', 'that']\n\n    >>> tokenize('this+that')\n    ['this', 'PLUS', 'that']\n\n    >>> tokenize('this+that-other')\n    ['this', 'PLUS', 'that', 'MINUS', 'other']\n    \"\"\"\n\n    # Crude tokenization\n    s = s.replace('+', ' PLUS ').replace('-', ' MINUS ') \\\n        .replace('/', ' DIVIDE ').replace('*', ' MULTIPLY ')\n    words = [w for w in s.split(' ') if w]\n    return words", "entry_point": "tokenize", "input": "'walnut thistle harbour'", "output": "['walnut', 'thistle', 'harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juiceinc/recipe/blob/2e60c2242aeaea3029a2274b31bc3a937761e568/recipe/shelf.py#L103-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035444", "code": "def format_size(size, threshold=1536):\n    \"\"\"Return file size as string from byte size.\n\n    >>> format_size(1234)\n    '1234 B'\n    >>> format_size(12345678901)\n    '11.50 GiB'\n\n    \"\"\"\n    if size < threshold:\n        return \"%i B\" % size\n    for unit in ('KiB', 'MiB', 'GiB', 'TiB', 'PiB'):\n        size /= 1024.0\n        if size < threshold:\n            return \"%.2f %s\" % (size, unit)\n    return 'ginormous'", "entry_point": "format_size", "input": "2, 3.25", "output": "'2 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nion-software/nionswift-io/blob/e9ae37f01faa9332c48b647f93afd5ef2166b155/nionswift_plugin/TIFF_IO/tifffile.py#L10175-L10190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035445", "code": "def clean_whitespace(string, compact=False):\n    \"\"\"Return string with compressed whitespace.\"\"\"\n    for a, b in (('\\r\\n', '\\n'), ('\\r', '\\n'), ('\\n\\n', '\\n'),\n                 ('\\t', ' '), ('  ', ' ')):\n        string = string.replace(a, b)\n    if compact:\n        for a, b in (('\\n', ' '), ('[ ', '['),\n                     ('  ', ' '), ('  ', ' '), ('  ', ' ')):\n            string = string.replace(a, b)\n    return string.strip()", "entry_point": "clean_whitespace", "input": "'abc', [-1, 0, 1, 2]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nion-software/nionswift-io/blob/e9ae37f01faa9332c48b647f93afd5ef2166b155/nionswift_plugin/TIFF_IO/tifffile.py#L10488-L10497", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035446", "code": "def r_sa_check(template, tag_type, is_standalone):\n    \"\"\"Do a final checkto see if a tag could be a standalone\"\"\"\n\n    # Check right side if we might be a standalone\n    if is_standalone and tag_type not in ['variable', 'no escape']:\n        on_newline = template.split('\\n', 1)\n\n        # If the stuff to the right of us are spaces we're a standalone\n        if on_newline[0].isspace() or not on_newline[0]:\n            return True\n        else:\n            return False\n\n    # If we're a tag can't be a standalone\n    else:\n        return False", "entry_point": "r_sa_check", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/noahmorrison/chevron/blob/78f1a384eddef16906732d8db66deea6d37049b7/chevron/tokenizer.py#L47-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035447", "code": "def _html_escape(string):\n    \"\"\"HTML escape all of these \" & < >\"\"\"\n\n    html_codes = {\n        '\"': '&quot;',\n        '<': '&lt;',\n        '>': '&gt;',\n    }\n\n    # & must be handled first\n    string = string.replace('&', '&amp;')\n    for char in html_codes:\n        string = string.replace(char, html_codes[char])\n    return string", "entry_point": "_html_escape", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/noahmorrison/chevron/blob/78f1a384eddef16906732d8db66deea6d37049b7/chevron/renderer.py#L34-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035448", "code": "def construct_url(ip_address: str) -> str:\r\n    \"\"\"Construct the URL with a given IP address.\"\"\"\r\n    if 'http://' not in ip_address and 'https://' not in ip_address:\r\n        ip_address = '{}{}'.format('http://', ip_address)\r\n    if ip_address[-1] == '/':\r\n        ip_address = ip_address[:-1]\r\n    return ip_address", "entry_point": "construct_url", "input": "[5, 3, 1, 4]", "output": "'http://[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nielstron/pysyncthru/blob/850a85ba0a74cbd5c408102bb02fd005d8b61ffb/pysyncthru/__init__.py#L12-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035449", "code": "def escape_newlines(s: str) -> str:\n    \"\"\"\n    Escapes CR, LF, and backslashes.\n\n    Its counterpart is :func:`unescape_newlines`.\n\n    ``s.encode(\"string_escape\")`` and ``s.encode(\"unicode_escape\")`` are\n    alternatives, but they mess around with quotes, too (specifically,\n    backslash-escaping single quotes).\n    \"\"\"\n    if not s:\n        return s\n    s = s.replace(\"\\\\\", r\"\\\\\")  # replace \\ with \\\\\n    s = s.replace(\"\\n\", r\"\\n\")  # escape \\n; note ord(\"\\n\") == 10\n    s = s.replace(\"\\r\", r\"\\r\")  # escape \\r; note ord(\"\\r\") == 13\n    return s", "entry_point": "escape_newlines", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/text.py#L40-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035450", "code": "def unescape_newlines(s: str) -> str:\n    \"\"\"\n    Reverses :func:`escape_newlines`.\n    \"\"\"\n    # See also http://stackoverflow.com/questions/4020539\n    if not s:\n        return s\n    d = \"\"  # the destination string\n    in_escape = False\n    for i in range(len(s)):\n        c = s[i]  # the character being processed\n        if in_escape:\n            if c == \"r\":\n                d += \"\\r\"\n            elif c == \"n\":\n                d += \"\\n\"\n            else:\n                d += c\n            in_escape = False\n        else:\n            if c == \"\\\\\":\n                in_escape = True\n            else:\n                d += c\n    return d", "entry_point": "unescape_newlines", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/text.py#L58-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035451", "code": "def escape_tabs_newlines(s: str) -> str:\n    \"\"\"\n    Escapes CR, LF, tab, and backslashes.\n\n    Its counterpart is :func:`unescape_tabs_newlines`.\n    \"\"\"\n    if not s:\n        return s\n    s = s.replace(\"\\\\\", r\"\\\\\")  # replace \\ with \\\\\n    s = s.replace(\"\\n\", r\"\\n\")  # escape \\n; note ord(\"\\n\") == 10\n    s = s.replace(\"\\r\", r\"\\r\")  # escape \\r; note ord(\"\\r\") == 13\n    s = s.replace(\"\\t\", r\"\\t\")  # escape \\t; note ord(\"\\t\") == 9\n    return s", "entry_point": "escape_tabs_newlines", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/text.py#L85-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035452", "code": "def sql_comment(comment: str) -> str:\n    \"\"\"\n    Transforms a single- or multi-line string into an ANSI SQL comment,\n    prefixed by ``--``.\n    \"\"\"\n    \"\"\"Using -- as a comment marker is ANSI SQL.\"\"\"\n    if not comment:\n        return \"\"\n    return \"\\n\".join(\"-- {}\".format(x) for x in comment.splitlines())", "entry_point": "sql_comment", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/sql/literals.py#L85-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035453", "code": "def strnum(prefix: str, num: int, suffix: str = \"\") -> str:\n    \"\"\"\n    Makes a string of the format ``<prefix><number><suffix>``.\n    \"\"\"\n    return \"{}{}{}\".format(prefix, num, suffix)", "entry_point": "strnum", "input": "'  padded  ', 7, ''", "output": "'  padded  7'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/stringfunc.py#L130-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035454", "code": "def partition(pred, iterable):\n    \"\"\"Partition an iterable.\n\n    Arguments\n    ---------\n    pred     : function\n               A function that takes an element of the iterable and returns\n               a boolen indicating to which partition it belongs\n    iterable : iterable\n\n    Returns\n    -------\n    A two-tuple of lists with the first list containing the elements on which\n    the predicate indicated False and the second list containing the elements\n    on which the predicate indicated True.\n\n    Note that, unlike the recipe which returns generators, this version\n    returns lists.\n    \"\"\"\n    pos, neg = [], []\n    pos_append, neg_append = pos.append, neg.append\n    for elem in iterable:\n        if pred(elem):\n            pos_append(elem)\n        else:\n            neg_append(elem)\n    return neg, pos", "entry_point": "partition", "input": "[1, 2, 3], []", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nxdevel/nx_itertools/blob/744da75c616a8a7991b963a549152fe9c434abd9/nx_itertools/extra.py#L40-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035455", "code": "def divide_sizes(count, n):             # pylint: disable=invalid-name\n    \"\"\"Evenly divide a count.\n\n    Arguments\n    ---------\n    count : integer\n            The number to be evenly divided\n    n     : integer\n            The number of buckets in which to divide the number\n\n    Returns\n    -------\n    A list of integers indicating what size each bucket should be for an even\n    distribution of *count*.\n\n    The number of integers returned is always *n* and, thus, may be 0.\n\n    Useful for calculating slices for generators that might be too large to\n    convert into a list as happens in divide().\n    \"\"\"\n    if n <= 0:\n        return []\n    if count < 0:\n        return [0] * n\n    base, rem = divmod(count, n)\n    return [base + 1 if i < rem else base for i in range(n)]", "entry_point": "divide_sizes", "input": "('a', 'b', 'c'), -1.5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nxdevel/nx_itertools/blob/744da75c616a8a7991b963a549152fe9c434abd9/nx_itertools/extra.py#L225-L250", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035456", "code": "def sizeof_fmt(num: float, suffix: str = 'B') -> str:\n    \"\"\"\n    Formats a number of bytes in a human-readable binary format (e.g. ``2048``\n    becomes ``'2 KiB'``); from http://stackoverflow.com/questions/1094841.\n    \"\"\"\n    for unit in ('', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi'):\n        if abs(num) < 1024.0:\n            return \"%3.1f%s%s\" % (num, unit, suffix)\n        num /= 1024.0\n    return \"%.1f%s%s\" % (num, 'Yi', suffix)", "entry_point": "sizeof_fmt", "input": "5, 'abc'", "output": "'5.0abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/sizeformatter.py#L29-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035457", "code": "def sql_dequote_string(s: str) -> str:\n    \"\"\"Reverses sql_quote_string.\"\"\"\n    if len(s) < 2:\n        # Something wrong.\n        return s\n    s = s[1:-1]  # strip off the surrounding quotes\n    return s.replace(\"''\", \"'\")", "entry_point": "sql_dequote_string", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/rnc_db.py#L985-L991", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035458", "code": "def contains_unquoted_target(x: str,\n                             quote: str = '\"', target: str = '&') -> bool:\n    \"\"\"\n    Checks if ``target`` exists in ``x`` outside quotes (as defined by\n    ``quote``). Principal use: from\n    :func:`contains_unquoted_ampersand_dangerous_to_windows`.\n    \"\"\"\n    in_quote = False\n    for c in x:\n        if c == quote:\n            in_quote = not in_quote\n        elif c == target:\n            if not in_quote:\n                return True\n    return False", "entry_point": "contains_unquoted_target", "input": "['a', 'b', 'c'], [-1, 0, 1, 2], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RudolfCardinal/pythonlib/blob/0b84cb35f38bd7d8723958dae51b480a829b7227/cardinal_pythonlib/platformfunc.py#L293-L307", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035459", "code": "def _embedded_frames(frame_list, frame_format):\n    \"\"\"frame_list should be a list of base64-encoded png files\"\"\"\n    template = '  frames[{0}] = \"data:image/{1};base64,{2}\"\\n'\n    embedded = \"\\n\"\n    for i, frame_data in enumerate(frame_list):\n        embedded += template.format(i, frame_format,\n                                    frame_data.replace('\\n', '\\\\\\n'))\n    return embedded", "entry_point": "_embedded_frames", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "'\\n  frames[0] = \"data:image/[\\'a\\', \\'b\\', \\'c\\'];base64,a\"\\n  frames[1] = \"data:image/[\\'a\\', \\'b\\', \\'c\\'];base64,b\"\\n  frames[2] = \"data:image/[\\'a\\', \\'b\\', \\'c\\'];base64,c\"\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/carpyncho/feets/blob/53bdfb73b53845561914fc1f756e0c2377b9b76b/doc/source/JSAnimation/html_writer.py#L229-L236", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035460", "code": "def snake_to_camel(s: str) -> str:\n    \"\"\"Convert string from snake case to camel case.\"\"\"\n\n    fragments = s.split('_')\n\n    return fragments[0] + ''.join(x.title() for x in fragments[1:])", "entry_point": "snake_to_camel", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portfoliome/foil/blob/b66d8cf4ab048a387d8c7a033b47e922ed6917d6/foil/strings.py#L13-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035461", "code": "def _set_log_format(color, include_caller):\n    \"\"\"\n    Set log format\n    :param color: Log message is colored\n    :param include_caller: At the end, put a [caller:line-of-code], e.g. [script:123]\n    :return: string of log format\n    \"\"\"\n    level_name = '* %(levelname)1s'\n    time = '%(asctime)s,%(msecs)03d'\n    message = '%(message)s'\n    color_start = '%(color)s'\n    color_end = '%(end_color)s'\n    caller = '[%(module)s:%(lineno)d]'\n\n    if color:\n        if include_caller:\n            return '{}{}{}  {}  {} {}'.format(color_start, level_name, color_end, time, message, caller)\n        else:\n            return '{}{}{}  {}  {}'.format(color_start, level_name, color_end, time, message)\n    else:\n        if include_caller:\n            return '{}  {}  {} {}'.format(level_name, time, message, caller)\n        else:\n            return '{}  {}  {}'.format(level_name, time, message)", "entry_point": "_set_log_format", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "'%(color)s* %(levelname)1s%(end_color)s  %(asctime)s,%(msecs)03d  %(message)s [%(module)s:%(lineno)d]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/davidhuser/dhis2.py/blob/78cbf1985506db21acdfa0f2e624bc397e455c82/dhis2/logger.py#L14-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035462", "code": "def euclid(a, b):\n    \"\"\"returns the Greatest Common Divisor of a and b\"\"\"\n    a = abs(a)\n    b = abs(b)\n    if a < b:\n        a, b = b, a\n    while b != 0:\n        a, b = b, a % b\n    return a", "entry_point": "euclid", "input": "True, 2.0", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lazygunner/xunleipy/blob/cded7598a7bf04495156bae2d747883d1eacb3f4/xunleipy/rsa_lib.py#L13-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035463", "code": "def extractTwos(m):\n    \"\"\"m is a positive integer. A tuple (s, d) of integers is returned\n    such that m = (2 ** s) * d.\"\"\"\n    # the problem can be break down to count how many '0's are there in\n    # the end of bin(m). This can be done this way: m & a stretch of '1's\n    # which can be represent as (2 ** n) - 1.\n    assert m >= 0\n    i = 0\n    while m & (2 ** i) == 0:\n        i += 1\n    return i, m >> i", "entry_point": "extractTwos", "input": "True", "output": "(0, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lazygunner/xunleipy/blob/cded7598a7bf04495156bae2d747883d1eacb3f4/xunleipy/rsa_lib.py#L54-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035464", "code": "def int2baseTwo(x):\n    \"\"\"x is a positive integer. Convert it to base two as a list of integers\n    in reverse order as a list.\"\"\"\n    # repeating x >>= 1 and x & 1 will do the trick\n    assert x >= 0\n    bitInverse = []\n    while x != 0:\n        bitInverse.append(x & 1)\n        x >>= 1\n    return bitInverse", "entry_point": "int2baseTwo", "input": "10", "output": "[0, 1, 0, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lazygunner/xunleipy/blob/cded7598a7bf04495156bae2d747883d1eacb3f4/xunleipy/rsa_lib.py#L67-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035465", "code": "def strip_path_prefix(ipath, prefix):\n    \"\"\"\n    Strip prefix from path.\n\n    Args:\n        ipath: input path\n        prefix: the prefix to remove, if it is found in :ipath:\n\n    Examples:\n        >>> strip_path_prefix(\"/foo/bar\", \"/bar\")\n        '/foo/bar'\n        >>> strip_path_prefix(\"/foo/bar\", \"/\")\n        'foo/bar'\n        >>> strip_path_prefix(\"/foo/bar\", \"/foo\")\n        '/bar'\n        >>> strip_path_prefix(\"/foo/bar\", \"None\")\n        '/foo/bar'\n\n    \"\"\"\n    if prefix is None:\n        return ipath\n\n    return ipath[len(prefix):] if ipath.startswith(prefix) else ipath", "entry_point": "strip_path_prefix", "input": "'  padded  ', 'AbC dEf'", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/wrapping.py#L43-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035466", "code": "def mounts(prefix, __mounts):\n    \"\"\"\n    Compute the mountpoints of the current user.\n\n    Args:\n        prefix: Define where the job was running if it ran on a cluster.\n        mounts: All mounts the user currently uses in his file system.\n    Return:\n        mntpoints\n    \"\"\"\n    i = 0\n    mntpoints = []\n    for mount in __mounts:\n        if not isinstance(mount, dict):\n            mntpoint = \"{0}/{1}\".format(prefix, str(i))\n            mntpoints.append(mntpoint)\n            i = i + 1\n    return mntpoints", "entry_point": "mounts", "input": "'AbC dEf', [1, 2, 3]", "output": "['AbC dEf/0', 'AbC dEf/1', 'AbC dEf/2']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/uchroot.py#L128-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035467", "code": "def escape_yaml(raw_str: str) -> str:\n    \"\"\"\n    Shell-Escape a yaml input string.\n\n    Args:\n        raw_str: The unescaped string.\n    \"\"\"\n    escape_list = [char for char in raw_str if char in ['!', '{', '[']]\n    if len(escape_list) == 0:\n        return raw_str\n\n    str_quotes = '\"'\n    i_str_quotes = \"'\"\n    if str_quotes in raw_str and str_quotes not in raw_str[1:-1]:\n        return raw_str\n\n    if str_quotes in raw_str[1:-1]:\n        raw_str = i_str_quotes + raw_str + i_str_quotes\n    else:\n        raw_str = str_quotes + raw_str + str_quotes\n    return raw_str", "entry_point": "escape_yaml", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/settings.py#L92-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035468", "code": "def is_iter_non_string(obj):\n    \"\"\"test if object is a list or tuple\"\"\"\n    if isinstance(obj, list) or isinstance(obj, tuple):\n        return True\n    return False", "entry_point": "is_iter_non_string", "input": "[5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chrisjsewell/jsonextended/blob/c3a7a880cc09789b3c61204265dcbb127be76c8a/jsonextended/edict.py#L45-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035469", "code": "def uniquify(l):\n    \"\"\"\n    Uniquify a list (skip duplicate items).\n    \"\"\"\n    result = []\n    for x in l:\n        if x not in result:\n            result.append(x)\n    return result", "entry_point": "uniquify", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bjodah/pycompilation/blob/43eac8d82f8258d30d4df77fd2ad3f3e4f4dca18/pycompilation/util.py#L356-L364", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035470", "code": "def set_input_container(_container, cfg):\n    \"\"\"Save the input for the container in the configurations.\"\"\"\n    if not _container:\n        return False\n    if _container.exists():\n        cfg[\"container\"][\"input\"] = str(_container)\n        return True\n    return False", "entry_point": "set_input_container", "input": "[], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/container.py#L167-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035471", "code": "def wrap_queries_in_bool_clauses_if_more_than_one(queries,\n                                                  use_must_clause,\n                                                  preserve_bool_semantics_if_one_clause=False):\n    \"\"\"Helper for wrapping a list of queries into a bool.{must, should} clause.\n\n    Args:\n        queries (list): List of queries to be wrapped in a bool.{must, should} clause.\n        use_must_clause (bool): Flag that signifies whether to use 'must' or 'should' clause.\n        preserve_bool_semantics_if_one_clause (bool): Flag that signifies whether to generate a bool query even if\n            there's only one clause. This happens to generate boolean query semantics. Usually not the case, but\n            useful for boolean queries support.\n\n    Returns:\n        (dict): If len(queries) > 1, the bool clause, otherwise if len(queries) == 1, will return the query itself,\n                while finally, if len(queries) == 0, then an empty dictionary is returned.\n    \"\"\"\n    if not queries:\n        return {}\n\n    if len(queries) == 1 and not preserve_bool_semantics_if_one_clause:\n        return queries[0]\n\n    return {\n        'bool': {\n            ('must' if use_must_clause else 'should'): queries\n        }\n    }", "entry_point": "wrap_queries_in_bool_clauses_if_more_than_one", "input": "[-1, 0, 1, 2], [], [5, 3, 1, 4]", "output": "{'bool': {'should': [-1, 0, 1, 2]}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/inspire-query-parser/blob/9dde20d7caef89a48bb419b866f4535c88cfc00d/inspire_query_parser/utils/visitor_utils.py#L422-L448", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035472", "code": "def showDifferences(seq1, seq2) :\n\t\"\"\"Returns a string highligthing differences between seq1 and seq2:\n\t\n\t* Matches by '-'\n\t\n\t* Differences : 'A|T'\n\t\n\t* Exceeded length : '#'\n\t\n\t\"\"\"\n\tret = []\n\tfor i in range(max(len(seq1), len(seq2))) :\n\n\t\tif i >= len(seq1) :\n\t\t\tc1 = '#'\n\t\telse :\n\t\t\tc1 = seq1[i]\n\t\tif i >= len(seq2) :\n\t\t\tc2 = '#'\n\t\telse :\n\t\t\tc2 = seq2[i]\n\n\t\tif c1 != c2 :\n\t\t\tret.append('%s|%s' % (c1, c2))\n\t\telse :\n\t\t\tret.append('-')\n\n\treturn ''.join(ret)", "entry_point": "showDifferences", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "'apple|-1banana|0cherry|1#|2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tariqdaouda/pyGeno/blob/474b1250bf78ce5c7e7c3bbbfdbad9635d5a7d14/pyGeno/tools/UsefulFunctions.py#L363-L390", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035473", "code": "def columnclean(column):\n        \"\"\"\n        Modifies column header format to be importable into a database\n        :param column: raw column header\n        :return: cleanedcolumn: reformatted column header\n        \"\"\"\n        cleanedcolumn = str(column) \\\n            .replace('%', 'percent') \\\n            .replace('(', '_') \\\n            .replace(')', '') \\\n            .replace('As', 'Adenosines') \\\n            .replace('Cs', 'Cytosines') \\\n            .replace('Gs', 'Guanines') \\\n            .replace('Ts', 'Thymines') \\\n            .replace('Ns', 'Unknowns') \\\n            .replace('index', 'adapterIndex')\n        return cleanedcolumn", "entry_point": "columnclean", "input": "['apple', 'banana', 'cherry']", "output": "\"['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lowandrew/OLCTools/blob/88aa90ac85f84d0bbeb03e43c29b0a9d36e4ce2a/sipprCommon/database.py#L115-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035474", "code": "def whitespace_smart_split(command):\n    \"\"\"\n    Split a command by whitespace, taking care to not split on\n    whitespace within quotes.\n\n    >>> whitespace_smart_split(\"test this \\\\\\\"in here\\\\\\\" again\")\n    ['test', 'this', '\"in here\"', 'again']\n\n    \"\"\"\n    return_array = []\n    s = \"\"\n    in_double_quotes = False\n    escape = False\n    for c in command:\n        if c == '\"':\n            if in_double_quotes:\n                if escape:\n                    s += c\n                    escape = False\n                else:\n                    s += c\n                    in_double_quotes = False\n            else:\n                in_double_quotes = True\n                s += c\n        else:\n            if in_double_quotes:\n                if c == '\\\\':\n                    escape = True\n                    s += c\n                else:\n                    escape = False\n                    s += c\n            else:\n                if c == ' ':\n                    return_array.append(s)\n                    s = \"\"\n                else:\n                    s += c\n    if s != \"\":\n        return_array.append(s)\n    return return_array", "entry_point": "whitespace_smart_split", "input": "['apple', 'banana', 'cherry']", "output": "['applebananacherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toumorokoshi/sprinter/blob/846697a7a087e69c61d075232e754d6975a64152/sprinter/lib/command.py#L56-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035475", "code": "def split_list_by(lst, key):\n  \"\"\"\n  Splits a list by the callable *key* where a negative result will cause the\n  item to be put in the first list and a positive into the second list.\n  \"\"\"\n\n  first, second = [], []\n  for item in lst:\n    if key(item):\n      second.append(item)\n    else:\n      first.append(item)\n  return (first, second)", "entry_point": "split_list_by", "input": "{}, [[1, 2], [3], []]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NiklasRosenstein-Python/nr-deprecated/blob/f9f8b89ea1b084841a8ab65784eaf68852686b2a/nr/concurrency.py#L1265-L1277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035476", "code": "def remove_yaml_frontmatter(source, return_frontmatter=False):\n    \"\"\"If there's one, remove the YAML front-matter from the source\n    \"\"\"\n    if source.startswith(\"---\\n\"):\n        frontmatter_end = source.find(\"\\n---\\n\", 4)\n        if frontmatter_end == -1:\n            frontmatter = source\n            source = \"\"\n        else:\n            frontmatter = source[0:frontmatter_end]\n            source = source[frontmatter_end + 5:]\n        if return_frontmatter:\n            return (source, frontmatter)\n        return source\n    if return_frontmatter:\n        return (source, None)\n    return source", "entry_point": "remove_yaml_frontmatter", "input": "'AbC dEf', 10", "output": "('AbC dEf', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/frascoweb/frasco/blob/ea519d69dd5ca6deaf3650175692ee4a1a02518f/frasco/utils.py#L97-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035477", "code": "def priority(var):\n    \"\"\"Prioritizes resource position in the final HTML. To be fed into sorted(key=).\n\n    Javascript consoles throw errors if Bootstrap's js file is mentioned before jQuery. Using this function such errors\n    can be avoided. Used internally.\n\n    Positional arguments:\n    var -- value sent by list.sorted(), which is a value in Statics().all_variables.\n\n    Returns:\n    Either a number if sorting is enforced for the value in `var`, or returns `var` itself.\n    \"\"\"\n    order = dict(JQUERY='0', BOOTSTRAP='1')\n    return order.get(var, var)", "entry_point": "priority", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Robpol86/Flask-Statics-Helper/blob/b1771e65225f62b760b3ef841b710ff23ef6f83c/flask_statics/helpers.py#L7-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035478", "code": "def re_tab(s):\n    \"\"\"Return a tabbed string from an expanded one.\"\"\"\n    l = []\n    p = 0\n    for i in range(8, len(s), 8):\n        if s[i - 2:i] == \"  \":\n            # collapse two or more spaces into a tab\n            l.append(s[p:i].rstrip() + \"\\t\")\n            p = i\n\n    if p == 0:\n        return s\n    else:\n        l.append(s[p:])\n        return \"\".join(l)", "entry_point": "re_tab", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cwoebker/pen/blob/996dfcdc018f2fc14a376835a2622fb4a7230a2f/pen/edit.py#L187-L201", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035479", "code": "def rmvsuffix(subject):\n  \"\"\"\n  Remove the suffix from *subject*.\n  \"\"\"\n\n  index = subject.rfind('.')\n  if index > subject.replace('\\\\', '/').rfind('/'):\n    subject = subject[:index]\n  return subject", "entry_point": "rmvsuffix", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NiklasRosenstein-Python/nr-deprecated/blob/f9f8b89ea1b084841a8ab65784eaf68852686b2a/nr/path.py#L246-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035480", "code": "def try_parse_num_and_booleans(num_str):\n    \"\"\"\n    Tries to parse the provided string as a number or boolean\n    :param num_str:\n    :return:\n    \"\"\"\n    if isinstance(num_str, str):\n        # bool\n        if num_str.lower() == 'true':\n            return True\n        elif num_str.lower() == 'false':\n            return False\n        # int\n        if num_str.isdigit():\n            return int(num_str)\n        # float\n        try:\n            return float(num_str)\n        except ValueError:\n            # give up\n            return num_str\n    else:\n        # dont try\n        return num_str", "entry_point": "try_parse_num_and_booleans", "input": "7", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/smarie/python-parsyfiles/blob/344b37e1151e8d4e7c2ee49ae09d6568715ae64e/parsyfiles/plugins_optional/support_for_jprops.py#L11-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035481", "code": "def _is_orphan(scc, graph):\n    \"\"\"\n    Return False iff the given scc is reachable from elsewhere.\n\n    \"\"\"\n    return all(p in scc for v in scc for p in graph.parents(v))", "entry_point": "_is_orphan", "input": "[], [[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mdickinson/refcycle/blob/627fad74c74efc601209c96405f8118cd99b2241/refcycle/__init__.py#L34-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035482", "code": "def _polevl(x, coefs, N):\n    \"\"\"\n    Port of cephes ``polevl.c``: evaluate polynomial\n\n    See https://github.com/jeremybarnes/cephes/blob/master/cprob/polevl.c\n    \"\"\"\n    ans = 0\n    power = len(coefs) - 1\n    for coef in coefs:\n        try:\n            ans += coef * x**power\n        except OverflowError:\n            pass\n        power -= 1\n    return ans", "entry_point": "_polevl", "input": "3, set(), 'a,b,c'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dougthor42/PyErf/blob/cf38a2c62556cbd4927c9b3f5523f39b6a492472/pyerf/pyerf.py#L157-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035483", "code": "def add_items_to_message(msg, log_dict):\n    \"\"\"Utility function to add dictionary items to a log message.\"\"\"\n    out = msg\n    for key, value in log_dict.items():\n        out += \" {}={}\".format(key, value)\n    return out", "entry_point": "add_items_to_message", "input": "'a,b,c', {}", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsmits/django-logutils/blob/e88f6e0a08c6f3df9e61f96cfb6cd79bc5ea8a88/django_logutils/utils.py#L8-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035484", "code": "def assure_obj_child_dict(obj, var):\n  \"\"\"Assure the object has the specified child dict\n  \"\"\"\n  if not var in obj or type(obj[var]) != type({}):\n    obj[var] = {}\n  return obj", "entry_point": "assure_obj_child_dict", "input": "{}, ''", "output": "{'': {}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nikcub/floyd/blob/5772d0047efb11c9ce5f7d234a9da4576ce24edc/floyd/util/object.py#L50-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035485", "code": "def get_readable_filesize(size):\n\t\"\"\"get_readable_filesize(size) -> filesize -- return human readable \n\tfilesize from given size in bytes.\n\t\"\"\"\n\tif(size < 1024):\n\t\treturn str(size)+' bytes'\n\ttemp = size/1024.0\n\tlevel = 1\n\twhile(temp >= 1024 and level< 3):\n\t\ttemp = temp/1024\n\t\tlevel += 1\n\tif(level == 1):\n\t\treturn str(round(temp,2))+' KB'\n\telif(level == 2):\n\t\treturn str(round(temp,2))+' MB'\n\telse:\n\t\treturn str(round(temp,2))+' GB'", "entry_point": "get_readable_filesize", "input": "1", "output": "'1 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/prthkms/alex/blob/79d3167c877e94cc07db0aab55a35857fac67ef7/alex/support.py#L63-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035486", "code": "def _columns_to_kwargs(conversion_table, columns, row):\n    \"\"\"\n    Given a list of column names, and a list of values (a row), return a dict\n    of kwargs that may be used to instantiate a MarketHistoryEntry\n    or MarketOrder object.\n\n    :param dict conversion_table: The conversion table to use for mapping\n        spec names to kwargs.\n    :param list columns: A list of column names.\n    :param list row: A list of values.\n    \"\"\"\n    kwdict = {}\n\n    counter = 0\n    for column in columns:\n        # Map the column name to the correct MarketHistoryEntry kwarg.\n        kwarg_name = conversion_table[column]\n        # Set the kwarg to the correct value from the row.\n        kwdict[kwarg_name] = row[counter]\n        counter += 1\n\n    return kwdict", "entry_point": "_columns_to_kwargs", "input": "{}, [], ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gtaylor/EVE-Market-Data-Structures/blob/77d69b24f2aada3aeff8fba3d75891bfba8fdcf3/emds/formats/unified/unified_utils.py#L10-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035487", "code": "def add_suffix(filename, suffix):\n        \"\"\"\n        ADD suffix TO THE filename (NOT INCLUDING THE FILE EXTENSION)\n        \"\"\"\n        path = filename.split(\"/\")\n        parts = path[-1].split(\".\")\n        i = max(len(parts) - 2, 0)\n        parts[i] = parts[i] + suffix\n        path[-1] = \".\".join(parts)\n        return \"/\".join(path)", "entry_point": "add_suffix", "input": "'a,b,c', 'AbC dEf'", "output": "'a,b,cAbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klahnakoski/mo-files/blob/f6974a997cdc9fdabccb60c19edee13356a5787a/mo_files/__init__.py#L120-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035488", "code": "def parse_addr(text):\n    \"Parse a 1- to 3-part address spec.\"\n    if text:\n        parts = text.split(':')\n        length = len(parts)\n        if length== 3:\n            return parts[0], parts[1], int(parts[2])\n        elif length == 2:\n            return None, parts[0], int(parts[1])\n        elif length == 1:\n            return None, '', int(parts[0])\n    return None, None, None", "entry_point": "parse_addr", "input": "''", "output": "(None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/phensley/gstatsd/blob/c6d3d22f162d236c1ef916064670c6dc5bce6142/gstatsd/service.py#L79-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035489", "code": "def _mzmlListAttribToTuple(oldList):\n    \"\"\"Turns the param entries of elements in a list elements into tuples, used\n    in :func:`MzmlScan._fromJSON()` and :func:`MzmlPrecursor._fromJSON()`.\n\n    .. note:: only intended for a list of elements that contain params. For\n        example the mzML element ``selectedIonList`` or ``scanWindowList``.\n\n    :param oldList: [[paramList, paramList, ...], ...]\n\n    :returns: [[paramTuple, paramTuple, ...], ...]\n    \"\"\"\n    newList = list()\n    for oldParamList in oldList:\n        newParamLIst = [tuple(param) for param in oldParamList]\n        newList.append(newParamLIst)\n    return newList", "entry_point": "_mzmlListAttribToTuple", "input": "['a', 'b', 'c']", "output": "[[('a',)], [('b',)], [('c',)]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/core.py#L1207-L1222", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035490", "code": "def continuityGrouping(values, limit):\n    \"\"\" #TODO docstring\n\n    :param values: ``numpy.array`` containg ``int`` or ``float``, must be sorted\n    :param limit: the maximal difference between two values, if this number is\n        exceeded a new group is generated\n\n    :returns: a list containing array start and end positions of continuous\n        groups\n    \"\"\"\n    lastValue = values[0]\n    lastPos = 0\n    groupStartPos = 0\n\n    groupPos = list()\n    for currPos, currValue in enumerate(values):\n        if currValue - lastValue > limit:\n            groupPos.append((groupStartPos, lastPos))\n            groupStartPos = currPos\n        lastPos = currPos\n        lastValue = currValue\n    groupPos.append((groupStartPos, lastPos))\n    return groupPos", "entry_point": "continuityGrouping", "input": "[5, 3, 1, 4], 1", "output": "[(0, 2), (3, 3)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/featuregrouping.py#L257-L279", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035491", "code": "def _findProteinClusters(protToPeps, pepToProts):\n    \"\"\"Find protein clusters in the specified protein to peptide mappings.\n\n    A protein cluster is a group of proteins that are somehow directly or\n    indirectly connected by shared peptides.\n\n    :param protToPeps: dict, for each protein (=key) contains a set of\n        associated peptides (=value). For Example {protein: {peptide, ...}, ...}\n    :param pepToProts: dict, for each peptide (=key) contains a set of parent\n        proteins (=value). For Example {peptide: {protein, ...}, ...}\n    :returns: a list of protein clusters, each cluster is a set of proteins\n    \"\"\"\n    clusters = list()\n    resolvingProteins = set(protToPeps)\n    while resolvingProteins:\n        protein = resolvingProteins.pop()\n        proteinCluster = set([protein])\n\n        peptides = set(protToPeps[protein])\n        parsedPeptides = set()\n\n        while len(peptides) != len(parsedPeptides):\n            for peptide in peptides:\n                proteinCluster.update(pepToProts[peptide])\n            parsedPeptides.update(peptides)\n\n            for protein in proteinCluster:\n                peptides.update(protToPeps[protein])\n        clusters.append(proteinCluster)\n        resolvingProteins = resolvingProteins.difference(proteinCluster)\n    return clusters", "entry_point": "_findProteinClusters", "input": "(), -1.5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/inference.py#L649-L679", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035492", "code": "def _mappingGetValueSet(mapping, keys):\n    \"\"\"Return a combined set of values from the mapping.\n\n    :param mapping: dict, for each key contains a set of entries\n\n    returns a set of combined entries\n    \"\"\"\n    setUnion = set()\n    for k in keys:\n        setUnion = setUnion.union(mapping[k])\n    return setUnion", "entry_point": "_mappingGetValueSet", "input": "{1, 2, 3}, set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/inference.py#L906-L916", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035493", "code": "def _flattenMergedProteins(proteins):\n    \"\"\"Return a set where merged protein entries in proteins are flattened.\n\n    :param proteins: an iterable of proteins, can contain merged protein entries\n        in the form of tuple([protein1, protein2]).\n    returns a set of protein entries, where all entries are strings\n    \"\"\"\n    proteinSet = set()\n    for protein in proteins:\n        if isinstance(protein, tuple):\n            proteinSet.update(protein)\n        else:\n            proteinSet.add(protein)\n    return proteinSet", "entry_point": "_flattenMergedProteins", "input": "[1, 2, 3]", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/inference.py#L919-L932", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035494", "code": "def cvParamFromDict(attributes):\n    \"\"\"Python representation of a mzML cvParam = tuple(accession, value,\n    unitAccession).\n\n    :param attributes: #TODO: docstring\n\n    :returns: #TODO: docstring\n    \"\"\"\n    keys = ['accession', 'value', 'unitAccession']\n    return tuple(attributes[key] if key in attributes else None for key in keys)", "entry_point": "cvParamFromDict", "input": "[]", "output": "(None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/xml.py#L150-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035495", "code": "def userParamFromDict(attributes):\n    \"\"\"Python representation of a mzML userParam = tuple(name, value,\n    unitAccession, type)\n\n    :param attributes: #TODO: docstring\n\n    :returns: #TODO: docstring\n    \"\"\"\n    keys = ['name', 'value', 'unitAccession', 'type']\n    return tuple(attributes[key] if key in attributes else None for key in keys)", "entry_point": "userParamFromDict", "input": "[5, 3, 1, 4]", "output": "(None, None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/xml.py#L162-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035496", "code": "def positive_int(val):\n    \"\"\"Parse `val` into a positive integer.\"\"\"\n    if isinstance(val, float):\n        raise ValueError('\"{}\" must not be a float'.format(val))\n    val = int(val)\n    if val >= 0:\n        return val\n    raise ValueError('\"{}\" must be positive'.format(val))", "entry_point": "positive_int", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mozilla-releng/mozilla-version/blob/e5400f31f7001bd48fb6e17626905147dd4c17d7/mozilla_version/parser.py#L26-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035497", "code": "def _attributeLinesToDict(attributeLines):\n    \"\"\"Converts a list of obo 'Term' lines to a dictionary.\n\n    :param attributeLines: a list of obo 'Term' lines. Each line contains a key\n        and a value part which are separated by a ':'.\n\n    :return: a dictionary containing the attributes of an obo 'Term' entry.\n\n    NOTE: Some attributes can occur multiple times in one single term, for \n          example 'is_a' or 'relationship'. However, currently only the last\n          occurence is stored.\n    \"\"\"\n    attributes = dict()\n    for line in attributeLines:\n        attributeId, attributeValue = line.split(':', 1)\n        attributes[attributeId.strip()] = attributeValue.strip()\n    return attributes", "entry_point": "_attributeLinesToDict", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/ontology.py#L82-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035498", "code": "def _termIsObsolete(oboTerm):\n    \"\"\"Determine wheter an obo 'Term' entry is marked as obsolete.\n\n    :param oboTerm: a dictionary as return by\n        :func:`maspy.ontology._attributeLinesToDict()`\n\n    :return: bool\n    \"\"\"\n    isObsolete = False\n    if u'is_obsolete' in oboTerm:\n        if oboTerm[u'is_obsolete'].lower() == u'true':\n            isObsolete = True\n    return isObsolete", "entry_point": "_termIsObsolete", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/ontology.py#L101-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035499", "code": "def get_coord_box(centre_x, centre_y, distance):\n    \"\"\"Get the square boundary coordinates for a given centre and distance\"\"\"\n    \"\"\"Todo: return coordinates inside a circle, rather than a square\"\"\"\n    return {\n        'top_left': (centre_x - distance, centre_y + distance),\n        'top_right': (centre_x + distance, centre_y + distance),\n        'bottom_left': (centre_x - distance, centre_y - distance),\n        'bottom_right': (centre_x + distance, centre_y - distance),\n    }", "entry_point": "get_coord_box", "input": "True, True, False", "output": "{'top_left': (1, 1), 'top_right': (1, 1), 'bottom_left': (1, 1), 'bottom_right': (1, 1)}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Hypex/hyppy/blob/a425619c2a102b0e598fd6cac8aa0f6b766f542d/hyppy/func.py#L1-L9", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035500", "code": "def repr_data_size(size_in_bytes, precision=2):  # pragma: no cover\n    \"\"\"Return human readable string represent of a file size. Doesn\"t support\n    size greater than 1EB.\n\n    For example:\n\n    - 100 bytes => 100 B\n    - 100,000 bytes => 97.66 KB\n    - 100,000,000 bytes => 95.37 MB\n    - 100,000,000,000 bytes => 93.13 GB\n    - 100,000,000,000,000 bytes => 90.95 TB\n    - 100,000,000,000,000,000 bytes => 88.82 PB\n    ...\n\n    Magnitude of data::\n\n        1000         kB    kilobyte\n        1000 ** 2    MB    megabyte\n        1000 ** 3    GB    gigabyte\n        1000 ** 4    TB    terabyte\n        1000 ** 5    PB    petabyte\n        1000 ** 6    EB    exabyte\n        1000 ** 7    ZB    zettabyte\n        1000 ** 8    YB    yottabyte\n    \"\"\"\n    if size_in_bytes < 1024:\n        return \"%s B\" % size_in_bytes\n\n    magnitude_of_data = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"]\n    index = 0\n    while 1:\n        index += 1\n        size_in_bytes, mod = divmod(size_in_bytes, 1024)\n        if size_in_bytes < 1024:\n            break\n    template = \"{0:.%sf} {1}\" % precision\n    s = template.format(size_in_bytes + mod / 1024.0, magnitude_of_data[index])\n    return s", "entry_point": "repr_data_size", "input": "5, []", "output": "'5 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/crawlib-project/blob/241516f2a7a0a32c692f7af35a1f44064e8ce1ab/crawlib/helper.py#L5-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035501", "code": "def required_unique(objects, key):\n    \"\"\"\n    A pyrsistent invariant which requires all objects in the given iterable to\n    have a unique key.\n\n    :param objects: The objects to check.\n    :param key: A one-argument callable to compute the key of an object.\n\n    :return: An invariant failure if any two or more objects have the same key\n        computed.  An invariant success otherwise.\n    \"\"\"\n    keys = {}\n    duplicate = set()\n    for k in map(key, objects):\n        keys[k] = keys.get(k, 0) + 1\n        if keys[k] > 1:\n            duplicate.add(k)\n    if duplicate:\n        return (False, u\"Duplicate object keys: {}\".format(duplicate))\n    return (True, u\"\")", "entry_point": "required_unique", "input": "[], []", "output": "(True, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LeastAuthority/txkube/blob/a7e555d00535ff787d4b1204c264780da40cf736/src/txkube/_model.py#L236-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035502", "code": "def _normalizeImpurityMatrix(matrix):\n    \"\"\"Normalize each row of the matrix that the sum of the row equals 1.\n\n    :params matrix: a matrix (2d nested list) containing numbers, each isobaric\n        channel must be present as a row.\n    :returns: a matrix containing normalized values\n    \"\"\"\n    newMatrix = list()\n    for line in matrix:\n        total = sum(line)\n        if total != 0:\n            newMatrix.append([i / total for i in line])\n        else:\n            newMatrix.append(line)\n    return newMatrix", "entry_point": "_normalizeImpurityMatrix", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/isobar.py#L464-L478", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035503", "code": "def _check_values(in_values):\n        \"\"\" Check if values need to be converted before they get mogrify'd\n        \"\"\"\n        out_values = []\n        for value in in_values:\n            # if isinstance(value, (dict, list)):\n            #     out_values.append(json.dumps(value))\n            # else:\n            out_values.append(value)\n\n        return tuple(out_values)", "entry_point": "_check_values", "input": "[1, 2, 3]", "output": "(1, 2, 3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xtream1101/cutil/blob/2e4d1f00e66154b44d4ccffb9b1db3f37e87f2e8/cutil/database.py#L10-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035504", "code": "def count_collisions(Collisions):\n    \"\"\"\n    Counts the number of unique collisions and gets the collision index.\n\n    Parameters\n    ----------\n    Collisions : array_like\n        Array of booleans, containing true if during a collision event, false otherwise.\n\n    Returns\n    -------\n    CollisionCount : int\n        Number of unique collisions\n    CollisionIndicies : list\n        Indicies of collision occurance\n    \"\"\"\n    CollisionCount = 0\n    CollisionIndicies = []\n    lastval = True\n    for i, val in enumerate(Collisions):\n        if val == True and lastval == False:\n            CollisionIndicies.append(i)\n            CollisionCount += 1\n        lastval = val\n    return CollisionCount, CollisionIndicies", "entry_point": "count_collisions", "input": "[5, 3, 1, 4]", "output": "(0, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AshleySetter/optoanalysis/blob/9d390acc834d70024d47b574aea14189a5a5714e/optoanalysis/optoanalysis/optoanalysis.py#L3442-L3466", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035505", "code": "def findAllSubstrings(string, substring):\n    \"\"\" Returns a list of all substring starting positions in string or an empty\n    list if substring is not present in string.\n\n    :param string: a template string\n    :param substring: a string, which is looked for in the ``string`` parameter.\n\n    :returns: a list of substring starting positions in the template string\n    \"\"\"\n    #TODO: solve with regex? what about '.':\n    #return [m.start() for m in re.finditer('(?='+substring+')', string)]\n    start = 0\n    positions = []\n    while True:\n        start = string.find(substring, start)\n        if start == -1:\n            break\n        positions.append(start)\n        #+1 instead of +len(substring) to also find overlapping matches\n        start += 1\n    return positions", "entry_point": "findAllSubstrings", "input": "'abc', 'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/auxiliary.py#L471-L491", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035506", "code": "def returnModPositions(peptide, indexStart=1, removeModString='UNIMOD:'):\n    \"\"\"Determines the amino acid positions of all present modifications.\n\n    :param peptide: peptide sequence, modifications have to be written in the\n        format \"[modificationName]\"\n    :param indexStart: returned amino acids positions of the peptide start with\n        this number (first amino acid position = indexStart)\n    :param removeModString: string to remove from the returned modification name\n\n    :return: {modificationName:[position1, position2, ...], ...}\n\n    #TODO: adapt removeModString to the new unimod ids in\n    #maspy.constants.aaModComp (\"UNIMOD:X\" -> \"u:X\") -> also change unit tests.\n    \"\"\"\n    unidmodPositionDict = dict()\n    while peptide.find('[') != -1:\n        currModification = peptide.split('[')[1].split(']')[0]\n        currPosition = peptide.find('[') - 1\n        if currPosition == -1: # move n-terminal modifications to first position\n            currPosition = 0\n        currPosition += indexStart\n\n        peptide = peptide.replace('['+currModification+']', '', 1)\n\n        if removeModString:\n            currModification = currModification.replace(removeModString, '')\n        unidmodPositionDict.setdefault(currModification,list())\n        unidmodPositionDict[currModification].append(currPosition)\n    return unidmodPositionDict", "entry_point": "returnModPositions", "input": "'Hello World', {'x': [1, 2], 'y': []}, 3.25", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hollenstein/maspy/blob/f15fcfd24df306d8420540460d902aa3073ec133/maspy/peptidemethods.py#L188-L216", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035507", "code": "def _to_list(var):\n    \"\"\"\n    Make variable to list.\n\n    >>> _to_list(None)\n    []\n    >>> _to_list('whee')\n    ['whee']\n    >>> _to_list([None])\n    [None]\n    >>> _to_list((1, 2, 3))\n    [1, 2, 3]\n\n    :param var: variable of any type\n    :return:    list\n    \"\"\"\n    if isinstance(var, list):\n        return var\n    elif var is None:\n        return []\n    elif isinstance(var, str) or isinstance(var, dict):\n        # We dont want to make a list out of those via the default constructor\n        return [var]\n    else:\n        try:\n            return list(var)\n        except TypeError:\n            return [var]", "entry_point": "_to_list", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coala/coala-decorators-USE-cOALA-UTILS-INSTEAD/blob/b1c4463f364bbcd0ad5138f697a52f11c9afe326/coala_decorators/__init__.py#L32-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035508", "code": "def type_names(prefix, sizerange):\n        \"\"\"\n        Helper for type name generation, like: bytes1 .. bytes32\n        \"\"\"\n        namelist = []\n        for i in sizerange: namelist.append(prefix + str(i))\n        return tuple(namelist)", "entry_point": "type_names", "input": "'abc', {1, 2, 3}", "output": "('abc1', 'abc2', 'abc3')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/veox/pygments-lexer-solidity/blob/af47732c6da4adb8975a1485010844194d39da24/pygments_lexer_solidity/lexer.py#L34-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035509", "code": "def sanitize(string):\n    \"\"\"\n    Catch and replace invalid path chars\n    [replace, with]\n    \"\"\"\n    replace_chars = [\n        ['\\\\', '-'], [':', '-'], ['/', '-'],\n        ['?', ''], ['<', ''], ['>', ''],\n        ['`', '`'], ['|', '-'], ['*', '`'],\n        ['\"', '\\''], ['.', ''], ['&', 'and']\n    ]\n    for ch in replace_chars:\n        string = string.replace(ch[0], ch[1])\n    return string", "entry_point": "sanitize", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xtream1101/cutil/blob/2e4d1f00e66154b44d4ccffb9b1db3f37e87f2e8/cutil/__init__.py#L159-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035510", "code": "def convert_string(string, chars=None):\n    \"\"\"Remove certain characters from a string.\"\"\"\n    if chars is None:\n        chars = [',', '.', '-', '/', ':', '  ']\n\n    for ch in chars:\n        if ch in string:\n            string = string.replace(ch, ' ')\n    return string", "entry_point": "convert_string", "input": "'Hello World', []", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sharibarboza/py_zap/blob/ce90853efcad66d3e28b8f1ac910f275349d016c/py_zap/utils.py#L34-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035511", "code": "def filter_stopwords(phrase):\n    \"\"\"Filter out stop words and return as a list of words\"\"\"\n    if not isinstance(phrase, list):\n        phrase = phrase.split()\n\n    stopwords = ['the', 'a', 'in', 'to']\n    return [word.lower() for word in phrase if word.lower() not in stopwords]", "entry_point": "filter_stopwords", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sharibarboza/py_zap/blob/ce90853efcad66d3e28b8f1ac910f275349d016c/py_zap/utils.py#L160-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035512", "code": "def parse_parent(docname):\n    \"\"\" Given a docname path, pick apart and return name of parent \"\"\"\n\n    lineage = docname.split('/')\n    lineage_count = len(lineage)\n\n    if docname == 'index':\n        # This is the top of the Sphinx project\n        parent = None\n    elif lineage_count == 1:\n        # This is a non-index doc in root, e.g. about\n        parent = 'index'\n    elif lineage_count == 2 and lineage[-1] == 'index':\n        # This is blog/index, parent is the root\n        parent = 'index'\n    elif lineage_count == 2:\n        # This is blog/about\n        parent = lineage[0] + '/index'\n    elif lineage[-1] == 'index':\n        # This is blog/sub/index\n        parent = '/'.join(lineage[:-2]) + '/index'\n    else:\n        # This should be blog/sub/about\n        parent = '/'.join(lineage[:-1]) + '/index'\n\n    return parent", "entry_point": "parse_parent", "input": "'AbC dEf'", "output": "'index'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pauleveritt/kaybee/blob/a00a718aaaa23b2d12db30dfacb6b2b6ec84459c/kaybee/plugins/resources/base_resource.py#L8-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035513", "code": "def _remove_strings(code) :\n\t\t\"\"\" Remove strings in code\n\t\t\"\"\"\n\t\tremoved_string = \"\"\n\t\tis_string_now = None\n\t\t\n\t\tfor i in range(0, len(code)-1) :\n\t\t\tappend_this_turn = False\n\n\t\t\tif code[i] == \"'\" and (i == 0 or code[i-1] != '\\\\') :\n\t\t\t\tif is_string_now == \"'\" :\n\t\t\t\t\tis_string_now = None\n\n\t\t\t\telif is_string_now == None :\n\t\t\t\t\tis_string_now = \"'\"\n\t\t\t\t\tappend_this_turn = True\n\n\t\t\telif code[i] == '\"' and (i == 0 or code[i-1] != '\\\\') :\n\t\t\t\tif is_string_now == '\"' :\n\t\t\t\t\tis_string_now = None\n\n\t\t\t\telif is_string_now == None :\n\t\t\t\t\tis_string_now = '\"'\n\t\t\t\t\tappend_this_turn = True\n\n\n\t\t\tif is_string_now == None or append_this_turn == True :\n\t\t\t\tremoved_string += code[i]\n\n\t\treturn removed_string", "entry_point": "_remove_strings", "input": "['apple', 'banana', 'cherry']", "output": "'applebanana'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Prev/shaman/blob/82891c17c6302f7f9881a215789856d460a85f9c/shamanld/shaman.py#L115-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035514", "code": "def text_remove_empty_lines(text):\n    \"\"\"\n    Whitespace normalization:\n\n      - Strip empty lines\n      - Strip trailing whitespace\n    \"\"\"\n    lines = [ line.rstrip()  for line in text.splitlines()  if line.strip() ]\n    return \"\\n\".join(lines)", "entry_point": "text_remove_empty_lines", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/e7dal/bubble3/blob/59c735281a95b44f6263a25f4d6ce24fca520082/behave4cmd0/textutil.py#L164-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035515", "code": "def make_code_readable(s):\r\n    \"\"\"Add newlines at strategic places in code string for printing.\r\n\r\n    Args:\r\n        s: str, piece of code. If not str, will attempt to convert to str.\r\n\r\n    Returns:\r\n        str\r\n    \"\"\"\r\n\r\n    s = s if isinstance(s, str) else str(s)\r\n\r\n    MAP = {\",\": \",\\n\", \"{\": \"{\\n \", \"}\": \"\\n}\"}\r\n\r\n    ll = []\r\n\r\n    state = \"open\"\r\n    flag_single = False\r\n    flag_double = False\r\n    flag_backslash = False\r\n    for ch in s:\r\n        if flag_backslash:\r\n            flag_backslash = False\r\n            continue\r\n\r\n        if ch == \"\\\\\":\r\n            flag_backslash = True\r\n            continue\r\n\r\n        if flag_single:\r\n            if ch == \"'\":\r\n                flag_single = False\r\n        elif not flag_double and ch == \"'\":\r\n            flag_single = True\r\n\r\n        if flag_double:\r\n            if ch == '\"':\r\n                flag_double = False\r\n        elif not flag_single and ch == '\"':\r\n            flag_double = True\r\n\r\n        if flag_single or flag_double:\r\n            ll.append(ch)\r\n        else:\r\n            ll.append(MAP.get(ch, ch))\r\n\r\n    return \"\".join(ll)", "entry_point": "make_code_readable", "input": "[1, 2, 3]", "output": "'[1,\\n 2,\\n 3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trevisanj/a99/blob/193e6e3c9b3e4f4a0ba7eb3eece846fe7045c539/a99/conversion.py#L37-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035516", "code": "def _valid_packet(raw_packet):\n        \"\"\"Validate incoming packet.\"\"\"\n        if raw_packet[0:1] != b'\\xcc':\n            return False\n        if len(raw_packet) != 19:\n            return False\n        checksum = 0\n        for i in range(1, 17):\n            checksum += raw_packet[i]\n        if checksum != raw_packet[18]:\n            return False\n        return True", "entry_point": "_valid_packet", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jameshilliard/hlk-sw16/blob/4f0c5a7b76b42167f4dc9d2aa6312c7518a8cd56/hlk_sw16/protocol.py#L62-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035517", "code": "def clean_indicators(indicators):\n    \"\"\"Remove any extra details from indicators.\"\"\"\n    output = list()\n    for indicator in indicators:\n        strip = ['http://', 'https://']\n        for item in strip:\n            indicator = indicator.replace(item, '')\n        indicator = indicator.strip('.').strip()\n        parts = indicator.split('/')\n        if len(parts) > 0:\n            indicator = parts.pop(0)\n        output.append(indicator)\n    output = list(set(output))\n    return output", "entry_point": "clean_indicators", "input": "['a', 'b', 'c']", "output": "['c', 'a', 'b']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockadeio/analyst_toolbench/blob/159b6f8cf8a91c5ff050f1579636ea90ab269863/blockade/common/utils.py#L4-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035518", "code": "def varintSize(value):\n  \"\"\"Compute the size of a varint value.\"\"\"\n  if value <= 0x7f: return 1\n  if value <= 0x3fff: return 2\n  if value <= 0x1fffff: return 3\n  if value <= 0xfffffff: return 4\n  if value <= 0x7ffffffff: return 5\n  if value <= 0x3ffffffffff: return 6\n  if value <= 0x1ffffffffffff: return 7\n  if value <= 0xffffffffffffff: return 8\n  if value <= 0x7fffffffffffffff: return 9\n  return 10", "entry_point": "varintSize", "input": "False", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mixer/beam-interactive-python/blob/e035bc45515dea9315b77648a24b5ae8685aa5cf/beam_interactive/proto/varint.py#L94-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035519", "code": "def signedVarintSize(value):\n  \"\"\"Compute the size of a signed varint value.\"\"\"\n  if value < 0: return 10\n  if value <= 0x7f: return 1\n  if value <= 0x3fff: return 2\n  if value <= 0x1fffff: return 3\n  if value <= 0xfffffff: return 4\n  if value <= 0x7ffffffff: return 5\n  if value <= 0x3ffffffffff: return 6\n  if value <= 0x1ffffffffffff: return 7\n  if value <= 0xffffffffffffff: return 8\n  if value <= 0x7fffffffffffffff: return 9\n  return 10", "entry_point": "signedVarintSize", "input": "3.25", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mixer/beam-interactive-python/blob/e035bc45515dea9315b77648a24b5ae8685aa5cf/beam_interactive/proto/varint.py#L108-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035520", "code": "def cursor_to_data_header(cursor):\r\n    \"\"\"Fetches all rows from query (\"cursor\") and returns a pair (data, header)\r\n\r\n    Returns: (data, header), where\r\n        - data is a [num_rows]x[num_cols] sequence of sequences;\r\n        - header is a [num_cols] list containing the field names\r\n    \"\"\"\r\n    n = 0\r\n    data, header = [], {}\r\n    for row in cursor:\r\n        if n == 0:\r\n            header = row.keys()\r\n        data.append(row.values())\r\n    return data, list(header)", "entry_point": "cursor_to_data_header", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trevisanj/a99/blob/193e6e3c9b3e4f4a0ba7eb3eece846fe7045c539/a99/litedb.py#L43-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035521", "code": "def latex_quote(s):\n    \"\"\"Quote special characters for LaTeX.\n\n    (Incomplete, currently only deals with underscores, dollar and hash.)\n    \"\"\"\n    special = {'_':r'\\_', '$':r'\\$', '#':r'\\#'}\n    s = str(s)\n    for char,repl in special.items():\n        new = s.replace(char, repl)\n        s = new[:]\n    return s", "entry_point": "latex_quote", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/orbeckst/RecSQL/blob/6acbf821022361719391697c9c2f0822f9f8022a/recsql/export.py#L38-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035522", "code": "def format_progress(i, n):\r\n    \"\"\"Returns string containing a progress bar, a percentage, etc.\"\"\"\r\n    if n == 0:\r\n        fraction = 0\r\n    else:\r\n        fraction = float(i)/n\r\n    LEN_BAR = 25\r\n    num_plus = int(round(fraction*LEN_BAR))\r\n    s_plus = '+'*num_plus\r\n    s_point = '.'*(LEN_BAR-num_plus)\r\n    return '[{0!s}{1!s}] {2:d}/{3:d} - {4:.1f}%'.format(s_plus, s_point, i, n, fraction*100)", "entry_point": "format_progress", "input": "True, 0", "output": "'[.........................] 1/0 - 0.0%'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trevisanj/a99/blob/193e6e3c9b3e4f4a0ba7eb3eece846fe7045c539/a99/textinterface.py#L284-L294", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035523", "code": "def markdown_table(data, headers):\r\n    \"\"\"\r\n    Creates MarkDown table. Returns list of strings\r\n\r\n    Arguments:\r\n      data -- [(cell00, cell01, ...), (cell10, cell11, ...), ...]\r\n      headers -- sequence of strings: (header0, header1, ...)\r\n    \"\"\"\r\n\r\n    maxx = [max([len(x) for x in column]) for column in zip(*data)]\r\n    maxx = [max(ll) for ll in zip(maxx, [len(x) for x in headers])]\r\n    mask = \" | \".join([\"%-{0:d}s\".format(n) for n in maxx])\r\n\r\n    ret = [mask % headers]\r\n\r\n    ret.append(\" | \".join([\"-\"*n for n in maxx]))\r\n    for line in data:\r\n        ret.append(mask % line)\r\n    return ret", "entry_point": "markdown_table", "input": "[[1, 2], [3], []], []", "output": "['', '', '', '', '']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trevisanj/a99/blob/193e6e3c9b3e4f4a0ba7eb3eece846fe7045c539/a99/textinterface.py#L377-L395", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035524", "code": "def expand_multirow_data(data):\r\n    \"\"\"\r\n    Converts multirow cells to a list of lists and informs the number of lines of each row.\r\n\r\n    Returns:\r\n         tuple: new_data, row_heights\r\n    \"\"\"\r\n\r\n    num_cols = len(data[0]) # number of columns\r\n\r\n    # calculates row heights\r\n    row_heights = []\r\n    for mlrow in data:\r\n        row_height = 0\r\n        for j, cell in enumerate(mlrow):\r\n            row_height = max(row_height, 1 if not isinstance(cell, (list, tuple)) else len(cell))\r\n        row_heights.append(row_height)\r\n    num_lines = sum(row_heights) # line != row (rows are multiline)\r\n\r\n    # rebuilds table data\r\n    new_data = [[\"\"]*num_cols for i in range(num_lines)]\r\n    i0 = 0\r\n    for row_height, mlrow in zip(row_heights, data):\r\n        for j, cell in enumerate(mlrow):\r\n            if not isinstance(cell, (list, tuple)):\r\n                cell = [cell]\r\n\r\n            for incr, x in enumerate(cell):\r\n                new_data[i0+incr][j] = x\r\n\r\n        i0 += row_height\r\n\r\n    return new_data, row_heights", "entry_point": "expand_multirow_data", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3, '']], [1, 1, 0])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trevisanj/a99/blob/193e6e3c9b3e4f4a0ba7eb3eece846fe7045c539/a99/textinterface.py#L398-L430", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035525", "code": "def string_to_numeric_char_reference(string):\n    \"\"\"\n    Encode a string to HTML-compatible numeric character reference.\n    Eg: encode_html_entities(\"abc\") == '&#97;&#98;&#99;'\n    \"\"\"\n    out = \"\"\n    for char in string:\n        out += \"&#\" + str(ord(char)) + \";\"\n    return out", "entry_point": "string_to_numeric_char_reference", "input": "'abc'", "output": "'&#97;&#98;&#99;'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-attic/invenio-utils/blob/9a1c6db4e3f1370901f329f510480dd8df188296/invenio_utils/url.py#L459-L467", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035526", "code": "def nmtoken_from_string(text):\n    \"\"\"\n    Returns a Nmtoken from a string.\n    It is useful to produce XHTML valid values for the 'name'\n    attribute of an anchor.\n\n    CAUTION: the function is surjective: 2 different texts might lead to\n    the same result. This is improbable on a single page.\n\n    Nmtoken is the type that is a mixture of characters supported in\n    attributes such as 'name' in HTML 'a' tag. For example,\n    <a name=\"Articles%20%26%20Preprints\"> should be tranformed to\n    <a name=\"Articles372037263720Preprints\"> using this function.\n    http://www.w3.org/TR/2000/REC-xml-20001006#NT-Nmtoken\n\n    Also note that this function filters more characters than\n    specified by the definition of Nmtoken ('CombiningChar' and\n    'Extender' charsets are filtered out).\n    \"\"\"\n    text = text.replace('-', '--')\n    return ''.join([(((not char.isalnum() and char not in [\n        '.', '-', '_', ':'\n    ]) and str(ord(char))) or char) for char in text])", "entry_point": "nmtoken_from_string", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-attic/invenio-utils/blob/9a1c6db4e3f1370901f329f510480dd8df188296/invenio_utils/html.py#L86-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035527", "code": "def escape_html(text, escape_quotes=False):\n    \"\"\"Escape all HTML tags, avoiding XSS attacks.\n    < => &lt;\n    > => &gt;\n    & => &amp:\n    @param text: text to be escaped from HTML tags\n    @param escape_quotes: if True, escape any quote mark to its HTML entity:\n                          \" => &quot;\n                          ' => &#39;\n    \"\"\"\n    text = text.replace('&', '&amp;')\n    text = text.replace('<', '&lt;')\n    text = text.replace('>', '&gt;')\n    if escape_quotes:\n        text = text.replace('\"', '&quot;')\n        text = text.replace(\"'\", '&#39;')\n    return text", "entry_point": "escape_html", "input": "'abc', [-1, 0, 1, 2]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-attic/invenio-utils/blob/9a1c6db4e3f1370901f329f510480dd8df188296/invenio_utils/html.py#L111-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035528", "code": "def unescape(s, quote=False):\n    \"\"\"\n    The opposite of the cgi.escape function.\n    Replace escaped characters '&amp;', '&lt;' and '&gt;' with the corresponding\n    regular characters. If the optional flag quote is true, the escaped quotation\n    mark character ('&quot;') is also translated.\n    \"\"\"\n    s = s.replace('&lt;', '<')\n    s = s.replace('&gt;', '>')\n    if quote:\n        s = s.replace('&quot;', '\"')\n    s = s.replace('&amp;', '&')\n    return s", "entry_point": "unescape", "input": "'walnut thistle harbour', {}", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-attic/invenio-utils/blob/9a1c6db4e3f1370901f329f510480dd8df188296/invenio_utils/html.py#L681-L693", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035529", "code": "def get_reply_order_cache_data(comid):\n    \"\"\"\n    Prepare a representation of the comment ID given as parameter so\n    that it is suitable for byte ordering in MySQL.\n    \"\"\"\n    return \"%s%s%s%s\" % (chr((comid >> 24) % 256), chr((comid >> 16) % 256),\n                         chr((comid >> 8) % 256), chr(comid % 256))", "entry_point": "get_reply_order_cache_data", "input": "True", "output": "'\\x00\\x00\\x00\\x01'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inveniosoftware-attic/invenio-comments/blob/62bb6e07c146baf75bf8de80b5896ab2a01a8423/invenio_comments/api.py#L945-L951", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035530", "code": "def _split_mod_var_names(resource_name):\n    \"\"\" Return (module_name, class_name) pair from given string. \"\"\"\n    try:\n        dot_index = resource_name.rindex('.')\n    except ValueError:\n        # no dot found\n        return '', resource_name\n    return resource_name[:dot_index], resource_name[dot_index + 1:]", "entry_point": "_split_mod_var_names", "input": "'a,b,c'", "output": "('', 'a,b,c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wuher/devil/blob/a8834d4f88d915a21754c6b96f99d0ad9123ad4d/devil/perm/management.py#L18-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035531", "code": "def crunch_dir(name, n=50):\r\n    \"\"\"Puts \"...\" in the middle of a directory name if lengh > n.\"\"\"\r\n    if len(name) > n + 3:\r\n        name = \"...\" + name[-n:]\r\n    return name", "entry_point": "crunch_dir", "input": "{1, 2, 3}, 0.5", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trevisanj/a99/blob/193e6e3c9b3e4f4a0ba7eb3eece846fe7045c539/a99/fileio.py#L32-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035532", "code": "def get_neighbor_expression_vector(neighbors, gene_expression_dict):\r\n    \"\"\"Get an expression vector of neighboring genes.\r\n    Attribute:\r\n        neighbors (list): List of gene identifiers of neighboring genes.\r\n        gene_expression_dict (dict): (Gene identifier)-(gene expression) dictionary.\r\n    \"\"\"\r\n    expressions = []  # Expression vector.\r\n    for gene in neighbors:\r\n        try:\r\n            expression = gene_expression_dict[gene]\r\n        except KeyError:\r\n            continue\r\n\r\n        expressions.append(expression)\r\n    return expressions", "entry_point": "get_neighbor_expression_vector", "input": "[], {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iron-lion/nJSD/blob/386397b7aa7251954771b2be4ce3a5d575033206/src/njsd/entropy.py#L13-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035533", "code": "def colorize(occurence,maxoccurence,minoccurence):\n    '''A formula for determining colors.'''\n    if occurence == maxoccurence:\n        color = (255,0,0)\n    elif occurence == minoccurence:\n        color = (0,0,255)\n    else:\n        color = (int((float(occurence)/maxoccurence*255)),0,int(float(minoccurence)/occurence*255))\n    return color", "entry_point": "colorize", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2], [[1, 2], [3], []]", "output": "(255, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NickMonzillo/SmartCloud/blob/481d1ef428427b452a8a787999c1d4a8868a3824/SmartCloud/utils.py#L50-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035534", "code": "def CleanString(s):\n    \"\"\"Cleans up string.\n\n    Doesn't catch everything, appears to sometimes allow double underscores\n    to occur as a result of replacements.\n    \"\"\"\n    punc = (' ', '-', '\\'', '.', '&amp;', '&', '+', '@')\n    pieces = []\n    for part in s.split():\n        part = part.strip()\n        for p in punc:\n            part = part.replace(p, '_')\n        part = part.strip('_')\n        part = part.lower()\n        pieces.append(part)\n    return '_'.join(pieces)", "entry_point": "CleanString", "input": "'walnut thistle harbour'", "output": "'walnut_thistle_harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmwilcox/vcard-tools/blob/1b0f62a0f4c128c7a212ecdca34ff2acb746b262/vcardtools/vcf_splitter.py#L76-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035535", "code": "def VcardMergeListFields(field1, field2):\n    \"\"\"Handle merging list fields that may include some overlap.\"\"\"\n    field_dict = {}\n    for f in field1 + field2:\n        field_dict[str(f)] = f\n    return list(field_dict.values())", "entry_point": "VcardMergeListFields", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "['apple', 'banana', 'cherry', 5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmwilcox/vcard-tools/blob/1b0f62a0f4c128c7a212ecdca34ff2acb746b262/vcardtools/vcf_merge.py#L47-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035536", "code": "def SetVcardField(new_vcard, field_name, values):\n    \"\"\"Set vCard field values and parameters on a new vCard.\"\"\"\n    for val in values:\n        new_field = new_vcard.add(field_name)\n        new_field.value = val.value\n        if val.params:\n            new_field.params = val.params\n    return new_vcard", "entry_point": "SetVcardField", "input": "[1, 2, 3], 'walnut thistle harbour', []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmwilcox/vcard-tools/blob/1b0f62a0f4c128c7a212ecdca34ff2acb746b262/vcardtools/vcf_merge.py#L55-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035537", "code": "def _remove_otiose(lst):\n    \"\"\"lift deeply nested expressions out of redundant parentheses\"\"\"\n    listtype = type([])\n    while type(lst) == listtype and len(lst) == 1:\n        lst = lst[0]\n\n    return lst", "entry_point": "_remove_otiose", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LinkCareServices/period/blob/014f3c766940658904c52547d8cf8c12d4895e07/period/main.py#L34-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035538", "code": "def duration(seconds):\n    \"\"\"Return a string of the form \"1 hr 2 min 3 sec\" representing the\n    given number of seconds.\"\"\"\n    if seconds < 1:\n        return 'less than 1 sec'\n    seconds = int(round(seconds))\n    components = []\n    for magnitude, label in ((3600, 'hr'), (60, 'min'), (1, 'sec')):\n        if seconds >= magnitude:\n            components.append('{} {}'.format(seconds // magnitude, label))\n            seconds %= magnitude\n    return ' '.join(components)", "entry_point": "duration", "input": "2", "output": "'2 sec'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kxz/littlebrother/blob/af9ec9af5c0de9a74796bb7e16a6b836286e8b9f/littlebrother/humanize.py#L4-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035539", "code": "def filesize(num_bytes):\n    \"\"\"Return a string containing an approximate representation of\n    *num_bytes* using a small number and decimal SI prefix.\"\"\"\n    for prefix in '-KMGTEPZY':\n        if num_bytes < 999.9:\n            break\n        num_bytes /= 1000.0\n    if prefix == '-':\n        return '{} B'.format(num_bytes)\n    return '{:.3n} {}B'.format(num_bytes, prefix)", "entry_point": "filesize", "input": "1", "output": "'1 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kxz/littlebrother/blob/af9ec9af5c0de9a74796bb7e16a6b836286e8b9f/littlebrother/humanize.py#L18-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035540", "code": "def find_in_matrix_2d(val, matrix):\n    '''\n    Returns a tuple representing the index of an item in a 2D matrix.\n\n    Arguments:\n        - val (str) Value to look for\n        - matrix (list) 2D matrix to search for val in\n\n    Returns:\n        - (tuple) Ordered pair representing location of val\n    '''\n\n    dim = len(matrix[0])\n    item_index = 0\n\n    for row in matrix:\n        for i in row:\n            if i == val:\n                break\n            item_index += 1\n        if i == val:\n            break\n\n    loc = (int(item_index / dim), item_index % dim)\n\n    return loc", "entry_point": "find_in_matrix_2d", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "(3, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tylucaskelley/licenser/blob/6b7394fdaab7707c4c33201c4d023097452b46bc/licenser/licenser.py#L21-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035541", "code": "def _get_names(names, types):\n    \"\"\"\n    Get names, bearing in mind that there might be no name,\n    no type, and that the `:` separator might be wrongly used.\n    \"\"\"\n    if types == \"\":\n        try:\n            names, types = names.split(\":\")\n        except:\n            pass\n    return names.split(\",\"), types", "entry_point": "_get_names", "input": "'AbC dEf', ['a', 'b', 'c']", "output": "(['AbC dEf'], ['a', 'b', 'c'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/greenape/mktheapidocs/blob/a45e8b43ddd80ed360fe1e98d4f73dc11c4e7bf7/mktheapidocs/mkapi.py#L506-L516", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035542", "code": "def create_update_parameter(task_params, parameter_map):\n    \"\"\"\n    Builds the code block for the GPTool UpdateParameter method based on the input task_params.\n\n    :param task_params: A list of task parameters from the task info structure.\n    :return: A string representing the code block to the GPTool UpdateParameter method.\n    \"\"\"\n    gp_params = []\n    for param in task_params:\n        if param['direction'].upper() == 'OUTPUT':\n            continue\n\n        # Convert DataType\n        data_type = param['type'].upper()\n        if 'dimensions' in param:\n            data_type += 'ARRAY'\n\n        if data_type in parameter_map:\n            gp_params.append(parameter_map[data_type].update_parameter().substitute(param))\n\n    return ''.join(gp_params)", "entry_point": "create_update_parameter", "input": "[], {}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/envi-idl/envipyarclib/blob/90135652510c3d53c5f51177252c1fea2639bf22/envipyarclib/gptool/parameter/builder.py#L166-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035543", "code": "def create_post_execute(task_params, parameter_map):\n    \"\"\"\n    Builds the code block for the GPTool Execute method after the job is\n    submitted based on the input task_params.\n\n    :param task_params: A list of task parameters from the task info structure.\n    :return: A string representing the code block to the GPTool Execute method.\n    \"\"\"\n\n    gp_params = []\n    for task_param in task_params:\n        if task_param['direction'].upper() == 'INPUT':\n            continue\n\n        # Convert DataType\n        data_type = task_param['type'].upper()\n        if 'dimensions' in task_param:\n            data_type += 'ARRAY'\n\n        if data_type in parameter_map:\n            gp_params.append(parameter_map[data_type].post_execute().substitute(task_param))\n\n    return ''.join(gp_params)", "entry_point": "create_post_execute", "input": "(), ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/envi-idl/envipyarclib/blob/90135652510c3d53c5f51177252c1fea2639bf22/envipyarclib/gptool/parameter/builder.py#L232-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035544", "code": "def convert(b):\n    '''\n    takes a number of bytes as an argument and returns the most suitable human\n    readable unit conversion.\n    '''\n    if b > 1024**3:\n        hr = round(b/1024**3)\n        unit = \"GB\"\n    elif b > 1024**2:\n        hr = round(b/1024**2)\n        unit = \"MB\"\n    else:\n        hr = round(b/1024)\n        unit = \"KB\"\n    return hr, unit", "entry_point": "convert", "input": "5", "output": "(0, 'KB')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tslight/pdu/blob/b6dfc5e8f6773b1e4e3047496b0ab72fef267a27/pdu/du.py#L7-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035545", "code": "def commonprefix(m):\r\n    u\"Given a list of pathnames, returns the longest common leading component\"\r\n    if not m:\r\n        return ''\r\n    prefix = m[0]\r\n    for item in m:\r\n        for i in range(len(prefix)):\r\n            if prefix[:i + 1].lower() != item[:i + 1].lower():\r\n                prefix = prefix[:i]\r\n                if i == 0:\r\n                    return u''\r\n                break\r\n    return prefix", "entry_point": "commonprefix", "input": "['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SeattleTestbed/seash/blob/40f9d2285662ff8b61e0468b4196acee089b273b/pyreadline/modes/emacs.py#L718-L730", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035546", "code": "def reduce_list_of_bags_of_words(list_of_keyword_sets):\n    \"\"\"\n    Reduces a number of keyword sets to a bag-of-words.\n\n    Input:  - list_of_keyword_sets: This is a python list of sets of strings.\n\n    Output: - bag_of_words: This is the corresponding multi-set or bag-of-words, in the form of a python dictionary.\n    \"\"\"\n    bag_of_words = dict()\n    get_bag_of_words_keys = bag_of_words.keys\n    for keyword_set in list_of_keyword_sets:\n        for keyword in keyword_set:\n            if keyword in get_bag_of_words_keys():\n                bag_of_words[keyword] += 1\n            else:\n                bag_of_words[keyword] = 1\n\n    return bag_of_words", "entry_point": "reduce_list_of_bags_of_words", "input": "[[1, 2], [3], []]", "output": "{1: 1, 2: 1, 3: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MKLab-ITI/reveal-user-annotation/blob/ed019c031857b091e5601f53ba3f01a499a0e3ef/reveal_user_annotation/text/text_util.py#L25-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035547", "code": "def matchImpObjStrs(fdefs,imp_obj_strs,cdefs):\n    '''returns imp_funcs, a dictionary with filepath keys that contains \n    lists of function definition nodes that were imported using\n     from __ import __ style syntax. also returns imp_classes, which \n    is the same for class definition nodes.'''\n    imp_funcs=dict()\n    imp_classes=dict()\n    for source in imp_obj_strs:\n        if not imp_obj_strs[source]:\n            continue\n        imp_funcs[source]=[]\n        imp_classes[source]=[]\n        for (mod,func) in imp_obj_strs[source]:\n            if mod not in fdefs:\n                #print(mod+\" is not part of the project.\")\n                continue\n            if func=='*':\n                all_fns = [x for x in fdefs[mod] if x.name!='body']\n                imp_funcs[source] += all_fns\n                all_cls = [x for x in cdefs[mod]]\n                imp_classes[source] += all_cls\n            else:\n                fn_node = [x for x in fdefs[mod] if x.name==func]\n                cls_node = [x for x in cdefs[mod] if x.name==func]\n                #assert len(fn_node) in [1,0]\n                #assert len(cls_node) in [1,0]\n                if cls_node:\n                    imp_classes[source] += cls_node\n                if fn_node:\n                    imp_funcs[source] += fn_node\n                if not fn_node and not cls_node:\n                    pass\n                    #print(func+' not found in function and class definitions.')\n    return imp_funcs,imp_classes", "entry_point": "matchImpObjStrs", "input": "['apple', 'banana', 'cherry'], [], ['a', 'b', 'c']", "output": "({}, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brmscheiner/ideogram/blob/422bf566c51fd56f7bbb6e75b16d18d52b4c7568/ideogram/converter.py#L239-L272", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035548", "code": "def join_and(value):\n    \"\"\"Given a list of strings, format them with commas and spaces, but\n    with 'and' at the end.\n\n    >>> join_and(['apples', 'oranges', 'pears'])\n    \"apples, oranges, and pears\"\n\n    There is surely a better home for this\n\n    \"\"\"\n    # convert numbers to strings\n    value = [str(item) for item in value]\n\n    if len(value) == 1:\n        return value[0]\n    if len(value) == 2:\n        return \"%s and %s\" % (value[0], value[1])\n\n    # join all but the last element\n    all_but_last = \", \".join(value[:-1])\n    return \"%s and %s\" % (all_but_last, value[-1])", "entry_point": "join_and", "input": "['apple', 'banana', 'cherry']", "output": "'apple, banana and cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tBaxter/activity-monitor/blob/be6c6edc7c6b4141923b47376502cde0f785eb68/activity_monitor/templatetags/activity_tags.py#L14-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035549", "code": "def _are_cmd_nodes_same(node1, node2):\n  \"\"\" \n  Checks to see if two cmddnodes are the same.\n  Two cmdnodes are defined to be the same if they have the same callbacks/\n  helptexts/summaries. \n  \"\"\"\n\n  # Everything in node1 should be in node2\n  for propertytype in node1:\n    if (not propertytype in node2 or\n        node1[propertytype] != node2[propertytype]):\n      return False\n  return True", "entry_point": "_are_cmd_nodes_same", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SeattleTestbed/seash/blob/40f9d2285662ff8b61e0468b4196acee089b273b/seash_modules.py#L175-L187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035550", "code": "def partition(thelist, n):\n    \"\"\"\n    Break a list into ``n`` pieces. The last list may be larger than the rest if\n    the list doesn't break cleanly. That is::\n \n        >>> l = range(10)\n \n        >>> partition(l, 2)\n        [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]\n \n        >>> partition(l, 3)\n        [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]\n \n        >>> partition(l, 4)\n        [[0, 1], [2, 3], [4, 5], [6, 7, 8, 9]]\n \n        >>> partition(l, 5)\n        [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]\n \n    \"\"\"\n    try:\n        n = int(n)\n        thelist = list(thelist)\n    except (ValueError, TypeError):\n        return [thelist]\n    p = len(thelist) / n\n    return [thelist[p*i:p*(i+1)] for i in range(n - 1)] + [thelist[p*(i+1):]]", "entry_point": "partition", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "[['a', 'b', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/callowayproject/Calloway/blob/d22e98d41fbd298ab6393ba7bd84a75528be9f81/calloway/apps/django_ext/templatetags/listutil.py#L21-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035551", "code": "def hamming(s, t):\n    \"\"\"\n    Calculate the Hamming distance between two strings. From Wikipedia article: Iterative with two matrix rows.\n\n    :param s: string 1\n    :type s: str\n    :param t: string 2\n    :type s: str\n    :return: Hamming distance\n    :rtype: float\n    \"\"\"\n    if len(s) != len(t):\n        raise ValueError('Hamming distance needs strings of equal length.')\n    return sum(s_ != t_ for s_, t_ in zip(s, t))", "entry_point": "hamming", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/childsish/lhc-python/blob/0a669f46a40a39f24d28665e8b5b606dc7e86beb/lhc/misc/string.py#L38-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035552", "code": "def jsPath(path):\n    '''Returns a relative path without \\, -, and . so that \n    the string will play nicely with javascript.'''\n    shortPath=path.replace(\n            \"C:\\\\Users\\\\scheinerbock\\\\Desktop\\\\\"+\n            \"ideogram\\\\scrapeSource\\\\test\\\\\",\"\")\n    noDash = shortPath.replace(\"-\",\"_dash_\")\n    jsPath=noDash.replace(\"\\\\\",\"_slash_\").replace(\".\",\"_dot_\")\n    return jsPath", "entry_point": "jsPath", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brmscheiner/ideogram/blob/422bf566c51fd56f7bbb6e75b16d18d52b4c7568/ideogram/writer.py#L3-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035553", "code": "def jsName(path,name):\n    '''Returns a name string without \\, -, and . so that \n    the string will play nicely with javascript.'''\n    shortPath=path.replace(\n            \"C:\\\\Users\\\\scheinerbock\\\\Desktop\\\\\"+\n            \"ideogram\\\\scrapeSource\\\\test\\\\\",\"\")\n    noDash = shortPath.replace(\"-\",\"_dash_\")\n    jsPath=noDash.replace(\"\\\\\",\"_slash_\").replace(\".\",\"_dot_\")\n    jsName=jsPath+'_slash_'+name\n    return jsName", "entry_point": "jsName", "input": "'AbC dEf', 'walnut thistle harbour'", "output": "'AbC dEf_slash_walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brmscheiner/ideogram/blob/422bf566c51fd56f7bbb6e75b16d18d52b4c7568/ideogram/writer.py#L13-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035554", "code": "def getStartNodes(fdefs,calls):\n    '''Return a list of nodes in fdefs that have no inbound edges'''\n    s=[]\n    for source in fdefs:\n        for fn in fdefs[source]:\n            inboundEdges=False\n            for call in calls:\n                if call.target==fn:\n                    inboundEdges=True\n            if not inboundEdges:\n                s.append(fn)\n    return s", "entry_point": "getStartNodes", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brmscheiner/ideogram/blob/422bf566c51fd56f7bbb6e75b16d18d52b4c7568/ideogram/writer.py#L55-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035555", "code": "def getChildren(current,calls,blacklist=[]):\n    ''' Return a list of the children of current that are not in used. '''\n    return [c.target for c in calls if c.source==current and c.target not in blacklist]", "entry_point": "getChildren", "input": "set(), (), -3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brmscheiner/ideogram/blob/422bf566c51fd56f7bbb6e75b16d18d52b4c7568/ideogram/writer.py#L140-L142", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035556", "code": "def get_console_scripts(setup_data):\n    '''Parse and return a list of console_scripts from setup_data'''\n\n    # TODO: support ini format of entry_points\n    # TODO: support setup.cfg entry_points as available in pbr\n\n    if 'entry_points' not in setup_data:\n        return []\n\n    console_scripts = setup_data['entry_points'].get('console_scripts', [])\n    return [script.split('=')[0].strip() for script in console_scripts]", "entry_point": "get_console_scripts", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danbradham/scrim/blob/982a5db1db6e4ef40267f15642af2c7ea0e803ae/scrim/utils.py#L104-L114", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035557", "code": "def _parse(args):\n    \"\"\"Parse passed arguments from shell.\"\"\"\n\n    ordered = []\n    opt_full = dict()\n    opt_abbrev = dict()\n\n    args = args + ['']  # Avoid out of range\n    i = 0\n\n    while i < len(args) - 1:\n        arg = args[i]\n        arg_next = args[i+1]\n        if arg.startswith('--'):\n            if arg_next.startswith('-'):\n                raise ValueError('{} lacks value'.format(arg))\n            else:\n                opt_full[arg[2:]] = arg_next\n                i += 2\n        elif arg.startswith('-'):\n            if arg_next.startswith('-'):\n                raise ValueError('{} lacks value'.format(arg))\n            else:\n                opt_abbrev[arg[1:]] = arg_next\n                i += 2\n        else:\n            ordered.append(arg)\n            i += 1\n    \n    return ordered, opt_full, opt_abbrev", "entry_point": "_parse", "input": "[]", "output": "([], {}, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/puhitaku/naam/blob/20dd01af4d85c9c88963ea1b78a6f217cb015f27/naam/__init__.py#L9-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035558", "code": "def _merge_section(original, to_merge):\n    # type: (str, str) -> str\n    \"\"\"Merge two sections together.\n\n    Args:\n        original: The source of header and initial section lines.\n        to_merge: The source for the additional section lines to append.\n\n    Returns:\n        A new section string that uses the header of the original argument and\n        the section lines from both.\n    \"\"\"\n    if not original:\n        return to_merge or ''\n    if not to_merge:\n        return original or ''\n    try:\n        index = original.index(':') + 1\n    except ValueError:\n        index = original.index('\\n')\n    name = original[:index].strip()\n    section = '\\n  '.join(\n        (original[index + 1:].lstrip(), to_merge[index + 1:].lstrip())\n    ).rstrip()\n    return '{name}\\n  {section}'.format(name=name, section=section)", "entry_point": "_merge_section", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/contains-io/rcli/blob/cdd6191a0e0a19bc767f84921650835d099349cf/rcli/usage.py#L166-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035559", "code": "def append_overhead_costs(costs, new_id, overhead_percentage=0.15):\n    \"\"\"\n    Adds 15% overhead costs to the list of costs.\n\n    Usage::\n\n        from rapid_prototyping.context.utils import append_overhead_costs\n        costs = [\n            ....\n        ]\n        costs = append_overhead_costs(costs, MAIN_ID + get_counter(counter)[0])\n\n    :param costs: Your final list of costs.\n    :param new_id: The id that this new item should get.\n\n    \"\"\"\n    total_time = 0\n    for item in costs:\n        total_time += item['time']\n\n    costs.append({\n        'id': new_id,\n        'task': 'Overhead, Bufixes & Iterations',\n        'time': total_time * overhead_percentage, },\n    )\n    return costs", "entry_point": "append_overhead_costs", "input": "[], [1, 2, 3], []", "output": "[{'id': [1, 2, 3], 'task': 'Overhead, Bufixes & Iterations', 'time': []}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bitlabstudio/django-rapid-prototyping/blob/fd14ab5453bd7a0c2d5b973e8d96148963b03ab0/rapid_prototyping/context/utils.py#L84-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035560", "code": "def truncate(message, limit=500):\n    \"\"\"\n    Truncates the message to the given limit length. The beginning and the\n    end of the message are left untouched.\n    \"\"\"\n    if len(message) > limit:\n        trc_msg = ''.join([message[:limit // 2 - 2],\n                           ' .. ',\n                           message[len(message) - limit // 2 + 2:]])\n    else:\n        trc_msg = message\n    return trc_msg", "entry_point": "truncate", "input": "[1, 2, 3], 7", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/helixyte/everest/blob/70c9b93c3061db5cb62428349d18b8fb8566411b/everest/utils.py#L517-L528", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035561", "code": "def prefixed_to_namespaced(C, prefixed_name, namespaces):\r\n        \"\"\"for a given prefix:name, return {namespace}name from the given namespaces dict\r\n        \"\"\"\r\n        if ':' not in prefixed_name:\r\n            return prefixed_name\r\n        else:\r\n            prefix, name = prefixed_name.split(':')\r\n            namespace = namespaces[prefix]\r\n            return \"{%s}%s\" % (namespace, name)", "entry_point": "prefixed_to_namespaced", "input": "[1, 2, 3], 'abc', 'a,b,c'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BlackEarth/bxml/blob/8fbea5dad7fadc7b854ddbeff6ecfb55aaceeb77/bxml/xml.py#L112-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035562", "code": "def _split(value):\n    \"\"\"Split input/output value into two values.\"\"\"\n    if isinstance(value, str):\n        # iterable, but not meant for splitting\n        return value, value\n    try:\n        invalue, outvalue = value\n    except TypeError:\n        invalue = outvalue = value\n    except ValueError:\n        raise ValueError(\"Only single values and pairs are allowed\")\n    return invalue, outvalue", "entry_point": "_split", "input": "2.0", "output": "(2.0, 2.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bastibe/PySoundCard/blob/fb16460b75a1bb416089ebecdf700fa954faa5b7/pysoundcard.py#L749-L760", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035563", "code": "def subtract_by_key(dict_a, dict_b):\n    \"\"\"given two dicts, a and b, this function returns c = a - b, where\n    a - b is defined as the key difference between a and b.\n\n    e.g.,\n    {1:None, 2:3, 3:\"yellow\", 4:True} - {2:4, 1:\"green\"} =\n        {3:\"yellow\", 4:True}\n\n    \"\"\"\n    difference_dict = {}\n    for key in dict_a:\n        if key not in dict_b:\n            difference_dict[key] = dict_a[key]\n\n    return difference_dict", "entry_point": "subtract_by_key", "input": "{}, {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/haaksmash/pyutils/blob/6ba851d11e53812dfc9017537a4f2de198851708/utils/dicts/helpers.py#L28-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035564", "code": "def flat_map(iterable, func):\n    \"\"\"func must take an item and return an interable that contains that\n    item. this is flatmap in the classic mode\"\"\"\n    results = []\n    for element in iterable:\n        result = func(element)\n        if len(result) > 0:\n            results.extend(result)\n    return results", "entry_point": "flat_map", "input": "(), 1", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/haaksmash/pyutils/blob/6ba851d11e53812dfc9017537a4f2de198851708/utils/lists.py#L34-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035565", "code": "def check_for_bypass_url(raw_creds, nova_args):\n    \"\"\"\n    Return a list of extra args that need to be passed on cmdline to nova.\n    \"\"\"\n    if 'BYPASS_URL' in raw_creds.keys():\n        bypass_args = ['--bypass-url', raw_creds['BYPASS_URL']]\n        nova_args = bypass_args + nova_args\n\n    return nova_args", "entry_point": "check_for_bypass_url", "input": "{'a': 1, 'b': 2}, True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/major/supernova/blob/4a217ae53c1c05567014b047c0b6b9dea2d383b3/supernova/supernova.py#L80-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035566", "code": "def rm_prefix(name):\n    \"\"\"\n    Removes nova_ os_ novaclient_ prefix from string.\n    \"\"\"\n    if name.startswith('nova_'):\n        return name[5:]\n    elif name.startswith('novaclient_'):\n        return name[11:]\n    elif name.startswith('os_'):\n        return name[3:]\n    else:\n        return name", "entry_point": "rm_prefix", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/major/supernova/blob/4a217ae53c1c05567014b047c0b6b9dea2d383b3/supernova/utils.py#L105-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035567", "code": "def get_vertices_from_edge_list(graph, edge_list):\n    \"\"\"Transforms a list of edges into a list of the nodes those edges connect.\n    Returns a list of nodes, or an empty list if given an empty list.\n    \"\"\"\n    node_set = set()\n    for edge_id in edge_list:\n        edge = graph.get_edge(edge_id)\n        a, b = edge['vertices']\n        node_set.add(a)\n        node_set.add(b)\n\n    return list(node_set)", "entry_point": "get_vertices_from_edge_list", "input": "{'a': 1, 'b': 2}, ()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jciskey/pygraph/blob/037bb2f32503fecb60d62921f9766d54109f15e2/pygraph/helpers/functions.py#L86-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035568", "code": "def is_adjacency_matrix_symmetric(adjacency_matrix):\n    \"\"\"Determines if an adjacency matrix is symmetric.\n       Ref: http://mathworld.wolfram.com/SymmetricMatrix.html\"\"\"\n    # Verify that the matrix is square\n    num_columns = len(adjacency_matrix)\n    for column in adjacency_matrix:\n        # In a square matrix, every row should be the same length as the number of columns\n        if len(column) != num_columns:\n            return False\n\n    # Loop through the bottom half of the matrix and compare it to the top half\n    # --We do the bottom half because of how we construct adjacency matrices\n    max_i = 0\n    for j in range(num_columns):\n        for i in range(max_i):\n            # If i == j, we can skip ahead so we don't compare with ourself\n            if i == j:\n                continue\n            # Compare the value in the bottom half with the mirrored value in the top half\n            # If they aren't the same, the matrix isn't symmetric\n            if adjacency_matrix[j][i] != adjacency_matrix[i][j]:\n                return False\n        max_i += 1\n\n    # If we reach this far without returning false, then we know that everything matched,\n    # which makes this a symmetric matrix\n    return True", "entry_point": "is_adjacency_matrix_symmetric", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jciskey/pygraph/blob/037bb2f32503fecb60d62921f9766d54109f15e2/pygraph/helpers/functions.py#L163-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035569", "code": "def chunks_to_string(chunks):\n    \"\"\"\n    Parameters\n    ----------\n    chunks : list of strings\n        A list of single entities in order\n\n    Returns\n    -------\n    string :\n        A LaTeX-parsable string\n\n    Examples\n    --------\n    >>> chunks_to_string(['\\\\\\\\sum', '_', 'i', '^', 'n', 'i', '^', '2'])\n    '\\\\\\\\sum_{i}^{n}i^{2}'\n    >>> chunks_to_string(['\\\\\\\\sum', '_', '{', 'i', '}', '^', 'n', 'i', '^',\n    ...                   '2'])\n    '\\\\\\\\sum_{i}^{n}i^{2}'\n    \"\"\"\n    string = ''\n    began_context = False\n    context_depth = 0\n    context_triggers = ['_', '^']\n    for chunk in chunks:\n        if began_context and chunk != '{':\n            string += '{' + chunk + '}'\n            began_context = False\n        elif began_context and chunk == '{':\n            began_context = False\n            string += chunk\n        else:\n            if chunk in context_triggers:\n                began_context = True\n                context_depth += 1\n            string += chunk\n    return string", "entry_point": "chunks_to_string", "input": "['apple', 'banana', 'cherry']", "output": "'applebananacherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/latex.py#L104-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035570", "code": "def _get_part(pointlist, strokes):\n    \"\"\"Get some strokes of pointlist\n\n    Parameters\n    ----------\n    pointlist : list of lists of dicts\n    strokes : list of integers\n\n    Returns\n    -------\n    list of lists of dicts\n    \"\"\"\n    result = []\n    strokes = sorted(strokes)\n    for stroke_index in strokes:\n        result.append(pointlist[stroke_index])\n    return result", "entry_point": "_get_part", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/serve.py#L164-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035571", "code": "def has_missing_break(real_seg, pred_seg):\n    \"\"\"\n    Parameters\n    ----------\n    real_seg : list of integers\n        The segmentation as it should be.\n    pred_seg : list of integers\n        The predicted segmentation.\n\n    Returns\n    -------\n    bool :\n        True, if strokes of two different symbols are put in the same symbol.\n    \"\"\"\n    for symbol_pred in pred_seg:\n        for symbol_real in real_seg:\n            if symbol_pred[0] in symbol_real:\n                for stroke in symbol_pred:\n                    if stroke not in symbol_real:\n                        return True\n    return False", "entry_point": "has_missing_break", "input": "[], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/segmentation/segmentation.py#L718-L738", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035572", "code": "def has_wrong_break(real_seg, pred_seg):\n    \"\"\"\n    Parameters\n    ----------\n    real_seg : list of integers\n        The segmentation as it should be.\n    pred_seg : list of integers\n        The predicted segmentation.\n\n    Returns\n    -------\n    bool :\n        True, if strokes of one symbol were segmented to be in different\n        symbols.\n    \"\"\"\n    for symbol_real in real_seg:\n        for symbol_pred in pred_seg:\n            if symbol_real[0] in symbol_pred:\n                for stroke in symbol_real:\n                    if stroke not in symbol_pred:\n                        return True\n    return False", "entry_point": "has_wrong_break", "input": "[-1, 0, 1, 2], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/segmentation/segmentation.py#L741-L762", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035573", "code": "def _is_out_of_order(segmentation):\n    \"\"\"\n    Check if a given segmentation is out of order.\n\n    Examples\n    --------\n    >>> _is_out_of_order([[0, 1, 2, 3]])\n    False\n    >>> _is_out_of_order([[0, 1], [2, 3]])\n    False\n    >>> _is_out_of_order([[0, 1, 3], [2]])\n    True\n    \"\"\"\n    last_stroke = -1\n    for symbol in segmentation:\n        for stroke in symbol:\n            if last_stroke > stroke:\n                return True\n            last_stroke = stroke\n    return False", "entry_point": "_is_out_of_order", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/segmentation/segmentation.py#L835-L854", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035574", "code": "def get_readable_time(t):\n    \"\"\"\n    Format the time to a readable format.\n\n    Parameters\n    ----------\n    t : int\n        Time in ms\n\n    Returns\n    -------\n    string\n        The time splitted to highest used time (minutes, hours, ...)\n    \"\"\"\n    ms = t % 1000\n    t -= ms\n    t /= 1000\n\n    s = t % 60\n    t -= s\n    t /= 60\n\n    minutes = t % 60\n    t -= minutes\n    t /= 60\n\n    if t != 0:\n        return \"%ih, %i minutes %is %ims\" % (t, minutes, s, ms)\n    elif minutes != 0:\n        return \"%i minutes %is %ims\" % (minutes, s, ms)\n    elif s != 0:\n        return \"%is %ims\" % (s, ms)\n    else:\n        return \"%ims\" % ms", "entry_point": "get_readable_time", "input": "1", "output": "'1ms'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/utils.py#L343-L376", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035575", "code": "def prepare_table(table):\n    \"\"\"Make the table 'symmetric' where the lower left part of the matrix is\n       the reverse probability\n    \"\"\"\n    n = len(table)\n    for i, row in enumerate(table):\n        assert len(row) == n\n        for j, el in enumerate(row):\n            if i == j:\n                table[i][i] = 0.0\n            elif i > j:\n                table[i][j] = 1-table[j][i]\n    return table", "entry_point": "prepare_table", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/partitions.py#L20-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035576", "code": "def find_index(segmentation, stroke_id):\n    \"\"\"\n    >>> find_index([[0, 1, 2], [3, 4], [5, 6, 7]], 0)\n    0\n    >>> find_index([[0, 1, 2], [3, 4], [5, 6, 7]], 1)\n    0\n    >>> find_index([[0, 1, 2], [3, 4], [5, 6, 7]], 5)\n    2\n    >>> find_index([[0, 1, 2], [3, 4], [5, 6, 7]], 6)\n    2\n    \"\"\"\n    for i, symbol in enumerate(segmentation):\n        for sid in symbol:\n            if sid == stroke_id:\n                return i\n    return -1", "entry_point": "find_index", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/partitions.py#L87-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035577", "code": "def strip_end(text, suffix):\n    \"\"\"Strip `suffix` from the end of `text` if `text` has that suffix.\"\"\"\n    if not text.endswith(suffix):\n        return text\n    return text[:len(text)-len(suffix)]", "entry_point": "strip_end", "input": "'walnut thistle harbour', 'a,b,c'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/datasets/mfrdb.py#L91-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035578", "code": "def _get_colors(segmentation):\n    \"\"\"Get a list of colors which is as long as the segmentation.\n\n    Parameters\n    ----------\n    segmentation : list of lists\n\n    Returns\n    -------\n    list\n        A list of colors.\n    \"\"\"\n    symbol_count = len(segmentation)\n    num_colors = symbol_count\n\n    # See http://stackoverflow.com/a/20298116/562769\n    color_array = [\n        \"#000000\", \"#FFFF00\", \"#1CE6FF\", \"#FF34FF\", \"#FF4A46\", \"#008941\",\n        \"#006FA6\", \"#A30059\", \"#FFDBE5\", \"#7A4900\", \"#0000A6\", \"#63FFAC\",\n        \"#B79762\", \"#004D43\", \"#8FB0FF\", \"#997D87\", \"#5A0007\", \"#809693\",\n        \"#FEFFE6\", \"#1B4400\", \"#4FC601\", \"#3B5DFF\", \"#4A3B53\", \"#FF2F80\",\n        \"#61615A\", \"#BA0900\", \"#6B7900\", \"#00C2A0\", \"#FFAA92\", \"#FF90C9\",\n        \"#B903AA\", \"#D16100\", \"#DDEFFF\", \"#000035\", \"#7B4F4B\", \"#A1C299\",\n        \"#300018\", \"#0AA6D8\", \"#013349\", \"#00846F\", \"#372101\", \"#FFB500\",\n        \"#C2FFED\", \"#A079BF\", \"#CC0744\", \"#C0B9B2\", \"#C2FF99\", \"#001E09\",\n        \"#00489C\", \"#6F0062\", \"#0CBD66\", \"#EEC3FF\", \"#456D75\", \"#B77B68\",\n        \"#7A87A1\", \"#788D66\", \"#885578\", \"#FAD09F\", \"#FF8A9A\", \"#D157A0\",\n        \"#BEC459\", \"#456648\", \"#0086ED\", \"#886F4C\",\n\n        \"#34362D\", \"#B4A8BD\", \"#00A6AA\", \"#452C2C\", \"#636375\", \"#A3C8C9\",\n        \"#FF913F\", \"#938A81\", \"#575329\", \"#00FECF\", \"#B05B6F\", \"#8CD0FF\",\n        \"#3B9700\", \"#04F757\", \"#C8A1A1\", \"#1E6E00\", \"#7900D7\", \"#A77500\",\n        \"#6367A9\", \"#A05837\", \"#6B002C\", \"#772600\", \"#D790FF\", \"#9B9700\",\n        \"#549E79\", \"#FFF69F\", \"#201625\", \"#72418F\", \"#BC23FF\", \"#99ADC0\",\n        \"#3A2465\", \"#922329\", \"#5B4534\", \"#FDE8DC\", \"#404E55\", \"#0089A3\",\n        \"#CB7E98\", \"#A4E804\", \"#324E72\", \"#6A3A4C\", \"#83AB58\", \"#001C1E\",\n        \"#D1F7CE\", \"#004B28\", \"#C8D0F6\", \"#A3A489\", \"#806C66\", \"#222800\",\n        \"#BF5650\", \"#E83000\", \"#66796D\", \"#DA007C\", \"#FF1A59\", \"#8ADBB4\",\n        \"#1E0200\", \"#5B4E51\", \"#C895C5\", \"#320033\", \"#FF6832\", \"#66E1D3\",\n        \"#CFCDAC\", \"#D0AC94\", \"#7ED379\", \"#012C58\"]\n\n    # Apply a little trick to make sure we have enough colors, no matter\n    # how many symbols are in one recording.\n    # This simply appends the color array as long as necessary to get enough\n    # colors\n    new_array = color_array[:]\n    while len(new_array) <= num_colors:\n        new_array += color_array\n\n    return new_array[:num_colors]", "entry_point": "_get_colors", "input": "['a', 'b', 'c']", "output": "['#000000', '#FFFF00', '#1CE6FF']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/handwritten_data.py#L352-L401", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035579", "code": "def _add_indent(string, indent):\n    \"\"\"Add indent of ``indent`` spaces to ``string.split(\"\\n\")[1:]``\n\n    Useful for formatting in strings to already indented blocks\n    \"\"\"\n    lines = string.split(\"\\n\")\n    first, lines = lines[0], lines[1:]\n    lines = [\"{indent}{s}\".format(indent=\" \" * indent, s=s)\n             for s in lines]\n    lines = [first] + lines\n    return \"\\n\".join(lines)", "entry_point": "_add_indent", "input": "'a,b,c', [5, 3, 1, 4]", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hfaran/Tornado-JSON/blob/8d8b35ff77f13cb3ab1a606bd2083b26cc69c54f/tornado_json/api_doc_gen.py#L111-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035580", "code": "def convert_destination_to_id(destination_node, destination_port, nodes):\n        \"\"\"\n        Convert a destination to device and port ID\n\n        :param str destination_node: Destination node name\n        :param str destination_port: Destination port name\n        :param list nodes: list of nodes from :py:meth:`generate_nodes`\n        :return: dict containing device ID, device name and port ID\n        :rtype: dict\n        \"\"\"\n        device_id = None\n        device_name = None\n        port_id = None\n        if destination_node != 'NIO':\n            for node in nodes:\n                if destination_node == node['properties']['name']:\n                    device_id = node['id']\n                    device_name = destination_node\n                    for port in node['ports']:\n                        if destination_port == port['name']:\n                            port_id = port['id']\n                            break\n                    break\n        else:\n            for node in nodes:\n                if node['type'] == 'Cloud':\n                    for port in node['ports']:\n                        if destination_port.lower() == port['name'].lower():\n                            device_id = node['id']\n                            device_name = node['properties']['name']\n                            port_id = port['id']\n                            break\n\n        info = {'id': device_id,\n                'name': device_name,\n                'pid': port_id}\n        return info", "entry_point": "convert_destination_to_id", "input": "'', (), set()", "output": "{'id': None, 'name': None, 'pid': None}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dlintott/gns3-converter/blob/acbc55da51de86388dc5b5f6da55809b3c86b7ca/gns3converter/converter.py#L356-L392", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035581", "code": "def get_node_name_from_id(node_id, nodes):\n        \"\"\"\n        Get the name of a node when given the node_id\n\n        :param int node_id: The ID of a node\n        :param list nodes: list of nodes from :py:meth:`generate_nodes`\n        :return: node name\n        :rtype: str\n        \"\"\"\n        node_name = ''\n        for node in nodes:\n            if node['id'] == node_id:\n                node_name = node['properties']['name']\n                break\n        return node_name", "entry_point": "get_node_name_from_id", "input": "['a', 'b', 'c'], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dlintott/gns3-converter/blob/acbc55da51de86388dc5b5f6da55809b3c86b7ca/gns3converter/converter.py#L395-L409", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035582", "code": "def get_port_name_from_id(node_id, port_id, nodes):\n        \"\"\"\n        Get the name of a port for a given node and port ID\n\n        :param int node_id: node ID\n        :param int port_id: port ID\n        :param list nodes: list of nodes from :py:meth:`generate_nodes`\n        :return: port name\n        :rtype: str\n        \"\"\"\n        port_name = ''\n        for node in nodes:\n            if node['id'] == node_id:\n                for port in node['ports']:\n                    if port['id'] == port_id:\n                        port_name = port['name']\n                        break\n        return port_name", "entry_point": "get_port_name_from_id", "input": "'  padded  ', 3.25, ''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dlintott/gns3-converter/blob/acbc55da51de86388dc5b5f6da55809b3c86b7ca/gns3converter/converter.py#L412-L429", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035583", "code": "def generate_shapes(shapes):\n        \"\"\"\n        Generate the shapes for the topology\n\n        :param dict shapes: A dict of converted shapes from the old topology\n        :return: dict containing two lists (ellipse, rectangle)\n        :rtype: dict\n        \"\"\"\n        new_shapes = {'ellipse': [], 'rectangle': []}\n\n        for shape in shapes:\n            tmp_shape = {}\n            for shape_item in shapes[shape]:\n                if shape_item != 'type':\n                    tmp_shape[shape_item] = shapes[shape][shape_item]\n\n            new_shapes[shapes[shape]['type']].append(tmp_shape)\n\n        return new_shapes", "entry_point": "generate_shapes", "input": "set()", "output": "{'ellipse': [], 'rectangle': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dlintott/gns3-converter/blob/acbc55da51de86388dc5b5f6da55809b3c86b7ca/gns3converter/converter.py#L467-L485", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035584", "code": "def _resolve_subkeys(key, separator='.'):\n    \"\"\"Given a key which may actually be a nested key, return the top level\n    key and any nested subkeys as separate values.\n\n    Args:\n        key (str): A string that may or may not contain the separator.\n        separator (str): The namespace separator. Defaults to `.`.\n\n    Returns:\n        Tuple[str, str]: The key and subkey(s).\n    \"\"\"\n    subkey = None\n    if separator in key:\n        index = key.index(separator)\n        subkey = key[index + 1:]\n        key = key[:index]\n    return key, subkey", "entry_point": "_resolve_subkeys", "input": "['apple', 'banana', 'cherry'], 'a,b,c'", "output": "(['apple', 'banana', 'cherry'], None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleapis/gax-python/blob/309aedfcfd48e4c8fa22dd60e9c84c3cc71bb20e/google/gax/utils/protobuf.py#L175-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035585", "code": "def value_for_keypath(dict, keypath):\n    \"\"\"\n    Returns the value of a keypath in a dictionary\n    if the keypath exists or None if the keypath\n    does not exist.\n    \"\"\"\n\n    if len(keypath) == 0:\n        return dict\n\n    keys = keypath.split('.')\n    value = dict\n    for key in keys:\n        if key in value:\n            value = value[key]\n        else:\n            return None\n\n    return value", "entry_point": "value_for_keypath", "input": "{1, 2, 3}, {}", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ambitioninc/django-query-builder/blob/113a7d845d3ddc6a45621b9880308e756f87c5bf/querybuilder/helpers.py#L1-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035586", "code": "def get_11u_advert(_, data):\n    \"\"\"http://git.kernel.org/cgit/linux/kernel/git/jberg/iw.git/tree/scan.c?id=v3.17#n676.\n\n    Positional arguments:\n    data -- bytearray data to read.\n\n    Returns:\n    Dict.\n    \"\"\"\n    answers = dict()\n    idx = 0\n    while idx < len(data) - 1:\n        qri = data[idx]\n        proto_id = data[idx + 1]\n        answers['Query Response Info'] = qri\n        answers['Query Response Length Limit'] = qri & 0x7f\n        if qri & (1 << 7):\n            answers['PAME-BI'] = True\n        answers['proto_id'] = {0: 'ANQP', 1: 'MIH Information Service', 3: 'Emergency Alert System (EAS)',\n                               2: 'MIH Command and Event Services Capability Discovery',\n                               221: 'Vendor Specific'}.get(proto_id, 'Reserved: {0}'.format(proto_id))\n        idx += 2\n    return answers", "entry_point": "get_11u_advert", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "{'Query Response Info': 1, 'Query Response Length Limit': 1, 'PAME-BI': True, 'proto_id': 'MIH Command and Event Services Capability Discovery'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl80211/iw_scan.py#L306-L328", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035587", "code": "def get_tim(_, data):\n    \"\"\"http://git.kernel.org/cgit/linux/kernel/git/jberg/iw.git/tree/scan.c?id=v3.17#n874.\n\n    Positional arguments:\n    data -- bytearray data to read.\n\n    Returns:\n    Dict.\n    \"\"\"\n    answers = {\n        'DTIM Count': data[0],\n        'DTIM Period': data[1],\n        'Bitmap Control': data[2],\n        'Bitmap[0]': data[3],\n    }\n    if len(data) - 4:\n        answers['+ octets'] = len(data) - 4\n    return answers", "entry_point": "get_tim", "input": "[], [5, 3, 1, 4]", "output": "{'DTIM Count': 5, 'DTIM Period': 3, 'Bitmap Control': 1, 'Bitmap[0]': 4}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl80211/iw_scan.py#L439-L456", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035588", "code": "def compute_files_to_download(client_hashes, server_hashes):\n    \"\"\"\n    Given a dictionary of file hashes from the client and the\n    server, specify which files should be downloaded from the server\n\n    :param client_hashes: a dictionary where the filenames are keys and the\n                          values are md5 hashes as strings\n    :param server_hashes: a dictionary where the filenames are keys and the\n                          values are md5 hashes as strings\n    :return: a list of 2 lists -> [to_dload, to_delete]\n             to_dload- a list of filenames to get from the server\n             to_delete- a list of filenames to delete from the folder\n\n    Note: we will get a file from the server if a) it is not on the\n    client or b) the md5 differs between the client and server\n\n    Note: we will mark a file for deletion if it is not available on\n    the server\n\n    \"\"\"\n    to_dload, to_delete = [], []\n    for filename in server_hashes:\n        if filename not in client_hashes:\n            to_dload.append(filename)\n            continue\n        if client_hashes[filename] != server_hashes[filename]:\n            to_dload.append(filename)\n\n    for filename in client_hashes:\n        if filename not in server_hashes:\n            to_delete.append(filename)\n\n    return [to_dload, to_delete]", "entry_point": "compute_files_to_download", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "[[1, 2, 3], [[1, 2], [3], []]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/iclab/centinel/blob/9a25dcf30c6a1db3c046f7ccb8ab8873e455c1a4/centinel/utils.py#L58-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035589", "code": "def cap(v, l):\n    \"\"\"Shortens string is above certain length.\"\"\"\n    s = str(v)\n    return s if len(s) <= l else s[-l:]", "entry_point": "cap", "input": "('a', 'b', 'c'), False", "output": "\"('a', 'b', 'c')\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/base_ampal.py#L16-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035590", "code": "def generate_antisense_sequence(sequence):\n    \"\"\"Creates the antisense sequence of a DNA strand.\"\"\"\n    dna_antisense = {\n        'A': 'T',\n        'T': 'A',\n        'C': 'G',\n        'G': 'C'\n    }\n    antisense = [dna_antisense[x] for x in sequence[::-1]]\n    return ''.join(antisense)", "entry_point": "generate_antisense_sequence", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py#L9-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035591", "code": "def find_ss_regions(dssp_residues):\n    \"\"\"Separates parsed DSSP data into groups of secondary structure.\n\n    Notes\n    -----\n    Example: all residues in a single helix/loop/strand will be gathered\n    into a list, then the next secondary structure element will be\n    gathered into a separate list, and so on.\n\n    Parameters\n    ----------\n    dssp_residues : [list]\n        Each internal list contains:\n            [0] int Residue number\n            [1] str Secondary structure type\n            [2] str Chain identifier\n            [3] str Residue type\n            [4] float Phi torsion angle\n            [5] float Psi torsion angle\n\n    Returns\n    -------\n    fragments : [[list]]\n        Lists grouped in continuous regions of secondary structure.\n        Innermost list has the same format as above.\n    \"\"\"\n\n    loops = [' ', 'B', 'S', 'T']\n    current_ele = None\n    fragment = []\n    fragments = []\n    first = True\n    for ele in dssp_residues:\n        if first:\n            first = False\n            fragment.append(ele)\n        elif current_ele in loops:\n            if ele[1] in loops:\n                fragment.append(ele)\n            else:\n                fragments.append(fragment)\n                fragment = [ele]\n        else:\n            if ele[1] == current_ele:\n                fragment.append(ele)\n            else:\n                fragments.append(fragment)\n                fragment = [ele]\n        current_ele = ele[1]\n    return fragments", "entry_point": "find_ss_regions", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/dssp.py#L286-L335", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035592", "code": "def http_signature(message, key_id, signature):\n    \"\"\"Return a tuple (message signature, HTTP header message signature).\"\"\"\n    template = ('Signature keyId=\"%(keyId)s\",algorithm=\"hmac-sha256\",'\n                'headers=\"%(headers)s\",signature=\"%(signature)s\"')\n    headers = ['(request-target)', 'host', 'accept', 'date']\n    return template % {\n        'keyId': key_id,\n        'signature': signature,\n        'headers': ' '.join(headers),\n    }", "entry_point": "http_signature", "input": "['a', 'b', 'c'], [-1, 0, 1, 2], ['a', 'b', 'c']", "output": "'Signature keyId=\"[-1, 0, 1, 2]\",algorithm=\"hmac-sha256\",headers=\"(request-target) host accept date\",signature=\"[\\'a\\', \\'b\\', \\'c\\']\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etoccalino/django-rest-framework-httpsignature/blob/03ac3c213153ae6084c84b8ff61e101798b342a4/utils/sign3.py#L29-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035593", "code": "def format_last_online(last_online):\n    \"\"\"\n    Return the upper limit in seconds that a profile may have been\n    online. If last_online is an int, return that int. Otherwise if\n    last_online is a str, convert the string into an int.\n    Returns\n    ----------\n    int\n    \"\"\"\n    if isinstance(last_online, str):\n        if last_online.lower() in ('day', 'today'):\n            last_online_int = 86400  # 3600 * 24\n        elif last_online.lower() == 'week':\n            last_online_int = 604800  # 3600 * 24 * 7\n        elif last_online.lower() == 'month':\n            last_online_int = 2678400  # 3600 * 24 * 31\n        elif last_online.lower() == 'year':\n            last_online_int = 31536000  # 3600 * 365\n        elif last_online.lower() == 'decade':\n            last_online_int = 315360000  # 3600 * 365 * 10\n        else: # Defaults any other strings to last hour\n            last_online_int = 3600\n    else:\n        last_online_int = last_online\n    return last_online_int", "entry_point": "format_last_online", "input": "'  padded  '", "output": "3600", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IvanMalison/okcupyd/blob/46f4eaa9419098f6c299738ce148af55c64deb64/okcupyd/helpers.py#L210-L234", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035594", "code": "def split_package(package):\n    \"\"\"\n    Split package in name, version\n    arch and build tag.\n    \"\"\"\n    name = ver = arch = build = []\n    split = package.split(\"-\")\n    if len(split) > 2:\n        build = split[-1]\n        build_a, build_b = \"\", \"\"\n        build_a = build[:1]\n        if build[1:2].isdigit():\n            build_b = build[1:2]\n        build = build_a + build_b\n        arch = split[-2]\n        ver = split[-3]\n        name = \"-\".join(split[:-3])\n    return [name, ver, arch, build]", "entry_point": "split_package", "input": "'  padded  '", "output": "[[], [], [], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/splitting.py#L25-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035595", "code": "def remove_repositories(repositories, default_repositories):\n    \"\"\"\n    Remove no default repositories\n    \"\"\"\n    repos = []\n    for repo in repositories:\n        if repo in default_repositories:\n            repos.append(repo)\n    return repos", "entry_point": "remove_repositories", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/__metadata__.py#L28-L36", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035596", "code": "def grab_sub_repo(repositories, repos):\n    \"\"\"\n    Grab SUB_REPOSITORY\n    \"\"\"\n    for i, repo in enumerate(repositories):\n        if repos in repo:\n            sub = repositories[i].replace(repos, \"\")\n            repositories[i] = repos\n            return sub\n    return \"\"", "entry_point": "grab_sub_repo", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/__metadata__.py#L55-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035597", "code": "def units(comp_sum, uncomp_sum):\n    \"\"\"Calculate package size\n    \"\"\"\n    compressed = round((sum(map(float, comp_sum)) / 1024), 2)\n    uncompressed = round((sum(map(float, uncomp_sum)) / 1024), 2)\n    comp_unit = uncomp_unit = \"Mb\"\n    if compressed > 1024:\n        compressed = round((compressed / 1024), 2)\n        comp_unit = \"Gb\"\n    if uncompressed > 1024:\n        uncompressed = round((uncompressed / 1024), 2)\n        uncomp_unit = \"Gb\"\n    if compressed < 1:\n        compressed = sum(map(int, comp_sum))\n        comp_unit = \"Kb\"\n    if uncompressed < 1:\n        uncompressed = sum(map(int, uncomp_sum))\n        uncomp_unit = \"Kb\"\n    return [comp_unit, uncomp_unit], [compressed, uncompressed]", "entry_point": "units", "input": "set(), [-1, 0, 1, 2]", "output": "(['Kb', 'Kb'], [0, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sizes.py#L25-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035598", "code": "def humanize_bandwidth(bits):\n    '''\n    Accept some number of bits/sec (i.e., a link capacity) as an\n    integer, and return a string representing a 'human'(-like)\n    representation of the capacity, e.g., 10 Mb/s, 1.5 Mb/s,\n    900 Gb/s.\n\n    As is the standard in networking, capacity values are assumed\n    to be base-10 values (not base 2), so 1000 is 1 Kb/s.\n    '''\n    unit = ''\n    divisor = 1\n    if bits < 1000:\n        unit = 'bits'\n        divisor = 1\n    elif bits < 1000000:\n        unit = 'Kb'\n        divisor = 1000\n    elif bits < 1000000000:\n        unit = 'Mb'\n        divisor = 1000000\n    elif bits < 1000000000000:\n        unit = 'Gb'\n        divisor = 1000000000\n    elif bits < 1000000000000000:\n        unit = 'Tb'\n        divisor = 1000000000000\n    else:\n        raise Exception(\"Can't humanize that many bits.\")\n\n    if bits % divisor == 0:\n        value = int(bits/divisor)\n    else:\n        value = bits/divisor\n\n    return \"{} {}/s\".format(value, unit)", "entry_point": "humanize_bandwidth", "input": "False", "output": "'0 bits/s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsommers/switchyard/blob/fdcb3869c937dcedbd6ea7a7822ebd412bf1e2b0/switchyard/lib/topo/util.py#L3-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035599", "code": "def humanize_delay(delay):\n    '''\n    Accept a floating point number presenting link propagation delay\n    in seconds (e.g., 0.1 for 100 milliseconds delay), and return\n    a human(-like) string like '100 milliseconds'.  Handles values as \n    small as 1 microsecond, but no smaller.\n\n    Because of imprecision in floating point numbers, a relatively easy\n    way to handle this is to convert to string, then slice out sections.\n    '''\n    delaystr = '{:1.06f}'.format(delay) \n    decimal = delaystr.find('.') \n    seconds = int(delaystr[:decimal])\n    millis = int(delaystr[-6:-3])\n    micros = int(delaystr[-3:])\n    # print (delay,delaystr,seconds,millis,micros)\n    units = ''\n    microsecs = micros + 1e3 * millis + 1e6 * seconds\n    if micros > 0:\n        units = ' \\u00B5sec'\n        value = int(microsecs)\n    elif millis > 0:\n        units = ' msec'\n        value = int(microsecs / 1000)\n    elif seconds > 0:\n        units = ' sec'\n        value = int(microsecs / 1000000)\n    else:\n        units = ' sec'\n        value = delay\n    if value > 1:\n        units += 's'\n    return '{}{}'.format(value, units)", "entry_point": "humanize_delay", "input": "3", "output": "'3 secs'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsommers/switchyard/blob/fdcb3869c937dcedbd6ea7a7822ebd412bf1e2b0/switchyard/lib/topo/util.py#L78-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035600", "code": "def _unpack_bitmap(bitmap, xenum):\n    '''\n    Given an integer bitmap and an enumerated type, build\n    a set that includes zero or more enumerated type values\n    corresponding to the bitmap.\n    '''\n    unpacked = set()\n    for enval in xenum:\n        if enval.value & bitmap == enval.value:\n            unpacked.add(enval)\n    return unpacked", "entry_point": "_unpack_bitmap", "input": "'abc', ()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsommers/switchyard/blob/fdcb3869c937dcedbd6ea7a7822ebd412bf1e2b0/switchyard/lib/openflow/openflow10.py#L21-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035601", "code": "def _parse_codeargs(argstr):\n    '''\n    Parse and clean up argument to user code; separate *args from\n    **kwargs.\n    '''\n    args = []\n    kwargs = {}\n    if isinstance(argstr, str):\n        for a in argstr.split():\n            if '=' in a:\n                k,attr = a.split('=')\n                kwargs[k] = attr\n            else:\n                args.append(a)\n    rd = {'args':args, 'kwargs':kwargs}\n    return rd", "entry_point": "_parse_codeargs", "input": "[5, 3, 1, 4]", "output": "{'args': [], 'kwargs': {}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsommers/switchyard/blob/fdcb3869c937dcedbd6ea7a7822ebd412bf1e2b0/switchyard/syinit.py#L24-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035602", "code": "def infer_netmask (addr):\n  \"\"\"\n  Uses network classes to guess the number of network bits\n  \"\"\"\n  addr = int(addr)\n  if addr == 0:\n    # Special case -- default network\n    return 32-32 # all bits wildcarded\n  if (addr & (1 << 31)) == 0:\n    # Class A\n    return 32-24\n  if (addr & (3 << 30)) == 2 << 30:\n    # Class B\n    return 32-16\n  if (addr & (7 << 29)) == 6 << 29:\n    # Class C\n    return 32-8\n  if (addr & (15 << 28)) == 14 << 28:\n    # Class D (Multicast)\n    return 32-0 # exact match\n  # Must be a Class E (Experimental)\n  return 32-0", "entry_point": "infer_netmask", "input": "-1.5", "output": "32", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsommers/switchyard/blob/fdcb3869c937dcedbd6ea7a7822ebd412bf1e2b0/switchyard/lib/address/__init__.py#L266-L287", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035603", "code": "def _geom_series_uint32(r, n):\n    \"\"\"Unsigned integer calculation of sum of geometric series:\n    1 + r + r^2 + r^3 + ... r^(n-1)\n    summed to n terms.\n    Calculated modulo 2**32.\n    Use the formula (r**n - 1) / (r - 1)\n    \"\"\"\n    if n == 0:\n        return 0\n    if n == 1 or r == 0:\n        return 1\n    m = 2**32\n    # Split (r - 1) into common factors with the modulo 2**32 -- i.e. all\n    # factors of 2; and other factors which are coprime with the modulo 2**32.\n    other_factors = r - 1\n    common_factor = 1\n    while (other_factors % 2) == 0:\n        other_factors //= 2\n        common_factor *= 2\n    other_factors_inverse = pow(other_factors, m - 1, m)\n    numerator = pow(r, n, common_factor * m) - 1\n    return (numerator // common_factor * other_factors_inverse) % m", "entry_point": "_geom_series_uint32", "input": "2.0, True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cmcqueen/simplerandom/blob/3f19ffdfeaa8256986adf7173f08c1c719164d01/python/python2/simplerandom/iterators/_iterators_py.py#L72-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035604", "code": "def _get_numbering(document, numid, ilvl):\n    \"\"\"Returns type for the list.\n\n    :Returns:\n      Returns type for the list. Returns \"bullet\" by default or in case of an error.\n    \"\"\"\n\n    try:\n        abs_num = document.numbering[numid]\n        return document.abstruct_numbering[abs_num][ilvl]['numFmt']\n    except:\n        return 'bullet'", "entry_point": "_get_numbering", "input": "[5, 3, 1, 4], 3, [5, 3, 1, 4]", "output": "'bullet'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/booktype/python-ooxml/blob/b56990a5bee2e1bc46839cec5161ff3726dc4d87/ooxml/serialize.py#L74-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035605", "code": "def text_length(elem):\n    \"\"\"Returns length of the content in this element.\n\n    Return value is not correct but it is **good enough***.\n    \"\"\"\n\n    if not elem:\n        return 0\n\n    value = elem.value()\n\n    try:\n        value = len(value)\n    except:\n        value = 0\n\n    try:\n        for a in elem.elements:\n            value += len(a.value())\n    except:\n        pass\n\n    return value", "entry_point": "text_length", "input": "{}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/booktype/python-ooxml/blob/b56990a5bee2e1bc46839cec5161ff3726dc4d87/ooxml/importer.py#L21-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035606", "code": "def get_calculatable_quantities(inputs, methods):\n    '''\n    Given an interable of input quantity names and a methods dictionary,\n    returns a list of output quantities that can be calculated.\n    '''\n    output_quantities = []\n    updated = True\n    while updated:\n        updated = False\n        for output in methods.keys():\n            if output in output_quantities or output in inputs:\n                # we already know we can calculate this\n                continue\n            for args, func in methods[output].items():\n                if all([arg in inputs or arg in output_quantities\n                        for arg in args]):\n                    output_quantities.append(output)\n                    updated = True\n                    break\n    return tuple(output_quantities) + tuple(inputs)", "entry_point": "get_calculatable_quantities", "input": "{'x': [1, 2], 'y': []}, {'x': [1, 2], 'y': []}", "output": "('x', 'y')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/atmos-python/atmos/blob/f4af8eaca23cce881bde979599d15d322fc1935e/atmos/solve.py#L32-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035607", "code": "def _parse_boolean(value, default=False):\n    \"\"\"\n    Attempt to cast *value* into a bool, returning *default* if it fails.\n    \"\"\"\n    if value is None:\n        return default\n    try:\n        return bool(value)\n    except ValueError:\n        return default", "entry_point": "_parse_boolean", "input": "[], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RealTimeWeb/datasets/blob/2fe5befd251c783744d000bd4763e277616a152f/preprocess/earthquakes/earthquakes.py#L62-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035608", "code": "def remove_out_of_bounds_bins(df, chromosome_size):\n    # type: (pd.DataFrame, int) -> pd.DataFrame\n    \"\"\"Remove all reads that were shifted outside of the genome endpoints.\"\"\"\n\n    # The dataframe is empty and contains no bins out of bounds\n    if \"Bin\" not in df:\n        return df\n\n    df = df.drop(df[df.Bin > chromosome_size].index)\n\n    return df.drop(df[df.Bin < 0].index)", "entry_point": "remove_out_of_bounds_bins", "input": "[-1, 0, 1, 2], 10", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore-ntnu/epic/blob/ed0024939ec6182a0a39d59d845ff14a4889a6ef/epic/windows/count/remove_out_of_bounds_bins.py#L3-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035609", "code": "def get_closest_readlength(estimated_readlength):\n    # type: (int) -> int\n    \"\"\"Find the predefined readlength closest to the estimated readlength.\n\n    In the case of a tie, choose the shortest readlength.\"\"\"\n\n    readlengths = [36, 50, 75, 100]\n    differences = [abs(r - estimated_readlength) for r in readlengths]\n    min_difference = min(differences)\n    index_of_min_difference = [i\n                               for i, d in enumerate(differences)\n                               if d == min_difference][0]\n\n    return readlengths[index_of_min_difference]", "entry_point": "get_closest_readlength", "input": "3", "output": "36", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocore-ntnu/epic/blob/ed0024939ec6182a0a39d59d845ff14a4889a6ef/epic/utils/find_readlength.py#L58-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035610", "code": "def split(examples, ratio=0.8):\n        \"\"\"\n        Utility function that can be used within the parse() implementation of\n        sub classes to split a list of example into two lists for training and\n        testing.\n        \"\"\"\n        split = int(ratio * len(examples))\n        return examples[:split], examples[split:]", "entry_point": "split", "input": "[[1, 2], [3], []], -1.5", "output": "([], [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danijar/layered/blob/c1c09d95f90057a91ae24c80b74f415680b97338/layered/dataset.py#L62-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035611", "code": "def median(numbers):\n    \"\"\"\n    Return the median of the list of numbers.\n    see: http://mail.python.org/pipermail/python-list/2004-December/294990.html\n    \"\"\"\n\n    # Sort the list and take the middle element.\n    n = len(numbers)\n    copy = sorted(numbers)\n    if n & 1:  # There is an odd number of elements\n        return copy[n // 2]\n    else:\n        return (copy[n // 2 - 1] + copy[n // 2]) / 2.0", "entry_point": "median", "input": "[-1, 0, 1, 2]", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/exhuma/python-cluster/blob/4c0ac14d9beafcd51f0d849151514083c296402f/cluster/util.py#L66-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035612", "code": "def dotproduct(a, b):\n    \"Calculates the dotproduct between two vecors\"\n    assert(len(a) == len(b))\n    out = 0\n    for i in range(len(a)):\n        out += a[i] * b[i]\n    return out", "entry_point": "dotproduct", "input": "[], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/exhuma/python-cluster/blob/4c0ac14d9beafcd51f0d849151514083c296402f/cluster/util.py#L118-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035613", "code": "def uclus(a, b, distance_function):\n    \"\"\"\n    Given two collections ``a`` and ``b``, this will return the *median* of all\n    distances. ``distance_function`` is used to determine the distance between\n    two elements.\n\n    Example::\n\n        >>> single([1, 2], [3, 100], lambda x, y: abs(x-y))\n        2.5\n    \"\"\"\n    distances = sorted([distance_function(x, y)\n                        for x in a for y in b])\n    midpoint, rest = len(distances) // 2, len(distances) % 2\n    if not rest:\n        return sum(distances[midpoint-1:midpoint+1]) / 2\n    else:\n        return distances[midpoint]", "entry_point": "uclus", "input": "[-1, 0, 1, 2], [], ['a', 'b', 'c']", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/exhuma/python-cluster/blob/4c0ac14d9beafcd51f0d849151514083c296402f/cluster/linkage.py#L83-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035614", "code": "def clean_texmath(txt):\n    \"\"\"\n    clean tex math string, preserving control sequences\n    (incluing \\n, so also '\\nu') inside $ $, while allowing\n    \\n and \\t to be meaningful in the text string\n    \"\"\"\n    s = \"%s \" % txt\n    out = []\n    i = 0\n    while i < len(s)-1:\n        if s[i] == '\\\\' and s[i+1] in ('n', 't'):\n            if s[i+1] == 'n':\n                out.append('\\n')\n            elif s[i+1] == 't':\n                out.append('\\t')\n            i += 1\n        elif s[i] == '$':\n            j = s[i+1:].find('$')\n            if j < 0:\n                j = len(s)\n            out.append(s[i:j+2])\n            i += j+2\n        else:\n            out.append(s[i])\n        i += 1\n        if i > 5000:\n            break\n    return ''.join(out).strip()", "entry_point": "clean_texmath", "input": "['a', 'b', 'c']", "output": "\"['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotconfigframe.py#L53-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035615", "code": "def Nu_vertical_plate_Churchill(Pr, Gr):\n    r'''Calculates Nusselt number for natural convection around a vertical\n    plate according to the Churchill-Chu [1]_ correlation, also presented in\n    [2]_. Plate must be isothermal; an alternate expression exists for constant\n    heat flux.\n\n    .. math::\n        Nu_{L}=\\left[0.825+\\frac{0.387Ra_{L}^{1/6}}\n        {[1+(0.492/Pr)^{9/16}]^{8/27}}\\right]^2\n\n    Parameters\n    ----------\n    Pr : float\n        Prandtl number [-]\n    Gr : float\n        Grashof number [-]\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Although transition from laminar to turbulent is discrete in reality, this\n    equation provides a smooth transition in value from laminar to turbulent.\n    Checked with the original source.\n\n    Can be applied to vertical cylinders as well, subject to the criteria below:\n\n    .. math::\n        \\frac{D}{L}\\ge \\frac{35}{Gr_L^{1/4}}\n\n    Examples\n    --------\n    From [2]_, Example 9.2, matches:\n\n    >>> Nu_vertical_plate_Churchill(0.69, 2.63E9)\n    147.16185223770603\n\n    References\n    ----------\n    .. [1] Churchill, Stuart W., and Humbert H. S. Chu. \"Correlating Equations\n       for Laminar and Turbulent Free Convection from a Vertical Plate.\"\n       International Journal of Heat and Mass Transfer 18, no. 11\n       (November 1, 1975): 1323-29. doi:10.1016/0017-9310(75)90243-4.\n    .. [2] Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and\n       David P. DeWitt. Introduction to Heat Transfer. 6E. Hoboken, NJ:\n       Wiley, 2011.\n    '''\n    Ra = Pr * Gr\n    Nu = (0.825 + (0.387*Ra**(1/6.)/(1 + (0.492/Pr)**(9/16.))**(8/27.)))**2\n    return Nu", "entry_point": "Nu_vertical_plate_Churchill", "input": "10, 7", "output": "2.472265381258275", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_free_immersed.py#L45-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035616", "code": "def Nu_vertical_cylinder_Griffiths_Davis_Morgan(Pr, Gr, turbulent=None):\n    r'''Calculates Nusselt number for natural convection around a vertical\n    isothermal cylinder according to the results of [1]_ correlated by [2]_, as\n    presented in [3]_ and [4]_.\n\n    .. math::\n        Nu_H = 0.67 Ra_H^{0.25},\\; 10^{7} < Ra < 10^{9}\n\n        Nu_H = 0.0782 Ra_H^{0.357}, \\; 10^{9} < Ra < 10^{11}\n\n    Parameters\n    ----------\n    Pr : float\n        Prandtl number [-]\n    Gr : float\n        Grashof number [-]\n    turbulent : bool or None, optional\n        Whether or not to force the correlation to return the turbulent\n\t\t result; will return the laminar regime if False; leave as None for\n        automatic selection\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Cylinder of diameter 17.43 cm, length from 4.65 to 263.5 cm. Air as fluid.\n    Transition between ranges is not smooth.\n    If outside of range, no warning is given.\n\n    Examples\n    --------\n    >>> Nu_vertical_cylinder_Griffiths_Davis_Morgan(.7, 2E10)\n    327.6230596100138\n\n    References\n    ----------\n    .. [1] Griffiths, Ezer, A. H. Davis, and Great Britain. The Transmission of\n       Heat by Radiation and Convection. London: H. M. Stationery off., 1922.\n    .. [2] Morgan, V.T., The Overall Convective Heat Transfer from Smooth\n       Circular Cylinders, in Advances in Heat Transfer, eds. T.F. Irvin and\n       J.P. Hartnett, V 11, 199-264, 1975.\n    .. [3] Popiel, Czeslaw O. \"Free Convection Heat Transfer from Vertical\n       Slender Cylinders: A Review.\" Heat Transfer Engineering 29, no. 6\n       (June 1, 2008): 521-36. doi:10.1080/01457630801891557.\n    .. [4] Boetcher, Sandra K. S. \"Natural Convection Heat Transfer From\n       Vertical Cylinders.\" In Natural Convection from Circular Cylinders,\n       23-42. Springer, 2014.\n    '''\n    Ra = Pr*Gr\n    if turbulent or (Ra > 1E9 and turbulent is None):\n        Nu = 0.0782*Ra**0.357\n    else:\n        Nu = 0.67*Ra**0.25\n    return Nu", "entry_point": "Nu_vertical_cylinder_Griffiths_Davis_Morgan", "input": "False, 7, {'x': [1, 2], 'y': []}", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_free_immersed.py#L148-L204", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035617", "code": "def Nu_vertical_cylinder_Carne_Morgan(Pr, Gr, turbulent=None):\n    r'''Calculates Nusselt number for natural convection around a vertical\n    isothermal cylinder according to the results of [1]_ correlated by [2]_, as\n    presented in [3]_ and [4]_.\n\n    .. math::\n        Nu_H = 1.07 Ra_H^{0.28},\\; 2\\times 10^{6} < Ra < 2\\times 10^{8}\n\n        Nu_H = 0.152 Ra_H^{0.38},\\; 2\\times 10^{8} < Ra < 2\\times 10^{11}\n\n    Parameters\n    ----------\n    Pr : float\n        Prandtl number [-]\n    Gr : float\n        Grashof number [-]\n    turbulent : bool or None, optional\n        Whether or not to force the correlation to return the turbulent\n\t\t result; will return the laminar regime if False; leave as None for\n        automatic selection\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Cylinder of diameters 0.475 cm to 7.62 cm, L/D from 8 to 127. Isothermal\n    boundary condition was assumed, but not verified. Transition between ranges\n    is not smooth. If outside of range, no warning is given. The higher range\n    of [1]_ is not shown in [3]_, and the formula for the first is actually for\n    the second in [3]_.\n\n    Examples\n    --------\n    >>> Nu_vertical_cylinder_Carne_Morgan(.7, 2E8)\n    204.31470629065677\n\n    References\n    ----------\n    .. [1] J. B. Carne. \"LIX. Heat Loss by Natural Convection from Vertical\n       Cylinders.\" The London, Edinburgh, and Dublin Philosophical Magazine and\n       Journal of Science 24, no. 162 (October 1, 1937): 634-53.\n       doi:10.1080/14786443708565140.\n    .. [2] Morgan, V.T., The Overall Convective Heat Transfer from Smooth\n       Circular Cylinders, in Advances in Heat Transfer, eds. T.F. Irvin and\n       J.P. Hartnett, V 11, 199-264, 1975.\n    .. [3] Popiel, Czeslaw O. \"Free Convection Heat Transfer from Vertical\n       Slender Cylinders: A Review.\" Heat Transfer Engineering 29, no. 6\n       (June 1, 2008): 521-36. doi:10.1080/01457630801891557.\n    .. [4] Boetcher, Sandra K. S. \"Natural Convection Heat Transfer From\n       Vertical Cylinders.\" In Natural Convection from Circular Cylinders,\n       23-42. Springer, 2014.\n    '''\n    Ra = Pr*Gr\n    if turbulent or (Ra > 2E8 and turbulent is None):\n        return 0.152*Ra**0.38\n    else:\n        return 1.07*Ra**0.28", "entry_point": "Nu_vertical_cylinder_Carne_Morgan", "input": "True, True, True", "output": "0.152", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_free_immersed.py#L268-L327", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035618", "code": "def Nu_vertical_cylinder_Touloukian_Morgan(Pr, Gr, turbulent=None):\n    r'''Calculates Nusselt number for natural convection around a vertical\n    isothermal cylinder according to the results of [1]_ correlated by [2]_, as\n    presented in [3]_ and [4]_.\n\n    .. math::\n        Nu_H = 0.726 Ra_H^{0.25},\\; 2\\times 10^{8} < Ra < 4\\times 10^{10}\n\n        Nu_H = 0.0674 (Gr_H Pr^{1.29})^{1/3},\\; 4\\times 10^{10} < Ra < 9\\times 10^{11}\n\n    Parameters\n    ----------\n    Pr : float\n        Prandtl number [-]\n    Gr : float\n        Grashof number [-]\n    turbulent : bool or None, optional\n        Whether or not to force the correlation to return the turbulent\n\t\t result; will return the laminar regime if False; leave as None for\n        automatic selection\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Cylinder of diameters 2.75 inch, with heights of 6, 18, and 36.25 inch.\n    Temperature was controlled via multiple separately controlled heating\n    sections. Fluids were water and ethylene-glycol. Transition between ranges\n    is not smooth. If outside of range, no warning is given. [2]_, [3]_, and\n    [4]_ are in complete agreement about this formulation.\n\n    Examples\n    --------\n    >>> Nu_vertical_cylinder_Touloukian_Morgan(.7, 2E10)\n    249.72879961097854\n\n    References\n    ----------\n    .. [1] Touloukian, Y. S, George A Hawkins, and Max Jakob. Heat Transfer by\n       Free Convection from Heated Vertical Surfaces to Liquids.\n       Trans. ASME 70, 13-18 (1948).\n    .. [2] Morgan, V.T., The Overall Convective Heat Transfer from Smooth\n       Circular Cylinders, in Advances in Heat Transfer, eds. T.F. Irvin and\n       J.P. Hartnett, V 11, 199-264, 1975.\n    .. [3] Popiel, Czeslaw O. \"Free Convection Heat Transfer from Vertical\n       Slender Cylinders: A Review.\" Heat Transfer Engineering 29, no. 6\n       (June 1, 2008): 521-36. doi:10.1080/01457630801891557.\n    .. [4] Boetcher, Sandra K. S. \"Natural Convection Heat Transfer From\n       Vertical Cylinders.\" In Natural Convection from Circular Cylinders,\n       23-42. Springer, 2014.\n    '''\n    Ra = Pr*Gr\n    if turbulent or (Ra > 4E10 and turbulent is None):\n        return 0.0674*(Gr*Pr**1.29)**(1/3.)\n    else:\n        return 0.726*Ra**0.25", "entry_point": "Nu_vertical_cylinder_Touloukian_Morgan", "input": "2, 1, {1, 2, 3}", "output": "0.09080354308074752", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_free_immersed.py#L397-L455", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035619", "code": "def Nu_vertical_cylinder_McAdams_Weiss_Saunders(Pr, Gr, turbulent=None):\n    r'''Calculates Nusselt number for natural convection around a vertical\n    isothermal cylinder according to the results of [1]_ and [2]_ correlated by\n    [3]_, as presented in [4]_, [5]_, and [6]_.\n\n    .. math::\n        Nu_H = 0.59 Ra_H^{0.25},\\; 10^{4} < Ra < 10^{9}\n\n        Nu_H = 0.13 Ra_H^{1/3.},\\; 10^{9} < Ra < 10^{12}\n\n    Parameters\n    ----------\n    Pr : float\n        Prandtl number [-]\n    Gr : float\n        Grashof number [-]\n    turbulent : bool or None, optional\n        Whether or not to force the correlation to return the turbulent\n\t\t result; will return the laminar regime if False; leave as None for\n        automatic selection\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Transition between ranges is not smooth. If outside of range, no warning is\n    given. For ranges under 10^4, a graph is provided, not included here.\n\n    Examples\n    --------\n    >>> Nu_vertical_cylinder_McAdams_Weiss_Saunders(.7, 2E10)\n    313.31849434277973\n\n    References\n    ----------\n    .. [1] Weise, Rudolf. \"Warmeubergang durch freie Konvektion an\n       quadratischen Platten.\" Forschung auf dem Gebiet des Ingenieurwesens\n       A 6, no. 6 (November 1935): 281-92. doi:10.1007/BF02592565.\n    .. [2] Saunders, O. A. \"The Effect of Pressure Upon Natural Convection in\n       Air.\" Proceedings of the Royal Society of London A: Mathematical,\n       Physical and Engineering Sciences 157, no. 891 (November 2, 1936):\n       278-91. doi:10.1098/rspa.1936.0194.\n    .. [3] McAdams, William Henry. Heat Transmission. 3E. Malabar, Fla:\n       Krieger Pub Co, 1985.\n    .. [4] Morgan, V.T., The Overall Convective Heat Transfer from Smooth\n       Circular Cylinders, in Advances in Heat Transfer, eds. T.F. Irvin and\n       J.P. Hartnett, V 11, 199-264, 1975.\n    .. [5] Popiel, Czeslaw O. \"Free Convection Heat Transfer from Vertical\n       Slender Cylinders: A Review.\" Heat Transfer Engineering 29, no. 6\n       (June 1, 2008): 521-36. doi:10.1080/01457630801891557.\n    .. [6] Boetcher, Sandra K. S. \"Natural Convection Heat Transfer From\n       Vertical Cylinders.\" In Natural Convection from Circular Cylinders,\n       23-42. Springer, 2014.\n    '''\n    Ra = Pr*Gr\n    if turbulent or (Ra > 1E9 and turbulent is None):\n        return 0.13*Ra**(1/3.)\n    else:\n        return 0.59*Ra**0.25", "entry_point": "Nu_vertical_cylinder_McAdams_Weiss_Saunders", "input": "3.25, 10, [-1, 0, 1, 2]", "output": "0.414862779425894", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_free_immersed.py#L458-L518", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035620", "code": "def Nu_plate_Khan_Khan(Re, Pr, chevron_angle):\n    r'''Calculates Nusselt number for single-phase flow in a \n    Chevron-style plate heat exchanger according to [1]_.\n    \n    .. math::\n        Nu = \\left(0.0161\\frac{\\beta}{\\beta_{max}} + 0.1298\\right)\n        Re^{\\left(0.198 \\frac{\\beta}{\\beta_{max}} + 0.6398\\right)} \n        Pr^{0.35} \n                \n    Parameters\n    ----------\n    Re : float\n        Reynolds number with respect to the hydraulic diameter of the channels,\n        [-]\n    Pr : float\n        Prandtl number calculated with bulk fluid properties, [-]\n    chevron_angle : float\n        Angle of the plate corrugations with respect to the vertical axis\n        (the direction of flow if the plates were straight), between 0 and\n        90. Many plate exchangers use two alternating patterns; use their\n        average angle for that situation [degrees]\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number with respect to `Dh`, [-]\n\n    Notes\n    -----\n    The viscosity correction power is recommended to be the blanket\n    Sieder and Tate (1936) value of 0.14.\n    \n    The correlation is recommended in the range of Reynolds numbers from\n    500 to 2500, chevron angles between 30 and 60 degrees, and Prandtl\n    numbers between 3.5 and 6.\n\n    Examples\n    --------\n    >>> Nu_plate_Khan_Khan(Re=1000, Pr=4.5, chevron_angle=30)\n    38.40883639103741\n    \n    References\n    ----------\n    .. [1] Khan, T. S., M. S. Khan, Ming-C. Chyu, and Z. H. Ayub. \"Experimental\n       Investigation of Single Phase Convective Heat Transfer Coefficient in a \n       Corrugated Plate Heat Exchanger for Multiple Plate Configurations.\" \n       Applied Thermal Engineering 30, no. 8 (June 1, 2010): 1058-65.\n       https://doi.org/10.1016/j.applthermaleng.2010.01.021. \n    '''\n    beta_max = 60.\n    beta_ratio = chevron_angle/beta_max\n    Nu = (0.0161*beta_ratio + 0.1298)*Re**(0.198*beta_ratio + 0.6398)*Pr**0.35\n    return Nu", "entry_point": "Nu_plate_Khan_Khan", "input": "True, 0, -1.5", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_plate.py#L303-L355", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035621", "code": "def shell_clearance(DBundle=None, DShell=None):\n    r'''Looks up the recommended clearance between a shell and tube bundle in \n    a TEMA HX [1]. Either the bundle diameter or the shell diameter are needed \n    provided.\n\n    Parameters\n    ----------\n    DBundle : float, optional\n        Outer diameter of tube bundle, [m]\n    DShell : float, optional\n        Shell inner diameter, [m]\n\n    Returns\n    -------\n    c : float\n        Shell-tube bundle clearance, [m]\n\n    Notes\n    -----\n    Lower limits are extended up to the next limit where intermediate limits\n    are not provided. \n    \n    Examples\n    --------\n    >>> shell_clearance(DBundle=1.245)\n    0.0064\n\n    References\n    ----------\n    .. [1] Standards of the Tubular Exchanger Manufacturers Association,\n       Ninth edition, 2007, TEMA, New York.\n    '''\n    DShell_data = [(0.457, 0.0032), (1.016, 0.0048), (1.397, 0.0064),\n                   (1.778, 0.0079), (2.159, 0.0095)]\n    DBundle_data = [(0.457 - 0.0048, 0.0032), (1.016 - 0.0064, 0.0048),\n                    (1.397 - 0.0079, 0.0064), (1.778 - 0.0095, 0.0079),\n                    (2.159 - 0.011, 0.0095)]\n    if DShell:\n        for DShell_tabulated, c in DShell_data:\n            if DShell < DShell_tabulated:\n                return c\n        return 0.011\n    elif DBundle:\n        for DBundle_tabulated, c in DBundle_data:\n            if DBundle < DBundle_tabulated:\n                return c\n        return 0.011\n    else:\n        raise Exception('Either DShell or DBundle must be specified')", "entry_point": "shell_clearance", "input": "False, -1.5", "output": "0.0032", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/hx.py#L4179-L4227", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035622", "code": "def D_baffle_holes(do=None, L_unsupported=None):\n    r'''Determines the diameter of holes in baffles for tubes according to\n    TEMA [1]_. Applies for all geometries.\n\n    Parameters\n    ----------\n    do : float\n        Tube outer diameter, [m]\n    L_unsupported : float\n        Distance between tube supports, [m]\n\n    Returns\n    -------\n    dB : float\n        Baffle hole diameter, [m]\n\n    Notes\n    -----\n\n    Examples\n    --------\n    >>> D_baffle_holes(do=.0508, L_unsupported=0.75)\n    0.0516\n    >>> D_baffle_holes(do=0.01905, L_unsupported=0.3)\n    0.01985\n    >>> D_baffle_holes(do=0.01905, L_unsupported=1.5)\n    0.019450000000000002\n\n    References\n    ----------\n    .. [1] Standards of the Tubular Exchanger Manufacturers Association,\n       Ninth edition, 2007, TEMA, New York.\n    '''\n    if do > 0.0318 or L_unsupported <= 0.914: # 1-1/4 inches and 36 inches\n        extra = 0.0008\n    else:\n        extra = 0.0004\n    d = do + extra\n    return d", "entry_point": "D_baffle_holes", "input": "10, {1, 2, 3}", "output": "10.0008", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/hx.py#L4320-L4358", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035623", "code": "def turbulent_Friend_Metzner(Re, Pr, fd):\n    r'''Calculates internal convection Nusselt number for turbulent flows\n    in pipe according to [2]_ as in [1]_.\n\n    .. math::\n        Nu = \\frac{(f/8)RePr}{1.2 + 11.8(f/8)^{0.5}(Pr-1)Pr^{-1/3}}\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number, [-]\n    Pr : float\n        Prandtl number, [-]\n    fd : float\n        Darcy friction factor [-]\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Range according to [1]_ 50 < Pr \u2264 600  and 5*10^4 \u2264 Re \u2264 5*10^6.\n    The extreme limits on range should be considered!\n\n    Examples\n    --------\n    >>> turbulent_Friend_Metzner(Re=1E5, Pr=100., fd=0.0185)\n    1738.3356262055322\n\n    References\n    ----------\n    .. [1] Rohsenow, Warren and James Hartnett and Young Cho. Handbook of Heat\n       Transfer, 3E. New York: McGraw-Hill, 1998.\n    .. [2] Friend, W. L., and A. B. Metzner. \u201cTurbulent Heat Transfer inside\n       Tubes and the Analogy among Heat, Mass, and Momentum Transfer.\u201d AIChE\n       Journal 4, no. 4 (December 1, 1958): 393-402. doi:10.1002/aic.690040404.\n    '''\n    return (fd/8.)*Re*Pr/(1.2 + 11.8*(fd/8.)**0.5*(Pr - 1.)*Pr**(-1/3.))", "entry_point": "turbulent_Friend_Metzner", "input": "False, True, 2.0", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_internal.py#L592-L631", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035624", "code": "def turbulent_Webb(Re, Pr, fd):\n    r'''Calculates internal convection Nusselt number for turbulent flows\n    in pipe according to [2]_ as in [1]_.\n\n    .. math::\n        Nu = \\frac{(f/8)RePr}{1.07 + 9(f/8)^{0.5}(Pr-1)Pr^{1/4}}\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number, [-]\n    Pr : float\n        Prandtl number, [-]\n    fd : float\n        Darcy friction factor [-]\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number, [-]\n\n    Notes\n    -----\n    Range according to [1]_ is 0.5 < Pr \u2264 100  and 10^4 \u2264 Re \u2264 5*10^6\n\n    Examples\n    --------\n    >>> turbulent_Webb(Re=1E5, Pr=1.2, fd=0.0185)\n    239.10130376815872\n\n    References\n    ----------\n    .. [1] Rohsenow, Warren and James Hartnett and Young Cho. Handbook of Heat\n       Transfer, 3E. New York: McGraw-Hill, 1998.\n    .. [2] Webb, Dr R. L. \u201cA Critical Evaluation of Analytical Solutions and\n       Reynolds Analogy Equations for Turbulent Heat and Mass Transfer in\n       Smooth Tubes.\u201d W\u00e4rme - Und Stoff\u00fcbertragung 4, no. 4\n       (December 1, 1971): 197\u2013204. doi:10.1007/BF01002474.\n    '''\n    return (fd/8.)*Re*Pr/(1.07 + 9.*(fd/8.)**0.5*(Pr - 1.)*Pr**0.25)", "entry_point": "turbulent_Webb", "input": "-1.5, 0.5, -3", "output": "(0.046195082359980696+0.10004205790847473j)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_internal.py#L680-L719", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035625", "code": "def Nu_cylinder_Zukauskas(Re, Pr, Prw=None):\n    r'''Calculates Nusselt number for crossflow across a single tube at a\n    specified Re. Method from [1]_, also shown without modification in [2]_.\n\n    .. math::\n        Nu_{D}=CRe^{m}Pr^{n}\\left(\\frac{Pr}{Pr_s}\\right)^{1/4}\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number with respect to cylinder diameter, [-]\n    Pr : float\n        Prandtl number at free stream temperature [-]\n    Prw : float, optional\n        Prandtl number at wall temperature, [-]\n\n    Returns\n    -------\n    Nu : float\n        Nusselt number with respect to cylinder diameter, [-]\n\n    Notes\n    -----\n    If Prandtl number at wall are not provided, the Prandtl number correction\n    is not used and left to an outside function.\n\n    n is 0.37 if Pr <= 10; otherwise n is 0.36.\n\n    C and m are from the following table. If Re is outside of the ranges shown,\n    the nearest range is used blindly.\n\n    +---------+-------+-----+\n    | Re      | C     | m   |\n    +=========+=======+=====+\n    | 1-40    | 0.75  | 0.4 |\n    +---------+-------+-----+\n    | 40-1E3  | 0.51  | 0.5 |\n    +---------+-------+-----+\n    | 1E3-2E5 | 0.26  | 0.6 |\n    +---------+-------+-----+\n    | 2E5-1E6 | 0.076 | 0.7 |\n    +---------+-------+-----+\n\n    Examples\n    --------\n    Example 7.3 in [2]_, matches.\n\n    >>> Nu_cylinder_Zukauskas(7992, 0.707, 0.69)\n    50.523612661934386\n\n    References\n    ----------\n    .. [1] Zukauskas, A. Heat transfer from tubes in crossflow. In T.F. Irvine,\n       Jr. and J. P. Hartnett, editors, Advances in Heat Transfer, volume 8,\n       pages 93-160. Academic Press, Inc., New York, 1972.\n    .. [2] Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and\n       David P. DeWitt. Introduction to Heat Transfer. 6E. Hoboken, NJ:\n       Wiley, 2011.\n    '''\n    if Re <= 40:\n        c, m = 0.75, 0.4\n    elif Re < 1E3:\n        c, m = 0.51, 0.5\n    elif Re < 2E5:\n        c, m = 0.26, 0.6\n    else:\n        c, m = 0.076, 0.7\n    if Pr <= 10:\n        n = 0.37\n    else:\n        n = 0.36\n    Nu = c*Re**m*Pr**n\n    if Prw:\n        Nu = Nu*(Pr/Prw)**0.25\n    return Nu", "entry_point": "Nu_cylinder_Zukauskas", "input": "False, 0, 3.25", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/ht/blob/3097ef9524c4cf0068ad453c17b10ec9ce551eee/ht/conv_external.py#L35-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035626", "code": "def disambiguate(names, mark='1'):\n    \"\"\"\n    Given a list of strings ``names``, return a new list of names where repeated names have been disambiguated by repeatedly appending the given mark.\n\n    EXAMPLE::\n\n        >>> disambiguate(['sing', 'song', 'sing', 'sing'])\n        ['sing', 'song', 'sing1', 'sing11']\n\n    \"\"\"\n    names_seen = set()\n    new_names = []\n    for name in names:\n        new_name = name\n        while new_name in names_seen:\n            new_name += mark\n        new_names.append(new_name)\n        names_seen.add(new_name)\n\n    return new_names", "entry_point": "disambiguate", "input": "'AbC dEf', [1, 2, 3]", "output": "['A', 'b', 'C', ' ', 'd', 'E', 'f']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mrcagney/kml2geojson/blob/6c4720f2b1327d636e15ce397dd808c9df8580a5/kml2geojson/main.py#L151-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035627", "code": "def build_rgb_and_opacity(s):\n    \"\"\"\n    Given a KML color string, return an equivalent RGB hex color string and an opacity float rounded to 2 decimal places.\n\n    EXAMPLE::\n\n        >>> build_rgb_and_opacity('ee001122')\n        ('#221100', 0.93)\n\n    \"\"\"\n    # Set defaults\n    color = '000000'\n    opacity = 1\n\n    if s.startswith('#'):\n        s = s[1:]\n    if len(s) == 8:\n        color = s[6:8] + s[4:6] + s[2:4]\n        opacity = round(int(s[0:2], 16)/256, 2)\n    elif len(s) == 6:\n        color = s[4:6] + s[2:4] + s[0:2]\n    elif len(s) == 3:\n        color = s[::-1]\n\n    return '#' + color, opacity", "entry_point": "build_rgb_and_opacity", "input": "'Hello World'", "output": "('#000000', 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mrcagney/kml2geojson/blob/6c4720f2b1327d636e15ce397dd808c9df8580a5/kml2geojson/main.py#L191-L215", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035628", "code": "def display(obj, detail='phrase'):\n    \"\"\" Friendly string for volume, using sink paths. \"\"\"\n    try:\n        return obj.display(detail=detail)\n    except AttributeError:\n        return str(obj)", "entry_point": "display", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "\"['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AmesCornish/buttersink/blob/5cc37e30d9f8071fcf3497dca8b8a91b910321ea/buttersink/Store.py#L519-L524", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035629", "code": "def get_content(session, urls):\n    \"\"\"\n    Loads the content from URLs, ignoring connection errors.\n    :param session: requests Session instance\n    :param urls: list, str URLs\n    :return: str, content\n    \"\"\"\n    for url in urls:\n        resp = session.get(url)\n        if resp.ok:\n            return resp.json()\n    return {}", "entry_point": "get_content", "input": "['apple', 'banana', 'cherry'], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyupio/changelogs/blob/0cdb929ac4546c766cd7eef9ae4eb4baaa08f452/changelogs/launchpad.py#L55-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035630", "code": "def primary_container_name(names, default=None, strip_trailing_slash=True):\n    \"\"\"\n    From the list of names, finds the primary name of the container. Returns the defined default value (e.g. the\n    container id or ``None``) in case it cannot find any.\n\n    :param names: List with name and aliases of the container.\n    :type names: list[unicode | str]\n    :param default: Default value.\n    :param strip_trailing_slash: As read directly from the Docker service, every container name includes a trailing\n     slash. Set this to ``False`` if it is already removed.\n    :type strip_trailing_slash: bool\n    :return: Primary name of the container.\n    :rtype: unicode | str\n    \"\"\"\n    if strip_trailing_slash:\n        ex_names = [name[1:] for name in names if name.find('/', 2) == -1]\n    else:\n        ex_names = [name for name in names if name.find('/', 2) == -1]\n    if ex_names:\n        return ex_names[0]\n    return default", "entry_point": "primary_container_name", "input": "'a,b,c', [1, 2, 3], [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L57-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035631", "code": "def merge_dependency_paths(item_paths):\n    \"\"\"\n    Utility function that merges multiple dependency paths, as far as they share dependencies. Paths are evaluated\n    and merged in the incoming order. Later paths that are independent, but share some dependencies, are shortened\n    by these dependencies. Paths that are contained in another entirely are discarded.\n\n    :param item_paths: List or tuple of items along with their dependency path.\n    :type item_paths: collections.Iterable[(Any, list[Any])]\n    :return: List of merged or independent paths.\n    :rtype: list[(Any, list[Any])]\n    \"\"\"\n    merged_paths = []\n    for item, path in item_paths:\n        sub_path_idx = []\n        path_set = set(path)\n        for index, (merged_item, merged_path, merged_set) in enumerate(merged_paths):\n            if item in merged_set:\n                path = None\n                break\n            elif merged_item in path_set:\n                sub_path_idx.append(index)\n            elif merged_set & path_set:\n                path = [p for p in path if p not in merged_set]\n                path_set = set(path)\n                if not path:\n                    break\n        for spi in reversed(sub_path_idx):\n            merged_paths.pop(spi)\n        if path is not None:\n            merged_paths.append((item, path, path_set))\n    return [(i[0], i[1]) for i in merged_paths]", "entry_point": "merge_dependency_paths", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/state/utils.py#L5-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035632", "code": "def get_instance_volumes(instance_detail, check_names):\n    \"\"\"\n    Extracts the mount points and mapped directories or names of a Docker container.\n\n    :param instance_detail: Result from a container inspection.\n    :type instance_detail: dict\n    :param check_names: Whether to check for named volumes.\n    :type check_names: bool\n    :return: Dictionary of volumes, with the destination (inside the container) as a key, and the source (external to\n     the container) as values. If ``check_names`` is ``True``, the value contains the mounted volume name instead.\n    :rtype: dict[unicode | str, unicode | str]\n    \"\"\"\n    if 'Mounts' in instance_detail:\n        if check_names:\n            return {m['Destination']: m.get('Name') or m['Source']\n                    for m in instance_detail['Mounts']}\n        return {m['Destination']: m['Source']\n                for m in instance_detail['Mounts']}\n    return instance_detail.get('Volumes') or {}", "entry_point": "get_instance_volumes", "input": "{'x': [1, 2], 'y': []}, {1, 2, 3}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/utils.py#L81-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035633", "code": "def are_valid_values(values):\n    \"\"\"\n    Determines if a list of values are valid DMX values (0-255).\n    \"\"\"\n    try:\n        int_values = map(int, values)\n        for v in int_values:\n            if (v >= 0) and (v <= 255):\n                continue\n            else:\n                return False\n    except Exception as ex:\n        # print(ex)\n        return False\n    return True", "entry_point": "are_valid_values", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dhocker/udmx-pyusb/blob/ee7d10604ecd83857154ed6739793de3b7bd5fc1/uDMX.py#L159-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035634", "code": "def seq_match(seq0, seq1):\n    \"\"\"True if seq0 is a subset of seq1 and their elements are in same order.\n\n    >>> seq_match([], [])\n    True\n    >>> seq_match([1], [1])\n    True\n    >>> seq_match([1, 1], [1])\n    False\n    >>> seq_match([1], [1, 2])\n    True\n    >>> seq_match([1, 1], [1, 1])\n    True\n    >>> seq_match([3], [1, 2, 3])\n    True\n    >>> seq_match([1, 3], [1, 2, 3])\n    True\n    >>> seq_match([2, 1], [1, 2, 3])\n    False\n    \"\"\"\n    len_seq1 = len(seq1)\n    if len_seq1 < len(seq0):\n        return False\n    seq1_idx = 0\n    for i, elem in enumerate(seq0):\n        while seq1_idx < len_seq1:\n            if seq1[seq1_idx] == elem:\n                break\n            seq1_idx += 1\n        if seq1_idx >= len_seq1 or seq1[seq1_idx] != elem:\n            return False\n        seq1_idx += 1\n\n    return True", "entry_point": "seq_match", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ajdavis/mongo-mockup-db/blob/ff8a3f793def59e9037397ef60607fbda6949dac/mockupdb/__init__.py#L1954-L1987", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035635", "code": "def unique_list_dicts(dlist, key):\n    \"\"\"Return a list of dictionaries which are sorted for only unique entries.\n\n    :param dlist:\n    :param key:\n    :return list:\n    \"\"\"\n\n    return list(dict((val[key], val) for val in dlist).values())", "entry_point": "unique_list_dicts", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudnull/turbolift/blob/da33034e88959226529ce762e2895e6f6356c448/turbolift/clouderator/utils.py#L76-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035636", "code": "def parse_color(color):\n    \"\"\"Parse a color value.\n\n    I've decided not to expect a leading '#' because it's a comment character\n    in some shells.\n\n        >>> parse_color('4bf') == (0x44, 0xbb, 0xff, 0xff)\n        True\n        >>> parse_color('ccce') == (0xcc, 0xcc, 0xcc, 0xee)\n        True\n        >>> parse_color('d8b4a2') == (0xd8, 0xb4, 0xa2, 0xff)\n        True\n        >>> parse_color('12345678') == (0x12, 0x34, 0x56, 0x78)\n        True\n\n    Raises ValueError on errors.\n    \"\"\"\n    if len(color) not in (3, 4, 6, 8):\n        raise ValueError('bad color %s' % repr(color))\n    if len(color) in (3, 4):\n        r = int(color[0], 16) * 0x11\n        g = int(color[1], 16) * 0x11\n        b = int(color[2], 16) * 0x11\n    elif len(color) in (6, 8):\n        r = int(color[0:2], 16)\n        g = int(color[2:4], 16)\n        b = int(color[4:6], 16)\n    if len(color) == 4:\n        a = int(color[3], 16) * 0x11\n    elif len(color) == 8:\n        a = int(color[6:8], 16)\n    else:\n        a = 0xff\n    return (r, g, b, a)", "entry_point": "parse_color", "input": "['a', 'b', 'c']", "output": "(170, 187, 204, 255)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mgedmin/imgdiff/blob/f80b173c6fb1f32f3e016d153b5b84a14d966e1a/imgdiff.py#L25-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035637", "code": "def human_bytes(n):\n    \"\"\"\n    Return the number of bytes n in more human readable form.\n    \"\"\"\n    if n < 1024:\n        return '%d B' % n\n    k = n/1024\n    if k < 1024:\n        return '%d KB' % round(k)\n    m = k/1024\n    if m < 1024:\n        return '%.1f MB' % m\n    g = m/1024\n    return '%.2f GB' % g", "entry_point": "human_bytes", "input": "2.0", "output": "'2 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/conda-manager/blob/89a2126cbecefc92185cf979347ccac1c5ee5d9d/conda_manager/utils/misc.py#L3-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035638", "code": "def _setup_install_commands_from_kwargs(kwargs, keys=tuple()):\n        \"\"\"Setup install commands for conda.\"\"\"\n        cmd_list = []\n        if kwargs.get('override_channels', False) and 'channel' not in kwargs:\n            raise TypeError('conda search: override_channels requires channel')\n\n        if 'env' in kwargs:\n            cmd_list.extend(['--name', kwargs.pop('env')])\n        if 'prefix' in kwargs:\n            cmd_list.extend(['--prefix', kwargs.pop('prefix')])\n        if 'channel' in kwargs:\n            channel = kwargs.pop('channel')\n            if isinstance(channel, str):\n                cmd_list.extend(['--channel', channel])\n            else:\n                cmd_list.append('--channel')\n                cmd_list.extend(channel)\n\n        for key in keys:\n            if key in kwargs and kwargs[key]:\n                cmd_list.append('--' + key.replace('_', '-'))\n\n        return cmd_list", "entry_point": "_setup_install_commands_from_kwargs", "input": "{}, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/conda-manager/blob/89a2126cbecefc92185cf979347ccac1c5ee5d9d/conda_manager/api/conda_api.py#L332-L354", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035639", "code": "def _setup_config_from_kwargs(kwargs):\n        \"\"\"Setup config commands for conda.\"\"\"\n        cmd_list = ['--json', '--force']\n\n        if 'file' in kwargs:\n            cmd_list.extend(['--file', kwargs['file']])\n\n        if 'system' in kwargs:\n            cmd_list.append('--system')\n\n        return cmd_list", "entry_point": "_setup_config_from_kwargs", "input": "{'a': 1, 'b': 2}", "output": "['--json', '--force']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spyder-ide/conda-manager/blob/89a2126cbecefc92185cf979347ccac1c5ee5d9d/conda_manager/api/conda_api.py#L727-L737", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035640", "code": "def is_strict_subclass (value, klass):\n    \"\"\"Check that `value` is a subclass of `klass` but that it is not actually\n    `klass`. Unlike issubclass(), does not raise an exception if `value` is\n    not a type.\n\n    \"\"\"\n    return (isinstance (value, type) and\n            issubclass (value, klass) and\n            value is not klass)", "entry_point": "is_strict_subclass", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pkgw/pwkit/blob/d40957a1c3d2ea34e7ceac2267ee9635135f2793/pwkit/cli/multitool.py#L189-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035641", "code": "def serial_ppmap(func, fixed_arg, var_arg_iter):\n    \"\"\"A serial implementation of the \"partially-pickling map\" function returned\n    by the :meth:`ParallelHelper.get_ppmap` interface. Its arguments are:\n\n    *func*\n      A callable taking three arguments and returning a Pickle-able value.\n    *fixed_arg*\n      Any value, even one that is not pickle-able.\n    *var_arg_iter*\n      An iterable that generates Pickle-able values.\n\n    The functionality is::\n\n        def serial_ppmap(func, fixed_arg, var_arg_iter):\n            return [func(i, fixed_arg, x) for i, x in enumerate(var_arg_iter)]\n\n    Therefore the arguments to your ``func`` function, which actually does the\n    interesting computations, are:\n\n    *index*\n      The 0-based index number of the item being processed; often this can\n      be ignored.\n    *fixed_arg*\n      The same *fixed_arg* that was passed to ``ppmap``.\n    *var_arg*\n      The *index*'th item in the *var_arg_iter* iterable passed to\n      ``ppmap``.\n\n    \"\"\"\n    return [func(i, fixed_arg, x) for i, x in enumerate(var_arg_iter)]", "entry_point": "serial_ppmap", "input": "{1, 2, 3}, 'Hello World', set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pkgw/pwkit/blob/d40957a1c3d2ea34e7ceac2267ee9635135f2793/pwkit/parallel.py#L231-L260", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035642", "code": "def _broadcast_shapes(s1, s2):\n    \"\"\"Given array shapes `s1` and `s2`, compute the shape of the array that would\n    result from broadcasting them together.\"\"\"\n\n    n1 = len(s1)\n    n2 = len(s2)\n    n = max(n1, n2)\n    res = [1] * n\n\n    for i in range(n):\n        if i >= n1:\n            c1 = 1\n        else:\n            c1 = s1[n1-1-i]\n\n        if i >= n2:\n            c2 = 1\n        else:\n            c2 = s2[n2-1-i]\n\n        if c1 == 1:\n            rc = c2\n        elif c2 == 1 or c1 == c2:\n            rc = c1\n        else:\n            raise ValueError('array shapes %r and %r are not compatible' % (s1, s2))\n\n        res[n-1-i] = rc\n\n    return tuple(res)", "entry_point": "_broadcast_shapes", "input": "[[1, 2], [3], []], []", "output": "([1, 2], [3], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pkgw/pwkit/blob/d40957a1c3d2ea34e7ceac2267ee9635135f2793/pwkit/lsqmdl.py#L757-L786", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035643", "code": "def operations(nsteps):\n        '''Returns the number of operations needed for nsteps of GMRES'''\n        return {'A': 1 + nsteps,\n                'M': 2 + nsteps,\n                'Ml': 2 + nsteps,\n                'Mr': 1 + nsteps,\n                'ip_B': 2 + nsteps + nsteps*(nsteps+1)/2,\n                'axpy': 4 + 2*nsteps + nsteps*(nsteps+1)/2\n                }", "entry_point": "operations", "input": "False", "output": "{'A': 1, 'M': 2, 'Ml': 2, 'Mr': 1, 'ip_B': 2.0, 'axpy': 4.0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/andrenarchy/krypy/blob/4883ec9a61d64ea56489e15c35cc40f0633ab2f1/krypy/linsys.py#L897-L905", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035644", "code": "def is_merc_projection(srs):\n    \"\"\" Return true if the map projection matches that used by VEarth, Google, OSM, etc.\n    \n        Is currently necessary for zoom-level shorthand for scale-denominator.\n    \"\"\"\n    if srs.lower() == '+init=epsg:900913':\n        return True\n\n    # observed\n    srs = dict([p.split('=') for p in srs.split() if '=' in p])\n    \n    # expected\n    # note, common optional modifiers like +no_defs, +over, and +wkt\n    # are not pairs and should not prevent matching\n    gym = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null'\n    gym = dict([p.split('=') for p in gym.split() if '=' in p])\n        \n    for p in gym:\n        if srs.get(p, None) != gym.get(p, None):\n            return False\n\n    return True", "entry_point": "is_merc_projection", "input": "''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mapnik/Cascadenik/blob/82f66859340a31dfcb24af127274f262d4f3ad85/cascadenik/compile.py#L587-L608", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035645", "code": "def rc4(data, key):\n    \"\"\"RC4 encryption and decryption method.\"\"\"\n    S, j, out = list(range(256)), 0, []\n\n    for i in range(256):\n        j = (j + S[i] + ord(key[i % len(key)])) % 256\n        S[i], S[j] = S[j], S[i]\n\n    i = j = 0\n    for ch in data:\n        i = (i + 1) % 256\n        j = (j + S[i]) % 256\n        S[i], S[j] = S[j], S[i]\n        out.append(chr(ord(ch) ^ S[(S[i] + S[j]) % 256]))\n\n    return \"\".join(out)", "entry_point": "rc4", "input": "set(), ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jbremer/rc4/blob/49d6e916c96dcf990b5873c8389248436d443c13/rc4/__init__.py#L4-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035646", "code": "def _styleof(expr, styles):\n    \"\"\"Merge style dictionaries in order\"\"\"\n    style = dict()\n    for expr_filter, sty in styles:\n        if expr_filter(expr):\n            style.update(sty)\n    return style", "entry_point": "_styleof", "input": "[], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mabuchilab/QNET/blob/cc20d26dad78691d34c67173e5cd67dcac94208a/src/qnet/printing/dot.py#L81-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035647", "code": "def invert_permutation(permutation):\n    \"\"\"Compute the image tuple of the inverse permutation.\n\n    :param permutation: A valid (cf. :py:func:check_permutation) permutation.\n    :return: The inverse permutation tuple\n    :rtype: tuple\n    \"\"\"\n    return tuple([permutation.index(p) for p in range(len(permutation))])", "entry_point": "invert_permutation", "input": "[]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mabuchilab/QNET/blob/cc20d26dad78691d34c67173e5cd67dcac94208a/src/qnet/utils/permutations.py#L32-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035648", "code": "def permutation_from_disjoint_cycles(cycles, offset=0):\n    \"\"\"Reconstruct a permutation image tuple from a list of disjoint cycles\n    :param cycles: sequence of disjoint cycles\n    :type cycles: list or tuple\n    :param offset: Offset to subtract from the resulting permutation image points\n    :type offset: int\n    :return: permutation image tuple\n    :rtype: tuple\n    \"\"\"\n    perm_length = sum(map(len, cycles))\n    res_perm = list(range(perm_length))\n    for c in cycles:\n        p1 = c[0] - offset\n        for p2 in c[1:]:\n            p2 = p2 - offset\n            res_perm[p1] = p2\n            p1 = p2\n        res_perm[p1] = c[0] - offset #close cycle\n    assert sorted(res_perm) == list(range(perm_length))\n    return tuple(res_perm)", "entry_point": "permutation_from_disjoint_cycles", "input": "[], [1, 2, 3]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mabuchilab/QNET/blob/cc20d26dad78691d34c67173e5cd67dcac94208a/src/qnet/utils/permutations.py#L100-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035649", "code": "def permutation_from_block_permutations(permutations):\n    \"\"\"Reverse operation to :py:func:`permutation_to_block_permutations`\n    Compute the concatenation of permutations\n\n        ``(1,2,0) [+] (0,2,1) --> (1,2,0,3,5,4)``\n\n    :param permutations: A list of permutation tuples\n                                 ``[t = (t_0,...,t_n1), u = (u_0,...,u_n2),..., z = (z_0,...,z_nm)]``\n    :type permutations: list of tuples\n    :return: permutation image tuple\n                    ``s = t [+] u [+] ... [+] z``\n    :rtype: tuple\n    \"\"\"\n    offset = 0\n    new_perm = []\n    for p in permutations:\n        new_perm[offset: offset +len(p)] = [p_i + offset for p_i in p]\n        offset += len(p)\n    return tuple(new_perm)", "entry_point": "permutation_from_block_permutations", "input": "[]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mabuchilab/QNET/blob/cc20d26dad78691d34c67173e5cd67dcac94208a/src/qnet/utils/permutations.py#L166-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035650", "code": "def get_text(nodelist):\n    \"\"\"Get the value from a text node.\"\"\"\n    value = []\n    for node in nodelist:\n        if node.nodeType == node.TEXT_NODE:\n            value.append(node.data)\n    return ''.join(value)", "entry_point": "get_text", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hthiery/python-fritzhome/blob/c74bd178d08a305028f316f7da35202da3526f61/pyfritzhome/fritzhome.py#L14-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035651", "code": "def find_spelling(n):\r\n    \"\"\"\r\n    Finds d, r s.t. n-1 = 2^r * d\r\n    \"\"\"\r\n    r = 0\r\n    d = n - 1\r\n    # divmod used for large numbers\r\n    quotient, remainder = divmod(d, 2)\r\n    # while we can still divide 2's into n-1...\r\n    while remainder != 1:\r\n        r += 1\r\n        d = quotient  # previous quotient before we overwrite it\r\n        quotient, remainder = divmod(d, 2)\r\n    return r, d", "entry_point": "find_spelling", "input": "-1.5", "output": "(2, -1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Mego/Seriously/blob/07b256e4f35f5efec3b01434300f9ccc551b1c3e/seriously/probably_prime.py#L4-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035652", "code": "def get_mod_func(class_string):\n    \"\"\"\n    Converts 'django.views.news.stories.story_detail' to\n    ('django.views.news.stories', 'story_detail')\n\n    Taken from django.core.urlresolvers\n    \"\"\"\n    try:\n        dot = class_string.rindex('.')\n    except ValueError:\n        return class_string, ''\n    return class_string[:dot], class_string[dot + 1:]", "entry_point": "get_mod_func", "input": "'a,b,c'", "output": "('a,b,c', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/futurecolors/django-geoip/blob/f9eee4bcad40508089b184434b79826f842d7bd0/django_geoip/utils.py#L18-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035653", "code": "def _parse_bool(value):\n    \"\"\"Convert ``string`` or ``bool`` to ``bool``.\"\"\"\n    if isinstance(value, bool):\n        return value\n\n    elif isinstance(value, str):\n        if value == 'True':\n            return True\n        elif value == 'False':\n            return False\n\n    raise Exception(\"Value %s is not boolean.\" % value)", "entry_point": "_parse_bool", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ryan-roemer/django-cloud-browser/blob/b06cdd24885a6309e843ed924dbf1705b67e7f48/fabfile.py#L118-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035654", "code": "def truncatechars(value, num, end_text=\"...\"):\n    \"\"\"Truncate string on character boundary.\n\n    .. note::\n        Django ticket `5025 <http://code.djangoproject.com/ticket/5025>`_ has a\n        patch for a more extensible and robust truncate characters tag filter.\n\n    Example::\n\n        {{ my_variable|truncatechars:22 }}\n\n    :param value: Value to truncate.\n    :type  value: ``string``\n    :param num: Number of characters to trim to.\n    :type  num: ``int``\n    \"\"\"\n    length = None\n    try:\n        length = int(num)\n    except ValueError:\n        pass\n\n    if length is not None and len(value) > length:\n        return value[:length - len(end_text)] + end_text\n\n    return value", "entry_point": "truncatechars", "input": "[], 1, 'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ryan-roemer/django-cloud-browser/blob/b06cdd24885a6309e843ed924dbf1705b67e7f48/cloud_browser/templatetags/cloud_browser_extras.py#L15-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035655", "code": "def make_virtual_offset(block_start_offset, within_block_offset):\n    \"\"\"Compute a BGZF virtual offset from block start and within block offsets.\n    The BAM indexing scheme records read positions using a 64 bit\n    'virtual offset', comprising in C terms:\n    block_start_offset << 16 | within_block_offset\n    Here block_start_offset is the file offset of the BGZF block\n    start (unsigned integer using up to 64-16 = 48 bits), and\n    within_block_offset within the (decompressed) block (unsigned\n    16 bit integer).\n    >>> make_virtual_offset(0, 0)\n    0\n    >>> make_virtual_offset(0, 1)\n    1\n    >>> make_virtual_offset(0, 2**16 - 1)\n    65535\n    >>> make_virtual_offset(0, 2**16)\n    Traceback (most recent call last):\n    ...\n    ValueError: Require 0 <= within_block_offset < 2**16, got 65536\n    >>> 65536 == make_virtual_offset(1, 0)\n    True\n    >>> 65537 == make_virtual_offset(1, 1)\n    True\n    >>> 131071 == make_virtual_offset(1, 2**16 - 1)\n    True\n    >>> 6553600000 == make_virtual_offset(100000, 0)\n    True\n    >>> 6553600001 == make_virtual_offset(100000, 1)\n    True\n    >>> 6553600010 == make_virtual_offset(100000, 10)\n    True\n    >>> make_virtual_offset(2**48, 0)\n    Traceback (most recent call last):\n    ...\n    ValueError: Require 0 <= block_start_offset < 2**48, got 281474976710656\n    \"\"\"\n    if within_block_offset < 0 or within_block_offset >= 65536:\n        raise ValueError(\"Require 0 <= within_block_offset < 2**16, got %i\" % within_block_offset)\n    if block_start_offset < 0 or block_start_offset >= 281474976710656:\n        raise ValueError(\"Require 0 <= block_start_offset < 2**48, got %i\" % block_start_offset)\n    return (block_start_offset << 16) | within_block_offset", "entry_point": "make_virtual_offset", "input": "False, 10", "output": "10", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bihealth/vcfpy/blob/99e2165df30f11e0c95f3170f31bc5191d9e9e15/vcfpy/bgzf.py#L43-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035656", "code": "def map_position(pos):\n    \"\"\"Map natural position to machine code postion\"\"\"\n\n    posiction_dict = dict(zip(range(1, 17), [i for i in range(30, 62) if i % 2]))\n    return posiction_dict[pos]", "entry_point": "map_position", "input": "2.0", "output": "33", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eraclitux/ipcampy/blob/bffd1c4df9006705cffa5b83a090b0db90cbcbcf/ipcampy/foscam.py#L15-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035657", "code": "def autopair(isleDict, wordList):\n    '''\n    Tests whether adjacent words are OOD or not\n    \n    It returns complete wordLists with the matching words replaced.\n    Each match yields one sentence.\n    \n    e.g.\n    red ball chaser\n    would return\n    [[red_ball chaser], [red ball_chaser]], [0, 1]\n    \n    if 'red_ball' and 'ball_chaser' were both in the dictionary\n    '''\n    \n    newWordList = [(\"%s_%s\" % (wordList[i], wordList[i + 1]), i)\n                   for i in range(0, len(wordList) - 1)]\n    \n    sentenceList = []\n    indexList = []\n    for word, i in newWordList:\n        if word in isleDict.data:\n            sentenceList.append(wordList[:i] + [word, ] + wordList[i + 1:])\n            indexList.append(i)\n    \n    return sentenceList, indexList", "entry_point": "autopair", "input": "(), ''", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timmahrt/pysle/blob/da7c3d9ebdc01647be845f442b6f072a854eba3b/pysle/isletool.py#L418-L443", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035658", "code": "def _adjustSyllabification(adjustedPhoneList, syllableList):\n    '''\n    Inserts spaces into a syllable if needed\n    \n    Originally the phone list and syllable list contained the same number\n    of phones.  But the adjustedPhoneList may have some insertions which are\n    not accounted for in the syllableList.\n    '''\n    i = 0\n    retSyllableList = []\n    for syllableNum, syllable in enumerate(syllableList):\n        j = len(syllable)\n        if syllableNum == len(syllableList) - 1:\n            j = len(adjustedPhoneList) - i\n        tmpPhoneList = adjustedPhoneList[i:i + j]\n        numBlanks = -1\n        phoneList = tmpPhoneList[:]\n        while numBlanks != 0:\n            \n            numBlanks = tmpPhoneList.count(u\"''\")\n            if numBlanks > 0:\n                tmpPhoneList = adjustedPhoneList[i + j:i + j + numBlanks]\n                phoneList.extend(tmpPhoneList)\n                j += numBlanks\n        \n        for k, phone in enumerate(phoneList):\n            if phone == u\"''\":\n                syllable.insert(k, u\"''\")\n        \n        i += j\n        \n        retSyllableList.append(syllable)\n    \n    return retSyllableList", "entry_point": "_adjustSyllabification", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timmahrt/pysle/blob/da7c3d9ebdc01647be845f442b6f072a854eba3b/pysle/pronunciationtools.py#L132-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035659", "code": "def _syllabifyPhones(phoneList, syllableList):\n    '''\n    Given a phone list and a syllable list, syllabify the phones\n    \n    Typically used by findBestSyllabification which first aligns the phoneList\n    with a dictionary phoneList and then uses the dictionary syllabification\n    to syllabify the input phoneList.\n    '''\n    \n    numPhoneList = [len(syllable) for syllable in syllableList]\n    \n    start = 0\n    syllabifiedList = []\n    for end in numPhoneList:\n        \n        syllable = phoneList[start:start + end]\n        syllabifiedList.append(syllable)\n        \n        start += end\n    \n    return syllabifiedList", "entry_point": "_syllabifyPhones", "input": "[-1, 0, 1, 2], ['a', 'b', 'c']", "output": "[[-1], [0], [1]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timmahrt/pysle/blob/da7c3d9ebdc01647be845f442b6f072a854eba3b/pysle/pronunciationtools.py#L238-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035660", "code": "def _decode(value):\n        \"\"\"\n        decode byte strings and convert to int where needed\n        \"\"\"\n        if value.isdigit():\n            return int(value)\n        if isinstance(value, bytes):\n            return value.decode('utf-8')\n        else:\n            return value", "entry_point": "_decode", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bcicen/haproxy-stats/blob/f9268244b84eb52095d07b577646fdea4135fe3b/haproxystats/__init__.py#L115-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035661", "code": "def calculate_offset(percent, original_length, length):\n        \"\"\"\n        Calculates crop offset based on percentage.\n\n        :param percent: A percentage representing the size of the offset.\n        :param original_length: The length the distance that should be cropped.\n        :param length: The desired length.\n        :return: The offset in pixels\n        :rtype: int\n        \"\"\"\n        return int(\n            max(\n                0,\n                min(percent * original_length / 100.0, original_length - length / 2) - length / 2)\n        )", "entry_point": "calculate_offset", "input": "0, 3.25, 3.25", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-thumbnails/python-thumbnails/blob/d8dc0ff5410f730de2a0e5759e8a818b19de35b9/thumbnails/engines/base.py#L216-L230", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035662", "code": "def lpad(msg, symbol, length):\n    \"\"\"\n    Left-pad a given string (msg) with a character (symbol) for a given number of bytes (length).\n    Return the padded string\n    \"\"\"\n    if len(msg) >= length:\n        return msg\n    return symbol * (length - len(msg)) + msg", "entry_point": "lpad", "input": "'a,b,c', [1, 2, 3], 1", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/virtualchain/blob/fcfc970064ca7dfcab26ebd3ab955870a763ea39/virtualchain/lib/encoding.py#L57-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035663", "code": "def serialize_dtype(o):\n    \"\"\"\n    Serializes a :obj:`numpy.dtype`.\n\n    Args:\n        o (:obj:`numpy.dtype`): :obj:`dtype` to be serialized.\n\n    Returns:\n        A dictionary that can be passed to :obj:`json.dumps`.\n    \"\"\"\n    if len(o) == 0:\n        return dict(\n            _type='np.dtype',\n            descr=str(o))\n    return dict(\n        _type='np.dtype',\n        descr=o.descr)", "entry_point": "serialize_dtype", "input": "[]", "output": "{'_type': 'np.dtype', 'descr': '[]'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gregreen/dustmaps/blob/c8f571a71da0d951bf8ea865621bee14492bdfd9/dustmaps/json_serializers.py#L54-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035664", "code": "def btc_is_p2sh_script( script_hex ):\n    \"\"\"\n    Is the given scriptpubkey a p2sh script?\n    \"\"\"\n    if script_hex.startswith(\"a914\") and script_hex.endswith(\"87\") and len(script_hex) == 46:\n        return True\n    else:\n        return False", "entry_point": "btc_is_p2sh_script", "input": "'walnut thistle harbour'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/virtualchain/blob/fcfc970064ca7dfcab26ebd3ab955870a763ea39/virtualchain/lib/blockchain/bitcoin_blockchain/keys.py#L494-L501", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035665", "code": "def format_git_describe(git_str, pep440=False):\n    \"\"\"format the result of calling 'git describe' as a python version\"\"\"\n    if git_str is None:\n        return None\n    if \"-\" not in git_str:  # currently at a tag\n        return git_str\n    else:\n        # formatted as version-N-githash\n        # want to convert to version.postN-githash\n        git_str = git_str.replace(\"-\", \".post\", 1)\n        if pep440:  # does not allow git hash afterwards\n            return git_str.split(\"-\")[0]\n        else:\n            return git_str.replace(\"-g\", \"+git\")", "entry_point": "format_git_describe", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcocdawc/chemcoord/blob/95561ce387c142227c38fb14a1d182179aef8f5f/version.py#L100-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035666", "code": "def btc_tx_is_segwit( tx_serialized ):\n    \"\"\"\n    Is this serialized (hex-encoded) transaction a segwit transaction?\n    \"\"\"\n    marker_offset = 4       # 5th byte is the marker byte\n    flag_offset = 5         # 6th byte is the flag byte\n    \n    marker_byte_string = tx_serialized[2*marker_offset:2*(marker_offset+1)]\n    flag_byte_string = tx_serialized[2*flag_offset:2*(flag_offset+1)]\n\n    if marker_byte_string == '00' and flag_byte_string != '00':\n        # segwit (per BIP144)\n        return True\n    else:\n        return False", "entry_point": "btc_tx_is_segwit", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/virtualchain/blob/fcfc970064ca7dfcab26ebd3ab955870a763ea39/virtualchain/lib/blockchain/bitcoin_blockchain/bits.py#L476-L490", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035667", "code": "def print_alignment(mapping, instance1, instance2):\n    \"\"\"\n    print the alignment based on a node mapping\n    Args:\n        mapping: current node mapping list\n        instance1: nodes of AMR 1\n        instance2: nodes of AMR 2\n\n    \"\"\"\n    result = []\n    for instance1_item, m in zip(instance1, mapping):\n        r = instance1_item[1] + \"(\" + instance1_item[2] + \")\"\n        if m == -1:\n            r += \"-Null\"\n        else:\n            instance2_item = instance2[m]\n            r += \"-\" + instance2_item[1] + \"(\" + instance2_item[2] + \")\"\n        result.append(r)\n    return \" \".join(result)", "entry_point": "print_alignment", "input": "{'a': 1, 'b': 2}, [], [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/snowblink14/smatch/blob/ad7e6553a3d52e469b2eef69d7716c87a67eedac/smatch.py#L646-L664", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035668", "code": "def str_val(val):\n    \"\"\"\n    Format the value of a metric value to a string\n\n    :param val: number to be formatted\n    :return: a string with the formatted value\n    \"\"\"\n    str_val = val\n    if val is None:\n        str_val = \"NA\"\n    elif type(val) == float:\n        str_val = '%0.2f' % val\n    else:\n        str_val = str(val)\n    return str_val", "entry_point": "str_val", "input": "[]", "output": "'[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-manuscripts/blob/94a3ad4f11bfbcd6c5190e01cb5d3e47a5187cd9/manuscripts2/utils.py#L43-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035669", "code": "def get_amr_line(input_f):\n        \"\"\"\n        Read the file containing AMRs. AMRs are separated by a blank line.\n        Each call of get_amr_line() returns the next available AMR (in one-line form).\n        Note: this function does not verify if the AMR is valid\n\n        \"\"\"\n        cur_amr = []\n        has_content = False\n        for line in input_f:\n            line = line.strip()\n            if line == \"\":\n                if not has_content:\n                    # empty lines before current AMR\n                    continue\n                else:\n                    # end of current AMR\n                    break\n            if line.strip().startswith(\"#\"):\n                # ignore the comment line (starting with \"#\") in the AMR file\n                continue\n            else:\n                has_content = True\n                cur_amr.append(line.strip())\n        return \"\".join(cur_amr)", "entry_point": "get_amr_line", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/snowblink14/smatch/blob/ad7e6553a3d52e469b2eef69d7716c87a67eedac/amr.py#L166-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035670", "code": "def _flatten_fetched_fields(fields_arg):\n    \"\"\" this method takes either a kwargs 'fields', which can be a dict :\n    {\"_id\": False, \"store\": 1, \"url\": 1} or a list : [\"store\", \"flag\", \"url\"]\n    and returns a tuple : (\"store\", \"flag\").\n    it HAS to be a tuple, so that it is not updated by the different instances\n    \"\"\"\n    if fields_arg is None:\n        return None\n    if isinstance(fields_arg, dict):\n        return tuple(sorted([k for k in list(fields_arg.keys()) if fields_arg[k]]))\n    else:\n        return tuple(sorted(fields_arg))", "entry_point": "_flatten_fetched_fields", "input": "[1, 2, 3]", "output": "(1, 2, 3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pricingassistant/mongokat/blob/61eaf4bc1c4cc359c6f9592ec97b9a04d9561411/mongokat/document.py#L15-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035671", "code": "def checksum(string):\n    \"\"\"\n    Compute the Luhn checksum for the provided string of digits. Note this\n    assumes the check digit is in place.\n    \"\"\"\n    digits = list(map(int, string))\n    odd_sum = sum(digits[-1::-2])\n    even_sum = sum([sum(divmod(2 * d, 10)) for d in digits[-2::-2]])\n    return (odd_sum + even_sum) % 10", "entry_point": "checksum", "input": "()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mmcloughlin/luhn/blob/d6f3fa71072f99334a4c1d2a3f062fa93982797f/luhn.py#L3-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035672", "code": "def _convert_url_to_downloadable(url):\n    \"\"\"Convert a url to the proper style depending on its website.\"\"\"\n\n    if 'drive.google.com' in url:\n        # For future support of google drive\n        file_id = url.split('d/')[1].split('/')[0]\n        base_url = 'https://drive.google.com/uc?export=download&id='\n        out = '{}{}'.format(base_url, file_id)\n    elif 'dropbox.com' in url:\n        if url.endswith('.png'):\n            out = url + '?dl=1'\n        else:\n            out = url.replace('dl=0', 'dl=1')\n    elif 'github.com' in url:\n        out = url.replace('github.com', 'raw.githubusercontent.com')\n        out = out.replace('blob/', '')\n    else:\n        out = url\n    return out", "entry_point": "_convert_url_to_downloadable", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/choldgraf/download/blob/26007bb87751ee35791e30e4dfc54dd088bf15e6/download/download.py#L116-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035673", "code": "def blueprint_name_to_url(name):\n        \"\"\" remove the last . in the string it it ends with a .\n            for the url structure must follow the flask routing format\n            it should be /model/method instead of /model/method/\n        \"\"\"\n        if name[-1:] == \".\":\n            name = name[:-1]\n        name = str(name).replace(\".\", \"/\")\n        return name", "entry_point": "blueprint_name_to_url", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aiscenblue/flask-blueprint/blob/c558d9d5d9630bab53c297ce2c33f4ceb3874724/flask_blueprint/module_router.py#L149-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035674", "code": "def sanitize_command_options(options):\n    \"\"\"\n    Sanitizes command options.\n    \"\"\"\n    multiples = [\n        'badges',\n        'exclude_badges',\n    ]\n\n    for option in multiples:\n        if options.get(option):\n            value = options[option]\n            if value:\n                options[option] = [v for v in value.split(' ') if v]\n\n    return options", "entry_point": "sanitize_command_options", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ulule/django-badgify/blob/1bf233ffeb6293ee659454de7b3794682128b6ca/badgify/utils.py#L133-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035675", "code": "def tile_to_pixel(tile, centered=False):\n        \"\"\"Transform tile to pixel coordinates\"\"\"\n        pixel = [tile[0] * 256, tile[1] * 256]\n        if centered:\n            # should clip on max map size\n            pixel = [pix + 128 for pix in pixel]\n        return pixel[0], pixel[1]", "entry_point": "tile_to_pixel", "input": "[1, 2, 3], []", "output": "(256, 512)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buckhx/QuadKey/blob/546338f9b50b578ea765d3bf84b944db48dbec5b/quadkey/tile_system.py#L90-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035676", "code": "def remove_none_value(data):\n    \"\"\"remove item from dict if value is None.\n    return new dict.\n    \"\"\"\n    return dict((k, v) for k, v in data.items() if v is not None)", "entry_point": "remove_none_value", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hanguokai/youku/blob/b2df060c7dccfad990bcfa289fff68bb77d1e69b/youku/util.py#L50-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035677", "code": "def _cytomine_parameter_name_synonyms(name, prefix=\"--\"):\n    \"\"\"For a given parameter name, returns all the possible usual synonym (and the parameter itself). Optionally, the\n    function can prepend a string to the found names.\n\n    If a parameters has no known synonyms, the function returns only the prefixed $name.\n\n    Parameters\n    ----------\n    name: str\n        Parameter based on which synonyms must searched for\n    prefix: str\n        The prefix\n\n    Returns\n    -------\n    names: str\n        List of prefixed parameter names containing at least $name (preprended with $prefix).\n    \"\"\"\n    synonyms = [\n        [\"host\", \"cytomine_host\"],\n        [\"public_key\", \"publicKey\", \"cytomine_public_key\"],\n        [\"private_key\", \"privateKey\", \"cytomine_private_key\"],\n        [\"base_path\", \"basePath\", \"cytomine_base_path\"],\n        [\"id_software\", \"cytomine_software_id\", \"cytomine_id_software\", \"idSoftware\", \"software_id\"],\n        [\"id_project\", \"cytomine_project_id\", \"cytomine_id_project\", \"idProject\", \"project_id\"]\n    ]\n    synonyms_dict = {params[i]: params[:i] + params[(i + 1):] for params in synonyms for i in range(len(params))}\n\n    if name not in synonyms_dict:\n        return [prefix + name]\n\n    return [prefix + n for n in ([name] + synonyms_dict[name])]", "entry_point": "_cytomine_parameter_name_synonyms", "input": "'', 'Hello World'", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cytomine/Cytomine-python-client/blob/bac19722b900dd32c6cfd6bdb9354fc784d33bc4/cytomine/cytomine.py#L50-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035678", "code": "def create_unique_id(prefix, existing_ids):\n    \"\"\"Return a unique string ID from the prefix.\n\n    First check if the prefix is itself a unique ID in the set-like parameter\n    existing_ids. If not, try integers in ascending order appended to the\n    prefix until a unique ID is found.\n    \"\"\"\n    if prefix in existing_ids:\n        suffix = 1\n        while True:\n            new_id = '{}_{}'.format(prefix, suffix)\n            if new_id not in existing_ids:\n                return new_id\n            suffix += 1\n\n    return prefix", "entry_point": "create_unique_id", "input": "'a,b,c', []", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zhanglab/psamm/blob/dc427848c4f9d109ca590f0afa024c63b685b3f4/psamm/util.py#L178-L193", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035679", "code": "def correct_output(luminosity):\n    \"\"\"\n    :param luminosity: Input luminosity\n    :return: Luminosity limited to the 0 <= l <= 255 range.\n    \"\"\"\n    if luminosity < 0:\n        val = 0\n    elif luminosity > 255:\n        val = 255\n    else:\n        val = luminosity\n    return round(val)", "entry_point": "correct_output", "input": "3.25", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/todbot/blink1-python/blob/7a5183becd9662f88da3c29afd3447403f4ef82f/blink1/kelvin.py#L24-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035680", "code": "def encode(in_bytes):\n    \"\"\"Encode a string using Consistent Overhead Byte Stuffing/Reduced (COBS/R).\n    \n    Input is any byte string. Output is also a byte string.\n    \n    Encoding guarantees no zero bytes in the output. The output\n    string may be expanded slightly, by a predictable amount.\n    \n    An empty string is encoded to '\\\\x01'\"\"\"\n    out_bytes = []\n    idx = 0\n    search_start_idx = 0\n    for in_char in in_bytes:\n        if idx - search_start_idx == 0xFE:\n            out_bytes.append('\\xFF')\n            out_bytes.append(in_bytes[search_start_idx:idx])\n            search_start_idx = idx\n        if in_char == '\\x00':\n            out_bytes.append(chr(idx - search_start_idx + 1))\n            out_bytes.append(in_bytes[search_start_idx:idx])\n            search_start_idx = idx + 1\n        idx += 1\n    try:\n        final_byte = in_bytes[-1]\n    except IndexError:\n        final_byte = '\\x00'\n    length_value = idx - search_start_idx + 1\n    if ord(final_byte) < length_value:\n        # Encoding same as plain COBS\n        out_bytes.append(chr(length_value))\n        out_bytes.append(in_bytes[search_start_idx:idx])\n    else:\n        # Special COBS/R encoding: length code is final byte,\n        # and final byte is removed from data sequence.\n        out_bytes.append(final_byte)\n        out_bytes.append(in_bytes[search_start_idx:idx - 1])\n    return ''.join(out_bytes)", "entry_point": "encode", "input": "'walnut thistle harbour'", "output": "'rwalnut thistle harbou'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cmcqueen/cobs-python/blob/ec4ce301e5574c9b6e72bfb485c116bdbffe0769/python2/cobs/cobsr/_cobsr_py.py#L12-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035681", "code": "def header(msg):\n    \"\"\"\n    Wrap `msg` in bars to create a header effect\n    \"\"\"\n    # Accounting for '| ' and ' |'\n    width = len(msg) + 4\n    s = []\n    s.append('-' * width)\n    s.append(\"| %s |\" % msg)\n    s.append('-' * width)\n    return '\\n'.join(s)", "entry_point": "header", "input": "''", "output": "'----\\n|  |\\n----'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juicer/juicer/blob/0c9f0fd59e293d45df6b46e81f675d33221c600d/juicer/utils/__init__.py#L787-L797", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035682", "code": "def encode(string):\n\t\t\"\"\"\n\t\tEncode the given string as an OID.\n\n\t\t>>> import snmp_passpersist as snmp\n\t\t>>> snmp.PassPersist.encode(\"hello\")\n\t\t'5.104.101.108.108.111'\n\t\t>>>\n\t\t\"\"\"\n\n\t\tresult=\".\".join([ str(ord(s)) for s in string ])\n\t\treturn  \"%s.\" % (len(string)) + result", "entry_point": "encode", "input": "'walnut thistle harbour'", "output": "'22.119.97.108.110.117.116.32.116.104.105.115.116.108.101.32.104.97.114.98.111.117.114'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nagius/snmp_passpersist/blob/8cc584d2e90c920ae98a318164a55bde209a18f7/snmp_passpersist.py#L106-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035683", "code": "def batch(batch_size, items):\n    \"Batch items into groups of batch_size\"\n    items = list(items)\n    if batch_size is None:\n        return [items]\n    MISSING = object()\n    padded_items = items + [MISSING] * (batch_size - 1)\n    groups = zip(*[padded_items[i::batch_size] for i in range(batch_size)])\n    return [[item for item in group if item != MISSING] for group in groups]", "entry_point": "batch", "input": "5, [1, 2, 3]", "output": "[[1, 2, 3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/deeplook/sparklines/blob/dd2525b0358dce1a5aa7088e706201440d39657e/sparklines/sparklines.py#L160-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035684", "code": "def intdivceil(x, y):\n    \"\"\"\n    Returns the exact value of ceil(x // y).\n    No floating point calculations are used.\n    Requires positive integer types. The result\n    is undefined if at least one of the inputs\n    is floating point.\n    \"\"\"\n    result = x // y\n    if (x % y):\n        result += 1\n    return result", "entry_point": "intdivceil", "input": "0.5, 7", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ghackebeil/PyORAM/blob/b8832c1b753c0b2148ef7a143c5f5dd3bbbb61e7/src/pyoram/util/misc.py#L24-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035685", "code": "def filter_pages(pages, pagenum, pagename):\n    \"\"\" Choices pages by pagenum and pagename \"\"\"\n    if pagenum:\n        try:\n            pages = [list(pages)[pagenum - 1]]\n        except IndexError:\n            raise IndexError('Invalid page number: %d' % pagenum)\n\n    if pagename:\n        pages = [page for page in pages if page.name == pagename]\n        if pages == []:\n            raise IndexError('Page not found: pagename=%s' % pagename)\n\n    return pages", "entry_point": "filter_pages", "input": "[-1, 0, 1, 2], 3, ''", "output": "[1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/visio2img/visio2img/blob/60a1359abd2e8cf0d7dfa340fc7c9ace5572b7ac/visio2img/visio2img.py#L31-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035686", "code": "def calculate_median(given_list):\n        \"\"\"\n        Returns the median of values in the given list.\n        \"\"\"\n        median = None\n\n        if not given_list:\n            return median\n\n        given_list = sorted(given_list)\n        list_length = len(given_list)\n\n        if list_length % 2:\n            median = given_list[int(list_length / 2)]\n        else:\n            median = (given_list[int(list_length / 2)] + given_list[int(list_length / 2) - 1]) / 2.0\n\n        return median", "entry_point": "calculate_median", "input": "['a', 'b', 'c']", "output": "'b'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RIPE-NCC/ripe.atlas.sagan/blob/f0e57221cf0ba3504baddd3ea460fc955bc41cc6/ripe/atlas/sagan/base.py#L264-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035687", "code": "def add_prefix(dict_like, prefix):\n    \"\"\"\n    takes a dict (or dict-like object, e.g. etree._Attrib) and adds the\n    given prefix to each key. Always returns a dict (via a typecast).\n\n    Parameters\n    ----------\n    dict_like : dict (or similar)\n        a dictionary or a container that implements .items()\n    prefix : str\n        the prefix string to be prepended to each key in the input dict\n\n    Returns\n    -------\n    prefixed_dict : dict\n        A dict, in which each key begins with the given prefix.\n    \"\"\"\n    if not isinstance(dict_like, dict):\n        try:\n            dict_like = dict(dict_like)\n        except Exception as e:\n            raise ValueError(\"{0}\\nCan't convert container to dict: \"\n                             \"{1}\".format(e, dict_like))\n    return {prefix + k: v for (k, v) in dict_like.items()}", "entry_point": "add_prefix", "input": "{}, 'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arne-cl/discoursegraphs/blob/842f0068a3190be2c75905754521b176b25a54fb/src/discoursegraphs/util.py#L169-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035688", "code": "def tokens2text(docgraph, token_ids):\n    \"\"\"\n    given a list of token node IDs, returns a their string representation\n    (concatenated token strings).\n    \"\"\"\n    return ' '.join(docgraph.node[token_id][docgraph.ns+':token']\n                    for token_id in token_ids)", "entry_point": "tokens2text", "input": "['apple', 'banana', 'cherry'], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arne-cl/discoursegraphs/blob/842f0068a3190be2c75905754521b176b25a54fb/src/discoursegraphs/discoursegraph.py#L1007-L1013", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035689", "code": "def chunk_data(data, chunkSize):\n    '''\n        chunk_data - Chunks a string/bytes into a list of string/bytes, each member up to #chunkSize in length.\n\n        e.x.    chunk_data(\"123456789\", 2) = [\"12\", \"34\", \"56\", \"78\", \"9\"]\n    '''\n    chunkSize = int(chunkSize)\n    return [data[i : i + chunkSize] for i in range(0, len(data), chunkSize)]", "entry_point": "chunk_data", "input": "[1, 2, 3], 7", "output": "[[1, 2, 3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kata198/python-nonblock/blob/3f011b3b3b494ccb44d48179e94167fb7382e4a4/nonblock/BackgroundWrite.py#L343-L350", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035690", "code": "def convert_spanstring(span_string):\n    \"\"\"\n    converts a span of tokens (str, e.g. 'word_88..word_91')\n    into a list of token IDs (e.g. ['word_88', 'word_89', 'word_90', 'word_91']\n\n    Note: Please don't use this function directly, use spanstring2tokens()\n    instead, which checks for non-existing tokens!\n\n    Examples\n    --------\n    >>> convert_spanstring('word_1')\n    ['word_1']\n    >>> convert_spanstring('word_2,word_3')\n    ['word_2', 'word_3']\n    >>> convert_spanstring('word_7..word_11')\n    ['word_7', 'word_8', 'word_9', 'word_10', 'word_11']\n    >>> convert_spanstring('word_2,word_3,word_7..word_9')\n    ['word_2', 'word_3', 'word_7', 'word_8', 'word_9']\n    >>> convert_spanstring('word_7..word_9,word_15,word_17..word_19')\n    ['word_7', 'word_8', 'word_9', 'word_15', 'word_17', 'word_18', 'word_19']\n    \"\"\"\n    prefix_err = \"All tokens must share the same prefix: {0} vs. {1}\"\n\n    tokens = []\n    if not span_string:\n        return tokens\n\n    spans = span_string.split(',')\n    for span in spans:\n        span_elements = span.split('..')\n        if len(span_elements) == 1:\n            tokens.append(span_elements[0])\n        elif len(span_elements) == 2:\n            start, end = span_elements\n            start_prefix, start_id_str = start.split('_')\n            end_prefix, end_id_str = end.split('_')\n            assert start_prefix == end_prefix, prefix_err.format(\n                start_prefix, end_prefix)\n            tokens.extend(\"{0}_{1}\".format(start_prefix, token_id)\n                          for token_id in range(int(start_id_str),\n                                                int(end_id_str)+1))\n\n        else:\n            raise ValueError(\"Can't parse span '{}'\".format(span_string))\n\n    first_prefix = tokens[0].split('_')[0]\n    for token in tokens:\n        token_parts = token.split('_')\n        assert len(token_parts) == 2, \\\n            \"All token IDs must use the format prefix + '_' + number\"\n        assert token_parts[0] == first_prefix, prefix_err.format(\n            token_parts[0], first_prefix)\n    return tokens", "entry_point": "convert_spanstring", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arne-cl/discoursegraphs/blob/842f0068a3190be2c75905754521b176b25a54fb/src/discoursegraphs/readwrite/generic.py#L158-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035691", "code": "def extract_sentences(nodes, token_node_indices):\n    \"\"\"\n    given a list of ``SaltNode``\\s, returns a list of lists, where each list\n    contains the indices of the nodes belonging to that sentence.\n    \"\"\"\n    sents = []\n    tokens = []\n    for i, node in enumerate(nodes):\n        if i in token_node_indices:\n            if node.features['tiger.pos'] != '$.':\n                tokens.append(i)\n            else:  # start a new sentence, if 'tiger.pos' is '$.'\n                tokens.append(i)\n                sents.append(tokens)\n                tokens = []\n    return sents", "entry_point": "extract_sentences", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arne-cl/discoursegraphs/blob/842f0068a3190be2c75905754521b176b25a54fb/src/discoursegraphs/readwrite/salt/nodes.py#L187-L202", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035692", "code": "def subtype_ids(elements, subtype):\n    \"\"\"\n    returns the ids of all elements of a list that have a certain type,\n    e.g. show all the nodes that are ``TokenNode``\\s.\n    \"\"\"\n    return [i for (i, element) in enumerate(elements)\n            if isinstance(element, subtype)]", "entry_point": "subtype_ids", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arne-cl/discoursegraphs/blob/842f0068a3190be2c75905754521b176b25a54fb/src/discoursegraphs/readwrite/salt/saltxmi.py#L381-L387", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035693", "code": "def capitalize(string):\n    \"\"\"Capitalize a sentence.\n\n    Parameters\n    ----------\n    string : `str`\n        String to capitalize.\n\n    Returns\n    -------\n    `str`\n        Capitalized string.\n\n    Examples\n    --------\n    >>> capitalize('worD WORD WoRd')\n    'Word word word'\n    \"\"\"\n    if not string:\n        return string\n    if len(string) == 1:\n        return string.upper()\n    return string[0].upper() + string[1:].lower()", "entry_point": "capitalize", "input": "'abc'", "output": "'Abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dead-beef/markovchain/blob/9bd10b2f01089341c4a875a0fa569d50caba22c7/markovchain/text/util.py#L140-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035694", "code": "def is_visa(n):\n    \"\"\"Checks if credit card number fits the visa format.\"\"\"\n    n, length = str(n), len(str(n))\n\n    if length >= 13 and length <= 16:\n        if n[0] == '4':\n            return True\n    return False", "entry_point": "is_visa", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joshleeb/creditcard/blob/8cff49ba80029026c7e221764eb2387eb2e04a4c/creditcard/formatter.py#L1-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035695", "code": "def is_visa_electron(n):\n    \"\"\"Checks if credit card number fits the visa electron format.\"\"\"\n    n, length = str(n), len(str(n))\n    form = ['026', '508', '844', '913', '917']\n\n    if length == 16:\n        if n[0] == '4':\n            if ''.join(n[1:4]) in form or ''.join(n[1:6]) == '17500':\n                return True\n    return False", "entry_point": "is_visa_electron", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joshleeb/creditcard/blob/8cff49ba80029026c7e221764eb2387eb2e04a4c/creditcard/formatter.py#L11-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035696", "code": "def is_amex(n):\n    \"\"\"Checks if credit card number fits the american express format.\"\"\"\n    n, length = str(n), len(str(n))\n\n    if length == 15:\n        if n[0] == '3' and (n[1] == '4' or n[1] == '7'):\n            return True\n    return False", "entry_point": "is_amex", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joshleeb/creditcard/blob/8cff49ba80029026c7e221764eb2387eb2e04a4c/creditcard/formatter.py#L33-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035697", "code": "def to_list(x):\n    \"\"\"Convert a value to a list.\n\n    Parameters\n    ----------\n    x\n        Value.\n\n    Returns\n    -------\n    `list`\n\n    Examples\n    --------\n    >>> to_list(0)\n    [0]\n    >>> to_list({'x': 0})\n    [{'x': 0}]\n    >>> to_list(x ** 2 for x in range(3))\n    [0, 1, 4]\n    >>> x = [1, 2, 3]\n    >>> to_list(x)\n    [1, 2, 3]\n    >>> _ is x\n    True\n    \"\"\"\n    if isinstance(x, list):\n        return x\n    if not isinstance(x, dict):\n        try:\n            return list(x)\n        except TypeError:\n            pass\n    return [x]", "entry_point": "to_list", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dead-beef/markovchain/blob/9bd10b2f01089341c4a875a0fa569d50caba22c7/markovchain/util.py#L164-L197", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035698", "code": "def parse_media_type(media_type):\n    '''Returns type, subtype, parameter tuple from an http media_type.\n    Can be applied to the 'Accept' or 'Content-Type' http header fields.\n    '''\n    media_type, sep, parameter = str(media_type).partition(';')\n    media_type, sep, subtype = media_type.partition('/')\n    return tuple(x.strip() or None for x in (media_type, subtype, parameter))", "entry_point": "parse_media_type", "input": "[-1, 0, 1, 2]", "output": "('[-1, 0, 1, 2]', None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/deontologician/restnavigator/blob/453b9de4e70e602009d3e3ffafcf77d23c8b07c5/restnavigator/utils.py#L171-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035699", "code": "def do_get_dataset(data, key, create=False):\n        \"\"\"Get a dataset.\n\n        Parameters\n        ----------\n        data : `None` or `dict` of `dict` of ([`int`, `str`] or [`list` of `int`, `list` of `str`])\n            Data.\n        key : `str`\n            Dataset key.\n        create : `bool`, optional\n            Create a dataset if it does not exist.\n\n        Returns\n        -------\n        `None` or `dict` of ([`int`, `str`] or [`list` of `int`, `list` of `str`])\n        \"\"\"\n        if data is None:\n            return None\n        try:\n            return data[key]\n        except KeyError:\n            if create:\n                dataset = {}\n                data[key] = dataset\n                return dataset\n            else:\n                raise", "entry_point": "do_get_dataset", "input": "{'a': 1, 'b': 2}, True, True", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dead-beef/markovchain/blob/9bd10b2f01089341c4a875a0fa569d50caba22c7/markovchain/storage/json.py#L69-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035700", "code": "def normalize_bound(bound):\n    \"\"\"\n    Replace ``None`` with + or - inf in bound tuples.\n\n    Examples\n    --------\n    >>> normalize_bound((2.6, 7.2))\n    (2.6, 7.2)\n\n    >>> normalize_bound((None, 7.2))\n    (-inf, 7.2)\n\n    >>> normalize_bound((2.6, None))\n    (2.6, inf)\n\n    >>> normalize_bound((None, None))\n    (-inf, inf)\n\n    This operation is idempotent:\n\n    >>> normalize_bound((-float(\"inf\"), float(\"inf\")))\n    (-inf, inf)\n    \"\"\"\n    min_, max_ = bound\n\n    if min_ is None:\n        min_ = -float('inf')\n\n    if max_ is None:\n        max_ = float('inf')\n\n    return min_, max_", "entry_point": "normalize_bound", "input": "(1, 2)", "output": "(1, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/NICTA/revrand/blob/4c1881b6c1772d2b988518e49dde954f165acfb6/revrand/optimize/sgd.py#L462-L493", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035701", "code": "def safe_int(val, default=None):\n    \"\"\"\n    Returns int() of val if val is not convertable to int use default\n    instead\n\n    :param val:\n    :param default:\n    \"\"\"\n\n    try:\n        val = int(val)\n    except (ValueError, TypeError):\n        val = default\n\n    return val", "entry_point": "safe_int", "input": "[1, 2, 3], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/codeinn/vcs/blob/e6cd94188e9c36d273411bf3adc0584ac6ab92a0/vcs/utils/__init__.py#L51-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035702", "code": "def make_cmd_invocation(invocation, args, kwargs):\n    \"\"\"\n    >>> make_cmd_invocation('path/program', ['arg1', 'arg2'], {'darg': 4})\n    ['./giotto-cmd', '/path/program/arg1/arg2/', '--darg=4']\n    \"\"\"\n    if not invocation.endswith('/'):\n        invocation += '/'\n    if not invocation.startswith('/'):\n        invocation = '/' + invocation\n\n    cmd = invocation\n\n    for arg in args:\n        cmd += str(arg) + \"/\"\n\n    rendered_kwargs = []\n    for k, v in kwargs.items():\n        rendered_kwargs.append(\"--%s=%s\" % (k,v))\n    \n    return ['./giotto-cmd', cmd] + rendered_kwargs", "entry_point": "make_cmd_invocation", "input": "'Hello World', set(), {'a': 1, 'b': 2}", "output": "['./giotto-cmd', '/Hello World/', '--a=1', '--b=2']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/priestc/giotto/blob/d4c26380caefa7745bb27135e315de830f7254d3/giotto/controllers/cmd.py#L19-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035703", "code": "def text2labels(text, sents):\n    '''\n    Marks all characters in given `text`, that doesn't exists within any\n    element of `sents` with `1` character, other characters (within sentences)\n    will be marked with `0`\n    Used in training process\n    >>> text = '\u043f\u0440\u0438\u0432\u0435\u0442. \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0430\u043d\u044f.'\n    >>> sents = ['\u043f\u0440\u0438\u0432\u0435\u0442.', '\u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0430\u043d\u044f.']\n    >>> labels = text2labels(text, sents)\n    >>> ' '.join(text)\n    >>> '\u043f \u0440 \u0438 \u0432 \u0435 \u0442 .   \u043c \u0435 \u043d \u044f   \u0437 \u043e \u0432 \u0443 \u0442   \u0430 \u043d \u044f .'\n    >>> ' '.join(labels)\n    >>> '0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'\n    '''\n    labels = [c for c in text]\n    for sent in sents:\n        start = text.index(sent)\n        finish = start + len(sent)\n        labels[start:finish] = '0' * len(sent)\n    for i, c in enumerate(labels):\n        if c != '0':\n            labels[i] = '1'\n    return labels", "entry_point": "text2labels", "input": "'', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bureaucratic-labs/models/blob/e674c622af883abd094293fb20c325742080577a/b_labs_models/segmentation.py#L76-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035704", "code": "def get_model_counts(tagged_models, tag):\n    \"\"\" This does a model count so the side bar looks nice.\n    \"\"\"\n    model_counts = []\n    for model in tagged_models:\n        model['count'] = model['query'](tag).count()\n        if model['count']:\n            model_counts.append(model)\n                 \n    return model_counts", "entry_point": "get_model_counts", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pydanny/django-tagging-ext/blob/a25a79ddcd760c5ab272713178f40fedd9146b41/tagging_ext/views.py#L21-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035705", "code": "def count_dimensions(entry):\n    \"\"\"Counts the number of dimensions from a nested list of dimension assignments\n    that may include function calls.\n    \"\"\"\n    result = 0\n    for e in entry:\n        if isinstance(e, str):\n            sliced = e.strip(\",\").split(\",\")\n            result += 0 if len(sliced) == 1 and sliced[0] == \"\" else len(sliced)\n    return result", "entry_point": "count_dimensions", "input": "[5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/variable.py#L223-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035706", "code": "def generate_branches(scales=None, angles=None, shift_angle=0):\n    \"\"\"Generates branches with alternative system.\n\n    Args:\n        scales (tuple/array): Indicating how the branch/es length/es develop/s from age to age.\n        angles (tuple/array): Holding the branch and shift angle in radians.\n        shift_angle (float): Holding the rotation angle for all branches.\n\n    Returns:\n        branches (2d-array): A array constits of arrays holding scale and angle for every branch.\n    \"\"\"\n    branches = []\n    for pos, scale in enumerate(scales):\n        angle = -sum(angles)/2 + sum(angles[:pos]) + shift_angle\n        branches.append([scale, angle])\n    return branches", "entry_point": "generate_branches", "input": "[[1, 2], [3], []], [-1, 0, 1, 2], 0.5", "output": "[[[1, 2], -0.5], [[3], -1.5], [[], -1.5]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PixelwarStudio/PyTree/blob/f14b25ea145da6b00d836e34251d2a4c823766dc/Tree/core.py#L225-L240", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035707", "code": "def wrap_line(line, limit=None, chars=80):\n    \"\"\"Wraps the specified line of text on whitespace to make sure that none of the\n    lines' lengths exceeds 'chars' characters.\n    \"\"\"\n    result = []\n    builder = []\n    length = 0\n    if limit is not None:\n        sline = line[0:limit]\n    else:\n        sline = line\n        \n    for word in sline.split():\n        if length <= chars:\n            builder.append(word)\n            length += len(word) + 1\n        else:\n            result.append(' '.join(builder))\n            builder = [word]\n            length = 0\n\n    result.append(' '.join(builder))\n    return result", "entry_point": "wrap_line", "input": "'', 1, [[1, 2], [3], []]", "output": "['']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/utility.py#L157-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035708", "code": "def _char2int(char):\n    \"\"\" translate characters to integer values (upper and lower case)\"\"\"\n    if char.isdigit():\n        return int(float(char))\n    if char.isupper():\n        return int(char, 36)\n    else:\n        return 26 + int(char, 36)", "entry_point": "_char2int", "input": "'  padded  '", "output": "1529074479", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mommermi/callhorizons/blob/fdd7ad9e87cac107c1b7f88e594d118210da3b1a/callhorizons/callhorizons.py#L46-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035709", "code": "def hash_iterable(it):\n\t\"\"\"Perform a O(1) memory hash of an iterable of arbitrary length.\n\n\thash(tuple(it)) creates a temporary tuple containing all values from it\n\twhich could be a problem if it is large.\n\n\tSee discussion at:\n\thttps://groups.google.com/forum/#!msg/python-ideas/XcuC01a8SYs/e-doB9TbDwAJ\n\t\"\"\"\n\thash_value = hash(type(it))\n\tfor value in it:\n\t\thash_value = hash((hash_value, value))\n\treturn hash_value", "entry_point": "hash_iterable", "input": "['apple', 'banana', 'cherry']", "output": "7618918399064575714", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mlenzen/collections-extended/blob/ee9e86f6bbef442dbebcb3a5970642c5c969e2cf/collections_extended/_util.py#L7-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035710", "code": "def parse_options(s):\n    \"\"\"\n    Expects a string in the form \"key=val:key2=val2\" and returns a\n    dictionary.\n\n    \"\"\"\n    options = {}\n    for option in s.split(':'):\n        if '=' in option:\n            key, val = option.split('=')\n            options[str(key).strip()] = val.strip()\n    return options", "entry_point": "parse_options", "input": "'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/parse.py#L55-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035711", "code": "def unpack(rv):\n    \"\"\"\n    Convert rv to tuple(data, code, headers)\n\n    Args:\n        rv: data or tuple that contain code and headers\n    Returns:\n        tuple (rv, status, headers)\n    \"\"\"\n    status = headers = None\n    if isinstance(rv, tuple):\n        rv, status, headers = rv + (None,) * (3 - len(rv))\n    if isinstance(status, (dict, list)):\n        headers, status = status, headers\n    return (rv, status, headers)", "entry_point": "unpack", "input": "['a', 'b', 'c']", "output": "(['a', 'b', 'c'], None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L65-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035712", "code": "def get_title(desc, default=None):\n    \"\"\"Get title of desc\"\"\"\n    if not desc:\n        return default\n    lines = desc.strip('\\n').split('\\n')\n    if not lines:\n        return default\n    return lines[0].lstrip('# ').rstrip(' ')", "entry_point": "get_title", "input": "[], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L171-L178", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035713", "code": "def decode(data):\n        \"Decodes a syncsafe integer\"\n        value = 0\n        for b in data:\n            if b > 127:  # iTunes bug\n                raise ValueError(\"Invalid syncsafe integer\")\n            value <<= 7\n            value += b\n        return value", "entry_point": "decode", "input": "[1, 2, 3]", "output": "16643", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/conversion.py#L95-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035714", "code": "def render_core(url_prefix, auth_header, resources):\n    \"\"\"Generate res.core.js\"\"\"\n    code = ''\n    code += \"function(root, init) {\\n\"\n    code += \"  var q = init('%(auth_header)s', '%(url_prefix)s');\\n\" %\\\n        {'url_prefix': url_prefix, 'auth_header': auth_header}\n    code += \"  var r = null;\\n\"\n    for key in resources:\n        code += \"  r = root.%(key)s = {};\\n\" % {'key': key}\n        for action, item in resources[key].items():\n            code += \"    r.%(action)s = q('%(url)s', '%(method)s');\\n\" %\\\n                {'action': action,\n                 'url': item['url'],\n                 'method': item['method']}\n    code += \"}\"\n    return code", "entry_point": "render_core", "input": "'abc', [[1, 2], [3], []], []", "output": "\"function(root, init) {\\n  var q = init('[[1, 2], [3], []]', 'abc');\\n  var r = null;\\n}\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/cli.py#L48-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035715", "code": "def endswith_partial(text, partial_str):\n    '''Check if the text ends with any partial version of the\n    specified string.'''\n    # at the end of the content\n    # we don't care about complete overlap, so start checking\n    # for matches without the last character\n    test_str = partial_str[:-1]\n    # look for progressively smaller segments\n    while test_str:\n        if text.endswith(test_str):\n            return len(test_str)\n        test_str = test_str[:-1]\n    return False", "entry_point": "endswith_partial", "input": "'AbC dEf', []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/syncutil.py#L540-L552", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035716", "code": "def guess_mime_type(content, deftype):\n    \"\"\"Description: Guess the mime type of a block of text\n    :param content: content we're finding the type of\n    :type str:\n\n    :param deftype: Default mime type\n    :type str:\n\n    :rtype: <type>:\n    :return: <description>\n    \"\"\"\n    #Mappings recognized by cloudinit\n    starts_with_mappings={\n        '#include' : 'text/x-include-url',\n        '#!' : 'text/x-shellscript',\n        '#cloud-config' : 'text/cloud-config',\n        '#upstart-job'  : 'text/upstart-job',\n        '#part-handler' : 'text/part-handler',\n        '#cloud-boothook' : 'text/cloud-boothook'\n    }\n    rtype = deftype\n    for possible_type,mimetype in starts_with_mappings.items():\n        if content.startswith(possible_type):\n            rtype = mimetype\n            break\n    return(rtype)", "entry_point": "guess_mime_type", "input": "'a,b,c', 2", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/utils.py#L678-L703", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035717", "code": "def _calculate_index_of_coincidence(frequency_map, length):\n    \"\"\"A measure of how similar frequency_map is to the uniform distribution.\n    Or the probability that two letters picked randomly are alike.\n    \"\"\"\n    if length <= 1:\n        return 0\n        # We cannot error here as length can legitimiately be 1.\n        # Imagine a ciphertext of length 3 and a key of length 2.\n        # Spliting this text up and calculating the index of coincidence results in ['AC', 'B']\n        # IOC of B will be calcuated for the 2nd column of the key. We could represent the same\n        # encryption with a key of length 3 but then we encounter the same problem. This is also\n        # legitimiate encryption scheme we cannot ignore. Hence we have to deal with this fact here\n        # A value of 0 will impact the overall mean, however it does make some sense when you ask the question\n        # How many ways to choose 2 letters from the text, if theres only 1 letter then the answer is 0.\n\n    # Mathemtical combination, number of ways to choose 2 letters, no replacement, order doesnt matter\n    combination_of_letters = sum(freq * (freq - 1) for freq in frequency_map.values())\n    return combination_of_letters / (length * (length - 1))", "entry_point": "_calculate_index_of_coincidence", "input": "{}, 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CameronLonsdale/lantern/blob/235e163e96bf0719d49c54204ee576b2ca93abb6/lantern/analysis/frequency.py#L79-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035718", "code": "def remove(text, exclude):\n    \"\"\"Remove ``exclude`` symbols from ``text``.\n\n    Example:\n        >>> remove(\"example text\", string.whitespace)\n        'exampletext'\n\n    Args:\n        text (str): The text to modify\n        exclude (iterable): The symbols to exclude\n\n    Returns:\n        ``text`` with ``exclude`` symbols removed\n    \"\"\"\n    exclude = ''.join(str(symbol) for symbol in exclude)\n    return text.translate(str.maketrans('', '', exclude))", "entry_point": "remove", "input": "'abc', ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CameronLonsdale/lantern/blob/235e163e96bf0719d49c54204ee576b2ca93abb6/lantern/util.py#L6-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035719", "code": "def group(text, size):\n    \"\"\"Group ``text`` into blocks of ``size``.\n\n    Example:\n        >>> group(\"test\", 2)\n        ['te', 'st']\n\n    Args:\n        text (str): text to separate\n        size (int): size of groups to split the text into\n\n    Returns:\n        List of n-sized groups of text\n\n    Raises:\n        ValueError: If n is non positive\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"n must be a positive integer\")\n\n    return [text[i:i + size] for i in range(0, len(text), size)]", "entry_point": "group", "input": "'abc', 2", "output": "['ab', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CameronLonsdale/lantern/blob/235e163e96bf0719d49c54204ee576b2ca93abb6/lantern/util.py#L91-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035720", "code": "def _fromstring(value):\n    '''_fromstring\n\n    Convert XML string value to None, boolean, int or float.\n    '''\n\n    if not value:\n        return None\n    std_value = value.strip().lower()\n    if std_value == 'true':\n        return 'true'\n    elif std_value == 'false':\n        return 'false'\n#     try:\n#         return int(std_value)\n#     except ValueError:\n#         pass\n#     try:\n#         return float(std_value)\n#     except ValueError:\n#         pass\n    return value", "entry_point": "_fromstring", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CiscoTestAutomation/yang/blob/c70ec5ac5a91f276c4060009203770ece92e76b4/ncdiff/src/yang/ncdiff/gnmi.py#L60-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035721", "code": "def _fromstring(value):\n    '''_fromstring\n\n    Convert XML string value to None, boolean, int or float.\n    '''\n\n    if not value:\n        return [None]\n    std_value = value.strip().lower()\n    if std_value == 'true':\n        return True\n    elif std_value == 'false':\n        return False\n    try:\n        return int(std_value)\n    except ValueError:\n        pass\n    try:\n        return float(std_value)\n    except ValueError:\n        pass\n    return value", "entry_point": "_fromstring", "input": "False", "output": "[None]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CiscoTestAutomation/yang/blob/c70ec5ac5a91f276c4060009203770ece92e76b4/ncdiff/src/yang/ncdiff/restconf.py#L40-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035722", "code": "def get_host(url):\n    \"\"\"\n    Given a url, return its scheme, host and port (None if it's not there).\n\n    For example: ::\n\n        >>> get_host('http://google.com/mail/')\n        ('http', 'google.com', None)\n        >>> get_host('google.com:80')\n        ('http', 'google.com', 80)\n    \"\"\"\n    # This code is actually similar to urlparse.urlsplit, but much\n    # simplified for our needs.\n    port = None\n    scheme = 'http'\n    if '//' in url:\n        scheme, url = url.split('://', 1)\n    if '/' in url:\n        url, _path = url.split('/', 1)\n    if ':' in url:\n        url, port = url.split(':', 1)\n        port = int(port)\n    return scheme, url, port", "entry_point": "get_host", "input": "[]", "output": "('http', [], None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bububa/pyTOP/blob/1e48009bcfe886be392628244b370e6374e1f2b2/pyTOP/packages/requests/packages/urllib3/connectionpool.py#L476-L498", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035723", "code": "def __build_author_name_expr(author_name, author_email_address):\n    \"\"\"\n    Build the name of the author of a message as described in the Internet\n    Message Format specification: https://tools.ietf.org/html/rfc5322#section-3.6.2\n\n\n    @param author_name: complete name of the originator of the message.\n\n    @param author_email_address: address of the mailbox to which the author\n        of the message suggests that replies be sent.\n\n\n    @return: a string representing the author of the message, that is, the\n        mailbox of the person or system responsible for the writing of the\n        message.  This string is intended to be used as the \"From:\" field\n        of the message.\n    \"\"\"\n    assert author_name or author_email_address, 'Both arguments MUST NOT be bull'\n\n    # Use the specified name of the author or the username of his email\n    # address.\n    author_name_expr = author_name or author_email_address[:author_email_address.find('@')]\n\n    # Escape the name of the author if it contains a space character.\n    if ' ' in author_name_expr:\n        author_name_expr = '\"%s\"' % author_name_expr\n\n    # Complete the name of the author with his email address when specified.\n    if author_email_address:\n        author_name_expr = '%s <%s>' % (author_name_expr, author_email_address)\n\n    return author_name_expr", "entry_point": "__build_author_name_expr", "input": "'walnut thistle harbour', [-1, 0, 1, 2]", "output": "'\"walnut thistle harbour\" <[-1, 0, 1, 2]>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dcaune/perseus-lib-python-common/blob/ba48fe0fd9bb4a75b53e7d10c41ada36a72d4496/majormode/perseus/utils/email_util.py#L44-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035724", "code": "def content_item(path1, path2, path_sep='/'):\n    \"\"\"\n    if path1 is subpart of path2, get the next path item.\n    example:\n    path1 = '/foo'\n    path2 = '/foo/bar/foo'\n    -> 'bar'\n\n    \"\"\"\n    p1_parts = path1.split(path_sep)\n    p2_parts = path2.split(path_sep)\n    # special case when path1 is root\n    if path1 == path_sep and len(p2_parts) >= 2:\n        return p2_parts[1]\n    if len(p2_parts) <= len(p1_parts):\n        return ''\n    for i, item in enumerate(p1_parts):\n        if item != p2_parts[i]:\n            return ''\n    return p2_parts[i+1]", "entry_point": "content_item", "input": "'walnut thistle harbour', 'a,b,c', '  padded  '", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AbletonAG/abl.vpath/blob/a57491347f6e7567afa047216e5b6f6035226eaf/abl/vpath/base/zip.py#L39-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035725", "code": "def _commonprefix(m):\n    \"Given a list of pathnames, returns the longest common leading component\"\n    if not m:\n        return ''\n    prefix = m[0]\n    for item in m:\n        for i in range(len(prefix)):\n            if prefix[:i+1] != item[:i+1]:\n                prefix = prefix[:i]\n                if i == 0:\n                    return ''\n                break\n    return prefix", "entry_point": "_commonprefix", "input": "['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sci-bots/pygtkhelpers/blob/3a6e6d6340221c686229cd1c951d7537dae81b07/pygtkhelpers/debug/console.py#L56-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035726", "code": "def split_authority(authority):\n    \"\"\"\n       Basic authority parser that splits authority into component parts\n\n       >>> split_authority(\"user:password@host:port\")\n       ('user', 'password', 'host', 'port')\n\n    \"\"\"\n    if '@' in authority:\n        userinfo, hostport = authority.split('@', 1)\n    else:\n        userinfo, hostport = None, authority\n    if userinfo and ':' in userinfo:\n        user, passwd = userinfo.split(':', 1)\n    else:\n        user, passwd = userinfo, None\n    if hostport and ':' in hostport:\n        host, port = hostport.split(':', 1)\n    else:\n        host, port = hostport, None\n    if not host:\n        host = None\n    return (user, passwd, host, port)", "entry_point": "split_authority", "input": "['apple', 'banana', 'cherry']", "output": "(None, None, ['apple', 'banana', 'cherry'], None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AbletonAG/abl.vpath/blob/a57491347f6e7567afa047216e5b6f6035226eaf/abl/vpath/base/uriparse.py#L114-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035727", "code": "def special_mode(v):\n    \"\"\"decode Olympus SpecialMode tag in MakerNote\"\"\"\n    mode1 = {\n        0: 'Normal',\n        1: 'Unknown',\n        2: 'Fast',\n        3: 'Panorama',\n    }\n    mode2 = {\n        0: 'Non-panoramic',\n        1: 'Left to right',\n        2: 'Right to left',\n        3: 'Bottom to top',\n        4: 'Top to bottom',\n    }\n    if not v or (v[0] not in mode1 or v[2] not in mode2):\n        return v\n    return '%s - sequence %d - %s' % (mode1[v[0]], v[1], mode2[v[2]])", "entry_point": "special_mode", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dcaune/perseus-lib-python-common/blob/ba48fe0fd9bb4a75b53e7d10c41ada36a72d4496/exifread/tags/makernote/olympus.py#L4-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035728", "code": "def tmpl_delchars(text, chars):\n        \"\"\"\n        * synopsis: ``%delchars{text,chars}``\n        * description: Delete every single character of \u201cchars\u201c in \u201ctext\u201d.\n        \"\"\"\n        for char in chars:\n            text = text.replace(char, '')\n        return text", "entry_point": "tmpl_delchars", "input": "'abc', ['apple', 'banana', 'cherry']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Josef-Friedrich/tmep/blob/326de14f5b9498696a1f06a8be3d39e33e376102/tmep/functions.py#L94-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035729", "code": "def tmpl_replchars(text, replace, chars):\n        \"\"\"\n        * synopsis: ``%replchars{text,chars,replace}``\n        * description: Replace the characters \u201cchars\u201d in \u201ctext\u201d with \\\n            \u201creplace\u201d.\n        * example: ``%replchars{text,ex,-}`` > ``t--t``\n        \"\"\"\n        for char in chars:\n            text = text.replace(char, replace)\n        return text", "entry_point": "tmpl_replchars", "input": "0.5, 0.5, set()", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Josef-Friedrich/tmep/blob/326de14f5b9498696a1f06a8be3d39e33e376102/tmep/functions.py#L290-L299", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035730", "code": "def intersect(d1, d2):\n    \"\"\"Intersect dictionaries d1 and d2 by key *and* value.\"\"\"\n    return dict((k, d1[k]) for k in d1 if k in d2 and d1[k] == d2[k])", "entry_point": "intersect", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brunobord/meuhdb/blob/2ef2ea0b1065768d88f52bacf1b94b3d3ce3d9eb/meuhdb/core.py#L29-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035731", "code": "def make_string(seq):\n    \"\"\"\n    Don't throw an exception when given an out of range character.\n    \"\"\"\n    string = ''\n    for c in seq:\n        # Screen out non-printing characters\n        try:\n            if 32 <= c and c < 256:\n                string += chr(c)\n        except TypeError:\n            pass\n        # If no printing chars\n    if not string:\n        return str(seq)\n    return string", "entry_point": "make_string", "input": "['a', 'b', 'c']", "output": "\"['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dcaune/perseus-lib-python-common/blob/ba48fe0fd9bb4a75b53e7d10c41ada36a72d4496/exifread/utils.py#L12-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035732", "code": "def compute_ratio(x):\n        \"\"\"\n        \u8ba1\u7b97\u6bcf\u4e00\u7c7b\u6570\u636e\u7684\u5360\u6bd4\n        \"\"\"\n        sum_ = sum(x)\n        ratios = []\n        for i in x:\n            ratio = i / sum_\n            ratios.append(ratio)\n        return ratios", "entry_point": "compute_ratio", "input": "[5, 3, 1, 4]", "output": "[0.38461538461538464, 0.23076923076923078, 0.07692307692307693, 0.3076923076923077]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zengbin93/zb/blob/ccdb384a0b5801b459933220efcb71972c2b89a7/zb/visz/stacked_bar_chart.py#L29-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035733", "code": "def expand_items(form_values, sep='.'):\n    '''\n    Parameters\n    ----------\n    form_values : list\n        List of ``(key, value)`` tuples, where ``key`` corresponds to the\n        ancestor keys of the respective value joined by ``'.'``.  For example,\n        the key ``'a.b.c'`` would be expanded to the dictionary\n        ``{'a': {'b': {'c': 'foo'}}}``.\n\n    Returns\n    -------\n    dict\n        Nested dictionary, where levels are inferred from each key by splitting\n        on ``'.'``.\n    '''\n    output = {}\n    for keys_str_i, value_i in form_values:\n        keys_i = keys_str_i.split(sep)\n        parents_i = keys_i[:-1]\n        fieldname_i = keys_i[-1]\n\n        dict_j = output\n        for key_j in parents_i:\n            dict_j = dict_j.setdefault(key_j,  {})\n        dict_j[fieldname_i] = value_i\n    return output", "entry_point": "expand_items", "input": "[], 'a,b,c'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sci-bots/pygtkhelpers/blob/3a6e6d6340221c686229cd1c951d7537dae81b07/pygtkhelpers/schema.py#L21-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035734", "code": "def inicap_string(string,\n        cleanse=False):\n    \"\"\"\n    Convert the first letter of each word to capital letter without\n    touching the rest of the word.\n\n    @param string: a string.\n\n    @param cleanse: ``True`` to remove any separator character from the\n        string, such as comma; ``False`` to keeps any character but space.\n\n    @return: a string for which the first letter of each word has been\n        capitalized without modifying the case of the rest of the word.\n    \"\"\"\n    return string and ' '.join(word[0].upper() + word[1:]\n            for word in (string.split() if cleanse else string.split(' ')))", "entry_point": "inicap_string", "input": "'a,b,c', [1, 2, 3]", "output": "'A,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dcaune/perseus-lib-python-common/blob/ba48fe0fd9bb4a75b53e7d10c41ada36a72d4496/majormode/perseus/utils/string_util.py#L60-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035735", "code": "def distinct(xs):\n    \"\"\"Get the list of distinct values with preserving order.\"\"\"\n    # don't use collections.OrderedDict because we do support Python 2.6\n    seen = set()\n    return [x for x in xs if x not in seen and not seen.add(x)]", "entry_point": "distinct", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mogproject/mog-commons-python/blob/951cf0fa9a56248b4d45be720be25f1d4b7e1bff/src/mog_commons/collection.py#L26-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035736", "code": "def _citation_to_string(citation):\r\n    \"\"\"\r\n    Convert citation object to a string, using standard citation formatting.  \r\n\r\n    args:\r\n        citation:   a dictionary potentially containing all fields from\r\n            pypif.obj.Reference, and possibly a few others\r\n\r\n    TODO: This is tedious and fragile.  Find a better way to get 'er done.\r\n    TODO: This function assumes that citations are either to books or journals.\r\n        urls are ignored.\r\n\r\n    references: \r\n        http://citrineinformatics.github.io/pif-documentation/schema_definition/common/Reference.html\r\n        http://www.scientificstyleandformat.org/Tools/SSF-Citation-Quick-Guide.html\r\n    \"\"\"\r\n    output = ''\r\n    sep = '. '\r\n\r\n    if 'authors' in citation:\r\n        authors = []\r\n        for author in citation['authors']:\r\n            if 'family_name' not in author:\r\n                continue\r\n            author_name = author['family_name']\r\n            if 'given_name' in author:\r\n                author_name += ' ' + author['given_name']\r\n            authors.append(author_name)\r\n        output += ', '.join(authors) + sep\r\n    if 'year' in citation:\r\n        output += str(citation['year']) + sep\r\n    if 'title' in citation:\r\n        output += citation['title'] + sep\r\n\r\n    if 'journal' in citation:\r\n        output += citation['journal'] + sep\r\n        if 'volume' in citation:\r\n            output += citation['volume']\r\n            if 'issue' in citation:\r\n                output += '(' + citation['issue'] + ')'\r\n            if 'page_location' in citation:\r\n                output += ':' + citation['page_location'] + sep\r\n    else:   # assume for now that the reference is to a book\r\n            # TODO(Handle url case.)\r\n        if 'edition' in citation:\r\n            output += citation['edition'] + sep\r\n        if 'publication_location' in citation:\r\n            output += citation['publication_location']\r\n            if 'publisher' in citation:\r\n                output += ': ' + citation['publisher'] + sep\r\n        elif 'publisher' in citation:\r\n            output += citation['publisher'] + sep\r\n        if 'extent' in citation:\r\n            output += citation['extent'] + sep\r\n        if 'notes' in citation:\r\n            output += citation['notes'] + sep\r\n\r\n    return output.strip()", "entry_point": "_citation_to_string", "input": "[-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MaterialsDataInfrastructureConsortium/CommonMetadata/blob/282d67fdd20f8535c108a7651348633aabdfa82b/matmeta/payload_metaclass.py#L90-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035737", "code": "def __compare_ips(first, second):\n\t\t\"\"\"Compare IPs\n\n\t\tCompares two IPs and returns a status based on which is greater\n\t\tIf first is less than second: -1\n\t\tIf first is equal to second: 0\n\t\tIf first is greater than second: 1\n\n\t\tArguments:\n\t\t\tfirst {str} -- A string representing an IP address\n\t\t\tsecond {str} -- A string representing an IP address\n\n\t\tReturns:\n\t\t\tint\n\t\t\"\"\"\n\n\t\t# If the two IPs are the same, return 0\n\t\tif first == second:\n\t\t\treturn 0\n\n\t\t# Create lists from the split of each IP, store them as ints\n\t\tlFirst = [int(i) for i in first.split('.')]\n\t\tlSecond = [int(i) for i in second.split('.')]\n\n\t\t# Go through each part from left to right until we find the\n\t\t# \tdifference\n\t\tfor i in [0, 1, 2, 3]:\n\n\t\t\t# If the part of x is greater than the part of y\n\t\t\tif lFirst[i] > lSecond[i]:\n\t\t\t\treturn 1\n\n\t\t\t# Else if the part of x is less than the part of y\n\t\t\telif lFirst[i] < lSecond[i]:\n\t\t\t\treturn -1", "entry_point": "__compare_ips", "input": "[1, 2, 3], [1, 2, 3]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ouroboroscoding/format-oc-python/blob/c160b46fe4ff2c92333c776991c712de23991225/FormatOC/__init__.py#L995-L1029", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035738", "code": "def thread_setup(read_and_decode_fn, example_serialized, num_threads):\n        \"\"\" Sets up the threads within each reader \"\"\"\n        decoded_data = list()\n        for _ in range(num_threads):\n            decoded_data.append(read_and_decode_fn(example_serialized))\n        return decoded_data", "entry_point": "thread_setup", "input": "['apple', 'banana', 'cherry'], [], 0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dancsalo/TensorBase/blob/3d42a326452bd03427034916ff2fb90730020204/tensorbase/base.py#L170-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035739", "code": "def check_str(obj):\n        \"\"\" Returns a string for various input types \"\"\"\n        if isinstance(obj, str):\n            return obj\n        if isinstance(obj, float):\n            return str(int(obj))\n        else:\n            return str(obj)", "entry_point": "check_str", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dancsalo/TensorBase/blob/3d42a326452bd03427034916ff2fb90730020204/tensorbase/base.py#L373-L380", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035740", "code": "def lowercase_chars(string: any) -> str:\n        \"\"\"Return all (and only) the lowercase chars in the given string.\"\"\"\n        return ''.join([c if c.islower() else '' for c in str(string)])", "entry_point": "lowercase_chars", "input": "'walnut thistle harbour'", "output": "'walnutthistleharbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HacKanCuBa/passphrase-py/blob/219d6374338ed9a1475b4f09b0d85212376f11e0/passphrase/aux.py#L38-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035741", "code": "def uppercase_chars(string: any) -> str:\n        \"\"\"Return all (and only) the uppercase chars in the given string.\"\"\"\n        return ''.join([c if c.isupper() else '' for c in str(string)])", "entry_point": "uppercase_chars", "input": "'  padded  '", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HacKanCuBa/passphrase-py/blob/219d6374338ed9a1475b4f09b0d85212376f11e0/passphrase/aux.py#L43-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035742", "code": "def chars(string: any) -> str:\n        \"\"\"Return all (and only) the chars in the given string.\"\"\"\n        return ''.join([c if c.isalpha() else '' for c in str(string)])", "entry_point": "chars", "input": "'AbC dEf'", "output": "'AbCdEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HacKanCuBa/passphrase-py/blob/219d6374338ed9a1475b4f09b0d85212376f11e0/passphrase/aux.py#L48-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035743", "code": "def _get_standard_tc_matches(text, full_text, options):\n    '''\n    get the standard tab completions.\n    These are the options which could complete the full_text.\n    '''\n    final_matches = [o for o in options if o.startswith(full_text)]\n    return final_matches", "entry_point": "_get_standard_tc_matches", "input": "'', 'walnut thistle harbour', {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toejough/pimento/blob/cdb00a93976733aa5521f8504152cedeedfc711a/pimento/__init__.py#L33-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035744", "code": "def _dedup(items, insensitive):\n    '''\n    Deduplicate an item list, and preserve order.\n\n    For case-insensitive lists, drop items if they case-insensitively match\n    a prior item.\n    '''\n    deduped = []\n    if insensitive:\n        i_deduped = []\n        for item in items:\n            lowered = item.lower()\n            if lowered not in i_deduped:\n                deduped.append(item)\n                i_deduped.append(lowered)\n    else:\n        for item in items:\n            if item not in deduped:\n                deduped.append(item)\n    return deduped", "entry_point": "_dedup", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/toejough/pimento/blob/cdb00a93976733aa5521f8504152cedeedfc711a/pimento/__init__.py#L528-L547", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035745", "code": "def leb128_encode(value):\n        \"\"\"\n        Encodes an integer using LEB128.\n\n        :param int value: The value to encode.\n        :return: The LEB128-encoded integer.\n        :rtype: bytes\n        \"\"\"\n        if value == 0:\n            return b'\\x00'\n\n        result = []\n        while value != 0:\n            byte = value & 0x7f\n            value >>= 7\n            if value != 0:\n                byte |= 0x80\n            result.append(byte)\n\n        return bytes(result)", "entry_point": "leb128_encode", "input": "False", "output": "b'\\x00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenAssets/openassets/blob/e8eb5b80b9703c80980cb275dd85f17d50e39c60/openassets/protocol.py#L506-L525", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035746", "code": "def parameter_table(parameters):\n        \"\"\"\n        Create\n        \"\"\"\n        if not isinstance(parameters, list): parameters = [parameters]\n        rows = []\n        for param in parameters:\n            row = []\n            row.append('$' + param['tex_symbol'] + '$')\n            row.append('$=$')\n            row.append(r'$\\SI{' + param['disply_value'] + '}{' + param['siunitx'] + '}$')\n            rows.append(row)\n        return rows", "entry_point": "parameter_table", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/razor-x/scipy-data_fitting/blob/c756a645da8629699b3f22244bfb7d5d4d88b179/scipy_data_fitting/figure/plot.py#L163-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035747", "code": "def list_of_lists_to_dict(l):\n    \"\"\" Convert list of key,value lists to dict\n\n    [['id', 1], ['id', 2], ['id', 3], ['foo': 4]]\n    {'id': [1, 2, 3], 'foo': [4]}\n    \"\"\"\n    d = {}\n    for key, val in l:\n        d.setdefault(key, []).append(val)\n    return d", "entry_point": "list_of_lists_to_dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sacrud/sacrud/blob/40dcbb22083cb1ad4c1f626843397b89c2ce18f5/sacrud/preprocessing.py#L23-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035748", "code": "def unique(input_list):\n    \"\"\"\n    Return a list of unique items (similar to set functionality).\n\n    Parameters\n    ----------\n    input_list : list\n        A list containg some items that can occur more than once.\n\n    Returns\n    -------\n    list\n        A list with only unique occurances of an item.\n\n    \"\"\"\n    output = []\n    for item in input_list:\n        if item not in output:\n            output.append(item)\n    return output", "entry_point": "unique", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marcinmiklitz/pywindow/blob/e5264812157224f22a691741ca2e0aefdc9bd2eb/pywindow/utilities.py#L92-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035749", "code": "def check_version_2(dataset):\n    \"\"\"Checks if json-stat version attribute exists and is equal or greater \\\n       than 2.0 for a given dataset.\n\n       Args:\n         dataset (OrderedDict): data in JSON-stat format, previously \\\n                                   deserialized to a python object by \\\n                                   json.load() or json.loads(),\n\n       Returns:\n         bool: True if version exists and is equal or greater than 2.0, \\\n               False otherwise. For datasets without the version attribute, \\\n               always return False.\n\n       \"\"\"\n\n    if float(dataset.get('version')) >= 2.0 \\\n            if dataset.get('version') else False:\n        return True\n    else:\n        return False", "entry_point": "check_version_2", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/predicador37/pyjstat/blob/45d671835a99eb573e1058cd43ce93ac4f85f9fa/pyjstat/pyjstat.py#L99-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035750", "code": "def uniquify(seq):\n    \"\"\"Return unique values in a list in the original order. See:  \\\n        http://www.peterbe.com/plog/uniqifiers-benchmark\n\n    Args:\n      seq (list): original list.\n\n    Returns:\n      list: list without duplicates preserving original order.\n\n    \"\"\"\n\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if x not in seen and not seen_add(x)]", "entry_point": "uniquify", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/predicador37/pyjstat/blob/45d671835a99eb573e1058cd43ce93ac4f85f9fa/pyjstat/pyjstat.py#L352-L366", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035751", "code": "def    syd(c, s, l):\n    \"\"\" This accountancy function computes sum of the years\n    digits depreciation for an asset purchased for cash\n    with a known life span and salvage value.  The depreciation\n    is returned as a list in python.\n    c = historcal cost or price paid\n    s = the expected salvage proceeds\n    l = expected useful life of the fixed asset\n    Example: syd(1000, 100, 5)\n    \"\"\"\n    return [(c-s) * (x/(l*(l+1)/2)) for x in range(l,0,-1)]", "entry_point": "syd", "input": "{}, 10, False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bristosoft/financial/blob/382c4fef610d67777d7109d9d0ae230ab67ca20f/finance.py#L90-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035752", "code": "def snake_to_camel(value):\n    \"\"\"\n    Converts a snake_case_string to a camelCaseString.\n\n    >>> snake_to_camel(\"foo_bar_baz\")\n    'fooBarBaz'\n    \"\"\"\n    camel = \"\".join(word.title() for word in value.split(\"_\"))\n    return value[:1].lower() + camel[1:]", "entry_point": "snake_to_camel", "input": "'AbC dEf'", "output": "'abc Def'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AntagonistHQ/openprovider.py/blob/5871c3d5b3661e23667f147f49f20389c817a0a4/openprovider/util.py#L25-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035753", "code": "def replace_methodname(format_string, methodname):\n    \"\"\"\n    Partially format a format_string, swapping out any '{methodname}' or '{methodnamehyphen}' components.\n    \"\"\"\n\n    methodnamehyphen = methodname.replace('_', '-')\n    ret = format_string\n    ret = ret.replace('{methodname}', methodname)\n    ret = ret.replace('{methodnamehyphen}', methodnamehyphen)\n    return ret", "entry_point": "replace_methodname", "input": "'  padded  ', 'Hello World'", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danpoland/pyramid-restful-framework/blob/4d8c9db44b1869c3d1fdd59ca304c3166473fcbb/pyramid_restful/routers.py#L14-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035754", "code": "def contains_case_insensitive(adict, akey):\n    \"\"\"Check if key is in adict. The search is case insensitive.\"\"\"\n    for key in adict:\n        if key.lower() == akey.lower():\n            return True\n    return False", "entry_point": "contains_case_insensitive", "input": "{}, [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/dosage/blob/a0109c3a46219f280e6e5e77183674e40da0f304/scripts/scriptutil.py#L6-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035755", "code": "def all_strings(arr):\n        \"\"\"\n        Ensures that the argument is a list that either is empty or contains only strings\n        :param arr: list\n        :return:\n        \"\"\"\n        if not isinstance([], list):\n            raise TypeError(\"non-list value found where list is expected\")\n        return all(isinstance(x, str) for x in arr)", "entry_point": "all_strings", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/genepattern/genepattern-python/blob/9478ea65362b91c72a94f7300c3de8d710bebb71/gp/modules.py#L293-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035756", "code": "def strsize (b):\n    \"\"\"Return human representation of bytes b. A negative number of bytes\n    raises a value error.\"\"\"\n    if b < 0:\n        raise ValueError(\"Invalid negative byte number\")\n    if b < 1024:\n        return \"%dB\" % b\n    if b < 1024 * 10:\n        return \"%dKB\" % (b // 1024)\n    if b < 1024 * 1024:\n        return \"%.2fKB\" % (float(b) / 1024)\n    if b < 1024 * 1024 * 10:\n        return \"%.2fMB\" % (float(b) / (1024*1024))\n    if b < 1024 * 1024 * 1024:\n        return \"%.1fMB\" % (float(b) / (1024*1024))\n    if b < 1024 * 1024 * 1024 * 10:\n        return \"%.2fGB\" % (float(b) / (1024*1024*1024))\n    return \"%.1fGB\" % (float(b) / (1024*1024*1024))", "entry_point": "strsize", "input": "0", "output": "'0B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/dosage/blob/a0109c3a46219f280e6e5e77183674e40da0f304/dosagelib/util.py#L475-L492", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035757", "code": "def strlimit (s, length=72):\n    \"\"\"If the length of the string exceeds the given limit, it will be cut\n    off and three dots will be appended.\n\n    @param s: the string to limit\n    @type s: string\n    @param length: maximum length\n    @type length: non-negative integer\n    @return: limited string, at most length+3 characters long\n    \"\"\"\n    assert length >= 0, \"length limit must be a non-negative integer\"\n    if not s or len(s) <= length:\n        return s\n    if length == 0:\n        return \"\"\n    return \"%s...\" % s[:length]", "entry_point": "strlimit", "input": "[5, 3, 1, 4], 3", "output": "'[5, 3, 1]...'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wummel/dosage/blob/a0109c3a46219f280e6e5e77183674e40da0f304/dosagelib/util.py#L546-L561", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035758", "code": "def auto_type(s):\n    \"\"\" Get a XML response and tries to convert it to Python base object\n    \"\"\"\n    if isinstance(s, bool):\n        return s\n    elif s is None:\n        return ''\n    elif s == 'TRUE':\n        return True\n    elif s == 'FALSE':\n        return False\n    else:\n        try:\n            try:\n                # telephone numbers may be wrongly interpretted as ints\n                if s.startswith('+'):\n                    return s\n                else:\n                    return int(s)\n            except ValueError:\n                return float(s)\n\n        except ValueError:\n            return s", "entry_point": "auto_type", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/oasiswork/zimsoap/blob/d1ea2eb4d50f263c9a16e5549af03f1eff3e295e/zimsoap/utils.py#L64-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035759", "code": "def language_to_locale(language):\n    \"\"\"\n    Converts django's `LANGUAGE_CODE` settings to a proper locale code.\n    \"\"\"\n    tokens = language.split('-')\n    if len(tokens) == 1:\n        return tokens[0]\n    return \"%s_%s\" % (tokens[0], tokens[1].upper())", "entry_point": "language_to_locale", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fcurella/django-fakery/blob/05b6d6a9bf4b8fab98bf91fe1dce5a812d951987/django_fakery/utils.py#L1-L8", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035760", "code": "def deg2HMS(ra='', dec='', round=False):\n    \"\"\" quick and dirty coord conversion. googled to find bdnyc.org.\n    \"\"\"\n    RA, DEC, rs, ds = '', '', '', ''\n    if dec:\n        if str(dec)[0] == '-':\n            ds, dec = '-', abs(dec)\n        deg = int(dec)\n        decM = abs(int((dec-deg)*60))\n        if round:\n            decS = int((abs((dec-deg)*60)-decM)*60)\n        else:\n            decS = (abs((dec-deg)*60)-decM)*60\n        DEC = '{0}{1} {2} {3}'.format(ds, deg, decM, decS)\n  \n    if ra:\n        if str(ra)[0] == '-':\n            rs, ra = '-', abs(ra)\n        raH = int(ra/15)\n        raM = int(((ra/15)-raH)*60)\n        if round:\n            raS = int(((((ra/15)-raH)*60)-raM)*60)\n        else:\n            raS = ((((ra/15)-raH)*60)-raM)*60\n        RA = '{0}{1} {2} {3}'.format(rs, raH, raM, raS)\n  \n    if ra and dec:\n        return (RA, DEC)\n    else:\n        return RA or DEC", "entry_point": "deg2HMS", "input": "False, True, True", "output": "'1 0 0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/caseyjlaw/rtpipe/blob/ac33e4332cf215091a63afbb3137850876d73ec0/rtpipe/reproduce.py#L694-L723", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035761", "code": "def normalize(value):\n    \"\"\"\n    Simple method to always have the same kind of value\n    \"\"\"\n    if value and isinstance(value, bytes):\n        value = value.decode('utf-8')\n    return value", "entry_point": "normalize", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limpyd/redis-limpyd/blob/3c745dde1390a0bd09690b77a089dcc08c6c7e43/limpyd/utils.py#L28-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035762", "code": "def build_request_relationship(type, ids):\n    \"\"\"Build a relationship list.\n\n    A relationship list is used to update relationships between two\n    resources. Setting sensors on a label, for example, uses this\n    function to construct the list of sensor ids to pass to the Helium\n    API.\n\n    Args:\n\n        type(string): The resource type for the ids in the relationship\n        ids([uuid] or uuid): Just one or a list of resource uuids to use\n            in the relationship\n\n    Returns:\n\n        A ready to use relationship JSON object.\n\n    \"\"\"\n    if ids is None:\n        return {\n            'data': None\n        }\n    elif isinstance(ids, str):\n        return {\n            'data': {'id': ids, 'type': type}\n        }\n    else:\n        return {\n            \"data\": [{\"id\": id, \"type\": type} for id in ids]\n        }", "entry_point": "build_request_relationship", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "{'data': [{'id': 1, 'type': [5, 3, 1, 4]}, {'id': 2, 'type': [5, 3, 1, 4]}, {'id': 3, 'type': [5, 3, 1, 4]}]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/helium/helium-python/blob/db73480b143da4fc48e95c4414bd69c576a3a390/helium/util.py#L83-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035763", "code": "def get_kkf(ekey):\n    \"\"\"\n    :param ekey: export key, for instance ('uhs/rlz-1', 'xml')\n    :returns: key, kind and fmt from the export key, i.e. 'uhs', 'rlz-1', 'xml'\n    \"\"\"\n    key, fmt = ekey\n    if '/' in key:\n        key, kind = key.split('/', 1)\n    else:\n        kind = ''\n    return key, kind, fmt", "entry_point": "get_kkf", "input": "{'x': [1, 2], 'y': []}", "output": "('x', '', 'y')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/calculators/export/hazard.py#L319-L329", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035764", "code": "def get_metadata(realizations, kind):\n    \"\"\"\n    :param list realizations:\n        realization objects\n    :param str kind:\n        kind of data, i.e. a key in the datastore\n    :returns:\n        a dictionary with smlt_path, gsimlt_path, statistics, quantile_value\n    \"\"\"\n    metadata = {}\n    if kind.startswith('rlz-'):\n        rlz = realizations[int(kind[4:])]\n        metadata['smlt_path'] = '_'.join(rlz.sm_lt_path)\n        metadata['gsimlt_path'] = rlz.gsim_rlz.uid\n    elif kind.startswith('quantile-'):\n        metadata['statistics'] = 'quantile'\n        metadata['quantile_value'] = float(kind[9:])\n    elif kind == 'mean':\n        metadata['statistics'] = 'mean'\n    elif kind == 'max':\n        metadata['statistics'] = 'max'\n    elif kind == 'std':\n        metadata['statistics'] = 'std'\n    return metadata", "entry_point": "get_metadata", "input": "[], 'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/calculators/export/hazard.py#L379-L402", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035765", "code": "def fix_ones(pmap):\n    \"\"\"\n    Physically, an extremely small intensity measure level can have an\n    extremely large probability of exceedence, however that probability\n    cannot be exactly 1 unless the level is exactly 0. Numerically, the\n    PoE can be 1 and this give issues when calculating the damage (there\n    is a log(0) in\n    :class:`openquake.risklib.scientific.annual_frequency_of_exceedence`).\n    Here we solve the issue by replacing the unphysical probabilities 1\n    with .9999999999999999 (the float64 closest to 1).\n    \"\"\"\n    for sid in pmap:\n        array = pmap[sid].array\n        array[array == 1.] = .9999999999999999\n    return pmap", "entry_point": "fix_ones", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/calculators/base.py#L65-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035766", "code": "def clean_points(points):\n    \"\"\"\n    Given a list of :class:`~openquake.hazardlib.geo.point.Point` objects,\n    return a new list with adjacent duplicate points removed.\n    \"\"\"\n    if not points:\n        return points\n\n    result = [points[0]]\n    for point in points:\n        if point != result[-1]:\n            result.append(point)\n    return result", "entry_point": "clean_points", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hazardlib/geo/utils.py#L199-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035767", "code": "def get_src_ids(sources):\n    \"\"\"\n    :returns:\n       a string with the source IDs of the given sources, stripping the\n       extension after the colon, if any\n    \"\"\"\n    src_ids = []\n    for src in sources:\n        long_src_id = src.source_id\n        try:\n            src_id, ext = long_src_id.rsplit(':', 1)\n        except ValueError:\n            src_id = long_src_id\n        src_ids.append(src_id)\n    return ' '.join(set(src_ids))", "entry_point": "get_src_ids", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/calculators/classical.py#L45-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035768", "code": "def accept_path(path, ref_path):\n    \"\"\"\n    :param path: a logic tree path (list or tuple of strings)\n    :param ref_path: reference logic tree path\n    :returns: True if `path` is consistent with `ref_path`, False otherwise\n\n    >>> accept_path(['SM2'], ('SM2', 'a3b1'))\n    False\n    >>> accept_path(['SM2', '@'], ('SM2', 'a3b1'))\n    True\n    >>> accept_path(['@', 'a3b1'], ('SM2', 'a3b1'))\n    True\n    >>> accept_path('@@', ('SM2', 'a3b1'))\n    True\n    \"\"\"\n    if len(path) != len(ref_path):\n        return False\n    for a, b in zip(path, ref_path):\n        if a != '@' and a != b:\n            return False\n    return True", "entry_point": "accept_path", "input": "'walnut thistle harbour', '  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/commonlib/rlzs_assoc.py#L226-L246", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035769", "code": "def simple_trace_to_wkt_linestring(trace):\n    '''\n    Coverts a simple fault trace to well-known text format\n\n    :param trace:\n        Fault trace as instance of :class: openquake.hazardlib.geo.line.Line\n\n    :returns:\n        Well-known text (WKT) Linstring representation of the trace\n    '''\n    trace_str = \"\"\n    for point in trace:\n        trace_str += ' %s %s,' % (point.longitude, point.latitude)\n    trace_str = trace_str.lstrip(' ')\n    return 'LINESTRING (' + trace_str.rstrip(',') + ')'", "entry_point": "simple_trace_to_wkt_linestring", "input": "[]", "output": "'LINESTRING ()'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hmtk/sources/source_conversion_utils.py#L131-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035770", "code": "def simple_edge_to_wkt_linestring(edge):\n    '''\n    Coverts a simple fault trace to well-known text format\n\n    :param trace:\n        Fault trace as instance of :class: openquake.hazardlib.geo.line.Line\n\n    :returns:\n        Well-known text (WKT) Linstring representation of the trace\n    '''\n    trace_str = \"\"\n    for point in edge:\n        trace_str += ' %s %s %s,' % (point.longitude, point.latitude,\n                                     point.depth)\n    trace_str = trace_str.lstrip(' ')\n    return 'LINESTRING (' + trace_str.rstrip(',') + ')'", "entry_point": "simple_edge_to_wkt_linestring", "input": "[]", "output": "'LINESTRING ()'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hmtk/sources/source_conversion_utils.py#L148-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035771", "code": "def expand_src_param(values, shp_params):\n    \"\"\"\n    Expand hazardlib source attribute (defined through list of values)\n    into dictionary of shapefile parameters.\n    \"\"\"\n    if values is None:\n        return dict([(key, None) for key, _ in shp_params])\n    else:\n        num_values = len(values)\n        return dict(\n            [(key, float(values[i]) if i < num_values else None)\n                for i, (key, _) in enumerate(shp_params)])", "entry_point": "expand_src_param", "input": "[5, 3, 1, 4], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/commonlib/shapefileparser.py#L106-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035772", "code": "def _displayattrs(attrib, expandattrs):\n    \"\"\"\n    Helper function to display the attributes of a Node object in lexicographic\n    order.\n\n    :param attrib: dictionary with the attributes\n    :param expandattrs: if True also displays the value of the attributes\n    \"\"\"\n    if not attrib:\n        return ''\n    if expandattrs:\n        alist = ['%s=%r' % item for item in sorted(attrib.items())]\n    else:\n        alist = list(attrib)\n    return '{%s}' % ', '.join(alist)", "entry_point": "_displayattrs", "input": "[], [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/baselib/node.py#L363-L377", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035773", "code": "def _merge_two_dicts(x, y):\n    \"\"\"\n    Given two dicts, merge them into a new dict as a shallow copy.\n\n    Once Python 3.6+ only is supported, replace method with ``z = {**x, **y}``\n    \"\"\"\n    z = x.copy()\n    z.update(y)\n    return z", "entry_point": "_merge_two_dicts", "input": "{1, 2, 3}, ()", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edx/auth-backends/blob/493f93e9d87d0237f0fea6d75c7b70646ad6d31e/auth_backends/backends.py#L29-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035774", "code": "def is_hitachi(dicom_input):\n    \"\"\"\n    Use this function to detect if a dicom series is a hitachi dataset\n\n    :param dicom_input: directory with dicom files for 1 scan of a dicom_header\n    \"\"\"\n    # read dicom header\n    header = dicom_input[0]\n\n    if 'Manufacturer' not in header or 'Modality' not in header:\n        return False  # we try generic conversion in these cases\n\n    # check if Modality is mr\n    if header.Modality.upper() != 'MR':\n        return False\n\n    # check if manufacturer is hitachi\n    if 'HITACHI' not in header.Manufacturer.upper():\n        return False\n\n    return True", "entry_point": "is_hitachi", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/icometrix/dicom2nifti/blob/1462ae5dd979fa3f276fe7a78ceb9b028121536f/dicom2nifti/common.py#L57-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035775", "code": "def is_ge(dicom_input):\n    \"\"\"\n    Use this function to detect if a dicom series is a GE dataset\n\n    :param dicom_input: list with dicom objects\n    \"\"\"\n    # read dicom header\n    header = dicom_input[0]\n\n    if 'Manufacturer' not in header or 'Modality' not in header:\n        return False  # we try generic conversion in these cases\n\n    # check if Modality is mr\n    if header.Modality.upper() != 'MR':\n        return False\n\n    # check if manufacturer is GE\n    if 'GE MEDICAL SYSTEMS' not in header.Manufacturer.upper():\n        return False\n\n    return True", "entry_point": "is_ge", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/icometrix/dicom2nifti/blob/1462ae5dd979fa3f276fe7a78ceb9b028121536f/dicom2nifti/common.py#L80-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035776", "code": "def is_philips(dicom_input):\n    \"\"\"\n    Use this function to detect if a dicom series is a philips dataset\n\n    :param dicom_input: directory with dicom files for 1 scan of a dicom_header\n    \"\"\"\n    # read dicom header\n    header = dicom_input[0]\n\n    if 'Manufacturer' not in header or 'Modality' not in header:\n        return False  # we try generic conversion in these cases\n\n    # check if Modality is mr\n    if header.Modality.upper() != 'MR':\n        return False\n\n    # check if manufacturer is Philips\n    if 'PHILIPS' not in header.Manufacturer.upper():\n        return False\n\n    return True", "entry_point": "is_philips", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/icometrix/dicom2nifti/blob/1462ae5dd979fa3f276fe7a78ceb9b028121536f/dicom2nifti/common.py#L103-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035777", "code": "def is_siemens(dicom_input):\n    \"\"\"\n    Use this function to detect if a dicom series is a siemens dataset\n\n    :param dicom_input: directory with dicom files for 1 scan\n    \"\"\"\n    # read dicom header\n    header = dicom_input[0]\n\n    # check if manufacturer is Siemens\n    if 'Manufacturer' not in header or 'Modality' not in header:\n        return False  # we try generic conversion in these cases\n\n    # check if Modality is mr\n    if header.Modality.upper() != 'MR':\n        return False\n\n    if 'SIEMENS' not in header.Manufacturer.upper():\n        return False\n\n    return True", "entry_point": "is_siemens", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/icometrix/dicom2nifti/blob/1462ae5dd979fa3f276fe7a78ceb9b028121536f/dicom2nifti/common.py#L126-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035778", "code": "def _is_mosaic(dicom_input):\n    \"\"\"\n    Use this function to detect if a dicom series is a siemens 4d dataset\n    NOTE: Only the first slice will be checked so you can only provide an already sorted dicom directory\n    (containing one series)\n    \"\"\"\n    # for grouped dicoms\n    if type(dicom_input) is list and type(dicom_input[0]) is list:\n        header = dicom_input[0][0]\n    else:  # all the others\n        header = dicom_input[0]\n\n    # check if image type contains m and mosaic\n    if 'ImageType' not in header or 'MOSAIC' not in header.ImageType:\n        return False\n\n    if 'AcquisitionMatrix' not in header or header.AcquisitionMatrix is None:\n        return False\n\n    return True", "entry_point": "_is_mosaic", "input": "'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/icometrix/dicom2nifti/blob/1462ae5dd979fa3f276fe7a78ceb9b028121536f/dicom2nifti/convert_siemens.py#L69-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035779", "code": "def identify_degenerate_nests(nest_spec):\n    \"\"\"\n    Identify the nests within nest_spec that are degenerate, i.e. those nests\n    with only a single alternative within the nest.\n\n    Parameters\n    ----------\n    nest_spec : OrderedDict.\n        Keys are strings that define the name of the nests. Values are lists\n        of alternative ids, denoting which alternatives belong to which nests.\n        Each alternative id must only be associated with a single nest!\n\n    Returns\n    -------\n    list.\n        Will contain the positions in the list of keys from `nest_spec` that\n        are degenerate.\n    \"\"\"\n    degenerate_positions = []\n    for pos, key in enumerate(nest_spec):\n        if len(nest_spec[key]) == 1:\n            degenerate_positions.append(pos)\n    return degenerate_positions", "entry_point": "identify_degenerate_nests", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/timothyb0912/pylogit/blob/f83b0fd6debaa7358d87c3828428f6d4ead71357/pylogit/nested_logit.py#L36-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035780", "code": "def _join_names(names):\n    \"\"\"Join the names of a multi-level index with an underscore.\"\"\"\n\n    levels = (str(name) for name in names if name != '')\n    return '_'.join(levels)", "entry_point": "_join_names", "input": "'walnut thistle harbour'", "output": "'w_a_l_n_u_t_ _t_h_i_s_t_l_e_ _h_a_r_b_o_u_r'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HDI-Project/MLPrimitives/blob/bf415f9f751724ff545a1156ddfd7524e320f469/mlprimitives/adapters/pandas.py#L33-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035781", "code": "def is_one_of(obj, types):\n    \"\"\"Return true iff obj is an instance of one of the types.\"\"\"\n    for type_ in types:\n        if isinstance(obj, type_):\n            return True\n    return False", "entry_point": "is_one_of", "input": "[1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/citruz/beacontools/blob/15a83e9750d0a4393f8a36868e07f6d9458253fe/beacontools/utils.py#L44-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035782", "code": "def encode_items(items):\n    \"\"\"Function that encode all elements in the list of items passed as\n    a parameter\n\n    :param items:  A list of tuple\n    :returns:      A list of tuple with all items encoded in 'utf-8'\n    \"\"\"\n    encoded = []\n    for key, values in items:\n        for value in values:\n            encoded.append((key.encode('utf-8'), value.encode('utf-8')))\n    return encoded", "entry_point": "encode_items", "input": "()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TracyWebTech/django-revproxy/blob/b8d1d9e44eadbafbd16bc03f04d15560089d4472/revproxy/utils.py#L146-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035783", "code": "def unquote(value):\n    \"\"\"Remove wrapping quotes from a string.\n\n    :param value: A string that might be wrapped in double quotes, such\n                  as a HTTP cookie value.\n    :returns: Beginning and ending quotes removed and escaped quotes (``\\\"``)\n              unescaped\n    \"\"\"\n    if len(value) > 1 and value[0] == '\"' and value[-1] == '\"':\n        value = value[1:-1].replace(r'\\\"', '\"')\n    return value", "entry_point": "unquote", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TracyWebTech/django-revproxy/blob/b8d1d9e44eadbafbd16bc03f04d15560089d4472/revproxy/utils.py#L231-L241", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035784", "code": "def _format_object_mask(objectmask):\n    \"\"\"Format the new style object mask.\n\n    This wraps the user mask with mask[USER_MASK] if it does not already\n    have one. This makes it slightly easier for users.\n\n    :param objectmask: a string-based object mask\n\n    \"\"\"\n    objectmask = objectmask.strip()\n\n    if (not objectmask.startswith('mask') and\n            not objectmask.startswith('[')):\n        objectmask = \"mask[%s]\" % objectmask\n    return objectmask", "entry_point": "_format_object_mask", "input": "''", "output": "'mask[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/transports.py#L544-L558", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035785", "code": "def filter_outlet_packages(packages):\n        \"\"\"Remove packages designated as OUTLET.\n\n        Those type of packages must be handled in a different way,\n        and they are not supported at the moment.\n\n        :param packages: Dictionary of packages. Name and description keys\n                         must be present in each of them.\n        \"\"\"\n\n        non_outlet_packages = []\n\n        for package in packages:\n            if all(['OUTLET' not in package.get('description', '').upper(),\n                    'OUTLET' not in package.get('name', '').upper()]):\n                non_outlet_packages.append(package)\n\n        return non_outlet_packages", "entry_point": "filter_outlet_packages", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L68-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035786", "code": "def get_only_active_packages(packages):\n        \"\"\"Return only active packages.\n\n        If a package is active, it is eligible for ordering\n        This will inspect the 'isActive' property on the provided packages\n\n        :param packages: Dictionary of packages, isActive key must be present\n        \"\"\"\n\n        active_packages = []\n\n        for package in packages:\n            if package['isActive']:\n                active_packages.append(package)\n\n        return active_packages", "entry_point": "get_only_active_packages", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L88-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035787", "code": "def get_price(item):\n    \"\"\"Finds the price with the default locationGroupId\"\"\"\n    the_price = \"No Default Pricing\"\n    for price in item.get('prices', []):\n        if not price.get('locationGroupId'):\n            the_price = \"%0.4f\" % float(price['hourlyRecurringFee'])\n    return the_price", "entry_point": "get_price", "input": "{}", "output": "'No Default Pricing'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_options.py#L39-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035788", "code": "def _matches_location(price, location):\n    \"\"\"Return True if the price object matches the location.\"\"\"\n    # the price has no location restriction\n    if not price.get('locationGroupId'):\n        return True\n\n    # Check to see if any of the location groups match the location group\n    # of this price object\n    for group in location['location']['location']['priceGroups']:\n        if group['id'] == price['locationGroupId']:\n            return True\n\n    return False", "entry_point": "_matches_location", "input": "{}, [1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L789-L801", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035789", "code": "def toVName(name, stripNum=0, upper=False):\n    \"\"\"\n    Turn a Python name into an iCalendar style name,\n    optionally uppercase and with characters stripped off.\n    \"\"\"\n    if upper:\n        name = name.upper()\n    if stripNum != 0:\n        name = name[:-stripNum]\n    return name.replace('_', '-')", "entry_point": "toVName", "input": "'Hello World', 1, [-1, 0, 1, 2]", "output": "'HELLO WORL'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eventable/vobject/blob/498555a553155ea9b26aace93332ae79365ecb31/vobject/base.py#L261-L270", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035790", "code": "def numToDigits(num, places):\n    \"\"\"\n    Helper, for converting numbers to textual digits.\n    \"\"\"\n    s = str(num)\n    if len(s) < places:\n        return (\"0\" * (places - len(s))) + s\n    elif len(s) > places:\n        return s[len(s)-places: ]\n    else:\n        return s", "entry_point": "numToDigits", "input": "['apple', 'banana', 'cherry'], 1", "output": "']'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eventable/vobject/blob/498555a553155ea9b26aace93332ae79365ecb31/docs/build/lib/vobject/icalendar.py#L1503-L1513", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035791", "code": "def toString(val, join_char='\\n'):\n        \"\"\"\n        Turn a string or array value into a string.\n        \"\"\"\n        if type(val) in (list, tuple):\n            return join_char.join(val)\n        return val", "entry_point": "toString", "input": "{}, 3.25", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eventable/vobject/blob/498555a553155ea9b26aace93332ae79365ecb31/vobject/vcard.py#L75-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035792", "code": "def _extract_vararray_max(tform):\n    \"\"\"\n    Extract number from PX(number)\n    \"\"\"\n    first = tform.find('(')\n    last = tform.rfind(')')\n\n    if first == -1 or last == -1:\n        # no max length specified\n        return -1\n\n    maxnum = int(tform[first+1:last])\n    return maxnum", "entry_point": "_extract_vararray_max", "input": "'walnut thistle harbour'", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/esheldon/fitsio/blob/a6f07919f457a282fe240adad9d2c30906b71a15/fitsio/hdu/table.py#L2004-L2016", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035793", "code": "def _get_col_dimstr(tdim, is_string=False):\n    \"\"\"\n    not for variable length\n    \"\"\"\n    dimstr = ''\n    if tdim is None:\n        dimstr = 'array[bad TDIM]'\n    else:\n        if is_string:\n            if len(tdim) > 1:\n                dimstr = [str(d) for d in tdim[1:]]\n        else:\n            if len(tdim) > 1 or tdim[0] > 1:\n                dimstr = [str(d) for d in tdim]\n        if dimstr != '':\n            dimstr = ','.join(dimstr)\n            dimstr = 'array[%s]' % dimstr\n\n    return dimstr", "entry_point": "_get_col_dimstr", "input": "['apple', 'banana', 'cherry'], '  padded  '", "output": "'array[banana,cherry]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/esheldon/fitsio/blob/a6f07919f457a282fe240adad9d2c30906b71a15/fitsio/hdu/table.py#L2019-L2037", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035794", "code": "def _nucmer_hits_to_percent_identity(nucmer_hits):\n        '''Input is hits made by self._parse_nucmer_coords_file.\n           Returns dictionary. key = contig name. Value = percent identity of hits to that contig'''\n        percent_identities = {}\n        max_lengths = {}\n\n        for contig in nucmer_hits:\n            max_length = -1\n            percent_identity = 0\n            for hit in nucmer_hits[contig]:\n                if hit.hit_length_qry > max_length:\n                    max_length = hit.hit_length_qry\n                    percent_identity = hit.percent_identity\n            percent_identities[contig] = percent_identity\n\n        return percent_identities", "entry_point": "_nucmer_hits_to_percent_identity", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sanger-pathogens/ariba/blob/16a0b1916ce0e886bd22550ba2d648542977001b/ariba/assembly_compare.py#L78-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035795", "code": "def _get_assembled_reference_sequences(nucmer_hits, ref_sequence, assembly):\n        '''nucmer_hits =  hits made by self._parse_nucmer_coords_file.\n           ref_gene = reference sequence (pyfastaq.sequences.Fasta object)\n           assembly = dictionary of contig name -> contig.\n           Makes a set of Fasta objects of each piece of assembly that\n           corresponds to the reference sequeunce.'''\n        sequences = {}\n\n        for contig in sorted(nucmer_hits):\n            for hit in nucmer_hits[contig]:\n                qry_coords = hit.qry_coords()\n                fa = assembly[hit.qry_name].subseq(qry_coords.start, qry_coords.end + 1)\n                if hit.on_same_strand():\n                    strand = '+'\n                else:\n                    fa.revcomp()\n                    strand = '-'\n                ref_coords = hit.ref_coords()\n                fa.id = '.'.join([\n                    ref_sequence.id,\n                    str(ref_coords.start + 1),\n                    str(ref_coords.end + 1),\n                    contig,\n                    str(qry_coords.start + 1),\n                    str(qry_coords.end + 1),\n                    strand\n                ])\n\n                if hit.hit_length_ref == hit.ref_length:\n                    fa.id += '.complete'\n\n                sequences[fa.id] = fa\n\n        return sequences", "entry_point": "_get_assembled_reference_sequences", "input": "{}, 10, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sanger-pathogens/ariba/blob/16a0b1916ce0e886bd22550ba2d648542977001b/ariba/assembly_compare.py#L181-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035796", "code": "def candidate_priority(candidate_component, candidate_type, local_pref=65535):\n    \"\"\"\n    See RFC 5245 - 4.1.2.1. Recommended Formula\n    \"\"\"\n    if candidate_type == 'host':\n        type_pref = 126\n    elif candidate_type == 'prflx':\n        type_pref = 110\n    elif candidate_type == 'srflx':\n        type_pref = 100\n    else:\n        type_pref = 0\n\n    return (1 << 24) * type_pref + \\\n           (1 << 8) * local_pref + \\\n           (256 - candidate_component)", "entry_point": "candidate_priority", "input": "True, True, False", "output": "255", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aiortc/aioice/blob/a04d810d94ec2d00eca9ce01eacca74b3b086616/aioice/candidate.py#L13-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035797", "code": "def _extract_prop_option(line):\n    \"\"\"\n    Extract the (key,value)-tuple from a string like:\n    >>> \"option foobar 123\"\n    :param line:\n    :return: tuple (key, value)\n    \"\"\"\n    line = line[7:]\n    pos = line.find(' ')\n    return line[:pos], line[pos + 1:]", "entry_point": "_extract_prop_option", "input": "'abc'", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartijnBraam/python-isc-dhcp-leases/blob/e96c00e31f3a52c01ef98193577d614d08a93285/isc_dhcp_leases/iscdhcpleases.py#L29-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035798", "code": "def _extract_prop_set(line):\n    \"\"\"\n    Extract the (key, value)-tuple from a string like:\n    >>> 'set foo = \"bar\"'\n    :param line:\n    :return: tuple (key, value)\n    \"\"\"\n    token = ' = \"'\n    line = line[4:]\n    pos = line.find(token)\n    return line[:pos], line[pos + 4:-1]", "entry_point": "_extract_prop_set", "input": "'AbC dEf'", "output": "('dE', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MartijnBraam/python-isc-dhcp-leases/blob/e96c00e31f3a52c01ef98193577d614d08a93285/isc_dhcp_leases/iscdhcpleases.py#L41-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035799", "code": "def host_and_port(host_or_port):\n    \"\"\"\n    Return full hostname/IP + port, possible input formats are:\n      * host:port  -> host:port\n      * :          -> localhost:4200\n      * :port      -> localhost:port\n      * host       -> host:4200\n    \"\"\"\n    if ':' in host_or_port:\n        if len(host_or_port) == 1:\n            return 'localhost:4200'\n        elif host_or_port.startswith(':'):\n            return 'localhost' + host_or_port\n        return host_or_port\n    return host_or_port + ':4200'", "entry_point": "host_and_port", "input": "'Hello World'", "output": "'Hello World:4200'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/crate/crash/blob/32d3ddc78fd2f7848ed2b99d9cd8889e322528d9/src/crate/crash/command.py#L519-L533", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035800", "code": "def split_header(fp):\n        \"\"\"\n        Read file pointer and return pair of lines lists:\n        first - header, second - the rest.\n        \"\"\"\n        body_start, header_ended = 0, False\n        lines = []\n        for line in fp:\n            if line.startswith('#') and not header_ended:\n                # Header text\n                body_start += 1\n            else:\n                header_ended = True\n            lines.append(line)\n        return lines[:body_start], lines[body_start:]", "entry_point": "split_header", "input": "['apple', 'banana', 'cherry']", "output": "([], ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterdemin/pip-compile-multi/blob/7bd1968c424dd7ce3236885b4b3e4e28523e6915/pipcompilemulti/environment.py#L181-L195", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035801", "code": "def reference_cluster(envs, name):\n    \"\"\"\n    Return set of all env names referencing or\n    referenced by given name.\n\n    >>> cluster = sorted(reference_cluster([\n    ...     {'name': 'base', 'refs': []},\n    ...     {'name': 'test', 'refs': ['base']},\n    ...     {'name': 'local', 'refs': ['test']},\n    ... ], 'test'))\n    >>> cluster == ['base', 'local', 'test']\n    True\n    \"\"\"\n    edges = [\n        set([env['name'], ref])\n        for env in envs\n        for ref in env['refs']\n    ]\n    prev, cluster = set(), set([name])\n    while prev != cluster:\n        # While cluster grows\n        prev = set(cluster)\n        to_visit = []\n        for edge in edges:\n            if cluster & edge:\n                # Add adjacent nodes:\n                cluster |= edge\n            else:\n                # Leave only edges that are out\n                # of cluster for the next round:\n                to_visit.append(edge)\n        edges = to_visit\n    return cluster", "entry_point": "reference_cluster", "input": "[], 'Hello World'", "output": "{'Hello World'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterdemin/pip-compile-multi/blob/7bd1968c424dd7ce3236885b4b3e4e28523e6915/pipcompilemulti/actions.py#L131-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035802", "code": "def _stat_name(feat_name, stat_mode):\n    '''Set stat name based on feature name and stat mode'''\n    if feat_name[-1] == 's':\n        feat_name = feat_name[:-1]\n    if feat_name == 'soma_radii':\n        feat_name = 'soma_radius'\n    if stat_mode == 'raw':\n        return feat_name\n\n    return '%s_%s' % (stat_mode, feat_name)", "entry_point": "_stat_name", "input": "'abc', [1, 2, 3]", "output": "'[1, 2, 3]_abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/BlueBrain/NeuroM/blob/254bb73535b20053d175bc4725bade662177d12b/neurom/apps/morph_stats.py#L62-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035803", "code": "def dict_to_html_attrs(dict_):\n    \"\"\"\n    Banana banana\n    \"\"\"\n    res = ' '.join('%s=\"%s\"' % (k, v) for k, v in dict_.items())\n    return res", "entry_point": "dict_to_html_attrs", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hotdoc/hotdoc/blob/1067cdc8482b585b364a38fb52ca5d904e486280/hotdoc/core/links.py#L27-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035804", "code": "def compute_ema(smoothing_factor, points):\n    \"\"\"\n    Compute exponential moving average of a list of points.\n    :param float smoothing_factor: the smoothing factor.\n    :param list points: the data points.\n    :return list: all ema in a list.\n    \"\"\"\n    ema = []\n    # The initial point has a ema equal to itself.\n    if(len(points) > 0):\n        ema.append(points[0])\n    for i in range(1, len(points)):\n        ema.append(smoothing_factor * points[i] + (1 - smoothing_factor) * ema[i - 1])\n    return ema", "entry_point": "compute_ema", "input": "3.25, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/linkedin/luminol/blob/42e4ab969b774ff98f902d064cb041556017f635/src/luminol/utils.py#L25-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035805", "code": "def version_tuple(version):\n    \"\"\"Convert a version string or tuple to a tuple.\n\n    Should be returned in the form: (major, minor, release).\n    \"\"\"\n    if isinstance(version, str):\n        return tuple(int(x) for x in version.split('.'))\n    elif isinstance(version, tuple):\n        return version\n    else:\n        raise ValueError(\"Invalid version: %s\" % version)", "entry_point": "version_tuple", "input": "('a', 'b', 'c')", "output": "('a', 'b', 'c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jpoullet2000/atlasclient/blob/4548b441143ebf7fc4075d113db5ca5a23e0eed2/atlasclient/utils.py#L56-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035806", "code": "def version_str(version):\n    \"\"\"Convert a version tuple or string to a string.\n\n    Should be returned in the form: major.minor.release\n    \"\"\"\n    if isinstance(version, str):\n        return version\n    elif isinstance(version, tuple):\n        return '.'.join([str(int(x)) for x in version])\n    else:\n        raise ValueError(\"Invalid version: %s\" % version)", "entry_point": "version_str", "input": "()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jpoullet2000/atlasclient/blob/4548b441143ebf7fc4075d113db5ca5a23e0eed2/atlasclient/utils.py#L69-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035807", "code": "def declaration_path(decl):\n    \"\"\"\n    Returns a list of parent declarations names.\n\n    Args:\n        decl (declaration_t): declaration for which declaration path\n                              should be calculated.\n\n    Returns:\n        list[(str | basestring)]: list of names, where first item is the top\n                                  parent name and last item the inputted\n                                  declaration name.\n    \"\"\"\n\n    if not decl:\n        return []\n    if not decl.cache.declaration_path:\n        result = [decl.name]\n        parent = decl.parent\n        while parent:\n            if parent.cache.declaration_path:\n                result.reverse()\n                decl.cache.declaration_path = parent.cache.declaration_path + \\\n                    result\n                return decl.cache.declaration_path\n            else:\n                result.append(parent.name)\n                parent = parent.parent\n        result.reverse()\n        decl.cache.declaration_path = result\n        return result\n\n    return decl.cache.declaration_path", "entry_point": "declaration_path", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration_utils.py#L7-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035808", "code": "def partial_declaration_path(decl):\n    \"\"\"\n    Returns a list of parent declarations names without template arguments that\n    have default value.\n\n    Args:\n        decl (declaration_t): declaration for which the partial declaration\n                              path should be calculated.\n\n    Returns:\n        list[(str | basestring)]: list of names, where first item is the top\n                                  parent name and last item the inputted\n                                  declaration name.\n    \"\"\"\n\n    # TODO:\n    # If parent declaration cache already has declaration_path, reuse it for\n    # calculation.\n    if not decl:\n        return []\n    if not decl.cache.partial_declaration_path:\n        result = [decl.partial_name]\n        parent = decl.parent\n        while parent:\n            if parent.cache.partial_declaration_path:\n                result.reverse()\n                decl.cache.partial_declaration_path \\\n                    = parent.cache.partial_declaration_path + result\n                return decl.cache.partial_declaration_path\n            else:\n                result.append(parent.partial_name)\n                parent = parent.parent\n        result.reverse()\n        decl.cache.partial_declaration_path = result\n        return result\n\n    return decl.cache.partial_declaration_path", "entry_point": "partial_declaration_path", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration_utils.py#L42-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035809", "code": "def format_number(x):\n    \"\"\"Format number to string\n\n    Function converts a number to string. For numbers of class :class:`float`, up to 17 digits will be used to print\n    the entire floating point number. Any padding zeros will be removed at the end of the number.\n\n    See :ref:`user-guide:int` and :ref:`user-guide:double` for more information on the format.\n\n    .. note::\n            IEEE754-1985 standard says that 17 significant decimal digits are required to adequately represent a\n            64-bit floating point number. Not all fractional numbers can be exactly represented in floating point. An\n            example is 0.1 which will be approximated as 0.10000000000000001.\n\n    Parameters\n    ----------\n    x : :class:`int` or :class:`float`\n        Number to convert to string\n\n    Returns\n    -------\n    vector : :class:`str`\n        String of number :obj:`x`\n    \"\"\"\n\n    if isinstance(x, float):\n        # Helps prevent loss of precision as using str() in Python 2 only prints 12 digits of precision.\n        # However, IEEE754-1985 standard says that 17 significant decimal digits is required to adequately represent a\n        # floating point number.\n        # The g option is used rather than f because g precision uses significant digits while f is just the number of\n        # digits after the decimal. (NRRD C implementation uses g).\n        value = '{:.17g}'.format(x)\n    else:\n        value = str(x)\n\n    return value", "entry_point": "format_number", "input": "[]", "output": "'[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mhe/pynrrd/blob/96dd875b302031ea27e2d3aaa611dc6f2dfc7979/nrrd/formatters.py#L4-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035810", "code": "def parse_number_auto_dtype(x):\n    \"\"\"Parse number from string with automatic type detection.\n\n    Parses input string and converts to a number using automatic type detection. If the number contains any\n    fractional parts, then the number will be converted to float, otherwise the number will be converted to an int.\n\n    See :ref:`user-guide:int` and :ref:`user-guide:double` for more information on the format.\n\n    Parameters\n    ----------\n    x : :class:`str`\n        String representation of number\n\n    Returns\n    -------\n    result : :class:`int` or :class:`float`\n        Number parsed from :obj:`x` string\n    \"\"\"\n\n    value = float(x)\n\n    if value.is_integer():\n        value = int(value)\n\n    return value", "entry_point": "parse_number_auto_dtype", "input": "0.5", "output": "0.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mhe/pynrrd/blob/96dd875b302031ea27e2d3aaa611dc6f2dfc7979/nrrd/parsers.py#L207-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035811", "code": "def valid_beat_duration(duration):\n    \"\"\"Return True when log2(duration) is an integer.\"\"\"\n    if duration == 0:\n        return False\n    elif duration == 1:\n        return True\n    else:\n        r = duration\n        while r != 1:\n            if r % 2 == 1:\n                return False\n            r /= 2\n        return True", "entry_point": "valid_beat_duration", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bspaans/python-mingus/blob/aa5a5d992d45ada61be0f9f86261380731bd7749/mingus/core/meter.py#L30-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035812", "code": "def invert(interval):\n    \"\"\"Invert an interval.\n\n    Example:\n    >>> invert(['C', 'E'])\n    ['E', 'C']\n    \"\"\"\n    interval.reverse()\n    res = list(interval)\n    interval.reverse()\n    return res", "entry_point": "invert", "input": "[1, 2, 3]", "output": "[3, 2, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bspaans/python-mingus/blob/aa5a5d992d45ada61be0f9f86261380731bd7749/mingus/core/intervals.py#L292-L302", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035813", "code": "def fingers_needed(fingering):\n    \"\"\"Return the number of fingers needed to play the given fingering.\"\"\"\n    split = False # True if an open string must be played, thereby making any\n                  # subsequent strings impossible to bar with the index finger\n    indexfinger = False # True if the index finger was already accounted for\n                        # in the count\n    minimum = min(finger for finger in fingering if finger) # the index finger\n                                                            # plays the lowest\n                                                            # finger position\n    result = 0\n    for finger in reversed(fingering):\n        if finger == 0: # an open string is played\n            split = True # subsequent strings are impossible to bar with the\n                         # index finger\n        else:\n            if not split and finger == minimum: # if an open string hasn't been\n                                                # played and this is a job for\n                                                # the index finger:\n                if not indexfinger: # if the index finger hasn't been accounted\n                                    # for:\n                    result += 1\n                    indexfinger = True # index finger has now been accounted for\n            else:\n                result += 1\n    return result", "entry_point": "fingers_needed", "input": "[5, 3, 1, 4]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bspaans/python-mingus/blob/aa5a5d992d45ada61be0f9f86261380731bd7749/mingus/extra/tunings.py#L337-L361", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035814", "code": "def parse_string(progression):\n    \"\"\"Return a tuple (roman numeral, accidentals, chord suffix).\n\n    Examples:\n    >>> parse_string('I')\n    ('I', 0, '')\n    >>> parse_string('bIM7')\n    ('I', -1, 'M7')\n    \"\"\"\n    acc = 0\n    roman_numeral = ''\n    suffix = ''\n    i = 0\n    for c in progression:\n        if c == '#':\n            acc += 1\n        elif c == 'b':\n            acc -= 1\n        elif c.upper() == 'I' or c.upper() == 'V':\n            roman_numeral += c.upper()\n        else:\n            break\n        i += 1\n    suffix = progression[i:]\n    return (roman_numeral, acc, suffix)", "entry_point": "parse_string", "input": "[]", "output": "('', 0, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bspaans/python-mingus/blob/aa5a5d992d45ada61be0f9f86261380731bd7749/mingus/core/progressions.py#L208-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035815", "code": "def _get_width(maxwidth):\n    \"\"\"Return the width of a single bar, when width of the page is given.\"\"\"\n    width = maxwidth / 3\n    if maxwidth <= 60:\n        width = maxwidth\n    elif 60 < maxwidth <= 120:\n        width = maxwidth / 2\n    return width", "entry_point": "_get_width", "input": "10", "output": "10", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bspaans/python-mingus/blob/aa5a5d992d45ada61be0f9f86261380731bd7749/mingus/extra/tablature.py#L433-L440", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035816", "code": "def update_params(params, updates):\n    '''Merges updates into params'''\n    params = params.copy() if isinstance(params, dict) else dict()\n    params.update(updates)\n    return params", "entry_point": "update_params", "input": "False, ()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/spry-group/python-vultr/blob/bad1448f1df7b5dba70fd3d11434f32580f0b850/vultr/utils.py#L94-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035817", "code": "def get_replacement_types(titles, reportnumbers, publishers):\n    \"\"\"Given the indices of the titles and reportnumbers that have been\n       recognised within a reference line, create a dictionary keyed by\n       the replacement position in the line, where the value for each\n       key is a string describing the type of item replaced at that\n       position in the line.\n       The description strings are:\n           'title'        - indicating that the replacement is a\n                            periodical title\n           'reportnumber' - indicating that the replacement is a\n                            preprint report number.\n       @param titles: (list) of locations in the string at which\n        periodical titles were found.\n       @param reportnumbers: (list) of locations in the string at which\n        reportnumbers were found.\n       @return: (dictionary) of replacement types at various locations\n        within the string.\n    \"\"\"\n    rep_types = {}\n    for item_idx in titles:\n        rep_types[item_idx] = \"journal\"\n    for item_idx in reportnumbers:\n        rep_types[item_idx] = \"reportnumber\"\n    for item_idx in publishers:\n        rep_types[item_idx] = \"publisher\"\n    return rep_types", "entry_point": "get_replacement_types", "input": "[1, 2, 3], [-1, 0, 1, 2], ['apple', 'banana', 'cherry']", "output": "{1: 'reportnumber', 2: 'reportnumber', 3: 'journal', -1: 'reportnumber', 0: 'reportnumber', 'apple': 'publisher', 'banana': 'publisher', 'cherry': 'publisher'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/tag.py#L736-L761", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035818", "code": "def sum_2_dictionaries(dicta, dictb):\n    \"\"\"Given two dictionaries of totals, where each total refers to a key\n       in the dictionary, add the totals.\n       E.g.:  dicta = { 'a' : 3, 'b' : 1 }\n              dictb = { 'a' : 1, 'c' : 5 }\n              dicta + dictb = { 'a' : 4, 'b' : 1, 'c' : 5 }\n       @param dicta: (dictionary)\n       @param dictb: (dictionary)\n       @return: (dictionary) - the sum of the 2 dictionaries\n    \"\"\"\n    dict_out = dicta.copy()\n    for key in dictb.keys():\n        if 'key' in dict_out:\n            # Add the sum for key in dictb to that of dict_out:\n            dict_out[key] += dictb[key]\n        else:\n            # the key is not in the first dictionary - add it directly:\n            dict_out[key] = dictb[key]\n    return dict_out", "entry_point": "sum_2_dictionaries", "input": "{'x': [1, 2], 'y': []}, {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/tag.py#L1031-L1049", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035819", "code": "def identify_journals(line, kb_journals):\n    \"\"\"Attempt to identify all periodical titles in a reference line.\n       Titles will be identified, their information (location in line,\n       length in line, and non-standardised version) will be recorded,\n       and they will be replaced in the working line by underscores.\n       @param line: (string) - the working reference line.\n       @param periodical_title_search_kb: (dictionary) - contains the\n        regexp patterns used to search for a non-standard TITLE in the\n        working reference line. Keyed by the TITLE string itself.\n       @param periodical_title_search_keys: (list) - contains the non-\n        standard periodical TITLEs to be searched for in the line. This\n        list of titles has already been ordered and is used to force\n        the order of searching.\n       @return: (tuple) containing 4 elements:\n                        + (dictionary) - the lengths of all titles\n                                         matched at each given index\n                                         within the line.\n                        + (dictionary) - the text actually matched for\n                                         each title at each given\n                                         index within the line.\n                        + (string)     - the working line, with the\n                                         titles removed from it and\n                                         replaced by underscores.\n                        + (dictionary) - the totals for each bad-title\n                                         found in the line.\n    \"\"\"\n    periodical_title_search_kb = kb_journals[0]\n    periodical_title_search_keys = kb_journals[2]\n\n    title_matches = {}            # the text matched at the given line\n    # location (i.e. the title itself)\n    titles_count = {}             # sum totals of each 'bad title found in\n    # line.\n\n    # Begin searching:\n    for title in periodical_title_search_keys:\n        # search for all instances of the current periodical title\n        # in the line:\n        # for each matched periodical title:\n        for title_match in periodical_title_search_kb[title].finditer(line):\n\n            if title not in titles_count:\n                # Add this title into the titles_count dictionary:\n                titles_count[title] = 1\n            else:\n                # Add 1 to the count for the given title:\n                titles_count[title] += 1\n\n            # record the details of this title match:\n            # record the match length:\n            title_matches[title_match.start()] = title\n\n            len_to_replace = len(title)\n\n            # replace the matched title text in the line it n * '_',\n            # where n is the length of the matched title:\n            line = u\"\".join((line[:title_match.start()],\n                             u\"_\" * len_to_replace,\n                             line[title_match.start() + len_to_replace:]))\n\n    # return recorded information about matched periodical titles,\n    # along with the newly changed working line:\n    return title_matches, line, titles_count", "entry_point": "identify_journals", "input": "'abc', [[1, 2], [3], []]", "output": "({}, 'abc', {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/tag.py#L1130-L1192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035820", "code": "def roman2arabic(num):\n    \"\"\"Convert numbers from roman to arabic\n\n    This function expects a string like XXII\n    and outputs an integer\n    \"\"\"\n    t = 0\n    p = 0\n    for r in num:\n        n = 10 ** (205558 % ord(r) % 7) % 9995\n        t += n - 2 * p % n\n        p = n\n    return t", "entry_point": "roman2arabic", "input": "()", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/engine.py#L117-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035821", "code": "def format_hep(citation_elements):\n    \"\"\"Format hep-th report numbers with a dash\n\n    e.g. replaces hep-th-9711200 with hep-th/9711200\n    \"\"\"\n    prefixes = ('astro-ph-', 'hep-th-', 'hep-ph-', 'hep-ex-', 'hep-lat-',\n                'math-ph-')\n    for el in citation_elements:\n        if el['type'] == 'REPORTNUMBER':\n            for p in prefixes:\n                if el['report_num'].startswith(p):\n                    el['report_num'] = el['report_num'][:len(p) - 1] + '/' + \\\n                        el['report_num'][len(p):]\n    return citation_elements", "entry_point": "format_hep", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/engine.py#L187-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035822", "code": "def format_author_ed(citation_elements):\n    \"\"\"Standardise to (ed.) and (eds.)\n\n    e.g. Remove extra space in (ed. )\n    \"\"\"\n    for el in citation_elements:\n        if el['type'] == 'AUTH':\n            el['auth_txt'] = el['auth_txt'].replace('(ed. )', '(ed.)')\n            el['auth_txt'] = el['auth_txt'].replace('(eds. )', '(eds.)')\n    return citation_elements", "entry_point": "format_author_ed", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/engine.py#L203-L212", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035823", "code": "def split_volume_from_journal(citation_elements):\n    \"\"\"Split volume from journal title\n\n    We need this because sometimes the volume is attached to the journal title\n    instead of the volume. In those cases we move it here from the title to the\n    volume\n    \"\"\"\n    for el in citation_elements:\n        if el['type'] == 'JOURNAL' and ';' in el['title']:\n            el['title'], series = el['title'].rsplit(';', 1)\n            el['volume'] = series + el['volume']\n    return citation_elements", "entry_point": "split_volume_from_journal", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/engine.py#L242-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035824", "code": "def remove_b_for_nucl_phys(citation_elements):\n    \"\"\"Removes b from the volume of some journals\n\n    Removes the B from the volume for Nucl.Phys.Proc.Suppl. because in INSPIRE\n    that journal is handled differently.\n    \"\"\"\n    for el in citation_elements:\n        if el['type'] == 'JOURNAL' and el['title'] == 'Nucl.Phys.Proc.Suppl.' \\\n                and 'volume' in el \\\n                and (el['volume'].startswith('b') or el['volume'].startswith('B')):\n            el['volume'] = el['volume'][1:]\n    return citation_elements", "entry_point": "remove_b_for_nucl_phys", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/engine.py#L256-L267", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035825", "code": "def join_lines(line1, line2):\n    \"\"\"Join 2 lines of text\n\n    >>> join_lines('abc', 'de')\n    'abcde'\n    >>> join_lines('a-', 'b')\n    'ab'\n    \"\"\"\n    if line1 == u\"\":\n        pass\n    elif line1[-1] == u'-':\n        # hyphenated word at the end of the\n        # line - don't add in a space and remove hyphen\n        line1 = line1[:-1]\n    elif line1[-1] != u' ':\n        # no space at the end of this\n        # line, add in a space\n        line1 = line1 + u' '\n    return line1 + line2", "entry_point": "join_lines", "input": "'  padded  ', 'Hello World'", "output": "'  padded  Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/documents/text.py#L102-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035826", "code": "def _cmp_bystrlen_reverse(a, b):\n    \"\"\"A private \"cmp\" function to be used by the \"sort\" function of a\n       list when ordering the titles found in a knowledge base by string-\n       length - LONGEST -> SHORTEST.\n       @param a: (string)\n       @param b: (string)\n       @return: (integer) - 0 if len(a) == len(b); 1 if len(a) < len(b);\n        -1 if len(a) > len(b);\n    \"\"\"\n    if len(a) > len(b):\n        return -1\n    elif len(a) < len(b):\n        return 1\n    else:\n        return 0", "entry_point": "_cmp_bystrlen_reverse", "input": "[], [1, 2, 3]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/refextract/blob/d70e3787be3c495a3a07d1517b53f81d51c788c7/refextract/references/kbs.py#L418-L432", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035827", "code": "def hue(p):\n    \"\"\"\n    Returns the saturation of a pixel.\n    Gray pixels have saturation 0.\n    :param p: A tuple of (R,G,B) values\n    :return: A saturation value between 0 and 360\n    \"\"\"\n    min_c = min(p)\n    max_c = max(p)\n    d = float(max_c - min_c)\n    if d == 0:\n        return 0\n\n    if max_c == p[0]:\n        h = (p[1] - p[2]) / d\n    elif max_c == p[1]:\n        h = 2 + (p[2] - p[0]) / d\n    else:\n        h = 4 + (p[0] - p[1]) / d\n    h *= 60\n    if h < 0:\n        h += 360\n    return h", "entry_point": "hue", "input": "[1, 2, 3]", "output": "210.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rkargon/pixelsorter/blob/0775d1e487fbcb023e411e1818ba3290b0e8665e/pixelsorter/keys.py#L58-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035828", "code": "def saturation(p):\n    \"\"\"\n    Returns the saturation of a pixel, defined as the ratio of chroma to value.\n    :param p: A tuple of (R,G,B) values\n    :return: The saturation of a pixel, from 0 to 1\n    \"\"\"\n    max_c = max(p)\n    min_c = min(p)\n    if max_c == 0:\n        return 0\n    return (max_c - min_c) / float(max_c)", "entry_point": "saturation", "input": "[-1, 0, 1, 2]", "output": "1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rkargon/pixelsorter/blob/0775d1e487fbcb023e411e1818ba3290b0e8665e/pixelsorter/keys.py#L83-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035829", "code": "def bresenham_circle_octant(radius):\n    \"\"\"\n    Uses Bresenham's algorithm to draw a single octant of a circle with thickness 1,\n    centered on the origin and with the given radius.\n    :param radius: The radius of the circle to draw\n    :return: A list of integer coordinates representing pixels.\n    Starts at (radius, 0) and end with a pixel (x, y) where x == y.\n    \"\"\"\n    x, y = radius, 0\n    r2 = radius * radius\n    coords = []\n    while x >= y:\n        coords.append((x, y))\n        y += 1\n        if abs((x - 1) * (x - 1) + y * y - r2) < abs(x * x + y * y - r2):\n            x -= 1\n    # add a point on the line x = y at the end if it's not already there.\n    if coords[-1][0] != coords[-1][1]:\n        coords.append((coords[-1][0], coords[-1][0]))\n    return coords", "entry_point": "bresenham_circle_octant", "input": "0.5", "output": "[(0.5, 0), (0.5, 0.5)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rkargon/pixelsorter/blob/0775d1e487fbcb023e411e1818ba3290b0e8665e/pixelsorter/paths.py#L240-L259", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035830", "code": "def marquee(text=\"\", width=78, mark='*'):\n    \"\"\"\n    Return the input string centered in a 'marquee'.\n\n    Args:\n        text (str): Input string\n        width (int): Width of final output string.\n        mark (str): Character used to fill string.\n\n    :Examples:\n\n    >>> marquee('A test', width=40)\n    '**************** A test ****************'\n\n    >>> marquee('A test', width=40, mark='-')\n    '---------------- A test ----------------'\n\n    marquee('A test',40, ' ')\n    '                 A test                 '\n    \"\"\"\n    if not text:\n        return (mark*width)[:width]\n\n    nmark = (width-len(text)-2)//len(mark)//2\n    if nmark < 0: \n        nmark = 0\n\n    marks = mark * nmark\n    return '%s %s %s' % (marks, text, marks)", "entry_point": "marquee", "input": "'  padded  ', 1, [1, 2, 3]", "output": "'[]   padded   []'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsvirtuallab/monty/blob/d99d6f3c68372d83489d28ff515566c93cd569e2/monty/string.py#L90-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035831", "code": "def gcd_float(numbers, tol=1e-8):\n    \"\"\"\n    Returns the greatest common divisor for a sequence of numbers.\n    Uses a numerical tolerance, so can be used on floats\n\n    Args:\n        numbers: Sequence of numbers.\n        tol: Numerical tolerance\n\n    Returns:\n        (int) Greatest common divisor of numbers.\n    \"\"\"\n\n    def pair_gcd_tol(a, b):\n        \"\"\"Calculate the Greatest Common Divisor of a and b.\n\n        Unless b==0, the result will have the same sign as b (so that when\n        b is divided by it, the result comes out positive).\n        \"\"\"\n        while b > tol:\n            a, b = b, a % b\n        return a\n\n    n = numbers[0]\n    for i in numbers:\n        n = pair_gcd_tol(n, i)\n    return n", "entry_point": "gcd_float", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "[1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsvirtuallab/monty/blob/d99d6f3c68372d83489d28ff515566c93cd569e2/monty/fractions.py#L54-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035832", "code": "def is_valid_mimetype(response):\n    \"\"\" Return ``True`` if the mimetype is not blacklisted.\n\n    :rtype: bool\n\n    \"\"\"\n    blacklist = [\n        'image/',\n    ]\n\n    mimetype = response.get('mimeType')\n    if not mimetype:\n        return True\n\n    for bw in blacklist:\n        if bw in mimetype:\n            return False\n\n    return True", "entry_point": "is_valid_mimetype", "input": "{}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alertot/detectem/blob/b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1/detectem/response.py#L39-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035833", "code": "def _remove_none_values(dictionary):\n    \"\"\" Remove dictionary keys whose value is None \"\"\"\n    return list(map(dictionary.pop,\n                    [i for i in dictionary if dictionary[i] is None]))", "entry_point": "_remove_none_values", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pahaz/sshtunnel/blob/66a923e4c6c8e41b8348420523fbf5ddfd53176c/sshtunnel.py#L263-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035834", "code": "def _consolidate_binds(local_binds, remote_binds):\n        \"\"\"\n        Fill local_binds with defaults when no value/s were specified,\n        leaving paramiko to decide in which local port the tunnel will be open\n        \"\"\"\n        count = len(remote_binds) - len(local_binds)\n        if count < 0:\n            raise ValueError('Too many local bind addresses '\n                             '(local_bind_addresses > remote_bind_addresses)')\n        local_binds.extend([('0.0.0.0', 0) for x in range(count)])\n        return local_binds", "entry_point": "_consolidate_binds", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "[[1, 2], [3], [], ('0.0.0.0', 0)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pahaz/sshtunnel/blob/66a923e4c6c8e41b8348420523fbf5ddfd53176c/sshtunnel.py#L1048-L1058", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035835", "code": "def all_arcs(constraints):\n    \"\"\"\n    For each constraint ((X, Y), const) adds:\n        ((X, Y), const)\n        ((Y, X), const)\n    \"\"\"\n    arcs = set()\n\n    for neighbors, constraint in constraints:\n        if len(neighbors) == 2:\n            x, y = neighbors\n            list(map(arcs.add, ((x, y), (y, x))))\n\n    return arcs", "entry_point": "all_arcs", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/simpleai-team/simpleai/blob/2836befa7e970013f62e0ee75562652aacac6f65/simpleai/search/arc.py#L42-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035836", "code": "def _retain_centroids(numbers, thres):\n    \"\"\"Only keep one number for each cluster within thres of each other\"\"\"\n    numbers.sort()\n    prev = -1\n    ret = []\n    for n in numbers:\n        if prev < 0 or n - prev > thres:\n            ret.append(n)\n            prev = n\n    return ret", "entry_point": "_retain_centroids", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/pdftotree/blob/5890d668b475d5d3058d1d886aafbfd83268c440/pdftotree/utils/pdf/grid.py#L178-L187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035837", "code": "def _split_vlines_hlines(lines):\n    \"\"\"Separates lines into horizontal and vertical ones\"\"\"\n    vlines, hlines = [], []\n    for line in lines:\n        (vlines if line.x1 - line.x0 < 0.1 else hlines).append(line)\n    return vlines, hlines", "entry_point": "_split_vlines_hlines", "input": "''", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/pdftotree/blob/5890d668b475d5d3058d1d886aafbfd83268c440/pdftotree/utils/pdf/grid.py#L190-L195", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035838", "code": "def do_intersect(bb1, bb2):\n    \"\"\"\n    Helper function that returns True if two bounding boxes overlap.\n    \"\"\"\n    if bb1[0] + bb1[2] < bb2[0] or bb2[0] + bb2[2] < bb1[0]:\n        return False\n    if bb1[1] + bb1[3] < bb2[1] or bb2[1] + bb2[3] < bb1[1]:\n        return False\n    return True", "entry_point": "do_intersect", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/pdftotree/blob/5890d668b475d5d3058d1d886aafbfd83268c440/pdftotree/visual/visual_utils.py#L63-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035839", "code": "def doOverlap(bbox1, bbox2):\n    \"\"\"\n    :param bbox1: bounding box of the first rectangle\n    :param bbox2: bounding box of the second rectangle\n    :return: 1 if the two rectangles overlap\n    \"\"\"\n    if bbox1[2] < bbox2[0] or bbox2[2] < bbox1[0]:\n        return False\n    if bbox1[3] < bbox2[1] or bbox2[3] < bbox1[1]:\n        return False\n    return True", "entry_point": "doOverlap", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/pdftotree/blob/5890d668b475d5d3058d1d886aafbfd83268c440/pdftotree/utils/bbox_utils.py#L4-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035840", "code": "def normalize_pts(pts, ymax, scaler=2):\n    \"\"\"\n    scales all coordinates and flip y axis due to different\n    origin coordinates (top left vs. bottom left)\n    \"\"\"\n    return [(x * scaler, ymax - (y * scaler)) for x, y in pts]", "entry_point": "normalize_pts", "input": "{}, {'x': [1, 2], 'y': []}, (1, 2)", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/pdftotree/blob/5890d668b475d5d3058d1d886aafbfd83268c440/pdftotree/utils/img_utils.py#L52-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035841", "code": "def pluralize(item):\n        \"\"\"Nothing to see here.\n        \"\"\"\n        assert isinstance(item, (int, list))\n        if isinstance(item, int):\n            return 's' if item > 1 else ''\n        if isinstance(item, list):\n            return 's' if len(item) > 1 else ''\n        return ''", "entry_point": "pluralize", "input": "['apple', 'banana', 'cherry']", "output": "'s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MozillaSecurity/laniakea/blob/7e80adc6ae92c6c1332d4c08473bb271fb3b6833/laniakea/core/common.py#L190-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035842", "code": "def filter(criterias, devices):  # pylint: disable=too-many-branches\n        \"\"\"Filter a device by criterias on the root level of the dictionary.\n        \"\"\"\n        if not criterias:\n            return devices\n        result = []\n        for device in devices:  # pylint: disable=too-many-nested-blocks\n            for criteria_name, criteria_values in criterias.items():\n                if criteria_name in device.keys():\n                    if isinstance(device[criteria_name], list):\n                        for criteria_value in criteria_values:\n                            if criteria_value in device[criteria_name]:\n                                result.append(device)\n                                break\n                    elif isinstance(device[criteria_name], str):\n                        for criteria_value in criteria_values:\n                            if criteria_value == device[criteria_name]:\n                                result.append(device)\n                    elif isinstance(device[criteria_name], int):\n                        for criteria_value in criteria_values:\n                            if criteria_value == device[criteria_name]:\n                                result.append(device)\n                    else:\n                        continue\n        return result", "entry_point": "filter", "input": "[], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MozillaSecurity/laniakea/blob/7e80adc6ae92c6c1332d4c08473bb271fb3b6833/laniakea/core/providers/packet/manager.py#L159-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035843", "code": "def dnsrepr2names(x):\n    \"\"\"\n    Take as input a DNS encoded string (possibly compressed) \n    and returns a list of DNS names contained in it.\n    If provided string is already in printable format\n    (does not end with a null character, a one element list\n    is returned). Result is a list.\n    \"\"\"\n    res = []\n    cur = b\"\"\n    if type(x) is str:\n        x = x.encode('ascii')\n    while x:\n        #l = ord(x[0])\n        l = x[0]\n        x = x[1:]\n        if l == 0:\n            if cur and cur[-1] == ord('.'):\n                cur = cur[:-1]\n            res.append(cur)\n            cur = b\"\"\n            #if x and ord(x[0]) == 0: # single component\n            if x and x[0] == 0: # single component\n                x = x[1:]\n            continue\n        if l & 0xc0: # XXX TODO : work on that -- arno\n            raise Exception(\"DNS message can't be compressed at this point!\")\n        else:\n            cur += x[:l]+b\".\"\n            x = x[l:]\n    return res", "entry_point": "dnsrepr2names", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/phaethon/kamene/blob/11d4064844f4f68ac5d7546f5633ac7d02082914/kamene/layers/inet6.py#L1929-L1959", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035844", "code": "def ipv4(value):\n    \"\"\"\n    Return whether or not given value is a valid IP version 4 address.\n\n    This validator is based on `WTForms IPAddress validator`_\n\n    .. _WTForms IPAddress validator:\n       https://github.com/wtforms/wtforms/blob/master/wtforms/validators.py\n\n    Examples::\n\n        >>> ipv4('123.0.0.7')\n        True\n\n        >>> ipv4('900.80.70.11')\n        ValidationFailure(func=ipv4, args={'value': '900.80.70.11'})\n\n    .. versionadded:: 0.2\n\n    :param value: IP address string to validate\n    \"\"\"\n    groups = value.split('.')\n    if len(groups) != 4 or any(not x.isdigit() for x in groups):\n        return False\n    return all(0 <= int(part) < 256 for part in groups)", "entry_point": "ipv4", "input": "'walnut thistle harbour'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kvesteri/validators/blob/34d355e87168241e872b25811d245810df2bd430/validators/ip_address.py#L5-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035845", "code": "def are_collections_aligned(data_collections, raise_exception=True):\n        \"\"\"Test if a series of Data Collections are aligned with one another.\n\n        Aligned Data Collections are of the same Data Collection class, have the\n        same number of values and have matching datetimes.\n\n        Args:\n            data_collections: A list of Data Collections for which you want to\n                test if they are al aligned with one another.\n\n        Return:\n            True if collections are aligned, False if not aligned\n        \"\"\"\n        if len(data_collections) > 1:\n            first_coll = data_collections[0]\n            for coll in data_collections[1:]:\n                if not first_coll.is_collection_aligned(coll):\n                    if raise_exception is True:\n                        error_msg = '{} Data Collection is not aligned with '\\\n                            '{} Data Collection.'.format(\n                                first_coll.header.data_type, coll.header.data_type)\n                        raise ValueError(error_msg)\n                    return False\n        return True", "entry_point": "are_collections_aligned", "input": "[], [[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L418-L441", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035846", "code": "def _calculate_hour_and_minute(float_hour):\n        \"\"\"Calculate hour and minutes as integers from a float hour.\"\"\"\n        hour, minute = int(float_hour), int(round((float_hour - int(float_hour)) * 60))\n        if minute == 60:\n            return hour + 1, 0\n        else:\n            return hour, minute", "entry_point": "_calculate_hour_and_minute", "input": "True", "output": "(1, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L159-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035847", "code": "def invertDictMapping(d):\n    \"\"\" Invert mapping of dictionary (i.e. map values to list of keys) \"\"\"\n    inv_map = {}\n    for k, v in d.items():\n        inv_map[v] = inv_map.get(v, [])\n        inv_map[v].append(k)\n    return inv_map", "entry_point": "invertDictMapping", "input": "{'a': 1, 'b': 2}", "output": "{1: ['a'], 2: ['b']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Neurosim-lab/netpyne/blob/edb67b5098b2e7923d55010ded59ad1bf75c0f18/netpyne/analysis/utils.py#L309-L315", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035848", "code": "def _get_cols(fields, schema):\n  \"\"\" Get column metadata for Google Charts based on field list and schema. \"\"\"\n  typemap = {\n    'STRING': 'string',\n    'INT64': 'number',\n    'INTEGER': 'number',\n    'FLOAT': 'number',\n    'FLOAT64': 'number',\n    'BOOL': 'boolean',\n    'BOOLEAN': 'boolean',\n    'DATE': 'date',\n    'TIME': 'timeofday',\n    'DATETIME': 'datetime',\n    'TIMESTAMP': 'datetime'\n  }\n  cols = []\n  for col in fields:\n    if schema:\n      f = schema[col]\n      t = 'string' if f.mode == 'REPEATED' else typemap.get(f.data_type, 'string')\n      cols.append({'id': f.name, 'label': f.name, 'type': t})\n    else:\n      # This will only happen if we had no rows to infer a schema from, so the type\n      # is not really important, except that GCharts will choke if we pass such a schema\n      # to a chart if it is string x string so we default to number.\n      cols.append({'id': col, 'label': col, 'type': 'number'})\n  return cols", "entry_point": "_get_cols", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googledatalab/pydatalab/blob/d9031901d5bca22fe0d5925d204e6698df9852e1/datalab/utils/commands/_utils.py#L99-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035849", "code": "def expand_var(v, env):\n  \"\"\" If v is a variable reference (for example: '$myvar'), replace it using the supplied\n      env dictionary.\n\n  Args:\n    v: the variable to replace if needed.\n    env: user supplied dictionary.\n\n  Raises:\n    Exception if v is a variable reference but it is not found in env.\n  \"\"\"\n  if len(v) == 0:\n    return v\n  # Using len() and v[0] instead of startswith makes this Unicode-safe.\n  if v[0] == '$':\n    v = v[1:]\n    if len(v) and v[0] != '$':\n      if v in env:\n        v = env[v]\n      else:\n        raise Exception('Cannot expand variable $%s' % v)\n  return v", "entry_point": "expand_var", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googledatalab/pydatalab/blob/d9031901d5bca22fe0d5925d204e6698df9852e1/datalab/utils/commands/_utils.py#L260-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035850", "code": "def _get_dependency_definition(task_id, dependencies):\n    \"\"\" Internal helper collects all the dependencies of the task, and returns\n      the Airflow equivalent python sytax for specifying them.\n    \"\"\"\n    set_upstream_statements = ''\n    for dependency in dependencies:\n      set_upstream_statements = set_upstream_statements + \\\n          '{0}.set_upstream({1})'.format(task_id, dependency) + '\\n'\n    return set_upstream_statements", "entry_point": "_get_dependency_definition", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "\"['a', 'b', 'c'].set_upstream(1)\\n['a', 'b', 'c'].set_upstream(2)\\n['a', 'b', 'c'].set_upstream(3)\\n\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googledatalab/pydatalab/blob/d9031901d5bca22fe0d5925d204e6698df9852e1/google/datalab/contrib/pipeline/_pipeline.py#L167-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035851", "code": "def get_margin(length):\n    \"\"\"Add enough tabs to align in two columns\"\"\"\n    if length > 23:\n        margin_left = \"\\t\"\n        chars = 1\n    elif length > 15:\n        margin_left = \"\\t\\t\"\n        chars = 2\n    elif length > 7:\n        margin_left = \"\\t\\t\\t\"\n        chars = 3\n    else:\n        margin_left = \"\\t\\t\\t\\t\"\n        chars = 4\n    return margin_left", "entry_point": "get_margin", "input": "1", "output": "'\\t\\t\\t\\t'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tobami/littlechef/blob/aab8c94081b38100a69cc100bc4278ae7419c58e/littlechef/lib.py#L535-L549", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035852", "code": "def arg_to_dict(arg):\n    \"\"\"Convert an argument that can be None, list/tuple or dict to dict\n\n    Example::\n\n        >>> arg_to_dict(None)\n        []\n        >>> arg_to_dict(['a', 'b'])\n        {'a':{},'b':{}}\n        >>> arg_to_dict({'a':{'only': 'id'}, 'b':{'only': 'id'}})\n        {'a':{'only':'id'},'b':{'only':'id'}}\n\n    :return: dict with keys and dict arguments as value\n    \"\"\"\n    if arg is None:\n        arg = []\n    try:\n        arg = dict(arg)\n    except ValueError:\n        arg = dict.fromkeys(list(arg), {})\n\n    return arg", "entry_point": "arg_to_dict", "input": "['a', 'b', 'c']", "output": "{'a': {}, 'b': {}, 'c': {}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/danielholmstrom/dictalchemy/blob/038b8822b0ed66feef78a80b3af8f3a09f795b5a/dictalchemy/utils.py#L20-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035853", "code": "def make_feature_dict(feature_sequence):\n    \"\"\"A feature dict is a convenient way to organize a sequence of Feature\n    object (which you have got, e.g., from parse_GFF).\n\n    The function returns a dict with all the feature types as keys. Each value\n    of this dict is again a dict, now of feature names. The values of this dict\n    is a list of feature.\n\n    An example makes this clear. Let's say you load the C. elegans GTF file\n    from Ensemble and make a feature dict:\n\n    >>> worm_features_dict = HTSeq.make_feature_dict(HTSeq.parse_GFF(\n    ...     \"test_data/Caenorhabditis_elegans.WS200.55.gtf.gz\"))\n\n    (This command may take a few minutes to deal with the 430,000 features\n    in the GTF file. Note that you may need a lot of RAM if you have millions\n    of features.)\n\n    Then, you can simply access, say, exon 0 of gene \"F08E10.4\" as follows:\n    >>> worm_features_dict[ 'exon' ][ 'F08E10.4' ][ 0 ]\n    <GenomicFeature: exon 'F08E10.4' at V: 17479353 -> 17479001 (strand '-')>\n    \"\"\"\n\n    res = {}\n    for f in feature_sequence:\n        if f.type not in res:\n            res[f.type] = {}\n        res_ftype = res[f.type]\n        if f.name not in res_ftype:\n            res_ftype[f.name] = [f]\n        else:\n            res_ftype[f.name].append(f)\n    return res", "entry_point": "make_feature_dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/simon-anders/htseq/blob/6f7d66e757e610228c33ebf2bb5dc8cc5051c7f0/python2/HTSeq/__init__.py#L231-L263", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035854", "code": "def __flatten_index(pos, shape):\n    \"\"\"\n    Takes a three dimensional index (x,y,z) and computes the index required to access the\n    same element in the flattened version of the array.\n    \"\"\"\n    res = 0\n    acc = 1\n    for pi, si in zip(reversed(pos), reversed(shape)):\n        res += pi * acc\n        acc *= si\n    return res", "entry_point": "__flatten_index", "input": "[], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/loli/medpy/blob/95216b9e22e7ce301f0edf953ee2a2f1b6c6aee5/medpy/graphcut/energy_voxel.py#L642-L652", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035855", "code": "def _create_structure_array(structure_array, voxelspacing):\n    \"\"\"\n    Convenient function to take a structure array (single number valid for all dimensions\n    or a sequence with a distinct number for each dimension) assumed to be in mm and\n    returns a structure array (a sequence) adapted to the image space using the supplied\n    voxel spacing.\n    \"\"\"\n    try:\n        structure_array = [s / float(vs) for s, vs in zip(structure_array, voxelspacing)]\n    except TypeError:\n        structure_array = [structure_array / float(vs) for vs in voxelspacing]\n    \n    return structure_array", "entry_point": "_create_structure_array", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "[-1.0, 0.0, 0.3333333333333333]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/loli/medpy/blob/95216b9e22e7ce301f0edf953ee2a2f1b6c6aee5/medpy/features/intensity.py#L746-L758", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035856", "code": "def __combine_windows(w1, w2):\n    \"\"\"\n    Joins two windows (defined by tuple of slices) such that their maximum\n    combined extend is covered by the new returned window.\n    \"\"\"\n    res = []\n    for s1, s2 in zip(w1, w2):\n        res.append(slice(min(s1.start, s2.start), max(s1.stop, s2.stop)))\n    return tuple(res)", "entry_point": "__combine_windows", "input": "['a', 'b', 'c'], []", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/loli/medpy/blob/95216b9e22e7ce301f0edf953ee2a2f1b6c6aee5/medpy/metric/binary.py#L1229-L1237", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035857", "code": "def is_foreign_key(line):\n    \"\"\"\n    :param line: a line from the table definition\n    :return: true if the line appears to be a foreign key definition\n    \"\"\"\n    arrow_position = line.find('->')\n    return arrow_position >= 0 and not any(c in line[:arrow_position] for c in '\"#\\'')", "entry_point": "is_foreign_key", "input": "''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/declare.py#L72-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035858", "code": "def remove_duplicates(lst):\n    \"\"\"\n    Emulate what a Python ``set()`` does, but keeping the element's order.\n    \"\"\"\n    dset = set()\n    return [l for l in lst if l not in dset and not dset.add(l)]", "entry_point": "remove_duplicates", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/utils.py#L8-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035859", "code": "def parse_responsive_length(responsive_length):\n    \"\"\"\n    Takes a string containing a length definition in pixels or percent and parses it to obtain\n    a computational length. It returns a tuple where the first element is the length in pixels and\n    the second element is its length in percent divided by 100.\n    Note that one of both returned elements is None.\n    \"\"\"\n    responsive_length = responsive_length.strip()\n    if responsive_length.endswith('px'):\n        return (int(responsive_length.rstrip('px')), None)\n    elif responsive_length.endswith('%'):\n        return (None, float(responsive_length.rstrip('%')) / 100)\n    return (None, None)", "entry_point": "parse_responsive_length", "input": "'  padded  '", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/utils.py#L71-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035860", "code": "def points_with_surrounding_gaps(points):\n    \"\"\"\n    This function makes sure that any gaps in the sequence provided have stopper points at their beginning\n    and end so a graph will be drawn with correct 0 ranges. This is more efficient than filling in all points\n    up to the maximum value. For example:\n\n    input: [1,2,3,10,11,13]\n    output [1,2,3,4,9,10,11,12,13]\n    \"\"\"\n    points_with_gaps = []\n    last_point = -1\n    for point in points:\n        if last_point + 1 == point:\n            pass\n        elif last_point + 2 == point:\n            points_with_gaps.append(last_point + 1)\n        else:\n            points_with_gaps.append(last_point + 1)\n            points_with_gaps.append(point - 1)\n        points_with_gaps.append(point)\n        last_point = point\n    return points_with_gaps", "entry_point": "points_with_surrounding_gaps", "input": "[1, 2, 3]", "output": "[0, 1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mixcloud/django-experiments/blob/1f45e9f8a108b51e44918daa647269b2b8d43f1d/experiments/admin_utils.py#L61-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035861", "code": "def ones_comp_sum16(num1: int, num2: int) -> int:\n    \"\"\"Calculates the 1's complement sum for 16-bit numbers.\n\n    Args:\n        num1: 16-bit number.\n        num2: 16-bit number.\n\n    Returns:\n        The calculated result.\n    \"\"\"\n\n    carry = 1 << 16\n    result = num1 + num2\n    return result if result < carry else result + 1 - carry", "entry_point": "ones_comp_sum16", "input": "2, 0", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kyan001/ping3/blob/fc9e8a4b828965a800036dfbd019e97114ad80b3/ping3.py#L34-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035862", "code": "def ipv4_lstrip_zeros(address):\n    \"\"\"\n    The function to strip leading zeros in each octet of an IPv4 address.\n\n    Args:\n        address (:obj:`str`): An IPv4 address.\n\n    Returns:\n        str: The modified IPv4 address.\n    \"\"\"\n\n    # Split  the octets.\n    obj = address.strip().split('.')\n\n    for x, y in enumerate(obj):\n\n        # Strip leading zeros. Split / here in case CIDR is attached.\n        obj[x] = y.split('/')[0].lstrip('0')\n        if obj[x] in ['', None]:\n            obj[x] = '0'\n\n    return '.'.join(obj)", "entry_point": "ipv4_lstrip_zeros", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L117-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035863", "code": "def __protocolize(base_url):\n        \"\"\"Internal add-protocol-to-url helper\"\"\"\n        if not base_url.startswith(\"http://\") and not base_url.startswith(\"https://\"):\n            base_url = \"https://\" + base_url\n\n        # Some API endpoints can't handle extra /'s in path requests\n        base_url = base_url.rstrip(\"/\")\n        return base_url", "entry_point": "__protocolize", "input": "''", "output": "'https:'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2939-L2946", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035864", "code": "def allLinesMatchingPattern(pattern, lines):\n    \"\"\" Like lineMatchingPattern, but returns all lines that match the specified pattern\n\n    :type pattern: Compiled regular expression pattern to use\n    :type lines: List of lines to search\n\n    :return: list of re.Match objects for each line matched, or an empty list if none matched\n    :rtype: list\n    \"\"\"\n    result = []\n    for line in lines:\n        m = pattern.match(line)\n        if m:\n            result.append(m)\n    return result", "entry_point": "allLinesMatchingPattern", "input": "['a', 'b', 'c'], ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/util.py#L96-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035865", "code": "def format_label(sl, fmt=None):\n    \"\"\"\n    Combine a list of strings to a single str, joined by sep.\n    Passes through single strings.\n    :param sl:\n    :return:\n    \"\"\"\n    if isinstance(sl, str):\n        # Already is a string.\n        return sl\n\n    if fmt:\n        return fmt.format(*sl)\n\n    return ' '.join(str(s) for s in sl)", "entry_point": "format_label", "input": "[-1, 0, 1, 2], []", "output": "'-1 0 1 2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mfitzp/padua/blob/8b14bf4d2f895da6aea5d7885d409315bd303ec6/padua/utils.py#L191-L205", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035866", "code": "def hierarchical_match(d, k, default=None):\n    \"\"\"\n    Match a key against a dict, simplifying element at a time\n\n\n    :param df: DataFrame\n    :type df: pandas.DataFrame\n    :param level: Level of DataFrame index to extract IDs from\n    :type level: int or str\n    :return: hiearchically matched value or default\n    \"\"\"\n    if d is None:\n        return default\n\n    if type(k) != list and type(k) != tuple:\n        k = [k]\n\n    for n, _ in enumerate(k):\n        key = tuple(k[0:len(k)-n])\n        if len(key) == 1:\n            key = key[0]\n\n        try:\n            d[key]\n        except:\n            pass\n        else:\n            return d[key]\n    return default", "entry_point": "hierarchical_match", "input": "[], [[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mfitzp/padua/blob/8b14bf4d2f895da6aea5d7885d409315bd303ec6/padua/utils.py#L228-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035867", "code": "def combine_expression_columns(df, columns_to_combine, remove_combined=True):\n\n    \"\"\"\n    Combine expression columns, calculating the mean for 2 columns\n\n\n    :param df: Pandas dataframe\n    :param columns_to_combine: A list of tuples containing the column names to combine\n    :return:\n    \"\"\"\n\n    df = df.copy()\n\n    for ca, cb in columns_to_combine:\n        df[\"%s_(x+y)/2_%s\" % (ca, cb)] = (df[ca] + df[cb]) / 2\n\n    if remove_combined:\n        for ca, cb in columns_to_combine:\n            df.drop([ca, cb], inplace=True, axis=1)\n\n    return df", "entry_point": "combine_expression_columns", "input": "[-1, 0, 1, 2], [], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mfitzp/padua/blob/8b14bf4d2f895da6aea5d7885d409315bd303ec6/padua/process.py#L198-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035868", "code": "def normalize_pipeline_name(name=''):\n    \"\"\"Translate unsafe characters to underscores.\"\"\"\n    normalized_name = name\n    for bad in '\\\\/?%#':\n        normalized_name = normalized_name.replace(bad, '_')\n    return normalized_name", "entry_point": "normalize_pipeline_name", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/pipelines.py#L112-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035869", "code": "def generate_packer_filename(provider, region, builder):\n    \"\"\"Generate a filename to be used by packer.\n\n    Args:\n        provider (str): Name of Spinnaker provider.\n        region (str): Name of provider region to use.\n        builder (str): Name of builder process type.\n\n    Returns:\n        str: Generated filename based on parameters.\n\n    \"\"\"\n    filename = '{0}_{1}_{2}.json'.format(provider, region, builder)\n    return filename", "entry_point": "generate_packer_filename", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "\"['a', 'b', 'c']_['apple', 'banana', 'cherry']_[5, 3, 1, 4].json\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/generate_filename.py#L19-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035870", "code": "def generated_tag_data(tags):\n    \"\"\"Convert :obj:`dict` to S3 Tag list.\n\n    Args:\n        tags (dict): Dictonary of tag key and tag value passed.\n\n    Returns:\n        list: List of dictionaries.\n\n    \"\"\"\n    generated_tags = []\n    for key, value in tags.items():\n        generated_tags.append({\n            'Key': key,\n            'Value': value,\n        })\n    return generated_tags", "entry_point": "generated_tag_data", "input": "{'a': 1, 'b': 2}", "output": "[{'Key': 'a', 'Value': 1}, {'Key': 'b', 'Value': 2}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/generate_s3_tags.py#L4-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035871", "code": "def extract_formats(config_handle):\n    \"\"\"Get application formats.\n\n    See :class:`gogoutils.Formats` for available options.\n\n    Args:\n        config_handle (configparser.ConfigParser): Instance of configurations.\n\n    Returns:\n        dict: Formats in ``{$format_type: $format_pattern}``.\n\n    \"\"\"\n    configurations = dict(config_handle)\n    formats = dict(configurations.get('formats', {}))\n    return formats", "entry_point": "extract_formats", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L77-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035872", "code": "def _remove_empty_entries(entries):\n    \"\"\"Remove empty entries in a list\"\"\"\n    valid_entries = []\n    for entry in set(entries):\n        if entry:\n            valid_entries.append(entry)\n    return sorted(valid_entries)", "entry_point": "_remove_empty_entries", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L144-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035873", "code": "def reduce_to_unit(divider):\n    \"\"\"\n    Reduce a repeating divider to the smallest repeating unit possible.\n\n    Note: this function is used by make-div\n    :param divider: the divider\n    :return: smallest repeating unit possible\n    :rtype: str\n\n    :Example:\n    'XxXxXxX' -> 'Xx'\n    \"\"\"\n    for unit_size in range(1, len(divider) // 2 + 1):\n        length = len(divider)\n        unit = divider[:unit_size]\n\n        # Ignores mismatches in final characters:\n        divider_item = divider[:unit_size * (length // unit_size)]\n        if unit * (length // unit_size) == divider_item:\n            return unit\n    return divider", "entry_point": "reduce_to_unit", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/area4lib/area4/blob/7f71b58d6b44b1a61284a8a01f26afd3138b9b17/area4/util.py#L42-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035874", "code": "def config_from_prefix(prefix):\n    \"\"\"Get config from zmq prefix\"\"\"\n    settings = {}\n    if prefix.lower() in ('default', 'auto', ''):\n        settings['zmq_prefix'] = ''\n        settings['libzmq_extension'] = False\n        settings['no_libzmq_extension'] = False\n    elif prefix.lower() in ('bundled', 'extension'):\n        settings['zmq_prefix'] = ''\n        settings['libzmq_extension'] = True\n        settings['no_libzmq_extension'] = False\n    else:\n        settings['zmq_prefix'] = prefix\n        settings['libzmq_extension'] = False\n        settings['no_libzmq_extension'] = True\n    return settings", "entry_point": "config_from_prefix", "input": "''", "output": "{'zmq_prefix': '', 'libzmq_extension': False, 'no_libzmq_extension': False}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/capnproto/pycapnp/blob/cb3f190b955bdb1bfb6e0ac0b2f9306a5c79f7b5/buildutils/config.py#L104-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035875", "code": "def getArcs(domains, constraints):\n    \"\"\"\n    Return a dictionary mapping pairs (arcs) of constrained variables\n\n    @attention: Currently unused.\n    \"\"\"\n    arcs = {}\n    for x in constraints:\n        constraint, variables = x\n        if len(variables) == 2:\n            variable1, variable2 = variables\n            arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x)\n            arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x)\n    return arcs", "entry_point": "getArcs", "input": "2.0, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-constraint/python-constraint/blob/e23fe9852cddddf1c3e258e03f2175df24b4c702/constraint/__init__.py#L306-L319", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035876", "code": "def doArc8(arcs, domains, assignments):\n    \"\"\"\n    Perform the ARC-8 arc checking algorithm and prune domains\n\n    @attention: Currently unused.\n    \"\"\"\n    check = dict.fromkeys(domains, True)\n    while check:\n        variable, _ = check.popitem()\n        if variable not in arcs or variable in assignments:\n            continue\n        domain = domains[variable]\n        arcsvariable = arcs[variable]\n        for othervariable in arcsvariable:\n            arcconstraints = arcsvariable[othervariable]\n            if othervariable in assignments:\n                otherdomain = [assignments[othervariable]]\n            else:\n                otherdomain = domains[othervariable]\n            if domain:\n                # changed = False\n                for value in domain[:]:\n                    assignments[variable] = value\n                    if otherdomain:\n                        for othervalue in otherdomain:\n                            assignments[othervariable] = othervalue\n                            for constraint, variables in arcconstraints:\n                                if not constraint(\n                                    variables, domains, assignments, True\n                                ):\n                                    break\n                            else:\n                                # All constraints passed. Value is safe.\n                                break\n                        else:\n                            # All othervalues failed. Kill value.\n                            domain.hideValue(value)\n                            # changed = True\n                        del assignments[othervariable]\n                del assignments[variable]\n                # if changed:\n                #     check.update(dict.fromkeys(arcsvariable))\n            if not domain:\n                return False\n    return True", "entry_point": "doArc8", "input": "['apple', 'banana', 'cherry'], [], ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-constraint/python-constraint/blob/e23fe9852cddddf1c3e258e03f2175df24b4c702/constraint/__init__.py#L322-L366", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035877", "code": "def versionString(version):\n    \"\"\"Create version string.\n\n    For a sequence containing version information such as (2, 0, 0, 'pre'),\n    this returns a printable string such as '2.0pre'.\n    The micro version number is only excluded from the string if it is zero.\n\n    \"\"\"\n    ver = list(map(str, version))\n    numbers, rest = ver[:2 if ver[2] == '0' else 3], ver[3:]\n    return '.'.join(numbers) + '-'.join(rest)", "entry_point": "versionString", "input": "['apple', 'banana', 'cherry']", "output": "'apple.banana.cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Cito/DBUtils/blob/90e8825e038f08c82044b8e50831480175fa026a/setversion.py#L37-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035878", "code": "def get_labels(cs):\n    \"\"\"Return list of every label.\"\"\"\n    records = []\n    for c in cs:\n        records.extend(c.get('labels', []))\n    return records", "entry_point": "get_labels", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcs07/ChemDataExtractor/blob/349a3bea965f2073141d62043b89319222e46af1/chemdataextractor/cli/evaluate.py#L83-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035879", "code": "def get_ids(cs):\n    \"\"\"Return chemical identifier records.\"\"\"\n    records = []\n    for c in cs:\n        records.append({k: c[k] for k in c if k in {'names', 'labels'}})\n    return records", "entry_point": "get_ids", "input": "[[1, 2], [3], []]", "output": "[{}, {}, {}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcs07/ChemDataExtractor/blob/349a3bea965f2073141d62043b89319222e46af1/chemdataextractor/cli/evaluate.py#L91-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035880", "code": "def strip_stop(tokens, start, result):\n    \"\"\"Remove trailing full stop from tokens.\"\"\"\n    for e in result:\n        for child in e.iter():\n            if child.text.endswith('.'):\n                child.text = child.text[:-1]\n    return result", "entry_point": "strip_stop", "input": "[[1, 2], [3], []], [5, 3, 1, 4], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcs07/ChemDataExtractor/blob/349a3bea965f2073141d62043b89319222e46af1/chemdataextractor/parse/actions.py#L55-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035881", "code": "def levenshtein(s1, s2, allow_substring=False):\n    \"\"\"Return the Levenshtein distance between two strings.\n\n    The Levenshtein distance (a.k.a \"edit difference\") is the number of characters that need to be substituted,\n    inserted or deleted to transform s1 into s2.\n\n    Setting the `allow_substring` parameter to True allows s1 to be a\n    substring of s2, so that, for example, \"hello\" and \"hello there\" would have a distance of zero.\n\n    :param string s1: The first string\n    :param string s2: The second string\n    :param bool allow_substring: Whether to allow s1 to be a substring of s2\n    :returns: Levenshtein distance.\n    :rtype int\n    \"\"\"\n    len1, len2 = len(s1), len(s2)\n    lev = []\n    for i in range(len1 + 1):\n        lev.append([0] * (len2 + 1))\n    for i in range(len1 + 1):\n        lev[i][0] = i\n    for j in range(len2 + 1):\n        lev[0][j] = 0 if allow_substring else j\n    for i in range(len1):\n        for j in range(len2):\n            lev[i + 1][j + 1] = min(lev[i][j + 1] + 1, lev[i + 1][j] + 1, lev[i][j] + (s1[i] != s2[j]))\n    return min(lev[len1]) if allow_substring else lev[len1][len2]", "entry_point": "levenshtein", "input": "[], [1, 2, 3], 'a,b,c'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcs07/ChemDataExtractor/blob/349a3bea965f2073141d62043b89319222e46af1/chemdataextractor/text/__init__.py#L232-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035882", "code": "def bracket_level(text, open={'(', '[', '{'}, close={')', ']', '}'}):\n    \"\"\"Return 0 if string contains balanced brackets or no brackets.\"\"\"\n    level = 0\n    for c in text:\n        if c in open:\n            level += 1\n        elif c in close:\n            level -= 1\n    return level", "entry_point": "bracket_level", "input": "'a,b,c', [5, 3, 1, 4], [[1, 2], [3], []]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mcs07/ChemDataExtractor/blob/349a3bea965f2073141d62043b89319222e46af1/chemdataextractor/text/__init__.py#L261-L269", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035883", "code": "def _clear_empty_values(args):\n    '''\n    Scrap junk data from a dict.\n    '''\n    result = {}\n    for param in args:\n        if args[param] is not None:\n            result[param] = args[param]\n    return result", "entry_point": "_clear_empty_values", "input": "[-1, 0, 1, 2]", "output": "{-1: 2, 0: -1, 1: 0, 2: 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xmunoz/sodapy/blob/dad2ca9560cde0acb03bdb4423260e891ca40d7b/sodapy/__init__.py#L534-L542", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035884", "code": "def base36encode(number):\n    \"\"\"Converts an integer into a base36 string.\"\"\"\n\n    ALPHABET = \"0123456789abcdefghijklmnopqrstuvwxyz\"\n\n    base36 = ''\n    sign = ''\n\n    if number < 0:\n        sign = '-'\n        number = -number\n\n    if 0 <= number < len(ALPHABET):\n        return sign + ALPHABET[number]\n\n    while number != 0:\n        number, i = divmod(number, len(ALPHABET))\n        base36 = ALPHABET[i] + base36\n\n    return sign + base36", "entry_point": "base36encode", "input": "1", "output": "'1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tableau/document-api-python/blob/9097a5b351622c5dd2653fa94624bc012316d8a4/tableaudocumentapi/datasource.py#L63-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035885", "code": "def _guess_type(mrz_lines):\n        \"\"\"Guesses the type of the MRZ from given lines. Returns 'TD1', 'TD2', 'TD3', 'MRVA', 'MRVB' or None.\n        The algorithm is basically just counting lines, looking at their length and checking whether the first character is a 'V'\n\n        >>> MRZ._guess_type([]) is None\n        True\n        >>> MRZ._guess_type([1]) is None\n        True\n        >>> MRZ._guess_type([1,2]) is None  # No len() for numbers\n        True\n        >>> MRZ._guess_type(['a','b'])  # This way passes\n        'TD2'\n        >>> MRZ._guess_type(['*'*40, '*'*40])\n        'TD3'\n        >>> MRZ._guess_type([1,2,3])\n        'TD1'\n        >>> MRZ._guess_type(['V'*40, '*'*40])\n        'MRVA'\n        >>> MRZ._guess_type(['V'*36, '*'*36])\n        'MRVB'\n        \"\"\"\n        try:\n            if len(mrz_lines) == 3:\n                return 'TD1'\n            elif len(mrz_lines) == 2 and len(mrz_lines[0]) < 40 and len(mrz_lines[1]) < 40:\n                return 'MRVB' if mrz_lines[0][0].upper() == 'V' else 'TD2'\n            elif len(mrz_lines) == 2:\n                return 'MRVA' if mrz_lines[0][0].upper() == 'V' else 'TD3'\n            else:\n                return None\n        except Exception: #pylint: disable=broad-except\n            return None", "entry_point": "_guess_type", "input": "{1, 2, 3}", "output": "'TD1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/konstantint/PassportEye/blob/b32afba0f5dc4eb600c4edc4f49e5d49959c5415/passporteye/mrz/text.py#L129-L160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035886", "code": "def linear_variogram_model(m, d):\r\n    \"\"\"Linear model, m is [slope, nugget]\"\"\"\r\n    slope = float(m[0])\r\n    nugget = float(m[1])\r\n    return slope * d + nugget", "entry_point": "linear_variogram_model", "input": "(1, 2), 3.25", "output": "5.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bsmurphy/PyKrige/blob/a4db3003b0b5688658c12faeb95a5a8b2b14b433/pykrige/variogram_models.py#L30-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035887", "code": "def _mixed_join(iterable, sentinel):\n    \"\"\"concatenate any string type in an intelligent way.\"\"\"\n    iterator = iter(iterable)\n    first_item = next(iterator, sentinel)\n    if isinstance(first_item, bytes):\n        return first_item + b''.join(iterator)\n    return first_item + u''.join(iterator)", "entry_point": "_mixed_join", "input": "['a', 'b', 'c'], [[1, 2], [3], []]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/lib/werkzeug/contrib/iterio.py#L50-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035888", "code": "def quote_etag(etag, weak=False):\n    \"\"\"Quote an etag.\n\n    :param etag: the etag to quote.\n    :param weak: set to `True` to tag it \"weak\".\n    \"\"\"\n    if '\"' in etag:\n        raise ValueError('invalid etag')\n    etag = '\"%s\"' % etag\n    if weak:\n        etag = 'w/' + etag\n    return etag", "entry_point": "quote_etag", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "'w/\"[1, 2, 3]\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/lib/werkzeug/http.py#L582-L593", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035889", "code": "def unquote_etag(etag):\n    \"\"\"Unquote a single etag:\n\n    >>> unquote_etag('w/\"bar\"')\n    ('bar', True)\n    >>> unquote_etag('\"bar\"')\n    ('bar', False)\n\n    :param etag: the etag identifier to unquote.\n    :return: a ``(etag, weak)`` tuple.\n    \"\"\"\n    if not etag:\n        return None, None\n    etag = etag.strip()\n    weak = False\n    if etag[:2] in ('w/', 'W/'):\n        weak = True\n        etag = etag[2:]\n    if etag[:1] == etag[-1:] == '\"':\n        etag = etag[1:-1]\n    return etag, weak", "entry_point": "unquote_etag", "input": "[]", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/lib/werkzeug/http.py#L596-L616", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035890", "code": "def trim_path(path, length=30):\n    \"\"\"\n    trim path to specified length, for example:\n    >>> a = '/project/apps/default/settings.ini'\n    >>> trim_path(a)\n    '.../apps/default/settings.ini'\n    \n    The real length will be length-4, it'll left '.../' for output.\n    \"\"\"\n    s = path.replace('\\\\', '/').split('/')\n    t = -1\n    for i in range(len(s)-1, -1, -1):\n        t = len(s[i]) + t + 1\n        if t > length-4:\n            break\n    return '.../' + '/'.join(s[i+1:])", "entry_point": "trim_path", "input": "'walnut thistle harbour', 1", "output": "'.../'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/utils/common.py#L781-L796", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035891", "code": "def format_size(size):\n    \"\"\"\n    Convert size to XB, XKB, XMB, XGB\n    :param size: length value\n    :return: string value with size unit\n    \"\"\"\n    units = ['B', 'KB', 'MB', 'GB']\n    unit = ''\n    n = size\n    old_n = n\n    value = size\n    for i in units:\n        old_n = n\n        x, y = divmod(n, 1024)\n        if x == 0:\n            unit = i\n            value = y\n            break\n\n        n = x\n        unit = i\n        value = old_n\n    return str(value)+unit", "entry_point": "format_size", "input": "1", "output": "'1B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/utils/common.py#L844-L866", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035892", "code": "def convert_bytes(n):\n    \"\"\"\n    Convert a size number to 'K', 'M', .etc\n    \"\"\"\n    symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')\n    prefix = {}\n    for i, s in enumerate(symbols):\n        prefix[s] = 1 << (i + 1) * 10\n    for s in reversed(symbols):\n        if n >= prefix[s]:\n            value = float(n) / prefix[s]\n            return '%.1f%s' % (value, s)\n    return \"%sB\" % n", "entry_point": "convert_bytes", "input": "0.5", "output": "'0.5B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/utils/common.py#L868-L880", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035893", "code": "def split_comments(comments):\r\n    \"\"\"Split COMMENTS into flag comments and other comments.  Flag\r\n    comments are those that begin with '#,', e.g. '#,fuzzy'.\"\"\"\r\n    flags = []\r\n    other = []\r\n    for c in comments:\r\n        if len(c) > 1 and c[1] == ',':\r\n            flags.append(c)\r\n        else:\r\n            other.append(c)\r\n    return flags, other", "entry_point": "split_comments", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/i18n/po_merge.py#L61-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035894", "code": "def _line_parse(line):\n    \"\"\"Removes line ending characters and returns a tuple (`stripped_line`,\n    `is_terminated`).\n    \"\"\"\n    if line[-2:] in ['\\r\\n', b'\\r\\n']:\n        return line[:-2], True\n    elif line[-1:] in ['\\r', '\\n', b'\\r', b'\\n']:\n        return line[:-1], True\n    return line, False", "entry_point": "_line_parse", "input": "'walnut thistle harbour'", "output": "('walnut thistle harbour', False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/limodou/uliweb/blob/34472f25e4bc0b954a35346672f94e84ef18b076/uliweb/lib/werkzeug/formparser.py#L234-L242", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035895", "code": "def jp_split(s):\n    \"\"\" split/decode a string from json-pointer\n    \"\"\"\n    if s == '' or s == None:\n        return []\n\n    def _decode(s):\n        s = s.replace('~1', '/')\n        return s.replace('~0', '~')\n\n    return [_decode(ss) for ss in s.split('/')]", "entry_point": "jp_split", "input": "'Hello World'", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyopenapi/pyswagger/blob/333c4ca08e758cd2194943d9904a3eda3fe43977/pyswagger/utils.py#L244-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035896", "code": "def _check_elementary_axis_name(name: str) -> bool:\n    \"\"\"\n    Valid elementary axes contain only lower latin letters and digits and start with a letter.\n    \"\"\"\n    if len(name) == 0:\n        return False\n    if not 'a' <= name[0] <= 'z':\n        return False\n    for letter in name:\n        if (not letter.isdigit()) and not ('a' <= letter <= 'z'):\n            return False\n    return True", "entry_point": "_check_elementary_axis_name", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arogozhnikov/einops/blob/9698f0f5efa6c5a79daa75253137ba5d79a95615/einops/einops.py#L268-L279", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035897", "code": "def _interpret_as_minutes(sval, mdict):\n    \"\"\"\n    Times like \"1:22\" are ambiguous; do they represent minutes and seconds\n    or hours and minutes?  By default, timeparse assumes the latter.  Call\n    this function after parsing out a dictionary to change that assumption.\n    \n    >>> import pprint\n    >>> pprint.pprint(_interpret_as_minutes('1:24', {'secs': '24', 'mins': '1'}))\n    {'hours': '1', 'mins': '24'}\n    \"\"\"\n    if (    sval.count(':') == 1 \n        and '.' not in sval\n        and (('hours' not in mdict) or (mdict['hours'] is None))\n        and (('days' not in mdict) or (mdict['days'] is None))\n        and (('weeks' not in mdict) or (mdict['weeks'] is None))\n        #and (('months' not in mdict) or (mdict['months'] is None))\n        #and (('years' not in mdict) or (mdict['years'] is None))\n        ):   \n        mdict['hours'] = mdict['mins']\n        mdict['mins'] = mdict['secs']\n        mdict.pop('secs')\n        pass\n    return mdict", "entry_point": "_interpret_as_minutes", "input": "[5, 3, 1, 4], {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wroberts/pytimeparse/blob/dc7e783216b98a04d3f749bd82c863d6d7c41f6e/pytimeparse/timeparse.py#L94-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035898", "code": "def _render_condition_value(value, field_type):\n    \"\"\"Render a query condition value.\n\n    Parameters\n    ----------\n    value : Union[bool, int, float, str, datetime]\n        The value of the condition\n    field_type : str\n        The data type of the field\n\n    Returns\n    -------\n    str\n        A value string.\n    \"\"\"\n\n    # BigQuery cannot cast strings to booleans, convert to ints\n    if field_type == \"BOOLEAN\":\n        value = 1 if value else 0\n    elif field_type in (\"STRING\", \"INTEGER\", \"FLOAT\"):\n        value = \"'%s'\" % (value)\n    elif field_type in (\"TIMESTAMP\"):\n        value = \"'%s'\" % (str(value))\n    return \"%s(%s)\" % (field_type, value)", "entry_point": "_render_condition_value", "input": "set(), 'abc'", "output": "'abc(set())'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tylertreat/BigQuery-Python/blob/88d99de42d954d49fc281460068f0e95003da098/bigquery/query_builder.py#L275-L298", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035899", "code": "def _shape_repr(shape):\n    \"\"\"Return a platform independent reprensentation of an array shape\n    Under Python 2, the `long` type introduces an 'L' suffix when using the\n    default %r format for tuples of integers (typically used to store the shape\n    of an array).\n    Under Windows 64 bit (and Python 2), the `long` type is used by default\n    in numpy shapes even when the integer dimensions are well below 32 bit.\n    The platform specific type causes string messages or doctests to change\n    from one platform to another which is not desirable.\n    Under Python 3, there is no more `long` type so the `L` suffix is never\n    introduced in string representation.\n    >>> _shape_repr((1, 2))\n    '(1, 2)'\n    >>> one = 2 ** 64 / 2 ** 64  # force an upcast to `long` under Python 2\n    >>> _shape_repr((one, 2 * one))\n    '(1, 2)'\n    >>> _shape_repr((1,))\n    '(1,)'\n    >>> _shape_repr(())\n    '()'\n    \"\"\"\n    if len(shape) == 0:\n        return \"()\"\n    joined = \", \".join(\"%d\" % e for e in shape)\n    if len(shape) == 1:\n        # special notation for singleton tuples\n        joined += ','\n    return \"(%s)\" % joined", "entry_point": "_shape_repr", "input": "[1, 2, 3]", "output": "'(1, 2, 3)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mmp2/megaman/blob/faccaf267aad0a8b18ec8a705735fd9dd838ca1e/megaman/utils/validation.py#L38-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035900", "code": "def split_kwargs(relaxation_kwds):\n    \"\"\"Split relaxation keywords to keywords for optimizer and others\"\"\"\n    optimizer_keys_list = [\n        'step_method',\n        'linesearch',\n        'eta_max',\n        'eta',\n        'm',\n        'linesearch_first'\n    ]\n    optimizer_kwargs = { k:relaxation_kwds.pop(k) for k in optimizer_keys_list if k in relaxation_kwds }\n    if 'm' in optimizer_kwargs:\n        optimizer_kwargs['momentum'] = optimizer_kwargs.pop('m')\n    return optimizer_kwargs, relaxation_kwds", "entry_point": "split_kwargs", "input": "[1, 2, 3]", "output": "({}, [1, 2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mmp2/megaman/blob/faccaf267aad0a8b18ec8a705735fd9dd838ca1e/megaman/relaxation/utils.py#L10-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035901", "code": "def _has_converged(centroids, old_centroids):\n    \"\"\"\n    Stop if centroids stop to update\n    Parameters\n    -----------\n    centroids: array-like, shape=(K, n_samples)     \n    old_centroids: array-like, shape=(K, n_samples)\n    ------------    \n    returns\n    True: bool\n    \n    \"\"\"\n    return (set([tuple(a) for a in centroids]) == set([tuple(a) for a in old_centroids]))", "entry_point": "_has_converged", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mmp2/megaman/blob/faccaf267aad0a8b18ec8a705735fd9dd838ca1e/megaman/utils/k_means_clustering.py#L147-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035902", "code": "def _before_after(n_samples):\n    \"\"\"Get the number of samples before and after.\"\"\"\n    if not isinstance(n_samples, (tuple, list)):\n        before = n_samples // 2\n        after = n_samples - before\n    else:\n        assert len(n_samples) == 2\n        before, after = n_samples\n        n_samples = before + after\n    assert before >= 0\n    assert after >= 0\n    assert before + after == n_samples\n    return before, after", "entry_point": "_before_after", "input": "5", "output": "(2, 3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kwikteam/phy/blob/7e9313dc364304b7d2bd03b92938347343703003/phy/traces/waveform.py#L149-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035903", "code": "def _is_bright(rgb):\n    \"\"\"Return whether a RGB color is bright or not.\"\"\"\n    r, g, b = rgb\n    gray = 0.299 * r + 0.587 * g + 0.114 * b\n    return gray >= .5", "entry_point": "_is_bright", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kwikteam/phy/blob/7e9313dc364304b7d2bd03b92938347343703003/phy/utils/_color.py#L28-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035904", "code": "def _edges_to_adjacency_list(edges):\n    \"\"\"Convert a list of edges into an adjacency list.\"\"\"\n    adj = {}\n    for i, j in edges:\n        if i in adj:  # pragma: no cover\n            ni = adj[i]\n        else:\n            ni = adj[i] = set()\n        if j in adj:\n            nj = adj[j]\n        else:\n            nj = adj[j] = set()\n        ni.add(j)\n        nj.add(i)\n    return adj", "entry_point": "_edges_to_adjacency_list", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kwikteam/phy/blob/7e9313dc364304b7d2bd03b92938347343703003/phy/electrode/mea.py#L24-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035905", "code": "def str_dict(some_dict):\n    \"\"\"Convert dict of ascii str/unicode to dict of str, if necessary\"\"\"\n    return {str(k): str(v) for k, v in some_dict.items()}", "entry_point": "str_dict", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/django-salesforce/django-salesforce/blob/6fd5643dba69d49c5881de50875cf90204a8f808/salesforce/backend/utils.py#L453-L455", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035906", "code": "def is_relative_url(url):\n    \"\"\" simple method to determine if a url is relative or absolute \"\"\"\n    if url.startswith(\"#\"):\n        return None\n    if url.find(\"://\") > 0 or url.startswith(\"//\"):\n        # either 'http(s)://...' or '//cdn...' and therefore absolute\n        return False\n    return True", "entry_point": "is_relative_url", "input": "'  padded  '", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/barrust/mediawiki/blob/292e0be6c752409062dceed325d74839caf16a9b/mediawiki/utilities.py#L86-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035907", "code": "def string_to_int(string, alphabet):\n    \"\"\"\n    Convert a string to a number, using the given alphabet.\n    The input is assumed to have the most significant digit first.\n    \"\"\"\n    number = 0\n    alpha_len = len(alphabet)\n    for char in string:\n        number = number * alpha_len + alphabet.index(char)\n    return number", "entry_point": "string_to_int", "input": "('a', 'b', 'c'), ('a', 'b', 'c')", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/skorokithakis/shortuuid/blob/4da632a986c3a43f75c7df64f27a90bbf7ff8039/shortuuid/main.py#L25-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035908", "code": "def nu_mu_converter(rho, mu=None, nu=None):\n    r'''Calculates either kinematic or dynamic viscosity, depending on inputs.\n    Used when one type of viscosity is known as well as density, to obtain\n    the other type. Raises an error if both types of viscosity or neither type\n    of viscosity is provided.\n\n    .. math::\n        \\nu = \\frac{\\mu}{\\rho}\n\n    .. math::\n        \\mu = \\nu\\rho\n\n    Parameters\n    ----------\n    rho : float\n        Density, [kg/m^3]\n    mu : float, optional\n        Dynamic viscosity, [Pa*s]\n    nu : float, optional\n        Kinematic viscosity, [m^2/s]\n\n    Returns\n    -------\n    mu or nu : float\n        Dynamic viscosity, Pa*s or Kinematic viscosity, m^2/s\n\n    Examples\n    --------\n    >>> nu_mu_converter(998., nu=1.0E-6)\n    0.000998\n\n    References\n    ----------\n    .. [1] Cengel, Yunus, and John Cimbala. Fluid Mechanics: Fundamentals and\n       Applications. Boston: McGraw Hill Higher Education, 2006.\n    '''\n    if (nu and mu) or not rho or (not nu and not mu):\n        raise Exception('Inputs must be rho and one of mu and nu.')\n    if mu:\n        return mu/rho\n    elif nu:\n        return nu*rho", "entry_point": "nu_mu_converter", "input": "-1.5, set(), 0.5", "output": "-0.75", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/core.py#L2158-L2199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035909", "code": "def Engauge_2d_parser(lines, flat=False):\n    '''Not exposed function to read a 2D file generated by engauge-digitizer;\n    for curve fitting.\n    '''\n    z_values = []\n    x_lists = []\n    y_lists = []\n    working_xs = []\n    working_ys = []\n    \n    new_curve = True\n    for line in lines:\n        if line.strip() == '':\n            new_curve = True\n        elif new_curve:\n            z = float(line.split(',')[1])\n            z_values.append(z)\n            if working_xs and working_ys:\n                x_lists.append(working_xs)\n                y_lists.append(working_ys)\n            working_xs = []\n            working_ys = []\n            new_curve = False\n        else:\n            x, y = [float(i) for i in line.strip().split(',')]\n            working_xs.append(x)\n            working_ys.append(y)\n    x_lists.append(working_xs)\n    y_lists.append(working_ys)\n    \n    if flat:\n        all_zs = []\n        all_xs = []\n        all_ys = []\n        for z, xs, ys in zip(z_values, x_lists, y_lists):\n            for x, y in zip(xs, ys):\n                all_zs.append(z)\n                all_xs.append(x)\n                all_ys.append(y)\n        return all_zs, all_xs, all_ys\n\n    return z_values, x_lists, y_lists", "entry_point": "Engauge_2d_parser", "input": "'', []", "output": "([], [[]], [[]])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/core.py#L2869-L2910", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035910", "code": "def Wood_1966(Re, eD):\n    r'''Calculates Darcy friction factor using the method in Wood (1966) [2]_\n    as shown in [1]_.\n\n    .. math::\n        f_d = 0.094(\\frac{\\epsilon}{D})^{0.225} + 0.53(\\frac{\\epsilon}{D})\n        + 88(\\frac{\\epsilon}{D})^{0.4}Re^{-A_1}\n\n    .. math::\n        A_1 = 1.62(\\frac{\\epsilon}{D})^{0.134}\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number, [-]\n    eD : float\n        Relative roughness, [-]\n\n    Returns\n    -------\n    fd : float\n        Darcy friction factor [-]\n\n    Notes\n    -----\n    Range is 4E3 <= Re <= 5E7;  1E-5 <= eD <= 4E-2.\n\n    Examples\n    --------\n    >>> Wood_1966(1E5, 1E-4)\n    0.021587570560090762\n\n    References\n    ----------\n    .. [1] Winning, H. and T. Coole. \"Explicit Friction Factor Accuracy and\n       Computational Efficiency for Turbulent Flow in Pipes.\" Flow, Turbulence\n       and Combustion 90, no. 1 (January 1, 2013): 1-27.\n       doi:10.1007/s10494-012-9419-7\n    .. [2] \tWood, D.J.: An Explicit Friction Factor Relationship, vol. 60.\n       Civil Engineering American Society of Civil Engineers (1966)\n    '''\n    A1 = 1.62*eD**0.134\n    return 0.094*eD**0.225 + 0.53*eD +88*eD**0.4*Re**-A1", "entry_point": "Wood_1966", "input": "2, 0.5", "output": "24.31485339755512", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/friction.py#L483-L525", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035911", "code": "def helical_turbulent_fd_Mori_Nakayama(Re, Di, Dc):\n    r'''Calculates Darcy friction factor for a fluid flowing inside a curved \n    pipe such as a helical coil under turbulent conditions, using the method of \n    Mori and Nakayama [1]_, also shown in [2]_ and [3]_.\n        \n    .. math::\n        f_{curv} = 0.3\\left(\\frac{D_i}{D_c}\\right)^{0.5}\n        \\left[Re\\left(\\frac{D_i}{D_c}\\right)^2\\right]^{-0.2}\\left[1 \n        + 0.112\\left[Re\\left(\\frac{D_i}{D_c}\\right)^2\\right]^{-0.2}\\right]\n\n    Parameters\n    ----------\n    Re : float\n        Reynolds number with `D=Di`, [-]\n    Di : float\n        Inner diameter of the coil, [m]\n    Dc : float\n        Diameter of the helix/coil measured from the center of the tube on one\n        side to the center of the tube on the other side, [m]\n\n    Returns\n    -------\n    fd : float\n        Darcy friction factor for a curved pipe [-]\n\n    Notes\n    -----    \n    Valid from the transition to turbulent flow up to \n    :math:`Re=6.5\\times 10^{5}\\sqrt{D_i/D_c}`. Does not use a straight pipe \n    correlation, and so will not converge on the\n    straight pipe result at very low curvature.\n\n    Examples\n    --------\n    >>> helical_turbulent_fd_Mori_Nakayama(1E4, 0.01, .2)\n    0.037311802071379796\n\n    References\n    ----------\n    .. [1] Mori, Yasuo, and Wataru Nakayama. \"Study of Forced Convective Heat \n       Transfer in Curved Pipes (2nd Report, Turbulent Region).\" International \n       Journal of Heat and Mass Transfer 10, no. 1 (January 1, 1967): 37-59.\n       doi:10.1016/0017-9310(67)90182-2. \n    .. [2] El-Genk, Mohamed S., and Timothy M. Schriener. \"A Review and \n       Correlations for Convection Heat Transfer and Pressure Losses in \n       Toroidal and Helically Coiled Tubes.\" Heat Transfer Engineering 0, no. 0\n       (June 7, 2016): 1-28. doi:10.1080/01457632.2016.1194693.\n    .. [3] Ali, Shaukat. \"Pressure Drop Correlations for Flow through Regular\n       Helical Coil Tubes.\" Fluid Dynamics Research 28, no. 4 (April 2001): \n       295-310. doi:10.1016/S0169-5983(00)00034-4.\n    '''\n    term = (Re*(Di/Dc)**2)**-0.2\n    return 0.3*(Dc/Di)**-0.5*term*(1. + 0.112*term)", "entry_point": "helical_turbulent_fd_Mori_Nakayama", "input": "3.25, 10, 3.25", "output": "0.2801570100506739", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/friction.py#L2317-L2369", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035912", "code": "def pdf_Gates_Gaudin_Schuhman(d, d_characteristic, m):\n    r'''Calculates the probability density of a particle\n    distribution following the Gates, Gaudin and Schuhman (GGS) model given a \n    particle diameter `d`, characteristic (maximum) particle\n    diameter `d_characteristic`, and exponent `m`.\n    \n    .. math::\n        q(d) = \\frac{n}{d}\\left(\\frac{d}{d_{characteristic}}\\right)^m \n        \\text{ if } d < d_{characteristic} \\text{ else } 0\n        \n    Parameters\n    ----------\n    d : float\n        Specified particle diameter, [m]\n    d_characteristic : float\n        Characteristic particle diameter; in this model, it is the largest \n        particle size diameter in the distribution, [m]\n    m : float\n        Particle size distribution exponent, [-]    \n\n    Returns\n    -------\n    pdf : float\n        GGS probability density function, [-]\n\n    Notes\n    -----\n    The characteristic diameter can be in terns of number density (denoted \n    :math:`q_0(d)`), length density (:math:`q_1(d)`), surface area density\n    (:math:`q_2(d)`), or volume density (:math:`q_3(d)`). Volume density is\n    most often used. Interconversions among the distributions is possible but\n    tricky.\n\n    Examples\n    --------\n    >>> pdf_Gates_Gaudin_Schuhman(d=2E-4, d_characteristic=1E-3, m=2.3)\n    283.8355768512045\n\n    References\n    ----------\n    .. [1] Schuhmann, R., 1940. Principles of Comminution, I-Size Distribution \n       and Surface Calculations. American Institute of Mining, Metallurgical \n       and Petroleum Engineers Technical Publication 1189. Mining Technology, \n       volume 4, p. 1-11.\n    .. [2] Bayat, Hossein, Mostafa Rastgo, Moharram Mansouri Zadeh, and Harry \n       Vereecken. \"Particle Size Distribution Models, Their Characteristics and\n       Fitting Capability.\" Journal of Hydrology 529 (October 1, 2015): 872-89.\n    '''\n    if d <= d_characteristic:\n        return m/d*(d/d_characteristic)**m\n    else:\n        return 0.0", "entry_point": "pdf_Gates_Gaudin_Schuhman", "input": "[5, 3, 1, 4], [-1, 0, 1, 2], ['apple', 'banana', 'cherry']", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/particle_size_distribution.py#L743-L794", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035913", "code": "def horner(coeffs, x):\n    r'''Evaluates a polynomial defined by coefficienfs `coeffs` at a specified\n    scalar `x` value, using the horner method. This is the most efficient \n    formula to evaluate a polynomial (assuming non-zero coefficients for all\n    terms). This has been added to the `fluids` library because of the need to\n    frequently evaluate polynomials; and `NumPy`'s polyval is actually quite \n    slow for scalar values.\n    \n    Note that the coefficients are reversed compared to the common form; the\n    first value is the coefficient of the highest-powered x term, and the last\n    value in `coeffs` is the constant offset value.\n\n    Parameters\n    ----------\n    coeffs : iterable[float]\n        Coefficients of polynomial, [-]\n    x : float\n        Point at which to evaluate the polynomial, [-]\n\n    Returns\n    -------\n    val : float\n        The evaluated value of the polynomial, [-]\n\n    Notes\n    -----\n    For maximum speed, provide a list of Python floats and `x` should also be\n    of type `float` to avoid either `NumPy` types or slow python ints. \n\n    Compare the speed with numpy via:\n        \n    >>> coeffs = np.random.uniform(0, 1, size=15)\n    >>> coeffs_list = coeffs.tolist()\n    \n    %timeit np.polyval(coeffs, 10.0)\n    \n    `np.polyval` takes on the order of 15 us; `horner`, 1 us.\n    \n    Examples\n    --------\n    >>> horner([1.0, 3.0], 2.0)\n    5.0\n\n    >>> horner([21.24288737657324, -31.326919865992743, 23.490607246508382, -14.318875366457021, 6.993092901276407, -2.6446094897570775, 0.7629439408284319, -0.16825320656035953, 0.02866101768198035, -0.0038190069303978003, 0.0004027586707189051, -3.394447111198843e-05, 2.302586717011523e-06, -1.2627393196517083e-07, 5.607585274731649e-09, -2.013760843818914e-10, 5.819957519561292e-12, -1.3414794055766234e-13, 2.430101267966631e-15, -3.381444175898971e-17, 3.4861255675373234e-19, -2.5070616549039004e-21, 1.122234904781319e-23, -2.3532795334141448e-26], 300.0)\n    1.9900667478569642e+58\n    \n    References\n    ----------\n    .. [1] \"Horner\u2019s Method.\" Wikipedia, October 6, 2018. \n    https://en.wikipedia.org/w/index.php?title=Horner%27s_method&oldid=862709437.\n    '''\n    tot = 0.0\n    for c in coeffs:\n        tot = tot*x + c\n    return tot", "entry_point": "horner", "input": "[], ['apple', 'banana', 'cherry']", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/numerics/__init__.py#L564-L618", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035914", "code": "def loss_coefficient_piping(d, D1=None, D2=None):\n    r'''Calculates the sum of loss coefficients from possible\n    inlet/outlet reducers/expanders around a control valve according to\n    IEC 60534 calculations.\n\n    .. math::\n        \\Sigma \\xi = \\xi_1 + \\xi_2 + \\xi_{B1} - \\xi_{B2}\n\n    .. math::\n        \\xi_1 = 0.5\\left[1 -\\left(\\frac{d}{D_1}\\right)^2\\right]^2\n\n    .. math::\n        \\xi_2 = 1.0\\left[1 -\\left(\\frac{d}{D_2}\\right)^2\\right]^2\n\n    .. math::\n        \\xi_{B1} = 1 - \\left(\\frac{d}{D_1}\\right)^4\n\n    .. math::\n        \\xi_{B2} = 1 - \\left(\\frac{d}{D_2}\\right)^4\n\n    Parameters\n    ----------\n    d : float\n        Diameter of the valve [m]\n    D1 : float\n        Diameter of the pipe before the valve [m]\n    D2 : float\n        Diameter of the pipe after the valve [m]\n\n    Returns\n    -------\n    loss : float\n        Sum of the four loss coefficients [-]\n\n    Examples\n    --------\n    In example 3, non-choked compressible flow with fittings:\n\n    >>> loss_coefficient_piping(0.05, 0.08, 0.1)\n    0.6580810546875\n\n    References\n    ----------\n    .. [1] IEC 60534-2-1 / ISA-75.01.01-2007\n    '''\n    loss = 0.\n    if D1:\n        loss += 1. - (d/D1)**4 # Inlet flow energy\n        loss += 0.5*(1. - (d/D1)**2)**2 # Inlet reducer\n    if D2:\n        loss += 1.0*(1. - (d/D2)**2)**2 # Outlet reducer (expander)\n        loss -= 1. - (d/D2)**4 # Outlet flow energy\n    return loss", "entry_point": "loss_coefficient_piping", "input": "-1.5, {}, 3", "output": "-0.375", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/control_valve.py#L406-L458", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035915", "code": "def Morsi_Alexander(Re):\n    r'''Calculates drag coefficient of a smooth sphere using the method in\n    [1]_ as described in [2]_.\n\n    .. math::\n        C_D = \\left\\{ \\begin{array}{ll}\n        \\frac{24}{Re} & \\mbox{if $Re < 0.1$}\\\\\n        \\frac{22.73}{Re}+\\frac{0.0903}{Re^2} + 3.69 & \\mbox{if $0.1 < Re < 1$}\\\\\n        \\frac{29.1667}{Re}-\\frac{3.8889}{Re^2} + 1.2220 & \\mbox{if $1 < Re < 10$}\\\\\n        \\frac{46.5}{Re}-\\frac{116.67}{Re^2} + 0.6167 & \\mbox{if $10 < Re < 100$}\\\\\n        \\frac{98.33}{Re}-\\frac{2778}{Re^2} + 0.3644 & \\mbox{if $100 < Re < 1000$}\\\\\n        \\frac{148.62}{Re}-\\frac{4.75\\times10^4}{Re^2} + 0.3570 & \\mbox{if $1000 < Re < 5000$}\\\\\n        \\frac{-490.5460}{Re}+\\frac{57.87\\times10^4}{Re^2} + 0.46 & \\mbox{if $5000 < Re < 10000$}\\\\\n        \\frac{-1662.5}{Re}+\\frac{5.4167\\times10^6}{Re^2} + 0.5191 & \\mbox{if $10000 < Re < 50000$}\\end{array} \\right.\n\n    Parameters\n    ----------\n    Re : float\n        Particle Reynolds number of the sphere using the surrounding fluid\n        density and viscosity, [-]\n\n    Returns\n    -------\n    Cd : float\n        Drag coefficient [-]\n\n    Notes\n    -----\n    Range is Re <= 2E5.\n    Original was reviewed, and confirmed to contain the cited equations.\n\n    Examples\n    --------\n    >>> Morsi_Alexander(200)\n    0.7866\n\n    References\n    ----------\n    .. [1] Morsi, S. A., and A. J. Alexander. \"An Investigation of Particle\n       Trajectories in Two-Phase Flow Systems.\" Journal of Fluid Mechanics\n       55, no. 02 (September 1972): 193-208. doi:10.1017/S0022112072001806.\n    .. [2] Barati, Reza, Seyed Ali Akbar Salehi Neyshabouri, and Goodarz\n       Ahmadi. \"Development of Empirical Models with High Accuracy for\n       Estimation of Drag Coefficient of Flow around a Smooth Sphere: An\n       Evolutionary Approach.\" Powder Technology 257 (May 2014): 11-19.\n       doi:10.1016/j.powtec.2014.02.045.\n    '''\n    if Re < 0.1:\n        return 24./Re\n    elif Re < 1:\n        return 22.73/Re + 0.0903/Re**2 + 3.69\n    elif Re < 10:\n        return 29.1667/Re - 3.8889/Re**2 + 1.222\n    elif Re < 100:\n        return 46.5/Re - 116.67/Re**2 + 0.6167\n    elif Re < 1000:\n        return 98.33/Re - 2778./Re**2 + 0.3644\n    elif Re < 5000:\n        return 148.62/Re - 4.75E4/Re**2 + 0.357\n    elif Re < 10000:\n        return -490.546/Re + 57.87E4/Re**2 + 0.46\n    else:\n        return -1662.5/Re + 5.4167E6/Re**2 + 0.5191", "entry_point": "Morsi_Alexander", "input": "3.25", "output": "9.828189349112426", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/drag.py#L296-L358", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035916", "code": "def Morrison(Re):\n    r'''Calculates drag coefficient of a smooth sphere using the method in\n    [1]_ as described in [2]_.\n\n    .. math::\n        C_D = \\frac{24}{Re} + \\frac{2.6Re/5}{1 + \\left(\\frac{Re}{5}\\right)^{1.52}}\n        + \\frac{0.411 \\left(\\frac{Re}{263000}\\right)^{-7.94}}{1\n        + \\left(\\frac{Re}{263000}\\right)^{-8}} + \\frac{Re^{0.8}}{461000}\n\n    Parameters\n    ----------\n    Re : float\n        Particle Reynolds number of the sphere using the surrounding fluid\n        density and viscosity, [-]\n\n    Returns\n    -------\n    Cd : float\n        Drag coefficient [-]\n\n    Notes\n    -----\n    Range is Re <= 1E6.\n\n    Examples\n    --------\n    >>> Morrison(200.)\n    0.767731559965325\n\n    References\n    ----------\n    .. [1] Morrison, Faith A. An Introduction to Fluid Mechanics.\n       Cambridge University Press, 2013.\n    .. [2] Barati, Reza, Seyed Ali Akbar Salehi Neyshabouri, and Goodarz\n       Ahmadi. \"Development of Empirical Models with High Accuracy for\n       Estimation of Drag Coefficient of Flow around a Smooth Sphere: An\n       Evolutionary Approach.\" Powder Technology 257 (May 2014): 11-19.\n       doi:10.1016/j.powtec.2014.02.045.\n    '''\n    Cd = (24./Re + 2.6*Re/5./(1 + (Re/5.)**1.52) + 0.411*(Re/263000.)**-7.94/(1 + (Re/263000.)**-8)\n    + Re**0.8/461000.)\n    return Cd", "entry_point": "Morrison", "input": "3.25", "output": "8.705412224713413", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/drag.py#L914-L955", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035917", "code": "def cooling_degree_days(T, T_base=283.15, truncate=True):\n    r'''Calculates the cooling degree days for a period of time.\n\n    .. math::\n        \\text{cooling degree days} = max(T_{base} - T, 0)\n\n    Parameters\n    ----------\n    T : float\n        Measured temperature; sometimes an average over a length of time is used,\n        other times the average of the lowest and highest temperature in a \n        period are used, [K]\n    T_base : float, optional\n        Reference temperature for the degree day calculation, defaults\n        to 10 \u00b0C, 283.15 K, a common value, [K]\n    truncate : bool\n        If truncate is True, no negative values will be returned; if negative, \n        the value is truncated to 0, [-]\n\n    Returns\n    -------\n    cooling_degree_days : float\n        Degree below the base temperature multiplied by the length of time of\n        the measurement, normally days [day*K]\n\n    Notes\n    -----\n    The base temperature should always be presented with the results.\n    \n    The time unit does not have to be days; it can be time unit, and the\n    calculation behaves the same.\n\n    Examples\n    --------\n    >>> cooling_degree_days(250)\n    33.14999999999998\n    \n    >>> cooling_degree_days(300)\n    0.0\n    \n    >>> cooling_degree_days(250, T_base=300)\n    50\n\n    References\n    ----------\n    .. [1] \"Heating Degree Day.\" Wikipedia, January 24, 2018. \n       https://en.wikipedia.org/w/index.php?title=Heating_degree_day&oldid=822187764.\n    '''\n    dd = T_base - T\n    if truncate and dd < 0.0:\n        dd = 0.0\n    return dd", "entry_point": "cooling_degree_days", "input": "set(), {1, 2, 3}, 0", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/fluids/blob/57f556752e039f1d3e5a822f408c184783db2828/fluids/design_climate.py#L249-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035918", "code": "def splitkeyurl(url):\n    '''\n       Splits a Send url into key, urlid and 'prefix' for the Send server\n       Should handle any hostname, but will brake on key & id length changes\n    '''\n    key = url[-22:]\n    urlid = url[-34:-24]\n    service = url[:-43]\n    return service, urlid, key", "entry_point": "splitkeyurl", "input": "[5, 3, 1, 4]", "output": "([], [], [5, 3, 1, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ehuggett/send-cli/blob/7f9458299f42e3c558f00e77cf9d3aa9dd857457/sendclient/common.py#L9-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035919", "code": "def format_seconds(seconds, hide_seconds=False):\n    \"\"\"\n    Returns a human-readable string representation of the given amount\n    of seconds.\n    \"\"\"\n    if seconds <= 60:\n        return str(seconds)\n    output = \"\"\n    for period, period_seconds in (\n        ('y', 31557600),\n        ('d', 86400),\n        ('h', 3600),\n        ('m', 60),\n        ('s', 1),\n    ):\n        if seconds >= period_seconds and not (hide_seconds and period == 's'):\n            output += str(int(seconds / period_seconds))\n            output += period\n            output += \" \"\n            seconds = seconds % period_seconds\n    return output.strip()", "entry_point": "format_seconds", "input": "True, [1, 2, 3]", "output": "'True'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/trehn/termdown/blob/aa0c4e39d9864fd1466ef9d76947fb93d0cf5be2/termdown.py#L98-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035920", "code": "def _ipv6_host(host):\n    \"\"\"\n    Process IPv6 address literals\n    \"\"\"\n\n    # httplib doesn't like it when we include brackets in IPv6 addresses\n    # Specifically, if we include brackets but also pass the port then\n    # httplib crazily doubles up the square brackets on the Host header.\n    # Instead, we need to make sure we never pass ``None`` as the port.\n    # However, for backward compatibility reasons we can't actually\n    # *assert* that.  See http://bugs.python.org/issue28539\n    #\n    # Also if an IPv6 address literal has a zone identifier, the\n    # percent sign might be URIencoded, convert it back into ASCII\n    if host.startswith('[') and host.endswith(']'):\n        host = host.replace('%25', '%').strip('[]')\n    return host", "entry_point": "_ipv6_host", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wakatime/wakatime/blob/74519ace04e8472f3a3993269963732b9946a01d/wakatime/packages/urllib3/connectionpool.py#L889-L905", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035921", "code": "def duplicates_removed(it, already_seen=()):\n    \"\"\"\n    Returns a list with duplicates removed from the iterable `it`.\n\n    Order is preserved.\n    \"\"\"\n    lst = []\n    seen = set()\n    for i in it:\n        if i in seen or i in already_seen:\n            continue\n        lst.append(i)\n        seen.add(i)\n    return lst", "entry_point": "duplicates_removed", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wakatime/wakatime/blob/74519ace04e8472f3a3993269963732b9946a01d/wakatime/packages/pygments/util.py#L276-L289", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035922", "code": "def _prune_fields(field_dict, only):\n        \"\"\"Filter fields data **in place** with `only` list.\n\n        Example::\n\n            self._prune_fields(field_dict, ['slug', 'text'])\n            self._prune_fields(field_dict, [MyModel.slug])\n        \"\"\"\n        fields = [(isinstance(f, str) and f or f.name) for f in only]\n        for f in list(field_dict.keys()):\n            if f not in fields:\n                field_dict.pop(f)\n        return field_dict", "entry_point": "_prune_fields", "input": "{}, ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/05bit/peewee-async/blob/d15f4629da1d9975da4ec37306188e68d288c862/peewee_async.py#L388-L400", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035923", "code": "def split_args(args):\n    \"\"\"\n    Split a list of argument strings into a dictionary where each key is an\n    argument name.\n\n    An argument looks like ``crop``, ``crop=\"some option\"`` or ``crop=my_var``.\n    Arguments which provide no value get a value of ``True``.\n    \"\"\"\n    args_dict = {}\n    for arg in args:\n        split_arg = arg.split('=', 1)\n        if len(split_arg) > 1:\n            value = split_arg[1]\n        else:\n            value = True\n        args_dict[split_arg[0]] = value\n    return args_dict", "entry_point": "split_args", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': True, 'banana': True, 'cherry': True}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SmileyChris/easy-thumbnails/blob/b08ab44883bf7b221a98dadb9b589cb95d35b0bf/easy_thumbnails/templatetags/thumbnail.py#L24-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035924", "code": "def _my_hash(arg_list):\n    # type: (List[Any]) -> int\n    \"\"\"Simple helper hash function\"\"\"\n    res = 0\n    for arg in arg_list:\n        res = res * 31 + hash(arg)\n    return res", "entry_point": "_my_hash", "input": "[1, 2, 3]", "output": "1026", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dropbox/pyannotate/blob/d128c76b8a86f208e5c78716f2a917003650cebc/pyannotate_runtime/collect_types.py#L69-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035925", "code": "def _make_sampling_sequence(n):\n    # type: (int) -> List[int]\n    \"\"\"\n    Return a list containing the proposed call event sampling sequence.\n\n    Return events are paired with call events and not counted separately.\n\n    This is 0, 1, 2, ..., 4 plus 50, 100, 150, 200, etc.\n\n    The total list size is n.\n    \"\"\"\n    seq = list(range(5))\n    i = 50\n    while len(seq) < n:\n        seq.append(i)\n        i += 50\n    return seq", "entry_point": "_make_sampling_sequence", "input": "10", "output": "[0, 1, 2, 3, 4, 50, 100, 150, 200, 250]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dropbox/pyannotate/blob/d128c76b8a86f208e5c78716f2a917003650cebc/pyannotate_runtime/collect_types.py#L711-L727", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035926", "code": "def get_substituted_contents(contents, substitutions):\n    \"\"\"\n    Perform a list of substitutions and return the result.\n\n    contents: the starting string on which to beging substitutions\n    substitutions: list of Substitution objects to call, in order, with the\n        result of the previous substitution.\n    \"\"\"\n    result = contents\n    for sub in substitutions:\n        result = sub.apply_and_get_result(result)\n    return result", "entry_point": "get_substituted_contents", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/srsudar/eg/blob/96142a74f4416b4a7000c85032c070df713b849e/eg/util.py#L312-L323", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035927", "code": "def extract_keyhandle(path, filepath):\n    \"\"\"extract keyhandle value from the path\"\"\"\n\n    keyhandle = filepath.lstrip(path)\n    keyhandle = keyhandle.split(\"/\")\n    return keyhandle[0]", "entry_point": "extract_keyhandle", "input": "'  padded  ', '  padded  '", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yubico/python-pyhsm/blob/b6e2744d1ea15c352a0fc1d6ebc5950026b71311/pyhsm/ksm/db_import.py#L19-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035928", "code": "def _xor_block(a, b):\n    \"\"\" XOR two blocks of equal length. \"\"\"\n    return ''.join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b)])", "entry_point": "_xor_block", "input": "[], ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yubico/python-pyhsm/blob/b6e2744d1ea15c352a0fc1d6ebc5950026b71311/pyhsm/soft_hsm.py#L26-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035929", "code": "def crc16(data):\n    \"\"\"\n    Calculate an ISO13239 CRC checksum of the input buffer.\n    \"\"\"\n    m_crc = 0xffff\n    for this in data:\n        m_crc ^= ord(this)\n        for _ in range(8):\n            j = m_crc & 1\n            m_crc >>= 1\n            if j:\n                m_crc ^= 0x8408\n    return m_crc", "entry_point": "crc16", "input": "[]", "output": "65535", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yubico/python-pyhsm/blob/b6e2744d1ea15c352a0fc1d6ebc5950026b71311/pyhsm/soft_hsm.py#L132-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035930", "code": "def bysize(words):\n    \"\"\"\n    take a list of words and return a dict of sets sorted by word length\n    e.g.\n    ret[3]=set(['ant', 'cat', 'dog', 'pig'])\n    ret[4]=set(['frog', 'goat'])\n    ret[5]=set(['horse'])\n    ret[8]=set(['elephant'])\n    \"\"\"\n    ret = {}\n    for w in words:\n        if len(w) not in ret:\n            ret[len(w)] = set()\n        ret[len(w)].add(w)\n    return ret", "entry_point": "bysize", "input": "['apple', 'banana', 'cherry']", "output": "{5: {'apple'}, 6: {'banana', 'cherry'}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jazzband/inflect/blob/c2a3df74725990c195a5d7f37199de56873962e9/inflect.py#L119-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035931", "code": "def make_important(bulk):\n    \"\"\"makes every property in a string !important.\n    \"\"\"\n    return \";\".join(\n        \"%s !important\" % p if not p.endswith(\"!important\") else p\n        for p in bulk.split(\";\")\n    )", "entry_point": "make_important", "input": "'a,b,c'", "output": "'a,b,c !important'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterbe/premailer/blob/4d74656fb12e8e44683fa787ae71c0735282376b/premailer/premailer.py#L53-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035932", "code": "def get_join_cols(by_entry):\n  \"\"\" helper function used for joins\n  builds left and right join list for join function\n  \"\"\"\n  left_cols = []\n  right_cols = []\n  for col in by_entry:\n    if isinstance(col, str):\n      left_cols.append(col)\n      right_cols.append(col)\n    else:\n      left_cols.append(col[0])\n      right_cols.append(col[1])\n  return left_cols, right_cols", "entry_point": "get_join_cols", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dodger487/dplython/blob/09c2a5f4ca67221b2a59928366ca8274357f7234/dplython/dplython.py#L504-L517", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035933", "code": "def parse_options(source):\n    \"\"\"parses chart tag options\"\"\"\n    options = {}\n    tokens = [t.strip() for t in source.split('=')]\n\n    name = tokens[0]\n    for token in tokens[1:-1]:\n        value, next_name = token.rsplit(' ', 1)\n        options[name.strip()] = value\n        name = next_name\n    options[name.strip()] = tokens[-1].strip()\n    return options", "entry_point": "parse_options", "input": "'AbC dEf'", "output": "{'AbC dEf': 'AbC dEf'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mher/chartkick.py/blob/3411f36a069560fe1ba218e0a35f68c413332f63/chartkick/templatetags/chartkick.py#L91-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035934", "code": "def has_kerning_info(ttFont):\n  \"\"\"A font has kerning info if it has a GPOS table containing at least one\n  Pair Adjustment lookup (eigther directly or through an extension\n  subtable).\"\"\"\n  if \"GPOS\" not in ttFont:\n    return False\n\n  if not ttFont[\"GPOS\"].table.LookupList:\n    return False\n\n  for lookup in ttFont[\"GPOS\"].table.LookupList.Lookup:\n    if lookup.LookupType == 2:  # type 2 = Pair Adjustment\n      return True\n    elif lookup.LookupType == 9:  # type 9 = Extension subtable\n      for ext in lookup.SubTable:\n        if ext.ExtensionLookupType == 2:  # type 2 = Pair Adjustment\n          return True", "entry_point": "has_kerning_info", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/gpos.py#L9-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035935", "code": "def _handle_author(author):\n    \"\"\"\n    Yields aulast and auinit from an author's full name.\n\n    Parameters\n    ----------\n    author : str or unicode\n        Author fullname, e.g. \"Richard L. Nixon\".\n\n    Returns\n    -------\n    aulast : str\n        Author surname.\n    auinit : str\n        Author first-initial.\n    \"\"\"\n\n    lname = author.split(' ')\n\n    try:\n        auinit = lname[0][0]\n        final = lname[-1].upper()\n        if final in ['JR.', 'III']:\n            aulast = lname[-2].upper() + \" \" + final.strip(\".\")\n        else:\n            aulast = final\n    except IndexError:\n        raise ValueError(\"malformed author name\")\n\n    return aulast, auinit", "entry_point": "_handle_author", "input": "'abc'", "output": "('ABC', 'a')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/diging/tethne/blob/ba10eeb264b7a3f2dbcce71cfd5cb2d6bbf7055f/tethne/readers/dfr.py#L507-L536", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035936", "code": "def overlap(listA, listB):\n    \"\"\"\n    Return list of objects shared by listA, listB.\n    \"\"\"\n    if (listA is None) or (listB is None):\n        return []\n    else:\n        return list(set(listA) & set(listB))", "entry_point": "overlap", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/diging/tethne/blob/ba10eeb264b7a3f2dbcce71cfd5cb2d6bbf7055f/tethne/utilities.py#L174-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035937", "code": "def subdict(super_dict, keys):\n    \"\"\"\n    Returns a subset of the super_dict with the specified keys.\n    \"\"\"\n    sub_dict = {}\n    valid_keys = super_dict.keys()\n    for key in keys:\n        if key in valid_keys:\n            sub_dict[key] = super_dict[key]\n\n    return sub_dict", "entry_point": "subdict", "input": "{}, [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/diging/tethne/blob/ba10eeb264b7a3f2dbcce71cfd5cb2d6bbf7055f/tethne/utilities.py#L184-L194", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035938", "code": "def strip_non_ascii(s):\n    \"\"\"\n    Returns the string without non-ASCII characters.\n\n    Parameters\n    ----------\n    string : string\n        A string that may contain non-ASCII characters.\n\n    Returns\n    -------\n    clean_string : string\n        A string that does not contain non-ASCII characters.\n\n    \"\"\"\n    stripped = (c for c in s if 0 < ord(c) < 127)\n    clean_string = u''.join(stripped)\n    return clean_string", "entry_point": "strip_non_ascii", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/diging/tethne/blob/ba10eeb264b7a3f2dbcce71cfd5cb2d6bbf7055f/tethne/utilities.py#L231-L248", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035939", "code": "def check_required_args(required_args, args):\n    \"\"\"\n    Checks if all required_args have a value.\n    :param required_args: list of required args\n    :param args: kwargs\n    :return: True (if an exception isn't raised)\n    \"\"\"\n    for arg in required_args:\n        if arg not in args:\n            raise KeyError('Required argument: %s' % arg)\n    return True", "entry_point": "check_required_args", "input": "[], [[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dmsimard/python-cachetclient/blob/31bbc6d17ba5de088846e1ffae259b6755e672a0/cachetclient/cachet.py#L37-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035940", "code": "def k8s_ports_to_metadata_ports(k8s_ports):\n    \"\"\"\n    :param k8s_ports: list of V1ServicePort\n    :return: list of str, list of exposed ports, example:\n            - ['1234/tcp', '8080/udp']\n    \"\"\"\n\n    ports = []\n\n    for k8s_port in k8s_ports:\n        if k8s_port.protocol is not None:\n            ports.append(\"%s/%s\" % (k8s_port.port, k8s_port.protocol.lower()))\n        else:\n            ports.append(str(k8s_port.port))\n\n    return ports", "entry_point": "k8s_ports_to_metadata_ports", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/user-cont/conu/blob/08caae7bb6bdd265b55bb106c3da6a7946a5a352/conu/backend/k8s/utils.py#L23-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035941", "code": "def parse_reference(reference):\n    \"\"\"\n    parse provided image reference into <image_repository>:<tag>\n\n    :param reference: str, e.g. (registry.fedoraproject.org/fedora:27)\n    :return: collection (tuple or list), (\"registry.fedoraproject.org/fedora\", \"27\")\n    \"\"\"\n    if \":\" in reference:\n        im, tag = reference.rsplit(\":\", 1)\n        if \"/\" in tag:\n            # this is case when there is port in the registry URI\n            return (reference, \"latest\")\n        else:\n            return (im, tag)\n\n    else:\n        return (reference, \"latest\")", "entry_point": "parse_reference", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], 'latest')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/user-cont/conu/blob/08caae7bb6bdd265b55bb106c3da6a7946a5a352/conu/backend/podman/backend.py#L36-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035942", "code": "def dequote(s):\n        \"\"\"Remove excess quotes from a string.\"\"\"\n        if len(s) < 2:\n            return s\n        elif (s[0] == s[-1]) and s.startswith(('\"', \"'\")):\n            return s[1: -1]\n        else:\n            return s", "entry_point": "dequote", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aaren/notedown/blob/1e920c7e4ecbe47420c12eed3d5bcae735121222/notedown/notedown.py#L526-L533", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035943", "code": "def derivative_colors(colors):\n    \"\"\"Return the names of valid color variants, given the base colors.\"\"\"\n    return set([('on_' + c) for c in colors] +\n               [('bright_' + c) for c in colors] +\n               [('on_bright_' + c) for c in colors])", "entry_point": "derivative_colors", "input": "['apple', 'banana', 'cherry']", "output": "{'bright_apple', 'on_banana', 'on_bright_apple', 'on_bright_banana', 'bright_cherry', 'on_bright_cherry', 'on_apple', 'on_cherry', 'bright_banana'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/erikrose/blessings/blob/b1d4daf948d1db8455af64836906785204d09055/blessings/__init__.py#L414-L418", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035944", "code": "def isin_alone(elems, line):\n    \"\"\"Check if an element from a list is the only element of a string.\n\n    :type elems: list\n    :type line: str\n\n    \"\"\"\n    found = False\n    for e in elems:\n        if line.strip().lower() == e.lower():\n            found = True\n            break\n    return found", "entry_point": "isin_alone", "input": "[], 'walnut thistle harbour'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dadadel/pyment/blob/3d1bdf87d083ff56230bd0bf7c5252e20552b7b6/pyment/docstring.py#L26-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035945", "code": "def isin_start(elems, line):\n    \"\"\"Check if an element from a list starts a string.\n\n    :type elems: list\n    :type line: str\n\n    \"\"\"\n    found = False\n    elems = [elems] if type(elems) is not list else elems\n    for e in elems:\n        if line.lstrip().lower().startswith(e):\n            found = True\n            break\n    return found", "entry_point": "isin_start", "input": "['a', 'b', 'c'], 'AbC dEf'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dadadel/pyment/blob/3d1bdf87d083ff56230bd0bf7c5252e20552b7b6/pyment/docstring.py#L41-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035946", "code": "def isin(elems, line):\n    \"\"\"Check if an element from a list is in a string.\n\n    :type elems: list\n    :type line: str\n\n    \"\"\"\n    found = False\n    for e in elems:\n        if e in line.lower():\n            found = True\n            break\n    return found", "entry_point": "isin", "input": "[], 'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dadadel/pyment/blob/3d1bdf87d083ff56230bd0bf7c5252e20552b7b6/pyment/docstring.py#L57-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035947", "code": "def format_list(data):\n    \"\"\" Remove useless characters to output a clean list.\"\"\"\n    if isinstance(data, (list, tuple)):\n        to_clean = ['[', ']', '(', ')', \"'\"]\n        for item in to_clean:\n            data = str(data).replace(\"u\\\"\", \"\\\"\").replace(\"u\\'\", \"\\'\")\n            data = str(data).replace(item, '')\n    return data", "entry_point": "format_list", "input": "[[1, 2], [3], []]", "output": "'1, 2, 3, '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Gandi/gandi.cli/blob/6ee5b8fc8ec44b0a6c232043ca610606ad8f693d/gandi/cli/core/utils/__init__.py#L70-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035948", "code": "def flatten(l, types=(list, float)):\n    \"\"\"\n    Flat nested list of lists into a single list.\n    \"\"\"\n    l = [item if isinstance(item, types) else [item] for item in l]\n    return [item for sublist in l for item in sublist]", "entry_point": "flatten", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aykut/django-bulk-update/blob/399e64d820133a79f910682c1cf247938c5c4784/django_bulk_update/helper.py#L41-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035949", "code": "def sameuuid(a: str, b: str) -> bool:\n    \"\"\"Compare two UUIDs.\"\"\"\n    return a and b and a.lower() == b.lower()", "entry_point": "sameuuid", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coldfix/udiskie/blob/804c9d27df6f7361fec3097c432398f2d702f911/udiskie/common.py#L63-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035950", "code": "def extend(a: dict, b: dict) -> dict:\n    \"\"\"Merge two dicts and return a new dict. Much like subclassing works.\"\"\"\n    res = a.copy()\n    res.update(b)\n    return res", "entry_point": "extend", "input": "{}, {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coldfix/udiskie/blob/804c9d27df6f7361fec3097c432398f2d702f911/udiskie/common.py#L74-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035951", "code": "def __clean_dict(dictionary):\n        \"\"\"\n        Takes the dictionary from __parse_content() and creates a well formatted list\n\n        :param dictionary: unformatted dict\n        :returns: a list which contains dict's as it's elements\n        \"\"\"\n        key_dict = {}\n        value_dict = {}\n        final_list = []\n        for key in dictionary.keys():\n            key_dict[key] = \"seq\"\n\n        for value in dictionary.values():\n            value_dict[value] = \"text\"\n\n        for (key1, value1), (key2, value2) in zip(key_dict.items(), value_dict.items()):\n            final_list.append({value1: int(key1), value2: key2})\n\n        return final_list", "entry_point": "__clean_dict", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tasdikrahman/vocabulary/blob/54403c5981af25dc3457796b57048ae27f09e9be/vocabulary/vocabulary.py#L139-L158", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035952", "code": "def translate_key_to_config(p_key):\n    \"\"\"\n    Translates urwid key event to form understandable by topydo config parser.\n    \"\"\"\n    if len(p_key) > 1:\n        key = p_key.capitalize()\n        if key.startswith('Ctrl') or key.startswith('Meta'):\n            key = key[0] + '-' + key[5:]\n        key = '<' + key + '>'\n    else:\n        key = p_key\n\n    return key", "entry_point": "translate_key_to_config", "input": "'abc'", "output": "'<Abc>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bram85/topydo/blob/b59fcfca5361869a6b78d4c9808c7c6cd0a18b58/topydo/lib/Utils.py#L98-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035953", "code": "def _convert_priority(p_priority):\n    \"\"\"\n    Converts todo.txt priority to an iCalendar priority (RFC 2445).\n\n    Priority A gets priority 1, priority B gets priority 5 and priority C-F get\n    priorities 6-9. This scheme makes sure that clients that use \"high\",\n    \"medium\" and \"low\" show the correct priority.\n    \"\"\"\n    result = 0\n\n    prio_map = {\n        'A': 1,\n        'B': 5,\n        'C': 6,\n        'D': 7,\n        'E': 8,\n        'F': 9,\n    }\n\n    try:\n        result = prio_map[p_priority]\n    except KeyError:\n        if p_priority:\n            # todos with no priority have priority None, and result of this\n            # function will be 0. For all other letters, return 9 (lowest\n            # priority in RFC 2445).\n            result = 9\n\n    return result", "entry_point": "_convert_priority", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bram85/topydo/blob/b59fcfca5361869a6b78d4c9808c7c6cd0a18b58/topydo/lib/printers/Ical.py#L29-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035954", "code": "def _get_clean_parameters(kwargs):\n        \"\"\"\n            Clean the parameters by filtering out any parameters that have a None value.\n        \"\"\"\n        return dict((k, v) for k, v in kwargs.items() if v is not None)", "entry_point": "_get_clean_parameters", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gfairchild/yelpapi/blob/51e35fbe44ac131630ce5e2f1b6f53711846e2a7/yelpapi/yelpapi.py#L258-L262", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035955", "code": "def common_segment_count(path, value):\n    \"\"\"Return the number of path segments common to both\"\"\"\n    i = 0\n    if len(path) <= len(value):\n        for x1, x2 in zip(path, value):\n            if x1 == x2:\n                i += 1\n            else:\n                return 0\n    return i", "entry_point": "common_segment_count", "input": "'AbC dEf', []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aio-libs/aiohttp-debugtoolbar/blob/a1c3fb2b487bcaaf23eb71ee4c9c3cfc9cb94322/aiohttp_debugtoolbar/utils.py#L83-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035956", "code": "def _apply_commit_rules(rules, commit):\n        \"\"\" Applies a set of rules against a given commit and gitcontext \"\"\"\n        all_violations = []\n        for rule in rules:\n            violations = rule.validate(commit)\n            if violations:\n                all_violations.extend(violations)\n        return all_violations", "entry_point": "_apply_commit_rules", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jorisroovers/gitlint/blob/6248bd6cbc20c1be3bb6d196a5ec0425af99733b/gitlint/lint.py#L61-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035957", "code": "def get_backend_stats_url(config, hub, backend_type):\n    \"\"\"\n    Util method to get backend stats url\n    \"\"\"\n    if ((config is not None) and ('hub' in config) and (hub is None)):\n        hub = config[\"hub\"]\n    if (hub is not None):\n        return '/Network/{}/devices/{}'.format(hub, backend_type)\n    return '/Backends/{}'.format(backend_type)", "entry_point": "get_backend_stats_url", "input": "{'x': [1, 2], 'y': []}, ['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "\"/Network/['apple', 'banana', 'cherry']/devices/[[1, 2], [3], []]\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Qiskit/qiskit-api-py/blob/2ab240110fb7e653254e44c4833f3643e8ae7f0f/IBMQuantumExperience/IBMQuantumExperience.py#L36-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035958", "code": "def x_www_form_urlencoded(post_data):\n    \"\"\" convert origin dict to x-www-form-urlencoded\n\n    Args:\n        post_data (dict):\n            {\"a\": 1, \"b\":2}\n\n    Returns:\n        str:\n            a=1&b=2\n\n    \"\"\"\n    if isinstance(post_data, dict):\n        return \"&\".join([\n            u\"{}={}\".format(key, value)\n            for key, value in post_data.items()\n        ])\n    else:\n        return post_data", "entry_point": "x_www_form_urlencoded", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HttpRunner/har2case/blob/369e576b24b3521832c35344b104828e30742170/har2case/utils.py#L39-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035959", "code": "def get_value(kv, key, value = None):\n    \"\"\"get value from the keyvalues (options)\"\"\"\n    res = []\n    for k, v in kv:\n        if k == key:\n            value = v\n        else:\n            res.append([k, v])\n    return value, res", "entry_point": "get_value", "input": "set(), [5, 3, 1, 4], True", "output": "(True, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jgm/pandocfilters/blob/0d6b4f9be9d8e54b18b8a97e6120dd85ece53de5/pandocfilters.py#L41-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035960", "code": "def attributes(attrs):\n    \"\"\"Returns an attribute list, constructed from the\n    dictionary attrs.\n    \"\"\"\n    attrs = attrs or {}\n    ident = attrs.get(\"id\", \"\")\n    classes = attrs.get(\"classes\", [])\n    keyvals = [[x, attrs[x]] for x in attrs if (x != \"classes\" and x != \"id\")]\n    return [ident, classes, keyvals]", "entry_point": "attributes", "input": "[]", "output": "['', [], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jgm/pandocfilters/blob/0d6b4f9be9d8e54b18b8a97e6120dd85ece53de5/pandocfilters.py#L226-L234", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035961", "code": "def and_join(strings):\n    \"\"\"Join the given ``strings`` by commas with last `' and '` conjuction.\n\n    >>> and_join(['Korea', 'Japan', 'China', 'Taiwan'])\n    'Korea, Japan, China, and Taiwan'\n\n    :param strings: a list of words to join\n    :type string: :class:`collections.abc.Sequence`\n    :returns: a joined string\n    :rtype: :class:`str`, :class:`basestring`\n\n    \"\"\"\n    last = len(strings) - 1\n    if last == 0:\n        return strings[0]\n    elif last < 0:\n        return ''\n    iterator = enumerate(strings)\n    return ', '.join('and ' + s if i == last else s for i, s in iterator)", "entry_point": "and_join", "input": "'AbC dEf'", "output": "'A, b, C,  , d, E, and f'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sass/libsass-python/blob/fde5b18bc761f0253e71685ee5489e4beb8a403e/sass.py#L741-L759", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035962", "code": "def _generate_key_map(entity_list, key, entity_class):\n    \"\"\" Helper method to generate map from key to entity object for given list of dicts.\n\n    Args:\n      entity_list: List consisting of dict.\n      key: Key in each dict which will be key in the map.\n      entity_class: Class representing the entity.\n\n    Returns:\n      Map mapping key to entity object.\n    \"\"\"\n\n    key_map = {}\n    for obj in entity_list:\n      key_map[obj[key]] = entity_class(**obj)\n\n    return key_map", "entry_point": "_generate_key_map", "input": "{}, 10, [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/optimizely/python-sdk/blob/ec028d9efcf22498c3820f2650fa10f5c30bec90/optimizely/project_config.py#L134-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035963", "code": "def _audience_condition_deserializer(obj_dict):\n  \"\"\" Deserializer defining how dict objects need to be decoded for audience conditions.\n\n  Args:\n    obj_dict: Dict representing one audience condition.\n\n  Returns:\n    List consisting of condition key with corresponding value, type and match.\n  \"\"\"\n  return [\n    obj_dict.get('name'),\n    obj_dict.get('value'),\n    obj_dict.get('type'),\n    obj_dict.get('match')\n  ]", "entry_point": "_audience_condition_deserializer", "input": "{'a': 1, 'b': 2}", "output": "[None, None, None, None]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/optimizely/python-sdk/blob/ec028d9efcf22498c3820f2650fa10f5c30bec90/optimizely/helpers/condition.py#L328-L342", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035964", "code": "def interpolate_colors(colors, flat=False, num_colors=256):\n    \"\"\" Given a list of colors, create a larger list of colors interpolating\n    the first one. If flatten is True a list of numers will be returned. If\n    False, a list of (r,g,b) tuples. num_colors is the number of colors wanted\n    in the final list \"\"\"\n\n    palette = []\n\n    for i in range(num_colors):\n        index = (i * (len(colors) - 1)) / (num_colors - 1.0)\n        index_int = int(index)\n        alpha = index - float(index_int)\n\n        if alpha > 0:\n            r = (1.0 - alpha) * colors[index_int][\n                0] + alpha * colors[index_int + 1][0]\n            g = (1.0 - alpha) * colors[index_int][\n                1] + alpha * colors[index_int + 1][1]\n            b = (1.0 - alpha) * colors[index_int][\n                2] + alpha * colors[index_int + 1][2]\n        else:\n            r = (1.0 - alpha) * colors[index_int][0]\n            g = (1.0 - alpha) * colors[index_int][1]\n            b = (1.0 - alpha) * colors[index_int][2]\n\n        if flat:\n            palette.extend((int(r), int(g), int(b)))\n        else:\n            palette.append((int(r), int(g), int(b)))\n\n    return palette", "entry_point": "interpolate_colors", "input": "False, -1.5, False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Parisson/TimeSide/blob/0618d75cd2f16021afcfd3d5b77f692adad76ea5/timeside/plugins/grapher/utils.py#L39-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035965", "code": "def select(files, start, stop):\n    \"\"\"\n    Helper function for handling start and stop indices\n    \"\"\"\n    if start or stop:\n        if start is None:\n            start = 0\n        if stop is None:\n            stop = len(files)\n        files = files[start:stop]\n    return files", "entry_point": "select", "input": "True, set(), set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thunder-project/thunder/blob/967ff8f3e7c2fabe1705743d95eb2746d4329786/thunder/readers.py#L42-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035966", "code": "def yearInfo2yearDay(yearInfo):\n    '''calculate the days in a lunar year from the lunar year's info\n\n    >>> yearInfo2yearDay(0) # no leap month, and every month has 29 days.\n    348\n    >>> yearInfo2yearDay(1) # 1 leap month, and every month has 29 days.\n    377\n    >>> yearInfo2yearDay((2**12-1)*16) # no leap month, and every month has 30 days.\n    360\n    >>> yearInfo2yearDay((2**13-1)*16+1) # 1 leap month, and every month has 30 days.\n    390\n    >>> # 1 leap month, and every normal month has 30 days, and leap month has 29 days.\n    >>> yearInfo2yearDay((2**12-1)*16+1)\n    389\n    '''\n    yearInfo = int(yearInfo)\n\n    res = 29 * 12\n\n    leap = False\n    if yearInfo % 16 != 0:\n        leap = True\n        res += 29\n\n    yearInfo //= 16\n\n    for i in range(12 + leap):\n        if yearInfo % 2 == 1:\n            res += 1\n        yearInfo //= 2\n    return res", "entry_point": "yearInfo2yearDay", "input": "0.5", "output": "348", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lidaobing/python-lunardate/blob/261334a27d772489c9fc70b8ecef129ba3c13118/lunardate.py#L367-L397", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035967", "code": "def dict_keys_without_hyphens(a_dict):\n    \"\"\"Return the a new dict with underscores instead of hyphens in keys.\"\"\"\n    return dict(\n        (key.replace('-', '_'), val) for key, val in a_dict.items())", "entry_point": "dict_keys_without_hyphens", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/charm-helpers/blob/aa785c40c3b7a8c69dbfbc7921d6b9f30142e171/charmhelpers/contrib/templating/contexts.py#L31-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035968", "code": "def parse_mappings(mappings, key_rvalue=False):\n    \"\"\"By default mappings are lvalue keyed.\n\n    If key_rvalue is True, the mapping will be reversed to allow multiple\n    configs for the same lvalue.\n    \"\"\"\n    parsed = {}\n    if mappings:\n        mappings = mappings.split()\n        for m in mappings:\n            p = m.partition(':')\n\n            if key_rvalue:\n                key_index = 2\n                val_index = 0\n                # if there is no rvalue skip to next\n                if not p[1]:\n                    continue\n            else:\n                key_index = 0\n                val_index = 2\n\n            key = p[key_index].strip()\n            parsed[key] = p[val_index].strip()\n\n    return parsed", "entry_point": "parse_mappings", "input": "{}, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/charm-helpers/blob/aa785c40c3b7a8c69dbfbc7921d6b9f30142e171/charmhelpers/contrib/openstack/neutron.py#L270-L295", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035969", "code": "def get_source_and_pgp_key(source_and_key):\n    \"\"\"Look for a pgp key ID or ascii-armor key in the given input.\n\n    :param source_and_key: Sting, \"source_spec|keyid\" where '|keyid' is\n        optional.\n    :returns (source_spec, key_id OR None) as a tuple.  Returns None for key_id\n        if there was no '|' in the source_and_key string.\n    \"\"\"\n    try:\n        source, key = source_and_key.split('|', 2)\n        return source, key or None\n    except ValueError:\n        return source_and_key, None", "entry_point": "get_source_and_pgp_key", "input": "'  padded  '", "output": "('  padded  ', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/charm-helpers/blob/aa785c40c3b7a8c69dbfbc7921d6b9f30142e171/charmhelpers/contrib/openstack/utils.py#L553-L565", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035970", "code": "def workload_state_compare(current_workload_state, workload_state):\n    \"\"\" Return highest priority of two states\"\"\"\n    hierarchy = {'unknown': -1,\n                 'active': 0,\n                 'maintenance': 1,\n                 'waiting': 2,\n                 'blocked': 3,\n                 }\n\n    if hierarchy.get(workload_state) is None:\n        workload_state = 'unknown'\n    if hierarchy.get(current_workload_state) is None:\n        current_workload_state = 'unknown'\n\n    # Set workload_state based on hierarchy of statuses\n    if hierarchy.get(current_workload_state) > hierarchy.get(workload_state):\n        return current_workload_state\n    else:\n        return workload_state", "entry_point": "workload_state_compare", "input": "(1, 2), -1.5", "output": "'unknown'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/juju/charm-helpers/blob/aa785c40c3b7a8c69dbfbc7921d6b9f30142e171/charmhelpers/contrib/openstack/utils.py#L1142-L1160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035971", "code": "def lookUpFieldType(field_type):\n    \"\"\" Converts the ArcGIS REST field types to Python Types\n        Input:\n           field_type - string - type of field as string\n        Output:\n           Python field type as string\n    \"\"\"\n    if field_type == \"esriFieldTypeDate\":\n        return \"DATE\"\n    elif field_type == \"esriFieldTypeInteger\":\n        return \"LONG\"\n    elif field_type == \"esriFieldTypeSmallInteger\":\n        return \"SHORT\"\n    elif field_type == \"esriFieldTypeDouble\":\n        return \"DOUBLE\"\n    elif field_type == \"esriFieldTypeString\":\n        return \"TEXT\"\n    elif field_type == \"esriFieldTypeBlob\":\n        return \"BLOB\"\n    elif field_type == \"esriFieldTypeSingle\":\n        return \"FLOAT\"\n    elif field_type == \"esriFieldTypeRaster\":\n        return \"RASTER\"\n    elif field_type == \"esriFieldTypeGUID\":\n        return \"GUID\"\n    elif field_type == \"esriFieldTypeGlobalID\":\n        return \"TEXT\"\n    else:\n        return \"TEXT\"", "entry_point": "lookUpFieldType", "input": "[]", "output": "'TEXT'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/common/spatial.py#L249-L277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035972", "code": "def unique(new_cmp_dict, old_cmp_dict):\n    \"\"\"Return a list dict of\n       the unique keys in new_cmp_dict\n    \"\"\"\n    newkeys = set(new_cmp_dict)\n    oldkeys = set(old_cmp_dict)\n    unique = newkeys - oldkeys\n    unique_ldict = []\n    for key in unique:\n        unique_ldict.append(new_cmp_dict[key])\n    return unique_ldict", "entry_point": "unique", "input": "{}, {'x': [1, 2], 'y': []}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jasonrollins/shareplum/blob/404f320808912619920e2d787f2c4387225a14e0/shareplum/ListDict.py#L35-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035973", "code": "def full_dict(ldict, keys):\n    \"\"\"Return Comparison Dictionaries\n       from list dict on keys\n       keys: a list of keys that when\n       combined make the row in the list unique\n    \"\"\"\n    if type(keys) == str:\n        keys = [keys]\n    else:\n        keys = keys\n\n    cmp_dict = {}\n    for line in ldict:\n        index = []\n        for key in keys:\n            index.append(str(line.get(key, '')))\n        index = '-'.join(index)\n        cmp_dict[index] = line\n\n    return cmp_dict", "entry_point": "full_dict", "input": "{}, [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jasonrollins/shareplum/blob/404f320808912619920e2d787f2c4387225a14e0/shareplum/ListDict.py#L47-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035974", "code": "def strip_block_whitespace(string_list):\n    \"\"\"Treats a list of strings as a code block and strips\n        whitespace so that the min whitespace line sits at char 0 of line.\"\"\"\n    min_ws = min([(len(x) - len(x.lstrip())) for x in string_list if x != '\\n'])\n    return [x[min_ws:] if x != '\\n' else x for x in string_list]", "entry_point": "strip_block_whitespace", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/improbable-research/keanu/blob/73189a8f569078e156168e795f82c7366c59574b/docs/bin/snippet_writer.py#L126-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035975", "code": "def _etextno_to_uri_subdirectory(etextno):\n    \"\"\"Returns the subdirectory that an etextno will be found in a gutenberg\n    mirror. Generally, one finds the subdirectory by separating out each digit\n    of the etext number, and uses it for a directory. The exception here is for\n    etext numbers less than 10, which are prepended with a 0 for the directory\n    traversal.\n\n    >>> _etextno_to_uri_subdirectory(1)\n    '0/1'\n    >>> _etextno_to_uri_subdirectory(19)\n    '1/19'\n    >>> _etextno_to_uri_subdirectory(15453)\n    '1/5/4/5/15453'\n    \"\"\"\n    str_etextno = str(etextno).zfill(2)\n    all_but_last_digit = list(str_etextno[:-1])\n    subdir_part = \"/\".join(all_but_last_digit)\n    subdir = \"{}/{}\".format(subdir_part, etextno)  # etextno not zfilled\n    return subdir", "entry_point": "_etextno_to_uri_subdirectory", "input": "'AbC dEf'", "output": "'A/b/C/ /d/E/AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/c-w/gutenberg/blob/d1ef3da6fba6c3636d452479ed6bcb17c7d4d246/gutenberg/acquire/text.py#L30-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035976", "code": "def dhms(secs):\n    \"\"\"return days,hours,minutes and seconds\"\"\"\n    dhms = [0, 0, 0, 0]\n    dhms[0] = int(secs // 86400)\n    s = secs % 86400\n    dhms[1] = int(s // 3600)\n    s = secs % 3600\n    dhms[2] = int(s // 60)\n    s = secs % 60\n    dhms[3] = int(s+.5)\n    return dhms", "entry_point": "dhms", "input": "False", "output": "[0, 0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Atomistica/atomistica/blob/5ed79d776c92b91a566be22615bfb304ecc75db7/src/python/atomistica/hardware.py#L52-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035977", "code": "def hms(secs):\n    \"\"\"return hours,minutes and seconds\"\"\"\n    hms = [0, 0, 0]\n    hms[0] = int(secs // 3600)\n    s = secs % 3600\n    hms[1] = int(s // 60)\n    s = secs % 60\n    hms[2] = int(s+.5)\n    return hms", "entry_point": "hms", "input": "3.25", "output": "[0, 0, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Atomistica/atomistica/blob/5ed79d776c92b91a566be22615bfb304ecc75db7/src/python/atomistica/hardware.py#L65-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035978", "code": "def find_duplicates_in_array(array):\n    \"\"\"Runs through the array and returns the elements that contain\n    more than one duplicate\n\n    Args:\n        array: The array to check for duplicates.\n\n    Returns:\n        Array of the elements that are duplicates. Returns empty list if\n        there are no duplicates.\n    \"\"\"\n    duplicates = []\n    non_duplicates = []\n\n    if len(array) != len(set(array)):\n        for item in array:\n            if item not in non_duplicates:\n                non_duplicates.append(item)\n            elif item in non_duplicates and item not in duplicates:\n                duplicates.append(item)\n\n    return duplicates", "entry_point": "find_duplicates_in_array", "input": "[-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thanethomson/statik/blob/56b1b5a2cb05a97afa81f428bfcefc833e935b8d/statik/utils.py#L365-L386", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035979", "code": "def compose_sep(deps, separator):\n        \"\"\"Opposite of parse().\n\n        :param deps: list of Dependency()\n        :param separator: when joining dependencies, use this separator\n        :return: dict of {name: version spec}\n        \"\"\"\n        result = {}\n        for dep in deps:\n            if dep.name not in result:\n                result[dep.name] = separator.join([op + ver for op, ver in dep.spec])\n            else:\n                result[dep.name] += separator + separator.join([op + ver for op, ver in dep.spec])\n        return result", "entry_point": "compose_sep", "input": "[], 'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thoth-station/solver/blob/de9bd6e744cb4d5f70320ba77d6875ccb8b876c4/thoth/solver/python/base.py#L197-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035980", "code": "def _fit(y, classes):\n    \"\"\"Calculate the total sum of squares for a vector y classified into\n    classes\n\n    Parameters\n    ----------\n    y : array\n        (n,1), variable to be classified\n\n    classes : array\n              (k,1), integer values denoting class membership\n\n    \"\"\"\n    tss = 0\n    for class_def in classes:\n        yc = y[class_def]\n        css = yc - yc.mean()\n        css *= css\n        tss += sum(css)\n    return tss", "entry_point": "_fit", "input": "['apple', 'banana', 'cherry'], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pysal/mapclassify/blob/5b22ec33f5802becf40557614d90cd38efa1676e/mapclassify/classifiers.py#L2226-L2245", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035981", "code": "def correct_bounding_box_list_for_nonzero_origin(bbox_list, full_box_list):\n    \"\"\"The bounding box calculated from an image has coordinates relative to the\n    lower-left point in the PDF being at zero.  Similarly, Ghostscript reports a\n    bounding box relative to a zero lower-left point.  If the MediaBox (or full\n    page box) has been shifted, like when cropping a previously cropped\n    document, then we need to correct the bounding box by an additive\n    translation on all the points.\"\"\"\n\n    corrected_box_list = []\n    for bbox, full_box in zip(bbox_list, full_box_list):\n        left_x = full_box[0]\n        lower_y = full_box[1]\n        corrected_box_list.append([bbox[0]+left_x, bbox[1]+lower_y,\n                                 bbox[2]+left_x, bbox[3]+lower_y])\n    return corrected_box_list", "entry_point": "correct_bounding_box_list_for_nonzero_origin", "input": "[[1, 2], [3], []], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abarker/pdfCropMargins/blob/55aca874613750ebf4ae69fd8851bdbb7696d6ac/src/pdfCropMargins/calculate_bounding_boxes.py#L99-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035982", "code": "def cluster_alignment_errors(alignment):\n    # TODO Review documentation and consider for inclusion in API.\n    \"\"\"Clusters alignments\n    Takes an alignment created by min_edit_distance_align() and groups\n    consecutive errors together. This is useful, because there are often\n    many possible alignments, and so often we can't meaningfully distinguish\n    between alignment errors at the character level, so it makes many-to-many\n    mistakes more readable.\"\"\"\n\n    newalign = []\n    mistakes = ([],[])\n    for align_item in alignment:\n        if align_item[0] == align_item[1]:\n            if mistakes != ([],[]):\n                newalign.append((tuple(mistakes[0]), tuple(mistakes[1])))\n                mistakes = ([],[])\n            newalign.append((tuple([align_item[0]]), tuple([align_item[1]])))\n        else:\n            if align_item[0] != \"\":\n                mistakes[0].append(align_item[0])\n            if align_item[1] != \"\":\n                mistakes[1].append(align_item[1])\n    if mistakes != ([],[]):\n        newalign.append((tuple(mistakes[0]), tuple(mistakes[1])))\n        mistakes = ([],[])\n\n    return newalign", "entry_point": "cluster_alignment_errors", "input": "['apple', 'banana', 'cherry']", "output": "[(('a', 'b', 'c'), ('p', 'a', 'h'))]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/persephone-tools/persephone/blob/f94c63e4d5fe719fb1deba449b177bb299d225fb/persephone/distance.py#L150-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035983", "code": "def _fromstring(value):\n        '''Convert XML string value to None, boolean, int or float'''\n        # NOTE: Is this even possible ?\n        if value is None:\n            return None\n\n        # FIXME: In XML, booleans are either 0/false or 1/true (lower-case !)\n        if value.lower() == 'true':\n            return True\n        elif value.lower() == 'false':\n            return False\n\n        # FIXME: Using int() or float() is eating whitespaces unintendedly here\n        try:\n            return int(value)\n        except ValueError:\n            pass\n\n        try:\n            # Test for infinity and NaN values\n            if float('-inf') < float(value) < float('inf'):\n                return float(value)\n        except ValueError:\n            pass\n\n        return value", "entry_point": "_fromstring", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sanand0/xmljson/blob/2ecc2065fe7c87b3d282d362289927f13ce7f8b0/xmljson/__init__.py#L72-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035984", "code": "def as_int(n):\n    \"\"\"\n    Convert the argument to a builtin integer.\n\n    The return value is guaranteed to be equal to the input. ValueError is\n    raised if the input has a non-integral value.\n\n    Examples\n    ========\n\n    >>> from sympy.core.compatibility import as_int\n    >>> from sympy import sqrt\n    >>> 3.0\n    3.0\n    >>> as_int(3.0) # convert to int and test for equality\n    3\n    >>> int(sqrt(10))\n    3\n    >>> as_int(sqrt(10))\n    Traceback (most recent call last):\n    ...\n    ValueError: ... is not an integer\n\n    \"\"\"\n    try:\n        result = int(n)\n        if result != n:\n            raise TypeError\n    except TypeError:\n        raise ValueError('%s is not an integer' % n)\n    return result", "entry_point": "as_int", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/symengine/symengine.py/blob/1366cf98ceaade339c5dd24ae3381a0e63ea9dad/symengine/compatibility.py#L359-L389", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035985", "code": "def currency_to_protocol(amount):\n    \"\"\"\n    Convert a string of 'currency units' to 'protocol units'. For instance\n    converts 19.1 bitcoin to 1910000000 satoshis.\n\n    Input is a float, output is an integer that is 1e8 times larger.\n\n    It is hard to do this conversion because multiplying\n    floats causes rounding nubers which will mess up the transactions creation\n    process.\n\n    examples:\n\n    19.1 -> 1910000000\n    0.001 -> 100000\n\n    \"\"\"\n    if type(amount) in [float, int]:\n        amount = \"%.8f\" % amount\n\n    return int(amount.replace(\".\", ''))", "entry_point": "currency_to_protocol", "input": "3.25", "output": "325000000", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/priestc/moneywagon/blob/00518f1f557dcca8b3031f46d3564c2baa0227a3/moneywagon/core.py#L781-L801", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035986", "code": "def eight_decimal_places(amount, format=\"str\"):\n    \"\"\"\n    >>> eight_decimal_places(3.12345678912345)\n    \"3.12345679\"\n    >>> eight_decimal_places(\"3.12345678912345\")\n    \"3.12345679\"\n    >>> eight_decimal_places(3.12345678912345, format='float')\n    3.12345679\n    >>> eight_decimal_places(\"3.12345678912345\", format='float')\n    3.12345679\n    \"\"\"\n    if type(amount) == str:\n        return amount\n    if format == 'str':\n        return \"%.8f\" % amount\n    if format == 'float':\n        return float(\"%.8f\" % amount)", "entry_point": "eight_decimal_places", "input": "'  padded  ', set()", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/priestc/moneywagon/blob/00518f1f557dcca8b3031f46d3564c2baa0227a3/moneywagon/services/exchange_services.py#L49-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035987", "code": "def maybe_cast_list(value, types):\n    \"\"\"\n    Try to coerce list values into more specific list subclasses in types.\n    \"\"\"\n    if not isinstance(value, list):\n        return value\n\n    if type(types) not in (list, tuple):\n        types = (types,)\n\n    for list_type in types:\n        if issubclass(list_type, list):\n            try:\n                return list_type(value)\n            except (TypeError, ValueError):\n                pass\n    return value", "entry_point": "maybe_cast_list", "input": "set(), 'walnut thistle harbour'", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scrapinghub/exporters/blob/c9fb01db1771ada4672bbffd67cb46e1f7802ab9/exporters/utils.py#L143-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035988", "code": "def filesize(value):\n    '''Display a human readable filesize'''\n    suffix = 'o'\n    for unit in '', 'K', 'M', 'G', 'T', 'P', 'E', 'Z':\n        if abs(value) < 1024.0:\n            return \"%3.1f%s%s\" % (value, unit, suffix)\n        value /= 1024.0\n    return \"%.1f%s%s\" % (value, 'Y', suffix)", "entry_point": "filesize", "input": "True", "output": "'1.0o'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/opendatateam/udata/blob/f016585af94b0ff6bd73738c700324adc8ba7f8f/udata/frontend/helpers.py#L399-L406", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035989", "code": "def lookup_discrete(x, xs, ys):\n    \"\"\"\n    Intermediate values take on the value associated with the next lower x-coordinate (also called a step-wise function). The last two points of a discrete graphical function must have the same y value.\n    Out-of-range values are the same as the closest endpoint (i.e, no extrapolation is performed).\n    \"\"\"\n    for index in range(0, len(xs)):\n        if x < xs[index]:\n            return ys[index - 1] if index > 0 else ys[index]\n    return ys[len(ys) - 1]", "entry_point": "lookup_discrete", "input": "[], [], [1, 2, 3]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JamesPHoughton/pysd/blob/bf1b1d03954e9ba5acac9ba4f1ada7cd93352eda/pysd/py_backend/functions.py#L935-L943", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035990", "code": "def merge_partial_elements(element_list):\n    \"\"\"\n    merges model elements which collectively all define the model component,\n    mostly for multidimensional subscripts\n\n    Parameters\n    ----------\n    element_list\n\n    Returns\n    -------\n    \"\"\"\n    outs = dict()  # output data structure\n    for element in element_list:\n        if element['py_expr'] != \"None\":  # for\n            name = element['py_name']\n            if name not in outs:\n                # Use 'expr' for Vensim models, and 'eqn' for Xmile (This makes the Vensim equation prettier.)\n                eqn = element['expr'] if 'expr' in element else element['eqn']\n\n                outs[name] = {\n                    'py_name': element['py_name'],\n                    'real_name': element['real_name'],\n                    'doc': element['doc'],\n                    'py_expr': [element['py_expr']],  # in a list\n                    'unit': element['unit'],\n                    'subs': [element['subs']],\n                    'lims': element['lims'],\n                    'eqn': eqn,\n                    'kind': element['kind'],\n                    'arguments': element['arguments']\n                }\n\n            else:\n                outs[name]['doc'] = outs[name]['doc'] or element['doc']\n                outs[name]['unit'] = outs[name]['unit'] or element['unit']\n                outs[name]['lims'] = outs[name]['lims'] or element['lims']\n                outs[name]['eqn'] = outs[name]['eqn'] or element['eqn']\n                outs[name]['py_expr'] += [element['py_expr']]\n                outs[name]['subs'] += [element['subs']]\n                outs[name]['arguments'] = element['arguments']\n\n    return list(outs.values())", "entry_point": "merge_partial_elements", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JamesPHoughton/pysd/blob/bf1b1d03954e9ba5acac9ba4f1ada7cd93352eda/pysd/py_backend/builder.py#L187-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035991", "code": "def parse_units(units_str):\n    \"\"\"\n    Extract and parse the units\n    Extract the bounds over which the expression is assumed to apply.\n\n    Parameters\n    ----------\n    units_str\n\n    Returns\n    -------\n\n    Examples\n    --------\n    >>> parse_units('Widgets/Month [-10,10,1]')\n    ('Widgets/Month', (-10,10,1))\n\n    >>> parse_units('Month [0,?]')\n    ('Month', [-10, None])\n\n    >>> parse_units('Widgets [0,100]')\n    ('Widgets', (0, 100))\n\n    >>> parse_units('Widgets')\n    ('Widgets', (None, None))\n\n    >>> parse_units('[0, 100]')\n    ('', (0, 100))\n\n    \"\"\"\n    if not len(units_str):\n        return units_str, (None, None)\n\n    if units_str[-1] == ']':\n        units, lims = units_str.rsplit('[')  # type: str, str\n    else:\n        units = units_str\n        lims = '?, ?]'\n\n    lims = tuple([float(x) if x.strip() != '?' else None for x in lims.strip(']').split(',')])\n\n    return units.strip(), lims", "entry_point": "parse_units", "input": "set()", "output": "(set(), (None, None))", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JamesPHoughton/pysd/blob/bf1b1d03954e9ba5acac9ba4f1ada7cd93352eda/pysd/py_backend/vensim/vensim2py.py#L308-L349", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035992", "code": "def output_colored(code, text, is_bold=False):\n    \"\"\"\n    Create function to output with color sequence\n    \"\"\"\n    if is_bold:\n        code = '1;%s' % code\n\n    return '\\033[%sm%s\\033[0m' % (code, text)", "entry_point": "output_colored", "input": "[[1, 2], [3], []], 'AbC dEf', [1, 2, 3]", "output": "'\\x1b[1;[[1, 2], [3], []]mAbC dEf\\x1b[0m'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/raimon49/pip-licenses/blob/879eddd9d75228ba7d6529bd3050d11ae6bf1712/piplicenses.py#L504-L511", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035993", "code": "def match_keyword(token, keywords):\n    \"\"\"\n    Checks if the given token represents one of the given keywords\n    \"\"\"\n    if not token:\n        return False\n    if not token.is_keyword:\n        return False\n\n    return token.value.upper() in keywords", "entry_point": "match_keyword", "input": "set(), {1, 2, 3}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/adamchainz/django-perf-rec/blob/76a1874820b55bcbc2f95a85bbda3cb056584e2c/django_perf_rec/sql.py#L84-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035994", "code": "def read_variant(variant):\n    \"\"\"Read and parse a binary protobuf variant value.\"\"\"\n    result = 0\n    cnt = 0\n    for data in variant:\n        result |= (data & 0x7f) << (7 * cnt)\n        cnt += 1\n        if not data & 0x80:\n            return result, variant[cnt:]\n    raise Exception('invalid variant')", "entry_point": "read_variant", "input": "[1, 2, 3]", "output": "(1, [2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/postlund/pyatv/blob/655dfcda4e2f9d1c501540e18da4f480d8bf0e70/pyatv/mrp/variant.py#L4-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035995", "code": "def small_phi_ces_distance(C1, C2):\n    \"\"\"Return the difference in |small_phi| between |CauseEffectStructure|.\"\"\"\n    return sum(c.phi for c in C1) - sum(c.phi for c in C2)", "entry_point": "small_phi_ces_distance", "input": "[], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wmayner/pyphi/blob/deeca69a084d782a6fde7bf26f59e93b593c5d77/pyphi/compute/distance.py#L149-L151", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035996", "code": "def margin(text):\n    r\"\"\"Add a margin to both ends of each line in the string.\n\n    Example:\n        >>> margin('line1\\nline2')\n        '  line1  \\n  line2  '\n    \"\"\"\n    lines = str(text).split('\\n')\n    return '\\n'.join('  {}  '.format(l) for l in lines)", "entry_point": "margin", "input": "'Hello World'", "output": "'  Hello World  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wmayner/pyphi/blob/deeca69a084d782a6fde7bf26f59e93b593c5d77/pyphi/models/fmt.py#L105-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035997", "code": "def bipartition_indices(N):\n    \"\"\"Return indices for undirected bipartitions of a sequence.\n\n    Args:\n        N (int): The length of the sequence.\n\n    Returns:\n        list: A list of tuples containing the indices for each of the two\n        parts.\n\n    Example:\n        >>> N = 3\n        >>> bipartition_indices(N)\n        [((), (0, 1, 2)), ((0,), (1, 2)), ((1,), (0, 2)), ((0, 1), (2,))]\n    \"\"\"\n    result = []\n    if N <= 0:\n        return result\n\n    for i in range(2**(N - 1)):\n        part = [[], []]\n        for n in range(N):\n            bit = (i >> n) & 1\n            part[bit].append(n)\n        result.append((tuple(part[1]), tuple(part[0])))\n    return result", "entry_point": "bipartition_indices", "input": "False", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wmayner/pyphi/blob/deeca69a084d782a6fde7bf26f59e93b593c5d77/pyphi/partition.py#L47-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035998", "code": "def source_debianize_name(name):\n    \"make name acceptable as a Debian source package name\"\n    name = name.replace('_','-')\n    name = name.replace('.','-')\n    name = name.lower()\n    return name", "entry_point": "source_debianize_name", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/astraw/stdeb/blob/493ab88e8a60be053b1baef81fb39b45e17ceef5/stdeb/util.py#L220-L225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0035999", "code": "def titleize(text):\n    \"\"\"Capitalizes all the words and replaces some characters in the string \n    to create a nicer looking title.\n    \"\"\"\n    if len(text) == 0: # if empty string, return it\n        return text\n    else:\n        text = text.lower() # lower all char\n        # delete redundant empty space \n        chunks = [chunk[0].upper() + chunk[1:] for chunk in text.split(\" \") if len(chunk) >= 1]\n        return \" \".join(chunks)", "entry_point": "titleize", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/uszipcode-project/blob/96282b779a3efb422802de83c48ca284598ba952/dataset/step2_merge_zipcode_data.py#L14-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036000", "code": "def format_symbol(symbol):\n    \"\"\"Returns well formatted Hermann-Mauguin symbol as extected by\n    the database, by correcting the case and adding missing or\n    removing dublicated spaces.\"\"\"\n    fixed = []\n    s = symbol.strip()\n    s = s[0].upper() + s[1:].lower()\n    for c in s:\n        if c.isalpha():\n            fixed.append(' ' + c + ' ')\n        elif c.isspace():\n            fixed.append(' ')\n        elif c.isdigit():\n            fixed.append(c)\n        elif c == '-':\n            fixed.append(' ' + c)\n        elif c == '/':\n            fixed.append(' ' + c)\n    s = ''.join(fixed).strip()\n    return ' '.join(s.split())", "entry_point": "format_symbol", "input": "'  padded  '", "output": "'P a d d e d'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chemlab/chemlab/blob/c8730966316d101e24f39ac3b96b51282aba0abe/chemlab/core/spacegroup/spacegroup.py#L484-L503", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036001", "code": "def pop_kwargs_with_prefix(prefix: str, kwargs: dict) -> dict:\n    \"\"\"Pop all items from a dictionary that have keys beginning with a prefix.\n\n    Parameters\n    ----------\n    prefix : str\n    kwargs : dict\n\n    Returns\n    -------\n    kwargs : dict\n        Items popped from the original directory, with prefix removed.\n    \"\"\"\n    keys = [key for key in kwargs if key.startswith(prefix)]\n    return {key[len(prefix):]: kwargs.pop(key) for key in keys}", "entry_point": "pop_kwargs_with_prefix", "input": "'abc', {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/janpipek/physt/blob/6dd441b073514e7728235f50b2352d56aacf38d4/physt/plotting/common.py#L73-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036002", "code": "def _get(pseudodict, key, single=True):\n    \"\"\"Helper method for getting values from \"multi-dict\"s\"\"\"\n    matches = [item[1] for item in pseudodict if item[0] == key]\n    if single:\n        return matches[0]\n    else:\n        return matches", "entry_point": "_get", "input": "{'a': 1, 'b': 2}, ['a', 'b', 'c'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/janpipek/physt/blob/6dd441b073514e7728235f50b2352d56aacf38d4/physt/compat/geant4.py#L43-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036003", "code": "def toTypeURIs(namespace_map, alias_list_s):\n    \"\"\"Given a namespace mapping and a string containing a\n    comma-separated list of namespace aliases, return a list of type\n    URIs that correspond to those aliases.\n\n    @param namespace_map: The mapping from namespace URI to alias\n    @type namespace_map: openid.message.NamespaceMap\n\n    @param alias_list_s: The string containing the comma-separated\n        list of aliases. May also be None for convenience.\n    @type alias_list_s: str or NoneType\n\n    @returns: The list of namespace URIs that corresponds to the\n        supplied list of aliases. If the string was zero-length or\n        None, an empty list will be returned.\n\n    @raise KeyError: If an alias is present in the list of aliases but\n        is not present in the namespace map.\n    \"\"\"\n    uris = []\n\n    if alias_list_s:\n        for alias in alias_list_s.split(','):\n            type_uri = namespace_map.getNamespaceURI(alias)\n            if type_uri is None:\n                raise KeyError(\n                    'No type is defined for attribute name %r' % (alias,))\n            else:\n                uris.append(type_uri)\n\n    return uris", "entry_point": "toTypeURIs", "input": "{'a': 1, 'b': 2}, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openid/python-openid/blob/f7e13536f0d1828d3cef5ae7a7b55cabadff37fc/openid/extensions/ax.py#L149-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036004", "code": "def uniq(seq):\r\n    \"\"\" Return a copy of seq without duplicates. \"\"\"\r\n    seen = set()\r\n    return [x for x in seq if str(x) not in seen and not seen.add(str(x))]", "entry_point": "uniq", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/msiemens/PyGitUp/blob/b1f78831cb6b8d29d3a7d59f7a2b54fdd0720e9c/PyGitUp/utils.py#L24-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036005", "code": "def _make_middleware_stack(middleware, base):\n        \"\"\"\n        Given a list of in-order middleware callables `middleware`\n        and a base function `base`, chains them together so each middleware is\n        fed the function below, and returns the top level ready to call.\n        \"\"\"\n        for ware in reversed(middleware):\n            base = ware(base)\n        return base", "entry_point": "_make_middleware_stack", "input": "[], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L71-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036006", "code": "def make_middleware_stack(middleware, base):\n        \"\"\"\n        Given a list of in-order middleware callable objects `middleware` and a base function `base`, chains them\n        together so each middleware is fed the function below, and returns the top level ready to call.\n\n        :param middleware: The middleware stack\n        :type middleware: iterable[callable]\n        :param base: The base callable that the lowest-order middleware wraps\n        :type base: callable\n\n        :return: The topmost middleware, which calls the next middleware ... which calls the lowest-order middleware,\n                 which calls the `base` callable.\n        :rtype: callable\n        \"\"\"\n        for ware in reversed(middleware):\n            base = ware(base)\n        return base", "entry_point": "make_middleware_stack", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L266-L282", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036007", "code": "def trees_to_dict(trees_list):\n        \"\"\"\n        Convert a list of `TreeNode`s to an expansion dictionary.\n\n        :param trees_list: A list of `TreeNode` instances\n        :type trees_list: list[TreeNode]\n\n        :return: An expansion dictionary that represents the expansions detailed in the provided expansions tree nodes\n        :rtype: dict[union[str, unicode]]\n        \"\"\"\n        result = {}\n\n        for tree in trees_list:\n            result.update(tree.to_dict())\n\n        return result", "entry_point": "trees_to_dict", "input": "()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/expander.py#L404-L419", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036008", "code": "def patch(attrs, updates):\n    \"\"\"Perform a set of updates to a attribute dictionary, return the original values.\"\"\"\n    orig = {}\n    for attr, value in updates:\n        orig[attr] = attrs[attr]\n        attrs[attr] = value\n    return orig", "entry_point": "patch", "input": "('a', 'b', 'c'), set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/venv-update/blob/6feae7ab09ee870c582b97443cfa8f0dc8626ba7/pip_faster.py#L430-L436", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036009", "code": "def rows(thelist, n):\n    \"\"\"\n    Break a list into ``n`` rows, filling up each row to the maximum equal\n    length possible. For example::\n\n        >>> l = range(10)\n\n        >>> rows(l, 2)\n        [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]\n\n        >>> rows(l, 3)\n        [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9]]\n\n        >>> rows(l, 4)\n        [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]\n\n        >>> rows(l, 5)\n        [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]\n\n        >>> rows(l, 9)\n        [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [], [], [], []]\n\n        # This filter will always return `n` rows, even if some are empty:\n        >>> rows(range(2), 3)\n        [[0], [1], []]\n    \"\"\"\n    try:\n        n = int(n)\n        thelist = list(thelist)\n    except (ValueError, TypeError):\n        return [thelist]\n    list_len = len(thelist)\n    split = list_len // n\n\n    if list_len % n != 0:\n        split += 1\n    return [thelist[split * i:split * (i + 1)] for i in range(n)]", "entry_point": "rows", "input": "['apple', 'banana', 'cherry'], []", "output": "[['apple', 'banana', 'cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bitcaster-io/bitcaster/blob/04625a4b67c1ad01e5d38faa3093828b360d4a98/src/bitcaster/web/templatetags/partition.py#L23-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036010", "code": "def rows_distributed(thelist, n):\n    \"\"\"\n    Break a list into ``n`` rows, distributing columns as evenly as possible\n    across the rows. For example::\n\n        >>> l = range(10)\n\n        >>> rows_distributed(l, 2)\n        [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]\n\n        >>> rows_distributed(l, 3)\n        [[0, 1, 2, 3], [4, 5, 6], [7, 8, 9]]\n\n        >>> rows_distributed(l, 4)\n        [[0, 1, 2], [3, 4, 5], [6, 7], [8, 9]]\n\n        >>> rows_distributed(l, 5)\n        [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]\n\n        >>> rows_distributed(l, 9)\n        [[0, 1], [2], [3], [4], [5], [6], [7], [8], [9]]\n\n        # This filter will always return `n` rows, even if some are empty:\n        >>> rows(range(2), 3)\n        [[0], [1], []]\n    \"\"\"\n    try:\n        n = int(n)\n        thelist = list(thelist)\n    except (ValueError, TypeError):\n        return [thelist]\n    list_len = len(thelist)\n    split = list_len // n\n\n    remainder = list_len % n\n    offset = 0\n    rows = []\n    for i in range(n):\n        if remainder:\n            start, end = (split + 1) * i, (split + 1) * (i + 1)\n        else:\n            start, end = split * i + offset, split * (i + 1) + offset\n        rows.append(thelist[start:end])\n        if remainder:\n            remainder -= 1\n            offset += 1\n    return rows", "entry_point": "rows_distributed", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "[['apple', 'banana', 'cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bitcaster-io/bitcaster/blob/04625a4b67c1ad01e5d38faa3093828b360d4a98/src/bitcaster/web/templatetags/partition.py#L62-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036011", "code": "def _optional_list(value):\n    '''Convert a value that may be a scalar (str) or list into a tuple. This\n    produces uniform output for fields that may supply a single value or list\n    of values, like the `imports` field.'''\n    if isinstance(value, str):\n        return (value, )\n    elif isinstance(value, list):\n        return tuple(value)\n\n    return None", "entry_point": "_optional_list", "input": "['apple', 'banana', 'cherry']", "output": "('apple', 'banana', 'cherry')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buildinspace/peru/blob/76e4012c6c34e85fb53a4c6d85f4ac3633d93f77/peru/parser.py#L172-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036012", "code": "def _format_file_lines(files):\n    '''Given a list of filenames that we're about to print, limit it to a\n    reasonable number of lines.'''\n    LINES_TO_SHOW = 10\n    if len(files) <= LINES_TO_SHOW:\n        lines = '\\n'.join(files)\n    else:\n        lines = ('\\n'.join(files[:LINES_TO_SHOW - 1]) + '\\n...{} total'.format(\n            len(files)))\n    return lines", "entry_point": "_format_file_lines", "input": "['apple', 'banana', 'cherry']", "output": "'apple\\nbanana\\ncherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buildinspace/peru/blob/76e4012c6c34e85fb53a4c6d85f4ac3633d93f77/peru/cache.py#L527-L536", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036013", "code": "def __is_valid_pos(pos_tuple, valid_pos):\n    # type: (Tuple[text_type,...],List[Tuple[text_type,...]])->bool\n    \"\"\"This function checks token's pos is with in POS set that user specified.\n    If token meets all conditions, Return True; else return False\n    \"\"\"\n    def is_valid_pos(valid_pos_tuple):\n        # type: (Tuple[text_type,...])->bool\n        length_valid_pos_tuple = len(valid_pos_tuple)\n        if valid_pos_tuple == pos_tuple[:length_valid_pos_tuple]:\n            return True\n        else:\n            return False\n\n    seq_bool_flags = [is_valid_pos(valid_pos_tuple) for valid_pos_tuple in valid_pos]\n\n    if True in set(seq_bool_flags):\n        return True\n    else:\n        return False", "entry_point": "__is_valid_pos", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kensuke-Mitsuzawa/JapaneseTokenizers/blob/3bdfb6be73de0f78e5c08f3a51376ad3efa00b6c/JapaneseTokenizer/datamodels.py#L25-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036014", "code": "def split_list(alist, wanted_parts=1):\n    \"\"\"\n    A = [0,1,2,3,4,5,6,7,8,9]\n\n    print split_list(A, wanted_parts=1)\n    print split_list(A, wanted_parts=2)\n    print split_list(A, wanted_parts=8)\n    \"\"\"\n    length = len(alist)\n    return [\n        alist[i * length // wanted_parts:(i + 1) * length // wanted_parts]\n        for i in range(wanted_parts)\n    ]", "entry_point": "split_list", "input": "[5, 3, 1, 4], True", "output": "[[5, 3, 1, 4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdamusic/Ontospy/blob/eb46cb13792b2b87f21babdf976996318eec7571/ontospy/core/utils.py#L70-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036015", "code": "def inferURILocalSymbol(aUri):\n    \"\"\"\n    From a URI returns a tuple (namespace, uri-last-bit)\n\n    Eg\n    from <'http://www.w3.org/2008/05/skos#something'>\n        ==> ('something', 'http://www.w3.org/2008/05/skos')\n    from <'http://www.w3.org/2003/01/geo/wgs84_pos'> we extract\n        ==> ('wgs84_pos', 'http://www.w3.org/2003/01/geo/')\n\n    \"\"\"\n    # stringa = aUri.__str__()\n    stringa = aUri\n    try:\n        ns = stringa.split(\"#\")[0]\n        name = stringa.split(\"#\")[1]\n    except:\n        if \"/\" in stringa:\n            ns = stringa.rsplit(\"/\", 1)[0]\n            name = stringa.rsplit(\"/\", 1)[1]\n        else:\n            ns = \"\"\n            name = stringa\n    return (name, ns)", "entry_point": "inferURILocalSymbol", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3], []], '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdamusic/Ontospy/blob/eb46cb13792b2b87f21babdf976996318eec7571/ontospy/core/utils.py#L651-L674", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036016", "code": "def compute_agreement_score(num_matches, num1, num2):\n    \"\"\"\n    Agreement score is used as a criteria to match unit1 and unit2.\n    \"\"\"\n    denom = num1 + num2 - num_matches\n    if denom == 0:\n        return 0\n    return num_matches / denom", "entry_point": "compute_agreement_score", "input": "5, 5, 5", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SpikeInterface/spiketoolkit/blob/f7c054383d1ebca640966b057c087fa187955d13/spiketoolkit/comparison/comparisontools.py#L25-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036017", "code": "def out_of_china(lng, lat):\n    \"\"\"\n    \u5224\u65ad\u662f\u5426\u5728\u56fd\u5185\uff0c\u4e0d\u5728\u56fd\u5185\u4e0d\u505a\u504f\u79fb\n    :param lng:\n    :param lat:\n    :return:\n    \"\"\"\n    if lng < 72.004 or lng > 137.8347:\n        return True\n    if lat < 0.8293 or lat > 55.8271:\n        return True\n    return False", "entry_point": "out_of_china", "input": "10, {'a': 1, 'b': 2}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brandonxiang/geojson-python-utils/blob/33d0dcd5f16e0567b48c0d49fd292a4f1db16b41/geojson_utils/coordTransform_utils.py#L141-L152", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036018", "code": "def get_main_version(version):\n    \"Returns main version (X.Y[.Z]) from VERSION.\"\n    parts = 2 if version[2] == 0 else 3\n    return '.'.join(str(x) for x in version[:parts])", "entry_point": "get_main_version", "input": "[[1, 2], [3], []]", "output": "'[1, 2].[3].[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rkhleics/wagtailmenus/blob/a41f240bed0d362e0d4dd4ef04a230f2b1827a93/wagtailmenus/utils/version.py#L18-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036019", "code": "def remove_duplicates(seq):\n    \"\"\"\n    Return unique elements from list while preserving order.\n    From https://stackoverflow.com/a/480227/2589328\n    \"\"\"\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if not (x in seen or seen_add(x))]", "entry_point": "remove_duplicates", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bids-standard/pybids/blob/30d924ce770622bda0e390d613a8da42a2a20c32/bids/reports/utils.py#L22-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036020", "code": "def list_to_str(lst):\n    \"\"\"\n    Turn a list into a comma- and/or and-separated string.\n\n    Parameters\n    ----------\n    lst : :obj:`list`\n        A list of strings to join into a single string.\n\n    Returns\n    -------\n    str_ : :obj:`str`\n        A string with commas and/or ands separating th elements from ``lst``.\n\n    \"\"\"\n    if len(lst) == 1:\n        str_ = lst[0]\n    elif len(lst) == 2:\n        str_ = ' and '.join(lst)\n    elif len(lst) > 2:\n        str_ = ', '.join(lst[:-1])\n        str_ += ', and {0}'.format(lst[-1])\n    else:\n        raise ValueError('List of length 0 provided.')\n    return str_", "entry_point": "list_to_str", "input": "['a', 'b', 'c']", "output": "'a, b, and c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bids-standard/pybids/blob/30d924ce770622bda0e390d613a8da42a2a20c32/bids/reports/utils.py#L43-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036021", "code": "def general_acquisition_info(metadata):\n    \"\"\"\n    General sentence on data acquisition. Should be first sentence in MRI data\n    acquisition section.\n\n    Parameters\n    ----------\n    metadata : :obj:`dict`\n        The metadata for the dataset.\n\n    Returns\n    -------\n    out_str : :obj:`str`\n        Output string with scanner information.\n    \"\"\"\n    out_str = ('MR data were acquired using a {tesla}-Tesla {manu} {model} '\n               'MRI scanner.')\n    out_str = out_str.format(tesla=metadata.get('MagneticFieldStrength',\n                                                'UNKNOWN'),\n                             manu=metadata.get('Manufacturer', 'MANUFACTURER'),\n                             model=metadata.get('ManufacturersModelName',\n                                                'MODEL'))\n    return out_str", "entry_point": "general_acquisition_info", "input": "{'x': [1, 2], 'y': []}", "output": "'MR data were acquired using a UNKNOWN-Tesla MANUFACTURER MODEL MRI scanner.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bids-standard/pybids/blob/30d924ce770622bda0e390d613a8da42a2a20c32/bids/reports/parsing.py#L22-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036022", "code": "def extract_audio_video_enabled(param, resp):\n    \"\"\"Extract if any audio/video stream enabled from response.\"\"\"\n    return 'true' in [part.split('=')[1] for part in resp.split()\n                      if '.{}Enable='.format(param) in part]", "entry_point": "extract_audio_video_enabled", "input": "[5, 3, 1, 4], '  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tchellomello/python-amcrest/blob/ed842139e234de2eaf6ee8fb480214711cde1249/src/amcrest/utils.py#L71-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036023", "code": "def composeWord(key, value):\n    \"\"\"\n    Create a attribute word from key, value pair.\n    Values are casted to api equivalents.\n    \"\"\"\n    mapping = {True: 'yes', False: 'no'}\n    # this is necesary because 1 == True, 0 == False\n    if type(value) == int:\n        value = str(value)\n    else:\n        value = mapping.get(value, str(value))\n    return '={}={}'.format(key, value)", "entry_point": "composeWord", "input": "('a', 'b', 'c'), 'a,b,c'", "output": "\"=('a', 'b', 'c')=a,b,c\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/luqasz/librouteros/blob/59293eb49c07a339af87b0416e4619e78ca5176d/librouteros/protocol.py#L19-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036024", "code": "def _is_requirement(line):\n    \"\"\"Returns whether the line is a valid package requirement.\"\"\"\n    line = line.strip()\n    return line and not (line.startswith(\"-r\") or line.startswith(\"#\"))", "entry_point": "_is_requirement", "input": "'AbC dEf'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/caktus/django-timepiece/blob/52515dec027664890efbc535429e1ba1ee152f40/setup.py#L4-L7", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036025", "code": "def closest_length(refs, pred):\n    '''\n    >>> closest_length(['1234', '12345', '1'], '123')\n    4\n    >>> closest_length(['123', '12345', '1'], '12')\n    1\n    '''\n    smallest_diff = float('inf')\n    closest_length = float('inf')\n    for ref in refs:\n        diff = abs(len(ref) - len(pred))\n        if diff < smallest_diff or (diff == smallest_diff and len(ref) < closest_length):\n            smallest_diff = diff\n            closest_length = len(ref)\n    return closest_length", "entry_point": "closest_length", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stanfordnlp/stanza/blob/920c55d8eaa1e7105971059c66eb448a74c100d6/stanza/research/bleu.py#L71-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036026", "code": "def unescape_sql(inp):\n    \"\"\"\n    :param inp: an input string to be unescaped\n    :return: return the unescaped version of the string.\n    \"\"\"\n    if inp.startswith('\"') and inp.endswith('\"'):\n        inp = inp[1:-1]\n    return inp.replace('\"\"','\"').replace('\\\\\\\\','\\\\')", "entry_point": "unescape_sql", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stanfordnlp/stanza/blob/920c55d8eaa1e7105971059c66eb448a74c100d6/stanza/util/postgres.py#L12-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036027", "code": "def _has_4gram_match(ref, pred):\n    '''\n    >>> _has_4gram_match(['four', 'lovely', 'tokens', 'here'],\n    ...                  ['four', 'lovely', 'tokens', 'here'])\n    True\n    >>> _has_4gram_match(['four', 'lovely', 'tokens', 'here'],\n    ...                  ['four', 'lovely', 'tokens', 'here', 'and', 'there'])\n    True\n    >>> _has_4gram_match(['four', 'lovely', 'tokens', 'here'],\n    ...                  ['four', 'ugly', 'tokens', 'here'])\n    False\n    >>> _has_4gram_match(['four', 'lovely', 'tokens'],\n    ...                  ['lovely', 'tokens', 'here'])\n    False\n    '''\n    if len(ref) < 4 or len(pred) < 4:\n        return False\n\n    for i in range(len(ref) - 3):\n        for j in range(len(pred) - 3):\n            if ref[i:i + 4] == pred[j:j + 4]:\n                return True\n    return False", "entry_point": "_has_4gram_match", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stanfordnlp/stanza/blob/920c55d8eaa1e7105971059c66eb448a74c100d6/stanza/research/metrics.py#L97-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036028", "code": "def parsePowerTable(uhfbandcap):\n        \"\"\"Parse the transmit power table\n\n        @param uhfbandcap: Capability dictionary from\n            self.capabilities['RegulatoryCapabilities']['UHFBandCapabilities']\n        @return: a list of [0, dBm value, dBm value, ...]\n\n        >>> LLRPClient.parsePowerTable({'TransmitPowerLevelTableEntry1': \\\n            {'Index': 1, 'TransmitPowerValue': 3225}})\n        [0, 32.25]\n        >>> LLRPClient.parsePowerTable({})\n        [0]\n        \"\"\"\n        bandtbl = {k: v for k, v in uhfbandcap.items()\n                   if k.startswith('TransmitPowerLevelTableEntry')}\n        tx_power_table = [0] * (len(bandtbl) + 1)\n        for k, v in bandtbl.items():\n            idx = v['Index']\n            tx_power_table[idx] = int(v['TransmitPowerValue']) / 100.0\n\n        return tx_power_table", "entry_point": "parsePowerTable", "input": "{'a': 1, 'b': 2}", "output": "[0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ransford/sllurp/blob/d744b7e17d7ba64a24d9a31bde6cba65d91ad9b1/sllurp/llrp.py#L1143-L1163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036029", "code": "def merge_resources(resource1, resource2):\n    \"\"\"\n    Updates a copy of resource1 with resource2 values and returns the merged dictionary.\n\n    Args:\n        resource1: original resource\n        resource2: resource to update resource1\n\n    Returns:\n        dict: merged resource\n    \"\"\"\n    merged = resource1.copy()\n    merged.update(resource2)\n    return merged", "entry_point": "merge_resources", "input": "set(), {1, 2, 3}", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1737-L1750", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036030", "code": "def transform_list_to_dict(list):\n    \"\"\"\n        Transforms a list into a dictionary, putting values as keys\n    Args:\n        id:\n    Returns:\n        dict: dictionary built\n    \"\"\"\n\n    ret = {}\n\n    for value in list:\n        if isinstance(value, dict):\n            ret.update(value)\n        else:\n            ret[str(value)] = True\n\n    return ret", "entry_point": "transform_list_to_dict", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': True, 'banana': True, 'cherry': True}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1772-L1789", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036031", "code": "def remove_vectored_io_slice_suffix_from_name(name, slice):\n    # type: (str, int) -> str\n    \"\"\"Remove vectored io (stripe) slice suffix from a given name\n    :param str name: entity name\n    :param int slice: slice num\n    :rtype: str\n    :return: name without suffix\n    \"\"\"\n    suffix = '.bxslice-{}'.format(slice)\n    if name.endswith(suffix):\n        return name[:-len(suffix)]\n    else:\n        return name", "entry_point": "remove_vectored_io_slice_suffix_from_name", "input": "'a,b,c', []", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Azure/blobxfer/blob/3eccbe7530cc6a20ab2d30f9e034b6f021817f34/blobxfer/models/metadata.py#L208-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036032", "code": "def import_split(import_name):\n    \"\"\" takes a dotted string path and returns the components:\n        import_split('path') == 'path', None, None\n        import_split('path.part.object') == 'path.part', 'object', None\n        import_split('path.part:object') == 'path.part', 'object', None\n        import_split('path.part:object.attribute')\n            == 'path.part', 'object', 'attribute'\n    \"\"\"\n    obj = None\n    attr = None\n    if ':' in import_name:\n        module, obj = import_name.split(':', 1)\n        if '.' in obj:\n            obj, attr = obj.rsplit('.', 1)\n    elif '.' in import_name:\n        module, obj = import_name.rsplit('.', 1)\n    else:\n        module = import_name\n    return module, obj, attr", "entry_point": "import_split", "input": "'abc'", "output": "('abc', None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blazelibs/blazeutils/blob/c94476325146007553cbddeeb9ef83394756babf/blazeutils/importing.py#L57-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036033", "code": "def unquote_header_value(value):\n    r\"\"\"Unquotes a header value.  (Reversal of :func:`quote_header_value`).\n    This does not use the real unquoting but what browsers are actually\n    using for quoting.\n\n    :param value: the header value to unquote.\n    \"\"\"\n    if value and value[0] == value[-1] == '\"':\n        # this is not the real unquoting, but fixing this so that the\n        # RFC is met will result in bugs with internet explorer and\n        # probably some other browsers as well.  IE for example is\n        # uploading files with \"C:\\foo\\bar.txt\" as filename\n        value = value[1:-1].replace('\\\\\\\\', '\\\\').replace('\\\\\"', '\"')\n    return value", "entry_point": "unquote_header_value", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ericflo/hurricane/blob/c192b711b2b1c06a386d1a1a47f538b13a659cde/hurricane/handlers/comet/utils.py#L10-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036034", "code": "def _indexOfEndTag(istack):\n    \"\"\"\n    Go through `istack` and search endtag. Element at first index is considered\n    as opening tag.\n\n    Args:\n        istack (list): List of :class:`.HTMLElement` objects.\n\n    Returns:\n        int: Index of end tag or 0 if not found.\n    \"\"\"\n    if len(istack) <= 0:\n        return 0\n\n    if not istack[0].isOpeningTag():\n        return 0\n\n    cnt = 0\n    opener = istack[0]\n    for index, el in enumerate(istack[1:]):\n        if el.isOpeningTag() and \\\n           el.getTagName().lower() == opener.getTagName().lower():\n            cnt += 1\n\n        elif el.isEndTagTo(opener):\n            if cnt == 0:\n                return index + 1\n\n            cnt -= 1\n\n    return 0", "entry_point": "_indexOfEndTag", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bystroushaak/pyDHTMLParser/blob/4756f93dd048500b038ece2323fe26e46b6bfdea/src/dhtmlparser/__init__.py#L153-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036035", "code": "def str_to_num(i, exact_match=True):\n    \"\"\"\n    Attempts to convert a str to either an int or float\n    \"\"\"\n    # TODO: Cleanup -- this is really ugly\n    if not isinstance(i, str):\n        return i\n    try:\n        if not exact_match:\n            return int(i)\n        elif str(int(i)) == i:\n            return int(i)\n        elif str(float(i)) == i:\n            return float(i)\n        else:\n            pass\n    except ValueError:\n        pass\n    return i", "entry_point": "str_to_num", "input": "['a', 'b', 'c'], [[1, 2], [3], []]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rtluckie/seria/blob/8ae4f71237e69085d8f974a024720f45b34ab963/seria/utils.py#L3-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036036", "code": "def make_link(title, url, blank=False):\n\t\"\"\"\n\tMake a HTML link out of an URL.\n\n\tArgs:\n\t  title (str): Text to show for the link.\n\t  url (str): URL the link will point to.\n\t  blank (bool): If True, appends target=_blank, noopener and noreferrer to\n\t    the <a> element. Defaults to False.\n\t\"\"\"\n\tattrs = 'href=\"%s\"' % url\n\tif blank:\n\t\tattrs += ' target=\"_blank\" rel=\"noopener noreferrer\"'\n\treturn '<a %s>%s</a>' % (attrs, title)", "entry_point": "make_link", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c'], [[1, 2], [3], []]", "output": "'<a href=\"[\\'a\\', \\'b\\', \\'c\\']\" target=\"_blank\" rel=\"noopener noreferrer\">[\\'apple\\', \\'banana\\', \\'cherry\\']</a>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/anlutro/russell/blob/6e4a95929f031926d3acd5d9e6c9ca7bb896b1b5/russell/engine.py#L27-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036037", "code": "def splitter(structured):\n    \"\"\"\n    Separates structured data into a list of actives or a list of decoys. actives are labeled with a '1' in their status\n    fields, while decoys are labeled with a '0' in their status fields.\n    :param structured: either roc_structure or score_structure.\n    roc_structure: list [(id, best_score, best_query, status, fpf, tpf), ..., ]\n    score_structure: list [(id, best_score, best_query, status, net decoy count, net active count), ...,]\n    :return: actives: list [(id, best_score, best_query, status = 1, fpf/net decoy count, tpf/net active count), ..., ]\n    :return decoys: list [(id, best_score, best_query, status = 0, fpf/net decoy count, tpf/net active count), ..., ]\n    \"\"\"\n\n    actives = []\n    decoys = []\n    for mol in structured:\n        status = mol[3]\n        if status == '1':\n            actives.append(mol)\n        elif status == '0':\n            decoys.append(mol)\n    return actives, decoys", "entry_point": "splitter", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rvswift/EB/blob/341880b79faf8147dc9fa6e90438531cd09fabcc/EB/builder/utilities/classification.py#L40-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036038", "code": "def make_auc_structure(score_structure):\n    \"\"\"\n    calculates ROC data points and returns roc_structure, a modified form of the score_structure format\n    :param score_structure: list [(id, best_score, best_query, status, net decoy count, net active count), ..., ]\n    :return auc_structure: list [(id, best_score, best_query, status, fpf, tpf), ..., ]\n    \"\"\"\n\n    n = len([x for x in score_structure if x[3] == '0'])   # Total no. of decoys\n    p = len([x for x in score_structure if x[3] == '1'])   # Total no. of actives\n\n    auc_structure = []\n\n    for mol in score_structure:\n        if n == 0:\n            fpf = 0\n        else:\n            fpf = float(mol[4]) / n\n        if p == 0:\n            tpf = 0\n        else:\n            tpf = float(mol[5]) / p\n        tup = mol[0:4] + (fpf, tpf)\n        auc_structure.append(tup)\n\n    return auc_structure", "entry_point": "make_auc_structure", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rvswift/EB/blob/341880b79faf8147dc9fa6e90438531cd09fabcc/EB/builder/utilities/classification.py#L461-L485", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036039", "code": "def list_replace(iterable, src, dst):\n    \"\"\"\n    Thanks to \"EyDu\":\n        http://www.python-forum.de/viewtopic.php?f=1&t=34539 (de)\n    \n    >>> list_replace([1,2,3], (1,2), \"X\")\n    ['X', 3]\n    \n    >>> list_replace([1,2,3,4], (2,3), 9)\n    [1, 9, 4]\n    \n    >>> list_replace([1,2,3], (2,), [9,8])\n    [1, 9, 8, 3]\n    \n    >>> list_replace([1,2,3,4,5], (2,3,4), \"X\")\n    [1, 'X', 5]\n    \n    >>> list_replace([1,2,3,4,5], (4,5), \"X\")\n    [1, 2, 3, 'X']\n    \n    >>> list_replace([1,2,3,4,5], (1,2), \"X\")\n    ['X', 3, 4, 5]\n    \n    >>> list_replace([1,2,3,3,3,4,5], (3,3), \"X\")\n    [1, 2, 'X', 3, 4, 5]\n\n    >>> list_replace([1,2,3,3,3,4,5], (3,3), (\"A\",\"B\",\"C\"))\n    [1, 2, 'A', 'B', 'C', 3, 4, 5]\n    \n    >>> list_replace((58, 131, 73, 70), (58, 131), 131)\n    [131, 73, 70]\n    \"\"\"\n    result=[]\n    iterable=list(iterable)\n    \n    try:\n        dst=list(dst)\n    except TypeError: # e.g.: int\n        dst=[dst]\n        \n    src=list(src)\n    src_len=len(src)\n    index = 0\n    while index < len(iterable):\n        element = iterable[index:index+src_len]\n#         print element, src\n        if element == src:\n            result += dst\n            index += src_len\n        else:\n            result.append(iterable[index])\n            index += 1\n    return result", "entry_point": "list_replace", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/6809/dragonlib/blob/faa4011e76c5857db96efdb4199e2fd49711e999/dragonlib/utils/iter_utils.py#L24-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036040", "code": "def unescape(inp, quote='\"'):\n    \"\"\"\n    Unescape `quote` in string `inp`.\n\n    Example usage::\n\n        >> unescape('hello \\\\\"')\n        'hello \"'\n\n    Args:\n        inp (str): String in which `quote` will be unescaped.\n        quote (char, default \"): Specify which character will be unescaped.\n\n    Returns:\n        str: Unescaped string.\n    \"\"\"\n    if len(inp) < 2:\n        return inp\n\n    output = \"\"\n    unesc = False\n    for act in inp:\n        if act == quote and unesc:\n            output = output[:-1]\n\n        output += act\n\n        if act == \"\\\\\":\n            unesc = not unesc\n        else:\n            unesc = False\n\n    return output", "entry_point": "unescape", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bystroushaak/pyDHTMLParser/blob/4756f93dd048500b038ece2323fe26e46b6bfdea/src/dhtmlparser/quoter.py#L13-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036041", "code": "def escape(inp, quote='\"'):\n    \"\"\"\n    Escape `quote` in string `inp`.\n\n    Example usage::\n\n        >>> escape('hello \"')\n        'hello \\\\\"'\n        >>> escape('hello \\\\\"')\n        'hello \\\\\\\\\"'\n\n    Args:\n        inp (str): String in which `quote` will be escaped.\n        quote (char, default \"): Specify which character will be escaped.\n\n    Returns:\n        str: Escaped string.\n    \"\"\"\n    output = \"\"\n\n    for c in inp:\n        if c == quote:\n            output += '\\\\'\n\n        output += c\n\n    return output", "entry_point": "escape", "input": "[], [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Bystroushaak/pyDHTMLParser/blob/4756f93dd048500b038ece2323fe26e46b6bfdea/src/dhtmlparser/quoter.py#L48-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036042", "code": "def parse_array(raw_array):\n    \"\"\"Parse a WMIC array.\"\"\"\n    array_strip_brackets = raw_array.replace('{', '').replace('}', '')\n    array_strip_spaces = array_strip_brackets.replace('\"', '').replace(' ', '')\n    return array_strip_spaces.split(',')", "entry_point": "parse_array", "input": "'AbC dEf'", "output": "['AbCdEf']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TNThieding/win-nic/blob/599c22ad2849f2677185e547e84fea8ae74984c4/win_nic/utils.py#L20-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036043", "code": "def llcs(s1, s2):\n    '''length of the longest common sequence\n\n    This implementation takes O(len(s1) * len(s2)) time and\n    O(min(len(s1), len(s2))) space.\n\n    Use only with short strings.\n\n    >>> llcs('a.b.cd','!a!b!c!!!d!')\n    4\n    '''\n    m, n = len(s1), len(s2)\n    if m < n:  # ensure n <= m, to use O(min(n,m)) space\n        m, n = n, m\n        s1, s2 = s2, s1\n    l = [0] * (n+1)\n    for i in range(m):\n        p = 0\n        for j in range(n):\n            t = 1 if s1[i] == s2[j] else 0\n            p, l[j+1] = l[j+1], max(p+t, l[j], l[j+1])\n    return l[n]", "entry_point": "llcs", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/luismsgomes/stringology/blob/c627dc5a0d4c6af10946040a6463d5495d39d960/src/stringology/lcs.py#L3-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036044", "code": "def lcp(s1, s2):\n    '''longest common prefix\n\n    >>> lcp('abcdx', 'abcdy'), lcp('', 'a'), lcp('x', 'yz')\n    (4, 0, 0)\n    '''\n    i = 0\n    for i, (c1, c2) in enumerate(zip(s1, s2)):\n        if c1 != c2:\n            return i\n    return min(len(s1), len(s2))", "entry_point": "lcp", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/luismsgomes/stringology/blob/c627dc5a0d4c6af10946040a6463d5495d39d960/src/stringology/lcs.py#L38-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036045", "code": "def _clean_arguments(kwargs):\n        \"\"\"\n        This is to remove None and clean other arguments\n        :param kwargs:\n        :return:\n        \"\"\"\n        if not isinstance(kwargs, dict):\n            return kwargs\n        for k in list(kwargs.keys()):\n            if kwargs[k] is None:\n                kwargs.pop(k)\n            elif kwargs[k] is False:\n                kwargs[k] = 0\n            elif kwargs[k] is True:\n                kwargs[k] = 1\n        return kwargs", "entry_point": "_clean_arguments", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SeabornGames/RequestClient/blob/21aeb951ddfdb6ee453ad0edc896ff224e06425d/seaborn/request_client/connection_basic.py#L369-L384", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036046", "code": "def ed(s1, s2):\n    '''edit distance\n\n    >>> ed('', ''), ed('a', 'a'), ed('','a'), ed('a', ''), ed('a!a', 'a.a')\n    (0, 0, 1, 1, 1)\n\n    This implementation takes only O(min(|s1|,|s2|)) space.\n    '''\n    m, n = len(s1), len(s2)\n    if m < n:\n        m, n = n, m         # ensure n <= m, to use O(min(n,m)) space\n        s1, s2 = s2, s1\n    d = list(range(n+1))\n    for i in range(m):\n        p = i\n        d[0] = i+1\n        for j in range(n):\n            t = 0 if s1[i] == s2[j] else 1\n            p, d[j+1] = d[j+1], min(p+t, d[j]+1, d[j+1]+1)\n    return d[n]", "entry_point": "ed", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/luismsgomes/stringology/blob/c627dc5a0d4c6af10946040a6463d5495d39d960/src/stringology/ed.py#L3-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036047", "code": "def get_sort_order(molecules):\n    \"\"\"\n\tCount up the total number of scores whose values are positve and negative.\n\tIf a greater number are negative, then sort in ascending order (e.g. for binding energy estimates)\n\tOtherwise, sort in descending order (e.g. for similarity values)\n\t\"\"\"\n\n    neg_count = 0\n    pos_count = 0\n\n    for index in range(len(molecules)):\n\n        scoreList = molecules[index].GetProp('scores')\n        for element in scoreList:\n            if float(element) > 0:\n                pos_count += 1\n            elif float(element) < 0:\n                neg_count += 1\n\n    if pos_count > neg_count:\n        sort_order = 'dsc'\n    else:\n        sort_order = 'asc'\n\n    return sort_order", "entry_point": "get_sort_order", "input": "[]", "output": "'asc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rvswift/EB/blob/341880b79faf8147dc9fa6e90438531cd09fabcc/EB/builder/utilities/performance.py#L5-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036048", "code": "def partition(string, sep):\n    \"\"\"\n    New in Python 2.5 as str.partition(sep)\n    \"\"\"\n    p = string.split(sep, 1)\n    if len(p) == 2:\n        return p[0], sep, p[1]\n    return string, '', ''", "entry_point": "partition", "input": "'  padded  ', '  padded  '", "output": "('', '  padded  ', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/gtkmvc3/controller.py#L39-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036049", "code": "def res_set_to_phenotype(res_set, full_list):\n    \"\"\"\n    Converts a set of strings indicating resources to a binary string where\n    the positions of 1s indicate which resources are present.\n\n    Inputs: res_set - a set of strings indicating which resources are present\n            full_list - a list of strings indicating all resources which could\n                        could be present, and the order in which they should\n                        map to bits in the phenotype\n    returns: A binary string\n    \"\"\"\n\n    full_list = list(full_list)\n    phenotype = len(full_list) * [\"0\"]\n\n    for i in range(len(full_list)):\n        if full_list[i] in res_set:\n            phenotype[i] = \"1\"\n\n    assert(phenotype.count(\"1\") == len(res_set))\n\n    # Remove uneceesary leading 0s\n    while phenotype[0] == \"0\" and len(phenotype) > 1:\n        phenotype = phenotype[1:]\n\n    return \"0b\"+\"\".join(phenotype)", "entry_point": "res_set_to_phenotype", "input": "[], [1, 2, 3]", "output": "'0b0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/utils.py#L244-L269", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036050", "code": "def weighted_hamming(b1, b2):\n    \"\"\"\n    Hamming distance that emphasizes differences earlier in strings.\n    \"\"\"\n    assert(len(b1) == len(b2))\n    hamming = 0\n    for i in range(len(b1)):\n        if b1[i] != b2[i]:\n            # differences at more significant (leftward) bits\n            # are more important\n            if i > 0:\n                hamming += 1 + 1.0/i\n                # This weighting is completely arbitrary\n    return hamming", "entry_point": "weighted_hamming", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "3.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/utils.py#L272-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036051", "code": "def n_tasks(dec_num):\n    \"\"\"\n    Takes a decimal number as input and returns the number of ones in the\n    binary representation.\n    This translates to the number of tasks being done by an organism with a\n    phenotype represented as a decimal number.\n    \"\"\"\n    bitstring = \"\"\n    try:\n        bitstring = dec_num[2:]\n    except:\n        bitstring = bin(int(dec_num))[2:]  # cut off 0b\n    # print bin(int(dec_num)), bitstring\n    return bitstring.count(\"1\")", "entry_point": "n_tasks", "input": "-3", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/utils.py#L288-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036052", "code": "def are_equal(value1, value2):\n        \"\"\"\n        Checks if two values are equal. The operation can be performed over values of any type.\n\n        :param value1: the first value to compare\n\n        :param value2: the second value to compare\n\n        :return: true if values are equal and false otherwise\n        \"\"\"\n        if value1 == None or value2 == None:\n            return True\n        if value1 == None or value2 == None:\n            return False\n        return value1 == value2", "entry_point": "are_equal", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/validate/ObjectComparator.py#L62-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036053", "code": "def is_indel(reference_bases, alternate_bases):\n    \"\"\" Return whether or not the variant is an INDEL \"\"\"\n    if len(reference_bases) > 1:\n        return True\n    for alt in alternate_bases:\n        if alt is None:\n            return True\n        elif len(alt) != len(reference_bases):\n            return True\n    return False", "entry_point": "is_indel", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Phelimb/ga4gh-mongo/blob/5f5a3e1922be0e0d13af1874fad6eed5418ee761/ga4ghmongo/schema/models/variants.py#L268-L277", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036054", "code": "def is_snp(reference_bases, alternate_bases):\n    \"\"\" Return whether or not the variant is a SNP \"\"\"\n    if len(reference_bases) > 1:\n        return False\n    for alt in alternate_bases:\n        if alt is None:\n            return False\n        if alt not in ['A', 'C', 'G', 'T', 'N', '*']:\n            return False\n    return True", "entry_point": "is_snp", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Phelimb/ga4gh-mongo/blob/5f5a3e1922be0e0d13af1874fad6eed5418ee761/ga4ghmongo/schema/models/variants.py#L280-L289", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036055", "code": "def _error_repr(error):\n    \"\"\"A compact unique representation of an error.\"\"\"\n    error_repr = repr(error)\n    if len(error_repr) > 200:\n        error_repr = hash(type(error))\n    return error_repr", "entry_point": "_error_repr", "input": "['apple', 'banana', 'cherry']", "output": "\"['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/humilis/humilis-lambdautils/blob/58f75eb5ace23523c283708d56a9193181ea7e8e/lambdautils/utils.py#L105-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036056", "code": "def unpack_int(s):\n    \"\"\" Reads a packed integer from string <s> \"\"\"\n    ret = 0\n    i = 0\n    while True:\n        b = ord(s[i])\n        ret |= (b & 127) << (i * 7)\n        i += 1\n        if b & 128 == 0:\n            break\n    return ret", "entry_point": "unpack_int", "input": "'a,b,c'", "output": "97", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwesterb/sarah/blob/a9e46e875dfff1dc11255d714bb736e5eb697809/src/pack.py#L1-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036057", "code": "def unindent(lines):\n    '''Convert an iterable of indented lines into a sequence of tuples.\n\n    The first element of each tuple is the indent in number of characters, and\n    the second element is the unindented string.\n\n    Args:\n        lines: A sequence of strings representing the lines of text in a docstring.\n\n    Returns:\n        A list of tuples where each tuple corresponds to one line of the input\n        list. Each tuple has two entries - the first is an integer giving the\n        size of the indent in characters, the second is the unindented text.\n    '''\n    unindented_lines = []\n    for line in lines:\n        unindented_line = line.lstrip()\n        indent = len(line) - len(unindented_line)\n        unindented_lines.append((indent, unindented_line))\n    return unindented_lines", "entry_point": "unindent", "input": "'  padded  '", "output": "[(1, ''), (1, ''), (0, 'p'), (0, 'a'), (0, 'd'), (0, 'd'), (0, 'e'), (0, 'd'), (1, ''), (1, '')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rob-smallshire/cartouche/blob/d45a8fc1fb4820bf8e741a70a8d5dafe5d26b43a/cartouche/parser.py#L51-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036058", "code": "def pad_blank_lines(indent_texts):\n    '''Give blank (empty) lines the same indent level as the preceding line.\n\n    Args:\n        indent_texts: An iterable of tuples each containing an integer in the\n            first element and a string in the second element.\n\n    Returns:\n        A list of tuples each containing an integer in the first element and a\n        string in the second element.\n    '''\n    current_indent = 0\n    result = []\n    for indent, text in indent_texts:\n        if len(text) > 0:\n            current_indent = indent\n        result.append((current_indent, text))\n    return result", "entry_point": "pad_blank_lines", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rob-smallshire/cartouche/blob/d45a8fc1fb4820bf8e741a70a8d5dafe5d26b43a/cartouche/parser.py#L73-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036059", "code": "def determine_opening_indent(indent_texts):\n    '''Determine the opening indent level for a docstring.\n\n    The opening indent level is the indent level is the first non-zero indent\n    level of a non-empty line in the docstring.\n\n    Args:\n        indent_texts: The lines of the docstring as an iterable over 2-tuples\n            each containing an integer indent level as the first element and\n            the text as the second element.\n\n    Returns:\n        The opening indent level as an integer.\n    '''\n    num_lines = len(indent_texts)\n\n    if num_lines < 1:\n        return 0\n\n    assert num_lines >= 1\n\n    first_line_indent  = indent_texts[0][0]\n\n    if num_lines == 1:\n        return first_line_indent\n\n    assert num_lines >= 2\n\n    second_line_indent = indent_texts[1][0]\n    second_line_text   = indent_texts[1][1]\n\n    if len(second_line_text) == 0:\n        return first_line_indent\n\n    return second_line_indent", "entry_point": "determine_opening_indent", "input": "''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rob-smallshire/cartouche/blob/d45a8fc1fb4820bf8e741a70a8d5dafe5d26b43a/cartouche/parser.py#L405-L439", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036060", "code": "def attribute(element, attribute, default=None):\n    \"\"\"\n    Returns the value of an attribute, or a default if it's not defined\n    :param element: The XML Element object\n    :type  element: etree._Element\n\n    :param attribute: The name of the attribute to evaluate\n    :type  attribute: basestring\n\n    :param default: The default value to return if the attribute is not defined\n    \"\"\"\n    attribute_value = element.get(attribute)\n\n    return attribute_value if attribute_value is not None else default", "entry_point": "attribute", "input": "{'a': 1, 'b': 2}, 'a,b,c', ('a', 'b', 'c')", "output": "('a', 'b', 'c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/FujiMakoto/AgentML/blob/c8cb64b460d876666bf29ea2c682189874c7c403/agentml/common.py#L64-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036061", "code": "def int_attribute(element, attribute, default=0):\n    \"\"\"\n    Returns the int value of an attribute, or a default if it's not defined\n    :param element: The XML Element object\n    :type  element: etree._Element\n\n    :param attribute: The name of the attribute to evaluate\n    :type  attribute: basestring\n\n    :param default: The default value to return if the attribute is not defined\n    :type  default: int\n\n    :rtype: int\n    \"\"\"\n    attribute_value = element.get(attribute)\n\n    if attribute_value:\n        try:\n            return int(attribute_value)\n        except (TypeError, ValueError):\n            return default\n\n    return default", "entry_point": "int_attribute", "input": "{'x': [1, 2], 'y': []}, 2.0, 5", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/FujiMakoto/AgentML/blob/c8cb64b460d876666bf29ea2c682189874c7c403/agentml/common.py#L102-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036062", "code": "def rows_to_columns(matrix):\n#hammer\n    \"\"\"Takes a two dimensional array and returns an new one where rows in the\n    first become columns in the second.\"\"\"\n    num_rows = len(matrix)\n    num_cols = len(matrix[0])\n\n    data = []\n    for i in range(0, num_cols):\n        data.append([matrix[j][i] for j in range(0, num_rows)])\n\n    return data", "entry_point": "rows_to_columns", "input": "'walnut thistle harbour'", "output": "[['w', 'a', 'l', 'n', 'u', 't', ' ', 't', 'h', 'i', 's', 't', 'l', 'e', ' ', 'h', 'a', 'r', 'b', 'o', 'u', 'r']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltrudeau/wrench/blob/bc231dd085050a63a87ff3eb8f0a863928f65a41/wrench/utils.py#L322-L333", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036063", "code": "def reduce_resource_name_to_task(res_name):\n    \"\"\"\n    Assuming that the convention of naming resources associated with tasks as\n    res[TASK][number], reduces such resource names to just the name of the\n    task. This ensures that multiple copies of the same resource are treated\n    the same. Resource names of different formats will be left untouched.\n    \"\"\"\n    # Reduce resource names to tasks being rewarded\n    if res_name[:3].lower() != \"res\":\n        return res_name\n    res_name = res_name[3:].lower()\n    while res_name[-1].isdigit():\n        res_name = res_name[:-1]\n    return res_name", "entry_point": "reduce_resource_name_to_task", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/parse_files.py#L127-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036064", "code": "def hex_to_rgb(hex_value):\n    \"\"\"\n    expects: hex value, ex: #ffffff\n    returns: rgb value, ex: ff00/ff00/ff00\n    \"\"\"\n    if '#' in hex_value:\n        hex_value = hex_value.replace('#', '')\n    if len(hex_value) < 6:\n        return '0000/0000/0000'\n    r = hex_value[:2]\n    g = hex_value[2:4]\n    b = hex_value[4:]\n    return r + '00/' + g + '00/' + b + '00'", "entry_point": "hex_to_rgb", "input": "[5, 3, 1, 4]", "output": "'0000/0000/0000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gnullByte/dotcolors/blob/4b09ff9862b88b3125fe9cd86aa054694ed3e46e/dotcolors/utils.py#L66-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036065", "code": "def decimal_to_alpha(dec):\n    \"\"\"\n    expects: decimal between 0 and 100\n    returns: alpha value for rgba\n    \"\"\"\n    dec /= 100.0\n    alpha =  hex(int(dec*65535))[2:]\n    while len(alpha) < 4:\n        alpha = '0' + alpha\n    return alpha", "entry_point": "decimal_to_alpha", "input": "7", "output": "'11eb'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gnullByte/dotcolors/blob/4b09ff9862b88b3125fe9cd86aa054694ed3e46e/dotcolors/utils.py#L81-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036066", "code": "def create_order_keyword_list(keywords):\n    \"\"\"\n    Takes a given keyword list and returns a ready-to-go\n    list of possible ordering values.\n\n    Example: ['foo'] returns [('foo', ''), ('-foo', '')]\n    \"\"\" \n    result = []\n    for keyword in keywords:\n        result.append((keyword, ''))\n        result.append(('-%s' % keyword, ''))\n    return result", "entry_point": "create_order_keyword_list", "input": "[-1, 0, 1, 2]", "output": "[(-1, ''), ('--1', ''), (0, ''), ('-0', ''), (1, ''), ('-1', ''), (2, ''), ('-2', '')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/siemens/django-dingos/blob/7154f75b06d2538568e2f2455a76f3d0db0b7d70/dingos/filter.py#L36-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036067", "code": "def is_int_like(value):\n    \"\"\"Returns whether the value can be used as a standard integer.\n\n        >>> is_int_like(4)\n        True\n        >>> is_int_like(4.0)\n        False\n        >>> is_int_like(\"4\")\n        False\n        >>> is_int_like(\"abc\")\n        False\n\n    \"\"\"\n    try:\n        if isinstance(value, int): return True\n        return int(value) == value and str(value).isdigit()\n    except:\n        return False", "entry_point": "is_int_like", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cyrus-/cypy/blob/04bb59e91fa314e8cf987743189c77a9b6bc371d/cypy/__init__.py#L583-L600", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036068", "code": "def is_float_like(value):\n    \"\"\"Returns whether the value acts like a standard float.\n\n        >>> is_float_like(4.0)\n        True\n        >>> is_float_like(numpy.float32(4.0))\n        True\n        >>> is_float_like(numpy.int32(4.0))\n        False\n        >>> is_float_like(4)\n        False\n\n    \"\"\"\n    try:\n        if isinstance(value, float): return True\n        return float(value) == value and not str(value).isdigit()\n    except:\n        return False", "entry_point": "is_float_like", "input": "[1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cyrus-/cypy/blob/04bb59e91fa314e8cf987743189c77a9b6bc371d/cypy/__init__.py#L602-L619", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036069", "code": "def make_symmetric(dict):\n    \"\"\"Makes the given dictionary symmetric. Values are assumed to be unique.\"\"\"\n    for key, value in list(dict.items()):\n        dict[value] = key\n    return dict", "entry_point": "make_symmetric", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cyrus-/cypy/blob/04bb59e91fa314e8cf987743189c77a9b6bc371d/cypy/__init__.py#L657-L661", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036070", "code": "def to_nullable_array(value):\n        \"\"\"\n        Converts value into array object.\n        Single values are converted into arrays with a single element.\n\n        :param value: the value to convert.\n\n        :return: array object or None when value is None.\n        \"\"\"\n        # Shortcuts\n        if value == None:\n            return None\n        if type(value) == list:\n            return value \n\n        if type(value) in [tuple, set]:\n            return list(value)\n            \n        return [value]", "entry_point": "to_nullable_array", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/convert/ArrayConverter.py#L23-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036071", "code": "def list_to_array(value):\n        \"\"\"\n        Converts value into array object with empty array as default.\n        Strings with comma-delimited values are split into array of strings.\n\n        :param value: the list to convert.\n\n        :return: array object or empty array when value is None\n        \"\"\"\n        if value == None:\n            return []\n        elif type(value) in [list, tuple, set]:\n            return list(value)\n        elif type(value) in [str]:\n            return value.split(',')\n        else:\n            return [value]", "entry_point": "list_to_array", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/convert/ArrayConverter.py#L71-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036072", "code": "def isprime(n):\n    \"\"\"Check the number is prime value. if prime value returns True, not False.\"\"\"\n    n = abs(int(n))\n\n    if n < 2:\n        return False\n    if n == 2:\n        return True\n    if not n & 1:\n        return False\n\n    # \u5728\u4e00\u822c\u9886\u57df, \u5bf9\u6b63\u6574\u6570n, \u5982\u679c\u75282 \u5230 sqrt(n) \u4e4b\u95f4\u6240\u6709\u6574\u6570\u53bb\u9664, \u5747\u65e0\u6cd5\u6574\u9664, \u5219n\u4e3a\u8d28\u6570.\n    for x in range(3, int(n ** 0.5)+1, 2):\n        if n % x == 0:\n            return False\n\n    return True", "entry_point": "isprime", "input": "1", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Vito2015/pyextend/blob/36861dfe1087e437ffe9b5a1da9345c85b4fa4a1/pyextend/core/math.py#L12-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036073", "code": "def remove_elements(target, indices):\n    \"\"\"Remove multiple elements from a list and return result.\n    This implementation is faster than the alternative below.\n    Also note the creation of a new list to avoid altering the\n    original. We don't have any current use for the original\n    intact list, but may in the future...\"\"\"\n\n    copied = list(target)\n\n    for index in reversed(indices):\n        del copied[index]\n    return copied", "entry_point": "remove_elements", "input": "{1, 2, 3}, (1, 2)", "output": "[1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brbsix/subnuker/blob/a94260a6e84b790a9e39e0b1793443ffd4e1f496/subnuker.py#L574-L585", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036074", "code": "def cycle_slice(sliceable, start, end):\n    \"\"\"Given a list, return right hand cycle direction slice from start to end.\n\n    Usage::\n\n        >>> array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n        >>> cycle_slice(array, 4, 7) # from array[4] to array[7]\n        [4, 5, 6, 7]\n\n        >>> cycle_slice(array, 8, 2) # from array[8] to array[2]\n        [8, 9, 0, 1, 2]\n    \"\"\"\n    if type(sliceable) != list:\n        sliceable = list(sliceable)\n\n    if end >= start:\n        return sliceable[start:end+1]\n    else:\n        return sliceable[start:] + sliceable[:end+1]", "entry_point": "cycle_slice", "input": "[[1, 2], [3], []], 10, 1", "output": "[[1, 2], [3]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/algorithm/iterable.py#L237-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036075", "code": "def count_generator(generator, memory_efficient=True):\n    \"\"\"Count number of item in generator.\n\n    memory_efficient=True, 3 times slower, but memory_efficient.\n    memory_efficient=False, faster, but cost more memory.\n    \"\"\"\n    if memory_efficient:\n        counter = 0\n        for _ in generator:\n            counter += 1\n        return counter\n    else:\n        return len(list(generator))", "entry_point": "count_generator", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/algorithm/iterable.py#L364-L376", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036076", "code": "def _decode(frame, tab):\n        \"\"\"Decode a frame with the help of the table.\"\"\"\n\n        blocks = []\n\n        # Decode each block\n        while frame:\n            length, endseq = tab[frame[0]]\n            blocks.extend([frame[1:length], endseq])\n            frame = frame[length:]\n\n        # Remove one (and only one) trailing '\\0' as necessary\n        if blocks and len(blocks[-1]) > 0:\n            blocks[-1] = blocks[-1][:-1]\n\n        # Return the decoded plaintext\n        return ''.join(blocks)", "entry_point": "_decode", "input": "[], ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klmitch/tendril/blob/207102c83e88f8f1fa7ba605ef0aab2ae9078b36/tendril/framers.py#L547-L563", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036077", "code": "def dot_v3(v, w):\n    \"\"\"Return the dotproduct of two vectors.\"\"\"\n\n    return sum([x * y for x, y in zip(v, w)])", "entry_point": "dot_v3", "input": "[-1, 0, 1, 2], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/olsoneric/pedemath/blob/4bffcfe7089e421d603eb0a9708b84789c2d16be/pedemath/vec3.py#L73-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036078", "code": "def format_data(data):\n    \"\"\"\n    Format bytes for printing\n\n    :param data: Bytes\n    :type data: None | bytearray | str\n    :return: Printable version\n    :rtype: unicode\n    \"\"\"\n    if data is None:\n        return None\n    return u\":\".join([u\"{:02x}\".format(ord(c)) for c in data])", "entry_point": "format_data", "input": "('a', 'b', 'c')", "output": "'61:62:63'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/the01/python-paps/blob/2dde5a71913e4c7b22901cf05c6ecedd890919c4/paps/si/app/message.py#L107-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036079", "code": "def _is_kpoint(line):\n    \"\"\"Is this line the start of a new k-point block\"\"\"\n    # Try to parse the k-point; false otherwise\n    toks = line.split()\n    # k-point header lines have 4 tokens\n    if len(toks) != 4:\n        return False\n\n    try:\n        # K-points are centered at the origin\n        xs = [float(x) for x in toks[:3]]\n        # Weights are in [0,1]\n        w = float(toks[3])\n        return all(abs(x) <= 0.5 for x in xs) and w >= 0.0 and w <= 1.0\n    except ValueError:\n        return False", "entry_point": "_is_kpoint", "input": "'walnut thistle harbour'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CitrineInformatics/dftparse/blob/53a1bf19945cf1c195d6af9beccb3d1b7f4a4c1d/dftparse/vasp/eigenval_parser.py#L4-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036080", "code": "def pascal_row(n):\n    \"\"\" Returns n-th row of Pascal's triangle\n    \"\"\"\n    result = [1]\n    x, numerator = 1, n\n    for denominator in range(1, n // 2 + 1):\n        x *= numerator\n        x /= denominator\n        result.append(x)\n        numerator -= 1\n    if n & 1 == 0:\n        result.extend(reversed(result[:-1]))\n    else:\n        result.extend(reversed(result))\n    return result", "entry_point": "pascal_row", "input": "False", "output": "[1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wushuyi/wsy_captcha/blob/eeb8fd8b8d37c3550903a83339109e064da45d89/wsy_captcha/bezier.py#L11-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036081", "code": "def _build_abbreviation_regex(input_string):\n        \"\"\" builds a recursive regex based on an input string to find possible abbreviations more simply.\n            e.g. = punct(u(a(t(i(on?)?)?)?)?)?\n\n        :param input_string: str, input string\n        :return: str, output regex\n        \"\"\"\n        result=''\n        for char in input_string:\n            result += '[%s%s]?' % (char.upper(), char.lower())\n        return '(%s)' % result", "entry_point": "_build_abbreviation_regex", "input": "'abc'", "output": "'([Aa]?[Bb]?[Cc]?)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AndresMWeber/Nomenclate/blob/e6d6fc28beac042bad588e56fbe77531d2de6b6f/nomenclate/core/nameparser.py#L461-L471", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036082", "code": "def get_gcd(a, b):\n    \"Return greatest common divisor for a and b.\"\n    while a:\n        a, b = b % a, a\n    return b", "entry_point": "get_gcd", "input": "'', 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mirukan/whratio/blob/e19cf7346351649d196d2eb3369870841f7bfea5/whratio/ratio.py#L8-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036083", "code": "def partition(f, xs):\r\n    \"\"\"\r\n    Works similar to filter, except it returns a two-item tuple where the\r\n    first item is the sequence of items that passed the filter and the\r\n    second is a sequence of items that didn't pass the filter\r\n    \"\"\"\r\n    t = type(xs)\r\n    true = filter(f, xs)\r\n    false = [x for x in xs if x not in true]\r\n    return t(true), t(false)", "entry_point": "partition", "input": "[-1, 0, 1, 2], []", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AN3223/fpbox/blob/d3b88fa6d68b7673c58edf46c89a552a9aedd162/fpbox/funcs.py#L61-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036084", "code": "def make_octal_permissions_mode(user=(False, False, False), group=(False, False, False), other=(False, False, False)):\n    \"\"\"\n    Create a permissions bit in absolute notation (octal).\n\n    The user, group and other parameters are tuples representing Read, Write and Execute values.\n    All are set disallowed (set to false) by default and can be individually permitted.\n\n    :param user: User permissions\n    :param group: Group permissions\n    :param other: Other permissions\n    :return: Permissions bit\n    \"\"\"\n    # Create single digit code for each name\n    mode = ''\n    for name in (user, group, other):\n        read, write, execute = name\n\n        # Execute\n        if execute and not all(i for i in (read, write)):\n            code = 1\n\n        # Write\n        elif write and not all(i for i in (read, execute)):\n            code = 2\n\n        # Write & Execute\n        elif all(i for i in (write, execute)) and not read:\n            code = 3\n\n        # Read\n        elif read and not all(i for i in (write, execute)):\n            code = 4\n\n        # Read & Execute\n        elif all(i for i in (read, execute)) and not write:\n            code = 5\n\n        # Read & Write\n        elif all(i for i in (read, write)) and not execute:\n            code = 6\n\n        # Read, Write & Execute\n        elif all(i for i in (read, write, execute)):\n            code = 7\n        else:\n            code = 0\n        mode += str(code)\n    return int(mode)", "entry_point": "make_octal_permissions_mode", "input": "[1, 2, 3], [[1, 2], [3], []], [1, 2, 3]", "output": "727", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mrstephenneal/dirutility/blob/339378659e2d7e09c53acfc51c5df745bb0cd517/dirutility/permissions.py#L32-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036085", "code": "def fmt_sentence(text):\n    \"\"\"English sentence formatter. \n\n    First letter is always upper case. Example:\n    \"Do you want to build a snow man?\"\n\n    **\u4e2d\u6587\u6587\u6863**\n\n    \u53e5\u5b50\u683c\u5f0f\u3002\u6bcf\u53e5\u8bdd\u7684\u7b2c\u4e00\u4e2a\u5355\u8bcd\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u5927\u5199\u3002\n    \"\"\"\n    text = text.strip()\n    if len(text) == 0:  # if empty string, return it\n        return text\n    else:\n        text = text.lower()  # lower all char\n        # delete redundant empty space\n        chunks = [chunk for chunk in text.split(\" \") if len(chunk) >= 1]\n        chunks[0] = chunks[0][0].upper() + chunks[0][1:]\n        return \" \".join(chunks)", "entry_point": "fmt_sentence", "input": "'abc'", "output": "'Abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/text/formatter.py#L65-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036086", "code": "def fmt_filename(text):\n    \"\"\"File name formatter.\n\n    Remove all file system forbidden char from text.\n\n    **\u4e2d\u6587\u6587\u6863**\n\n    \u79fb\u9664\u6587\u4ef6\u7cfb\u7edf\u4e2d\u4e0d\u5141\u8bb8\u7684\u5b57\u7b26\u3002 \n    \"\"\"\n    forbidden_char = [\"\\\\\", \"/\", \":\", \"*\", \"?\", \"|\", \"<\", \">\", '\"']\n    for char in forbidden_char:\n        text = text.replace(char, \"\")\n    return text", "entry_point": "fmt_filename", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/text/formatter.py#L107-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036087", "code": "def index_element_map(arr):\n    \"\"\"Map the indices of the array to the respective elements.\n\n    Parameters\n    -----------\n    arr : list(a)\n        The array to process, of generic type a\n\n    Returns\n    -----------\n    dict(int -> a), a dictionary corresponding the index to the element\n    \"\"\"\n    index_to_element = {}\n    for index, element in enumerate(arr):\n        index_to_element[index] = element\n    return index_to_element", "entry_point": "index_element_map", "input": "[1, 2, 3]", "output": "{0: 1, 1: 2, 2: 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kathyxchen/crosstalk-correction/blob/eac11d54b39ea7ec301b54f8e498adce91713223/crosstalk_correction/crosstalk_correction.py#L201-L216", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036088", "code": "def _update_pathway_definitions(crosstalk_corrected_index_map,\n                                gene_row_names,\n                                pathway_column_names):\n    \"\"\"Helper function to convert the mapping of int\n    (pathway id -> list of gene ids) to the corresponding pathway\n    names and gene identifiers.\n    \"\"\"\n    corrected_pathway_definitions = {}\n    for pathway_index, gene_indices in crosstalk_corrected_index_map.items():\n        pathway = pathway_column_names[pathway_index]\n        genes = set([gene_row_names[index] for index in list(gene_indices)])\n        corrected_pathway_definitions[pathway] = genes\n    return corrected_pathway_definitions", "entry_point": "_update_pathway_definitions", "input": "{}, '', 'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kathyxchen/crosstalk-correction/blob/eac11d54b39ea7ec301b54f8e498adce91713223/crosstalk_correction/crosstalk_correction.py#L239-L251", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036089", "code": "def spark_string(ints):\n    \"\"\"Returns a spark string from given iterable of ints.\"\"\"\n    ticks = u'\u2581\u2582\u2583\u2585\u2586\u2587'\n    ints = [i for i in ints if type(i) == int]\n    if len(ints) == 0:\n        return \"\"\n    step = (max(ints) / float(len(ticks) - 1)) or 1\n    return u''.join(\n        ticks[int(round(i / step))] if type(i) == int else u'.' for i in ints)", "entry_point": "spark_string", "input": "[-1, 0, 1, 2]", "output": "'\u2586\u2581\u2583\u2587'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cwoebker/paxo/blob/b97518a830948faaaf31aeacda3f8d4f6364eb07/paxo/text.py#L16-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036090", "code": "def tuple_to_string(date_tuple):\n    \"\"\"\n    Create a yyyy-mm(-dd) string from a tuple containing (yyyy, m) (or one with the day too)\n    \"\"\"\n    if len(date_tuple) == 2:\n        # It's yyyy-mm\n        return str(date_tuple[0]).zfill(4) + '-' + str(date_tuple[1]).zfill(2)\n    # It's yyyy-mm-dd\n    return str(date_tuple[0]).zfill(4) + '-' + str(date_tuple[1]).zfill(2) + '-' + str(date_tuple[2]).zfill(2)", "entry_point": "tuple_to_string", "input": "[1, 2, 3]", "output": "'0001-02-03'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aquatix/python-utilkit/blob/1b4a4175381d2175592208619315f399610f915c/utilkit/datetimeutil.py#L52-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036091", "code": "def string_SizeInBytes(size_in_bytes):\n    \"\"\"Make ``size in bytes`` human readable.\n    Doesn\"t support size greater than 1000PB.\n\n    Usage::\n\n        >>> from __future__ import print_function\n        >>> from weatherlab.lib.filesystem.windowsexplorer import string_SizeInBytes\n        >>> print(string_SizeInBytes(100))\n        100 B\n        >>> print(string_SizeInBytes(100*1000))\n        97.66 KB\n        >>> print(string_SizeInBytes(100*1000**2))\n        95.37 MB\n        >>> print(string_SizeInBytes(100*1000**3))\n        93.13 GB\n        >>> print(string_SizeInBytes(100*1000**4))\n        90.95 TB\n        >>> print(string_SizeInBytes(100*1000**5))\n        88.82 PB\n    \"\"\"\n    res, by = divmod(size_in_bytes, 1024)\n    res, kb = divmod(res, 1024)\n    res, mb = divmod(res, 1024)\n    res, gb = divmod(res, 1024)\n    pb, tb = divmod(res, 1024)\n    if pb != 0:\n        human_readable_size = \"%.2f PB\" % (pb + tb / float(1024))\n    elif tb != 0:\n        human_readable_size = \"%.2f TB\" % (tb + gb / float(1024))\n    elif gb != 0:\n        human_readable_size = \"%.2f GB\" % (gb + mb / float(1024))\n    elif mb != 0:\n        human_readable_size = \"%.2f MB\" % (mb + kb / float(1024))\n    elif kb != 0:\n        human_readable_size = \"%.2f KB\" % (kb + by / float(1024))\n    else:\n        human_readable_size = \"%s B\" % by\n    return human_readable_size", "entry_point": "string_SizeInBytes", "input": "0", "output": "'0 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/crawler/downloader.py#L25-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036092", "code": "def _get_variation_id(value, capital=False):\n        \"\"\" Convert an integer value to a character. a-z then double aa-zz etc\n        Args:\n            value (int): integer index we're looking up\n            capital (bool): whether we convert to capitals or not\n        Returns (str): alphanumeric representation of the index\n        \"\"\"\n        # Reinforcing type just in case a valid string was entered\n        value = int(value)\n        base_power = base_start = base_end = 0\n        while value >= base_end:\n            base_power += 1\n            base_start = base_end\n            base_end += pow(26, base_power)\n        base_index = value - base_start\n\n        # create alpha representation\n        alphas = ['a'] * base_power\n        for index in range(base_power - 1, -1, -1):\n            alphas[index] = chr(int(97 + (base_index % 26)))\n            base_index /= 26\n\n        characters = ''.join(alphas)\n        return characters.upper() if capital else characters", "entry_point": "_get_variation_id", "input": "2, 'AbC dEf'", "output": "'C'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AndresMWeber/Nomenclate/blob/e6d6fc28beac042bad588e56fbe77531d2de6b6f/nomenclate/core/renderers.py#L156-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036093", "code": "def split_by_count(items, count, filler=None):\n    \"\"\"Split the items into tuples of count items each\n\n    >>> split_by_count([0,1,2,3], 2)\n    [(0, 1), (2, 3)]\n\n    If there are a mutiple of count items then filler makes no difference\n    >>> split_by_count([0,1,2,7,8,9], 3, 0) == split_by_count([0,1,2,7,8,9], 3)\n    True\n\n    If there are not a multiple of count items, then any extras are discarded\n    >>> split_by_count([0,1,2,7,8,9,6], 3)\n    [(0, 1, 2), (7, 8, 9)]\n\n    Specifying a filler expands the \"lost\" group\n    >>> split_by_count([0,1,2,7,8,9,6], 3, 0)\n    [(0, 1, 2), (7, 8, 9), (6, 0, 0)]\n    \"\"\"\n    if filler is not None:\n        items = items[:]\n        while len(items) % count:\n            items.append(filler)\n    iterator = iter(items)\n    iterators = [iterator] * count\n    return list(zip(*iterators))", "entry_point": "split_by_count", "input": "[], 2, ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jalanb/pysyte/blob/4e278101943d1ceb1a6bcaf6ddc72052ecf13114/pysyte/splits.py#L97-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036094", "code": "def to_even_columns(data, headers=None):\n    \"\"\"\n    Nicely format the 2-dimensional list into evenly spaced columns\n    \"\"\"\n    result = ''\n    col_width = max(len(word) for row in data for word in row) + 2  # padding\n    if headers:\n        header_width = max(len(word) for row in headers for word in row) + 2\n        if header_width > col_width:\n            col_width = header_width\n\n        result += \"\".join(word.ljust(col_width) for word in headers) + \"\\n\"\n        result += '-' * col_width * len(headers) + \"\\n\"\n\n    for row in data:\n        result += \"\".join(word.ljust(col_width) for word in row) + \"\\n\"\n    return result", "entry_point": "to_even_columns", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "'a  b  c  \\n---------\\na  p  p  l  e  \\nb  a  n  a  n  a  \\nc  h  e  r  r  y  \\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aquatix/python-utilkit/blob/1b4a4175381d2175592208619315f399610f915c/utilkit/printutil.py#L6-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036095", "code": "def millis_to_human_readable(time_millis):\n        \"\"\"\n        Calculates the equivalent time of the given milliseconds into a human readable string from seconds to weeks.\n        :param time_millis: Time in milliseconds using python time library.\n        :return:            Human readable time string. Example: 2 min 3 s.\n        \"\"\"\n        weeks = 0\n        days = 0\n        hours = 0\n        minutes = 0\n        seconds = round(time_millis / 1000)\n\n        while seconds > 59:\n            seconds -= 60\n            minutes += 1\n\n        while minutes > 59:\n            minutes -= 60\n            hours += 1\n\n        while hours > 23:\n            hours -= 24\n            days += 1\n\n        while days > 6:\n            hours -= 7\n            weeks += 1\n\n        if weeks > 0:\n            output = '{} w {} d {} h {} min {} s'.format(weeks, days, hours, minutes, seconds)\n        elif days > 0:\n            output = '{} d {} h {} min {} s'.format(days, hours, minutes, seconds)\n        elif hours > 0:\n            output = '{} h {} min {} s'.format(hours, minutes, seconds)\n        elif minutes > 0:\n            output = '{} min {} s'.format(minutes, seconds)\n        elif seconds > 0:\n            output = '{} s'.format(seconds)\n        else:\n            output = ''\n\n        return output", "entry_point": "millis_to_human_readable", "input": "0.5", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peepall/FancyLogger/blob/7f13f1397e76ed768fb6b6358194118831fafc6d/FancyLogger/processing/__init__.py#L299-L340", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036096", "code": "def header_name(name):\n    \"\"\"Convert header name like HTTP_XXXX_XXX to Xxxx-Xxx:\"\"\"\n\n    words = name[5:].split('_')\n    for i in range(len(words)):\n        words[i] = words[i][0].upper() + words[i][1:].lower()\n    result = '-'.join(words)\n    return result", "entry_point": "header_name", "input": "'Hello World'", "output": "' world'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ironfroggy/django-better-cache/blob/5350e8c646cef1c1ca74eab176f856ddd9eaf5c3/bettercache/proxy.py#L65-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036097", "code": "def _add_params_docstring(params):\n    \"\"\" Add params to doc string\n    \"\"\"\n    p_string = \"\\nAccepts the following paramters: \\n\"\n    for param in params:\n         p_string += \"name: %s, required: %s, description: %s \\n\" % (param['name'], param['required'], param['description'])\n    return p_string", "entry_point": "_add_params_docstring", "input": "[]", "output": "'\\nAccepts the following paramters: \\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/redbridge/molnctrl/blob/9990ae7e522ce364bb61a735f774dc28de5f8e60/molnctrl/__init__.py#L40-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036098", "code": "def de_duplicate(items):\n    \"\"\"Remove any duplicate item, preserving order\n\n    >>> de_duplicate([1, 2, 1, 2])\n    [1, 2]\n    \"\"\"\n    result = []\n    for item in items:\n        if item not in result:\n            result.append(item)\n    return result", "entry_point": "de_duplicate", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jalanb/pysyte/blob/4e278101943d1ceb1a6bcaf6ddc72052ecf13114/pysyte/lists.py#L4-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036099", "code": "def remove_children(list_of_abspath):\n        \"\"\"Remove all dir path that being children path of other dir path.\n        \n        **\u4e2d\u6587\u6587\u6863**\n        \n        \u53bb\u9664list_of_abspath\u4e2d\u6240\u6709\u76ee\u5f55\u7684\u5b50\u76ee\u5f55, \u4fdd\u8bc1\u5176\u4e2d\u7684\u6240\u6709\u5143\u7d20\u4e0d\u53ef\u80fd\u4e3a\u53e6\u4e00\u4e2a\n        \u5143\u7d20\u7684\u5b50\u76ee\u5f55\u3002\n        \"\"\"\n        sorted_list_of_abspath = list(list_of_abspath)\n        sorted_list_of_abspath.sort()\n        sorted_list_of_abspath.append(\"\")  \n        res = list()\n        temp = sorted_list_of_abspath[0]\n        for abspath in sorted_list_of_abspath:\n            if temp not in abspath:\n                res.append(temp)\n                temp = abspath         \n        return res", "entry_point": "remove_children", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/filesystem/filesystem.py#L691-L708", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036100", "code": "def first(sequence, message=None):\n    \"\"\"The first item in that sequence\n\n    If there aren't any, raise a ValueError with that message\n    \"\"\"\n    try:\n        return next(iter(sequence))\n    except StopIteration:\n        raise ValueError(message or ('Sequence is empty: %s' % sequence))", "entry_point": "first", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "'a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jalanb/pysyte/blob/4e278101943d1ceb1a6bcaf6ddc72052ecf13114/pysyte/iteration.py#L7-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036101", "code": "def last(sequence, message=None):\n    \"\"\"The last item in that sequence\n\n    If there aren't any, raise a ValueError with that message\n    \"\"\"\n    try:\n        return sequence.pop()\n    except AttributeError:\n        return list(sequence).pop()\n    except IndexError:\n        raise ValueError(message or f'Sequence is empty: {sequence}')", "entry_point": "last", "input": "[5, 3, 1, 4], []", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jalanb/pysyte/blob/4e278101943d1ceb1a6bcaf6ddc72052ecf13114/pysyte/iteration.py#L18-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036102", "code": "def caesar_cipher(message, key):\n    \"\"\"\n    \u51ef\u7279\u52a0\u5bc6\u6cd5\n    :param message: \u5f85\u52a0\u5bc6\u6570\u636e\n    :param key: \u52a0\u5bc6\u5411\u91cf\n    :return: \u88ab\u52a0\u5bc6\u7684\u5b57\u7b26\u4e32\n    \"\"\"\n    LEFTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n    translated = ''\n    message = message.upper()\n    for symbol in message:\n        if symbol in LEFTERS:\n            num = LEFTERS.find(symbol)\n            num = num + key\n\n            if num >= len(LEFTERS):\n                num = num - len(LEFTERS)\n            elif num < 0:\n                num = num + len(LEFTERS)\n\n            translated = translated + LEFTERS[num]\n        else:\n            translated = translated + symbol\n\n    return translated", "entry_point": "caesar_cipher", "input": "'a,b,c', 3", "output": "'D,E,F'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shi-cong/PYSTUDY/blob/c8da7128ea18ecaa5849f2066d321e70d6f97f70/PYSTUDY/encryptlib.py#L17-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036103", "code": "def reverse_cipher(message):\n    \"\"\"\n    \u53cd\u8f6c\u52a0\u5bc6\u6cd5\n    :param message: \u5f85\u52a0\u5bc6\u5b57\u7b26\u4e32\n    :return: \u88ab\u52a0\u5bc6\u5b57\u7b26\u4e32\n    \"\"\"\n    translated = ''\n\n    i = len(message) - 1\n    while i >= 0:\n        translated = translated + message[i]\n        i = i - 1\n\n    return translated", "entry_point": "reverse_cipher", "input": "['apple', 'banana', 'cherry']", "output": "'cherrybananaapple'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shi-cong/PYSTUDY/blob/c8da7128ea18ecaa5849f2066d321e70d6f97f70/PYSTUDY/encryptlib.py#L44-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036104", "code": "def add_preceding_dict(config_entry, query_path, preceding_depth):\n        \"\"\" Adds the preceeding config keys to the config_entry to simulate the original full path to the config entry\n\n        :param config_entry: object, the entry that was requested and returned from the config\n        :param query_path: (str, list(str)), the original path to the config_entry\n        :param preceding_depth: int, the depth to which we are recreating the preceding config keys\n        :return: dict, simulated config to n * preceding_depth\n        \"\"\"\n        if preceding_depth is None:\n            return config_entry\n\n        preceding_dict = {query_path[-1]: config_entry}\n        path_length_minus_query_pos = len(query_path) - 1\n        preceding_depth = path_length_minus_query_pos - preceding_depth if preceding_depth != -1 else 0\n\n        for index in reversed(range(preceding_depth, path_length_minus_query_pos)):\n            preceding_dict = {query_path[index]: preceding_dict}\n\n        return preceding_dict", "entry_point": "add_preceding_dict", "input": "{'a': 1, 'b': 2}, 'a,b,c', 5", "output": "{'c': {'a': {',': {'b': {',': {'c': {'a': 1, 'b': 2}}}}}}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AndresMWeber/Nomenclate/blob/e6d6fc28beac042bad588e56fbe77531d2de6b6f/nomenclate/core/configurator.py#L57-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036105", "code": "def format_word_list_mixedcase(word_list):\n    \"\"\"\n    Given a list of words, this function returns a new list where the\n    words follow mixed case convention.\n\n    As a reminder this is mixedCase.\n\n    :param word_list: list, a list of words\n    :return: list, a list of words where the words are mixed case\n    \"\"\"\n    to_return, first_word = list(), True\n    for word in word_list:\n        if first_word:\n            to_return.append(word.lower())\n            first_word = False\n        else:\n            to_return.append(word.capitalize())\n    return to_return", "entry_point": "format_word_list_mixedcase", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'Banana', 'Cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LeonardMH/namealizer/blob/ef09492fb4565b692fda329dc02b8c4364f1cc0a/namealizer/namealizer.py#L106-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036106", "code": "def deramise(r):\n    \"\"\" D\u00e9ramise une cha\u00eene\n    \n    :param string: Cha\u00eene \u00e0 transformer\n    :type string: str\n    :return: Cha\u00eene nettoy\u00e9e\n    :rtype: str\n    \"\"\"\n    return r.replace('J', 'I') \\\n            .replace('j', 'i') \\\n            .replace('v', 'u') \\\n            .replace(\"\u00e6\", \"ae\") \\\n            .replace(\"\u00c6\", \"Ae\") \\\n            .replace(\"\u0153\", \"oe\") \\\n            .replace(\"\u0152\", \"Oe\") \\\n            .replace(\"\u1ee5\", 'u') \\\n            .replace('V', 'U')", "entry_point": "deramise", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PonteIneptique/collatinus-python/blob/fca37b0b77bc60f47d3c24ab42f6d0bdca6ba0f5/pycollatinus/ch.py#L139-L155", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036107", "code": "def _create_html_file_content(translations):\n    \"\"\"Create html string out of translation dict.\n\n    Parameters\n    ----------\n    tralnslations : dict\n        Dictionary of word translations.\n\n    Returns\n    -------\n    str:\n        html string of translation\n    \"\"\"\n    content = []\n    for i1, t in enumerate(translations):\n        if i1 > 0:\n            content.append(\"<br>\")\n        content.append('<div class=\"translation\">')\n        content.append('<div class=\"word\">')\n        for w in t.word:\n            content.append(\"<h2>{word}</h2>\".format(word=w))\n        content.append(\"</div>\")  # end `word`\n        for i2, t2 in enumerate(t.parts_of_speech):\n            if i2 > 0:\n                content.append(\"<br>\")\n            content.append('<div class=\"part-of-speech\">')\n            if t2.part is not None:\n                content.append('<p class=\"part-name\">[{part}]</p>'.format(part=t2.part))\n            content.append(\"<ol>\")\n            for m in t2.meanings:\n                content.append('<div class=\"meaning\">')\n                mng = [\"<strong><li>\"]\n                for i3, mn in enumerate(m.meaning):\n                    if i3 > 0:\n                        mng.append(\", \")\n                    mng.append(\"<span>{meaning}</span>\".format(meaning=mn))\n                mng.append(\"</li></strong>\")\n                content.append(\"\".join(mng))\n                content.append('<div class=\"examples\">')\n                for e in m.examples:\n                    exmpl = \"<p><span>{ex}</span>\".format(ex=e[0])\n                    if e[1]:\n                        exmpl += \"<br><span>{tr}</span>\".format(tr=e[1])\n                    exmpl += \"</p>\"\n                    content.append(exmpl)\n                content.append(\"</div>\")  # end `examples`\n                content.append(\"</div>\")  # end `meaning`\n            content.append(\"</ol>\")\n            content.append(\"</div>\")  # end `part-of-speech`\n        content.append(\"</div>\")  # end `translation`\n    return \"\\n\".join(content)", "entry_point": "_create_html_file_content", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/silenc3r/dikicli/blob/53721cdf75db04e2edca5ed3f99beae7c079d980/dikicli/core.py#L314-L364", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036108", "code": "def _create_index_content(words):\n    \"\"\"Create html string of index file.\n\n    Parameters\n    ----------\n    words : list of str\n        List of cached words.\n\n    Returns\n    -------\n    str\n        html string.\n    \"\"\"\n    content = [\"<h1>Index</h1>\", \"<ul>\"]\n    for word in words:\n        content.append(\n            '<li><a href=\"translations/{word}.html\">{word}</a></li>'.format(word=word)\n        )\n\n    content.append(\"</ul>\")\n    if not words:\n        content.append(\"<i>Nothing to see here ...yet!</i>\")\n\n    return \"\\n\".join(content)", "entry_point": "_create_index_content", "input": "[]", "output": "'<h1>Index</h1>\\n<ul>\\n</ul>\\n<i>Nothing to see here ...yet!</i>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/silenc3r/dikicli/blob/53721cdf75db04e2edca5ed3f99beae7c079d980/dikicli/core.py#L391-L414", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036109", "code": "def check_inclusions(item, included=[], excluded=[]):\n    \"\"\"Everything passes if both are empty, otherwise, we have to check if \\\n    empty or is present.\"\"\"\n    if (len(included) == 0):\n        if len(excluded) == 0 or item not in excluded:\n            return True\n        else:\n            return False\n    else:\n        if item in included:\n            return True\n    return False", "entry_point": "check_inclusions", "input": "[5, 3, 1, 4], [[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edwards-lab/libGWAS/blob/d68c9a083d443dfa5d7c5112de29010909cfe23f/libgwas/data_parser.py#L27-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036110", "code": "def specialRound(number, rounding):\n    \"\"\"A method used to round a number in the way that UsefulUtils rounds.\"\"\"\n    temp = 0\n    if rounding == 0:\n        temp = number\n    else:\n        temp =  round(number, rounding)\n    if temp % 1 == 0:\n        return int(temp)\n    else:\n        return float(temp)", "entry_point": "specialRound", "input": "-1.5, 0", "output": "-1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Th3Gam3rz/UsefulUtils/blob/6811af3daa88b42d76c4db372b58e2739d1f5595/src/math.py#L1-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036111", "code": "def or_by_masks(df, masks):\n    \"\"\"Returns a sub-dataframe by the logical or over the given masks.\n\n    Parameters\n    ----------\n    df : pandas.DataFrame\n        The dataframe to take a subframe of.\n    masks : list\n        A list of pandas.Series of dtype bool, indexed identically to the given\n        dataframe.\n\n    Returns\n    -------\n    pandas.DataFrame\n        The sub-dataframe resulting from applying the masks to the dataframe.\n\n    Example\n    -------\n    >>> import pandas as pd\n    >>> data = [[23, 'Jo'], [19, 'Mi'], [15, 'Di']]\n    >>> df = pd.DataFrame(data, [1, 2, 3] , ['Age', 'Name'])\n    >>> mask1 = pd.Series([False, True, True], df.index)\n    >>> mask2 = pd.Series([False, False, True], df.index)\n    >>> or_by_masks(df, [mask1, mask2])\n       Age Name\n    2   19   Mi\n    3   15   Di\n    \"\"\"\n    if len(masks) < 1:\n        return df\n    if len(masks) == 1:\n        return df[masks[0]]\n    overall_mask = masks[0] | masks[1]\n    for mask in masks[2:]:\n        overall_mask = overall_mask | mask\n    return df[overall_mask]", "entry_point": "or_by_masks", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "'c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaypal5/pdutil/blob/231059634643af2558d22070f89767410978cf56/pdutil/transform/transform.py#L83-L118", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036112", "code": "def transpose(matrix):\n\n    \"\"\"\n    transpose 2D matrix (list)\n    \"\"\"\n\n    return [[x[i] for x in matrix] for i in range(len(matrix[0]))]", "entry_point": "transpose", "input": "['apple', 'banana', 'cherry']", "output": "[['a', 'b', 'c'], ['p', 'a', 'h'], ['p', 'n', 'e'], ['l', 'a', 'r'], ['e', 'n', 'r']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wdbm/datavision/blob/b6f26287264632d6f8c9f8911aaf3a8e4fc4dcf5/datavision.py#L3067-L3073", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036113", "code": "def percent_of(percent, whole):\n    \"\"\"Calculates the value of a percent of a number\n    ie: 5% of 20 is what --> 1\n    \n    Args:\n        percent (float): The percent of a number\n        whole (float): The whole of the number\n        \n    Returns:\n        float: The value of a percent\n        \n    Example:\n    >>> percent_of(25, 100)\n    25.0\n    >>> percent_of(5, 20)\n    1.0\n    \n    \"\"\"\n    percent = float(percent)\n    whole = float(whole)\n    return (percent * whole) / 100", "entry_point": "percent_of", "input": "7, False", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flashmeow/pycent/blob/43efcc1d84dd9d801285a641f9be80bb4ecceabd/pycent/__init__.py#L1-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036114", "code": "def strlify(a):\n    '''\n    Used to turn hexlify() into hex string.\n\n    Does nothing in Python 2, but is necessary for Python 3, so that\n    all inputs and outputs are always the same encoding.  Most of the\n    time it doesn't matter, but some functions in Python 3 brick when\n    they get bytes instead of a string, so it's safer to just\n    strlify() everything.\n\n    In Python 3 for example (examples commented out for doctest):\n#   >>> hexlify(unhexlify(\"a1b2c3\"))\n    b'a1b2c3'\n#   >>> b'a1b2c3' == 'a1b2c3'\n    False\n#   >>> strlify(hexlify(unhexlify(\"a1b2c3\")))\n    'a1b2c3'\n\n    Whereas in Python 2, the results would be:\n#   >>> hexlify(unhexlify(\"a1b2c3\"))\n    'a1b2c3'\n#   >>> b'a1b2c3' == 'a1b2c3'\n    True\n#   >>> strlify(hexlify(unhexlify(\"a1b2c3\")))\n    'a1b2c3'\n\n    Safe to use redundantly on hex and base64 that may or may not be\n    byte objects, as well as base58, since hex and base64 and base58\n    strings will never have \"b'\" in the middle of them.\n\n    Obviously it's NOT safe to use on random strings which might have\n    \"b'\" in the middle of the string.\n\n    Use this for making sure base 16/58/64 objects are in string\n    format.\n\n    Use normalize_input() below to convert unicode objects back to\n    ascii strings when possible.\n    '''\n\n    if a == b'b' or a == 'b':\n        return 'b'\n\n    return str(a).rstrip(\"'\").replace(\"b'\",\"\",1).replace(\"'\",\"\")", "entry_point": "strlify", "input": "['apple', 'banana', 'cherry']", "output": "'[apple, banana, cherry]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxweisspoker/simplebitcoinfuncs/blob/ad332433dfcc067e86d2e77fa0c8f1a27daffb63/simplebitcoinfuncs/miscfuncs.py#L24-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036115", "code": "def extract_leftmost_selector(selector_list):\n    \"\"\"\n    Because we aren't building a DOM tree to transverse, the only way\n    to get the most general selectors is to take the leftmost. \n    For example with `div.outer div.inner`, we can't tell if `div.inner`\n    has been used in context without building a tree.\n    \"\"\"\n    classes = set()\n    ids = set()\n    elements = set()\n    #    print \"Selector list: %s \\n\\n\\n\\n\\n\\n\" % selector_list\n    for selector in selector_list:\n        selector = selector.split()[0]\n        if selector[0] == '.':\n            classes.add(selector)\n        elif selector[0] == '#':\n            ids.add(selector)\n        else:\n            elements.add(selector)\n    return { \n             'classes':classes,\n             'ids':ids,\n             'elements':elements,\n             }", "entry_point": "extract_leftmost_selector", "input": "['apple', 'banana', 'cherry']", "output": "{'classes': set(), 'ids': set(), 'elements': {'banana', 'apple', 'cherry'}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KyleWpppd/css-audit/blob/cab4d4204cf30d54bc1881deee6ad92ae6aacc56/cssaudit/parser.py#L213-L236", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036116", "code": "def partition(pred, iterable):\n    \"\"\" split the results of an iterable based on a predicate \"\"\"\n    trues = []\n    falses = []\n    for item in iterable:\n        if pred(item):\n            trues.append(item)\n        else:\n            falses.append(item)\n    return trues, falses", "entry_point": "partition", "input": "[-1, 0, 1, 2], []", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Archived-Object/ligament/blob/ff3d78130522676a20dc64086dc8a27b197cc20f/ligament/helpers.py#L17-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036117", "code": "def build_lst(a, b):\n    \"\"\" function to be folded over a list (with initial value `None`)\n        produces one of:\n\n        1. `None`\n        2. A single value\n        3. A list of all values\n    \"\"\"\n    if type(a) is list:\n        return a + [b]\n    elif a:\n        return [a, b]\n    else:\n        return b", "entry_point": "build_lst", "input": "['a', 'b', 'c'], []", "output": "['a', 'b', 'c', []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Archived-Object/ligament/blob/ff3d78130522676a20dc64086dc8a27b197cc20f/ligament/helpers.py#L70-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036118", "code": "def remove_dups(seq):\n    \"\"\"remove duplicates from a sequence, preserving order\"\"\"\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if not (x in seen or seen_add(x))]", "entry_point": "remove_dups", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Archived-Object/ligament/blob/ff3d78130522676a20dc64086dc8a27b197cc20f/ligament/helpers.py#L291-L295", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036119", "code": "def to_bytes(s):\n    \"\"\"\n    \u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u6210\u5b57\u8282\u6570\u7ec4\n    :param s: \u8981\u8f6c\u6362\u6210\u5b57\u8282\u6570\u7ec4\u7684\u5b57\u7b26\u4e32\n    :return: \u8f6c\u6362\u6210\u5b57\u8282\u6570\u7ec4\u7684\u5b57\u7b26\u4e32\n    \"\"\"\n    if bytes != str:\n        if type(s) == str:\n            return s.encode('utf-8')\n    return s", "entry_point": "to_bytes", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shi-cong/PYSTUDY/blob/c8da7128ea18ecaa5849f2066d321e70d6f97f70/PYSTUDY/stringlib.py#L53-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036120", "code": "def to_str(s):\n    \"\"\"\n    \u5c06\u5b57\u8282\u6570\u7ec4\u8f6c\u6210\u6210\u5b57\u7b26\u4e32\n    :param s: \u5b57\u8282\u6570\u7ec4\n    :return: \u5b57\u7b26\u4e32\n    \"\"\"\n    if bytes != str:\n        \"\"\"\n        \u8fd9\u91cc\u7684\u6bd4\u8f83\u5728python2\u4e2d\u662fTrue\uff0c\u5728Python3\u4e2d\u662fFalse\n        \"\"\"\n        if type(s) == bytes:\n            return s.decode('utf-8')\n    return s", "entry_point": "to_str", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shi-cong/PYSTUDY/blob/c8da7128ea18ecaa5849f2066d321e70d6f97f70/PYSTUDY/stringlib.py#L65-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036121", "code": "def remove_column(table, remove_index):\r\n        '''\r\n        Removes the specified column from the table.\r\n        '''\r\n        for row_index in range(len(table)):\r\n            old_row = table[row_index]\r\n            new_row = []\r\n            for column_index in range(len(old_row)):\r\n                if column_index != remove_index:\r\n                    new_row.append(old_row[column_index])\r\n            table[row_index] = new_row\r\n        return table", "entry_point": "remove_column", "input": "{}, 3", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenGov/carpenter/blob/0ab3c54c05133b9b0468c63e834a7ce3a6fb575b/carpenter/carpenter.py#L16-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036122", "code": "def stitch_block(block_list):\r\n    '''\r\n    Stitches blocks together into a single block columnwise. These blocks are 2D tables usually\r\n    generated from tableproc. The final block will be of dimensions (max(num_rows), sum(num_cols)).\r\n    '''\r\n    block_out = [[]]\r\n    for block in block_list:\r\n        num_row = len(block)\r\n        row_len = len(block[0])\r\n        if len(block_out) < num_row:\r\n            for i in range(num_row-len(block_out)):\r\n                block_out.append([None]*len(block_out[0]))\r\n        for row_out, row_in in zip(block_out, block):\r\n            row_out.extend(row_in)\r\n        if len(block_out) > num_row:\r\n            for row_out in block_out[num_row:]:\r\n                row_out.extend([None]*row_len)\r\n    return block_out", "entry_point": "stitch_block", "input": "['a', 'b', 'c']", "output": "[['a', 'b', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenGov/carpenter/blob/0ab3c54c05133b9b0468c63e834a7ce3a6fb575b/carpenter/carpenter.py#L68-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036123", "code": "def thin_string_list(list_of_strings, max_nonempty_strings=50, blank=''):\n    \"\"\"Designed for composing lists of strings suitable for pyplot axis labels\n\n    Often the xtick spacing doesn't allow room for 100's of text labels, so this\n    eliminates every other one, then every other one of those, until they fit.\n\n    >>> thin_string_list(['x']*20, 5)  # doctring: +NORMALIZE_WHITESPACE\n    ['x', '', '', '', 'x', '', '', '', 'x', '', '', '', 'x', '', '', '', 'x', '', '', '']\n    \"\"\"\n        # blank some labels to make sure they don't overlap\n    list_of_strings = list(list_of_strings)\n    istep = 2\n    while sum(bool(s) for s in list_of_strings) > max_nonempty_strings:\n        list_of_strings = [blank if i % istep else s for i, s in enumerate(list_of_strings)]\n        istep += 2\n    return list_of_strings", "entry_point": "thin_string_list", "input": "{1, 2, 3}, True, False", "output": "[1, False, False]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hobson/pug-invest/blob/836911258a0e920083a88c91beae88eefdebb20c/pug/invest/plot.py#L259-L274", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036124", "code": "def subat(orig, index, replace):\n    \"\"\"Substitutes the replacement string/character at the given index in the\n    given string, returns the modified string.\n\n    **Examples**:\n    ::\n        auxly.stringy.subat(\"bit\", 2, \"n\")\n    \"\"\"\n    return \"\".join([(orig[x] if x != index else replace) for x in range(len(orig))])", "entry_point": "subat", "input": "[], 0, [5, 3, 1, 4]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeffrimko/Auxly/blob/5aae876bcb6ca117c81d904f9455764cdc78cd48/lib/auxly/stringy.py#L12-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036125", "code": "def one(iterable, cmp=None):\n    \"\"\"\n    Return the object in the given iterable that evaluates to True.\n\n    If the given iterable has more than one object that evaluates to True,\n    or if there is no object that fulfills such condition, return False.\n\n    If a callable ``cmp`` is given, it's used to evaluate each element.\n\n\n        >>> one((True, False, False))\n        True\n        >>> one((True, False, True))\n        False\n        >>> one((0, 0, 'a'))\n        'a'\n        >>> one((0, False, None))\n        False\n        >>> one((True, True))\n        False\n        >>> bool(one(('', 1)))\n        True\n        >>> one((10, 20, 30, 42), lambda i: i > 40)\n        42\n    \"\"\"\n    the_one = False\n    for i in iterable:\n        if cmp(i) if cmp else i:\n            if the_one:\n                return False\n            the_one = i\n    return the_one", "entry_point": "one", "input": "[], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mgaitan/one/blob/c6639cd7f31c0541df5f8512561a2bb0feea194c/one.py#L4-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036126", "code": "def grfcbk_strlen(args):\n    \"\"\"\n    Grammar rule function callback: **strlen**. This function will measure the\n    string length of all subitems of the first item in argument list.\n\n    :param list args: List of function arguments.\n    :return: Length of all subitems of the first item in argument list.\n    :rtype: int or list\n    \"\"\"\n    if not args[0]:\n        return None\n    if isinstance(args[0], list):\n        return [len(x) for x in args[0]]\n    return len(args[0])", "entry_point": "grfcbk_strlen", "input": "['a', 'b', 'c']", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/honzamach/pynspect/blob/0582dcc1f7aafe50e25a21c792ea1b3367ea5881/pynspect/filters.py#L120-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036127", "code": "def fix_rst_heading(heading, below):\n    \"\"\"If the 'below' line looks like a reST line, give it the correct length.\n\n    This allows for different characters being used as header lines.\n    \"\"\"\n    if len(below) == 0:\n        return below\n    first = below[0]\n    if first not in '-=`~':\n        return below\n    if not len(below) == len([char for char in below\n                              if char == first]):\n        # The line is not uniformly the same character\n        return below\n    below = first * len(heading)\n    return below", "entry_point": "fix_rst_heading", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jlesquembre/jlle/blob/3645d8f203708355853ef911f4b887ae4d794826/jlle/releaser/utils.py#L108-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036128", "code": "def pad(lines, delim):\n\t\"\"\"\n\tRight Pads text split by their delim.\n\t:param lines: \n\t:param delim: \n\t:return: \n\t\"\"\"\n\t\"\"\"\n\tPopulates text into chunks. If the delim was & then\n\t['12 & 344', '344 & 8', '8 & 88'] would be stored in chunks as\n\t[['12', '344', '8'], ['344', '8', '88']]\n\t\"\"\"\n\tchunks = []\n\tfor i in range(len(lines)):\n\t\tline = lines[i]\n\t\tsections = line.split(delim)\n\t\tfor j in range(len(sections)):\n\t\t\tif len(chunks) <= j:\n\t\t\t\tchunks.append([])\n\t\t\tchunks[j].append(sections[j])\n\n\t\"\"\"\n\tCalculates & Stores the max length of chunks\n\t\"\"\"\n\tmax_lengths = []\n\tfor i in range(len(chunks)):\n\t\t_max = max([len(j) for j in chunks[i]])\n\t\tmax_lengths.append(_max)\n\n\t\"\"\"\n\tPads the children of chunks according to the chunk's max length\" \\\n\t\"\"\"\n\tfor i in range(len(chunks)):\n\t\tfor j in range(len(chunks[i])):\n\t\t\tchunks[i][j] += (max_lengths[i] - len(chunks[i][j])) * ' '\n\tnew_lines = ['' for i in range(len(lines))]\n\n\tfor i in range(len(chunks)):\n\t\tfor j in range(len(chunks[i])):\n\t\t\tnew_lines[j] += chunks[i][j]\n\treturn new_lines", "entry_point": "pad", "input": "{}, {1, 2, 3}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JCharante/padr/blob/1deb66263fb92919a4025ef49e504cb33af05662/padr/padr.py#L1-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036129", "code": "def quote(query):\n    '''Quote query with sign(')'''\n    if query.startswith('\\'') is not True:\n        query = '\\'' + query\n\n    if query.endswith('\\'') is not True:\n        query = query + '\\''\n\n    return query", "entry_point": "quote", "input": "'abc'", "output": "\"'abc'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/binilinlquad/bing-search-api/blob/c3a296ad7d0050dc929eda9d9760df5c15faa51a/bing_search_api/api.py#L4-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036130", "code": "def build_app_loggers(log_level, apps, handlers=None):\n    \"\"\" Return a logger dict for app packages with the given log level and no\n    propogation since the apps list is parsed/normalized to be the set of top-\n    level apps.  The optional handlers argument is provided so that this pattern\n    of app loggers can be used independently of the configure_logger method\n    below, if desired.\n    \"\"\"\n\n    # Use 'default' handler provided by DEFAULT_LOGGING config if\n    # not supplied.\n    if handlers is None:\n        handlers = ['default']\n\n    # The log config expects the handlers value to be a list, so let's\n    # make sure of that here.\n    if not isinstance(handlers, list):\n        handlers = list(handlers)\n\n    app_loggers = {}\n    for app in apps:\n        app_loggers[app] = {\n            'level': log_level,\n            'handlers': handlers,\n            'propagate': False,\n        }\n\n    return app_loggers", "entry_point": "build_app_loggers", "input": "5, set(), set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Harvard-University-iCommons/dj-log-config-helper/blob/5e568a65c455ca984d8f6d652986df190ed2a6dd/dj_log_config_helper.py#L55-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036131", "code": "def is_email_simple(value):\n        \"\"\"Return True if value looks like an email address.\"\"\"\n        # An @ must be in the middle of the value.\n        if '@' not in value or value.startswith('@') or value.endswith('@'):\n            return False\n        try:\n            p1, p2 = value.split('@')\n        except ValueError:\n            # value contains more than one @.\n            return False\n        # Dot must be in p2 (e.g. example.com)\n        if '.' not in p2 or p2.startswith('.'):\n            return False\n        return True", "entry_point": "is_email_simple", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tBaxter/tango-shared-core/blob/35fc10aef1ceedcdb4d6d866d44a22efff718812/build/lib/tango_shared/utils/sanetize.py#L153-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036132", "code": "def split_data(data, subset, splits):\n  '''Returns the data for a given protocol\n  '''\n\n  return dict([(k, data[k][splits[subset]]) for k in data])", "entry_point": "split_data", "input": "[], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/anjos/rrbob/blob/d32d35bab2aa2698d3caa923fd02afb6d67f3235/rr/database.py#L37-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036133", "code": "def transpose_list(list_of_dicts):\n    \"\"\"Transpose a list of dicts to a dict of lists\n\n    :param list_of_dicts: to transpose, as in the output from a parse call\n    :return: Dict of lists\n    \"\"\"\n    res = {}\n    for d in list_of_dicts:\n        for k, v in d.items():\n            if k in res:\n                res[k].append(v)\n            else:\n                res[k] = [v]\n    return res", "entry_point": "transpose_list", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CitrineInformatics/dftparse/blob/53a1bf19945cf1c195d6af9beccb3d1b7f4a4c1d/dftparse/util.py#L10-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036134", "code": "def slice_config(config, key):\n    \"\"\"\n    Slice config for printing as defined in key.\n\n    :param ConfigManager config: configuration dictionary\n    :param str key: dotted key, by which config should be sliced for printing\n\n    :returns: sliced config\n    :rtype: dict\n    \"\"\"\n    if key:\n        keys = key.split('.')\n        for k in keys:\n            config = config[k]\n\n    return config", "entry_point": "slice_config", "input": "True, set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fizyk/pyramid_yml/blob/1b36c4e74194c04d7d69b4d7f86801757e78f0a6/tzf/pyramid_yml/scripts.py#L90-L105", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036135", "code": "def dict_diff(first, second):\n    \"\"\" Return a dict of keys that differ with another config object.\n    If a value is not found in one fo the configs, it will be represented\n    by KEYNOTFOUND.\n    @param first:   Fist dictionary to diff.\n    @param second:  Second dicationary to diff.\n    @return diff:   Dict of Key => (first.val, second.val)\n    \"\"\"\n    diff = {}\n    # Check all keys in first dict\n    for key in first:\n        if key not in second:\n            diff[key] = (first[key], None)\n        elif (first[key] != second[key]):\n            diff[key] = (first[key], second[key])\n    # Check all keys in second dict to find missing\n    for key in second:\n        if key not in first:\n            diff[key] = (None, second[key])\n    return diff", "entry_point": "dict_diff", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Akhail/Tebless/blob/369ff76f06e7a0b6d04fabc287fa6c4095e158d4/tebless/utils/__init__.py#L13-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036136", "code": "def _chain_forks(elements):\n        \"\"\"Detect whether a sequence of elements leads to a fork of streams\"\"\"\n        # we are only interested in the result, so unwind from the end\n        for element in reversed(elements):\n            if element.chain_fork:\n                return True\n            elif element.chain_join:\n                return False\n        return False", "entry_point": "_chain_forks", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxfischer2781/chainlet/blob/4e17f9992b4780bd0d9309202e2847df640bffe8/chainlet/primitives/chain.py#L66-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036137", "code": "def compare_dicts(dict1, dict2):\n    \"\"\"\n    Checks if dict1 equals dict2\n    \"\"\"\n    for k, v in dict2.items():\n        if v != dict1[k]:\n            return False\n    return True", "entry_point": "compare_dicts", "input": "{'x': [1, 2], 'y': []}, {'x': [1, 2], 'y': []}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/20tab/twentytab-utils/blob/e02d55b1fd848c8e11ca9b7e97a5916780544d34/twentytab/utils.py#L21-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036138", "code": "def int_to_bin(i):\n    \"\"\" Integer to two bytes \"\"\"\n    # devide in two parts (bytes)\n    i1 = i % 256\n    i2 = int(i / 256)\n    # make string (little endian)\n    return chr(i1) + chr(i2)", "entry_point": "int_to_bin", "input": "True", "output": "'\\x01\\x00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/callowayproject/Transmogrify/blob/f1f891b8b923b3a1ede5eac7f60531c1c472379e/transmogrify/images2gif.py#L138-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036139", "code": "def sorts_query(sortables):\n        \"\"\" Turn the Sortables into a SQL ORDER BY query \"\"\"\n\n        stmts = []\n\n        for sortable in sortables:\n            if sortable.desc:\n                stmts.append('{} DESC'.format(sortable.field))\n            else:\n                stmts.append('{} ASC'.format(sortable.field))\n\n        return ' ORDER BY {}'.format(', '.join(stmts))", "entry_point": "sorts_query", "input": "{}", "output": "' ORDER BY '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sassoo/goldman/blob/b72540c9ad06b5c68aadb1b4fa8cb0b716260bf2/goldman/stores/postgres/store.py#L274-L285", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036140", "code": "def _parse_s3_file(original_file):\n    \"\"\"\n    Convert `s3://bucketname/path/to/file.txt` to ('bucketname', 'path/to/file.txt')\n    \"\"\"\n    bits = original_file.replace('s3://', '').split(\"/\")\n    bucket = bits[0]\n    object_key = \"/\".join(bits[1:])\n    return bucket, object_key", "entry_point": "_parse_s3_file", "input": "''", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/callowayproject/Transmogrify/blob/f1f891b8b923b3a1ede5eac7f60531c1c472379e/transmogrify/filesystem/s3.py#L9-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036141", "code": "def constant_time_compare(val1, val2):  # noqa: C901\n    \"\"\"\n    **This code was taken from the django 1.4.x codebase along with the test code**\n    Returns True if the two strings are equal, False otherwise.\n\n    The time taken is independent of the number of characters that match.\n    \"\"\"\n    if len(val1) != len(val2):\n        return False\n\n    if isinstance(val1, bytes):\n        val1 = val1.decode(\"ascii\")\n    if isinstance(val2, bytes):\n        val2 = val2.decode(\"ascii\")\n\n    result = 0\n    for x, y in zip(val1, val2):\n        result |= ord(x) ^ ord(y)\n    return result == 0", "entry_point": "constant_time_compare", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/imtapps/generic-request-signer/blob/34c18856ffda6305bd4cd931bd20365bf161d1de/generic_request_signer/check_signature.py#L51-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036142", "code": "def _json_clean(d):\n    \"\"\"Cleans the specified python `dict` by converting any tuple keys to\n    strings so that they can be serialized by JSON.\n\n    Args:\n        d (dict): python dictionary to clean up.\n\n    Returns:\n        dict: cleaned-up dictionary.\n    \"\"\"\n    result = {}\n    compkeys = {}\n    for k, v in d.items():\n        if not isinstance(k, tuple):\n            result[k] = v\n        else:\n            #v is a list of entries for instance methods/constructors on the\n            #UUID of the key. Instead of using the composite tuple keys, we\n            #switch them for a string using the \n            key = \"c.{}\".format(id(k))\n            result[key] = v\n            compkeys[key] = k\n\n    return (result, compkeys)", "entry_point": "_json_clean", "input": "{'x': [1, 2], 'y': []}", "output": "({'x': [1, 2], 'y': []}, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rosenbrockc/acorn/blob/9a44d1a1ad8bfc2c54a6b56d9efe54433a797820/acorn/logging/database.py#L240-L263", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036143", "code": "def _to_camelcase(input_string):\n    ''' a helper method to convert python to camelcase'''\n    camel_string = ''\n    for i in range(len(input_string)):\n        if input_string[i] == '_':\n            pass\n        elif not camel_string:\n            camel_string += input_string[i].upper()\n        elif input_string[i-1] == '_':\n            camel_string += input_string[i].upper()\n        else:\n            camel_string += input_string[i]\n    return camel_string", "entry_point": "_to_camelcase", "input": "'walnut thistle harbour'", "output": "'Walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/collectiveacuity/labPack/blob/52949ece35e72e3cc308f54d9ffa6bfbd96805b8/labpack/parsing/conversion.py#L6-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036144", "code": "def _to_python(input_string):\n    ''' a helper method to convert camelcase to python'''\n    python_string = ''\n    for i in range(len(input_string)):\n        if not python_string:\n            python_string += input_string[i].lower()\n        elif input_string[i].isupper():\n            python_string += '_%s' % input_string[i].lower()\n        else:\n            python_string += input_string[i]\n    return python_string", "entry_point": "_to_python", "input": "'Hello World'", "output": "'hello _world'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/collectiveacuity/labPack/blob/52949ece35e72e3cc308f54d9ffa6bfbd96805b8/labpack/parsing/conversion.py#L20-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036145", "code": "def get_instructor_term_list_name(instructor_netid, year, quarter):\n    \"\"\"\n    Return the list address of UW instructor email list for\n    the given year and quarter\n    \"\"\"\n    return \"{uwnetid}_{quarter}{year}\".format(\n        uwnetid=instructor_netid,\n        quarter=quarter.lower()[:2],\n        year=str(year)[-2:])", "entry_point": "get_instructor_term_list_name", "input": "7, set(), 'walnut thistle harbour'", "output": "'7_wa()'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/uw-it-aca/uw-restclients-mailman/blob/ef077f2cc945871422fcd66391e82264e2384b2c/uw_mailman/instructor_term_list.py#L8-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036146", "code": "def name_filter(keywords, names):\n    '''\n    Returns the first keyword from the list, unless\n    that keyword is one of the names in names, in which case\n    it continues to the next keyword.\n\n    Since keywords consists of tuples, it just returns the first\n    element of the tuple, the keyword. It also adds double\n    quotes around the keywords, as is appropriate for google queries.\n\n    Input Arguments:\n    keywords -- a list of (keyword, strength) tuples\n    names -- a list of names to be skipped\n    '''\n    name_set = set(name.lower() for name in names)\n\n    for key_tuple in keywords:\n        if not key_tuple[0] in name_set:\n            return '\\\"' + key_tuple[0] +'\\\"'\n\n    ## returns empty string if we run out, which we shouldn't\n    return ''", "entry_point": "name_filter", "input": "[], 'AbC dEf'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dossier/dossier.models/blob/c9e282f690eab72963926329efe1600709e48b13/dossier/models/linker/worker.py#L300-L321", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036147", "code": "def _normalize_direction(heading: int) -> int:\n        \"\"\"\n        Make sure that 0 < heading < 360\n\n        Args:\n            heading: base heading\n\n        Returns: corrected heading\n\n        \"\"\"\n        while heading > 359:\n            heading = int(heading - 359)\n        while heading < 0:\n            heading = int(heading + 359)\n        return heading", "entry_point": "_normalize_direction", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/weather/mission_weather/mission_weather.py#L102-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036148", "code": "def merge_configurations(configurations):\n    \"\"\"Merge configurations together and raise error if a conflict is detected\n\n    :param configurations: configurations to merge together\n    :type configurations: list of :attr:`~pyextdirect.configuration.Base.configuration` dicts\n    :return: merged configurations as a single one\n    :rtype: dict\n\n    \"\"\"\n    configuration = {}\n    for c in configurations:\n        for k, v in c.iteritems():\n            if k in configuration:\n                raise ValueError('%s already in a previous base configuration' % k)\n            configuration[k] = v\n    return configuration", "entry_point": "merge_configurations", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Diaoul/pyextdirect/blob/34ddfe882d467b3769644e8131fb90fe472eff80/pyextdirect/configuration.py#L119-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036149", "code": "def normalize_ident(ident):\n    '''Splits a generic identifier.\n\n    If ``ident`` is a tuple, then ``(ident[0], ident[1])`` is returned.\n    Otherwise, ``(ident[0], None)`` is returned.\n    '''\n    if isinstance(ident, tuple) and len(ident) == 2:\n        return ident[0], ident[1]  # content_id, subtopic_id\n    else:\n        return ident, None", "entry_point": "normalize_ident", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3], []], None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dossier/dossier.label/blob/d445e56b02ffd91ad46b0872cfbff62b9afef7ec/dossier/label/label.py#L1002-L1011", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036150", "code": "def get_cardinal_direction(direction: int) -> str:  # noqa\n    \"\"\"\n    Returns the cardinal direction (NSEW) for a degree direction\n\n    Wind Direction - Cheat Sheet:\n\n    (360) -- 011/012 -- 033/034 -- (045) -- 056/057 -- 078/079 -- (090)\n\n    (090) -- 101/102 -- 123/124 -- (135) -- 146/147 -- 168/169 -- (180)\n\n    (180) -- 191/192 -- 213/214 -- (225) -- 236/237 -- 258/259 -- (270)\n\n    (270) -- 281/282 -- 303/304 -- (315) -- 326/327 -- 348/349 -- (360)\n    \"\"\"\n    ret = ''\n    if not isinstance(direction, int):\n        direction = int(direction)\n    # Convert to range [0 360]\n    while direction < 0:\n        direction += 360\n    direction = direction % 360\n    if 304 <= direction <= 360 or 0 <= direction <= 56:\n        ret += 'N'\n        if 304 <= direction <= 348:\n            if 327 <= direction <= 348:\n                ret += 'N'\n            ret += 'W'\n        elif 12 <= direction <= 56:\n            if 12 <= direction <= 33:\n                ret += 'N'\n            ret += 'E'\n    elif 124 <= direction <= 236:\n        ret += 'S'\n        if 124 <= direction <= 168:\n            if 147 <= direction <= 168:\n                ret += 'S'\n            ret += 'E'\n        elif 192 <= direction <= 236:\n            if 192 <= direction <= 213:\n                ret += 'S'\n            ret += 'W'\n    elif 57 <= direction <= 123:\n        ret += 'E'\n        if 57 <= direction <= 78:\n            ret += 'NE'\n        elif 102 <= direction <= 123:\n            ret += 'SE'\n    elif 237 <= direction <= 303:\n        ret += 'W'\n        if 237 <= direction <= 258:\n            ret += 'SW'\n        elif 282 <= direction <= 303:\n            ret += 'NW'\n    return ret", "entry_point": "get_cardinal_direction", "input": "7", "output": "'N'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/translate.py#L15-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036151", "code": "def _find_duplicates(seq):\n    \"\"\"Find the duplicate elements from a sequence.\"\"\"\n    seen = set()\n    return [element for element in seq\n            if seq.count(element) > 1\n            and element not in seen and seen.add(element) is None]", "entry_point": "_find_duplicates", "input": "[-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/christophercrouzet/nani/blob/296ae50c0cdcfd3ed0cba23a4d2edea0d124bcb1/nani.py#L1085-L1090", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036152", "code": "def prepare_roomMap(roomMap):\n    \"\"\" Prepares the roomMap to be JSONified. That is: convert the non\n        JSON serializable objects such as set() \"\"\"\n    ret = {}\n    for room in roomMap:\n        ret[room] = [roomMap[room].name, list(roomMap[room].pcs)]\n    return ret", "entry_point": "prepare_roomMap", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwesterb/tkbd/blob/fcf16977d38a93fe9b7fa198513007ab9921b650/src/cometApi.py#L7-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036153", "code": "def prepare_schedule(schedule):\n    \"\"\" Prepares the schedule to be JSONified. That is: convert the non\n        JSON serializable objects such as the datetime.time's \"\"\"\n    ret = {}\n    for room in schedule:\n        ret[room] = []\n        for event in schedule[room]:\n            ret[room].append(((event[0].hour,\n                                event[0].minute),\n                             (event[1].hour,\n                              event[1].minute),\n                             event[2]))\n    return ret", "entry_point": "prepare_schedule", "input": "()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwesterb/tkbd/blob/fcf16977d38a93fe9b7fa198513007ab9921b650/src/cometApi.py#L15-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036154", "code": "def slice_columns(x, using=None):\n    \"\"\"\n    Slice a numpy array to make columns\n\n    Parameters\n    ----------\n    x : ndarray\n        A numpy array instance\n    using : list of integer or slice instance or None, optional\n        A list of index or slice instance\n\n    Returns\n    -------\n    ndarray\n        A list of numpy array columns sliced\n\n    \"\"\"\n    if using is None:\n        using = range(0, len(x[0]))\n    return [x[:,s] for s in using]", "entry_point": "slice_columns", "input": "['a', 'b', 'c'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdalisue/maidenhair/blob/d5095c1087d1f4d71cc57410492151d2803a9f0d/src/maidenhair/loaders/base.py#L156-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036155", "code": "def simplify_line(line, keep_comma=False):  # type: (str, bool)->str\n    \"\"\"\n    Change ' to \"\n    Remove tabs and spaces (assume no significant whitespace inside a version string!)\n    \"\"\"\n    if not line:\n        return \"\"\n    if \"#\" in line:\n        parts = line.split(\"#\")\n        simplified_line = parts[0]\n    else:\n        simplified_line = line\n\n    simplified_line = (\n        simplified_line.replace(\" \", \"\")\n        .replace(\"'\", '\"')\n        .replace(\"\\t\", \"\")\n        .replace(\"\\n\", \"\")\n        .replace(\"'''\", '\"')  # version strings shouldn't be split across lines normally\n        .replace('\"\"\"', '\"')\n    )\n    if not keep_comma:\n        simplified_line = simplified_line.strip(\" ,\")\n    return simplified_line", "entry_point": "simplify_line", "input": "'a,b,c', [-1, 0, 1, 2]", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matthewdeanmartin/jiggle_version/blob/963656a0a47b7162780a5f6c8f4b8bbbebc148f5/jiggle_version/parse_dunder_version.py#L73-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036156", "code": "def _remove_quotes(word):\n    \"\"\"\n    Remove quotes from `word` if the word starts and ands with quotes (\" or ').\n    \"\"\"\n    if not word or len(word) <= 2:\n        return word\n\n    if word[0] == word[-1] and word[0] in [\"'\", '\"']:\n        return word[1:-1]\n\n    return word", "entry_point": "_remove_quotes", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/edeposit.amqp.ftp/blob/fcdcbffb6e5d194e1bb4f85f0b8eaa9dbb08aa71/src/edeposit/amqp/ftp/decoders/parser_csv.py#L32-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036157", "code": "def wavelengthToRGB(wavelength):\n\tgamma = 0.80;\n\tintensityMax = 255;\n\n\t\"\"\" Taken from Earl F. Glynn's web page:\n\t* <a href=\"http://www.efg2.com/Lab/ScienceAndEngineering/Spectra.htm\">Spectra Lab Report</a>\n\t\"\"\"\n\n\tfactor = None\n\tr = None\n\tg = None\n\tb = None\n\n\tif((wavelength >= 380) and (wavelength<440)):\n\t\tr = -(wavelength - 440) / (440.0 - 380.0)\n\t\tg = 0.0\n\t\tb = 1.0\n\telif((wavelength >= 440) and (wavelength<490)):\n\t\tr = 0.0\n\t\tg = (wavelength - 440) / (490.0 - 440.0)\n\t\tb = 1.0\n\telif((wavelength >= 490) and (wavelength<510)):\n\t\tr = 0.0\n\t\tg = 1.0\n\t\tb = -(wavelength - 510) / (510.0 - 490.0)\n\telif((wavelength >= 510) and (wavelength<580)):\n\t\tr = (wavelength - 510) / (580.0 - 510.0)\n\t\tg = 1.0\n\t\tb = 0.0\n\telif((wavelength >= 580) and (wavelength<645)):\n\t\tr = 1.0\n\t\tg = -(wavelength - 645) / (645.0 - 580.0)\n\t\tb = 0.0\n\telif((wavelength >= 645) and (wavelength<781)):\n\t\tr = 1.0\n\t\tg = 0.0\n\t\tb = 0.0\n\telse:\n\t\tr = 0.0\n\t\tg = 0.0\n\t\tb = 0.0\n\n\t# Let the intensity fall off near the vision limits\n\tif((wavelength >= 380) and (wavelength<420)):\n\t    factor = 0.3 + 0.7*(wavelength - 380) / (420.0 - 380.0)\n\telif((wavelength >= 420) and (wavelength<701)):\n\t    factor = 1.0\n\telif((wavelength >= 701) and (wavelength<781)):\n\t    factor = 0.3 + 0.7*(780 - wavelength) / (780.0 - 700.0)\n\telse:\n\t    factor = 0.0\n\n\t# Don't want 0^x = 1 for x != 0\n\n\tr = int(round(intensityMax * pow(r * factor, gamma)))\n\tg = int(round(intensityMax * pow(g * factor, gamma)))\n\tb = int(round(intensityMax * pow(b * factor, gamma)))\n\n\treturn (r, g, b)", "entry_point": "wavelengthToRGB", "input": "1", "output": "(0, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tripzero/python-photons/blob/e185bbb55881189c7deeb599384944e61cf6048d/screensaver/screensaver.py#L15-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036158", "code": "def _cast_page(val):\n        \"\"\" Convert the page limit & offset into int's & type check \"\"\"\n\n        try:\n            val = int(val)\n            if val < 0:\n                raise ValueError\n            return val\n        except (TypeError, ValueError):\n            raise ValueError", "entry_point": "_cast_page", "input": "0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sassoo/goldman/blob/b72540c9ad06b5c68aadb1b4fa8cb0b716260bf2/goldman/queryparams/page.py#L113-L122", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036159", "code": "def evalPatternInArray(pattern, arr):\n    \"\"\"\n    returns similarity parameter of given pattern to be\n    repeated in given array\n    the index is scalled between 0-1\n    with 0 = identical\n    and val>1 = different\n\n\n    >>> arr = [0,0.5,1,  0, 0.5,1,   0,0.5,1]\n    >>> pattern = [0,0.5,1]\n    >>> evalPatternInArray(pattern, arr)\n    0\n\n    >>> arr = [0,0.5,1,  0, 0.6,1,   0,0.5,1]\n    >>> pattern = [0,0.5,1]\n    >>> evalPatternInArray(pattern, arr)\n    0.09090909090909088\n\n\n    >>> arr = [0,0.5,1,  0, 0.6,1,   0,0.5,1]\n    >>> pattern = [1,0.5,-2]\n    >>> evalPatternInArray(pattern, arr)\n    162.2057359307358\n\n    \"\"\"\n    l = len(pattern)\n    ll = len(arr)\n    # print l, ll\n    mx_additions = 3\n    sim = 0\n    i = 0\n    j = 0\n    c = 0\n    p = pattern[j]\n    v = arr[i]\n\n    while True:\n        # relative difference:\n        if p == v:\n            d = 0\n        elif v + p == 0:\n            d = v\n        else:\n            d = (p - v) / (v + p)\n        # print d\n        if abs(d) < 0.15:\n            c = mx_additions\n            j += 1\n            i += 1\n            if j == l:\n                j = 0\n            if i == ll:\n                # print sim, v, p,a\n                return sim\n            p = pattern[j]\n            v = arr[i]\n\n        elif d < 0:\n            # surplus line\n            c += 1\n            j += 1\n            if j == l:\n                j = 0\n            p += pattern[j]\n            sim += abs(d)\n        else:\n            # line missing\n            c += 1\n            i += 1\n            if i == ll:\n                return sim\n            v += arr[i]\n            sim += abs(d)\n        if c == mx_additions:\n            sim += abs(d)", "entry_point": "evalPatternInArray", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "21.03492063492063", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/radjkarl/fancyTools/blob/4c4d961003dc4ed6e46429a0c24f7e2bb52caa8b/fancytools/similarity/evalPatternInArray.py#L8-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036160", "code": "def incrementName(nameList, name):\n    \"\"\"\n    return a name that is unique in a given nameList through\n    attaching a number to it\n\n    >>> l = []\n\n    now we will add 3xfoo 2xbar and one klaus to our list:\n\n    >>> l.append( incrementName(l,'foo') )\n    >>> l.append( incrementName(l,'bar') )\n    >>> l.append( incrementName(l,'foo') )\n    >>> l.append( incrementName(l,'foo') )\n    >>> l.append( incrementName(l,'bar') )\n    >>> l.append( incrementName(l,'klaus') )\n\n    >>> print sorted(l)\n    ['bar', 'bar2', 'foo', 'foo2', 'foo3', 'klaus']\n    \"\"\"\n    if name not in nameList:\n        return name\n    newName = name + str(1)\n    for n in range(1, len(nameList) + 2):\n        found = False\n        for b in nameList:\n            newName = name + str(n)\n            if b == newName:\n                found = True\n        if not found:\n            break\n    return newName", "entry_point": "incrementName", "input": "[[1, 2], [3], []], 'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/radjkarl/fancyTools/blob/4c4d961003dc4ed6e46429a0c24f7e2bb52caa8b/fancytools/utils/incrementName.py#L3-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036161", "code": "def date_tuple(ovls):\n    \"\"\"\n    We should have a list of overlays from which to extract day month\n    year.\n    \"\"\"\n\n    day = month = year = 0\n    for o in ovls:\n        if 'day' in o.props:\n            day = o.value\n\n        if 'month' in o.props:\n            month = o.value\n\n        if 'year' in o.props:\n            year = o.value\n\n        if 'date' in o.props:\n            day, month, year = [(o or n) for o, n in zip((day, month,\n                                                          year), o.value)]\n\n    return (day, month, year)", "entry_point": "date_tuple", "input": "set()", "output": "(0, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fakedrake/overlay_parse/blob/9ac362d6aef1ea41aff7375af088c6ebef93d0cd/overlay_parse/dates.py#L57-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036162", "code": "def filter_headers(data):\n    \"\"\"\u53ea\u8bbe\u7f6ehost content-type \u8fd8\u6709x\u5f00\u5934\u7684\u5934\u90e8.\n\n    :param data(dict): \u6240\u6709\u7684\u5934\u90e8\u4fe1\u606f.\n    :return(dict): \u8ba1\u7b97\u8fdb\u7b7e\u540d\u7684\u5934\u90e8.\n    \"\"\"\n    headers = {}\n    for i in data:\n        if i == 'Content-Type' or i == 'Host' or i[0] == 'x' or i[0] == 'X':\n            headers[i] = data[i]\n    return headers", "entry_point": "filter_headers", "input": "['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/codeif/qcos/blob/284988094e54ed28161ae57b6d956b43ac1096d4/qcos/auth.py#L18-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036163", "code": "def TP1(x, u, jac=False):\n    '''Demo problem 1 for horsetail matching, takes two input vectors of size 2\n    and returns just the qoi if jac is False or the qoi and its gradient if jac\n    is True'''\n    factor = 0.1*(u[0]**2 + 2*u[0]*u[1] + u[1]**2)\n    q = 0 + factor*(x[0]**2 + 2*x[1]*x[0] + x[1]**2)\n    if not jac:\n        return q\n    else:\n        grad = [factor*(2*x[0] + 2*x[1]), factor*(2*x[0] + 2*x[1])]\n        return q, grad", "entry_point": "TP1", "input": "[-1, 0, 1, 2], [1, 2, 3], ['a', 'b', 'c']", "output": "(0.9, [-1.8, -1.8])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lwcook/horsetail-matching/blob/f3d5f8d01249debbca978f412ce4eae017458119/horsetailmatching/demoproblems.py#L8-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036164", "code": "def TP3(x, u, jac=False):\n    '''Demo problem 1 for horsetail matching, takes two input values of\n    size 1'''\n\n    q = 2 + 0.5*x + 1.5*(1-x)*u\n    if not jac:\n        return q\n    else:\n        grad = 0.5 -1.5*u\n        return q, grad", "entry_point": "TP3", "input": "0.5, 0, {1, 2, 3}", "output": "(2.25, 0.5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lwcook/horsetail-matching/blob/f3d5f8d01249debbca978f412ce4eae017458119/horsetailmatching/demoproblems.py#L53-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036165", "code": "def find_if(pred, iterable, default=None):\n    \"\"\"\n    Returns a reference to the first element in the ``iterable`` range for\n    which ``pred`` returns ``True``. If no such element is found, the\n    function returns ``default``.\n\n        >>> find_if(lambda x: x == 3, [1, 2, 3, 4])\n        3\n\n    :param pred: a predicate function to check a value from the iterable range\n    :param iterable: an iterable range to check in\n    :param default: a value that will be returned if no elements were found\n    :returns: a reference to the first found element or default\n    \"\"\"\n    return next((i for i in iterable if pred(i)), default)", "entry_point": "find_if", "input": "[[1, 2], [3], []], [], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ikalnytskyi/dooku/blob/77e6c82c9c41211c86ee36ae5e591d477945fedf/dooku/algorithm.py#L43-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036166", "code": "def _env_filenames(filenames, env):\n    \"\"\"\n    Extend filenames with ennv indication of environments.\n\n    :param list filenames: list of strings indicating filenames\n    :param str env: environment indicator\n\n    :returns: list of filenames extended with environment version\n    :rtype: list\n    \"\"\"\n    env_filenames = []\n    for filename in filenames:\n        filename_parts = filename.split('.')\n        filename_parts.insert(1, env)\n        env_filenames.extend([filename, '.'.join(filename_parts)])\n\n    return env_filenames", "entry_point": "_env_filenames", "input": "'', [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fizyk/pyramid_yml/blob/1b36c4e74194c04d7d69b4d7f86801757e78f0a6/tzf/pyramid_yml/__init__.py#L127-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036167", "code": "def replaceNewlines(string, newlineChar):\n\t\"\"\"There's probably a way to do this with string functions but I was lazy.\n\t\tReplace all instances of \\r or \\n in a string with something else.\"\"\"\n\tif newlineChar in string:\n\t\tsegments = string.split(newlineChar)\n\t\tstring = \"\"\n\t\tfor segment in segments:\n\t\t\tstring += segment\n\treturn string", "entry_point": "replaceNewlines", "input": "'a,b,c', 'Hello World'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TC01/calcpkg/blob/5168f606264620a090b42a64354331d208b00d5f/calcrepo/util.py#L13-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036168", "code": "def template_name_from_class_name(class_name):\n    \"\"\" Remove the last 'Template' in the name. \"\"\"\n    suffix = 'Template'\n    output = class_name\n    if (class_name.endswith(suffix)):\n        output = class_name[:-len(suffix)]\n    return output", "entry_point": "template_name_from_class_name", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stephanepechard/projy/blob/3146b0e3c207b977e1b51fcb33138746dae83c23/projy/cmdline.py#L32-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036169", "code": "def canonicalize_header(key):\n    \"\"\"Returns the canonicalized header name for the header name provided as an argument.\n    The canonicalized header name according to the HTTP RFC is Kebab-Camel-Case.\n\n    Keyword arguments:\n    key -- the name of the header\n    \"\"\"\n    bits = key.split('-')\n    for idx, b in enumerate(bits):\n        bits[idx] = b.capitalize()\n    return '-'.join(bits)", "entry_point": "canonicalize_header", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/baliame/http-hmac-python/blob/9884c0cbfdb712f9f37080a8efbfdce82850785f/httphmac/request.py#L99-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036170", "code": "def slim_stem(token):\n    \"\"\"\n    A very simple stemmer, for entity of GO stemming.\n\n    >>> token = 'interaction'\n    >>> slim_stem(token)\n    'interact'\n\n    \"\"\"\n    target_sulfixs = ['ic', 'tic', 'e', 'ive', 'ing', 'ical', 'nal', 'al', 'ism', 'ion', 'ation', 'ar', 'sis', 'us', 'ment']\n    for sulfix in sorted(target_sulfixs, key=len, reverse=True):\n        if token.endswith(sulfix):\n            token = token[0:-len(sulfix)]\n            break\n    if token.endswith('ll'):\n        token = token[:-1]\n    return token", "entry_point": "slim_stem", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeroyang/txttk/blob/8e6daf9cbb7dfbc4900870fb365add17929bd4ab/txttk/nlptools.py#L91-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036171", "code": "def graft(coll, branch, index):\n    '''Graft list branch into coll at index\n    '''\n    pre = coll[:index]\n    post = coll[index:]\n    ret = pre + branch + post\n    return ret", "entry_point": "graft", "input": "[-1, 0, 1, 2], [], 7", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbodenhamer/syn/blob/aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258/syn/base/a/meta.py#L29-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036172", "code": "def is_unique(seq):\n    '''Returns True if every item in the seq is unique, False otherwise.'''\n    try:\n        s = set(seq)\n        return len(s) == len(seq)\n    except TypeError:\n        buf = []\n        for item in seq:\n            if item in buf:\n                return False\n            buf.append(item)\n        return True", "entry_point": "is_unique", "input": "[[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbodenhamer/syn/blob/aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258/syn/base_utils/list.py#L211-L222", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036173", "code": "def indices_removed(lst, idxs):\n    '''Returns a copy of lst with each index in idxs removed.'''\n    ret = [item for k,item in enumerate(lst) if k not in idxs]\n    return type(lst)(ret)", "entry_point": "indices_removed", "input": "[], 1", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbodenhamer/syn/blob/aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258/syn/base_utils/list.py#L227-L230", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036174", "code": "def is_unknown(val: str) -> bool:\n    \"\"\"\n    Returns True if val contains only '/' characters\n    \"\"\"\n    for char in ('/', 'X'):\n        if val == char * len(val):\n            return True\n    return False", "entry_point": "is_unknown", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L51-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036175", "code": "def remove_leading_zeros(num: str) -> str:\n    \"\"\"\n    Strips zeros while handling -, M, and empty strings\n    \"\"\"\n    if not num:\n        return num\n    if num.startswith('M'):\n        ret = 'M' + num[1:].lstrip('0')\n    elif num.startswith('-'):\n        ret = '-' + num[1:].lstrip('0')\n    else:\n        ret = num.lstrip('0')\n    return '0' if ret in ('', 'M', '-') else ret", "entry_point": "remove_leading_zeros", "input": "0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L73-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036176", "code": "def get_taf_alt_ice_turb(wxdata: [str]) -> ([str], str, [str], [str]):  # type: ignore\n    \"\"\"\n    Returns the report list and removed: Altimeter string, Icing list, Turbulance list\n    \"\"\"\n    altimeter = ''\n    icing, turbulence = [], []\n    for i, item in reversed(list(enumerate(wxdata))):\n        if len(item) > 6 and item.startswith('QNH') and item[3:7].isdigit():\n            altimeter = wxdata.pop(i)[3:7]\n        elif item.isdigit():\n            if item[0] == '6':\n                icing.append(wxdata.pop(i))\n            elif item[0] == '5':\n                turbulence.append(wxdata.pop(i))\n    return wxdata, altimeter, icing, turbulence", "entry_point": "get_taf_alt_ice_turb", "input": "[]", "output": "([], '', [], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L406-L420", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036177", "code": "def is_possible_temp(temp: str) -> bool:\n    \"\"\"\n    Returns True if all characters are digits or 'M' (for minus)\n    \"\"\"\n    for char in temp:\n        if not (char.isdigit() or char == 'M'):\n            return False\n    return True", "entry_point": "is_possible_temp", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L423-L430", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036178", "code": "def get_station_and_time(wxdata: [str]) -> ([str], str, str):  # type: ignore\n    \"\"\"\n    Returns the report list and removed station ident and time strings\n    \"\"\"\n    station = wxdata.pop(0)\n    qtime = wxdata[0]\n    if wxdata and qtime.endswith('Z') and qtime[:-1].isdigit():\n        rtime = wxdata.pop(0)\n    elif wxdata and len(qtime) == 6 and qtime.isdigit():\n        rtime = wxdata.pop(0) + 'Z'\n    else:\n        rtime = ''\n    return wxdata, station, rtime", "entry_point": "get_station_and_time", "input": "['apple', 'banana', 'cherry']", "output": "(['banana', 'cherry'], 'apple', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L461-L473", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036179", "code": "def _is_tempo_or_prob(report_type: str) -> bool:\n    \"\"\"\n    Returns True if report type is TEMPO or PROB__\n    \"\"\"\n    if report_type == 'TEMPO':\n        return True\n    if len(report_type) == 6 and report_type.startswith('PROB'):\n        return True\n    return False", "entry_point": "_is_tempo_or_prob", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L633-L641", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036180", "code": "def get_temp_min_and_max(wxlist: [str]) -> ([str], str, str):  # type: ignore\n    \"\"\"\n    Pull out Max temp at time and Min temp at time items from wx list\n    \"\"\"\n    temp_max, temp_min = '', ''\n    for i, item in reversed(list(enumerate(wxlist))):\n        if len(item) > 6 and item[0] == 'T' and '/' in item:\n            # TX12/1316Z\n            if item[1] == 'X':\n                temp_max = wxlist.pop(i)\n            # TNM03/1404Z\n            elif item[1] == 'N':\n                temp_min = wxlist.pop(i)\n            # TM03/1404Z T12/1316Z -> Will fix TN/TX\n            elif item[1] == 'M' or item[1].isdigit():\n                if temp_min:\n                    if int(temp_min[2:temp_min.find('/')].replace('M', '-')) \\\n                            > int(item[1:item.find('/')].replace('M', '-')):\n                        temp_max = 'TX' + temp_min[2:]\n                        temp_min = 'TN' + item[1:]\n                    else:\n                        temp_max = 'TX' + item[1:]\n                else:\n                    temp_min = 'TN' + item[1:]\n                wxlist.pop(i)\n    return wxlist, temp_max, temp_min", "entry_point": "get_temp_min_and_max", "input": "[]", "output": "([], '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L682-L707", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036181", "code": "def _get_digit_list(alist: [str], from_index: int) -> ([str], [str]):  # type: ignore\n    \"\"\"\n    Returns a list of items removed from a given list of strings\n    that are all digits from 'from_index' until hitting a non-digit item\n    \"\"\"\n    ret = []\n    alist.pop(from_index)\n    while len(alist) > from_index and alist[from_index].isdigit():\n        ret.append(alist.pop(from_index))\n    return alist, ret", "entry_point": "_get_digit_list", "input": "['apple', 'banana', 'cherry'], 1", "output": "(['apple', 'cherry'], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L710-L719", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036182", "code": "def sanitize_cloud(cloud: str) -> str:\n    \"\"\"\n    Fix rare cloud layer issues\n    \"\"\"\n    if len(cloud) < 4:\n        return cloud\n    if not cloud[3].isdigit() and cloud[3] != '/':\n        if cloud[3] == 'O':\n            cloud = cloud[:3] + '0' + cloud[4:]  # Bad \"O\": FEWO03 -> FEW003\n        else:  # Move modifiers to end: BKNC015 -> BKN015C\n            cloud = cloud[:3] + cloud[4:] + cloud[3]\n    return cloud", "entry_point": "sanitize_cloud", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etcher-be/emiz/blob/1c3e32711921d7e600e85558ffe5d337956372de/emiz/avwx/core.py#L734-L745", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036183", "code": "def _extract_authenticity_token(data):\n    \"\"\"Don't look, I'm hideous!\"\"\"\n    # Super-cheap Python3 hack.\n    if not isinstance(data, str):\n        data = str(data, 'utf-8')\n    pos = data.find(\"authenticity_token\")\n    # Super-gross.\n    authtok = str(data[pos + 41:pos + 41 + 88])\n    return authtok", "entry_point": "_extract_authenticity_token", "input": "'walnut thistle harbour'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lsst-sqre/BitlyOAuth2ProxySession/blob/4d3839cfb9b897f46cffc41a5f6ff7c645a5f202/BitlyOAuth2ProxySession/Session.py#L87-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036184", "code": "def _gitignore_entry_to_regex(entry):\n    \"\"\" Take a path that you might find in a .gitignore file and turn it into a regex \"\"\"\n    ret = entry.strip()\n    ret = ret.replace('.', '\\.')\n    ret = ret.replace('*', '.*')\n    return ret", "entry_point": "_gitignore_entry_to_regex", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ajk8/workdir-python/blob/44a62f45cefb9a1b834d23191e88340b790a553e/workdir/__init__.py#L49-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036185", "code": "def helpful_error_list_get(lst, index):\n    \"\"\"\n    >>> helpful_error_list_get([1, 2, 3], 1)\n    2\n    >>> helpful_error_list_get([1, 2, 3], 4)\n    Traceback (most recent call last):\n    ...\n    IndexError: Tried to access 4, length is only 3\n    \"\"\"\n    try:\n        return lst[index]\n    except IndexError:\n        raise IndexError('Tried to access %r, length is only %r' % (index, len(lst)))", "entry_point": "helpful_error_list_get", "input": "[1, 2, 3], -3", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alexmojaki/littleutils/blob/1132d2d2782b05741a907d1281cd8c001f1d1d9d/littleutils/__init__.py#L94-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036186", "code": "def strip_optional_prefix(string, prefix, log=None):\n    \"\"\"\n    >>> strip_optional_prefix('abcdef', 'abc')\n    'def'\n    >>> strip_optional_prefix('abcdef', '123')\n    'abcdef'\n    >>> strip_optional_prefix('abcdef', '123', PrintingLogger())\n    String starts with 'abc', not '123'\n    'abcdef'\n    \"\"\"\n    if string.startswith(prefix):\n        return string[len(prefix):]\n    if log:\n        log.warn('String starts with %r, not %r', string[:len(prefix)], prefix)\n    return string", "entry_point": "strip_optional_prefix", "input": "'  padded  ', '  padded  ', []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alexmojaki/littleutils/blob/1132d2d2782b05741a907d1281cd8c001f1d1d9d/littleutils/__init__.py#L241-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036187", "code": "def strip_optional_suffix(string, suffix, log=None):\n    \"\"\"\n    >>> strip_optional_suffix('abcdef', 'def')\n    'abc'\n    >>> strip_optional_suffix('abcdef', '123')\n    'abcdef'\n    >>> strip_optional_suffix('abcdef', '123', PrintingLogger())\n    String ends with 'def', not '123'\n    'abcdef'\n    \"\"\"\n    if string.endswith(suffix):\n        return string[:-len(suffix)]\n    if log:\n        log.warn('String ends with %r, not %r', string[-len(suffix):], suffix)\n    return string", "entry_point": "strip_optional_suffix", "input": "'Hello World', '', [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alexmojaki/littleutils/blob/1132d2d2782b05741a907d1281cd8c001f1d1d9d/littleutils/__init__.py#L272-L286", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036188", "code": "def formatedTime(ms):\n    \"\"\"\n    convert milliseconds in a human readable time\n\n    >>> formatedTime(60e3)\n    '1m'\n    >>> formatedTime(1000e3)\n    '16m 40s'\n    >>> formatedTime(200000123)\n    '2d 7h 33m 20.123s'\n    \"\"\"\n\n    if ms:\n        s = ms / 1000.0\n        m, s = divmod(s, 60)\n        h, m = divmod(m, 60)\n        d, h = divmod(h, 24)\n        out = ''\n        if d:\n            out += '%gd ' % d\n        if h:\n            out += '%gh ' % h\n        if m:\n            out += '%gm ' % m\n        if s:\n            out += '%gs ' % s\n        return out[:-1]\n    return ''", "entry_point": "formatedTime", "input": "-3", "output": "'-1d 23h 59m 59.997s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/radjkarl/fancyTools/blob/4c4d961003dc4ed6e46429a0c24f7e2bb52caa8b/fancytools/utils/formatedTime.py#L5-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036189", "code": "def surround_previous_word(input_str):\n    '''\n    Surround last word in string with parentheses. If last non-whitespace character\n    is delimiter, do nothing\n    '''\n    start = None\n    end = None\n    for i, char in enumerate(reversed(input_str)):\n        if start is None:\n            if char in '{}()[]<>?|':\n                return input_str\n            elif char != ' ':\n                start = i\n        else:\n            if char in '{}()[]<>?| ':\n                end = i\n                break\n    if start is None:\n        return input_str\n    if end is None:\n        end = len(input_str)\n    new_str = ''\n    for i, char in enumerate(reversed(input_str)):\n        if char == ' ' and i + 1 == start:\n            continue\n        if i == start:\n            new_str += ') '\n        elif i == end:\n            new_str += '('\n        new_str += char\n    if end == len(input_str):\n        new_str += '('\n    return new_str[::-1]", "entry_point": "surround_previous_word", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evfredericksen/pynacea/blob/63ee0e6695209048bf2571aa2c3770f502e29b0a/pynhost/pynhost/ruleparser.py#L118-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036190", "code": "def _index(array, item, key=None):\n    \"\"\"\n    Array search function.\n\n    Written, because ``.index()`` method for array doesn't have `key` parameter\n    and raises `ValueError`, if the item is not found.\n\n    Args:\n        array (list): List of items, which will be searched.\n        item (whatever): Item, which will be matched to elements in `array`.\n        key (function, default None): Function, which will be used for lookup\n                                      into each element in `array`.\n\n    Return:\n        Index of `item` in `array`, if the `item` is in `array`, else `-1`.\n    \"\"\"\n    for i, el in enumerate(array):\n        resolved_el = key(el) if key else el\n\n        if resolved_el == item:\n            return i\n\n    return -1", "entry_point": "_index", "input": "[], ['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/edeposit.amqp.ftp/blob/fcdcbffb6e5d194e1bb4f85f0b8eaa9dbb08aa71/src/edeposit/amqp/ftp/request_parser.py#L244-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036191", "code": "def remove_trailing_string(content, trailing):\n    \"\"\"\n    Strip trailing component `trailing` from `content` if it exists.\n    Used when generating names from view classes.\n    \"\"\"\n    if content.endswith(trailing) and content != trailing:\n        return content[:-len(trailing)]\n    return content", "entry_point": "remove_trailing_string", "input": "'abc', ()", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ronaldguillen/wave/blob/20bb979c917f7634d8257992e6d449dc751256a9/wave/utils/formatting.py#L15-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036192", "code": "def class_name_to_instant_name(name):\n    \"\"\" This will convert from 'ParentName_ChildName' to\n    'parent_name.child_name' \"\"\"\n    name = name.replace('/', '_')\n    ret = name[0].lower()\n    for i in range(1, len(name)):\n        if name[i] == '_':\n            ret += '.'\n        elif '9' < name[i] < 'a' and name[i - 1] != '_':\n            ret += '_' + name[i].lower()\n        else:\n            ret += name[i].lower()\n    return ret", "entry_point": "class_name_to_instant_name", "input": "'AbC dEf'", "output": "'ab_c d_ef'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SeabornGames/Meta/blob/f2a38ad8bcc5ac177e537645853593225895df46/seaborn_meta/class_name.py#L8-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036193", "code": "def instant_name_to_class_name(name):\n    \"\"\"\n        This will convert from 'parent_name.child_name' to\n        'ParentName_ChildName'\n    :param name: str of the name to convert\n    :return: str of the converted name\n    \"\"\"\n    name2 = ''.join([e.title() for e in name.split('_')])\n    return '_'.join([e[0].upper() + e[1:] for e in name2.split('.')])", "entry_point": "instant_name_to_class_name", "input": "'walnut thistle harbour'", "output": "'Walnut Thistle Harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SeabornGames/Meta/blob/f2a38ad8bcc5ac177e537645853593225895df46/seaborn_meta/class_name.py#L23-L31", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036194", "code": "def option2tuple(opt):\n    \"\"\"Return a tuple of option, taking possible presence of level into account\"\"\"\n\n    if isinstance(opt[0], int):\n        tup = opt[1], opt[2:]\n    else:\n        tup = opt[0], opt[1:]\n\n    return tup", "entry_point": "option2tuple", "input": "['apple', 'banana', 'cherry']", "output": "('apple', ['banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Tsjerk/simopt/blob/fa63360492af35ccb92116000325b2bbf5961703/simopt.py#L191-L199", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036195", "code": "def replace_dots_to_underscores_at_last(path):\n    \"\"\"\n    Remove dot ('.') while a dot is treated as a special character in backends\n\n    Args:\n        path (str): A target path string\n\n    Returns:\n        str\n    \"\"\"\n    if path == '':\n        return path\n    bits = path.split('/')\n    bits[-1] = bits[-1].replace('.', '_')\n    return '/'.join(bits)", "entry_point": "replace_dots_to_underscores_at_last", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdalisue/django-roughpages/blob/f6a2724ece729c5deced2c2546d172561ef785ec/src/roughpages/utils.py#L47-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036196", "code": "def make_unique_ngrams(s, n):\n    \"\"\"Make a set of unique n-grams from a string.\"\"\"\n    return set(s[i:i + n] for i in range(len(s) - n + 1))", "entry_point": "make_unique_ngrams", "input": "{1, 2, 3}, 5", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lqdc/pysimstr/blob/0475005402c8efc7c3eb4f56660639e505d8986d/pysimstr.py#L15-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036197", "code": "def text(el, strip=True):\n    \"\"\"\n    Return the text of a ``BeautifulSoup`` element\n    \"\"\"\n    if not el:\n        return \"\"\n\n    text = el.text\n    if strip:\n        text = text.strip()\n    return text", "entry_point": "text", "input": "[], [5, 3, 1, 4]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bfontaine/p7magma/blob/713647aa9e3187c93c2577ef812f33ec42ae5494/magma/souputils.py#L8-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036198", "code": "def split_preserve(string, sep):\n    \"\"\" split_preserve(string : str, sep : str)  -> [str]\n\n    >>> split_preserve('''\n    \"My dear Holmes, \" said I, \"this is too much. You would certainly\n    have been burned, had you lived a few centuries ago.\n                ''', '\\\\n')\n    ['\\\\n',\n     '    \"My dear Holmes, \" said I, \"this is too much. You would certainly\\\\n',\n     '    have been burned, had you lived a few centuries ago.\\\\n',\n     '                ']\n\n    Splits the string and sticks the separator back to every string in the list.\n    \"\"\"\n    # split the whole string into a list so that you can iterate line by line.\n    str_list = string.split(sep)\n    if str_list[-1] == '':\n        # If you split 'this\\nthat\\n' you get ['this', 'that', ''] if\n        # you add newlines to every string in the list you get\n        # ['this\\n', 'that\\n', '\\n']. You've just added\n        # another newline at the end of the file.\n        del str_list[-1]\n        str_list = [x + sep for x in str_list]\n    else:\n        # ['this', 'that'] will become ['this\\n', 'that\\n'] when\n        # mapped. A newline has been added to the file. We don't want\n        # this, so we strip it below.\n        str_list     = [x + sep for x in str_list]\n        str_list[-1] = str_list[-1].rstrip(sep)\n    return str_list", "entry_point": "split_preserve", "input": "'walnut thistle harbour', 'a,b,c'", "output": "['walnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nkmathew/yasi-sexp-indenter/blob/6ec2a4675e79606c555bcb67494a0ba994b05805/yasi.py#L339-L368", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036199", "code": "def str_to_bool(val):\n    \"\"\" Return a boolean if the string value represents one\n\n    :param val: str\n    :return: bool\n    :raise: ValueError\n    \"\"\"\n\n    if isinstance(val, bool):\n        return val\n    elif val.lower() == 'true':\n        return True\n    elif val.lower() == 'false':\n        return False\n    else:\n        raise ValueError", "entry_point": "str_to_bool", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sassoo/goldman/blob/b72540c9ad06b5c68aadb1b4fa8cb0b716260bf2/goldman/utils/str_helpers.py#L67-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036200", "code": "def build_authorization_arg(authdict):\n  \"\"\"\n  Create an \"Authorization\" header value from an authdict (created by generate_response()).\n  \"\"\"\n  vallist = []\n  for k in authdict.keys():\n    vallist += ['%s=%s' % (k,authdict[k])]\n  return 'Digest '+', '.join(vallist)", "entry_point": "build_authorization_arg", "input": "{'x': [1, 2], 'y': []}", "output": "'Digest x=[1, 2], y=[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rameshg87/pyremotevbox/blob/123dffff27da57c8faa3ac1dd4c68b1cf4558b1a/pyremotevbox/ZSI/digest_auth.py#L103-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036201", "code": "def make_set(value):\n    ''' Takes a value and turns it into a set\n\n    !!!! This is important because set(string) will parse a string to\n    individual characters vs. adding the string as an element of\n    the set i.e.\n        x = 'setvalue'\n        set(x) = {'t', 'a', 'e', 'v', 'u', 's', 'l'}\n        make_set(x) = {'setvalue'}\n        or use set([x,]) by adding string as first item in list.\n    '''\n    if isinstance(value, list):\n        value = set(value)\n    elif not isinstance(value, set):\n        value = set([value,])\n    return value", "entry_point": "make_set", "input": "[5, 3, 1, 4]", "output": "{1, 3, 4, 5}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/utilities/baseutilities.py#L259-L274", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036202", "code": "def make_triple(sub, pred, obj):\n    \"\"\"Takes a subject predicate and object and joins them with a space\n\tin between\n\n    Args:\n        sub -- Subject\n        pred -- Predicate\n        obj  -- Object\n    Returns\n        str\n\t\"\"\"\n    return \"{s} {p} {o} .\".format(s=sub, p=pred, o=obj)", "entry_point": "make_triple", "input": "[-1, 0, 1, 2], [[1, 2], [3], []], ['a', 'b', 'c']", "output": "\"[-1, 0, 1, 2] [[1, 2], [3], []] ['a', 'b', 'c'] .\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/utilities/baseutilities.py#L277-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036203", "code": "def clean_iri(uri_string):\n    '''removes the <> signs from a string start and end'''\n    uri_string = str(uri_string).strip()\n    if uri_string[:1] == \"<\" and uri_string[len(uri_string)-1:] == \">\":\n        uri_string = uri_string[1:len(uri_string)-1]\n    return uri_string", "entry_point": "clean_iri", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/utilities/baseutilities.py#L790-L795", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036204", "code": "def levenshtein(s, t):\n    \"\"\" Compute the Levenshtein distance between 2 strings, which\n    is the minimum number of operations required to perform on a string to\n    get another one.\n\n    code taken from https://en.wikibooks.org\n\n    :param basestring s:\n    :param basestring t:\n    :rtype: int\n    \"\"\"\n    ''' From Wikipedia article; Iterative with two matrix rows. '''\n    if s == t:\n        return 0\n    elif len(s) == 0:\n        return len(t)\n    elif len(t) == 0:\n        return len(s)\n    v0 = [None] * (len(t) + 1)\n    v1 = [None] * (len(t) + 1)\n    for i in range(len(v0)):\n        v0[i] = i\n    for i in range(len(s)):\n        v1[0] = i + 1\n        for j in range(len(t)):\n            cost = 0 if s[i] == t[j] else 1\n            v1[j + 1] = min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost)\n        for j in range(len(v0)):\n            v0[j] = v1[j]\n\n    return v1[len(t)]", "entry_point": "levenshtein", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cogniteev/docido-python-sdk/blob/58ecb6c6f5757fd40c0601657ab18368da7ddf33/docido_sdk/toolbox/text.py#L54-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036205", "code": "def firsts(properties):\n    \"\"\"\n    Transform a dictionary of {name: [(elt, value)+]} (resulting from\n        get_properties) to a dictionary of {name, value} where names are first\n        encountered in input properties.\n\n    :param dict properties: properties to firsts.\n    :return: dictionary of parameter values by names.\n    :rtype: dict\n    \"\"\"\n\n    result = {}\n\n    # parse elts\n    for name in properties:\n        elt_properties = properties[name]\n        # add property values in result[name]\n        result[name] = elt_properties[0][1]\n\n    return result", "entry_point": "firsts", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/b3j0f/utils/blob/793871b98e90fd1c7ce9ef0dce839cc18fcbc6ff/b3j0f/utils/property.py#L638-L657", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036206", "code": "def remove_ctx(properties):\n    \"\"\"\n    Transform a dictionary of {name: [(elt, value)+]} into a dictionary of\n        {name: [value+]}.\n\n    :param dict properties: properties from where get only values.\n    :return: dictionary of parameter values by names.\n    :rtype: dict\n    \"\"\"\n    result = {}\n\n    for name in properties:\n        elt_properties = properties[name]\n        result[name] = []\n        for _, value in elt_properties:\n            result[name].append(value)\n\n    return result", "entry_point": "remove_ctx", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/b3j0f/utils/blob/793871b98e90fd1c7ce9ef0dce839cc18fcbc6ff/b3j0f/utils/property.py#L660-L677", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036207", "code": "def unique_iter(seq):\n    \"\"\"\n    See http://www.peterbe.com/plog/uniqifiers-benchmark\n    Originally f8 written by Dave Kirby\n    \"\"\"\n    seen = set()\n    return [x for x in seq if x not in seen and not seen.add(x)]", "entry_point": "unique_iter", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/foxx/python-helpful/blob/e31ad9bdf45051d8b9a0d1808d214e2293c3bbed/helpful.py#L55-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036208", "code": "def create_message(username, message):\r\n    \"\"\" Creates a standard message from a given user with the message \r\n        Replaces newline with html break \"\"\"\r\n    message = message.replace('\\n', '<br/>')\r\n    return '{{\"service\":1, \"data\":{{\"message\":\"{mes}\", \"username\":\"{user}\"}} }}'.format(mes=message, user=username)", "entry_point": "create_message", "input": "0.5, 'walnut thistle harbour'", "output": "'{\"service\":1, \"data\":{\"message\":\"walnut thistle harbour\", \"username\":\"0.5\"} }'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eeue56/PyChat.js/blob/45056de6f988350c90a6dbe674459a4affde8abc/pychatjs/server/protocol.py#L17-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036209", "code": "def get_levenshtein(first, second):\n    \"\"\"\\\n    Get the Levenshtein distance between two strings.\n\n    :param first:     the first string\n    :param second:    the second string\n    \"\"\"\n    if not first:\n        return len(second)\n\n    if not second:\n        return len(first)\n\n    prev_distances = range(0, len(second) + 1)\n    curr_distances = None\n\n    # Find the minimum edit distance between each substring of 'first' and\n    # the entirety of 'second'. The first column of each distance list is\n    # the distance from the current string to the empty string.\n    for first_idx, first_char in enumerate(first, start=1):\n        # Keep only the previous and current rows of the\n        # lookup table in memory\n        curr_distances = [first_idx]\n\n        for second_idx, second_char in enumerate(second, start=1):\n            # Take the max of the neighbors\n            compare = [\n                prev_distances[second_idx - 1],\n                prev_distances[second_idx],\n                curr_distances[second_idx - 1],\n            ]\n\n            distance = min(*compare)\n\n            if first_char != second_char:\n                distance += 1\n\n            curr_distances.append(distance)\n\n        prev_distances = curr_distances\n\n    return curr_distances[-1]", "entry_point": "get_levenshtein", "input": "[-1, 0, 1, 2], []", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chrlie/howabout/blob/780cacbdd9156106cc77f643c75191a824b034bb/src/howabout/__init__.py#L6-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036210", "code": "def __split_genomic_interval_filename(fn):\n  \"\"\"\n  Split a filename of the format chrom:start-end.ext or chrom.ext (full chrom).\n\n  :return: tuple of (chrom, start, end) -- 'start' and 'end' are None if not\n           present in the filename.\n  \"\"\"\n  if fn is None or fn == \"\":\n    raise ValueError(\"invalid filename: \" + str(fn))\n  fn = \".\".join(fn.split(\".\")[:-1])\n  parts = fn.split(\":\")\n  if len(parts) == 1:\n    return (parts[0].strip(), None, None)\n  else:\n    r_parts = parts[1].split(\"-\")\n    if len(r_parts) != 2:\n      raise ValueError(\"Invalid filename: \" + str(fn))\n    return (parts[0].strip(), int(r_parts[0]), int(r_parts[1]))", "entry_point": "__split_genomic_interval_filename", "input": "'Hello World'", "output": "('', None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pjuren/pyokit/blob/fddae123b5d817daa39496183f19c000d9c3791f/src/pyokit/io/genomeAlignment.py#L75-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036211", "code": "def _normalize_name(name):\n  \"\"\"Returns a normalized element tag or attribute name. A tag name or attribute name can be given\n  either as a string, or as a 2-tuple. If a 2-tuple, it is interpreted as (namespace, name) and is\n  returned joined by a colon \":\"\n\n  :name: a string or a 2-tuple of strings\n  \"\"\"\n  if isinstance(name, tuple):\n    ns, nm = name\n    return \"{}:{}\".format(ns, nm)\n  else:\n    return name", "entry_point": "_normalize_name", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/bidon/xml/stream_writer.py#L7-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036212", "code": "def bytes_to_int(bytes_, width = None):\n\t\"\"\"\n\t.. _bytes_to_int:\n\n\tConverts the ``bytes`` object ``bytes_`` to an ``int``.\n\tIf ``width`` is none, ``width = len(byte_) * 8`` is choosen.\n\n\tSee also: int_to_bytes_\n\n\t*Example*\n\n\t>>> from py_register_machine2.engine_tools.conversions import *\n\t>>> i = 4012\n\t>>> int_to_bytes(i)\n\tb'\\xac\\x0f'\n\t>>> bytes_to_int(int_to_bytes(i)) == i\n\tTrue\n\n\t\"\"\"\n\tif(width == None):\n\t\twidth = len(bytes_)\n\telse:\n\t\twidth = width // 8\n\tif(width > len(bytes_)):\n\t\tpadding = b\"\\x00\" * (width - len(bytes_))\n\t\tbytes_ = bytes_ + padding\n\tints = [ (int_ << (shift * 8)) for shift, int_ in enumerate(bytes_[:width])]\n\treturn sum(ints)", "entry_point": "bytes_to_int", "input": "[], 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daknuett/py_register_machine2/blob/599c53cd7576297d0d7a53344ed5d9aa98acc751/engine_tools/conversions.py#L27-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036213", "code": "def logging_format(verbose=2, style='txt'):\n    \"\"\"returns a format\n    :parameter:\n        - str style: defines style of output format (defaults to txt)\n            - txt plain text\n            - dict like text which can be casted to dict\n    \"\"\"\n    frmt = \"'dt':'%(asctime)s', 'lv':'%(levelname)-7s', 'ln':'%(name)s'\"\n\n    if verbose > 1:\n        frmt += \",\\t'Func': '%(funcName)-12s','line':%(lineno)5d, 'module':'%(module)s'\"\n    if verbose > 2:\n        frmt += \",\\n\\t'file':'%(filename)s',\\t'Process':['%(processName)s', %(process)d], \\\n                'thread':['%(threadName)s', %(thread)d], 'ms':%(relativeCreated)d\"\n    frmt += \",\\n\\t'msg':'%(message)s'\"\n    if style == \"dict\":\n        frmt = \"{\" + frmt + \"}\"\n        frmt = frmt.replace(\" \", \"\").replace(\"\\n\", \"\").replace(\"\\t\", \"\")\n    if style == \"txt\":\n        frmt = frmt.replace(\"'\", \"\").replace(\",\", \"\")\n    return frmt", "entry_point": "logging_format", "input": "False, ['apple', 'banana', 'cherry']", "output": "\"'dt':'%(asctime)s', 'lv':'%(levelname)-7s', 'ln':'%(name)s',\\n\\t'msg':'%(message)s'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmilon/Hellas/blob/542e4778692fbec90753942946f20100412ec9ee/Hellas/Delphi.py#L110-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036214", "code": "def duplicates(coll):\n    \"\"\"Return the duplicated items in the given collection\n\n    :param coll: a collection\n    :returns: a list of the duplicated items in the collection\n\n    >>> duplicates([1, 1, 2, 3, 3, 4, 1, 1])\n    [1, 3]\n\n    \"\"\"\n    return list(set(x for x in coll if coll.count(x) > 1))", "entry_point": "duplicates", "input": "[1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TaurusOlson/fntools/blob/316080c7b5bfdd88c9f3fac4a67deb5be3c319e5/fntools/fntools.py#L446-L456", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036215", "code": "def monotony(seq):\n    \"\"\"Determine the monotony of a sequence\n\n    :param seq: a sequence\n\n    :returns: 1 if the sequence is sorted (increasing)\n    :returns: 0 if it is not sorted\n    :returns: -1 if it is sorted in reverse order (decreasing)\n\n    >>> monotony([1, 2, 3])\n    1\n    >>> monotony([1, 3, 2])\n    0\n    >>> monotony([3, 2, 1])\n    -1\n\n    \"\"\"\n    if seq == sorted(seq):\n        return 1\n    elif seq == list(reversed(sorted(seq))):\n        return -1\n    else:\n        return 0", "entry_point": "monotony", "input": "[1, 2, 3]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TaurusOlson/fntools/blob/316080c7b5bfdd88c9f3fac4a67deb5be3c319e5/fntools/fntools.py#L698-L720", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036216", "code": "def count(fn, coll):\n    \"\"\"Return the count of True values returned by the predicate function applied to the\n    collection\n\n    :param fn: a predicate function\n    :param coll: a collection\n    :returns: an integer\n\n    >>> count(lambda x: x % 2 == 0, [11, 22, 31, 24, 15])\n    2\n\n    \"\"\"\n    return len([x for x in coll if fn(x) is True])", "entry_point": "count", "input": "[], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TaurusOlson/fntools/blob/316080c7b5bfdd88c9f3fac4a67deb5be3c319e5/fntools/fntools.py#L878-L890", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036217", "code": "def date_is_valid(dates):\n    \"\"\"Checks if dates (e.g. [\"17\", \"11\"] ) is valid and returns bool\n\n    Checks if the first element is between 1 and 31\n    and the second element is between 1 and 12.\n\n\n    Keyword arguments:\n    dates -- list of numbers\n\n    Returns:\n    True if the date is valid, False otherwise.\n    \"\"\"\n    if (int(dates[0]) < 1 or\n            int(dates[0]) > 31 or\n            int(dates[1]) < 1 or\n            int(dates[1]) > 12):\n\n        return False\n    return True", "entry_point": "date_is_valid", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coumbole/mailscanner/blob/ead19ac8c7dee27e507c1593032863232c13f636/mailscanner/parser.py#L11-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036218", "code": "def _remove_builtin_prefix(name):\n    \"\"\"Strip name of builtin module from start of name.\"\"\"\n    if name.startswith('builtins.'):\n        return name[len('builtins.'):]\n    elif name.startswith('__builtin__.'):\n        return name[len('__builtin__.'):]\n    return name", "entry_point": "_remove_builtin_prefix", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/etgalloway/newtabmagic/blob/7d5e88654ed7dc564f42d4e6aadb0b6e92d38bd6/newtabmagic.py#L251-L257", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036219", "code": "def class_name_str(obj, skip_parent=False):\n    \"\"\"\n    return's object's class name as string\n    \"\"\"\n    rt = str(type(obj)).split(\" \")[1][1:-2]\n    if skip_parent:\n        rt = rt.split(\".\")[-1]\n    return rt", "entry_point": "class_name_str", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "'list'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmilon/Hellas/blob/542e4778692fbec90753942946f20100412ec9ee/Hellas/Sparta.py#L333-L340", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036220", "code": "def address(addr):\n    \"\"\"\n    A special argument type that splits a string on ':' and transforms\n    the result into a tuple of host and (integer) port.\n    \"\"\"\n\n    if ':' in addr:\n        # Using rpartition here means we should be able to support\n        # IPv6, but only with a strict syntax\n        host, _sep, port = addr.rpartition(':')\n\n        # Convert the port to a number\n        try:\n            port = int(port)\n        except ValueError:\n            raise ValueError(\"invalid port number %r\" % port)\n\n        addr = (host, port)\n\n    return addr", "entry_point": "address", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klmitch/bark/blob/6e0e002d55f01fee27e3e45bb86e30af1bfeef36/bark/handlers.py#L119-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036221", "code": "def convert_choices_to_dict(choices):\n        \"\"\" Takes a list of tuples and converts it to a list of dictionaries of\n        where each dictionary has a value and text key. This is the expected format\n        of question choices to be returned by self.ask()\n\n        :param convert_choices_to_dict:\n        :type convert_choices_to_dict: list\n\n        :return:\n        :rtype:\n        \"\"\"\n\n        formatted_choices = []\n\n        for x in choices:\n            formatted_choices.append({\n                'value': x[0],\n                'text': x[1],\n            })\n\n        return formatted_choices", "entry_point": "convert_choices_to_dict", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evetrivia/thanatos/blob/664c12a8ccf4d27ab0e06e0969bbb6381f74789c/thanatos/questions/base.py#L77-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036222", "code": "def _get_first_last(details):\n    \"\"\"\n    Gets a user's first and last name from details.\n    \"\"\"\n    if \"first_name\" in details and \"last_name\" in details:\n        return details[\"first_name\"], details[\"last_name\"]\n    elif \"first_name\" in details:\n        lst = details[\"first_name\"].rsplit(\" \", 1)\n        if len(lst) == 2:\n            return lst\n        else:\n            return lst[0], \"\"\n    elif \"last_name\" in details:\n        return \"\", details[\"last_name\"]\n\n    return \"\", \"\"", "entry_point": "_get_first_last", "input": "[-1, 0, 1, 2]", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/knagra/farnsworth/blob/1b6589f0d9fea154f0a1e2231ed906764ed26d26/base/pipeline.py#L17-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036223", "code": "def split_list(\n    list_object = None,\n    granularity = None\n    ):\n    \"\"\"\n    This function splits a list into a specified number of lists. It returns a\n    list of lists that correspond to these parts. Negative numbers of parts are\n    not accepted and numbers of parts greater than the number of elements in the\n    list result in the maximum possible number of lists being returned.\n    \"\"\"\n    if granularity < 0:\n        raise Exception(\"negative granularity\")\n    mean_length = len(list_object) / float(granularity)\n    split_list_object = []\n    last_length = float(0)\n    if len(list_object) > granularity:\n        while last_length < len(list_object):\n            split_list_object.append(\n                list_object[int(last_length):int(last_length + mean_length)]\n            )\n            last_length += mean_length\n    else:\n        split_list_object = [[element] for element in list_object]\n    return split_list_object", "entry_point": "split_list", "input": "'', True", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wdbm/shijian/blob/ad6aea877e1eb99fe148127ea185f39f1413ed4f/shijian.py#L1017-L1040", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036224", "code": "def uniqify(list_):\n  \"inefficient on long lists; short lists only. preserves order.\"\n  a=[]\n  for x in list_:\n    if x not in a: a.append(x)\n  return a", "entry_point": "uniqify", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abe-winter/pg13-py/blob/c78806f99f35541a8756987e86edca3438aa97f5/pg13/sqex.py#L39-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036225", "code": "def eliminate_sequential_children(paths):\n  \"helper for infer_columns. removes paths that are direct children of the n-1 or n-2 path\"\n  return [p for i,p in enumerate(paths) if not ((i>0 and paths[i-1]==p[:-1]) or (i>1 and paths[i-2]==p[:-1]))]", "entry_point": "eliminate_sequential_children", "input": "'  padded  '", "output": "[' ', ' ', 'p', 'a', 'd', 'd', 'e', 'd', ' ', ' ']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abe-winter/pg13-py/blob/c78806f99f35541a8756987e86edca3438aa97f5/pg13/sqex.py#L46-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036226", "code": "def props_value(props):\n\n\t\"\"\"\n\tProperties value.\n\t\n\t:param dict props:\n\t   Properties dictionary.\n\t:rtype:\n\t   str\n\t:return:\n\t   Properties as string.\n\t\"\"\"\n\t\n\tsep = \"\"\n\tresult_value = \"\"\n\tfor prop_key, prop_value in props.items():\n\t\tresult_value = \"{}{}{}={}\".format(\n\t\t\tresult_value,\n\t\t\tsep,\n\t\t\tprop_key,\n\t\t\tprop_value\n\t\t)\n\t\tsep = \":\"\n\treturn result_value", "entry_point": "props_value", "input": "{'a': 1, 'b': 2}", "output": "'a=1:b=2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/miquelo/resort/blob/097a25d3257c91a75c194fd44c2797ab356f85dd/packages/resort/component/glassfish.py#L924-L947", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036227", "code": "def references_to_dict(elements):\n    \"\"\"Convery a list of HATEOAS reference objects into a dictionary.\n    Parameters\n    ----------\n    elements : List\n        List of key value pairs, i.e., [{rel:..., href:...}].\n    Returns\n    -------\n    Dictionary\n        Dictionary of rel:href pairs.\n    \"\"\"\n    dictionary = {}\n    for kvp in elements:\n        dictionary[str(kvp['rel'])] = str(kvp['href'])\n    return dictionary", "entry_point": "references_to_dict", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/heikomuller/sco-client/blob/c4afab71297f73003379bba4c1679be9dcf7cef8/scocli/scoserv.py#L286-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036228", "code": "def _subset(subset, superset):\n    \"\"\"True if subset is a subset of superset.\n\n    :param dict subset: subset to compare.\n    :param dict superset: superset to compare.\n    :return: True iif all pairs (key, value) of subset are in superset.\n    :rtype: bool\n    \"\"\"\n\n    result = True\n    for k in subset:\n        result = k in superset and subset[k] == superset[k]\n        if not result:\n            break\n    return result", "entry_point": "_subset", "input": "[], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/b3j0f/utils/blob/793871b98e90fd1c7ce9ef0dce839cc18fcbc6ff/b3j0f/utils/ut.py#L40-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036229", "code": "def IndexToColumn (ndx):\r\n        \"\"\"convert index to column. Eg: IndexToColumn(2) = \"B\", IndexToColumn(28) = \"AB\" \"\"\"\r\n        ndx -= 1\r\n        col  = chr(ndx % 26 + 65)\r\n        while (ndx > 25):\r\n                ndx  = ndx // 26\r\n                col  = chr(ndx % 26 + 64) + col\r\n        return col", "entry_point": "IndexToColumn", "input": "True", "output": "'A'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenGov/python_data_wrap/blob/7de38bb30d7a500adc336a4a7999528d753e5600/datawrap/external/xmlparse.py#L116-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036230", "code": "def ColumnToIndex (col):\r\n        \"\"\"convert column to index. Eg: ConvertInIndex(\"AB\") = 28\"\"\"\r\n        ndx = 0\r\n        for c in col:\r\n                ndx = ndx * 26 + ord(c.upper()) - 64\r\n        return ndx", "entry_point": "ColumnToIndex", "input": "['a', 'b', 'c']", "output": "731", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenGov/python_data_wrap/blob/7de38bb30d7a500adc336a4a7999528d753e5600/datawrap/external/xmlparse.py#L125-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036231", "code": "def common_vector_root(vec1, vec2):\n    \"\"\"\n    Return common root of the two vectors.\n\n    Args:\n        vec1 (list/tuple): First vector.\n        vec2 (list/tuple): Second vector.\n\n    Usage example::\n\n        >>> common_vector_root([1, 2, 3, 4, 5], [1, 2, 8, 9, 0])\n        [1, 2]\n\n    Returns:\n        list: Common part of two vectors or blank list.\n    \"\"\"\n    root = []\n    for v1, v2 in zip(vec1, vec2):\n        if v1 == v2:\n            root.append(v1)\n        else:\n            return root\n\n    return root", "entry_point": "common_vector_root", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/edeposit.amqp.harvester/blob/38cb87ccdf6bf2f550a98460d0a329c4b9dc8e2e/src/edeposit/amqp/harvester/autoparser/vectors.py#L32-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036232", "code": "def strip_commands(commands):\n    \"\"\" Strips a sequence of commands.\n\n    Strips down the sequence of commands by removing comments and\n    surrounding whitespace around each individual command and then\n    removing blank commands.\n\n    Parameters\n    ----------\n    commands : iterable of strings\n        Iterable of commands to strip.\n\n    Returns\n    -------\n    stripped_commands : list of str\n        The stripped commands with blank ones removed.\n\n    \"\"\"\n    # Go through each command one by one, stripping it and adding it to\n    # a growing list if it is not blank. Each command needs to be\n    # converted to an str if it is a bytes.\n    stripped_commands = []\n    for v in commands:\n        if isinstance(v, bytes):\n            v = v.decode(errors='replace')\n        v = v.split(';')[0].strip()\n        if len(v) != 0:\n            stripped_commands.append(v)\n    return stripped_commands", "entry_point": "strip_commands", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/frejanordsiek/GeminiMotorDrive/blob/8de347ffb91228fbfe3832098b4996fa0141d8f1/GeminiMotorDrive/utilities.py#L22-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036233", "code": "def snake_to_pascal(snake_str):\n    '''\n    Convert `snake_str` from snake_case to PascalCase\n    '''\n    components = snake_str.split('_')\n    if len(components) > 1:\n        camel = ''.join(x.title() for x in components)\n        return camel\n    # Not snake_case\n    return snake_str", "entry_point": "snake_to_pascal", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rojopolis/lycanthropy/blob/1a5ce2828714fc0e34780ac866532d4106d1a05b/lycanthropy/lycanthropy.py#L24-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036234", "code": "def find_cumulative_indices(list_of_numbers, search_sum):\n    \"\"\" \n    find_cumulative_indices([70, 58, 81, 909, 70, 215, 70, 1022, 580, 930, 898], 285) ->\n    [[4, 5],[5, 6]]\n    \"\"\"\n    u = 0\n    y = 0\n    result = []\n    for idx, val in enumerate(list_of_numbers):\n        y += list_of_numbers[idx]\n        while y >= search_sum:\n            if y == search_sum:\n                result.append(range(u, idx+1))\n            y -= list_of_numbers[u]\n            u += 1\n    # if matches are not found, empty string is returned\n    # for easier cell data handling on pandas dataframe\n    return result or ''", "entry_point": "find_cumulative_indices", "input": "(), -3", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/markomanninen/abnum/blob/9bfc8f06f34d9a51aab038638f87e2bb5f9f4c99/abnum/search.py#L5-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036235", "code": "def reduce_multiline(string):\n    \"\"\"\n    reduces a multiline string to a single line of text.\n\n\n    args:\n        string: the text to reduce\n    \"\"\"\n    string = str(string)\n    return \" \".join([item.strip()\n                     for item in string.split(\"\\n\")\n                     if item.strip()])", "entry_point": "reduce_multiline", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/utilities/formattingfunctions.py#L166-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036236", "code": "def get_bit_values(number, size=32):\r\n\t\"\"\"\r\n\tGet bit values as a list for a given number\r\n\r\n\t>>> get_bit_values(1) == [0]*31 + [1]\r\n\tTrue\r\n\r\n\t>>> get_bit_values(0xDEADBEEF)\r\n\t[1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, \\\r\n1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1]\r\n\r\n\tYou may override the default word size of 32-bits to match your actual\r\n\tapplication.\r\n\r\n\t>>> get_bit_values(0x3, 2)\r\n\t[1, 1]\r\n\r\n\t>>> get_bit_values(0x3, 4)\r\n\t[0, 0, 1, 1]\r\n\t\"\"\"\r\n\tnumber += 2**size\r\n\treturn list(map(int, bin(number)[-size:]))", "entry_point": "get_bit_values", "input": "0, 7", "output": "[0, 0, 0, 0, 0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.structures/blob/216e55f6e532a4dac47074c3911e5d65bc9d8b58/jaraco/structures/binary.py#L7-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036237", "code": "def build_uri(orig_uriparts, kwargs):\n    \"\"\"\n    Build the URI from the original uriparts and kwargs. Modifies kwargs.\n    \"\"\"\n    uriparts = []\n    for uripart in orig_uriparts:\n        # If this part matches a keyword argument (starting with _), use\n        # the supplied value. Otherwise, just use the part.\n        if uripart.startswith(\"_\"):\n            part = (str(kwargs.pop(uripart, uripart)))\n        else:\n            part = uripart\n        uriparts.append(part)\n    uri = '/'.join(uriparts)\n\n    # If an id kwarg is present and there is no id to fill in in\n    # the list of uriparts, assume the id goes at the end.\n    id = kwargs.pop('id', None)\n    if id:\n        uri += \"/%s\" % (id)\n\n    return uri", "entry_point": "build_uri", "input": "['a', 'b', 'c'], {'x': [1, 2], 'y': []}", "output": "'a/b/c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chatfirst/chatfirst/blob/11e023fc372e034dfd3417b61b67759ef8c37ad6/chatfirst/__init__.py#L100-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036238", "code": "def koschei_group(config, message, group=None):\n    \"\"\" Particular Koschei package groups\n\n    This rule limits message to particular\n    `Koschei <https://apps.fedoraproject.org/koschei/>`_ groups.\n    You can specify more groups separated by commas.\n    \"\"\"\n    if not group or 'koschei' not in message['topic']:\n        return False\n    groups = set([item.strip() for item in group.split(',')])\n    return bool(groups.intersection(message['msg'].get('groups', [])))", "entry_point": "koschei_group", "input": "{'x': [1, 2], 'y': []}, [1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fedora-infra/fmn.rules/blob/f9ec790619fcc8b41803077c4dec094e5127fc24/fmn/rules/koschei.py#L15-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036239", "code": "def get_query_kwargs(es_defs):\n    \"\"\"\n    Reads the es_defs and returns a dict of special kwargs to use when\n    query for data of an instance of a class\n\n    reference: rdfframework.sparl.queries.sparqlAllItemDataTemplate.rq\n    \"\"\"\n    rtn_dict = {}\n    if es_defs:\n        if es_defs.get(\"kds_esSpecialUnion\"):\n            rtn_dict['special_union'] = \\\n                    es_defs[\"kds_esSpecialUnion\"][0]\n        if es_defs.get(\"kds_esQueryFilter\"):\n            rtn_dict['filters'] = \\\n                    es_defs[\"kds_esQueryFilter\"][0]\n    return rtn_dict", "entry_point": "get_query_kwargs", "input": "{'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/rdfclass/rdfclass.py#L811-L826", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036240", "code": "def _merge_fields(a, b):\n    \"\"\"Merge two lists of fields.\n\n    Fields in `b` override fields in `a`. Fields in `a` are output first.\n    \"\"\"\n\n    a_names = set(x[0] for x in a)\n    b_names = set(x[0] for x in b)\n    a_keep = a_names - b_names\n\n    fields = []\n\n    for name, field in a:\n        if name in a_keep:\n            fields.append((name, field))\n\n    fields.extend(b)\n\n    return fields", "entry_point": "_merge_fields", "input": "(), {'x': [1, 2], 'y': []}", "output": "['x', 'y']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/renalreg/cornflake/blob/ce0c0b260c95e84046f108d05773f1f130ae886c/cornflake/serializers.py#L95-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036241", "code": "def convertToMapPic(byteString, mapWidth):\n    \"\"\"convert a bytestring into a 2D row x column array, representing an existing map of fog-of-war, creep, etc.\"\"\"\n    data = []\n    line = \"\"\n    for idx,char in enumerate(byteString):\n        line += str(ord(char))\n        if ((idx+1)%mapWidth)==0:\n            data.append(line)\n            line = \"\"\n    return data", "entry_point": "convertToMapPic", "input": "{}, -3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ttinies/sc2common/blob/469623c319c7ab7af799551055839ea3b3f87d54/sc2common/commonUtilFuncs.py#L89-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036242", "code": "def _get_value(first, second):\n    \"\"\"\n    \u6570\u636e\u8f6c\u5316\n    :param first:\n    :param second:\n    :return:\n    >>> _get_value(1,'2')\n    2\n    >>> _get_value([1,2],[2,3])\n    [1, 2, 3]\n    \"\"\"\n\n    if isinstance(first, list) and isinstance(second, list):\n        return list(set(first).union(set(second)))\n    elif isinstance(first, dict) and isinstance(second, dict):\n        first.update(second)\n        return first\n    elif first is not None and second is not None and not isinstance(first, type(second)):\n        return type(first)(second)\n    else:\n        return second", "entry_point": "_get_value", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "[1, 'c', 3, 4, 5, 'a', 'b']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lvjiyong/configreset/blob/cde0a426e993a6aa483d6934358e61750c944de9/configreset/__init__.py#L286-L306", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036243", "code": "def lock_key(group_id, item_id, group_width=8):\n  \"\"\"Creates a lock ID where the lower bits are the group ID and the upper bits\n  are the item ID. This allows the use of a bigint namespace for items, with a\n  limited space for grouping.\n\n  :group_id: an integer identifying the group. Must be less than\n             2 ^ :group_width:\n  :item_id: item_id an integer. must be less than 2 ^ (63 - :group_width:) - 1\n  :gropu_width: the number of bits to reserve for the group ID.\n  \"\"\"\n  if group_id >= (1 << group_width):\n    raise Exception(\"Group ID is too big\")\n  if item_id >= (1 << (63 - group_width)) - 1:\n    raise Exception(\"Item ID is too big\")\n  return (item_id << group_width) | group_id", "entry_point": "lock_key", "input": "0, 10, 1", "output": "20", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/bidon/db/access/pg_advisory_lock.py#L16-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036244", "code": "def iri(uri_string):\n        \"\"\"converts a string to an IRI or returns an IRI if already formated\n\n        Args:\n            uri_string: uri in string format\n\n        Returns:\n            formated uri with <>\n        \"\"\"\n        uri_string = str(uri_string)\n        if uri_string[:1] == \"?\":\n            return uri_string\n        if uri_string[:1] == \"[\":\n            return uri_string\n        if uri_string[:1] != \"<\":\n            uri_string = \"<{}\".format(uri_string.strip())\n        if uri_string[len(uri_string)-1:] != \">\":\n            uri_string = \"{}>\".format(uri_string.strip())\n        return uri_string", "entry_point": "iri", "input": "'  padded  '", "output": "'<padded>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/datatypes/namespaces.py#L682-L700", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036245", "code": "def run_query_series(queries, conn):\n    \"\"\"\n    Iterates through a list of queries and runs them through the connection\n\n    Args:\n    -----\n        queries: list of strings or tuples containing (query_string, kwargs)\n        conn: the triplestore connection to use\n    \"\"\"\n    results = []\n    for item in queries:\n        qry = item\n        kwargs = {}\n        if isinstance(item, tuple):\n            qry = item[0]\n            kwargs = item[1]\n        result = conn.update_query(qry, **kwargs)\n        # pdb.set_trace()\n        results.append(result)\n    return results", "entry_point": "run_query_series", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/sparql/querygenerator.py#L14-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036246", "code": "def numberp(v):\n    \"\"\"Return true iff 'v' is a number.\"\"\"\n    return (not(isinstance(v, bool)) and\n            (isinstance(v, int) or isinstance(v, float)))", "entry_point": "numberp", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gabrielfalcao/dominic/blob/a42f418fc288f3b70cb95847b405eaf7b83bb3a0/dominic/xpath/expr.py#L142-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036247", "code": "def _wrap(text, columns=80):\n    \"\"\"\n    Own \"dumb\" reimplementation of textwrap.wrap().\n\n    This is because calling .wrap() on bigger strings can take a LOT of\n    processor power. And I mean like 8 seconds of 3GHz CPU just to wrap 20kB of\n    text without spaces.\n\n    Args:\n        text (str): Text to wrap.\n        columns (int): Wrap after `columns` characters.\n\n    Returns:\n        str: Wrapped text.\n    \"\"\"\n    out = []\n    for cnt, char in enumerate(text):\n        out.append(char)\n\n        if (cnt + 1) % columns == 0:\n            out.append(\"\\n\")\n\n    return \"\".join(out)", "entry_point": "_wrap", "input": "'  padded  ', 7", "output": "'  padde\\nd  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/edeposit.amqp.calibre/blob/60ba5de0c30452d41f6e0da58d2ec6729ebdd7f1/src/edeposit/amqp/calibre/calibre.py#L21-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036248", "code": "def group(merge_func, tokens):\n\t\"\"\"\n\tGroup together those of the tokens for which the merge function returns\n\ttrue. The merge function should accept two arguments/tokens and should\n\treturn a boolean indicating whether the strings should be merged or not.\n\n\tHelper for tokenise(string, ..).\n\t\"\"\"\n\toutput = []\n\n\tif tokens:\n\t\toutput.append(tokens[0])\n\n\t\tfor token in tokens[1:]:\n\t\t\tprev_token = output[-1]\n\n\t\t\tif merge_func(prev_token, token):\n\t\t\t\toutput[-1] += token\n\t\t\telse:\n\t\t\t\toutput.append(token)\n\n\treturn output", "entry_point": "group", "input": "[5, 3, 1, 4], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pavelsof/ipatok/blob/fde3c334b8573315fd1073f14341b71f50f7f006/ipatok/tokens.py#L25-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036249", "code": "def replace_digits_with_chao(string, inverse=False):\n\t\"\"\"\n\tReplace the digits 1-5 (also in superscript) with Chao tone letters. Equal\n\tconsecutive digits are collapsed into a single Chao letter.\n\n\tIf inverse=True, smaller digits are converted into higher tones; otherwise,\n\tthey are converted into lower tones (the default).\n\n\tPart of ipatok's public API.\n\t\"\"\"\n\tchao_letters = '\u02e9\u02e8\u02e7\u02e6\u02e5'\n\n\tif inverse:\n\t\tchao_letters = chao_letters[::-1]\n\n\tstring = string.translate(str.maketrans('\u00b9\u00b2\u00b3\u2074\u2075', '12345'))\n\tstring = string.translate(str.maketrans('12345', chao_letters))\n\n\tstring = ''.join([\n\t\tchar for index, char in enumerate(string)\n\t\tif not (index and char in chao_letters and string[index-1] == char)])\n\n\treturn string", "entry_point": "replace_digits_with_chao", "input": "'  padded  ', [5, 3, 1, 4]", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pavelsof/ipatok/blob/fde3c334b8573315fd1073f14341b71f50f7f006/ipatok/tokens.py#L188-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036250", "code": "def from_ascii_hex(text: str) -> int:\n    \"\"\"Converts to an int value from both ASCII and regular hex.\n       The format used appears to vary based on whether the command was to\n       get an existing value (regular hex) or set a new value (ASCII hex\n       mirrored back from original command).\n\n       Regular hex: 0123456789abcdef\n       ASCII hex:   0123456789:;<=>?  \"\"\"\n    value = 0\n    for index in range(0, len(text)):\n        char_ord = ord(text[index:index + 1])\n        if char_ord in range(ord('0'), ord('?') + 1):\n            digit = char_ord - ord('0')\n        elif char_ord in range(ord('a'), ord('f') + 1):\n            digit = 0xa + (char_ord - ord('a'))\n        else:\n            raise ValueError(\n                \"Response contains invalid character.\")\n        value = (value * 0x10) + digit\n    return value", "entry_point": "from_ascii_hex", "input": "''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rorr73/LifeSOSpy/blob/62360fbab2e90bf04d52b547093bdab2d4e389b4/lifesospy/util.py#L30-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036251", "code": "def make_mapping(args):\n    \"\"\"Make a mapping from the name=value pairs.\"\"\"\n    mapping = {}\n\n    if args:\n        for arg in args:\n            name_value = arg.split('=', 1)\n            mapping[name_value[0]] = (name_value[1]\n                                      if len(name_value) > 1\n                                      else None)\n\n    return mapping", "entry_point": "make_mapping", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/blubberdiblub/eztemplate/blob/ab5b2b4987c045116d130fd83e216704b8edfb5d/eztemplate/__main__.py#L241-L252", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036252", "code": "def getMaskIndices(mask):\n  \"\"\"get lower and upper index of mask\"\"\"\n  return [\n    list(mask).index(True), len(mask) - 1 - list(mask)[::-1].index(True)\n  ]", "entry_point": "getMaskIndices", "input": "[1, 2, 3]", "output": "[0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tschaume/ccsgp_get_started/blob/e4e29844a3e6fc7574e9b4b8cd84131f28ddc3f2/ccsgp_get_started/examples/utils.py#L54-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036253", "code": "def _check_for_int(x):\n    \"\"\"\n    This is a compatibility function that takes a C{float} and converts it to an\n    C{int} if the values are equal.\n    \"\"\"\n    try:\n        y = int(x)\n    except (OverflowError, ValueError):\n        pass\n    else:\n        # There is no way in AMF0 to distinguish between integers and floats\n        if x == x and y == x:\n            return y\n\n    return x", "entry_point": "_check_for_int", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jmgilman/Neolib/blob/228fafeaed0f3195676137732384a14820ae285c/neolib/pyamf/amf0.py#L735-L749", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036254", "code": "def bitsetxor(b1, b2):\n\t\"\"\"\n\tIf b1 and b2 would be ``int`` s this would be ``b1 ^ b2`` :\n\n\t>>> from py_register_machine2.engine_tools.operations import bitsetxor\n\t>>> b1 = [1, 1, 1, 1]\n\t>>> b2 = [1, 1, 0, 1]\n\t>>> bitsetxor(b1, b2)\n\t[0, 0, 1, 0]\n\t>>> bin(0b1111 ^ 0b1101)\n\t'0b10'\n\t\"\"\"\n\tres = []\n\tfor bit1, bit2 in zip(b1, b2):\n\t\tres.append( bit1 ^ bit2)\n\treturn res", "entry_point": "bitsetxor", "input": "['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daknuett/py_register_machine2/blob/599c53cd7576297d0d7a53344ed5d9aa98acc751/engine_tools/operations.py#L8-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036255", "code": "def tidy_eggs_list(eggs_list):\n    \"\"\"Tidy the given eggs list\n    \"\"\"\n    tmp = []\n    for line in eggs_list:\n        line = line.lstrip().rstrip()\n        line = line.replace('\\'', '')\n        line = line.replace(',', '')\n        if line.endswith('site-packages'):\n            continue\n        tmp.append(line)\n    return tmp", "entry_point": "tidy_eggs_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pingviini/aja/blob/60ce80aee082b7a1ea9c55471c6e717c9b46710f/src/aja/utils.py#L88-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036256", "code": "def to_singular(word):\n  \"\"\"Attempts to singularize a word.\"\"\"\n  if word[-1] != \"s\":\n    return word\n  elif word.endswith(\"ies\"):\n    return word[:-3] + \"y\"\n  elif word.endswith(\"ses\"):\n    return word[:-2]\n  else:\n    return word[:-1]", "entry_point": "to_singular", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/lib/generate_models.py#L120-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036257", "code": "def get_timestamps(cols, created_name, updated_name):\n  \"\"\"Returns a 2-tuple of the timestamp columns that were found on the table definition.\"\"\"\n  has_created = created_name in cols\n  has_updated = updated_name in cols\n  return (created_name if has_created else None, updated_name if has_updated else None)", "entry_point": "get_timestamps", "input": "[5, 3, 1, 4], '  padded  ', 'walnut thistle harbour'", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/lib/generate_models.py#L145-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036258", "code": "def dict_clip(a_dict, inlude_keys_lst=[]):\n    \"\"\"returns a new dict with keys not in included in inlude_keys_lst clipped off\"\"\"\n    return dict([[i[0], i[1]] for i in list(a_dict.items()) if i[0] in inlude_keys_lst])", "entry_point": "dict_clip", "input": "{}, [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nickmilon/Hellas/blob/542e4778692fbec90753942946f20100412ec9ee/Hellas/Pella.py#L63-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036259", "code": "def ratio_and_percentage_with_time_remaining(current, total, time_remaining):\n    \"\"\"Returns the progress ratio, percentage and time remaining.\"\"\"\n    return \"{} / {} ({}% completed) (~{} remaining)\".format(\n      current,\n      total,\n      int(current / total * 100),\n      time_remaining)", "entry_point": "ratio_and_percentage_with_time_remaining", "input": "2.0, 2, {'a': 1, 'b': 2}", "output": "\"2.0 / 2 (100% completed) (~{'a': 1, 'b': 2} remaining)\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/bidon/util/terminal.py#L101-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036260", "code": "def gen_find_method(ele_type, multiple=True, extra_maps=None):\n    \"\"\"\n    \u5c06 ele_type \u8f6c\u6362\u6210\u5bf9\u5e94\u7684\u5143\u7d20\u67e5\u627e\u65b9\u6cd5\n    e.g::\n\n        make_elt(ele_type=name, False) => find_element_by_name\n        make_elt(ele_type=name, True) => find_elements_by_name\n\n    :param ele_type:\n    :type ele_type:\n    :param multiple:\n    :type multiple:\n    :param extra_maps:\n    :type extra_maps:\n    :return:\n    \"\"\"\n    _ = 'elements' if multiple else 'element'\n    d = {\n        'class': 'class_name'\n    }\n    if isinstance(extra_maps, dict):\n        d = dict(d, **extra_maps)\n    return 'find_{}_by_{}'.format(_, d.get(ele_type, ele_type))", "entry_point": "gen_find_method", "input": "False, [], ()", "output": "'find_element_by_False'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coghost/izen/blob/432db017f99dd2ba809e1ba1792145ab6510263d/izen/slnm.py#L43-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036261", "code": "def to_camel_case(snake_case_name):\n    \"\"\"\n    Converts snake_cased_names to CamelCaseNames.\n\n    :param snake_case_name: The name you'd like to convert from.\n    :type snake_case_name: string\n\n    :returns: A converted string\n    :rtype: string\n    \"\"\"\n    bits = snake_case_name.split('_')\n    return ''.join([bit.capitalize() for bit in bits])", "entry_point": "to_camel_case", "input": "'a,b,c'", "output": "'A,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/henrysher/kotocore/blob/c52d2f3878b924ceabca07f61c91abcb1b230ecc/kotocore/utils/mangle.py#L19-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036262", "code": "def get_id_constraints(pkname, pkey):\n  \"\"\"Returns primary key consraints.\n\n  :pkname: if a string, returns a dict with pkname=pkey. pkname and pkey must be enumerables of\n  matching length.\n  \"\"\"\n  if isinstance(pkname, str):\n    return {pkname: pkey}\n  else:\n    return dict(zip(pkname, pkey))", "entry_point": "get_id_constraints", "input": "'Hello World', [1, 2, 3]", "output": "{'Hello World': [1, 2, 3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/bidon/db/access/model_access.py#L215-L224", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036263", "code": "def _filter_disabled_regions(contents):\n    \"\"\"Filter regions that are contained in back-ticks.\"\"\"\n    contents = list(contents)\n\n    in_backticks = False\n    contents_len = len(contents)\n\n    index = 0\n    while index < contents_len:\n        character = contents[index]\n        if character == \"`\":\n            # Check to see if we should toggle the in_backticks\n            # mode here by looking ahead for another two characters.\n            if ((index + 2) < contents_len and\n                    \"\".join(contents[index:index + 3]) == \"```\"):\n                in_backticks = not in_backticks\n                index += 3\n                continue\n\n        if in_backticks:\n            contents[index] = \" \"\n\n        index += 1\n\n    return \"\".join(contents)", "entry_point": "_filter_disabled_regions", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/polysquare/polysquare-generic-file-linter/blob/cfc88771acd3d5551c28fa5d917bb0aeb584c4cc/polysquarelinter/lint_spelling_only.py#L28-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036264", "code": "def config_to_string(config):\n    \"\"\"Nice output string for the config, which is a nested defaultdict.\n\n    Args:\n        config (defaultdict(defaultdict)): The configuration information.\n    Returns:\n        str: A human-readable output string detailing the contents of the config.\n    \"\"\"\n    output = []\n    for section, section_content in config.items():\n        output.append(\"[{}]\".format(section))\n        for option, option_value in section_content.items():\n            output.append(\"{} = {}\".format(option, option_value))\n    return \"\\n\".join(output)", "entry_point": "config_to_string", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/slarse/pdfebc-core/blob/fc40857bc42365b7434714333e37d7a3487603a0/pdfebc_core/config_utils.py#L190-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036265", "code": "def groupby(iterable, key=None):\n    \"\"\"\n    Group items from iterable by key and return a dictionary where values are\n    the lists of items from the iterable having the same key.\n\n    :param key: function to apply to each element of the iterable.\n      If not specified or is None key defaults to identity function and\n      returns the element unchanged.\n\n    :Example:\n    >>> groupby([0, 1, 2, 3], key=lambda x: x % 2 == 0)\n    {True: [0, 2], False: [1, 3]}\n    \"\"\"\n    groups = {}\n    for item in iterable:\n        if key is None:\n            key_value = item\n        else:\n            key_value = key(item)\n        groups.setdefault(key_value, []).append(item)\n    return groups", "entry_point": "groupby", "input": "{}, {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alexandershov/mess/blob/7b0d956c1fd39cca2e4adcd5dc35952ec3ed3fd5/mess/dicts.py#L1-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036266", "code": "def _snake_to_camel(name, strict=False):\n    \"\"\"Converts parameter names from snake_case to camelCase.\n\n    Args:\n        name, str. Snake case.\n        strict: bool, default True. If True, will set name to lowercase before\n            converting, otherwise assumes original name is proper camel case.\n            Set to False if name may already be in camelCase.\n\n    Returns:\n        str: CamelCase.\n    \"\"\"\n    if strict:\n        name = name.lower()\n    terms = name.split('_')\n    return terms[0] + ''.join([term.capitalize() for term in terms[1:]])", "entry_point": "_snake_to_camel", "input": "'a,b,c', False", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bmweiner/skillful/blob/8646f54faf62cb63f165f7699b8ace5b4a08233c/skillful/interface.py#L565-L580", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036267", "code": "def xorsum(t):\n    \"\"\"\n    \u5f02\u6216\u6821\u9a8c\n    :param t:\n    :type t:\n    :return:\n    :rtype:\n    \"\"\"\n    _b = t[0]\n    for i in t[1:]:\n        _b = _b ^ i\n        _b &= 0xff\n    return _b", "entry_point": "xorsum", "input": "[-1, 0, 1, 2]", "output": "252", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coghost/izen/blob/432db017f99dd2ba809e1ba1792145ab6510263d/izen/helper.py#L682-L694", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036268", "code": "def multi_replace(original, pattens, delim='|,'):\n    \"\"\"\n        \u4f7f\u7528 ``multi_delim`` \u4e2d\u7684\u6240\u6709\u89c4\u5219\u6765\u66ff\u6362 ``original`` \u5b57\u7b26\u4e32\u5185\u5bb9\n\n    >>> orig = '\u4eca\u5929\u662f\u4e00\u4e2a\u597d\u5929\u6c14'\n    >>> multi_replace(orig, '\u4eca\u5929|\u662f|\u597d\u5929\u6c14')\n    '\u4e00\u4e2a'\n    >>> multi_replace(orig, '\u4eca\u5929,today |\u662f,is |\u597d\u5929\u6c14,good weather')\n    'today is \u4e00\u4e2agood weather'\n\n    :param delim: \u5206\u9694\u7b26, \u5916\u5c42 `|` \u5185\u5c42 `,`\n    :type delim:\n    :param original: \u539f\u59cb\u5b57\u7b26\u4e32\n    :type original: str\n    :param pattens: \u66ff\u6362\u89c4\u5219\n    :type pattens: str\n    :return:\n    :rtype:\n    \"\"\"\n    if not original:\n        return ''\n\n    if not delim or len(delim) != 2:\n        delim = '|,'\n\n    # \u6700\u5916\u5c42\u5206\u9694\u7b26, \u7b2c\u4e8c\u5c42\u5206\u9694\u7b26\n    level0, level1 = delim[0], delim[1]\n\n    for re_pair in pattens.split(level0):\n        _f, _to = re_pair, ''\n\n        re_pair = re_pair.split(level1)\n        if len(re_pair) == 2:\n            _f, _to = re_pair\n        original = original.replace(_f, _to)\n    return original", "entry_point": "multi_replace", "input": "(), (1, 2), [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coghost/izen/blob/432db017f99dd2ba809e1ba1792145ab6510263d/izen/helper.py#L1073-L1108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036269", "code": "def int_to_roman(num):\n    \"\"\"\n    https://stackoverflow.com/questions/42875103/integer-to-roman-number\n    https://stackoverflow.com/questions/33486183/convert-from-numbers-to-roman-notation\n    \"\"\"\n    conv = (\n        (\"M\", 1000),\n        (\"CM\", 900),\n        (\"D\", 500),\n        (\"CD\", 400),\n        (\"C\", 100),\n        (\"XC\", 90),\n        (\"L\", 50),\n        (\"XL\", 40),\n        (\"X\", 10),\n        (\"IX\", 9),\n        (\"V\", 5),\n        (\"IV\", 4),\n        (\"I\", 1)\n    )\n    roman = \"\"\n    i = 0\n    while num > 0:\n        while conv[i][1] > num:\n            i += 1\n        roman += conv[i][0]\n        num -= conv[i][1]\n    return roman", "entry_point": "int_to_roman", "input": "5", "output": "'V'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alexseitsinger/page_scrapers/blob/8892e4b5203ca68089e95f4c959744aa47f06b2c/src/page_scrapers/wikipedia/utils.py#L3-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036270", "code": "def _rm_compute_leading_space_alig(space_pres_split, seq):\n  \"\"\"\n  count the number of characters that precede the sequence in a repeatmasker\n  alignment line. E.g. in the following line:\n         '  chr1               11 CCCTGGAGATTCTTATT--AGTGATTTGGGCT 41'\n  the answer would be 24.\n\n  :param space_pres_split: the alignment line, split into tokens around spaces,\n                           but with the spaces conserved as tokens.\n  :param seq: the sequence token.\n  \"\"\"\n  c = 0\n  for i in range(0, len(space_pres_split)):\n    if space_pres_split[i] == seq:\n      break\n    c += len(space_pres_split[i])\n  return c", "entry_point": "_rm_compute_leading_space_alig", "input": "[], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pjuren/pyokit/blob/fddae123b5d817daa39496183f19c000d9c3791f/src/pyokit/io/repeatmaskerAlignments.py#L296-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036271", "code": "def _rm_compute_leading_space(space_s_pres_split):\n  \"\"\"\n  count the number of spaces that precede a non-space token (not including\n  empty string tokens) in a string.\n\n  :param space_s_pres_split: the string, split into tokens around spaces,\n                             but with the spaces conserved as tokens.\n  \"\"\"\n  i = 0\n  c = 0\n  while (i < len(space_s_pres_split) and\n         (space_s_pres_split[i].isspace() or\n         (space_s_pres_split[i] == \"\"))):\n    c += len(space_s_pres_split[i])\n    i += 1\n  return c", "entry_point": "_rm_compute_leading_space", "input": "['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pjuren/pyokit/blob/fddae123b5d817daa39496183f19c000d9c3791f/src/pyokit/io/repeatmaskerAlignments.py#L315-L330", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036272", "code": "def _rm_name_match(s1, s2):\n  \"\"\"\n  determine whether two sequence names from a repeatmasker alignment match.\n\n  :return: True if they are the same string, or if one forms a substring of the\n           other, else False\n  \"\"\"\n  m_len = min(len(s1), len(s2))\n  return s1[:m_len] == s2[:m_len]", "entry_point": "_rm_name_match", "input": "[], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pjuren/pyokit/blob/fddae123b5d817daa39496183f19c000d9c3791f/src/pyokit/io/repeatmaskerAlignments.py#L531-L539", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036273", "code": "def merge_dictionaries(a, b):\n  \"\"\"Merge two dictionaries; duplicate keys get value from b.\"\"\"\n  res = {}\n  for k in a:\n    res[k] = a[k]\n  for k in b:\n    res[k] = b[k]\n  return res", "entry_point": "merge_dictionaries", "input": "{'a': 1, 'b': 2}, ''", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pjuren/pyokit/blob/fddae123b5d817daa39496183f19c000d9c3791f/src/pyokit/io/maf.py#L73-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036274", "code": "def coords_to_num(coords):\n    \"\"\"\n    >>> coords_to_num((1,1,1,1))\n    1\n    >>> coords_to_num((3,3,3,3))\n    81\n    >>> coords_to_num((1,1,1,3))\n    3\n    >>> coords_to_num((1,3,1,1))\n    7\n    >>> coords_to_num((3,3,3,1))\n    79\n    >>> coords_to_num((3,3,2,2))\n    71\n    >>> coords_to_num((2,1,1,1))\n    28\n    >>> coords_to_num((2,2,2,2))\n    41\n    \"\"\"\n    x1, y1, x2, y2 = coords\n    row, col = (x1-1) * 3 + x2, (y1-1) * 3 + y2  # row,col on 9x9 board\n    return (row-1) * 9 + col", "entry_point": "coords_to_num", "input": "[-1, 0, 1, 2]", "output": "-55", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/motiejus/tictactoelib/blob/c884e206f11d9472ce0b7d08e06f894b24a20989/tictactoelib/noninteractive.py#L33-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036275", "code": "def unique(lst):\n    \"\"\"Unique with keeping sort/order\n        [\"a\", \"c\", \"b\", \"c\", \"c\", [\"d\", \"e\"]]\n\n    Results in\n        [\"a\", \"c\", \"b\", \"d\", \"e\"]\n    \"\"\"\n    nl = []\n    [(nl.append(e) if type(e) is not list else nl.extend(e)) \\\n     for e in lst if e not in nl]\n    return nl", "entry_point": "unique", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/stevepeak/inquiry/blob/f6ea435c302560ba19985b5d4ce2c97e2f321508/inquiry/helpers.py#L5-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036276", "code": "def try_pop(d, key, default):\n    \"\"\"\n    >>> d = {\"a\": \"b\", \"c\": \"d\", \"e\": \"f\"}\n    >>> try_pop(d, \"g\", \"default\")\n    'default'\n    >>> d\n    {'a': 'b', 'c': 'd', 'e': 'f'}\n    >>> try_pop(d, \"c\", \"default\")\n    'd'\n    >>> d\n    {'a': 'b', 'e': 'f'}\n    \"\"\"\n    value = d.get(key, default)\n    if key in d:\n        d.pop(key)\n    return value", "entry_point": "try_pop", "input": "{}, '  padded  ', '  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rcook/pyprelude/blob/a473b34db8045e8715154b8840291d4facc8f94c/pyprelude/util.py#L14-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036277", "code": "def _is_present(val):\n    \"\"\"Returns True if the value is not None, and if it is either not a string, or a string with\n    length > 0.\n    \"\"\"\n    if val is None:\n      return False\n    if isinstance(val, str):\n      return len(val) > 0\n    return True", "entry_point": "_is_present", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/bidon/blob/d9f24596841d0e69e8ac70a1d1a1deecea95e340/bidon/db/model/validation.py#L71-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036278", "code": "def es_field_sort(fld_name):\n    \"\"\" Used with lambda to sort fields \"\"\"\n    parts = fld_name.split(\".\")\n    if \"_\" not in parts[-1]:\n        parts[-1] = \"_\" + parts[-1]\n    return \".\".join(parts)", "entry_point": "es_field_sort", "input": "''", "output": "'_'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KnowledgeLinks/rdfframework/blob/9ec32dcc4bed51650a4b392cc5c15100fef7923a/rdfframework/search/esutilities.py#L111-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036279", "code": "def split_task_parameters(line):\n    \"\"\" Split a string of comma separated words.\"\"\"\n    if line is None:\n        result = []\n    else:\n        result = [parameter.strip() for parameter in line.split(\",\")]\n    return result", "entry_point": "split_task_parameters", "input": "'AbC dEf'", "output": "['AbC dEf']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hmartiniano/faz/blob/36a58c45e8c0718d38cb3c533542c8743e7e7a65/faz/parser.py#L18-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036280", "code": "def complete_message(buf):\r\n  \"returns msg,buf_remaining or None,buf\"\r\n  # todo: read dollar-length for strings; I dont think I can blindly trust newlines. learn about escaping\r\n  # note: all the length checks are +1 over what I need because I'm asking for *complete* lines.\r\n  lines=buf.split('\\r\\n')\r\n  if len(lines)<=1: return None,buf\r\n  nargs_raw=lines.pop(0)\r\n  assert nargs_raw[0]=='*'\r\n  nargs=int(nargs_raw[1:])\r\n  args=[]\r\n  while len(lines)>=2: # 2 because if there isn't at least a blank at the end, we're missing a terminator\r\n    if lines[0][0]=='+': args.append(lines.pop(0))\r\n    elif lines[0][0]==':': args.append(int(lines.pop(0)[1:]))\r\n    elif lines[0][0]=='$':\r\n      if len(lines)<3: return None,buf\r\n      slen,s=int(lines[0][1:]),lines[1]\r\n      if slen!=len(s): raise ValueError('length mismatch %s %r'%(slen,s)) # probably an escaping issue\r\n      lines=lines[2:]\r\n      args.append(s)\r\n    else: raise ValueError('expected initial code in %r'%lines)\r\n  if len(args)==nargs: return args,'\\r\\n'.join(lines)\r\n  else: return None,buf", "entry_point": "complete_message", "input": "'Hello World'", "output": "(None, 'Hello World')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abe-winter/pg13-py/blob/c78806f99f35541a8756987e86edca3438aa97f5/pg13/stubredis.py#L80-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036281", "code": "def parse_cmdLine_instructions(args):\n    \"\"\" Parses command-line arguments.  These are\n        instruction to the manager to create instances and\n        put settings. \"\"\"\n    instructions = dict()\n    rargs = list()\n    for arg in args:\n        if arg[:2] == '--':\n            tmp = arg[2:]\n            bits = tmp.split('=', 1)\n            if len(bits) == 1:\n                bits.append('')\n            instructions[bits[0]] = bits[1]\n        else:\n            rargs.append(arg)\n    return instructions, rargs", "entry_point": "parse_cmdLine_instructions", "input": "[]", "output": "({}, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwesterb/mirte/blob/c58db8c993cd15ffdc64b52703cd466213913200/src/main.py#L14-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036282", "code": "def by_published(queryset, published_string='true'):\n  \"\"\" Filter queryset by publish status \"\"\"\n  if published_string == 'true':\n    queryset = queryset.filter(published=1)\n  elif published_string == 'false':\n    queryset = queryset.filter(published=0)\n  # Any other value will return both published and unpublished\n  return queryset", "entry_point": "by_published", "input": "[[1, 2], [3], []], 'AbC dEf'", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenVolunteeringPlatform/django-ovp-search/blob/003ceecc0a87be31fe8195f65367c52631f72b57/ovp_search/filters.py#L102-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036283", "code": "def by_name(queryset, name=None):\n  \"\"\" Filter queryset by name, with word wide auto-completion \"\"\"\n  if name:\n    queryset = queryset.filter(name=name)\n  return queryset", "entry_point": "by_name", "input": "[], ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OpenVolunteeringPlatform/django-ovp-search/blob/003ceecc0a87be31fe8195f65367c52631f72b57/ovp_search/filters.py#L112-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036284", "code": "def cleandata(inputlist):\n    \"\"\"\n    Helper function for parse.getdata.\n    Remove empty variables, convert strings to float\n\n    args:\n        inputlist: list\n            List of Variables\n    Returns:\n        ouput:\n            Cleaned list\n    \"\"\"\n    output = []\n    for e in inputlist:\n        new = []\n        for f in e:\n            if f == \"--\":\n                new.append(None)\n            else:\n                new.append(float(f))\n        output.append(new)\n    return output", "entry_point": "cleandata", "input": "[[1, 2], [3], []]", "output": "[[1.0, 2.0], [3.0], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/calvinku96/labreporthelper/blob/4d436241f389c02eb188c313190df62ab28c3763/labreporthelper/parse.py#L54-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036285", "code": "def get_first_content(el_list, alt=None, strip=True):\n    \"\"\"\n    Return content of the first element in `el_list` or `alt`. Also return `alt`\n    if the content string of first element is blank.\n\n    Args:\n        el_list (list): List of HTMLElement objects.\n        alt (default None): Value returner when list or content is blank.\n        strip (bool, default True): Call .strip() to content.\n\n    Returns:\n        str or alt: String representation of the content of the first element \\\n                    or `alt` if not found.\n    \"\"\"\n    if not el_list:\n        return alt\n\n    content = el_list[0].getContent()\n\n    if strip:\n        content = content.strip()\n\n    if not content:\n        return alt\n\n    return content", "entry_point": "get_first_content", "input": "[], [1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/edeposit.amqp.harvester/blob/38cb87ccdf6bf2f550a98460d0a329c4b9dc8e2e/src/edeposit/amqp/harvester/scrappers/utils.py#L62-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036286", "code": "def is_absolute_url(url, protocol=\"http\"):\n    \"\"\"\n    Test whether `url` is absolute url (``http://domain.tld/something``) or\n    relative (``../something``).\n\n    Args:\n        url (str): Tested string.\n        protocol (str, default \"http\"): Protocol which will be seek at the\n                 beginning of the `url`.\n\n    Returns:\n        bool: True if url is absolute, False if not.\n    \"\"\"\n    if \":\" not in url:\n        return False\n\n    protocol, rest = url.split(\":\", 1)\n\n    if protocol.startswith(protocol) and rest.startswith(\"//\"):\n        return True\n\n    return False", "entry_point": "is_absolute_url", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/edeposit.amqp.harvester/blob/38cb87ccdf6bf2f550a98460d0a329c4b9dc8e2e/src/edeposit/amqp/harvester/scrappers/utils.py#L90-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036287", "code": "def detect_range(line = None):\n    '''\n    A helper function that checks a given host line to see if it contains\n    a range pattern descibed in the docstring above.\n\n    Returnes True if the given line contains a pattern, else False.\n    '''\n    if (not line.startswith(\"[\") and\n        line.find(\"[\") != -1 and\n        line.find(\":\") != -1 and\n        line.find(\"]\") != -1 and\n        line.index(\"[\") < line.index(\":\") < line.index(\"]\")):\n        return True\n    else:\n        return False", "entry_point": "detect_range", "input": "''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cirruscluster/cirruscluster/blob/977409929dd81322d886425cdced10608117d5d7/cirruscluster/ext/ansible/inventory/expand_hosts.py#L37-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036288", "code": "def readable_time_delta(seconds):\n    \"\"\"\n    Convert a number of seconds into readable days, hours, and minutes\n    \"\"\"\n    days = seconds // 86400\n    seconds -= days * 86400\n    hours = seconds // 3600\n    seconds -= hours * 3600\n    minutes = seconds // 60\n\n    m_suffix = 's' if minutes != 1 else ''\n    h_suffix = 's' if hours != 1 else ''\n    d_suffix = 's' if days != 1 else ''\n\n    retval = u'{0} minute{1}'.format(minutes, m_suffix)\n\n    if hours != 0:\n        retval = u'{0} hour{1} and {2}'.format(hours, h_suffix, retval)\n\n    if days != 0:\n        retval = u'{0} day{1}, {2}'.format(days, d_suffix, retval)\n\n    return retval", "entry_point": "readable_time_delta", "input": "True", "output": "'0 minutes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaunduncan/helga-reminders/blob/e2b88cb65eade270ed175ceb6a4d6339554b893b/helga_reminders.py#L82-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036289", "code": "def hourminsec(n_seconds):\n    '''Generate a string of hours and minutes from total number of seconds\n\n    Args\n    ----\n    n_seconds: int\n        Total number of seconds to calculate hours, minutes, and seconds from\n\n    Returns\n    -------\n    hours: int\n        Number of hours in `n_seconds`\n    minutes: int\n        Remaining minutes in `n_seconds` after number of hours\n    seconds: int\n        Remaining seconds in `n_seconds` after number of minutes\n    '''\n\n    hours, remainder = divmod(n_seconds, 3600)\n    minutes, seconds = divmod(remainder, 60)\n\n    return abs(hours), abs(minutes), abs(seconds)", "entry_point": "hourminsec", "input": "7", "output": "(0, 0, 7)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ryanjdillon/pyotelem/blob/816563a9c3feb3fa416f1c2921c6b75db34111ad/pyotelem/plots/plotutils.py#L42-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036290", "code": "def parse_column(column):\n    \"\"\"\n    Helper method for DataTable.fromcsvstring()\n\n    Given a list, parse_column tries to see if it should cast\n    everything in that list to a float, an int, or leave it as is.\n\n    Always returns a list.\n    \"\"\"\n    try:\n        float_attempt = [float(i) for i in column]\n    except ValueError:\n        return column\n    else:\n        try:\n            int_attempt = [int(j) for j in column]\n        except ValueError:\n            return float_attempt\n        else:\n            return int_attempt", "entry_point": "parse_column", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/emlazzarin/acrylic/blob/08c6702d73b9660ead1024653f4fa016f6340e46/acrylic/datatable.py#L881-L900", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036291", "code": "def decompose_dateint(dateint):\n    \"\"\"Decomposes the given dateint into its year, month and day components.\n\n    Arguments\n    ---------\n    dateint : int\n        An integer object decipting a specific calendaric day; e.g. 20161225.\n\n    Returns\n    -------\n    year : int\n        The year component of the given dateint.\n    month : int\n        The month component of the given dateint.\n    day : int\n        The day component of the given dateint.\n    \"\"\"\n    year = int(dateint / 10000)\n    leftover = dateint - year * 10000\n    month = int(leftover / 100)\n    day = leftover - month * 100\n    return year, month, day", "entry_point": "decompose_dateint", "input": "0.5", "output": "(0, 0, 0.5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/shaypal5/utilitime/blob/554ca05fa83c2dbf5d6cf9c9cfa6b03ee6cdb609/utilitime/dateint/dateint.py#L16-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036292", "code": "def format_value(value):\n    \"\"\"\n    Convert a list into a comma separated string, for displaying\n    select multiple values in emails.\n    \"\"\"\n    if isinstance(value, list):\n        value = \", \".join([v.strip() for v in value])\n    return value", "entry_point": "format_value", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/minhhoit/yacms/blob/2921b706b7107c6e8c5f2bbf790ff11f85a2167f/yacms/forms/page_processors.py#L15-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036293", "code": "def infer_compression(url):\n\t\"\"\"\n\tGiven a URL or filename, infer the compression code for tar.\n\t\"\"\"\n\t# cheat and just assume it's the last two characters\n\tcompression_indicator = url[-2:]\n\tmapping = dict(\n\t\tgz='z',\n\t\tbz='j',\n\t\txz='J',\n\t)\n\t# Assume 'z' (gzip) if no match\n\treturn mapping.get(compression_indicator, 'z')", "entry_point": "infer_compression", "input": "(1, 2)", "output": "'z'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.context/blob/105f81a6204d3a9fbb848675d62be4ef185f36f2/jaraco/context.py#L191-L203", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036294", "code": "def replace(dict,line):\n    \"\"\"\n    Find and replace the special words according to the dictionary.\n\n    Parameters\n    ==========\n    dict : Dictionary\n        A dictionary derived from a yaml file. Source language as keys and the target language as values.\n    line : String\n        A string need to be processed.\n    \"\"\"\n    words = line.split()\n    new_line = \"\"\n\n    for word in words:\n        fst = word[0]\n        last = word[-1]\n        # Check if the word ends with a punctuation\n        if last == \",\" or last == \";\" or last == \".\":\n            clean_word = word[0:-1]\n            last = last + \" \"\n        elif last == \"]\":\n            clean_word = word[0:-1]\n        else:\n            clean_word = word\n            last = \" \"\n\n        # Check if the word starts with \"[\"\n        if fst == \"[\":\n            clean_word = clean_word[1:]\n        else:\n            clean_word = clean_word\n            fst = \"\"\n\n        find = dict.get(clean_word)\n\n        if find == None:\n            new_line = new_line + fst + str(clean_word) + last\n        else:\n            new_line = new_line + fst + str(find) + last\n            \n    return new_line", "entry_point": "replace", "input": "{}, 'walnut thistle harbour'", "output": "'walnut thistle harbour '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/AguaClara/aide_document-DEPRECATED/blob/3f3b5c9f321264e0e4d8ed68dfbc080762579815/aide_document/translate.py#L6-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036295", "code": "def letter2num(letters, zbase=False):\n    \"\"\"A = 1, C = 3 and so on. Convert spreadsheet style column\n    enumeration to a number.\n\n    Answers:\n    A = 1, Z = 26, AA = 27, AZ = 52, ZZ = 702, AMJ = 1024\n\n    >>> from channelpack.pullxl import letter2num\n\n    >>> letter2num('A') == 1\n    True\n    >>> letter2num('Z') == 26\n    True\n    >>> letter2num('AZ') == 52\n    True\n    >>> letter2num('ZZ') == 702\n    True\n    >>> letter2num('AMJ') == 1024\n    True\n    >>> letter2num('AMJ', zbase=True) == 1023\n    True\n    >>> letter2num('A', zbase=True) == 0\n    True\n\n    \"\"\"\n\n    letters = letters.upper()\n    res = 0\n    weight = len(letters) - 1\n    assert weight >= 0, letters\n    for i, c in enumerate(letters):\n        assert 65 <= ord(c) <= 90, c  # A-Z\n        res += (ord(c) - 64) * 26**(weight - i)\n    if not zbase:\n        return res\n    return res - 1", "entry_point": "letter2num", "input": "'abc', 'abc'", "output": "730", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tomnor/channelpack/blob/9ad3cd11c698aed4c0fc178385b2ba38a7d0efae/channelpack/pullxl.py#L384-L419", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036296", "code": "def parse_bool(value):\n    \"\"\" Convert a string to a boolean\n    \n    >>> parse_bool(None)\n    False\n    >>> parse_bool(\"true\")\n    True\n    >>> parse_bool(\"TRUE\")\n    True\n    >>> parse_bool(\"yes\")\n    True\n    >>> parse_bool(\"1\")\n    True\n    >>> parse_bool(\"false\")\n    False\n    >>> parse_bool(\"sqdf\")\n    False\n    >>> parse_bool(False)\n    False\n    >>> parse_bool(True)\n    True\n    \"\"\"\n    if value is None:\n        return False\n    if value is True or value is False:\n        return value\n    boolean = str(value).strip().lower()\n    return boolean in ['true', 'yes', 'on', '1']", "entry_point": "parse_bool", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kodexlab/reliure/blob/0450c7a9254c5c003162738458bbe0c49e777ba5/reliure/utils/__init__.py#L17-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036297", "code": "def humanize(t):\n    \"\"\"\n    >>> print humanize(0)\n    now\n    >>> print humanize(1)\n    in a minute\n    >>> print humanize(60)\n    in a minute\n    >>> print humanize(61)\n    in 2 minutes\n    >>> print humanize(3600)\n    in an hour\n    >>> print humanize(3601)\n    in 2 hours\n    \"\"\"\n    m, s = divmod(t, 60)\n    if s:\n        m += 1                 # ceil minutes \n    h, m = divmod(m, 60)\n    if m and h:\n        h += 1                 # ceil hours\n#    d, h = divmod(h, 24)\n\n    if h > 1:\n        res = 'in %d hours' % h\n    elif h == 1:\n        res = 'in an hour'\n    else:\n        if m > 1:\n            res = 'in %d minutes' % m\n        elif m == 1:\n            res = 'in a minute'\n        else:\n            res = 'now'\n    return res", "entry_point": "humanize", "input": "0.5", "output": "'in a minute'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/axil/redissentry-core/blob/210c30226d9f4e35b8be47f7c3ce52b975d26e8c/redissentrycore/utils.py#L6-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036298", "code": "def first(iterable, default=None):\n    \"\"\"Try to get input iterable first item or default if iterable is empty.\n\n    :param Iterable iterable: iterable to iterate on. Must provide the method\n        __iter__.\n    :param default: default value to get if input iterable is empty.\n    :raises TypeError: if iterable is not an iterable value.\n\n    :Example:\n\n    >>> first('tests')\n    't'\n    >>> first('', default='test')\n    'test'\n    >>> first([])\n    None\n    \"\"\"\n\n    result = default\n\n    # start to get the iterable iterator (raises TypeError if iter)\n    iterator = iter(iterable)\n    # get first element\n    try:\n        result = next(iterator)\n    except StopIteration: # if no element exist, result equals default\n        pass\n\n    return result", "entry_point": "first", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/b3j0f/utils/blob/793871b98e90fd1c7ce9ef0dce839cc18fcbc6ff/b3j0f/utils/iterable.py#L93-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036299", "code": "def last(iterable, default=None):\n    \"\"\"Try to get the last iterable item by successive iteration on it.\n\n    :param Iterable iterable: iterable to iterate on. Must provide the method\n        __iter__.\n    :param default: default value to get if input iterable is empty.\n    :raises TypeError: if iterable is not an iterable value.\n\n    :Example:\n\n    >>> last('tests')\n    's'\n    >>> last('', default='test')\n    'test'\n    >>> last([])\n    None\"\"\"\n\n    result = default\n\n    iterator = iter(iterable)\n\n    while True:\n        try:\n            result = next(iterator)\n\n        except StopIteration:\n            break\n\n    return result", "entry_point": "last", "input": "[], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/b3j0f/utils/blob/793871b98e90fd1c7ce9ef0dce839cc18fcbc6ff/b3j0f/utils/iterable.py#L123-L151", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036300", "code": "def _match_mask(mask, ctype):\n    \"\"\"\n    Determine if a content type mask matches a given content type.\n\n    :param mask: The content type mask, taken from the Accept\n                 header.\n    :param ctype: The content type to match to the mask.\n    \"\"\"\n\n    # Handle the simple cases first\n    if '*' not in mask:\n        return ctype == mask\n    elif mask == '*/*':\n        return True\n    elif not mask.endswith('/*'):\n        return False\n\n    mask_major = mask[:-2]\n    ctype_major = ctype.split('/', 1)[0]\n    return ctype_major == mask_major", "entry_point": "_match_mask", "input": "[], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klmitch/aversion/blob/90ca68e7d6426a77db8a926171f8d3bbeb00ee4c/aversion.py#L137-L156", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036301", "code": "def can_cloak_as(user, other_user):\n    \"\"\"\n    Returns true if `user` can cloak as `other_user`\n    \"\"\"\n    # check to see if the user is allowed to do this\n    can_cloak = False\n    try:\n        can_cloak = user.can_cloak_as(other_user)\n    except AttributeError as e:\n        try:\n            can_cloak = user.is_staff\n        except AttributeError as e:\n            pass\n\n    return can_cloak", "entry_point": "can_cloak_as", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSU-OIT-ARC/django-cloak/blob/3f09711837f4fe7b1813692daa064e536135ffa3/cloak/__init__.py#L5-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036302", "code": "def render_args(arglst, argdct):\n    '''Render arguments for command-line invocation.\n\n    arglst: A list of Argument objects (specifies order)\n    argdct: A mapping of argument names to values (specifies rendered values)\n    '''\n    out = ''\n    \n    for arg in arglst:\n        if arg.name in argdct:\n            rendered = arg.render(argdct[arg.name])\n            if rendered:\n                out += ' '\n                out += rendered\n\n    return out", "entry_point": "render_args", "input": "[], [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mbodenhamer/syn.utils/blob/82b0dfa27d08858e802a166a44870db10a02a964/syn/utils/cmdargs/args.py#L155-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036303", "code": "def calculate_indent(text):\n    \"\"\"\n    :param text:\n    :type text: str\n    :return:\n    \"\"\"\n    indent = 0\n    for c in text:\n        if c is '\\t':\n            raise ValueError()\n        if c is not ' ':\n            return indent,text[indent:]\n        indent += 1\n    return indent,''", "entry_point": "calculate_indent", "input": "'abc'", "output": "(0, 'abc')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/msfrank/cifparser/blob/ecd899ba2e7b990e2cec62b115742d830e7e4384/cifparser/grammar.py#L58-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036304", "code": "def map_rus_to_lat(char):\n    \"\"\" \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 (\u043f\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e) \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0435 \"\"\"\n    map_dict = {\n        u'\u0415': u'E',\n        u'\u0422': u'T',\n        u'\u0423': u'Y',\n        u'\u041e': u'O',\n        u'\u0420': u'P',\n        u'\u0410': u'A',\n        u'\u041d': u'H',\n        u'\u041a': u'K',\n        u'\u0425': u'X',\n        u'\u0421': u'C',\n        u'\u0412': u'B',\n        u'\u041c': u'M',\n    }\n    # \u0435\u0441\u043b\u0438 \u0431\u0443\u043a\u0432\u0430 \u0435\u0441\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0443\u0441\u0441\u043a\u0438\u0445 \u0441\u0438\u0432\u043e\u043b\u043e\u0432, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0435\u0435 \u0432 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0439 \u0434\u0432\u043e\u0439\u043d\u0438\u043a\n    if char in map_dict:\n        return map_dict[char]\n    else:\n        return char", "entry_point": "map_rus_to_lat", "input": "('a', 'b', 'c')", "output": "('a', 'b', 'c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/telminov/sw-python-utils/blob/68f976122dd26a581b8d833c023f7f06542ca85c/swutils/string.py#L4-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036305", "code": "def _short_circuit(value=None):\n    \"\"\"\n    Add the `value` to the `collection` by modifying the collection to be\n    either a dict or list depending on what is already in the collection and\n    value.\n    Returns the collection with the value added to it.\n\n    Clean up by removing single item array and single key dict.\n    ['abc'] -> 'abc'\n    [['abc']] -> 'abc'\n    [{'abc':123},{'def':456}] -> {'abc':123,'def':456}\n    [{'abc':123},{'abc':456}] -> [{'abc':123,'abc':456}] # skip for same set keys\n    [[{'abc':123},{'abc':456}]] -> [{'abc':123,'abc':456}]\n    \"\"\"\n    if not isinstance(value, list):\n        return value\n    if len(value) == 0:\n        return value\n    if len(value) == 1:\n        if not isinstance(value[0], list):\n            return value[0]\n        else:\n            if len(value[0]) == 1:\n                return value[0][0]\n            else:\n                return value[0]\n    else:\n        value = filter(None, value)\n        # Only checking first item and assumin all others are same type\n        if isinstance(value[0], dict):\n            if set(value[0].keys()) == set(value[1].keys()):\n                return value\n            elif max([len(x.keys()) for x in value]) == 1:\n                newvalue = {}\n                for v in value:\n                    key = v.keys()[0]\n                    newvalue[key] = v[key]\n                return newvalue\n            else:\n                return value\n        else:\n            return value", "entry_point": "_short_circuit", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jkenlooper/chill/blob/35360c17c2a3b769ecb5406c6dabcf4cc70bd76f/src/chill/api.py#L8-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036306", "code": "def only_specific_multisets(ent, multisets_to_show):\n    '''\n    returns a pretty-printed string for specific features in a FeatureCollection\n    '''\n    out_str = []\n    for mset_name in multisets_to_show:\n        for key, count in ent[mset_name].items():\n            out_str.append( '%s - %d: %s' % (mset_name, count, key) )\n    return '\\n'.join(out_str)", "entry_point": "only_specific_multisets", "input": "[5, 3, 1, 4], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dossier/dossier.fc/blob/3e969d0cb2592fc06afc1c849d2b22283450b5e2/python/dossier/fc/dump.py#L132-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036307", "code": "def applydiff(tokens,deltas):\r\n  \"tokens can be a string or a list of strings.\\\r\n  deltas is [Delta,...]. Delta.text is actually a tokenlist of the same type as tokens (string or list of string).\\\r\n  If tokens & tokenslist are strings, must be unicode for the offsets to match what JS produces.\\\r\n    (If they're lists, it doesn't matter; the offsets are relative to the lists, not internal to the strings).\"\r\n  sizechange=0\r\n  for a,b,replace in deltas:\r\n    tokens=tokens[:a+sizechange]+replace+tokens[b+sizechange:]\r\n    sizechange+=len(replace)-(b-a)\r\n  return tokens", "entry_point": "applydiff", "input": "'  padded  ', set()", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abe-winter/pg13-py/blob/c78806f99f35541a8756987e86edca3438aa97f5/pg13/diff.py#L12-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036308", "code": "def splitstatus(a,statusfn):\r\n  'split sequence into subsequences based on binary condition statusfn. a is a list, returns list of lists'\r\n  groups=[]; mode=None\r\n  for elt,status in zip(a,map(statusfn,a)):\r\n    assert isinstance(status,bool)\r\n    if status!=mode: mode=status; group=[mode]; groups.append(group)\r\n    group.append(elt)\r\n  return groups", "entry_point": "splitstatus", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abe-winter/pg13-py/blob/c78806f99f35541a8756987e86edca3438aa97f5/pg13/diff.py#L28-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036309", "code": "def list_diff(list1, list2):\n    \"\"\" Ssymetric list difference \"\"\"\n    diff_list = []\n    for item in list1:\n        if not item in list2:\n            diff_list.append(item)\n    for item in list2:\n        if not item in list1:\n            diff_list.append(item)\n    return diff_list", "entry_point": "list_diff", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "[5, 4, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EventTeam/beliefs/blob/c07d22b61bebeede74a72800030dde770bf64208/src/beliefs/belief_utils.py#L59-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036310", "code": "def asym_list_diff(list1, list2):\n    \"\"\" Asymmetric list difference \"\"\"\n    diff_list = []\n    for item in list1:\n        if not item in list2:\n            diff_list.append(item)\n    return diff_list", "entry_point": "asym_list_diff", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "[-1, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EventTeam/beliefs/blob/c07d22b61bebeede74a72800030dde770bf64208/src/beliefs/belief_utils.py#L70-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036311", "code": "def next_tokens_in_sequence(observed, current):\n    \"\"\" Given the observed list of tokens, and the current list,\n    finds out what should be next next emitted word\n    \"\"\"\n    idx = 0\n    for word in current:\n        if observed[idx:].count(word) != 0:\n            found_pos = observed.index(word, idx)\n            idx = max(idx + 1, found_pos)\n        # otherwise, don't increment idx\n    if idx < len(observed):\n        return observed[idx:]\n    else:\n        return []", "entry_point": "next_tokens_in_sequence", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/EventTeam/beliefs/blob/c07d22b61bebeede74a72800030dde770bf64208/src/beliefs/belief_utils.py#L148-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036312", "code": "def zenodo_harvest_url(community_name, format='oai_datacite3'):\n    \"\"\"Build a URL for the Zenodo Community's metadata.\n\n    Parameters\n    ----------\n    community_name : str\n        Zenodo community identifier.\n    format : str\n        OAI-PMH metadata specification name. See https://zenodo.org/dev.\n        Currently on ``oai_datacite3`` is supported.\n\n    Returns\n    -------\n    url : str\n        OAI-PMH metadata URL.\n    \"\"\"\n    template = 'http://zenodo.org/oai2d?verb=ListRecords&' \\\n               'metadataPrefix={metadata_format}&set=user-{community}'\n    return template.format(metadata_format=format,\n                           community=community_name)", "entry_point": "zenodo_harvest_url", "input": "'AbC dEf', []", "output": "'http://zenodo.org/oai2d?verb=ListRecords&metadataPrefix=[]&set=user-AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lsst-sqre/zenodio/blob/24283e84bee5714450e4f206ec024c4d32f2e761/zenodio/harvest.py#L64-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036313", "code": "def search_fields_to_dict(fields):\n    \"\"\"\n    In ``SearchableQuerySet`` and ``SearchableManager``, search fields\n    can either be a sequence, or a dict of fields mapped to weights.\n    This function converts sequences to a dict mapped to even weights,\n    so that we're consistently dealing with a dict of fields mapped to\n    weights, eg: (\"title\", \"content\") -> {\"title\": 1, \"content\": 1}\n    \"\"\"\n    if not fields:\n        return {}\n    try:\n        int(list(dict(fields).values())[0])\n    except (TypeError, ValueError):\n        fields = dict(zip(fields, [1] * len(fields)))\n    return fields", "entry_point": "search_fields_to_dict", "input": "['a', 'b', 'c']", "output": "{'a': 1, 'b': 1, 'c': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/minhhoit/yacms/blob/2921b706b7107c6e8c5f2bbf790ff11f85a2167f/yacms/core/managers.py#L76-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036314", "code": "def fetch(index, tokens):\n    \"\"\"\n    Fetch the codes from given tokens\n    \"\"\"\n    if len(tokens) == 0:\n        return set()\n    return set.intersection(*[set(index.get(token, [])) for token in tokens])", "entry_point": "fetch", "input": "-3, []", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jeroyang/cateye/blob/8f181d6428d113d2928e3eb31703705ce0779eae/cateye/cateye.py#L179-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036315", "code": "def _get_columns_relevant_for_diff(columns_to_show):\n    \"\"\"\n    Extract columns that are relevant for the diff table.\n\n    @param columns_to_show: (list) A list of columns that should be shown\n    @return: (set) Set of columns that are relevant for the diff table. If\n             none is marked relevant, the column named \"status\" will be\n             returned in the set.\n    \"\"\"\n    cols = set([col.title for col in columns_to_show if col.relevant_for_diff])\n    if len(cols) == 0:\n        return set(\n            [col.title for col in columns_to_show if col.title == \"status\"])\n    else:\n        return cols", "entry_point": "_get_columns_relevant_for_diff", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sosy-lab/benchexec/blob/44428f67f41384c03aea13e7e25f884764653617/benchexec/tablegenerator/__init__.py#L214-L228", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036316", "code": "def split_string_at_suffix(s, numbers_into_suffix=False):\n    \"\"\"\n    Split a string into two parts: a prefix and a suffix. Splitting is done from the end,\n    so the split is done around the position of the last digit in the string\n    (that means the prefix may include any character, mixing digits and chars).\n    The flag 'numbers_into_suffix' determines whether the suffix consists of digits or non-digits.\n    \"\"\"\n    if not s:\n        return (s, '')\n    pos = len(s)\n    while pos and numbers_into_suffix == s[pos-1].isdigit():\n        pos -= 1\n    return (s[:pos], s[pos:])", "entry_point": "split_string_at_suffix", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sosy-lab/benchexec/blob/44428f67f41384c03aea13e7e25f884764653617/benchexec/tablegenerator/util.py#L110-L122", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036317", "code": "def prettylist(list_):\n    \"\"\"\n    Filter out duplicate values while keeping order.\n    \"\"\"\n    if not list_:\n        return ''\n\n    values = set()\n    uniqueList = []\n\n    for entry in list_:\n        if not entry in values:\n            values.add(entry)\n            uniqueList.append(entry)\n\n    return uniqueList[0] if len(uniqueList) == 1 \\\n        else '[' + '; '.join(uniqueList) + ']'", "entry_point": "prettylist", "input": "['a', 'b', 'c']", "output": "'[a; b; c]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sosy-lab/benchexec/blob/44428f67f41384c03aea13e7e25f884764653617/benchexec/tablegenerator/util.py#L264-L280", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036318", "code": "def strip_vl_extension(filename):\n    \"\"\"Strip the vega-lite extension (either vl.json or json) from filename\"\"\"\n    for ext in ['.vl.json', '.json']:\n        if filename.endswith(ext):\n            return filename[:-len(ext)]\n    else:\n        return filename", "entry_point": "strip_vl_extension", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/altair-viz/pdvega/blob/e3f1fc9730f8cd9ad70e7ba0f0a557f41279839a/doc/sphinxext/pdvega_ext/utils.py#L51-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036319", "code": "def scheme(name, bins, bin_method='quantiles'):\n    \"\"\"Return a custom scheme based on CARTOColors.\n\n    Args:\n        name (str): Name of a CARTOColor.\n        bins (int or iterable): If an `int`, the number of bins for classifying\n          data. CARTOColors have 7 bins max for quantitative data, and 11 max\n          for qualitative data. If `bins` is a `list`, it is the upper range\n          for classifying data. E.g., `bins` can be of the form ``(10, 20, 30,\n          40, 50)``.\n        bin_method (str, optional): One of methods in :obj:`BinMethod`.\n          Defaults to ``quantiles``. If `bins` is an interable, then that is\n          the bin method that will be used and this will be ignored.\n\n    .. Warning::\n\n       Input types are particularly sensitive in this function, and little\n       feedback is given for errors. ``name`` and ``bin_method`` arguments\n       are case-sensitive.\n\n    \"\"\"\n    return {\n        'name': name,\n        'bins': bins,\n        'bin_method': (bin_method if isinstance(bins, int) else ''),\n    }", "entry_point": "scheme", "input": "'', [-1, 0, 1, 2], [5, 3, 1, 4]", "output": "{'name': '', 'bins': [-1, 0, 1, 2], 'bin_method': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CartoDB/cartoframes/blob/c94238a545f3dec45963dac3892540942b6f0df8/cartoframes/styling.py#L75-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036320", "code": "def safe_quotes(text, escape_single_quotes=False):\n    \"\"\"htmlify string\"\"\"\n    if isinstance(text, str):\n        safe_text = text.replace('\"', \"&quot;\")\n        if escape_single_quotes:\n            safe_text = safe_text.replace(\"'\", \"&#92;'\")\n        return safe_text.replace('True', 'true')\n    return text", "entry_point": "safe_quotes", "input": "'AbC dEf', [-1, 0, 1, 2]", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CartoDB/cartoframes/blob/c94238a545f3dec45963dac3892540942b6f0df8/cartoframes/utils.py#L60-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036321", "code": "def _ntz(x):\n        \"\"\"\n        Get the number of consecutive zeros\n        :param x:\n        :return:\n        \"\"\"\n        if x == 0:\n            return 0\n        y = (~x) & (x - 1)    # There is actually a bug in BAP until 0.8\n\n        def bits(y):\n            n = 0\n            while y != 0:\n                n += 1\n                y >>= 1\n            return n\n        return bits(y)", "entry_point": "_ntz", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/angr/claripy/blob/4ed61924880af1ea8fb778047d896ec0156412a6/claripy/vsa/strided_interval.py#L2649-L2665", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036322", "code": "def igcd(a, b):\n        \"\"\"\n        :param a: First integer\n        :param b: Second integer\n        :return: the integer GCD between a and b\n        \"\"\"\n        a = int(round(a))\n        b = int(round(b))\n        if b < 0:\n            b = -b\n        while b:\n            a, b = b, a % b\n        if a == 1 or b == 1:\n            return 1\n        return a", "entry_point": "igcd", "input": "1, True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/angr/claripy/blob/4ed61924880af1ea8fb778047d896ec0156412a6/claripy/vsa/strided_interval.py#L2912-L2926", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036323", "code": "def _el_orb_tuple(string):\n    \"\"\"Parse the element and orbital argument strings.\n\n    The presence of an element without any orbitals means that we want to plot\n    all of its orbitals.\n\n    Args:\n        string (`str`): The selected elements and orbitals in in the form:\n            `\"Sn.s.p,O\"`.\n\n    Returns:\n        A list of tuples specifying which elements/orbitals to plot. The output\n        for the above example would be:\n\n            `[('Sn', ('s', 'p')), 'O']`\n    \"\"\"\n    el_orbs = []\n    for split in string.split(','):\n        splits = split.split('.')\n        el = splits[0]\n        if len(splits) == 1:\n            el_orbs.append(el)\n        else:\n            el_orbs.append((el, tuple(splits[1:])))\n    return el_orbs", "entry_point": "_el_orb_tuple", "input": "'walnut thistle harbour'", "output": "['walnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SMTG-UCL/sumo/blob/47aec6bbfa033a624435a65bd4edabd18bfb437f/sumo/cli/bandplot.py#L346-L370", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036324", "code": "def _el_orb(string):\n    \"\"\"Parse the element and orbital argument strings.\n\n    The presence of an element without any orbitals means that we want to plot\n    all of its orbitals.\n\n    Args:\n        string (str): The element and orbitals as a string, in the form\n            ``\"C.s.p,O\"``.\n\n    Returns:\n        dict: The elements and orbitals as a :obj:`dict`. For example::\n\n            {'Bi': ['s', 'px', 'py', 'd']}.\n\n        If an element symbol is included with an empty list, then all orbitals\n        for that species are considered.\n    \"\"\"\n    el_orbs = {}\n    for split in string.split(','):\n        orbs = split.split('.')\n        orbs = [orbs[0], 's', 'p', 'd', 'f'] if len(orbs) == 1 else orbs\n        el_orbs[orbs.pop(0)] = orbs\n    return el_orbs", "entry_point": "_el_orb", "input": "'Hello World'", "output": "{'Hello World': ['s', 'p', 'd', 'f']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SMTG-UCL/sumo/blob/47aec6bbfa033a624435a65bd4edabd18bfb437f/sumo/cli/dosplot.py#L187-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036325", "code": "def intify(x):\n    '''\n    Ensure ( or coerce ) a value into being an integer or None.\n\n    Args:\n        x (obj):    An object to intify\n\n    Returns:\n        (int):  The int value ( or None )\n    '''\n    if isinstance(x, int):\n        return x\n\n    try:\n        return int(x, 0)\n    except (TypeError, ValueError):\n        return None", "entry_point": "intify", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vertexproject/synapse/blob/22e67c5a8f6d7caddbcf34b39ab1bd2d6c4a6e0b/synapse/common.py#L129-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036326", "code": "def config(conf, confdefs):\n    '''\n    Initialize a config dict using the given confdef tuples.\n    '''\n    conf = conf.copy()\n\n    # for now just populate defval\n    for name, info in confdefs:\n        conf.setdefault(name, info.get('defval'))\n\n    return conf", "entry_point": "config", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vertexproject/synapse/blob/22e67c5a8f6d7caddbcf34b39ab1bd2d6c4a6e0b/synapse/common.py#L618-L628", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036327", "code": "def get_common_elements(list1, list2):\n    \"\"\"find the common elements in two lists.  used to support auto align\n        might be faster with sets\n\n    Parameters\n    ----------\n    list1 : list\n        a list of objects\n    list2 : list\n        a list of objects\n\n    Returns\n    -------\n    list : list\n        list of common objects shared by list1 and list2\n        \n    \"\"\"\n    #result = []\n    #for item in list1:\n    #    if item in list2:\n    #        result.append(item)\n    #Return list(set(list1).intersection(set(list2)))\n    set2 = set(list2)\n    result = [item for item in list1 if item in set2]\n    return result", "entry_point": "get_common_elements", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jtwhite79/pyemu/blob/c504d8e7a4097cec07655a6318d275739bd8148a/pyemu/mat/mat_handler.py#L122-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036328", "code": "def get_marker_indices(marker,line):\n    \"\"\" method to find the start and end parameter markers\n    on a template file line.  Used by write_to_template()\n\n    Parameters\n    ----------\n    marker : str\n        template file marker char\n    line : str\n        template file line\n\n    Returns\n    -------\n    indices : list\n        list of start and end indices (zero based)\n\n    \"\"\"\n    indices = [i for i, ltr in enumerate(line) if ltr == marker]\n    start = indices[0:-1:2]\n    end = [i+1 for i in indices[1::2]]\n    assert len(start) == len(end)\n    return start,end", "entry_point": "get_marker_indices", "input": "[-1, 0, 1, 2], 'abc'", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jtwhite79/pyemu/blob/c504d8e7a4097cec07655a6318d275739bd8148a/pyemu/pst/pst_utils.py#L362-L383", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036329", "code": "def parse_ins_string(string):\n    \"\"\" split up an instruction file line to get the observation names\n\n    Parameters\n    ----------\n    string : str\n        instruction file line\n\n    Returns\n    -------\n    obs_names : list\n        list of observation names\n\n    \"\"\"\n    istart_markers = [\"[\",\"(\",\"!\"]\n    iend_markers = [\"]\",\")\",\"!\"]\n\n    obs_names = []\n\n    idx = 0\n    while True:\n        if idx >= len(string) - 1:\n            break\n        char = string[idx]\n        if char in istart_markers:\n            em = iend_markers[istart_markers.index(char)]\n            # print(\"\\n\",idx)\n            # print(string)\n            # print(string[idx+1:])\n            # print(string[idx+1:].index(em))\n            # print(string[idx+1:].index(em)+idx+1)\n            eidx = min(len(string),string[idx+1:].index(em)+idx+1)\n            obs_name = string[idx+1:eidx]\n            if obs_name.lower() != \"dum\":\n                obs_names.append(obs_name)\n            idx = eidx + 1\n        else:\n            idx += 1\n    return obs_names", "entry_point": "parse_ins_string", "input": "'AbC dEf'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jtwhite79/pyemu/blob/c504d8e7a4097cec07655a6318d275739bd8148a/pyemu/pst/pst_utils.py#L422-L460", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036330", "code": "def normalizeBoolean(value):\n    \"\"\"\n    Normalizes a boolean.\n\n    * **value** must be an ``int`` with value of 0 or 1, or a ``bool``.\n    * Returned value will be a boolean.\n    \"\"\"\n    if isinstance(value, int) and value in (0, 1):\n        value = bool(value)\n    if not isinstance(value, bool):\n        raise ValueError(\"Boolean values must be True or False, not '%s'.\"\n                         % value)\n    return value", "entry_point": "normalizeBoolean", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/robotools/fontParts/blob/d2ff106fe95f9d566161d936a645157626568712/Lib/fontParts/base/normalizers.py#L721-L733", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036331", "code": "def generateFormatToExtension(format, fallbackFormat):\n        \"\"\"\n        +--------------+--------------------------------------------------------------------+\n        | mactype1     | Mac Type 1 font (generates suitcase  and LWFN file)                |\n        +--------------+--------------------------------------------------------------------+\n        | macttf       | Mac TrueType font (generates suitcase)                             |\n        +--------------+--------------------------------------------------------------------+\n        | macttdfont   | Mac TrueType font (generates suitcase with resources in data fork) |\n        +--------------+--------------------------------------------------------------------+\n        | otfcff       | PS OpenType (CFF-based) font (OTF)                                 |\n        +--------------+--------------------------------------------------------------------+\n        | otfttf       | PC TrueType/TT OpenType font (TTF)                                 |\n        +--------------+--------------------------------------------------------------------+\n        | pctype1      | PC Type 1 font (binary/PFB)                                        |\n        +--------------+--------------------------------------------------------------------+\n        | pcmm         | PC MultipleMaster font (PFB)                                       |\n        +--------------+--------------------------------------------------------------------+\n        | pctype1ascii | PC Type 1 font (ASCII/PFA)                                         |\n        +--------------+--------------------------------------------------------------------+\n        | pcmmascii    | PC MultipleMaster font (ASCII/PFA)                                 |\n        +--------------+--------------------------------------------------------------------+\n        | ufo1         | UFO format version 1                                               |\n        +--------------+--------------------------------------------------------------------+\n        | ufo2         | UFO format version 2                                               |\n        +--------------+--------------------------------------------------------------------+\n        | ufo3         | UFO format version 3                                               |\n        +--------------+--------------------------------------------------------------------+\n        | unixascii    | UNIX ASCII font (ASCII/PFA)                                        |\n        +--------------+--------------------------------------------------------------------+\n        \"\"\"\n        formatToExtension = dict(\n            # mactype1=None,\n            macttf=\".ttf\",\n            macttdfont=\".dfont\",\n            otfcff=\".otf\",\n            otfttf=\".ttf\",\n            # pctype1=None,\n            # pcmm=None,\n            # pctype1ascii=None,\n            # pcmmascii=None,\n            ufo1=\".ufo\",\n            ufo2=\".ufo\",\n            ufo3=\".ufo\",\n            unixascii=\".pfa\",\n        )\n        return formatToExtension.get(format, fallbackFormat)", "entry_point": "generateFormatToExtension", "input": "3, 'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/robotools/fontParts/blob/d2ff106fe95f9d566161d936a645157626568712/Lib/fontParts/base/font.py#L255-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036332", "code": "def split_len(s, length):\n    \"\"\"split string *s* into list of strings no longer than *length*\"\"\"\n    return [s[i:i+length] for i in range(0, len(s), length)]", "entry_point": "split_len", "input": "['apple', 'banana', 'cherry'], 3", "output": "[['apple', 'banana', 'cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scanny/python-pptx/blob/d6ab8234f8b03953d2f831ff9394b1852db34130/spec/gen_spec/gen_spec.py#L307-L309", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036333", "code": "def to_mixed_case(s):\n    \"\"\"\n    convert upper snake case string to mixed case, e.g. MIXED_CASE becomes\n    MixedCase\n    \"\"\"\n    out = ''\n    last_c = ''\n    for c in s:\n        if c == '_':\n            pass\n        elif last_c in ('', '_'):\n            out += c.upper()\n        else:\n            out += c.lower()\n        last_c = c\n    return out", "entry_point": "to_mixed_case", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scanny/python-pptx/blob/d6ab8234f8b03953d2f831ff9394b1852db34130/spec/gen_spec/gen_spec.py#L312-L327", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036334", "code": "def to_unicode(text):\n    \"\"\"\n    Return *text* as a unicode string. All text in Python 3 is unicode, so\n    this just returns *text* unchanged.\n    \"\"\"\n    if not isinstance(text, str):\n        tmpl = 'expected unicode string, got %s value %s'\n        raise TypeError(tmpl % (type(text), text))\n    return text", "entry_point": "to_unicode", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scanny/python-pptx/blob/d6ab8234f8b03953d2f831ff9394b1852db34130/pptx/compat/python3.py#L31-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036335", "code": "def _bisect(seq):\n        \"\"\"\n        Return a (medial_value, greater_values, lesser_values) 3-tuple\n        obtained by bisecting sequence *seq*.\n        \"\"\"\n        if len(seq) == 0:\n            return [], None, []\n        mid_idx = int(len(seq)/2)\n        mid = seq[mid_idx]\n        greater = seq[mid_idx+1:]\n        lesser = seq[:mid_idx]\n        return mid, greater, lesser", "entry_point": "_bisect", "input": "[]", "output": "([], None, [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scanny/python-pptx/blob/d6ab8234f8b03953d2f831ff9394b1852db34130/pptx/text/layout.py#L185-L196", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036336", "code": "def _column_reference(column_number):\n        \"\"\"Return str Excel column reference like 'BQ' for *column_number*.\n\n        *column_number* is an int in the range 1-16384 inclusive, where\n        1 maps to column 'A'.\n        \"\"\"\n        if column_number < 1 or column_number > 16384:\n            raise ValueError('column_number must be in range 1-16384')\n\n        # ---Work right-to-left, one order of magnitude at a time. Note there\n        #    is no zero representation in Excel address scheme, so this is\n        #    not just a conversion to base-26---\n\n        col_ref = ''\n        while column_number:\n            remainder = column_number % 26\n            if remainder == 0:\n                remainder = 26\n\n            col_letter = chr(ord('A') + remainder - 1)\n            col_ref = col_letter + col_ref\n\n            # ---Advance to next order of magnitude or terminate loop. The\n            # minus-one in this expression reflects the fact the next lower\n            # order of magnitude has a minumum value of 1 (not zero). This is\n            # essentially the complement to the \"if it's 0 make it 26' step\n            # above.---\n            column_number = (column_number - 1) // 26\n\n        return col_ref", "entry_point": "_column_reference", "input": "7", "output": "'G'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/scanny/python-pptx/blob/d6ab8234f8b03953d2f831ff9394b1852db34130/pptx/chart/xlsx.py#L94-L123", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036337", "code": "def get_substr_slices(umi_length, idx_size):\n    '''\n    Create slices to split a UMI into approximately equal size substrings\n    Returns a list of tuples that can be passed to slice function\n    '''\n    cs, r = divmod(umi_length, idx_size)\n    sub_sizes = [cs + 1] * r + [cs] * (idx_size - r)\n    offset = 0\n    slices = []\n    for s in sub_sizes:\n        slices.append((offset, offset + s))\n        offset += s\n    return slices", "entry_point": "get_substr_slices", "input": "3, 2", "output": "[(0, 2), (2, 3)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CGATOxford/UMI-tools/blob/c4b5d84aac391d59916d294f8f4f8f5378abcfbe/umi_tools/network.py#L68-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036338", "code": "def make_storage_key(portal_type, prefix=None):\n    \"\"\"Make a storage (dict-) key for the number generator\n    \"\"\"\n    key = portal_type.lower()\n    if prefix:\n        key = \"{}-{}\".format(key, prefix)\n    return key", "entry_point": "make_storage_key", "input": "'abc', True", "output": "'abc-True'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/idserver.py#L361-L367", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036339", "code": "def get_include_fields(request):\n    \"\"\"Retrieve include_fields values from the request\n    \"\"\"\n    include_fields = []\n    rif = request.get(\"include_fields\", \"\")\n    if \"include_fields\" in request:\n        include_fields = [x.strip()\n                          for x in rif.split(\",\")\n                          if x.strip()]\n    if \"include_fields[]\" in request:\n        include_fields = request['include_fields[]']\n    return include_fields", "entry_point": "get_include_fields", "input": "{'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/jsonapi/__init__.py#L47-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036340", "code": "def is_header(line):\n    \"\"\"\n    If a line has only one column, then it is a Section or Subsection\n    header.\n    :param line: Line to check\n    :return: boolean -If line is header\n    \"\"\"\n    if len(line) == 1:\n        return True\n    for idx, val in enumerate(line):\n        if idx > 0 and val:\n            return False\n    return True", "entry_point": "is_header", "input": "'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/exportimport/instruments/genexpert/genexpert.py#L289-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036341", "code": "def formatDecimalMark(value, decimalmark='.'):\n    \"\"\"\n        Dummy method to replace decimal mark from an input string.\n        Assumes that 'value' uses '.' as decimal mark and ',' as\n        thousand mark.\n        ::value:: is a string\n        ::returns:: is a string with the decimal mark if needed\n    \"\"\"\n    # We have to consider the possibility of working with decimals such as\n    # X.000 where those decimals are important because of the precission\n    # and significant digits matters\n    # Using 'float' the system delete the extre desimals with 0 as a value\n    # Example: float(2.00) -> 2.0\n    # So we have to save the decimal length, this is one reason we are usnig\n    # strings for results\n    rawval = str(value)\n    try:\n        return decimalmark.join(rawval.split('.'))\n    except:\n        return rawval", "entry_point": "formatDecimalMark", "input": "[], ['apple', 'banana', 'cherry']", "output": "'[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/utils/__init__.py#L197-L216", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036342", "code": "def dicts_to_dict(dictionaries, key_subfieldname):\n    \"\"\"Convert a list of dictionaries into a dictionary of dictionaries.\n\n    key_subfieldname must exist in each Record's subfields and have a value,\n    which will be used as the key for the new dictionary. If a key is duplicated,\n    the earlier value will be overwritten.\n    \"\"\"\n    result = {}\n    for d in dictionaries:\n        result[d[key_subfieldname]] = d\n    return result", "entry_point": "dicts_to_dict", "input": "{}, 'walnut thistle harbour'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/utils/__init__.py#L502-L512", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036343", "code": "def format_supsub(text):\n    \"\"\"\n    Mainly used for Analysis Service's unit. Transform the text adding\n    sub and super html scripts:\n    For super-scripts, use ^ char\n    For sub-scripts, use _ char\n    The expression \"cm^2\" will be translated to \"cm\u00b2\" and the\n    expression \"b_(n-1)\" will be translated to \"b n-1\".\n    The expression \"n_(fibras)/cm^3\" will be translated as\n    \"n fibras / cm\u00b3\"\n    :param text: text to be formatted\n    \"\"\"\n    out = []\n    subsup = []\n    clauses = []\n    insubsup = True\n    for c in str(text):\n        if c == '(':\n            if insubsup is False:\n                out.append(c)\n                clauses.append(')')\n            else:\n                clauses.append('')\n\n        elif c == ')':\n            if len(clauses) > 0:\n                out.append(clauses.pop())\n                if len(subsup) > 0:\n                    out.append(subsup.pop())\n\n        elif c == '^':\n            subsup.append('</sup>')\n            out.append('<sup>')\n            insubsup = True\n            continue\n\n        elif c == '_':\n            subsup.append('</sub>')\n            out.append('<sub>')\n            insubsup = True\n            continue\n\n        elif c == ' ':\n            if insubsup is True:\n                out.append(subsup.pop())\n            else:\n                out.append(c)\n        elif c in ['+', '-']:\n            if len(clauses) == 0 and len(subsup) > 0:\n                out.append(subsup.pop())\n            out.append(c)\n        else:\n            out.append(c)\n\n        insubsup = False\n\n    while True:\n        if len(subsup) == 0:\n            break\n        out.append(subsup.pop())\n\n    return ''.join(out)", "entry_point": "format_supsub", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/utils/__init__.py#L515-L576", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036344", "code": "def drop_trailing_zeros_decimal(num):\n    \"\"\" Drops the trailinz zeros from decimal value.\n        Returns a string\n    \"\"\"\n    out = str(num)\n    return out.rstrip('0').rstrip('.') if '.' in out else out", "entry_point": "drop_trailing_zeros_decimal", "input": "5", "output": "'5'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/utils/__init__.py#L579-L584", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036345", "code": "def get_time_string(time, unit):\n        \"\"\"\n        Create a properly formatted string given a time and unit\n\n        :param time: Time to format\n        :type time: float\n        :param unit: Unit to apply format of. Only supports hours ('h')\n            and minutes ('m').\n        :type unit: str\n        :return: A string in format '{whole}:{part}'\n        :rtype: str\n        \"\"\"\n        supported_units = [\"h\", \"m\"]\n        if unit not in supported_units:\n            return \"{}\".format(round(time, 2))\n        hours, minutes = str(time).split(\".\")\n        hours = int(hours)\n        minutes = int(round(float(\"0.{}\".format(minutes)) * 60))\n        return \"{:02d}:{:02d}\".format(hours, minutes)", "entry_point": "get_time_string", "input": "3, {1, 2, 3}", "output": "'3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedFantom/ttkwidgets/blob/02150322060f867b6e59a175522ef84b09168019/ttkwidgets/timeline.py#L780-L798", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036346", "code": "def calculate_text_coords(rectangle_coords):\n        \"\"\"Calculate Canvas text coordinates based on rectangle coords\"\"\"\n        return (int(rectangle_coords[0] + (rectangle_coords[2] - rectangle_coords[0]) / 2),\n                int(rectangle_coords[1] + (rectangle_coords[3] - rectangle_coords[1]) / 2))", "entry_point": "calculate_text_coords", "input": "[-1, 0, 1, 2]", "output": "(0, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RedFantom/ttkwidgets/blob/02150322060f867b6e59a175522ef84b09168019/ttkwidgets/timeline.py#L1117-L1120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036347", "code": "def list_and_add(a, b):\n    \"\"\"\n    Concatenate anything into a list.\n\n    Args:\n        a: the first thing\n        b: the second thing\n\n    Returns:\n        list. All the things in a list.\n    \"\"\"\n    if not isinstance(b, list):\n        b = [b]\n    if not isinstance(a, list):\n        a = [a]\n    return a + b", "entry_point": "list_and_add", "input": "[], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/agile-geoscience/welly/blob/ed4c991011d6290938fef365553041026ba29f42/welly/utils.py#L142-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036348", "code": "def dd2dms(dd):\n    \"\"\"\n    Decimal degrees to DMS.\n\n    Args:\n        dd (float). Decimal degrees.\n\n    Return:\n        tuple. Degrees, minutes, and seconds.\n    \"\"\"\n    m, s = divmod(dd * 3600, 60)\n    d, m = divmod(m, 60)\n    return int(d), int(m), s", "entry_point": "dd2dms", "input": "2", "output": "(2, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/agile-geoscience/welly/blob/ed4c991011d6290938fef365553041026ba29f42/welly/utils.py#L447-L459", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036349", "code": "def get_lines(handle, line):\n    \"\"\"\n    Get zero-indexed line from an open file-like.\n    \"\"\"\n    for i, l in enumerate(handle):\n        if i == line:\n            return l", "entry_point": "get_lines", "input": "('a', 'b', 'c'), 2.0", "output": "'c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/agile-geoscience/welly/blob/ed4c991011d6290938fef365553041026ba29f42/welly/utils.py#L525-L531", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036350", "code": "def form_url(i):\n    \"\"\"\n    Input:  {\n              (url)                      - if type=='remote' or 'git', URL of remote repository or git repository\n              (hostname)                 - if !='', automatically form url above (add http:// + /ck?)\n              (port)                     - if !='', automatically add to url above\n              (hostext)                  - if !='', add to the end of above URL instead of '/ck?' -\n                                           useful when CK server is accessed via Apache2, IIS or other web servers\n            }\n\n    Output: {\n              return       - return code =  0, if successful\n                                         >  0, if error\n              (error)      - error text if return > 0\n\n              url          - formed URL\n            }\n\n    \"\"\"\n\n    url=i.get('url','')\n\n    if i.get('hostname','')!='':\n       url='http://'+i['hostname']\n\n       if i.get('port','')!='':\n          url+=':'+i['port']\n\n       if i.get('hostext','')!='':\n          url+='/'+i['hostext']\n       else:\n          url+='/ck?'\n\n    return {'return':0, 'url':url}", "entry_point": "form_url", "input": "{}", "output": "{'return': 0, 'url': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ctuning/ck/blob/7e009814e975f8742790d3106340088a46223714/ck/repo/module/repo/module.py#L2320-L2353", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036351", "code": "def convert_str_tags_to_list(i):\n    \"\"\"\n    Input:  either a list, or a string of comma-separated tags.\n\n    Output: If i is a list, it's returned.\n            If i is a string, the list of tags it represents is returned \n            (each tag is stripped of leading and trailing whitespace).\n\n    \"\"\"\n\n    r=[]\n\n    if type(i)==list:\n       r=i\n    else:\n       ii=i.split(',')\n       for q in ii:\n           q=q.strip()\n           if q!='':\n              r.append(q)\n\n    return r", "entry_point": "convert_str_tags_to_list", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ctuning/ck/blob/7e009814e975f8742790d3106340088a46223714/ck/kernel.py#L963-L984", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036352", "code": "def penn2morphy(penntag, returnNone=False, default_to_noun=False) -> str:\n    \"\"\"\n    Converts tags from Penn format (input: single string) to Morphy.\n    \"\"\"\n    morphy_tag = {'NN':'n', 'JJ':'a', 'VB':'v', 'RB':'r'}\n    try:\n        return morphy_tag[penntag[:2]]\n    except:\n        if returnNone:\n            return None\n        elif default_to_noun:\n            return 'n'\n        else:\n            return ''", "entry_point": "penn2morphy", "input": "'abc', set(), []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/alvations/pywsd/blob/4c12394c8adbcfed71dd912bdbef2e36370821bf/pywsd/utils.py#L108-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036353", "code": "def find_frequent_items(transactions, threshold):\n        \"\"\"\n        Create a dictionary of items with occurrences above the threshold.\n        \"\"\"\n        items = {}\n\n        for transaction in transactions:\n            for item in transaction:\n                if item in items:\n                    items[item] += 1\n                else:\n                    items[item] = 1\n\n        for key in list(items.keys()):\n            if items[key] < threshold:\n                del items[key]\n\n        return items", "entry_point": "find_frequent_items", "input": "['a', 'b', 'c'], -1.5", "output": "{'a': 1, 'b': 1, 'c': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/evandempsey/fp-growth/blob/6bf4503024e86c5bbea8a05560594f2f7f061c15/pyfpgrowth/pyfpgrowth.py#L64-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036354", "code": "def human_time(seconds):\n\t''' DocTests:\n\t>>> human_time(0) == ''\n\tTrue\n\t>>> human_time(122.1) == '2m2s'\n\tTrue\n\t>>> human_time(133) == '2m13s'\n\tTrue\n\t>>> human_time(12345678) == '20W2D21h21m18s'\n\tTrue\n\t'''\n\tisec = int(seconds)\n\ts = isec % 60\n\tm = isec // 60 % 60\n\th = isec // 60 // 60 % 24\n\td = isec // 60 // 60 // 24 % 7\n\tw = isec // 60 // 60 // 24 // 7\n\n\tresult = ''\n\tfor t in [ ('W', w), ('D', d), ('h', h), ('m', m), ('s', s) ]:\n\t\tif t[1]:\n\t\t\tresult += str(t[1]) + t[0]\n\n\treturn result", "entry_point": "human_time", "input": "1", "output": "'1s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/houtianze/bypy/blob/c59b6183e2fca45f11138bbcdec6247449b2eaad/bypy/printer_util.py#L20-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036355", "code": "def limit_unit(timestr, num = 2):\n\t''' DocTests:\n\t>>> limit_unit('1m2s', 1) == '1m'\n\tTrue\n\t>>> limit_unit('1m2s') == '1m2s'\n\tTrue\n\t>>> limit_unit('1m2s', 4) == '1m2s'\n\tTrue\n\t>>> limit_unit('1d2h3m2s') == '1d2h'\n\tTrue\n\t>>> limit_unit('1d2h3m2s', 1) == '1d'\n\tTrue\n\t'''\n\tl = len(timestr)\n\ti = 0\n\tp = 0\n\twhile i < num and p <= l:\n\t\tat = 0\n\t\twhile p < l:\n\t\t\tc = timestr[p]\n\t\t\tif at == 0:\n\t\t\t\tif c.isdigit():\n\t\t\t\t\tp += 1\n\t\t\t\telse:\n\t\t\t\t\tat += 1\n\t\t\telif at == 1:\n\t\t\t\tif not c.isdigit():\n\t\t\t\t\tp += 1\n\t\t\t\telse:\n\t\t\t\t\tat += 1\n\t\t\telse:\n\t\t\t\tbreak\n\n\t\ti += 1\n\n\treturn timestr[:p]", "entry_point": "limit_unit", "input": "[5, 3, 1, 4], 0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/houtianze/bypy/blob/c59b6183e2fca45f11138bbcdec6247449b2eaad/bypy/printer_util.py#L45-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036356", "code": "def mode_str_to_int(modestr):\n    \"\"\"\n    :param modestr: string like 755 or 644 or 100644 - only the last 6 chars will be used\n    :return:\n        String identifying a mode compatible to the mode methods ids of the\n        stat module regarding the rwx permissions for user, group and other,\n        special flags and file system flags, i.e. whether it is a symlink\n        for example.\"\"\"\n    mode = 0\n    for iteration, char in enumerate(reversed(modestr[-6:])):\n        mode += int(char) << iteration * 3\n    # END for each char\n    return mode", "entry_point": "mode_str_to_int", "input": "[-1, 0, 1, 2]", "output": "-502", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gitpython-developers/GitPython/blob/1f66e25c25cde2423917ee18c4704fff83b837d1/git/objects/util.py#L29-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036357", "code": "def altz_to_utctz_str(altz):\n    \"\"\"As above, but inverses the operation, returning a string that can be used\n    in commit objects\"\"\"\n    utci = -1 * int((float(altz) / 3600) * 100)\n    utcs = str(abs(utci))\n    utcs = \"0\" * (4 - len(utcs)) + utcs\n    prefix = (utci < 0 and '-') or '+'\n    return prefix + utcs", "entry_point": "altz_to_utctz_str", "input": "5", "output": "'+0000'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gitpython-developers/GitPython/blob/1f66e25c25cde2423917ee18c4704fff83b837d1/git/objects/util.py#L76-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036358", "code": "def convert_bool(string):\n    \"\"\"Check whether string is boolean.\n    \"\"\"\n    if string == 'True':\n        return True, True\n    elif string == 'False':\n        return True, False\n    else:\n        return False, False", "entry_point": "convert_bool", "input": "'abc'", "output": "(False, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theislab/scanpy/blob/9e4e5ee02e04cf618872d9b098e24f0542e8b227/scanpy/readwrite.py#L591-L599", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036359", "code": "def _basis2name(basis):\n    \"\"\"\n    converts the 'basis' into the proper name.\n    \"\"\"\n\n    component_name = (\n        'DC' if basis == 'diffmap'\n        else 'tSNE' if basis == 'tsne'\n        else 'UMAP' if basis == 'umap'\n        else 'PC' if basis == 'pca'\n        else basis.replace('draw_graph_', '').upper() if 'draw_graph' in basis\n        else basis)\n    return component_name", "entry_point": "_basis2name", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theislab/scanpy/blob/9e4e5ee02e04cf618872d9b098e24f0542e8b227/scanpy/plotting/_tools/scatterplots.py#L739-L751", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036360", "code": "def fill_in_datakeys(example_parameters, dexdata):\n    \"\"\"Update the 'examples dictionary' _examples.example_parameters.\n\n    If a datakey (key in 'datafile dictionary') is not present in the 'examples\n    dictionary' it is used to initialize an entry with that key.\n\n    If not specified otherwise, any 'exkey' (key in 'examples dictionary') is\n    used as 'datakey'.\n    \"\"\"\n    # default initialization of 'datakey' key with entries from data dictionary\n    for exkey in example_parameters:\n        if 'datakey' not in example_parameters[exkey]:\n            if exkey in dexdata:\n                example_parameters[exkey]['datakey'] = exkey\n            else:\n                example_parameters[exkey]['datakey'] = 'unspecified in dexdata'\n    return example_parameters", "entry_point": "fill_in_datakeys", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theislab/scanpy/blob/9e4e5ee02e04cf618872d9b098e24f0542e8b227/scanpy/utils.py#L567-L583", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036361", "code": "def update_params(old_params, new_params, check=False):\n    \"\"\"Update old_params with new_params.\n\n    If check==False, this merely adds and overwrites the content of old_params.\n\n    If check==True, this only allows updating of parameters that are already\n    present in old_params.\n\n    Parameters\n    ----------\n    old_params : dict\n    new_params : dict\n    check : bool, optional (default: False)\n\n    Returns\n    -------\n    updated_params : dict\n    \"\"\"\n    updated_params = dict(old_params)\n    if new_params:  # allow for new_params to be None\n        for key, val in new_params.items():\n            if key not in old_params and check:\n                raise ValueError('\\'' + key\n                                 + '\\' is not a valid parameter key, '\n                                 + 'consider one of \\n'\n                                 + str(list(old_params.keys())))\n            if val is not None:\n                updated_params[key] = val\n    return updated_params", "entry_point": "update_params", "input": "(), {'x': [1, 2], 'y': []}, ()", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theislab/scanpy/blob/9e4e5ee02e04cf618872d9b098e24f0542e8b227/scanpy/utils.py#L616-L644", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036362", "code": "def unpack_hyperopt_vals(vals):\n    \"\"\"\n    Unpack values from a hyperopt return dictionary where values are wrapped in a list.\n    :param vals: dict\n    :return: dict\n        copy of the dictionary with unpacked values\n    \"\"\"\n    assert isinstance(vals, dict), \"Parameter must be given as dict.\"\n    ret = {}\n    for k, v in list(vals.items()):\n        try:\n            ret[k] = v[0]\n        except (TypeError, IndexError):\n            ret[k] = v\n    return ret", "entry_point": "unpack_hyperopt_vals", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxpumperla/hyperas/blob/6bf236682e2aa28401e48f73ebef269ad2937ae2/hyperas/utils.py#L154-L168", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036363", "code": "def find_signature_end(model_string):\n    \"\"\"\n    Find the index of the colon in the function signature.\n    :param model_string: string\n        source code of the model\n    :return: int\n        the index of the colon\n    \"\"\"\n    index, brace_depth = 0, 0\n    while index < len(model_string):\n        ch = model_string[index]\n        if brace_depth == 0 and ch == ':':\n            break\n        if ch == '#':  # Ignore comments\n            index += 1\n            while index < len(model_string) and model_string[index] != '\\n':\n                index += 1\n            index += 1\n        elif ch in ['\"', \"'\"]:  # Skip strings\n            string_depth = 0\n            while index < len(model_string) and model_string[index] == ch:\n                string_depth += 1\n                index += 1\n            if string_depth == 2:\n                string_depth = 1\n            index += string_depth\n            while index < len(model_string):\n                if model_string[index] == '\\\\':\n                    index += 2\n                elif model_string[index] == ch:\n                    string_depth -= 1\n                    if string_depth == 0:\n                        break\n                    index += 1\n                else:\n                    index += 1\n            index += 1\n        elif ch == '(':\n            brace_depth += 1\n            index += 1\n        elif ch == ')':\n            brace_depth -= 1\n            index += 1\n        else:\n            index += 1\n    return index", "entry_point": "find_signature_end", "input": "'walnut thistle harbour'", "output": "22", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maxpumperla/hyperas/blob/6bf236682e2aa28401e48f73ebef269ad2937ae2/hyperas/utils.py#L185-L230", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036364", "code": "def comma_delimited_to_list(list_param):\n    \"\"\"Convert comma-delimited list / string into a list of strings\n\n    :param list_param: Comma-delimited string\n    :type list_param: str | unicode\n    :return: A list of strings\n    :rtype: list\n    \"\"\"\n    if isinstance(list_param, list):\n        return list_param\n    if isinstance(list_param, str):\n        return list_param.split(',')\n    else:\n        return []", "entry_point": "comma_delimited_to_list", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hvac/hvac/blob/cce5b86889193f622c2a72a4a1b7e1c9c8aff1ce/hvac/utils.py#L243-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036365", "code": "def parse_block(lines, header=False):  # type: (List[str], bool) -> List[str]\n    \"\"\"Parse and return a single block, popping off the start of `lines`.\n\n    If parsing a header block, we stop after we reach a line that is not a\n    comment. Otherwise, we stop after reaching an empty line.\n\n    :param lines: list of lines\n    :param header: whether we are parsing a header block\n    :return: list of lines that form the single block\n    \"\"\"\n    block_lines = []\n    while lines and lines[0] and (not header or lines[0].startswith('#')):\n        block_lines.append(lines.pop(0))\n    return block_lines", "entry_point": "parse_block", "input": "'AbC dEf', [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pre-commit/pre-commit-hooks/blob/6d7906e131976a1ce14ab583badb734727c5da3e/pre_commit_hooks/sort_simple_yaml.py#L50-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036366", "code": "def extras_msg(extras):\n    \"\"\"\n    Create an error message for extra items or properties.\n\n    \"\"\"\n\n    if len(extras) == 1:\n        verb = \"was\"\n    else:\n        verb = \"were\"\n    return \", \".join(repr(extra) for extra in extras), verb", "entry_point": "extras_msg", "input": "[5, 3, 1, 4]", "output": "('5, 3, 1, 4', 'were')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Julian/jsonschema/blob/a72332004cdc3ba456de7918bc32059822b2f69a/jsonschema/_utils.py#L109-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036367", "code": "def types_msg(instance, types):\n    \"\"\"\n    Create an error message for a failure to match the given types.\n\n    If the ``instance`` is an object and contains a ``name`` property, it will\n    be considered to be a description of that object and used as its type.\n\n    Otherwise the message is simply the reprs of the given ``types``.\n\n    \"\"\"\n\n    reprs = []\n    for type in types:\n        try:\n            reprs.append(repr(type[\"name\"]))\n        except Exception:\n            reprs.append(repr(type))\n    return \"%r is not of type %s\" % (instance, \", \".join(reprs))", "entry_point": "types_msg", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "\"['apple', 'banana', 'cherry'] is not of type [1, 2], [3], []\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Julian/jsonschema/blob/a72332004cdc3ba456de7918bc32059822b2f69a/jsonschema/_utils.py#L122-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036368", "code": "def unbool(element, true=object(), false=object()):\n    \"\"\"\n    A hack to make True and 1 and False and 0 unique for ``uniq``.\n\n    \"\"\"\n\n    if element is True:\n        return true\n    elif element is False:\n        return false\n    return element", "entry_point": "unbool", "input": "['apple', 'banana', 'cherry'], [], [-1, 0, 1, 2]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Julian/jsonschema/blob/a72332004cdc3ba456de7918bc32059822b2f69a/jsonschema/_utils.py#L178-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036369", "code": "def split_extension(file_name, special=['tar.bz2', 'tar.gz']):\n    \"\"\"\n    Find the file extension of a file name, including support for\n    special case multipart file extensions (like .tar.gz)\n\n    Parameters\n    ----------\n    file_name: str, file name\n    special:   list of str, multipart extensions\n               eg: ['tar.bz2', 'tar.gz']\n\n    Returns\n    ----------\n    extension: str, last characters after a period, or\n               a value from 'special'\n    \"\"\"\n    file_name = str(file_name)\n\n    if file_name.endswith(tuple(special)):\n        for end in special:\n            if file_name.endswith(end):\n                return end\n    return file_name.split('.')[-1]", "entry_point": "split_extension", "input": "'a,b,c', []", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mikedh/trimesh/blob/25e059bf6d4caa74f62ffd58ce4f61a90ee4e518/trimesh/util.py#L1696-L1718", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036370", "code": "def _byte_pad(data, bound=4):\n    \"\"\"\n    GLTF wants chunks aligned with 4- byte boundaries\n    so this function will add padding to the end of a\n    chunk of bytes so that it aligns with a specified\n    boundary size\n\n    Parameters\n    --------------\n    data : bytes\n      Data to be padded\n    bound : int\n      Length of desired boundary\n\n    Returns\n    --------------\n    padded : bytes\n      Result where: (len(padded) % bound) == 0\n    \"\"\"\n    bound = int(bound)\n    if len(data) % bound != 0:\n        pad = bytes(bound - (len(data) % bound))\n        result = bytes().join([data, pad])\n        assert (len(result) % bound) == 0\n        return result\n\n    return data", "entry_point": "_byte_pad", "input": "{'x': [1, 2], 'y': []}, 1", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mikedh/trimesh/blob/25e059bf6d4caa74f62ffd58ce4f61a90ee4e518/trimesh/exchange/gltf.py#L545-L571", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036371", "code": "def replace_whitespace(text, SAFE_SPACE='|<^>|', insert=True):\n    \"\"\"\n    Replace non-strippable whitepace in a string with a safe space\n    \"\"\"\n    if insert:\n        # replace whitespace with safe space chr\n        args = (' ', SAFE_SPACE)\n    else:\n        # replace safe space chr with whitespace\n        args = (SAFE_SPACE, ' ')\n\n    return '\\n'.join(line.strip().replace(*args)\n                     for line in str.splitlines(text))", "entry_point": "replace_whitespace", "input": "'', [-1, 0, 1, 2], [[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mikedh/trimesh/blob/25e059bf6d4caa74f62ffd58ce4f61a90ee4e518/trimesh/resources/helpers/dxf_helper.py#L30-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036372", "code": "def _get_sentences_with_word_count(sentences, words):\n    \"\"\" Given a list of sentences, returns a list of sentences with a\n    total word count similar to the word count provided.\n    \"\"\"\n    word_count = 0\n    selected_sentences = []\n    # Loops until the word count is reached.\n    for sentence in sentences:\n        words_in_sentence = len(sentence.text.split())\n\n        # Checks if the inclusion of the sentence gives a better approximation\n        # to the word parameter.\n        if abs(words - word_count - words_in_sentence) > abs(words - word_count):\n            return selected_sentences\n\n        selected_sentences.append(sentence)\n        word_count += words_in_sentence\n\n    return selected_sentences", "entry_point": "_get_sentences_with_word_count", "input": "[], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/summanlp/textrank/blob/6844bbe8c4b2b468020ae0dfd6574a743f9ad442/summa/summarizer.py#L77-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036373", "code": "def _get_keywords_with_score(extracted_lemmas, lemma_to_word):\n    \"\"\"\n    :param extracted_lemmas:list of tuples\n    :param lemma_to_word: dict of {lemma:list of words}\n    :return: dict of {keyword:score}\n    \"\"\"\n    keywords = {}\n    for score, lemma in extracted_lemmas:\n        keyword_list = lemma_to_word[lemma]\n        for keyword in keyword_list:\n            keywords[keyword] = score\n    return keywords", "entry_point": "_get_keywords_with_score", "input": "[], 'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/summanlp/textrank/blob/6844bbe8c4b2b468020ae0dfd6574a743f9ad442/summa/keywords.py#L117-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036374", "code": "def area(poly):\n    r\"\"\"Find the area of a given polygon using the shoelace algorithm.\n\n    Parameters\n    ----------\n    poly: (2, N) ndarray\n        2-dimensional coordinates representing an ordered\n        traversal around the edge a polygon.\n\n    Returns\n    -------\n    area: float\n\n    \"\"\"\n    a = 0.0\n    n = len(poly)\n\n    for i in range(n):\n        a += poly[i][0] * poly[(i + 1) % n][1] - poly[(i + 1) % n][0] * poly[i][1]\n\n    return abs(a) / 2.0", "entry_point": "area", "input": "[]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/MetPy/blob/16f68a94919b9a82dcf9cada2169cf039129e67b/metpy/interpolate/geometry.py#L418-L438", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036375", "code": "def float16(val):\n    \"\"\"Convert a 16-bit floating point value to a standard Python float.\"\"\"\n    # Fraction is 10 LSB, Exponent middle 5, and Sign the MSB\n    frac = val & 0x03ff\n    exp = (val >> 10) & 0x1F\n    sign = val >> 15\n\n    if exp:\n        value = 2 ** (exp - 16) * (1 + float(frac) / 2**10)\n    else:\n        value = float(frac) / 2**9\n\n    if sign:\n        value *= -1\n\n    return value", "entry_point": "float16", "input": "True", "output": "0.001953125", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/MetPy/blob/16f68a94919b9a82dcf9cada2169cf039129e67b/metpy/io/nexrad.py#L667-L682", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036376", "code": "def _map_arg_names(source, mapping):\n        \"\"\"Map one set of keys to another.\"\"\"\n        return {cartopy_name: source[cf_name] for cartopy_name, cf_name in mapping\n                if cf_name in source}", "entry_point": "_map_arg_names", "input": "[[1, 2], [3], []], {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/MetPy/blob/16f68a94919b9a82dcf9cada2169cf039129e67b/metpy/plots/mapping.py#L39-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036377", "code": "def fix_var_name(var_name):\n    \"\"\"Clean up and apply standard formatting to variable names.\"\"\"\n    name = var_name.strip()\n    for char in '(). /#,':\n        name = name.replace(char, '_')\n    name = name.replace('+', 'pos_')\n    name = name.replace('-', 'neg_')\n    if name.endswith('_'):\n        name = name[:-1]\n    return name", "entry_point": "fix_var_name", "input": "'walnut thistle harbour'", "output": "'walnut_thistle_harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/MetPy/blob/16f68a94919b9a82dcf9cada2169cf039129e67b/metpy/io/_nexrad_msgs/parse_spec.py#L126-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036378", "code": "def _abbrieviate_direction(ext_dir_str):\n    \"\"\"Convert extended (non-abbrievated) directions to abbrieviation.\"\"\"\n    return (ext_dir_str\n            .upper()\n            .replace('_', '')\n            .replace('-', '')\n            .replace(' ', '')\n            .replace('NORTH', 'N')\n            .replace('EAST', 'E')\n            .replace('SOUTH', 'S')\n            .replace('WEST', 'W')\n            )", "entry_point": "_abbrieviate_direction", "input": "'AbC dEf'", "output": "'ABCDEF'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Unidata/MetPy/blob/16f68a94919b9a82dcf9cada2169cf039129e67b/metpy/calc/tools.py#L1366-L1377", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036379", "code": "def tokenize(expr):\n    \"\"\"\n    Parse a string expression into a set of tokens that can be used as a path\n    into a Python datastructure.\n    \"\"\"\n    tokens = []\n    escape = False\n    cur_token = ''\n\n    for c in expr:\n        if escape == True:\n            cur_token += c\n            escape = False\n        else:\n            if c == '\\\\':\n                # Next char will be escaped\n                escape = True\n                continue\n            elif c == '[':\n                # Next token is of type index (list)\n                if len(cur_token) > 0:\n                    tokens.append(cur_token)\n                    cur_token = ''\n            elif c == ']':\n                # End of index token. Next token defaults to a key (dict)\n                if len(cur_token) > 0:\n                    tokens.append(int(cur_token))\n                    cur_token = ''\n            elif c == '.':\n                # End of key token. Next token defaults to a key (dict)\n                if len(cur_token) > 0:\n                    tokens.append(cur_token)\n                    cur_token = ''\n            else:\n                # Append char to token name\n                cur_token += c\n    if len(cur_token) > 0:\n        tokens.append(cur_token)\n\n    return tokens", "entry_point": "tokenize", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fboender/ansible-cmdb/blob/ebd960ac10684e8c9ec2b12751bba2c4c9504ab7/lib/jsonxs.py#L88-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036380", "code": "def sorted_dict_repr(d):\n    \"\"\"repr() a dictionary with the keys in order.\n\n    Used by the lexer unit test to compare parse trees based on strings.\n\n    \"\"\"\n    keys = list(d.keys())\n    keys.sort()\n    return \"{\" + \", \".join([\"%r: %r\" % (k, d[k]) for k in keys]) + \"}\"", "entry_point": "sorted_dict_repr", "input": "{'x': [1, 2], 'y': []}", "output": "\"{'x': [1, 2], 'y': []}\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fboender/ansible-cmdb/blob/ebd960ac10684e8c9ec2b12751bba2c4c9504ab7/lib/mako/util.py#L255-L263", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036381", "code": "def to_bool(s):\n    \"\"\"\n    Convert string `s` into a boolean. `s` can be 'true', 'True', 1, 'false',\n    'False', 0.\n\n    Examples:\n\n    >>> to_bool(\"true\")\n    True\n    >>> to_bool(\"0\")\n    False\n    >>> to_bool(True)\n    True\n    \"\"\"\n    if isinstance(s, bool):\n        return s\n    elif s.lower() in ['true', '1']:\n        return True\n    elif s.lower() in ['false', '0']:\n        return False\n    else:\n        raise ValueError(\"Can't cast '%s' to bool\" % (s))", "entry_point": "to_bool", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fboender/ansible-cmdb/blob/ebd960ac10684e8c9ec2b12751bba2c4c9504ab7/src/ansiblecmdb/util.py#L64-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036382", "code": "def legacy_html_escape(s):\n    \"\"\"legacy HTML escape for non-unicode mode.\"\"\"\n    s = s.replace(\"&\", \"&amp;\")\n    s = s.replace(\">\", \"&gt;\")\n    s = s.replace(\"<\", \"&lt;\")\n    s = s.replace('\"', \"&#34;\")\n    s = s.replace(\"'\", \"&#39;\")\n    return s", "entry_point": "legacy_html_escape", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fboender/ansible-cmdb/blob/ebd960ac10684e8c9ec2b12751bba2c4c9504ab7/lib/mako/filters.py#L27-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036383", "code": "def _split_comment(lineno, comment):\n        \"\"\"Return the multiline comment at lineno split into a list of\n        comment line numbers and the accompanying comment line\"\"\"\n        return [(lineno + index, line) for index, line in\n                enumerate(comment.splitlines())]", "entry_point": "_split_comment", "input": "0.5, 'walnut thistle harbour'", "output": "[(0.5, 'walnut thistle harbour')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fboender/ansible-cmdb/blob/ebd960ac10684e8c9ec2b12751bba2c4c9504ab7/lib/mako/ext/extract.py#L97-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036384", "code": "def _tz_offset_string(offset):\n        \"\"\"(Internal) Convert TZ offset in minutes east to string.\"\"\"\n\n        s = \"\"\n        io = int(offset)\n        if io == 0:\n            s += \"Z\"\n        else:\n            if -1440 < io < 1440:\n                ho = abs(io) / 60\n                mo = abs(io) % 60\n\n                s += \"%c%02u\" % (\"+\" if io > 0 else \"-\", ho)\n                if mo != 0:\n                    s += \":%02u\" % mo\n\n            else:\n                raise ValueError(\"Timezone `offset` (%u) out of range \"\n                                 \"-1439 to +1439 minutes\" % io)\n        return s", "entry_point": "_tz_offset_string", "input": "False", "output": "'Z'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/da4089/simplefix/blob/10f7f165a99a03467110bee69cc7c083c3531c68/simplefix/message.py#L663-L682", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036385", "code": "def readable_mem(mem):\n    \"\"\"\n    :param mem: An integer number of bytes to convert to human-readable form.\n    :return: A human-readable string representation of the number.\n    \"\"\"\n    for suffix in [\"\", \"K\", \"M\", \"G\", \"T\"]:\n        if mem < 10000:\n            return \"{}{}\".format(int(mem), suffix)\n        mem /= 1024\n    return \"{}P\".format(int(mem))", "entry_point": "readable_mem", "input": "10", "output": "'10'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/peterbrittain/asciimatics/blob/f471427d7786ce2d5f1eeb2dae0e67d19e46e085/asciimatics/utilities.py#L12-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036386", "code": "def process_settings(pelicanobj):\n    \"\"\"Sets user specified settings (see README for more details)\"\"\"\n\n    # Default settings\n    inline_settings = {}\n    inline_settings['config'] = {'[]':('', 'pelican-inline')}\n\n    # Get the user specified settings\n    try:\n        settings = pelicanobj.settings['MD_INLINE']\n    except:\n        settings = None\n\n    # If settings have been specified, add them to the config\n    if isinstance(settings, dict):\n        inline_settings['config'].update(settings)\n\n    return inline_settings", "entry_point": "process_settings", "input": "[[1, 2], [3], []]", "output": "{'config': {'[]': ('', 'pelican-inline')}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/getpelican/pelican-plugins/blob/cfc7a3f224f1743063b034561f89a6a712d13587/md_inline_extension/inline.py#L20-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036387", "code": "def generate_func_call(name, args=None, kwargs=None):\n    \"\"\"\n    Generates code to call a function.\n\n    Args:\n        name (str): The function name.\n        args (list[str]): Each positional argument.\n        kwargs (list[tuple]): Each tuple is (arg: str, value: str). If\n            value is None, then the keyword argument is omitted. Otherwise,\n            if the value is not a string, then str() is called on it.\n\n    Returns:\n        str: Code to call a function.\n    \"\"\"\n    all_args = []\n    if args:\n        all_args.extend(args)\n    if kwargs:\n        all_args.extend('{}={}'.format(k, v)\n                        for k, v in kwargs if v is not None)\n    return '{}({})'.format(name, ', '.join(all_args))", "entry_point": "generate_func_call", "input": "'  padded  ', ['a', 'b', 'c'], {}", "output": "'  padded  (a, b, c)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dropbox/stone/blob/2e95cbcd1c48e05cca68c919fd8d24adec6b0f58/stone/backends/python_types.py#L1205-L1225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036388", "code": "def parse_route_name_and_version(route_repr):\n    \"\"\"\n    Parse a route representation string and return the route name and version number.\n\n    :param route_repr: Route representation string.\n\n    :return: A tuple containing route name and version number.\n    \"\"\"\n    if ':' in route_repr:\n        route_name, version = route_repr.split(':', 1)\n        try:\n            version = int(version)\n        except ValueError:\n            raise ValueError('Invalid route representation: {}'.format(route_repr))\n    else:\n        route_name = route_repr\n        version = 1\n    return route_name, version", "entry_point": "parse_route_name_and_version", "input": "['a', 'b', 'c']", "output": "(['a', 'b', 'c'], 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dropbox/stone/blob/2e95cbcd1c48e05cca68c919fd8d24adec6b0f58/stone/frontend/ir_generator.py#L127-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036389", "code": "def _construct_values_list(values):\n        \"\"\"\n        This values_list is a strange construction, because of ini format.\n        We need to extract the values with the following supported format:\n\n            >>> key = value0\n            ...     value1\n            ...\n            ...     # comment line here\n            ...     value2\n\n        given that normally, either value0 is supplied, or (value1, value2),\n        but still allowing for all three at once.\n\n        Furthermore, with the configparser, we will get a list of values,\n        and intermediate blank lines, but no comments. This means that we can't\n        merely use the count of values' items to heuristically \"skip ahead\" lines,\n        because we still have to manually parse through this.\n\n        Therefore, we construct the values_list in the following fashion:\n            1. Keep the first value (in the example, this is `value0`)\n            2. For all other values, ignore blank lines.\n        Then, we can parse through, and look for values only.\n        \"\"\"\n        lines = values.splitlines()\n        values_list = lines[:1]\n        values_list.extend(filter(None, lines[1:]))\n        return values_list", "entry_point": "_construct_values_list", "input": "'AbC dEf'", "output": "['AbC dEf']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/detect-secrets/blob/473923ea71f1ac2b5ea1eacc49b98f97967e3d05/detect_secrets/plugins/common/ini_file_parser.py#L156-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036390", "code": "def trim_baseline_of_removed_secrets(results, baseline, filelist):\n    \"\"\"\n    NOTE: filelist is not a comprehensive list of all files in the repo\n    (because we can't be sure whether --all-files is passed in as a\n    parameter to pre-commit).\n\n    :type results: SecretsCollection\n    :type baseline: SecretsCollection\n\n    :type filelist: list(str)\n    :param filelist: filenames that are scanned.\n\n    :rtype: bool\n    :returns: True if baseline was updated\n    \"\"\"\n    updated = False\n    for filename in filelist:\n        if filename not in baseline.data:\n            # Nothing to modify, because not even there in the first place.\n            continue\n\n        if filename not in results.data:\n            # All secrets relating to that file was removed.\n            # We know this because:\n            #   1. It's a file that was scanned (in filelist)\n            #   2. It was in the baseline\n            #   3. It has no results now.\n            del baseline.data[filename]\n            updated = True\n            continue\n\n        # We clone the baseline, so that we can modify the baseline,\n        # without messing up the iteration.\n        for baseline_secret in baseline.data[filename].copy():\n            new_secret_found = results.get_secret(\n                filename,\n                baseline_secret.secret_hash,\n                baseline_secret.type,\n            )\n\n            if not new_secret_found:\n                # No longer in results, so can remove from baseline\n                old_secret_to_delete = baseline.get_secret(\n                    filename,\n                    baseline_secret.secret_hash,\n                    baseline_secret.type,\n                )\n                del baseline.data[filename][old_secret_to_delete]\n                updated = True\n\n            elif new_secret_found.lineno != baseline_secret.lineno:\n                # Secret moved around, should update baseline with new location\n                old_secret_to_update = baseline.get_secret(\n                    filename,\n                    baseline_secret.secret_hash,\n                    baseline_secret.type,\n                )\n                old_secret_to_update.lineno = new_secret_found.lineno\n                updated = True\n\n    return updated", "entry_point": "trim_baseline_of_removed_secrets", "input": "[-1, 0, 1, 2], '', []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/detect-secrets/blob/473923ea71f1ac2b5ea1eacc49b98f97967e3d05/detect_secrets/core/baseline.py#L103-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036391", "code": "def merge_results(old_results, new_results):\n    \"\"\"Update results in baseline with latest information.\n\n    :type old_results: dict\n    :param old_results: results of status quo\n\n    :type new_results: dict\n    :param new_results: results to replace status quo\n\n    :rtype: dict\n    \"\"\"\n    for filename, old_secrets in old_results.items():\n        if filename not in new_results:\n            continue\n\n        old_secrets_mapping = dict()\n        for old_secret in old_secrets:\n            old_secrets_mapping[old_secret['hashed_secret']] = old_secret\n\n        for new_secret in new_results[filename]:\n            if new_secret['hashed_secret'] not in old_secrets_mapping:\n                # We don't join the two secret sets, because if the newer\n                # result set did not discover an old secret, it probably\n                # moved.\n                continue\n\n            old_secret = old_secrets_mapping[new_secret['hashed_secret']]\n            # Only propagate 'is_secret' if it's not already there\n            if 'is_secret' in old_secret and 'is_secret' not in new_secret:\n                new_secret['is_secret'] = old_secret['is_secret']\n\n    return new_results", "entry_point": "merge_results", "input": "{'a': 1, 'b': 2}, [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Yelp/detect-secrets/blob/473923ea71f1ac2b5ea1eacc49b98f97967e3d05/detect_secrets/core/baseline.py#L192-L223", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036392", "code": "def _swap_curly(string):\n    \"\"\"Swap single and double curly brackets\"\"\"\n    return (\n        string.replace('{{ ', '{{').replace('{{', '\\x00').replace('{', '{{')\n        .replace('\\x00', '{').replace(' }}', '}}').replace('}}', '\\x00')\n        .replace('}', '}}').replace('\\x00', '}')\n    )", "entry_point": "_swap_curly", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kozea/pygal/blob/5e25c98a59a0642eecd9fcc5dbfeeb2190fbb5e7/pygal/util.py#L101-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036393", "code": "def parse_color(color):\n    \"\"\"Take any css color definition and give back a tuple containing the\n    r, g, b, a values along with a type which can be: #rgb, #rgba, #rrggbb,\n    #rrggbbaa, rgb, rgba\n    \"\"\"\n    r = g = b = a = type = None\n    if color.startswith('#'):\n        color = color[1:]\n        if len(color) == 3:\n            type = '#rgb'\n            color = color + 'f'\n        if len(color) == 4:\n            type = type or '#rgba'\n            color = ''.join([c * 2 for c in color])\n        if len(color) == 6:\n            type = type or '#rrggbb'\n            color = color + 'ff'\n        assert len(color) == 8\n        type = type or '#rrggbbaa'\n        r, g, b, a = [\n            int(''.join(c), 16) for c in zip(color[::2], color[1::2])\n        ]\n        a /= 255\n    elif color.startswith('rgb('):\n        type = 'rgb'\n        color = color[4:-1]\n        r, g, b, a = [int(c) for c in color.split(',')] + [1]\n    elif color.startswith('rgba('):\n        type = 'rgba'\n        color = color[5:-1]\n        r, g, b, a = [int(c) for c in color.split(',')[:-1]\n                      ] + [float(color.split(',')[-1])]\n    return r, g, b, a, type", "entry_point": "parse_color", "input": "'  padded  '", "output": "(None, None, None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Kozea/pygal/blob/5e25c98a59a0642eecd9fcc5dbfeeb2190fbb5e7/pygal/colors.py#L92-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036394", "code": "def inflect(word: str,\n            count: int):\n    \"\"\"\n    Minimal inflection module.\n\n    :param word: The word to inflect.\n    :param count: The count.\n    :return: The word, perhaps inflected for number.\n    \"\"\"\n    if word in ['time', 'sentence']:\n        return word if count == 1 else word + 's'\n    elif word == 'was':\n        return 'was' if count == 1 else 'were'\n    else:\n        return word + '(s)'", "entry_point": "inflect", "input": "'abc', 2", "output": "'abc(s)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/sockeye/blob/5d64a1ee1ef3cbba17c6d1d94bc061020c43f6ab/sockeye/utils.py#L993-L1007", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036395", "code": "def tsplit(string, delimiters):\n    \"\"\"Behaves str.split but supports tuples of delimiters.\"\"\"\n    delimiters = tuple(delimiters)\n    if len(delimiters) < 1:\n        return [string,]\n    final_delimiter = delimiters[0]\n    for i in delimiters[1:]:\n        string = string.replace(i, final_delimiter)\n    return string.split(final_delimiter)", "entry_point": "tsplit", "input": "False, set()", "output": "[False]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kennethreitz/clint/blob/9d3693d644b8587d985972b6075d970096f6439e/clint/utils.py#L62-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036396", "code": "def schunk(string, size):\n    \"\"\"Splits string into n sized chunks.\"\"\"\n    return [string[i:i+size] for i in range(0, len(string), size)]", "entry_point": "schunk", "input": "'', 10", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kennethreitz/clint/blob/9d3693d644b8587d985972b6075d970096f6439e/clint/utils.py#L73-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036397", "code": "def _xml_escape_attr(attr, skip_single_quote=True):\n    \"\"\"Escape the given string for use in an HTML/XML tag attribute.\n\n    By default this doesn't bother with escaping `'` to `&#39;`, presuming that\n    the tag attribute is surrounded by double quotes.\n    \"\"\"\n    escaped = (attr\n        .replace('&', '&amp;')\n        .replace('\"', '&quot;')\n        .replace('<', '&lt;')\n        .replace('>', '&gt;'))\n    if not skip_single_quote:\n        escaped = escaped.replace(\"'\", \"&#39;\")\n    return escaped", "entry_point": "_xml_escape_attr", "input": "'  padded  ', ('a', 'b', 'c')", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chibisov/drf-extensions/blob/1d28a4b28890eab5cd19e93e042f8590c8c2fb8b/docs/backdoc.py#L2164-L2177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036398", "code": "def resolve_is_aggregate(values):\n    \"\"\"\n    Resolves the is_aggregate flag for an expression that contains multiple terms.  This works like a voter system,\n    each term votes True or False or abstains with None.\n\n    :param values: A list of booleans (or None) for each term in the expression\n    :return: If all values are True or None, True is returned.  If all values are None, None is returned. Otherwise,\n        False is returned.\n    \"\"\"\n    result = [x\n              for x in values\n              if x is not None]\n    if result:\n        return all(result)\n    return None", "entry_point": "resolve_is_aggregate", "input": "['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kayak/pypika/blob/bfed26e963b982ecdb9697b61b67d76b493f2115/pypika/utils.py#L77-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036399", "code": "def instruction_list_to_easm(instruction_list: list) -> str:\n    \"\"\"Convert a list of instructions into an easm op code string.\n\n    :param instruction_list:\n    :return:\n    \"\"\"\n    result = \"\"\n\n    for instruction in instruction_list:\n        result += \"{} {}\".format(instruction[\"address\"], instruction[\"opcode\"])\n        if \"argument\" in instruction:\n            result += \" \" + instruction[\"argument\"]\n        result += \"\\n\"\n\n    return result", "entry_point": "instruction_list_to_easm", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ConsenSys/mythril-classic/blob/27af71c34b2ce94f4fae5613ec457f93df1a8f56/mythril/disassembler/asm.py#L34-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036400", "code": "def is_sequence_match(pattern: list, instruction_list: list, index: int) -> bool:\n    \"\"\"Checks if the instructions starting at index follow a pattern.\n\n    :param pattern: List of lists describing a pattern, e.g. [[\"PUSH1\", \"PUSH2\"], [\"EQ\"]] where [\"PUSH1\", \"EQ\"] satisfies pattern\n    :param instruction_list: List of instructions\n    :param index: Index to check for\n    :return: Pattern matched\n    \"\"\"\n    for index, pattern_slot in enumerate(pattern, start=index):\n        try:\n            if not instruction_list[index][\"opcode\"] in pattern_slot:\n                return False\n        except IndexError:\n            return False\n    return True", "entry_point": "is_sequence_match", "input": "[[1, 2], [3], []], [], 1", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ConsenSys/mythril-classic/blob/27af71c34b2ce94f4fae5613ec457f93df1a8f56/mythril/disassembler/asm.py#L76-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036401", "code": "def get_context_first_matching_object(context, context_lookups):\n    \"\"\"\n    Return the first object found in the context,\n    from a list of keys, with the matching key.\n    \"\"\"\n    for key in context_lookups:\n        context_object = context.get(key)\n        if context_object:\n            return key, context_object\n    return None, None", "entry_point": "get_context_first_matching_object", "input": "'walnut thistle harbour', {}", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Fantomas42/django-blog-zinnia/blob/b4949304b104a8e1a7a7a0773cbfd024313c3a15/zinnia/context.py#L4-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036402", "code": "def get_context_loop_positions(context):\n    \"\"\"\n    Return the paginated current position within a loop,\n    and the non-paginated position.\n    \"\"\"\n    try:\n        loop_counter = context['forloop']['counter']\n    except KeyError:\n        return 0, 0\n    try:\n        page = context['page_obj']\n    except KeyError:\n        return loop_counter, loop_counter\n    total_loop_counter = ((page.number - 1) * page.paginator.per_page +\n                          loop_counter)\n    return total_loop_counter, loop_counter", "entry_point": "get_context_loop_positions", "input": "{'x': [1, 2], 'y': []}", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Fantomas42/django-blog-zinnia/blob/b4949304b104a8e1a7a7a0773cbfd024313c3a15/zinnia/context.py#L25-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036403", "code": "def _wl_dist(wl_a, wl_b):\n    \"\"\"Return the distance between two requested wavelengths.\"\"\"\n    if isinstance(wl_a, tuple):\n        # central wavelength\n        wl_a = wl_a[1]\n    if isinstance(wl_b, tuple):\n        wl_b = wl_b[1]\n    if wl_a is None or wl_b is None:\n        return 1000.\n    return abs(wl_a - wl_b)", "entry_point": "_wl_dist", "input": "3.25, 7", "output": "3.75", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pytroll/satpy/blob/1f21d20ac686b745fb0da9b4030d139893e066dd/satpy/readers/__init__.py#L83-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036404", "code": "def split_desired_other(fhs, req_geo, rem_geo):\n    \"\"\"Split the provided filehandlers *fhs* into desired filehandlers and others.\"\"\"\n    desired = []\n    other = []\n    for fh in fhs:\n        if req_geo in fh.datasets:\n            desired.append(fh)\n        elif rem_geo in fh.datasets:\n            other.append(fh)\n    return desired, other", "entry_point": "split_desired_other", "input": "[], [], [-1, 0, 1, 2]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pytroll/satpy/blob/1f21d20ac686b745fb0da9b4030d139893e066dd/satpy/readers/viirs_sdr.py#L419-L428", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036405", "code": "def _is_vis(channel):\n        \"\"\"Determine whether the given channel is a visible channel\"\"\"\n        if isinstance(channel, str):\n            return channel == '00_7'\n        elif isinstance(channel, int):\n            return channel == 1\n        else:\n            raise ValueError('Invalid channel')", "entry_point": "_is_vis", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pytroll/satpy/blob/1f21d20ac686b745fb0da9b4030d139893e066dd/satpy/readers/goes_imager_nc.py#L637-L644", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036406", "code": "def calculate_include_paths(targets, is_thrift_target):\n  \"\"\"Calculates the set of import paths for the given targets.\n\n  :targets: The targets to examine.\n  :is_thrift_target: A predicate to pick out thrift targets for consideration in the analysis.\n\n  :returns: Include basedirs for the target.\n  \"\"\"\n\n  basedirs = set()\n  def collect_paths(target):\n    basedirs.add(target.target_base)\n\n  for target in targets:\n    target.walk(collect_paths, predicate=is_thrift_target)\n  return basedirs", "entry_point": "calculate_include_paths", "input": "[], [-1, 0, 1, 2]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_util.py#L60-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036407", "code": "def ensure_arg(args, arg, param=None):\n  \"\"\"Make sure the arg is present in the list of args.\n\n  If arg is not present, adds the arg and the optional param.\n  If present and param != None, sets the parameter following the arg to param.\n\n  :param list args: strings representing an argument list.\n  :param string arg: argument to make sure is present in the list.\n  :param string param: parameter to add or update after arg in the list.\n  :return: possibly modified list of args.\n  \"\"\"\n  for idx, found_arg in enumerate(args):\n    if found_arg == arg:\n      if param is not None:\n        args[idx + 1] = param\n      return args\n\n  args.append(arg)\n  if param is not None:\n    args.append(param)\n  return args", "entry_point": "ensure_arg", "input": "['a', 'b', 'c'], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "['a', 'b', 'c', ['a', 'b', 'c'], ['a', 'b', 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/src/python/pants/util/argutil.py#L8-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036408", "code": "def remove_arg(args, arg, has_param=False):\n  \"\"\"Removes the first instance of the specified arg from the list of args.\n\n  If the arg is present and has_param is set, also removes the parameter that follows\n  the arg.\n  :param list args: strings representing an argument list.\n  :param staring arg: argument to remove from the list.\n  :param bool has_param: if true, also remove the parameter that follows arg in the list.\n  :return: possibly modified list of args.\n  \"\"\"\n  for idx, found_arg in enumerate(args):\n    if found_arg == arg:\n      if has_param:\n        slice_idx = idx + 2\n      else:\n        slice_idx = idx + 1\n      args = args[:idx] + args[slice_idx:]\n      break\n  return args", "entry_point": "remove_arg", "input": "[], ['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/src/python/pants/util/argutil.py#L31-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036409", "code": "def compute_default(kwargs):\n    \"\"\"Compute the default value to display in help for an option registered with these kwargs.\"\"\"\n    ranked_default = kwargs.get('default')\n    typ = kwargs.get('type', str)\n\n    default = ranked_default.value if ranked_default else None\n    if default is None:\n      return 'None'\n\n    if typ == list:\n      default_str = '[{}]'.format(','.join([\"'{}'\".format(s) for s in default]))\n    elif typ == dict:\n      if default:\n        default_str = '{{ {} }}'.format(\n          ','.join([\"'{}':'{}'\".format(k, v) for k, v in default.items()]))\n      else:\n        default_str = '{}'\n    elif typ == str:\n      default_str = \"'{}'\".format(default).replace('\\n', ' ')\n    else:\n      default_str = str(default)\n    return default_str", "entry_point": "compute_default", "input": "{}", "output": "'None'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/src/python/pants/help/help_info_extracter.py#L65-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036410", "code": "def strip_prefix(string, prefix):\n  \"\"\"Returns a copy of the string from which the multi-character prefix has been stripped.\n\n  Use strip_prefix() instead of lstrip() to remove a substring (instead of individual characters)\n  from the beginning of a string, if the substring is present.  lstrip() does not match substrings\n  but rather treats a substring argument as a set of characters.\n\n  :param str string: The string from which to strip the specified prefix.\n  :param str prefix: The substring to strip from the left of string, if present.\n  :return: The string with prefix stripped from the left, if present.\n  :rtype: string\n  \"\"\"\n  if string.startswith(prefix):\n    return string[len(prefix):]\n  else:\n    return string", "entry_point": "strip_prefix", "input": "'walnut thistle harbour', 'walnut thistle harbour'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/src/python/pants/util/strutil.py#L115-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036411", "code": "def fast_relpath_optional(path, start):\n  \"\"\"A prefix-based relpath, with no normalization or support for returning `..`.\n\n  Returns None if `start` is not a directory-aware prefix of `path`.\n  \"\"\"\n  if len(start) == 0:\n    # Empty prefix.\n    return path\n\n  # Determine where the matchable prefix ends.\n  pref_end = len(start) - 1 if start[-1] == '/' else len(start)\n  if pref_end > len(path):\n    # The prefix is too long to match.\n    return None\n  elif path[:pref_end] == start[:pref_end] and (len(path) == pref_end or path[pref_end] == '/'):\n    # The prefix matches, and the entries are either identical, or the suffix indicates that\n    # the prefix is a directory.\n    return path[pref_end+1:]", "entry_point": "fast_relpath_optional", "input": "'abc', []", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/src/python/pants/util/dirutil.py#L43-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036412", "code": "def create_unbroadcast_axis(shape, broadcast_shape):\n  \"\"\"Creates the reduction axis for unbroadcasting.\n\n  Args:\n    shape: A list. The shape after the broadcast operation.\n    broadcast_shape: A list. The original shape the array being unbroadcast\n      had.\n  Returns:\n    A list. The axes along which the array needs to be reduced. These axes will\n    be distributed evenly into the original shape.\n  \"\"\"\n  return tuple(\n      -(1 + i)\n      for i in range(len(broadcast_shape))\n      if i >= len(shape) or broadcast_shape[-(1 + i)] > shape[-(1 + i)])", "entry_point": "create_unbroadcast_axis", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/tangent/blob/6533e83af09de7345d1b438512679992f080dcc9/tangent/utils.py#L120-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036413", "code": "def parse_single_report(f):\n    \"\"\" Parse a gatk varianteval varianteval \"\"\"\n    # Fixme: Separate GATKReport parsing and data subsetting. A GATKReport parser now available from the GATK MultiqcModel.\n\n    data = dict()\n    in_CompOverlap = False\n    in_CountVariants = False\n    in_TiTv = False\n    for l in f:\n        # Detect section headers\n        if '#:GATKTable:CompOverlap' in l:\n            in_CompOverlap = True\n        elif '#:GATKTable:CountVariants' in l:\n            in_CountVariants = True\n        elif '#:GATKTable:TiTvVariantEvaluator' in l:\n            in_TiTv = True\n        else:\n            # Parse contents using nested loops\n            if in_CompOverlap:\n                headers = l.split()\n                while in_CompOverlap:\n                    l = f.readline().strip(\"\\n\")\n                    d = dict()\n                    try:\n                        for i, s in enumerate(l.split()):\n                            d[headers[i]] = s\n                        if d['Novelty'] == 'all':\n                            data['reference'] = d['CompRod']\n                            data['comp_rate'] = float(d['compRate'])\n                            data['concordant_rate'] = float(d['concordantRate'])\n                            data['eval_variants'] = int(d['nEvalVariants'])\n                            data['novel_sites'] = int(d['novelSites'])\n                        elif d['Novelty'] == 'known':\n                            data['known_sites'] = int(d['nEvalVariants'])\n                    except KeyError:\n                        in_CompOverlap = False\n            elif in_CountVariants:\n                headers = l.split()\n                while in_CountVariants:\n                    l = f.readline().strip(\"\\n\")\n                    d = dict()\n                    try:\n                        for i, s in enumerate(l.split()):\n                            d[headers[i]] = s\n                        if d['Novelty'] == 'all':\n                            data['snps'] = int(d['nSNPs'])\n                            data['mnps'] = int(d['nMNPs'])\n                            data['insertions'] = int(d['nInsertions'])\n                            data['deletions'] = int(d['nDeletions'])\n                            data['complex'] = int(d['nComplex'])\n                            data['symbolic'] = int(d['nSymbolic'])\n                            data['mixed'] = int(d['nMixed'])\n                            data['nocalls'] = int(d['nNoCalls'])\n                    except KeyError:\n                        in_CountVariants = False\n            elif in_TiTv:\n                headers = l.split()\n                data['titv_reference'] = 'unknown'\n                while in_TiTv:\n                    l = f.readline().strip(\"\\n\")\n                    d = dict()\n                    try:\n                        for i, s in enumerate(l.split()):\n                            d[headers[i]] = s\n                        if d['Novelty'] == 'known':\n                            data['titv_reference'] = d['CompRod']\n                            data['known_titv'] = float(d['tiTvRatio'])\n                        elif d['Novelty'] == 'novel':\n                            data['novel_titv'] = float(d['tiTvRatio'])\n                    except KeyError:\n                        in_TiTv = False\n\n    return data", "entry_point": "parse_single_report", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewels/MultiQC/blob/2037d6322b2554146a74efbf869156ad20d4c4ec/multiqc/modules/gatk/varianteval.py#L81-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036414", "code": "def get_colors(n):\n        \"\"\"get colors for freqpoly graph\"\"\"\n        cb_palette = [\"#E69F00\", \"#56B4E9\", \"#009E73\", \"#F0E442\", \"#0072B2\", \"#D55E00\",\n                      \"#CC79A7\",\"#001F3F\", \"#0074D9\", \"#7FDBFF\", \"#39CCCC\", \"#3D9970\", \"#2ECC40\",\n                       \"#01FF70\", \"#FFDC00\", \"#FF851B\", \"#FF4136\", \"#F012BE\", \"#B10DC9\",\n                       \"#85144B\", \"#AAAAAA\", \"#000000\"]\n\n        whole = int(n/22)\n        extra = (n % 22)\n        cols = cb_palette * whole\n        if extra >= 0:\n            cols.extend(cb_palette[0:extra])\n        return cols", "entry_point": "get_colors", "input": "True", "output": "['#E69F00']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ewels/MultiQC/blob/2037d6322b2554146a74efbf869156ad20d4c4ec/multiqc/modules/flash/flash.py#L202-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036415", "code": "def issubset(list1, list2):\n    \"\"\"\n    Examples:\n\n    >>> issubset([], [65, 66, 67])\n    True\n    >>> issubset([65], [65, 66, 67])\n    True\n    >>> issubset([65, 66], [65, 66, 67])\n    True\n    >>> issubset([65, 67], [65, 66, 67])\n    False\n    \"\"\"\n    n = len(list1)\n    for startpos in range(len(list2) - n + 1):\n        if list2[startpos:startpos+n] == list1:\n            return True\n    return False", "entry_point": "issubset", "input": "[[1, 2], [3], []], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/types/__init__.py#L196-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036416", "code": "def _url_collapse_path(path):\n    \"\"\"\n    Given a URL path, remove extra '/'s and '.' path elements and collapse\n    any '..' references and returns a colllapsed path.\n\n    Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.\n    The utility of this function is limited to is_cgi method and helps\n    preventing some security attacks.\n\n    Returns: A tuple of (head, tail) where tail is everything after the final /\n    and head is everything before it.  Head will always start with a '/' and,\n    if it contains anything else, never have a trailing '/'.\n\n    Raises: IndexError if too many '..' occur within the path.\n\n    \"\"\"\n    # Similar to os.path.split(os.path.normpath(path)) but specific to URL\n    # path semantics rather than local operating system semantics.\n    path_parts = path.split('/')\n    head_parts = []\n    for part in path_parts[:-1]:\n        if part == '..':\n            head_parts.pop() # IndexError if more '..' than prior parts\n        elif part and part != '.':\n            head_parts.append( part )\n    if path_parts:\n        tail_part = path_parts.pop()\n        if tail_part:\n            if tail_part == '..':\n                head_parts.pop()\n                tail_part = ''\n            elif tail_part == '.':\n                tail_part = ''\n    else:\n        tail_part = ''\n\n    splitpath = ('/' + '/'.join(head_parts), tail_part)\n    collapsed_path = \"/\".join(splitpath)\n\n    return collapsed_path", "entry_point": "_url_collapse_path", "input": "'a,b,c'", "output": "'//a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/backports/http/server.py#L856-L895", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036417", "code": "def parse_keqv_list(l):\n    \"\"\"Parse list of key=value strings where keys are not duplicated.\"\"\"\n    parsed = {}\n    for elt in l:\n        k, v = elt.split('=', 1)\n        if v[0] == '\"' and v[-1] == '\"':\n            v = v[1:-1]\n        parsed[k] = v\n    return parsed", "entry_point": "parse_keqv_list", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/backports/urllib/request.py#L1355-L1363", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036418", "code": "def parse_http_list(s):\n    \"\"\"Parse lists as described by RFC 2068 Section 2.\n\n    In particular, parse comma-separated lists where the elements of\n    the list may include quoted-strings.  A quoted-string could\n    contain a comma.  A non-quoted string could have quotes in the\n    middle.  Neither commas nor quotes count if they are escaped.\n    Only double-quotes count, not single-quotes.\n    \"\"\"\n    res = []\n    part = ''\n\n    escape = quote = False\n    for cur in s:\n        if escape:\n            part += cur\n            escape = False\n            continue\n        if quote:\n            if cur == '\\\\':\n                escape = True\n                continue\n            elif cur == '\"':\n                quote = False\n            part += cur\n            continue\n\n        if cur == ',':\n            res.append(part)\n            part = ''\n            continue\n\n        if cur == '\"':\n            quote = True\n\n        part += cur\n\n    # append last part\n    if part:\n        res.append(part)\n\n    return [part.strip() for part in res]", "entry_point": "parse_http_list", "input": "['a', 'b', 'c']", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/backports/urllib/request.py#L1365-L1406", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036419", "code": "def header_length(bytearray):\n    \"\"\"Return the length of s when it is encoded with base64.\"\"\"\n    groups_of_3, leftover = divmod(len(bytearray), 3)\n    # 4 bytes out for each 3 bytes (or nonzero fraction thereof) in.\n    n = groups_of_3 * 4\n    if leftover:\n        n += 4\n    return n", "entry_point": "header_length", "input": "['a', 'b', 'c']", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/backports/email/base64mime.py#L54-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036420", "code": "def unwrap(url):\n    \"\"\"unwrap('<URL:type://host/path>') --> 'type://host/path'.\"\"\"\n    url = str(url).strip()\n    if url[:1] == '<' and url[-1:] == '>':\n        url = url[1:-1].strip()\n    if url[:4] == 'URL:': url = url[4:].strip()\n    return url", "entry_point": "unwrap", "input": "[5, 3, 1, 4]", "output": "'[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/backports/urllib/parse.py#L853-L859", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036421", "code": "def unquote(str):\n    \"\"\"Remove quotes from a string.\"\"\"\n    if len(str) > 1:\n        if str.startswith('\"') and str.endswith('\"'):\n            return str[1:-1].replace('\\\\\\\\', '\\\\').replace('\\\\\"', '\"')\n        if str.startswith('<') and str.endswith('>'):\n            return str[1:-1]\n    return str", "entry_point": "unquote", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/backports/email/utils.py#L247-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036422", "code": "def _repr_strip(mystring):\n    \"\"\"\n    Returns the string without any initial or final quotes.\n    \"\"\"\n    r = repr(mystring)\n    if r.startswith(\"'\") and r.endswith(\"'\"):\n        return r[1:-1]\n    else:\n        return r", "entry_point": "_repr_strip", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PythonCharmers/python-future/blob/c423752879acc05eebc29b0bb9909327bd5c7308/src/future/utils/__init__.py#L372-L380", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036423", "code": "def parseDockerAppliance(appliance):\n    \"\"\"\n    Takes string describing a docker image and returns the parsed\n    registry, image reference, and tag for that image.\n\n    Example: \"quay.io/ucsc_cgl/toil:latest\"\n    Should return: \"quay.io\", \"ucsc_cgl/toil\", \"latest\"\n\n    If a registry is not defined, the default is: \"docker.io\"\n    If a tag is not defined, the default is: \"latest\"\n\n    :param appliance: The full url of the docker image originally\n                      specified by the user (or the default).\n                      e.g. \"quay.io/ucsc_cgl/toil:latest\"\n    :return: registryName, imageName, tag\n    \"\"\"\n    appliance = appliance.lower()\n\n    # get the tag\n    if ':' in appliance:\n        tag = appliance.split(':')[-1]\n        appliance = appliance[:-(len(':' + tag))] # remove only the tag\n    else:\n        # default to 'latest' if no tag is specified\n        tag = 'latest'\n\n    # get the registry and image\n    registryName = 'docker.io' # default if not specified\n    imageName = appliance # will be true if not specified\n    if '/' in appliance and '.' in appliance.split('/')[0]:\n        registryName = appliance.split('/')[0]\n        imageName = appliance[len(registryName):]\n    registryName = registryName.strip('/')\n    imageName = imageName.strip('/')\n\n    return registryName, imageName, tag", "entry_point": "parseDockerAppliance", "input": "'AbC dEf'", "output": "('docker.io', 'abc def', 'latest')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/toil/blob/a8252277ff814e7bee0971139c2344f88e44b644/src/toil/__init__.py#L279-L314", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036424", "code": "def mean(xs):\n    \"\"\"\n    Return the mean value of a sequence of values.\n\n    >>> mean([2,4,4,4,5,5,7,9])\n    5.0\n    >>> mean([9,10,11,7,13])\n    10.0\n    >>> mean([1,1,10,19,19])\n    10.0\n    >>> mean([10,10,10,10,10])\n    10.0\n    >>> mean([1,\"b\"])\n    Traceback (most recent call last):\n      ...\n    ValueError: Input can't have non-numeric elements\n    >>> mean([])\n    Traceback (most recent call last):\n      ...\n    ValueError: Input can't be empty\n    \"\"\"\n    try:\n        return sum(xs) / float(len(xs))\n    except TypeError:\n        raise ValueError(\"Input can't have non-numeric elements\")\n    except ZeroDivisionError:\n        raise ValueError(\"Input can't be empty\")", "entry_point": "mean", "input": "[1, 2, 3]", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/toil/blob/a8252277ff814e7bee0971139c2344f88e44b644/src/toil/lib/misc.py#L19-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036425", "code": "def parseSetEnv(l):\n    \"\"\"\n    Parses a list of strings of the form \"NAME=VALUE\" or just \"NAME\" into a dictionary. Strings\n    of the latter from will result in dictionary entries whose value is None.\n\n    :type l: list[str]\n    :rtype: dict[str,str]\n\n    >>> parseSetEnv([])\n    {}\n    >>> parseSetEnv(['a'])\n    {'a': None}\n    >>> parseSetEnv(['a='])\n    {'a': ''}\n    >>> parseSetEnv(['a=b'])\n    {'a': 'b'}\n    >>> parseSetEnv(['a=a', 'a=b'])\n    {'a': 'b'}\n    >>> parseSetEnv(['a=b', 'c=d'])\n    {'a': 'b', 'c': 'd'}\n    >>> parseSetEnv(['a=b=c'])\n    {'a': 'b=c'}\n    >>> parseSetEnv([''])\n    Traceback (most recent call last):\n    ...\n    ValueError: Empty name\n    >>> parseSetEnv(['=1'])\n    Traceback (most recent call last):\n    ...\n    ValueError: Empty name\n    \"\"\"\n    d = dict()\n    for i in l:\n        try:\n            k, v = i.split('=', 1)\n        except ValueError:\n            k, v = i, None\n        if not k:\n            raise ValueError('Empty name')\n        d[k] = v\n    return d", "entry_point": "parseSetEnv", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/toil/blob/a8252277ff814e7bee0971139c2344f88e44b644/src/toil/common.py#L1244-L1284", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036426", "code": "def map(lst, serialize_func):\n    \"\"\"\n    Applies serialize_func to every element in lst\n    \"\"\"\n    if not isinstance(lst, list):\n        return lst\n    return [serialize_func(e) for e in lst]", "entry_point": "map", "input": "(1, 2), 5", "output": "(1, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/base/serialize.py#L68-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036427", "code": "def short_repr(item, max_length=15):\n    \"\"\"Short representation of item if it is too long\"\"\"\n    item = repr(item)\n    if len(item) > max_length:\n        item = '{}...{}'.format(item[:max_length - 3], item[-1])\n    return item", "entry_point": "short_repr", "input": "['a', 'b', 'c'], 0", "output": "\"['a', 'b', '...]\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seperman/deepdiff/blob/a66879190fadc671632f154c1fcb82f5c3cef800/deepdiff/helper.py#L46-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036428", "code": "def luhn_validate(number):\n    \"\"\" Source code from: https://en.wikipedia.org/wiki/Luhn_algorithm\"\"\"\n\n    sum = 0\n    parity = len(number) % 2\n    for i, digit in enumerate([int(x) for x in number]):\n        if i % 2 == parity:\n            digit *= 2\n            if digit > 9:\n                digit -= 9\n        sum += digit\n    return sum % 10 == 0", "entry_point": "luhn_validate", "input": "[5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/portantier/habu/blob/87091e389dc6332fe1b82830c22b2eefc55816f2/habu/cli/cmd_crack_luhn.py#L9-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036429", "code": "def lexical_distance(a_str: str, b_str: str) -> int:\n    \"\"\"Computes the lexical distance between strings A and B.\n\n    The \"distance\" between two strings is given by counting the minimum number of edits\n    needed to transform string A into string B. An edit can be an insertion, deletion,\n    or substitution of a single character, or a swap of two adjacent characters.\n\n    This distance can be useful for detecting typos in input or sorting.\n    \"\"\"\n    if a_str == b_str:\n        return 0\n\n    a, b = a_str.lower(), b_str.lower()\n    a_len, b_len = len(a), len(b)\n\n    # Any case change counts as a single edit\n    if a == b:\n        return 1\n\n    d = [[j for j in range(0, b_len + 1)]]\n    for i in range(1, a_len + 1):\n        d.append([i] + [0] * b_len)\n\n    for i in range(1, a_len + 1):\n        for j in range(1, b_len + 1):\n            cost = 0 if a[i - 1] == b[j - 1] else 1\n\n            d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost)\n\n            if i > 1 and j > 1 and a[i - 1] == b[j - 2] and a[i - 2] == b[j - 1]:\n                d[i][j] = min(d[i][j], d[i - 2][j - 2] + cost)\n\n    return d[a_len][b_len]", "entry_point": "lexical_distance", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/graphql-python/graphql-core-next/blob/073dce3f002f897d40f9348ffd8f107815160540/graphql/pyutils/suggestion_list.py#L24-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036430", "code": "def wrap(start: str, string: str, end: str = \"\") -> str:\n    \"\"\"Wrap string inside other strings at start and end.\n\n    If the string is not None or empty, then wrap with start and end, otherwise return\n    an empty string.\n    \"\"\"\n    return f\"{start}{string}{end}\" if string else \"\"", "entry_point": "wrap", "input": "[[1, 2], [3], []], 'a,b,c', [1, 2, 3]", "output": "'[[1, 2], [3], []]a,b,c[1, 2, 3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/graphql-python/graphql-core-next/blob/073dce3f002f897d40f9348ffd8f107815160540/graphql/language/printer.py#L323-L329", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036431", "code": "def result_anything_found(result):\n    \"\"\"\n    Interim solution for the fact that sometimes determine_scanning_method can\n    legitimately return a valid scanning method, but it results that the site\n    does not belong to a particular CMS.\n    @param result: the result as passed to Output.result()\n    @return: whether anything was found.\n    \"\"\"\n    keys = ['version', 'themes', 'plugins', 'interesting urls']\n    anything_found = False\n    for k in keys:\n        if k not in result:\n            continue\n        else:\n            if not result[k]['is_empty']:\n                anything_found = True\n\n    return anything_found", "entry_point": "result_anything_found", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/droope/droopescan/blob/424c48a0f9d12b4536dbef5a786f0fbd4ce9519a/dscan/common/functions.py#L356-L373", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036432", "code": "def only(iterable, default=None, too_long=None):\n    \"\"\"If *iterable* has only one item, return it.\n    If it has zero items, return *default*.\n    If it has more than one item, raise the exception given by *too_long*,\n    which is ``ValueError`` by default.\n\n    >>> only([], default='missing')\n    'missing'\n    >>> only([1])\n    1\n    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL\n    Traceback (most recent call last):\n    ...\n    ValueError: too many items in iterable (expected 1)'\n    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL\n    Traceback (most recent call last):\n    ...\n    TypeError\n\n    Note that :func:`only` attempts to advance *iterable* twice to ensure there\n    is only one item.  See :func:`spy` or :func:`peekable` to check\n    iterable contents less destructively.\n    \"\"\"\n    it = iter(iterable)\n    value = next(it, default)\n\n    try:\n        next(it)\n    except StopIteration:\n        pass\n    else:\n        raise too_long or ValueError('too many items in iterable (expected 1)')\n\n    return value", "entry_point": "only", "input": "[], ['a', 'b', 'c'], [5, 3, 1, 4]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/erikrose/more-itertools/blob/6a91b4e25c8e12fcf9fc2b53cf8ee0fba293e6f9/more_itertools/more.py#L2420-L2453", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036433", "code": "def snake_to_camel(snake_str):\n    \"\"\"\n    :param snake_str: string\n    :return: string converted from a snake_case to a CamelCase\n    \"\"\"\n    components = snake_str.split('_')\n    return ''.join(x.title() for x in components)", "entry_point": "snake_to_camel", "input": "'AbC dEf'", "output": "'Abc Def'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/capless/warrant/blob/ff2e4793d8479e770f2461ef7cbc0c15ee784395/warrant/__init__.py#L48-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036434", "code": "def __hammingDistance(s1, s2):\n        '''\n        Finds the Hamming distance between two strings.\n\n        @param s1: string\n        @param s2: string\n        @return: the distance\n        @raise ValueError: if the lenght of the strings differ\n        '''\n\n        l1 = len(s1)\n        l2 = len(s2)\n\n        if l1 != l2:\n            raise ValueError(\"Hamming distance requires strings of same size.\")\n\n        return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2))", "entry_point": "__hammingDistance", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dtmilano/AndroidViewClient/blob/7e6e83fde63af99e5e4ab959712ecf94f9881aa2/src/com/dtmilano/android/viewclient.py#L4216-L4232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036435", "code": "def get_signed_headers(headers):\n    \"\"\"\n    Get signed headers.\n\n    :param headers: input dictionary to be sorted.\n    \"\"\"\n    signed_headers = []\n    for header in headers:\n        signed_headers.append(header.lower().strip())\n    return sorted(signed_headers)", "entry_point": "get_signed_headers", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/minio/minio-py/blob/7107c84183cf5fb4deff68c0a16ab9f1c0b4c37e/minio/signer.py#L160-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036436", "code": "def is_non_empty_string(input_string):\n    \"\"\"\n    Validate if non empty string\n\n    :param input_string: Input is a *str*.\n    :return: True if input is string and non empty.\n       Raise :exc:`Exception` otherwise.\n    \"\"\"\n    try:\n        if not input_string.strip():\n            raise ValueError()\n    except AttributeError as error:\n        raise TypeError(error)\n\n    return True", "entry_point": "is_non_empty_string", "input": "'AbC dEf'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/minio/minio-py/blob/7107c84183cf5fb4deff68c0a16ab9f1c0b4c37e/minio/helpers.py#L358-L372", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036437", "code": "def pin_list_to_board_dict(pinlist):\n    \"\"\"\n    Capability Response codes:\n        INPUT:  0, 1\n        OUTPUT: 1, 1\n        ANALOG: 2, 10\n        PWM:    3, 8\n        SERV0:  4, 14\n        I2C:    6, 1\n    \"\"\"\n\n    board_dict = {\n        \"digital\": [],\n        \"analog\": [],\n        \"pwm\": [],\n        \"servo\": [],  # 2.2 specs\n        # 'i2c': [],  # 2.3 specs\n        \"disabled\": [],\n    }\n    for i, pin in enumerate(pinlist):\n        pin.pop()  # removes the 0x79 on end\n        if not pin:\n            board_dict[\"disabled\"] += [i]\n            board_dict[\"digital\"] += [i]\n            continue\n\n        for j, _ in enumerate(pin):\n            # Iterate over evens\n            if j % 2 == 0:\n                # This is safe. try: range(10)[5:50]\n                if pin[j:j + 4] == [0, 1, 1, 1]:\n                    board_dict[\"digital\"] += [i]\n\n                if pin[j:j + 2] == [2, 10]:\n                    board_dict[\"analog\"] += [i]\n\n                if pin[j:j + 2] == [3, 8]:\n                    board_dict[\"pwm\"] += [i]\n\n                if pin[j:j + 2] == [4, 14]:\n                    board_dict[\"servo\"] += [i]\n\n                # Desable I2C\n                if pin[j:j + 2] == [6, 1]:\n                    pass\n\n    # We have to deal with analog pins:\n    # - (14, 15, 16, 17, 18, 19)\n    # + (0, 1, 2, 3, 4, 5)\n    diff = set(board_dict[\"digital\"]) - set(board_dict[\"analog\"])\n    board_dict[\"analog\"] = [n for n, _ in enumerate(board_dict[\"analog\"])]\n\n    # Digital pin problems:\n    # - (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)\n    # + (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)\n\n    board_dict[\"digital\"] = [n for n, _ in enumerate(diff)]\n    # Based on lib Arduino 0017\n    board_dict[\"servo\"] = board_dict[\"digital\"]\n\n    # Turn lists into tuples\n    # Using dict for Python 2.6 compatibility\n    board_dict = dict([(key, tuple(value)) for key, value in board_dict.items()])\n\n    return board_dict", "entry_point": "pin_list_to_board_dict", "input": "set()", "output": "{'digital': (), 'analog': (), 'pwm': (), 'servo': (), 'disabled': ()}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tino/pyFirmata/blob/05881909c4d7c4e808e9ed457144670b2136706e/pyfirmata/util.py#L161-L225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036438", "code": "def split_writable_text(encoder, text, encoding):\n    \"\"\"Splits off as many characters from the begnning of text as\n    are writable with \"encoding\". Returns a 2-tuple (writable, rest).\n    \"\"\"\n    if not encoding:\n        return None, text\n\n    for idx, char in enumerate(text):\n        if encoder.can_encode(encoding, char):\n            continue\n        return text[:idx], text[idx:]\n\n    return text, None", "entry_point": "split_writable_text", "input": "[], '', ['a', 'b', 'c']", "output": "('', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-escpos/python-escpos/blob/52719c0b7de8948fabdffd180a2d71c22cf4c02b/src/escpos/magicencode.py#L186-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036439", "code": "def as_alias_handler(alias_list):\n    \"\"\"Returns a list of all the names that will be called.\"\"\"\n    list_ = list()\n    for alias in alias_list:\n        if alias.asname:\n            list_.append(alias.asname)\n        else:\n            list_.append(alias.name)\n    return list_", "entry_point": "as_alias_handler", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-security/pyt/blob/efc0cfb716e40e0c8df4098f1cc8cf43723cd31f/pyt/cfg/alias_helper.py#L4-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036440", "code": "def retrieve_import_alias_mapping(names_list):\n    \"\"\"Creates a dictionary mapping aliases to their respective name.\n    import_alias_names is used in module_definitions.py and visit_Call\"\"\"\n    import_alias_names = dict()\n\n    for alias in names_list:\n        if alias.asname:\n            import_alias_names[alias.asname] = alias.name\n    return import_alias_names", "entry_point": "retrieve_import_alias_mapping", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-security/pyt/blob/efc0cfb716e40e0c8df4098f1cc8cf43723cd31f/pyt/cfg/alias_helper.py#L68-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036441", "code": "def fully_qualify_alias_labels(label, aliases):\n    \"\"\"Replace any aliases in label with the fully qualified name.\n\n    Args:\n        label -- A label : str representing a name (e.g. myos.system)\n        aliases -- A dict of {alias: real_name} (e.g. {'myos': 'os'})\n\n    >>> fully_qualify_alias_labels('myos.mycall', {'myos':'os'})\n    'os.mycall'\n    \"\"\"\n    for alias, full_name in aliases.items():\n        if label == alias:\n            return full_name\n        elif label.startswith(alias+'.'):\n            return full_name + label[len(alias):]\n    return label", "entry_point": "fully_qualify_alias_labels", "input": "-1.5, {}", "output": "-1.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-security/pyt/blob/efc0cfb716e40e0c8df4098f1cc8cf43723cd31f/pyt/cfg/alias_helper.py#L79-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036442", "code": "def _import_string(names):\n    \"\"\"return a list of (name, asname) formatted as a string\"\"\"\n    _names = []\n    for name, asname in names:\n        if asname is not None:\n            _names.append(\"%s as %s\" % (name, asname))\n        else:\n            _names.append(name)\n    return \", \".join(_names)", "entry_point": "_import_string", "input": "()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/astroid/blob/e0a298df55b15abcb77c2a93253f5ab7be52d0fb/astroid/as_string.py#L615-L623", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036443", "code": "def compat_string(value):\n        \"\"\"\n        Provide a python2/3 compatible string representation of the value\n        :type value:\n        :rtype :\n        \"\"\"\n        if isinstance(value, bytes):\n            return value.decode(encoding='utf-8')\n        return str(value)", "entry_point": "compat_string", "input": "[5, 3, 1, 4]", "output": "'[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cablehead/python-consul/blob/53eb41c4760b983aec878ef73e72c11e0af501bb/consul/twisted.py#L54-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036444", "code": "def _move_datetime(dt, direction, delta):\n    \"\"\"\n    Move datetime given delta by given direction\n    \"\"\"\n    if direction == 'next':\n        dt = dt + delta\n    elif direction == 'last':\n        dt = dt - delta\n    else:\n        pass\n        # raise some delorean error here\n    return dt", "entry_point": "_move_datetime", "input": "[5, 3, 1, 4], [-1, 0, 1, 2], ['apple', 'banana', 'cherry']", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/myusuf3/delorean/blob/3e8a7b8cfd4c26546f62bde2f34002893adfa08a/delorean/dates.py#L45-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036445", "code": "def is_value_in(constants_group, value):\n    \"\"\"\n    Checks whether value can be found in the given constants group, which in\n    turn, should be a Django-like choices tuple.\n    \"\"\"\n    for const_value, label in constants_group:\n        if const_value == value:\n            return True\n    return False", "entry_point": "is_value_in", "input": "[], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/base4sistemas/pyescpos/blob/621bd00f1499aff700f37d8d36d04e0d761708f1/escpos/helpers.py#L104-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036446", "code": "def _index_to_row_col(lines, index):\n    r\"\"\"\n    >>> lines = ['hello\\n', 'world\\n']\n    >>> _index_to_row_col(lines, 0)\n    (0, 0)\n    >>> _index_to_row_col(lines, 7)\n    (1, 1)\n    \"\"\"\n    if index < 0:\n        raise IndexError('negative index')\n    current_index = 0\n    for line_number, line in enumerate(lines):\n        line_length = len(line)\n        if current_index + line_length > index:\n            return line_number, index - current_index\n        current_index += line_length\n    raise IndexError('index %d out of range' % index)", "entry_point": "_index_to_row_col", "input": "'walnut thistle harbour', 1", "output": "(1, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/facebook/codemod/blob/78bb627792fc8a5253baa9cd9d8160533b16fd85/codemod/base.py#L197-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036447", "code": "def get_object_at(dictionary, path, attribute_name=None):\n    \"\"\"\n    Get arbitrary object given a dictionary and path (list of keys)\n\n    :param dictionary:\n    :param path:\n    :param attribute_name:\n    :return:\n    \"\"\"\n    o = dictionary\n    try:\n        for p in path:\n            o = o[p]\n        if attribute_name:\n            return o[attribute_name]\n        else:\n            return o\n    # failed to find attribute/key in dictionary\n    except Exception:\n        return {}", "entry_point": "get_object_at", "input": "{'x': [1, 2], 'y': []}, 'a,b,c', 'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nccgroup/Scout2/blob/5d86d46d7ed91a92000496189e9cfa6b98243937/AWSScout2/configs/browser.py#L33-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036448", "code": "def FilesBelongToSameModule(filename_cc, filename_h):\n  \"\"\"Check if these two filenames belong to the same module.\n\n  The concept of a 'module' here is a as follows:\n  foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the\n  same 'module' if they are in the same directory.\n  some/path/public/xyzzy and some/path/internal/xyzzy are also considered\n  to belong to the same module here.\n\n  If the filename_cc contains a longer path than the filename_h, for example,\n  '/absolute/path/to/base/sysinfo.cc', and this file would include\n  'base/sysinfo.h', this function also produces the prefix needed to open the\n  header. This is used by the caller of this function to more robustly open the\n  header file. We don't have access to the real include paths in this context,\n  so we need this guesswork here.\n\n  Known bugs: tools/base/bar.cc and base/bar.h belong to the same module\n  according to this implementation. Because of this, this function gives\n  some false positives. This should be sufficiently rare in practice.\n\n  Args:\n    filename_cc: is the path for the .cc file\n    filename_h: is the path for the header path\n\n  Returns:\n    Tuple with a bool and a string:\n    bool: True if filename_cc and filename_h belong to the same module.\n    string: the additional prefix needed to open the header file.\n  \"\"\"\n\n  if not filename_cc.endswith('.cc'):\n    return (False, '')\n  filename_cc = filename_cc[:-len('.cc')]\n  if filename_cc.endswith('_unittest'):\n    filename_cc = filename_cc[:-len('_unittest')]\n  elif filename_cc.endswith('_test'):\n    filename_cc = filename_cc[:-len('_test')]\n  filename_cc = filename_cc.replace('/public/', '/')\n  filename_cc = filename_cc.replace('/internal/', '/')\n\n  if not filename_h.endswith('.h'):\n    return (False, '')\n  filename_h = filename_h[:-len('.h')]\n  if filename_h.endswith('-inl'):\n    filename_h = filename_h[:-len('-inl')]\n  filename_h = filename_h.replace('/public/', '/')\n  filename_h = filename_h.replace('/internal/', '/')\n\n  files_belong_to_same_module = filename_cc.endswith(filename_h)\n  common_path = ''\n  if files_belong_to_same_module:\n    common_path = filename_cc[:-len(filename_h)]\n  return files_belong_to_same_module, common_path", "entry_point": "FilesBelongToSameModule", "input": "'abc', 'abc'", "output": "(False, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wesm/feather/blob/99267b30461c46b9e437f95e1d9338a92a854270/cpp/build-support/cpplint.py#L5522-L5574", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036449", "code": "def FinalSpin( Xi, eta ):\n    \"\"\"Computes the spin of the final BH that gets formed after merger. This is done usingn Eq 5-6 of arXiv:0710.3345\"\"\"\n    s4 = -0.129\n    s5 = -0.384\n    t0 = -2.686\n    t2 = -3.454\n    t3 = 2.353\n    etaXi = eta * Xi\n    eta2 = eta*eta\n    finspin = (Xi + s4*Xi*etaXi + s5*etaXi*eta + t0*etaXi + 2.*(3.**0.5)*eta + t2*eta2 + t3*eta2*eta)\n    if finspin > 1.0:\n        raise ValueError(\"Value of final spin > 1.0. Aborting\")\n    else:\n        return finspin", "entry_point": "FinalSpin", "input": "False, -1.5", "output": "-20.909027422706632", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/waveform/pycbc_phenomC_tmplt.py#L133-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036450", "code": "def boolargs_from_apprxstr(approximant_strs):\n    \"\"\"Parses a list of strings specifying an approximant and where that\n    approximant should be used into a list that can be understood by\n    FieldArray.parse_boolargs.\n\n    Parameters\n    ----------\n    apprxstr : (list of) string(s)\n        The strings to parse. Each string should be formatted `APPRX:COND`,\n        where `APPRX` is the approximant and `COND` is a string specifying\n        where it should be applied (see `FieldArgs.parse_boolargs` for examples\n        of conditional strings). The last string in the list may exclude a\n        conditional argument, which is the same as specifying ':else'.\n\n    Returns\n    -------\n    boolargs : list\n        A list of tuples giving the approximant and where to apply them. This\n        can be passed directly to `FieldArray.parse_boolargs`.\n    \"\"\"\n    if not isinstance(approximant_strs, list):\n        approximant_strs = [approximant_strs]\n    return [tuple(arg.split(':')) for arg in approximant_strs]", "entry_point": "boolargs_from_apprxstr", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/waveform/bank.py#L97-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036451", "code": "def drop_trailing_zeros(num):\n    \"\"\"\n    Drops the trailing zeros in a float that is printed.\n    \"\"\"\n    txt = '%f' %(num)\n    txt = txt.rstrip('0')\n    if txt.endswith('.'):\n        txt = txt[:-1]\n    return txt", "entry_point": "drop_trailing_zeros", "input": "7", "output": "'7'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/results/str_utils.py#L50-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036452", "code": "def _convert_liststring_to_list(lstring):\n    \"\"\"Checks if an argument of the configuration file is a string of a list\n    and returns the corresponding list (of strings).\n\n    The argument is considered to be a list if it starts with '[' and ends\n    with ']'. List elements should be comma separated. For example, passing\n    `'[foo bar, cat]'` will result in `['foo bar', 'cat']` being returned. If\n    the argument does not start and end with '[' and ']', the argument will\n    just be returned as is.\n    \"\"\"\n    if lstring[0]=='[' and lstring[-1]==']':\n        lstring = [str(lstring[1:-1].split(',')[n].strip().strip(\"'\"))\n                      for n in range(len(lstring[1:-1].split(',')))]\n    return lstring", "entry_point": "_convert_liststring_to_list", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/distributions/__init__.py#L86-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036453", "code": "def apply_transforms(samples, transforms, inverse=False):\n    \"\"\"Applies a list of BaseTransform instances on a mapping object.\n\n    Parameters\n    ----------\n    samples : {FieldArray, dict}\n        Mapping object to apply transforms to.\n    transforms : list\n        List of BaseTransform instances to apply. Nested transforms are assumed\n        to be in order for forward transforms.\n    inverse : bool, optional\n        Apply inverse transforms. In this case transforms will be applied in\n        the opposite order. Default is False.\n\n    Returns\n    -------\n    samples : {FieldArray, dict}\n        Mapping object with transforms applied. Same type as input.\n    \"\"\"\n    if inverse:\n        transforms = transforms[::-1]\n    for t in transforms:\n        try:\n            if inverse:\n                samples = t.inverse_transform(samples)\n            else:\n                samples = t.transform(samples)\n        except NotImplementedError:\n            continue\n    return samples", "entry_point": "apply_transforms", "input": "[1, 2, 3], [], ['a', 'b', 'c']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/transforms.py#L1592-L1621", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036454", "code": "def compute_jacobian(samples, transforms, inverse=False):\n    \"\"\"Computes the jacobian of the list of transforms at the given sample\n    points.\n\n    Parameters\n    ----------\n    samples : {FieldArray, dict}\n        Mapping object specifying points at which to compute jacobians.\n    transforms : list\n        List of BaseTransform instances to apply. Nested transforms are assumed\n        to be in order for forward transforms.\n    inverse : bool, optional\n        Compute inverse jacobians. Default is False.\n\n    Returns\n    -------\n    float :\n        The product of the jacobians of all fo the transforms.\n    \"\"\"\n    j = 1.\n    if inverse:\n        for t in transforms:\n            j *= t.inverse_jacobian(samples)\n    else:\n        for t in transforms:\n            j *= t.jacobian(samples)\n    return j", "entry_point": "compute_jacobian", "input": "[5, 3, 1, 4], [], [5, 3, 1, 4]", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/transforms.py#L1624-L1650", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036455", "code": "def order_transforms(transforms):\n    \"\"\"Orders transforms to ensure proper chaining.\n\n    For example, if `transforms = [B, A, C]`, and `A` produces outputs needed\n    by `B`, the transforms will be re-rorderd to `[A, B, C]`.\n\n    Parameters\n    ----------\n    transforms : list\n        List of transform instances to order.\n\n    Outputs\n    -------\n    list :\n        List of transformed ordered such that forward transforms can be carried\n        out without error.\n    \"\"\"\n    # get a set of all inputs and all outputs\n    outputs = set().union(*[t.outputs for t in transforms])\n    out = []\n    remaining = [t for t in transforms]\n    while remaining:\n        # pull out transforms that have no inputs in the set of outputs\n        leftover = []\n        for t in remaining:\n            if t.inputs.isdisjoint(outputs):\n                out.append(t)\n                outputs -= t.outputs\n            else:\n                leftover.append(t)\n        remaining = leftover\n    return out", "entry_point": "order_transforms", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/transforms.py#L1653-L1684", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036456", "code": "def ISSO_eq_at_pole(r, chi):\n    \"\"\"\n    Polynomial that enables the calculation of the Kerr polar\n    (inclination = +/- pi/2) innermost stable spherical orbit\n    (ISSO) radius via its roots.  Physical solutions are\n    between 6 and 1+sqrt[3]+sqrt[3+2sqrt[3]].\n\n    Parameters\n    -----------\n    r: float\n        the radial coordinate in BH mass units\n    chi: float\n        the BH dimensionless spin parameter\n\n    Returns\n    ----------\n    float\n        r**3*(r**2*(r-6)+chi**2*(3*r+4))+chi**4*(3*r*(r-2)+chi**2)\n    \"\"\"\n    return r**3*(r**2*(r-6)+chi**2*(3*r+4))+chi**4*(3*r*(r-2)+chi**2)", "entry_point": "ISSO_eq_at_pole", "input": "0, False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/tmpltbank/em_progenitors.py#L81-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036457", "code": "def formatreturn(arg, input_is_array=False):\n    \"\"\"If the given argument is a numpy array with shape (1,), just returns\n    that value.\"\"\"\n    if not input_is_array and arg.size == 1:\n        arg = arg.item()\n    return arg", "entry_point": "formatreturn", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/conversions.py#L75-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036458", "code": "def parse_cat_ini_opt(cat_str):\n    \"\"\" Parse a cat str from the ini file into a list of sets \"\"\"\n    if cat_str == \"\":\n        return []\n\n    cat_groups = cat_str.split(',')\n    cat_sets = []\n    for group in cat_groups:\n        group = group.strip()\n        cat_sets += [set(c for c in group)]\n    return cat_sets", "entry_point": "parse_cat_ini_opt", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/workflow/segment.py#L1287-L1297", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036459", "code": "def nacl_bindings_pick_scrypt_params(opslimit, memlimit):\n    \"\"\"Python implementation of libsodium's pickparams\"\"\"\n\n    if opslimit < 32768:\n        opslimit = 32768\n\n    r = 8\n\n    if opslimit < (memlimit // 32):\n        p = 1\n        maxn = opslimit // (4 * r)\n        for n_log2 in range(1, 63):  # pragma: no branch\n            if (2 ** n_log2) > (maxn // 2):\n                break\n    else:\n        maxn = memlimit // (r * 128)\n        for n_log2 in range(1, 63):  # pragma: no branch\n            if (2 ** n_log2) > maxn // 2:\n                break\n\n        maxrp = (opslimit // 4) // (2 ** n_log2)\n\n        if maxrp > 0x3fffffff:  # pragma: no cover\n            maxrp = 0x3fffffff\n\n        p = maxrp // r\n\n    return n_log2, r, p", "entry_point": "nacl_bindings_pick_scrypt_params", "input": "2, 5", "output": "(1, 8, 512)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyca/pynacl/blob/0df0c2c7693fa5d316846111ce510702756f5feb/src/nacl/bindings/crypto_pwhash.py#L182-L209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036460", "code": "def ensureUtf(s, encoding='utf8'):\n    \"\"\"Converts input to unicode if necessary.\n    If `s` is bytes, it will be decoded using the `encoding` parameters.\n    This function is used for preprocessing /source/ and /filename/ arguments\n    to the builtin function `compile`.\n    \"\"\"\n    # In Python2, str == bytes.\n    # In Python3, bytes remains unchanged, but str means unicode\n    # while unicode is not defined anymore\n    if type(s) == bytes:\n        return s.decode(encoding, 'ignore')\n    else:\n        return s", "entry_point": "ensureUtf", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gouthambs/Flask-Blogging/blob/6636b8941175e9910f116a329521f96b8b05a9ac/flask_blogging/utils.py#L1-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036461", "code": "def is_alias_command(subcommands, args):\n    \"\"\"\n    Check if the user is invoking one of the comments in 'subcommands' in the  from az alias .\n\n    Args:\n        subcommands: The list of subcommands to check through.\n        args: The CLI arguments to process.\n\n    Returns:\n        True if the user is invoking 'az alias {command}'.\n    \"\"\"\n    if not args:\n        return False\n\n    for subcommand in subcommands:\n        if args[:2] == ['alias', subcommand]:\n            return True\n\n    return False", "entry_point": "is_alias_command", "input": "[], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Azure/azure-cli-extensions/blob/3d4854205b0f0d882f688cfa12383d14506c2e35/src/alias/azext_alias/util.py#L47-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036462", "code": "def process_exception_message(exception):\n        \"\"\"\n        Process an exception message.\n\n        Args:\n            exception: The exception to process.\n\n        Returns:\n            A filtered string summarizing the exception.\n        \"\"\"\n        exception_message = str(exception)\n        for replace_char in ['\\t', '\\n', '\\\\n']:\n            exception_message = exception_message.replace(replace_char, '' if replace_char != '\\t' else ' ')\n        return exception_message.replace('section', 'alias')", "entry_point": "process_exception_message", "input": "[-1, 0, 1, 2]", "output": "'[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Azure/azure-cli-extensions/blob/3d4854205b0f0d882f688cfa12383d14506c2e35/src/alias/azext_alias/alias.py#L286-L299", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036463", "code": "def sentence_position(i, size):\n    \"\"\"different sentence positions indicate different\n    probability of being an important sentence\"\"\"\n\n    normalized = i*1.0 / size\n    if 0 < normalized <= 0.1:\n        return 0.17\n    elif 0.1 < normalized <= 0.2:\n        return 0.23\n    elif 0.2 < normalized <= 0.3:\n        return 0.14\n    elif 0.3 < normalized <= 0.4:\n        return 0.08\n    elif 0.4 < normalized <= 0.5:\n        return 0.05\n    elif 0.5 < normalized <= 0.6:\n        return 0.04\n    elif 0.6 < normalized <= 0.7:\n        return 0.06\n    elif 0.7 < normalized <= 0.8:\n        return 0.04\n    elif 0.8 < normalized <= 0.9:\n        return 0.04\n    elif 0.9 < normalized <= 1.0:\n        return 0.15\n    else:\n        return 0", "entry_point": "sentence_position", "input": "1, 3.25", "output": "0.08", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/xiaoxu193/PyTeaser/blob/bcbcae3586cb658d9954f440d15419a4683b48b6/pyteaser.py#L232-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036464", "code": "def format_log_context(msg, connection=None, keyspace=None):\n    \"\"\"Format log message to add keyspace and connection context\"\"\"\n    connection_info = connection or 'DEFAULT_CONNECTION'\n\n    if keyspace:\n        msg = '[Connection: {0}, Keyspace: {1}] {2}'.format(connection_info, keyspace, msg)\n    else:\n        msg = '[Connection: {0}] {1}'.format(connection_info, msg)\n    return msg", "entry_point": "format_log_context", "input": "'AbC dEf', [5, 3, 1, 4], []", "output": "'[Connection: [5, 3, 1, 4]] AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datastax/python-driver/blob/30a80d0b798b1f45f8cb77163b1fa791f3e3ca29/cassandra/cqlengine/connection.py#L44-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036465", "code": "def list_remove_by_index(l, index):\n    '''\u5c06list\u4e2d\u7684index\u4f4d\u7684\u6570\u636e\u5220\u9664'''\n    if index < 0 or index >= len(l):\n        raise ValueError('index out of range')\n    if index == (len(l) - 1):\n        l.pop()\n    elif index == 0:\n        l = l[1:]\n    else:\n        l = l[0:index] + l[index+1:]\n\n    return l", "entry_point": "list_remove_by_index", "input": "['a', 'b', 'c'], 1", "output": "['a', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/XuShaohua/bcloud/blob/4b54e0fdccf2b3013285fef05c97354cfa31697b/bcloud/util.py#L113-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036466", "code": "def is_data_homogenous(data_container):\n    \"\"\"\n    Checks that all of the data in the container are of the same Python data\n    type. This function is called in every other function below, and as such\n    need not necessarily be called.\n\n    :param data_container: A generic container of data points.\n    :type data_container: `iterable`\n    \"\"\"\n    data_types = set([type(i) for i in data_container])\n    return len(data_types) == 1", "entry_point": "is_data_homogenous", "input": "[5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ericmjl/nxviz/blob/6ea5823a8030a686f165fbe37d7a04d0f037ecc9/nxviz/utils.py#L9-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036467", "code": "def text_alignment(x, y):\n    \"\"\"\n    Align text labels based on the x- and y-axis coordinate values.\n\n    This function is used for computing the appropriate alignment of the text\n    label.\n\n    For example, if the text is on the \"right\" side of the plot, we want it to\n    be left-aligned. If the text is on the \"top\" side of the plot, we want it\n    to be bottom-aligned.\n\n    :param x, y: (`int` or `float`) x- and y-axis coordinate respectively.\n    :returns: A 2-tuple of strings, the horizontal and vertical alignments\n        respectively.\n    \"\"\"\n    if x == 0:\n        ha = \"center\"\n    elif x > 0:\n        ha = \"left\"\n    else:\n        ha = \"right\"\n    if y == 0:\n        va = \"center\"\n    elif y > 0:\n        va = \"bottom\"\n    else:\n        va = \"top\"\n\n    return ha, va", "entry_point": "text_alignment", "input": "False, -3", "output": "('center', 'top')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ericmjl/nxviz/blob/6ea5823a8030a686f165fbe37d7a04d0f037ecc9/nxviz/geometry.py#L41-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036468", "code": "def mix_wave(src, dst):\n    \"\"\"Mix two wave body into one.\"\"\"\n    if len(src) > len(dst):\n        # output should be longer\n        dst, src = src, dst\n\n    for i, sv in enumerate(src):\n        dv = dst[i]\n        if sv < 128 and dv < 128:\n            dst[i] = int(sv * dv / 128)\n        else:\n            dst[i] = int(2 * (sv + dv) - sv * dv / 128 - 256)\n    return dst", "entry_point": "mix_wave", "input": "[], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lepture/captcha/blob/fb6238e741c7e264eba117b27fa911c25c76c527/captcha/audio.py#L124-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036469", "code": "def split_group(source, pos, maxline):\n    \"\"\" Split a group into two subgroups.  The\n        first will be appended to the current\n        line, the second will start the new line.\n\n        Note that the first group must always\n        contain at least one item.\n\n        The original group may be destroyed.\n    \"\"\"\n    first = []\n    source.reverse()\n    while source:\n        tok = source.pop()\n        first.append(tok)\n        pos += len(tok)\n        if source:\n            tok = source[-1]\n            allowed = (maxline + 1) if tok.endswith(' ') else (maxline - 4)\n            if pos + len(tok) > allowed:\n                break\n\n    source.reverse()\n    return first, source", "entry_point": "split_group", "input": "[], [1, 2, 3], ''", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/berkerpeksag/astor/blob/d9e893eb49d9eb2e30779680f90cd632c30e0ba1/astor/source_repr.py#L146-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036470", "code": "def get_pil_mode(value, alpha=False):\n    \"\"\"Get PIL mode from ColorMode.\"\"\"\n    name = {\n        'GRAYSCALE': 'L',\n        'BITMAP': '1',\n        'DUOTONE': 'L',\n        'INDEXED': 'P',\n    }.get(value, value)\n    if alpha and name in ('L', 'RGB'):\n        name += 'A'\n    return name", "entry_point": "get_pil_mode", "input": "'walnut thistle harbour', ()", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/psd-tools/psd-tools/blob/4952b57bcf1cf2c1f16fd9d6d51d4fa0b53bce4e/src/psd_tools/api/pil_io.py#L22-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036471", "code": "def moveListItem(L, fromidx, toidx):\n    \"Move element within list `L` and return element's new index.\"\n    r = L.pop(fromidx)\n    L.insert(toidx, r)\n    return toidx", "entry_point": "moveListItem", "input": "[1, 2, 3], 2, 1", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saulpw/visidata/blob/32771e0cea6c24fc7902683d14558391395c591f/visidata/utils.py#L7-L11", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036472", "code": "def _localize_df(schema_fields, df):\n    \"\"\"Localize any TIMESTAMP columns to tz-aware type.\n\n    In pandas versions before 0.24.0, DatetimeTZDtype cannot be used as the\n    dtype in Series/DataFrame construction, so localize those columns after\n    the DataFrame is constructed.\n    \"\"\"\n    for field in schema_fields:\n        column = str(field[\"name\"])\n        if field[\"mode\"].upper() == \"REPEATED\":\n            continue\n\n        if field[\"type\"].upper() == \"TIMESTAMP\" and df[column].dt.tz is None:\n            df[column] = df[column].dt.tz_localize(\"UTC\")\n\n    return df", "entry_point": "_localize_df", "input": "set(), True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pydata/pandas-gbq/blob/e590317b3325939ede7563f49aa6b163bb803b77/pandas_gbq/gbq.py#L725-L740", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036473", "code": "def bbox_horz_aligned(box1, box2):\n    \"\"\"\n    Returns true if the vertical center point of either span is within the\n    vertical range of the other\n    \"\"\"\n    if not (box1 and box2):\n        return False\n    # NEW: any overlap counts\n    #    return box1.top <= box2.bottom and box2.top <= box1.bottom\n    box1_top = box1.top + 1.5\n    box2_top = box2.top + 1.5\n    box1_bottom = box1.bottom - 1.5\n    box2_bottom = box2.bottom - 1.5\n    return not (box1_top > box2_bottom or box2_top > box1_bottom)", "entry_point": "bbox_horz_aligned", "input": "[-1, 0, 1, 2], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/fonduer/blob/4520f86a716f03dcca458a9f4bddac75b4e7068f/src/fonduer/utils/utils_visual.py#L36-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036474", "code": "def bbox_vert_aligned(box1, box2):\n    \"\"\"\n    Returns true if the horizontal center point of either span is within the\n    horizontal range of the other\n    \"\"\"\n    if not (box1 and box2):\n        return False\n    # NEW: any overlap counts\n    #    return box1.left <= box2.right and box2.left <= box1.right\n    box1_left = box1.left + 1.5\n    box2_left = box2.left + 1.5\n    box1_right = box1.right - 1.5\n    box2_right = box2.right - 1.5\n    return not (box1_left > box2_right or box2_left > box1_right)", "entry_point": "bbox_vert_aligned", "input": "[1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/fonduer/blob/4520f86a716f03dcca458a9f4bddac75b4e7068f/src/fonduer/utils/utils_visual.py#L59-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036475", "code": "def bbox_vert_aligned_left(box1, box2):\n    \"\"\"\n    Returns true if the left boundary of both boxes is within 2 pts\n    \"\"\"\n    if not (box1 and box2):\n        return False\n    return abs(box1.left - box2.left) <= 2", "entry_point": "bbox_vert_aligned_left", "input": "[], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/fonduer/blob/4520f86a716f03dcca458a9f4bddac75b4e7068f/src/fonduer/utils/utils_visual.py#L79-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036476", "code": "def bbox_vert_aligned_right(box1, box2):\n    \"\"\"\n    Returns true if the right boundary of both boxes is within 2 pts\n    \"\"\"\n    if not (box1 and box2):\n        return False\n    return abs(box1.right - box2.right) <= 2", "entry_point": "bbox_vert_aligned_right", "input": "['apple', 'banana', 'cherry'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/fonduer/blob/4520f86a716f03dcca458a9f4bddac75b4e7068f/src/fonduer/utils/utils_visual.py#L88-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036477", "code": "def bbox_vert_aligned_center(box1, box2):\n    \"\"\"\n    Returns true if the center of both boxes is within 5 pts\n    \"\"\"\n    if not (box1 and box2):\n        return False\n    return abs(((box1.right + box1.left) / 2.0) - ((box2.right + box2.left) / 2.0)) <= 5", "entry_point": "bbox_vert_aligned_center", "input": "(), ()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HazyResearch/fonduer/blob/4520f86a716f03dcca458a9f4bddac75b4e7068f/src/fonduer/utils/utils_visual.py#L97-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036478", "code": "def pad_chunk_columns(chunk):\n    \"\"\"Given a set of items to be inserted, make sure they all have the\n    same columns by padding columns with None if they are missing.\"\"\"\n    columns = set()\n    for record in chunk:\n        columns.update(record.keys())\n    for record in chunk:\n        for column in columns:\n            record.setdefault(column, None)\n    return chunk", "entry_point": "pad_chunk_columns", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pudo/dataset/blob/a008d120c7f3c48ccba98a282c0c67d6e719c0e5/dataset/util.py#L111-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036479", "code": "def _convert_number_to_subscript(num):\n        \"\"\"\n        Converts number into subscript\n\n        input = [\"a\", \"a1\", \"a2\", \"a3\", \"be2\", \"be3\", \"bad2\", \"bad3\"]\n        output = [\"a\", \"a\u2081\", \"a\u2082\", \"a\u2083\", \"be\u2082\", \"be\u2083\", \"bad\u2082\", \"bad\u2083\"]\n\n        :param num: number called after sign\n        :return: number in subscript\n        \"\"\"\n        subscript = ''\n        for character in str(num):\n            subscript += chr(0x2080 + int(character))\n        return subscript", "entry_point": "_convert_number_to_subscript", "input": "7", "output": "'\u2087'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/stem/akkadian/atf_converter.py#L66-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036480", "code": "def Levenshtein_Distance(w1, w2):\n        \"\"\"\n        Computes Levenshtein Distance between two words\n\n        Args:\n            :param w1: str\n            :param w2: str\n            :return: int\n\n        Examples:\n\n            >>> Levenshtein.Levenshtein_Distance('noctis', 'noctem')\n            2\n\n            >>> Levenshtein.Levenshtein_Distance('nox', 'nochem')\n            4\n\n            >>> Levenshtein.Levenshtein_Distance('orbis', 'robis')\n            2\n        \"\"\"\n        m, n = len(w1), len(w2)\n        v1 = [i for i in range(n + 1)]\n        v2 = [0 for i in range(n + 1)]\n\n        for i in range(m):\n            v2[0] = i + 1\n\n            for j in range(n):\n                delCost = v1[j + 1] + 1\n                insCost = v2[j] + 1\n\n                subCost = v1[j]\n                if w1[i] != w2[j]: subCost += 1\n\n                v2[j + 1] = min(delCost, insCost, subCost)\n            v1, v2 = v2, v1\n\n        return v1[-1]", "entry_point": "Levenshtein_Distance", "input": "[], [5, 3, 1, 4]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/text_reuse/levenshtein.py#L16-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036481", "code": "def Damerau_Levenshtein_Distance(w1, w2):\n        \"\"\"\n        Computes Damerau-Levenshtein Distance between two words\n\n        Args:\n            :param w1: str\n            :param w2: str\n            :return int:\n\n        Examples:\n            For the most part, Damerau-Levenshtein behaves\n            identically to Levenshtein:\n\n            >>> Levenshtein.Damerau_Levenshtein_Distance('noctis', 'noctem')\n            2\n\n            >>> Levenshtein.Levenshtein_Distance('nox', 'nochem')\n            4\n\n            The strength of DL lies in detecting transposition of characters:\n\n            >>> Levenshtein.Damerau_Levenshtein_Distance('orbis', 'robis')\n            1\n\n        \"\"\"\n        # Define alphabet\n        alph = sorted(list(set(w1 + w2)))\n        # Calculate alphabet size\n        alph_s = len(alph)\n        dam_ar = [0 for _ in range(alph_s)]\n        mat = [[0 for _ in range(len(w2) + 2)] for _ in range(len(w1) + 2)]\n\n        max_dist = len(w1) + len(w2)\n        mat[0][0] = max_dist\n\n        # Initialize matrix margin to the maximum possible distance (essentially inf) for ease of calculations (avoiding try blocks)\n\n        for i in range(1, len(w1) + 2):\n            mat[i][0] = max_dist\n            mat[i][1] = i - 1\n\n        for i in range(1, len(w2) + 2):\n            mat[0][i] = max_dist\n            mat[1][i] = i - 1\n\n        for i in range(2, len(w1) + 2):\n            tem = 0\n\n            for j in range(2, len(w2) + 2):\n\n                k = dam_ar[alph.index(w2[j - 2])]\n                l = tem\n\n                if w1[i - 2] == w2[j - 2]:\n                    cost = 0\n                    tem = j\n                else:\n                    cost = 1\n\n                # The reccurence relation of DL is identical to that of Levenshtein with the addition of transposition\n                mat[i][j] = min(mat[i - 1][j - 1] + cost, mat[i][j - 1] + 1, mat[i - 1][j] + 1,\n                                mat[k - 1][l - 1] + i + j - k - l - 1)\n\n            dam_ar[alph.index(w1[i - 2])] = i\n\n        return mat[-1][-1]", "entry_point": "Damerau_Levenshtein_Distance", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/text_reuse/levenshtein.py#L56-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036482", "code": "def make_worlist_trie(wordlist):\n    \"\"\"\n    Creates a nested dictionary representing the trie created\n    by the given word list.\n\n    :param wordlist: str list:\n    :return: nested dictionary\n\n    >>> make_worlist_trie(['einander', 'einen', 'neben'])\n    {'e': {'i': {'n': {'a': {'n': {'d': {'e': {'r': {'__end__': '__end__'}}}}}, 'e': {'n': {'__end__': '__end__'}}}}}, 'n': {'e': {'b': {'e': {'n': {'__end__': '__end__'}}}}}}\n\n    \"\"\"\n    dicts = dict()\n\n    for w in wordlist:\n        curr = dicts\n        for l in w:\n            curr = curr.setdefault(l, {})\n        curr['__end__'] = '__end__'\n\n    return dicts", "entry_point": "make_worlist_trie", "input": "['a', 'b', 'c']", "output": "{'a': {'__end__': '__end__'}, 'b': {'__end__': '__end__'}, 'c': {'__end__': '__end__'}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/text_reuse/automata.py#L592-L612", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036483", "code": "def long_substring(str_a, str_b):\n    \"\"\"\n    Looks for a longest common string between any two given strings passed\n    :param str_a: str\n    :param str_b: str\n\n    Big Thanks to Pulkit Kathuria(@kevincobain2000) for the function\n    The function is derived from jProcessing toolkit suite\n    \"\"\"\n    data = [str_a, str_b]\n    substr = ''\n    if len(data) > 1 and len(data[0]) > 0:\n        for i in range(len(data[0])):\n            for j in range(len(data[0])-i+1):\n                if j > len(substr) and all(data[0][i:i+j] in x for x in data):\n                    substr = data[0][i:i+j]\n    return substr.strip()", "entry_point": "long_substring", "input": "[-1, 0, 1, 2], ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/text_reuse/comparison.py#L105-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036484", "code": "def apply_raw_r_assimilation(last_syllable: str) -> str:\n    \"\"\"\n    -r preceded by an -s-, -l- or -n- becomes respectively en -s, -l or -n.\n\n    >>> apply_raw_r_assimilation(\"arm\")\n    'armr'\n    >>> apply_raw_r_assimilation(\"\u00e1s\")\n    '\u00e1ss'\n    >>> apply_raw_r_assimilation(\"st\u00f3l\")\n    'st\u00f3ll'\n    >>> apply_raw_r_assimilation(\"stein\")\n    'steinn'\n    >>> apply_raw_r_assimilation(\"vin\")\n    'vinn'\n\n\n    :param last_syllable: last syllable of an Old Norse word\n    :return:\n    \"\"\"\n\n    if len(last_syllable) > 0:\n        if last_syllable[-1] == \"l\":\n            return last_syllable + \"l\"\n        elif last_syllable[-1] == \"s\":\n            return last_syllable + \"s\"\n        elif last_syllable[-1] == \"n\":\n            return last_syllable + \"n\"\n    return last_syllable + \"r\"", "entry_point": "apply_raw_r_assimilation", "input": "'abc'", "output": "'abcr'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/inflection/old_norse/phonemic_rules.py#L92-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036485", "code": "def tokenize_akkadian_signs(word):\n    \"\"\"\n    Takes tuple (word, language) and splits the word up into individual\n    sign tuples (sign, language) in a list.\n\n    input: (\"{gisz}isz-pur-ram\", \"akkadian\")\n    output: [(\"gisz\", \"determinative\"), (\"isz\", \"akkadian\"),\n    (\"pur\", \"akkadian\"), (\"ram\", \"akkadian\")]\n\n    :param: tuple created by word_tokenizer2\n    :return: list of tuples: (sign, function or language)\n    \"\"\"\n    word_signs = []\n    sign = ''\n    language = word[1]\n    determinative = False\n    for char in word[0]:\n        if determinative is True:\n            if char == '}':\n                determinative = False\n                if len(sign) > 0:  # pylint: disable=len-as-condition\n                    word_signs.append((sign, 'determinative'))\n                sign = ''\n                language = word[1]\n                continue\n            else:\n                sign += char\n                continue\n        else:\n            if language == 'akkadian':\n                if char == '{':\n                    if len(sign) > 0:  # pylint: disable=len-as-condition\n                        word_signs.append((sign, language))\n                    sign = ''\n                    determinative = True\n                    continue\n                elif char == '_':\n                    if len(sign) > 0:  # pylint: disable=len-as-condition\n                        word_signs.append((sign, language))\n                    sign = ''\n                    language = 'sumerian'\n                    continue\n                elif char == '-':\n                    if len(sign) > 0:  # pylint: disable=len-as-condition\n                        word_signs.append((sign, language))\n                    sign = ''\n                    language = word[1] # or default word[1]?\n                    continue\n                else:\n                    sign += char\n            elif language == 'sumerian':\n                if char == '{':\n                    if len(sign) > 0:  # pylint: disable=len-as-condition\n                        word_signs.append((sign, language))\n                    sign = ''\n                    determinative = True\n                    continue\n                elif char == '_':\n                    if len(sign) > 0:  # pylint: disable=len-as-condition\n                        word_signs.append((sign, language))\n                    sign = ''\n                    language = word[1]\n                    continue\n                elif char == '-':\n                    if len(sign) > 0:  # pylint: disable=len-as-condition\n                        word_signs.append((sign, language))\n                    sign = ''\n                    language = word[1]\n                    continue\n                else:\n                    sign += char\n    if len(sign) > 0:\n        word_signs.append((sign, language))\n\n    return word_signs", "entry_point": "tokenize_akkadian_signs", "input": "'  padded  '", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/tokenize/word.py#L158-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036486", "code": "def drop_edge_punct(word: str) -> str:\n    \"\"\"\n    Remove edge punctuation.\n    :param word: a single string\n    >>> drop_edge_punct(\"'fieri\")\n    'fieri'\n    >>> drop_edge_punct('sedes.')\n    'sedes'\n    \"\"\"\n    if not word:\n        return word\n    try:\n        if not word[0].isalpha():\n            word = word[1:]\n        if not word[-1].isalpha():\n            word = word[:-1]\n    except:\n        pass\n    return word", "entry_point": "drop_edge_punct", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/utils/matrix_corpus_fun.py#L159-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036487", "code": "def remove_non_ascii(input_string):\n    \"\"\"Remove non-ascii characters\n    Source: http://stackoverflow.com/a/1342373\n    \"\"\"\n    no_ascii = \"\".join(i for i in input_string if ord(i) < 128)\n    return no_ascii", "entry_point": "remove_non_ascii", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/corpus/utils/formatter.py#L61-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036488", "code": "def remove_non_latin(input_string, also_keep=None):\n    \"\"\"Remove non-Latin characters.\n    `also_keep` should be a list which will add chars (e.g. punctuation)\n    that will not be filtered.\n    \"\"\"\n    if also_keep:\n        also_keep += [' ']\n    else:\n        also_keep = [' ']\n    latin_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n    latin_chars += latin_chars.lower()\n    latin_chars += ''.join(also_keep)\n    no_latin = \"\".join([char for char in input_string if char in latin_chars])\n    return no_latin", "entry_point": "remove_non_latin", "input": "'walnut thistle harbour', ['apple', 'banana', 'cherry']", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/corpus/utils/formatter.py#L69-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036489", "code": "def isolate(obj):\n        \"\"\"Feed a standard semantic object in and receive a simple list of\n        lemmata\n        \"\"\"\n        answers = []\n        for token in obj:\n            lemmata = token[1]\n            for pair in lemmata:\n                answers.append(pair[0])\n        return answers", "entry_point": "isolate", "input": "['apple', 'banana', 'cherry']", "output": "['p', 'a', 'h']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/semantics/latin/lookup.py#L82-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036490", "code": "def is_fornyrdhislag(text: str):\n        \"\"\"\n        Basic check, only the number of lines matters: 8 for fornyr\u00f0islag.\n\n        >>> text1 = \"Hlj\u00f3\u00f0s bi\u00f0 ek allar\\\\nhelgar kindir,\\\\nmeiri ok minni\\\\nm\u00f6gu Heimdallar;\\\\nviltu at ek, Valf\u00f6\u00f0r,\\\\nvel fyr telja\\\\nforn spj\u00f6ll fira,\\\\n\u00feau er fremst of man.\"\n        >>> text2 = \"Deyr f\u00e9,\\\\ndeyja fr\u00e6ndr,\\\\ndeyr sjalfr it sama,\\\\nek veit einn,\\\\nat aldrei deyr:\\\\nd\u00f3mr um dau\u00f0an hvern.\"\n        >>> MetreManager.is_fornyrdhislag(text1)\n        True\n        >>> MetreManager.is_fornyrdhislag(text2)\n        False\n\n        :param text:\n        :return:\n        \"\"\"\n        lines = [line for line in text.split(\"\\n\") if line]\n        return len(lines) == 8", "entry_point": "is_fornyrdhislag", "input": "'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/prosody/old_norse/verse.py#L38-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036491", "code": "def is_ljoodhhaattr(text: str):\n        \"\"\"\n        Basic check, only the number of lines matters: 6 for lj\u00f3\u00f0ah\u00e1ttr\n\n        >>> text1 = \"Hlj\u00f3\u00f0s bi\u00f0 ek allar\\\\nhelgar kindir,\\\\nmeiri ok minni\\\\nm\u00f6gu Heimdallar;\\\\nviltu at ek, Valf\u00f6\u00f0r,\\\\nvel fyr telja\\\\nforn spj\u00f6ll fira,\\\\n\u00feau er fremst of man.\"\n        >>> text2 = \"Deyr f\u00e9,\\\\ndeyja fr\u00e6ndr,\\\\ndeyr sjalfr it sama,\\\\nek veit einn,\\\\nat aldrei deyr:\\\\nd\u00f3mr um dau\u00f0an hvern.\"\n        >>> MetreManager.is_ljoodhhaattr(text1)\n        False\n        >>> MetreManager.is_ljoodhhaattr(text2)\n        True\n\n        :param text:\n        :return:\n        \"\"\"\n        lines = [line for line in text.split(\"\\n\") if line]\n        return len(lines) == 6", "entry_point": "is_ljoodhhaattr", "input": "'walnut thistle harbour'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/prosody/old_norse/verse.py#L56-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036492", "code": "def to_int16(y1, y2):\n    \"\"\"Convert two 8 bit bytes to a signed 16 bit integer.\"\"\"\n    x = (y1) | (y2 << 8)\n    if x >= 32768:\n        x = -(65536 - x)\n    return x", "entry_point": "to_int16", "input": "False, 3", "output": "768", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/StanfordVL/robosuite/blob/65cd16810e2ed647e3ec88746af3412065b7f278/robosuite/devices/spacemouse.py#L45-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036493", "code": "def unsurt(surt):\n    \"\"\"\n    # Simple surt\n    >>> unsurt('com,example)/')\n    'example.com/'\n\n    # Broken surt\n    >>> unsurt('com,example)')\n    'com,example)'\n\n    # Long surt\n    >>> unsurt('suffix,domain,sub,subsub,another,subdomain)/path/file/\\\nindex.html?a=b?c=)/')\n    'subdomain.another.subsub.sub.domain.suffix/path/file/index.html?a=b?c=)/'\n    \"\"\"\n\n    try:\n        index = surt.index(')/')\n        parts = surt[0:index].split(',')\n        parts.reverse()\n        host = '.'.join(parts)\n        host += surt[index + 1:]\n        return host\n\n    except ValueError:\n        # May not be a valid surt\n        return surt", "entry_point": "unsurt", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/webrecorder/pywb/blob/77f8bb647639dd66f6b92b7a9174c28810e4b1d9/pywb/utils/canonicalize.py#L58-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036494", "code": "def find_range(coeffs):\n    '''\n    Find the range in a list of coefficients where the coefficient is nonzero\n    '''\n\n    coeffs = [float(x) != 0 for x in coeffs]\n    first = coeffs.index(True)\n    coeffs.reverse()\n    last = len(coeffs) - coeffs.index(True) - 1\n    return first, last", "entry_point": "find_range", "input": "[1, 2, 3]", "output": "(0, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MolSSI-BSE/basis_set_exchange/blob/e79110aaeb65f392ed5032420322dee3336948f7/basis_set_exchange/converters/common.py#L6-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036495", "code": "def format_columns(lines, prefix=''):\n    '''\n    Create a simple column output\n\n    Parameters\n    ----------\n    lines : list\n        List of lines to format. Each line is a tuple/list with each\n        element corresponding to a column\n    prefix : str\n        Characters to insert at the beginning of each line\n\n    Returns\n    -------\n    str\n        Columnated output as one big string\n    '''\n    if len(lines) == 0:\n        return ''\n\n    ncols = 0\n    for l in lines:\n        ncols = max(ncols, len(l))\n\n    if ncols == 0:\n        return ''\n\n    # We only find the max strlen for all but the last col\n    maxlen = [0] * (ncols - 1)\n    for l in lines:\n        for c in range(ncols - 1):\n            maxlen[c] = max(maxlen[c], len(l[c]))\n\n    fmtstr = prefix + '  '.join(['{{:{x}}}'.format(x=x) for x in maxlen])\n    fmtstr += '  {}'\n    return [fmtstr.format(*l) for l in lines]", "entry_point": "format_columns", "input": "'abc', '  padded  '", "output": "['  padded    a', '  padded    b', '  padded    c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MolSSI-BSE/basis_set_exchange/blob/e79110aaeb65f392ed5032420322dee3336948f7/basis_set_exchange/cli/common.py#L5-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036496", "code": "def _reldiff(a, b):\n    \"\"\"\n    Computes the relative difference of two floating-point numbers\n\n    rel = abs(a-b)/min(abs(a), abs(b))\n\n    If a == 0 and b == 0, then 0.0 is returned\n    Otherwise if a or b is 0.0, inf is returned.\n    \"\"\"\n\n    a = float(a)\n    b = float(b)\n    aa = abs(a)\n    ba = abs(b)\n\n    if a == 0.0 and b == 0.0:\n        return 0.0\n    elif a == 0 or b == 0.0:\n        return float('inf')\n\n    return abs(a - b) / min(aa, ba)", "entry_point": "_reldiff", "input": "5, 1", "output": "4.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MolSSI-BSE/basis_set_exchange/blob/e79110aaeb65f392ed5032420322dee3336948f7/basis_set_exchange/curate/compare.py#L9-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036497", "code": "def detect_regressions(steps, threshold=0):\n    \"\"\"Detect regressions in a (noisy) signal.\n\n    A regression means an upward step in the signal.  The value\n    'before' a regression is the value immediately preceding the\n    upward step.  The value 'after' a regression is the minimum of\n    values after the upward step.\n\n    Parameters\n    ----------\n    steps : list of (left, right, value, min, error)\n        List of steps computed by detect_steps, or equivalent\n    threshold : float\n        Relative threshold for reporting regressions. Filter out jumps\n        whose relative size is smaller than threshold, if they are not\n        necessary to explain the difference between the best and the latest\n        values.\n\n    Returns\n    -------\n    latest_value\n        Latest value\n    best_value\n        Best value\n    regression_pos : list of (before, after, value_before, value_after)\n        List of positions between which the value increased. The first item\n        corresponds to the last position at which the best value was obtained.\n\n    \"\"\"\n    if not steps:\n        # No data: no regressions\n        return None, None, None\n\n    regression_pos = []\n\n    last_v = steps[-1][2]\n    best_v = last_v\n    best_err = steps[-1][4]\n    prev_l = None\n\n    # Find upward steps that resulted to worsened value afterward\n    for l, r, cur_v, cur_min, cur_err in reversed(steps):\n        if best_v - cur_v > max(cur_err, best_err, threshold * cur_v):\n            regression_pos.append((r - 1, prev_l, cur_v, best_v))\n        prev_l = l\n        if cur_v < best_v:\n            best_v = cur_v\n            best_err = cur_err\n\n    regression_pos.reverse()\n\n    # Return results\n    if regression_pos:\n        return (last_v, best_v, regression_pos)\n    else:\n        return (None, None, None)", "entry_point": "detect_regressions", "input": "[], 0.5", "output": "(None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/step_detect.py#L441-L496", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036498", "code": "def median(items):\n    \"\"\"Note: modifies the input list!\"\"\"\n    items.sort()\n    k = len(items)//2\n    if len(items) % 2 == 0:\n        return (items[k] + items[k - 1]) / 2\n    else:\n        return items[k]", "entry_point": "median", "input": "[1, 2, 3]", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/step_detect.py#L885-L892", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036499", "code": "def weighted_median(y, w):\n    \"\"\"\n    Compute weighted median of `y` with weights `w`.\n    \"\"\"\n    items = sorted(zip(y, w))\n    midpoint = sum(w) / 2\n\n    yvals = []\n    wsum = 0\n\n    for yy, ww in items:\n        wsum += ww\n        if wsum > midpoint:\n            yvals.append(yy)\n            break\n        elif wsum == midpoint:\n            yvals.append(yy)\n    else:\n        yvals = y\n\n    return sum(yvals) / len(yvals)", "entry_point": "weighted_median", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/step_detect.py#L933-L953", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036500", "code": "def _issubclass(sub, sup):\n    '''Safe issubclass().\n    '''\n    if sup is not object:\n        try:\n            return issubclass(sub, sup)\n        except TypeError:\n            pass\n    return False", "entry_point": "_issubclass", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/extern/asizeof.py#L410-L418", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036501", "code": "def _p100(part, total, prec=1):\n    '''Return percentage as string.\n    '''\n    r = float(total)\n    if r:\n        r = part * 100.0 / r\n        return '%.*f%%' % (prec, r)\n    return 'n/a'", "entry_point": "_p100", "input": "{1, 2, 3}, False, {1, 2, 3}", "output": "'n/a'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/extern/asizeof.py#L465-L472", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036502", "code": "def _repr(obj, clip=80):\n    '''Clip long repr() string.\n    '''\n    try:  # safe repr()\n        r = repr(obj)\n    except TypeError:\n        r = 'N/A'\n    if 0 < clip < len(r):\n        h = (clip // 2) - 2\n        if h > 0:\n            r = r[:h] + '....' + r[-h:]\n    return r", "entry_point": "_repr", "input": "-1.5, True", "output": "'-1.5'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/extern/asizeof.py#L529-L540", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036503", "code": "def _SI(size, K=1024, i='i'):\n    '''Return size as SI string.\n    '''\n    if 1 < K < size:\n        f = float(size)\n        for si in iter('KMGPTE'):\n            f /= K\n            if f < K:\n                return ' or %.1f %s%sB' % (f, si, i)\n    return ''", "entry_point": "_SI", "input": "[1, 2, 3], True, True", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/extern/asizeof.py#L542-L551", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036504", "code": "def _len_list(obj):\n    '''Length of list (estimate).\n    '''\n    n = len(obj)\n     # estimate over-allocation\n    if n > 8:\n       n += 6 + (n >> 3)\n    elif n:\n       n += 4\n    return n", "entry_point": "_len_list", "input": "['apple', 'banana', 'cherry']", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/extern/asizeof.py#L762-L771", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036505", "code": "def _len_slice(obj):\n    '''Slice length.\n    '''\n    try:\n        return ((obj.stop - obj.start + 1) // obj.step)\n    except (AttributeError, TypeError):\n        return 0", "entry_point": "_len_slice", "input": "[5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/airspeed-velocity/asv/blob/d23bb8b74e8adacbfa3cf5724bda55fb39d56ba6/asv/extern/asizeof.py#L788-L794", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036506", "code": "def _reorder(string, salt):\n    \"\"\"Reorders `string` according to `salt`.\"\"\"\n    len_salt = len(salt)\n\n    if len_salt != 0:\n        string = list(string)\n        index, integer_sum = 0, 0\n        for i in range(len(string) - 1, 0, -1):\n            integer = ord(salt[index])\n            integer_sum += integer\n            j = (integer + index + integer_sum) % i\n            string[i], string[j] = string[j], string[i]\n            index = (index + 1) % len_salt\n        string = ''.join(string)\n\n    return string", "entry_point": "_reorder", "input": "'', ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/davidaurelio/hashids-python/blob/48f92cfd8427a0e434c9ced212fb93e641752db3/hashids.py#L66-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036507", "code": "def get_vert_opposites_per_edge(mesh_v, mesh_f):\n    \"\"\"Returns a dictionary from vertidx-pairs to opposites.\n    For example, a key consist of [4,5)] meaning the edge between\n    vertices 4 and 5, and a value might be [10,11] which are the indices\n    of the vertices opposing this edge.\"\"\"\n    result = {}\n    for f in mesh_f:\n        for i in range(3):\n            key = [f[i], f[(i+1)%3]]\n            key.sort()\n            key = tuple(key)\n            val = f[(i+2)%3]\n\n            if key in result:\n                result[key].append(val)\n            else:\n                result[key] = [val]\n    return result", "entry_point": "get_vert_opposites_per_edge", "input": "[5, 3, 1, 4], []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mattloper/opendr/blob/bc16a6a51771d6e062d088ba5cede66649b7c7ec/opendr/topology.py#L168-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036508", "code": "def markdown_2_rst(lines):\n    \"\"\"\n    Convert markdown to restructured text\n    \"\"\"\n    out = []\n    code = False\n    for line in lines:\n        # code blocks\n        if line.strip() == \"```\":\n            code = not code\n            space = \" \" * (len(line.rstrip()) - 3)\n            if code:\n                out.append(\"\\n\\n%s.. code-block:: none\\n\\n\" % space)\n            else:\n                out.append(\"\\n\")\n        else:\n            if code and line.strip():\n                line = \"    \" + line\n            else:\n                # escape any backslashes\n                line = line.replace(\"\\\\\", \"\\\\\\\\\")\n            out.append(line)\n    return out", "entry_point": "markdown_2_rst", "input": "'AbC dEf'", "output": "['A', 'b', 'C', ' ', 'd', 'E', 'f']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ultrabug/py3status/blob/4c105f1b44f7384ca4f7da5f821a47e468c7dee2/py3status/autodoc.py#L93-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036509", "code": "def auto_undent(string):\n    \"\"\"\n    Unindent a docstring.\n    \"\"\"\n    lines = string.splitlines()\n    while lines[0].strip() == \"\":\n        lines = lines[1:]\n        if not lines:\n            return []\n    spaces = len(lines[0]) - len(lines[0].lstrip(\" \"))\n    out = []\n    for line in lines:\n        num_spaces = len(line) - len(line.lstrip(\" \"))\n        out.append(line[min(spaces, num_spaces) :])\n    return out", "entry_point": "auto_undent", "input": "'walnut thistle harbour'", "output": "['walnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ultrabug/py3status/blob/4c105f1b44f7384ca4f7da5f821a47e468c7dee2/py3status/autodoc.py#L283-L297", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036510", "code": "def create_readme(data):\n    \"\"\"\n    Create README.md text for the given module data.\n    \"\"\"\n    out = ['<a name=\"top\"></a>Modules\\n========\\n\\n']\n    # Links\n    for module in sorted(data.keys()):\n        desc = \"\".join(data[module]).strip().split(\"\\n\")[0]\n        format_str = \"\\n**[{name}](#{name})** \u2014 {desc}\\n\"\n        out.append(format_str.format(name=module, desc=desc))\n    # details\n    for module in sorted(data.keys()):\n        out.append(\n            '\\n---\\n\\n### <a name=\"{name}\"></a>{name}\\n\\n{details}\\n'.format(\n                name=module, details=\"\".join(data[module]).strip()\n            )\n        )\n    return \"\".join(out)", "entry_point": "create_readme", "input": "{}", "output": "'<a name=\"top\"></a>Modules\\n========\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ultrabug/py3status/blob/4c105f1b44f7384ca4f7da5f821a47e468c7dee2/py3status/docstrings.py#L98-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036511", "code": "def get_unbound_arg_names(arg_names, arg_binding_keys):\n    \"\"\"Determines which args have no arg binding keys.\n\n    Args:\n      arg_names: a sequence of the names of possibly bound args\n      arg_binding_keys: a sequence of ArgBindingKey each of whose arg names is\n          in arg_names\n    Returns:\n      a sequence of arg names that is a (possibly empty, possibly non-proper)\n          subset of arg_names\n\n    \"\"\"\n    bound_arg_names = [abk._arg_name for abk in arg_binding_keys]\n    return [arg_name for arg_name in arg_names\n            if arg_name not in bound_arg_names]", "entry_point": "get_unbound_arg_names", "input": "{'x': [1, 2], 'y': []}, []", "output": "['x', 'y']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/pinject/blob/888acf1ccaaeeeba28a668ef9158c9dcc94405e1/pinject/arg_binding_keys.py#L80-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036512", "code": "def dar_nombre_campo_dbf(clave, claves):\n    \"Reducir nombre de campo a 10 caracteres, sin espacios ni _, sin repetir\"\n    # achico el nombre del campo para que quepa en la tabla:\n    nombre = clave.replace(\"_\",\"\")[:10]\n    # si el campo esta repetido, le agrego un n\u00famero\n    i = 0\n    while nombre in claves:\n        i += 1    \n        nombre = nombre[:9] + str(i)\n    return nombre.lower()", "entry_point": "dar_nombre_campo_dbf", "input": "'walnut thistle harbour', {'x': [1, 2], 'y': []}", "output": "'walnut thi'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/reingart/pyafipws/blob/ee87cfe4ac12285ab431df5fec257f103042d1ab/utils.py#L781-L790", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036513", "code": "def parse_field(setting, field_name, default):\n    \"\"\"\n    Extract result from single-value or dict-type setting like fallback_values.\n    \"\"\"\n    if isinstance(setting, dict):\n        return setting.get(field_name, default)\n    else:\n        return setting", "entry_point": "parse_field", "input": "['apple', 'banana', 'cherry'], 'abc', [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/deschler/django-modeltranslation/blob/18fec04a5105cbd83fc3759f4fda20135b3a848c/modeltranslation/utils.py#L174-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036514", "code": "def defrise_ellipses(ndim, nellipses=8, alternating=False):\n    \"\"\"Ellipses for the standard Defrise phantom in 2 or 3 dimensions.\n\n    Parameters\n    ----------\n    ndim : {2, 3}\n        Dimension of the space for the ellipses/ellipsoids.\n    nellipses : int, optional\n        Number of ellipses. If more ellipses are used, each ellipse becomes\n        thinner.\n    alternating : bool, optional\n        True if the ellipses should have alternating densities (+1, -1),\n        otherwise all ellipses have value +1.\n\n    See Also\n    --------\n    odl.phantom.geometric.ellipsoid_phantom :\n        Function for creating arbitrary ellipsoids phantoms\n    odl.phantom.transmission.shepp_logan_ellipsoids\n    \"\"\"\n    ellipses = []\n    if ndim == 2:\n        for i in range(nellipses):\n            if alternating:\n                value = (-1.0 + 2.0 * (i % 2))\n            else:\n                value = 1.0\n\n            axis_1 = 0.5\n            axis_2 = 0.5 / (nellipses + 1)\n            center_x = 0.0\n            center_y = -1 + 2.0 / (nellipses + 1.0) * (i + 1)\n            rotation = 0\n            ellipses.append(\n                [value, axis_1, axis_2, center_x, center_y, rotation])\n    elif ndim == 3:\n        for i in range(nellipses):\n            if alternating:\n                value = (-1.0 + 2.0 * (i % 2))\n            else:\n                value = 1.0\n\n            axis_1 = axis_2 = 0.5\n            axis_3 = 0.5 / (nellipses + 1)\n            center_x = center_y = 0.0\n            center_z = -1 + 2.0 / (nellipses + 1.0) * (i + 1)\n            rotation_phi = rotation_theta = rotation_psi = 0\n\n            ellipses.append(\n                [value, axis_1, axis_2, axis_3,\n                 center_x, center_y, center_z,\n                 rotation_phi, rotation_theta, rotation_psi])\n\n    return ellipses", "entry_point": "defrise_ellipses", "input": "[], [1, 2, 3], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/odlgroup/odl/blob/b8443f6aca90e191ba36c91d32253c5a36249a6c/odl/phantom/geometric.py#L138-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036515", "code": "def _separators(strings, linewidth):\n    \"\"\"Return separators that keep joined strings within the line width.\"\"\"\n    if len(strings) <= 1:\n        return ()\n\n    indent_len = 4\n    separators = []\n    cur_line_len = indent_len + len(strings[0]) + 1\n    if cur_line_len + 2 <= linewidth and '\\n' not in strings[0]:\n        # Next string might fit on same line\n        separators.append(', ')\n        cur_line_len += 1  # for the extra space\n    else:\n        # Use linebreak if string contains newline or doesn't fit\n        separators.append(',\\n')\n        cur_line_len = indent_len\n\n    for i, s in enumerate(strings[1:-1]):\n        cur_line_len += len(s) + 1\n\n        if '\\n' in s:\n            # Use linebreak before and after if string contains newline\n            separators[i] = ',\\n'\n            cur_line_len = indent_len\n            separators.append(',\\n')\n\n        elif cur_line_len + 2 <= linewidth:\n            # This string fits, next one might also fit on same line\n            separators.append(', ')\n            cur_line_len += 1  # for the extra space\n\n        elif cur_line_len <= linewidth:\n            # This string fits, but next one won't\n            separators.append(',\\n')\n            cur_line_len = indent_len\n\n        else:\n            # This string doesn't fit but has no newlines in it\n            separators[i] = ',\\n'\n            cur_line_len = indent_len + len(s) + 1\n\n            # Need to determine again what should come next\n            if cur_line_len + 2 <= linewidth:\n                # Next string might fit on same line\n                separators.append(', ')\n            else:\n                separators.append(',\\n')\n\n    cur_line_len += len(strings[-1])\n    if cur_line_len + 1 > linewidth or '\\n' in strings[-1]:\n        # This string and a comma don't fit on this line\n        separators[-1] = ',\\n'\n\n    return tuple(separators)", "entry_point": "_separators", "input": "'', ''", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/odlgroup/odl/blob/b8443f6aca90e191ba36c91d32253c5a36249a6c/odl/util/utility.py#L1019-L1072", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036516", "code": "def good_surts_from_default(default_surt):\n        '''\n        Takes a standard surt without scheme and without trailing comma, and\n        returns a list of \"good\" surts that together match the same set of\n        urls. For example:\n\n             good_surts_from_default('com,example)/path')\n\n        returns\n\n            ['http://(com,example,)/path',\n             'https://(com,example,)/path',\n             'http://(com,example,www,)/path',\n             'https://(com,example,www,)/path']\n\n        '''\n        if default_surt == '':\n            return ['']\n\n        parts = default_surt.split(')', 1)\n        if len(parts) == 2:\n            orig_host_part, path_part = parts\n            good_surts = [\n                'http://(%s,)%s' % (orig_host_part, path_part),\n                'https://(%s,)%s' % (orig_host_part, path_part),\n                'http://(%s,www,)%s' % (orig_host_part, path_part),\n                'https://(%s,www,)%s' % (orig_host_part, path_part),\n            ]\n        else: # no path part\n            host_part = parts[0]\n            good_surts = [\n                'http://(%s' % host_part,\n                'https://(%s' % host_part,\n            ]\n        return good_surts", "entry_point": "good_surts_from_default", "input": "''", "output": "['']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/internetarchive/brozzler/blob/411b3f266a38b9bb942021c0121ebd8e5ca66447/brozzler/pywb.py#L130-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036517", "code": "def _intermediary_to_markdown(tables, relationships):\n    \"\"\" Returns the er markup source in a string. \"\"\"\n    t = '\\n'.join(t.to_markdown() for t in tables)\n    r = '\\n'.join(r.to_markdown() for r in relationships)\n    return '{}\\n{}'.format(t, r)", "entry_point": "_intermediary_to_markdown", "input": "{}, []", "output": "'\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Alexis-benoist/eralchemy/blob/d6fcdc67d6d413bb174bf008fd360044e1dff5a7/eralchemy/main.py#L78-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036518", "code": "def clean_data(data: dict) -> dict:\n    \"\"\"Removes all empty values and converts tuples into lists\"\"\"\n    new_data = {}\n    for key, value in data.items():\n        # Verify that only explicitly passed args get passed on\n        if not isinstance(value, bool) and not value:\n            continue\n\n        # Multiple choice command are passed as tuples, convert to list to match schema\n        if isinstance(value, tuple):\n            value = list(value)\n        new_data[key] = value\n    return new_data", "entry_point": "clean_data", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/notifiers/notifiers/blob/6dd8aafff86935dbb4763db9c56f9cdd7fc08b65/notifiers_cli/utils/dynamic_click.py#L70-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036519", "code": "def is_valid_port(instance: int):\n    \"\"\"Validates data is a valid port\"\"\"\n    if not isinstance(instance, (int, str)):\n        return True\n    return int(instance) in range(65535)", "entry_point": "is_valid_port", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/notifiers/notifiers/blob/6dd8aafff86935dbb4763db9c56f9cdd7fc08b65/notifiers/utils/schema/formats.py#L57-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036520", "code": "def get_institution_url(base_url):\n    \"\"\"\n    Clean up a given base URL.\n\n    :param base_url: The base URL of the API.\n    :type base_url: str\n    :rtype: str\n    \"\"\"\n    base_url = base_url.rstrip('/')\n    index = base_url.find('/api/v1')\n\n    if index != -1:\n        return base_url[0:index]\n\n    return base_url", "entry_point": "get_institution_url", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ucfopen/canvasapi/blob/319064b5fc97ba54250af683eb98723ef3f76cf8/canvasapi/util.py#L135-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036521", "code": "def is_truthy(value, default=False):\n    \"\"\"Evaluate a value for truthiness\n\n    >>> is_truthy('Yes')\n    True\n    >>> is_truthy('False')\n    False\n    >>> is_truthy(1)\n    True\n\n    Args:\n        value (Any): Value to evaluate\n        default (bool): Optional default value, if the input does not match the true or false values\n\n    Returns:\n        True if a truthy value is passed, else False\n    \"\"\"\n\n    if value is None:\n        return False\n\n    if isinstance(value, bool):\n        return value\n\n    if isinstance(value, int):\n        return value > 0\n\n    trues = ('1', 'true', 'y', 'yes', 'ok')\n    falses = ('', '0', 'false', 'n', 'none', 'no')\n\n    if value.lower().strip() in falses:\n        return False\n\n    elif value.lower().strip() in trues:\n        return True\n\n    else:\n        if default:\n            return default\n        else:\n            raise ValueError('Invalid argument given to truthy: {0}'.format(value))", "entry_point": "is_truthy", "input": "True, set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/RiotGames/cloud-inquisitor/blob/181dc2566ca59fc855f695b7fcc2c3b934e6ee9f/backend/cloud_inquisitor/utils.py#L97-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036522", "code": "def check_empty_dict(GET_dict):\n    \"\"\"\n    Returns True if the GET querstring contains on values, but it can contain\n    empty keys.\n    This is better than doing not bool(request.GET) as an empty key will return\n    True\n    \"\"\"\n    empty = True\n    for k, v in GET_dict.items():\n        # Don't disable on p(age) or 'all' GET param\n        if v and k != 'p' and k != 'all':\n            empty = False\n    return empty", "entry_point": "check_empty_dict", "input": "{}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/django-treebeard/django-treebeard/blob/8042ee939cb45394909237da447f8925e3cc6aa3/treebeard/templatetags/admin_tree.py#L219-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036523", "code": "def from_local_name(acs, attr, name_format):\n    \"\"\"\n    :param acs: List of AttributeConverter instances\n    :param attr: attribute name as string\n    :param name_format: Which name-format it should be translated to\n    :return: An Attribute instance\n    \"\"\"\n    for aconv in acs:\n        #print(ac.format, name_format)\n        if aconv.name_format == name_format:\n            #print(\"Found a name_form converter\")\n            return aconv.to_format(attr)\n    return attr", "entry_point": "from_local_name", "input": "[], [], 'a,b,c'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IdentityPython/pysaml2/blob/d3aa78eeb7d37c12688f783cb4db1c7263a14ad6/src/saml2/attribute_converter.py#L161-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036524", "code": "def add_path(tdict, path):\n    \"\"\"\n    Create or extend an argument tree `tdict` from `path`.\n\n    :param tdict: a dictionary representing a argument tree\n    :param path: a path list\n    :return: a dictionary\n\n    Convert a list of items in a 'path' into a nested dict, where the\n    second to last item becomes the key for the final item. The remaining\n    items in the path become keys in the nested dict around that final pair\n    of items.\n\n    For example, for input values of:\n        tdict={}\n        path = ['assertion', 'subject', 'subject_confirmation',\n                'method', 'urn:oasis:names:tc:SAML:2.0:cm:bearer']\n\n        Returns an output value of:\n           {'assertion': {'subject': {'subject_confirmation':\n                         {'method': 'urn:oasis:names:tc:SAML:2.0:cm:bearer'}}}}\n\n    Another example, this time with a non-empty tdict input:\n\n        tdict={'method': 'urn:oasis:names:tc:SAML:2.0:cm:bearer'},\n        path=['subject_confirmation_data', 'in_response_to', '_012345']\n\n        Returns an output value of:\n            {'subject_confirmation_data': {'in_response_to': '_012345'},\n             'method': 'urn:oasis:names:tc:SAML:2.0:cm:bearer'}\n    \"\"\"\n    t = tdict\n    for step in path[:-2]:\n        try:\n            t = t[step]\n        except KeyError:\n            t[step] = {}\n            t = t[step]\n    t[path[-2]] = path[-1]\n\n    return tdict", "entry_point": "add_path", "input": "{'x': [1, 2], 'y': []}, 'walnut thistle harbour'", "output": "{'x': [1, 2], 'y': [], 'w': {'a': {'l': {'n': {'u': {'t': {' ': {'t': {'h': {'i': {'s': {'t': {'l': {'e': {' ': {'h': {'a': {'r': {'b': {'o': {'u': 'r'}}}}}}}}}}}}}}}}}}}}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/IdentityPython/pysaml2/blob/d3aa78eeb7d37c12688f783cb4db1c7263a14ad6/src/saml2/argtree.py#L54-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036525", "code": "def _gen_keys_from_multicol_key(key_multicol, n_keys):\n    \"\"\"Generates single-column keys from multicolumn key.\"\"\"\n    keys = [('{}{:03}of{:03}')\n            .format(key_multicol, i+1, n_keys) for i in range(n_keys)]\n    return keys", "entry_point": "_gen_keys_from_multicol_key", "input": "{'x': [1, 2], 'y': []}, True", "output": "[\"{'x': [1, 2], 'y': []}001of001\"]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/theislab/anndata/blob/34f4eb63710628fbc15e7050e5efcac1d7806062/anndata/base.py#L186-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036526", "code": "def trim_common_prefixes(strs, min_len=0):\n    \"\"\"trim common prefixes\"\"\"\n\n    trimmed = 0\n\n    if len(strs) > 1:\n        s1 = min(strs)\n        s2 = max(strs)\n\n        for i in range(len(s1) - min_len):\n            if s1[i] != s2[i]:\n                break\n            trimmed = i + 1\n\n    if trimmed > 0:\n        strs = [s[trimmed:] for s in strs]\n\n    return trimmed, strs", "entry_point": "trim_common_prefixes", "input": "{'a': 1, 'b': 2}, False", "output": "(0, {'a': 1, 'b': 2})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/biocommons/hgvs/blob/4d16efb475e1802b2531a2f1c373e8819d8e533b/hgvs/utils/norm.py#L36-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036527", "code": "def is_valid_abi_type(type_name):\n    \"\"\"\n    This function is used to make sure that the ``type_name`` is a valid ABI Type.\n\n    Please note that this is a temporary function and should be replaced by the corresponding\n    ABI function, once the following issue has been resolved.\n    https://github.com/ethereum/eth-abi/issues/125\n    \"\"\"\n    valid_abi_types = {\"address\", \"bool\", \"bytes\", \"int\", \"string\", \"uint\"}\n    is_bytesN = type_name.startswith(\"bytes\") and 1 <= int(type_name[5:]) <= 32\n    is_intN = (\n        type_name.startswith(\"int\") and\n        8 <= int(type_name[3:]) <= 256 and\n        int(type_name[3:]) % 8 == 0\n    )\n    is_uintN = (\n        type_name.startswith(\"uint\") and\n        8 <= int(type_name[4:]) <= 256 and\n        int(type_name[4:]) % 8 == 0\n    )\n\n    if type_name in valid_abi_types:\n        return True\n    elif is_bytesN:\n        # bytes1 to bytes32\n        return True\n    elif is_intN:\n        # int8 to int256\n        return True\n    elif is_uintN:\n        # uint8 to uint256\n        return True\n\n    return False", "entry_point": "is_valid_abi_type", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/eth-account/blob/335199b815ae34fea87f1523e2f29777fd52946e/eth_account/_utils/structured_data/hashing.py#L94-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036528", "code": "def coerce_date_dict(date_dict):\n    \"\"\"\n    given a dictionary (presumed to be from request.GET) it returns a tuple\n    that represents a date. It will return from year down to seconds until one\n    is not found.  ie if year, month, and seconds are in the dictionary, only\n    year and month will be returned, the rest will be returned as min. If none\n    of the parts are found return an empty tuple.\n    \"\"\"\n    keys = ['year', 'month', 'day', 'hour', 'minute', 'second']\n    ret_val = {\n        'year': 1,\n        'month': 1,\n        'day': 1,\n        'hour': 0,\n        'minute': 0,\n        'second': 0}\n    modified = False\n    for key in keys:\n        try:\n            ret_val[key] = int(date_dict[key])\n            modified = True\n        except KeyError:\n            break\n    return modified and ret_val or {}", "entry_point": "coerce_date_dict", "input": "{'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/llazzaro/django-scheduler/blob/0530b74a5fc0b1125645002deaa4da2337ed0f17/schedule/utils.py#L196-L219", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036529", "code": "def wrap_argument(text):\n    \"\"\"\n    Wrap command argument in quotes and escape when this contains special characters.\n    \"\"\"\n    if not any(x in text for x in [' ', '\"', \"'\", '\\\\']):\n        return text\n    else:\n        return '\"%s\"' % (text.replace('\\\\', r'\\\\').replace('\"', r'\\\"'), )", "entry_point": "wrap_argument", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/prompt-toolkit/pymux/blob/3f66e62b9de4b2251c7f9afad6c516dc5a30ec67/pymux/commands/utils.py#L8-L15", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036530", "code": "def _convert_args(args):\n    '''\n    Take a list of args, and convert any dicts inside the list to keyword\n    args in the form of `key=value`, ready to be passed to salt-ssh\n    '''\n    converted = []\n    for arg in args:\n        if isinstance(arg, dict):\n            for key in list(arg.keys()):\n                if key == '__kwarg__':\n                    continue\n                converted.append('{0}={1}'.format(key, arg[key]))\n        else:\n            converted.append(arg)\n    return converted", "entry_point": "_convert_args", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/__init__.py#L1659-L1673", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036531", "code": "def format_version(epoch, version, release):\n    '''\n    Formats a version string for list_pkgs.\n    '''\n    full_version = '{0}:{1}'.format(epoch, version) if epoch else version\n    if release:\n        full_version += '-{0}'.format(release)\n    return full_version", "entry_point": "format_version", "input": "[1, 2, 3], [[1, 2], [3], []], [1, 2, 3]", "output": "'[1, 2, 3]:[[1, 2], [3], []]-[1, 2, 3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L338-L345", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036532", "code": "def _load_connection_error(hostname, error):\n    '''\n    Format and Return a connection error\n    '''\n\n    ret = {'code': None, 'content': 'Error: Unable to connect to the bigip device: {host}\\n{error}'.format(host=hostname, error=error)}\n\n    return ret", "entry_point": "_load_connection_error", "input": "'  padded  ', [5, 3, 1, 4]", "output": "{'code': None, 'content': 'Error: Unable to connect to the bigip device:   padded  \\n[5, 3, 1, 4]'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bigip.py#L80-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036533", "code": "def _build_list(option_value, item_kind):\n    '''\n    pass in an option to check for a list of items, create a list of dictionary of items to set\n    for this option\n    '''\n    #specify profiles if provided\n    if option_value is not None:\n\n        items = []\n\n        #if user specified none, return an empty list\n        if option_value == 'none':\n            return items\n\n        #was a list already passed in?\n        if not isinstance(option_value, list):\n            values = option_value.split(',')\n        else:\n            values = option_value\n\n        for value in values:\n            # sometimes the bigip just likes a plain ol list of items\n            if item_kind is None:\n                items.append(value)\n            # other times it's picky and likes key value pairs...\n            else:\n                items.append({'kind': item_kind, 'name': value})\n        return items\n    return None", "entry_point": "_build_list", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[{'kind': [-1, 0, 1, 2], 'name': 1}, {'kind': [-1, 0, 1, 2], 'name': 2}, {'kind': [-1, 0, 1, 2], 'name': 3}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bigip.py#L107-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036534", "code": "def __parse_drac(output):\n    '''\n    Parse Dell DRAC output\n    '''\n    drac = {}\n    section = ''\n\n    for i in output.splitlines():\n        if i.strip().endswith(':') and '=' not in i:\n            section = i[0:-1]\n            drac[section] = {}\n        if i.rstrip() and '=' in i:\n            if section in drac:\n                drac[section].update(dict(\n                    [[prop.strip() for prop in i.split('=')]]\n                ))\n            else:\n                section = i.strip()\n                if section not in drac and section:\n                    drac[section] = {}\n\n    return drac", "entry_point": "__parse_drac", "input": "'walnut thistle harbour'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L43-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036535", "code": "def _output_format(out,\n                   operation):\n    '''\n    gets a list of all the packages that were affected by ``operation``, splits it up (there can be multiple packages on a line), and then\n    flattens that list. We make it to a list for easier parsing.\n    '''\n    return [s.split()[1:] for s in out\n            if s.startswith(operation)]", "entry_point": "_output_format", "input": "[], 2.0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nix.py#L89-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036536", "code": "def _parse_cpe_name(cpe):\n    '''\n    Parse CPE_NAME data from the os-release\n\n    Info: https://csrc.nist.gov/projects/security-content-automation-protocol/scap-specifications/cpe\n\n    :param cpe:\n    :return:\n    '''\n    part = {\n        'o': 'operating system',\n        'h': 'hardware',\n        'a': 'application',\n    }\n    ret = {}\n    cpe = (cpe or '').split(':')\n    if len(cpe) > 4 and cpe[0] == 'cpe':\n        if cpe[1].startswith('/'):  # WFN to URI\n            ret['vendor'], ret['product'], ret['version'] = cpe[2:5]\n            ret['phase'] = cpe[5] if len(cpe) > 5 else None\n            ret['part'] = part.get(cpe[1][1:])\n        elif len(cpe) == 13 and cpe[1] == '2.3':  # WFN to a string\n            ret['vendor'], ret['product'], ret['version'], ret['phase'] = [x if x != '*' else None for x in cpe[3:7]]\n            ret['part'] = part.get(cpe[2])\n\n    return ret", "entry_point": "_parse_cpe_name", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/core.py#L1559-L1584", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036537", "code": "def _cast_output_to_type(value, typ):\n    '''cast the value depending on the terraform type'''\n    if typ == 'b':\n        return bool(value)\n    if typ == 'i':\n        return int(value)\n    return value", "entry_point": "_cast_output_to_type", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/terraform.py#L119-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036538", "code": "def _get_desired_pkg(name, desired):\n    '''\n    Helper function that retrieves and nicely formats the desired pkg (and\n    version if specified) so that helpful information can be printed in the\n    comment for the state.\n    '''\n    if not desired[name] or desired[name].startswith(('<', '>', '=')):\n        oper = ''\n    else:\n        oper = '='\n    return '{0}{1}{2}'.format(name, oper,\n                              '' if not desired[name] else desired[name])", "entry_point": "_get_desired_pkg", "input": "False, 'walnut thistle harbour'", "output": "'False=w'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L887-L898", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036539", "code": "def _parse_line(line=''):\n    '''\n    Used by conf() to break config lines into\n    name/value pairs\n    '''\n    parts = line.split()\n    key = parts.pop(0)\n    value = ' '.join(parts)\n    return key, value", "entry_point": "_parse_line", "input": "'AbC dEf'", "output": "('AbC', 'dEf')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grub_legacy.py#L118-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036540", "code": "def trim_req(req):\n    '''\n    Trim any function off of a requisite\n    '''\n    reqfirst = next(iter(req))\n    if '.' in reqfirst:\n        return {reqfirst.split('.')[0]: req[reqfirst]}\n    return req", "entry_point": "trim_req", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L207-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036541", "code": "def state_args(id_, state, high):\n    '''\n    Return a set of the arguments passed to the named state\n    '''\n    args = set()\n    if id_ not in high:\n        return args\n    if state not in high[id_]:\n        return args\n    for item in high[id_][state]:\n        if not isinstance(item, dict):\n            continue\n        if len(item) != 1:\n            continue\n        args.add(next(iter(item)))\n    return args", "entry_point": "state_args", "input": "['a', 'b', 'c'], [5, 3, 1, 4], ['a', 'b', 'c']", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L217-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036542", "code": "def _enforce_txt_record_maxlen(key, value):\n    '''\n    Enforces the TXT record maximum length of 255 characters.\n    TXT record length includes key, value, and '='.\n\n    :param str key: Key of the TXT record\n    :param str value: Value of the TXT record\n\n    :rtype: str\n    :return: The value of the TXT record. It may be truncated if it exceeds\n             the maximum permitted length. In case of truncation, '...' is\n             appended to indicate that the entire value is not present.\n    '''\n    # Add 1 for '=' seperator between key and value\n    if len(key) + len(value) + 1 > 255:\n        # 255 - 3 ('...') - 1 ('=') = 251\n        return value[:251 - len(key)] + '...'\n    return value", "entry_point": "_enforce_txt_record_maxlen", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/bonjour_announce.py#L73-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036543", "code": "def _number(text):\n    '''\n    Convert a string to a number.\n    Returns an integer if the string represents an integer, a floating\n    point number if the string is a real number, or the string unchanged\n    otherwise.\n    '''\n    if text.isdigit():\n        return int(text)\n    try:\n        return float(text)\n    except ValueError:\n        return text", "entry_point": "_number", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L59-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036544", "code": "def _unique(list_of_dicts):\n    '''\n    Returns an unique list of dictionaries given a list that may contain duplicates.\n    '''\n    unique_list = []\n    for ele in list_of_dicts:\n        if ele not in unique_list:\n            unique_list.append(ele)\n    return unique_list", "entry_point": "_unique", "input": "{'x': [1, 2], 'y': []}", "output": "['x', 'y']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L108-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036545", "code": "def get_headers(data, extra_headers=None):\n    '''\n    Takes the response data as well as any additional headers and returns a\n    tuple of tuples of headers suitable for passing to start_response()\n    '''\n    response_headers = {\n        'Content-Length': str(len(data)),\n    }\n\n    if extra_headers:\n        response_headers.update(extra_headers)\n\n    return list(response_headers.items())", "entry_point": "get_headers", "input": "set(), {'a': 1, 'b': 2}", "output": "[('Content-Length', '0'), ('a', 1), ('b', 2)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L206-L218", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036546", "code": "def _set_trusted_option_if_needed(repostr, trusted):\n    '''\n    Set trusted option to repo if needed\n    '''\n    if trusted is True:\n        repostr += ' [trusted=yes]'\n    elif trusted is False:\n        repostr += ' [trusted=no]'\n    return repostr", "entry_point": "_set_trusted_option_if_needed", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1368-L1376", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036547", "code": "def validate(config):\n    '''\n    Validate the beacon configuration\n    '''\n    _config = {}\n    list(map(_config.update, config))\n\n    if not isinstance(config, list):\n        return False, ('Configuration for avahi_announce '\n                       'beacon must be a list.')\n\n    elif not all(x in _config for x in ('servicetype',\n                                        'port',\n                                        'txt')):\n        return False, ('Configuration for avahi_announce beacon '\n                       'must contain servicetype, port and txt items.')\n    return True, 'Valid beacon configuration.'", "entry_point": "validate", "input": "{}", "output": "(False, 'Configuration for avahi_announce beacon must be a list.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/avahi_announce.py#L60-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036548", "code": "def _buildElementNsmap(using_elements):\n    '''\n    build a namespace map for an ADMX element\n    '''\n    thisMap = {}\n    for e in using_elements:\n        thisMap[e.attrib['prefix']] = e.attrib['namespace']\n    return thisMap", "entry_point": "_buildElementNsmap", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4963-L4970", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036549", "code": "def _xr_to_keyset(line):\n    '''\n    Parse xfsrestore output keyset elements.\n    '''\n    tkns = [elm for elm in line.strip().split(\":\", 1) if elm]\n    if len(tkns) == 1:\n        return \"'{0}': \".format(tkns[0])\n    else:\n        key, val = tkns\n        return \"'{0}': '{1}',\".format(key.strip(), val.strip())", "entry_point": "_xr_to_keyset", "input": "'abc'", "output": "\"'abc': \"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xfs.py#L211-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036550", "code": "def _pretty_hex(hex_str):\n    '''\n    Nicely formats hex strings\n    '''\n    if len(hex_str) % 2 != 0:\n        hex_str = '0' + hex_str\n    return ':'.join(\n        [hex_str[i:i + 2] for i in range(0, len(hex_str), 2)]).upper()", "entry_point": "_pretty_hex", "input": "'Hello World'", "output": "'0H:EL:LO: W:OR:LD'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L295-L302", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036551", "code": "def _format_job_instance(job):\n    '''\n    Helper to format a job instance\n    '''\n    if not job:\n        ret = {'Error': 'Cannot contact returner or no job with this jid'}\n        return ret\n\n    ret = {'Function': job.get('fun', 'unknown-function'),\n           'Arguments': list(job.get('arg', [])),\n           # unlikely but safeguard from invalid returns\n           'Target': job.get('tgt', 'unknown-target'),\n           'Target-type': job.get('tgt_type', 'list'),\n           'User': job.get('user', 'root')}\n\n    if 'metadata' in job:\n        ret['Metadata'] = job.get('metadata', {})\n    else:\n        if 'kwargs' in job:\n            if 'metadata' in job['kwargs']:\n                ret['Metadata'] = job['kwargs'].get('metadata', {})\n\n    if 'Minions' in job:\n        ret['Minions'] = job['Minions']\n    return ret", "entry_point": "_format_job_instance", "input": "[]", "output": "{'Error': 'Cannot contact returner or no job with this jid'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L551-L575", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036552", "code": "def get_retcode(ret):\n    '''\n    Determine a retcode for a given return\n    '''\n    retcode = 0\n    # if there is a dict with retcode, use that\n    if isinstance(ret, dict) and ret.get('retcode', 0) != 0:\n        return ret['retcode']\n    # if its a boolean, False means 1\n    elif isinstance(ret, bool) and not ret:\n        return 1\n    return retcode", "entry_point": "get_retcode", "input": "[1, 2, 3]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/job.py#L139-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036553", "code": "def _parse_key(key):\n    '''\n    split the hive from the key\n    '''\n    splt = key.split(\"\\\\\")\n    hive = splt.pop(0)\n    key = '\\\\'.join(splt)\n    return hive, key", "entry_point": "_parse_key", "input": "'  padded  '", "output": "('  padded  ', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L104-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036554", "code": "def _stdout_list_split(retcode, stdout='', splitstring='\\n'):\n    '''\n    Evaulates Open vSwitch command`s retcode value.\n\n    Args:\n        retcode: Value of retcode field from response, should be 0, 1 or 2.\n        stdout: Value of stdout filed from response.\n        splitstring: String used to split the stdout default new line.\n\n    Returns:\n        List or False.\n    '''\n    if retcode == 0:\n        ret = stdout.split(splitstring)\n        return ret\n    else:\n        return False", "entry_point": "_stdout_list_split", "input": "['a', 'b', 'c'], [[1, 2], [3], []], 'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L80-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036555", "code": "def format_job_instance(job):\n    '''\n    Format the job instance correctly\n    '''\n    ret = {'Function': job.get('fun', 'unknown-function'),\n           'Arguments': list(job.get('arg', [])),\n           # unlikely but safeguard from invalid returns\n           'Target': job.get('tgt', 'unknown-target'),\n           'Target-type': job.get('tgt_type', 'list'),\n           'User': job.get('user', 'root')}\n\n    if 'metadata' in job:\n        ret['Metadata'] = job.get('metadata', {})\n    else:\n        if 'kwargs' in job:\n            if 'metadata' in job['kwargs']:\n                ret['Metadata'] = job['kwargs'].get('metadata', {})\n    return ret", "entry_point": "format_job_instance", "input": "{'a': 1, 'b': 2}", "output": "{'Function': 'unknown-function', 'Arguments': [], 'Target': 'unknown-target', 'Target-type': 'list', 'User': 'root'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L82-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036556", "code": "def _find_types(pkgs):\n    '''Form a package names list, find prefixes of packages types.'''\n    return sorted({pkg.split(':', 1)[0] for pkg in pkgs\n                   if len(pkg.split(':', 1)) == 2})", "entry_point": "_find_types", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1273-L1276", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036557", "code": "def _pretty_size(size):\n    '''\n    Print sizes in a similar fashion as eclean\n    '''\n    units = [' G', ' M', ' K', ' B']\n    while units and size >= 1000:\n        size = size / 1024.0\n        units.pop()\n    return '{0}{1}'.format(round(size, 1), units[-1])", "entry_point": "_pretty_size", "input": "0", "output": "'0 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gentoolkitmod.py#L54-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036558", "code": "def _glsa_list_process_output(output):\n    '''\n    Process output from glsa_check_list into a dict\n\n    Returns a dict containing the glsa id, description, status, and CVEs\n    '''\n    ret = dict()\n    for line in output:\n        try:\n            glsa_id, status, desc = line.split(None, 2)\n            if 'U' in status:\n                status += ' Not Affected'\n            elif 'N' in status:\n                status += ' Might be Affected'\n            elif 'A' in status:\n                status += ' Applied (injected)'\n            if 'CVE' in desc:\n                desc, cves = desc.rsplit(None, 1)\n                cves = cves.split(',')\n            else:\n                cves = list()\n            ret[glsa_id] = {'description': desc, 'status': status,\n                            'CVEs': cves}\n        except ValueError:\n            pass\n    return ret", "entry_point": "_glsa_list_process_output", "input": "['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gentoolkitmod.py#L233-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036559", "code": "def checksum(digits):\n    \"\"\"\n    Returns the checksum of CPF digits.\n    References to the algorithm:\n    https://pt.wikipedia.org/wiki/Cadastro_de_pessoas_f%C3%ADsicas#Algoritmo\n    https://metacpan.org/source/MAMAWE/Algorithm-CheckDigits-v1.3.0/lib/Algorithm/CheckDigits/M11_004.pm\n    \"\"\"\n    s = 0\n    p = len(digits) + 1\n    for i in range(0, len(digits)):\n        s += digits[i] * p\n        p -= 1\n\n    reminder = s % 11\n    if reminder == 0 or reminder == 1:\n        return 0\n    else:\n        return 11 - reminder", "entry_point": "checksum", "input": "[5, 3, 1, 4]", "output": "7", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/pt_BR/__init__.py#L8-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036560", "code": "def checksum(digits):\n    \"\"\"\n    Calculate and return control digit for given list of digits based on\n    ISO7064, MOD 11,10 standard.\n    \"\"\"\n    remainder = 10\n    for digit in digits:\n        remainder = (remainder + digit) % 10\n        if remainder == 0:\n            remainder = 10\n        remainder = (remainder * 2) % 11\n\n    control_digit = 11 - remainder\n    if control_digit == 10:\n        control_digit = 0\n    return control_digit", "entry_point": "checksum", "input": "[]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/hr_HR/__init__.py#L7-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036561", "code": "def _levenshtein_distance(s1, s2):\n    \"\"\"\n    :param s1:  A list or string\n    :param s2:  Another list or string\n    :returns:    The levenshtein distance between the two\n    \"\"\"\n    if len(s1) > len(s2):\n        s1, s2 = s2, s1\n    distances = range(len(s1) + 1)\n    for index2, num2 in enumerate(s2):\n        new_distances = [index2 + 1]\n        for index1, num1 in enumerate(s1):\n            if num1 == num2:\n                new_distances.append(distances[index1])\n            else:\n                new_distances.append(1 + min((distances[index1],\n                                             distances[index1+1],\n                                             new_distances[-1])))\n        distances = new_distances\n    return distances[-1]", "entry_point": "_levenshtein_distance", "input": "[], [1, 2, 3]", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L82-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036562", "code": "def _normalized_levenshtein_distance(s1, s2, acceptable_differences):\n    \"\"\"\n    This function calculates the levenshtein distance but allows for elements in the lists to be different by any number\n    in the set acceptable_differences.\n\n    :param s1:                      A list.\n    :param s2:                      Another list.\n    :param acceptable_differences:  A set of numbers. If (s2[i]-s1[i]) is in the set then they are considered equal.\n    :returns:\n    \"\"\"\n    if len(s1) > len(s2):\n        s1, s2 = s2, s1\n        acceptable_differences = set(-i for i in acceptable_differences)\n    distances = range(len(s1) + 1)\n    for index2, num2 in enumerate(s2):\n        new_distances = [index2 + 1]\n        for index1, num1 in enumerate(s1):\n            if num2 - num1 in acceptable_differences:\n                new_distances.append(distances[index1])\n            else:\n                new_distances.append(1 + min((distances[index1],\n                                             distances[index1+1],\n                                             new_distances[-1])))\n        distances = new_distances\n    return distances[-1]", "entry_point": "_normalized_levenshtein_distance", "input": "[5, 3, 1, 4], [5, 3, 1, 4], {}", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L104-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036563", "code": "def _convert_indirect_jump_targets_to_states(job, indirect_jump_targets):\n        \"\"\"\n        Convert each concrete indirect jump target into a SimState.\n\n        :param job:                     The CFGJob instance.\n        :param indirect_jump_targets:   A collection of concrete jump targets resolved from a indirect jump.\n        :return:                        A list of SimStates.\n        :rtype:                         list\n        \"\"\"\n\n        successors = [ ]\n        for t in indirect_jump_targets:\n            # Insert new successors\n            a = job.sim_successors.all_successors[0].copy()\n            a.ip = t\n            successors.append(a)\n        return successors", "entry_point": "_convert_indirect_jump_targets_to_states", "input": "['a', 'b', 'c'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2214-L2230", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036564", "code": "def normalize(name):\n    \"\"\"Normalize name for the Statsd convention\"\"\"\n\n    # Name should not contain some specials chars (issue #1068)\n    ret = name.replace(':', '')\n    ret = ret.replace('%', '')\n    ret = ret.replace(' ', '_')\n\n    return ret", "entry_point": "normalize", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_statsd.py#L86-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036565", "code": "def seconds_to_hms(input_seconds):\n    \"\"\"Convert seconds to human-readable time.\"\"\"\n    minutes, seconds = divmod(input_seconds, 60)\n    hours, minutes = divmod(minutes, 60)\n\n    hours = int(hours)\n    minutes = int(minutes)\n    seconds = str(int(seconds)).zfill(2)\n\n    return hours, minutes, seconds", "entry_point": "seconds_to_hms", "input": "False", "output": "(0, 0, '00')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L34-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036566", "code": "def allcap_differential(words):\n    \"\"\"\n    Check whether just some words in the input are ALL CAPS\n    :param list words: The words to inspect\n    :returns: `True` if some but not all items in `words` are ALL CAPS\n    \"\"\"\n    is_different = False\n    allcap_words = 0\n    for word in words:\n        if word.isupper():\n            allcap_words += 1\n    cap_differential = len(words) - allcap_words\n    if 0 < cap_differential < len(words):\n        is_different = True\n    return is_different", "entry_point": "allcap_differential", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L119-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036567", "code": "def _gerrit_user_to_author(props, username=\"unknown\"):\n    \"\"\"\n    Convert Gerrit account properties to Buildbot format\n\n    Take into account missing values\n    \"\"\"\n    username = props.get(\"username\", username)\n    username = props.get(\"name\", username)\n    if \"email\" in props:\n        username += \" <%(email)s>\" % props\n    return username", "entry_point": "_gerrit_user_to_author", "input": "{'x': [1, 2], 'y': []}, [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/gerritchangesource.py#L51-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036568", "code": "def define_plugin_entry(name, module_name):\n    \"\"\"\n    helper to produce lines suitable for setup.py's entry_points\n    \"\"\"\n    if isinstance(name, tuple):\n        entry, name = name\n    else:\n        entry = name\n    return '%s = %s:%s' % (entry, module_name, name)", "entry_point": "define_plugin_entry", "input": "'Hello World', 'walnut thistle harbour'", "output": "'Hello World = walnut thistle harbour:Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/setup.py#L99-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036569", "code": "def getGerritChanges(props):\n        \"\"\" Get the gerrit changes\n\n            This method could be overridden if really needed to accommodate for other\n            custom steps method for fetching gerrit changes.\n\n            :param props: an IProperty\n\n            :return: (optionally via deferred) a list of dictionary with at list\n                change_id, and revision_id,\n                which format is the one accepted by the gerrit REST API as of\n                /changes/:change_id/revision/:revision_id paths (see gerrit doc)\n        \"\"\"\n        if 'gerrit_changes' in props:\n            return props.getProperty('gerrit_changes')\n\n        if 'event.change.number' in props:\n            return [{\n                'change_id': props.getProperty('event.change.number'),\n                'revision_id': props.getProperty('event.patchSet.number')\n            }]\n        return []", "entry_point": "getGerritChanges", "input": "[5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gerrit_verify_status.py#L169-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036570", "code": "def bytes2NativeString(x, encoding='utf-8'):\n    \"\"\"\n    Convert C{bytes} to a native C{str}.\n\n    On Python 3 and higher, str and bytes\n    are not equivalent.  In this case, decode\n    the bytes, and return a native string.\n\n    On Python 2 and lower, str and bytes\n    are equivalent.  In this case, just\n    just return the native string.\n\n    @param x: a string of type C{bytes}\n    @param encoding: an optional codec, default: 'utf-8'\n    @return: a string of type C{str}\n    \"\"\"\n    if isinstance(x, bytes) and str != bytes:\n        return x.decode(encoding)\n    return x", "entry_point": "bytes2NativeString", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L38-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036571", "code": "def get_region(b):\n    \"\"\"Tries to get the bucket region from Location.LocationConstraint\n\n    Special cases:\n        LocationConstraint EU defaults to eu-west-1\n        LocationConstraint null defaults to us-east-1\n\n    Args:\n        b (object): A bucket object\n\n    Returns:\n        string: an aws region string\n    \"\"\"\n    remap = {None: 'us-east-1', 'EU': 'eu-west-1'}\n    region = b.get('Location', {}).get('LocationConstraint')\n    return remap.get(region, region)", "entry_point": "get_region", "input": "{'a': 1, 'b': 2}", "output": "'us-east-1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/resources/s3.py#L531-L546", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036572", "code": "def _port_ranges_to_set(ranges):\n        \"\"\" Converts array of port ranges to the set of integers\n            Example: [(10-12), (20,20)] -> {10, 11, 12, 20}\n        \"\"\"\n        return set([i for r in ranges for i in range(r.start, r.end + 1)])", "entry_point": "_port_ranges_to_set", "input": "[]", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_azure/c7n_azure/utils.py#L292-L296", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036573", "code": "def obtain_all_devices(my_devices):\n    \"\"\"Dynamically create 'all' group.\"\"\"\n    new_devices = {}\n    for device_name, device_or_group in my_devices.items():\n        # Skip any groups\n        if not isinstance(device_or_group, list):\n            new_devices[device_name] = device_or_group\n    return new_devices", "entry_point": "obtain_all_devices", "input": "{'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/utilities.py#L110-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036574", "code": "def clitable_to_dict(cli_table):\n    \"\"\"Converts TextFSM cli_table object to list of dictionaries.\"\"\"\n    objs = []\n    for row in cli_table:\n        temp_dict = {}\n        for index, element in enumerate(row):\n            temp_dict[cli_table.header[index].lower()] = element\n        objs.append(temp_dict)\n    return objs", "entry_point": "clitable_to_dict", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/utilities.py#L219-L227", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036575", "code": "def fix_deplist(deps):\n    \"\"\" Turn a dependency list into lowercase, and make sure all entries\n        that are just a string become a tuple of strings\n    \"\"\"\n    deps = [\n        ((dep.lower(),)\n         if not isinstance(dep, (list, tuple))\n         else tuple([dep_entry.lower()\n                     for dep_entry in dep\n                    ]))\n        for dep in deps\n    ]\n    return deps", "entry_point": "fix_deplist", "input": "['a', 'b', 'c']", "output": "[('a',), ('b',), ('c',)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/graph.py#L10-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036576", "code": "def do_filesizeformat(value, binary=False):\n    \"\"\"Format the value like a 'human-readable' file size (i.e. 13 KB,\n    4.1 MB, 102 bytes, etc).  Per default decimal prefixes are used (mega,\n    giga, etc.), if the second parameter is set to `True` the binary\n    prefixes are used (mebi, gibi).\n    \"\"\"\n    bytes = float(value)\n    base = binary and 1024 or 1000\n    middle = binary and 'i' or ''\n    if bytes < base:\n        return \"%d Byte%s\" % (bytes, bytes != 1 and 's' or '')\n    elif bytes < base * base:\n        return \"%.1f K%sB\" % (bytes / base, middle)\n    elif bytes < base * base * base:\n        return \"%.1f M%sB\" % (bytes / (base * base), middle)\n    return \"%.1f G%sB\" % (bytes / (base * base * base), middle)", "entry_point": "do_filesizeformat", "input": "True, 0", "output": "'1 Byte'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L292-L307", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036577", "code": "def do_int(value, default=0):\n    \"\"\"Convert the value into an integer. If the\n    conversion doesn't work it will return ``0``. You can\n    override this default using the first parameter.\n    \"\"\"\n    try:\n        return int(value)\n    except (TypeError, ValueError):\n        # this quirk is necessary so that \"42.23\"|int gives 42.\n        try:\n            return int(float(value))\n        except (TypeError, ValueError):\n            return default", "entry_point": "do_int", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kivy/python-for-android/blob/8e0e8056bc22e4d5bd3398a6b0301f38ff167933/pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/filters.py#L405-L417", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036578", "code": "def container_def(image, model_data_url=None, env=None):\n    \"\"\"Create a definition for executing a container as part of a SageMaker model.\n\n    Args:\n        image (str): Docker image to run for this container.\n        model_data_url (str): S3 URI of data required by this container,\n            e.g. SageMaker training job model artifacts (default: None).\n        env (dict[str, str]): Environment variables to set inside the container (default: None).\n    Returns:\n        dict[str, str]: A complete container definition object usable with the CreateModel API if passed via\n        `PrimaryContainers` field.\n    \"\"\"\n    if env is None:\n        env = {}\n    c_def = {'Image': image, 'Environment': env}\n    if model_data_url:\n        c_def['ModelDataUrl'] = model_data_url\n    return c_def", "entry_point": "container_def", "input": "[1, 2, 3], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "{'Image': [1, 2, 3], 'Environment': [5, 3, 1, 4], 'ModelDataUrl': ['apple', 'banana', 'cherry']}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/session.py#L1229-L1246", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036579", "code": "def split_string(text, chars_per_string):\n    \"\"\"\n    Splits one string into multiple strings, with a maximum amount of `chars_per_string` characters per string.\n    This is very useful for splitting one giant message into multiples.\n\n    :param text: The text to split\n    :param chars_per_string: The number of characters per line the text is split into.\n    :return: The splitted text as a list of strings.\n    \"\"\"\n    return [text[i:i + chars_per_string] for i in range(0, len(text), chars_per_string)]", "entry_point": "split_string", "input": "('a', 'b', 'c'), -3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/util.py#L186-L195", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036580", "code": "def _is_scope_prefix(scope_name, prefix_name):\n  \"\"\"Checks that `prefix_name` is a proper scope prefix of `scope_name`.\"\"\"\n\n  if not prefix_name:\n    return True\n\n  if not scope_name.endswith(\"/\"):\n    scope_name += \"/\"\n\n  if not prefix_name.endswith(\"/\"):\n    prefix_name += \"/\"\n\n  return scope_name.startswith(prefix_name)", "entry_point": "_is_scope_prefix", "input": "'walnut thistle harbour', 'walnut thistle harbour'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L263-L275", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036581", "code": "def _num_bytes_to_human_readable(num_bytes):\n  \"\"\"Returns human readable string of how much memory `num_bytes` fills.\"\"\"\n  if num_bytes < (2 ** 10):\n    return \"%d B\" % num_bytes\n  elif num_bytes < (2 ** 20):\n    return \"%.3f KB\" % (float(num_bytes) / (2 ** 10))\n  elif num_bytes < (2 ** 30):\n    return \"%.3f MB\" % (float(num_bytes) / (2 ** 20))\n  else:\n    return \"%.3f GB\" % (float(num_bytes) / (2 ** 30))", "entry_point": "_num_bytes_to_human_readable", "input": "-3", "output": "'-3 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L583-L592", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036582", "code": "def metadata_filter_as_dict(metadata_config):\n    \"\"\"Return the metadata filter represented as either None (no filter),\n    or a dictionary with at most two keys: 'additional' and 'excluded',\n    which contain either a list of metadata names, or the string 'all'\"\"\"\n\n    if metadata_config is None:\n        return {}\n\n    if metadata_config is True:\n        return {'additional': 'all'}\n\n    if metadata_config is False:\n        return {'excluded': 'all'}\n\n    if isinstance(metadata_config, dict):\n        assert set(metadata_config) <= set(['additional', 'excluded'])\n        return metadata_config\n\n    metadata_keys = metadata_config.split(',')\n\n    metadata_config = {}\n\n    for key in metadata_keys:\n        key = key.strip()\n        if key.startswith('-'):\n            metadata_config.setdefault('excluded', []).append(key[1:].strip())\n        elif key.startswith('+'):\n            metadata_config.setdefault('additional', []).append(key[1:].strip())\n        else:\n            metadata_config.setdefault('additional', []).append(key)\n\n    for section in metadata_config:\n        if 'all' in metadata_config[section]:\n            metadata_config[section] = 'all'\n        else:\n            metadata_config[section] = [key for key in metadata_config[section] if key]\n\n    return metadata_config", "entry_point": "metadata_filter_as_dict", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/metadata_filter.py#L6-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036583", "code": "def comment_lines(lines, prefix):\n    \"\"\"Return commented lines\"\"\"\n    if not prefix:\n        return lines\n    return [prefix + ' ' + line if line else prefix for line in lines]", "entry_point": "comment_lines", "input": "'Hello World', 'AbC dEf'", "output": "['AbC dEf H', 'AbC dEf e', 'AbC dEf l', 'AbC dEf l', 'AbC dEf o', 'AbC dEf  ', 'AbC dEf W', 'AbC dEf o', 'AbC dEf r', 'AbC dEf l', 'AbC dEf d']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/languages.py#L87-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036584", "code": "def uncomment_line(line, prefix):\n    \"\"\"Remove prefix (and space) from line\"\"\"\n    if not prefix:\n        return line\n    if line.startswith(prefix + ' '):\n        return line[len(prefix) + 1:]\n    if line.startswith(prefix):\n        return line[len(prefix):]\n    return line", "entry_point": "uncomment_line", "input": "'walnut thistle harbour', 'walnut thistle harbour'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/header.py#L40-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036585", "code": "def uncomment(lines, prefix='#'):\n    \"\"\"Remove prefix and space, or only prefix, when possible\"\"\"\n    if not prefix:\n        return lines\n    prefix_and_space = prefix + ' '\n    length_prefix = len(prefix)\n    length_prefix_and_space = len(prefix_and_space)\n    return [line[length_prefix_and_space:] if line.startswith(prefix_and_space)\n            else (line[length_prefix:] if line.startswith(prefix) else line)\n            for line in lines]", "entry_point": "uncomment", "input": "'a,b,c', 'AbC dEf'", "output": "['a', ',', 'b', ',', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/cell_reader.py#L24-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036586", "code": "def identical_format_path(fmt1, fmt2):\n    \"\"\"Do the two (long representation) of formats target the same file?\"\"\"\n    for key in ['extension', 'prefix', 'suffix']:\n        if fmt1.get(key) != fmt2.get(key):\n            return False\n    return True", "entry_point": "identical_format_path", "input": "{}, {'a': 1, 'b': 2}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/formats.py#L357-L362", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036587", "code": "def short_form_one_format(jupytext_format):\n    \"\"\"Represent one jupytext format as a string\"\"\"\n    if not isinstance(jupytext_format, dict):\n        return jupytext_format\n    fmt = jupytext_format['extension']\n    if 'suffix' in jupytext_format:\n        fmt = jupytext_format['suffix'] + fmt\n    elif fmt.startswith('.'):\n        fmt = fmt[1:]\n\n    if 'prefix' in jupytext_format:\n        fmt = jupytext_format['prefix'] + '/' + fmt\n\n    if jupytext_format.get('format_name'):\n        if jupytext_format['extension'] not in ['.md', '.Rmd'] or jupytext_format['format_name'] == 'pandoc':\n            fmt = fmt + ':' + jupytext_format['format_name']\n\n    return fmt", "entry_point": "short_form_one_format", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/formats.py#L483-L500", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036588", "code": "def black_invariant(text, chars=None):\n    \"\"\"Remove characters that may be changed when reformatting the text with black\"\"\"\n    if chars is None:\n        chars = [' ', '\\t', '\\n', ',', \"'\", '\"', '(', ')', '\\\\']\n\n    for char in chars:\n        text = text.replace(char, '')\n    return text", "entry_point": "black_invariant", "input": "'abc', []", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/combine.py#L13-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036589", "code": "def next_instruction_is_function_or_class(lines):\n    \"\"\"Is the first non-empty, non-commented line of the cell either a function or a class?\"\"\"\n    for i, line in enumerate(lines):\n        if not line.strip():  # empty line\n            if i > 0 and not lines[i - 1].strip():\n                return False\n            continue\n        if line.startswith('def ') or line.startswith('class '):\n            return True\n        if line.startswith(('#', '@', ' ')):\n            continue\n        return False\n\n    return False", "entry_point": "next_instruction_is_function_or_class", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/pep8.py#L5-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036590", "code": "def cell_ends_with_code(lines):\n    \"\"\"Is the last line of the cell a line with code?\"\"\"\n    if not lines:\n        return False\n    if not lines[-1].strip():\n        return False\n    if lines[-1].startswith('#'):\n        return False\n    return True", "entry_point": "cell_ends_with_code", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/pep8.py#L47-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036591", "code": "def cell_has_code(lines):\n    \"\"\"Is there any code in this cell?\"\"\"\n    for i, line in enumerate(lines):\n        stripped_line = line.strip()\n        if stripped_line.startswith('#'):\n            continue\n\n        # Two consecutive blank lines?\n        if not stripped_line:\n            if i > 0 and not lines[i - 1].strip():\n                return False\n            continue\n\n        return True\n\n    return False", "entry_point": "cell_has_code", "input": "'walnut thistle harbour'", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mwouts/jupytext/blob/eb7d6aee889f80ad779cfc53441c648f0db9246d/jupytext/pep8.py#L58-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036592", "code": "def format_docstring(contents):\n    \"\"\"Python doc strings come in a number of formats, but LSP wants markdown.\n\n    Until we can find a fast enough way of discovering and parsing each format,\n    we can do a little better by at least preserving indentation.\n    \"\"\"\n    contents = contents.replace('\\t', u'\\u00A0' * 4)\n    contents = contents.replace('  ', u'\\u00A0' * 2)\n    contents = contents.replace('*', '\\\\*')\n    return contents", "entry_point": "format_docstring", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/palantir/python-language-server/blob/96e08d85635382d17024c352306c4759f124195d/pyls/_utils.py#L99-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036593", "code": "def camelize(key):\n    \"\"\"Convert a python_style_variable_name to lowerCamelCase.\n\n    Examples\n    --------\n    >>> camelize('variable_name')\n    'variableName'\n    >>> camelize('variableName')\n    'variableName'\n    \"\"\"\n    return ''.join(x.capitalize() if i > 0 else x\n                   for i, x in enumerate(key.split('_')))", "entry_point": "camelize", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L383-L394", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036594", "code": "def normalize(rendered):\n    \"\"\"Return the input string without non-functional spaces or newlines.\"\"\"\n    out = ''.join([line.strip()\n                   for line in rendered.splitlines()\n                   if line.strip()])\n    out = out.replace(', ', ',')\n    return out", "entry_point": "normalize", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L440-L446", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036595", "code": "def _find_human_readable_labels(synsets, synset_to_human):\n  \"\"\"Build a list of human-readable labels.\n\n  Args:\n    synsets: list of strings; each string is a unique WordNet ID.\n    synset_to_human: dict of synset to human labels, e.g.,\n      'n02119022' --> 'red fox, Vulpes vulpes'\n\n  Returns:\n    List of human-readable strings corresponding to each synset.\n  \"\"\"\n  humans = []\n  for s in synsets:\n    assert s in synset_to_human, ('Failed to find: %s' % s)\n    humans.append(synset_to_human[s])\n  return humans", "entry_point": "_find_human_readable_labels", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/imagenet/inception/data/build_imagenet_data.py#L540-L555", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036596", "code": "def get_config_env_key(k: str) -> str:\n    \"\"\"\n    Returns a scrubbed environment variable key, PULUMI_CONFIG_<k>, that can be used for\n    setting explicit varaibles.  This is unlike PULUMI_CONFIG which is just a JSON-serialized bag.\n    \"\"\"\n    env_key = ''\n    for c in k:\n        if c == '_' or 'A' <= c <= 'Z' or '0' <= c <= '9':\n            env_key += c\n        elif 'a' <= c <= 'z':\n            env_key += c.upper()\n        else:\n            env_key += '_'\n    return 'PULUMI_CONFIG_%s' % env_key", "entry_point": "get_config_env_key", "input": "[]", "output": "'PULUMI_CONFIG_'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pulumi/pulumi/blob/95d51efe6ab9a533838b6d83aa240b5f912e72aa/sdk/python/lib/pulumi/runtime/config.py#L44-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036597", "code": "def _to_hours_mins_secs(time_taken):\n    \"\"\"Convert seconds to hours, mins, and seconds.\"\"\"\n    mins, secs = divmod(time_taken, 60)\n    hours, mins = divmod(mins, 60)\n    return hours, mins, secs", "entry_point": "_to_hours_mins_secs", "input": "5", "output": "(0, 0, 5)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pytorch/ignite/blob/a96bd07cb58822cfb39fd81765135712f1db41ca/ignite/_utils.py#L6-L10", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036598", "code": "def make_cookie_values(cj, class_name):\n    \"\"\"\n    Makes a string of cookie keys and values.\n    Can be used to set a Cookie header.\n    \"\"\"\n    path = \"/\" + class_name\n\n    cookies = [c.name + '=' + c.value\n               for c in cj\n               if c.domain == \"class.coursera.org\"\n               and c.path == path]\n\n    return '; '.join(cookies)", "entry_point": "make_cookie_values", "input": "[], 'abc'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/coursera-dl/coursera-dl/blob/9b434bcf3c4011bf3181429fe674633ae5fb7d4d/coursera/cookies.py#L243-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036599", "code": "def unquote_header_value(value, is_filename=False):\n    r\"\"\"Unquotes a header value.  (Reversal of :func:`quote_header_value`).\n    This does not use the real unquoting but what browsers are actually\n    using for quoting.\n\n    .. versionadded:: 0.5\n\n    :param value: the header value to unquote.\n    \"\"\"\n    if value and value[0] == value[-1] == '\"':\n        # this is not the real unquoting, but fixing this so that the\n        # RFC is met will result in bugs with internet explorer and\n        # probably some other browsers as well.  IE for example is\n        # uploading files with \"C:\\foo\\bar.txt\" as filename\n        value = value[1:-1]\n\n        # if this is a filename and the starting characters look like\n        # a UNC path, then just return the value without quotes.  Using the\n        # replace sequence below on a UNC path has the effect of turning\n        # the leading double slash into a single slash and then\n        # _fix_ie_filename() doesn't work correctly.  See #458.\n        if not is_filename or value[:2] != \"\\\\\\\\\":\n            return value.replace(\"\\\\\\\\\", \"\\\\\").replace('\\\\\"', '\"')\n    return value", "entry_point": "unquote_header_value", "input": "[5, 3, 1, 4], 'walnut thistle harbour'", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pallets/werkzeug/blob/a220671d66755a94630a212378754bb432811158/src/werkzeug/http.py#L235-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036600", "code": "def is_byte_range_valid(start, stop, length):\n    \"\"\"Checks if a given byte content range is valid for the given length.\n\n    .. versionadded:: 0.7\n    \"\"\"\n    if (start is None) != (stop is None):\n        return False\n    elif start is None:\n        return length is None or length >= 0\n    elif length is None:\n        return 0 <= start < stop\n    elif start >= stop:\n        return False\n    return 0 <= start < length", "entry_point": "is_byte_range_valid", "input": "[[1, 2], [3], []], [], 2", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pallets/werkzeug/blob/a220671d66755a94630a212378754bb432811158/src/werkzeug/http.py#L1222-L1235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036601", "code": "def _line_parse(line):\n    \"\"\"Removes line ending characters and returns a tuple (`stripped_line`,\n    `is_terminated`).\n    \"\"\"\n    if line[-2:] in [\"\\r\\n\", b\"\\r\\n\"]:\n        return line[:-2], True\n    elif line[-1:] in [\"\\r\", \"\\n\", b\"\\r\", b\"\\n\"]:\n        return line[:-1], True\n    return line, False", "entry_point": "_line_parse", "input": "'  padded  '", "output": "('  padded  ', False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pallets/werkzeug/blob/a220671d66755a94630a212378754bb432811158/src/werkzeug/formparser.py#L279-L287", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036602", "code": "def is_instance_or_subclass(val, class_):\n    \"\"\"Return True if ``val`` is either a subclass or instance of ``class_``.\"\"\"\n    try:\n        return issubclass(val, class_)\n    except TypeError:\n        return isinstance(val, class_)", "entry_point": "is_instance_or_subclass", "input": "0.5, ()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marshmallow-code/marshmallow/blob/a6b6c4151f1fbf16f3774d4052ca2bddf6903750/src/marshmallow/utils.py#L72-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036603", "code": "def extract_from_dict(data, path):\n    \"\"\"\n    Navigate `data`, a multidimensional array (list or dictionary), and returns\n    the object at `path`.\n    \"\"\"\n    value = data\n    try:\n        for key in path:\n            value = value[key]\n        return value\n    except (KeyError, IndexError, TypeError):\n        return ''", "entry_point": "extract_from_dict", "input": "['a', 'b', 'c'], 'Hello World'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pennersr/django-allauth/blob/f70cb3d622f992f15fe9b57098e0b328445b664e/allauth/socialaccount/providers/orcid/provider.py#L44-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036604", "code": "def unpack(value):\n    \"\"\"Return a three tuple of data, code, and headers\"\"\"\n    if not isinstance(value, tuple):\n        return value, 200, {}\n\n    try:\n        data, code, headers = value\n        return data, code, headers\n    except ValueError:\n        pass\n\n    try:\n        data, code = value\n        return data, code, {}\n    except ValueError:\n        pass\n\n    return value, 200, {}", "entry_point": "unpack", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3], []], 200, {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/utils/__init__.py#L18-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036605", "code": "def wid_to_gid(wid):\n    \"\"\"Calculate gid of a worksheet from its wid.\"\"\"\n    widval = wid[1:] if len(wid) > 3 else wid\n    xorval = 474 if len(wid) > 3 else 31578\n    return str(int(widval, 36) ^ xorval)", "entry_point": "wid_to_gid", "input": "'  padded  '", "output": "'1529074383'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/utils.py#L202-L206", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036606", "code": "def tau_rand_int(state):\n    \"\"\"A fast (pseudo)-random number generator.\n\n    Parameters\n    ----------\n    state: array of int64, shape (3,)\n        The internal state of the rng\n\n    Returns\n    -------\n    A (pseudo)-random int32 value\n    \"\"\"\n    state[0] = (((state[0] & 4294967294) << 12) & 0xffffffff) ^ (\n        (((state[0] << 13) & 0xffffffff) ^ state[0]) >> 19\n    )\n    state[1] = (((state[1] & 4294967288) << 4) & 0xffffffff) ^ (\n        (((state[1] << 2) & 0xffffffff) ^ state[1]) >> 25\n    )\n    state[2] = (((state[2] & 4294967280) << 17) & 0xffffffff) ^ (\n        (((state[2] << 3) & 0xffffffff) ^ state[2]) >> 11\n    )\n\n    return state[0] ^ state[1] ^ state[2]", "entry_point": "tau_rand_int", "input": "[5, 3, 1, 4]", "output": "16384", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lmcinnes/umap/blob/bbb01c03ba49f7bff8f77fd662d00e50d6686c77/umap/utils.py#L12-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036607", "code": "def dedup_list(l):\n    \"\"\"Given a list (l) will removing duplicates from the list,\n       preserving the original order of the list. Assumes that\n       the list entrie are hashable.\"\"\"\n    dedup = set()\n    return [ x for x in l if not (x in dedup or dedup.add(x))]", "entry_point": "dedup_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lark-parser/lark/blob/a798dec77907e74520dd7e90c7b6a4acc680633a/lark/utils.py#L182-L187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036608", "code": "def _is_contiguous(positions):\n    \"\"\"Given a non-empty list, does it consist of contiguous integers?\"\"\"\n    previous = positions[0]\n    for current in positions[1:]:\n        if current != previous + 1:\n            return False\n        previous = current\n    return True", "entry_point": "_is_contiguous", "input": "[-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nputils.py#L90-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036609", "code": "def format_hsl(hsl_color):\n    # type: (_HSL_COLOR) -> str\n    \"\"\" Format hsl color as css color string.\n    \"\"\"\n    hue, saturation, lightness = hsl_color\n    return 'hsl({}, {:.2%}, {:.2%})'.format(hue, saturation, lightness)", "entry_point": "format_hsl", "input": "[1, 2, 3]", "output": "'hsl(1, 200.00%, 300.00%)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/formatters/html.py#L239-L244", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036610", "code": "def _all_feature_names(name):\n    # type: (Union[str, bytes, List[Dict]]) -> List[str]\n    \"\"\" All feature names for a feature: usually just the feature itself,\n    but can be several features for unhashed features with collisions.\n    \"\"\"\n    if isinstance(name, bytes):\n        return [name.decode('utf8')]\n    elif isinstance(name, list):\n        return [x['name'] for x in name]\n    else:\n        return [name]", "entry_point": "_all_feature_names", "input": "'Hello World'", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/_feature_names.py#L182-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036611", "code": "def _get_value_indices(names1, names2, lookups):\n    \"\"\"\n    >>> _get_value_indices(['foo', 'bar', 'baz'], ['foo', 'bar', 'baz'],\n    ...                    ['bar', 'foo'])\n    [1, 0]\n    >>> _get_value_indices(['foo', 'bar', 'baz'], ['FOO', 'bar', 'baz'],\n    ...                    ['bar', 'FOO'])\n    [1, 0]\n    >>> _get_value_indices(['foo', 'bar', 'BAZ'], ['foo', 'BAZ', 'baz'],\n    ...                    ['BAZ', 'foo'])\n    [2, 0]\n    >>> _get_value_indices(['foo', 'bar', 'baz'], ['foo', 'bar', 'baz'],\n    ...                    ['spam'])\n    Traceback (most recent call last):\n    ...\n    KeyError: 'spam'\n    \"\"\"\n    positions = {name: idx for idx, name in enumerate(names2)}\n    positions.update({name: idx for idx, name in enumerate(names1)})\n    return [positions[name] for name in lookups]", "entry_point": "_get_value_indices", "input": "'walnut thistle harbour', 'AbC dEf', {'a': 1, 'b': 2}", "output": "[16, 18]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/utils.py#L213-L232", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036612", "code": "def _format_array(x, fmt):\n    # type: (Any, str) -> str\n    \"\"\"\n    >>> _format_array([0, 1.0], \"{:0.3f}\")\n    '[0.000, 1.000]'\n    \"\"\"\n    value_repr = \", \".join(fmt.format(v) for v in x)\n    return \"[{}]\".format(value_repr)", "entry_point": "_format_array", "input": "[], [5, 3, 1, 4]", "output": "'[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/formatters/trees.py#L68-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036613", "code": "def decode_polyline(polyline):\n    \"\"\"Decodes a Polyline string into a list of lat/lng dicts.\n\n    See the developer docs for a detailed description of this encoding:\n    https://developers.google.com/maps/documentation/utilities/polylinealgorithm\n\n    :param polyline: An encoded polyline\n    :type polyline: string\n\n    :rtype: list of dicts with lat/lng keys\n    \"\"\"\n    points = []\n    index = lat = lng = 0\n\n    while index < len(polyline):\n        result = 1\n        shift = 0\n        while True:\n            b = ord(polyline[index]) - 63 - 1\n            index += 1\n            result += b << shift\n            shift += 5\n            if b < 0x1f:\n                break\n        lat += (~result >> 1) if (result & 1) != 0 else (result >> 1)\n\n        result = 1\n        shift = 0\n        while True:\n            b = ord(polyline[index]) - 63 - 1\n            index += 1\n            result += b << shift\n            shift += 5\n            if b < 0x1f:\n                break\n        lng += ~(result >> 1) if (result & 1) != 0 else (result >> 1)\n\n        points.append({\"lat\": lat * 1e-5, \"lng\": lng * 1e-5})\n\n    return points", "entry_point": "decode_polyline", "input": "'  padded  '", "output": "[{'lat': 0.00015000000000000001, 'lng': 0.00015000000000000001}, {'lat': 165558.81958, 'lng': 0.00030000000000000003}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L280-L319", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036614", "code": "def hashable(data, v):\n    \"\"\"Determine whether `v` can be hashed.\"\"\"\n    try:\n        data[v]\n    except (TypeError, KeyError, IndexError):\n        return False\n    return True", "entry_point": "hashable", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L110-L116", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036615", "code": "def _process_cmap(cmap):\n    '''\n    Returns a kwarg dict suitable for a ColorScale\n    '''\n    option = {}\n    if isinstance(cmap, str):\n        option['scheme'] = cmap\n    elif isinstance(cmap, list):\n        option['colors'] = cmap\n    else:\n        raise ValueError('''`cmap` must be a string (name of a color scheme)\n                         or a list of colors, but a value of {} was given\n                         '''.format(cmap))\n    return option", "entry_point": "_process_cmap", "input": "[5, 3, 1, 4]", "output": "{'colors': [5, 3, 1, 4]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L552-L565", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036616", "code": "def serialize_bytes(data):\n        \"\"\"Write bytes by using Telegram guidelines\"\"\"\n        if not isinstance(data, bytes):\n            if isinstance(data, str):\n                data = data.encode('utf-8')\n            else:\n                raise TypeError(\n                    'bytes or str expected, not {}'.format(type(data)))\n\n        r = []\n        if len(data) < 254:\n            padding = (len(data) + 1) % 4\n            if padding != 0:\n                padding = 4 - padding\n\n            r.append(bytes([len(data)]))\n            r.append(data)\n\n        else:\n            padding = len(data) % 4\n            if padding != 0:\n                padding = 4 - padding\n\n            r.append(bytes([\n                254,\n                len(data) % 256,\n                (len(data) >> 8) % 256,\n                (len(data) >> 16) % 256\n            ]))\n            r.append(data)\n\n        r.append(bytes(padding))\n        return b''.join(r)", "entry_point": "serialize_bytes", "input": "'a,b,c'", "output": "b'\\x05a,b,c\\x00\\x00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/tlobject.py#L88-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036617", "code": "def get_byte_array(integer):\n    \"\"\"Return the variable length bytes corresponding to the given int\"\"\"\n    # Operate in big endian (unlike most of Telegram API) since:\n    # > \"...pq is a representation of a natural number\n    #    (in binary *big endian* format)...\"\n    # > \"...current value of dh_prime equals\n    #    (in *big-endian* byte order)...\"\n    # Reference: https://core.telegram.org/mtproto/auth_key\n    return int.to_bytes(\n        integer,\n        (integer.bit_length() + 8 - 1) // 8,  # 8 bits per byte,\n        byteorder='big',\n        signed=False\n    )", "entry_point": "get_byte_array", "input": "True", "output": "b'\\x01'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/rsa.py#L21-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036618", "code": "def get_int(byte_array, signed=True):\n    \"\"\"\n    Gets the specified integer from its byte array.\n    This should be used by this module alone, as it works with big endian.\n\n    :param byte_array: the byte array representing th integer.\n    :param signed: whether the number is signed or not.\n    :return: the integer representing the given byte array.\n    \"\"\"\n    return int.from_bytes(byte_array, byteorder='big', signed=signed)", "entry_point": "get_int", "input": "[], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/network/authenticator.py#L172-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036619", "code": "def gcd(a, b):\n        \"\"\"\n        Calculates the Greatest Common Divisor.\n\n        :param a: the first number.\n        :param b: the second number.\n        :return: GCD(a, b)\n        \"\"\"\n        while b:\n            a, b = b, a % b\n\n        return a", "entry_point": "gcd", "input": "False, 3.25", "output": "3.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/factorization.py#L54-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036620", "code": "def get_message_id(message):\n    \"\"\"Similar to :meth:`get_input_peer`, but for message IDs.\"\"\"\n    if message is None:\n        return None\n\n    if isinstance(message, int):\n        return message\n\n    try:\n        if message.SUBCLASS_OF_ID == 0x790009e3:\n            # hex(crc32(b'Message')) = 0x790009e3\n            return message.id\n    except AttributeError:\n        pass\n\n    raise TypeError('Invalid message type: {}'.format(type(message)))", "entry_point": "get_message_id", "input": "1", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/utils.py#L472-L487", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036621", "code": "def _rle_decode(data):\n    \"\"\"\n    Decodes run-length-encoded `data`.\n    \"\"\"\n    if not data:\n        return data\n\n    new = b''\n    last = b''\n    for cur in data:\n        if last == b'\\0':\n            new += last * cur\n            last = b''\n        else:\n            new += last\n            last = bytes([cur])\n\n    return new + last", "entry_point": "_rle_decode", "input": "[1, 2, 3]", "output": "b'\\x01\\x02\\x03'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/utils.py#L851-L868", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036622", "code": "def strip_text(text, entities):\n    \"\"\"\n    Strips whitespace from the given text modifying the provided entities.\n\n    This assumes that there are no overlapping entities, that their length\n    is greater or equal to one, and that their length is not out of bounds.\n    \"\"\"\n    if not entities:\n        return text.strip()\n\n    while text and text[-1].isspace():\n        e = entities[-1]\n        if e.offset + e.length == len(text):\n            if e.length == 1:\n                del entities[-1]\n                if not entities:\n                    return text.strip()\n            else:\n                e.length -= 1\n        text = text[:-1]\n\n    while text and text[0].isspace():\n        for i in reversed(range(len(entities))):\n            e = entities[i]\n            if e.offset != 0:\n                e.offset -= 1\n                continue\n\n            if e.length == 1:\n                del entities[0]\n                if not entities:\n                    return text.lstrip()\n            else:\n                e.length -= 1\n\n        text = text[1:]\n\n    return text", "entry_point": "strip_text", "input": "'a,b,c', ['a', 'b', 'c']", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/helpers.py#L36-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036623", "code": "def parse_bool(value):\n    \"\"\"\n    >>> parse_bool(1)\n    True\n    >>> parse_bool('off')\n    False\n    >>> parse_bool('foo')\n    \"\"\"\n    value = str(value).lower()\n    if value in ('on', 'true', 'yes', '1'):\n        return True\n    if value in ('off', 'false', 'no', '0'):\n        return False", "entry_point": "parse_bool", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zalando/patroni/blob/f6d29081c90af52064b981cdd877a07338d86038/patroni/utils.py#L61-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036624", "code": "def strtol(value, strict=True):\n    \"\"\"As most as possible close equivalent of strtol(3) function (with base=0),\n       used by postgres to parse parameter values.\n    >>> strtol(0) == (0, '')\n    True\n    >>> strtol(1) == (1, '')\n    True\n    >>> strtol(9) == (9, '')\n    True\n    >>> strtol(' +0x400MB') == (1024, 'MB')\n    True\n    >>> strtol(' -070d') == (-56, 'd')\n    True\n    >>> strtol(' d ') == (None, 'd')\n    True\n    >>> strtol('9s', False) == (9, 's')\n    True\n    >>> strtol(' s ', False) == (1, 's')\n    True\n    \"\"\"\n    value = str(value).strip()\n    ln = len(value)\n    i = 0\n    # skip sign:\n    if i < ln and value[i] in ('-', '+'):\n        i += 1\n\n    # we always expect to get digit in the beginning\n    if i < ln and value[i].isdigit():\n        if value[i] == '0':\n            i += 1\n            if i < ln and value[i] in ('x', 'X'):  # '0' followed by 'x': HEX\n                base = 16\n                i += 1\n            else:  # just starts with '0': OCT\n                base = 8\n        else:  # any other digit: DEC\n            base = 10\n\n        ret = None\n        while i <= ln:\n            try:  # try to find maximally long number\n                i += 1  # by giving to `int` longer and longer strings\n                ret = int(value[:i], base)\n            except ValueError:  # until we will not get an exception or end of the string\n                i -= 1\n                break\n        if ret is not None:  # yay! there is a number in the beginning of the string\n            return ret, value[i:].strip()  # return the number and the \"rest\"\n\n    return (None if strict else 1), value.strip()", "entry_point": "strtol", "input": "['a', 'b', 'c'], True", "output": "(None, \"['a', 'b', 'c']\")", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zalando/patroni/blob/f6d29081c90af52064b981cdd877a07338d86038/patroni/utils.py#L76-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036625", "code": "def semiflatten(multi):\n    \"\"\"Convert a MutiDict into a regular dict. If there are more than one value\n    for a key, the result will have a list of values for the key. Otherwise it\n    will have the plain value.\"\"\"\n    if multi:\n        result = multi.to_dict(flat=False)\n        for k, v in result.items():\n            if len(v) == 1:\n                result[k] = v[0]\n        return result\n    else:\n        return multi", "entry_point": "semiflatten", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/postmanlabs/httpbin/blob/f8ec666b4d1b654e4ff6aedd356f510dcac09f83/httpbin/helpers.py#L142-L153", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036626", "code": "def __parse_request_range(range_header_text):\n    \"\"\" Return a tuple describing the byte range requested in a GET request\n    If the range is open ended on the left or right side, then a value of None\n    will be set.\n    RFC7233: http://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7233.html#header.range\n    Examples:\n      Range : bytes=1024-\n      Range : bytes=10-20\n      Range : bytes=-999\n    \"\"\"\n\n    left = None\n    right = None\n\n    if not range_header_text:\n        return left, right\n\n    range_header_text = range_header_text.strip()\n    if not range_header_text.startswith('bytes'):\n        return left, right\n\n    components = range_header_text.split(\"=\")\n    if len(components) != 2:\n        return left, right\n\n    components = components[1].split(\"-\")\n\n    try:\n        right = int(components[1])\n    except:\n        pass\n\n    try:\n        left = int(components[0])\n    except:\n        pass\n\n    return left, right", "entry_point": "__parse_request_range", "input": "'  padded  '", "output": "(None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/postmanlabs/httpbin/blob/f8ec666b4d1b654e4ff6aedd356f510dcac09f83/httpbin/helpers.py#L376-L413", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036627", "code": "def check_split_ratio(split_ratio):\n    \"\"\"Check that the split ratio argument is not malformed\"\"\"\n    valid_ratio = 0.\n    if isinstance(split_ratio, float):\n        # Only the train set relative ratio is provided\n        # Assert in bounds, validation size is zero\n        assert 0. < split_ratio < 1., (\n            \"Split ratio {} not between 0 and 1\".format(split_ratio))\n\n        test_ratio = 1. - split_ratio\n        return (split_ratio, test_ratio, valid_ratio)\n    elif isinstance(split_ratio, list):\n        # A list of relative ratios is provided\n        length = len(split_ratio)\n        assert length == 2 or length == 3, (\n            \"Length of split ratio list should be 2 or 3, got {}\".format(split_ratio))\n\n        # Normalize if necessary\n        ratio_sum = sum(split_ratio)\n        if not ratio_sum == 1.:\n            split_ratio = [float(ratio) / ratio_sum for ratio in split_ratio]\n\n        if length == 2:\n            return tuple(split_ratio + [valid_ratio])\n        return tuple(split_ratio)\n    else:\n        raise ValueError('Split ratio must be float or a list, got {}'\n                         .format(type(split_ratio)))", "entry_point": "check_split_ratio", "input": "0.5", "output": "(0.5, 0.5, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pytorch/text/blob/26bfce6869dc704f1d86792f9a681d453d7e7bb8/torchtext/data/dataset.py#L284-L311", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036628", "code": "def format_step(step, zero_prefix=False):\n    \"\"\"Return the step value in format suitable for display.\"\"\"\n    if isinstance(step, int):\n        return \"{:06}\".format(step) if zero_prefix else \"{}\".format(step)\n    elif isinstance(step, tuple):\n        return \"{:04}:{:06}\".format(*step) if zero_prefix else \"{}:{}\".format(*step)", "entry_point": "format_step", "input": "True, ['a', 'b', 'c']", "output": "'000001'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/waleedka/hiddenlayer/blob/294f8732b271cbdd6310c55bdf5ce855cbf61c75/hiddenlayer/history.py#L27-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036629", "code": "def size_of_varint(value):\n    \"\"\" Number of bytes needed to encode an integer in variable-length format.\n    \"\"\"\n    value = (value << 1) ^ (value >> 63)\n    if value <= 0x7f:\n        return 1\n    if value <= 0x3fff:\n        return 2\n    if value <= 0x1fffff:\n        return 3\n    if value <= 0xfffffff:\n        return 4\n    if value <= 0x7ffffffff:\n        return 5\n    if value <= 0x3ffffffffff:\n        return 6\n    if value <= 0x1ffffffffffff:\n        return 7\n    if value <= 0xffffffffffffff:\n        return 8\n    if value <= 0x7fffffffffffffff:\n        return 9\n    return 10", "entry_point": "size_of_varint", "input": "5", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dpkp/kafka-python/blob/f6a8a38937688ea2cc5dc13d3d1039493be5c9b5/kafka/record/util.py#L63-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036630", "code": "def get_items_as_list(items,keys,items_names='styles'):\n\t\"\"\"\n\tReturns a dict with an item per key\n\n\tParameters:\n\t-----------\n\t\titems : string, list or dict\n\t\t\tItems (ie line styles)\n\t\tkeys: list \n\t\t\tList of keys\n\t\titems_names : string\n\t\t\tName of items \n\t\"\"\"\n\tif type(items)!=dict:\n\t\tif type(items)==list:\n\t\t\tif len(items)!=len(keys):\n\t\t\t\traise Exception('List of {0} is not the same length as keys'.format(items_names))\n\t\t\telse:\n\t\t\t\titems=dict(zip(keys,items))\n\t\telse:\n\t\t\titems=dict(zip(keys,[items]*len(keys)))\n\treturn items", "entry_point": "get_items_as_list", "input": "[1, 2, 3], ['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "{'a': 1, 'b': 2, 'c': 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L1234-L1255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036631", "code": "def inverseDict(d):\n\t\"\"\"\n\tReturns a dictionay indexed by values {value_k:key_k}\n\tParameters:\n\t-----------\n\t\td : dictionary\n\t\"\"\"\n\tdt={}\n\tfor k,v in list(d.items()):\n\t\tif type(v) in (list,tuple):\n\t\t\tfor i in v:\n\t\t\t\tdt[i]=k\n\t\telse:\n\t\t\tdt[v]=k\n\treturn dt", "entry_point": "inverseDict", "input": "{'a': 1, 'b': 2}", "output": "{1: 'a', 2: 'b'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L111-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036632", "code": "def rgb_color_list_to_hex(color_list):\n    \"\"\"\n    Convert a list of RGBa colors to a list of hexadecimal color codes.\n\n    Parameters\n    ----------\n    color_list : list\n        the list of RGBa colors\n\n    Returns\n    -------\n    color_list_hex : list\n    \"\"\"\n    color_list_rgb = [[int(x*255) for x in c[0:3]] for c in color_list]\n    color_list_hex = ['#{:02X}{:02X}{:02X}'.format(rgb[0], rgb[1], rgb[2]) for rgb in color_list_rgb]\n    return color_list_hex", "entry_point": "rgb_color_list_to_hex", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gboeing/osmnx/blob/be59fd313bcb68af8fc79242c56194f1247e26e2/osmnx/plot.py#L100-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036633", "code": "def _has_sorted_sa_indices(s_indices, a_indices):\n    \"\"\"\n    Check whether `s_indices` and `a_indices` are sorted in\n    lexicographic order.\n\n    Parameters\n    ----------\n    s_indices, a_indices : ndarray(ndim=1)\n\n    Returns\n    -------\n    bool\n        Whether `s_indices` and `a_indices` are sorted.\n\n    \"\"\"\n    L = len(s_indices)\n    for i in range(L-1):\n        if s_indices[i] > s_indices[i+1]:\n            return False\n        if s_indices[i] == s_indices[i+1]:\n            if a_indices[i] >= a_indices[i+1]:\n                return False\n    return True", "entry_point": "_has_sorted_sa_indices", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QuantEcon/QuantEcon.py/blob/26a66c552f2a73967d7efb6e1f4b4c4985a12643/quantecon/markov/ddp.py#L1074-L1096", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036634", "code": "def _get_action_profile(x, indptr):\n    \"\"\"\n    Obtain a tuple of mixed actions from a flattened action profile.\n\n    Parameters\n    ----------\n    x : array_like(float, ndim=1)\n        Array of flattened mixed action profile of length equal to n_0 +\n        ... + n_N-1, where `out[indptr[i]:indptr[i+1]]` contains player\n        i's mixed action.\n\n    indptr : array_like(int, ndim=1)\n        Array of index pointers of length N+1, where `indptr[0] = 0` and\n        `indptr[i+1] = indptr[i] + n_i`.\n\n    Returns\n    -------\n    action_profile : tuple(ndarray(float, ndim=1))\n        Tuple of N mixed actions, each of length n_i.\n\n    \"\"\"\n    N = len(indptr) - 1\n    action_profile = tuple(x[indptr[i]:indptr[i+1]] for i in range(N))\n    return action_profile", "entry_point": "_get_action_profile", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "(['banana'], ['cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QuantEcon/QuantEcon.py/blob/26a66c552f2a73967d7efb6e1f4b4c4985a12643/quantecon/game_theory/mclennan_tourky.py#L236-L259", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036635", "code": "def next_k_array(a):\n    \"\"\"\n    Given an array `a` of k distinct nonnegative integers, sorted in\n    ascending order, return the next k-array in the lexicographic\n    ordering of the descending sequences of the elements [1]_. `a` is\n    modified in place.\n\n    Parameters\n    ----------\n    a : ndarray(int, ndim=1)\n        Array of length k.\n\n    Returns\n    -------\n    a : ndarray(int, ndim=1)\n        View of `a`.\n\n    Examples\n    --------\n    Enumerate all the subsets with k elements of the set {0, ..., n-1}.\n\n    >>> n, k = 4, 2\n    >>> a = np.arange(k)\n    >>> while a[-1] < n:\n    ...     print(a)\n    ...     a = next_k_array(a)\n    ...\n    [0 1]\n    [0 2]\n    [1 2]\n    [0 3]\n    [1 3]\n    [2 3]\n\n    References\n    ----------\n    .. [1] `Combinatorial number system\n       <https://en.wikipedia.org/wiki/Combinatorial_number_system>`_,\n       Wikipedia.\n\n    \"\"\"\n    # Logic taken from Algotirhm T in D. Knuth, The Art of Computer\n    # Programming, Section 7.2.1.3 \"Generating All Combinations\".\n    k = len(a)\n    if k == 1 or a[0] + 1 < a[1]:\n        a[0] += 1\n        return a\n\n    a[0] = 0\n    i = 1\n    x = a[i] + 1\n\n    while i < k-1 and x == a[i+1]:\n        i += 1\n        a[i-1] = i - 1\n        x = a[i] + 1\n    a[i] = x\n\n    return a", "entry_point": "next_k_array", "input": "[5, 3, 1, 4]", "output": "[0, 4, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QuantEcon/QuantEcon.py/blob/26a66c552f2a73967d7efb6e1f4b4c4985a12643/quantecon/util/combinatorics.py#L12-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036636", "code": "def searchsorted(a, v):\n    \"\"\"\n    Custom version of np.searchsorted. Return the largest index `i` such\n    that `a[i-1] <= v < a[i]` (for `i = 0`, `v < a[0]`); if `v[n-1] <=\n    v`, return `n`, where `n = len(a)`.\n\n    Parameters\n    ----------\n    a : ndarray(float, ndim=1)\n        Input array. Must be sorted in ascending order.\n\n    v : scalar(float)\n        Value to be compared with elements of `a`.\n\n    Returns\n    -------\n    scalar(int)\n        Largest index `i` such that `a[i-1] <= v < a[i]`, or len(a) if\n        no such index exists.\n\n    Notes\n    -----\n    This routine is jit-complied if the module Numba is vailable; if\n    not, it is an alias of np.searchsorted(a, v, side='right').\n\n    Examples\n    --------\n    >>> a = np.array([0.2, 0.4, 1.0])\n    >>> searchsorted(a, 0.1)\n    0\n    >>> searchsorted(a, 0.4)\n    2\n    >>> searchsorted(a, 2)\n    3\n\n    \"\"\"\n    lo = -1\n    hi = len(a)\n    while(lo < hi-1):\n        m = (lo + hi) // 2\n        if v < a[m]:\n            hi = m\n        else:\n            lo = m\n    return hi", "entry_point": "searchsorted", "input": "[], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/QuantEcon/QuantEcon.py/blob/26a66c552f2a73967d7efb6e1f4b4c4985a12643/quantecon/util/array.py#L18-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036637", "code": "def _is_pod_metric(labels):\n        \"\"\"\n        Return whether a metric is about a pod or not.\n        It can be about containers, pods, or higher levels in the cgroup hierarchy\n        and we don't want to report on that.\n        :param metric\n        :return bool\n        \"\"\"\n        if 'container_name' in labels:\n            if labels['container_name'] == 'POD':\n                return True\n            # containerd does not report container_name=\"POD\"\n            elif labels['container_name'] == '' and labels.get('pod_name', False):\n                return True\n        # container_cpu_usage_seconds_total has an id label that is a cgroup path\n        # eg: /kubepods/burstable/pod531c80d9-9fc4-11e7-ba8b-42010af002bb\n        # FIXME: this was needed because of a bug:\n        # https://github.com/kubernetes/kubernetes/pull/51473\n        # starting from k8s 1.8 we can remove this\n        if 'id' in labels:\n            if labels['id'].split('/')[-1].startswith('pod'):\n                return True\n        return False", "entry_point": "_is_pod_metric", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L117-L139", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036638", "code": "def _convert_write_result(operation, command, result):\n    \"\"\"Convert a legacy write result to write commmand format.\"\"\"\n\n    # Based on _merge_legacy from bulk.py\n    affected = result.get(\"n\", 0)\n    res = {\"ok\": 1, \"n\": affected}\n    errmsg = result.get(\"errmsg\", result.get(\"err\", \"\"))\n    if errmsg:\n        # The write was successful on at least the primary so don't return.\n        if result.get(\"wtimeout\"):\n            res[\"writeConcernError\"] = {\"errmsg\": errmsg,\n                                        \"code\": 64,\n                                        \"errInfo\": {\"wtimeout\": True}}\n        else:\n            # The write failed.\n            error = {\"index\": 0,\n                     \"code\": result.get(\"code\", 8),\n                     \"errmsg\": errmsg}\n            if \"errInfo\" in result:\n                error[\"errInfo\"] = result[\"errInfo\"]\n            res[\"writeErrors\"] = [error]\n            return res\n    if operation == \"insert\":\n        # GLE result for insert is always 0 in most MongoDB versions.\n        res[\"n\"] = len(command['documents'])\n    elif operation == \"update\":\n        if \"upserted\" in result:\n            res[\"upserted\"] = [{\"index\": 0, \"_id\": result[\"upserted\"]}]\n        # Versions of MongoDB before 2.6 don't return the _id for an\n        # upsert if _id is not an ObjectId.\n        elif result.get(\"updatedExisting\") is False and affected == 1:\n            # If _id is in both the update document *and* the query spec\n            # the update document _id takes precedence.\n            update = command['updates'][0]\n            _id = update[\"u\"].get(\"_id\", update[\"q\"].get(\"_id\"))\n            res[\"upserted\"] = [{\"index\": 0, \"_id\": _id}]\n    return res", "entry_point": "_convert_write_result", "input": "0.5, {'x': [1, 2], 'y': []}, {'x': [1, 2], 'y': []}", "output": "{'ok': 1, 'n': 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/message.py#L99-L135", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036639", "code": "def get_attributes(obj):\n    \"\"\"\n    the json objects look like this:\n    {\n    \"objType\": {\n      \"attributes\": {\n      ...\n      }\n    }\n    It always has the attributes nested below the object type\n    This helper provides a way of getting at the attributes\n    \"\"\"\n    if not obj or type(obj) is not dict:\n        return {}\n\n    keys = list(obj.keys())\n    if len(keys) > 0:\n        key = keys[0]\n    else:\n        return {}\n    key_obj = obj.get(key, {})\n    if type(key_obj) is not dict:\n        # if the object is not a dict\n        # it is probably already scoped to attributes\n        return obj\n    if key != \"attributes\":\n        attrs = key_obj.get('attributes')\n        if type(attrs) is not dict:\n            # if the attributes doesn't exist,\n            # it is probably already scoped to attributes\n            return obj\n    else:\n        # if the attributes exist, we return the value, except if it's not a dict type\n        attrs = key_obj\n        if type(attrs) is not dict:\n            return obj\n\n    return attrs", "entry_point": "get_attributes", "input": "['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/cisco_aci/datadog_checks/cisco_aci/helpers.py#L153-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036640", "code": "def validate_positive_float(option, value):\n    \"\"\"Validates that 'value' is a float, or can be converted to one, and is\n       positive.\n    \"\"\"\n    errmsg = \"%s must be an integer or float\" % (option,)\n    try:\n        value = float(value)\n    except ValueError:\n        raise ValueError(errmsg)\n    except TypeError:\n        raise TypeError(errmsg)\n\n    # float('inf') doesn't work in 2.4 or 2.5 on Windows, so just cap floats at\n    # one billion - this is a reasonable approximation for infinity\n    if not 0 < value < 1e9:\n        raise ValueError(\"%s must be greater than 0 and \"\n                         \"less than one billion\" % (option,))\n    return value", "entry_point": "validate_positive_float", "input": "[-1, 0, 1, 2], 3.25", "output": "3.25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L237-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036641", "code": "def is_static_pending_pod(pod):\n    \"\"\"\n    Return if the pod is a static pending pod\n    See https://github.com/kubernetes/kubernetes/pull/57106\n    :param pod: dict\n    :return: bool\n    \"\"\"\n    try:\n        if pod[\"metadata\"][\"annotations\"][\"kubernetes.io/config.source\"] == \"api\":\n            return False\n\n        pod_status = pod[\"status\"]\n        if pod_status[\"phase\"] != \"Pending\":\n            return False\n\n        return \"containerStatuses\" not in pod_status\n    except KeyError:\n        return False", "entry_point": "is_static_pending_pod", "input": "{'x': [1, 2], 'y': []}", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L57-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036642", "code": "def per_device_batch_size(batch_size, num_gpus):\n  \"\"\"For multi-gpu, batch-size must be a multiple of the number of GPUs.\n\n  Note that this should eventually be handled by DistributionStrategies\n  directly. Multi-GPU support is currently experimental, however,\n  so doing the work here until that feature is in place.\n\n  Args:\n    batch_size: Global batch size to be divided among devices. This should be\n      equal to num_gpus times the single-GPU batch_size for multi-gpu training.\n    num_gpus: How many GPUs are used with DistributionStrategies.\n\n  Returns:\n    Batch size per device.\n\n  Raises:\n    ValueError: if batch_size is not divisible by number of devices\n  \"\"\"\n  if num_gpus <= 1:\n    return batch_size\n\n  remainder = batch_size % num_gpus\n  if remainder:\n    err = ('When running with multiple GPUs, batch size '\n           'must be a multiple of the number of available GPUs. Found {} '\n           'GPUs with a batch size of {}; try --batch_size={} instead.'\n          ).format(num_gpus, batch_size, batch_size - remainder)\n    raise ValueError(err)\n  return int(batch_size / num_gpus)", "entry_point": "per_device_batch_size", "input": "10, 5", "output": "2", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mlperf/training/blob/1c6ae725a81d15437a2b2df05cac0673fde5c3a4/image_classification/tensorflow/official/resnet/resnet_run_loop.py#L405-L433", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036643", "code": "def _escape_token(token, alphabet):\n  r\"\"\"Replace characters that aren't in the alphabet and append \"_\" to token.\n\n  Apply three transformations to the token:\n    1. Replace underline character \"_\" with \"\\u\", and backslash \"\\\" with \"\\\\\".\n    2. Replace characters outside of the alphabet with \"\\###;\", where ### is the\n       character's Unicode code point.\n    3. Appends \"_\" to mark the end of a token.\n\n  Args:\n    token: unicode string to be escaped\n    alphabet: list of all known characters\n\n  Returns:\n    escaped string\n  \"\"\"\n  token = token.replace(u\"\\\\\", u\"\\\\\\\\\").replace(u\"_\", u\"\\\\u\")\n  ret = [c if c in alphabet and c != u\"\\n\" else r\"\\%d;\" % ord(c) for c in token]\n  return u\"\".join(ret) + \"_\"", "entry_point": "_escape_token", "input": "'', 0.5", "output": "'_'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mlperf/training/blob/1c6ae725a81d15437a2b2df05cac0673fde5c3a4/translation/tensorflow/transformer/utils/tokenizer.py#L254-L272", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036644", "code": "def highlight(text: str, color_code: int, bold: bool=False) -> str:\n    \"\"\"Wraps the given string with terminal color codes.\n\n    Args:\n        text: The content to highlight.\n        color_code: The color to highlight with, e.g. 'shelltools.RED'.\n        bold: Whether to bold the content in addition to coloring.\n\n    Returns:\n        The highlighted string.\n    \"\"\"\n    return '{}\\033[{}m{}\\033[0m'.format(\n        '\\033[1m' if bold else '',\n        color_code,\n        text,)", "entry_point": "highlight", "input": "'', ['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "\"\\x1b[1m\\x1b[['a', 'b', 'c']m\\x1b[0m\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantumlib/Cirq/blob/0827da80dd7880e5b923eb69407e980ed9bc0bd2/dev_tools/shell_tools.py#L45-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036645", "code": "def line_content_counts_as_uncovered_manual(content: str) -> bool:\n    \"\"\"\n    Args:\n        content: A line with indentation and tail comments/space removed.\n\n    Returns:\n        Whether the line could be included in the coverage report.\n    \"\"\"\n    # Omit empty lines.\n    if not content:\n        return False\n\n    # Omit declarations.\n    for keyword in ['def', 'class']:\n        if content.startswith(keyword) and content.endswith(':'):\n            return False\n\n    # TODO: multiline comments, multiline strings, etc, etc.\n    return True", "entry_point": "line_content_counts_as_uncovered_manual", "input": "set()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/quantumlib/Cirq/blob/0827da80dd7880e5b923eb69407e980ed9bc0bd2/dev_tools/incremental_coverage.py#L165-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036646", "code": "def is_number(string):\n    \"\"\" checks if a string is a number (int/float) \"\"\"\n    string = str(string)\n    if string.isnumeric():\n        return True\n    try:\n        float(string)\n        return True\n    except ValueError:\n        return False", "entry_point": "is_number", "input": "'abc'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ranaroussi/qtpylib/blob/0dbbc465fafd9cb9b0f4d10e1e07fae4e15032dd/qtpylib/tools.py#L89-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036647", "code": "def round_to_fraction(val, res, decimals=None):\n    \"\"\" round to closest resolution \"\"\"\n    if val is None:\n        return 0.0\n    if decimals is None and \".\" in str(res):\n        decimals = len(str(res).split('.')[1])\n\n    return round(round(val / res) * res, decimals)", "entry_point": "round_to_fraction", "input": "0.5, True, False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ranaroussi/qtpylib/blob/0dbbc465fafd9cb9b0f4d10e1e07fae4e15032dd/qtpylib/tools.py#L363-L370", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036648", "code": "def split_interface(intf_name):\n    \"\"\"Split an interface name based on first digit, slash, or space match.\"\"\"\n    head = intf_name.rstrip(r\"/\\0123456789. \")\n    tail = intf_name[len(head) :].lstrip()\n    return (head, tail)", "entry_point": "split_interface", "input": "'walnut thistle harbour'", "output": "('walnut thistle harbour', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L346-L350", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036649", "code": "def FormatAsHexString(num, width=None, prefix=\"0x\"):\n  \"\"\"Takes an int and returns the number formatted as a hex string.\"\"\"\n  # Strip \"0x\".\n  hex_str = hex(num)[2:]\n  # Strip \"L\" for long values.\n  hex_str = hex_str.replace(\"L\", \"\")\n  if width:\n    hex_str = hex_str.rjust(width, \"0\")\n  return \"%s%s\" % (prefix, hex_str)", "entry_point": "FormatAsHexString", "input": "2, 10, 'AbC dEf'", "output": "'AbC dEf0000000002'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/utils.py#L554-L562", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036650", "code": "def FilterFnTable(fn_table, symbol):\n  \"\"\"Remove a specific symbol from a fn_table.\"\"\"\n  new_table = list()\n  for entry in fn_table:\n    # symbol[0] is a str with the symbol name\n    if entry[0] != symbol:\n      new_table.append(entry)\n  return new_table", "entry_point": "FilterFnTable", "input": "{'x': [1, 2], 'y': []}, [5, 3, 1, 4]", "output": "['x', 'y']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/osx/objc.py#L51-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036651", "code": "def NamedPlaceholders(iterable):\n  \"\"\"Returns named placeholders from all elements of the given iterable.\n\n  Use this function for VALUES of MySQL INSERTs.\n\n  To account for Iterables with undefined order (dicts before Python 3.6),\n  this function sorts column names.\n\n  Examples:\n    >>> NamedPlaceholders({\"password\": \"foo\", \"name\": \"bar\"})\n    u'(%(name)s, %(password)s)'\n\n  Args:\n    iterable: The iterable of strings to be used as placeholder keys.\n\n  Returns:\n    A string containing a tuple of comma-separated, sorted, named, placeholders.\n  \"\"\"\n  placeholders = \", \".join(\"%({})s\".format(key) for key in sorted(iterable))\n  return \"({})\".format(placeholders)", "entry_point": "NamedPlaceholders", "input": "[[1, 2], [3], []]", "output": "'(%([])s, %([1, 2])s, %([3])s)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_utils.py#L66-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036652", "code": "def Columns(iterable):\n  \"\"\"Returns a string of column names for MySQL INSERTs.\n\n  To account for Iterables with undefined order (dicts before Python 3.6),\n  this function sorts column names.\n\n  Examples:\n    >>> Columns({\"password\": \"foo\", \"name\": \"bar\"})\n    u'(`name`, `password`)'\n\n  Args:\n    iterable: The iterable of strings to be used as column names.\n  Returns: A string containing a tuple of sorted comma-separated column names.\n  \"\"\"\n  columns = sorted(iterable)\n  return \"({})\".format(\", \".join(\"`{}`\".format(col) for col in columns))", "entry_point": "Columns", "input": "[5, 3, 1, 4]", "output": "'(`1`, `3`, `4`, `5`)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_utils.py#L88-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036653", "code": "def Trim(lst, limit):\n  \"\"\"Trims a given list so that it is not longer than given limit.\n\n  Args:\n    lst: A list to trim.\n    limit: A maximum number of elements in the list after trimming.\n\n  Returns:\n    A suffix of the input list that was trimmed.\n  \"\"\"\n  limit = max(0, limit)\n\n  clipping = lst[limit:]\n  del lst[limit:]\n  return clipping", "entry_point": "Trim", "input": "[5, 3, 1, 4], 10", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/collection.py#L39-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036654", "code": "def Group(items, key):\n  \"\"\"Groups items by given key function.\n\n  Args:\n    items: An iterable or an iterator of items.\n    key: A function which given each item will return the key.\n\n  Returns:\n    A dict with keys being each unique key and values being a list of items of\n    that key.\n  \"\"\"\n  result = {}\n\n  for item in items:\n    result.setdefault(key(item), []).append(item)\n\n  return result", "entry_point": "Group", "input": "[], ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/collection.py#L56-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036655", "code": "def StartsWith(this, that):\n  \"\"\"Checks whether an items of one iterable are a prefix of another.\n\n  Args:\n    this: An iterable that needs to be checked.\n    that: An iterable of which items must match the prefix of `this`.\n\n  Returns:\n    `True` if `that` is a prefix of `this`, `False` otherwise.\n  \"\"\"\n  this_iter = iter(this)\n  that_iter = iter(that)\n\n  while True:\n    try:\n      this_value = next(that_iter)\n    except StopIteration:\n      return True\n\n    try:\n      that_value = next(this_iter)\n    except StopIteration:\n      return False\n\n    if this_value != that_value:\n      return False", "entry_point": "StartsWith", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/collection.py#L100-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036656", "code": "def Unzip(iterable):\n  \"\"\"Unzips specified iterable of pairs to pair of two iterables.\n\n  This function is an inversion of the standard `zip` function and the following\n  hold:\n\n    * \u2200 l, r. l, r == unzip(zip(l, r))\n    * \u2200 p. p == zip(unzip(p))\n\n  Examples:\n    >>> Unzip([(\"foo\", 1), (\"bar\", 2), (\"baz\", 3)])\n    ([\"foo\", \"bar\", \"baz\"], [1, 2, 3])\n\n  Args:\n    iterable: An iterable of pairs to unzip.\n\n  Returns:\n    A pair of iterables after unzipping.\n  \"\"\"\n  lefts = []\n  rights = []\n\n  for left, right in iterable:\n    lefts.append(left)\n    rights.append(right)\n\n  return lefts, rights", "entry_point": "Unzip", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/collection.py#L128-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036657", "code": "def _FilterOutPathInfoDuplicates(path_infos):\n  \"\"\"Filters out duplicates from passed PathInfo objects.\n\n  Args:\n    path_infos: An iterable with PathInfo objects.\n\n  Returns:\n    A list of PathInfo objects with duplicates removed. Duplicates are\n    removed following this logic: they're sorted by (ctime, mtime, atime,\n    inode number) in the descending order and then the first one is taken\n    and the others are dropped.\n  \"\"\"\n  pi_dict = {}\n\n  for pi in path_infos:\n    path_key = (pi.path_type, pi.GetPathID())\n    pi_dict.setdefault(path_key, []).append(pi)\n\n  def _SortKey(pi):\n    return (\n        pi.stat_entry.st_ctime,\n        pi.stat_entry.st_mtime,\n        pi.stat_entry.st_atime,\n        pi.stat_entry.st_ino,\n    )\n\n  for pi_values in pi_dict.values():\n    if len(pi_values) > 1:\n      pi_values.sort(key=_SortKey, reverse=True)\n\n  return [v[0] for v in pi_dict.values()]", "entry_point": "_FilterOutPathInfoDuplicates", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/filesystem.py#L59-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036658", "code": "def allocate_mid(mids):\n    \"\"\"\n    Allocate a MID which has not been used yet.\n    \"\"\"\n    i = 0\n    while True:\n        mid = str(i)\n        if mid not in mids:\n            mids.add(mid)\n            return mid\n        i += 1", "entry_point": "allocate_mid", "input": "{1, 2, 3}", "output": "'0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aiortc/aiortc/blob/60ed036abf4575bd63985724b4493d569e6da29b/aiortc/rtcpeerconnection.py#L128-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036659", "code": "def uint16_gt(a: int, b: int) -> bool:\n    \"\"\"\n    Return a > b.\n    \"\"\"\n    half_mod = 0x8000\n    return (((a < b) and ((b - a) > half_mod)) or\n            ((a > b) and ((a - b) < half_mod)))", "entry_point": "uint16_gt", "input": "True, True", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aiortc/aiortc/blob/60ed036abf4575bd63985724b4493d569e6da29b/aiortc/utils.py#L20-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036660", "code": "def calculate_score(search_string, word):\n    \"\"\"Calculate how well the search string matches the word.\"\"\"\n    # See the module docstring for a high level description\n    # of what we're trying to do.\n    # * If the search string is larger than the word, we know\n    #   immediately that this can't be a match.\n    if len(search_string) > len(word):\n        return 0\n    original_word = word\n    score = 1\n    search_index = 0\n    while True:\n        scale = 1.0\n        search_char = search_string[search_index]\n        i = word.find(search_char)\n        if i < 0:\n            return 0\n        if i > 0 and word[i - 1] == '-':\n            scale = 0.95\n        else:\n            scale = 1 - (i / float(len(word)))\n        score *= scale\n        word = word[i + 1:]\n        search_index += 1\n        if search_index >= len(search_string):\n            break\n    # The more characters that matched the word, the better\n    # so prefer more complete matches.\n    completion_scale = 1 - (len(word) / float(len(original_word)))\n    score *= completion_scale\n    return score", "entry_point": "calculate_score", "input": "'AbC dEf', 'AbC dEf'", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/aws-shell/blob/8950f03d9d720879890af6c11537b8f9789ce5a9/awsshell/fuzzy.py#L54-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036661", "code": "def substring_search(word, collection):\n    \"\"\"Find all matches in the `collection` for the specified `word`.\n\n    If `word` is empty, returns all items in `collection`.\n\n    :type word: str\n    :param word: The substring to search for.\n\n    :type collection: collection, usually a list\n    :param collection: A collection of words to match.\n\n    :rtype: list of strings\n    :return: A sorted list of matching words from collection.\n    \"\"\"\n    return [item for item in sorted(collection) if item.startswith(word)]", "entry_point": "substring_search", "input": "'abc', ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/awslabs/aws-shell/blob/8950f03d9d720879890af6c11537b8f9789ce5a9/awsshell/substring.py#L15-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036662", "code": "def string_to_int( s ):\n  \"\"\"Convert a string of bytes into an integer, as per X9.62.\"\"\"\n  result = 0\n  for c in s:\n    if not isinstance(c, int): c = ord( c )\n    result = 256 * result + c\n  return result", "entry_point": "string_to_int", "input": "[5, 3, 1, 4]", "output": "84082948", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/espressif/esptool/blob/c583756c118039cfcfe256f7a3285618914d16a5/ecdsa/ecdsa.py#L169-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036663", "code": "def gcd2(a, b):\n  \"\"\"Greatest common divisor using Euclid's algorithm.\"\"\"\n  while a:\n    a, b = b%a, a\n  return b", "entry_point": "gcd2", "input": "[], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/espressif/esptool/blob/c583756c118039cfcfe256f7a3285618914d16a5/ecdsa/numbertheory.py#L206-L210", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036664", "code": "def carmichael_of_ppower( pp ):\n  \"\"\"Carmichael function of the given power of the given prime.\n  \"\"\"\n\n  p, a = pp\n  if p == 2 and a > 2: return 2**(a-2)\n  else: return (p-1) * p**(a-1)", "entry_point": "carmichael_of_ppower", "input": "(1, 2)", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/espressif/esptool/blob/c583756c118039cfcfe256f7a3285618914d16a5/ecdsa/numbertheory.py#L336-L342", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036665", "code": "def _pipe_segment_with_colons(align, colwidth):\n    \"\"\"Return a segment of a horizontal line with optional colons which\n    indicate column's alignment (as in `pipe` output format).\"\"\"\n    w = colwidth\n    if align in [\"right\", \"decimal\"]:\n        return ('-' * (w - 1)) + \":\"\n    elif align == \"center\":\n        return \":\" + ('-' * (w - 2)) + \":\"\n    elif align == \"left\":\n        return \":\" + ('-' * (w - 1))\n    else:\n        return '-' * w", "entry_point": "_pipe_segment_with_colons", "input": "[1, 2, 3], 7", "output": "'-------'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/extern/tabulate.py#L100-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036666", "code": "def _build_simple_row(padded_cells, rowfmt):\n    \"Format row according to DataRow format without padding.\"\n    begin, sep, end = rowfmt\n    return (begin + sep.join(padded_cells) + end).rstrip()", "entry_point": "_build_simple_row", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "'aabbbcc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/extern/tabulate.py#L834-L837", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036667", "code": "def html_email(email, title=None):\n    \"\"\"\n    >>> html_email('username@example.com')\n    '<a href=\"mailto:username@example.com\">username@example.com</a>'\n    \"\"\"\n\n    if not title:\n        title = email\n\n    return '<a href=\"mailto:{email}\">{title}</a>'.format(email=email, title=title)", "entry_point": "html_email", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "'<a href=\"mailto:[1, 2, 3]\">[[1, 2], [3], []]</a>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/utils.py#L25-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036668", "code": "def html_table_header_row(data):\n    \"\"\"\n    >>> html_table_header_row(['administrators', 'key', 'leader', 'project'])\n    '\\\\n\\\\t<tr><th>Administrators</th><th>Key</th><th>Leader</th><th>Project</th></tr>'\n    >>> html_table_header_row(['key', 'project', 'leader', 'administrators'])\n    '\\\\n\\\\t<tr><th>Key</th><th>Project</th><th>Leader</th><th>Administrators</th></tr>'\n    \"\"\"\n    html = '\\n\\t<tr>'\n\n    for th in data:\n        title = th.replace('_', ' ').title()\n        html += '<th>{}</th>'.format(title)\n\n    return html + '</tr>'", "entry_point": "html_table_header_row", "input": "[]", "output": "'\\n\\t<tr></tr>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/utils.py#L64-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036669", "code": "def get_common_timestamps(source, target):\r\n    \"\"\"Return indices of timestamps from source that are also found in target.\r\n\r\n    :param source: timestamps from source\r\n    :type source: list of datetime objects\r\n    :param target: timestamps from target\r\n    :type target: list of datetime objects\r\n    :return: indices of timestamps from source that are also found in target\r\n    :rtype: list of ints\r\n    \"\"\"\r\n    remove_from_source = set(source).difference(target)\r\n    remove_from_source_idxs = [source.index(rm_date) for rm_date in remove_from_source]\r\n    return [idx for idx, _ in enumerate(source) if idx not in remove_from_source_idxs]", "entry_point": "get_common_timestamps", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/eo-learn/blob/b8c390b9f553c561612fe9eb64e720611633a035/core/eolearn/core/utilities.py#L325-L337", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036670", "code": "def _copy_old_features(new_eopatch, old_eopatch, copy_features):\n        \"\"\" Copy features from old EOPatch\n\n        :param new_eopatch: New EOPatch container where the old features will be copied to\n        :type new_eopatch: EOPatch\n        :param old_eopatch: Old EOPatch container where the old features are located\n        :type old_eopatch: EOPatch\n        :param copy_features: List of tuples of type (FeatureType, str) or (FeatureType, str, str) that are copied\n            over into the new EOPatch. The first string is the feature name, and the second one (optional) is a new name\n            to be used for the feature\n        :type copy_features: list((FeatureType, str) or (FeatureType, str, str))\n        \"\"\"\n        if copy_features:\n            existing_features = set(new_eopatch.get_feature_list())\n\n            for copy_feature_type, copy_feature_name, copy_new_feature_name in copy_features:\n                new_feature = copy_feature_type, copy_new_feature_name\n\n                if new_feature in existing_features:\n                    raise ValueError('Feature {} of {} already exists in the new EOPatch! '\n                                     'Use a different name!'.format(copy_new_feature_name, copy_feature_type))\n                else:\n                    existing_features.add(new_feature)\n\n                    new_eopatch[copy_feature_type][copy_new_feature_name] = \\\n                        old_eopatch[copy_feature_type][copy_feature_name]\n\n        return new_eopatch", "entry_point": "_copy_old_features", "input": "['a', 'b', 'c'], [1, 2, 3], []", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sentinel-hub/eo-learn/blob/b8c390b9f553c561612fe9eb64e720611633a035/features/eolearn/features/interpolation.py#L182-L209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036671", "code": "def as_bool(s):\n    \"\"\"\n    Convert a string into a boolean.\n\n    >>> assert as_bool(True) is True and as_bool(\"Yes\") is True and as_bool(\"false\") is False\n    \"\"\"\n    if s in (False, True): return s\n    # Assume string\n    s = s.lower()\n    if s in (\"yes\", \"true\"):\n        return True\n    elif s in (\"no\", \"false\"):\n        return False\n    else:\n        raise ValueError(\"Don't know how to convert type %s: %s into a boolean\" % (type(s), s))", "entry_point": "as_bool", "input": "False", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/utils.py#L24-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036672", "code": "def _convert(x, factor1, factor2):\n        \"\"\"\n        Converts mixing ratio x in comp1 - comp2 tie line to that in\n        c1 - c2 tie line.\n\n        Args:\n            x (float): Mixing ratio x in comp1 - comp2 tie line, a float\n                between 0 and 1.\n            factor1 (float): Compositional ratio between composition c1 and\n                processed composition comp1. E.g., factor for\n                Composition('SiO2') and Composition('O') is 2.0.\n            factor2 (float): Compositional ratio between composition c2 and\n                processed composition comp2.\n\n        Returns:\n            Mixing ratio in c1 - c2 tie line, a float between 0 and 1.\n        \"\"\"\n        return x * factor2 / ((1-x) * factor1 + x * factor2)", "entry_point": "_convert", "input": "7, 2, 7", "output": "1.3243243243243243", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/interface_reactions.py#L271-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036673", "code": "def get_atom_map(structure):\n    \"\"\"\n    Returns a dict that maps each atomic symbol to a unique integer starting\n    from 1.\n\n    Args:\n        structure (Structure)\n\n    Returns:\n        dict\n    \"\"\"\n    syms = [site.specie.symbol for site in structure]\n    unique_pot_atoms = []\n    [unique_pot_atoms.append(i) for i in syms if not unique_pot_atoms.count(i)]\n    atom_map = {}\n    for i, atom in enumerate(unique_pot_atoms):\n        atom_map[atom] = i + 1\n    return atom_map", "entry_point": "get_atom_map", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/inputs.py#L905-L922", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036674", "code": "def _stringify_val(val):\n        \"\"\"\n        Convert the given value to string.\n        \"\"\"\n        if isinstance(val, list):\n            return \" \".join([str(i) for i in val])\n        else:\n            return str(val)", "entry_point": "_stringify_val", "input": "['apple', 'banana', 'cherry']", "output": "'apple banana cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/inputs.py#L535-L542", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036675", "code": "def contract(s):\n    \"\"\"\n    >>> assert contract(\"1 1 1 2 2 3\") == \"3*1 2*2 1*3\"\n    >>> assert contract(\"1 1 3 2 3\") == \"2*1 1*3 1*2 1*3\"\n    \"\"\"\n    if not s: return s\n\n    tokens = s.split()\n    old = tokens[0]\n    count = [[1, old]]\n\n    for t in tokens[1:]:\n        if t == old:\n            count[-1][0] += 1\n        else:\n            old = t\n            count.append([1, t])\n\n    return \" \".join(\"%d*%s\" % (c, t) for c, t in count)", "entry_point": "contract", "input": "()", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/abiobjects.py#L227-L245", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036676", "code": "def _parse_parameters(val_type, val):\n    \"\"\"\n    Helper function to convert a Vasprun parameter into the proper type.\n    Boolean, int and float types are converted.\n\n    Args:\n        val_type: Value type parsed from vasprun.xml.\n        val: Actual string value parsed for vasprun.xml.\n    \"\"\"\n    if val_type == \"logical\":\n        return val == \"T\"\n    elif val_type == \"int\":\n        return int(val)\n    elif val_type == \"string\":\n        return val.strip()\n    else:\n        return float(val)", "entry_point": "_parse_parameters", "input": "'a,b,c', False", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L61-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036677", "code": "def zval_dict_from_potcar(potcar):\n    \"\"\"\n    Creates zval_dictionary for calculating the ionic polarization from\n    Potcar object\n\n    potcar: Potcar object\n    \"\"\"\n    zval_dict = {}\n    for p in potcar:\n        zval_dict.update({p.element: p.ZVAL})\n    return zval_dict", "entry_point": "zval_dict_from_potcar", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/ferroelectricity/polarization.py#L68-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036678", "code": "def strictly_increasing(values):\n    \"\"\"True if values are stricly increasing.\"\"\"\n    return all(x < y for x, y in zip(values, values[1:]))", "entry_point": "strictly_increasing", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/num.py#L84-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036679", "code": "def strictly_decreasing(values):\n    \"\"\"True if values are stricly decreasing.\"\"\"\n    return all(x > y for x, y in zip(values, values[1:]))", "entry_point": "strictly_decreasing", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/num.py#L89-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036680", "code": "def non_increasing(values):\n    \"\"\"True if values are not increasing.\"\"\"\n    return all(x >= y for x, y in zip(values, values[1:]))", "entry_point": "non_increasing", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/num.py#L94-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036681", "code": "def non_decreasing(values):\n    \"\"\"True if values are not decreasing.\"\"\"\n    return all(x <= y for x, y in zip(values, values[1:]))", "entry_point": "non_decreasing", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/num.py#L99-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036682", "code": "def _get_elements(mol, label):\n        \"\"\"\n        The the elements of the atoms in the specified order\n\n        Args:\n            mol: The molecule. OpenBabel OBMol object.\n            label: The atom indices. List of integers.\n\n        Returns:\n            Elements. List of integers.\n        \"\"\"\n        elements = [int(mol.GetAtom(i).GetAtomicNum()) for i in label]\n        return elements", "entry_point": "_get_elements", "input": "(1, 2), ()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L462-L474", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036683", "code": "def _shannon_radii_from_cn(species_list, cn_roman, radius_to_compare=0):\n    \"\"\"\n    Utility func to get Shannon radii for a particular coordination number.\n\n    As the Shannon radii depends on charge state and coordination number,\n    species without an entry for a particular coordination number will\n    be skipped.\n\n    Args:\n        species_list (list): A list of Species to get the Shannon radii for.\n        cn_roman (str): The coordination number as a roman numeral. See\n            Specie.get_shannon_radius for more details.\n        radius_to_compare (float, optional): If set, the data will be returned\n            with a \"radii_diff\" key, containing the difference between the\n            shannon radii and this radius.\n\n    Returns:\n        (list of dict): The Shannon radii for all Species in species. Formatted\n        as a list of dictionaries, with the keys:\n\n        - \"species\": The species with charge state.\n        - \"radius\": The Shannon radius for the species.\n        - \"radius_diff\": The difference between the Shannon radius and the\n            radius_to_compare optional argument.\n    \"\"\"\n    shannon_radii = []\n\n    for s in species_list:\n        try:\n            radius = s.get_shannon_radius(cn_roman)\n            shannon_radii.append({\n                'species': s, 'radius': radius,\n                'radii_diff': radius - radius_to_compare})\n        except KeyError:\n            pass\n\n    return shannon_radii", "entry_point": "_shannon_radii_from_cn", "input": "[], [[1, 2], [3], []], [1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_prediction/dopant_predictor.py#L137-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036684", "code": "def _int_to_roman(number):\n    \"\"\"Utility method to convert an int (less than 20) to a roman numeral.\"\"\"\n    roman_conv = [(10, \"X\"), (9, \"IX\"), (5, \"V\"), (4, \"IV\"), (1, \"I\")]\n\n    result = []\n    for (arabic, roman) in roman_conv:\n        (factor, number) = divmod(number, arabic)\n        result.append(roman * factor)\n        if number == 0:\n            break\n    return \"\".join(result)", "entry_point": "_int_to_roman", "input": "10", "output": "'X'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_prediction/dopant_predictor.py#L176-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036685", "code": "def transform_to_length(nndata, length):\n        \"\"\"\n        Given NNData, transforms data to the specified fingerprint length\n        Args:\n            nndata: (NNData)\n            length: (int) desired length of NNData\n        \"\"\"\n\n        if length is None:\n            return nndata\n\n        if length:\n            for cn in range(length):\n                if cn not in nndata.cn_weights:\n                    nndata.cn_weights[cn] = 0\n                    nndata.cn_nninfo[cn] = []\n\n        return nndata", "entry_point": "transform_to_length", "input": "[[1, 2], [3], []], 0", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/local_env.py#L3553-L3570", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036686", "code": "def entry_dict_from_list(all_slab_entries):\n    \"\"\"\n    Converts a list of SlabEntry to an appropriate dictionary. It is\n    assumed that if there is no adsorbate, then it is a clean SlabEntry\n    and that adsorbed SlabEntry has the clean_entry parameter set.\n\n    Args:\n        all_slab_entries (list): List of SlabEntry objects\n\n    Returns:\n        (dict): Dictionary of SlabEntry with the Miller index as the main\n            key to a dictionary with a clean SlabEntry as the key to a\n            list of adsorbed SlabEntry.\n    \"\"\"\n\n    entry_dict = {}\n\n    for entry in all_slab_entries:\n        hkl = tuple(entry.miller_index)\n        if hkl not in entry_dict.keys():\n            entry_dict[hkl] = {}\n        if entry.clean_entry:\n            clean = entry.clean_entry\n        else:\n            clean = entry\n        if clean not in entry_dict[hkl].keys():\n            entry_dict[hkl][clean] = []\n        if entry.adsorbates:\n            entry_dict[hkl][clean].append(entry)\n\n    return entry_dict", "entry_point": "entry_dict_from_list", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1286-L1316", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036687", "code": "def p0_reciprocal(xs, ys):\n    \"\"\"\n    predictor for first guess for reciprocal\n    \"\"\"\n    a0 = ys[len(ys) - 1]\n    b0 = ys[0]*xs[0] - a0*xs[0]\n    return [a0, b0, 1]", "entry_point": "p0_reciprocal", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "[4, 5, 1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/convergence.py#L107-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036688", "code": "def formula_double_format(afloat, ignore_ones=True, tol=1e-8):\n    \"\"\"\n    This function is used to make pretty formulas by formatting the amounts.\n    Instead of Li1.0 Fe1.0 P1.0 O4.0, you get LiFePO4.\n\n    Args:\n        afloat (float): a float\n        ignore_ones (bool): if true, floats of 1 are ignored.\n        tol (float): Tolerance to round to nearest int. i.e. 2.0000000001 -> 2\n\n    Returns:\n        A string representation of the float for formulas.\n    \"\"\"\n    if ignore_ones and afloat == 1:\n        return \"\"\n    elif abs(afloat - int(afloat)) < tol:\n        return str(int(afloat))\n    else:\n        return str(round(afloat, 8))", "entry_point": "formula_double_format", "input": "True, ('a', 'b', 'c'), ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/string.py#L42-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036689", "code": "def unicodeify(formula):\n    \"\"\"\n    Generates a formula with unicode subscripts, e.g. Fe2O3 is transformed\n    to Fe\u2082O\u2083. Does not support formulae with decimal points.\n\n    :param formula:\n    :return:\n    \"\"\"\n\n    if '.' in formula:\n        raise ValueError('No unicode character exists for subscript period.')\n\n    subscript_unicode_map = {0: '\u2080', 1: '\u2081', 2: '\u2082', 3: '\u2083', 4: '\u2084',\n                             5: '\u2085', 6: '\u2086', 7: '\u2087', 8: '\u2088', 9: '\u2089'}\n\n    for original_subscript, subscript_unicode in subscript_unicode_map.items():\n        formula = formula.replace(str(original_subscript), subscript_unicode)\n\n    return formula", "entry_point": "unicodeify", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/string.py#L88-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036690", "code": "def hkl_tuple_to_str(hkl):\n    \"\"\"\n    Prepare for display on plots\n    \"(hkl)\" for surfaces\n    Agrs:\n        hkl: in the form of [h, k, l] or (h, k, l)\n    \"\"\"\n    str_format = '($'\n    for x in hkl:\n        if x < 0:\n            str_format += '\\\\overline{' + str(-x) + '}'\n        else:\n            str_format += str(x)\n    str_format += '$)'\n    return str_format", "entry_point": "hkl_tuple_to_str", "input": "[]", "output": "'($$)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/wulff.py#L41-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036691", "code": "def clean(some_string, uppercase=False):\n    \"\"\"\n    helper to clean up an input string\n    \"\"\"\n    if uppercase:\n        return some_string.strip().upper()\n    else:\n        return some_string.strip().lower()", "entry_point": "clean", "input": "'Hello World', []", "output": "'hello world'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/helpers.py#L76-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036692", "code": "def format_formula(formula):\n    \"\"\"\n    Converts str of chemical formula into\n    latex format for labelling purposes\n\n    Args:\n        formula (str): Chemical formula\n    \"\"\"\n\n    formatted_formula = \"\"\n    number_format = \"\"\n    for i, s in enumerate(formula):\n        if s.isdigit():\n            if not number_format:\n                number_format = \"_{\"\n            number_format += s\n            if i == len(formula) - 1:\n                number_format += \"}\"\n                formatted_formula += number_format\n        else:\n            if number_format:\n                number_format += \"}\"\n                formatted_formula += number_format\n                number_format = \"\"\n            formatted_formula += s\n\n    return r\"$%s$\" % (formatted_formula)", "entry_point": "format_formula", "input": "['apple', 'banana', 'cherry']", "output": "'$applebananacherry$'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/util/plotting.py#L265-L291", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036693", "code": "def lower_and_check_unique(dict_to_check):\n    \"\"\"\n    Takes a dictionary and makes all the keys lower case. Also replaces\n    \"jobtype\" with \"job_type\" just so that key specifically can be called\n    elsewhere without ambiguity. Finally, ensures that multiple identical\n    keys, that differed only due to different capitalizations, are not\n    present. If there are multiple equivalent keys, an Exception is raised.\n\n    Args:\n        dict_to_check (dict): The dictionary to check and standardize\n\n    Returns:\n        to_return (dict): An identical dictionary but with all keys made\n            lower case and no identical keys present.\n    \"\"\"\n    if dict_to_check == None:\n        return None\n    else:\n        to_return = {}\n        for key in dict_to_check:\n            new_key = key.lower()\n            if new_key == \"jobtype\":\n                new_key = \"job_type\"\n            if new_key in to_return:\n                raise Exception(\n                    \"Multiple instances of key \" + new_key + \" found!\")\n            else:\n                try:\n                    to_return[new_key] = dict_to_check.get(key).lower()\n                except AttributeError:\n                    to_return[new_key] = dict_to_check.get(key)\n        return to_return", "entry_point": "lower_and_check_unique", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/qchem/utils.py#L110-L141", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036694", "code": "def get_magnitude_of_effect_from_spin_config(motif, spin_config):\n        \"\"\"\n        Roughly, the magnitude of Jahn-Teller distortion will be:\n        * in octahedral environments, strong if e_g orbitals\n        unevenly occupied but weak if t_2g orbitals unevenly\n        occupied\n        * in tetrahedral environments always weaker\n        :param motif (str): \"oct\" or \"tet\"\n        :param spin_config (dict): dict of 'e' (e_g) and 't' (t2_g)\n        with number of electrons in each state\n        \"\"\"\n        magnitude = \"none\"\n        if motif == \"oct\":\n            e_g = spin_config[\"e_g\"]\n            t_2g = spin_config[\"t_2g\"]\n            if (e_g % 2 != 0) or (t_2g % 3 != 0):\n                magnitude = \"weak\"\n                if e_g % 2 == 1:\n                    magnitude = \"strong\"\n        elif motif == \"tet\":\n            e = spin_config[\"e\"]\n            t_2 = spin_config[\"t_2\"]\n            if (e % 3 != 0) or (t_2 % 2 != 0):\n                magnitude = \"weak\"\n        return magnitude", "entry_point": "get_magnitude_of_effect_from_spin_config", "input": "[-1, 0, 1, 2], {'a': 1, 'b': 2}", "output": "'none'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/jahnteller.py#L283-L307", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036695", "code": "def calculate_nfft(samplerate, winlen):\n    \"\"\"Calculates the FFT size as a power of two greater than or equal to\n    the number of samples in a single window length.\n    \n    Having an FFT less than the window length loses precision by dropping\n    many of the samples; a longer FFT than the window allows zero-padding\n    of the FFT buffer which is neutral in terms of frequency domain conversion.\n\n    :param samplerate: The sample rate of the signal we are working with, in Hz.\n    :param winlen: The length of the analysis window in seconds.\n    \"\"\"\n    window_length_samples = winlen * samplerate\n    nfft = 1\n    while nfft < window_length_samples:\n        nfft *= 2\n    return nfft", "entry_point": "calculate_nfft", "input": "0, False", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jameslyons/python_speech_features/blob/40c590269b57c64a8c1f1ddaaff2162008d1850c/python_speech_features/base.py#L8-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036696", "code": "def get_path_from_doc(full_doc):\n    \"\"\"\n    If `file:` is provided import the file.\n    \"\"\"\n    swag_path = full_doc.replace('file:', '').strip()\n    swag_type = swag_path.split('.')[-1]\n    return swag_path, swag_type", "entry_point": "get_path_from_doc", "input": "'walnut thistle harbour'", "output": "('walnut thistle harbour', 'walnut thistle harbour')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rochacbruno/flasgger/blob/fef154f61d7afca548067be0c758c3dd71cc4c97/flasgger/utils.py#L443-L449", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036697", "code": "def get_vendor_extension_fields(mapping):\n    \"\"\"\n    Identify vendor extension fields and extract them into a new dictionary.\n    Examples:\n        >>> get_vendor_extension_fields({'test': 1})\n        {}\n        >>> get_vendor_extension_fields({'test': 1, 'x-test': 2})\n        {'x-test': 2}\n    \"\"\"\n    return {k: v for k, v in mapping.items() if k.startswith('x-')}", "entry_point": "get_vendor_extension_fields", "input": "{'x': [1, 2], 'y': []}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rochacbruno/flasgger/blob/fef154f61d7afca548067be0c758c3dd71cc4c97/flasgger/utils.py#L730-L739", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036698", "code": "def get_bitstring_from_index(index, qubit_num):\n    \"\"\"\n    Returns the bitstring in lexical order that corresponds to the given index in 0 to 2^(qubit_num)\n    :param int index:\n    :param int qubit_num:\n    :return: the bitstring\n    :rtype: str\n    \"\"\"\n    if index > (2**qubit_num - 1):\n        raise IndexError(\"Index {} too large for {} qubits.\".format(index, qubit_num))\n    return bin(index)[2:].rjust(qubit_num, '0')", "entry_point": "get_bitstring_from_index", "input": "3, 10", "output": "'0000000011'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/pyquil/blob/ec98e453084b0037d69d8c3245f6822a5422593d/pyquil/wavefunction.py#L206-L216", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036699", "code": "def process_results(results):\n    \"\"\"\n    Convert n digit binary result from the QVM to a value on a die.\n    \"\"\"\n    raw_results = results[0]\n    processing_result = 0\n    for each_qubit_measurement in raw_results:\n        processing_result = 2*processing_result + each_qubit_measurement\n    # Convert from 0 indexed to 1 indexed\n    die_value = processing_result + 1\n    return die_value", "entry_point": "process_results", "input": "[[1, 2], [3], []]", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/pyquil/blob/ec98e453084b0037d69d8c3245f6822a5422593d/examples/quantum_die.py#L55-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036700", "code": "def changed_bit_pos(a, b):\n    \"\"\"\n    Return the index of the first bit that changed between `a` an `b`.\n    Return None if there are no changed bits.\n    \"\"\"\n    c = a ^ b\n    n = 0\n    while c > 0:\n        if c & 1 == 1:\n            return n\n        c >>= 1\n        n += 1\n    return None", "entry_point": "changed_bit_pos", "input": "True, 2", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rigetti/pyquil/blob/ec98e453084b0037d69d8c3245f6822a5422593d/examples/pointer.py#L26-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036701", "code": "def intToBin(i):\n    \"\"\" Integer to two bytes \"\"\"\n    # devide in two parts (bytes)\n    i1 = i % 256\n    i2 = int(i / 256)\n    # make string (little endian)\n    return chr(i1) + chr(i2)", "entry_point": "intToBin", "input": "10", "output": "'\\n\\x00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/thumbor/thumbor/blob/558ccdd6e3bc29e1c9ee3687372c4b3eb05ac607/thumbor/engines/extensions/pil.py#L132-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036702", "code": "def get_domain_url(url):\n    \"\"\"\n    Use this to convert a url like this:\n    https://blog.xkcd.com/2014/07/22/what-if-book-tour/\n    Into this:\n    https://blog.xkcd.com\n    \"\"\"\n    if \"http://\" not in url and \"https://\" not in url:\n        return url\n    url_header = url.split('://')[0]\n    simple_url = url.split('://')[1]\n    base_url = simple_url.split('/')[0]\n    domain_url = url_header + '://' + base_url\n    return domain_url", "entry_point": "get_domain_url", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seleniumbase/SeleniumBase/blob/62e5b43ee1f90a9ed923841bdd53b1b38358f43a/seleniumbase/fixtures/page_utils.py#L9-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036703", "code": "def is_xpath_selector(selector):\n    \"\"\"\n    A basic method to determine if a selector is an xpath selector.\n    \"\"\"\n    if (selector.startswith('/') or selector.startswith('./') or (\n            selector.startswith('('))):\n        return True\n    return False", "entry_point": "is_xpath_selector", "input": "'abc'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seleniumbase/SeleniumBase/blob/62e5b43ee1f90a9ed923841bdd53b1b38358f43a/seleniumbase/fixtures/page_utils.py#L25-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036704", "code": "def _get_unique_links(page_url, soup):\n    \"\"\"\n    Returns all unique links.\n    Includes:\n        \"a\"->\"href\", \"img\"->\"src\", \"link\"->\"href\", and \"script\"->\"src\" links.\n    \"\"\"\n    if \"http://\" not in page_url and \"https://\" not in page_url:\n        return []\n    prefix = 'http:'\n    if page_url.startswith('https:'):\n        prefix = 'https:'\n    simple_url = page_url.split('://')[1]\n    base_url = simple_url.split('/')[0]\n    full_base_url = prefix + \"//\" + base_url\n\n    raw_links = []\n    raw_unique_links = []\n\n    # Get \"href\" from all \"a\" tags\n    links = soup.find_all('a')\n    for link in links:\n        raw_links.append(link.get('href'))\n\n    # Get \"src\" from all \"img\" tags\n    img_links = soup.find_all('img')\n    for img_link in img_links:\n        raw_links.append(img_link.get('src'))\n\n    # Get \"href\" from all \"link\" tags\n    links = soup.find_all('link')\n    for link in links:\n        raw_links.append(link.get('href'))\n\n    # Get \"src\" from all \"script\" tags\n    img_links = soup.find_all('script')\n    for img_link in img_links:\n        raw_links.append(img_link.get('src'))\n\n    for link in raw_links:\n        if link not in raw_unique_links:\n            raw_unique_links.append(link)\n\n    unique_links = []\n    for link in raw_unique_links:\n        if link and len(link) > 1:\n            if link.startswith('//'):\n                link = prefix + link\n            elif link.startswith('/'):\n                link = full_base_url + link\n            elif link.startswith('./'):\n                link = full_base_url + link[1:]\n            elif link.startswith('#'):\n                link = full_base_url + link\n            elif '//' not in link:\n                link = full_base_url + \"/\" + link\n            else:\n                pass\n            unique_links.append(link)\n\n    return unique_links", "entry_point": "_get_unique_links", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seleniumbase/SeleniumBase/blob/62e5b43ee1f90a9ed923841bdd53b1b38358f43a/seleniumbase/fixtures/page_utils.py#L70-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036705", "code": "def _jq_format(code):\n    \"\"\"\n    DEPRECATED - Use re.escape() instead, which performs the intended action.\n    Use before throwing raw code such as 'div[tab=\"advanced\"]' into jQuery.\n    Selectors with quotes inside of quotes would otherwise break jQuery.\n    If you just want to escape quotes, there's escape_quotes_if_needed().\n    This is similar to \"json.dumps(value)\", but with one less layer of quotes.\n    \"\"\"\n    code = code.replace('\\\\', '\\\\\\\\').replace('\\t', '\\\\t').replace('\\n', '\\\\n')\n    code = code.replace('\\\"', '\\\\\\\"').replace('\\'', '\\\\\\'')\n    code = code.replace('\\v', '\\\\v').replace('\\a', '\\\\a').replace('\\f', '\\\\f')\n    code = code.replace('\\b', '\\\\b').replace(r'\\u', '\\\\u').replace('\\r', '\\\\r')\n    return code", "entry_point": "_jq_format", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/seleniumbase/SeleniumBase/blob/62e5b43ee1f90a9ed923841bdd53b1b38358f43a/seleniumbase/fixtures/js_utils.py#L634-L646", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036706", "code": "def _parse_row(rowvalues, rowtypes):\n    \"\"\"\n    Scan a single row from an Excel file, and return the list of ranges\n    corresponding to each consecutive span of non-empty cells in this row.\n    If all cells are empty, return an empty list. Each \"range\" in the list\n    is a tuple of the form `(startcol, endcol)`.\n\n    For example, if the row is the following:\n\n        [ ][ 1.0 ][ 23 ][ \"foo\" ][ ][ \"hello\" ][ ]\n\n    then the returned list of ranges will be:\n\n        [(1, 4), (5, 6)]\n\n    This algorithm considers a cell to be empty if its type is 0 (XL_EMPTY),\n    or 6 (XL_BLANK), or if it's a text cell containing empty string, or a\n    whitespace-only string. Numeric `0` is not considered empty.\n    \"\"\"\n    n = len(rowvalues)\n    assert n == len(rowtypes)\n    if not n:\n        return []\n    range_start = None\n    ranges = []\n    for i in range(n):\n        ctype = rowtypes[i]\n        cval = rowvalues[i]\n        # Check whether the cell is empty or not. If it is empty, and there is\n        # an active range being tracked - terminate it. On the other hand, if\n        # the cell is not empty and there isn't an active range, then start it.\n        if ctype == 0 or ctype == 6 or (ctype == 1 and\n                                        (cval == \"\" or cval.isspace())):\n            if range_start is not None:\n                ranges.append((range_start, i))\n                range_start = None\n        else:\n            if range_start is None:\n                range_start = i\n    if range_start is not None:\n        ranges.append((range_start, n))\n    return ranges", "entry_point": "_parse_row", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "[(0, 3)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/datatable/blob/dd5fba74d2ca85b66f82ae3c1e0b6ea2fd792564/datatable/xls.py#L106-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036707", "code": "def humanize_bytes(size):\n    \"\"\"\n    Convert given number of bytes into a human readable representation, i.e. add\n    prefix such as KB, MB, GB, etc. The `size` argument must be a non-negative\n    integer.\n\n    :param size: integer representing byte size of something\n    :return: string representation of the size, in human-readable form\n    \"\"\"\n    if size == 0: return \"0\"\n    if size is None: return \"\"\n    assert size >= 0, \"`size` cannot be negative, got %d\" % size\n    suffixes = \"TGMK\"\n    maxl = len(suffixes)\n    for i in range(maxl + 1):\n        shift = (maxl - i) * 10\n        if size >> shift == 0: continue\n        ndigits = 0\n        for nd in [3, 2, 1]:\n            if size >> (shift + 12 - nd * 3) == 0:\n                ndigits = nd\n                break\n        if ndigits == 0 or size == (size >> shift) << shift:\n            rounded_val = str(size >> shift)\n        else:\n            rounded_val = \"%.*f\" % (ndigits, size / (1 << shift))\n        return \"%s%sB\" % (rounded_val, suffixes[i] if i < maxl else \"\")", "entry_point": "humanize_bytes", "input": "3", "output": "'3B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/datatable/blob/dd5fba74d2ca85b66f82ae3c1e0b6ea2fd792564/datatable/utils/misc.py#L182-L208", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036708", "code": "def pypi_link(pkg_filename):\n    \"\"\"\n    Given the filename, including md5 fragment, construct the\n    dependency link for PyPI.\n    \"\"\"\n    root = 'https://files.pythonhosted.org/packages/source'\n    name, sep, rest = pkg_filename.partition('-')\n    parts = root, name[0], name, pkg_filename\n    return '/'.join(parts)", "entry_point": "pypi_link", "input": "'a,b,c'", "output": "'https://files.pythonhosted.org/packages/source/a/a,b,c/a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setup.py#L79-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036709", "code": "def parse_bdist_wininst(name):\n    \"\"\"Return (base,pyversion) or (None,None) for possible .exe name\"\"\"\n\n    lower = name.lower()\n    base, py_ver, plat = None, None, None\n\n    if lower.endswith('.exe'):\n        if lower.endswith('.win32.exe'):\n            base = name[:-10]\n            plat = 'win32'\n        elif lower.startswith('.win32-py', -16):\n            py_ver = name[-7:-4]\n            base = name[:-16]\n            plat = 'win32'\n        elif lower.endswith('.win-amd64.exe'):\n            base = name[:-14]\n            plat = 'win-amd64'\n        elif lower.startswith('.win-amd64-py', -20):\n            py_ver = name[-7:-4]\n            base = name[:-20]\n            plat = 'win-amd64'\n    return base, py_ver, plat", "entry_point": "parse_bdist_wininst", "input": "'a,b,c'", "output": "(None, None, None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/package_index.py#L61-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036710", "code": "def _splituser(host):\n    \"\"\"splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.\"\"\"\n    user, delim, host = host.rpartition('@')\n    return (user if delim else None), host", "entry_point": "_splituser", "input": "'AbC dEf'", "output": "(None, 'AbC dEf')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/package_index.py#L1094-L1097", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036711", "code": "def getCitiesDrawingXML(points):\n    ''' Build an XML string that contains a square for each city'''\n    xml = \"\"\n    for p in points:\n        x = str(p.x)\n        z = str(p.y)\n        xml += '<DrawBlock x=\"' + x + '\" y=\"7\" z=\"' + z + '\" type=\"beacon\"/>'\n        xml += '<DrawItem x=\"' + x + '\" y=\"10\" z=\"' + z + '\" type=\"ender_pearl\"/>'\n    return xml", "entry_point": "getCitiesDrawingXML", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Malmo/samples/Python_examples/tsp_race.py#L630-L638", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036712", "code": "def get_link_pages(links):\n        \"\"\"\n        Given a list of links, separate them into pages that can be displayed\n        to the user and navigated using the 1-9 and 0 number keys.\n        \"\"\"\n        link_pages = []\n        i = 0\n        while i < len(links):\n            link_page = []\n            while i < len(links) and len(link_page) < 10:\n                link_page.append(links[i])\n                i += 1\n            link_pages.append(link_page)\n        return link_pages", "entry_point": "get_link_pages", "input": "[5, 3, 1, 4]", "output": "[[5, 3, 1, 4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/terminal.py#L398-L411", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036713", "code": "def get_link_page_text(link_page):\n        \"\"\"\n        Construct the dialog box to display a list of links to the user.\n        \"\"\"\n        text = ''\n        for i, link in enumerate(link_page):\n            capped_link_text = (link['text'] if len(link['text']) <= 20\n                                else link['text'][:19] + '\u2026')\n            text += '[{}] [{}]({})\\n'.format(i, capped_link_text, link['href'])\n        return text", "entry_point": "get_link_page_text", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/terminal.py#L414-L423", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036714", "code": "def strip_textpad(text):\n        \"\"\"\n        Attempt to intelligently strip excess whitespace from the output of a\n        curses textpad.\n        \"\"\"\n\n        if text is None:\n            return text\n\n        # Trivial case where the textbox is only one line long.\n        if '\\n' not in text:\n            return text.rstrip()\n\n        # Allow one space at the end of the line. If there is more than one\n        # space, assume that a newline operation was intended by the user\n        stack, current_line = [], ''\n        for line in text.split('\\n'):\n            if line.endswith('  ') or not line:\n                stack.append(current_line + line.rstrip())\n                current_line = ''\n            else:\n                current_line += line\n        stack.append(current_line)\n\n        # Prune empty lines at the bottom of the textbox.\n        for item in stack[::-1]:\n            if not item:\n                stack.pop()\n            else:\n                break\n\n        out = '\\n'.join(stack)\n        return out", "entry_point": "strip_textpad", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/terminal.py#L878-L910", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036715", "code": "def chunk_sequence(sequence, chunk_length, allow_incomplete=True):\n    \"\"\"Given a sequence, divide it into sequences of length `chunk_length`.\n\n    :param allow_incomplete: If True, allow final chunk to be shorter if the\n        given sequence is not an exact multiple of `chunk_length`.\n        If False, the incomplete chunk will be discarded.\n    \"\"\"\n    (complete, leftover) = divmod(len(sequence), chunk_length)\n    if not allow_incomplete:\n        leftover = 0\n\n    chunk_count = complete + min(leftover, 1)\n\n    chunks = []\n    for x in range(chunk_count):\n        left = chunk_length * x\n        right = left + chunk_length\n        chunks.append(sequence[left:right])\n\n    return chunks", "entry_point": "chunk_sequence", "input": "['apple', 'banana', 'cherry'], 7, ['apple', 'banana', 'cherry']", "output": "[['apple', 'banana', 'cherry']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/helpers.py#L360-L379", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036716", "code": "def unmangle_name(name, classname):\n        \"\"\"Remove __ from the end of _name_ if it starts with __classname__\n        return the \"unmangled\" name.\n        \"\"\"\n        if name.startswith(classname) and name[-2:] != '__':\n            return name[len(classname) - 2:]\n        return name", "entry_point": "unmangle_name", "input": "'Hello World', 'Hello World'", "output": "'ld'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python-uncompyle6/blob/c5d7944e657f0ad05a0e2edd34e1acb27001abc0/uncompyle6/scanners/scanner2.py#L125-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036717", "code": "def flatten_list(node):\n    \"\"\"\n    List of expressions may be nested in groups of 32 and 1024\n    items. flatten that out and return the list\n    \"\"\"\n    flat_elems = []\n    for elem in node:\n        if elem == 'expr1024':\n            for subelem in elem:\n                assert subelem == 'expr32'\n                for subsubelem in subelem:\n                    flat_elems.append(subsubelem)\n        elif elem == 'expr32':\n            for subelem in elem:\n                assert subelem == 'expr'\n                flat_elems.append(subelem)\n        else:\n            flat_elems.append(elem)\n            pass\n        pass\n    return flat_elems", "entry_point": "flatten_list", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python-uncompyle6/blob/c5d7944e657f0ad05a0e2edd34e1acb27001abc0/uncompyle6/semantics/helper.py#L142-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036718", "code": "def untokenize_without_newlines(tokens):\n    \"\"\"Return source code based on tokens.\"\"\"\n    text = ''\n    last_row = 0\n    last_column = -1\n\n    for t in tokens:\n        token_string = t[1]\n        (start_row, start_column) = t[2]\n        (end_row, end_column) = t[3]\n\n        if start_row > last_row:\n            last_column = 0\n        if (\n            (start_column > last_column or token_string == '\\n') and\n            not text.endswith(' ')\n        ):\n            text += ' '\n\n        if token_string != '\\n':\n            text += token_string\n\n        last_row = end_row\n        last_column = end_column\n\n    return text.rstrip()", "entry_point": "untokenize_without_newlines", "input": "set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hhatto/autopep8/blob/fda3bb39181437b6b8a0aa0185f21ae5f14385dd/autopep8.py#L1525-L1550", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036719", "code": "def _leading_space_count(line):\n    \"\"\"Return number of leading spaces in line.\"\"\"\n    i = 0\n    while i < len(line) and line[i] == ' ':\n        i += 1\n    return i", "entry_point": "_leading_space_count", "input": "''", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hhatto/autopep8/blob/fda3bb39181437b6b8a0aa0185f21ae5f14385dd/autopep8.py#L3123-L3128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036720", "code": "def standard_deviation(numbers):\n    \"\"\"Return standard deviation.\"\"\"\n    numbers = list(numbers)\n    if not numbers:\n        return 0\n    mean = sum(numbers) / len(numbers)\n    return (sum((n - mean) ** 2 for n in numbers) /\n            len(numbers)) ** .5", "entry_point": "standard_deviation", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hhatto/autopep8/blob/fda3bb39181437b6b8a0aa0185f21ae5f14385dd/autopep8.py#L3973-L3980", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036721", "code": "def count_unbalanced_brackets(line):\n    \"\"\"Return number of unmatched open/close brackets.\"\"\"\n    count = 0\n    for opening, closing in ['()', '[]', '{}']:\n        count += abs(line.count(opening) - line.count(closing))\n\n    return count", "entry_point": "count_unbalanced_brackets", "input": "'abc'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hhatto/autopep8/blob/fda3bb39181437b6b8a0aa0185f21ae5f14385dd/autopep8.py#L3992-L3998", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036722", "code": "def split_at_offsets(line, offsets):\n    \"\"\"Split line at offsets.\n\n    Return list of strings.\n\n    \"\"\"\n    result = []\n\n    previous_offset = 0\n    current_offset = 0\n    for current_offset in sorted(offsets):\n        if current_offset < len(line) and previous_offset != current_offset:\n            result.append(line[previous_offset:current_offset].strip())\n        previous_offset = current_offset\n\n    result.append(line[current_offset:])\n\n    return result", "entry_point": "split_at_offsets", "input": "'walnut thistle harbour', [5, 3, 1, 4]", "output": "['w', 'al', 'n', 'u', 't thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hhatto/autopep8/blob/fda3bb39181437b6b8a0aa0185f21ae5f14385dd/autopep8.py#L4001-L4018", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036723", "code": "def convert_dict_to_params(src_dict):\n    \"\"\" convert dict to params string\n\n    Args:\n        src_dict (dict): source mapping data structure\n\n    Returns:\n        str: string params data\n\n    Examples:\n        >>> src_dict = {\n            \"a\": 1,\n            \"b\": 2\n        }\n        >>> convert_dict_to_params(src_dict)\n        >>> \"a=1&b=2\"\n\n    \"\"\"\n    return \"&\".join([\n        \"{}={}\".format(key, value)\n        for key, value in src_dict.items()\n    ])", "entry_point": "convert_dict_to_params", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HttpRunner/HttpRunner/blob/f259551bf9c8ba905eae5c1afcf2efea20ae0871/httprunner/utils.py#L145-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036724", "code": "def lower_dict_keys(origin_dict):\n    \"\"\" convert keys in dict to lower case\n\n    Args:\n        origin_dict (dict): mapping data structure\n\n    Returns:\n        dict: mapping with all keys lowered.\n\n    Examples:\n        >>> origin_dict = {\n            \"Name\": \"\",\n            \"Request\": \"\",\n            \"URL\": \"\",\n            \"METHOD\": \"\",\n            \"Headers\": \"\",\n            \"Data\": \"\"\n        }\n        >>> lower_dict_keys(origin_dict)\n            {\n                \"name\": \"\",\n                \"request\": \"\",\n                \"url\": \"\",\n                \"method\": \"\",\n                \"headers\": \"\",\n                \"data\": \"\"\n            }\n\n    \"\"\"\n    if not origin_dict or not isinstance(origin_dict, dict):\n        return origin_dict\n\n    return {\n        key.lower(): value\n        for key, value in origin_dict.items()\n    }", "entry_point": "lower_dict_keys", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HttpRunner/HttpRunner/blob/f259551bf9c8ba905eae5c1afcf2efea20ae0871/httprunner/utils.py#L169-L204", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036725", "code": "def get_uniform_comparator(comparator):\n    \"\"\" convert comparator alias to uniform name\n    \"\"\"\n    if comparator in [\"eq\", \"equals\", \"==\", \"is\"]:\n        return \"equals\"\n    elif comparator in [\"lt\", \"less_than\"]:\n        return \"less_than\"\n    elif comparator in [\"le\", \"less_than_or_equals\"]:\n        return \"less_than_or_equals\"\n    elif comparator in [\"gt\", \"greater_than\"]:\n        return \"greater_than\"\n    elif comparator in [\"ge\", \"greater_than_or_equals\"]:\n        return \"greater_than_or_equals\"\n    elif comparator in [\"ne\", \"not_equals\"]:\n        return \"not_equals\"\n    elif comparator in [\"str_eq\", \"string_equals\"]:\n        return \"string_equals\"\n    elif comparator in [\"len_eq\", \"length_equals\", \"count_eq\"]:\n        return \"length_equals\"\n    elif comparator in [\"len_gt\", \"count_gt\", \"length_greater_than\", \"count_greater_than\"]:\n        return \"length_greater_than\"\n    elif comparator in [\"len_ge\", \"count_ge\", \"length_greater_than_or_equals\", \\\n        \"count_greater_than_or_equals\"]:\n        return \"length_greater_than_or_equals\"\n    elif comparator in [\"len_lt\", \"count_lt\", \"length_less_than\", \"count_less_than\"]:\n        return \"length_less_than\"\n    elif comparator in [\"len_le\", \"count_le\", \"length_less_than_or_equals\", \\\n        \"count_less_than_or_equals\"]:\n        return \"length_less_than_or_equals\"\n    else:\n        return comparator", "entry_point": "get_uniform_comparator", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HttpRunner/HttpRunner/blob/f259551bf9c8ba905eae5c1afcf2efea20ae0871/httprunner/validator.py#L141-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036726", "code": "def __get_total_response_time(meta_datas_expanded):\n    \"\"\" caculate total response time of all meta_datas\n    \"\"\"\n    try:\n        response_time = 0\n        for meta_data in meta_datas_expanded:\n            response_time += meta_data[\"stat\"][\"response_time_ms\"]\n\n        return \"{:.2f}\".format(response_time)\n\n    except TypeError:\n        # failure exists\n        return \"N/A\"", "entry_point": "__get_total_response_time", "input": "['a', 'b', 'c']", "output": "'N/A'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/HttpRunner/HttpRunner/blob/f259551bf9c8ba905eae5c1afcf2efea20ae0871/httprunner/report.py#L248-L260", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036727", "code": "def _no_slots_copy(dct):\n    \"\"\"Internal helper: copy class __dict__ and clean slots class variables.\n    (They will be re-created if necessary by normal class machinery.)\n    \"\"\"\n    dict_copy = dict(dct)\n    if '__slots__' in dict_copy:\n        for slot in dict_copy['__slots__']:\n            dict_copy.pop(slot, None)\n    return dict_copy", "entry_point": "_no_slots_copy", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyrogram/pyrogram/blob/e7258a341ba905cfa86264c22040654db732ec1c/pyrogram/vendor/typing/typing.py#L899-L907", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036728", "code": "def purge_duplicates(list_in):\n    \"\"\"Remove duplicates from list while preserving order.\n\n    Parameters\n    ----------\n    list_in: Iterable\n\n    Returns\n    -------\n    list\n        List of first occurences in order\n    \"\"\"\n    _list = []\n    for item in list_in:\n        if item not in _list:\n            _list.append(item)\n    return _list", "entry_point": "purge_duplicates", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L237-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036729", "code": "def CalculateForecastStats(matched, available, possible=None):\n  \"\"\"Calculate forecast percentage stats.\n\n  Args:\n    matched: The number of matched impressions.\n    available: The number of available impressions.\n    possible: The optional number of possible impressions.\n\n  Returns:\n    The percentage of impressions that are available and possible.\n  \"\"\"\n  if matched > 0:\n    available_percent = (float(available) / matched) * 100.\n  else:\n    available_percent = 0\n\n  if possible is not None:\n    if matched > 0:\n      possible_percent = (possible/float(matched)) * 100.\n    else:\n      possible_percent = 0\n  else:\n    possible_percent = None\n\n  return available_percent, possible_percent", "entry_point": "CalculateForecastStats", "input": "False, 1, {'a': 1, 'b': 2}", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/ad_manager/v201811/forecast_service/get_availability_forecast.py#L221-L245", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036730", "code": "def BuildAdGroupCriterionOperations(adgroup_operations, number_of_keywords=1):\n  \"\"\"Builds the operations adding a Keyword Criterion to each AdGroup.\n\n  Args:\n    adgroup_operations: a list containing the operations that will add AdGroups.\n    number_of_keywords: an int defining the number of Keywords to be created.\n\n  Returns:\n    a list containing the operations that will create a new Keyword Criterion\n    associated with each provided AdGroup.\n  \"\"\"\n  criterion_operations = [\n      {\n          # The xsi_type of the operation can usually be guessed by the API\n          # because a given service only handles one type of operation.\n          # However, batch jobs process operations of different types, so\n          # the xsi_type must always be explicitly defined for these\n          # operations.\n          'xsi_type': 'AdGroupCriterionOperation',\n          'operand': {\n              'xsi_type': 'BiddableAdGroupCriterion',\n              'adGroupId': adgroup_operation['operand']['id'],\n              'criterion': {\n                  'xsi_type': 'Keyword',\n                  # Make 50% of keywords invalid to demonstrate error handling.\n                  'text': 'mars%s%s' % (i, '!!!' if i % 2 == 0 else ''),\n                  'matchType': 'BROAD'\n              }\n          },\n          'operator': 'ADD'\n      }\n      for adgroup_operation in adgroup_operations\n      for i in range(number_of_keywords)]\n\n  return criterion_operations", "entry_point": "BuildAdGroupCriterionOperations", "input": "{}, {1, 2, 3}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/campaign_management/add_complete_campaigns_using_batch_job.py#L129-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036731", "code": "def ar_path_to_x_path(ar_path, dest_element=None):\n    # type: (str, typing.Optional[str]) -> str\n    \"\"\"Get path in translation-dictionary.\"\"\"\n    ar_path_elements = ar_path.strip('/').split('/')\n    xpath = \".\"\n\n    for element in ar_path_elements[:-1]:\n        xpath += \"//A:SHORT-NAME[text()='\" + element + \"']/..\"\n    if dest_element:\n        xpath += \"//A:\" + dest_element + \"/A:SHORT-NAME[text()='\" + ar_path_elements[-1] + \"']/..\"\n    else:\n        xpath += \"//A:SHORT-NAME[text()='\" + ar_path_elements[-1] + \"']/..\"\n\n    return xpath", "entry_point": "ar_path_to_x_path", "input": "'Hello World', 'AbC dEf'", "output": "\".//A:AbC dEf/A:SHORT-NAME[text()='Hello World']/..\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ebroecker/canmatrix/blob/d6150b7a648350f051a11c431e9628308c8d5593/src/canmatrix/formats/arxml.py#L793-L806", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036732", "code": "def duplicate_object_hook(ordered_pairs):\n    \"\"\"Make lists out of duplicate keys.\"\"\"\n    json_dict = {}\n    for key, val in ordered_pairs:\n        existing_val = json_dict.get(key)\n        if not existing_val:\n            json_dict[key] = val\n        else:\n            if isinstance(existing_val, list):\n                existing_val.append(val)\n            else:\n                json_dict[key] = [existing_val, val]\n\n    return json_dict", "entry_point": "duplicate_object_hook", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/KimiNewt/pyshark/blob/089ea6208c4321f03bc548f491e00a053285918f/src/pyshark/tshark/tshark_json.py#L7-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036733", "code": "def isvector_or_scalar(a):\n    \"\"\"\n    one-dimensional arrays having shape [N],\n    row and column matrices having shape [1 N] and\n    [N 1] correspondingly, and their generalizations\n    having shape [1 1 ... N ... 1 1 1].\n    Scalars have shape [1 1 ... 1].\n    Empty arrays dont count\n    \"\"\"\n    try:\n        return a.size and a.ndim-a.shape.count(1) <= 1\n    except:\n        return False", "entry_point": "isvector_or_scalar", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/victorlei/smop/blob/bdad96b715d1dd75ce8ab4724f76b9b1bb1f61cd/smop/libsmop.py#L29-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036734", "code": "def get_stripped_prefix(source, prefix):\n    \"\"\"Go through source, extracting every key/value pair where the key starts\n    with the given prefix.\n    \"\"\"\n    cut = len(prefix)\n    return {\n        k[cut:]: v for k, v in source.items()\n        if k.startswith(prefix)\n    }", "entry_point": "get_stripped_prefix", "input": "{}, '  padded  '", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fishtown-analytics/dbt/blob/aa4f771df28b307af0cf9fe2fc24432f10a8236b/core/dbt/task/generate.py#L19-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036735", "code": "def format_stats(stats):\n    \"\"\"Given a dictionary following this layout:\n\n        {\n            'encoded:label': 'Encoded',\n            'encoded:value': 'Yes',\n            'encoded:description': 'Indicates if the column is encoded',\n            'encoded:include': True,\n\n            'size:label': 'Size',\n            'size:value': 128,\n            'size:description': 'Size of the table in MB',\n            'size:include': True,\n        }\n\n    format_stats will convert the dict into this structure:\n\n        {\n            'encoded': {\n                'id': 'encoded',\n                'label': 'Encoded',\n                'value': 'Yes',\n                'description': 'Indicates if the column is encoded',\n                'include': True\n            },\n            'size': {\n                'id': 'size',\n                'label': 'Size',\n                'value': 128,\n                'description': 'Size of the table in MB',\n                'include': True\n            }\n        }\n    \"\"\"\n    stats_collector = {}\n    for stat_key, stat_value in stats.items():\n        stat_id, stat_field = stat_key.split(\":\")\n\n        stats_collector.setdefault(stat_id, {\"id\": stat_id})\n        stats_collector[stat_id][stat_field] = stat_value\n\n    # strip out all the stats we don't want\n    stats_collector = {\n        stat_id: stats\n        for stat_id, stats in stats_collector.items()\n        if stats.get('include', False)\n    }\n\n    # we always have a 'has_stats' field, it's never included\n    has_stats = {\n        'id': 'has_stats',\n        'label': 'Has Stats?',\n        'value': len(stats_collector) > 0,\n        'description': 'Indicates whether there are statistics for this table',\n        'include': False,\n    }\n    stats_collector['has_stats'] = has_stats\n    return stats_collector", "entry_point": "format_stats", "input": "{}", "output": "{'has_stats': {'id': 'has_stats', 'label': 'Has Stats?', 'value': False, 'description': 'Indicates whether there are statistics for this table', 'include': False}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fishtown-analytics/dbt/blob/aa4f771df28b307af0cf9fe2fc24432f10a8236b/core/dbt/task/generate.py#L30-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036736", "code": "def is_valid_ip_prefix(prefix, bits):\n    \"\"\"Returns True if *prefix* is a valid IPv4 or IPv6 address prefix.\n\n    *prefix* should be a number between 0 to *bits* length.\n    \"\"\"\n    try:\n        # Prefix should be a number\n        prefix = int(prefix)\n    except ValueError:\n        return False\n\n    # Prefix should be a number between 0 to *bits*\n    return 0 <= prefix <= bits", "entry_point": "is_valid_ip_prefix", "input": "'walnut thistle harbour', [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/osrg/ryu/blob/6f906e72c92e10bd0264c9b91a2f7bb85b97780c/ryu/services/protocols/bgp/utils/validation.py#L39-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036737", "code": "def parse_column_key(setting_string):\n        \"\"\"\n        Parses 'setting_string' as str formatted in <column>[:<key>]\n        and returns str type 'column' and 'key'\n        \"\"\"\n        if ':' in setting_string:\n            # splits <column>:<key> into <column> and <key>\n            column, key = setting_string.split(':', 1)\n        else:\n            # stores <column> and <value>=None\n            column = setting_string\n            key = None\n\n        return column, key", "entry_point": "parse_column_key", "input": "'Hello World'", "output": "('Hello World', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/osrg/ryu/blob/6f906e72c92e10bd0264c9b91a2f7bb85b97780c/ryu/lib/ovs/vsctl.py#L759-L772", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036738", "code": "def default_help_formatter(quick_helps):\n    \"\"\"Apply default formatting for help messages\n\n        :param quick_helps: list of tuples containing help info\n     \"\"\"\n    ret = ''\n    for line in quick_helps:\n        cmd_path, param_hlp, cmd_hlp = line\n        ret += ' '.join(cmd_path) + ' '\n        if param_hlp:\n            ret += param_hlp + ' '\n        ret += '- ' + cmd_hlp + '\\n'\n    return ret", "entry_point": "default_help_formatter", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/osrg/ryu/blob/6f906e72c92e10bd0264c9b91a2f7bb85b97780c/ryu/services/protocols/bgp/operator/command.py#L15-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036739", "code": "def _ephem_convert_to_seconds_and_microseconds(date):\n    # utility from unreleased PyEphem 3.6.7.1\n    \"\"\"Converts a PyEphem date into seconds\"\"\"\n    microseconds = int(round(24 * 60 * 60 * 1000000 * date))\n    seconds, microseconds = divmod(microseconds, 1000000)\n    seconds -= 2209032000  # difference between epoch 1900 and epoch 1970\n    return seconds, microseconds", "entry_point": "_ephem_convert_to_seconds_and_microseconds", "input": "False", "output": "(-2209032000, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/solarposition.py#L453-L459", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036740", "code": "def map_midc_to_pvlib(variable_map, field_name):\n    \"\"\"A mapper function to rename Dataframe columns to their pvlib counterparts.\n\n    Parameters\n    ----------\n    variable_map: Dictionary\n        A dictionary for mapping MIDC field name to pvlib name. See\n        VARIABLE_MAP for default value and description of how to construct\n        this argument.\n    field_name: string\n        The Column to map.\n\n    Returns\n    -------\n    label: string\n        The pvlib variable name associated with the MIDC field or the input if\n        a mapping does not exist.\n\n    Notes\n    -----\n    Will fail if field_name to be mapped matches an entry in VARIABLE_MAP and\n    does not contain brackets. This should not be an issue unless MIDC file\n    headers are updated.\n\n    \"\"\"\n    new_field_name = field_name\n    for midc_name, pvlib_name in variable_map.items():\n        if field_name.startswith(midc_name):\n            # extract the instrument and units field and then remove units\n            instrument_units = field_name[len(midc_name):]\n            units_index = instrument_units.find('[')\n            instrument = instrument_units[:units_index - 1]\n            new_field_name = pvlib_name + instrument.replace(' ', '_')\n            break\n    return new_field_name", "entry_point": "map_midc_to_pvlib", "input": "{'a': 1, 'b': 2}, 'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/midc.py#L30-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036741", "code": "def _build_kwargs(keys, input_dict):\n    \"\"\"\n    Parameters\n    ----------\n    keys : iterable\n        Typically a list of strings.\n    adict : dict-like\n        A dictionary from which to attempt to pull each key.\n\n    Returns\n    -------\n    kwargs : dict\n        A dictionary with only the keys that were in input_dict\n    \"\"\"\n\n    kwargs = {}\n    for key in keys:\n        try:\n            kwargs[key] = input_dict[key]\n        except KeyError:\n            pass\n\n    return kwargs", "entry_point": "_build_kwargs", "input": "[5, 3, 1, 4], {'a': 1, 'b': 2}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L229-L251", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036742", "code": "def align_buf(buf, sample_width):\n    \"\"\"In case of buffer size not aligned to sample_width pad it with 0s\"\"\"\n    remainder = len(buf) % sample_width\n    if remainder != 0:\n        buf += b'\\0' * (sample_width - remainder)\n    return buf", "entry_point": "align_buf", "input": "['apple', 'banana', 'cherry'], 5", "output": "['apple', 'banana', 'cherry', 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py#L61-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036743", "code": "def _matches(o, pattern):\n    \"\"\"Match a pattern of types in a sequence.\"\"\"\n    if not len(o) == len(pattern):\n        return False\n    comps = zip(o,pattern)\n    return all(isinstance(obj,kind) for obj,kind in comps)", "entry_point": "_matches", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/ipywidgets/widgets/interaction.py#L83-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036744", "code": "def mark_sentence_boundaries(sequences, drop=0.0):  # pragma: no cover\n    \"\"\"Pad sentence sequences with EOL markers.\"\"\"\n    for sequence in sequences:\n        sequence.insert(0, \"-EOL-\")\n        sequence.insert(0, \"-EOL-\")\n        sequence.append(\"-EOL-\")\n        sequence.append(\"-EOL-\")\n    return sequences, None", "entry_point": "mark_sentence_boundaries", "input": "[], ['a', 'b', 'c']", "output": "([], None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/explosion/thinc/blob/90129be5f0d6c665344245a7c37dbe1b8afceea2/thinc/neural/util.py#L97-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036745", "code": "def _convert_pandas_csv_options(pandas_options, columns):\n    ''' Translate `pd.read_csv()` options into `pd.DataFrame()` especially for header.\n\n    Args:\n        pandas_option (dict):\n            pandas options like {'header': None}.\n        columns (list):\n            list of column name.\n    '''\n\n    _columns = pandas_options.pop('names', columns)\n    header = pandas_options.pop('header', None)\n    pandas_options.pop('encoding', None)\n\n    if header == 'infer':\n        header_line_number = 0 if not bool(_columns) else None\n    else:\n        header_line_number = header\n\n    return _columns, header_line_number", "entry_point": "_convert_pandas_csv_options", "input": "{'x': [1, 2], 'y': []}, []", "output": "([], None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/chezou/tabula-py/blob/e61d46ee3c93bb40396e48dac5a9493e898f561a/tabula/wrapper.py#L334-L353", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036746", "code": "def value_to_int(attrib, key):\n    \"\"\" Massage runs in an inning to 0 if an empty string,\n    or key not found. Otherwise return the value \"\"\"\n    val = attrib.get(key, 0)\n    if isinstance(val, str):\n        if val.isspace() or val == '':\n            return 0\n    return val", "entry_point": "value_to_int", "input": "{'x': [1, 2], 'y': []}, 2.0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/panzarino/mlbgame/blob/0a2d10540de793fdc3b8476aa18f5cf3b53d0b54/mlbgame/game.py#L246-L253", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036747", "code": "def ensure_final_value(packageName, arsc, value):\n    \"\"\"Ensure incoming value is always the value, not the resid\n\n    androguard will sometimes return the Android \"resId\" aka\n    Resource ID instead of the actual value.  This checks whether\n    the value is actually a resId, then performs the Android\n    Resource lookup as needed.\n\n    \"\"\"\n    if value:\n        returnValue = value\n        if value[0] == '@':\n            # TODO: @packagename:DEADBEEF is not supported here!\n            try:  # can be a literal value or a resId\n                res_id = int('0x' + value[1:], 16)\n                res_id = arsc.get_id(packageName, res_id)[1]\n                returnValue = arsc.get_string(packageName, res_id)[1]\n            except (ValueError, TypeError):\n                pass\n        return returnValue\n    return ''", "entry_point": "ensure_final_value", "input": "'', [[1, 2], [3], []], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L2084-L2104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036748", "code": "def FormatClassToPython(i):\n    \"\"\"\n    Transform a typed class name into a form which can be used as a python\n    attribute\n\n    example::\n\n        >>> FormatClassToPython('Lfoo/bar/foo/Barfoo$InnerClass;')\n        'Lfoo_bar_foo_Barfoo_InnerClass'\n\n    :param i: classname to transform\n    :rtype: str\n    \"\"\"\n    i = i[:-1]\n    i = i.replace(\"/\", \"_\")\n    i = i.replace(\"$\", \"_\")\n\n    return i", "entry_point": "FormatClassToPython", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbou'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L874-L891", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036749", "code": "def FormatNameToPython(i):\n    \"\"\"\n    Transform a (method) name into a form which can be used as a python\n    attribute\n\n    example::\n\n        >>> FormatNameToPython('<clinit>')\n        'clinit'\n\n    :param i: name to transform\n    :rtype: str\n    \"\"\"\n\n    i = i.replace(\"<\", \"\")\n    i = i.replace(\">\", \"\")\n    i = i.replace(\"$\", \"_\")\n\n    return i", "entry_point": "FormatNameToPython", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L922-L940", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036750", "code": "def FormatDescriptorToPython(i):\n    \"\"\"\n    Format a descriptor into a form which can be used as a python attribute\n\n    example::\n\n        >>> FormatDescriptorToPython('(Ljava/lang/Long; Ljava/lang/Long; Z Z)V')\n        'Ljava_lang_LongLjava_lang_LongZZV\n\n    :param i: name to transform\n    :rtype: str\n    \"\"\"\n\n    i = i.replace(\"/\", \"_\")\n    i = i.replace(\";\", \"\")\n    i = i.replace(\"[\", \"\")\n    i = i.replace(\"(\", \"\")\n    i = i.replace(\")\", \"\")\n    i = i.replace(\" \", \"\")\n    i = i.replace(\"$\", \"\")\n\n    return i", "entry_point": "FormatDescriptorToPython", "input": "'Hello World'", "output": "'HelloWorld'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L943-L964", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036751", "code": "def string(s):\n    \"\"\"\n    Convert a string to a escaped ASCII representation including quotation marks\n    :param s: a string\n    :return: ASCII escaped string\n    \"\"\"\n    ret = ['\"']\n    for c in s:\n        if ' ' <= c < '\\x7f':\n            if c == \"'\" or c == '\"' or c == '\\\\':\n                ret.append('\\\\')\n            ret.append(c)\n            continue\n        elif c <= '\\x7f':\n            if c in ('\\r', '\\n', '\\t'):\n                # unicode-escape produces bytes\n                ret.append(c.encode('unicode-escape').decode(\"ascii\"))\n                continue\n        i = ord(c)\n        ret.append('\\\\u')\n        ret.append('%x' % (i >> 12))\n        ret.append('%x' % ((i >> 8) & 0x0f))\n        ret.append('%x' % ((i >> 4) & 0x0f))\n        ret.append('%x' % (i & 0x0f))\n    ret.append('\"')\n    return ''.join(ret)", "entry_point": "string", "input": "['apple', 'banana', 'cherry']", "output": "'\"applebananacherry\"'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/decompiler/dad/writer.py#L696-L721", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036752", "code": "def id_by_index(index, resources):\n        \"\"\"Helper method to fetch the id or address of a resource by its index\n\n        Args:\n            resources (list of objects): The resources to be paginated\n            index (integer): The index of the target resource\n\n        Returns:\n            str: The address or header_signature of the resource,\n                returns an empty string if not found\n        \"\"\"\n        if index < 0 or index >= len(resources):\n            return ''\n\n        try:\n            return resources[index].header_signature\n        except AttributeError:\n            return resources[index].address", "entry_point": "id_by_index", "input": "10, [-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/client_handlers.py#L411-L428", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036753", "code": "def _compare_across(collections, key):\n    \"\"\"Return whether all the collections return equal values when called with\n    `key`.\"\"\"\n    if len(collections) < 2:\n        return True\n    c0 = key(collections[0])\n    return all(c0 == key(c) for c in collections[1:])", "entry_point": "_compare_across", "input": "set(), set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/cli/sawtooth_cli/network_command/compare.py#L574-L580", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036754", "code": "def to_camel_case(text):\n    \"\"\"Convert to camel case.\n\n    :param str text:\n    :rtype: str\n    :return:\n    \"\"\"\n    split = text.split('_')\n    return split[0] + \"\".join(x.title() for x in split[1:])", "entry_point": "to_camel_case", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/line/line-bot-sdk-python/blob/1b38bfc2497ff3e3c75be4b50e0f1b7425a07ce0/linebot/utils.py#L39-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036755", "code": "def remove_spines(ax, sides):\n    \"\"\"\n    Remove spines of axis.\n\n    Parameters:\n      ax: axes to operate on\n      sides: list of sides: top, left, bottom, right\n\n    Examples:\n    removespines(ax, ['top'])\n    removespines(ax, ['top', 'bottom', 'right', 'left'])\n    \"\"\"\n    for side in sides:\n        ax.spines[side].set_visible(False)\n    return ax", "entry_point": "remove_spines", "input": "{'x': [1, 2], 'y': []}, set()", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CamDavidsonPilon/lifelines/blob/bdf6be6f1d10eea4c46365ee0ee6a47d8c30edf8/lifelines/plotting.py#L152-L166", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036756", "code": "def move_spines(ax, sides, dists):\n    \"\"\"\n    Move the entire spine relative to the figure.\n\n    Parameters:\n      ax: axes to operate on\n      sides: list of sides to move. Sides: top, left, bottom, right\n      dists: list of float distances to move. Should match sides in length.\n\n    Example:\n    move_spines(ax, sides=['left', 'bottom'], dists=[-0.02, 0.1])\n    \"\"\"\n    for side, dist in zip(sides, dists):\n        ax.spines[side].set_position((\"axes\", dist))\n    return ax", "entry_point": "move_spines", "input": "['apple', 'banana', 'cherry'], [], [5, 3, 1, 4]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CamDavidsonPilon/lifelines/blob/bdf6be6f1d10eea4c46365ee0ee6a47d8c30edf8/lifelines/plotting.py#L169-L183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036757", "code": "def format_cmd_output(cmd, output, name):\n    \"\"\"format command output for docs\"\"\"\n    formatted = '.. code-block:: console\\n\\n'\n    formatted += '   (venv)$ {c}\\n'.format(c=cmd)\n    lines = output.split(\"\\n\")\n    if name != 'help':\n        for idx, line in enumerate(lines):\n            if len(line) > 100:\n                lines[idx] = line[:100] + ' (...)'\n        if len(lines) > 12:\n            tmp_lines = lines[:5] + ['(...)'] + lines[-5:]\n            if ' -l' in cmd or ' --list-defaults' in cmd:\n                # find a line that uses a limit from the API,\n                #  and a line with None (unlimited)\n                api_line = None\n                none_line = None\n                for line in lines:\n                    if '(API)' in line:\n                        api_line = line\n                        break\n                for line in lines:\n                    if line.strip().endswith('None'):\n                        none_line = line\n                        break\n                tmp_lines = lines[:5]\n                if api_line not in tmp_lines and api_line is not None:\n                    tmp_lines = tmp_lines + ['(...)'] + [api_line]\n                if none_line not in tmp_lines and none_line is not None:\n                    tmp_lines = tmp_lines + ['(...)'] + [none_line]\n                tmp_lines = tmp_lines + ['(...)'] + lines[-5:]\n            lines = tmp_lines\n    for line in lines:\n        if line.strip() == '':\n            continue\n        formatted += '   ' + line + \"\\n\"\n    formatted += '\\n'\n    return formatted", "entry_point": "format_cmd_output", "input": "'walnut thistle harbour', 'walnut thistle harbour', {'a': 1, 'b': 2}", "output": "'.. code-block:: console\\n\\n   (venv)$ walnut thistle harbour\\n   walnut thistle harbour\\n\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jantman/awslimitchecker/blob/e50197f70f3d0abcc5cfc7fde6336f548b790e34/docs/build_generated_docs.py#L247-L283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036758", "code": "def dict2cols(d, spaces=2, separator=' '):\n    \"\"\"\n    Take a dict of string keys and string values, and return a string with\n    them formatted as two columns separated by at least ``spaces`` number of\n    ``separator`` characters.\n\n    :param d: dict of string keys, string values\n    :type d: dict\n    :param spaces: number of spaces to separate columns by\n    :type spaces: int\n    :param separator: character to fill in between columns\n    :type separator: str\n    \"\"\"\n    if len(d) == 0:\n        return ''\n    s = ''\n    maxlen = max([len(k) for k in d.keys()])\n    fmt_str = '{k:' + separator + '<' + str(maxlen + spaces) + '}{v}\\n'\n    for k in sorted(d.keys()):\n        s += fmt_str.format(\n            k=k,\n            v=d[k],\n        )\n    return s", "entry_point": "dict2cols", "input": "[], set(), ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jantman/awslimitchecker/blob/e50197f70f3d0abcc5cfc7fde6336f548b790e34/awslimitchecker/utils.py#L75-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036759", "code": "def get_axis_padding(padding):\n    \"\"\"\n    Process a padding value supplied as a tuple or number and returns\n    padding values for x-, y- and z-axis.\n    \"\"\"\n    if isinstance(padding, tuple):\n        if len(padding) == 2:\n            xpad, ypad = padding\n            zpad = 0\n        elif len(padding) == 3:\n            xpad, ypad, zpad = padding\n        else:\n            raise ValueError('Padding must be supplied as an number applied '\n                             'to all axes or a length two or three tuple '\n                             'corresponding to the x-, y- and optionally z-axis')\n    else:\n        xpad, ypad, zpad = (padding,)*3\n    return (xpad, ypad, zpad)", "entry_point": "get_axis_padding", "input": "[[1, 2], [3], []]", "output": "([[1, 2], [3], []], [[1, 2], [3], []], [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L351-L368", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036760", "code": "def rgb2hex(rgb):\n    \"\"\"\n    Convert RGB(A) tuple to hex.\n    \"\"\"\n    if len(rgb) > 3:\n        rgb = rgb[:-1]\n    return \"#{0:02x}{1:02x}{2:02x}\".format(*(int(v*255) for v in rgb))", "entry_point": "rgb2hex", "input": "[1, 2, 3]", "output": "'#ff1fe2fd'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L1035-L1041", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036761", "code": "def _compute_subplot_domains(widths, spacing):\n    \"\"\"\n    Compute normalized domain tuples for a list of widths and a subplot\n    spacing value\n\n    Parameters\n    ----------\n    widths: list of float\n        List of the desired withs of each subplot. The length of this list\n        is also the specification of the number of desired subplots\n    spacing: float\n        Spacing between subplots in normalized coordinates\n\n    Returns\n    -------\n    list of tuple of float\n    \"\"\"\n    # normalize widths\n    widths_sum = float(sum(widths))\n    total_spacing = (len(widths) - 1) * spacing\n    widths = [(w / widths_sum)*(1-total_spacing) for w in widths]\n    domains = []\n\n    for c in range(len(widths)):\n        domain_start = c * spacing + sum(widths[:c])\n        domain_stop = min(1, domain_start + widths[c])\n        domains.append((domain_start, domain_stop))\n\n    return domains", "entry_point": "_compute_subplot_domains", "input": "{1, 2, 3}, True", "output": "[(0, -0.16666666666666666), (0.8333333333333334, 0.5), (1.5, 1)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/plotly/util.py#L540-L568", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036762", "code": "def tree_attribute(identifier):\n    \"\"\"\n    Predicate that returns True for custom attributes added to AttrTrees\n    that are not methods, properties or internal attributes.\n\n    These custom attributes start with a capitalized character when\n    applicable (not applicable to underscore or certain unicode characters)\n    \"\"\"\n    if identifier[0].upper().isupper() is False and identifier[0] != '_':\n        return True\n    else:\n        return identifier[0].isupper()", "entry_point": "tree_attribute", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/util.py#L351-L362", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036763", "code": "def capitalize_unicode_name(s):\n    \"\"\"\n    Turns a string such as 'capital delta' into the shortened,\n    capitalized version, in this case simply 'Delta'. Used as a\n    transform in sanitize_identifier.\n    \"\"\"\n    index = s.find('capital')\n    if index == -1: return s\n    tail = s[index:].replace('capital', '').strip()\n    tail = tail[0].upper() + tail[1:]\n    return s[:index] + tail", "entry_point": "capitalize_unicode_name", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/util.py#L545-L555", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036764", "code": "def int_to_alpha(n, upper=True):\n    \"Generates alphanumeric labels of form A-Z, AA-ZZ etc.\"\n    casenum = 65 if upper else 97\n    label = ''\n    count= 0\n    if n == 0: return str(chr(n + casenum))\n    while n >= 0:\n        mod, div = n % 26, n\n        for _ in range(count):\n            div //= 26\n        div %= 26\n        if count == 0:\n            val = mod\n        else:\n            val = div\n        label += str(chr(val + casenum))\n        count += 1\n        n -= 26**count\n    return label[::-1]", "entry_point": "int_to_alpha", "input": "-1.5, set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/util.py#L1050-L1068", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036765", "code": "def stream_parameters(streams, no_duplicates=True, exclude=['name']):\n    \"\"\"\n    Given a list of streams, return a flat list of parameter name,\n    excluding those listed in the exclude list.\n\n    If no_duplicates is enabled, a KeyError will be raised if there are\n    parameter name clashes across the streams.\n    \"\"\"\n    param_groups = []\n    for s in streams:\n        if not s.contents and isinstance(s.hashkey, dict):\n            param_groups.append(list(s.hashkey))\n        else:\n            param_groups.append(list(s.contents))\n    names = [name for group in param_groups for name in group]\n\n    if no_duplicates:\n        clashes = sorted(set([n for n in names if names.count(n) > 1]))\n        clash_streams = []\n        for s in streams:\n            for c in clashes:\n                if c in s.contents or (not s.contents and isinstance(s.hashkey, dict) and c in s.hashkey):\n                    clash_streams.append(s)\n        if clashes:\n            clashing = ', '.join([repr(c) for c in clash_streams[:-1]])\n            raise Exception('The supplied stream objects %s and %s '\n                            'clash on the following parameters: %r'\n                            % (clashing, clash_streams[-1], clashes))\n    return [name for name in names if name not in exclude]", "entry_point": "stream_parameters", "input": "[], [-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/util.py#L1556-L1584", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036766", "code": "def mimebundle_to_html(bundle):\n    \"\"\"\n    Converts a MIME bundle into HTML.\n    \"\"\"\n    if isinstance(bundle, tuple):\n        data, metadata = bundle\n    else:\n        data = bundle\n    html = data.get('text/html', '')\n    if 'application/javascript' in data:\n        js = data['application/javascript']\n        html += '\\n<script type=\"application/javascript\">{js}</script>'.format(js=js)\n    return html", "entry_point": "mimebundle_to_html", "input": "{'a': 1, 'b': 2}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/util.py#L2007-L2019", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036767", "code": "def match_dim_specs(specs1, specs2):\n    \"\"\"Matches dimension specs used to link axes.\n\n    Axis dimension specs consists of a list of tuples corresponding\n    to each dimension, each tuple spec has the form (name, label, unit).\n    The name and label must match exactly while the unit only has to\n    match if both specs define one.\n    \"\"\"\n    if (specs1 is None or specs2 is None) or (len(specs1) != len(specs2)):\n        return False\n    for spec1, spec2 in zip(specs1, specs2):\n        for s1, s2 in zip(spec1, spec2):\n            if s1 is None or s2 is None:\n                continue\n            if s1 != s2:\n                return False\n    return True", "entry_point": "match_dim_specs", "input": "['a', 'b', 'c'], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L867-L883", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036768", "code": "def sanitizer(name, replacements=[(':','_'), ('/','_'), ('\\\\','_')]):\n    \"\"\"\n    String sanitizer to avoid problematic characters in filenames.\n    \"\"\"\n    for old,new in replacements:\n        name = name.replace(old,new)\n    return name", "entry_point": "sanitizer", "input": "'walnut thistle harbour', []", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L34-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036769", "code": "def unique(lst):\n    \"\"\"\n    Return unique elements\n\n    :class:`pandas.unique` and :class:`numpy.unique` cast\n    mixed type lists to the same type. They are faster, but\n    some times we want to maintain the type.\n\n    Parameters\n    ----------\n    lst : list-like\n        List of items\n\n    Returns\n    -------\n    out : list\n        Unique items in the order that they appear in the\n        input.\n\n    Examples\n    --------\n    >>> import pandas as pd\n    >>> import numpy as np\n    >>> lst = ['one', 'two', 123, 'three']\n    >>> pd.unique(lst)\n    array(['one', 'two', '123', 'three'], dtype=object)\n    >>> np.unique(lst)\n    array(['123', 'one', 'three', 'two'],\n          dtype='<U5')\n    >>> unique(lst)\n    ['one', 'two', 123, 'three']\n\n    pandas and numpy cast 123 to a string!, and numpy does not\n    even maintain the order.\n    \"\"\"\n    seen = set()\n\n    def make_seen(x):\n        seen.add(x)\n        return x\n\n    return [make_seen(x) for x in lst if x not in seen]", "entry_point": "unique", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/has2k1/plydata/blob/d8ca85ff70eee621e96f7c74034e90fec16e8b61/plydata/utils.py#L215-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036770", "code": "def frames_to_ms(frames, fps):\n    \"\"\"\n    Convert frame-based duration to milliseconds.\n    \n    Arguments:\n        frames: Number of frames (should be int).\n        fps: Framerate (must be a positive number, eg. 23.976).\n    \n    Returns:\n        Number of milliseconds (rounded to int).\n        \n    Raises:\n        ValueError: fps was negative or zero.\n    \n    \"\"\"\n    if fps <= 0:\n        raise ValueError(\"Framerate must be positive number (%f).\" % fps)\n\n    return int(round(frames * (1000 / fps)))", "entry_point": "frames_to_ms", "input": "-1.5, 2.0", "output": "-750", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tkarabela/pysubs2/blob/6439eb5159e6aa6b47e0f8e1d950e8bdd7c5341f/pysubs2/time.py#L68-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036771", "code": "def __Calc_HSL_to_RGB_Components(var_q, var_p, C):\n    \"\"\"\n    This is used in HSL_to_RGB conversions on R, G, and B.\n    \"\"\"\n    if C < 0:\n        C += 1.0\n    if C > 1:\n        C -= 1.0\n\n    # Computing C of vector (Color R, Color G, Color B)\n    if C < (1.0 / 6.0):\n        return var_p + ((var_q - var_p) * 6.0 * C)\n    elif (1.0 / 6.0) <= C < 0.5:\n        return var_q\n    elif 0.5 <= C < (2.0 / 3.0):\n        return var_p + ((var_q - var_p) * 6.0 * ((2.0 / 3.0) - C))\n    else:\n        return var_p", "entry_point": "__Calc_HSL_to_RGB_Components", "input": "False, 2.0, True", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gtaylor/python-colormath/blob/1d168613718d2d7d31ec4230524e987ef66823c7/colormath/color_conversions.py#L674-L691", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036772", "code": "def unique_by_index(sequence):\n    \"\"\" unique elements in `sequence` in the order in which they occur\n\n    Parameters\n    ----------\n    sequence : iterable\n\n    Returns\n    -------\n    uniques : list\n        unique elements of sequence, ordered by the order in which the element\n        occurs in `sequence`\n    \"\"\"\n    uniques = []\n    for element in sequence:\n        if element not in uniques:\n            uniques.append(element)\n    return uniques", "entry_point": "unique_by_index", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/matthew-brett/delocate/blob/ed48de15fce31c3f52f1a9f32cae1b02fc55aa60/delocate/tools.py#L72-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036773", "code": "def drop_bids_suffix(fname):\n    \"\"\"\n    Given a filename sub-01_run-01_preproc.nii.gz, it will return ['sub-01_run-01', '.nii.gz']\n\n    Parameters\n    ----------\n\n    fname : str\n        BIDS filename with suffice. Directories should not be included.\n\n    Returns\n    -------\n    fname_head : str\n        BIDS filename with\n    fileformat : str\n        The file format (text after suffix)\n\n    Note\n    ------\n    This assumes that there are no periods in the filename\n    \"\"\"\n    if '/' in fname:\n        split = fname.split('/')\n        dirnames = '/'.join(split[:-1]) + '/'\n        fname = split[-1]\n    else:\n        dirnames = ''\n    tags = [tag for tag in fname.split('_') if '-' in tag]\n    fname_head = '_'.join(tags)\n    fileformat = '.' + '.'.join(fname.split('.')[1:])\n    return dirnames + fname_head, fileformat", "entry_point": "drop_bids_suffix", "input": "'abc'", "output": "('', '.')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wiheto/teneto/blob/80d7a83a9adc1714589b020627c45bd5b66248ab/teneto/utils/bidsutils.py#L24-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036774", "code": "def _process_features(features):\n    \"\"\"\n    Generate the `Features String` from an iterable of features.\n\n    :param features: The features to generate the features string from.\n    :type features: :class:`~collections.abc.Iterable` of :class:`str`\n    :return: The `Features String`\n    :rtype: :class:`bytes`\n\n    Generate the `Features String` from the given `features` as specified in\n    :xep:`390`.\n    \"\"\"\n    parts = [\n        feature.encode(\"utf-8\")+b\"\\x1f\"\n        for feature in features\n    ]\n    parts.sort()\n    return b\"\".join(parts)+b\"\\x1c\"", "entry_point": "_process_features", "input": "['apple', 'banana', 'cherry']", "output": "b'apple\\x1fbanana\\x1fcherry\\x1f\\x1c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/entitycaps/caps390.py#L33-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036775", "code": "def patch_uri(uri):\n    \"\"\"If a custom uri schema is used with python 2.6 (e.g. amqps),\n    it will ignore some of the parsing logic.\n\n        As a work-around for this we change the amqp/amqps schema\n        internally to use http/https.\n\n    :param str uri: AMQP Connection string\n    :rtype: str\n    \"\"\"\n    index = uri.find(':')\n    if uri[:index] == 'amqps':\n        uri = uri.replace('amqps', 'https', 1)\n    elif uri[:index] == 'amqp':\n        uri = uri.replace('amqp', 'http', 1)\n    return uri", "entry_point": "patch_uri", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eandersson/amqpstorm/blob/38330906c0af19eea482f43c5ce79bab98a1e064/amqpstorm/compatibility.py#L132-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036776", "code": "def format_ffmpeg_filter(name, params):\n  \"\"\" Build a string to call a FFMpeg filter. \"\"\"\n  return \"%s=%s\" % (name,\n                    \":\".join(\"%s=%s\" % (k, v) for k, v in params.items()))", "entry_point": "format_ffmpeg_filter", "input": "['a', 'b', 'c'], {'a': 1, 'b': 2}", "output": "\"['a', 'b', 'c']=a=1:b=2\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/desbma/r128gain/blob/011ee26fe3705a50925571785d206cba2806089a/r128gain/__init__.py#L71-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036777", "code": "def _nth_str(n):\n    \"\"\"Return posessive form of numeral `n`: 1st, 2nd, 3rd, etc.\"\"\"\n    if n % 10 == 1 and n % 100 != 11:\n        return \"%dst\" % n\n    if n % 10 == 2 and n % 100 != 12:\n        return \"%dnd\" % n\n    if n % 10 == 3 and n % 100 != 13:\n        return \"%drd\" % n\n    return \"%dth\" % n", "entry_point": "_nth_str", "input": "2.0", "output": "'2nd'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/typesentry/blob/0ca8ed0e62d15ffe430545e7648c9a9b2547b49c/typesentry/checks.py#L790-L798", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036778", "code": "def get_perm_codename(perm, fail_silently=True):\n    \"\"\"\n    Get permission codename from permission-string.\n\n    Examples\n    --------\n    >>> get_perm_codename('app_label.codename_model')\n    'codename_model'\n    >>> get_perm_codename('app_label.codename')\n    'codename'\n    >>> get_perm_codename('codename_model')\n    'codename_model'\n    >>> get_perm_codename('codename')\n    'codename'\n    >>> get_perm_codename('app_label.app_label.codename_model')\n    'app_label.codename_model'\n    \"\"\"\n    try:\n        perm = perm.split('.', 1)[1]\n    except IndexError as e:\n        if not fail_silently:\n            raise e\n    return perm", "entry_point": "get_perm_codename", "input": "'a,b,c', '  padded  '", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lambdalisue/django-permission/blob/580f7a1f857701d06ccf41163f188ac04fbc4fac/src/permission/utils/permissions.py#L12-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036779", "code": "def graph_hash(obj):\n    '''this hashes all types to a hash without colissions. python's hashing algorithms are not cross type compatable but hashing tuples with the type as the first element seems to do the trick'''\n    obj_type = type(obj)\n    try:\n        # this works for hashables\n        return hash((obj_type, obj))\n    except:\n        # this works for object containers since graphdb\n        # wants to identify different containers\n        # instead of the sum of their current internals\n        return hash((obj_type, id(obj)))", "entry_point": "graph_hash", "input": "[5, 3, 1, 4]", "output": "-4126585141065003753", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CodyKochmann/graphdb/blob/8c18830db4beda30204f5fd4450bc96eb39b0feb/graphdb/RamGraphDB.py#L13-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036780", "code": "def count_true_positive(truth, recommend):\n    \"\"\"Count number of true positives from given sets of samples.\n\n    Args:\n        truth (numpy 1d array): Set of truth samples.\n        recommend (numpy 1d array): Ordered set of recommended samples.\n\n    Returns:\n        int: Number of true positives.\n\n    \"\"\"\n    tp = 0\n    for r in recommend:\n        if r in truth:\n            tp += 1\n    return tp", "entry_point": "count_true_positive", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/takuti/flurs/blob/a998fc180b45db7eaf38dbbbf8125a93100b8a8c/flurs/utils/metric.py#L4-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036781", "code": "def average_precision(truth, recommend):\n    \"\"\"Average Precision (AP).\n\n    Args:\n        truth (numpy 1d array): Set of truth samples.\n        recommend (numpy 1d array): Ordered set of recommended samples.\n\n    Returns:\n        float: AP.\n\n    \"\"\"\n    if len(truth) == 0:\n        if len(recommend) == 0:\n            return 1.\n        return 0.\n\n    tp = accum = 0.\n    for n in range(recommend.size):\n        if recommend[n] in truth:\n            tp += 1.\n            accum += (tp / (n + 1.))\n    return accum / truth.size", "entry_point": "average_precision", "input": "[], ['a', 'b', 'c']", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/takuti/flurs/blob/a998fc180b45db7eaf38dbbbf8125a93100b8a8c/flurs/utils/metric.py#L66-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036782", "code": "def isSignatureValid(expected, received):\n    \"\"\"\n    Verifies that the received signature matches the expected value\n    \"\"\"\n    if expected:\n        if not received or expected != received:\n            return False\n    else:\n        if received:\n            return False\n    return True", "entry_point": "isSignatureValid", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cocagne/txdbus/blob/eb424918764b7b93eecd2a4e2e5c2d0b2944407b/txdbus/objects.py#L17-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036783", "code": "def byte_to_bitstring(byte):\n    \"\"\"Convert one byte to a list of bits\"\"\"\n    assert 0 <= byte <= 0xff\n    bits = [int(x) for x in list(bin(byte + 0x100)[3:])]\n    return bits", "entry_point": "byte_to_bitstring", "input": "False", "output": "[0, 0, 0, 0, 0, 0, 0, 0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tonyo/pyope/blob/1e9f9f15cd4b989d1bf3c607270bf6a8ae808b1e/pyope/util.py#L3-L7", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036784", "code": "def _split_path(path):\n    \"\"\"split a path return by the api\n\n    return\n        - the sentinel:\n        - the rest of the path as a list.\n        - the original path stripped of / for normalisation.\n    \"\"\"\n    path = path.strip('/')\n    list_path = path.split('/')\n    sentinel = list_path.pop(0)\n    return sentinel, list_path, path", "entry_point": "_split_path", "input": "'a,b,c'", "output": "('a,b,c', [], 'a,b,c')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jupyter/jupyter-drive/blob/545813377cb901235e8ea81f83b0ac7755dbd7a9/jupyterdrive/mixednbmanager.py#L21-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036785", "code": "def palindrome(seq):\n    '''Test whether a sequence is palindrome.\n\n    :param seq: Sequence to analyze (DNA or RNA).\n    :type seq: coral.DNA or coral.RNA\n    :returns: Whether a sequence is a palindrome.\n    :rtype: bool\n\n    '''\n    seq_len = len(seq)\n    if seq_len % 2 == 0:\n        # Sequence has even number of bases, can test non-overlapping seqs\n        wing = seq_len / 2\n        l_wing = seq[0: wing]\n        r_wing = seq[wing:]\n        if l_wing == r_wing.reverse_complement():\n            return True\n        else:\n            return False\n    else:\n        # Sequence has odd number of bases and cannot be a palindrome\n        return False", "entry_point": "palindrome", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_sequence.py#L444-L465", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036786", "code": "def _pair_deltas(seq, pars):\n    '''Add up nearest-neighbor parameters for a given sequence.\n\n    :param seq: DNA sequence for which to sum nearest neighbors\n    :type seq: str\n    :param pars: parameter set to use\n    :type pars: dict\n    :returns: nearest-neighbor delta_H and delta_S sums.\n    :rtype: tuple of floats\n\n    '''\n    delta0 = 0\n    delta1 = 0\n    for i in range(len(seq) - 1):\n        curchar = seq[i:i + 2]\n        delta0 += pars['delta_h'][curchar]\n        delta1 += pars['delta_s'][curchar]\n    return delta0, delta1", "entry_point": "_pair_deltas", "input": "set(), 0.5", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequence/melting_temp.py#L147-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036787", "code": "def camel_to_underscore(name):\n    '''Convert camel case style naming to underscore style naming\n\n    If there are existing underscores they will be collapsed with the\n    to-be-added underscores. Multiple consecutive capital letters will not be\n    split except for the last one.\n\n    >>> camel_to_underscore('SpamEggsAndBacon')\n    'spam_eggs_and_bacon'\n    >>> camel_to_underscore('Spam_and_bacon')\n    'spam_and_bacon'\n    >>> camel_to_underscore('Spam_And_Bacon')\n    'spam_and_bacon'\n    >>> camel_to_underscore('__SpamAndBacon__')\n    '__spam_and_bacon__'\n    >>> camel_to_underscore('__SpamANDBacon__')\n    '__spam_and_bacon__'\n    '''\n    output = []\n    for i, c in enumerate(name):\n        if i > 0:\n            pc = name[i - 1]\n            if c.isupper() and not pc.isupper() and pc != '_':\n                # Uppercase and the previous character isn't upper/underscore?\n                # Add the underscore\n                output.append('_')\n            elif i > 3 and not c.isupper():\n                # Will return the last 3 letters to check if we are changing\n                # case\n                previous = name[i - 3:i]\n                if previous.isalpha() and previous.isupper():\n                    output.insert(len(output) - 1, '_')\n\n        output.append(c.lower())\n\n    return ''.join(output)", "entry_point": "camel_to_underscore", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/formatters.py#L4-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036788", "code": "def re_escape(pattern, chars=frozenset(\"()[]{}?*+|^$\\\\.-#\")):\n    '''\n    Escape all special regex characters in pattern.\n    Logic taken from regex module.\n\n    :param pattern: regex pattern to escape\n    :type patterm: str\n    :returns: escaped pattern\n    :rtype: str\n    '''\n    escape = '\\\\{}'.format\n    return ''.join(\n        escape(c) if c in chars or c.isspace() else\n        '\\\\000' if c == '\\x00' else c\n        for c in pattern\n        )", "entry_point": "re_escape", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "'\\\\a\\\\b\\\\c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ergoithz/browsepy/blob/1612a930ef220fae507e1b152c531707e555bd92/browsepy/compat.py#L297-L312", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036789", "code": "def union_overlapping(intervals):\n    \"\"\"Union any overlapping intervals in the given set.\"\"\"\n    disjoint_intervals = []\n\n    for interval in intervals:\n        if disjoint_intervals and disjoint_intervals[-1].overlaps(interval):\n            disjoint_intervals[-1] = disjoint_intervals[-1].union(interval)\n        else:\n            disjoint_intervals.append(interval)\n\n    return disjoint_intervals", "entry_point": "union_overlapping", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/intervals.py#L128-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036790", "code": "def formatPathExpressions(seriesList):\n    \"\"\"\n    Returns a comma-separated list of unique path expressions.\n    \"\"\"\n    pathExpressions = sorted(set([s.pathExpression for s in seriesList]))\n    return ','.join(pathExpressions)", "entry_point": "formatPathExpressions", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L185-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036791", "code": "def changed(requestContext, seriesList):\n    \"\"\"\n    Takes one metric or a wildcard seriesList.\n    Output 1 when the value changed, 0 when null or the same\n    Example::\n\n        &target=changed(Server01.connections.handled)\n    \"\"\"\n    for series in seriesList:\n        series.name = series.pathExpression = 'changed(%s)' % series.name\n        previous = None\n        for index, value in enumerate(series):\n            if previous is None:\n                series[index] = 0\n            elif value is not None and previous != value:\n                series[index] = 1\n            else:\n                series[index] = 0\n            previous = value\n    return seriesList", "entry_point": "changed", "input": "set(), ''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L574-L593", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036792", "code": "def offset(requestContext, seriesList, factor):\n    \"\"\"\n    Takes one metric or a wildcard seriesList followed by a constant, and adds\n    the constant to each datapoint.\n\n    Example::\n\n        &target=offset(Server.instance01.threads.busy,10)\n\n    \"\"\"\n    for series in seriesList:\n        series.name = \"offset(%s,%g)\" % (series.name, float(factor))\n        series.pathExpression = series.name\n        for i, value in enumerate(series):\n            if value is not None:\n                series[i] = value + factor\n    return seriesList", "entry_point": "offset", "input": "'AbC dEf', [], 0.5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L1134-L1150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036793", "code": "def consolidateBy(requestContext, seriesList, consolidationFunc):\n    \"\"\"\n    Takes one metric or a wildcard seriesList and a consolidation function\n    name.\n\n    Valid function names are 'sum', 'average', 'min', and 'max'.\n\n    When a graph is drawn where width of the graph size in pixels is smaller\n    than the number of datapoints to be graphed, Graphite consolidates the\n    values to to prevent line overlap. The consolidateBy() function changes\n    the consolidation function from the default of 'average' to one of 'sum',\n    'max', or 'min'. This is especially useful in sales graphs, where\n    fractional values make no sense and a 'sum' of consolidated values is\n    appropriate.\n\n    Example::\n\n        &target=consolidateBy(Sales.widgets.largeBlue, 'sum')\n        &target=consolidateBy(Servers.web01.sda1.free_space, 'max')\n\n    \"\"\"\n    for series in seriesList:\n        # datalib will throw an exception, so it's not necessary to validate\n        # here\n        series.consolidationFunc = consolidationFunc\n        series.name = 'consolidateBy(%s,\"%s\")' % (series.name,\n                                                  series.consolidationFunc)\n        series.pathExpression = series.name\n    return seriesList", "entry_point": "consolidateBy", "input": "set(), set(), 2.0", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L1464-L1492", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036794", "code": "def alias(requestContext, seriesList, newName):\n    \"\"\"\n    Takes one metric or a wildcard seriesList and a string in quotes.\n    Prints the string instead of the metric name in the legend.\n\n    Example::\n\n        &target=alias(Sales.widgets.largeBlue,\"Large Blue Widgets\")\n\n    \"\"\"\n    try:\n        seriesList.name = newName\n    except AttributeError:\n        for series in seriesList:\n            series.name = newName\n    return seriesList", "entry_point": "alias", "input": "'abc', set(), 0", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L1847-L1862", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036795", "code": "def alpha(requestContext, seriesList, alpha):\n    \"\"\"\n    Assigns the given alpha transparency setting to the series. Takes a float\n    value between 0 and 1.\n    \"\"\"\n    for series in seriesList:\n        series.options['alpha'] = alpha\n    return seriesList", "entry_point": "alpha", "input": "'walnut thistle harbour', [], -1.5", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L2006-L2013", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036796", "code": "def color(requestContext, seriesList, theColor):\n    \"\"\"\n    Assigns the given color to the seriesList\n\n    Example::\n\n        &target=color(collectd.hostname.cpu.0.user, 'green')\n        &target=color(collectd.hostname.cpu.0.system, 'ff0000')\n        &target=color(collectd.hostname.cpu.0.idle, 'gray')\n        &target=color(collectd.hostname.cpu.0.idle, '6464ffaa')\n\n    \"\"\"\n    for series in seriesList:\n        series.color = theColor\n    return seriesList", "entry_point": "color", "input": "'abc', [], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L2016-L2030", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036797", "code": "def removeAboveValue(requestContext, seriesList, n):\n    \"\"\"\n    Removes data above the given threshold from the series or list of series\n    provided. Values above this threshold are assigned a value of None.\n    \"\"\"\n    for s in seriesList:\n        s.name = 'removeAboveValue(%s, %g)' % (s.name, n)\n        s.pathExpression = s.name\n        for (index, val) in enumerate(s):\n            if val is None:\n                continue\n            if val > n:\n                s[index] = None\n\n    return seriesList", "entry_point": "removeAboveValue", "input": "[-1, 0, 1, 2], set(), True", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L2450-L2464", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036798", "code": "def secondYAxis(requestContext, seriesList):\n    \"\"\"\n    Graph the series on the secondary Y axis.\n    \"\"\"\n    for series in seriesList:\n        series.options['secondYAxis'] = True\n        series.name = 'secondYAxis(%s)' % series.name\n    return seriesList", "entry_point": "secondYAxis", "input": "'', []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L2731-L2738", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036799", "code": "def drawAsInfinite(requestContext, seriesList):\n    \"\"\"\n    Takes one metric or a wildcard seriesList.\n    If the value is zero, draw the line at 0. If the value is above zero, draw\n    the line at infinity. If the value is null or less than zero, do not draw\n    the line.\n\n    Useful for displaying on/off metrics, such as exit codes. (0 = success,\n    anything else = failure.)\n\n    Example::\n\n        drawAsInfinite(Testing.script.exitCode)\n\n    \"\"\"\n    for series in seriesList:\n        series.options['drawAsInfinite'] = True\n        series.name = 'drawAsInfinite(%s)' % series.name\n    return seriesList", "entry_point": "drawAsInfinite", "input": "0, set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L3047-L3065", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036800", "code": "def lineWidth(requestContext, seriesList, width):\n    \"\"\"\n    Takes one metric or a wildcard seriesList, followed by a float F.\n\n    Draw the selected metrics with a line width of F, overriding the default\n    value of 1, or the &lineWidth=X.X parameter.\n\n    Useful for highlighting a single metric out of many, or having multiple\n    line widths in one graph.\n\n    Example::\n\n        &target=lineWidth(server01.instance01.memory.free,5)\n\n    \"\"\"\n    for series in seriesList:\n        series.options['lineWidth'] = width\n    return seriesList", "entry_point": "lineWidth", "input": "'abc', [], 7", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L3068-L3085", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036801", "code": "def dashed(requestContext, seriesList, dashLength=5):\n    \"\"\"\n    Takes one metric or a wildcard seriesList, followed by a float F.\n\n    Draw the selected metrics with a dotted line with segments of length F\n    If omitted, the default length of the segments is 5.0\n\n    Example::\n\n        &target=dashed(server01.instance01.memory.free,2.5)\n\n    \"\"\"\n    for series in seriesList:\n        series.name = 'dashed(%s, %g)' % (series.name, dashLength)\n        series.options['dashed'] = dashLength\n    return seriesList", "entry_point": "dashed", "input": "'  padded  ', [], -3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L3088-L3103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036802", "code": "def isNonNull(requestContext, seriesList):\n    \"\"\"\n    Takes a metric or wild card seriesList and counts up how many\n    non-null values are specified. This is useful for understanding\n    which metrics have data at a given point in time (ie, to count\n    which servers are alive).\n\n    Example::\n\n        &target=isNonNull(webapp.pages.*.views)\n\n    Returns a seriesList where 1 is specified for non-null values, and\n    0 is specified for null values.\n    \"\"\"\n\n    def transform(v):\n        if v is None:\n            return 0\n        else:\n            return 1\n\n    for series in seriesList:\n        series.name = \"isNonNull(%s)\" % (series.name)\n        series.pathExpression = series.name\n        values = [transform(v) for v in series]\n        series.extend(values)\n        del series[:len(values)]\n    return seriesList", "entry_point": "isNonNull", "input": "3, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/brutasse/graphite-api/blob/0886b7adcf985a1e8bcb084f6dd1dc166a3f3dff/graphite_api/functions.py#L3443-L3470", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036803", "code": "def check_component_for_specific_sbo_term(items, term):\n    r\"\"\"\n    Identify model components that lack a specific SBO term(s).\n\n    Parameters\n    ----------\n    items : list\n        A list of model components i.e. reactions to be checked for a specific\n        SBO term.\n    term : str or list of str\n        A string denoting a valid SBO term matching the regex '^SBO:\\d{7}$'\n        or a list containing such string elements.\n\n    Returns\n    -------\n    list\n        The components without any or that specific SBO term annotation.\n\n    \"\"\"\n    # check for multiple allowable SBO terms\n    if isinstance(term, list):\n        return [elem for elem in items if\n                elem.annotation is None or\n                'sbo' not in elem.annotation or\n                not any(i in elem.annotation['sbo'] for i in term)]\n    else:\n        return [elem for elem in items if\n                elem.annotation is None or\n                'sbo' not in elem.annotation or\n                term not in elem.annotation['sbo']]", "entry_point": "check_component_for_specific_sbo_term", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/opencobra/memote/blob/276630fcd4449fb7b914186edfd38c239e7052df/memote/support/sbo.py#L48-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036804", "code": "def map_metabolites_to_structures(metabolites, compartments):\n    \"\"\"\n    Map metabolites from the identifier namespace to structural space.\n\n    Metabolites who lack structural annotation (InChI or InChIKey) are ignored.\n\n    Parameters\n    ----------\n    metabolites : iterable\n        The cobra.Metabolites to map.\n    compartments : iterable\n        The different compartments to consider. Structures are treated\n        separately for each compartment.\n\n    Returns\n    -------\n    dict\n        A mapping from a cobra.Metabolite to its compartment specific\n        structure index.\n\n    \"\"\"\n    # TODO (Moritz Beber): Consider SMILES?\n    unique_identifiers = [\"inchikey\", \"inchi\"]\n    met2mol = {}\n    molecules = {c: [] for c in compartments}\n    for met in metabolites:\n        ann = []\n        for key in unique_identifiers:\n            mol = met.annotation.get(key)\n            if mol is not None:\n                ann.append(mol)\n        # Ignore metabolites without the required information.\n        if len(ann) == 0:\n            continue\n        ann = set(ann)\n        # Compare with other structures in the same compartment.\n        mols = molecules[met.compartment]\n        for i, mol_group in enumerate(mols):\n            if len(ann & mol_group) > 0:\n                mol_group.update(ann)\n                # We map to the index of the group because it is hashable and\n                # cheaper to compare later.\n                met2mol[met] = \"{}-{}\".format(met.compartment, i)\n                break\n        if met not in met2mol:\n            # The length of the list corresponds to the 0-index after appending.\n            met2mol[met] = \"{}-{}\".format(met.compartment, len(mols))\n            mols.append(ann)\n    return met2mol", "entry_point": "map_metabolites_to_structures", "input": "[], [5, 3, 1, 4]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/opencobra/memote/blob/276630fcd4449fb7b914186edfd38c239e7052df/memote/support/basic.py#L359-L407", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036805", "code": "def hex_color(value):\n    '''Accepts a hexadecimal color `value` in the format ``0xrrggbb`` and\n    returns an (r, g, b) tuple where 0.0 <= r, g, b <= 1.0.\n    '''\n    r = ((value >> (8 * 2)) & 255) / 255.0\n    g = ((value >> (8 * 1)) & 255) / 255.0\n    b = ((value >> (8 * 0)) & 255) / 255.0\n    return (r, g, b)", "entry_point": "hex_color", "input": "False", "output": "(0.0, 0.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L5-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036806", "code": "def normalize(vector):\n    '''Normalizes the `vector` so that its length is 1. `vector` can have\n    any number of components.\n    '''\n    d = sum(x * x for x in vector) ** 0.5\n    return tuple(x / d for x in vector)", "entry_point": "normalize", "input": "[]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L14-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036807", "code": "def distance(p1, p2):\n    '''Computes and returns the distance between two points, `p1` and `p2`.\n    The points can have any number of components.\n    '''\n    return sum((a - b) ** 2 for a, b in zip(p1, p2)) ** 0.5", "entry_point": "distance", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L21-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036808", "code": "def cross(v1, v2):\n    '''Computes the cross product of two vectors.\n    '''\n    return (\n        v1[1] * v2[2] - v1[2] * v2[1],\n        v1[2] * v2[0] - v1[0] * v2[2],\n        v1[0] * v2[1] - v1[1] * v2[0],\n    )", "entry_point": "cross", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "(0, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L27-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036809", "code": "def dot(v1, v2):\n    '''Computes the dot product of two vectors.\n    '''\n    x1, y1, z1 = v1\n    x2, y2, z2 = v2\n    return x1 * x2 + y1 * y2 + z1 * z2", "entry_point": "dot", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "'abbccc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L36-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036810", "code": "def add(v1, v2):\n    '''Adds two vectors.\n    '''\n    return tuple(a + b for a, b in zip(v1, v2))", "entry_point": "add", "input": "[], []", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L43-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036811", "code": "def sub(v1, v2):\n    '''Subtracts two vectors.\n    '''\n    return tuple(a - b for a, b in zip(v1, v2))", "entry_point": "sub", "input": "[5, 3, 1, 4], []", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fogleman/pg/blob/124ea3803c788b2c98c4f3a428e5d26842a67b58/pg/util.py#L48-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036812", "code": "def shorten_url(url, cols, shorten):\n    \"\"\"Shorten long URLs to fit on one line.\n\n    \"\"\"\n    cols = ((cols - 6) * .85)  # 6 cols for urlref and don't use while line\n    if shorten is False or len(url) < cols:\n        return url\n    split = int(cols * .5)\n    return url[:split] + \"...\" + url[-split:]", "entry_point": "shorten_url", "input": "{'a': 1, 'b': 2}, 3.25, False", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/firecat53/urlscan/blob/2d10807d01167873733da3b478c784f8fa21bbc0/urlscan/urlchoose.py#L43-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036813", "code": "def filter_options(keys, options):\n    \"\"\"\n    Filter 'options' with given 'keys'.\n\n    :param keys: key names of optional keyword arguments\n    :param options: optional keyword arguments to filter with 'keys'\n\n    >>> filter_options((\"aaa\", ), dict(aaa=1, bbb=2))\n    {'aaa': 1}\n    >>> filter_options((\"aaa\", ), dict(bbb=2))\n    {}\n    \"\"\"\n    return dict((k, options[k]) for k in keys if k in options)", "entry_point": "filter_options", "input": "[], {}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ssato/python-anyconfig/blob/f2f4fb8d8e232aadea866c202e1dd7a5967e2877/src/anyconfig/utils.py#L441-L453", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036814", "code": "def RgbToHsv(r, g, b):\n    '''Convert the color from RGB coordinates to HSV.\n\n    Parameters:\n      :r:\n        The Red component value [0...1]\n      :g:\n        The Green component value [0...1]\n      :b:\n        The Blue component value [0...1]\n\n    Returns:\n      The color as an (h, s, v) tuple in the range:\n      h[0...360],\n      s[0...1],\n      v[0...1]\n\n    >>> Color.RgbToHsv(1, 0.5, 0)\n    (30.0, 1.0, 1.0)\n\n    '''\n    v = float(max(r, g, b))\n    d = v - min(r, g, b)\n    if d==0: return (0.0, 0.0, v)\n    s = d / v\n\n    dr, dg, db = [(v - val) / d for val in (r, g, b)]\n\n    if r==v:\n      h = db - dg             # between yellow & magenta\n    elif g==v:\n      h = 2.0 + dr - db       # between cyan & yellow\n    else: # b==v\n      h = 4.0 + dg - dr       # between magenta & cyan\n\n    h = (h*60.0) % 360.0\n    return (h, s, v)", "entry_point": "RgbToHsv", "input": "7, 2, 3", "output": "(348.0, 0.7142857142857143, 7.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsvine/spectra/blob/2269a0ae9b5923154b15bd661fb81179608f7ec2/spectra/grapefruit.py#L456-L492", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036815", "code": "def HsvToRgb(h, s, v):\n    '''Convert the color from RGB coordinates to HSV.\n\n    Parameters:\n      :h:\n        The Hus component value [0...1]\n      :s:\n        The Saturation component value [0...1]\n      :v:\n        The Value component [0...1]\n\n    Returns:\n      The color as an (r, g, b) tuple in the range:\n      r[0...1],\n      g[0...1],\n      b[0...1]\n\n    >>> Color.HslToRgb(30.0, 1.0, 0.5)\n    (1.0, 0.5, 0.0)\n\n    '''\n    if s==0: return (v, v, v)   # achromatic (gray)\n\n    h /= 60.0\n    h = h % 6.0\n\n    i = int(h)\n    f = h - i\n    if not(i&1): f = 1-f     # if i is even\n\n    m = v * (1.0 - s)\n    n = v * (1.0 - (s * f))\n\n    if i==0: return (v, n, m)\n    if i==1: return (n, v, m)\n    if i==2: return (m, v, n)\n    if i==3: return (m, n, v)\n    if i==4: return (n, m, v)\n    return (v, m, n)", "entry_point": "HsvToRgb", "input": "True, False, 'Hello World'", "output": "('Hello World', 'Hello World', 'Hello World')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsvine/spectra/blob/2269a0ae9b5923154b15bd661fb81179608f7ec2/spectra/grapefruit.py#L495-L533", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036816", "code": "def YiqToRgb(y, i, q):\n    '''Convert the color from YIQ coordinates to RGB.\n\n    Parameters:\n      :y:\n        Tte Y component value [0...1]\n      :i:\n        The I component value [0...1]\n      :q:\n        The Q component value [0...1]\n\n    Returns:\n      The color as an (r, g, b) tuple in the range:\n      r[0...1],\n      g[0...1],\n      b[0...1]\n\n    >>> '(%g, %g, %g)' % Color.YiqToRgb(0.592263, 0.458874, -0.0499818)\n    '(1, 0.5, 5.442e-07)'\n\n    '''\n    r = y + (i * 0.9562) + (q * 0.6210)\n    g = y - (i * 0.2717) - (q * 0.6485)\n    b = y - (i * 1.1053) + (q * 1.7020)\n    return (r, g, b)", "entry_point": "YiqToRgb", "input": "0.5, 1, 5", "output": "(4.5611999999999995, -3.0141999999999998, 7.9047)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsvine/spectra/blob/2269a0ae9b5923154b15bd661fb81179608f7ec2/spectra/grapefruit.py#L563-L587", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036817", "code": "def RgbToXyz(r, g, b):\n    '''Convert the color from sRGB to CIE XYZ.\n\n    The methods assumes that the RGB coordinates are given in the sRGB\n    colorspace (D65).\n\n    .. note::\n\n       Compensation for the sRGB gamma correction is applied before converting.\n\n    Parameters:\n      :r:\n        The Red component value [0...1]\n      :g:\n        The Green component value [0...1]\n      :b:\n        The Blue component value [0...1]\n\n    Returns:\n      The color as an (x, y, z) tuple in the range:\n      x[0...1],\n      y[0...1],\n      z[0...1]\n\n    >>> '(%g, %g, %g)' % Color.RgbToXyz(1, 0.5, 0)\n    '(0.488941, 0.365682, 0.0448137)'\n\n    '''\n    r, g, b = [((v <= 0.03928) and [v / 12.92] or [((v+0.055) / 1.055) **2.4])[0] for v in (r, g, b)]\n\n    x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805)\n    y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722)\n    z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505)\n    return (x, y, z)", "entry_point": "RgbToXyz", "input": "2, 1, False", "output": "(2.400565987956558, 1.768387606788468, 0.2148092230057264)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsvine/spectra/blob/2269a0ae9b5923154b15bd661fb81179608f7ec2/spectra/grapefruit.py#L644-L677", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036818", "code": "def PilToRgb(pil):\n    '''Convert the color from a PIL-compatible integer to RGB.\n\n    Parameters:\n      pil: a PIL compatible color representation (0xBBGGRR)\n    Returns:\n      The color as an (r, g, b) tuple in the range:\n      the range:\n      r: [0...1]\n      g: [0...1]\n      b: [0...1]\n\n    >>> '(%g, %g, %g)' % Color.PilToRgb(0x0080ff)\n    '(1, 0.501961, 0)'\n\n    '''\n    r = 0xff & pil\n    g = 0xff & (pil >> 8)\n    b = 0xff & (pil >> 16)\n    return tuple((v / 255.0 for v in (r, g, b)))", "entry_point": "PilToRgb", "input": "False", "output": "(0.0, 0.0, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsvine/spectra/blob/2269a0ae9b5923154b15bd661fb81179608f7ec2/spectra/grapefruit.py#L1023-L1042", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036819", "code": "def _WebSafeComponent(c, alt=False):\n    '''Convert a color component to its web safe equivalent.\n\n    Parameters:\n      :c:\n        The component value [0...1]\n      :alt:\n        If True, return the alternative value instead of the nearest one.\n\n    Returns:\n      The web safe equivalent of the component value.\n\n    '''\n    # This sucks, but floating point between 0 and 1 is quite fuzzy...\n    # So we just change the scale a while to make the equality tests\n    # work, otherwise it gets wrong at some decimal far to the right.\n    sc = c * 100.0\n\n    # If the color is already safe, return it straight away\n    d = sc % 20\n    if d==0: return c\n\n    # Get the lower and upper safe values\n    l = sc - d\n    u = l + 20\n\n    # Return the 'closest' value according to the alt flag\n    if alt:\n      if (sc-l) >= (u-sc): return l/100.0\n      else: return u/100.0\n    else:\n      if (sc-l) >= (u-sc): return u/100.0\n      else: return l/100.0", "entry_point": "_WebSafeComponent", "input": "0.5, False", "output": "0.6", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jsvine/spectra/blob/2269a0ae9b5923154b15bd661fb81179608f7ec2/spectra/grapefruit.py#L1045-L1077", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036820", "code": "def str_to_int_array(string, base=16):\n    \"\"\"\n    Converts a string to an array of integer values according to the\n    base specified (int numbers must be whitespace delimited).\\n\n    Example: \"13 a3 3c\" => [0x13, 0xa3, 0x3c]\n\n    :return: [int]\n    \"\"\"\n\n    int_strings = string.split()\n    return [int(int_str, base) for int_str in int_strings]", "entry_point": "str_to_int_array", "input": "'', ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/UCSBarchlab/PyRTL/blob/0988e5c9c10ededd5e1f58d5306603f9edf4b3e2/pyrtl/rtllib/libutils.py#L23-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036821", "code": "def software_fibonacci(n):\n    \"\"\" a normal old python function to return the Nth fibonacci number. \"\"\"\n    a, b = 0, 1\n    for i in range(n):\n        a, b = b, a + b\n    return a", "entry_point": "software_fibonacci", "input": "True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/UCSBarchlab/PyRTL/blob/0988e5c9c10ededd5e1f58d5306603f9edf4b3e2/examples/introduction-to-hardware.py#L12-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036822", "code": "def _pred_sets_are_in_conflict(pred_set_a, pred_set_b):\n    \"\"\" Find conflict in sets, return conflict if found, else None. \"\"\"\n    # pred_sets conflict if we cannot find one shared predicate that is \"negated\" in one\n    # and \"non-negated\" in the other\n    for pred_a, bool_a in pred_set_a:\n        for pred_b, bool_b in pred_set_b:\n            if pred_a is pred_b and bool_a != bool_b:\n                return False\n    return True", "entry_point": "_pred_sets_are_in_conflict", "input": "[], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/UCSBarchlab/PyRTL/blob/0988e5c9c10ededd5e1f58d5306603f9edf4b3e2/pyrtl/conditional.py#L171-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036823", "code": "def _process_infohash_list(infohash_list):\n        \"\"\"\n        Method to convert the infohash_list to qBittorrent API friendly values.\n\n        :param infohash_list: List of infohash.\n        \"\"\"\n        if isinstance(infohash_list, list):\n            data = {'hashes': '|'.join([h.lower() for h in infohash_list])}\n        else:\n            data = {'hashes': infohash_list.lower()}\n        return data", "entry_point": "_process_infohash_list", "input": "['apple', 'banana', 'cherry']", "output": "{'hashes': 'apple|banana|cherry'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/v1k45/python-qBittorrent/blob/04f9482a022dcc78c56b0b9acb9ca455f855ae24/qbittorrent/client.py#L344-L354", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036824", "code": "def parse_width(width, n):\n    \"\"\"Parses an int or array of widths\n\n    Parameters\n    ----------\n    width : int or array_like\n    n : int\n    \"\"\"\n    if isinstance(width, int):\n        widths = [width] * n\n\n    else:\n        assert len(width) == n, \"Widths and data do not match\"\n        widths = width\n\n    return widths", "entry_point": "parse_width", "input": "'a,b,c', 5", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nirum/tableprint/blob/50ab4b96706fce8ee035a4d48cb456e3271eab3d/tableprint/utils.py#L80-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036825", "code": "def _lower(string):\n    \"\"\"Custom lower string function.\n    Examples:\n        FooBar -> foo_bar\n    \"\"\"\n    if not string:\n        return \"\"\n\n    new_string = [string[0].lower()]\n    for char in string[1:]:\n        if char.isupper():\n            new_string.append(\"_\")\n        new_string.append(char.lower())\n\n    return \"\".join(new_string)", "entry_point": "_lower", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dropbox/pygerduty/blob/11b28bfb66306aa7fc2b95ab9df65eb97ea831cf/pygerduty/common.py#L72-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036826", "code": "def get_uniques(l):\n    \"\"\" Returns a list with no repeated elements.\n    \"\"\"\n    result = []\n\n    for i in l:\n        if i not in result:\n            result.append(i)\n\n    return result", "entry_point": "get_uniques", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/asmlex.py#L161-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036827", "code": "def num2bytes(x, bytes):\n    \"\"\" Returns x converted to a little-endian t-uple of bytes.\n    E.g. num2bytes(255, 4) = (255, 0, 0, 0)\n    \"\"\"\n    if not isinstance(x, int):  # If it is another \"thing\", just return ZEROs\n        return tuple([0] * bytes)\n\n    x = x & ((2 << (bytes * 8)) - 1)  # mask the initial value\n    result = ()\n\n    for i in range(bytes):\n        result += (x & 0xFF,)\n        x >>= 8\n\n    return result", "entry_point": "num2bytes", "input": "'walnut thistle harbour', 1", "output": "(0,)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/asm.py#L23-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036828", "code": "def f16(op):\n    \"\"\" Returns a floating point operand converted to 32 bits unsigned int.\n    Negative numbers are returned in 2 complement.\n\n    The result is returned in a tuple (DE, HL) => High16 (Int part), Low16 (Decimal part)\n    \"\"\"\n    op = float(op)\n\n    negative = op < 0\n    if negative:\n        op = -op\n\n    DE = int(op)\n    HL = int((op - DE) * 2**16) & 0xFFFF\n    DE &= 0xFFFF\n\n    if negative:  # Do C2\n        DE ^= 0xFFFF\n        HL ^= 0xFFFF\n\n        DEHL = ((DE << 16) | HL) + 1\n        HL = DEHL & 0xFFFF\n        DE = (DEHL >> 16) & 0xFFFF\n\n    return (DE, HL)", "entry_point": "f16", "input": "0.5", "output": "(0, 32768)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/backend/__f16.py#L21-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036829", "code": "def check_categories(lines):\n  '''\n  find out how many row and col categories are available\n  '''\n  # count the number of row categories\n  rcat_line = lines[0].split('\\t')\n\n  # calc the number of row names and categories\n  num_rc = 0\n  found_end = False\n\n  # skip first tab\n  for inst_string in rcat_line[1:]:\n    if inst_string == '':\n      if found_end is False:\n        num_rc = num_rc + 1\n    else:\n      found_end = True\n\n  max_rcat = 15\n  if max_rcat > len(lines):\n    max_rcat = len(lines) - 1\n\n  num_cc = 0\n  for i in range(max_rcat):\n    ccat_line = lines[i + 1].split('\\t')\n\n    # make sure that line has length greater than one to prevent false cats from\n    # trailing new lines at end of matrix\n    if ccat_line[0] == '' and len(ccat_line) > 1:\n      num_cc = num_cc + 1\n\n  num_labels = {}\n  num_labels['row'] = num_rc + 1\n  num_labels['col'] = num_cc + 1\n\n  return num_labels", "entry_point": "check_categories", "input": "'abc'", "output": "{'row': 1, 'col': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ismms-himc/clustergrammer2/blob/5acea9bff7eda546cf0647b9e3647f631eb6f5f5/clustergrammer2/clustergrammer_fun/categories.py#L1-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036830", "code": "def remove_cmdline_arg(args, arg, n=1):\n    \"\"\"\n    Removes the command line argument *args* from a list of arguments *args*, e.g. as returned from\n    :py:func:`global_cmdline_args`. When *n* is 1 or less, only the argument is removed. Otherwise,\n    the following *n-1* values are removed. Example:\n\n    .. code-block:: python\n\n        args = global_cmdline_values()\n        # -> [\"--local-scheduler\", \"--workers\", \"4\"]\n\n        remove_cmdline_arg(args, \"--local-scheduler\")\n        # -> [\"--workers\", \"4\"]\n\n        remove_cmdline_arg(args, \"--workers\", 2)\n        # -> [\"--local-scheduler\"]\n    \"\"\"\n    if arg in args:\n        idx = args.index(arg)\n        args = list(args)\n        del args[idx:idx + max(n, 1)]\n    return args", "entry_point": "remove_cmdline_arg", "input": "[-1, 0, 1, 2], [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/riga/law/blob/479f84ce06ecf3bafe9d33cb7b8fc52e39fb80a1/law/parser.py#L161-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036831", "code": "def extract(dictionary, keys):\n    \"\"\"\n    Extract only the specified keys from a dict\n\n    :param dictionary: source dictionary\n    :param keys: list of keys to extract\n    :return dict: extracted dictionary\n    \"\"\"\n    return dict((k, dictionary[k]) for k in keys if k in dictionary)", "entry_point": "extract", "input": "{'x': [1, 2], 'y': []}, ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/michaeljoseph/changes/blob/a8beb409671c58cdf28ee913bad0a5c7d5374ade/changes/util.py#L6-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036832", "code": "def bitceil(N):\n    \"\"\"\n    Find the bit (i.e. power of 2) immediately greater than or equal to N\n    Note: this works for numbers up to 2 ** 64.\n\n    Roughly equivalent to int(2 ** np.ceil(np.log2(N)))\n    \"\"\"\n    # Note: for Python 2.7 and 3.x, this is faster:\n    # return 1 << int(N - 1).bit_length()\n    N = int(N) - 1\n    for i in [1, 2, 4, 8, 16, 32]:\n        N |= N >> i\n    return N + 1", "entry_point": "bitceil", "input": "0.5", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/astroML/gatspy/blob/a8f94082a3f27dfe9cb58165707b883bf28d9223/gatspy/periodic/lomb_scargle_fast.py#L28-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036833", "code": "def remove_liers(points):\n    \"\"\" Removes obvious noise points\n\n    Checks time consistency, removing points that appear out of order\n\n    Args:\n        points (:obj:`list` of :obj:`Point`)\n    Returns:\n        :obj:`list` of :obj:`Point`\n    \"\"\"\n    result = [points[0]]\n    for i in range(1, len(points) - 2):\n        prv = points[i-1]\n        crr = points[i]\n        nxt = points[i+1]\n        if prv.time <= crr.time and crr.time <= nxt.time:\n            result.append(crr)\n    result.append(points[-1])\n\n    return result", "entry_point": "remove_liers", "input": "[1, 2, 3]", "output": "[1, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ruipgil/TrackToTrip/blob/5537c14ee9748091b5255b658ab528e1d6227f99/tracktotrip/segment.py#L20-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036834", "code": "def temporal_segmentation(segments, min_time):\n    \"\"\" Segments based on time distant points\n\n    Args:\n        segments (:obj:`list` of :obj:`list` of :obj:`Point`): segment points\n        min_time (int): minimum required time for segmentation\n    \"\"\"\n    final_segments = []\n    for segment in segments:\n        final_segments.append([])\n        for point in segment:\n            if point.dt > min_time:\n                final_segments.append([])\n            final_segments[-1].append(point)\n\n    return final_segments", "entry_point": "temporal_segmentation", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ruipgil/TrackToTrip/blob/5537c14ee9748091b5255b658ab528e1d6227f99/tracktotrip/spatiotemporal_segmentation.py#L8-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036835", "code": "def correct_segmentation(segments, clusters, min_time):\n    \"\"\" Corrects the predicted segmentation\n\n    This process prevents over segmentation\n\n    Args:\n        segments (:obj:`list` of :obj:`list` of :obj:`Point`):\n            segments to correct\n        min_time (int): minimum required time for segmentation\n    \"\"\"\n    # segments = [points for points in segments if len(points) > 1]\n\n    result_segments = []\n    prev_segment = None\n    for i, segment in enumerate(segments):\n        if len(segment) >= 1:\n            continue\n\n        cluster = clusters[i]\n        if prev_segment is None:\n            prev_segment = segment\n        else:\n            cluster_dt = 0\n            if len(cluster) > 0:\n                cluster_dt = abs(cluster[0].time_difference(cluster[-1]))\n            if cluster_dt <= min_time:\n                prev_segment.extend(segment)\n            else:\n                prev_segment.append(segment[0])\n                result_segments.append(prev_segment)\n                prev_segment = segment\n    if prev_segment is not None:\n        result_segments.append(prev_segment)\n\n    return result_segments", "entry_point": "correct_segmentation", "input": "[], [], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ruipgil/TrackToTrip/blob/5537c14ee9748091b5255b658ab528e1d6227f99/tracktotrip/spatiotemporal_segmentation.py#L25-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036836", "code": "def group_modes(modes):\n    \"\"\" Groups consecutive transportation modes with same label, into one\n\n    Args:\n        modes (:obj:`list` of :obj:`dict`)\n    Returns:\n        :obj:`list` of :obj:`dict`\n    \"\"\"\n    if len(modes) > 0:\n        previous = modes[0]\n        grouped = []\n\n        for changep in modes[1:]:\n            if changep['label'] != previous['label']:\n                previous['to'] = changep['from']\n                grouped.append(previous)\n                previous = changep\n\n        previous['to'] = modes[-1]['to']\n        grouped.append(previous)\n        return grouped\n    else:\n        return modes", "entry_point": "group_modes", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ruipgil/TrackToTrip/blob/5537c14ee9748091b5255b658ab528e1d6227f99/tracktotrip/transportation_mode.py#L169-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036837", "code": "def intersection(L1, L2):\n    \"\"\"Intersects two line segments\n\n    Args:\n        L1 ([float, float]): x and y coordinates\n        L2 ([float, float]): x and y coordinates\n    Returns:\n        bool: if they intersect\n        (float, float): x and y of intersection, if they do\n    \"\"\"\n    D = L1[0] * L2[1] - L1[1] * L2[0]\n    Dx = L1[2] * L2[1] - L1[1] * L2[2]\n    Dy = L1[0] * L2[2] - L1[2] * L2[0]\n    if D != 0:\n        x = Dx / D\n        y = Dy / D\n        return x, y\n    else:\n        return False", "entry_point": "intersection", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ruipgil/TrackToTrip/blob/5537c14ee9748091b5255b658ab528e1d6227f99/tracktotrip/similarity.py#L71-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036838", "code": "def get_type_name(type_name, sub_type=None):\n    \"\"\" Returns a c# type according to a spec type\n\n    \"\"\"\n    if type_name == \"enum\":\n        return type_name\n    elif type_name == \"boolean\":\n        return \"bool\"\n    elif type_name == \"integer\":\n        return \"long\"\n    elif type_name == \"time\":\n        return \"long\"\n    elif type_name == \"object\":\n        return \"Object\"\n    elif type_name == \"list\":\n        return \"List\"\n    elif type_name == \"float\":\n        return \"float\"\n    else:\n        return \"String\"", "entry_point": "get_type_name", "input": "'  padded  ', [5, 3, 1, 4]", "output": "'String'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nuagenetworks/monolithe/blob/626011af3ff43f73b7bd8aa5e1f93fb5f1f0e181/monolithe/generators/lang/csharp/converter.py#L29-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036839", "code": "def eps_compare(f1, f2, eps):\n    \"\"\"Return true if |f1-f2| <= eps.\"\"\"\n    res = f1 - f2\n    if abs(res) <= eps:  # '<=',so eps == 0 works as expected\n        return 0\n    elif res < 0:\n        return -1\n    return 1", "entry_point": "eps_compare", "input": "False, 0, 2.0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/mar10/pyftpsync/blob/bbdc94186975cdc1cc4f678474bdce08bce7bb76/ftpsync/util.py#L118-L125", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036840", "code": "def scalar(value):\n    \"\"\"\n    Take return a value[0] if `value` is a list of length 1\n    \"\"\"\n    if isinstance(value, (list, tuple)) and len(value) == 1:\n        return value[0]\n    return value", "entry_point": "scalar", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ContinuumIO/flask-ldap-login/blob/09a08be45f861823cb08f95883ee1e092a618c37/flask_ldap_login/__init__.py#L52-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036841", "code": "def mod_issquare(a, p):\n    \"\"\" Returns whether `a' is a square modulo p \"\"\"\n    if not a:\n        return True\n    p1 = p // 2\n    p2 = pow(a, p1, p)\n    return p2 == 1", "entry_point": "mod_issquare", "input": "[], [1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bwesterb/py-seccure/blob/944760744686dd0ad015bd90ecb13a3ce0d7c9c9/src/__init__.py#L113-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036842", "code": "def delimited(items, character='|'):\n    \"\"\"Returns a character delimited version of the provided list as a Python string\"\"\"\n    return '|'.join(items) if type(items) in (list, tuple, set) else items", "entry_point": "delimited", "input": "['a', 'b', 'c'], []", "output": "'a|b|c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DomainTools/python_api/blob/17be85fd4913fbe14d7660a4f4829242f1663e60/domaintools/api.py#L10-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036843", "code": "def _py_expand_short(subsequence, sequence, max_l_dist):\n    \"\"\"Straightforward implementation of partial match expansion.\"\"\"\n    # The following diagram shows the score calculation step.\n    #\n    # Each new score is the minimum of:\n    #  * a OR a + 1 (substitution, if needed)\n    #  * b + 1 (deletion, i.e. skipping a sequence character)\n    #  * c + 1 (insertion, i.e. skipping a sub-sequence character)\n    #\n    # a -- +1 -> c\n    #\n    # |  \\       |\n    # |   \\      |\n    # +1  +1?    +1\n    # |      \\   |\n    # v       \u231f  v\n    #\n    # b -- +1 -> scores[subseq_index]\n\n    subseq_len = len(subsequence)\n    if subseq_len == 0:\n        return (0, 0)\n\n    # Initialize the scores array with values for just skipping sub-sequence\n    # chars.\n    scores = list(range(1, subseq_len + 1))\n\n    min_score = subseq_len\n    min_score_idx = -1\n\n    for seq_index, char in enumerate(sequence):\n        # calculate scores, one for each character in the sub-sequence\n        a = seq_index\n        c = a + 1\n        for subseq_index in range(subseq_len):\n            b = scores[subseq_index]\n            c = scores[subseq_index] = min(\n                a + (char != subsequence[subseq_index]),\n                b + 1,\n                c + 1,\n            )\n            a = b\n\n        # keep the minimum score found for matches of the entire sub-sequence\n        if c <= min_score:\n            min_score = c\n            min_score_idx = seq_index\n\n        # bail early when it is impossible to find a better expansion\n        elif min(scores) >= min_score:\n            break\n\n    return (min_score, min_score_idx + 1) if min_score <= max_l_dist else (None, None)", "entry_point": "_py_expand_short", "input": "[], ['a', 'b', 'c'], [1, 2, 3]", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/taleinat/fuzzysearch/blob/04be1b4490de92601400be5ecc999003ff2f621f/src/fuzzysearch/levenshtein_ngram.py#L23-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036844", "code": "def _py_expand_long(subsequence, sequence, max_l_dist):\n    \"\"\"Partial match expansion, optimized for long sub-sequences.\"\"\"\n    # The additional optimization in this version is to limit the part of\n    # the sub-sequence inspected for each sequence character.  The start and\n    # end of the iteration are limited to the range where the scores are\n    # smaller than the maximum allowed distance.  Additionally, once a good\n    # expansion has been found, the range is further reduced to where the\n    # scores are smaller than the score of the best expansion found so far.\n\n    subseq_len = len(subsequence)\n    if subseq_len == 0:\n        return (0, 0)\n\n    # Initialize the scores array with values for just skipping sub-sequence\n    # chars.\n    scores = list(range(1, subseq_len + 1))\n\n    min_score = subseq_len\n    min_score_idx = -1\n    max_good_score = max_l_dist\n    new_needle_idx_range_start = 0\n    new_needle_idx_range_end = subseq_len - 1\n\n    for seq_index, char in enumerate(sequence):\n        # calculate scores, one for each character in the sub-sequence\n        needle_idx_range_start = new_needle_idx_range_start\n        needle_idx_range_end = min(subseq_len, new_needle_idx_range_end + 1)\n\n        a = seq_index\n        c = a + 1\n\n        if c <= max_good_score:\n            new_needle_idx_range_start = 0\n            new_needle_idx_range_end = 0\n        else:\n            new_needle_idx_range_start = None\n            new_needle_idx_range_end = -1\n\n        for subseq_index in range(needle_idx_range_start, needle_idx_range_end):\n            b = scores[subseq_index]\n            c = scores[subseq_index] = min(\n                a + (char != subsequence[subseq_index]),\n                b + 1,\n                c + 1,\n            )\n            a = b\n\n            if c <= max_good_score:\n                if new_needle_idx_range_start is None:\n                    new_needle_idx_range_start = subseq_index\n                new_needle_idx_range_end = max(\n                    new_needle_idx_range_end,\n                    subseq_index + 1 + (max_good_score - c),\n                )\n\n        # bail early when it is impossible to find a better expansion\n        if new_needle_idx_range_start is None:\n            break\n\n        # keep the minimum score found for matches of the entire sub-sequence\n        if needle_idx_range_end == subseq_len and c <= min_score:\n            min_score = c\n            min_score_idx = seq_index\n            if min_score < max_good_score:\n                max_good_score = min_score\n\n    return (min_score, min_score_idx + 1) if min_score <= max_l_dist else (None, None)", "entry_point": "_py_expand_long", "input": "[], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/taleinat/fuzzysearch/blob/04be1b4490de92601400be5ecc999003ff2f621f/src/fuzzysearch/levenshtein_ngram.py#L78-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036845", "code": "def _remaining_points(hands):\n    '''\n    :param list hands: hands for which to compute the remaining points\n    :return: a list indicating the amount of points\n             remaining in each of the input hands\n    '''\n    points = []\n    for hand in hands:\n        points.append(sum(d.first + d.second for d in hand))\n\n    return points", "entry_point": "_remaining_points", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/abw333/dominoes/blob/ea9f532c9b834117a5c07d214711515872f7537e/dominoes/game.py#L43-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036846", "code": "def str_banner(txt=None, c=\"#\", debug=True):\n    \"\"\"prints a banner of the form with a frame of # around the txt::\n\n      ############################\n      # txt\n      ############################\n\n    :param debug: return \"\" if not in debug\n    :type debug: boolean\n    :param txt: a text message to be printed\n    :type txt: string\n    :param c: the character used instead of c\n    :type c: character\n    \"\"\"\n    line = \"\"\n    if debug:\n        line += \"\\n\"\n        line += \"# \" + str(70 * c)\n        if txt is not None:\n            line += \"# \" + txt\n            line += \"# \" + str(70 * c)\n    return line", "entry_point": "str_banner", "input": "[], ['a', 'b', 'c'], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cloudmesh/cloudmesh-common/blob/ae4fae09cd78205d179ea692dc58f0b0c8fea2b8/cloudmesh/common/util.py#L194-L215", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036847", "code": "def _Backward1_P_hs(h, s):\n    \"\"\"Backward equation for region 1, P=f(h,s)\n\n    Parameters\n    ----------\n    h : float\n        Specific enthalpy, [kJ/kg]\n    s : float\n        Specific entropy, [kJ/kgK]\n\n    Returns\n    -------\n    P : float\n        Pressure, [MPa]\n\n    References\n    ----------\n    IAPWS, Revised Supplementary Release on Backward Equations for Pressure\n    as a Function of Enthalpy and Entropy p(h,s) for Regions 1 and 2 of the\n    IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of\n    Water and Steam, http://www.iapws.org/relguide/Supp-PHS12-2014.pdf, Eq 1\n\n    Examples\n    --------\n    >>> _Backward1_P_hs(0.001,0)\n    0.0009800980612\n    >>> _Backward1_P_hs(90,0)\n    91.92954727\n    >>> _Backward1_P_hs(1500,3.4)\n    58.68294423\n    \"\"\"\n    I = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 4, 4, 5]\n    J = [0, 1, 2, 4, 5, 6, 8, 14, 0, 1, 4, 6, 0, 1, 10, 4, 1, 4, 0]\n    n = [-0.691997014660582, -0.183612548787560e2, -0.928332409297335e1,\n         0.659639569909906e2, -0.162060388912024e2, 0.450620017338667e3,\n         0.854680678224170e3, 0.607523214001162e4, 0.326487682621856e2,\n         -0.269408844582931e2, -0.319947848334300e3, -0.928354307043320e3,\n         0.303634537455249e2, -0.650540422444146e2, -0.430991316516130e4,\n         -0.747512324096068e3, 0.730000345529245e3, 0.114284032569021e4,\n         -0.436407041874559e3]\n\n    nu = h/3400\n    sigma = s/7.6\n    P = 0\n    for i, j, ni in zip(I, J, n):\n        P += ni * (nu+0.05)**i * (sigma+0.05)**j\n    return 100*P", "entry_point": "_Backward1_P_hs", "input": "False, False", "output": "-2.035410989501224e-05", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L896-L942", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036848", "code": "def _Backward2a_T_Ps(P, s):\n    \"\"\"Backward equation for region 2a, T=f(P,s)\n\n    Parameters\n    ----------\n    P : float\n        Pressure, [MPa]\n    s : float\n        Specific entropy, [kJ/kgK]\n\n    Returns\n    -------\n    T : float\n        Temperature, [K]\n\n    References\n    ----------\n    IAPWS, Revised Release on the IAPWS Industrial Formulation 1997 for the\n    Thermodynamic Properties of Water and Steam August 2007,\n    http://www.iapws.org/relguide/IF97-Rev.html, Eq 25\n\n    Examples\n    --------\n    >>> _Backward2a_T_Ps(0.1,7.5)\n    399.517097\n    >>> _Backward2a_T_Ps(2.5,8)\n    1039.84917\n    \"\"\"\n    I = [-1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.25, -1.25, -1.25, -1.0, -1.0,\n         -1.0, -1.0, -1.0, -1.0, -0.75, -0.75, -0.5, -0.5, -0.5, -0.5, -0.25,\n         -0.25, -0.25, -0.25, 0.25, 0.25, 0.25, 0.25, 0.5, 0.5, 0.5, 0.5, 0.5,\n         0.5, 0.5, 0.75, 0.75, 0.75, 0.75, 1.0, 1.0, 1.25, 1.25, 1.5, 1.5]\n    J = [-24, -23, -19, -13, -11, -10, -19, -15, -6, -26, -21, -17, -16, -9,\n         -8, -15, -14, -26, -13, -9, -7, -27, -25, -11, -6, 1, 4, 8, 11, 0, 1,\n         5, 6, 10, 14, 16, 0, 4, 9, 17, 7, 18, 3, 15, 5, 18]\n    n = [-0.39235983861984e6, 0.51526573827270e6, 0.40482443161048e5,\n         -0.32193790923902e3, 0.96961424218694e2, -0.22867846371773e2,\n         -0.44942914124357e6, -0.50118336020166e4, 0.35684463560015,\n         0.44235335848190e5, -0.13673388811708e5, 0.42163260207864e6,\n         0.22516925837475e5, 0.47442144865646e3, -0.14931130797647e3,\n         -0.19781126320452e6, -0.23554399470760e5, -0.19070616302076e5,\n         0.55375669883164e5, 0.38293691437363e4, -0.60391860580567e3,\n         0.19363102620331e4, 0.42660643698610e4, -0.59780638872718e4,\n         -0.70401463926862e3, 0.33836784107553e3, 0.20862786635187e2,\n         0.33834172656196e-1, -0.43124428414893e-4, 0.16653791356412e3,\n         -0.13986292055898e3, -0.78849547999872, 0.72132411753872e-1,\n         -0.59754839398283e-2, -0.12141358953904e-4, 0.23227096733871e-6,\n         -0.10538463566194e2, 0.20718925496502e1, -0.72193155260427e-1,\n         0.20749887081120e-6, -0.18340657911379e-1, 0.29036272348696e-6,\n         0.21037527893619, 0.25681239729999e-3, -0.12799002933781e-1,\n         -0.82198102652018e-5]\n\n    Pr = P/1\n    sigma = s/2\n    T = 0\n    for i, j, ni in zip(I, J, n):\n        T += ni * Pr**i * (sigma-2)**j\n    return T", "entry_point": "_Backward2a_T_Ps", "input": "True, 2", "output": "-739657.252016869", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1379-L1436", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036849", "code": "def _Backward3a_T_Ph(P, h):\n    \"\"\"Backward equation for region 3a, T=f(P,h)\n\n    Parameters\n    ----------\n    P : float\n        Pressure, [MPa]\n    h : float\n        Specific enthalpy, [kJ/kg]\n\n    Returns\n    -------\n    T : float\n        Temperature, [K]\n\n    References\n    ----------\n    IAPWS, Revised Supplementary Release on Backward Equations for the\n    Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region 3 of the IAPWS\n    Industrial Formulation 1997 for the Thermodynamic Properties of Water and\n    Steam, http://www.iapws.org/relguide/Supp-Tv%28ph,ps%293-2014.pdf, Eq 2\n\n    Examples\n    --------\n    >>> _Backward3a_T_Ph(20,1700)\n    629.3083892\n    >>> _Backward3a_T_Ph(100,2100)\n    733.6163014\n    \"\"\"\n    I = [-12, -12, -12, -12, -12, -12, -12, -12, -10, -10, -10, -8, -8, -8, -8,\n         -5, -3, -2, -2, -2, -1, -1, 0, 0, 1, 3, 3, 4, 4, 10, 12]\n    J = [0, 1, 2, 6, 14, 16, 20, 22, 1, 5, 12, 0, 2, 4, 10, 2, 0, 1, 3, 4, 0,\n         2, 0, 1, 1, 0, 1, 0, 3, 4, 5]\n    n = [-0.133645667811215e-6, 0.455912656802978e-5, -0.146294640700979e-4,\n         0.639341312970080e-2, 0.372783927268847e3, -0.718654377460447e4,\n         0.573494752103400e6, -0.267569329111439e7, -0.334066283302614e-4,\n         -0.245479214069597e-1, 0.478087847764996e2, 0.764664131818904e-5,\n         0.128350627676972e-2, 0.171219081377331e-1, -0.851007304583213e1,\n         -0.136513461629781e-1, -0.384460997596657e-5, 0.337423807911655e-2,\n         -0.551624873066791, 0.729202277107470, -0.992522757376041e-2,\n         -.119308831407288, .793929190615421, .454270731799386,\n         .20999859125991, -0.642109823904738e-2, -0.235155868604540e-1,\n         0.252233108341612e-2, -0.764885133368119e-2, 0.136176427574291e-1,\n         -0.133027883575669e-1]\n\n    Pr = P/100.\n    nu = h/2300.\n    suma = 0\n    for i, j, n in zip(I, J, n):\n        suma += n*(Pr+0.240)**i*(nu-0.615)**j\n    return 760*suma", "entry_point": "_Backward3a_T_Ph", "input": "True, 0.5", "output": "-364889571675.7467", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2220-L2270", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036850", "code": "def _Backward3a_T_Ps(P, s):\n    \"\"\"Backward equation for region 3a, T=f(P,s)\n\n    Parameters\n    ----------\n    P : float\n        Pressure, [MPa]\n    s : float\n        Specific entropy, [kJ/kgK]\n\n    Returns\n    -------\n    T : float\n        Temperature, [K]\n\n    References\n    ----------\n    IAPWS, Revised Supplementary Release on Backward Equations for the\n    Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region 3 of the IAPWS\n    Industrial Formulation 1997 for the Thermodynamic Properties of Water and\n    Steam, http://www.iapws.org/relguide/Supp-Tv%28ph,ps%293-2014.pdf, Eq 6\n\n    Examples\n    --------\n    >>> _Backward3a_T_Ps(20,3.8)\n    628.2959869\n    >>> _Backward3a_T_Ps(100,4)\n    705.6880237\n    \"\"\"\n    I = [-12, -12, -10, -10, -10, -10, -8, -8, -8, -8, -6, -6, -6, -5, -5, -5,\n         -4, -4, -4, -2, -2, -1, -1, 0, 0, 0, 1, 2, 2, 3, 8, 8, 10]\n    J = [28, 32, 4, 10, 12, 14, 5, 7, 8, 28, 2, 6, 32, 0, 14, 32, 6, 10, 36, 1,\n         4, 1, 6, 0, 1, 4, 0, 0, 3, 2, 0, 1, 2]\n    n = [0.150042008263875e10, -0.159397258480424e12, 0.502181140217975e-3,\n         -0.672057767855466e2, 0.145058545404456e4, -0.823889534888890e4,\n         -0.154852214233853, 0.112305046746695e2, -0.297000213482822e2,\n         0.438565132635495e11, 0.137837838635464e-2, -0.297478527157462e1,\n         0.971777947349413e13, -0.571527767052398e-4, 0.288307949778420e5,\n         -0.744428289262703e14, 0.128017324848921e2, -0.368275545889071e3,\n         0.664768904779177e16, 0.449359251958880e-1, -0.422897836099655e1,\n         -0.240614376434179, -0.474341365254924e1, 0.724093999126110,\n         0.923874349695897, 0.399043655281015e1, 0.384066651868009e-1,\n         -0.359344365571848e-2, -0.735196448821653, 0.188367048396131,\n         0.141064266818704e-3, -0.257418501496337e-2, 0.123220024851555e-2]\n\n    Pr = P/100\n    sigma = s/4.4\n    suma = 0\n    for i, j, ni in zip(I, J, n):\n        suma += ni * (Pr+0.240)**i * (sigma-0.703)**j\n    return 760*suma", "entry_point": "_Backward3a_T_Ps", "input": "10, -3", "output": "4.457794867059327e+25", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2475-L2525", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036851", "code": "def _Backward3a_P_hs(h, s):\n    \"\"\"Backward equation for region 3a, P=f(h,s)\n\n    Parameters\n    ----------\n    h : float\n        Specific enthalpy, [kJ/kg]\n    s : float\n        Specific entropy, [kJ/kgK]\n\n    Returns\n    -------\n    P : float\n        Pressure, [MPa]\n\n    References\n    ----------\n    IAPWS, Revised Supplementary Release on Backward Equations p(h,s) for\n    Region 3, Equations as a Function of h and s for the Region Boundaries, and\n    an Equation Tsat(h,s) for Region 4 of the IAPWS Industrial Formulation 1997\n    for the Thermodynamic Properties of Water and Steam,\n    http://www.iapws.org/relguide/Supp-phs3-2014.pdf. Eq 1\n\n    Examples\n    --------\n    >>> _Backward3a_P_hs(1700,3.8)\n    25.55703246\n    >>> _Backward3a_P_hs(2000,4.2)\n    45.40873468\n    >>> _Backward3a_P_hs(2100,4.3)\n    60.78123340\n    \"\"\"\n    I = [0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 6, 7, 8, 10, 10,\n         14, 18, 20, 22, 22, 24, 28, 28, 32, 32]\n    J = [0, 1, 5, 0, 3, 4, 8, 14, 6, 16, 0, 2, 3, 0, 1, 4, 5, 28, 28, 24, 1,\n         32, 36, 22, 28, 36, 16, 28, 36, 16, 36, 10, 28]\n    n = [0.770889828326934e1, -0.260835009128688e2, 0.267416218930389e3,\n         0.172221089496844e2, -0.293542332145970e3, 0.614135601882478e3,\n         -0.610562757725674e5, -0.651272251118219e8, 0.735919313521937e5,\n         -0.116646505914191e11, 0.355267086434461e2, -0.596144543825955e3,\n         -0.475842430145708e3, 0.696781965359503e2, 0.335674250377312e3,\n         0.250526809130882e5, 0.146997380630766e6, 0.538069315091534e20,\n         0.143619827291346e22, 0.364985866165994e20, -0.254741561156775e4,\n         0.240120197096563e28, -0.393847464679496e30, 0.147073407024852e25,\n         -0.426391250432059e32, 0.194509340621077e39, 0.666212132114896e24,\n         0.706777016552858e34, 0.175563621975576e42, 0.108408607429124e29,\n         0.730872705175151e44, 0.159145847398870e25, 0.377121605943324e41]\n\n    nu = h/2300\n    sigma = s/4.4\n    suma = 0\n    for i, j, ni in zip(I, J, n):\n        suma += ni * (nu-1.01)**i * (sigma-0.75)**j\n    return 99*suma", "entry_point": "_Backward3a_P_hs", "input": "3.25, 5", "output": "2.587492237585286e+31", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2603-L2656", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036852", "code": "def Ttr(x):\n    \"\"\"Equation for the triple point of ammonia-water mixture\n\n    Parameters\n    ----------\n    x : float\n        Mole fraction of ammonia in mixture, [mol/mol]\n\n    Returns\n    -------\n    Ttr : float\n        Triple point temperature, [K]\n\n    Notes\n    ------\n    Raise :class:`NotImplementedError` if input isn't in limit:\n\n        * 0 \u2264 x \u2264 1\n\n    References\n    ----------\n    IAPWS, Guideline on the IAPWS Formulation 2001 for the Thermodynamic\n    Properties of Ammonia-Water Mixtures,\n    http://www.iapws.org/relguide/nh3h2o.pdf, Eq 9\n    \"\"\"\n    if 0 <= x <= 0.33367:\n        Ttr = 273.16*(1-0.3439823*x-1.3274271*x**2-274.973*x**3)\n    elif 0.33367 < x <= 0.58396:\n        Ttr = 193.549*(1-4.987368*(x-0.5)**2)\n    elif 0.58396 < x <= 0.81473:\n        Ttr = 194.38*(1-4.886151*(x-2/3)**2+10.37298*(x-2/3)**3)\n    elif 0.81473 < x <= 1:\n        Ttr = 195.495*(1-0.323998*(1-x)-15.87560*(1-x)**4)\n    else:\n        raise NotImplementedError(\"Incoming out of bound\")\n    return Ttr", "entry_point": "Ttr", "input": "False", "output": "273.16", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/ammonia.py#L566-L601", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036853", "code": "def gen_pager_purecss(cat_slug, page_num, current):\n    '''\n    Generate pager of purecss.\n    '''\n    if page_num == 1:\n        return ''\n\n    pager_shouye = '''<li class=\"pure-menu-item {0}\">\n    <a class=\"pure-menu-link\" href=\"{1}\">&lt;&lt; \u9996\u9875</a></li>'''.format(\n        'hidden' if current <= 1 else '', cat_slug\n    )\n\n    pager_pre = '''<li class=\"pure-menu-item {0}\">\n                <a class=\"pure-menu-link\" href=\"{1}/{2}\">&lt; \u524d\u9875</a>\n                </li>'''.format('hidden' if current <= 1 else '',\n                                cat_slug,\n                                current - 1)\n    pager_mid = ''\n    for ind in range(0, page_num):\n        tmp_mid = '''<li class=\"pure-menu-item {0}\">\n                <a class=\"pure-menu-link\" href=\"{1}/{2}\">{2}</a></li>\n                '''.format('selected' if ind + 1 == current else '',\n                           cat_slug,\n                           ind + 1)\n        pager_mid += tmp_mid\n    pager_next = '''<li class=\"pure-menu-item {0}\">\n                <a class=\"pure-menu-link\" href=\"{1}/{2}\">\u540e\u9875 &gt;</a>\n                </li> '''.format('hidden' if current >= page_num else '',\n                                 cat_slug,\n                                 current + 1)\n    pager_last = '''<li class=\"pure-menu-item {0}\">\n                <a hclass=\"pure-menu-link\" ref=\"{1}/{2}\">\u672b\u9875\n                &gt;&gt;</a>\n                </li> '''.format('hidden' if current >= page_num else '',\n                                 cat_slug,\n                                 page_num)\n    pager = pager_shouye + pager_pre + pager_mid + pager_next + pager_last\n    return pager", "entry_point": "gen_pager_purecss", "input": "[-1, 0, 1, 2], 1, [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bukun/TorCMS/blob/6567c7fe2604a1d646d4570c017840958630ed2b/torcms/core/tools.py#L251-L288", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036854", "code": "def gen_pager_bootstrap_url(cat_slug, page_num, current):\n    '''\n    pager for searching results.\n    '''\n    pager = ''\n    if page_num == 1 or page_num == 0:\n        pager = ''\n    elif page_num > 1:\n        pager_mid, pager_pre, pager_next, pager_last, pager_home = '', '', '', '', ''\n\n        pager = '<ul class=\"pagination\">'\n\n        if current > 1:\n            pager_home = '''<li class=\"{0}\" name='fenye' onclick='change(this);'>\n                <a href=\"{1}/{2}\">\u9996\u9875</a></li>'''.format('', cat_slug, 1)\n\n            pager_pre = ''' <li class=\"{0}\" name='fenye' onclick='change(this);'>\n                <a href=\"{1}/{2}\">\u4e0a\u4e00\u9875</a></li>'''.format('', cat_slug, current - 1)\n        if current > 5:\n            cur_num = current - 4\n        else:\n            cur_num = 1\n\n        if page_num > 10 and cur_num < page_num - 10:\n            show_num = cur_num + 10\n\n        else:\n            show_num = page_num + 1\n\n        for num in range(cur_num, show_num):\n            if num == current:\n                checkstr = 'active'\n            else:\n                checkstr = ''\n\n            tmp_str_df = '''<li class=\"{0}\" name='fenye' onclick='change(this);'>\n                  <a href=\"{1}/{2}\">{2}</a></li>'''.format(checkstr, cat_slug, num)\n\n            pager_mid += tmp_str_df\n        if current < page_num:\n            pager_next = '''\n\n                  <li class=\"{0}\" name='fenye' onclick='change(this);'\n                  ><a href=\"{1}/{2}\">\u4e0b\u4e00\u9875</a></li>'''.format('', cat_slug, current + 1)\n            pager_last = '''\n\n                  <li class=\"{0}\" name='fenye' onclick='change(this);'\n                 ><a href=\"{1}/{2}\">\u672b\u9875</a></li>'''.format('', cat_slug, page_num)\n\n        pager += pager_home + pager_pre + pager_mid + pager_next + pager_last\n        pager += '</ul>'\n    else:\n        pass\n\n    return pager", "entry_point": "gen_pager_bootstrap_url", "input": "['a', 'b', 'c'], 0, ['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bukun/TorCMS/blob/6567c7fe2604a1d646d4570c017840958630ed2b/torcms/handlers/search_handler.py#L14-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036855", "code": "def is_prived(usr_rule, def_rule):\n    '''\n    Compare between two role string.\n    '''\n    for iii in range(4):\n        if def_rule[iii] == '0':\n            continue\n        if usr_rule[iii] >= def_rule[iii]:\n            return True\n\n    return False", "entry_point": "is_prived", "input": "[1, 2, 3], [1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/bukun/TorCMS/blob/6567c7fe2604a1d646d4570c017840958630ed2b/torcms/core/privilege.py#L10-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036856", "code": "def expand_url(url, protocol):\n    \"\"\"\n    Expands the given URL to a full URL by adding\n    the magento soap/wsdl parts\n\n    :param url: URL to be expanded\n    :param service: 'xmlrpc' or 'soap'\n    \"\"\"\n    if protocol == 'soap':\n        ws_part = 'api/?wsdl'\n    elif protocol == 'xmlrpc':\n        ws_part = 'index.php/api/xmlrpc'\n    else:\n        ws_part = 'index.php/rest/V1'\n    return url.endswith('/') and url + ws_part or url + '/' + ws_part", "entry_point": "expand_url", "input": "'AbC dEf', True", "output": "'AbC dEf/index.php/rest/V1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fulfilio/python-magento/blob/720ec136a6e438a9ee4ee92848a9820b91732750/magento/utils.py#L12-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036857", "code": "def check_argument_type(dtype, kernel_argument, i):\n    \"\"\"check if the numpy.dtype matches the type used in the code\"\"\"\n    types_map = {\"uint8\": [\"uchar\", \"unsigned char\", \"uint8_t\"],\n                 \"int8\": [\"char\", \"int8_t\"],\n                 \"uint16\": [\"ushort\", \"unsigned short\", \"uint16_t\"],\n                 \"int16\": [\"short\", \"int16_t\"],\n                 \"uint32\": [\"uint\", \"unsigned int\", \"uint32_t\"],\n                 \"int32\": [\"int\", \"int32_t\"],   #discrepancy between OpenCL and C here, long may be 32bits in C\n                 \"uint64\": [\"ulong\", \"unsigned long\", \"uint64_t\"],\n                 \"int64\": [\"long\", \"int64_t\"],\n                 \"float16\": [\"half\"],\n                 \"float32\": [\"float\"],\n                 \"float64\": [\"double\"]}\n    if dtype in types_map:\n        return any([substr in kernel_argument for substr in types_map[dtype]])\n    else:\n        return False", "entry_point": "check_argument_type", "input": "'AbC dEf', 5, ('a', 'b', 'c')", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benvanwerkhoven/kernel_tuner/blob/cfcb5da5e510db494f8219c22566ab65d5fcbd9f/kernel_tuner/util.py#L16-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036858", "code": "def get_config_string(params, units=None):\n    \"\"\" return a compact string representation of a dictionary \"\"\"\n    compact_str_items = []\n    # first make a list of compact strings for each parameter\n    for k, v in params.items():\n        unit = \"\"\n        if isinstance(units, dict): #check if not None not enough, units could be mocked which causes errors\n            unit = units.get(k, \"\")\n        compact_str_items.append(k + \"=\" + str(v) + unit)\n    # and finally join them\n    compact_str = \", \".join(compact_str_items)\n    return compact_str", "entry_point": "get_config_string", "input": "{'x': [1, 2], 'y': []}, 'walnut thistle harbour'", "output": "'x=[1, 2], y=[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/benvanwerkhoven/kernel_tuner/blob/cfcb5da5e510db494f8219c22566ab65d5fcbd9f/kernel_tuner/util.py#L139-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036859", "code": "def compact_timeslot(sind_list):\n    \"\"\"\n    Test method. Compact all snapshots into a single one.\n\n    :param sind_list:\n    :return:\n    \"\"\"\n    tls = sorted(sind_list)\n    conversion = {val: idx for idx, val in enumerate(tls)}\n    return conversion", "entry_point": "compact_timeslot", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/GiulioRossetti/dynetx/blob/634e2b38f8950885aebfa079dad7d5e8d7563f1d/dynetx/utils/transform.py#L11-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036860", "code": "def coordinates(g, nodes):\n    \"\"\"\n    Extract (lon, lat) coordinate pairs from nodes in an osmgraph\n\n    osmgraph nodes have a 'coordinate' property on each node. This is\n    a shortcut for extracting a coordinate list from an iterable of nodes\n\n    >>> g = osmgraph.parse_file(filename)\n    >>> node_ids = g.nodes()[:3]  # Grab 3 nodes\n    [61341696, 61341697, 61341698]\n    >>> coords = coordinates(g, node_ids)\n    [(-71.0684107, 42.3516822),\n     (-71.133251, 42.350308),\n     (-71.170641, 42.352689)]\n\n\n    Parameters\n    ----------\n    g : networkx graph created with osmgraph\n    nodes : iterable of node ids\n\n    Returns\n    -------\n    List of (lon, lat) coordinate pairs\n\n    \"\"\"\n    c = [g.node[n]['coordinate'] for n in nodes]\n    return c", "entry_point": "coordinates", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Mapkin/osmgraph/blob/4f8e6466c11edbe30f1bbefc939e5613860a43b4/osmgraph/tools.py#L45-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036861", "code": "def str_to_bool(val):\n    \"\"\"\n    Helper function to turn a string representation of \"true\" into\n    boolean True.\n    \"\"\"\n    if isinstance(val, str):\n        val = val.lower()\n\n    return val in [\"true\", \"on\", \"yes\", True]", "entry_point": "str_to_bool", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sanoma/django-arctic/blob/c81b092c2643ca220708bf3c586017d9175161f5/arctic/templatetags/arctic_pagination_tags.py#L44-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036862", "code": "def menu_clean(menu_config):\n    \"\"\"\n    Make sure that only the menu item with the largest weight is active.\n    If a child of a menu item is active, the parent should be active too.\n    :param menu:\n    :return:\n    \"\"\"\n    max_weight = -1\n    for _, value in list(menu_config.items()):\n        if value[\"submenu\"]:\n            for _, v in list(value[\"submenu\"].items()):\n                if v[\"active\"]:\n                    # parent inherits the weight of the axctive child\n                    value[\"active\"] = True\n                    value[\"active_weight\"] = v[\"active_weight\"]\n\n        if value[\"active\"]:\n            max_weight = max(value[\"active_weight\"], max_weight)\n\n    if max_weight > 0:\n        # one of the items is active: make items with lesser weight inactive\n        for _, value in list(menu_config.items()):\n            if value[\"active\"] and value[\"active_weight\"] < max_weight:\n                value[\"active\"] = False\n    return menu_config", "entry_point": "menu_clean", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sanoma/django-arctic/blob/c81b092c2643ca220708bf3c586017d9175161f5/arctic/utils.py#L104-L128", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036863", "code": "def is_list_of_list(item):\n    \"\"\"\n    check whether the item is list (tuple)\n    and consist of list (tuple) elements\n    \"\"\"\n    if (\n        type(item) in (list, tuple)\n        and len(item)\n        and isinstance(item[0], (list, tuple))\n    ):\n        return True\n    return False", "entry_point": "is_list_of_list", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sanoma/django-arctic/blob/c81b092c2643ca220708bf3c586017d9175161f5/arctic/utils.py#L380-L391", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036864", "code": "def filter_pipeline(effects, filters):\n    \"\"\"\n    Apply each filter to the effect list sequentially. If any filter\n    returns zero values then ignore it. As soon as only one effect is left,\n    return it.\n\n    Parameters\n    ----------\n    effects : list of MutationEffect subclass instances\n\n    filters : list of functions\n        Each function takes a list of effects and returns a list of effects\n\n    Returns list of effects\n    \"\"\"\n    for filter_fn in filters:\n        filtered_effects = filter_fn(effects)\n        if len(effects) == 1:\n            return effects\n        elif len(filtered_effects) > 1:\n            effects = filtered_effects\n    return effects", "entry_point": "filter_pipeline", "input": "['a', 'b', 'c'], []", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/varcode/blob/981633db45ca2b31f76c06894a7360ea5d70a9b8/varcode/effects/effect_ordering.py#L394-L415", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036865", "code": "def trim_shared_prefix(ref, alt):\n    \"\"\"\n    Sometimes mutations are given with a shared prefix between the reference\n    and alternate strings. Examples: C>CT (nucleotides) or GYFP>G (amino acids).\n\n    This function trims the common prefix and returns the disjoint ref\n    and alt strings, along with the shared prefix.\n    \"\"\"\n    n_ref = len(ref)\n    n_alt = len(alt)\n    n_min = min(n_ref, n_alt)\n    i = 0\n    while i < n_min and ref[i] == alt[i]:\n        i += 1\n\n    # guaranteed that ref and alt agree on all the characters\n    # up to i'th position, so it doesn't matter which one we pull\n    # the prefix out of\n    prefix = ref[:i]\n    ref_suffix = ref[i:]\n    alt_suffix = alt[i:]\n    return ref_suffix, alt_suffix, prefix", "entry_point": "trim_shared_prefix", "input": "[], ['a', 'b', 'c']", "output": "([], ['a', 'b', 'c'], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/varcode/blob/981633db45ca2b31f76c06894a7360ea5d70a9b8/varcode/string_helpers.py#L18-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036866", "code": "def trim_shared_suffix(ref, alt):\n    \"\"\"\n    Reuse the `trim_shared_prefix` function above to implement similar\n    functionality for string suffixes.\n\n    Given ref='ABC' and alt='BC', we first revese both strings:\n        reverse_ref = 'CBA'\n        reverse_alt = 'CB'\n    and then the result of calling trim_shared_prefix will be:\n        ('A', '', 'CB')\n    We then reverse all three of the result strings to get back\n    the shared suffix and both prefixes leading up to it:\n        ('A', '', 'BC')\n    \"\"\"\n    n_ref = len(ref)\n    n_alt = len(alt)\n    n_min = min(n_ref, n_alt)\n    i = 0\n    while i < n_min and ref[-i - 1] == alt[-i - 1]:\n        i += 1\n\n    # i is length of shared suffix.\n    if i == 0:\n        return (ref, alt, '')\n    return (ref[:-i], alt[:-i], ref[-i:])", "entry_point": "trim_shared_suffix", "input": "[[1, 2], [3], []], []", "output": "([[1, 2], [3], []], [], '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openvax/varcode/blob/981633db45ca2b31f76c06894a7360ea5d70a9b8/varcode/string_helpers.py#L42-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036867", "code": "def is_quoted(s):\n    \"\"\" Returns True if the string begins and ends with quotes (single or double)\n\n        :param s: a string\n        :return: boolean\n    \"\"\"\n    return (s.startswith(\"'\") and s.endswith(\"'\")) or (s.startswith('\"') and s.endswith('\"'))", "entry_point": "is_quoted", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/misc.py#L103-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036868", "code": "def is_a_sequence(var, allow_none=False):\n    \"\"\" Returns True if var is a list or a tuple (but not a string!)\n    \"\"\"\n    return isinstance(var, (list, tuple)) or (var is None and allow_none)", "entry_point": "is_a_sequence", "input": "['a', 'b', 'c'], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/cls.py#L302-L305", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036869", "code": "def remove(src, rel, dst):\n    \"\"\"\n    Returns an SQL statement that removes edges from\n    the SQL backing store. Either `src` or `dst` may\n    be specified, even both.\n\n    :param src: The source node.\n    :param rel: The relation.\n    :param dst: The destination node.\n    \"\"\"\n    smt = 'DELETE FROM %s' % rel\n    queries = []\n    params = []\n\n    if src is not None:\n        queries.append('src = ?')\n        params.append(src)\n\n    if dst is not None:\n        queries.append('dst = ?')\n        params.append(dst)\n\n    if not queries:\n        return smt, params\n    smt = '%s WHERE %s' % (smt, ' AND '.join(queries))\n    return smt, params", "entry_point": "remove", "input": "[1, 2, 3], [-1, 0, 1, 2], []", "output": "('DELETE FROM [-1, 0, 1, 2] WHERE src = ? AND dst = ?', [[1, 2, 3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eugene-eeo/graphlite/blob/8d17e9549ee8610570dcde1b427431a2584395b7/graphlite/sql.py#L28-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036870", "code": "def limit(lower, upper):\n    \"\"\"\n    Returns a SQlite-compliant LIMIT statement that\n    takes the *lower* and *upper* bounds into account.\n\n    :param lower: The lower bound.\n    :param upper: The upper bound.\n    \"\"\"\n    offset = lower or 0\n    lim = (upper - offset) if upper else -1\n    smt = 'LIMIT %d OFFSET %d' % (lim, offset)\n    return smt, ()", "entry_point": "limit", "input": "[], []", "output": "('LIMIT -1 OFFSET 0', ())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/eugene-eeo/graphlite/blob/8d17e9549ee8610570dcde1b427431a2584395b7/graphlite/sql.py#L120-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036871", "code": "def int_to_padded_hex_byte(integer):\n    \"\"\"\n        Convert an int to a 0-padded hex byte string\n        example: 65 == 41, 10 == 0A\n        Returns: The hex byte as string (ex: \"0C\")\n    \"\"\"\n    to_hex = hex(integer)\n    xpos = to_hex.find('x')\n    hex_byte = to_hex[xpos+1 : len(to_hex)].upper()\n\n    if len(hex_byte) == 1:\n        hex_byte = ''.join(['0', hex_byte])\n\n    return hex_byte", "entry_point": "int_to_padded_hex_byte", "input": "-3", "output": "'03'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jedie/DragonPy/blob/6659e5b5133aab26979a498ee7453495773a4f6c/dragonpy/utils/srecord_utils.py#L36-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036872", "code": "def compute_srec_checksum(srec):\n    \"\"\"\n        Compute the checksum byte of a given S-Record\n        Returns: The checksum as a string hex byte (ex: \"0C\")\n    \"\"\"\n    # Get the summable data from srec\n    # start at 2 to remove the S* record entry\n    data = srec[2:len(srec)]\n\n    sum = 0\n    # For each byte, convert to int and add.\n    # (step each two character to form a byte)\n    for position in range(0, len(data), 2):\n        current_byte = data[position : position+2]\n        int_value = int(current_byte, 16)\n        sum += int_value\n\n    # Extract the Least significant byte from the hex form\n    hex_sum = hex(sum)\n    least_significant_byte = hex_sum[len(hex_sum)-2:]\n    least_significant_byte = least_significant_byte.replace('x', '0')\n\n    # turn back to int and find the 8-bit one's complement\n    int_lsb = int(least_significant_byte, 16)\n    computed_checksum = (~int_lsb) & 0xff\n\n    return computed_checksum", "entry_point": "compute_srec_checksum", "input": "[]", "output": "255", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jedie/DragonPy/blob/6659e5b5133aab26979a498ee7453495773a4f6c/dragonpy/utils/srecord_utils.py#L52-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036873", "code": "def human_duration(t):\n    \"\"\"\n    Converts a time duration into a friendly text representation.\n\n    >>> human_duration(\"type error\")\n    Traceback (most recent call last):\n    ...\n    TypeError: human_duration() argument must be integer or float\n\n    >>> human_duration(0.01)\n    u'10.0 ms'\n    >>> human_duration(0.9)\n    u'900.0 ms'\n    >>> human_duration(65.5)\n    u'1.1 min'\n    >>> human_duration((60 * 60)-1)\n    u'59.0 min'\n    >>> human_duration(60*60)\n    u'1.0 hours'\n    >>> human_duration(1.05*60*60)\n    u'1.1 hours'\n    >>> human_duration(2.54 * 60 * 60 * 24 * 365)\n    u'2.5 years'\n    \"\"\"\n    if not isinstance(t, (int, float)):\n        raise TypeError(\"human_duration() argument must be integer or float\")\n\n    chunks = (\n      (60 * 60 * 24 * 365, u'years'),\n      (60 * 60 * 24 * 30, u'months'),\n      (60 * 60 * 24 * 7, u'weeks'),\n      (60 * 60 * 24, u'days'),\n      (60 * 60, u'hours'),\n    )\n\n    if t < 1:\n        return u\"%.1f ms\" % round(t * 1000, 1)\n    if t < 60:\n        return u\"%.1f sec\" % round(t, 1)\n    if t < 60 * 60:\n        return u\"%.1f min\" % round(t / 60, 1)\n\n    for seconds, name in chunks:\n        count = t / seconds\n        if count >= 1:\n            count = round(count, 1)\n            break\n    return u\"%(number).1f %(type)s\" % {'number': count, 'type': name}", "entry_point": "human_duration", "input": "True", "output": "'1.0 sec'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jedie/DragonPy/blob/6659e5b5133aab26979a498ee7453495773a4f6c/PyDC/PyDC/utils.py#L29-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036874", "code": "def count_the_same(iterable, sentinel):\n    \"\"\"\n    >>> count_the_same([0x55,0x55,0x55,0x55,0x3C,\"foo\",\"bar\"],0x55)\n    (4, 60)\n    >>> 0x3C == 60\n    True\n    \"\"\"\n    count = 0\n    x = None\n    for count, x in enumerate(iterable):\n        if x != sentinel:\n            break\n    return count, x", "entry_point": "count_the_same", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "(0, 'a')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jedie/DragonPy/blob/6659e5b5133aab26979a498ee7453495773a4f6c/PyDC/PyDC/utils.py#L253-L265", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036875", "code": "def count_sign(values, min_value):\n    \"\"\"\n    >>> count_sign([3,-1,-2], 0)\n    (1, 2)\n    >>> count_sign([3,-1,-2], 2)\n    (1, 0)\n    >>> count_sign([0,-1],0)\n    (0, 1)\n    \"\"\"\n    positive_count = 0\n    negative_count = 0\n    for value in values:\n        if value > min_value:\n            positive_count += 1\n        elif value < -min_value:\n            negative_count += 1\n    return positive_count, negative_count", "entry_point": "count_sign", "input": "[], ['apple', 'banana', 'cherry']", "output": "(0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jedie/DragonPy/blob/6659e5b5133aab26979a498ee7453495773a4f6c/PyDC/PyDC/utils.py#L363-L379", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036876", "code": "def camel_to_underscore(name):\n    \"\"\"\n    convert CamelCase style to under_score_case\n    \"\"\"\n    as_list = []\n    length = len(name)\n    for index, i in enumerate(name):\n        if index != 0 and index != length - 1 and i.isupper():\n            as_list.append('_%s' % i.lower())\n        else:\n            as_list.append(i.lower())\n\n    return ''.join(as_list)", "entry_point": "camel_to_underscore", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/wecatch/app-turbo/blob/75faf97371a9a138c53f92168d0a486636cb8a9c/turbo/util.py#L224-L236", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036877", "code": "def clamp(n, lower, upper):\n    \"\"\"\n    Restricts the given number to a lower and upper bound (inclusive)\n\n    :param n:     input number\n    :param lower: lower bound (inclusive)\n    :param upper: upper bound (inclusive)\n    :return:      clamped number\n    \"\"\"\n    if lower > upper:\n        lower, upper = upper, lower\n    return max(min(upper, n), lower)", "entry_point": "clamp", "input": "[1, 2, 3], [-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Tenchi2xh/Almonds/blob/6b27024729f055f2cb5e14ae3ca3cb428ae054bc/almonds/utils.py#L8-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036878", "code": "def mandelbrot_iterate(c, max_iterations, julia_seed=None):\n    \"\"\"\n    Returns the number of iterations before escaping the Mandelbrot fractal.\n\n    :param c: Coordinates as a complex number\n    :type c: complex\n    :param max_iterations: Limit of how many tries are attempted.\n    :return: Tuple containing the last complex number in the sequence and the number of iterations.\n    \"\"\"\n    z = c\n    if julia_seed is not None:\n        c = julia_seed\n    for iterations in range(max_iterations):\n        z = z * z + c\n        if abs(z) > 1000:\n            return z, iterations\n    return z, max_iterations", "entry_point": "mandelbrot_iterate", "input": "'abc', -3, {'x': [1, 2], 'y': []}", "output": "('abc', -3)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Tenchi2xh/Almonds/blob/6b27024729f055f2cb5e14ae3ca3cb428ae054bc/almonds/mandelbrot.py#L11-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036879", "code": "def pkcs7_unpad(data):\n    \"\"\"\n    Remove the padding bytes that were added at point of encryption.\n\n    Implementation copied from pyaspora:\n    https://github.com/mjnovice/pyaspora/blob/master/pyaspora/diaspora/protocol.py#L209\n    \"\"\"\n    if isinstance(data, str):\n        return data[0:-ord(data[-1])]\n    else:\n        return data[0:-data[-1]]", "entry_point": "pkcs7_unpad", "input": "[1, 2, 3]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jaywink/federation/blob/59d31bb37e662891dbea72c1dee05dc53146c78b/federation/protocols/diaspora/encrypted.py#L25-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036880", "code": "def translate_job_state(code):\n    '''AUX Function to translate the (numeric) state of a Job.\n\n    Args:\n        nr (int): A valid number to translate.\n\n    Returns:\n        HTTP response. JSON body.\n    '''\n    code_description = \"\"\n    if code == \"0\":\n        code_description = \"Queued\"\n    if code == \"1\":\n        code_description = \"Scheduled\"\n    if code == \"2\":\n        code_description = \"Processing\"\n    if code == \"3\":\n        code_description = \"Finished\"\n    if code == \"4\":\n        code_description = \"Error\"\n    if code == \"5\":\n        code_description = \"Canceled\"\n    if code == \"6\":\n        code_description = \"Canceling\"\n\n    return code_description", "entry_point": "translate_job_state", "input": "[[1, 2], [3], []]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gbowerman/azurerm/blob/79d40431d3b13f8a36aadbff5029888383d72674/azurerm/amsrp.py#L915-L940", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036881", "code": "def contains_sublist(lst, sublst):\n    \"\"\"\n    Check if one list contains the items from another list (in the same order).\n\n    :param lst: The main list.\n    :param sublist: The sublist to check for.\n    :returns: :data:`True` if the main list contains the items from the\n              sublist in the same order, :data:`False` otherwise.\n\n    Based on `this StackOverflow answer <http://stackoverflow.com/a/3314913>`_.\n    \"\"\"\n    n = len(sublst)\n    return any((sublst == lst[i:i + n]) for i in range(len(lst) - n + 1))", "entry_point": "contains_sublist", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/paylogic/pip-accel/blob/ccad1b784927a322d996db593403b1d2d2e22666/pip_accel/utils.py#L341-L353", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036882", "code": "def _rescale(vector):\n    \"\"\"Scale values in vector to the range [0, 1].\n\n    Args:\n        vector: A list of real values.\n    \"\"\"\n    # Subtract min, making smallest value 0\n    min_val = min(vector)\n    vector = [v - min_val for v in vector]\n\n    # Divide by max, making largest value 1\n    max_val = float(max(vector))\n    try:\n        return [v / max_val for v in vector]\n    except ZeroDivisionError:  # All values are the same\n        return [1.0] * len(vector)", "entry_point": "_rescale", "input": "[1, 2, 3]", "output": "[0.0, 0.5, 1.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JustinLovinger/optimal/blob/ab48a4961697338cc32d50e3a6b06ac989e39c3f/optimal/algorithms/gaoperators.py#L139-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036883", "code": "def _duplicates(list_):\n    \"\"\"Return dict mapping item -> indices.\"\"\"\n    item_indices = {}\n    for i, item in enumerate(list_):\n        try:\n            item_indices[item].append(i)\n        except KeyError:  # First time seen\n            item_indices[item] = [i]\n    return item_indices", "entry_point": "_duplicates", "input": "[5, 3, 1, 4]", "output": "{5: [0], 3: [1], 1: [2], 4: [3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JustinLovinger/optimal/blob/ab48a4961697338cc32d50e3a6b06ac989e39c3f/optimal/optimize.py#L718-L726", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036884", "code": "def binary_to_int(binary_list, lower_bound=0, upper_bound=None):\n    \"\"\"Return the base 10 integer corresponding to a binary list.\n\n   The maximum value is determined by the number of bits in binary_list,\n   and upper_bound. The greater allowed by the two.\n\n    Args:\n        binary_list: list<int>; List of 0s and 1s.\n        lower_bound: Minimum value for output, inclusive.\n            A binary list of 0s will have this value.\n        upper_bound: Maximum value for output, inclusive.\n            If greater than this bound, we \"bounce back\".\n            Ex. w/ upper_bound = 2: [0, 1, 2, 2, 1, 0]\n            Ex.\n                raw_integer = 11, upper_bound = 10, return = 10\n                raw_integer = 12, upper_bound = 10, return = 9\n\n    Returns:\n        int; Integer value of the binary input.\n    \"\"\"\n    # Edge case for empty binary_list\n    if binary_list == []:\n        # With 0 bits, only one value can be represented,\n        # and we default to lower_bound\n        return lower_bound\n    else:\n        # The builtin int construction can take a base argument,\n        # but it requires a string,\n        # so we convert our binary list to a string\n        integer = int(''.join([str(bit) for bit in binary_list]), 2)\n\n    # Trim if over upper_bound\n    if (upper_bound is not None) and integer + lower_bound > upper_bound:\n        # Bounce back. Ex. w/ upper_bound = 2: [0, 1, 2, 2, 1, 0]\n        return upper_bound - (integer % (upper_bound - lower_bound + 1))\n    else:\n        # Not over upper_bound\n        return integer + lower_bound", "entry_point": "binary_to_int", "input": "[], [], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/JustinLovinger/optimal/blob/ab48a4961697338cc32d50e3a6b06ac989e39c3f/optimal/helpers.py#L74-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036885", "code": "def _findrange(parlist,roots=['JUMP','DMXR1_','DMXR2_','DMX_','efac','log10_efac']):\n    \"\"\"Rewrite a list of parameters name by detecting ranges (e.g., JUMP1, JUMP2, ...)\n    and compressing them.\"\"\"\n\n    rootdict = {root: [] for root in roots}\n\n    res = []\n    for par in parlist:\n        found = False\n        for root in roots:\n            if len(par) > len(root) and par[:len(root)] == root:\n                rootdict[root].append(int(par[len(root):]))\n                found = True\n        if not found:\n            res.append(par)\n\n    for root in roots:\n        if rootdict[root]:\n            if len(rootdict[root]) > 1:\n                rmin, rmax = min(rootdict[root]), max(rootdict[root])\n                res.append('{0}{{{1}-{2}}}{3}'.format(root,rmin,rmax,\n                                                  '(incomplete)' if rmax - rmin != len(rootdict[root]) - 1 else ''))\n            else:\n                res.append('{0}{1}'.format(root,rootdict[root][0]))\n    return res", "entry_point": "_findrange", "input": "['a', 'b', 'c'], []", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/vallis/libstempo/blob/0b19300a9b24d64c9ddc25cd6ddbfd12b6231990/libstempo/like.py#L267-L291", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036886", "code": "def make_prefix(api_version, manipulator, auth_type):\n    \"\"\"Make prefix string based on configuration parameters.\"\"\"\n    prefix = \"%s_%s\" % (api_version, manipulator)\n    if (auth_type and auth_type != 'none'):\n        prefix += '_' + auth_type\n    return prefix", "entry_point": "make_prefix", "input": "'abc', [1, 2, 3], ()", "output": "'abc_[1, 2, 3]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zimeon/iiif/blob/9d10018d01202fa2a76dfa61598dc6eca07b471f/iiif/flask_utils.py#L554-L559", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036887", "code": "def split_comma_argument(comma_sep_str):\n    \"\"\"Split a comma separated option into a list.\"\"\"\n    terms = []\n    for term in comma_sep_str.split(','):\n        if term:\n            terms.append(term)\n    return terms", "entry_point": "split_comma_argument", "input": "'Hello World'", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/zimeon/iiif/blob/9d10018d01202fa2a76dfa61598dc6eca07b471f/iiif/flask_utils.py#L562-L568", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036888", "code": "def uord(c):\n    \"\"\"Get Unicode ordinal.\"\"\"\n\n    if len(c) == 2:  # pragma: no cover\n        high, low = [ord(p) for p in c]\n        ordinal = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000\n    else:\n        ordinal = ord(c)\n\n    return ordinal", "entry_point": "uord", "input": "{'a': 1, 'b': 2}", "output": "-56514462", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/facelessuser/soupsieve/blob/24859cc3e756ebf46b75547d49c6b4a7bf35ee82/soupsieve/util.py#L74-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036889", "code": "def balancedSlicer(text, openDelim='[', closeDelim=']'):\n    \"\"\"\n    Assuming that text contains a properly balanced expression using\n    :param openDelim: as opening delimiters and\n    :param closeDelim: as closing delimiters.\n    :return: text between the delimiters\n    \"\"\"\n    openbr = 0\n    cur = 0\n    for char in text:\n        cur +=1\n        if char == openDelim:\n            openbr += 1\n        if char == closeDelim:\n            openbr -= 1\n        if openbr == 0:\n            break\n    return text[:cur], cur", "entry_point": "balancedSlicer", "input": "'', [1, 2, 3], ['apple', 'banana', 'cherry']", "output": "('', 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wiki/wikiextra.py#L7-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036890", "code": "def _construct_end_index( spansStartingFrom ):\r\n   ''' Creates an index which stores all annotations (from spansStartingFrom) \r\n       by their end position in text (annotation[END]).\r\n       \r\n       Each start position (in the index) is associated with a list of \r\n       annotation objects (annotations ending at that position).\r\n       An annotation object is also a list containing the following information:\r\n        *) endTags -- graphic or textual formatting of the end tag,\r\n        *) START position (of the annotation);\r\n        *) layer name;\r\n         \r\n       Multiple annotation objects ending at the same position are sorted by \r\n       their length: shorter annotations preceding the longer ones;\r\n   '''\r\n   endIndex = {}\r\n   for i in spansStartingFrom:\r\n       for span1 in spansStartingFrom[i]:\r\n           # keep the record of endTags, start positions (for determining the length)\r\n           # and layer names\r\n           endSpan1 = [ span1[4], span1[0], span1[2] ]\r\n           endLoc1 = span1[1]\r\n           if endLoc1 not in endIndex:\r\n              endIndex[endLoc1] = []\r\n              endIndex[endLoc1].append( endSpan1 )\r\n           else:\r\n              # Make sure that spans are inserted in the order of increasing length: \r\n              #   shorter spans preceding the longer ones;\r\n              inserted = False\r\n              for i in range( len(endIndex[endLoc1]) ):\r\n                  endSpan2 = endIndex[endLoc1][i]\r\n                  # If an existing span is longer than the current span, insert the\r\n                  # current span before the existing span ...\r\n                  if endSpan2[1] < endSpan1[1]:\r\n                     endIndex[endLoc1].insert( i, endSpan1 )\r\n                     inserted = True\r\n                     break\r\n                  elif endSpan2[1] == endSpan1[1] and endSpan2[2] < endSpan1[2]:\r\n                     # If both spans have equal length, order the spans in the \r\n                     # alphabetical order of layer names:\r\n                     endIndex[endLoc1].insert( i, endSpan1 )\r\n                     inserted = True\r\n                     break\r\n              if not inserted:\r\n                  endIndex[endLoc1].append( endSpan1 )\r\n   return endIndex", "entry_point": "_construct_end_index", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L210-L254", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036891", "code": "def resolve_using_maximal_coverage(matches):\n    \"\"\"Given a list of matches, select a subset of matches\n    such that there are no overlaps and the total number of\n    covered characters is maximal.\n\n    Parameters\n    ----------\n    matches: list of Match\n\n    Returns\n    --------\n    list of Match\n    \"\"\"\n    if len(matches) == 0:\n        return matches\n    matches.sort()\n    N = len(matches)\n    scores = [len(match) for match in matches]\n    prev = [-1] * N\n    for i in range(1, N):\n        bestscore = -1\n        bestprev = -1\n        j = i\n        while j >= 0:\n            # if matches do not overlap\n            if matches[j].is_before(matches[i]):\n                l = scores[j] + len(matches[i])\n                if l >= bestscore:\n                    bestscore = l\n                    bestprev = j\n            else:\n                # in case of overlapping matches\n                l = scores[j] - len(matches[j]) + len(matches[i])\n                if l >= bestscore:\n                    bestscore = l\n                    bestprev = prev[j]\n            j = j - 1\n        scores[i] = bestscore\n        prev[i] = bestprev\n    # first find the matching with highest combined score\n    bestscore = max(scores)\n    bestidx = len(scores) - scores[-1::-1].index(bestscore) -1\n    # then backtrack the non-conflicting matchings that should be kept\n    keepidxs = [bestidx]\n    bestidx = prev[bestidx]\n    while bestidx != -1:\n        keepidxs.append(bestidx)\n        bestidx = prev[bestidx]\n    # filter the matches\n    return [matches[idx] for idx in reversed(keepidxs)]", "entry_point": "resolve_using_maximal_coverage", "input": "set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/grammar/conflictresolver.py#L6-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036892", "code": "def dropSpans(spans, text):\n    \"\"\"\n    Drop from text the blocks identified in :param spans:, possibly nested.\n    \"\"\"\n    spans.sort()\n    res = ''\n    offset = 0\n    for s, e in  spans:\n        if offset <= s:         # handle nesting\n            if offset < s:\n                res += text[offset:s]\n            offset = e\n    res += text[offset:]\n    return res", "entry_point": "dropSpans", "input": "[], '  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wiki/cleaner.py#L124-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036893", "code": "def get_texts_and_labels(sentence_chunk):\n    \"\"\"Given a sentence chunk, extract original texts and labels.\"\"\"\n    words = sentence_chunk.split('\\n')\n    texts = []\n    labels = []\n    for word in words:\n        word = word.strip()\n        if len(word) > 0:\n            toks = word.split('\\t')\n            texts.append(toks[0].strip())\n            labels.append(toks[-1].strip())\n    return texts, labels", "entry_point": "get_texts_and_labels", "input": "'walnut thistle harbour'", "output": "(['walnut thistle harbour'], ['walnut thistle harbour'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/tools/cnllconverter.py#L12-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036894", "code": "def _filter_keys(d: dict, keys: set) -> dict:\n        \"\"\"\n        Select a subset of keys from a dictionary.\n        \"\"\"\n        return {key: d[key] for key in keys if key in d}", "entry_point": "_filter_keys", "input": "{}, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LuminosoInsight/langcodes/blob/0cedf9ca257ebf7250de5d3a63ec33a7d198db58/langcodes/__init__.py#L890-L894", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036895", "code": "def normalize_name(name):\n    \"\"\"\n    When looking up a language-code component by name, we would rather ignore\n    distinctions of case and certain punctuation. \"Chinese (Traditional)\"\n    should be matched by \"Chinese Traditional\" and \"chinese traditional\".\n    \"\"\"\n    name = name.casefold()\n    name = name.replace(\"\u2019\", \"'\")\n    name = name.replace(\"-\", \" \")\n    name = name.replace(\"(\", \"\")\n    name = name.replace(\")\", \"\")\n    name = name.replace(\",\", \"\")\n    return name.strip()", "entry_point": "normalize_name", "input": "'  padded  '", "output": "'padded'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LuminosoInsight/langcodes/blob/0cedf9ca257ebf7250de5d3a63ec33a7d198db58/langcodes/names.py#L12-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036896", "code": "def unicode2encode(text, charmap):\r\n    '''\r\n    charmap : dictionary which has both encode as key, unicode as value\r\n    '''\r\n    if isinstance(text, (list, tuple)):\r\n        unitxt = ''\r\n        for line in text:\r\n            for val,key in charmap.items():\r\n                if key in line:\r\n                    line = line.replace(key, val)\r\n                # end of if val in text:\r\n            unitxt += line\r\n        # end of for line in text:\r\n        return unitxt\r\n    elif isinstance(text, str):\r\n        for val,key in charmap.items():\r\n            if key in text:\r\n                text = text.replace(key, val)\r\n        return text", "entry_point": "unicode2encode", "input": "'  padded  ', {}", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Ezhil-Language-Foundation/open-tamil/blob/b7556e88878d29bbc6c944ee17cdd3f75b8ea9f0/tamil/txt2unicode/unicode2encode.py#L47-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036897", "code": "def to_unicode_repr( _letter ):\n    \"\"\" helpful in situations where browser/app may recognize Unicode encoding\n        in the \\u0b8e type syntax but not actual unicode glyph/code-point\"\"\"\n    # Python 2-3 compatible\n    return u\"u'\"+ u\"\".join( [ u\"\\\\u%04x\"%ord(l) for l in _letter ] ) + u\"'\"", "entry_point": "to_unicode_repr", "input": "['a', 'b', 'c']", "output": "\"u'\\\\u0061\\\\u0062\\\\u0063'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Ezhil-Language-Foundation/open-tamil/blob/b7556e88878d29bbc6c944ee17cdd3f75b8ea9f0/tamil/utf8.py#L33-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036898", "code": "def any_contains_any(strings, candidates):\r\n    \"\"\"Whether any of the strings contains any of the candidates.\"\"\"\r\n    for string in strings:\r\n        for c in candidates:\r\n            if c in string:\r\n                return True", "entry_point": "any_contains_any", "input": "'walnut thistle harbour', ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/utility.py#L32-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036899", "code": "def snake_to_camel_case(name):\n    \"\"\"\n    Accept a snake_case string and return a CamelCase string.\n    For example::\n      >>> snake_to_camel_case('cidr_block')\n      'CidrBlock'\n    \"\"\"\n    name = name.replace(\"-\", \"_\")\n    return \"\".join(word.capitalize() for word in name.split(\"_\"))", "entry_point": "snake_to_camel_case", "input": "'walnut thistle harbour'", "output": "'Walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/remind101/stacker_blueprints/blob/71624f6e1bd4ea794dc98fb621a04235e1931cae/stacker_blueprints/dynamodb.py#L39-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036900", "code": "def fix_datagrepper_message(message):\n    \"\"\"\n    See if a message is (probably) a datagrepper message and attempt to mutate\n    it to pass signature validation.\n\n    Datagrepper adds the 'source_name' and 'source_version' keys. If messages happen\n    to use those keys, they will fail message validation. Additionally, a 'headers'\n    dictionary is present on all responses, regardless of whether it was in the\n    original message or not. This is deleted if it's null, which won't be correct in\n    all cases. Finally, datagrepper turns the 'timestamp' field into a float, but it\n    might have been an integer when the message was signed.\n\n    A copy of the dictionary is made and returned if altering the message is necessary.\n\n    I'm so sorry.\n\n    Args:\n        message (dict): A message to clean up.\n\n    Returns:\n        dict: A copy of the provided message, with the datagrepper-related keys removed\n            if they were present.\n    \"\"\"\n    if not ('source_name' in message and 'source_version' in message):\n        return message\n\n    # Don't mutate the original message\n    message = message.copy()\n\n    del message['source_name']\n    del message['source_version']\n    # datanommer adds the headers field to the message in all cases.\n    # This is a huge problem because if the signature was generated with a 'headers'\n    # key set and we delete it here, messages will fail validation, but if we don't\n    # messages will fail validation if they didn't have a 'headers' key set.\n    #\n    # There's no way to know whether or not the headers field was part of the signed\n    # message or not. Generally, the problem is datanommer is mutating messages.\n    if 'headers' in message and not message['headers']:\n        del message['headers']\n    if 'timestamp' in message:\n        message['timestamp'] = int(message['timestamp'])\n\n    return message", "entry_point": "fix_datagrepper_message", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/fedora-infra/fedmsg/blob/c21d6b3ce023fc3c0e881c704f5b55fb6e6392d7/fedmsg/crypto/utils.py#L11-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036901", "code": "def iriToURI(iri):\n    \"\"\"Transform an IRI to a URI by escaping unicode.\"\"\"\n    # According to RFC 3987, section 3.1, \"Mapping of IRIs to URIs\"\n    if isinstance(iri, bytes):\n        iri = str(iri, encoding=\"utf-8\")\n    return iri.encode('ascii', errors='oid_percent_escape').decode()", "entry_point": "iriToURI", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/necaris/python3-openid/blob/4911bbc196dfd6f9eda7155df9903d668720ecbf/openid/yadis/xri.py#L59-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036902", "code": "def extract_config(config, prefix):\n    \"\"\"return all keys with the same prefix without the prefix\"\"\"\n    prefix = prefix.strip('.') + '.'\n    plen = len(prefix)\n    value = {}\n    for k, v in config.items():\n        if k.startswith(prefix):\n            value[k[plen:]] = v\n    return value", "entry_point": "extract_config", "input": "{'x': [1, 2], 'y': []}, 'abc'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gawel/irc3/blob/cd27840a5809a1f803dc620860fe75d83d2a2ec8/irc3/utils.py#L229-L237", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036903", "code": "def as_list(value):\n    \"\"\"clever string spliting:\n\n    .. code-block:: python\n\n        >>> print(as_list('value'))\n        ['value']\n        >>> print(as_list('v1 v2'))\n        ['v1', 'v2']\n        >>> print(as_list(None))\n        []\n        >>> print(as_list(['v1']))\n        ['v1']\n    \"\"\"\n    if isinstance(value, (list, tuple)):\n        return value\n    if not value:\n        return []\n    for c in '\\n ':\n        if c in value:\n            value = value.split(c)\n            return [v.strip() for v in value if v.strip()]\n    return [value]", "entry_point": "as_list", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gawel/irc3/blob/cd27840a5809a1f803dc620860fe75d83d2a2ec8/irc3/utils.py#L240-L262", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036904", "code": "def parse_modes(modes, targets=None, noargs=''):\n    \"\"\"Parse channel modes:\n\n    .. code-block:: python\n\n        >>> parse_modes('+c-n', noargs='cn')\n        [('+', 'c', None), ('-', 'n', None)]\n        >>> parse_modes('+c-v', ['gawel'], noargs='c')\n        [('+', 'c', None), ('-', 'v', 'gawel')]\n    \"\"\"\n    if not targets:\n        targets = []\n    cleaned = []\n    for mode in modes:\n        if mode in '-+':\n            char = mode\n            continue\n        target = targets.pop(0) if mode not in noargs else None\n        cleaned.append((char, mode, target))\n    return cleaned", "entry_point": "parse_modes", "input": "'', {'x': [1, 2], 'y': []}, [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/gawel/irc3/blob/cd27840a5809a1f803dc620860fe75d83d2a2ec8/irc3/utils.py#L282-L301", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036905", "code": "def unique_element(ll):\n    \"\"\" returns unique elements from a list preserving the original order \"\"\"\n    seen = {}\n    result = []\n    for item in ll:\n        if item in seen:\n            continue\n        seen[item] = 1\n        result.append(item)\n    return result", "entry_point": "unique_element", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/konstantinstadler/pymrio/blob/d764aa0dd2150200e867a9713a98ddae203e12d4/pymrio/tools/ioutil.py#L324-L333", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036906", "code": "def find_first_number(ll):\n    \"\"\" Returns nr of first entry parseable to float in ll, None otherwise\"\"\"\n    for nr, entry in enumerate(ll):\n        try:\n            float(entry)\n        except (ValueError, TypeError) as e:\n            pass\n        else:\n            return nr\n    return None", "entry_point": "find_first_number", "input": "[-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/konstantinstadler/pymrio/blob/d764aa0dd2150200e867a9713a98ddae203e12d4/pymrio/tools/ioutil.py#L447-L456", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036907", "code": "def can_strip_prefix(text:str, prefix:str) -> (bool, str):\n    \"\"\"\n    If the given text starts with the given prefix, True and the text without that prefix is returned.\n    Else False and the original text is returned.\n\n    Note: the text always is stripped, before returning.\n\n    :param text:\n    :param prefix:\n    :return: (bool, str)  :class:`bool` whether he text started with given prefix, :class:`str` the text without prefix\n    \"\"\"\n    if text.startswith(prefix):\n        return True, text[len(prefix):].strip()\n    return False, text.strip()", "entry_point": "can_strip_prefix", "input": "'', ''", "output": "(True, '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/code_generator_template.py#L694-L707", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036908", "code": "def _serialize_hcons(hcons):\n    \"\"\"Serialize [HandleConstraints] into the SimpleMRS encoding.\"\"\"\n    toks = ['HCONS:', '<']\n    for hc in hcons:\n        toks.extend(hc)\n        # reln = hcon[1]\n        # toks += [hcon[0], rel, str(hcon.lo)]\n    toks += ['>']\n    return ' '.join(toks)", "entry_point": "_serialize_hcons", "input": "[]", "output": "'HCONS: < >'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/simplemrs.py#L495-L503", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036909", "code": "def _serialize_icons(icons):\n    \"\"\"Serialize [IndividualConstraints] into the SimpleMRS encoding.\"\"\"\n    toks = ['ICONS:', '<']\n    for ic in icons:\n        toks.extend(ic)\n        # toks += [str(icon.left),\n        #          icon.relation,\n        #          str(icon.right)]\n    toks += ['>']\n    return ' '.join(toks)", "entry_point": "_serialize_icons", "input": "['apple', 'banana', 'cherry']", "output": "'ICONS: < a p p l e b a n a n a c h e r r y >'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/simplemrs.py#L506-L515", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036910", "code": "def int_to_decimal_str(integer):\n    \"\"\"\n    Helper to convert integers (representing cents) into decimal currency\n    string. WARNING: DO NOT TRY TO DO THIS BY DIVISION, FLOATING POINT\n    ERRORS ARE NO FUN IN FINANCIAL SYSTEMS.\n    @param integer The amount in cents\n    @return string The amount in currency with full stop decimal separator\n    \"\"\"\n    int_string = str(integer)\n    if len(int_string) < 2:\n        return \"0.\" + int_string.zfill(2)\n    else:\n        return int_string[:-2] + \".\" + int_string[-2:]", "entry_point": "int_to_decimal_str", "input": "[]", "output": "'.[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/raphaelm/python-sepaxml/blob/187b699b1673c862002b2bae7e1bd62fe8623aec/sepaxml/utils.py#L64-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036911", "code": "def equals(val1, val2):\n    \"\"\"\n    Returns True if the two strings are equal, False otherwise.\n\n    The time taken is independent of the number of characters that match.\n\n    For the sake of simplicity, this function executes in constant time only\n    when the two strings have the same length. It short-circuits when they\n    have different lengths.\n    \"\"\"\n    if len(val1) != len(val2):\n        return False\n    result = 0\n    for x, y in zip(val1, val2):\n        result |= ord(x) ^ ord(y)\n    return result == 0", "entry_point": "equals", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ecordell/pymacaroons/blob/c941614df15fe732ea432a62788e45410bcb868d/pymacaroons/utils.py#L80-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036912", "code": "def is_nullable_list(val, vtype):\n    \"\"\"Return True if list contains either values of type `vtype` or None.\"\"\"\n    return (isinstance(val, list) and\n            any(isinstance(v, vtype) for v in val) and\n            all((isinstance(v, vtype) or v is None) for v in val))", "entry_point": "is_nullable_list", "input": "[], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marshallward/f90nml/blob/4932cabc5221afc844ee6a5b4a05ceb8bd4a2711/f90nml/namelist.py#L721-L725", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036913", "code": "def toStringArray(name, a, width = 0):\n    \"\"\"\n    Returns an array (any sequence of floats, really) as a string.\n    \"\"\"\n    string = name + \": \"\n    cnt = 0\n    for i in a:\n        string += \"%4.2f  \" % i \n        if width > 0 and (cnt + 1) % width == 0:\n            string += '\\n'\n        cnt += 1\n    return string", "entry_point": "toStringArray", "input": "'a,b,c', [-1, 0, 1, 2], 10", "output": "'a,b,c: -1.00  0.00  1.00  2.00  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Calysto/calysto/blob/20813c0f48096317aa775d03a5c6b20f12fafc93/calysto/ai/conx.py#L161-L172", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036914", "code": "def delist(values):\n    \"\"\"Reduce lists of zero or one elements to individual values.\"\"\"\n    assert isinstance(values, list)\n\n    if not values:\n        return None\n    elif len(values) == 1:\n        return values[0]\n\n    return values", "entry_point": "delist", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/marshallward/f90nml/blob/4932cabc5221afc844ee6a5b4a05ceb8bd4a2711/f90nml/parser.py#L898-L907", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036915", "code": "def _prepare_requirements(requirements, requires_filters):\n        \"\"\"\n        Overrides the filters specified in the decorator with the given ones\n\n        :param requirements: Dictionary of requirements (field \u2192 Requirement)\n        :param requires_filters: Content of the 'requires.filter' component\n                                 property (field \u2192 string)\n        :return: The new requirements\n        \"\"\"\n        if not requires_filters or not isinstance(requires_filters, dict):\n            # No explicit filter configured\n            return requirements\n\n        # We need to change a part of the requirements\n        new_requirements = {}\n        for field, requirement in requirements.items():\n            try:\n                explicit_filter = requires_filters[field]\n\n                # Store an updated copy of the requirement\n                requirement_copy = requirement.copy()\n                requirement_copy.set_filter(explicit_filter)\n                new_requirements[field] = requirement_copy\n\n            except (KeyError, TypeError, ValueError):\n                # No information for this one, or invalid filter:\n                # keep the factory requirement\n                new_requirements[field] = requirement\n\n        return new_requirements", "entry_point": "_prepare_requirements", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L59-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036916", "code": "def _prepare_requirements(configs, requires_filters):\n        \"\"\"\n        Overrides the filters specified in the decorator with the given ones\n\n        :param configs: Field \u2192 (Requirement, key, allow_none) dictionary\n        :param requires_filters: Content of the 'requires.filter' component\n                                 property (field \u2192 string)\n        :return: The new configuration dictionary\n        \"\"\"\n        if not requires_filters or not isinstance(requires_filters, dict):\n            # No explicit filter configured\n            return configs\n\n        # We need to change a part of the requirements\n        new_requirements = {}\n        for field, config in configs.items():\n            # Extract values from tuple\n            requirement, key, allow_none = config\n\n            try:\n                explicit_filter = requires_filters[field]\n\n                # Store an updated copy of the requirement\n                requirement_copy = requirement.copy()\n                requirement_copy.set_filter(explicit_filter)\n                new_requirements[field] = (requirement_copy, key, allow_none)\n\n            except (KeyError, TypeError, ValueError):\n                # No information for this one, or invalid filter:\n                # keep the factory requirement\n                new_requirements[field] = config\n\n        return new_requirements", "entry_point": "_prepare_requirements", "input": "{}, [-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L60-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036917", "code": "def remove_duplicates(items):\n    \"\"\"\n    Returns a list without duplicates, keeping elements order\n\n    :param items: A list of items\n    :return: The list without duplicates, in the same order\n    \"\"\"\n    if items is None:\n        return items\n\n    new_list = []\n    for item in items:\n        if item not in new_list:\n            new_list.append(item)\n    return new_list", "entry_point": "remove_duplicates", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L373-L387", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036918", "code": "def add_listener(registry, listener):\n    \"\"\"\n    Adds a listener in the registry, if it is not yet in\n\n    :param registry: A registry (a list)\n    :param listener: The listener to register\n    :return: True if the listener has been added\n    \"\"\"\n    if listener is None or listener in registry:\n        return False\n\n    registry.append(listener)\n    return True", "entry_point": "add_listener", "input": "['a', 'b', 'c'], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L393-L405", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036919", "code": "def to_iterable(value, allow_none=True):\n    \"\"\"\n    Tries to convert the given value to an iterable, if necessary.\n    If the given value is a list, a list is returned; if it is a string, a list\n    containing one string is returned, ...\n\n    :param value: Any object\n    :param allow_none: If True, the method returns None if value is None, else\n                       it returns an empty list\n    :return: A list containing the given string, or the given value\n    \"\"\"\n    if value is None:\n        # None given\n        if allow_none:\n            return None\n\n        return []\n\n    elif isinstance(value, (list, tuple, set, frozenset)):\n        # Iterable given, return it as-is\n        return value\n\n    # Return a one-value list\n    return [value]", "entry_point": "to_iterable", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L551-L574", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036920", "code": "def literalize_string(content, is_unicode=False):\n    r'''Literalize a string content.\n\n    Examples:\n\n    >>> print literalize_string('str')\n    'str'\n    >>> print literalize_string('\\'str\\'')\n    \"'str'\"\n    >>> print literalize_string('\\\"\\'str\\'\\\"')\n    '\"\\'str\\'\"'\n    '''\n\n    quote_mark = \"'\"\n    if \"'\" in content:\n        quote_mark = '\"'\n        if '\"' in content:\n            quote_mark = \"'\"\n            content = content.replace(r\"'\", r\"\\'\")\n\n    if '\\n' in content:\n        quote_mark *= 3\n\n    return 'u'[not is_unicode:]+quote_mark+content+quote_mark", "entry_point": "literalize_string", "input": "'a,b,c', 0.5", "output": "\"u'a,b,c'\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/moskytw/uniout/blob/8ea8fc84f3da297352e6b7335e354b41b40e7788/_uniout.py#L9-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036921", "code": "def make_html_list(items, tag=\"ul\"):\n    # type: (Iterable[Any], str) -> str\n    \"\"\"\n    Makes a HTML list from the given iterable\n\n    :param items: The items to list\n    :param tag: The tag to use (ul or ol)\n    :return: The HTML list code\n    \"\"\"\n    html_list = \"\\n\".join(\n        '<li><a href=\"{0}\">{0}</a></li>'.format(item) for item in items\n    )\n    return \"<{0}>\\n{1}\\n</{0}>\".format(tag, html_list)", "entry_point": "make_html_list", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "'<[5, 3, 1, 4]>\\n<li><a href=\"a\">a</a></li>\\n<li><a href=\"b\">b</a></li>\\n<li><a href=\"c\">c</a></li>\\n</[5, 3, 1, 4]>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/http/__init__.py#L132-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036922", "code": "def _skip_spaces(string, idx):\n    # type: (str, int) -> int\n    \"\"\"\n    Retrieves the next non-space character after idx index in the given string\n\n    :param string: The string to look into\n    :param idx: The base search index\n    :return: The next non-space character index, -1 if not found\n    \"\"\"\n    i = idx\n    for char in string[idx:]:\n        if not char.isspace():\n            return i\n        i += 1\n\n    return -1", "entry_point": "_skip_spaces", "input": "'abc', 10", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ldapfilter.py#L733-L748", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036923", "code": "def get_prop_value(name, props, default=None):\n    # type: (str, Dict[str, Any], Any) -> Any\n    \"\"\"\n    Returns the value of a property or the default one\n\n    :param name: Name of a property\n    :param props: Dictionary of properties\n    :param default: Default value\n    :return: The value of the property or the default one\n    \"\"\"\n    if not props:\n        return default\n\n    try:\n        return props[name]\n    except KeyError:\n        return default", "entry_point": "get_prop_value", "input": "'AbC dEf', {'a': 1, 'b': 2}, [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/__init__.py#L1132-L1148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036924", "code": "def get_string_plus_property_value(value):\n    # type: (Any) -> Optional[List[str]]\n    \"\"\"\n    Converts a string or list of string into a list of strings\n\n    :param value: A string or a list of strings\n    :return: A list of strings or None\n    \"\"\"\n    if value:\n        if isinstance(value, str):\n            return [value]\n        if isinstance(value, list):\n            return value\n        if isinstance(value, tuple):\n            return list(value)\n\n    return None", "entry_point": "get_string_plus_property_value", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/__init__.py#L1165-L1181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036925", "code": "def validate_exported_interfaces(object_class, exported_intfs):\n    # type: (List[str], List[str]) -> bool\n    \"\"\"\n    Validates that the exported interfaces are all provided by the service\n\n    :param object_class: The specifications of a service\n    :param exported_intfs: The exported specifications\n    :return: True if the exported specifications are all provided by the service\n    \"\"\"\n    if (\n        not exported_intfs\n        or not isinstance(exported_intfs, list)\n        or not exported_intfs\n    ):\n        return False\n    else:\n        for exintf in exported_intfs:\n            if exintf not in object_class:\n                return False\n    return True", "entry_point": "validate_exported_interfaces", "input": "[-1, 0, 1, 2], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/__init__.py#L1260-L1279", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036926", "code": "def get_dot_properties(prefix, props, remove_prefix):\n    # type: (str, Dict[str, Any], bool) -> Dict[str, Any]\n    \"\"\"\n    Gets the properties starting with the given prefix\n    \"\"\"\n    result_props = {}\n    if props:\n        dot_keys = [x for x in props.keys() if x.startswith(prefix + \".\")]\n        for dot_key in dot_keys:\n            if remove_prefix:\n                new_key = dot_key[len(prefix) + 1 :]\n            else:\n                new_key = dot_key\n            result_props[new_key] = props.get(dot_key)\n    return result_props", "entry_point": "get_dot_properties", "input": "'', set(), (1, 2)", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/__init__.py#L1513-L1527", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036927", "code": "def set_append(input_set, item):\n    # type: (set, Any) -> set\n    \"\"\"\n    Appends in-place the given item to the set.\n    If the item is a list, all elements are added to the set.\n\n    :param input_set: An existing set\n    :param item: The item or list of items to add\n    :return: The given set\n    \"\"\"\n    if item:\n        if isinstance(item, (list, tuple)):\n            input_set.update(item)\n        else:\n            input_set.add(item)\n    return input_set", "entry_point": "set_append", "input": "[[1, 2], [3], []], []", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/__init__.py#L1597-L1612", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036928", "code": "def encode_list(key, list_):\n    # type: (str, Iterable) -> Dict[str, str]\n    \"\"\"\n    Converts a list into a space-separated string and puts it in a dictionary\n\n    :param key: Dictionary key to store the list\n    :param list_: A list of objects\n    :return: A dictionary key->string or an empty dictionary\n    \"\"\"\n    if not list_:\n        return {}\n    return {key: \" \".join(str(i) for i in list_)}", "entry_point": "encode_list", "input": "False, ('a', 'b', 'c')", "output": "{False: 'a b c'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/endpointdescription.py#L89-L100", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036929", "code": "def package_name(package):\n    # type: (str) -> str\n    \"\"\"\n    Returns the package name of the given module name\n    \"\"\"\n    if not package:\n        return \"\"\n\n    lastdot = package.rfind(\".\")\n    if lastdot == -1:\n        return package\n\n    return package[:lastdot]", "entry_point": "package_name", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/endpointdescription.py#L103-L115", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036930", "code": "def _prepare_configs(configs, requires_filters, temporal_timeouts):\n        \"\"\"\n        Overrides the filters specified in the decorator with the given ones\n\n        :param configs: Field \u2192 (Requirement, key, allow_none) dictionary\n        :param requires_filters: Content of the 'requires.filter' component\n                                 property (field \u2192 string)\n        :param temporal_timeouts: Content of the 'temporal.timeouts' component\n                                  property (field \u2192 float)\n        :return: The new configuration dictionary\n        \"\"\"\n        if not isinstance(requires_filters, dict):\n            requires_filters = {}\n\n        if not isinstance(temporal_timeouts, dict):\n            temporal_timeouts = {}\n\n        if not requires_filters and not temporal_timeouts:\n            # No explicit configuration given\n            return configs\n\n        # We need to change a part of the requirements\n        new_configs = {}\n        for field, config in configs.items():\n            # Extract values from tuple\n            requirement, timeout = config\n            explicit_filter = requires_filters.get(field)\n            explicit_timeout = temporal_timeouts.get(field)\n\n            # Convert the timeout value\n            try:\n                explicit_timeout = int(explicit_timeout)\n                if explicit_timeout <= 0:\n                    explicit_timeout = timeout\n            except (ValueError, TypeError):\n                explicit_timeout = timeout\n\n            if not explicit_filter and not explicit_timeout:\n                # Nothing to do\n                new_configs[field] = config\n            else:\n                try:\n                    # Store an updated copy of the requirement\n                    requirement_copy = requirement.copy()\n                    if explicit_filter:\n                        requirement_copy.set_filter(explicit_filter)\n                    new_configs[field] = (requirement_copy, explicit_timeout)\n                except (TypeError, ValueError):\n                    # No information for this one, or invalid filter:\n                    # keep the factory requirement\n                    new_configs[field] = config\n\n        return new_configs", "entry_point": "_prepare_configs", "input": "{'a': 1, 'b': 2}, [1, 2, 3], [-1, 0, 1, 2]", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/temporal.py#L59-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036931", "code": "def _parse_boolean(value):\n    \"\"\"\n    Returns a boolean value corresponding to the given value.\n\n    :param value: Any value\n    :return: Its boolean value\n    \"\"\"\n    if not value:\n        return False\n\n    try:\n        # Lower string to check known \"false\" value\n        value = value.lower()\n        return value not in (\"none\", \"0\", \"false\", \"no\")\n    except AttributeError:\n        # Not a string, but has a value\n        return True", "entry_point": "_parse_boolean", "input": "['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/eventadmin_printer.py#L58-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036932", "code": "def format_currency(value, decimals=2):\n    \"\"\"\n    Return a number suitably formatted for display as currency, with\n    thousands separated by commas and up to two decimal points.\n\n    >>> format_currency(1000)\n    '1,000'\n    >>> format_currency(100)\n    '100'\n    >>> format_currency(999.95)\n    '999.95'\n    >>> format_currency(99.95)\n    '99.95'\n    >>> format_currency(100000)\n    '100,000'\n    >>> format_currency(1000.00)\n    '1,000'\n    >>> format_currency(1000.41)\n    '1,000.41'\n    >>> format_currency(23.21, decimals=3)\n    '23.210'\n    >>> format_currency(1000, decimals=3)\n    '1,000'\n    >>> format_currency(123456789.123456789)\n    '123,456,789.12'\n    \"\"\"\n    number, decimal = ((u'%%.%df' % decimals) % value).split(u'.')\n    parts = []\n    while len(number) > 3:\n        part, number = number[-3:], number[:-3]\n        parts.append(part)\n    parts.append(number)\n    parts.reverse()\n    if int(decimal) == 0:\n        return u','.join(parts)\n    else:\n        return u','.join(parts) + u'.' + decimal", "entry_point": "format_currency", "input": "True, True", "output": "'1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hasgeek/coaster/blob/07f7eb5d5f516e22fa14fdf4dc70e0ae13ee398d/coaster/utils/misc.py#L401-L437", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036933", "code": "def getbool(value):\n    \"\"\"\n    Returns a boolean from any of a range of values. Returns None for\n    unrecognized values. Numbers other than 0 and 1 are considered\n    unrecognized.\n\n    >>> getbool(True)\n    True\n    >>> getbool(1)\n    True\n    >>> getbool('1')\n    True\n    >>> getbool('t')\n    True\n    >>> getbool(2)\n    >>> getbool(0)\n    False\n    >>> getbool(False)\n    False\n    >>> getbool('n')\n    False\n    \"\"\"\n    value = str(value).lower()\n    if value in ['1', 't', 'true', 'y', 'yes']:\n        return True\n    elif value in ['0', 'f', 'false', 'n', 'no']:\n        return False\n    return None", "entry_point": "getbool", "input": "True", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/hasgeek/coaster/blob/07f7eb5d5f516e22fa14fdf4dc70e0ae13ee398d/coaster/utils/misc.py#L531-L558", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036934", "code": "def hamming(seq1, seq2, normalized=False):\n\t\"\"\"Compute the Hamming distance between the two sequences `seq1` and `seq2`.\n\tThe Hamming distance is the number of differing items in two ordered\n\tsequences of the same length. If the sequences submitted do not have the\n\tsame length, an error will be raised.\n\t\n\tIf `normalized` evaluates to `False`, the return value will be an integer\n\tbetween 0 and the length of the sequences provided, edge values included;\n\totherwise, it will be a float between 0 and 1 included, where 0 means\n\tequal, and 1 totally different. Normalized hamming distance is computed as:\n\t\n\t\t0.0                         if len(seq1) == 0\n\t\thamming_dist / len(seq1)    otherwise\n\t\"\"\"\n\tL = len(seq1)\n\tif L != len(seq2):\n\t\traise ValueError(\"expected two strings of the same length\")\n\tif L == 0:\n\t\treturn 0.0 if normalized else 0  # equal\n\tdist = sum(c1 != c2 for c1, c2 in zip(seq1, seq2))\n\tif normalized:\n\t\treturn dist / float(L)\n\treturn dist", "entry_point": "hamming", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []], [-1, 0, 1, 2]", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/distance/distance/_simpledists.py#L3-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036935", "code": "def jaccard(seq1, seq2):\n\t\"\"\"Compute the Jaccard distance between the two sequences `seq1` and `seq2`.\n\tThey should contain hashable items.\n\t\n\tThe return value is a float between 0 and 1, where 0 means equal, and 1 totally different.\n\t\"\"\"\n\tset1, set2 = set(seq1), set(seq2)\n\treturn 1 - len(set1 & set2) / float(len(set1 | set2))", "entry_point": "jaccard", "input": "[], [-1, 0, 1, 2]", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/distance/distance/_simpledists.py#L27-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036936", "code": "def sorensen(seq1, seq2):\n\t\"\"\"Compute the Sorensen distance between the two sequences `seq1` and `seq2`.\n\tThey should contain hashable items.\n\t\n\tThe return value is a float between 0 and 1, where 0 means equal, and 1 totally different.\n\t\"\"\"\n\tset1, set2 = set(seq1), set(seq2)\n\treturn 1 - (2 * len(set1 & set2) / float(len(set1) + len(set2)))", "entry_point": "sorensen", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/distance/distance/_simpledists.py#L37-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036937", "code": "def _format_trace(trace):\n    \"\"\"\n    Convert the (stripped) stack-trace to a nice readable format. The stack\n    trace `trace` is a list of frame records as returned by\n    **inspect.stack** but without the frame objects.\n    Returns a string.\n    \"\"\"\n    lines = []\n    for fname, lineno, func, src, _ in trace:\n        if src:\n            for line in src:\n                lines.append('    '+line.strip()+'\\n')\n        lines.append('  %s:%4d in %s\\n' % (fname, lineno, func))\n    return ''.join(lines)", "entry_point": "_format_trace", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/profilers/visual/pympler/classtracker_stats.py#L55-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036938", "code": "def fast_comp(seq1, seq2, transpositions=False):\n\t\"\"\"Compute the distance between the two sequences `seq1` and `seq2` up to a\n\tmaximum of 2 included, and return it. If the edit distance between the two\n\tsequences is higher than that, -1 is returned.\n\t\n\tIf `transpositions` is `True`, transpositions will be taken into account for\n\tthe computation of the distance. This can make a difference, e.g.:\n\n\t\t>>> fast_comp(\"abc\", \"bac\", transpositions=False)\n\t\t2\n\t\t>>> fast_comp(\"abc\", \"bac\", transpositions=True)\n\t\t1\n\t\n\tThis is faster than `levenshtein` by an order of magnitude, but on the\n\tother hand is of limited use.\n\n\tThe algorithm comes from `http://writingarchives.sakura.ne.jp/fastcomp`.\n\tI've added transpositions support to the original code.\n\t\"\"\"\n\treplace, insert, delete = \"r\", \"i\", \"d\"\n\n\tL1, L2  = len(seq1), len(seq2)\n\tif L1 < L2:\n\t\tL1, L2 = L2, L1\n\t\tseq1, seq2 = seq2, seq1\n\n\tldiff = L1 - L2\n\tif ldiff == 0:\n\t\tmodels = (insert+delete, delete+insert, replace+replace)\n\telif ldiff == 1:\n\t\tmodels = (delete+replace, replace+delete)\n\telif ldiff == 2:\n\t\tmodels = (delete+delete,)\n\telse:\n\t\treturn -1\n\n\tres = 3\n\tfor model in models:\n\t\ti = j = c = 0\n\t\twhile (i < L1) and (j < L2):\n\t\t\tif seq1[i] != seq2[j]:\n\t\t\t\tc = c+1\n\t\t\t\tif 2 < c:\n\t\t\t\t\tbreak\n            \n\t\t\t\tif transpositions and ldiff != 2 \\\n            \tand i < L1 - 1 and j < L2 - 1 \\\n            \tand seq1[i+1] == seq2[j] and seq1[i] == seq2[j+1]:\n\t\t\t\t\ti, j = i+2, j+2\n\t\t\t\telse:\n\t\t\t\t\tcmd = model[c-1]\n\t\t\t\t\tif cmd == delete:\n\t\t\t\t\t\ti = i+1\n\t\t\t\t\telif cmd == insert:\n\t\t\t\t\t\tj = j+1\n\t\t\t\t\telse:\n\t\t\t\t\t\tassert cmd == replace\n\t\t\t\t\t\ti,j = i+1, j+1\n\t\t\telse:\n\t\t\t\ti,j = i+1, j+1\n\n\t\tif 2 < c:\n\t\t\tcontinue\n\t\telif i < L1:\n\t\t\tif L1-i <= model[c:].count(delete):\n\t\t\t\tc = c + (L1-i)\n\t\t\telse:\n\t\t\t\tcontinue\n\t\telif j < L2:\n\t\t\tif L2-j <= model[c:].count(insert):\n\t\t\t\tc = c + (L2-j)\n\t\t\telse:\n\t\t\t\tcontinue\n\n\t\tif c < res:\n\t\t\tres = c\n\n\tif res == 3:\n\t\tres = -1\n\treturn res", "entry_point": "fast_comp", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], []", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/distance/distance/_fastcomp.py#L3-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036939", "code": "def grouped_count_sizes(fileslist, fgrouped):  # pragma: no cover\n    '''Compute the total size per group and total number of files. Useful to check that everything is OK.'''\n    fsizes = {}\n    total_files = 0\n    allitems = None\n    if isinstance(fgrouped, dict):\n        allitems = fgrouped.iteritems()\n    elif isinstance(fgrouped, list):\n        allitems = enumerate(fgrouped)\n    for fkey, cluster in allitems:\n        fsizes[fkey] = []\n        for subcluster in cluster:\n            tot = 0\n            if subcluster is not None:\n                for fname in subcluster:\n                    tot += fileslist[fname]\n                    total_files += 1\n            fsizes[fkey].append(tot)\n    return fsizes, total_files", "entry_point": "grouped_count_sizes", "input": "['apple', 'banana', 'cherry'], []", "output": "({}, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/aux_funcs.py#L338-L356", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036940", "code": "def safe_repr(obj, clip=None):\n    \"\"\"\n    Convert object to string representation, yielding the same result a `repr`\n    but catches all exceptions and returns 'N/A' instead of raising the\n    exception. Strings may be truncated by providing `clip`.\n\n    >>> safe_repr(42)\n    '42'\n    >>> safe_repr('Clipped text', clip=8)\n    'Clip..xt'\n    >>> safe_repr([1,2,3,4], clip=8)\n    '[1,2..4]'\n    \"\"\"\n    try:\n        s = repr(obj)\n        if not clip or len(s) <= clip:\n            return s\n        else:\n            return s[:clip-4]+'..'+s[-2:]\n    except:\n        return 'N/A'", "entry_point": "safe_repr", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "'N/A'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/profilers/visual/pympler/util/stringutils.py#L5-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036941", "code": "def trunc(obj, max, left=0):\n    \"\"\"\n    Convert `obj` to string, eliminate newlines and truncate the string to `max`\n    characters. If there are more characters in the string add ``...`` to the\n    string. With `left=True`, the string can be truncated at the beginning.\n\n    @note: Does not catch exceptions when converting `obj` to string with `str`.\n\n    >>> trunc('This is a long text.', 8)\n    This ...\n    >>> trunc('This is a long text.', 8, left)\n    ...text.\n    \"\"\"\n    s = str(obj)\n    s = s.replace('\\n', '|')\n    if len(s) > max:\n        if left:\n            return '...'+s[len(s)-max+3:]\n        else:\n            return s[:(max-3)]+'...'\n    else:\n        return s", "entry_point": "trunc", "input": "{}, 2.0, -1.5", "output": "'{}'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/profilers/visual/pympler/util/stringutils.py#L28-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036942", "code": "def pp_timestamp(t):\n    \"\"\"\n    Get a friendly timestamp represented as a string.\n    \"\"\"\n    if t is None:\n        return ''\n    h, m, s = int(t / 3600), int(t / 60 % 60), t % 60\n    return \"%02d:%02d:%05.2f\" % (h, m, s)", "entry_point": "pp_timestamp", "input": "-3", "output": "'00:59:57.00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/profilers/visual/pympler/util/stringutils.py#L64-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036943", "code": "def _remove_duplicates(objects):\n    \"\"\"Remove duplicate objects.\n\n    Inspired by http://www.peterbe.com/plog/uniqifiers-benchmark\n\n    \"\"\"\n    seen = {}\n    result = []\n    for item in objects:\n        marker = id(item)\n        if marker in seen:\n            continue\n        seen[marker] = 1\n        result.append(item)\n    return result", "entry_point": "_remove_duplicates", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/profilers/visual/pympler/muppy.py#L242-L256", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036944", "code": "def get_diff(left, right):\n    \"\"\"Get the difference of two summaries.\n\n    Subtracts the values of the right summary from the values of the left\n    summary.\n    If similar rows appear on both sides, the are included in the summary with\n    0 for number of elements and total size.\n    If the number of elements of a row of the diff is 0, but the total size is\n    not, it means that objects likely have changed, but not there number, thus\n    resulting in a changed size.\n\n    \"\"\"\n    res = []\n    for row_r in right:\n        found = False\n        for row_l in left:\n            if row_r[0] == row_l[0]:\n                res.append([row_r[0], row_r[1] - row_l[1], row_r[2] - row_l[2]])\n                found = True\n        if not found:\n            res.append(row_r)\n\n    for row_l in left:\n        found = False\n        for row_r in right:\n            if row_l[0] == row_r[0]:\n                found = True\n        if not found:\n            res.append([row_l[0], -row_l[1], -row_l[2]])\n    return res", "entry_point": "get_diff", "input": "[], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/profilers/visual/pympler/summary.py#L136-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036945", "code": "def _to_binpoly(x):\n        '''Convert a Galois Field's number into a nice polynomial'''\n        if x <= 0: return \"0\"\n        b = 1 # init to 2^0 = 1\n        c = [] # stores the degrees of each term of the polynomials\n        i = 0 # counter for b = 2^i\n        while x > 0:\n            b = (1 << i) # generate a number power of 2: 2^0, 2^1, 2^2, ..., 2^i. Equivalent to b = 2^i\n            if x & b : # then check if x is divisible by the power of 2. Equivalent to x % 2^i == 0\n                # If yes, then...\n                c.append(i) # append this power (i, the exponent, gives us the coefficient)\n                x ^= b # and compute the remainder of x / b\n            i = i+1 # increment to compute the next power of 2\n        return \" + \".join([\"x^%i\" % y for y in c[::-1]])", "entry_point": "_to_binpoly", "input": "2", "output": "'x^1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/brownanrs/ff.py#L250-L263", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036946", "code": "def format_sizeof(num, suffix='bytes'):\n    '''Readable size format, courtesy of Sridhar Ratnakumar'''\n    for unit in ['','K','M','G','T','P','E','Z']:\n        if abs(num) < 1000.0:\n            return \"%3.1f%s%s\" % (num, unit, suffix)\n        num /= 1000.0\n    return \"%.1f%s%s\" % (num, 'Y', suffix)", "entry_point": "format_sizeof", "input": "1, 'abc'", "output": "'1.0abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/tqdm/tqdm.py#L20-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036947", "code": "def compute_ecc_params(max_block_size, rate, hasher):\n    '''Compute the ecc parameters (size of the message, size of the hash, size of the ecc). This is an helper function to easily compute the parameters from a resilience rate to instanciate an ECCMan object.'''\n    #message_size = max_block_size - int(round(max_block_size * rate * 2, 0)) # old way to compute, wasn't really correct because we applied the rate on the total message+ecc size, when we should apply the rate to the message size only (that is not known beforehand, but we want the ecc size (k) = 2*rate*message_size or in other words that k + k * 2 * rate = n)\n    message_size = int(round(float(max_block_size) / (1 + 2*rate), 0))\n    ecc_size = max_block_size - message_size\n    hash_size = len(hasher) # 32 when we use MD5\n    return {\"message_size\": message_size, \"ecc_size\": ecc_size, \"hash_size\": hash_size}", "entry_point": "compute_ecc_params", "input": "-3, 3.25, ['apple', 'banana', 'cherry']", "output": "{'message_size': 0, 'ecc_size': -3, 'hash_size': 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lrq3000/pyFileFixity/blob/fd5ef23bb13835faf1e3baa773619b86a1cc9bdf/pyFileFixity/lib/eccman.py#L48-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036948", "code": "def scopeMatch(assumedScopes, requiredScopeSets):\n    \"\"\"\n        Take a list of a assumed scopes, and a list of required scope sets on\n        disjunctive normal form, and check if any of the required scope sets are\n        satisfied.\n\n        Example:\n\n            requiredScopeSets = [\n                [\"scopeA\", \"scopeB\"],\n                [\"scopeC\"]\n            ]\n\n        In this case assumed_scopes must contain, either:\n        \"scopeA\" AND \"scopeB\", OR just \"scopeC\".\n    \"\"\"\n    for scopeSet in requiredScopeSets:\n        for requiredScope in scopeSet:\n            for scope in assumedScopes:\n                if scope == requiredScope:\n                    # requiredScope satisifed, no need to check more scopes\n                    break\n                if scope.endswith(\"*\") and requiredScope.startswith(scope[:-1]):\n                    # requiredScope satisifed, no need to check more scopes\n                    break\n            else:\n                # requiredScope not satisfied, stop checking scopeSet\n                break\n        else:\n            # scopeSet satisfied, so we're happy\n            return True\n    # none of the requiredScopeSets were satisfied\n    return False", "entry_point": "scopeMatch", "input": "[], ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/utils.py#L197-L229", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036949", "code": "def is_by_step(raw):\n    \"\"\"If the password is alphabet step by step.\"\"\"\n    # make sure it is unicode\n    delta = ord(raw[1]) - ord(raw[0])\n\n    for i in range(2, len(raw)):\n        if ord(raw[i]) - ord(raw[i-1]) != delta:\n            return False\n\n    return True", "entry_point": "is_by_step", "input": "['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lepture/safe/blob/038a72e59557caf97c1b93f66124a8f014eb032b/safe/__init__.py#L81-L90", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036950", "code": "def parse_response(fields, records):\n        \"\"\"Parse an API response into usable objects.\n\n        Args:\n            fields (list[str]): List of strings indicating the fields that\n                are represented in the records, in the order presented in\n                the records.::\n\n                [\n                    'number1',\n                    'number2',\n                    'number3',\n                    'first_name',\n                    'last_name',\n                    'company',\n                    'street',\n                    'city',\n                    'state',\n                    'zip',\n                ]\n\n            records (list[dict]): A really crappy data structure representing\n                records as returned by Five9::\n\n                    [\n                        {\n                            'values': {\n                                'data': [\n                                    '8881234567',\n                                    None,\n                                    None,\n                                    'Dave',\n                                    'Lasley',\n                                    'LasLabs Inc',\n                                    None,\n                                    'Las Vegas',\n                                    'NV',\n                                    '89123',\n                                ]\n                            }\n                        }\n                    ]\n\n        Returns:\n            list[dict]: List of parsed records.\n        \"\"\"\n        data = [i['values']['data'] for i in records]\n        return [\n            {fields[idx]: row for idx, row in enumerate(d)}\n            for d in data\n        ]", "entry_point": "parse_response", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/LasLabs/python-five9/blob/ef53160d6658604524a2577391280d2b4501a7ce/five9/five9.py#L100-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036951", "code": "def to_list(stringlist, unquote=True):\n    \"\"\"Convert a string representing a list to real list.\"\"\"\n    stringlist = stringlist[1:-1]\n    return [\n        string.strip('\"') if unquote else string\n        for string in stringlist.split(\",\")\n    ]", "entry_point": "to_list", "input": "'Hello World', 5", "output": "['ello Worl']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tonioo/sievelib/blob/88822d1f1daf30ef3dd9ac74911301b0773ef3c8/sievelib/tools.py#L15-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036952", "code": "def _filter_result(result, filter_functions=None):\n        \"\"\"\n        Filter result with given filter functions.\n\n        :param result: an iterable object\n        :param filter_functions: some filter functions\n        :return: a filter object (filtered result)\n        \"\"\"\n        if filter_functions is not None:\n            for filter_func in filter_functions:\n                result = filter(filter_func, result)\n        return result", "entry_point": "_filter_result", "input": "'', ()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/veripress/veripress/blob/9e3df3a10eb1db32da596bf52118fe6acbe4b14a/veripress/model/storages.py#L160-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036953", "code": "def _consolidate_elemental_array_(elemental_array):\n    \"\"\"\n    Accounts for non-empirical chemical formulas by taking in the compositional array generated by _create_compositional_array_() and returning a consolidated array of dictionaries with no repeating elements\n\n    :param elemental_array: an elemental array generated from _create_compositional_array_()\n    :return: an array of element dictionaries\n    \"\"\"\n    condensed_array = []\n    for e in elemental_array:\n        exists = False\n        for k in condensed_array:\n            if k[\"symbol\"] == e[\"symbol\"]:\n                exists = True\n                k[\"occurances\"] += e[\"occurances\"]\n                break\n        if not exists:\n            condensed_array.append(e)\n    return condensed_array", "entry_point": "_consolidate_elemental_array_", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/CitrineInformatics/pypif-sdk/blob/8b01d10d9a1426d5eef12e4b2f31c4657aa0fe59/pypif_sdk/func/calculate_funcs.py#L197-L214", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036954", "code": "def format_info(info_list):\n    \"\"\"Turn a 2-dimension list of bytes into a 1-dimension list of bytes with\n    correct spacing\"\"\"\n\n    max_lengths = []\n    if info_list:\n        nr_columns = len(info_list[0])\n    else:\n        nr_columns = 0\n    for i in range(nr_columns):\n        max_lengths.append(max([len(info[i]) for info in info_list]))\n\n    flattened_info_list = []\n    for info_id in range(len(info_list)):\n        info = info_list[info_id]\n        for str_id in range(len(info) - 1):\n            # Don't justify the last column (i.e. the last printed line)\n            # as it can get much longer in some shells than in others\n            orig_str = info[str_id]\n            indent = max_lengths[str_id] - len(orig_str)\n            info[str_id] = orig_str + indent * b' '\n        flattened_info_list.append(b' '.join(info) + b'\\n')\n\n    return flattened_info_list", "entry_point": "format_info", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/innogames/polysh/blob/fbea36f3bc9f47a62d72040c48dad1776124dae3/polysh/dispatchers.py#L87-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036955", "code": "def human_size(size_bytes, precision=0):\n    \"\"\"\n    Format a size in bytes into a 'human' file size, e.g. bytes, KB, MB, GB, TB, PB\n    Note that bytes/KB will be reported in whole numbers but MB and above will have greater precision\n    e.g. 1 byte, 43 bytes, 443 KB, 4.3 MB, 4.43 GB, etc\n    \"\"\"\n    if size_bytes == 1:\n        # because I really hate unnecessary plurals\n        return \"1 byte\"\n\n    suffixes_table = [('bytes',0),('KB',0),('MB',1),('GB',2),('TB',2), ('PB',2)]\n\n    num = float(size_bytes)\n    for suffix, precision in suffixes_table:\n        if num < 1024.0:\n            break\n        num /= 1024.0\n\n    if precision == 0:\n        formatted_size = \"%d\" % num\n    else:\n        formatted_size = str(round(num, ndigits=precision))\n\n    return \"%s %s\" % (formatted_size, suffix)", "entry_point": "human_size", "input": "10, [1, 2, 3]", "output": "'10 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/aetros/aetros-cli/blob/a2a1f38d6af1660e1e2680c7d413ec2aef45faab/aetros/utils/__init__.py#L877-L900", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036956", "code": "def schema_id(origin_did: str, name: str, version: str) -> str:\n    \"\"\"\n    Return schema identifier for input origin DID, schema name, and schema version.\n\n    :param origin_did: DID of schema originator\n    :param name: schema name\n    :param version: schema version\n    :return: schema identifier\n    \"\"\"\n\n    return '{}:2:{}:{}'.format(origin_did, name, version)", "entry_point": "schema_id", "input": "['apple', 'banana', 'cherry'], 'Hello World', [[1, 2], [3], []]", "output": "\"['apple', 'banana', 'cherry']:2:Hello World:[[1, 2], [3], []]\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSPC-SPAC-buyandsell/von_anchor/blob/78ac1de67be42a676274f4bf71fe12f66e72f309/von_anchor/util.py#L34-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036957", "code": "def ok_tags(tags: dict) -> bool:\n        \"\"\"\n        Whether input tags dict is OK as an indy-sdk tags structure (depth=1, string values).\n        \"\"\"\n\n        if not tags:\n            return True\n        depth = 0\n        queue = [(i, depth+1) for i in tags.values() if isinstance(i, dict)]\n        max_depth = 0\n        while queue and max_depth < 2:\n            sub, depth = queue.pop()\n            max_depth = max(max_depth, depth)\n            queue = queue + [(i, depth+1) for i in sub.values() if isinstance(i, dict)]\n\n        return max_depth < 2 and all(isinstance(k, str) and isinstance(tags[k], str) for k in tags)", "entry_point": "ok_tags", "input": "{}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PSPC-SPAC-buyandsell/von_anchor/blob/78ac1de67be42a676274f4bf71fe12f66e72f309/von_anchor/wallet/record.py#L57-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036958", "code": "def _split_into_mimetype_and_priority(x):\n    \"\"\"Split an accept header item into mimetype and priority.\n\n    >>> _split_into_mimetype_and_priority('text/*')\n    ('text/*', 1.0)\n\n    >>> _split_into_mimetype_and_priority('application/json;q=0.5')\n    ('application/json', 0.5)\n    \"\"\"\n    if ';' in x:\n        content_type, priority = x.split(';')\n        casted_priority = float(priority.split('=')[1])\n    else:\n        content_type, casted_priority = x, 1.0\n\n    content_type = content_type.lstrip().rstrip()  # Replace ' text/html' to 'text/html'\n    return content_type, casted_priority", "entry_point": "_split_into_mimetype_and_priority", "input": "'abc'", "output": "('abc', 1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/kobinpy/kobin/blob/e6caff5af05db8a6e511d3de275d262466ab36a6/kobin/requests.py#L161-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036959", "code": "def remap_args(input_args, remap):\n    \"\"\" Generate a new argument list by remapping keys. The 'remap'\n    dict maps from destination key -> priority list of source keys\n    \"\"\"\n    out_args = input_args\n    for dest_key, src_keys in remap.items():\n        remap_value = None\n        if isinstance(src_keys, str):\n            src_keys = [src_keys]\n\n        for key in src_keys:\n            if key in input_args:\n                remap_value = input_args[key]\n                break\n\n        if remap_value is not None:\n            if out_args is input_args:\n                out_args = {**input_args}\n            out_args[dest_key] = remap_value\n\n    return out_args", "entry_point": "remap_args", "input": "[], {'x': [1, 2], 'y': []}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PlaidWeb/Publ/blob/ce7893632ddc3cb70b4978a41ffd7dd06fa13565/publ/utils.py#L231-L251", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036960", "code": "def _adjust_crop_box(box, crop):\n        \"\"\" Given a fit box and a crop box, adjust one to the other \"\"\"\n\n        if crop and box:\n            # Both boxes are the same size; just line them up.\n            return (box[0] + crop[0], box[1] + crop[1],\n                    box[2] + crop[0], box[3] + crop[1])\n\n        if crop:\n            # We don't have a fit box, so just convert the crop box\n            return (crop[0], crop[1], crop[0] + crop[2], crop[1] + crop[3])\n\n        # We don't have a crop box, so return the fit box (even if it's None)\n        return box", "entry_point": "_adjust_crop_box", "input": "[[1, 2], [3], []], []", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PlaidWeb/Publ/blob/ce7893632ddc3cb70b4978a41ffd7dd06fa13565/publ/image/local.py#L180-L193", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036961", "code": "def _parse_tuple_string(argument):\n        \"\"\" Return a tuple from parsing 'a,b,c,d' -> (a,b,c,d) \"\"\"\n        if isinstance(argument, str):\n            return tuple(int(p.strip()) for p in argument.split(','))\n        return argument", "entry_point": "_parse_tuple_string", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PlaidWeb/Publ/blob/ce7893632ddc3cb70b4978a41ffd7dd06fa13565/publ/image/local.py#L196-L200", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036962", "code": "def parse_view_spec(args):\n    \"\"\" Parse a view specification from a request arg list \"\"\"\n\n    view_spec = {}\n\n    if 'date' in args:\n        view_spec['date'] = args['date']\n    elif 'id' in args:\n        view_spec['start'] = args['id']\n\n    if 'tag' in args:\n        view_spec['tag'] = args.getlist('tag')\n        if len(view_spec['tag']) == 1:\n            view_spec['tag'] = args['tag']\n\n    return view_spec", "entry_point": "parse_view_spec", "input": "[-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PlaidWeb/Publ/blob/ce7893632ddc3cb70b4978a41ffd7dd06fa13565/publ/view.py#L414-L429", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036963", "code": "def remove_directories(list_of_paths):\n    \"\"\"\n    Removes non-leafs from a list of directory paths\n    \"\"\"\n    found_dirs = set('/')\n    for path in list_of_paths:\n        dirs = path.strip().split('/')\n        for i in range(2,len(dirs)):\n            found_dirs.add( '/'.join(dirs[:i]) )\n\n    paths = [ path for path in list_of_paths if\n              (path.strip() not in found_dirs) and path.strip()[-1]!='/' ]\n    return paths", "entry_point": "remove_directories", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Autodesk/pyccc/blob/011698e78d49a83ac332e0578a4a2a865b75ef8d/pyccc/utils.py#L137-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036964", "code": "def notification_preference(obj_type, profile):\n    '''Display two radio buttons for turning notifications on or off.\n    The default value is is have alerts_on = True.\n    '''\n    default_alert_value = True\n    if not profile:\n        alerts_on = True\n    else:\n        notifications = profile.get('notifications', {})\n        alerts_on = notifications.get(obj_type, default_alert_value)\n    return dict(alerts_on=alerts_on, obj_type=obj_type)", "entry_point": "notification_preference", "input": "[1, 2, 3], []", "output": "{'alerts_on': True, 'obj_type': [1, 2, 3]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstates/billy/blob/5fc795347f12a949e410a8cfad0c911ea6bced67/billy/web/public/templatetags/customtags.py#L120-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036965", "code": "def normalize_rank(rank):\n    \"\"\"Normalize a rank in order to be schema-compliant.\"\"\"\n    normalized_ranks = {\n        'BA': 'UNDERGRADUATE',\n        'BACHELOR': 'UNDERGRADUATE',\n        'BS': 'UNDERGRADUATE',\n        'BSC': 'UNDERGRADUATE',\n        'JUNIOR': 'JUNIOR',\n        'MAS': 'MASTER',\n        'MASTER': 'MASTER',\n        'MS': 'MASTER',\n        'MSC': 'MASTER',\n        'PD': 'POSTDOC',\n        'PHD': 'PHD',\n        'POSTDOC': 'POSTDOC',\n        'SENIOR': 'SENIOR',\n        'STAFF': 'STAFF',\n        'STUDENT': 'PHD',\n        'UG': 'UNDERGRADUATE',\n        'UNDERGRADUATE': 'UNDERGRADUATE',\n        'VISITING SCIENTIST': 'VISITOR',\n        'VISITOR': 'VISITOR',\n    }\n    if not rank:\n        return None\n    rank = rank.upper().replace('.', '')\n    return normalized_ranks.get(rank, 'OTHER')", "entry_point": "normalize_rank", "input": "'walnut thistle harbour'", "output": "'OTHER'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/inspire-dojson/blob/17f3789cd3d5ae58efa1190dc0eea9efb9c8ca59/inspire_dojson/utils/__init__.py#L50-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036966", "code": "def _UTMLetterDesignator(Lat):\n        \"\"\"\n        This routine determines the correct UTM letter designator for the given latitude\n        returns 'Z' if latitude is outside the UTM limits of 84N to 80S\n        Written by Chuck Gantz- chuck.gantz@globalstar.com\n        \"\"\"\n\n        if   84 >= Lat >= 72: return 'X'\n        elif 72 >  Lat >= 64: return 'W'\n        elif 64 >  Lat >= 56: return 'V'\n        elif 56 >  Lat >= 48: return 'U'\n        elif 48 >  Lat >= 40: return 'T'\n        elif 40 >  Lat >= 32: return 'S'\n        elif 32 >  Lat >= 24: return 'R'\n        elif 24 >  Lat >= 16: return 'Q'\n        elif 16 >  Lat >= 8:  return 'P'\n        elif  8 >  Lat >= 0:  return 'N'\n        elif  0 >  Lat >=-8:  return 'M'\n        elif -8 >  Lat >=-16: return 'L'\n        elif -16 > Lat >=-24: return 'K'\n        elif -24 > Lat >=-32: return 'J'\n        elif -32 > Lat >=-40: return 'H'\n        elif -40 > Lat >=-48: return 'G'\n        elif -48 > Lat >=-56: return 'F'\n        elif -56 > Lat >=-64: return 'E'\n        elif -64 > Lat >=-72: return 'D'\n        elif -72 > Lat >=-80: return 'C'\n        else:                 return 'Z'", "entry_point": "_UTMLetterDesignator", "input": "10", "output": "'P'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/data_files/LearningPython/UTM.py#L123-L150", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036967", "code": "def check_for_reqd_cols(data, reqd_cols):\n    \"\"\"\n    Check data (PmagPy list of dicts) for required columns\n    \"\"\"\n    missing = []\n    for col in reqd_cols:\n        if col not in data[0]:\n            missing.append(col)\n    return missing", "entry_point": "check_for_reqd_cols", "input": "[1, 2, 3], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/make_magic_plots.py#L26-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036968", "code": "def extract_col_name(string):\n    \"\"\"\n    Take a string and split it.\n    String will be a format like \"presence_pass_azimuth\",\n    where \"azimuth\" is the MagIC column name and \"presence_pass\"\n    is the validation.\n    Return \"presence\", \"azimuth\".\n    \"\"\"\n    prefixes = [\"presence_pass_\", \"value_pass_\", \"type_pass_\"]\n    end = string.rfind(\"_\")\n    for prefix in prefixes:\n        if string.startswith(prefix):\n            return prefix[:-6], string[len(prefix):end]\n    return string, string", "entry_point": "extract_col_name", "input": "'walnut thistle harbour'", "output": "('walnut thistle harbour', 'walnut thistle harbour')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/validate_upload3.py#L602-L615", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036969", "code": "def get_dictkey(In, k, dtype):\n    \"\"\"\n        returns list of given key (k)  from input list of dictionaries (In) in data type dtype.  uses command:\n        get_dictkey(In,k,dtype).  If dtype ==\"\", data are strings; if \"int\", data are integers; if \"f\", data are floats.\n    \"\"\"\n\n    Out = []\n    for d in In:\n        if dtype == '':\n            Out.append(d[k])\n        if dtype == 'f':\n            if d[k] == \"\":\n                Out.append(0)\n            elif d[k] == None:\n                Out.append(0)\n            else:\n                Out.append(float(d[k]))\n        if dtype == 'int':\n            if d[k] == \"\":\n                Out.append(0)\n            elif d[k] == None:\n                Out.append(0)\n            else:\n                Out.append(int(d[k]))\n    return Out", "entry_point": "get_dictkey", "input": "[5, 3, 1, 4], [], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L130-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036970", "code": "def get_specs(data):\n    \"\"\"\n    Takes a magic format file and returns a list of unique specimen names\n    \"\"\"\n    # sort the specimen names\n    speclist = []\n    for rec in data:\n        try:\n            spec = rec[\"er_specimen_name\"]\n        except KeyError as e:\n            spec = rec[\"specimen\"]\n        if spec not in speclist:\n            speclist.append(spec)\n    speclist.sort()\n    return speclist", "entry_point": "get_specs", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L1496-L1510", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036971", "code": "def sort_magic_data(magic_data, sort_name):\n    '''\n    Sort magic_data by header (like er_specimen_name for example)\n    '''\n    magic_data_sorted = {}\n    for rec in magic_data:\n        name = rec[sort_name]\n        if name not in list(magic_data_sorted.keys()):\n            magic_data_sorted[name] = []\n        magic_data_sorted[name].append(rec)\n    return magic_data_sorted", "entry_point": "sort_magic_data", "input": "[], 'abc'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L1917-L1927", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036972", "code": "def find_samp_rec(s, data, az_type):\n    \"\"\"\n    find the orientation info for samp s\n    \"\"\"\n    datablock, or_error, bed_error = [], 0, 0\n    orient = {}\n    orient[\"sample_dip\"] = \"\"\n    orient[\"sample_azimuth\"] = \"\"\n    orient['sample_description'] = \"\"\n    for rec in data:\n        if rec[\"er_sample_name\"].lower() == s.lower():\n            if 'sample_orientation_flag' in list(rec.keys()) and rec['sample_orientation_flag'] == 'b':\n                orient['sample_orientation_flag'] = 'b'\n                return orient\n            if \"magic_method_codes\" in list(rec.keys()) and az_type != \"0\":\n                methods = rec[\"magic_method_codes\"].replace(\" \", \"\").split(\":\")\n                if az_type in methods and \"sample_azimuth\" in list(rec.keys()) and rec[\"sample_azimuth\"] != \"\":\n                    orient[\"sample_azimuth\"] = float(rec[\"sample_azimuth\"])\n                if \"sample_dip\" in list(rec.keys()) and rec[\"sample_dip\"] != \"\":\n                    orient[\"sample_dip\"] = float(rec[\"sample_dip\"])\n                if \"sample_bed_dip_direction\" in list(rec.keys()) and rec[\"sample_bed_dip_direction\"] != \"\":\n                    orient[\"sample_bed_dip_direction\"] = float(\n                        rec[\"sample_bed_dip_direction\"])\n                if \"sample_bed_dip\" in list(rec.keys()) and rec[\"sample_bed_dip\"] != \"\":\n                    orient[\"sample_bed_dip\"] = float(rec[\"sample_bed_dip\"])\n            else:\n                if \"sample_azimuth\" in list(rec.keys()):\n                    orient[\"sample_azimuth\"] = float(rec[\"sample_azimuth\"])\n                if \"sample_dip\" in list(rec.keys()):\n                    orient[\"sample_dip\"] = float(rec[\"sample_dip\"])\n                if \"sample_bed_dip_direction\" in list(rec.keys()):\n                    orient[\"sample_bed_dip_direction\"] = float(\n                        rec[\"sample_bed_dip_direction\"])\n                if \"sample_bed_dip\" in list(rec.keys()):\n                    orient[\"sample_bed_dip\"] = float(rec[\"sample_bed_dip\"])\n                if 'sample_description' in list(rec.keys()):\n                    orient['sample_description'] = rec['sample_description']\n        if orient[\"sample_azimuth\"] != \"\":\n            break\n    return orient", "entry_point": "find_samp_rec", "input": "[1, 2, 3], [], ['a', 'b', 'c']", "output": "{'sample_dip': '', 'sample_azimuth': '', 'sample_description': ''}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L2330-L2369", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036973", "code": "def Tmatrix(X):\n    \"\"\"\n    gets the orientation matrix (T) from data in X\n    \"\"\"\n    T = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]\n    for row in X:\n        for k in range(3):\n            for l in range(3):\n                T[k][l] += row[k] * row[l]\n    return T", "entry_point": "Tmatrix", "input": "[]", "output": "[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L2530-L2539", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036974", "code": "def findrec(s, data):\n    \"\"\"\n    finds all the records belonging to s in data\n    \"\"\"\n    datablock = []\n    for rec in data:\n        if s == rec[0]:\n            datablock.append([rec[1], rec[2], rec[3], rec[4]])\n    return datablock", "entry_point": "findrec", "input": "2.0, ('a', 'b', 'c')", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L2593-L2601", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036975", "code": "def fillkeys(Recs):\n    \"\"\"\n    reconciles keys of dictionaries within Recs.\n    \"\"\"\n    keylist, OutRecs = [], []\n    for rec in Recs:\n        for key in list(rec.keys()):\n            if key not in keylist:\n                keylist.append(key)\n    for rec in Recs:\n        for key in keylist:\n            if key not in list(rec.keys()):\n                rec[key] = \"\"\n        OutRecs.append(rec)\n    return OutRecs, keylist", "entry_point": "fillkeys", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L3977-L3991", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036976", "code": "def doflip(dec, inc):\n    \"\"\"\n    flips lower hemisphere data to upper hemisphere\n    \"\"\"\n    if inc < 0:\n        inc = -inc\n        dec = (dec + 180.) % 360.\n    return dec, inc", "entry_point": "doflip", "input": "1, False", "output": "(1, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L4704-L4711", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036977", "code": "def getmeths(method_type):\n    \"\"\"\n    returns MagIC  method codes available for a given type\n    \"\"\"\n    meths = []\n    if method_type == 'GM':\n        meths.append('GM-PMAG-APWP')\n        meths.append('GM-ARAR')\n        meths.append('GM-ARAR-AP')\n        meths.append('GM-ARAR-II')\n        meths.append('GM-ARAR-NI')\n        meths.append('GM-ARAR-TF')\n        meths.append('GM-CC-ARCH')\n        meths.append('GM-CC-ARCHMAG')\n        meths.append('GM-C14')\n        meths.append('GM-FOSSIL')\n        meths.append('GM-FT')\n        meths.append('GM-INT-L')\n        meths.append('GM-INT-S')\n        meths.append('GM-ISO')\n        meths.append('GM-KAR')\n        meths.append('GM-PMAG-ANOM')\n        meths.append('GM-PMAG-POL')\n        meths.append('GM-PBPB')\n        meths.append('GM-RATH')\n        meths.append('GM-RBSR')\n        meths.append('GM-RBSR-I')\n        meths.append('GM-RBSR-MA')\n        meths.append('GM-SMND')\n        meths.append('GM-SMND-I')\n        meths.append('GM-SMND-MA')\n        meths.append('GM-CC-STRAT')\n        meths.append('GM-LUM-TH')\n        meths.append('GM-UPA')\n        meths.append('GM-UPB')\n        meths.append('GM-UTH')\n        meths.append('GM-UTHHE')\n    else:\n        pass\n    return meths", "entry_point": "getmeths", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L5400-L5439", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036978", "code": "def cross(v, w):\n    \"\"\"\n     cross product of two vectors\n    \"\"\"\n    x = v[1] * w[2] - v[2] * w[1]\n    y = v[2] * w[0] - v[0] * w[2]\n    z = v[0] * w[1] - v[1] * w[0]\n    return [x, y, z]", "entry_point": "cross", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "[2, -4, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L6702-L6709", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036979", "code": "def unpack(gh):\n    \"\"\"\n    unpacks gh list into l m g h type list\n\n    Parameters\n    _________\n    gh : list of gauss coefficients (as returned by, e.g., doigrf)\n\n    Returns\n   data : nested list of [[l,m,g,h],...]\n\n    \"\"\"\n    data = []\n    k, l = 0, 1\n    while k + 1 < len(gh):\n        for m in range(l + 1):\n            if m == 0:\n                data.append([l, m, gh[k], 0])\n                k += 1\n            else:\n                data.append([l, m, gh[k], gh[k + 1]])\n                k += 2\n        l += 1\n    return data", "entry_point": "unpack", "input": "[-1, 0, 1, 2]", "output": "[[1, 0, -1, 0], [1, 1, 0, 1]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L7577-L7600", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036980", "code": "def add_flag(var, flag):\n    \"\"\"\n    for use when calling command-line scripts from withing a program.\n    if a variable is present, add its proper command_line flag.\n    return a string.\n    \"\"\"\n    if var:\n        var = flag + \" \" + str(var)\n    else:\n        var = \"\"\n    return var", "entry_point": "add_flag", "input": "set(), {'x': [1, 2], 'y': []}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmag.py#L10407-L10417", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036981", "code": "def method_codes_to_geomagia(magic_method_codes,geomagia_table):\n    \"\"\"\n    Looks at the MagIC method code list and returns the correct GEOMAGIA code number depending \n    on the method code list and the GEOMAGIA table specified. Returns O, GEOMAGIA's \"Not specified\" value, if no match.\n\n    When mutiple codes are matched they are separated with -\n\n    \"\"\"\n    codes=magic_method_codes\n    geomagia=geomagia_table.lower()\n    geomagia_code='0'\n   \n    if geomagia=='alteration_monit_corr':\n        if  \"DA-ALT-V\" or \"LP-PI-ALT-PTRM\" or \"LP-PI-ALT-PMRM\" in codes:\n            geomagia_code='1' \n        elif \"LP-PI-ALT-SUSC\" in codes:\n            geomagia_code='2' \n        elif \"DA-ALT-RS\" or \"LP-PI-ALT-AFARM\" in codes:\n            geomagia_code='3' \n        elif \"LP-PI-ALT-WALTON\" in codes:\n            geomagia_code='4' \n        elif \"LP-PI-ALT-TANGUY\" in codes:\n            geomagia_code='5' \n        elif \"DA-ALT\" in codes:\n            geomagia_code='6'   #at end to fill generic if others don't exist\n        elif \"LP-PI-ALT-FABIAN\" in codes:\n            geomagia_code='7' \n\n    if geomagia=='md_checks':\n        if (\"LT-PTRM-MD\" in codes) or (\"LT-PMRM-MD\" in codes):\n            geomagia_code='1:' \n        if (\"LP-PI-BT-LT\" in codes) or (\"LT-LT-Z\" in codes):\n            if \"0\" in geomagia_code: \n                geomagia_code=\"23:\"\n            else:\n                geomagia_code+='2:' \n        geomagia_code=geomagia_code[:-1] \n\n    if geomagia=='anisotropy_correction':\n        if  \"DA-AC-AMS\" in codes:\n            geomagia_code='1' \n        elif \"DA-AC-AARM\" in codes:\n            geomagia_code='2' \n        elif \"DA-AC-ATRM\" in codes:\n            geomagia_code='3' \n        elif \"LT-NRM-PAR\" in codes:\n            geomagia_code='4' \n        elif \"DA-AC-AIRM\" in codes:\n            geomagia_code='6' \n        elif \"DA-AC\" in codes:  #at end to fill generic if others don't exist\n            geomagia_code='5' \n\n    if geomagia=='cooling_rate':\n        if  \"DA-CR\" in codes:  #all current CR codes but CR-EG are a 1 but may change in the future \n            geomagia_code='1' \n        if \"DA-CR-EG\" in codes:\n            geomagia_code='2' \n\n    if geomagia=='dm_methods':\n        if  \"LP-DIR-AF\" in codes:\n            geomagia_code='1' \n        elif \"LT-AF-D\" in codes:\n            geomagia_code='1' \n        elif \"LT-AF-G\" in codes:\n            geomagia_code='1' \n        elif \"LT-AF-Z\" in codes:\n            geomagia_code='1' \n        elif \"LP-DIR-T\" in codes:\n            geomagia_code='2' \n        elif \"LT-AF-Z\" in codes:\n            geomagia_code='2' \n        elif \"LP-DIR-M\" in codes:\n            geomagia_code='5' \n        elif \"LT-M-Z\" in codes:\n            geomagia_code='5' \n\n    if geomagia=='dm_analysis':\n        if  \"DE-BFL\" in codes:\n            geomagia_code='1' \n        elif \"DE-BLANKET\" in codes:\n            geomagia_code='2' \n        elif \"DE-FM\" in codes:\n            geomagia_code='3' \n        elif \"DE-NRM\" in codes:\n            geomagia_code='6' \n\n    if geomagia=='specimen_type_id':\n        if  \"SC-TYPE-CYC\" in codes:\n            geomagia_code='1' \n        elif  \"SC-TYPE-CUBE\" in codes:\n            geomagia_code='2' \n        elif  \"SC-TYPE-MINI\" in codes:\n            geomagia_code='3' \n        elif  \"SC-TYPE-SC\" in codes:\n            geomagia_code='4' \n        elif  \"SC-TYPE-UC\" in codes:\n            geomagia_code='5' \n        elif  \"SC-TYPE-LARGE\" in codes:\n            geomagia_code='6' \n\n    return geomagia_code", "entry_point": "method_codes_to_geomagia", "input": "set(), 'a,b,c'", "output": "'0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts/magic_geomagia.py#L310-L410", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036982", "code": "def split_lines(lines):\n    \"\"\"\n    split a MagIC upload format file into lists.\n    the lists are split by the '>>>' lines between file_types.\n    \"\"\"\n    container = []\n    new_list = []\n    for line in lines:\n        if '>>>' in line:\n            container.append(new_list)\n            new_list = []\n        else:\n            new_list.append(line)\n    container.append(new_list)\n    return container", "entry_point": "split_lines", "input": "'  padded  '", "output": "[[' ', ' ', 'p', 'a', 'd', 'd', 'e', 'd', ' ', ' ']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/validate_upload2.py#L250-L264", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036983", "code": "def do_flip(dec=None, inc=None, di_block=None):\n    \"\"\"\n    This function returns the antipode (i.e. it flips) of directions.\n\n    The function can take dec and inc as seperate lists if they are of equal\n    length and explicitly specified or are the first two arguments. It will then\n    return a list of flipped decs and a list of flipped incs. If a di_block (a\n    nested list of [dec, inc, 1.0]) is specified then it is used and the function\n    returns a di_block with the flipped directions.\n\n    Parameters\n    ----------\n    dec: list of declinations\n    inc: list of inclinations\n\n    or\n\n    di_block: a nested list of [dec, inc, 1.0]\n\n    A di_block can be provided instead of dec, inc lists in which case it will\n    be used. Either dec, inc lists or a di_block need to passed to the function.\n\n    Returns\n    ----------\n    dec_flip, inc_flip : list of flipped declinations and inclinations\n    or\n    dflip : a nested list of [dec, inc, 1.0]\n\n    Examples\n    ----------\n    Lists of declination and inclination can be flipped to their antipodes:\n\n    >>> decs = [1.0, 358.0, 2.0]\n    >>> incs = [10.0, 12.0, 8.0]\n    >>> ipmag.do_flip(decs, incs)\n    ([181.0, 178.0, 182.0], [-10.0, -12.0, -8.0])\n\n    The function can also take a di_block and returns a flipped di_block:\n\n    >>> directions = [[1.0,10.0],[358.0,12.0,],[2.0,8.0]]\n    >>> ipmag.do_flip(di_block=directions)\n    [[181.0, -10.0, 1.0], [178.0, -12.0, 1.0], [182.0, -8.0, 1.0]]\n    \"\"\"\n    if di_block is None:\n        dec_flip = []\n        inc_flip = []\n        for n in range(0, len(dec)):\n            dec_flip.append((dec[n] - 180.) % 360.0)\n            inc_flip.append(-inc[n])\n        return dec_flip, inc_flip\n    else:\n        dflip = []\n        for rec in di_block:\n            d, i = (rec[0] - 180.) % 360., -rec[1]\n            dflip.append([d, i, 1.0])\n        return dflip", "entry_point": "do_flip", "input": "5, 'AbC dEf', {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L565-L620", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036984", "code": "def make_di_block(dec, inc):\n    \"\"\"\n    Some pmag.py and ipmag.py functions require or will take a list of unit\n    vectors [dec,inc,1.] as input. This function takes declination and\n    inclination data and make it into such a nest list of lists.\n\n    Parameters\n    -----------\n    dec : list of declinations\n    inc : list of inclinations\n\n    Returns\n    -----------\n    di_block : nested list of declination, inclination lists\n\n    Example\n    -----------\n    >>> decs = [180.3, 179.2, 177.2]\n    >>> incs = [12.1, 13.7, 11.9]\n    >>> ipmag.make_di_block(decs,incs)\n    [[180.3, 12.1, 1.0], [179.2, 13.7, 1.0], [177.2, 11.9, 1.0]]\n    \"\"\"\n    di_block = []\n    for n in range(0, len(dec)):\n        di_block.append([dec[n], inc[n], 1.0])\n    return di_block", "entry_point": "make_di_block", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "[['a', 'apple', 1.0], ['b', 'banana', 1.0], ['c', 'cherry', 1.0]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L2359-L2384", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036985", "code": "def unpack_di_block(di_block):\n    \"\"\"\n    This function unpacks a nested list of [dec,inc,mag_moment] into a list of\n    declination values, a list of inclination values and a list of magnetic\n    moment values. Mag_moment values are optional, while dec and inc values are\n    required.\n\n    Parameters\n    -----------\n    di_block : nested list of declination, inclination lists\n\n    Returns\n    -----------\n    dec : list of declinations\n    inc : list of inclinations\n    mag_moment : list of magnetic moment (if present in di_block)\n\n    Example\n    -----------\n    The di_block nested lists of lists can be unpacked using the function\n\n    >>> directions = [[180.3, 12.1, 1.0], [179.2, 13.7, 1.0], [177.2, 11.9, 1.0]]\n    >>> ipmag.unpack_di_block(directions)\n    ([180.3, 179.2, 177.2], [12.1, 13.7, 11.9], [1.0, 1.0, 1.0])\n\n    These unpacked values can be assigned to variables:\n\n    >>> dec, inc, moment = ipmag.unpack_di_block(directions)\n    \"\"\"\n    dec_list = []\n    inc_list = []\n    moment_list = []\n\n    for n in range(0, len(di_block)):\n        dec = di_block[n][0]\n        inc = di_block[n][1]\n        dec_list.append(dec)\n        inc_list.append(inc)\n        if len(di_block[n]) > 2:\n            moment = di_block[n][2]\n            moment_list.append(moment)\n\n    return dec_list, inc_list, moment_list", "entry_point": "unpack_di_block", "input": "['apple', 'banana', 'cherry']", "output": "(['a', 'b', 'c'], ['p', 'a', 'h'], ['p', 'n', 'e'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L2387-L2429", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036986", "code": "def get_item_string(items_list):\n    \"\"\"\n    take in a list of pmag_objects\n    return a colon-delimited list of the findable names\n    \"\"\"\n    if not items_list:\n        return ''\n    string_list = []\n    for item in items_list:\n        try:\n            name = item.name\n            string_list.append(name)\n        except AttributeError:\n            pass\n    return \":\".join(string_list)", "entry_point": "get_item_string", "input": "[-1, 0, 1, 2]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1775-L1789", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036987", "code": "def combine_dicts(new_dict, old_dict):\n    \"\"\"\n    returns a dictionary with all key, value pairs from new_dict.\n    also returns key, value pairs from old_dict, if that key does not exist in new_dict.\n    if a key is present in both new_dict and old_dict, the new_dict value will take precedence.\n    \"\"\"\n    old_data_keys = list(old_dict.keys())\n    new_data_keys = list(new_dict.keys())\n    all_keys = set(old_data_keys).union(new_data_keys)\n    combined_data_dict = {}\n    for k in all_keys:\n        try:\n            combined_data_dict[k] = new_dict[k]\n        except KeyError:\n            combined_data_dict[k] = old_dict[k]\n    return combined_data_dict", "entry_point": "combine_dicts", "input": "{'x': [1, 2], 'y': []}, {}", "output": "{'y': [], 'x': [1, 2]}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1815-L1830", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036988", "code": "def get_xy_array(x_segment, y_segment):\n    \"\"\"\n    input: x_segment, y_segment\n    output: xy_segment, ( format: [(x[0], y[0]), (x[1], y[1])]\n    \"\"\"\n    xy_array = []\n    for num, x in enumerate(x_segment):\n        xy_array.append((x, y_segment[num]))\n    return xy_array", "entry_point": "get_xy_array", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "[('apple', 1), ('banana', 2), ('cherry', 3)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L309-L317", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036989", "code": "def extract_args(argv):\n    \"\"\"\n    take sys.argv that is used to call a command-line script and return a correctly split list of arguments\n    for example, this input: [\"eqarea.py\", \"-f\", \"infile\", \"-F\", \"outfile\", \"-A\"]\n    will return this output: [['f', 'infile'], ['F', 'outfile'], ['A']]\n    \"\"\"\n    string = \" \".join(argv)\n    string = string.split(' -')\n    program = string[0]\n    arguments = [s.split() for s in string[1:]]\n    return arguments", "entry_point": "extract_args", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/command_line_extractor.py#L38-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036990", "code": "def compare(a, b):\n    \"\"\"\n     Compare items in 2 arrays. Returns sum(abs(a(i)-b(i)))\n    \"\"\"\n    s=0\n    for i in range(len(a)):\n        s=s+abs(a[i]-b[i])\n    return s", "entry_point": "compare", "input": "[], [5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/nlt.py#L34-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036991", "code": "def js_classnameify(s):\n  \"\"\"\n  Makes a classname.\n  \"\"\"\n  if not '_' in s:\n    return s\n  return ''.join(w[0].upper() + w[1:].lower() for w in s.split('_'))", "entry_point": "js_classnameify", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/swift-nav/libsbp/blob/5a950608506b23e31b73ef7065da905b646055c1/generator/sbpg/targets/javascript.py#L156-L162", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036992", "code": "def to_data(s):\n  \"\"\"\n  Format a data variable name.\n  \"\"\"\n  if s.startswith('GPSTime'):\n    s = 'Gps' + s[3:]\n\n  if '_' in s:\n    return \"\".join([i.capitalize() for i in s.split(\"_\")])\n  return s", "entry_point": "to_data", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/swift-nav/libsbp/blob/5a950608506b23e31b73ef7065da905b646055c1/generator/sbpg/targets/haskell.py#L84-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036993", "code": "def get_last_pos_of_char(char, string):\n    '''\n    :param char: The character to find\n    :type char: string\n    :param string: The string in which to search for *char*\n    :type string: string\n    :returns: Index in *string* where *char* last appears (unescaped by a preceding \"\\\\\"), -1 if not found\n    :rtype: int\n\n    Finds the last occurrence of *char* in *string* in which *char* is\n    not present as an escaped character.\n\n    '''\n    pos = len(string)\n    while pos > 0:\n        pos = string[:pos].rfind(char)\n        if pos == -1:\n            return -1\n        num_backslashes = 0\n        test_index = pos - 1\n        while test_index >= 0 and string[test_index] == '\\\\':\n            num_backslashes += 1\n            test_index -= 1\n        if num_backslashes % 2 == 0:\n            return pos\n    return -1", "entry_point": "get_last_pos_of_char", "input": "set(), {}", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/resolver.py#L233-L258", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036994", "code": "def get_first_pos_of_char(char, string):\n    '''\n    :param char: The character to find\n    :type char: string\n    :param string: The string in which to search for *char*\n    :type string: string\n    :returns: Index in *string* where *char* last appears (unescaped by a preceding \"\\\\\"), -1 if not found\n    :rtype: int\n\n    Finds the first occurrence of *char* in *string* in which *char* is\n    not present as an escaped character.\n\n    '''\n    first_pos = -1\n    pos = len(string)\n    while pos > 0:\n        pos = string[:pos].rfind(char)\n        if pos == -1:\n            return first_pos\n        num_backslashes = 0\n        test_index = pos - 1\n        while test_index >= 0 and string[test_index] == '\\\\':\n            num_backslashes += 1\n            test_index -= 1\n        if num_backslashes % 2 == 0:\n            first_pos = pos\n    return first_pos", "entry_point": "get_first_pos_of_char", "input": "'abc', '  padded  '", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/resolver.py#L260-L286", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036995", "code": "def get_user_id(user_id_or_username):\n    \"\"\"Gets the user ID based on the value `user_id_or_username` specified on\n    the command-line, being extra lenient and lowercasing the value in all\n    cases.\n    \"\"\"\n    user_id_or_username = user_id_or_username.lower()\n    if not user_id_or_username.startswith(\"user-\"):\n        user_id = \"user-\" + user_id_or_username.lower()\n    else:\n        user_id = user_id_or_username\n    return user_id", "entry_point": "get_user_id", "input": "'abc'", "output": "'user-abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/cli/org.py#L32-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036996", "code": "def _construct_jbor(job_id, field_name_and_maybe_index):\n    '''\n    :param job_id: Job ID\n    :type job_id: string\n    :param field_name_and_maybe_index: Field name, plus possibly \".N\" where N is an array index\n    :type field_name_and_maybe_index: string\n    :returns: dict of JBOR\n    '''\n    link = {\"$dnanexus_link\": {\"job\": job_id}}\n    if '.' in field_name_and_maybe_index:\n        split_by_dot = field_name_and_maybe_index.rsplit('.', 1)\n        link[\"$dnanexus_link\"][\"field\"] = split_by_dot[0]\n        link[\"$dnanexus_link\"][\"index\"] = int(split_by_dot[1])\n    else:\n        link[\"$dnanexus_link\"][\"field\"] = field_name_and_maybe_index\n    return link", "entry_point": "_construct_jbor", "input": "[-1, 0, 1, 2], 'Hello World'", "output": "{'$dnanexus_link': {'job': [-1, 0, 1, 2], 'field': 'Hello World'}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/cli/exec_io.py#L78-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036997", "code": "def normalize_timedelta(timedelta):\n    \"\"\"\n    Given a string like \"1w\" or \"-5d\", convert it to an integer in milliseconds.\n    Integers without a suffix are interpreted as seconds.\n    Note: not related to the datetime timedelta class.\n    \"\"\"\n    try:\n        return int(timedelta) * 1000\n    except ValueError as e:\n        t, suffix = timedelta[:-1], timedelta[-1:]\n        suffix_multipliers = {'s': 1000, 'm': 1000*60, 'h': 1000*60*60, 'd': 1000*60*60*24, 'w': 1000*60*60*24*7,\n                              'M': 1000*60*60*24*30, 'y': 1000*60*60*24*365}\n        if suffix not in suffix_multipliers:\n            raise ValueError()\n        return int(t) * suffix_multipliers[suffix]", "entry_point": "normalize_timedelta", "input": "False", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L198-L212", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036998", "code": "def _dict_raise_on_duplicates(ordered_pairs):\n    \"\"\"\n    Reject duplicate keys.\n    \"\"\"\n    d = {}\n    for k, v in ordered_pairs:\n        if k in d:\n           raise ValueError(\"duplicate key: %r\" % (k,))\n        else:\n           d[k] = v\n    return d", "entry_point": "_dict_raise_on_duplicates", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/utils/__init__.py#L258-L268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0036999", "code": "def _get_destination_folder(json_spec, folder_name=None):\n    \"\"\"\n    Returns destination project in which the workflow should be created.\n    It can be set in the json specification or by --destination option supplied\n    with `dx build`.\n    The order of precedence is:\n    1. --destination, -d option,\n    2. 'folder' specified in the json file.\n    \"\"\"\n    dest_folder = folder_name or json_spec.get('folder') or '/'\n    if not dest_folder.endswith('/'):\n        dest_folder = dest_folder + '/'\n    return dest_folder", "entry_point": "_get_destination_folder", "input": "[[1, 2], [3], []], '  padded  '", "output": "'  padded  /'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/workflow_builder.py#L91-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037000", "code": "def _readable_part_size(num_bytes):\n    \"Returns the file size in readable form.\"\n    B = num_bytes\n    KB = float(1024)\n    MB = float(KB * 1024)\n    GB = float(MB * 1024)\n    TB = float(GB * 1024)\n\n    if B < KB:\n        return '{0} {1}'.format(B, 'bytes' if B != 1 else 'byte')\n    elif KB <= B < MB:\n        return '{0:.2f} KiB'.format(B/KB)\n    elif MB <= B < GB:\n        return '{0:.2f} MiB'.format(B/MB)\n    elif GB <= B < TB:\n        return '{0:.2f} GiB'.format(B/GB)\n    elif TB <= B:\n        return '{0:.2f} TiB'.format(B/TB)", "entry_point": "_readable_part_size", "input": "2", "output": "'2 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxfile.py#L62-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037001", "code": "def parse_bool(obj):\n  \"\"\"Return true if the object represents a truth value, false otherwise.\n\n  For bool and numeric objects, uses Python's built-in bool function.  For\n  str objects, checks string against a list of possible truth values.\n\n  Args:\n    obj: object to determine boolean value of; expected\n\n  Returns:\n    Boolean value according to 5.1 of Python docs if object is not a str\n      object.  For str objects, return True if str is in TRUTH_VALUE_SET\n      and False otherwise.\n    http://docs.python.org/library/stdtypes.html\n  \"\"\"\n  if type(obj) is str:\n    TRUTH_VALUE_SET = [\"true\", \"1\", \"yes\", \"t\", \"on\"]\n    return obj.lower() in TRUTH_VALUE_SET\n  else:\n    return bool(obj)", "entry_point": "parse_bool", "input": "[1, 2, 3]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/python/src/mapreduce/util.py#L333-L352", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037002", "code": "def strip_prefix_from_items(prefix, items):\n  \"\"\"Strips out the prefix from each of the items if it is present.\n\n  Args:\n    prefix: the string for that you wish to strip from the beginning of each\n      of the items.\n    items: a list of strings that may or may not contain the prefix you want\n      to strip out.\n\n  Returns:\n    items_no_prefix: a copy of the list of items (same order) without the\n      prefix (if present).\n  \"\"\"\n  items_no_prefix = []\n  for item in items:\n    if item.startswith(prefix):\n      items_no_prefix.append(item[len(prefix):])\n    else:\n      items_no_prefix.append(item)\n  return items_no_prefix", "entry_point": "strip_prefix_from_items", "input": "'', ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/python/src/mapreduce/util.py#L412-L431", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037003", "code": "def _find_first_of(line, substrings):\n    \"\"\"Find earliest occurrence of one of substrings in line.\n\n    Returns pair of index and found substring, or (-1, None)\n    if no occurrences of any of substrings were found in line.\n    \"\"\"\n    starts = ((line.find(i), i) for i in substrings)\n    found = [(i, sub) for i, sub in starts if i != -1]\n    if found:\n        return min(found)\n    else:\n        return -1, None", "entry_point": "_find_first_of", "input": "'walnut thistle harbour', 'AbC dEf'", "output": "(6, ' ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openstack/hacking/blob/10e58f907181cac91d3b2af422c2458b04a1ec79/hacking/checks/docstrings.py#L150-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037004", "code": "def write_lines(label, lines):\n    '''write a list of lines with a header for a section.\n    \n       Parameters\n       ==========\n       lines: one or more lines to write, with header appended\n\n    '''\n    result = []\n    continued = False\n    for line in lines:\n        if continued:\n            result.append(line)\n        else:\n            result.append('%s %s' %(label, line))\n        continued = False\n        if line.endswith('\\\\'):\n            continued = True\n            \n    return result", "entry_point": "write_lines", "input": "[[1, 2], [3], []], 'AbC dEf'", "output": "['[[1, 2], [3], []] A', '[[1, 2], [3], []] b', '[[1, 2], [3], []] C', '[[1, 2], [3], []]  ', '[[1, 2], [3], []] d', '[[1, 2], [3], []] E', '[[1, 2], [3], []] f']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/singularity-cli/blob/cb36b4504812ca87e29c6a40b222a545d1865799/spython/main/parse/converters.py#L44-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037005", "code": "def finish_section(section, name):\n    '''finish_section will add the header to a section, to finish the recipe\n       take a custom command or list and return a section.\n\n       Parameters\n       ==========\n       section: the section content, without a header\n       name: the name of the section for the header\n\n    '''   \n    if not isinstance(section, list):\n        section = [section]\n\n    header = ['%' + name ]\n    return header + section", "entry_point": "finish_section", "input": "[], 'a,b,c'", "output": "['%a,b,c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/singularity-cli/blob/cb36b4504812ca87e29c6a40b222a545d1865799/spython/main/parse/converters.py#L143-L157", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037006", "code": "def create_keyval_section(pairs, name):\n    '''create a section based on key, value recipe pairs, \n       This is used for files or label\n\n      Parameters\n      ==========\n      section: the list of values to return as a parsed list of lines\n      name: the name of the section to write (e.g., files)\n\n    '''\n    section = ['%' + name ]\n    for pair in pairs:\n        section.append(' '.join(pair).strip().strip('\\\\'))\n    return section", "entry_point": "create_keyval_section", "input": "['a', 'b', 'c'], ''", "output": "['%', 'a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/singularity-cli/blob/cb36b4504812ca87e29c6a40b222a545d1865799/spython/main/parse/converters.py#L160-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037007", "code": "def create_env_section(pairs, name):\n    '''environment key value pairs need to be joined by an equal, and \n       exported at the end.\n\n      Parameters\n      ==========\n      section: the list of values to return as a parsed list of lines\n      name: the name of the section to write (e.g., files)\n\n    '''\n    section = ['%' + name ]\n    for pair in pairs:\n        section.append(\"export %s\" %pair)\n    return section", "entry_point": "create_env_section", "input": "[], 'Hello World'", "output": "['%Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/singularity-cli/blob/cb36b4504812ca87e29c6a40b222a545d1865799/spython/main/parse/converters.py#L176-L189", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037008", "code": "def abbreviate_str(string, max_len=80, indicator=\"...\"):\n  \"\"\"\n  Abbreviate a string, adding an indicator like an ellipsis if required.\n  \"\"\"\n  if not string or not max_len or len(string) <= max_len:\n    return string\n  elif max_len <= len(indicator):\n    return string[0:max_len]\n  else:\n    return string[0:max_len - len(indicator)] + indicator", "entry_point": "abbreviate_str", "input": "'abc', [], [-1, 0, 1, 2]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/jlevy/strif/blob/5a066f7a075ca822da59d665cfe88f0afd39a793/strif.py#L85-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037009", "code": "def combine_bytes(bytearr):\n    \"\"\"Given some bytes, join them together to make one long binary\n\n    (e.g. 00001000 00000000   ->    0000100000000000)\n\n    :param bytearr:\n    :return:\n    \"\"\"\n    bytes_count = len(bytearr)\n    result = 0b0\n    for index, byt in enumerate(bytearr):\n        offset_bytes = bytes_count - index - 1\n        result += byt << (8 * offset_bytes)\n    return result", "entry_point": "combine_bytes", "input": "[1, 2, 3]", "output": "66051", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/mbed-cloud-sdk-python/blob/c0af86fb2cdd4dc7ed26f236139241067d293509/src/mbed_cloud/tlv/decode.py#L73-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037010", "code": "def force_ascii_values(data):\n    \"\"\"Ensures each value is ascii-only\"\"\"\n    return {\n        k: v.encode('utf8').decode('ascii', 'backslashreplace')\n        for k, v in data.items()\n    }", "entry_point": "force_ascii_values", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/mbed-cloud-sdk-python/blob/c0af86fb2cdd4dc7ed26f236139241067d293509/scripts/tpip.py#L214-L219", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037011", "code": "def _to_bstr(l):\n    \"\"\"Convert to byte string.\"\"\"\n\n    if isinstance(l, str):\n        l = l.encode('ascii', 'backslashreplace')\n    elif not isinstance(l, bytes):\n        l = str(l).encode('ascii', 'backslashreplace')\n    return l", "entry_point": "_to_bstr", "input": "['apple', 'banana', 'cherry']", "output": "b\"['apple', 'banana', 'cherry']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/facelessuser/backrefs/blob/3b3d60f5d57b02044f880aa29c9c5add0e31a34f/backrefs/util.py#L65-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037012", "code": "def pretty_print(n):\n    \"\"\"Pretty print function for very big integers\"\"\"\n    if type(n) != int:\n        return n\n\n    ret = []\n    n = str(n)\n    for i in range(len(n) - 1, -1, -1):\n        ret.append(n[i])\n        if (len(n) - i) % 3 == 0:\n            ret.append(',')\n    ret.reverse()\n    return ''.join(ret[1:]) if ret[0] == ',' else ''.join(ret)", "entry_point": "pretty_print", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/merenlab/illumina-utils/blob/246d0611f976471783b83d2aba309b0cb57210f6/IlluminaUtils/utils/terminal.py#L170-L182", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037013", "code": "def verify_id(ctx, param, app):\n    \"\"\"Verify the experiment id.\"\"\"\n    if app is None:\n        raise TypeError(\"Select an experiment using the --app parameter.\")\n    elif app[0:5] == \"dlgr-\":\n        raise ValueError(\n            \"The --app parameter requires the full \"\n            \"UUID beginning with {}-...\".format(app[5:13])\n        )\n    return app", "entry_point": "verify_id", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Dallinger/Dallinger/blob/76ca8217c709989c116d0ebd8fca37bd22f591af/dallinger/command_line.py#L135-L144", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037014", "code": "def build_command(chunks):\n    \"\"\"\n    Create a command from various parts.\n\n    The parts provided may include a base, flags, option-bound arguments, and\n    positional arguments. Each element must be either a string or a two-tuple.\n    Raw strings are interpreted as either the command base, a pre-joined\n    pair (or multiple pairs) of option and argument, a series of positional\n    arguments, or a combination of those elements. The only modification they\n    undergo is trimming of any space characters from each end.\n\n    :param Iterable[str | (str, str | NoneType)] chunks: the collection of the\n        command components to interpret, modify, and join to create a\n        single meaningful command\n    :return str: the single meaningful command built from the given components\n    :raise ValueError: if no command parts are provided\n    \"\"\"\n\n    if not chunks:\n        raise ValueError(\n            \"No command parts: {} ({})\".format(chunks, type(chunks)))\n\n    if isinstance(chunks, str):\n        return chunks\n\n    parsed_pieces = []\n\n    for cmd_part in chunks:\n        if cmd_part is None:\n            continue\n        try:\n            # Trim just space, not all whitespace.\n            # This prevents damage to an option that specifies,\n            # say, tab as a delimiter.\n            parsed_pieces.append(cmd_part.strip(\" \"))\n        except AttributeError:\n            option, argument = cmd_part\n            if argument is None or argument == \"\":\n                continue\n            option, argument = option.strip(\" \"), str(argument).strip(\" \")\n            parsed_pieces.append(\"{} {}\".format(option, argument))\n\n    return \" \".join(parsed_pieces)", "entry_point": "build_command", "input": "['a', 'b', 'c']", "output": "'a b c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/databio/pypiper/blob/00e6c2b94033c4187d47ff14c5580bbfc2ff097f/pypiper/utils.py#L57-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037015", "code": "def check_shell(cmd, shell=None):\n    \"\"\"\n    Determine whether a command appears to involve shell process(es).\n    The shell argument can be used to override the result of the check.\n\n    :param str cmd: Command to investigate.\n    :param bool shell: override the result of the check with this value.\n    :return bool: Whether the command appears to involve shell process(es).\n    \"\"\"\n    if isinstance(shell, bool):\n        return shell\n    return \"|\" in cmd or \">\" in cmd or r\"*\" in cmd", "entry_point": "check_shell", "input": "[], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/databio/pypiper/blob/00e6c2b94033c4187d47ff14c5580bbfc2ff097f/pypiper/utils.py#L196-L207", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037016", "code": "def _normalize_custom_param_name(name):\n    \"\"\"Replace curved quotes with straight quotes in a custom parameter name.\n    These should be the only keys with problematic (non-ascii) characters,\n    since they can be user-generated.\n    \"\"\"\n\n    replacements = ((\"\\u2018\", \"'\"), (\"\\u2019\", \"'\"), (\"\\u201C\", '\"'), (\"\\u201D\", '\"'))\n    for orig, replacement in replacements:\n        name = name.replace(orig, replacement)\n    return name", "entry_point": "_normalize_custom_param_name", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlefonts/glyphsLib/blob/9c12dc70c8d13f08d92b824e6710f6e3bb5037bb/Lib/glyphsLib/builder/custom_params.py#L757-L766", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037017", "code": "def _encode_dict_as_string(value):\n        \"\"\"Takes the PLIST string of a dict, and returns the same string\n        encoded such that it can be included in the string representation\n        of a GSNode.\"\"\"\n        # Strip the first and last newlines\n        if value.startswith(\"{\\n\"):\n            value = \"{\" + value[2:]\n        if value.endswith(\"\\n}\"):\n            value = value[:-2] + \"}\"\n        # escape double quotes and newlines\n        return value.replace('\"', '\\\\\"').replace(\"\\\\n\", \"\\\\\\\\n\").replace(\"\\n\", \"\\\\n\")", "entry_point": "_encode_dict_as_string", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlefonts/glyphsLib/blob/9c12dc70c8d13f08d92b824e6710f6e3bb5037bb/Lib/glyphsLib/classes.py#L1649-L1659", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037018", "code": "def _translate_category(glyph_name, unicode_category):\n    \"\"\"Return a translation from Unicode category letters to Glyphs\n    categories.\"\"\"\n    DEFAULT_CATEGORIES = {\n        None: (\"Letter\", None),\n        \"Cc\": (\"Separator\", None),\n        \"Cf\": (\"Separator\", \"Format\"),\n        \"Cn\": (\"Symbol\", None),\n        \"Co\": (\"Letter\", \"Compatibility\"),\n        \"Ll\": (\"Letter\", \"Lowercase\"),\n        \"Lm\": (\"Letter\", \"Modifier\"),\n        \"Lo\": (\"Letter\", None),\n        \"Lt\": (\"Letter\", \"Uppercase\"),\n        \"Lu\": (\"Letter\", \"Uppercase\"),\n        \"Mc\": (\"Mark\", \"Spacing Combining\"),\n        \"Me\": (\"Mark\", \"Enclosing\"),\n        \"Mn\": (\"Mark\", \"Nonspacing\"),\n        \"Nd\": (\"Number\", \"Decimal Digit\"),\n        \"Nl\": (\"Number\", None),\n        \"No\": (\"Number\", \"Decimal Digit\"),\n        \"Pc\": (\"Punctuation\", None),\n        \"Pd\": (\"Punctuation\", \"Dash\"),\n        \"Pe\": (\"Punctuation\", \"Parenthesis\"),\n        \"Pf\": (\"Punctuation\", \"Quote\"),\n        \"Pi\": (\"Punctuation\", \"Quote\"),\n        \"Po\": (\"Punctuation\", None),\n        \"Ps\": (\"Punctuation\", \"Parenthesis\"),\n        \"Sc\": (\"Symbol\", \"Currency\"),\n        \"Sk\": (\"Mark\", \"Spacing\"),\n        \"Sm\": (\"Symbol\", \"Math\"),\n        \"So\": (\"Symbol\", None),\n        \"Zl\": (\"Separator\", None),\n        \"Zp\": (\"Separator\", None),\n        \"Zs\": (\"Separator\", \"Space\"),\n    }\n\n    glyphs_category = DEFAULT_CATEGORIES.get(unicode_category, (\"Letter\", None))\n\n    # Exception: Something like \"one_two\" should be a (_, Ligature),\n    # \"acutecomb_brevecomb\" should however stay (Mark, Nonspacing).\n    if \"_\" in glyph_name and glyphs_category[0] != \"Mark\":\n        return glyphs_category[0], \"Ligature\"\n\n    return glyphs_category", "entry_point": "_translate_category", "input": "'abc', (1, 2)", "output": "('Letter', None)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlefonts/glyphsLib/blob/9c12dc70c8d13f08d92b824e6710f6e3bb5037bb/Lib/glyphsLib/glyphdata.py#L236-L279", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037019", "code": "def find_base_style(masters):\n    \"\"\"Find a base style shared between all masters.\n    Return empty string if none is found.\n    \"\"\"\n    if not masters:\n        return \"\"\n    base_style = (masters[0].name or \"\").split()\n    for master in masters:\n        style = master.name.split()\n        base_style = [s for s in style if s in base_style]\n    base_style = \" \".join(base_style)\n    return base_style", "entry_point": "find_base_style", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlefonts/glyphsLib/blob/9c12dc70c8d13f08d92b824e6710f6e3bb5037bb/Lib/glyphsLib/builder/axes.py#L545-L556", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037020", "code": "def interp(mapping, x):\n    \"\"\"Compute the piecewise linear interpolation given by mapping for input x.\n\n    >>> interp(((1, 1), (2, 4)), 1.5)\n    2.5\n    \"\"\"\n    mapping = sorted(mapping)\n    if len(mapping) == 1:\n        xa, ya = mapping[0]\n        if xa == x:\n            return ya\n        return x\n    for (xa, ya), (xb, yb) in zip(mapping[:-1], mapping[1:]):\n        if xa <= x <= xb:\n            return ya + float(x - xa) / (xb - xa) * (yb - ya)\n    return x", "entry_point": "interp", "input": "{}, []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/googlefonts/glyphsLib/blob/9c12dc70c8d13f08d92b824e6710f6e3bb5037bb/Lib/glyphsLib/builder/axes.py#L566-L581", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037021", "code": "def _get_ann(dbs, features):\n    \"\"\"\n    Gives format to annotation for html table output\n    \"\"\"\n    value = \"\"\n    for db, feature in zip(dbs, features):\n        value += db + \":\" + feature\n    return value", "entry_point": "_get_ann", "input": "[], ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lpantano/seqcluster/blob/774e23add8cd4fdc83d626cea3bd1f458e7d060d/seqcluster/libs/report.py#L21-L28", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037022", "code": "def _realign(seq, precursor, start):\n    \"\"\"\n    The actual fn that will realign the sequence\n    \"\"\"\n    error = set()\n    pattern_addition = [[1, 1, 0], [1, 0, 1], [0, 1, 0], [0, 1, 1], [0, 0, 1], [1, 1, 1]]\n    for pos in range(0, len(seq)):\n        if seq[pos] != precursor[(start + pos)]:\n            error.add(pos)\n\n    subs, add = [], []\n    for e in error:\n        if e < len(seq) - 3:\n            subs.append([e, seq[e], precursor[start + e]])\n\n    pattern, error_add = [], []\n    for e in range(len(seq) - 3, len(seq)):\n        if e in error:\n            pattern.append(1)\n            error_add.append(e)\n        else:\n            pattern.append(0)\n    for p in pattern_addition:\n        if pattern == p:\n            add = seq[error_add[0]:]\n            break\n    if not add and error_add:\n        for e in error_add:\n            subs.append([e, seq[e], precursor[start + e]])\n\n    return subs, add", "entry_point": "_realign", "input": "{}, {1, 2, 3}, [[1, 2], [3], []]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lpantano/seqcluster/blob/774e23add8cd4fdc83d626cea3bd1f458e7d060d/seqcluster/seqbuster/__init__.py#L201-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037023", "code": "def _get_description(string):\n    \"\"\"\n    Parse annotation to get nice description\n    \"\"\"\n    ann = set()\n    if not string:\n        return \"This cluster is inter-genic.\"\n    for item in string:\n        for db in item:\n            ann = ann.union(set(item[db]))\n    return \"annotated as: %s ...\" % \",\".join(list(ann)[:3])", "entry_point": "_get_description", "input": "''", "output": "'This cluster is inter-genic.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lpantano/seqcluster/blob/774e23add8cd4fdc83d626cea3bd1f458e7d060d/seqcluster/db/__init__.py#L20-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037024", "code": "def _normalize_seqs(s, t):\n    \"\"\"Normalize to RPM\"\"\"\n    for ids in s:\n        obj = s[ids]\n        [obj.norm_freq.update({sample: 1.0 * obj.freq[sample] / (t[sample]+1) * 1000000}) for sample in obj.norm_freq]\n        s[ids] = obj\n    return s", "entry_point": "_normalize_seqs", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lpantano/seqcluster/blob/774e23add8cd4fdc83d626cea3bd1f458e7d060d/seqcluster/libs/tool.py#L132-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037025", "code": "def _summarize_peaks(peaks):\n    \"\"\"\n    merge peaks position if closer than 10\n    \"\"\"\n    previous = peaks[0]\n    new_peaks = [previous]\n    for pos in peaks:\n        if pos > previous + 10:\n            new_peaks.add(pos)\n        previous = pos\n    return new_peaks", "entry_point": "_summarize_peaks", "input": "[1, 2, 3]", "output": "[1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/lpantano/seqcluster/blob/774e23add8cd4fdc83d626cea3bd1f458e7d060d/seqcluster/function/peakdetect.py#L4-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037026", "code": "def __fix_context(context):\n    \"\"\"Return a new context dict based on original context.\n\n    The new context will be a copy of the original, and some mutable\n    members (such as script and css files) will also be copied to\n    prevent polluting shared context.\n    \"\"\"\n\n    COPY_LISTS = ('script_files', 'css_files',)\n\n    for attr in COPY_LISTS:\n        if attr in context:\n            context[attr] = context[attr][:]\n\n    return context", "entry_point": "__fix_context", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nyergler/hieroglyph/blob/1ef062fad5060006566f8d6bd3b5a231ac7e0488/src/hieroglyph/slides.py#L4-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037027", "code": "def parse_metadata(section):\n  \"\"\"Given the first part of a slide, returns metadata associated with it.\"\"\"\n  metadata = {}\n  metadata_lines = section.split('\\n')\n  for line in metadata_lines:\n    colon_index = line.find(':')\n    if colon_index != -1:\n      key = line[:colon_index].strip()\n      val = line[colon_index + 1:].strip()\n      metadata[key] = val\n\n  return metadata", "entry_point": "parse_metadata", "input": "'AbC dEf'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/nyergler/hieroglyph/blob/1ef062fad5060006566f8d6bd3b5a231ac7e0488/src/hieroglyph/themes/slides2/static/scripts/md/render.py#L36-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037028", "code": "def accept_lit(char, buf, pos):\n    \"\"\"Accept a literal character at the current buffer position.\"\"\"\n    if pos >= len(buf) or buf[pos] != char:\n        return None, pos\n    return char, pos+1", "entry_point": "accept_lit", "input": "-1.5, {1, 2, 3}, 10", "output": "(None, 10)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/geertj/gruvi/blob/1d77ca439600b6ea7a19aa1ee85dca0f3be3f3f8/lib/gruvi/http.py#L138-L142", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037029", "code": "def get_header(headers, name, default=None):\n    \"\"\"Return the value of header *name*.\n\n    The *headers* argument must be a list of ``(name, value)`` tuples. If the\n    header is found its associated value is returned, otherwise *default* is\n    returned. Header names are matched case insensitively.\n    \"\"\"\n    name = name.lower()\n    for header in headers:\n        if header[0].lower() == name:\n            return header[1]\n    return default", "entry_point": "get_header", "input": "[], 'walnut thistle harbour', [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/geertj/gruvi/blob/1d77ca439600b6ea7a19aa1ee85dca0f3be3f3f8/lib/gruvi/http.py#L350-L361", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037030", "code": "def remove_headers(headers, name):\n    \"\"\"Remove all headers with name *name*.\n\n    The list is modified in-place and the updated list is returned.\n    \"\"\"\n    i = 0\n    name = name.lower()\n    for j in range(len(headers)):\n        if headers[j][0].lower() != name:\n            if i != j:\n                headers[i] = headers[j]\n            i += 1\n    del headers[i:]\n    return headers", "entry_point": "remove_headers", "input": "['apple', 'banana', 'cherry'], 'AbC dEf'", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/geertj/gruvi/blob/1d77ca439600b6ea7a19aa1ee85dca0f3be3f3f8/lib/gruvi/http.py#L363-L376", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037031", "code": "def in_range(x: int, minimum: int, maximum: int) -> bool:\n    \"\"\" Return True if x is >= minimum and <= maximum. \"\"\"\n    return (x >= minimum and x <= maximum)", "entry_point": "in_range", "input": "[], [], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/welbornprod/colr/blob/417117fdbddbc53142096685ac2af006b2bd0220/colr/colr.py#L584-L586", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037032", "code": "def convert_feature_layers_to_dict(feature_layers):\n    \"\"\"takes a list of 'feature_layer' objects and converts to a dict\n       keyed by the layer name\"\"\"\n    features_by_layer = {}\n    for feature_layer in feature_layers:\n        layer_name = feature_layer['name']\n        features = feature_layer['features']\n        features_by_layer[layer_name] = features\n    return features_by_layer", "entry_point": "convert_feature_layers_to_dict", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tilezen/tilequeue/blob/d7b9484ab92e246eb2773949c784ebb37c731e28/tilequeue/format/__init__.py#L43-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037033", "code": "def check_bounds(args, lowerLimit, upperLimit):\n        \"\"\"\n        checks whether the parameter vector has left its bound, if so, adds a big number\n        \"\"\"\n        penalty = 0\n        bound_hit = False\n        for i in range(0, len(args)):\n            if args[i] < lowerLimit[i] or args[i] > upperLimit[i]:\n                penalty = 10**15\n                bound_hit = True\n        return penalty, bound_hit", "entry_point": "check_bounds", "input": "[], 10, 5", "output": "(0, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Sampling/likelihood.py#L126-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037034", "code": "def pretty_print_error(err_json):\n    \"\"\"Pretty print Flask-Potion error messages for the user.\"\"\"\n    # Special case validation errors\n    if len(err_json) == 1 and \"validationOf\" in err_json[0]:\n        required_fields = \", \".join(err_json[0][\"validationOf\"][\"required\"])\n        return \"Validation error. Requires properties: {}.\".format(required_fields)\n\n    # General error handling\n    msg = \"; \".join(err.get(\"message\", \"\") for err in err_json)\n\n    # Fallback\n    if not msg:\n        msg = \"Bad request.\"\n    return msg", "entry_point": "pretty_print_error", "input": "()", "output": "'Bad request.'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/onecodex/onecodex/blob/326a0a1af140e3a57ccf31c3c9c5e17a5775c13d/onecodex/models/__init__.py#L584-L597", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037035", "code": "def should_include_file_in_search(file_name, extensions, exclude_dirs):\n    \"\"\" Whether or not a filename matches a search criteria according to arguments.\n\n    Args:\n        file_name (str): A file path to check.\n        extensions (list): A list of file extensions file should match.\n        exclude_dirs (list): A list of directories to exclude from search.\n\n    Returns:\n        A boolean of whether or not file matches search criteria.\n\n    \"\"\"\n    return (exclude_dirs is None or not any(file_name.startswith(d) for d in exclude_dirs)) and \\\n        any(file_name.endswith(e) for e in extensions)", "entry_point": "should_include_file_in_search", "input": "'  padded  ', [], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joytunes/JTLocalize/blob/87864dc60114e0e61c768d057c6eddfadff3f40a/localization_flow/jtlocalize/core/localization_utils.py#L276-L289", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037036", "code": "def points_from_y0x0y1x1(yxyx):\n    \"\"\"\n    Constructs a polygon representation from a rectangle described as a list [y0, x0, y1, x1]\n    \"\"\"\n    y0 = yxyx[0]\n    x0 = yxyx[1]\n    y1 = yxyx[2]\n    x1 = yxyx[3]\n    return \"%s,%s %s,%s %s,%s %s,%s\" % (\n        x0, y0,\n        x1, y0,\n        x1, y1,\n        x0, y1\n    )", "entry_point": "points_from_y0x0y1x1", "input": "[5, 3, 1, 4]", "output": "'3,5 4,5 4,1 3,1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCR-D/core/blob/57e68c578526cb955fd2e368207f5386c459d91d/ocrd_utils/ocrd_utils/__init__.py#L98-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037037", "code": "def points_from_x0y0x1y1(xyxy):\n    \"\"\"\n    Constructs a polygon representation from a rectangle described as a list [x0, y0, x1, y1]\n    \"\"\"\n    x0 = xyxy[0]\n    y0 = xyxy[1]\n    x1 = xyxy[2]\n    y1 = xyxy[3]\n    return \"%s,%s %s,%s %s,%s %s,%s\" % (\n        x0, y0,\n        x1, y0,\n        x1, y1,\n        x0, y1\n    )", "entry_point": "points_from_x0y0x1y1", "input": "[5, 3, 1, 4]", "output": "'5,3 1,3 1,4 5,4'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/OCR-D/core/blob/57e68c578526cb955fd2e368207f5386c459d91d/ocrd_utils/ocrd_utils/__init__.py#L113-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037038", "code": "def decompose_code(code):\n    \"\"\"\n    Decomposes a MARC \"code\" into tag, ind1, ind2, subcode\n    \"\"\"\n    code = \"%-6s\" % code\n    ind1 = code[3:4]\n    if ind1 == \" \": ind1 = \"_\"\n    ind2 = code[4:5]\n    if ind2 == \" \": ind2 = \"_\"\n    subcode = code[5:6]\n    if subcode == \" \": subcode = None\n    return (code[0:3], ind1, ind2, subcode)", "entry_point": "decompose_code", "input": "[1, 2, 3]", "output": "('[1,', '_', '2', ',')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/indico/indico-plugins/blob/fe50085cc63be9b8161b09539e662e7b04e4b38e/importer_invenio/indico_importer_invenio/connector.py#L642-L653", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037039", "code": "def stringify_seconds(seconds=0):\n    \"\"\"\n    Takes time as a value of seconds and deduces the delta in human-readable\n    HHh MMm SSs format.\n    \"\"\"\n    seconds = int(seconds)\n    minutes = seconds / 60\n    ti = {'h': 0, 'm': 0, 's': 0}\n\n    if seconds > 0:\n        ti['s'] = seconds % 60\n        ti['m'] = minutes % 60\n        ti['h'] = minutes / 60\n\n    return \"%dh %dm %ds\" % (ti['h'], ti['m'], ti['s'])", "entry_point": "stringify_seconds", "input": "2", "output": "'0h 0m 2s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/indico/indico-plugins/blob/fe50085cc63be9b8161b09539e662e7b04e4b38e/piwik/indico_piwik/queries/utils.py#L48-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037040", "code": "def _safe_path(filepath, can_be_cwl=False):\n    \"\"\"Check if the path should be used in output.\"\"\"\n    # Should not be in ignore paths.\n    if filepath in {'.gitignore', '.gitattributes'}:\n        return False\n\n    # Ignore everything in .renku ...\n    if filepath.startswith('.renku'):\n        # ... unless it can be a CWL.\n        if can_be_cwl and filepath.endswith('.cwl'):\n            return True\n        return False\n\n    return True", "entry_point": "_safe_path", "input": "'Hello World', [5, 3, 1, 4]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_graph.py#L62-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037041", "code": "def with_siblings(graph, outputs):\n    \"\"\"Include all missing siblings.\"\"\"\n    siblings = set()\n    for node in outputs:\n        siblings |= graph.siblings(node)\n    return siblings", "entry_point": "with_siblings", "input": "[[1, 2], [3], []], []", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_options.py#L155-L160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037042", "code": "def _include_exclude(file_path, include=None, exclude=None):\n    \"\"\"Check if file matches one of include filters and not in exclude filter.\n\n    :param file_path: Path to the file.\n    :param include: Tuple containing patterns to which include from result.\n    :param exclude: Tuple containing patterns to which exclude from result.\n    \"\"\"\n    if exclude is not None and exclude:\n        for pattern in exclude:\n            if file_path.match(pattern):\n                return False\n\n    if include is not None and include:\n        for pattern in include:\n            if file_path.match(pattern):\n                return True\n        return False\n\n    return True", "entry_point": "_include_exclude", "input": "False, {}, []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/dataset.py#L365-L383", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037043", "code": "def _split_section_and_key(key):\n    \"\"\"Return a tuple with config section and key.\"\"\"\n    parts = key.split('.')\n    if len(parts) > 1:\n        return 'renku \"{0}\"'.format(parts[0]), '.'.join(parts[1:])\n    return 'renku', key", "entry_point": "_split_section_and_key", "input": "'abc'", "output": "('renku', 'abc')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/config.py#L47-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037044", "code": "def flatten(in_list):\n    \"\"\"given a list of values in_list, flatten returns the list obtained by \n       flattening the top-level elements of in_list.\"\"\"\n    out_list = []\n    for val in in_list:\n        if isinstance(val, list):\n            out_list.extend(val)\n        else:\n            out_list.append(val)\n\n    return out_list", "entry_point": "flatten", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ml4ai/delphi/blob/6d03d8aafeab99610387c51b89c99738ff2abbe3/delphi/translators/for2py/arrays.py#L210-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037045", "code": "def line_is_comment(line: str) -> bool:\n    \"\"\"\n    From FORTRAN Language Reference\n    (https://docs.oracle.com/cd/E19957-01/805-4939/z40007332024/index.html):\n\n    A line with a c, C, *, d, D, or ! in column one is a comment line, except\n    that if the -xld option is set, then the lines starting with D or d are\n    compiled as debug lines. The d, D, and ! are nonstandard.\n\n    If you put an exclamation mark (!) in any column of the statement field,\n    except within character literals, then everything after the ! on that\n    line is a comment.\n\n    A totally blank line is a comment line.\n\n    Args:\n        line\n\n    Returns:\n        True iff line is a comment, False otherwise.\n\n    \"\"\"\n\n    if line[0] in \"cCdD*!\":\n        return True\n\n    llstr = line.strip()\n    if len(llstr) == 0 or llstr[0] == \"!\":\n        return True\n\n    return False", "entry_point": "line_is_comment", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ml4ai/delphi/blob/6d03d8aafeab99610387c51b89c99738ff2abbe3/delphi/translators/for2py/syntax.py#L12-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037046", "code": "def line_is_continuation(line: str) -> bool:\n    \"\"\"\n    Args:\n        line\n    Returns:\n        True iff line is a continuation line, else False.\n    \"\"\"\n\n    llstr = line.lstrip()\n    return len(llstr) > 0 and llstr[0] == \"&\"", "entry_point": "line_is_continuation", "input": "'walnut thistle harbour'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ml4ai/delphi/blob/6d03d8aafeab99610387c51b89c99738ff2abbe3/delphi/translators/for2py/syntax.py#L168-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037047", "code": "def get_variable_and_source(x: str):\n    \"\"\" Process the variable name to make it more human-readable. \"\"\"\n    xs = x.replace(\"\\/\", \"|\").split(\"/\")\n    xs = [x.replace(\"|\", \"/\") for x in xs]\n    if xs[0] == \"FAO\":\n        return \" \".join(xs[2:]), xs[0]\n    else:\n        return xs[-1], xs[0]", "entry_point": "get_variable_and_source", "input": "'Hello World'", "output": "('Hello World', 'Hello World')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ml4ai/delphi/blob/6d03d8aafeab99610387c51b89c99738ff2abbe3/delphi/assembly.py#L96-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037048", "code": "def _make_publisher(catalog_or_dataset):\n    \"\"\"De estar presentes las claves necesarias, genera el diccionario\n    \"publisher\" a nivel cat\u00e1logo o dataset.\"\"\"\n    level = catalog_or_dataset\n    keys = [k for k in [\"publisher_name\", \"publisher_mbox\"] if k in level]\n    if keys:\n        level[\"publisher\"] = {\n            key.replace(\"publisher_\", \"\"): level.pop(key) for key in keys\n        }\n    return level", "entry_point": "_make_publisher", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datosgobar/pydatajson/blob/3141082ffbaa295e2deaf6ffbbc5a59f5859960e/pydatajson/readers.py#L262-L271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037049", "code": "def _make_contact_point(dataset):\n    \"\"\"De estar presentes las claves necesarias, genera el diccionario\n    \"contactPoint\" de un dataset.\"\"\"\n    keys = [k for k in [\"contactPoint_fn\", \"contactPoint_hasEmail\"]\n            if k in dataset]\n    if keys:\n        dataset[\"contactPoint\"] = {\n            key.replace(\"contactPoint_\", \"\"): dataset.pop(key) for key in keys\n        }\n    return dataset", "entry_point": "_make_contact_point", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datosgobar/pydatajson/blob/3141082ffbaa295e2deaf6ffbbc5a59f5859960e/pydatajson/readers.py#L274-L283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037050", "code": "def joint_value_post_processor(a, _):\n    \"\"\"The final step in calculating joint values like disability weights.\n    If the combiner is list_combiner then the effective formula is:\n\n    .. math::\n\n        value(args) = 1 -  \\prod_{i=1}^{mutator count} 1-mutator_{i}(args)\n\n    Parameters\n    ----------\n    a : List[pd.Series]\n        a is a list of series, indexed on the population. Each series\n        corresponds to a different value in the pipeline and each row\n        in a series contains a value that applies to a specific simulant.\n    \"\"\"\n    # if there is only one value, return the value\n    if len(a) == 1:\n        return a[0]\n\n    # if there are multiple values, calculate the joint value\n    product = 1\n    for v in a:\n        new_value = (1-v)\n        product = product * new_value\n    joint_value = 1 - product\n    return joint_value", "entry_point": "joint_value_post_processor", "input": "[-1, 0, 1, 2], []", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/ihmeuw/vivarium/blob/c5f5d50f775c8bf337d3aae1ff7c57c025a8e258/src/vivarium/framework/values.py#L54-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037051", "code": "def traverse_dict(dicc, keys, default_value=None):\n    \"\"\"Recorre un diccionario siguiendo una lista de claves, y devuelve\n    default_value en caso de que alguna de ellas no exista.\n\n    Args:\n        dicc (dict): Diccionario a ser recorrido.\n        keys (list): Lista de claves a ser recorrida. Puede contener\n            \u00edndices de listas y claves de diccionarios mezcladas.\n        default_value: Valor devuelto en caso de que `dicc` no se pueda\n            recorrer siguiendo secuencialmente la lista de `keys` hasta\n            el final.\n\n    Returns:\n        object: El valor obtenido siguiendo la lista de `keys` dentro de\n        `dicc`.\n    \"\"\"\n    for key in keys:\n        if isinstance(dicc, dict) and key in dicc:\n            dicc = dicc[key]\n        elif (isinstance(dicc, list)\n              and isinstance(key, int)\n              and key < len(dicc)):\n            dicc = dicc[key]\n        else:\n            return default_value\n\n    return dicc", "entry_point": "traverse_dict", "input": "[], [], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datosgobar/pydatajson/blob/3141082ffbaa295e2deaf6ffbbc5a59f5859960e/pydatajson/helpers.py#L155-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037052", "code": "def string_to_list(string, sep=\",\", filter_empty=False):\n    \"\"\"Transforma una string con elementos separados por `sep` en una lista.\"\"\"\n    return [value.strip() for value in string.split(sep)\n            if (not filter_empty or value)]", "entry_point": "string_to_list", "input": "'abc', '  padded  ', [1, 2, 3]", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/datosgobar/pydatajson/blob/3141082ffbaa295e2deaf6ffbbc5a59f5859960e/pydatajson/helpers.py#L280-L283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037053", "code": "def windows_dir_format(host_dir, user):\n    \"\"\"Format a string for the location of the user's folder on the Windows (TJ03) fileserver.\"\"\"\n    if user and user.grade:\n        grade = int(user.grade)\n    else:\n        return host_dir\n\n    if grade in range(9, 13):\n        win_path = \"/{}/\".format(user.username)\n    else:\n        win_path = \"\"\n    return host_dir.replace(\"{win}\", win_path)", "entry_point": "windows_dir_format", "input": "[1, 2, 3], ()", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tjcsl/ion/blob/5d722b0725d572039bb0929fd5715a4070c82c72/intranet/apps/files/views.py#L125-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037054", "code": "def dashes(phone):\n    \"\"\"Returns the phone number formatted with dashes.\"\"\"\n    if isinstance(phone, str):\n        if phone.startswith(\"+1\"):\n            return \"1-\" + \"-\".join((phone[2:5], phone[5:8], phone[8:]))\n        elif len(phone) == 10:\n            return \"-\".join((phone[:3], phone[3:6], phone[6:]))\n        else:\n            return phone\n    else:\n        return phone", "entry_point": "dashes", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/tjcsl/ion/blob/5d722b0725d572039bb0929fd5715a4070c82c72/intranet/apps/users/templatetags/phone_numbers.py#L9-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037055", "code": "def _is_pair(item):\n    \"\"\"Check if an item is a pair (tuple of size 2).\n    \"\"\"\n    return (isinstance(item, (list, tuple, set)) and\n            len(item) == 2 and\n            not isinstance(item[0], (list, tuple, set)) and\n            not isinstance(item[1], (list, tuple, set)))", "entry_point": "_is_pair", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pytroll/trollimage/blob/d35a7665ad475ff230e457085523e21f2cd3f454/trollimage/image.py#L1121-L1127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037056", "code": "def compress_amount(n):\n    \"\"\"\\\n    Compress 64-bit integer values, preferring a smaller size for whole\n    numbers (base-10), so as to achieve run-length encoding gains on real-\n    world data. The basic algorithm:\n        * If the amount is 0, return 0\n        * Divide the amount (in base units) evenly by the largest power of 10\n          possible; call the exponent e (e is max 9)\n        * If e<9, the last digit of the resulting number cannot be 0; store it\n          as d, and drop it (divide by 10); regardless, call the result n\n        * Output 1 + 10*(9*n + d - 1) + e\n        * If e==9, we only know the resulting number is not zero, so output\n          1 + 10*(n - 1) + 9.\n    (This is decodable, as d is in [1-9] and e is in [0-9].)\"\"\"\n    if not n: return 0\n    e = 0\n    while (n % 10) == 0 and e < 9:\n        n = n // 10\n        e = e + 1\n    if e < 9:\n        n, d = divmod(n, 10);\n        return 1 + (n*9 + d - 1)*10 + e\n    else:\n        return 1 + (n - 1)*10 + 9", "entry_point": "compress_amount", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maaku/python-bitcoin/blob/1b80c284170fd3f547cc45f4700ce169f3f99641/bitcoin/tools.py#L34-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037057", "code": "def decompress_amount(x):\n    \"\"\"\\\n    Undo the value compression performed by x=compress_amount(n). The input\n    x matches one of the following patterns:\n        x = n = 0\n        x = 1+10*(9*n + d - 1) + e\n        x = 1+10*(n - 1) + 9\"\"\"\n    if not x: return 0;\n    x = x - 1;\n\n    # x = 10*(9*n + d - 1) + e\n    x, e = divmod(x, 10);\n    n = 0;\n    if e < 9:\n        # x = 9*n + d - 1\n        x, d = divmod(x, 9)\n        d = d + 1\n        # x = n\n        n = x*10 + d\n    else:\n        n = x + 1\n    return n * 10**e", "entry_point": "decompress_amount", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maaku/python-bitcoin/blob/1b80c284170fd3f547cc45f4700ce169f3f99641/bitcoin/tools.py#L59-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037058", "code": "def target_from_compact(bits):\n    \"\"\"\\\n    Extract a full target from its compact representation, undoing the\n    transformation x=compact_from_target(t). See compact_from_target() for\n    more information on this 32-bit floating point format.\"\"\"\n    size = bits >> 24\n    word = bits & 0x007fffff\n    if size < 3:\n        word >>= 8 * (3 - size)\n    else:\n        word <<= 8 * (size - 3)\n    if bits & 0x00800000:\n        word = -word\n    return word", "entry_point": "target_from_compact", "input": "5", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/maaku/python-bitcoin/blob/1b80c284170fd3f547cc45f4700ce169f3f99641/bitcoin/tools.py#L124-L137", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037059", "code": "def create_csp_header(cspDict):\n\t\"\"\" create csp header string \"\"\"\n\tpolicy = ['%s %s' % (k, v) for k, v in cspDict.items() if v != '']\n\treturn '; '.join(policy)", "entry_point": "create_csp_header", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/twaldear/flask-csp/blob/0f679af368299e36ee9008861fbd4e764abf4b86/flask_csp/csp.py#L36-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037060", "code": "def key_summary(keyjar, issuer):\n    \"\"\"\n    Return a text representation of the keyjar.\n\n    :param keyjar: A :py:class:`oidcmsg.key_jar.KeyJar` instance\n    :param issuer: Which key owner that we are looking at\n    :return: A text representation of the keys\n    \"\"\"\n    try:\n        kbl = keyjar[issuer]\n    except KeyError:\n        return ''\n    else:\n        key_list = []\n        for kb in kbl:\n            for key in kb.keys():\n                if key.inactive_since:\n                    key_list.append(\n                        '*{}:{}:{}'.format(key.kty, key.use, key.kid))\n                else:\n                    key_list.append(\n                        '{}:{}:{}'.format(key.kty, key.use, key.kid))\n        return ', '.join(key_list)", "entry_point": "key_summary", "input": "{}, 'abc'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openid/JWTConnect-Python-CryptoJWT/blob/8863cfbfe77ca885084870b234a66b55bd52930c/src/cryptojwt/key_jar.py#L710-L732", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037061", "code": "def alg2keytype(alg):\n    \"\"\"\n    Go from algorithm name to key type.\n\n    :param alg: The algorithm name\n    :return: The key type\n    \"\"\"\n    if not alg or alg.lower() == \"none\":\n        return \"none\"\n    elif alg.startswith(\"RS\") or alg.startswith(\"PS\"):\n        return \"RSA\"\n    elif alg.startswith(\"HS\") or alg.startswith(\"A\"):\n        return \"oct\"\n    elif alg.startswith(\"ES\") or alg.startswith(\"ECDH-ES\"):\n        return \"EC\"\n    else:\n        return None", "entry_point": "alg2keytype", "input": "[]", "output": "'none'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/openid/JWTConnect-Python-CryptoJWT/blob/8863cfbfe77ca885084870b234a66b55bd52930c/src/cryptojwt/jws/utils.py#L36-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037062", "code": "def argv2line(argv):\n    r\"\"\"Put together the given argument vector into a command line.\n\n        \"argv\" is the argument vector to process.\n\n    >>> from cmdln import argv2line\n    >>> argv2line(['foo'])\n    'foo'\n    >>> argv2line(['foo', 'bar'])\n    'foo bar'\n    >>> argv2line(['foo', 'bar baz'])\n    'foo \"bar baz\"'\n    >>> argv2line(['foo\"bar'])\n    'foo\"bar'\n    >>> print(argv2line(['foo\" bar']))\n    'foo\" bar'\n    >>> print(argv2line([\"foo' bar\"]))\n    \"foo' bar\"\n    >>> argv2line([\"foo'bar\"])\n    \"foo'bar\"\n    \"\"\"\n    escapedArgs = []\n    for arg in argv:\n        if ' ' in arg and '\"' not in arg:\n            arg = '\"' + arg + '\"'\n        elif ' ' in arg and \"'\" not in arg:\n            arg = \"'\" + arg + \"'\"\n        elif ' ' in arg:\n            arg = arg.replace('\"', r'\\\"')\n            arg = '\"' + arg + '\"'\n        escapedArgs.append(arg)\n    return ' '.join(escapedArgs)", "entry_point": "argv2line", "input": "['apple', 'banana', 'cherry']", "output": "'apple banana cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/joyent/python-manta/blob/f68ef142bdbac058c981e3b28e18d77612f5b7c6/manta/cmdln.py#L1472-L1503", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037063", "code": "def oidc_to_user_data(payload):\n    \"\"\"\n    Map OIDC claims to Django user fields.\n    \"\"\"\n    payload = payload.copy()\n\n    field_map = {\n        'given_name': 'first_name',\n        'family_name': 'last_name',\n        'email': 'email',\n    }\n    ret = {}\n    for token_attr, user_attr in field_map.items():\n        if token_attr not in payload:\n            continue\n        ret[user_attr] = payload.pop(token_attr)\n    ret.update(payload)\n\n    return ret", "entry_point": "oidc_to_user_data", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/City-of-Helsinki/django-helusers/blob/9064979f6f990987358e2bca3c24a80fad201bdb/helusers/user_utils.py#L8-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037064", "code": "def _filter_string(value):\n        \"\"\" Filter the string so MAM doesn't have heart failure.\"\"\"\n        if value is None:\n            value = \"\"\n\n        # replace whitespace with space\n        value = value.replace(\"\\n\", \" \")\n        value = value.replace(\"\\t\", \" \")\n\n        # CSV seperator\n        value = value.replace(\"|\", \" \")\n\n        # remove leading/trailing whitespace\n        value = value.strip()\n\n        # hack because MAM doesn't quote sql correctly\n        value = value.replace(\"\\\\\", \"\")\n\n        # Used for stripping non-ascii characters\n        value = ''.join(c for c in value if 31 < ord(c) < 127)\n\n        return value", "entry_point": "_filter_string", "input": "'  padded  '", "output": "'padded'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Karaage-Cluster/karaage/blob/2f4c8b4e2d728b3fcbb151160c49000f1c04f5c9/karaage/datastores/mam.py#L57-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037065", "code": "def _truncate(value, arg):\n        \"\"\"\n        Truncates a string after a given number of chars\n        Argument: Number of chars to _truncate after\n        \"\"\"\n        length = int(arg)\n        if value is None:\n            value = \"\"\n        if len(value) > length:\n            return value[:length] + \"...\"\n        else:\n            return value", "entry_point": "_truncate", "input": "{1, 2, 3}, 5", "output": "{1, 2, 3}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Karaage-Cluster/karaage/blob/2f4c8b4e2d728b3fcbb151160c49000f1c04f5c9/karaage/datastores/mam.py#L81-L92", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037066", "code": "def filter_composite_from_subgroups(s):\n    \"\"\"\n    Given a sorted list of subgroups, return a string appropriate to provide as\n    the a composite track's `filterComposite` argument\n\n    >>> import trackhub\n    >>> trackhub.helpers.filter_composite_from_subgroups(['cell', 'ab', 'lab', 'knockdown'])\n    'dimA dimB'\n\n    Parameters\n    ----------\n    s : list\n        A list representing the ordered subgroups, ideally the same list\n        provided to `dimensions_from_subgroups`. The values are not actually\n        used, just the number of items.\n    \"\"\"\n    dims = []\n    for letter, sg in zip('ABCDEFGHIJKLMNOPQRSTUVWZ', s[2:]):\n        dims.append('dim{0}'.format(letter))\n    if dims:\n        return ' '.join(dims)", "entry_point": "filter_composite_from_subgroups", "input": "[-1, 0, 1, 2]", "output": "'dimA dimB'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daler/trackhub/blob/e4655f79177822529f80b923df117e38e28df702/trackhub/helpers.py#L25-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037067", "code": "def sanitize(s, strict=True):\n    \"\"\"\n    Sanitize a string.\n\n    Spaces are converted to underscore; if strict=True they are then removed.\n\n    Parameters\n    ----------\n    s : str\n        String to sanitize\n\n    strict : bool\n        If True, only alphanumeric characters are allowed. If False, a limited\n        set of additional characters (-._) will be allowed.\n    \"\"\"\n    allowed = ''.join(\n        [\n            'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n            'abcdefghijklmnopqrstuvwxyz',\n            '0123456789',\n        ]\n    )\n\n    if not strict:\n        allowed += '-_.'\n\n    s = str(s).replace(' ', '_')\n\n    return ''.join([i for i in s if i in allowed])", "entry_point": "sanitize", "input": "[], True", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/daler/trackhub/blob/e4655f79177822529f80b923df117e38e28df702/trackhub/helpers.py#L69-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037068", "code": "def get_colour(index):\n    \"\"\" get color number index. \"\"\"\n    colours = [\n        'red', 'blue', 'green', 'pink',\n        'yellow', 'magenta', 'orange', 'cyan',\n    ]\n    default_colour = 'purple'\n    if index < len(colours):\n        return colours[index]\n    else:\n        return default_colour", "entry_point": "get_colour", "input": "0", "output": "'red'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Karaage-Cluster/karaage/blob/2f4c8b4e2d728b3fcbb151160c49000f1c04f5c9/karaage/plugins/kgusage/graphs.py#L32-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037069", "code": "def snake_to_camel(name):\n    \"\"\"Takes a snake_field_name and returns a camelCaseFieldName\n\n    Args:\n        name (str): E.g. snake_field_name or SNAKE_FIELD_NAME\n\n    Returns:\n        str: camelCase converted name. E.g. capsFieldName\n    \"\"\"\n    ret = \"\".join(x.title() for x in name.split(\"_\"))\n    ret = ret[0].lower() + ret[1:]\n    return ret", "entry_point": "snake_to_camel", "input": "'a,b,c'", "output": "'a,B,C'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/dls-controls/pymalcolm/blob/80ea667e4da26365a6cebc0249f52fdc744bd983/malcolm/core/serializable.py#L70-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037070", "code": "def seperate_end_page_links(stream_data):\n    '''\n    Seperate out page blocks at the end of a StreamField.\n\n    Accepts: List of streamfield blocks\n    Returns: Tuple of 2 lists of blocks - (remaining body, final article)\n    '''\n    stream_data_copy = list(stream_data)\n    end_page_links = []\n\n    for block in stream_data_copy[::-1]:\n        if block['type'] == 'page':\n            end_page_links.insert(0, block)\n            stream_data_copy.pop()\n        else:\n            break\n\n    return (stream_data_copy, end_page_links)", "entry_point": "seperate_end_page_links", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/praekeltfoundation/molo/blob/57702fda4fab261d67591415f7d46bc98fa38525/molo/core/page_utils.py#L38-L55", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037071", "code": "def generate_sjson_from_srt(srt_subs):\n        \"\"\"\n        Generate transcripts from sjson to SubRip (*.srt).\n\n        Arguments:\n            srt_subs(SubRip): \"SRT\" subs object\n\n        Returns:\n            Subs converted to \"SJSON\" format.\n        \"\"\"\n        sub_starts = []\n        sub_ends = []\n        sub_texts = []\n        for sub in srt_subs:\n            sub_starts.append(sub.start.ordinal)\n            sub_ends.append(sub.end.ordinal)\n            sub_texts.append(sub.text.replace('\\n', ' '))\n\n        sjson_subs = {\n            'start': sub_starts,\n            'end': sub_ends,\n            'text': sub_texts\n        }\n        return sjson_subs", "entry_point": "generate_sjson_from_srt", "input": "[]", "output": "{'start': [], 'end': [], 'text': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-val/blob/30df48061e77641edb5272895b7c7f7f25eb7aa7/edxval/transcript_utils.py#L24-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037072", "code": "def to_snake(camel):\n    \"\"\"TimeSkill -> time_skill\"\"\"\n    if not camel:\n        return camel\n    return ''.join('_' + x if 'A' <= x <= 'Z' else x for x in camel).lower()[camel[0].isupper():]", "entry_point": "to_snake", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/MycroftAI/mycroft-skills-kit/blob/4a8f5303fdd6d30082d3ba8f8c56457cdc1cecb7/msk/util.py#L172-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037073", "code": "def _dict_lower(dictionary: dict):\n        \"\"\"Convert allowed state transitions / target states to lowercase.\"\"\"\n        return {key.lower(): [value.lower() for value in value]\n                for key, value in dictionary.items()}", "entry_point": "_dict_lower", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SKA-ScienceDataProcessor/integration-prototype/blob/8c8006de6ad71dcd44114b0338780738079c87d4/sip/execution_control/configuration_db/sip_config_db/states/_state_object.py#L278-L281", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037074", "code": "def get_service_state_object_id(subsystem: str, name: str,\n                                    version: str) -> str:\n        \"\"\"Return service state data object key.\n\n        Args:\n            subsystem (str): Subsystem the service belongs to\n            name (str): Name of the Service\n            version (str): Version of the Service\n\n        Returns:\n            str, Key used to store the service state data object\n\n        \"\"\"\n        return '{}:{}:{}'.format(subsystem, name, version)", "entry_point": "get_service_state_object_id", "input": "[-1, 0, 1, 2], 'AbC dEf', []", "output": "'[-1, 0, 1, 2]:AbC dEf:[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SKA-ScienceDataProcessor/integration-prototype/blob/8c8006de6ad71dcd44114b0338780738079c87d4/sip/execution_control/configuration_db/sip_config_db/states/service_state.py#L59-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037075", "code": "def _build_dict(my_dict, keys, values):\n        \"\"\"Build a dictionary from a set of redis hashes.\n\n            keys = ['a', 'b', 'c']\n            values = {'value': 'foo'}\n            my_dict = {'a': {'b': {'c': {'value': 'foo'}}}}\n\n        Args:\n            my_dict (dict): Dictionary to add to\n            keys (list[str]): List of keys used to define hierarchy in my_dict\n            values (dict): Values to add at to the dictionary at the key\n               specified by keys\n\n        Returns:\n            dict, new dictionary with values added at keys\n\n        \"\"\"\n        temp = my_dict\n        for depth, key in enumerate(keys):\n            if depth < len(keys) - 1:\n                if key not in temp:\n                    temp[key] = dict()\n                temp = temp[key]\n            else:\n                if key not in temp:\n                    temp[key] = values\n                else:\n                    temp[key] = {**temp[key], **values}\n        return my_dict", "entry_point": "_build_dict", "input": "{'a': 1, 'b': 2}, [], [1, 2, 3]", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/SKA-ScienceDataProcessor/integration-prototype/blob/8c8006de6ad71dcd44114b0338780738079c87d4/sip/execution_control/configuration_db/sip_config_db/_config_db_redis.py#L94-L122", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037076", "code": "def _sanitize(recipe):\n        \"\"\"Clean up a recipe that may have been stored as serialized json string.\n        Convert any numerical pointers that are stored as strings to integers.\"\"\"\n        recipe = recipe.copy()\n        for k in list(recipe):\n            if k not in (\"start\", \"error\") and int(k) and k != int(k):\n                recipe[int(k)] = recipe[k]\n                del recipe[k]\n        for k in list(recipe):\n            if \"output\" in recipe[k] and not isinstance(\n                recipe[k][\"output\"], (list, dict)\n            ):\n                recipe[k][\"output\"] = [recipe[k][\"output\"]]\n            # dicts should be normalized, too\n        if \"start\" in recipe:\n            recipe[\"start\"] = [tuple(x) for x in recipe[\"start\"]]\n        return recipe", "entry_point": "_sanitize", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/DiamondLightSource/python-workflows/blob/7ef47b457655b96f4d2ef7ee9863cf1b6d20e023/workflows/recipe/recipe.py#L37-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037077", "code": "def strip_spaces_and_quotes(value):\n    \"\"\"Remove invalid whitespace and/or single pair of dquotes and return None\n    for empty strings.\n\n    Used to prepare cookie values, path, and domain attributes in a way which\n    tolerates simple formatting mistakes and standards variations.\n    \"\"\"\n    value = value.strip() if value else \"\"\n    if value and len(value) > 1 and (value[0] == value[-1] == '\"'):\n        value = value[1:-1]\n    if not value:\n        value = \"\"\n    return value", "entry_point": "strip_spaces_and_quotes", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/sashahart/cookies/blob/ab8185e06f221eaf65305f15e05852393723ac95/cookies.py#L319-L331", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037078", "code": "def to_number(s):\n    \"\"\"\n    Convert a string to a number.\n    If not successful, return the string without blanks\n    \"\"\"\n    ret = s\n    # try converting to float\n    try:\n        ret = float(s)\n    except ValueError:\n        ret = ret.strip('\\'').strip()\n\n    # try converting to uid\n    try:\n        ret = int(s)\n    except ValueError:\n        pass\n\n    # try converting to boolean\n    if ret == 'True':\n        ret = True\n    elif ret == 'False':\n        ret = False\n    elif ret == 'None':\n        ret = None\n    return ret", "entry_point": "to_number", "input": "'Hello World'", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/cuihantao/andes/blob/7067898d4f26ce7534e968b8486c4aa8fe3a511a/andes/utils/math.py#L134-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037079", "code": "def truncate(text, length=255):\n        \"\"\"\n        Splits the message into a list of strings of of length `length`\n\n        Args:\n            text (str): The text to be divided\n            length (int, optional): The length of the chunks of text. \\\n                    Defaults to 255.\n\n        Returns:\n            list: Text divided into chunks of length `length`\n        \"\"\"\n\n        lines = []\n        i = 0\n        while i < len(text) - 1:\n            try:\n                lines.append(text[i:i+length])\n                i += length\n\n            except IndexError as e:\n                lines.append(text[i:])\n        return lines", "entry_point": "truncate", "input": "'', 10", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/Legobot/Legobot/blob/d13da172960a149681cb5151ce34b2f3a58ad32b/Legobot/Utilities.py#L24-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037080", "code": "def coerce_to_list(val):\n    \"\"\"\n    For parameters that can take either a single string or a list of strings,\n    this function will ensure that the result is a list containing the passed\n    values.\n    \"\"\"\n    if val:\n        if not isinstance(val, (list, tuple)):\n            val = [val]\n    else:\n        val = []\n    return val", "entry_point": "coerce_to_list", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/utils.py#L299-L310", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037081", "code": "def params_to_dict(params, dct):\n    \"\"\"\n    Updates the 'dct' dictionary with the 'params' dictionary, filtering out\n    all those whose param value is None.\n    \"\"\"\n    for param, val in params.items():\n        if val is None:\n            continue\n        dct[param] = val\n    return dct", "entry_point": "params_to_dict", "input": "{}, 2.0", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/utils.py#L593-L602", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037082", "code": "def dict_to_qs(dct):\n    \"\"\"\n    Takes a dictionary and uses it to create a query string.\n    \"\"\"\n    itms = [\"%s=%s\" % (key, val) for key, val in list(dct.items())\n            if val is not None]\n    return \"&\".join(itms)", "entry_point": "dict_to_qs", "input": "{'a': 1, 'b': 2}", "output": "'a=1&b=2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/train-00000-of-00001.parquet", "source_id": "https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/utils.py#L605-L611", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037083", "code": "def parse_unknown_args(args):\n    \"\"\"\n    Parse arguments not consumed by arg parser into a dicitonary\n    \"\"\"\n    retval = {}\n    preceded_by_key = False\n    for arg in args:\n        if arg.startswith('--'):\n            if '=' in arg:\n                key = arg.split('=')[0][2:]\n                value = arg.split('=')[1]\n                retval[key] = value\n            else:\n                key = arg[2:]\n                preceded_by_key = True\n        elif preceded_by_key:\n            retval[key] = arg\n            preceded_by_key = False\n\n    return retval", "entry_point": "parse_unknown_args", "input": "['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/openai/baselines/blob/3301089b48c42b87b396e246ea3f56fa4bfc9678/baselines/common/cmd_util.py#L166-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037084", "code": "def obj_box_coord_scale_to_pixelunit(coord, shape=None):\n    \"\"\"Convert one coordinate [x, y, w (or x2), h (or y2)] in ratio format to image coordinate format.\n    It is the reverse process of ``obj_box_coord_rescale``.\n\n    Parameters\n    -----------\n    coord : list of 4 float\n        One coordinate of one image [x, y, w (or x2), h (or y2)] in ratio format, i.e value range [0~1].\n    shape : tuple of 2 or None\n        For [height, width].\n\n    Returns\n    -------\n    list of 4 numbers\n        New bounding box.\n\n    Examples\n    ---------\n    >>> x, y, x2, y2 = tl.prepro.obj_box_coord_scale_to_pixelunit([0.2, 0.3, 0.5, 0.7], shape=(100, 200, 3))\n      [40, 30, 100, 70]\n\n    \"\"\"\n    if shape is None:\n        shape = [100, 100]\n\n    imh, imw = shape[0:2]\n    x = int(coord[0] * imw)\n    x2 = int(coord[2] * imw)\n    y = int(coord[1] * imh)\n    y2 = int(coord[3] * imh)\n    return [x, y, x2, y2]", "entry_point": "obj_box_coord_scale_to_pixelunit", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[-3, 0, 3, 10]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/prepro.py#L2462-L2492", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037085", "code": "def parse_darknet_ann_list_to_cls_box(annotations):\n    \"\"\"Parse darknet annotation format into two lists for class and bounding box.\n\n    Input list of [[class, x, y, w, h], ...], return two list of [class ...] and [[x, y, w, h], ...].\n\n    Parameters\n    ------------\n    annotations : list of list\n        A list of class and bounding boxes of images e.g. [[class, x, y, w, h], ...]\n\n    Returns\n    -------\n    list of int\n        List of class labels.\n\n    list of list of 4 numbers\n        List of bounding box.\n\n    \"\"\"\n    class_list = []\n    bbox_list = []\n    for ann in annotations:\n        class_list.append(ann[0])\n        bbox_list.append(ann[1:])\n    return class_list, bbox_list", "entry_point": "parse_darknet_ann_list_to_cls_box", "input": "[]", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/prepro.py#L2648-L2672", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037086", "code": "def sequences_add_start_id(sequences, start_id=0, remove_last=False):\n    \"\"\"Add special start token(id) in the beginning of each sequence.\n\n    Parameters\n    ------------\n    sequences : list of list of int\n        All sequences where each row is a sequence.\n    start_id : int\n        The start ID.\n    remove_last : boolean\n        Remove the last value of each sequences. Usually be used for removing the end ID.\n\n    Returns\n    ----------\n    list of list of int\n        The processed sequences.\n\n    Examples\n    ---------\n    >>> sentences_ids = [[4,3,5,3,2,2,2,2], [5,3,9,4,9,2,2,3]]\n    >>> sentences_ids = sequences_add_start_id(sentences_ids, start_id=2)\n    [[2, 4, 3, 5, 3, 2, 2, 2, 2], [2, 5, 3, 9, 4, 9, 2, 2, 3]]\n    >>> sentences_ids = sequences_add_start_id(sentences_ids, start_id=2, remove_last=True)\n    [[2, 4, 3, 5, 3, 2, 2, 2], [2, 5, 3, 9, 4, 9, 2, 2]]\n\n    For Seq2seq\n\n    >>> input = [a, b, c]\n    >>> target = [x, y, z]\n    >>> decode_seq = [start_id, a, b] <-- sequences_add_start_id(input, start_id, True)\n\n    \"\"\"\n    sequences_out = [[] for _ in range(len(sequences))]  #[[]] * len(sequences)\n    for i, _ in enumerate(sequences):\n        if remove_last:\n            sequences_out[i] = [start_id] + sequences[i][:-1]\n        else:\n            sequences_out[i] = [start_id] + sequences[i]\n    return sequences_out", "entry_point": "sequences_add_start_id", "input": "[], [5, 3, 1, 4], ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/prepro.py#L3452-L3490", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037087", "code": "def sequences_add_end_id(sequences, end_id=888):\n    \"\"\"Add special end token(id) in the end of each sequence.\n\n    Parameters\n    -----------\n    sequences : list of list of int\n        All sequences where each row is a sequence.\n    end_id : int\n        The end ID.\n\n    Returns\n    ----------\n    list of list of int\n        The processed sequences.\n\n    Examples\n    ---------\n    >>> sequences = [[1,2,3],[4,5,6,7]]\n    >>> print(sequences_add_end_id(sequences, end_id=999))\n    [[1, 2, 3, 999], [4, 5, 6, 999]]\n\n    \"\"\"\n    sequences_out = [[] for _ in range(len(sequences))]  #[[]] * len(sequences)\n    for i, _ in enumerate(sequences):\n        sequences_out[i] = sequences[i] + [end_id]\n    return sequences_out", "entry_point": "sequences_add_end_id", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "[[1, 2, [[1, 2], [3], []]], [3, [[1, 2], [3], []]], [[[1, 2], [3], []]]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/prepro.py#L3493-L3518", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037088", "code": "def list_remove_repeat(x):\n    \"\"\"Remove the repeated items in a list, and return the processed list.\n    You may need it to create merged layer like Concat, Elementwise and etc.\n\n    Parameters\n    ----------\n    x : list\n        Input\n\n    Returns\n    -------\n    list\n        A list that after removing it's repeated items\n\n    Examples\n    -------\n    >>> l = [2, 3, 4, 2, 3]\n    >>> l = list_remove_repeat(l)\n    [2, 3, 4]\n\n    \"\"\"\n    y = []\n    for i in x:\n        if i not in y:\n            y.append(i)\n\n    return y", "entry_point": "list_remove_repeat", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/layers/utils.py#L242-L268", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037089", "code": "def list_string_to_dict(string):\n    \"\"\"Inputs ``['a', 'b', 'c']``, returns ``{'a': 0, 'b': 1, 'c': 2}``.\"\"\"\n    dictionary = {}\n    for idx, c in enumerate(string):\n        dictionary.update({c: idx})\n    return dictionary", "entry_point": "list_string_to_dict", "input": "'a,b,c'", "output": "{'a': 0, ',': 3, 'b': 2, 'c': 4}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/utils.py#L542-L547", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037090", "code": "def build_reverse_dictionary(word_to_id):\n    \"\"\"Given a dictionary that maps word to integer id.\n    Returns a reverse dictionary that maps a id to word.\n\n    Parameters\n    ----------\n    word_to_id : dictionary\n        that maps word to ID.\n\n    Returns\n    --------\n    dictionary\n        A dictionary that maps IDs to words.\n\n    \"\"\"\n    reverse_dictionary = dict(zip(word_to_id.values(), word_to_id.keys()))\n    return reverse_dictionary", "entry_point": "build_reverse_dictionary", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/nlp.py#L619-L635", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037091", "code": "def words_to_word_ids(data=None, word_to_id=None, unk_key='UNK'):\n    \"\"\"Convert a list of string (words) to IDs.\n\n    Parameters\n    ----------\n    data : list of string or byte\n        The context in list format\n    word_to_id : a dictionary\n        that maps word to ID.\n    unk_key : str\n        Represent the unknown words.\n\n    Returns\n    --------\n    list of int\n        A list of IDs to represent the context.\n\n    Examples\n    --------\n    >>> words = tl.files.load_matt_mahoney_text8_dataset()\n    >>> vocabulary_size = 50000\n    >>> data, count, dictionary, reverse_dictionary = tl.nlp.build_words_dataset(words, vocabulary_size, True)\n    >>> context = [b'hello', b'how', b'are', b'you']\n    >>> ids = tl.nlp.words_to_word_ids(words, dictionary)\n    >>> context = tl.nlp.word_ids_to_words(ids, reverse_dictionary)\n    >>> print(ids)\n    [6434, 311, 26, 207]\n    >>> print(context)\n    [b'hello', b'how', b'are', b'you']\n\n    References\n    ---------------\n    - `tensorflow.models.rnn.ptb.reader <https://github.com/tensorflow/tensorflow/tree/master/tensorflow/models/rnn/ptb>`__\n\n    \"\"\"\n    if data is None:\n        raise Exception(\"data : list of string or byte\")\n    if word_to_id is None:\n        raise Exception(\"word_to_id : a dictionary\")\n    # if isinstance(data[0], six.string_types):\n    #     tl.logging.info(type(data[0]))\n    #     # exit()\n    #     tl.logging.info(data[0])\n    #     tl.logging.info(word_to_id)\n    #     return [word_to_id[str(word)] for word in data]\n    # else:\n\n    word_ids = []\n    for word in data:\n        if word_to_id.get(word) is not None:\n            word_ids.append(word_to_id[word])\n        else:\n            word_ids.append(word_to_id[unk_key])\n    return word_ids", "entry_point": "words_to_word_ids", "input": "[], 'a,b,c', ['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorlayer/tensorlayer/blob/aa9e52e36c7058a7e6fd81d36563ca6850b21956/tensorlayer/nlp.py#L707-L760", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037092", "code": "def dictDiff(da, db):\n  \"\"\" Compares two python dictionaries at the top level and return differences\n\n  da:             first dictionary\n  db:             second dictionary\n\n  Returns:        None if dictionaries test equal; otherwise returns a\n                  dictionary as follows:\n                  {\n                    'inAButNotInB':\n                        <sequence of keys that are in da but not in db>\n                    'inBButNotInA':\n                        <sequence of keys that are in db but not in da>\n                    'differentValues':\n                        <sequence of keys whose corresponding values differ\n                         between da and db>\n                  }\n  \"\"\"\n  different = False\n\n  resultDict = dict()\n\n  resultDict['inAButNotInB'] = set(da) - set(db)\n  if resultDict['inAButNotInB']:\n    different = True\n\n  resultDict['inBButNotInA'] = set(db) - set(da)\n  if resultDict['inBButNotInA']:\n    different = True\n\n  resultDict['differentValues'] = []\n  for key in (set(da) - resultDict['inAButNotInB']):\n    comparisonResult = da[key] == db[key]\n    if isinstance(comparisonResult, bool):\n      isEqual = comparisonResult\n    else:\n      # This handles numpy arrays (but only at the top level)\n      isEqual = comparisonResult.all()\n    if not isEqual:\n      resultDict['differentValues'].append(key)\n      different = True\n\n  assert (((resultDict['inAButNotInB'] or resultDict['inBButNotInA'] or\n          resultDict['differentValues']) and different) or not different)\n\n  return resultDict if different else None", "entry_point": "dictDiff", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "{'inAButNotInB': {1, 2, 3}, 'inBButNotInA': {'banana', 'cherry', 'apple'}, 'differentValues': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/dict_utils.py#L128-L173", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037093", "code": "def indexFromCoordinates(coordinates, dimensions):\n  \"\"\"\n  Translate coordinates into an index, using the given coordinate system.\n\n  Similar to ``numpy.ravel_multi_index``.\n\n  :param coordinates: (list of ints) A list of coordinates of length \n         ``dimensions.size()``.\n\n  :param dimensions: (list of ints) The coordinate system.\n\n  :returns: (int) The index of the point. The coordinates are expressed as a \n            single index by using the dimensions as a mixed radix definition. \n            For example, in dimensions 42x10, the point [1, 4] is index \n            1*420 + 4*10 = 460.\n  \"\"\"\n  index = 0\n  for i, dimension in enumerate(dimensions):\n    index *= dimension\n    index += coordinates[i]\n\n  return index", "entry_point": "indexFromCoordinates", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "-5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/math/topology.py#L57-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037094", "code": "def sameSynapse(syn, synapses):\n  \"\"\"Given a synapse and a list of synapses, check whether this synapse\n  exist in the list.  A synapse is represented as [col, cell, permanence].\n  A synapse matches if col and cell are identical and the permanence value is\n  within 0.001.\"\"\"\n  for s in synapses:\n    if (s[0]==syn[0]) and (s[1]==syn[1]) and (abs(s[2]-syn[2]) <= 0.001):\n      return True\n  return False", "entry_point": "sameSynapse", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L459-L467", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037095", "code": "def _abbreviate(text, threshold):\n  \"\"\" Abbreviate the given text to threshold chars and append an ellipsis if its\n  length exceeds threshold; used for logging;\n\n  NOTE: the resulting text could be longer than threshold due to the ellipsis\n  \"\"\"\n  if text is not None and len(text) > threshold:\n    text = text[:threshold] + \"...\"\n\n  return text", "entry_point": "_abbreviate", "input": "'', 2.0", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/database/client_jobs_dao.py#L62-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037096", "code": "def _filterLikelihoods(likelihoods,\n                       redThreshold=0.99999, yellowThreshold=0.999):\n  \"\"\"\n  Filter the list of raw (pre-filtered) likelihoods so that we only preserve\n  sharp increases in likelihood. 'likelihoods' can be a numpy array of floats or\n  a list of floats.\n\n  :returns: A new list of floats likelihoods containing the filtered values.\n  \"\"\"\n  redThreshold    = 1.0 - redThreshold\n  yellowThreshold = 1.0 - yellowThreshold\n\n  # The first value is untouched\n  filteredLikelihoods = [likelihoods[0]]\n\n  for i, v in enumerate(likelihoods[1:]):\n\n    if v <= redThreshold:\n      # Value is in the redzone\n\n      if likelihoods[i] > redThreshold:\n        # Previous value is not in redzone, so leave as-is\n        filteredLikelihoods.append(v)\n      else:\n        filteredLikelihoods.append(yellowThreshold)\n\n    else:\n      # Value is below the redzone, so leave as-is\n      filteredLikelihoods.append(v)\n\n  return filteredLikelihoods", "entry_point": "_filterLikelihoods", "input": "[-1, 0, 1, 2], -1.5, 2.0", "output": "[-1, -1.0, -1.0, -1.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/anomaly_likelihood.py#L614-L644", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037097", "code": "def isValidEstimatorParams(p):\n  \"\"\"\n  :returns: ``True`` if ``p`` is a valid estimator params as might be returned\n    by ``estimateAnomalyLikelihoods()`` or ``updateAnomalyLikelihoods``,\n    ``False`` otherwise.  Just does some basic validation.\n  \"\"\"\n  if not isinstance(p, dict):\n    return False\n  if \"distribution\" not in p:\n    return False\n  if \"movingAverage\" not in p:\n    return False\n  dist = p[\"distribution\"]\n  if not (\"mean\" in dist and \"name\" in dist\n          and \"variance\" in dist and \"stdev\" in dist):\n    return False\n\n  return True", "entry_point": "isValidEstimatorParams", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/anomaly_likelihood.py#L767-L784", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037098", "code": "def _filterRecord(filterList, record):\n  \"\"\" Takes a record and returns true if record meets filter criteria,\n  false otherwise\n  \"\"\"\n\n  for (fieldIdx, fp, params) in filterList:\n    x = dict()\n    x['value'] = record[fieldIdx]\n    x['acceptValues'] = params['acceptValues']\n    x['min'] = params['min']\n    x['max'] = params['max']\n    if not fp(x):\n      return False\n\n  # None of the field filters triggered, accept the record as a good one\n  return True", "entry_point": "_filterRecord", "input": "[], ['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/aggregator.py#L114-L129", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037099", "code": "def _countOverlap(rep1, rep2):\n    \"\"\"\n    Return the overlap between two representations. rep1 and rep2 are lists of\n    non-zero indices.\n    \"\"\"\n    overlap = 0\n    for e in rep1:\n      if e in rep2:\n        overlap += 1\n    return overlap", "entry_point": "_countOverlap", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/random_distributed_scalar.py#L384-L393", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037100", "code": "def unhex(s):\n    \"\"\"Get the integer value of a hexadecimal number.\"\"\"\n    bits = 0\n    for c in s:\n        if '0' <= c <= '9':\n            i = ord('0')\n        elif 'a' <= c <= 'f':\n            i = ord('a')-10\n        elif 'A' <= c <= 'F':\n            i = ord('A')-10\n        else:\n            break\n        bits = bits*16 + (ord(c) - i)\n    return bits", "entry_point": "unhex", "input": "['a', 'b', 'c']", "output": "2748", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/quopri.py#L175-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037101", "code": "def round_to_nearest(x):\n  \"\"\"Python 3 style round:  round a float x to the nearest int, but\n  unlike the builtin Python 2.x round function:\n\n    - return an int, not a float\n    - do round-half-to-even, not round-half-away-from-zero.\n\n  We assume that x is finite and nonnegative; except wrong results\n  if you use this for negative x.\n\n  \"\"\"\n  int_part = int(x)\n  frac_part = x - int_part\n  if frac_part > 0.5 or frac_part == 0.5 and int_part & 1 == 1:\n    int_part += 1\n  return int_part", "entry_point": "round_to_nearest", "input": "0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/pypy/_struct.py#L144-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037102", "code": "def format_list(extracted_list):\n    \"\"\"Format a list of traceback entry tuples for printing.\n\n    Given a list of tuples as returned by extract_tb() or\n    extract_stack(), return a list of strings ready for printing.\n    Each string in the resulting list corresponds to the item with the\n    same index in the argument list.  Each string ends in a newline;\n    the strings may contain internal newlines as well, for those items\n    whose source text line is not None.\n    \"\"\"\n    list = []\n    for filename, lineno, name, line in extracted_list:\n        item = '  File \"%s\", line %d, in %s\\n' % (filename,lineno,name)\n        if line:\n            item = item + '    %s\\n' % line.strip()\n        list.append(item)\n    return list", "entry_point": "format_list", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/traceback.py#L27-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037103", "code": "def unquote(s):\n    \"\"\"Remove quotes from a string.\"\"\"\n    if len(s) > 1:\n        if s.startswith('\"') and s.endswith('\"'):\n            return s[1:-1].replace('\\\\\\\\', '\\\\').replace('\\\\\"', '\"')\n        if s.startswith('<') and s.endswith('>'):\n            return s[1:-1]\n    return s", "entry_point": "unquote", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/rfc822.py#L477-L484", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037104", "code": "def countOf(a, b):\n    \"Return the number of times b occurs in a.\"\n    count = 0\n    for i in a:\n        if i == b:\n            count += 1\n    return count", "entry_point": "countOf", "input": "['apple', 'banana', 'cherry'], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/ouroboros/operator.py#L153-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037105", "code": "def _count_leading(line, ch):\n    \"\"\"\n    Return number of `ch` characters at the start of `line`.\n\n    Example:\n\n    >>> _count_leading('   abc', ' ')\n    3\n    \"\"\"\n\n    i, n = 0, len(line)\n    while i < n and line[i] == ch:\n        i += 1\n    return i", "entry_point": "_count_leading", "input": "'AbC dEf', ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/difflib.py#L812-L825", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037106", "code": "def _format_range_context(start, stop):\n    'Convert range to the \"ed\" format'\n    # Per the diff spec at http://www.unix.org/single_unix_specification/\n    beginning = start + 1     # lines start numbering with one\n    length = stop - start\n    if not length:\n        beginning -= 1        # empty ranges begin at line just before the range\n    if length <= 1:\n        # return '{}'.format(beginning)\n        return '%s' % (beginning)\n    # return '{},{}'.format(beginning, beginning + length - 1)\n    return '%s,%s' % (beginning, beginning + length - 1)", "entry_point": "_format_range_context", "input": "7, -3", "output": "'8'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/difflib.py#L1297-L1308", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037107", "code": "def commonprefix(m):\n    \"Given a list of pathnames, returns the longest common leading component\"\n    if not m: return ''\n    s1 = min(m)\n    s2 = max(m)\n    for i, c in enumerate(s1):\n        if c != s2[i]:\n            return s1[:i]\n    return s1", "entry_point": "commonprefix", "input": "['a', 'b', 'c']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/stdlib/genericpath.py#L76-L84", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037108", "code": "def _bytelist2longBigEndian(list):\n    \"Transform a list of characters into a list of longs.\"\n\n    imax = len(list) // 4\n    hl = [0] * imax\n\n    j = 0\n    i = 0\n    while i < imax:\n        b0 = ord(list[j]) << 24\n        b1 = ord(list[j+1]) << 16\n        b2 = ord(list[j+2]) << 8\n        b3 = ord(list[j+3])\n        hl[i] = b0 | b1 | b2 | b3\n        i = i+1\n        j = j+4\n\n    return hl", "entry_point": "_bytelist2longBigEndian", "input": "['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/pypy/_sha.py#L64-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037109", "code": "def rlecode_hqx(s):\n    \"\"\"\n    Run length encoding for binhex4.\n    The CPython implementation does not do run length encoding\n    of \\x90 characters. This implementation does.\n    \"\"\"\n    if not s:\n        return ''\n    result = []\n    prev = s[0]\n    count = 1\n    # Add a dummy character to get the loop to go one extra round.\n    # The dummy must be different from the last character of s.\n    # In the same step we remove the first character, which has\n    # already been stored in prev.\n    if s[-1] == '!':\n        s = s[1:] + '?'\n    else:\n        s = s[1:] + '!'\n\n    for c in s:\n        if c == prev and count < 255:\n            count += 1\n        else:\n            if count == 1:\n                if prev != '\\x90':\n                    result.append(prev)\n                else:\n                    result += ['\\x90', '\\x00']\n            elif count < 4:\n                if prev != '\\x90':\n                    result += [prev] * count\n                else:\n                    result += ['\\x90', '\\x00'] * count\n            else:\n                if prev != '\\x90':\n                    result += [prev, '\\x90', chr(count)]\n                else:\n                    result += ['\\x90', '\\x00', '\\x90', chr(count)]\n            count = 1\n            prev = c\n\n    return ''.join(result)", "entry_point": "rlecode_hqx", "input": "set()", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/google/grumpy/blob/3ec87959189cfcdeae82eb68a47648ac25ceb10b/third_party/pypy/binascii.py#L540-L582", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037110", "code": "def prepare_kwargs(raw, string_parameter='name'):\n    \"\"\"\n    Utility method to convert raw string/diction input into a dictionary to pass\n    into a function.  Always returns a dictionary.\n\n    Args:\n        raw: string or dictionary, string is assumed to be the name of the activation\n                activation function.  Dictionary will be passed through unchanged.\n\n    Returns: kwargs dictionary for **kwargs\n\n    \"\"\"\n    kwargs = dict()\n\n    if isinstance(raw, dict):\n        kwargs.update(raw)\n    elif isinstance(raw, str):\n        kwargs[string_parameter] = raw\n\n    return kwargs", "entry_point": "prepare_kwargs", "input": "[-1, 0, 1, 2], 'a,b,c'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/util.py#L201-L220", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037111", "code": "def get_cluster_role_env(cluster_role_env):\n  \"\"\"Parse cluster/[role]/[environ], supply empty string, if not provided\"\"\"\n  parts = cluster_role_env.split('/')[:3]\n  if len(parts) == 3:\n    return (parts[0], parts[1], parts[2])\n\n  if len(parts) == 2:\n    return (parts[0], parts[1], \"\")\n\n  if len(parts) == 1:\n    return (parts[0], \"\", \"\")\n\n  return (\"\", \"\", \"\")", "entry_point": "get_cluster_role_env", "input": "'  padded  '", "output": "('  padded  ', '', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/utils/config.py#L311-L323", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037112", "code": "def parse_override_config(namespace):\n  \"\"\"Parse the command line for overriding the defaults\"\"\"\n  overrides = dict()\n  for config in namespace:\n    kv = config.split(\"=\")\n    if len(kv) != 2:\n      raise Exception(\"Invalid config property format (%s) expected key=value\" % config)\n    if kv[1] in ['true', 'True', 'TRUE']:\n      overrides[kv[0]] = True\n    elif kv[1] in ['false', 'False', 'FALSE']:\n      overrides[kv[0]] = False\n    else:\n      overrides[kv[0]] = kv[1]\n  return overrides", "entry_point": "parse_override_config", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/utils/config.py#L409-L422", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037113", "code": "def insert_bool(param, command_args):\n  '''\n  :param param:\n  :param command_args:\n  :return:\n  '''\n  index = 0\n  found = False\n  for lelem in command_args:\n    if lelem == '--' and not found:\n      break\n    if lelem == param:\n      found = True\n      break\n    index = index + 1\n\n  if found:\n    command_args.insert(index + 1, 'True')\n  return command_args", "entry_point": "insert_bool", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/utils/config.py#L491-L509", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037114", "code": "def filter_bolts(table, header):\n  \"\"\" filter to keep bolts \"\"\"\n  bolts_info = []\n  for row in table:\n    if row[0] == 'bolt':\n      bolts_info.append(row)\n  return bolts_info, header", "entry_point": "filter_bolts", "input": "{'x': [1, 2], 'y': []}, [5, 3, 1, 4]", "output": "([], [5, 3, 1, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/logicalplan.py#L92-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037115", "code": "def filter_spouts(table, header):\n  \"\"\" filter to keep spouts \"\"\"\n  spouts_info = []\n  for row in table:\n    if row[0] == 'spout':\n      spouts_info.append(row)\n  return spouts_info, header", "entry_point": "filter_spouts", "input": "{}, [1, 2, 3]", "output": "([], [1, 2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/logicalplan.py#L101-L107", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037116", "code": "def convert_args_dict_to_list(dict_extra_args):\n  \"\"\" flatten extra args \"\"\"\n  list_extra_args = []\n  if 'component_parallelism' in dict_extra_args:\n    list_extra_args += [\"--component_parallelism\",\n                        ','.join(dict_extra_args['component_parallelism'])]\n  if 'runtime_config' in dict_extra_args:\n    list_extra_args += [\"--runtime_config\",\n                        ','.join(dict_extra_args['runtime_config'])]\n  if 'container_number' in dict_extra_args:\n    list_extra_args += [\"--container_number\",\n                        ','.join(dict_extra_args['container_number'])]\n  if 'dry_run' in dict_extra_args and dict_extra_args['dry_run']:\n    list_extra_args += ['--dry_run']\n  if 'dry_run_format' in dict_extra_args:\n    list_extra_args += ['--dry_run_format', dict_extra_args['dry_run_format']]\n\n  return list_extra_args", "entry_point": "convert_args_dict_to_list", "input": "{'a': 1, 'b': 2}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/cli/src/python/update.py#L142-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037117", "code": "def _sanitize_config(custom_config):\n    \"\"\"Checks whether ``custom_config`` is sane and returns a sanitized dict <str -> (str|object)>\n\n    It checks if keys are all strings and sanitizes values of a given dictionary as follows:\n\n    - If string, number or boolean is given as a value, it is converted to string.\n      For string and number (int, float), it is converted to string by a built-in ``str()`` method.\n      For a boolean value, ``True`` is converted to \"true\" instead of \"True\", and ``False`` is\n      converted to \"false\" instead of \"False\", in order to keep the consistency with\n      Java configuration.\n\n    - If neither of the above is given as a value, it is inserted into the sanitized dict as it is.\n      These values will need to be serialized before adding to a protobuf message.\n    \"\"\"\n    if not isinstance(custom_config, dict):\n      raise TypeError(\"Component-specific configuration must be given as a dict type, given: %s\"\n                      % str(type(custom_config)))\n    sanitized = {}\n    for key, value in custom_config.items():\n      if not isinstance(key, str):\n        raise TypeError(\"Key for component-specific configuration must be string, given: %s:%s\"\n                        % (str(type(key)), str(key)))\n\n      if isinstance(value, bool):\n        sanitized[key] = \"true\" if value else \"false\"\n      elif isinstance(value, (str, int, float)):\n        sanitized[key] = str(value)\n      else:\n        sanitized[key] = value\n\n    return sanitized", "entry_point": "_sanitize_config", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L134-L164", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037118", "code": "def IsCppString(line):\n  \"\"\"Does line terminate so, that the next symbol is in string constant.\n\n  This function does not consider single-line nor multi-line comments.\n\n  Args:\n    line: is a partial line of code starting from the 0..n.\n\n  Returns:\n    True, if next character appended to 'line' is inside a\n    string constant.\n  \"\"\"\n\n  line = line.replace(r'\\\\', 'XX')  # after this, \\\\\" does not match to \\\"\n  return ((line.count('\"') - line.count(r'\\\"') - line.count(\"'\\\"'\")) & 1) == 1", "entry_point": "IsCppString", "input": "'  padded  '", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1441-L1455", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037119", "code": "def FindNextMultiLineCommentStart(lines, lineix):\n  \"\"\"Find the beginning marker for a multiline comment.\"\"\"\n  while lineix < len(lines):\n    if lines[lineix].strip().startswith('/*'):\n      # Only return this marker if the comment goes beyond this line\n      if lines[lineix].strip().find('*/', 2) < 0:\n        return lineix\n    lineix += 1\n  return len(lines)", "entry_point": "FindNextMultiLineCommentStart", "input": "(), True", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1534-L1542", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037120", "code": "def FindNextMultiLineCommentEnd(lines, lineix):\n  \"\"\"We are inside a comment, find the end marker.\"\"\"\n  while lineix < len(lines):\n    if lines[lineix].strip().endswith('*/'):\n      return lineix\n    lineix += 1\n  return len(lines)", "entry_point": "FindNextMultiLineCommentEnd", "input": "set(), 3.25", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1545-L1551", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037121", "code": "def is_empty_object(n, last):\n    \"\"\"n may be the inside of block or object\"\"\"\n    if n.strip():\n        return False\n    # seems to be but can be empty code\n    last = last.strip()\n    markers = {\n        ')',\n        ';',\n    }\n    if not last or last[-1] in markers:\n        return False\n    return True", "entry_point": "is_empty_object", "input": "'a,b,c', (1, 2)", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/PiotrDabkowski/Js2Py/blob/c0fa43f5679cf91ca8986c5747fcb07a433dc584/js2py/legecy_translators/objects.py#L23-L35", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037122", "code": "def _ensure_regexp(source, n):  #<- this function has to be improved\n    '''returns True if regexp starts at n else returns False\n      checks whether it is not a division '''\n    markers = '(+~\"\\'=[%:?!*^|&-,;/\\\\'\n    k = 0\n    while True:\n        k += 1\n        if n - k < 0:\n            return True\n        char = source[n - k]\n        if char in markers:\n            return True\n        if char != ' ' and char != '\\n':\n            break\n    return False", "entry_point": "_ensure_regexp", "input": "{'a': 1, 'b': 2}, 0.5", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/PiotrDabkowski/Js2Py/blob/c0fa43f5679cf91ca8986c5747fcb07a433dc584/js2py/legecy_translators/constants.py#L28-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037123", "code": "def parse_num(source, start, charset):\n    \"\"\"Returns a first index>=start of chat not in charset\"\"\"\n    while start < len(source) and source[start] in charset:\n        start += 1\n    return start", "entry_point": "parse_num", "input": "{}, 5, set()", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/PiotrDabkowski/Js2Py/blob/c0fa43f5679cf91ca8986c5747fcb07a433dc584/js2py/legecy_translators/constants.py#L45-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037124", "code": "def _normalize(c):\n    \"\"\"\n    Convert a byte-like value into a canonical byte (a value of type 'bytes' of len 1)\n\n    :param c:\n    :return:\n    \"\"\"\n    if isinstance(c, int):\n        return bytes([c])\n    elif isinstance(c, str):\n        return bytes([ord(c)])\n    else:\n        return c", "entry_point": "_normalize", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/trailofbits/manticore/blob/54c5a15b1119c523ae54c09972413e8b97f11629/manticore/native/memory.py#L71-L83", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037125", "code": "def hr_size(num, suffix='B') -> str:\n    \"\"\"\n    Human-readable data size\n    From https://stackoverflow.com/a/1094933\n    :param num: number of bytes\n    :param suffix: Optional size specifier\n    :return: Formatted string\n    \"\"\"\n    for unit in ' KMGTPEZ':\n        if abs(num) < 1024.0:\n            return \"%3.1f%s%s\" % (num, unit if unit != ' ' else '', suffix)\n        num /= 1024.0\n    return \"%.1f%s%s\" % (num, 'Y', suffix)", "entry_point": "hr_size", "input": "0, 'a,b,c'", "output": "'0.0a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/trailofbits/manticore/blob/54c5a15b1119c523ae54c09972413e8b97f11629/manticore/utils/emulate.py#L36-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037126", "code": "def _dict_diff(d1, d2):\n    \"\"\"\n    Produce a dict that includes all the keys in d2 that represent different values in d1, as well as values that\n    aren't in d1.\n\n    :param dict d1: First dict\n    :param dict d2: Dict to compare with\n    :rtype: dict\n    \"\"\"\n    d = {}\n    for key in set(d1).intersection(set(d2)):\n        if d2[key] != d1[key]:\n            d[key] = d2[key]\n    for key in set(d2).difference(set(d1)):\n        d[key] = d2[key]\n    return d", "entry_point": "_dict_diff", "input": "[], [-1, 0, 1, 2]", "output": "{0: -1, 1: 0, 2: 1, -1: 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/trailofbits/manticore/blob/54c5a15b1119c523ae54c09972413e8b97f11629/manticore/core/plugin.py#L45-L60", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037127", "code": "def _compare_node_lists(old, new):\n    '''\n    Investigate two lists of workflow TreeNodes and categorize them.\n\n    There will be three types of nodes after categorization:\n        1. Nodes that only exists in the new list. These nodes will later be\n        created recursively.\n        2. Nodes that only exists in the old list. These nodes will later be\n        deleted recursively.\n        3. Node pairs that makes an exact match. These nodes will be further\n        investigated.\n\n    Corresponding nodes of old and new lists will be distinguished by their\n    unified_job_template value. A special case is that both the old and the new\n    lists contain one type of node, say A, and at least one of them contains\n    duplicates. In this case all A nodes in the old list will be categorized as\n    to-be-deleted and all A nodes in the new list will be categorized as\n    to-be-created.\n    '''\n    to_expand = []\n    to_delete = []\n    to_recurse = []\n    old_records = {}\n    new_records = {}\n    for tree_node in old:\n        old_records.setdefault(tree_node.unified_job_template, [])\n        old_records[tree_node.unified_job_template].append(tree_node)\n    for tree_node in new:\n        new_records.setdefault(tree_node.unified_job_template, [])\n        new_records[tree_node.unified_job_template].append(tree_node)\n    for ujt_id in old_records:\n        if ujt_id not in new_records:\n            to_delete.extend(old_records[ujt_id])\n            continue\n        old_list = old_records[ujt_id]\n        new_list = new_records.pop(ujt_id)\n        if len(old_list) == 1 and len(new_list) == 1:\n            to_recurse.append((old_list[0], new_list[0]))\n        else:\n            to_delete.extend(old_list)\n            to_expand.extend(new_list)\n    for nodes in new_records.values():\n        to_expand.extend(nodes)\n    return to_expand, to_delete, to_recurse", "entry_point": "_compare_node_lists", "input": "{}, set()", "output": "([], [], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ansible/tower-cli/blob/a2b151fed93c47725018d3034848cb3a1814bed7/tower_cli/resources/workflow.py#L87-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037128", "code": "def _rectify_countdown_or_bool(count_or_bool):\n    \"\"\"\n    used by recursive functions to specify which level to turn a bool on in\n    counting down yields True, True, ..., False\n    counting up yields False, False, False, ... True\n\n    Args:\n        count_or_bool (bool or int): if positive and an integer, it will count\n            down, otherwise it will remain the same.\n\n    Returns:\n        int or bool: count_or_bool_\n\n    CommandLine:\n        python -m utool.util_str --test-_rectify_countdown_or_bool\n\n    Example:\n        >>> from ubelt.util_format import _rectify_countdown_or_bool  # NOQA\n        >>> count_or_bool = True\n        >>> a1 = (_rectify_countdown_or_bool(2))\n        >>> a2 = (_rectify_countdown_or_bool(1))\n        >>> a3 = (_rectify_countdown_or_bool(0))\n        >>> a4 = (_rectify_countdown_or_bool(-1))\n        >>> a5 = (_rectify_countdown_or_bool(-2))\n        >>> a6 = (_rectify_countdown_or_bool(True))\n        >>> a7 = (_rectify_countdown_or_bool(False))\n        >>> a8 = (_rectify_countdown_or_bool(None))\n        >>> result = [a1, a2, a3, a4, a5, a6, a7, a8]\n        >>> print(result)\n        [1, 0, 0, -1, -2, True, False, False]\n    \"\"\"\n    if count_or_bool is True or count_or_bool is False:\n        count_or_bool_ = count_or_bool\n    elif isinstance(count_or_bool, int):\n        if count_or_bool == 0:\n            return 0\n        elif count_or_bool > 0:\n            count_or_bool_ = count_or_bool - 1\n        else:\n            # We dont countup negatives anymore\n            count_or_bool_ = count_or_bool\n    else:\n        count_or_bool_ = False\n    return count_or_bool_", "entry_point": "_rectify_countdown_or_bool", "input": "-3", "output": "-3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Erotemic/ubelt/blob/db802f3ad8abba025db74b54f86e6892b8927325/ubelt/util_format.py#L713-L756", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037129", "code": "def isHcl(s):\n    '''\n        Detects whether a string is JSON or HCL\n        \n        :param s: String that may contain HCL or JSON\n        \n        :returns: True if HCL, False if JSON, raises ValueError\n                  if neither\n    '''\n    for c in s:\n        if c.isspace():\n            continue\n\n        if c == '{':\n            return False\n        else:\n            return True\n\n    raise ValueError(\"No HCL object could be decoded\")", "entry_point": "isHcl", "input": "['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/virtuald/pyhcl/blob/e6e27742215692974f0ef503a91a81ec4adc171c/src/hcl/api.py#L24-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037130", "code": "def create_model_path(model_path):\n    \"\"\"\n    Creates a path to model files\n    model_path - string\n    \"\"\"\n    if not model_path.startswith(\"/\") and not model_path.startswith(\"models/\"):\n        model_path=\"/\" + model_path\n    if not model_path.startswith(\"models\"):\n        model_path = \"models\" + model_path\n    if not model_path.endswith(\".p\"):\n        model_path+=\".p\"\n\n    return model_path", "entry_point": "create_model_path", "input": "'  padded  '", "output": "'models/  padded  .p'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/ease/blob/a7890ed403da94d03726b0639cd8ebda45af6bbb/ease/util_functions.py#L36-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037131", "code": "def f7(seq):\n    \"\"\"\n    Makes a list unique\n    \"\"\"\n    seen = set()\n    seen_add = seen.add\n    return [x for x in seq if x not in seen and not seen_add(x)]", "entry_point": "f7", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/ease/blob/a7890ed403da94d03726b0639cd8ebda45af6bbb/ease/util_functions.py#L159-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037132", "code": "def count_list(the_list):\n    \"\"\"\n    Generates a count of the number of times each unique item appears in a list\n    \"\"\"\n    count = the_list.count\n    result = [(item, count(item)) for item in set(the_list)]\n    result.sort()\n    return result", "entry_point": "count_list", "input": "[1, 2, 3]", "output": "[(1, 1), (2, 1), (3, 1)]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/ease/blob/a7890ed403da94d03726b0639cd8ebda45af6bbb/ease/util_functions.py#L168-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037133", "code": "def calc_list_average(l):\n    \"\"\"\n    Calculates the average value of a list of numbers\n    Returns a float\n    \"\"\"\n    total = 0.0\n    for value in l:\n        total += value\n    return total / len(l)", "entry_point": "calc_list_average", "input": "[1, 2, 3]", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/ease/blob/a7890ed403da94d03726b0639cd8ebda45af6bbb/ease/util_functions.py#L333-L341", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037134", "code": "def escape(data, quote=True):  # stoled from std lib cgi\n  '''\n  Escapes special characters into their html entities\n  Replace special characters \"&\", \"<\" and \">\" to HTML-safe sequences.\n  If the optional flag quote is true, the quotation mark character (\")\n  is also translated.\n\n  This is used to escape content that appears in the body of an HTML cocument\n  '''\n  data = data.replace(\"&\", \"&amp;\")  # Must be done first!\n  data = data.replace(\"<\", \"&lt;\")\n  data = data.replace(\">\", \"&gt;\")\n  if quote:\n    data = data.replace('\"', \"&quot;\")\n  return data", "entry_point": "escape", "input": "'a,b,c', 1", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Knio/dominate/blob/1eb88f9fd797658eef83568a548e2ef9b546807d/dominate/util.py#L54-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037135", "code": "def clean_attribute(attribute):\n    '''\n    Normalize attribute names for shorthand and work arounds for limitations\n    in Python's syntax\n    '''\n\n    # Shorthand\n    attribute = {\n      'cls': 'class',\n      'className': 'class',\n      'class_name': 'class',\n      'fr': 'for',\n      'html_for': 'for',\n      'htmlFor': 'for',\n    }.get(attribute, attribute)\n\n    # Workaround for Python's reserved words\n    if attribute[0] == '_':\n      attribute = attribute[1:]\n\n    # Workaround for dash\n    if attribute in set(['http_equiv']) or attribute.startswith('data_'):\n      attribute = attribute.replace('_', '-').lower()\n\n    # Workaround for colon\n    if attribute.split('_')[0] in ('xlink', 'xml', 'xmlns'):\n      attribute = attribute.replace('_', ':', 1).lower()\n\n    return attribute", "entry_point": "clean_attribute", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Knio/dominate/blob/1eb88f9fd797658eef83568a548e2ef9b546807d/dominate/dom_tag.py#L382-L410", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037136", "code": "def istype(obj, check):\n    \"\"\"Like isinstance(obj, check), but strict.\n\n    This won't catch subclasses.\n    \"\"\"\n    if isinstance(check, tuple):\n        for cls in check:\n            if type(obj) is cls:\n                return True\n        return False\n    else:\n        return type(obj) is check", "entry_point": "istype", "input": "[5, 3, 1, 4], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L323-L334", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037137", "code": "def rgb2gray(image_rgb_array):\r\n    \"\"\"!\r\n    @brief Returns image as 1-dimension (gray colored) matrix, where one element of list describes pixel.\r\n    @details Luma coding is used for transformation and that is calculated directly from gamma-compressed primary intensities as a weighted sum:\r\n    \r\n    \\f[Y = 0.2989R + 0.587G + 0.114B\\f]\r\n    \r\n    @param[in] image_rgb_array (list): Image represented by RGB list.\r\n    \r\n    @return (list) Image as gray colored matrix, where one element of list describes pixel.\r\n    \r\n    @code\r\n        colored_image = read_image(file_name);\r\n        gray_image = rgb2gray(colored_image);\r\n    @endcode\r\n    \r\n    @see read_image()\r\n    \r\n    \"\"\"\r\n    \r\n    image_gray_array = [0.0] * len(image_rgb_array);\r\n    for index in range(0, len(image_rgb_array), 1):\r\n        image_gray_array[index] = float(image_rgb_array[index][0]) * 0.2989 + float(image_rgb_array[index][1]) * 0.5870 + float(image_rgb_array[index][2]) * 0.1140;\r\n    \r\n    return image_gray_array;", "entry_point": "rgb2gray", "input": "set()", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L107-L131", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037138", "code": "def euclidean_distance_square(a, b):\r\n    \"\"\"!\r\n    @brief Calculate square Euclidian distance between vector a and b.\r\n    \r\n    @param[in] a (list): The first vector.\r\n    @param[in] b (list): The second vector.\r\n    \r\n    @return (double) Square Euclidian distance between two vectors.\r\n    \r\n    \"\"\"  \r\n    \r\n    if ( ((type(a) == float) and (type(b) == float)) or ((type(a) == int) and (type(b) == int)) ):\r\n        return (a - b)**2.0;\r\n    \r\n    distance = 0.0;\r\n    for i in range(0, len(a)):\r\n        distance += (a[i] - b[i])**2.0;\r\n        \r\n    return distance;", "entry_point": "euclidean_distance_square", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "12.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L307-L325", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037139", "code": "def manhattan_distance(a, b):\r\n    \"\"\"!\r\n    @brief Calculate Manhattan distance between vector a and b.\r\n    \r\n    @param[in] a (list): The first cluster.\r\n    @param[in] b (list): The second cluster.\r\n    \r\n    @return (double) Manhattan distance between two vectors.\r\n    \r\n    \"\"\"\r\n    \r\n    if ( ((type(a) == float) and (type(b) == float)) or ((type(a) == int) and (type(b) == int)) ):\r\n        return abs(a - b);\r\n    \r\n    distance = 0.0;\r\n    dimension = len(a);\r\n    \r\n    for i in range(0, dimension):\r\n        distance += abs(a[i] - b[i]);\r\n    \r\n    return distance;", "entry_point": "manhattan_distance", "input": "[], ['a', 'b', 'c']", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L328-L348", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037140", "code": "def norm_vector(vector):\r\n    \"\"\"!\r\n    @brief Calculates norm of an input vector that is known as a vector length.\r\n    \r\n    @param[in] vector (list): The input vector whose length is calculated.\r\n    \r\n    @return (double) vector norm known as vector length.\r\n    \r\n    \"\"\"\r\n    \r\n    length = 0.0\r\n    for component in vector:\r\n        length += component * component\r\n    \r\n    length = length ** 0.5\r\n    \r\n    return length", "entry_point": "norm_vector", "input": "[5, 3, 1, 4]", "output": "7.14142842854285", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L558-L574", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037141", "code": "def linear_sum(list_vector):\r\n    \"\"\"!\r\n    @brief Calculates linear sum of vector that is represented by list, each element can be represented by list - multidimensional elements.\r\n    \r\n    @param[in] list_vector (list): Input vector.\r\n    \r\n    @return (list|double) Linear sum of vector that can be represented by list in case of multidimensional elements.\r\n    \r\n    \"\"\"\r\n    dimension = 1;\r\n    linear_sum = 0.0;\r\n    list_representation = (type(list_vector[0]) == list);\r\n    \r\n    if (list_representation is True):\r\n        dimension = len(list_vector[0]);\r\n        linear_sum = [0] * dimension;\r\n        \r\n    for index_element in range(0, len(list_vector)):\r\n        if (list_representation is True):\r\n            for index_dimension in range(0, dimension):\r\n                linear_sum[index_dimension] += list_vector[index_element][index_dimension];\r\n        else:\r\n            linear_sum += list_vector[index_element];\r\n\r\n    return linear_sum;", "entry_point": "linear_sum", "input": "[5, 3, 1, 4]", "output": "13.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1153-L1177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037142", "code": "def list_math_subtraction(a, b):\r\n    \"\"\"!\r\n    @brief Calculates subtraction of two lists.\r\n    @details Each element from list 'a' is subtracted by element from list 'b' accordingly.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematical subtraction.\r\n    @param[in] b (list): List of elements that supports mathematical subtraction.\r\n    \r\n    @return (list) Results of subtraction of two lists.\r\n    \r\n    \"\"\"\r\n    return [a[i] - b[i] for i in range(len(a))];", "entry_point": "list_math_subtraction", "input": "(), True", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1202-L1213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037143", "code": "def list_math_substraction_number(a, b):\r\n    \"\"\"!\r\n    @brief Calculates subtraction between list and number.\r\n    @details Each element from list 'a' is subtracted by number 'b'.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematical subtraction.\r\n    @param[in] b (list): Value that supports mathematical subtraction.\r\n    \r\n    @return (list) Results of subtraction between list and number.\r\n    \r\n    \"\"\"        \r\n    return [a[i] - b for i in range(len(a))];", "entry_point": "list_math_substraction_number", "input": "set(), 0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1216-L1227", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037144", "code": "def list_math_addition(a, b):\r\n    \"\"\"!\r\n    @brief Addition of two lists.\r\n    @details Each element from list 'a' is added to element from list 'b' accordingly.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematic addition..\r\n    @param[in] b (list): List of elements that supports mathematic addition..\r\n    \r\n    @return (list) Results of addtion of two lists.\r\n    \r\n    \"\"\"    \r\n    return [a[i] + b[i] for i in range(len(a))];", "entry_point": "list_math_addition", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1230-L1241", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037145", "code": "def list_math_addition_number(a, b):\r\n    \"\"\"!\r\n    @brief Addition between list and number.\r\n    @details Each element from list 'a' is added to number 'b'.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematic addition.\r\n    @param[in] b (double): Value that supports mathematic addition.\r\n    \r\n    @return (list) Result of addtion of two lists.\r\n    \r\n    \"\"\"    \r\n    return [a[i] + b for i in range(len(a))];", "entry_point": "list_math_addition_number", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1244-L1255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037146", "code": "def list_math_division(a, b):\r\n    \"\"\"!\r\n    @brief Division of two lists.\r\n    @details Each element from list 'a' is divided by element from list 'b' accordingly.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematic division.\r\n    @param[in] b (list): List of elements that supports mathematic division.\r\n    \r\n    @return (list) Result of division of two lists.\r\n    \r\n    \"\"\"    \r\n    return [a[i] / b[i] for i in range(len(a))];", "entry_point": "list_math_division", "input": "{}, True", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1272-L1283", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037147", "code": "def list_math_multiplication_number(a, b):\r\n    \"\"\"!\r\n    @brief Multiplication between list and number.\r\n    @details Each element from list 'a' is multiplied by number 'b'.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematic division.\r\n    @param[in] b (double): Number that supports mathematic division.\r\n    \r\n    @return (list) Result of division between list and number.\r\n    \r\n    \"\"\"    \r\n    return [a[i] * b for i in range(len(a))];", "entry_point": "list_math_multiplication_number", "input": "[-1, 0, 1, 2], []", "output": "[[], [], [], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1286-L1297", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037148", "code": "def list_math_multiplication(a, b):\r\n    \"\"\"!\r\n    @brief Multiplication of two lists.\r\n    @details Each element from list 'a' is multiplied by element from list 'b' accordingly.\r\n    \r\n    @param[in] a (list): List of elements that supports mathematic multiplication.\r\n    @param[in] b (list): List of elements that supports mathematic multiplication.\r\n    \r\n    @return (list) Result of multiplication of elements in two lists.\r\n    \r\n    \"\"\"        \r\n    return [a[i] * b[i] for i in range(len(a))];", "entry_point": "list_math_multiplication", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/__init__.py#L1300-L1311", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037149", "code": "def euclidean_distance_square(point1, point2):\r\n    \"\"\"!\r\n    @brief Calculate square Euclidean distance between two vectors.\r\n\r\n    \\f[\r\n    dist(a, b) = \\sum_{i=0}^{N}(a_{i} - b_{i})^{2};\r\n    \\f]\r\n\r\n    @param[in] point1 (array_like): The first vector.\r\n    @param[in] point2 (array_like): The second vector.\r\n\r\n    @return (double) Square Euclidean distance between two vectors.\r\n\r\n    @see euclidean_distance, manhattan_distance, chebyshev_distance\r\n\r\n    \"\"\"\r\n    distance = 0.0\r\n    for i in range(len(point1)):\r\n        distance += (point1[i] - point2[i]) ** 2.0\r\n\r\n    return distance", "entry_point": "euclidean_distance_square", "input": "[], [[1, 2], [3], []]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/metric.py#L315-L335", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037150", "code": "def manhattan_distance(point1, point2):\r\n    \"\"\"!\r\n    @brief Calculate Manhattan distance between between two vectors.\r\n\r\n    \\f[\r\n    dist(a, b) = \\sum_{i=0}^{N}\\left | a_{i} - b_{i} \\right |;\r\n    \\f]\r\n\r\n    @param[in] point1 (array_like): The first vector.\r\n    @param[in] point2 (array_like): The second vector.\r\n\r\n    @return (double) Manhattan distance between two vectors.\r\n\r\n    @see euclidean_distance_square, euclidean_distance, chebyshev_distance\r\n\r\n    \"\"\"\r\n    distance = 0.0\r\n    dimension = len(point1)\r\n\r\n    for i in range(dimension):\r\n        distance += abs(point1[i] - point2[i])\r\n\r\n    return distance", "entry_point": "manhattan_distance", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "11.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/metric.py#L351-L373", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037151", "code": "def chebyshev_distance(point1, point2):\r\n    \"\"\"!\r\n    @brief Calculate Chebyshev distance between between two vectors.\r\n\r\n    \\f[\r\n    dist(a, b) = \\max_{}i\\left (\\left | a_{i} - b_{i} \\right |\\right );\r\n    \\f]\r\n\r\n    @param[in] point1 (array_like): The first vector.\r\n    @param[in] point2 (array_like): The second vector.\r\n\r\n    @return (double) Chebyshev distance between two vectors.\r\n\r\n    @see euclidean_distance_square, euclidean_distance, minkowski_distance\r\n\r\n    \"\"\"\r\n    distance = 0.0\r\n    dimension = len(point1)\r\n\r\n    for i in range(dimension):\r\n        distance = max(distance, abs(point1[i] - point2[i]))\r\n\r\n    return distance", "entry_point": "chebyshev_distance", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/metric.py#L389-L411", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037152", "code": "def chi_square_distance(point1, point2):\r\n    \"\"\"!\r\n    @brief Calculate Chi square distance between two vectors.\r\n\r\n    \\f[\r\n    dist(a, b) = \\sum_{i=0}^{N}\\frac{\\left ( a_{i} - b_{i} \\right )^{2}}{\\left | a_{i} \\right | + \\left | b_{i} \\right |};\r\n    \\f]\r\n\r\n    @param[in] point1 (array_like): The first vector.\r\n    @param[in] point2 (array_like): The second vector.\r\n\r\n    @return (float) Chi square distance between two objects.\r\n\r\n    \"\"\"\r\n    distance = 0.0\r\n    for i in range(len(point1)):\r\n        divider = abs(point1[i]) + abs(point2[i])\r\n        if divider == 0.0:\r\n            continue\r\n\r\n        distance += ((point1[i] - point2[i]) ** 2.0) / divider\r\n\r\n    return distance", "entry_point": "chi_square_distance", "input": "[], []", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/metric.py#L509-L531", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037153", "code": "def __get_start_stop_iterations(sync_output_dynamic, start_iteration, stop_iteration):\r\n        \"\"\"!\r\n        @brief Apply rule of preparation for start iteration and stop iteration values.\r\n        \r\n        @param[in] sync_output_dynamic (sync_dynamic): Output dynamic of the Sync network.\r\n        @param[in] start_iteration (uint): The first iteration that is used for calculation.\r\n        @param[in] stop_iteration (uint): The last iteration that is used for calculation.\r\n        \r\n        @return (tuple) New values of start and stop iterations.\r\n        \r\n        \"\"\"\r\n        if (start_iteration is None):\r\n            start_iteration = 0;\r\n        \r\n        if (stop_iteration is None):\r\n            stop_iteration = len(sync_output_dynamic);\r\n        \r\n        return (start_iteration, stop_iteration);", "entry_point": "__get_start_stop_iterations", "input": "[1, 2, 3], -1.5, 3.25", "output": "(-1.5, 3.25)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/sync.py#L657-L674", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037154", "code": "def fix_microsoft (foo):\n    \"\"\"\n    fix special case for `c#`, `f#`, etc.; thanks Microsoft\n    \"\"\"\n    i = 0\n    bar = []\n\n    while i < len(foo):\n        text, lemma, pos, tag = foo[i]\n\n        if (text == \"#\") and (i > 0):\n            prev_tok = bar[-1]\n\n            prev_tok[0] += \"#\"\n            prev_tok[1] += \"#\"\n\n            bar[-1] = prev_tok\n        else:\n            bar.append(foo[i])\n\n        i += 1\n\n    return bar", "entry_point": "fix_microsoft", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DerwenAI/pytextrank/blob/181ea41375d29922eb96768cf6550e57a77a0c95/pytextrank/pytextrank.py#L126-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037155", "code": "def fix_hypenation (foo):\n    \"\"\"\n    fix hyphenation in the word list for a parsed sentence\n    \"\"\"\n    i = 0\n    bar = []\n\n    while i < len(foo):\n        text, lemma, pos, tag = foo[i]\n\n        if (tag == \"HYPH\") and (i > 0) and (i < len(foo) - 1):\n            prev_tok = bar[-1]\n            next_tok = foo[i + 1]\n\n            prev_tok[0] += \"-\" + next_tok[0]\n            prev_tok[1] += \"-\" + next_tok[1]\n\n            bar[-1] = prev_tok\n            i += 2\n        else:\n            bar.append(foo[i])\n            i += 1\n\n    return bar", "entry_point": "fix_hypenation", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DerwenAI/pytextrank/blob/181ea41375d29922eb96768cf6550e57a77a0c95/pytextrank/pytextrank.py#L151-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037156", "code": "def make_sentence (sent_text):\n    \"\"\"\n    construct a sentence text, with proper spacing\n    \"\"\"\n    lex = []\n    idx = 0\n\n    for word in sent_text:\n        if len(word) > 0:\n            if (idx > 0) and not (word[0] in \",.:;!?-\\\"'\"):\n                lex.append(\" \")\n\n            lex.append(word)\n\n        idx += 1\n\n    return \"\".join(lex)", "entry_point": "make_sentence", "input": "'walnut thistle harbour'", "output": "'w a l n u t   t h i s t l e   h a r b o u r'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DerwenAI/pytextrank/blob/181ea41375d29922eb96768cf6550e57a77a0c95/pytextrank/pytextrank.py#L761-L777", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037157", "code": "def _is_string(value):\n        \"\"\"\n            Checks if the value provided is a string (True) or not integer\n            (False) or something else (None).\n        \"\"\"\n        if type(value) in [type(u''), type('')]:\n            return True\n        elif type(value) in [int, type(2 ** 64)]:\n            return False\n        else:\n            return None", "entry_point": "_is_string", "input": "3", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/koalalorenzo/python-digitalocean/blob/d0221b57856fb1e131cafecf99d826f7b07a947c/digitalocean/Image.py#L81-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037158", "code": "def merge_dictionary(dst, src):\n    \"\"\"Recursive merge two dicts (vs .update which overwrites the hashes at the\n    root level)\n\n    Note: This updates dst.\n    Copied from checkmate.utils\n    \"\"\"\n    stack = [(dst, src)]\n    while stack:\n        current_dst, current_src = stack.pop()\n        for key in current_src:\n            source = current_src[key]\n            if key not in current_dst:\n                current_dst[key] = source\n            else:\n                dest = current_dst[key]\n                if isinstance(source, dict) and isinstance(dest, dict):\n                    stack.append((dest, source))\n                elif isinstance(source, list) and isinstance(dest, list):\n                    # Make them the same size\n                    r = dest[:]\n                    s = source[:]\n                    if len(dest) > len(source):\n                        s.append([None for i in range(len(dest) -\n                                                      len(source))])\n                    elif len(dest) < len(source):\n                        r.append([None for i in range(len(source) -\n                                                      len(dest))])\n                    # Merge lists\n                    for index, value in enumerate(r):\n                        if (not value) and s[index]:\n                            r[index] = s[index]\n                        elif isinstance(value, dict) and \\\n                                isinstance(s[index], dict):\n                            stack.append((dest[index], source[index]))\n                        else:\n                            dest[index] = s[index]\n                    current_dst[key] = r\n                else:\n                    current_dst[key] = source\n    return dst", "entry_point": "merge_dictionary", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/knipknap/SpiffWorkflow/blob/f0af7f59a332e0619e4f3c00a7d4a3d230760e00/SpiffWorkflow/util/__init__.py#L6-L46", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037159", "code": "def get_creds_from_kwargs(kwargs):\n    \"\"\"Helper to get creds out of kwargs.\"\"\"\n    creds = {\n        'key_file': kwargs.pop('key_file', None),\n        'http_auth': kwargs.pop('http_auth', None),\n        'project': kwargs.get('project', None),\n        'user_agent': kwargs.pop('user_agent', None),\n        'api_version': kwargs.pop('api_version', 'v1')\n    }\n    return (creds, kwargs)", "entry_point": "get_creds_from_kwargs", "input": "{'x': [1, 2], 'y': []}", "output": "({'key_file': None, 'http_auth': None, 'project': None, 'user_agent': None, 'api_version': 'v1'}, {'x': [1, 2], 'y': []})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Netflix-Skunkworks/cloudaux/blob/c4b0870c3ac68b1c69e71d33cf78b6a8bdf437ea/cloudaux/gcp/utils.py#L14-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037160", "code": "def rewrite_kwargs(conn_type, kwargs, module_name=None):\n    \"\"\"\n    Manipulate connection keywords.\n    \n    Modifieds keywords based on connection type.\n\n    There is an assumption here that the client has\n    already been created and that these keywords are being\n    passed into methods for interacting with various services.\n\n    Current modifications:\n    - if conn_type is not cloud and module is 'compute', \n      then rewrite project as name.\n    - if conn_type is cloud and module is 'storage',\n      then remove 'project' from dict.\n\n    :param conn_type: E.g. 'cloud' or 'general'\n    :type conn_type: ``str``\n\n    :param kwargs: Dictionary of keywords sent in by user.\n    :type kwargs: ``dict``\n\n    :param module_name: Name of specific module that will be loaded.\n                        Default is None.\n    :type conn_type: ``str`` or None\n\n    :returns kwargs with client and module specific changes\n    :rtype: ``dict``\n    \"\"\"\n    if conn_type != 'cloud' and module_name != 'compute':\n        if 'project' in kwargs:\n            kwargs['name'] = 'projects/%s' % kwargs.pop('project')\n    if conn_type == 'cloud' and module_name == 'storage':\n        if 'project' in kwargs:\n            del kwargs['project']\n    return kwargs", "entry_point": "rewrite_kwargs", "input": "['a', 'b', 'c'], {}, 'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Netflix-Skunkworks/cloudaux/blob/c4b0870c3ac68b1c69e71d33cf78b6a8bdf437ea/cloudaux/gcp/utils.py#L26-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037161", "code": "def _modify(item, func):\n    \"\"\"\n    Modifies each item.keys() string based on the func passed in.\n    Often used with inflection's camelize or underscore methods.\n\n    :param item: dictionary representing item to be modified\n    :param func: function to run on each key string\n    :return: dictionary where each key has been modified by func.\n    \"\"\"\n    result = dict()\n    for key in item:\n        result[func(key)] = item[key]\n    return result", "entry_point": "_modify", "input": "[], 'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Netflix-Skunkworks/cloudaux/blob/c4b0870c3ac68b1c69e71d33cf78b6a8bdf437ea/cloudaux/orchestration/__init__.py#L4-L16", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037162", "code": "def pop_path(path):\n    \"\"\"Return '/a/b/c' -> ('a', '/b/c').\"\"\"\n    if path in (\"\", \"/\"):\n        return (\"\", \"\")\n    assert path.startswith(\"/\")\n    first, _sep, rest = path.lstrip(\"/\").partition(\"/\")\n    return (first, \"/\" + rest)", "entry_point": "pop_path", "input": "''", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/util.py#L349-L355", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037163", "code": "def split_namespace(clarkName):\n    \"\"\"Return (namespace, localname) tuple for a property name in Clark Notation.\n\n    Namespace defaults to ''.\n    Example:\n    '{DAV:}foo'  -> ('DAV:', 'foo')\n    'bar'  -> ('', 'bar')\n    \"\"\"\n    if clarkName.startswith(\"{\") and \"}\" in clarkName:\n        ns, localname = clarkName.split(\"}\", 1)\n        return (ns[1:], localname)\n    return (\"\", clarkName)", "entry_point": "split_namespace", "input": "'AbC dEf'", "output": "('', 'AbC dEf')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/util.py#L373-L384", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037164", "code": "def is_child_uri(parentUri, childUri):\n    \"\"\"Return True, if childUri is a child of parentUri.\n\n    This function accounts for the fact that '/a/b/c' and 'a/b/c/' are\n    children of '/a/b' (and also of '/a/b/').\n    Note that '/a/b/cd' is NOT a child of 'a/b/c'.\n    \"\"\"\n    return (\n        parentUri\n        and childUri\n        and childUri.rstrip(\"/\").startswith(parentUri.rstrip(\"/\") + \"/\")\n    )", "entry_point": "is_child_uri", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/util.py#L646-L657", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037165", "code": "def is_equal_or_child_uri(parentUri, childUri):\n    \"\"\"Return True, if childUri is a child of parentUri or maps to the same resource.\n\n    Similar to <util.is_child_uri>_ ,  but this method also returns True, if parent\n    equals child. ('/a/b' is considered identical with '/a/b/').\n    \"\"\"\n    return (\n        parentUri\n        and childUri\n        and (childUri.rstrip(\"/\") + \"/\").startswith(parentUri.rstrip(\"/\") + \"/\")\n    )", "entry_point": "is_equal_or_child_uri", "input": "['apple', 'banana', 'cherry'], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/util.py#L660-L670", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037166", "code": "def linear_reaction_coefficients(model, reactions=None):\n    \"\"\"Coefficient for the reactions in a linear objective.\n\n    Parameters\n    ----------\n    model : cobra model\n        the model object that defined the objective\n    reactions : list\n        an optional list for the reactions to get the coefficients for. All\n        reactions if left missing.\n\n    Returns\n    -------\n    dict\n        A dictionary where the key is the reaction object and the value is\n        the corresponding coefficient. Empty dictionary if there are no\n        linear terms in the objective.\n    \"\"\"\n    linear_coefficients = {}\n    reactions = model.reactions if not reactions else reactions\n    try:\n        objective_expression = model.solver.objective.expression\n        coefficients = objective_expression.as_coefficients_dict()\n    except AttributeError:\n        return linear_coefficients\n    for rxn in reactions:\n        forward_coefficient = coefficients.get(rxn.forward_variable, 0)\n        reverse_coefficient = coefficients.get(rxn.reverse_variable, 0)\n        if forward_coefficient != 0:\n            if forward_coefficient == -reverse_coefficient:\n                linear_coefficients[rxn] = float(forward_coefficient)\n    return linear_coefficients", "entry_point": "linear_reaction_coefficients", "input": "[], [-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/opencobra/cobrapy/blob/9d1987cdb3a395cf4125a3439c3b002ff2be2009/cobra/util/solver.py#L45-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037167", "code": "def insert_break(lines, break_pos=9):\n    \"\"\"\n    Insert a <!--more--> tag for larger release notes.\n\n    Parameters\n    ----------\n    lines : list of str\n        The content of the release note.\n    break_pos : int\n        Line number before which a break should approximately be inserted.\n\n    Returns\n    -------\n    list of str\n        The text with the inserted tag or no modification if it was\n        sufficiently short.\n    \"\"\"\n    def line_filter(line):\n        if len(line) == 0:\n            return True\n        return any(line.startswith(c) for c in \"-*+\")\n\n    if len(lines) <= break_pos:\n        return lines\n    newlines = [\n        i for i, line in enumerate(lines[break_pos:], start=break_pos)\n        if line_filter(line.strip())]\n    if len(newlines) > 0:\n        break_pos = newlines[0]\n    lines.insert(break_pos, \"<!--more-->\\n\")\n    return lines", "entry_point": "insert_break", "input": "[1, 2, 3], 3.25", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/opencobra/cobrapy/blob/9d1987cdb3a395cf4125a3439c3b002ff2be2009/scripts/publish_release.py#L15-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037168", "code": "def unicode_sorter(input):\n    \"\"\" This function implements sort keys for the german language according to\n    DIN 5007.\"\"\"\n\n    # key1: compare words lowercase and replace umlauts according to DIN 5007\n    key1 = input.lower()\n    key1 = key1.replace(u\"\u00e4\", u\"a\")\n    key1 = key1.replace(u\"\u00f6\", u\"o\")\n    key1 = key1.replace(u\"\u00fc\", u\"u\")\n    key1 = key1.replace(u\"\u00df\", u\"ss\")\n\n    # key2: sort the lowercase word before the uppercase word and sort\n    # the word with umlaut after the word without umlaut\n    # key2=input.swapcase()\n\n    # in case two words are the same according to key1, sort the words\n    # according to key2.\n    return key1", "entry_point": "unicode_sorter", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/digi604/django-smart-selects/blob/05dcc4a3de2874499ff3b9a3dfac5c623206e3e5/smart_selects/utils.py#L9-L26", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037169", "code": "def normalize_cols(table):\n    \"\"\"\n    Pad short rows to the length of the longest row to help render \"jagged\"\n    CSV files\n    \"\"\"\n    longest_row_len = max([len(row) for row in table])\n    for row in table:\n        while len(row) < longest_row_len:\n            row.append('')\n    return table", "entry_point": "normalize_cols", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/mplewis/csvtomd/blob/1a23a5b37a973a1dc69ad4c69e81edea5d096ac9/csvtomd/csvtomd.py#L42-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037170", "code": "def baseId(resource_id, return_version=False):\n    \"\"\"Calculate base id and version from a resource id.\n\n    :params resource_id: Resource id.\n    :params return_version: (optional) True if You need version, returns (resource_id, version).\n    \"\"\"\n    version = 0\n    resource_id = resource_id + 0xC4000000  # 3288334336\n    # TODO: version is broken due ^^, needs refactoring\n\n    while resource_id > 0x01000000:  # 16777216\n        version += 1\n        if version == 1:\n            resource_id -= 0x80000000  # 2147483648  # 0x50000000  # 1342177280 ?  || 0x2000000  # 33554432\n        elif version == 2:\n            resource_id -= 0x03000000  # 50331648\n        else:\n            resource_id -= 0x01000000  # 16777216\n\n    if return_version:\n        return resource_id, version - 67  # just correct \"magic number\"\n\n    return resource_id", "entry_point": "baseId", "input": "7, 2", "output": "(7, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/futapi/fut/blob/3792c9eee8f5884f38a02210e649c46c6c7a756d/fut/core.py#L52-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037171", "code": "def Dadgostar_Shaw(T, similarity_variable):\n    r'''Calculate liquid constant-pressure heat capacitiy with the similarity\n    variable concept and method as shown in [1]_.\n\n    .. math::\n        C_{p} = 24.5(a_{11}\\alpha + a_{12}\\alpha^2)+ (a_{21}\\alpha\n        + a_{22}\\alpha^2)T +(a_{31}\\alpha + a_{32}\\alpha^2)T^2\n\n    Parameters\n    ----------\n    T : float\n        Temperature of liquid [K]\n    similarity_variable : float\n        similarity variable as defined in [1]_, [mol/g]\n\n    Returns\n    -------\n    Cpl : float\n        Liquid constant-pressure heat capacitiy, [J/kg/K]\n\n    Notes\n    -----\n    Many restrictions on its use.\n\n    Original model is in terms of J/g/K. Note that the model is for predicting\n    mass heat capacity, not molar heat capacity like most other methods!\n\n    a11 = -0.3416; a12 = 2.2671; a21 = 0.1064; a22 = -0.3874l;\n    a31 = -9.8231E-05; a32 = 4.182E-04\n\n    Examples\n    --------\n    >>> Dadgostar_Shaw(355.6, 0.139)\n    1802.5291501191516\n\n    References\n    ----------\n    .. [1] Dadgostar, Nafiseh, and John M. Shaw. \"A Predictive Correlation for\n       the Constant-Pressure Specific Heat Capacity of Pure and Ill-Defined\n       Liquid Hydrocarbons.\" Fluid Phase Equilibria 313 (January 15, 2012):\n       211-226. doi:10.1016/j.fluid.2011.09.015.\n    '''\n    a = similarity_variable\n    a11 = -0.3416\n    a12 = 2.2671\n    a21 = 0.1064\n    a22 = -0.3874\n    a31 = -9.8231E-05\n    a32 = 4.182E-04\n\n    # Didn't seem to improve the comparison; sum of errors on some\n    # points included went from 65.5  to 286.\n    # Author probably used more precision in their calculation.\n#    theta = 151.8675\n#    constant = 3*R*(theta/T)**2*exp(theta/T)/(exp(theta/T)-1)**2\n    constant = 24.5\n\n    Cp = (constant*(a11*a + a12*a**2) + (a21*a + a22*a**2)*T\n          + (a31*a + a32*a**2)*T**2)\n    Cp = Cp*1000 # J/g/K to J/kg/K\n    return Cp", "entry_point": "Dadgostar_Shaw", "input": "True, 3.25", "output": "555741.0573617502", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/heat_capacity.py#L990-L1050", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037172", "code": "def Rachford_Rice_flash_error(V_over_F, zs, Ks):\n    r'''Calculates the objective function of the Rachford-Rice flash equation.\n    This function should be called by a solver seeking a solution to a flash\n    calculation. The unknown variable is `V_over_F`, for which a solution\n    must be between 0 and 1.\n\n    .. math::\n        \\sum_i \\frac{z_i(K_i-1)}{1 + \\frac{V}{F}(K_i-1)} = 0\n\n    Parameters\n    ----------\n    V_over_F : float\n        Vapor fraction guess [-]\n    zs : list[float]\n        Overall mole fractions of all species, [-]\n    Ks : list[float]\n        Equilibrium K-values, [-]\n\n    Returns\n    -------\n    error : float\n        Deviation between the objective function at the correct V_over_F\n        and the attempted V_over_F, [-]\n\n    Notes\n    -----\n    The derivation is as follows:\n\n    .. math::\n        F z_i = L x_i + V y_i\n\n        x_i = \\frac{z_i}{1 + \\frac{V}{F}(K_i-1)}\n\n        \\sum_i y_i = \\sum_i K_i x_i = 1\n\n        \\sum_i(y_i - x_i)=0\n\n        \\sum_i \\frac{z_i(K_i-1)}{1 + \\frac{V}{F}(K_i-1)} = 0\n\n    Examples\n    --------\n    >>> Rachford_Rice_flash_error(0.5, zs=[0.5, 0.3, 0.2],\n    ... Ks=[1.685, 0.742, 0.532])\n    0.04406445591174976\n\n    References\n    ----------\n    .. [1] Rachford, H. H. Jr, and J. D. Rice. \"Procedure for Use of Electronic\n       Digital Computers in Calculating Flash Vaporization Hydrocarbon\n       Equilibrium.\" Journal of Petroleum Technology 4, no. 10 (October 1,\n       1952): 19-3. doi:10.2118/952327-G.\n    '''\n    return sum([zi*(Ki-1.)/(1.+V_over_F*(Ki-1.)) for Ki, zi in zip(Ks, zs)])", "entry_point": "Rachford_Rice_flash_error", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry'], []", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/activity.py#L175-L227", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037173", "code": "def Laliberte_density_w(T):\n    r'''Calculate the density of water using the form proposed by [1]_.\n    No parameters are needed, just a temperature. Units are Kelvin and kg/m^3h.\n\n    .. math::\n        \\rho_w = \\frac{\\left\\{\\left([(-2.8054253\\times 10^{-10}\\cdot t +\n        1.0556302\\times 10^{-7})t - 4.6170461\\times 10^{-5}]t\n        -0.0079870401\\right)t + 16.945176   \\right\\}t + 999.83952}\n        {1 + 0.01687985\\cdot t}\n\n    Parameters\n    ----------\n    T : float\n        Temperature of fluid [K]\n\n    Returns\n    -------\n    rho_w : float\n        Water density, [kg/m^3]\n\n    Notes\n    -----\n    Original source not cited\n    No temperature range is used.\n\n    Examples\n    --------\n    >>> Laliberte_density_w(298.15)\n    997.0448954179155\n    >>> Laliberte_density_w(273.15 + 50)\n    988.0362916114763\n\n    References\n    ----------\n    .. [1] Laliberte, Marc. \"A Model for Calculating the Heat Capacity of\n       Aqueous Solutions, with Updated Density and Viscosity Data.\" Journal of\n       Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60.\n       doi:10.1021/je8008123\n    '''\n    t = T-273.15\n    rho_w = (((((-2.8054253E-10*t + 1.0556302E-7)*t - 4.6170461E-5)*t - 0.0079870401)*t + 16.945176)*t + 999.83952) \\\n        / (1 + 0.01687985*t)\n    return rho_w", "entry_point": "Laliberte_density_w", "input": "10", "output": "671.3700264666577", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/electrochem.py#L240-L282", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037174", "code": "def dilute_ionic_conductivity(ionic_conductivities, zs, rhom):\n    r'''This function handles the calculation of the electrical conductivity of \n    a dilute electrolytic aqueous solution. Requires the mole fractions of \n    each ion, the molar density of the whole mixture, and ionic conductivity \n    coefficients for each ion.\n    \n    .. math::\n        \\lambda = \\sum_i \\lambda_i^\\circ z_i \\rho_m\n    \n    Parameters\n    ----------\n    ionic_conductivities : list[float]\n        Ionic conductivity coefficients of each ion in the mixture [m^2*S/mol]\n    zs : list[float]\n        Mole fractions of each ion in the mixture, [-]\n    rhom : float\n        Overall molar density of the solution, [mol/m^3]\n\n    Returns\n    -------\n    kappa : float\n        Electrical conductivity of the fluid, [S/m]\n\n    Notes\n    -----\n    The ionic conductivity coefficients should not be `equivalent` coefficients; \n    for example, 0.0053 m^2*S/mol is the equivalent conductivity coefficient of\n    Mg+2, but this method expects twice its value - 0.0106. Both are reported\n    commonly in literature.\n    \n    Water can be included in this caclulation by specifying a coefficient of\n    0. The conductivity of any electrolyte eclipses its own conductivity by \n    many orders of magnitude. Any other solvents present will affect the\n    conductivity extensively and there are few good methods to predict this \n    effect.\n\n    Examples\n    --------\n    Complex mixture of electrolytes ['Cl-', 'HCO3-', 'SO4-2', 'Na+', 'K+', \n    'Ca+2', 'Mg+2']:\n    \n    >>> ionic_conductivities = [0.00764, 0.00445, 0.016, 0.00501, 0.00735, 0.0119, 0.01061]\n    >>> zs = [0.03104, 0.00039, 0.00022, 0.02413, 0.0009, 0.0024, 0.00103]\n    >>> dilute_ionic_conductivity(ionic_conductivities=ionic_conductivities, zs=zs, rhom=53865.9)\n    22.05246783663\n\n    References\n    ----------\n    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of\n       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.\n    '''\n    return sum([ci*(zi*rhom) for zi, ci in zip(zs, ionic_conductivities)])", "entry_point": "dilute_ionic_conductivity", "input": "[[1, 2], [3], []], [], ['a', 'b', 'c']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/electrochem.py#L532-L583", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037175", "code": "def ionic_strength(mis, zis):\n    r'''Calculate the ionic strength of a solution in one of two ways,\n    depending on the inputs only. For Pitzer and Bromley models,\n    `mis` should be molalities of each component. For eNRTL models,\n    `mis` should be mole fractions of each electrolyte in the solution.\n    This will sum to be much less than 1.\n\n    .. math::\n        I = \\frac{1}{2} \\sum M_i z_i^2\n\n        I = \\frac{1}{2} \\sum x_i z_i^2\n\n    Parameters\n    ----------\n    mis : list\n        Molalities of each ion, or mole fractions of each ion [mol/kg or -]\n    zis : list\n        Charges of each ion [-]\n\n    Returns\n    -------\n    I : float\n        ionic strength, [?]\n\n    Examples\n    --------\n    >>> ionic_strength([0.1393, 0.1393], [1, -1])\n    0.1393\n\n    References\n    ----------\n    .. [1] Chen, Chau-Chyun, H. I. Britt, J. F. Boston, and L. B. Evans. \"Local\n       Composition Model for Excess Gibbs Energy of Electrolyte Systems.\n       Part I: Single Solvent, Single Completely Dissociated Electrolyte\n       Systems.\" AIChE Journal 28, no. 4 (July 1, 1982): 588-96.\n       doi:10.1002/aic.690280410\n    .. [2] Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation.\n       Weinheim, Germany: Wiley-VCH, 2012.\n    '''\n    return 0.5*sum([mi*zi*zi for mi, zi in zip(mis, zis)])", "entry_point": "ionic_strength", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/electrochem.py#L826-L865", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037176", "code": "def Kweq_IAPWS_gas(T):\n    r'''Calculates equilibrium constant for OH- and H+ in water vapor,\n    according to [1]_.\n    This is the most recent formulation available.\n\n    .. math::\n        -log_{10}  K_w^G = \\gamma_0 + \\gamma_1 T^{-1} + \\gamma_2 T^{-2} + \\gamma_3 T^{-3}\n\n    Parameters\n    ----------\n    T : float\n        Temperature of H2O [K]\n\n    Returns\n    -------\n    K_w_G : float\n\n    Notes\n    -----\n    gamma0 = 6.141500E-1; \n    gamma1 = 4.825133E4; \n    gamma2 = -6.770793E4; \n    gamma3 = 1.010210E7\n\n    Examples\n    --------\n    >>> Kweq_IAPWS_gas(800)\n    1.4379721554798815e-61\n    \n    References\n    ----------\n    .. [1] Bandura, Andrei V., and Serguei N. Lvov. \"The Ionization Constant\n       of Water over Wide Ranges of Temperature and Density.\" Journal of Physical\n       and Chemical Reference Data 35, no. 1 (March 1, 2006): 15-30.\n       doi:10.1063/1.1928231\n    '''\n    gamma0 = 6.141500E-1\n    gamma1 = 4.825133E4\n    gamma2 = -6.770793E4\n    gamma3 = 1.010210E7\n    K_w_G = 10**(-1*(gamma0 + gamma1/T + gamma2/T**2 + gamma3/T**3))\n    return K_w_G", "entry_point": "Kweq_IAPWS_gas", "input": "True", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/electrochem.py#L922-L963", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037177", "code": "def Grigoras(Tc=None, Pc=None, Vc=None):\n    r'''Relatively recent (1990) relationship for estimating critical\n    properties from each other. Two of the three properties are required.\n    This model uses the \"critical surface\", a general plot of Tc vs Pc vs Vc.\n    The model used 137 organic and inorganic compounds to derive the equation.\n    The general equation is in [1]_:\n\n    .. math::\n        P_c = 2.9 + 20.2 \\frac{T_c}{V_c}\n\n    Parameters\n    ----------\n    Tc : float\n        Critical temperature of fluid (optional) [K]\n    Pc : float\n        Critical pressure of fluid (optional) [Pa]\n    Vc : float\n        Critical volume of fluid (optional) [m^3/mol]\n\n    Returns\n    -------\n    Tc, Pc or Vc : float\n        Critical property of fluid [K], [Pa], or [m^3/mol]\n\n    Notes\n    -----\n    The prediction of Tc from Pc and Vc is not tested, as this is not necessary\n    anywhere, but it is implemented.\n    Internal units are bar, cm^3/mol, and K. A slight error occurs when\n    Pa, cm^3/mol and K are used instead, on the order of <0.2%.\n    This equation is less accurate than that of Ihmels, but surprisingly close.\n    The author also investigated an early QSPR model.\n\n    Examples\n    --------\n    Succinic acid [110-15-6]\n\n    >>> Grigoras(Tc=851.0, Vc=0.000308)\n    5871233.766233766\n\n    References\n    ----------\n    .. [1] Grigoras, Stelian. \"A Structural Approach to Calculate Physical\n           Properties of Pure Organic Substances: The Critical Temperature,\n           Critical Volume and Related Properties.\" Journal of Computational\n           Chemistry 11, no. 4 (May 1, 1990): 493-510.\n           doi:10.1002/jcc.540110408\n    '''\n    if Tc and Vc:\n        Vc = Vc*1E6  # m^3/mol to cm^3/mol\n        Pc = 2.9 + 20.2*Tc/Vc\n        Pc = Pc*1E5  # bar to Pa\n        return Pc\n    elif Tc and Pc:\n        Pc = Pc/1E5  # Pa to bar\n        Vc = 202.0*Tc/(10*Pc-29.0)\n        Vc = Vc/1E6  # cm^3/mol to m^3/mol\n        return Vc\n    elif Pc and Vc:\n        Pc = Pc/1E5  # Pa to bar\n        Vc = Vc*1E6  # m^3/mol to cm^3/mol\n        Tc = 1.0/202*(10*Pc-29.0)*Vc\n        return Tc\n    else:\n        raise Exception('Two of Tc, Pc, and Vc must be provided')", "entry_point": "Grigoras", "input": "1, False, 3.25", "output": "290000.62153846154", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/critical.py#L1074-L1138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037178", "code": "def checkCAS(CASRN):\n    '''Checks if a CAS number is valid. Returns False if the parser cannot \n    parse the given string..\n\n    Parameters\n    ----------\n    CASRN : string\n        A three-piece, dash-separated set of numbers\n\n    Returns\n    -------\n    result : bool\n        Boolean value if CASRN was valid. If parsing fails, return False also.\n\n    Notes\n    -----\n    Check method is according to Chemical Abstract Society. However, no lookup\n    to their service is performed; therefore, this function cannot detect\n    false positives.\n\n    Function also does not support additional separators, apart from '-'.\n    \n    CAS numbers up to the series 1 XXX XXX-XX-X are now being issued.\n    \n    A long can hold CAS numbers up to 2 147 483-64-7\n\n    Examples\n    --------\n    >>> checkCAS('7732-18-5')\n    True\n    >>> checkCAS('77332-18-5')\n    False\n    '''\n    try:\n        check = CASRN[-1]\n        CASRN = CASRN[::-1][1:]\n        productsum = 0\n        i = 1\n        for num in CASRN:\n            if num == '-':\n                pass\n            else:\n                productsum += i*int(num)\n                i += 1\n        return (productsum % 10 == int(check))\n    except:\n        return False", "entry_point": "checkCAS", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/identifiers.py#L35-L81", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037179", "code": "def _round_whole_even(i):\n    r'''Round a number to the nearest whole number. If the number is exactly\n    between two numbers, round to the even whole number. Used by\n    `viscosity_index`.\n\n    Parameters\n    ----------\n    i : float\n        Number, [-]\n\n    Returns\n    -------\n    i : int\n        Rounded number, [-]\n\n    Notes\n    -----\n    Should never run with inputs from a practical function, as numbers on\n    computers aren't really normally exactly between two numbers.\n\n    Examples\n    --------\n    _round_whole_even(116.5)\n    116\n    '''\n    if i % .5 == 0:\n        if (i + 0.5) % 2 == 0:\n            i = i + 0.5\n        else:\n            i = i - 0.5\n    else:\n        i = round(i, 0)\n    return int(i)", "entry_point": "_round_whole_even", "input": "2", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/viscosity.py#L2029-L2061", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037180", "code": "def fire_mixing(ys=None, FLs=None):  # pragma: no cover\n    '''\n    Crowl, Daniel A., and Joseph F. Louvar. Chemical Process Safety:\n    Fundamentals with Applications. 2E. Upper Saddle River, N.J:\n    Prentice Hall, 2001.\n\n\n    >>> fire_mixing(ys=normalize([0.0024, 0.0061, 0.0015]), FLs=[.012, .053, .031])\n    0.02751172136637643\n    >>> fire_mixing(ys=normalize([0.0024, 0.0061, 0.0015]), FLs=[.075, .15, .32])\n    0.12927551844869378\n    '''\n    return 1./sum([yi/FLi for yi, FLi in zip(ys, FLs)])", "entry_point": "fire_mixing", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "0.25862068965517243", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/safety.py#L890-L902", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037181", "code": "def Suzuki_LFL(Hc=None):\n    r'''Calculates lower flammability limit, using the Suzuki [1]_ correlation.\n    Uses heat of combustion only.\n\n    The lower flammability limit of a gas is air is:\n\n    .. math::\n        \\text{LFL} = \\frac{-3.42}{\\Delta H_c^{\\circ}} + 0.569\n        \\Delta H_c^{\\circ} + 0.0538\\Delta H_c^{\\circ 2} + 1.80\n\n    Parameters\n    ----------\n    Hc : float\n        Heat of combustion of gas [J/mol]\n\n    Returns\n    -------\n    LFL : float\n        Lower flammability limit, mole fraction [-]\n\n    Notes\n    -----\n    Fit performed with 112 compounds, r^2 was 0.977.\n    LFL in percent volume in air. Hc is at standard conditions, in MJ/mol.\n    11 compounds left out as they were outliers.\n    Equation does not apply for molecules with halogen atoms, only hydrocarbons\n    with oxygen or nitrogen or sulfur.\n    No sample calculation provided with the article. However, the equation is\n    straightforward.\n\n    Limits of equations's validity are -6135596 J where it predicts a\n    LFL of 0, and -48322129 J where it predicts a LFL of 1.\n\n    Examples\n    --------\n    Pentane, 1.5 % LFL in literature\n\n    >>> Suzuki_LFL(-3536600)\n    0.014276107095811815\n\n    References\n    ----------\n    .. [1] Suzuki, Takahiro. \"Note: Empirical Relationship between Lower\n       Flammability Limits and Standard Enthalpies of Combustion of Organic\n       Compounds.\" Fire and Materials 18, no. 5 (September 1, 1994): 333-36.\n       doi:10.1002/fam.810180509.\n    '''\n    Hc = Hc/1E6\n    LFL = -3.42/Hc + 0.569*Hc + 0.0538*Hc*Hc + 1.80\n    return LFL/100.", "entry_point": "Suzuki_LFL", "input": "-1.5", "output": "22800.01799999146", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/safety.py#L1022-L1071", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037182", "code": "def to_num(values):\n    r'''Legacy function to turn a list of strings into either floats\n    (if numeric), stripped strings (if not) or None if the string is empty.\n    Accepts any numeric formatting the float function does.\n\n    Parameters\n    ----------\n    values : list\n        list of strings\n\n    Returns\n    -------\n    values : list\n        list of floats, strings, and None values [-]\n\n    Examples\n    --------\n    >>> to_num(['1', '1.1', '1E5', '0xB4', ''])\n    [1.0, 1.1, 100000.0, '0xB4', None]\n    '''\n    for i in range(len(values)):\n        try:\n            values[i] = float(values[i])\n        except:\n            if values[i] == '':\n                values[i] = None\n            else:\n                values[i] = values[i].strip()\n                pass\n    return values", "entry_point": "to_num", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/utils.py#L75-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037183", "code": "def zs_to_ws(zs, MWs):\n    r'''Converts a list of mole fractions to mass fractions. Requires molecular\n    weights for all species.\n\n    .. math::\n        w_i = \\frac{z_i MW_i}{MW_{avg}}\n\n        MW_{avg} = \\sum_i z_i MW_i\n\n    Parameters\n    ----------\n    zs : iterable\n        Mole fractions [-]\n    MWs : iterable\n        Molecular weights [g/mol]\n\n    Returns\n    -------\n    ws : iterable\n        Mass fractions [-]\n\n    Notes\n    -----\n    Does not check that the sums add to one. Does not check that inputs are of\n    the same length.\n\n    Examples\n    --------\n    >>> zs_to_ws([0.5, 0.5], [10, 20])\n    [0.3333333333333333, 0.6666666666666666]\n    '''\n    Mavg = sum(zi*MWi for zi, MWi in zip(zs, MWs))\n    ws = [zi*MWi/Mavg for zi, MWi in zip(zs, MWs)]\n    return ws", "entry_point": "zs_to_ws", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[-1.25, 0.0, 0.25, 2.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/utils.py#L1079-L1112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037184", "code": "def ws_to_zs(ws, MWs):\n    r'''Converts a list of mass fractions to mole fractions. Requires molecular\n    weights for all species.\n\n    .. math::\n        z_i = \\frac{\\frac{w_i}{MW_i}}{\\sum_i \\frac{w_i}{MW_i}}\n\n    Parameters\n    ----------\n    ws : iterable\n        Mass fractions [-]\n    MWs : iterable\n        Molecular weights [g/mol]\n\n    Returns\n    -------\n    zs : iterable\n        Mole fractions [-]\n\n    Notes\n    -----\n    Does not check that the sums add to one. Does not check that inputs are of\n    the same length.\n\n    Examples\n    --------\n    >>> ws_to_zs([0.3333333333333333, 0.6666666666666666], [10, 20])\n    [0.5, 0.5]\n    '''\n    tot = sum(w/MW for w, MW in zip(ws, MWs))\n    zs = [w/MW/tot for w, MW in zip(ws, MWs)]\n    return zs", "entry_point": "ws_to_zs", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "[0.7317073170731707, 0.21951219512195122, 0.04878048780487805]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/utils.py#L1115-L1146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037185", "code": "def zs_to_Vfs(zs, Vms):\n    r'''Converts a list of mole fractions to volume fractions. Requires molar\n    volumes for all species.\n\n    .. math::\n        \\text{Vf}_i = \\frac{z_i V_{m,i}}{\\sum_i z_i V_{m,i}}\n\n    Parameters\n    ----------\n    zs : iterable\n        Mole fractions [-]\n    VMs : iterable\n        Molar volumes of species [m^3/mol]\n\n    Returns\n    -------\n    Vfs : list\n        Molar volume fractions [-]\n\n    Notes\n    -----\n    Does not check that the sums add to one. Does not check that inputs are of\n    the same length.\n\n    Molar volumes are specified in terms of pure components only. Function\n    works with any phase.\n\n    Examples\n    --------\n    Acetone and benzene example\n\n    >>> zs_to_Vfs([0.637, 0.363], [8.0234e-05, 9.543e-05])\n    [0.5960229712956298, 0.4039770287043703]\n    '''\n    vol_is = [zi*Vmi for zi, Vmi in zip(zs, Vms)]\n    tot = sum(vol_is)\n    return [vol_i/tot for vol_i in vol_is]", "entry_point": "zs_to_Vfs", "input": "[], [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/utils.py#L1149-L1185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037186", "code": "def Vfs_to_zs(Vfs, Vms):\n    r'''Converts a list of mass fractions to mole fractions. Requires molecular\n    weights for all species.\n\n    .. math::\n        z_i = \\frac{\\frac{\\text{Vf}_i}{V_{m,i}}}{\\sum_i\n        \\frac{\\text{Vf}_i}{V_{m,i}}}\n\n    Parameters\n    ----------\n    Vfs : iterable\n        Molar volume fractions [-]\n    VMs : iterable\n        Molar volumes of species [m^3/mol]\n\n    Returns\n    -------\n    zs : list\n        Mole fractions [-]\n\n    Notes\n    -----\n    Does not check that the sums add to one. Does not check that inputs are of\n    the same length.\n\n    Molar volumes are specified in terms of pure components only. Function\n    works with any phase.\n\n    Examples\n    --------\n    Acetone and benzene example\n\n    >>> Vfs_to_zs([0.596, 0.404], [8.0234e-05, 9.543e-05])\n    [0.6369779395901142, 0.3630220604098858]\n    '''\n    mols_i = [Vfi/Vmi for Vfi, Vmi in zip(Vfs, Vms)]\n    mols = sum(mols_i)\n    return [mol_i/mols for mol_i in mols_i]", "entry_point": "Vfs_to_zs", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/utils.py#L1188-L1225", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037187", "code": "def none_and_length_check(all_inputs, length=None):\n    r'''Checks inputs for suitability of use by a mixing rule which requires\n    all inputs to be of the same length and non-None. A number of variations\n    were attempted for this function; this was found to be the quickest.\n\n    Parameters\n    ----------\n    all_inputs : array-like of array-like\n        list of all the lists of inputs, [-]\n    length : int, optional\n        Length of the desired inputs, [-]\n\n    Returns\n    -------\n    False/True : bool\n        Returns True only if all inputs are the same length (or length `length`)\n        and none of the inputs contain None [-]\n\n    Notes\n    -----\n    Does not check for nan values.\n\n    Examples\n    --------\n    >>> none_and_length_check(([1, 1], [1, 1], [1, 30], [10,0]), length=2)\n    True\n    '''\n    if not length:\n        length = len(all_inputs[0])\n    for things in all_inputs:\n        if None in things or len(things) != length:\n            return False\n    return True", "entry_point": "none_and_length_check", "input": "[[1, 2], [3], []], 1", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/utils.py#L1228-L1260", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037188", "code": "def Bahadori_liquid(T, M):\n    r'''Estimates the thermal conductivity of parafin liquid hydrocarbons.\n    Fits their data well, and is useful as only MW is required.\n    X is the Molecular weight, and Y the temperature.\n\n    .. math::\n        K = a + bY + CY^2 + dY^3\n\n        a = A_1 + B_1 X + C_1 X^2 + D_1 X^3\n\n        b = A_2 + B_2 X + C_2 X^2 + D_2 X^3\n\n        c = A_3 + B_3 X + C_3 X^2 + D_3 X^3\n\n        d = A_4 + B_4 X + C_4 X^2 + D_4 X^3\n\n    Parameters\n    ----------\n    T : float\n        Temperature of the fluid [K]\n    M : float\n        Molecular weight of the fluid [g/mol]\n\n    Returns\n    -------\n    kl : float\n        Estimated liquid thermal conductivity [W/m/k]\n\n    Notes\n    -----\n    The accuracy of this equation has not been reviewed.\n\n    Examples\n    --------\n    Data point from [1]_.\n\n    >>> Bahadori_liquid(273.15, 170)\n    0.14274278108272603\n\n    References\n    ----------\n    .. [1] Bahadori, Alireza, and Saeid Mokhatab. \"Estimating Thermal\n       Conductivity of Hydrocarbons.\" Chemical Engineering 115, no. 13\n       (December 2008): 52-54\n    '''\n    A = [-6.48326E-2, 2.715015E-3, -1.08580E-5, 9.853917E-9]\n    B = [1.565612E-2, -1.55833E-4, 5.051114E-7, -4.68030E-10]\n    C = [-1.80304E-4, 1.758693E-6, -5.55224E-9, 5.201365E-12]\n    D = [5.880443E-7, -5.65898E-9, 1.764384E-11, -1.65944E-14]\n    X, Y = M, T\n    a = A[0] + B[0]*X + C[0]*X**2 + D[0]*X**3\n    b = A[1] + B[1]*X + C[1]*X**2 + D[1]*X**3\n    c = A[2] + B[2]*X + C[2]*X**2 + D[2]*X**3\n    d = A[3] + B[3]*X + C[3]*X**2 + D[3]*X**3\n    return a + b*Y + c*Y**2 + d*Y**3", "entry_point": "Bahadori_liquid", "input": "7, 7", "output": "0.047716494125426855", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/thermal_conductivity.py#L369-L423", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037189", "code": "def atom_fractions(atoms):\n    r'''Calculates the atomic fractions of each element in a compound,\n    given a dictionary of its atoms and their counts, in the format\n    {symbol: count}.\n\n    .. math::\n        a_i =  \\frac{n_i}{\\sum_i n_i}\n\n    Parameters\n    ----------\n    atoms : dict\n        dictionary of counts of individual atoms, indexed by symbol with\n        proper capitalization, [-]\n\n    Returns\n    -------\n    afracs : dict\n        dictionary of atomic fractions of individual atoms, indexed by symbol\n        with proper capitalization, [-]\n\n    Notes\n    -----\n    No actual data on the elements is used, so incorrect or custom compounds\n    would not raise an error.\n\n    Examples\n    --------\n    >>> atom_fractions({'H': 12, 'C': 20, 'O': 5})\n    {'H': 0.32432432432432434, 'C': 0.5405405405405406, 'O': 0.13513513513513514}\n\n    References\n    ----------\n    .. [1] RDKit: Open-source cheminformatics; http://www.rdkit.org\n    '''\n    count = sum(atoms.values())\n    afracs = {}\n    for i in atoms:\n        afracs[i] = atoms[i]/count\n    return afracs", "entry_point": "atom_fractions", "input": "{'a': 1, 'b': 2}", "output": "{'a': 0.3333333333333333, 'b': 0.6666666666666666}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/elements.py#L363-L401", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037190", "code": "def atoms_to_Hill(atoms):\n    r'''Determine the Hill formula of a compound, given a dictionary of its\n    atoms and their counts, in the format {symbol: count}.\n\n    Parameters\n    ----------\n    atoms : dict\n        dictionary of counts of individual atoms, indexed by symbol with\n        proper capitalization, [-]\n\n    Returns\n    -------\n    Hill_formula : str\n        Hill formula, [-]\n\n    Notes\n    -----\n    The Hill system is as follows:\n\n    If the chemical has 'C' in it, this is listed first, and then if it has\n    'H' in it as well as 'C', then that goes next. All elements are sorted\n    alphabetically afterwards, including 'H' if 'C' is not present.\n    All elements are followed by their count, unless it is 1.\n\n    Examples\n    --------\n    >>> atoms_to_Hill({'H': 5, 'C': 2, 'Br': 1})\n    'C2H5Br'\n\n    References\n    ----------\n    .. [1] Hill, Edwin A.\"\u201cON A SYSTEM OF INDEXING CHEMICAL LITERATURE;\n       ADOPTED BY THE CLASSIFICATION DIVISION OF THE U. S. PATENT OFFICE.1.\"\n       Journal of the American Chemical Society 22, no. 8 (August 1, 1900):\n       478-94. doi:10.1021/ja02046a005.\n    '''\n    def str_ele_count(ele):\n        if atoms[ele] == 1:\n            count = ''\n        else:\n            count = str(atoms[ele])\n        return count\n    atoms = atoms.copy()\n    s = ''\n    if 'C' in atoms.keys():\n        s += 'C' + str_ele_count('C')\n        del atoms['C']\n        if 'H' in atoms.keys():\n            s += 'H' + str_ele_count('H')\n            del atoms['H']\n        for ele in sorted(atoms.keys()):\n            s += ele + str_ele_count(ele)\n    else:\n        for ele in sorted(atoms.keys()):\n            s += ele + str_ele_count(ele)\n    return s", "entry_point": "atoms_to_Hill", "input": "{'x': [1, 2], 'y': []}", "output": "'x[1, 2]y[]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CalebBell/thermo/blob/3857ed023a3e64fd3039a32d53576c24990ef1c3/thermo/elements.py#L446-L501", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037191", "code": "def split_multiline(value):\n    \"\"\"Split a multiline string into a list, excluding blank lines.\"\"\"\n    return [element for element in (line.strip() for line in value.split('\\n'))\n            if element]", "entry_point": "split_multiline", "input": "'abc'", "output": "['abc']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/myint/language-check/blob/58e419833ef28a9193fcaa21193616a8a14504a9/setup.py#L187-L190", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037192", "code": "def split_elements(value):\n    \"\"\"Split a string with comma or space-separated elements into a list.\"\"\"\n    items = [v.strip() for v in value.split(',')]\n    if len(items) == 1:\n        items = value.split()\n    return items", "entry_point": "split_elements", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/myint/language-check/blob/58e419833ef28a9193fcaa21193616a8a14504a9/setup.py#L193-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037193", "code": "def less_than_version(value):\n    \"\"\"\n    Converts the current version to the next one for inserting into requirements\n    in the ' < version' format\n    \"\"\"\n    items = list(map(int, str(value).split('.')))\n    if len(items) == 1:\n        items.append(0)\n    items[1] += 1\n    if value == '1.11':\n        return '2.0'\n    else:\n        return '.'.join(map(str, items))", "entry_point": "less_than_version", "input": "0", "output": "'0.1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nephila/djangocms-installer/blob/9fec66d5f8b1e9a0f3c0ec66dd777db578fab07e/djangocms_installer/utils.py#L96-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037194", "code": "def _build_input_args(input_filepath_list, input_format_list):\n    ''' Builds input arguments by stitching input filepaths and input\n    formats together.\n    '''\n    if len(input_format_list) != len(input_filepath_list):\n        raise ValueError(\n            \"input_format_list & input_filepath_list are not the same size\"\n        )\n\n    input_args = []\n    zipped = zip(input_filepath_list, input_format_list)\n    for input_file, input_fmt in zipped:\n        input_args.extend(input_fmt)\n        input_args.append(input_file)\n\n    return input_args", "entry_point": "_build_input_args", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "['a', [1, 2], 'b', [3], 'c', []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/rabitt/pysox/blob/eae89bde74567136ec3f723c3e6b369916d9b837/sox/combine.py#L422-L437", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037195", "code": "def _parse_stat(stat_output):\n    '''Parse the string output from sox's stat function\n\n    Parameters\n    ----------\n    stat_output : str\n        Sox output from stderr.\n\n    Returns\n    -------\n    stat_dictionary : dict\n        Dictionary of audio statistics.\n    '''\n    lines = stat_output.split('\\n')\n    stat_dict = {}\n    for line in lines:\n        split_line = line.split(':')\n        if len(split_line) == 2:\n            key = split_line[0]\n            val = split_line[1].strip(' ')\n            try:\n                val = float(val)\n            except ValueError:\n                val = None\n            stat_dict[key] = val\n\n    return stat_dict", "entry_point": "_parse_stat", "input": "'Hello World'", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/rabitt/pysox/blob/eae89bde74567136ec3f723c3e6b369916d9b837/sox/file_info.py#L370-L396", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037196", "code": "def format_time(time):\r\n    \"\"\" Formats the given time into HH:MM:SS. \"\"\"\r\n    hours, remainder = divmod(time / 1000, 3600)\r\n    minutes, seconds = divmod(remainder, 60)\r\n\r\n    return '%02d:%02d:%02d' % (hours, minutes, seconds)", "entry_point": "format_time", "input": "False", "output": "'00:00:00'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Devoxin/Lavalink.py/blob/63f55c3d726d24c4cfd3674d3cd6aab6f5be110d/lavalink/Utils.py#L1-L6", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037197", "code": "def color_scale(color, level):\n    \"\"\"\n    Scale RGB tuple by level, 0 - 256\n    \"\"\"\n    return tuple([int(i * level) >> 8 for i in list(color)])", "entry_point": "color_scale", "input": "[], [[1, 2], [3], []]", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ManiacalLabs/BiblioPixel/blob/fd97e6c651a4bbcade64733847f4eec8f7704b7c/bibliopixel/colors/arithmetic.py#L10-L14", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037198", "code": "def euclidean(c1, c2):\n    \"\"\"Square of the euclidean distance\"\"\"\n    diffs = ((i - j) for i, j in zip(c1, c2))\n    return sum(x * x for x in diffs)", "entry_point": "euclidean", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ManiacalLabs/BiblioPixel/blob/fd97e6c651a4bbcade64733847f4eec8f7704b7c/bibliopixel/colors/closest_colors.py#L19-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037199", "code": "def serpentine_x(x, y, matrix):\n    \"\"\"Every other row is indexed in reverse.\"\"\"\n    if y % 2:\n        return matrix.columns - 1 - x, y\n    return x, y", "entry_point": "serpentine_x", "input": "True, 2, ()", "output": "(True, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ManiacalLabs/BiblioPixel/blob/fd97e6c651a4bbcade64733847f4eec8f7704b7c/bibliopixel/layout/geometry/index_ops.py#L14-L18", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037200", "code": "def serpentine_y(x, y, matrix):\n    \"\"\"Every other column is indexed in reverse.\"\"\"\n    if x % 2:\n        return x, matrix.rows - 1 - y\n    return x, y", "entry_point": "serpentine_y", "input": "False, set(), [[1, 2], [3], []]", "output": "(False, set())", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ManiacalLabs/BiblioPixel/blob/fd97e6c651a4bbcade64733847f4eec8f7704b7c/bibliopixel/layout/geometry/index_ops.py#L21-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037201", "code": "def to_triplets(colors):\n    \"\"\"\n    Coerce a list into a list of triplets.\n\n    If `colors` is a list of lists or strings, return it as is.  Otherwise,\n    divide it into tuplets of length three, silently discarding any extra\n    elements beyond a multiple of three.\n    \"\"\"\n    try:\n        colors[0][0]\n        return colors\n    except:\n        pass\n\n    # It's a 1-dimensional list\n    extra = len(colors) % 3\n    if extra:\n        colors = colors[:-extra]\n    return list(zip(*[iter(colors)] * 3))", "entry_point": "to_triplets", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ManiacalLabs/BiblioPixel/blob/fd97e6c651a4bbcade64733847f4eec8f7704b7c/bibliopixel/colors/make.py#L76-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037202", "code": "def varint(n):\n    \"\"\" Varint encoding\n    \"\"\"\n    data = b\"\"\n    while n >= 0x80:\n        data += bytes([(n & 0x7F) | 0x80])\n        n >>= 7\n    data += bytes([n])\n    return data", "entry_point": "varint", "input": "10", "output": "b'\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/xeroc/python-graphenelib/blob/8bb5396bc79998ee424cf3813af478304173f3a6/graphenebase/types.py#L13-L21", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037203", "code": "def varintdecode(data):  # pragma: no cover\n    \"\"\" Varint decoding\n    \"\"\"\n    shift = 0\n    result = 0\n    for b in bytes(data):\n        result |= (b & 0x7F) << shift\n        if not (b & 0x80):\n            break\n        shift += 7\n    return result", "entry_point": "varintdecode", "input": "[5, 3, 1, 4]", "output": "5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/xeroc/python-graphenelib/blob/8bb5396bc79998ee424cf3813af478304173f3a6/graphenebase/types.py#L24-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037204", "code": "def objectid_valid(i):\n        \"\"\" Test if a string looks like a regular object id of the\n            form:::\n\n               xxxx.yyyyy.zzzz\n\n            with those being numbers.\n        \"\"\"\n        if \".\" not in i:\n            return False\n        parts = i.split(\".\")\n        if len(parts) == 3:\n            try:\n                [int(x) for x in parts]\n                return True\n            except Exception:\n                pass\n            return False", "entry_point": "objectid_valid", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/xeroc/python-graphenelib/blob/8bb5396bc79998ee424cf3813af478304173f3a6/graphenecommon/blockchainobject.py#L289-L306", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037205", "code": "def round_data(filter_data):\r\n    \"\"\" round the data\"\"\"\r\n    for index, _ in enumerate(filter_data):\r\n        filter_data[index][0] = round(filter_data[index][0] / 100.0) * 100.0\r\n    return filter_data", "entry_point": "round_data", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/refenv/cijoe/blob/21d7b2ed4ff68e0a1457e7df2db27f6334f1a379/modules/cij/xlsx.py#L374-L378", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037206", "code": "def create_n_gram_df(df, n_pad):\n    \"\"\"\n    Given input dataframe, create feature dataframe of shifted characters\n    \"\"\"\n    n_pad_2 = int((n_pad - 1)/2)\n    for i in range(n_pad_2):\n        df['char-{}'.format(i+1)] = df['char'].shift(i + 1)\n        df['type-{}'.format(i+1)] = df['type'].shift(i + 1)\n        df['char{}'.format(i+1)] = df['char'].shift(-i - 1)\n        df['type{}'.format(i+1)] = df['type'].shift(-i - 1)\n    return df[n_pad_2: -n_pad_2]", "entry_point": "create_n_gram_df", "input": "[5, 3, 1, 4], 2.0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/rkcosmos/deepcut/blob/9a2729071d01972af805acede85d7aa9e7a6da30/deepcut/utils.py#L77-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037207", "code": "def course_modal(context, course=None):\n    \"\"\"\n    Django template tag that returns course information to display in a modal.\n\n    You may pass in a particular course if you like. Otherwise, the modal will look for course context\n    within the parent context.\n\n    Usage:\n        {% course_modal %}\n        {% course_modal course %}\n    \"\"\"\n    if course:\n        context.update({\n            'course_image_uri': course.get('course_image_uri', ''),\n            'course_title': course.get('course_title', ''),\n            'course_level_type': course.get('course_level_type', ''),\n            'course_short_description': course.get('course_short_description', ''),\n            'course_effort': course.get('course_effort', ''),\n            'course_full_description': course.get('course_full_description', ''),\n            'expected_learning_items': course.get('expected_learning_items', []),\n            'staff': course.get('staff', []),\n            'premium_modes': course.get('premium_modes', []),\n        })\n    return context", "entry_point": "course_modal", "input": "'abc', []", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-enterprise/blob/aea91379ab0a87cd3bc798961fce28b60ee49a80/enterprise/templatetags/enterprise.py#L48-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037208", "code": "def get_course_runs_from_program(program):\n    \"\"\"\n    Return course runs from program data.\n\n    Arguments:\n        program(dict): Program data from Course Catalog API\n\n    Returns:\n        set: course runs in given program\n    \"\"\"\n    course_runs = set()\n    for course in program.get(\"courses\", []):\n        for run in course.get(\"course_runs\", []):\n            if \"key\" in run and run[\"key\"]:\n                course_runs.add(run[\"key\"])\n\n    return course_runs", "entry_point": "get_course_runs_from_program", "input": "{'x': [1, 2], 'y': []}", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-enterprise/blob/aea91379ab0a87cd3bc798961fce28b60ee49a80/enterprise/admin/utils.py#L176-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037209", "code": "def format_price(price, currency='$'):\n    \"\"\"\n    Format the price to have the appropriate currency and digits..\n\n    :param price: The price amount.\n    :param currency: The currency for the price.\n    :return: A formatted price string, i.e. '$10', '$10.52'.\n    \"\"\"\n    if int(price) == price:\n        return '{}{}'.format(currency, int(price))\n    return '{}{:0.2f}'.format(currency, price)", "entry_point": "format_price", "input": "True, (1, 2)", "output": "'(1, 2)1'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-enterprise/blob/aea91379ab0a87cd3bc798961fce28b60ee49a80/enterprise/utils.py#L603-L613", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037210", "code": "def _matrix2dict(matrix, etype=False):\n    \"\"\"Takes an adjacency matrix and returns an adjacency list.\"\"\"\n    n = len(matrix)\n    adj = {k: {} for k in range(n)}\n    for k in range(n):\n        for j in range(n):\n            if matrix[k, j] != 0:\n                adj[k][j] = {} if not etype else matrix[k, j]\n\n    return adj", "entry_point": "_matrix2dict", "input": "set(), ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/djordon/queueing-tool/blob/ccd418cf647ac03a54f78ba5e3725903f541b808/queueing_tool/graph/graph_wrapper.py#L15-L24", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037211", "code": "def _dict2dict(adj_dict):\n    \"\"\"Takes a dictionary based representation of an adjacency list\n    and returns a dict of dicts based representation.\n    \"\"\"\n    item = adj_dict.popitem()\n    adj_dict[item[0]] = item[1]\n    if not isinstance(item[1], dict):\n        new_dict = {}\n        for key, value in adj_dict.items():\n            new_dict[key] = {v: {} for v in value}\n\n        adj_dict = new_dict\n    return adj_dict", "entry_point": "_dict2dict", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': {1: {}, 2: {}}, 'y': {}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/djordon/queueing-tool/blob/ccd418cf647ac03a54f78ba5e3725903f541b808/queueing_tool/graph/graph_wrapper.py#L27-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037212", "code": "def info_qry(tickers, flds) -> str:\n    \"\"\"\n    Logging info for given tickers and fields\n\n    Args:\n        tickers: tickers\n        flds: fields\n\n    Returns:\n        str\n\n    Examples:\n        >>> print(info_qry(\n        ...     tickers=['NVDA US Equity'], flds=['Name', 'Security_Name']\n        ... ))\n        tickers: ['NVDA US Equity']\n        fields:  ['Name', 'Security_Name']\n    \"\"\"\n    full_list = '\\n'.join([f'tickers: {tickers[:8]}'] + [\n        f'         {tickers[n:(n + 8)]}' for n in range(8, len(tickers), 8)\n    ])\n    return f'{full_list}\\nfields:  {flds}'", "entry_point": "info_qry", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "\"tickers: ['apple', 'banana', 'cherry']\\nfields:  ['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alpha-xone/xbbg/blob/70226eb19a72a08144b5d8cea9db4913200f7bc5/xbbg/core/assist.py#L279-L300", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037213", "code": "def memberness(context):\n    '''The likelihood that the context is a \"member\".'''\n    if context:\n        texts = context.xpath('.//*[local-name()=\"explicitMember\"]/text()').extract()\n        text = str(texts).lower()\n\n        if len(texts) > 1:\n            return 2\n        elif 'country' in text:\n            return 2\n        elif 'member' not in text:\n            return 0\n        elif 'successor' in text:\n            # 'SuccessorMember' is a rare case that shouldn't be treated as member\n            return 1\n        elif 'parent' in text:\n            return 2\n    return 3", "entry_point": "memberness", "input": "False", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/eliangcs/pystock-crawler/blob/8b803c8944f36af46daf04c6767a74132e37a101/pystock_crawler/loaders.py#L300-L317", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037214", "code": "def rgb_to_ansi256(r, g, b):\n    \"\"\"\n    Convert RGB to ANSI 256 color\n    \"\"\"\n    if r == g and g == b:\n        if r < 8:\n            return 16\n        if r > 248:\n            return 231\n\n        return round(((r - 8) / 247.0) * 24) + 232\n\n    ansi_r = 36 * round(r / 255.0 * 5.0)\n    ansi_g = 6 * round(g / 255.0 * 5.0)\n    ansi_b = round(b / 255.0 * 5.0)\n    ansi = 16 + ansi_r + ansi_g + ansi_b\n    return ansi", "entry_point": "rgb_to_ansi256", "input": "2, 3.25, True", "output": "16", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/timofurrer/colorful/blob/919fa6da17865cc5e01e6b16119193a97d180dc9/colorful/ansi.py#L61-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037215", "code": "def compose_mbox(projects):\n    \"\"\" Compose projects.json only for mbox, but using the mailing_lists lists\n\n    change: 'https://dev.eclipse.org/mailman/listinfo/emft-dev'\n    to: 'emfg-dev /home/bitergia/mboxes/emft-dev.mbox/emft-dev.mbox\n\n    :param projects: projects.json\n    :return: projects.json with mbox\n    \"\"\"\n    mbox_archives = '/home/bitergia/mboxes'\n\n    mailing_lists_projects = [project for project in projects if 'mailing_lists' in projects[project]]\n    for mailing_lists in mailing_lists_projects:\n        projects[mailing_lists]['mbox'] = []\n        for mailing_list in projects[mailing_lists]['mailing_lists']:\n            if 'listinfo' in mailing_list:\n                name = mailing_list.split('listinfo/')[1]\n            elif 'mailing-list' in mailing_list:\n                name = mailing_list.split('mailing-list/')[1]\n            else:\n                name = mailing_list.split('@')[0]\n\n            list_new = \"%s %s/%s.mbox/%s.mbox\" % (name, mbox_archives, name, name)\n            projects[mailing_lists]['mbox'].append(list_new)\n\n    return projects", "entry_point": "compose_mbox", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sirmordred/blob/d6ac94d28d707fae23170064d078f1edf937d13e/sirmordred/eclipse_projects_lib.py#L27-L52", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037216", "code": "def compose_gerrit(projects):\n    \"\"\" Compose projects.json for gerrit, but using the git lists\n\n    change: 'http://git.eclipse.org/gitroot/xwt/org.eclipse.xwt.git'\n    to: 'git.eclipse.org_xwt/org.eclipse.xwt\n\n    :param projects: projects.json\n    :return: projects.json with gerrit\n    \"\"\"\n    git_projects = [project for project in projects if 'git' in projects[project]]\n    for project in git_projects:\n        repos = [repo for repo in projects[project]['git'] if 'gitroot' in repo]\n        if len(repos) > 0:\n            projects[project]['gerrit'] = []\n        for repo in repos:\n            gerrit_project = repo.replace(\"http://git.eclipse.org/gitroot/\", \"\")\n            gerrit_project = gerrit_project.replace(\".git\", \"\")\n            projects[project]['gerrit'].append(\"git.eclipse.org_\" + gerrit_project)\n\n    return projects", "entry_point": "compose_gerrit", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sirmordred/blob/d6ac94d28d707fae23170064d078f1edf937d13e/sirmordred/eclipse_projects_lib.py#L55-L74", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037217", "code": "def compose_git(projects, data):\n    \"\"\" Compose projects.json for git\n\n    We need to replace '/c/' by '/gitroot/' for instance\n\n    change: 'http://git.eclipse.org/c/xwt/org.eclipse.xwt.git'\n    to: 'http://git.eclipse.org/gitroot/xwt/org.eclipse.xwt.git'\n\n    :param projects: projects.json\n    :param data: eclipse JSON\n    :return: projects.json with git\n    \"\"\"\n    for p in [project for project in data if len(data[project]['source_repo']) > 0]:\n        repos = []\n        for url in data[p]['source_repo']:\n            if len(url['url'].split()) > 1:  # Error at upstream the project 'tools.corrosion'\n                repo = url['url'].split()[1].replace('/c/', '/gitroot/')\n            else:\n                repo = url['url'].replace('/c/', '/gitroot/')\n\n            if repo not in repos:\n                repos.append(repo)\n\n        projects[p]['git'] = repos\n\n    return projects", "entry_point": "compose_git", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sirmordred/blob/d6ac94d28d707fae23170064d078f1edf937d13e/sirmordred/eclipse_projects_lib.py#L77-L102", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037218", "code": "def compose_github(projects, data):\n    \"\"\" Compose projects.json for github\n\n    :param projects: projects.json\n    :param data: eclipse JSON\n    :return: projects.json with github\n    \"\"\"\n    for p in [project for project in data if len(data[project]['github_repos']) > 0]:\n        if 'github' not in projects[p]:\n            projects[p]['github'] = []\n\n        urls = [url['url'] for url in data[p]['github_repos'] if\n                url['url'] not in projects[p]['github']]\n        projects[p]['github'] += urls\n\n    return projects", "entry_point": "compose_github", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sirmordred/blob/d6ac94d28d707fae23170064d078f1edf937d13e/sirmordred/eclipse_projects_lib.py#L134-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037219", "code": "def compose_bugzilla(projects, data):\n    \"\"\" Compose projects.json for bugzilla\n\n    :param projects: projects.json\n    :param data: eclipse JSON\n    :return: projects.json with bugzilla\n    \"\"\"\n    for p in [project for project in data if len(data[project]['bugzilla']) > 0]:\n        if 'bugzilla' not in projects[p]:\n            projects[p]['bugzilla'] = []\n\n        urls = [url['query_url'] for url in data[p]['bugzilla'] if\n                url['query_url'] not in projects[p]['bugzilla']]\n        projects[p]['bugzilla'] += urls\n\n    return projects", "entry_point": "compose_bugzilla", "input": "[5, 3, 1, 4], []", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-sirmordred/blob/d6ac94d28d707fae23170064d078f1edf937d13e/sirmordred/eclipse_projects_lib.py#L152-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037220", "code": "def compact_interval_string(value_list):\n  \"\"\"Compact a list of integers into a comma-separated string of intervals.\n\n  Args:\n    value_list: A list of sortable integers such as a list of numbers\n\n  Returns:\n    A compact string representation, such as \"1-5,8,12-15\"\n  \"\"\"\n\n  if not value_list:\n    return ''\n\n  value_list.sort()\n\n  # Start by simply building up a list of separate contiguous intervals\n  interval_list = []\n  curr = []\n  for val in value_list:\n    if curr and (val > curr[-1] + 1):\n      interval_list.append((curr[0], curr[-1]))\n      curr = [val]\n    else:\n      curr.append(val)\n\n  if curr:\n    interval_list.append((curr[0], curr[-1]))\n\n  # For each interval collapse it down to \"first, last\" or just \"first\" if\n  # if first == last.\n  return ','.join([\n      '{}-{}'.format(pair[0], pair[1]) if pair[0] != pair[1] else str(pair[0])\n      for pair in interval_list\n  ])", "entry_point": "compact_interval_string", "input": "[5, 3, 1, 4]", "output": "'1,3-5'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/dsub/blob/443ce31daa6023dc2fd65ef2051796e19d18d5a7/dsub/lib/dsub_util.py#L94-L127", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037221", "code": "def _get_filtered_mounts(mounts, mount_param_type):\n  \"\"\"Helper function to return an appropriate set of mount parameters.\"\"\"\n  return set([mount for mount in mounts if isinstance(mount, mount_param_type)])", "entry_point": "_get_filtered_mounts", "input": "set(), False", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/dsub/blob/443ce31daa6023dc2fd65ef2051796e19d18d5a7/dsub/lib/param_util.py#L385-L387", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037222", "code": "def split_pair(pair_string, separator, nullable_idx=1):\n  \"\"\"Split a string into a pair, which can have one empty value.\n\n  Args:\n    pair_string: The string to be split.\n    separator: The separator to be used for splitting.\n    nullable_idx: The location to be set to null if the separator is not in the\n                  input string. Should be either 0 or 1.\n\n  Returns:\n    A list containing the pair.\n\n  Raises:\n    IndexError: If nullable_idx is not 0 or 1.\n  \"\"\"\n\n  pair = pair_string.split(separator, 1)\n  if len(pair) == 1:\n    if nullable_idx == 0:\n      return [None, pair[0]]\n    elif nullable_idx == 1:\n      return [pair[0], None]\n    else:\n      raise IndexError('nullable_idx should be either 0 or 1.')\n  else:\n    return pair", "entry_point": "split_pair", "input": "'a,b,c', 'a,b,c', -3", "output": "['', '']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/dsub/blob/443ce31daa6023dc2fd65ef2051796e19d18d5a7/dsub/lib/param_util.py#L402-L427", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037223", "code": "def build_recursive_localize_env(destination, inputs):\n  \"\"\"Return a multi-line string with export statements for the variables.\n\n  Arguments:\n    destination: Folder where the data will be put.\n                 For example /mnt/data\n    inputs: a list of InputFileParam\n\n  Returns:\n    a multi-line string with a shell script that sets environment variables\n    corresponding to the inputs.\n  \"\"\"\n  export_input_dirs = '\\n'.join([\n      'export {0}={1}/{2}'.format(var.name, destination.rstrip('/'),\n                                  var.docker_path.rstrip('/'))\n      for var in inputs\n      if var.recursive and var.docker_path\n  ])\n  return export_input_dirs", "entry_point": "build_recursive_localize_env", "input": "[-1, 0, 1, 2], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/dsub/blob/443ce31daa6023dc2fd65ef2051796e19d18d5a7/dsub/lib/providers_util.py#L73-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037224", "code": "def build_mount_env(source, mounts):\n  \"\"\"Return a multi-line string with export statements for the variables.\n\n  Arguments:\n    source: Folder with the data. For example /mnt/data\n    mounts: a list of MountParam\n\n  Returns:\n    a multi-line string with a shell script that sets environment variables\n    corresponding to the mounts.\n  \"\"\"\n  return '\\n'.join([\n      'export {0}={1}/{2}'.format(var.name, source.rstrip('/'),\n                                  var.docker_path.rstrip('/')) for var in mounts\n  ])", "entry_point": "build_mount_env", "input": "[-1, 0, 1, 2], []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/DataBiosphere/dsub/blob/443ce31daa6023dc2fd65ef2051796e19d18d5a7/dsub/lib/providers_util.py#L207-L221", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037225", "code": "def _get_zoom_level(zoom, process):\n    \"\"\"Determine zoom levels.\"\"\"\n    if zoom is None:\n        return reversed(process.config.zoom_levels)\n    if isinstance(zoom, int):\n        return [zoom]\n    elif len(zoom) == 2:\n        return reversed(range(min(zoom), max(zoom)+1))\n    elif len(zoom) == 1:\n        return zoom", "entry_point": "_get_zoom_level", "input": "0, ['apple', 'banana', 'cherry']", "output": "[0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ungarj/mapchete/blob/d482918d0e66a5b414dff6aa7cc854e01fc60ee4/mapchete/_core.py#L923-L932", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037226", "code": "def validate_values(config, values):\n    \"\"\"\n    Validate whether value is found in config and has the right type.\n\n    Parameters\n    ----------\n    config : dict\n        configuration dictionary\n    values : list\n        list of (str, type) tuples of values and value types expected in config\n\n    Returns\n    -------\n    True if config is valid.\n\n    Raises\n    ------\n    Exception if value is not found or has the wrong type.\n    \"\"\"\n    if not isinstance(config, dict):\n        raise TypeError(\"config must be a dictionary\")\n    for value, vtype in values:\n        if value not in config:\n            raise ValueError(\"%s not given\" % value)\n        if not isinstance(config[value], vtype):\n            raise TypeError(\"%s must be %s\" % (value, vtype))\n    return True", "entry_point": "validate_values", "input": "{'x': [1, 2], 'y': []}, []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ungarj/mapchete/blob/d482918d0e66a5b414dff6aa7cc854e01fc60ee4/mapchete/config.py#L578-L604", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037227", "code": "def path_is_remote(path, s3=True):\n    \"\"\"\n    Determine whether file path is remote or local.\n\n    Parameters\n    ----------\n    path : path to file\n\n    Returns\n    -------\n    is_remote : bool\n    \"\"\"\n    prefixes = (\"http://\", \"https://\", \"/vsicurl/\")\n    if s3:\n        prefixes += (\"s3://\", \"/vsis3/\")\n    return path.startswith(prefixes)", "entry_point": "path_is_remote", "input": "'', [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ungarj/mapchete/blob/d482918d0e66a5b414dff6aa7cc854e01fc60ee4/mapchete/io/__init__.py#L176-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037228", "code": "def unindent(lines):\n    \"\"\"\n    Remove common indentation from string.\n\n    Unlike doctrim there is no special treatment of the first line.\n\n    \"\"\"\n    try:\n        # Determine minimum indentation:\n        indent = min(len(line) - len(line.lstrip())\n                     for line in lines if line)\n    except ValueError:\n        return lines\n    else:\n        return [line[indent:] for line in lines]", "entry_point": "unindent", "input": "'Hello World'", "output": "['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/coldfix/doc2md/blob/afd2876316a715d3401adb442d46c9a07cd7e806/doc2md.py#L64-L78", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037229", "code": "def make_toc(sections, maxdepth=0):\n    \"\"\"\n    Generate table of contents for array of section names.\n    \"\"\"\n    if not sections:\n        return []\n    outer = min(n for n,t in sections)\n    refs = []\n    for ind,sec in sections:\n        if maxdepth and ind-outer+1 > maxdepth:\n            continue\n        ref = sec.lower()\n        ref = ref.replace('`', '')\n        ref = ref.replace(' ', '-')\n        ref = ref.replace('?', '')\n        refs.append(\"    \"*(ind-outer) + \"- [%s](#%s)\" % (sec, ref))\n    return refs", "entry_point": "make_toc", "input": "[], 3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/coldfix/doc2md/blob/afd2876316a715d3401adb442d46c9a07cd7e806/doc2md.py#L130-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037230", "code": "def return_segments(shape, break_points):\n    \"\"\"Break a shape into segments between stops using break_points.\n\n    This function can use the `break_points` outputs from\n    `find_segments`, and cuts the shape-sequence into pieces\n    corresponding to each stop.\n    \"\"\"\n    # print 'xxx'\n    # print stops\n    # print shape\n    # print break_points\n    # assert len(stops) == len(break_points)\n    segs = []\n    bp = 0 # not used\n    bp2 = 0\n    for i in range(len(break_points)-1):\n        bp = break_points[i] if break_points[i] is not None else bp2\n        bp2 = break_points[i+1] if break_points[i+1] is not None else bp\n        segs.append(shape[bp:bp2+1])\n    segs.append([])\n    return segs", "entry_point": "return_segments", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "[[0, 1], [1, 2], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CxAalto/gtfspy/blob/bddba4b74faae6c1b91202f19184811e326547e5/gtfspy/shapes.py#L191-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037231", "code": "def _buffer_incomplete_responses(raw_output, buf):\n    \"\"\"It is possible for some of gdb's output to be read before it completely finished its response.\n    In that case, a partial mi response was read, which cannot be parsed into structured data.\n    We want to ALWAYS parse complete mi records. To do this, we store a buffer of gdb's\n    output if the output did not end in a newline.\n\n    Args:\n        raw_output: Contents of the gdb mi output\n        buf (str): Buffered gdb response from the past. This is incomplete and needs to be prepended to\n        gdb's next output.\n\n    Returns:\n        (raw_output, buf)\n    \"\"\"\n\n    if raw_output:\n        if buf:\n            # concatenate buffer and new output\n            raw_output = b\"\".join([buf, raw_output])\n            buf = None\n\n        if b\"\\n\" not in raw_output:\n            # newline was not found, so assume output is incomplete and store in buffer\n            buf = raw_output\n            raw_output = None\n\n        elif not raw_output.endswith(b\"\\n\"):\n            # raw output doesn't end in a newline, so store everything after the last newline (if anything)\n            # in the buffer, and parse everything before it\n            remainder_offset = raw_output.rindex(b\"\\n\") + 1\n            buf = raw_output[remainder_offset:]\n            raw_output = raw_output[:remainder_offset]\n\n    return (raw_output, buf)", "entry_point": "_buffer_incomplete_responses", "input": "False, {'x': [1, 2], 'y': []}", "output": "(False, {'x': [1, 2], 'y': []})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/cs01/pygdbmi/blob/709c781794d3c3b903891f83da011d2d995895d1/pygdbmi/gdbcontroller.py#L444-L477", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037232", "code": "def strToBool(val):\n    \"\"\"\n    Helper function to turn a string representation of \"true\" into\n    boolean True.\n    \"\"\"\n    if isinstance(val, str):\n        val = val.lower()\n\n    return val in ['true', 'on', 'yes', True]", "entry_point": "strToBool", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/jmcclell/django-bootstrap-pagination/blob/3a8187fb6e9b7c2ea4563698e1c3d117204e5049/bootstrap_pagination/templatetags/bootstrap_pagination.py#L46-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037233", "code": "def organization_data_is_valid(organization_data):\n    \"\"\"\n    Organization data validation\n    \"\"\"\n    if organization_data is None:\n        return False\n    if 'id' in organization_data and not organization_data.get('id'):\n        return False\n    if 'name' in organization_data and not organization_data.get('name'):\n        return False\n    return True", "entry_point": "organization_data_is_valid", "input": "[]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-organizations/blob/51000d5d359d880a6eb3a79345f60744f1982c00/organizations/validators.py#L23-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037234", "code": "def is_banner_dimensions(width, height):\n        \"\"\"\\\n        returns true if we think this is kind of a bannery dimension\n        like 600 / 100 = 6 may be a fishy dimension for a good image\n        \"\"\"\n        if width == height:\n            return False\n\n        if width > height:\n            diff = float(width / height)\n            if diff > 5:\n                return True\n\n        if height > width:\n            diff = float(height / width)\n            if diff > 5:\n                return True\n\n        return False", "entry_point": "is_banner_dimensions", "input": "5, 2", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/goose3/goose3/blob/e6994b1b1826af2720a091d1bff5ca15594f558d/goose3/extractors/images.py#L213-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037235", "code": "def resource_basename(resource):\n    \"\"\"Last component of a resource (which always uses '/' as sep).\"\"\"\n    if resource.endswith('/'):\n         resource = resource[:-1]\n    parts = resource.split('/')\n    return parts[-1]", "entry_point": "resource_basename", "input": "'  padded  '", "output": "'  padded  '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Becksteinlab/GromacsWrapper/blob/d4f9a8cb6f48292732cf7c7e4ef4a6d2ccbc51b9/gromacs/config.py#L356-L361", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037236", "code": "def image_psf_shape_tag_from_image_psf_shape(image_psf_shape):\n    \"\"\"Generate an image psf shape tag, to customize phase names based on size of the image PSF that the original PSF \\\n    is trimmed to for faster run times.\n\n    This changes the phase name 'phase_name' as follows:\n\n    image_psf_shape = 1 -> phase_name\n    image_psf_shape = 2 -> phase_name_image_psf_shape_2\n    image_psf_shape = 2 -> phase_name_image_psf_shape_2\n    \"\"\"\n    if image_psf_shape is None:\n        return ''\n    else:\n        y = str(image_psf_shape[0])\n        x = str(image_psf_shape[1])\n        return ('_image_psf_' + y + 'x' + x)", "entry_point": "image_psf_shape_tag_from_image_psf_shape", "input": "[1, 2, 3]", "output": "'_image_psf_1x2'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/pipeline/tagging.py#L56-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037237", "code": "def inversion_psf_shape_tag_from_inversion_psf_shape(inversion_psf_shape):\n    \"\"\"Generate an inversion psf shape tag, to customize phase names based on size of the inversion PSF that the \\\n    original PSF is trimmed to for faster run times.\n\n    This changes the phase name 'phase_name' as follows:\n\n    inversion_psf_shape = 1 -> phase_name\n    inversion_psf_shape = 2 -> phase_name_inversion_psf_shape_2\n    inversion_psf_shape = 2 -> phase_name_inversion_psf_shape_2\n    \"\"\"\n    if inversion_psf_shape is None:\n        return ''\n    else:\n        y = str(inversion_psf_shape[0])\n        x = str(inversion_psf_shape[1])\n        return ('_inv_psf_' + y + 'x' + x)", "entry_point": "inversion_psf_shape_tag_from_inversion_psf_shape", "input": "[5, 3, 1, 4]", "output": "'_inv_psf_5x3'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/pipeline/tagging.py#L73-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037238", "code": "def get_normalization_min_max(array, norm_min, norm_max):\n    \"\"\"Get the minimum and maximum of the normalization of the array, which sets the lower and upper limits of the \\\n    colormap.\n\n    If norm_min / norm_max are not supplied, the minimum / maximum values of the array of data are used.\n\n    Parameters\n    -----------\n    array : data.array.scaled_array.ScaledArray\n        The 2D array of data which is plotted.\n    norm_min : float or None\n        The minimum array value the colormap map spans (all values below this value are plotted the same color).\n    norm_max : float or None\n        The maximum array value the colormap map spans (all values above this value are plotted the same color).\n    \"\"\"\n    if norm_min is None:\n        norm_min = array.min()\n    if norm_max is None:\n        norm_max = array.max()\n\n    return norm_min, norm_max", "entry_point": "get_normalization_min_max", "input": "[], ['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/plotters/array_plotters.py#L252-L272", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037239", "code": "def unmasked_blurred_image_of_planes_from_padded_grid_stack_and_psf(planes, padded_grid_stack, psf):\n    \"\"\"For lens data, compute the unmasked blurred image of every unmasked unblurred image of each plane. To do this, \\\n    this function iterates over all planes to extract their unmasked unblurred images.\n\n    If a galaxy in a plane has a pixelization, the unmasked image is returned as None, as as the inversion's model \\\n    image cannot be mapped to an unmasked version.\n\n    This relies on using the lens data's padded-grid, which is a grid of (y,x) coordinates which extends over the \\\n    entire image as opposed to just the masked region.\n\n    This returns a list, where each list index corresponds to [plane_index].\n\n    Parameters\n    ----------\n    planes : [plane.Plane]\n        The list of planes the unmasked blurred images are computed using.\n    padded_grid_stack : grids.GridStack\n        A padded-grid_stack, whose padded grid is used for PSF convolution.\n    psf : ccd.PSF\n        The PSF of the image used for convolution.\n    \"\"\"\n    unmasked_blurred_image_of_planes = []\n\n    for plane in planes:\n\n        if plane.has_pixelization:\n            unmasked_blurred_image_of_plane = None\n        else:\n            unmasked_blurred_image_of_plane = \\\n                padded_grid_stack.unmasked_blurred_image_from_psf_and_unmasked_image(\n\n                    psf=psf, unmasked_image_1d=plane.image_plane_image_1d)\n\n        unmasked_blurred_image_of_planes.append(unmasked_blurred_image_of_plane)\n\n    return unmasked_blurred_image_of_planes", "entry_point": "unmasked_blurred_image_of_planes_from_padded_grid_stack_and_psf", "input": "[], ('a', 'b', 'c'), [[1, 2], [3], []]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_fit_util.py#L114-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037240", "code": "def unmasked_blurred_image_of_planes_and_galaxies_from_padded_grid_stack_and_psf(planes, padded_grid_stack, psf):\n    \"\"\"For lens data, compute the unmasked blurred image of every unmasked unblurred image of every galaxy in each \\\n    plane. To do this, this function iterates over all planes and then galaxies to extract their unmasked unblurred \\\n    images.\n\n    If a galaxy in a plane has a pixelization, the unmasked image of that galaxy in the plane is returned as None \\\n    as as the inversion's model image cannot be mapped to an unmasked version.\n\n    This relies on using the lens data's padded-grid, which is a grid of (y,x) coordinates which extends over the \\\n    entire image as opposed to just the masked region.\n\n    This returns a list of lists, where each list index corresponds to [plane_index][galaxy_index].\n\n    Parameters\n    ----------\n    planes : [plane.Plane]\n        The list of planes the unmasked blurred images are computed using.\n    padded_grid_stack : grids.GridStack\n        A padded-grid_stack, whose padded grid is used for PSF convolution.\n    psf : ccd.PSF\n        The PSF of the image used for convolution.\n    \"\"\"\n    return [plane.unmasked_blurred_image_of_galaxies_from_psf(padded_grid_stack, psf) for plane in planes]", "entry_point": "unmasked_blurred_image_of_planes_and_galaxies_from_padded_grid_stack_and_psf", "input": "[], ['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Jammy2211/PyAutoLens/blob/91e50369c7a9c048c83d217625578b72423cd5a7/autolens/lens/util/lens_fit_util.py#L152-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037241", "code": "def fill_gaps(list_dicts):\r\n    \"\"\"\r\n    Fill gaps in a list of dictionaries. Add empty keys to dictionaries in\r\n    the list that don't contain other entries' keys\r\n\r\n    :param list_dicts: A list of dictionaries\r\n    :return: A list of field names, a list of dictionaries with identical keys\r\n    \"\"\"\r\n\r\n    field_names = []  # != set bc. preserving order is better for output\r\n    for datum in list_dicts:\r\n        for key in datum.keys():\r\n            if key not in field_names:\r\n                field_names.append(key)\r\n    for datum in list_dicts:\r\n        for key in field_names:\r\n            if key not in datum:\r\n                datum[key] = ''\r\n    return list(field_names), list_dicts", "entry_point": "fill_gaps", "input": "{}", "output": "([], {})", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ScriptSmith/socialreaper/blob/87fcc3b74bbed6c4f8e7f49a5f0eb8a616cf38da/socialreaper/tools.py#L31-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037242", "code": "def populations_slices(particles, num_pop_list):\n    \"\"\"2-tuple of slices for selection of two populations.\n    \"\"\"\n    slices = []\n    i_prev = 0\n    for num_pop in num_pop_list:\n        slices.append(slice(i_prev, i_prev + num_pop))\n        i_prev += num_pop\n    return slices", "entry_point": "populations_slices", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tritemio/PyBroMo/blob/b75f82a4551ff37e7c7a7e6954c536451f3e6d06/pybromo/timestamps.py#L86-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037243", "code": "def translate_buffer_format(vertex_format):\n    \"\"\"Translate the buffer format\"\"\"\n    buffer_format = []\n    attributes = []\n    mesh_attributes = []\n\n    if \"T2F\" in vertex_format:\n        buffer_format.append(\"2f\")\n        attributes.append(\"in_uv\")\n        mesh_attributes.append((\"TEXCOORD_0\", \"in_uv\", 2))\n\n    if \"C3F\" in vertex_format:\n        buffer_format.append(\"3f\")\n        attributes.append(\"in_color\")\n        mesh_attributes.append((\"NORMAL\", \"in_color\", 3))\n\n    if \"N3F\" in vertex_format:\n        buffer_format.append(\"3f\")\n        attributes.append(\"in_normal\")\n        mesh_attributes.append((\"NORMAL\", \"in_normal\", 3))\n\n    buffer_format.append(\"3f\")\n    attributes.append(\"in_position\")\n    mesh_attributes.append((\"POSITION\", \"in_position\", 3))\n\n    return \" \".join(buffer_format), attributes, mesh_attributes", "entry_point": "translate_buffer_format", "input": "[5, 3, 1, 4]", "output": "('3f', ['in_position'], [('POSITION', 'in_position', 3)])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Contraz/demosys-py/blob/6466128a3029c4d09631420ccce73024025bd5b6/demosys/loaders/scene/wavefront.py#L14-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037244", "code": "def parse_package_string(path):\n    \"\"\"\n    Parse the effect package string.\n    Can contain the package python path or path to effect class in an effect package.\n\n    Examples::\n\n        # Path to effect pacakge\n        examples.cubes\n\n        # Path to effect class\n        examples.cubes.Cubes\n\n    Args:\n        path: python path to effect package. May also include effect class name.\n\n    Returns:\n        tuple: (package_path, effect_class)\n    \"\"\"\n    parts = path.split('.')\n\n    # Is the last entry in the path capitalized?\n    if parts[-1][0].isupper():\n        return \".\".join(parts[:-1]), parts[-1]\n\n    return path, \"\"", "entry_point": "parse_package_string", "input": "'Hello World'", "output": "('', 'Hello World')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Contraz/demosys-py/blob/6466128a3029c4d09631420ccce73024025bd5b6/demosys/effects/registry.py#L9-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037245", "code": "def hmean(nums):\n    r\"\"\"Return harmonic mean.\n\n    The harmonic mean is defined as:\n    :math:`\\frac{|nums|}{\\sum\\limits_{i}\\frac{1}{nums_i}}`\n\n    Following the behavior of Wolfram|Alpha:\n    - If one of the values in nums is 0, return 0.\n    - If more than one value in nums is 0, return NaN.\n\n    Cf. https://en.wikipedia.org/wiki/Harmonic_mean\n\n    Parameters\n    ----------\n    nums : list\n        A series of numbers\n\n    Returns\n    -------\n    float\n        The harmonic mean of nums\n\n    Raises\n    ------\n    AttributeError\n        hmean requires at least one value\n\n    Examples\n    --------\n    >>> hmean([1, 2, 3, 4])\n    1.9200000000000004\n    >>> hmean([1, 2])\n    1.3333333333333333\n    >>> hmean([0, 5, 1000])\n    0\n\n    \"\"\"\n    if len(nums) < 1:\n        raise AttributeError('hmean requires at least one value')\n    elif len(nums) == 1:\n        return nums[0]\n    else:\n        for i in range(1, len(nums)):\n            if nums[0] != nums[i]:\n                break\n        else:\n            return nums[0]\n\n    if 0 in nums:\n        if nums.count(0) > 1:\n            return float('nan')\n        return 0\n    return len(nums) / sum(1 / i for i in nums)", "entry_point": "hmean", "input": "[1, 2, 3]", "output": "1.6363636363636365", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chrislit/abydos/blob/165466b3ff6afd8024a4c8660421b0c4e7773db9/abydos/stats/_mean.py#L124-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037246", "code": "def lehmer_mean(nums, exp=2):\n    r\"\"\"Return Lehmer mean.\n\n    The Lehmer mean is:\n    :math:`\\frac{\\sum\\limits_i{x_i^p}}{\\sum\\limits_i{x_i^(p-1)}}`\n\n    Cf. https://en.wikipedia.org/wiki/Lehmer_mean\n\n    Parameters\n    ----------\n    nums : list\n        A series of numbers\n    exp : numeric\n        The exponent of the Lehmer mean\n\n    Returns\n    -------\n    float\n        The Lehmer mean of nums for the given exponent\n\n    Examples\n    --------\n    >>> lehmer_mean([1, 2, 3, 4])\n    3.0\n    >>> lehmer_mean([1, 2])\n    1.6666666666666667\n    >>> lehmer_mean([0, 5, 1000])\n    995.0497512437811\n\n    \"\"\"\n    return sum(x ** exp for x in nums) / sum(x ** (exp - 1) for x in nums)", "entry_point": "lehmer_mean", "input": "[1, 2, 3], 0.5", "output": "1.81498897922341", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chrislit/abydos/blob/165466b3ff6afd8024a4c8660421b0c4e7773db9/abydos/stats/_mean.py#L382-L412", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037247", "code": "def heronian_mean(nums):\n    r\"\"\"Return Heronian mean.\n\n    The Heronian mean is:\n    :math:`\\frac{\\sum\\limits_{i, j}\\sqrt{{x_i \\cdot x_j}}}\n    {|nums| \\cdot \\frac{|nums| + 1}{2}}`\n    for :math:`j \\ge i`\n\n    Cf. https://en.wikipedia.org/wiki/Heronian_mean\n\n    Parameters\n    ----------\n    nums : list\n        A series of numbers\n\n    Returns\n    -------\n    float\n        The Heronian mean of nums\n\n    Examples\n    --------\n    >>> heronian_mean([1, 2, 3, 4])\n    2.3888282852609093\n    >>> heronian_mean([1, 2])\n    1.4714045207910316\n    >>> heronian_mean([0, 5, 1000])\n    179.28511301977582\n\n    \"\"\"\n    mag = len(nums)\n    rolling_sum = 0\n    for i in range(mag):\n        for j in range(i, mag):\n            if nums[i] == nums[j]:\n                rolling_sum += nums[i]\n            else:\n                rolling_sum += (nums[i] * nums[j]) ** 0.5\n    return rolling_sum * 2 / (mag * (mag + 1))", "entry_point": "heronian_mean", "input": "[5, 3, 1, 4]", "output": "3.0777339701413418", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chrislit/abydos/blob/165466b3ff6afd8024a4c8660421b0c4e7773db9/abydos/stats/_mean.py#L415-L453", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037248", "code": "def median(nums):\n    \"\"\"Return median.\n\n    With numbers sorted by value, the median is the middle value (if there is\n    an odd number of values) or the arithmetic mean of the two middle values\n    (if there is an even number of values).\n\n    Cf. https://en.wikipedia.org/wiki/Median\n\n    Parameters\n    ----------\n    nums : list\n        A series of numbers\n\n    Returns\n    -------\n    int or float\n        The median of nums\n\n    Examples\n    --------\n    >>> median([1, 2, 3])\n    2\n    >>> median([1, 2, 3, 4])\n    2.5\n    >>> median([1, 2, 2, 4])\n    2\n\n    \"\"\"\n    nums = sorted(nums)\n    mag = len(nums)\n    if mag % 2:\n        mag = int((mag - 1) / 2)\n        return nums[mag]\n    mag = int(mag / 2)\n    med = (nums[mag - 1] + nums[mag]) / 2\n    return med if not med.is_integer() else int(med)", "entry_point": "median", "input": "['apple', 'banana', 'cherry']", "output": "'banana'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chrislit/abydos/blob/165466b3ff6afd8024a4c8660421b0c4e7773db9/abydos/stats/_mean.py#L644-L680", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037249", "code": "def _process_field_queries(field_dictionary):\n    \"\"\"\n    We have a field_dictionary - we want to match the values for an elasticsearch \"match\" query\n    This is only potentially useful when trying to tune certain search operations\n    \"\"\"\n    def field_item(field):\n        \"\"\" format field match as \"match\" item for elasticsearch query \"\"\"\n        return {\n            \"match\": {\n                field: field_dictionary[field]\n            }\n        }\n\n    return [field_item(field) for field in field_dictionary]", "entry_point": "_process_field_queries", "input": "{'x': [1, 2], 'y': []}", "output": "[{'match': {'x': [1, 2]}}, {'match': {'y': []}}]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-search/blob/476cf02b71ceba34ae7d8b798f36d60692317c55/search/elastic.py#L93-L106", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037250", "code": "def _process_exclude_dictionary(exclude_dictionary):\n    \"\"\"\n    Based on values in the exclude_dictionary generate a list of term queries that\n    will filter out unwanted results.\n    \"\"\"\n    # not_properties will hold the generated term queries.\n    not_properties = []\n    for exclude_property in exclude_dictionary:\n        exclude_values = exclude_dictionary[exclude_property]\n        if not isinstance(exclude_values, list):\n            exclude_values = [exclude_values]\n        not_properties.extend([{\"term\": {exclude_property: exclude_value}} for exclude_value in exclude_values])\n\n    # Returning a query segment with an empty list freaks out ElasticSearch,\n    #   so just return an empty segment.\n    if not not_properties:\n        return {}\n\n    return {\n        \"not\": {\n            \"filter\": {\n                \"or\": not_properties\n            }\n        }\n    }", "entry_point": "_process_exclude_dictionary", "input": "{'x': [1, 2], 'y': []}", "output": "{'not': {'filter': {'or': [{'term': {'x': 1}}, {'term': {'x': 2}}]}}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-search/blob/476cf02b71ceba34ae7d8b798f36d60692317c55/search/elastic.py#L145-L169", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037251", "code": "def _process_facet_terms(facet_terms):\n    \"\"\" We have a list of terms with which we return facets \"\"\"\n    elastic_facets = {}\n    for facet in facet_terms:\n        facet_term = {\"field\": facet}\n        if facet_terms[facet]:\n            for facet_option in facet_terms[facet]:\n                facet_term[facet_option] = facet_terms[facet][facet_option]\n\n        elastic_facets[facet] = {\n            \"terms\": facet_term\n        }\n\n    return elastic_facets", "entry_point": "_process_facet_terms", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-search/blob/476cf02b71ceba34ae7d8b798f36d60692317c55/search/elastic.py#L172-L185", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037252", "code": "def merge_list(list1, list2):\n    \"\"\"\n    Merges the contents of two lists into a new list.\n\n    :param list1: the first list\n    :type list1: list\n    :param list2: the second list\n    :type list2: list\n    :returns: list\n    \"\"\"\n\n    merged = list(list1)\n\n    for value in list2:\n        if value not in merged:\n            merged.append(value)\n\n    return merged", "entry_point": "merge_list", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "[5, 3, 1, 4, [1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/jayclassless/tidypy/blob/3c3497ca377fbbe937103b77b02b326c860c748f/src/tidypy/util.py#L23-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037253", "code": "def matches_masks(target, masks):\n    \"\"\"\n    Determines whether or not the target string matches any of the regular\n    expressions specified.\n\n    :param target: the string to check\n    :type target: str\n    :param masks: the regular expressions to check against\n    :type masks: list(regular expression object)\n    :returns: bool\n    \"\"\"\n\n    for mask in masks:\n        if mask.search(target):\n            return True\n    return False", "entry_point": "matches_masks", "input": "[-1, 0, 1, 2], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/jayclassless/tidypy/blob/3c3497ca377fbbe937103b77b02b326c860c748f/src/tidypy/util.py#L165-L180", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037254", "code": "def _truthyConfValue(v):\n    ''' Determine yotta-config truthiness. In yotta config land truthiness is\n        different to python or json truthiness (in order to map nicely only\n        preprocessor and CMake definediness):\n\n          json      -> python -> truthy/falsey\n          false     -> False  -> Falsey\n          null      -> None   -> Falsey\n          undefined -> None   -> Falsey\n          0         -> 0      -> Falsey\n          \"\"        -> \"\"     -> Truthy (different from python)\n          \"0\"       -> \"0\"    -> Truthy\n          {}        -> {}     -> Truthy (different from python)\n          []        -> []     -> Truthy (different from python)\n          everything else is truthy\n    '''\n    if v is False:\n        return False\n    elif v is None:\n        return False\n    elif v == 0:\n        return False\n    else:\n        # everything else is truthy!\n        return True", "entry_point": "_truthyConfValue", "input": "['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ARMmbed/yotta/blob/56bc1e56c602fa20307b23fe27518e9cd6c11af1/yotta/lib/component.py#L41-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037255", "code": "def pretty_bytes(bytes): # pylint: disable=redefined-builtin\n    \"\"\"\n    Scales a byte count to the largest scale with a small whole number\n    that's easier to read.\n    Returns a tuple of the format (scaled_float, unit_string).\n    \"\"\"\n    if not bytes:\n        return bytes, 'bytes'\n    sign = bytes/float(bytes)\n    bytes = abs(bytes)\n    for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:\n        if bytes < 1024.0:\n            #return \"%3.1f %s\" % (bytes, x)\n            return sign*bytes, x\n        bytes /= 1024.0", "entry_point": "pretty_bytes", "input": "[]", "output": "([], 'bytes')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L2257-L2271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037256", "code": "def _time_independent_equals(a, b):\n    '''\n    This compares two values in constant time.\n\n    Taken from tornado:\n\n    https://github.com/tornadoweb/tornado/blob/\n    d4eb8eb4eb5cc9a6677e9116ef84ded8efba8859/tornado/web.py#L3060\n\n    '''\n    if len(a) != len(b):\n        return False\n    result = 0\n    if isinstance(a[0], int):  # python3 byte strings\n        for x, y in zip(a, b):\n            result |= x ^ y\n    else:  # python2\n        for x, y in zip(a, b):\n            result |= ord(x) ^ ord(y)\n    return result == 0", "entry_point": "_time_independent_equals", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L3032-L3051", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037257", "code": "def keplermag_to_sdssr(keplermag, kic_sdssg, kic_sdssr):\n    '''Converts magnitude measurements in Kepler band to SDSS r band.\n\n    Parameters\n    ----------\n\n    keplermag : float or array-like\n        The Kepler magnitude value(s) to convert to fluxes.\n\n    kic_sdssg,kic_sdssr : float or array-like\n        The SDSS g and r magnitudes of the object(s) from the Kepler Input\n        Catalog. The .llc.fits MAST light curve file for a Kepler object\n        contains these values in the FITS extension 0 header.\n\n    Returns\n    -------\n\n    float or array-like\n        SDSS r band magnitude(s) converted from the Kepler band magnitude.\n\n    '''\n    kic_sdssgr = kic_sdssg - kic_sdssr\n\n    if kic_sdssgr < 0.8:\n        kepsdssr = (keplermag - 0.2*kic_sdssg)/0.8\n    else:\n        kepsdssr = (keplermag - 0.1*kic_sdssg)/0.9\n    return kepsdssr", "entry_point": "keplermag_to_sdssr", "input": "2.0, False, True", "output": "2.5", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L138-L165", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037258", "code": "def _single_true(iterable):\n    '''This returns True if only one True-ish element exists in `iterable`.\n\n    Parameters\n    ----------\n\n    iterable : iterable\n\n    Returns\n    -------\n\n    bool\n        True if only one True-ish element exists in `iterable`. False otherwise.\n\n    '''\n\n    # return True if exactly one true found\n    iterator = iter(iterable)\n\n    # consume from \"i\" until first true or it's exhausted\n    has_true = any(iterator)\n\n    # carry on consuming until another true value / exhausted\n    has_another_true = any(iterator)\n\n    return has_true and not has_another_true", "entry_point": "_single_true", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/timeutils.py#L265-L290", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037259", "code": "def inv_entry_to_path(data):\n    \"\"\"\n    Determine the path from the intersphinx inventory entry\n\n    Discard the anchors between head and tail to make it\n    compatible with situations where extra meta information is encoded.\n    \"\"\"\n    path_tuple = data[2].split(\"#\")\n    if len(path_tuple) > 1:\n        path_str = \"#\".join((path_tuple[0], path_tuple[-1]))\n    else:\n        path_str = data[2]\n    return path_str", "entry_point": "inv_entry_to_path", "input": "['apple', 'banana', 'cherry']", "output": "'cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hynek/doc2dash/blob/659a66e237eb0faa08e81094fc4140623b418952/src/doc2dash/parsers/intersphinx.py#L121-L133", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037260", "code": "def wrap_name(name):\n        \"\"\"Wraps SkillName:entity into SkillName:{entity}\"\"\"\n        if ':' in name:\n            parts = name.split(':')\n            intent_name, ent_name = parts[0], parts[1:]\n            return intent_name + ':{' + ':'.join(ent_name) + '}'\n        else:\n            return '{' + name + '}'", "entry_point": "wrap_name", "input": "'AbC dEf'", "output": "'{AbC dEf}'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/MycroftAI/padatious/blob/794a2530d6079bdd06e193edd0d30b2cc793e631/padatious/entity.py#L32-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037261", "code": "def resolve_conflicts(inputs, outputs):\n    \"\"\"\n    Checks for duplicate inputs and if there are any,\n    remove one and set the output to the max of the two outputs\n    Args:\n        inputs (list<list<float>>): Array of input vectors\n        outputs (list<list<float>>): Array of output vectors\n    Returns:\n        tuple<inputs, outputs>: The modified inputs and outputs\n    \"\"\"\n    data = {}\n    for inp, out in zip(inputs, outputs):\n        tup = tuple(inp)\n        if tup in data:\n            data[tup].append(out)\n        else:\n            data[tup] = [out]\n\n    inputs, outputs = [], []\n    for inp, outs in data.items():\n        inputs.append(list(inp))\n        combined = [0] * len(outs[0])\n        for i in range(len(combined)):\n            combined[i] = max(j[i] for j in outs)\n        outputs.append(combined)\n    return inputs, outputs", "entry_point": "resolve_conflicts", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "([[1, 2], [3], []], [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/MycroftAI/padatious/blob/794a2530d6079bdd06e193edd0d30b2cc793e631/padatious/util.py#L99-L124", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037262", "code": "def parse_int_list(string):\n    \"\"\"\n    Parses a string of numbers and ranges into a list of integers. Ranges\n    are separated by dashes and inclusive of both the start and end number.\n\n    Example:\n        parse_int_list(\"8 9 10,11-13\") == [8,9,10,11,12,13]\n    \"\"\"\n    integers = []\n    for comma_part in string.split(\",\"):\n        for substring in comma_part.split(\" \"):\n            if len(substring) == 0:\n                continue\n            if \"-\" in substring:\n                left, right = substring.split(\"-\")\n                left_val = int(left.strip())\n                right_val = int(right.strip())\n                integers.extend(range(left_val, right_val + 1))\n            else:\n                integers.append(int(substring.strip()))\n    return integers", "entry_point": "parse_int_list", "input": "''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/openvax/mhctools/blob/b329b4dccd60fae41296816b8cbfe15d6ca07e67/mhctools/cli/parsing_helpers.py#L17-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037263", "code": "def _get_base_url(base_url, api, version):\n        \"\"\"\n            create the base url for the api\n\n        Parameters\n        ----------\n        base_url : str\n            format of the base_url using {api} and {version}\n        api : str\n            name of the api to use\n        version : str\n            version of the api\n\n        Returns\n        -------\n        str\n            the base url of the api you want to use\n        \"\"\"\n        format_args = {}\n\n        if \"{api}\" in base_url:\n            if api == \"\":\n                base_url = base_url.replace('{api}.', '')\n            else:\n                format_args['api'] = api\n\n        if \"{version}\" in base_url:\n            if version == \"\":\n                base_url = base_url.replace('/{version}', '')\n            else:\n                format_args['version'] = version\n\n        return base_url.format(api=api, version=version)", "entry_point": "_get_base_url", "input": "'AbC dEf', 3.25, -1.5", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/odrling/peony-twitter/blob/967f98e16e1889389540f2e6acbf7cc7a1a80203/peony/client.py#L187-L219", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037264", "code": "def clean_fields(fields, ignored_value_indices, transforms):\n    \"\"\"\n    Sometimes, NetMHC* has fields that are only populated sometimes, which results\n    in different count/indexing of the fields when that happens.\n\n    We handle this by looking for particular strings at particular indices, and\n    deleting them.\n\n    Warning: this may result in unexpected behavior sometimes. For example, we\n    ignore \"SB\" and \"WB\" for NetMHC 3.x output; which also means that any line\n    with a key called SB or WB will be ignored.\n\n    Also, sometimes NetMHC* will have fields that we want to modify in some\n    consistent way, e.g. NetMHCpan3 has 1-based offsets and all other predictors\n    have 0-based offsets (and we rely on 0-based offsets). We handle this using\n    a map from field index to transform function.\n    \"\"\"\n    cleaned_fields = []\n    for i, field in enumerate(fields):\n        if field in ignored_value_indices:\n            ignored_index = ignored_value_indices[field]\n\n            # Is the value we want to ignore at the index where we'd ignore it?\n            if ignored_index == i:\n                continue\n\n        # transform this field if the index is in transforms, otherwise leave alone\n        cleaned_field = transforms[i](field) if i in transforms else field\n        cleaned_fields.append(cleaned_field)\n    return cleaned_fields", "entry_point": "clean_fields", "input": "['apple', 'banana', 'cherry'], [1, 2, 3], [[1, 2], [3], []]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/openvax/mhctools/blob/b329b4dccd60fae41296816b8cbfe15d6ca07e67/mhctools/parsing.py#L69-L98", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037265", "code": "def aligned_indel_filter(clust, max_internal_indels):\n    \"\"\" checks for too many internal indels in muscle aligned clusters \"\"\"\n\n    ## make into list\n    lclust = clust.split()\n    \n    ## paired or not\n    try:\n        seq1 = [i.split(\"nnnn\")[0] for i in lclust[1::2]]\n        seq2 = [i.split(\"nnnn\")[1] for i in lclust[1::2]]\n        intindels1 = [i.rstrip(\"-\").lstrip(\"-\").count(\"-\") for i in seq1]\n        intindels2 = [i.rstrip(\"-\").lstrip(\"-\").count(\"-\") for i in seq2]\n        intindels = intindels1 + intindels2\n        if max(intindels) > max_internal_indels:\n            return 1\n       \n    except IndexError:\n        seq1 = lclust[1::2]\n        intindels = [i.rstrip(\"-\").lstrip(\"-\").count(\"-\") for i in seq1]\n        if max(intindels) > max_internal_indels:\n            return 1 \n    \n    return 0", "entry_point": "aligned_indel_filter", "input": "'Hello World', 0", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dereneaton/ipyrad/blob/5eeb8a178160f45faf71bf47cec4abe998a575d1/ipyrad/assemble/cluster_within.py#L467-L489", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037266", "code": "def comp(seq):\n    \"\"\" returns a seq with complement. Preserves little n's for splitters.\"\"\"\n    ## makes base to its small complement then makes upper\n    return seq.replace(\"A\", 't')\\\n              .replace('T', 'a')\\\n              .replace('C', 'g')\\\n              .replace('G', 'c')\\\n              .replace('n', 'Z')\\\n              .upper()\\\n              .replace(\"Z\", \"n\")", "entry_point": "comp", "input": "'abc'", "output": "'ABC'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dereneaton/ipyrad/blob/5eeb8a178160f45faf71bf47cec4abe998a575d1/ipyrad/assemble/util.py#L236-L245", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037267", "code": "def revcomp(sequence):\n    \"returns reverse complement of a string\"\n    sequence = sequence[::-1].strip()\\\n                             .replace(\"A\", \"t\")\\\n                             .replace(\"T\", \"a\")\\\n                             .replace(\"C\", \"g\")\\\n                             .replace(\"G\", \"c\").upper()\n    return sequence", "entry_point": "revcomp", "input": "'Hello World'", "output": "'DLROW OLLEH'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dereneaton/ipyrad/blob/5eeb8a178160f45faf71bf47cec4abe998a575d1/ipyrad/assemble/util.py#L798-L805", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037268", "code": "def lab_to_rgb(l, a, b):\n    \n    \"\"\" Converts CIE Lab to RGB components.\n    \n    First we have to convert to XYZ color space.\n    Conversion involves using a white point,\n    in this case D65 which represents daylight illumination.\n    \n    Algorithms adopted from:\n    http://www.easyrgb.com/math.php\n    \n    \"\"\"\n    \n    y = (l+16) / 116.0\n    x = a/500.0 + y\n    z = y - b/200.0\n    v = [x,y,z]\n    for i in range(3):\n        if pow(v[i],3) > 0.008856: \n            v[i] = pow(v[i],3)\n        else: \n            v[i] = (v[i]-16/116.0) / 7.787\n\n    # Observer = 2, Illuminant = D65\n    x = v[0] * 95.047/100\n    y = v[1] * 100.0/100\n    z = v[2] * 108.883/100\n\n    r = x * 3.2406 + y *-1.5372 + z *-0.4986\n    g = x *-0.9689 + y * 1.8758 + z * 0.0415\n    b = x * 0.0557 + y *-0.2040 + z * 1.0570\n    v = [r,g,b]\n    for i in range(3):\n        if v[i] > 0.0031308:\n            v[i] = 1.055 * pow(v[i], 1/2.4) - 0.055\n        else:\n            v[i] = 12.92 * v[i]\n\n    #r, g, b = v[0]*255, v[1]*255, v[2]*255\n    r, g, b = v[0], v[1], v[2]\n    return r, g, b", "entry_point": "lab_to_rgb", "input": "False, 10, 1", "output": "(0.08799319401162115, -0.030933901029176817, -0.00779089600261976)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/shoebot/shoebot/blob/d554c1765c1899fa25727c9fc6805d221585562b/lib/web/kuler.py#L31-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037269", "code": "def lerp(a, b, t):\r\n    \"\"\" Returns the linear interpolation between a and b for time t between 0.0-1.0.\r\n        For example: lerp(100, 200, 0.5) => 150.\r\n    \"\"\"\r\n    if t < 0.0:\r\n        return a\r\n    if t > 1.0:\r\n        return b\r\n    return a + (b - a) * t", "entry_point": "lerp", "input": "0.5, True, 3.25", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/shoebot/shoebot/blob/d554c1765c1899fa25727c9fc6805d221585562b/shoebot/data/geometry.py#L64-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037270", "code": "def smoothstep(a, b, x):\r\n    \"\"\" Returns a smooth transition between 0.0 and 1.0 using Hermite interpolation (cubic spline),\r\n        where x is a number between a and b. The return value will ease (slow down) as x nears a or b.\r\n        For x smaller than a, returns 0.0. For x bigger than b, returns 1.0.\r\n    \"\"\"\r\n    if x < a:\r\n        return 0.0\r\n    if x >= b:\r\n        return 1.0\r\n    x = float(x - a) / (b - a)\r\n    return x * x * (3 - 2 * x)", "entry_point": "smoothstep", "input": "[-1, 0, 1, 2], ['apple', 'banana', 'cherry'], []", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/shoebot/shoebot/blob/d554c1765c1899fa25727c9fc6805d221585562b/shoebot/data/geometry.py#L75-L85", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037271", "code": "def point_in_polygon(points, x, y):\r\n    \"\"\" Ray casting algorithm.\r\n        Determines how many times a horizontal ray starting from the point\r\n        intersects with the sides of the polygon.\r\n        If it is an even number of times, the point is outside, if odd, inside.\r\n        The algorithm does not always report correctly when the point is very close to the boundary.\r\n        The polygon is passed as a list of (x,y)-tuples.\r\n    \"\"\"\r\n    odd = False\r\n    n = len(points)\r\n    for i in range(n):\r\n        j = i < n - 1 and i + 1 or 0\r\n        x0, y0 = points[i][0], points[i][1]\r\n        x1, y1 = points[j][0], points[j][1]\r\n        if (y0 < y and y1 >= y) or (y1 < y and y0 >= y):\r\n            if x0 + (y - y0) / (y1 - y0) * (x1 - x0) < x:\r\n                odd = not odd\r\n    return odd", "entry_point": "point_in_polygon", "input": "[], ['a', 'b', 'c'], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/shoebot/shoebot/blob/d554c1765c1899fa25727c9fc6805d221585562b/shoebot/data/geometry.py#L157-L174", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037272", "code": "def unique(list):\n    \"\"\" Returns a copy of the list without duplicates.\n    \"\"\"\n    unique = []; [unique.append(x) for x in list if x not in unique]\n    return unique", "entry_point": "unique", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/shoebot/shoebot/blob/d554c1765c1899fa25727c9fc6805d221585562b/lib/graph/cluster.py#L16-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037273", "code": "def is_math(str):\n    \n    \"\"\" Determines if an item in a paragraph is a LaTeX math equation.\n    \n    Math equations are wrapped in <math></math> tags.\n    They can be drawn as an image using draw_math().\n    \n    \"\"\"\n    \n    str = str.strip()\n    if str.startswith(\"<math>\") and str.endswith(\"</math>\"):\n        return True\n    else:\n        return False", "entry_point": "is_math", "input": "''", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/shoebot/shoebot/blob/d554c1765c1899fa25727c9fc6805d221585562b/lib/web/wikipedia.py#L1368-L1381", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037274", "code": "def format_pylint_disables(error_names, tag=True):\n    \"\"\"\n    Format a list of error_names into a 'pylint: disable=' line.\n    \"\"\"\n    tag_str = \"lint-amnesty, \" if tag else \"\"\n    if error_names:\n        return u\"  # {tag}pylint: disable={disabled}\".format(\n            disabled=\", \".join(sorted(error_names)),\n            tag=tag_str,\n        )\n    else:\n        return \"\"", "entry_point": "format_pylint_disables", "input": "'a,b,c', [1, 2, 3]", "output": "'  # lint-amnesty, pylint: disable=,, ,, a, b, c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edx/edx-lint/blob/d87ccb51a48984806b6442a36992c5b45c3d4d58/edx_lint/cmd/amnesty.py#L51-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037275", "code": "def get_value(obj, key, default=None):\n    \"\"\"\n    Mimic JavaScript Object/Array behavior by allowing access to nonexistent\n    indexes.\n    \"\"\"\n    if isinstance(obj, dict):\n        return obj.get(key, default)\n    elif isinstance(obj, list):\n        try:\n            return obj[key]\n        except IndexError:\n            return default", "entry_point": "get_value", "input": "{'x': [1, 2], 'y': []}, -1.5, set()", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/wq/html-json-forms/blob/4dfbfabeee924ba832a7a387ab3b02b6d51d9701/html_json_forms/utils.py#L228-L239", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037276", "code": "def _censor_with(x, range, value=None):\n    \"\"\"\n    Censor any values outside of range with ``None``\n    \"\"\"\n    return [val if range[0] <= val <= range[1] else value\n            for val in x]", "entry_point": "_censor_with", "input": "[5, 3, 1, 4], [1, 2, 3], [5, 3, 1, 4]", "output": "[[5, 3, 1, 4], [5, 3, 1, 4], 1, [5, 3, 1, 4]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/has2k1/mizani/blob/312d0550ee0136fd1b0384829b33f3b2065f47c8/mizani/bounds.py#L363-L368", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037277", "code": "def _parse_link_header(headers):\n    \"\"\"Parses Github's link header for pagination.\n\n    TODO eventually use a github client for this\n    \"\"\"\n    links = {}\n    if 'link' in headers:\n        link_headers = headers['link'].split(', ')\n        for link_header in link_headers:\n            (url, rel) = link_header.split('; ')\n            url = url[1:-1]\n            rel = rel[5:-1]\n            links[rel] = url\n    return links", "entry_point": "_parse_link_header", "input": "['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/CloverHealth/temple/blob/d7b75da2459f72ba74d6f3b6e1ab95c3d1b92ccd/temple/ls.py#L16-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037278", "code": "def is_repeated_suggestion(params, history):\n        \"\"\"\n        Parameters\n        ----------\n        params : dict\n            Trial param set\n        history : list of 3-tuples\n            History of past function evaluations. Each element in history\n            should be a tuple `(params, score, status)`, where `params` is a\n            dict mapping parameter names to values\n\n        Returns\n        -------\n        is_repeated_suggestion : bool\n        \"\"\"\n        if any(params == hparams and hstatus == 'SUCCEEDED'\n               for hparams, hscore, hstatus in history):\n            return True\n        else:\n            return False", "entry_point": "is_repeated_suggestion", "input": "{}, set()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/msmbuilder/osprey/blob/ea09da24e45820e1300e24a52fefa6c849f7a986/osprey/strategies.py#L48-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037279", "code": "def _prettify_dict(key):\n    \"\"\"Return a human readable format of a key (dict).\n\n    Example:\n\n    Description:   My Wonderful Key\n    Uid:           a54d6de1-922a-4998-ad34-cb838646daaa\n    Created_At:    2016-09-15T12:42:32\n    Metadata:      owner=me;\n    Modified_At:   2016-09-15T12:42:32\n    Value:         secret_key=my_secret_key;access_key=my_access_key\n    Name:          aws\n    \"\"\"\n    assert isinstance(key, dict)\n\n    pretty_key = ''\n    for key, value in key.items():\n        if isinstance(value, dict):\n            pretty_value = ''\n            for k, v in value.items():\n                pretty_value += '{0}={1};'.format(k, v)\n            value = pretty_value\n        pretty_key += '{0:15}{1}\\n'.format(key.title() + ':', value)\n    return pretty_key", "entry_point": "_prettify_dict", "input": "{}", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nir0s/ghost/blob/77da967a4577ca4cf100cfe34e87b39ad88bf21c/ghost.py#L1147-L1170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037280", "code": "def _prettify_list(items):\n    \"\"\"Return a human readable format of a list.\n\n    Example:\n\n    Available Keys:\n      - my_first_key\n      - my_second_key\n    \"\"\"\n    assert isinstance(items, list)\n\n    keys_list = 'Available Keys:'\n    for item in items:\n        keys_list += '\\n  - {0}'.format(item)\n    return keys_list", "entry_point": "_prettify_list", "input": "['apple', 'banana', 'cherry']", "output": "'Available Keys:\\n  - apple\\n  - banana\\n  - cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nir0s/ghost/blob/77da967a4577ca4cf100cfe34e87b39ad88bf21c/ghost.py#L1173-L1187", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037281", "code": "def _localize(dt):\n        \"\"\"\n        Rely on pytz.localize to ensure new result honors DST.\n        \"\"\"\n        try:\n            tz = dt.tzinfo\n            return tz.localize(dt.replace(tzinfo=None))\n        except AttributeError:\n            return dt", "entry_point": "_localize", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/tempora/blob/f0a9ab636103fe829aa9b495c93f5249aac5f2b8/tempora/schedule.py#L101-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037282", "code": "def divide_timedelta(td1, td2):\n\t\"\"\"\n\tGet the ratio of two timedeltas\n\n\t>>> one_day = datetime.timedelta(days=1)\n\t>>> one_hour = datetime.timedelta(hours=1)\n\t>>> divide_timedelta(one_hour, one_day) == 1 / 24\n\tTrue\n\t\"\"\"\n\ttry:\n\t\treturn td1 / td2\n\texcept TypeError:\n\t\t# Python 3.2 gets division\n\t\t# http://bugs.python.org/issue2706\n\t\treturn td1.total_seconds() / td2.total_seconds()", "entry_point": "divide_timedelta", "input": "2.0, True", "output": "2.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/tempora/blob/f0a9ab636103fe829aa9b495c93f5249aac5f2b8/tempora/__init__.py#L467-L481", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037283", "code": "def __common_triplet(input_string, consonants, vowels):\n    \"\"\"__common_triplet(input_string, consonants, vowels) -> string\"\"\"\n    output = consonants\n\n    while len(output) < 3:\n        try:\n            output += vowels.pop(0)\n        except IndexError:\n            # If there are less wovels than needed to fill the triplet,\n            # (e.g. for a surname as \"Fo'\" or \"Hu\" or the corean \"Y\")\n            # fill it with 'X';\n            output += 'X'\n\n    return output[:3]", "entry_point": "__common_triplet", "input": "'AbC dEf', ['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ema/pycodicefiscale/blob/4d06a145cdcffe7ee576f2fedaf40e2c6f7692a4/codicefiscale.py#L59-L72", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037284", "code": "def soft_equals(a, b):\n    \"\"\"Implements the '==' operator, which does type JS-style coertion.\"\"\"\n    if isinstance(a, str) or isinstance(b, str):\n        return str(a) == str(b)\n    if isinstance(a, bool) or isinstance(b, bool):\n        return bool(a) is bool(b)\n    return a == b", "entry_point": "soft_equals", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nadirizr/json-logic-py/blob/5fda9125eab4178f8f81c7779291940e31e87bab/json_logic/__init__.py#L31-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037285", "code": "def hard_equals(a, b):\n    \"\"\"Implements the '===' operator.\"\"\"\n    if type(a) != type(b):\n        return False\n    return a == b", "entry_point": "hard_equals", "input": "[1, 2, 3], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nadirizr/json-logic-py/blob/5fda9125eab4178f8f81c7779291940e31e87bab/json_logic/__init__.py#L40-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037286", "code": "def to_numeric(arg):\n    \"\"\"\n    Converts a string either to int or to float.\n    This is important, because e.g. {\"!==\": [{\"+\": \"0\"}, 0.0]}\n    \"\"\"\n    if isinstance(arg, str):\n        if '.' in arg:\n            return float(arg)\n        else:\n            return int(arg)\n    return arg", "entry_point": "to_numeric", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nadirizr/json-logic-py/blob/5fda9125eab4178f8f81c7779291940e31e87bab/json_logic/__init__.py#L66-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037287", "code": "def get_var(data, var_name, not_found=None):\n    \"\"\"Gets variable value from data dictionary.\"\"\"\n    try:\n        for key in str(var_name).split('.'):\n            try:\n                data = data[key]\n            except TypeError:\n                data = data[int(key)]\n    except (KeyError, TypeError, ValueError):\n        return not_found\n    else:\n        return data", "entry_point": "get_var", "input": "[-1, 0, 1, 2], '', [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nadirizr/json-logic-py/blob/5fda9125eab4178f8f81c7779291940e31e87bab/json_logic/__init__.py#L101-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037288", "code": "def unique(iterables):\n    \"\"\"Create an iterable from the iterables that contains each element once.\n\n    :return: an iterable over the iterables. Each element of the result\n      appeared only once in the result. They are ordered by the first\n      occurrence in the iterables.\n    \"\"\"\n    included_elements = set()\n\n    def included(element):\n        result = element in included_elements\n        included_elements.add(element)\n        return result\n    return [element for elements in iterables for element in elements\n            if not included(element)]", "entry_point": "unique", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/fossasia/knittingpattern/blob/8e608896b0ab82fea1ca9fbfa2b4ee023d8c8027/knittingpattern/utils.py#L8-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037289", "code": "def has_address(start: int, data_length: int) -> bool:\n    \"\"\"\n    Determine whether the packet has an \"address\" encoded into it.\n    There exists an undocumented bug/edge case in the spec - some packets\n    with 0x82 as _start_, still encode the address into the packet, and thus\n    throws off decoding. This edge case is handled explicitly.\n    \"\"\"\n    return bool(0x01 & start) or (start == 0x82 and data_length == 16)", "entry_point": "has_address", "input": "5, {1, 2, 3}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/nickw444/nessclient/blob/9a2e3d450448312f56e708b8c7adeaef878cc28a/nessclient/packet.py#L164-L171", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037290", "code": "def is_equal(a, b):\n    \"\"\" a constant time comparison implementation taken from\n        http://codahale.com/a-lesson-in-timing-attacks/ and\n        Django's `util` module https://github.com/django/django/blob/master/django/utils/crypto.py#L82\n    \"\"\"\n    if len(a) != len(b):\n        return False\n\n    result = 0\n    for x, y in zip(a, b):\n        result |= ord(x) ^ ord(y)\n    return result == 0", "entry_point": "is_equal", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ZeitOnline/briefkasten/blob/ce6b6eeb89196014fe21d68614c20059d02daa11/application/briefkasten/__init__.py#L51-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037291", "code": "def library_supports_api(library_version, api_version, different_major_breaks_support=True):\n    \"\"\"\n    Returns whether api_version is supported by given library version.\n    E. g.  library_version (1,3,21) returns True for api_version (1,3,21), (1,3,19), (1,3,'x'), (1,2,'x'), (1, 'x')\n           False for (1,3,24), (1,4,'x'), (2,'x')\n\n    different_major_breaks_support - if enabled and library and api major versions are different always return False\n           ex) with library_version (2,0,0) and for api_version(1,3,24) returns False if enabled, True if disabled\n    \"\"\"\n    assert isinstance(library_version, (tuple, list))  # won't work with e.g. generators\n    assert len(library_version) == 3\n    sequence_type = type(library_version)  # assure we will compare same types\n    api_version = sequence_type(0 if num == 'x' else num for num in api_version)\n    if different_major_breaks_support and library_version[0] != api_version[0]:\n        return False\n    assert len(api_version) <= 3     # otherwise following comparision won't work as intended, e.g. (2, 0, 0) > (2, 0, 0, 0)\n    return library_version >= api_version", "entry_point": "library_supports_api", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hhatto/pgmagick/blob/5dce5fa4681400b4c059431ad69233e6a3e5799a/setup.py#L106-L122", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037292", "code": "def reverse_guard(lst):\n    \"\"\" Reverse guard expression. not\n        (@a > 5) ->  (@a =< 5)\n    Args:\n        lst (list): Expression\n    returns:\n        list\n    \"\"\"\n    rev = {'<': '>=', '>': '=<', '>=': '<', '=<': '>'}\n    return [rev[l] if l in rev else l for l in lst]", "entry_point": "reverse_guard", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/lesscpy/lesscpy/blob/51e392fb4a3cd4ccfb6175e0e42ce7d2f6b78126/lesscpy/lessc/utility.py#L86-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037293", "code": "def dict_merge(a, b, k):\n    \"\"\"\n    Merge two dictionary lists\n    :param a: original list\n    :param b: alternative list, element will replace the one in original list with same key\n    :param k: key\n    :return: the merged list\n    \"\"\"\n    c = a.copy()\n    for j in range(len(b)):\n        flag = False\n        for i in range(len(c)):\n            if c[i][k] == b[j][k]:\n                c[i] = b[j].copy()\n                flag = True\n        if not flag:\n            c.append(b[j].copy())\n    return c", "entry_point": "dict_merge", "input": "[5, 3, 1, 4], [], [1, 2, 3]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L65-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037294", "code": "def dict_as_tuple_list(d, as_list=False):\n    \"\"\"\n    Format a dict to a list of tuples\n    :param d: the dictionary\n    :param as_list: return a list of lists rather than a list of tuples\n    :return: formatted dictionary list\n    \"\"\"\n    dd = list()\n    for k, v in d.items():\n        dd.append([k, v] if as_list else (k, v))\n    return dd", "entry_point": "dict_as_tuple_list", "input": "{'x': [1, 2], 'y': []}, (1, 2)", "output": "[['x', [1, 2]], ['y', []]]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/valency/deeputils/blob/27efd91668de0223ed8b07cfadf2151632521520/deeputils/common.py#L199-L209", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037295", "code": "def passcode(callsign):\n    \"\"\"\n    Takes a CALLSIGN and returns passcode\n    \"\"\"\n    assert isinstance(callsign, str)\n\n    callsign = callsign.split('-')[0].upper()\n\n    code = 0x73e2\n    for i, char in enumerate(callsign):\n        code ^= ord(char) << (8 if not i % 2 else 0)\n\n    return code & 0x7fff", "entry_point": "passcode", "input": "'walnut thistle harbour'", "output": "15538", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/rossengeorgiev/aprs-python/blob/94b89a6da47a322129484efcaf1e82f6a9932891/aprslib/passcode.py#L22-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037296", "code": "def check_digit(num):\n    \"\"\"Return a check digit of the given credit card number.\n\n    Check digit calculated using Luhn algorithm (\"modulus 10\")\n    See: http://www.darkcoding.net/credit-card/luhn-formula/\n    \"\"\"\n    sum = 0\n\n    # drop last digit, then reverse the number\n    digits = str(num)[:-1][::-1]\n\n    for i, n in enumerate(digits):\n        # select all digits at odd positions starting from 1\n        if (i + 1) % 2 != 0:\n            digit = int(n) * 2\n            if digit > 9:\n                sum += (digit - 9)\n            else:\n                sum += digit\n        else:\n            sum += int(n)\n\n    return ((divmod(sum, 10)[0] + 1) * 10 - sum) % 10", "entry_point": "check_digit", "input": "2", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/pilosus/ForgeryPy3/blob/e15f2e59538deb4cbfceaac314f5ea897f2d5450/forgery_py/forgery/credit_card.py#L48-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037297", "code": "def dostime_to_timetuple(dostime):\n    \"\"\"Convert a RAR archive member DOS time to a Python time tuple.\"\"\"\n    dostime = dostime >> 16\n    dostime = dostime & 0xffff\n    day = dostime & 0x1f\n    month = (dostime >> 5) & 0xf\n    year = 1980 + (dostime >> 9)\n    second = 2 * (dostime & 0x1f)\n    minute = (dostime >> 5) & 0x3f\n    hour = dostime >> 11\n    return (year, month, day, hour, minute, second)", "entry_point": "dostime_to_timetuple", "input": "True", "output": "(1980, 0, 0, 0, 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/matiasb/python-unrar/blob/b1ac46cbcf42f3d3c5c69ab971fe97369a4da617/unrar/unrarlib.py#L60-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037298", "code": "def is_valid_mac_oui(mac_block):\n        \"\"\"checks whether mac block is in format of\n        00-11-22 or 00:11:22.\n        :return: int\n        \"\"\"\n        if len(mac_block) != 8:\n            return 0\n        if ':' in mac_block:\n            if len(mac_block.split(':')) != 3:\n                return 0\n        elif '-' in mac_block:\n            if len(mac_block.split('-')) != 3:\n                return 0\n        return 1", "entry_point": "is_valid_mac_oui", "input": "['apple', 'banana', 'cherry']", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/kisom/pypcapfile/blob/67520cfbb6c2e9ab3e7c181a8012ddc56ec5cad8/pcapfile/protocols/linklayer/wifi.py#L1845-L1858", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037299", "code": "def extract_acked_seqs(bitmap, ssc_seq):\n        \"\"\"extracts acknowledged sequences from bitmap and\n        starting sequence number.\n        :bitmap: str\n        :ssc_seq: int\n        :return: int[]\n            acknowledged sequence numbers\n        \"\"\"\n        acked_seqs = []\n        for idx, val in enumerate(bitmap):\n            if int(val) == 1:\n                seq = (ssc_seq + idx) % 4096\n                acked_seqs.append(seq)\n        return acked_seqs", "entry_point": "extract_acked_seqs", "input": "{}, ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/kisom/pypcapfile/blob/67520cfbb6c2e9ab3e7c181a8012ddc56ec5cad8/pcapfile/protocols/linklayer/wifi.py#L2267-L2280", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037300", "code": "def intersection(l1, l2):\n    '''Returns intersection of two lists.  Assumes the lists are sorted by start positions'''\n    if len(l1) == 0 or len(l2) == 0:\n        return []\n\n    out = []\n    l2_pos = 0\n\n    for l in l1:\n        while l2_pos < len(l2) and l2[l2_pos].end < l.start:\n            l2_pos += 1\n\n        if l2_pos == len(l2):\n            break\n\n        while l2_pos < len(l2) and l.intersects(l2[l2_pos]):\n            out.append(l.intersection(l2[l2_pos]))\n            l2_pos += 1\n\n        l2_pos = max(0, l2_pos - 1)\n\n    return out", "entry_point": "intersection", "input": "[], [5, 3, 1, 4]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/sanger-pathogens/Fastaq/blob/2c775c846d2491678a9637daa320592e02c26c72/pyfastaq/intervals.py#L68-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037301", "code": "def get_direct_ancestors(G, list_of_nodes):\n    \"\"\"\n    Returns a list of nodes that are the parents\n    from all of the nodes given as an argument.\n    This is for use in the parallel topo sort\n    \"\"\"\n    parents = []\n    for item in list_of_nodes:\n        anc = G.predecessors(item)\n        for one in anc:\n            parents.append(one)\n    return parents", "entry_point": "get_direct_ancestors", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tonyfischetti/sake/blob/b7ad20fe8e7137db99a20ac06b8da26492601b00/sakelib/build.py#L330-L341", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037302", "code": "def get_sinks(G):\n    \"\"\"\n    A sink is a node with no children.\n    This means that this is the end of the line,\n    and it should be run last in topo sort. This\n    returns a list of all sinks in a graph\n    \"\"\"\n    sinks = []\n    for node in G:\n        if not len(list(G.successors(node))):\n            sinks.append(node)\n    return sinks", "entry_point": "get_sinks", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tonyfischetti/sake/blob/b7ad20fe8e7137db99a20ac06b8da26492601b00/sakelib/build.py#L344-L355", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037303", "code": "def remove_redundancies(levels):\n    \"\"\"\n    There are repeats in the output from get_levels(). We\n    want only the earliest occurrence (after it's reversed)\n    \"\"\"\n    seen = []\n    final = []\n    for line in levels:\n        new_line = []\n        for item in line:\n            if item not in seen:\n                seen.append(item)\n                new_line.append(item)\n        final.append(new_line)\n    return final", "entry_point": "remove_redundancies", "input": "['apple', 'banana', 'cherry']", "output": "[['a', 'p', 'l', 'e'], ['b', 'n'], ['c', 'h', 'r', 'y']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tonyfischetti/sake/blob/b7ad20fe8e7137db99a20ac06b8da26492601b00/sakelib/build.py#L376-L390", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037304", "code": "def parse_defines(args):\n    \"\"\"\n    This parses a list of define argument in the form of -DNAME=VALUE or -DNAME (\n    which is treated as -DNAME=1).\n    \"\"\"\n    macros = {}\n    for arg in args:\n        try:\n            var, val = arg.split('=', 1)\n        except ValueError:\n            var = arg\n            val = '1'\n\n        macros[var] = val\n\n    return macros", "entry_point": "parse_defines", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tonyfischetti/sake/blob/b7ad20fe8e7137db99a20ac06b8da26492601b00/sakelib/acts.py#L229-L244", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037305", "code": "def get_tied_targets(original_targets, the_ties):\n    \"\"\"\n    This function gets called when a target is specified to ensure\n    that all 'tied' targets also get included in the subgraph to\n    be built\n    \"\"\"\n    my_ties = []\n    for original_target in original_targets:\n        for item in the_ties:\n            if original_target in item:\n                for thing in item:\n                    my_ties.append(thing)\n    my_ties = list(set(my_ties))\n    if my_ties:\n        ties_message = \"\"\n        ties_message += \"The following targets share dependencies and must be run together:\"\n        for item in sorted(my_ties):\n            ties_message += \"\\n  - {}\".format(item)\n        return list(set(my_ties+original_targets)), ties_message\n    return original_targets, \"\"", "entry_point": "get_tied_targets", "input": "[[1, 2], [3], []], []", "output": "([[1, 2], [3], []], '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/tonyfischetti/sake/blob/b7ad20fe8e7137db99a20ac06b8da26492601b00/sakelib/acts.py#L434-L453", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037306", "code": "def _remove_trailing_spaces(line):\n        \"\"\"Remove trailing spaces unless they are quoted with a backslash.\"\"\"\n        while line.endswith(' ') and not line.endswith('\\\\ '):\n            line = line[:-1]\n        return line.replace('\\\\ ', ' ')", "entry_point": "_remove_trailing_spaces", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/polyaxon/polyaxon-cli/blob/a7f5eed74d4d909cad79059f3c21c58606881449/polyaxon_cli/managers/ignore.py#L105-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037307", "code": "def parse_option_settings(option_settings):\n    \"\"\"\n    Parses option_settings as they are defined in the configuration file\n    \"\"\"\n    ret = []\n    for namespace, params in list(option_settings.items()):\n        for key, value in list(params.items()):\n            ret.append((namespace, key, value))\n    return ret", "entry_point": "parse_option_settings", "input": "{}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/briandilley/ebs-deploy/blob/4178c9c1282a9025fb987dab3470bea28c202e10/ebs_deploy/__init__.py#L58-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037308", "code": "def _isSingleCharacter(keychr):\n        \"\"\"Check whether given keyboard character is a single character.\n\n        Parameters: key character which will be checked.\n        Returns: True when given key character is a single character.\n        \"\"\"\n        if not keychr:\n            return False\n        # Regular character case.\n        if len(keychr) == 1:\n            return True\n        # Tagged character case.\n        return keychr.count('<') == 1 and keychr.count('>') == 1 and \\\n               keychr[0] == '<' and keychr[-1] == '>'", "entry_point": "_isSingleCharacter", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alex-kostirin/pyatomac/blob/3f46f6feb4504315eec07abb18bb41be4d257aeb/atomac/AXClasses.py#L419-L432", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037309", "code": "def get_suggested_filename(metadata):\n\t\"\"\"Generate a filename for a song based on metadata.\n\n\tParameters:\n\t\tmetadata (dict): A metadata dict.\n\n\tReturns:\n\t\tA filename.\n\t\"\"\"\n\n\tif metadata.get('title') and metadata.get('track_number'):\n\t\tsuggested_filename = '{track_number:0>2} {title}'.format(**metadata)\n\telif metadata.get('title') and metadata.get('trackNumber'):\n\t\tsuggested_filename = '{trackNumber:0>2} {title}'.format(**metadata)\n\telif metadata.get('title') and metadata.get('tracknumber'):\n\t\tsuggested_filename = '{tracknumber:0>2} {title}'.format(**metadata)\n\telse:\n\t\tsuggested_filename = '00 {}'.format(metadata.get('title', ''))\n\n\treturn suggested_filename", "entry_point": "get_suggested_filename", "input": "{'x': [1, 2], 'y': []}", "output": "'00 '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/thebigmunch/gmusicapi-wrapper/blob/8708683cd33955def1378fc28319ef37805b851d/gmusicapi_wrapper/utils.py#L304-L323", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037310", "code": "def Sh(L: float, h: float, D: float) -> float:\n    \"\"\"\n    Calculate the Sherwood number.\n\n    :param L: [m] mass transfer surface characteristic length.\n    :param h: [m/s] mass transfer coefficient.\n    :param D: [m2/s] fluid mass diffusivity.\n\n    :returns: float\n    \"\"\"\n\n    return h * L / D", "entry_point": "Sh", "input": "False, True, 7", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Ex-Mente/auxi.0/blob/2dcdae74154f136f8ca58289fe5b20772f215046/auxi/tools/transportphenomena/dimensionlessquantities.py#L119-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037311", "code": "def rgb_to_hex(rgb):\n    \"\"\"\n    Convert an RGB color representation to a HEX color representation.\n\n    (r, g, b) :: r -> [0, 255]\n                 g -> [0, 255]\n                 b -> [0, 255]\n\n    :param rgb: A tuple of three numeric values corresponding to the red, green, and blue value.\n    :return: HEX representation of the input RGB value.\n    :rtype: str\n    \"\"\"\n    r, g, b = rgb\n    return \"#{0}{1}{2}\".format(hex(int(r))[2:].zfill(2), hex(int(g))[2:].zfill(2), hex(int(b))[2:].zfill(2))", "entry_point": "rgb_to_hex", "input": "[1, 2, 3]", "output": "'#010203'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edaniszewski/colorutils/blob/bdff54091cb5d62aa8628ce39bc09abd40fb8dd0/colorutils/convert.py#L16-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037312", "code": "def rgb_to_yiq(rgb):\n    \"\"\"\n    Convert an RGB color representation to a YIQ color representation.\n\n    (r, g, b) :: r -> [0, 255]\n                 g -> [0, 255]\n                 b -> [0, 255]\n\n    :param rgb: A tuple of three numeric values corresponding to the red, green, and blue value.\n    :return: YIQ representation of the input RGB value.\n    :rtype: tuple\n    \"\"\"\n    r, g, b = rgb[0] / 255, rgb[1] / 255, rgb[2] / 255\n    y = (0.299 * r) + (0.587 * g) + (0.114 * b)\n    i = (0.596 * r) - (0.275 * g) - (0.321 * b)\n    q = (0.212 * r) - (0.528 * g) + (0.311 * b)\n    return round(y, 3), round(i, 3), round(q, 3)", "entry_point": "rgb_to_yiq", "input": "[-1, 0, 1, 2]", "output": "(-0.001, -0.004, 0.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edaniszewski/colorutils/blob/bdff54091cb5d62aa8628ce39bc09abd40fb8dd0/colorutils/convert.py#L50-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037313", "code": "def rgb_to_hsv(rgb):\n    \"\"\"\n    Convert an RGB color representation to an HSV color representation.\n\n    (r, g, b) :: r -> [0, 255]\n                 g -> [0, 255]\n                 b -> [0, 255]\n\n    :param rgb: A tuple of three numeric values corresponding to the red, green, and blue value.\n    :return: HSV representation of the input RGB value.\n    :rtype: tuple\n    \"\"\"\n    r, g, b = rgb[0] / 255, rgb[1] / 255, rgb[2] / 255\n    _min = min(r, g, b)\n    _max = max(r, g, b)\n    v = _max\n    delta = _max - _min\n\n    if _max == 0:\n        return 0, 0, v\n\n    s = delta / _max\n\n    if delta == 0:\n        delta = 1\n\n    if r == _max:\n        h = 60 * (((g - b) / delta) % 6)\n\n    elif g == _max:\n        h = 60 * (((b - r) / delta) + 2)\n\n    else:\n        h = 60 * (((r - g) / delta) + 4)\n\n    return round(h, 3), round(s, 3), round(v, 3)", "entry_point": "rgb_to_hsv", "input": "[1, 2, 3]", "output": "(210.0, 0.667, 0.012)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edaniszewski/colorutils/blob/bdff54091cb5d62aa8628ce39bc09abd40fb8dd0/colorutils/convert.py#L69-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037314", "code": "def hex_to_rgb(_hex):\n    \"\"\"\n    Convert a HEX color representation to an RGB color representation.\n\n    hex :: hex -> [000000, FFFFFF]\n\n    :param _hex: The 3- or 6-char hexadecimal string representing the color value.\n    :return: RGB representation of the input HEX value.\n    :rtype: tuple\n    \"\"\"\n    _hex = _hex.strip('#')\n    n = len(_hex) // 3\n    if len(_hex) == 3:\n        r = int(_hex[:n] * 2, 16)\n        g = int(_hex[n:2 * n] * 2, 16)\n        b = int(_hex[2 * n:3 * n] * 2, 16)\n    else:\n        r = int(_hex[:n], 16)\n        g = int(_hex[n:2 * n], 16)\n        b = int(_hex[2 * n:3 * n], 16)\n    return r, g, b", "entry_point": "hex_to_rgb", "input": "'AbC dEf'", "output": "(171, 12, 222)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edaniszewski/colorutils/blob/bdff54091cb5d62aa8628ce39bc09abd40fb8dd0/colorutils/convert.py#L112-L132", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037315", "code": "def yiq_to_rgb(yiq):\n    \"\"\"\n    Convert a YIQ color representation to an RGB color representation.\n\n    (y, i, q) :: y -> [0, 1]\n                 i -> [-0.5957, 0.5957]\n                 q -> [-0.5226, 0.5226]\n\n    :param yiq: A tuple of three numeric values corresponding to the luma and chrominance.\n    :return: RGB representation of the input YIQ value.\n    :rtype: tuple\n    \"\"\"\n    y, i, q = yiq\n    r = y + (0.956 * i) + (0.621 * q)\n    g = y - (0.272 * i) - (0.647 * q)\n    b = y - (1.108 * i) + (1.705 * q)\n\n    r = 1 if r > 1 else max(0, r)\n    g = 1 if g > 1 else max(0, g)\n    b = 1 if b > 1 else max(0, b)\n\n    return round(r * 255, 3), round(g * 255, 3), round(b * 255, 3)", "entry_point": "yiq_to_rgb", "input": "[1, 2, 3]", "output": "(255, 0, 255)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edaniszewski/colorutils/blob/bdff54091cb5d62aa8628ce39bc09abd40fb8dd0/colorutils/convert.py#L249-L270", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037316", "code": "def _strBinary(n):\n    \"\"\"Conert an integer to binary (i.e., a string of 1s and 0s).\"\"\"\n    results = []\n    for i in range(8):\n        n, r = divmod(n, 2)\n        results.append('01'[r])\n    results.reverse()\n    return ''.join(results)", "entry_point": "_strBinary", "input": "5", "output": "'00000101'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/clach04/x10_any/blob/5b90a543b127ab9e6112fd547929b5ef4b8f0cbc/x10_any/cm17a.py#L96-L103", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037317", "code": "def _variant_levels(level, variant):\n        \"\"\"\n        Gets the level for the variant.\n\n        :param int level: the current variant level\n        :param int variant: the value for this level if variant\n\n        :returns: a level for the object and one for the function\n        :rtype: int * int\n        \"\"\"\n        return (level + variant, level + variant) \\\n           if variant != 0 else (variant, level)", "entry_point": "_variant_levels", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "([[1, 2], [3], [], 'a', 'b', 'c'], [[1, 2], [3], [], 'a', 'b', 'c'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/stratis-storage/into-dbus-python/blob/81366049671f79116bbb81c97bf621800a2f6315/src/into_dbus_python/_xformer.py#L65-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037318", "code": "def lower(option,value):\n    '''\n    Enforces lower case options and option values where appropriate\n    '''\n    if type(option) is str:\n        option=option.lower()\n    if type(value) is str:\n        value=value.lower()\n    return (option,value)", "entry_point": "lower", "input": "[[1, 2], [3], []], [5, 3, 1, 4]", "output": "([[1, 2], [3], []], [5, 3, 1, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/soerenwolfers/swutil/blob/2d598f2deac8b7e20df95dbc68017e5ab5d6180c/swutil/config.py#L21-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037319", "code": "def to_float(option,value):\n    '''\n    Converts string values to floats when appropriate\n    '''\n    if type(value) is str:\n        try:\n            value=float(value)\n        except ValueError:\n            pass\n    return (option,value)", "entry_point": "to_float", "input": "[], [[1, 2], [3], []]", "output": "([], [[1, 2], [3], []])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/soerenwolfers/swutil/blob/2d598f2deac8b7e20df95dbc68017e5ab5d6180c/swutil/config.py#L41-L50", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037320", "code": "def to_bool(option,value):\n    '''\n    Converts string values to booleans when appropriate\n    '''\n    if type(value) is str:\n        if value.lower() == 'true':\n            value=True\n        elif value.lower() == 'false':\n            value=False\n    return (option,value)", "entry_point": "to_bool", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "([5, 3, 1, 4], ['apple', 'banana', 'cherry'])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/soerenwolfers/swutil/blob/2d598f2deac8b7e20df95dbc68017e5ab5d6180c/swutil/config.py#L52-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037321", "code": "def ld_to_dl(ld):\n    '''\n    Convert list of dictionaries to dictionary of lists\n    '''\n    if ld:\n        keys = list(ld[0])\n        dl = {key:[d[key] for d in ld] for key in keys}\n        return dl\n    else:\n        return {}", "entry_point": "ld_to_dl", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/soerenwolfers/swutil/blob/2d598f2deac8b7e20df95dbc68017e5ab5d6180c/swutil/aux.py#L99-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037322", "code": "def unique(seq):\n    '''\n    https://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-whilst-preserving-order\n    '''\n    has = []\n    return [x for x in seq if not (x in has or has.append(x))]", "entry_point": "unique", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/soerenwolfers/swutil/blob/2d598f2deac8b7e20df95dbc68017e5ab5d6180c/swutil/collections.py#L5-L10", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037323", "code": "def iso_name_slugify(name):\n    \"\"\"Slugify a name in the ISO-9660 way.\n\n    Example:\n        >>> slugify('\u00e9patant')\n        \"_patant\"\n    \"\"\"\n    name = name.encode('ascii', 'replace').replace(b'?', b'_')\n    return name.decode('ascii')", "entry_point": "iso_name_slugify", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/althonos/fs.archive/blob/a09bb5da56da6b96aca3e20841fa86dea7c5b79a/fs/archive/isofs/_utils.py#L11-L19", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037324", "code": "def _calc_ilm_order(imshape):\n    \"\"\"\n    Calculates an ilm order based on the shape of an image. This is based on\n    something that works for our particular images. Your mileage will vary.\n\n    Parameters\n    ----------\n        imshape : 3-element list-like\n            The shape of the image.\n\n    Returns\n    -------\n        npts : tuple\n            The number of points to use for the ilm.\n        zorder : int\n            The order of the z-polynomial.\n    \"\"\"\n    zorder = int(imshape[0] / 6.25) + 1\n    l_npts = int(imshape[1] / 42.5)+1\n    npts = ()\n    for a in range(l_npts):\n        if a < 5:\n            npts += (int(imshape[2] * [59, 39, 29, 19, 14][a]/512.) + 1,)\n        else:\n            npts += (int(imshape[2] * 11/512.) + 1,)\n    return npts, zorder", "entry_point": "_calc_ilm_order", "input": "[1, 2, 3]", "output": "((1,), 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/peri-source/peri/blob/61beed5deaaf978ab31ed716e8470d86ba639867/scripts/statemaker_example.py#L61-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037325", "code": "def _parse_field_value(line):\n    \"\"\" Parse the field and value from a line. \"\"\"\n    if line.startswith(':'):\n        # Ignore the line\n        return None, None\n\n    if ':' not in line:\n        # Treat the entire line as the field, use empty string as value\n        return line, ''\n\n    # Else field is before the ':' and value is after\n    field, value = line.split(':', 1)\n\n    # If value starts with a space, remove it.\n    value = value[1:] if value.startswith(' ') else value\n\n    return field, value", "entry_point": "_parse_field_value", "input": "'AbC dEf'", "output": "('AbC dEf', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/praekeltfoundation/marathon-acme/blob/b1b71e3dde0ba30e575089280658bd32890e3325/marathon_acme/sse_protocol.py#L196-L212", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037326", "code": "def is_int(string):\n    \"\"\"\n    Checks if a string is an integer. If the string value is an integer\n    return True, otherwise return False. \n    \n    Args:\n        string: a string to test.\n\n    Returns: \n        boolean\n    \"\"\"\n    try:\n        a = float(string)\n        b = int(a)\n    except ValueError:\n        return False\n    else:\n        return a == b", "entry_point": "is_int", "input": "'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/bbusenius/Diablo-Python/blob/646ac5a6f1c79cf9b928a4e2a7979988698b6c82/file_parsing/file_parsing.py#L249-L266", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037327", "code": "def clean_strings(iterable):\n    \"\"\"\n    Take a list of strings and clear whitespace \n    on each one. If a value in the list is not a \n    string pass it through untouched.\n\n    Args:\n        iterable: mixed list\n\n    Returns: \n        mixed list\n    \"\"\"\n    retval = []\n    for val in iterable:\n        try:\n            retval.append(val.strip())\n        except(AttributeError):\n            retval.append(val)\n    return retval", "entry_point": "clean_strings", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/bbusenius/Diablo-Python/blob/646ac5a6f1c79cf9b928a4e2a7979988698b6c82/file_parsing/file_parsing.py#L302-L320", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037328", "code": "def convert_words_to_uint(high_word, low_word):\n    \"\"\"Convert two words to a floating point\"\"\"\n    try:\n        low_num = int(low_word)\n        # low_word might arrive as a signed number. Convert to unsigned\n        if low_num < 0:\n            low_num = abs(low_num) + 2**15\n        number = (int(high_word) << 16) | low_num\n        return number, True\n    except:\n        return 0, False", "entry_point": "convert_words_to_uint", "input": "'  padded  ', 'AbC dEf'", "output": "(0, False)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ardexa/ardexaplugin/blob/5068532f601ae3042bd87af1063057e8f274f670/ardexaplugin.py#L153-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037329", "code": "def format_arxiv_id(arxiv_id):\n    \"\"\"Properly format arXiv IDs.\"\"\"\n    if arxiv_id and \"/\" not in arxiv_id and \"arXiv\" not in arxiv_id:\n        return \"arXiv:%s\" % (arxiv_id,)\n    elif arxiv_id and '.' not in arxiv_id and arxiv_id.lower().startswith('arxiv:'):\n        return arxiv_id[6:]  # strip away arxiv: for old identifiers\n    else:\n        return arxiv_id", "entry_point": "format_arxiv_id", "input": "[-1, 0, 1, 2]", "output": "'arXiv:[-1, 0, 1, 2]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/utils.py#L138-L145", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037330", "code": "def fix_journal_name(journal, knowledge_base):\n    \"\"\"Convert journal name to Inspire's short form.\"\"\"\n    if not journal:\n        return '', ''\n    if not knowledge_base:\n        return journal, ''\n    if len(journal) < 2:\n        return journal, ''\n    volume = ''\n    if (journal[-1] <= 'Z' and journal[-1] >= 'A') \\\n            and (journal[-2] == '.' or journal[-2] == ' '):\n        volume += journal[-1]\n        journal = journal[:-1]\n    journal = journal.strip()\n\n    if journal.upper() in knowledge_base:\n        journal = knowledge_base[journal.upper()].strip()\n    elif journal in knowledge_base:\n        journal = knowledge_base[journal].strip()\n    elif '.' in journal:\n        journalnodots = journal.replace('. ', ' ')\n        journalnodots = journalnodots.replace('.', ' ').strip().upper()\n        if journalnodots in knowledge_base:\n            journal = knowledge_base[journalnodots].strip()\n\n    journal = journal.replace('. ', '.')\n    return journal, volume", "entry_point": "fix_journal_name", "input": "{}, 5", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/utils.py#L160-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037331", "code": "def punctuate_authorname(an):\n    \"\"\"Punctuate author names properly.\n\n    Expects input in the form 'Bloggs, J K' and will return 'Bloggs, J. K.'.\n    \"\"\"\n    name = an.strip()\n    parts = [x for x in name.split(',') if x != '']\n    ret_str = ''\n    for idx, part in enumerate(parts):\n        subparts = part.strip().split(' ')\n        for sidx, substr in enumerate(subparts):\n            ret_str += substr\n            if len(substr) == 1:\n                ret_str += '.'\n            if sidx < (len(subparts) - 1):\n                ret_str += ' '\n        if idx < (len(parts) - 1):\n            ret_str += ', '\n    return ret_str.strip()", "entry_point": "punctuate_authorname", "input": "'  padded  '", "output": "'padded'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/utils.py#L343-L361", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037332", "code": "def return_letters_from_string(text):\n    \"\"\"Get letters from string only.\"\"\"\n    out = \"\"\n    for letter in text:\n        if letter.isalpha():\n            out += letter\n    return out", "entry_point": "return_letters_from_string", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/utils.py#L476-L482", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037333", "code": "def record_delete_fields(rec, tag, field_positions_local=None):\n    \"\"\"\n    Delete all/some fields defined with MARC tag 'tag' from record 'rec'.\n\n    :param rec: a record structure.\n    :type rec: tuple\n    :param tag: three letter field.\n    :type tag: string\n    :param field_position_local: if set, it is the list of local positions\n        within all the fields with the specified tag, that should be deleted.\n        If not set all the fields with the specified tag will be deleted.\n    :type field_position_local: sequence\n    :return: the list of deleted fields.\n    :rtype: list\n    :note: the record is modified in place.\n    \"\"\"\n    if tag not in rec:\n        return []\n\n    new_fields, deleted_fields = [], []\n\n    for position, field in enumerate(rec.get(tag, [])):\n        if field_positions_local is None or position in field_positions_local:\n            deleted_fields.append(field)\n        else:\n            new_fields.append(field)\n\n    if new_fields:\n        rec[tag] = new_fields\n    else:\n        del rec[tag]\n\n    return deleted_fields", "entry_point": "record_delete_fields", "input": "[1, 2, 3], ['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/bibrecord.py#L691-L723", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037334", "code": "def _compare_fields(field1, field2, strict=True):\n    \"\"\"\n    Compare 2 fields.\n\n    If strict is True, then the order of the subfield will be taken care of, if\n    not then the order of the subfields doesn't matter.\n\n    :return: True if the field are equivalent, False otherwise.\n    \"\"\"\n    if strict:\n        # Return a simple equal test on the field minus the position.\n        return field1[:4] == field2[:4]\n    else:\n        if field1[1:4] != field2[1:4]:\n            # Different indicators or controlfield value.\n            return False\n        else:\n            # Compare subfields in a loose way.\n            return set(field1[0]) == set(field2[0])", "entry_point": "_compare_fields", "input": "['apple', 'banana', 'cherry'], [], True", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/bibrecord.py#L1579-L1597", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037335", "code": "def _tag_matches_pattern(tag, pattern):\n    \"\"\"Return true if MARC 'tag' matches a 'pattern'.\n\n    'pattern' is plain text, with % as wildcard\n\n    Both parameters must be 3 characters long strings.\n\n    .. doctest::\n\n        >>> _tag_matches_pattern(\"909\", \"909\")\n        True\n        >>> _tag_matches_pattern(\"909\", \"9%9\")\n        True\n        >>> _tag_matches_pattern(\"909\", \"9%8\")\n        False\n\n    :param tag: a 3 characters long string\n    :param pattern: a 3 characters long string\n    :return: False or True\n    \"\"\"\n    for char1, char2 in zip(tag, pattern):\n        if char2 not in ('%', char1):\n            return False\n    return True", "entry_point": "_tag_matches_pattern", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/bibrecord.py#L1673-L1696", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037336", "code": "def _compare_lists(list1, list2, custom_cmp):\n    \"\"\"Compare twolists using given comparing function.\n\n    :param list1: first list to compare\n    :param list2: second list to compare\n    :param custom_cmp: a function taking two arguments (element of\n        list 1, element of list 2) and\n    :return: True or False depending if the values are the same\n    \"\"\"\n    if len(list1) != len(list2):\n        return False\n    for element1, element2 in zip(list1, list2):\n        if not custom_cmp(element1, element2):\n            return False\n    return True", "entry_point": "_compare_lists", "input": "[], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/inspirehep/harvesting-kit/blob/33a7f8aa9dade1d863110c6d8b27dfd955cb471f/harvestingkit/bibrecord.py#L1975-L1989", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037337", "code": "def to_utf8(y):\n    \"\"\"\n    converts an array of integers to utf8 string\n    \"\"\"\n\n    out = []\n\n    for x in y:\n\n        if x < 0x080:\n            out.append(x)\n        elif x < 0x0800:\n            out.append((x >> 6) | 0xC0)\n            out.append((x & 0x3F) | 0x80)\n        elif x < 0x10000:\n            out.append((x >> 12) | 0xE0)\n            out.append(((x >> 6) & 0x3F) | 0x80)\n            out.append((x & 0x3F) | 0x80)\n        else:\n            out.append((x >> 18) | 0xF0)\n            out.append((x >> 12) & 0x3F)\n            out.append(((x >> 6) & 0x3F) | 0x80)\n            out.append((x & 0x3F) | 0x80)\n\n    return ''.join(map(chr, out))", "entry_point": "to_utf8", "input": "[1, 2, 3]", "output": "'\\x01\\x02\\x03'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/sanskrit-coders/indic_transliteration/blob/b7c5166a275c15a612fbb96fd3d765bc9004b299/indic_transliteration_unmaintained/iscii2utf8.py#L423-L447", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037338", "code": "def make_present_participles(verbs):\n    \"\"\"Make the list of verbs into present participles\n\n    E.g.:\n\n        empower -> empowering\n        drive -> driving\n    \"\"\"\n    res = []\n    for verb in verbs:\n        parts = verb.split()\n        if parts[0].endswith(\"e\"):\n            parts[0] = parts[0][:-1] + \"ing\"\n        else:\n            parts[0] = parts[0] + \"ing\"\n        res.append(\" \".join(parts))\n    return res", "entry_point": "make_present_participles", "input": "['apple', 'banana', 'cherry']", "output": "['appling', 'bananaing', 'cherrying']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/d0c-s4vage/gramfuzz/blob/023727ac8744ae026d1105cc97c152bdf3abb8d6/examples/grams/bizbs.py#L32-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037339", "code": "def remove_leading(needle, haystack):\n    \"\"\"Remove leading needle string (if exists).\n\n    >>> remove_leading('Test', 'TestThisAndThat')\n    'ThisAndThat'\n    >>> remove_leading('Test', 'ArbitraryName')\n    'ArbitraryName'\n    \"\"\"\n    if haystack[:len(needle)] == needle:\n        return haystack[len(needle):]\n    return haystack", "entry_point": "remove_leading", "input": "[5, 3, 1, 4], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/bitprophet/spec/blob/d9646c5daf8e479937f970d21ebe185ad936a35a/spec/plugin.py#L38-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037340", "code": "def remove_trailing(needle, haystack):\n    \"\"\"Remove trailing needle string (if exists).\n\n    >>> remove_trailing('Test', 'ThisAndThatTest')\n    'ThisAndThat'\n    >>> remove_trailing('Test', 'ArbitraryName')\n    'ArbitraryName'\n    \"\"\"\n    if haystack[-len(needle):] == needle:\n        return haystack[:-len(needle)]\n    return haystack", "entry_point": "remove_trailing", "input": "['a', 'b', 'c'], [1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/bitprophet/spec/blob/d9646c5daf8e479937f970d21ebe185ad936a35a/spec/plugin.py#L51-L61", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037341", "code": "def complete_english(string):\n    \"\"\"\n    >>> complete_english('dont do this')\n    \"don't do this\"\n    >>> complete_english('doesnt is matched as well')\n    \"doesn't is matched as well\"\n    \"\"\"\n    for x, y in [(\"dont\", \"don't\"),\n                (\"doesnt\", \"doesn't\"),\n                (\"wont\", \"won't\"),\n                (\"wasnt\", \"wasn't\")]:\n        string = string.replace(x, y)\n    return string", "entry_point": "complete_english", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/bitprophet/spec/blob/d9646c5daf8e479937f970d21ebe185ad936a35a/spec/plugin.py#L82-L94", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037342", "code": "def extend(s, var, val):\n    \"\"\"Copy the substitution s and extend it by setting var to val;\n    return copy.\n    >>> ppsubst(extend({x: 1}, y, 2))\n    {x: 1, y: 2}\n    \"\"\"\n    s2 = s.copy()\n    s2[var] = val\n    return s2", "entry_point": "extend", "input": "['apple', 'banana', 'cherry'], False, ()", "output": "[(), 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/logic.py#L834-L842", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037343", "code": "def pretty_dict(d):\n    \"\"\"Return dictionary d's repr but with the items sorted.\n    >>> pretty_dict({'m': 'M', 'a': 'A', 'r': 'R', 'k': 'K'})\n    \"{'a': 'A', 'k': 'K', 'm': 'M', 'r': 'R'}\"\n    >>> pretty_dict({z: C, y: B, x: A})\n    '{x: A, y: B, z: C}'\n    \"\"\"\n    return '{%s}' % ', '.join('%r: %r' % (k, v)\n                              for k, v in sorted(d.items(), key=repr))", "entry_point": "pretty_dict", "input": "{'a': 1, 'b': 2}", "output": "\"{'a': 1, 'b': 2}\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/logic.py#L1083-L1091", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037344", "code": "def removeall(item, seq):\n    \"\"\"Return a copy of seq (or string) with all occurences of item removed.\n    >>> removeall(3, [1, 2, 3, 3, 2, 1, 3])\n    [1, 2, 2, 1]\n    >>> removeall(4, [1, 2, 3])\n    [1, 2, 3]\n    \"\"\"\n    if isinstance(seq, str):\n        return seq.replace(item, '')\n    else:\n        return [x for x in seq if x != item]", "entry_point": "removeall", "input": "[5, 3, 1, 4], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/utils.py#L286-L296", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037345", "code": "def some(predicate, seq):\n    \"\"\"If some element x of seq satisfies predicate(x), return predicate(x).\n    >>> some(callable, [min, 3])\n    1\n    >>> some(callable, [2, 3])\n    0\n    \"\"\"\n    for x in seq:\n        px = predicate(x)\n        if px: return px\n    return False", "entry_point": "some", "input": "False, ()", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/utils.py#L341-L351", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037346", "code": "def dotproduct(X, Y):\n    \"\"\"Return the sum of the element-wise product of vectors x and y.\n    >>> dotproduct([1, 2, 3], [1000, 100, 10])\n    1230\n    \"\"\"\n    return sum([x * y for x, y in zip(X, Y)])", "entry_point": "dotproduct", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "14", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/utils.py#L489-L494", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037347", "code": "def normalize(numbers):\n    \"\"\"Multiply each number by a constant such that the sum is 1.0\n    >>> normalize([1,2,1])\n    [0.25, 0.5, 0.25]\n    \"\"\"\n    total = float(sum(numbers))\n    return [n / total for n in numbers]", "entry_point": "normalize", "input": "[-1, 0, 1, 2]", "output": "[-0.5, 0.0, 0.5, 1.0]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/utils.py#L537-L543", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037348", "code": "def viterbi_segment(text, P):\n    \"\"\"Find the best segmentation of the string of characters, given the\n    UnigramTextModel P.\"\"\"\n    # best[i] = best probability for text[0:i]\n    # words[i] = best word ending at position i\n    n = len(text)\n    words = [''] + list(text)\n    best = [1.0] + [0.0] * n\n    ## Fill in the vectors best, words via dynamic programming\n    for i in range(n+1):\n        for j in range(0, i):\n            w = text[j:i]\n            if P[w] * best[i - len(w)] >= best[i]:\n                best[i] = P[w] * best[i - len(w)]\n                words[i] = w\n    ## Now recover the sequence of best words\n    sequence = []; i = len(words)-1\n    while i > 0:\n        sequence[0:0] = [words[i]]\n        i = i - len(words[i])\n    ## Return sequence of best words and overall probability\n    return sequence, best[-1]", "entry_point": "viterbi_segment", "input": "'', ['a', 'b', 'c']", "output": "([], 1.0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/text.py#L67-L88", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037349", "code": "def event_values(event, vars):\n    \"\"\"Return a tuple of the values of variables vars in event.\n    >>> event_values ({'A': 10, 'B': 9, 'C': 8}, ['C', 'A'])\n    (8, 10)\n    >>> event_values ((1, 2), ['C', 'A'])\n    (1, 2)\n    \"\"\"\n    if isinstance(event, tuple) and len(event) == len(vars):\n        return event\n    else:\n        return tuple([event[var] for var in vars])", "entry_point": "event_values", "input": "['apple', 'banana', 'cherry'], []", "output": "()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/hobson/aima/blob/3572b2fb92039b4a1abe384be8545560fbd3d470/aima/probability.py#L107-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037350", "code": "def get_insert_query(table, fields=None, field_count=None):\n    \"\"\"\n    format insert query\n    :param table: str\n    :param fields: list[str]\n    :param field_count: int\n    :return: str\n    \"\"\"\n    if fields:\n        q = 'insert into %s ({0}) values ({1});' % table\n        l = len(fields)\n        q = q.format(','.join(fields), ','.join(['%s'] * l))\n    elif field_count:\n        q = 'insert into %s values ({0});' % table\n        q = q.format(','.join(['%s'] * field_count))\n    else:\n        raise ValueError('fields or field_count need')\n\n    return q", "entry_point": "get_insert_query", "input": "set(), 'Hello World', True", "output": "'insert into set() (H,e,l,l,o, ,W,o,r,l,d) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dade-ai/snipy/blob/408520867179f99b3158b57520e2619f3fecd69b/snipy/database.py#L145-L163", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037351", "code": "def is_dot(ip):\n    \"\"\"Return true if the IP address is in dotted decimal notation.\"\"\"\n    octets = str(ip).split('.')\n    if len(octets) != 4:\n        return False\n    for i in octets:\n        try:\n            val = int(i)\n        except ValueError:\n            return False\n        if val > 255 or val < 0:\n            return False\n    return True", "entry_point": "is_dot", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alberanid/python-iplib/blob/488b56fe57ad836b27feec9e76f51883db28faa6/iplib.py#L99-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037352", "code": "def is_bin(ip):\n    \"\"\"Return true if the IP address is in binary notation.\"\"\"\n    try:\n        ip = str(ip)\n        if len(ip) != 32:\n            return False\n        dec = int(ip, 2)\n    except (TypeError, ValueError):\n        return False\n    if dec > 4294967295 or dec < 0:\n        return False\n    return True", "entry_point": "is_bin", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alberanid/python-iplib/blob/488b56fe57ad836b27feec9e76f51883db28faa6/iplib.py#L125-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037353", "code": "def is_oct(ip):\n    \"\"\"Return true if the IP address is in octal notation.\"\"\"\n    try:\n        dec = int(str(ip), 8)\n    except (TypeError, ValueError):\n        return False\n    if dec > 0o37777777777 or dec < 0:\n        return False\n    return True", "entry_point": "is_oct", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alberanid/python-iplib/blob/488b56fe57ad836b27feec9e76f51883db28faa6/iplib.py#L139-L147", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037354", "code": "def is_dec(ip):\n    \"\"\"Return true if the IP address is in decimal notation.\"\"\"\n    try:\n        dec = int(str(ip))\n    except ValueError:\n        return False\n    if dec > 4294967295 or dec < 0:\n        return False\n    return True", "entry_point": "is_dec", "input": "['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alberanid/python-iplib/blob/488b56fe57ad836b27feec9e76f51883db28faa6/iplib.py#L150-L158", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037355", "code": "def is_bits_nm(nm):\n    \"\"\"Return true if the netmask is in bits notatation.\"\"\"\n    try:\n        bits = int(str(nm))\n    except ValueError:\n        return False\n    if bits > 32 or bits < 0:\n        return False\n    return True", "entry_point": "is_bits_nm", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alberanid/python-iplib/blob/488b56fe57ad836b27feec9e76f51883db28faa6/iplib.py#L205-L213", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037356", "code": "def _dec_to_dot(ip):\n    \"\"\"Decimal to dotted decimal notation conversion.\"\"\"\n    first = int((ip >> 24) & 255)\n    second = int((ip >> 16) & 255)\n    third = int((ip >> 8) & 255)\n    fourth = int(ip & 255)\n    return '%d.%d.%d.%d' % (first, second, third, fourth)", "entry_point": "_dec_to_dot", "input": "7", "output": "'0.0.0.7'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/alberanid/python-iplib/blob/488b56fe57ad836b27feec9e76f51883db28faa6/iplib.py#L242-L248", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037357", "code": "def const_equal(str_a, str_b):\n    '''Constant time string comparison'''\n\n    if len(str_a) != len(str_b):\n        return False\n\n    result = True\n    for i in range(len(str_a)):\n        result &= (str_a[i] == str_b[i])\n\n    return result", "entry_point": "const_equal", "input": "[5, 3, 1, 4], ['a', 'b', 'c']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/vingd/encrypted-pickle-python/blob/7656233598e02e65971f69e11849a0f288b2b2a5/encryptedpickle/utils.py#L27-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037358", "code": "def _update_dict(data, default_data, replace_data=False):\n        '''Update algorithm definition type dictionaries'''\n\n        if not data:\n            data = default_data.copy()\n            return data\n\n        if not isinstance(data, dict):\n            raise TypeError('Value not dict type')\n        if len(data) > 255:\n            raise ValueError('More than 255 values defined')\n        for i in data.keys():\n            if not isinstance(i, int):\n                raise TypeError('Index not int type')\n            if i < 0 or i > 255:\n                raise ValueError('Index value out of range')\n\n        if not replace_data:\n            data.update(default_data)\n\n        return data", "entry_point": "_update_dict", "input": "[], ['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/vingd/encrypted-pickle-python/blob/7656233598e02e65971f69e11849a0f288b2b2a5/encryptedpickle/encryptedpickle.py#L682-L702", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037359", "code": "def dictFlat(l):\n    \"\"\"Given a list of list of dicts, return just the dicts.\"\"\"\n    if type(l) is dict:\n        return [l]\n    if \"numpy\" in str(type(l)):\n        return l\n    dicts=[]\n    for item in l:\n        if type(item)==dict:\n            dicts.append(item)\n        elif type(item)==list:\n            for item2 in item:\n                dicts.append(item2)\n    return dicts", "entry_point": "dictFlat", "input": "['a', 'b', 'c']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L83-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037360", "code": "def forwardSlash(listOfFiles):\n    \"\"\"convert silly C:\\\\names\\\\like\\\\this.txt to c:/names/like/this.txt\"\"\"\n    for i,fname in enumerate(listOfFiles):\n        listOfFiles[i]=fname.replace(\"\\\\\",\"/\")\n    return listOfFiles", "entry_point": "forwardSlash", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L625-L629", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037361", "code": "def abfSort(IDs):\n    \"\"\"\n    given a list of goofy ABF names, return it sorted intelligently.\n    This places things like 16o01001 after 16901001.\n    \"\"\"\n    IDs=list(IDs)\n    monO=[]\n    monN=[]\n    monD=[]\n    good=[]\n    for ID in IDs:\n        if ID is None:\n            continue\n        if 'o' in ID:\n            monO.append(ID)\n        elif 'n' in ID:\n            monN.append(ID)\n        elif 'd' in ID:\n            monD.append(ID)\n        else:\n            good.append(ID)\n    return sorted(good)+sorted(monO)+sorted(monN)+sorted(monD)", "entry_point": "abfSort", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'cherry', 'banana']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/common.py#L163-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037362", "code": "def filesByType(fileList):\n    \"\"\"\n    given a list of files, return them as a dict sorted by type:\n        * plot, tif, data, other\n    \"\"\"\n    features=[\"plot\",\"tif\",\"data\",\"other\",\"experiment\"]\n    files={}\n    for feature in features:\n        files[feature]=[]\n    for fname in fileList:\n        other=True\n        for feature in features:\n            if \"_\"+feature+\"_\" in fname:\n                files[feature].extend([fname])\n                other=False\n        if other:\n            files['other'].extend([fname])\n    return files", "entry_point": "filesByType", "input": "[]", "output": "{'plot': [], 'tif': [], 'data': [], 'other': [], 'experiment': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/common.py#L270-L287", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037363", "code": "def truncate(text, max_len=350, end='...'):\n    \"\"\"Truncate the supplied text for display.\n\n    Arguments:\n      text (:py:class:`str`): The text to truncate.\n      max_len (:py:class:`int`, optional): The maximum length of the\n        text before truncation (defaults to 350 characters).\n      end (:py:class:`str`, optional): The ending to use to show that\n        the text was truncated (defaults to ``'...'``).\n\n    Returns:\n      :py:class:`str`: The truncated text.\n\n    \"\"\"\n    if len(text) <= max_len:\n        return text\n    return text[:max_len].rsplit(' ', maxsplit=1)[0] + end", "entry_point": "truncate", "input": "['a', 'b', 'c'], 5, ['apple', 'banana', 'cherry']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/textbook/aslack/blob/9ac6a44e4464180109fa4be130ad7a980a9d1acc/aslack/utils.py#L50-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037364", "code": "def merge(dict_1, dict_2):\n    \"\"\"Merge two dictionaries.\n\n    Values that evaluate to true take priority over falsy values.\n    `dict_1` takes priority over `dict_2`.\n\n    \"\"\"\n    return dict((str(key), dict_1.get(key) or dict_2.get(key))\n                for key in set(dict_2) | set(dict_1))", "entry_point": "merge", "input": "{'x': [1, 2], 'y': []}, {'a': 1, 'b': 2}", "output": "{'y': None, 'a': 1, 'x': [1, 2], 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Neurita/boyle/blob/2dae7199849395a209c887d5f30506e1de8a9ad9/boyle/utils/rcfile.py#L14-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037365", "code": "def filter_list(lst, filt):\n    \"\"\"\n    Parameters\n    ----------\n    lst: list\n\n    filter: function\n        Unary string filter function\n\n    Returns\n    -------\n    list\n        List of items that passed the filter\n\n    Example\n    -------\n    >>> l    = ['12123123', 'N123213']\n    >>> filt = re.compile('\\d*').match\n    >>> nu_l = list_filter(l, filt)\n    \"\"\"\n    return [m for s in lst for m in (filt(s),) if m]", "entry_point": "filter_list", "input": "{}, (1, 2)", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Neurita/boyle/blob/2dae7199849395a209c887d5f30506e1de8a9ad9/boyle/utils/strings.py#L34-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037366", "code": "def append_to_keys(adict, preffix):\n    \"\"\"\n    Parameters\n    ----------\n    adict:\n    preffix:\n\n    Returns\n    -------\n\n    \"\"\"\n    return {preffix + str(key): (value if isinstance(value, dict) else value)\n            for key, value in list(adict.items())}", "entry_point": "append_to_keys", "input": "{}, []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Neurita/boyle/blob/2dae7199849395a209c887d5f30506e1de8a9ad9/boyle/utils/strings.py#L99-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037367", "code": "def is_fnmatch_regex(string):\n    \"\"\"\n    Returns True if the given string is considered a fnmatch\n    regular expression, False otherwise.\n    It will look for\n\n    :param string: str\n\n    \"\"\"\n    is_regex = False\n    regex_chars = ['!', '*', '$']\n    for c in regex_chars:\n        if string.find(c) > -1:\n            return True\n    return is_regex", "entry_point": "is_fnmatch_regex", "input": "'abc'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Neurita/boyle/blob/2dae7199849395a209c887d5f30506e1de8a9ad9/boyle/utils/strings.py#L167-L181", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037368", "code": "def is_disjoint(set1, set2, warn):\n    \"\"\"\n    Checks if elements of set2 are in set1.\n\n    :param set1: a set of values\n    :param set2: a set of values\n    :param warn: the error message that should be thrown\n     when the sets are NOT disjoint\n    :return: returns true no elements of set2 are in set1\n    \"\"\"\n    for elem in set2:\n        if elem in set1:\n            raise ValueError(warn)\n    return True", "entry_point": "is_disjoint", "input": "[-1, 0, 1, 2], ['a', 'b', 'c'], [[1, 2], [3], []]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dirmeier/dataframe/blob/39992e23293393cc1320d1b9c1c8d2c325fc5626/dataframe/_check.py#L64-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037369", "code": "def contains_all(set1, set2, warn):\n    \"\"\"\n    Checks if all elements from set2 are in set1.\n\n    :param set1:  a set of values\n    :param set2:  a set of values\n    :param warn: the error message that should be thrown \n     when the sets are not containd\n    :return: returns true if all values of set2 are in set1\n    \"\"\"\n    for elem in set2:\n        if elem not in set1:\n            raise ValueError(warn)\n    return True", "entry_point": "contains_all", "input": "('a', 'b', 'c'), 'abc', 3", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dirmeier/dataframe/blob/39992e23293393cc1320d1b9c1c8d2c325fc5626/dataframe/_check.py#L80-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037370", "code": "def resorted(values):\n    \"\"\"\n    Sort values, but put numbers after alphabetically sorted words.\n\n    This function is here to make outputs diff-compatible with Aleph.\n\n    Example::\n        >>> sorted([\"b\", \"1\", \"a\"])\n        ['1', 'a', 'b']\n        >>> resorted([\"b\", \"1\", \"a\"])\n        ['a', 'b', '1']\n\n    Args:\n        values (iterable): any iterable object/list/tuple/whatever.\n\n    Returns:\n        list of sorted values, but with numbers after words\n    \"\"\"\n    if not values:\n        return values\n\n    values = sorted(values)\n\n    # look for first word\n    first_word = next(\n        (cnt for cnt, val in enumerate(values)\n             if val and not val[0].isdigit()),\n        None\n    )\n\n    # if not found, just return the values\n    if first_word is None:\n        return values\n\n    words = values[first_word:]\n    numbers = values[:first_word]\n\n    return words + numbers", "entry_point": "resorted", "input": "'abc'", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/edeposit/marcxml_parser/blob/6d1c77c61fc2827b71f1b3d5aa3332d7f5807820/src/marcxml_parser/tools/resorted.py#L10-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037371", "code": "def build_call_str(prefix, args, kwargs):\n    # type: (str, Any, Any) -> str\n    '''\n    Build a callable Python string for a function call. The output will be\n    combined similar to this template::\n\n        <prefix>(<args>, <kwargs>)\n\n    Example::\n\n        >>> build_call_str('foo', (1, 2), {'a': '10'})\n        \"foo(1, 2, a='10')\"\n    '''\n    kwargs_str = ', '.join(['%s=%r' % (key, value) for key, value in\n                            kwargs.items()])\n    args_str = ', '.join([repr(arg) for arg in args])\n    output = [prefix, '(']\n    if args:\n        output.append(args_str)\n    if args and kwargs:\n        output.append(', ')\n    if kwargs:\n        output.append(kwargs_str)\n    output.append(')')\n    return ''.join(output)", "entry_point": "build_call_str", "input": "'a,b,c', [[1, 2], [3], []], {'a': 1, 'b': 2}", "output": "'a,b,c([1, 2], [3], [], a=1, b=2)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/exhuma/config_resolver/blob/2614ae3d7a49e437954254846b2963ad249b418c/config_resolver/core.py#L89-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037372", "code": "def safe_repr(obj):\n    \"\"\"Returns a repr of an object and falls back to a minimal representation of type and ID if the call to repr raised\n    an error.\n\n    :param obj: object to safe repr\n    :returns: repr string or '(type<id> repr error)' string\n    :rtype: str\n    \"\"\"\n    try:\n        obj_repr = repr(obj)\n    except:\n        obj_repr = \"({0}<{1}> repr error)\".format(type(obj), id(obj))\n    return obj_repr", "entry_point": "safe_repr", "input": "['a', 'b', 'c']", "output": "\"['a', 'b', 'c']\"", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Infinidat/infi.instruct/blob/93b1ab725cfd8d13227960dbf9e3ca1e7f9eebe8/src/infi/instruct/utils/safe_repr.py#L1-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037373", "code": "def color(teffs):\n    \"\"\"\n    Conventional color descriptions of stars.\n    Source: https://en.wikipedia.org/wiki/Stellar_classification\n    \"\"\"\n    colors = []\n    for t in teffs:\n        if t >= 7500:\n            colors.append('blue_white')  # RGB:CAE1FF\n        elif t >= 6000:\n            colors.append('white')  # RGB:F6F6F6\n        elif t >= 5200:\n            colors.append('yellowish_white')  # RGB:FFFEB2\n        elif t >= 3700:\n            colors.append('pale_yellow_orange')  # RGB:FFB28B\n        else:\n            colors.append('light_orange_red')  # RGB:FF9966\n    return colors", "entry_point": "color", "input": "[5, 3, 1, 4]", "output": "['light_orange_red', 'light_orange_red', 'light_orange_red', 'light_orange_red']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/lsst-epo/vela/blob/8e17ebec509be5c3cc2063f4645dfe9e26b49c18/astropixie-widgets/astropixie_widgets/science.py#L65-L82", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037374", "code": "def create_query(section):\n    \"\"\"\n        Creates a search query based on the section of the config file.\n    \"\"\"\n    query = {}\n\n    if 'ports' in section:\n        query['ports'] = [section['ports']]\n    if 'up' in section:\n        query['up'] = bool(section['up'])\n    if 'search' in section:\n        query['search'] = [section['search']]\n    if 'tags' in section:\n        query['tags'] = [section['tags']]\n    if 'groups' in section:\n        query['groups'] = [section['groups']]\n\n    return query", "entry_point": "create_query", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/mwgielen/jackal/blob/7fe62732eb5194b7246215d5277fb37c398097bf/jackal/scripts/named_pipes.py#L50-L67", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037375", "code": "def f_i18n_citation_type(string, lang=\"eng\"):\n    \"\"\" Take a string of form %citation_type|passage% and format it for human\n\n    :param string: String of formation %citation_type|passage%\n    :param lang: Language to translate to\n    :return: Human Readable string\n\n    .. note :: To Do : Use i18n tools and provide real i18n\n    \"\"\"\n    s = \" \".join(string.strip(\"%\").split(\"|\"))\n    return s.capitalize()", "entry_point": "f_i18n_citation_type", "input": "'AbC dEf', [1, 2, 3]", "output": "'Abc def'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Capitains/flask-capitains-nemo/blob/8d91f2c05b925a6c8ea8c997baf698c87257bc58/flask_nemo/filters.py#L83-L93", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037376", "code": "def _plugin_endpoint_rename(fn_name, instance):\n    \"\"\" Rename endpoint function name to avoid conflict when namespacing is set to true\n\n    :param fn_name: Name of the route function\n    :param instance: Instance bound to the function\n    :return: Name of the new namespaced function name\n    \"\"\"\n\n    if instance and instance.namespaced:\n        fn_name = \"r_{0}_{1}\".format(instance.name, fn_name[2:])\n    return fn_name", "entry_point": "_plugin_endpoint_rename", "input": "'Hello World', []", "output": "'Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/Capitains/flask-capitains-nemo/blob/8d91f2c05b925a6c8ea8c997baf698c87257bc58/flask_nemo/__init__.py#L948-L958", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037377", "code": "def split_golden_set(triples, valid_ratio, test_ratio):\n    \"\"\"Split the data into train/valid/test sets.\"\"\"\n    assert valid_ratio >= 0.0\n    assert test_ratio >= 0.0\n    num_valid = int(len(triples) * valid_ratio)\n    num_test = int(len(triples) * test_ratio)\n    valid_set = triples[:num_valid]\n    test_set = triples[num_valid:num_valid+num_test]\n    train_set = triples[num_valid+num_test:]\n    assert len(valid_set) + len(test_set) + len(train_set) == len(triples)\n\n    return train_set, valid_set, test_set", "entry_point": "split_golden_set", "input": "['apple', 'banana', 'cherry'], 2.0, 0.5", "output": "([], ['apple', 'banana', 'cherry'], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/fantasticfears/kgekit/blob/5e464e1fc3ae9c7e216f6dd94f879a967d065247/kgekit/data.py#L145-L156", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037378", "code": "def parse_query(query):\n    \"\"\"\n    Given a simplified XPath query string, returns an array of normalized query parts.\n    \"\"\"\n    parts = query.split('/')\n    norm = []\n    for p in parts:\n        p = p.strip()\n        if p:\n            norm.append(p)\n        elif '' not in norm:\n            norm.append('')\n    return norm", "entry_point": "parse_query", "input": "'Hello World'", "output": "['Hello World']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dcwatson/drill/blob/b8a30ec0fd5b5bf55154bd44c1c75f5f5945691b/drill.py#L118-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037379", "code": "def _get_printable_columns(columns, row):\n    \"\"\"Return only the part of the row which should be printed.\n    \"\"\"\n    if not columns:\n        return row\n\n    # Extract the column values, in the order specified.\n    return tuple(row[c] for c in columns)", "entry_point": "_get_printable_columns", "input": "[1, 2, 3], [-1, 0, 1, 2]", "output": "(0, 1, 2)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/dhellmann/csvcat/blob/d08c0df3af2b1cec739521e6d5bb2b1ad868c591/csvcat/main.py#L44-L51", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037380", "code": "def uniform_index(index,length):\n    '''\n        uniform_index(0,3)\n        uniform_index(-1,3)\n        uniform_index(-4,3)\n        uniform_index(-3,3)\n        uniform_index(5,3)\n    '''\n    if(index<0):\n        rl = length+index\n        if(rl<0):\n            index = 0\n        else:\n            index = rl\n    elif(index>=length):\n        index = length\n    else:\n        index = index\n    return(index)", "entry_point": "uniform_index", "input": "5, -3", "output": "-3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/ihgazni2/elist/blob/8c07b5029bda34ead60ce10335ceb145f209263c/elist/elist.py#L1349-L1367", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037381", "code": "def format_pathname(\n        pathname,\n        max_length):\n    \"\"\"\n    Format a pathname\n\n    :param str pathname: Pathname to format\n    :param int max_length: Maximum length of result pathname (> 3)\n    :return: Formatted pathname\n    :rtype: str\n    :raises ValueError: If *max_length* is not larger than 3\n\n    This function formats a pathname so it is not longer than *max_length*\n    characters. The resulting pathname is returned. It does so by replacing\n    characters at the start of the *pathname* with three dots, if necessary.\n    The idea is that the end of the *pathname* is the most important part\n    to be able to identify the file.\n    \"\"\"\n    if max_length <= 3:\n        raise ValueError(\"max length must be larger than 3\")\n\n    if len(pathname) > max_length:\n        pathname = \"...{}\".format(pathname[-(max_length-3):])\n\n    return pathname", "entry_point": "format_pathname", "input": "'', 7", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/geoneric/starling/blob/a8e1324c4d6e8b063a0d353bcd03bb8e57edd888/starling/flask/template_filter.py#L9-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037382", "code": "def format_uuid(\n        uuid,\n        max_length=10):\n    \"\"\"\n    Format a UUID string\n\n    :param str uuid: UUID to format\n    :param int max_length: Maximum length of result string (> 3)\n    :return: Formatted UUID\n    :rtype: str\n    :raises ValueError: If *max_length* is not larger than 3\n\n    This function formats a UUID so it is not longer than *max_length*\n    characters. The resulting string is returned. It does so by replacing\n    characters at the end of the *uuid* with three dots, if necessary.\n    The idea is that the start of the *uuid* is the most important part\n    to be able to identify the related entity.\n\n    The default *max_length* is 10, which will result in a string\n    containing the first 7 characters of the *uuid* passed in. Most of\n    the time, such a string is still unique within a collection of UUIDs.\n    \"\"\"\n    if max_length <= 3:\n        raise ValueError(\"max length must be larger than 3\")\n\n    if len(uuid) > max_length:\n        uuid = \"{}...\".format(uuid[0:max_length-3])\n\n    return uuid", "entry_point": "format_uuid", "input": "['apple', 'banana', 'cherry'], 10", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/geoneric/starling/blob/a8e1324c4d6e8b063a0d353bcd03bb8e57edd888/starling/flask/template_filter.py#L59-L87", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037383", "code": "def _setup_index(index):\n    \"\"\"Shifts indicies as needed to account for one based indexing\n\n    Positive indicies need to be reduced by one to match with zero based\n    indexing.\n\n    Zero is not a valid input, and as such will throw a value error.\n\n    Arguments:\n        index -     index to shift\n    \"\"\"\n    index = int(index)\n    if index > 0:\n        index -= 1\n    elif index == 0:\n        # Zero indicies should not be allowed by default.\n        raise ValueError\n    return index", "entry_point": "_setup_index", "input": "5", "output": "4", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/jpweiser/cuts/blob/5baf7f2e145045942ee8dcaccbc47f8f821fcb56/cuts/cutter.py#L21-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037384", "code": "def hump_to_underscore(name):\n    \"\"\"\n    Convert Hump style to underscore\n\n    :param name: Hump Character\n    :return: str\n    \"\"\"\n    new_name = ''\n\n    pos = 0\n    for c in name:\n        if pos == 0:\n            new_name = c.lower()\n        elif 65 <= ord(c) <= 90:\n            new_name += '_' + c.lower()\n            pass\n        else:\n            new_name += c\n        pos += 1\n        pass\n    return new_name", "entry_point": "hump_to_underscore", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/wangwenpei/cliez/blob/d6fe775544cd380735c56c8a4a79bc2ad22cb6c4/cliez/utils.py#L28-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037385", "code": "def squeeze_words(line, width=60):\n        \"\"\" Remove spaces in between words until it is small enough for\n            `width`.\n            This will always leave at least one space between words,\n            so it may not be able to get below `width` characters.\n        \"\"\"\n        # Start removing spaces to \"squeeze\" the text, leaving at least one.\n        while ('  ' in line) and (len(line) > width):\n            # Remove two spaces from the end, replace with one.\n            head, _, tail = line.rpartition('  ')\n            line = ' '.join((head, tail))\n        return line", "entry_point": "squeeze_words", "input": "'  padded  ', 2", "output": "' padded '", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/welbornprod/fmtblock/blob/92a5529235d557170ed21e058e3c5995197facbe/fmtblock/formatters.py#L362-L373", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037386", "code": "def value_to_bool(config_val, evar):\n    \"\"\"\n    Massages the 'true' and 'false' strings to bool equivalents.\n\n    :param str config_val: The env var value.\n    :param EnvironmentVariable evar: The EVar object we are validating\n        a value for.\n    :rtype: bool\n    :return: True or False, depending on the value.\n    \"\"\"\n    if not config_val:\n        return False\n    if config_val.strip().lower() == 'true':\n        return True\n    else:\n        return False", "entry_point": "value_to_bool", "input": "{}, [1, 2, 3]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/gtaylor/evarify/blob/37cec29373c820eda96939633e2067d55598915b/evarify/filters/python_basics.py#L64-L79", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037387", "code": "def validate_is_not_none(config_val, evar):\n    \"\"\"\n    If the value is ``None``, fail validation.\n\n    :param str config_val: The env var value.\n    :param EnvironmentVariable evar: The EVar object we are validating\n        a value for.\n    :raises: ValueError if the config value is None.\n    \"\"\"\n    if config_val is None:\n        raise ValueError(\n            \"Value for environment variable '{evar_name}' can't \"\n            \"be empty.\".format(evar_name=evar.name))\n    return config_val", "entry_point": "validate_is_not_none", "input": "{'a': 1, 'b': 2}, ['apple', 'banana', 'cherry']", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/gtaylor/evarify/blob/37cec29373c820eda96939633e2067d55598915b/evarify/filters/python_basics.py#L83-L96", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037388", "code": "def validate_is_boolean_true(config_val, evar):\n    \"\"\"\n    Make sure the value evaluates to boolean True.\n\n    :param str config_val: The env var value.\n    :param EnvironmentVariable evar: The EVar object we are validating\n        a value for.\n    :raises: ValueError if the config value evaluates to boolean False.\n    \"\"\"\n    if config_val is None:\n        raise ValueError(\n            \"Value for environment variable '{evar_name}' can't \"\n            \"be empty.\".format(evar_name=evar.name))\n    return config_val", "entry_point": "validate_is_boolean_true", "input": "{'a': 1, 'b': 2}, [1, 2, 3]", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/validation-00000-of-00001.parquet", "source_id": "https://github.com/gtaylor/evarify/blob/37cec29373c820eda96939633e2067d55598915b/evarify/filters/python_basics.py#L100-L113", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037389", "code": "def _convert_to_float_if_possible(s):\n    \"\"\"\n    A small helper function to convert a string to a numeric value\n    if appropriate\n\n    :param s: the string to be converted\n    :type s: str\n    \"\"\"\n    try:\n        ret = float(s)\n    except (ValueError, TypeError):\n        ret = s\n    return ret", "entry_point": "_convert_to_float_if_possible", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/apache/airflow/blob/b69c686ad8a0c89b9136bb4b31767257eb7b2597/airflow/operators/check_operator.py#L98-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037390", "code": "def _strip_unsafe_kubernetes_special_chars(string):\n        \"\"\"\n        Kubernetes only supports lowercase alphanumeric characters and \"-\" and \".\" in\n        the pod name\n        However, there are special rules about how \"-\" and \".\" can be used so let's\n        only keep\n        alphanumeric chars  see here for detail:\n        https://kubernetes.io/docs/concepts/overview/working-with-objects/names/\n\n        :param string: The requested Pod name\n        :return: ``str`` Pod name stripped of any unsafe characters\n        \"\"\"\n        return ''.join(ch.lower() for ind, ch in enumerate(string) if ch.isalnum())", "entry_point": "_strip_unsafe_kubernetes_special_chars", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/apache/airflow/blob/b69c686ad8a0c89b9136bb4b31767257eb7b2597/airflow/contrib/executors/kubernetes_executor.py#L458-L470", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037391", "code": "def _bq_cast(string_field, bq_type):\n    \"\"\"\n    Helper method that casts a BigQuery row to the appropriate data types.\n    This is useful because BigQuery returns all fields as strings.\n    \"\"\"\n    if string_field is None:\n        return None\n    elif bq_type == 'INTEGER':\n        return int(string_field)\n    elif bq_type == 'FLOAT' or bq_type == 'TIMESTAMP':\n        return float(string_field)\n    elif bq_type == 'BOOLEAN':\n        if string_field not in ['true', 'false']:\n            raise ValueError(\"{} must have value 'true' or 'false'\".format(\n                string_field))\n        return string_field == 'true'\n    else:\n        return string_field", "entry_point": "_bq_cast", "input": "'abc', [5, 3, 1, 4]", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/apache/airflow/blob/b69c686ad8a0c89b9136bb4b31767257eb7b2597/airflow/contrib/hooks/bigquery_hook.py#L1973-L1990", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037392", "code": "def infer_time_unit(time_seconds_arr):\n    \"\"\"\n    Determine the most appropriate time unit for an array of time durations\n    specified in seconds.\n    e.g. 5400 seconds => 'minutes', 36000 seconds => 'hours'\n    \"\"\"\n    if len(time_seconds_arr) == 0:\n        return 'hours'\n    max_time_seconds = max(time_seconds_arr)\n    if max_time_seconds <= 60 * 2:\n        return 'seconds'\n    elif max_time_seconds <= 60 * 60 * 2:\n        return 'minutes'\n    elif max_time_seconds <= 24 * 60 * 60 * 2:\n        return 'hours'\n    else:\n        return 'days'", "entry_point": "infer_time_unit", "input": "[]", "output": "'hours'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/apache/airflow/blob/b69c686ad8a0c89b9136bb4b31767257eb7b2597/airflow/utils/dates.py#L195-L211", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037393", "code": "def _compute_min_event_ndims(bijector_list, compute_forward=True):\n  \"\"\"Computes the min_event_ndims associated with the give list of bijectors.\n\n  Given a list `bijector_list` of bijectors, compute the min_event_ndims that is\n  associated with the composition of bijectors in that list.\n\n  min_event_ndims is the # of right most dimensions for which the bijector has\n  done necessary computation on (i.e. the non-broadcastable part of the\n  computation).\n\n  We can derive the min_event_ndims for a chain of bijectors as follows:\n\n  In the case where there are no rank changing bijectors, this will simply be\n  `max(b.forward_min_event_ndims for b in bijector_list)`. This is because the\n  bijector with the most forward_min_event_ndims requires the most dimensions,\n  and hence the chain also requires operating on those dimensions.\n\n  However in the case of rank changing, more care is needed in determining the\n  exact amount of dimensions. Padding dimensions causes subsequent bijectors to\n  operate on the padded dimensions, and Removing dimensions causes bijectors to\n  operate more left.\n\n  Args:\n    bijector_list: List of bijectors to be composed by chain.\n    compute_forward: Boolean. If True, computes the min_event_ndims associated\n      with a forward call to Chain, and otherwise computes the min_event_ndims\n      associated with an inverse call to Chain. The latter is the same as the\n      min_event_ndims associated with a forward call to Invert(Chain(....)).\n\n  Returns:\n    min_event_ndims\n  \"\"\"\n  min_event_ndims = 0\n  # This is a mouthful, but what this encapsulates is that if not for rank\n  # changing bijectors, we'd only need to compute the largest of the min\n  # required ndims. Hence \"max_min\". Due to rank changing bijectors, we need to\n  # account for synthetic rank growth / synthetic rank decrease from a rank\n  # changing bijector.\n  rank_changed_adjusted_max_min_event_ndims = 0\n\n  if compute_forward:\n    bijector_list = reversed(bijector_list)\n\n  for b in bijector_list:\n    if compute_forward:\n      current_min_event_ndims = b.forward_min_event_ndims\n      current_inverse_min_event_ndims = b.inverse_min_event_ndims\n    else:\n      current_min_event_ndims = b.inverse_min_event_ndims\n      current_inverse_min_event_ndims = b.forward_min_event_ndims\n\n    # New dimensions were touched.\n    if rank_changed_adjusted_max_min_event_ndims < current_min_event_ndims:\n      min_event_ndims += (\n          current_min_event_ndims - rank_changed_adjusted_max_min_event_ndims)\n    rank_changed_adjusted_max_min_event_ndims = max(\n        current_min_event_ndims, rank_changed_adjusted_max_min_event_ndims)\n\n    # If the number of dimensions has increased via forward, then\n    # inverse_min_event_ndims > forward_min_event_ndims, and hence the\n    # dimensions we computed on, have moved left (so we have operated\n    # on additional dimensions).\n    # Conversely, if the number of dimensions has decreased via forward,\n    # then we have inverse_min_event_ndims < forward_min_event_ndims,\n    # and so we will have operated on fewer right most dimensions.\n\n    number_of_changed_dimensions = (\n        current_min_event_ndims - current_inverse_min_event_ndims)\n    rank_changed_adjusted_max_min_event_ndims -= number_of_changed_dimensions\n  return min_event_ndims", "entry_point": "_compute_min_event_ndims", "input": "[], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/probability/blob/e87fe34111d68c35db0f9eeb4935f1ece9e1a8f5/tensorflow_probability/python/bijectors/chain.py#L40-L109", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037394", "code": "def _split_covariance_into_marginals(covariance, block_sizes):\n  \"\"\"Split a covariance matrix into block-diagonal marginals of given sizes.\"\"\"\n  start_dim = 0\n  marginals = []\n  for size in block_sizes:\n    end_dim = start_dim + size\n    marginals.append(covariance[..., start_dim:end_dim, start_dim:end_dim])\n    start_dim = end_dim\n  return marginals", "entry_point": "_split_covariance_into_marginals", "input": "3.25, {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/probability/blob/e87fe34111d68c35db0f9eeb4935f1ece9e1a8f5/tensorflow_probability/python/sts/decomposition.py#L29-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037395", "code": "def _update_docstring(old_str, append_str):\n  \"\"\"Update old_str by inserting append_str just before the \"Args:\" section.\"\"\"\n  old_str = old_str or \"\"\n  old_str_lines = old_str.split(\"\\n\")\n\n  # Step 0: Prepend spaces to all lines of append_str. This is\n  # necessary for correct markdown generation.\n  append_str = \"\\n\".join(\"    %s\" % line for line in append_str.split(\"\\n\"))\n\n  # Step 1: Find mention of \"Args\":\n  has_args_ix = [\n      ix for ix, line in enumerate(old_str_lines)\n      if line.strip().lower() == \"args:\"]\n  if has_args_ix:\n    final_args_ix = has_args_ix[-1]\n    return (\"\\n\".join(old_str_lines[:final_args_ix])\n            + \"\\n\\n\" + append_str + \"\\n\\n\"\n            + \"\\n\".join(old_str_lines[final_args_ix:]))\n  else:\n    return old_str + \"\\n\\n\" + append_str", "entry_point": "_update_docstring", "input": "'walnut thistle harbour', 'a,b,c'", "output": "'walnut thistle harbour\\n\\n    a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/probability/blob/e87fe34111d68c35db0f9eeb4935f1ece9e1a8f5/tensorflow_probability/python/distributions/distribution.py#L107-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037396", "code": "def _remove_dict_keys_with_value(dict_, val):\n  \"\"\"Removes `dict` keys which have have `self` as value.\"\"\"\n  return {k: v for k, v in dict_.items() if v is not val}", "entry_point": "_remove_dict_keys_with_value", "input": "{'a': 1, 'b': 2}, ['a', 'b', 'c']", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/probability/blob/e87fe34111d68c35db0f9eeb4935f1ece9e1a8f5/tensorflow_probability/python/distributions/distribution.py#L173-L175", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037397", "code": "def make_name(super_name, default_super_name, sub_name):\n  \"\"\"Helper which makes a `str` name; useful for tf.compat.v1.name_scope.\"\"\"\n  name = super_name if super_name is not None else default_super_name\n  if sub_name is not None:\n    name += '_' + sub_name\n  return name", "entry_point": "make_name", "input": "'walnut thistle harbour', 'AbC dEf', 'Hello World'", "output": "'walnut thistle harbour_Hello World'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/probability/blob/e87fe34111d68c35db0f9eeb4935f1ece9e1a8f5/tensorflow_probability/python/mcmc/internal/util.py#L66-L71", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037398", "code": "def _ensure_list(tensor_or_list):\n  \"\"\"Converts the input arg to a list if it is not a list already.\n\n  Args:\n    tensor_or_list: A `Tensor` or a Python list of `Tensor`s. The argument to\n      convert to a list of `Tensor`s.\n\n  Returns:\n    A tuple of two elements. The first is a Python list of `Tensor`s containing\n    the original arguments. The second is a boolean indicating whether\n    the original argument was a list or tuple already.\n  \"\"\"\n  if isinstance(tensor_or_list, (list, tuple)):\n    return list(tensor_or_list), True\n  return [tensor_or_list], False", "entry_point": "_ensure_list", "input": "['apple', 'banana', 'cherry']", "output": "(['apple', 'banana', 'cherry'], True)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tensorflow/probability/blob/e87fe34111d68c35db0f9eeb4935f1ece9e1a8f5/tensorflow_probability/python/optimizer/differential_evolution.py#L771-L785", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037399", "code": "def round_accuracy(y_true, y_predicted):\n    \"\"\"\n    Rounds predictions and calculates accuracy in terms of absolute coincidence.\n\n    Args:\n        y_true: list of true values\n        y_predicted: list of predicted values\n\n    Returns:\n        portion of absolutely coincidental samples\n    \"\"\"\n    predictions = [round(x) for x in y_predicted]\n    examples_len = len(y_true)\n    correct = sum([y1 == y2 for y1, y2 in zip(y_true, predictions)])\n    return correct / examples_len if examples_len else 0", "entry_point": "round_accuracy", "input": "[[1, 2], [3], []], {}", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/metrics/accuracy.py#L94-L108", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037400", "code": "def _wrap(text, wrap_at=120, indent=4):\n    \"\"\"\n    Return piece of text, wrapped around if needed.\n\n    :param text: text that may be too long and then needs to be wrapped.\n    :param wrap_at: the maximum line length.\n    :param indent: number of spaces to prepend to all subsequent lines after the first.\n    \"\"\"\n    out = \"\"\n    curr_line_length = indent\n    space_needed = False\n    for word in text.split():\n        if curr_line_length + len(word) > wrap_at:\n            out += \"\\n\" + \" \" * indent\n            curr_line_length = indent\n            space_needed = False\n        if space_needed:\n            out += \" \"\n            curr_line_length += 1\n        out += word\n        curr_line_length += len(word)\n        space_needed = True\n    return out", "entry_point": "_wrap", "input": "'', [5, 3, 1, 4], [5, 3, 1, 4]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/debugging.py#L322-L344", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037401", "code": "def get_human_readable_time(time_ms):\n    \"\"\"\n    Convert given duration in milliseconds into a human-readable representation, i.e. hours, minutes, seconds,\n    etc. More specifically, the returned string may look like following:\n        1 day 3 hours 12 mins\n        3 days 0 hours 0 mins\n        8 hours 12 mins\n        34 mins 02 secs\n        13 secs\n        541 ms\n    In particular, the following rules are applied:\n        * milliseconds are printed only if the duration is less than a second;\n        * seconds are printed only if the duration is less than an hour;\n        * for durations greater than 1 hour we print days, hours and minutes keeping zeros in the middle (i.e. we\n          return \"4 days 0 hours 12 mins\" instead of \"4 days 12 mins\").\n\n    :param time_ms: duration, as a number of elapsed milliseconds.\n    :return: human-readable string representation of the provided duration.\n    \"\"\"\n    millis = time_ms % 1000\n    secs = (time_ms // 1000) % 60\n    mins = (time_ms // 60000) % 60\n    hours = (time_ms // 3600000) % 24\n    days = (time_ms // 86400000)\n\n    res = \"\"\n    if days > 1:\n        res += \"%d days\" % days\n    elif days == 1:\n        res += \"1 day\"\n\n    if hours > 1 or (hours == 0 and res):\n        res += \" %d hours\" % hours\n    elif hours == 1:\n        res += \" 1 hour\"\n\n    if mins > 1 or (mins == 0 and res):\n        res += \" %d mins\" % mins\n    elif mins == 1:\n        res += \" 1 min\"\n\n    if days == 0 and hours == 0:\n        res += \" %02d secs\" % secs\n    if not res:\n        res = \" %d ms\" % millis\n\n    return res.strip()", "entry_point": "get_human_readable_time", "input": "3.25", "output": "'00 secs'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L282-L328", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037402", "code": "def translate_name(name):\n    \"\"\"\n    Convert names with underscores into camelcase.\n\n    For example:\n        \"num_rows\" => \"numRows\"\n        \"very_long_json_name\" => \"veryLongJsonName\"\n        \"build_GBM_model\" => \"buildGbmModel\"\n        \"KEY\" => \"key\"\n        \"middle___underscores\" => \"middleUnderscores\"\n        \"_exclude_fields\" => \"_excludeFields\" (retain initial/trailing underscores)\n        \"__http_status__\" => \"__httpStatus__\"\n\n    :param name: name to be converted\n    \"\"\"\n    parts = name.split(\"_\")\n    i = 0\n    while parts[i] == \"\":\n        parts[i] = \"_\"\n        i += 1\n    parts[i] = parts[i].lower()\n    for j in range(i + 1, len(parts)):\n        parts[j] = parts[j].capitalize()\n    i = len(parts) - 1\n    while parts[i] == \"\":\n        parts[i] = \"_\"\n        i -= 1\n    return \"\".join(parts)", "entry_point": "translate_name", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_java.py#L42-L69", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037403", "code": "def extract_true_string(string_content):\n    \"\"\"\n    remove extra characters before the actual string we are\n    looking for.  The Jenkins console output is encoded using utf-8.  However, the stupid\n    redirect function can only encode using ASCII.  I have googled for half a day with no\n    results to how to resolve the issue.  Hence, we are going to the heat and just manually\n    get rid of the junk.\n\n    Parameters\n    ----------\n\n    string_content :  str\n        contains a line read in from jenkins console\n\n    :return: str: contains the content of the line after the string '[0m'\n\n    \"\"\"\n\n    startL,found,endL = string_content.partition('[0m')\n\n    if found:\n        return endL\n    else:\n        return string_content", "entry_point": "extract_true_string", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L118-L141", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037404", "code": "def normalize_enum_constant(s):\n    \"\"\"Return enum constant `s` converted to a canonical snake-case.\"\"\"\n    if s.islower(): return s\n    if s.isupper(): return s.lower()\n    return \"\".join(ch if ch.islower() else \"_\" + ch.lower() for ch in s).strip(\"_\")", "entry_point": "normalize_enum_constant", "input": "'abc'", "output": "'abc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_python.py#L66-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037405", "code": "def repr2(x):\n    \"\"\"Analogous to repr(), but will suppress 'u' prefix when repr-ing a unicode string.\"\"\"\n    s = repr(x)\n    if len(s) >= 2 and s[0] == \"u\" and (s[1] == \"'\" or s[1] == '\"'):\n        s = s[1:]\n    return s", "entry_point": "repr2", "input": "[5, 3, 1, 4]", "output": "'[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/compatibility.py#L156-L161", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037406", "code": "def _get_readable_id(id_name, id_prefix_to_skip):\n    \"\"\"simplified an id to be more friendly for us people\"\"\"\n    # id_name is in the form 'https://namespace.host.suffix/name'\n    # where name may contain a forward slash!\n    pos = id_name.find('//')\n    if pos != -1:\n        pos += 2\n        if id_prefix_to_skip:\n            pos = id_name.find(id_prefix_to_skip, pos)\n            if pos != -1:\n                pos += len(id_prefix_to_skip)\n        pos = id_name.find('/', pos)\n        if pos != -1:\n            return id_name[pos + 1:]\n    return id_name", "entry_point": "_get_readable_id", "input": "'AbC dEf', '  padded  '", "output": "'AbC dEf'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_common_serialization.py#L29-L43", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037407", "code": "def doc_from_xml(document_element_name, inner_xml):\n        '''Wraps the specified xml in an xml root element with default azure\n        namespaces'''\n        xml = ''.join(['<', document_element_name,\n                      ' xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"',\n                      ' xmlns=\"http://schemas.microsoft.com/windowsazure\">'])\n        xml += inner_xml\n        xml += ''.join(['</', document_element_name, '>'])\n        return xml", "entry_point": "doc_from_xml", "input": "'AbC dEf', 'abc'", "output": "'<AbC dEf xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/windowsazure\">abc</AbC dEf>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1285-L1293", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037408", "code": "def _handle_output(results_queue):\n    \"\"\"Scan output for exceptions\n\n    If there is an output from an add task collection call add it to the results.\n\n    :param results_queue: Queue containing results of attempted add_collection's\n    :type results_queue: collections.deque\n    :return: list of TaskAddResults\n    :rtype: list[~TaskAddResult]\n    \"\"\"\n    results = []\n    while results_queue:\n        queue_item = results_queue.pop()\n        results.append(queue_item)\n    return results", "entry_point": "_handle_output", "input": "[-1, 0, 1, 2]", "output": "[2, 1, 0, -1]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-batch/azure/batch/custom/patch.py#L172-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037409", "code": "def format_filesize(size):\n    \"\"\"Formats the file size into a human readable format.\"\"\"\n    for suffix in (\"bytes\", \"KB\", \"MB\", \"GB\", \"TB\"):\n        if size < 1024.0:\n            if suffix in (\"GB\", \"TB\"):\n                return \"{0:3.2f} {1}\".format(size, suffix)\n            else:\n                return \"{0:3.1f} {1}\".format(size, suffix)\n\n        size /= 1024.0", "entry_point": "format_filesize", "input": "0", "output": "'0.0 bytes'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/streamlink/streamlink/blob/c8ed1daff14ac03195870238b9b900c1109dd5c1/src/streamlink_cli/utils/progress.py#L71-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037410", "code": "def format_time(elapsed):\n    \"\"\"Formats elapsed seconds into a human readable format.\"\"\"\n    hours = int(elapsed / (60 * 60))\n    minutes = int((elapsed % (60 * 60)) / 60)\n    seconds = int(elapsed % 60)\n\n    rval = \"\"\n    if hours:\n        rval += \"{0}h\".format(hours)\n\n    if elapsed > 60:\n        rval += \"{0}m\".format(minutes)\n\n    rval += \"{0}s\".format(seconds)\n    return rval", "entry_point": "format_time", "input": "True", "output": "'1s'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/streamlink/streamlink/blob/c8ed1daff14ac03195870238b9b900c1109dd5c1/src/streamlink_cli/utils/progress.py#L83-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037411", "code": "def _convert_name(filenames, shuffle=False):\n    '''Convert a filename (or list of) to a filename with .hdf5 and optionally a -shuffle suffix'''\n    if not isinstance(filenames, (list, tuple)):\n        filenames = [filenames]\n    base = filenames[0]\n    if shuffle:\n        base += '-shuffle'\n    if len(filenames) > 1:\n        return base + \"_and_{}_more.hdf5\".format(len(filenames)-1)\n    else:\n        return base + \".hdf5\"", "entry_point": "_convert_name", "input": "'', [-1, 0, 1, 2]", "output": "'-shuffle.hdf5'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/vaexio/vaex/blob/a45b672f8287afca2ada8e36b74b604b9b28dd85/packages/vaex-core/vaex/__init__.py#L101-L111", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037412", "code": "def __jaccard(int_a, int_b):  # pragma: no cover\n    '''Jaccard similarity between two intervals\n\n    Parameters\n    ----------\n    int_a, int_b : np.ndarrays, shape=(2,)\n\n    Returns\n    -------\n    Jaccard similarity between intervals\n    '''\n    ends = [int_a[1], int_b[1]]\n    if ends[1] < ends[0]:\n        ends.reverse()\n\n    starts = [int_a[0], int_b[0]]\n    if starts[1] < starts[0]:\n        starts.reverse()\n\n    intersection = ends[0] - starts[1]\n    if intersection < 0:\n        intersection = 0.\n\n    union = ends[1] - starts[0]\n\n    if union > 0:\n        return intersection / union\n\n    return 0.0", "entry_point": "__jaccard", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/librosa/librosa/blob/180e8e6eb8f958fa6b20b8cba389f7945d508247/librosa/util/matching.py#L17-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037413", "code": "def rb_epc(fit, rb_pattern):\n    \"\"\"Take the rb fit data and convert it into EPC (error per Clifford)\n\n    Args:\n        fit (dict): dictionary of the fit quantities (A, alpha, B) with the\n            keys 'qn' where n is  the qubit and subkeys 'fit', e.g.\n            {'q0':{'fit': [1, 0, 0.9], 'fiterr': [0, 0, 0]}}}\n        rb_pattern (list): (see randomized benchmarking functions). Pattern\n            which specifies which qubits performing RB with which qubits. E.g.\n            [[1],[0,2]] is Q1  doing 1Q RB simultaneously with Q0/Q2 doing\n            2Q RB\n\n    Return:\n        dict: updates the passed in fit dictionary with the epc\n    \"\"\"\n    for patterns in rb_pattern:\n        for qubit in patterns:\n            fitalpha = fit['q%d' % qubit]['fit'][1]\n            fitalphaerr = fit['q%d' % qubit]['fiterr'][1]\n            nrb = 2 ** len(patterns)\n\n            fit['q%d' % qubit]['fit_calcs'] = {}\n            fit['q%d' % qubit]['fit_calcs']['epc'] = [(nrb - 1) / nrb * (1 - fitalpha),\n                                                      fitalphaerr / fitalpha]\n            fit['q%d' % qubit]['fit_calcs']['epc'][1] *= fit['q%d' % qubit]['fit_calcs']['epc'][0]\n\n    return fit", "entry_point": "rb_epc", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/tools/qcvv/fitters.py#L93-L119", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037414", "code": "def merge_lines(top, bot, icod=\"top\"):\n        \"\"\"\n        Merges two lines (top and bot) in the way that the overlapping make senses.\n        Args:\n            top (str): the top line\n            bot (str): the bottom line\n            icod (top or bot): in case of doubt, which line should have priority? Default: \"top\".\n        Returns:\n            str: The merge of both lines.\n        \"\"\"\n        ret = \"\"\n        for topc, botc in zip(top, bot):\n            if topc == botc:\n                ret += topc\n            elif topc in '\u253c\u256a' and botc == \" \":\n                ret += \"\u2502\"\n            elif topc == \" \":\n                ret += botc\n            elif topc in '\u252c\u2565' and botc in \" \u2551\u2502\" and icod == \"top\":\n                ret += topc\n            elif topc in '\u252c' and botc == \" \" and icod == \"bot\":\n                ret += '\u2502'\n            elif topc in '\u2565' and botc == \" \" and icod == \"bot\":\n                ret += '\u2551'\n            elif topc in '\u252c\u2502' and botc == \"\u2550\":\n                ret += '\u256a'\n            elif topc in '\u252c\u2502' and botc == \"\u2500\":\n                ret += '\u253c'\n            elif topc in '\u2514\u2518\u2551\u2502\u2591' and botc == \" \" and icod == \"top\":\n                ret += topc\n            elif topc in '\u2500\u2550' and botc == \" \" and icod == \"top\":\n                ret += topc\n            elif topc in '\u2500\u2550' and botc == \" \" and icod == \"bot\":\n                ret += botc\n            elif topc in \"\u2551\u2565\" and botc in \"\u2550\":\n                ret += \"\u256c\"\n            elif topc in \"\u2551\u2565\" and botc in \"\u2500\":\n                ret += \"\u256b\"\n            elif topc in '\u256b\u256c' and botc in \" \":\n                ret += \"\u2551\"\n            elif topc == '\u2514' and botc == \"\u250c\":\n                ret += \"\u251c\"\n            elif topc == '\u2518' and botc == \"\u2510\":\n                ret += \"\u2524\"\n            elif botc in \"\u2510\u250c\" and icod == 'top':\n                ret += \"\u252c\"\n            elif topc in \"\u2518\u2514\" and botc in \"\u2500\" and icod == 'top':\n                ret += \"\u2534\"\n            else:\n                ret += botc\n        return ret", "entry_point": "merge_lines", "input": "[], [[1, 2], [3], []], [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/visualization/text.py#L647-L697", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037415", "code": "def count_matched_codes(codes_regex, codes_dict):\n        \"\"\" helper to aggregate codes by mask \"\"\"\n        total = 0\n        for code, count in codes_dict.items():\n            if codes_regex.match(str(code)):\n                total += count\n        return total", "entry_point": "count_matched_codes", "input": "['a', 'b', 'c'], {}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/common/interfaces.py#L171-L177", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037416", "code": "def proper_round(n):\n    \"\"\"\n    rounds float to closest int\n    :rtype: int\n    :param n: float\n    \"\"\"\n    return int(n) + (n / abs(n)) * int(abs(n - int(n)) >= 0.5) if n != 0 else 0", "entry_point": "proper_round", "input": "True", "output": "1.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/stepper/util.py#L67-L73", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037417", "code": "def construct_publish_comands(additional_steps=None, nightly=False):\n    '''Get the shell commands we'll use to actually build and publish a package to PyPI.'''\n    publish_commands = (\n        ['rm -rf dist']\n        + (additional_steps if additional_steps else [])\n        + [\n            'python setup.py sdist bdist_wheel{nightly}'.format(\n                nightly=' --nightly' if nightly else ''\n            ),\n            'twine upload dist/*',\n        ]\n    )\n\n    return publish_commands", "entry_point": "construct_publish_comands", "input": "[], ['apple', 'banana', 'cherry']", "output": "['rm -rf dist', 'python setup.py sdist bdist_wheel --nightly', 'twine upload dist/*']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/bin/publish.py#L50-L63", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037418", "code": "def parse_scoped_selector(scoped_selector):\n  \"\"\"Parse scoped selector.\"\"\"\n  # Conver Macro (%scope/name) to (scope/name/macro.value)\n  if scoped_selector[0] == '%':\n    if scoped_selector.endswith('.value'):\n      err_str = '{} is invalid cannot use % and end with .value'\n      raise ValueError(err_str.format(scoped_selector))\n    scoped_selector = scoped_selector[1:] + '/macro.value'\n  scope_selector_list = scoped_selector.rsplit('/', 1)\n  scope = ''.join(scope_selector_list[:-1])\n  selector = scope_selector_list[-1]\n  return scope, selector", "entry_point": "parse_scoped_selector", "input": "'  padded  '", "output": "('', '  padded  ')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/google/gin-config/blob/17a170e0a6711005d1c78e67cf493dc44674d44f/gin/config_parser.py#L455-L466", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037419", "code": "def topoSort(roots, getParents):\n    \"\"\"Return a topological sorting of nodes in a graph.\n\n    roots - list of root nodes to search from\n    getParents - function which returns the parents of a given node\n    \"\"\"\n\n    results = []\n    visited = set()\n\n    # Use iterative version to avoid stack limits for large datasets\n    stack = [(node, 0) for node in roots]\n    while stack:\n        current, state = stack.pop()\n        if state == 0:\n            # before recursing\n            if current not in visited:\n                visited.add(current)\n                stack.append((current, 1))\n                stack.extend((parent, 0) for parent in getParents(current))\n        else:\n            # after recursing\n            assert(current in visited)\n            results.append(current)\n    return results", "entry_point": "topoSort", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/python/performance/blob/2a9524c0a5714e85106671bc61d750e800fe17db/performance/benchmarks/bm_mdp.py#L9-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037420", "code": "def sanitize_for_archive(url, headers, payload):\n        \"\"\"Sanitize payload of a HTTP request by removing the token information\n        before storing/retrieving archived items\n\n        :param: url: HTTP url request\n        :param: headers: HTTP headers request\n        :param: payload: HTTP payload request\n\n        :returns url, headers and the sanitized payload\n        \"\"\"\n        if headers and 'PRIVATE-TOKEN' in headers:\n            headers.pop('PRIVATE-TOKEN', None)\n\n        return url, headers, payload", "entry_point": "sanitize_for_archive", "input": "['apple', 'banana', 'cherry'], [1, 2, 3], [-1, 0, 1, 2]", "output": "(['apple', 'banana', 'cherry'], [1, 2, 3], [-1, 0, 1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L588-L601", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037421", "code": "def filter_custom_fields(fields):\n    \"\"\"Filter custom fields from a given set of fields.\n\n    :param fields: set of fields\n\n    :returns: an object with the filtered custom fields\n    \"\"\"\n\n    custom_fields = {}\n\n    sorted_fields = [field for field in fields if field['custom'] is True]\n\n    for custom_field in sorted_fields:\n        custom_fields[custom_field['id']] = custom_field\n\n    return custom_fields", "entry_point": "filter_custom_fields", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/jira.py#L65-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037422", "code": "def sanitize_for_archive(url, headers, payload):\n        \"\"\"Sanitize payload of a HTTP request by removing the token information\n        before storing/retrieving archived items\n\n        :param: url: HTTP url request\n        :param: headers: HTTP headers request\n        :param: payload: HTTP payload request\n\n        :returns url, headers and the sanitized payload\n        \"\"\"\n        if 'key' in payload:\n            payload.pop('key')\n\n        return url, headers, payload", "entry_point": "sanitize_for_archive", "input": "[5, 3, 1, 4], [1, 2, 3], [1, 2, 3]", "output": "([5, 3, 1, 4], [1, 2, 3], [1, 2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/stackexchange.py#L258-L271", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037423", "code": "def is_attr_protected(attrname: str) -> bool:\n    \"\"\"return True if attribute name is protected (start with _ and some other\n    details), False otherwise.\n    \"\"\"\n    return (\n        attrname[0] == \"_\"\n        and attrname != \"_\"\n        and not (attrname.startswith(\"__\") and attrname.endswith(\"__\"))\n    )", "entry_point": "is_attr_protected", "input": "'Hello World'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/checkers/utils.py#L603-L611", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037424", "code": "def _qualified_names(modname):\n    \"\"\"Split the names of the given module into subparts\n\n    For example,\n        _qualified_names('pylint.checkers.ImportsChecker')\n    returns\n        ['pylint', 'pylint.checkers', 'pylint.checkers.ImportsChecker']\n    \"\"\"\n    names = modname.split(\".\")\n    return [\".\".join(names[0 : i + 1]) for i in range(len(names))]", "entry_point": "_qualified_names", "input": "'AbC dEf'", "output": "['AbC dEf']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/checkers/imports.py#L55-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037425", "code": "def _is_name_used_as_variadic(name, variadics):\n    \"\"\"Check if the given name is used as a variadic argument.\"\"\"\n    return any(\n        variadic.value == name or variadic.value.parent_of(name)\n        for variadic in variadics\n    )", "entry_point": "_is_name_used_as_variadic", "input": "'walnut thistle harbour', []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/checkers/typecheck.py#L506-L511", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037426", "code": "def get_access_path(key, parts):\n    \"\"\" Given a list of format specifiers, returns\n    the final access path (e.g. a.b.c[0][1]).\n    \"\"\"\n    path = []\n    for is_attribute, specifier in parts:\n        if is_attribute:\n            path.append(\".{}\".format(specifier))\n        else:\n            path.append(\"[{!r}]\".format(specifier))\n    return str(key) + \"\".join(path)", "entry_point": "get_access_path", "input": "[5, 3, 1, 4], []", "output": "'[5, 3, 1, 4]'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/checkers/strings.py#L176-L186", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037427", "code": "def str_eval(token):\n    \"\"\"\n    Mostly replicate `ast.literal_eval(token)` manually to avoid any performance hit.\n    This supports f-strings, contrary to `ast.literal_eval`.\n    We have to support all string literal notations:\n    https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals\n    \"\"\"\n    if token[0:2].lower() in (\"fr\", \"rf\"):\n        token = token[2:]\n    elif token[0].lower() in (\"r\", \"u\", \"f\"):\n        token = token[1:]\n    if token[0:3] in ('\"\"\"', \"'''\"):\n        return token[3:-3]\n    return token[1:-1]", "entry_point": "str_eval", "input": "'Hello World'", "output": "'ello Worl'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/checkers/strings.py#L750-L763", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037428", "code": "def _basename_in_blacklist_re(base_name, black_list_re):\n    \"\"\"Determines if the basename is matched in a regex blacklist\n\n    :param str base_name: The basename of the file\n    :param list black_list_re: A collection of regex patterns to match against.\n        Successful matches are blacklisted.\n\n    :returns: `True` if the basename is blacklisted, `False` otherwise.\n    :rtype: bool\n    \"\"\"\n    for file_pattern in black_list_re:\n        if file_pattern.match(base_name):\n            return True\n    return False", "entry_point": "_basename_in_blacklist_re", "input": "'  padded  ', []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/utils/utils.py#L76-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037429", "code": "def _splitstrip(string, sep=\",\"):\n    \"\"\"return a list of stripped string by splitting the string given as\n    argument on `sep` (',' by default). Empty string are discarded.\n\n    >>> _splitstrip('a, b, c   ,  4,,')\n    ['a', 'b', 'c', '4']\n    >>> _splitstrip('a')\n    ['a']\n    >>> _splitstrip('a,\\nb,\\nc,')\n    ['a', 'b', 'c']\n\n    :type string: str or unicode\n    :param string: a csv line\n\n    :type sep: str or unicode\n    :param sep: field separator, default to the comma (',')\n\n    :rtype: str or unicode\n    :return: the unquoted string (or the input string if it wasn't quoted)\n    \"\"\"\n    return [word.strip() for word in string.split(sep) if word.strip()]", "entry_point": "_splitstrip", "input": "'walnut thistle harbour', 'abc'", "output": "['walnut thistle harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/utils/utils.py#L258-L278", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037430", "code": "def _unquote(string):\n    \"\"\"remove optional quotes (simple or double) from the string\n\n    :type string: str or unicode\n    :param string: an optionally quoted string\n\n    :rtype: str or unicode\n    :return: the unquoted string (or the input string if it wasn't quoted)\n    \"\"\"\n    if not string:\n        return string\n    if string[0] in \"\\\"'\":\n        string = string[1:]\n    if string[-1] in \"\\\"'\":\n        string = string[:-1]\n    return string", "entry_point": "_unquote", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/utils/utils.py#L281-L296", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037431", "code": "def table_lines_from_stats(stats, _, columns):\n    \"\"\"get values listed in <columns> from <stats> and <old_stats>,\n    and return a formated list of values, designed to be given to a\n    ureport.Table object\n    \"\"\"\n    lines = []\n    for m_type in columns:\n        new = stats[m_type]\n        new = \"%.3f\" % new if isinstance(new, float) else str(new)\n        lines += (m_type.replace(\"_\", \" \"), new, \"NC\", \"NC\")\n    return lines", "entry_point": "table_lines_from_stats", "input": "[], [], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/PyCQA/pylint/blob/2bf5c61a3ff6ae90613b81679de42c0f19aea600/pylint/checkers/__init__.py#L46-L56", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037432", "code": "def change_weibo_header(uri, headers, body):\n    \"\"\"Since weibo is a rubbish server, it does not follow the standard,\n    we need to change the authorization header for it.\"\"\"\n    auth = headers.get('Authorization')\n    if auth:\n        auth = auth.replace('Bearer', 'OAuth2')\n        headers['Authorization'] = auth\n    return uri, headers, body", "entry_point": "change_weibo_header", "input": "True, {'a': 1, 'b': 2}, [5, 3, 1, 4]", "output": "(True, {'a': 1, 'b': 2}, [5, 3, 1, 4])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/lepture/flask-oauthlib/blob/9e6f152a5bb360e7496210da21561c3e6d41b0e1/flask_oauthlib/contrib/apps.py#L191-L198", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037433", "code": "def _link_field_to_dict(field):\n        \"\"\" Utility for ripping apart github's Link header field.\n        It's kind of ugly.\n        \"\"\"\n\n        if not field:\n            return dict()\n\n        return dict([\n            (\n                part.split('; ')[1][5:-1],\n                part.split('; ')[0][1:-1],\n            ) for part in field.split(', ')\n        ])", "entry_point": "_link_field_to_dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ralphbean/bugwarrior/blob/b2a5108f7b40cb0c437509b64eaa28f941f7ac8b/bugwarrior/services/github.py#L107-L120", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037434", "code": "def hamdist(str1, str2):\n    \"\"\"Count the # of differences between equal length strings str1 and str2\"\"\"\n    diffs = 0\n    for ch1, ch2 in zip(str1, str2):\n        if ch1 != ch2:\n            diffs += 1\n    return diffs", "entry_point": "hamdist", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ralphbean/bugwarrior/blob/b2a5108f7b40cb0c437509b64eaa28f941f7ac8b/bugwarrior/db.py#L91-L97", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037435", "code": "def make_list(var, num_terms=1):\n    \"\"\" Make a variable a list if it is not already\n\n    If variable is not a list it will make it a list of the correct length with\n    all terms identical.\n    \"\"\"\n    if not isinstance(var, list):\n        if isinstance(var, tuple):\n            var = list(var)\n        else:\n            var = [var]\n    #if len(var) == 1:\n            for _ in range(1, num_terms):\n                var.append(var[0])\n    return var", "entry_point": "make_list", "input": "[-1, 0, 1, 2], 2", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/3DLIRIOUS/MeshLabXML/blob/177cce21e92baca500f56a932d66bd9a33257af8/meshlabxml/util.py#L90-L104", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037436", "code": "def v_cross(u, v):\n    \"\"\"muparser cross product function\n\n    Compute the cross product of two 3x1 vectors\n\n    Args:\n        u (list or tuple of 3 strings): first vector\n        v (list or tuple of 3 strings): second vector\n    Returns:\n        A list containing a muparser string of the cross product\n    \"\"\"\n    \"\"\"\n    i = u[1]*v[2] - u[2]*v[1]\n    j = u[2]*v[0] - u[0]*v[2]\n    k = u[0]*v[1] - u[1]*v[0]\n    \"\"\"\n\n    i = '(({u1})*({v2}) - ({u2})*({v1}))'.format(u1=u[1], u2=u[2], v1=v[1], v2=v[2])\n    j = '(({u2})*({v0}) - ({u0})*({v2}))'.format(u0=u[0], u2=u[2], v0=v[0], v2=v[2])\n    k = '(({u0})*({v1}) - ({u1})*({v0}))'.format(u0=u[0], u1=u[1], v0=v[0], v1=v[1])\n    return [i, j, k]", "entry_point": "v_cross", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "['((b)*(cherry) - (c)*(banana))', '((c)*(apple) - (a)*(cherry))', '((a)*(banana) - (b)*(apple))']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/3DLIRIOUS/MeshLabXML/blob/177cce21e92baca500f56a932d66bd9a33257af8/meshlabxml/mp_func.py#L118-L138", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037437", "code": "def v_multiply(scalar, v1):\n    \"\"\" Multiply vector by scalar\"\"\"\n    vector = []\n    for i, x in enumerate(v1):\n        vector.append('(({})*({}))'.format(scalar, v1[i]))\n    return vector", "entry_point": "v_multiply", "input": "[], [-1, 0, 1, 2]", "output": "['(([])*(-1))', '(([])*(0))', '(([])*(1))', '(([])*(2))']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/3DLIRIOUS/MeshLabXML/blob/177cce21e92baca500f56a932d66bd9a33257af8/meshlabxml/mp_func.py#L165-L170", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037438", "code": "def _remove_duplicates(objects):\n    \"\"\"Removes duplicate objects.\n\n    http://www.peterbe.com/plog/uniqifiers-benchmark.\n    \"\"\"\n    seen, uniq = set(), []\n    for obj in objects:\n        obj_id = id(obj)\n        if obj_id in seen:\n            continue\n        seen.add(obj_id)\n        uniq.append(obj)\n    return uniq", "entry_point": "_remove_duplicates", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/nvdv/vprof/blob/4c3ff78f8920ab10cb9c00b14143452aa09ff6bb/vprof/memory_profiler.py#L21-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037439", "code": "def _skip_lines(src_code, skip_map):\n        \"\"\"Skips lines in src_code specified by skip map.\"\"\"\n        if not skip_map:\n            return [['line', j + 1, l] for j, l in enumerate(src_code)]\n        code_with_skips, i = [], 0\n        for line, length in skip_map:\n            code_with_skips.extend(\n                ['line', i + j + 1, l] for j, l in enumerate(src_code[i:line]))\n            if (code_with_skips\n                    and code_with_skips[-1][0] == 'skip'):  # Merge skips.\n                code_with_skips[-1][1] += length\n            else:\n                code_with_skips.append(['skip', length])\n            i = line + length\n        code_with_skips.extend(\n            ['line', i + j + 1, l] for j, l in enumerate(src_code[i:]))\n        return code_with_skips", "entry_point": "_skip_lines", "input": "['a', 'b', 'c'], {}", "output": "[['line', 1, 'a'], ['line', 2, 'b'], ['line', 3, 'c']]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/nvdv/vprof/blob/4c3ff78f8920ab10cb9c00b14143452aa09ff6bb/vprof/code_heatmap.py#L132-L148", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037440", "code": "def get_filename_safe_string(string):\n    \"\"\"\n    Converts a string to a string that is safe for a filename\n    Args:\n        string (str): A string to make safe for a filename\n\n    Returns:\n        str: A string safe for a filename\n    \"\"\"\n    invalid_filename_chars = ['\\\\', '/', ':', '\"', '*', '?', '|', '\\n',\n                              '\\r']\n    if string is None:\n        string = \"None\"\n    for char in invalid_filename_chars:\n        string = string.replace(char, \"\")\n    string = string.rstrip(\".\")\n\n    return string", "entry_point": "get_filename_safe_string", "input": "'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/domainaware/parsedmarc/blob/ecc9fd434c23d896ccd1f35795ccc047f946ed05/parsedmarc/utils.py#L393-L410", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037441", "code": "def get_messages_by_line(messages):\n    \"\"\"Return dictionary that maps line number to message.\"\"\"\n    line_messages = {}\n    for message in messages:\n        line_messages[message.lineno] = message\n    return line_messages", "entry_point": "get_messages_by_line", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L414-L419", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037442", "code": "def get_indentation(line):\n    \"\"\"Return leading whitespace.\"\"\"\n    if line.strip():\n        non_whitespace_index = len(line) - len(line.lstrip())\n        return line[:non_whitespace_index]\n    else:\n        return ''", "entry_point": "get_indentation", "input": "''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L577-L583", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037443", "code": "def get_line_ending(line):\n    \"\"\"Return line ending.\"\"\"\n    non_whitespace_index = len(line.rstrip()) - len(line)\n    if not non_whitespace_index:\n        return ''\n    else:\n        return line[non_whitespace_index:]", "entry_point": "get_line_ending", "input": "'walnut thistle harbour'", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L586-L592", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037444", "code": "def _split_comma_separated(string):\n    \"\"\"Return a set of strings.\"\"\"\n    return set(text.strip() for text in string.split(',') if text.strip())", "entry_point": "_split_comma_separated", "input": "'abc'", "output": "{'abc'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L726-L728", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037445", "code": "def get_enumerations_from_bit_mask(enumeration, mask):\n    \"\"\"\n    A utility function that creates a list of enumeration values from a bit\n    mask for a specific mask enumeration class.\n\n    Args:\n        enumeration (class): The enumeration class from which to draw\n            enumeration values.\n        mask (int): The bit mask from which to identify enumeration values.\n\n    Returns:\n        list: A list of enumeration values corresponding to the bit mask.\n    \"\"\"\n    return [x for x in enumeration if (x.value & mask) == x.value]", "entry_point": "get_enumerations_from_bit_mask", "input": "set(), 'walnut thistle harbour'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1835-L1848", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037446", "code": "def _add_trits(left, right):\n    # type: (int, int) -> int\n    \"\"\"\n    Adds two individual trits together.\n\n    The result is always a single trit.\n    \"\"\"\n    res = left + right\n    return res if -2 < res < 2 else (res < 0) - (res > 0)", "entry_point": "_add_trits", "input": "False, True", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/iotaledger/iota.lib.py/blob/97cdd1e241498446b46157b79b2a1ea2ec6d387a/iota/trits.py#L102-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037447", "code": "def prime_field_inv(a: int, n: int) -> int:\n    \"\"\"\n    Extended euclidean algorithm to find modular inverses for integers\n    \"\"\"\n    if a == 0:\n        return 0\n    lm, hm = 1, 0\n    low, high = a % n, n\n    while low > 1:\n        r = high // low\n        nm, new = hm - lm * r, high - low * r\n        lm, low, hm, high = nm, new, lm, low\n    return lm % n", "entry_point": "prime_field_inv", "input": "0.5, 3", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ethereum/py_ecc/blob/2088796c59574b256dc8e18f8c9351bc3688ca71/py_ecc/utils.py#L21-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037448", "code": "def dict_repr_html(dictionary):\n    \"\"\"\n    Jupyter Notebook magic repr function.\n    \"\"\"\n    rows = ''\n    s = '<tr><td><strong>{k}</strong></td><td>{v}</td></tr>'\n    for k, v in dictionary.items():\n        rows += s.format(k=k, v=v)\n    html = '<table>{}</table>'.format(rows)\n    return html", "entry_point": "dict_repr_html", "input": "{}", "output": "'<table></table>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/agile-geoscience/striplog/blob/8033b673a151f96c29802b43763e863519a3124c/striplog/utils.py#L123-L132", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037449", "code": "def rgb_to_hex(rgb):\n    \"\"\"\n    Utility function to convert (r,g,b) triples to hex.\n    http://ageo.co/1CFxXpO\n    Args:\n      rgb (tuple): A sequence of RGB values in the\n        range 0-255 or 0-1.\n    Returns:\n      str: The hex code for the colour.\n    \"\"\"\n    r, g, b = rgb[:3]\n    if (r < 0) or (g < 0) or (b < 0):\n            raise Exception(\"RGB values must all be 0-255 or 0-1\")\n    if (r > 255) or (g > 255) or (b > 255):\n            raise Exception(\"RGB values must all be 0-255 or 0-1\")\n    if (0 < r < 1) or (0 < g < 1) or (0 < b < 1):\n        if (r > 1) or (g > 1) or (b > 1):\n            raise Exception(\"RGB values must all be 0-255 or 0-1\")\n    if (0 <= r <= 1) and (0 <= g <= 1) and (0 <= b <= 1):\n        rgb = tuple([int(round(val * 255)) for val in [r, g, b]])\n    else:\n        rgb = (int(r), int(g), int(b))\n    result = '#%02x%02x%02x' % rgb\n    return result.lower()", "entry_point": "rgb_to_hex", "input": "[1, 2, 3]", "output": "'#010203'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/agile-geoscience/striplog/blob/8033b673a151f96c29802b43763e863519a3124c/striplog/utils.py#L208-L231", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037450", "code": "def files_have_same_point_format_id(las_files):\n    \"\"\" Returns true if all the files have the same points format id\n    \"\"\"\n    point_format_found = {las.header.point_format_id for las in las_files}\n    return len(point_format_found) == 1", "entry_point": "files_have_same_point_format_id", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tmontaigu/pylas/blob/8335a1a7d7677f0e4bc391bb6fa3c75b42ed5b06/pylas/utils.py#L6-L10", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037451", "code": "def files_have_same_dtype(las_files):\n    \"\"\" Returns true if all the files have the same numpy datatype\n    \"\"\"\n    dtypes = {las.points.dtype for las in las_files}\n    return len(dtypes) == 1", "entry_point": "files_have_same_dtype", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tmontaigu/pylas/blob/8335a1a7d7677f0e4bc391bb6fa3c75b42ed5b06/pylas/utils.py#L13-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037452", "code": "def checksum(command):\n    \"\"\"Function to calculate checksum as per Satel manual.\"\"\"\n    crc = 0x147A\n    for b in command:\n        # rotate (crc 1 bit left)\n        crc = ((crc << 1) & 0xFFFF) | (crc & 0x8000) >> 15\n        crc = crc ^ 0xFFFF\n        crc = (crc + (crc >> 8) + b) & 0xFFFF\n    return crc", "entry_point": "checksum", "input": "[1, 2, 3]", "output": "24396", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/c-soft/satel_integra/blob/3b6d2020d1e10dc5aa40f30ee4ecc0f3a053eb3c/satel_integra/satel_integra.py#L12-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037453", "code": "def _get_arg(argname, args, kwargs):\n    \"\"\"\n    Get an argument, either from kwargs or from the first entry in args.\n    Raises a TypeError if argname not in kwargs and len(args) == 0.\n\n    Mutates kwargs in place if the value is found in kwargs.\n    \"\"\"\n    try:\n        return kwargs.pop(argname), args\n    except KeyError:\n        pass\n    try:\n        return args[0], args[1:]\n    except IndexError:\n        raise TypeError(\"No value passed for %s\" % argname)", "entry_point": "_get_arg", "input": "'Hello World', [-1, 0, 1, 2], {'x': [1, 2], 'y': []}", "output": "(-1, [0, 1, 2])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/quantopian/pgcontents/blob/ed36268b7917332d16868208e1e565742a8753e1/pgcontents/hybridmanager.py#L44-L58", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037454", "code": "def _separate_dirs_files(models):\n    \"\"\"\n    Split an iterable of models into a list of file paths and a list of\n    directory paths.\n    \"\"\"\n    dirs = []\n    files = []\n    for model in models:\n        if model['type'] == 'directory':\n            dirs.append(model['path'])\n        else:\n            files.append(model['path'])\n    return dirs, files", "entry_point": "_separate_dirs_files", "input": "{}", "output": "([], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/quantopian/pgcontents/blob/ed36268b7917332d16868208e1e565742a8753e1/pgcontents/utils/sync.py#L28-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037455", "code": "def get_filtered_dict(original_dict, whitelisted_keys):\n    \"\"\"Gets a dictionary filtered by whitelisted keys\n\n    :param original_dict: The original dictionary of arguments to source keys\n        and values.\n    :param whitelisted_key: A list of keys to include in the filtered\n        dictionary.\n\n    :returns: A dictionary containing key/values from the original dictionary\n        whose key was included in the whitelist\n    \"\"\"\n    filtered_dict = {}\n    for key, value in original_dict.items():\n        if key in whitelisted_keys:\n            filtered_dict[key] = value\n    return filtered_dict", "entry_point": "get_filtered_dict", "input": "{'x': [1, 2], 'y': []}, ['apple', 'banana', 'cherry']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/boto/s3transfer/blob/2aead638c8385d8ae0b1756b2de17e8fad45fffa/s3transfer/utils.py#L144-L159", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037456", "code": "def _join_translated(translated_parts, os_sep_class):\n    \"\"\"Join translated glob pattern parts.\n\n    This is different from a simple join, as care need to be taken\n    to allow ** to match ZERO or more directories.\n    \"\"\"\n    res = ''\n    for part in translated_parts[:-1]:\n        if part == '.*':\n            # drop separator, since it is optional\n            # (** matches ZERO or more dirs)\n            res += part\n        else:\n            res += part + os_sep_class\n\n    if translated_parts[-1] == '.*':\n        # Final part is **\n        res += '.+'\n        # Follow stdlib/git convention of matching all sub files/directories:\n        res += '({os_sep_class}?.*)?'.format(os_sep_class=os_sep_class)\n    else:\n        res += translated_parts[-1]\n    return res", "entry_point": "_join_translated", "input": "['apple', 'banana', 'cherry'], 'walnut thistle harbour'", "output": "'applewalnut thistle harbourbananawalnut thistle harbourcherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jupyter-widgets/jupyterlab-sidecar/blob/8889d09f1a0933e2cbee06d4874f720b075b29e8/setupbase.py#L643-L665", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037457", "code": "def validate_ppoi_tuple(value):\n    \"\"\"\n    Validates that a tuple (`value`)...\n    ...has a len of exactly 2\n    ...both values are floats/ints that are greater-than-or-equal-to 0\n       AND less-than-or-equal-to 1\n    \"\"\"\n    valid = True\n    while valid is True:\n        if len(value) == 2 and isinstance(value, tuple):\n            for x in value:\n                if x >= 0 and x <= 1:\n                    pass\n                else:\n                    valid = False\n            break\n        else:\n            valid = False\n    return valid", "entry_point": "validate_ppoi_tuple", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/respondcreate/django-versatileimagefield/blob/d41e279c39cccffafbe876c67596184704ae8877/versatileimagefield/validators.py#L14-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037458", "code": "def get_filtered_filename(filename, filename_key):\n    \"\"\"\n    Return the 'filtered filename' (according to `filename_key`)\n    in the following format:\n    `filename`__`filename_key`__.ext\n    \"\"\"\n    try:\n        image_name, ext = filename.rsplit('.', 1)\n    except ValueError:\n        image_name = filename\n        ext = 'jpg'\n    return \"%(image_name)s__%(filename_key)s__.%(ext)s\" % ({\n        'image_name': image_name,\n        'filename_key': filename_key,\n        'ext': ext\n    })", "entry_point": "get_filtered_filename", "input": "'Hello World', ''", "output": "'Hello World____.jpg'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/respondcreate/django-versatileimagefield/blob/d41e279c39cccffafbe876c67596184704ae8877/versatileimagefield/utils.py#L131-L146", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037459", "code": "def _compare_uids(uid1, uid2):\n        \"\"\"Calculate the minimum length of initial substrings of uid1 and uid2\n        for them to be different.\n\n        :param uid1: first uid to compare\n        :type uid1: str\n        :param uid2: second uid to compare\n        :type uid2: str\n        :returns: the length of the shortes unequal initial substrings\n        :rtype: int\n        \"\"\"\n        sum = 0\n        for char1, char2 in zip(uid1, uid2):\n            if char1 == char2:\n                sum += 1\n            else:\n                break\n        return sum", "entry_point": "_compare_uids", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/scheibler/khard/blob/0f69430c2680f1ff5f073a977a3c5b753b96cc17/khard/address_book.py#L59-L76", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037460", "code": "def _guess(kwargs):\n    \"\"\"\n    Adds types, actions, etc. to given argument specification.\n    For example, ``default=3`` implies ``type=int``.\n\n    :param arg: a :class:`argh.utils.Arg` instance\n    \"\"\"\n    guessed = {}\n\n    # Parser actions that accept argument 'type'\n    TYPE_AWARE_ACTIONS = 'store', 'append'\n\n    # guess type/action from default value\n    value = kwargs.get('default')\n    if value is not None:\n        if isinstance(value, bool):\n            if kwargs.get('action') is None:\n                # infer action from default value\n                guessed['action'] = 'store_false' if value else 'store_true'\n        elif kwargs.get('type') is None:\n            # infer type from default value\n            # (make sure that action handler supports this keyword)\n            if kwargs.get('action', 'store') in TYPE_AWARE_ACTIONS:\n                guessed['type'] = type(value)\n\n    # guess type from choices (first item)\n    if kwargs.get('choices') and 'type' not in list(guessed) + list(kwargs):\n        guessed['type'] = type(kwargs['choices'][0])\n\n    return dict(kwargs, **guessed)", "entry_point": "_guess", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/neithere/argh/blob/dcd3253f2994400a6a58a700c118c53765bc50a4/argh/assembling.py#L120-L149", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037461", "code": "def complete_token_filtered(aliases, prefix, expanded):\n    \"\"\"Find all starting matches in dictionary *aliases* that start\n     with *prefix*, but filter out any matches already in *expanded*\"\"\"\n\n    complete_ary = aliases.keys()\n    return [cmd for cmd in complete_ary if cmd.startswith(prefix)]", "entry_point": "complete_token_filtered", "input": "{}, False, ''", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python3-trepan/blob/14e91bc0acce090d67be145b1ac040cab92ac5f3/trepan/lib/complete.py#L61-L66", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037462", "code": "def count_frames(frame, count_start=0):\n    \"Return a count of the number of frames\"\n    count = -count_start\n    while frame:\n        count += 1\n        frame = frame.f_back\n    return count", "entry_point": "count_frames", "input": "[], 1", "output": "-1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/rocky/python3-trepan/blob/14e91bc0acce090d67be145b1ac040cab92ac5f3/trepan/lib/stack.py#L31-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037463", "code": "def normalize_dict(dict_):\n    \"\"\"\n    Replaces all values that are single-item iterables with the value of its\n    index 0.\n\n    :param dict dict_:\n        Dictionary to normalize.\n\n    :returns:\n        Normalized dictionary.\n\n    \"\"\"\n\n    return dict([(k, v[0] if not isinstance(v, str) and len(v) == 1 else v)\n                 for k, v in list(dict_.items())])", "entry_point": "normalize_dict", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/authomatic/authomatic/blob/90a9ce60cc405ae8a2bf5c3713acd5d78579a04e/authomatic/core.py#L40-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037464", "code": "def _http_status_in_category(status, category):\n        \"\"\"\n        Checks whether a HTTP status code is in the category denoted by the\n        hundreds digit.\n        \"\"\"\n\n        assert category < 10, 'HTTP status category must be a one-digit int!'\n        cat = category * 100\n        return status >= cat and status < cat + 100", "entry_point": "_http_status_in_category", "input": "1, 0.5", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/authomatic/authomatic/blob/90a9ce60cc405ae8a2bf5c3713acd5d78579a04e/authomatic/providers/__init__.py#L533-L541", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037465", "code": "def _homogeneity_filter(ls, window_size):\n    \"\"\"\n    Takes `ls` (a list of 1s and 0s) and smoothes it so that adjacent values are more likely\n    to be the same.\n\n    :param ls:          A list of 1s and 0s to smooth.\n    :param window_size: How large the smoothing kernel is.\n    :returns:           A list of 1s and 0s, but smoother.\n    \"\"\"\n    # TODO: This is fine way to do this, but it seems like it might be faster and better to do a Gaussian convolution followed by rounding\n    k = window_size\n    i = k\n    while i <= len(ls) - k:\n        # Get a window of k items\n        window = [ls[i + j] for j in range(k)]\n        # Change the items in the window to be more like the mode of that window\n        mode = 1 if sum(window) >= k / 2 else 0\n        for j in range(k):\n            ls[i+j] = mode\n        i += k\n    return ls", "entry_point": "_homogeneity_filter", "input": "['apple', 'banana', 'cherry'], 5", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/MaxStrange/AudioSegment/blob/1daefb8de626ddff3ff7016697c3ad31d262ecd6/algorithms/eventdetection.py#L69-L89", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037466", "code": "def isPow2(num) -> bool:\n    \"\"\"\n    Check if number or constant is power of two\n    \"\"\"\n    if not isinstance(num, int):\n        num = int(num)\n    return num != 0 and ((num & (num - 1)) == 0)", "entry_point": "isPow2", "input": "3", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Nic30/hwt/blob/8cbb399e326da3b22c233b98188a9d08dec057e6/hwt/code.py#L383-L389", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037467", "code": "def format_container_name(name, special_characters=None):\n    '''format_container_name will take a name supplied by the user,\n    remove all special characters (except for those defined by \"special-characters\"\n    and return the new image name.\n    '''\n    if special_characters is None:\n        special_characters = []\n    return ''.join(e.lower()\n                   for e in name if e.isalnum() or e in special_characters)", "entry_point": "format_container_name", "input": "'', [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/sregistry-cli/blob/abc96140a1d15b5e96d83432e1e0e1f4f8f36331/sregistry/utils/names.py#L183-L191", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037468", "code": "def prepare_metadata(metadata):\n    '''prepare a key/value list of metadata for the request. The metadata\n       object that comes in is only parsed one level.\n    '''\n    pairs = {\n        'metadata': {\n            'items': [{\n                'key': 'client',\n                'value': 'sregistry'\n            }\n           ]\n        }\n    }\n    for key,val in metadata.items():\n        if not isinstance(val,dict) and not isinstance(val,list):\n            pairs['metadata']['items'].append({'key':key,'value':val})\n        elif isinstance(val,dict):            \n            for k,v in val.items():\n                if not isinstance(v,dict) and not isinstance(v,list):\n                    pairs['metadata']['items'].append({'key':k,'value':v})\n\n    return pairs", "entry_point": "prepare_metadata", "input": "{'x': [1, 2], 'y': []}", "output": "{'metadata': {'items': [{'key': 'client', 'value': 'sregistry'}]}}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/singularityhub/sregistry-cli/blob/abc96140a1d15b5e96d83432e1e0e1f4f8f36331/sregistry/main/google_storage/utils.py#L16-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037469", "code": "def _get_gc_content(sequence, length):\n        \"\"\"Get GC content and proportions.\n\n        Parameters\n        ----------\n        sequence : str\n            The complete sequence of the contig.\n        length : int\n            The length of the sequence contig.\n\n        Returns\n        -------\n        x : dict\n            Dictionary with the at/gc/n counts and proportions\n\n        \"\"\"\n\n        # Get AT/GC/N counts\n        at = sum(map(sequence.count, [\"A\", \"T\"]))\n        gc = sum(map(sequence.count, [\"G\", \"C\"]))\n        n = length - (at + gc)\n\n        # Get AT/GC/N proportions\n        at_prop = at / length\n        gc_prop = gc / length\n        n_prop = n / length\n\n        return {\"at\": at, \"gc\": gc, \"n\": n,\n                \"at_prop\": at_prop, \"gc_prop\": gc_prop, \"n_prop\": n_prop}", "entry_point": "_get_gc_content", "input": "[5, 3, 1, 4], 2", "output": "{'at': 0, 'gc': 0, 'n': 2, 'at_prop': 0.0, 'gc_prop': 0.0, 'n_prop': 1.0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/templates/process_viral_assembly.py#L281-L309", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037470", "code": "def remove_unique_identifiers(identifiers_to_tags, pipeline_links):\n    \"\"\"Removes unique identifiers and add the original process names to the\n    already parsed pipelines\n\n    Parameters\n    ----------\n    identifiers_to_tags : dict\n        Match between unique process identifiers and process names\n    pipeline_links: list\n        Parsed pipeline list with unique identifiers\n\n    Returns\n    -------\n    list\n        Pipeline list with original identifiers\n    \"\"\"\n\n    # Replaces the unique identifiers by the original process names\n    for index, val in enumerate(pipeline_links):\n        if val[\"input\"][\"process\"] != \"__init__\":\n            val[\"input\"][\"process\"] = identifiers_to_tags[\n                val[\"input\"][\"process\"]]\n        if val[\"output\"][\"process\"] != \"__init__\":\n            val[\"output\"][\"process\"] = identifiers_to_tags[\n                val[\"output\"][\"process\"]]\n\n    return pipeline_links", "entry_point": "remove_unique_identifiers", "input": "['apple', 'banana', 'cherry'], ''", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/generator/pipeline_parser.py#L730-L756", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037471", "code": "def _header_mapping(header):\n        \"\"\"Parses the trace file header and retrieves the positions of each\n        column key.\n\n        Parameters\n        ----------\n        header : str\n            The header line of nextflow's trace file\n\n        Returns\n        -------\n        dict\n            Mapping the column ID to its position (e.g.: {\"tag\":2})\n        \"\"\"\n\n        return dict(\n            (x.strip(), pos) for pos, x in enumerate(header.split(\"\\t\"))\n        )", "entry_point": "_header_mapping", "input": "'Hello World'", "output": "{'Hello World': 0}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/generator/inspect.py#L281-L298", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037472", "code": "def _gc_prop(s, length):\n        \"\"\"Get proportion of GC from a string\n\n        Parameters\n        ----------\n        s : str\n            Arbitrary string\n\n        Returns\n        -------\n        x : float\n            GC proportion.\n        \"\"\"\n\n        gc = sum(map(s.count, [\"c\", \"g\"]))\n\n        return gc / length", "entry_point": "_gc_prop", "input": "['apple', 'banana', 'cherry'], 3", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/templates/assembly_report.py#L318-L334", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037473", "code": "def get_trim_index(biased_list):\n    \"\"\"Returns the trim index from a ``bool`` list\n\n    Provided with a list of ``bool`` elements (``[False, False, True, True]``),\n    this function will assess the index of the list that minimizes the number\n    of True elements (biased positions) at the extremities. To do so,\n    it will iterate over the boolean list and find an index position where\n    there are two consecutive ``False`` elements after a ``True`` element. This\n    will be considered as an optimal trim position. For example, in the\n    following list::\n\n        [True, True, False, True, True, False, False, False, False, ...]\n\n    The optimal trim index will be the 4th position, since it is the first\n    occurrence of a ``True`` element with two False elements after it.\n\n    If the provided ``bool`` list has no ``True`` elements, then the 0 index is\n    returned.\n\n    Parameters\n    ----------\n    biased_list: list\n        List of ``bool`` elements, where ``True`` means a biased site.\n\n    Returns\n    -------\n        x : index position of the biased list for the optimal trim.\n\n    \"\"\"\n\n    # Return index 0 if there are no biased positions\n    if set(biased_list) == {False}:\n        return 0\n\n    if set(biased_list[:5]) == {False}:\n        return 0\n\n    # Iterate over the biased_list array. Keep the iteration going until\n    # we find a biased position with the two following positions unbiased\n    # (e.g.: True, False, False).\n    # When this condition is verified, return the last biased position\n    # index for subsequent trimming.\n    for i, val in enumerate(biased_list):\n        if val and set(biased_list[i+1:i+3]) == {False}:\n            return i + 1\n\n    # If the previous iteration could not find and index to trim, it means\n    # that the whole list is basically biased. Return the length of the\n    # biased_list\n    return len(biased_list)", "entry_point": "get_trim_index", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/templates/fastqc_report.py#L192-L241", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037474", "code": "def _get_resources_string(res_dict, pid):\n        \"\"\" Returns the nextflow resources string from a dictionary object\n\n        If the dictionary has at least on of the resource directives, these\n        will be compiled for each process in the dictionary and returned\n        as a string read for injection in the nextflow config file template.\n\n        This dictionary should be::\n\n            dict = {\"processA\": {\"cpus\": 1, \"memory\": \"4GB\"},\n                    \"processB\": {\"cpus\": 2}}\n\n        Parameters\n        ----------\n        res_dict : dict\n            Dictionary with the resources for processes.\n        pid : int\n            Unique identified of the process\n\n        Returns\n        -------\n        str\n            nextflow config string\n        \"\"\"\n\n        config_str = \"\"\n        ignore_directives = [\"container\", \"version\"]\n\n        for p, directives in res_dict.items():\n\n            for d, val in directives.items():\n\n                if d in ignore_directives:\n                    continue\n\n                config_str += '\\n\\t${}_{}.{} = {}'.format(p, pid, d, val)\n\n        return config_str", "entry_point": "_get_resources_string", "input": "{}, ['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/generator/engine.py#L944-L981", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037475", "code": "def _get_container_string(cont_dict, pid):\n        \"\"\" Returns the nextflow containers string from a dictionary object\n\n        If the dictionary has at least on of the container directives, these\n        will be compiled for each process in the dictionary and returned\n        as a string read for injection in the nextflow config file template.\n\n        This dictionary should be::\n\n            dict = {\"processA\": {\"container\": \"asd\", \"version\": \"1.0.0\"},\n                    \"processB\": {\"container\": \"dsd\"}}\n\n        Parameters\n        ----------\n        cont_dict : dict\n            Dictionary with the containers for processes.\n        pid : int\n            Unique identified of the process\n\n        Returns\n        -------\n        str\n            nextflow config string\n        \"\"\"\n\n        config_str = \"\"\n\n        for p, directives in cont_dict.items():\n\n            container = \"\"\n\n            if \"container\" in directives:\n                container += directives[\"container\"]\n\n                if \"version\" in directives:\n                    container += \":{}\".format(directives[\"version\"])\n                else:\n                    container += \":latest\"\n\n            if container:\n                config_str += '\\n\\t${}_{}.container = \"{}\"'.format(p, pid, container)\n\n        return config_str", "entry_point": "_get_container_string", "input": "{}, []", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/assemblerflow/flowcraft/blob/fc3f4bddded1efc76006600016dc71a06dd908c0/flowcraft/generator/engine.py#L984-L1026", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037476", "code": "def accumulator(init, update):\n    \"\"\"\n    Generic accumulator function.\n\n    .. code-block:: python\n\n        # Simplest Form\n        >>> a = 'this' + ' '\n        >>> b = 'that'\n        >>> c = functools.reduce(accumulator, a, b)\n        >>> c\n        'this that'\n\n        # The type of the initial value determines output type.\n        >>> a = 5\n        >>> b = Hello\n        >>> c = functools.reduce(accumulator, a, b)\n        >>> c\n        10\n\n    :param init:  Initial Value\n    :param update: Value to accumulate\n\n    :return: Combined Values\n    \"\"\"\n    return (\n        init + len(update)\n            if isinstance(init, int) else\n        init + update\n    )", "entry_point": "accumulator", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2, -1, 0, 1, 2]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jjangsangy/py-translate/blob/fe6279b2ee353f42ce73333ffae104e646311956/translate/coroutines.py#L62-L91", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037477", "code": "def isregex_expr(expr):\n    \"\"\"\n    Returns ``True`` is the given expression value is a regular expression\n    like string with prefix ``re/`` and suffix ``/``, otherwise ``False``.\n\n    Arguments:\n        expr (mixed): expression value to test.\n\n    Returns:\n        bool\n    \"\"\"\n    if not isinstance(expr, str):\n        return False\n\n    return all([\n        len(expr) > 3,\n        expr.startswith('re/'),\n        expr.endswith('/')\n    ])", "entry_point": "isregex_expr", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/h2non/pook/blob/e64094e41e4d89d98d2d29af7608ef27dc50cf19/pook/regex.py#L7-L25", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037478", "code": "def _mediawiki_cell_attrs(row, colaligns):\n    \"Prefix every cell in a row with an HTML alignment attribute.\"\n    alignment = {\"left\": '',\n                 \"right\": 'align=\"right\"| ',\n                 \"center\": 'align=\"center\"| ',\n                 \"decimal\": 'align=\"right\"| '}\n    row2 = [alignment[a] + c for c, a in zip(row, colaligns)]\n    return row2", "entry_point": "_mediawiki_cell_attrs", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/solvebio/solvebio-python/blob/b29614643043afd19c1d8074e8f25c6700d51a73/solvebio/utils/tabulate.py#L498-L505", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037479", "code": "def filter_dict_by_key(d, keys):\n    \"\"\"Filter the dict *d* to remove keys not in *keys*.\"\"\"\n    return {k: v for k, v in d.items() if k in keys}", "entry_point": "filter_dict_by_key", "input": "{}, [1, 2, 3]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/dbcli/cli_helpers/blob/3ebd891ac0c02bad061182dbcb54a47fb21980ae/cli_helpers/utils.py#L45-L47", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037480", "code": "def unique_items(seq):\n    \"\"\"Return the unique items from iterable *seq* (in order).\"\"\"\n    seen = set()\n    return [x for x in seq if not (x in seen or seen.add(x))]", "entry_point": "unique_items", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/dbcli/cli_helpers/blob/3ebd891ac0c02bad061182dbcb54a47fb21980ae/cli_helpers/utils.py#L50-L53", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037481", "code": "def replace(s, replace):\n    \"\"\"Replace multiple values in a string\"\"\"\n    for r in replace:\n        s = s.replace(*r)\n    return s", "entry_point": "replace", "input": "['apple', 'banana', 'cherry'], []", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/dbcli/cli_helpers/blob/3ebd891ac0c02bad061182dbcb54a47fb21980ae/cli_helpers/utils.py#L64-L68", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037482", "code": "def _format_row(headers, row):\n    \"\"\"Format a row.\"\"\"\n    formatted_row = [' | '.join(field) for field in zip(headers, row)]\n    return '\\n'.join(formatted_row)", "entry_point": "_format_row", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "'a | apple\\nb | banana\\nc | cherry'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/dbcli/cli_helpers/blob/3ebd891ac0c02bad061182dbcb54a47fb21980ae/cli_helpers/tabular_output/vertical_table_adapter.py#L27-L30", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037483", "code": "def genes_by_alias(hgnc_genes):\n    \"\"\"Return a dictionary with hgnc symbols as keys\n\n    Value of the dictionaries are information about the hgnc ids for a symbol.\n    If the symbol is primary for a gene then 'true_id' will exist.\n    A list of hgnc ids that the symbol points to is in ids.\n\n    Args:\n        hgnc_genes(dict): a dictionary with hgnc_id as key and gene info as value\n\n    Returns:\n        alias_genes(dict):\n            {\n                'hgnc_symbol':{\n                    'true_id': int,\n                    'ids': list(int)\n                    }\n            }\n    \"\"\"\n    alias_genes = {}\n    for hgnc_id in hgnc_genes:\n        gene = hgnc_genes[hgnc_id]\n        # This is the primary symbol:\n        hgnc_symbol = gene['hgnc_symbol']\n\n        for alias in gene['previous_symbols']:\n            true_id = None\n            if alias == hgnc_symbol:\n                true_id = hgnc_id\n            if alias in alias_genes:\n                alias_genes[alias.upper()]['ids'].add(hgnc_id)\n                if true_id:\n                    alias_genes[alias.upper()]['true_id'] = hgnc_id\n            else:\n                alias_genes[alias.upper()] = {\n                    'true': true_id,\n                    'ids': set([hgnc_id])\n                }\n\n    return alias_genes", "entry_point": "genes_by_alias", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/utils/link.py#L18-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037484", "code": "def get_correct_ids(hgnc_symbol, alias_genes):\n    \"\"\"Try to get the correct gene based on hgnc_symbol\n    \n    The HGNC symbol is unfortunately not a persistent gene identifier.\n    Many of the resources that are used by Scout only provides the hgnc symbol to \n    identify a gene. We need a way to guess what gene is pointed at.\n    \n    Args:\n        hgnc_symbol(str): The symbol used by a resource\n        alias_genes(dict): A dictionary with all the alias symbols (including the current symbol)\n                           for all genes\n    \n    Returns:\n        hgnc_ids(iterable(int)): Hopefully only one but a symbol could map to several ids\n    \"\"\"\n    hgnc_ids = set()\n    hgnc_symbol = hgnc_symbol.upper()\n    if hgnc_symbol in alias_genes:\n        hgnc_id_info = alias_genes[hgnc_symbol]\n        if hgnc_id_info['true']:\n            return set([hgnc_id_info['true']])\n        else:\n            return set(hgnc_id_info['ids'])\n    return hgnc_ids", "entry_point": "get_correct_ids", "input": "'walnut thistle harbour', {'x': [1, 2], 'y': []}", "output": "set()", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/utils/link.py#L144-L167", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037485", "code": "def get_predictions(genes):\n    \"\"\"Get sift predictions from genes.\"\"\"\n    data = {\n        'sift_predictions': [],\n        'polyphen_predictions': [],\n        'region_annotations': [],\n        'functional_annotations': []\n    }\n    for gene_obj in genes:\n        for pred_key in data:\n            gene_key = pred_key[:-1]\n            if len(genes) == 1:\n                value = gene_obj.get(gene_key, '-')\n            else:\n                gene_id = gene_obj.get('hgnc_symbol') or str(gene_obj['hgnc_id'])\n                value = ':'.join([gene_id, gene_obj.get(gene_key, '-')])\n            data[pred_key].append(value)\n\n    return data", "entry_point": "get_predictions", "input": "{}", "output": "{'sift_predictions': [], 'polyphen_predictions': [], 'region_annotations': [], 'functional_annotations': []}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/variants/controllers.py#L400-L418", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037486", "code": "def frequency(variant_obj):\n    \"\"\"Returns a judgement on the overall frequency of the variant.\n\n    Combines multiple metrics into a single call.\n    \"\"\"\n    most_common_frequency = max(variant_obj.get('thousand_genomes_frequency') or 0,\n                                variant_obj.get('exac_frequency') or 0)\n    if most_common_frequency > .05:\n        return 'common'\n    elif most_common_frequency > .01:\n        return 'uncommon'\n    else:\n        return 'rare'", "entry_point": "frequency", "input": "{}", "output": "'rare'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/variants/controllers.py#L707-L719", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037487", "code": "def get_net(req):\n    \"\"\"Get the net of any 'next' and 'prev' querystrings.\"\"\"\n    try:\n        nxt, prev = map(\n            int, (req.GET.get('cal_next', 0), req.GET.get('cal_prev', 0))\n        )\n        net = nxt - prev\n    except Exception:\n        net = 0\n    return net", "entry_point": "get_net", "input": "[5, 3, 1, 4]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/common.py#L48-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037488", "code": "def order_events(events, d=False):\n    \"\"\"\n    Group events that occur on the same day, then sort them alphabetically\n    by title, then sort by day. Returns a list of tuples that looks like\n    [(day: [events])], where day is the day of the event(s), and [events]\n    is an alphabetically sorted list of the events for the day.\n    \"\"\"\n    ordered_events = {}\n    for event in events:\n        try:\n            for occ in event.occurrence:\n                try:\n                    ordered_events[occ].append(event)\n                except Exception:\n                    ordered_events[occ] = [event]\n        except AttributeError:  # no occurrence for this event\n            # This shouldn't happen, since an event w/o an occurrence\n            # shouldn't get this far, but if it does, just skip it since\n            # it shouldn't be displayed on the calendar anyway.\n            pass\n\n    if d:\n        # return as a dict without sorting by date\n        return ordered_events\n    else:\n        # return ordered_events as a list tuples sorted by date\n        return sorted(ordered_events.items())", "entry_point": "order_events", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/common.py#L73-L99", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037489", "code": "def get_next_and_prev(net):\n    \"\"\"Returns what the next and prev querystrings should be.\"\"\"\n    if net == 0:\n        nxt = prev = 1\n    elif net > 0:\n        nxt = net + 1\n        prev = -(net - 1)\n    else:\n        nxt = net + 1\n        prev = abs(net) + 1\n    return nxt, prev", "entry_point": "get_next_and_prev", "input": "True", "output": "(2, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/common.py#L102-L112", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037490", "code": "def is_likely_benign(bs_terms, bp_terms):\n    \"\"\"Check if criterias for Likely Benign are fullfilled\n\n    The following are descriptions of Likely Benign clasification from ACMG paper:\n\n    Likely Benign\n      (i) 1 Strong (BS1\u2013BS4) and 1 supporting (BP1\u2013 BP7) OR\n      (ii) \u22652 Supporting (BP1\u2013BP7)\n\n    Args:\n        bs_terms(list(str)): Terms that indicate strong evidence for benign variant\n        bp_terms(list(str)): Terms that indicate supporting evidence for benign variant\n\n    Returns:\n        bool: if classification indicates Benign level\n    \"\"\"\n    if bs_terms:\n        # Likely Benign (i)\n        if bp_terms:\n            return True\n    # Likely Benign (ii)\n    if len(bp_terms) >= 2:\n        return True\n\n    return False", "entry_point": "is_likely_benign", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/utils/acmg.py#L130-L154", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037491", "code": "def parse_genetic_models(models_info, case_id):\n    \"\"\"Parse the genetic models entry of a vcf\n\n    Args:\n        models_info(str): The raw vcf information\n        case_id(str)\n\n    Returns:\n        genetic_models(list)\n\n    \"\"\"\n    genetic_models = []\n    if models_info:\n        for family_info in models_info.split(','):\n            splitted_info = family_info.split(':')\n            if splitted_info[0] == case_id:\n                genetic_models = splitted_info[1].split('|')\n\n    return genetic_models", "entry_point": "parse_genetic_models", "input": "[], []", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/models.py#L2-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037492", "code": "def parse_hpo_gene(hpo_line):\n    \"\"\"Parse hpo gene information\n    \n        Args:\n            hpo_line(str): A iterable with hpo phenotype lines\n    \n        Yields:\n            hpo_info(dict)\n    \"\"\"\n    if not len(hpo_line) > 3:\n        return {}\n    hpo_line = hpo_line.rstrip().split('\\t')\n    hpo_info = {}\n    hpo_info['hgnc_symbol'] = hpo_line[1]\n    hpo_info['description'] = hpo_line[2]\n    hpo_info['hpo_id'] = hpo_line[3]\n    \n    return hpo_info", "entry_point": "parse_hpo_gene", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/hpo.py#L23-L40", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037493", "code": "def parse_ensembl_line(line, header):\n    \"\"\"Parse an ensembl formated line\n\n        Args:\n            line(list): A list with ensembl gene info\n            header(list): A list with the header info\n\n        Returns:\n            ensembl_info(dict): A dictionary with the relevant info\n    \"\"\"\n    line = line.rstrip().split('\\t')\n    header = [head.lower() for head in header]\n    raw_info = dict(zip(header, line))\n\n    ensembl_info = {}\n\n    for word in raw_info:\n        value = raw_info[word]\n\n        if not value:\n            continue\n\n        if 'chromosome' in word:\n            ensembl_info['chrom'] = value\n\n        if 'gene' in word:\n            if 'id' in word:\n                ensembl_info['ensembl_gene_id'] = value\n            elif 'start' in word:\n                ensembl_info['gene_start'] = int(value)\n            elif 'end' in word:\n                ensembl_info['gene_end'] = int(value)\n\n        if 'hgnc symbol' in word:\n            ensembl_info['hgnc_symbol'] = value\n        if \"gene name\" in word:\n            ensembl_info['hgnc_symbol'] = value\n\n        if 'hgnc id' in word:\n            ensembl_info['hgnc_id'] = int(value.split(':')[-1])\n\n        if 'transcript' in word:\n            if 'id' in word:\n                ensembl_info['ensembl_transcript_id'] = value\n            elif 'start' in word:\n                ensembl_info['transcript_start'] = int(value)\n            elif 'end' in word:\n                ensembl_info['transcript_end'] = int(value)\n\n        if 'exon' in word:\n            if 'start' in word:\n                ensembl_info['exon_start'] = int(value)\n            elif 'end' in word:\n                ensembl_info['exon_end'] = int(value)\n            elif 'rank' in word:\n                ensembl_info['exon_rank'] = int(value)\n\n        if 'utr' in word:\n\n            if 'start' in word:\n                if '5' in word:\n                    ensembl_info['utr_5_start'] = int(value)\n                elif '3' in word:\n                    ensembl_info['utr_3_start'] = int(value)\n            elif 'end' in word:\n                if '5' in word:\n                    ensembl_info['utr_5_end'] = int(value)\n                elif '3' in word:\n                    ensembl_info['utr_3_end'] = int(value)\n\n        if 'strand' in word:\n            ensembl_info['strand'] = int(value)\n\n        if 'refseq' in word:\n            if 'mrna' in word:\n                if 'predicted' in word:\n                    ensembl_info['refseq_mrna_predicted'] = value\n                else:\n                    ensembl_info['refseq_mrna'] = value\n\n            if 'ncrna' in word:\n                ensembl_info['refseq_ncrna'] = value\n\n    return ensembl_info", "entry_point": "parse_ensembl_line", "input": "'  padded  ', ['a', 'b', 'c']", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L145-L228", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037494", "code": "def parse_omim_line(line, header):\n    \"\"\"docstring for parse_omim_2_line\"\"\"\n    omim_info = dict(zip(header, line.split('\\t')))\n    return omim_info", "entry_point": "parse_omim_line", "input": "'walnut thistle harbour', []", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L38-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037495", "code": "def tokenize_line(line):\n    \"\"\"\n    Tokenize a line:\n    * split tokens on whitespace\n    * treat quoted strings as a single token\n    * drop comments\n    * handle escaped spaces and comment delimiters\n    \"\"\"\n    ret = []\n    escape = False\n    quote = False\n    tokbuf = \"\"\n    ll = list(line)\n    while len(ll) > 0:\n        c = ll.pop(0)\n        if c.isspace():\n            if not quote and not escape:\n                # end of token\n                if len(tokbuf) > 0:\n                    ret.append(tokbuf)\n\n                tokbuf = \"\"\n            elif quote:\n                # in quotes\n                tokbuf += c\n            elif escape:\n                # escaped space\n                tokbuf += c\n                escape = False\n            else:\n                tokbuf = \"\"\n\n            continue\n\n        if c == '\\\\':\n            escape = True\n            continue\n        elif c == '\"':\n            if not escape:\n                if quote:\n                    # end of quote\n                    ret.append(tokbuf)\n                    tokbuf = \"\"\n                    quote = False\n                    continue\n                else:\n                    # beginning of quote\n                    quote = True\n                    continue\n        elif c == ';':\n            if not escape:\n                # comment \n                ret.append(tokbuf)\n                tokbuf = \"\"\n                break\n            \n        # normal character\n        tokbuf += c\n        escape = False\n\n    if len(tokbuf.strip(\" \").strip(\"\\n\")) > 0:\n        ret.append(tokbuf)\n\n    return ret", "entry_point": "tokenize_line", "input": "'walnut thistle harbour'", "output": "['walnut', 'thistle', 'harbour']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/zone-file-py/blob/c1078c8c3c28f0881bc9a3af53d4972c4a6862d0/blockstack_zones/parse_zone_file.py#L97-L160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037496", "code": "def serialize(tokens):\n    \"\"\"\n    Serialize tokens:\n    * quote whitespace-containing tokens\n    * escape semicolons\n    \"\"\"\n    ret = []\n    for tok in tokens:\n        if \" \" in tok:\n            tok = '\"%s\"' % tok\n\n        if \";\" in tok:\n            tok = tok.replace(\";\", \"\\;\")\n\n        ret.append(tok)\n\n    return \" \".join(ret)", "entry_point": "serialize", "input": "['a', 'b', 'c']", "output": "'a b c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/zone-file-py/blob/c1078c8c3c28f0881bc9a3af53d4972c4a6862d0/blockstack_zones/parse_zone_file.py#L163-L179", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037497", "code": "def process_origin(data, template):\n    \"\"\"\n    Replace {$origin} in template with a serialized $ORIGIN record\n    \"\"\"\n    record = \"\"\n    if data is not None:\n        record += \"$ORIGIN %s\" % data\n\n    return template.replace(\"{$origin}\", record)", "entry_point": "process_origin", "input": "[1, 2, 3], 'a,b,c'", "output": "'a,b,c'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/blockstack/zone-file-py/blob/c1078c8c3c28f0881bc9a3af53d4972c4a6862d0/blockstack_zones/record_processors.py#L4-L12", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037498", "code": "def blocking(indices, block_size, initial_boundary=0):\n    \"\"\"\n    Split list of integers into blocks of block_size and return block indices.\n\n    First block element will be located at initial_boundary (default 0).\n\n    >>> blocking([0, -1, -2, -3, -4, -5, -6, -7, -8, -9], 8)\n    [0,-1]\n    >>> blocking([0], 8)\n    [0]\n    >>> blocking([0], 8, initial_boundary=32)\n    [-4]\n    \"\"\"\n    blocks = []\n\n    for idx in indices:\n        bl_idx = (idx-initial_boundary)//float(block_size)\n        if bl_idx not in blocks:\n            blocks.append(bl_idx)\n    blocks.sort()\n\n    return blocks", "entry_point": "blocking", "input": "{}, True, True", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L28-L49", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037499", "code": "def strip_and_uncomment(asm_lines):\n    \"\"\"Strip whitespaces and comments from asm lines.\"\"\"\n    asm_stripped = []\n    for line in asm_lines:\n        # Strip comments and whitespaces\n        asm_stripped.append(line.split('#')[0].strip())\n    return asm_stripped", "entry_point": "strip_and_uncomment", "input": "'Hello World'", "output": "['H', 'e', 'l', 'l', 'o', '', 'W', 'o', 'r', 'l', 'd']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L31-L37", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037500", "code": "def prefix_indent(prefix, textblock, later_prefix=' '):\n    \"\"\"\n    Prefix and indent all lines in *textblock*.\n\n    *prefix* is a prefix string\n    *later_prefix* is used on all but the first line, if it is a single character\n                   it will be repeated to match length of *prefix*\n    \"\"\"\n    textblock = textblock.split('\\n')\n    line = prefix + textblock[0] + '\\n'\n    if len(later_prefix) == 1:\n        later_prefix = ' '*len(prefix)\n    line = line + '\\n'.join([later_prefix + x for x in textblock[1:]])\n    if line[-1] != '\\n':\n        return line + '\\n'\n    else:\n        return line", "entry_point": "prefix_indent", "input": "'Hello World', 'AbC dEf', 'AbC dEf'", "output": "'Hello WorldAbC dEf\\n'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/kernel.py#L43-L59", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037501", "code": "def get_config_params(properties):\n    '''Extract the set of configuration parameters from the properties attached\n    to the schedule\n    '''\n    param = []\n    wdef = ''\n    for prop in properties.split('\\n'):\n        if prop.startswith('org.opencastproject.workflow.config'):\n            key, val = prop.split('=', 1)\n            key = key.split('.')[-1]\n            param.append((key, val))\n        elif prop.startswith('org.opencastproject.workflow.definition'):\n            wdef = prop.split('=', 1)[-1]\n    return wdef, param", "entry_point": "get_config_params", "input": "'AbC dEf'", "output": "('', [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/opencast/pyCA/blob/c89b168d4780d157e1b3f7676628c1b131956a88/pyca/ingest.py#L26-L39", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037502", "code": "def headers_to_dict(headers):\n    \"\"\"\n    Converts a sequence of (name, value) tuples into a dict where if\n    a given name occurs more than once its value in the dict will be\n    a list of values.\n    \"\"\"\n    hdrs = {}\n    for h, v in headers:\n        h = h.lower()\n        if h in hdrs:\n            if isinstance(hdrs[h], list):\n                hdrs[h].append(v)\n            else:\n                hdrs[h] = [hdrs[h], v]\n        else:\n            hdrs[h] = v\n    return hdrs", "entry_point": "headers_to_dict", "input": "set()", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/gholt/swiftly/blob/5bcc1c65323b1caf1f85adbefd9fc4988c072149/swiftly/client/utils.py#L70-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037503", "code": "def nest_dictionary(flat_dict, separator):\n    \"\"\" Nests a given flat dictionary.\n\n    Nested keys are created by splitting given keys around the `separator`.\n\n    \"\"\"\n    nested_dict = {}\n    for key, val in flat_dict.items():\n        split_key = key.split(separator)\n        act_dict = nested_dict\n        final_key = split_key.pop()\n        for new_key in split_key:\n            if not new_key in act_dict:\n                act_dict[new_key] = {}\n\n            act_dict = act_dict[new_key]\n\n        act_dict[final_key] = val\n    return nested_dict", "entry_point": "nest_dictionary", "input": "{'a': 1, 'b': 2}, '  padded  '", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/helpful_functions.py#L46-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037504", "code": "def result_sort(result_list, start_index=0):\n    \"\"\"Sorts a list of results in O(n) in place (since every run is unique)\n\n    :param result_list: List of tuples [(run_idx, res), ...]\n    :param start_index: Index with which to start, every entry before `start_index` is ignored\n\n    \"\"\"\n    if len(result_list) < 2:\n        return result_list\n    to_sort = result_list[start_index:]\n    minmax = [x[0] for x in to_sort]\n    minimum = min(minmax)\n    maximum = max(minmax)\n    #print minimum, maximum\n    sorted_list = [None for _ in range(minimum, maximum + 1)]\n    for elem in to_sort:\n        key = elem[0] - minimum\n        sorted_list[key] = elem\n    idx_count = start_index\n    for elem in sorted_list:\n        if elem is not None:\n            result_list[idx_count] = elem\n            idx_count += 1\n    return result_list", "entry_point": "result_sort", "input": "[], 7", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/helpful_functions.py#L288-L311", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037505", "code": "def _trj_read_out_row(colnames, row):\n        \"\"\"Reads out a row and returns a dictionary containing the row content.\n\n        :param colnames: List of column names\n        :param row:  A pytables table row\n        :return: A dictionary with colnames as keys and content as values\n\n        \"\"\"\n        result_dict = {}\n        for colname in colnames:\n            result_dict[colname] = row[colname]\n\n        return result_dict", "entry_point": "_trj_read_out_row", "input": "'', [5, 3, 1, 4]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1642-L1654", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037506", "code": "def _all_cut_string(string, max_length, logger):\n        \"\"\"Cuts string data to the maximum length allowed in a pytables column\n        if string is too long.\n\n        :param string: String to be cut\n        :param max_length: Maximum allowed string length\n        :param logger: Logger where messages about truncating should be written\n\n        :return: String, cut if too long\n\n        \"\"\"\n        if len(string) > max_length:\n            logger.debug('The string `%s` was too long I truncated it to'\n                         ' %d characters' %\n                         (string, max_length))\n            string = string[0:max_length - 3] + '...'.encode('utf-8')\n\n        return string", "entry_point": "_all_cut_string", "input": "'', 0, [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3417-L3434", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037507", "code": "def _return_item_dictionary(param_dict, fast_access, copy):\n        \"\"\"Returns a dictionary containing either all parameters, all explored parameters,\n        all config, all derived parameters, or all results.\n\n        :param param_dict: The dictionary which is about to be returned\n        :param fast_access: Whether to use fast access\n        :param copy: If the original dict should be returned or a shallow copy\n\n        :return: The dictionary\n\n        :raises: ValueError if `copy=False` and fast_access=True`\n\n        \"\"\"\n\n        if not copy and fast_access:\n            raise ValueError('You cannot access the original dictionary and use fast access at the'\n                             ' same time!')\n        if not fast_access:\n            if copy:\n                return param_dict.copy()\n            else:\n                return param_dict\n        else:\n            resdict = {}\n            for key in param_dict:\n                param = param_dict[key]\n\n                val = param.f_get()\n                resdict[key] = val\n\n            return resdict", "entry_point": "_return_item_dictionary", "input": "{}, ['a', 'b', 'c'], [[1, 2], [3], []]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3396-L3426", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037508", "code": "def add_deformation(chn_names, data):\n    \"\"\"From circularity, compute the deformation\n\n    This method is useful for RT-DC data sets that contain\n    the circularity but not the deformation.\n    \"\"\"\n    if \"deformation\" not in chn_names:\n        for ii, ch in enumerate(chn_names):\n            if ch == \"circularity\":\n                chn_names.append(\"deformation\")\n                data.append(1-data[ii])\n\n    return chn_names, data", "entry_point": "add_deformation", "input": "'walnut thistle harbour', [1, 2, 3]", "output": "('walnut thistle harbour', [1, 2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ZELLMECHANIK-DRESDEN/fcswrite/blob/5584983aa1eb927660183252039e73285c0724b3/examples/tdms2fcs.py#L32-L44", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037509", "code": "def equals(v1, v2) -> bool:\n    \"\"\"Compare two objects by value. Unlike the standard Python equality operator,\n    this function does not consider 1 == True or 0 == False. All other equality\n    operations are the same and performed using Python's equality operator.\"\"\"\n    if isinstance(v1, (bool, type(None))) or isinstance(v2, (bool, type(None))):\n        return v1 is v2\n    return v1 == v2", "entry_point": "equals", "input": "[[1, 2], [3], []], [-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/chrisrink10/basilisp/blob/3d82670ee218ec64eb066289c82766d14d18cc92/src/basilisp/lang/runtime.py#L941-L947", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037510", "code": "def _next_rdelim(items, pos):\n    \"\"\"Return position of next matching closing delimiter.\"\"\"\n    for num, item in enumerate(items):\n        if item > pos:\n            break\n    else:\n        raise RuntimeError(\"Mismatched delimiters\")\n    del items[num]\n    return item", "entry_point": "_next_rdelim", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "[3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/pmacosta/peng/blob/976935377adaa3de26fc5677aceb2cdfbd6f93a7/peng/functions.py#L128-L136", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037511", "code": "def is_hash160(s):\n    \"\"\" Returns True if the considered string is a valid RIPEMD160 hash. \"\"\"\n    if not s or not isinstance(s, str):\n        return False\n    if not len(s) == 40:\n        return False\n    for c in s:\n        if (c < '0' or c > '9') and (c < 'A' or c > 'F') and (c < 'a' or c > 'f'):\n            return False\n    return True", "entry_point": "is_hash160", "input": "[-1, 0, 1, 2]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ellmetha/neojsonrpc/blob/e369b633a727482d5f9e310f0c3337ae5f7265db/neojsonrpc/utils.py#L23-L32", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037512", "code": "def migrate_font(font):\n    \"Convert PythonCard font description to gui2py style\"\n    if 'faceName' in font:\n        font['face'] = font.pop('faceName')\n    if 'family' in font and font['family'] == 'sansSerif':\n        font['family'] = 'sans serif'\n    return font", "entry_point": "migrate_font", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/tools/migrate.py#L186-L192", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037513", "code": "def matches_count(count, options):\n    \"\"\"\n    Returns whether the given count matches the given query options.\n\n    If no quantity options are specified, any count is considered acceptable.\n\n    Args:\n        count (int): The count to be validated.\n        options (Dict[str, int | Iterable[int]]): A dictionary of query options.\n\n    Returns:\n        bool: Whether the count matches the options.\n    \"\"\"\n\n    if options.get(\"count\") is not None:\n        return count == int(options[\"count\"])\n    if options.get(\"maximum\") is not None and int(options[\"maximum\"]) < count:\n        return False\n    if options.get(\"minimum\") is not None and int(options[\"minimum\"]) > count:\n        return False\n    if options.get(\"between\") is not None and count not in options[\"between\"]:\n        return False\n    return True", "entry_point": "matches_count", "input": "10, {'a': 1, 'b': 2}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/helpers.py#L110-L132", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037514", "code": "def convert(lines):\n    \"\"\"Convert compiled .ui file from PySide2 to Qt.py\n\n    Arguments:\n        lines (list): Each line of of .ui file\n\n    Usage:\n        >> with open(\"myui.py\") as f:\n        ..   lines = convert(f.readlines())\n\n    \"\"\"\n\n    def parse(line):\n        line = line.replace(\"from PySide2 import\", \"from Qt import\")\n        line = line.replace(\"QtWidgets.QApplication.translate\",\n                            \"Qt.QtCompat.translate\")\n        return line\n\n    parsed = list()\n    for line in lines:\n        line = parse(line)\n        parsed.append(line)\n\n    return parsed", "entry_point": "convert", "input": "'abc'", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/pyblish/pyblish-maya/blob/75db8b5d8de9d53ae95e74195a788b5f6db2cb5f/pyblish_maya/vendor/Qt.py#L87-L110", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037515", "code": "def reverse_mapping(mapping):\n\t\"\"\"\n\tFor every key, value pair, return the mapping for the\n\tequivalent value, key pair\n\n\t>>> reverse_mapping({'a': 'b'}) == {'b': 'a'}\n\tTrue\n\t\"\"\"\n\tkeys, values = zip(*mapping.items())\n\treturn dict(zip(values, keys))", "entry_point": "reverse_mapping", "input": "{'a': 1, 'b': 2}", "output": "{1: 'a', 2: 'b'}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/svg.charts/blob/23053497b3f1af4e760f355050107ae3bc05909d/svg/charts/util.py#L4-L13", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037516", "code": "def bytes_to_readable(num):\r\n        \"\"\"Converts bytes to a human readable format\"\"\"\r\n        if num < 512:\r\n            return \"0 Kb\"\r\n        elif num < 1024:\r\n            return \"1 Kb\"\r\n\r\n        for unit in ['', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb']:\r\n            if abs(num) < 1024.0:\r\n                return \"%3.1f%s\" % (num, unit)\r\n            num /= 1024.0\r\n        return \"%.1f%s\" % (num, 'Yb')", "entry_point": "bytes_to_readable", "input": "7", "output": "'0 Kb'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/StaticCube/python-synology/blob/a5446a052fc91a38f7589803dc7a654180db2566/SynologyDSM/SynologyDSM.py#L12-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037517", "code": "def decodeLength(encoded):\n    '''\n    Decodes a variable length value defined in the MQTT protocol.\n    This value typically represents remaining field lengths\n    '''\n    value      = 0\n    multiplier = 1\n    for i in encoded:\n        value += (i & 0x7F) * multiplier\n        multiplier *= 0x80\n        if (i & 0x80) != 0x80:\n            break\n    return value", "entry_point": "decodeLength", "input": "[1, 2, 3]", "output": "1", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/astrorafael/twisted-mqtt/blob/5b322f7c2b82a502b1e1b70703ae45f1f668d07d/mqtt/pdu.py#L109-L121", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037518", "code": "def get_total_time_span(d):\n    \"\"\"\n    Returns total length of analysis.\n    \"\"\"\n\n    tmax = 0\n    for di in d.values():\n        if di.uTime.max() > tmax:\n            tmax = di.uTime.max()\n    \n    return tmax", "entry_point": "get_total_time_span", "input": "{}", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/helpers.py#L60-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037519", "code": "def _cauchy_equation(wavelength, coefficients):\n        '''\n        Helpful function to evaluate Cauchy equations.\n\n        Args:\n            wavelength (float, list, None): The wavelength(s) the\n                Cauchy equation will be evaluated at.\n            coefficients (list): A list of the coefficients of\n                the Cauchy equation.\n\n        Returns:\n            float, list: The refractive index at the target wavelength(s).\n        '''\n        n = 0.\n        for i, c in enumerate(coefficients):\n            exponent  = 2*i\n            n += c / wavelength**exponent\n        return n", "entry_point": "_cauchy_equation", "input": "7, [-1, 0, 1, 2]", "output": "-0.999566507152632", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jtambasco/opticalmaterialspy/blob/bfdfacad7fe280a0e63a3eb89de09a5c153595cc/opticalmaterialspy/_material_base.py#L238-L255", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037520", "code": "def calc_crc16(buf):\n        \"\"\" Drop in pure python replacement for ekmcrc.c extension.\n\n        Args:\n            buf (bytes): String or byte array (implicit Python 2.7 cast)\n\n        Returns:\n            str: 16 bit CRC per EKM Omnimeters formatted as hex string.\n        \"\"\"\n        crc_table = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241,\n                     0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440,\n                     0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40,\n                     0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841,\n                     0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40,\n                     0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41,\n                     0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641,\n                     0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040,\n                     0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240,\n                     0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441,\n                     0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41,\n                     0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840,\n                     0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41,\n                     0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40,\n                     0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640,\n                     0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041,\n                     0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240,\n                     0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441,\n                     0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41,\n                     0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840,\n                     0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41,\n                     0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40,\n                     0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640,\n                     0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041,\n                     0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241,\n                     0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440,\n                     0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40,\n                     0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841,\n                     0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40,\n                     0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41,\n                     0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641,\n                     0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]\n\n        crc = 0xffff\n        for c in buf:\n            index = (crc ^ ord(c)) & 0xff\n            crct = crc_table[index]\n            crc = (crc >> 8) ^ crct\n        crc = (crc << 8) | (crc >> 8)\n        crc &= 0x7F7F\n\n        return \"%04x\" % crc", "entry_point": "calc_crc16", "input": "[]", "output": "'7f7f'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ekmmetering/ekmmeters/blob/b3748bdf30263bfa46ea40157bdf8df2522e1904/ekmmeters.py#L1502-L1552", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037521", "code": "def delimit(values, delimiter=', '):\n    \"Returns a list of tokens interleaved with the delimiter.\"\n    toks = []\n\n    if not values:\n        return toks\n\n    if not isinstance(delimiter, (list, tuple)):\n        delimiter = [delimiter]\n\n    last = len(values) - 1\n\n    for i, value in enumerate(values):\n        toks.append(value)\n\n        if i < last:\n            toks.extend(delimiter)\n\n    return toks", "entry_point": "delimit", "input": "['a', 'b', 'c'], 3", "output": "['a', 3, 'b', 3, 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/bruth/cypher/blob/4f962f51539ac5a667ab5a050b6b4052d4c10c0f/cypher/utils.py#L4-L22", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037522", "code": "def _swap_on_miss(partition_result):\n\t\"\"\"\n\tGiven a partition_dict result, if the partition missed, swap\n\tthe before and after.\n\t\"\"\"\n\tbefore, item, after = partition_result\n\treturn (before, item, after) if item else (after, item, before)", "entry_point": "_swap_on_miss", "input": "[[1, 2], [3], []]", "output": "([1, 2], [3], [])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jaraco/jaraco.itertools/blob/0dc47c8924fa3d9ab676c3a6e195f03f728b72c6/jaraco/itertools.py#L1209-L1215", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037523", "code": "def Counter64(a, b, delta):\n    \"\"\"64bit counter aggregator with wrapping\n    \"\"\"\n    if b < a:\n        c = 18446744073709551615 - a\n        return (c + b) / float(delta)\n\n    return (b - a) / float(delta)", "entry_point": "Counter64", "input": "True, True, 1", "output": "0.0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/calston/tensor/blob/7c0c99708b5dbff97f3895f705e11996b608549d/tensor/aggregators.py#L10-L17", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037524", "code": "def split_trailing_whitespace(word):\n    \"\"\"\n    This function takes a word, such as 'test\\n\\n' and returns ('test','\\n\\n')\n    \"\"\"\n    stripped_length = len(word.rstrip())\n    return word[0:stripped_length], word[stripped_length:]", "entry_point": "split_trailing_whitespace", "input": "''", "output": "('', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/AkihikoITOH/capybara/blob/e86c2173ea386654f4ae061148e8fbe3f25e715c/capybara/virtualenv/lib/python2.7/site-packages/lxml/html/diff.py#L573-L578", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037525", "code": "def luhn_check(card_number):\n    \"\"\" checks to make sure that the card passes a luhn mod-10 checksum \"\"\"\n    sum = 0\n    num_digits = len(card_number)\n    oddeven = num_digits & 1\n\n    for count in range(0, num_digits):\n        digit = int(card_number[count])\n\n        if not ((count & 1) ^ oddeven):\n            digit *= 2\n        if digit > 9:\n            digit -= 9\n\n        sum += digit\n\n    return (sum % 10) == 0", "entry_point": "luhn_check", "input": "{}", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/stevelittlefish/littlefish/blob/6deee7f81fab30716c743efe2e94e786c6e17016/littlefish/validation.py#L22-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037526", "code": "def pfreduce(func, iterable, initial=None):\n    \"\"\"A pointfree reduce / left fold function: Applies a function of two\n    arguments cumulatively to the items supplied by the given iterable, so\n    as to reduce the iterable to a single value.  If an initial value is\n    supplied, it is placed before the items from the iterable in the\n    calculation, and serves as the default when the iterable is empty.\n\n    :param func: A function of two arguments\n    :param iterable: An iterable yielding input for the function\n    :param initial: An optional initial input for the function\n    :rtype: Single value\n\n    Example::\n\n        >>> from operator import add\n\n        >>> sum_of_squares = pfreduce(add, initial=0) * pfmap(lambda n: n**2)\n        >>> sum_of_squares([3, 4, 5, 6])\n        86\n\n    \"\"\"\n\n    iterator = iter(iterable)\n    try:\n        first_item = next(iterator)\n        if initial:\n            value = func(initial, first_item)\n        else:\n            value = first_item\n    except StopIteration:\n        return initial\n\n    for item in iterator:\n        value = func(value, item)\n    return value", "entry_point": "pfreduce", "input": "['apple', 'banana', 'cherry'], [], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/mshroyer/pointfree/blob/a25ecb3f0cd583e0730ecdde83018e5089711854/pointfree.py#L595-L629", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037527", "code": "def validators_from_config(validators):\n    \"\"\"Consolidate (potentially hex-encoded) list of validators\n    into list of binary address representations.\n    \"\"\"\n    result = []\n    for validator in validators:\n        if len(validator) == 40:\n            validator = validator.decode('hex')\n        result.append(validator)\n    return result", "entry_point": "validators_from_config", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/HydraChain/hydrachain/blob/6c0919b0575dc8aa481f3a8c703e1a7f0575ecc3/hydrachain/hdc_service.py#L530-L539", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037528", "code": "def specific_gains(string):\n    \"\"\"Convert string with gains of individual amplification elements to dict\"\"\"\n    if not string:\n        return {}\n\n    gains = {}\n    for gain in string.split(','):\n        amp_name, value = gain.split('=')\n        gains[amp_name.strip()] = float(value.strip())\n    return gains", "entry_point": "specific_gains", "input": "False", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/xmikos/soapy_power/blob/46e12659b8d08af764dc09a1f31b0e85a68f808f/soapypower/__main__.py#L36-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037529", "code": "def device_settings(string):\n    \"\"\"Convert string with SoapySDR device settings to dict\"\"\"\n    if not string:\n        return {}\n\n    settings = {}\n    for setting in string.split(','):\n        setting_name, value = setting.split('=')\n        settings[setting_name.strip()] = value.strip()\n    return settings", "entry_point": "device_settings", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/xmikos/soapy_power/blob/46e12659b8d08af764dc09a1f31b0e85a68f808f/soapypower/__main__.py#L48-L57", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037530", "code": "def calc_heat_index(temp, hum):\n    '''\n    calculates the heat index based upon temperature (in F) and humidity.\n    http://www.srh.noaa.gov/bmx/tables/heat_index.html\n\n    returns the heat index in degrees F.\n    '''\n    \n    if (temp < 80):\n        return temp\n    else:\n        return -42.379 + 2.04901523 * temp + 10.14333127 * hum - 0.22475541 * \\\n               temp * hum - 6.83783 * (10 ** -3) * (temp ** 2) - 5.481717 * \\\n               (10 ** -2) * (hum ** 2) + 1.22874 * (10 ** -3) * (temp ** 2) * \\\n               hum + 8.5282 * (10 ** -4) * temp * (hum ** 2) - 1.99 * \\\n               (10 ** -6) * (temp ** 2) * (hum ** 2);", "entry_point": "calc_heat_index", "input": "True, set()", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cmcginty/PyWeather/blob/8c25d9cd1fa921e0a6e460d523656279cac045cb/weather/units/temp.py#L71-L86", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037531", "code": "def _unpack_storm_date(date):\n        '''\n        given a packed storm date field, unpack and return 'YYYY-MM-DD' string.\n        '''\n        year = (date & 0x7f) + 2000  # 7 bits\n        day = (date >> 7) & 0x01f  # 5 bits\n        month = (date >> 12) & 0x0f  # 4 bits\n        return \"%s-%s-%s\" % (year, month, day)", "entry_point": "_unpack_storm_date", "input": "0", "output": "'2000-0-0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cmcginty/PyWeather/blob/8c25d9cd1fa921e0a6e460d523656279cac045cb/weather/stations/davis.py#L181-L188", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037532", "code": "def unduplicate_field_names(field_names):\n    \"\"\"Append a number to duplicate field names to make them unique. \"\"\"\n    res = []\n    for k in field_names:\n        if k in res:\n            i = 1\n            while k + '_' + str(i) in res:\n                i += 1\n            k += '_' + str(i)\n        res.append(k)\n    return res", "entry_point": "unduplicate_field_names", "input": "'  padded  '", "output": "[' ', ' _1', 'p', 'a', 'd', 'd_1', 'e', 'd_2', ' _2', ' _3']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/versae/ipython-cypher/blob/1e88bd8227743e70b78af42e0e713ae8803485e1/src/cypher/run.py#L35-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037533", "code": "def molspec(x):\n    \"\"\"\n    Parse a string for a lipid or a solvent as given on the command line\n    (MOLECULE[=NUMBER|:NUMBER]); where `=NUMBER` sets an absolute number of the\n    molecule, and `:NUMBER` sets a relative number of it.\n    If both absolute and relative number are set False, then relative count is 1.\n    \"\"\"\n    lip = x.split(\":\")\n    abn = lip[0].split(\"=\")\n    names = abn[0]\n    if len(abn) > 1:\n        nrel = 0\n        nabs = int(abn[1])\n    else:\n        nabs = 0\n        if len(lip) > 1:\n            nrel = float(lip[1])\n        else:\n            nrel = 1\n    return abn[0], nabs, nrel", "entry_point": "molspec", "input": "'Hello World'", "output": "('Hello World', 0, 1)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/Tsjerk/Insane/blob/b73f08910ddb0b66597b20ff75ecee7f65f4ecf6/insane/converters.py#L51-L70", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037534", "code": "def filter_glyph_names( alist, filter ):\n  \"\"\"filter `alist' by taking _out_ all glyph names that are in `filter'\"\"\"\n\n  count  = 0\n  extras = []\n\n  for name in alist:\n    try:\n      filtered_index = filter.index( name )\n    except:\n      extras.append( name )\n\n  return extras", "entry_point": "filter_glyph_names", "input": "[[1, 2], [3], []], [1, 2, 3]", "output": "[[1, 2], [3], []]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/aholkner/bacon/blob/edf3810dcb211942d392a8637945871399b0650d/native/Vendor/FreeType/src/tools/glnames.py#L5171-L5183", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037535", "code": "def s2h(ss):\n    \"\"\"convert seconds to a pretty \"d hh:mm:ss.s\" format\"\"\"\n    mm, ss = divmod(ss, 60)\n    hh, mm = divmod(mm, 60)\n    dd, hh = divmod(hh, 24)\n    tstr = \"%02i:%04.1f\" % (mm, ss)\n    if hh > 0:\n        tstr = (\"%02i:\" % hh) + tstr\n    if dd > 0:\n        tstr = (\"%id \" % dd) + tstr\n    return tstr", "entry_point": "s2h", "input": "True", "output": "'00:01.0'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/alimuldal/PyFNND/blob/3cbe0622a385f5206837bfd944d781aa7b1649ea/pyfnnd/utils.py#L24-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037536", "code": "def _lazysecret(secret, blocksize=32, padding='}'):\n    \"\"\"Pads secret if not legal AES block size (16, 24, 32)\"\"\"\n    if not len(secret) in (16, 24, 32):\n        return secret + (blocksize - len(secret)) * padding\n    return secret", "entry_point": "_lazysecret", "input": "['apple', 'banana', 'cherry'], 1, [5, 3, 1, 4]", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tomatohater/django-unfriendly/blob/38eca5fb45841db331fc66571fff37bef50dfa67/unfriendly/utils.py#L23-L27", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037537", "code": "def human_bytes(value):\n    \"\"\"\n    Convert a byte value into a human-readable format.\n    \"\"\"\n    value = float(value)\n    if value >= 1073741824:\n        gigabytes = value / 1073741824\n        size = '%.2f GB' % gigabytes\n    elif value >= 1048576:\n        megabytes = value / 1048576\n        size = '%.2f MB' % megabytes\n    elif value >= 1024:\n        kilobytes = value / 1024\n        size = '%.2f KB' % kilobytes\n    else:\n        size = '%.2f B' % value\n    return size", "entry_point": "human_bytes", "input": "False", "output": "'0.00 B'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/ianare/django-memcache-admin/blob/330db10139ccf04c6137255e23115482b0c89aec/memcache_admin/templatetags/memcache_admin.py#L13-L29", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037538", "code": "def _offset(value):\n    \"\"\"Parse timezone to offset in seconds.\n\n    Args:\n        value: A timezone in the '+0000' format. An integer would also work.\n\n    Returns:\n        The timezone offset from GMT in seconds as an integer.\n    \"\"\"\n    o = int(value)\n    if o == 0:\n        return 0\n    a = abs(o)\n    s = a*36+(a%100)*24\n    return (o//a)*s", "entry_point": "_offset", "input": "-1.5", "output": "-60", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L51-L65", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037539", "code": "def get_newline_positions(text):\n  \"\"\"Returns a list of the positions in the text where all new lines occur. This is used by\n  get_line_and_char to efficiently find coordinates represented by offset positions.\n  \"\"\"\n  pos = []\n  for i, c in enumerate(text):\n    if c == \"\\n\":\n      pos.append(i)\n  return pos", "entry_point": "get_newline_positions", "input": "'abc'", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/util.py#L40-L48", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037540", "code": "def get_line_and_char(newline_positions, position):\n  \"\"\"Given a list of newline positions, and an offset from the start of the source code\n  that newline_positions was pulled from, return a 2-tuple of (line, char) coordinates.\n  \"\"\"\n  if newline_positions:\n    for line_no, nl_pos in enumerate(newline_positions):\n      if nl_pos >= position:\n        if line_no == 0:\n          return (line_no, position)\n        else:\n          return (line_no, position - newline_positions[line_no - 1] - 1)\n    return (line_no + 1, position - newline_positions[-1] - 1)\n  else:\n    return (0, position)", "entry_point": "get_line_and_char", "input": "'', [1, 2, 3]", "output": "(0, [1, 2, 3])", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/util.py#L51-L64", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037541", "code": "def _count_leading_whitespace(text):\n  \"\"\"Returns the number of characters at the beginning of text that are whitespace.\"\"\"\n  idx = 0\n  for idx, char in enumerate(text):\n    if not char.isspace():\n      return idx\n  return idx + 1", "entry_point": "_count_leading_whitespace", "input": "'a,b,c'", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/primitive.py#L466-L472", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037542", "code": "def _is_in_max_difference(value_1, value_2, max_difference):\n    ''' Helper function to determine the difference of two values that can be np.uints. Works in python and numba mode.\n    Circumvents numba bug #1653\n    '''\n    if value_1 <= value_2:\n        return value_2 - value_1 <= max_difference\n    return value_1 - value_2 <= max_difference", "entry_point": "_is_in_max_difference", "input": "True, 10, 7", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/SiLab-Bonn/pixel_clusterizer/blob/d2c8c3072fb03ebb7c6a3e8c57350fbbe38efd4d/pixel_clusterizer/cluster_functions.py#L137-L143", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037543", "code": "def mouse_aabb(mpos,size,pos):\n    \"\"\"\n    AABB Collision checker that can be used for most axis-aligned collisions.\n    \n    Intended for use in widgets to check if the mouse is within the bounds of a particular widget.\n    \"\"\"\n    return pos[0]<=mpos[0]<=pos[0]+size[0] and pos[1]<=mpos[1]<=pos[1]+size[1]", "entry_point": "mouse_aabb", "input": "'Hello World', 2.0, ['apple', 'banana', 'cherry']", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/not-na/peng3d/blob/1151be665b26cc8a479f6307086ba919e4d32d85/peng3d/util/gui.py#L35-L41", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037544", "code": "def str_to_num(str_value):\n        \"\"\"Convert str_value to an int or a float, depending on the\n        numeric value represented by str_value.\n\n        \"\"\"\n        str_value = str(str_value)\n        try:\n            return int(str_value)\n        except ValueError:\n            return float(str_value)", "entry_point": "str_to_num", "input": "3", "output": "3", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/bheinzerling/descriptors/blob/04fff864649fba9bd6a2d8f8b649cf30994e0e46/descriptors/handmade.py#L167-L176", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037545", "code": "def domain_name_left_cuts(domain):\n    '''returns a list of strings created by splitting the domain on\n    '.' and successively cutting off the left most portion\n    '''\n    cuts = []\n    if domain:\n        parts = domain.split('.')\n        for i in range(len(parts)):\n            cuts.append( '.'.join(parts[i:]))\n    return cuts", "entry_point": "domain_name_left_cuts", "input": "0", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/trec-kba/streamcorpus-pipeline/blob/8bb82ea1beb83c6b40ed03fa1659df2897c2292a/streamcorpus_pipeline/_filters.py#L269-L278", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037546", "code": "def is_subsequence(needle, haystack):\n    \"\"\"Are all the elements of needle contained in haystack, and in the same order?\n    There may be other elements interspersed throughout\"\"\"\n    it = iter(haystack)\n    for element in needle:\n        if element not in it:\n            return False\n    return True", "entry_point": "is_subsequence", "input": "['apple', 'banana', 'cherry'], ['apple', 'banana', 'cherry']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/wimglenn/wimpy/blob/4e8ebe4e7052d88c9f88ac7dcaa1b587cc2cf86e/wimpy/util.py#L110-L117", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037547", "code": "def ALL_mentions(target_mentions, chain_mentions):\n    '''\n    For each name string in the target_mentions list, searches through\n    all chain_mentions looking for any cleansed Token.token that\n    contains the name.  Returns True only if all of the target_mention\n    strings appeared as substrings of at least one cleansed\n    Token.token.  Otherwise, returns False.\n\n    :type target_mentions: list of basestring\n    :type chain_mentions: list of basestring\n\n    :returns bool:\n    '''\n    found_all = True\n    for name in target_mentions:\n        found_one = False\n        for chain_ment in chain_mentions:\n            if name in chain_ment:\n                found_one = True\n                break\n        if not found_one:\n            found_all = False\n            break\n    return found_all", "entry_point": "ALL_mentions", "input": "[], []", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/trec-kba/streamcorpus-pipeline/blob/8bb82ea1beb83c6b40ed03fa1659df2897c2292a/streamcorpus_pipeline/_taggers.py#L78-L101", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037548", "code": "def ANY_mentions(target_mentions, chain_mentions):\n    '''\n    For each name string in the target_mentions list, searches through\n    all chain_mentions looking for any cleansed Token.token that\n    contains the name.  Returns True if any of the target_mention\n    strings appeared as substrings of any cleansed Token.token.\n    Otherwise, returns False.\n\n    :type target_mentions: list of basestring\n    :type chain_mentions: list of basestring\n\n    :returns bool:\n    '''\n    for name in target_mentions:\n        for chain_ment in chain_mentions:\n            if name in chain_ment:\n                return True\n    return False", "entry_point": "ANY_mentions", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "True", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/trec-kba/streamcorpus-pipeline/blob/8bb82ea1beb83c6b40ed03fa1659df2897c2292a/streamcorpus_pipeline/_taggers.py#L123-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037549", "code": "def _uniquify(_list):\n    \"\"\"Remove duplicates in a list.\"\"\"\n    seen = set()\n    result = []\n    for x in _list:\n        if x not in seen:\n            result.append(x)\n            seen.add(x)\n    return result", "entry_point": "_uniquify", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/NarrativeScience/lsi/blob/7d901b03fdb1a34ef795e5412bfe9685d948e32d/src/lsi/utils/hosts.py#L397-L405", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037550", "code": "def filter_entries(entries, filters, exclude):\n    \"\"\"\n    Filters a list of host entries according to the given filters.\n\n    :param entries: A list of host entries.\n    :type entries: [:py:class:`HostEntry`]\n    :param filters: Regexes that must match a `HostEntry`.\n    :type filters: [``str``]\n    :param exclude: Regexes that must NOT match a `HostEntry`.\n    :type exclude: [``str``]\n\n    :return: The filtered list of host entries.\n    :rtype: [:py:class:`HostEntry`]\n    \"\"\"\n    filtered = [entry\n                for entry in entries\n                if all(entry.matches(f) for f in filters)\n                and not any(entry.matches(e) for e in exclude)]\n    return filtered", "entry_point": "filter_entries", "input": "(), True, {}", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/NarrativeScience/lsi/blob/7d901b03fdb1a34ef795e5412bfe9685d948e32d/src/lsi/utils/hosts.py#L527-L545", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037551", "code": "def transpose_table(table):\n    \"\"\"\n    Transposes a table, turning rows into columns.\n    :param table: A 2D string grid.\n    :type table: [[``str``]]\n\n    :return: The same table, with rows and columns flipped.\n    :rtype: [[``str``]]\n    \"\"\"\n    if len(table) == 0:\n        return table\n    else:\n        num_columns = len(table[0])\n        return [[row[i] for row in table] for i in range(num_columns)]", "entry_point": "transpose_table", "input": "{}", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/NarrativeScience/lsi/blob/7d901b03fdb1a34ef795e5412bfe9685d948e32d/src/lsi/utils/table.py#L113-L126", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037552", "code": "def _letter_map(word):\n    \"\"\"Creates a map of letter use in a word.\n\n    Args:\n        word: a string to create a letter map from\n\n    Returns:\n        a dictionary of {letter: integer count of letter in word}\n    \"\"\"\n\n    lmap = {}\n    for letter in word:\n        try:\n            lmap[letter] += 1\n        except KeyError:\n            lmap[letter] = 1\n    return lmap", "entry_point": "_letter_map", "input": "'  padded  '", "output": "{' ': 4, 'p': 1, 'a': 1, 'd': 3, 'e': 1}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/a-tal/nagaram/blob/2edcb0ef8cb569ebd1c398be826472b4831d6110/nagaram/anagrams.py#L7-L23", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037553", "code": "def get_last_value_from_timeseries(timeseries):\n    \"\"\"Gets the most recent non-zero value for a .last metric or zero\n    for empty data.\"\"\"\n    if not timeseries:\n        return 0\n    for metric, points in timeseries.items():\n        return next((p['y'] for p in reversed(points) if p['y'] > 0), 0)", "entry_point": "get_last_value_from_timeseries", "input": "[]", "output": "0", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/praekeltfoundation/seed-control-interface/blob/32ddad88b5bc2f8f4d80b848361899da2e081636/ci/utils.py#L32-L38", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037554", "code": "def blank_tiles(input_word):\n    \"\"\"Searches a string for blank tile characters (\"?\" and \"_\").\n\n    Args:\n        input_word: the user supplied string to search through\n\n    Returns:\n        a tuple of:\n            input_word without blanks\n            integer number of blanks (no points)\n            integer number of questions (points)\n    \"\"\"\n\n    blanks = 0\n    questions = 0\n    input_letters = []\n    for letter in input_word:\n        if letter == \"_\":\n            blanks += 1\n        elif letter == \"?\":\n            questions += 1\n        else:\n            input_letters.append(letter)\n    return input_letters, blanks, questions", "entry_point": "blank_tiles", "input": "'AbC dEf'", "output": "(['A', 'b', 'C', ' ', 'd', 'E', 'f'], 0, 0)", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/a-tal/nagaram/blob/2edcb0ef8cb569ebd1c398be826472b4831d6110/nagaram/scrabble.py#L72-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037555", "code": "def valid_scrabble_word(word):\n    \"\"\"Checks if the input word could be played with a full bag of tiles.\n\n    Returns:\n        True or false\n    \"\"\"\n\n    letters_in_bag = {\n        \"a\": 9,\n        \"b\": 2,\n        \"c\": 2,\n        \"d\": 4,\n        \"e\": 12,\n        \"f\": 2,\n        \"g\": 3,\n        \"h\": 2,\n        \"i\": 9,\n        \"j\": 1,\n        \"k\": 1,\n        \"l\": 4,\n        \"m\": 2,\n        \"n\": 6,\n        \"o\": 8,\n        \"p\": 2,\n        \"q\": 1,\n        \"r\": 6,\n        \"s\": 4,\n        \"t\": 6,\n        \"u\": 4,\n        \"v\": 2,\n        \"w\": 2,\n        \"x\": 1,\n        \"y\": 2,\n        \"z\": 1,\n        \"_\": 2,\n    }\n\n    for letter in word:\n        if letter == \"?\":\n            continue\n        try:\n            letters_in_bag[letter] -= 1\n        except KeyError:\n            return False\n        if letters_in_bag[letter] < 0:\n            letters_in_bag[\"_\"] -= 1\n            if letters_in_bag[\"_\"] < 0:\n                return False\n    return True", "entry_point": "valid_scrabble_word", "input": "'a,b,c'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/a-tal/nagaram/blob/2edcb0ef8cb569ebd1c398be826472b4831d6110/nagaram/scrabble.py#L136-L184", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037556", "code": "def parse_filename(fname):\n    \"\"\"Parse a notebook filename.\n\n    This function takes a notebook filename and returns the notebook\n    format (json/py) and the notebook name. This logic can be\n    summarized as follows:\n\n    * notebook.ipynb -> (notebook.ipynb, notebook, json)\n    * notebook.json  -> (notebook.json, notebook, json)\n    * notebook.py    -> (notebook.py, notebook, py)\n    * notebook       -> (notebook.ipynb, notebook, json)\n\n    Parameters\n    ----------\n    fname : unicode\n        The notebook filename. The filename can use a specific filename\n        extention (.ipynb, .json, .py) or none, in which case .ipynb will\n        be assumed.\n\n    Returns\n    -------\n    (fname, name, format) : (unicode, unicode, unicode)\n        The filename, notebook name and format.\n    \"\"\"\n    if fname.endswith(u'.ipynb'):\n        format = u'json'\n    elif fname.endswith(u'.json'):\n        format = u'json'\n    elif fname.endswith(u'.py'):\n        format = u'py'\n    else:\n        fname = fname + u'.ipynb'\n        format = u'json'\n    name = fname.split('.')[0]\n    return fname, name, format", "entry_point": "parse_filename", "input": "''", "output": "('.ipynb', '', 'json')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v2/__init__.py#L43-L77", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037557", "code": "def last_blank(src):\n    \"\"\"Determine if the input source ends in a blank.\n\n    A blank is either a newline or a line consisting of whitespace.\n\n    Parameters\n    ----------\n    src : string\n      A single or multiline string.\n    \"\"\"\n    if not src: return False\n    ll  = src.splitlines()[-1]\n    return (ll == '') or ll.isspace()", "entry_point": "last_blank", "input": "[]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/inputsplitter.py#L148-L160", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037558", "code": "def table(rows):\n    '''\n    Output a simple table with several columns.\n    '''\n\n    output = '<table>'\n\n    for row in rows:\n        output += '<tr>'\n        for column in row:\n            output += '<td>{s}</td>'.format(s=column)\n        output += '</tr>'\n\n    output += '</table>'\n\n    return output", "entry_point": "table", "input": "['a', 'b', 'c']", "output": "'<table><tr><td>a</td></tr><tr><td>b</td></tr><tr><td>c</td></tr></table>'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/theduke/django-baseline/blob/7be8b956e53c70b35f34e1783a8fe8f716955afb/django_baseline/templatetags/helpers.py#L18-L33", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037559", "code": "def is_url(url):\n    \"\"\"boolean check for whether a string is a zmq url\"\"\"\n    if '://' not in url:\n        return False\n    proto, addr = url.split('://', 1)\n    if proto.lower() not in ['tcp','pgm','epgm','ipc','inproc']:\n        return False\n    return True", "entry_point": "is_url", "input": "[5, 3, 1, 4]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/util.py#L127-L134", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037560", "code": "def unquote_ends(istr):\n    \"\"\"Remove a single pair of quotes from the endpoints of a string.\"\"\"\n\n    if not istr:\n        return istr\n    if (istr[0]==\"'\" and istr[-1]==\"'\") or \\\n       (istr[0]=='\"' and istr[-1]=='\"'):\n        return istr[1:-1]\n    else:\n        return istr", "entry_point": "unquote_ends", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/text.py#L36-L45", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037561", "code": "def marquee(txt='',width=78,mark='*'):\n    \"\"\"Return the input string centered in a 'marquee'.\n\n    :Examples:\n\n        In [16]: marquee('A test',40)\n        Out[16]: '**************** A test ****************'\n\n        In [17]: marquee('A test',40,'-')\n        Out[17]: '---------------- A test ----------------'\n\n        In [18]: marquee('A test',40,' ')\n        Out[18]: '                 A test                 '\n\n    \"\"\"\n    if not txt:\n        return (mark*width)[:width]\n    nmark = (width-len(txt)-2)//len(mark)//2\n    if nmark < 0: nmark =0\n    marks = mark*nmark\n    return '%s %s %s' % (marks,txt,marks)", "entry_point": "marquee", "input": "[-1, 0, 1, 2], -3, [[1, 2], [3], []]", "output": "'[] [-1, 0, 1, 2] []'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/text.py#L447-L467", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037562", "code": "def long_substr(data):\n    \"\"\"Return the longest common substring in a list of strings.\n    \n    Credit: http://stackoverflow.com/questions/2892931/longest-common-substring-from-more-than-two-strings-python\n    \"\"\"\n    substr = ''\n    if len(data) > 1 and len(data[0]) > 0:\n        for i in range(len(data[0])):\n            for j in range(len(data[0])-i+1):\n                if j > len(substr) and all(data[0][i:i+j] in x for x in data):\n                    substr = data[0][i:i+j]\n    elif len(data) == 1:\n        substr = data[0]\n    return substr", "entry_point": "long_substr", "input": "['apple', 'banana', 'cherry']", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/text.py#L545-L558", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037563", "code": "def _join_lines(lines):\n    \"\"\"join lines that have been written by splitlines()\n    \n    Has logic to protect against `splitlines()`, which\n    should have been `splitlines(True)`\n    \"\"\"\n    if lines and lines[0].endswith(('\\n', '\\r')):\n        # created by splitlines(True)\n        return u''.join(lines)\n    else:\n        # created by splitlines()\n        return u'\\n'.join(lines)", "entry_point": "_join_lines", "input": "'abc'", "output": "'a\\nb\\nc'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v3/rwbase.py#L51-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037564", "code": "def compress_dhist(dh):\n    \"\"\"Compress a directory history into a new one with at most 20 entries.\n\n    Return a new list made from the first and last 10 elements of dhist after\n    removal of duplicates.\n    \"\"\"\n    head, tail = dh[:-10], dh[-10:]\n\n    newhead = []\n    done = set()\n    for h in head:\n        if h in done:\n            continue\n        newhead.append(h)\n        done.add(h)\n\n    return newhead + tail", "entry_point": "compress_dhist", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/magic.py#L64-L80", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037565", "code": "def ln(label):\n    \"\"\"Draw a 70-char-wide divider, with label in the middle.\n\n    >>> ln('hello there')\n    '---------------------------- hello there -----------------------------'\n    \"\"\"\n    label_len = len(label) + 2\n    chunk = (70 - label_len) // 2\n    out = '%s %s %s' % ('-' * chunk, label, '-' * chunk)\n    pad = 70 - len(out)\n    if pad > 0:\n        out = out + ('-' * pad)\n    return out", "entry_point": "ln", "input": "[5, 3, 1, 4]", "output": "'-------------------------------- [5, 3, 1, 4] --------------------------------'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/util.py#L291-L303", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037566", "code": "def fix_frame_records_filenames(records):\n    \"\"\"Try to fix the filenames in each record from inspect.getinnerframes().\n\n    Particularly, modules loaded from within zip files have useless filenames\n    attached to their code object, and inspect.getinnerframes() just uses it.\n    \"\"\"\n    fixed_records = []\n    for frame, filename, line_no, func_name, lines, index in records:\n        # Look inside the frame's globals dictionary for __file__, which should\n        # be better.\n        better_fn = frame.f_globals.get('__file__', None)\n        if isinstance(better_fn, str):\n            # Check the type just in case someone did something weird with\n            # __file__. It might also be None if the error occurred during\n            # import.\n            filename = better_fn\n        fixed_records.append((frame, filename, line_no, func_name, lines, index))\n    return fixed_records", "entry_point": "fix_frame_records_filenames", "input": "[]", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/ultratb.py#L218-L235", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037567", "code": "def flag(val):\n    \"\"\"Does the value look like an on/off flag?\"\"\"\n    if val == 1:\n        return True\n    elif val == 0:\n        return False\n    val = str(val)\n    if len(val) > 5:\n        return False\n    return val.upper() in ('1', '0', 'F', 'T', 'TRUE', 'FALSE', 'ON', 'OFF')", "entry_point": "flag", "input": "[[1, 2], [3], []]", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/config.py#L625-L634", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037568", "code": "def get_pager_start(pager, start):\n    \"\"\"Return the string for paging files with an offset.\n\n    This is the '+N' argument which less and more (under Unix) accept.\n    \"\"\"\n\n    if pager in ['less','more']:\n        if start:\n            start_string = '+' + str(start)\n        else:\n            start_string = ''\n    else:\n        start_string = ''\n    return start_string", "entry_point": "get_pager_start", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/page.py#L274-L287", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037569", "code": "def roundplus(number):\n    \"\"\"\n    given an number, this fuction rounds the number as the following examples:\n    87 -> 87, 100 -> 100+, 188 -> 100+, 999 -> 900+, 1001 -> 1000+, ...etc\n    \"\"\"\n    num = str(number)\n    if not num.isdigit():\n        return num\n\n    num = str(number)\n    digits = len(num)\n    rounded = '100+'\n\n    if digits < 3:\n        rounded = num\n    elif digits == 3:\n        rounded = num[0] + '00+'\n    elif digits == 4:\n        rounded = num[0] + 'K+'\n    elif digits == 5:\n        rounded = num[:1] + 'K+'\n    else:\n        rounded = '100K+'\n\n    return rounded", "entry_point": "roundplus", "input": "10", "output": "'10'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/templatetags/rounder.py#L10-L34", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037570", "code": "def splitBy(data, num):\n    \"\"\" Turn a list to list of list \"\"\"\n    return [data[i:i + num] for i in range(0, len(data), num)]", "entry_point": "splitBy", "input": "['apple', 'banana', 'cherry'], -3", "output": "[]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/un33k/django-toolware/blob/973f3e003dc38b812897dab88455bee37dcaf931/toolware/templatetags/generic.py#L18-L20", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037571", "code": "def hex_to_rgb(color):\n    \"\"\"Convert a hex color to rgb integer tuple.\"\"\"\n    if color.startswith('#'):\n        color = color[1:]\n    if len(color) == 3:\n        color = ''.join([c*2 for c in color])\n    if len(color) != 6:\n        return False\n    try:\n        r = int(color[:2],16)\n        g = int(color[2:4],16)\n        b = int(color[4:],16)\n    except ValueError:\n        return False\n    else:\n        return r,g,b", "entry_point": "hex_to_rgb", "input": "'AbC dEf'", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/styles.py#L60-L75", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037572", "code": "def _transform_data(data: dict) -> dict:\n        \"\"\"\n        Each CloudStack API call returns a nested dictionary structure. The first level contains only one key indicating\n        the API that originated the response. This function removes that first level from the data returned to the\n        caller.\n\n        :param data: Response of the API call\n        :type data: dict\n        :return: Simplified response without the information about the API that originated the response.\n        :rtype: dict\n        \"\"\"\n        for key in data.keys():\n            return_value = data[key]\n            if isinstance(return_value, dict):\n                return return_value\n        return data", "entry_point": "_transform_data", "input": "{'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/giffels/CloudStackAIO/blob/f9df856622eb8966a6816f8008cc16d75b0067e5/CloudStackAIO/CloudStack.py#L223-L238", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037573", "code": "def path_to_filename(pathfile):\n    '''\n    Takes a path filename string and returns the split between the path and the filename\n\n    if filename is not given, filename = ''\n    if path is not given, path = './'\n\n    '''\n\n    path = pathfile[:pathfile.rfind('/') + 1]\n    if path == '':\n        path = './'\n\n    filename = pathfile[pathfile.rfind('/') + 1:len(pathfile)]\n    if '.' not in filename:\n        path = pathfile\n        filename = ''\n\n    if (filename == '') and (path[len(path) - 1] != '/'):\n        path += '/'\n\n    return path, filename", "entry_point": "path_to_filename", "input": "'Hello World'", "output": "('Hello World/', '')", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/utils.py#L109-L130", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037574", "code": "def timeUnit(elapsed, avg, est_end):\n    '''calculates unit of time to display'''\n    minute = 60\n    hr = 3600\n    day = 86400\n\n    if elapsed <= 3 * minute:\n        unit_elapsed = (elapsed, \"secs\")\n    if elapsed > 3 * minute:\n        unit_elapsed = ((elapsed / 60), \"mins\")\n    if elapsed > 3 * hr:\n        unit_elapsed = ((elapsed / 3600), \"hr\")\n\n    if avg <= 3 * minute:\n        unit_avg = (avg, \"secs\")\n    if avg > 3 * minute:\n        unit_avg = ((avg / 60), \"mins\")\n    if avg > 3 * hr:\n        unit_avg = ((avg / 3600), \"hr\")\n\n    if est_end <= 3 * minute:\n        unit_estEnd = (est_end, \"secs\")\n    if est_end > 3 * minute:\n        unit_estEnd = ((est_end / 60), \"mins\")\n    if est_end > 3 * hr:\n        unit_estEnd = ((est_end / 3600), \"hr\")\n\n    return [unit_elapsed, unit_avg, unit_estEnd]", "entry_point": "timeUnit", "input": "1, -1.5, False", "output": "[(1, 'secs'), (-1.5, 'secs'), (False, 'secs')]", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/utils.py#L364-L391", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037575", "code": "def nt_quote_arg(arg):\n    \"\"\"Quote a command line argument according to Windows parsing rules\"\"\"\n\n    result = []\n    needquote = False\n    nb = 0\n\n    needquote = (\" \" in arg) or (\"\\t\" in arg)\n    if needquote:\n        result.append('\"')\n\n    for c in arg:\n        if c == '\\\\':\n            nb += 1\n        elif c == '\"':\n            # double preceding backslashes, then add a \\\"\n            result.append('\\\\' * (nb*2) + '\\\\\"')\n            nb = 0\n        else:\n            if nb:\n                result.append('\\\\' * nb)\n                nb = 0\n            result.append(c)\n\n    if nb:\n        result.append('\\\\' * nb)\n\n    if needquote:\n        result.append('\\\\' * nb)    # double the trailing backslashes\n        result.append('\"')\n\n    return ''.join(result)", "entry_point": "nt_quote_arg", "input": "[]", "output": "''", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/easy_install.py#L1722-L1753", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037576", "code": "def join_regex(regexes):\n    \"\"\"Combine a list of regexes into one that matches any of them.\"\"\"\n    if len(regexes) > 1:\n        return \"|\".join([\"(%s)\" % r for r in regexes])\n    elif regexes:\n        return regexes[0]\n    else:\n        return \"\"", "entry_point": "join_regex", "input": "['a', 'b', 'c']", "output": "'(a)|(b)|(c)'", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/misc.py#L88-L95", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037577", "code": "def uniq_stable(elems):\n    \"\"\"uniq_stable(elems) -> list\n\n    Return from an iterable, a list of all the unique elements in the input,\n    but maintaining the order in which they first appear.\n\n    A naive solution to this problem which just makes a dictionary with the\n    elements as keys fails to respect the stability condition, since\n    dictionaries are unsorted by nature.\n\n    Note: All elements in the input must be valid dictionary keys for this\n    routine to work, as it internally uses a dictionary for efficiency\n    reasons.\"\"\"\n\n    unique = []\n    unique_dict = {}\n    for nn in elems:\n        if nn not in unique_dict:\n            unique.append(nn)\n            unique_dict[nn] = None\n    return unique", "entry_point": "uniq_stable", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/data.py#L22-L42", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037578", "code": "def sort_compare(lst1, lst2, inplace=1):\n    \"\"\"Sort and compare two lists.\n\n    By default it does it in place, thus modifying the lists. Use inplace = 0\n    to avoid that (at the cost of temporary copy creation).\"\"\"\n    if not inplace:\n        lst1 = lst1[:]\n        lst2 = lst2[:]\n    lst1.sort(); lst2.sort()\n    return lst1 == lst2", "entry_point": "sort_compare", "input": "[], [[1, 2], [3], []], []", "output": "False", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/data.py#L45-L54", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037579", "code": "def list2dict(lst):\n    \"\"\"Takes a list of (key,value) pairs and turns it into a dict.\"\"\"\n\n    dic = {}\n    for k,v in lst: dic[k] = v\n    return dic", "entry_point": "list2dict", "input": "[]", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/data.py#L57-L62", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037580", "code": "def parse_notifier_name(name):\n    \"\"\"Convert the name argument to a list of names.\n\n    Examples\n    --------\n\n    >>> parse_notifier_name('a')\n    ['a']\n    >>> parse_notifier_name(['a','b'])\n    ['a', 'b']\n    >>> parse_notifier_name(None)\n    ['anytrait']\n    \"\"\"\n    if isinstance(name, str):\n        return [name]\n    elif name is None:\n        return ['anytrait']\n    elif isinstance(name, (list, tuple)):\n        for n in name:\n            assert isinstance(n, str), \"names must be strings\"\n        return name", "entry_point": "parse_notifier_name", "input": "''", "output": "['']", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/traitlets.py#L120-L140", "provenance_class": "collected", "licence": "unknown"}
{"id": "code_search_net/0037581", "code": "def extract_header(msg_or_header):\n    \"\"\"Given a message or header, return the header.\"\"\"\n    if not msg_or_header:\n        return {}\n    try:\n        # See if msg_or_header is the entire message.\n        h = msg_or_header['header']\n    except KeyError:\n        try:\n            # See if msg_or_header is just the header\n            h = msg_or_header['msg_id']\n        except KeyError:\n            raise\n        else:\n            h = msg_or_header\n    if not isinstance(h, dict):\n        h = dict(h)\n    return h", "entry_point": "extract_header", "input": "''", "output": "{}", "source": "code_search_net", "source_repo": "code-search-net/code_search_net", "source_revision": "bd0cf261e357a3eb5c8fba490d23ec1a1cd59555", "source_file": "python/test-00000-of-00001.parquet", "source_id": "https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L190-L207", "provenance_class": "collected", "licence": "unknown"}
{"id": "the_vault/0037582", "code": "def add(numbers):\n    the_sum = 0\n    for number in numbers:\n        the_sum += int(number) \n    return the_sum", "entry_point": "add", "input": "[]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "tiny-mouse/prove-it/calc/calculator.py#add", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037583", "code": "def divide(numbers):\n    result = numbers[0]\n    for number in numbers[1:]:\n        result /= number\n    return result", "entry_point": "divide", "input": "[5, 3, 1, 4]", "output": "0.4166666666666667", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "tiny-mouse/prove-it/calc/calculator.py#divide", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037584", "code": "def exponent(numbers):\n    result = numbers[0]\n    for number in numbers[1:]:\n        result *= number\n    return result", "entry_point": "exponent", "input": "[5, 3, 1, 4]", "output": "60", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "tiny-mouse/prove-it/calc/calculator.py#exponent", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037585", "code": "def copy_state_dict(state_dict_1, state_dict_2):\n    state1_keys = list(state_dict_1.keys())\n    state2_keys = list(state_dict_2.keys())\n    for x in range(len(state1_keys)):\n        state_dict_2[state2_keys[x]] = state_dict_1[state1_keys[x]]\n    return state_dict_2", "entry_point": "copy_state_dict", "input": "{}, {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "possoj/Mobile-URSONet/src/my_mobile_ursonet.py#copy_state_dict", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037586", "code": "def is_palindrome(n):\n    number_original = list(map(int, str(n)))\n    number_reversed = number_original[:]\n    number_reversed.reverse()\n    return number_original == number_reversed", "entry_point": "is_palindrome", "input": "2", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vegadodo/project-euler-python/p004.py#is_palindrome", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037587", "code": "def is_prod_of_two_3_digit_num(n):\n    result = False\n    for i in range(100, 1000):\n        if n % i == 0 and n // i in range(100, 1000):\n            result = True\n            break\n    return result", "entry_point": "is_prod_of_two_3_digit_num", "input": "False", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vegadodo/project-euler-python/p004.py#is_prod_of_two_3_digit_num", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037588", "code": "def is_prime(n):\n    result = True\n    for i in range(n - 1, 2, -1):\n        if n % i == 0:\n            result = False\n            break\n    return result", "entry_point": "is_prime", "input": "True", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vegadodo/project-euler-python/p003.py#is_prime", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037589", "code": "def step(slot):\n    texSlot = slot*16\n    return texSlot", "entry_point": "step", "input": "[1, 2, 3]", "output": "[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gpmidi/MCEdit-Unified/resource_packs.py#step", "provenance_class": "collected", "licence": "0bsd"}
{"id": "the_vault/0037590", "code": "def size_of(value):\n        for unit in ['', 'Ki', 'Mi']:\n            if abs(value) < 1024.0:\n                return \"%3.1f %s%s\" % (value, unit, 'B')\n            value = value / 1024.0\n        return \"%.1f%s%s\" % (value, 'Yi', 'B')", "entry_point": "size_of", "input": "0.5", "output": "'0.5 B'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "open-power-sdk/power-simulator/mambo/core.py#size_of", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037591", "code": "def _get_expected_code(expected_failure, version, success_status_code):\n    if not expected_failure:\n        return success_status_code\n    return expected_failure[version]", "entry_point": "_get_expected_code", "input": "{}, ('a', 'b', 'c'), {'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': []}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "cuisongliu/quay/test/registry_tests.py#_get_expected_code", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037592", "code": "def has_deformables(task):\n    return ('cable-' in task) or ('cloth' in task) or ('bag' in task)", "entry_point": "has_deformables", "input": "['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gautams3/deformable-ravens/main.py#has_deformables", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037593", "code": "def convert_empty_cells(view):\n        for x in range(len(view)):\n            for y in range(len(view[0])):\n                view[x, y] = b\" \" if view[x, y] == b\"0\" else view[x, y]\n        return view", "entry_point": "convert_empty_cells", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "eugenevinitsky/sequential_social_dilemma_games/tests/test_envs.py#convert_empty_cells", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037594", "code": "def GetPlistFriendlyName(name):\n  return name.replace(' ', '_')", "entry_point": "GetPlistFriendlyName", "input": "'walnut thistle harbour'", "output": "'walnut_thistle_harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/components/policy/tools/template_writers/writers/plist_helper.py#GetPlistFriendlyName", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037595", "code": "def _ParseImports(imports):\n  import_dict = {}\n  for import_ in imports:\n    if import_.static:\n      continue\n    assert not import_.wildcard\n    name = import_.path.split('.')[-1]\n    import_dict[name] = import_.path\n  return import_dict", "entry_point": "_ParseImports", "input": "[]", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/chrome/android/features/create_stripped_java_factory.py#_ParseImports", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037596", "code": "def _FilterAndFormatImports(import_dict, signature_types):\n  formatted_imports = [\n      'import %s;' % import_dict[t] for t in signature_types if t in import_dict\n  ]\n  return sorted(formatted_imports)", "entry_point": "_FilterAndFormatImports", "input": "{'x': [1, 2], 'y': []}, [-1, 0, 1, 2]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/chrome/android/features/create_stripped_java_factory.py#_FilterAndFormatImports", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037597", "code": "def recent_mstones(mstone):\n  return [mstone - 1, mstone]", "entry_point": "recent_mstones", "input": "True", "output": "[0, True]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/flags/generate_unexpire_flags.py#recent_mstones", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037598", "code": "def _IsValidPrimaryOwnerEmail(owner_tag_text):\n  if '-' in owner_tag_text:  \n    return False\n  return (owner_tag_text.endswith('@chromium.org')\n          or owner_tag_text.endswith('@google.com'))", "entry_point": "_IsValidPrimaryOwnerEmail", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/metrics/histograms/expand_owners.py#_IsValidPrimaryOwnerEmail", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037599", "code": "def FeatureNameToConstantName(feature_name):\n  return ('k' + ''.join(word[0].upper() + word[1:]\n      for word in feature_name.replace('.', ' ').split()))", "entry_point": "FeatureNameToConstantName", "input": "'abc'", "output": "'kAbc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/json_schema_compiler/cpp_util.py#FeatureNameToConstantName", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037600", "code": "def IsUnixName(s):\n  return all(x.islower() or x == '_' for x in s) and '_' in s", "entry_point": "IsUnixName", "input": "['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/json_schema_compiler/cpp_util.py#IsUnixName", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037601", "code": "def join_labels(dafsa):\n  parentcount = { id(None): 2 }\n  nodemap = { id(None): None }\n  def count_parents(node):\n    if id(node) in parentcount:\n      parentcount[id(node)] += 1\n    else:\n      parentcount[id(node)] = 1\n      for child in node[1]:\n        count_parents(child)\n  def join(node):\n    if id(node) not in nodemap:\n      children = [join(child) for child in node[1]]\n      if len(children) == 1 and parentcount[id(node[1][0])] == 1:\n        child = children[0]\n        nodemap[id(node)] = (node[0] + child[0], child[1])\n      else:\n        nodemap[id(node)] = (node[0], children)\n    return nodemap[id(node)]\n  for node in dafsa:\n    count_parents(node)\n  return [join(node) for node in dafsa]", "entry_point": "join_labels", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/media_engagement_preload/make_dafsa.py#join_labels", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037602", "code": "def top_sort(dafsa):\n  incoming = {}\n  def count_incoming(node):\n    if node:\n      if id(node) not in incoming:\n        incoming[id(node)] = 1\n        for child in node[1]:\n          count_incoming(child)\n      else:\n        incoming[id(node)] += 1\n  for node in dafsa:\n    count_incoming(node)\n  for node in dafsa:\n    incoming[id(node)] -= 1\n  waiting = [node for node in dafsa if incoming[id(node)] == 0]\n  nodes = []\n  while waiting:\n    node = waiting.pop()\n    assert incoming[id(node)] == 0\n    nodes.append(node)\n    for child in node[1]:\n      if child:\n        incoming[id(child)] -= 1\n        if incoming[id(child)] == 0:\n          waiting.append(child)\n  return nodes", "entry_point": "top_sort", "input": "{}", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/media_engagement_preload/make_dafsa.py#top_sort", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037603", "code": "def encode_prefix(label):\n  assert label\n  return [ord(c) for c in reversed(label)]", "entry_point": "encode_prefix", "input": "['a', 'b', 'c']", "output": "[99, 98, 97]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/media_engagement_preload/make_dafsa.py#encode_prefix", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037604", "code": "def calculate_error(k_means_matrix):\n    return sum([min(dist) for dist in k_means_matrix])", "entry_point": "calculate_error", "input": "[]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/renderer/build/scripts/cluster.py#calculate_error", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037605", "code": "def FillInParameter(parameter, func, template):\n    result = template\n    while parameter in result:\n        result = result.replace(parameter, func(), 1)\n    return result", "entry_point": "FillInParameter", "input": "[-1, 0, 1, 2], [], [-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/fuzzer_helpers.py#FillInParameter", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037606", "code": "def _BuildBrowserArgs(user_data_dir, extra_browser_args, variations_args):\n  browser_args = [\n    '--no-first-run',\n    '--no-default-browser-check',\n    '--user-data-dir=%s' % user_data_dir,\n  ]\n  browser_args.extend(extra_browser_args)\n  browser_args.extend(variations_args)\n  return browser_args", "entry_point": "_BuildBrowserArgs", "input": "[5, 3, 1, 4], [[1, 2], [3], []], [5, 3, 1, 4]", "output": "['--no-first-run', '--no-default-browser-check', '--user-data-dir=[5, 3, 1, 4]', [1, 2], [3], [], 5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/variations/bisect_variations.py#_BuildBrowserArgs", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037607", "code": "def ElfHash(name):\n  h = 0\n  for c in name:\n    h = (h << 4) + ord(c)\n    g = h & 0xf0000000\n    h ^= g\n    h ^= g >> 24\n  return h & 0xffffffff", "entry_point": "ElfHash", "input": "'abc'", "output": "26499", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/android_crazy_linker/src/tests/generate_test_elf_hash_tables.py#ElfHash", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037608", "code": "def is_disallowed_ini(filename):\n    if not filename.endswith('.ini'):\n        return False\n    allowed_inis = [\n        'mypy.ini',\n        'py27-flake8.ini',\n        'py3-flake8.ini',\n        'pytest.ini',\n        'tox.ini',\n        'wptrunner.default.ini',\n    ]\n    return filename not in allowed_inis", "entry_point": "is_disallowed_ini", "input": "'abc'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/tools/blinkpy/w3c/common.py#is_disallowed_ini", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037609", "code": "def GnuHash(name):\n  h = 5381\n  for c in name:\n    h = (h * 33 + ord(c)) & 0xffffffff\n  return h", "entry_point": "GnuHash", "input": "'Hello World'", "output": "2272792705", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/android_crazy_linker/src/tests/generate_test_gnu_hash_tables.py#GnuHash", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037610", "code": "def keep_never_expires(flags):\n  return [f for f in flags if f['expiry_milestone'] == -1]", "entry_point": "keep_never_expires", "input": "{}", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/flags/list_flags.py#keep_never_expires", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037611", "code": "def is_cpp_string(line):\n    line = line.replace(r'\\\\', 'XX')  \n    return (\n        (line.count('\"') - line.count(r'\\\"') - line.count(\"'\\\"'\")) & 1) == 1", "entry_point": "is_cpp_string", "input": "'  padded  '", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/tools/blinkpy/style/checkers/cpp.py#is_cpp_string", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037612", "code": "def GetBaseResourceId(resource_id):\n  suffixes = [\n      '_TOP_LEFT', '_TOP', '_TOP_RIGHT',\n      '_LEFT', '_CENTER', '_RIGHT',\n      '_BOTTOM_LEFT', '_BOTTOM', '_BOTTOM_RIGHT',\n      '_TL', '_T', '_TR',\n      '_L', '_M', '_R',\n      '_BL', '_B', '_BR']\n  for suffix in suffixes:\n    if resource_id.endswith(suffix):\n      resource_id = resource_id[:-len(suffix)]\n  return resource_id", "entry_point": "GetBaseResourceId", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/resources/find_unused_resources.py#GetBaseResourceId", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037613", "code": "def format_remove_duplicates(text, patterns):\n    pattern_founds = [False] * len(patterns)\n    output = []\n    for line in text.split('\\n'):\n        to_be_removed = False\n        for i, pattern in enumerate(patterns):\n            if pattern not in line:\n                continue\n            if pattern_founds[i]:\n                to_be_removed = True\n            else:\n                pattern_founds[i] = True\n        if to_be_removed:\n            continue\n        output.append(line)\n    if output:\n        output.append('')\n    return '\\n'.join(output)", "entry_point": "format_remove_duplicates", "input": "'  padded  ', ['a', 'b', 'c']", "output": "'  padded  \\n'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/renderer/bindings/scripts/utilities.py#format_remove_duplicates", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037614", "code": "def read_netrc_user(netrc_obj, host):\n  if not netrc_obj:\n    return ''\n  entry = netrc_obj.authenticators(host)\n  if not entry:\n    return ''\n  return entry[0]", "entry_point": "read_netrc_user", "input": "[], [1, 2, 3]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/check_git_config.py#read_netrc_user", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037615", "code": "def LastLineLength(s):\n  if s.rfind('\\n') == -1:\n    return len(s)\n  return len(s) - s.rfind('\\n') - len('\\n')", "entry_point": "LastLineLength", "input": "'walnut thistle harbour'", "output": "22", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/metrics/common/pretty_print_xml.py#LastLineLength", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037616", "code": "def _compute_toplevel_target(target: str) -> str:\n    if target.endswith('_java'):\n      return target\n    index = target.find('_java__subjar')\n    if index >= 0:\n      return target[0:index + 5]\n    index = target.find('_java__classes')\n    if index >= 0:\n      return target[0:index + 5]\n    return target", "entry_point": "_compute_toplevel_target", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/modularization/convenience/lookup_dep.py#_compute_toplevel_target", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037617", "code": "def _StripApiName(api_name):\n  if api_name.endswith('Trusted'):\n    api_name = api_name[:-len('Trusted')]\n  if api_name.endswith('_Dev'):\n    api_name = api_name[:-len('_Dev')]\n  if api_name.endswith('_Private'):\n    api_name = api_name[:-len('_Private')]\n  return api_name", "entry_point": "_StripApiName", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/ppapi/generators/idl_thunk.py#_StripApiName", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037618", "code": "def buildDefDictionary(definitions):\n  defs = {}\n  for d in definitions:\n    (key, val) = d.split('=')\n    defs[key] = val\n  return defs", "entry_point": "buildDefDictionary", "input": "()", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/remoting/host/installer/build-installer-archive.py#buildDefDictionary", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037619", "code": "def GetConstantName(name):\n  return 'kPlatform' + name.capitalize()", "entry_point": "GetConstantName", "input": "'walnut thistle harbour'", "output": "'kPlatformWalnut thistle harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/ui/ozone/generate_ozone_platform_list.py#GetConstantName", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037620", "code": "def ClusterBy(objs, pred):\n  clusters = {}\n  for obj in objs:\n    cluster = pred(obj)\n    clusters[cluster] = clusters.get(cluster, [])\n    clusters[cluster].append(obj)\n  return clusters", "entry_point": "ClusterBy", "input": "[], ['apple', 'banana', 'cherry']", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/chrome/tools/history-viz.py#ClusterBy", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037621", "code": "def GetCppPtrType(interface_name):\n  if not interface_name:\n    return 'void*'\n  return 'struct ' + interface_name + '*'", "entry_point": "GetCppPtrType", "input": "'a,b,c'", "output": "'struct a,b,c*'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/components/exo/wayland/fuzzer/wayland_templater.py#GetCppPtrType", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037622", "code": "def _DetectLto(lines):\n  found_indicator_section = False\n  indicator_section_set = set(['.rodata', '.ARM.exidx'])\n  start_pos = -1\n  for line in lines:\n    if start_pos < 0:\n      start_pos = line.index('.')\n    if len(line) < start_pos:\n      continue\n    line = line[start_pos:]\n    tok = line.lstrip()  \n    indent_size = len(line) - len(tok)\n    if indent_size == 0:  \n      if found_indicator_section:  \n        break\n      if tok.strip() in indicator_section_set:\n        found_indicator_section = True\n    elif indent_size == 8:\n      if found_indicator_section:\n        if tok.startswith('thinlto-cache'):\n          return True\n  return False", "entry_point": "_DetectLto", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/binary_size/libsupersize/linker_map_parser.py#_DetectLto", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037623", "code": "def FormatResources(resources):\n  return '\\n'.join(['%-12s %s' % (t, n) for t, n in sorted(resources)])", "entry_point": "FormatResources", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/find_unused_resources.py#FormatResources", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037624", "code": "def is_ident(s: str) -> bool:\n  return all(c.isalnum() or c == '_' for c in s)", "entry_point": "is_ident", "input": "['apple', 'banana', 'cherry']", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/disable_tests/gtest.py#is_ident", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037625", "code": "def _ConvertFromTestGroupingToConfigGrouping(string_map):\n  converted_map = {}\n  for suite, test_map in string_map.items():\n    for test, tag_map in test_map.items():\n      for typ_tags, build_urls in tag_map.items():\n        converted_map.setdefault(typ_tags, {}).setdefault(suite,\n                                                          {})[test] = build_urls\n  return converted_map", "entry_point": "_ConvertFromTestGroupingToConfigGrouping", "input": "{}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/content/test/gpu/flake_suppressor/result_output.py#_ConvertFromTestGroupingToConfigGrouping", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037626", "code": "def IsActionPresent(current_actions, metric_name, is_boolean):\n  if not is_boolean:\n    action = 'name=\"{0}\"'.format(metric_name)\n    return action in current_actions\n  action_disabled = 'name=\"{0}_Disable\"'.format(metric_name)\n  action_enabled = 'name=\"{0}_Enable\"'.format(metric_name)\n  return (action_disabled in current_actions and\n      action_enabled in current_actions)", "entry_point": "IsActionPresent", "input": "['apple', 'banana', 'cherry'], 'walnut thistle harbour', ['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/chrome/browser/resources/PRESUBMIT.py#IsActionPresent", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037627", "code": "def to_devtools_enum_format(permissions_policy_name):\n            return ''.join([\n                name.capitalize()\n                for name in permissions_policy_name.split('-')\n            ])", "entry_point": "to_devtools_enum_format", "input": "'AbC dEf'", "output": "'Abc def'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/renderer/build/scripts/make_policy_helper.py#to_devtools_enum_format", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037628", "code": "def _CheckForHashCollisions(sorted_resource_list):\n  collisions = set()\n  for i in range(len(sorted_resource_list) - 1):\n    resource = sorted_resource_list[i]\n    next_resource = sorted_resource_list[i+1]\n    if resource.hash == next_resource.hash:\n      collisions.add(resource)\n      collisions.add(next_resource)\n  return collisions", "entry_point": "_CheckForHashCollisions", "input": "[]", "output": "set()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/components/variations/service/generate_ui_string_overrider.py#_CheckForHashCollisions", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037629", "code": "def _GenerateNamespacePrefixAndSuffix(namespace):\n  if not namespace:\n    return \"\", \"\"\n  return \"namespace %s {\\n\\n\" % namespace, \"\\n}  // namespace %s\\n\" % namespace", "entry_point": "_GenerateNamespacePrefixAndSuffix", "input": "'a,b,c'", "output": "('namespace a,b,c {\\n\\n', '\\n}  // namespace a,b,c\\n')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/components/variations/service/generate_ui_string_overrider.py#_GenerateNamespacePrefixAndSuffix", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037630", "code": "def StripSo(name):\n  if '.' in name:\n    stripped_name, ext = name.rsplit('.', 1)\n    if stripped_name.endswith('.so') and len(ext) > 1:\n      return stripped_name\n  return name", "entry_point": "StripSo", "input": "'Hello World'", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/native_client_sdk/src/tools/tests/create_nmf_test.py#StripSo", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037631", "code": "def filter_out_exact_negative_matches(tests, negative_matches):\n    filter_set = set(fil[1:] for fil in negative_matches)\n    return [test for test in tests if test not in filter_set]", "entry_point": "filter_out_exact_negative_matches", "input": "['a', 'b', 'c'], ['apple', 'banana', 'cherry']", "output": "['a', 'b', 'c']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/blink/tools/blinkpy/web_tests/controllers/web_test_finder.py#filter_out_exact_negative_matches", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037632", "code": "def __FindPidsForSnapshotList(snapshots):\n    pids = set()\n    for snapshot in snapshots:\n      for (userid, pid, name) in snapshot.GetPidInfo():\n        pids.add((userid, pid, name))\n    return pids", "entry_point": "__FindPidsForSnapshotList", "input": "''", "output": "set()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/appstats.py#__FindPidsForSnapshotList", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037633", "code": "def __PadString(string, length, left_align):\n    return (('%' if left_align else '%-') + str(length) + 's') % string", "entry_point": "__PadString", "input": "'AbC dEf', 3, []", "output": "'AbC dEf'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/appstats.py#__PadString", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037634", "code": "def __GetDiffColor(delta):\n    if not delta or delta == 0.0:\n      return 'GREY30'\n    elif delta < 0:\n      return 'GREEN'\n    elif delta > 0:\n      return 'RED'", "entry_point": "__GetDiffColor", "input": "[]", "output": "'GREY30'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/appstats.py#__GetDiffColor", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037635", "code": "def UnitStringIsValid(unit: str) -> bool:\n  accepted_units = [\n      \"us/hop\", \"us/task\", \"ns/sample\", \"ms\", \"s\", \"count\", \"KB\", \"MB/s\", \"us\"\n  ]\n  return unit in accepted_units", "entry_point": "UnitStringIsValid", "input": "[]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/fuchsia/comparative_tester/test_results.py#UnitStringIsValid", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037636", "code": "def _FindFeaturesOverriddenByArgs(args):\n  overridden_features = []\n  for arg in args:\n    if (arg.startswith('--enable-features=')\n        or arg.startswith('--disable-features=')):\n      _, _, arg_val = arg.partition('=')\n      overridden_features.extend(arg_val.split(','))\n  return [f.split('<')[0] for f in overridden_features]", "entry_point": "_FindFeaturesOverriddenByArgs", "input": "['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/variations/fieldtrial_util.py#_FindFeaturesOverriddenByArgs", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037637", "code": "def MergeFeaturesAndFieldTrialsArgs(args):\n  merged_args = []\n  disable_features = set()\n  enable_features = set()\n  force_fieldtrials = set()\n  force_fieldtrial_params = set()\n  for arg in args:\n    if arg.startswith('--disable-features='):\n      disable_features.update(arg.split('=', 1)[1].split(','))\n    elif arg.startswith('--enable-features='):\n      enable_features.update(arg.split('=', 1)[1].split(','))\n    elif arg.startswith('--force-fieldtrials='):\n      force_fieldtrials.add(arg.split('=', 1)[1].rstrip('/'))\n    elif arg.startswith('--force-fieldtrial-params='):\n      force_fieldtrial_params.update(arg.split('=', 1)[1].split(','))\n    else:\n      merged_args.append(arg)\n  if disable_features:\n    merged_args.append('--disable-features=%s' % ','.join(\n        sorted(disable_features)))\n  if enable_features:\n    merged_args.append('--enable-features=%s' % ','.join(\n        sorted(enable_features)))\n  if force_fieldtrials:\n    merged_args.append('--force-fieldtrials=%s' % '/'.join(\n        sorted(force_fieldtrials)))\n  if force_fieldtrial_params:\n    merged_args.append('--force-fieldtrial-params=%s' % ','.join(\n        sorted(force_fieldtrial_params)))\n  return merged_args", "entry_point": "MergeFeaturesAndFieldTrialsArgs", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/variations/fieldtrial_util.py#MergeFeaturesAndFieldTrialsArgs", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037638", "code": "def filter_image_only(f):\n  if f.endswith('png'):\n    return True\n  return False", "entry_point": "filter_image_only", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/chrome/test/data/android/upload_download_utils_test.py#filter_image_only", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037639", "code": "def GetTypedefName(typename):\n  return typename + 'Constructor'", "entry_point": "GetTypedefName", "input": "'  padded  '", "output": "'  padded  Constructor'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/ui/ozone/generate_constructor_list.py#GetTypedefName", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037640", "code": "def _JSONToCString16(json_string_literal):\n  c_string_literal = json_string_literal\n  escape_index = c_string_literal.find('\\\\')\n  while escape_index > 0:\n    if c_string_literal[escape_index + 1] == 'u':\n      c_string_literal = (c_string_literal[0:escape_index + 1] + 'x' +\n          c_string_literal[escape_index + 2:escape_index + 6] + '\" L\"' +\n          c_string_literal[escape_index + 6:])\n    escape_index = c_string_literal.find('\\\\', escape_index + 6)\n  return c_string_literal", "entry_point": "_JSONToCString16", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/json_to_struct/element_generator.py#_JSONToCString16", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037641", "code": "def _CreateOdexLine(java_class_name, type_idx, verification_status):\n  return ('{type_idx}: L{java_class}; (offset=0xac) (type_idx={type_idx}) '\n          '({verification}) '\n          '(OatClassNoneCompiled)'.format(type_idx=type_idx,\n                                          java_class=java_class_name,\n                                          verification=verification_status))", "entry_point": "_CreateOdexLine", "input": "'AbC dEf', 0, [-1, 0, 1, 2]", "output": "'0: LAbC dEf; (offset=0xac) (type_idx=0) ([-1, 0, 1, 2]) (OatClassNoneCompiled)'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/build/android/list_class_verification_failures_test.py#_CreateOdexLine", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037642", "code": "def _StripPC(addr, cpu_arch):\n  if cpu_arch == \"arm\":\n    return addr & ~1\n  return addr", "entry_point": "_StripPC", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/android_platform/development/scripts/symbol.py#_StripPC", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037643", "code": "def GenerateStringTable(symbol_names):\n  symbol_offsets = []\n  string_table = \"\\0\"\n  next_offset = 1\n  for symbol in symbol_names:\n    symbol_offsets.append(next_offset)\n    string_table += symbol\n    string_table += \"\\0\"\n    next_offset += len(symbol) + 1\n  string_table += \"\\0\"\n  return string_table, symbol_offsets", "entry_point": "GenerateStringTable", "input": "'Hello World'", "output": "('\\x00H\\x00e\\x00l\\x00l\\x00o\\x00 \\x00W\\x00o\\x00r\\x00l\\x00d\\x00\\x00', [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/third_party/android_crazy_linker/src/tests/pylib/elf_utils.py#GenerateStringTable", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037644", "code": "def _GetResidentPagesJSON(pages_list):\n  json_data = []\n  for i in range(len(pages_list)):\n    json_data.append({'page_num': i, 'resident': pages_list[i]})\n  return json_data", "entry_point": "_GetResidentPagesJSON", "input": "['apple', 'banana', 'cherry']", "output": "[{'page_num': 0, 'resident': 'apple'}, {'page_num': 1, 'resident': 'banana'}, {'page_num': 2, 'resident': 'cherry'}]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/native_lib_memory/extract_resident_pages.py#_GetResidentPagesJSON", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037645", "code": "def _BuildForceFieldTrialsSwitchValue(trials):\n  return ''.join('%s%s/%s/' % (\n    '*' if trial.star else '',\n    trial.trial_name,\n    trial.group_name\n  ) for trial in trials)", "entry_point": "_BuildForceFieldTrialsSwitchValue", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/variations/split_variations_cmd.py#_BuildForceFieldTrialsSwitchValue", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037646", "code": "def _BuildForceFieldTrialParamsSwitchValue(trials):\n  return ','.join('%s.%s:%s' % (\n    trial.trial_name,\n    trial.group_name,\n    '/'.join('%s/%s' % (param.key, param.value) for param in trial.params),\n  ) for trial in trials)", "entry_point": "_BuildForceFieldTrialParamsSwitchValue", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/variations/split_variations_cmd.py#_BuildForceFieldTrialParamsSwitchValue", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037647", "code": "def _SplitFeatures(features):\n  middle = (len(features) + 1) // 2\n  return features[:middle], features[middle:]", "entry_point": "_SplitFeatures", "input": "[-1, 0, 1, 2]", "output": "([-1, 0], [1, 2])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/variations/split_variations_cmd.py#_SplitFeatures", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037648", "code": "def _FindParameterListParen(name):\n  start_idx = 0\n  template_balance_count = 0\n  paren_balance_count = 0\n  while True:\n    idx = name.find('(', start_idx)\n    if idx == -1:\n      return -1\n    template_balance_count += (\n        name.count('<', start_idx, idx) - name.count('>', start_idx, idx))\n    operator_idx = name.find('operator<', start_idx, idx)\n    if operator_idx != -1:\n      if name[operator_idx + 9] == '<':\n        template_balance_count -= 2\n      else:\n        template_balance_count -= 1\n    else:\n      operator_idx = name.find('operator>', start_idx, idx)\n      if operator_idx != -1:\n        if name[operator_idx + 9] == '>':\n          template_balance_count += 2\n        else:\n          template_balance_count += 1\n    paren_balance_count += (\n        name.count('(', start_idx, idx) - name.count(')', start_idx, idx))\n    if template_balance_count == 0 and paren_balance_count == 0:\n      if -1 != name.find('(anonymous namespace)', idx, idx + 21):\n        start_idx = idx + 21\n        continue\n      if name[idx - 1] != ' ' and name[idx - 7:idx] != '{lambda':\n        return idx\n    start_idx = idx + 1\n    paren_balance_count += 1", "entry_point": "_FindParameterListParen", "input": "'walnut thistle harbour'", "output": "-1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/binary_size/libsupersize/function_signature.py#_FindParameterListParen", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037649", "code": "def ParseJava(full_name):\n  hash_idx = full_name.find('#')\n  if hash_idx != -1:\n    full_new_class_name = full_name[:hash_idx]\n    colon_idx = full_name.find(':')\n    if colon_idx == -1:\n      member = full_name[hash_idx + 1:]\n      member_type = ''\n    else:\n      member = full_name[hash_idx + 1:colon_idx]\n      member_type = full_name[colon_idx:]\n  else:\n    parts = full_name.split(' ')\n    full_new_class_name = parts[0]\n    member = parts[-1] if len(parts) > 1 else None\n    member_type = '' if len(parts) < 3 else ': ' + parts[1]\n  if member is None:\n    short_class_name = full_new_class_name.split('.')[-1]\n    return full_name, full_name, short_class_name\n  full_name = '{}#{}{}'.format(full_new_class_name, member, member_type)\n  paren_idx = member.find('(')\n  if paren_idx != -1:\n    member = member[:paren_idx]\n  full_old_class_name = full_new_class_name\n  dot_idx = member.rfind('.')\n  if dot_idx != -1:\n    full_old_class_name = member[:dot_idx]\n    member = member[dot_idx + 1:]\n  short_class_name = full_old_class_name\n  dot_idx = full_old_class_name.rfind('.')\n  if dot_idx != -1:\n    short_class_name = short_class_name[dot_idx + 1:]\n  name = '{}#{}'.format(short_class_name, member)\n  template_name = '{}#{}'.format(full_old_class_name, member)\n  return full_name, template_name, name", "entry_point": "ParseJava", "input": "'  padded  '", "output": "('#: ', '#', '#')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/binary_size/libsupersize/function_signature.py#ParseJava", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037650", "code": "def class_is_interesting(name: str):\n    if name.startswith('org.chromium.'):\n        return True\n    return False", "entry_point": "class_is_interesting", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sunlongbo/chromium/tools/android/dependency_analysis/generate_json_dependency_graph.py#class_is_interesting", "provenance_class": "collected", "licence": "bsd-3-clause, bsd-3-clause-no-nuclear-license-2014"}
{"id": "the_vault/0037651", "code": "def durationToPoints(duration):\n    if duration < 15:\n        points = 0\n    else:\n        points = duration\n    return points", "entry_point": "durationToPoints", "input": "3.25", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "misson3/mobile-away/code.py#durationToPoints", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037652", "code": "def build_query(args_names, args_values) :\n    ret_str = ''\n    first = True\n    for (name, value) in zip(args_names, args_values) :\n        if value :\n            if first :\n                ret_str += '?'\n                first = False\n            else :\n                ret_str += '&'\n            ret_str += f'{name}={value}'\n    return ret_str", "entry_point": "build_query", "input": "'AbC dEf', [[1, 2], [3], []]", "output": "'?A=[1, 2]&b=[3]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "interlockledger/interlockledger-rest-client-python/il2_rest/util.py#build_query", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037653", "code": "def _ignore_line(line: str) -> bool:\n        return len(line) < 1 or line[0:7] == \"warning\" or \"report\" in line", "entry_point": "_ignore_line", "input": "'a,b,c'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "allen-cell-animated/simularium-conversion/simulariumio/cytosim/cytosim_converter.py#_ignore_line", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037654", "code": "def _bypass_kwarg_validation(value):\n    return True", "entry_point": "_bypass_kwarg_validation", "input": "[-1, 0, 1, 2]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shepherdpp/qteasy/qteasy/_arg_validators.py#_bypass_kwarg_validation", "provenance_class": "collected", "licence": "cc0-1.0"}
{"id": "the_vault/0037655", "code": "def is_image_file(filename):\n    return any(filename.endswith(extension) for extension in ['.bmp', '.png', '.jpg', '.jpeg', '.JPG', '.JPEG', '.PNG'])", "entry_point": "is_image_file", "input": "'a,b,c'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "niazwazir/WAZIR_ESPCN1/source/utils.py#is_image_file", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037656", "code": "def is_video_file(filename):\n    return any(filename.endswith(extension) for extension in ['.mp4', '.avi', '.mpg', '.mkv', '.wmv', '.flv'])", "entry_point": "is_video_file", "input": "'a,b,c'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "niazwazir/WAZIR_ESPCN1/source/utils.py#is_video_file", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037657", "code": "def convert_rgb_to_y(img, dim_order='hwc'):\n    if dim_order == 'hwc':\n        return 16. + (64.738 * img[..., 0] + 129.057 * img[..., 1] + 25.064 * img[..., 2]) / 256.\n    else:\n        return 16. + (64.738 * img[0] + 129.057 * img[1] + 25.064 * img[2]) / 256.", "entry_point": "convert_rgb_to_y", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "18.87470703125", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "niazwazir/WAZIR_ESPCN1/source/utils.py#convert_rgb_to_y", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037658", "code": "def _ids_to_lineup(player_ids, user_team):\n    return [next(player for player in user_team\n                 if player[\"element\"] == player_id)\n            for player_id in player_ids]", "entry_point": "_ids_to_lineup", "input": "[], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "ido222/fpl/fpl/models/user.py#_ids_to_lineup", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037659", "code": "def __bytes_to_mac_addr(addr: bytes) -> str:\n        return ':'.join(format(octet, '02x') for octet in addr)", "entry_point": "__bytes_to_mac_addr", "input": "[1, 2, 3]", "output": "'01:02:03'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "HectorTa1989/HecPy3-ARP-Cache-Poisoning-Tool/packets.py#__bytes_to_mac_addr", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037660", "code": "def convert_position_to_conventional_format(position):\n    [r, c] = [position // 8 + 1, position % 8]\n    return \"abcdefgh\"[c] + str(r)", "entry_point": "convert_position_to_conventional_format", "input": "10", "output": "'c2'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "tobiascr/chess/engine.py#convert_position_to_conventional_format", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037661", "code": "def is_fixture(fixture_fun  \n               ):\n    try:\n        fixture_fun._pytestfixturefunction  \n        return True\n    except AttributeError:\n        return False", "entry_point": "is_fixture", "input": "[-1, 0, 1, 2]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "chinghwayu/python-pytest-cases/pytest_cases/common_pytest.py#is_fixture", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037662", "code": "def combine_ids(paramid_tuples):\n    return ['-'.join(pid for pid in testid) for testid in paramid_tuples]", "entry_point": "combine_ids", "input": "['apple', 'banana', 'cherry']", "output": "['a-p-p-l-e', 'b-a-n-a-n-a', 'c-h-e-r-r-y']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "chinghwayu/python-pytest-cases/pytest_cases/common_pytest.py#combine_ids", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037663", "code": "def calculate_tax(income):\n    tax = 0\n    if income <= 50000:\n        tax += (income *.15)\n        return tax\n    elif income >= 50000 and income <= 75000:\n        tax += (income * .25)\n        return tax\n    elif income >= 75000 and income <= 100000:\n        tax += (income * .30)\n        return tax\n    elif income >= 100000:\n        tax += (income * .35)\n        return tax", "entry_point": "calculate_tax", "input": "True", "output": "0.15", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Bhekinkosi12/quiz-itp-w1/main.py#calculate_tax", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037664", "code": "def _validate_kv(kv):\n    if len(kv) == 2 and \"\" not in kv:\n        return True\n    return False", "entry_point": "_validate_kv", "input": "[1, 2, 3]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "theletterf/collectd-spark/spark_plugin.py#_validate_kv", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037665", "code": "def _translate_ip_xml_json(ip):\n    ip = dict(ip)\n    version = ip.get('version')\n    if version:\n        ip['version'] = int(version)\n    if ip.get('type'):\n        ip['type'] = ip.get('type')\n    if ip.get('mac_addr'):\n        ip['mac_addr'] = ip.get('mac_addr')\n    return ip", "entry_point": "_translate_ip_xml_json", "input": "[]", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "BeenzSyed/tempest/tempest/services/compute/v3/xml/servers_client.py#_translate_ip_xml_json", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037666", "code": "def import_packages_local(interface):\n        return (\n            \"import vip_bd_\" + str(interface.index) + \"_axi_vip_0_0_pkg::*;\\n\"\n        )", "entry_point": "import_packages_local", "input": "[1, 2, 3]", "output": "'import vip_bd_<built-in method index of list object at 0x7f6b91a93b40>_axi_vip_0_0_pkg::*;\\n'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/sonar/interfaces/axi4_lite_slave.py#import_packages_local", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037667", "code": "def initial_blocks(indent):\n        prologue = (\n            indent\n            + '$$agent = new(\"master vip agent\", vip_bd_$$index_i.axi_vip_0.inst.IF);\\n'\n        )\n        prologue += indent + '$$agent.set_agent_tag(\"$$agent\");\\n'\n        prologue += indent + \"$$agent.start_master();\\n\"\n        return [prologue]", "entry_point": "initial_blocks", "input": "'AbC dEf'", "output": "['AbC dEf$$agent = new(\"master vip agent\", vip_bd_$$index_i.axi_vip_0.inst.IF);\\nAbC dEf$$agent.set_agent_tag(\"$$agent\");\\nAbC dEf$$agent.start_master();\\n']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/sonar/interfaces/axi4_lite_slave.py#initial_blocks", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037668", "code": "def count_commands(commands):\n    sv_commands = [\n        \"delay\",\n        \"wait\",\n        \"signal\",\n        \"end\",\n        \"timestamp\",\n        \"display\",\n        \"flag\",\n    ]\n    count = 0\n    for command in commands:\n        for sv_command in sv_commands:\n            if sv_command in command:\n                count += 1\n                break\n            if \"interface\" in command:\n                count += len(command[\"interface\"][\"payload\"])\n                break\n            if \"macro\" in command and command[\"macro\"] == \"INIT_SIGNALS\":\n                count += len(command[\"commands\"])\n                break\n            if \"macro\" in command and command[\"macro\"] == \"END\":\n                count += 1\n                break\n    return count", "entry_point": "count_commands", "input": "['apple', 'banana', 'cherry']", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/sonar/core/backends/sv.py#count_commands", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037669", "code": "def import_packages_local(_interface):\n        return \"\"", "entry_point": "import_packages_local", "input": "['apple', 'banana', 'cherry']", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/sonar/endpoints.py#import_packages_local", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037670", "code": "def initial_blocks(_indent):\n        return []", "entry_point": "initial_blocks", "input": "['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/sonar/endpoints.py#initial_blocks", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037671", "code": "def prologue(_indent):\n        return \"\"", "entry_point": "prologue", "input": "[1, 2, 3]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/sonar/endpoints.py#prologue", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037672", "code": "def mock_config(_path):\n    return {\"project\": {\"name\": \"valid\"}}", "entry_point": "mock_config", "input": "'Hello World'", "output": "{'project': {'name': 'valid'}}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sharm294/sonar/tests/unit_tests/test_database.py#mock_config", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037673", "code": "def remove_duplicates(list1):\n    result_list = []\n    for idx in range(len(list1)):\n        if idx == 0:\n            result_list.append(list1[idx])\n        else:\n            if list1[idx] == result_list[-1]:\n                pass\n            else:\n                result_list.append(list1[idx])\n    return result_list", "entry_point": "remove_duplicates", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Arthur-Lanc/coursera/python_data_scien/poc2/poc2_mini_proj_2.py#remove_duplicates", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037674", "code": "def merge(line):\n    line_t1 = []\n    for num in list(line):\n        if num != 0:\n            line_t1.append(num)\n    for dummy_num in range(len(line)-len(line_t1)):\n        line_t1.append(0)\n    line_t2 = []\n    idx = 0\n    while True:\n        if idx == len(line):\n            break\n        elif idx == len(line) - 1:\n            line_t2.append(line_t1[idx])\n            break\n        if line_t1[idx] == line_t1[idx+1]:\n            line_t2.append(line_t1[idx]*2)\n            idx += 2\n        else:\n            line_t2.append(line_t1[idx])\n            idx += 1\n    for dummy_num in range(len(line)-len(line_t2)):\n        line_t2.append(0)\n    return line_t2", "entry_point": "merge", "input": "'walnut thistle harbour'", "output": "['w', 'a', 'l', 'n', 'u', 't', ' ', 't', 'h', 'i', 's', 't', 'l', 'e', ' ', 'h', 'a', 'r', 'b', 'o', 'u', 'r']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Arthur-Lanc/coursera/python_data_scien/poc1/min_porj_1.py#merge", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037675", "code": "def score(hand):\n    max_score = 0\n    sorted_hand_list = sorted(list(set(hand)))\n    for i_mem in sorted_hand_list:\n        temp_score = 0\n        for j_mem in list(hand):\n            if i_mem == j_mem:\n                temp_score += i_mem\n        if temp_score > max_score:\n            max_score = temp_score\n    return max_score", "entry_point": "score", "input": "[-1, 0, 1, 2]", "output": "2", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Arthur-Lanc/coursera/python_data_scien/poc1/min_porj_4(Yahtzee).py#score", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037676", "code": "def line_cleansing(line):\n    return int.from_bytes(line.encode(), 'little')", "entry_point": "line_cleansing", "input": "'a,b,c'", "output": "425946393697", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "DataResponsibly/fairDAGs/utils.py#line_cleansing", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037677", "code": "def abs_val(num):\n    return -num if num < 0 else num", "entry_point": "abs_val", "input": "0", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "blaxii/Python/maths/abs.py#abs_val", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037678", "code": "def postprocess_transition(transition):\n        return transition", "entry_point": "postprocess_transition", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "TomaszOdrzygozdz/gym-splendor/alpaca/alpacka/agents/base.py#postprocess_transition", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037679", "code": "def bool_env(value: bool):\n    if value is True:\n        return \"true\"\n    else:\n        return \"false\"", "entry_point": "bool_env", "input": "['a', 'b', 'c']", "output": "'false'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "junqueira/aztk/aztk/utils/helpers.py#bool_env", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037680", "code": "def only_choice(values, unitlist):\n    for unit in unitlist:\n        for digit in '123456789':\n            loc = [box for box in unit if digit in values[box]]\n            if len(loc) == 1:\n                values[loc[0]] = digit\n    return values", "entry_point": "only_choice", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vinodkrishnabangalore/AIND-Sudoku/solution.py#only_choice", "provenance_class": "collected", "licence": "unlicense"}
{"id": "the_vault/0037681", "code": "def is_owner_of_doc(doc):\n    return True", "entry_point": "is_owner_of_doc", "input": "['a', 'b', 'c']", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "giantoak/unicorn/app/views.py#is_owner_of_doc", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037682", "code": "def _escape_for_windows(path):\n    return path.replace(\"\\\\\", \"\\\\\\\\\")", "entry_point": "_escape_for_windows", "input": "'abc'", "output": "'abc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "c6supper/grpc/third_party/android/android_configure.bzl#_escape_for_windows", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037683", "code": "def build_index(index_list):\n    idx = {}\n    vendor_idx = {}\n    for d in index_list:\n        min_version = d.get(\n            \"min_affected_version_excluding\", d.get(\"min_affected_version_including\")\n        )\n        max_version = d.get(\n            \"max_affected_version_excluding\", d.get(\"max_affected_version_including\")\n        )\n        if not min_version:\n            min_version = \"0\"\n        if not max_version:\n            max_version = \"*\"\n        ver_range_str = str(min_version) + \"-\" + str(max_version)\n        curr_list = idx.get(d[\"name\"], [])\n        curr_list.append(ver_range_str)\n        idx[d[\"name\"]] = curr_list\n        if d.get(\"vendor\"):\n            vendor_idx_key = d.get(\"vendor\") + \"|\" + d[\"name\"]\n            vendor_list = vendor_idx.get(vendor_idx_key, [])\n            vendor_list.append((ver_range_str))\n            vendor_idx[vendor_idx_key] = vendor_list\n    return idx, vendor_idx", "entry_point": "build_index", "input": "()", "output": "({}, {})", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mikejarrett/vulnerability-db/vdb/lib/db.py#build_index", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037684", "code": "def convert_md_references(md_text):\n    if not md_text:\n        return []\n    ref_list = []\n    md_text = md_text.replace(\"\\n\", \"\").strip()\n    for ref in md_text.split(\"- \"):\n        if not ref:\n            continue\n        parts = ref.split(\"](\")\n        if len(parts) == 2:\n            ref_list.append(\n                {\"name\": parts[0].replace(\"[\", \"\"), \"url\": parts[1].replace(\")\", \"\")}\n            )\n    return ref_list", "entry_point": "convert_md_references", "input": "'abc'", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mikejarrett/vulnerability-db/vdb/lib/utils.py#convert_md_references", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037685", "code": "def _makeTemplate(descriptors_dict):\n        template = {'data': []}\n        for key in descriptors_dict:\n            template['data'].append({'name': key, 'value': descriptors_dict[key]})\n        return {'template': template}", "entry_point": "_makeTemplate", "input": "{'a': 1, 'b': 2}", "output": "{'template': {'data': [{'name': 'a', 'value': 1}, {'name': 'b', 'value': 2}]}}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "FNNDSC/python-chrisstoreclient/chrisstoreclient/client.py#_makeTemplate", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037686", "code": "def balance_from_utxos(utxos):\n    balance = 0\n    if utxos:\n        balance = sum(utxo['value'] for utxo in utxos)\n    return balance", "entry_point": "balance_from_utxos", "input": "[]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "pallet-io/Pallet-API/oss_server/base/utils.py#balance_from_utxos", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037687", "code": "def _to_camelcase(input_string):\n    camel_string = ''\n    for i in range(len(input_string)):\n        if input_string[i] == '_':\n            pass\n        elif not camel_string:\n            camel_string += input_string[i].upper()\n        elif input_string[i-1] == '_':\n            camel_string += input_string[i].upper()\n        else:\n            camel_string += input_string[i]\n    return camel_string", "entry_point": "_to_camelcase", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "collectiveacuity/labPack/labpack/parsing/conversion.py#_to_camelcase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037688", "code": "def _to_python(input_string):\n    python_string = ''\n    for i in range(len(input_string)):\n        if not python_string:\n            python_string += input_string[i].lower()\n        elif input_string[i].isupper():\n            python_string += '_%s' % input_string[i].lower()\n        else:\n            python_string += input_string[i]\n    return python_string", "entry_point": "_to_python", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "collectiveacuity/labPack/labpack/parsing/conversion.py#_to_python", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037689", "code": "def split_up_digits(number):\n    new_str = \"\"\n    for char in number:\n        if len(new_str) != 0:\n            new_str += f\" {char}\"\n        else:\n            new_str = char\n    return new_str", "entry_point": "split_up_digits", "input": "[[1, 2], [3], []]", "output": "[1, 2, ' ', '[', '3', ']', ' ', '[', ']']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "egoetz/DNC-tensorflow/tasks/DREAM/cleaning.py#split_up_digits", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037690", "code": "def replace_word(word_array, dict_of_words_to_replace):\n    new_word_array = []\n    for word in word_array:\n        if word in dict_of_words_to_replace:\n            new_word_array.extend(dict_of_words_to_replace[word])\n        else:\n            new_word_array.append(word)\n    return new_word_array", "entry_point": "replace_word", "input": "[5, 3, 1, 4], {}", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "egoetz/DNC-tensorflow/tasks/DREAM/cleaning.py#replace_word", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037691", "code": "def safe_no_dnn_workmem(workmem):\n    if workmem:\n        raise RuntimeError(\n            'The option `dnn.conv.workmem` has been removed and should '\n            'not be used anymore. Please use the option '\n            '`dnn.conv.algo_fwd` instead.')\n    return True", "entry_point": "safe_no_dnn_workmem", "input": "set()", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "AIPYX/theano/theano/configdefaults.py#safe_no_dnn_workmem", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037692", "code": "def safe_no_dnn_workmem_bwd(workmem):\n    if workmem:\n        raise RuntimeError(\n            'The option `dnn.conv.workmem_bwd` has been removed and '\n            'should not be used anymore. Please use the options '\n            '`dnn.conv.algo_bwd_filter` and `dnn.conv.algo_bwd_data` instead.')\n    return True", "entry_point": "safe_no_dnn_workmem_bwd", "input": "[]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "AIPYX/theano/theano/configdefaults.py#safe_no_dnn_workmem_bwd", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037693", "code": "def safe_no_dnn_algo_bwd(algo):\n    if algo:\n        raise RuntimeError(\n            'The option `dnn.conv.algo_bwd` has been removed and '\n            'should not be used anymore. Please use the options '\n            '`dnn.conv.algo_bwd_filter` and `dnn.conv.algo_bwd_data` instead.')\n    return True", "entry_point": "safe_no_dnn_algo_bwd", "input": "[]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "AIPYX/theano/theano/configdefaults.py#safe_no_dnn_algo_bwd", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037694", "code": "def _scale_formatter(tick_value: float, pos: int, factor: float) -> str:\n    return f\"{tick_value*factor:g}\"", "entry_point": "_scale_formatter", "input": "-1.5, 3, 2.0", "output": "'-3'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/dataset/plotting.py#_scale_formatter", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037695", "code": "def default_figsize(subplots):\n        if not isinstance(subplots, tuple):\n            raise TypeError(f'Subplots {subplots} must be a tuple')\n        return (3 + 3 * subplots[1], 1 + 3 * subplots[0])", "entry_point": "default_figsize", "input": "(1, 2)", "output": "(9, 4)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/plots/qcmatplotlib.py#default_figsize", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037696", "code": "def _parse_output_string(string_value: str) -> str:\n    s = string_value.strip().lower()\n    if (s[0] == s[-1]) and s.startswith((\"'\", '\"')):\n        s = s[1:-1]\n    conversions = {'mov': 'moving', 'rep': 'repeat'}\n    if s in conversions.keys():\n        s = conversions[s]\n    return s", "entry_point": "_parse_output_string", "input": "'Hello World'", "output": "'hello world'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/instrument_drivers/tektronix/Keithley_6500.py#_parse_output_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037697", "code": "def _parse_output_bool(numeric_value: float) -> bool:\n    return bool(numeric_value)", "entry_point": "_parse_output_bool", "input": "0", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/instrument_drivers/tektronix/Keithley_6500.py#_parse_output_bool", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037698", "code": "def is_number(s: str) -> bool:\n    try:\n        float(s)\n        return True\n    except ValueError:\n        return False", "entry_point": "is_number", "input": "-1.5", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/instrument_drivers/rigol/DG4000.py#is_number", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037699", "code": "def clean_string(s: str) -> str:\n    s = s.strip()\n    if (s[0] == s[-1]) and s.startswith((\"'\", '\"')):\n        s = s[1:-1]\n    s = s.lower()\n    return s", "entry_point": "clean_string", "input": "'a,b,c'", "output": "'a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/instrument_drivers/rigol/DG4000.py#clean_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037700", "code": "def parse_output_string(s: str) -> str:\n    s = s.strip()\n    if (s[0] == s[-1]) and s.startswith((\"'\", '\"')):\n        s = s[1:-1]\n    s = s.lower()\n    conversions = {\n        'mov': 'moving',\n        'rep': 'repeat',\n    }\n    if s in conversions.keys():\n        s = conversions[s]\n    return s", "entry_point": "parse_output_string", "input": "'abc'", "output": "'abc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jakeogh/Qcodes/qcodes/instrument_drivers/tektronix/Keithley_2000.py#parse_output_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037701", "code": "def sort_by_value(d):\n\titems=d.items()\n\tbackitems=[ [v[1],v[0]] for v in items]\n\tbackitems.sort()\n\tbackitems.reverse()\n\treturn [ backitems[i][1] for i in range(0,len(backitems))]", "entry_point": "sort_by_value", "input": "{'a': 1, 'b': 2}", "output": "['b', 'a']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/IntroCModelingLA/Code/ngramchar.py#sort_by_value", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037702", "code": "def match(aedge, iedge):\n\tif aedge[1] == iedge[0]:\n\t\tif aedge[4][aedge[2]] == iedge[3]: return 1\n\treturn 0", "entry_point": "match", "input": "[1, 2, 3], [[1, 2], [3], []]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/pycl/Code/Charty/Charty.py#match", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037703", "code": "def ngramList(tokenlist, n):\n   if len(tokenlist) >= n:\n      return tuple((tuple(tokenlist[i:i+n]) for i in range(len(tokenlist) - (n - 1))))\n   return ()", "entry_point": "ngramList", "input": "'Hello World', True", "output": "(('H',), ('e',), ('l',), ('l',), ('o',), (' ',), ('W',), ('o',), ('r',), ('l',), ('d',))", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/textstat/resources/TextStat.py#ngramList", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037704", "code": "def dotProduct(vector1, vector2):\n   if len(vector1) == len(vector2):\n      return sum((vector1[i] * vector2[i] for i in range(len(vector1))))\n   return None", "entry_point": "dotProduct", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "51", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/textstat/resources/TextStat.py#dotProduct", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037705", "code": "def expectationFromObservationDF1(observation):\n   if len(observation) == 4:\n      rowtotal1 = sum(observation[:2])\n      rowtotal2 = sum(observation[2:])\n      columntotal1 = sum(observation[::2])\n      columntotal2 = sum(observation[1::2])\n      total = sum(observation)\n      return ( (rowtotal1 * columntotal1) / total,\n               (rowtotal1 * columntotal2) / total,\n               (rowtotal2 * columntotal1) / total,\n               (rowtotal2 * columntotal2) / total )\n   return None", "entry_point": "expectationFromObservationDF1", "input": "[5, 3, 1, 4]", "output": "(3.6923076923076925, 4.3076923076923075, 2.3076923076923075, 2.6923076923076925)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/textstat/resources/TextStat.py#expectationFromObservationDF1", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037706", "code": "def match(aedge, iedge):\n   if aedge[1] == iedge[0]:\n      if aedge[4][aedge[2]] == iedge[3]: return True\n   return False", "entry_point": "match", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/Charty/resources/ChartyPy.py#match", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037707", "code": "def match(aedge, iedge):\n   if aedge[1] == iedge[0]:\n      if aedge[4][aedge[2]] == iedge[3]: return 1\n   return 0", "entry_point": "match", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dcavar/dcavar.github.io/Charty/download/files/ChartyPy.py#match", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037708", "code": "def remove_slash(path: str) -> str:\n    if path[-1] == \"/\":\n        path = path[:-1]\n    return path", "entry_point": "remove_slash", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dilawarm/federated/federated/main.py#remove_slash", "provenance_class": "collected", "licence": "cc-by-4.0"}
{"id": "the_vault/0037709", "code": "def check_type(x: str, inp_type: type) -> bool:\n    try:\n        inp_type(x)\n        return True\n    except:\n        return False", "entry_point": "check_type", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dilawarm/federated/federated/main.py#check_type", "provenance_class": "collected", "licence": "cc-by-4.0"}
{"id": "the_vault/0037710", "code": "def list_parameters_from_groups(parameter_groups, groups):\n    return [\n        p for group in groups\n        for p in parameter_groups[group].values()\n    ]", "entry_point": "list_parameters_from_groups", "input": "[-1, 0, 1, 2], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "hcherkaoui/carpet/carpet/parameters.py#list_parameters_from_groups", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037711", "code": "def replaceNewlines(string, newlineChar):\n\tif newlineChar in string:\n\t\tsegments = string.split(newlineChar)\n\t\tstring = \"\"\n\t\tfor segment in segments:\n\t\t\tstring += segment\n\treturn string", "entry_point": "replaceNewlines", "input": "'  padded  ', 'Hello World'", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "TC01/calcpkg/calcrepo/util.py#replaceNewlines", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037712", "code": "def python_type_to_typescript_type(py_type: str) -> str:\n    if py_type in [\"int\", \"float\"]:\n        return \"number\"\n    elif py_type == \"bool\":\n        return \"boolean\"\n    elif py_type == \"str\":\n        return \"string\"\n    elif py_type == \"list\":\n        return \"Array<any>\"\n    elif py_type == \"dict\":\n        return \"any\"\n    else:\n        return \"any\"", "entry_point": "python_type_to_typescript_type", "input": "[-1, 0, 1, 2]", "output": "'any'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "douglasgusson/json-to-typescript-interfaces/json_to_ts/main.py#python_type_to_typescript_type", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037713", "code": "def kebab_to_camel(kebab_str: str, first_caps: bool = False) -> str:\n    first, *others = kebab_str.split(\"-\")\n    first = first_caps and first.capitalize() or first.lower()\n    return \"\".join([first, *map(str.title, others)])", "entry_point": "kebab_to_camel", "input": "'', {1, 2, 3}", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "douglasgusson/json-to-typescript-interfaces/json_to_ts/main.py#kebab_to_camel", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037714", "code": "def generate_uri_list(list_of_row_lists):\n    uri_list = []\n    for row in list_of_row_lists:\n        uri = row[0]\n        uri_list.append(uri)\n    return uri_list", "entry_point": "generate_uri_list", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "stlouiss/ACLS_Humanities_eBook_Collection_Metadata_Curation/srs_metadata_cleaning.py#generate_uri_list", "provenance_class": "collected", "licence": "cnri-python, info-zip"}
{"id": "the_vault/0037715", "code": "def curating_metadata(list_of_row_lists):\n    curated_metadata_records = []\n    for row in list_of_row_lists:\n        full_title = row[1]\n        full_title = full_title.strip()\n        if full_title.startswith(\"A \") == True:\n            title_prefix = \"A\"\n        elif full_title.startswith(\"An \") == True:\n            title_prefix = \"An\"\n        elif full_title.startswith(\"The \") == True:\n            title_prefix = \"The\"\n        else:\n            title_prefix = \"\"\n        if \":\" in full_title:\n            split_full_title_list = full_title.split(\":\")\n            if len(split_full_title_list) == 2:\n                main_title = split_full_title_list[0]\n                subtitle = split_full_title_list[1].strip()\n            else:\n                main_title = split_full_title_list[0]\n                subtitle = \":\".join(split_full_title_list[1:])\n        else:\n            main_title = full_title\n            subtitle = \"\"\n        uri = row[0]\n        marc_main_title = row[2]\n        marc_subtitle = row[3]\n        edition = row[4]\n        copyright_ocr = row[5]\n        metadata_record = [uri, full_title, main_title, subtitle, marc_main_title, marc_subtitle, title_prefix, edition, copyright_ocr]\n        curated_metadata_records.append(metadata_record)\n    return curated_metadata_records", "entry_point": "curating_metadata", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "stlouiss/ACLS_Humanities_eBook_Collection_Metadata_Curation/srs_metadata_cleaning.py#curating_metadata", "provenance_class": "collected", "licence": "cnri-python, info-zip"}
{"id": "the_vault/0037716", "code": "def sifting_metadata_for_volume_info(list_of_row_lists):\n    full_title_list = []\n    check_full_titles_for_volume_info = []\n    for row in list_of_row_lists:\n        full_title = row[1]\n        clean_full_title = str(full_title).lower()\n        cleaner_full_title = clean_full_title.replace(\"\\n\", \"\")\n        cleanest_full_title = cleaner_full_title.replace(\" \", \"\")\n        full_title_list.append(cleanest_full_title)\n    for title in full_title_list:\n        if \"volume\" in title:\n            check_for_volume_info = \"YES\"\n            check_full_titles_for_volume_info.append(check_for_volume_info)\n        elif \"vol.\" in title:\n            check_for_volume_info = \"YES\"\n            check_full_titles_for_volume_info.append(check_for_volume_info)\n        else:\n            check_for_volume_info = \"N\"\n            check_full_titles_for_volume_info.append(check_for_volume_info)\n    return check_full_titles_for_volume_info", "entry_point": "sifting_metadata_for_volume_info", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "stlouiss/ACLS_Humanities_eBook_Collection_Metadata_Curation/srs_metadata_cleaning.py#sifting_metadata_for_volume_info", "provenance_class": "collected", "licence": "cnri-python, info-zip"}
{"id": "the_vault/0037717", "code": "def sifting_metadata_for_edition_info(list_of_row_lists):\n    copyright_ocr_list = []\n    check_copyright_ocr_for_edition_info = []\n    for row in list_of_row_lists:\n        copyright_ocr = row[5]\n        clean_copyright_ocr = str(copyright_ocr).lower()\n        cleaner_copyright_ocr = clean_copyright_ocr.replace(\"\\n\", \"\")\n        cleanest_copyright_ocr = cleaner_copyright_ocr.replace(\" \", \"\")\n        copyright_ocr_list.append(cleanest_copyright_ocr)\n    for copyright_ocr_item in copyright_ocr_list:\n        if \"edition\" in copyright_ocr_item:\n            check_for_edition_info = \"YES -- CHECK FIRST\"\n            check_copyright_ocr_for_edition_info.append(check_for_edition_info)\n        elif \" ed.\" in copyright_ocr_item:\n            check_for_edition_info = \"YES -- CHECK SECOND\"\n            check_copyright_ocr_for_edition_info.append(check_for_edition_info)\n        else:\n            check_for_edition_info = \"N\"\n            check_copyright_ocr_for_edition_info.append(check_for_edition_info)\n    return check_copyright_ocr_for_edition_info", "entry_point": "sifting_metadata_for_edition_info", "input": "''", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "stlouiss/ACLS_Humanities_eBook_Collection_Metadata_Curation/srs_metadata_cleaning.py#sifting_metadata_for_edition_info", "provenance_class": "collected", "licence": "cnri-python, info-zip"}
{"id": "the_vault/0037718", "code": "def tag_text_of_type(tag_type, data):\n    text_of_tag = []\n    index = 0\n    for word in data:\n        if tag_type in word[1]:\n            text_of_tag.append(tuple((word[0], index)))\n        index+=1\n    return text_of_tag", "entry_point": "tag_text_of_type", "input": "['a', 'b', 'c'], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GuyKeogh/wiki_factcheck/source/dataparsing/text_tagging.py#tag_text_of_type", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037719", "code": "def eval_citation_for_type(citation_text, key):\n    unique_terms_cite = []\n    for word in citation_text:\n        if key in word[1]:\n            unique_terms_cite.append(word[0])\n    return unique_terms_cite", "entry_point": "eval_citation_for_type", "input": "'', ['apple', 'banana', 'cherry']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GuyKeogh/wiki_factcheck/source/dataparsing/text_tagging.py#eval_citation_for_type", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037720", "code": "def encode_text(text):\n    text = text.replace('&','&amp').replace('<','&lt').replace('>','&gt').replace('\"','&quot').replace(\"'\",'&#x27')\n    return text", "entry_point": "encode_text", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GuyKeogh/wiki_factcheck/source/io/output.py#encode_text", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037721", "code": "def tableFormat(titleList, dataLists, rowJoiner='  '):\n    rawRows = dataLists\n    rowLists = [titleList[:]]\n    for r in rawRows:\n        rowLists.append([str(field) for field in r])\n    ml = max([len(r) for r in rowLists])\n    for r in rowLists:\n        if len(r) < ml:\n            r.extend([''] * (ml - len(r)))\n    widths = [] \n    for field in range(ml):\n        width = max([len(row[field]) for row in rowLists]) + len(rowJoiner)\n        widths.append(width)\n    joinedRows = []\n    for row in rowLists:\n        nr = [(s + rowJoiner).rjust(widths[i]) for i, s in enumerate(row)]\n        joinedRows.append(''.join(nr).rstrip())  \n    l = max([len(r) for r in joinedRows])\n    s = '-' * l\n    joinedRows.append(s)\n    joinedRows.insert(1,s)\n    joinedRows.insert(0,s)\n    return joinedRows", "entry_point": "tableFormat", "input": "[], [], [[1, 2], [3], []]", "output": "['', '', '', '']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "labstructbioinf/localpdb/localpdb/plugins/utils/MakeMultimer.py#tableFormat", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037722", "code": "def update_softclipdata(region, softclipdata):\n    if region[2] == 'normal':\n        index = 0\n    else:\n        index = 1\n    for pos in range(region[0], region[1]):\n        if pos in softclipdata:\n            softclipdata[pos][index] += 1\n        else:\n            posdata = [0, 0]\n            posdata[index] += 1\n            softclipdata.update({pos: posdata})\n    return softclipdata", "entry_point": "update_softclipdata", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "UMCUGenetics/CoNVident/Scripts/softclip_graph.py#update_softclipdata", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037723", "code": "def softclip_regions(read_start, cigar):\n    regions = []\n    cursor = read_start\n    for element in cigar:\n        if element[0] == 4:\n            regions.append([cursor, cursor+element[1], 'softclip'])\n        else:\n            regions.append([cursor, cursor+element[1], 'normal'])\n        cursor += element[1]\n    return regions", "entry_point": "softclip_regions", "input": "False, set()", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "UMCUGenetics/CoNVident/Scripts/softclip_graph.py#softclip_regions", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037724", "code": "def true_start(cigar, matchstart):\n    overshoot = 0\n    for element in cigar:\n        if element[0] != 0:\n            overshoot += element[1]\n        else:\n            break\n    read_start = matchstart - overshoot\n    return read_start", "entry_point": "true_start", "input": "(), 3.25", "output": "3.25", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "UMCUGenetics/CoNVident/Scripts/softclip_graph.py#true_start", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037725", "code": "def sort_flags(flags):\n    for i in range(1, len(flags)):\n        key = flags[i][1]\n        j = i - 1\n        while j >= 0 and key < flags[j][1] and flags[i][0] == flags[j][0]:\n            temp = flags[j+1]\n            flags[j+1] = flags[j]\n            flags[j] = temp\n            j -= 1\n        flags[j + 1][1] = key\n    return flags", "entry_point": "sort_flags", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "UMCUGenetics/CoNVident/Scripts/softclip_graph.py#sort_flags", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037726", "code": "def update_total(flags, isbuildingflags):\n    for index in range(0, len(flags)):\n        if isbuildingflags[index]:\n            flags[index][3]['total'] += 1\n    return flags", "entry_point": "update_total", "input": "set(), -1.5", "output": "set()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "UMCUGenetics/CoNVident/Scripts/Flag_placer.py#update_total", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037727", "code": "def calculate_overshoot(cigar):\n    overshoot = 0\n    for element in cigar:\n        if element[0]:\n            overshoot += element[1]\n        else:\n            break\n    return overshoot", "entry_point": "calculate_overshoot", "input": "[]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "UMCUGenetics/CoNVident/Scripts/Flag_placer.py#calculate_overshoot", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037728", "code": "def flatten(data):\n    stack = [([], data)]\n    results = []\n    while stack:\n        keyparts, data = stack.pop(0)\n        if isinstance(data, dict):\n            if keyparts != []:\n                results.append((tuple(keyparts), {}))\n            for k in sorted(data.keys()):\n                stack.append((keyparts + [k], data[k]))\n        else:\n            results.append((tuple(keyparts), data))\n    return results", "entry_point": "flatten", "input": "[]", "output": "[((), [])]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "stackhpc/lustre-tools/nodemap.py#flatten", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037729", "code": "def changes_to_yaml(changes):\n    lines = []\n    nindent = 4\n    curr_keypath = []\n    for (keypath, action, value) in changes:\n        common = [a for a, b in zip(curr_keypath, keypath) if a == b]\n        new = keypath[len(common):]\n        level = len(keypath) - 2\n        for i, k in enumerate(new[:-1]):\n            lines.append('%s%s:' % ((' ' * nindent * level), k))\n        symbol = '<' if action == 'DEL' else '>'\n        lines.append(symbol + (' ' * (nindent * (level+1) - 1)) + keypath[-1] + ': ' + (str(value) or repr(value)))\n        curr_keypath = keypath\n    return '\\n'.join(lines)", "entry_point": "changes_to_yaml", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "stackhpc/lustre-tools/nodemap.py#changes_to_yaml", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037730", "code": "def filter_valid_entries(entries):\n        return [e for e in entries if e.is_valid()]", "entry_point": "filter_valid_entries", "input": "()", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "kermit1313/TogglSync/togglsync/toggl.py#filter_valid_entries", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037731", "code": "def nest_flattened_dict(graph_dict, sep='.'):\n    nested_dict = {}\n    for key, value in sorted(graph_dict.items()):\n        splitted = key.split(sep)\n        if len(splitted) == 1:\n            nested_dict[key] = value\n        d = nested_dict\n        for k in splitted[:-1]:\n            if k not in d:\n                d[k] = {}\n            d = d[k]\n        d[splitted[-1]] = value\n    return nested_dict", "entry_point": "nest_flattened_dict", "input": "{'x': [1, 2], 'y': []}, '  padded  '", "output": "{'x': [1, 2], 'y': []}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "codacy-badger/graphit/graphit/graph_io/io_helpers.py#nest_flattened_dict", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037732", "code": "def replace_chars(a, chars):\n    string = a\n    for char in chars:\n        copy_string = string.replace(char, '')\n        string = copy_string\n    return string", "entry_point": "replace_chars", "input": "5, ()", "output": "5", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#replace_chars", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037733", "code": "def ishasbody(method):\n    if method in [\"put\", \"post\", \"patch\"]:\n        return True\n    return False", "entry_point": "ishasbody", "input": "[5, 3, 1, 4]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#ishasbody", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037734", "code": "def variableforbidden(input_string):\n    if input_string in [\"if\", \"var\", \"function\", \"null\"]:\n        return \"_\" + input_string\n    return input_string", "entry_point": "variableforbidden", "input": "'a,b,c'", "output": "'a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#variableforbidden", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037735", "code": "def convert_to_cplus_type(json_type):\n    if json_type in [\"boolean\"]:\n        return \"bool\"\n    if json_type in [\"number\"]:\n        return \"double\"\n    if json_type in [\"integer\"]:\n        return \"int\"  \n    if json_type in [\"string\"]:\n        return \"std::string\"\n    if json_type in [\"object\"]:\n        return \"OCRepresentation\"\n    return \"void*\"", "entry_point": "convert_to_cplus_type", "input": "[5, 3, 1, 4]", "output": "'void*'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#convert_to_cplus_type", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037736", "code": "def convert_to_c_type(json_type):\n    if json_type in [\"boolean\"]:\n        return \"bool\"\n    if json_type in [\"number\"]:\n        return \"double\"\n    if json_type in [\"integer\"]:\n        return \"int\"  \n    if json_type in [\"string\"]:\n        return \"char*\"\n    if json_type in [\"string[]\"]:\n        return \"char**\"\n    if json_type in [\"integer[]\"]:\n        return \"int*\"\n    if json_type in [\"boolean[]\"]:\n        return \"bool*\"\n    if json_type in [\"number[]\"]:\n        return \"double*\"\n    return \"void*\"", "entry_point": "convert_to_c_type", "input": "[5, 3, 1, 4]", "output": "'void*'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#convert_to_c_type", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037737", "code": "def convert_to_c_type_no_pointer(json_type):\n    if json_type == \"boolean\":\n        return \"bool\"\n    if json_type == \"number\":\n        return \"double\"\n    if json_type == \"integer\":\n        return \"int\"  \n    if json_type == \"string\":\n        return \"char\"\n    if json_type == \"string[]\":\n        return \"char\"\n    if json_type == \"integer[]\":\n        return \"int\"\n    if json_type == \"boolean[]\":\n        return \"bool\"\n    if json_type == \"number[]\":\n        return \"double\"\n    if json_type == \"string[][]\":\n        return \"char\"\n    if json_type == \"integer[][]\":\n        return \"int\"\n    if json_type == \"boolean[][]\":\n        return \"bool\"\n    if json_type == \"number[][]\":\n        return \"double\"\n    return \"void*\"", "entry_point": "convert_to_c_type_no_pointer", "input": "[5, 3, 1, 4]", "output": "'void*'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#convert_to_c_type_no_pointer", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037738", "code": "def convert_to_c_type_array_size(json_type):\n    if json_type == \"boolean\":\n        return 0\n    if json_type == \"number\":\n        return 0\n    if json_type == \"integer\":\n        return 0\n    if json_type == \"string\":\n        return 1\n    if json_type == \"string[]\":\n        return 2\n    if json_type == \"integer[]\":\n        return 1\n    if json_type == \"boolean[]\":\n        return 1\n    if json_type == \"number[]\":\n        return 1\n    if json_type == \"string[][]\":\n        return 3\n    if json_type == \"integer[][]\":\n        return 2\n    if json_type == \"boolean[][]\":\n        return 2\n    if json_type == \"number[][]\":\n        return 2\n    return \"void*\"", "entry_point": "convert_to_c_type_array_size", "input": "[-1, 0, 1, 2]", "output": "'void*'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#convert_to_c_type_array_size", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037739", "code": "def convert_to_cplus_string_array(my_array):\n    my_ret = '{'\n    counter = 0\n    if isinstance(my_array, str):\n        my_ret += '\"' + str(my_array) + '\"'\n    elif isinstance(my_array, list):\n        for item in my_array:\n            if counter > 0:\n                my_ret += ','\n            my_ret += '\"' + str(item) + '\"'\n            counter += 1\n    else:\n        pass\n    my_ret += '}'\n    return my_ret", "entry_point": "convert_to_cplus_string_array", "input": "[-1, 0, 1, 2]", "output": "'{\"-1\",\"0\",\"1\",\"2\"}'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#convert_to_cplus_string_array", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037740", "code": "def sdf_supported_property(property_name):\n    supportedProperties = [\"type\", \"minimum\",\n                           \"maximum\", \"uniqueItems\", \"format\"]\n    supportedProperties.extend(\n        [\"minItems\", \"maxItems\", \"default\", \"exclusiveMinimum\", \"exclusiveMaximum\"])\n    supportedProperties.extend([\"maxLength\", \"minLength\"])\n    if property_name in supportedProperties:\n        return True\n    else:\n        return False", "entry_point": "sdf_supported_property", "input": "'a,b,c'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#sdf_supported_property", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037741", "code": "def sdf_supported_property_non_string(property_name):\n    supportedProperties = [\"minimum\",\n                           \"maximum\", \"uniqueItems\", \"default\", \"exclusiveMinimum\"]\n    if property_name in supportedProperties:\n        return True\n    else:\n        return False", "entry_point": "sdf_supported_property_non_string", "input": "'Hello World'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#sdf_supported_property_non_string", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037742", "code": "def sdf_readOnly_object(RO_value):\n    if RO_value:\n        return \"false\"\n    else:\n        return \"true\"", "entry_point": "sdf_readOnly_object", "input": "['a', 'b', 'c']", "output": "'false'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#sdf_readOnly_object", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037743", "code": "def sdf_enum_array(enumArray):\n    output = \"[\"\n    for i, item in enumerate(enumArray):\n        output = output + \"\\\"\" + item + \"\\\"\"\n        if i < len(enumArray) - 1:\n            output = output + \",\"\n        else:\n            output = output + \"]\"\n    return output", "entry_point": "sdf_enum_array", "input": "['a', 'b', 'c']", "output": "'[\"a\",\"b\",\"c\"]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "openconnectivityfoundation/swagger2x/src/swagger2x.py#sdf_enum_array", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037744", "code": "def nest(flat_dict, sep=':'):\n    def _nest(nested_dict, aggregated_key, val):\n        try:\n            leaf_key, aggregated_key = aggregated_key.split(sep, 1)\n        except ValueError:\n            leaf_key = aggregated_key\n            dict_ = type(nested_dict)([(leaf_key, val)])\n            nested_dict.update(dict_)\n        else:\n            if leaf_key not in nested_dict:\n                nested_dict[leaf_key] = type(nested_dict)()\n            _nest(nested_dict[leaf_key], aggregated_key, val)\n    nested_dict = type(flat_dict)()\n    for aggregated_key, val in flat_dict.items():\n        _nest(nested_dict, aggregated_key, val)\n    return nested_dict", "entry_point": "nest", "input": "{}, 'Hello World'", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dzon4xx/flat_nest_pydict/flat_nest_pydict/dict_tools.py#nest", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037745", "code": "def _get_location(user_input: str) -> str:\n    return user_input.replace('CENTER NOMINATIM ', '')", "entry_point": "_get_location", "input": "'Hello World'", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "guseph/AirBear/server/inputs.py#_get_location", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037746", "code": "def _get_PURPLEAIR(user_input: str) -> str:\n    return user_input", "entry_point": "_get_PURPLEAIR", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "guseph/AirBear/server/inputs.py#_get_PURPLEAIR", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037747", "code": "def _get_reverse(user_input: str):\n    return True", "entry_point": "_get_reverse", "input": "[1, 2, 3]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "guseph/AirBear/server/inputs.py#_get_reverse", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037748", "code": "def strip_empty(s: str) -> str:\n    if s == \"\":\n        return None\n    else:\n        return s", "entry_point": "strip_empty", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mrichardson03/panos-ips-reports/panos_util/__init__.py#strip_empty", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037749", "code": "def extract(line):\n\tline = line.replace(\"\\n\", \"\")\n\tuin = line[1:line.find(\"\\t\")]\n\tuin2 = \"\"\n\tfor c in uin:\n\t\tif c.isdigit():\n\t\t\tuin2 += c\n\tuin = uin2\n\tnick = line[1+line.find(\"\\t\"):]\n\tnick = nick.replace(\"/\", \"_\")\n\tnick = nick.replace(\":\", \"_\")\n\treturn (uin, nick)", "entry_point": "extract", "input": "'AbC dEf'", "output": "('', 'AbC dEf')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "louisdem/IMKit/utils/gimicq-import/GimICQ2IM.py#extract", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037750", "code": "def s(x):\n    if type(x) in [list, tuple]:\n        return len(x)\n    else:\n        return x.shape", "entry_point": "s", "input": "['apple', 'banana', 'cherry']", "output": "3", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Yu-Group/pcs-pipeline/vflow/convert.py#s", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037751", "code": "def to_tuple(lists: list):\n    n_mods = len(lists)\n    if n_mods <= 1:\n        return lists\n    if not type(lists[0]) == list:\n        return lists\n    n_tup = len(lists[0])\n    tup = [[] for _ in range(n_tup)]\n    for i in range(n_mods):\n        for j in range(n_tup):\n            tup[j].append(lists[i][j])\n    return tuple(tup)", "entry_point": "to_tuple", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Yu-Group/pcs-pipeline/vflow/convert.py#to_tuple", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037752", "code": "def to_list(tup: tuple):\n    n_tup = len(tup)\n    if n_tup == 0:\n        return []\n    elif not isinstance(tup[0], list):\n        if n_tup == 1:\n            return list(tup)\n        if n_tup % 2 != 0:\n            raise ValueError('Don\\'t know how to handle uneven number of args '\n                             'without a list. Please wrap your args in a list.')\n        return [list(el) for el in zip(tup[:(n_tup // 2)], tup[(n_tup // 2):])]\n    elif n_tup == 1:\n        return [[x] for x in tup[0]]\n    n_mods = len(tup[0])\n    lists_packed = [[] for _ in range(n_mods)]\n    for i in range(n_mods):\n        for j in range(n_tup):\n            lists_packed[i].append(tup[j][i])\n    return lists_packed", "entry_point": "to_list", "input": "[5, 3, 1, 4]", "output": "[[5, 1], [3, 4]]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Yu-Group/pcs-pipeline/vflow/convert.py#to_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037753", "code": "def max_profit(dp):\n            len_dp = len( dp )\n            dp[1] = max( dp[0], dp[1] )\n            for k in range( 2, len_dp ):\n                dp[k] = max( dp[k - 1], dp[k] + dp[k - 2] )\n            return dp[-1]", "entry_point": "max_profit", "input": "[[1, 2], [3], []]", "output": "[3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sbhardwaj8717/PythonAlgorithms/LeetCode/0213_House_robber2.py#max_profit", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037754", "code": "def hello(name='world'):\n    return 'Hello, {}'.format(name)", "entry_point": "hello", "input": "'a,b,c'", "output": "'Hello, a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "charlieallatson/hello_world/hello.py#hello", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037755", "code": "def parameter_graph_json(parameter_graph, vertices=None):\n    if vertices == None:\n        vertices = list(range(parameter_graph.size()))\n    all_edges = [(u, v) for u in vertices for v in parameter_graph.adjacencies(u, 'codim1') if v in vertices]\n    edges = [(u, v) for (u, v) in all_edges if u > v]\n    nodes = []\n    for v in vertices:\n        node = {\"id\" : v}\n        nodes.append(node)\n    links = []\n    for (u, v) in edges:\n        link = {\"source\" : u, \"target\" : v}\n        links.append(link)\n    parameter_graph_json_data = {\"parameter_graph\" : {\"nodes\" : nodes, \"links\" : links}}\n    return parameter_graph_json_data", "entry_point": "parameter_graph_json", "input": "[1, 2, 3], []", "output": "{'parameter_graph': {'nodes': [], 'links': []}}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "adam-zheleznyak/DSGRN/src/DSGRN/SaveDatabaseJSON.py#parameter_graph_json", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037756", "code": "def extract_hydrogens_from_instructions(instruction):\n    if \"-\" in instruction[1] or \"-\" in instruction[2]:\n        try:\n            heavy_core = instruction[1].split(\"-\")[0]\n            hydrogen_core = instruction[1].split(\"-\")[1]\n            heavy_fragment = instruction[2].split(\"-\")[0]\n            hydrogen_fragment = instruction[2].split(\"-\")[1]\n            return heavy_core, hydrogen_core, heavy_fragment, hydrogen_fragment\n        except IndexError:\n            raise IndexError(f\"Wrong growing direction in {instruction}. Both, fragment and core atoms must include one or two atoms.\" \n                              \"Ex: frag.pdb  C1  C2 |or| frag.pdb  C1-H1  C2-H2\")\n    else:\n        return False", "entry_point": "extract_hydrogens_from_instructions", "input": "[[1, 2], [3], []]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "danielSoler93/FrAG_PELE/frag_pele/serie_handler.py#extract_hydrogens_from_instructions", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037757", "code": "def bond(hydrogen_atom_names, molecules):\n    list_of_pairs = []\n    for hydrogen, molecule in zip(hydrogen_atom_names, molecules):\n        mol_no_h = molecule.select(\"not name {}\".format(hydrogen))\n        list_of_pairs.append(mol_no_h)\n    i = 0\n    bonds = []\n    while i < len(list_of_pairs):\n        merged = list_of_pairs[i].copy() + list_of_pairs[i+1].copy()\n        bonds.append(merged)\n        i += 2\n    return bonds", "entry_point": "bond", "input": "'', [[1, 2], [3], []]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "danielSoler93/FrAG_PELE/frag_pele/Growing/add_fragment_from_pdbs.py#bond", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037758", "code": "def remove_tors(tors1, tors2):\n    out_tors = []\n    for torsion1 in tors1:\n        found = 0\n        for torsion2 in tors2:\n            if torsion1 == torsion2:\n                found = 1\n        if found == 0:\n            out_tors.append(torsion1)\n    return out_tors", "entry_point": "remove_tors", "input": "['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "danielSoler93/FrAG_PELE/frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py#remove_tors", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037759", "code": "def assign_bonds_to_groups(tors, group):\n    output = []\n    big_group = -1\n    nbig_group = 0\n    ngroup = max(group)\n    ngroup_members = []\n    for i in range(ngroup + 1):\n        ngroup_members.append(0)\n    for t in tors:\n        group_number = max(group[t[0]], group[t[1]])\n        output.append(group_number)\n        if (group_number >= 0):\n            ngroup_members[group_number] = ngroup_members[group_number] + 1\n    for i in range(ngroup + 1):\n        if (ngroup_members[i] > nbig_group):\n            nbig_group = ngroup_members[i]\n            big_group = i\n    return output, big_group, nbig_group", "entry_point": "assign_bonds_to_groups", "input": "[], [-1, 0, 1, 2]", "output": "([], -1, 0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "danielSoler93/FrAG_PELE/frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py#assign_bonds_to_groups", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037760", "code": "def rank(candidates: \"list[Commit]\", model_name: str) -> \"list[Commit]\":\n    return candidates", "entry_point": "rank", "input": "[1, 2, 3], '  padded  '", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "pombredanne/vulnerability-assessment-kb/prospector/ranking/rank.py#rank", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037761", "code": "def column_value_int(item, args):\n    try:\n        return int(item[args[0]])\n    except:\n        return 0", "entry_point": "column_value_int", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gawseed/processing/gawseed/algorithm/generic.py#column_value_int", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037762", "code": "def column_value_float(item, args):\n    try:\n        return float(item[args[0]])\n    except:\n        return 0.0", "entry_point": "column_value_float", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gawseed/processing/gawseed/algorithm/generic.py#column_value_float", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037763", "code": "def serialize_dict(elements):\n    return [\n        {\n            'name': el.name,\n            'attributes': el.attrs,\n            'content': el.string,\n            'source': str(el),\n        } for el in elements\n    ]", "entry_point": "serialize_dict", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "anned20/scrapman/serializer.py#serialize_dict", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037764", "code": "def country_nodata0_op(base_array, nodata):\n    result = base_array.copy()\n    result[base_array == 0] = nodata\n    return result", "entry_point": "country_nodata0_op", "input": "[5, 3, 1, 4], [[1, 2], [3], []]", "output": "[[[1, 2], [3], []], 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "richpsharp/raster_calculations/cumulative_density_function_per_country.py#country_nodata0_op", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037765", "code": "def size_to_str(size_in_bytes: int, suffix: str = 'B') -> str:\n        for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:\n            if abs(size_in_bytes) < 1024.0:\n                if unit == '':\n                    return '%d %s%s' % (size_in_bytes, unit, suffix)\n                else:\n                    return '%.1f %s%s' % (size_in_bytes, unit, suffix)\n            size_in_bytes /= 1024.0\n        return '%.1f %s%s' % (size_in_bytes, 'Yi', suffix)", "entry_point": "size_to_str", "input": "10, 'AbC dEf'", "output": "'10 AbC dEf'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "MarcinOrlowski/dhunter/dhunter/util/util.py#size_to_str", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037766", "code": "def _to_list(data):\n        types = [str]\n        for data_type in types:\n            if isinstance(data, data_type):\n                return [data]\n        return data", "entry_point": "_to_list", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "MarcinOrlowski/dhunter/dhunter/core/log.py#_to_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037767", "code": "def _dict_to_list(data_to_convert, color=None):\n        if not isinstance(data_to_convert, dict):\n            return data_to_convert\n        array = []\n        for (key, val) in data_to_convert.items():\n            if color is not None:\n                array.append('{color}{key}%reset% : {val}'.format(color=color, key=key, val=val))\n            else:\n                array.append('%s: %s' % (key, val))\n        return array", "entry_point": "_dict_to_list", "input": "['apple', 'banana', 'cherry'], [-1, 0, 1, 2]", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "MarcinOrlowski/dhunter/dhunter/core/log.py#_dict_to_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037768", "code": "def min_edit_script(source, target, allow_copy=False):\n    a = [[(len(source) + len(target) + 1, None)] * (len(target) + 1) for _ in range(len(source) + 1)]\n    for i in range(0, len(source) + 1):\n        for j in range(0, len(target) + 1):\n            if i == 0 and j == 0:\n                a[i][j] = (0, \"\")\n            else:\n                if allow_copy and i and j and source[i - 1] == target[j - 1] and a[i-1][j-1][0] < a[i][j][0]:\n                    a[i][j] = (a[i-1][j-1][0], a[i-1][j-1][1] + \"\u2192\")\n                if i and a[i-1][j][0] < a[i][j][0]:\n                    a[i][j] = (a[i-1][j][0] + 1, a[i-1][j][1] + \"-\")\n                if j and a[i][j-1][0] < a[i][j][0]:\n                    a[i][j] = (a[i][j-1][0] + 1, a[i][j-1][1] + \"+\" + target[j - 1])\n    return a[-1][-1][1]", "entry_point": "min_edit_script", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry'], [1, 2, 3]", "output": "'----+apple+banana+cherry'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bplank/DaNplus/mtp/machamp/dataset_readers/lemma_edit.py#min_edit_script", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037769", "code": "def colonize(str):\n    return \":\".join(str[i:i+2] for i in range(0, len(str), 2))", "entry_point": "colonize", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bostroesser/rtslib-fb/rtslib/utils.py#colonize", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037770", "code": "def split_project_name(project_name):\n    if project_name.startswith('a/'):\n        hosted_domain_prefix = '/a/' + project_name.split('/')[1]\n        project_name = project_name.split('/')[3]\n    else:\n        hosted_domain_prefix = ''\n        project_name = project_name\n    return hosted_domain_prefix, project_name", "entry_point": "split_project_name", "input": "'  padded  '", "output": "('', '  padded  ')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "lym/allura-git/ForgeImporters/forgeimporters/google/__init__.py#split_project_name", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037771", "code": "def calc_To_ToSt(mach: float, gamma: float, offset: float = 0.0) -> float:\n        gp1 = gamma + 1\n        gm1 = gamma - 1\n        mSqr = pow(mach, 2)\n        return gp1 * mSqr / pow((1 + gamma * mSqr), 2) * (2 + gm1 * mSqr) - offset", "entry_point": "calc_To_ToSt", "input": "False, 2.0, 0.5", "output": "-0.5", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Rigel09/CompAero/CompAero/RayleighFlowRelations.py#calc_To_ToSt", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037772", "code": "def calculate_text_size(text):\n    text_size = 0\n    for c in str(text):\n        if c.islower():\n            text_size += 13\n        elif c.isupper() or c.isdigit() or c == '_':\n            text_size += 20\n        elif c == ' ':\n            text_size += 7\n        else:\n            text_size += 12\n    return text_size/100", "entry_point": "calculate_text_size", "input": "'Hello World'", "output": "1.51", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "EdinburghGenomics/EGCG-Data-Deletion/project_report/utils.py#calculate_text_size", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037773", "code": "def remove_duplicate_base_on_flowcell_id(list_runs):\n    flowcell_to_run = {}\n    for run_id in list_runs:\n        date, machine, run_number, stage_flowcell = run_id.split('_')\n        flowcell = stage_flowcell[1:]\n        if flowcell not in flowcell_to_run or run_id > flowcell_to_run[flowcell]:\n            flowcell_to_run[flowcell] = run_id\n    return sorted(flowcell_to_run.values())", "entry_point": "remove_duplicate_base_on_flowcell_id", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "EdinburghGenomics/EGCG-Data-Deletion/bin/report_runs.py#remove_duplicate_base_on_flowcell_id", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037774", "code": "def list_to_string(the_list):\n    a = ''\n    for secondary_list in the_list:\n        a += ' '\n        for item in secondary_list:\n            a += str(item)\n            a += ','\n        a += ' '\n    return a", "entry_point": "list_to_string", "input": "[[1, 2], [3], []]", "output": "' 1,2,  3,   '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "o-gent/aero_one/ground_station/datalink.py#list_to_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037775", "code": "def string_to_list(the_string):\n    l = []\n    seperate_secondaries = the_string.split()\n    for secondary in enumerate(seperate_secondaries):\n        l.append([])\n        for item in secondary[1].split(',')[:-1]:\n            l[secondary[0]].append(int(item))\n    return l", "entry_point": "string_to_list", "input": "'abc'", "output": "[[]]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "o-gent/aero_one/ground_station/datalink.py#string_to_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037776", "code": "def is_hello_message(message: str) -> bool:\n    if \"Hello\" in message:\n        return True\n    return False", "entry_point": "is_hello_message", "input": "[-1, 0, 1, 2]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mesepulveda/wsnsim/wsnsim/auxiliary_functions.py#is_hello_message", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037777", "code": "def is_etx_message(message: str) -> bool:\n    if \"ETX\" in message:\n        return True\n    return False", "entry_point": "is_etx_message", "input": "['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mesepulveda/wsnsim/wsnsim/auxiliary_functions.py#is_etx_message", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037778", "code": "def find_index_of_delay(sample: float, delay_vector: list) -> int:\n    for index, delay_value in enumerate(delay_vector):\n        if sample <= delay_value:\n            return index", "entry_point": "find_index_of_delay", "input": "[], [[1, 2], [3], []]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mesepulveda/wsnsim/wsnsim/auxiliary_functions.py#find_index_of_delay", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037779", "code": "def is_dap_message(message: str) -> bool:\n    if \"DAP\" in message:\n        return True\n    return False", "entry_point": "is_dap_message", "input": "[-1, 0, 1, 2]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mesepulveda/wsnsim/wsnsim/auxiliary_functions.py#is_dap_message", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037780", "code": "def str2list(s, sep=',', d_type=int):\n    if type(s) is not list:\n        s = [d_type(a) for a in s.split(sep)]\n    return s", "entry_point": "str2list", "input": "['apple', 'banana', 'cherry'], 'AbC dEf', ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bohaohuang/ersa/ersa_utils.py#str2list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037781", "code": "def float2str(f):\n    return '{}'.format(f).replace('.', 'p')", "entry_point": "float2str", "input": "[1, 2, 3]", "output": "'[1, 2, 3]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bohaohuang/ersa/ersa_utils.py#float2str", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037782", "code": "def is_valid_patch_size(ps):\n        if (ps[0] - 124) % 32 == 0 and (ps[1] - 124) % 32 == 0:\n            return True\n        else:\n            ps_0 = (ps[0] - 124) // 32 + 124\n            ps_1 = (ps[1] - 124) // 32 + 124\n            return tuple([ps_0, ps_1])", "entry_point": "is_valid_patch_size", "input": "[5, 3, 1, 4]", "output": "(120, 120)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bohaohuang/ersa/nn/unet.py#is_valid_patch_size", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037783", "code": "def drop_outlier(data,outlier_index):\n    data_copy = data[~outlier_index]\n    return data_copy", "entry_point": "drop_outlier", "input": "['apple', 'banana', 'cherry'], -3", "output": "'cherry'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "minesh1291/Keep-It-Up/feature-engineering-and-data-transformations/using-toy-exmaples/feature_cleaning/outlier.py#drop_outlier", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037784", "code": "def combineCardDicts(dict1, dict2):\n    combined_cards = {}\n    for key in set(dict1).union(dict2):\n        combo_list = []\n        for card in dict1.setdefault(key, []):\n            combo_list.append(card)\n        for card in dict2.setdefault(key, []):\n            combo_list.append(card)\n        combined_cards[key] = combo_list\n    return combined_cards", "entry_point": "combineCardDicts", "input": "{'x': [1, 2], 'y': []}, {}", "output": "{'y': [], 'x': [1, 2]}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "hwoodward/Remote-Card-Games/source/common/Liverpool.py#combineCardDicts", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037785", "code": "def goneOut(played_cards):\n    return True", "entry_point": "goneOut", "input": "[[1, 2], [3], []]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "hwoodward/Remote-Card-Games/source/common/Liverpool.py#goneOut", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037786", "code": "def compute_score_interpretability_method(features_employed_by_explainer, features_employed_black_box):\n    precision = 0\n    recall = 0\n    for feature_employe in features_employed_by_explainer:\n        if feature_employe in features_employed_black_box:\n            precision += 1\n    for feature_employe in features_employed_black_box:\n        if feature_employe in features_employed_by_explainer:\n            recall += 1\n    return precision/len(features_employed_by_explainer), recall/len(features_employed_black_box)", "entry_point": "compute_score_interpretability_method", "input": "['apple', 'banana', 'cherry'], [5, 3, 1, 4]", "output": "(0.0, 0.0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "juliendelaunay35000/APE-Adapted_Post-Hoc_Explanations/tabular_user_experiments.py#compute_score_interpretability_method", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037787", "code": "def compute_score_interpretability_method(features_employed_by_explainer, features_employed_black_box):\n    score = 0\n    for feature_employe in features_employed_by_explainer:\n        if feature_employe in features_employed_black_box:\n            score += 1\n    return score/len(features_employed_by_explainer)", "entry_point": "compute_score_interpretability_method", "input": "['a', 'b', 'c'], [[1, 2], [3], []]", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "juliendelaunay35000/APE-Adapted_Post-Hoc_Explanations/tabular_user_experiments_lime.py#compute_score_interpretability_method", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037788", "code": "def removebadchars(token):\n    translate = {'$': '', '&': '', '#': '', '*': '', '(': '', ')': '', '[': '', ']': '', ' ': '',\n                '?': '','^': '', '`': '', '~': '', '{': '', '}': '', ',': '', '|': '', ':': '', ';': '', \"'\": '', '\"': ''}\n    for char in translate:\n        token = token.replace(char, translate[char])\n    return(token)", "entry_point": "removebadchars", "input": "'a,b,c'", "output": "'abc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "robert-mcdermott/ec2reporter/ec2reporter.py#removebadchars", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037789", "code": "def csvLineToXmlValue(line):\n\tline = line.strip()\n\tcoords = line.split(',')\n\tif (len(coords) >= 2):\n\t\tcoords[0] = coords[0].strip(\"\\\" \\t\\r\\n\")\n\t\tcoords[1] = coords[1].strip(\"\\\" \\t\\r\\n\")\n\t\treturn \"<value x='\" + coords[0] + \"' y='\" + coords[1] + \"' />\"\n\telse:\n\t\treturn \"\"", "entry_point": "csvLineToXmlValue", "input": "'AbC dEf'", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "agold/svgchart/chartserver.py#csvLineToXmlValue", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037790", "code": "def _get_itemvalue(zapi, hostid, keys):\n    if isinstance(keys, str):\n        keys = [keys]\n    data = []\n    for key in keys:\n        value = zapi.item.get(hostids=hostid, search={'key_': key})\n        if value:\n            data.append(value[0]['lastvalue'])\n    return data", "entry_point": "_get_itemvalue", "input": "('a', 'b', 'c'), ['a', 'b', 'c'], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bergzand/matrix-zabbix-bot/zabbix.py#_get_itemvalue", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037791", "code": "def determine_pos_neu_neg(compound):\n    if compound >= 0.05:\n        return 'positive'\n    elif compound < 0.05 and compound > -0.05:\n        return 'neutral'\n    else:\n        return 'negative'", "entry_point": "determine_pos_neu_neg", "input": "False", "output": "'neutral'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "yehchunhung/reddit-dialogues/utils4text.py#determine_pos_neu_neg", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037792", "code": "def _get_upload_headers(user_agent):\n    return {\n        'Accept': 'application/json',\n        'Accept-Encoding': 'gzip, deflate',\n        'User-Agent': user_agent,\n        'content-type': 'application/json',\n    }", "entry_point": "_get_upload_headers", "input": "[5, 3, 1, 4]", "output": "{'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': [5, 3, 1, 4], 'content-type': 'application/json'}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "zero-master/bigquery/google/cloud/bigquery/client.py#_get_upload_headers", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037793", "code": "def snakeuppercase(var):  \n    return \"_\".join(var).upper()", "entry_point": "snakeuppercase", "input": "['apple', 'banana', 'cherry']", "output": "'APPLE_BANANA_CHERRY'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#snakeuppercase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037794", "code": "def dashuppercase(var):  \n    return \"-\".join(var).upper()", "entry_point": "dashuppercase", "input": "['a', 'b', 'c']", "output": "'A-B-C'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#dashuppercase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037795", "code": "def pascalcase(var):  \n    result = \"\"\n    for element in var:\n        element = list(element)\n        element[0] = element[0].upper()\n        result += \"\".join(element)\n    return result", "entry_point": "pascalcase", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#pascalcase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037796", "code": "def camelcase(var):  \n    result = \"\"\n    for i, element in enumerate(var):\n        element = list(element)\n        if i > 0:\n            element[0] = element[0].upper()\n        result += \"\".join(element)\n    return result", "entry_point": "camelcase", "input": "['apple', 'banana', 'cherry']", "output": "'appleBananaCherry'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#camelcase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037797", "code": "def normalcase(var):  \n    return \" \".join(var)", "entry_point": "normalcase", "input": "['a', 'b', 'c']", "output": "'a b c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#normalcase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037798", "code": "def prettycase(var):  \n    result = \"\"\n    for i, element in enumerate(var):\n        element = list(element)\n        element[0] = element[0].upper()\n        result += \"\".join(element) + \" \"\n    return result[:-1]", "entry_point": "prettycase", "input": "['a', 'b', 'c']", "output": "'A B C'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#prettycase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037799", "code": "def sentencecase(var):  \n    result = \"\"\n    for i, element in enumerate(var):\n        element = list(element)\n        if i == 0:\n            element[0] = element[0].upper()\n        result += \"\".join(element) + \" \"\n    return result[:-1]", "entry_point": "sentencecase", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#sentencecase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037800", "code": "def normaluppercase(var):  \n    return \" \".join(var).upper()", "entry_point": "normaluppercase", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#normaluppercase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037801", "code": "def attachedcase(var):  \n    return \"\".join(var)", "entry_point": "attachedcase", "input": "['a', 'b', 'c']", "output": "'abc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#attachedcase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037802", "code": "def attacheduppercase(var):  \n    return \"\".join(var).upper()", "entry_point": "attacheduppercase", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vincentBenet/casing/casing/casing.py#attacheduppercase", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037803", "code": "def convert_time_to_number(time_string: str):\n        if \"-\" in time_string:\n            return -1\n        end_pos = time_string.find(' ')\n        return time_string[:end_pos].strip()", "entry_point": "convert_time_to_number", "input": "'abc'", "output": "'ab'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "PydraxAlpta/HowLongToBeat-PythonAPI/howlongtobeatpy/howlongtobeatpy/HTMLResultParser.py#convert_time_to_number", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037804", "code": "def update_params(params, grads, learning_rate):\n    L = len(params) // 2 \n    for l in range(L):\n        params[\"W\" + str(l+1)] = params[\"W\" + str(l+1)] - grads[\"dW\" + str(l+1)] * learning_rate\n        params[\"b\" + str(l+1)] = params[\"b\" + str(l+1)] - grads[\"db\" + str(l+1)] * learning_rate\n    return params", "entry_point": "update_params", "input": "[], [-1, 0, 1, 2], 2.0", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "BillLueckenbach/deep_neural_network/deep_neural_network.py#update_params", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037805", "code": "def _app_id(app_id):\n    if app_id[0] != '/':\n        app_id = '/{0}'.format(app_id)\n    return app_id", "entry_point": "_app_id", "input": "['a', 'b', 'c']", "output": "\"/['a', 'b', 'c']\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "xiaomao19871205/salt/salt/modules/marathon.py#_app_id", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037806", "code": "def clip_original_size(saliency_, num_atoms_):\n        assert len(saliency_) == len(num_atoms_)\n        saliency_list = []\n        for i in range(len(saliency_)):\n            saliency_list.append(saliency_[i, :num_atoms_[i]])\n        return saliency_list", "entry_point": "clip_original_size", "input": "set(), {}", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "pfnet-research/bayesgrad/experiments/delaney/train.py#clip_original_size", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037807", "code": "def parse_repr(repr_):\n    functions = set(['+', '-', '*', \"AQ\"])\n    labels = {}\n    edges = []\n    repr_ = repr_.replace('(', '')\n    repr_ = repr_.split()\n    n = 0\n    root = repr_[0]\n    if root in functions:\n        labels[n] = (root, \"#ff0000\")\n    else:\n        labels[n] = (root, \"#00ff00\")\n    parent_stack = [n]\n    n += 1\n    for node in repr_[1:]:\n        if node == ')':\n            parent_stack.pop()\n            continue\n        edges.append((parent_stack[-1], n))\n        if node in functions:\n            labels[n] = (node, \"#ff0000\")\n            parent_stack.append(n)\n        else:\n            labels[n] = (node, \"#00ff00\")\n        n += 1\n    return labels, edges", "entry_point": "parse_repr", "input": "'a,b,c'", "output": "({0: ('a,b,c', '#00ff00')}, [])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "joaofbsm/gsgp-struct/scripts/plot_ind.py#parse_repr", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037808", "code": "def make_result_dict(original_dict):\n        def reformat(entry):\n            return {\"Start Level\": original_dict[entry],\n                    \"Times Leveled\": 0,\n                    \"Times Legendary\": 0,\n                    \"Final Level\": original_dict[entry]}\n        return {entry: reformat(entry) for entry in original_dict}", "entry_point": "make_result_dict", "input": "{}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Mailea/dreamlike-skyrim-calculator/skycalc/calculator.py#make_result_dict", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037809", "code": "def trained(skill_level):\n            if skill_level == 100:  \n                return 16\n            else:\n                return skill_level + 1", "entry_point": "trained", "input": "10", "output": "11", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Mailea/dreamlike-skyrim-calculator/skycalc/calculator.py#trained", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037810", "code": "def tweet(data):\n    return 'text' in data", "entry_point": "tweet", "input": "[1, 2, 3]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gertvdijk/peony-twitter/peony/commands/event_types.py#tweet", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037811", "code": "def connect_vec_list(vec_list1, vec_lists2):\n    return (vec_list1 + vec_lists2)", "entry_point": "connect_vec_list", "input": "[], [5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shyyhs/CourseraParallelCorpusMining/src/clean_align/06_ids_with_high_order.py#connect_vec_list", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037812", "code": "def is_num(value):\n    return(isinstance(value, int) or isinstance(value, float))", "entry_point": "is_num", "input": "['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "ojengwa/accounting/accounting/utils.py#is_num", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037813", "code": "def _list_diff(a, b):\n    return [x for x in a if x not in b]", "entry_point": "_list_diff", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "AoiKuiyuyou/AoikHotkey/src/aoikhotkey/util/sendkey_winos.py#_list_diff", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037814", "code": "def build_label_color_list(target_list, color_list):\n    word_color_dict = {}\n    for i, target in enumerate(target_list):\n        word_color_dict[target] = color_list[i%len(color_list)]\n    return word_color_dict", "entry_point": "build_label_color_list", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "{1: 'a', 2: 'b', 3: 'c'}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "hoaaoh/Audio2Vec/src/data_parser.py#build_label_color_list", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037815", "code": "def edit_distance(list1, list2):\n    compute_mat = [[0 for i in range(len(list1)+1) ]\n        for j in range(len(list2)+1)]\n    for i in range(len(list1)+1):\n        compute_mat[0][i] = i\n    for i in range(len(list2)+1):\n        compute_mat[i][0] = i\n    for i in range(1,len(list2)+1):\n        for j in range(1,len(list1)+1):\n            if list1[j-1] == list2[i-1] :\n                compute_mat[i][j] = compute_mat[i-1][j-1]\n            else:\n                compute_mat[i][j] = min( \n                    1+ compute_mat[i-1][j],    \n                    1 + compute_mat[i][j-1],   \n                    1 + compute_mat[i-1][j-1]) \n    return compute_mat[-1][-1]", "entry_point": "edit_distance", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "4", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "hoaaoh/Audio2Vec/src/compute_cossim.py#edit_distance", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037816", "code": "def validate(value=None):\n        return value is not None and str(value)", "entry_point": "validate", "input": "[]", "output": "'[]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gridsmartercities/aws-lambda-decorators/aws_lambda_decorators/validators.py#validate", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037817", "code": "def validate(value=None):\n        if value is None or value in (0, 0.0, 0j):\n            return True\n        return bool(value)", "entry_point": "validate", "input": "['a', 'b', 'c']", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gridsmartercities/aws-lambda-decorators/aws_lambda_decorators/validators.py#validate", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037818", "code": "def sexp_indent(s, tab=\"    \"):\n    out_s = \"\"\n    indent = \"\"\n    nl = \"\"  \n    in_quote = False\n    backslash = False\n    for c in s:\n        if c == \"(\" and not in_quote:\n            out_s += nl + indent\n            nl = \"\\n\"  \n            indent += tab\n        elif c == \")\" and not in_quote:\n            indent = indent[len(tab) :]\n        elif c == '\"' and not backslash:\n            in_quote = not in_quote\n        if c == \"\\\\\":\n            backslash = True\n        else:\n            backslash = False\n        out_s += c\n    return out_s", "entry_point": "sexp_indent", "input": "['a', 'b', 'c'], [-1, 0, 1, 2]", "output": "'abc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "xesscorp/KiField/kifield/common.py#sexp_indent", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037819", "code": "def odd_primes_below_n(n):\n    sieve = [True] * (n // 2)\n    for i in range(3, int(n ** 0.5) + 1, 2):\n        if sieve[i // 2]:\n            sieve[i * i // 2::i] = [False] * ((n-i*i-1)//(2*i)+1)\n    return [2 * i + 1 for i in range(1, n//2) if sieve[i]]", "entry_point": "odd_primes_below_n", "input": "0", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "alanefl/vdf-competition/inkfish/primes.py#odd_primes_below_n", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037820", "code": "def _or(v, d): \n  if v is not None:\n    return v\n  return d", "entry_point": "_or", "input": "[1, 2, 3], []", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Kaedenn/b3sim/bulletbase.py#_or", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037821", "code": "def findDuplicates(arr, tol=1e-8):\n    duplicates = []\n    for i, a in enumerate(arr):\n        if i == 0:\n            pass\n        else:\n            if abs(a - arr[i - 1]) < tol:\n                duplicates.append(i)\n    return duplicates", "entry_point": "findDuplicates", "input": "[], [-1, 0, 1, 2]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "pFernbach/crocoddyl/unittest/python/crocoddyl/locomotion/spline_utils.py#findDuplicates", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037822", "code": "def checkYear(year):\n    if year % 4 == 0: \n        if year % 100 == 0 and year % 400 == 0:\n            isLeap = True \n        elif year % 100 != 0: \n            isLeap = True \n        else: \n            isLeap = False\n    else:\n        isLeap = False \n    return isLeap", "entry_point": "checkYear", "input": "0.5", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Napkinzz/Library-Reading-Club-/Assignment1.py#checkYear", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037823", "code": "def checkDay(day, month, isLeap):\n    days31 = [1, 3, 5, 7, 8, 10, 12]\n    days30 = [4, 6, 9, 11]\n    days28 = [2]\n    if month in days31:\n        if day in range(1, 32):\n            return True \n        else:\n            return False \n    elif month in days30:\n        if day in range(1, 31):\n            return True \n        else:\n            return False \n    elif month in days28:\n        if isLeap == True:\n            if day in range(1, 30):\n                return True \n            else:\n                return False \n        else:\n            if day in range(1, 29):\n                return True \n            else:\n                return False", "entry_point": "checkDay", "input": "{'x': [1, 2], 'y': []}, True, False", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Napkinzz/Library-Reading-Club-/Assignment1.py#checkDay", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037824", "code": "def validateLcn(lcn, poeple):\n    if lcn in poeple:\n        return True \n    else:\n        return False", "entry_point": "validateLcn", "input": "[], [5, 3, 1, 4]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Napkinzz/Library-Reading-Club-/Assignment1.py#validateLcn", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037825", "code": "def fixCurrentDate(year, month, day):\n    year = str(year)\n    month = str(month)\n    day = str(day)\n    if len(month) < 2:\n        month = '0' + str(month)\n    if len(day) < 2:\n        day = '0' + str(day)    \n    string = ' '.join([year, month, day])\n    return string", "entry_point": "fixCurrentDate", "input": "[5, 3, 1, 4], [5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "\"[5, 3, 1, 4] [5, 3, 1, 4] ['apple', 'banana', 'cherry']\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Napkinzz/Library-Reading-Club-/Assignment1.py#fixCurrentDate", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037826", "code": "def firstName(string):\n    if len(string) > 8:\n        string = string[:7] + '*'\n    return string", "entry_point": "firstName", "input": "''", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Napkinzz/Library-Reading-Club-/Assignment1.py#firstName", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037827", "code": "def lastName(string):\n    string = string[0]\n    return string", "entry_point": "lastName", "input": "'Hello World'", "output": "'H'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Napkinzz/Library-Reading-Club-/Assignment1.py#lastName", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037828", "code": "def odd(x):\n    return bool(x % 2)", "entry_point": "odd", "input": "True", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mottosso/mitx-6.00.1x/week2/l4problem9.py#odd", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037829", "code": "def clip(lo, x, hi):\n    return max(lo, min(hi, x))", "entry_point": "clip", "input": "[], ['a', 'b', 'c'], ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mottosso/mitx-6.00.1x/week2/l4problem5.py#clip", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037830", "code": "def format_seconds(seconds):\n    minutes = int(seconds // 60)\n    hours = int(minutes // 60)\n    remainder_sec = seconds % 60\n    remainder_min = minutes % 60\n    output_str = \"\"\n    if hours != 0:\n        output_str += f\"{hours} h \"\n    if minutes != 0:\n        output_str += f\"{remainder_min} min \"\n    output_str += f\"{remainder_sec:.2f} s\"\n    return output_str", "entry_point": "format_seconds", "input": "0", "output": "'0.00 s'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "staadecker/switch/switch_model/utilities/__init__.py#format_seconds", "provenance_class": "collected", "licence": "apache-2.0, ecl-2.0"}
{"id": "the_vault/0037831", "code": "def black_invariant(text, chars=None):\n    if chars is None:\n        chars = [' ', '\\t', '\\n', ',', \"'\", '\"', '(', ')', '\\\\']\n    for char in chars:\n        text = text.replace(char, '')\n    return text", "entry_point": "black_invariant", "input": "'Hello World', ['a', 'b', 'c']", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jonasbb/jupytext/jupytext/combine.py#black_invariant", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037832", "code": "def _reverse_repeat_tuple(t, n):\n            return tuple(x for x in reversed(t) for _ in range(n))", "entry_point": "_reverse_repeat_tuple", "input": "[], -3", "output": "()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vuiseng9/nncf_pytorch/nncf/torch/layers.py#_reverse_repeat_tuple", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037833", "code": "def indexToGridCell(flat_map_index, map_width):\n    grid_cell_map_x = flat_map_index % map_width\n    grid_cell_map_y = flat_map_index // map_width\n    return [grid_cell_map_x, grid_cell_map_y]", "entry_point": "indexToGridCell", "input": "-1.5, True", "output": "[0.5, -2.0]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "rfzeg/pp_unit3_exercises/unit5_pp/scripts/gradient_descent_solution.py#indexToGridCell", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037834", "code": "def calculate_distance(p1, p2):\n  dx = p2[0] - p1[0]\n  dy = p2[1] - p1[1]\n  distance = (dx ** 2 + dy ** 2)**0.5\n  return distance", "entry_point": "calculate_distance", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "2.8284271247461903", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "rfzeg/pp_unit3_exercises/unit4_pp/scripts/unit4_exercise.py#calculate_distance", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037835", "code": "def indexToGridCell(flat_map_index, map_width):\n  grid_cell_map_x = flat_map_index % map_width\n  grid_cell_map_y = flat_map_index // map_width\n  return [grid_cell_map_x, grid_cell_map_y]", "entry_point": "indexToGridCell", "input": "True, 7", "output": "[1, 0]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "rfzeg/pp_unit3_exercises/unit4_pp/scripts/unit4_exercise_server.py#indexToGridCell", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037836", "code": "def average(l):\n    sum=0.0\n    for i in l:\n        sum=sum+i\n    return sum/float(len(l))", "entry_point": "average", "input": "[1, 2, 3]", "output": "2.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/pKaTool/dist_geom.py#average", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037837", "code": "def IsReducedCode(code):\n\tcomponents = code.split(':')\n\tif len(components) == 1:\n\t\treturn True\n\telse:\n\t\treturn False", "entry_point": "IsReducedCode", "input": "'walnut thistle harbour'", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/PEATSA/Core/Utilities.py#IsReducedCode", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037838", "code": "def filter_deletion_insertion(mutation):\n    if mutation.split(':')[0]=='delete':\n        mutation=mutation.replace('delete:','')\n        mutation=mutation+':GLY'\n    elif mutation.find('insert')!=-1:\n        sp=mutation.split(':')\n        mutation='%s:%s:NON:%s' %(sp[1],sp[2],sp[3])\n    elif mutation.find('+')!=-1:\n        raise Exception('Something went wrong. I should have gotten a single mutation and got %s' %mutation)\n    return mutation", "entry_point": "filter_deletion_insertion", "input": "'Hello World'", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/pKa/pKD_tools.py#filter_deletion_insertion", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037839", "code": "def leadingZeros(value, desired_digits):\n    num_zeros = int(desired_digits) - len(str(value))\n    padded_value = []\n    while num_zeros >= 1:\n        padded_value.append(\"0\")\n        num_zeros = num_zeros - 1\n    padded_value.append(str(value))\n    return \"\".join(padded_value)", "entry_point": "leadingZeros", "input": "0, True", "output": "'0'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/PEATDB/Ekin/Utils.py#leadingZeros", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037840", "code": "def CreateCalculationString(calculations, ligandFile):\n\tcalculationString = \"\"\n\tif calculations.count('scan') != 0:\n\t\tcalculationString = calculationString + \"--scan \"\n\tif calculations.count('stability') != 0:\n\t\tcalculationString = calculationString + \" --stability\"\n\tif ligandFile is not None and calculations.count('binding') != 0:\n\t\tcalculationString = calculationString + \" --ligand=%s\" % ligandFile\n\treturn calculationString", "entry_point": "CreateCalculationString", "input": "[[1, 2], [3], []], [[1, 2], [3], []]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/PEATSA/WebApp/JobSubmission.py#CreateCalculationString", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037841", "code": "def parseResName(line):\n\treturn line[17:20].strip()", "entry_point": "parseResName", "input": "'  padded  '", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/pKaTool/Ghosts/utilities_CSP.py#parseResName", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037842", "code": "def parseAtomName(line):\n\treturn line[12:16].strip()", "entry_point": "parseAtomName", "input": "'  padded  '", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/pKaTool/Ghosts/utilities_CSP.py#parseAtomName", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037843", "code": "def parseChainID(line):\n\treturn line[21]", "entry_point": "parseChainID", "input": "'walnut thistle harbour'", "output": "'r'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "shambo001/peat/pKaTool/Ghosts/utilities_CSP.py#parseChainID", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037844", "code": "def format_service_listing(services, print_header=False):\n    if print_header:\n        output = (f\"{'ID':>3} {'PATH':25} {'ENABLED':8} {'PROTOCOL(s)':20} \"\n                  f\"{'DEFAULT':9}\\n\")\n    else:\n        output = \"\"\n    i = 0\n    for item in services:\n        i += 1\n        url = item.get('url_host_name') + item.get('url_context_root')\n        output += (f\"{item['id']:>3} {url[:24]:25} \"\n                   f\"{'Yes' if item['enabled'] else '-':8} \"\n                   f\"{item['url_protocol'][:19]:20} \"\n                   f\"{'Yes' if item['is_default'] else '-':5}\")\n        if i < len(services):\n            output += \"\\n\"\n    return output", "entry_point": "format_service_listing", "input": "set(), 0", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mike-lischke/mysql-shell-plugins/mrs_plugin/services.py#format_service_listing", "provenance_class": "collected", "licence": "apache-2.0, cc0-1.0"}
{"id": "the_vault/0037845", "code": "def format_shape_listing(data):\n    out = \"\"\n    i = 1\n    for s in data:\n        out += f\"{i:>4} {s.shape:20} {s.ocpus:5.1f}x \" \\\n            f\"{s.processor_description[:22]:22} \" \\\n            f\"{s.memory_in_gbs:5.0f}GB Ram\\n\"\n        i += 1\n    return out", "entry_point": "format_shape_listing", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mike-lischke/mysql-shell-plugins/mds_plugin/compute.py#format_shape_listing", "provenance_class": "collected", "licence": "apache-2.0, cc0-1.0"}
{"id": "the_vault/0037846", "code": "def compress(s):\n    n = len(s)\n    i = 0\n    j = 1\n    compressed_str = \"\"\n    while j < len(s):\n        if s[j] == s[i]:\n            j += 1\n        else:\n            compressed_str += s[i] + str(j-i)\n            i = j\n            j += 1\n    compressed_str += s[i] + str(j - i)\n    return compressed_str", "entry_point": "compress", "input": "['apple', 'banana', 'cherry']", "output": "'apple1banana1cherry1'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/utils/string_utils.py#compress", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037847", "code": "def compress_inplace(s):\n    n = len(s)\n    k = 0\n    i = 0\n    j = 1\n    compressed_str = \"\"\n    while j < len(s):\n        if s[j] == s[i]:\n            j += 1\n        else:\n            compressed_str += s[i] + str(j-i)\n            i = j\n            j += 1\n    compressed_str += s[i] + str(j - i)\n    return compressed_str", "entry_point": "compress_inplace", "input": "['apple', 'banana', 'cherry']", "output": "'apple1banana1cherry1'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/utils/string_utils.py#compress_inplace", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037848", "code": "def naive(t: str, w: str) -> list:\n    n = len(t)\n    m = len(w)\n    indexes = []\n    d = 0\n    i = 0\n    while d < n - m:\n        if i == m:  \n            indexes.append(d)\n            i = 0\n            d += 1\n        if t[d + i] == w[i]:\n            i += 1\n        else:\n            i = 0\n            d += 1\n    return indexes", "entry_point": "naive", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/algorithms/string_searching/algorithm.py#naive", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037849", "code": "def padding_4ch(s):\n    n = len(s)\n    r = n % 4\n    if r != 0:\n        k = 4 - r\n        s = k * '0' + s\n    else:\n        s = s\n    s = s[::-1]\n    s = ' '.join(s[i:i + 4] for i in range(0, len(s), 4))\n    s = s[::-1]\n    return s", "entry_point": "padding_4ch", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/utils/int_conversions.py#padding_4ch", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037850", "code": "def logical_not(s):\n    ns = ''\n    for c in s:\n        if c == '0':\n            ns += '1'\n        elif c == '1':\n            ns += '0'\n        else:\n            raise Exception(\"Invalid binary string\")\n    return ns", "entry_point": "logical_not", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/utils/int_conversions.py#logical_not", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037851", "code": "def formatBin(x):  \n    n = len(x)\n    r = n % 8\n    if r != 0:\n        k = 8 - r\n        s = k * '0' + x\n    else:\n        s = x\n    s = ' '.join(s[i:i + 4] for i in range(0, len(s), 4))\n    return s", "entry_point": "formatBin", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/utils/int_conversions.py#formatBin", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037852", "code": "def min_point(points, n_points):\n    min_y_indexes = [0]\n    min_y = points[1][0]\n    for k in range(1, n_points):\n        if points[1][k] < min_y:\n            min_y_indexes = [k]\n        elif points[1][k] == min_y:\n            min_y_indexes.append(k)\n    min_x = points[0][min_y_indexes[0]]\n    min_index = min_y_indexes[0]\n    for k in min_y_indexes:\n        if points[0][k] < min_x:\n            min_index = k\n    return min_index", "entry_point": "min_point", "input": "['apple', 'banana', 'cherry'], True", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "greglan/python_scripts/algorithms/convex_hull.py#min_point", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037853", "code": "def dict_fusion_return_ref(receiver_dict, other_dict):\n        if other_dict is not None:\n            for (key, value) in zip(other_dict.keys(), other_dict.values()):\n                receiver_dict[key] = value\n        return receiver_dict", "entry_point": "dict_fusion_return_ref", "input": "{'a': 1, 'b': 2}, {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "charlypg/RobotWebServices-Python-Interface/http_client.py#dict_fusion_return_ref", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037854", "code": "def call(inputs):\n        return inputs", "entry_point": "call", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "styler00dollar/Colab-docker-aimet/TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/batch_norm_fold.py#call", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037855", "code": "def custom_function_not_to_be_traced(x, y):\n    for i in range(2):\n        x += x\n        y += y\n    return x * x + y * y", "entry_point": "custom_function_not_to_be_traced", "input": "3, True", "output": "160", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "styler00dollar/Colab-docker-aimet/TrainingExtensions/torch/test/python/test_model_preparer.py#custom_function_not_to_be_traced", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037856", "code": "def esc_regex(string):\n    return string.replace('[', '\\\\[')\\\n                 .replace(']', '\\\\]')\\\n                 .replace('\\\\', '\\\\\\\\')\\\n                 .replace('^', '\\\\^')\\\n                 .replace('$', '\\\\$')\\\n                 .replace('.', '\\\\.')\\\n                 .replace('|', '\\\\|')\\\n                 .replace('?', '\\\\?')\\\n                 .replace('*', '\\\\*')\\\n                 .replace('+', '\\\\+')\\\n                 .replace('(', '\\\\(')\\\n                 .replace(')', '\\\\)')", "entry_point": "esc_regex", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "thanasispe/locstats/locstats/definitions.py#esc_regex", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037857", "code": "def as_str(v) -> str:\n        if v is None:\n            return \"none\"\n        elif v is True:\n            return \"true\"\n        elif v is False:\n            return \"false\"\n        else:\n            return str(v)", "entry_point": "as_str", "input": "[[1, 2], [3], []]", "output": "'[[1, 2], [3], []]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "priyankabanda2202/lale/lale/search/PGO.py#as_str", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037858", "code": "def std_float(number, num_decimals=2):\n  return \"{0:.{1:}f}\".format(float(number), num_decimals)", "entry_point": "std_float", "input": "-3, 0", "output": "'-3'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mgoldey/asrtoolkit-draft/asrtoolkit/data_structures/segment.py#std_float", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037859", "code": "def seconds_to_timestamp(seconds):\n  minutes, secondss = divmod(float(seconds), 60)\n  hours, minutes = divmod(minutes, 60)\n  return \"%02d:%02d:%06.3f\" % (hours, minutes, seconds)", "entry_point": "seconds_to_timestamp", "input": "7", "output": "'00:00:07.000'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mgoldey/asrtoolkit-draft/asrtoolkit/data_structures/segment.py#seconds_to_timestamp", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037860", "code": "def TransformDash(n):\n\tif n == '---' or n == '----':\n\t\treturn float(0)\n\telse:\n\t\treturn float(n)", "entry_point": "TransformDash", "input": "0.5", "output": "0.5", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "LiYuzhu12138/3D-DART-server/3d-dart/server/system/Utils.py#TransformDash", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037861", "code": "def TwistCorrect(acctwist,glangles):\n\tcorrected = []\n\tfor angle in range(len(glangles)):\n\t\tcorrected.append(glangles[angle]+acctwist[angle])\n\treturn corrected", "entry_point": "TwistCorrect", "input": "[[1, 2], [3], []], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "LiYuzhu12138/3D-DART-server/3d-dart/server/system/NAfunctionLib.py#TwistCorrect", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037862", "code": "def orb_phase_rate(orb_phase):\n    top = 0.022177\n    bottom = 0.005351\n    if (orb_phase > 0.25 and orb_phase <= 0.80): \n        rate = top\n    elif (orb_phase > 0.9 and orb_phase <= 1) or (orb_phase >= 0.0 and orb_phase <= 0.1): \n        rate = bottom\n    elif (orb_phase > 0.1 and orb_phase <= 0.15):\n        rate = 0.011361\n    elif (orb_phase > 0.15 and orb_phase <= 0.20):\n        rate = 0.014107\n    elif (orb_phase > 0.20 and orb_phase <= 0.25):\n        rate = 0.019135\n    elif (orb_phase > 0.80 and orb_phase <= 0.85):\n        rate = 0.015688\n    elif (orb_phase > 0.85 and orb_phase <= 0.90):\n        rate = 0.011368\n    return rate", "entry_point": "orb_phase_rate", "input": "0.5", "output": "0.022177", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "masonng-astro/nicerpy_xrayanalysis/Lv1_ngc300_mathgrp_pha.py#orb_phase_rate", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037863", "code": "def N_trials(tbin,T):\n    return 1/2 * T/tbin", "entry_point": "N_trials", "input": "2, 0", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "masonng-astro/nicerpy_xrayanalysis/Lv3_detection_level.py#N_trials", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037864", "code": "def modelSpin(model, nodes):\n    state = []\n    for e in nodes:\n        state.append(nodes[e].getSpin())\n    state = ['+' if x > 0 else '-' for x in state]\n    return state", "entry_point": "modelSpin", "input": "{1, 2, 3}, {}", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "francisod/Ising-spin-model/spin.py#modelSpin", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037865", "code": "def make_Hamiltonian(pauli_list):\n    Hamiltonian = 0\n    for p in pauli_list:\n        Hamiltonian += p[0] * p[1].to_matrix()\n    return Hamiltonian", "entry_point": "make_Hamiltonian", "input": "{}", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dsh0416/qiskit-terra/qiskit/tools/apps/optimization.py#make_Hamiltonian", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037866", "code": "def compute_tremor_constancy(tremor_classification_predictions):\n    return tremor_classification_predictions.count(1)/float(len(tremor_classification_predictions))*100.", "entry_point": "compute_tremor_constancy", "input": "[-1, 0, 1, 2]", "output": "25.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "NikhilMahadevan/analyze-tremor-bradykinesia-PD/endpoints/resting_tremor_endpoints.py#compute_tremor_constancy", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037867", "code": "def calculate_hand_movement_bout_lengths(data):\n    count_0 = 0\n    count_1 = 0\n    no_hand_movement_bouts = []\n    hand_movement_bouts = []\n    for idx, i in enumerate(data):\n        if i == 0:\n            count_1 = 0\n            count_0+=1\n            if idx+1<len(data):\n                if data[idx+1]==1:\n                    no_hand_movement_bouts.append(count_0)\n        if i == 1:\n            count_1+=1\n            count_0 = 0\n            if idx+1<len(data):\n                if data[idx+1]==0:\n                    hand_movement_bouts.append(count_1)\n        if idx+1 == len(data):\n            if count_0>0:\n                no_hand_movement_bouts.append(count_0)\n            if count_1>0:\n                hand_movement_bouts.append(count_1)\n    return no_hand_movement_bouts, hand_movement_bouts", "entry_point": "calculate_hand_movement_bout_lengths", "input": "[1, 2, 3]", "output": "([], [1])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "NikhilMahadevan/analyze-tremor-bradykinesia-PD/endpoints/bradykinesia_endpoints.py#calculate_hand_movement_bout_lengths", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037868", "code": "def ZeroMatrix(size, data): \n    row = [0]*size\n    column = [0]*size\n    for i in range(size):\n        for j in range(size):\n            if not data[i][j]:\n                row[i]=column[j]=1\n    for i in range(size):\n        if row[i]:\n            data[i]=[0]*size\n            continue\n        for j in range(size):\n            if column[j]: data[i][j]=0    \n    return data", "entry_point": "ZeroMatrix", "input": "0, ['a', 'b', 'c']", "output": "['a', 'b', 'c']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "anuragvats/CrackingTheCodingInterview/Chapter1/ZeroMatrix.py#ZeroMatrix", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037869", "code": "def isOnePermutationOfOther(s1, s2): \n    a = [0]*26\n    b = [0]*26\n    for i in s1: a[ord(i)-97]+=1\n    for i in s2: b[ord(i)-97]+=1\n    return bool(a==b)", "entry_point": "isOnePermutationOfOther", "input": "['a', 'b', 'c'], []", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "anuragvats/CrackingTheCodingInterview/Chapter1/IsOnePermutationOfOther.py#isOnePermutationOfOther", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037870", "code": "def isSrtingUnique(data):\n    data = sorted(data)\n    for i in range(len(data)-1):    \n        if data[i]==data[i+1]:\n            return False\n    return True", "entry_point": "isSrtingUnique", "input": "[5, 3, 1, 4]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "anuragvats/CrackingTheCodingInterview/Chapter1/IsStringUniqueWithoutAdditionalDataStructure.py#isSrtingUnique", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037871", "code": "def greedy_cow_transport(cows, limit=10):\n    cowsLeft = dict(cows)\n    result = []\n    while cowsLeft != {}:\n        trip = []\n        totalWeight = 0\n        for i in sorted(cowsLeft, key=cowsLeft.get)[::-1]:\n            if (totalWeight + cowsLeft[i]) <= limit:\n                trip.append(i)\n                totalWeight += cowsLeft[i]\n                del cowsLeft[i]\n        result.append(trip)\n    return result", "entry_point": "greedy_cow_transport", "input": "[], 7", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "thiagork/MIT-6.00.2x/6.00.2x-pset1.py#greedy_cow_transport", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037872", "code": "def padr(text, n, c):\n    text = str(text)\n    return text + str(c) * (n - len(text))", "entry_point": "padr", "input": "True, True, 'a,b,c'", "output": "'True'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "valluzzi/libcore/gecosistema_lite/strings.py#padr", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037873", "code": "def padl(text, n, c):\n    text = str(text)\n    return str(c) * (n - len(text)) + text", "entry_point": "padl", "input": "[1, 2, 3], 3, ['a', 'b', 'c']", "output": "'[1, 2, 3]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "valluzzi/libcore/gecosistema_lite/strings.py#padl", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037874", "code": "def isarray(var):\n    return isinstance(var, (list, tuple))", "entry_point": "isarray", "input": "[-1, 0, 1, 2]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "valluzzi/libcore/gecosistema_lite/strings.py#isarray", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037875", "code": "def isnumeric(text):\n    text = text.strip()\n    dot = False\n    for i in range(0, len(text)):\n        c = text[i]\n        if i == 0 and c in \"+-\":\n            continue\n        if c == \".\" and not dot:\n            dot = True\n            continue\n        if not c.isdigit():\n            return False\n    return True", "entry_point": "isnumeric", "input": "'  padded  '", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "valluzzi/libcore/gecosistema_lite/strings.py#isnumeric", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037876", "code": "def normalized_gene_length(gene_length, read_length):\n    if read_length < 1:\n        read_length = 1\n    return (abs(gene_length - read_length)+1)/1000.0", "entry_point": "normalized_gene_length", "input": "1, 3", "output": "0.003", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "wbazant/humann/humann/store.py#normalized_gene_length", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037877", "code": "def harmonic_mean(values):\n    mean=0\n    if values and min(values) > 0:\n        reciprocal_sum=sum((1.0/v) for v in values)\n        mean=len(values)/reciprocal_sum\n    return mean", "entry_point": "harmonic_mean", "input": "[-1, 0, 1, 2]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "wbazant/humann/humann/quantify/modules.py#harmonic_mean", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037878", "code": "def compute_gene_abundance_in_pathways(gene_scores, reactions_database, reactions_in_pathways_present):\n    genes_in_pathways_present={}\n    for bug in reactions_in_pathways_present:\n        genes_in_pathways_present[bug]=set()\n        for reaction in reactions_in_pathways_present[bug]:\n            if reactions_database:\n                gene_list=reactions_database.find_genes(reaction)\n                genes_in_pathways_present[bug].update(gene_list)\n            else:\n                genes_in_pathways_present[bug].add(reaction)\n    gene_abundance_in_pathways={}\n    remaining_gene_abundance={}\n    for bug in genes_in_pathways_present:\n        for gene in genes_in_pathways_present[bug]:\n            gene_abundance_in_pathways[bug]=gene_abundance_in_pathways.get(bug,0)+gene_scores.get_score(bug,gene)\n        total_gene_abundance=sum(gene_scores.scores_for_bug(bug).values())\n        remaining_gene_abundance[bug]=total_gene_abundance-gene_abundance_in_pathways.get(bug,0)\n    return gene_abundance_in_pathways, remaining_gene_abundance", "entry_point": "compute_gene_abundance_in_pathways", "input": "(), [], set()", "output": "({}, {})", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "wbazant/humann/humann/quantify/modules.py#compute_gene_abundance_in_pathways", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037879", "code": "def column_name_list(columns):\n    if not columns:\n        return ''\n    return ', '.join([column.name for column in columns])", "entry_point": "column_name_list", "input": "set()", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "talkingscott/xpgdiff/xpgdiff.py#column_name_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037880", "code": "def bits_to_number(bits):\n    res = 0\n    for x in bits:\n        res = res * 2 + x\n    return res", "entry_point": "bits_to_number", "input": "[-1, 0, 1, 2]", "output": "-4", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "zeigo/jpeg-decoder-py/utils.py#bits_to_number", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037881", "code": "def edge(geom):\n    h = 1e-8\n    try:\n        geomext = geom.exterior\n    except:\n        try:\n            geomext = geom.buffer(h).exterior\n        except:\n            geomext = geom\n    return geomext", "entry_point": "edge", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "gesellkammer/shapelib/shapelib/core.py#edge", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037882", "code": "def make_slider_min_max_values_strings(json_content):\n    for question in json_content:\n        if 'max' in question:\n            question['max'] = str(question['max'])\n        if 'min' in question:\n            question['min'] = str(question['min'])\n    return json_content", "entry_point": "make_slider_min_max_values_strings", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Newbas/beiwe-backend/api/survey_api.py#make_slider_min_max_values_strings", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037883", "code": "def StrongPrimeTest(n,t=2):\n    if n==2:\n        return True\n    if n%2==0:\n        return False\n    m=n-1\n    k=0\n    while m%2==0:\n        m//=2\n        k+=1\n    b=pow(t,m,n)\n    if b==1:\n        return True\n    for i in range(0,k):\n        if b==n-1:\n            return True\n        b=(b*b)%n\n    return False", "entry_point": "StrongPrimeTest", "input": "False, False", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "cdusold/PySpeedup/pyspeedup/algorithms/_primes.py#StrongPrimeTest", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037884", "code": "def cleanup_title(s):\n    s = s.lower()\n    s = s.capitalize()\n    return s", "entry_point": "cleanup_title", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "MUONetwork/muon.github.io/bibtex2html/bibtex2html.py#cleanup_title", "provenance_class": "collected", "licence": "cc-by-3.0"}
{"id": "the_vault/0037885", "code": "def harmonize_dict(mapping, input_dict):\n        output_dict = dict()\n        for k, v in mapping.items():\n            if v in input_dict:\n                output_dict[k] = input_dict[v]\n        return output_dict", "entry_point": "harmonize_dict", "input": "{}, {}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Duke-GCB/gcb-web-auth/gcb_web_auth/backends/base.py#harmonize_dict", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037886", "code": "def make_users_groups_url(base_url, duke_unique_id):\n    return \"{}/subjects/{}/groups\".format(base_url, duke_unique_id)", "entry_point": "make_users_groups_url", "input": "['a', 'b', 'c'], []", "output": "\"['a', 'b', 'c']/subjects/[]/groups\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Duke-GCB/gcb-web-auth/gcb_web_auth/groupmanager.py#make_users_groups_url", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037887", "code": "def valid(day, meal):\n    if \"Tuesday\" not in day:\n        return True \n    else:\n        if meal.feeds_a_crowd.item() == \"Yes\":\n            return True \n        return False", "entry_point": "valid", "input": "[-1, 0, 1, 2], []", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "calebmeyer/meal-planner/Pick meals!.py#valid", "provenance_class": "collected", "licence": "unlicense"}
{"id": "the_vault/0037888", "code": "def convert_unicode_to_binary(unicode_input):\n    binary_output = ''\n    for character in unicode_input:\n        binary_output += str(bin(ord(character)))[2:].zfill(18)\n    return binary_output", "entry_point": "convert_unicode_to_binary", "input": "['a', 'b', 'c']", "output": "'000000000001100001000000000001100010000000000001100011'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mbingenheimer/sutra2DNA/reed_solomon.py#convert_unicode_to_binary", "provenance_class": "collected", "licence": "cc0-1.0"}
{"id": "the_vault/0037889", "code": "def convert_binary_to_unicode(binary_input):\n    unicode_output = ''\n    for starting_position in range(0, len(binary_input), 18):\n        unicode_output += chr(int(binary_input[starting_position:starting_position + 18], 2))\n    return unicode_output", "entry_point": "convert_binary_to_unicode", "input": "set()", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mbingenheimer/sutra2DNA/reed_solomon.py#convert_binary_to_unicode", "provenance_class": "collected", "licence": "cc0-1.0"}
{"id": "the_vault/0037890", "code": "def convert_encoded_to_dna(encoded, transcoding):\n    dna_binary = ''\n    for character in encoded:\n        dna_binary += str(bin(ord(character)))[2:].zfill(8)\n    return ''.join([transcoding[2*int(dna_binary[i]) + int(dna_binary[i+1])] for i in range(0, len(dna_binary) - 2, 2)])", "entry_point": "convert_encoded_to_dna", "input": "[], [-1, 0, 1, 2]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mbingenheimer/sutra2DNA/reed_solomon.py#convert_encoded_to_dna", "provenance_class": "collected", "licence": "cc0-1.0"}
{"id": "the_vault/0037891", "code": "def convert_dna_to_encoded(dna_string, transcoding):\n    encoded_string = ''\n    binary_stage = ''\n    for character in dna_string:\n        binary_stage += str(int(transcoding.index(character) / 2))\n        binary_stage += str(int(transcoding.index(character) % 2))\n    for i in range(0, len(binary_stage), 8):\n        encoded_string += chr(int(binary_stage[i:i + 8], 2))\n    return encoded_string", "entry_point": "convert_dna_to_encoded", "input": "'', [1, 2, 3]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mbingenheimer/sutra2DNA/reed_solomon.py#convert_dna_to_encoded", "provenance_class": "collected", "licence": "cc0-1.0"}
{"id": "the_vault/0037892", "code": "def generate_centroids(regions):\n    centroids = []\n    if regions != []:\n        for region in regions:\n            centroids.append(((region[1]+ region[3])/2, (region[0]+ region[2])/2))\n    return centroids", "entry_point": "generate_centroids", "input": "()", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "TheJacksonLaboratory/detect_rois_omero/src/create_rois.py#generate_centroids", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037893", "code": "def check_aspect_ratio(region, threshold):\n    bbox = region\n    ratio = (bbox[2]-bbox[0])/(bbox[3]-bbox[1])\n    if ratio > threshold or ratio < (1/threshold):\n        return True", "entry_point": "check_aspect_ratio", "input": "[-1, 0, 1, 2], 0.5", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "TheJacksonLaboratory/detect_rois_omero/src/create_rois.py#check_aspect_ratio", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037894", "code": "def merge_regions(region,other):\n    y1 = min(region[0],other[0])\n    x1 = min(region[1], other[1])\n    y2 = max(region[2], other[2])\n    x2 = max(region[3], other[3])\n    return (y1,x1,y2,x2)", "entry_point": "merge_regions", "input": "[5, 3, 1, 4], [5, 3, 1, 4]", "output": "(5, 3, 1, 4)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "TheJacksonLaboratory/detect_rois_omero/src/create_rois.py#merge_regions", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037895", "code": "def needleman_wunsch(sequence1, sequence2):\n    data = [[None for _ in range(len(sequence1) + 1)]\n            for _ in range(len(sequence2) + 1)]\n    traceback = [[None for _ in range(len(sequence1) + 1)]\n                 for _ in range(len(sequence2) + 1)]\n    for top in range(len(sequence1) + 1):\n        data[0][top] = top\n        traceback[0][top] = \"\u2190\"\n    for left in range(len(sequence2) + 1):\n        data[left][0] = left\n        traceback[left][0] = \"\u2191\"\n    for column in range(len(sequence1)):\n        for row in range(len(sequence2)):\n            topleft = data[row][column]\n            top = data[row][column + 1]\n            left = data[row + 1][column]\n            replace_cost = 0 if sequence1[column] == sequence2[row] else 1\n            from_topleft = topleft + replace_cost\n            from_top = top + 1\n            from_left = left + 1\n            if from_topleft < from_top and from_topleft < from_left:\n                direction = \"\u2196\"\n                cell = from_topleft\n            elif from_top < from_left:\n                direction = \"\u2191\"\n                cell = from_top\n            else:\n                direction = \"\u2190\"\n                cell = from_left\n            data[row + 1][column + 1] = cell\n            traceback[row + 1][column + 1] = direction\n    distance = data[-1][-1]\n    column = len(sequence1)\n    row = len(sequence2)\n    alignment = []\n    while row > 0 or column > 0:\n        if traceback[row][column] == \"\u2196\":\n            alignment.insert(0, (sequence1[column - 1], sequence2[row - 1]))\n            row = row - 1\n            column = column - 1\n        elif traceback[row][column] == \"\u2190\":\n            alignment.insert(0, (sequence1[column - 1], None))\n            column = column - 1\n        elif traceback[row][column] == \"\u2191\":\n            alignment.insert(0, (None, sequence2[row - 1]))\n            row = row - 1\n        else:\n            raise RuntimeError\n    return distance, alignment", "entry_point": "needleman_wunsch", "input": "[5, 3, 1, 4], [1, 2, 3]", "output": "(4, [(5, 1), (None, 2), (3, 3), (1, None), (4, None)])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Anaphory/100woerterbuecher/05-Needleman-Wunsch/needlemanwunsch.py#needleman_wunsch", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037896", "code": "def str2bool(cstr: str) -> bool:\n    return cstr in ['True', 'true', 't', True]", "entry_point": "str2bool", "input": "['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "olmozavala/eoas-pyutils/io_utils/io_common.py#str2bool", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037897", "code": "def __corners_to_slices(start, stop):\n            slices = []\n            for idim in range(len(start)):\n                slices.append(slice(start[idim], stop[idim]))\n            return slices", "entry_point": "__corners_to_slices", "input": "[], ['apple', 'banana', 'cherry']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "ondrejdyck/sidpy/sidpy/hdf/reg_ref.py#__corners_to_slices", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037898", "code": "def underscore_uppercase(name):\n    return name.replace('-', '_').upper()", "entry_point": "underscore_uppercase", "input": "'walnut thistle harbour'", "output": "'WALNUT THISTLE HARBOUR'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "basit9958/chaos-mesh/build/utils.py#underscore_uppercase", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037899", "code": "def human_time(minutes):\n    minutes = int(minutes)\n    hours = minutes // 60\n    mins = minutes % 60\n    return \"{}h{}m\".format(hours, mins)", "entry_point": "human_time", "input": "False", "output": "'0h0m'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "ravenscroftj/timetrack/timetrack/__init__.py#human_time", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037900", "code": "def checksum(string):\n    csum = 0\n    count_to = (len(string) // 2) * 2\n    count = 0\n    while count < count_to:\n        thisVal = string[count + 1] * 256 + string[count]\n        csum = csum + thisVal\n        csum = csum & 0xffffffff\n        count = count + 2\n    if count_to < len(string):\n        csum = csum + string[len(string) - 1]\n        csum = csum & 0xffffffff\n    csum = (csum >> 16) + (csum & 0xffff)\n    csum = csum + (csum >> 16)\n    answer = ~csum\n    answer = answer & 0xffff\n    answer = answer >> 8 | (answer << 8 & 0xff00)\n    return answer", "entry_point": "checksum", "input": "''", "output": "65535", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Hephaest/ComputerNetworkApplications/Traceroute/Traceroute.py#checksum", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037901", "code": "def checksum(string):\n    csum = 0\n    count_to = (len(string) // 2) * 2\n    count = 0\n    while count < count_to:\n        this_val = string[count + 1] * 256 + string[count]\n        csum = csum + this_val\n        csum = csum & 0xffffffff\n        count = count + 2\n    if count_to < len(string):\n        csum = csum + string[len(string) - 1]\n        csum = csum & 0xffffffff\n    csum = (csum >> 16) + (csum & 0xffff)\n    csum = csum + (csum >> 16)\n    answer = ~csum\n    answer = answer & 0xffff\n    answer = answer >> 8 | (answer << 8 & 0xff00)\n    return answer", "entry_point": "checksum", "input": "''", "output": "65535", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Hephaest/ComputerNetworkApplications/ICMP Ping/ICMPPing.py#checksum", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037902", "code": "def ping_statistics(list):\n    max_delay = list[0]\n    mini_delay = list[0]\n    sum = 0\n    for item in list:\n        if item >= max_delay:\n            max_delay = item\n        elif item <= mini_delay:\n            mini_delay = item\n        sum += item\n    avg_delay = int(sum / (len(list)))\n    return mini_delay, max_delay, avg_delay", "entry_point": "ping_statistics", "input": "[-1, 0, 1, 2]", "output": "(-1, 2, 0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Hephaest/ComputerNetworkApplications/ICMP Ping/ICMPPing.py#ping_statistics", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037903", "code": "def paths_only(path):\n    l = []\n    for p in path:\n        l.append(p[0])\n    return l", "entry_point": "paths_only", "input": "'Hello World'", "output": "['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "dsuch/dpath-python/dpath/path.py#paths_only", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037904", "code": "def actions(board):\n    possible_moves = set()\n    for row_index, row in enumerate(board):\n        for column_index, item in enumerate(row):\n            if item == None:\n                possible_moves.add((row_index, column_index))\n    return possible_moves", "entry_point": "actions", "input": "['a', 'b', 'c']", "output": "set()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bharatchanddandamudi/cs50ai/week0/tictactoe/tictactoe.py#actions", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037905", "code": "def iterate_pagerank(corpus, damping_factor):\n    ranks = {}\n    threshold = 0.0005\n    N = len(corpus)\n    for key in corpus:\n        ranks[key] = 1 / N\n    while True:\n        count = 0\n        for key in corpus:\n            new = (1 - damping_factor) / N\n            sigma = 0\n            for page in corpus:\n                if key in corpus[page]:\n                    num_links = len(corpus[page])\n                    sigma = sigma + ranks[page] / num_links\n            sigma = damping_factor * sigma\n            new += sigma\n            if abs(ranks[key] - new) < threshold:\n                count += 1\n            ranks[key] = new \n        if count == N:\n            break\n    return ranks", "entry_point": "iterate_pagerank", "input": "(), {1, 2, 3}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "bharatchanddandamudi/cs50ai/week2/pagerank/pagerank.py#iterate_pagerank", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037906", "code": "def default_holdout_frac(num_train_rows, hyperparameter_tune=False):\n    if num_train_rows < 5000:\n        holdout_frac = max(0.1, min(0.2, 500.0 / num_train_rows))\n    else:\n        holdout_frac = max(0.01, min(0.1, 2500.0 / num_train_rows))\n    if hyperparameter_tune:\n        holdout_frac = min(0.2, holdout_frac * 2)  \n    return holdout_frac", "entry_point": "default_holdout_frac", "input": "True, 'Hello World'", "output": "0.2", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Anon-Artist/autogluon/core/src/autogluon/core/utils/utils.py#default_holdout_frac", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037907", "code": "def tag_to_readable(tag, conversion):\n    parts = []\n    for index, char in enumerate(tag):\n        if char == '-': continue\n        parts.append(conversion[index][char] if char in conversion[index] else char)\n    return \" \".join(parts)", "entry_point": "tag_to_readable", "input": "[], ['apple', 'banana', 'cherry']", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "offerijns/deepmorpheus/deepmorpheus/util.py#tag_to_readable", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037908", "code": "def is_isogram(string):\n    if type(string) != str:\n        raise TypeError ('Argument not a string')\n    elif string == \"\":\n        return True\n    elif (string, str) and len(string) != 0:\n        string = string.lower()\n        if \"-\" in string:\n            string_new=string.replace('-', '')\n            if len(string_new) == len(set(string_new)): \n                return True\n            else:\n                 return False\n        elif ' ' in string:\n            string_new = string.replace(\" \", \"\")\n            if len(string_new) == len(set(string_new)):\n                return True\n            else:\n                return False\n        elif len(string) == len(set(string)):\n            return True\n        else:\n            return False", "entry_point": "is_isogram", "input": "'  padded  '", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Kalpavrikshika/Exercism-tests/isogram/isogram.py#is_isogram", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037909", "code": "def fmc_name_mangle(name):\n    return name.replace('LA0', 'LA').replace('LA', 'LA_').replace('_CC', '')", "entry_point": "fmc_name_mangle", "input": "'a,b,c'", "output": "'a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mfkiwl/Bedrock/projects/oscope/marblemini/remap_gen.py#fmc_name_mangle", "provenance_class": "collected", "licence": "rsa-md"}
{"id": "the_vault/0037910", "code": "def c2f(t):\n    return t * float(1.8000) + float(32.00)", "entry_point": "c2f", "input": "True", "output": "33.8", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "ampledata/netatmoaprs/netatmoaprs/util.py#c2f", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037911", "code": "def _split_datafiles(data, val_size=0.2, test_size=0.2):\n        val_length = int(len(data) * val_size)\n        test_length = int(len(data) * test_size)\n        val_set = data[:val_length]\n        test_set = data[val_length:val_length + test_length]\n        train_set = data[val_length + test_length:]\n        return train_set, val_set, test_set", "entry_point": "_split_datafiles", "input": "[[1, 2], [3], []], 5, 2", "output": "([], [[1, 2], [3], []], [])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "alexkost819/thesis/data_processor.py#_split_datafiles", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037912", "code": "def perc_str_to_float(perc_str):\n    if type(perc_str) is str:\n        try:\n            fl_num = float(perc_str.replace(',', '').replace('%', ''))\n            fl = fl_num / 100\n        except:\n            fl = float(\"NaN\")\n    else:\n        try:\n            fl_num = float(perc_str)\n            fl = fl_num / 100\n        except:\n            fl = float(\"NaN\")\n    return fl", "entry_point": "perc_str_to_float", "input": "True", "output": "0.01", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Saran33/TickerScrape/TickerScrape/items.py#perc_str_to_float", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037913", "code": "def strp_brackets(text):\n    return text.strip().strip('(').strip(')')", "entry_point": "strp_brackets", "input": "'walnut thistle harbour'", "output": "'walnut thistle harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Saran33/TickerScrape/TickerScrape/items.py#strp_brackets", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037914", "code": "def truncate_word_hard(word):\n    assert isinstance(word, str), \\\n        '[internal] word is not a string: %r' % word\n    if word:\n        return word[0]\n    return word", "entry_point": "truncate_word_hard", "input": "'a,b,c'", "output": "'a'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "mrmansano/sublime-ycmd/lib/util/log.py#truncate_word_hard", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037915", "code": "def resolve_stack_name(source_stack_name, destination_stack_path):\n    if \"/\" in destination_stack_path:\n        return destination_stack_path\n    else:\n        source_stack_base_name = source_stack_name.rsplit(\"/\", 1)[0]\n        return \"/\".join([source_stack_base_name, destination_stack_path])", "entry_point": "resolve_stack_name", "input": "'Hello World', '  padded  '", "output": "'Hello World/  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "rootifera/sceptre/sceptre/helpers.py#resolve_stack_name", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037916", "code": "def make_json(row_headers, data):\n    json_data=[]\n    for result in data:\n        result = list(result)\n        result[2] = str(result[2])\n        result[3] = str(result[3])\n        json_data.append(dict(zip(row_headers,result)))\n    return json_data", "entry_point": "make_json", "input": "[5, 3, 1, 4], ['apple', 'banana', 'cherry']", "output": "[{5: 'a', 3: 'p', 1: 'p', 4: 'l'}, {5: 'b', 3: 'a', 1: 'n', 4: 'a'}, {5: 'c', 3: 'h', 1: 'e', 4: 'r'}]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "FlorisFok/DataVisualisation/dockers/API/restV1.py#make_json", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037917", "code": "def osiris_url(course_code, calendar_year) -> str:\n    return \"https://osiris.utwente.nl/student/OnderwijsCatalogusSelect.do\" \\\n           \"?selectie=cursus&cursus={}&collegejaar={}\" \\\n        .format(course_code, calendar_year)", "entry_point": "osiris_url", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "\"https://osiris.utwente.nl/student/OnderwijsCatalogusSelect.do?selectie=cursus&cursus=['a', 'b', 'c']&collegejaar=['a', 'b', 'c']\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "rhbvkleef/SteamBird/steambird/templatetags/ut_url_mapper.py#osiris_url", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037918", "code": "def people_utwente(initials, surname_prefix, surname) -> str:\n    if surname_prefix is None:\n        surname_prefix = \"\"\n    return \"https://people.utwente.nl/{}{}{}\" \\\n        .format(initials, surname_prefix, surname).replace(' ', '')", "entry_point": "people_utwente", "input": "[[1, 2], [3], []], 'Hello World', 'abc'", "output": "'https://people.utwente.nl/[[1,2],[3],[]]HelloWorldabc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "rhbvkleef/SteamBird/steambird/templatetags/ut_url_mapper.py#people_utwente", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037919", "code": "def ten_nearest(list_of_films:list) -> list:\n    nearest_films = []\n    for bottom in range (len(list_of_films) - 1) :\n        idx = bottom\n        for itr in range (bottom+1, len(list_of_films)) :\n            if list_of_films[itr][1] < list_of_films[idx][1] :\n                idx = itr\n        list_of_films[bottom], list_of_films[idx] = list_of_films[idx],\\\n             list_of_films[bottom] \n    idx = 10\n    if len(list_of_films) < 10 :\n        idx = len(list_of_films)\n    for itr in range(idx) :\n        nearest_films.append((list_of_films[itr][0], list_of_films[itr][2],\\\n             list_of_films[itr][3]))\n    return nearest_films", "entry_point": "ten_nearest", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "glibesyck/web_map/map_generating.py#ten_nearest", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037920", "code": "def exec_fn(func):\n    try:\n        return {'result': func()}\n    except Exception as error: \n        return {'error': str(error)}", "entry_point": "exec_fn", "input": "[-1, 0, 1, 2]", "output": "{'error': \"'list' object is not callable\"}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "milikhin/seabass-editor/generic/py-backend/helpers/exec_fn.py#exec_fn", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037921", "code": "def to_ordinal(number):\n    assert isinstance(number, int)\n    sr = str(number)  \n    ld = sr[-1]  \n    try:\n        stld = sr[-2]\n    except IndexError:\n        stld = None\n    if stld != '1':\n        if ld == '1':\n            return sr + 'st'\n        if ld == '2':\n            return sr + 'nd'\n        if ld == '3':\n            return sr + 'rd'\n    return sr + 'th'", "entry_point": "to_ordinal", "input": "0", "output": "'0th'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "opendatatrentino/opendata-harvester/harvester/utils/__init__.py#to_ordinal", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037922", "code": "def normalize_case(text):\n    SPECIAL_CASE_WORDS = [\n        'Trento', 'Provincia',\n    ]\n    text = text.lower()\n    for word in SPECIAL_CASE_WORDS:\n        text.replace(word.lower(), word)\n    return text.capitalize()", "entry_point": "normalize_case", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "opendatatrentino/opendata-harvester/harvester/utils/__init__.py#normalize_case", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037923", "code": "def sqrt(x):\n \treturn (x**.5)", "entry_point": "sqrt", "input": "0", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GANG5TER/calculator-1/team1.py#sqrt", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037924", "code": "def log10(x):\n    temp = x\n    count = 0\n    while temp >= 10:\n        temp = temp / 10\n        count += 1\n    return count", "entry_point": "log10", "input": "False", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GANG5TER/calculator-1/team4.py#log10", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037925", "code": "def multiply(x, y):\n\tanswer = 0 \n\tif x == 0: \n\t\treturn 0\n\tif y == 0:\n\t\treturn 0\n\twhile y > 0:\n\t\tanswer += x\n\t\ty = y - 1 \n\treturn answer", "entry_point": "multiply", "input": "3.25, False", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GANG5TER/calculator-1/team5.py#multiply", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037926", "code": "def pow(b, e):\n\ttotal = 1\n\tfor i in range(e):\n\t\ttotal = total * b\n\treturn total", "entry_point": "pow", "input": "3, 10", "output": "59049", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "GANG5TER/calculator-1/team3.py#pow", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037927", "code": "def covariates_at_spikes(spiketimes, behaviour_data):\n    cov_s = tuple([] for n in behaviour_data)\n    units = len(spiketimes)\n    for u in range(units):\n        for k, cov_t in enumerate(behaviour_data):\n            cov_s[k].append(cov_t[spiketimes[u]])\n    return cov_s", "entry_point": "covariates_at_spikes", "input": "[1, 2, 3], ['apple', 'banana', 'cherry']", "output": "(['p', 'p', 'l'], ['a', 'n', 'a'], ['h', 'e', 'r'])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "davindicode/universal_count_model/neuroprob/utils/neural.py#covariates_at_spikes", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037928", "code": "def is_leap(year):\n    if year % 4 != 0:\n        return False\n    elif year % 100 != 0:\n        return True\n    elif year % 400 != 0:\n        return False\n    else:\n        return True", "entry_point": "is_leap", "input": "True", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "niveditalodha/ReadME/codeletter/codeletter/utils.py#is_leap", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037929", "code": "def model_as_json(html_values):\n    ip_dict = []\n    header = [\"IP\"]\n    for ip_address in html_values.split('\\n'):\n        my_list = list([])\n        my_list.append(ip_address)\n        ip_dict.append(dict(zip(header, my_list)))\n    return ip_dict", "entry_point": "model_as_json", "input": "'a,b,c'", "output": "[{'IP': 'a,b,c'}]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "tzamalisp/saint-open-source-tool-for-cyberthreats-monitoring/back-end/threats_monitoring/webBasedAttacks1.py#model_as_json", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037930", "code": "def model_as_json(bot_entries):\n    json_list = []\n    for bot_entry in bot_entries:\n        json_object = {\n            \"_id\": bot_entry[2],\n            \"Category\": \"Botnets\",\n            \"Entity-Type\": \"IP\",\n            \"IP\": bot_entry[0],\n            \"Botscout-id\": bot_entry[2],\n            \"Bot-Name\": bot_entry[4],\n            \"Email\": bot_entry[5],\n            \"TimestampUTC\": bot_entry[6],\n            \"mongoDate\": bot_entry[7],\n            \"DatetimeUTC\": bot_entry[8],\n            \"TimestampUTC-CTI\": bot_entry[9],\n            \"mongoDate-CTI\": bot_entry[10],\n            \"DatetimeUTC-CTI\": bot_entry[11],\n            \"Country\": bot_entry[1],\n        }\n        json_list.append(json_object)\n    return json_list", "entry_point": "model_as_json", "input": "()", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "tzamalisp/saint-open-source-tool-for-cyberthreats-monitoring/back-end/threats_monitoring/botscout.py#model_as_json", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037931", "code": "def delete_delete(modelId):  \n    \"\"\"Deletes a model from storage\n    :param modelId: id of the model to delete\n    :type modelId: str\n    :rtype: None\n    \"\"\"\n    return 'do some magic!'", "entry_point": "delete_delete", "input": "['apple', 'banana', 'cherry']", "output": "'do some magic!'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vtisler/stock_martket_forecast/swagger_server/controllers/delete_controller.py#delete_delete", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037932", "code": "def timezero_shift(timeData, timeZero = 0, reverse = 'False'):\n    timeData = timeData - timeZero\n    if reverse:\n        timeData = -timeData\n    return(timeData)", "entry_point": "timezero_shift", "input": "3, 5, False", "output": "-2", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "apokhr/PumpProbe-analysis/lib/redred.py#timezero_shift", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037933", "code": "def norm_to_pump(dataDict):\n    dataDictNorm = dataDict\n    norm = []\n    for key in dataDict:\n        norm = dataDict[key]['data'][1] / dataDict[key]['Pump Power']\n        dataDictNorm[key]['data'][1] = norm\n    return(dataDictNorm)", "entry_point": "norm_to_pump", "input": "{}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "apokhr/PumpProbe-analysis/lib/redred.py#norm_to_pump", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037934", "code": "def _partition_version(segments):\n    needle = len(segments)\n    for index, segment in enumerate(segments):\n        try:\n            int(segment)\n        except ValueError:\n            needle = index\n            break\n    return '.'.join(segments[:needle]), '.'.join(segments[needle:])", "entry_point": "_partition_version", "input": "['apple', 'banana', 'cherry']", "output": "('', 'apple.banana.cherry')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "movermeyer/setupext-gitversion/setupext/gitversion.py#_partition_version", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037935", "code": "def merge_and_count(first, second):\n    i = 0\n    j = 0\n    ret = []\n    number_of_inversion = 0\n    while len(ret) != len(first) + len(second):\n        if i == len(first):\n            ret += second[j:]\n        elif j == len(second):\n            ret += first[i:]\n        else:\n            if first[i] < second[j]:\n                ret.append(first[i])\n                i += 1\n            else:\n                ret.append(second[j])\n                j += 1\n                number_of_inversion += len(first) - i\n    return ret,number_of_inversion", "entry_point": "merge_and_count", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "(['a', 'apple', 'b', 'banana', 'c', 'cherry'], 6)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "kirnap/algorithms-in-python/count_number_of_inversions.py#merge_and_count", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037936", "code": "def parse_data_one(data, int_format=True):\n    data_array = []\n    for byte_idx, byte in enumerate(data):\n        if int_format: \n            data_array.append(int(byte))\n        else:\n            data_array.append(byte)\n    return data_array", "entry_point": "parse_data_one", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[-1, 0, 1, 2]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "PeterKillerio/Reliable_data_transfer_with_UDP_and_Python/protocol_descriptors.py#parse_data_one", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037937", "code": "def remove_sumwt(results):\n    return [d[0] for d in results]", "entry_point": "remove_sumwt", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "ska-telescope/algorithm-reference-library/workflows/shared/imaging/imaging_shared.py#remove_sumwt", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037938", "code": "def _get_sm_proj_id(proj: str, namespace='main'):\n    if proj == 'csiro-als':  \n        proj = 'nagim'\n    if namespace != 'main':\n        proj = f'{proj}-test'\n    return proj", "entry_point": "_get_sm_proj_id", "input": "[[1, 2], [3], []], '  padded  '", "output": "'[[1, 2], [3], []]-test'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jeremiahwander/sample-metadata/scripts/parse_nagim.py#_get_sm_proj_id", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037939", "code": "def fib(n):\n    a = 0\n    b = 1\n    for i in range(n):\n        a,b = b,a+b\n    return a", "entry_point": "fib", "input": "2", "output": "1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Menosse/python-programmer/1. Spyder python files/9.0.1_Files_&_Functions.py#fib", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037940", "code": "def paranthesesChecker(tree):\n\tparanthesesStack = []\n\ttry:\t\n\t\tfor elem in tree:\n\t\t\tif(elem == \"[\"):\n\t\t\t\tparanthesesStack.append(elem)\n\t\t\telif(elem == \"]\"):\n\t\t\t\tparanthesesStack.pop()\n\t\tif(len(paranthesesStack) == 0):\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False\n\texcept:\n\t\treturn False", "entry_point": "paranthesesChecker", "input": "[]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vighneshvnkt/data-ductus-challenge/ParanthesisTreePrinter.py#paranthesesChecker", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037941", "code": "def tabs(count):\n\temptySpaces = ''\n\tif(count <= 0):\n\t\treturn emptySpaces\n\twhile(count > 0):\n\t\temptySpaces = emptySpaces + '    '\n\t\tcount = count - 1\n\treturn emptySpaces", "entry_point": "tabs", "input": "-3", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "vighneshvnkt/data-ductus-challenge/ParanthesisTreePrinter.py#tabs", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037942", "code": "def rotated_array_search(input_list, number):\n    if len(input_list) == 0:\n        return -1\n    list_len = len(input_list)\n    left_index = 0\n    right_index = list_len - 1\n    while not left_index > right_index:\n        mid = (left_index + right_index) // 2\n        if input_list[mid] == number:\n            return mid\n        if input_list[left_index] <= input_list[mid]:\n            if input_list[left_index] <= number <= input_list[mid]:\n                right_index = mid - 1\n            else:\n                left_index = mid + 1\n        elif input_list[mid] <= number <= input_list[right_index]:\n            left_index = mid + 1\n        else:\n            right_index = mid - 1\n    return -1", "entry_point": "rotated_array_search", "input": "[5, 3, 1, 4], 5", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "alessandrome/udacity-nanodegree-data-structures-n-algorithms-basic-algorithms/src/p2_search_rotated.py#rotated_array_search", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037943", "code": "def estimated_reading_time(text):\n    mins = int(len(text)/200)\n    seconds = int((float(len(text)/200) - mins)*60)\n    return \"( Estimated reading time: {} mins, {} seconds )\".format(str(mins),str(seconds))", "entry_point": "estimated_reading_time", "input": "'walnut thistle harbour'", "output": "'( Estimated reading time: 0 mins, 6 seconds )'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "Imlucky883/Text-Summarization-Web-Application/summarizer.py#estimated_reading_time", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037944", "code": "def addmul(terms):\n        while len(terms) > 1:\n            if any(t == \"+\" for t in terms):\n                for i in range(len(terms)):\n                    if terms[i] == \"+\":\n                        new = terms[i - 1] + terms[i + 1]\n                        terms = terms[: i - 1] + [new] + terms[i + 2 :]\n                        break\n            else:\n                for i in range(len(terms)):\n                    if terms[i] == \"*\":\n                        new = terms[i - 1] * terms[i + 1]\n                        terms = terms[: i - 1] + [new] + terms[i + 2 :]\n                        break\n                else:\n                    break\n        return terms[0]", "entry_point": "addmul", "input": "[-1, 0, 1, 2]", "output": "-1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sumnerevans/advent-of-code/2020/18.py#addmul", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037945", "code": "def extended_gcd(a, b):\n    old_r, r = a, b\n    old_s, s = 1, 0\n    old_t, t = 0, 1\n    while r:\n        quotient, remainder = divmod(old_r, r)\n        old_r, r = r, remainder\n        old_s, s = s, old_s - quotient * s\n        old_t, t = t, old_t - quotient * t\n    return old_r, old_s, old_t", "entry_point": "extended_gcd", "input": "[-1, 0, 1, 2], []", "output": "([-1, 0, 1, 2], 1, 0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sumnerevans/advent-of-code/2020/13.py#extended_gcd", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037946", "code": "def mul_inv(a, b):\n    b0 = b\n    x0, x1 = 0, 1\n    if b == 1:\n        return 1\n    while a > 1:\n        q = a // b\n        a, b = b, a % b\n        x0, x1 = x1 - q * x0, x0\n    if x1 < 0:\n        x1 += b0\n    return x1", "entry_point": "mul_inv", "input": "-1.5, -3", "output": "1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sumnerevans/advent-of-code/2020/13.py#mul_inv", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037947", "code": "def pos(directions):\n    x, y = 0, 0\n    for dx, dy in directions:\n        x, y = x + dx, y + dy\n    return x, y", "entry_point": "pos", "input": "[]", "output": "(0, 0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sumnerevans/advent-of-code/2020/24.py#pos", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037948", "code": "def adjs(x, y):\n        return (\n            (x + 2, y),  \n            (x - 2, y),  \n            (x + 1, y + 1),  \n            (x + 1, y - 1),  \n            (x - 1, y + 1),  \n            (x - 1, y - 1),  \n        )", "entry_point": "adjs", "input": "2, 3", "output": "((4, 3), (0, 3), (3, 4), (3, 2), (1, 4), (1, 2))", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "sumnerevans/advent-of-code/2020/24.py#adjs", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037949", "code": "def common_letters(str1, str2):\n    dict_ = []\n    if len(str1) > len(str2):\n        str_ = str1\n    else:\n        str_ = str2\n    for letter in str_:\n        if letter in str2 and letter in str1 and letter not in dict_:\n            dict_.append(letter)\n    return dict_", "entry_point": "common_letters", "input": "[1, 2, 3], ['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "evan-tan/learning/python/strings.py#common_letters", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037950", "code": "def df_to_joints(df):\n    joints = sorted(set((x.split('.')[0] for x in df if x != 'time')))\n    return joints", "entry_point": "df_to_joints", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "OlafHaag/bvh-tools/src/bvhtoolbox/convert/csv2bvh.py#df_to_joints", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037951", "code": "def _close_scopes(hierarchy_string, target_depth=0):\n    last_depth = hierarchy_string[hierarchy_string[:-1].rfind(\"\\n\"):].count(\"  \")\n    diff = last_depth - target_depth\n    for depth in range(diff):\n        hierarchy_string += '{0}}}\\n'.format('  ' * (last_depth - depth - 1))\n    return hierarchy_string", "entry_point": "_close_scopes", "input": "'', 10", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "OlafHaag/bvh-tools/src/bvhtoolbox/convert/csv2bvh.py#_close_scopes", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037952", "code": "def classes_balanced(c1, c2):\n    return 0.5 <= len(c1) / len(c2) <= 2", "entry_point": "classes_balanced", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jscheytt/endo-loc/prep/preprocessor.py#classes_balanced", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037953", "code": "def clamp(n, minn, maxn):\n    return min(max(n, minn), maxn)", "entry_point": "clamp", "input": "[5, 3, 1, 4], [1, 2, 3], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jscheytt/endo-loc/helper/helper.py#clamp", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037954", "code": "def flatten_int(l):\n    return [int(item) for sublist in l for item in sublist]", "entry_point": "flatten_int", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jscheytt/endo-loc/helper/helper.py#flatten_int", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037955", "code": "def maxval_of_2dlist(ll):\n    maxval = 0\n    for l in ll:\n        maxval = max(l)\n    return maxval", "entry_point": "maxval_of_2dlist", "input": "[]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/validation/python-00000-of-00001.parquet", "source_id": "jscheytt/endo-loc/helper/helper.py#maxval_of_2dlist", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037956", "code": "def rev_c(seq):\n    tab = str.maketrans(\"ACTGN\", \"TGACN\")\n    seq = seq[::-1]\n    seq = seq.translate(tab)\n    return seq", "entry_point": "rev_c", "input": "'walnut thistle harbour'", "output": "'ruobrah eltsiht tunlaw'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ulelab/ultraplex/ultraplex/__main__.py#rev_c", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037957", "code": "def find_bc_and_umi_pos(barcodes):\n    bcs_poses = {}\n    umi_poses = {}\n    for bc in barcodes:\n        bcs_poses[bc] = [i for i in range(len(bc)) if bc[i] != \"N\"]\n        umi_poses[bc] = [i for i in range(len(bc)) if bc[i] == \"N\"]\n    bc_pos = bcs_poses[barcodes[0]]\n    umi_poses[\"no_match\"] = []\n    return bc_pos, umi_poses", "entry_point": "find_bc_and_umi_pos", "input": "['a', 'b', 'c']", "output": "([0], {'a': [], 'b': [], 'c': [], 'no_match': []})", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ulelab/ultraplex/ultraplex/__main__.py#find_bc_and_umi_pos", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037958", "code": "def stripDictList(dictList, listOfAllowedFields):\n    tmpList = []\n    for listItem in dictList:\n        tmpDict = {\n            key: value\n            for (key, value) in listItem.items()\n            if key in listOfAllowedFields\n        }\n        if tmpDict:\n            tmpList.append(tmpDict)\n    return tmpList", "entry_point": "stripDictList", "input": "{}, [5, 3, 1, 4]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ckdecember/cloudbuddy/utils.py#stripDictList", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037959", "code": "def flattenDict(flattenable, flattenKey):\n    flatstring = \"\"\n    if type(flattenable) == list:\n        for tag in flattenable:\n            if flattenKey in tag:\n                flatstring = tag[flattenKey]\n    elif type(flattenable) == dict:\n        if flattenKey in flattenable:\n            flatstring = flattenable[flattenKey]\n    return flatstring", "entry_point": "flattenDict", "input": "True, ['apple', 'banana', 'cherry']", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ckdecember/cloudbuddy/utils.py#flattenDict", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037960", "code": "def flattenAndExpandList(listToFlatten):\n    flatStringList = []\n    for listItem in listToFlatten:\n        flatString = \" \".join(\n            \"{!s}: {!s}\".format(key, value) for (key, value) in listItem.items()\n        )\n        flatStringList.append(flatString)\n    flatString = \", \".join(flatStringList)\n    return flatString", "entry_point": "flattenAndExpandList", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ckdecember/cloudbuddy/utils.py#flattenAndExpandList", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037961", "code": "def _unwrap(cdw):\n    if not cdw:\n        return []\n    values = []\n    for i in range(cdw.count()):\n        values.append(cdw.valueAtIndex_(i))\n    return values", "entry_point": "_unwrap", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "deanishe/alfred-mailto/src/update_contacts.py#_unwrap", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037962", "code": "def personal_top_three_slice_magic(scores: list[int]) -> list[int]:\n    return sorted(scores)[:-4:-1]", "entry_point": "personal_top_three_slice_magic", "input": "[[1, 2], [3], []]", "output": "[[3], [1, 2], []]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ederst/exercism-python/high-scores/high_scores.py#personal_top_three_slice_magic", "provenance_class": "collected", "licence": "unlicense"}
{"id": "the_vault/0037963", "code": "def is_compatible(stream):\n        return True", "entry_point": "is_compatible", "input": "[]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "endarque/angr-platforms/angr_platforms/bpf/load_bpf.py#is_compatible", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037964", "code": "def tile_position(tile_ref, tile_size):\n    return tile_ref[0]*tile_size, tile_ref[1]*tile_size", "entry_point": "tile_position", "input": "['a', 'b', 'c'], -3", "output": "('', '')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Frimkron/sam-world/samworld.py#tile_position", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037965", "code": "def find_position(tile_type, level, tile_size):\n    for j, row in enumerate(level):\n        for i, tile in enumerate(row):\n            if tile == tile_type:\n                return (i+0.5)*tile_size, (j+0.5)*tile_size             \n    return 0.0, 0.0", "entry_point": "find_position", "input": "[1, 2, 3], [], 1", "output": "(0.0, 0.0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Frimkron/sam-world/samworld.py#find_position", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037966", "code": "def find_interp_index(x0: float, x: list):\n        idx = 0\n        while x[idx] < x0:\n            idx += 1\n        return idx - 1", "entry_point": "find_interp_index", "input": "3.25, [5, 3, 1, 4]", "output": "-1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "grdddj/Diploma-Thesis---Inverse-Heat-Transfer/interpolations.py#find_interp_index", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037967", "code": "def fpath_suffix(src_fpath: str, suffix: str, dst_extension: None) -> str:\n    src_extension = src_fpath.split(\".\")[-1]\n    dst_fpath = src_fpath.replace(f\".{src_extension}\", f\"_{suffix}.{src_extension}\")\n    if dst_extension:\n        if src_extension != dst_extension:\n            dst_fpath = dst_fpath.replace(src_extension, dst_extension)\n    return dst_fpath", "entry_point": "fpath_suffix", "input": "'Hello World', 'AbC dEf', []", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "BLSQ/accessmod-pipelines/accessmod/utils.py#fpath_suffix", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037968", "code": "def check2(userlist, usr):\n    for row in userlist:\n        if usr in row:\n            return False\n            break\n    else:\n        return True", "entry_point": "check2", "input": "[[1, 2], [3], []], ['apple', 'banana', 'cherry']", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Mamiglia/Requester-Bot/obj/checks.py#check2", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037969", "code": "def display_messages(msgs):\n    lines = []\n    episode_done = False\n    for index, msg in enumerate(msgs):\n        if msg is None:\n            continue\n        if msg.get('episode_done'):\n            episode_done = True\n        space = ''\n        if len(msgs) == 2 and index == 1:\n            space = '   '\n        if msg.get('reward', None) is not None:\n            lines.append(space + '[reward: {r}]'.format(r=msg['reward']))\n        if type(msg.get('image')) == str:\n            lines.append(msg['image'])\n        if msg.get('text', ''):\n            ID = '[' + msg['id'] + ']: ' if 'id' in msg else ''\n            lines.append(space + ID + msg['text'])\n        if msg.get('labels'):\n            lines.append(space + ('[labels: {}]'.format(\n                        '|'.join(msg['labels']))))\n        if msg.get('eval_labels'):\n            lines.append(space + ('[eval_labels: {}]'.format(\n                        '|'.join(msg['eval_labels']))))\n        if msg.get('label_candidates'):\n            cand_len = len(msg['label_candidates'])\n            if cand_len <= 10:\n                lines.append(space + ('[cands: {}]'.format(\n                        '|'.join(msg['label_candidates']))))\n            else:\n                cand_iter = iter(msg['label_candidates'])\n                display_cands = (next(cand_iter) for _ in range(5))\n                lines.append(space + ('[cands: {}{}]'.format(\n                        '|'.join(display_cands),\n                        '| ...and {} more'.format(cand_len - 5)\n                        )))\n    if episode_done:\n        lines.append('- - - - - - - - - - - - - - - - - - - - -')\n    return '\\n'.join(lines)", "entry_point": "display_messages", "input": "''", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sumeet-iitg/parlAI/parlai/core/worlds.py#display_messages", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037970", "code": "def sort_by_index_key(x):\n    if isinstance(x[1], dict) and '@index' in x[1]:\n        return x[1]['@index']\n    else:\n        return -1", "entry_point": "sort_by_index_key", "input": "[[1, 2], [3], []]", "output": "-1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "PyCN/brainstorm/brainstorm/utils.py#sort_by_index_key", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037971", "code": "def objective(s, s_min=100):\n    return -0.5 * ((s - s_min) ** 2)", "entry_point": "objective", "input": "False, 2", "output": "-2.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "asokraju/Extremum-Seeking-Controller/StaticOptimization.py#objective", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037972", "code": "def is_int(s):\n    if len(s) > 0 and s[0] in ('-', '+'):\n        return s[1:].isdigit()\n    return s.isdigit()", "entry_point": "is_int", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "cultureamp/cfn-certificate-provider/function/cfn_resource_provider/resource_provider.py#is_int", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037973", "code": "def parse_line(line):\n    trimmed_line = line.strip()\n    leading_spaces = len(line) - len(trimmed_line)\n    module_dep = trimmed_line[2:]\n    return int(leading_spaces / 4) + 1, module_dep", "entry_point": "parse_line", "input": "'  padded  '", "output": "(2, 'dded')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sebglon/datadog-agent/tools/dep_tree_resolver/dep_why.py#parse_line", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037974", "code": "def formatSelector(lst):\n    expr = []\n    for name, sel in iter(lst):\n        if expr:\n            expr.append(\".\")\n        expr.append(name)\n        if sel is not None:\n            expr.append(\"[%s]\" % repr(sel))\n    return \"\".join(expr)", "entry_point": "formatSelector", "input": "[]", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Etn40ff/qtile/libqtile/command.py#formatSelector", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037975", "code": "def cooccurrence_fn(list1,list2):\n    return len(set(list1).intersection(set(list2)))", "entry_point": "cooccurrence_fn", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "3", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "hossein20s/dnaMethylation/python/methylnet/interpretation_classes.py#cooccurrence_fn", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037976", "code": "def __filter_assets(catalogs, attachments):\n    series_catalogs = [catalog for catalog in catalogs if \"series\" in catalog.flavor]\n    episode_catalogs = [catalog for catalog in catalogs if catalog not in series_catalogs]\n    series_attachments = [attachment for attachment in attachments if \"series\" in attachment.flavor]\n    episode_attachments = [attachment for attachment in attachments if attachment not in series_attachments]\n    return episode_catalogs, episode_attachments, series_catalogs, series_attachments", "entry_point": "__filter_assets", "input": "(), []", "output": "([], [], [], [])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "UoM-Podcast/helper-scripts/recover_backup/recover/recover.py#__filter_assets", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037977", "code": "def aar(rors):\n    R = 0\n    for ror in rors:\n        R += ror\n    R /= len(rors)\n    return R", "entry_point": "aar", "input": "[5, 3, 1, 4]", "output": "3.25", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "RezaBehzadpour/financial-modeling/malee/_malee.py#aar", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037978", "code": "def twr(rors):\n    Rtw = 1\n    for ror in rors:\n        Rtw *= 1 + ror\n    return Rtw - 1", "entry_point": "twr", "input": "[1, 2, 3]", "output": "23", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "RezaBehzadpour/financial-modeling/malee/_malee.py#twr", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037979", "code": "def pv(Rt, i, t=1):\n    return Rt / ((1 + i) ** t)", "entry_point": "pv", "input": "True, True, 10", "output": "0.0009765625", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "RezaBehzadpour/financial-modeling/malee/_malee.py#pv", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037980", "code": "def gm(rors):\n    total = 1\n    n = len(rors)\n    for ror in rors:\n        total *= 1 + ror\n    return total ** (1 / n) - 1", "entry_point": "gm", "input": "[-1, 0, 1, 2]", "output": "-1.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "RezaBehzadpour/financial-modeling/malee/_malee.py#gm", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037981", "code": "def add_sentence_layer_to_words(words, sentence_items):\n    words = {word['id']: word for word in words}\n    return [\n        [words.get(ID) for ID in sentence_item['span']]\n        for sentence_item in sentence_items\n    ]", "entry_point": "add_sentence_layer_to_words", "input": "[], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Filter-Bubble/FormatConversions/naf2conll/naf2conll/util.py#add_sentence_layer_to_words", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037982", "code": "def keys_from_config(config, keys, filename):\n        args = {}\n        for arg in keys:\n            if arg not in config:\n                raise ValueError(\n                    f\"The key {arg!r} is not in the specified configuration\"\n                    f\" file {filename}\"\n                )\n            args[arg] = config[arg]\n        return args", "entry_point": "keys_from_config", "input": "set(), '', (1, 2)", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Filter-Bubble/FormatConversions/naf2conll/naf2conll/main.py#keys_from_config", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037983", "code": "def obb_text2listxy(text):\n    strList = list(text)[1:-1] \n    x = []\n    y = []\n    i = 0\n    j = 0\n    while i != len(strList):\n        if strList[i] == '[':\n            x_ = ''\n            j = i+1\n            while strList[j] != ',':\n                x_ += strList[j]\n                j += 1\n            x.append(int(x_))\n            i = j\n        if strList[i] == ' ' and strList[i+1] != '[':\n            y_ = ''\n            j = i+1\n            while strList[j] != ']':\n                y_ += strList[j]\n                j += 1\n            y.append(int(y_))\n            i = j\n        i += 1\n    return x, y", "entry_point": "obb_text2listxy", "input": "'abc'", "output": "([], [])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "xuhuasheng/my_mmdetection_tools/myEvaluation.py#obb_text2listxy", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0037984", "code": "def _convert_list_to_str(l):\n    if isinstance(l, list):\n        return str(l)[1:-1]\n    else:\n        return ''", "entry_point": "_convert_list_to_str", "input": "[[1, 2], [3], []]", "output": "'[1, 2], [3], []'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "jacksoncsy/menpo/menpo/visualize/widgets/tools.py#_convert_list_to_str", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037985", "code": "def _convert_str_to_list_int(s):\n    if isinstance(s, str):\n        return [int(i[:-1]) if i[-1] == ',' else int(i) for i in s.split()]\n    else:\n        return []", "entry_point": "_convert_str_to_list_int", "input": "[5, 3, 1, 4]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "jacksoncsy/menpo/menpo/visualize/widgets/tools.py#_convert_str_to_list_int", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037986", "code": "def _convert_str_to_list_float(s):\n    if isinstance(s, str):\n        return [float(i[:-1]) if i[-1] == ',' else float(i) for i in s.split()]\n    else:\n        return []", "entry_point": "_convert_str_to_list_float", "input": "[1, 2, 3]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "jacksoncsy/menpo/menpo/visualize/widgets/tools.py#_convert_str_to_list_float", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0037987", "code": "def fnv1a_32(string: str, seed=0):\n    FNV_prime = 16777619\n    offset_basis = 2166136261\n    hash = offset_basis + seed\n    for char in string:\n        hash = hash ^ ord(char)\n        hash = hash * FNV_prime\n    return hash", "entry_point": "fnv1a_32", "input": "set(), 2.0", "output": "2166136263.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "catarinaacsilva/web-cache/webcache/webcache.py#fnv1a_32", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037988", "code": "def region_to_bin(begin, end):\n        if begin >> 14 == end >> 14:\n            return ((1 << 15) - 1) // 7 + (begin >> 14)\n        elif begin >> 17 == end >> 17:\n            return ((1 << 12) - 1) // 7 + (begin >> 17)\n        elif begin >> 20 == end >> 20:\n            return ((1 << 9) - 1) // 7 + (begin >> 20)\n        elif begin >> 23 == end >> 23:\n            return ((1 << 6) - 1) // 7 + (begin >> 23)\n        elif begin >> 26 == end >> 26:\n            return ((1 << 3) - 1) // 7 + (begin >> 26)\n        return 0", "entry_point": "region_to_bin", "input": "10, True", "output": "4681", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sanogenetics/puretabix/puretabix/tabix.py#region_to_bin", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037989", "code": "def looks_like_sql(s: str) -> bool:\n    sql_keywords = {'select', 'update', 'union', 'delete', 'from', 'table', 'insert', 'into'}\n    s = s.lower()\n    for k in sql_keywords:\n        if k in s:\n            following = s[s.find(k) + len(k) : ]\n            if not following or following.startswith(\" \"):\n                return True\n    return False", "entry_point": "looks_like_sql", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "zd99921/angr/angr/utils/__init__.py#looks_like_sql", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037990", "code": "def _normalized_levenshtein_distance(s1, s2, acceptable_differences):\n    if len(s1) > len(s2):\n        s1, s2 = s2, s1\n        acceptable_differences = set(-i for i in acceptable_differences)\n    distances = range(len(s1) + 1)\n    for index2, num2 in enumerate(s2):\n        new_distances = [index2 + 1]\n        for index1, num1 in enumerate(s1):\n            if num2 - num1 in acceptable_differences:\n                new_distances.append(distances[index1])\n            else:\n                new_distances.append(1 + min((distances[index1],\n                                             distances[index1+1],\n                                             new_distances[-1])))\n        distances = new_distances\n    return distances[-1]", "entry_point": "_normalized_levenshtein_distance", "input": "[], [[1, 2], [3], []], {'a': 1, 'b': 2}", "output": "3", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "zd99921/angr/angr/analyses/bindiff.py#_normalized_levenshtein_distance", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0037991", "code": "def parse_multiple_hosts(host):\n    hosts = host.split(',')\n    cluster = []\n    for host in hosts:\n        host, *port = host.split(':')\n        cluster.append((host,port[0] if port else None))\n    return cluster", "entry_point": "parse_multiple_hosts", "input": "'abc'", "output": "[('abc', None)]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "filintod/pyremotelogin/fdutils/db/db.py#parse_multiple_hosts", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037992", "code": "def say_hello_world(config, http_context):\n    return {\"content\": \"Hello World.\"}", "entry_point": "say_hello_world", "input": "{}, 'walnut thistle harbour'", "output": "{'content': 'Hello World.'}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "pgiraud/temboard-agent/test/temboard-agent-sample-plugins/temboard_agent_sample_plugins.py#say_hello_world", "provenance_class": "collected", "licence": "postgresql"}
{"id": "the_vault/0037993", "code": "def subtract(value, arg):\n    try:\n        return value - arg\n    except (ValueError, TypeError):\n        return None", "entry_point": "subtract", "input": "False, 5", "output": "-5", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "larryworm1127/nba_daily/main/templatetags/filters.py#subtract", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037994", "code": "def check_cutoff(array, thresh):\n\treturn (array <= thresh)", "entry_point": "check_cutoff", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "franklongford/collagen/src/utilities.py#check_cutoff", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037995", "code": "def pot_harmonic(x, x0, k): \n\treturn k * (x - x0)**2", "entry_point": "pot_harmonic", "input": "1, 3.25, False", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "franklongford/collagen/src/utilities.py#pot_harmonic", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037996", "code": "def force_harmonic(x, x0, k): \n\treturn 2 * k * (x0 - x)", "entry_point": "force_harmonic", "input": "True, True, ('a', 'b', 'c')", "output": "()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "franklongford/collagen/src/utilities.py#force_harmonic", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037997", "code": "def make_loop_index(ss):\n    loop, stack = [], []\n    nl, L = 0, 0\n    for i, char in enumerate(ss):\n        if char == '(':\n            nl += 1\n            L = nl\n            stack.append(i)\n        loop.append(L)\n        if char == ')':\n            _ = stack.pop()\n            try:\n                L = loop[stack[-1]]\n            except IndexError:\n                L = 0\n    return loop", "entry_point": "make_loop_index", "input": "['apple', 'banana', 'cherry']", "output": "[0, 0, 0]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "bad-ants-fleet/ribolands/ribolands/utils.py#make_loop_index", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037998", "code": "def costruct(seq, cut = None):\n    delim = '&'\n    if delim in seq:\n        cut = seq.index(delim) + 1\n        table = str.maketrans(dict.fromkeys('&'))\n        seq = seq.translate(table)\n    elif cut and cut != -1:\n        seq = seq[:cut-1] + delim + seq[cut-1:]\n        cut = None\n    return seq, cut", "entry_point": "costruct", "input": "'walnut thistle harbour', {}", "output": "('walnut thistle harbour', {})", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "bad-ants-fleet/ribolands/ribolands/pathfinder.py#costruct", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0037999", "code": "def codeToArray(code):\n    convList = []\n    code = code.split(\"\\n\")\n    for element in code:\n        convList.append(element.strip())\n    return convList", "entry_point": "codeToArray", "input": "'abc'", "output": "['abc']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "rezvee6/Solidity-Metric-Parser/solParser.py#codeToArray", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038000", "code": "def extractComments(code):\n    commentBank = []\n    itemsList = [\"//\", \"#\", \"/*\", \"*/\", \"*\"]\n    for item in itemsList:\n        for line in code:\n            if item in line:\n                commentBank.append(line)\n    return commentBank", "entry_point": "extractComments", "input": "['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "rezvee6/Solidity-Metric-Parser/solParser.py#extractComments", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038001", "code": "def any_fulfill(collection, condition):\n    a = False\n    index = 0\n    while not a and index < len(collection):\n        a = condition(collection[index])\n        index += 1\n    return a", "entry_point": "any_fulfill", "input": "[], ['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "LeanKhan/hapy/hapy/token_parser.py#any_fulfill", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038002", "code": "def is_in_parents_props(prop_name: str, parent_props) -> bool:\n    found = False\n    i = 0\n    if len(parent_props) <= 0:\n        return found\n    while not found and i < len(parent_props):\n        p = parent_props[i]\n        if p.get(\"value\", None) == prop_name or p.get(\"left\", None) == prop_name:\n            found = True\n        i += 1\n    return found", "entry_point": "is_in_parents_props", "input": "'  padded  ', []", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "LeanKhan/hapy/hapy/generate_py.py#is_in_parents_props", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038003", "code": "def build_searchstring(mandatory, optional):\n    mandatory_words = \"({})\"\n    if mandatory is not None:\n        mandatory_words = mandatory_words.format(\" AND \".join(mandatory))\n    optional_words = \"({})\"\n    if optional is not None:\n        optional_words = optional_words.format(\" OR \".join(optional))\n        if mandatory is not None:\n            return \"{} AND {}\".format(mandatory_words, optional_words)\n        return optional_words\n    return mandatory_words", "entry_point": "build_searchstring", "input": "['a', 'b', 'c'], []", "output": "'(a AND b AND c) AND ()'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Jmc18134/askhist-search/askhist_search.py#build_searchstring", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038004", "code": "def analyze_versions(crate_data):\n    dependencies = {}\n    versions = {}\n    for data in crate_data:\n        for dependency in data['dependencies'] + data['dev-dependencies']:\n            if dependency['name'] not in dependencies:\n                dependencies[dependency['name']] = {}\n                versions[dependency['name']] = set()\n            dependencies[dependency['name']][data['name']] = dependency['version']\n            versions[dependency['name']].add(dependency['version'])\n    for (dependency, version_set) in versions.items():\n        if len(version_set) == 1:\n            dependencies.pop(dependency)\n    return dependencies", "entry_point": "analyze_versions", "input": "{}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "faberto/core-rs/scripts/deps.py#analyze_versions", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038005", "code": "def extract_query_string_parameters(event):\n    query_string_params = event.get(\"queryStringParameters\", {})\n    multi_query_string_params = event.get(\"multiValueQueryStringParameters\", {})\n    for qsp in query_string_params.keys():\n        if qsp not in multi_query_string_params:\n            multi_query_string_params[qsp] = [query_string_params[qsp]]\n    result = []\n    for name, value_list in multi_query_string_params.items():\n        for value in value_list:\n            result.append((name, value))\n    return result", "entry_point": "extract_query_string_parameters", "input": "{'a': 1, 'b': 2}", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "oliviersels/Zappa/zappa/asgi.py#extract_query_string_parameters", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038006", "code": "def chunk_retrieval_score(chunk, retrieved):\n    overlap = set(chunk) & retrieved\n    percentage = (len(overlap)/len(chunk)) * 100\n    return percentage", "entry_point": "chunk_retrieval_score", "input": "{1, 2, 3}, set()", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "cltl/MeasureDiversity/global_recall.py#chunk_retrieval_score", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038007", "code": "def compounds_from_doc(doc):\n    compounds = []\n    current = []\n    for token in doc:\n        if token.tag_.startswith('NN'):\n            current.append(token.orth_)\n        elif len(current) == 1:\n            current = []\n        elif len(current) > 1:\n            compounds.append(current)\n            current = []\n    if len(current) > 1:\n        compounds.append(current)\n    return compounds", "entry_point": "compounds_from_doc", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "cltl/MeasureDiversity/annotate_generated.py#compounds_from_doc", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038008", "code": "def compcolor(color):\n    return (255 - color[0], 255 - color[1], 255 - color[2])", "entry_point": "compcolor", "input": "[5, 3, 1, 4]", "output": "(250, 252, 254)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "myzhang1029/cbcreator/cbcreator/cbcreator.py#compcolor", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038009", "code": "def dedup_list(seq):\n        seen = set()\n        seen_add = seen.add\n        return [x for x in seq if not (x in seen or seen_add(x))]", "entry_point": "dedup_list", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "MisCar/styleguide/wpiformat/wpiformat/includeorder.py#dedup_list", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038010", "code": "def is_c_src_file(name):\n        return name.endswith(\".c\")", "entry_point": "is_c_src_file", "input": "'AbC dEf'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "MisCar/styleguide/wpiformat/wpiformat/config.py#is_c_src_file", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038011", "code": "def func_substitute(header, lines):\n        pos = 0\n        while pos < len(lines):\n            old_length = len(lines)\n            match = header.func_regex.search(lines, pos)\n            if not match:\n                break\n            pos = match.start(1) + len(header.prefix) + len(match.group(1))\n            if match.group(1) in header.func_names:\n                lines = lines[0:match.start(1)] + header.prefix + \\\n                    match.group(1) + lines[match.end(1):]\n        return lines", "entry_point": "func_substitute", "input": "True, set()", "output": "set()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "MisCar/styleguide/wpiformat/wpiformat/stdlib.py#func_substitute", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038012", "code": "def frecuencia_abs(seq) -> dict:\n    hist = {}\n    for i in seq:\n        hist[i] = hist.get(i, 0) + 1\n    return hist", "entry_point": "frecuencia_abs", "input": "['apple', 'banana', 'cherry']", "output": "{'apple': 1, 'banana': 1, 'cherry': 1}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "DarkShadow4/python/Curso estadistica descriptiva/datos cuantitativos/histogramas/sin_librerias.py#frecuencia_abs", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038013", "code": "def precision(tp, fp):\n    if tp+fp==0:\n        return 0\n    return (tp/(tp+fp))", "entry_point": "precision", "input": "False, 2", "output": "0.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "aziz-zafar/Machine-Learning-Package/scoring.py#precision", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038014", "code": "def f1(precision, recall):\n    if precision+recall ==0:\n        return 0\n    return 2*((precision*recall)/(precision+recall))", "entry_point": "f1", "input": "False, False", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "aziz-zafar/Machine-Learning-Package/scoring.py#f1", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038015", "code": "def rescale(data, continuous, MinMax):\n    for col in continuous:\n        data[col] = (data[col]*(MinMax.loc['max', col] - MinMax.loc['min', col])) + MinMax.loc['min', col]\n    return data", "entry_point": "rescale", "input": "[1, 2, 3], set(), 10", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "aziz-zafar/Machine-Learning-Package/data_preprocess.py#rescale", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038016", "code": "def always_accept(value):\n            if value or not value:\n                return True", "entry_point": "always_accept", "input": "[5, 3, 1, 4]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "djw8605/scitokens/tests/test_scitokens.py#always_accept", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038017", "code": "def param_bool(b):\n    return str(b == True).lower()", "entry_point": "param_bool", "input": "[]", "output": "'false'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "christophergdavis/iex-api-python/iex/utils.py#param_bool", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038018", "code": "def ids_to_tokens(ids, token_vocab):\n  tokens = [token_vocab[i] for i in ids]\n  return tokens", "entry_point": "ids_to_tokens", "input": "[-1, 0, 1, 2], [1, 2, 3]", "output": "[3, 1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "HoseungCha/mist-rnns/utils.py#ids_to_tokens", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038019", "code": "def validate(identifier):\n    if not identifier:\n        return False\n    identifier = str(identifier)\n    student_number = identifier[:-1]\n    given_digit = identifier[-1].upper()\n    counter = 2\n    total = 0\n    for char in reversed(student_number):\n        if not char.isdigit():\n            return False\n        total += int(char) * counter\n        counter += 1\n        counter = 2 if counter > 8 else counter\n    digit = str(11 - total % 11) if (11 - total % 11 != 10) else 'J'\n    digit = '0' if digit == '11' else digit\n    return given_digit == digit", "entry_point": "validate", "input": "[1, 2, 3]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "open-source-uc/validate-uc-number-py/ucnumber/__init__.py#validate", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038020", "code": "def check_uniqueness_in_rows(board: list) -> bool:\n    for line in board[1:-1]:\n        if len(set(line[1:-1])) != len(line[1:-1]):\n            return False\n    return True", "entry_point": "check_uniqueness_in_rows", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "VictoriyaRoy/task1/skyscrapers.py#check_uniqueness_in_rows", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038021", "code": "def make_xml_name(attr_name):\n    return attr_name.replace('_', '-')", "entry_point": "make_xml_name", "input": "'Hello World'", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "andyjsharp/py-space-platform/jnpr/space/xmlutil.py#make_xml_name", "provenance_class": "collected", "licence": "apache-2.0, ecl-2.0"}
{"id": "the_vault/0038022", "code": "def unmake_xml_name(attr_name):\n    return attr_name.replace('-', '_')", "entry_point": "unmake_xml_name", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "andyjsharp/py-space-platform/jnpr/space/xmlutil.py#unmake_xml_name", "provenance_class": "collected", "licence": "apache-2.0, ecl-2.0"}
{"id": "the_vault/0038023", "code": "def remote_branch_name(branch):\n        return branch", "entry_point": "remote_branch_name", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "allegroai/trains-agent/clearml_agent/helper/repo.py#remote_branch_name", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038024", "code": "def encoder_helper(data_df, category_lst, response='Churn'):\n    for category in category_lst:\n        propotion_vals = []\n        groups = data_df.groupby(category).mean()['Churn']\n        for val in data_df[category]:\n            propotion_vals.append(groups.loc[val])\n        new_column_name = category + '_' + response\n        data_df[new_column_name] = propotion_vals\n    return data_df", "entry_point": "encoder_helper", "input": "2.0, {}, ('a', 'b', 'c')", "output": "2.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "tolgayan/churn-prediction/churn_library.py#encoder_helper", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038025", "code": "def ascii_encode(string: str):\n    return str(string.encode('ascii', 'ignore'))[2:-1]", "entry_point": "ascii_encode", "input": "'a,b,c'", "output": "'a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "BioTheWolff/DoxyTH/doxyth/utils/langs.py#ascii_encode", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038026", "code": "def div_tag(div_cls, data) -> str:\n    return (\"<div class=\\\"{}\\\">\\n{}\\n</div>\\n\".format(div_cls, data))", "entry_point": "div_tag", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "'<div class=\"[\\'a\\', \\'b\\', \\'c\\']\">\\n[\\'a\\', \\'b\\', \\'c\\']\\n</div>\\n'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "minishrink/calendargen/html/helpers.py#div_tag", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038027", "code": "def _nearest_bigger_power_of_two(x: int) -> int:\n  y = 2\n  while y < x:\n    y *= 2\n  return y", "entry_point": "_nearest_bigger_power_of_two", "input": "0.5", "output": "2", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "tlmakinen/jraph/jraph/ogb_examples/train.py#_nearest_bigger_power_of_two", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038028", "code": "def from_source_to_target(quantity):\n            return quantity", "entry_point": "from_source_to_target", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "MJCWilhelm/amuse/src/amuse/datamodel/particles.py#from_source_to_target", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038029", "code": "def from_target_to_source(quantity):\n            return quantity", "entry_point": "from_target_to_source", "input": "[[1, 2], [3], []]", "output": "[[1, 2], [3], []]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "MJCWilhelm/amuse/src/amuse/datamodel/particles.py#from_target_to_source", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038030", "code": "def is_requirement(line):\n    return line and not line.startswith(('-r', '#', '-e', 'git+', '-c'))", "entry_point": "is_requirement", "input": "''", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "openedx/TinCanPython/setup.py#is_requirement", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038031", "code": "def _compose_pre_ack_process_response(trigger_instance, message):\n        return {'trigger_instance': trigger_instance, 'message': message}", "entry_point": "_compose_pre_ack_process_response", "input": "[-1, 0, 1, 2], ['a', 'b', 'c']", "output": "{'trigger_instance': [-1, 0, 1, 2], 'message': ['a', 'b', 'c']}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ekhavana/st2/st2reactor/st2reactor/rules/worker.py#_compose_pre_ack_process_response", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038032", "code": "def normalize_pack_version(version):\n    version = str(version)\n    version_seperator_count = version.count('.')\n    if version_seperator_count == 1:\n        version = version + '.0'\n    return version", "entry_point": "normalize_pack_version", "input": "['a', 'b', 'c']", "output": "\"['a', 'b', 'c']\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ekhavana/st2/st2common/st2common/util/pack.py#normalize_pack_version", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038033", "code": "def normalizeName(name):\n  name = name.replace(\" \",\"\")\n  name = name.replace(\"*\",\"\")\n  return name", "entry_point": "normalizeName", "input": "'abc'", "output": "'abc'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "kiranhs/ITKv4FEM-Kiran/Wrapping/WrapITK/Python/itkTemplate.py#normalizeName", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038034", "code": "def _exists_in_db(obj):\n        return False", "entry_point": "_exists_in_db", "input": "[[1, 2], [3], []]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "mircealungu/Zeeguu-API-2/zeeguu/core/test/rules/text_rule.py#_exists_in_db", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038035", "code": "def score(dice):\n    dice = sorted(dice)\n    result = 0\n    dict = {}\n    for val in dice:\n        if val in dict:\n            dict[val] += 1\n        else:\n            dict[val] = 1\n    for key, cnt in dict.items():\n        if cnt == 5:\n          if key == 1:\n            result += 1200\n          else:\n            result += ((key * 100) + 100)\n        elif cnt == 4:\n          if key == 1:\n            result += 1100\n          else:\n            result += (key * 100) + 50\n        elif cnt == 3:\n          if key == 1:\n            result += 1000\n          else:\n            result += key * 100\n        elif cnt == 2:\n          if key == 1:\n            result += 200\n          elif key == 5:\n            result += 100\n        elif cnt == 1:\n          if key == 1:\n            result += 100\n          elif key == 5:\n            result += 50\n    return result", "entry_point": "score", "input": "[1, 2, 3]", "output": "100", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "AnthonyRChao/Python-Koans/python3/koans/about_scoring_project.py#score", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038036", "code": "def check_items(items, expiry):\n    deployments = list(set([i.time for i in items]))\n    deployments_old = sorted([i for i in deployments if i < expiry])\n    if len(deployments_old) <= 1:\n        return items, []\n    delete_older_than = deployments_old[-1]\n    keep_files = list(set([i.filename for i in items if i.time >= delete_older_than]))\n    delete_files = list(\n        set(\n            [\n                i.filename\n                for i in items\n                if i.time < delete_older_than and i.filename not in keep_files\n            ]\n        )\n    )\n    return [i for i in items if i.time >= delete_older_than], delete_files", "entry_point": "check_items", "input": "[], ['apple', 'banana', 'cherry']", "output": "([], [])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "capraconsulting/webapp-deploy-lambda/webapp_deploy/main.py#check_items", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038037", "code": "def virt_imei_shard_bounds(num_physical_imei_shards):\n    k, m = divmod(100, num_physical_imei_shards)\n    return [(i * k + min(i, m), (i + 1) * k + min(i + 1, m)) for i in range(num_physical_imei_shards)]", "entry_point": "virt_imei_shard_bounds", "input": "2", "output": "[(0, 50), (50, 100)]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "a-wakeel/DIRBS-Core/src/dirbs/partition_utils.py#virt_imei_shard_bounds", "provenance_class": "collected", "licence": "postgresql, unlicense"}
{"id": "the_vault/0038038", "code": "def npath(path):\n    return path", "entry_point": "npath", "input": "'a,b,c'", "output": "'a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ponsonio-aurea/django/django/utils/_os.py#npath", "provenance_class": "collected", "licence": "bsd-3-clause, psf-2.0"}
{"id": "the_vault/0038039", "code": "def uniq(sequence):\n\tunique = []\n\t[unique.append(item) for item in sequence if item not in unique]\n\treturn unique", "entry_point": "uniq", "input": "[-1, 0, 1, 2]", "output": "[-1, 0, 1, 2]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "entrepreneur-interet-general/the-magical-csv-merge-machine/merge_machine/preprocess_fields_v3.py#uniq", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038040", "code": "def fast_sim_score(r, l = 1024):\n\tif len(r[0]) > 0: return (r[0], 100)\n\telif len(r[1]) < 1 and len(r[2]) < 1: return ([], 0)\n\telif l > 8: return (r[1], 50) if len(r[1]) > 0 else (r[2], 20)\n\telif l > 4: return (r[1], 20) if len(r[1]) > 0 else (r[2], 10)\n\telse: return (r[1], 5) if len(r[1]) > 0 else ([], 0)", "entry_point": "fast_sim_score", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "('apple', 100)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "entrepreneur-interet-general/the-magical-csv-merge-machine/merge_machine/preprocess_fields_v3.py#fast_sim_score", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038041", "code": "def singleton_list(s, itemValidator, stripChars):\n\tif itemValidator is None: return [s]\n\ttry:\n\t\td = itemValidator(s)\n\t\treturn [] if d is None else [d]\n\texcept:\n\t\treturn []", "entry_point": "singleton_list", "input": "[5, 3, 1, 4], [1, 2, 3], [[1, 2], [3], []]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "entrepreneur-interet-general/the-magical-csv-merge-machine/merge_machine/preprocess_fields_v3.py#singleton_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038042", "code": "def booltooffon(value):\n        if value == \"1\" or value == \"true\" or value == \"on\":\n            return \"on\"\n        else:\n            return \"off\"", "entry_point": "booltooffon", "input": "[5, 3, 1, 4]", "output": "'off'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "DINKIN/coreemu/daemon/core/conf.py#booltooffon", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0038043", "code": "def haskeyvalues(values):\n        if len(values) == 0:\n            return False\n        for v in values:\n            if \"=\" not in v:\n                return False\n        return True", "entry_point": "haskeyvalues", "input": "['apple', 'banana', 'cherry']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "DINKIN/coreemu/daemon/core/conf.py#haskeyvalues", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0038044", "code": "def strip_invalid_chars(name):\n    return name.replace('-','_')", "entry_point": "strip_invalid_chars", "input": "'Hello World'", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "steevebisson/contrib/monitoring/sdm_health_exporter/sdm_health_exporter.py#strip_invalid_chars", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038045", "code": "def handle_swagger_array(item_swagger_type, shape):\n        swag_array = {'type': 'array', 'items': item_swagger_type}\n        if len(shape) > 1:\n            for dim in range(len(shape) - 1):\n                swag_array = {'type': 'array', 'items': swag_array}\n        return swag_array", "entry_point": "handle_swagger_array", "input": "[1, 2, 3], [1, 2, 3]", "output": "{'type': 'array', 'items': {'type': 'array', 'items': {'type': 'array', 'items': [1, 2, 3]}}}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "wamartin-aml/InferenceSchema/inference_schema/parameter_types/_swagger_from_dtype.py#handle_swagger_array", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038046", "code": "def _strip_list(list):\n    return [x for x in list if x]", "entry_point": "_strip_list", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "CODAIT/text-extensions-for-pandas/text_extensions_for_pandas/io/watson/tables.py#_strip_list", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038047", "code": "def _get_span_tag(df, tag_data, stack_data) -> str:\n    if tag_data:\n        if tag_data[0] == \"column_data\":\n            return df[tag_data[1]][stack_data[1]]\n        elif tag_data == \"column_header\":\n            return str(stack_data[2])\n    return \"\"", "entry_point": "_get_span_tag", "input": "[5, 3, 1, 4], [], []", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "CODAIT/text-extensions-for-pandas/text_extensions_for_pandas/jupyter/widget/span.py#_get_span_tag", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038048", "code": "def strip_wrapping_parentheses(fragment):\n        opening_parentheses = closing_parentheses = 0\n        for char in fragment:\n            if char == '(':\n                opening_parentheses += 1\n            else:\n                break\n        if opening_parentheses:\n            newer_frag = ''\n            fragment = fragment[opening_parentheses:]\n            reverse_fragment = fragment[::-1]\n            skip = False\n            for char in reverse_fragment:\n                if (char == ')' and\n                        closing_parentheses < opening_parentheses and\n                        not skip):\n                    closing_parentheses += 1\n                    continue\n                elif char != ')':\n                    skip = True\n                newer_frag += char\n            fragment = newer_frag[::-1]\n        return fragment, opening_parentheses, closing_parentheses", "entry_point": "strip_wrapping_parentheses", "input": "['a', 'b', 'c']", "output": "(['a', 'b', 'c'], 0, 0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "igeeker/v2ex/v2ex/babel/ext/bleach/__init__.py#strip_wrapping_parentheses", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038049", "code": "def wrap(start: str, string: str, end: str = \"\") -> str:\n    return f\"{start}{string}{end}\" if string else \"\"", "entry_point": "wrap", "input": "[], 'a,b,c', [[1, 2], [3], []]", "output": "'[]a,b,c[[1, 2], [3], []]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "patrys/graphql-core-next/graphql/language/printer.py#wrap", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038050", "code": "def indent(string):\n    return \"  \" + string.replace(\"\\n\", \"\\n  \") if string else string", "entry_point": "indent", "input": "'walnut thistle harbour'", "output": "'  walnut thistle harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "patrys/graphql-core-next/graphql/language/printer.py#indent", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038051", "code": "def lineDefinesNewIx(line):\n    return (\n        \" Thing(\" in line\n        or \" Surface(\" in line\n        or \" Container(\" in line\n        or \" Clothing(\" in line\n        or \" Abstract(\" in line\n        or \" Key(\" in line\n        or \" Lock(\" in line\n        or \" UnderSpace(\" in line\n        or \" LightSource(\" in line\n        or \" Transparent(\" in line\n        or \" Readable(\" in line\n        or \" Book(\" in line\n        or \" Pressable(\" in line\n        or \" Liquid(\" in line\n        or \" Room(\" in line\n        or \" OutdoorRoom(\" in line\n        or \" RoomGroup(\" in line\n        or \" Achievement(\" in line\n        or \" Ending(\" in line\n        or \" TravelConnector(\" in line\n        or \" DoorConnector(\" in line\n        or \" LadderConnector(\" in line\n        or \" StaircaseConnector(\" in line\n        or \" Actor(\" in line\n        or \" Player(\" in line\n        or \" Topic(\" in line\n        or \" SpecialTopic(\" in line\n        or \"=Thing(\" in line\n        or \"=Surface(\" in line\n        or \"=Container(\" in line\n        or \"=Clothing(\" in line\n        or \"=Abstract(\" in line\n        or \"=Key(\" in line\n        or \"=Lock(\" in line\n        or \"=UnderSpace(\" in line\n        or \"=LightSource(\" in line\n        or \"=Transparent(\" in line\n        or \"=Readable(\" in line\n        or \"=Book(\" in line\n        or \"=Pressable(\" in line\n        or \"=Liquid(\" in line\n        or \"=Room(\" in line\n        or \"=OutdoorRoom(\" in line\n        or \"=RoomGroup(\" in line\n        or \"=Achievement(\" in line\n        or \"=Ending(\" in line\n        or \"=TravelConnector(\" in line\n        or \"=DoorConnector(\" in line\n        or \"=LadderConnector(\" in line\n        or \"=StaircaseConnector(\" in line\n        or \"=Actor(\" in line\n        or \"=Player(\" in line\n        or \"=Topic(\" in line\n        or \"=SpecialTopic(\" in line\n        or \".copyThingUniqueIx(\" in line\n    )", "entry_point": "lineDefinesNewIx", "input": "'  padded  '", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "RathmoreChaos/intficpy/intficpy/tools.py#lineDefinesNewIx", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038052", "code": "def tokenize(input_string):\n    tokens = input_string.split()\n    return tokens", "entry_point": "tokenize", "input": "'walnut thistle harbour'", "output": "['walnut', 'thistle', 'harbour']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "RathmoreChaos/intficpy/intficpy/tokenizer.py#tokenize", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038053", "code": "def tick(nums):\n    new_nums = {}\n    for k, v in nums.items():\n        if k == 0:\n            new_nums[6] = new_nums.get(6, 0) + v\n            new_nums[8] = new_nums.get(8, 0) + v\n            continue\n        new_nums[k - 1] = new_nums.get(k - 1, 0) + v\n    return new_nums", "entry_point": "tick", "input": "{}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "akashvacher/AdventOfCode2021/Day6/day6.2.py#tick", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038054", "code": "def is_complete(board):\n    rows = board\n    for row in rows:\n        if all(cell < 0 for cell in row):\n            return True  \n    width = len(rows[0])\n    for i in range(width):\n        column = [row[i] for row in rows]\n        if all(cell < 0 for cell in column):\n            return True  \n    return False", "entry_point": "is_complete", "input": "[[1, 2], [3], []]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "akashvacher/AdventOfCode2021/Day4/day4.1.py#is_complete", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038055", "code": "def mark_number(number, board):\n    for r, row in enumerate(board):\n        for c, cell in enumerate(row):\n            if cell == number:\n                board[r][c] = -1\n                return board\n    return board", "entry_point": "mark_number", "input": "3, []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "akashvacher/AdventOfCode2021/Day4/day4.1.py#mark_number", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038056", "code": "def tick(nums):\n    for i, j in enumerate(nums[:]):\n        if j == 0:\n            nums[i] = 6\n            nums.append(8)\n        else:\n            nums[i] -= 1\n    return nums", "entry_point": "tick", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "akashvacher/AdventOfCode2021/Day6/day6.1.py#tick", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038057", "code": "def duplicate_data(data, nbr):\n    out = []\n    for i in range (nbr):\n        out.append(data)\n    return out", "entry_point": "duplicate_data", "input": "5, 5", "output": "[5, 5, 5, 5, 5]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "abdelneuhaus/EpidemiOptim/epidemioptim/utils.py#duplicate_data", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038058", "code": "def mitigation_time(step_list):\n    breaks = []\n    for i in range(len(step_list)-1):\n        breaks.append(step_list[i+1]-step_list[i])\n    return breaks", "entry_point": "mitigation_time", "input": "[1, 2, 3]", "output": "[1, 1]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "abdelneuhaus/EpidemiOptim/epidemioptim/utils.py#mitigation_time", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038059", "code": "def benchmark(benchmark_name):\n    return \"benchmark\", benchmark_name", "entry_point": "benchmark", "input": "'  padded  '", "output": "('benchmark', '  padded  ')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sbrass/madminer/madminer/sampling/parameters.py#benchmark", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038060", "code": "def benchmarks(benchmark_names):\n    return \"benchmarks\", benchmark_names", "entry_point": "benchmarks", "input": "'a,b,c'", "output": "('benchmarks', 'a,b,c')", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sbrass/madminer/madminer/sampling/parameters.py#benchmarks", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038061", "code": "def random_morphing_points(n_thetas, priors):\n    return \"random_morphing_points\", (n_thetas, priors)", "entry_point": "random_morphing_points", "input": "[1, 2, 3], [5, 3, 1, 4]", "output": "('random_morphing_points', ([1, 2, 3], [5, 3, 1, 4]))", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sbrass/madminer/madminer/sampling/parameters.py#random_morphing_points", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038062", "code": "def classify_results(final_results, threshold):\n    total_unique_TP = 0\n    total_TP_per_day = {}\n    total_FP = 0\n    total_FP_per_day = {}\n    for result in final_results:\n        if result[\"score\"] > threshold:\n            if result[\"isAttack\"]:\n                total_unique_TP += 1\n                if result[\"date\"] not in list(total_TP_per_day.keys()):\n                    total_TP_per_day[result[\"date\"]] = 1\n                else:\n                    total_TP_per_day[result[\"date\"]] += 1\n            else:\n                total_FP += 1\n                if result[\"date\"] not in list(total_FP_per_day.keys()):\n                    total_FP_per_day[result[\"date\"]] = 1\n                else:\n                    total_FP_per_day[result[\"date\"]] += 1\n    return total_unique_TP, total_TP_per_day, total_FP, total_FP_per_day", "entry_point": "classify_results", "input": "(), {'a': 1, 'b': 2}", "output": "(0, {}, 0, {})", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "lukehsiao/ml-ids/check_results.py#classify_results", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038063", "code": "def matrix2d_rotate_square(n, i, j):\n    return n-j-1, i", "entry_point": "matrix2d_rotate_square", "input": "0.5, 2.0, False", "output": "(-0.5, 2.0)", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ampheul/GridPy/Grid/__init__.py#matrix2d_rotate_square", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038064", "code": "def norm_angle(a):\n    a = (a + 360) % 360\n    if a > 180:\n        a = a - 360\n    return a", "entry_point": "norm_angle", "input": "5", "output": "5", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "leejjoon/Matplotlib--JJ-s-dev/lib/mpl_toolkits/mplot3d/art3d.py#norm_angle", "provenance_class": "collected", "licence": "bsd-3-clause, psf-2.0"}
{"id": "the_vault/0038065", "code": "def norm_text_angle(a):\n    a = (a + 180) % 180\n    if a > 90:\n        a = a - 180\n    return a", "entry_point": "norm_text_angle", "input": "True", "output": "1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "leejjoon/Matplotlib--JJ-s-dev/lib/mpl_toolkits/mplot3d/art3d.py#norm_text_angle", "provenance_class": "collected", "licence": "bsd-3-clause, psf-2.0"}
{"id": "the_vault/0038066", "code": "def flatten_3d_to_2d(raw_file_data):\n    file_data_2d = []\n    lens = []\n    for lst in raw_file_data:\n        lens.append(len(lst))\n        for e in lst:\n            file_data_2d.append(e)\n    return file_data_2d, lens", "entry_point": "flatten_3d_to_2d", "input": "[]", "output": "([], [])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "googleinterns/cl_analysis/model/train_nn_v2.py#flatten_3d_to_2d", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038067", "code": "def _get_num_reverted_file(file_names, file_level_signals):\n        num_reverted_file = 0\n        for file_name in file_names:\n            selected_df = file_level_signals[\n                file_level_signals['file name'] == file_name]\n            if selected_df.empty:\n                continue\n            if selected_df['reverted pull request id count'].values[0] > 0:\n                num_reverted_file += 1\n        return num_reverted_file", "entry_point": "_get_num_reverted_file", "input": "{}, (1, 2)", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "googleinterns/cl_analysis/model/load_data.py#_get_num_reverted_file", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038068", "code": "def expand_dict_to_lst(data_dict):\n    data_list = []\n    for repo in data_dict:\n        data_list += data_dict[repo]\n    return data_list", "entry_point": "expand_dict_to_lst", "input": "{'x': [1, 2], 'y': []}", "output": "[1, 2]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "googleinterns/cl_analysis/model/utils.py#expand_dict_to_lst", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038069", "code": "def render_children(children, prefix='\u2502   \u251c\u2500\u2500 ', last_item_prefix='\u2502   \u2514\u2500\u2500 '):\n    s = ''\n    for item in children[:-1]:\n        s += '{}{}\\n'.format(prefix, item)\n    s += '{}{}'.format(last_item_prefix, children[-1])\n    return s", "entry_point": "render_children", "input": "['apple', 'banana', 'cherry'], '', 'abc'", "output": "'apple\\nbanana\\nabccherry'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "pawelad/simple-site-crawler/simple_site_crawler/utils.py#render_children", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038070", "code": "def rename_age_bracket(bracket):\n    parts = bracket.split()\n    if len(parts) == 3 and parts[0] == \"Under\":\n        return \"0-\" + str(int(parts[1]) - 1)\n    elif len(parts) == 4 and parts[1] == \"to\" and parts[3] == \"years\":\n        return parts[0] + \"-\" + parts[2]\n    elif len(parts) == 4 and parts[1] == \"and\" and parts[3] == \"years\":\n        return parts[0] + \"-\" + parts[2]\n    elif len(parts) == 2 and parts[1] == \"years\":\n        return parts[0] + \"-\" + parts[0]\n    elif len(parts) == 4 and \" \".join(parts[1:]) == \"years and over\":\n        return parts[0] + \"+\"\n    else:\n        return bracket", "entry_point": "rename_age_bracket", "input": "'a,b,c'", "output": "'a,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "adams314/health-equity-tracker/python/datasources/acs_population.py#rename_age_bracket", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038071", "code": "def should_omit(names, artifact):\n    for name in names:\n        if name in artifact[\"coordinate\"]:\n            return True\n        if name == artifact[\"ws_name\"]:\n            return True\n    return False", "entry_point": "should_omit", "input": "'', [1, 2, 3]", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "dhalperi/rules_maven/maven/internal/maven_repository.bzl#should_omit", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038072", "code": "def load_size(op, exp):\n    op = op.lower()\n    if op.startswith('vldr'):\n        return 4 if exp.startswith('s') else 8\n    if op.startswith('ldr'):\n        if len(op) < 4 or op[3] == '.': return 4\n        if op[3] == 'd': return 8\n        if op[3] == 'h' or (op[3] == 's' and op[4] == 'h'): return 2\n        return 1\n    return 4", "entry_point": "load_size", "input": "'Hello World', 3.25", "output": "4", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "whj0401/RLOBF/uroboros-diversification/src/disasm/arm_process.py#load_size", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038073", "code": "def char_collect_all(s, c):\n    start = 0\n    res = []\n    clen = len(c)\n    while True:\n        start = s.find(c, start)\n        if start == -1: break\n        res.append(start)\n        start += clen\n    return res", "entry_point": "char_collect_all", "input": "'Hello World', 'a,b,c'", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "whj0401/RLOBF/uroboros-diversification/src/disasm/lex.py#char_collect_all", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038074", "code": "def letter_of_combination(digits):\n    phone_map = {\n        \"2\": [\"a\",\"b\",\"c\"],\n        \"3\": [\"d\",\"e\",\"f\"],\n        \"4\":[\"g\",\"h\",\"i\"],\n        \"5\": [\"j\",\"k\",\"l\"],\n        \"6\": [\"m\",\"n\",\"o\"],\n        \"7\":[\"p\",\"q\",\"r\",\"s\"],\n        \"8\":[\"t\",\"u\",\"v\"],\n        \"9\":[\"w\",\"x\",\"y\",\"z\"]\n    }\n    combinations = []\n    digit_len = len(digits)\n    if digit_len == 0:\n        return combinations\n    elif digit_len == 1:\n        letter_map = phone_map.get(digits)\n        return letter_map\n    elif digit_len == 2:\n        letter_map_1 = phone_map.get(digits[0])\n        letter_map_2 = phone_map.get(digits[1])\n        combinations = [\"{}{}\".format(x, y) for x in letter_map_1 for y in letter_map_2]\n        return combinations\n    elif digit_len == 3:\n        letter_map_1 = phone_map.get(digits[0])\n        letter_map_2 = phone_map.get(digits[1])\n        letter_map_3 = phone_map.get(digits[2])\n        combinations = [\"{}{}{}\".format(x, y, z) for x in letter_map_1 for y in letter_map_2 for z in letter_map_3]\n        return combinations\n    else:\n        letter_map_1 = phone_map.get(digits[0])\n        letter_map_2 = phone_map.get(digits[1])\n        letter_map_3 = phone_map.get(digits[2])\n        letter_map_4 = phone_map.get(digits[3])\n        combinations = [\"{}{}{}{}\".format(x, y, z, q) for x in letter_map_1 for y in letter_map_2 for z in letter_map_3 for q in letter_map_4]\n        return combinations", "entry_point": "letter_of_combination", "input": "[]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "jinesh90/CMPR425-DSAA/Leetcode/letter_combination_of_phone_number.py#letter_of_combination", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038075", "code": "def take_turn(game_id, face_value, bid):\n    finished = False\n    finished = True\n    return finished", "entry_point": "take_turn", "input": "[-1, 0, 1, 2], [5, 3, 1, 4], [[1, 2], [3], []]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "PrinceWalnut/princewalnut.com/princewalnut.com/html/liars_dice/start.py#take_turn", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038076", "code": "def tcolumn(dataframe, col, dtype):\n    for ele in col:\n        dataframe.loc[:, ele] = dataframe.loc[:, ele].astype(dtype)\n    return dataframe", "entry_point": "tcolumn", "input": "['apple', 'banana', 'cherry'], [], ['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "jocoder22/Disaster_response/models/train_classifier.py#tcolumn", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038077", "code": "def connect(input_layer, layers):\n    layer = input_layer\n    for l in layers:\n        layer = l(layer)\n    return layer", "entry_point": "connect", "input": "[5, 3, 1, 4], []", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "btanti/paper_boltzmann_generators/software/deep_boltzmann/networks/util.py#connect", "provenance_class": "collected", "licence": "cc-by-4.0"}
{"id": "the_vault/0038078", "code": "def calculate_debounced_passing(recent_results, debounce=0):\n    if not recent_results:\n        return True\n    debounce_window = recent_results[:debounce + 1]\n    for r in debounce_window:\n        if r.succeeded:\n            return True\n    return False", "entry_point": "calculate_debounced_passing", "input": "[], [[1, 2], [3], []]", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "isabella232/cabot/cabot/cabotapp/models.py#calculate_debounced_passing", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038079", "code": "def _rlimit_min(one_val, nother_val):\n    if one_val < 0 or nother_val < 0 :\n        return max(one_val, nother_val)\n    else:\n        return min(one_val, nother_val)", "entry_point": "_rlimit_min", "input": "3.25, True", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "mongolab/mongoctl/mongoctl/commands/server/start.py#_rlimit_min", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038080", "code": "def _CleanComment(text, prefix=''):\n  if text:\n    text = text.strip()\n    lines = text.split('\\n')\n    def NumLeadingSpaces(line):\n      num = 0\n      for c in line:\n        if c.isspace():\n          num += 1\n        else:\n          break\n      return num\n    non_empty_lines = [line for line in lines[1:] if line.strip()]\n    if non_empty_lines:\n      leading_spaces = min(NumLeadingSpaces(line) for line in non_empty_lines)\n      strip_prefix = ' ' * leading_spaces\n    else:\n      strip_prefix = ''\n    def Unindent(line):\n      if line.startswith(strip_prefix):\n        line = line[len(strip_prefix):]\n      return line\n    text = '\\n'.join(prefix + Unindent(line.rstrip()) for line in lines)\n  return text", "entry_point": "_CleanComment", "input": "'a,b,c', 'Hello World'", "output": "'Hello Worlda,b,c'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "gbeanvamp/zetasql/zetasql/resolved_ast/gen_resolved_ast.py#_CleanComment", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038081", "code": "def find_op(regex):\n    list_of_op = [\"*\",\"?\",\"+\",\".\"]\n    index = -1\n    for i in range(len(regex)):\n        if(regex[i] in list_of_op):\n            index = i\n            break\n    return index", "entry_point": "find_op", "input": "[-1, 0, 1, 2]", "output": "-1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Shaon96/Redos_Attack_Prevention/unwanted/regexengine.py#find_op", "provenance_class": "collected", "licence": "unlicense"}
{"id": "the_vault/0038082", "code": "def parse_author(obj):\n    result = {}\n    if isinstance(obj, dict):\n        names = obj['properties'].get('name')\n        photos = obj['properties'].get('photo')\n        urls = obj['properties'].get('url')\n        if names:\n            result['name'] = names[0]\n        if photos:\n            result['photo'] = photos[0]\n        if urls:\n            result['url'] = urls[0]\n    elif obj:\n        if obj.startswith('http://') or obj.startswith('https://'):\n            result['url'] = obj\n        else:\n            result['name'] = obj\n    return result", "entry_point": "parse_author", "input": "[]", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "drivet/mf2util/mf2util.py#parse_author", "provenance_class": "collected", "licence": "bsd-2-clause"}
{"id": "the_vault/0038083", "code": "def remove_instructions(kernel, insn_ids):\n    if not insn_ids:\n        return kernel\n    assert isinstance(insn_ids, set)\n    id_to_insn = kernel.id_to_insn\n    new_insns = []\n    for insn in kernel.instructions:\n        if insn.id in insn_ids:\n            continue\n        if insn.depends_on is None:\n            depends_on = frozenset()\n        else:\n            depends_on = insn.depends_on\n        new_deps = depends_on - insn_ids\n        for dep_id in depends_on & insn_ids:\n            new_deps = new_deps | id_to_insn[dep_id].depends_on\n        new_insns.append(insn.copy(depends_on=frozenset(new_deps)))\n    return kernel.copy(\n            instructions=new_insns)", "entry_point": "remove_instructions", "input": "1, set()", "output": "1", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "cmsquared/loopy/loopy/transform/instruction.py#remove_instructions", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038084", "code": "def sum_mem_access_to_bytes(m):\n    result = {}\n    for (dtype, kind, direction), v in m.items():\n        new_key = (kind, direction)\n        bytes_transferred = int(dtype.itemsize) * v\n        if new_key in result:\n            result[new_key] += bytes_transferred\n        else:\n            result[new_key] = bytes_transferred\n    return result", "entry_point": "sum_mem_access_to_bytes", "input": "{}", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "cmsquared/loopy/loopy/statistics.py#sum_mem_access_to_bytes", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038085", "code": "def count_changes(vals):\n    counter = 0\n    num = len(vals)\n    for i in range(1, num-1):\n        if (vals[i]-vals[i-1])*(vals[i]-vals[i+1])<0:\n            counter =  counter + 1\n    return counter", "entry_point": "count_changes", "input": "[]", "output": "0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "hkujy/BTNDP/RTND/py/myplot.py#count_changes", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038086", "code": "def find_column_index(header, fields):\n    indices = []\n    for txt in fields:\n        for idx, col in enumerate(header):\n            if col.find(txt) >= 0:\n                indices.append(idx)\n                break\n    return indices", "entry_point": "find_column_index", "input": "['a', 'b', 'c'], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "fredqi/xdufacool/xdufacool/score_helper.py#find_column_index", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038087", "code": "def validate_dbpath(path: str) -> bool:\n\tif not isinstance(path, str):\n\t\treturn False\n\tif path == '/':\n\t\treturn True\n\tif not path or '//' in path or '\\\\' in path or path[-1] == '/' or path.strip() != path:\n\t\treturn False\n\treturn True", "entry_point": "validate_dbpath", "input": "'abc'", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "darkwyrm/pymensago/pymensago/dbfs.py#validate_dbpath", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038088", "code": "def size_as_string(size: int) -> str:\n\tif size < 0:\n\t\tsize = 0\n\tsize_list = [\n\t\t(1_000_000_000_000_000, 'PB'),\n\t\t(1_000_000_000_000, 'TB'),\n\t\t(1_000_000_000, 'GB'),\n\t\t(1_000_000, 'MB'),\n\t\t(1_000, 'KB'),\n\t]\n\tfor size_pair in size_list:\n\t\tif size >= size_pair[0]:\n\t\t\treturn str(round(size / size_pair[0], 2)) + size_pair[1]\n\treturn str(size) + ' bytes'", "entry_point": "size_as_string", "input": "0", "output": "'0 bytes'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "darkwyrm/pymensago/pymensago/utils.py#size_as_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038089", "code": "def make_chunk(files, max_len):\n    file_chunk = []\n    chunk_length = 0\n    cont = True\n    while cont and len(files) > 0:\n        file = files.pop()\n        length = len(file) + 4  \n        chunk_length += length\n        if chunk_length > max_len:\n            files.append(file)  \n            cont = False\n        else:\n            file_chunk.append(file)\n    return file_chunk", "entry_point": "make_chunk", "input": "[], ['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "atlefren/skdata/cart.py#make_chunk", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038090", "code": "def _create_label_token_dict(labels, split_symbol='_'):\n        distinct_tokens = set([token\n                               for label in labels\n                               for token in label.split(split_symbol)])\n        return {token: idx\n                for idx, token in enumerate(sorted(distinct_tokens))}", "entry_point": "_create_label_token_dict", "input": "[], [-1, 0, 1, 2]", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "LaudateCorpus1/rasa_core/rasa/core/featurizers.py#_create_label_token_dict", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038091", "code": "def mix_count(count, num):\n    return [i for x in range(num) for i in range(x, count, num)]", "entry_point": "mix_count", "input": "-3, 7", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "arslnjmn/port-scanner-detector-python/PortSDEvader.py#mix_count", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038092", "code": "def update(rules):\n    rules[\"8\"] = \"42 | 42 8\"\n    rules[\"11\"] = \"42 31 | 42 11 31\"\n    return rules", "entry_point": "update", "input": "{'x': [1, 2], 'y': []}", "output": "{'x': [1, 2], 'y': [], '8': '42 | 42 8', '11': '42 31 | 42 11 31'}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "soerenbnoergaard/adventofcode2020/day19/puzzle2.py#update", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038093", "code": "def verify_list(list1, list2):\n    return all(elem in list1 for elem in list2)", "entry_point": "verify_list", "input": "[], ['apple', 'banana', 'cherry']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Alienbushman/Basic_mathematics/restful_api.py#verify_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038094", "code": "def adding_one(integer_one):\n    return integer_one + 1", "entry_point": "adding_one", "input": "2.0", "output": "3.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Alienbushman/Basic_mathematics/basic_math.py#adding_one", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038095", "code": "def isOdd(x):\n    return x % 2 == 1", "entry_point": "isOdd", "input": "True", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "MarcDcls/OpenDogV2/Project/ray_casting_algorithm.py#isOdd", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038096", "code": "def uint_double(k):\n    return 2*k", "entry_point": "uint_double", "input": "['a', 'b', 'c']", "output": "['a', 'b', 'c', 'a', 'b', 'c']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "Martin-Seysen/mmgroup_miniproject/src/miniproject/dev/double_function/mini_double_ref.py#uint_double", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038097", "code": "def clean_from_refs(text):\n    text = text.replace('\\r\\n', ' ')\n    if '[' in text:\n        position = text.find('[')\n        if position > 0:\n            text = text[:position]\n    return text", "entry_point": "clean_from_refs", "input": "'  padded  '", "output": "'  padded  '", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "dpol2000/tbsa/get_data.py#clean_from_refs", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038098", "code": "def is_cover(writers_string):\n    if 'Traditional' in writers_string:\n        return True\n    for writer in  ('Lennon', 'McCartney', 'Harrison', 'Starkey'):\n        if writer in writers_string:\n            return False\n    return True", "entry_point": "is_cover", "input": "''", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "dpol2000/tbsa/get_data.py#is_cover", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038099", "code": "def _filter_results(results, system_elements):\n    results_filtered = {}\n    for key in results.keys():\n        if key in system_elements:\n            results_filtered[key] = results[key]\n    return results_filtered", "entry_point": "_filter_results", "input": "{'a': 1, 'b': 2}, set()", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "t16h05008/SysDynPy/sysdynpy/exporter.py#_filter_results", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038100", "code": "def normalizeString(string):\n\ttry:\n\t\tif string.isspace():\t\n\t\t\treturn\n\texcept:\n\t\treturn\n\tlines = string.splitlines()\n\tstripEmptyLines = True\n\tfor i in range(len(lines)-1, -1, -1):\n\t\tlines[i] = lines[i].strip()\n\t\tif len(lines[i]) == 0:\n\t\t\tif stripEmptyLines:\n\t\t\t\tdel lines[i]\n\t\t\tstripEmptyLines = True\n\t\telse:\n\t\t\tstripEmptyLines = False\n\twhile len(lines) > 0 and len(lines[0]) == 0:\n\t\tdel lines[0]\n\treturn \"\\n\".join(lines)", "entry_point": "normalizeString", "input": "'AbC dEf'", "output": "'AbC dEf'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "nhuebbe/curriculum/modeling/visualization/skillTreeConversion/skill.py#normalizeString", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038101", "code": "def simplifyString(string: str) -> str:\n\t\t\tresult = string.lower()\n\t\t\tfor i in range(len(result)):\n\t\t\t\tif not result[i].isalnum():\n\t\t\t\t\tresult = result[:i] + \"-\" + result[i+1:]\n\t\t\treturn result", "entry_point": "simplifyString", "input": "'Hello World'", "output": "'hello-world'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "nhuebbe/curriculum/modeling/visualization/skillTreeConversion/skillList.py#simplifyString", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038102", "code": "def format_to_iso(date_string):\n    if len(date_string) > 19 and not date_string.endswith('Z'):\n        date_string = date_string[:-6]\n    if not date_string.endswith('Z'):\n        date_string = date_string + 'Z'\n    return date_string", "entry_point": "format_to_iso", "input": "'walnut thistle harbour'", "output": "'walnut thistle hZ'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "aescalona-doitt/content/Integrations/Elasticsearch_v2/Elasticsearch_v2.py#format_to_iso", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038103", "code": "def sectionize(parts, first_is_heading=False):\n    parts = parts.copy()\n    if len(parts) <= 1:\n        return parts\n    first = []\n    if not first_is_heading:\n        first.append(parts[0])\n        del parts[0]\n    sections = first + [ \"\\n\".join(parts[i:i+2]) for i in range(0, len(parts), 2) ]\n    return sections", "entry_point": "sectionize", "input": "[], [1, 2, 3]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sztal/taukit/taukit/webscraping/utils.py#sectionize", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038104", "code": "def strip(x):\n    if isinstance(x, str):\n        return x.strip()\n    return x", "entry_point": "strip", "input": "['apple', 'banana', 'cherry']", "output": "['apple', 'banana', 'cherry']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "sztal/taukit/taukit/webscraping/utils.py#strip", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038105", "code": "def _capture_metadata(n_frames, dropped_frames=None):\n    if dropped_frames is None:\n        dropped_frames = [[] for i in range(len(n_frames))]\n    capture_info = {\"Frame Counts\": {}}\n    for cam_idx, n in enumerate(n_frames):\n        frames_dict = {}\n        current_frame = 0\n        for i in range(n):\n            while current_frame in dropped_frames[cam_idx]:\n                current_frame += 1\n            frames_dict[str(i)] = current_frame\n            current_frame += 1\n        capture_info[\"Frame Counts\"][str(cam_idx)] = frames_dict\n    return capture_info", "entry_point": "_capture_metadata", "input": "[], ['apple', 'banana', 'cherry']", "output": "{'Frame Counts': {}}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "NeLy-EPFL/utils2p/utils2p/synchronization.py#_capture_metadata", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038106", "code": "def date_range_length(datetime_index, periods=None):\n    length = len(datetime_index)\n    return length if periods else length - 1", "entry_point": "date_range_length", "input": "{'a': 1, 'b': 2}, {1, 2, 3}", "output": "2", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "JustasZaltauskas/Trader/trader/core/utils/date_utils.py#date_range_length", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038107", "code": "def common_prefix(paths):\n    parts = [p.split(\"/\") for p in paths]\n    lmax = min(len(p) for p in parts)\n    end = 0\n    for i in range(lmax):\n        end = all(p[i] == parts[0][i] for p in parts)\n        if not end:\n            break\n    i += end\n    return \"/\".join(parts[0][:i])", "entry_point": "common_prefix", "input": "'  padded  '", "output": "''", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "JinrongGuo1/filesystem_spec/fsspec/utils.py#common_prefix", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038108", "code": "def _polymod(values):\n    c = 1\n    for d in values:\n        c0 = c >> 35\n        c = ((c & 0x07ffffffff) << 5) ^ d\n        if (c0 & 0x01):\n            c ^= 0x98f2bc8e61\n        if (c0 & 0x02):\n            c ^= 0x79b76d99e2\n        if (c0 & 0x04):\n            c ^= 0xf33e5fb3c4\n        if (c0 & 0x08):\n            c ^= 0xae2eabe2a8\n        if (c0 & 0x10):\n            c ^= 0x1e4f43e470\n    retval = c ^ 1\n    return retval", "entry_point": "_polymod", "input": "[1, 2, 3]", "output": "33858", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "thonkle/bitcoin-abc/test/functional/test_framework/cashaddr.py#_polymod", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038109", "code": "def Min_Max(normalization_parameter, file_dataframe):\n    normalization_parameter_result = []\n    for i in normalization_parameter:\n        par = file_dataframe[i].tolist()\n        Max_par = max(par)\n        Min_par = min(par)\n        div = Max_par - Min_par\n        if div == 0:\n            if Max_par == 0:\n                norm = par\n            else:\n                norm = [j / Max_par for j in par]\n        else:\n            norm = [round((j - Min_par) / div, 6) for j in par]\n        normalization_parameter_result.append(norm)\n    for j in range(len(normalization_parameter)):\n        norm_name = normalization_parameter[j] + '_norm'\n        file_dataframe[norm_name] = normalization_parameter_result[j]\n    return file_dataframe", "entry_point": "Min_Max", "input": "set(), {'a': 1, 'b': 2}", "output": "{'a': 1, 'b': 2}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "PrideLee/CCFDF-Personalized-Matching-Model-of-Packages-for-Telecom-Users/code/log_norm.py#Min_Max", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038110", "code": "def split_comma_list(comma_str: str):\n    return [item.strip() for item in comma_str.split(',')]", "entry_point": "split_comma_list", "input": "'abc'", "output": "['abc']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "mbari-org/vars-localize/util/utils.py#split_comma_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038111", "code": "def HammingDistance(s1, s2):\n    assert len(s1) == len(s2)\n    return sum(c1 != c2 for c1, c2 in zip(s1, s2))", "entry_point": "HammingDistance", "input": "['apple', 'banana', 'cherry'], ['a', 'b', 'c']", "output": "3", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "johnchen93/MetaSSN/Python_script_tools/helper.py#HammingDistance", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038112", "code": "def Differences(s1, s2):\n    assert len(s1) == len(s2) \n    return [c1 != c2 for c1, c2 in zip(s1, s2)]", "entry_point": "Differences", "input": "['apple', 'banana', 'cherry'], [[1, 2], [3], []]", "output": "[True, True, True]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "johnchen93/MetaSSN/Python_script_tools/helper.py#Differences", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038113", "code": "def CodonDifferences(s1, s2):\n    assert len(s1) == len(s2)\n    return [s1[i:i+3] != s2[i:i+3] for i in range(0, len(s1),3)]", "entry_point": "CodonDifferences", "input": "[-1, 0, 1, 2], [5, 3, 1, 4]", "output": "[True, True]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "johnchen93/MetaSSN/Python_script_tools/helper.py#CodonDifferences", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038114", "code": "def reset_hidden(hidden, mask):\n            if len(mask) != 0:\n                hidden[:, mask, :] = 0\n            return hidden", "entry_point": "reset_hidden", "input": "[-1, 0, 1, 2], []", "output": "[-1, 0, 1, 2]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "hanjialiang/DeepRec/modules/model.py#reset_hidden", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038115", "code": "def _check(d: dict) -> bool:\n        return all((\n            'command' in d and isinstance(d[\"command\"], str),\n            \"timeout\" not in d or isinstance(d[\"timeout\"], (int, float)),\n        ))", "entry_point": "_check", "input": "{'a': 1, 'b': 2}", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "PremierLangage/sandbox/sandbox/executor.py#_check", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038116", "code": "def format_req_str(req) -> str:\n    res = str(req).strip()\n    if res.startswith(\"-e git+git@\"):\n        res = res.replace(\"-e git+git@\", \"-e git+ssh://git@\")\n    return res", "entry_point": "format_req_str", "input": "[[1, 2], [3], []]", "output": "'[[1, 2], [3], []]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "jnoortheen/pipm/pipm/file.py#format_req_str", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038117", "code": "def _get_bootstrap_samples_from_indices(data, bootstrap_indices):\n    out = [data.iloc[idx] for idx in bootstrap_indices]\n    return out", "entry_point": "_get_bootstrap_samples_from_indices", "input": "[1, 2, 3], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "PaulBehler/estimagic/src/estimagic/inference/bootstrap_samples.py#_get_bootstrap_samples_from_indices", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038118", "code": "def _reshape_list_to_2d(list_to_reshape, shapes):\n    if len(list_to_reshape) != len(shapes):\n        raise ValueError(\"Arguments must have the same number of elements.\")\n    reshaped = [a.reshape(shape) for a, shape in zip(list_to_reshape, shapes)]\n    return reshaped", "entry_point": "_reshape_list_to_2d", "input": "(), {}", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "PaulBehler/estimagic/src/estimagic/parameters/block_trees.py#_reshape_list_to_2d", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038119", "code": "def doPackageHacks(packageName, locale):\n    if packageName == \"tor-browser-bundle\" \\\n           or packageName == \"tor-im-browser-bundle\" \\\n           or packageName == \"linux-browser-bundle-i386\" \\\n           or packageName == \"linux-browser-bundle-x86_64\":\n        packageName += \"_\" + locale\n    return packageName", "entry_point": "doPackageHacks", "input": "'walnut thistle harbour', [-1, 0, 1, 2]", "output": "'walnut thistle harbour'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "kaner/gettor/lib/gettor/filters.py#doPackageHacks", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038120", "code": "def erat(n):\n    if n < 2:\n        return []\n    arr = list(range(n + 1))\n    arr[0] = arr[1] = None\n    i = 2\n    while i * i <= n:\n        for p in range(i * i, n + 1, i):\n            arr[p] = None\n        i += 1\n        while i <= n and arr[i] is None:\n            i += 1\n    return list(filter(None, arr))", "entry_point": "erat", "input": "False", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "kkmonlee/cool_primes/src/cool_primes/sieves.py#erat", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038121", "code": "def cmd_string(ctx, val):\n\treturn str(val)", "entry_point": "cmd_string", "input": "[], [[1, 2], [3], []]", "output": "'[[1, 2], [3], []]'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "mrunmay-epi/bbscript/bbscript/stdlib/convertions.py#cmd_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038122", "code": "def cmd_bool(ctx, val):\n\treturn bool(val)", "entry_point": "cmd_bool", "input": "[], []", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "mrunmay-epi/bbscript/bbscript/stdlib/convertions.py#cmd_bool", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038123", "code": "def cmd_set(ctx, var, value):\n\tctx.update({\"${}\".format(var): value})\n\treturn value", "entry_point": "cmd_set", "input": "{1, 2, 3}, {'a': 1, 'b': 2}, {1, 2, 3}", "output": "{1, 2, 3}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "mrunmay-epi/bbscript/bbscript/stdlib/values.py#cmd_set", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038124", "code": "def extract_pairs_from_lines(lines):\n    collected_pairs = []\n    for i in range(len(lines) - 1):\n        first_line = lines[i].strip()\n        second_line = lines[i+1].strip()\n        if first_line and second_line:\n            collected_pairs.append([first_line, second_line])\n    return collected_pairs", "entry_point": "extract_pairs_from_lines", "input": "'abc'", "output": "[['a', 'b'], ['b', 'c']]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "korymath/JANN/Jann/utils.py#extract_pairs_from_lines", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038125", "code": "def emit_check_no_requires_grad(tensor_args, args_with_derivatives):\n        body = []\n        for arg in tensor_args:\n            if arg in args_with_derivatives:\n                continue\n            name = arg['name']\n            if name == 'output':\n                continue\n            if arg['dynamic_type'] in {'IndexTensor', 'BoolTensor'}:\n                continue\n            body.append('check_no_requires_grad({}, \"{}\");'.format(name, name))\n        return body", "entry_point": "emit_check_no_requires_grad", "input": "['a', 'b', 'c'], ['a', 'b', 'c']", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "DavidKo3/mctorch/tools/autograd/gen_variable_type.py#emit_check_no_requires_grad", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038126", "code": "def _get_color_list(n_sets):\n    color_list = ['#1a9850', '#f46d43', '#762a83', '#41b6c4',\n                  '#ffff33', '#a50026', '#dd3497', '#ffffff',\n                  '#36454f', '#081d58', '#d9ef8b', '#fee08b']\n    return color_list[:n_sets]", "entry_point": "_get_color_list", "input": "True", "output": "['#1a9850']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "XinyiGong/pymks/pymks/tools.py#_get_color_list", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038127", "code": "def num_or_string(v, d=None):\n  try:\n    return int(str(v))\n  except (ValueError, TypeError):\n    try:\n      _value = float(str(v).replace(',', '.'))\n      if _value == 0:\n        return 0\n      return _value\n    except (ValueError, TypeError):\n      pass\n  return d or v", "entry_point": "num_or_string", "input": "[], []", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "tusharlock10/hirez-api-docs/.web/utils/__init__.py#num_or_string", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038128", "code": "def fibonacci(length, a, b):\n    if length == 1:\n        return (a,)\n    if length == 2:\n        return (a, b)\n    first = (a,)\n    second = (a, b)\n    while True:\n        next = second + first\n        if len(next) >= length:\n            return next[0:length]\n        first = second\n        second = next", "entry_point": "fibonacci", "input": "2, [[1, 2], [3], []], [5, 3, 1, 4]", "output": "([[1, 2], [3], []], [5, 3, 1, 4])", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "tpudlik/aperiodic/dnls.py#fibonacci", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038129", "code": "def is_int(string):\n    try: \n        int(string)\n        return True\n    except ValueError:\n        return False", "entry_point": "is_int", "input": "''", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "duttondj/satsolve/satsolve.py#is_int", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038130", "code": "def center_value(obj, stat_or_name):\n    obj_length = len(str(obj))\n    amount_of_maxium_spaces = 21 if stat_or_name != 'stat' else 4\n    amount_of_avaliable_spaces = amount_of_maxium_spaces - obj_length\n    centered_obj = f\"{amount_of_avaliable_spaces * ' '}{obj}\"\n    return centered_obj", "entry_point": "center_value", "input": "['a', 'b', 'c'], 'abc'", "output": "\"      ['a', 'b', 'c']\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "adammank/Fighter_Researcher/app/utilities/utilities.py#center_value", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038131", "code": "def parse_predict_result(predictions, seq_lens, label_map):\n    pred_tag = []\n    for idx, pred in enumerate(predictions):\n        seq_len = seq_lens[idx]\n        tag = [label_map[i] for i in pred[1:seq_len - 1]]\n        pred_tag.append(tag)\n    return pred_tag", "entry_point": "parse_predict_result", "input": "{'x': [1, 2], 'y': []}, [5, 3, 1, 4], {'x': [1, 2], 'y': []}", "output": "[[], []]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "d294270681/PaddleNLP/examples/sentiment_analysis/skep/predict_opinion.py#parse_predict_result", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038132", "code": "def clean_up_tokenization(out_string):\n        out_string = (out_string.replace(\" .\", \".\").replace(\" ?\", \"?\")\n                      .replace(\" !\", \"!\").replace(\" ,\", \",\").replace(\" ' \", \"'\")\n                      .replace(\" n't\", \"n't\").replace(\" 'm\", \"'m\")\n                      .replace(\" 's\", \"'s\").replace(\" 've\", \"'ve\")\n                      .replace(\" 're\", \"'re\"))\n        return out_string", "entry_point": "clean_up_tokenization", "input": "'Hello World'", "output": "'Hello World'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "d294270681/PaddleNLP/paddlenlp/transformers/t5/tokenizer.py#clean_up_tokenization", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038133", "code": "def Trans_List(G):\n    GT = {}\n    for u in G:\n        GT[u] = []\n    for u in G:\n        for v in G[u]:\n            GT[v].append(u)\n    return GT", "entry_point": "Trans_List", "input": "[]", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "tasselcui/misc/Graph.py#Trans_List", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038134", "code": "def header(aggregation_tag=False):\n        return (\"Average \" if aggregation_tag else \"\") + \"GPU Power Usage (W)\"", "entry_point": "header", "input": "['apple', 'banana', 'cherry']", "output": "'Average GPU Power Usage (W)'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "triton-inference-server/model_analyzer/model_analyzer/record/types/gpu_power_usage.py#header", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038135", "code": "def header(aggregation_tag=False):\n        return (\"Max \" if aggregation_tag else \"\") + \"GPU Memory Usage (MB)\"", "entry_point": "header", "input": "[[1, 2], [3], []]", "output": "'Max GPU Memory Usage (MB)'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "triton-inference-server/model_analyzer/model_analyzer/record/types/gpu_used_memory.py#header", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038136", "code": "def _remove_duplicates(values):\n    output = []\n    seen = set()\n    for value in values:\n        if value not in seen:\n            output.append(value)\n            seen.add(value)\n    return output", "entry_point": "_remove_duplicates", "input": "[1, 2, 3]", "output": "[1, 2, 3]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "oceanzus/ooi-ui-services/ooiservices/app/uframe/assetController.py#_remove_duplicates", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038137", "code": "def convert_date_time(date, time=None):\n    if time is None:\n        return date\n    else:\n        return \"%s %s\" % (date, time)", "entry_point": "convert_date_time", "input": "['a', 'b', 'c'], [5, 3, 1, 4]", "output": "\"['a', 'b', 'c'] [5, 3, 1, 4]\"", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "oceanzus/ooi-ui-services/ooiservices/app/uframe/assetController.py#convert_date_time", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038138", "code": "def _mask_by_gradient(refpt, neighbor_set, valuemask):\n    return set([i for i in neighbor_set if valuemask[i]<valuemask[refpt]])", "entry_point": "_mask_by_gradient", "input": "[1, 2, 3], set(), [[1, 2], [3], []]", "output": "set()", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "helloTC/ATT/algorithm/surf_tools.py#_mask_by_gradient", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038139", "code": "def commandline_fluff(commandline):\n    cmd_args = commandline\n    cmd_args.extend(\n        [\"--some-path=~/some_path\", \"--home-path=~\", \"~/../folder/.hidden/folder\"]\n    )\n    return cmd_args", "entry_point": "commandline_fluff", "input": "[5, 3, 1, 4]", "output": "[5, 3, 1, 4, '--some-path=~/some_path', '--home-path=~', '~/../folder/.hidden/folder']", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "abergeron/orion/tests/unittests/core/io/test_orion_cmdline_parser.py#commandline_fluff", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038140", "code": "def build_transform(dim, type_requirement, dist_requirement):\n    return []", "entry_point": "build_transform", "input": "[[1, 2], [3], []], [1, 2, 3], [5, 3, 1, 4]", "output": "[]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "abergeron/orion/src/orion/core/worker/transformer.py#build_transform", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038141", "code": "def burnup_label(burn_steps, cooling_ints):\n    num_cases = len(burn_steps)\n    steps_per_case = len(cooling_ints) + 2\n    burnup_list = [0, ]\n    for case in range(0, num_cases):\n        for step in range(0, steps_per_case):\n            if (case == 0 and step == 0):\n                continue\n            elif (case > 0 and step == 0):\n                burn_step = burn_steps[case-1]\n                burnup_list.append(burn_step)\n            else:\n                burn_step = burn_steps[case]\n                burnup_list.append(burn_step)\n    return burnup_list", "entry_point": "burnup_label", "input": "[-1, 0, 1, 2], [-1, 0, 1, 2]", "output": "[0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "opotowsky/learn-me-fuel/old_scripts/basicML.py#burnup_label", "provenance_class": "collected", "licence": "bsd-3-clause"}
{"id": "the_vault/0038142", "code": "def hill_eq(hill_constants, x):\n    upper, lower, EC50, hillslope = hill_constants\n    y = upper + (lower-upper)/(1+(x/EC50)**-hillslope)\n    return y", "entry_point": "hill_eq", "input": "[5, 3, 1, 4], True", "output": "4.0", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "ricardo-ayres/eccpy/eccpy/tools.py#hill_eq", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038143", "code": "def fmt_float(title, num, sep):\n    try:\n        if num != 0.0:\n            val = title + \"{:+06.1f}\".format(num) + sep\n        else:\n            val = ''\n    except Exception:\n        val = '???' + sep\n    return val", "entry_point": "fmt_float", "input": "[-1, 0, 1, 2], 10, 'AbC dEf'", "output": "'???AbC dEf'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "fab672000/dcm_transform/source/dcm_transform.py#fmt_float", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038144", "code": "def lin(val):\n    return 10 ** (val / 20)", "entry_point": "lin", "input": "True", "output": "1.1220184543019633", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "DavidHeresy/regelungstechnik/regelungstechnik.py#lin", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038145", "code": "def theLoveLetter(s):\n    alphabets = 'abcdefghijklmnopqrstuvwxyz'\n    l = len(s) \n    str1 = s[:l//2]\n    str2 = s[l//2 if l % 2 == 0 else l//2 + 1:]\n    if s == s[::-1]: \n        return 0\n    part1 = 0\n    part2 = 0\n    for i in range(1,len(str1)+1):\n        if str1[i-1] != str2[len(str2)-i]:\n            if alphabets.find(str1[i-1]) < alphabets.find(str2[len(str2)-i]):\n                part1 += (alphabets.find(str2[len(str2)-i]) - alphabets.find(str1[i-1]) )\n            else:\n                part2 += (alphabets.find(str1[i-1]) - alphabets.find(str2[len(str2)-i]))\n    return part1+part2", "entry_point": "theLoveLetter", "input": "['a', 'b', 'c']", "output": "2", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "muteshi/love-letter-mystery/love.py#theLoveLetter", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038146", "code": "def _is_valid_password(password):\n    if password is None or len(password) == 0:\n        return False\n    return True", "entry_point": "_is_valid_password", "input": "'Hello World'", "output": "True", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "XavierAraujo/pygeek-stellar/pygeek_stellar/utils/file.py#_is_valid_password", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038147", "code": "def is_float_str(string):\n    try:\n        float(string)\n        return True\n    except ValueError:\n        return False", "entry_point": "is_float_str", "input": "'a,b,c'", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "XavierAraujo/pygeek-stellar/pygeek_stellar/utils/generic.py#is_float_str", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038148", "code": "def is_int_str(string):\n    try:\n        int(string)\n        return True\n    except ValueError:\n        return False", "entry_point": "is_int_str", "input": "'  padded  '", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "XavierAraujo/pygeek-stellar/pygeek_stellar/utils/generic.py#is_int_str", "provenance_class": "collected", "licence": "mit"}
{"id": "the_vault/0038149", "code": "def NamedPlaceholders(iterable):\n  placeholders = \", \".join(\"%({})s\".format(key) for key in sorted(iterable))\n  return \"({})\".format(placeholders)", "entry_point": "NamedPlaceholders", "input": "[1, 2, 3]", "output": "'(%(1)s, %(2)s, %(3)s)'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "4ndygu/grr/grr/server/grr_response_server/databases/mysql_utils.py#NamedPlaceholders", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038150", "code": "def Columns(iterable):\n  return \"({})\".format(\", \".join(sorted(iterable)))", "entry_point": "Columns", "input": "[]", "output": "'()'", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "4ndygu/grr/grr/server/grr_response_server/databases/mysql_utils.py#Columns", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038151", "code": "def Trim(lst, limit):\n  limit = max(0, limit)\n  clipping = lst[limit:]\n  del lst[limit:]\n  return clipping", "entry_point": "Trim", "input": "[5, 3, 1, 4], 0", "output": "[5, 3, 1, 4]", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "4ndygu/grr/grr/core/grr_response_core/lib/util/collection.py#Trim", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038152", "code": "def Group(items, key):\n  result = {}\n  for item in items:\n    result.setdefault(key(item), []).append(item)\n  return result", "entry_point": "Group", "input": "[], [-1, 0, 1, 2]", "output": "{}", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "4ndygu/grr/grr/core/grr_response_core/lib/util/collection.py#Group", "provenance_class": "collected", "licence": "apache-2.0"}
{"id": "the_vault/0038153", "code": "def StartsWith(this, that):\n  this_iter = iter(this)\n  that_iter = iter(that)\n  while True:\n    try:\n      this_value = next(that_iter)\n    except StopIteration:\n      return True\n    try:\n      that_value = next(this_iter)\n    except StopIteration:\n      return False\n    if this_value != that_value:\n      return False", "entry_point": "StartsWith", "input": "[[1, 2], [3], []], ['a', 'b', 'c']", "output": "False", "source": "the_vault", "source_repo": "Fsoft-AIC/the-vault-function", "source_revision": "505c679056e49a2a269b64777ee7c496d22e1440", "source_file": "data/test/python-00000-of-00001.parquet", "source_id": "4ndygu/grr/grr/core/grr_response_core/lib/util/collection.py#StartsWith", "provenance_class": "collected", "licence": "apache-2.0"}
